summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am8
-rw-r--r--src/audio_out/Makefile.am108
-rw-r--r--src/audio_out/audio_arts_out.c418
-rwxr-xr-x[-rw-r--r--]src/audio_out/audio_directx_out.c0
-rw-r--r--src/audio_out/audio_pulse_out.c12
-rw-r--r--src/audio_out/audio_sun_out.c4
-rw-r--r--src/combined/Makefile.am57
-rw-r--r--src/combined/flac_decoder.c (renamed from src/combined/decoder_flac.c)29
-rw-r--r--src/combined/flac_demuxer.c (renamed from src/combined/demux_flac.c)2
-rw-r--r--src/combined/nsf_combined.c44
-rw-r--r--src/combined/nsf_combined.h (renamed from src/combined/demux_flac.h)22
-rw-r--r--src/combined/nsf_decoder.c (renamed from src/libxineadec/nsf.c)35
-rw-r--r--src/combined/nsf_demuxer.c (renamed from src/demuxers/demux_nsf.c)15
-rw-r--r--src/combined/wavpack_combined.c (renamed from src/combined/combined_wavpack.c)2
-rw-r--r--src/combined/wavpack_combined.h (renamed from src/combined/combined_wavpack.h)9
-rw-r--r--src/combined/wavpack_decoder.c (renamed from src/combined/decoder_wavpack.c)4
-rw-r--r--src/combined/wavpack_demuxer.c (renamed from src/combined/demux_wavpack.c)2
-rw-r--r--src/combined/xine_ogg_demuxer.c (renamed from src/demuxers/demux_ogg.c)29
-rw-r--r--src/combined/xine_speex_decoder.c (renamed from src/libxineadec/xine_speex_decoder.c)19
-rw-r--r--src/combined/xine_theora_decoder.c (renamed from src/libxinevdec/xine_theora_decoder.c)21
-rw-r--r--src/combined/xine_vorbis_decoder.c (renamed from src/libxineadec/xine_vorbis_decoder.c)14
-rw-r--r--src/demuxers/Makefile.am57
-rw-r--r--src/demuxers/asfheader.c2
-rw-r--r--src/demuxers/demux_asf.c6
-rw-r--r--src/demuxers/demux_aud.c2
-rw-r--r--src/demuxers/demux_film.c2
-rw-r--r--src/demuxers/demux_flac.c7
-rw-r--r--src/demuxers/demux_flv.c2
-rw-r--r--src/demuxers/demux_idcin.c5
-rw-r--r--src/demuxers/demux_matroska.c11
-rw-r--r--src/demuxers/demux_mod.c14
-rw-r--r--src/demuxers/demux_mpgaudio.c4
-rw-r--r--src/demuxers/demux_qt.c337
-rw-r--r--src/demuxers/demux_real.c4
-rw-r--r--src/demuxers/demux_realaudio.c2
-rw-r--r--src/demuxers/demux_ts.c5
-rw-r--r--src/demuxers/demux_tta.c13
-rw-r--r--src/demuxers/demux_wc3movie.c8
-rw-r--r--src/demuxers/group_audio.c14
-rw-r--r--src/demuxers/group_audio.h5
-rw-r--r--src/demuxers/id3.c8
-rw-r--r--src/demuxers/id3.h8
-rw-r--r--src/dxr3/Makefile.am39
-rw-r--r--src/input/Makefile.am99
-rw-r--r--src/input/dvb/Makefile.am5
-rw-r--r--src/input/dvb/dmx.h178
-rw-r--r--src/input/dvb/frontend.h277
-rw-r--r--src/input/input_cdda.c74
-rw-r--r--src/input/input_dvb.c82
-rw-r--r--src/input/input_dvd.c86
-rw-r--r--src/input/input_file.c35
-rw-r--r--src/input/input_gnome_vfs.c3
-rw-r--r--src/input/input_http.c48
-rw-r--r--src/input/input_mms.c17
-rw-r--r--src/input/input_net.c3
-rw-r--r--src/input/input_plugin.h2
-rw-r--r--src/input/input_pnm.c3
-rw-r--r--src/input/input_pvr.c3
-rw-r--r--src/input/input_rtp.c3
-rw-r--r--src/input/input_rtsp.c2
-rw-r--r--src/input/input_smb.c7
-rw-r--r--src/input/input_stdin_fifo.c3
-rw-r--r--src/input/input_v4l.c49
-rw-r--r--src/input/input_vcd.c9
-rw-r--r--src/input/libdvdnav/Makefile.am6
-rw-r--r--src/input/libdvdnav/diff_against_cvs.patch33
-rw-r--r--src/input/libdvdnav/ifo_types.h22
-rw-r--r--src/input/libreal/Makefile.am19
-rw-r--r--src/input/libreal/real.c2
-rw-r--r--src/input/librtsp/Makefile.am16
-rw-r--r--src/input/vcd/Makefile.am31
-rw-r--r--src/input/vcd/libcdio/FreeBSD/freebsd.c638
-rw-r--r--src/input/vcd/libcdio/FreeBSD/freebsd.h232
-rw-r--r--src/input/vcd/libcdio/FreeBSD/freebsd_cam.c346
-rw-r--r--src/input/vcd/libcdio/FreeBSD/freebsd_ioctl.c267
-rw-r--r--src/input/vcd/libcdio/MSWindows/Makefile.am3
-rw-r--r--src/input/vcd/libcdio/MSWindows/aspi32.c805
-rw-r--r--src/input/vcd/libcdio/MSWindows/aspi32.h249
-rw-r--r--src/input/vcd/libcdio/MSWindows/win32.c805
-rw-r--r--src/input/vcd/libcdio/MSWindows/win32.h170
-rw-r--r--src/input/vcd/libcdio/MSWindows/win32_ioctl.c739
-rw-r--r--src/input/vcd/libcdio/Makefile.am70
-rw-r--r--src/input/vcd/libcdio/_cdio_bsdi.c846
-rw-r--r--src/input/vcd/libcdio/_cdio_generic.c426
-rw-r--r--src/input/vcd/libcdio/_cdio_osx.c1470
-rw-r--r--src/input/vcd/libcdio/_cdio_stdio.c222
-rw-r--r--src/input/vcd/libcdio/_cdio_stdio.h52
-rw-r--r--src/input/vcd/libcdio/_cdio_stream.c200
-rw-r--r--src/input/vcd/libcdio/_cdio_stream.h127
-rw-r--r--src/input/vcd/libcdio/_cdio_sunos.c917
-rw-r--r--src/input/vcd/libcdio/cd_types.c358
-rw-r--r--src/input/vcd/libcdio/cdio.c1125
-rw-r--r--src/input/vcd/libcdio/cdio/Makefile.am19
-rw-r--r--src/input/vcd/libcdio/cdio/bytesex.h196
-rw-r--r--src/input/vcd/libcdio/cdio/bytesex_asm.h123
-rw-r--r--src/input/vcd/libcdio/cdio/cd_types.h155
-rw-r--r--src/input/vcd/libcdio/cdio/cdio.h980
-rw-r--r--src/input/vcd/libcdio/cdio/cdtext.h108
-rw-r--r--src/input/vcd/libcdio/cdio/ds.h73
-rw-r--r--src/input/vcd/libcdio/cdio/dvd.h113
-rw-r--r--src/input/vcd/libcdio/cdio/iso9660.h786
-rw-r--r--src/input/vcd/libcdio/cdio/logging.h137
-rw-r--r--src/input/vcd/libcdio/cdio/scsi_mmc.h415
-rw-r--r--src/input/vcd/libcdio/cdio/sector.h326
-rw-r--r--src/input/vcd/libcdio/cdio/types.h379
-rw-r--r--src/input/vcd/libcdio/cdio/util.h136
-rw-r--r--src/input/vcd/libcdio/cdio/version.h10
-rw-r--r--src/input/vcd/libcdio/cdio/xa.h151
-rw-r--r--src/input/vcd/libcdio/cdio_assert.h59
-rw-r--r--src/input/vcd/libcdio/cdio_private.h315
-rw-r--r--src/input/vcd/libcdio/cdtext.c228
-rw-r--r--src/input/vcd/libcdio/cdtext_private.h119
-rw-r--r--src/input/vcd/libcdio/ds.c249
-rw-r--r--src/input/vcd/libcdio/generic.h179
-rw-r--r--src/input/vcd/libcdio/image.h75
-rw-r--r--src/input/vcd/libcdio/image/Makefile.am3
-rw-r--r--src/input/vcd/libcdio/image/bincue.c1214
-rw-r--r--src/input/vcd/libcdio/image/cdrdao.c1198
-rw-r--r--src/input/vcd/libcdio/image/nrg.c1274
-rw-r--r--src/input/vcd/libcdio/image/nrg.h115
-rw-r--r--src/input/vcd/libcdio/image_common.h225
-rw-r--r--src/input/vcd/libcdio/iso9660.c1007
-rw-r--r--src/input/vcd/libcdio/iso9660_fs.c1260
-rw-r--r--src/input/vcd/libcdio/iso9660_private.h85
-rw-r--r--src/input/vcd/libcdio/logging.c142
-rw-r--r--src/input/vcd/libcdio/portable.h74
-rw-r--r--src/input/vcd/libcdio/scsi_mmc.c589
-rw-r--r--src/input/vcd/libcdio/scsi_mmc.h63
-rw-r--r--src/input/vcd/libcdio/scsi_mmc_private.h105
-rw-r--r--src/input/vcd/libcdio/sector.c289
-rw-r--r--src/input/vcd/libcdio/util.c197
-rw-r--r--src/input/vcd/libcdio/xa.c136
-rw-r--r--src/input/vcd/libvcd/Makefile.am66
-rw-r--r--src/input/vcd/libvcd/bitvec.h131
-rw-r--r--src/input/vcd/libvcd/bytesex.h145
-rw-r--r--src/input/vcd/libvcd/bytesex_asm.h123
-rw-r--r--src/input/vcd/libvcd/data_structures.c342
-rw-r--r--src/input/vcd/libvcd/data_structures.h92
-rw-r--r--src/input/vcd/libvcd/dict.h165
-rw-r--r--src/input/vcd/libvcd/directory.c507
-rw-r--r--src/input/vcd/libvcd/directory.h64
-rw-r--r--src/input/vcd/libvcd/files.c1020
-rw-r--r--src/input/vcd/libvcd/image.c108
-rw-r--r--src/input/vcd/libvcd/image_bincue.c259
-rw-r--r--src/input/vcd/libvcd/image_cdrdao.c313
-rw-r--r--src/input/vcd/libvcd/image_nrg.c352
-rw-r--r--src/input/vcd/libvcd/image_sink.h80
-rw-r--r--src/input/vcd/libvcd/inf.c531
-rw-r--r--src/input/vcd/libvcd/info.c2103
-rw-r--r--src/input/vcd/libvcd/info_private.c328
-rw-r--r--src/input/vcd/libvcd/info_private.h118
-rw-r--r--src/input/vcd/libvcd/libvcd/Makefile.am3
-rw-r--r--src/input/vcd/libvcd/libvcd/files.h101
-rw-r--r--src/input/vcd/libvcd/libvcd/files_private.h562
-rw-r--r--src/input/vcd/libvcd/libvcd/inf.h260
-rw-r--r--src/input/vcd/libvcd/libvcd/info.h860
-rw-r--r--src/input/vcd/libvcd/libvcd/logging.h137
-rw-r--r--src/input/vcd/libvcd/libvcd/sector.h118
-rw-r--r--src/input/vcd/libvcd/libvcd/types.h97
-rw-r--r--src/input/vcd/libvcd/libvcd/version.h11
-rw-r--r--src/input/vcd/libvcd/logging.c145
-rw-r--r--src/input/vcd/libvcd/mpeg.c1177
-rw-r--r--src/input/vcd/libvcd/mpeg.h194
-rw-r--r--src/input/vcd/libvcd/mpeg_stream.c487
-rw-r--r--src/input/vcd/libvcd/mpeg_stream.h116
-rw-r--r--src/input/vcd/libvcd/obj.h202
-rw-r--r--src/input/vcd/libvcd/pbc.c880
-rw-r--r--src/input/vcd/libvcd/pbc.h157
-rw-r--r--src/input/vcd/libvcd/salloc.c212
-rw-r--r--src/input/vcd/libvcd/salloc.h56
-rw-r--r--src/input/vcd/libvcd/sector.c268
-rw-r--r--src/input/vcd/libvcd/sector_private.h1348
-rw-r--r--src/input/vcd/libvcd/stream.c276
-rw-r--r--src/input/vcd/libvcd/stream.h123
-rw-r--r--src/input/vcd/libvcd/stream_stdio.c236
-rw-r--r--src/input/vcd/libvcd/stream_stdio.h43
-rw-r--r--src/input/vcd/libvcd/util.c179
-rw-r--r--src/input/vcd/libvcd/util.h108
-rw-r--r--src/input/vcd/libvcd/vcd.c2412
-rw-r--r--src/input/vcd/libvcd/vcd.h176
-rw-r--r--src/input/vcd/libvcd/vcd_assert.h55
-rw-r--r--src/input/vcd/libvcd/vcd_read.c108
-rw-r--r--src/input/vcd/libvcd/vcd_read.h36
-rw-r--r--src/input/vcd/xineplug_inp_vcd.c6
-rw-r--r--src/liba52/Makefile.am38
-rw-r--r--src/liba52/a52.h62
-rw-r--r--src/liba52/a52_internal.h121
-rw-r--r--src/liba52/bit_allocate.c265
-rw-r--r--src/liba52/bitstream.c95
-rw-r--r--src/liba52/bitstream.h81
-rw-r--r--src/liba52/crc.c73
-rw-r--r--src/liba52/diff_against_release.patch76
-rw-r--r--src/liba52/downmix.c655
-rw-r--r--src/liba52/imdct.c431
-rw-r--r--src/liba52/parse.c894
-rw-r--r--src/liba52/tables.h246
-rw-r--r--src/libdts/Makefile.am28
-rw-r--r--src/libdts/bitstream.c111
-rw-r--r--src/libdts/bitstream.h67
-rw-r--r--src/libdts/downmix.c691
-rw-r--r--src/libdts/dts_internal.h203
-rw-r--r--src/libdts/internal-dts.h85
-rw-r--r--src/libdts/parse.c1290
-rw-r--r--src/libdts/tables.h47
-rw-r--r--src/libdts/tables_adpcm.h4122
-rw-r--r--src/libdts/tables_fir.h2085
-rw-r--r--src/libdts/tables_huffman.h1070
-rw-r--r--src/libdts/tables_quantization.h88
-rw-r--r--src/libdts/tables_vq.h2075
-rw-r--r--src/libfaad/Makefile.am106
-rw-r--r--src/libfaad/analysis.h49
-rw-r--r--src/libfaad/bits.c213
-rw-r--r--src/libfaad/bits.h382
-rw-r--r--src/libfaad/cfft.c1004
-rw-r--r--src/libfaad/cfft.h53
-rw-r--r--src/libfaad/cfft_tab.h1820
-rw-r--r--src/libfaad/codebook/Makefile.am15
-rw-r--r--src/libfaad/codebook/hcb.h142
-rw-r--r--src/libfaad/codebook/hcb_1.h183
-rw-r--r--src/libfaad/codebook/hcb_10.h309
-rw-r--r--src/libfaad/codebook/hcb_11.h412
-rw-r--r--src/libfaad/codebook/hcb_2.h182
-rw-r--r--src/libfaad/codebook/hcb_3.h193
-rw-r--r--src/libfaad/codebook/hcb_4.h196
-rw-r--r--src/libfaad/codebook/hcb_5.h193
-rw-r--r--src/libfaad/codebook/hcb_6.h179
-rw-r--r--src/libfaad/codebook/hcb_7.h159
-rw-r--r--src/libfaad/codebook/hcb_8.h170
-rw-r--r--src/libfaad/codebook/hcb_9.h369
-rw-r--r--src/libfaad/codebook/hcb_sf.h273
-rw-r--r--src/libfaad/common.c519
-rw-r--r--src/libfaad/common.h426
-rw-r--r--src/libfaad/decoder.c1024
-rw-r--r--src/libfaad/decoder.h121
-rw-r--r--src/libfaad/diff_to_faad2_cvs.patch101
-rw-r--r--src/libfaad/drc.c170
-rw-r--r--src/libfaad/drc.h46
-rw-r--r--src/libfaad/drm_dec.c990
-rw-r--r--src/libfaad/drm_dec.h97
-rw-r--r--src/libfaad/error.c61
-rw-r--r--src/libfaad/error.h41
-rw-r--r--src/libfaad/faad.h217
-rw-r--r--src/libfaad/filtbank.c404
-rw-r--r--src/libfaad/filtbank.h58
-rw-r--r--src/libfaad/fixed.h265
-rw-r--r--src/libfaad/hcr.c409
-rw-r--r--src/libfaad/huffman.c556
-rw-r--r--src/libfaad/huffman.h44
-rw-r--r--src/libfaad/ic_predict.c267
-rw-r--r--src/libfaad/ic_predict.h249
-rw-r--r--src/libfaad/iq_table.h16455
-rw-r--r--src/libfaad/is.c106
-rw-r--r--src/libfaad/is.h64
-rw-r--r--src/libfaad/kbd_win.h2294
-rw-r--r--src/libfaad/lt_predict.c215
-rw-r--r--src/libfaad/lt_predict.h63
-rw-r--r--src/libfaad/mdct.c298
-rw-r--r--src/libfaad/mdct.h45
-rw-r--r--src/libfaad/mdct_tab.h3652
-rw-r--r--src/libfaad/mp4.c299
-rw-r--r--src/libfaad/mp4.h49
-rw-r--r--src/libfaad/ms.c74
-rw-r--r--src/libfaad/ms.h41
-rw-r--r--src/libfaad/output.c609
-rw-r--r--src/libfaad/output.h45
-rw-r--r--src/libfaad/pns.c265
-rw-r--r--src/libfaad/pns.h53
-rw-r--r--src/libfaad/ps_dec.c1977
-rw-r--r--src/libfaad/ps_dec.h148
-rw-r--r--src/libfaad/ps_syntax.c545
-rw-r--r--src/libfaad/ps_tables.h547
-rw-r--r--src/libfaad/pulse.c56
-rw-r--r--src/libfaad/pulse.h40
-rw-r--r--src/libfaad/rvlc.c530
-rw-r--r--src/libfaad/rvlc.h53
-rw-r--r--src/libfaad/sbr_dct.c2271
-rw-r--r--src/libfaad/sbr_dct.h49
-rw-r--r--src/libfaad/sbr_dec.c614
-rw-r--r--src/libfaad/sbr_dec.h249
-rw-r--r--src/libfaad/sbr_e_nf.c507
-rw-r--r--src/libfaad/sbr_e_nf.h47
-rw-r--r--src/libfaad/sbr_fbt.c761
-rw-r--r--src/libfaad/sbr_fbt.h52
-rw-r--r--src/libfaad/sbr_hfadj.c1720
-rw-r--r--src/libfaad/sbr_hfadj.h54
-rw-r--r--src/libfaad/sbr_hfgen.c666
-rw-r--r--src/libfaad/sbr_hfgen.h46
-rw-r--r--src/libfaad/sbr_huff.c357
-rw-r--r--src/libfaad/sbr_huff.h43
-rw-r--r--src/libfaad/sbr_noise.h561
-rw-r--r--src/libfaad/sbr_qmf.c633
-rw-r--r--src/libfaad/sbr_qmf.h52
-rw-r--r--src/libfaad/sbr_qmf_c.h365
-rw-r--r--src/libfaad/sbr_syntax.c871
-rw-r--r--src/libfaad/sbr_syntax.h64
-rw-r--r--src/libfaad/sbr_tf_grid.c258
-rw-r--r--src/libfaad/sbr_tf_grid.h44
-rw-r--r--src/libfaad/sine_win.h4301
-rw-r--r--src/libfaad/specrec.c1241
-rw-r--r--src/libfaad/specrec.h46
-rw-r--r--src/libfaad/ssr.c172
-rw-r--r--src/libfaad/ssr.h56
-rw-r--r--src/libfaad/ssr_fb.c182
-rw-r--r--src/libfaad/ssr_fb.h44
-rw-r--r--src/libfaad/ssr_ipqf.c188
-rw-r--r--src/libfaad/ssr_ipqf.h37
-rw-r--r--src/libfaad/ssr_win.h626
-rw-r--r--src/libfaad/structs.h473
-rw-r--r--src/libfaad/syntax.c2330
-rw-r--r--src/libfaad/syntax.h124
-rw-r--r--src/libfaad/tns.c306
-rw-r--r--src/libfaad/tns.h48
-rw-r--r--src/libffmpeg/Makefile.am65
-rw-r--r--src/libffmpeg/diff_to_ffmpeg_cvs.txt619
-rw-r--r--src/libffmpeg/ff_audio_decoder.c136
-rw-r--r--src/libffmpeg/ff_dvaudio_decoder.c12
-rw-r--r--src/libffmpeg/ff_video_decoder.c298
-rw-r--r--src/libffmpeg/ffmpeg_decoder.c271
-rw-r--r--src/libffmpeg/ffmpeg_decoder.h8
-rw-r--r--src/libffmpeg/ffmpeg_encoder.c6
-rw-r--r--src/libffmpeg/libavcodec/4xm.c759
-rw-r--r--src/libffmpeg/libavcodec/8bps.c236
-rw-r--r--src/libffmpeg/libavcodec/Makefile.am190
-rw-r--r--src/libffmpeg/libavcodec/aasc.c176
-rw-r--r--src/libffmpeg/libavcodec/adpcm.c1370
-rw-r--r--src/libffmpeg/libavcodec/adx.c412
-rw-r--r--src/libffmpeg/libavcodec/alac.c859
-rw-r--r--src/libffmpeg/libavcodec/alpha/Makefile.am13
-rw-r--r--src/libffmpeg/libavcodec/alpha/asm.h191
-rw-r--r--src/libffmpeg/libavcodec/alpha/dsputil_alpha.c362
-rw-r--r--src/libffmpeg/libavcodec/alpha/dsputil_alpha_asm.S285
-rw-r--r--src/libffmpeg/libavcodec/alpha/motion_est_alpha.c345
-rw-r--r--src/libffmpeg/libavcodec/alpha/motion_est_mvi_asm.S185
-rw-r--r--src/libffmpeg/libavcodec/alpha/mpegvideo_alpha.c147
-rw-r--r--src/libffmpeg/libavcodec/alpha/regdef.h66
-rw-r--r--src/libffmpeg/libavcodec/alpha/simple_idct_alpha.c308
-rw-r--r--src/libffmpeg/libavcodec/armv4l/Makefile.am23
-rw-r--r--src/libffmpeg/libavcodec/armv4l/dsputil_arm.c262
-rw-r--r--src/libffmpeg/libavcodec/armv4l/dsputil_arm_s.S696
-rw-r--r--src/libffmpeg/libavcodec/armv4l/dsputil_iwmmxt.c188
-rw-r--r--src/libffmpeg/libavcodec/armv4l/dsputil_iwmmxt_rnd.h1114
-rw-r--r--src/libffmpeg/libavcodec/armv4l/jrevdct_arm.S386
-rw-r--r--src/libffmpeg/libavcodec/armv4l/libavcodec_armv4l_dummy.c2
-rw-r--r--src/libffmpeg/libavcodec/armv4l/mathops.h49
-rw-r--r--src/libffmpeg/libavcodec/armv4l/mpegvideo_arm.c36
-rw-r--r--src/libffmpeg/libavcodec/armv4l/mpegvideo_armv5te.c213
-rw-r--r--src/libffmpeg/libavcodec/armv4l/mpegvideo_iwmmxt.c119
-rw-r--r--src/libffmpeg/libavcodec/armv4l/simple_idct_arm.S487
-rw-r--r--src/libffmpeg/libavcodec/armv4l/simple_idct_armv5te.S718
-rw-r--r--src/libffmpeg/libavcodec/asv1.c655
-rw-r--r--src/libffmpeg/libavcodec/avcodec.h2714
-rw-r--r--src/libffmpeg/libavcodec/avs.c160
-rw-r--r--src/libffmpeg/libavcodec/bitstream.c254
-rw-r--r--src/libffmpeg/libavcodec/bitstream.h956
-rw-r--r--src/libffmpeg/libavcodec/bytestream.h89
-rw-r--r--src/libffmpeg/libavcodec/cabac.c265
-rw-r--r--src/libffmpeg/libavcodec/cabac.h859
-rw-r--r--src/libffmpeg/libavcodec/cavs.c1540
-rw-r--r--src/libffmpeg/libavcodec/cavsdata.h643
-rw-r--r--src/libffmpeg/libavcodec/cinepak.c473
-rw-r--r--src/libffmpeg/libavcodec/cljr.c158
-rw-r--r--src/libffmpeg/libavcodec/cook.c1362
-rw-r--r--src/libffmpeg/libavcodec/cookdata.h559
-rw-r--r--src/libffmpeg/libavcodec/cscd.c264
-rw-r--r--src/libffmpeg/libavcodec/cyuv.c190
-rw-r--r--src/libffmpeg/libavcodec/dpcm.c335
-rw-r--r--src/libffmpeg/libavcodec/dsputil.c4176
-rw-r--r--src/libffmpeg/libavcodec/dsputil.h759
-rw-r--r--src/libffmpeg/libavcodec/dv.c1266
-rw-r--r--src/libffmpeg/libavcodec/dvdata.h2724
-rw-r--r--src/libffmpeg/libavcodec/error_resilience.c1030
-rw-r--r--src/libffmpeg/libavcodec/eval.c466
-rw-r--r--src/libffmpeg/libavcodec/eval.h84
-rw-r--r--src/libffmpeg/libavcodec/faandct.c220
-rw-r--r--src/libffmpeg/libavcodec/faandct.h33
-rw-r--r--src/libffmpeg/libavcodec/fastmemcpy.h4
-rw-r--r--src/libffmpeg/libavcodec/fdctref.c158
-rw-r--r--src/libffmpeg/libavcodec/fft.c262
-rw-r--r--src/libffmpeg/libavcodec/ffv1.c1040
-rw-r--r--src/libffmpeg/libavcodec/flac.c762
-rw-r--r--src/libffmpeg/libavcodec/flashsv.c260
-rw-r--r--src/libffmpeg/libavcodec/flicvideo.c754
-rw-r--r--src/libffmpeg/libavcodec/fraps.c398
-rw-r--r--src/libffmpeg/libavcodec/g726.c429
-rw-r--r--src/libffmpeg/libavcodec/golomb.c156
-rw-r--r--src/libffmpeg/libavcodec/golomb.h479
-rw-r--r--src/libffmpeg/libavcodec/h261.c1055
-rw-r--r--src/libffmpeg/libavcodec/h261data.h157
-rw-r--r--src/libffmpeg/libavcodec/h263.c6312
-rw-r--r--src/libffmpeg/libavcodec/h263data.h308
-rw-r--r--src/libffmpeg/libavcodec/h263dec.c913
-rw-r--r--src/libffmpeg/libavcodec/h264.c8653
-rw-r--r--src/libffmpeg/libavcodec/h264data.h1323
-rw-r--r--src/libffmpeg/libavcodec/h264idct.c168
-rw-r--r--src/libffmpeg/libavcodec/huffyuv.c1290
-rw-r--r--src/libffmpeg/libavcodec/i386/Makefile.am54
-rw-r--r--src/libffmpeg/libavcodec/i386/cputest.c130
-rw-r--r--src/libffmpeg/libavcodec/i386/dsputil_h264_template_mmx.c326
-rw-r--r--src/libffmpeg/libavcodec/i386/dsputil_mmx.c3540
-rw-r--r--src/libffmpeg/libavcodec/i386/dsputil_mmx_avg.h870
-rw-r--r--src/libffmpeg/libavcodec/i386/dsputil_mmx_rnd.h592
-rw-r--r--src/libffmpeg/libavcodec/i386/fdct_mmx.c566
-rw-r--r--src/libffmpeg/libavcodec/i386/fft_3dn.c125
-rw-r--r--src/libffmpeg/libavcodec/i386/fft_3dn2.c210
-rw-r--r--src/libffmpeg/libavcodec/i386/fft_sse.c247
-rw-r--r--src/libffmpeg/libavcodec/i386/h264dsp_mmx.c1513
-rw-r--r--src/libffmpeg/libavcodec/i386/idct_mmx.c597
-rw-r--r--src/libffmpeg/libavcodec/i386/idct_mmx_xvid.c535
-rw-r--r--src/libffmpeg/libavcodec/i386/libavcodec_mmx_dummy.c2
-rw-r--r--src/libffmpeg/libavcodec/i386/mathops.h41
-rw-r--r--src/libffmpeg/libavcodec/i386/mmx.h283
-rw-r--r--src/libffmpeg/libavcodec/i386/motion_est_mmx.c408
-rw-r--r--src/libffmpeg/libavcodec/i386/mpegvideo_mmx.c725
-rw-r--r--src/libffmpeg/libavcodec/i386/mpegvideo_mmx_template.c348
-rw-r--r--src/libffmpeg/libavcodec/i386/simple_idct_mmx.c1294
-rw-r--r--src/libffmpeg/libavcodec/i386/vp3dsp_mmx.c324
-rw-r--r--src/libffmpeg/libavcodec/i386/vp3dsp_sse2.c827
-rw-r--r--src/libffmpeg/libavcodec/idcinvideo.c272
-rw-r--r--src/libffmpeg/libavcodec/imgconvert.c2855
-rw-r--r--src/libffmpeg/libavcodec/imgconvert_template.h875
-rw-r--r--src/libffmpeg/libavcodec/imgresample.c949
-rw-r--r--src/libffmpeg/libavcodec/indeo2.c221
-rw-r--r--src/libffmpeg/libavcodec/indeo2data.h134
-rw-r--r--src/libffmpeg/libavcodec/indeo3.c1153
-rw-r--r--src/libffmpeg/libavcodec/indeo3data.h2335
-rw-r--r--src/libffmpeg/libavcodec/interplayvideo.c964
-rw-r--r--src/libffmpeg/libavcodec/jfdctfst.c338
-rw-r--r--src/libffmpeg/libavcodec/jfdctint.c406
-rw-r--r--src/libffmpeg/libavcodec/jpeg_ls.c860
-rw-r--r--src/libffmpeg/libavcodec/jrevdct.c1159
-rw-r--r--src/libffmpeg/libavcodec/kmvc.c417
-rw-r--r--src/libffmpeg/libavcodec/lcl.c928
-rw-r--r--src/libffmpeg/libavcodec/libpostproc/Makefile.am19
-rw-r--r--src/libffmpeg/libavcodec/libpostproc/mangle.h30
-rw-r--r--src/libffmpeg/libavcodec/libpostproc/postprocess.c1157
-rw-r--r--src/libffmpeg/libavcodec/libpostproc/postprocess.h82
-rw-r--r--src/libffmpeg/libavcodec/libpostproc/postprocess_altivec_template.c1196
-rw-r--r--src/libffmpeg/libavcodec/libpostproc/postprocess_internal.h174
-rw-r--r--src/libffmpeg/libavcodec/libpostproc/postprocess_template.c3847
-rw-r--r--src/libffmpeg/libavcodec/loco.c287
-rw-r--r--src/libffmpeg/libavcodec/lzo.c268
-rw-r--r--src/libffmpeg/libavcodec/lzo.h35
-rw-r--r--src/libffmpeg/libavcodec/mace.c456
-rw-r--r--src/libffmpeg/libavcodec/mathops.h69
-rw-r--r--src/libffmpeg/libavcodec/mdct.c177
-rw-r--r--src/libffmpeg/libavcodec/mdec.c270
-rw-r--r--src/libffmpeg/libavcodec/mjpeg.c2632
-rw-r--r--src/libffmpeg/libavcodec/mlib/Makefile.am18
-rw-r--r--src/libffmpeg/libavcodec/mlib/dsputil_mlib.c466
-rw-r--r--src/libffmpeg/libavcodec/mlib/libavcodec_mlib_dummy.c2
-rw-r--r--src/libffmpeg/libavcodec/mmvideo.c206
-rw-r--r--src/libffmpeg/libavcodec/motion_est.c2149
-rw-r--r--src/libffmpeg/libavcodec/motion_est_template.c1238
-rw-r--r--src/libffmpeg/libavcodec/mpeg12.c3504
-rw-r--r--src/libffmpeg/libavcodec/mpeg12data.h469
-rw-r--r--src/libffmpeg/libavcodec/mpeg4data.h423
-rw-r--r--src/libffmpeg/libavcodec/mpegaudio.h106
-rw-r--r--src/libffmpeg/libavcodec/mpegaudiodec.c2879
-rw-r--r--src/libffmpeg/libavcodec/mpegaudiodectab.h795
-rw-r--r--src/libffmpeg/libavcodec/mpegaudiotab.h111
-rw-r--r--src/libffmpeg/libavcodec/mpegvideo.c7008
-rw-r--r--src/libffmpeg/libavcodec/mpegvideo.h931
-rw-r--r--src/libffmpeg/libavcodec/msmpeg4.c1938
-rw-r--r--src/libffmpeg/libavcodec/msmpeg4data.h2028
-rw-r--r--src/libffmpeg/libavcodec/msrle.c309
-rw-r--r--src/libffmpeg/libavcodec/msvideo1.c349
-rw-r--r--src/libffmpeg/libavcodec/nuv.c216
-rw-r--r--src/libffmpeg/libavcodec/opt.c381
-rw-r--r--src/libffmpeg/libavcodec/opt.h83
-rw-r--r--src/libffmpeg/libavcodec/parser.c902
-rw-r--r--src/libffmpeg/libavcodec/parser.h63
-rw-r--r--src/libffmpeg/libavcodec/pcm.c548
-rw-r--r--src/libffmpeg/libavcodec/ppc/Makefile.am36
-rw-r--r--src/libffmpeg/libavcodec/ppc/dsputil_altivec.c1589
-rw-r--r--src/libffmpeg/libavcodec/ppc/dsputil_altivec.h106
-rw-r--r--src/libffmpeg/libavcodec/ppc/dsputil_h264_altivec.c319
-rw-r--r--src/libffmpeg/libavcodec/ppc/dsputil_h264_template_altivec.c717
-rw-r--r--src/libffmpeg/libavcodec/ppc/dsputil_ppc.c325
-rw-r--r--src/libffmpeg/libavcodec/ppc/dsputil_ppc.h155
-rw-r--r--src/libffmpeg/libavcodec/ppc/fdct_altivec.c493
-rw-r--r--src/libffmpeg/libavcodec/ppc/fft_altivec.c166
-rw-r--r--src/libffmpeg/libavcodec/ppc/float_altivec.c193
-rw-r--r--src/libffmpeg/libavcodec/ppc/gcc_fixes.h119
-rw-r--r--src/libffmpeg/libavcodec/ppc/gmc_altivec.c146
-rw-r--r--src/libffmpeg/libavcodec/ppc/h264_altivec.c565
-rw-r--r--src/libffmpeg/libavcodec/ppc/h264_template_altivec.c719
-rw-r--r--src/libffmpeg/libavcodec/ppc/idct_altivec.c237
-rw-r--r--src/libffmpeg/libavcodec/ppc/libavcodec_ppc_dummy.c2
-rw-r--r--src/libffmpeg/libavcodec/ppc/mathops.h33
-rw-r--r--src/libffmpeg/libavcodec/ppc/mpegvideo_altivec.c603
-rw-r--r--src/libffmpeg/libavcodec/ppc/mpegvideo_ppc.c87
-rw-r--r--src/libffmpeg/libavcodec/ppc/snow_altivec.c788
-rw-r--r--src/libffmpeg/libavcodec/ppc/types_altivec.h41
-rw-r--r--src/libffmpeg/libavcodec/ppc/vc1dsp_altivec.c338
-rw-r--r--src/libffmpeg/libavcodec/qdm2.c2042
-rw-r--r--src/libffmpeg/libavcodec/qdm2data.h530
-rw-r--r--src/libffmpeg/libavcodec/qdrw.c160
-rw-r--r--src/libffmpeg/libavcodec/qpeg.c324
-rw-r--r--src/libffmpeg/libavcodec/qtrle.c630
-rw-r--r--src/libffmpeg/libavcodec/ra144.c519
-rw-r--r--src/libffmpeg/libavcodec/ra144.h2428
-rw-r--r--src/libffmpeg/libavcodec/ra288.c258
-rw-r--r--src/libffmpeg/libavcodec/ra288.h205
-rw-r--r--src/libffmpeg/libavcodec/rangecoder.c153
-rw-r--r--src/libffmpeg/libavcodec/rangecoder.h127
-rw-r--r--src/libffmpeg/libavcodec/ratecontrol.c944
-rw-r--r--src/libffmpeg/libavcodec/ratecontrol.h103
-rw-r--r--src/libffmpeg/libavcodec/raw.c210
-rw-r--r--src/libffmpeg/libavcodec/resample2.c274
-rw-r--r--src/libffmpeg/libavcodec/roqvideo.c474
-rw-r--r--src/libffmpeg/libavcodec/rpza.c292
-rw-r--r--src/libffmpeg/libavcodec/rtjpeg.c165
-rw-r--r--src/libffmpeg/libavcodec/rtjpeg.h39
-rw-r--r--src/libffmpeg/libavcodec/rv10.c803
-rw-r--r--src/libffmpeg/libavcodec/shorten.c533
-rw-r--r--src/libffmpeg/libavcodec/simple_idct.c587
-rw-r--r--src/libffmpeg/libavcodec/simple_idct.h38
-rw-r--r--src/libffmpeg/libavcodec/smacker.c723
-rw-r--r--src/libffmpeg/libavcodec/smc.c493
-rw-r--r--src/libffmpeg/libavcodec/snow.c4720
-rw-r--r--src/libffmpeg/libavcodec/snow.h176
-rw-r--r--src/libffmpeg/libavcodec/sp5x.h332
-rw-r--r--src/libffmpeg/libavcodec/sparc/Makefile.am18
-rw-r--r--src/libffmpeg/libavcodec/sparc/dsputil_vis.c4090
-rw-r--r--src/libffmpeg/libavcodec/sparc/libavcodec_sparc_dummy.c2
-rw-r--r--src/libffmpeg/libavcodec/sparc/vis.h327
-rw-r--r--src/libffmpeg/libavcodec/svq1.c1431
-rw-r--r--src/libffmpeg/libavcodec/svq1_cb.h1580
-rw-r--r--src/libffmpeg/libavcodec/svq1_vlc.h281
-rw-r--r--src/libffmpeg/libavcodec/svq3.c1015
-rw-r--r--src/libffmpeg/libavcodec/swscale.h146
-rw-r--r--src/libffmpeg/libavcodec/truemotion1.c923
-rw-r--r--src/libffmpeg/libavcodec/truemotion1data.h829
-rw-r--r--src/libffmpeg/libavcodec/truemotion2.c893
-rw-r--r--src/libffmpeg/libavcodec/truespeech.c381
-rw-r--r--src/libffmpeg/libavcodec/truespeech_data.h157
-rw-r--r--src/libffmpeg/libavcodec/tscc.c348
-rw-r--r--src/libffmpeg/libavcodec/tta.c446
-rw-r--r--src/libffmpeg/libavcodec/ulti.c428
-rw-r--r--src/libffmpeg/libavcodec/ulti_cb.h4119
-rw-r--r--src/libffmpeg/libavcodec/utils.c1354
-rw-r--r--src/libffmpeg/libavcodec/vc1.c4390
-rw-r--r--src/libffmpeg/libavcodec/vc1acdata.h585
-rw-r--r--src/libffmpeg/libavcodec/vc1data.h652
-rw-r--r--src/libffmpeg/libavcodec/vc1dsp.c463
-rw-r--r--src/libffmpeg/libavcodec/vcr1.c190
-rw-r--r--src/libffmpeg/libavcodec/vmdav.c572
-rw-r--r--src/libffmpeg/libavcodec/vorbis.c1814
-rw-r--r--src/libffmpeg/libavcodec/vorbis.h43
-rw-r--r--src/libffmpeg/libavcodec/vorbis_data.c2155
-rw-r--r--src/libffmpeg/libavcodec/vp3.c2657
-rw-r--r--src/libffmpeg/libavcodec/vp3data.h3178
-rw-r--r--src/libffmpeg/libavcodec/vp3dsp.c225
-rw-r--r--src/libffmpeg/libavcodec/vp5.c290
-rw-r--r--src/libffmpeg/libavcodec/vp56.c665
-rw-r--r--src/libffmpeg/libavcodec/vp56.h252
-rw-r--r--src/libffmpeg/libavcodec/vp56data.c66
-rw-r--r--src/libffmpeg/libavcodec/vp56data.h248
-rw-r--r--src/libffmpeg/libavcodec/vp5data.h173
-rw-r--r--src/libffmpeg/libavcodec/vp6.c556
-rw-r--r--src/libffmpeg/libavcodec/vp6data.h300
-rw-r--r--src/libffmpeg/libavcodec/vqavideo.c625
-rw-r--r--src/libffmpeg/libavcodec/wavpack.c556
-rw-r--r--src/libffmpeg/libavcodec/wmadata.h1433
-rw-r--r--src/libffmpeg/libavcodec/wmadec.c1337
-rw-r--r--src/libffmpeg/libavcodec/wmv2.c861
-rw-r--r--src/libffmpeg/libavcodec/wnv1.c146
-rw-r--r--src/libffmpeg/libavcodec/ws-snd1.c144
-rw-r--r--src/libffmpeg/libavcodec/xan.c492
-rw-r--r--src/libffmpeg/libavcodec/xl.c140
-rw-r--r--src/libffmpeg/libavcodec/zmbv.c692
-rw-r--r--src/libffmpeg/libavutil/Makefile.am38
-rw-r--r--src/libffmpeg/libavutil/adler32.c71
-rw-r--r--src/libffmpeg/libavutil/adler32.h27
-rw-r--r--src/libffmpeg/libavutil/avutil.h137
-rw-r--r--src/libffmpeg/libavutil/bswap.h175
-rw-r--r--src/libffmpeg/libavutil/common.h364
-rw-r--r--src/libffmpeg/libavutil/crc.c104
-rw-r--r--src/libffmpeg/libavutil/crc.h35
-rw-r--r--src/libffmpeg/libavutil/integer.c223
-rw-r--r--src/libffmpeg/libavutil/integer.h49
-rw-r--r--src/libffmpeg/libavutil/internal.h328
-rw-r--r--src/libffmpeg/libavutil/intfloat_readwrite.h39
-rw-r--r--src/libffmpeg/libavutil/intreadwrite.h65
-rw-r--r--src/libffmpeg/libavutil/lls.c151
-rw-r--r--src/libffmpeg/libavutil/lls.h45
-rw-r--r--src/libffmpeg/libavutil/log.c82
-rw-r--r--src/libffmpeg/libavutil/log.h102
-rw-r--r--src/libffmpeg/libavutil/mathematics.c139
-rw-r--r--src/libffmpeg/libavutil/mathematics.h51
-rw-r--r--src/libffmpeg/libavutil/md5.c186
-rw-r--r--src/libffmpeg/libavutil/md5.h34
-rw-r--r--src/libffmpeg/libavutil/mem.c171
-rw-r--r--src/libffmpeg/libavutil/rational.c120
-rw-r--r--src/libffmpeg/libavutil/rational.h71
-rw-r--r--src/libffmpeg/libavutil/x86_cpu.h60
-rw-r--r--src/libmad/D.dat607
-rw-r--r--src/libmad/Makefile.am57
-rw-r--r--src/libmad/bit.c237
-rw-r--r--src/libmad/bit.h47
-rw-r--r--src/libmad/fixed.c81
-rw-r--r--src/libmad/fixed.h499
-rw-r--r--src/libmad/frame.c503
-rw-r--r--src/libmad/frame.h118
-rw-r--r--src/libmad/global.h58
-rw-r--r--src/libmad/huffman.c3109
-rw-r--r--src/libmad/huffman.h66
-rw-r--r--src/libmad/imdct_l_arm.S1000
-rw-r--r--src/libmad/imdct_s.dat62
-rw-r--r--src/libmad/layer12.c534
-rw-r--r--src/libmad/layer12.h31
-rw-r--r--src/libmad/layer3.c2698
-rw-r--r--src/libmad/layer3.h30
-rw-r--r--src/libmad/qc_table.dat77
-rw-r--r--src/libmad/rq_table.dat8747
-rw-r--r--src/libmad/sf_table.dat100
-rw-r--r--src/libmad/stream.c161
-rw-r--r--src/libmad/stream.h108
-rw-r--r--src/libmad/synth.c857
-rw-r--r--src/libmad/synth.h69
-rw-r--r--src/libmad/timer.c485
-rw-r--r--src/libmad/timer.h100
-rw-r--r--src/libmad/version.c91
-rw-r--r--src/libmad/version.h47
-rw-r--r--src/libmpeg2/Makefile.am12
-rw-r--r--src/libmpeg2new/Makefile.am11
-rw-r--r--src/libmpeg2new/libmpeg2/Makefile.am3
-rw-r--r--src/libmusepack/Makefile.am26
-rw-r--r--src/libmusepack/diff_against_svn.patch55
-rw-r--r--src/libmusepack/huffsv46.c268
-rw-r--r--src/libmusepack/huffsv7.c500
-rw-r--r--src/libmusepack/idtag.c83
-rw-r--r--src/libmusepack/mpc_decoder.c1349
-rw-r--r--src/libmusepack/mpc_reader.c96
-rw-r--r--src/libmusepack/musepack/Makefile.am5
-rw-r--r--src/libmusepack/musepack/config_types.h23
-rw-r--r--src/libmusepack/musepack/decoder.h114
-rw-r--r--src/libmusepack/musepack/huffman.h41
-rw-r--r--src/libmusepack/musepack/internal.h34
-rw-r--r--src/libmusepack/musepack/math.h110
-rw-r--r--src/libmusepack/musepack/musepack.h94
-rw-r--r--src/libmusepack/musepack/reader.h46
-rw-r--r--src/libmusepack/musepack/requant.h17
-rw-r--r--src/libmusepack/musepack/streaminfo.h52
-rw-r--r--src/libmusepack/requant.c152
-rw-r--r--src/libmusepack/streaminfo.c280
-rw-r--r--src/libmusepack/synth_filter.c440
-rw-r--r--src/libreal/Makefile.am9
-rw-r--r--src/libspucc/Makefile.am12
-rw-r--r--src/libspucmml/Makefile.am5
-rw-r--r--src/libspudec/Makefile.am31
-rw-r--r--src/libspudvb/Makefile.am5
-rw-r--r--src/libspudvb/xine_spudvb_decoder.c40
-rw-r--r--src/libsputext/Makefile.am3
-rw-r--r--src/libsputext/xine_sputext_decoder.c2
-rw-r--r--src/libw32dll/DirectShow/Makefile.am33
-rw-r--r--src/libw32dll/Makefile.am38
-rw-r--r--src/libw32dll/dmo/Makefile.am28
-rw-r--r--src/libw32dll/wine/Makefile.am57
-rw-r--r--src/libw32dll/wine/registry.c39
-rw-r--r--src/libw32dll/wine/windef.h7
-rw-r--r--src/libxineadec/Makefile.am86
-rw-r--r--src/libxineadec/gsm610.c14
-rw-r--r--src/libxineadec/gsm610/Makefile.am25
-rw-r--r--src/libxineadec/gsm610/add.c235
-rw-r--r--src/libxineadec/gsm610/decode.c63
-rw-r--r--src/libxineadec/gsm610/gsm.h71
-rw-r--r--src/libxineadec/gsm610/gsm_config.h37
-rw-r--r--src/libxineadec/gsm610/gsm_create.c45
-rw-r--r--src/libxineadec/gsm610/gsm_decode.c359
-rw-r--r--src/libxineadec/gsm610/gsm_destroy.c26
-rw-r--r--src/libxineadec/gsm610/long_term.c960
-rw-r--r--src/libxineadec/gsm610/lpc.c350
-rw-r--r--src/libxineadec/gsm610/private.h268
-rw-r--r--src/libxineadec/gsm610/proto.h65
-rw-r--r--src/libxineadec/gsm610/rpe.c489
-rw-r--r--src/libxineadec/gsm610/short_term.c428
-rw-r--r--src/libxineadec/gsm610/table.c63
-rw-r--r--src/libxineadec/gsm610/unproto.h23
-rw-r--r--src/libxineadec/nosefart/Makefile.am34
-rw-r--r--src/libxineadec/nosefart/diff_to_nosefart_cvs.patch75
-rw-r--r--src/libxineadec/nosefart/dis6502.c474
-rw-r--r--src/libxineadec/nosefart/dis6502.h52
-rw-r--r--src/libxineadec/nosefart/fds_snd.c94
-rw-r--r--src/libxineadec/nosefart/fds_snd.h50
-rw-r--r--src/libxineadec/nosefart/fmopl.c1323
-rw-r--r--src/libxineadec/nosefart/fmopl.h164
-rw-r--r--src/libxineadec/nosefart/log.c118
-rw-r--r--src/libxineadec/nosefart/log.h53
-rw-r--r--src/libxineadec/nosefart/memguard.c417
-rw-r--r--src/libxineadec/nosefart/memguard.h70
-rw-r--r--src/libxineadec/nosefart/mmc5_snd.c360
-rw-r--r--src/libxineadec/nosefart/mmc5_snd.h82
-rw-r--r--src/libxineadec/nosefart/nes6502.c2386
-rw-r--r--src/libxineadec/nosefart/nes6502.h134
-rw-r--r--src/libxineadec/nosefart/nes_apu.c1212
-rw-r--r--src/libxineadec/nosefart/nes_apu.h331
-rw-r--r--src/libxineadec/nosefart/nsf.c632
-rw-r--r--src/libxineadec/nosefart/nsf.h150
-rw-r--r--src/libxineadec/nosefart/osd.h98
-rw-r--r--src/libxineadec/nosefart/types.h136
-rw-r--r--src/libxineadec/nosefart/version.h59
-rw-r--r--src/libxineadec/nosefart/vrc7_snd.c347
-rw-r--r--src/libxineadec/nosefart/vrc7_snd.h70
-rw-r--r--src/libxineadec/nosefart/vrcvisnd.c210
-rw-r--r--src/libxineadec/nosefart/vrcvisnd.h85
-rw-r--r--src/libxineadec/xine_a52_decoder.c (renamed from src/liba52/xine_a52_decoder.c)2
-rw-r--r--src/libxineadec/xine_dts_decoder.c (renamed from src/libdts/xine_dts_decoder.c)135
-rw-r--r--src/libxineadec/xine_faad_decoder.c (renamed from src/libfaad/xine_faad_decoder.c)11
-rw-r--r--src/libxineadec/xine_lpcm_decoder.c14
-rw-r--r--src/libxineadec/xine_mad_decoder.c (renamed from src/libmad/xine_mad_decoder.c)0
-rw-r--r--src/libxineadec/xine_musepack_decoder.c (renamed from src/libmusepack/xine_musepack_decoder.c)64
-rw-r--r--src/libxinevdec/Makefile.am18
-rw-r--r--src/libxinevdec/bitplane.c8
-rw-r--r--src/post/Makefile.am3
-rw-r--r--src/post/audio/Makefile.am8
-rw-r--r--src/post/deinterlace/Makefile.am9
-rw-r--r--src/post/deinterlace/plugins/Makefile.am48
-rw-r--r--src/post/goom/Makefile.am47
-rwxr-xr-x[-rw-r--r--]src/post/goom/gfontlib.c0
-rwxr-xr-x[-rw-r--r--]src/post/goom/gfontlib.h0
-rwxr-xr-x[-rw-r--r--]src/post/goom/gfontrle.c0
-rwxr-xr-x[-rw-r--r--]src/post/goom/mathtools.h0
-rw-r--r--src/post/goom/mmx.h4
-rwxr-xr-x[-rw-r--r--]src/post/goom/surf3d.c0
-rwxr-xr-x[-rw-r--r--]src/post/goom/surf3d.h0
-rwxr-xr-x[-rw-r--r--]src/post/goom/tentacle3d.c0
-rwxr-xr-x[-rw-r--r--]src/post/goom/tentacle3d.h0
-rwxr-xr-x[-rw-r--r--]src/post/goom/v3d.h0
-rw-r--r--src/post/mosaico/Makefile.am7
-rw-r--r--src/post/mosaico/mosaico.c2
-rw-r--r--src/post/planar/Makefile.am44
-rwxr-xr-x[-rw-r--r--]src/post/planar/pp.c0
-rw-r--r--src/post/visualizations/Makefile.am9
-rw-r--r--src/vdr/Makefile.am17
-rw-r--r--src/vdr/input_vdr.c2693
-rw-r--r--src/vdr/input_vdr.h597
-rw-r--r--src/vdr/post_vdr.c44
-rw-r--r--src/vdr/post_vdr.h72
-rw-r--r--src/vdr/post_vdr_audio.c287
-rw-r--r--src/vdr/post_vdr_video.c495
-rw-r--r--src/video_out/Makefile.am119
-rw-r--r--src/video_out/deinterlace.c847
-rw-r--r--src/video_out/deinterlace.h55
-rw-r--r--src/video_out/libdha/.hgignore9
-rw-r--r--src/video_out/libdha/AsmMacros.h119
-rw-r--r--src/video_out/libdha/Makefile.am42
-rw-r--r--src/video_out/libdha/README12
-rw-r--r--src/video_out/libdha/bin/Makefile.am3
-rw-r--r--src/video_out/libdha/bin/README6
-rw-r--r--src/video_out/libdha/bin/mapdev.copyright70
-rw-r--r--src/video_out/libdha/bin/mapdev.vxdbin5780 -> 0 bytes
-rw-r--r--src/video_out/libdha/cpu_flush.c23
-rw-r--r--src/video_out/libdha/irq.c63
-rw-r--r--src/video_out/libdha/kernelhelper/Makefile.am53
-rw-r--r--src/video_out/libdha/kernelhelper/README38
-rw-r--r--src/video_out/libdha/kernelhelper/dhahelper.c1239
-rw-r--r--src/video_out/libdha/kernelhelper/dhahelper.h105
-rw-r--r--src/video_out/libdha/kernelhelper/test.c49
-rw-r--r--src/video_out/libdha/libdha.c99
-rw-r--r--src/video_out/libdha/libdha.h145
-rw-r--r--src/video_out/libdha/mmi.c112
-rw-r--r--src/video_out/libdha/mtrr.c91
-rw-r--r--src/video_out/libdha/oth/Makefile.am3
-rw-r--r--src/video_out/libdha/oth/pci.db9471
-rw-r--r--src/video_out/libdha/pci.c834
-rw-r--r--src/video_out/libdha/pci_db2c.awk267
-rw-r--r--src/video_out/libdha/ports.c219
-rw-r--r--src/video_out/libdha/sysdep/AsmMacros_alpha.h26
-rw-r--r--src/video_out/libdha/sysdep/AsmMacros_arm32.h50
-rw-r--r--src/video_out/libdha/sysdep/AsmMacros_generic.h56
-rw-r--r--src/video_out/libdha/sysdep/AsmMacros_ia64.h16
-rw-r--r--src/video_out/libdha/sysdep/AsmMacros_powerpc.h66
-rw-r--r--src/video_out/libdha/sysdep/AsmMacros_sparc.h53
-rw-r--r--src/video_out/libdha/sysdep/AsmMacros_x86.h72
-rw-r--r--src/video_out/libdha/sysdep/Makefile.am35
-rw-r--r--src/video_out/libdha/sysdep/libdha_os2.c161
-rw-r--r--src/video_out/libdha/sysdep/libdha_win32.c70
-rw-r--r--src/video_out/libdha/sysdep/pci_386bsd.c38
-rw-r--r--src/video_out/libdha/sysdep/pci_alpha.c80
-rw-r--r--src/video_out/libdha/sysdep/pci_arm32.c123
-rw-r--r--src/video_out/libdha/sysdep/pci_bsdi.c39
-rw-r--r--src/video_out/libdha/sysdep/pci_freebsd.c41
-rw-r--r--src/video_out/libdha/sysdep/pci_generic_cpu.c79
-rw-r--r--src/video_out/libdha/sysdep/pci_generic_os.c15
-rw-r--r--src/video_out/libdha/sysdep/pci_ia64.c123
-rw-r--r--src/video_out/libdha/sysdep/pci_isc.c32
-rw-r--r--src/video_out/libdha/sysdep/pci_linux.c54
-rw-r--r--src/video_out/libdha/sysdep/pci_lynx.c93
-rw-r--r--src/video_out/libdha/sysdep/pci_mach386.c25
-rw-r--r--src/video_out/libdha/sysdep/pci_netbsd.c44
-rw-r--r--src/video_out/libdha/sysdep/pci_openbsd.c27
-rw-r--r--src/video_out/libdha/sysdep/pci_os2.c55
-rw-r--r--src/video_out/libdha/sysdep/pci_powerpc.c250
-rw-r--r--src/video_out/libdha/sysdep/pci_sco.c33
-rw-r--r--src/video_out/libdha/sysdep/pci_sparc.c123
-rw-r--r--src/video_out/libdha/sysdep/pci_svr4.c42
-rw-r--r--src/video_out/libdha/sysdep/pci_win32.c18
-rw-r--r--src/video_out/libdha/sysdep/pci_x86.c123
-rw-r--r--src/video_out/libdha/test.c48
-rw-r--r--src/video_out/macosx/Makefile.am25
-rw-r--r--src/video_out/video_out_directfb.c4
-rwxr-xr-x[-rw-r--r--]src/video_out/video_out_directx.c0
-rw-r--r--src/video_out/video_out_fb.c83
-rw-r--r--src/video_out/video_out_xcbshm.c36
-rw-r--r--src/video_out/video_out_xcbxv.c270
-rw-r--r--src/video_out/video_out_xshm.c45
-rw-r--r--src/video_out/video_out_xv.c278
-rw-r--r--src/video_out/video_out_xvmc.c125
-rw-r--r--src/video_out/video_out_xxmc.c191
-rw-r--r--src/video_out/vidix/Makefile.am21
-rw-r--r--src/video_out/vidix/README7
-rw-r--r--src/video_out/vidix/drivers/Makefile.am66
-rw-r--r--src/video_out/vidix/drivers/cyberblade_regs.h137
-rw-r--r--src/video_out/vidix/drivers/cyberblade_vid.c649
-rw-r--r--src/video_out/vidix/drivers/genfb_vid.c177
-rw-r--r--src/video_out/vidix/drivers/glint_regs.h1304
-rw-r--r--src/video_out/vidix/drivers/mach64.h2611
-rw-r--r--src/video_out/vidix/drivers/mach64_vid.c1390
-rw-r--r--src/video_out/vidix/drivers/mga_vid.c1567
-rw-r--r--src/video_out/vidix/drivers/nvidia_vid.c976
-rw-r--r--src/video_out/vidix/drivers/pm2_vid.c357
-rw-r--r--src/video_out/vidix/drivers/pm3_regs.h1253
-rw-r--r--src/video_out/vidix/drivers/pm3_vid.c573
-rw-r--r--src/video_out/vidix/drivers/radeon.h2221
-rw-r--r--src/video_out/vidix/drivers/radeon_vid.c3366
-rw-r--r--src/video_out/vidix/drivers/savage_regs.h304
-rw-r--r--src/video_out/vidix/drivers/savage_vid.c1472
-rw-r--r--src/video_out/vidix/drivers/sis_bridge.c835
-rw-r--r--src/video_out/vidix/drivers/sis_defs.h106
-rw-r--r--src/video_out/vidix/drivers/sis_regs.h412
-rw-r--r--src/video_out/vidix/drivers/sis_vid.c1562
-rw-r--r--src/video_out/vidix/drivers/unichrome_regs.h635
-rw-r--r--src/video_out/vidix/drivers/unichrome_vid.c772
-rw-r--r--src/video_out/vidix/fourcc.h70
-rw-r--r--src/video_out/vidix/vidix.h312
-rw-r--r--src/video_out/vidix/vidix.txt247
-rw-r--r--src/video_out/vidix/vidixlib.c482
-rw-r--r--src/video_out/vidix/vidixlib.h128
-rw-r--r--src/video_out/xvmc_mocomp.c6
-rw-r--r--src/video_out/xvmc_vld.c8
-rw-r--r--src/video_out/xxmc.h1
-rw-r--r--src/xine-engine/Makefile.am50
-rw-r--r--src/xine-engine/accel_xvmc.h7
-rw-r--r--src/xine-engine/alphablend.c4
-rw-r--r--src/xine-engine/alphablend.h25
-rw-r--r--src/xine-engine/audio_out.c34
-rw-r--r--src/xine-engine/audio_out.h9
-rw-r--r--src/xine-engine/buffer.h235
-rw-r--r--src/xine-engine/buffer_types.c405
-rw-r--r--src/xine-engine/configfile.h55
-rw-r--r--src/xine-engine/input_cache.c3
-rw-r--r--src/xine-engine/input_rip.c3
-rw-r--r--src/xine-engine/load_plugins.c98
-rw-r--r--src/xine-engine/metronom.c7
-rw-r--r--src/xine-engine/metronom.h4
-rw-r--r--src/xine-engine/osd.c173
-rw-r--r--src/xine-engine/osd.h8
-rw-r--r--src/xine-engine/plugin_catalog.h6
-rw-r--r--src/xine-engine/post.c20
-rw-r--r--src/xine-engine/post.h25
-rw-r--r--src/xine-engine/refcounter.h2
-rw-r--r--src/xine-engine/scratch.c8
-rw-r--r--src/xine-engine/spu.c62
-rw-r--r--src/xine-engine/spu.h44
-rw-r--r--src/xine-engine/video_decoder.c10
-rw-r--r--src/xine-engine/video_out.c118
-rw-r--r--src/xine-engine/video_out.h17
-rw-r--r--src/xine-engine/video_overlay.h41
-rw-r--r--src/xine-engine/vo_scale.h7
-rw-r--r--src/xine-engine/xine.c136
-rw-r--r--src/xine-engine/xine_internal.h74
-rw-r--r--src/xine-utils/Makefile.am43
-rw-r--r--src/xine-utils/attributes.h24
-rw-r--r--src/xine-utils/cpu_accel.c34
-rw-r--r--src/xine-utils/memcpy.c6
-rw-r--r--src/xine-utils/monitor.c11
-rw-r--r--src/xine-utils/utils.c57
-rw-r--r--src/xine-utils/xineutils.h10
-rw-r--r--src/xine-utils/xmllexer.c140
-rw-r--r--src/xine-utils/xmllexer.h2
-rw-r--r--src/xine-utils/xmlparser.c308
-rw-r--r--src/xine-utils/xmlparser.h15
883 files changed, 7664 insertions, 396231 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 6718b4805..256e28bfa 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -11,19 +11,15 @@ SUBDIRS = \
demuxers \
libffmpeg \
libmpeg2 \
- liba52 \
libspudec \
libspucc \
libspucmml \
libspudvb \
libsputext \
- libdts \
- libmad \
libw32dll \
libxinevdec \
libxineadec \
libreal \
- libfaad \
- libmusepack \
post \
- combined
+ combined \
+ vdr
diff --git a/src/audio_out/Makefile.am b/src/audio_out/Makefile.am
index b984de7de..6eafd507e 100644
--- a/src/audio_out/Makefile.am
+++ b/src/audio_out/Makefile.am
@@ -1,146 +1,116 @@
include $(top_srcdir)/misc/Makefile.common
-AM_CPPFLAGS = -DXINE_COMPILE
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_LDFLAGS = $(xineplug_ldflags)
+
+##
+# IMPORTANT:
+# ---------
+# all xine audio out plugins should be named like the
+# scheme "xineplug_ao_out_"
+#
EXTRA_DIST = audio_irixal_out.c
-if HAVE_OSS
+if ENABLE_OSS
oss_module = xineplug_ao_out_oss.la
endif
-if HAVE_ALSA
+if ENABLE_ALSA
alsa_module = xineplug_ao_out_alsa.la
endif
-if HAVE_ESD
+if ENABLE_ESD
esd_module = xineplug_ao_out_esd.la
endif
-if HAVE_SUNAUDIO
+if ENABLE_SUNAUDIO
sun_module = xineplug_ao_out_sun.la
endif
-#if HAVE_IRIXAL
+#if ENABLE_IRIXAL
#irixal_module = xineplug_ao_out_irixal.la
#endif
-if HAVE_ARTS
-arts_module = xineplug_ao_out_arts.la
-endif
-
-if HAVE_DIRECTX
+if ENABLE_DIRECTX
directx_module = xineplug_ao_out_directx.la
directx2_module = xineplug_ao_out_directx2.la
endif
-if HAVE_COREAUDIO
+if ENABLE_COREAUDIO
coreaudio_module = xineplug_ao_out_coreaudio.la
endif
-if HAVE_PULSEAUDIO
+if ENABLE_PULSEAUDIO
pulseaudio_module = xineplug_ao_out_pulseaudio.la
endif
-if HAVE_FUSIONSOUND
+if ENABLE_FUSIONSOUND
fusionsound_module = xineplug_ao_out_fusionsound.la
endif
-if HAVE_JACK
+if ENABLE_JACK
jack_module = xineplug_ao_out_jack.la
endif
-##
-# IMPORTANT:
-# ---------
-# all xine audio out plugins should be named like the
-# scheme "xineplug_ao_out_"
-#
-xineplug_LTLIBRARIES = xineplug_ao_out_none.la xineplug_ao_out_file.la \
- $(oss_module) \
- $(alsa_module) \
- $(sun_module) \
- $(arts_module) \
- $(esd_module) \
- $(directx_module) \
- $(coreaudio_module) \
- $(pulseaudio_module) \
+xineplug_LTLIBRARIES = \
+ xineplug_ao_out_none.la \
+ xineplug_ao_out_file.la \
+ $(oss_module) \
+ $(alsa_module) \
+ $(sun_module) \
+ $(esd_module) \
+ $(directx_module) \
+ $(coreaudio_module) \
+ $(pulseaudio_module) \
$(directx2_module) \
- $(fusionsound_module) \
+ $(fusionsound_module) \
$(jack_module)
xineplug_ao_out_none_la_SOURCES = audio_none_out.c
xineplug_ao_out_none_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
-xineplug_ao_out_none_la_CFLAGS = $(VISIBILITY_FLAG)
-xineplug_ao_out_none_la_LDFLAGS = -avoid-version -module
xineplug_ao_out_file_la_SOURCES = audio_file_out.c
xineplug_ao_out_file_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
-xineplug_ao_out_file_la_CFLAGS = $(VISIBILITY_FLAG)
-xineplug_ao_out_file_la_LDFLAGS = -avoid-version -module
xineplug_ao_out_oss_la_SOURCES = audio_oss_out.c
xineplug_ao_out_oss_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
-xineplug_ao_out_oss_la_CFLAGS = $(VISIBILITY_FLAG)
-xineplug_ao_out_oss_la_LDFLAGS = -avoid-version -module
xineplug_ao_out_alsa_la_SOURCES = audio_alsa_out.c
xineplug_ao_out_alsa_la_LIBADD = $(ALSA_LIBS) $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_ao_out_alsa_la_CFLAGS = $(VISIBILITY_FLAG) $(ALSA_CFLAGS)
-xineplug_ao_out_alsa_la_LDFLAGS = -avoid-version -module
+xineplug_ao_out_alsa_la_CFLAGS = $(AM_CFLAGS) $(ALSA_CFLAGS)
xineplug_ao_out_esd_la_SOURCES = audio_esd_out.c
xineplug_ao_out_esd_la_LIBADD = $(ESD_LIBS) $(XINE_LIB) $(LTLIBINTL)
-xineplug_ao_out_esd_la_CFLAGS = $(VISIBILITY_FLAG) $(ESD_CFLAGS)
-xineplug_ao_out_esd_la_LDFLAGS = -avoid-version -module
+xineplug_ao_out_esd_la_CFLAGS = $(AM_CFLAGS) $(ESD_CFLAGS)
xineplug_ao_out_sun_la_SOURCES = audio_sun_out.c
xineplug_ao_out_sun_la_LIBADD = $(XINE_LIB)
-xineplug_ao_out_sun_la_CFLAGS = $(VISIBILITY_FLAG)
-xineplug_ao_out_sun_la_LDFLAGS = -avoid-version -module
#xineplug_ao_out_irixal_la_SOURCES = audio_irixal_out.c
#xineplug_ao_out_irixal_la_LIBADD = $(IRIXAL_LIBS)
-#xineplug_ao_out_irixal_la_CFLAGS = $(VISIBILITY_FLAG) $(IRIXAL_CFLAGS)
-#xineplug_ao_out_irixal_la_LDFLAGS = -avoid-version -module
-
-xineplug_ao_out_arts_la_SOURCES = audio_arts_out.c
-xineplug_ao_out_arts_la_LIBADD = $(ARTS_LIBS) $(XINE_LIB)
-xineplug_ao_out_arts_la_CFLAGS = $(VISIBILITY_FLAG) $(ARTS_CFLAGS)
-xineplug_ao_out_arts_la_LDFLAGS = -avoid-version -module
+#xineplug_ao_out_irixal_la_CFLAGS = $(AM_CFLAGS) $(IRIXAL_CFLAGS)
xineplug_ao_out_directx_la_SOURCES = audio_directx_out.c
-xineplug_ao_out_directx_la_CPPFLAGS = $(DIRECTX_CPPFLAGS)
xineplug_ao_out_directx_la_LIBADD = $(DIRECTX_AUDIO_LIBS) $(XINE_LIB)
-xineplug_ao_out_directx_la_CFLAGS = $(VISIBILITY_FLAG)
-xineplug_ao_out_directx_la_LDFLAGS = -avoid-version -module
+xineplug_ao_out_directx_la_CPPFLAGS = $(AM_CPPFLAGS) $(DIRECTX_CPPFLAGS)
xineplug_ao_out_coreaudio_la_SOURCES = audio_coreaudio_out.c
xineplug_ao_out_coreaudio_la_LIBADD = $(XINE_LIB)
-# The "-Wl,-framework -Wl,..." is needed for libtool versions before
-# 1.5.x (1.257): the default version that ships with Mac OS X is 1.5 (1.1220)
-xineplug_ao_out_coreaudio_la_LDFLAGS = \
- -Wl,-framework -Wl,Cocoa -framework CoreAudio \
- -Wl,-framework -Wl,AudioUnit -framework AudioUnit \
- -avoid-version -module
-xineplug_ao_out_coreaudio_la_CFLAGS = -framework CoreAudio -framework AudioUnit $(VISIBILITY_FLAG)
+xineplug_ao_out_coreaudio_la_LDFLAGS = $(AM_LDFLAGS) -framework CoreAudio -framework AudioUnit
xineplug_ao_out_pulseaudio_la_SOURCES = audio_pulse_out.c
xineplug_ao_out_pulseaudio_la_LIBADD = $(PULSEAUDIO_LIBS) $(XINE_LIB) $(LTLIBINTL)
-xineplug_ao_out_pulseaudio_la_CFLAGS = $(VISIBILITY_FLAG) $(PULSEAUDIO_CFLAGS)
-xineplug_ao_out_pulseaudio_la_LDFLAGS = -avoid-version -module
+xineplug_ao_out_pulseaudio_la_CFLAGS = $(AM_CFLAGS) $(PULSEAUDIO_CFLAGS)
xineplug_ao_out_directx2_la_SOURCES = audio_directx2_out.c
-xineplug_ao_out_directx2_la_CPPFLAGS = $(DIRECTX_CPPFLAGS)
+xineplug_ao_out_directx2_la_CPPFLAGS = $(AM_CPPFLAGS) $(DIRECTX_CPPFLAGS)
xineplug_ao_out_directx2_la_LIBADD = $(XINE_LIB) $(DIRECTX_AUDIO_LIBS) $(PTHREAD_LIBS)
-xineplug_ao_out_directx2_la_CFLAGS = $(VISIBILITY_FLAG)
-xineplug_ao_out_directx2_la_LDFLAGS = -avoid-version -module
xineplug_ao_out_fusionsound_la_SOURCES = audio_fusionsound_out.c
xineplug_ao_out_fusionsound_la_LIBADD = $(FUSIONSOUND_LIBS) $(XINE_LIB)
-xineplug_ao_out_fusionsound_la_CFLAGS = $(VISIBILITY_FLAG) $(FUSIONSOUND_CFLAGS)
-xineplug_ao_out_fusionsound_la_LDFLAGS = -avoid-version -module
+xineplug_ao_out_fusionsound_la_CFLAGS = $(AM_CFLAGS) $(FUSIONSOUND_CFLAGS)
xineplug_ao_out_jack_la_SOURCES = audio_jack_out.c
xineplug_ao_out_jack_la_LIBADD = $(JACK_LIBS) $(XINE_LIB) $(LTLIBINTL)
-xineplug_ao_out_jack_la_CFLAGS = $(VISIBILITY_FLAG) $(JACK_CFLAGS)
-xineplug_ao_out_jack_la_LDFLAGS = -avoid-version -module
+xineplug_ao_out_jack_la_CFLAGS = $(AM_FLAGS) $(JACK_CFLAGS)
diff --git a/src/audio_out/audio_arts_out.c b/src/audio_out/audio_arts_out.c
deleted file mode 100644
index 5347d7f76..000000000
--- a/src/audio_out/audio_arts_out.c
+++ /dev/null
@@ -1,418 +0,0 @@
-/*
- * Copyright (C) 2000-2003 the xine project
- *
- * This file is part of xine, a free video player.
- *
- * xine is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * xine is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- *
- * $Id: audio_arts_out.c,v 1.32 2006/07/16 16:18:09 dsalt Exp $
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <math.h>
-#include <unistd.h>
-#include <inttypes.h>
-#include <artsc.h>
-
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "audio_out.h"
-#include "bswap.h"
-
-#define AO_OUT_ARTS_IFACE_VERSION 8
-
-#define AUDIO_NUM_FRAGMENTS 15
-#define AUDIO_FRAGMENT_SIZE 8192
-
-#define GAP_TOLERANCE AO_MAX_GAP
-
-typedef struct arts_driver_s {
-
- ao_driver_t ao_driver;
-
- xine_t *xine;
-
- arts_stream_t audio_stream;
- int capabilities;
- int mode;
-
- int32_t sample_rate;
- uint32_t num_channels;
- uint32_t bits_per_sample;
- uint32_t bytes_per_frame;
-
- uint32_t latency;
-
- struct {
- int volume;
- int mute;
- int vol_scale;
- int v_mixer;
- } mixer;
-
-} arts_driver_t;
-
-typedef struct {
- audio_driver_class_t driver_class;
-
- xine_t *xine;
- int inited;
-} arts_class_t;
-
-/*
- * Software stereo volume control.....
- * Igor Mokrushin <igor@avtomir.ru>
- */
-static void ao_arts_volume(void *buffer, int length, int volume) {
- int v;
- short *data = (short *)buffer;
-
- while (length--) {
- v=(int) ((*(data) * volume) / 100);
- *(data)=(v>32767) ? 32767 : ((v<-32768) ? -32768 : v);
- *(data)=_X_LE_16(data);
- data++;
- }
-}
-/* End volume control */
-
-/*
- * open the audio device for writing to
- */
-static int ao_arts_open(ao_driver_t *this_gen,
- uint32_t bits, uint32_t rate, int mode)
-{
- arts_driver_t *this = (arts_driver_t *) this_gen;
-
- xprintf (this->xine, XINE_VERBOSITY_DEBUG,
- "audio_arts_out: ao_open bits=%d rate=%d, mode=%d\n", bits, rate, mode);
-
- if ( (mode & this->capabilities) == 0 ) {
- xprintf (this->xine, XINE_VERBOSITY_DEBUG, "audio_arts_out: unsupported mode %08x\n", mode);
- return 0;
- }
-
- if (this->audio_stream) {
-
- if ( (mode == this->mode) && (rate == this->sample_rate) )
- return this->sample_rate;
-
- sleep(2); /* arts might segfault if we are still playing */
- arts_close_stream(this->audio_stream);
- }
-
- this->mode = mode;
- this->sample_rate = rate;
- this->bits_per_sample = bits;
-
- switch (mode) {
- case AO_CAP_MODE_MONO:
- this->num_channels = 1;
- break;
- case AO_CAP_MODE_STEREO:
- this->num_channels = 2;
- break;
- }
-
- this->bytes_per_frame=(this->bits_per_sample*this->num_channels)/8;
-
- xprintf (this->xine, XINE_VERBOSITY_DEBUG, "audio_arts_out: %d channels output\n", this->num_channels);
-
- this->audio_stream=arts_play_stream(this->sample_rate, bits, this->num_channels, "xine");
-
- this->latency = arts_stream_get (this->audio_stream, ARTS_P_TOTAL_LATENCY);
-
- /* try to keep latency low, if we don't do this we might end
- with very high latencies for low quality sound and audio_out will
- try to fill gaps every time...(values in ms) */
- if( this->latency > 800 )
- {
- this->latency = 800 - arts_stream_get (this->audio_stream, ARTS_P_SERVER_LATENCY);
- if( this->latency < 100 )
- this->latency = 100;
- arts_stream_set( this->audio_stream, ARTS_P_BUFFER_TIME, this->latency );
- this->latency = arts_stream_get (this->audio_stream, ARTS_P_TOTAL_LATENCY);
- }
-
- xprintf (this->xine, XINE_VERBOSITY_DEBUG, "audio_arts_out : latency %d ms\n", this->latency);
-
- return this->sample_rate;
-}
-
-
-static int ao_arts_num_channels(ao_driver_t *this_gen)
-{
- arts_driver_t *this = (arts_driver_t *) this_gen;
- return this->num_channels;
-}
-
-static int ao_arts_bytes_per_frame(ao_driver_t *this_gen)
-{
- arts_driver_t *this = (arts_driver_t *) this_gen;
- return this->bytes_per_frame;
-}
-
-static int ao_arts_get_gap_tolerance (ao_driver_t *this_gen)
-{
- return GAP_TOLERANCE;
-}
-
-static int ao_arts_write(ao_driver_t *this_gen, int16_t *data,
- uint32_t num_frames)
-{
- arts_driver_t *this = (arts_driver_t *) this_gen;
- int size = num_frames * this->bytes_per_frame;
-
- ao_arts_volume(data, num_frames * this->num_channels, this->mixer.vol_scale );
- arts_write(this->audio_stream, data, size );
-
- return 1;
-}
-
-
-static int ao_arts_delay (ao_driver_t *this_gen)
-{
- arts_driver_t *this = (arts_driver_t *) this_gen;
-
- /* Just convert latency (ms) to frame units.
- please note that there is no function in aRts C API to
- get the current buffer utilization. This is, at best,
- a very roughly aproximation.
- */
-
- return this->latency * this->sample_rate / 1000;
-}
-
-static void ao_arts_close(ao_driver_t *this_gen)
-{
- arts_driver_t *this = (arts_driver_t *) this_gen;
-
- if (this->audio_stream) {
- sleep(2); /* arts might segfault if we are still playing */
- arts_close_stream(this->audio_stream);
- this->audio_stream = NULL;
- }
-}
-
-static uint32_t ao_arts_get_capabilities (ao_driver_t *this_gen) {
- arts_driver_t *this = (arts_driver_t *) this_gen;
- return this->capabilities;
-}
-
-static void ao_arts_exit(ao_driver_t *this_gen)
-{
- arts_driver_t *this = (arts_driver_t *) this_gen;
-
- ao_arts_close(this_gen);
- /* FIXME: arts_free() freezes on BSD, so don't use it there */
-#if !defined(__OpenBSD__) && !defined (__FreeBSD__) && !defined(__NetBSD__)
- arts_free();
-#endif
-
- free (this);
-}
-
-static int ao_arts_get_property (ao_driver_t *this_gen, int property) {
-
- arts_driver_t *this = (arts_driver_t *) this_gen;
-
- switch(property) {
- case AO_PROP_PCM_VOL:
- case AO_PROP_MIXER_VOL:
- if(!this->mixer.mute)
- this->mixer.volume = this->mixer.vol_scale;
- return this->mixer.volume;
- break;
- case AO_PROP_MUTE_VOL:
- return this->mixer.mute;
- break;
- }
- return 0;
-}
-
-static int ao_arts_set_property (ao_driver_t *this_gen, int property, int value) {
-
- arts_driver_t *this = (arts_driver_t *) this_gen;
- int mute = (value) ? 1 : 0;
-
- switch(property) {
- case AO_PROP_PCM_VOL:
- case AO_PROP_MIXER_VOL:
- if(!this->mixer.mute)
- this->mixer.volume = value;
- this->mixer.vol_scale = this->mixer.volume;
- return this->mixer.volume;
- break;
- case AO_PROP_MUTE_VOL:
- if(mute) {
- this->mixer.v_mixer = this->mixer.volume;
- this->mixer.volume = 0;
- this->mixer.vol_scale = this->mixer.volume;
- } else {
- this->mixer.volume = this->mixer.v_mixer;
- this->mixer.vol_scale = this->mixer.volume;
- }
- this->mixer.mute = mute;
- return value;
- break;
- }
-
- return ~value;
-}
-
-static int ao_arts_ctrl(ao_driver_t *this_gen, int cmd, ...) {
- /*arts_driver_t *this = (arts_driver_t *) this_gen;*/
-
- switch (cmd) {
-
- case AO_CTRL_PLAY_PAUSE:
- break;
-
- case AO_CTRL_PLAY_RESUME:
- break;
-
- case AO_CTRL_FLUSH_BUFFERS:
- break;
- }
-
- return 0;
-}
-
-static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *data) {
- arts_class_t *class = (arts_class_t *) class_gen;
- arts_driver_t *this;
- int rc;
-
- lprintf ("audio_arts_out: open_plugin called\n");
-
- this = (arts_driver_t *) xine_xmalloc (sizeof (arts_driver_t));
- if (!this)
- return NULL;
-
- this->xine = class->xine;
-
- if (class->inited == 0) {
- rc = arts_init();
- class->inited++;
- } else {
- xprintf (this->xine, XINE_VERBOSITY_LOG, "audio_arts_out: not trying to initialise a second time\n");
- free(this);
- return NULL;
- }
-
- if (rc < 0) {
- xprintf (this->xine, XINE_VERBOSITY_DEBUG,"audio_arts_out: arts_init failed: %s\n", arts_error_text(rc));
- free(this);
- return NULL;
- }
-
- /*
- * set volume control
- */
- this->mixer.mute = 0;
- this->mixer.vol_scale = 60;
- this->mixer.v_mixer = 0;
- /*
- * set capabilities
- */
- this->capabilities = 0;
- xprintf (this->xine, XINE_VERBOSITY_DEBUG, "audio_arts_out : supported modes are ");
- this->capabilities |= AO_CAP_MODE_MONO | AO_CAP_MIXER_VOL | AO_CAP_PCM_VOL | AO_CAP_MUTE_VOL;
- xprintf (this->xine, XINE_VERBOSITY_DEBUG, "mono ");
- this->capabilities |= AO_CAP_MODE_STEREO | AO_CAP_MIXER_VOL | AO_CAP_PCM_VOL | AO_CAP_MUTE_VOL;
- xprintf (this->xine, XINE_VERBOSITY_DEBUG, "stereo ");
-
- this->sample_rate = 0;
- this->audio_stream = NULL;
-
- this->ao_driver.get_capabilities = ao_arts_get_capabilities;
- this->ao_driver.get_property = ao_arts_get_property;
- this->ao_driver.set_property = ao_arts_set_property;
- this->ao_driver.open = ao_arts_open;
- this->ao_driver.num_channels = ao_arts_num_channels;
- this->ao_driver.bytes_per_frame = ao_arts_bytes_per_frame;
- this->ao_driver.delay = ao_arts_delay;
- this->ao_driver.write = ao_arts_write;
- this->ao_driver.close = ao_arts_close;
- this->ao_driver.exit = ao_arts_exit;
- this->ao_driver.get_gap_tolerance = ao_arts_get_gap_tolerance;
- this->ao_driver.control = ao_arts_ctrl;
-
- return &this->ao_driver;
-}
-
-/*
- * class functions
- */
-
-static char* get_identifier (audio_driver_class_t *this_gen) {
- return "arts";
-}
-
-static char* get_description (audio_driver_class_t *this_gen) {
- return _("xine audio output plugin using kde artsd");
-}
-
-static void dispose_class (audio_driver_class_t *this_gen) {
-
- arts_class_t *this = (arts_class_t *) this_gen;
-
- free (this);
-}
-
-static void *init_class (xine_t *xine, void *data) {
-
- arts_class_t *this;
-
- lprintf ("audio_arts_out: init class\n");
-
- this = (arts_class_t *) xine_xmalloc (sizeof (arts_class_t));
- if (!this)
- return NULL;
-
- this->inited = 0;
-
- this->driver_class.open_plugin = open_plugin;
- this->driver_class.get_identifier = get_identifier;
- this->driver_class.get_description = get_description;
- this->driver_class.dispose = dispose_class;
-
- this->xine = xine;
-
- return this;
-}
-
-static ao_info_t ao_info_arts = {
- 5
-};
-
-/*
- * exported plugin catalog entry
- */
-
-const plugin_info_t xine_plugin_info[] EXPORTED = {
- /* type, API, "name", version, special_info, init_function */
- { PLUGIN_AUDIO_OUT, AO_OUT_ARTS_IFACE_VERSION, "arts", XINE_VERSION_CODE, &ao_info_arts, init_class },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
-};
-
diff --git a/src/audio_out/audio_directx_out.c b/src/audio_out/audio_directx_out.c
index d2147ac52..d2147ac52 100644..100755
--- a/src/audio_out/audio_directx_out.c
+++ b/src/audio_out/audio_directx_out.c
diff --git a/src/audio_out/audio_pulse_out.c b/src/audio_out/audio_pulse_out.c
index 9e6089730..d93c9d279 100644
--- a/src/audio_out/audio_pulse_out.c
+++ b/src/audio_out/audio_pulse_out.c
@@ -79,7 +79,7 @@ typedef struct pulse_driver_s {
int capabilities;
int mode;
- int32_t sample_rate;
+ uint32_t sample_rate;
uint32_t num_channels;
uint32_t bits_per_sample;
uint32_t bytes_per_frame;
@@ -342,7 +342,7 @@ static int ao_pulse_write(ao_driver_t *this_gen, int16_t *data,
uint32_t num_frames)
{
pulse_driver_t *this = (pulse_driver_t *) this_gen;
- int size = num_frames * this->bytes_per_frame;
+ size_t size = num_frames * this->bytes_per_frame;
int ret = 0;
if ( !this->stream || !this->pa_class->context)
@@ -381,7 +381,7 @@ static int ao_pulse_delay (ao_driver_t *this_gen)
{
pulse_driver_t *this = (pulse_driver_t *) this_gen;
pa_usec_t latency = 0;
- int delay_frames;
+ unsigned int delay_frames;
if ( ! this->stream ) return this->frames_written;
@@ -626,12 +626,6 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
this->pa_class = class;
return &this->ao_driver;
-
- fail:
- pthread_mutex_unlock(&this->pa_class->pa_mutex);
- free(this);
- xprintf (class->xine, XINE_VERBOSITY_DEBUG, "audio_pulse_out: open_plugin failed.\n");
- return NULL;
}
/*
diff --git a/src/audio_out/audio_sun_out.c b/src/audio_out/audio_sun_out.c
index 5923eb658..ca91a8fe6 100644
--- a/src/audio_out/audio_sun_out.c
+++ b/src/audio_out/audio_sun_out.c
@@ -248,13 +248,11 @@ static int realtime_samplecounter_available(xine_t *xine, char *dev)
error:
if (silence != NULL) free(silence);
if (fd >= 0) {
-#ifdef __svr4__
/*
* remove the 0 bytes from the above measurement from the
* audio driver's STREAMS queue
*/
ioctl(fd, I_FLUSH, FLUSHW);
-#endif
close(fd);
}
@@ -334,7 +332,7 @@ find_close_samplerate_match(int dev, int sample_rate)
#else
int i, err;
- int audiocs_rates[] = {
+ static const int audiocs_rates[] = {
5510, 6620, 8000, 9600, 11025, 16000, 18900, 22050,
27420, 32000, 33075, 37800, 44100, 48000, 0
};
diff --git a/src/combined/Makefile.am b/src/combined/Makefile.am
index 884fcf0cc..a32b886d4 100644
--- a/src/combined/Makefile.am
+++ b/src/combined/Makefile.am
@@ -1,21 +1,60 @@
include $(top_srcdir)/misc/Makefile.common
-if HAVE_WAVPACK
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_LDFLAGS = $(xineplug_ldflags)
+
+if ENABLE_WAVPACK
xineplug_wavpack = xineplug_wavpack.la
endif
-if HAVE_LIBFLAC
+if ENABLE_LIBFLAC
xineplug_flac = xineplug_flac.la
endif
-xineplug_LTLIBRARIES = $(xineplug_wavpack) $(xineplug_flac)
+$(top_builddir)/contrib/nosefart/libnosefart.la:
+ $(MAKE) -C $(top_builddir)/contrib/nosefart
+
+xineplug_LTLIBRARIES = \
+ $(xineplug_wavpack) \
+ $(xineplug_flac) \
+ xineplug_nsf.la
-xineplug_wavpack_la_SOURCES = demux_wavpack.c decoder_wavpack.c combined_wavpack.c combined_wavpack.h
-xineplug_wavpack_la_CFLAGS = $(VISIBILITY_FLAG) $(WAVPACK_CFLAGS) -I$(srcdir)/../demuxers
+xineplug_wavpack_la_SOURCES = wavpack_demuxer.c wavpack_decoder.c wavpack_combined.c wavpack_combined.h
xineplug_wavpack_la_LIBADD = $(XINE_LIB) $(WAVPACK_LIBS)
-xineplug_wavpack_la_LDFLAGS = $(xineplug_ldflags)
+xineplug_wavpack_la_CFLAGS = $(AM_CFLAGS) $(WAVPACK_CFLAGS)
+xineplug_wavpack_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/src/demuxers
-xineplug_flac_la_SOURCES = demux_flac.c decoder_flac.c demux_flac.h
-xineplug_flac_la_CFLAGS = $(VISIBILITY_FLAG) $(LIBFLAC_CFLAGS)
+xineplug_flac_la_SOURCES = flac_demuxer.c flac_decoder.c
xineplug_flac_la_LIBADD = $(XINE_LIB) $(LIBFLAC_LIBS)
-xineplug_flac_la_LDFLAGS = $(xineplug_ldflags)
+xineplug_flac_la_CFLAGS = $(AM_CFLAGS) $(LIBFLAC_CFLAGS)
+
+xineplug_nsf_la_SOURCES = nsf_decoder.c nsf_demuxer.c nsf_combined.c nsf_combined.h
+xineplug_nsf_la_LIBADD = $(XINE_LIB) $(top_builddir)/contrib/nosefart/libnosefart.la -lm
+xineplug_nsf_la_CFLAGS = $(AM_CFLAGS) -fno-strict-aliasing
+xineplug_nsf_la_CPPFLAGS = $(AM_CPPFLAGS) -DNSF_PLAYER -I$(top_srcdir)/contrib/nosefart -I$(top_srcdir)/src/demuxers
+
+xineplug_xiph_la_SOURCES = xine_ogg_demuxer.c
+xineplug_xiph_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
+xineplug_xiph_la_CFLAGS = $(AM_CFLAGS)
+xineplug_xiph_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/src/demuxers
+
+if ENABLE_VORBIS
+xineplug_LTLIBRARIES += xineplug_xiph.la
+xineplug_xiph_la_SOURCES += xine_vorbis_decoder.c
+xineplug_xiph_la_LIBADD += $(VORBIS_LIBS)
+xineplug_xiph_la_CFLAGS += $(VORBIS_CFLAGS)
+endif
+
+if ENABLE_THEORA
+xineplug_LTLIBRARIES += xineplug_xiph.la
+xineplug_xiph_la_SOURCES += xine_theora_decoder.c
+xineplug_xiph_la_LIBADD += $(THEORA_LIBS)
+xineplug_xiph_la_CFLAGS += $(THEORA_CFLAGS)
+endif
+
+if ENABLE_SPEEX
+xineplug_LTLIBRARIES += xineplug_xiph.la
+xineplug_xiph_la_SOURCES += xine_speex_decoder.c
+xineplug_xiph_la_LIBADD += $(SPEEX_LIBS)
+xineplug_xiph_la_CFLAGS += $(SPEEX_CFLAGS)
+endif
diff --git a/src/combined/decoder_flac.c b/src/combined/flac_decoder.c
index 148f5e62c..cc7c9570a 100644
--- a/src/combined/decoder_flac.c
+++ b/src/combined/flac_decoder.c
@@ -48,8 +48,6 @@
#include "audio_out.h"
#include "buffer.h"
-#include "demux_flac.h"
-
typedef struct {
audio_decoder_class_t decoder_class;
} flac_class_t;
@@ -59,23 +57,17 @@ typedef struct flac_decoder_s {
int64_t pts;
- int output_sampling_rate;
- int output_open;
- int output_mode;
-
xine_stream_t *stream;
FLAC__StreamDecoder *flac_decoder;
- int sample_rate;
- int bits_per_sample;
- int channels;
-
unsigned char *buf;
int buf_size;
int buf_pos;
int min_size;
+ int output_open;
+
} flac_decoder_t;
/*
@@ -249,21 +241,18 @@ flac_decode_data (audio_decoder_t *this_gen, buf_element_t *buf)
*/
if (buf->decoder_flags & BUF_FLAG_STDHEADER)
{
- int mode = AO_CAP_MODE_MONO;
-
- this->sample_rate = buf->decoder_info[1];
- this->bits_per_sample = buf->decoder_info[2];
- this->channels = buf->decoder_info[3];
-
- mode = _x_ao_channels2mode(this->channels);
+ const int sample_rate = buf->decoder_info[1];
+ const int bits_per_sample = buf->decoder_info[2];
+ const int channels = buf->decoder_info[3];
+ const int mode = _x_ao_channels2mode(channels);
if (!this->output_open)
{
this->output_open = (this->stream->audio_out->open) (
this->stream->audio_out,
this->stream,
- this->bits_per_sample,
- this->sample_rate,
+ bits_per_sample,
+ sample_rate,
mode);
@@ -418,6 +407,8 @@ init_plugin (xine_t *xine, void *data) {
return this;
}
+void *demux_flac_init_class (xine_t *xine, void *data);
+
static uint32_t audio_types[] = {
BUF_AUDIO_FLAC, 0
};
diff --git a/src/combined/demux_flac.c b/src/combined/flac_demuxer.c
index 43ee17d5c..b4932406e 100644
--- a/src/combined/demux_flac.c
+++ b/src/combined/flac_demuxer.c
@@ -55,8 +55,6 @@
#include "xineutils.h"
#include "../demuxers/demux.h"
-#include "demux_flac.h"
-
#ifndef LEGACY_FLAC
# define FLAC__SeekableStreamDecoder FLAC__StreamDecoder
#endif
diff --git a/src/combined/nsf_combined.c b/src/combined/nsf_combined.c
new file mode 100644
index 000000000..474064213
--- /dev/null
+++ b/src/combined/nsf_combined.c
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2007 the xine project
+ *
+ * This file is part of xine, a free video player.
+ *
+ * xine is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * xine is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ *
+ * $Id: combined_wavpack.c,v 1.3 2007/03/17 07:34:02 dgp85 Exp $
+ */
+
+#include "xine_internal.h"
+#include "nsf_combined.h"
+
+static const demuxer_info_t demux_info_nsf = {
+ 10 /* priority */
+};
+
+static uint32_t audio_types[] = {
+ BUF_AUDIO_NSF,
+ 0
+};
+
+static const decoder_info_t decoder_info_nsf = {
+ audio_types, /* supported types */
+ 5 /* priority */
+};
+
+const plugin_info_t xine_plugin_info[] EXPORTED = {
+ { PLUGIN_DEMUX, 26, "nsfdemux", XINE_VERSION_CODE, &demux_info_nsf, demux_nsf_init_plugin },
+ { PLUGIN_AUDIO_DECODER, 15, "nsfdec", XINE_VERSION_CODE, &decoder_info_nsf, decoder_nsf_init_plugin },
+ { PLUGIN_NONE, 0, NULL, 0, NULL, NULL }
+};
diff --git a/src/combined/demux_flac.h b/src/combined/nsf_combined.h
index 6086781d1..36a0abe71 100644
--- a/src/combined/demux_flac.h
+++ b/src/combined/nsf_combined.h
@@ -1,28 +1,22 @@
-/*
- * Copyright (C) 2000-2003 the xine project
- *
+/*
+ * Copyright (C) 2000-2001 the xine project
+ *
* This file is part of xine, a free video player.
- *
+ *
* xine is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* xine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- *
- * $Id: demux_flac.h,v 1.2 2003/12/09 00:02:32 f1rmb Exp $
*/
-#ifndef HAVE_DEMUX_FLAC_H
-#define HAVE_DEMUX_FLAC_H
-
-void *demux_flac_init_class (xine_t *xine, void *data);
-
-#endif
+void *decoder_nsf_init_plugin (xine_t *xine, void *data);
+void *demux_nsf_init_plugin (xine_t *xine, void *data);
diff --git a/src/libxineadec/nsf.c b/src/combined/nsf_decoder.c
index 31d3b36e8..20472cd10 100644
--- a/src/libxineadec/nsf.c
+++ b/src/combined/nsf_decoder.c
@@ -36,8 +36,10 @@
#include "bswap.h"
/* Nosefart includes */
-#include "nosefart/types.h"
-#include "nosefart/nsf.h"
+#include "types.h"
+#include "nsf.h"
+
+#include "nsf_combined.h"
typedef struct {
audio_decoder_class_t decoder_class;
@@ -253,7 +255,7 @@ static void dispose_class (audio_decoder_class_t *this_gen) {
/* This function allocates a private audio decoder class and initializes
* the class's member functions. */
-static void *init_plugin (xine_t *xine, void *data) {
+void *decoder_nsf_init_plugin (xine_t *xine, void *data) {
nsf_class_t *this ;
@@ -266,30 +268,3 @@ static void *init_plugin (xine_t *xine, void *data) {
return this;
}
-
-/* This is a list of all of the internal xine audio buffer types that
- * this decoder is able to handle. Check src/xine-engine/buffer.h for a
- * list of valid buffer types (and add a new one if the one you need does
- * not exist). Terminate the list with a 0. */
-static uint32_t audio_types[] = {
- BUF_AUDIO_NSF,
- 0
-};
-
-/* This data structure combines the list of supported xine buffer types and
- * the priority that the plugin should be given with respect to other
- * plugins that handle the same buffer type. A plugin with priority (n+1)
- * will be used instead of a plugin with priority (n). */
-static const decoder_info_t dec_info_audio = {
- audio_types, /* supported types */
- 5 /* priority */
-};
-
-/* The plugin catalog entry. This is the only information that this plugin
- * will export to the public. */
-const plugin_info_t xine_plugin_info[] EXPORTED = {
- /* { type, API version, "name", version, special_info, init_function }, */
- { PLUGIN_AUDIO_DECODER, 15, "nsf", XINE_VERSION_CODE, &dec_info_audio, &init_plugin },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
-};
-
diff --git a/src/demuxers/demux_nsf.c b/src/combined/nsf_demuxer.c
index 7408274d5..71e4b2c78 100644
--- a/src/demuxers/demux_nsf.c
+++ b/src/combined/nsf_demuxer.c
@@ -53,7 +53,8 @@
#include "compat.h"
#include "demux.h"
#include "bswap.h"
-#include "group_audio.h"
+
+#include "nsf_combined.h"
#define NSF_HEADER_SIZE 0x80
#define NSF_SAMPLERATE 44100
@@ -99,18 +100,14 @@ static int open_nsf_file(demux_nsf_t *this) {
return 0;
/* check for the signature */
- if ((header[0] != 'N') ||
- (header[1] != 'E') ||
- (header[2] != 'S') ||
- (header[3] != 'M') ||
- (header[4] != 0x1A))
+ if ( memcmp(header, "NESM\x1A", 5) != 0 )
return 0;
this->total_songs = header[6];
this->current_song = header[7];
- this->title = strdup(&header[0x0E]);
- this->artist = strdup(&header[0x2E]);
- this->copyright = strdup(&header[0x4E]);
+ this->title = strndup((char*)&header[0x0E], 0x20);
+ this->artist = strndup((char*)&header[0x2E], 0x20);
+ this->copyright = strndup((char*)&header[0x4E], 0x20);
this->filesize = this->input->get_length(this->input);
diff --git a/src/combined/combined_wavpack.c b/src/combined/wavpack_combined.c
index 7a334b15c..110de2b2e 100644
--- a/src/combined/combined_wavpack.c
+++ b/src/combined/wavpack_combined.c
@@ -23,7 +23,7 @@
*/
#include "xine_internal.h"
-#include "combined_wavpack.h"
+#include "wavpack_combined.h"
static const demuxer_info_t demux_info_wv = {
0 /* priority */
diff --git a/src/combined/combined_wavpack.h b/src/combined/wavpack_combined.h
index b7bf32acb..7688f91df 100644
--- a/src/combined/combined_wavpack.h
+++ b/src/combined/wavpack_combined.h
@@ -23,6 +23,7 @@
*/
#include "os_types.h"
+#include "bswap.h"
typedef struct {
uint32_t idcode; /* This should always be the string "wvpk" */
@@ -37,13 +38,9 @@ typedef struct {
uint32_t samples_count; /* Count of samples in the current frame */
uint32_t flags; /* Misc flags */
uint32_t decoded_crc32; /* CRC32 of the decoded data */
-} __attribute__((packed)) wvheader_t;
+} XINE_PACKED wvheader_t;
-#ifdef WORDS_BIGENDIAN
-static const uint32_t wvpk_signature = ('k' + ('p' << 8) + ('v' << 16) + ('w' << 24));
-#else
-static const uint32_t wvpk_signature = ('w' + ('v' << 8) + ('p' << 16) + ('k' << 24));
-#endif
+static const uint32_t wvpk_signature = ME_FOURCC('w', 'v', 'p', 'k');
void *demux_wv_init_plugin (xine_t *const xine, void *const data);
void *decoder_wavpack_init_plugin (xine_t *xine, void *data);
diff --git a/src/combined/decoder_wavpack.c b/src/combined/wavpack_decoder.c
index e036e3bf8..0929d1b8e 100644
--- a/src/combined/decoder_wavpack.c
+++ b/src/combined/wavpack_decoder.c
@@ -34,7 +34,7 @@
#include "bswap.h"
#include <wavpack/wavpack.h>
-#include "combined_wavpack.h"
+#include "wavpack_combined.h"
typedef struct {
audio_decoder_class_t decoder_class;
@@ -104,6 +104,8 @@ static int xine_buffer_set_pos_rel(void *const this_gen, const int32_t delta,
return 0;
}
+
+ return -1;
}
static int xine_buffer_set_pos_abs(void *const this_gen, const uint32_t pos) {
diff --git a/src/combined/demux_wavpack.c b/src/combined/wavpack_demuxer.c
index 7343976fa..5f2f57d49 100644
--- a/src/combined/demux_wavpack.c
+++ b/src/combined/wavpack_demuxer.c
@@ -37,7 +37,7 @@
#include "attributes.h"
#include <wavpack/wavpack.h>
-#include "combined_wavpack.h"
+#include "wavpack_combined.h"
typedef struct {
demux_plugin_t demux_plugin;
diff --git a/src/demuxers/demux_ogg.c b/src/combined/xine_ogg_demuxer.c
index a23bfa6b6..85402484e 100644
--- a/src/demuxers/demux_ogg.c
+++ b/src/combined/xine_ogg_demuxer.c
@@ -40,7 +40,10 @@
#include <inttypes.h>
#include <ogg/ogg.h>
+
+#ifdef HAVE_VORBIS
#include <vorbis/codec.h>
+#endif
#ifdef HAVE_SPEEX
#include <speex/speex.h>
@@ -416,6 +419,7 @@ static void ogg_handle_event (demux_ogg_t *this) {
* to label audio and spu streams
*/
static void read_language_comment (demux_ogg_t *this, ogg_packet *op, int stream_num) {
+#ifdef HAVE_VORBIS
char **ptr;
char *comment;
vorbis_comment vc;
@@ -439,6 +443,7 @@ static void read_language_comment (demux_ogg_t *this, ogg_packet *op, int stream
}
vorbis_comment_clear(&vc);
vorbis_info_clear(&vi);
+#endif
}
/*
@@ -446,6 +451,7 @@ static void read_language_comment (demux_ogg_t *this, ogg_packet *op, int stream
* to name parts of the videostream
*/
static void read_chapter_comment (demux_ogg_t *this, ogg_packet *op) {
+#ifdef HAVE_VORBIS
char **ptr;
char *comment;
vorbis_comment vc;
@@ -512,6 +518,7 @@ static void read_chapter_comment (demux_ogg_t *this, ogg_packet *op) {
}
vorbis_comment_clear(&vc);
vorbis_info_clear(&vi);
+#endif
}
/*
@@ -770,6 +777,7 @@ static void send_ogg_buf (demux_ogg_t *this,
}
static void decode_vorbis_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) {
+#ifdef HAVE_VORBIS
vorbis_info vi;
vorbis_comment vc;
@@ -803,6 +811,7 @@ static void decode_vorbis_header (demux_ogg_t *this, const int stream_num, ogg_p
}
vorbis_comment_clear(&vc);
vorbis_info_clear(&vi);
+#endif
}
static void decode_speex_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) {
@@ -1295,7 +1304,11 @@ static void decode_anxdata_header (demux_ogg_t *this, const int stream_num, ogg_
/* what type of stream are we dealing with? */
if (!strncmp(content_type, "audio/x-vorbis", content_type_length)) {
+#ifdef HAVE_VORBIS
this->si[stream_num]->buf_types = BUF_AUDIO_VORBIS;
+#else
+ this->si[stream_num]->buf_types = BUF_CONTROL_NOP;
+#endif
this->num_audio_streams++;
} else if (!strncmp(content_type, "audio/x-speex", content_type_length)) {
this->num_audio_streams++;
@@ -2194,9 +2207,25 @@ static const demuxer_info_t demux_info_ogg = {
10 /* priority */
};
+extern const demuxer_info_t dec_info_vorbis;
+void *vorbis_init_plugin (xine_t *xine, void *data);
+extern const demuxer_info_t dec_info_speex;
+void *speex_init_plugin (xine_t *xine, void *data);
+extern const demuxer_info_t dec_info_theora;
+void *theora_init_plugin (xine_t *xine, void *data);
+
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
{ PLUGIN_DEMUX, 26, "ogg", XINE_VERSION_CODE, &demux_info_ogg, ogg_init_class },
{ PLUGIN_DEMUX, 26, "anx", XINE_VERSION_CODE, &demux_info_anx, anx_init_class },
+#ifdef HAVE_VORBIS
+ { PLUGIN_AUDIO_DECODER, 15, "vorbis", XINE_VERSION_CODE, &dec_info_vorbis, vorbis_init_plugin },
+#endif
+#ifdef HAVE_SPEEX
+ { PLUGIN_AUDIO_DECODER, 15, "speex", XINE_VERSION_CODE, &dec_info_speex, speex_init_plugin },
+#endif
+#ifdef HAVE_THEORA
+ { PLUGIN_VIDEO_DECODER, 18, "theora", XINE_VERSION_CODE, &dec_info_theora, theora_init_plugin },
+#endif
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/libxineadec/xine_speex_decoder.c b/src/combined/xine_speex_decoder.c
index e99585fe5..aca048c8f 100644
--- a/src/libxineadec/xine_speex_decoder.c
+++ b/src/combined/xine_speex_decoder.c
@@ -193,6 +193,7 @@ void read_metadata (speex_decoder_t *this, char * comments, int length)
static void speex_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
speex_decoder_t *this = (speex_decoder_t *) this_gen;
+ char *const buf_content = (char*)buf->content;
llprintf (LOG_BUFFERS, "decode buf=%8p content=%8p flags=%08x\n",
buf, buf->content, buf->decoder_flags);
@@ -211,7 +212,7 @@ static void speex_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
speex_bits_init (&this->bits);
- spx_header = speex_packet_to_header (buf->content, buf->size);
+ spx_header = speex_packet_to_header (buf_content, buf->size);
if (!spx_header) {
xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "libspeex: could not read Speex header\n");
@@ -261,7 +262,7 @@ static void speex_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
free (spx_header);
} else if (this->expect_metadata) {
- read_metadata (this, buf->content, buf->size);
+ read_metadata (this, buf_content, buf->size);
}
this->header_count--;
@@ -282,14 +283,14 @@ static void speex_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
}
} else if (this->output_open) {
- int i, j;
+ int j;
audio_buffer_t *audio_buffer;
audio_buffer =
this->stream->audio_out->get_buffer (this->stream->audio_out);
- speex_bits_read_from (&this->bits, buf->content, buf->size);
+ speex_bits_read_from (&this->bits, buf_content, buf->size);
for (j = 0; j < this->nframes; j++) {
int ret;
@@ -389,7 +390,7 @@ static void dispose_class (audio_decoder_class_t *this) {
free (this);
}
-static void *init_plugin (xine_t *xine, void *data) {
+void *speex_init_plugin (xine_t *xine, void *data) {
speex_class_t *this;
@@ -407,13 +408,7 @@ static uint32_t audio_types[] = {
BUF_AUDIO_SPEEX, 0
};
-static const decoder_info_t dec_info_audio = {
+const decoder_info_t dec_info_speex = {
audio_types, /* supported types */
5 /* priority */
};
-
-const plugin_info_t xine_plugin_info[] EXPORTED = {
- /* type, API, "name", version, special_info, init_function */
- { PLUGIN_AUDIO_DECODER, 15, "speex", XINE_VERSION_CODE, &dec_info_audio, init_plugin },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
-};
diff --git a/src/libxinevdec/xine_theora_decoder.c b/src/combined/xine_theora_decoder.c
index ea968c415..d43affead 100644
--- a/src/libxinevdec/xine_theora_decoder.c
+++ b/src/combined/xine_theora_decoder.c
@@ -63,7 +63,7 @@ typedef struct theora_decoder_s {
xine_stream_t* stream;
int reject;
int op_max_size;
- char* packet;
+ unsigned char* packet;
int done;
int width, height;
double ratio;
@@ -74,7 +74,7 @@ typedef struct theora_decoder_s {
int initialized;
} theora_decoder_t;
-static void readin_op (theora_decoder_t *this, char* src, int size) {
+static void readin_op (theora_decoder_t *this, unsigned char* src, int size) {
if ( this->done+size > this->op_max_size) {
while (this->op_max_size < this->done+size)
this->op_max_size=this->op_max_size*2;
@@ -123,22 +123,23 @@ static void yuv2frame(yuv_buffer *yuv, vo_frame_t *frame, int offset_x, int offs
static int collect_data (theora_decoder_t *this, buf_element_t *buf ) {
/* Assembles an ogg_packet which was sent with send_ogg_packet over xinebuffers */
/* this->done, this->rejected, this->op and this->decoder->flags are needed*/
+ int op_size = sizeof (ogg_packet);
if (buf->decoder_flags & BUF_FLAG_FRAME_START) {
this->done=0; /*start from the beginnig*/
this->reject=0;/*new packet - new try*/
/*copy the ogg_packet struct and the sum, correct the adress of the packet*/
- xine_fast_memcpy (&this->op, buf->content, sizeof(ogg_packet));
+ xine_fast_memcpy (&this->op, buf->content, op_size);
this->op.packet=this->packet;
- readin_op (this, buf->content + sizeof(ogg_packet), buf->size - sizeof(ogg_packet) );
+ readin_op (this, buf->content + op_size, buf->size - op_size );
/*read the rest of the data*/
} else {
if (this->done==0 || this->reject) {
/*we are starting to collect an packet without the beginnig
- reject the rest*/
+ reject the rest*/
printf ("libtheora: rejecting packet\n");
this->reject=1;
return 0;
@@ -369,7 +370,7 @@ static void theora_dispose_class (video_decoder_class_t *this) {
free (this);
}
-static void *init_plugin (xine_t *xine, void *data) {
+void *theora_init_plugin (xine_t *xine, void *data) {
/*initialize our plugin*/
theora_class_t *this;
@@ -389,13 +390,7 @@ static void *init_plugin (xine_t *xine, void *data) {
static uint32_t supported_types[] = { BUF_VIDEO_THEORA, 0 };
-static const decoder_info_t dec_info_video = {
+const decoder_info_t dec_info_theora = {
supported_types, /* supported types */
5 /* priority */
};
-
-const plugin_info_t xine_plugin_info[] EXPORTED = {
- /* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_DECODER, 18, "theora", XINE_VERSION_CODE, &dec_info_video, init_plugin },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
-};
diff --git a/src/libxineadec/xine_vorbis_decoder.c b/src/combined/xine_vorbis_decoder.c
index c7b1e5761..344bd8ed4 100644
--- a/src/libxineadec/xine_vorbis_decoder.c
+++ b/src/combined/xine_vorbis_decoder.c
@@ -94,8 +94,8 @@ static void vorbis_discontinuity (audio_decoder_t *this_gen) {
}
/* Known vorbis comment keys from ogg123 sources*/
-static struct {
- char *key; /* includes the '=' for programming convenience */
+static const struct {
+ const char *key; /* includes the '=' for programming convenience */
int xine_metainfo_index;
} vorbis_comment_keys[] = {
{"ARTIST=", XINE_META_INFO_ARTIST},
@@ -327,7 +327,7 @@ static void dispose_class (audio_decoder_class_t *this) {
free (this);
}
-static void *init_plugin (xine_t *xine, void *data) {
+void *vorbis_init_plugin (xine_t *xine, void *data) {
vorbis_class_t *this;
@@ -345,13 +345,7 @@ static uint32_t audio_types[] = {
BUF_AUDIO_VORBIS, 0
};
-static const decoder_info_t dec_info_audio = {
+const decoder_info_t dec_info_vorbis = {
audio_types, /* supported types */
5 /* priority */
};
-
-const plugin_info_t xine_plugin_info[] EXPORTED = {
- /* type, API, "name", version, special_info, init_function */
- { PLUGIN_AUDIO_DECODER, 15, "vorbis", XINE_VERSION_CODE, &dec_info_audio, init_plugin },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
-};
diff --git a/src/demuxers/Makefile.am b/src/demuxers/Makefile.am
index 83c29f4e3..ac132463b 100644
--- a/src/demuxers/Makefile.am
+++ b/src/demuxers/Makefile.am
@@ -1,30 +1,38 @@
include $(top_srcdir)/misc/Makefile.common
-AM_CFLAGS = $(VISIBILITY_FLAG)
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
AM_LDFLAGS = $(xineplug_ldflags)
-if HAVE_VORBIS
-ogg_module = xineplug_dmx_ogg.la
-endif
+##
+# IMPORTANT:
+# ---------
+# All of xine demuxer plugins should be named like the scheme "xineplug_dmx_"
-if BUILD_ASF
+xineinclude_HEADERS = demux.h
+
+noinst_HEADERS = asfheader.h qtpalette.h group_games.h group_audio.h id3.h ebml.h matroska.h iff.h flacutils.h
+
+if ENABLE_ASF
asf_module = xineplug_dmx_asf.la
endif
-if HAVE_LIBMNG
+if ENABLE_MNG
mng_module = xineplug_dmx_mng.la
endif
+if ENABLE_MODPLUG
+modplug_module = xineplug_dmx_modplug.la
+endif
+
if BUILD_DMX_IMAGE
image_module = xineplug_dmx_image.la
endif
-##
-# IMPORTANT:
-# ---------
-# All of xine demuxer plugins should be named like the scheme "xineplug_dmx_"
-
-xineplug_LTLIBRARIES = $(ogg_module) $(asf_module) $(mng_module) $(image_module) \
+xineplug_LTLIBRARIES = \
+ $(asf_module) \
+ $(mng_module) \
+ $(image_module) \
+ $(modplug_module) \
xineplug_dmx_games.la \
xineplug_dmx_audio.la \
xineplug_dmx_mpeg_ts.la \
@@ -46,10 +54,6 @@ xineplug_LTLIBRARIES = $(ogg_module) $(asf_module) $(mng_module) $(image_module)
xineplug_dmx_iff.la \
xineplug_dmx_flv.la
-xineplug_dmx_ogg_la_SOURCES = demux_ogg.c
-xineplug_dmx_ogg_la_LIBADD = $(VORBIS_LIBS) $(SPEEX_LIBS) $(THEORA_LIBS) $(OGG_LIBS) $(XINE_LIB) $(LTLIBINTL)
-xineplug_dmx_ogg_la_CFLAGS = $(AM_CFLAGS) $(VORBIS_CFLAGS) $(SPEEX_CFLAGS) $(THEORA_CFLAGS) $(OGG_CFLAGS)
-
xineplug_dmx_avi_la_SOURCES = demux_avi.c
xineplug_dmx_avi_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
@@ -70,7 +74,7 @@ xineplug_dmx_mpeg_ts_la_LIBADD = $(XINE_LIB)
xineplug_dmx_qt_la_SOURCES = demux_qt.c
xineplug_dmx_qt_la_LIBADD = $(XINE_LIB) $(ZLIB_LIBS)
-xineplug_dmx_qt_la_CPPFLAGS = $(ZLIB_CPPFLAGS)
+xineplug_dmx_qt_la_CPPFLAGS = $(AM_CPPFLAGS) $(ZLIB_CPPFLAGS)
xineplug_dmx_asf_la_SOURCES = demux_asf.c asfheader.c
xineplug_dmx_asf_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) $(LTLIBICONV)
@@ -90,7 +94,7 @@ xineplug_dmx_rawdv_la_LIBADD = $(XINE_LIB)
xineplug_dmx_mng_la_SOURCES = demux_mng.c
xineplug_dmx_mng_la_LIBADD = $(XINE_LIB) $(ZLIB_LIBS) $(MNG_LIBS)
-xineplug_dmx_mng_la_CPPFLAGS = $(ZLIB_CPPFLAGS)
+xineplug_dmx_mng_la_CPPFLAGS = $(AM_CPPFLAGS) $(ZLIB_CPPFLAGS)
xineplug_dmx_pva_la_SOURCES = demux_pva.c
xineplug_dmx_pva_la_LIBADD = $(XINE_LIB)
@@ -101,17 +105,19 @@ xineplug_dmx_games_la_SOURCES = group_games.c demux_eawve.c \
demux_film.c demux_smjpeg.c demux_4xm.c \
demux_vmd.c
xineplug_dmx_games_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
-xineplug_dmx_games_la_LDFLAGS = -avoid-version -module
xineplug_dmx_audio_la_SOURCES = group_audio.c demux_aud.c demux_aiff.c \
- demux_cdda.c demux_mpgaudio.c demux_nsf.c \
+ demux_cdda.c demux_mpgaudio.c \
demux_realaudio.c demux_snd.c demux_voc.c \
demux_vox.c demux_wav.c demux_ac3.c id3.c \
- demux_aac.c demux_mod.c demux_flac.c \
+ demux_aac.c demux_flac.c \
demux_mpc.c demux_dts.c demux_shn.c \
demux_tta.c
-xineplug_dmx_audio_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) $(LIBMODPLUG_LIBS)
-xineplug_dmx_audio_la_CFLAGS = $(AM_CFLAGS) $(LIBMODPLUG_CFLAGS)
+xineplug_dmx_audio_la_LIBADD = $(XINE_LIB)
+
+xineplug_dmx_modplug_la_SOURCES = demux_mod.c
+xineplug_dmx_modplug_la_LIBADD = $(XINE_LIB) $(LIBMODPLUG_LIBS)
+xineplug_dmx_modplug_la_CFLAGS = $(AM_CFLAGS) $(LIBMODPLUG_CFLAGS)
xineplug_dmx_yuv_frames_la_SOURCES = demux_yuv_frames.c
xineplug_dmx_yuv_frames_la_LIBADD = $(XINE_LIB)
@@ -127,14 +133,11 @@ xineplug_dmx_nsv_la_LIBADD = $(XINE_LIB)
xineplug_dmx_matroska_la_SOURCES = demux_matroska.c ebml.c
xineplug_dmx_matroska_la_LIBADD = $(XINE_LIB) $(ZLIB_LIBS)
-xineplug_dmx_matroska_la_CPPFLAGS = $(ZLIB_CPPFLAGS)
xineplug_dmx_matroska_la_CFLAGS = $(AM_CFLAGS) -fno-strict-aliasing
+xineplug_dmx_matroska_la_CPPFLAGS = $(AM_CPPFLAGS) $(ZLIB_CPPFLAGS)
xineplug_dmx_iff_la_SOURCES = demux_iff.c
xineplug_dmx_iff_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
xineplug_dmx_flv_la_SOURCES = demux_flv.c
xineplug_dmx_flv_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
-
-xineinclude_HEADERS = demux.h
-noinst_HEADERS = asfheader.h qtpalette.h group_games.h group_audio.h id3.h ebml.h matroska.h iff.h flacutils.h
diff --git a/src/demuxers/asfheader.c b/src/demuxers/asfheader.c
index ea92f878b..26a61d8fd 100644
--- a/src/demuxers/asfheader.c
+++ b/src/demuxers/asfheader.c
@@ -152,7 +152,7 @@ static char *asf_reader_get_string(asf_reader_t *reader, size_t size, iconv_t cd
outbuf = scratch;
outbytesleft = sizeof(scratch);
reader->pos += size;
- if (iconv (cd, (ICONV_CONST char **)&inbuf, &inbytesleft, &outbuf, &outbytesleft) != -1) {
+ if (iconv (cd, (ICONV_CONST char **)&inbuf, &inbytesleft, &outbuf, &outbytesleft) != (size_t)-1) {
return strdup(scratch);
} else {
lprintf("iconv error\n");
diff --git a/src/demuxers/demux_asf.c b/src/demuxers/demux_asf.c
index 62e245666..a147068f9 100644
--- a/src/demuxers/demux_asf.c
+++ b/src/demuxers/demux_asf.c
@@ -2042,10 +2042,8 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen,
!strstr(buf,"ASX") &&
strncmp(buf,"[Reference]", 11) &&
strncmp(buf,"ASF ", 4) &&
- ((buf[0] != 0x30)
- || (buf[1] != 0x26)
- || (buf[2] != 0xb2)
- || (buf[3] != 0x75)))
+ memcmp(buf, "\x30\x26\xB2\x75", 4)
+ )
return NULL;
}
diff --git a/src/demuxers/demux_aud.c b/src/demuxers/demux_aud.c
index 8604ea317..23ba15df8 100644
--- a/src/demuxers/demux_aud.c
+++ b/src/demuxers/demux_aud.c
@@ -133,7 +133,7 @@ static int demux_aud_send_chunk(demux_plugin_t *this_gen) {
demux_aud_t *this = (demux_aud_t *) this_gen;
unsigned char chunk_preamble[AUD_CHUNK_PREAMBLE_SIZE];
- unsigned int chunk_size;
+ int chunk_size;
off_t current_file_pos;
int64_t audio_pts;
buf_element_t *buf;
diff --git a/src/demuxers/demux_film.c b/src/demuxers/demux_film.c
index 3a88ddfab..e4c1c1895 100644
--- a/src/demuxers/demux_film.c
+++ b/src/demuxers/demux_film.c
@@ -258,7 +258,7 @@ static int open_film_file(demux_film_t *film) {
film->frequency = _X_BE_32(&film_header[i + 8]);
film->sample_count = _X_BE_32(&film_header[i + 12]);
film->sample_table =
- xine_xmalloc(film->sample_count * sizeof(film_sample_t));
+ xine_xcalloc(film->sample_count, sizeof(film_sample_t));
for (j = 0; j < film->sample_count; j++) {
film->sample_table[j].sample_offset =
diff --git a/src/demuxers/demux_flac.c b/src/demuxers/demux_flac.c
index c1dedb6ce..488a909cb 100644
--- a/src/demuxers/demux_flac.c
+++ b/src/demuxers/demux_flac.c
@@ -166,8 +166,8 @@ static int open_flac_file(demux_flac_t *flac) {
case 3:
lprintf ("SEEKTABLE metadata, %d bytes\n", block_length);
flac->seekpoint_count = block_length / FLAC_SEEKPOINT_SIZE;
- flac->seekpoints = xine_xmalloc(flac->seekpoint_count *
- sizeof(flac_seekpoint_t));
+ flac->seekpoints = xine_xcalloc(flac->seekpoint_count,
+ sizeof(flac_seekpoint_t));
for (i = 0; i < flac->seekpoint_count; i++) {
if (flac->input->read(flac->input, buffer, FLAC_SEEKPOINT_SIZE) != FLAC_SEEKPOINT_SIZE)
return 0;
@@ -193,8 +193,7 @@ static int open_flac_file(demux_flac_t *flac) {
{
char comments[block_length];
char *ptr = comments;
- uint32_t length, user_comment_list_length;
- int cn;
+ uint32_t length, user_comment_list_length, cn;
char *comment;
char c;
diff --git a/src/demuxers/demux_flv.c b/src/demuxers/demux_flv.c
index e607745ed..cb811ae33 100644
--- a/src/demuxers/demux_flv.c
+++ b/src/demuxers/demux_flv.c
@@ -275,7 +275,7 @@ static int parse_flv_var(demux_flv_t *this,
if (key && keylen == 5 && !strncmp(key, "times", 5)) {
if (this->index)
free (this->index);
- this->index = xine_xmalloc(num*sizeof(flv_index_entry_t));
+ this->index = xine_xcalloc(num, sizeof(flv_index_entry_t));
this->num_indices = num;
for (num = 0; num < this->num_indices && tmp < end; num++) {
if (*tmp++ == FLV_DATA_TYPE_NUMBER) {
diff --git a/src/demuxers/demux_idcin.c b/src/demuxers/demux_idcin.c
index f14e36185..5c440ad6e 100644
--- a/src/demuxers/demux_idcin.c
+++ b/src/demuxers/demux_idcin.c
@@ -130,7 +130,7 @@ static int demux_idcin_send_chunk(demux_plugin_t *this_gen) {
unsigned char disk_palette[PALETTE_SIZE * 3];
palette_entry_t palette[PALETTE_SIZE];
int i;
- unsigned int remaining_sample_bytes;
+ int remaining_sample_bytes;
int scale_bits;
/* figure out what the next data is */
@@ -359,7 +359,8 @@ static void demux_idcin_send_headers(demux_plugin_t *this_gen) {
demux_idcin_t *this = (demux_idcin_t *) this_gen;
buf_element_t *buf;
xine_bmiheader *bih = (xine_bmiheader *)this->bih;
- uint32_t i, size;
+ uint32_t i;
+ int size;
this->video_fifo = this->stream->video_fifo;
this->audio_fifo = this->stream->audio_fifo;
diff --git a/src/demuxers/demux_matroska.c b/src/demuxers/demux_matroska.c
index 64ac83a03..b45db701e 100644
--- a/src/demuxers/demux_matroska.c
+++ b/src/demuxers/demux_matroska.c
@@ -68,13 +68,6 @@
#define MAX(a, b) ((a)>(b)?(a):(b))
#endif
-/* FOURCC will be manipulated using machine endian */
-#ifdef WORDS_BIGENDIAN
-#define meFOURCC BE_FOURCC
-#else
-#define meFOURCC LE_FOURCC
-#endif
-
typedef struct {
int track_num;
off_t *pos;
@@ -1319,7 +1312,7 @@ static int parse_track_entry(demux_matroska_t *this, matroska_track_t *track) {
/* create a bitmap info header struct for MPEG 4 */
bih = malloc(sizeof(xine_bmiheader) + track->codec_private_len);
bih->biSize = sizeof(xine_bmiheader) + track->codec_private_len;
- bih->biCompression = meFOURCC('M', 'P', '4', 'S');
+ bih->biCompression = ME_FOURCC('M', 'P', '4', 'S');
bih->biWidth = track->video_track->pixel_width;
bih->biHeight = track->video_track->pixel_height;
_x_bmiheader_le2me(bih);
@@ -1340,7 +1333,7 @@ static int parse_track_entry(demux_matroska_t *this, matroska_track_t *track) {
/* create a bitmap info header struct for h264 */
bih = malloc(sizeof(xine_bmiheader) + track->codec_private_len);
bih->biSize = sizeof(xine_bmiheader) + track->codec_private_len;
- bih->biCompression = meFOURCC('a', 'v', 'c', '1');
+ bih->biCompression = ME_FOURCC('a', 'v', 'c', '1');
bih->biWidth = track->video_track->pixel_width;
bih->biHeight = track->video_track->pixel_height;
_x_bmiheader_le2me(bih);
diff --git a/src/demuxers/demux_mod.c b/src/demuxers/demux_mod.c
index f1b3cdd37..5f8361801 100644
--- a/src/demuxers/demux_mod.c
+++ b/src/demuxers/demux_mod.c
@@ -31,8 +31,6 @@
#include "config.h"
#endif
-#ifdef HAVE_MODPLUG
-
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
@@ -48,7 +46,6 @@
#include "xineutils.h"
#include "compat.h"
#include "demux.h"
-#include "group_audio.h"
#include "modplug.h"
#include "bswap.h"
@@ -377,7 +374,7 @@ static void class_dispose (demux_class_t *this_gen) {
free (this);
}
-void *demux_mod_init_plugin (xine_t *xine, void *data) {
+static void *demux_mod_init_plugin (xine_t *xine, void *data) {
demux_mod_class_t *this;
this = xine_xmalloc (sizeof (demux_mod_class_t));
@@ -392,4 +389,11 @@ void *demux_mod_init_plugin (xine_t *xine, void *data) {
return this;
}
-#endif /* HAVE_MODPLUG */
+static const demuxer_info_t demux_info_mod = {
+ 10 /* priority */
+};
+
+const plugin_info_t xine_plugin_info[] EXPORTED = {
+ { PLUGIN_DEMUX, 26, "modplug", XINE_VERSION_CODE, &demux_info_mod, demux_mod_init_plugin },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
diff --git a/src/demuxers/demux_mpgaudio.c b/src/demuxers/demux_mpgaudio.c
index 78b81a1d4..ef22af16b 100644
--- a/src/demuxers/demux_mpgaudio.c
+++ b/src/demuxers/demux_mpgaudio.c
@@ -413,7 +413,7 @@ static vbri_header_t* parse_vbri_header(mpg_audio_frame_t *frame,
lprintf("entry_frames: %d\n", vbri->entry_frames);
if ((ptr + (vbri->toc_entries + 1) * vbri->entry_size) >= (buf + bufsize)) return 0;
- vbri->toc = xine_xmalloc (sizeof(int) * (vbri->toc_entries + 1));
+ vbri->toc = xine_xcalloc ((vbri->toc_entries + 1), sizeof(int));
if (!vbri->toc) {
free (vbri);
return NULL;
@@ -697,7 +697,7 @@ static int detect_mpgaudio_file(input_plugin_t *input) {
* id3v2 are not specific to mp3 files,
* flac files can contain id3v2 tags
*/
- uint32_t tag_size = _X_BE_32_synchsafe(&buf[6]);
+ int tag_size = _X_BE_32_synchsafe(&buf[6]);
lprintf("try to skip id3v2 tag (%d bytes)\n", tag_size);
if ((10 + tag_size) >= preview_len) {
lprintf("cannot skip id3v2 tag\n");
diff --git a/src/demuxers/demux_qt.c b/src/demuxers/demux_qt.c
index 1e0bdebab..dffcfac55 100644
--- a/src/demuxers/demux_qt.c
+++ b/src/demuxers/demux_qt.c
@@ -110,6 +110,8 @@ typedef unsigned int qt_atom;
#define UDTA_ATOM QT_ATOM('u', 'd', 't', 'a')
#define META_ATOM QT_ATOM('m', 'e', 't', 'a')
+#define HDLR_ATOM QT_ATOM('h', 'd', 'l', 'r')
+#define ILST_ATOM QT_ATOM('i', 'l', 's', 't')
#define NAM_ATOM QT_ATOM(0xA9, 'n', 'a', 'm')
#define CPY_ATOM QT_ATOM(0xA9, 'c', 'p', 'y')
#define DES_ATOM QT_ATOM(0xA9, 'd', 'e', 's')
@@ -136,8 +138,10 @@ typedef unsigned int qt_atom;
#define MAX_PTS_DIFF 100000
-/* network bandwidth, cribbed from src/input/input_mms.c */
-const int64_t bandwidths[]={14400,19200,28800,33600,34430,57600,
+/**
+ * @brief Network bandwidth, cribbed from src/input/input_mms.c
+ */
+static const int64_t bandwidths[]={14400,19200,28800,33600,34430,57600,
115200,262200,393216,524300,1544000,10485800};
/* these are things that can go wrong */
@@ -404,6 +408,10 @@ typedef struct {
* demuxer is sending off to the audio decoder */
#define DEBUG_AUDIO_DEMUX 0
+/* define DEBUG_META_LOAD as 1 to see details about the metadata chunks the
+ * demuxer is reading from the file */
+#define DEBUG_META_LOAD 0
+
/* Define DEBUG_DUMP_MOOV as 1 to dump the raw moov atom to disk. This is
* particularly useful in debugging a file with a compressed moov (cmov)
* atom. The atom will be dumped to the filename specified as
@@ -411,10 +419,6 @@ typedef struct {
#define DEBUG_DUMP_MOOV 0
#define RAW_MOOV_FILENAME "moovatom.raw"
-#ifndef __GNUC__
-#define __attribute__(x)
-#endif
-
#if DEBUG_ATOM_LOAD
#define debug_atom_load printf
#else
@@ -445,6 +449,12 @@ static inline void XINE_FORMAT_PRINTF(1, 2) debug_video_demux(const char *format
static inline void XINE_FORMAT_PRINTF(1, 2) debug_audio_demux(const char *format, ...) {}
#endif
+#if DEBUG_META_LOAD
+#define debug_meta_load printf
+#else
+static inline void XINE_FORMAT_PRINTF(1, 2) debug_meta_load(const char *format, ...) {}
+#endif
+
static inline void dump_moov_atom(unsigned char *moov_atom, int moov_atom_size) {
#if DEBUG_DUMP_MOOV
@@ -729,52 +739,114 @@ static int is_qt_file(input_plugin_t *qt_file) {
}
}
+static char *parse_data_atom(unsigned char *data_atom) {
+ const uint32_t data_atom_size = _X_BE_32(&data_atom[0]);
+
+ static const int data_atom_max_version = 0;
+ const int data_atom_version = data_atom[8];
+
+ const size_t alloc_size = data_atom_size - 8 + 1;
+ char *alloc_str = NULL;
+
+ if ( data_atom_version > data_atom_max_version ) {
+ debug_meta_load("demux_qt: version %d for data atom is higher than the highest supported version (%d)\n",
+ data_atom_version, data_atom_max_version);
+ return NULL;
+ }
+
+ alloc_str = xine_xmalloc(alloc_size);
+ xine_fast_memcpy(alloc_str, &data_atom[16], alloc_size-1);
+ alloc_str[alloc_size-1] = '\0';
+
+ debug_meta_load("demux_qt: got a string of size %zd (%s)\n", alloc_size, alloc_str);
+
+ return alloc_str;
+}
+
/* parse out a meta data atom */
static void parse_meta_atom(qt_info *info, unsigned char *meta_atom) {
- int i;
- unsigned int meta_atom_size = _X_BE_32(&meta_atom[0]);
- qt_atom current_atom;
- int string_size;
-
- for (i = 0; i < meta_atom_size - 4; i++) {
- current_atom = _X_BE_32(&meta_atom[i]);
-
- if (current_atom == ART_ATOM) {
- string_size = _X_BE_32(&meta_atom[i + 4]) - 16 + 1;
- info->artist = xine_xmalloc(string_size);
- strncpy(info->artist, &meta_atom[i + 20], string_size - 1);
- info->artist[string_size - 1] = 0;
- } else if (current_atom == NAM_ATOM) {
- string_size = _X_BE_32(&meta_atom[i + 4]) - 16 + 1;
- info->name = xine_xmalloc(string_size);
- strncpy(info->name, &meta_atom[i + 20], string_size - 1);
- info->name[string_size - 1] = 0;
- } else if (current_atom == ALB_ATOM) {
- string_size = _X_BE_32(&meta_atom[i + 4]) - 16 + 1;
- info->album = xine_xmalloc(string_size);
- strncpy(info->album, &meta_atom[i + 20], string_size - 1);
- info->album[string_size - 1] = 0;
- } else if (current_atom == GEN_ATOM) {
- string_size = _X_BE_32(&meta_atom[i + 4]) - 16 + 1;
- info->genre = xine_xmalloc(string_size);
- strncpy(info->genre, &meta_atom[i + 20], string_size - 1);
- info->genre[string_size - 1] = 0;
- } else if (current_atom == TOO_ATOM) {
- string_size = _X_BE_32(&meta_atom[i + 4]) - 16 + 1;
- info->comment = xine_xmalloc(string_size);
- strncpy(info->comment, &meta_atom[i + 20], string_size - 1);
- info->comment[string_size - 1] = 0;
- } else if (current_atom == WRT_ATOM) {
- string_size = _X_BE_32(&meta_atom[i + 4]) - 16 + 1;
- info->composer = xine_xmalloc(string_size);
- strncpy(info->composer, &meta_atom[i + 20], string_size - 1);
- info->composer[string_size - 1] = 0;
- } else if (current_atom == DAY_ATOM) {
- string_size = _X_BE_32(&meta_atom[i + 4]) - 16 + 1;
- info->year = xine_xmalloc(string_size);
- strncpy(info->year, &meta_atom[i + 20], string_size - 1);
- info->year[string_size - 1] = 0;
+ static const uint32_t meta_atom_preamble_size = 12;
+
+ const uint32_t meta_atom_size = _X_BE_32(&meta_atom[0]);
+
+ static const int meta_atom_max_version = 0;
+ const int meta_atom_version = meta_atom[8];
+ /* const uint32_t flags = _X_BE_24(&meta_atom[9]); */
+
+ uint32_t i = meta_atom_preamble_size;
+
+ if ( meta_atom_version > meta_atom_max_version ) {
+ debug_meta_load("demux_qt: version %d for meta atom is higher than the highest supported version (%d)\n",
+ meta_atom_version, meta_atom_max_version);
+ return;
+ }
+
+ while ( i < meta_atom_size ) {
+ const uint8_t *const current_atom = &meta_atom[i];
+ const qt_atom current_atom_code = _X_BE_32(&current_atom[4]);
+ const uint32_t current_atom_size = _X_BE_32(&current_atom[0]);
+ uint32_t handler_type = 0;
+
+ switch (current_atom_code) {
+ case HDLR_ATOM: {
+ static const int hdlr_atom_max_version = 0;
+ const int hdlr_atom_version = current_atom[8];
+
+ /* const uint32_t hdlr_atom_flags = _X_BE_24(&current_atom[9]); */
+
+ if ( hdlr_atom_version > hdlr_atom_max_version ) {
+ debug_meta_load("demux_qt: version %d for hdlr atom is higher than the highest supported version (%d)\n",
+ hdlr_atom_version, hdlr_atom_max_version);
+ return;
+ }
+
+ handler_type = _X_BE_32(&current_atom[12]);
}
+ break;
+
+ case ILST_ATOM: {
+ uint32_t j = i + 8;
+ while ( j < current_atom_size ) {
+ const uint8_t *const sub_atom = &meta_atom[j];
+ const qt_atom sub_atom_code = _X_BE_32(&sub_atom[4]);
+ const uint32_t sub_atom_size = _X_BE_32(&sub_atom[0]);
+
+ switch(sub_atom_code) {
+ case ART_ATOM:
+ info->artist = parse_data_atom(&sub_atom[8]);
+ break;
+ case NAM_ATOM:
+ info->name = parse_data_atom(&sub_atom[8]);
+ break;
+ case ALB_ATOM:
+ info->album = parse_data_atom(&sub_atom[8]);
+ break;
+ case GEN_ATOM:
+ info->genre = parse_data_atom(&sub_atom[8]);
+ break;
+ case CMT_ATOM:
+ info->comment = parse_data_atom(&sub_atom[8]);
+ break;
+ case WRT_ATOM:
+ info->composer = parse_data_atom(&sub_atom[8]);
+ break;
+ case DAY_ATOM:
+ info->year = parse_data_atom(&sub_atom[8]);
+ break;
+ default:
+ debug_meta_load("unknown atom %08x in ilst\n", sub_atom_code);
+ }
+
+ j += sub_atom_size;
+ }
+ }
+ break;
+
+ default:
+ debug_meta_load("unknown atom %08x in meta\n", current_atom_code);
+ }
+
+ i += current_atom_size;
}
}
@@ -816,25 +888,11 @@ static qt_error parse_trak_atom (qt_trak *trak,
unsigned char *trak_atom) {
int i, j, k;
- unsigned int trak_atom_size = _X_BE_32(&trak_atom[0]);
- qt_atom current_atom;
- unsigned int current_atom_size;
+ const unsigned int trak_atom_size = _X_BE_32(&trak_atom[0]);
unsigned int atom_pos;
unsigned int properties_offset;
- unsigned int current_stsd_atom_size;
qt_error last_error = QT_OK;
- /* for palette traversal */
- int color_depth;
- int color_flag;
- int color_start;
- int color_count;
- int color_end;
- int color_index;
- int color_dec;
- int color_greyscale;
- const unsigned char *color_table;
-
/* initialize trak structure */
trak->edit_list_count = 0;
trak->edit_list_table = NULL;
@@ -865,12 +923,13 @@ static qt_error parse_trak_atom (qt_trak *trak,
/* search for media type atoms */
for (i = ATOM_PREAMBLE_SIZE; i < trak_atom_size - 4; i++) {
- current_atom = _X_BE_32(&trak_atom[i]);
+ const qt_atom current_atom = _X_BE_32(&trak_atom[i]);
- if (current_atom == VMHD_ATOM) {
+ switch (current_atom) {
+ case VMHD_ATOM:
trak->type = MEDIA_VIDEO;
break;
- } else if (current_atom == SMHD_ATOM) {
+ case SMHD_ATOM:
trak->type = MEDIA_AUDIO;
break;
}
@@ -882,13 +941,15 @@ static qt_error parse_trak_atom (qt_trak *trak,
/* search for the useful atoms */
for (i = ATOM_PREAMBLE_SIZE; i < trak_atom_size - 4; i++) {
- current_atom_size = _X_BE_32(&trak_atom[i - 4]);
- current_atom = _X_BE_32(&trak_atom[i]);
+ const current_atom_size = _X_BE_32(&trak_atom[i - 4]);
+ const current_atom = _X_BE_32(&trak_atom[i]);
- if (current_atom == TKHD_ATOM) {
+ switch(current_atom) {
+ case TKHD_ATOM:
trak->flags = _X_BE_16(&trak_atom[i + 6]);
- } else if (current_atom == ELST_ATOM) {
+ break;
+ case ELST_ATOM:
/* there should only be one edit list table */
if (trak->edit_list_table) {
last_error = QT_HEADER_TROUBLE;
@@ -918,17 +979,19 @@ static qt_error parse_trak_atom (qt_trak *trak,
trak->edit_list_table[j].track_duration,
trak->edit_list_table[j].media_time);
}
+ break;
- } else if (current_atom == MDHD_ATOM) {
- int version;
+ case MDHD_ATOM:
debug_atom_load ("demux_qt: mdhd atom\n");
-
- version = trak_atom[i+4];
- if ( version > 1 ) continue; /* unsupported, undocumented */
+ {
+ const int version = trak_atom[i+4];
+ if ( version > 1 ) continue; /* unsupported, undocumented */
- trak->timescale = _X_BE_32(&trak_atom[i + (version == 0 ? 0x10 : 0x18) ]);
- } else if (current_atom == STSD_ATOM) {
+ trak->timescale = _X_BE_32(&trak_atom[i + (version == 0 ? 0x10 : 0x18) ]);
+ }
+ break;
+ case STSD_ATOM:
debug_atom_load ("demux_qt: stsd atom\n");
#if DEBUG_ATOM_LOAD
xine_hexdump (&trak_atom[i], current_atom_size);
@@ -936,18 +999,28 @@ static qt_error parse_trak_atom (qt_trak *trak,
/* allocate space for each of the properties unions */
trak->stsd_atoms_count = _X_BE_32(&trak_atom[i + 8]);
- trak->stsd_atoms = xine_xmalloc(trak->stsd_atoms_count * sizeof(properties_t));
+ trak->stsd_atoms = xine_xcalloc(trak->stsd_atoms_count, sizeof(properties_t));
if (!trak->stsd_atoms) {
last_error = QT_NO_MEMORY;
goto free_trak;
}
- memset(trak->stsd_atoms, 0, trak->stsd_atoms_count * sizeof(properties_t));
atom_pos = i + 0x10;
properties_offset = 0x0C;
for (k = 0; k < trak->stsd_atoms_count; k++) {
- current_stsd_atom_size = _X_BE_32(&trak_atom[atom_pos - 4]);
+ const uint32_t current_stsd_atom_size = _X_BE_32(&trak_atom[atom_pos - 4]);
+
+ /* for palette traversal */
+ int color_depth;
+ int color_flag;
+ int color_start;
+ int color_count;
+ int color_end;
+ int color_index;
+ int color_dec;
+ int color_greyscale;
+ const unsigned char *color_table;
if (trak->type == MEDIA_VIDEO) {
@@ -1228,7 +1301,7 @@ static qt_error parse_trak_atom (qt_trak *trak,
(_X_BE_32(&trak_atom[atom_pos + 0x34]) == WAVE_ATOM) &&
(_X_BE_32(&trak_atom[atom_pos + 0x3C]) == FRMA_ATOM) &&
(_X_ME_32(&trak_atom[atom_pos + 0x48]) == trak->stsd_atoms[k].audio.codec_fourcc)) {
- int wave_size = _X_BE_32(&trak_atom[atom_pos + 0x44]) - 8;
+ const int wave_size = _X_BE_32(&trak_atom[atom_pos + 0x44]) - 8;
if ((wave_size >= sizeof(xine_waveformatex)) &&
(current_atom_size >= (0x4C + wave_size))) {
@@ -1278,15 +1351,15 @@ static qt_error parse_trak_atom (qt_trak *trak,
atom_pos += current_stsd_atom_size;
properties_offset += current_stsd_atom_size;
}
-
- } else if (current_atom == ESDS_ATOM) {
-
- uint32_t len;
+ break;
+
+ case ESDS_ATOM:
debug_atom_load(" qt/mpeg-4 esds atom\n");
if ((trak->type == MEDIA_VIDEO) ||
(trak->type == MEDIA_AUDIO)) {
+ uint32_t len;
j = i + 8;
if( trak_atom[j++] == 0x03 ) {
@@ -1309,17 +1382,17 @@ static qt_error parse_trak_atom (qt_trak *trak,
}
}
}
+ break;
- } else if (current_atom == AVCC_ATOM) {
-
+ case AVCC_ATOM:
debug_atom_load(" avcC atom\n");
trak->decoder_config_len = current_atom_size - 8;
trak->decoder_config = realloc(trak->decoder_config, trak->decoder_config_len);
memcpy(trak->decoder_config, &trak_atom[i + 4], trak->decoder_config_len);
+ break;
- } else if (current_atom == STSZ_ATOM) {
-
+ case STSZ_ATOM:
/* there should only be one of these atoms */
if (trak->sample_size_table) {
last_error = QT_HEADER_TROUBLE;
@@ -1351,9 +1424,9 @@ static qt_error parse_trak_atom (qt_trak *trak,
/* set the pointer to non-NULL to indicate that the atom type has
* already been seen for this trak atom */
trak->sample_size_table = (void *)-1;
+ break;
- } else if (current_atom == STSS_ATOM) {
-
+ case STSS_ATOM:
/* there should only be one of these atoms */
if (trak->sync_sample_table) {
last_error = QT_HEADER_TROUBLE;
@@ -1380,9 +1453,9 @@ static qt_error parse_trak_atom (qt_trak *trak,
j, trak->sync_sample_table[j],
trak->sync_sample_table[j] - 1);
}
+ break;
- } else if (current_atom == STCO_ATOM) {
-
+ case STCO_ATOM:
/* there should only be one of either stco or co64 */
if (trak->chunk_offset_table) {
last_error = QT_HEADER_TROUBLE;
@@ -1408,9 +1481,9 @@ static qt_error parse_trak_atom (qt_trak *trak,
debug_atom_load(" chunk %d @ 0x%"PRIX64"\n",
j, trak->chunk_offset_table[j]);
}
+ break;
- } else if (current_atom == CO64_ATOM) {
-
+ case CO64_ATOM:
/* there should only be one of either stco or co64 */
if (trak->chunk_offset_table) {
last_error = QT_HEADER_TROUBLE;
@@ -1439,9 +1512,9 @@ static qt_error parse_trak_atom (qt_trak *trak,
debug_atom_load(" chunk %d @ 0x%"PRIX64"\n",
j, trak->chunk_offset_table[j]);
}
+ break;
- } else if (current_atom == STSC_ATOM) {
-
+ case STSC_ATOM:
/* there should only be one of these atoms */
if (trak->sample_to_chunk_table) {
last_error = QT_HEADER_TROUBLE;
@@ -1474,9 +1547,9 @@ static qt_error parse_trak_atom (qt_trak *trak,
trak->sample_to_chunk_table[j].first_chunk - 1,
trak->sample_to_chunk_table[j].media_id);
}
+ break;
- } else if (current_atom == STTS_ATOM) {
-
+ case STTS_ATOM:
/* there should only be one of these atoms */
if (trak->time_to_sample_table) {
last_error = QT_HEADER_TROUBLE;
@@ -1536,9 +1609,7 @@ static qt_error parse_reference_atom (reference_t *ref,
char *base_mrl) {
int i, j;
- unsigned int ref_atom_size = _X_BE_32(&ref_atom[0]);
- qt_atom current_atom;
- unsigned int current_atom_size;
+ const unsigned int ref_atom_size = _X_BE_32(&ref_atom[0]);
/* initialize reference atom */
ref->url = NULL;
@@ -1547,11 +1618,11 @@ static qt_error parse_reference_atom (reference_t *ref,
/* traverse through the atom looking for the key atoms */
for (i = ATOM_PREAMBLE_SIZE; i < ref_atom_size - 4; i++) {
+ const uint32_t current_atom_size = _X_BE_32(&ref_atom[i - 4]);
+ const qt_atom current_atom = _X_BE_32(&ref_atom[i]);
- current_atom_size = _X_BE_32(&ref_atom[i - 4]);
- current_atom = _X_BE_32(&ref_atom[i]);
-
- if (current_atom == RDRF_ATOM) {
+ switch (current_atom) {
+ case RDRF_ATOM:
/* if the URL starts with "http://", copy it */
if (strncmp(&ref_atom[i + 16], "http://", 7) == 0
@@ -1580,17 +1651,17 @@ static qt_error parse_reference_atom (reference_t *ref,
}
debug_atom_load(" qt rdrf URL reference:\n %s\n", ref->url);
+ break;
- } else if (current_atom == RMDR_ATOM) {
-
+ case RMDR_ATOM:
/* load the data rate */
ref->data_rate = _X_BE_32(&ref_atom[i + 8]);
ref->data_rate *= 10;
debug_atom_load(" qt rmdr data rate = %"PRId64"\n", ref->data_rate);
+ break;
- } else if (current_atom == RMVC_ATOM) {
-
+ case RMVC_ATOM:
debug_atom_load(" qt rmvc atom\n");
/* search the rmvc atom for 'qtim'; 2 bytes will follow the qtim
@@ -1918,7 +1989,6 @@ static void parse_moov_atom(qt_info *info, unsigned char *moov_atom,
int64_t bandwidth) {
int i, j;
unsigned int moov_atom_size = _X_BE_32(&moov_atom[0]);
- qt_atom current_atom;
int string_size, error;
unsigned int max_video_frames = 0;
unsigned int max_audio_frames = 0;
@@ -1933,15 +2003,17 @@ static void parse_moov_atom(qt_info *info, unsigned char *moov_atom,
/* prowl through the moov atom looking for very specific targets */
for (i = ATOM_PREAMBLE_SIZE + 4; i < moov_atom_size - 4; i += _X_BE_32(&moov_atom[i - 4])) {
- current_atom = _X_BE_32(&moov_atom[i]);
+ const qt_atom current_atom = _X_BE_32(&moov_atom[i]);
- if (current_atom == MVHD_ATOM) {
+ switch (current_atom) {
+ case MVHD_ATOM:
parse_mvhd_atom(info, &moov_atom[i - 4]);
if (info->last_error != QT_OK)
return;
- } else if (current_atom == TRAK_ATOM) {
+ break;
+ case TRAK_ATOM:
/* create a new trak structure */
info->trak_count++;
info->traks = (qt_trak *)realloc(info->traks,
@@ -1953,44 +2025,50 @@ static void parse_moov_atom(qt_info *info, unsigned char *moov_atom,
info->trak_count--;
return;
}
+ break;
+
+ case UDTA_ATOM:
+ parse_meta_atom(info, &moov_atom[i + 4]);
+ if (info->last_error != QT_OK)
+ return;
+ break;
- } else if (current_atom == META_ATOM) {
-
+ case META_ATOM:
parse_meta_atom(info, &moov_atom[i - 4]);
if (info->last_error != QT_OK)
return;
+ break;
- } else if (current_atom == NAM_ATOM) {
-
+ case NAM_ATOM:
string_size = _X_BE_16(&moov_atom[i + 4]) + 1;
info->name = realloc (info->name, string_size);
strncpy(info->name, &moov_atom[i + 8], string_size - 1);
info->name[string_size - 1] = 0;
+ break;
- } else if (current_atom == CPY_ATOM) {
-
+ case CPY_ATOM:
string_size = _X_BE_16(&moov_atom[i + 4]) + 1;
info->copyright = realloc (info->copyright, string_size);
strncpy(info->copyright, &moov_atom[i + 8], string_size - 1);
info->copyright[string_size - 1] = 0;
+ break;
- } else if (current_atom == DES_ATOM) {
-
+ case DES_ATOM:
string_size = _X_BE_16(&moov_atom[i + 4]) + 1;
info->description = realloc (info->description, string_size);
strncpy(info->description, &moov_atom[i + 8], string_size - 1);
info->description[string_size - 1] = 0;
+ break;
- } else if (current_atom == CMT_ATOM) {
-
+ case CMT_ATOM:
string_size = _X_BE_16(&moov_atom[i + 4]) + 1;
info->comment = realloc (info->comment, string_size);
strncpy(info->comment, &moov_atom[i + 8], string_size - 1);
info->comment[string_size - 1] = 0;
+ break;
- } else if (current_atom == RMDA_ATOM ||
- current_atom == RMRA_ATOM) {
-
+ case RMDA_ATOM:
+ case RMRA_ATOM:
/* create a new reference structure */
info->reference_count++;
info->references = (reference_t *)realloc(info->references,
@@ -1998,8 +2076,9 @@ static void parse_moov_atom(qt_info *info, unsigned char *moov_atom,
parse_reference_atom(&info->references[info->reference_count - 1],
&moov_atom[i - 4], info->base_mrl);
+ break;
- } else {
+ default:
debug_atom_load(" qt: unknown atom into the moov atom (0x%08X)\n", current_atom);
}
}
diff --git a/src/demuxers/demux_real.c b/src/demuxers/demux_real.c
index b58366e91..b27b01a10 100644
--- a/src/demuxers/demux_real.c
+++ b/src/demuxers/demux_real.c
@@ -692,7 +692,7 @@ unknown:
this->video_stream->mdpr->avg_bit_rate);
/* Allocate fragment offset table */
- this->fragment_tab = xine_xmalloc(FRAGMENT_TAB_SIZE*sizeof(uint32_t));
+ this->fragment_tab = xine_xcalloc(FRAGMENT_TAB_SIZE, sizeof(uint32_t));
this->fragment_tab_max = FRAGMENT_TAB_SIZE;
}
@@ -1282,7 +1282,7 @@ static int demux_real_send_chunk(demux_plugin_t *this_gen) {
frames = (stream_read_word(this) & 0xf0) >> 4;
/* 2 bytes per frame size */
- sizes = xine_xmalloc(frames*sizeof(int));
+ sizes = xine_xcalloc(frames, sizeof(int));
for(i = 0; i < frames; i++)
sizes[i] = stream_read_word(this);
diff --git a/src/demuxers/demux_realaudio.c b/src/demuxers/demux_realaudio.c
index 139ad24f4..2c315519e 100644
--- a/src/demuxers/demux_realaudio.c
+++ b/src/demuxers/demux_realaudio.c
@@ -313,8 +313,6 @@ static int demux_ra_get_status (demux_plugin_t *this_gen) {
/* return the approximate length in miliseconds */
static int demux_ra_get_stream_length (demux_plugin_t *this_gen) {
- demux_ra_t *this = (demux_ra_t *) this_gen;
-
return 0;
}
diff --git a/src/demuxers/demux_ts.c b/src/demuxers/demux_ts.c
index 0d82c7bae..bf557533e 100644
--- a/src/demuxers/demux_ts.c
+++ b/src/demuxers/demux_ts.c
@@ -1333,7 +1333,6 @@ printf("Program Number is %i, looking for %i\n",program_number,this->program_num
case ISO_13818_PES_PRIVATE:
for (i = 5; i < coded_length; i += stream[i+1] + 2) {
if ((stream[i] == 0x6a) && (this->audio_tracks_count < MAX_AUDIO_TRACKS)) {
- uint32_t format_identifier=0;
int i, found = 0;
for(i = 0; i < this->audio_tracks_count; i++) {
if(this->audio_tracks[i].pid == pid) {
@@ -2273,9 +2272,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen,
this->status = DEMUX_FINISHED;
#ifdef TS_READ_STATS
- for (i=0; i<=NPKT_PER_READ; i++) {
- this->rstat[i] = 0;
- }
+ memset(this-rstat, 0, sizeof(*this->rstat)*NPKT_PER_READ);
#endif
/* DVBSUB */
diff --git a/src/demuxers/demux_tta.c b/src/demuxers/demux_tta.c
index ab0936d88..4d53c5d3f 100644
--- a/src/demuxers/demux_tta.c
+++ b/src/demuxers/demux_tta.c
@@ -32,6 +32,7 @@
#include "buffer.h"
#include "bswap.h"
#include "group_audio.h"
+#include "attributes.h"
typedef struct {
demux_plugin_t demux_plugin;
@@ -56,7 +57,7 @@ typedef struct {
uint32_t samplerate;
uint32_t data_length;
uint32_t crc32;
- } __attribute__((__packed__)) tta;
+ } XINE_PACKED tta;
uint8_t buffer[22]; /* This is the size of the header */
} header;
} demux_tta_t;
@@ -65,16 +66,14 @@ typedef struct {
demux_class_t demux_class;
} demux_tta_class_t;
-#define FOURCC_32(a, b, c, d) (d + (c<<8) + (b<<16) + (a<<24))
-
static int open_tta_file(demux_tta_t *this) {
- uint8_t peek[4];
+ uint32_t peek;
uint32_t framelen;
- if (_x_demux_read_header(this->input, peek, 4) != 4)
+ if (_x_demux_read_header(this->input, &peek, 4) != 4)
return 0;
- if ( _X_BE_32(peek) != FOURCC_32('T', 'T', 'A', '1') )
+ if ( peek != ME_FOURCC('T', 'T', 'A', '1') )
return 0;
if ( this->input->read(this->input, this->header.buffer, sizeof(this->header)) != sizeof(this->header) )
@@ -89,7 +88,7 @@ static int open_tta_file(demux_tta_t *this) {
return 0;
}
- this->seektable = xine_xmalloc(sizeof(uint32_t)*this->totalframes);
+ this->seektable = xine_xcalloc(this->totalframes, sizeof(uint32_t));
this->input->read(this->input, this->seektable, sizeof(uint32_t)*this->totalframes);
/* Skip the CRC32 */
diff --git a/src/demuxers/demux_wc3movie.c b/src/demuxers/demux_wc3movie.c
index 7ab10c0aa..b02c3fa93 100644
--- a/src/demuxers/demux_wc3movie.c
+++ b/src/demuxers/demux_wc3movie.c
@@ -380,17 +380,15 @@ static int open_mve_file(demux_mve_t *this) {
this->number_of_shots = _X_LE_32(&preamble[0]);
/* allocate space for the shot offset index and set offsets to 0 */
- this->shot_offsets = xine_xmalloc(this->number_of_shots * sizeof(off_t));
+ this->shot_offsets = xine_xcalloc(this->number_of_shots, sizeof(off_t));
this->current_shot = 0;
- for (i = 0; i < this->number_of_shots; i++)
- this->shot_offsets[i] = 0;
/* skip the SOND chunk */
this->input->seek(this->input, 12, SEEK_CUR);
/* load the palette chunks */
- this->palettes = xine_xmalloc(this->number_of_shots * PALETTE_SIZE *
- sizeof(palette_entry_t));
+ this->palettes = xine_xcalloc(this->number_of_shots, PALETTE_SIZE *
+ sizeof(palette_entry_t));
for (i = 0; i < this->number_of_shots; i++) {
/* make sure there was a valid palette chunk preamble */
if (this->input->read(this->input, preamble, PREAMBLE_SIZE) !=
diff --git a/src/demuxers/group_audio.c b/src/demuxers/group_audio.c
index a498a3799..449c2ad12 100644
--- a/src/demuxers/group_audio.c
+++ b/src/demuxers/group_audio.c
@@ -71,10 +71,6 @@ static const demuxer_info_t demux_info_mpc = {
1 /* priority */
};
-static const demuxer_info_t demux_info_nsf = {
- 10 /* priority */
-};
-
static const demuxer_info_t demux_info_realaudio = {
10 /* priority */
};
@@ -103,12 +99,6 @@ static const demuxer_info_t demux_info_wav = {
6 /* priority */
};
-#ifdef HAVE_MODPLUG
-static const demuxer_info_t demux_info_mod = {
- 10 /* priority */
-};
-#endif
-
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
{ PLUGIN_DEMUX, 26, "aac", XINE_VERSION_CODE, &demux_info_aac, demux_aac_init_plugin },
@@ -120,7 +110,6 @@ const plugin_info_t xine_plugin_info[] EXPORTED = {
{ PLUGIN_DEMUX, 26, "flac", XINE_VERSION_CODE, &demux_info_flac, demux_flac_init_plugin },
{ PLUGIN_DEMUX, 26, "mp3", XINE_VERSION_CODE, &demux_info_mpgaudio, demux_mpgaudio_init_class },
{ PLUGIN_DEMUX, 26, "mpc", XINE_VERSION_CODE, &demux_info_mpc, demux_mpc_init_plugin },
- { PLUGIN_DEMUX, 26, "nsf", XINE_VERSION_CODE, &demux_info_nsf, demux_nsf_init_plugin },
{ PLUGIN_DEMUX, 26, "realaudio", XINE_VERSION_CODE, &demux_info_realaudio, demux_realaudio_init_plugin },
{ PLUGIN_DEMUX, 26, "shn", XINE_VERSION_CODE, &demux_info_shn, demux_shn_init_plugin },
{ PLUGIN_DEMUX, 26, "snd", XINE_VERSION_CODE, &demux_info_snd, demux_snd_init_plugin },
@@ -128,8 +117,5 @@ const plugin_info_t xine_plugin_info[] EXPORTED = {
{ PLUGIN_DEMUX, 26, "voc", XINE_VERSION_CODE, &demux_info_voc, demux_voc_init_plugin },
{ PLUGIN_DEMUX, 26, "vox", XINE_VERSION_CODE, &demux_info_vox, demux_vox_init_plugin },
{ PLUGIN_DEMUX, 26, "wav", XINE_VERSION_CODE, &demux_info_wav, demux_wav_init_plugin },
-#ifdef HAVE_MODPLUG
- { PLUGIN_DEMUX, 26, "mod", XINE_VERSION_CODE, &demux_info_mod, demux_mod_init_plugin },
-#endif
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/demuxers/group_audio.h b/src/demuxers/group_audio.h
index 7f1fccc5e..984b7c88e 100644
--- a/src/demuxers/group_audio.h
+++ b/src/demuxers/group_audio.h
@@ -34,7 +34,6 @@ void *demux_dts_init_plugin (xine_t *xine, void *data);
void *demux_flac_init_plugin (xine_t *xine, void *data);
void *demux_mpgaudio_init_class (xine_t *xine, void *data);
void *demux_mpc_init_plugin (xine_t *xine, void *data);
-void *demux_nsf_init_plugin (xine_t *xine, void *data);
void *demux_realaudio_init_plugin (xine_t *xine, void *data);
void *demux_shn_init_plugin (xine_t *xine, void *data);
void *demux_snd_init_plugin (xine_t *xine, void *data);
@@ -43,8 +42,4 @@ void *demux_voc_init_plugin (xine_t *xine, void *data);
void *demux_vox_init_plugin (xine_t *xine, void *data);
void *demux_wav_init_plugin (xine_t *xine, void *data);
-#ifdef HAVE_MODPLUG
-void *demux_mod_init_plugin (xine_t *xine, void *data);
-#endif
-
#endif
diff --git a/src/demuxers/id3.c b/src/demuxers/id3.c
index bc7902168..843b4e9e3 100644
--- a/src/demuxers/id3.c
+++ b/src/demuxers/id3.c
@@ -337,7 +337,7 @@ static int id3v22_interp_frame(input_plugin_t *input,
int id3v22_parse_tag(input_plugin_t *input,
xine_stream_t *stream,
- int8_t *mp3_frame_header) {
+ uint8_t *mp3_frame_header) {
id3v2_header_t tag_header;
id3v22_frame_header_t tag_frame_header;
int pos = 0;
@@ -530,7 +530,7 @@ static int id3v23_interp_frame(input_plugin_t *input,
int id3v23_parse_tag(input_plugin_t *input,
xine_stream_t *stream,
- int8_t *mp3_frame_header) {
+ uint8_t *mp3_frame_header) {
id3v2_header_t tag_header;
id3v23_frame_header_t tag_frame_header;
id3v23_frame_ext_header_t tag_frame_ext_header;
@@ -781,7 +781,7 @@ static int id3v24_interp_frame(input_plugin_t *input,
int id3v24_parse_tag(input_plugin_t *input,
xine_stream_t *stream,
- int8_t *mp3_frame_header) {
+ uint8_t *mp3_frame_header) {
id3v2_header_t tag_header;
id3v24_frame_header_t tag_frame_header;
id3v24_frame_ext_header_t tag_frame_ext_header;
@@ -849,7 +849,7 @@ int id3v24_parse_tag(input_plugin_t *input,
int id3v2_parse_tag(input_plugin_t *input,
xine_stream_t *stream,
- int8_t *mp3_frame_header) {
+ uint8_t *mp3_frame_header) {
_x_assert(mp3_frame_header[0] == 'I' && mp3_frame_header[1] == 'D' && mp3_frame_header[2] == '3');
int result = 0;
diff --git a/src/demuxers/id3.h b/src/demuxers/id3.h
index a5ab0bd1d..eea5930f1 100644
--- a/src/demuxers/id3.h
+++ b/src/demuxers/id3.h
@@ -155,20 +155,20 @@ int id3v1_parse_tag (input_plugin_t *input, xine_stream_t *stream);
int id3v22_parse_tag(input_plugin_t *input,
xine_stream_t *stream,
- int8_t *mp3_frame_header);
+ uint8_t *mp3_frame_header);
int id3v23_parse_tag(input_plugin_t *input,
xine_stream_t *stream,
- int8_t *mp3_frame_header);
+ uint8_t *mp3_frame_header);
int id3v24_parse_tag(input_plugin_t *input,
xine_stream_t *stream,
- int8_t *mp3_frame_header);
+ uint8_t *mp3_frame_header);
/* Generic function that switch between the three above */
int id3v2_parse_tag(input_plugin_t *input,
xine_stream_t *stream,
- int8_t *mp3_frame_header);
+ uint8_t *mp3_frame_header);
/**
* @brief Checks if the given buffer is an ID3 tag preamble
diff --git a/src/dxr3/Makefile.am b/src/dxr3/Makefile.am
index 3368dbe94..f53a2d081 100644
--- a/src/dxr3/Makefile.am
+++ b/src/dxr3/Makefile.am
@@ -1,40 +1,41 @@
include $(top_srcdir)/misc/Makefile.common
-AM_CFLAGS = $(X_CFLAGS) $(LIBFAME_CFLAGS)
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_CPPFLAGS =
+AM_LDFLAGS = $(xineplug_ldflags)
-if HAVE_DXR3
-dxr3_modules = xineplug_decode_dxr3_video.la \
- xineplug_decode_dxr3_spu.la \
- xineplug_vo_out_dxr3.la
-endif
if HAVE_X11
+AM_CFLAGS += $(X_CFLAGS)
link_x_libs = $(X_LIBS) -lXext
endif
if HAVE_LIBFAME
-link_fame = $(LIBFAME_LIBS)
+AM_CFLAGS += $(LIBFAME_CFLAGS)
+link_fame = $(LIBFAME_LIBS)
endif
if HAVE_LIBRTE
link_rte = -lrte
endif
-xineplug_LTLIBRARIES = $(dxr3_modules)
+noinst_HEADERS = em8300.h dxr3.h dxr3_scr.h video_out_dxr3.h
+
+if ENABLE_DXR3
+xineplug_LTLIBRARIES = xineplug_decode_dxr3_video.la \
+ xineplug_decode_dxr3_spu.la \
+ xineplug_vo_out_dxr3.la
+endif
xineplug_decode_dxr3_video_la_SOURCES = dxr3_decode_video.c
xineplug_decode_dxr3_video_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
-xineplug_decode_dxr3_video_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_decode_dxr3_video_la_LDFLAGS = -avoid-version -module
-if HAVE_DVDNAV
-AM_CPPFLAGS = $(DVDNAV_CFLAGS)
+if WITH_EXTERNAL_DVDNAV
xineplug_decode_dxr3_spu_la_SOURCES = dxr3_decode_spu.c
xineplug_decode_dxr3_spu_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) $(DVDNAV_LIBS)
+xineplug_decode_dxr3_spu_la_CFLAGS = $(AM_CFLAGS) $(DVDNAV_CFLAGS)
else
-AM_CPPFLAGS = -I$(top_srcdir)/src/input/libdvdnav
xineplug_decode_dxr3_spu_la_SOURCES = dxr3_decode_spu.c nav_read.c
xineplug_decode_dxr3_spu_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
+xineplug_decode_dxr3_spu_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/src/input/libdvdnav
endif
-xineplug_decode_dxr3_spu_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_decode_dxr3_spu_la_LDFLAGS = -avoid-version -module
xineplug_vo_out_dxr3_la_SOURCES = \
dxr3_mpeg_encoders.c \
@@ -43,11 +44,3 @@ xineplug_vo_out_dxr3_la_SOURCES = \
video_out_dxr3.c
xineplug_vo_out_dxr3_la_LIBADD = $(link_fame) $(link_rte) $(link_x_libs) $(XINE_LIB) $(LTLIBINTL) $(DYNAMIC_LD_LIBS) -lm
-xineplug_vo_out_dxr3_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_vo_out_dxr3_la_LDFLAGS = -avoid-version -module
-
-noinst_HEADERS = \
- em8300.h \
- dxr3.h \
- dxr3_scr.h \
- video_out_dxr3.h
diff --git a/src/input/Makefile.am b/src/input/Makefile.am
index e6476530b..0b966ce8e 100644
--- a/src/input/Makefile.am
+++ b/src/input/Makefile.am
@@ -1,12 +1,8 @@
include $(top_srcdir)/misc/Makefile.common
-EXTRA_DIST = input_dvd.c input_vcd.c input_gnome_vfs.c input_rtp.c
-
-if HAVE_DVDNAV
-SUBDIRS = vcd dvb libreal librtsp
-else
-SUBDIRS = vcd dvb libreal librtsp libdvdnav
-endif
+# REVISIT: This second line here bothers me more than just a little bit
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_LDFLAGS = $(xineplug_ldflags)
##
# IMPORTANT:
@@ -14,46 +10,58 @@ endif
# All of xine input plugins should be named like the scheme "xineplug_inp_"
#
-if HAVE_CDROM_IOCTLS
+SUBDIRS = libreal librtsp
+if ENABLE_VCD
+SUBDIRS += vcd
+endif
+if !WITH_EXTERNAL_DVDNAV
+SUBDIRS += libdvdnav
+endif
+
+
+xineinclude_HEADERS = input_plugin.h
+noinst_HEADERS = net_buf_ctrl.h mms.h mmsh.h pnm.h media_helper.h videodev2.h http_helper.h
+
+
+if ENABLE_DVB
+in_dvb = xineplug_inp_dvb.la
+endif
+
+if ENABLE_VCDO
in_vcd = xineplug_inp_vcdo.la
endif
-if HAVE_V4L
+if ENABLE_V4L
in_v4l = xineplug_inp_v4l.la
in_pvr = xineplug_inp_pvr.la
endif
-if HAVE_GNOME_VFS
+if ENABLE_GNOME_VFS
in_gnome_vfs = xineplug_inp_gnome_vfs.la
endif
-if HAVE_LIBSMBCLIENT
+if ENABLE_LIBSMBCLIENT
in_smb = xineplug_inp_smb.la
endif
-# For DVD
-in_dvd = xineplug_inp_dvd.la
-if HAVE_DVDNAV
-DVD_CFLAGS = $(DVDNAV_CFLAGS)
+if WITH_EXTERNAL_DVDNAV
+DVD_CFLAGS = $(DVDNAV_CFLAGS)
link_dvdnav = $(DVDNAV_LIBS)
else
-DVD_CFLAGS = -I$(top_srcdir)/src/input/libdvdnav/
+DVD_CFLAGS = -I$(top_srcdir)/src/input/libdvdnav
link_dvdnav = libdvdnav/libdvdnav.la
endif
# not ported to native Windows
-if WIN32
-else
+if !WIN32
in_rtp = xineplug_inp_rtp.la
-in_dvb = xineplug_inp_dvb.la
endif
-AM_CFLAGS = -D_LARGEFILE64_SOURCE $(GNOME_VFS_CFLAGS) $(ALSA_CFLAGS) $(DVD_CFLAGS)
xineplug_LTLIBRARIES = \
xineplug_inp_file.la \
xineplug_inp_http.la \
- $(in_dvd) \
+ xineplug_inp_dvd.la \
$(in_vcd) \
$(in_v4l) \
$(in_gnome_vfs) \
@@ -71,84 +79,55 @@ xineplug_LTLIBRARIES = \
xineplug_inp_file_la_SOURCES = input_file.c
xineplug_inp_file_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
-xineplug_inp_file_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_inp_file_la_LDFLAGS = -avoid-version -module
xineplug_inp_dvd_la_SOURCES = input_dvd.c media_helper.c
-xineplug_inp_dvd_la_LIBADD = $(XINE_LIB) $(link_dvdnav) $(PTHREAD_LIBS) $(DYNAMIC_LD_LIBS) $(LTLIBINTL)
-xineplug_inp_dvd_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_inp_dvd_la_LDFLAGS = -avoid-version -module
+xineplug_inp_dvd_la_LIBADD = $(XINE_LIB) $(link_dvdnav) $(PTHREAD_LIBS) $(DYNAMIC_LD_LIBS)
+xineplug_inp_dvd_la_CFLAGS = $(AM_CFLAGS) $(DVD_CFLAGS)
xineplug_inp_net_la_SOURCES = input_net.c net_buf_ctrl.c
xineplug_inp_net_la_LIBADD = $(XINE_LIB) $(NET_LIBS) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_inp_net_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_inp_net_la_LDFLAGS = -avoid-version -module
xineplug_inp_mms_la_SOURCES = input_mms.c net_buf_ctrl.c mms.c mmsh.c http_helper.c ../demuxers/asfheader.c
xineplug_inp_mms_la_LIBADD = $(XINE_LIB) $(LTLIBICONV) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_inp_mms_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_inp_mms_la_LDFLAGS = -avoid-version -module
xineplug_inp_vcdo_la_SOURCES = input_vcd.c media_helper.c
xineplug_inp_vcdo_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
-xineplug_inp_vcdo_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_inp_vcdo_la_LDFLAGS = -avoid-version -module
xineplug_inp_stdin_fifo_la_SOURCES = input_stdin_fifo.c net_buf_ctrl.c
xineplug_inp_stdin_fifo_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_inp_stdin_fifo_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_inp_stdin_fifo_la_LDFLAGS = -avoid-version -module
xineplug_inp_rtp_la_SOURCES = input_rtp.c net_buf_ctrl.c
xineplug_inp_rtp_la_LIBADD = $(XINE_LIB) $(NET_LIBS) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_inp_rtp_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_inp_rtp_la_LDFLAGS = -avoid-version -module
xineplug_inp_http_la_SOURCES = input_http.c net_buf_ctrl.c http_helper.c
xineplug_inp_http_la_LIBADD = $(XINE_LIB) $(NET_LIBS) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_inp_http_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_inp_http_la_LDFLAGS = -avoid-version -module
xineplug_inp_pnm_la_SOURCES = input_pnm.c net_buf_ctrl.c pnm.c
xineplug_inp_pnm_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_inp_pnm_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_inp_pnm_la_LDFLAGS = -avoid-version -module
xineplug_inp_dvb_la_SOURCES = input_dvb.c net_buf_ctrl.c
-xineplug_inp_dvb_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_inp_dvb_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_inp_dvb_la_LDFLAGS = -avoid-version -module
+xineplug_inp_dvb_la_DEPS = $(XDG_BASEDIR_DEPS)
+xineplug_inp_dvb_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL) $(XDG_BASEDIR_LIBS)
+xineplug_inp_dvb_la_CPPFLAGS = $(AM_CPPFLAGS) $(XDG_BASEDIR_CPPFLAGS)
xineplug_inp_rtsp_la_SOURCES = input_rtsp.c net_buf_ctrl.c
xineplug_inp_rtsp_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL) libreal/libreal.la librtsp/librtsp.la
-xineplug_inp_rtsp_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_inp_rtsp_la_LDFLAGS = -avoid-version -module
xineplug_inp_cdda_la_SOURCES = input_cdda.c media_helper.c sha1.c sha1.h base64.c base64.h
-xineplug_inp_cdda_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
-xineplug_inp_cdda_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_inp_cdda_la_LDFLAGS = -avoid-version -module
+xineplug_inp_cdda_la_DEPS = $(XDG_BASEDIR_DEPS)
+xineplug_inp_cdda_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) $(XDG_BASEDIR_LIBS)
+xineplug_inp_cdda_la_CPPFLAGS = $(AM_CPPFLAGS) $(XDG_BASEDIR_CPPFLAGS)
xineplug_inp_v4l_la_SOURCES = input_v4l.c
xineplug_inp_v4l_la_LIBADD = $(ALSA_LIBS) $(XINE_LIB) $(LTLIBINTL)
-xineplug_inp_v4l_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_inp_v4l_la_LDFLAGS = -avoid-version -module
+xineplug_inp_v4l_la_CFLAGS = $(AM_CFLAGS) $(ALSA_CFLAGS)
xineplug_inp_gnome_vfs_la_SOURCES = input_gnome_vfs.c net_buf_ctrl.c
xineplug_inp_gnome_vfs_la_LIBADD = $(GNOME_VFS_LIBS) $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_inp_gnome_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_inp_gnome_vfs_la_LDFLAGS = -avoid-version -module
+xineplug_inp_gnome_vfs_la_CFLAGS = $(AM_CFLAGS) $(GNOME_VFS_CFLAGS)
xineplug_inp_smb_la_SOURCES = input_smb.c
xineplug_inp_smb_la_LIBADD = $(LIBSMBCLIENT_LIBS) $(XINE_LIB) $(LTLIBINTL)
-xineplug_inp_smb_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_inp_smb_la_LDFLAGS = -avoid-version -module
xineplug_inp_pvr_la_SOURCES = input_pvr.c
xineplug_inp_pvr_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_inp_pvr_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_inp_pvr_la_LDFLAGS = -avoid-version -module
-
-xineinclude_HEADERS = input_plugin.h
-noinst_HEADERS = net_buf_ctrl.h mms.h mmsh.h pnm.h media_helper.h videodev2.h http_helper.h
-
diff --git a/src/input/dvb/Makefile.am b/src/input/dvb/Makefile.am
deleted file mode 100644
index 229ac21bf..000000000
--- a/src/input/dvb/Makefile.am
+++ /dev/null
@@ -1,5 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-noinst_HEADERS = \
- dmx.h \
- frontend.h
diff --git a/src/input/dvb/dmx.h b/src/input/dvb/dmx.h
deleted file mode 100644
index 51d3c48cd..000000000
--- a/src/input/dvb/dmx.h
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * dmx.h
- *
- * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
- * & Ralph Metzler <ralph@convergence.de>
- for convergence integrated media GmbH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef _DMX_H_
-#define _DMX_H_
-
-#ifdef __KERNEL__
-#include <linux/types.h>
-#else
-#if HAVE_INTTYPES_H
-#include <inttypes.h>
-#else
-#if HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#endif
-#endif
-
-#define DMX_FILTER_SIZE 16
-
-typedef enum
-{
- DMX_OUT_DECODER, /* Streaming directly to decoder. */
- DMX_OUT_TAP, /* Output going to a memory buffer */
- /* (to be retrieved via the read command).*/
- DMX_OUT_TS_TAP /* Output multiplexed into a new TS */
- /* (to be retrieved by reading from the */
- /* logical DVR device). */
-} dmx_output_t;
-
-
-typedef enum
-{
- DMX_IN_FRONTEND, /* Input from a front-end device. */
- DMX_IN_DVR /* Input from the logical DVR device. */
-} dmx_input_t;
-
-
-typedef enum
-{
- DMX_PES_AUDIO0,
- DMX_PES_VIDEO0,
- DMX_PES_TELETEXT0,
- DMX_PES_SUBTITLE0,
- DMX_PES_PCR0,
-
- DMX_PES_AUDIO1,
- DMX_PES_VIDEO1,
- DMX_PES_TELETEXT1,
- DMX_PES_SUBTITLE1,
- DMX_PES_PCR1,
-
- DMX_PES_AUDIO2,
- DMX_PES_VIDEO2,
- DMX_PES_TELETEXT2,
- DMX_PES_SUBTITLE2,
- DMX_PES_PCR2,
-
- DMX_PES_AUDIO3,
- DMX_PES_VIDEO3,
- DMX_PES_TELETEXT3,
- DMX_PES_SUBTITLE3,
- DMX_PES_PCR3,
-
- DMX_PES_OTHER
-} dmx_pes_type_t;
-
-#define DMX_PES_AUDIO DMX_PES_AUDIO0
-#define DMX_PES_VIDEO DMX_PES_VIDEO0
-#define DMX_PES_TELETEXT DMX_PES_TELETEXT0
-#define DMX_PES_SUBTITLE DMX_PES_SUBTITLE0
-#define DMX_PES_PCR DMX_PES_PCR0
-
-
-typedef enum
-{
- DMX_SCRAMBLING_EV,
- DMX_FRONTEND_EV
-} dmx_event_t;
-
-
-typedef enum
-{
- DMX_SCRAMBLING_OFF,
- DMX_SCRAMBLING_ON
-} dmx_scrambling_status_t;
-
-
-typedef struct dmx_filter
-{
- uint8_t filter[DMX_FILTER_SIZE];
- uint8_t mask[DMX_FILTER_SIZE];
- uint8_t mode[DMX_FILTER_SIZE];
-} dmx_filter_t;
-
-
-struct dmx_sct_filter_params
-{
- uint16_t pid;
- dmx_filter_t filter;
- uint32_t timeout;
- uint32_t flags;
-#define DMX_CHECK_CRC 1
-#define DMX_ONESHOT 2
-#define DMX_IMMEDIATE_START 4
-#define DMX_KERNEL_CLIENT 0x8000
-};
-
-
-struct dmx_pes_filter_params
-{
- uint16_t pid;
- dmx_input_t input;
- dmx_output_t output;
- dmx_pes_type_t pes_type;
- uint32_t flags;
-};
-
-
-struct dmx_event
-{
- dmx_event_t event;
- time_t timeStamp;
- union
- {
- dmx_scrambling_status_t scrambling;
- } u;
-};
-
-typedef struct dmx_caps {
- uint32_t caps;
- int num_decoders;
-} dmx_caps_t;
-
-typedef enum {
- DMX_SOURCE_FRONT0 = 0,
- DMX_SOURCE_FRONT1,
- DMX_SOURCE_FRONT2,
- DMX_SOURCE_FRONT3,
- DMX_SOURCE_DVR0 = 16,
- DMX_SOURCE_DVR1,
- DMX_SOURCE_DVR2,
- DMX_SOURCE_DVR3
-} dmx_source_t;
-
-
-#define DMX_START _IO('o',41)
-#define DMX_STOP _IO('o',42)
-#define DMX_SET_FILTER _IOW('o',43,struct dmx_sct_filter_params)
-#define DMX_SET_PES_FILTER _IOW('o',44,struct dmx_pes_filter_params)
-#define DMX_SET_BUFFER_SIZE _IO('o',45)
-#define DMX_GET_EVENT _IOR('o',46,struct dmx_event)
-#define DMX_GET_PES_PIDS _IOR('o',47,uint16_t[5])
-#define DMX_GET_CAPS _IOR('o',48,dmx_caps_t)
-#define DMX_SET_SOURCE _IOW('o',49,dmx_source_t)
-
-#endif /*_DMX_H_*/
-
diff --git a/src/input/dvb/frontend.h b/src/input/dvb/frontend.h
deleted file mode 100644
index aa671d43d..000000000
--- a/src/input/dvb/frontend.h
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
- * frontend.h
- *
- * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
- * Ralph Metzler <ralph@convergence.de>
- * Holger Waechtler <holger@convergence.de>
- * Andre Draszik <ad@convergence.de>
- * for convergence integrated media GmbH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef _FRONTEND_H_
-#define _FRONTEND_H_
-
-#ifdef __KERNEL__
-#include <linux/types.h>
-#else
-#if HAVE_INTTYPE_H
-#include <inttypes.h>
-#else
-#if HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#endif
-#endif
-
-
-typedef enum {
- FE_QPSK,
- FE_QAM,
- FE_OFDM,
- FE_ATSC
-} fe_type_t;
-
-
-typedef enum {
- FE_IS_STUPID = 0,
- FE_CAN_INVERSION_AUTO = 0x1,
- FE_CAN_FEC_1_2 = 0x2,
- FE_CAN_FEC_2_3 = 0x4,
- FE_CAN_FEC_3_4 = 0x8,
- FE_CAN_FEC_4_5 = 0x10,
- FE_CAN_FEC_5_6 = 0x20,
- FE_CAN_FEC_6_7 = 0x40,
- FE_CAN_FEC_7_8 = 0x80,
- FE_CAN_FEC_8_9 = 0x100,
- FE_CAN_FEC_AUTO = 0x200,
- FE_CAN_QPSK = 0x400,
- FE_CAN_QAM_16 = 0x800,
- FE_CAN_QAM_32 = 0x1000,
- FE_CAN_QAM_64 = 0x2000,
- FE_CAN_QAM_128 = 0x4000,
- FE_CAN_QAM_256 = 0x8000,
- FE_CAN_QAM_AUTO = 0x10000,
- FE_CAN_TRANSMISSION_MODE_AUTO = 0x20000,
- FE_CAN_BANDWIDTH_AUTO = 0x40000,
- FE_CAN_GUARD_INTERVAL_AUTO = 0x80000,
- FE_CAN_HIERARCHY_AUTO = 0x100000,
- FE_CAN_8VSB = 0x200000,
- FE_CAN_16VSB = 0x400000,
- FE_CAN_MUTE_TS = 0x80000000,
- FE_CAN_CLEAN_SETUP = 0x40000000
-} fe_caps_t;
-
-
-struct dvb_frontend_info {
- char name[128];
- fe_type_t type;
- uint32_t frequency_min;
- uint32_t frequency_max;
- uint32_t frequency_stepsize;
- uint32_t frequency_tolerance;
- uint32_t symbol_rate_min;
- uint32_t symbol_rate_max;
- uint32_t symbol_rate_tolerance; /* ppm */
- uint32_t notifier_delay; /* ms */
- fe_caps_t caps;
-};
-
-
-/**
- * Check out the DiSEqC bus spec available on http://www.eutelsat.org/ for
- * the meaning of this struct...
- */
-struct dvb_diseqc_master_cmd {
- uint8_t msg [6]; /* { framing, address, command, data [3] } */
- uint8_t msg_len; /* valid values are 3...6 */
-};
-
-
-struct dvb_diseqc_slave_reply {
- uint8_t msg [4]; /* { framing, data [3] } */
- uint8_t msg_len; /* valid values are 0...4, 0 means no msg */
- int timeout; /* return from ioctl after timeout ms with */
-}; /* errorcode when no message was received */
-
-
-typedef enum {
- SEC_VOLTAGE_13,
- SEC_VOLTAGE_18
-} fe_sec_voltage_t;
-
-
-typedef enum {
- SEC_TONE_ON,
- SEC_TONE_OFF
-} fe_sec_tone_mode_t;
-
-
-typedef enum {
- SEC_MINI_A,
- SEC_MINI_B
-} fe_sec_mini_cmd_t;
-
-
-typedef enum {
- FE_HAS_SIGNAL = 0x01, /* found something above the noise level */
- FE_HAS_CARRIER = 0x02, /* found a DVB signal */
- FE_HAS_VITERBI = 0x04, /* FEC is stable */
- FE_HAS_SYNC = 0x08, /* found sync bytes */
- FE_HAS_LOCK = 0x10, /* everything's working... */
- FE_TIMEDOUT = 0x20, /* no lock within the last ~2 seconds */
- FE_REINIT = 0x40 /* frontend was reinitialized, */
-} fe_status_t; /* application is recommned to reset */
- /* DiSEqC, tone and parameters */
-
-typedef enum {
- INVERSION_OFF,
- INVERSION_ON,
- INVERSION_AUTO
-} fe_spectral_inversion_t;
-
-
-typedef enum {
- FEC_NONE = 0,
- FEC_1_2,
- FEC_2_3,
- FEC_3_4,
- FEC_4_5,
- FEC_5_6,
- FEC_6_7,
- FEC_7_8,
- FEC_8_9,
- FEC_AUTO
-} fe_code_rate_t;
-
-
-typedef enum {
- QPSK,
- QAM_16,
- QAM_32,
- QAM_64,
- QAM_128,
- QAM_256,
- QAM_AUTO,
- VSB_8,
- VSB_16
-} fe_modulation_t;
-
-
-typedef enum {
- TRANSMISSION_MODE_2K,
- TRANSMISSION_MODE_8K,
- TRANSMISSION_MODE_AUTO
-} fe_transmit_mode_t;
-
-typedef enum {
- BANDWIDTH_8_MHZ,
- BANDWIDTH_7_MHZ,
- BANDWIDTH_6_MHZ,
- BANDWIDTH_AUTO
-} fe_bandwidth_t;
-
-
-typedef enum {
- GUARD_INTERVAL_1_32,
- GUARD_INTERVAL_1_16,
- GUARD_INTERVAL_1_8,
- GUARD_INTERVAL_1_4,
- GUARD_INTERVAL_AUTO
-} fe_guard_interval_t;
-
-
-typedef enum {
- HIERARCHY_NONE,
- HIERARCHY_1,
- HIERARCHY_2,
- HIERARCHY_4,
- HIERARCHY_AUTO
-} fe_hierarchy_t;
-
-
-struct dvb_qpsk_parameters {
- uint32_t symbol_rate; /* symbol rate in Symbols per second */
- fe_code_rate_t fec_inner; /* forward error correction (see above) */
-};
-
-
-struct dvb_qam_parameters {
- uint32_t symbol_rate; /* symbol rate in Symbols per second */
- fe_code_rate_t fec_inner; /* forward error correction (see above) */
- fe_modulation_t modulation; /* modulation type (see above) */
-};
-
-struct dvb_vsb_parameters {
- fe_modulation_t modulation; /* modulation type (see above) */
-};
-
-struct dvb_ofdm_parameters {
- fe_bandwidth_t bandwidth;
- fe_code_rate_t code_rate_HP; /* high priority stream code rate */
- fe_code_rate_t code_rate_LP; /* low priority stream code rate */
- fe_modulation_t constellation; /* modulation type (see above) */
- fe_transmit_mode_t transmission_mode;
- fe_guard_interval_t guard_interval;
- fe_hierarchy_t hierarchy_information;
-};
-
-
-struct dvb_frontend_parameters {
- uint32_t frequency; /* (absolute) frequency in Hz for QAM/OFDM */
- /* intermediate frequency in kHz for QPSK */
- fe_spectral_inversion_t inversion;
- union {
- struct dvb_qpsk_parameters qpsk;
- struct dvb_qam_parameters qam;
- struct dvb_ofdm_parameters ofdm;
- struct dvb_vsb_parameters vsb;
- } u;
-};
-
-
-struct dvb_frontend_event {
- fe_status_t status;
- struct dvb_frontend_parameters parameters;
-};
-
-
-
-#define FE_GET_INFO _IOR('o', 61, struct dvb_frontend_info)
-
-#define FE_DISEQC_RESET_OVERLOAD _IO('o', 62)
-#define FE_DISEQC_SEND_MASTER_CMD _IOW('o', 63, struct dvb_diseqc_master_cmd)
-#define FE_DISEQC_RECV_SLAVE_REPLY _IOR('o', 64, struct dvb_diseqc_slave_reply)
-#define FE_DISEQC_SEND_BURST _IO('o', 65) /* fe_sec_mini_cmd_t */
-
-#define FE_SET_TONE _IO('o', 66) /* fe_sec_tone_mode_t */
-#define FE_SET_VOLTAGE _IO('o', 67) /* fe_sec_voltage_t */
-#define FE_ENABLE_HIGH_LNB_VOLTAGE _IO('o', 68) /* int */
-
-#define FE_READ_STATUS _IOR('o', 69, fe_status_t)
-#define FE_READ_BER _IOR('o', 70, uint32_t)
-#define FE_READ_SIGNAL_STRENGTH _IOR('o', 71, uint16_t)
-#define FE_READ_SNR _IOR('o', 72, uint16_t)
-#define FE_READ_UNCORRECTED_BLOCKS _IOR('o', 73, uint32_t)
-
-#define FE_SET_FRONTEND _IOW('o', 76, struct dvb_frontend_parameters)
-#define FE_GET_FRONTEND _IOR('o', 77, struct dvb_frontend_parameters)
-#define FE_GET_EVENT _IOR('o', 78, struct dvb_frontend_event)
-
-
-#endif /*_FRONTEND_H_*/
-
diff --git a/src/input/input_cdda.c b/src/input/input_cdda.c
index 0b1f046e8..029658fe1 100644
--- a/src/input/input_cdda.c
+++ b/src/input/input_cdda.c
@@ -41,6 +41,9 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
+#ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+#endif
#ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
@@ -55,6 +58,8 @@
#include <netinet/in.h>
#include <sys/socket.h>
+#include <basedir.h>
+
#define LOG_MODULE "input_cdda"
#define LOG_VERBOSE
/*
@@ -128,7 +133,6 @@ typedef struct {
int enabled;
char *server;
int port;
- char *cache_dir;
char *cdiscid;
char *disc_title;
@@ -1187,15 +1191,6 @@ static void port_changed_cb(void *data, xine_cfg_entry_t *cfg) {
this->cddb.port = cfg->num_value;
}
}
-static void cachedir_changed_cb(void *data, xine_cfg_entry_t *cfg) {
- cdda_input_class_t *class = (cdda_input_class_t *) data;
-
- if(class->ip) {
- cdda_input_plugin_t *this = class->ip;
-
- this->cddb.cache_dir = cfg->str_value;
- }
-}
#ifdef CDROM_SELECT_SPEED
static void speed_changed_cb(void *data, xine_cfg_entry_t *cfg) {
cdda_input_class_t *class = (cdda_input_class_t *) data;
@@ -1337,18 +1332,6 @@ static void _cdda_mkdir_recursive_safe(xine_t *xine, char *path) {
}
/*
- * Where, by default, cddb cache files will be saved
- */
-static char *_cdda_cddb_get_default_location(void) {
- static char buf[XINE_PATH_MAX + XINE_NAME_MAX + 1];
-
- memset(&buf, 0, sizeof(buf));
- snprintf(buf, sizeof(buf), "%s/.xine/cddbcache", (xine_get_homedir()));
-
- return buf;
-}
-
-/*
* Read from socket, fill char *s, return size length.
*/
static int _cdda_cddb_socket_read(cdda_input_plugin_t *this, char *str, int size) {
@@ -1447,15 +1430,18 @@ static int _cdda_cddb_handle_code(char *buf) {
* Try to load cached cddb infos
*/
static int _cdda_load_cached_cddb_infos(cdda_input_plugin_t *this) {
- char cdir[XINE_PATH_MAX + XINE_NAME_MAX + 1];
+ char *cdir = NULL;
DIR *dir;
+ const char *const xdg_cache_home = xdgCacheHome(this->stream->xine->basedir_handle);
+
if(this == NULL)
return 0;
- memset(&cdir, 0, sizeof(cdir));
- snprintf(cdir, sizeof(cdir), "%s", this->cddb.cache_dir);
-
+ cdir = alloca(strlen(xdg_cache_home) + sizeof("/"PACKAGE"/cddb"));
+ strcpy(cdir, xdg_cache_home);
+ strcat(cdir, "/"PACKAGE"/cddb");
+
if((dir = opendir(cdir)) != NULL) {
struct dirent *pdir;
@@ -1579,20 +1565,23 @@ static int _cdda_load_cached_cddb_infos(cdda_input_plugin_t *this) {
* Save cddb grabbed infos.
*/
static void _cdda_save_cached_cddb_infos(cdda_input_plugin_t *this, char *filecontent) {
- char cfile[XINE_PATH_MAX + XINE_NAME_MAX + 1];
FILE *fd;
-
+ char *cfile;
+
+ const char *const xdg_cache_home = xdgCacheHome(this->stream->xine->basedir_handle);
+
if((this == NULL) || (filecontent == NULL))
return;
- memset(&cfile, 0, sizeof(cfile));
+ /* the filename is always 8 characters */
+ cfile = alloca(strlen(xdg_cache_home) + sizeof("/"PACKAGE"/cddb") + 9);
+ strcpy(cfile, xdg_cache_home);
+ strcat(cfile, "/"PACKAGE"/cddb");
- /* Ensure "~/.xine/cddbcache" exist */
- snprintf(cfile, sizeof(cfile), "%s", this->cddb.cache_dir);
-
+ /* Ensure the cache directory exists */
_cdda_mkdir_recursive_safe(this->stream->xine, cfile);
- snprintf(cfile, sizeof(cfile), "%s/%08lx", this->cddb.cache_dir, this->cddb.disc_id);
+ sprintf(cfile, "%s/%08lx", cfile, this->cddb.disc_id);
if((fd = fopen(cfile, "w")) == NULL) {
xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
@@ -2253,7 +2242,7 @@ static uint32_t cdda_plugin_get_capabilities (input_plugin_t *this_gen) {
}
-static off_t cdda_plugin_read (input_plugin_t *this_gen, char *buf, off_t len) {
+static off_t cdda_plugin_read (input_plugin_t *this_gen, void *buf, off_t len) {
/* only allow reading in block-sized chunks */
@@ -2463,7 +2452,7 @@ static int cdda_plugin_open (input_plugin_t *this_gen ) {
if(this->cddb.num_tracks) {
int t;
- this->cddb.track = (trackinfo_t *) xine_xmalloc(sizeof(trackinfo_t) * this->cddb.num_tracks);
+ this->cddb.track = (trackinfo_t *) xine_xcalloc(this->cddb.num_tracks, sizeof(trackinfo_t));
for(t = 0; t < this->cddb.num_tracks; t++) {
int length = (toc->toc_entries[t].first_frame_minute * CD_SECONDS_PER_MINUTE +
@@ -2608,7 +2597,7 @@ static input_plugin_t *cdda_class_get_instance (input_class_t *cls_gen, xine_str
cdda_input_plugin_t *this;
cdda_input_class_t *class = (cdda_input_class_t *) cls_gen;
int track;
- xine_cfg_entry_t enable_entry, server_entry, port_entry, cachedir_entry;
+ xine_cfg_entry_t enable_entry, server_entry, port_entry;
char *cdda_device = NULL;
int cddb_error = class->cddb_error;
@@ -2689,10 +2678,6 @@ static input_plugin_t *cdda_class_get_instance (input_class_t *cls_gen, xine_str
&port_entry))
port_changed_cb(class, &port_entry);
- if(xine_config_lookup_entry(this->stream->xine, "media.audio_cd.cddb_cachedir",
- &cachedir_entry))
- cachedir_changed_cb(class, &cachedir_entry);
-
class->cddb_error = cddb_error;
return (input_plugin_t *)this;
@@ -2715,7 +2700,6 @@ static void cdda_class_dispose (input_class_t *this_gen) {
config->unregister_callback(config, "media.audio_cd.use_cddb");
config->unregister_callback(config, "media.audio_cd.cddb_server");
config->unregister_callback(config, "media.audio_cd.cddb_port");
- config->unregister_callback(config, "media.audio_cd.cddb_cachedir");
#ifdef CDROM_SELECT_SPEED
config->unregister_callback(config, "media.audio_cd.drive_slowdown");
#endif
@@ -2784,14 +2768,6 @@ static void *init_plugin (xine_t *xine, void *data) {
"title and track information from."), XINE_CONFIG_SECURITY,
port_changed_cb, (void *) this);
- config->register_filename(config, "media.audio_cd.cddb_cachedir",
- (_cdda_cddb_get_default_location()), XINE_CONFIG_STRING_IS_DIRECTORY_NAME,
- _("CDDB cache directory"), _("The replies from the CDDB server will be "
- "cached in this directory.\nThis setting is security critical, because files "
- "with uncontrollable names will be created in this directory. Be sure to use "
- "a dedicated directory not used for anything but CDDB caching."), XINE_CONFIG_SECURITY,
- cachedir_changed_cb, (void *) this);
-
#ifdef CDROM_SELECT_SPEED
config->register_num(config, "media.audio_cd.drive_slowdown", 4,
_("slow down disc drive to this speed factor"),
diff --git a/src/input/input_dvb.c b/src/input/input_dvb.c
index b3a399ce4..5b307fc1e 100644
--- a/src/input/input_dvb.c
+++ b/src/input/input_dvb.c
@@ -66,14 +66,17 @@
* OSD - this will allow for filtering/searching of epg data - useful for automatic recording :)
*/
-/* pthread.h must be included first so rest of the headers are imported
- thread safely (on some systems). */
-#include <pthread.h>
-
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
+/* pthread.h must be included first so rest of the headers are imported
+ thread safely (on some systems).
+ However, including it before config.h causes problems with asprintf not
+ being declared (glibc 2.3.6)
+*/
+#include <pthread.h>
+
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
@@ -97,9 +100,11 @@
#endif
#include <ctype.h>
-/* These will eventually be #include <linux/dvb/...> */
-#include "dvb/dmx.h"
-#include "dvb/frontend.h"
+/* XDG */
+#include <basedir.h>
+
+#include <linux/dvb/dmx.h>
+#include <linux/dvb/frontend.h>
#define LOG_MODULE "input_dvb"
#define LOG_VERBOSE
@@ -331,6 +336,8 @@ typedef struct {
/* scratch buffer for forward seeking */
char seek_buf[BUFSIZE];
+ /* Is the GUI enabled at all? */
+ int dvb_gui_enabled;
/* simple vcr-like functionality */
int record_fd;
int record_paused;
@@ -887,8 +894,8 @@ static channel_t *load_channels(xine_t *xine, xine_stream_t *stream, int *num_ch
int num_alloc = 0;
int i;
struct stat st;
-
- snprintf(filename, BUFSIZE, "%s/.xine/channels.conf", xine_get_homedir());
+
+ snprintf(filename, BUFSIZE, "%s/"PACKAGE"/channels.conf", xdgConfigHome(xine->basedir_handle));
f = fopen(filename, "r");
if (!f) {
@@ -1329,8 +1336,8 @@ static void dvb_parse_si(dvb_input_plugin_t *this) {
/* Helper function for finding the channel index in the channels struct
given the service_id. If channel is not found, -1 is returned. */
-static int channel_index(dvb_input_plugin_t* this, unsigned int service_id) {
- unsigned int n;
+static int channel_index(dvb_input_plugin_t* this, int service_id) {
+ int n;
for (n=0; n < this->num_channels; n++)
if (this->channels[n].service_id == service_id)
return n;
@@ -2491,15 +2498,18 @@ static void ts_rewrite_packets (dvb_input_plugin_t *this, unsigned char * origin
}
static off_t dvb_plugin_read (input_plugin_t *this_gen,
- char *buf, off_t len) {
+ void *buf_gen, off_t len) {
dvb_input_plugin_t *this = (dvb_input_plugin_t *) this_gen;
+ char *buf = (char *)buf_gen;
+
off_t n=0, total=0;
int have_mutex=0;
struct pollfd pfd;
if (!this->tuned_in)
return 0;
- dvb_event_handler (this);
+ if (this->dvb_gui_enabled)
+ dvb_event_handler (this);
#ifdef LOG_READS
xprintf(this->class->xine,XINE_VERBOSITY_DEBUG,
"input_dvb: reading %" PRIdMAX " bytes...\n", (intmax_t)len);
@@ -2764,6 +2774,11 @@ static int dvb_plugin_open(input_plugin_t * this_gen)
xine_cfg_entry_t zoomdvb;
xine_cfg_entry_t adapter;
xine_cfg_entry_t lastchannel;
+ xine_cfg_entry_t gui_enabled;
+
+ xine_config_lookup_entry(this->stream->xine, "media.dvb.gui_enabled", &gui_enabled);
+ this->dvb_gui_enabled = gui_enabled.num_value;
+ xprintf(this->class->xine, XINE_VERBOSITY_LOG, _("input_dvb: DVB GUI %s\n"), this->dvb_gui_enabled ? "enabled" : "disabled");
xine_config_lookup_entry(this->stream->xine, "media.dvb.adapter", &adapter);
@@ -2823,7 +2838,7 @@ static int dvb_plugin_open(input_plugin_t * this_gen)
* by numbers...
*/
int chanlen = strlen(channame);
- int offset = 0;
+ size_t offset = 0;
xprintf(this->class->xine, XINE_VERBOSITY_LOG,
_("input_dvb: exact match for %s not found: trying partial matches\n"), channame);
@@ -2840,7 +2855,7 @@ static int dvb_plugin_open(input_plugin_t * this_gen)
idx++;
}
offset++;
- xprintf(this->class->xine,XINE_VERBOSITY_LOG,"%d,%d,%d\n", offset, idx, num_channels);
+ xprintf(this->class->xine,XINE_VERBOSITY_LOG,"%zd,%d,%d\n", offset, idx, num_channels);
}
while ((offset < 6) && (idx == num_channels));
if (idx < num_channels) {
@@ -2990,15 +3005,16 @@ static int dvb_plugin_open(input_plugin_t * this_gen)
this->event_queue = xine_event_new_queue(this->stream);
#ifdef EPG_UPDATE_IN_BACKGROUND
- /* Start the EPG updater thread. */
- this->epg_updater_stop = 0;
- if (pthread_create(&this->epg_updater_thread, NULL,
- epg_data_updater, this) != 0) {
- xprintf(
- this->class->xine, XINE_VERBOSITY_LOG,
- _("input_dvb: cannot create EPG updater thread\n"));
- return 0;
-
+ if (this->dvb_gui_enabled) {
+ /* Start the EPG updater thread. */
+ this->epg_updater_stop = 0;
+ if (pthread_create(&this->epg_updater_thread, NULL,
+ epg_data_updater, this) != 0) {
+ xprintf(
+ this->class->xine, XINE_VERBOSITY_LOG,
+ _("input_dvb: cannot create EPG updater thread\n"));
+ return 0;
+ }
}
#endif
/*
@@ -3190,11 +3206,14 @@ static char **dvb_class_get_autoplay_list(input_class_t * this_gen,
num_channels = 0;
if (!(channels = load_channels(class->xine, NULL, &num_channels, 0))) {
+ static char *placefile = NULL;
/* channels.conf not found in .xine */
- class->mrls[0]="Sorry, No channels.conf found";
- class->mrls[1]="Please run the dvbscan utility";
- class->mrls[2]="from the dvb drivers apps package";
- class->mrls[3]="and place the file in ~/.xine/";
+ class->mrls[0]="Sorry, no channels.conf found.";
+ class->mrls[1]="Please run the scan utility from the DVB";
+ class->mrls[2]="drivers apps package and place the file in";
+ if (!placefile)
+ asprintf (&placefile, "%s/"PACKAGE"/", xdgConfigHome(class->xine->basedir_handle));
+ class->mrls[3]=placefile;
*num_files=4;
return class->mrls;
}
@@ -3285,6 +3304,13 @@ static void *init_class (xine_t *xine, void *data) {
"Greater than 0 means wait that many seconds to get a lock. Minimum is 5 seconds."),
0, NULL, (void *) this);
+ /* set to 0 to turn off the GUI built into this input plugin */
+ config->register_bool(config, "media.dvb.gui_enabled",
+ 1,
+ _("Enable the DVB GUI"),
+ _("Enable the DVB GUI, mouse controlled recording and channel switching."),
+ 21, NULL, NULL);
+
config->register_num(config, "media.dvb.adapter",
0,
_("Number of dvb card to use."),
diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c
index 0cc4deda9..83ec751a4 100644
--- a/src/input/input_dvd.c
+++ b/src/input/input_dvd.c
@@ -158,7 +158,7 @@
# define lseek64 lseek
#endif
-static const char *dvdnav_menu_table[] = {
+static const char *const dvdnav_menu_table[] = {
NULL,
NULL,
"Title",
@@ -335,12 +335,11 @@ static void send_mouse_enter_leave_event(dvd_input_plugin_t *this, int direction
this->mouse_in = !this->mouse_in;
if(direction != this->mouse_in) {
- xine_event_t event;
- xine_spu_button_t spu_event;
-
- spu_event.direction = direction;
- spu_event.button = this->mouse_buttonN;
-
+ const xine_spu_button_t spu_event = {
+ .direction = direction,
+ .button = this->mouse_buttonN
+ };
+ xine_event_t event;
event.type = XINE_EVENT_SPU_BUTTON;
event.stream = this->stream;
event.data = &spu_event;
@@ -356,8 +355,6 @@ static void send_mouse_enter_leave_event(dvd_input_plugin_t *this, int direction
static int update_title_display(dvd_input_plugin_t *this) {
char ui_title[MAX_STR_LEN + 1];
- xine_event_t uevent;
- xine_ui_data_t data;
int tt=-1, pr=-1;
size_t ui_str_length=0;
int num_tt = 0;
@@ -434,13 +431,19 @@ static int update_title_display(dvd_input_plugin_t *this) {
#ifdef INPUT_DEBUG
printf("input_dvd: Changing title to read '%s'\n", ui_title);
#endif
- uevent.type = XINE_EVENT_UI_SET_TITLE;
- uevent.stream = this->stream;
- uevent.data = &data;
- uevent.data_length = sizeof(data);;
- memcpy(data.str, ui_title, strlen(ui_title) + 1);
- data.str_len = strlen(ui_title) + 1;
- xine_event_send(this->stream, &uevent);
+ {
+ xine_ui_data_t data;
+ xine_event_t uevent;
+ uevent.type = XINE_EVENT_UI_SET_TITLE;
+ uevent.stream = this->stream;
+ uevent.data = &data;
+ uevent.data_length = sizeof(data);
+
+ memcpy(data.str, ui_title, strlen(ui_title) + 1);
+ data.str_len = strlen(ui_title) + 1;
+
+ xine_event_send(this->stream, &uevent);
+ }
return 1;
}
@@ -733,13 +736,14 @@ static buf_element_t *dvd_plugin_read_block (input_plugin_t *this_gen,
{
dvdnav_cell_change_event_t *cell_event =
(dvdnav_cell_change_event_t*) (block);
- xine_event_t event;
/* Tell xine to update the UI */
- event.type = XINE_EVENT_UI_CHANNELS_CHANGED;
- event.stream = this->stream;
- event.data = NULL;
- event.data_length = 0;
+ xine_event_t event = {
+ .type = XINE_EVENT_UI_CHANNELS_CHANGED,
+ .stream = this->stream,
+ .data = NULL,
+ .data_length = 0
+ };
xine_event_send(this->stream, &event);
if( !update_title_display(this) ) {
@@ -853,8 +857,9 @@ static buf_element_t *dvd_plugin_read_block (input_plugin_t *this_gen,
return buf;
}
-static off_t dvd_plugin_read (input_plugin_t *this_gen, char *ch_buf, off_t len) {
+static off_t dvd_plugin_read (input_plugin_t *this_gen, void *buf_gen, off_t len) {
/* dvd_input_plugin_t *this = (dvd_input_plugin_t*)this_gen; */
+ char *ch_buf = (char *)buf_gen;
/* FIXME: Tricking the demux_mpeg_block plugin */
ch_buf[0] = 0;
@@ -1479,7 +1484,6 @@ static int dvd_plugin_open (input_plugin_t *this_gen) {
char *locator, *locator_orig;
char *title_part;
- xine_event_t event;
xine_cfg_entry_t region_entry, lang_entry, cfg_entry;
trace_print("Called\n");
@@ -1590,12 +1594,15 @@ static int dvd_plugin_open (input_plugin_t *this_gen) {
free(class->eject_device);
class->eject_device = strdup(this->current_dvd_device);
- /* Tell Xine to update the UI */
- event.type = XINE_EVENT_UI_CHANNELS_CHANGED;
- event.stream = this->stream;
- event.data = NULL;
- event.data_length = 0;
- xine_event_send(this->stream, &event);
+ { /* Tell Xine to update the UI */
+ const xine_event_t event = {
+ .type = XINE_EVENT_UI_CHANNELS_CHANGED,
+ .stream = this->stream,
+ .data = NULL,
+ .data_length = 0
+ };
+ xine_event_send(this->stream, &event);
+ }
update_title_display(this);
@@ -1635,7 +1642,7 @@ static input_plugin_t *dvd_class_get_instance (input_class_t *class_gen, xine_st
this->mem_stack = 0;
this->mem_stack_max = 1024;
- this->mem = xine_xmalloc(sizeof(unsigned char *) * this->mem_stack_max);
+ this->mem = xine_xcalloc(this->mem_stack_max, sizeof(unsigned char *));
if (!this->mem) {
free(this);
return NULL;
@@ -1797,8 +1804,7 @@ static void *init_class (xine_t *xine, void *data) {
{
/* we have found libdvdcss, enable the specific config options */
char *raw_device;
- static const char *decrypt_modes[] = { "key", "disc", "title", NULL };
- char *css_cache_default, *css_cache;
+ static const char *const decrypt_modes[] = { "key", "disc", "title", NULL };
int mode;
raw_device = config->register_filename(config, "media.dvd.raw_device",
@@ -1823,22 +1829,6 @@ static void *init_class (xine_t *xine, void *data) {
"playing scrambled DVDs."), 20, NULL, NULL);
xine_setenv("DVDCSS_METHOD", decrypt_modes[mode], 0);
- css_cache_default = (char *)malloc(strlen(xine_get_homedir()) + 10);
- sprintf(css_cache_default, "%s/.dvdcss/", xine_get_homedir());
- css_cache = config->register_filename(config, "media.dvd.css_cache_path", css_cache_default, XINE_CONFIG_STRING_IS_DIRECTORY_NAME,
- _("path to the title key cache"),
- _("Since cracking the copy protection of scrambled DVDs can "
- "be quite time consuming, libdvdcss will cache the cracked "
- "keys in this directory.\nThis setting is security critical, "
- "because files with uncontrollable names will be created in "
- "this directory. Be sure to use a dedicated directory not "
- "used for anything but DVD key caching."),
- XINE_CONFIG_SECURITY, NULL, NULL);
- if (strlen(css_cache) > 0)
- xine_setenv("DVDCSS_CACHE", css_cache, 0);
- free(css_cache_default);
-
-
if(xine->verbosity > XINE_VERBOSITY_NONE)
xine_setenv("DVDCSS_VERBOSE", "2", 0);
else
diff --git a/src/input/input_file.c b/src/input/input_file.c
index c0ff41a78..91513194c 100644
--- a/src/input/input_file.c
+++ b/src/input/input_file.c
@@ -82,8 +82,8 @@ typedef struct {
int fh;
#ifdef HAVE_MMAP
int mmap_on;
- void *mmap_base;
- void *mmap_curr;
+ uint8_t *mmap_base;
+ uint8_t *mmap_curr;
off_t mmap_len;
#endif
char *mrl;
@@ -144,7 +144,7 @@ static int check_mmap_file(file_input_plugin_t *this) {
}
#endif
-static off_t file_plugin_read (input_plugin_t *this_gen, char *buf, off_t len) {
+static off_t file_plugin_read (input_plugin_t *this_gen, void *buf, off_t len) {
file_input_plugin_t *this = (file_input_plugin_t *) this_gen;
#ifdef HAVE_MMAP
@@ -223,7 +223,7 @@ static off_t file_plugin_seek (input_plugin_t *this_gen, off_t offset, int origi
#ifdef HAVE_MMAP /* Simulate f*() library calls */
if ( check_mmap_file(this) ) {
- void *new_point = this->mmap_curr;
+ uint8_t *new_point = this->mmap_curr;
switch(origin) {
case SEEK_SET: new_point = this->mmap_base + offset; break;
case SEEK_CUR: new_point = this->mmap_curr + offset; break;
@@ -336,9 +336,6 @@ static int file_plugin_open (input_plugin_t *this_gen ) {
file_input_plugin_t *this = (file_input_plugin_t *) this_gen;
char *filename;
struct stat sbuf;
-#ifdef HAVE_MMAP
- size_t tmp_size;
-#endif
lprintf("file_plugin_open\n");
@@ -403,14 +400,16 @@ static int file_plugin_open (input_plugin_t *this_gen ) {
}
#ifdef HAVE_MMAP
- tmp_size = sbuf.st_size; /* may cause truncation - if it does, DON'T mmap! */
- if ((tmp_size == sbuf.st_size) &&
- ( (this->mmap_base = mmap(NULL, tmp_size, PROT_READ, MAP_SHARED, this->fh, 0)) != (void*)-1 )) {
- this->mmap_on = 1;
- this->mmap_curr = this->mmap_base;
- this->mmap_len = sbuf.st_size;
- } else {
- this->mmap_base = NULL;
+ {
+ size_t tmp_size = sbuf.st_size; /* may cause truncation - if it does, DON'T mmap! */
+ if ((tmp_size == sbuf.st_size) &&
+ ( (this->mmap_base = mmap(NULL, tmp_size, PROT_READ, MAP_SHARED, this->fh, 0)) != (void*)-1 )) {
+ this->mmap_on = 1;
+ this->mmap_curr = this->mmap_base;
+ this->mmap_len = sbuf.st_size;
+ } else {
+ this->mmap_base = NULL;
+ }
}
#endif
@@ -707,9 +706,9 @@ static xine_mrl_t **file_class_get_dir (input_class_t *this_gen,
return NULL;
}
- dir_files = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t) * MAXFILES);
- hide_files = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t) * MAXFILES);
- norm_files = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t) * MAXFILES);
+ dir_files = (xine_mrl_t *) xine_xcalloc(MAXFILES, sizeof(xine_mrl_t));
+ hide_files = (xine_mrl_t *) xine_xcalloc(MAXFILES, sizeof(xine_mrl_t));
+ norm_files = (xine_mrl_t *) xine_xcalloc(MAXFILES, sizeof(xine_mrl_t));
while((pdirent = readdir(pdir)) != NULL) {
diff --git a/src/input/input_gnome_vfs.c b/src/input/input_gnome_vfs.c
index 540abd0f4..1fe29fbcd 100644
--- a/src/input/input_gnome_vfs.c
+++ b/src/input/input_gnome_vfs.c
@@ -75,8 +75,9 @@ gnomevfs_plugin_get_capabilities (input_plugin_t *this_gen)
#define SSH_BUFFER_SIZE 256 * 1024
static off_t
-gnomevfs_plugin_read (input_plugin_t *this_gen, char *buf, off_t len)
+gnomevfs_plugin_read (input_plugin_t *this_gen, void *buf_gen, off_t len)
{
+ char *buf = (char *)buf_gen;
gnomevfs_input_t *this = (gnomevfs_input_t *) this_gen;
off_t n, num_bytes;
diff --git a/src/input/input_http.c b/src/input/input_http.c
index 934e6a9f6..8c0c11ee7 100644
--- a/src/input/input_http.c
+++ b/src/input/input_http.c
@@ -71,7 +71,6 @@ typedef struct {
xine_stream_t *stream;
- int fh;
char *mrl;
nbc_t *nbc;
@@ -85,28 +84,30 @@ typedef struct {
char auth[BUFSIZE];
char proxyauth[BUFSIZE];
+ char preview[MAX_PREVIEW_SIZE];
+ off_t preview_size;
+
char *proto;
char *user;
char *password;
char *host;
- int port;
char *uri;
-
- char preview[MAX_PREVIEW_SIZE];
- off_t preview_size;
-
- /* Last.FM streaming server */
- unsigned char is_lastfm;
+ int port;
+
+ int fh;
+
+ /** Set to 1 if the stream is a NSV stream. */
+ int is_nsv:1;
+ /** Set to 1 if the stream comes from last.fm. */
+ int is_lastfm:1;
+ /** Set to 1 if the stream is ShoutCast. */
+ int shoutcast_mode:1;
/* ShoutCast */
- int shoutcast_mode;
int shoutcast_metaint;
off_t shoutcast_pos;
char *shoutcast_songtitle;
- /* NSV */
- int is_nsv;
-
/* scratch buffer for forward seeking */
char seek_buf[BUFSIZE];
@@ -121,13 +122,13 @@ typedef struct {
config_values_t *config;
char *proxyhost;
+ char *proxyhost_env;
int proxyport;
+ int proxyport_env;
+
char *proxyuser;
char *proxypassword;
char *noproxylist;
-
- char *proxyhost_env;
- int proxyport_env;
} http_input_class_t;
static void proxy_host_change_cb (void *this_gen, xine_cfg_entry_t *cfg) {
@@ -425,8 +426,9 @@ error:
}
static off_t http_plugin_read (input_plugin_t *this_gen,
- char *buf, off_t nlen) {
+ void *buf_gen, off_t nlen) {
http_input_plugin_t *this = (http_input_plugin_t *) this_gen;
+ char *buf = (char *)buf_gen;
off_t n, num_bytes;
num_bytes = 0;
@@ -853,7 +855,12 @@ static int http_plugin_open (input_plugin_t *this_gen ) {
_("input_http: http status not 2xx: >%d %s<\n"),
httpcode, httpstatus);
return -7;
- } else if (httpcode == 403 || httpcode == 401) {
+ } else if (httpcode == 401) {
+ xine_log (this->stream->xine, XINE_LOG_MSG,
+ _("input_http: http status not 2xx: >%d %s<\n"),
+ httpcode, httpstatus);
+ /* don't return - there may be a WWW-Authenticate header... */
+ } else if (httpcode == 403) {
_x_message(this->stream, XINE_MSG_PERMISSION_ERROR, this->mrl, NULL);
xine_log (this->stream->xine, XINE_LOG_MSG,
_("input_http: http status not 2xx: >%d %s<\n"),
@@ -890,6 +897,9 @@ static int http_plugin_open (input_plugin_t *this_gen ) {
return http_plugin_open(this_gen);
}
+ if (!strncasecmp (this->buf, "WWW-Authenticate: ", 18))
+ strcpy (this->preview, this->buf + 18);
+
{
static const char mpegurl_ct_str[] = "Content-Type: audio/x-mpegurl";
static const size_t mpegurl_ct_size = sizeof(mpegurl_ct_str)-1;
@@ -963,6 +973,10 @@ static int http_plugin_open (input_plugin_t *this_gen ) {
lprintf ("end of headers\n");
+ if (httpcode == 401)
+ _x_message(this->stream, XINE_MSG_AUTHENTICATION_NEEDED,
+ this->mrl, *this->preview ? this->preview : NULL, NULL);
+
if ( mpegurl_redirect ) {
char buf[4096] = { 0, };
char *newline = NULL;
diff --git a/src/input/input_mms.c b/src/input/input_mms.c
index 05c0b168b..23102ac18 100644
--- a/src/input/input_mms.c
+++ b/src/input/input_mms.c
@@ -59,15 +59,15 @@
static const uint32_t mms_bandwidths[]={14400,19200,28800,33600,34430,57600,
115200,262200,393216,524300,1544000,10485800};
-static const char * mms_bandwidth_strs[]={"14.4 Kbps (Modem)", "19.2 Kbps (Modem)",
- "28.8 Kbps (Modem)", "33.6 Kbps (Modem)",
- "34.4 Kbps (Modem)", "57.6 Kbps (Modem)",
- "115.2 Kbps (ISDN)", "262.2 Kbps (Cable/DSL)",
- "393.2 Kbps (Cable/DSL)","524.3 Kbps (Cable/DSL)",
- "1.5 Mbps (T1)", "10.5 Mbps (LAN)", NULL};
+static const char *const mms_bandwidth_strs[]={"14.4 Kbps (Modem)", "19.2 Kbps (Modem)",
+ "28.8 Kbps (Modem)", "33.6 Kbps (Modem)",
+ "34.4 Kbps (Modem)", "57.6 Kbps (Modem)",
+ "115.2 Kbps (ISDN)", "262.2 Kbps (Cable/DSL)",
+ "393.2 Kbps (Cable/DSL)","524.3 Kbps (Cable/DSL)",
+ "1.5 Mbps (T1)", "10.5 Mbps (LAN)", NULL};
/* connection methods */
-static const char *mms_protocol_strs[]={"auto", "TCP", "HTTP", NULL};
+static const char *const mms_protocol_strs[]={"auto", "TCP", "HTTP", NULL};
typedef struct {
input_plugin_t input_plugin;
@@ -98,8 +98,9 @@ typedef struct {
} mms_input_class_t;
static off_t mms_plugin_read (input_plugin_t *this_gen,
- char *buf, off_t len) {
+ void *buf_gen, off_t len) {
mms_input_plugin_t *this = (mms_input_plugin_t *) this_gen;
+ char *buf = (char *)buf_gen;
off_t n = 0;
lprintf ("mms_plugin_read: %"PRId64" bytes ...\n", len);
diff --git a/src/input/input_net.c b/src/input/input_net.c
index 0ce2e1340..dd318c37c 100644
--- a/src/input/input_net.c
+++ b/src/input/input_net.c
@@ -249,8 +249,9 @@ static int host_connect(const char *host, int port, xine_t *xine) {
#define HIGH_WATER_MARK 100
static off_t net_plugin_read (input_plugin_t *this_gen,
- char *buf, off_t len) {
+ void *buf_gen, off_t len) {
net_input_plugin_t *this = (net_input_plugin_t *) this_gen;
+ char *buf = (char *)buf_gen;
off_t n, total;
lprintf("reading %" PRIdMAX " bytes...\n", (intmax_t)len);
diff --git a/src/input/input_plugin.h b/src/input/input_plugin.h
index 11e1303e7..66b3abbb9 100644
--- a/src/input/input_plugin.h
+++ b/src/input/input_plugin.h
@@ -118,7 +118,7 @@ struct input_plugin_s {
* Should block until some bytes available for read;
* a return value of 0 indicates no data available
*/
- off_t (*read) (input_plugin_t *this, char *buf, off_t nlen);
+ off_t (*read) (input_plugin_t *this, void *buf, off_t nlen);
/*
diff --git a/src/input/input_pnm.c b/src/input/input_pnm.c
index e1413b0f7..29d65da2d 100644
--- a/src/input/input_pnm.c
+++ b/src/input/input_pnm.c
@@ -76,8 +76,9 @@ typedef struct {
static off_t pnm_plugin_read (input_plugin_t *this_gen,
- char *buf, off_t len) {
+ void *buf_gen, off_t len) {
pnm_input_plugin_t *this = (pnm_input_plugin_t *) this_gen;
+ char *buf = (char *)buf_gen;
off_t n;
lprintf ("pnm_plugin_read: %"PRId64" bytes ...\n", len);
diff --git a/src/input/input_pvr.c b/src/input/input_pvr.c
index bcf93af2b..48b69c8f5 100644
--- a/src/input/input_pvr.c
+++ b/src/input/input_pvr.c
@@ -423,8 +423,9 @@ static uint32_t pvr_plugin_get_capabilities (input_plugin_t *this_gen) {
}
-static off_t pvr_plugin_read (input_plugin_t *this_gen, char *buf, off_t len) {
+static off_t pvr_plugin_read (input_plugin_t *this_gen, void *buf_gen, off_t len) {
/*pvr_input_plugin_t *this = (pvr_input_plugin_t *) this_gen;*/
+ char *buf = (char *)buf_gen;
/* FIXME: Tricking the demux_mpeg_block plugin */
buf[0] = 0;
diff --git a/src/input/input_rtp.c b/src/input/input_rtp.c
index 681bced0f..b49206c5e 100644
--- a/src/input/input_rtp.c
+++ b/src/input/input_rtp.c
@@ -446,8 +446,9 @@ static void * input_plugin_read_loop(void *arg) {
/* ***************************************************************** */
static off_t rtp_plugin_read (input_plugin_t *this_gen,
- char *buf, off_t length) {
+ void *buf_gen, off_t length) {
rtp_input_plugin_t *this = (rtp_input_plugin_t *) this_gen;
+ char *buf = (char *)buf_gen;
struct timeval tv;
struct timespec timeout;
diff --git a/src/input/input_rtsp.c b/src/input/input_rtsp.c
index 693e8af66..cd2209baa 100644
--- a/src/input/input_rtsp.c
+++ b/src/input/input_rtsp.c
@@ -77,7 +77,7 @@ typedef struct {
static off_t rtsp_plugin_read (input_plugin_t *this_gen,
- char *buf, off_t len) {
+ void *buf, off_t len) {
rtsp_input_plugin_t *this = (rtsp_input_plugin_t *) this_gen;
off_t n;
diff --git a/src/input/input_smb.c b/src/input/input_smb.c
index 1b1f15565..87f2a81fa 100644
--- a/src/input/input_smb.c
+++ b/src/input/input_smb.c
@@ -66,9 +66,10 @@ smb_plugin_get_capabilities (input_plugin_t *this_gen)
static off_t
-smb_plugin_read (input_plugin_t *this_gen, char *buf, off_t len)
+smb_plugin_read (input_plugin_t *this_gen, void *buf_gen, off_t len)
{
smb_input_t *this = (smb_input_t *) this_gen;
+ char *buf = (char *)buf_gen;
off_t n, num_bytes;
num_bytes = 0;
@@ -258,8 +259,8 @@ static xine_mrl_t **smb_class_get_dir (input_class_t *this_gen,
}
if ((dir = smbc_opendir(current_path_smb)) >= 0){
- xine_mrl_t *dir_files = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t) * MAXFILES);
- xine_mrl_t *norm_files = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t) * MAXFILES);
+ xine_mrl_t *dir_files = (xine_mrl_t *) xine_xcalloc(MAXFILES, sizeof(xine_mrl_t));
+ xine_mrl_t *norm_files = (xine_mrl_t *) xine_xcalloc(MAXFILES, sizeof(xine_mrl_t));
int num_dir_files=0;
int num_norm_files=0;
while ((pdirent = smbc_readdir(dir)) != NULL){
diff --git a/src/input/input_stdin_fifo.c b/src/input/input_stdin_fifo.c
index 939f56f25..2b3cf1376 100644
--- a/src/input/input_stdin_fifo.c
+++ b/src/input/input_stdin_fifo.c
@@ -81,9 +81,10 @@ static off_t stdin_plugin_get_current_pos (input_plugin_t *this_gen);
static off_t stdin_plugin_read (input_plugin_t *this_gen,
- char *buf, off_t len) {
+ void *buf_gen, off_t len) {
stdin_input_plugin_t *this = (stdin_input_plugin_t *) this_gen;
+ char *buf = (char *)buf_gen;
off_t n, total;
lprintf ("reading %"PRId64" bytes...\n", len);
diff --git a/src/input/input_v4l.c b/src/input/input_v4l.c
index 6829470ff..5acf8099b 100644
--- a/src/input/input_v4l.c
+++ b/src/input/input_v4l.c
@@ -62,12 +62,32 @@
#define XINE_ENABLE_EXPERIMENTAL_FEATURES
/********** logging **********/
-#define LOG_MODULE "input_v4l"
+/* #define LOG_MODULE "input_v4l" */
#define LOG_VERBOSE
/*
#define LOG
*/
+#ifdef LOG
+#define LOG_MODULE log_line_prefix()
+
+static char *log_line_prefix()
+{
+ static int print_timestamp = 1;
+ struct timeval now;
+ struct tm now_tm;
+ char buffer[64];
+
+ if( print_timestamp ) {
+ gettimeofday( &now, NULL );
+ localtime_r( &now.tv_sec, &now_tm );
+ strftime( buffer, sizeof( buffer ), "%Y-%m-%d %H:%M:%S", &now_tm );
+ printf( "%s.%6.6ld: ", buffer, now.tv_usec );
+ }
+ return "input_v4l";
+}
+#endif
+
#include "xine_internal.h"
#include "xineutils.h"
#include "input_plugin.h"
@@ -90,6 +110,9 @@ static const resolution_t resolutions[] = {
{ 160, 120 }
};
+static char *tv_standard_names[] = { "PAL", "NTSC", "SECAM", NULL };
+static int tv_standard_values[] = { VIDEO_MODE_PAL, VIDEO_MODE_NTSC, VIDEO_MODE_SECAM };
+
#define NUM_RESOLUTIONS (sizeof(resolutions)/sizeof(resolutions[0]))
#define RADIO_DEV "/dev/v4l/radio0"
#define VIDEO_DEV "/dev/v4l/video0"
@@ -547,7 +570,8 @@ static int set_frequency(v4l_input_plugin_t *this, unsigned long frequency)
ret = ioctl(fd, VIDIOCSFREQ, &this->calc_frequency);
- lprintf("IOCTL set frequency (%ld) returned: %d\n", frequency, ret);
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ "input_v4l: set frequency (%ld) returned: %d\n", frequency, ret);
} else {
xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
"input_v4l: No frequency given. Expected syntax: v4l:/tuner/frequency\n"
@@ -624,6 +648,7 @@ static int search_by_channel(v4l_input_plugin_t *this, char *input_source)
{
int ret = 0;
int fd = 0;
+ cfg_entry_t *tv_standard_entry;
lprintf("input_source: %s\n", input_source);
@@ -659,11 +684,17 @@ static int search_by_channel(v4l_input_plugin_t *this, char *input_source)
return -1;
}
+ tv_standard_entry = this->stream->xine->config->lookup_entry(this->stream->xine->config,
+ "media.video4linux.tv_standard");
this->tuner_name = input_source;
- ret = ioctl(fd, VIDIOCSCHAN, &this->input);
+ this->video_channel.norm = tv_standard_values[ tv_standard_entry->num_value ];
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ "input_v4l: TV Standard configured as STD %s (%d)\n",
+ tv_standard_names[ tv_standard_entry->num_value ], this->video_channel.norm );
+ ret = ioctl(fd, VIDIOCSCHAN, &this->video_channel);
lprintf("(%d) Set channel to %d\n", ret, this->input);
-
+
/* FIXME: Don't assume tuner 0 ? */
this->tuner = 0;
@@ -819,7 +850,7 @@ static int open_video_capture_device(v4l_input_plugin_t *this)
}
lprintf("Device opened, tv %d\n", this->video_fd);
-
+
/* figure out the resolution */
for (j = 0; j < NUM_RESOLUTIONS; j++)
{
@@ -1192,7 +1223,7 @@ static int v4l_adjust_realtime_speed(v4l_input_plugin_t *this, fifo_buffer_t *fi
* Plugin read.
* This function is not supported by the plugin.
*/
-static off_t v4l_plugin_read (input_plugin_t *this_gen, char *buf, off_t len) {
+static off_t v4l_plugin_read (input_plugin_t *this_gen, void *buf, off_t len) {
lprintf("Read not supported\n");
return 0;
}
@@ -1911,6 +1942,12 @@ static void *init_video_class (xine_t *xine, void *data)
_("The path to your Video4Linux video device."),
10, NULL, NULL);
+ config->register_enum (config, "media.video4linux.tv_standard", 0,
+ tv_standard_names, _("v4l TV standard"),
+ _("Selects the TV standard of the input signals. "
+ "Either: PAL, NTSC and SECAM. "), 20, NULL, NULL);
+
+
return this;
}
diff --git a/src/input/input_vcd.c b/src/input/input_vcd.c
index bcd50ecc1..7d2ea0063 100644
--- a/src/input/input_vcd.c
+++ b/src/input/input_vcd.c
@@ -340,9 +340,10 @@ static int sun_vcd_read(vcd_input_plugin_t *this, long lba, cdsector_t *data)
#if defined (__linux__)
static off_t vcd_plugin_read (input_plugin_t *this_gen,
- char *buf, off_t nlen) {
+ void *buf_gen, off_t nlen) {
vcd_input_plugin_t *this = (vcd_input_plugin_t *) this_gen;
+ char *buf = (char *)buf_gen;
static struct cdrom_msf msf ;
static cdsector_t data;
struct cdrom_msf0 *end_msf;
@@ -398,8 +399,9 @@ static off_t vcd_plugin_read (input_plugin_t *this_gen,
}
#elif defined (__FreeBSD__)
static off_t vcd_plugin_read (input_plugin_t *this_gen,
- char *buf, off_t nlen) {
+ void *buf_gen, off_t nlen) {
vcd_input_plugin_t *this = (vcd_input_plugin_t *) this_gen;
+ char *buf = (char *)buf_gen;
static cdsector_t data;
int bsize = 2352;
@@ -422,9 +424,10 @@ static off_t vcd_plugin_read (input_plugin_t *this_gen,
}
#elif defined (__sun)
static off_t vcd_plugin_read (input_plugin_t *this_gen,
- char *buf, off_t nlen) {
+ void *buf_gen, off_t nlen) {
vcd_input_plugin_t *this = (vcd_input_plugin_t *) this_gen;
+ char *buf = (char *)buf_gen;
static cdsector_t data;
struct cdrom_msf0 *end_msf;
long lba;
diff --git a/src/input/libdvdnav/Makefile.am b/src/input/libdvdnav/Makefile.am
index 412828261..f741b4f17 100644
--- a/src/input/libdvdnav/Makefile.am
+++ b/src/input/libdvdnav/Makefile.am
@@ -1,6 +1,8 @@
include $(top_srcdir)/misc/Makefile.common
-AM_CPPFLAGS = -D_LARGEFILE64_SOURCE -DDVDNAV_COMPILE -DHAVE_DLFCN_H
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_CPPFLAGS = -DDVDNAV_COMPILE -DHAVE_DLFCN_H
+AM_LDFLAGS = $(xineplug_ldflags)
noinst_LTLIBRARIES = libdvdnav.la
@@ -23,8 +25,6 @@ libdvdnav_la_SOURCES = \
dvd_input.c \
dvd_udf.c
libdvdnav_la_LIBADD = $(PTHREAD_LIBS)
-libdvdnav_la_CFLAGS = $(VISIBILITY_FLAG)
-libdvdnav_la_LDFLAGS = -avoid-version -module
noinst_HEADERS = \
decoder.h \
diff --git a/src/input/libdvdnav/diff_against_cvs.patch b/src/input/libdvdnav/diff_against_cvs.patch
index 202474fef..b9b1dbe8b 100644
--- a/src/input/libdvdnav/diff_against_cvs.patch
+++ b/src/input/libdvdnav/diff_against_cvs.patch
@@ -432,3 +432,36 @@ diff -u -p -u -r1.19 searching.c
if(this->position_current.still != 0) {
printerr("Cannot seek in a still frame.");
+--- src/input/libdvdnav/ifo_types.h Tue Apr 10 13:13:59 2007 +0200
++++ src/input/libdvdnav/ifo_types.h Tue Apr 10 13:38:19 2007 +0200
+@@ -23,2 +25,2 @@
+ #include <inttypes.h>
+ #include "dvd_reader.h"
+
++#include "config.h"
++
+-
+-#undef ATTRIBUTE_PACKED
+-#undef PRAGMA_PACK_BEGIN
+-#undef PRAGMA_PACK_END
+-
+-#if defined(__GNUC__)
+-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
+-#define ATTRIBUTE_PACKED __attribute__ ((packed))
+-#define PRAGMA_PACK 0
+-#endif
+-#endif
+-
+-#if !defined(ATTRIBUTE_PACKED)
+-#define ATTRIBUTE_PACKED
+-#define PRAGMA_PACK 1
+-#endif
+-
+-#if PRAGMA_PACK
+-#pragma pack(1)
+-#endif
+-
++#define ATTRIBUTE_PACKED XINE_PACKED
+
+ /**
+ * Common
diff --git a/src/input/libdvdnav/ifo_types.h b/src/input/libdvdnav/ifo_types.h
index 5d5124579..0935f75d0 100644
--- a/src/input/libdvdnav/ifo_types.h
+++ b/src/input/libdvdnav/ifo_types.h
@@ -23,27 +23,9 @@
#include <inttypes.h>
#include "dvd_reader.h"
+#include "config.h"
-#undef ATTRIBUTE_PACKED
-#undef PRAGMA_PACK_BEGIN
-#undef PRAGMA_PACK_END
-
-#if defined(__GNUC__)
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
-#define ATTRIBUTE_PACKED __attribute__ ((packed))
-#define PRAGMA_PACK 0
-#endif
-#endif
-
-#if !defined(ATTRIBUTE_PACKED)
-#define ATTRIBUTE_PACKED
-#define PRAGMA_PACK 1
-#endif
-
-#if PRAGMA_PACK
-#pragma pack(1)
-#endif
-
+#define ATTRIBUTE_PACKED XINE_PACKED
/**
* Common
diff --git a/src/input/libreal/Makefile.am b/src/input/libreal/Makefile.am
index 5b10d1bca..bd97a7548 100644
--- a/src/input/libreal/Makefile.am
+++ b/src/input/libreal/Makefile.am
@@ -1,19 +1,10 @@
include $(top_srcdir)/misc/Makefile.common
-AM_CPPFLAGS = -D_LARGEFILE64_SOURCE -I$(srcdir)/../librtsp
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_CPPFLAGS = -I$(top_srcdir)/src/input/librtsp
-noinst_LTLIBRARIES = libreal.la
-
-libreal_la_SOURCES = \
- real.c \
- asmrp.c \
- rmff.c \
- sdpplin.c
+noinst_HEADERS = real.h asmrp.h rmff.h sdpplin.h
-libreal_la_CFLAGS = $(VISIBILITY_FLAG)
+noinst_LTLIBRARIES = libreal.la
-noinst_HEADERS = \
- real.h \
- asmrp.h \
- rmff.h \
- sdpplin.h
+libreal_la_SOURCES = real.c asmrp.c rmff.c sdpplin.c
diff --git a/src/input/libreal/real.c b/src/input/libreal/real.c
index 07805729f..93dfc7047 100644
--- a/src/input/libreal/real.c
+++ b/src/input/libreal/real.c
@@ -461,7 +461,7 @@ rmff_header_t *real_parse_sdp(char *data, char **stream_rules, uint32_t bandwidt
desc->copyright,
desc->abstract);
header->data=rmff_new_dataheader(0,0);
- header->streams = xine_xmalloc(sizeof(rmff_mdpr_t*)*(desc->stream_count+1));
+ header->streams = xine_xcalloc((desc->stream_count+1), sizeof(rmff_mdpr_t*));
lprintf("number of streams: %u\n", desc->stream_count);
for (i=0; i<desc->stream_count; i++) {
diff --git a/src/input/librtsp/Makefile.am b/src/input/librtsp/Makefile.am
index bb85f9cf4..68d554c2c 100644
--- a/src/input/librtsp/Makefile.am
+++ b/src/input/librtsp/Makefile.am
@@ -1,16 +1,10 @@
include $(top_srcdir)/misc/Makefile.common
-AM_CPPFLAGS = -D_LARGEFILE64_SOURCE -I$(srcdir)/../libreal
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_CPPFLAGS = -I$(top_srcdir)/src/input/libreal
-noinst_LTLIBRARIES = librtsp.la
-
-librtsp_la_SOURCES = \
- rtsp.c \
- rtsp_session.c
+noinst_HEADERS = rtsp.h rtsp_session.h
-librtsp_la_CFLAGS = $(VISIBILITY_FLAG)
-librtsp_la_LDFLAGS = -avoid-version -module
+noinst_LTLIBRARIES = librtsp.la
-noinst_HEADERS = \
- rtsp.h \
- rtsp_session.h
+librtsp_la_SOURCES = rtsp.c rtsp_session.c
diff --git a/src/input/vcd/Makefile.am b/src/input/vcd/Makefile.am
index 31ec6a44c..49b3a7494 100644
--- a/src/input/vcd/Makefile.am
+++ b/src/input/vcd/Makefile.am
@@ -1,24 +1,25 @@
include $(top_srcdir)/misc/Makefile.common
-SUBDIRS = libcdio libvcd
+$(top_builddir)/contrib/libcdio/libcdio.la:
+ $(MAKE) -C $(top_builddir)/contrib/libcdio
-vcd_SRCS = xineplug_inp_vcd.c vcdplayer.c vcdio.c xine-extra.c
+$(top_builddir)/contrib/libcdio/libiso9660.la:
+ $(MAKE) -C $(top_builddir)/contrib/libcdio
-EXTRA_DIST = $(vcd_SRCS)
+$(top_builddir)/contrib/libvcd/libvcd.la:
+ $(MAKE) -C $(top_builddir)/contrib/libvcd
-if ENABLE_VCD
-xineplug_LTLIBRARIES = xineplug_inp_vcd.la
+$(top_builddir)/contrib/libvcd/libvcdinfo.la:
+ $(MAKE) -C $(top_builddir)/contrib/libvcd
-AM_CFLAGS = $(LIBCDIO_CFLAGS) $(LIBVCD_CFLAGS)
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_LDFLAGS = $(xineplug_ldflags)
-xineplug_inp_vcd_la_SOURCES = $(vcd_SRCS)
-xineplug_inp_vcd_la_LDFLAGS = -avoid-version -module
-if HAVE_VCDNAV
-xineplug_inp_vcd_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) $(LIBVCDINFO_LIBS)
-else
-xineplug_inp_vcd_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) $(LIBVCD_LIBS) $(LIBVCDINFO_LIBS) -lm
-endif
+noinst_HEADERS = vcdio.h vcdplayer.h xine-extra.h
-endif
+xineplug_LTLIBRARIES = xineplug_inp_vcd.la
-noinst_HEADERS = vcdio.h vcdplayer.h xine-extra.h
+xineplug_inp_vcd_la_SOURCES = xineplug_inp_vcd.c vcdplayer.c vcdio.c xine-extra.c
+xineplug_inp_vcd_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) $(LIBCDIO_LIBS) $(LIBVCD_LIBS) $(LIBVCDINFO_LIBS) $(LIBISO9660_LIBS) -lm
+xineplug_inp_vcd_la_DEPENDENCIES = $(LIBCDIO_DEPS) $(LIBVCD_DEPS) $(LIBVCDINFO_DEPS) $(LIBISO9660_DEPS)
+xineplug_inp_vcd_la_CFLAGS = $(AM_CFLAGS) $(LIBCDIO_CFLAGS) $(LIBVCD_CFLAGS)
diff --git a/src/input/vcd/libcdio/FreeBSD/freebsd.c b/src/input/vcd/libcdio/FreeBSD/freebsd.c
deleted file mode 100644
index daea9b3f5..000000000
--- a/src/input/vcd/libcdio/FreeBSD/freebsd.c
+++ /dev/null
@@ -1,638 +0,0 @@
-/*
- $Id: freebsd.c,v 1.1 2005/01/01 02:43:57 rockyb Exp $
-
- Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* This file contains FreeBSD-specific code and implements low-level
- control of the CD drive. Culled initially I think from xine's or
- mplayer's FreeBSD code with lots of modifications.
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-static const char _rcsid[] = "$Id: freebsd.c,v 1.1 2005/01/01 02:43:57 rockyb Exp $";
-
-#include "freebsd.h"
-
-#ifdef HAVE_FREEBSD_CDROM
-
-#include <cdio/sector.h>
-
-static access_mode_t
-str_to_access_mode_freebsd(const char *psz_access_mode)
-{
- const access_mode_t default_access_mode = DEFAULT_FREEBSD_AM;
-
- if (NULL==psz_access_mode) return default_access_mode;
-
- if (!strcmp(psz_access_mode, "ioctl"))
- return _AM_IOCTL;
- else if (!strcmp(psz_access_mode, "CAM"))
- return _AM_CAM;
- else {
- cdio_warn ("unknown access type: %s. Default ioctl used.",
- psz_access_mode);
- return default_access_mode;
- }
-}
-
-static void
-_free_freebsd (void *obj)
-{
- _img_private_t *env = obj;
-
- if (NULL == env) return;
-
- if (NULL != env->device) free(env->device);
-
- if (_AM_CAM == env->access_mode)
- return free_freebsd_cam(env);
- else
- return cdio_generic_free(obj);
-}
-
-/* Check a drive to see if it is a CD-ROM
- Return 1 if a CD-ROM. 0 if it exists but isn't a CD-ROM drive
- and -1 if no device exists .
-*/
-static bool
-cdio_is_cdrom(char *drive, char *mnttype)
-{
- return cdio_is_cdrom_freebsd_ioctl(drive, mnttype);
-}
-
-/*!
- Reads nblocks of audio sectors from cd device into data starting from lsn.
- Returns 0 if no error.
- */
-static int
-_read_audio_sectors_freebsd (void *user_data, void *data, lsn_t lsn,
- unsigned int nblocks)
-{
- return read_audio_sectors_freebsd_ioctl(user_data, data, lsn, nblocks);
-}
-
-/*!
- Reads a single mode2 sector from cd device into data starting
- from lsn. Returns 0 if no error.
- */
-static int
-_read_mode2_sector_freebsd (void *user_data, void *data, lsn_t lsn,
- bool b_form2)
-{
- _img_private_t *env = user_data;
-
- if ( env->access_mode == _AM_CAM )
- return read_mode2_sector_freebsd_cam(env, data, lsn, b_form2);
- else
- return read_mode2_sector_freebsd_ioctl(env, data, lsn, b_form2);
-}
-
-/*!
- Reads nblocks of mode2 sectors from cd device into data starting
- from lsn.
- Returns 0 if no error.
- */
-static int
-_read_mode2_sectors_freebsd (void *user_data, void *data, lsn_t lsn,
- bool b_form2, unsigned int nblocks)
-{
- _img_private_t *env = user_data;
-
- if ( env->access_mode == _AM_CAM && b_form2) {
- /* We have a routine that covers this case without looping. */
- return read_mode2_sectors_freebsd_cam(env, data, lsn, nblocks);
- } else {
- unsigned int i;
- unsigned int i_blocksize = b_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE;
-
- /* For each frame, pick out the data part we need */
- for (i = 0; i < nblocks; i++) {
- int retval = _read_mode2_sector_freebsd (env,
- ((char *)data) +
- (i_blocksize * i),
- lsn + i, b_form2);
- if (retval) return retval;
- }
- }
- return 0;
-}
-
-/*!
- Return the size of the CD in logical block address (LBA) units.
- */
-static uint32_t
-_stat_size_freebsd (void *obj)
-{
- _img_private_t *env = obj;
-
- if (NULL == env) return CDIO_INVALID_LBA;
-
- if (_AM_CAM == env->access_mode)
- return stat_size_freebsd_cam(env);
- else
- return stat_size_freebsd_ioctl(env);
-}
-
-/*!
- Set the key "arg" to "value" in source device.
-*/
-static int
-_set_arg_freebsd (void *user_data, const char key[], const char value[])
-{
- _img_private_t *env = user_data;
-
- if (!strcmp (key, "source"))
- {
- if (!value)
- return -2;
-
- free (env->gen.source_name);
-
- env->gen.source_name = strdup (value);
- }
- else if (!strcmp (key, "access-mode"))
- {
- env->access_mode = str_to_access_mode_freebsd(value);
- if (env->access_mode == _AM_CAM && !env->b_cam_init)
- return init_freebsd_cam(env) ? 1 : -3;
- return 0;
- }
- else
- return -1;
-
- return 0;
-}
-
-/*!
- Read and cache the CD's Track Table of Contents and track info.
- Return false if unsuccessful;
-*/
-static bool
-read_toc_freebsd (void *p_user_data)
-{
- _img_private_t *p_env = p_user_data;
- track_t i, j;
-
- /* read TOC header */
- if ( ioctl(p_env->gen.fd, CDIOREADTOCHEADER, &p_env->tochdr) == -1 ) {
- cdio_warn("error in ioctl(CDIOREADTOCHEADER): %s\n", strerror(errno));
- return false;
- }
-
- p_env->gen.i_first_track = p_env->tochdr.starting_track;
- p_env->gen.i_tracks = p_env->tochdr.ending_track -
- p_env->gen.i_first_track + 1;
-
- j=0;
- for (i=p_env->gen.i_first_track; i<=p_env->gen.i_tracks; i++, j++) {
- p_env->tocent[j].track = i;
- p_env->tocent[j].address_format = CD_LBA_FORMAT;
-
- if ( ioctl(p_env->gen.fd, CDIOREADTOCENTRY, &(p_env->tocent[j]) ) ) {
- cdio_warn("%s %d: %s\n",
- "error in ioctl CDROMREADTOCENTRY for track",
- i, strerror(errno));
- return false;
- }
- }
-
- p_env->tocent[j].track = CDIO_CDROM_LEADOUT_TRACK;
- p_env->tocent[j].address_format = CD_LBA_FORMAT;
- if ( ioctl(p_env->gen.fd, CDIOREADTOCENTRY, &(p_env->tocent[j]) ) ){
- cdio_warn("%s: %s\n",
- "error in ioctl CDROMREADTOCENTRY for leadout track",
- strerror(errno));
- return false;
- }
-
- p_env->gen.toc_init = true;
- return true;
-}
-
-/*!
- Eject media. Return 1 if successful, 0 otherwise.
- */
-static int
-_eject_media_freebsd (void *user_data)
-{
- _img_private_t *p_env = user_data;
-
- return (p_env->access_mode == _AM_IOCTL)
- ? eject_media_freebsd_ioctl(p_env)
- : eject_media_freebsd_cam(p_env);
-}
-
-/*!
- Return the value associated with the key "arg".
-*/
-static const char *
-_get_arg_freebsd (void *user_data, const char key[])
-{
- _img_private_t *env = user_data;
-
- if (!strcmp (key, "source")) {
- return env->gen.source_name;
- } else if (!strcmp (key, "access-mode")) {
- switch (env->access_mode) {
- case _AM_IOCTL:
- return "ioctl";
- case _AM_CAM:
- return "CAM";
- case _AM_NONE:
- return "no access method";
- }
- }
- return NULL;
-}
-
-/*!
- Return the media catalog number MCN.
-
- Note: string is malloc'd so caller should free() then returned
- string when done with it.
-
- FIXME: This is just a guess.
-
- */
-static char *
-_get_mcn_freebsd (const void *p_user_data) {
-
- const _img_private_t *p_env = p_user_data;
-
- return (p_env->access_mode == _AM_IOCTL)
- ? get_mcn_freebsd_ioctl(p_env)
- : scsi_mmc_get_mcn(p_env->gen.cdio);
-
-}
-
-static void
-get_drive_cap_freebsd (const void *p_user_data,
- cdio_drive_read_cap_t *p_read_cap,
- cdio_drive_write_cap_t *p_write_cap,
- cdio_drive_misc_cap_t *p_misc_cap)
-{
- const _img_private_t *p_env = p_user_data;
-
- if (p_env->access_mode == _AM_CAM)
- scsi_mmc_get_drive_cap_generic (p_user_data, p_read_cap, p_write_cap,
- p_misc_cap);
-
-}
-
-/*!
- Run a SCSI MMC command.
-
- p_user_data internal CD structure.
- i_timeout_ms time in milliseconds we will wait for the command
- to complete. If this value is -1, use the default
- time-out value.
- i_cdb Size of p_cdb
- p_cdb CDB bytes.
- e_direction direction the transfer is to go.
- i_buf Size of buffer
- p_buf Buffer for data, both sending and receiving
-
- Return 0 if no error.
- */
-static int
-run_scsi_cmd_freebsd( const void *p_user_data, unsigned int i_timeout_ms,
- unsigned int i_cdb, const scsi_mmc_cdb_t *p_cdb,
- scsi_mmc_direction_t e_direction,
- unsigned int i_buf, /*in/out*/ void *p_buf )
-{
- const _img_private_t *p_env = p_user_data;
-
- if (p_env->access_mode == _AM_CAM)
- return run_scsi_cmd_freebsd_cam( p_user_data, i_timeout_ms, i_cdb, p_cdb,
- e_direction, i_buf, p_buf );
- else
- return 2;
-}
-
-/*!
- Get format of track.
-
- FIXME: We're just guessing this from the GNU/Linux code.
-
-*/
-static track_format_t
-_get_track_format_freebsd(void *p_user_data, track_t i_track)
-{
- _img_private_t *p_env = p_user_data;
-
- if (!p_env->gen.toc_init) read_toc_freebsd (p_user_data) ;
-
- if (i_track > TOTAL_TRACKS || i_track == 0)
- return TRACK_FORMAT_ERROR;
-
- i_track -= FIRST_TRACK_NUM;
-
- /* This is pretty much copied from the "badly broken" cdrom_count_tracks
- in linux/cdrom.c.
- */
- if (p_env->tocent[i_track].entry.control & CDIO_CDROM_DATA_TRACK) {
- if (p_env->tocent[i_track].address_format == CDIO_CDROM_CDI_TRACK)
- return TRACK_FORMAT_CDI;
- else if (p_env->tocent[i_track].address_format == CDIO_CDROM_XA_TRACK)
- return TRACK_FORMAT_XA;
- else
- return TRACK_FORMAT_DATA;
- } else
- return TRACK_FORMAT_AUDIO;
-
-}
-
-/*!
- Return true if we have XA data (green, mode2 form1) or
- XA data (green, mode2 form2). That is track begins:
- sync - header - subheader
- 12 4 - 8
-
- FIXME: there's gotta be a better design for this and get_track_format?
-*/
-static bool
-_get_track_green_freebsd(void *user_data, track_t i_track)
-{
- _img_private_t *p_env = user_data;
-
- if (i_track == CDIO_CDROM_LEADOUT_TRACK) i_track = TOTAL_TRACKS+1;
-
- if (i_track > TOTAL_TRACKS+1 || i_track == 0)
- return false;
-
- /* FIXME: Dunno if this is the right way, but it's what
- I was using in cdinfo for a while.
- */
- return ((p_env->tocent[i_track-FIRST_TRACK_NUM].entry.control & 2) != 0);
-}
-
-/*!
- Return the starting LSN track number
- i_track in obj. Track numbers start at 1.
- The "leadout" track is specified either by
- using i_track LEADOUT_TRACK or the total tracks+1.
- CDIO_INVALID_LBA is returned if there is no track entry.
-*/
-static lba_t
-_get_track_lba_freebsd(void *user_data, track_t i_track)
-{
- _img_private_t *p_env = user_data;
-
- if (!p_env->gen.toc_init) read_toc_freebsd (p_env) ;
-
- if (i_track == CDIO_CDROM_LEADOUT_TRACK) i_track = TOTAL_TRACKS+1;
-
- if (i_track > TOTAL_TRACKS+1 || i_track == 0 || !p_env->gen.toc_init) {
- return CDIO_INVALID_LBA;
- } else {
- return cdio_lsn_to_lba(ntohl(p_env->tocent[i_track-FIRST_TRACK_NUM].entry.addr.lba));
- }
-}
-
-#endif /* HAVE_FREEBSD_CDROM */
-
-/*!
- Return an array of strings giving possible CD devices.
- */
-char **
-cdio_get_devices_freebsd (void)
-{
-#ifndef HAVE_FREEBSD_CDROM
- return NULL;
-#else
- char drive[40];
- char **drives = NULL;
- unsigned int num_drives=0;
- bool exists=true;
- char c;
-
- /* Scan the system for CD-ROM drives.
- */
-
-#ifdef USE_ETC_FSTAB
-
- struct fstab *fs;
- setfsent();
-
- /* Check what's in /etc/fstab... */
- while ( (fs = getfsent()) )
- {
- if (strncmp(fs->fs_spec, "/dev/sr", 7))
- cdio_add_device_list(&drives, fs->fs_spec, &num_drives);
- }
-
-#endif
-
- /* Scan the system for CD-ROM drives.
- Not always 100% reliable, so use the USE_MNTENT code above first.
- */
-
- /* Scan SCSI and CAM devices */
- for ( c='0'; exists && c <='9'; c++ ) {
- sprintf(drive, "/dev/cd%c%s", c, DEVICE_POSTFIX);
- exists = cdio_is_cdrom(drive, NULL);
- if ( exists ) {
- cdio_add_device_list(&drives, drive, &num_drives);
- }
- }
-
- /* Scan are ATAPI devices */
- for ( c='0'; exists && c <='9'; c++ ) {
- sprintf(drive, "/dev/acd%c%s", c, DEVICE_POSTFIX);
- exists = cdio_is_cdrom(drive, NULL);
- if ( exists ) {
- cdio_add_device_list(&drives, drive, &num_drives);
- }
- }
- cdio_add_device_list(&drives, NULL, &num_drives);
- return drives;
-#endif /*HAVE_FREEBSD_CDROM*/
-}
-
-/*!
- Return a string containing the default CD device if none is specified.
- */
-char *
-cdio_get_default_device_freebsd()
-{
-#ifndef HAVE_FREEBSD_CDROM
- return NULL;
-#else
- char drive[40];
- bool exists=true;
- char c;
-
- /* Scan the system for CD-ROM drives.
- */
-
-#ifdef USE_ETC_FSTAB
-
- struct fstab *fs;
- setfsent();
-
- /* Check what's in /etc/fstab... */
- while ( (fs = getfsent()) )
- {
- if (strncmp(fs->fs_spec, "/dev/sr", 7))
- return strdup(fs->fs_spec);
- }
-
-#endif
-
- /* Scan the system for CD-ROM drives.
- Not always 100% reliable, so use the USE_MNTENT code above first.
- */
-
- /* Scan SCSI and CAM devices */
- for ( c='0'; exists && c <='9'; c++ ) {
- sprintf(drive, "/dev/cd%c%s", c, DEVICE_POSTFIX);
- exists = cdio_is_cdrom(drive, NULL);
- if ( exists ) {
- return strdup(drive);
- }
- }
-
- /* Scan are ATAPI devices */
- for ( c='0'; exists && c <='9'; c++ ) {
- sprintf(drive, "/dev/acd%c%s", c, DEVICE_POSTFIX);
- exists = cdio_is_cdrom(drive, NULL);
- if ( exists ) {
- return strdup(drive);
- }
- }
- return NULL;
-#endif /*HAVE_FREEBSD_CDROM*/
-}
-
-/*!
- Initialization routine. This is the only thing that doesn't
- get called via a function pointer. In fact *we* are the
- ones to set that up.
- */
-CdIo *
-cdio_open_freebsd (const char *psz_source_name)
-{
- return cdio_open_am_freebsd(psz_source_name, NULL);
-}
-
-
-/*!
- Initialization routine. This is the only thing that doesn't
- get called via a function pointer. In fact *we* are the
- ones to set that up.
- */
-CdIo *
-cdio_open_am_freebsd (const char *psz_orig_source_name,
- const char *psz_access_mode)
-{
-
-#ifdef HAVE_FREEBSD_CDROM
- CdIo *ret;
- _img_private_t *_data;
- char *psz_source_name;
-
- cdio_funcs _funcs = {
- .eject_media = _eject_media_freebsd,
- .free = _free_freebsd,
- .get_arg = _get_arg_freebsd,
- .get_cdtext = get_cdtext_generic,
- .get_default_device = cdio_get_default_device_freebsd,
- .get_devices = cdio_get_devices_freebsd,
- .get_discmode = get_discmode_generic,
- .get_drive_cap = get_drive_cap_freebsd,
- .get_first_track_num= get_first_track_num_generic,
- .get_mcn = _get_mcn_freebsd,
- .get_num_tracks = get_num_tracks_generic,
- .get_track_format = _get_track_format_freebsd,
- .get_track_green = _get_track_green_freebsd,
- .get_track_lba = _get_track_lba_freebsd,
- .get_track_msf = NULL,
- .lseek = cdio_generic_lseek,
- .read = cdio_generic_read,
- .read_audio_sectors = _read_audio_sectors_freebsd,
- .read_mode2_sector = _read_mode2_sector_freebsd,
- .read_mode2_sectors = _read_mode2_sectors_freebsd,
- .read_toc = read_toc_freebsd,
- .run_scsi_mmc_cmd = run_scsi_cmd_freebsd,
- .set_arg = _set_arg_freebsd,
- .stat_size = _stat_size_freebsd
- };
-
- _data = _cdio_malloc (sizeof (_img_private_t));
- _data->access_mode = str_to_access_mode_freebsd(psz_access_mode);
- _data->gen.init = false;
- _data->gen.fd = -1;
- _data->gen.toc_init = false;
- _data->gen.b_cdtext_init = false;
- _data->gen.b_cdtext_error = false;
-
- if (NULL == psz_orig_source_name) {
- psz_source_name=cdio_get_default_device_freebsd();
- if (NULL == psz_source_name) return NULL;
- _data->device = psz_source_name;
- _set_arg_freebsd(_data, "source", psz_source_name);
- } else {
- if (cdio_is_device_generic(psz_orig_source_name)) {
- _set_arg_freebsd(_data, "source", psz_orig_source_name);
- _data->device = strdup(psz_orig_source_name);
- } else {
- /* The below would be okay if all device drivers worked this way. */
-#if 0
- cdio_info ("source %s is a not a device", psz_orig_source_name);
-#endif
- return NULL;
- }
- }
-
- ret = cdio_new ((void *)_data, &_funcs);
- if (ret == NULL) return NULL;
-
- if (cdio_generic_init(_data))
- if ( _data->access_mode == _AM_IOCTL ) {
- return ret;
- } else {
- if (init_freebsd_cam(_data))
- return ret;
- else {
- cdio_generic_free (_data);
- return NULL;
- }
- }
- else {
- cdio_generic_free (_data);
- return NULL;
- }
-
-#else
- return NULL;
-#endif /* HAVE_FREEBSD_CDROM */
-
-}
-
-bool
-cdio_have_freebsd (void)
-{
-#ifdef HAVE_FREEBSD_CDROM
- return true;
-#else
- return false;
-#endif /* HAVE_FREEBSD_CDROM */
-}
diff --git a/src/input/vcd/libcdio/FreeBSD/freebsd.h b/src/input/vcd/libcdio/FreeBSD/freebsd.h
deleted file mode 100644
index 50894c912..000000000
--- a/src/input/vcd/libcdio/FreeBSD/freebsd.h
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
- $Id: freebsd.h,v 1.1 2005/01/01 02:43:57 rockyb Exp $
-
- Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* This file contains FreeBSD-specific code and implements low-level
- control of the CD drive. Culled initially I think from xine's or
- mplayer's FreeBSD code with lots of modifications.
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <cdio/sector.h>
-#include "cdio_assert.h"
-#include "cdio_private.h"
-
-/*!
- For ioctl access /dev/acd0c is preferred over /dev/cd0c.
- For cam access /dev/cd0c is preferred. DEFAULT_CDIO_DEVICE and
- DEFAULT_FREEBSD_AM should be consistent.
- */
-
-#ifndef DEFAULT_CDIO_DEVICE
-#define DEFAULT_CDIO_DEVICE "/dev/cd0c"
-#endif
-
-#ifndef DEFUALT_FREEBSD_AM
-#define DEFAULT_FREEBSD_AM _AM_CAM
-#endif
-
-#include <string.h>
-
-#ifdef HAVE_FREEBSD_CDROM
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-
-#ifdef HAVE_SYS_CDIO_H
-# include <sys/cdio.h>
-#endif
-
-#ifndef CDIOCREADAUDIO
-struct ioc_read_audio
-{
- u_char address_format;
- union msf_lba address;
- int nframes;
- u_char* buffer;
-};
-
-#define CDIOCREADAUDIO _IOWR('c',31,struct ioc_read_audio)
-#endif
-
-#include <sys/cdrio.h>
-
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <sys/param.h> /* for __FreeBSD_version */
-
-#if __FreeBSD_version < 500000
-#define DEVICE_POSTFIX "c"
-#else
-#define DEVICE_POSTFIX ""
-#endif
-
-#define HAVE_FREEBSD_CAM
-#ifdef HAVE_FREEBSD_CAM
-#include <camlib.h>
-
-#include <cam/scsi/scsi_message.h>
-#include <cam/scsi/scsi_pass.h>
-#include <errno.h>
-#define ERRCODE(s) ((((s)[2]&0x0F)<<16)|((s)[12]<<8)|((s)[13]))
-#define EMEDIUMTYPE EINVAL
-#define ENOMEDIUM ENODEV
-#define CREAM_ON_ERRNO(s) do { \
- switch ((s)[12]) \
- { case 0x04: errno=EAGAIN; break; \
- case 0x20: errno=ENODEV; break; \
- case 0x21: if ((s)[13]==0) errno=ENOSPC; \
- else errno=EINVAL; \
- break; \
- case 0x30: errno=EMEDIUMTYPE; break; \
- case 0x3A: errno=ENOMEDIUM; break; \
- } \
-} while(0)
-#endif /*HAVE_FREEBSD_CAM*/
-
-#include <cdio/util.h>
-
-#define TOTAL_TRACKS ( p_env->tochdr.ending_track \
- - p_env->tochdr.starting_track + 1)
-#define FIRST_TRACK_NUM (p_env->tochdr.starting_track)
-
-typedef enum {
- _AM_NONE,
- _AM_IOCTL,
- _AM_CAM
-} access_mode_t;
-
-typedef struct {
- /* Things common to all drivers like this.
- This must be first. */
- generic_img_private_t gen;
-
-#ifdef HAVE_FREEBSD_CAM
- char *device;
- struct cam_device *cam;
- union ccb ccb;
-#endif
-
- access_mode_t access_mode;
-
- bool b_ioctl_init;
- bool b_cam_init;
-
- /* Track information */
- struct ioc_toc_header tochdr;
-
- /* Entry info for each track. Add 1 for leadout. */
- struct ioc_read_toc_single_entry tocent[CDIO_CD_MAX_TRACKS+1];
-
-} _img_private_t;
-
-bool cdio_is_cdrom_freebsd_ioctl(char *drive, char *mnttype);
-
-track_format_t get_track_format_freebsd_ioctl(const _img_private_t *env,
- track_t i_track);
-bool get_track_green_freebsd_ioctl(const _img_private_t *env,
- track_t i_track);
-
-int eject_media_freebsd_ioctl (_img_private_t *env);
-int eject_media_freebsd_cam (_img_private_t *env);
-
-void get_drive_cap_freebsd_cam (const _img_private_t *p_env,
- cdio_drive_read_cap_t *p_read_cap,
- cdio_drive_write_cap_t *p_write_cap,
- cdio_drive_misc_cap_t *p_misc_cap);
-
-char *get_mcn_freebsd_ioctl (const _img_private_t *p_env);
-
-void free_freebsd_cam (void *obj);
-
-/*!
- Using the ioctl method, r nblocks of audio sectors from cd device
- into data starting from lsn. Returns 0 if no error.
- */
-int read_audio_sectors_freebsd_ioctl (_img_private_t *env, void *data,
- lsn_t lsn, unsigned int nblocks);
-/*!
- Using the CAM method, reads nblocks of mode2 sectors from
- cd device using into data starting from lsn. Returns 0 if no
- error.
-*/
-int read_mode2_sector_freebsd_cam (_img_private_t *env, void *data,
- lsn_t lsn, bool b_form2);
-
-/*!
- Using the ioctl method, reads nblocks of mode2 sectors from
- cd device using into data starting from lsn. Returns 0 if no
- error.
-*/
-int read_mode2_sector_freebsd_ioctl (_img_private_t *env, void *data,
- lsn_t lsn, bool b_form2);
-
-/*!
- Using the CAM method, reads nblocks of mode2 form2 sectors from
- cd device using into data starting from lsn. Returns 0 if no
- error.
-
- Note: if you want form1 sectors, the caller has to pick out the
- appropriate piece.
-*/
-int read_mode2_sectors_freebsd_cam (_img_private_t *env, void *buf,
- lsn_t lsn, unsigned int nblocks);
-
-bool read_toc_freebsd_ioctl (_img_private_t *env);
-
-/*!
- Run a SCSI MMC command.
-
- p_user_data internal CD structure.
- i_timeout time in milliseconds we will wait for the command
- to complete. If this value is -1, use the default
- time-out value.
- i_cdb Size of p_cdb
- p_cdb CDB bytes.
- e_direction direction the transfer is to go.
- i_buf Size of buffer
- p_buf Buffer for data, both sending and receiving
-
- Return 0 if no error.
- */
-int run_scsi_cmd_freebsd_cam( const void *p_user_data,
- unsigned int i_timeout_ms,
- unsigned int i_cdb,
- const scsi_mmc_cdb_t *p_cdb,
- scsi_mmc_direction_t e_direction,
- unsigned int i_buf,
- /*in/out*/ void *p_buf );
-
-/*!
- Return the size of the CD in logical block address (LBA) units.
- */
-uint32_t stat_size_freebsd_cam (_img_private_t *env);
-uint32_t stat_size_freebsd_ioctl (_img_private_t *env);
-
-bool init_freebsd_cam (_img_private_t *env);
-void free_freebsd_cam (void *user_data);
-
-#endif /*HAVE_FREEBSD_CDROM*/
diff --git a/src/input/vcd/libcdio/FreeBSD/freebsd_cam.c b/src/input/vcd/libcdio/FreeBSD/freebsd_cam.c
deleted file mode 100644
index 68e38ccae..000000000
--- a/src/input/vcd/libcdio/FreeBSD/freebsd_cam.c
+++ /dev/null
@@ -1,346 +0,0 @@
-/*
- $Id: freebsd_cam.c,v 1.1 2005/01/01 02:43:57 rockyb Exp $
-
- Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* This file contains FreeBSD-specific code and implements low-level
- control of the CD drive via SCSI emulation.
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-static const char _rcsid[] = "$Id: freebsd_cam.c,v 1.1 2005/01/01 02:43:57 rockyb Exp $";
-
-#ifdef HAVE_FREEBSD_CDROM
-
-#include "freebsd.h"
-#include <cdio/scsi_mmc.h>
-
-/* Default value in seconds we will wait for a command to
- complete. */
-#define DEFAULT_TIMEOUT_MSECS 10000
-
-/*!
- Run a SCSI MMC command.
-
- p_user_data internal CD structure.
- i_timeout_ms time in milliseconds we will wait for the command
- to complete. If this value is -1, use the default
- time-out value.
- i_cdb Size of p_cdb
- p_cdb CDB bytes.
- e_direction direction the transfer is to go.
- i_buf Size of buffer
- p_buf Buffer for data, both sending and receiving
-
- Return 0 if no error.
- */
-int
-run_scsi_cmd_freebsd_cam( const void *p_user_data, unsigned int i_timeout_ms,
- unsigned int i_cdb, const scsi_mmc_cdb_t *p_cdb,
- scsi_mmc_direction_t e_direction,
- unsigned int i_buf, /*in/out*/ void *p_buf )
-{
- const _img_private_t *p_env = p_user_data;
- int i_status;
- int direction = CAM_DEV_QFRZDIS;
- union ccb ccb;
-
- if (!p_env || !p_env->cam) return -2;
-
- memset(&ccb, 0, sizeof(ccb));
-
- ccb.ccb_h.path_id = p_env->cam->path_id;
- ccb.ccb_h.target_id = p_env->cam->target_id;
- ccb.ccb_h.target_lun = p_env->cam->target_lun;
- ccb.ccb_h.timeout = i_timeout_ms;
-
- if (!i_cdb)
- direction |= CAM_DIR_NONE;
- else
- direction |= (e_direction == SCSI_MMC_DATA_READ)?CAM_DIR_IN : CAM_DIR_OUT;
- cam_fill_csio (&(ccb.csio), 1, NULL,
- direction | CAM_DEV_QFRZDIS, MSG_SIMPLE_Q_TAG, p_buf, i_buf,
- sizeof(ccb.csio.sense_data), 0, 30*1000);
-
- memcpy(ccb.csio.cdb_io.cdb_bytes, p_cdb, i_cdb);
-
- ccb.csio.cdb_len =
- scsi_mmc_get_cmd_len(ccb.csio.cdb_io.cdb_bytes[0]);
-
- if ((i_status = cam_send_ccb(p_env->cam, &ccb)) < 0)
- {
- cdio_warn ("transport failed: %d", i_status);
- return -1;
- }
- if ((ccb.ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP)
- {
- return 0;
- }
- errno = EIO;
- i_status = ERRCODE(((unsigned char *)&ccb.csio.sense_data));
- if (i_status == 0)
- i_status = -1;
- else
- CREAM_ON_ERRNO(((unsigned char *)&ccb.csio.sense_data));
- cdio_warn ("transport failed: %d", i_status);
- return i_status;
-}
-
-bool
-init_freebsd_cam (_img_private_t *p_env)
-{
- char pass[100];
-
- p_env->cam=NULL;
- memset (&p_env->ccb, 0, sizeof(p_env->ccb));
- p_env->ccb.ccb_h.func_code = XPT_GDEVLIST;
-
- if (-1 == p_env->gen.fd)
- p_env->gen.fd = open (p_env->device, O_RDONLY, 0);
-
- if (p_env->gen.fd < 0)
- {
- cdio_warn ("open (%s): %s", p_env->device, strerror (errno));
- return false;
- }
-
- if (ioctl (p_env->gen.fd, CAMGETPASSTHRU, &p_env->ccb) < 0)
- {
- cdio_warn ("open: %s", strerror (errno));
- return false;
- }
- sprintf (pass,"/dev/%.15s%u",
- p_env->ccb.cgdl.periph_name,
- p_env->ccb.cgdl.unit_number);
- p_env->cam = cam_open_pass (pass,O_RDWR,NULL);
- if (!p_env->cam) return false;
-
- p_env->gen.init = true;
- p_env->b_cam_init = true;
- return true;
-}
-
-void
-free_freebsd_cam (void *user_data)
-{
- _img_private_t *p_env = user_data;
-
- if (NULL == p_env) return;
-
- if (p_env->gen.fd > 0)
- close (p_env->gen.fd);
- p_env->gen.fd = -1;
-
- if(p_env->cam)
- cam_close_device(p_env->cam);
-
- free (p_env);
-}
-
-static int
-_set_bsize (_img_private_t *p_env, unsigned int bsize)
-{
- scsi_mmc_cdb_t cdb = {{0, }};
-
- struct
- {
- uint8_t reserved1;
- uint8_t medium;
- uint8_t reserved2;
- uint8_t block_desc_length;
- uint8_t density;
- uint8_t number_of_blocks_hi;
- uint8_t number_of_blocks_med;
- uint8_t number_of_blocks_lo;
- uint8_t reserved3;
- uint8_t block_length_hi;
- uint8_t block_length_med;
- uint8_t block_length_lo;
- } mh;
-
- memset (&mh, 0, sizeof (mh));
- mh.block_desc_length = 0x08;
- mh.block_length_hi = (bsize >> 16) & 0xff;
- mh.block_length_med = (bsize >> 8) & 0xff;
- mh.block_length_lo = (bsize >> 0) & 0xff;
-
- memset (&cdb, 0, sizeof (cdb));
-
- CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_MODE_SELECT_6);
-
- cdb.field[1] = 1 << 4;
- cdb.field[4] = 12;
-
- return run_scsi_cmd_freebsd_cam (p_env, DEFAULT_TIMEOUT_MSECS,
- scsi_mmc_get_cmd_len(cdb.field[0]),
- &cdb, SCSI_MMC_DATA_WRITE,
- sizeof(mh), &mh);
-}
-
-int
-read_mode2_sector_freebsd_cam (_img_private_t *p_env, void *data, lsn_t lsn,
- bool b_form2)
-{
- if ( b_form2 )
- return read_mode2_sectors_freebsd_cam(p_env, data, lsn, 1);
- else {
- /* Need to pick out the data portion from a mode2 form2 frame */
- char buf[M2RAW_SECTOR_SIZE] = { 0, };
- int retval = read_mode2_sectors_freebsd_cam(p_env, buf, lsn, 1);
- if ( retval ) return retval;
- memcpy (((char *)data), buf + CDIO_CD_SUBHEADER_SIZE, CDIO_CD_FRAMESIZE);
- return 0;
- }
-}
-
-/*!
- Reads nblocks of mode2 sectors from cd device into data starting
- from lsn.
- Returns 0 if no error.
- */
-int
-read_mode2_sectors_freebsd_cam (_img_private_t *p_env, void *p_buf,
- lsn_t lsn, unsigned int nblocks)
-{
- scsi_mmc_cdb_t cdb = {{0, }};
-
- bool b_read_10 = false;
-
- CDIO_MMC_SET_READ_LBA(cdb.field, lsn);
-
- if (b_read_10) {
- int retval;
-
- CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_READ_10);
- CDIO_MMC_SET_READ_LENGTH16(cdb.field, nblocks);
- if ((retval = _set_bsize (p_env, M2RAW_SECTOR_SIZE)))
- return retval;
-
- if ((retval = run_scsi_cmd_freebsd_cam (p_env, 0,
- scsi_mmc_get_cmd_len(cdb.field[0]),
- &cdb,
- SCSI_MMC_DATA_READ,
- M2RAW_SECTOR_SIZE * nblocks,
- p_buf)))
- {
- _set_bsize (p_env, CDIO_CD_FRAMESIZE);
- return retval;
- }
-
- if ((retval = _set_bsize (p_env, CDIO_CD_FRAMESIZE)))
- return retval;
- } else
- CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_READ_CD);
- CDIO_MMC_SET_READ_LENGTH24(cdb.field, nblocks);
- cdb.field[1] = 0; /* sector size mode2 */
- cdb.field[9] = 0x58; /* 2336 mode2 */
- return run_scsi_cmd_freebsd_cam (p_env, 0,
- scsi_mmc_get_cmd_len(cdb.field[0]),
- &cdb,
- SCSI_MMC_DATA_READ,
- M2RAW_SECTOR_SIZE * nblocks, p_buf);
-
- return 0;
-}
-
-/*!
- Return the size of the CD in logical block address (LBA) units.
- */
-uint32_t
-stat_size_freebsd_cam (_img_private_t *p_env)
-{
- scsi_mmc_cdb_t cdb = {{0, }};
- uint8_t buf[12] = { 0, };
-
- uint32_t retval;
- int i_status;
-
- /* Operation code */
- CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_READ_TOC);
-
- cdb.field[1] = 0; /* lba; msf: 0x2 */
-
- /* Format */
- cdb.field[2] = CDIO_MMC_READTOC_FMT_TOC;
-
- CDIO_MMC_SET_START_TRACK(cdb.field, CDIO_CDROM_LEADOUT_TRACK);
-
- CDIO_MMC_SET_READ_LENGTH16(cdb.field, sizeof(buf));
-
- p_env->ccb.csio.data_ptr = buf;
- p_env->ccb.csio.dxfer_len = sizeof (buf);
-
- i_status = run_scsi_cmd_freebsd_cam(p_env, DEFAULT_TIMEOUT_MSECS,
- scsi_mmc_get_cmd_len(cdb.field[0]),
- &cdb, SCSI_MMC_DATA_READ,
- sizeof(buf), buf);
- if (0 != i_status)
- return 0;
-
- {
- int i;
-
- retval = 0;
- for (i = 8; i < 12; i++)
- {
- retval <<= 8;
- retval += buf[i];
- }
- }
-
- return retval;
-}
-
-/*!
- * Eject using SCSI MMC commands. Return 0 if successful.
- */
-int
-eject_media_freebsd_cam (_img_private_t *p_env)
-{
- int i_status;
- scsi_mmc_cdb_t cdb = {{0, }};
- uint8_t buf[1];
-
- CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_ALLOW_MEDIUM_REMOVAL);
-
- i_status = run_scsi_cmd_freebsd_cam (p_env, DEFAULT_TIMEOUT_MSECS,
- scsi_mmc_get_cmd_len(cdb.field[0]),
- &cdb, SCSI_MMC_DATA_WRITE, 0, &buf);
- if (0 != i_status)
- return i_status;
-
- cdb.field[4] = 1;
- i_status = run_scsi_cmd_freebsd_cam (p_env, DEFAULT_TIMEOUT_MSECS,
- scsi_mmc_get_cmd_len(cdb.field[0]), &cdb,
- SCSI_MMC_DATA_WRITE, 0, &buf);
- if (0 != i_status)
- return i_status;
-
- CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_START_STOP);
- cdb.field[4] = 2; /* eject */
-
- return run_scsi_cmd_freebsd_cam (p_env, DEFAULT_TIMEOUT_MSECS,
- scsi_mmc_get_cmd_len(cdb.field[0]),
- &cdb,
- SCSI_MMC_DATA_WRITE, 0, &buf);
-}
-
-#endif /* HAVE_FREEBSD_CDROM */
diff --git a/src/input/vcd/libcdio/FreeBSD/freebsd_ioctl.c b/src/input/vcd/libcdio/FreeBSD/freebsd_ioctl.c
deleted file mode 100644
index be9835c95..000000000
--- a/src/input/vcd/libcdio/FreeBSD/freebsd_ioctl.c
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- $Id: freebsd_ioctl.c,v 1.1 2005/01/01 02:43:57 rockyb Exp $
-
- Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* This file contains FreeBSD-specific code and implements low-level
- control of the CD drive. Culled initially I think from xine's or
- mplayer's FreeBSD code with lots of modifications.
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-static const char _rcsid[] = "$Id: freebsd_ioctl.c,v 1.1 2005/01/01 02:43:57 rockyb Exp $";
-
-#ifdef HAVE_FREEBSD_CDROM
-
-#include "freebsd.h"
-
-/* Check a drive to see if it is a CD-ROM
- Return 1 if a CD-ROM. 0 if it exists but isn't a CD-ROM drive
- and -1 if no device exists .
-*/
-bool
-cdio_is_cdrom_freebsd_ioctl(char *drive, char *mnttype)
-{
- bool is_cd=false;
- int cdfd;
- struct ioc_toc_header tochdr;
-
- /* If it doesn't exist, return -1 */
- if ( !cdio_is_device_quiet_generic(drive) ) {
- return(false);
- }
-
- /* If it does exist, verify that it's an available CD-ROM */
- cdfd = open(drive, (O_RDONLY|O_EXCL|O_NONBLOCK), 0);
-
- /* Should we want to test the condition in more detail:
- ENOENT is the error for /dev/xxxxx does not exist;
- ENODEV means there's no drive present. */
-
- if ( cdfd >= 0 ) {
- if ( ioctl(cdfd, CDIOREADTOCHEADER, &tochdr) != -1 ) {
- is_cd = true;
- }
- close(cdfd);
- }
- /* Even if we can't read it, it might be mounted */
- else if ( mnttype && (strcmp(mnttype, "iso9660") == 0) ) {
- is_cd = true;
- }
- return(is_cd);
-}
-
-/*!
- Reads a single mode2 sector from cd device into data starting from lsn.
- Returns 0 if no error.
- */
-int
-read_audio_sectors_freebsd_ioctl (_img_private_t *_obj, void *data, lsn_t lsn,
- unsigned int nblocks)
-{
- unsigned char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, };
- struct ioc_read_audio cdda;
-
- cdda.address.lba = lsn;
- cdda.buffer = buf;
- cdda.nframes = nblocks;
- cdda.address_format = CDIO_CDROM_LBA;
-
- /* read a frame */
- if(ioctl(_obj->gen.fd, CDIOCREADAUDIO, &cdda) < 0) {
- perror("CDIOCREADAUDIO");
- return 1;
- }
- memcpy (data, buf, CDIO_CD_FRAMESIZE_RAW);
-
- return 0;
-}
-
-/*!
- Reads a single mode2 sector from cd device into data starting
- from lsn. Returns 0 if no error.
- */
-int
-read_mode2_sector_freebsd_ioctl (_img_private_t *env, void *data, lsn_t lsn,
- bool b_form2)
-{
- char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, };
- int retval;
-
- if ( !b_form2 )
- return cdio_generic_read_form1_sector (env, buf, lsn);
-
- if ( (retval = read_audio_sectors_freebsd_ioctl (env, buf, lsn, 1)) )
- return retval;
-
- memcpy (data, buf + CDIO_CD_XA_SYNC_HEADER, M2RAW_SECTOR_SIZE);
-
- return 0;
-}
-
-/*!
- Return the size of the CD in logical block address (LBA) units.
- */
-uint32_t
-stat_size_freebsd_ioctl (_img_private_t *_obj)
-{
- struct ioc_read_toc_single_entry tocent;
- uint32_t size;
-
- tocent.track = CDIO_CDROM_LEADOUT_TRACK;
- tocent.address_format = CDIO_CDROM_LBA;
- if (ioctl (_obj->gen.fd, CDIOREADTOCENTRY, &tocent) == -1)
- {
- perror ("ioctl(CDROMREADTOCENTRY)");
- exit (EXIT_FAILURE);
- }
-
- size = tocent.entry.addr.lba;
-
- return size;
-}
-
-/*!
- Eject media. Return 1 if successful, 0 otherwise.
- */
-int
-eject_media_freebsd_ioctl (_img_private_t *env)
-{
- _img_private_t *_obj = env;
- int ret=2;
- int fd;
-
- if ((fd = open(_obj->gen.source_name, O_RDONLY|O_NONBLOCK)) > -1) {
- ret = 1;
- if (ioctl(fd, CDIOCALLOW) == -1) {
- cdio_warn("ioctl(fd, CDIOCALLOW) failed: %s\n", strerror(errno));
- } else if (ioctl(fd, CDIOCEJECT) == -1) {
- cdio_warn("ioctl(CDIOCEJECT) failed: %s\n", strerror(errno));
- } else {
- ret = 0;
- }
- close(fd);
- }
-
- return ret;
-}
-
-/*!
- Return the media catalog number MCN.
-
- Note: string is malloc'd so caller should free() then returned
- string when done with it.
-
- FIXME: This is just a guess.
-
- */
-char *
-get_mcn_freebsd_ioctl (const _img_private_t *env) {
-
- struct ioc_read_subchannel subchannel;
- struct cd_sub_channel_info subchannel_info;
-
- subchannel.address_format = CDIO_CDROM_MSF;
- subchannel.data_format = CDIO_SUBCHANNEL_MEDIA_CATALOG;
- subchannel.track = 0;
- subchannel.data_len = sizeof(subchannel_info);
- subchannel.data = &subchannel_info;
-
- if(ioctl(env->gen.fd, CDIOCREADSUBCHANNEL, &subchannel) < 0) {
- perror("CDIOCREADSUBCHANNEL");
- return NULL;
- }
-
- /* Probably need a loop over tracks rather than give up if we
- can't find in track 0.
- */
- if (subchannel_info.what.media_catalog.mc_valid)
- return strdup(subchannel_info.what.media_catalog.mc_number);
- else
- return NULL;
-}
-
-/*!
- Get format of track.
-
- FIXME: We're just guessing this from the GNU/Linux code.
-
-*/
-track_format_t
-get_track_format_freebsd_ioctl(const _img_private_t *env, track_t i_track)
-{
- struct ioc_read_subchannel subchannel;
- struct cd_sub_channel_info subchannel_info;
-
- subchannel.address_format = CDIO_CDROM_LBA;
- subchannel.data_format = CDIO_SUBCHANNEL_CURRENT_POSITION;
- subchannel.track = i_track;
- subchannel.data_len = 1;
- subchannel.data = &subchannel_info;
-
- if(ioctl(env->gen.fd, CDIOCREADSUBCHANNEL, &subchannel) < 0) {
- perror("CDIOCREADSUBCHANNEL");
- return 1;
- }
-
- if (subchannel_info.what.position.control == 0x04) {
- if (subchannel_info.what.position.data_format == 0x10)
- return TRACK_FORMAT_CDI;
- else if (subchannel_info.what.position.data_format == 0x20)
- return TRACK_FORMAT_XA;
- else
- return TRACK_FORMAT_DATA;
- } else
- return TRACK_FORMAT_AUDIO;
-}
-
-/*!
- Return true if we have XA data (green, mode2 form1) or
- XA data (green, mode2 form2). That is track begins:
- sync - header - subheader
- 12 4 - 8
-
- FIXME: there's gotta be a better design for this and get_track_format?
-*/
-bool
-get_track_green_freebsd_ioctl(const _img_private_t *env, track_t i_track)
-{
- struct ioc_read_subchannel subchannel;
- struct cd_sub_channel_info subchannel_info;
-
- subchannel.address_format = CDIO_CDROM_LBA;
- subchannel.data_format = CDIO_SUBCHANNEL_CURRENT_POSITION;
- subchannel.track = i_track;
- subchannel.data_len = 1;
- subchannel.data = &subchannel_info;
-
- if(ioctl(env->gen.fd, CDIOCREADSUBCHANNEL, &subchannel) < 0) {
- perror("CDIOCREADSUBCHANNEL");
- return 1;
- }
-
- /* FIXME: Dunno if this is the right way, but it's what
- I was using in cdinfo for a while.
- */
- return (subchannel_info.what.position.control & 2) != 0;
-}
-
-#endif /* HAVE_FREEBSD_CDROM */
diff --git a/src/input/vcd/libcdio/MSWindows/Makefile.am b/src/input/vcd/libcdio/MSWindows/Makefile.am
deleted file mode 100644
index 61089cf69..000000000
--- a/src/input/vcd/libcdio/MSWindows/Makefile.am
+++ /dev/null
@@ -1,3 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-EXTRA_DIST = aspi32.c aspi32.h win32.c win32.h win32_ioctl.c
diff --git a/src/input/vcd/libcdio/MSWindows/aspi32.c b/src/input/vcd/libcdio/MSWindows/aspi32.c
deleted file mode 100644
index 238a4b4e9..000000000
--- a/src/input/vcd/libcdio/MSWindows/aspi32.c
+++ /dev/null
@@ -1,805 +0,0 @@
-/*
- $Id: aspi32.c,v 1.2 2005/01/01 02:43:58 rockyb Exp $
-
- Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* This file contains Win32-specific code and implements low-level
- control of the CD drive via the ASPI API.
- Inspired by vlc's cdrom.h code
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-static const char _rcsid[] = "$Id: aspi32.c,v 1.2 2005/01/01 02:43:58 rockyb Exp $";
-
-#include <cdio/cdio.h>
-#include <cdio/sector.h>
-#include <cdio/util.h>
-#include <cdio/scsi_mmc.h>
-#include "cdio_assert.h"
-
-#include <string.h>
-
-#ifdef HAVE_WIN32_CDROM
-
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-
-#include <windows.h>
-#include "win32.h"
-
-#include <sys/stat.h>
-#include <sys/types.h>
-#include "aspi32.h"
-#include "cdtext_private.h"
-
-/* Amount of time we are willing to wait for an operation to complete.
- 10 seconds?
-*/
-#define OP_TIMEOUT_MS 10000
-
-static const
-char *aspierror(int nErrorCode)
-{
- switch (nErrorCode)
- {
- case SS_PENDING:
- return "SRB being processed";
- break;
- case SS_COMP:
- return "SRB completed without error";
- break;
- case SS_ABORTED:
- return "SRB aborted";
- break;
- case SS_ABORT_FAIL:
- return "Unable to abort SRB";
- break;
- case SS_ERR:
- return "SRB completed with error";
- break;
- case SS_INVALID_CMD:
- return "Invalid ASPI command";
- break;
- case SS_INVALID_HA:
- return "Invalid host adapter number";
- break;
- case SS_NO_DEVICE:
- return "SCSI device not installed";
- break;
- case SS_INVALID_SRB:
- return "Invalid parameter set in SRB";
- break;
- case SS_OLD_MANAGER:
- return "ASPI manager doesn't support";
- break;
- case SS_ILLEGAL_MODE:
- return "Unsupported MS Windows mode";
- break;
- case SS_NO_ASPI:
- return "No ASPI managers";
- break;
- case SS_FAILED_INIT:
- return "ASPI for windows failed init";
- break;
- case SS_ASPI_IS_BUSY:
- return "No resources available to execute command.";
- break;
- case SS_BUFFER_TOO_BIG:
- return "Buffer size is too big to handle.";
- break;
- case SS_MISMATCHED_COMPONENTS:
- return "The DLLs/EXEs of ASPI don't version check";
- break;
- case SS_NO_ADAPTERS:
- return "No host adapters found";
- break;
- case SS_INSUFFICIENT_RESOURCES:
- return "Couldn't allocate resources needed to init";
- break;
- case SS_ASPI_IS_SHUTDOWN:
- return "Call came to ASPI after PROCESS_DETACH";
- break;
- case SS_BAD_INSTALL:
- return "The DLL or other components are installed wrong.";
- break;
- default:
- return "Unknown ASPI error.";
- }
-}
-
-/* General ioctl() CD-ROM command function */
-static bool
-mciSendCommand_aspi(int id, UINT msg, DWORD flags, void *arg)
-{
- MCIERROR mci_error;
-
- mci_error = mciSendCommand(id, msg, flags, (DWORD)arg);
- if ( mci_error ) {
- char error[256];
-
- mciGetErrorString(mci_error, error, 256);
- cdio_warn("mciSendCommand() error: %s", error);
- }
- return(mci_error == 0);
-}
-
-/*
- See if the ASPI DLL is loadable. If so pointers are returned
- and we return true. Return false if there was a problem.
- */
-static bool
-have_aspi( HMODULE *hASPI,
- long (**lpGetSupport)( void ),
- long (**lpSendCommand)( void* ) )
-{
- /* check if aspi is available */
- *hASPI = LoadLibrary( "wnaspi32.dll" );
-
- if( *hASPI == NULL ) {
- cdio_debug("Unable to load ASPI DLL");
- return false;
- }
-
- (FARPROC) *lpGetSupport = GetProcAddress( *hASPI,
- "GetASPI32SupportInfo" );
- (FARPROC) *lpSendCommand = GetProcAddress( *hASPI,
- "SendASPI32Command" );
-
- /* make sure that we've got both function addresses */
- if( *lpGetSupport == NULL || *lpSendCommand == NULL ) {
- cdio_debug("Unable to get ASPI function pointers");
- FreeLibrary( *hASPI );
- return false;
- }
-
- return true;
-}
-
-/*!
- Get disc type associated with cd object.
-*/
-discmode_t
-get_discmode_aspi (_img_private_t *p_env)
-{
- track_t i_track;
- discmode_t discmode=CDIO_DISC_MODE_NO_INFO;
-
- /* See if this is a DVD. */
- cdio_dvd_struct_t dvd; /* DVD READ STRUCT for layer 0. */
-
- dvd.physical.type = CDIO_DVD_STRUCT_PHYSICAL;
- dvd.physical.layer_num = 0;
- if (0 == scsi_mmc_get_dvd_struct_physical_private (p_env,
- &run_scsi_cmd_aspi,
- &dvd)) {
- switch(dvd.physical.layer[0].book_type) {
- case CDIO_DVD_BOOK_DVD_ROM: return CDIO_DISC_MODE_DVD_ROM;
- case CDIO_DVD_BOOK_DVD_RAM: return CDIO_DISC_MODE_DVD_RAM;
- case CDIO_DVD_BOOK_DVD_R: return CDIO_DISC_MODE_DVD_R;
- case CDIO_DVD_BOOK_DVD_RW: return CDIO_DISC_MODE_DVD_RW;
- case CDIO_DVD_BOOK_DVD_PR: return CDIO_DISC_MODE_DVD_PR;
- case CDIO_DVD_BOOK_DVD_PRW: return CDIO_DISC_MODE_DVD_PRW;
- default: return CDIO_DISC_MODE_DVD_OTHER;
- }
- }
-
- if (!p_env->gen.toc_init)
- read_toc_aspi (p_env);
-
- if (!p_env->gen.toc_init)
- return CDIO_DISC_MODE_NO_INFO;
-
- for (i_track = p_env->gen.i_first_track;
- i_track < p_env->gen.i_first_track + p_env->gen.i_tracks ;
- i_track ++) {
- track_format_t track_fmt=get_track_format_aspi(p_env, i_track);
-
- switch(track_fmt) {
- case TRACK_FORMAT_AUDIO:
- switch(discmode) {
- case CDIO_DISC_MODE_NO_INFO:
- discmode = CDIO_DISC_MODE_CD_DA;
- break;
- case CDIO_DISC_MODE_CD_DA:
- case CDIO_DISC_MODE_CD_MIXED:
- case CDIO_DISC_MODE_ERROR:
- /* No change*/
- break;
- default:
- discmode = CDIO_DISC_MODE_CD_MIXED;
- }
- break;
- case TRACK_FORMAT_XA:
- switch(discmode) {
- case CDIO_DISC_MODE_NO_INFO:
- discmode = CDIO_DISC_MODE_CD_XA;
- break;
- case CDIO_DISC_MODE_CD_XA:
- case CDIO_DISC_MODE_CD_MIXED:
- case CDIO_DISC_MODE_ERROR:
- /* No change*/
- break;
- default:
- discmode = CDIO_DISC_MODE_CD_MIXED;
- }
- break;
- case TRACK_FORMAT_DATA:
- switch(discmode) {
- case CDIO_DISC_MODE_NO_INFO:
- discmode = CDIO_DISC_MODE_CD_DATA;
- break;
- case CDIO_DISC_MODE_CD_DATA:
- case CDIO_DISC_MODE_CD_MIXED:
- case CDIO_DISC_MODE_ERROR:
- /* No change*/
- break;
- default:
- discmode = CDIO_DISC_MODE_CD_MIXED;
- }
- break;
- case TRACK_FORMAT_ERROR:
- default:
- discmode = CDIO_DISC_MODE_ERROR;
- }
- }
- return discmode;
-}
-
-const char *
-is_cdrom_aspi(const char drive_letter)
-{
- static char psz_win32_drive[7];
- HMODULE hASPI = NULL;
- long (*lpGetSupport)( void ) = NULL;
- long (*lpSendCommand)( void* ) = NULL;
- DWORD dwSupportInfo;
- int i_adapter, i_hostadapters;
- char c_drive;
- int i_rc;
-
- if ( !have_aspi(&hASPI, &lpGetSupport, &lpSendCommand) )
- return NULL;
-
- /* ASPI support seems to be there. */
-
- dwSupportInfo = lpGetSupport();
-
- i_rc = HIBYTE( LOWORD ( dwSupportInfo ) );
-
- if( SS_COMP != i_rc ) {
- cdio_debug("ASPI: %s", aspierror(i_rc));
- FreeLibrary( hASPI );
- return NULL;
- }
-
- i_hostadapters = LOBYTE( LOWORD( dwSupportInfo ) );
- if( i_hostadapters == 0 ) {
- FreeLibrary( hASPI );
- return NULL;
- }
-
- c_drive = toupper(drive_letter) - 'A';
-
- for( i_adapter = 0; i_adapter < i_hostadapters; i_adapter++ ) {
- struct SRB_GetDiskInfo srbDiskInfo;
- int i_target;
- SRB_HAInquiry srbInquiry;
-
- srbInquiry.SRB_Cmd = SC_HA_INQUIRY;
- srbInquiry.SRB_HaId = i_adapter;
-
- lpSendCommand( (void*) &srbInquiry );
-
- if( srbInquiry.SRB_Status != SS_COMP ) continue;
- if( !srbInquiry.HA_Unique[3]) srbInquiry.HA_Unique[3]=8;
-
- for(i_target=0; i_target < srbInquiry.HA_Unique[3]; i_target++)
- {
- int i_lun;
- for( i_lun=0; i_lun<8; i_lun++)
- {
- srbDiskInfo.SRB_Cmd = SC_GET_DISK_INFO;
- srbDiskInfo.SRB_Flags = 0;
- srbDiskInfo.SRB_Hdr_Rsvd = 0;
- srbDiskInfo.SRB_HaId = i_adapter;
- srbDiskInfo.SRB_Target = i_target;
- srbDiskInfo.SRB_Lun = i_lun;
-
- lpSendCommand( (void*) &srbDiskInfo );
-
- if( (srbDiskInfo.SRB_Status == SS_COMP) &&
- (srbDiskInfo.SRB_Int13HDriveInfo == c_drive) ) {
- /* Make sure this is a CD-ROM device. */
- struct SRB_GDEVBlock srbGDEVBlock;
-
- memset( &srbGDEVBlock, 0, sizeof(struct SRB_GDEVBlock) );
- srbGDEVBlock.SRB_Cmd = SC_GET_DEV_TYPE;
- srbDiskInfo.SRB_HaId = i_adapter;
- srbGDEVBlock.SRB_Target = i_target;
- srbGDEVBlock.SRB_Lun = i_lun;
-
- lpSendCommand( (void*) &srbGDEVBlock );
-
- if( ( srbGDEVBlock.SRB_Status == SS_COMP ) &&
- ( srbGDEVBlock.SRB_DeviceType == DTYPE_CDROM ) ) {
- sprintf( psz_win32_drive, "%c:", drive_letter );
- FreeLibrary( hASPI );
- return(psz_win32_drive);
- }
- }
- }
- }
- }
- FreeLibrary( hASPI );
- return NULL;
-}
-
-/*!
- Initialize CD device.
- */
-bool
-init_aspi (_img_private_t *env)
-{
- HMODULE hASPI = NULL;
- long (*lpGetSupport)( void ) = NULL;
- long (*lpSendCommand)( void* ) = NULL;
- DWORD dwSupportInfo;
- int i_adapter, i_hostadapters;
- char c_drive;
- int i_rc;
-
- if (2 == strlen(env->gen.source_name) && isalpha(env->gen.source_name[0]) )
- {
- c_drive = env->gen.source_name[0];
- } else if ( 6 == strlen(env->gen.source_name)
- && isalpha(env->gen.source_name[4] )) {
- c_drive = env->gen.source_name[4];
- } else {
- c_drive = 'C';
- }
-
- if ( !have_aspi(&hASPI, &lpGetSupport, &lpSendCommand) )
- return false;
-
- /* ASPI support seems to be there. */
-
- dwSupportInfo = lpGetSupport();
-
- i_rc = HIBYTE( LOWORD ( dwSupportInfo ) );
-
- if( SS_COMP != i_rc ) {
- cdio_info("ASPI: %s", aspierror(i_rc));
- FreeLibrary( hASPI );
- return false;
- }
-
- i_hostadapters = LOBYTE( LOWORD( dwSupportInfo ) );
- if( i_hostadapters == 0 ) {
- FreeLibrary( hASPI );
- return false;
- }
-
- c_drive = toupper(c_drive) - 'A';
-
- for( i_adapter = 0; i_adapter < i_hostadapters; i_adapter++ ) {
- struct SRB_GetDiskInfo srbDiskInfo;
- int i_target;
- SRB_HAInquiry srbInquiry;
-
- srbInquiry.SRB_Cmd = SC_HA_INQUIRY;
- srbInquiry.SRB_HaId = i_adapter;
-
- lpSendCommand( (void*) &srbInquiry );
-
- if( srbInquiry.SRB_Status != SS_COMP ) continue;
- if( !srbInquiry.HA_Unique[3]) srbInquiry.HA_Unique[3]=8;
-
- for(i_target=0; i_target < srbInquiry.HA_Unique[3]; i_target++)
- {
- int i_lun;
- for (i_lun = 0; i_lun < 8; i_lun++ ) {
- srbDiskInfo.SRB_Cmd = SC_GET_DISK_INFO;
- srbDiskInfo.SRB_Flags = 0;
- srbDiskInfo.SRB_Hdr_Rsvd = 0;
- srbDiskInfo.SRB_HaId = i_adapter;
- srbDiskInfo.SRB_Target = i_target;
- srbDiskInfo.SRB_Lun = i_lun;
-
- lpSendCommand( (void*) &srbDiskInfo );
-
- if( (srbDiskInfo.SRB_Status == SS_COMP) ) {
-
- if (srbDiskInfo.SRB_Int13HDriveInfo != c_drive)
- {
- continue;
- } else {
- /* Make sure this is a CD-ROM device. */
- struct SRB_GDEVBlock srbGDEVBlock;
-
- memset( &srbGDEVBlock, 0, sizeof(struct SRB_GDEVBlock) );
- srbGDEVBlock.SRB_Cmd = SC_GET_DEV_TYPE;
- srbGDEVBlock.SRB_HaId = i_adapter;
- srbGDEVBlock.SRB_Target = i_target;
-
- lpSendCommand( (void*) &srbGDEVBlock );
-
- if( ( srbGDEVBlock.SRB_Status == SS_COMP ) &&
- ( srbGDEVBlock.SRB_DeviceType == DTYPE_CDROM ) ) {
- env->i_sid = MAKEWORD( i_adapter, i_target );
- env->hASPI = (long)hASPI;
- env->lpSendCommand = lpSendCommand;
- env->b_aspi_init = true;
- env->i_lun = i_lun;
- cdio_debug("Using ASPI layer");
-
- return true;
- } else {
- FreeLibrary( hASPI );
- cdio_debug( "%c: is not a CD-ROM drive",
- env->gen.source_name[0] );
- return false;
- }
- }
- }
- }
- }
- }
-
- FreeLibrary( hASPI );
- cdio_debug( "Unable to get HaId and target (ASPI)" );
- return false;
-}
-
-/*!
- Run a SCSI MMC command.
-
- env private CD structure
- i_timeout_ms time in milliseconds we will wait for the command
- to complete. If this value is -1, use the default
- time-out value.
- p_buf Buffer for data, both sending and receiving
- i_buf Size of buffer
- e_direction direction the transfer is to go.
- cdb CDB bytes. All values that are needed should be set on
- input. We'll figure out what the right CDB length should be.
-
- We return 0 if command completed successfully.
- */
-int
-run_scsi_cmd_aspi( const void *p_user_data, unsigned int i_timeout_ms,
- unsigned int i_cdb, const scsi_mmc_cdb_t * p_cdb,
- scsi_mmc_direction_t e_direction,
- unsigned int i_buf, /*in/out*/ void *p_buf )
-{
- const _img_private_t *p_env = p_user_data;
- HANDLE hEvent;
- struct SRB_ExecSCSICmd ssc;
-
- /* Create the transfer completion event */
- hEvent = CreateEvent( NULL, TRUE, FALSE, NULL );
- if( hEvent == NULL ) {
- cdio_info("CreateEvent failed");
- return 1;
- }
-
- memset( &ssc, 0, sizeof( ssc ) );
-
- ssc.SRB_Cmd = SC_EXEC_SCSI_CMD;
-
- ssc.SRB_Flags = SCSI_MMC_DATA_READ == e_direction ?
- SRB_DIR_IN | SRB_EVENT_NOTIFY : SRB_DIR_OUT | SRB_EVENT_NOTIFY;
-
- ssc.SRB_HaId = LOBYTE( p_env->i_sid );
- ssc.SRB_Target = HIBYTE( p_env->i_sid );
- ssc.SRB_Lun = p_env->i_lun;
- ssc.SRB_SenseLen = SENSE_LEN;
-
- ssc.SRB_PostProc = (LPVOID) hEvent;
- ssc.SRB_CDBLen = i_cdb;
-
- /* Result buffer */
- ssc.SRB_BufPointer = p_buf;
- ssc.SRB_BufLen = i_buf;
-
- memcpy( ssc.CDBByte, p_cdb, i_cdb );
-
- ResetEvent( hEvent );
- p_env->lpSendCommand( (void*) &ssc );
-
- /* If the command has still not been processed, wait until it's
- * finished */
- if( ssc.SRB_Status == SS_PENDING ) {
- WaitForSingleObject( hEvent, msecs2secs(i_timeout_ms) );
- }
- CloseHandle( hEvent );
-
- /* check that the transfer went as planned */
- if( ssc.SRB_Status != SS_COMP ) {
- cdio_info("ASPI: %s", aspierror(ssc.SRB_Status));
- return 2;
- }
-
- return 0;
-}
-
-
-/*!
- Reads nblocks sectors from cd device into data starting from lsn.
- Returns 0 if no error.
- */
-static int
-read_sectors_aspi (const _img_private_t *env, void *data, lsn_t lsn,
- int sector_type, unsigned int nblocks)
-{
- scsi_mmc_cdb_t cdb = {{0, }};
- unsigned int i_buf;
-
- int sync = 0;
- int header_code = 2;
- int i_user_data = 1;
- int edc_ecc = 0;
- int error_field = 0;
-
-#if 0
- sector_type = 0; /*all types */
-#endif
-
- /* Set up passthrough command */
- CDIO_MMC_SET_COMMAND (cdb.field, CDIO_MMC_GPCMD_READ_CD);
- CDIO_MMC_SET_READ_TYPE (cdb.field, sector_type);
- CDIO_MMC_SET_READ_LBA (cdb.field, lsn);
- CDIO_MMC_SET_READ_LENGTH24(cdb.field, nblocks);
-
-#if 1
- cdb.field[ 9 ] = (sync << 7) |
- (header_code << 5) |
- (i_user_data << 4) |
- (edc_ecc << 3) |
- (error_field << 1);
- /* ssc.CDBByte[ 9 ] = READ_CD_USERDATA_MODE2; */
-#else
- CDIO_MMC_SET_MAIN_CHANNEL_SELECTION_BITS(cmd,
- CDIO_MMC_MCSB_ALL_HEADERS);
-#endif
-
- switch (sector_type) {
- case CDIO_MMC_READ_TYPE_ANY:
- case CDIO_MMC_READ_TYPE_CDDA:
- i_buf = CDIO_CD_FRAMESIZE_RAW;
- break;
- case CDIO_MMC_READ_TYPE_M2F1:
- i_buf = CDIO_CD_FRAMESIZE;
- break;
- case CDIO_MMC_READ_TYPE_M2F2:
- i_buf = 2324;
- break;
- case CDIO_MMC_READ_TYPE_MODE1:
- i_buf = CDIO_CD_FRAMESIZE;
- break;
- default:
- i_buf = CDIO_CD_FRAMESIZE_RAW;
- }
-
- return run_scsi_cmd_aspi(env, OP_TIMEOUT_MS,
- scsi_mmc_get_cmd_len(cdb.field[0]),
- &cdb, SCSI_MMC_DATA_READ, i_buf*nblocks, data);
-}
-
-/*!
- Reads an audio device into data starting from lsn.
- Returns 0 if no error.
- */
-int
-read_audio_sectors_aspi (_img_private_t *env, void *data, lsn_t lsn,
- unsigned int nblocks)
-{
- if (read_sectors_aspi(env, data, lsn, CDIO_MMC_READ_TYPE_CDDA, 1)) {
- return read_sectors_aspi(env, data, lsn, CDIO_MMC_READ_TYPE_ANY, 1);
- }
- return 0;
-}
-
-/*!
- Reads a single mode2 sector from cd device into data starting
- from lsn. Returns 0 if no error.
- */
-int
-read_mode2_sector_aspi (const _img_private_t *env, void *data, lsn_t lsn,
- bool b_form2)
-{
- return read_sectors_aspi(env, data, lsn, b_form2
- ? CDIO_MMC_READ_TYPE_M2F2
- : CDIO_MMC_READ_TYPE_M2F1,
- 1);
-}
-
-/*!
- Reads a single mode2 sector from cd device into data starting
- from lsn. Returns 0 if no error.
- */
-int
-read_mode1_sector_aspi (const _img_private_t *env, void *data, lsn_t lsn,
- bool b_form2)
-{
- return read_sectors_aspi(env, data, lsn, CDIO_MMC_READ_TYPE_MODE1, 1);
-}
-
-/*!
- Read and cache the CD's Track Table of Contents and track info.
- Return true if successful or false if an error.
-*/
-bool
-read_toc_aspi (_img_private_t *p_env)
-{
- scsi_mmc_cdb_t cdb = {{0, }};
- unsigned char tocheader[ 4 ];
- int i_status;
-
- /* Operation code */
- CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_READ_TOC);
-
- /* Format */
- cdb.field[ 2 ] = CDIO_MMC_READTOC_FMT_TOC;
-
- /* Starting track */
- CDIO_MMC_SET_START_TRACK(cdb.field, 0);
-
- CDIO_MMC_SET_READ_LENGTH16(cdb.field, sizeof(tocheader));
-
- i_status = run_scsi_cmd_aspi (p_env, OP_TIMEOUT_MS,
- scsi_mmc_get_cmd_len(cdb.field[0]),
- &cdb, SCSI_MMC_DATA_READ,
- sizeof(tocheader), &tocheader);
-
- if (0 != i_status) return false;
-
- p_env->gen.i_first_track = tocheader[2];
- p_env->gen.i_tracks = tocheader[3] - tocheader[2] + 1;
-
- {
- int i, i_toclength;
- unsigned char *p_fulltoc;
-
- i_toclength = 4 /* header */ + tocheader[0] +
- ((unsigned int) tocheader[1] << 8);
-
- p_fulltoc = malloc( i_toclength );
-
- if( p_fulltoc == NULL ) {
- cdio_error( "out of memory" );
- return false;
- }
-
- CDIO_MMC_SET_READ_LENGTH16(cdb.field, i_toclength);
-
- i_status = run_scsi_cmd_aspi (p_env, OP_TIMEOUT_MS,
- scsi_mmc_get_cmd_len(cdb.field[0]),
- &cdb, SCSI_MMC_DATA_READ,
- i_toclength, p_fulltoc);
- if( 0 != i_status ) {
- p_env->gen.i_tracks = 0;
- }
-
- for( i = 0 ; i <= p_env->gen.i_tracks ; i++ ) {
- int i_index = 8 + 8 * i;
- p_env->tocent[ i ].start_lsn = ((int)p_fulltoc[ i_index ] << 24) +
- ((int)p_fulltoc[ i_index+1 ] << 16) +
- ((int)p_fulltoc[ i_index+2 ] << 8) +
- (int)p_fulltoc[ i_index+3 ];
- p_env->tocent[ i ].Control = (UCHAR)p_fulltoc[ 1 + 8 * i ];
-
- cdio_debug( "p_sectors: %i %lu",
- i, (unsigned long int) p_env->tocent[i].start_lsn );
- }
-
- free( p_fulltoc );
- }
-
- p_env->gen.toc_init = true;
- return true;
-}
-
-/* Eject media will eventually get removed from _cdio_win32.c */
-#if 0
-/*!
- Eject media. Return 1 if successful, 0 otherwise.
- */
-int
-wnaspi32_eject_media (void *user_data) {
-
- _img_private_t *env = user_data;
-
-
- MCI_OPEN_PARMS op;
- MCI_STATUS_PARMS st;
- DWORD i_flags;
- char psz_drive[4];
- int ret;
-
- memset( &op, 0, sizeof(MCI_OPEN_PARMS) );
- op.lpstrDeviceType = (LPCSTR)MCI_DEVTYPE_CD_AUDIO;
- strcpy( psz_drive, "X:" );
- psz_drive[0] = env->gen.source_name[0];
- op.lpstrElementName = psz_drive;
-
- /* Set the flags for the device type */
- i_flags = MCI_OPEN_TYPE | MCI_OPEN_TYPE_ID |
- MCI_OPEN_ELEMENT | MCI_OPEN_SHAREABLE;
-
- if( mciSendCommand_aspi( 0, MCI_OPEN, i_flags, &op ) ) {
- st.dwItem = MCI_STATUS_READY;
- /* Eject disc */
- ret = mciSendCommand_aspi( op.wDeviceID, MCI_SET,
- MCI_SET_DOOR_OPEN, 0 ) != 0;
- /* Release access to the device */
- mciSendCommand_aspi( op.wDeviceID, MCI_CLOSE, MCI_WAIT, 0 );
- } else
- ret = 0;
-
- return ret;
-}
-#endif
-
-/*!
- Get format of track.
-*/
-track_format_t
-get_track_format_aspi(const _img_private_t *p_env, track_t track_num)
-{
- MCI_OPEN_PARMS op;
- MCI_STATUS_PARMS st;
- DWORD i_flags;
- int ret;
-
- memset( &op, 0, sizeof(MCI_OPEN_PARMS) );
- op.lpstrDeviceType = (LPCSTR)MCI_DEVTYPE_CD_AUDIO;
- op.lpstrElementName = p_env->gen.source_name;
-
- /* Set the flags for the device type */
- i_flags = MCI_OPEN_TYPE | MCI_OPEN_TYPE_ID |
- MCI_OPEN_ELEMENT | MCI_OPEN_SHAREABLE;
-
- if( mciSendCommand_aspi( 0, MCI_OPEN, i_flags, &op ) ) {
- st.dwItem = MCI_CDA_STATUS_TYPE_TRACK;
- st.dwTrack = track_num;
- i_flags = MCI_TRACK | MCI_STATUS_ITEM ;
- ret = mciSendCommand_aspi( op.wDeviceID, MCI_STATUS, i_flags, &st );
-
- /* Release access to the device */
- mciSendCommand_aspi( op.wDeviceID, MCI_CLOSE, MCI_WAIT, 0 );
-
- switch(st.dwReturn) {
- case MCI_CDA_TRACK_AUDIO:
- return TRACK_FORMAT_AUDIO;
- case MCI_CDA_TRACK_OTHER:
- return TRACK_FORMAT_DATA;
- default:
- return TRACK_FORMAT_XA;
- }
- }
- return TRACK_FORMAT_ERROR;
-}
-
-#endif /* HAVE_WIN32_CDROM */
diff --git a/src/input/vcd/libcdio/MSWindows/aspi32.h b/src/input/vcd/libcdio/MSWindows/aspi32.h
deleted file mode 100644
index 8742c0794..000000000
--- a/src/input/vcd/libcdio/MSWindows/aspi32.h
+++ /dev/null
@@ -1,249 +0,0 @@
-/* Win32 aspi specific */
-/*
- $Id: aspi32.h,v 1.2 2005/01/01 02:43:58 rockyb Exp $
-
- Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#define ASPI_HAID 0
-#define ASPI_TARGET 0
-#define DTYPE_CDROM 0x05
-
-#define SENSE_LEN 0x0E
-#define SC_HA_INQUIRY 0x00
-#define SC_GET_DEV_TYPE 0x01
-#define SC_EXEC_SCSI_CMD 0x02
-#define SC_GET_DISK_INFO 0x06
-
-//*****************************************************************************
-// %%% SRB Status %%%
-//*****************************************************************************
-
-#define SS_PENDING 0x00 // SRB being processed
-#define SS_COMP 0x01 // SRB completed without error
-#define SS_ABORTED 0x02 // SRB aborted
-#define SS_ABORT_FAIL 0x03 // Unable to abort SRB
-#define SS_ERR 0x04 // SRB completed with error
-
-#define SS_INVALID_CMD 0x80 // Invalid ASPI command
-#define SS_INVALID_HA 0x81 // Invalid host adapter number
-#define SS_NO_DEVICE 0x82 // SCSI device not installed
-
-#define SS_INVALID_SRB 0xE0 // Invalid parameter set in SRB
-#define SS_OLD_MANAGER 0xE1 // ASPI manager doesn't support Windows
-#define SS_BUFFER_ALIGN 0xE1 // Buffer not aligned (replaces
- // OLD_MANAGER in Win32)
-#define SS_ILLEGAL_MODE 0xE2 // Unsupported Windows mode
-#define SS_NO_ASPI 0xE3 // No ASPI managers resident
-#define SS_FAILED_INIT 0xE4 // ASPI for windows failed init
-#define SS_ASPI_IS_BUSY 0xE5 // No resources available to execute
- // cmd
-#define SS_BUFFER_TOO_BIG 0xE6 // Buffer size to big to handle!
-#define SS_MISMATCHED_COMPONENTS 0xE7 // The DLLs/EXEs of ASPI don't version
- // check
-#define SS_NO_ADAPTERS 0xE8 // No host adapters to manage
-#define SS_INSUFFICIENT_RESOURCES 0xE9 // Couldn't allocate resources needed
- // to init
-#define SS_ASPI_IS_SHUTDOWN 0xEA // Call came to ASPI after
- // PROCESS_DETACH
-#define SS_BAD_INSTALL 0xEB // The DLL or other components are installed wrong
-
-//*****************************************************************************
-// %%% Host Adapter Status %%%
-//*****************************************************************************
-
-#define HASTAT_OK 0x00 // Host adapter did not detect an
- // error
-#define HASTAT_SEL_TO 0x11 // Selection Timeout
-#define HASTAT_DO_DU 0x12 // Data overrun data underrun
-#define HASTAT_BUS_FREE 0x13 // Unexpected bus free
-#define HASTAT_PHASE_ERR 0x14 // Target bus phase sequence
- // failure
-#define HASTAT_TIMEOUT 0x09 // Timed out while SRB was
- // waiting to beprocessed.
-#define HASTAT_COMMAND_TIMEOUT 0x0B // Adapter timed out processing SRB.
-#define HASTAT_MESSAGE_REJECT 0x0D // While processing SRB, the
- // adapter received a MESSAGE
-#define HASTAT_BUS_RESET 0x0E // A bus reset was detected.
-#define HASTAT_PARITY_ERROR 0x0F // A parity error was detected.
-#define HASTAT_REQUEST_SENSE_FAILED 0x10 // The adapter failed in issuing
-#define SS_NO_ADAPTERS 0xE8
-#define SRB_DIR_IN 0x08
-#define SRB_DIR_OUT 0x10
-#define SRB_EVENT_NOTIFY 0x40
-
-#define SECTOR_TYPE_MODE2 0x14
-#define READ_CD_USERDATA_MODE2 0x10
-
-#define READ_TOC 0x43
-#define READ_TOC_FORMAT_TOC 0x0
-
-#pragma pack(1)
-
-struct SRB_GetDiskInfo
-{
- unsigned char SRB_Cmd;
- unsigned char SRB_Status;
- unsigned char SRB_HaId;
- unsigned char SRB_Flags;
- unsigned long SRB_Hdr_Rsvd;
- unsigned char SRB_Target;
- unsigned char SRB_Lun;
- unsigned char SRB_DriveFlags;
- unsigned char SRB_Int13HDriveInfo;
- unsigned char SRB_Heads;
- unsigned char SRB_Sectors;
- unsigned char SRB_Rsvd1[22];
-};
-
-struct SRB_GDEVBlock
-{
- unsigned char SRB_Cmd;
- unsigned char SRB_Status;
- unsigned char SRB_HaId;
- unsigned char SRB_Flags;
- unsigned long SRB_Hdr_Rsvd;
- unsigned char SRB_Target;
- unsigned char SRB_Lun;
- unsigned char SRB_DeviceType;
- unsigned char SRB_Rsvd1;
-};
-
-struct SRB_ExecSCSICmd
-{
- unsigned char SRB_Cmd;
- unsigned char SRB_Status;
- unsigned char SRB_HaId;
- unsigned char SRB_Flags;
- unsigned long SRB_Hdr_Rsvd;
- unsigned char SRB_Target;
- unsigned char SRB_Lun;
- unsigned short SRB_Rsvd1;
- unsigned long SRB_BufLen;
- unsigned char *SRB_BufPointer;
- unsigned char SRB_SenseLen;
- unsigned char SRB_CDBLen;
- unsigned char SRB_HaStat;
- unsigned char SRB_TargStat;
- unsigned long *SRB_PostProc;
- unsigned char SRB_Rsvd2[20];
- unsigned char CDBByte[16];
- unsigned char SenseArea[SENSE_LEN+2];
-};
-
-/*****************************************************************************
- %%% SRB - HOST ADAPTER INQUIRY - SC_HA_INQUIRY (0) %%%
-*****************************************************************************/
-
-typedef struct // Offset
-{ // HX/DEC
- BYTE SRB_Cmd; // 00/000 ASPI command code = SC_HA_INQUIRY
- BYTE SRB_Status; // 01/001 ASPI command status byte
- BYTE SRB_HaId; // 02/002 ASPI host adapter number
- BYTE SRB_Flags; // 03/003 ASPI request flags
- DWORD SRB_Hdr_Rsvd; // 04/004 Reserved, MUST = 0
- BYTE HA_Count; // 08/008 Number of host adapters present
- BYTE HA_SCSI_ID; // 09/009 SCSI ID of host adapter
- BYTE HA_ManagerId[16]; // 0A/010 String describing the manager
- BYTE HA_Identifier[16]; // 1A/026 String describing the host adapter
- BYTE HA_Unique[16]; // 2A/042 Host Adapter Unique parameters
- WORD HA_Rsvd1; // 3A/058 Reserved, MUST = 0
-}
-SRB_HAInquiry;
-
-/*!
- Get disc type associated with cd object.
-*/
-discmode_t get_discmode_aspi (_img_private_t *p_env);
-
-/*!
- Return the the kind of drive capabilities of device.
-
- Note: string is malloc'd so caller should free() then returned
- string when done with it.
-
- */
-char * get_mcn_aspi (const _img_private_t *env);
-
-/*!
- Get the format (XA, DATA, AUDIO) of a track.
-*/
-track_format_t get_track_format_aspi(const _img_private_t *env,
- track_t i_track);
-
-/*!
- Initialize internal structures for CD device.
- */
-bool init_aspi (_img_private_t *env);
-
-/*
- Read cdtext information for a CdIo object .
-
- return true on success, false on error or CD-TEXT information does
- not exist.
-*/
-bool init_cdtext_aspi (_img_private_t *env);
-
-const char *is_cdrom_aspi(const char drive_letter);
-
-/*!
- Reads an audio device using the DeviceIoControl method into data
- starting from lsn. Returns 0 if no error.
- */
-int read_audio_sectors_aspi (_img_private_t *obj, void *data, lsn_t lsn,
- unsigned int nblocks);
-/*!
- Reads a single mode1 sector using the DeviceIoControl method into
- data starting from lsn. Returns 0 if no error.
- */
-int read_mode1_sector_aspi (const _img_private_t *env, void *data,
- lsn_t lsn, bool b_form2);
-/*!
- Reads a single mode2 sector from cd device into data starting
- from lsn. Returns 0 if no error.
- */
-int read_mode2_sector_aspi (const _img_private_t *env, void *data, lsn_t lsn,
- bool b_form2);
-
-/*!
- Read and cache the CD's Track Table of Contents and track info.
- Return true if successful or false if an error.
-*/
-bool read_toc_aspi (_img_private_t *env);
-
-/*!
- Run a SCSI MMC command.
-
- env private CD structure
- i_timeout time in milliseconds we will wait for the command
- to complete. If this value is -1, use the default
- time-out value.
- p_buf Buffer for data, both sending and receiving
- i_buf Size of buffer
- e_direction direction the transfer is to go.
- cdb CDB bytes. All values that are needed should be set on
- input. We'll figure out what the right CDB length should be.
-
- Return 0 if command completed successfully.
- */
-int run_scsi_cmd_aspi( const void *p_user_data,
- unsigned int i_timeout,
- unsigned int i_cdb,
- const scsi_mmc_cdb_t * p_cdb,
- scsi_mmc_direction_t e_direction,
- unsigned int i_buf, /*in/out*/ void *p_buf );
-
diff --git a/src/input/vcd/libcdio/MSWindows/win32.c b/src/input/vcd/libcdio/MSWindows/win32.c
deleted file mode 100644
index 1c9d9b93d..000000000
--- a/src/input/vcd/libcdio/MSWindows/win32.c
+++ /dev/null
@@ -1,805 +0,0 @@
-/*
- $Id: win32.c,v 1.3 2006/09/26 22:10:24 dgp85 Exp $
-
- Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* This file contains Win32-specific code and implements low-level
- control of the CD drive. Inspired by vlc's cdrom.h code
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-static const char _rcsid[] = "$Id: win32.c,v 1.3 2006/09/26 22:10:24 dgp85 Exp $";
-
-#include <cdio/cdio.h>
-#include <cdio/sector.h>
-#include <cdio/util.h>
-#include <cdio/scsi_mmc.h>
-#include "cdio_assert.h"
-#include "cdio_private.h" /* protoype for cdio_is_device_win32 */
-
-#include <string.h>
-
-#ifdef HAVE_WIN32_CDROM
-
-#include <ctype.h>
-#include <stdio.h>
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-
-#include <windows.h>
-#include <winioctl.h>
-#include "win32.h"
-
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-
-#if defined (MSVC) || defined (_XBOX)
-#undef IN
-#else
-#include "aspi32.h"
-#endif
-
-#ifdef _XBOX
-#include "stdint.h"
-#include <xtl.h>
-#define WIN_NT 1
-#else
-#define WIN_NT ( GetVersion() < 0x80000000 )
-#endif
-
-/* General ioctl() CD-ROM command function */
-static bool
-_cdio_mciSendCommand(int id, UINT msg, DWORD flags, void *arg)
-{
-#ifdef _XBOX
- return false;
-#else
- MCIERROR mci_error;
-
- mci_error = mciSendCommand(id, msg, flags, (DWORD)arg);
- if ( mci_error ) {
- char error[256];
-
- mciGetErrorString(mci_error, error, 256);
- cdio_warn("mciSendCommand() error: %s", error);
- }
- return(mci_error == 0);
-#endif
-}
-
-static access_mode_t
-str_to_access_mode_win32(const char *psz_access_mode)
-{
- const access_mode_t default_access_mode =
- WIN_NT ? _AM_IOCTL : _AM_ASPI;
-
- if (NULL==psz_access_mode) return default_access_mode;
-
- if (!strcmp(psz_access_mode, "ioctl"))
- return _AM_IOCTL;
- else if (!strcmp(psz_access_mode, "ASPI")) {
-#ifdef _XBOX
- return _AM_ASPI;
-#else
- cdio_warn ("XBOX doesn't support access type: %s. Default used instead.",
- psz_access_mode);
- return default_access_mode;
-#endif
- } else {
- cdio_warn ("unknown access type: %s. Default used instead.",
- psz_access_mode);
- return default_access_mode;
- }
-}
-
-static discmode_t
-get_discmode_win32(void *p_user_data)
-{
- _img_private_t *p_env = p_user_data;
-
- if (p_env->hASPI) {
- return get_discmode_aspi (p_env);
- } else {
- return get_discmode_win32ioctl (p_env);
- }
-}
-
-static const char *
-is_cdrom_win32(const char drive_letter) {
- if ( WIN_NT ) {
- return is_cdrom_win32ioctl (drive_letter);
- } else {
- return is_cdrom_aspi(drive_letter);
- }
-}
-
-/*!
- Run a SCSI MMC command.
-
- env private CD structure
- i_timeout_ms time in milliseconds we will wait for the command
- to complete. If this value is -1, use the default
- time-out value.
- p_buf Buffer for data, both sending and receiving
- i_buf Size of buffer
- e_direction direction the transfer is to go.
- cdb CDB bytes. All values that are needed should be set on
- input. We'll figure out what the right CDB length should be.
-
- Return 0 if command completed successfully.
- */
-static int
-run_scsi_cmd_win32( const void *p_user_data, unsigned int i_timeout_ms,
- unsigned int i_cdb, const scsi_mmc_cdb_t *p_cdb,
- scsi_mmc_direction_t e_direction,
- unsigned int i_buf, /*in/out*/ void *p_buf )
-{
- const _img_private_t *p_env = p_user_data;
-
- if (p_env->hASPI) {
- return run_scsi_cmd_aspi( p_env, i_timeout_ms, i_cdb, p_cdb,
- e_direction, i_buf, p_buf );
- } else {
- return run_scsi_cmd_win32ioctl( p_env, i_timeout_ms, i_cdb, p_cdb,
- e_direction, i_buf, p_buf );
- }
-}
-
-/*!
- Initialize CD device.
- */
-static bool
-_cdio_init_win32 (void *user_data)
-{
- _img_private_t *p_env = user_data;
- if (p_env->gen.init) {
- cdio_error ("init called more than once");
- return false;
- }
-
- p_env->gen.init = true;
- p_env->gen.toc_init = false;
- p_env->gen.b_cdtext_init = false;
- p_env->gen.b_cdtext_error = false;
-
- /* Initializations */
- p_env->h_device_handle = NULL;
- p_env->i_sid = 0;
- p_env->hASPI = 0;
- p_env->lpSendCommand = 0;
- p_env->b_aspi_init = false;
- p_env->b_ioctl_init = false;
-
- if ( _AM_IOCTL == p_env->access_mode ) {
- return init_win32ioctl(p_env);
- } else {
- return init_aspi(p_env);
- }
-}
-
-/*!
- Release and free resources associated with cd.
- */
-static void
-_free_win32 (void *user_data)
-{
- _img_private_t *p_env = user_data;
-
- if (NULL == p_env) return;
- free (p_env->gen.source_name);
-
- if( p_env->h_device_handle )
- CloseHandle( p_env->h_device_handle );
- if( p_env->hASPI )
- FreeLibrary( (HMODULE)p_env->hASPI );
-
- free (p_env);
-}
-
-/*!
- Reads an audio device into data starting from lsn.
- Returns 0 if no error.
- */
-static int
-_cdio_read_audio_sectors (void *user_data, void *data, lsn_t lsn,
- unsigned int nblocks)
-{
- _img_private_t *p_env = user_data;
- if ( p_env->hASPI ) {
- return read_audio_sectors_aspi( p_env, data, lsn, nblocks );
- } else {
- return read_audio_sectors_win32ioctl( p_env, data, lsn, nblocks );
- }
-}
-
-/*!
- Reads a single mode1 sector from cd device into data starting
- from lsn. Returns 0 if no error.
- */
-static int
-_cdio_read_mode1_sector (void *user_data, void *data, lsn_t lsn,
- bool b_form2)
-{
- _img_private_t *p_env = user_data;
-
- if (p_env->gen.ioctls_debugged == 75)
- cdio_debug ("only displaying every 75th ioctl from now on");
-
- if (p_env->gen.ioctls_debugged == 30 * 75)
- cdio_debug ("only displaying every 30*75th ioctl from now on");
-
- if (p_env->gen.ioctls_debugged < 75
- || (p_env->gen.ioctls_debugged < (30 * 75)
- && p_env->gen.ioctls_debugged % 75 == 0)
- || p_env->gen.ioctls_debugged % (30 * 75) == 0)
- cdio_debug ("reading %lu", (unsigned long int) lsn);
-
- p_env->gen.ioctls_debugged++;
-
- if ( p_env->hASPI ) {
- return read_mode1_sector_aspi( p_env, data, lsn, b_form2 );
- } else {
- return read_mode1_sector_win32ioctl( p_env, data, lsn, b_form2 );
- }
-}
-
-/*!
- Reads nblocks of mode1 sectors from cd device into data starting
- from lsn.
- Returns 0 if no error.
- */
-static int
-_cdio_read_mode1_sectors (void *user_data, void *data, lsn_t lsn,
- bool b_form2, unsigned int nblocks)
-{
- _img_private_t *p_env = user_data;
- int i;
- int retval;
-
- for (i = 0; i < nblocks; i++) {
- if (b_form2) {
- if ( (retval = _cdio_read_mode1_sector (p_env,
- ((char *)data) + (M2RAW_SECTOR_SIZE * i),
- lsn + i, true)) )
- return retval;
- } else {
- char buf[M2RAW_SECTOR_SIZE] = { 0, };
- if ( (retval = _cdio_read_mode1_sector (p_env, buf, lsn + i, false)) )
- return retval;
-
- memcpy (((char *)data) + (CDIO_CD_FRAMESIZE * i),
- buf, CDIO_CD_FRAMESIZE);
- }
- }
- return 0;
-}
-
-/*!
- Reads a single mode2 sector from cd device into data starting
- from lsn. Returns 0 if no error.
- */
-static int
-_cdio_read_mode2_sector (void *user_data, void *data, lsn_t lsn,
- bool b_form2)
-{
- char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, };
- _img_private_t *p_env = user_data;
-
- if (p_env->gen.ioctls_debugged == 75)
- cdio_debug ("only displaying every 75th ioctl from now on");
-
- if (p_env->gen.ioctls_debugged == 30 * 75)
- cdio_debug ("only displaying every 30*75th ioctl from now on");
-
- if (p_env->gen.ioctls_debugged < 75
- || (p_env->gen.ioctls_debugged < (30 * 75)
- && p_env->gen.ioctls_debugged % 75 == 0)
- || p_env->gen.ioctls_debugged % (30 * 75) == 0)
- cdio_debug ("reading %lu", (unsigned long int) lsn);
-
- p_env->gen.ioctls_debugged++;
-
- if ( p_env->hASPI ) {
- int ret;
- ret = read_mode2_sector_aspi(user_data, buf, lsn, 1);
- if( ret != 0 ) return ret;
- if (b_form2)
- memcpy (data, buf, M2RAW_SECTOR_SIZE);
- else
- memcpy (((char *)data), buf + CDIO_CD_SUBHEADER_SIZE, CDIO_CD_FRAMESIZE);
- return 0;
- } else {
- return read_mode2_sector_win32ioctl( p_env, data, lsn, b_form2 );
- }
-}
-
-/*!
- Reads nblocks of mode2 sectors from cd device into data starting
- from lsn.
- Returns 0 if no error.
- */
-static int
-_cdio_read_mode2_sectors (void *user_data, void *data, lsn_t lsn,
- bool b_form2, unsigned int nblocks)
-{
- int i;
- int retval;
- unsigned int blocksize = b_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE;
-
- for (i = 0; i < nblocks; i++) {
- if ( (retval = _cdio_read_mode2_sector (user_data,
- ((char *)data) + (blocksize * i),
- lsn + i, b_form2)) )
- return retval;
- }
- return 0;
-}
-
-/*!
- Return the size of the CD in logical block address (LBA) units.
- */
-static uint32_t
-stat_size_win32 (void *user_data)
-{
- _img_private_t *p_env = user_data;
-
- return p_env->tocent[p_env->gen.i_tracks].start_lsn;
-}
-
-/*!
- Set the key "arg" to "value" in source device.
-*/
-static int
-set_arg_win32 (void *user_data, const char key[], const char value[])
-{
- _img_private_t *p_env = user_data;
-
- if (!strcmp (key, "source"))
- {
- if (!value)
- return -2;
-
- free (p_env->gen.source_name);
-
- p_env->gen.source_name = strdup (value);
- }
- else if (!strcmp (key, "access-mode"))
- {
- p_env->access_mode = str_to_access_mode_win32(value);
- if (p_env->access_mode == _AM_ASPI && !p_env->b_aspi_init)
- return init_aspi(p_env) ? 1 : -3;
- else if (p_env->access_mode == _AM_IOCTL && !p_env->b_ioctl_init)
- return init_win32ioctl(p_env) ? 1 : -3;
- else
- return -4;
- return 0;
- }
- else
- return -1;
-
- return 0;
-}
-
-/*!
- Read and cache the CD's Track Table of Contents and track info.
- Return true if successful or false if an error.
-*/
-static bool
-read_toc_win32 (void *p_user_data)
-{
- _img_private_t *p_env = p_user_data;
- bool ret;
- if( p_env->hASPI ) {
- ret = read_toc_aspi( p_env );
- } else {
- ret = read_toc_win32ioctl( p_env );
- }
- if (ret) p_env->gen.toc_init = true ;
- return true;
-}
-
-/*!
- Eject media. Return 1 if successful, 0 otherwise.
- */
-static int
-_cdio_eject_media (void *user_data) {
-#ifdef _XBOX
- return -1;
-#else
- _img_private_t *env = user_data;
-
-
- MCI_OPEN_PARMS op;
- MCI_STATUS_PARMS st;
- DWORD i_flags;
- char psz_drive[4];
- int ret;
-
- memset( &op, 0, sizeof(MCI_OPEN_PARMS) );
- op.lpstrDeviceType = (LPCSTR)MCI_DEVTYPE_CD_AUDIO;
- strcpy( psz_drive, "X:" );
- psz_drive[0] = env->gen.source_name[0];
- op.lpstrElementName = psz_drive;
-
- /* Set the flags for the device type */
- i_flags = MCI_OPEN_TYPE | MCI_OPEN_TYPE_ID |
- MCI_OPEN_ELEMENT | MCI_OPEN_SHAREABLE;
-
- if( _cdio_mciSendCommand( 0, MCI_OPEN, i_flags, &op ) ) {
- st.dwItem = MCI_STATUS_READY;
- /* Eject disc */
- ret = _cdio_mciSendCommand( op.wDeviceID, MCI_SET, MCI_SET_DOOR_OPEN, 0 ) != 0;
- /* Release access to the device */
- _cdio_mciSendCommand( op.wDeviceID, MCI_CLOSE, MCI_WAIT, 0 );
- } else
- ret = 0;
-
- return ret;
-#endif
-}
-
-/*!
- Return the value associated with the key "arg".
-*/
-static const char *
-_get_arg_win32 (void *user_data, const char key[])
-{
- _img_private_t *env = user_data;
-
- if (!strcmp (key, "source")) {
- return env->gen.source_name;
- } else if (!strcmp (key, "access-mode")) {
- if (env->hASPI)
- return "ASPI";
- else
- return "ioctl";
- }
- return NULL;
-}
-
-/*!
- Return the media catalog number MCN.
-
- Note: string is malloc'd so caller should free() then returned
- string when done with it.
-
- */
-static char *
-_cdio_get_mcn (const void *p_user_data) {
- const _img_private_t *p_env = p_user_data;
-
- if( p_env->hASPI ) {
- return scsi_mmc_get_mcn( p_env->gen.cdio );
- } else {
- return get_mcn_win32ioctl(p_env);
- }
-}
-
-/*!
- Get format of track.
-*/
-static track_format_t
-_cdio_get_track_format(void *p_obj, track_t i_track)
-{
- _img_private_t *p_env = p_obj;
-
- if ( !p_env ) return TRACK_FORMAT_ERROR;
-
- if (!p_env->gen.toc_init) read_toc_win32 (p_env) ;
-
- if ( i_track < p_env->gen.i_first_track
- || i_track >= p_env->gen.i_tracks + p_env->gen.i_first_track )
- return TRACK_FORMAT_ERROR;
-
- if( p_env->hASPI ) {
- return get_track_format_aspi(p_env, i_track);
- } else {
- return get_track_format_win32ioctl(p_env, i_track);
- }
-}
-
-/*!
- Return true if we have XA data (green, mode2 form1) or
- XA data (green, mode2 form2). That is track begins:
- sync - header - subheader
- 12 4 - 8
-
- FIXME: there's gotta be a better design for this and get_track_format?
-*/
-static bool
-_cdio_get_track_green(void *obj, track_t i_track)
-{
- _img_private_t *p_env = obj;
-
- switch (_cdio_get_track_format(p_env, i_track)) {
- case TRACK_FORMAT_XA:
- return true;
- case TRACK_FORMAT_ERROR:
- case TRACK_FORMAT_CDI:
- case TRACK_FORMAT_AUDIO:
- return false;
- case TRACK_FORMAT_DATA:
- if (_AM_ASPI == p_env->access_mode )
- return ((p_env->tocent[i_track-p_env->gen.i_first_track].Control & 8) != 0);
- default:
- break;
- }
-
- /* FIXME: Dunno if this is the right way, but it's what
- I was using in cd-info for a while.
- */
- return ((p_env->tocent[i_track-p_env->gen.i_first_track].Control & 2) != 0);
-}
-
-/*!
- Return the starting MSF (minutes/secs/frames) for track number
- i_tracks in obj. Track numbers start at 1.
- The "leadout" track is specified either by
- using i_tracks LEADOUT_TRACK or the total tracks+1.
- False is returned if there is no track entry.
-*/
-static bool
-_cdio_get_track_msf(void *p_user_data, track_t i_tracks, msf_t *msf)
-{
- _img_private_t *p_env = p_user_data;
-
- if (NULL == msf) return false;
-
- if (!p_env->gen.toc_init) read_toc_win32 (p_env) ;
-
- if (i_tracks == CDIO_CDROM_LEADOUT_TRACK) i_tracks = p_env->gen.i_tracks+1;
-
- if (i_tracks > p_env->gen.i_tracks+1 || i_tracks == 0) {
- return false;
- } else {
- cdio_lsn_to_msf(p_env->tocent[i_tracks-1].start_lsn, msf);
- return true;
- }
-}
-
-#endif /* HAVE_WIN32_CDROM */
-
-/*!
- Return an array of strings giving possible CD devices.
- */
-char **
-cdio_get_devices_win32 (void)
-{
-#ifndef HAVE_WIN32_CDROM
- return NULL;
-#else
- char **drives = NULL;
- unsigned int num_drives=0;
- char drive_letter;
-
- /* Scan the system for CD-ROM drives.
- */
-
-#if FINISHED
- /* Now check the currently mounted CD drives */
- if (NULL != (ret_drive = cdio_check_mounts("/etc/mtab"))) {
- cdio_add_device_list(&drives, drive, &num_drives);
- }
-
- /* Finally check possible mountable drives in /etc/fstab */
- if (NULL != (ret_drive = cdio_check_mounts("/etc/fstab"))) {
- cdio_add_device_list(&drives, drive, &num_drives);
- }
-#endif
-
- /* Scan the system for CD-ROM drives.
- Not always 100% reliable, so use the USE_MNTENT code above first.
- */
- for (drive_letter='A'; drive_letter <= 'Z'; drive_letter++) {
- const char *drive_str=is_cdrom_win32(drive_letter);
- if (drive_str != NULL) {
- cdio_add_device_list(&drives, drive_str, &num_drives);
- }
- }
- cdio_add_device_list(&drives, NULL, &num_drives);
- return drives;
-#endif /*HAVE_WIN32_CDROM*/
-}
-
-/*!
- Return a string containing the default CD device if none is specified.
- if CdIo is NULL (we haven't initialized a specific device driver),
- then find a suitable one and return the default device for that.
-
- NULL is returned if we couldn't get a default device.
-*/
-char *
-cdio_get_default_device_win32(void)
-{
-
-#ifdef HAVE_WIN32_CDROM
- char drive_letter;
-
- for (drive_letter='A'; drive_letter <= 'Z'; drive_letter++) {
- const char *drive_str=is_cdrom_win32(drive_letter);
- if (drive_str != NULL) {
- return strdup(drive_str);
- }
- }
-#endif
- return NULL;
-}
-
-/*!
- Return true if source_name could be a device containing a CD-ROM.
-*/
-bool
-cdio_is_device_win32(const char *source_name)
-{
- unsigned int len;
-
- if (NULL == source_name) return false;
- len = strlen(source_name);
-
-#ifdef HAVE_WIN32_CDROM
- if ((len == 2) && isalpha(source_name[0])
- && (source_name[len-1] == ':'))
- return true;
-
- if ( ! WIN_NT ) return false;
-
- /* Test to see if of form: \\.\x: */
- return ( (len == 6)
- && source_name[0] == '\\' && source_name[1] == '\\'
- && source_name[2] == '.' && source_name[3] == '\\'
- && isalpha(source_name[len-2])
- && (source_name[len-1] == ':') );
-#else
- return false;
-#endif
-}
-
-/*!
- Initialization routine. This is the only thing that doesn't
- get called via a function pointer. In fact *we* are the
- ones to set that up.
- */
-CdIo *
-cdio_open_win32 (const char *psz_source_name)
-{
-#ifdef HAVE_WIN32_CDROM
- if ( WIN_NT ) {
- return cdio_open_am_win32(psz_source_name, "ioctl");
- } else {
- return cdio_open_am_win32(psz_source_name, "ASPI");
- }
-#else
- return NULL;
-#endif /* HAVE_WIN32_CDROM */
-}
-
-/*!
- Initialization routine. This is the only thing that doesn't
- get called via a function pointer. In fact *we* are the
- ones to set that up.
- */
-CdIo *
-cdio_open_am_win32 (const char *psz_orig_source, const char *psz_access_mode)
-{
-
-#ifdef HAVE_WIN32_CDROM
- CdIo *ret;
- _img_private_t *_data;
- char *psz_source;
-
- cdio_funcs _funcs;
-
- memset( &_funcs, 0, sizeof(_funcs) );
-
- _funcs.eject_media = _cdio_eject_media;
- _funcs.free = _free_win32;
- _funcs.get_arg = _get_arg_win32;
- _funcs.get_cdtext = get_cdtext_generic;
- _funcs.get_default_device = cdio_get_default_device_win32;
- _funcs.get_devices = cdio_get_devices_win32;
- _funcs.get_discmode = get_discmode_win32;
- _funcs.get_drive_cap = scsi_mmc_get_drive_cap_generic;
- _funcs.get_first_track_num= get_first_track_num_generic;
- _funcs.get_hwinfo = NULL;
- _funcs.get_mcn = _cdio_get_mcn;
- _funcs.get_num_tracks = get_num_tracks_generic;
- _funcs.get_track_format = _cdio_get_track_format;
- _funcs.get_track_green = _cdio_get_track_green;
- _funcs.get_track_lba = NULL; /* This could be implemented if need be. */
- _funcs.get_track_msf = _cdio_get_track_msf;
- _funcs.lseek = NULL;
- _funcs.read = NULL;
- _funcs.read_audio_sectors = _cdio_read_audio_sectors;
- _funcs.read_mode1_sector = _cdio_read_mode1_sector;
- _funcs.read_mode1_sectors = _cdio_read_mode1_sectors;
- _funcs.read_mode2_sector = _cdio_read_mode2_sector;
- _funcs.read_mode2_sectors = _cdio_read_mode2_sectors;
- _funcs.read_toc = &read_toc_win32;
- _funcs.run_scsi_mmc_cmd = &run_scsi_cmd_win32;
- _funcs.set_arg = set_arg_win32;
- _funcs.stat_size = stat_size_win32;
-
- _data = _cdio_malloc (sizeof (_img_private_t));
- _data->access_mode = str_to_access_mode_win32(psz_access_mode);
- _data->gen.init = false;
- _data->gen.fd = -1;
-
- if (NULL == psz_orig_source) {
- psz_source=cdio_get_default_device_win32();
- if (NULL == psz_source) return NULL;
- set_arg_win32(_data, "source", psz_source);
- free(psz_source);
- } else {
- if (cdio_is_device_win32(psz_orig_source))
- set_arg_win32(_data, "source", psz_orig_source);
- else {
- /* The below would be okay if all device drivers worked this way. */
-#if 0
- cdio_info ("source %s is a not a device", psz_orig_source);
-#endif
- return NULL;
- }
- }
-
- ret = cdio_new ((void *)_data, &_funcs);
- if (ret == NULL) return NULL;
-
- if (_cdio_init_win32(_data))
- return ret;
- else {
- _free_win32 (_data);
- return NULL;
- }
-
-#else
- return NULL;
-#endif /* HAVE_WIN32_CDROM */
-
-}
-
-bool
-cdio_have_win32 (void)
-{
-#ifdef HAVE_WIN32_CDROM
- return true;
-#else
- return false;
-#endif /* HAVE_WIN32_CDROM */
-}
diff --git a/src/input/vcd/libcdio/MSWindows/win32.h b/src/input/vcd/libcdio/MSWindows/win32.h
deleted file mode 100644
index 84f3b67b3..000000000
--- a/src/input/vcd/libcdio/MSWindows/win32.h
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- $Id: win32.h,v 1.2 2005/01/01 02:43:58 rockyb Exp $
-
- Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#include "cdio_private.h"
-
-#pragma pack()
-
-typedef struct {
- lsn_t start_lsn;
- UCHAR Control : 4;
- UCHAR Format;
- cdtext_t cdtext; /* CD-TEXT */
-} track_info_t;
-
-typedef enum {
- _AM_NONE,
- _AM_IOCTL,
- _AM_ASPI,
-} access_mode_t;
-
-typedef struct {
- /* Things common to all drivers like this.
- This must be first. */
- generic_img_private_t gen;
-
- access_mode_t access_mode;
-
- /* Some of the more OS specific things. */
- /* Entry info for each track, add 1 for leadout. */
- track_info_t tocent[CDIO_CD_MAX_TRACKS+1];
-
- HANDLE h_device_handle; /* device descriptor */
- long hASPI;
- short i_sid;
- short i_lun;
- long (*lpSendCommand)( void* );
-
- bool b_ioctl_init;
- bool b_aspi_init;
-
-} _img_private_t;
-
-/*!
- Get disc type associated with cd object.
-*/
-discmode_t get_discmode_win32ioctl (_img_private_t *p_env);
-
-/*!
- Reads an audio device using the DeviceIoControl method into data
- starting from lsn. Returns 0 if no error.
-*/
-int read_audio_sectors_win32ioctl (_img_private_t *obj, void *data, lsn_t lsn,
- unsigned int nblocks);
-/*!
- Reads a single mode2 sector using the DeviceIoControl method into
- data starting from lsn. Returns 0 if no error.
- */
-int read_mode2_sector_win32ioctl (const _img_private_t *env, void *data,
- lsn_t lsn, bool b_form2);
-
-/*!
- Reads a single mode1 sector using the DeviceIoControl method into
- data starting from lsn. Returns 0 if no error.
- */
-int read_mode1_sector_win32ioctl (const _img_private_t *env, void *data,
- lsn_t lsn, bool b_form2);
-
-const char *is_cdrom_win32ioctl (const char drive_letter);
-
-/*!
- Run a SCSI MMC command.
-
- env private CD structure
- i_timeout_ms time in milliseconds we will wait for the command
- to complete. If this value is -1, use the default
- time-out value.
- p_buf Buffer for data, both sending and receiving
- i_buf Size of buffer
- e_direction direction the transfer is to go.
- cdb CDB bytes. All values that are needed should be set on
- input. We'll figure out what the right CDB length should be.
-
- Return 0 if command completed successfully.
- */
-int run_scsi_cmd_win32ioctl( const void *p_user_data,
- unsigned int i_timeout,
- unsigned int i_cdb,
- const scsi_mmc_cdb_t * p_cdb,
- scsi_mmc_direction_t e_direction,
- unsigned int i_buf, /*in/out*/ void *p_buf );
-
-/*!
- Initialize internal structures for CD device.
- */
-bool init_win32ioctl (_img_private_t *env);
-
-/*!
- Read and cache the CD's Track Table of Contents and track info.
- Return true if successful or false if an error.
-*/
-bool read_toc_win32ioctl (_img_private_t *env);
-
-/*!
- Return the media catalog number MCN.
-
- Note: string is malloc'd so caller should free() then returned
- string when done with it.
-
- */
-char *get_mcn_win32ioctl (const _img_private_t *env);
-
-/*
- Read cdtext information for a CdIo object .
-
- return true on success, false on error or CD-TEXT information does
- not exist.
-*/
-bool init_cdtext_win32ioctl (_img_private_t *env);
-
-/*!
- Return the the kind of drive capabilities of device.
-
- Note: string is malloc'd so caller should free() then returned
- string when done with it.
-
- */
-void get_drive_cap_aspi (const _img_private_t *env,
- cdio_drive_read_cap_t *p_read_cap,
- cdio_drive_write_cap_t *p_write_cap,
- cdio_drive_misc_cap_t *p_misc_cap);
-
-/*!
- Return the the kind of drive capabilities of device.
-
- Note: string is malloc'd so caller should free() then returned
- string when done with it.
-
- */
-void get_drive_cap_win32ioctl (const _img_private_t *env,
- cdio_drive_read_cap_t *p_read_cap,
- cdio_drive_write_cap_t *p_write_cap,
- cdio_drive_misc_cap_t *p_misc_cap);
-
-/*!
- Get the format (XA, DATA, AUDIO) of a track.
-*/
-track_format_t get_track_format_win32ioctl(const _img_private_t *env,
- track_t i_track);
-
-void set_cdtext_field_win32(void *user_data, track_t i_track,
- track_t i_first_track,
- cdtext_field_t e_field, const char *psz_value);
-
diff --git a/src/input/vcd/libcdio/MSWindows/win32_ioctl.c b/src/input/vcd/libcdio/MSWindows/win32_ioctl.c
deleted file mode 100644
index dec24e785..000000000
--- a/src/input/vcd/libcdio/MSWindows/win32_ioctl.c
+++ /dev/null
@@ -1,739 +0,0 @@
-/*
- $Id: win32_ioctl.c,v 1.1 2005/01/01 02:43:58 rockyb Exp $
-
- Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* This file contains Win32-specific code using the DeviceIoControl
- access method.
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-static const char _rcsid[] = "$Id: win32_ioctl.c,v 1.1 2005/01/01 02:43:58 rockyb Exp $";
-
-#ifdef HAVE_WIN32_CDROM
-
-#if defined (_XBOX)
-#include "inttypes.h"
-#include "NtScsi.h"
-#include "undocumented.h"
-#define FORMAT_ERROR(i_err, psz_msg) \
- psz_msg=(char *)LocalAlloc(LMEM_ZEROINIT, 255); \
- sprintf(psz_msg, "error file %s: line %d (%s) %d\n",
- _FILE__, __LINE__, __PRETTY_FUNCTION__, i_err)
-#else
-#include <ddk/ntddstor.h>
-#include <ddk/ntddscsi.h>
-#include <ddk/scsi.h>
-#define FORMAT_ERROR(i_err, psz_msg) \
- FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, \
- NULL, i_err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), \
- (LPSTR) psz_msg, 0, NULL)
-#endif
-
-#ifdef WIN32
-#include <windows.h>
-#endif
-
-#include <stdio.h>
-#include <stddef.h> /* offsetof() macro */
-#include <sys/stat.h>
-#include <errno.h>
-#include <sys/types.h>
-
-#include <cdio/cdio.h>
-#include <cdio/sector.h>
-#include "cdio_assert.h"
-#include <cdio/scsi_mmc.h>
-#include "cdtext_private.h"
-#include "cdio/logging.h"
-
-/* Win32 DeviceIoControl specifics */
-/***** FIXME: #include ntddcdrm.h from Wine, but probably need to
- modify it a little.
-*/
-
-#ifndef IOCTL_CDROM_BASE
-# define IOCTL_CDROM_BASE FILE_DEVICE_CD_ROM
-#endif
-#ifndef IOCTL_CDROM_READ_TOC
-#define IOCTL_CDROM_READ_TOC \
- CTL_CODE(IOCTL_CDROM_BASE, 0x0000, METHOD_BUFFERED, FILE_READ_ACCESS)
-#endif
-#ifndef IOCTL_CDROM_RAW_READ
-#define IOCTL_CDROM_RAW_READ CTL_CODE(IOCTL_CDROM_BASE, 0x000F, \
- METHOD_OUT_DIRECT, FILE_READ_ACCESS)
-#endif
-
-#ifndef IOCTL_CDROM_READ_Q_CHANNEL
-#define IOCTL_CDROM_READ_Q_CHANNEL \
- CTL_CODE(IOCTL_CDROM_BASE, 0x000B, METHOD_BUFFERED, FILE_READ_ACCESS)
-#endif
-
-typedef struct {
- SCSI_PASS_THROUGH Spt;
- ULONG Filler;
- UCHAR SenseBuf[32];
- UCHAR DataBuf[512];
-} SCSI_PASS_THROUGH_WITH_BUFFERS;
-
-typedef struct _TRACK_DATA {
- UCHAR Format;
- UCHAR Control : 4;
- UCHAR Adr : 4;
- UCHAR TrackNumber;
- UCHAR Reserved1;
- UCHAR Address[4];
-} TRACK_DATA, *PTRACK_DATA;
-
-typedef struct _CDROM_TOC {
- UCHAR Length[2];
- UCHAR FirstTrack;
- UCHAR LastTrack;
- TRACK_DATA TrackData[CDIO_CD_MAX_TRACKS+1];
-} CDROM_TOC, *PCDROM_TOC;
-
-typedef struct _TRACK_DATA_FULL {
- UCHAR SessionNumber;
- UCHAR Control : 4;
- UCHAR Adr : 4;
- UCHAR TNO;
- UCHAR POINT; /* Tracknumber (of session?) or lead-out/in (0xA0, 0xA1, 0xA2) */
- UCHAR Min; /* Only valid if disctype is CDDA ? */
- UCHAR Sec; /* Only valid if disctype is CDDA ? */
- UCHAR Frame; /* Only valid if disctype is CDDA ? */
- UCHAR Zero; /* Always zero */
- UCHAR PMIN; /* start min, if POINT is a track; if lead-out/in 0xA0: First Track */
- UCHAR PSEC;
- UCHAR PFRAME;
-} TRACK_DATA_FULL, *PTRACK_DATA_FULL;
-
-typedef struct _CDROM_TOC_FULL {
- UCHAR Length[2];
- UCHAR FirstSession;
- UCHAR LastSession;
- TRACK_DATA_FULL TrackData[CDIO_CD_MAX_TRACKS+3];
-} CDROM_TOC_FULL, *PCDROM_TOC_FULL;
-
-typedef enum _TRACK_MODE_TYPE {
- YellowMode2,
- XAForm2,
- CDDA
-} TRACK_MODE_TYPE, *PTRACK_MODE_TYPE;
-
-typedef struct __RAW_READ_INFO {
- LARGE_INTEGER DiskOffset;
- ULONG SectorCount;
- TRACK_MODE_TYPE TrackMode;
-} RAW_READ_INFO, *PRAW_READ_INFO;
-
-typedef struct _CDROM_SUB_Q_DATA_FORMAT {
- UCHAR Format;
- UCHAR Track;
-} CDROM_SUB_Q_DATA_FORMAT, *PCDROM_SUB_Q_DATA_FORMAT;
-
-typedef struct _SUB_Q_HEADER {
- UCHAR Reserved;
- UCHAR AudioStatus;
- UCHAR DataLength[2];
-} SUB_Q_HEADER, *PSUB_Q_HEADER;
-
-typedef struct _SUB_Q_MEDIA_CATALOG_NUMBER {
- SUB_Q_HEADER Header;
- UCHAR FormatCode;
- UCHAR Reserved[3];
- UCHAR Reserved1 : 7;
- UCHAR Mcval :1;
- UCHAR MediaCatalog[15];
-} SUB_Q_MEDIA_CATALOG_NUMBER, *PSUB_Q_MEDIA_CATALOG_NUMBER;
-
-#include "win32.h"
-
-#define OP_TIMEOUT_MS 60
-
-/*!
- Run a SCSI MMC command.
-
- env private CD structure
- i_timeout time in milliseconds we will wait for the command
- to complete. If this value is -1, use the default
- time-out value.
- p_buf Buffer for data, both sending and receiving
- i_buf Size of buffer
- e_direction direction the transfer is to go.
- cdb CDB bytes. All values that are needed should be set on
- input. We'll figure out what the right CDB length should be.
-
- Return 0 if command completed successfully.
- */
-int
-run_scsi_cmd_win32ioctl( const void *p_user_data,
- unsigned int i_timeout_ms,
- unsigned int i_cdb, const scsi_mmc_cdb_t * p_cdb,
- scsi_mmc_direction_t e_direction,
- unsigned int i_buf, /*in/out*/ void *p_buf )
-{
- const _img_private_t *p_env = p_user_data;
- SCSI_PASS_THROUGH_DIRECT sptd;
- bool success;
- DWORD dwBytesReturned;
-
- sptd.Length = sizeof(sptd);
- sptd.PathId = 0; /* SCSI card ID will be filled in automatically */
- sptd.TargetId= 0; /* SCSI target ID will also be filled in */
- sptd.Lun=0; /* SCSI lun ID will also be filled in */
- sptd.CdbLength = i_cdb;
- sptd.SenseInfoLength = 0; /* Don't return any sense data */
- sptd.DataIn = SCSI_MMC_DATA_READ == e_direction ?
- SCSI_IOCTL_DATA_IN : SCSI_IOCTL_DATA_OUT;
- sptd.DataTransferLength= i_buf;
- sptd.TimeOutValue = msecs2secs(i_timeout_ms);
- sptd.DataBuffer = (void *) p_buf;
- sptd.SenseInfoOffset = 0;
-
- memcpy(sptd.Cdb, p_cdb, i_cdb);
-
- /* Send the command to drive */
- success=DeviceIoControl(p_env->h_device_handle,
- IOCTL_SCSI_PASS_THROUGH_DIRECT,
- (void *)&sptd,
- (DWORD)sizeof(SCSI_PASS_THROUGH_DIRECT),
- NULL, 0,
- &dwBytesReturned,
- NULL);
-
- if(! success) {
- char *psz_msg = NULL;
- long int i_err = GetLastError();
- FORMAT_ERROR(i_err, psz_msg);
- cdio_info("Error: %s", psz_msg);
- LocalFree(psz_msg);
- return 1;
- }
- return 0;
-}
-
-/*!
- Get disc type associated with cd object.
-*/
-discmode_t
-get_discmode_win32ioctl (_img_private_t *p_env)
-{
- track_t i_track;
- discmode_t discmode=CDIO_DISC_MODE_NO_INFO;
-
- /* See if this is a DVD. */
- cdio_dvd_struct_t dvd; /* DVD READ STRUCT for layer 0. */
-
- dvd.physical.type = CDIO_DVD_STRUCT_PHYSICAL;
- dvd.physical.layer_num = 0;
- if (0 == scsi_mmc_get_dvd_struct_physical_private (p_env,
- &run_scsi_cmd_win32ioctl,
- &dvd)) {
- switch(dvd.physical.layer[0].book_type) {
- case CDIO_DVD_BOOK_DVD_ROM: return CDIO_DISC_MODE_DVD_ROM;
- case CDIO_DVD_BOOK_DVD_RAM: return CDIO_DISC_MODE_DVD_RAM;
- case CDIO_DVD_BOOK_DVD_R: return CDIO_DISC_MODE_DVD_R;
- case CDIO_DVD_BOOK_DVD_RW: return CDIO_DISC_MODE_DVD_RW;
- case CDIO_DVD_BOOK_DVD_PR: return CDIO_DISC_MODE_DVD_PR;
- case CDIO_DVD_BOOK_DVD_PRW: return CDIO_DISC_MODE_DVD_PRW;
- default: return CDIO_DISC_MODE_DVD_OTHER;
- }
- }
-
- if (!p_env->gen.toc_init)
- read_toc_win32ioctl (p_env);
-
- if (!p_env->gen.toc_init)
- return CDIO_DISC_MODE_NO_INFO;
-
- for (i_track = p_env->gen.i_first_track;
- i_track < p_env->gen.i_first_track + p_env->gen.i_tracks ;
- i_track ++) {
- track_format_t track_fmt=get_track_format_win32ioctl(p_env, i_track);
-
- switch(track_fmt) {
- case TRACK_FORMAT_AUDIO:
- switch(discmode) {
- case CDIO_DISC_MODE_NO_INFO:
- discmode = CDIO_DISC_MODE_CD_DA;
- break;
- case CDIO_DISC_MODE_CD_DA:
- case CDIO_DISC_MODE_CD_MIXED:
- case CDIO_DISC_MODE_ERROR:
- /* No change*/
- break;
- default:
- discmode = CDIO_DISC_MODE_CD_MIXED;
- }
- break;
- case TRACK_FORMAT_XA:
- switch(discmode) {
- case CDIO_DISC_MODE_NO_INFO:
- discmode = CDIO_DISC_MODE_CD_XA;
- break;
- case CDIO_DISC_MODE_CD_XA:
- case CDIO_DISC_MODE_CD_MIXED:
- case CDIO_DISC_MODE_ERROR:
- /* No change*/
- break;
- default:
- discmode = CDIO_DISC_MODE_CD_MIXED;
- }
- break;
- case TRACK_FORMAT_DATA:
- switch(discmode) {
- case CDIO_DISC_MODE_NO_INFO:
- discmode = CDIO_DISC_MODE_CD_DATA;
- break;
- case CDIO_DISC_MODE_CD_DATA:
- case CDIO_DISC_MODE_CD_MIXED:
- case CDIO_DISC_MODE_ERROR:
- /* No change*/
- break;
- default:
- discmode = CDIO_DISC_MODE_CD_MIXED;
- }
- break;
- case TRACK_FORMAT_ERROR:
- default:
- discmode = CDIO_DISC_MODE_ERROR;
- }
- }
- return discmode;
-}
-
-/*
- Returns a string that can be used in a CreateFile call if
- c_drive letter is a character. If not NULL is returned.
- */
-
-const char *
-is_cdrom_win32ioctl(const char c_drive_letter)
-{
-#ifdef _XBOX
- char sz_win32_drive_full[] = "\\\\.\\X:";
- sz_win32_drive_full[4] = c_drive_letter;
- return strdup(sz_win32_drive_full);
-#else
- UINT uDriveType;
- char sz_win32_drive[4];
-
- sz_win32_drive[0]= c_drive_letter;
- sz_win32_drive[1]=':';
- sz_win32_drive[2]='\\';
- sz_win32_drive[3]='\0';
-
- uDriveType = GetDriveType(sz_win32_drive);
-
- switch(uDriveType) {
- case DRIVE_CDROM: {
- char sz_win32_drive_full[] = "\\\\.\\X:";
- sz_win32_drive_full[4] = c_drive_letter;
- return strdup(sz_win32_drive_full);
- }
- default:
- cdio_debug("Drive %c is not a CD-ROM", c_drive_letter);
- return NULL;
- }
-#endif
-}
-
-/*!
- Reads an audio device using the DeviceIoControl method into data
- starting from lsn. Returns 0 if no error.
- */
-int
-read_audio_sectors_win32ioctl (_img_private_t *env, void *data, lsn_t lsn,
- unsigned int nblocks)
-{
- DWORD dwBytesReturned;
- RAW_READ_INFO cdrom_raw;
-
- /* Initialize CDROM_RAW_READ structure */
- cdrom_raw.DiskOffset.QuadPart = CDIO_CD_FRAMESIZE_RAW * lsn;
- cdrom_raw.SectorCount = nblocks;
- cdrom_raw.TrackMode = CDDA;
-
- if( DeviceIoControl( env->h_device_handle,
- IOCTL_CDROM_RAW_READ, &cdrom_raw,
- sizeof(RAW_READ_INFO), data,
- CDIO_CD_FRAMESIZE_RAW * nblocks,
- &dwBytesReturned, NULL ) == 0 ) {
- char *psz_msg = NULL;
- long int i_err = GetLastError();
- FORMAT_ERROR(i_err, psz_msg);
- cdio_info("Error reading audio-mode %lu\n%s)",
- (long unsigned int) lsn, psz_msg);
- LocalFree(psz_msg);
- return 1;
- }
- return 0;
-}
-
-/*!
- Reads a single raw sector using the DeviceIoControl method into
- data starting from lsn. Returns 0 if no error.
- */
-static int
-read_raw_sector (const _img_private_t *p_env, void *p_buf, lsn_t lsn)
-{
- scsi_mmc_cdb_t cdb = {{0, }};
-
- /* ReadCD CDB12 command. The values were taken from MMC1 draft paper. */
- CDIO_MMC_SET_COMMAND (cdb.field, CDIO_MMC_GPCMD_READ_CD);
- CDIO_MMC_SET_READ_LBA (cdb.field, lsn);
- CDIO_MMC_SET_READ_LENGTH24(cdb.field, 1);
-
- cdb.field[9]=0xF8; /* Raw read, 2352 bytes per sector */
-
- return run_scsi_cmd_win32ioctl(p_env, OP_TIMEOUT_MS,
- scsi_mmc_get_cmd_len(cdb.field[0]),
- &cdb, SCSI_MMC_DATA_READ,
- CDIO_CD_FRAMESIZE_RAW, p_buf);
-}
-
-/*!
- Reads a single mode2 sector using the DeviceIoControl method into
- data starting from lsn. Returns 0 if no error.
- */
-int
-read_mode2_sector_win32ioctl (const _img_private_t *p_env, void *p_data,
- lsn_t lsn, bool b_form2)
-{
- char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, };
- int ret = read_raw_sector (p_env, buf, lsn);
-
- if ( 0 != ret) return ret;
-
- memcpy (p_data,
- buf + CDIO_CD_SYNC_SIZE + CDIO_CD_XA_HEADER,
- b_form2 ? M2RAW_SECTOR_SIZE: CDIO_CD_FRAMESIZE);
-
- return 0;
-
-}
-
-/*!
- Reads a single mode2 sector using the DeviceIoControl method into
- data starting from lsn. Returns 0 if no error.
- */
-int
-read_mode1_sector_win32ioctl (const _img_private_t *env, void *data,
- lsn_t lsn, bool b_form2)
-{
- char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, };
- int ret = read_raw_sector (env, buf, lsn);
-
- if ( 0 != ret) return ret;
-
- memcpy (data,
- buf + CDIO_CD_SYNC_SIZE+CDIO_CD_HEADER_SIZE,
- b_form2 ? M2RAW_SECTOR_SIZE: CDIO_CD_FRAMESIZE);
-
- return 0;
-
-}
-
-/*!
- Initialize internal structures for CD device.
- */
-bool
-init_win32ioctl (_img_private_t *env)
-{
-#ifdef WIN32
- OSVERSIONINFO ov;
-#endif
-
-#ifdef _XBOX
- ANSI_STRING filename;
- OBJECT_ATTRIBUTES attributes;
- IO_STATUS_BLOCK status;
- HANDLE hDevice;
- NTSTATUS error;
-#else
- unsigned int len=strlen(env->gen.source_name);
- char psz_win32_drive[7];
- DWORD dw_access_flags;
-#endif
-
- cdio_debug("using winNT/2K/XP ioctl layer");
-
-#ifdef WIN32
- memset(&ov,0,sizeof(OSVERSIONINFO));
- ov.dwOSVersionInfoSize=sizeof(OSVERSIONINFO);
- GetVersionEx(&ov);
-
- if((ov.dwPlatformId==VER_PLATFORM_WIN32_NT) &&
- (ov.dwMajorVersion>4))
- dw_access_flags = GENERIC_READ|GENERIC_WRITE; /* add gen write on W2k/XP */
- else dw_access_flags = GENERIC_READ;
-#endif
-
- if (cdio_is_device_win32(env->gen.source_name))
- {
-#ifdef _XBOX
- // Use XBOX cdrom, no matter what drive letter is given.
- RtlInitAnsiString(&filename,"\\Device\\Cdrom0");
- InitializeObjectAttributes(&attributes, &filename, OBJ_CASE_INSENSITIVE,
- NULL);
- error = NtCreateFile( &hDevice,
- GENERIC_READ |SYNCHRONIZE | FILE_READ_ATTRIBUTES,
- &attributes,
- &status,
- NULL,
- 0,
- FILE_SHARE_READ,
- FILE_OPEN,
- FILE_NON_DIRECTORY_FILE
- | FILE_SYNCHRONOUS_IO_NONALERT );
-
- if (!NT_SUCCESS(error))
- {
- return false;
- }
- env->h_device_handle = hDevice;
-#else
- sprintf( psz_win32_drive, "\\\\.\\%c:", env->gen.source_name[len-2] );
-
- env->h_device_handle = CreateFile( psz_win32_drive,
- dw_access_flags,
- FILE_SHARE_READ | FILE_SHARE_WRITE,
- NULL,
- OPEN_EXISTING,
- FILE_ATTRIBUTE_NORMAL,
- NULL );
-
- if( env->h_device_handle == INVALID_HANDLE_VALUE )
- {
- /* No good. try toggle write. */
- dw_access_flags ^= GENERIC_WRITE;
- env->h_device_handle = CreateFile( psz_win32_drive,
- dw_access_flags,
- FILE_SHARE_READ,
- NULL,
- OPEN_EXISTING,
- FILE_ATTRIBUTE_NORMAL,
- NULL );
- if (env->h_device_handle == NULL)
- return false;
- }
-#endif
- env->b_ioctl_init = true;
- return true;
- }
- return false;
-}
-
-/*!
- Read and cache the CD's Track Table of Contents and track info.
- via a SCSI MMC READ_TOC (FULTOC). Return true if successful or
- false if an error.
-*/
-static bool
-read_fulltoc_win32mmc (_img_private_t *p_env)
-{
- scsi_mmc_cdb_t cdb = {{0, }};
- CDROM_TOC_FULL cdrom_toc_full;
- int i_status, i, i_track_format, i_seen_flag;
-
- /* Operation code */
- CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_READ_TOC);
-
- cdb.field[1] = 0x00;
-
- /* Format */
- cdb.field[2] = CDIO_MMC_READTOC_FMT_FULTOC;
-
- memset(&cdrom_toc_full, 0, sizeof(cdrom_toc_full));
-
- /* Setup to read header, to get length of data */
- CDIO_MMC_SET_READ_LENGTH16(cdb.field, sizeof(cdrom_toc_full));
-
- i_status = run_scsi_cmd_win32ioctl (p_env, 1000*60*3,
- scsi_mmc_get_cmd_len(cdb.field[0]),
- &cdb, SCSI_MMC_DATA_READ,
- sizeof(cdrom_toc_full), &cdrom_toc_full);
-
- if ( 0 != i_status ) {
- cdio_debug ("SCSI MMC READ_TOC failed\n");
- return false;
- }
-
- i_seen_flag=0;
- for( i = 0 ; i <= CDIO_CD_MAX_TRACKS+3; i++ ) {
-
- if ( 0xA0 == cdrom_toc_full.TrackData[i].POINT ) {
- /* First track number */
- p_env->gen.i_first_track = cdrom_toc_full.TrackData[i].PMIN;
- i_track_format = cdrom_toc_full.TrackData[i].PSEC;
- i_seen_flag|=0x01;
- }
-
- if ( 0xA1 == cdrom_toc_full.TrackData[i].POINT ) {
- /* Last track number */
- p_env->gen.i_tracks =
- cdrom_toc_full.TrackData[i].PMIN - p_env->gen.i_first_track + 1;
- i_seen_flag|=0x02;
- }
-
- if ( 0xA2 == cdrom_toc_full.TrackData[i].POINT ) {
- /* Start position of the lead out */
- p_env->tocent[ p_env->gen.i_tracks ].start_lsn =
- cdio_msf3_to_lba(
- cdrom_toc_full.TrackData[i].PMIN,
- cdrom_toc_full.TrackData[i].PSEC,
- cdrom_toc_full.TrackData[i].PFRAME );
- p_env->tocent[ p_env->gen.i_tracks ].Control
- = cdrom_toc_full.TrackData[i].Control;
- p_env->tocent[ p_env->gen.i_tracks ].Format = i_track_format;
- i_seen_flag|=0x04;
- }
-
- if (cdrom_toc_full.TrackData[i].POINT > 0
- && cdrom_toc_full.TrackData[i].POINT <= p_env->gen.i_tracks) {
- p_env->tocent[ cdrom_toc_full.TrackData[i].POINT - 1 ].start_lsn =
- cdio_msf3_to_lba(
- cdrom_toc_full.TrackData[i].PMIN,
- cdrom_toc_full.TrackData[i].PSEC,
- cdrom_toc_full.TrackData[i].PFRAME );
- p_env->tocent[ cdrom_toc_full.TrackData[i].POINT - 1 ].Control =
- cdrom_toc_full.TrackData[i].Control;
- p_env->tocent[ cdrom_toc_full.TrackData[i].POINT - 1 ].Format =
- i_track_format;
-
- cdio_debug("p_sectors: %i, %lu", i,
- (unsigned long int) (p_env->tocent[i].start_lsn));
-
- if (cdrom_toc_full.TrackData[i].POINT == p_env->gen.i_tracks)
- i_seen_flag|=0x08;
- }
-
- if ( 0x0F == i_seen_flag ) break;
- }
- if ( 0x0F == i_seen_flag ) {
- p_env->gen.toc_init = true;
- return true;
- }
- return false;
-}
-
-/*!
- Read and cache the CD's Track Table of Contents and track info.
- Return true if successful or false if an error.
-*/
-bool
-read_toc_win32ioctl (_img_private_t *p_env)
-{
- CDROM_TOC cdrom_toc;
- DWORD dwBytesReturned;
- unsigned int i;
-
- if ( ! p_env ) return false;
-
- if ( read_fulltoc_win32mmc(p_env) ) return true;
-
- /* SCSI-MMC READ_TOC (FULTOC) read failed. Try reading TOC via
- DeviceIoControl instead */
- if( DeviceIoControl( p_env->h_device_handle,
- IOCTL_CDROM_READ_TOC,
- NULL, 0, &cdrom_toc, sizeof(CDROM_TOC),
- &dwBytesReturned, NULL ) == 0 ) {
- char *psz_msg = NULL;
- long int i_err = GetLastError();
- FORMAT_ERROR(i_err, psz_msg);
- if (psz_msg) {
- cdio_warn("could not read TOC (%ld): %s", i_err, psz_msg);
- LocalFree(psz_msg);
- } else
- cdio_warn("could not read TOC (%ld)", i_err);
- return false;
- }
-
- p_env->gen.i_first_track = cdrom_toc.FirstTrack;
- p_env->gen.i_tracks = cdrom_toc.LastTrack - cdrom_toc.FirstTrack + 1;
-
- for( i = 0 ; i <= p_env->gen.i_tracks ; i++ ) {
- p_env->tocent[ i ].start_lsn =
- cdio_msf3_to_lba( cdrom_toc.TrackData[i].Address[1],
- cdrom_toc.TrackData[i].Address[2],
- cdrom_toc.TrackData[i].Address[3] );
- p_env->tocent[ i ].Control = cdrom_toc.TrackData[i].Control;
- p_env->tocent[ i ].Format = cdrom_toc.TrackData[i].Format;
- cdio_debug("p_sectors: %i, %lu", i,
- (unsigned long int) (p_env->tocent[i].start_lsn));
- }
- p_env->gen.toc_init = true;
- return true;
-}
-
-/*!
- Return the media catalog number MCN.
-
- Note: string is malloc'd so caller should free() then returned
- string when done with it.
-
- */
-char *
-get_mcn_win32ioctl (const _img_private_t *env) {
-
- DWORD dwBytesReturned;
- SUB_Q_MEDIA_CATALOG_NUMBER mcn;
- CDROM_SUB_Q_DATA_FORMAT q_data_format;
-
- memset( &mcn, 0, sizeof(mcn) );
-
- q_data_format.Format = CDIO_SUBCHANNEL_MEDIA_CATALOG;
-
- q_data_format.Track=1;
-
- if( DeviceIoControl( env->h_device_handle,
- IOCTL_CDROM_READ_Q_CHANNEL,
- &q_data_format, sizeof(q_data_format),
- &mcn, sizeof(mcn),
- &dwBytesReturned, NULL ) == 0 ) {
- cdio_warn( "could not read Q Channel at track %d", 1);
- } else if (mcn.Mcval)
- return strdup(mcn.MediaCatalog);
- return NULL;
-}
-
-/*!
- Get the format (XA, DATA, AUDIO) of a track.
-*/
-track_format_t
-get_track_format_win32ioctl(const _img_private_t *env, track_t i_track)
-{
- /* This is pretty much copied from the "badly broken" cdrom_count_tracks
- in linux/cdrom.c.
- */
-
- if (env->tocent[i_track - env->gen.i_first_track].Control & 0x04) {
- if (env->tocent[i_track - env->gen.i_first_track].Format == 0x10)
- return TRACK_FORMAT_CDI;
- else if (env->tocent[i_track - env->gen.i_first_track].Format == 0x20)
- return TRACK_FORMAT_XA;
- else
- return TRACK_FORMAT_DATA;
- } else
- return TRACK_FORMAT_AUDIO;
-}
-
-#endif /*HAVE_WIN32_CDROM*/
diff --git a/src/input/vcd/libcdio/Makefile.am b/src/input/vcd/libcdio/Makefile.am
deleted file mode 100644
index c7415e787..000000000
--- a/src/input/vcd/libcdio/Makefile.am
+++ /dev/null
@@ -1,70 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-SUBDIRS = cdio MSWindows image
-
-INCLUDES = $(LIBCDIO_CFLAGS) -I$(top_srcdir)/include -I$(top_srcdir)/lib -I$(top_builddir)/lib
-
-libcdio_SRCS = \
- _cdio_bsdi.c \
- _cdio_generic.c \
- _cdio_linux.c \
- _cdio_osx.c \
- _cdio_stdio.c \
- _cdio_stdio.h \
- _cdio_stream.c \
- _cdio_stream.h \
- _cdio_sunos.c \
- cd_types.c \
- cdio.c \
- cdtext.c \
- cdtext_private.h \
- ds.c \
- FreeBSD/freebsd.c \
- FreeBSD/freebsd.h \
- FreeBSD/freebsd_cam.c \
- FreeBSD/freebsd_ioctl.c \
- generic.h \
- image.h \
- image/bincue.c \
- image/cdrdao.c \
- image_common.h \
- image/nrg.c \
- image/nrg.h \
- MSWindows/aspi32.c \
- MSWindows/aspi32.h \
- MSWindows/win32_ioctl.c \
- MSWindows/win32.c \
- MSWindows/win32.h \
- logging.c \
- scsi_mmc.c \
- scsi_mmc_private.h \
- sector.c \
- util.c
-
-libiso9660_SRCS = \
- iso9660.c \
- iso9660_private.h \
- iso9660_fs.c \
- xa.c
-
-EXTRA_DIST = $(libcdio_SRCS) $(libiso9660_SRCS)
-
-if ENABLE_VCD
-if HAVE_VCDNAV
-else
-noinst_LTLIBRARIES = libcdio.la libiso9660.la
-libcdio_la_SOURCES = $(libcdio_SRCS)
-libcdio_la_LDFLAGS = -avoid-version -module
-libiso9660_la_SOURCES = $(libiso9660_SRCS)
-libiso9660_la_LDFLAGS = -avoid-version -module
-endif
-endif
-
-noinst_HEADERS = \
- cdio_assert.h \
- _cdio_stdio.h \
- scsi_mmc.h \
- cdio_private.h \
- _cdio_stream.h \
- iso9660_private.h \
- portable.h
diff --git a/src/input/vcd/libcdio/_cdio_bsdi.c b/src/input/vcd/libcdio/_cdio_bsdi.c
deleted file mode 100644
index aef535752..000000000
--- a/src/input/vcd/libcdio/_cdio_bsdi.c
+++ /dev/null
@@ -1,846 +0,0 @@
-/*
- $Id: _cdio_bsdi.c,v 1.3 2005/01/01 02:43:57 rockyb Exp $
-
- Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
- Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* This file contains BSDI-specific code and implements low-level
- control of the CD drive.
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-static const char _rcsid[] = "$Id: _cdio_bsdi.c,v 1.3 2005/01/01 02:43:57 rockyb Exp $";
-
-#include <cdio/logging.h>
-#include <cdio/sector.h>
-#include <cdio/util.h>
-#include "cdio_assert.h"
-#include "cdio_private.h"
-
-#define DEFAULT_CDIO_DEVICE "/dev/rsr0c"
-#include <string.h>
-
-#ifdef HAVE_BSDI_CDROM
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-
-/*#define USE_ETC_FSTAB*/
-#ifdef USE_ETC_FSTAB
-#include <fstab.h>
-#endif
-
-#include <dvd.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include </sys/dev/scsi/scsi.h>
-#include </sys/dev/scsi/scsi_ioctl.h>
-#include "cdtext_private.h"
-
-typedef enum {
- _AM_NONE,
- _AM_IOCTL,
-} access_mode_t;
-
-typedef struct {
- /* Things common to all drivers like this.
- This must be first. */
- generic_img_private_t gen;
-
- access_mode_t access_mode;
-
- /* Some of the more OS specific things. */
- /* Track information */
- struct cdrom_tochdr tochdr;
- struct cdrom_tocentry tocent[CDIO_CD_MAX_TRACKS+1];
-
-} _img_private_t;
-
-/* Define the Cdrom Generic Command structure */
-typedef struct cgc
-{
- scsi_mmc_cdb_t cdb;
- u_char *buf;
- int buflen;
- int rw;
- unsigned int timeout;
- scsi_user_sense_t *sus;
-} cgc_t;
-
-
-/*
- This code adapted from Steven M. Schultz's libdvd
-*/
-static int
-run_scsi_cmd_bsdi(const void *p_user_data, unsigned int i_timeout_ms,
- unsigned int i_cdb, const scsi_mmc_cdb_t *p_cdb,
- scsi_mmc_direction_t e_direction,
- unsigned int i_buf, /*in/out*/ void *p_buf )
-{
- const _img_private_t *p_env = p_user_data;
- int i_status, i_asc;
- struct scsi_user_cdb suc;
- struct scsi_sense *sp;
-
- again:
- suc.suc_flags = SCSI_MMC_DATA_READ == e_direction ?
- SUC_READ : SUC_WRITE;
- suc.suc_cdblen = i_cdb;
- memcpy(suc.suc_cdb, p_cdb, i_cdb);
- suc.suc_data = p_buf;
- suc.suc_datalen = i_buf;
- suc.suc_timeout = msecs2secs(i_timeout_ms);
- if (ioctl(p_env->gen.fd, SCSIRAWCDB, &suc) == -1)
- return(errno);
- i_status = suc.suc_sus.sus_status;
-
-#if 0
- /*
- * If the device returns a scsi sense error and debugging is enabled print
- * some hopefully useful information on stderr.
- */
- if (i_status && debug)
- {
- unsigned char *cp;
- int i;
- cp = suc.suc_sus.sus_sense;
- fprintf(stderr,"i_status = %x cdb =",
- i_status);
- for (i = 0; i < cdblen; i++)
- fprintf(stderr, " %x", cgc->cdb[i]);
- fprintf(stderr, "\nsense =");
- for (i = 0; i < 16; i++)
- fprintf(stderr, " %x", cp[i]);
- fprintf(stderr, "\n");
- }
-#endif
-
- /*
- * HACK! Some drives return a silly "medium changed" on the first
- * command AND a non-zero i_status which gets turned into a fatal
- * (EIO) error even though the operation was a success. Retrying
- * the operation clears the media changed status and gets the
- * answer. */
-
- sp = (struct scsi_sense *)&suc.suc_sus.sus_sense;
- i_asc = XSENSE_ASC(sp);
- if (i_status == STS_CHECKCOND && i_asc == 0x28)
- goto again;
-#if 0
- if (cgc->sus)
- memcpy(cgc->sus, &suc.suc_sus, sizeof (struct scsi_user_sense));
-#endif
-
- return(i_status);
-}
-
-
-
-/* Check a drive to see if it is a CD-ROM
- Return 1 if a CD-ROM. 0 if it exists but isn't a CD-ROM drive
- and -1 if no device exists .
-*/
-static bool
-cdio_is_cdrom(char *drive, char *mnttype)
-{
- bool is_cd=false;
- int cdfd;
- struct cdrom_tochdr tochdr;
-
- /* If it doesn't exist, return -1 */
- if ( !cdio_is_device_quiet_generic(drive) ) {
- return(false);
- }
-
- /* If it does exist, verify that it's an available CD-ROM */
- cdfd = open(drive, (O_RDONLY|O_EXCL|O_NONBLOCK), 0);
-
- /* Should we want to test the condition in more detail:
- ENOENT is the error for /dev/xxxxx does not exist;
- ENODEV means there's no drive present. */
-
- if ( cdfd >= 0 ) {
- if ( ioctl(cdfd, CDROMREADTOCHDR, &tochdr) != -1 ) {
- is_cd = true;
- }
- close(cdfd);
- }
- /* Even if we can't read it, it might be mounted */
- else if ( mnttype && (strcmp(mnttype, "cd9660") == 0) ) {
- is_cd = true;
- }
- return(is_cd);
-}
-
-/*!
- Initialize CD device.
- */
-static bool
-_cdio_init (_img_private_t *p_env)
-{
- if (p_env->gen.init) {
- cdio_warn ("init called more than once");
- return false;
- }
-
- p_env->gen.fd = open (p_env->gen.source_name, O_RDONLY, 0);
-
- if (p_env->gen.fd < 0)
- {
- cdio_warn ("open (%s): %s", p_env->gen.source_name, strerror (errno));
- return false;
- }
-
- p_env->gen.init = true;
- p_env->gen.toc_init = false;
- return true;
-}
-
-/* Read audio sectors
-*/
-static int
-_read_audio_sectors_bsdi (void *user_data, void *data, lsn_t lsn,
- unsigned int nblocks)
-{
- char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, };
- struct cdrom_msf *msf = (struct cdrom_msf *) &buf;
- msf_t _msf;
-
- _img_private_t *p_env = user_data;
-
- cdio_lba_to_msf (cdio_lsn_to_lba(lsn), &_msf);
- msf->cdmsf_min0 = cdio_from_bcd8(_msf.m);
- msf->cdmsf_sec0 = cdio_from_bcd8(_msf.s);
- msf->cdmsf_frame0 = cdio_from_bcd8(_msf.f);
-
- if (p_env->gen.ioctls_debugged == 75)
- cdio_debug ("only displaying every 75th ioctl from now on");
-
- if (p_env->gen.ioctls_debugged == 30 * 75)
- cdio_debug ("only displaying every 30*75th ioctl from now on");
-
- if (p_env->gen.ioctls_debugged < 75
- || (p_env->gen.ioctls_debugged < (30 * 75)
- && p_env->gen.ioctls_debugged % 75 == 0)
- || p_env->gen.ioctls_debugged % (30 * 75) == 0)
- cdio_debug ("reading %2.2d:%2.2d:%2.2d",
- msf->cdmsf_min0, msf->cdmsf_sec0, msf->cdmsf_frame0);
-
- p_env->gen.ioctls_debugged++;
-
- switch (p_env->access_mode) {
- case _AM_NONE:
- cdio_warn ("no way to read audio");
- return 1;
- break;
-
- case _AM_IOCTL: {
- unsigned int i;
- for (i=0; i < nblocks; i++) {
- if (ioctl (p_env->gen.fd, CDROMREADRAW, &buf) == -1) {
- perror ("ioctl()");
- return 1;
- /* exit (EXIT_FAILURE); */
- }
- memcpy (((char *)data) + (CDIO_CD_FRAMESIZE_RAW * i), buf,
- CDIO_CD_FRAMESIZE_RAW);
- }
- break;
- }
- }
-
- return 0;
-}
-
-/*!
- Reads a single mode1 sector from cd device into data starting
- from lsn. Returns 0 if no error.
- */
-static int
-_read_mode1_sector_bsdi (void *user_data, void *data, lsn_t lsn,
- bool b_form2)
-{
-
-#if FIXED
- char buf[M2RAW_SECTOR_SIZE] = { 0, };
- do something here.
-#else
- return cdio_generic_read_form1_sector(user_data, data, lsn);
-#endif
- return 0;
-}
-
-/*!
- Reads nblocks of mode2 sectors from cd device into data starting
- from lsn.
- Returns 0 if no error.
- */
-static int
-_read_mode1_sectors_bsdi (void *user_data, void *data, lsn_t lsn,
- bool b_form2, unsigned int nblocks)
-{
- _img_private_t *p_env = user_data;
- unsigned int i;
- int retval;
- unsigned int blocksize = b_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE;
-
- for (i = 0; i < nblocks; i++) {
- if ( (retval = _read_mode1_sector_bsdi (p_env,
- ((char *)data) + (blocksize * i),
- lsn + i, b_form2)) )
- return retval;
- }
- return 0;
-}
-
-/*!
- Reads a single mode2 sector from cd device into data starting
- from lsn. Returns 0 if no error.
- */
-static int
-_read_mode2_sector_bsdi (void *user_data, void *data, lsn_t lsn,
- bool b_form2)
-{
- char buf[M2RAW_SECTOR_SIZE] = { 0, };
- struct cdrom_msf *msf = (struct cdrom_msf *) &buf;
- msf_t _msf;
-
- _img_private_t *p_env = user_data;
-
- cdio_lba_to_msf (cdio_lsn_to_lba(lsn), &_msf);
- msf->cdmsf_min0 = cdio_from_bcd8(_msf.m);
- msf->cdmsf_sec0 = cdio_from_bcd8(_msf.s);
- msf->cdmsf_frame0 = cdio_from_bcd8(_msf.f);
-
- if (p_env->gen.ioctls_debugged == 75)
- cdio_debug ("only displaying every 75th ioctl from now on");
-
- if (p_env->gen.ioctls_debugged == 30 * 75)
- cdio_debug ("only displaying every 30*75th ioctl from now on");
-
- if (p_env->gen.ioctls_debugged < 75
- || (p_env->gen.ioctls_debugged < (30 * 75)
- && p_env->gen.ioctls_debugged % 75 == 0)
- || p_env->gen.ioctls_debugged % (30 * 75) == 0)
- cdio_debug ("reading %2.2d:%2.2d:%2.2d",
- msf->cdmsf_min0, msf->cdmsf_sec0, msf->cdmsf_frame0);
-
- p_env->gen.ioctls_debugged++;
-
- switch (p_env->access_mode)
- {
- case _AM_NONE:
- cdio_warn ("no way to read mode2");
- return 1;
- break;
-
- case _AM_IOCTL:
- if (ioctl (p_env->gen.fd, CDROMREADMODE2, &buf) == -1)
- {
- perror ("ioctl()");
- return 1;
- /* exit (EXIT_FAILURE); */
- }
- break;
- }
-
- if (b_form2)
- memcpy (data, buf, M2RAW_SECTOR_SIZE);
- else
- memcpy (((char *)data), buf + CDIO_CD_SUBHEADER_SIZE, CDIO_CD_FRAMESIZE);
-
- return 0;
-}
-
-/*!
- Reads nblocks of mode2 sectors from cd device into data starting
- from lsn.
- Returns 0 if no error.
- */
-static int
-_read_mode2_sectors_bsdi (void *user_data, void *data, lsn_t lsn,
- bool b_form2, unsigned int nblocks)
-{
- _img_private_t *p_env = user_data;
- unsigned int i;
- unsigned int i_blocksize = b_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE;
-
- /* For each frame, pick out the data part we need */
- for (i = 0; i < nblocks; i++) {
- int retval = _read_mode2_sector_bsdi(p_env,
- ((char *)data) +
- (i_blocksize * i),
- lsn + i, b_form2);
- if (retval) return retval;
- }
- return 0;
-}
-
-/*!
- Return the size of the CD in logical block address (LBA) units.
- */
-static uint32_t
-_stat_size_bsdi (void *user_data)
-{
- _img_private_t *p_env = user_data;
-
- struct cdrom_tocentry tocent;
- uint32_t size;
-
- tocent.cdte_track = CDIO_CDROM_LEADOUT_TRACK;
- tocent.cdte_format = CDROM_LBA;
- if (ioctl (p_env->gen.fd, CDROMREADTOCENTRY, &tocent) == -1)
- {
- perror ("ioctl(CDROMREADTOCENTRY)");
- exit (EXIT_FAILURE);
- }
-
- size = tocent.cdte_addr.lba;
-
- return size;
-}
-
-/*!
- Set the key "arg" to "value" in source device.
-*/
-static int
-_set_arg_bsdi (void *user_data, const char key[], const char value[])
-{
- _img_private_t *p_env = user_data;
-
- if (!strcmp (key, "source"))
- {
- if (!value)
- return -2;
-
- free (p_env->gen.source_name);
-
- p_env->gen.source_name = strdup (value);
- }
- else if (!strcmp (key, "access-mode"))
- {
- if (!strcmp(value, "IOCTL"))
- p_env->access_mode = _AM_IOCTL;
- else
- cdio_warn ("unknown access type: %s. ignored.", value);
- }
- else
- return -1;
-
- return 0;
-}
-
-/*!
- Read and cache the CD's Track Table of Contents and track info.
- Return false if successful or true if an error.
-*/
-static bool
-read_toc_bsdi (void *p_user_data)
-{
- _img_private_t *p_env = p_user_data;
- int i;
-
- /* read TOC header */
- if ( ioctl(p_env->gen.fd, CDROMREADTOCHDR, &p_env->tochdr) == -1 ) {
- cdio_warn("%s: %s\n",
- "error in ioctl CDROMREADTOCHDR", strerror(errno));
- return false;
- }
-
- p_env->gen.i_first_track = p_env->tochdr.cdth_trk0;
- p_env->gen.i_tracks = p_env->tochdr.cdth_trk1;
-
- /* read individual tracks */
- for (i= p_env->gen.i_first_track; i<=p_env->gen.i_tracks; i++) {
- p_env->tocent[i-1].cdte_track = i;
- p_env->tocent[i-1].cdte_format = CDROM_MSF;
- if (ioctl(p_env->gen.fd, CDROMREADTOCENTRY, &p_env->tocent[i-1]) == -1) {
- cdio_warn("%s %d: %s\n",
- "error in ioctl CDROMREADTOCENTRY for track",
- i, strerror(errno));
- return false;
- }
- /****
- struct cdrom_msf0 *msf= &p_env->tocent[i-1].cdte_addr.msf;
-
- fprintf (stdout, "--- track# %d (msf %2.2x:%2.2x:%2.2x)\n",
- i, msf->minute, msf->second, msf->frame);
- ****/
-
- }
-
- /* read the lead-out track */
- p_env->tocent[p_env->gen.i_tracks].cdte_track = CDIO_CDROM_LEADOUT_TRACK;
- p_env->tocent[p_env->gen.i_tracks].cdte_format = CDROM_MSF;
-
- if (ioctl(p_env->gen.fd, CDROMREADTOCENTRY,
- &p_env->tocent[p_env->gen.i_tracks]) == -1 ) {
- cdio_warn("%s: %s\n",
- "error in ioctl CDROMREADTOCENTRY for lead-out",
- strerror(errno));
- return false;
- }
-
- /*
- struct cdrom_msf0 *msf= &p_env->tocent[p_env->gen.i_tracks].cdte_addr.msf;
-
- fprintf (stdout, "--- track# %d (msf %2.2x:%2.2x:%2.2x)\n",
- i, msf->minute, msf->second, msf->frame);
- */
-
- p_env->gen.toc_init = true;
- return true;
-}
-
-/*!
- Eject media in CD drive. If successful, as a side effect we
- also free obj.
- */
-static int
-_eject_media_bsdi (void *user_data) {
-
- _img_private_t *p_env = user_data;
- int ret=2;
- int status;
- int fd;
-
- close(p_env->gen.fd);
- p_env->gen.fd = -1;
- if ((fd = open (p_env->gen.source_name, O_RDONLY|O_NONBLOCK)) > -1) {
- if((status = ioctl(fd, CDROM_DRIVE_STATUS, (void *) CDSL_CURRENT)) > 0) {
- switch(status) {
- case CDS_TRAY_OPEN:
- if((ret = ioctl(fd, CDROMCLOSETRAY, 0)) != 0) {
- cdio_warn ("ioctl CDROMCLOSETRAY failed: %s\n", strerror(errno));
- }
- break;
- case CDS_DISC_OK:
- if((ret = ioctl(fd, CDROMEJECT, 0)) != 0) {
- cdio_warn("ioctl CDROMEJECT failed: %s\n", strerror(errno));
- }
- break;
- }
- ret=0;
- } else {
- cdio_warn ("CDROM_DRIVE_STATUS failed: %s\n", strerror(errno));
- ret=1;
- }
- close(fd);
- }
- return 2;
-}
-
-/*!
- Return the value associated with the key "arg".
-*/
-static const char *
-_get_arg_bsdi (void *user_data, const char key[])
-{
- _img_private_t *p_env = user_data;
-
- if (!strcmp (key, "source")) {
- return p_env->gen.source_name;
- } else if (!strcmp (key, "access-mode")) {
- switch (p_env->access_mode) {
- case _AM_IOCTL:
- return "ioctl";
- case _AM_NONE:
- return "no access method";
- }
- }
- return NULL;
-}
-
-/*!
- Return the media catalog number MCN.
- Note: string is malloc'd so caller should free() then returned
- string when done with it.
- */
-static char *
-_get_mcn_bsdi (const void *user_data) {
-
- struct cdrom_mcn mcn;
- const _img_private_t *p_env = user_data;
- if (ioctl(p_env->gen.fd, CDROM_GET_MCN, &mcn) != 0)
- return NULL;
- return strdup(mcn.medium_catalog_number);
-}
-
-/*!
- Get format of track.
-*/
-static track_format_t
-get_track_format_bsdi(void *user_data, track_t i_track)
-{
- _img_private_t *p_env = user_data;
-
- if (!p_env->gen.toc_init) read_toc_bsdi (p_env) ;
-
- if (i_track > p_env->gen.i_tracks || i_track == 0)
- return TRACK_FORMAT_ERROR;
-
- i_track -= p_env->gen.i_first_track;
-
- /* This is pretty much copied from the "badly broken" cdrom_count_tracks
- in linux/cdrom.c.
- */
- if (p_env->tocent[i_track].cdte_ctrl & CDROM_DATA_TRACK) {
- if (p_env->tocent[i_track].cdte_format == CDIO_CDROM_CDI_TRACK)
- return TRACK_FORMAT_CDI;
- else if (p_env->tocent[i_track].cdte_format == CDIO_CDROM_XA_TRACK)
- return TRACK_FORMAT_XA;
- else
- return TRACK_FORMAT_DATA;
- } else
- return TRACK_FORMAT_AUDIO;
-
-}
-
-/*!
- Return true if we have XA data (green, mode2 form1) or
- XA data (green, mode2 form2). That is track begins:
- sync - header - subheader
- 12 4 - 8
-
- FIXME: there's gotta be a better design for this and get_track_format?
-*/
-static bool
-_get_track_green_bsdi(void *user_data, track_t i_track)
-{
- _img_private_t *p_env = user_data;
-
- if (!p_env->gen.toc_init) read_toc_bsdi (p_env) ;
-
- if (i_track == CDIO_CDROM_LEADOUT_TRACK) i_track = p_env->gen.i_tracks+1;
-
- if (i_track > p_env->gen.i_tracks+1 || i_track == 0)
- return false;
-
- /* FIXME: Dunno if this is the right way, but it's what
- I was using in cdinfo for a while.
- */
- return ((p_env->tocent[i_track-1].cdte_ctrl & 2) != 0);
-}
-
-/*!
- Return the starting MSF (minutes/secs/frames) for track number
- i_track in obj. Track numbers start at 1.
- The "leadout" track is specified either by
- using i_track LEADOUT_TRACK or the total tracks+1.
- False is returned if there is no track entry.
-*/
-static bool
-_get_track_msf_bsdi(void *user_data, track_t i_track, msf_t *msf)
-{
- _img_private_t *p_env = user_data;
-
- if (NULL == msf) return false;
-
- if (!p_env->gen.toc_init) read_toc_bsdi (p_env) ;
-
- if (i_track == CDIO_CDROM_LEADOUT_TRACK) i_track = p_env->gen.i_tracks+1;
-
- if (i_track > p_env->gen.i_tracks+1 || i_track == 0) {
- return false;
- }
-
- i_track -= p_env->gen.i_first_track;
-
- {
- struct cdrom_msf0 *msf0= &p_env->tocent[i_track].cdte_addr.msf;
- msf->m = cdio_to_bcd8(msf0->minute);
- msf->s = cdio_to_bcd8(msf0->second);
- msf->f = cdio_to_bcd8(msf0->frame);
- return true;
- }
-}
-
-#endif /* HAVE_BSDI_CDROM */
-
-/*!
- Return an array of strings giving possible CD devices.
- */
-char **
-cdio_get_devices_bsdi (void)
-{
-#ifndef HAVE_BSDI_CDROM
- return NULL;
-#else
- char drive[40];
- char **drives = NULL;
- unsigned int num_drives=0;
- bool exists=true;
- char c;
-
- /* Scan the system for CD-ROM drives.
- */
-
-#ifdef USE_ETC_FSTAB
-
- struct fstab *fs;
- setfsent();
-
- /* Check what's in /etc/fstab... */
- while ( (fs = getfsent()) )
- {
- if (strncmp(fs->fs_spec, "/dev/sr", 7))
- cdio_add_device_list(&drives, fs->fs_spec, &num_drives);
- }
-
-#endif
-
- /* Scan the system for CD-ROM drives.
- Not always 100% reliable, so use the USE_MNTENT code above first.
- */
- for ( c='0'; exists && c <='9'; c++ ) {
- sprintf(drive, "/dev/rsr%cc", c);
- exists = cdio_is_cdrom(drive, NULL);
- if ( exists ) {
- cdio_add_device_list(&drives, drive, &num_drives);
- }
- }
- cdio_add_device_list(&drives, NULL, &num_drives);
- return drives;
-#endif /*HAVE_BSDI_CDROM*/
-}
-
-/*!
- Return a string containing the default CD device if none is specified.
- */
-char *
-cdio_get_default_device_bsdi(void)
-{
- return strdup(DEFAULT_CDIO_DEVICE);
-}
-
-/*!
- Initialization routine. This is the only thing that doesn't
- get called via a function pointer. In fact *we* are the
- ones to set that up.
- */
-CdIo *
-cdio_open_am_bsdi (const char *psz_source_name, const char *psz_access_mode)
-{
- if (psz_access_mode != NULL)
- cdio_warn ("there is only one access mode for bsdi. Arg %s ignored",
- psz_access_mode);
- return cdio_open_bsdi(psz_source_name);
-}
-
-
-/*!
- Initialization routine. This is the only thing that doesn't
- get called via a function pointer. In fact *we* are the
- ones to set that up.
- */
-CdIo *
-cdio_open_bsdi (const char *psz_orig_source)
-{
-
-#ifdef HAVE_BSDI_CDROM
- CdIo *ret;
- _img_private_t *_data;
- char *psz_source;
-
- cdio_funcs _funcs = {
- .eject_media = _eject_media_bsdi,
- .free = cdio_generic_free,
- .get_arg = _get_arg_bsdi,
- .get_cdtext = get_cdtext_generic,
- .get_default_device = cdio_get_default_device_bsdi,
- .get_devices = cdio_get_devices_bsdi,
- .get_drive_cap = scsi_mmc_get_drive_cap_generic,
- .get_discmode = get_discmode_generic,
- .get_first_track_num= get_first_track_num_generic,
- .get_hwinfo = NULL,
- .get_mcn = _get_mcn_bsdi,
- .get_num_tracks = get_num_tracks_generic,
- .get_track_format = get_track_format_bsdi,
- .get_track_green = _get_track_green_bsdi,
- .get_track_lba = NULL, /* This could be implemented if need be. */
- .get_track_msf = _get_track_msf_bsdi,
- .lseek = cdio_generic_lseek,
- .read = cdio_generic_read,
- .read_audio_sectors = _read_audio_sectors_bsdi,
- .read_mode1_sector = _read_mode1_sector_bsdi,
- .read_mode1_sectors = _read_mode1_sectors_bsdi,
- .read_mode2_sector = _read_mode2_sector_bsdi,
- .read_mode2_sectors = _read_mode2_sectors_bsdi,
- .read_toc = &read_toc_bsdi,
- .run_scsi_mmc_cmd = &run_scsi_cmd_bsdi,
- .set_arg = _set_arg_bsdi,
- .stat_size = _stat_size_bsdi
- };
-
- _data = _cdio_malloc (sizeof (_img_private_t));
- _data->access_mode = _AM_IOCTL;
- _data->gen.init = false;
- _data->gen.fd = -1;
- _data->gen.toc_init = false;
- _data->gen.b_cdtext_init = false;
- _data->gen.b_cdtext_error = false;
-
- if (NULL == psz_orig_source) {
- psz_source=cdio_get_default_device_linux();
- if (NULL == psz_source) return NULL;
- _set_arg_bsdi(_data, "source", psz_source);
- free(psz_source);
- } else {
- if (cdio_is_device_generic(psz_orig_source))
- _set_arg_bsdi(_data, "source", psz_orig_source);
- else {
- /* The below would be okay if all device drivers worked this way. */
-#if 0
- cdio_info ("source %s is not a device", psz_orig_source);
-#endif
- return NULL;
- }
- }
-
- ret = cdio_new ( (void *) _data, &_funcs);
- if (ret == NULL) return NULL;
-
- if (_cdio_init(_data))
- return ret;
- else {
- cdio_generic_free (_data);
- return NULL;
- }
-
-#else
- return NULL;
-#endif /* HAVE_BSDI_CDROM */
-
-}
-
-bool
-cdio_have_bsdi (void)
-{
-#ifdef HAVE_BSDI_CDROM
- return true;
-#else
- return false;
-#endif /* HAVE_BSDI_CDROM */
-}
diff --git a/src/input/vcd/libcdio/_cdio_generic.c b/src/input/vcd/libcdio/_cdio_generic.c
deleted file mode 100644
index fb3ed5a9c..000000000
--- a/src/input/vcd/libcdio/_cdio_generic.c
+++ /dev/null
@@ -1,426 +0,0 @@
-/*
- $Id: _cdio_generic.c,v 1.3 2005/01/01 02:43:57 rockyb Exp $
-
- Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* This file contains generic implementations of device-dirver routines.
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-static const char _rcsid[] = "$Id: _cdio_generic.c,v 1.3 2005/01/01 02:43:57 rockyb Exp $";
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /*HAVE_UNISTD_H*/
-
-#include <fcntl.h>
-
-#include <sys/stat.h>
-#include <sys/types.h>
-
-#include <cdio/sector.h>
-#include <cdio/util.h>
-#include <cdio/logging.h>
-#include "cdio_assert.h"
-#include "cdio_private.h"
-#include "_cdio_stdio.h"
-#include "portable.h"
-
-/*!
- Eject media -- there's nothing to do here. We always return 2.
- Should we also free resources?
- */
-int
-cdio_generic_bogus_eject_media (void *user_data) {
- /* Sort of a stub here. Perhaps log a message? */
- return 2;
-}
-
-
-/*!
- Release and free resources associated with cd.
- */
-void
-cdio_generic_free (void *p_user_data)
-{
- generic_img_private_t *p_env = p_user_data;
- track_t i_track;
-
- if (NULL == p_env) return;
- free (p_env->source_name);
-
- for (i_track=0; i_track < p_env->i_tracks; i_track++) {
- cdtext_destroy(&(p_env->cdtext_track[i_track]));
- }
-
- if (p_env->fd >= 0)
- close (p_env->fd);
-
- free (p_env);
-}
-
-/*!
- Initialize CD device.
- */
-bool
-cdio_generic_init (void *user_data)
-{
- generic_img_private_t *p_env = user_data;
- if (p_env->init) {
- cdio_warn ("init called more than once");
- return false;
- }
-
- p_env->fd = open (p_env->source_name, O_RDONLY, 0);
-
- if (p_env->fd < 0)
- {
- cdio_warn ("open (%s): %s", p_env->source_name, strerror (errno));
- return false;
- }
-
- p_env->init = true;
- p_env->toc_init = false;
- p_env->b_cdtext_init = false;
- p_env->b_cdtext_error = false;
- p_env->i_joliet_level = 0; /* Assume no Joliet extensions initally */
- return true;
-}
-
-/*!
- Reads a single form1 sector from cd device into data starting
- from lsn. Returns 0 if no error.
- */
-int
-cdio_generic_read_form1_sector (void * user_data, void *data, lsn_t lsn)
-{
- if (0 > cdio_generic_lseek(user_data, CDIO_CD_FRAMESIZE*lsn, SEEK_SET))
- return -1;
- if (0 > cdio_generic_read(user_data, data, CDIO_CD_FRAMESIZE))
- return -1;
- return 0;
-}
-
-/*!
- Reads into buf the next size bytes.
- Returns -1 on error.
- Is in fact libc's lseek().
-*/
-off_t
-cdio_generic_lseek (void *user_data, off_t offset, int whence)
-{
- generic_img_private_t *p_env = user_data;
- return lseek(p_env->fd, offset, whence);
-}
-
-/*!
- Reads into buf the next size bytes.
- Returns -1 on error.
- Is in fact libc's read().
-*/
-ssize_t
-cdio_generic_read (void *user_data, void *buf, size_t size)
-{
- generic_img_private_t *p_env = user_data;
- return read(p_env->fd, buf, size);
-}
-
-/*!
- Release and free resources associated with stream or disk image.
-*/
-void
-cdio_generic_stdio_free (void *user_data)
-{
- generic_img_private_t *p_env = user_data;
-
- if (NULL == p_env) return;
- if (NULL != p_env->source_name)
- free (p_env->source_name);
-
- if (p_env->data_source)
- cdio_stdio_destroy (p_env->data_source);
-}
-
-
-/*!
- Return true if source_name could be a device containing a CD-ROM.
-*/
-bool
-cdio_is_device_generic(const char *source_name)
-{
- struct stat buf;
- if (0 != stat(source_name, &buf)) {
- cdio_warn ("Can't get file status for %s:\n%s", source_name,
- strerror(errno));
- return false;
- }
- return (S_ISBLK(buf.st_mode) || S_ISCHR(buf.st_mode));
-}
-
-/*!
- Like above, but don't give a warning device doesn't exist.
-*/
-bool
-cdio_is_device_quiet_generic(const char *source_name)
-{
- struct stat buf;
- if (0 != stat(source_name, &buf)) {
- return false;
- }
- return (S_ISBLK(buf.st_mode) || S_ISCHR(buf.st_mode));
-}
-
-/*!
- Add/allocate a drive to the end of drives.
- Use cdio_free_device_list() to free this device_list.
-*/
-void
-cdio_add_device_list(char **device_list[], const char *drive,
- unsigned int *num_drives)
-{
- if (NULL != drive) {
- unsigned int j;
-
- /* Check if drive is already in list. */
- for (j=0; j<*num_drives; j++) {
- if (strcmp((*device_list)[j], drive) == 0) break;
- }
-
- if (j==*num_drives) {
- /* Drive not in list. Add it. */
- (*num_drives)++;
- if (*device_list) {
- *device_list = realloc(*device_list, (*num_drives) * sizeof(char *));
- } else {
- /* num_drives should be 0. Add assert? */
- *device_list = malloc((*num_drives) * sizeof(char *));
- }
-
- (*device_list)[*num_drives-1] = strdup(drive);
- }
- } else {
- (*num_drives)++;
- if (*device_list) {
- *device_list = realloc(*device_list, (*num_drives) * sizeof(char *));
- } else {
- *device_list = malloc((*num_drives) * sizeof(char *));
- }
- (*device_list)[*num_drives-1] = NULL;
- }
-}
-
-
-/*!
- Get cdtext information for a CdIo object .
-
- @param obj the CD object that may contain CD-TEXT information.
- @return the CD-TEXT object or NULL if obj is NULL
- or CD-TEXT information does not exist.
-*/
-const cdtext_t *
-get_cdtext_generic (void *p_user_data, track_t i_track)
-{
- generic_img_private_t *p_env = p_user_data;
-
- if ( NULL == p_env ||
- (0 != i_track
- && i_track >= p_env->i_tracks+p_env->i_first_track ) )
- return NULL;
-
- if (!p_env->b_cdtext_init)
- init_cdtext_generic(p_env);
- if (!p_env->b_cdtext_init) return NULL;
-
- if (0 == i_track)
- return &(p_env->cdtext);
- else
- return &(p_env->cdtext_track[i_track-p_env->i_first_track]);
-
-}
-
-/*!
- Get disc type associated with cd object.
-*/
-discmode_t
-get_discmode_generic (void *p_user_data )
-{
- generic_img_private_t *p_env = p_user_data;
-
- /* See if this is a DVD. */
- cdio_dvd_struct_t dvd; /* DVD READ STRUCT for layer 0. */
-
- dvd.physical.type = CDIO_DVD_STRUCT_PHYSICAL;
- dvd.physical.layer_num = 0;
- if (0 == scsi_mmc_get_dvd_struct_physical (p_env->cdio, &dvd)) {
- switch(dvd.physical.layer[0].book_type) {
- case CDIO_DVD_BOOK_DVD_ROM: return CDIO_DISC_MODE_DVD_ROM;
- case CDIO_DVD_BOOK_DVD_RAM: return CDIO_DISC_MODE_DVD_RAM;
- case CDIO_DVD_BOOK_DVD_R: return CDIO_DISC_MODE_DVD_R;
- case CDIO_DVD_BOOK_DVD_RW: return CDIO_DISC_MODE_DVD_RW;
- case CDIO_DVD_BOOK_DVD_PR: return CDIO_DISC_MODE_DVD_PR;
- case CDIO_DVD_BOOK_DVD_PRW: return CDIO_DISC_MODE_DVD_PRW;
- default: return CDIO_DISC_MODE_DVD_OTHER;
- }
- }
-
- return get_discmode_cd_generic(p_user_data);
-}
-
-/*!
- Get disc type associated with cd object.
-*/
-discmode_t
-get_discmode_cd_generic (void *p_user_data )
-{
- generic_img_private_t *p_env = p_user_data;
- track_t i_track;
- discmode_t discmode=CDIO_DISC_MODE_NO_INFO;
-
- if (!p_env->toc_init)
- p_env->cdio->op.read_toc (p_user_data);
-
- if (!p_env->toc_init)
- return CDIO_DISC_MODE_NO_INFO;
-
- for (i_track = p_env->i_first_track;
- i_track < p_env->i_first_track + p_env->i_tracks ;
- i_track ++) {
- track_format_t track_fmt =
- p_env->cdio->op.get_track_format(p_env, i_track);
-
- switch(track_fmt) {
- case TRACK_FORMAT_AUDIO:
- switch(discmode) {
- case CDIO_DISC_MODE_NO_INFO:
- discmode = CDIO_DISC_MODE_CD_DA;
- break;
- case CDIO_DISC_MODE_CD_DA:
- case CDIO_DISC_MODE_CD_MIXED:
- case CDIO_DISC_MODE_ERROR:
- /* No change*/
- break;
- default:
- discmode = CDIO_DISC_MODE_CD_MIXED;
- }
- break;
- case TRACK_FORMAT_XA:
- switch(discmode) {
- case CDIO_DISC_MODE_NO_INFO:
- discmode = CDIO_DISC_MODE_CD_XA;
- break;
- case CDIO_DISC_MODE_CD_XA:
- case CDIO_DISC_MODE_CD_MIXED:
- case CDIO_DISC_MODE_ERROR:
- /* No change*/
- break;
- default:
- discmode = CDIO_DISC_MODE_CD_MIXED;
- }
- break;
- case TRACK_FORMAT_DATA:
- switch(discmode) {
- case CDIO_DISC_MODE_NO_INFO:
- discmode = CDIO_DISC_MODE_CD_DATA;
- break;
- case CDIO_DISC_MODE_CD_DATA:
- case CDIO_DISC_MODE_CD_MIXED:
- case CDIO_DISC_MODE_ERROR:
- /* No change*/
- break;
- default:
- discmode = CDIO_DISC_MODE_CD_MIXED;
- }
- break;
- case TRACK_FORMAT_ERROR:
- default:
- discmode = CDIO_DISC_MODE_ERROR;
- }
- }
- return discmode;
-}
-
-/*!
- Return the number of of the first track.
- CDIO_INVALID_TRACK is returned on error.
-*/
-track_t
-get_first_track_num_generic(void *p_user_data)
-{
- generic_img_private_t *p_env = p_user_data;
-
- if (!p_env->toc_init)
- p_env->cdio->op.read_toc (p_user_data);
-
- return p_env->toc_init ? p_env->i_first_track : CDIO_INVALID_TRACK;
-}
-
-
-/*!
- Return the number of tracks in the current medium.
-*/
- track_t
-get_num_tracks_generic(void *p_user_data)
-{
- generic_img_private_t *p_env = p_user_data;
-
- if (!p_env->toc_init)
- p_env->cdio->op.read_toc (p_user_data);
-
- return p_env->toc_init ? p_env->i_tracks : CDIO_INVALID_TRACK;
-}
-
-void
-set_cdtext_field_generic(void *user_data, track_t i_track,
- track_t i_first_track,
- cdtext_field_t e_field, const char *psz_value)
-{
- char **pp_field;
- generic_img_private_t *env = user_data;
-
- if( i_track == 0 )
- pp_field = &(env->cdtext.field[e_field]);
-
- else
- pp_field = &(env->cdtext_track[i_track-i_first_track].field[e_field]);
-
- *pp_field = strdup(psz_value);
-}
-
-/*!
- Read CD-Text information for a CdIo object .
-
- return true on success, false on error or CD-TEXT information does
- not exist.
-*/
-bool
-init_cdtext_generic (generic_img_private_t *p_env)
-{
- return scsi_mmc_init_cdtext_private( p_env,
- p_env->cdio->op.run_scsi_mmc_cmd,
- set_cdtext_field_generic
- );
-}
-
diff --git a/src/input/vcd/libcdio/_cdio_osx.c b/src/input/vcd/libcdio/_cdio_osx.c
deleted file mode 100644
index f754933c6..000000000
--- a/src/input/vcd/libcdio/_cdio_osx.c
+++ /dev/null
@@ -1,1470 +0,0 @@
-/*
- $Id: _cdio_osx.c,v 1.4 2005/01/01 02:43:57 rockyb Exp $
-
- Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
- from vcdimager code:
- Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
- and VideoLAN code Copyright (C) 1998-2001 VideoLAN
- Authors: Johan Bilien <jobi@via.ecp.fr>
- Gildas Bazin <gbazin@netcourrier.com>
- Jon Lech Johansen <jon-vl@nanocrew.net>
- Derk-Jan Hartman <hartman at videolan.org>
- Justin F. Hallett <thesin@southofheaven.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* This file contains OSX-specific code and implements low-level
- control of the CD drive.
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-static const char _rcsid[] = "$Id: _cdio_osx.c,v 1.4 2005/01/01 02:43:57 rockyb Exp $";
-
-#include <cdio/logging.h>
-#include <cdio/sector.h>
-#include <cdio/util.h>
-#include "cdio_assert.h"
-#include "cdio_private.h"
-
-#include <string.h>
-
-#ifdef HAVE_DARWIN_CDROM
-#undef VERSION
-
-#include <CoreFoundation/CoreFoundation.h>
-#include <IOKit/IOKitLib.h>
-#include <IOKit/storage/IOStorageDeviceCharacteristics.h>
-
-#include <mach/mach.h>
-#include <Carbon/Carbon.h>
-#include <IOKit/scsi-commands/SCSITaskLib.h>
-#include <IOKit/IOCFPlugIn.h>
-#include <mach/mach_error.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-
-
-#include <paths.h>
-#include <CoreFoundation/CoreFoundation.h>
-#include <IOKit/IOKitLib.h>
-#include <IOKit/IOBSD.h>
-#include <IOKit/scsi-commands/IOSCSIMultimediaCommandsDevice.h>
-#include <IOKit/storage/IOCDTypes.h>
-#include <IOKit/storage/IODVDTypes.h>
-#include <IOKit/storage/IOMedia.h>
-#include <IOKit/storage/IOCDMedia.h>
-#include <IOKit/storage/IODVDMedia.h>
-#include <IOKit/storage/IOCDMediaBSDClient.h>
-#include <IOKit/storage/IODVDMediaBSDClient.h>
-#include <IOKit/storage/IOStorageDeviceCharacteristics.h>
-
-#define kIOCDBlockStorageDeviceClassString "IOCDBlockStorageDevice"
-
-/* Note leadout is normally defined 0xAA, But on OSX 0xA0 is "lead in" while
- 0xA2 is "lead out". Don't ask me why. */
-#define OSX_CDROM_LEADOUT_TRACK 0xA2
-
-#define TOTAL_TRACKS (p_env->i_last_track - p_env->gen.i_first_track + 1)
-
-#define CDROM_CDI_TRACK 0x1
-#define CDROM_XA_TRACK 0x2
-
-typedef enum {
- _AM_NONE,
- _AM_OSX,
-} access_mode_t;
-
-#define MAX_SERVICE_NAME 1000
-typedef struct {
- /* Things common to all drivers like this.
- This must be first. */
- generic_img_private_t gen;
-
- access_mode_t access_mode;
-
- /* Track information */
- CDTOC *pTOC;
- int i_descriptors;
- track_t i_last_track; /* highest track number */
- track_t i_last_session; /* highest session number */
- track_t i_first_session; /* first session number */
- lsn_t *pp_lba;
- io_service_t MediaClass_service;
- char psz_MediaClass_service[MAX_SERVICE_NAME];
- SCSITaskDeviceInterface **pp_scsiTaskDeviceInterface;
-
-} _img_private_t;
-
-static bool read_toc_osx (void *p_user_data);
-
-/****
- * GetRegistryEntryProperties - Gets the registry entry properties for
- * an io_service_t.
- *****/
-
-static CFMutableDictionaryRef
-GetRegistryEntryProperties ( io_service_t service )
-{
- IOReturn err = kIOReturnSuccess;
- CFMutableDictionaryRef dict = 0;
-
- err = IORegistryEntryCreateCFProperties (service, &dict, kCFAllocatorDefault, 0);
- if ( err != kIOReturnSuccess )
- cdio_warn( "IORegistryEntryCreateCFProperties: 0x%08x", err );
-
- return dict;
-}
-
-
-static bool
-init_osx(_img_private_t *p_env) {
- mach_port_t port;
- char *psz_devname;
- kern_return_t ret;
- io_iterator_t iterator;
-
- p_env->gen.fd = open( p_env->gen.source_name, O_RDONLY | O_NONBLOCK );
- if (-1 == p_env->gen.fd) {
- cdio_warn("Failed to open %s: %s", p_env->gen.source_name,
- strerror(errno));
- return false;
- }
-
- /* get the device name */
- psz_devname = strrchr( p_env->gen.source_name, '/');
- if( NULL != psz_devname )
- ++psz_devname;
- else
- psz_devname = p_env->gen.source_name;
-
- /* unraw the device name */
- if( *psz_devname == 'r' )
- ++psz_devname;
-
- /* get port for IOKit communication */
- ret = IOMasterPort( MACH_PORT_NULL, &port );
-
- if( ret != KERN_SUCCESS )
- {
- cdio_warn( "IOMasterPort: 0x%08x", ret );
- return false;
- }
-
- ret = IOServiceGetMatchingServices( port,
- IOBSDNameMatching(port, 0, psz_devname),
- &iterator );
-
- /* get service iterator for the device */
- if( ret != KERN_SUCCESS )
- {
- cdio_warn( "IOServiceGetMatchingServices: 0x%08x", ret );
- return false;
- }
-
- /* first service */
- p_env->MediaClass_service = IOIteratorNext( iterator );
- IOObjectRelease( iterator );
-
- /* search for kIOCDMediaClass or kIOCDVDMediaClass */
- while( p_env->MediaClass_service &&
- (!IOObjectConformsTo(p_env->MediaClass_service, kIOCDMediaClass)) &&
- (!IOObjectConformsTo(p_env->MediaClass_service, kIODVDMediaClass)) )
- {
-
- ret = IORegistryEntryGetParentIterator( p_env->MediaClass_service,
- kIOServicePlane,
- &iterator );
- if( ret != KERN_SUCCESS )
- {
- cdio_warn( "IORegistryEntryGetParentIterator: 0x%08x", ret );
- IOObjectRelease( p_env->MediaClass_service );
- return false;
- }
-
- IOObjectRelease( p_env->MediaClass_service );
- p_env->MediaClass_service = IOIteratorNext( iterator );
- IOObjectRelease( iterator );
- }
-
- if ( 0 == p_env->MediaClass_service ) {
- cdio_warn( "search for kIOCDMediaClass/kIODVDMediaClass came up empty" );
- return false;
- }
-
- /* Save the name so we can compare against this in case we have to do
- another scan. FIXME: this is hoaky and there's got to be a better
- variable to test or way to do.
- */
- IORegistryEntryGetPath(p_env->MediaClass_service, kIOServicePlane,
- p_env->psz_MediaClass_service);
- return true;
-}
-
-/*!
- Run a SCSI MMC command.
-
- cdio CD structure set by cdio_open().
- i_timeout time in milliseconds we will wait for the command
- to complete. If this value is -1, use the default
- time-out value.
- p_buf Buffer for data, both sending and receiving
- i_buf Size of buffer
- e_direction direction the transfer is to go.
- cdb CDB bytes. All values that are needed should be set on
- input. We'll figure out what the right CDB length should be.
-
- We return true if command completed successfully and false if not.
- */
-static int
-run_scsi_cmd_osx( const void *p_user_data,
- unsigned int i_timeout_ms,
- unsigned int i_cdb, const scsi_mmc_cdb_t *p_cdb,
- scsi_mmc_direction_t e_direction,
- unsigned int i_buf, /*in/out*/ void *p_buf )
-{
-
-#ifndef SCSI_MMC_FIXED
- return 2;
-#else
- const _img_private_t *p_env = p_user_data;
- SCSITaskDeviceInterface **sc;
- SCSITaskInterface **cmd = NULL;
- IOVirtualRange iov;
- SCSI_Sense_Data senseData;
- SCSITaskStatus status;
- UInt64 bytesTransferred;
- IOReturn ioReturnValue;
- int ret = 0;
-
- if (NULL == p_user_data) return 2;
-
- /* Make sure pp_scsiTaskDeviceInterface is initialized. FIXME: The code
- should probably be reorganized better for this. */
- if (!p_env->gen.toc_init) read_toc_osx (p_user_data) ;
-
- sc = p_env->pp_scsiTaskDeviceInterface;
-
- if (NULL == sc) return 3;
-
- cmd = (*sc)->CreateSCSITask(sc);
- if (cmd == NULL) {
- cdio_warn("Failed to create SCSI task");
- return -1;
- }
-
- iov.address = (IOVirtualAddress) p_buf;
- iov.length = i_buf;
-
- ioReturnValue = (*cmd)->SetCommandDescriptorBlock(cmd, (UInt8 *) p_cdb,
- i_cdb);
- if (ioReturnValue != kIOReturnSuccess) {
- cdio_warn("SetCommandDescriptorBlock failed with status %x",
- ioReturnValue);
- return -1;
- }
-
- ioReturnValue = (*cmd)->SetScatterGatherEntries(cmd, &iov, 1, i_buf,
- (SCSI_MMC_DATA_READ == e_direction ) ?
- kSCSIDataTransfer_FromTargetToInitiator :
- kSCSIDataTransfer_FromInitiatorToTarget);
- if (ioReturnValue != kIOReturnSuccess) {
- cdio_warn("SetScatterGatherEntries failed with status %x", ioReturnValue);
- return -1;
- }
-
- ioReturnValue = (*cmd)->SetTimeoutDuration(cmd, i_timeout_ms );
- if (ioReturnValue != kIOReturnSuccess) {
- cdio_warn("SetTimeoutDuration failed with status %x", ioReturnValue);
- return -1;
- }
-
- memset(&senseData, 0, sizeof(senseData));
-
- ioReturnValue = (*cmd)->ExecuteTaskSync(cmd,&senseData, &status, &
- bytesTransferred);
-
- if (ioReturnValue != kIOReturnSuccess) {
- cdio_warn("Command execution failed with status %x", ioReturnValue);
- return -1;
- }
-
- if (cmd != NULL) {
- (*cmd)->Release(cmd);
- }
-
- return (ret);
-#endif
-}
-
-/***************************************************************************
- * GetDeviceIterator - Gets an io_iterator_t for our class type
- ***************************************************************************/
-
-static io_iterator_t
-GetDeviceIterator ( const char * deviceClass )
-{
-
- IOReturn err = kIOReturnSuccess;
- io_iterator_t iterator = MACH_PORT_NULL;
-
- err = IOServiceGetMatchingServices ( kIOMasterPortDefault,
- IOServiceMatching ( deviceClass ),
- &iterator );
- check ( err == kIOReturnSuccess );
-
- return iterator;
-
-}
-
-/***************************************************************************
- * GetFeaturesFlagsForDrive -Gets the bitfield which represents the
- * features flags.
- ***************************************************************************/
-
-static bool
-GetFeaturesFlagsForDrive ( CFDictionaryRef dict,
- uint32_t *i_cdFlags,
- uint32_t *i_dvdFlags )
-{
- CFDictionaryRef propertiesDict = 0;
- CFNumberRef flagsNumberRef = 0;
-
- *i_cdFlags = 0;
- *i_dvdFlags= 0;
-
- propertiesDict = ( CFDictionaryRef )
- CFDictionaryGetValue ( dict,
- CFSTR ( kIOPropertyDeviceCharacteristicsKey ) );
-
- if ( propertiesDict == 0 ) return false;
-
- /* Get the CD features */
- flagsNumberRef = ( CFNumberRef )
- CFDictionaryGetValue ( propertiesDict,
- CFSTR ( kIOPropertySupportedCDFeatures ) );
- if ( flagsNumberRef != 0 ) {
- CFNumberGetValue ( flagsNumberRef, kCFNumberLongType, i_cdFlags );
- }
-
- /* Get the DVD features */
- flagsNumberRef = ( CFNumberRef )
- CFDictionaryGetValue ( propertiesDict,
- CFSTR ( kIOPropertySupportedDVDFeatures ) );
- if ( flagsNumberRef != 0 ) {
- CFNumberGetValue ( flagsNumberRef, kCFNumberLongType, i_dvdFlags );
- }
-
- return true;
-}
-
-/*!
- Get disc type associated with the cd object.
-*/
-static discmode_t
-get_discmode_osx (void *p_user_data)
-{
- _img_private_t *p_env = p_user_data;
- char str[10];
- int32_t i_discmode = CDIO_DISC_MODE_ERROR;
- CFDictionaryRef propertiesDict = 0;
- CFStringRef data;
-
- propertiesDict = GetRegistryEntryProperties ( p_env->MediaClass_service );
-
- if ( propertiesDict == 0 ) return i_discmode;
-
- data = ( CFStringRef )
- CFDictionaryGetValue ( propertiesDict, CFSTR ( kIODVDMediaTypeKey ) );
-
- if( CFStringGetCString( data, str, sizeof(str),
- kCFStringEncodingASCII ) ) {
- if (0 == strncmp(str, "DVD+R", strlen(str)) )
- i_discmode = CDIO_DISC_MODE_DVD_PR;
- else if (0 == strncmp(str, "DVD+RW", strlen(str)) )
- i_discmode = CDIO_DISC_MODE_DVD_PRW;
- else if (0 == strncmp(str, "DVD-R", strlen(str)) )
- i_discmode = CDIO_DISC_MODE_DVD_R;
- else if (0 == strncmp(str, "DVD-RW", strlen(str)) )
- i_discmode = CDIO_DISC_MODE_DVD_RW;
- else if (0 == strncmp(str, "DVD-ROM", strlen(str)) )
- i_discmode = CDIO_DISC_MODE_DVD_ROM;
- else if (0 == strncmp(str, "DVD-RAM", strlen(str)) )
- i_discmode = CDIO_DISC_MODE_DVD_RAM;
- else if (0 == strncmp(str, "CD-ROM", strlen(str)) )
- i_discmode = CDIO_DISC_MODE_CD_DATA;
- else if (0 == strncmp(str, "CDR", strlen(str)) )
- i_discmode = CDIO_DISC_MODE_CD_DATA;
- else if (0 == strncmp(str, "CDRW", strlen(str)) )
- i_discmode = CDIO_DISC_MODE_CD_DATA;
- //?? Handled by below? CFRelease( data );
- }
- CFRelease( propertiesDict );
- if (CDIO_DISC_MODE_CD_DATA == i_discmode) {
- /* Need to do more classification */
- return get_discmode_cd_generic(p_user_data);
- }
- return i_discmode;
-
-}
-
-static io_service_t
-get_drive_service_osx(const _img_private_t *p_env)
-{
- io_service_t service;
- io_iterator_t service_iterator;
-
- service_iterator = GetDeviceIterator ( kIOCDBlockStorageDeviceClassString );
-
- if( service_iterator == MACH_PORT_NULL ) return 0;
-
- service = IOIteratorNext( service_iterator );
- if( service == 0 ) return 0;
-
- do
- {
- char psz_service[MAX_SERVICE_NAME];
- IORegistryEntryGetPath(service, kIOServicePlane, psz_service);
- psz_service[MAX_SERVICE_NAME-1] = '\0';
-
- /* FIXME: This is all hoaky. Here we need info from a parent class,
- psz_service of what we opened above. We are relying on the
- fact that the name will be a substring of the name we
- openned with.
- */
- if (0 == strncmp(psz_service, p_env->psz_MediaClass_service,
- strlen(psz_service))) {
- /* Found our device */
- IOObjectRelease( service_iterator );
- return service;
- }
-
- IOObjectRelease( service );
-
- } while( ( service = IOIteratorNext( service_iterator ) ) != 0 );
-
- IOObjectRelease( service_iterator );
- return service;
-}
-
-static void
-get_drive_cap_osx(const void *p_user_data,
- /*out*/ cdio_drive_read_cap_t *p_read_cap,
- /*out*/ cdio_drive_write_cap_t *p_write_cap,
- /*out*/ cdio_drive_misc_cap_t *p_misc_cap)
-{
- const _img_private_t *p_env = p_user_data;
- uint32_t i_cdFlags;
- uint32_t i_dvdFlags;
-
- io_service_t service = get_drive_service_osx(p_env);
-
- if( service == 0 ) goto err_exit;
-
- /* Found our device */
- {
- CFDictionaryRef properties = GetRegistryEntryProperties ( service );
-
- if (! GetFeaturesFlagsForDrive ( properties, &i_cdFlags,
- &i_dvdFlags ) ) {
- IOObjectRelease( service );
- goto err_exit;
- }
-
- /* Reader */
-
- if ( 0 != (i_cdFlags & kCDFeaturesAnalogAudioMask) )
- *p_read_cap |= CDIO_DRIVE_CAP_READ_AUDIO;
-
- if ( 0 != (i_cdFlags & kCDFeaturesWriteOnceMask) )
- *p_write_cap |= CDIO_DRIVE_CAP_WRITE_CD_R;
-
- if ( 0 != (i_cdFlags & kCDFeaturesCDDAStreamAccurateMask) )
- *p_read_cap |= CDIO_DRIVE_CAP_READ_CD_DA;
-
- if ( 0 != (i_dvdFlags & kDVDFeaturesReadStructuresMask) )
- *p_read_cap |= CDIO_DRIVE_CAP_READ_DVD_ROM;
-
- if ( 0 != (i_cdFlags & kCDFeaturesReWriteableMask) )
- *p_write_cap |= CDIO_DRIVE_CAP_WRITE_CD_RW;
-
- if ( 0 != (i_dvdFlags & kDVDFeaturesWriteOnceMask) )
- *p_write_cap |= CDIO_DRIVE_CAP_WRITE_DVD_R;
-
- if ( 0 != (i_dvdFlags & kDVDFeaturesRandomWriteableMask) )
- *p_write_cap |= CDIO_DRIVE_CAP_WRITE_DVD_RAM;
-
- if ( 0 != (i_dvdFlags & kDVDFeaturesReWriteableMask) )
- *p_write_cap |= CDIO_DRIVE_CAP_WRITE_DVD_RW;
-
- /***
- if ( 0 != (i_dvdFlags & kDVDFeaturesPlusRMask) )
- *p_write_cap |= CDIO_DRIVE_CAP_WRITE_DVD_PR;
-
- if ( 0 != (i_dvdFlags & kDVDFeaturesPlusRWMask )
- *p_write_cap |= CDIO_DRIVE_CAP_WRITE_DVD_PRW;
- ***/
-
- /* FIXME: fill out. For now assume CD-ROM is relatively modern. */
- *p_misc_cap = (
- CDIO_DRIVE_CAP_MISC_CLOSE_TRAY
- | CDIO_DRIVE_CAP_MISC_EJECT
- | CDIO_DRIVE_CAP_MISC_LOCK
- | CDIO_DRIVE_CAP_MISC_SELECT_SPEED
- | CDIO_DRIVE_CAP_MISC_MULTI_SESSION
- | CDIO_DRIVE_CAP_MISC_MEDIA_CHANGED
- | CDIO_DRIVE_CAP_MISC_RESET
- | CDIO_DRIVE_CAP_MCN
- | CDIO_DRIVE_CAP_ISRC
- );
-
- IOObjectRelease( service );
- }
-
- return;
-
- err_exit:
- *p_misc_cap = *p_write_cap = *p_read_cap = CDIO_DRIVE_CAP_UNKNOWN;
- return;
-}
-
-#if 1
-/****************************************************************************
- * GetDriveDescription - Gets drive description.
- ****************************************************************************/
-
-static bool
-get_hwinfo_osx ( const CdIo *p_cdio, /*out*/ cdio_hwinfo_t *hw_info)
-{
- _img_private_t *p_env = (_img_private_t *) p_cdio->env;
- io_service_t service = get_drive_service_osx(p_env);
-
- if ( service == 0 ) return false;
-
- /* Found our device */
- {
- CFStringRef vendor = NULL;
- CFStringRef product = NULL;
- CFStringRef revision = NULL;
-
- CFDictionaryRef properties = GetRegistryEntryProperties ( service );
- CFDictionaryRef deviceDict = ( CFDictionaryRef )
- CFDictionaryGetValue ( properties,
- CFSTR ( kIOPropertyDeviceCharacteristicsKey ) );
-
- if ( deviceDict == 0 ) return false;
-
- vendor = ( CFStringRef )
- CFDictionaryGetValue ( deviceDict, CFSTR ( kIOPropertyVendorNameKey ) );
-
- if ( CFStringGetCString( vendor,
- (char *) &(hw_info->psz_vendor),
- sizeof(hw_info->psz_vendor),
- kCFStringEncodingASCII ) )
- CFRelease( vendor );
-
- product = ( CFStringRef )
- CFDictionaryGetValue ( deviceDict, CFSTR ( kIOPropertyProductNameKey ) );
-
- if ( CFStringGetCString( product,
- (char *) &(hw_info->psz_model),
- sizeof(hw_info->psz_model),
- kCFStringEncodingASCII ) )
- CFRelease( product );
-
- revision = ( CFStringRef )
- CFDictionaryGetValue ( deviceDict,
- CFSTR ( kIOPropertyProductRevisionLevelKey ) );
-
- if ( CFStringGetCString( product,
- (char *) &(hw_info->psz_revision),
- sizeof(hw_info->psz_revision),
- kCFStringEncodingASCII ) )
- CFRelease( revision );
- }
- return true;
-
-}
-#endif
-
-/*!
- Return the media catalog number MCN.
-
- Note: string is malloc'd so caller should free() then returned
- string when done with it.
-
- */
-static const cdtext_t *
-get_cdtext_osx (void *p_user_data, track_t i_track)
-{
- return NULL;
-}
-
-static void
-_free_osx (void *p_user_data) {
- _img_private_t *p_env = p_user_data;
- if (NULL == p_env) return;
- cdio_generic_free(p_env);
- if (NULL != p_env->pp_lba) free((void *) p_env->pp_lba);
- if (NULL != p_env->pTOC) free((void *) p_env->pTOC);
- IOObjectRelease( p_env->MediaClass_service );
-
- if (NULL != p_env->pp_scsiTaskDeviceInterface)
- ( *(p_env->pp_scsiTaskDeviceInterface) )->
- Release ( (p_env->pp_scsiTaskDeviceInterface) );
-
-}
-
-/*!
- Reads nblocks of mode2 form2 sectors from cd device into data starting
- from lsn.
- Returns 0 if no error.
- */
-static int
-_get_read_mode1_sectors_osx (void *user_data, void *data, lsn_t lsn,
- bool b_form2, unsigned int nblocks)
-{
- _img_private_t *env = user_data;
- dk_cd_read_t cd_read;
-
- memset( &cd_read, 0, sizeof(cd_read) );
-
- cd_read.sectorArea = kCDSectorAreaUser;
- cd_read.buffer = data;
- cd_read.sectorType = kCDSectorTypeMode1;
-
- if (b_form2) {
- cd_read.offset = lsn * kCDSectorSizeMode2;
- cd_read.bufferLength = kCDSectorSizeMode2 * nblocks;
- } else {
- cd_read.offset = lsn * kCDSectorSizeMode1;
- cd_read.bufferLength = kCDSectorSizeMode1 * nblocks;
- }
-
- if( ioctl( env->gen.fd, DKIOCCDREAD, &cd_read ) == -1 )
- {
- cdio_info( "could not read block %d, %s", lsn, strerror(errno) );
- return -1;
- }
- return 0;
-}
-
-
-/*!
- Reads nblocks of mode2 form2 sectors from cd device into data starting
- from lsn.
- Returns 0 if no error.
- */
-static int
-_get_read_mode2_sectors_osx (void *user_data, void *data, lsn_t lsn,
- bool b_form2, unsigned int nblocks)
-{
- _img_private_t *env = user_data;
- dk_cd_read_t cd_read;
-
- memset( &cd_read, 0, sizeof(cd_read) );
-
- cd_read.sectorArea = kCDSectorAreaUser;
- cd_read.buffer = data;
-
- if (b_form2) {
- cd_read.offset = lsn * kCDSectorSizeMode2Form2;
- cd_read.sectorType = kCDSectorTypeMode2Form2;
- cd_read.bufferLength = kCDSectorSizeMode2Form2 * nblocks;
- } else {
- cd_read.offset = lsn * kCDSectorSizeMode2Form1;
- cd_read.sectorType = kCDSectorTypeMode2Form1;
- cd_read.bufferLength = kCDSectorSizeMode2Form1 * nblocks;
- }
-
- if( ioctl( env->gen.fd, DKIOCCDREAD, &cd_read ) == -1 )
- {
- cdio_info( "could not read block %d, %s", lsn, strerror(errno) );
- return -1;
- }
- return 0;
-}
-
-
-/*!
- Reads a single audio sector from CD device into data starting from lsn.
- Returns 0 if no error.
- */
-static int
-_get_read_audio_sectors_osx (void *user_data, void *data, lsn_t lsn,
- unsigned int nblocks)
-{
- _img_private_t *env = user_data;
- dk_cd_read_t cd_read;
-
- memset( &cd_read, 0, sizeof(cd_read) );
-
- cd_read.offset = lsn * kCDSectorSizeCDDA;
- cd_read.sectorArea = kCDSectorAreaUser;
- cd_read.sectorType = kCDSectorTypeCDDA;
-
- cd_read.buffer = data;
- cd_read.bufferLength = kCDSectorSizeCDDA * nblocks;
-
- if( ioctl( env->gen.fd, DKIOCCDREAD, &cd_read ) == -1 )
- {
- cdio_info( "could not read block %d", lsn );
- return -1;
- }
- return 0;
-}
-
-/*!
- Reads a single mode2 sector from cd device into data starting
- from lsn. Returns 0 if no error.
- */
-static int
-_get_read_mode1_sector_osx (void *user_data, void *data, lsn_t lsn,
- bool b_form2)
-{
- return _get_read_mode1_sectors_osx(user_data, data, lsn, b_form2, 1);
-}
-
-/*!
- Reads a single mode2 sector from cd device into data starting
- from lsn. Returns 0 if no error.
- */
-static int
-_get_read_mode2_sector_osx (void *user_data, void *data, lsn_t lsn,
- bool b_form2)
-{
- return _get_read_mode2_sectors_osx(user_data, data, lsn, b_form2, 1);
-}
-
-/*!
- Set the key "arg" to "value" in source device.
-*/
-static int
-_set_arg_osx (void *user_data, const char key[], const char value[])
-{
- _img_private_t *env = user_data;
-
- if (!strcmp (key, "source"))
- {
- if (!value)
- return -2;
-
- free (env->gen.source_name);
-
- env->gen.source_name = strdup (value);
- }
- else if (!strcmp (key, "access-mode"))
- {
- if (!strcmp(value, "OSX"))
- env->access_mode = _AM_OSX;
- else
- cdio_warn ("unknown access type: %s. ignored.", value);
- }
- else
- return -1;
-
- return 0;
-}
-
-#if 0
-static void TestDevice(_img_private_t *p_env, io_service_t service)
-{
- SInt32 score;
- HRESULT herr;
- kern_return_t err;
- IOCFPlugInInterface **plugInInterface = NULL;
- MMCDeviceInterface **mmcInterface = NULL;
-
- /* Create the IOCFPlugIn interface so we can query it. */
-
- err = IOCreatePlugInInterfaceForService ( service,
- kIOMMCDeviceUserClientTypeID,
- kIOCFPlugInInterfaceID,
- &plugInInterface,
- &score );
- if ( err != noErr ) {
- printf("IOCreatePlugInInterfaceForService returned %d\n", err);
- return;
- }
-
- /* Query the interface for the MMCDeviceInterface. */
-
- herr = ( *plugInInterface )->QueryInterface ( plugInInterface,
- CFUUIDGetUUIDBytes ( kIOMMCDeviceInterfaceID ),
- ( LPVOID ) &mmcInterface );
-
- if ( herr != S_OK ) {
- printf("QueryInterface returned %ld\n", herr);
- return;
- }
-
- p_env->pp_scsiTaskDeviceInterface =
- ( *mmcInterface )->GetSCSITaskDeviceInterface ( mmcInterface );
-
- if ( NULL == p_env->pp_scsiTaskDeviceInterface ) {
- printf("GetSCSITaskDeviceInterface returned NULL\n");
- return;
- }
-
- ( *mmcInterface )->Release ( mmcInterface );
- IODestroyPlugInInterface ( plugInInterface );
-}
-#endif
-
-/*!
- Read and cache the CD's Track Table of Contents and track info.
- Return false if successful or true if an error.
-*/
-static bool
-read_toc_osx (void *p_user_data)
-{
- _img_private_t *p_env = p_user_data;
- CFDictionaryRef propertiesDict = 0;
- CFDataRef data;
-
- /* create a CF dictionary containing the TOC */
- propertiesDict = GetRegistryEntryProperties( p_env->MediaClass_service );
-
- if ( 0 == propertiesDict ) {
- return false;
- }
-
- /* get the TOC from the dictionary */
- data = (CFDataRef) CFDictionaryGetValue( propertiesDict,
- CFSTR(kIOCDMediaTOCKey) );
- if ( data != NULL ) {
- CFRange range;
- CFIndex buf_len;
-
- buf_len = CFDataGetLength( data ) + 1;
- range = CFRangeMake( 0, buf_len );
-
- if( ( p_env->pTOC = (CDTOC *)malloc( buf_len ) ) != NULL ) {
- CFDataGetBytes( data, range, (u_char *) p_env->pTOC );
- } else {
- cdio_warn( "Trouble allocating CDROM TOC" );
- return false;
- }
- } else {
- cdio_warn( "Trouble reading TOC" );
- return false;
- }
-
- /* TestDevice(p_env, service); */
- CFRelease( propertiesDict );
-
- p_env->i_descriptors = CDTOCGetDescriptorCount ( p_env->pTOC );
-
- /* Read in starting sectors. There may be non-tracks mixed in with
- the real tracks. So find the first and last track number by
- scanning. Also find the lead-out track position.
- */
- {
- int i, i_leadout = -1;
-
- CDTOCDescriptor *pTrackDescriptors;
-
- p_env->pp_lba = malloc( p_env->i_descriptors * sizeof(int) );
- if( p_env->pp_lba == NULL )
- {
- cdio_warn("Out of memory in allocating track starting LSNs" );
- free( p_env->pTOC );
- return false;
- }
-
- pTrackDescriptors = p_env->pTOC->descriptors;
-
- p_env->gen.i_first_track = CDIO_CD_MAX_TRACKS+1;
- p_env->i_last_track = CDIO_CD_MIN_TRACK_NO;
- p_env->i_first_session = CDIO_CD_MAX_TRACKS+1;
- p_env->i_last_session = CDIO_CD_MIN_TRACK_NO;
-
- for( i = 0; i <= p_env->i_descriptors; i++ )
- {
- track_t i_track = pTrackDescriptors[i].point;
- session_t i_session = pTrackDescriptors[i].session;
-
- cdio_debug( "point: %d, tno: %d, session: %d, adr: %d, control:%d, "
- "address: %d:%d:%d, p: %d:%d:%d",
- i_track,
- pTrackDescriptors[i].tno, i_session,
- pTrackDescriptors[i].adr, pTrackDescriptors[i].control,
- pTrackDescriptors[i].address.minute,
- pTrackDescriptors[i].address.second,
- pTrackDescriptors[i].address.frame,
- pTrackDescriptors[i].p.minute,
- pTrackDescriptors[i].p.second,
- pTrackDescriptors[i].p.frame );
-
- /* track information has adr = 1 */
- if ( 0x01 != pTrackDescriptors[i].adr )
- continue;
-
- if( i_track == OSX_CDROM_LEADOUT_TRACK )
- i_leadout = i;
-
- if( i_track > CDIO_CD_MAX_TRACKS || i_track < CDIO_CD_MIN_TRACK_NO )
- continue;
-
- if (p_env->gen.i_first_track > i_track)
- p_env->gen.i_first_track = i_track;
-
- if (p_env->i_last_track < i_track)
- p_env->i_last_track = i_track;
-
- if (p_env->i_first_session > i_session)
- p_env->i_first_session = i_session;
-
- if (p_env->i_last_session < i_session)
- p_env->i_last_session = i_session;
- }
-
- /* Now that we know what the first track number is, we can make sure
- index positions are ordered starting at 0.
- */
- for( i = 0; i <= p_env->i_descriptors; i++ )
- {
- track_t i_track = pTrackDescriptors[i].point;
-
- if( i_track > CDIO_CD_MAX_TRACKS || i_track < CDIO_CD_MIN_TRACK_NO )
- continue;
-
- /* Note what OSX calls a LBA we call an LSN. So below re we
- really have have MSF -> LSN -> LBA.
- */
- p_env->pp_lba[i_track - p_env->gen.i_first_track] =
- cdio_lsn_to_lba(CDConvertMSFToLBA( pTrackDescriptors[i].p ));
- }
-
- if( i_leadout == -1 )
- {
- cdio_warn( "CD leadout not found" );
- free( p_env->pp_lba );
- free( (void *) p_env->pTOC );
- return false;
- }
-
- /* Set leadout sector.
- Note what OSX calls a LBA we call an LSN. So below re we
- really have have MSF -> LSN -> LBA.
- */
- p_env->pp_lba[TOTAL_TRACKS] =
- cdio_lsn_to_lba(CDConvertMSFToLBA( pTrackDescriptors[i_leadout].p ));
- p_env->gen.i_tracks = TOTAL_TRACKS;
- }
-
- p_env->gen.toc_init = true;
-
- return( true );
-
-}
-
-/*!
- Return the starting LSN track number
- i_track in obj. Track numbers start at 1.
- The "leadout" track is specified either by
- using i_track LEADOUT_TRACK or the total tracks+1.
- False is returned if there is no track entry.
-*/
-static lsn_t
-get_track_lba_osx(void *p_user_data, track_t i_track)
-{
- _img_private_t *p_env = p_user_data;
-
- if (!p_env->gen.toc_init) read_toc_osx (p_env) ;
- if (!p_env->gen.toc_init) return CDIO_INVALID_LSN;
-
- if (i_track == CDIO_CDROM_LEADOUT_TRACK) i_track = p_env->i_last_track+1;
-
- if (i_track > p_env->i_last_track + 1 || i_track < p_env->gen.i_first_track) {
- return CDIO_INVALID_LSN;
- } else {
- return p_env->pp_lba[i_track - p_env->gen.i_first_track];
- }
-}
-
-/*!
- Eject media . Return 1 if successful, 0 otherwise.
-
- The only way to cleanly unmount the disc under MacOS X is to use the
- 'disktool' command line utility. It uses the non-public Disk
- Arbitration API, which can not be used by Cocoa or Carbon
- applications.
-
- */
-
-static int
-_eject_media_osx (void *user_data) {
-
- _img_private_t *p_env = user_data;
-
- FILE *p_eject;
- char *psz_disk;
- char sz_cmd[32];
-
- if( ( psz_disk = (char *)strstr( p_env->gen.source_name, "disk" ) ) != NULL &&
- strlen( psz_disk ) > 4 )
- {
-#define EJECT_CMD "/usr/sbin/hdiutil eject %s"
- snprintf( sz_cmd, sizeof(sz_cmd), EJECT_CMD, psz_disk );
-#undef EJECT_CMD
-
- if( ( p_eject = popen( sz_cmd, "r" ) ) != NULL )
- {
- char psz_result[0x200];
- int i_ret = fread( psz_result, 1, sizeof(psz_result) - 1, p_eject );
-
- if( i_ret == 0 && ferror( p_eject ) != 0 )
- {
- pclose( p_eject );
- return 0;
- }
-
- pclose( p_eject );
-
- psz_result[ i_ret ] = 0;
-
- if( strstr( psz_result, "Disk Ejected" ) != NULL )
- {
- return 1;
- }
- }
- }
-
- return 0;
-}
-
-/*!
- Return the size of the CD in logical block address (LBA) units.
- */
-static uint32_t
-_stat_size_osx (void *user_data)
-{
- return get_track_lba_osx(user_data, CDIO_CDROM_LEADOUT_TRACK);
-}
-
-/*!
- Return the value associated with the key "arg".
-*/
-static const char *
-_get_arg_osx (void *user_data, const char key[])
-{
- _img_private_t *p_env = user_data;
-
- if (!strcmp (key, "source")) {
- return p_env->gen.source_name;
- } else if (!strcmp (key, "access-mode")) {
- switch (p_env->access_mode) {
- case _AM_OSX:
- return "OS X";
- case _AM_NONE:
- return "no access method";
- }
- }
- return NULL;
-}
-
-/*!
- Return the media catalog number MCN.
- */
-static char *
-get_mcn_osx (const void *user_data) {
- const _img_private_t *p_env = user_data;
- dk_cd_read_mcn_t cd_read;
-
- memset( &cd_read, 0, sizeof(cd_read) );
-
- if( ioctl( p_env->gen.fd, DKIOCCDREADMCN, &cd_read ) < 0 )
- {
- cdio_debug( "could not read MCN, %s", strerror(errno) );
- return NULL;
- }
- return strdup((char*)cd_read.mcn);
-}
-
-
-/*!
- Get format of track.
-*/
-static track_format_t
-get_track_format_osx(void *user_data, track_t i_track)
-{
- _img_private_t *p_env = user_data;
- dk_cd_read_track_info_t cd_read;
- CDTrackInfo a_track;
-
- if (!p_env->gen.toc_init) read_toc_osx (p_env) ;
-
- if (i_track > p_env->i_last_track || i_track < p_env->gen.i_first_track)
- return TRACK_FORMAT_ERROR;
-
- memset( &cd_read, 0, sizeof(cd_read) );
-
- cd_read.address = i_track;
- cd_read.addressType = kCDTrackInfoAddressTypeTrackNumber;
-
- cd_read.buffer = &a_track;
- cd_read.bufferLength = sizeof(CDTrackInfo);
-
- if( ioctl( p_env->gen.fd, DKIOCCDREADTRACKINFO, &cd_read ) == -1 )
- {
- cdio_warn( "could not read trackinfo for track %d", i_track );
- return TRACK_FORMAT_ERROR;
- }
-
- cdio_debug( "%d: trackinfo trackMode: %x dataMode: %x", i_track, a_track.trackMode, a_track.dataMode );
-
- if (a_track.trackMode == CDIO_CDROM_DATA_TRACK) {
- if (a_track.dataMode == CDROM_CDI_TRACK) {
- return TRACK_FORMAT_CDI;
- } else if (a_track.dataMode == CDROM_XA_TRACK) {
- return TRACK_FORMAT_XA;
- } else {
- return TRACK_FORMAT_DATA;
- }
- } else {
- return TRACK_FORMAT_AUDIO;
- }
-
-}
-
-/*!
- Return true if we have XA data (green, mode2 form1) or
- XA data (green, mode2 form2). That is track begins:
- sync - header - subheader
- 12 4 - 8
-
- FIXME: there's gotta be a better design for this and get_track_format?
-*/
-static bool
-get_track_green_osx(void *user_data, track_t i_track)
-{
- _img_private_t *p_env = user_data;
- CDTrackInfo a_track;
-
- if (!p_env->gen.toc_init) read_toc_osx (p_env) ;
-
- if ( i_track > p_env->i_last_track || i_track < p_env->gen.i_first_track )
- return false;
-
- else {
-
- dk_cd_read_track_info_t cd_read;
-
- memset( &cd_read, 0, sizeof(cd_read) );
-
- cd_read.address = i_track;
- cd_read.addressType = kCDTrackInfoAddressTypeTrackNumber;
-
- cd_read.buffer = &a_track;
- cd_read.bufferLength = sizeof(CDTrackInfo);
-
- if( ioctl( p_env->gen.fd, DKIOCCDREADTRACKINFO, &cd_read ) == -1 ) {
- cdio_warn( "could not read trackinfo for track %d", i_track );
- return false;
- }
- return ((a_track.trackMode & CDIO_CDROM_DATA_TRACK) != 0);
- }
-}
-
-#endif /* HAVE_DARWIN_CDROM */
-
-/*!
- Return a string containing the default CD device if none is specified.
- */
-char **
-cdio_get_devices_osx(void)
-{
-#ifndef HAVE_DARWIN_CDROM
- return NULL;
-#else
- io_object_t next_media;
- mach_port_t master_port;
- kern_return_t kern_result;
- io_iterator_t media_iterator;
- CFMutableDictionaryRef classes_to_match;
- char **drives = NULL;
- unsigned int num_drives=0;
-
- kern_result = IOMasterPort( MACH_PORT_NULL, &master_port );
- if( kern_result != KERN_SUCCESS )
- {
- return( NULL );
- }
-
- classes_to_match = IOServiceMatching( kIOCDMediaClass );
- if( classes_to_match == NULL )
- {
- return( NULL );
- }
-
- CFDictionarySetValue( classes_to_match, CFSTR(kIOMediaEjectableKey),
- kCFBooleanTrue );
-
- kern_result = IOServiceGetMatchingServices( master_port,
- classes_to_match,
- &media_iterator );
- if( kern_result != KERN_SUCCESS )
- {
- return( NULL );
- }
-
- next_media = IOIteratorNext( media_iterator );
- if( next_media != 0 )
- {
- char psz_buf[0x32];
- size_t dev_path_length;
- CFTypeRef str_bsd_path;
-
- do
- {
- str_bsd_path = IORegistryEntryCreateCFProperty( next_media,
- CFSTR( kIOBSDNameKey ),
- kCFAllocatorDefault,
- 0 );
- if( str_bsd_path == NULL )
- {
- IOObjectRelease( next_media );
- continue;
- }
-
- snprintf( psz_buf, sizeof(psz_buf), "%s%c", _PATH_DEV, 'r' );
- dev_path_length = strlen( psz_buf );
-
- if( CFStringGetCString( str_bsd_path,
- (char*)&psz_buf + dev_path_length,
- sizeof(psz_buf) - dev_path_length,
- kCFStringEncodingASCII ) )
- {
- CFRelease( str_bsd_path );
- IOObjectRelease( next_media );
- IOObjectRelease( media_iterator );
- cdio_add_device_list(&drives, strdup(psz_buf), &num_drives);
- }
-
- CFRelease( str_bsd_path );
- IOObjectRelease( next_media );
-
- } while( ( next_media = IOIteratorNext( media_iterator ) ) != 0 );
- }
- IOObjectRelease( media_iterator );
- cdio_add_device_list(&drives, NULL, &num_drives);
- return drives;
-#endif /* HAVE_DARWIN_CDROM */
-}
-
-/*!
- Return a string containing the default CD device if none is specified.
- */
-char *
-cdio_get_default_device_osx(void)
-{
-#ifndef HAVE_DARWIN_CDROM
- return NULL;
-#else
- io_object_t next_media;
- mach_port_t master_port;
- kern_return_t kern_result;
- io_iterator_t media_iterator;
- CFMutableDictionaryRef classes_to_match;
-
- kern_result = IOMasterPort( MACH_PORT_NULL, &master_port );
- if( kern_result != KERN_SUCCESS )
- {
- return( NULL );
- }
-
- classes_to_match = IOServiceMatching( kIOCDMediaClass );
- if( classes_to_match == NULL )
- {
- return( NULL );
- }
-
- CFDictionarySetValue( classes_to_match, CFSTR(kIOMediaEjectableKey),
- kCFBooleanTrue );
-
- kern_result = IOServiceGetMatchingServices( master_port,
- classes_to_match,
- &media_iterator );
- if( kern_result != KERN_SUCCESS )
- {
- return( NULL );
- }
-
- next_media = IOIteratorNext( media_iterator );
- if( next_media != 0 )
- {
- char psz_buf[0x32];
- size_t dev_path_length;
- CFTypeRef str_bsd_path;
-
- do
- {
- str_bsd_path = IORegistryEntryCreateCFProperty( next_media,
- CFSTR( kIOBSDNameKey ),
- kCFAllocatorDefault,
- 0 );
- if( str_bsd_path == NULL )
- {
- IOObjectRelease( next_media );
- continue;
- }
-
- snprintf( psz_buf, sizeof(psz_buf), "%s%c", _PATH_DEV, 'r' );
- dev_path_length = strlen( psz_buf );
-
- if( CFStringGetCString( str_bsd_path,
- (char*)&psz_buf + dev_path_length,
- sizeof(psz_buf) - dev_path_length,
- kCFStringEncodingASCII ) )
- {
- CFRelease( str_bsd_path );
- IOObjectRelease( next_media );
- IOObjectRelease( media_iterator );
- return strdup( psz_buf );
- }
-
- CFRelease( str_bsd_path );
- IOObjectRelease( next_media );
-
- } while( ( next_media = IOIteratorNext( media_iterator ) ) != 0 );
- }
- IOObjectRelease( media_iterator );
- return NULL;
-#endif /* HAVE_DARWIN_CDROM */
-}
-
-/*!
- Initialization routine. This is the only thing that doesn't
- get called via a function pointer. In fact *we* are the
- ones to set that up.
- */
-CdIo *
-cdio_open_am_osx (const char *psz_source_name, const char *psz_access_mode)
-{
-
- if (psz_access_mode != NULL)
- cdio_warn ("there is only one access mode for OS X. Arg %s ignored",
- psz_access_mode);
- return cdio_open_osx(psz_source_name);
-}
-
-
-/*!
- Initialization routine. This is the only thing that doesn't
- get called via a function pointer. In fact *we* are the
- ones to set that up.
- */
-CdIo *
-cdio_open_osx (const char *psz_orig_source)
-{
-
-#ifdef HAVE_DARWIN_CDROM
- CdIo *ret;
- _img_private_t *_data;
- char *psz_source;
-
- cdio_funcs _funcs = {
- .eject_media = _eject_media_osx,
- .free = _free_osx,
- .get_arg = _get_arg_osx,
- .get_cdtext = get_cdtext_osx,
- .get_default_device = cdio_get_default_device_osx,
- .get_devices = cdio_get_devices_osx,
- .get_discmode = get_discmode_osx,
- .get_drive_cap = get_drive_cap_osx,
- .get_first_track_num= get_first_track_num_generic,
- .get_hwinfo = get_hwinfo_osx,
- .get_mcn = get_mcn_osx,
- .get_num_tracks = get_num_tracks_generic,
- .get_track_format = get_track_format_osx,
- .get_track_green = get_track_green_osx,
- .get_track_lba = get_track_lba_osx,
- .get_track_msf = NULL,
- .lseek = cdio_generic_lseek,
- .read = cdio_generic_read,
- .read_audio_sectors = _get_read_audio_sectors_osx,
- .read_mode1_sector = _get_read_mode1_sector_osx,
- .read_mode1_sectors = _get_read_mode1_sectors_osx,
- .read_mode2_sector = _get_read_mode2_sector_osx,
- .read_mode2_sectors = _get_read_mode2_sectors_osx,
- .read_toc = read_toc_osx,
- .run_scsi_mmc_cmd = run_scsi_cmd_osx,
- .set_arg = _set_arg_osx,
- .stat_size = _stat_size_osx
- };
-
- _data = _cdio_malloc (sizeof (_img_private_t));
- _data->access_mode = _AM_OSX;
- _data->MediaClass_service = 0;
- _data->gen.init = false;
- _data->gen.fd = -1;
- _data->gen.toc_init = false;
- _data->gen.b_cdtext_init = false;
- _data->gen.b_cdtext_error = false;
-
- if (NULL == psz_orig_source) {
- psz_source=cdio_get_default_device_osx();
- if (NULL == psz_source) return NULL;
- _set_arg_osx(_data, "source", psz_source);
- free(psz_source);
- } else {
- if (cdio_is_device_generic(psz_orig_source))
- _set_arg_osx(_data, "source", psz_orig_source);
- else {
- /* The below would be okay if all device drivers worked this way. */
-#if 0
- cdio_info ("source %s is a not a device", psz_orig_source);
-#endif
- return NULL;
- }
- }
-
- ret = cdio_new ((void *)_data, &_funcs);
- if (ret == NULL) return NULL;
-
- if (cdio_generic_init(_data) && init_osx(_data))
- return ret;
- else {
- cdio_generic_free (_data);
- return NULL;
- }
-
-#else
- return NULL;
-#endif /* HAVE_DARWIN_CDROM */
-
-}
-
-bool
-cdio_have_osx (void)
-{
-#ifdef HAVE_DARWIN_CDROM
- return true;
-#else
- return false;
-#endif /* HAVE_DARWIN_CDROM */
-}
diff --git a/src/input/vcd/libcdio/_cdio_stdio.c b/src/input/vcd/libcdio/_cdio_stdio.c
deleted file mode 100644
index 0083b2194..000000000
--- a/src/input/vcd/libcdio/_cdio_stdio.c
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- $Id: _cdio_stdio.c,v 1.2 2004/04/11 12:20:31 miguelfreitas Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
- Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/stat.h>
-#include <errno.h>
-
-#include <cdio/logging.h>
-#include <cdio/util.h>
-#include "_cdio_stream.h"
-#include "_cdio_stdio.h"
-
-static const char _rcsid[] = "$Id: _cdio_stdio.c,v 1.2 2004/04/11 12:20:31 miguelfreitas Exp $";
-
-#define CDIO_STDIO_BUFSIZE (128*1024)
-
-typedef struct {
- char *pathname;
- FILE *fd;
- char *fd_buf;
- off_t st_size; /* used only for source */
-} _UserData;
-
-static int
-_stdio_open (void *user_data)
-{
- _UserData *const ud = user_data;
-
- if ((ud->fd = fopen (ud->pathname, "rb")))
- {
- ud->fd_buf = _cdio_malloc (CDIO_STDIO_BUFSIZE);
- setvbuf (ud->fd, ud->fd_buf, _IOFBF, CDIO_STDIO_BUFSIZE);
- }
-
- return (ud->fd == NULL);
-}
-
-static int
-_stdio_close(void *user_data)
-{
- _UserData *const ud = user_data;
-
- if (fclose (ud->fd))
- cdio_error ("fclose (): %s", strerror (errno));
-
- ud->fd = NULL;
-
- free (ud->fd_buf);
- ud->fd_buf = NULL;
-
- return 0;
-}
-
-static void
-_stdio_free(void *user_data)
-{
- _UserData *const ud = user_data;
-
- if (ud->pathname)
- free(ud->pathname);
-
- if (ud->fd) /* should be NULL anyway... */
- _stdio_close(user_data);
-
- free(ud);
-}
-
-/*!
- Like fseek(3) and in fact may be the same.
-
- This function sets the file position indicator for the stream
- pointed to by stream. The new position, measured in bytes, is obtained
- by adding offset bytes to the position specified by whence. If whence
- is set to SEEK_SET, SEEK_CUR, or SEEK_END, the offset is relative to
- the start of the file, the current position indicator, or end-of-file,
- respectively. A successful call to the fseek function clears the end-
- of-file indicator for the stream and undoes any effects of the
- ungetc(3) function on the same stream.
-
- RETURN VALUE
- Upon successful completion, return 0,
- Otherwise, -1 is returned and the global variable errno is set to indi-
- cate the error.
-*/
-static long
-_stdio_seek(void *user_data, long offset, int whence)
-{
- _UserData *const ud = user_data;
-
- if ( (offset=fseek (ud->fd, offset, whence)) ) {
- cdio_error ("fseek (): %s", strerror (errno));
- }
-
- return offset;
-}
-
-static long int
-_stdio_stat(void *user_data)
-{
- const _UserData *const ud = user_data;
-
- return ud->st_size;
-}
-
-/*!
- Like fread(3) and in fact is about the same.
-
- DESCRIPTION:
- The function fread reads nmemb elements of data, each size bytes long,
- from the stream pointed to by stream, storing them at the location
- given by ptr.
-
- RETURN VALUE:
- return the number of items successfully read or written (i.e.,
- not the number of characters). If an error occurs, or the
- end-of-file is reached, the return value is a short item count
- (or zero).
-
- We do not distinguish between end-of-file and error, and callers
- must use feof(3) and ferror(3) to determine which occurred.
- */
-static long
-_stdio_read(void *user_data, void *buf, long int count)
-{
- _UserData *const ud = user_data;
- long read;
-
- read = fread(buf, 1, count, ud->fd);
-
- if (read != count)
- { /* fixme -- ferror/feof */
- if (feof (ud->fd))
- {
- cdio_debug ("fread (): EOF encountered");
- clearerr (ud->fd);
- }
- else if (ferror (ud->fd))
- {
- cdio_error ("fread (): %s", strerror (errno));
- clearerr (ud->fd);
- }
- else
- cdio_debug ("fread (): short read and no EOF?!?");
- }
-
- return read;
-}
-
-/*!
- Deallocate resources assocaited with obj. After this obj is unusable.
-*/
-void
-cdio_stdio_destroy(CdioDataSource *obj)
-{
- cdio_stream_destroy(obj);
-}
-
-CdioDataSource*
-cdio_stdio_new(const char pathname[])
-{
- CdioDataSource *new_obj = NULL;
- cdio_stream_io_functions funcs = { 0, };
- _UserData *ud = NULL;
- struct stat statbuf;
-
- if (stat (pathname, &statbuf) == -1)
- {
- cdio_warn ("could not retrieve file info for `%s': %s",
- pathname, strerror (errno));
- return NULL;
- }
-
- ud = _cdio_malloc (sizeof (_UserData));
-
- ud->pathname = strdup(pathname);
- ud->st_size = statbuf.st_size; /* let's hope it doesn't change... */
-
- funcs.open = _stdio_open;
- funcs.seek = _stdio_seek;
- funcs.stat = _stdio_stat;
- funcs.read = _stdio_read;
- funcs.close = _stdio_close;
- funcs.free = _stdio_free;
-
- new_obj = cdio_stream_new(ud, &funcs);
-
- return new_obj;
-}
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libcdio/_cdio_stdio.h b/src/input/vcd/libcdio/_cdio_stdio.h
deleted file mode 100644
index f5e79c41c..000000000
--- a/src/input/vcd/libcdio/_cdio_stdio.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- $Id: _cdio_stdio.h,v 1.2 2004/04/11 12:20:31 miguelfreitas Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
- Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-
-#ifndef __CDIO_STDIO_H__
-#define __CDIO_STDIO_H__
-
-#include "_cdio_stream.h"
-
-/*!
- Initialize a new stdio stream reading from pathname.
- A pointer to the stream is returned or NULL if there was an error.
-
- cdio_stream_free should be called on the returned value when you
- don't need the stream any more. No other finalization is needed.
- */
-CdioDataSource* cdio_stdio_new(const char pathname[]);
-
-/*!
- Deallocate resources assocaited with obj. After this obj is unusable.
-*/
-void cdio_stdio_destroy(CdioDataSource *obj);
-
-
-#endif /* __CDIO_STREAM_STDIO_H__ */
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libcdio/_cdio_stream.c b/src/input/vcd/libcdio/_cdio_stream.c
deleted file mode 100644
index d3b9e0ade..000000000
--- a/src/input/vcd/libcdio/_cdio_stream.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- $Id: _cdio_stream.c,v 1.2 2004/04/11 12:20:31 miguelfreitas Exp $
-
- Copyright (C) 2000, 2004 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
-#include "cdio_assert.h"
-
-/* #define STREAM_DEBUG */
-
-#include <cdio/logging.h>
-#include <cdio/util.h>
-#include "_cdio_stream.h"
-
-static const char _rcsid[] = "$Id: _cdio_stream.c,v 1.2 2004/04/11 12:20:31 miguelfreitas Exp $";
-
-/*
- * DataSource implementations
- */
-
-struct _CdioDataSource {
- void* user_data;
- cdio_stream_io_functions op;
- int is_open;
- long position;
-};
-
-/*
- Open if not already open.
- Return false if we hit an error. Errno should be set for that error.
-*/
-static bool
-_cdio_stream_open_if_necessary(CdioDataSource *obj)
-{
- cdio_assert (obj != NULL);
-
- if (!obj->is_open) {
- if ((obj->op.open) (obj->user_data)) {
- cdio_warn ("could not open input stream...");
- return false;
- } else {
- cdio_debug ("opened source...");
- obj->is_open = 1;
- obj->position = 0;
- }
- }
- return true;
-}
-
-/*!
- Like 3 fseek and in fact may be the same.
-
- This function sets the file position indicator for the stream
- pointed to by stream. The new position, measured in bytes, is obtained
- by adding offset bytes to the position specified by whence. If whence
- is set to SEEK_SET, SEEK_CUR, or SEEK_END, the offset is relative to
- the start of the file, the current position indicator, or end-of-file,
- respectively. A successful call to the fseek function clears the end-
- of-file indicator for the stream and undoes any effects of the
- ungetc(3) function on the same stream.
-
- RETURN VALUE
- Upon successful completion, return 0,
- Otherwise, -1 is returned and the global variable errno is set to indi-
- cate the error.
-*/
-long
-cdio_stream_seek(CdioDataSource* obj, long offset, int whence)
-{
- cdio_assert (obj != NULL);
-
- if (!_cdio_stream_open_if_necessary(obj))
- /* errno is set by _cdio_stream_open_if necessary. */
- return -1;
-
- if (obj->position != offset) {
-#ifdef STREAM_DEBUG
- cdio_warn("had to reposition DataSource from %ld to %ld!", obj->position, offset);
-#endif
- obj->position = offset;
- return obj->op.seek(obj->user_data, offset, whence);
- }
-
- return 0;
-}
-
-CdioDataSource*
-cdio_stream_new(void *user_data, const cdio_stream_io_functions *funcs)
-{
- CdioDataSource *new_obj;
-
- new_obj = _cdio_malloc (sizeof (CdioDataSource));
-
- new_obj->user_data = user_data;
- memcpy(&(new_obj->op), funcs, sizeof(cdio_stream_io_functions));
-
- return new_obj;
-}
-
-/*!
- Like fread(3) and in fact may be the same.
-
- DESCRIPTION:
- The function fread reads nmemb elements of data, each size bytes long,
- from the stream pointed to by stream, storing them at the location
- given by ptr.
-
- RETURN VALUE:
- return the number of items successfully read or written (i.e.,
- not the number of characters). If an error occurs, or the
- end-of-file is reached, the return value is a short item count
- (or zero).
-
- We do not distinguish between end-of-file and error, and callers
- must use feof(3) and ferror(3) to determine which occurred.
-*/
-long
-cdio_stream_read(CdioDataSource* obj, void *ptr, long size, long nmemb)
-{
- long read_bytes;
-
- cdio_assert (obj != NULL);
-
- if (!_cdio_stream_open_if_necessary(obj)) return 0;
-
- read_bytes = obj->op.read(obj->user_data, ptr, size*nmemb);
- obj->position += read_bytes;
-
- return read_bytes;
-}
-
-/*!
- Return whatever size of stream reports, I guess unit size is bytes.
- On error return -1;
- */
-long int
-cdio_stream_stat(CdioDataSource* obj)
-{
- cdio_assert (obj != NULL);
-
- if (!_cdio_stream_open_if_necessary(obj)) return -1;
-
- return obj->op.stat(obj->user_data);
-}
-
-void
-cdio_stream_close(CdioDataSource* obj)
-{
- cdio_assert (obj != NULL);
-
- if (obj->is_open) {
- cdio_debug ("closed source...");
- obj->op.close(obj->user_data);
- obj->is_open = 0;
- obj->position = 0;
- }
-}
-
-void
-cdio_stream_destroy(CdioDataSource* obj)
-{
- cdio_assert (obj != NULL);
-
- cdio_stream_close(obj);
-
- obj->op.free(obj->user_data);
-
- free(obj);
-}
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libcdio/_cdio_stream.h b/src/input/vcd/libcdio/_cdio_stream.h
deleted file mode 100644
index ffbb4098e..000000000
--- a/src/input/vcd/libcdio/_cdio_stream.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- $Id: _cdio_stream.h,v 1.2 2004/04/11 12:20:31 miguelfreitas Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
- Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-
-#ifndef __CDIO_STREAM_H__
-#define __CDIO_STREAM_H__
-
-#include <cdio/types.h>
-#include "cdio_private.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
- /* typedef'ed IO functions prototypes */
-
- typedef int(*cdio_data_open_t)(void *user_data);
-
- typedef long(*cdio_data_read_t)(void *user_data, void *buf, long count);
-
- typedef long(*cdio_data_seek_t)(void *user_data, long offset, int whence);
-
- typedef long(*cdio_data_stat_t)(void *user_data);
-
- typedef int(*cdio_data_close_t)(void *user_data);
-
- typedef void(*cdio_data_free_t)(void *user_data);
-
-
- /* abstract data source */
-
- typedef struct {
- cdio_data_open_t open;
- cdio_data_seek_t seek;
- cdio_data_stat_t stat;
- cdio_data_read_t read;
- cdio_data_close_t close;
- cdio_data_free_t free;
- } cdio_stream_io_functions;
-
- CdioDataSource*
- cdio_stream_new(void *user_data, const cdio_stream_io_functions *funcs);
-
- /*!
- Like fread(3) and in fact may be the same.
-
- DESCRIPTION:
- The function fread reads nmemb elements of data, each size bytes long,
- from the stream pointed to by stream, storing them at the location
- given by ptr.
-
- RETURN VALUE:
- return the number of items successfully read or written (i.e.,
- not the number of characters). If an error occurs, or the
- end-of-file is reached, the return value is a short item count
- (or zero).
-
- We do not distinguish between end-of-file and error, and callers
- must use feof(3) and ferror(3) to determine which occurred.
- */
- long
- cdio_stream_read(CdioDataSource* obj, void *ptr, long size, long nmemb);
-
- /*!
- Like fseek(3) and in fact may be the same.
-
- This function sets the file position indicator for the stream
- pointed to by stream. The new position, measured in bytes, is obtained
- by adding offset bytes to the position specified by whence. If whence
- is set to SEEK_SET, SEEK_CUR, or SEEK_END, the offset is relative to
- the start of the file, the current position indicator, or end-of-file,
- respectively. A successful call to the fseek function clears the end-
- of-file indicator for the stream and undoes any effects of the
- ungetc(3) function on the same stream.
-
- RETURN VALUE
- Upon successful completion, return 0,
- Otherwise, -1 is returned and the global variable errno is set to indi-
- cate the error.
- */
- long int cdio_stream_seek(CdioDataSource* obj, long offset, int whence);
-
- /*!
- Return whatever size of stream reports, I guess unit size is bytes.
- On error return -1;
- */
- long int cdio_stream_stat(CdioDataSource* obj);
-
- /*!
- Deallocate resources assocaited with obj. After this obj is unusable.
- */
- void cdio_stream_destroy(CdioDataSource* obj);
-
- void cdio_stream_close(CdioDataSource* obj);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __CDIO_STREAM_H__ */
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libcdio/_cdio_sunos.c b/src/input/vcd/libcdio/_cdio_sunos.c
deleted file mode 100644
index 245d1e319..000000000
--- a/src/input/vcd/libcdio/_cdio_sunos.c
+++ /dev/null
@@ -1,917 +0,0 @@
-/*
- $Id: _cdio_sunos.c,v 1.3 2005/01/01 02:43:57 rockyb Exp $
-
- Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
- Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-#include <cdio/logging.h>
-#include <cdio/sector.h>
-#include <cdio/util.h>
-#include <cdio/scsi_mmc.h>
-#include "cdio_assert.h"
-#include "cdio_private.h"
-
-#define DEFAULT_CDIO_DEVICE "/vol/dev/aliases/cdrom0"
-
-#ifdef HAVE_SOLARIS_CDROM
-
-static const char _rcsid[] = "$Id: _cdio_sunos.c,v 1.3 2005/01/01 02:43:57 rockyb Exp $";
-
-#ifdef HAVE_GLOB_H
-#include <glob.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-
-#ifdef HAVE_SYS_CDIO_H
-# include <sys/cdio.h> /* CDIOCALLOW etc... */
-#else
-#error "You need <sys/cdio.h> to have CDROM support"
-#endif
-
-#include <sys/dkio.h>
-#include <sys/scsi/generic/commands.h>
-#include <sys/scsi/impl/uscsi.h>
-
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include "cdtext_private.h"
-
-/* not defined in dkio.h yet */
-#define DK_DVDRW 0x13
-
-/* reader */
-
-typedef enum {
- _AM_NONE,
- _AM_SUN_CTRL_ATAPI,
- _AM_SUN_CTRL_SCSI
-#if FINISHED
- _AM_READ_CD,
- _AM_READ_10
-#endif
-} access_mode_t;
-
-
-typedef struct {
- /* Things common to all drivers like this.
- This must be first. */
- generic_img_private_t gen;
-
- access_mode_t access_mode;
-
- /* Some of the more OS specific things. */
- /* Entry info for each track, add 1 for leadout. */
- struct cdrom_tocentry tocent[CDIO_CD_MAX_TRACKS+1];
-
- /* Track information */
- struct cdrom_tochdr tochdr;
-} _img_private_t;
-
-static track_format_t get_track_format_solaris(void *p_user_data,
- track_t i_track);
-
-static access_mode_t
-str_to_access_mode_sunos(const char *psz_access_mode)
-{
- const access_mode_t default_access_mode = _AM_SUN_CTRL_SCSI;
-
- if (NULL==psz_access_mode) return default_access_mode;
-
- if (!strcmp(psz_access_mode, "ATAPI"))
- return _AM_SUN_CTRL_SCSI; /* force ATAPI to be SCSI */
- else if (!strcmp(psz_access_mode, "SCSI"))
- return _AM_SUN_CTRL_SCSI;
- else {
- cdio_warn ("unknown access type: %s. Default SCSI used.",
- psz_access_mode);
- return default_access_mode;
- }
-}
-
-
-/*!
- Initialize CD device.
- */
-static bool
-init_solaris (_img_private_t *p_env)
-{
-
- if (!cdio_generic_init(p_env)) return false;
-
- p_env->access_mode = _AM_SUN_CTRL_SCSI;
-
- return true;
-}
-
-/*!
- Run a SCSI MMC command.
-
- p_user_data internal CD structure.
- i_timeout_ms time in milliseconds we will wait for the command
- to complete.
- i_cdb Size of p_cdb
- p_cdb CDB bytes.
- e_direction direction the transfer is to go.
- i_buf Size of buffer
- p_buf Buffer for data, both sending and receiving
-
- Return 0 if no error.
- */
-static int
-run_scsi_cmd_solaris( const void *p_user_data, unsigned int i_timeout_ms,
- unsigned int i_cdb, const scsi_mmc_cdb_t *p_cdb,
- scsi_mmc_direction_t e_direction,
- unsigned int i_buf, /*in/out*/ void *p_buf )
-{
- const _img_private_t *p_env = p_user_data;
- struct uscsi_cmd cgc;
-
- memset (&cgc, 0, sizeof (struct uscsi_cmd));
- cgc.uscsi_cdb = (caddr_t) p_cdb;
-
- cgc.uscsi_flags = SCSI_MMC_DATA_READ == e_direction ?
- USCSI_READ : USCSI_WRITE;
-
- cgc.uscsi_timeout = msecs2secs(i_timeout_ms);
- cgc.uscsi_bufaddr = p_buf;
- cgc.uscsi_buflen = i_buf;
- cgc.uscsi_cdblen = i_cdb;
-
- return ioctl(p_env->gen.fd, USCSICMD, &cgc);
-}
-
-/*!
- Reads audio sectors from CD device into data starting from lsn.
- Returns 0 if no error.
-
- May have to check size of nblocks. There may be a limit that
- can be read in one go, e.g. 25 blocks.
-*/
-
-static int
-_read_audio_sectors_solaris (void *p_user_data, void *data, lsn_t lsn,
- unsigned int nblocks)
-{
- struct cdrom_msf solaris_msf;
- msf_t _msf;
- struct cdrom_cdda cdda;
-
- _img_private_t *p_env = p_user_data;
-
- cdio_lba_to_msf (cdio_lsn_to_lba(lsn), &_msf);
- solaris_msf.cdmsf_min0 = cdio_from_bcd8(_msf.m);
- solaris_msf.cdmsf_sec0 = cdio_from_bcd8(_msf.s);
- solaris_msf.cdmsf_frame0 = cdio_from_bcd8(_msf.f);
-
- if (p_env->gen.ioctls_debugged == 75)
- cdio_debug ("only displaying every 75th ioctl from now on");
-
- if (p_env->gen.ioctls_debugged == 30 * 75)
- cdio_debug ("only displaying every 30*75th ioctl from now on");
-
- if (p_env->gen.ioctls_debugged < 75
- || (p_env->gen.ioctls_debugged < (30 * 75)
- && p_env->gen.ioctls_debugged % 75 == 0)
- || p_env->gen.ioctls_debugged % (30 * 75) == 0)
- cdio_debug ("reading %d", lsn);
-
- p_env->gen.ioctls_debugged++;
-
- cdda.cdda_addr = lsn;
- cdda.cdda_length = nblocks;
- cdda.cdda_data = (caddr_t) data;
- cdda.cdda_subcode = CDROM_DA_NO_SUBCODE;
-
- if (ioctl (p_env->gen.fd, CDROMCDDA, &cdda) == -1) {
- perror ("ioctl(..,CDROMCDDA,..)");
- return 1;
- /* exit (EXIT_FAILURE); */
- }
-
- return 0;
-}
-
-/*!
- Reads a single mode1 sector from cd device into data starting
- from lsn. Returns 0 if no error.
- */
-static int
-_read_mode1_sector_solaris (void *env, void *data, lsn_t lsn,
- bool b_form2)
-{
-
-#if FIXED
- do something here.
-#else
- return cdio_generic_read_form1_sector(env, data, lsn);
-#endif
-}
-
-/*!
- Reads nblocks of mode2 sectors from cd device into data starting
- from lsn.
- Returns 0 if no error.
- */
-static int
-_read_mode1_sectors_solaris (void *p_user_data, void *p_data, lsn_t lsn,
- bool b_form2, unsigned int nblocks)
-{
- _img_private_t *p_env = p_user_data;
- unsigned int i;
- int retval;
- unsigned int blocksize = b_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE;
-
- for (i = 0; i < nblocks; i++) {
- if ( (retval = _read_mode1_sector_solaris (p_env,
- ((char *)p_data) + (blocksize * i),
- lsn + i, b_form2)) )
- return retval;
- }
- return 0;
-}
-
-/*!
- Reads a single mode2 sector from cd device into data starting from lsn.
- Returns 0 if no error.
- */
-static int
-_read_mode2_sector_solaris (void *p_user_data, void *p_data, lsn_t lsn,
- bool b_form2)
-{
- char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, };
- struct cdrom_msf solaris_msf;
- msf_t _msf;
- int offset = 0;
- struct cdrom_cdxa cd_read;
-
- _img_private_t *p_env = p_user_data;
-
- cdio_lba_to_msf (cdio_lsn_to_lba(lsn), &_msf);
- solaris_msf.cdmsf_min0 = cdio_from_bcd8(_msf.m);
- solaris_msf.cdmsf_sec0 = cdio_from_bcd8(_msf.s);
- solaris_msf.cdmsf_frame0 = cdio_from_bcd8(_msf.f);
-
- if (p_env->gen.ioctls_debugged == 75)
- cdio_debug ("only displaying every 75th ioctl from now on");
-
- if (p_env->gen.ioctls_debugged == 30 * 75)
- cdio_debug ("only displaying every 30*75th ioctl from now on");
-
- if (p_env->gen.ioctls_debugged < 75
- || (p_env->gen.ioctls_debugged < (30 * 75)
- && p_env->gen.ioctls_debugged % 75 == 0)
- || p_env->gen.ioctls_debugged % (30 * 75) == 0)
- cdio_debug ("reading %2.2d:%2.2d:%2.2d",
- solaris_msf.cdmsf_min0, solaris_msf.cdmsf_sec0,
- solaris_msf.cdmsf_frame0);
-
- p_env->gen.ioctls_debugged++;
-
- /* Using CDROMXA ioctl will actually use the same uscsi command
- * as ATAPI, except we don't need to be root
- */
- offset = CDIO_CD_XA_SYNC_HEADER;
- cd_read.cdxa_addr = lsn;
- cd_read.cdxa_data = buf;
- cd_read.cdxa_length = 1;
- cd_read.cdxa_format = CDROM_XA_SECTOR_DATA;
- if (ioctl (p_env->gen.fd, CDROMCDXA, &cd_read) == -1) {
- perror ("ioctl(..,CDROMCDXA,..)");
- return 1;
- /* exit (EXIT_FAILURE); */
- }
-
- if (b_form2)
- memcpy (p_data, buf + (offset-CDIO_CD_SUBHEADER_SIZE), M2RAW_SECTOR_SIZE);
- else
- memcpy (((char *)p_data), buf + offset, CDIO_CD_FRAMESIZE);
-
- return 0;
-}
-
-/*!
- Reads nblocks of mode2 sectors from cd device into data starting
- from lsn.
- Returns 0 if no error.
- */
-static int
-_read_mode2_sectors_solaris (void *p_user_data, void *data, lsn_t lsn,
- bool b_form2, unsigned int nblocks)
-{
- _img_private_t *env = p_user_data;
- unsigned int i;
- int retval;
- unsigned int blocksize = b_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE;
-
- for (i = 0; i < nblocks; i++) {
- if ( (retval = _read_mode2_sector_solaris (env,
- ((char *)data) + (blocksize * i),
- lsn + i, b_form2)) )
- return retval;
- }
- return 0;
-}
-
-
-/*!
- Return the size of the CD in logical block address (LBA) units.
- */
-static uint32_t
-_cdio_stat_size (void *p_user_data)
-{
- _img_private_t *env = p_user_data;
-
- struct cdrom_tocentry tocent;
- uint32_t size;
-
- tocent.cdte_track = CDIO_CDROM_LEADOUT_TRACK;
- tocent.cdte_format = CDIO_CDROM_LBA;
- if (ioctl (env->gen.fd, CDROMREADTOCENTRY, &tocent) == -1)
- {
- perror ("ioctl(CDROMREADTOCENTRY)");
- exit (EXIT_FAILURE);
- }
-
- size = tocent.cdte_addr.lba;
-
- return size;
-}
-
-/*!
- Set the arg "key" with "value" in the source device.
- Currently "source" and "access-mode" are valid keys.
- "source" sets the source device in I/O operations
- "access-mode" sets the the method of CD access
-
- 0 is returned if no error was found, and nonzero if there as an error.
-*/
-static int
-_set_arg_solaris (void *p_user_data, const char key[], const char value[])
-{
- _img_private_t *env = p_user_data;
-
- if (!strcmp (key, "source"))
- {
- if (!value)
- return -2;
-
- free (env->gen.source_name);
-
- env->gen.source_name = strdup (value);
- }
- else if (!strcmp (key, "access-mode"))
- {
- env->access_mode = str_to_access_mode_sunos(key);
- }
- else
- return -1;
-
- return 0;
-}
-
-/*!
- Read and cache the CD's Track Table of Contents and track info.
- Return true if successful or false if an error.
-*/
-static bool
-read_toc_solaris (void *p_user_data)
-{
- _img_private_t *p_env = p_user_data;
- int i;
-
- /* read TOC header */
- if ( ioctl(p_env->gen.fd, CDROMREADTOCHDR, &p_env->tochdr) == -1 ) {
- cdio_warn("%s: %s\n",
- "error in ioctl CDROMREADTOCHDR", strerror(errno));
- return false;
- }
-
- p_env->gen.i_first_track = p_env->tochdr.cdth_trk0;
- p_env->gen.i_tracks = p_env->tochdr.cdth_trk1;
-
- /* read individual tracks */
- for (i=p_env->gen.i_first_track; i<=p_env->gen.i_tracks; i++) {
- p_env->tocent[i-1].cdte_track = i;
- p_env->tocent[i-1].cdte_format = CDIO_CDROM_MSF;
- if ( ioctl(p_env->gen.fd, CDROMREADTOCENTRY, &p_env->tocent[i-1]) == -1 ) {
- cdio_warn("%s %d: %s\n",
- "error in ioctl CDROMREADTOCENTRY for track",
- i, strerror(errno));
- return false;
- }
- }
-
- /* read the lead-out track */
- p_env->tocent[p_env->tochdr.cdth_trk1].cdte_track = CDIO_CDROM_LEADOUT_TRACK;
- p_env->tocent[p_env->tochdr.cdth_trk1].cdte_format = CDIO_CDROM_MSF;
-
- if (ioctl(p_env->gen.fd, CDROMREADTOCENTRY,
- &p_env->tocent[p_env->tochdr.cdth_trk1]) == -1 ) {
- cdio_warn("%s: %s\n",
- "error in ioctl CDROMREADTOCENTRY for lead-out",
- strerror(errno));
- return false;
- }
-
- p_env->gen.toc_init = true;
- return true;
-}
-
-/*!
- Eject media in CD drive. If successful, as a side effect we
- also free obj.
- */
-static int
-eject_media_solaris (void *p_user_data) {
-
- _img_private_t *env = p_user_data;
- int ret;
-
- close(env->gen.fd);
- env->gen.fd = -1;
- if (env->gen.fd > -1) {
- if ((ret = ioctl(env->gen.fd, CDROMEJECT)) != 0) {
- cdio_generic_free((void *) env);
- cdio_warn ("CDROMEJECT failed: %s\n", strerror(errno));
- return 1;
- } else {
- return 0;
- }
- }
- return 2;
-}
-
-
-static void *
-_cdio_malloc_and_zero(size_t size) {
- void *ptr;
-
- if( !size ) size++;
-
- if((ptr = malloc(size)) == NULL) {
- cdio_warn("malloc() failed: %s", strerror(errno));
- return NULL;
- }
-
- memset(ptr, 0, size);
- return ptr;
-}
-
-/*!
- Return the value associated with the key "arg".
-*/
-static const char *
-get_arg_solaris (void *p_user_data, const char key[])
-{
- _img_private_t *env = p_user_data;
-
- if (!strcmp (key, "source")) {
- return env->gen.source_name;
- } else if (!strcmp (key, "access-mode")) {
- switch (env->access_mode) {
- case _AM_SUN_CTRL_ATAPI:
- return "ATAPI";
- case _AM_SUN_CTRL_SCSI:
- return "SCSI";
- case _AM_NONE:
- return "no access method";
- }
- }
- return NULL;
-}
-
-/*!
- Return a string containing the default CD device if none is specified.
- */
-char *
-cdio_get_default_device_solaris(void)
-{
- char *volume_device;
- char *volume_name;
- char *volume_action;
- char *device;
- struct stat stb;
-
- if ((volume_device = getenv("VOLUME_DEVICE")) != NULL &&
- (volume_name = getenv("VOLUME_NAME")) != NULL &&
- (volume_action = getenv("VOLUME_ACTION")) != NULL &&
- strcmp(volume_action, "insert") == 0) {
-
- device = _cdio_malloc_and_zero(strlen(volume_device)
- + strlen(volume_name) + 2);
- if (device == NULL)
- return strdup(DEFAULT_CDIO_DEVICE);
- sprintf(device, "%s/%s", volume_device, volume_name);
- if (stat(device, &stb) != 0 || !S_ISCHR(stb.st_mode)) {
- free(device);
- return strdup(DEFAULT_CDIO_DEVICE);
- }
- return device;
- }
- /* Check if it could be a Solaris media*/
- if((stat(DEFAULT_CDIO_DEVICE, &stb) == 0) && S_ISDIR(stb.st_mode)) {
- device = _cdio_malloc_and_zero(strlen(DEFAULT_CDIO_DEVICE) + 4);
- sprintf(device, "%s/s0", DEFAULT_CDIO_DEVICE);
- return device;
- }
- return strdup(DEFAULT_CDIO_DEVICE);
-}
-
-/*!
- Get disc type associated with cd object.
-*/
-
-static discmode_t
-get_discmode_solaris (void *p_user_data)
-{
- _img_private_t *p_env = p_user_data;
- track_t i_track;
- discmode_t discmode=CDIO_DISC_MODE_NO_INFO;
- struct dk_minfo media;
- int ret;
-
- /* Get the media info */
- if((ret = ioctl(p_env->gen.fd, DKIOCGMEDIAINFO, &media)) != 0) {
- cdio_warn ("DKIOCGMEDIAINFO failed: %s\n", strerror(errno));
- return CDIO_DISC_MODE_NO_INFO;
- }
- switch(media.dki_media_type) {
- case DK_CDROM:
- case DK_CDR:
- case DK_CDRW:
- /* Do cdrom detection */
- break;
- case DK_DVDROM: return CDIO_DISC_MODE_DVD_ROM;
- case DK_DVDR: discmode = CDIO_DISC_MODE_DVD_R;
- break;
- case DK_DVDRAM: discmode = CDIO_DISC_MODE_DVD_RAM;
- break;
- case DK_DVDRW:
- case DK_DVDRW+1: discmode = CDIO_DISC_MODE_DVD_RW;
- break;
- default: /* no valid match */
- return CDIO_DISC_MODE_NO_INFO;
- }
-
- if((discmode == CDIO_DISC_MODE_DVD_RAM ||
- discmode == CDIO_DISC_MODE_DVD_RW ||
- discmode == CDIO_DISC_MODE_DVD_R)) {
- /* Fallback to uscsi if we can */
- if(geteuid() == 0)
- return get_discmode_solaris(p_user_data);
- return discmode;
- }
-
- if (!p_env->gen.toc_init)
- read_toc_solaris (p_env);
-
- if (!p_env->gen.toc_init)
- return CDIO_DISC_MODE_NO_INFO;
-
- for (i_track = p_env->gen.i_first_track;
- i_track < p_env->gen.i_first_track + p_env->tochdr.cdth_trk1 ;
- i_track ++) {
- track_format_t track_fmt=get_track_format_solaris(p_env, i_track);
-
- switch(track_fmt) {
- case TRACK_FORMAT_AUDIO:
- switch(discmode) {
- case CDIO_DISC_MODE_NO_INFO:
- discmode = CDIO_DISC_MODE_CD_DA;
- break;
- case CDIO_DISC_MODE_CD_DA:
- case CDIO_DISC_MODE_CD_MIXED:
- case CDIO_DISC_MODE_ERROR:
- /* No change*/
- break;
- default:
- discmode = CDIO_DISC_MODE_CD_MIXED;
- }
- break;
- case TRACK_FORMAT_XA:
- switch(discmode) {
- case CDIO_DISC_MODE_NO_INFO:
- discmode = CDIO_DISC_MODE_CD_XA;
- break;
- case CDIO_DISC_MODE_CD_XA:
- case CDIO_DISC_MODE_CD_MIXED:
- case CDIO_DISC_MODE_ERROR:
- /* No change*/
- break;
- default:
- discmode = CDIO_DISC_MODE_CD_MIXED;
- }
- break;
- case TRACK_FORMAT_DATA:
- switch(discmode) {
- case CDIO_DISC_MODE_NO_INFO:
- discmode = CDIO_DISC_MODE_CD_DATA;
- break;
- case CDIO_DISC_MODE_CD_DATA:
- case CDIO_DISC_MODE_CD_MIXED:
- case CDIO_DISC_MODE_ERROR:
- /* No change*/
- break;
- default:
- discmode = CDIO_DISC_MODE_CD_MIXED;
- }
- break;
- case TRACK_FORMAT_ERROR:
- default:
- discmode = CDIO_DISC_MODE_ERROR;
- }
- }
- return discmode;
-}
-
-/*!
- Get format of track.
-*/
-static track_format_t
-get_track_format_solaris(void *p_user_data, track_t i_track)
-{
- _img_private_t *p_env = p_user_data;
-
- if ( !p_env ) return TRACK_FORMAT_ERROR;
- if (!p_env->gen.init) init_solaris(p_env);
- if (!p_env->gen.toc_init) read_toc_solaris (p_user_data) ;
-
- if ( (i_track > p_env->gen.i_tracks+p_env->gen.i_first_track)
- || i_track < p_env->gen.i_first_track)
- return TRACK_FORMAT_ERROR;
-
- i_track -= p_env->gen.i_first_track;
-
- /* This is pretty much copied from the "badly broken" cdrom_count_tracks
- in linux/cdrom.c.
- */
- if (p_env->tocent[i_track].cdte_ctrl & CDROM_DATA_TRACK) {
- if (p_env->tocent[i_track].cdte_format == CDIO_CDROM_CDI_TRACK)
- return TRACK_FORMAT_CDI;
- else if (p_env->tocent[i_track].cdte_format == CDIO_CDROM_XA_TRACK)
- return TRACK_FORMAT_XA;
- else
- return TRACK_FORMAT_DATA;
- } else
- return TRACK_FORMAT_AUDIO;
-
-}
-
-/*!
- Return true if we have XA data (green, mode2 form1) or
- XA data (green, mode2 form2). That is track begins:
- sync - header - subheader
- 12 4 - 8
-
- FIXME: there's gotta be a better design for this and get_track_format?
-*/
-static bool
-_cdio_get_track_green(void *p_user_data, track_t i_track)
-{
- _img_private_t *p_env = p_user_data;
-
- if ( !p_env ) return false;
- if (!p_env->gen.init) init_solaris(p_env);
- if (!p_env->gen.toc_init) read_toc_solaris (p_env) ;
-
- if (i_track >= p_env->gen.i_tracks+p_env->gen.i_first_track
- || i_track < p_env->gen.i_first_track)
- return false;
-
- i_track -= p_env->gen.i_first_track;
-
- /* FIXME: Dunno if this is the right way, but it's what
- I was using in cd-info for a while.
- */
- return ((p_env->tocent[i_track].cdte_ctrl & 2) != 0);
-}
-
-/*!
- Return the starting MSF (minutes/secs/frames) for track number
- track_num in obj. Track numbers usually start at something
- greater than 0, usually 1.
-
- The "leadout" track is specified either by
- using track_num LEADOUT_TRACK or the total tracks+1.
- False is returned if there is no entry.
-*/
-static bool
-_cdio_get_track_msf(void *p_user_data, track_t i_track, msf_t *msf)
-{
- _img_private_t *p_env = p_user_data;
-
- if (NULL == msf) return false;
-
- if (!p_env->gen.init) init_solaris(p_env);
- if (!p_env->gen.toc_init) read_toc_solaris (p_env) ;
-
- if (i_track == CDIO_CDROM_LEADOUT_TRACK)
- i_track = p_env->gen.i_tracks + p_env->gen.i_first_track;
-
- if (i_track > (p_env->gen.i_tracks+p_env->gen.i_first_track)
- || i_track < p_env->gen.i_first_track) {
- return false;
- } else {
- struct cdrom_tocentry *msf0 = &p_env->tocent[i_track-1];
- msf->m = cdio_to_bcd8(msf0->cdte_addr.msf.minute);
- msf->s = cdio_to_bcd8(msf0->cdte_addr.msf.second);
- msf->f = cdio_to_bcd8(msf0->cdte_addr.msf.frame);
- return true;
- }
-}
-
-#else
-/*!
- Return a string containing the default VCD device if none is specified.
- */
-char *
-cdio_get_default_device_solaris(void)
-{
- return strdup(DEFAULT_CDIO_DEVICE);
-}
-
-#endif /* HAVE_SOLARIS_CDROM */
-
-/*!
- Return an array of strings giving possible CD devices.
- */
-char **
-cdio_get_devices_solaris (void)
-{
-#ifndef HAVE_SOLARIS_CDROM
- return NULL;
-#else
- char volpath[256];
- struct stat st;
- char **drives = NULL;
- unsigned int i_files=0;
-#ifdef HAVE_GLOB_H
- unsigned int i;
- glob_t globbuf;
-
- globbuf.gl_offs = 0;
- glob("/vol/dev/aliases/cdrom*", GLOB_DOOFFS, NULL, &globbuf);
- for (i=0; i<globbuf.gl_pathc; i++) {
- if(stat(globbuf.gl_pathv[i], &st) < 0)
- continue;
-
- /* Check if this is a directory, if so it's probably Solaris media */
- if(S_ISDIR(st.st_mode)) {
- sprintf(volpath, "%s/s0", globbuf.gl_pathv[i]);
- if(stat(volpath, &st) == 0)
- cdio_add_device_list(&drives, volpath, &i_files);
- }else
- cdio_add_device_list(&drives, globbuf.gl_pathv[i], &i_files);
- }
- globfree(&globbuf);
-#else
- if(stat(DEFAULT_CDIO_DEVICE, &st) == 0) {
- /* Check if this is a directory, if so it's probably Solaris media */
- if(S_ISDIR(st.st_mode)) {
- sprintf(volpath, "%s/s0", DEFAULT_CDIO_DEVICE);
- if(stat(volpath, &st) == 0)
- cdio_add_device_list(&drives, volpath, &i_files);
- }else
- cdio_add_device_list(&drives, DEFAULT_CDIO_DEVICE, &i_files);
- }
-#endif /*HAVE_GLOB_H*/
- cdio_add_device_list(&drives, NULL, &i_files);
- return drives;
-#endif /*HAVE_SOLARIS_CDROM*/
-}
-
-/*!
- Initialization routine. This is the only thing that doesn't
- get called via a function pointer. In fact *we* are the
- ones to set that up.
- */
-CdIo *
-cdio_open_solaris (const char *psz_source_name)
-{
- return cdio_open_am_solaris(psz_source_name, NULL);
-}
-
-/*!
- Initialization routine. This is the only thing that doesn't
- get called via a function pointer. In fact *we* are the
- ones to set that up.
- */
-CdIo *
-cdio_open_am_solaris (const char *psz_orig_source, const char *access_mode)
-{
-
-#ifdef HAVE_SOLARIS_CDROM
- CdIo *ret;
- _img_private_t *_data;
- char *psz_source;
-
- cdio_funcs _funcs;
-
- _funcs.eject_media = eject_media_solaris;
- _funcs.free = cdio_generic_free;
- _funcs.get_arg = get_arg_solaris;
- _funcs.get_cdtext = get_cdtext_generic;
- _funcs.get_default_device = cdio_get_default_device_solaris;
- _funcs.get_devices = cdio_get_devices_solaris;
- _funcs.get_discmode = get_discmode_solaris;
- _funcs.get_drive_cap = scsi_mmc_get_drive_cap_generic;
- _funcs.get_first_track_num= get_first_track_num_generic;
- _funcs.get_hwinfo = NULL;
- _funcs.get_mcn = scsi_mmc_get_mcn_generic,
- _funcs.get_num_tracks = get_num_tracks_generic;
- _funcs.get_track_format = get_track_format_solaris;
- _funcs.get_track_green = _cdio_get_track_green;
- _funcs.get_track_lba = NULL; /* This could be implemented if need be. */
- _funcs.get_track_msf = _cdio_get_track_msf;
- _funcs.lseek = cdio_generic_lseek;
- _funcs.read = cdio_generic_read;
- _funcs.read_audio_sectors = _read_audio_sectors_solaris;
- _funcs.read_mode1_sector = _read_mode1_sector_solaris;
- _funcs.read_mode1_sectors = _read_mode1_sectors_solaris;
- _funcs.read_mode2_sector = _read_mode2_sector_solaris;
- _funcs.read_mode2_sectors = _read_mode2_sectors_solaris;
- _funcs.read_toc = read_toc_solaris;
- _funcs.run_scsi_mmc_cmd = run_scsi_cmd_solaris;
- _funcs.stat_size = _cdio_stat_size;
- _funcs.set_arg = _set_arg_solaris;
-
- _data = _cdio_malloc (sizeof (_img_private_t));
-
- _data->access_mode = _AM_SUN_CTRL_SCSI;
- _data->gen.init = false;
- _data->gen.fd = -1;
- _data->gen.toc_init = false;
- _data->gen.b_cdtext_init = false;
- _data->gen.b_cdtext_error = false;
-
- if (NULL == psz_orig_source) {
- psz_source = cdio_get_default_device_solaris();
- if (NULL == psz_source) return NULL;
- _set_arg_solaris(_data, "source", psz_source);
- free(psz_source);
- } else {
- if (cdio_is_device_generic(psz_orig_source))
- _set_arg_solaris(_data, "source", psz_orig_source);
- else {
- /* The below would be okay if all device drivers worked this way. */
-#if 0
- cdio_info ("source %s is not a device", psz_orig_source);
-#endif
- return NULL;
- }
- }
-
- ret = cdio_new ( (void *) _data, &_funcs );
- if (ret == NULL) return NULL;
-
- if (init_solaris(_data))
- return ret;
- else {
- cdio_generic_free (_data);
- return NULL;
- }
-
-#else
- return NULL;
-#endif /* HAVE_SOLARIS_CDROM */
-
-}
-
-bool
-cdio_have_solaris (void)
-{
-#ifdef HAVE_SOLARIS_CDROM
- return true;
-#else
- return false;
-#endif /* HAVE_SOLARIS_CDROM */
-}
diff --git a/src/input/vcd/libcdio/cd_types.c b/src/input/vcd/libcdio/cd_types.c
deleted file mode 100644
index b983f9899..000000000
--- a/src/input/vcd/libcdio/cd_types.c
+++ /dev/null
@@ -1,358 +0,0 @@
-/*
- $Id: cd_types.c,v 1.4 2005/01/01 02:43:57 rockyb Exp $
-
- Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-/*
- This tries to determine what kind of CD-image or filesystems on a
- track we've got.
-*/
-#include "config.h"
-
-#ifdef HAVE_STDIO_H
-#include <stdio.h>
-#endif
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-#include <cdio/cdio.h>
-#include <cdio/iso9660.h>
-#include <cdio/logging.h>
-#include <cdio/util.h>
-#include <cdio/cd_types.h>
-
-/*
-Subject: -65- How can I read an IRIX (EFS) CD-ROM on a machine which
- doesn't use EFS?
-Date: 18 Jun 1995 00:00:01 EST
-
- You want 'efslook', at
- ftp://viz.tamu.edu/pub/sgi/software/efslook.tar.gz.
-
-and
-! Robert E. Seastrom <rs@access4.digex.net>'s software (with source
-! code) for using an SGI CD-ROM on a Macintosh is at
-! ftp://bifrost.seastrom.com/pub/mac/CDROM-Jumpstart.sit151.hqx.
-
-*/
-
-static char buffer[6][CDIO_CD_FRAMESIZE_RAW]; /* for CD-Data */
-
-/* Some interesting sector numbers stored in the above buffer. */
-#define ISO_SUPERBLOCK_SECTOR 16 /* buffer[0] */
-#define UFS_SUPERBLOCK_SECTOR 4 /* buffer[2] */
-#define BOOT_SECTOR 17 /* buffer[3] */
-#define VCD_INFO_SECTOR 150 /* buffer[4] */
-#define XISO_SECTOR 32 /* buffer[4] */
-#define UDFX_SECTOR 32 /* buffer[4] */
-#define UDF_ANCHOR_SECTOR 256 /* buffer[5] */
-
-
-typedef struct signature
-{
- unsigned int buf_num;
- unsigned int offset;
- const char *sig_str;
- const char *description;
-} signature_t;
-
-static signature_t sigs[] =
- {
-/*buffer[x] off look for description */
- {0, 0, "MICROSOFT*XBOX*MEDIA", "XBOX CD"},
- {0, 1, "BEA01", "UDF"},
- {0, 1, ISO_STANDARD_ID, "ISO 9660"},
- {0, 1, "CD-I", "CD-I"},
- {0, 8, "CDTV", "CDTV"},
- {0, 8, "CD-RTOS", "CD-RTOS"},
- {0, 9, "CDROM", "HIGH SIERRA"},
- {0, 16, "CD-BRIDGE", "BRIDGE"},
- {0, ISO_XA_MARKER_OFFSET, ISO_XA_MARKER_STRING, "XA"},
- {1, 64, "PPPPHHHHOOOOTTTTOOOO____CCCCDDDD", "PHOTO CD"},
- {1, 0x438, "\x53\xef", "EXT2 FS"},
- {2, 1372, "\x54\x19\x01\x0", "UFS"},
- {3, 7, "EL TORITO", "BOOTABLE"},
- {4, 0, "VIDEO_CD", "VIDEO CD"},
- {4, 0, "SUPERVCD", "SVCD or Chaoji VCD"},
- { 0 }
- };
-
-
-/* The below index into the above sigs array. Make sure things match. */
-#define INDEX_XISO 0 /* Microsoft X-BOX filesystem */
-#define INDEX_UDF 1
-#define INDEX_ISOFS 2
-#define INDEX_CD_I 3
-#define INDEX_CDTV 4
-#define INDEX_CD_RTOS 5
-#define INDEX_HS 6
-#define INDEX_BRIDGE 7
-#define INDEX_XA 8
-#define INDEX_PHOTO_CD 9
-#define INDEX_EXT2 10
-#define INDEX_UFS 11
-#define INDEX_BOOTABLE 12
-#define INDEX_VIDEO_CD 13 /* Video CD */
-#define INDEX_SVCD 14 /* CVD *or* SVCD */
-
-
-/*
- Read a particular block into the global array to be used for further
- analysis later.
-*/
-static int
-_cdio_read_block(const CdIo *cdio, int superblock, uint32_t offset,
- uint8_t bufnum, track_t i_track)
-{
- unsigned int track_sec_count = cdio_get_track_sec_count(cdio, i_track);
- memset(buffer[bufnum], 0, CDIO_CD_FRAMESIZE);
-
- if ( track_sec_count < superblock) {
- cdio_debug("reading block %u skipped track %d has only %u sectors\n",
- superblock, i_track, track_sec_count);
- return -1;
- }
-
- cdio_debug("about to read sector %lu\n",
- (long unsigned int) offset+superblock);
-
- if (cdio_get_track_green(cdio, i_track)) {
- if (0 > cdio_read_mode2_sector(cdio, buffer[bufnum],
- offset+superblock, false))
- return -1;
- } else {
- if (0 > cdio_read_mode1_sector(cdio, buffer[bufnum],
- offset+superblock, false))
- return -1;
- }
-
- return 0;
-}
-
-/*
- Return true if the previously read-in buffer contains a "signature" that
- matches index "num".
- */
-static bool
-_cdio_is_it(int num)
-{
- signature_t *sigp=&sigs[num];
- int len=strlen(sigp->sig_str);
-
- /* TODO: check that num < largest sig. */
- return 0 == memcmp(&buffer[sigp->buf_num][sigp->offset], sigp->sig_str, len);
-}
-
-static int
-_cdio_is_hfs(void)
-{
- return (0 == memcmp(&buffer[1][512],"PM",2)) ||
- (0 == memcmp(&buffer[1][512],"TS",2)) ||
- (0 == memcmp(&buffer[1][1024], "BD",2));
-}
-
-static int
-_cdio_is_3do(void)
-{
- return (0 == memcmp(&buffer[1][0],"\x01\x5a\x5a\x5a\x5a\x5a\x01", 7)) &&
- (0 == memcmp(&buffer[1][40], "CD-ROM", 6));
-}
-
-static int
-_cdio_is_joliet(void)
-{
- return 2 == buffer[3][0] && buffer[3][88] == 0x25 && buffer[3][89] == 0x2f;
-}
-
-static int
-_cdio_is_UDF(void)
-{
- return 2 == ((uint16_t)buffer[5][0] | ((uint16_t)buffer[5][1] << 8));
-}
-
-/* ISO 9660 volume space in M2F1_SECTOR_SIZE byte units */
-static int
-_cdio_get_iso9660_fs_sec_count(void)
-{
- return ((buffer[0][80] & 0xff) |
- ((buffer[0][81] & 0xff) << 8) |
- ((buffer[0][82] & 0xff) << 16) |
- ((buffer[0][83] & 0xff) << 24));
-}
-
-static int
-_cdio_get_joliet_level( void )
-{
- switch (buffer[3][90]) {
- case 0x40: return 1;
- case 0x43: return 2;
- case 0x45: return 3;
- }
- return 0;
-}
-
-/*
- Try to determine what kind of CD-image and/or filesystem we
- have at track i_track. Return information about the CD image
- is returned in cdio_analysis and the return value.
-*/
-cdio_fs_anal_t
-cdio_guess_cd_type(const CdIo *cdio, int start_session, track_t i_track,
- /*out*/ cdio_iso_analysis_t *iso_analysis)
-{
- int ret = CDIO_FS_UNKNOWN;
- bool sector0_read_ok;
-
- if (TRACK_FORMAT_AUDIO == cdio_get_track_format(cdio, i_track))
- return CDIO_FS_AUDIO;
-
- if ( _cdio_read_block(cdio, ISO_PVD_SECTOR, start_session,
- 0, i_track) < 0 )
- return CDIO_FS_UNKNOWN;
-
- if ( _cdio_is_it(INDEX_XISO) )
- return CDIO_FS_ANAL_XISO;
-
- if (_cdio_read_block(cdio, ISO_SUPERBLOCK_SECTOR, start_session, 0,
- i_track) < 0)
- return ret;
-
- if ( _cdio_is_it(INDEX_UDF) ) {
- /* Detect UDF version
- Test if we have a valid version of UDF the xbox can read natively */
- if (_cdio_read_block(cdio, 35, start_session, 5, i_track) < 0)
- return CDIO_FS_UNKNOWN;
-
- iso_analysis->UDFVerMinor=(unsigned int)buffer[5][240];
- iso_analysis->UDFVerMajor=(unsigned int)buffer[5][241];
- /* Read disc label */
- if (_cdio_read_block(cdio, 32, start_session, 5, i_track) < 0)
- return CDIO_FS_UDF;
-
- strncpy(iso_analysis->iso_label, buffer[5]+25, 33);
- iso_analysis->iso_label[32] = '\0';
- return CDIO_FS_UDF;
- }
-
- /* We have something that smells of a filesystem. */
- if (_cdio_is_it(INDEX_CD_I) && _cdio_is_it(INDEX_CD_RTOS)
- && !_cdio_is_it(INDEX_BRIDGE) && !_cdio_is_it(INDEX_XA)) {
- return CDIO_FS_INTERACTIVE;
- } else {
- /* read sector 0 ONLY, when NO greenbook CD-I !!!! */
-
- sector0_read_ok =
- _cdio_read_block(cdio, 0, start_session, 1, i_track) == 0;
-
- if (_cdio_is_it(INDEX_HS))
- ret |= CDIO_FS_HIGH_SIERRA;
- else if (_cdio_is_it(INDEX_ISOFS)) {
- if (_cdio_is_it(INDEX_CD_RTOS) && _cdio_is_it(INDEX_BRIDGE))
- ret = CDIO_FS_ISO_9660_INTERACTIVE;
- else if (_cdio_is_hfs())
- ret = CDIO_FS_ISO_HFS;
- else
- ret = CDIO_FS_ISO_9660;
- iso_analysis->isofs_size = _cdio_get_iso9660_fs_sec_count();
- strncpy(iso_analysis->iso_label, buffer[0]+40,33);
- iso_analysis->iso_label[32] = '\0';
-
- if ( _cdio_read_block(cdio, UDF_ANCHOR_SECTOR, start_session, 5,
- i_track) < 0)
- return ret;
-
- /* Maybe there is an UDF anchor in IOS session
- so its ISO/UDF session and we prefere UDF */
- if ( _cdio_is_UDF() ) {
- /* Detect UDF version.
- Test if we have a valid version of UDF the xbox can read natively */
- if ( _cdio_read_block(cdio, 35, start_session, 5, i_track) < 0)
- return ret;
-
- iso_analysis->UDFVerMinor=(unsigned int)buffer[5][240];
- iso_analysis->UDFVerMajor=(unsigned int)buffer[5][241];
-#if 0
- /* We are using ISO/UDF cd's as iso,
- no need to get UDF disc label */
- if (_cdio_read_block(cdio, 32, start_session, 5, i_track) < 0)
- return ret;
- stnrcpy(iso_analysis->iso_label, buffer[5]+25, 33);
- iso_analysis->iso_label[32] = '\0';
-#endif
- ret=CDIO_FS_ISO_UDF;
- }
-
-#if 0
- if (_cdio_is_rockridge())
- ret |= CDIO_FS_ANAL_ROCKRIDGE;
-#endif
-
- if (_cdio_read_block(cdio, BOOT_SECTOR, start_session, 3, i_track) < 0)
- return ret;
-
- if (_cdio_is_joliet()) {
- iso_analysis->joliet_level = _cdio_get_joliet_level();
- ret |= CDIO_FS_ANAL_JOLIET;
- }
- if (_cdio_is_it(INDEX_BOOTABLE))
- ret |= CDIO_FS_ANAL_BOOTABLE;
-
- if ( _cdio_is_it(INDEX_XA) && _cdio_is_it(INDEX_ISOFS)
- && !(sector0_read_ok && _cdio_is_it(INDEX_PHOTO_CD)) ) {
-
- if ( _cdio_read_block(cdio, VCD_INFO_SECTOR, start_session, 4,
- i_track) < 0 )
- return ret;
-
- if (_cdio_is_it(INDEX_BRIDGE) && _cdio_is_it(INDEX_CD_RTOS)) {
- if (_cdio_is_it(INDEX_VIDEO_CD)) ret |= CDIO_FS_ANAL_VIDEOCD;
- else if (_cdio_is_it(INDEX_SVCD)) ret |= CDIO_FS_ANAL_SVCD;
- } else if (_cdio_is_it(INDEX_SVCD)) ret |= CDIO_FS_ANAL_CVD;
-
- }
- }
- else if (_cdio_is_hfs()) ret |= CDIO_FS_HFS;
- else if (sector0_read_ok && _cdio_is_it(INDEX_EXT2)) ret |= CDIO_FS_EXT2;
- else if (_cdio_is_3do()) ret |= CDIO_FS_3DO;
- else {
- if ( _cdio_read_block(cdio, UFS_SUPERBLOCK_SECTOR, start_session, 2,
- i_track) < 0 )
- return ret;
-
- if (sector0_read_ok && _cdio_is_it(INDEX_UFS))
- ret |= CDIO_FS_UFS;
- else
- ret |= CDIO_FS_UNKNOWN;
- }
- }
-
- /* other checks */
- if (_cdio_is_it(INDEX_XA)) ret |= CDIO_FS_ANAL_XA;
- if (_cdio_is_it(INDEX_PHOTO_CD)) ret |= CDIO_FS_ANAL_PHOTO_CD;
- if (_cdio_is_it(INDEX_CDTV)) ret |= CDIO_FS_ANAL_CDTV;
- return ret;
-}
diff --git a/src/input/vcd/libcdio/cdio.c b/src/input/vcd/libcdio/cdio.c
deleted file mode 100644
index fc18add91..000000000
--- a/src/input/vcd/libcdio/cdio.c
+++ /dev/null
@@ -1,1125 +0,0 @@
-/*
- $Id: cdio.c,v 1.3 2005/01/01 02:43:57 rockyb Exp $
-
- Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
- Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <errno.h>
-#include <string.h>
-
-#include "cdio_assert.h"
-#include <cdio/cdio.h>
-#include <cdio/cd_types.h>
-#include <cdio/util.h>
-#include <cdio/logging.h>
-#include "cdio_private.h"
-
-static const char _rcsid[] = "$Id: cdio.c,v 1.3 2005/01/01 02:43:57 rockyb Exp $";
-
-
-const char *track_format2str[6] =
- {
- "audio", "CD-i", "XA", "data", "PSX", "error"
- };
-
-/* Must match discmode enumeration */
-const char *discmode2str[] = {
- "CD-DA",
- "CD-DATA Form 1",
- "CD DATA Form 2",
- "CD-ROM Mixed",
- "DVD-ROM",
- "DVD-RAM",
- "DVD-R",
- "DVD-RW",
- "DVD+R",
- "DVD+RW",
- "Unknown/unclassified DVD",
- "No information",
- "Error in getting information"
-};
-
-
-/* The below array gives of the drivers that are currently available for
- on a particular host. */
-
-CdIo_driver_t CdIo_driver[CDIO_MAX_DRIVER] = { {0} };
-
-/* The last valid entry of Cdio_driver.
- -1 or (CDIO_DRIVER_UNINIT) means uninitialzed.
- -2 means some sort of error.
-*/
-
-#define CDIO_DRIVER_UNINIT -1
-int CdIo_last_driver = CDIO_DRIVER_UNINIT;
-
-#ifdef HAVE_BSDI_CDROM
-const driver_id_t cdio_os_driver = DRIVER_BSDI;
-#elif HAVE_FREEBSD_CDROM
-const driver_id_t cdio_os_driver = DRIVER_FREEBSD;
-#elif HAVE_LINUX_CDROM
-const driver_id_t cdio_os_driver = DRIVER_LINUX;
-#elif HAVE_DARWIN_CDROM
-const driver_id_t cdio_os_driver = DRIVER_OSX;
-#elif HAVE_DARWIN_SOLARIS
-const driver_id_t cdio_os_driver = DRIVER_SOLARIS;
-#elif HAVE_DARWIN_WIN32
-const driver_id_t cdio_os_driver = DRIVER_WIN32;
-#else
-const driver_id_t cdio_os_driver = DRIVER_UNKNOWN;
-#endif
-
-static bool
-cdio_have_false(void)
-{
- return false;
-}
-
-/* The below array gives all drivers that can possibly appear.
- on a particular host. */
-
-CdIo_driver_t CdIo_all_drivers[CDIO_MAX_DRIVER+1] = {
- {DRIVER_UNKNOWN,
- 0,
- "Unknown",
- "No driver",
- &cdio_have_false,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
- },
-
- {DRIVER_BSDI,
- CDIO_SRC_IS_DEVICE_MASK|CDIO_SRC_IS_NATIVE_MASK|CDIO_SRC_IS_SCSI_MASK,
- "BSDI",
- "BSDI ATAPI and SCSI driver",
- &cdio_have_bsdi,
- &cdio_open_bsdi,
- &cdio_open_am_bsdi,
- &cdio_get_default_device_bsdi,
- &cdio_is_device_generic,
- &cdio_get_devices_bsdi
- },
-
- {DRIVER_FREEBSD,
- CDIO_SRC_IS_DEVICE_MASK|CDIO_SRC_IS_NATIVE_MASK|CDIO_SRC_IS_SCSI_MASK,
- "FreeBSD",
- "FreeBSD driver",
- &cdio_have_freebsd,
- &cdio_open_freebsd,
- &cdio_open_am_freebsd,
- &cdio_get_default_device_freebsd,
- &cdio_is_device_generic,
- NULL
- },
-
- {DRIVER_LINUX,
- CDIO_SRC_IS_DEVICE_MASK|CDIO_SRC_IS_NATIVE_MASK,
- "GNU/Linux",
- "GNU/Linux ioctl and MMC driver",
- &cdio_have_linux,
- &cdio_open_linux,
- &cdio_open_am_linux,
- &cdio_get_default_device_linux,
- &cdio_is_device_generic,
- &cdio_get_devices_linux
- },
-
- {DRIVER_SOLARIS,
- CDIO_SRC_IS_DEVICE_MASK|CDIO_SRC_IS_NATIVE_MASK|CDIO_SRC_IS_SCSI_MASK,
- "Solaris",
- "Solaris ATAPI and SCSI driver",
- &cdio_have_solaris,
- &cdio_open_solaris,
- &cdio_open_am_solaris,
- &cdio_get_default_device_solaris,
- &cdio_is_device_generic,
- &cdio_get_devices_solaris
- },
-
- {DRIVER_OSX,
- CDIO_SRC_IS_DEVICE_MASK|CDIO_SRC_IS_NATIVE_MASK|CDIO_SRC_IS_SCSI_MASK,
- "OS X",
- "Apple Darwin OS X driver",
- &cdio_have_osx,
- &cdio_open_osx,
- &cdio_open_am_osx,
- &cdio_get_default_device_osx,
- &cdio_is_device_generic,
- &cdio_get_devices_osx
- },
-
- {DRIVER_WIN32,
- CDIO_SRC_IS_DEVICE_MASK|CDIO_SRC_IS_NATIVE_MASK|CDIO_SRC_IS_SCSI_MASK,
- "WIN32",
- "MS Windows ASPI and ioctl driver",
- &cdio_have_win32,
- &cdio_open_win32,
- &cdio_open_am_win32,
- &cdio_get_default_device_win32,
- &cdio_is_device_win32,
- &cdio_get_devices_win32
- },
-
- {DRIVER_CDRDAO,
- CDIO_SRC_IS_DISK_IMAGE_MASK,
- "CDRDAO",
- "cdrdao (TOC) disk image driver",
- &cdio_have_cdrdao,
- &cdio_open_cdrdao,
- &cdio_open_am_cdrdao,
- &cdio_get_default_device_cdrdao,
- NULL,
- &cdio_get_devices_cdrdao
- },
-
- {DRIVER_BINCUE,
- CDIO_SRC_IS_DISK_IMAGE_MASK,
- "BIN/CUE",
- "bin/cuesheet disk image driver",
- &cdio_have_bincue,
- &cdio_open_bincue,
- &cdio_open_am_bincue,
- &cdio_get_default_device_bincue,
- NULL,
- &cdio_get_devices_bincue
- },
-
- {DRIVER_NRG,
- CDIO_SRC_IS_DISK_IMAGE_MASK,
- "NRG",
- "Nero NRG disk image driver",
- &cdio_have_nrg,
- &cdio_open_nrg,
- &cdio_open_am_nrg,
- &cdio_get_default_device_nrg,
- NULL,
- &cdio_get_devices_nrg
- }
-
-};
-
-static CdIo *
-scan_for_driver(driver_id_t start, driver_id_t end,
- const char *psz_source, const char *access_mode)
-{
- driver_id_t driver_id;
-
- for (driver_id=start; driver_id<=end; driver_id++) {
- if ((*CdIo_all_drivers[driver_id].have_driver)()) {
- CdIo *ret=
- (*CdIo_all_drivers[driver_id].driver_open_am)(psz_source, access_mode);
- if (ret != NULL) {
- ret->driver_id = driver_id;
- return ret;
- }
- }
- }
- return NULL;
-}
-
-const char *
-cdio_driver_describe(driver_id_t driver_id)
-{
- return CdIo_all_drivers[driver_id].describe;
-}
-
-/*!
- Eject media in CD drive if there is a routine to do so.
- Return 0 if success and 1 for failure, and 2 if no routine.
- If the CD is ejected *obj is freed and obj set to NULL.
- */
-int
-cdio_eject_media (CdIo **obj)
-{
-
- if ((obj == NULL) || (*obj == NULL)) return 1;
-
- if ((*obj)->op.eject_media) {
- int ret = (*obj)->op.eject_media ((*obj)->env);
- if (0 == ret) {
- cdio_destroy(*obj);
- *obj = NULL;
- }
- return ret;
- } else {
- cdio_destroy(*obj);
- *obj = NULL;
- return 2;
- }
-}
-
-/*!
- Free device list returned by cdio_get_devices or
- cdio_get_devices_with_cap.
-*/
-void cdio_free_device_list (char * device_list[])
-{
- if (NULL == device_list) return;
- for ( ; *device_list != NULL ; device_list++ )
- free(*device_list);
-}
-
-
-/*!
- Return the value associatied with key. NULL is returned if obj is NULL
- or "key" does not exist.
- */
-const char *
-cdio_get_arg (const CdIo *obj, const char key[])
-{
- if (obj == NULL) return NULL;
-
- if (obj->op.get_arg) {
- return obj->op.get_arg (obj->env, key);
- } else {
- return NULL;
- }
-}
-
-/*!
- Get cdtext information for a CdIo object .
-
- @param obj the CD object that may contain CD-TEXT information.
- @return the CD-TEXT object or NULL if obj is NULL
- or CD-TEXT information does not exist.
-*/
-const cdtext_t *
-cdio_get_cdtext (CdIo *obj, track_t i_track)
-{
- if (obj == NULL) return NULL;
-
- if (obj->op.get_cdtext) {
- return obj->op.get_cdtext (obj->env, i_track);
- } else {
- return NULL;
- }
-}
-
-/*!
- Return a string containing the default CD device if none is specified.
- if CdIo is NULL (we haven't initialized a specific device driver),
- then find a suitable one and return the default device for that.
-
- NULL is returned if we couldn't get a default device.
- */
-char *
-cdio_get_default_device (const CdIo *obj)
-{
- if (obj == NULL) {
- driver_id_t driver_id;
- /* Scan for driver */
- for (driver_id=DRIVER_UNKNOWN; driver_id<=CDIO_MAX_DRIVER; driver_id++) {
- if ( (*CdIo_all_drivers[driver_id].have_driver)() &&
- *CdIo_all_drivers[driver_id].get_default_device ) {
- return (*CdIo_all_drivers[driver_id].get_default_device)();
- }
- }
- return NULL;
- }
-
- if (obj->op.get_default_device) {
- return obj->op.get_default_device ();
- } else {
- return NULL;
- }
-}
-
-/*!Return an array of device names. If you want a specific
- devices, dor a driver give that device, if you want hardware
- devices, give DRIVER_DEVICE and if you want all possible devices,
- image drivers and hardware drivers give DRIVER_UNKNOWN.
-
- NULL is returned if we couldn't return a list of devices.
-*/
-char **
-cdio_get_devices (driver_id_t driver_id)
-{
- /* Probably could get away with &driver_id below. */
- driver_id_t driver_id_temp = driver_id;
- return cdio_get_devices_ret (&driver_id_temp);
-}
-
-char **
-cdio_get_devices_ret (/*in/out*/ driver_id_t *p_driver_id)
-{
- CdIo *p_cdio;
-
- switch (*p_driver_id) {
- /* FIXME: spit out unknown to give image drivers as well. */
- case DRIVER_UNKNOWN:
- case DRIVER_DEVICE:
- p_cdio = scan_for_driver(DRIVER_UNKNOWN, CDIO_MAX_DRIVER, NULL, NULL);
- *p_driver_id = cdio_get_driver_id(p_cdio);
- break;
- default:
- return (*CdIo_all_drivers[*p_driver_id].get_devices)();
- }
-
- if (p_cdio == NULL) return NULL;
- if (p_cdio->op.get_devices) {
- char **devices = p_cdio->op.get_devices ();
- cdio_destroy(p_cdio);
- return devices;
- } else {
- return NULL;
- }
-}
-
-/*!
- Return an array of device names in search_devices that have at
- least the capabilities listed by cap. If search_devices is NULL,
- then we'll search all possible CD drives.
-
- If "any" is set false then every capability listed in the extended
- portion of capabilities (i.e. not the basic filesystem) must be
- satisified. If "any" is set true, then if any of the capabilities
- matches, we call that a success.
-
- To find a CD-drive of any type, use the mask CDIO_FS_MATCH_ALL.
-
- NULL is returned if we couldn't get a default device.
- It is also possible to return a non NULL but after dereferencing the
- the value is NULL. This also means nothing was found.
-*/
-char **
-cdio_get_devices_with_cap (/*out*/ char* search_devices[],
- cdio_fs_anal_t capabilities, bool any)
-{
- driver_id_t p_driver_id;
- return cdio_get_devices_with_cap_ret (search_devices, capabilities, any,
- &p_driver_id);
-}
-
-char **
-cdio_get_devices_with_cap_ret (/*out*/ char* search_devices[],
- cdio_fs_anal_t capabilities, bool any,
- /*out*/ driver_id_t *p_driver_id)
-{
- char **drives=search_devices;
- char **drives_ret=NULL;
- unsigned int i_drives=0;
-
- *p_driver_id = DRIVER_DEVICE;
-
- if (NULL == drives) drives=cdio_get_devices_ret(p_driver_id);
- if (NULL == drives) return NULL;
-
- if (capabilities == CDIO_FS_MATCH_ALL) {
- /* Duplicate drives into drives_ret. */
- char **d = drives;
-
- for( ; *d != NULL; d++ ) {
- cdio_add_device_list(&drives_ret, *d, &i_drives);
- }
- } else {
- cdio_fs_anal_t got_fs=0;
- cdio_fs_anal_t need_fs = CDIO_FSTYPE(capabilities);
- cdio_fs_anal_t need_fs_ext;
- char **d = drives;
- need_fs_ext = capabilities & ~CDIO_FS_MASK;
-
- for( ; *d != NULL; d++ ) {
- CdIo *cdio = cdio_open(*d, *p_driver_id);
-
- if (NULL != cdio) {
- track_t first_track = cdio_get_first_track_num(cdio);
- cdio_iso_analysis_t cdio_iso_analysis;
- got_fs = cdio_guess_cd_type(cdio, 0, first_track,
- &cdio_iso_analysis);
- /* Match on fs and add */
- if ( (CDIO_FS_UNKNOWN == need_fs || CDIO_FSTYPE(got_fs) == need_fs) )
- {
- bool doit = any
- ? (got_fs & need_fs_ext) != 0
- : (got_fs | ~need_fs_ext) == -1;
- if (doit)
- cdio_add_device_list(&drives_ret, *d, &i_drives);
- }
-
- cdio_destroy(cdio);
- }
- }
- }
- cdio_add_device_list(&drives_ret, NULL, &i_drives);
- cdio_free_device_list(drives);
- free(drives);
- return drives_ret;
-}
-
-/*!
- Get medium associated with cd_obj.
-*/
-discmode_t
-cdio_get_discmode (CdIo *cd_obj)
-{
- if (cd_obj == NULL) return CDIO_DISC_MODE_ERROR;
-
- if (cd_obj->op.get_discmode) {
- return cd_obj->op.get_discmode (cd_obj->env);
- } else {
- return CDIO_DISC_MODE_NO_INFO;
- }
-}
-
-/*!
- Return the the kind of drive capabilities of device.
-
- Note: string is malloc'd so caller should free() then returned
- string when done with it.
-
- */
-void
-cdio_get_drive_cap (const CdIo *p_cdio,
- cdio_drive_read_cap_t *p_read_cap,
- cdio_drive_write_cap_t *p_write_cap,
- cdio_drive_misc_cap_t *p_misc_cap)
-{
- /* This seems like a safe bet. */
- *p_read_cap = CDIO_DRIVE_CAP_UNKNOWN;
- *p_write_cap = CDIO_DRIVE_CAP_UNKNOWN;
- *p_misc_cap = CDIO_DRIVE_CAP_UNKNOWN;
-
- if (p_cdio && p_cdio->op.get_drive_cap) {
- p_cdio->op.get_drive_cap(p_cdio->env, p_read_cap, p_write_cap, p_misc_cap);
- }
-}
-
-/*!
- Return the the kind of drive capabilities of device.
-
- Note: string is malloc'd so caller should free() then returned
- string when done with it.
-
- */
-void
-cdio_get_drive_cap_dev (const char *device,
- cdio_drive_read_cap_t *p_read_cap,
- cdio_drive_write_cap_t *p_write_cap,
- cdio_drive_misc_cap_t *p_misc_cap)
-{
- /* This seems like a safe bet. */
- CdIo *cdio=scan_for_driver(CDIO_MIN_DRIVER, CDIO_MAX_DRIVER,
- device, NULL);
- if (cdio) {
- cdio_get_drive_cap(cdio, p_read_cap, p_write_cap, p_misc_cap);
- cdio_destroy(cdio);
- } else {
- *p_read_cap = CDIO_DRIVE_CAP_UNKNOWN;
- *p_write_cap = CDIO_DRIVE_CAP_UNKNOWN;
- *p_misc_cap = CDIO_DRIVE_CAP_UNKNOWN;
- }
-}
-
-
-/*!
- Return a string containing the name of the driver in use.
- if CdIo is NULL (we haven't initialized a specific device driver),
- then return NULL.
-*/
-const char *
-cdio_get_driver_name (const CdIo *cdio)
-{
- if (NULL==cdio) return NULL;
- return CdIo_all_drivers[cdio->driver_id].name;
-}
-
- /*!
- Return the driver id.
- if CdIo is NULL (we haven't initialized a specific device driver),
- then return DRIVER_UNKNOWN.
- */
-driver_id_t
-cdio_get_driver_id (const CdIo *cdio)
-{
- if (NULL==cdio) return DRIVER_UNKNOWN;
- return cdio->driver_id;
-}
-
-
-/*!
- Return the number of the first track.
- CDIO_INVALID_TRACK is returned on error.
-*/
-track_t
-cdio_get_first_track_num (const CdIo *p_cdio)
-{
- if (NULL == p_cdio) return CDIO_INVALID_TRACK;
-
- if (p_cdio->op.get_first_track_num) {
- return p_cdio->op.get_first_track_num (p_cdio->env);
- } else {
- return CDIO_INVALID_TRACK;
- }
-}
-
-/*!
- Return a string containing the name of the driver in use.
- if CdIo is NULL (we haven't initialized a specific device driver),
- then return NULL.
-*/
-bool
-cdio_get_hwinfo (const CdIo *p_cdio, cdio_hwinfo_t *hw_info)
-{
- if (!p_cdio) return false;
- if (p_cdio->op.get_hwinfo) {
- return p_cdio->op.get_hwinfo (p_cdio, hw_info);
- } else {
- /* Perhaps driver forgot to initialize. We are no worse off Using
- scsi_mmc than returning false here. */
- return scsi_mmc_get_hwinfo(p_cdio, hw_info);
- }
-}
-
-/*!
- Return a string containing the name of the driver in use.
- if CdIo is NULL (we haven't initialized a specific device driver),
- then return NULL.
-*/
-char *
-cdio_get_mcn (const CdIo *p_cdio)
-{
- if (p_cdio->op.get_mcn) {
- return p_cdio->op.get_mcn (p_cdio->env);
- } else {
- return NULL;
- }
-}
-
-/*!
- Return the number of tracks in the current medium.
- CDIO_INVALID_TRACK is returned on error.
-*/
-track_t
-cdio_get_num_tracks (const CdIo *p_cdio)
-{
- if (p_cdio == NULL) return CDIO_INVALID_TRACK;
-
- if (p_cdio->op.get_num_tracks) {
- return p_cdio->op.get_num_tracks (p_cdio->env);
- } else {
- return CDIO_INVALID_TRACK;
- }
-}
-
-/*!
- Get format of track.
-*/
-track_format_t
-cdio_get_track_format(const CdIo *p_cdio, track_t i_track)
-{
- cdio_assert (p_cdio != NULL);
-
- if (p_cdio->op.get_track_format) {
- return p_cdio->op.get_track_format (p_cdio->env, i_track);
- } else {
- return TRACK_FORMAT_ERROR;
- }
-}
-
-/*!
- Return true if we have XA data (green, mode2 form1) or
- XA data (green, mode2 form2). That is track begins:
- sync - header - subheader
- 12 4 - 8
-
- FIXME: there's gotta be a better design for this and get_track_format?
-*/
-bool
-cdio_get_track_green(const CdIo *cdio, track_t track_num)
-{
- cdio_assert (cdio != NULL);
-
- if (cdio->op.get_track_green) {
- return cdio->op.get_track_green (cdio->env, track_num);
- } else {
- return false;
- }
-}
-
-/*!
- Return the starting LBA for track number
- track_num in cdio. Tracks numbers start at 1.
- The "leadout" track is specified either by
- using track_num LEADOUT_TRACK or the total tracks+1.
- CDIO_INVALID_LBA is returned on error.
-*/
-lba_t
-cdio_get_track_lba(const CdIo *cdio, track_t track_num)
-{
- if (cdio == NULL) return CDIO_INVALID_LBA;
-
- if (cdio->op.get_track_lba) {
- return cdio->op.get_track_lba (cdio->env, track_num);
- } else {
- msf_t msf;
- if (cdio->op.get_track_msf)
- if (cdio_get_track_msf(cdio, track_num, &msf))
- return cdio_msf_to_lba(&msf);
- return CDIO_INVALID_LBA;
- }
-}
-
-/*!
- Return the starting LSN for track number
- track_num in cdio. Tracks numbers start at 1.
- The "leadout" track is specified either by
- using track_num LEADOUT_TRACK or the total tracks+1.
- CDIO_INVALID_LBA is returned on error.
-*/
-lsn_t
-cdio_get_track_lsn(const CdIo *cdio, track_t track_num)
-{
- if (cdio == NULL) return CDIO_INVALID_LBA;
-
- if (cdio->op.get_track_lba) {
- return cdio_lba_to_lsn(cdio->op.get_track_lba (cdio->env, track_num));
- } else {
- msf_t msf;
- if (cdio_get_track_msf(cdio, track_num, &msf))
- return cdio_msf_to_lsn(&msf);
- return CDIO_INVALID_LSN;
- }
-}
-
-/*!
- Return the starting MSF (minutes/secs/frames) for track number
- track_num in cdio. Track numbers start at 1.
- The "leadout" track is specified either by
- using track_num LEADOUT_TRACK or the total tracks+1.
- False is returned if there is no track entry.
-*/
-bool
-cdio_get_track_msf(const CdIo *cdio, track_t track_num, /*out*/ msf_t *msf)
-{
- cdio_assert (cdio != NULL);
-
- if (cdio->op.get_track_msf) {
- return cdio->op.get_track_msf (cdio->env, track_num, msf);
- } else if (cdio->op.get_track_lba) {
- lba_t lba = cdio->op.get_track_lba (cdio->env, track_num);
- if (lba == CDIO_INVALID_LBA) return false;
- cdio_lba_to_msf(lba, msf);
- return true;
- } else {
- return false;
- }
-}
-
-/*!
- Return the number of sectors between this track an the next. This
- includes any pregap sectors before the start of the next track.
- Tracks start at 1.
- 0 is returned if there is an error.
-*/
-unsigned int
-cdio_get_track_sec_count(const CdIo *cdio, track_t track_num)
-{
- track_t num_tracks = cdio_get_num_tracks(cdio);
-
- if (track_num >=1 && track_num <= num_tracks)
- return ( cdio_get_track_lba(cdio, track_num+1)
- - cdio_get_track_lba(cdio, track_num) );
- return 0;
-}
-
-bool
-cdio_have_driver(driver_id_t driver_id)
-{
- return (*CdIo_all_drivers[driver_id].have_driver)();
-}
-
-/*!
- Return the Joliet level recognized for p_cdio.
-*/
-uint8_t
-cdio_get_joliet_level(const CdIo *p_cdio)
-{
- if (!p_cdio) return 0;
- {
- const generic_img_private_t *p_env
- = (generic_img_private_t *) (p_cdio->env);
- return p_env->i_joliet_level;
- }
-}
-
-bool
-cdio_is_device(const char *psz_source, driver_id_t driver_id)
-{
- if (CdIo_all_drivers[driver_id].is_device == NULL) return false;
- return (*CdIo_all_drivers[driver_id].is_device)(psz_source);
-}
-
-
-/*!
- Initialize CD Reading and control routines. Should be called first.
- May be implicitly called by other routines if not called first.
-*/
-bool
-cdio_init(void)
-{
-
- CdIo_driver_t *all_dp;
- CdIo_driver_t *dp = CdIo_driver;
- driver_id_t driver_id;
-
- if (CdIo_last_driver != CDIO_DRIVER_UNINIT) {
- cdio_warn ("Init routine called more than once.");
- return false;
- }
-
- for (driver_id=DRIVER_UNKNOWN; driver_id<=CDIO_MAX_DRIVER; driver_id++) {
- all_dp = &CdIo_all_drivers[driver_id];
- if ((*CdIo_all_drivers[driver_id].have_driver)()) {
- *dp++ = *all_dp;
- CdIo_last_driver++;
- }
- }
-
- return true;
-}
-
-CdIo *
-cdio_new (generic_img_private_t *p_env, cdio_funcs *p_funcs)
-{
- CdIo *p_new_cdio = _cdio_malloc (sizeof (CdIo));
-
- if (NULL == p_new_cdio) return NULL;
-
- p_new_cdio->env = p_env; /* This is the private "environment" that
- driver-dependent routines use. */
- p_new_cdio->op = *p_funcs;
- p_env->cdio = p_new_cdio; /* A way for the driver-dependent routines
- to access the higher-level general cdio
- object. */
- return p_new_cdio;
-}
-
-/*!
- Free any resources associated with cdio.
-*/
-void
-cdio_destroy (CdIo *cdio)
-{
- CdIo_last_driver = CDIO_DRIVER_UNINIT;
- if (cdio == NULL) return;
-
- if (cdio->op.free != NULL)
- cdio->op.free (cdio->env);
- free (cdio);
-}
-
-/*!
- lseek - reposition read/write file offset
- Returns (off_t) -1 on error.
- Similar to (if not the same as) libc's lseek()
-*/
-off_t
-cdio_lseek (const CdIo *cdio, off_t offset, int whence)
-{
- if (cdio == NULL) return -1;
-
- if (cdio->op.lseek)
- return cdio->op.lseek (cdio->env, offset, whence);
- return -1;
-}
-
-/*!
- Reads into buf the next size bytes.
- Returns -1 on error.
- Similar to (if not the same as) libc's read()
-*/
-ssize_t
-cdio_read (const CdIo *p_cdio, void *buf, size_t size)
-{
- if (p_cdio == NULL) return -1;
-
- if (p_cdio->op.read)
- return p_cdio->op.read (p_cdio->env, buf, size);
- return -1;
-}
-
-/*!
- Reads an audio sector from cd device into data starting
- from lsn. Returns 0 if no error.
-*/
-int
-cdio_read_audio_sector (const CdIo *p_cdio, void *buf, lsn_t lsn)
-{
-
- if (NULL == p_cdio || NULL == buf || CDIO_INVALID_LSN == lsn )
- return 0;
-
- if (p_cdio->op.read_audio_sectors != NULL)
- return p_cdio->op.read_audio_sectors (p_cdio->env, buf, lsn, 1);
- return -1;
-}
-
-/*!
- Reads audio sectors from cd device into data starting
- from lsn. Returns 0 if no error.
-*/
-int
-cdio_read_audio_sectors (const CdIo *p_cdio, void *buf, lsn_t lsn,
- unsigned int nblocks)
-{
- if ( NULL == p_cdio || NULL == buf || CDIO_INVALID_LSN == lsn )
- return 0;
-
- if (p_cdio->op.read_audio_sectors != NULL)
- return p_cdio->op.read_audio_sectors (p_cdio->env, buf, lsn, nblocks);
- return -1;
-}
-
-#ifndef SEEK_SET
-#define SEEK_SET 0
-#endif
-
-/*!
- Reads a single mode1 form1 or form2 sector from cd device
- into data starting from lsn. Returns 0 if no error.
- */
-int
-cdio_read_mode1_sector (const CdIo *p_cdio, void *data, lsn_t lsn,
- bool b_form2)
-{
- uint32_t size = b_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE ;
-
- if (NULL == p_cdio || NULL == data || CDIO_INVALID_LSN == lsn )
- return 0;
-
- if (p_cdio->op.read_mode1_sector) {
- return p_cdio->op.read_mode1_sector(p_cdio->env, data, lsn, b_form2);
- } else if (p_cdio->op.lseek && p_cdio->op.read) {
- char buf[CDIO_CD_FRAMESIZE] = { 0, };
- if (0 > cdio_lseek(p_cdio, CDIO_CD_FRAMESIZE*lsn, SEEK_SET))
- return -1;
- if (0 > cdio_read(p_cdio, buf, CDIO_CD_FRAMESIZE))
- return -1;
- memcpy (data, buf, size);
- return 0;
- }
-
- return 1;
-
-}
-
-int
-cdio_read_mode1_sectors (const CdIo *cdio, void *buf, lsn_t lsn,
- bool b_form2, unsigned int num_sectors)
-{
-
- if (NULL == cdio || NULL == buf || CDIO_INVALID_LSN == lsn )
- return 0;
-
- cdio_assert (cdio->op.read_mode1_sectors != NULL);
-
- return cdio->op.read_mode1_sectors (cdio->env, buf, lsn, b_form2,
- num_sectors);
-}
-
-/*!
- Reads a single mode2 sector from cd device into data starting
- from lsn. Returns 0 if no error.
- */
-int
-cdio_read_mode2_sector (const CdIo *cdio, void *buf, lsn_t lsn,
- bool b_form2)
-{
- if (NULL == cdio || NULL == buf || CDIO_INVALID_LSN == lsn )
- return 0;
-
- cdio_assert (cdio->op.read_mode2_sector != NULL
- || cdio->op.read_mode2_sectors != NULL);
-
- if (cdio->op.read_mode2_sector)
- return cdio->op.read_mode2_sector (cdio->env, buf, lsn, b_form2);
-
- /* fallback */
- if (cdio->op.read_mode2_sectors != NULL)
- return cdio_read_mode2_sectors (cdio, buf, lsn, b_form2, 1);
- return 1;
-}
-
-int
-cdio_read_mode2_sectors (const CdIo *cdio, void *buf, lsn_t lsn,
- bool b_form2, unsigned int num_sectors)
-{
-
- if (NULL == cdio || NULL == buf || CDIO_INVALID_LSN == lsn )
- return 0;
-
- cdio_assert (cdio->op.read_mode2_sectors != NULL);
-
- return cdio->op.read_mode2_sectors (cdio->env, buf, lsn,
- b_form2, num_sectors);
-}
-
-uint32_t
-cdio_stat_size (const CdIo *cdio)
-{
- cdio_assert (cdio != NULL);
-
- return cdio->op.stat_size (cdio->env);
-}
-
-/*!
- Set the arg "key" with "value" in the source device.
-*/
-int
-cdio_set_arg (CdIo *cdio, const char key[], const char value[])
-{
- cdio_assert (cdio != NULL);
- cdio_assert (cdio->op.set_arg != NULL);
- cdio_assert (key != NULL);
-
- return cdio->op.set_arg (cdio->env, key, value);
-}
-
-/*! Sets up to read from place specified by source_name and
- driver_id. This should be called before using any other routine,
- except cdio_init. This will call cdio_init, if that hasn't been
- done previously.
-
- NULL is returned on error.
-*/
-CdIo *
-cdio_open (const char *orig_source_name, driver_id_t driver_id)
-{
- return cdio_open_am(orig_source_name, driver_id, NULL);
-}
-
-/*! Sets up to read from place specified by source_name and
- driver_id. This should be called before using any other routine,
- except cdio_init. This will call cdio_init, if that hasn't been
- done previously.
-
- NULL is returned on error.
-*/
-CdIo *
-cdio_open_am (const char *psz_orig_source, driver_id_t driver_id,
- const char *psz_access_mode)
-{
- char *psz_source;
-
- if (CdIo_last_driver == -1) cdio_init();
-
- if (NULL == psz_orig_source || strlen(psz_orig_source)==0)
- psz_source = cdio_get_default_device(NULL);
- else
- psz_source = strdup(psz_orig_source);
-
- switch (driver_id) {
- case DRIVER_UNKNOWN:
- {
- CdIo *cdio=scan_for_driver(CDIO_MIN_DRIVER, CDIO_MAX_DRIVER,
- psz_source, psz_access_mode);
- free(psz_source);
- return cdio;
- }
- case DRIVER_DEVICE:
- {
- /* Scan for a driver. */
- CdIo *ret = cdio_open_am_cd(psz_source, psz_access_mode);
- free(psz_source);
- return ret;
- }
- break;
- case DRIVER_BSDI:
- case DRIVER_FREEBSD:
- case DRIVER_LINUX:
- case DRIVER_SOLARIS:
- case DRIVER_WIN32:
- case DRIVER_OSX:
- case DRIVER_NRG:
- case DRIVER_BINCUE:
- case DRIVER_CDRDAO:
- if ((*CdIo_all_drivers[driver_id].have_driver)()) {
- CdIo *ret =
- (*CdIo_all_drivers[driver_id].driver_open_am)(psz_source,
- psz_access_mode);
- if (ret) ret->driver_id = driver_id;
- free(psz_source);
- return ret;
- }
- }
-
- free(psz_source);
- return NULL;
-}
-
-
-/*!
- Set up CD-ROM for reading. The device_name is
- the some sort of device name.
-
- @return the cdio object for subsequent operations.
- NULL on error or there is no driver for a some sort of hardware CD-ROM.
-*/
-CdIo *
-cdio_open_cd (const char *psz_source)
-{
- return cdio_open_am_cd(psz_source, NULL);
-}
-
-/*!
- Set up CD-ROM for reading. The device_name is
- the some sort of device name.
-
- @return the cdio object for subsequent operations.
- NULL on error or there is no driver for a some sort of hardware CD-ROM.
-*/
-/* In the future we'll have more complicated code to allow selection
- of an I/O routine as well as code to find an appropriate default
- routine among the "registered" routines. Possibly classes too
- disk-based, SCSI-based, native-based, vendor (e.g. Sony, or
- Plextor) based
-
- For now though, we'll start more simply...
-*/
-CdIo *
-cdio_open_am_cd (const char *psz_source, const char *psz_access_mode)
-{
- if (CdIo_last_driver == -1) cdio_init();
-
- /* Scan for a driver. */
- return scan_for_driver(CDIO_MIN_DEVICE_DRIVER, CDIO_MAX_DEVICE_DRIVER,
- psz_source, psz_access_mode);
-}
-
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libcdio/cdio/Makefile.am b/src/input/vcd/libcdio/cdio/Makefile.am
deleted file mode 100644
index 0910d60e5..000000000
--- a/src/input/vcd/libcdio/cdio/Makefile.am
+++ /dev/null
@@ -1,19 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-noinst_HEADERS = \
- bytesex.h \
- bytesex_asm.h \
- cdio.h \
- cdtext.h \
- cdtext.h \
- cd_types.h \
- ds.h \
- dvd.h \
- iso9660.h \
- logging.h \
- sector.h \
- scsi_mmc.h \
- types.h \
- util.h \
- version.h \
- xa.h
diff --git a/src/input/vcd/libcdio/cdio/bytesex.h b/src/input/vcd/libcdio/cdio/bytesex.h
deleted file mode 100644
index c40e44729..000000000
--- a/src/input/vcd/libcdio/cdio/bytesex.h
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- $Id: bytesex.h,v 1.1 2005/01/02 00:51:38 rockyb Exp $
-
- Copyright (C) 2000, 2004 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifndef __CDIO_BYTESEX_H__
-#define __CDIO_BYTESEX_H__
-
-#include <cdio/types.h>
-#include <cdio/bytesex_asm.h>
-#include <cdio/logging.h>
-
-/* generic byteswap routines */
-
-#define UINT16_SWAP_LE_BE_C(val) ((uint16_t) ( \
- (((uint16_t) (val) & (uint16_t) 0x00ffU) << 8) | \
- (((uint16_t) (val) & (uint16_t) 0xff00U) >> 8)))
-
-#define UINT32_SWAP_LE_BE_C(val) ((uint32_t) ( \
- (((uint32_t) (val) & (uint32_t) 0x000000ffU) << 24) | \
- (((uint32_t) (val) & (uint32_t) 0x0000ff00U) << 8) | \
- (((uint32_t) (val) & (uint32_t) 0x00ff0000U) >> 8) | \
- (((uint32_t) (val) & (uint32_t) 0xff000000U) >> 24)))
-
-#define UINT64_SWAP_LE_BE_C(val) ((uint64_t) ( \
- (((uint64_t) (val) & (uint64_t) UINT64_C(0x00000000000000ff)) << 56) | \
- (((uint64_t) (val) & (uint64_t) UINT64_C(0x000000000000ff00)) << 40) | \
- (((uint64_t) (val) & (uint64_t) UINT64_C(0x0000000000ff0000)) << 24) | \
- (((uint64_t) (val) & (uint64_t) UINT64_C(0x00000000ff000000)) << 8) | \
- (((uint64_t) (val) & (uint64_t) UINT64_C(0x000000ff00000000)) >> 8) | \
- (((uint64_t) (val) & (uint64_t) UINT64_C(0x0000ff0000000000)) >> 24) | \
- (((uint64_t) (val) & (uint64_t) UINT64_C(0x00ff000000000000)) >> 40) | \
- (((uint64_t) (val) & (uint64_t) UINT64_C(0xff00000000000000)) >> 56)))
-
-#ifndef UINT16_SWAP_LE_BE
-# define UINT16_SWAP_LE_BE UINT16_SWAP_LE_BE_C
-#endif
-
-#ifndef UINT32_SWAP_LE_BE
-# define UINT32_SWAP_LE_BE UINT32_SWAP_LE_BE_C
-#endif
-
-#ifndef UINT64_SWAP_LE_BE
-# define UINT64_SWAP_LE_BE UINT64_SWAP_LE_BE_C
-#endif
-
-inline static
-uint16_t uint16_swap_le_be (const uint16_t val)
-{
- return UINT16_SWAP_LE_BE (val);
-}
-
-inline static
-uint32_t uint32_swap_le_be (const uint32_t val)
-{
- return UINT32_SWAP_LE_BE (val);
-}
-
-inline static
-uint64_t uint64_swap_le_be (const uint64_t val)
-{
- return UINT64_SWAP_LE_BE (val);
-}
-
-# define UINT8_TO_BE(val) ((uint8_t) (val))
-# define UINT8_TO_LE(val) ((uint8_t) (val))
-#ifdef WORDS_BIGENDIAN
-# define UINT16_TO_BE(val) ((uint16_t) (val))
-# define UINT16_TO_LE(val) ((uint16_t) UINT16_SWAP_LE_BE(val))
-
-# define UINT32_TO_BE(val) ((uint32_t) (val))
-# define UINT32_TO_LE(val) ((uint32_t) UINT32_SWAP_LE_BE(val))
-
-# define UINT64_TO_BE(val) ((uint64_t) (val))
-# define UINT64_TO_LE(val) ((uint64_t) UINT64_SWAP_LE_BE(val))
-#else
-# define UINT16_TO_BE(val) ((uint16_t) UINT16_SWAP_LE_BE(val))
-# define UINT16_TO_LE(val) ((uint16_t) (val))
-
-# define UINT32_TO_BE(val) ((uint32_t) UINT32_SWAP_LE_BE(val))
-# define UINT32_TO_LE(val) ((uint32_t) (val))
-
-# define UINT64_TO_BE(val) ((uint64_t) UINT64_SWAP_LE_BE(val))
-# define UINT64_TO_LE(val) ((uint64_t) (val))
-#endif
-
-/* symmetric conversions */
-#define UINT8_FROM_BE(val) (UINT8_TO_BE (val))
-#define UINT8_FROM_LE(val) (UINT8_TO_LE (val))
-#define UINT16_FROM_BE(val) (UINT16_TO_BE (val))
-#define UINT16_FROM_LE(val) (UINT16_TO_LE (val))
-#define UINT32_FROM_BE(val) (UINT32_TO_BE (val))
-#define UINT32_FROM_LE(val) (UINT32_TO_LE (val))
-#define UINT64_FROM_BE(val) (UINT64_TO_BE (val))
-#define UINT64_FROM_LE(val) (UINT64_TO_LE (val))
-
-/* converter function template */
-#define CVT_TO_FUNC(bits) \
- static inline uint ## bits ## _t \
- uint ## bits ## _to_be (uint ## bits ## _t val) \
- { return UINT ## bits ## _TO_BE (val); } \
- static inline uint ## bits ## _t \
- uint ## bits ## _to_le (uint ## bits ## _t val) \
- { return UINT ## bits ## _TO_LE (val); } \
-
-CVT_TO_FUNC(8)
-CVT_TO_FUNC(16)
-CVT_TO_FUNC(32)
-CVT_TO_FUNC(64)
-
-#undef CVT_TO_FUNC
-
-#define uint8_from_be(val) (uint8_to_be (val))
-#define uint8_from_le(val) (uint8_to_le (val))
-#define uint16_from_be(val) (uint16_to_be (val))
-#define uint16_from_le(val) (uint16_to_le (val))
-#define uint32_from_be(val) (uint32_to_be (val))
-#define uint32_from_le(val) (uint32_to_le (val))
-#define uint64_from_be(val) (uint64_to_be (val))
-#define uint64_from_le(val) (uint64_to_le (val))
-
-/* ISO9660 related stuff */
-
-#define to_711(i) uint8_to_le(i)
-#define from_711(i) uint8_from_le(i)
-
-#define to_721(i) uint16_to_le(i)
-#define from_721(i) uint16_from_le(i)
-
-#define to_721(i) uint16_to_le(i)
-#define from_721(i) uint16_from_le(i)
-
-#define to_722(i) uint16_to_be(i)
-#define from_722(i) uint16_from_be(i)
-
-static inline uint32_t
-to_723(uint16_t i)
-{
- return uint32_swap_le_be(i) | i;
-}
-
-static inline uint16_t
-from_723 (uint32_t p)
-{
- if (uint32_swap_le_be (p) != p)
- cdio_warn ("from_723: broken byte order");
-
- return (0xFFFF & p);
-}
-
-#define to_731(i) uint32_to_le(i)
-#define from_731(i) uint32_from_le(i)
-
-#define to_732(i) uint32_to_be(i)
-#define from_732(i) uint32_from_be(i)
-
-static inline uint64_t
-to_733(uint32_t i)
-{
- return uint64_swap_le_be(i) | i;
-}
-
-static inline uint32_t
-from_733 (uint64_t p)
-{
- if (uint64_swap_le_be (p) != p)
- cdio_warn ("from_733: broken byte order");
-
- return (UINT32_C(0xFFFFFFFF) & p);
-}
-
-#endif /* __CDIO_BYTESEX_H__ */
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libcdio/cdio/bytesex_asm.h b/src/input/vcd/libcdio/cdio/bytesex_asm.h
deleted file mode 100644
index 4291563ec..000000000
--- a/src/input/vcd/libcdio/cdio/bytesex_asm.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- $Id: bytesex_asm.h,v 1.1 2005/01/02 00:51:38 rockyb Exp $
-
- Copyright (C) 2001 Sven Ottemann <ac-logic@freenet.de>
- 2001, 2004 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifndef __CDIO_BYTESEX_ASM_H__
-#define __CDIO_BYTESEX_ASM_H__
-#if !defined(DISABLE_ASM_OPTIMIZE)
-
-#include <cdio/types.h>
-
-#if defined(__powerpc__) && defined(__GNUC__)
-
-inline static
-uint32_t uint32_swap_le_be_asm(const uint32_t a)
-{
- uint32_t b;
-
- __asm__ ("lwbrx %0,0,%1"
- :"=r"(b)
- :"r"(&a), "m"(a));
-
- return b;
-}
-
-inline static
-uint16_t uint16_swap_le_be_asm(const uint16_t a)
-{
- uint32_t b;
-
- __asm__ ("lhbrx %0,0,%1"
- :"=r"(b)
- :"r"(&a), "m"(a));
-
- return b;
-}
-
-#define UINT16_SWAP_LE_BE uint16_swap_le_be_asm
-#define UINT32_SWAP_LE_BE uint32_swap_le_be_asm
-
-#elif defined(__mc68000__) && defined(__STORMGCC__)
-
-inline static
-uint32_t uint32_swap_le_be_asm(uint32_t a __asm__("d0"))
-{
- /* __asm__("rolw #8,%0; swap %0; rolw #8,%0" : "=d" (val) : "0" (val)); */
-
- __asm__("move.l %1,d0;rol.w #8,d0;swap d0;rol.w #8,d0;move.l d0,%0"
- :"=r"(a)
- :"r"(a));
-
- return(a);
-}
-
-inline static
-uint16_t uint16_swap_le_be_asm(uint16_t a __asm__("d0"))
-{
- __asm__("move.l %1,d0;rol.w #8,d0;move.l d0,%0"
- :"=r"(a)
- :"r"(a));
-
- return(a);
-}
-
-#define UINT16_SWAP_LE_BE uint16_swap_le_be_asm
-#define UINT32_SWAP_LE_BE uint32_swap_le_be_asm
-
-#elif 0 && defined(__i386__) && defined(__GNUC__)
-
-inline static
-uint32_t uint32_swap_le_be_asm(uint32_t a)
-{
- __asm__("xchgb %b0,%h0\n\t" /* swap lower bytes */
- "rorl $16,%0\n\t" /* swap words */
- "xchgb %b0,%h0" /* swap higher bytes */
- :"=q" (a)
- : "0" (a));
-
- return(a);
-}
-
-inline static
-uint16_t uint16_swap_le_be_asm(uint16_t a)
-{
- __asm__("xchgb %b0,%h0" /* swap bytes */
- : "=q" (a)
- : "0" (a));
-
- return(a);
-}
-
-#define UINT16_SWAP_LE_BE uint16_swap_le_be_asm
-#define UINT32_SWAP_LE_BE uint32_swap_le_be_asm
-
-#endif
-
-#endif /* !defined(DISABLE_ASM_OPTIMIZE) */
-#endif /* __CDIO_BYTESEX_ASM_H__ */
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libcdio/cdio/cd_types.h b/src/input/vcd/libcdio/cdio/cd_types.h
deleted file mode 100644
index 9f4a73f67..000000000
--- a/src/input/vcd/libcdio/cdio/cd_types.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- $Id: cd_types.h,v 1.3 2005/01/01 02:43:58 rockyb Exp $
-
- Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
- Copyright (C) 1996,1997,1998 Gerd Knorr <kraxel@bytesex.org>
- and Heiko Eißfeldt <heiko@hexco.de>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/** \file cd_types.h
- * \brief Header for routines which automatically determine the Compact Disc
- * format and possibly filesystem on the CD.
- *
- */
-
-#ifndef __CDIO_CD_TYPES_H__
-#define __CDIO_CD_TYPES_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/**
- * Filesystem types we understand. The highest-numbered fs type should
- * be less than CDIO_FS_MASK defined below.
- */
-#define CDIO_FS_AUDIO 1 /**< audio only - not really a
- filesystem */
-#define CDIO_FS_HIGH_SIERRA 2
-#define CDIO_FS_ISO_9660 3 /**< ISO 9660 filesystem */
-#define CDIO_FS_INTERACTIVE 4
-#define CDIO_FS_HFS 5 /**< file system used on the Macintosh
- system in MacOS 6 through MacOS 9
- and depricated in OSX. */
-#define CDIO_FS_UFS 6 /**< Generic Unix file system derived
- from the Berkeley fast file
- system. */
-
-/**
- * EXT2 was the GNU/Linux native filesystem for early kernels. Newer
- * GNU/Linux OS's may use EXT3 which EXT2 with a journal.
- */
-#define CDIO_FS_EXT2 7
-
-#define CDIO_FS_ISO_HFS 8 /**< both HFS & ISO-9660 filesystem */
-#define CDIO_FS_ISO_9660_INTERACTIVE 9 /**< both CD-RTOS and ISO filesystem */
-
-
-/**
- * The 3DO is, technically, a set of specifications created by the 3DO
- * company. These specs are for making a 3DO Interactive Multiplayer
- * which uses a CD-player. Panasonic in the early 90's was the first
- * company to manufacture and market a 3DO player.
- */
-#define CDIO_FS_3DO 10
-
-/**
- Microsoft X-BOX CD.
- */
-#define CDIO_FS_XISO 11
-#define CDIO_FS_UDFX 12
-#define CDIO_FS_UDF 13
-#define CDIO_FS_ISO_UDF 14
-
-
-#define CDIO_FS_MASK 15 /**< Note: this should be 2**n-1 and
- and greater than the highest
- CDIO_FS number above */
-#define CDIO_FS_UNKNOWN CDIO_FS_MASK
-
-/**
- * Macro to extract just the FS type portion defined above
-*/
-#define CDIO_FSTYPE(fs) (fs & CDIO_FS_MASK)
-
-/**
- * Bit masks for the classes of CD-images. These are generally
- * higher-level than the fs-type information above and may be determined
- * based of the fs type information.
- */
-#define CDIO_FS_ANAL_XA 0x0010 /**< eXtended Architecture format */
-#define CDIO_FS_ANAL_MULTISESSION 0x0020 /**< CD has multisesion */
-#define CDIO_FS_ANAL_PHOTO_CD 0x0040 /**< Is a Kodak Photo CD */
-#define CDIO_FS_ANAL_HIDDEN_TRACK 0x0080 /**< Hidden track at the
- beginning of the CD */
-#define CDIO_FS_ANAL_CDTV 0x0100
-#define CDIO_FS_ANAL_BOOTABLE 0x0200 /**< CD is bootable */
-#define CDIO_FS_ANAL_VIDEOCD 0x0400 /**< VCD 1.1 */
-#define CDIO_FS_ANAL_ROCKRIDGE 0x0800 /**< Has Rock Ridge Extensions to
- ISO 9660 */
-#define CDIO_FS_ANAL_JOLIET 0x1000 /**< Microsoft Joliet extensions
- to ISO 9660 */
-#define CDIO_FS_ANAL_SVCD 0x2000 /**< Super VCD or Choiji Video CD */
-#define CDIO_FS_ANAL_CVD 0x4000 /**< Choiji Video CD */
-#define CDIO_FS_ANAL_XISO 0x8000 /**< XBOX CD */
-
-/**
- * Pattern which can be used by cdio_get_devices to specify matching
- * any sort of CD.
- */
-#define CDIO_FS_MATCH_ALL (cdio_fs_anal_t) (~CDIO_FS_MASK)
-
-
-/*!
- \brief The type used to return analysis information from
- cdio_guess_cd_type.
-
- These fields make sense only for when an ISO-9660 filesystem is used.
- */
-typedef struct
-{
- unsigned int joliet_level; /**< If has Joliet extensions, this is the
- associated level number (i.e. 1, 2, or 3). */
- char iso_label[33]; /**< This is 32 + 1 for null byte at the end in
- formatting the string */
- unsigned int isofs_size;
- uint8_t UDFVerMinor; /**< For UDF filesystems only */
- uint8_t UDFVerMajor; /**< For UDF filesystems only */
-} cdio_iso_analysis_t;
-
-/**
- * Try to determine what kind of CD-image and/or filesystem we
- * have at track track_num. Return information about the CD image
- * is returned in iso_analysis and the return value.
- */
-cdio_fs_anal_t cdio_guess_cd_type(const CdIo *cdio, int start_session,
- track_t track_num,
- /*out*/ cdio_iso_analysis_t *iso_analysis);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __CDIO_CD_TYPES_H__ */
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libcdio/cdio/cdio.h b/src/input/vcd/libcdio/cdio/cdio.h
deleted file mode 100644
index f9e2a38e3..000000000
--- a/src/input/vcd/libcdio/cdio/cdio.h
+++ /dev/null
@@ -1,980 +0,0 @@
-/* -*- c -*-
- $Id: cdio.h,v 1.4 2005/04/27 23:28:42 rockyb Exp $
-
- Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
- Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/** \file cdio.h
- *
- * \brief The top-level header for libcdio: the CD Input and Control
- * library. Applications include this for anything regarding libcdio.
- */
-
-
-#ifndef __CDIO_H__
-#define __CDIO_H__
-
-/** Application Interface or Protocol version number. If the public
- * interface changes, we increase this number.
- */
-#define CDIO_API_VERSION 2
-
-#include <cdio/version.h>
-
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#include <cdio/types.h>
-#include <cdio/sector.h>
-
-/**! Flags specifying the category of device to open or is opened. */
-
-#define CDIO_SRC_IS_DISK_IMAGE_MASK 0x0001 /**< Read source is a CD image. */
-#define CDIO_SRC_IS_DEVICE_MASK 0x0002 /**< Read source is a CD device. */
-#define CDIO_SRC_IS_SCSI_MASK 0x0004 /**< Read source SCSI device. */
-#define CDIO_SRC_IS_NATIVE_MASK 0x0008
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/*! Size of fields returned by an INQUIRY command */
-#define CDIO_MMC_HW_VENDOR_LEN 8 /**< length of vendor field */
-#define CDIO_MMC_HW_MODEL_LEN 16 /**< length of model field */
-#define CDIO_MMC_HW_REVISION_LEN 4 /**< length of revision field */
-
- /*! \brief Structure to return CD vendor, model, and revision-level
- strings obtained via the INQUIRY command */
- typedef struct cdio_hwinfo
- {
- char psz_vendor [CDIO_MMC_HW_VENDOR_LEN+1];
- char psz_model [CDIO_MMC_HW_MODEL_LEN+1];
- char psz_revision[CDIO_MMC_HW_REVISION_LEN+1];
- } cdio_hwinfo_t;
-
-/* For compatability. */
-#define CdIo CdIo_t
-
- /** This is an opaque structure for the CD object. */
- typedef struct _CdIo CdIo_t;
-
- /** This is an opaque structure for the CD-Text object. */
- typedef struct cdtext cdtext_t;
-
- /** The driver_id_t enumerations may be used to tag a specific driver
- * that is opened or is desired to be opened. Note that this is
- * different than what is available on a given host.
- *
- * Order is a little significant since the order is used in scans.
- * We have to start with DRIVER_UNKNOWN and devices should come before
- * disk-image readers. By putting something towards the top (a lower
- * enumeration number), in an iterative scan we prefer that to
- * something with a higher enumeration number.
- *
- * NOTE: IF YOU MODIFY ENUM MAKE SURE INITIALIZATION IN CDIO.C AGREES.
- *
- */
- typedef enum {
- DRIVER_UNKNOWN, /**< Used as input when we don't care what kind
- of driver to use. */
- DRIVER_BSDI, /**< BSDI driver */
- DRIVER_FREEBSD, /**< FreeBSD driver - includes CAM and ioctl access */
- DRIVER_LINUX, /**< GNU/Linux Driver */
- DRIVER_SOLARIS, /**< Sun Solaris Driver */
- DRIVER_OSX, /**< Apple OSX Driver */
- DRIVER_WIN32, /**< Microsoft Windows Driver. Includes ASPI and
- ioctl acces. */
- DRIVER_CDRDAO, /**< cdrdao format CD image. This is listed
- before BIN/CUE, to make the code prefer cdrdao
- over BIN/CUE when both exist. */
- DRIVER_BINCUE, /**< CDRWIN BIN/CUE format CD image. This is
- listed before NRG, to make the code prefer
- BIN/CUE over NRG when both exist. */
- DRIVER_NRG, /**< Nero NRG format CD image. */
- DRIVER_DEVICE /**< Is really a set of the above; should come last */
- } driver_id_t;
-
- /** There will generally be only one hardware for a given
- build/platform from the list above. You can use the variable
- below to determine which you've got. If the build doesn't make an
- hardware driver, then the value will be DRIVER_UNKNOWN.
- */
- extern const driver_id_t cdio_os_driver;
-
-
-/** Make sure what's listed for CDIO_MIN_DRIVER is the last
- enumeration in driver_id_t. Since we have a bogus (but useful) 0th
- entry above we don't have to add one.
-*/
-#define CDIO_MIN_DRIVER DRIVER_BSDI
-#define CDIO_MIN_DEVICE_DRIVER CDIO_MIN_DRIVER
-#define CDIO_MAX_DRIVER DRIVER_NRG
-#define CDIO_MAX_DEVICE_DRIVER DRIVER_WIN32
-
- typedef enum {
- TRACK_FORMAT_AUDIO, /**< Audio track, e.g. CD-DA */
- TRACK_FORMAT_CDI, /**< CD-i. How this is different from DATA below? */
- TRACK_FORMAT_XA, /**< Mode2 of some sort */
- TRACK_FORMAT_DATA, /**< Mode1 of some sort */
- TRACK_FORMAT_PSX, /**< Playstation CD. Like audio but only 2336 bytes
- * of user data.
- */
- TRACK_FORMAT_ERROR /**< Dunno what is, or some other error. */
- } track_format_t;
-
- extern const char *discmode2str[];
-
- /*! Printable tags for track_format_t enumeration. */
- extern const char *track_format2str[6];
-
- /*!
- Eject media in CD drive if there is a routine to do so.
-
- @param p_cdio the CD object to be acted upon.
- @return 0 if success and 1 for failure, and 2 if no routine.
- If the CD is ejected *p_cdio is freed and p_cdio set to NULL.
- */
- int cdio_eject_media (CdIo_t **p_cdio);
-
- /*!
- Free any resources associated with p_cdio. Call this when done using p_cdio
- and using CD reading/control operations.
-
- @param p_cdio the CD object to eliminated.
- */
- void cdio_destroy (CdIo_t *p_cdio);
-
- /*!
- Free device list returned by cdio_get_devices or
- cdio_get_devices_with_cap.
-
- @param device_list list returned by cdio_get_devices or
- cdio_get_devices_with_cap
-
- @see cdio_get_devices, cdio_get_devices_with_cap
-
- */
- void cdio_free_device_list (char * device_list[]);
-
- /*!
- Get the value associatied with key.
-
- @param p_cdio the CD object queried
- @param key the key to retrieve
- @return the value associatd with "key" or NULL if p_cdio is NULL
- or "key" does not exist.
- */
- const char * cdio_get_arg (const CdIo_t *p_cdio, const char key[]);
-
- /*!
- Get CD-Text information for a CdIo object.
-
- @param p_cdio the CD object that may contain CD-Text information.
- @param i_track track for which we are requesting CD-Text information.
- @return the CD-Text object or NULL if obj is NULL
- or CD-Text information does not exist.
-
- If i_track is 0 or CDIO_CDROM_LEADOUT_TRACK the track returned
- is the information assocated with the CD.
- */
- const cdtext_t *cdio_get_cdtext (CdIo_t *p_cdio, track_t i_track);
-
- /*!
- Get the default CD device.
- if p_cdio is NULL (we haven't initialized a specific device driver),
- then find a suitable one and return the default device for that.
-
- @param p_cdio the CD object queried
- @return a string containing the default CD device or NULL is
- if we couldn't get a default device.
-
- In some situations of drivers or OS's we can't find a CD device if
- there is no media in it and it is possible for this routine to return
- NULL even though there may be a hardware CD-ROM.
- */
- char * cdio_get_default_device (const CdIo_t *p_cdio);
-
- /*! Return an array of device names. If you want a specific
- devices for a driver, give that device. If you want hardware
- devices, give DRIVER_DEVICE and if you want all possible devices,
- image drivers and hardware drivers give DRIVER_UNKNOWN.
-
- NULL is returned if we couldn't return a list of devices.
-
- In some situations of drivers or OS's we can't find a CD device if
- there is no media in it and it is possible for this routine to return
- NULL even though there may be a hardware CD-ROM.
- */
- char ** cdio_get_devices (driver_id_t driver_id);
-
- /*!
- Get an array of device names in search_devices that have at least
- the capabilities listed by the capabities parameter. If
- search_devices is NULL, then we'll search all possible CD drives.
-
- If "b_any" is set false then every capability listed in the
- extended portion of capabilities (i.e. not the basic filesystem)
- must be satisified. If "any" is set true, then if any of the
- capabilities matches, we call that a success.
-
- To find a CD-drive of any type, use the mask CDIO_FS_MATCH_ALL.
-
- @return the array of device names or NULL if we couldn't get a
- default device. It is also possible to return a non NULL but
- after dereferencing the the value is NULL. This also means nothing
- was found.
- */
- char ** cdio_get_devices_with_cap (char* ppsz_search_devices[],
- cdio_fs_anal_t capabilities, bool b_any);
-
- /*!
- Like cdio_get_devices_with_cap but we return the driver we found
- as well. This is because often one wants to search for kind of drive
- and then *open* it afterwards. Giving the driver back facilitates this,
- and speeds things up for libcdio as well.
- */
- char ** cdio_get_devices_with_cap_ret (/*out*/ char* ppsz_search_devices[],
- cdio_fs_anal_t capabilities,
- bool b_any,
- /*out*/ driver_id_t *p_driver_id);
-
- /*! Like cdio_get_devices, but we may change the p_driver_id if we
- were given DRIVER_DEVICE or DRIVER_UNKNOWN. This is because
- often one wants to get a drive name and then *open* it
- afterwards. Giving the driver back facilitates this, and speeds
- things up for libcdio as well.
- */
-
- char ** cdio_get_devices_ret (/*in/out*/ driver_id_t *p_driver_id);
-
- /*!
- Get disc mode - the kind of CD (CD-DA, CD-ROM mode 1, CD-MIXED, etc.
- that we've got. The notion of "CD" is extended a little to include
- DVD's.
- */
- discmode_t cdio_get_discmode (CdIo_t *p_cdio);
-
- /*!
- Get the what kind of device we've got.
-
- @param p_cdio the CD object queried
- @param p_read_cap pointer to return read capabilities
- @param p_write_cap pointer to return write capabilities
- @param p_misc_cap pointer to return miscellaneous other capabilities
-
- In some situations of drivers or OS's we can't find a CD device if
- there is no media in it and it is possible for this routine to return
- NULL even though there may be a hardware CD-ROM.
- */
- void cdio_get_drive_cap (const CdIo_t *p_cdio,
- cdio_drive_read_cap_t *p_read_cap,
- cdio_drive_write_cap_t *p_write_cap,
- cdio_drive_misc_cap_t *p_misc_cap);
-
- /*!
- Get the drive capabilities for a specified device.
-
- @return a list of device capabilities.
-
- In some situations of drivers or OS's we can't find a CD device if
- there is no media in it and it is possible for this routine to return
- NULL even though there may be a hardware CD-ROM.
- */
- void cdio_get_drive_cap_dev (const char *device,
- cdio_drive_read_cap_t *p_read_cap,
- cdio_drive_write_cap_t *p_write_cap,
- cdio_drive_misc_cap_t *p_misc_cap);
-
- /*!
- Get a string containing the name of the driver in use.
-
- @return a string with driver name or NULL if CdIo is NULL (we
- haven't initialized a specific device.
- */
- const char * cdio_get_driver_name (const CdIo_t *p_cdio);
-
- /*!
- Get the driver id.
- if CdIo is NULL (we haven't initialized a specific device driver),
- then return DRIVER_UNKNOWN.
-
- @return the driver id..
- */
- driver_id_t cdio_get_driver_id (const CdIo_t *p_cdio);
-
- /*!
- Get the number of the first track.
-
- @return the track number or CDIO_INVALID_TRACK
- on error.
- */
- track_t cdio_get_first_track_num(const CdIo_t *p_cdio);
-
- /*!
- Get the CD-ROM hardware info via a SCSI MMC INQUIRY command.
- False is returned if we had an error getting the information.
- */
- bool cdio_get_hwinfo ( const CdIo_t *p_cdio,
- /* out*/ cdio_hwinfo_t *p_hw_info );
-
-
- /*!
- Return the Joliet level recognized for p_cdio.
- */
- uint8_t cdio_get_joliet_level(const CdIo_t *p_cdio);
-
- /*!
- Get the media catalog number (MCN) from the CD.
-
- @return the media catalog number r NULL if there is none or we
- don't have the ability to get it.
-
- Note: string is malloc'd so caller has to free() the returned
- string when done with it.
-
- */
- char * cdio_get_mcn (const CdIo_t *p_cdio);
-
- /*!
- Get the number of tracks on the CD.
-
- @return the number of tracks, or CDIO_INVALID_TRACK if there is
- an error.
- */
- track_t cdio_get_num_tracks (const CdIo_t *p_cdio);
-
- /*!
- Get the format (audio, mode2, mode1) of track.
- */
- track_format_t cdio_get_track_format(const CdIo_t *p_cdio, track_t i_track);
-
- /*!
- Return true if we have XA data (green, mode2 form1) or
- XA data (green, mode2 form2). That is track begins:
- sync - header - subheader
- 12 4 - 8
-
- FIXME: there's gotta be a better design for this and get_track_format?
- */
- bool cdio_get_track_green(const CdIo_t *p_cdio, track_t i_track);
-
- /*!
- Get the starting LBA for track number
- i_track in p_cdio. Track numbers usually start at something
- greater than 0, usually 1.
-
- The "leadout" track is specified either by
- using i_track CDIO_CDROM_LEADOUT_TRACK or the total tracks+1.
-
- @param p_cdio object to get information from
- @param i_track the track number we want the LSN for
- @return the starting LBA or CDIO_INVALID_LBA on error.
- */
- lba_t cdio_get_track_lba(const CdIo_t *p_cdio, track_t i_track);
-
- /*!
- Return the starting MSF (minutes/secs/frames) for track number
- i_track in p_cdio. Track numbers usually start at something
- greater than 0, usually 1.
-
- The "leadout" track is specified either by
- using i_track CDIO_CDROM_LEADOUT_TRACK or the total tracks+1.
-
- @param p_cdio object to get information from
- @param i_track the track number we want the LSN for
- @return the starting LSN or CDIO_INVALID_LSN on error.
- */
- lsn_t cdio_get_track_lsn(const CdIo_t *p_cdio, track_t i_track);
-
- /*!
- Return the starting MSF (minutes/secs/frames) for track number
- i_track in p_cdio. Track numbers usually start at something
- greater than 0, usually 1.
-
- The "leadout" track is specified either by
- using i_track CDIO_CDROM_LEADOUT_TRACK or the total tracks+1.
-
- @return true if things worked or false if there is no track entry.
- */
- bool cdio_get_track_msf(const CdIo_t *p_cdio, track_t i_track,
- /*out*/ msf_t *msf);
-
- /*!
- Get the number of sectors between this track an the next. This
- includes any pregap sectors before the start of the next track.
- Track numbers usually start at something
- greater than 0, usually 1.
-
- @return the number of sectors or 0 if there is an error.
- */
- unsigned int cdio_get_track_sec_count(const CdIo_t *p_cdio, track_t i_track);
-
- /*!
- Reposition read offset
- Similar to (if not the same as) libc's lseek()
-
- @param p_cdio object to get information from
- @param offset amount to seek
- @param whence like corresponding parameter in libc's lseek, e.g.
- SEEK_SET or SEEK_END.
- @return (off_t) -1 on error.
- */
- off_t cdio_lseek(const CdIo_t *p_cdio, off_t offset, int whence);
-
- /*!
- Reads into buf the next size bytes.
- Similar to (if not the same as) libc's read()
-
- @return (ssize_t) -1 on error.
- */
- ssize_t cdio_read(const CdIo_t *p_cdio, void *buf, size_t size);
-
- /*!
- Read an audio sector
-
- @param p_cdio object to read from
- @param buf place to read data into
- @param lsn sector to read
-
- @return 0 if no error, nonzero otherwise.
- */
- int cdio_read_audio_sector (const CdIo_t *p_cdio, void *buf, lsn_t lsn);
-
- /*!
- Reads audio sectors
-
- @param p_cdio object to read from
- @param buf place to read data into
- @param lsn sector to read
- @param i_sectors number of sectors to read
-
- @return 0 if no error, nonzero otherwise.
- */
- int cdio_read_audio_sectors (const CdIo_t *p_cdio, void *buf, lsn_t lsn,
- unsigned int i_sectors);
-
- /*!
- Reads a mode1 sector
-
- @param p_cdio object to read from
- @param buf place to read data into
- @param lsn sector to read
- @param b_form2 true for reading mode1 form2 sectors or false for
- mode1 form1 sectors.
-
- @return 0 if no error, nonzero otherwise.
- */
- int cdio_read_mode1_sector (const CdIo_t *p_cdio, void *buf, lsn_t lsn,
- bool b_form2);
-
- /*!
- Reads mode1 sectors
-
- @param p_cdio object to read from
- @param buf place to read data into
- @param lsn sector to read
- @param b_form2 true for reading mode1 form2 sectors or false for
- mode1 form1 sectors.
- @param i_sectors number of sectors to read
-
- @return 0 if no error, nonzero otherwise.
- */
- int cdio_read_mode1_sectors (const CdIo_t *p_cdio, void *buf, lsn_t lsn,
- bool b_form2, unsigned int i_sectors);
-
- /*!
- Reads a mode1 sector
-
- @param p_cdio object to read from
- @param buf place to read data into
- @param lsn sector to read
- @param b_form2 true for reading mode1 form2 sectors or false for
- mode1 form1 sectors.
-
- @return 0 if no error, nonzero otherwise.
- */
- int cdio_read_mode2_sector (const CdIo_t *p_cdio, void *buf, lsn_t lsn,
- bool b_form2);
-
- /*!
- Reads mode2 sectors
-
- @param p_cdio object to read from
- @param buf place to read data into
- @param lsn sector to read
- @param b_form2 true for reading mode1 form2 sectors or false for
- mode1 form1 sectors.
- @param i_sectors number of sectors to read
-
- @return 0 if no error, nonzero otherwise.
- */
- int cdio_read_mode2_sectors (const CdIo_t *p_cdio, void *buf, lsn_t lsn,
- bool b_form2, unsigned int i_sectors);
-
- /*!
- Set the arg "key" with "value" in "obj".
-
- @param p_cdio the CD object to set
- @param key the key to set
- @param value the value to assocaiate with key
- @return 0 if no error was found, and nonzero otherwise.
- */
- int cdio_set_arg (CdIo_t *p_cdio, const char key[], const char value[]);
-
- /*!
- Get the size of the CD in logical block address (LBA) units.
-
- @param p_cdio the CD object queried
- @return the size
- */
- uint32_t cdio_stat_size (const CdIo_t *p_cdio);
-
- /*!
- Initialize CD Reading and control routines. Should be called first.
- */
- bool cdio_init(void);
-
- /* True if xxx driver is available. where xxx=linux, solaris, nrg, ...
- */
-
- /*! True if BSDI driver is available. */
- bool cdio_have_bsdi (void);
-
- /*! True if FreeBSD driver is available. */
- bool cdio_have_freebsd (void);
-
- /*! True if GNU/Linux driver is available. */
- bool cdio_have_linux (void);
-
- /*! True if Sun Solaris driver is available. */
- bool cdio_have_solaris (void);
-
- /*! True if Apple OSX driver is available. */
- bool cdio_have_osx (void);
-
- /*! True if Microsoft Windows driver is available. */
- bool cdio_have_win32 (void);
-
- /*! True if Nero driver is available. */
- bool cdio_have_nrg (void);
-
- /*! True if BIN/CUE driver is available. */
- bool cdio_have_bincue (void);
-
- /*! True if cdrdao CDRDAO driver is available. */
- bool cdio_have_cdrdao (void);
-
- /*! Like cdio_have_xxx but uses an enumeration instead. */
- bool cdio_have_driver (driver_id_t driver_id);
-
- /*!
- Get a string decribing driver_id.
-
- @param driver_id the driver you want the description for
- @return a sring of driver description
- */
- const char *cdio_driver_describe (driver_id_t driver_id);
-
- /*! Sets up to read from place specified by source_name and
- driver_id. This or cdio_open_* should be called before using any
- other routine, except cdio_init. This will call cdio_init, if
- that hasn't been done previously. to call one of the specific
- cdio_open_xxx routines.
-
- @return the cdio object or NULL on error or no device.
- */
- CdIo_t * cdio_open (const char *source_name, driver_id_t driver_id);
-
- /*! Sets up to read from place specified by source_name, driver_id
- and access mode. This or cdio_open should be called before using
- any other routine, except cdio_init. This will call cdio_init, if
- that hasn't been done previously. to call one of the specific
- cdio_open_xxx routines.
-
- @return the cdio object or NULL on error or no device.
- */
- CdIo_t * cdio_open_am (const char *psz_source_name,
- driver_id_t driver_id, const char *psz_access_mode);
-
- /*! Set up BIN/CUE CD disk-image for reading. Source is the .bin or
- .cue file
-
- @return the cdio object or NULL on error or no device.
- */
- CdIo_t * cdio_open_bincue (const char *psz_cue_name);
-
- /*! Set up BIN/CUE CD disk-image for reading. Source is the .bin or
- .cue file
-
- @return the cdio object or NULL on error or no device..
- */
- CdIo_t * cdio_open_am_bincue (const char *psz_cue_name,
- const char *psz_access_mode);
-
- /*! Set up cdrdao CD disk-image for reading. Source is the .toc file
-
- @return the cdio object or NULL on error or no device.
- */
- CdIo_t * cdio_open_cdrdao (const char *psz_toc_name);
-
- /*! Set up cdrdao CD disk-image for reading. Source is the .toc file
-
- @return the cdio object or NULL on error or no device..
- */
- CdIo_t * cdio_open_am_cdrdao (const char *psz_toc_name,
- const char *psz_access_mode);
-
- /*! Return a string containing the default CUE file that would
- be used when none is specified.
-
- @return the cdio object or NULL on error or no device.
- */
- char * cdio_get_default_device_bincue(void);
-
- char **cdio_get_devices_bincue(void);
-
- /*! Return a string containing the default CUE file that would
- be used when none is specified.
-
- NULL is returned on error or there is no device.
- */
- char * cdio_get_default_device_cdrdao(void);
-
- char **cdio_get_devices_cdrdao(void);
-
- /*! Set up CD-ROM for reading. The device_name is
- the some sort of device name.
-
- @return the cdio object for subsequent operations.
- NULL on error or there is no driver for a some sort of hardware CD-ROM.
- */
- CdIo_t * cdio_open_cd (const char *device_name);
-
- /*! Set up CD-ROM for reading. The device_name is
- the some sort of device name.
-
- @return the cdio object for subsequent operations.
- NULL on error or there is no driver for a some sort of hardware CD-ROM.
- */
- CdIo_t * cdio_open_am_cd (const char *psz_device,
- const char *psz_access_mode);
-
- /*! CDRWIN BIN/CUE CD disc-image routines. Source is the .cue file
-
- @return the cdio object for subsequent operations.
- NULL on error.
- */
- CdIo_t * cdio_open_cue (const char *cue_name);
-
- /*! Set up CD-ROM for reading using the BSDI driver. The device_name is
- the some sort of device name.
-
- @return the cdio object for subsequent operations.
- NULL on error or there is no BSDI driver.
-
- @see cdio_open
- */
- CdIo_t * cdio_open_bsdi (const char *psz_source_name);
-
- /*! Set up CD-ROM for reading using the BSDI driver. The device_name is
- the some sort of device name.
-
- @return the cdio object for subsequent operations.
- NULL on error or there is no BSDI driver.
-
- @see cdio_open
- */
- CdIo_t * cdio_open_am_bsdi (const char *psz_source_name,
- const char *psz_access_mode);
-
- /*! Return a string containing the default device name that the
- BSDI driver would use when none is specified.
-
- @return the cdio object for subsequent operations.
- NULL on error or there is no BSDI driver.
-
- @see cdio_open_cd, cdio_open
- */
- char * cdio_get_default_device_bsdi(void);
-
- /*! Return a list of all of the CD-ROM devices that the BSDI driver
- can find.
-
- In some situations of drivers or OS's we can't find a CD device if
- there is no media in it and it is possible for this routine to return
- NULL even though there may be a hardware CD-ROM.
- */
- char **cdio_get_devices_bsdi(void);
-
- /*! Set up CD-ROM for reading using the FreeBSD driver. The device_name is
- the some sort of device name.
-
- NULL is returned on error or there is no FreeBSD driver.
-
- @see cdio_open_cd, cdio_open
- */
- CdIo_t * cdio_open_freebsd (const char *paz_source_name);
-
- /*! Set up CD-ROM for reading using the FreeBSD driver. The device_name is
- the some sort of device name.
-
- NULL is returned on error or there is no FreeBSD driver.
-
- @see cdio_open_cd, cdio_open
- */
- CdIo_t * cdio_open_am_freebsd (const char *psz_source_name,
- const char *psz_access_mode);
-
- /*! Return a string containing the default device name that the
- FreeBSD driver would use when none is specified.
-
- NULL is returned on error or there is no CD-ROM device.
- */
- char * cdio_get_default_device_freebsd(void);
-
- /*! Return a list of all of the CD-ROM devices that the FreeBSD driver
- can find.
- */
- char **cdio_get_devices_freebsd(void);
-
- /*! Set up CD-ROM for reading using the GNU/Linux driver. The device_name is
- the some sort of device name.
-
- @return the cdio object for subsequent operations.
- NULL on error or there is no GNU/Linux driver.
-
- In some situations of drivers or OS's we can't find a CD device if
- there is no media in it and it is possible for this routine to return
- NULL even though there may be a hardware CD-ROM.
- */
- CdIo_t * cdio_open_linux (const char *source_name);
-
- /*! Set up CD-ROM for reading using the GNU/Linux driver. The
- device_name is the some sort of device name.
-
- @return the cdio object for subsequent operations.
- NULL on error or there is no GNU/Linux driver.
- */
- CdIo_t * cdio_open_am_linux (const char *source_name,
- const char *access_mode);
-
- /*! Return a string containing the default device name that the
- GNU/Linux driver would use when none is specified. A scan is made
- for CD-ROM drives with CDs in them.
-
- NULL is returned on error or there is no CD-ROM device.
-
- In some situations of drivers or OS's we can't find a CD device if
- there is no media in it and it is possible for this routine to return
- NULL even though there may be a hardware CD-ROM.
-
- @see cdio_open_cd, cdio_open
- */
- char * cdio_get_default_device_linux(void);
-
- /*! Return a list of all of the CD-ROM devices that the GNU/Linux driver
- can find.
- */
- char **cdio_get_devices_linux(void);
-
- /*! Set up CD-ROM for reading using the Sun Solaris driver. The
- device_name is the some sort of device name.
-
- @return the cdio object for subsequent operations.
- NULL on error or there is no Solaris driver.
- */
- CdIo_t * cdio_open_solaris (const char *source_name);
-
- /*! Set up CD-ROM for reading using the Sun Solaris driver. The
- device_name is the some sort of device name.
-
- @return the cdio object for subsequent operations.
- NULL on error or there is no Solaris driver.
- */
- CdIo_t * cdio_open_am_solaris (const char *psz_source_name,
- const char *psz_access_mode);
-
- /*! Return a string containing the default device name that the
- Solaris driver would use when none is specified. A scan is made
- for CD-ROM drives with CDs in them.
-
- NULL is returned on error or there is no CD-ROM device.
-
- In some situations of drivers or OS's we can't find a CD device if
- there is no media in it and it is possible for this routine to return
- NULL even though there may be a hardware CD-ROM.
-
- @see cdio_open_cd, cdio_open
- */
- char * cdio_get_default_device_solaris(void);
-
- /*! Return a list of all of the CD-ROM devices that the Solaris driver
- can find.
- */
- char **cdio_get_devices_solaris(void);
-
- /*! Set up CD-ROM for reading using the Apple OSX driver. The
- device_name is the some sort of device name.
-
- NULL is returned on error or there is no OSX driver.
-
- In some situations of drivers or OS's we can't find a CD device if
- there is no media in it and it is possible for this routine to return
- NULL even though there may be a hardware CD-ROM.
-
- @see cdio_open_cd, cdio_open
- */
- CdIo_t * cdio_open_osx (const char *psz_source_name);
-
- /*! Set up CD-ROM for reading using the Apple OSX driver. The
- device_name is the some sort of device name.
-
- NULL is returned on error or there is no OSX driver.
-
- @see cdio_open_cd, cdio_open
- */
- CdIo_t * cdio_open_am_osx (const char *psz_source_name,
- const char *psz_access_mode);
-
- /*! Return a string containing the default device name that the
- OSX driver would use when none is specified. A scan is made
- for CD-ROM drives with CDs in them.
-
- In some situations of drivers or OS's we can't find a CD device if
- there is no media in it and it is possible for this routine to return
- NULL even though there may be a hardware CD-ROM.
- */
- char * cdio_get_default_device_osx(void);
-
- /*! Return a list of all of the CD-ROM devices that the OSX driver
- can find.
- */
- char **cdio_get_devices_osx(void);
-
- /*! Set up CD-ROM for reading using the Microsoft Windows driver. The
- device_name is the some sort of device name.
-
- In some situations of drivers or OS's we can't find a CD device if
- there is no media in it and it is possible for this routine to return
- NULL even though there may be a hardware CD-ROM.
- */
- CdIo_t * cdio_open_win32 (const char *source_name);
-
- /*! Set up CD-ROM for reading using the Microsoft Windows driver. The
- device_name is the some sort of device name.
-
- NULL is returned on error or there is no Microsof Windows driver.
- */
- CdIo_t * cdio_open_am_win32 (const char *psz_source_name,
- const char *psz_access_mode);
-
- /*! Return a string containing the default device name that the
- Win32 driver would use when none is specified. A scan is made
- for CD-ROM drives with CDs in them.
-
- In some situations of drivers or OS's we can't find a CD device if
- there is no media in it and it is possible for this routine to return
- NULL even though there may be a hardware CD-ROM.
-
- @see cdio_open_cd, cdio_open
- */
- char * cdio_get_default_device_win32(void);
-
- char **cdio_get_devices_win32(void);
-
- /*! Set up CD-ROM for reading using the Nero driver. The
- device_name is the some sort of device name.
-
- @return true on success; NULL on error or there is no Nero driver.
- */
- CdIo_t * cdio_open_nrg (const char *source_name);
-
- /*! Set up CD-ROM for reading using the Nero driver. The
- device_name is the some sort of device name.
-
- @return true on success; NULL on error or there is no Nero driver.
- */
- CdIo_t * cdio_open_am_nrg (const char *psz_source_name,
- const char *psz_access_mode);
-
- /*! Return a string containing the default device name that the
- NRG driver would use when none is specified. A scan is made
- for NRG disk images in the current directory..
-
- NULL is returned on error or there is no CD-ROM device.
- */
- char * cdio_get_default_device_nrg(void);
-
- char **cdio_get_devices_nrg(void);
-
- /*!
-
- Determine if bin_name is the bin file part of a CDRWIN CD disk image.
-
- @param bin_name location of presumed CDRWIN bin image file.
- @return the corresponding CUE file if bin_name is a BIN file or
- NULL if not a BIN file.
- */
- char *cdio_is_binfile(const char *bin_name);
-
- /*!
- Determine if cue_name is the cue sheet for a CDRWIN CD disk image.
-
- @return corresponding BIN file if cue_name is a CDRWIN cue file or
- NULL if not a CUE file.
- */
- char *cdio_is_cuefile(const char *cue_name);
-
- /*!
- Determine if psg_nrg is a Nero CD disk image.
-
- @param psz_nrg location of presumed NRG image file.
- @return true if psz_nrg is a Nero NRG image or false
- if not a NRG image.
- */
- bool cdio_is_nrg(const char *psz_nrg);
-
- /*!
- Determine if psg_toc is a TOC file for a cdrdao CD disk image.
-
- @param psz_toc location of presumed TOC image file.
- @return true if toc_name is a cdrdao TOC file or false
- if not a TOC file.
- */
- bool cdio_is_tocfile(const char *psz_toc);
-
- /*!
- Determine if source_name refers to a real hardware CD-ROM.
-
- @param source_name location name of object
- @param driver_id driver for reading object. Use DRIVER_UNKNOWN if you
- don't know what driver to use.
- @return true if source_name is a device; If false is returned we
- could have a CD disk image.
- */
- bool cdio_is_device(const char *source_name, driver_id_t driver_id);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __CDIO_H__ */
diff --git a/src/input/vcd/libcdio/cdio/cdtext.h b/src/input/vcd/libcdio/cdio/cdtext.h
deleted file mode 100644
index 4b397a3ff..000000000
--- a/src/input/vcd/libcdio/cdio/cdtext.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- $Id: cdtext.h,v 1.1 2005/01/01 02:43:58 rockyb Exp $
-
- Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
- adapted from cuetools
- Copyright (C) 2003 Svend Sanjay Sorensen <ssorensen@fastmail.fm>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-/*!
- * \file cdtext.h
- * \brief Header CD-Text information
-*/
-
-
-#ifndef __CDIO_CDTEXT_H__
-#define __CDIO_CDTEXT_H__
-
-#include <cdio/cdio.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define MAX_CDTEXT_FIELDS 13
-
- /*! \brief structure for holding CD-Text information
-
- @see cdtext_init, cdtext_destroy, cdtext_get, and cdtext_set.
- */
- struct cdtext {
- char *field[MAX_CDTEXT_FIELDS];
- };
-
- /*! \brief A list of all of the CD-Text fields */
- typedef enum {
- CDTEXT_ARRANGER = 0, /**< name(s) of the arranger(s) */
- CDTEXT_COMPOSER = 1, /**< name(s) of the composer(s) */
- CDTEXT_DISCID = 2, /**< disc identification information */
- CDTEXT_GENRE = 3, /**< genre identification and genre information */
- CDTEXT_MESSAGE = 4, /**< ISRC code of each track */
- CDTEXT_ISRC = 5, /**< message(s) from the content provider or artist */
- CDTEXT_PERFORMER = 6, /**< name(s) of the performer(s) */
- CDTEXT_SIZE_INFO = 7, /**< size information of the block */
- CDTEXT_SONGWRITER = 8, /**< name(s) of the songwriter(s) */
- CDTEXT_TITLE = 9, /**< title of album name or track titles */
- CDTEXT_TOC_INFO = 10, /**< table of contents information */
- CDTEXT_TOC_INFO2 = 11, /**< second table of contents information */
- CDTEXT_UPC_EAN = 12,
- CDTEXT_INVALID = MAX_CDTEXT_FIELDS
- } cdtext_field_t;
-
- /*! Return string representation of the enum values above */
- const char *cdtext_field2str (cdtext_field_t i);
-
- /*! Initialize a new cdtext structure.
- When the structure is no longer needed, release the
- resources using cdtext_delete.
- */
- void cdtext_init (cdtext_t *cdtext);
-
- /*! Free memory assocated with cdtext*/
- void cdtext_destroy (cdtext_t *cdtext);
-
- /*! returns the string associated with the given field. NULL is
- returned if key is CDTEXT_INVALID or the field is not set.
-
- @see cdio_get_cdtext to retrieve the cdtext structure used as
- input here.
- */
- const char *cdtext_get (cdtext_field_t key, const cdtext_t *cdtext);
-
- /*!
- returns enum of keyword if key is a CD-Text keyword,
- returns MAX_CDTEXT_FIELDS non-zero otherwise.
- */
- cdtext_field_t cdtext_is_keyword (const char *key);
-
- /*!
- sets cdtext's keyword entry to field
- */
- void cdtext_set (cdtext_field_t key, const char *value, cdtext_t *cdtext);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __CDIO_CDTEXT_H__ */
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libcdio/cdio/ds.h b/src/input/vcd/libcdio/cdio/ds.h
deleted file mode 100644
index c811cadd4..000000000
--- a/src/input/vcd/libcdio/cdio/ds.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- $Id: ds.h,v 1.1 2005/01/01 02:43:58 rockyb Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifndef __CDIO_DS_H__
-#define __CDIO_DS_H__
-
-#include <cdio/types.h>
-
-/* opaque... */
-typedef struct _CdioList CdioList;
-typedef struct _CdioListNode CdioListNode;
-
-typedef int (*_cdio_list_cmp_func) (void *data1, void *data2);
-
-typedef int (*_cdio_list_iterfunc) (void *data, void *user_data);
-
-/* methods */
-CdioList *_cdio_list_new (void);
-
-void _cdio_list_free (CdioList *list, int free_data);
-
-unsigned _cdio_list_length (const CdioList *list);
-
-void _cdio_list_prepend (CdioList *list, void *data);
-
-void _cdio_list_append (CdioList *list, void *data);
-
-void _cdio_list_foreach (CdioList *list, _cdio_list_iterfunc func, void *user_data);
-
-CdioListNode *_cdio_list_find (CdioList *list, _cdio_list_iterfunc cmp_func, void *user_data);
-
-#define _CDIO_LIST_FOREACH(node, list) \
- for (node = _cdio_list_begin (list); node; node = _cdio_list_node_next (node))
-
-/* node ops */
-
-CdioListNode *_cdio_list_begin (const CdioList *list);
-
-CdioListNode *_cdio_list_end (CdioList *list);
-
-CdioListNode *_cdio_list_node_next (CdioListNode *node);
-
-void _cdio_list_node_free (CdioListNode *node, int free_data);
-
-void *_cdio_list_node_data (CdioListNode *node);
-
-#endif /* __CDIO_DS_H__ */
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
-
diff --git a/src/input/vcd/libcdio/cdio/dvd.h b/src/input/vcd/libcdio/cdio/dvd.h
deleted file mode 100644
index df58c4322..000000000
--- a/src/input/vcd/libcdio/cdio/dvd.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- $Id: dvd.h,v 1.1 2005/01/01 02:43:58 rockyb Exp $
-
- Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
- Modeled after GNU/Linux definitions in linux/cdrom.h
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/*!
- \file dvd.h
- \brief Definitions for DVD access.
-*/
-
-#ifndef __CDIO_DVD_H__
-#define __CDIO_DVD_H__
-
-#include <cdio/types.h>
-
-/*! Values used in a READ DVD STRUCTURE */
-
-#define CDIO_DVD_STRUCT_PHYSICAL 0x00
-#define CDIO_DVD_STRUCT_COPYRIGHT 0x01
-#define CDIO_DVD_STRUCT_DISCKEY 0x02
-#define CDIO_DVD_STRUCT_BCA 0x03
-#define CDIO_DVD_STRUCT_MANUFACT 0x04
-
-/*! Media definitions for "Book Type" */
-#define CDIO_DVD_BOOK_DVD_ROM 0
-#define CDIO_DVD_BOOK_DVD_RAM 1
-#define CDIO_DVD_BOOK_DVD_R 2 /**< DVD-R */
-#define CDIO_DVD_BOOK_DVD_RW 3 /**< DVD-RW */
-#define CDIO_DVD_BOOK_DVD_PR 8 /**< DVD+R */
-#define CDIO_DVD_BOOK_DVD_PRW 9 /**< DVD+RW */
-
-typedef struct cdio_dvd_layer {
- uint8_t book_version : 4;
- uint8_t book_type : 4;
- uint8_t min_rate : 4;
- uint8_t disc_size : 4;
- uint8_t layer_type : 4;
- uint8_t track_path : 1;
- uint8_t nlayers : 2;
- uint8_t track_density : 4;
- uint8_t linear_density: 4;
- uint8_t bca : 1;
- uint32_t start_sector;
- uint32_t end_sector;
- uint32_t end_sector_l0;
-} cdio_dvd_layer_t;
-
-/*! Maximum number of layers in a DVD. */
-#define CDIO_DVD_MAX_LAYERS 4
-
-typedef struct cdio_dvd_physical {
- uint8_t type;
- uint8_t layer_num;
- cdio_dvd_layer_t layer[CDIO_DVD_MAX_LAYERS];
-} cdio_dvd_physical_t;
-
-typedef struct cdio_dvd_copyright {
- uint8_t type;
-
- uint8_t layer_num;
- uint8_t cpst;
- uint8_t rmi;
-} cdio_dvd_copyright_t;
-
-typedef struct cdio_dvd_disckey {
- uint8_t type;
-
- unsigned agid : 2;
- uint8_t value[2048];
-} cdio_dvd_disckey_t;
-
-typedef struct cdio_dvd_bca {
- uint8_t type;
-
- int len;
- uint8_t value[188];
-} cdio_dvd_bca_t;
-
-typedef struct cdio_dvd_manufact {
- uint8_t type;
-
- uint8_t layer_num;
- int len;
- uint8_t value[2048];
-} cdio_dvd_manufact_t;
-
-typedef union {
- uint8_t type;
-
- cdio_dvd_physical_t physical;
- cdio_dvd_copyright_t copyright;
- cdio_dvd_disckey_t disckey;
- cdio_dvd_bca_t bca;
- cdio_dvd_manufact_t manufact;
-} cdio_dvd_struct_t;
-
-#endif /* __SCSI_MMC_H__ */
diff --git a/src/input/vcd/libcdio/cdio/iso9660.h b/src/input/vcd/libcdio/cdio/iso9660.h
deleted file mode 100644
index 104b6ba62..000000000
--- a/src/input/vcd/libcdio/cdio/iso9660.h
+++ /dev/null
@@ -1,786 +0,0 @@
-/*
- $Id: iso9660.h,v 1.3 2005/01/01 02:43:58 rockyb Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
- Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
-
- See also iso9660.h by Eric Youngdale (1993).
-
- Copyright 1993 Yggdrasil Computing, Incorporated
- Copyright (c) 1999,2000 J. Schilling
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-/*!
- * \file iso9660.h
- * \brief Header for libiso9660: the ISO-9660 filesystem library.
-*/
-
-
-#ifndef __CDIO_ISO9660_H__
-#define __CDIO_ISO9660_H__
-
-#include <cdio/cdio.h>
-#include <cdio/ds.h>
-#include <cdio/xa.h>
-
-#include <time.h>
-
-#define _delta(from, to) ((to) - (from) + 1)
-
-#define MIN_TRACK_SIZE 4*75
-#define MIN_ISO_SIZE MIN_TRACK_SIZE
-
-/*!
- An ISO filename is: "abcde.eee;1" -> <filename> '.' <ext> ';' <version #>
-
- For ISO-9660 Level 1, the maximum needed string length is:
-
-\verbatim
- 30 chars (filename + ext)
- + 2 chars ('.' + ';')
- + 5 chars (strlen("32767"))
- + 1 null byte
- ================================
- = 38 chars
-\endverbatim
-*/
-
-/*! size in bytes of the filename portion + null byte */
-#define LEN_ISONAME 31
-
-/*! Max # characters in the entire ISO 9660 filename. */
-#define MAX_ISONAME 37
-
-/*! Max # characters in the entire ISO 9660 filename. */
-#define MAX_ISOPATHNAME 255
-
-/*! Max # characters in an perparer id. */
-#define ISO_MAX_PREPARER_ID 128
-
-/*! Max # characters in an publisher id. */
-#define ISO_MAX_PUBLISHER_ID 128
-
-/*! Max # characters in an application id. */
-#define ISO_MAX_APPLICATION_ID 128
-
-/*! Max # characters in an system id. */
-#define ISO_MAX_SYSTEM_ID 32
-
-/*! Max # characters in an volume id. */
-#define ISO_MAX_VOLUME_ID 32
-
-/*! Max # characters in an volume-set id. */
-#define ISO_MAX_VOLUMESET_ID 128
-
-/**! ISO 9660 directory flags. */
-#define ISO_FILE 0 /**< Not really a flag... */
-#define ISO_EXISTENCE 1 /**< Do not make existence known (hidden) */
-#define ISO_DIRECTORY 2 /**< This file is a directory */
-#define ISO_ASSOCIATED 4 /**< This file is an associated file */
-#define ISO_RECORD 8 /**< Record format in extended attr. != 0 */
-#define ISO_PROTECTION 16 /**< No read/execute perm. in ext. attr. */
-#define ISO_DRESERVED1 32 /**< Reserved bit 5 */
-#define ISO_DRESERVED2 64 /**< Reserved bit 6 */
-#define ISO_MULTIEXTENT 128 /**< Not final entry of a mult. ext. file */
-
-/**! Volume descriptor types */
-#define ISO_VD_PRIMARY 1
-#define ISO_VD_SUPPLEMENTARY 2 /**< Used by Joliet */
-#define ISO_VD_END 255
-
-/*! Sector of Primary Volume Descriptor */
-#define ISO_PVD_SECTOR 16
-
-/*! Sector of End Volume Descriptor */
-#define ISO_EVD_SECTOR 17
-
-/*! String inside track identifying an ISO 9660 filesystem. */
-#define ISO_STANDARD_ID "CD001"
-
-
-/*! Number of bytes in an ISO 9660 block */
-#define ISO_BLOCKSIZE 2048
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-enum strncpy_pad_check {
- ISO9660_NOCHECK = 0,
- ISO9660_7BIT,
- ISO9660_ACHARS,
- ISO9660_DCHARS
-};
-
-#ifndef EMPTY_ARRAY_SIZE
-#define EMPTY_ARRAY_SIZE 0
-#endif
-
-PRAGMA_BEGIN_PACKED
-
-/*!
- \brief ISO-9660 shorter-format time structure.
-
- @see iso9660_dtime
- */
-struct iso9660_dtime {
- uint8_t dt_year;
- uint8_t dt_month; /**< Has value in range 1..12. Note starts
- at 1, not 0 like a tm struct. */
- uint8_t dt_day;
- uint8_t dt_hour;
- uint8_t dt_minute;
- uint8_t dt_second;
- int8_t dt_gmtoff; /**< GMT values -48 .. + 52 in 15 minute
- intervals */
-} GNUC_PACKED;
-
-typedef struct iso9660_dtime iso9660_dtime_t;
-
-/*!
- \brief ISO-9660 longer-format time structure.
-
- @see iso9660_ltime
- */
-struct iso9660_ltime {
- char lt_year [_delta( 1, 4)]; /**< Add 1900 to value
- for the Julian
- year */
- char lt_month [_delta( 5, 6)]; /**< Has value in range
- 1..12. Note starts
- at 1, not 0 like a
- tm struct. */
- char lt_day [_delta( 7, 8)];
- char lt_hour [_delta( 9, 10)];
- char lt_minute [_delta( 11, 12)];
- char lt_second [_delta( 13, 14)];
- char lt_hsecond [_delta( 15, 16)]; /**<! The value is in
- units of 1/100's of
- a second */
- int8_t lt_gmtoff [_delta( 17, 17)];
-} GNUC_PACKED;
-
-typedef struct iso9660_ltime iso9660_ltime_t;
-
-/*! \brief Format of an ISO-9660 directory record
-
- This structure may have an odd length depending on how many
- characters there are in the filename! Some compilers (e.g. on
- Sun3/mc68020) pad the structures to an even length. For this reason,
- we cannot use sizeof (struct iso_path_table) or sizeof (struct
- iso_directory_record) to compute on disk sizes. Instead, we use
- offsetof(..., name) and add the name size. See mkisofs.h of the
- cdrtools package.
-
- @see iso9660_stat
-*/
-struct iso9660_dir {
- uint8_t length; /*! 711 encoded */
- uint8_t xa_length; /*! 711 encoded */
- uint64_t extent; /*! 733 encoded */
- uint64_t size; /*! 733 encoded */
- iso9660_dtime_t recording_time; /*! 7 711-encoded units */
- uint8_t file_flags;
- uint8_t file_unit_size; /*! 711 encoded */
- uint8_t interleave_gap; /*! 711 encoded */
- uint32_t volume_sequence_number; /*! 723 encoded */
- uint8_t filename_len; /*! 711 encoded */
- char filename[EMPTY_ARRAY_SIZE];
-} GNUC_PACKED;
-
-typedef struct iso9660_dir iso9660_dir_t;
-
-/*!
- \brief ISO-9660 Primary Volume Descriptor.
- */
-struct iso9660_pvd {
- uint8_t type; /**< 711 encoded */
- char id[5];
- uint8_t version; /**< 711 encoded */
- char unused1[1];
- char system_id[ISO_MAX_SYSTEM_ID]; /**< each char is an achar */
- char volume_id[ISO_MAX_VOLUME_ID]; /**< each char is a dchar */
- char unused2[8];
- uint64_t volume_space_size; /**< 733 encoded */
- char unused3[32];
- uint32_t volume_set_size; /**< 723 encoded */
- uint32_t volume_sequence_number; /**< 723 encoded */
- uint32_t logical_block_size; /**< 723 encoded */
- uint64_t path_table_size; /**< 733 encoded */
- uint32_t type_l_path_table; /**< 731 encoded */
- uint32_t opt_type_l_path_table; /**< 731 encoded */
- uint32_t type_m_path_table; /**< 732 encoded */
- uint32_t opt_type_m_path_table; /**< 732 encoded */
- iso9660_dir_t root_directory_record; /**< See section 9.1 of
- ISO 9660 spec. */
- char root_directory_filename; /**< Is \0 */
- char volume_set_id[ISO_MAX_VOLUMESET_ID]; /**< dchars */
- char publisher_id[ISO_MAX_PUBLISHER_ID]; /**< achars */
- char preparer_id[ISO_MAX_PREPARER_ID]; /**< achars */
- char application_id[ISO_MAX_APPLICATION_ID]; /**< achars */
- char copyright_file_id[37]; /**< See section 7.5 of
- ISO 9660 spec. Each char is
- a dchar */
- char abstract_file_id[37]; /**< See section 7.5 of
- ISO 9660 spec. Each char is
- a dchar */
- char bibliographic_file_id[37]; /**< See section 7.5 of
- ISO 9660 spec. Each char is
- a dchar. */
- iso9660_ltime_t creation_date; /**< See section 8.4.26.1 of
- ISO 9660 spec. */
- iso9660_ltime_t modification_date; /**< See section 8.4.26.1 of
- ISO 9660 spec. */
- iso9660_ltime_t expiration_date; /**< See section 8.4.26.1 of
- ISO 9660 spec. */
- iso9660_ltime_t effective_date; /**< See section 8.4.26.1 of
- ISO 9660 spec. */
- uint8_t file_structure_version; /**< 711 encoded */
- char unused4[1];
- char application_data[512];
- char unused5[653];
-} GNUC_PACKED;
-
-typedef struct iso9660_pvd iso9660_pvd_t;
-
-/*!
- \brief ISO-9660 Supplementary Volume Descriptor.
-
- This is used for Joliet Extentions and is almost the same as the
- the primary descriptor but two unused fields, "unused1" and "unused3
- become "flags and "escape_sequences" respectively.
-*/
-struct iso9660_svd {
- uint8_t type; /**< 711 encoded */
- char id[5];
- uint8_t version; /**< 711 encoded */
- char flags; /**< 853 */
- char system_id[ISO_MAX_SYSTEM_ID]; /**< each char is an achar */
- char volume_id[ISO_MAX_VOLUME_ID]; /**< each char is a dchar */
- char unused2[8];
- uint64_t volume_space_size; /**< 733 encoded */
- char escape_sequences[32]; /**< 856 */
- uint32_t volume_set_size; /**< 723 encoded */
- uint32_t volume_sequence_number; /**< 723 encoded */
- uint32_t logical_block_size; /**< 723 encoded */
- uint64_t path_table_size; /**< 733 encoded */
- uint32_t type_l_path_table; /**< 731 encoded */
- uint32_t opt_type_l_path_table; /**< 731 encoded */
- uint32_t type_m_path_table; /**< 732 encoded */
- uint32_t opt_type_m_path_table; /**< 732 encoded */
- iso9660_dir_t root_directory_record; /**< See section 9.1 of
- ISO 9660 spec. */
- char volume_set_id[ISO_MAX_VOLUMESET_ID]; /**< dchars */
- char publisher_id[ISO_MAX_PUBLISHER_ID]; /**< achars */
- char preparer_id[ISO_MAX_PREPARER_ID]; /**< achars */
- char application_id[ISO_MAX_APPLICATION_ID]; /**< achars */
- char copyright_file_id[37]; /**< See section 7.5 of
- ISO 9660 spec. Each char is
- a dchar */
- char abstract_file_id[37]; /**< See section 7.5 of
- ISO 9660 spec. Each char is
- a dchar */
- char bibliographic_file_id[37]; /**< See section 7.5 of
- ISO 9660 spec. Each char is
- a dchar. */
- iso9660_ltime_t creation_date; /**< See section 8.4.26.1 of
- ISO 9660 spec. */
- iso9660_ltime_t modification_date; /**< See section 8.4.26.1 of
- ISO 9660 spec. */
- iso9660_ltime_t expiration_date; /**< See section 8.4.26.1 of
- ISO 9660 spec. */
- iso9660_ltime_t effective_date; /**< See section 8.4.26.1 of
- ISO 9660 spec. */
- uint8_t file_structure_version; /**< 711 encoded */
- char unused4[1];
- char application_data[512];
- char unused5[653];
-} GNUC_PACKED;
-
-typedef struct iso9660_svd iso9660_svd_t;
-
-PRAGMA_END_PACKED
-
-/*! \brief Unix stat-like version of iso9660_dir
-
- The iso9660_stat structure is not part of the ISO-9660
- specification. We use it for our to communicate information
- in a C-library friendly way, e.g struct tm time structures and
- a C-style filename string.
-
- @see iso9660_dir
-*/
-struct iso9660_stat { /* big endian!! */
- struct tm tm; /**< time on entry */
- lsn_t lsn; /**< start logical sector number */
- uint32_t size; /**< total size in bytes */
- uint32_t secsize; /**< number of sectors allocated */
- iso9660_xa_t xa; /**< XA attributes */
- enum { _STAT_FILE = 1, _STAT_DIR = 2 } type;
- char filename[EMPTY_ARRAY_SIZE]; /**< filename */
-};
-
-typedef struct iso9660_stat iso9660_stat_t;
-
-
-/** A mask used in iso9660_ifs_read_vd which allows what kinds
- of extensions we allow, eg. Joliet, Rock Ridge, etc. */
-typedef uint8_t iso_extension_mask_t;
-
-#define ISO_EXTENSION_JOLIET_LEVEL1 0x01
-#define ISO_EXTENSION_JOLIET_LEVEL2 0x02
-#define ISO_EXTENSION_JOLIET_LEVEL3 0x04
-#define ISO_EXTENSION_ROCK_RIDGE 0x08
-#define ISO_EXTENSION_HIGH_SIERRA 0x10
-
-#define ISO_EXTENSION_ALL 0xFF
-#define ISO_EXTENSION_NONE 0x00
-#define ISO_EXTENSION_JOLIET \
- (ISO_EXTENSION_JOLIET_LEVEL1 | \
- ISO_EXTENSION_JOLIET_LEVEL2 | \
- ISO_EXTENSION_JOLIET_LEVEL3 )
-
-
-/** This is an opaque structure. */
-typedef struct _iso9660 iso9660_t;
-
-/*!
- Open an ISO 9660 image for reading. Maybe in the future we will have
- a mode. NULL is returned on error.
-*/
- iso9660_t *iso9660_open (const char *psz_pathname /*flags, mode */);
-
-/*!
- Open an ISO 9660 image for reading allowing various ISO 9660
- extensions. Maybe in the future we will have a mode. NULL is
- returned on error.
-*/
- iso9660_t *iso9660_open_ext (const char *psz_pathname,
- iso_extension_mask_t iso_extension_mask);
-
-/*!
- Close previously opened ISO 9660 image.
- True is unconditionally returned. If there was an error false would
- be returned.
-*/
- bool iso9660_close (iso9660_t * p_iso);
-
-
-/*!
- Seek to a position and then read n bytes. Size read is returned.
-*/
- long int iso9660_iso_seek_read (const iso9660_t *p_iso, void *ptr,
- lsn_t start, long int i_size);
-
-/*!
- Read the Primary Volume Descriptor for a CD.
- True is returned if read, and false if there was an error.
-*/
- bool iso9660_fs_read_pvd ( const CdIo *p_cdio,
- /*out*/ iso9660_pvd_t *p_pvd );
-
-/*!
- Read the Primary Volume Descriptor for an ISO 9660 image.
- True is returned if read, and false if there was an error.
-*/
- bool iso9660_ifs_read_pvd (const iso9660_t *p_iso,
- /*out*/ iso9660_pvd_t *p_pvd);
-
-/*!
- Read the Super block of an ISO 9660 image. This is the
- Primary Volume Descriptor (PVD) and perhaps a Supplemental Volume
- Descriptor if (Joliet) extensions are acceptable.
-*/
- bool iso9660_fs_read_superblock (CdIo *p_cdio,
- iso_extension_mask_t iso_extension_mask);
-
-/*!
- Read the Supper block of an ISO 9660 image. This is the
- Primary Volume Descriptor (PVD) and perhaps a Supplemental Volume
- Descriptor if (Joliet) extensions are acceptable.
-*/
- bool iso9660_ifs_read_superblock (iso9660_t *p_iso,
- iso_extension_mask_t iso_extension_mask);
-
-
-/*====================================================
- Time conversion
- ====================================================*/
-/*!
- Set time in format used in ISO 9660 directory index record
- from a Unix time structure. */
- void iso9660_set_dtime (const struct tm *tm,
- /*out*/ iso9660_dtime_t *idr_date);
-
-
-/*!
- Set "long" time in format used in ISO 9660 primary volume descriptor
- from a Unix time structure. */
- void iso9660_set_ltime (const struct tm *_tm,
- /*out*/ iso9660_ltime_t *p_pvd_date);
-
-/*!
- Get Unix time structure from format use in an ISO 9660 directory index
- record. Even though tm_wday and tm_yday fields are not explicitly in
- idr_date, they are calculated from the other fields.
-
- If tm is to reflect the localtime, set "use_localtime" true, otherwise
- tm will reported in GMT.
-*/
- void iso9660_get_dtime (const iso9660_dtime_t *idr_date, bool use_localtime,
- /*out*/ struct tm *tm);
-
-
-/*====================================================
- Characters used in file and directory and manipulation
- ====================================================*/
-/*!
- Return true if c is a DCHAR - a character that can appear in an an
- ISO-9600 level 1 directory name. These are the ASCII capital
- letters A-Z, the digits 0-9 and an underscore.
-*/
-bool iso9660_isdchar (int c);
-
-/*!
- Return true if c is an ACHAR -
- These are the DCHAR's plus some ASCII symbols including the space
- symbol.
-*/
-bool iso9660_isachar (int c);
-
-/*!
- Convert ISO-9660 file name that stored in a directory entry into
- what's usually listed as the file name in a listing.
- Lowercase name, and remove trailing ;1's or .;1's and
- turn the other ;'s into version numbers.
-
- The length of the translated string is returned.
-*/
-int iso9660_name_translate(const char *psz_oldname, char *psz_newname);
-
-/*!
- Convert ISO-9660 file name that stored in a directory entry into
- what's usually listed as the file name in a listing. Lowercase
- name if not using Joliet extension. Remove trailing ;1's or .;1's and
- turn the other ;'s into version numbers.
-
- The length of the translated string is returned.
-*/
-int iso9660_name_translate_ext(const char *old, char *new,
- uint8_t i_joliet_level);
-
-/*!
- Pad string src with spaces to size len and copy this to dst. If
- len is less than the length of src, dst will be truncated to the
- first len characters of src.
-
- src can also be scanned to see if it contains only ACHARs, DCHARs,
- 7-bit ASCII chars depending on the enumeration _check.
-
- In addition to getting changed, dst is the return value.
- Note: this string might not be NULL terminated.
- */
-char *iso9660_strncpy_pad(char dst[], const char src[], size_t len,
- enum strncpy_pad_check _check);
-
-/*=====================================================================
- file/dirname's
-======================================================================*/
-
-/*!
- Check that pathname is a valid ISO-9660 directory name.
-
- A valid directory name should not start out with a slash (/),
- dot (.) or null byte, should be less than 37 characters long,
- have no more than 8 characters in a directory component
- which is separated by a /, and consist of only DCHARs.
-
- True is returned if pathname is valid.
- */
-bool iso9660_dirname_valid_p (const char pathname[]);
-
-/*!
- Take pathname and a version number and turn that into a ISO-9660
- pathname. (That's just the pathname followd by ";" and the version
- number. For example, mydir/file.ext -> MYDIR/FILE.EXT;1 for version
- 1. The resulting ISO-9660 pathname is returned.
-*/
-char *iso9660_pathname_isofy (const char pathname[], uint16_t i_version);
-
-/*!
- Check that pathname is a valid ISO-9660 pathname.
-
- A valid pathname contains a valid directory name, if one appears and
- the filename portion should be no more than 8 characters for the
- file prefix and 3 characters in the extension (or portion after a
- dot). There should be exactly one dot somewhere in the filename
- portion and the filename should be composed of only DCHARs.
-
- True is returned if pathname is valid.
- */
-bool iso9660_pathname_valid_p (const char pathname[]);
-
-/*=====================================================================
- directory tree
-======================================================================*/
-
-void
-iso9660_dir_init_new (void *dir, uint32_t self, uint32_t ssize,
- uint32_t parent, uint32_t psize,
- const time_t *dir_time);
-
-void
-iso9660_dir_init_new_su (void *dir, uint32_t self, uint32_t ssize,
- const void *ssu_data, unsigned int ssu_size,
- uint32_t parent, uint32_t psize,
- const void *psu_data, unsigned int psu_size,
- const time_t *dir_time);
-
-void
-iso9660_dir_add_entry_su (void *dir, const char filename[], uint32_t extent,
- uint32_t size, uint8_t file_flags,
- const void *su_data,
- unsigned int su_size, const time_t *entry_time);
-
-unsigned int
-iso9660_dir_calc_record_size (unsigned int namelen, unsigned int su_len);
-
-/*!
- Given a directory pointer, find the filesystem entry that contains
- lsn and return information about it.
-
- Returns stat_t of entry if we found lsn, or NULL otherwise.
- */
-iso9660_stat_t *iso9660_find_fs_lsn(CdIo *p_cdio, lsn_t i_lsn);
-
-
-/*!
- Given a directory pointer, find the filesystem entry that contains
- lsn and return information about it.
-
- Returns stat_t of entry if we found lsn, or NULL otherwise.
- */
-iso9660_stat_t *iso9660_find_ifs_lsn(const iso9660_t *p_iso, lsn_t i_lsn);
-
-
-/*!
- Get file status for pathname into stat. NULL is returned on error.
- */
-iso9660_stat_t *iso9660_fs_stat (CdIo *p_cdio, const char pathname[]);
-
-
-/*!
- Get file status for pathname into stat. NULL is returned on error.
- pathname version numbers in the ISO 9660
- name are dropped, i.e. ;1 is removed and if level 1 ISO-9660 names
- are lowercased.
- */
-iso9660_stat_t *iso9660_fs_stat_translate (CdIo *p_cdio,
- const char pathname[],
- bool b_mode2);
-
-/*!
- Get file status for pathname into stat. NULL is returned on error.
- */
-iso9660_stat_t *iso9660_ifs_stat (iso9660_t *p_iso, const char pathname[]);
-
-
-/*!
- Get file status for pathname into stat. NULL is returned on error.
- pathname version numbers in the ISO 9660
- name are dropped, i.e. ;1 is removed and if level 1 ISO-9660 names
- are lowercased.
- */
-iso9660_stat_t *iso9660_ifs_stat_translate (iso9660_t *p_iso,
- const char pathname[]);
-
-/*!
- Read pathname (a directory) and return a list of iso9660_stat_t
- of the files inside that. The caller must free the returned result.
-*/
-CdioList * iso9660_fs_readdir (CdIo *p_cdio, const char pathname[],
- bool b_mode2);
-
-/*!
- Read pathname (a directory) and return a list of iso9660_stat_t
- of the files inside that. The caller must free the returned result.
-*/
-CdioList * iso9660_ifs_readdir (iso9660_t *p_iso, const char pathname[]);
-
-/*!
- Return the PVD's application ID.
- NULL is returned if there is some problem in getting this.
-*/
-char * iso9660_get_application_id(iso9660_pvd_t *p_pvd);
-
-/*!
- Get the application ID. psz_app_id is set to NULL if there
- is some problem in getting this and false is returned.
-*/
-bool iso9660_ifs_get_application_id(iso9660_t *p_iso,
- /*out*/ char **p_psz_app_id);
-
-/*!
- Return the Joliet level recognized for p_iso.
-*/
-uint8_t iso9660_ifs_get_joliet_level(iso9660_t *p_iso);
-
-uint8_t iso9660_get_dir_len(const iso9660_dir_t *p_idr);
-
-#if FIXME
-uint8_t iso9660_get_dir_size(const iso9660_dir_t *p_idr);
-
-lsn_t iso9660_get_dir_extent(const iso9660_dir_t *p_idr);
-#endif
-
-/*!
- Return the directory name stored in the iso9660_dir_t
-
- A string is allocated: the caller must deallocate.
-*/
-char * iso9660_dir_to_name (const iso9660_dir_t *p_iso9660_dir);
-
-/*!
- Return a string containing the preparer id with trailing
- blanks removed.
-*/
-char *iso9660_get_preparer_id(const iso9660_pvd_t *p_pvd);
-
-/*!
- Get the preparer ID. psz_preparer_id is set to NULL if there
- is some problem in getting this and false is returned.
-*/
-bool iso9660_ifs_get_preparer_id(iso9660_t *p_iso,
- /*out*/ char **p_psz_preparer_id);
-
-/*!
- Return a string containing the PVD's publisher id with trailing
- blanks removed.
-*/
-char *iso9660_get_publisher_id(const iso9660_pvd_t *p_pvd);
-
-/*!
- Get the publisher ID. psz_publisher_id is set to NULL if there
- is some problem in getting this and false is returned.
-*/
-bool iso9660_ifs_get_publisher_id(iso9660_t *p_iso,
- /*out*/ char **p_psz_publisher_id);
-
-uint8_t iso9660_get_pvd_type(const iso9660_pvd_t *p_pvd);
-
-const char * iso9660_get_pvd_id(const iso9660_pvd_t *p_pvd);
-
-int iso9660_get_pvd_space_size(const iso9660_pvd_t *p_pvd);
-
-int iso9660_get_pvd_block_size(const iso9660_pvd_t *p_pvd) ;
-
-/*! Return the primary volume id version number (of pvd).
- If there is an error 0 is returned.
- */
-int iso9660_get_pvd_version(const iso9660_pvd_t *pvd) ;
-
-/*!
- Return a string containing the PVD's system id with trailing
- blanks removed.
-*/
-char *iso9660_get_system_id(const iso9660_pvd_t *p_pvd);
-
-/*!
- Get the system ID. psz_system_id is set to NULL if there
- is some problem in getting this and false is returned.
-*/
-bool iso9660_ifs_get_system_id(iso9660_t *p_iso,
- /*out*/ char **p_psz_system_id);
-
-
-/*! Return the LSN of the root directory for pvd.
- If there is an error CDIO_INVALID_LSN is returned.
- */
-lsn_t iso9660_get_root_lsn(const iso9660_pvd_t *p_pvd);
-
-/*!
- Return the PVD's volume ID.
-*/
-char *iso9660_get_volume_id(const iso9660_pvd_t *p_pvd);
-
-/*!
- Get the system ID. psz_system_id is set to NULL if there
- is some problem in getting this and false is returned.
-*/
-bool iso9660_ifs_get_volume_id(iso9660_t *p_iso,
- /*out*/ char **p_psz_volume_id);
-
-/*!
- Return the PVD's volumeset ID.
- NULL is returned if there is some problem in getting this.
-*/
-char *iso9660_get_volumeset_id(const iso9660_pvd_t *p_pvd);
-
-/*!
- Get the systemset ID. psz_systemset_id is set to NULL if there
- is some problem in getting this and false is returned.
-*/
-bool iso9660_ifs_get_volumeset_id(iso9660_t *p_iso,
- /*out*/ char **p_psz_volumeset_id);
-
-/* pathtable */
-
-/*! Zero's out pathable. Do this first. */
-void iso9660_pathtable_init (void *pt);
-
-unsigned int iso9660_pathtable_get_size (const void *pt);
-
-uint16_t
-iso9660_pathtable_l_add_entry (void *pt, const char name[], uint32_t extent,
- uint16_t parent);
-
-uint16_t
-iso9660_pathtable_m_add_entry (void *pt, const char name[], uint32_t extent,
- uint16_t parent);
-
-/*=====================================================================
- Volume Descriptors
-======================================================================*/
-
-void
-iso9660_set_pvd (void *pd, const char volume_id[], const char application_id[],
- const char publisher_id[], const char preparer_id[],
- uint32_t iso_size, const void *root_dir,
- uint32_t path_table_l_extent, uint32_t path_table_m_extent,
- uint32_t path_table_size, const time_t *pvd_time);
-
-void
-iso9660_set_evd (void *pd);
-
-/*!
- Return true if ISO 9660 image has extended attrributes (XA).
-*/
-bool iso9660_ifs_is_xa (const iso9660_t * p_iso);
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __CDIO_ISO9660_H__ */
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libcdio/cdio/logging.h b/src/input/vcd/libcdio/cdio/logging.h
deleted file mode 100644
index 8c78259ea..000000000
--- a/src/input/vcd/libcdio/cdio/logging.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- $Id: logging.h,v 1.3 2005/01/01 02:43:58 rockyb Exp $
-
- Copyright (C) 2000, Herbert Valerio Riedel <hvr@gnu.org>
- Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/** \file logging.h
- * \brief Header to control logging and level of detail of output.
- *
- */
-
-#ifndef __LOGGING_H__
-#define __LOGGING_H__
-
-#include <cdio/types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * The different log levels supported.
- */
-typedef enum {
- CDIO_LOG_DEBUG = 1, /**< Debug-level messages - helps debug what's up. */
- CDIO_LOG_INFO, /**< Informational - indicates perhaps something of
- interest. */
- CDIO_LOG_WARN, /**< Warning conditions - something that looks funny. */
- CDIO_LOG_ERROR, /**< Error conditions - may terminate program. */
- CDIO_LOG_ASSERT /**< Critical conditions - may abort program. */
-} cdio_log_level_t;
-
-/**
- * The place to save the preference concerning how much verbosity
- * is desired. This is used by the internal default log handler, but
- * it could be use by applications which provide their own log handler.
- */
-extern cdio_log_level_t cdio_loglevel_default;
-
-/**
- * This type defines the signature of a log handler. For every
- * message being logged, the handler will receive the log level and
- * the message string.
- *
- * @see cdio_log_set_handler
- * @see cdio_log_level_t
- *
- * @param level The log level.
- * @param message The log message.
- */
-typedef void (*cdio_log_handler_t) (cdio_log_level_t level,
- const char message[]);
-
-/**
- * Set a custom log handler for libcdio. The return value is the log
- * handler being replaced. If the provided parameter is NULL, then
- * the handler will be reset to the default handler.
- *
- * @see cdio_log_handler_t
- *
- * @param new_handler The new log handler.
- * @return The previous log handler.
- */
-cdio_log_handler_t cdio_log_set_handler (cdio_log_handler_t new_handler);
-
-/**
- * Handle an message with the given log level.
- *
- * @see cdio_debug
- * @see cdio_info
- * @see cdio_warn
- * @see cdio_error
-
- * @param level The log level.
- * @param format printf-style format string
- * @param ... remaining arguments needed by format string
- */
-void cdio_log (cdio_log_level_t level,
- const char format[], ...) GNUC_PRINTF(2, 3);
-
-/**
- * Handle a debugging message.
- *
- * @see cdio_log for a more generic routine
- */
-void cdio_debug (const char format[], ...) GNUC_PRINTF(1,2);
-
-/**
- * Handle an informative message.
- *
- * @see cdio_log for a more generic routine
- */
-void cdio_info (const char format[], ...) GNUC_PRINTF(1,2);
-
-/**
- * Handle a warning message.
- *
- * @see cdio_log for a more generic routine
- */
-void cdio_warn (const char format[], ...) GNUC_PRINTF(1,2);
-
-/**
- * Handle an error message. Execution is terminated.
- *
- * @see cdio_log for a more generic routine.
- */
-void cdio_error (const char format[], ...) GNUC_PRINTF(1,2);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __LOGGING_H__ */
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libcdio/cdio/scsi_mmc.h b/src/input/vcd/libcdio/cdio/scsi_mmc.h
deleted file mode 100644
index 12860247e..000000000
--- a/src/input/vcd/libcdio/cdio/scsi_mmc.h
+++ /dev/null
@@ -1,415 +0,0 @@
-/*
- $Id: scsi_mmc.h,v 1.1 2005/01/01 02:43:58 rockyb Exp $
-
- Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/*!
- \file scsi_mmc.h
- \brief Common definitions for SCSI MMC (Multi-Media Commands).
-*/
-
-#ifndef __SCSI_MMC_H__
-#define __SCSI_MMC_H__
-
-#include <cdio/cdio.h>
-#include <cdio/types.h>
-#include <cdio/dvd.h>
-
-/*! The generic packet command opcodes for CD/DVD Logical Units. */
-
-#define CDIO_MMC_GPCMD_INQUIRY 0x12
-#define CDIO_MMC_GPCMD_MODE_SELECT_6 0x15
-#define CDIO_MMC_GPCMD_MODE_SENSE 0x1a
-#define CDIO_MMC_GPCMD_START_STOP 0x1b
-#define CDIO_MMC_GPCMD_ALLOW_MEDIUM_REMOVAL 0x1e
-#define CDIO_MMC_GPCMD_READ_10 0x28
-
-/*!
- Group 2 Commands
- */
-#define CDIO_MMC_GPCMD_READ_SUBCHANNEL 0x42
-#define CDIO_MMC_GPCMD_READ_TOC 0x43
-#define CDIO_MMC_GPCMD_READ_HEADER 0x44
-#define CDIO_MMC_GPCMD_PLAY_AUDIO_10 0x45
-#define CDIO_MMC_GPCMD_GET_CONFIGURATION 0x46
-#define CDIO_MMC_GPCMD_PLAY_AUDIO_MSF 0x47
-#define CDIO_MMC_GPCMD_PLAY_AUDIO_TI 0x48
-#define CDIO_MMC_GPCMD_PLAY_TRACK_REL_10 0x49
-#define CDIO_MMC_GPCMD_PAUSE_RESUME 0x4b
-
-#define CDIO_MMC_GPCMD_READ_DISC_INFO 0x51
-#define CDIO_MMC_GPCMD_MODE_SELECT 0x55
-#define CDIO_MMC_GPCMD_MODE_SENSE_10 0x5a
-
-/*!
- Group 5 Commands
- */
-#define CDIO_MMC_GPCMD_PLAY_AUDIO_12 0xa5
-#define CDIO_MMC_GPCMD_READ_12 0xa8
-#define CDIO_MMC_GPCMD_PLAY_TRACK_REL_12 0xa9
-#define CDIO_MMC_GPCMD_READ_DVD_STRUCTURE 0xad
-#define CDIO_MMC_GPCMD_READ_CD 0xbe
-#define CDIO_MMC_GPCMD_READ_MSF 0xb9
-
-/*!
- Group 6 Commands
- */
-
-#define CDIO_MMC_GPCMD_CD_PLAYBACK_STATUS 0xc4 /**< SONY unique command */
-#define CDIO_MMC_GPCMD_PLAYBACK_CONTROL 0xc9 /**< SONY unique command */
-#define CDIO_MMC_GPCMD_READ_CDDA 0xd8 /**< Vendor unique command */
-#define CDIO_MMC_GPCMD_READ_CDXA 0xdb /**< Vendor unique command */
-#define CDIO_MMC_GPCMD_READ_ALL_SUBCODES 0xdf /**< Vendor unique command */
-
-
-
-/*! Level values that can go into READ_CD */
-#define CDIO_MMC_READ_TYPE_ANY 0 /**< All types */
-#define CDIO_MMC_READ_TYPE_CDDA 1 /**< Only CD-DA sectors */
-#define CDIO_MMC_READ_TYPE_MODE1 2 /**< mode1 sectors (user data = 2048) */
-#define CDIO_MMC_READ_TYPE_MODE2 3 /**< mode2 sectors form1 or form2 */
-#define CDIO_MMC_READ_TYPE_M2F1 4 /**< mode2 sectors form1 */
-#define CDIO_MMC_READ_TYPE_M2F2 5 /**< mode2 sectors form2 */
-
-/*! Format values for READ_TOC */
-#define CDIO_MMC_READTOC_FMT_TOC 0
-#define CDIO_MMC_READTOC_FMT_SESSION 1
-#define CDIO_MMC_READTOC_FMT_FULTOC 2
-#define CDIO_MMC_READTOC_FMT_PMA 3 /**< Q subcode data */
-#define CDIO_MMC_READTOC_FMT_ATIP 4 /**< includes media type */
-#define CDIO_MMC_READTOC_FMT_CDTEXT 5 /**< CD-TEXT info */
-
-/*! Page codes for MODE SENSE and MODE SET. */
-#define CDIO_MMC_R_W_ERROR_PAGE 0x01
-#define CDIO_MMC_WRITE_PARMS_PAGE 0x05
-#define CDIO_MMC_AUDIO_CTL_PAGE 0x0e
-#define CDIO_MMC_CDR_PARMS_PAGE 0x0d
-#define CDIO_MMC_POWER_PAGE 0x1a
-#define CDIO_MMC_FAULT_FAIL_PAGE 0x1c
-#define CDIO_MMC_TO_PROTECT_PAGE 0x1d
-#define CDIO_MMC_CAPABILITIES_PAGE 0x2a
-#define CDIO_MMC_ALL_PAGES 0x3f
-
-/*! Return type codes for GET_CONFIGURATION. */
-#define CDIO_MMC_GET_CONF_ALL_FEATURES 0 /**< all features without regard
- to currency. */
-#define CDIO_MMC_GET_CONF_CURRENT_FEATURES 1 /**< features which are currently
- in effect (e.g. based on
- medium inserted). */
-#define CDIO_MMC_GET_CONF_NAMED_FEATURE 2 /**< just the feature named in
- the GET_CONFIGURATION
- cdb. */
-
-/*! FEATURE codes used in GET CONFIGURATION. */
-
-#define CDIO_MMC_FEATURE_PROFILE_LIST 0x000 /**< Profile List Feature */
-#define CDIO_MMC_FEATURE_CORE 0x001
-#define CDIO_MMC_FEATURE_REMOVABLE_MEDIUM 0x002 /**< Removable Medium
- Feature */
-#define CDIO_MMC_FEATURE_WRITE_PROTECT 0x003 /**< Write Protect
- Feature */
-#define CDIO_MMC_FEATURE_RANDOM_READABLE 0x010 /**< Random Readable
- Feature */
-#define CDIO_MMC_FEATURE_MULTI_READ 0x01D /**< Multi-Read
- Feature */
-#define CDIO_MMC_FEATURE_CD_READ 0x01E /**< CD Read
- Feature */
-#define CDIO_MMC_FEATURE_DVD_READ 0x01F /**< DVD Read
- Feature */
-#define CDIO_MMC_FEATURE_RANDOM_WRITABLE 0x020 /**< Random Writable
- Feature */
-#define CDIO_MMC_FEATURE_INCR_WRITE 0x021 /**< Incremental
- Streaming Writable
- Feature */
-#define CDIO_MMC_FEATURE_SECTOR_ERASE 0x022 /**< Sector Erasable
- Feature */
-#define CDIO_MMC_FEATURE_FORMATABLE 0x023 /**< Formattable
- Feature */
-#define CDIO_MMC_FEATURE_DEFECT_MGMT 0x024 /**< Management
- Ability of the
- Logical Unit/media
- system to provide
- an apparently
- defect-free
- space.*/
-#define CDIO_MMC_FEATURE_WRITE_ONCE 0x025 /**< Write Once
- Feature */
-#define CDIO_MMC_FEATURE_RESTRICT_OVERW 0x026 /**< Restricted
- Overwrite
- Feature */
-#define CDIO_MMC_FEATURE_CD_RW_CAV 0x027 /**< CD-RW CAV Write
- Feature */
-#define CDIO_MMC_FEATURE_MRW 0x028 /**< MRW Feature */
-#define CDIO_MMC_FEATURE_DVD_PRW 0x02A /**< DVD+RW Feature */
-#define CDIO_MMC_FEATURE_DVD_PR 0x02B /**< DVD+R Feature */
-#define CDIO_MMC_FEATURE_CD_TAO 0x02D
-#define CDIO_MMC_FEATURE_CD_SAO 0x02E
-#define CDIO_MMC_FEATURE_POWER_MGMT 0x100 /**< Initiator and
- device directed
- power management */
-#define CDIO_MMC_FEATURE_CDDA_EXT_PLAY 0x103 /**< Ability to play
- audio CDs via the
- Logical Unit s own
- analog output */
-#define CDIO_MMC_FEATURE_MCODE_UPGRADE 0x104 /* Ability for the
- device to accept
- new microcode via
- the interface */
-#define CDIO_MMC_FEATURE_TIME_OUT 0x105 /**< Ability to
- respond to all
- commands within a
- specific time */
-#define CDIO_MMC_FEATURE_DVD_CSS 0x106 /**< Ability to
- perform DVD
- CSS/CPPM
- authentication and
- RPC */
-#define CDIO_MMC_FEATURE_RT_STREAMING 0x107 /**< Ability to read
- and write using
- Initiator requested
- performance
- parameters
- */
-#define CDIO_MMC_FEATURE_LU_SN 0x108 /**< The Logical Unit
- has a unique
- identifier. */
-#define CDIO_MMC_FEATURE_FIRMWARE_DATE 0x1FF /**< Firmware creation
- date report */
-
-/*! Profile codes used in GET_CONFIGURATION - PROFILE LIST. */
-#define CDIO_MMC_FEATURE_PROF_NON_REMOVABLE 0x0001 /**< Re-writable
- disk, capable of
- changing
- behavior */
-#define CDIO_MMC_FEATURE_PROF_REMOVABLE 0x0002 /**< disk
- Re-writable;
- with removable
- media */
-#define CDIO_MMC_FEATURE_PROF_MO_ERASABLE 0x0003 /**< Erasable
- Magneto-Optical
- disk with sector
- erase
- capability */
-#define CDIO_MMC_FEATURE_PROF_MO_WRITE_ONCE 0x0004 /**< Write Once
- Magneto-Optical
- write once */
-#define CDIO_MMC_FEATURE_PROF_AS_MO 0x0005 /**< Advance
- Storage
- Magneto-Optical */
-#define CDIO_MMC_FEATURE_PROF_CD_ROM 0x0008 /**< Read only
- Compact Disc
- capable */
-#define CDIO_MMC_FEATURE_PROF_CD_R 0x0009 /**< Write once
- Compact Disc
- capable */
-#define CDIO_MMC_FEATURE_PROF_CD_RW 0x000A /**< CD-RW
- Re-writable
- Compact Disc
- capable */
-#define CDIO_MMC_FEATURE_PROF_DVD_ROM 0x0010 /**< Read only
- DVD */
-#define CDIO_MMC_FEATURE_PROF_DVD_R_SEQ 0x0011 /**< Re-recordable
- DVD using
- Sequential
- recording */
-#define CDIO_MMC_FEATURE_PROF_DVD_RAM 0x0012 /**< Re-writable
- DVD */
-#define CDIO_MMC_FEATURE_PROF_DVD_RW_RO 0x0013 /**< Re-recordable
- DVD using
- Restricted
- Overwrite */
-#define CDIO_MMC_FEATURE_PROF_DVD_RW_SEQ 0x0014 /**< Re-recordable
- DVD using
- Sequential
- recording */
-#define CDIO_MMC_FEATURE_PROF_DVD_PRW 0x001A /**< DVD+RW - DVD
- ReWritable */
-#define CDIO_MMC_FEATURE_PROF_DVD_PR 0x001B /**< DVD+R - DVD
- Recordable */
-#define CDIO_MMC_FEATURE_PROF_DDCD_ROM 0x0020 /**< Read only
- DDCD */
-#define CDIO_MMC_FEATURE_PROF_DDCD_R 0x0021 /**< DDCD-R Write
- only DDCD */
-#define CDIO_MMC_FEATURE_PROF_DDCD_RW 0x0022 /**< Re-Write only
- DDCD */
-#define CDIO_MMC_FEATURE_PROF_NON_CONFORM 0xFFFF /**< The Logical
- Unit does not
- conform to any
- Profile. */
-
-/*! This is listed as optional in ATAPI 2.6, but is (curiously)
- missing from Mt. Fuji, Table 57. It _is_ mentioned in Mt. Fuji
- Table 377 as an MMC command for SCSi devices though... Most ATAPI
- drives support it. */
-#define CDIO_MMC_GPCMD_SET_SPEED 0xbb
-
-
-/*! The largest Command Descriptor Buffer (CDB) size.
- The possible sizes are 6, 10, and 12 bytes.
- */
-#define MAX_CDB_LEN 12
-
-/*! \brief A Command Descriptor Buffer (CDB) used in sending SCSI MMC
- commands.
- */
-typedef struct scsi_mmc_cdb {
- uint8_t field[MAX_CDB_LEN];
-} scsi_mmc_cdb_t;
-
-/*! \brief Format of header block in data returned from a SCSI-MMC
- GET_CONFIGURATION command.
- */
-typedef struct scsi_mmc_feature_list_header {
- unsigned char length_msb;
- unsigned char length_1sb;
- unsigned char length_2sb;
- unsigned char length_lsb;
- unsigned char reserved1;
- unsigned char reserved2;
- unsigned char profile_msb;
- unsigned char profile_lsb;
-} scs_mmc_feature_list_header_t;
-
-/*! An enumeration indicating whether a SCSI MMC command is sending
- data or getting data.
- */
-typedef enum scsi_mmc_direction {
- SCSI_MMC_DATA_READ,
- SCSI_MMC_DATA_WRITE
-} scsi_mmc_direction_t;
-
-#define CDIO_MMC_SET_COMMAND(cdb, command) \
- cdb[0] = command
-
-#define CDIO_MMC_SET_READ_TYPE(cdb, sector_type) \
- cdb[1] = (sector_type << 2)
-
-#define CDIO_MMC_GET_LEN16(p) \
- (p[0]<<8) + p[1]
-
-#define CDIO_MMC_GET_LEN32(p) \
- (p[0] << 24) + (p[1] << 16) + (p[2] << 8) + p[3];
-
-#define CDIO_MMC_SET_LEN16(cdb, pos, len) \
- cdb[pos ] = (len >> 8) & 0xff; \
- cdb[pos+1] = (len ) & 0xff
-
-#define CDIO_MMC_SET_READ_LBA(cdb, lba) \
- cdb[2] = (lba >> 24) & 0xff; \
- cdb[3] = (lba >> 16) & 0xff; \
- cdb[4] = (lba >> 8) & 0xff; \
- cdb[5] = (lba ) & 0xff
-
-#define CDIO_MMC_SET_START_TRACK(cdb, command) \
- cdb[6] = command
-
-#define CDIO_MMC_SET_READ_LENGTH24(cdb, len) \
- cdb[6] = (len >> 16) & 0xff; \
- cdb[7] = (len >> 8) & 0xff; \
- cdb[8] = (len ) & 0xff
-
-#define CDIO_MMC_SET_READ_LENGTH16(cdb, len) \
- CDIO_MMC_SET_LEN16(cdb, 7, len)
-
-#define CDIO_MMC_SET_READ_LENGTH8(cdb, len) \
- cdb[8] = (len ) & 0xff
-
-#define CDIO_MMC_MCSB_ALL_HEADERS 0x78
-
-#define CDIO_MMC_SET_MAIN_CHANNEL_SELECTION_BITS(cdb, val) \
- cdb[9] = val;
-
-/*!
- Return the number of length in bytes of the Command Descriptor
- buffer (CDB) for a given SCSI MMC command. The length will be
- either 6, 10, or 12.
-*/
-uint8_t scsi_mmc_get_cmd_len(uint8_t scsi_cmd);
-
-
-/*!
- Run a SCSI MMC command.
-
- cdio CD structure set by cdio_open().
- i_timeout_ms time in milliseconds we will wait for the command
- to complete.
- p_cdb CDB bytes. All values that are needed should be set on
- input. We'll figure out what the right CDB length should be.
- e_direction direction the transfer is to go.
- i_buf Size of buffer
- p_buf Buffer for data, both sending and receiving.
-
- Returns 0 if command completed successfully.
- */
-int scsi_mmc_run_cmd( const CdIo *p_cdio, unsigned int i_timeout_ms,
- const scsi_mmc_cdb_t *p_cdb,
- scsi_mmc_direction_t e_direction, unsigned int i_buf,
- /*in/out*/ void *p_buf );
-
-/*!
- * Eject using SCSI MMC commands. Return 0 if successful.
- */
-int scsi_mmc_eject_media( const CdIo *p_cdio);
-
-/*! Packet driver to read mode2 sectors.
- Can read only up to 25 blocks.
-*/
-int scsi_mmc_read_sectors ( const CdIo *p_cdio, void *p_buf, lba_t lba,
- int sector_type, unsigned int nblocks);
-
-/*!
- Set the block size for subsequest read requests, via a SCSI MMC
- MODE_SELECT 6 command.
- */
-int scsi_mmc_set_blocksize ( const CdIo *p_cdio, unsigned int bsize);
-
-/*!
- Return the the kind of drive capabilities of device.
- */
-void scsi_mmc_get_drive_cap (const CdIo *p_cdio,
- /*out*/ cdio_drive_read_cap_t *p_read_cap,
- /*out*/ cdio_drive_write_cap_t *p_write_cap,
- /*out*/ cdio_drive_misc_cap_t *p_misc_cap);
-
-/*!
- Get the DVD type associated with cd object.
-*/
-discmode_t scsi_mmc_get_dvd_struct_physical ( const CdIo *p_cdio,
- cdio_dvd_struct_t *s);
-
-/*!
- Get the CD-ROM hardware info via a SCSI MMC INQUIRY command.
- False is returned if we had an error getting the information.
-*/
-bool scsi_mmc_get_hwinfo ( const CdIo *p_cdio,
- /* out*/ cdio_hwinfo_t *p_hw_info );
-
-
-/*!
- Get the media catalog number (MCN) from the CD via MMC.
-
- @return the media catalog number r NULL if there is none or we
- don't have the ability to get it.
-
- Note: string is malloc'd so caller has to free() the returned
- string when done with it.
-
-*/
-char *scsi_mmc_get_mcn ( const CdIo *p_cdio );
-
-#endif /* __SCSI_MMC_H__ */
diff --git a/src/input/vcd/libcdio/cdio/sector.h b/src/input/vcd/libcdio/cdio/sector.h
deleted file mode 100644
index 826883aea..000000000
--- a/src/input/vcd/libcdio/cdio/sector.h
+++ /dev/null
@@ -1,326 +0,0 @@
-/*
- $Id: sector.h,v 1.3 2005/01/01 02:43:58 rockyb Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
- Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-/*!
- \file sector.h
- \brief Things related to CD-ROM layout: tracks, sector sizes, MSFs, LBAs.
-
- A CD-ROM physical sector size is 2048, 2052, 2056, 2324, 2332, 2336,
- 2340, or 2352 bytes long.
-
- Sector types of the standard CD-ROM data formats:
-
-\verbatim
- format sector type user data size (bytes)
- -----------------------------------------------------------------------------
- 1 (Red Book) CD-DA 2352 (CDIO_CD_FRAMESIZE_RAW)
- 2 (Yellow Book) Mode1 Form1 2048 (CDIO_CD_FRAMESIZE)
- 3 (Yellow Book) Mode1 Form2 2336 (M2RAW_SECTOR_SIZE)
- 4 (Green Book) Mode2 Form1 2048 (CDIO_CD_FRAMESIZE)
- 5 (Green Book) Mode2 Form2 2328 (2324+4 spare bytes)
-
-
- The layout of the standard CD-ROM data formats:
- -----------------------------------------------------------------------------
- - audio (red): | audio_sample_bytes |
- | 2352 |
-
- - data (yellow, mode1): | sync - head - data - EDC - zero - ECC |
- | 12 - 4 - 2048 - 4 - 8 - 276 |
-
- - data (yellow, mode2): | sync - head - data |
- | 12 - 4 - 2336 |
-
- - XA data (green, mode2 form1): | sync - head - sub - data - EDC - ECC |
- | 12 - 4 - 8 - 2048 - 4 - 276 |
-
- - XA data (green, mode2 form2): | sync - head - sub - data - Spare |
- | 12 - 4 - 8 - 2324 - 4 |
-\endverbatim
-
-
-*/
-
-#ifndef _CDIO_SECTOR_H_
-#define _CDIO_SECTOR_H_
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#include <cdio/types.h>
-
-/*! track modes (Table 350)
- reference: MMC-3 draft revsion - 10g
-*/
-typedef enum {
- AUDIO, /**< 2352 byte block length */
- MODE1, /**< 2048 byte block length */
- MODE1_RAW, /**< 2352 byte block length */
- MODE2, /**< 2336 byte block length */
- MODE2_FORM1, /**< 2048 byte block length */
- MODE2_FORM2, /**< 2324 byte block length */
- MODE2_FORM_MIX, /**< 2336 byte block length */
- MODE2_RAW /**< 2352 byte block length */
-} trackmode_t;
-
-/*! disc modes. The first combined from MMC-3 5.29.2.8 (Send CUESHEET)
- and GNU/Linux /usr/include/linux/cdrom.h and we've added DVD.
- */
-typedef enum {
- CDIO_DISC_MODE_CD_DA, /**< CD-DA */
- CDIO_DISC_MODE_CD_DATA, /**< CD-ROM form 1 */
- CDIO_DISC_MODE_CD_XA, /**< CD-ROM XA form2 */
- CDIO_DISC_MODE_CD_MIXED, /**< Some combo of above. */
- CDIO_DISC_MODE_DVD_ROM, /**< DVD ROM (e.g. movies) */
- CDIO_DISC_MODE_DVD_RAM, /**< DVD-RAM */
- CDIO_DISC_MODE_DVD_R, /**< DVD-R */
- CDIO_DISC_MODE_DVD_RW, /**< DVD-RW */
- CDIO_DISC_MODE_DVD_PR, /**< DVD+R */
- CDIO_DISC_MODE_DVD_PRW, /**< DVD+RW */
- CDIO_DISC_MODE_DVD_OTHER, /**< Unknown/unclassified DVD type */
- CDIO_DISC_MODE_NO_INFO,
- CDIO_DISC_MODE_ERROR
-} discmode_t;
-
-/*! Information that can be obtained through a Read Subchannel
- command.
- */
-#define CDIO_SUBCHANNEL_SUBQ_DATA 0
-#define CDIO_SUBCHANNEL_CURRENT_POSITION 1
-#define CDIO_SUBCHANNEL_MEDIA_CATALOG 2
-#define CDIO_SUBCHANNEL_TRACK_ISRC 3
-
-/*! track flags
- * Q Sub-channel Control Field (4.2.3.3)
- */
-typedef enum {
- NONE = 0x00, /* no flags set */
- PRE_EMPHASIS = 0x01, /* audio track recorded with pre-emphasis */
- COPY_PERMITTED = 0x02, /* digital copy permitted */
- DATA = 0x04, /* data track */
- FOUR_CHANNEL_AUDIO = 0x08, /* 4 audio channels */
- SCMS = 0x10 /* SCMS (5.29.2.7) */
-} flag_t;
-
-#define CDIO_PREGAP_SECTORS 150
-#define CDIO_POSTGAP_SECTORS 150
-
-/*
- Some generally useful CD-ROM information -- mostly based on the above.
- This is from linux.h - not to slight other OS's. This was the first
- place I came across such useful stuff.
-*/
-#define CDIO_CD_MINS 74 /**< max. minutes per CD, not really
- a limit */
-#define CDIO_CD_SECS_PER_MIN 60 /**< seconds per minute */
-#define CDIO_CD_FRAMES_PER_SEC 75 /**< frames per second */
-#define CDIO_CD_SYNC_SIZE 12 /**< 12 sync bytes per raw data frame */
-#define CDIO_CD_CHUNK_SIZE 24 /**< lowest-level "data bytes piece" */
-#define CDIO_CD_NUM_OF_CHUNKS 98 /**< chunks per frame */
-#define CDIO_CD_FRAMESIZE_SUB 96 /**< subchannel data "frame" size */
-#define CDIO_CD_HEADER_SIZE 4 /**< header (address) bytes per raw
- data frame */
-#define CDIO_CD_SUBHEADER_SIZE 8 /**< subheader bytes per raw XA data
- frame */
-#define CDIO_CD_EDC_SIZE 4 /**< bytes EDC per most raw data
- frame types */
-#define CDIO_CD_M1F1_ZERO_SIZE 8 /**< bytes zero per yellow book mode
- 1 frame */
-#define CDIO_CD_ECC_SIZE 276 /**< bytes ECC per most raw data frame
- types */
-#define CDIO_CD_FRAMESIZE 2048 /**< bytes per frame, "cooked" mode */
-#define CDIO_CD_FRAMESIZE_RAW 2352 /**< bytes per frame, "raw" mode */
-#define CDIO_CD_FRAMESIZE_RAWER 2646 /**< The maximum possible returned
- bytes */
-#define CDIO_CD_FRAMESIZE_RAW1 (CDIO_CD_CD_FRAMESIZE_RAW-CDIO_CD_SYNC_SIZE) /*2340*/
-#define CDIO_CD_FRAMESIZE_RAW0 (CDIO_CD_FRAMESIZE_RAW-CDIO_CD_SYNC_SIZE-CDIO_CD__HEAD_SIZE) /*2336*/
-
-/*! "before data" part of raw XA (green, mode2) frame */
-#define CDIO_CD_XA_HEADER (CDIO_CD_HEADER_SIZE+CDIO_CD_SUBHEADER_SIZE)
-
-/*! "after data" part of raw XA (green, mode2 form1) frame */
-#define CDIO_CD_XA_TAIL (CDIO_CD_EDC_SIZE+CDIO_CD_ECC_SIZE)
-
-/*! "before data" sync bytes + header of XA (green, mode2) frame */
-#define CDIO_CD_XA_SYNC_HEADER (CDIO_CD_SYNC_SIZE+CDIO_CD_XA_HEADER)
-
-/*! CD-ROM address types (GNU/Linux e.g. cdrom_tocentry.cdte_format) */
-#define CDIO_CDROM_LBA 0x01 /**< "logical block": first frame is #0 */
-#define CDIO_CDROM_MSF 0x02 /**< "minute-second-frame": binary, not
- BCD here! */
-
-/*! CD-ROM track format types (GNU/Linux cdte_ctrl) */
-#define CDIO_CDROM_DATA_TRACK 0x04
-#define CDIO_CDROM_CDI_TRACK 0x10
-#define CDIO_CDROM_XA_TRACK 0x20
-
-/*! The leadout track is always 0xAA, regardless of # of tracks on
- disc, or what value may be used internally. For example although
- OS X uses a different value for the lead-out track internally than
- given below, programmers should use CDIO_CDROM_LEADOUT_TRACK and
- not worry about this.
- */
-#define CDIO_CDROM_LEADOUT_TRACK 0xAA
-
-#define M2F2_SECTOR_SIZE 2324
-#define M2SUB_SECTOR_SIZE 2332
-#define M2RAW_SECTOR_SIZE 2336
-
-/*! Largest CD track number */
-#define CDIO_CD_MAX_TRACKS 99
-/*! Smallest CD track number */
-#define CDIO_CD_MIN_TRACK_NO 1
-
-/*! Largest CD session number */
-#define CDIO_CD_MAX_SESSIONS 99
-/*! Smallest CD session number */
-#define CDIO_CD_MIN_SESSION_NO 1
-
-/*! Largest LSN in a CD */
-#define CDIO_CD_MAX_LSN 450150
-/*! Smallest LSN in a CD */
-#define CDIO_CD_MIN_LSN -450150
-
-
-#define CDIO_CD_FRAMES_PER_MIN \
- (CDIO_CD_FRAMES_PER_SEC*CDIO_CD_SECS_PER_MIN)
-
-#define CDIO_CD_74MIN_SECTORS (UINT32_C(74)*CDIO_CD_FRAMES_PER_MIN)
-#define CDIO_CD_80MIN_SECTORS (UINT32_C(80)*CDIO_CD_FRAMES_PER_MIN)
-#define CDIO_CD_90MIN_SECTORS (UINT32_C(90)*CDIO_CD_FRAMES_PER_MIN)
-
-#define CDIO_CD_MAX_SECTORS \
- (UINT32_C(100)*CDIO_CD_FRAMES_PER_MIN-CDIO_PREGAP_SECTORS)
-
-#define msf_t_SIZEOF 3
-
-/*!
- Convert an LBA into a string representation of the MSF.
- \warning cdio_lba_to_msf_str returns new allocated string */
-char *cdio_lba_to_msf_str (lba_t lba);
-
-/*!
- Convert an MSF into a string representation of the MSF.
- \warning cdio_msf_to_msf_str returns new allocated string */
-char *cdio_msf_to_str (const msf_t *msf);
-
-/*!
- Convert an LBA into the corresponding LSN.
-*/
-lba_t cdio_lba_to_lsn (lba_t lba);
-
-/*!
- Convert an LBA into the corresponding MSF.
-*/
-void cdio_lba_to_msf(lba_t lba, msf_t *msf);
-
-/*!
- Convert an LSN into the corresponding LBA.
- CDIO_INVALID_LBA is returned if there is an error.
-*/
-lba_t cdio_lsn_to_lba (lsn_t lsn);
-
-/*!
- Convert an LSN into the corresponding MSF.
-*/
-void cdio_lsn_to_msf (lsn_t lsn, msf_t *msf);
-
-/*!
- Convert a MSF into the corresponding LBA.
- CDIO_INVALID_LBA is returned if there is an error.
-*/
-lba_t cdio_msf_to_lba (const msf_t *msf);
-
-/*!
- Convert a MSF into the corresponding LSN.
- CDIO_INVALID_LSN is returned if there is an error.
-*/
-lsn_t cdio_msf_to_lsn (const msf_t *msf);
-
-/*!
- Convert a MSF - broken out as 3 integer components into the
- corresponding LBA.
- CDIO_INVALID_LBA is returned if there is an error.
-*/
-lba_t cdio_msf3_to_lba (unsigned int minutes, unsigned int seconds,
- unsigned int frames);
-
-/*!
- Convert a string of the form MM:SS:FF into the corresponding LBA.
- CDIO_INVALID_LBA is returned if there is an error.
-*/
-lba_t cdio_mmssff_to_lba (const char *psz_mmssff);
-
-/*!
- Return true if discmode is some sort of CD.
-*/
-bool cdio_is_discmode_cdrom (discmode_t discmode);
-
-/*!
- Return true if discmode is some sort of DVD.
-*/
-bool cdio_is_discmode_dvd (discmode_t discmode);
-
-
-#ifdef __cplusplus
- }
-#endif
-
-static inline bool discmode_is_cd(discmode_t discmode)
-{
- switch (discmode) {
- case CDIO_DISC_MODE_CD_DA:
- case CDIO_DISC_MODE_CD_DATA:
- case CDIO_DISC_MODE_CD_XA:
- case CDIO_DISC_MODE_CD_MIXED:
- return true;
- default:
- return false;
- }
-}
-
-static inline bool discmode_is_dvd(discmode_t discmode)
-{
- switch (discmode) {
- case CDIO_DISC_MODE_DVD_ROM:
- case CDIO_DISC_MODE_DVD_RAM:
- case CDIO_DISC_MODE_DVD_R:
- case CDIO_DISC_MODE_DVD_RW:
- case CDIO_DISC_MODE_DVD_PR:
- case CDIO_DISC_MODE_DVD_PRW:
- case CDIO_DISC_MODE_DVD_OTHER:
- return true;
- default:
- return false;
- }
-}
-
-
-#endif /* _CDIO_SECTOR_H_ */
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libcdio/cdio/types.h b/src/input/vcd/libcdio/cdio/types.h
deleted file mode 100644
index ec84a142b..000000000
--- a/src/input/vcd/libcdio/cdio/types.h
+++ /dev/null
@@ -1,379 +0,0 @@
-/*
- $Id: types.h,v 1.3 2005/01/01 02:43:58 rockyb Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
- Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/** \file types.h
- * \brief Common type definitions used pervasively in libcdio.
- */
-
-
-#ifndef __CDIO_TYPES_H__
-#define __CDIO_TYPES_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
- /* provide some C99 definitions */
-
-#if defined(HAVE_SYS_TYPES_H)
-#include <sys/types.h>
-#endif
-
-#if defined(HAVE_STDINT_H)
-# include <stdint.h>
-#elif defined(HAVE_INTTYPES_H)
-# include <inttypes.h>
-#elif defined(AMIGA) || defined(__linux__)
- typedef u_int8_t uint8_t;
- typedef u_int16_t uint16_t;
- typedef u_int32_t uint32_t;
- typedef u_int64_t uint64_t;
-#else
- /* warning ISO/IEC 9899:1999 <stdint.h> was missing and even <inttypes.h> */
- /* fixme */
-#endif /* HAVE_STDINT_H */
-
- /* default HP/UX macros are broken */
-#if defined(__hpux__)
-# undef UINT16_C
-# undef UINT32_C
-# undef UINT64_C
-# undef INT64_C
-#endif
-
- /* if it's still not defined, take a good guess... should work for
- most 32bit and 64bit archs */
-
-#ifndef UINT16_C
-# define UINT16_C(c) c ## U
-#endif
-
-#ifndef UINT32_C
-# if defined (SIZEOF_INT) && SIZEOF_INT == 4
-# define UINT32_C(c) c ## U
-# elif defined (SIZEOF_LONG) && SIZEOF_LONG == 4
-# define UINT32_C(c) c ## UL
-# else
-# define UINT32_C(c) c ## U
-# endif
-#endif
-
-#ifndef UINT64_C
-# if defined (SIZEOF_LONG) && SIZEOF_LONG == 8
-# define UINT64_C(c) c ## UL
-# elif defined (SIZEOF_INT) && SIZEOF_INT == 8
-# define UINT64_C(c) c ## U
-# else
-# define UINT64_C(c) c ## ULL
-# endif
-#endif
-
-#ifndef INT64_C
-# if defined (SIZEOF_LONG) && SIZEOF_LONG == 8
-# define INT64_C(c) c ## L
-# elif defined (SIZEOF_INT) && SIZEOF_INT == 8
-# define INT64_C(c) c
-# else
-# define INT64_C(c) c ## LL
-# endif
-#endif
-
-#if defined(HAVE_STDBOOL_H)
-#include <stdbool.h>
-#else
- /* ISO/IEC 9899:1999 <stdbool.h> missing -- enabling workaround */
-
-# ifndef __cplusplus
- typedef enum
- {
- false = 0,
- true = 1
- } _cdio_Bool;
-
-# define false false
-# define true true
-# define bool _cdio_Bool
-# endif
-#endif
-
- /* some GCC optimizations -- gcc 2.5+ */
-
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
-#define GNUC_PRINTF( format_idx, arg_idx ) \
- __attribute__((format (printf, format_idx, arg_idx)))
-#define GNUC_SCANF( format_idx, arg_idx ) \
- __attribute__((format (scanf, format_idx, arg_idx)))
-#define GNUC_FORMAT( arg_idx ) \
- __attribute__((format_arg (arg_idx)))
-#define GNUC_NORETURN \
- __attribute__((noreturn))
-#define GNUC_CONST \
- __attribute__((const))
-#define GNUC_UNUSED \
- __attribute__((unused))
-#define GNUC_PACKED \
- __attribute__((packed))
-#else /* !__GNUC__ */
-#define GNUC_PRINTF( format_idx, arg_idx )
-#define GNUC_SCANF( format_idx, arg_idx )
-#define GNUC_FORMAT( arg_idx )
-#define GNUC_NORETURN
-#define GNUC_CONST
-#define GNUC_UNUSED
-#define GNUC_PACKED
-#endif /* !__GNUC__ */
-
-#if defined(__GNUC__)
- /* for GCC we try to use GNUC_PACKED */
-# define PRAGMA_BEGIN_PACKED
-# define PRAGMA_END_PACKED
-#elif defined(HAVE_ISOC99_PRAGMA)
- /* should work with most EDG-frontend based compilers */
-# define PRAGMA_BEGIN_PACKED _Pragma("pack(1)")
-# define PRAGMA_END_PACKED _Pragma("pack()")
-#else /* neither gcc nor _Pragma() available... */
- /* ...so let's be naive and hope the regression testsuite is run... */
-# define PRAGMA_BEGIN_PACKED
-# define PRAGMA_END_PACKED
-#endif
-
- /*
- * user directed static branch prediction gcc 2.96+
- */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 95)
-# define GNUC_LIKELY(x) __builtin_expect((x),true)
-# define GNUC_UNLIKELY(x) __builtin_expect((x),false)
-#else
-# define GNUC_LIKELY(x) (x)
-# define GNUC_UNLIKELY(x) (x)
-#endif
-
-#ifndef NULL
-# define NULL ((void*) 0)
-#endif
-
- /* our own offsetof()-like macro */
-#define __cd_offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
-
- /*!
- \brief MSF (minute/second/frame) structure
-
- One CD-ROMs addressing scheme especially used in audio formats
- (Red Book) is an address by minute, sector and frame which
- BCD-encoded in three bytes. An alternative format is an lba_t.
-
- @see lba_t
- */
- PRAGMA_BEGIN_PACKED
- struct msf_rec {
- uint8_t m, s, f;
- } GNUC_PACKED;
- PRAGMA_END_PACKED
-
- typedef struct msf_rec msf_t;
-
-#define msf_t_SIZEOF 3
-
- /* type used for bit-fields in structs (1 <= bits <= 8) */
-#if defined(__GNUC__)
- /* this is strict ISO C99 which allows only 'unsigned int', 'signed
- int' and '_Bool' explicitly as bit-field type */
- typedef unsigned int bitfield_t;
-#else
- /* other compilers might increase alignment requirements to match the
- 'unsigned int' type -- fixme: find out how unalignment accesses can
- be pragma'ed on non-gcc compilers */
- typedef uint8_t bitfield_t;
-#endif
-
- /*! The type of a Logical Block Address. We allow for an lba to be
- negative to be consistent with an lba, although I'm not sure this
- this is possible.
-
- */
- typedef int32_t lba_t;
-
- /*! The type of a Logical Sector Number. Note that an lba lsn be negative
- and the MMC3 specs allow for a conversion of a negative lba
-
- @see msf_t
- */
- typedef int32_t lsn_t;
-
- /*! The type of a track number 0..99. */
- typedef uint8_t track_t;
-
- /*!
- Constant for invalid track number
- */
-#define CDIO_INVALID_TRACK 0xFF
-
- /*! The type of a session number 0..99. */
- typedef uint8_t session_t;
-
- /*!
- Constant for invalid session number
- */
-#define CDIO_INVALID_SESSION 0xFF
-
- /*!
- Constant for invalid LBA. It is 151 less than the most negative
- LBA -45150. This provide slack for the 150-frame offset in
- LBA to LSN 150 conversions
- */
-#define CDIO_INVALID_LBA -45301
-
- /*!
- Constant for invalid LSN
- */
-#define CDIO_INVALID_LSN CDIO_INVALID_LBA
-
- /*!
- Number of ASCII bytes in a media catalog number (MCN).
- */
-#define CDIO_MCN_SIZE 13
-
- /*!
- Type to hold ASCII bytes in a media catalog number (MCN).
- We include an extra 0 byte so these can be used as C strings.
- */
- typedef char cdio_mcn_t[CDIO_MCN_SIZE+1];
-
-
- /*!
- Number of ASCII bytes in International Standard Recording Codes (ISRC)
- */
-#define CDIO_ISRC_SIZE 12
-
- /*!
- Type to hold ASCII bytes in a media catalog number (MCN).
- We include an extra 0 byte so these can be used as C strings.
- */
- typedef char cdio_isrc_t[CDIO_ISRC_SIZE+1];
-
- typedef int cdio_fs_anal_t;
-
- /*! The type of an drive capability bit mask. See below for values*/
- typedef uint32_t cdio_drive_read_cap_t;
- typedef uint32_t cdio_drive_write_cap_t;
- typedef uint32_t cdio_drive_misc_cap_t;
-
- /*!
- \brief Drive types returned by cdio_get_drive_cap()
-
- NOTE: Setting a bit here means the presence of a capability.
- */
-
-#define CDIO_DRIVE_CAP_ERROR 0x40000 /**< Error */
-#define CDIO_DRIVE_CAP_UNKNOWN 0x80000 /**< Dunno. It can be on if we
- have only partial information
- or are not completely certain
- */
-
-#define CDIO_DRIVE_CAP_MISC_CLOSE_TRAY 0x00001 /**< caddy systems can't
- close... */
-#define CDIO_DRIVE_CAP_MISC_EJECT 0x00002 /**< but can eject. */
-#define CDIO_DRIVE_CAP_MISC_LOCK 0x00004 /**< disable manual eject */
-#define CDIO_DRIVE_CAP_MISC_SELECT_SPEED 0x00008 /**< programmable speed */
-#define CDIO_DRIVE_CAP_MISC_SELECT_DISC 0x00010 /**< select disc from
- juke-box */
-#define CDIO_DRIVE_CAP_MISC_MULTI_SESSION 0x00020 /**< read sessions>1 */
-#define CDIO_DRIVE_CAP_MISC_MEDIA_CHANGED 0x00080 /**< media changed */
-#define CDIO_DRIVE_CAP_MISC_RESET 0x00100 /**< hard reset device */
-#define CDIO_DRIVE_CAP_MCN 0x00200 /**< can read MCN */
-#define CDIO_DRIVE_CAP_ISRC 0x00200 /**< can read ISRC */
-#define CDIO_DRIVE_CAP_MISC_FILE 0x20000 /**< drive is really a file,
- i.e a CD file image */
-
- /*! Reading masks.. */
-#define CDIO_DRIVE_CAP_READ_AUDIO 0x00001 /**< drive can play CD audio */
-#define CDIO_DRIVE_CAP_READ_CD_DA 0x00002 /**< drive can read CD-DA */
-#define CDIO_DRIVE_CAP_READ_CD_G 0x00004 /**< drive can read CD+G */
-#define CDIO_DRIVE_CAP_READ_CD_R 0x00008 /**< drive can read CD-R */
-#define CDIO_DRIVE_CAP_READ_CD_RW 0x00010 /**< drive can read CD-RW */
-#define CDIO_DRIVE_CAP_READ_DVD_R 0x00020 /**< drive can read DVD-R */
-#define CDIO_DRIVE_CAP_READ_DVD_PR 0x00040 /**< drive can read DVD+R */
-#define CDIO_DRIVE_CAP_READ_DVD_RAM 0x00080 /**< drive can read DVD-RAM */
-#define CDIO_DRIVE_CAP_READ_DVD_ROM 0x00100 /**< drive can read DVD-ROM */
-#define CDIO_DRIVE_CAP_READ_DVD_RW 0x00200 /**< drive can read DVD-RW */
-#define CDIO_DRIVE_CAP_READ_DVD_RPW 0x00400 /**< drive can read DVD+RW */
-#define CDIO_DRIVE_CAP_READ_C2_ERRS 0x00800 /**< has C2 error correction */
-
- /*! Writing masks.. */
-#define CDIO_DRIVE_CAP_WRITE_CD_R 0x00001 /**< drive can write CD-R */
-#define CDIO_DRIVE_CAP_WRITE_CD_RW 0x00002 /**< drive can write CD-R */
-#define CDIO_DRIVE_CAP_WRITE_DVD_R 0x00004 /**< drive can write DVD-R */
-#define CDIO_DRIVE_CAP_WRITE_DVD_PR 0x00008 /**< drive can write DVD+R */
-#define CDIO_DRIVE_CAP_WRITE_DVD_RAM 0x00010 /**< drive can write DVD-RAM */
-#define CDIO_DRIVE_CAP_WRITE_DVD_RW 0x00020 /**< drive can write DVD-RW */
-#define CDIO_DRIVE_CAP_WRITE_DVD_RPW 0x00040 /**< drive can write DVD+RW */
-#define CDIO_DRIVE_CAP_WRITE_MT_RAINIER 0x00080 /**< Mount Rainier */
-#define CDIO_DRIVE_CAP_WRITE_BURN_PROOF 0x00100 /**< burn proof */
-
-/**< Masks derived from above... */
-#define CDIO_DRIVE_CAP_WRITE_CD ( \
- CDIO_DRIVE_CAP_WRITE_CD_R \
- | CDIO_DRIVE_CAP_WRITE_CD_RW \
- )
-/**< Has some sort of CD writer ability */
-
-/**< Masks derived from above... */
-#define CDIO_DRIVE_CAP_WRITE_DVD ( \
- | CDIO_DRIVE_CAP_WRITE_DVD_R \
- | CDIO_DRIVE_CAP_WRITE_DVD_PR \
- | CDIO_DRIVE_CAP_WRITE_DVD_RAM \
- | CDIO_DRIVE_CAP_WRITE_DVD_RW \
- | CDIO_DRIVE_CAP_WRITE_DVD_RPW \
- )
-/**< Has some sort of DVD writer ability */
-
-#define CDIO_DRIVE_CAP_WRITE \
- (CDIO_DRIVE_CAP_WRITE_CD | CDIO_DRIVE_CAP_WRITE_DVD)
-/**< Has some sort of DVD or CD writing ability */
-
- /*!
- track flags
- Q Sub-channel Control Field (4.2.3.3)
- */
- typedef enum {
- CDIO_TRACK_FLAG_NONE = 0x00, /**< no flags set */
- CDIO_TRACK_FLAG_PRE_EMPHASIS = 0x01, /**< audio track recorded with
- pre-emphasis */
- CDIO_TRACK_FLAG_COPY_PERMITTED = 0x02, /**< digital copy permitted */
- CDIO_TRACK_FLAG_DATA = 0x04, /**< data track */
- CDIO_TRACK_FLAG_FOUR_CHANNEL_AUDIO = 0x08, /**< 4 audio channels */
- CDIO_TRACK_FLAG_SCMS = 0x10 /**< SCMS (5.29.2.7) */
-} cdio_track_flag;
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __CDIO_TYPES_H__ */
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libcdio/cdio/util.h b/src/input/vcd/libcdio/cdio/util.h
deleted file mode 100644
index 3cea313b4..000000000
--- a/src/input/vcd/libcdio/cdio/util.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- $Id: util.h,v 1.3 2005/01/01 02:43:58 rockyb Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
- Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifndef __CDIO_UTIL_H__
-#define __CDIO_UTIL_H__
-
-/*!
- \file util.h
- \brief Miscellaneous utility functions.
-
- Warning: this will probably get removed/replaced by using glib.h
-*/
-#include <stdlib.h>
-
-#undef MAX
-#define MAX(a, b) (((a) > (b)) ? (a) : (b))
-
-#undef MIN
-#define MIN(a, b) (((a) < (b)) ? (a) : (b))
-
-#undef IN
-#define IN(x, low, high) ((x) >= (low) && (x) <= (high))
-
-#undef CLAMP
-#define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
-
-static inline unsigned
-_cdio_len2blocks (unsigned len, int blocksize)
-{
- unsigned blocks;
-
- blocks = len / blocksize;
- if (len % blocksize)
- blocks++;
-
- return blocks;
-}
-
-/* round up to next block boundary */
-static inline unsigned
-_cdio_ceil2block (unsigned offset, int blocksize)
-{
- return _cdio_len2blocks (offset, blocksize) * blocksize;
-}
-
-static inline unsigned
-_cdio_ofs_add (unsigned offset, unsigned length, int blocksize)
-{
- if (blocksize - (offset % blocksize) < length)
- offset = _cdio_ceil2block (offset, blocksize);
-
- offset += length;
-
- return offset;
-}
-
-static inline const char *
-_cdio_bool_str (bool b)
-{
- return b ? "yes" : "no";
-}
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void *
-_cdio_malloc (size_t size);
-
-void *
-_cdio_memdup (const void *mem, size_t count);
-
-char *
-_cdio_strdup_upper (const char str[]);
-
-void
-_cdio_strfreev(char **strv);
-
-char *
-_cdio_strjoin (char *strv[], unsigned count, const char delim[]);
-
-size_t
-_cdio_strlenv(char **str_array);
-
-char **
-_cdio_strsplit(const char str[], char delim);
-
-uint8_t cdio_to_bcd8(uint8_t n);
-uint8_t cdio_from_bcd8(uint8_t p);
-
-#if defined(__GNUC__) && __GNUC__ >= 3
-static inline __attribute__((deprecated))
-uint8_t to_bcd8(uint8_t n) {
- return cdio_to_bcd8(n);
-}
-static inline __attribute__((deprecated))
-uint8_t from_bcd8(uint8_t p) {
- return cdio_from_bcd8(p);
-}
-#else
-#define to_bcd8 cdio_to_bcd8
-#define from_bcd8 cdio_from_bcd8
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __CDIO_UTIL_H__ */
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libcdio/cdio/version.h b/src/input/vcd/libcdio/cdio/version.h
deleted file mode 100644
index 345924cab..000000000
--- a/src/input/vcd/libcdio/cdio/version.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/* $Id: version.h,v 1.2 2004/04/11 12:20:31 miguelfreitas Exp $ */
-/** \file version.h
- * \brief A file simply containing the library version number.
- */
-
-/*! CDIO_VERSION can as a string in programs to show what version is used. */
-#define CDIO_VERSION "0.68"
-
-/*! LIBCDIO_VERSION_NUM can be used for testing in the C preprocessor */
-#define LIBCDIO_VERSION_NUM 68
diff --git a/src/input/vcd/libcdio/cdio/xa.h b/src/input/vcd/libcdio/cdio/xa.h
deleted file mode 100644
index 3af27eab5..000000000
--- a/src/input/vcd/libcdio/cdio/xa.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- $Id: xa.h,v 1.3 2005/01/01 02:43:58 rockyb Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
- Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
-
- See also iso9660.h by Eric Youngdale (1993) and in cdrtools. These
- are
-
- Copyright 1993 Yggdrasil Computing, Incorporated
- Copyright (c) 1999,2000 J. Schilling
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-/*!
- \file xa.h
- \brief Things related to the ISO-9660 XA (Extended Attributes) format
-*/
-
-
-#ifndef __CDIO_XA_H__
-#define __CDIO_XA_H__
-
-#include <cdio/types.h>
-
-#define ISO_XA_MARKER_STRING "CD-XA001"
-#define ISO_XA_MARKER_OFFSET 1024
-
-/* XA attribute definitions */
-#define XA_PERM_RSYS 0x0001 /**< System Group Read */
-#define XA_PERM_XSYS 0x0004 /**< System Group Execute */
-
-#define XA_PERM_RUSR 0x0010 /**< User (owner) Read */
-#define XA_PERM_XUSR 0x0040 /**< User (owner) Execute */
-
-#define XA_PERM_RGRP 0x0100 /**< Group Read */
-#define XA_PERM_XGRP 0x0400 /**< Group Execute */
-
-#define XA_PERM_ROTH 0x1000 /**< Other (world) Read */
-#define XA_PERM_XOTH 0x4000 /**< Other (world) Execute */
-
-#define XA_ATTR_MODE2FORM1 (1 << 11)
-#define XA_ATTR_MODE2FORM2 (1 << 12)
-#define XA_ATTR_INTERLEAVED (1 << 13)
-#define XA_ATTR_CDDA (1 << 14)
-#define XA_ATTR_DIRECTORY (1 << 15)
-
-/* some aggregations */
-#define XA_PERM_ALL_READ (XA_PERM_RUSR | XA_PERM_RSYS | XA_PERM_RGRP)
-#define XA_PERM_ALL_EXEC (XA_PERM_XUSR | XA_PERM_XSYS | XA_PERM_XGRP)
-#define XA_PERM_ALL_ALL (XA_PERM_ALL_READ | XA_PERM_ALL_EXEC)
-
-#define XA_FORM1_DIR (XA_ATTR_DIRECTORY | XA_ATTR_MODE2FORM1 | XA_PERM_ALL_ALL)
-#define XA_FORM1_FILE (XA_ATTR_MODE2FORM1 | XA_PERM_ALL_ALL)
-#define XA_FORM2_FILE (XA_ATTR_MODE2FORM2 | XA_PERM_ALL_ALL)
-
-/*! \brief "Extended Architecture according to the Philips Yellow Book.
-
-CD-ROM EXtended Architecture is a modification to the CD-ROM
-specification that defines two new types of sectors. CD-ROM XA was
-developed jointly by Sony, Philips, and Microsoft, and announced in
-August 1988. Its specifications were published in an extension to the
-Yellow Book. CD-i, Photo CD, Video CD and CD-EXTRA have all
-subsequently been based on CD-ROM XA.
-
-CD-XA defines another way of formatting sectors on a CD-ROM, including
-headers in the sectors that describe the type (audio, video, data) and
-some additional info (markers, resolution in case of a video or audio
-sector, file numbers, etc).
-
-The data written on a CD-XA is consistent with and can be in ISO-9660
-file system format and therefore be readable by ISO-9660 file system
-translators. But also a CD-I player can also read CD-XA discs even if
-its own `Green Book' file system only resembles ISO 9660 and isn't
-fully compatible.
-
- Note structure is big-endian.
-*/
-typedef struct iso9660_xa
-{
- uint16_t group_id; /**< 0 */
- uint16_t user_id; /**< 0 */
- uint16_t attributes; /**< XA_ATTR_ */
- uint8_t signature[2]; /**< { 'X', 'A' } */
- uint8_t filenum; /**< file number, see also XA subheader */
- uint8_t reserved[5]; /**< zero */
-} GNUC_PACKED iso9660_xa_t;
-
-
-/*!
- Returns a string which interpreting the extended attribute xa_attr.
- For example:
- \verbatim
- d---1xrxrxr
- ---2--r-r-r
- -a--1xrxrxr
- \endverbatim
-
- A description of the characters in the string follows
- The 1st character is either "d" if the entry is a directory, or "-" if not
- The 2nd character is either "a" if the entry is CDDA (audio), or "-" if not
- The 3rd character is either "i" if the entry is interleaved, or "-" if not
- The 4th character is either "2" if the entry is mode2 form2 or "-" if not
- The 5th character is either "1" if the entry is mode2 form1 or "-" if not
- Note that an entry will either be in mode2 form1 or mode form2. That
- is you will either see "2-" or "-1" in the 4th & 5th positions.
-
- The 6th and 7th characters refer to permissions for a user while the
- the 8th and 9th characters refer to permissions for a group while, and
- the 10th and 11th characters refer to permissions for everyone.
-
- In each of these pairs the first character (6, 8, 10) is "x" if the
- entry is executable. For a directory this means the directory is
- allowed to be listed or "searched".
- The second character of a pair (7, 9, 11) is "r" if the entry is allowed
- to be read.
-*/
-const char *
-iso9660_get_xa_attr_str (uint16_t xa_attr);
-
-/*!
- Allocates and initalizes a new iso9600_xa_t variable and returns
- it. The caller should free the returned result.
-
- @see iso9660_xa
-*/
-iso9660_xa_t *
-iso9660_xa_init (iso9660_xa_t *_xa, uint16_t uid, uint16_t gid, uint16_t attr,
- uint8_t filenum);
-
-#endif /* __CDIO_XA_H__ */
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libcdio/cdio_assert.h b/src/input/vcd/libcdio/cdio_assert.h
deleted file mode 100644
index 2433bf0c7..000000000
--- a/src/input/vcd/libcdio/cdio_assert.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- $Id: cdio_assert.h,v 1.2 2004/04/11 12:20:31 miguelfreitas Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifndef __CDIO_ASSERT_H__
-#define __CDIO_ASSERT_H__
-
-#if defined(__GNUC__)
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <cdio/types.h>
-#include <cdio/logging.h>
-
-#define cdio_assert(expr) \
- { \
- if (GNUC_UNLIKELY (!(expr))) cdio_log (CDIO_LOG_ASSERT, \
- "file %s: line %d (%s): assertion failed: (%s)", \
- __FILE__, __LINE__, __PRETTY_FUNCTION__, #expr); \
- }
-
-#define cdio_assert_not_reached() \
- { \
- cdio_log (CDIO_LOG_ASSERT, \
- "file %s: line %d (%s): should not be reached", \
- __FILE__, __LINE__, __PRETTY_FUNCTION__); \
- }
-
-#else /* non GNU C */
-
-#include <assert.h>
-
-#define cdio_assert(expr) \
- assert(expr)
-
-#define cdio_assert_not_reached() \
- assert(0)
-
-#endif
-
-#endif /* __CDIO_ASSERT_H__ */
diff --git a/src/input/vcd/libcdio/cdio_private.h b/src/input/vcd/libcdio/cdio_private.h
deleted file mode 100644
index b1e2777ed..000000000
--- a/src/input/vcd/libcdio/cdio_private.h
+++ /dev/null
@@ -1,315 +0,0 @@
-/*
- $Id: cdio_private.h,v 1.3 2005/01/01 02:43:57 rockyb Exp $
-
- Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* Internal routines for CD I/O drivers. */
-
-
-#ifndef __CDIO_PRIVATE_H__
-#define __CDIO_PRIVATE_H__
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <cdio/cdio.h>
-#include <cdio/cdtext.h>
-#include "scsi_mmc_private.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
- /* Opaque type */
- typedef struct _CdioDataSource CdioDataSource;
-
-#ifdef __cplusplus
-}
-
-#endif /* __cplusplus */
-
-#include "generic.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-
- typedef struct {
-
- /*!
- Eject media in CD drive. If successful, as a side effect we
- also free obj. Return 0 if success and 1 for failure.
- */
- int (*eject_media) (void *env);
-
- /*!
- Release and free resources associated with cd.
- */
- void (*free) (void *env);
-
- /*!
- Return the value associated with the key "arg".
- */
- const char * (*get_arg) (void *env, const char key[]);
-
- /*!
- Get cdtext information for a CdIo object.
-
- @param obj the CD object that may contain CD-TEXT information.
- @return the CD-TEXT object or NULL if obj is NULL
- or CD-TEXT information does not exist.
-
- If i_track is 0 or CDIO_CDROM_LEADOUT_TRACK the track returned
- is the information assocated with the CD.
- */
- const cdtext_t * (*get_cdtext) (void *env, track_t i_track);
-
- /*!
- Return an array of device names. if CdIo is NULL (we haven't
- initialized a specific device driver), then find a suitable device
- driver.
-
- NULL is returned if we couldn't return a list of devices.
- */
- char ** (*get_devices) (void);
-
- /*!
- Return a string containing the default CD device if none is specified.
- */
- char * (*get_default_device)(void);
-
- /*!
- Get disc mode associated with cd_obj.
- */
- discmode_t (*get_discmode) (void *p_env);
-
- /*!
- Return the what kind of device we've got.
-
- See cd_types.h for a list of bitmasks for the drive type;
- */
- void (*get_drive_cap) (const void *env,
- cdio_drive_read_cap_t *p_read_cap,
- cdio_drive_write_cap_t *p_write_cap,
- cdio_drive_misc_cap_t *p_misc_cap);
- /*!
- Return the number of of the first track.
- CDIO_INVALID_TRACK is returned on error.
- */
- track_t (*get_first_track_num) (void *p_env);
-
- /*!
- Get the CD-ROM hardware info via a SCSI MMC INQUIRY command.
- False is returned if we had an error getting the information.
- */
- bool (*get_hwinfo) ( const CdIo *p_cdio,
- /* out*/ cdio_hwinfo_t *p_hw_info );
-
- /*!
- Return the media catalog number MCN from the CD or NULL if
- there is none or we don't have the ability to get it.
- */
- char * (*get_mcn) (const void *env);
-
- /*!
- Return the number of tracks in the current medium.
- CDIO_INVALID_TRACK is returned on error.
- */
- track_t (*get_num_tracks) (void *env);
-
- /*!
- Return the starting LBA for track number
- track_num in obj. Tracks numbers start at 1.
- The "leadout" track is specified either by
- using track_num LEADOUT_TRACK or the total tracks+1.
- CDIO_INVALID_LBA is returned on error.
- */
- lba_t (*get_track_lba) (void *env, track_t track_num);
-
- /*!
- Get format of track.
- */
- track_format_t (*get_track_format) (void *env, track_t track_num);
-
- /*!
- Return true if we have XA data (green, mode2 form1) or
- XA data (green, mode2 form2). That is track begins:
- sync - header - subheader
- 12 4 - 8
-
- FIXME: there's gotta be a better design for this and get_track_format?
- */
- bool (*get_track_green) (void *env, track_t track_num);
-
- /*!
- Return the starting MSF (minutes/secs/frames) for track number
- track_num in obj. Tracks numbers start at 1.
- The "leadout" track is specified either by
- using track_num LEADOUT_TRACK or the total tracks+1.
- False is returned on error.
- */
- bool (*get_track_msf) (void *env, track_t track_num, msf_t *msf);
-
- /*!
- lseek - reposition read/write file offset
- Returns (off_t) -1 on error.
- Similar to libc's lseek()
- */
- off_t (*lseek) (void *env, off_t offset, int whence);
-
- /*!
- Reads into buf the next size bytes.
- Returns -1 on error.
- Similar to libc's read()
- */
- ssize_t (*read) (void *env, void *buf, size_t size);
-
- /*!
- Reads a single mode2 sector from cd device into buf starting
- from lsn. Returns 0 if no error.
- */
- int (*read_audio_sectors) (void *env, void *buf, lsn_t lsn,
- unsigned int nblocks);
-
- /*!
- Reads a single mode2 sector from cd device into buf starting
- from lsn. Returns 0 if no error.
- */
- int (*read_mode2_sector) (void *env, void *buf, lsn_t lsn,
- bool mode2_form2);
-
- /*!
- Reads nblocks of mode2 sectors from cd device into data starting
- from lsn.
- Returns 0 if no error.
- */
- int (*read_mode2_sectors) (void *p_env, void *p_buf, lsn_t lsn,
- bool mode2_form2, unsigned int nblocks);
-
- /*!
- Reads a single mode1 sector from cd device into buf starting
- from lsn. Returns 0 if no error.
- */
- int (*read_mode1_sector) (void *p_env, void *p_buf, lsn_t lsn,
- bool mode1_form2);
-
- /*!
- Reads nblocks of mode1 sectors from cd device into data starting
- from lsn.
- Returns 0 if no error.
- */
- int (*read_mode1_sectors) (void *p_env, void *p_buf, lsn_t lsn,
- bool mode1_form2, unsigned int nblocks);
-
- bool (*read_toc) ( void *p_env ) ;
-
- /*!
- Run a SCSI MMC command.
-
- cdio CD structure set by cdio_open().
- i_timeout_ms time in milliseconds we will wait for the command
- to complete.
- cdb_len number of bytes in cdb (6, 10, or 12).
- cdb CDB bytes. All values that are needed should be set on
- input.
- b_return_data TRUE if the command expects data to be returned in
- the buffer
- len Size of buffer
- buf Buffer for data, both sending and receiving
-
- Returns 0 if command completed successfully.
- */
- scsi_mmc_run_cmd_fn_t run_scsi_mmc_cmd;
-
- /*!
- Set the arg "key" with "value" in the source device.
- */
- int (*set_arg) (void *env, const char key[], const char value[]);
-
- /*!
- Return the size of the CD in logical block address (LBA) units.
- */
- uint32_t (*stat_size) (void *env);
-
- } cdio_funcs;
-
-
- /*! Implementation of CdIo type */
- struct _CdIo {
- driver_id_t driver_id; /**< Particular driver opened. */
- cdio_funcs op; /**< driver-specific routines handling
- implementation*/
- void *env; /**< environment. Passed to routine above. */
- };
-
- /* This is used in drivers that must keep their own internal
- position pointer for doing seeks. Stream-based drivers (like bincue,
- nrg, toc, network) would use this.
- */
- typedef struct
- {
- off_t buff_offset; /* buffer offset in disk-image seeks. */
- track_t index; /* Current track index in tocent. */
- lba_t lba; /* Current LBA */
- } internal_position_t;
-
- CdIo * cdio_new (generic_img_private_t *p_env, cdio_funcs *funcs);
-
- /* The below structure describes a specific CD Input driver */
- typedef struct
- {
- driver_id_t id;
- unsigned int flags;
- const char *name;
- const char *describe;
- bool (*have_driver) (void);
- CdIo *(*driver_open) (const char *psz_source_name);
- CdIo *(*driver_open_am) (const char *psz_source_name,
- const char *psz_access_mode);
- char *(*get_default_device) (void);
- bool (*is_device) (const char *psz_source_name);
- char **(*get_devices) (void);
- } CdIo_driver_t;
-
- /* The below array gives of the drivers that are currently available for
- on a particular host. */
- extern CdIo_driver_t CdIo_driver[CDIO_MAX_DRIVER];
-
- /* The last valid entry of Cdio_driver. -1 means uninitialzed. -2
- means some sort of error.
- */
- extern int CdIo_last_driver;
-
- /* The below array gives all drivers that can possibly appear.
- on a particular host. */
- extern CdIo_driver_t CdIo_all_drivers[CDIO_MAX_DRIVER+1];
-
- /*!
- Add/allocate a drive to the end of drives.
- Use cdio_free_device_list() to free this device_list.
- */
- void cdio_add_device_list(char **device_list[], const char *drive,
- unsigned int *i_drives);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __CDIO_PRIVATE_H__ */
diff --git a/src/input/vcd/libcdio/cdtext.c b/src/input/vcd/libcdio/cdtext.c
deleted file mode 100644
index 5842641f7..000000000
--- a/src/input/vcd/libcdio/cdtext.c
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- $Id: cdtext.c,v 1.1 2005/01/01 02:43:57 rockyb Exp $
-
- Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
- toc reading routine adapted from cuetools
- Copyright (C) 2003 Svend Sanjay Sorensen <ssorensen@fastmail.fm>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <cdio/cdtext.h>
-#include <cdio/logging.h>
-#include "cdtext_private.h"
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-/*! Note: the order and number items (except CDTEXT_INVALID) should
- match the cdtext_field_t enumeration. */
-const char *cdtext_keywords[] =
- {
- "ARRANGER",
- "COMPOSER",
- "DISC_ID",
- "GENRE",
- "ISRC",
- "MESSAGE",
- "PERFORMER",
- "SIZE_INFO",
- "SONGWRITER",
- "TITLE",
- "TOC_INFO",
- "TOC_INFO2",
- "UPC_EAN",
- };
-
-
-/*! Return string representation of the enum values above */
-const char *
-cdtext_field2str (cdtext_field_t i)
-{
- if (i >= MAX_CDTEXT_FIELDS)
- return "Invalid CDTEXT field index";
- else
- return cdtext_keywords[i];
-}
-
-
-/*! Free memory assocated with cdtext*/
-void
-cdtext_destroy (cdtext_t *cdtext)
-{
- cdtext_field_t i;
-
- for (i=0; i < MAX_CDTEXT_FIELDS; i++) {
- if (cdtext->field[i]) free(cdtext->field[i]);
- }
-}
-
-/*!
- returns the CDTEXT value associated with key. NULL is returned
- if key is CDTEXT_INVALID or the field is not set.
- */
-const char *
-cdtext_get (cdtext_field_t key, const cdtext_t *cdtext)
-{
- if (key == CDTEXT_INVALID) return NULL;
- return cdtext->field[key];
-}
-
-/*! Initialize a new cdtext structure.
- When the structure is no longer needed, release the
- resources using cdtext_delete.
-*/
-void
-cdtext_init (cdtext_t *cdtext)
-{
- cdtext_field_t i;
-
- for (i=0; i < MAX_CDTEXT_FIELDS; i++) {
- cdtext->field[i] = NULL;
- }
-}
-
-/*!
- returns 0 if field is a CD-TEXT keyword, returns non-zero otherwise
-*/
-cdtext_field_t
-cdtext_is_keyword (const char *key)
-{
-#if 0
- char *item;
-
- item = bsearch(key,
- cdtext_keywords, 12,
- sizeof (char *),
- (int (*)(const void *, const void *))
- strcmp);
- return (NULL != item) ? 0 : 1;
-#else
- unsigned int i;
-
- for (i = 0; i < 13 ; i++)
- if (0 == strcmp (cdtext_keywords[i], key)) {
- return i;
- }
- return CDTEXT_INVALID;
-#endif
-}
-
-/*! sets cdtext's keyword entry to field.
- */
-void
-cdtext_set (cdtext_field_t key, const char *value, cdtext_t *cdtext)
-{
- if (NULL == value || key == CDTEXT_INVALID) return;
-
- if (cdtext->field[key]) free (cdtext->field[key]);
- cdtext->field[key] = strdup (value);
-
-}
-
-#define SET_CDTEXT_FIELD(FIELD) \
- (*set_cdtext_field_fn)(user_data, i_track, i_first_track, FIELD, buffer);
-
-/*
- parse all CD-TEXT data retrieved.
-*/
-bool
-cdtext_data_init(void *user_data, track_t i_first_track,
- unsigned char *wdata,
- set_cdtext_field_fn_t set_cdtext_field_fn)
-{
- CDText_data_t *pdata;
- int i;
- int j;
- char buffer[256];
- int idx;
- int i_track;
- bool b_ret = false;
-
- memset( buffer, 0x00, sizeof(buffer) );
- idx = 0;
-
- pdata = (CDText_data_t *) (&wdata[4]);
- for( i=0; i < CDIO_CDTEXT_MAX_PACK_DATA; i++ ) {
-
-#if TESTED
- if ( pdata->bDBC ) {
- cdio_warn("Double-byte characters not supported");
- return false;
- }
-#endif
-
- if( pdata->seq != i )
- break;
-
- if( (pdata->type >= 0x80)
- && (pdata->type <= 0x85) && (pdata->block == 0) ) {
- i_track = pdata->i_track;
-
- for( j=0; j < CDIO_CDTEXT_MAX_TEXT_DATA; j++ ) {
- if( pdata->text[j] == 0x00 ) {
- bool b_field_set=true;
- switch( pdata->type) {
- case CDIO_CDTEXT_TITLE:
- SET_CDTEXT_FIELD(CDTEXT_TITLE);
- break;
- case CDIO_CDTEXT_PERFORMER:
- SET_CDTEXT_FIELD(CDTEXT_PERFORMER);
- break;
- case CDIO_CDTEXT_SONGWRITER:
- SET_CDTEXT_FIELD(CDTEXT_SONGWRITER);
- break;
- case CDIO_CDTEXT_COMPOSER:
- SET_CDTEXT_FIELD(CDTEXT_COMPOSER);
- break;
- case CDIO_CDTEXT_ARRANGER:
- SET_CDTEXT_FIELD(CDTEXT_ARRANGER);
- break;
- case CDIO_CDTEXT_MESSAGE:
- SET_CDTEXT_FIELD(CDTEXT_MESSAGE);
- break;
- case CDIO_CDTEXT_DISCID:
- SET_CDTEXT_FIELD(CDTEXT_DISCID);
- break;
- case CDIO_CDTEXT_GENRE:
- SET_CDTEXT_FIELD(CDTEXT_GENRE);
- break;
- default : b_field_set = false;
- }
- if (b_field_set) {
- b_ret = true;
- i_track++;
- idx = 0;
- }
- } else {
- buffer[idx++] = pdata->text[j];
- }
- buffer[idx] = 0x00;
- }
- }
- pdata++;
- }
- return b_ret;
-}
-
diff --git a/src/input/vcd/libcdio/cdtext_private.h b/src/input/vcd/libcdio/cdtext_private.h
deleted file mode 100644
index 03a9c4945..000000000
--- a/src/input/vcd/libcdio/cdtext_private.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- $Id: cdtext_private.h,v 1.1 2005/01/01 02:43:57 rockyb Exp $
-
- Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifndef __CDIO_CDTEXT_PRIVATE_H__
-#define __CDIO_CDTEXT_PRIVATE_H__
-
-#include <cdio/cdio.h>
-#include <cdio/cdtext.h>
-
-#define CDIO_CDTEXT_MAX_PACK_DATA 255
-#define CDIO_CDTEXT_MAX_TEXT_DATA 12
-
-/* From table J.2 - Pack Type Indicator Definitions from
- Working Draft NCITS XXX T10/1364-D Revision 10G. November 12, 2001.
-*/
-/* Title of Alubm name (ID=0) or Track Titles (ID != 0) */
-#define CDIO_CDTEXT_TITLE 0x80
-
-/* Name(s) of the performer(s) in ASCII */
-#define CDIO_CDTEXT_PERFORMER 0x81
-
-/* Name(s) of the songwriter(s) in ASCII */
-#define CDIO_CDTEXT_SONGWRITER 0x82
-
-/* Name(s) of the Composers in ASCII */
-#define CDIO_CDTEXT_COMPOSER 0x83
-
-/* Name(s) of the Arrangers in ASCII */
-#define CDIO_CDTEXT_ARRANGER 0x84
-
-/* Message(s) from content provider and/or artist in ASCII */
-#define CDIO_CDTEXT_MESSAGE 0x85
-
-/* Disc Identificatin information */
-#define CDIO_CDTEXT_DISCID 0x86
-
-/* Genre Identification and Genre Information */
-#define CDIO_CDTEXT_GENRE 0x87
-
-/* Table of Content Information */
-#define CDIO_CDTEXT_TOC 0x88
-
-/* Second Table of Content Information */
-#define CDIO_CDTEXT_TOC2 0x89
-
-/* 0x8A, 0x8B, 0x8C are reserved
- 0x8D Reserved for content provider only.
- */
-
-/* UPC/EAN code of the album and ISRC code of each track */
-#define CDIO_CDTEXT_UPC 0x8E
-
-/* Size information of the Block */
-#define CDIO_CDTEXT_BLOCKSIZE 0x8F
-
-
-PRAGMA_BEGIN_PACKED
-
-struct CDText_data
-{
- uint8_t type;
- track_t i_track;
- uint8_t seq;
-#ifdef WORDS_BIGENDIAN
- uint8_t bDBC: 1; /* double byte character */
- uint8_t block: 3; /* block number 0..7 */
- uint8_t characterPosition:4; /* character position */
-#else
- uint8_t characterPosition:4; /* character position */
- uint8_t block :3; /* block number 0..7 */
- uint8_t bDBC :1; /* double byte character */
-#endif
- char text[CDIO_CDTEXT_MAX_TEXT_DATA];
- uint8_t crc[2];
-} GNUC_PACKED;
-
-PRAGMA_END_PACKED
-
-typedef struct CDText_data CDText_data_t;
-
-typedef void (*set_cdtext_field_fn_t) (void *user_data, track_t i_track,
- track_t i_first_track,
- cdtext_field_t field,
- const char *buffer);
-
-/*
- Internal routine to parse all CD-TEXT data retrieved.
-*/
-bool cdtext_data_init(void *user_data, track_t i_first_track,
- unsigned char *wdata,
- set_cdtext_field_fn_t set_cdtext_field_fn);
-
-
-#endif /* __CDIO_CDTEXT_PRIVATE_H__ */
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libcdio/ds.c b/src/input/vcd/libcdio/ds.c
deleted file mode 100644
index 381c0f00c..000000000
--- a/src/input/vcd/libcdio/ds.c
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- $Id: ds.c,v 1.3 2005/01/01 02:43:57 rockyb Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-
-#include <cdio/ds.h>
-#include <cdio/util.h>
-#include <cdio/types.h>
-#include "cdio_assert.h"
-
-static const char _rcsid[] = "$Id: ds.c,v 1.3 2005/01/01 02:43:57 rockyb Exp $";
-
-struct _CdioList
-{
- unsigned length;
-
- CdioListNode *begin;
- CdioListNode *end;
-};
-
-struct _CdioListNode
-{
- CdioList *list;
-
- CdioListNode *next;
-
- void *data;
-};
-
-/* impl */
-
-CdioList *
-_cdio_list_new (void)
-{
- CdioList *new_obj = _cdio_malloc (sizeof (CdioList));
-
- return new_obj;
-}
-
-void
-_cdio_list_free (CdioList *list, int free_data)
-{
- while (_cdio_list_length (list))
- _cdio_list_node_free (_cdio_list_begin (list), free_data);
-
- free (list);
-}
-
-unsigned
-_cdio_list_length (const CdioList *list)
-{
- cdio_assert (list != NULL);
-
- return list->length;
-}
-
-void
-_cdio_list_prepend (CdioList *list, void *data)
-{
- CdioListNode *new_node;
-
- cdio_assert (list != NULL);
-
- new_node = _cdio_malloc (sizeof (CdioListNode));
-
- new_node->list = list;
- new_node->next = list->begin;
- new_node->data = data;
-
- list->begin = new_node;
- if (list->length == 0)
- list->end = new_node;
-
- list->length++;
-}
-
-void
-_cdio_list_append (CdioList *list, void *data)
-{
- cdio_assert (list != NULL);
-
- if (list->length == 0)
- {
- _cdio_list_prepend (list, data);
- }
- else
- {
- CdioListNode *new_node = _cdio_malloc (sizeof (CdioListNode));
-
- new_node->list = list;
- new_node->next = NULL;
- new_node->data = data;
-
- list->end->next = new_node;
- list->end = new_node;
-
- list->length++;
- }
-}
-
-void
-_cdio_list_foreach (CdioList *list, _cdio_list_iterfunc func, void *user_data)
-{
- CdioListNode *node;
-
- cdio_assert (list != NULL);
- cdio_assert (func != 0);
-
- for (node = _cdio_list_begin (list);
- node != NULL;
- node = _cdio_list_node_next (node))
- func (_cdio_list_node_data (node), user_data);
-}
-
-CdioListNode *
-_cdio_list_find (CdioList *list, _cdio_list_iterfunc cmp_func, void *user_data)
-{
- CdioListNode *node;
-
- cdio_assert (list != NULL);
- cdio_assert (cmp_func != 0);
-
- for (node = _cdio_list_begin (list);
- node != NULL;
- node = _cdio_list_node_next (node))
- if (cmp_func (_cdio_list_node_data (node), user_data))
- break;
-
- return node;
-}
-
-CdioListNode *
-_cdio_list_begin (const CdioList *list)
-{
- cdio_assert (list != NULL);
-
- return list->begin;
-}
-
-CdioListNode *
-_cdio_list_end (CdioList *list)
-{
- cdio_assert (list != NULL);
-
- return list->end;
-}
-
-CdioListNode *
-_cdio_list_node_next (CdioListNode *node)
-{
- if (node)
- return node->next;
-
- return NULL;
-}
-
-void
-_cdio_list_node_free (CdioListNode *node, int free_data)
-{
- CdioList *list;
- CdioListNode *prev_node;
-
- cdio_assert (node != NULL);
-
- list = node->list;
-
- cdio_assert (_cdio_list_length (list) > 0);
-
- if (free_data)
- free (_cdio_list_node_data (node));
-
- if (_cdio_list_length (list) == 1)
- {
- cdio_assert (list->begin == list->end);
-
- list->end = list->begin = NULL;
- list->length = 0;
- free (node);
- return;
- }
-
- cdio_assert (list->begin != list->end);
-
- if (list->begin == node)
- {
- list->begin = node->next;
- free (node);
- list->length--;
- return;
- }
-
- for (prev_node = list->begin; prev_node->next; prev_node = prev_node->next)
- if (prev_node->next == node)
- break;
-
- cdio_assert (prev_node->next != NULL);
-
- if (list->end == node)
- list->end = prev_node;
-
- prev_node->next = node->next;
-
- list->length--;
-
- free (node);
-}
-
-void *
-_cdio_list_node_data (CdioListNode *node)
-{
- if (node)
- return node->data;
-
- return NULL;
-}
-
-/* eof */
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
-
diff --git a/src/input/vcd/libcdio/generic.h b/src/input/vcd/libcdio/generic.h
deleted file mode 100644
index 9deb77254..000000000
--- a/src/input/vcd/libcdio/generic.h
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- $Id: generic.h,v 1.1 2005/01/01 02:43:57 rockyb Exp $
-
- Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* Internal routines for CD I/O drivers. */
-
-
-#ifndef __CDIO_GENERIC_H__
-#define __CDIO_GENERIC_H__
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <cdio/cdio.h>
-#include <cdio/cdtext.h>
-#include <cdio/iso9660.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
- /*!
- Things common to private device structures. Even though not all
- devices may have some of these fields, by listing common ones
- we facilitate writing generic routines and even cut-and-paste
- code.
- */
- typedef struct {
- char *source_name; /**< Name used in open. */
- bool init; /**< True if structure has been initialized */
- bool toc_init; /**< True if TOC read in */
- bool b_cdtext_init; /**< True if CD-Text read in */
- bool b_cdtext_error; /**< True if trouble reading CD-Text */
-
- int ioctls_debugged; /**< for debugging */
-
- /* Only one of data_source or fd is used; fd is for CD-ROM
- devices and the data_source for stream reading (bincue, nrg, toc,
- network).
- */
- CdioDataSource *data_source;
- int fd; /**< File descriptor of device */
- track_t i_first_track; /**< The starting track number. */
- track_t i_tracks; /**< The number of tracks. */
-
- uint8_t i_joliet_level; /**< 0 = no Joliet extensions.
- 1-3: Joliet level. */
- iso9660_pvd_t pvd;
- iso9660_svd_t svd;
- CdIo *cdio; /**< a way to call general cdio routines. */
- cdtext_t cdtext; /**< CD-Text for disc. */
- cdtext_t cdtext_track[CDIO_CD_MAX_TRACKS+1]; /*CD-TEXT for each track*/
-
- } generic_img_private_t;
-
- /*!
- Bogus eject media when there is no ejectable media, e.g. a disk image
- We always return 2. Should we also free resources?
- */
- int cdio_generic_bogus_eject_media (void *env);
-
- /*!
- Release and free resources associated with cd.
- */
- void cdio_generic_free (void *env);
-
- /*!
- Initialize CD device.
- */
- bool cdio_generic_init (void *env);
-
- /*!
- Reads into buf the next size bytes.
- Returns -1 on error.
- Is in fact libc's read().
- */
- off_t cdio_generic_lseek (void *env, off_t offset, int whence);
-
- /*!
- Reads into buf the next size bytes.
- Returns -1 on error.
- Is in fact libc's read().
- */
- ssize_t cdio_generic_read (void *env, void *buf, size_t size);
-
- /*!
- Reads a single form1 sector from cd device into data starting
- from lsn. Returns 0 if no error.
- */
- int cdio_generic_read_form1_sector (void * user_data, void *data,
- lsn_t lsn);
-
- /*!
- Release and free resources associated with stream or disk image.
- */
- void cdio_generic_stdio_free (void *env);
-
- /*!
- Return true if source_name could be a device containing a CD-ROM on
- Win32
- */
- bool cdio_is_device_win32(const char *source_name);
-
-
- /*!
- Return true if source_name could be a device containing a CD-ROM on
- most Unix servers with block and character devices.
- */
- bool cdio_is_device_generic(const char *source_name);
-
-
- /*!
- Like above, but don't give a warning device doesn't exist.
- */
- bool cdio_is_device_quiet_generic(const char *source_name);
-
- /*!
- Get cdtext information for a CdIo object .
-
- @param obj the CD object that may contain CD-TEXT information.
- @return the CD-TEXT object or NULL if obj is NULL
- or CD-TEXT information does not exist.
- */
- const cdtext_t *get_cdtext_generic (void *p_user_data, track_t i_track);
-
- /*!
- Return the number of of the first track.
- CDIO_INVALID_TRACK is returned on error.
- */
- track_t get_first_track_num_generic(void *p_user_data);
-
- /*!
- Return the number of tracks in the current medium.
- */
- track_t get_num_tracks_generic(void *p_user_data);
-
- /*!
- Get disc type associated with cd object.
- */
- discmode_t get_discmode_generic (void *p_user_data );
-
- /*!
- Same as above but only handles CD cases
- */
- discmode_t get_discmode_cd_generic (void *p_user_data );
-
- void set_cdtext_field_generic(void *user_data, track_t i_track,
- track_t i_first_track,
- cdtext_field_t e_field, const char *psz_value);
- /*!
- Read cdtext information for a CdIo object .
-
- return true on success, false on error or CD-Text information does
- not exist.
- */
- bool init_cdtext_generic (generic_img_private_t *p_env);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __CDIO_GENERIC_H__ */
diff --git a/src/input/vcd/libcdio/image.h b/src/input/vcd/libcdio/image.h
deleted file mode 100644
index 79c836d32..000000000
--- a/src/input/vcd/libcdio/image.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- $Id: image.h,v 1.1 2005/01/01 02:43:57 rockyb Exp $
-
- Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/*!
- Header for image drivers. In contrast to image_common.h which contains
- routines, this header like most C headers does not depend on anything
- defined before it is included.
-*/
-
-#ifndef __CDIO_IMAGE_H__
-#define __CDIO_IMAGE_H__
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <cdio/types.h>
-#include <cdio/cdtext.h>
-#include "cdio_private.h"
-#include <cdio/sector.h>
-
-/*!
- The universal format for information about a track for CD image readers
- It may be that some fields can be derived from other fields.
- Over time this structure may get cleaned up. Possibly this can be
- expanded/reused for real CD formats.
-*/
-
-typedef struct {
- track_t track_num; /**< Probably is index+1 */
- msf_t start_msf;
- lba_t start_lba;
- int start_index;
- lba_t length;
- lba_t pregap; /**< pre-gap with zero audio data */
- int sec_count; /**< Number of sectors in this track. Does not
- include pregap */
- int num_indices;
- flag_t flags; /**< "[NO] COPY", "4CH", "[NO] PREMPAHSIS" */
- char *isrc; /**< IRSC Code (5.22.4) exactly 12 bytes */
- char *filename;
- CdioDataSource *data_source;
- track_format_t track_format;
- bool track_green;
- cdtext_t cdtext; /**< CD-TEXT */
-
- trackmode_t mode;
- uint16_t datasize; /**< How much is in the portion we return
- back? */
- uint16_t datastart; /**< Offset from begining that data starts */
- uint16_t endsize; /**< How much stuff at the end to skip over.
- This stuff may have error correction
- (EDC, or ECC).*/
- uint16_t blocksize; /**< total block size = start + size + end */
-} track_info_t;
-
-
-#endif /* __CDIO_IMAGE_H__ */
diff --git a/src/input/vcd/libcdio/image/Makefile.am b/src/input/vcd/libcdio/image/Makefile.am
deleted file mode 100644
index e7a09e980..000000000
--- a/src/input/vcd/libcdio/image/Makefile.am
+++ /dev/null
@@ -1,3 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-EXTRA_DIST = bincue.c nrg.c
diff --git a/src/input/vcd/libcdio/image/bincue.c b/src/input/vcd/libcdio/image/bincue.c
deleted file mode 100644
index 56f0e151c..000000000
--- a/src/input/vcd/libcdio/image/bincue.c
+++ /dev/null
@@ -1,1214 +0,0 @@
-/*
- $Id: bincue.c,v 1.2 2005/01/01 02:43:58 rockyb Exp $
-
- Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com>
- Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
- cue parsing routine adapted from cuetools
- Copyright (C) 2003 Svend Sanjay Sorensen <ssorensen@fastmail.fm>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* This code implements low-level access functions for a CD images
- residing inside a disk file (*.bin) and its associated cue sheet.
- (*.cue).
-*/
-
-static const char _rcsid[] = "$Id: bincue.c,v 1.2 2005/01/01 02:43:58 rockyb Exp $";
-
-#include "image.h"
-#include "cdio_assert.h"
-#include "cdio_private.h"
-#include "_cdio_stdio.h"
-
-#include <cdio/logging.h>
-#include <cdio/util.h>
-#include <cdio/version.h>
-
-#ifdef HAVE_STDIO_H
-#include <stdio.h>
-#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-#ifdef HAVE_GLOB_H
-#include <glob.h>
-#endif
-#include <ctype.h>
-
-#include "portable.h"
-/* reader */
-
-#define DEFAULT_CDIO_DEVICE "videocd.bin"
-#define DEFAULT_CDIO_CUE "videocd.cue"
-
-typedef struct {
- /* Things common to all drivers like this.
- This must be first. */
- generic_img_private_t gen;
- internal_position_t pos;
-
- char *psz_cue_name;
- char *psz_mcn; /* Media Catalog Number (5.22.3)
- exactly 13 bytes */
- track_info_t tocent[CDIO_CD_MAX_TRACKS+1]; /* entry info for each track
- add 1 for leadout. */
- discmode_t disc_mode;
-} _img_private_t;
-
-static uint32_t _stat_size_bincue (void *user_data);
-static bool parse_cuefile (_img_private_t *cd, const char *toc_name);
-
-#define NEED_MEDIA_EJECT_IMAGE
-#include "image_common.h"
-
-/*!
- Initialize image structures.
- */
-static bool
-_init_bincue (_img_private_t *env)
-{
- lsn_t lead_lsn;
-
- if (env->gen.init)
- return false;
-
- if (!(env->gen.data_source = cdio_stdio_new (env->gen.source_name))) {
- cdio_warn ("init failed");
- return false;
- }
-
- /* Have to set init before calling _stat_size_bincue() or we will
- get into infinite recursion calling passing right here.
- */
- env->gen.init = true;
- env->gen.i_first_track = 1;
- env->psz_mcn = NULL;
- env->disc_mode = CDIO_DISC_MODE_NO_INFO;
-
- cdtext_init (&(env->gen.cdtext));
-
- lead_lsn = _stat_size_bincue( (_img_private_t *) env);
-
- if (-1 == lead_lsn) return false;
-
- if ((env->psz_cue_name == NULL)) return false;
-
- /* Read in CUE sheet. */
- if ( !parse_cuefile(env, env->psz_cue_name) ) return false;
-
- /* Fake out leadout track and sector count for last track*/
- cdio_lsn_to_msf (lead_lsn, &env->tocent[env->gen.i_tracks].start_msf);
- env->tocent[env->gen.i_tracks].start_lba = cdio_lsn_to_lba(lead_lsn);
- env->tocent[env->gen.i_tracks - env->gen.i_first_track].sec_count =
- cdio_lsn_to_lba(lead_lsn -
- env->tocent[env->gen.i_tracks - env->gen.i_first_track].start_lba);
-
- return true;
-}
-
-/*!
- Reads into buf the next size bytes.
- Returns -1 on error.
- Would be libc's seek() but we have to adjust for the extra track header
- information in each sector.
-*/
-static off_t
-_lseek_bincue (void *user_data, off_t offset, int whence)
-{
- _img_private_t *env = user_data;
-
- /* real_offset is the real byte offset inside the disk image
- The number below was determined empirically. I'm guessing
- the 1st 24 bytes of a bin file are used for something.
- */
- off_t real_offset=0;
-
- unsigned int i;
-
- env->pos.lba = 0;
- for (i=0; i<env->gen.i_tracks; i++) {
- track_info_t *this_track=&(env->tocent[i]);
- env->pos.index = i;
- if ( (this_track->sec_count*this_track->datasize) >= offset) {
- int blocks = offset / this_track->datasize;
- int rem = offset % this_track->datasize;
- int block_offset = blocks * this_track->blocksize;
- real_offset += block_offset + rem;
- env->pos.buff_offset = rem;
- env->pos.lba += blocks;
- break;
- }
- real_offset += this_track->sec_count*this_track->blocksize;
- offset -= this_track->sec_count*this_track->datasize;
- env->pos.lba += this_track->sec_count;
- }
-
- if (i==env->gen.i_tracks) {
- cdio_warn ("seeking outside range of disk image");
- return -1;
- } else {
- real_offset += env->tocent[i].datastart;
- return cdio_stream_seek(env->gen.data_source, real_offset, whence);
- }
-}
-
-/*!
- Reads into buf the next size bytes.
- Returns -1 on error.
- FIXME:
- At present we assume a read doesn't cross sector or track
- boundaries.
-*/
-static ssize_t
-_read_bincue (void *user_data, void *data, size_t size)
-{
- _img_private_t *env = user_data;
- char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, };
- char *p = data;
- ssize_t final_size=0;
- ssize_t this_size;
- track_info_t *this_track=&(env->tocent[env->pos.index]);
- ssize_t skip_size = this_track->datastart + this_track->endsize;
-
- while (size > 0) {
- long int rem = this_track->datasize - env->pos.buff_offset;
- if ((long int) size <= rem) {
- this_size = cdio_stream_read(env->gen.data_source, buf, size, 1);
- final_size += this_size;
- memcpy (p, buf, this_size);
- break;
- }
-
- /* Finish off reading this sector. */
- cdio_warn ("Reading across block boundaries not finished");
-
- size -= rem;
- this_size = cdio_stream_read(env->gen.data_source, buf, rem, 1);
- final_size += this_size;
- memcpy (p, buf, this_size);
- p += this_size;
- this_size = cdio_stream_read(env->gen.data_source, buf, rem, 1);
-
- /* Skip over stuff at end of this sector and the beginning of the next.
- */
- cdio_stream_read(env->gen.data_source, buf, skip_size, 1);
-
- /* Get ready to read another sector. */
- env->pos.buff_offset=0;
- env->pos.lba++;
-
- /* Have gone into next track. */
- if (env->pos.lba >= env->tocent[env->pos.index+1].start_lba) {
- env->pos.index++;
- this_track=&(env->tocent[env->pos.index]);
- skip_size = this_track->datastart + this_track->endsize;
- }
- }
- return final_size;
-}
-
-/*!
- Return the size of the CD in logical block address (LBA) units.
- */
-static uint32_t
-_stat_size_bincue (void *user_data)
-{
- _img_private_t *env = user_data;
- long size;
-
- size = cdio_stream_stat (env->gen.data_source);
-
- if (size % CDIO_CD_FRAMESIZE_RAW)
- {
- cdio_warn ("image %s size (%ld) not multiple of blocksize (%d)",
- env->gen.source_name, size, CDIO_CD_FRAMESIZE_RAW);
- if (size % M2RAW_SECTOR_SIZE == 0)
- cdio_warn ("this may be a 2336-type disc image");
- else if (size % CDIO_CD_FRAMESIZE_RAW == 0)
- cdio_warn ("this may be a 2352-type disc image");
- /* exit (EXIT_FAILURE); */
- }
-
- size /= CDIO_CD_FRAMESIZE_RAW;
-
- return size;
-}
-
-#define MAXLINE 4096 /* maximum line length + 1 */
-
-static bool
-parse_cuefile (_img_private_t *cd, const char *psz_cue_name)
-{
- /* The below declarations may be common in other image-parse routines. */
- FILE *fp;
- char psz_line[MAXLINE]; /* text of current line read in file fp. */
- unsigned int i_line=0; /* line number in file of psz_line. */
- int i = -1; /* Position in tocent. Same as
- cd->gen.i_tracks - 1 */
- char *psz_keyword, *psz_field;
- cdio_log_level_t log_level = (NULL == cd) ? CDIO_LOG_INFO : CDIO_LOG_WARN;
- cdtext_field_t cdtext_key;
-
- /* The below declarations may be unique to this image-parse routine. */
- int start_index;
- bool b_first_index_for_track=false;
-
- if (NULL == psz_cue_name)
- return false;
-
- fp = fopen (psz_cue_name, "r");
- if (fp == NULL) {
- cdio_log(log_level, "error opening %s for reading: %s",
- psz_cue_name, strerror(errno));
- return false;
- }
-
- if (cd) {
- cd->gen.i_tracks=0;
- cd->gen.i_first_track=1;
- cd->gen.b_cdtext_init = true;
- cd->gen.b_cdtext_error = false;
- cd->psz_mcn=NULL;
- }
-
- while ((fgets(psz_line, MAXLINE, fp)) != NULL) {
-
- i_line++;
-
- if (NULL != (psz_keyword = strtok (psz_line, " \t\n\r"))) {
- /* REM remarks ... */
- if (0 == strcmp ("REM", psz_keyword)) {
- ;
-
- /* global section */
- /* CATALOG ddddddddddddd */
- } else if (0 == strcmp ("CATALOG", psz_keyword)) {
- if (-1 == i) {
- if (NULL == (psz_field = strtok (NULL, " \t\n\r"))) {
- cdio_log(log_level,
- "%s line %d after word CATALOG: ",
- psz_cue_name, i_line);
- cdio_log(log_level,
- "expecting 13-digit media catalog number, got nothing.");
- goto err_exit;
- }
- if (strlen(psz_field) != 13) {
- cdio_log(log_level,
- "%s line %d after word CATALOG: ",
- psz_cue_name, i_line);
- cdio_log(log_level,
- "Token %s has length %ld. Should be 13 digits.",
- psz_field, (long int) strlen(psz_field));
- goto err_exit;
- } else {
- /* Check that we have all digits*/
- unsigned int i;
- for (i=0; i<13; i++) {
- if (!isdigit(psz_field[i])) {
- cdio_log(log_level,
- "%s line %d after word CATALOG:",
- psz_cue_name, i_line);
- cdio_log(log_level,
- "Character \"%c\" at postition %i of token \"%s\" "
- "is not all digits.",
- psz_field[i], i+1, psz_field);
- goto err_exit;
- }
- }
- }
-
- if (cd) cd->psz_mcn = strdup (psz_field);
- if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) {
- goto format_error;
- }
- } else {
- goto not_in_global_section;
- }
-
- /* FILE "<filename>" <BINARY|WAVE|other?> */
- } else if (0 == strcmp ("FILE", psz_keyword)) {
- if (NULL != (psz_field = strtok (NULL, "\"\t\n\r"))) {
- if (cd) cd->tocent[i + 1].filename = strdup (psz_field);
- } else {
- goto format_error;
- }
-
- /* TRACK N <mode> */
- } else if (0 == strcmp ("TRACK", psz_keyword)) {
- int i_track;
-
- if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) {
- if (1!=sscanf(psz_field, "%d", &i_track)) {
- cdio_log(log_level,
- "%s line %d after word TRACK:",
- psz_cue_name, i_line);
- cdio_log(log_level,
- "Expecting a track number, got %s", psz_field);
- goto err_exit;
- }
- }
- if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) {
- track_info_t *this_track=NULL;
-
- if (cd) {
- this_track = &(cd->tocent[cd->gen.i_tracks]);
- this_track->track_num = cd->gen.i_tracks;
- this_track->num_indices = 0;
- b_first_index_for_track = false;
- cdtext_init (&(cd->gen.cdtext_track[cd->gen.i_tracks]));
- cd->gen.i_tracks++;
- }
- i++;
-
- if (0 == strcmp ("AUDIO", psz_field)) {
- if (cd) {
- this_track->mode = AUDIO;
- this_track->blocksize = CDIO_CD_FRAMESIZE_RAW;
- this_track->datasize = CDIO_CD_FRAMESIZE_RAW;
- this_track->datastart = 0;
- this_track->endsize = 0;
- this_track->track_format = TRACK_FORMAT_AUDIO;
- this_track->track_green = false;
- switch(cd->disc_mode) {
- case CDIO_DISC_MODE_NO_INFO:
- cd->disc_mode = CDIO_DISC_MODE_CD_DA;
- break;
- case CDIO_DISC_MODE_CD_DA:
- case CDIO_DISC_MODE_CD_MIXED:
- case CDIO_DISC_MODE_ERROR:
- /* Disc type stays the same. */
- break;
- case CDIO_DISC_MODE_CD_DATA:
- case CDIO_DISC_MODE_CD_XA:
- cd->disc_mode = CDIO_DISC_MODE_CD_MIXED;
- break;
- default:
- cd->disc_mode = CDIO_DISC_MODE_ERROR;
- }
- }
- } else if (0 == strcmp ("MODE1/2048", psz_field)) {
- if (cd) {
- this_track->mode = MODE1;
- this_track->blocksize = 2048;
- this_track->track_format= TRACK_FORMAT_DATA;
- this_track->track_green = false;
- /* Is the below correct? */
- this_track->datastart = 0;
- this_track->datasize = CDIO_CD_FRAMESIZE;
- this_track->endsize = 0;
- switch(cd->disc_mode) {
- case CDIO_DISC_MODE_NO_INFO:
- cd->disc_mode = CDIO_DISC_MODE_CD_DATA;
- break;
- case CDIO_DISC_MODE_CD_DATA:
- case CDIO_DISC_MODE_CD_MIXED:
- case CDIO_DISC_MODE_ERROR:
- /* Disc type stays the same. */
- break;
- case CDIO_DISC_MODE_CD_DA:
- case CDIO_DISC_MODE_CD_XA:
- cd->disc_mode = CDIO_DISC_MODE_CD_MIXED;
- break;
- default:
- cd->disc_mode = CDIO_DISC_MODE_ERROR;
- }
- }
- } else if (0 == strcmp ("MODE1/2352", psz_field)) {
- if (cd) {
- this_track->blocksize = 2352;
- this_track->track_format= TRACK_FORMAT_DATA;
- this_track->track_green = false;
- this_track->datastart = CDIO_CD_SYNC_SIZE
- + CDIO_CD_HEADER_SIZE;
- this_track->datasize = CDIO_CD_FRAMESIZE;
- this_track->endsize = CDIO_CD_EDC_SIZE
- + CDIO_CD_M1F1_ZERO_SIZE + CDIO_CD_ECC_SIZE;
- this_track->mode = MODE1_RAW;
- switch(cd->disc_mode) {
- case CDIO_DISC_MODE_NO_INFO:
- cd->disc_mode = CDIO_DISC_MODE_CD_DATA;
- break;
- case CDIO_DISC_MODE_CD_DATA:
- case CDIO_DISC_MODE_CD_MIXED:
- case CDIO_DISC_MODE_ERROR:
- /* Disc type stays the same. */
- break;
- case CDIO_DISC_MODE_CD_DA:
- case CDIO_DISC_MODE_CD_XA:
- cd->disc_mode = CDIO_DISC_MODE_CD_MIXED;
- break;
- default:
- cd->disc_mode = CDIO_DISC_MODE_ERROR;
- }
- }
- } else if (0 == strcmp ("MODE2/2336", psz_field)) {
- if (cd) {
- this_track->blocksize = 2336;
- this_track->track_format= TRACK_FORMAT_XA;
- this_track->track_green = true;
- this_track->mode = MODE2;
- this_track->datastart = CDIO_CD_SYNC_SIZE
- + CDIO_CD_HEADER_SIZE;
- this_track->datasize = M2RAW_SECTOR_SIZE;
- this_track->endsize = 0;
- switch(cd->disc_mode) {
- case CDIO_DISC_MODE_NO_INFO:
- cd->disc_mode = CDIO_DISC_MODE_CD_DATA;
- break;
- case CDIO_DISC_MODE_CD_DATA:
- case CDIO_DISC_MODE_CD_MIXED:
- case CDIO_DISC_MODE_ERROR:
- /* Disc type stays the same. */
- break;
- case CDIO_DISC_MODE_CD_DA:
- case CDIO_DISC_MODE_CD_XA:
- cd->disc_mode = CDIO_DISC_MODE_CD_MIXED;
- break;
- default:
- cd->disc_mode = CDIO_DISC_MODE_ERROR;
- }
- }
- } else if (0 == strcmp ("MODE2/2048", psz_field)) {
- if (cd) {
- this_track->blocksize = 2048;
- this_track->track_format= TRACK_FORMAT_XA;
- this_track->track_green = true;
- this_track->mode = MODE2_FORM1;
- switch(cd->disc_mode) {
- case CDIO_DISC_MODE_NO_INFO:
- cd->disc_mode = CDIO_DISC_MODE_CD_XA;
- break;
- case CDIO_DISC_MODE_CD_XA:
- case CDIO_DISC_MODE_CD_MIXED:
- case CDIO_DISC_MODE_ERROR:
- /* Disc type stays the same. */
- break;
- case CDIO_DISC_MODE_CD_DA:
- case CDIO_DISC_MODE_CD_DATA:
- cd->disc_mode = CDIO_DISC_MODE_CD_MIXED;
- break;
- default:
- cd->disc_mode = CDIO_DISC_MODE_ERROR;
- }
- }
- } else if (0 == strcmp ("MODE2/2324", psz_field)) {
- if (cd) {
- this_track->blocksize = 2324;
- this_track->track_format= TRACK_FORMAT_XA;
- this_track->track_green = true;
- this_track->mode = MODE2_FORM2;
- switch(cd->disc_mode) {
- case CDIO_DISC_MODE_NO_INFO:
- cd->disc_mode = CDIO_DISC_MODE_CD_XA;
- break;
- case CDIO_DISC_MODE_CD_XA:
- case CDIO_DISC_MODE_CD_MIXED:
- case CDIO_DISC_MODE_ERROR:
- /* Disc type stays the same. */
- break;
- case CDIO_DISC_MODE_CD_DA:
- case CDIO_DISC_MODE_CD_DATA:
- cd->disc_mode = CDIO_DISC_MODE_CD_MIXED;
- break;
- default:
- cd->disc_mode = CDIO_DISC_MODE_ERROR;
- }
- }
- } else if (0 == strcmp ("MODE2/2336", psz_field)) {
- if (cd) {
- this_track->blocksize = 2336;
- this_track->track_format= TRACK_FORMAT_XA;
- this_track->track_green = true;
- this_track->mode = MODE2_FORM_MIX;
- this_track->datastart = CDIO_CD_SYNC_SIZE
- + CDIO_CD_HEADER_SIZE;
- this_track->datasize = M2RAW_SECTOR_SIZE;
- this_track->endsize = 0;
- switch(cd->disc_mode) {
- case CDIO_DISC_MODE_NO_INFO:
- cd->disc_mode = CDIO_DISC_MODE_CD_XA;
- break;
- case CDIO_DISC_MODE_CD_XA:
- case CDIO_DISC_MODE_CD_MIXED:
- case CDIO_DISC_MODE_ERROR:
- /* Disc type stays the same. */
- break;
- case CDIO_DISC_MODE_CD_DA:
- case CDIO_DISC_MODE_CD_DATA:
- cd->disc_mode = CDIO_DISC_MODE_CD_MIXED;
- break;
- default:
- cd->disc_mode = CDIO_DISC_MODE_ERROR;
- }
- }
- } else if (0 == strcmp ("MODE2/2352", psz_field)) {
- if (cd) {
- this_track->blocksize = 2352;
- this_track->track_format= TRACK_FORMAT_XA;
- this_track->track_green = true;
- this_track->mode = MODE2_RAW;
- this_track->datastart = CDIO_CD_SYNC_SIZE
- + CDIO_CD_HEADER_SIZE + CDIO_CD_SUBHEADER_SIZE;
- this_track->datasize = CDIO_CD_FRAMESIZE;
- this_track->endsize = CDIO_CD_SYNC_SIZE + CDIO_CD_ECC_SIZE;
- switch(cd->disc_mode) {
- case CDIO_DISC_MODE_NO_INFO:
- cd->disc_mode = CDIO_DISC_MODE_CD_XA;
- break;
- case CDIO_DISC_MODE_CD_XA:
- case CDIO_DISC_MODE_CD_MIXED:
- case CDIO_DISC_MODE_ERROR:
- /* Disc type stays the same. */
- break;
- case CDIO_DISC_MODE_CD_DA:
- case CDIO_DISC_MODE_CD_DATA:
- cd->disc_mode = CDIO_DISC_MODE_CD_MIXED;
- break;
- default:
- cd->disc_mode = CDIO_DISC_MODE_ERROR;
- }
- }
- } else {
- cdio_log(log_level,
- "%s line %d after word TRACK:",
- psz_cue_name, i_line);
- cdio_log(log_level,
- "Unknown track mode %s", psz_field);
- goto err_exit;
- }
- } else {
- goto format_error;
- }
-
- /* FLAGS flag1 flag2 ... */
- } else if (0 == strcmp ("FLAGS", psz_keyword)) {
- if (0 <= i) {
- while (NULL != (psz_field = strtok (NULL, " \t\n\r"))) {
- if (0 == strcmp ("PRE", psz_field)) {
- if (cd) cd->tocent[i].flags |= PRE_EMPHASIS;
- } else if (0 == strcmp ("DCP", psz_field)) {
- if (cd) cd->tocent[i].flags |= COPY_PERMITTED;
- } else if (0 == strcmp ("4CH", psz_field)) {
- if (cd) cd->tocent[i].flags |= FOUR_CHANNEL_AUDIO;
- } else if (0 == strcmp ("SCMS", psz_field)) {
- if (cd) cd->tocent[i].flags |= SCMS;
- } else {
- goto format_error;
- }
- }
- } else {
- goto format_error;
- }
-
- /* ISRC CCOOOYYSSSSS */
- } else if (0 == strcmp ("ISRC", psz_keyword)) {
- if (0 <= i) {
- if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) {
- if (cd) cd->tocent[i].isrc = strdup (psz_field);
- } else {
- goto format_error;
- }
- } else {
- goto in_global_section;
- }
-
- /* PREGAP MM:SS:FF */
- } else if (0 == strcmp ("PREGAP", psz_keyword)) {
- if (0 <= i) {
- if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) {
- lba_t lba = cdio_lsn_to_lba(cdio_mmssff_to_lba (psz_field));
- if (CDIO_INVALID_LBA == lba) {
- cdio_log(log_level, "%s line %d: after word PREGAP:",
- psz_cue_name, i_line);
- cdio_log(log_level, "Invalid MSF string %s",
- psz_field);
- goto err_exit;
- }
- if (cd) {
- cd->tocent[i].pregap = lba;
- }
- } else {
- goto format_error;
- } if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) {
- goto format_error;
- }
- } else {
- goto in_global_section;
- }
-
- /* INDEX [##] MM:SS:FF */
- } else if (0 == strcmp ("INDEX", psz_keyword)) {
- if (0 <= i) {
- if (NULL != (psz_field = strtok (NULL, " \t\n\r")))
- if (1!=sscanf(psz_field, "%d", &start_index)) {
- cdio_log(log_level,
- "%s line %d after word INDEX:",
- psz_cue_name, i_line);
- cdio_log(log_level,
- "expecting an index number, got %s",
- psz_field);
- goto err_exit;
- }
- if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) {
- lba_t lba = cdio_mmssff_to_lba (psz_field);
- if (CDIO_INVALID_LBA == lba) {
- cdio_log(log_level, "%s line %d: after word INDEX:",
- psz_cue_name, i_line);
- cdio_log(log_level, "Invalid MSF string %s",
- psz_field);
- goto err_exit;
- }
- if (cd) {
-#if FIXED_ME
- cd->tocent[i].indexes[cd->tocent[i].nindex++] = lba;
-#else
- track_info_t *this_track=
- &(cd->tocent[cd->gen.i_tracks - cd->gen.i_first_track]);
-
- if (start_index != 0) {
- if (!b_first_index_for_track) {
- lba += CDIO_PREGAP_SECTORS;
- cdio_lba_to_msf(lba, &(this_track->start_msf));
- b_first_index_for_track = true;
- this_track->start_lba = lba;
- }
-
- if (cd->gen.i_tracks > 1) {
- /* Figure out number of sectors for previous track */
- track_info_t *prev_track=&(cd->tocent[cd->gen.i_tracks-2]);
- if ( this_track->start_lba < prev_track->start_lba ) {
- cdio_log (log_level,
- "track %d at LBA %lu starts before track %d at LBA %lu",
- cd->gen.i_tracks,
- (unsigned long int) this_track->start_lba,
- cd->gen.i_tracks,
- (unsigned long int) prev_track->start_lba);
- prev_track->sec_count = 0;
- } else if ( this_track->start_lba >= prev_track->start_lba
- + CDIO_PREGAP_SECTORS ) {
- prev_track->sec_count = this_track->start_lba -
- prev_track->start_lba - CDIO_PREGAP_SECTORS ;
- } else {
- cdio_log (log_level,
- "%lu fewer than pregap (%d) sectors in track %d",
- (long unsigned int)
- this_track->start_lba - prev_track->start_lba,
- CDIO_PREGAP_SECTORS,
- cd->gen.i_tracks);
- /* Include pregap portion in sec_count. Maybe the pregap
- was omitted. */
- prev_track->sec_count = this_track->start_lba -
- prev_track->start_lba;
- }
- }
- this_track->num_indices++;
- }
- }
-#endif
- } else {
- goto format_error;
- }
- } else {
- goto in_global_section;
- }
-
- /* CD-TEXT */
- } else if ( CDTEXT_INVALID !=
- (cdtext_key = cdtext_is_keyword (psz_keyword)) ) {
- if (-1 == i) {
- if (cd) {
- cdtext_set (cdtext_key,
- strtok (NULL, "\"\t\n\r"),
- &(cd->gen.cdtext));
- }
- } else {
- if (cd) {
- cdtext_set (cdtext_key, strtok (NULL, "\"\t\n\r"),
- &(cd->gen.cdtext_track[i]));
- }
- }
-
- /* unrecognized line */
- } else {
- cdio_log(log_level, "%s line %d: warning: unrecognized keyword: %s",
- psz_cue_name, i_line, psz_keyword);
- goto err_exit;
- }
- }
- }
-
- if (NULL != cd) {
- cd->gen.toc_init = true;
- }
-
- fclose (fp);
- return true;
-
- format_error:
- cdio_log(log_level, "%s line %d after word %s",
- psz_cue_name, i_line, psz_keyword);
- goto err_exit;
-
- in_global_section:
- cdio_log(log_level, "%s line %d: word %s not allowed in global section",
- psz_cue_name, i_line, psz_keyword);
- goto err_exit;
-
- not_in_global_section:
- cdio_log(log_level, "%s line %d: word %s only allowed in global section",
- psz_cue_name, i_line, psz_keyword);
-
- err_exit:
- fclose (fp);
- return false;
-
-}
-
-/*!
- Reads a single audio sector from CD device into data starting
- from lsn. Returns 0 if no error.
- */
-static int
-_read_audio_sectors_bincue (void *user_data, void *data, lsn_t lsn,
- unsigned int nblocks)
-{
- _img_private_t *env = user_data;
- int ret;
-
- /* Why the adjustment of 272, I don't know. It seems to work though */
- if (lsn != 0) {
- ret = cdio_stream_seek (env->gen.data_source,
- (lsn * CDIO_CD_FRAMESIZE_RAW) - 272, SEEK_SET);
- if (ret!=0) return ret;
-
- ret = cdio_stream_read (env->gen.data_source, data,
- CDIO_CD_FRAMESIZE_RAW, nblocks);
- } else {
- /* We need to pad out the first 272 bytes with 0's */
- BZERO(data, 272);
-
- ret = cdio_stream_seek (env->gen.data_source, 0, SEEK_SET);
-
- if (ret!=0) return ret;
-
- ret = cdio_stream_read (env->gen.data_source, (uint8_t *) data+272,
- CDIO_CD_FRAMESIZE_RAW - 272, nblocks);
- }
-
- /* ret is number of bytes if okay, but we need to return 0 okay. */
- return ret == 0;
-}
-
-/*!
- Reads a single mode2 sector from cd device into data starting
- from lsn. Returns 0 if no error.
- */
-static int
-_read_mode1_sector_bincue (void *user_data, void *data, lsn_t lsn,
- bool b_form2)
-{
- _img_private_t *p_env = user_data;
- int ret;
- char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, };
- int blocksize = CDIO_CD_FRAMESIZE_RAW;
-
- ret = cdio_stream_seek (p_env->gen.data_source, lsn * blocksize, SEEK_SET);
- if (ret!=0) return ret;
-
- /* FIXME: Not completely sure the below is correct. */
- ret = cdio_stream_read (p_env->gen.data_source, buf, CDIO_CD_FRAMESIZE_RAW, 1);
- if (ret==0) return ret;
-
- memcpy (data, buf + CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE,
- b_form2 ? M2RAW_SECTOR_SIZE: CDIO_CD_FRAMESIZE);
-
- return 0;
-}
-
-/*!
- Reads nblocks of mode1 sectors from cd device into data starting
- from lsn.
- Returns 0 if no error.
- */
-static int
-_read_mode1_sectors_bincue (void *user_data, void *data, lsn_t lsn,
- bool b_form2, unsigned int nblocks)
-{
- _img_private_t *p_env = user_data;
- int i;
- int retval;
- unsigned int blocksize = b_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE;
-
- for (i = 0; i < nblocks; i++) {
- if ( (retval = _read_mode1_sector_bincue (p_env,
- ((char *)data) + (blocksize * i),
- lsn + i, b_form2)) )
- return retval;
- }
- return 0;
-}
-
-/*!
- Reads a single mode1 sector from cd device into data starting
- from lsn. Returns 0 if no error.
- */
-static int
-_read_mode2_sector_bincue (void *user_data, void *data, lsn_t lsn,
- bool b_form2)
-{
- _img_private_t *p_env = user_data;
- int ret;
- char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, };
-
- /* NOTE: The logic below seems a bit wrong and convoluted
- to me, but passes the regression tests. (Perhaps it is why we get
- valgrind errors in vcdxrip). Leave it the way it was for now.
- Review this sector 2336 stuff later.
- */
-
- int blocksize = CDIO_CD_FRAMESIZE_RAW;
-
- ret = cdio_stream_seek (p_env->gen.data_source, lsn * blocksize, SEEK_SET);
- if (ret!=0) return ret;
-
- ret = cdio_stream_read (p_env->gen.data_source, buf, CDIO_CD_FRAMESIZE_RAW, 1);
- if (ret==0) return ret;
-
-
- /* See NOTE above. */
- if (b_form2)
- memcpy (data, buf + CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE,
- M2RAW_SECTOR_SIZE);
- else
- memcpy (data, buf + CDIO_CD_XA_SYNC_HEADER, CDIO_CD_FRAMESIZE);
-
- return 0;
-}
-
-/*!
- Reads nblocks of mode2 sectors from cd device into data starting
- from lsn.
- Returns 0 if no error.
- */
-static int
-_read_mode2_sectors_bincue (void *user_data, void *data, lsn_t lsn,
- bool b_form2, unsigned int nblocks)
-{
- _img_private_t *p_env = user_data;
- int i;
- int retval;
- unsigned int blocksize = b_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE;
-
- for (i = 0; i < nblocks; i++) {
- if ( (retval = _read_mode2_sector_bincue (p_env,
- ((char *)data) + (blocksize * i),
- lsn + i, b_form2)) )
- return retval;
- }
- return 0;
-}
-
-/*!
- Return an array of strings giving possible BIN/CUE disk images.
- */
-char **
-cdio_get_devices_bincue (void)
-{
- char **drives = NULL;
- unsigned int num_files=0;
-#ifdef HAVE_GLOB_H
- unsigned int i;
- glob_t globbuf;
- globbuf.gl_offs = 0;
- glob("*.cue", GLOB_DOOFFS, NULL, &globbuf);
- for (i=0; i<globbuf.gl_pathc; i++) {
- cdio_add_device_list(&drives, globbuf.gl_pathv[i], &num_files);
- }
- globfree(&globbuf);
-#else
- cdio_add_device_list(&drives, DEFAULT_CDIO_DEVICE, &num_files);
-#endif /*HAVE_GLOB_H*/
- cdio_add_device_list(&drives, NULL, &num_files);
- return drives;
-}
-
-/*!
- Return a string containing the default CD device.
- */
-char *
-cdio_get_default_device_bincue(void)
-{
- char **drives = cdio_get_devices_nrg();
- char *drive = (drives[0] == NULL) ? NULL : strdup(drives[0]);
- cdio_free_device_list(drives);
- return drive;
-}
-
-static bool
-get_hwinfo_bincue ( const CdIo *p_cdio, /*out*/ cdio_hwinfo_t *hw_info)
-{
- strcpy(hw_info->psz_vendor, "libcdio");
- strcpy(hw_info->psz_model, "CDRWIN");
- strcpy(hw_info->psz_revision, CDIO_VERSION);
- return true;
-
-}
-
-/*!
- Return the number of tracks in the current medium.
- CDIO_INVALID_TRACK is returned on error.
-*/
-static track_format_t
-_get_track_format_bincue(void *user_data, track_t i_track)
-{
- _img_private_t *p_env = user_data;
-
- if (i_track > p_env->gen.i_tracks || i_track == 0)
- return TRACK_FORMAT_ERROR;
-
- return p_env->tocent[i_track-p_env->gen.i_first_track].track_format;
-}
-
-/*!
- Return true if we have XA data (green, mode2 form1) or
- XA data (green, mode2 form2). That is track begins:
- sync - header - subheader
- 12 4 - 8
-
- FIXME: there's gotta be a better design for this and get_track_format?
-*/
-static bool
-_get_track_green_bincue(void *user_data, track_t i_track)
-{
- _img_private_t *p_env = user_data;
-
- if ( NULL == p_env ||
- ( i_track < p_env->gen.i_first_track
- || i_track >= p_env->gen.i_tracks + p_env->gen.i_first_track ) )
- return false;
-
- return p_env->tocent[i_track-p_env->gen.i_first_track].track_green;
-}
-
-/*!
- Return the starting LSN track number
- i_track in obj. Track numbers start at 1.
- The "leadout" track is specified either by
- using i_track LEADOUT_TRACK or the total tracks+1.
- False is returned if there is no track entry.
-*/
-static lba_t
-_get_lba_track_bincue(void *user_data, track_t i_track)
-{
- _img_private_t *p_env = user_data;
-
- if (i_track == CDIO_CDROM_LEADOUT_TRACK) i_track = p_env->gen.i_tracks+1;
-
- if (i_track <= p_env->gen.i_tracks + p_env->gen.i_first_track && i_track != 0) {
- return p_env->tocent[i_track-p_env->gen.i_first_track].start_lba;
- } else
- return CDIO_INVALID_LBA;
-}
-
-/*!
- Return corresponding BIN file if psz_cue_name is a cue file or NULL
- if not a CUE file.
-*/
-char *
-cdio_is_cuefile(const char *psz_cue_name)
-{
- int i;
- char *psz_bin_name;
-
- if (psz_cue_name == NULL) return NULL;
-
- /* FIXME? Now that we have cue parsing, should we really force
- the filename extension requirement or is it enough just to
- parse the cuefile?
- */
-
- psz_bin_name=strdup(psz_cue_name);
- i=strlen(psz_bin_name)-strlen("cue");
-
- if (i>0) {
- if (psz_cue_name[i]=='c' && psz_cue_name[i+1]=='u' && psz_cue_name[i+2]=='e') {
- psz_bin_name[i++]='b'; psz_bin_name[i++]='i'; psz_bin_name[i++]='n';
- if (parse_cuefile(NULL, psz_cue_name))
- return psz_bin_name;
- else
- goto error;
- }
- else if (psz_cue_name[i]=='C' && psz_cue_name[i+1]=='U' && psz_cue_name[i+2]=='E') {
- psz_bin_name[i++]='B'; psz_bin_name[i++]='I'; psz_bin_name[i++]='N';
- if (parse_cuefile(NULL, psz_cue_name))
- return psz_bin_name;
- else
- goto error;
- }
- }
- error:
- free(psz_bin_name);
- return NULL;
-}
-
-/*!
- Return corresponding CUE file if psz_bin_name is a bin file or NULL
- if not a BIN file.
-*/
-char *
-cdio_is_binfile(const char *psz_bin_name)
-{
- int i;
- char *psz_cue_name;
-
- if (psz_bin_name == NULL) return NULL;
-
- psz_cue_name=strdup(psz_bin_name);
- i=strlen(psz_bin_name)-strlen("bin");
-
- if (i>0) {
- if (psz_bin_name[i]=='b' && psz_bin_name[i+1]=='i' && psz_bin_name[i+2]=='n') {
- psz_cue_name[i++]='c'; psz_cue_name[i++]='u'; psz_cue_name[i++]='e';
- return psz_cue_name;
- }
- else if (psz_bin_name[i]=='B' && psz_bin_name[i+1]=='I' && psz_bin_name[i+2]=='N') {
- psz_cue_name[i++]='C'; psz_cue_name[i++]='U'; psz_cue_name[i++]='E';
- return psz_cue_name;
- }
- }
- free(psz_cue_name);
- return NULL;
-}
-
-/*!
- Initialization routine. This is the only thing that doesn't
- get called via a function pointer. In fact *we* are the
- ones to set that up.
- */
-CdIo *
-cdio_open_am_bincue (const char *psz_source_name, const char *psz_access_mode)
-{
- if (psz_access_mode != NULL)
- cdio_warn ("there is only one access mode for bincue. Arg %s ignored",
- psz_access_mode);
- return cdio_open_bincue(psz_source_name);
-}
-
-/*!
- Initialization routine. This is the only thing that doesn't
- get called via a function pointer. In fact *we* are the
- ones to set that up.
- */
-CdIo *
-cdio_open_bincue (const char *source_name)
-{
- char *psz_bin_name = cdio_is_cuefile(source_name);
-
- if (NULL != psz_bin_name) {
- free(psz_bin_name);
- return cdio_open_cue(source_name);
- } else {
- char *psz_cue_name = cdio_is_binfile(source_name);
- CdIo *cdio = cdio_open_cue(psz_cue_name);
- free(psz_cue_name);
- return cdio;
- }
-}
-
-CdIo *
-cdio_open_cue (const char *psz_cue_name)
-{
- CdIo *ret;
- _img_private_t *_data;
- char *psz_bin_name;
-
- cdio_funcs _funcs;
-
- memset( &_funcs, 0, sizeof(_funcs) );
-
- _funcs.eject_media = _eject_media_image;
- _funcs.free = _free_image;
- _funcs.get_arg = _get_arg_image;
- _funcs.get_cdtext = get_cdtext_generic;
- _funcs.get_devices = cdio_get_devices_bincue;
- _funcs.get_default_device = cdio_get_default_device_bincue;
- _funcs.get_discmode = _get_discmode_image;
- _funcs.get_drive_cap = _get_drive_cap_image;
- _funcs.get_first_track_num= _get_first_track_num_image;
- _funcs.get_hwinfo = get_hwinfo_bincue;
- _funcs.get_mcn = _get_mcn_image;
- _funcs.get_num_tracks = _get_num_tracks_image;
- _funcs.get_track_format = _get_track_format_bincue;
- _funcs.get_track_green = _get_track_green_bincue;
- _funcs.get_track_lba = _get_lba_track_bincue;
- _funcs.get_track_msf = _get_track_msf_image;
- _funcs.lseek = _lseek_bincue;
- _funcs.read = _read_bincue;
- _funcs.read_audio_sectors = _read_audio_sectors_bincue;
- _funcs.read_mode1_sector = _read_mode1_sector_bincue;
- _funcs.read_mode1_sectors = _read_mode1_sectors_bincue;
- _funcs.read_mode2_sector = _read_mode2_sector_bincue;
- _funcs.read_mode2_sectors = _read_mode2_sectors_bincue;
- _funcs.set_arg = _set_arg_image;
- _funcs.stat_size = _stat_size_bincue;
-
- if (NULL == psz_cue_name) return NULL;
-
- _data = _cdio_malloc (sizeof (_img_private_t));
- _data->gen.init = false;
- _data->psz_cue_name = NULL;
-
- ret = cdio_new ((void *)_data, &_funcs);
-
- if (ret == NULL) {
- free(_data);
- return NULL;
- }
-
- psz_bin_name = cdio_is_cuefile(psz_cue_name);
-
- if (NULL == psz_bin_name) {
- cdio_error ("source name %s is not recognized as a CUE file",
- psz_cue_name);
- }
-
- _set_arg_image (_data, "cue", psz_cue_name);
- _set_arg_image (_data, "source", psz_bin_name);
- free(psz_bin_name);
-
- if (_init_bincue(_data)) {
- return ret;
- } else {
- _free_image(_data);
- free(ret);
- return NULL;
- }
-}
-
-bool
-cdio_have_bincue (void)
-{
- return true;
-}
diff --git a/src/input/vcd/libcdio/image/cdrdao.c b/src/input/vcd/libcdio/image/cdrdao.c
deleted file mode 100644
index 828172721..000000000
--- a/src/input/vcd/libcdio/image/cdrdao.c
+++ /dev/null
@@ -1,1198 +0,0 @@
-/*
- $Id: cdrdao.c,v 1.1 2005/01/01 02:43:58 rockyb Exp $
-
- Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
- toc reading routine adapted from cuetools
- Copyright (C) 2003 Svend Sanjay Sorensen <ssorensen@fastmail.fm>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* This code implements low-level access functions for a CD images
- residing inside a disk file (*.bin) and its associated cue sheet.
- (*.cue).
-*/
-
-static const char _rcsid[] = "$Id: cdrdao.c,v 1.1 2005/01/01 02:43:58 rockyb Exp $";
-
-#include "image.h"
-#include "cdio_assert.h"
-#include "_cdio_stdio.h"
-
-#include <cdio/logging.h>
-#include <cdio/sector.h>
-#include <cdio/util.h>
-#include <cdio/version.h>
-
-#ifdef HAVE_STDIO_H
-#include <stdio.h>
-#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#ifdef HAVE_GLOB_H
-#include <glob.h>
-#endif
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-
-#include <ctype.h>
-
-#include "portable.h"
-
-/* reader */
-
-#define DEFAULT_CDIO_DEVICE "videocd.bin"
-#define DEFAULT_CDIO_CDRDAO "videocd.toc"
-
-typedef struct {
- /* Things common to all drivers like this.
- This must be first. */
- generic_img_private_t gen;
- internal_position_t pos;
-
- char *psz_cue_name;
- char *psz_mcn; /* Media Catalog Number (5.22.3)
- exactly 13 bytes */
- track_info_t tocent[CDIO_CD_MAX_TRACKS+1]; /* entry info for each track
- add 1 for leadout. */
- discmode_t disc_mode;
-} _img_private_t;
-
-static uint32_t _stat_size_cdrdao (void *user_data);
-static bool parse_tocfile (_img_private_t *cd, const char *toc_name);
-
-#define NEED_MEDIA_EJECT_IMAGE
-#include "image_common.h"
-
-/*!
- Initialize image structures.
- */
-static bool
-_init_cdrdao (_img_private_t *env)
-{
- lsn_t lead_lsn;
-
- if (env->gen.init)
- return false;
-
- /* Have to set init before calling _stat_size_cdrdao() or we will
- get into infinite recursion calling passing right here.
- */
- env->gen.init = true;
- env->gen.i_first_track = 1;
- env->psz_mcn = NULL;
- env->disc_mode = CDIO_DISC_MODE_NO_INFO;
-
- cdtext_init (&(env->gen.cdtext));
-
- /* Read in TOC sheet. */
- if ( !parse_tocfile(env, env->psz_cue_name) ) return false;
-
- lead_lsn = _stat_size_cdrdao( (_img_private_t *) env);
-
- if (-1 == lead_lsn)
- return false;
-
- /* Fake out leadout track and sector count for last track*/
- cdio_lsn_to_msf (lead_lsn, &env->tocent[env->gen.i_tracks].start_msf);
- env->tocent[env->gen.i_tracks].start_lba = cdio_lsn_to_lba(lead_lsn);
- env->tocent[env->gen.i_tracks-env->gen.i_first_track].sec_count =
- cdio_lsn_to_lba(lead_lsn - env->tocent[env->gen.i_tracks-1].start_lba);
-
- return true;
-}
-
-/*!
- Reads into buf the next size bytes.
- Returns -1 on error.
- Would be libc's seek() but we have to adjust for the extra track header
- information in each sector.
-*/
-static off_t
-_lseek_cdrdao (void *user_data, off_t offset, int whence)
-{
- _img_private_t *env = user_data;
-
- /* real_offset is the real byte offset inside the disk image
- The number below was determined empirically. I'm guessing
- the 1st 24 bytes of a bin file are used for something.
- */
- off_t real_offset=0;
-
- unsigned int i;
-
- env->pos.lba = 0;
- for (i=0; i<env->gen.i_tracks; i++) {
- track_info_t *this_track=&(env->tocent[i]);
- env->pos.index = i;
- if ( (this_track->sec_count*this_track->datasize) >= offset) {
- int blocks = offset / this_track->datasize;
- int rem = offset % this_track->datasize;
- int block_offset = blocks * this_track->blocksize;
- real_offset += block_offset + rem;
- env->pos.buff_offset = rem;
- env->pos.lba += blocks;
- break;
- }
- real_offset += this_track->sec_count*this_track->blocksize;
- offset -= this_track->sec_count*this_track->datasize;
- env->pos.lba += this_track->sec_count;
- }
-
- if (i==env->gen.i_tracks) {
- cdio_warn ("seeking outside range of disk image");
- return -1;
- } else {
- real_offset += env->tocent[i].datastart;
- return cdio_stream_seek(env->tocent[i].data_source, real_offset, whence);
- }
-}
-
-/*!
- Reads into buf the next size bytes.
- Returns -1 on error.
- FIXME:
- At present we assume a read doesn't cross sector or track
- boundaries.
-*/
-static ssize_t
-_read_cdrdao (void *user_data, void *data, size_t size)
-{
- _img_private_t *env = user_data;
- char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, };
- char *p = data;
- ssize_t final_size=0;
- ssize_t this_size;
- track_info_t *this_track=&(env->tocent[env->pos.index]);
- ssize_t skip_size = this_track->datastart + this_track->endsize;
-
- while (size > 0) {
- int rem = this_track->datasize - env->pos.buff_offset;
- if (size <= rem) {
- this_size = cdio_stream_read(this_track->data_source, buf, size, 1);
- final_size += this_size;
- memcpy (p, buf, this_size);
- break;
- }
-
- /* Finish off reading this sector. */
- cdio_warn ("Reading across block boundaries not finished");
-
- size -= rem;
- this_size = cdio_stream_read(this_track->data_source, buf, rem, 1);
- final_size += this_size;
- memcpy (p, buf, this_size);
- p += this_size;
- this_size = cdio_stream_read(this_track->data_source, buf, rem, 1);
-
- /* Skip over stuff at end of this sector and the beginning of the next.
- */
- cdio_stream_read(this_track->data_source, buf, skip_size, 1);
-
- /* Get ready to read another sector. */
- env->pos.buff_offset=0;
- env->pos.lba++;
-
- /* Have gone into next track. */
- if (env->pos.lba >= env->tocent[env->pos.index+1].start_lba) {
- env->pos.index++;
- this_track=&(env->tocent[env->pos.index]);
- skip_size = this_track->datastart + this_track->endsize;
- }
- }
- return final_size;
-}
-
-/*!
- Return the size of the CD in logical block address (LBA) units.
- */
-static uint32_t
-_stat_size_cdrdao (void *user_data)
-{
- _img_private_t *env = user_data;
- long size;
-
- size = cdio_stream_stat (env->tocent[0].data_source);
-
- if (size % CDIO_CD_FRAMESIZE_RAW)
- {
- cdio_warn ("image %s size (%ld) not multiple of blocksize (%d)",
- env->tocent[0].filename, size, CDIO_CD_FRAMESIZE_RAW);
- if (size % M2RAW_SECTOR_SIZE == 0)
- cdio_warn ("this may be a 2336-type disc image");
- else if (size % CDIO_CD_FRAMESIZE_RAW == 0)
- cdio_warn ("this may be a 2352-type disc image");
- /* exit (EXIT_FAILURE); */
- }
-
- size /= CDIO_CD_FRAMESIZE_RAW;
-
- return size;
-}
-
-#define MAXLINE 512
-#define UNIMPLIMENTED_MSG \
- cdio_log(log_level, "%s line %d: unimplimented keyword: %s", \
- psz_cue_name, i_line, psz_keyword)
-
-
-static bool
-parse_tocfile (_img_private_t *cd, const char *psz_cue_name)
-{
- /* The below declarations may be common in other image-parse routines. */
- FILE *fp;
- char psz_line[MAXLINE]; /* text of current line read in file fp. */
- unsigned int i_line=0; /* line number in file of psz_line. */
- int i = -1; /* Position in tocent. Same as
- cd->gen.i_tracks - 1 */
- char *psz_keyword, *psz_field;
- cdio_log_level_t log_level = (NULL == cd) ? CDIO_LOG_INFO : CDIO_LOG_WARN;
- cdtext_field_t cdtext_key;
-
- /* The below declaration(s) may be unique to this image-parse routine. */
- unsigned int i_cdtext_nest = 0;
-
- if (NULL == psz_cue_name)
- return false;
-
- fp = fopen (psz_cue_name, "r");
- if (fp == NULL) {
- cdio_log(log_level, "error opening %s for reading: %s",
- psz_cue_name, strerror(errno));
- return false;
- }
-
- if (cd) {
- cd->gen.b_cdtext_init = true;
- cd->gen.b_cdtext_error = false;
- }
-
- while ((fgets(psz_line, MAXLINE, fp)) != NULL) {
-
- i_line++;
-
- /* strip comment from line */
- /* todo: // in quoted strings? */
- /* //comment */
- if (NULL != (psz_field = strstr (psz_line, "//")))
- *psz_field = '\0';
-
- if (NULL != (psz_keyword = strtok (psz_line, " \t\n\r"))) {
- /* CATALOG "ddddddddddddd" */
- if (0 == strcmp ("CATALOG", psz_keyword)) {
- if (-1 == i) {
- if (NULL != (psz_field = strtok (NULL, "\"\t\n\r"))) {
- if (13 != strlen(psz_field)) {
- cdio_log(log_level,
- "%s line %d after word CATALOG:",
- psz_cue_name, i_line);
- cdio_log(log_level,
- "Token %s has length %ld. Should be 13 digits.",
- psz_field, (long int) strlen(psz_field));
-
- goto err_exit;
- } else {
- /* Check that we have all digits*/
- unsigned int i;
- for (i=0; i<13; i++) {
- if (!isdigit(psz_field[i])) {
- cdio_log(log_level,
- "%s line %d after word CATALOG:",
- psz_cue_name, i_line);
- cdio_log(log_level,
- "Character \"%c\" at postition %i of token \"%s\""
- " is not all digits.",
- psz_field[i], i+1, psz_field);
- goto err_exit;
- }
- }
- if (NULL != cd) cd->psz_mcn = strdup (psz_field);
- }
- } else {
- cdio_log(log_level,
- "%s line %d after word CATALOG:",
- psz_cue_name, i_line);
- cdio_log(log_level, "Expecting 13 digits; nothing seen.");
- goto err_exit;
- }
- } else {
- goto err_exit;
- }
-
- /* CD_DA | CD_ROM | CD_ROM_XA */
- } else if (0 == strcmp ("CD_DA", psz_keyword)) {
- if (-1 == i) {
- if (NULL != cd)
- cd->disc_mode = CDIO_DISC_MODE_CD_DA;
- } else {
- goto not_in_global_section;
- }
- } else if (0 == strcmp ("CD_ROM", psz_keyword)) {
- if (-1 == i) {
- if (NULL != cd)
- cd->disc_mode = CDIO_DISC_MODE_CD_DATA;
- } else {
- goto not_in_global_section;
- }
-
- } else if (0 == strcmp ("CD_ROM_XA", psz_keyword)) {
- if (-1 == i) {
- if (NULL != cd)
- cd->disc_mode = CDIO_DISC_MODE_CD_XA;
- } else {
- goto not_in_global_section;
- }
-
- /* TRACK <track-mode> [<sub-channel-mode>] */
- } else if (0 == strcmp ("TRACK", psz_keyword)) {
- i++;
- if (NULL != cd) cdtext_init (&(cd->gen.cdtext_track[i]));
- if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) {
- if (0 == strcmp ("AUDIO", psz_field)) {
- if (NULL != cd) {
- cd->tocent[i].track_format = TRACK_FORMAT_AUDIO;
- cd->tocent[i].blocksize = CDIO_CD_FRAMESIZE_RAW;
- cd->tocent[i].datasize = CDIO_CD_FRAMESIZE_RAW;
- cd->tocent[i].datastart = 0;
- cd->tocent[i].endsize = 0;
- switch(cd->disc_mode) {
- case CDIO_DISC_MODE_NO_INFO:
- cd->disc_mode = CDIO_DISC_MODE_CD_DA;
- break;
- case CDIO_DISC_MODE_CD_DA:
- case CDIO_DISC_MODE_CD_MIXED:
- case CDIO_DISC_MODE_ERROR:
- /* Disc type stays the same. */
- break;
- case CDIO_DISC_MODE_CD_DATA:
- case CDIO_DISC_MODE_CD_XA:
- cd->disc_mode = CDIO_DISC_MODE_CD_MIXED;
- break;
- default:
- cd->disc_mode = CDIO_DISC_MODE_ERROR;
- }
-
- }
- } else if (0 == strcmp ("MODE1", psz_field)) {
- if (NULL != cd) {
- cd->tocent[i].track_format = TRACK_FORMAT_DATA;
- cd->tocent[i].blocksize = CDIO_CD_FRAMESIZE_RAW;
- cd->tocent[i].datastart = CDIO_CD_SYNC_SIZE
- + CDIO_CD_HEADER_SIZE;
- cd->tocent[i].datasize = CDIO_CD_FRAMESIZE;
- cd->tocent[i].endsize = CDIO_CD_EDC_SIZE
- + CDIO_CD_M1F1_ZERO_SIZE + CDIO_CD_ECC_SIZE;
- switch(cd->disc_mode) {
- case CDIO_DISC_MODE_NO_INFO:
- cd->disc_mode = CDIO_DISC_MODE_CD_DATA;
- break;
- case CDIO_DISC_MODE_CD_DATA:
- case CDIO_DISC_MODE_CD_MIXED:
- case CDIO_DISC_MODE_ERROR:
- /* Disc type stays the same. */
- break;
- case CDIO_DISC_MODE_CD_DA:
- case CDIO_DISC_MODE_CD_XA:
- cd->disc_mode = CDIO_DISC_MODE_CD_MIXED;
- break;
- default:
- cd->disc_mode = CDIO_DISC_MODE_ERROR;
- }
- }
- } else if (0 == strcmp ("MODE1_RAW", psz_field)) {
- if (NULL != cd) {
- cd->tocent[i].track_format = TRACK_FORMAT_DATA;
- cd->tocent[i].blocksize = CDIO_CD_FRAMESIZE_RAW;
- cd->tocent[i].datastart = CDIO_CD_SYNC_SIZE
- + CDIO_CD_HEADER_SIZE;
- cd->tocent[i].datasize = CDIO_CD_FRAMESIZE;
- cd->tocent[i].endsize = CDIO_CD_EDC_SIZE
- + CDIO_CD_M1F1_ZERO_SIZE + CDIO_CD_ECC_SIZE;
- switch(cd->disc_mode) {
- case CDIO_DISC_MODE_NO_INFO:
- cd->disc_mode = CDIO_DISC_MODE_CD_DATA;
- break;
- case CDIO_DISC_MODE_CD_DATA:
- case CDIO_DISC_MODE_CD_MIXED:
- case CDIO_DISC_MODE_ERROR:
- /* Disc type stays the same. */
- break;
- case CDIO_DISC_MODE_CD_DA:
- case CDIO_DISC_MODE_CD_XA:
- cd->disc_mode = CDIO_DISC_MODE_CD_MIXED;
- break;
- default:
- cd->disc_mode = CDIO_DISC_MODE_ERROR;
- }
- }
- } else if (0 == strcmp ("MODE2", psz_field)) {
- if (NULL != cd) {
- cd->tocent[i].track_format = TRACK_FORMAT_XA;
- cd->tocent[i].datastart = CDIO_CD_SYNC_SIZE
- + CDIO_CD_HEADER_SIZE;
- cd->tocent[i].datasize = M2RAW_SECTOR_SIZE;
- cd->tocent[i].endsize = 0;
- switch(cd->disc_mode) {
- case CDIO_DISC_MODE_NO_INFO:
- cd->disc_mode = CDIO_DISC_MODE_CD_XA;
- break;
- case CDIO_DISC_MODE_CD_XA:
- case CDIO_DISC_MODE_CD_MIXED:
- case CDIO_DISC_MODE_ERROR:
- /* Disc type stays the same. */
- break;
- case CDIO_DISC_MODE_CD_DA:
- case CDIO_DISC_MODE_CD_DATA:
- cd->disc_mode = CDIO_DISC_MODE_CD_MIXED;
- break;
- default:
- cd->disc_mode = CDIO_DISC_MODE_ERROR;
- }
- }
- } else if (0 == strcmp ("MODE2_FORM1", psz_field)) {
- if (NULL != cd) {
- cd->tocent[i].track_format = TRACK_FORMAT_XA;
- cd->tocent[i].datastart = CDIO_CD_SYNC_SIZE
- + CDIO_CD_HEADER_SIZE;
- cd->tocent[i].datasize = CDIO_CD_FRAMESIZE_RAW;
- cd->tocent[i].endsize = 0;
- switch(cd->disc_mode) {
- case CDIO_DISC_MODE_NO_INFO:
- cd->disc_mode = CDIO_DISC_MODE_CD_XA;
- break;
- case CDIO_DISC_MODE_CD_XA:
- case CDIO_DISC_MODE_CD_MIXED:
- case CDIO_DISC_MODE_ERROR:
- /* Disc type stays the same. */
- break;
- case CDIO_DISC_MODE_CD_DA:
- case CDIO_DISC_MODE_CD_DATA:
- cd->disc_mode = CDIO_DISC_MODE_CD_MIXED;
- break;
- default:
- cd->disc_mode = CDIO_DISC_MODE_ERROR;
- }
- }
- } else if (0 == strcmp ("MODE2_FORM2", psz_field)) {
- if (NULL != cd) {
- cd->tocent[i].track_format = TRACK_FORMAT_XA;
- cd->tocent[i].datastart = CDIO_CD_SYNC_SIZE
- + CDIO_CD_HEADER_SIZE + CDIO_CD_SUBHEADER_SIZE;
- cd->tocent[i].datasize = CDIO_CD_FRAMESIZE;
- cd->tocent[i].endsize = CDIO_CD_SYNC_SIZE
- + CDIO_CD_ECC_SIZE;
- switch(cd->disc_mode) {
- case CDIO_DISC_MODE_NO_INFO:
- cd->disc_mode = CDIO_DISC_MODE_CD_XA;
- break;
- case CDIO_DISC_MODE_CD_XA:
- case CDIO_DISC_MODE_CD_MIXED:
- case CDIO_DISC_MODE_ERROR:
- /* Disc type stays the same. */
- break;
- case CDIO_DISC_MODE_CD_DA:
- case CDIO_DISC_MODE_CD_DATA:
- cd->disc_mode = CDIO_DISC_MODE_CD_MIXED;
- break;
- default:
- cd->disc_mode = CDIO_DISC_MODE_ERROR;
- }
- }
- } else if (0 == strcmp ("MODE2_FORM_MIX", psz_field)) {
- if (NULL != cd) {
- cd->tocent[i].track_format = TRACK_FORMAT_XA;
- cd->tocent[i].datasize = M2RAW_SECTOR_SIZE;
- cd->tocent[i].blocksize = CDIO_CD_FRAMESIZE_RAW;
- cd->tocent[i].datastart = CDIO_CD_SYNC_SIZE +
- CDIO_CD_HEADER_SIZE + CDIO_CD_SUBHEADER_SIZE;
- cd->tocent[i].track_green = true;
- cd->tocent[i].endsize = 0;
- switch(cd->disc_mode) {
- case CDIO_DISC_MODE_NO_INFO:
- cd->disc_mode = CDIO_DISC_MODE_CD_XA;
- break;
- case CDIO_DISC_MODE_CD_XA:
- case CDIO_DISC_MODE_CD_MIXED:
- case CDIO_DISC_MODE_ERROR:
- /* Disc type stays the same. */
- break;
- case CDIO_DISC_MODE_CD_DA:
- case CDIO_DISC_MODE_CD_DATA:
- cd->disc_mode = CDIO_DISC_MODE_CD_MIXED;
- break;
- default:
- cd->disc_mode = CDIO_DISC_MODE_ERROR;
- }
- }
- } else if (0 == strcmp ("MODE2_RAW", psz_field)) {
- if (NULL != cd) {
- cd->tocent[i].track_format = TRACK_FORMAT_XA;
- cd->tocent[i].blocksize = CDIO_CD_FRAMESIZE_RAW;
- cd->tocent[i].datastart = CDIO_CD_SYNC_SIZE +
- CDIO_CD_HEADER_SIZE + CDIO_CD_SUBHEADER_SIZE;
- cd->tocent[i].datasize = CDIO_CD_FRAMESIZE;
- cd->tocent[i].track_green = true;
- cd->tocent[i].endsize = 0;
- switch(cd->disc_mode) {
- case CDIO_DISC_MODE_NO_INFO:
- cd->disc_mode = CDIO_DISC_MODE_CD_XA;
- break;
- case CDIO_DISC_MODE_CD_XA:
- case CDIO_DISC_MODE_CD_MIXED:
- case CDIO_DISC_MODE_ERROR:
- /* Disc type stays the same. */
- break;
- case CDIO_DISC_MODE_CD_DA:
- case CDIO_DISC_MODE_CD_DATA:
- cd->disc_mode = CDIO_DISC_MODE_CD_MIXED;
- break;
- default:
- cd->disc_mode = CDIO_DISC_MODE_ERROR;
- }
- }
- } else {
- cdio_log(log_level, "%s line %d after TRACK:",
- psz_cue_name, i_line);
- cdio_log(log_level, "'%s' not a valid mode.", psz_field);
- goto err_exit;
- }
- }
- if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) {
- /* todo: set sub-channel-mode */
- if (0 == strcmp ("RW", psz_field))
- ;
- else if (0 == strcmp ("RW_RAW", psz_field))
- ;
- }
- if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) {
- goto format_error;
- }
-
- /* track flags */
- /* [NO] COPY | [NO] PRE_EMPHASIS */
- } else if (0 == strcmp ("NO", psz_keyword)) {
- if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) {
- if (0 == strcmp ("COPY", psz_field)) {
- if (NULL != cd)
- cd->tocent[i].flags &= ~CDIO_TRACK_FLAG_COPY_PERMITTED;
-
- } else if (0 == strcmp ("PRE_EMPHASIS", psz_field))
- if (NULL != cd) {
- cd->tocent[i].flags &= ~CDIO_TRACK_FLAG_PRE_EMPHASIS;
- goto err_exit;
- }
- } else {
- goto format_error;
- }
- if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) {
- goto format_error;
- }
- } else if (0 == strcmp ("COPY", psz_keyword)) {
- if (NULL != cd)
- cd->tocent[i].flags |= CDIO_TRACK_FLAG_COPY_PERMITTED;
- } else if (0 == strcmp ("PRE_EMPHASIS", psz_keyword)) {
- if (NULL != cd)
- cd->tocent[i].flags |= CDIO_TRACK_FLAG_PRE_EMPHASIS;
- /* TWO_CHANNEL_AUDIO */
- } else if (0 == strcmp ("TWO_CHANNEL_AUDIO", psz_keyword)) {
- if (NULL != cd)
- cd->tocent[i].flags &= ~CDIO_TRACK_FLAG_FOUR_CHANNEL_AUDIO;
- /* FOUR_CHANNEL_AUDIO */
- } else if (0 == strcmp ("FOUR_CHANNEL_AUDIO", psz_keyword)) {
- if (NULL != cd)
- cd->tocent[i].flags |= CDIO_TRACK_FLAG_FOUR_CHANNEL_AUDIO;
-
- /* ISRC "CCOOOYYSSSSS" */
- } else if (0 == strcmp ("ISRC", psz_keyword)) {
- if (NULL != (psz_field = strtok (NULL, "\"\t\n\r"))) {
- if (NULL != cd)
- cd->tocent[i].isrc = strdup(psz_field);
- } else {
- goto format_error;
- }
-
- /* SILENCE <length> */
- } else if (0 == strcmp ("SILENCE", psz_keyword)) {
- UNIMPLIMENTED_MSG;
-
- /* ZERO <length> */
- } else if (0 == strcmp ("ZERO", psz_keyword)) {
- UNIMPLIMENTED_MSG;
-
- /* [FILE|AUDIOFILE] "<filename>" <start> [<length>] */
- } else if (0 == strcmp ("FILE", psz_keyword)
- || 0 == strcmp ("AUDIOFILE", psz_keyword)) {
- if (0 <= i) {
- if (NULL != (psz_field = strtok (NULL, "\"\t\n\r"))) {
- if (NULL != cd) {
- cd->tocent[i].filename = strdup (psz_field);
- /* Todo: do something about reusing existing files. */
- if (!(cd->tocent[i].data_source = cdio_stdio_new (psz_field))) {
- cdio_log (log_level,
- "%s line %d: can't open file `%s' for reading",
- psz_cue_name, i_line, psz_field);
- goto err_exit;
- }
- }
- }
-
- if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) {
- lba_t lba = cdio_lsn_to_lba(cdio_mmssff_to_lba (psz_field));
- if (CDIO_INVALID_LBA == lba) {
- cdio_log(log_level, "%s line %d: invalid MSF string %s",
- psz_cue_name, i_line, psz_field);
- goto err_exit;
- }
-
- if (NULL != cd) {
- cd->tocent[i].start_lba = lba;
- cdio_lba_to_msf(lba, &(cd->tocent[i].start_msf));
- }
- }
- if (NULL != (psz_field = strtok (NULL, " \t\n\r")))
- if (NULL != cd)
- cd->tocent[i].length = cdio_mmssff_to_lba (psz_field);
- if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) {
- goto format_error;
- }
- } else {
- goto not_in_global_section;
- }
-
- /* DATAFILE "<filename>" <start> [<length>] */
- } else if (0 == strcmp ("DATAFILE", psz_keyword)) {
- goto unimplimented_error;
-
- /* FIFO "<fifo path>" [<length>] */
- } else if (0 == strcmp ("FIFO", psz_keyword)) {
- goto unimplimented_error;
-
- /* START MM:SS:FF */
- } else if (0 == strcmp ("START", psz_keyword)) {
- if (0 <= i) {
- if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) {
- /* todo: line is too long! */
- if (NULL != cd) {
- cd->tocent[i].start_lba += cdio_mmssff_to_lba (psz_field);
- cdio_lba_to_msf(cd->tocent[i].start_lba,
- &(cd->tocent[i].start_msf));
- }
- }
-
- if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) {
- goto format_error;
- }
- } else {
- goto not_in_global_section;
- }
-
- /* PREGAP MM:SS:FF */
- } else if (0 == strcmp ("PREGAP", psz_keyword)) {
- if (0 <= i) {
- if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) {
- if (NULL != cd)
- cd->tocent[i].pregap = cdio_mmssff_to_lba (psz_field);
- } else {
- goto format_error;
- }
- if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) {
- goto format_error;
- }
- } else {
- goto not_in_global_section;
- }
-
- /* INDEX MM:SS:FF */
- } else if (0 == strcmp ("INDEX", psz_keyword)) {
- if (0 <= i) {
- if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) {
- if (NULL != cd) {
-#if 0
- if (1 == cd->tocent[i].nindex) {
- cd->tocent[i].indexes[1] = cd->tocent[i].indexes[0];
- cd->tocent[i].nindex++;
- }
- cd->tocent[i].indexes[cd->tocent[i].nindex++] =
- cdio_mmssff_to_lba (psz_field) + cd->tocent[i].indexes[0];
-#else
- ;
-
-#endif
- }
- } else {
- goto format_error;
- }
- if (NULL != (psz_field = strtok (NULL, " \t\n\r"))) {
- goto format_error;
- }
- } else {
- goto not_in_global_section;
- }
-
- /* CD_TEXT { ... } */
- /* todo: opening { must be on same line as CD_TEXT */
- } else if (0 == strcmp ("CD_TEXT", psz_keyword)) {
- if (NULL == (psz_field = strtok (NULL, " \t\n\r"))) {
- goto format_error;
- }
- if ( 0 == strcmp( "{", psz_field ) ) {
- i_cdtext_nest++;
- } else {
- cdio_log (log_level,
- "%s line %d: expecting '{'", psz_cue_name, i_line);
- goto err_exit;
- }
-
- } else if (0 == strcmp ("LANGUAGE_MAP", psz_keyword)) {
- /* LANGUAGE d { ... } */
- } else if (0 == strcmp ("LANGUAGE", psz_keyword)) {
- if (NULL == (psz_field = strtok (NULL, " \t\n\r"))) {
- goto format_error;
- }
- /* Language number */
- if (NULL == (psz_field = strtok (NULL, " \t\n\r"))) {
- goto format_error;
- }
- if ( 0 == strcmp( "{", psz_field ) ) {
- i_cdtext_nest++;
- }
- } else if (0 == strcmp ("{", psz_keyword)) {
- i_cdtext_nest++;
- } else if (0 == strcmp ("}", psz_keyword)) {
- if (i_cdtext_nest > 0) i_cdtext_nest--;
- } else if ( CDTEXT_INVALID !=
- (cdtext_key = cdtext_is_keyword (psz_keyword)) ) {
- if (-1 == i) {
- if (NULL != cd) {
- cdtext_set (cdtext_key,
- strtok (NULL, "\"\t\n\r"),
- &(cd->gen.cdtext));
- }
- } else {
- if (NULL != cd) {
- cdtext_set (cdtext_key,
- strtok (NULL, "\"\t\n\r"),
- &(cd->gen.cdtext_track[i]));
- }
- }
-
- /* unrecognized line */
- } else {
- cdio_log(log_level, "%s line %d: warning: unrecognized word: %s",
- psz_cue_name, i_line, psz_keyword);
- goto err_exit;
- }
- }
- }
-
- if (NULL != cd) {
- cd->gen.i_tracks = i+1;
- cd->gen.toc_init = true;
- }
-
- fclose (fp);
- return true;
-
- unimplimented_error:
- UNIMPLIMENTED_MSG;
- goto err_exit;
-
- format_error:
- cdio_log(log_level, "%s line %d after word %s",
- psz_cue_name, i_line, psz_keyword);
- goto err_exit;
-
- not_in_global_section:
- cdio_log(log_level, "%s line %d: word %s only allowed in global section",
- psz_cue_name, i_line, psz_keyword);
-
- err_exit:
- fclose (fp);
- return false;
-}
-
-/*!
- Reads a single audio sector from CD device into data starting
- from lsn. Returns 0 if no error.
- */
-static int
-_read_audio_sectors_cdrdao (void *user_data, void *data, lsn_t lsn,
- unsigned int nblocks)
-{
- _img_private_t *env = user_data;
- int ret;
-
- /* Why the adjustment of 272, I don't know. It seems to work though */
- if (lsn != 0) {
- ret = cdio_stream_seek (env->tocent[0].data_source,
- (lsn * CDIO_CD_FRAMESIZE_RAW) - 272, SEEK_SET);
- if (ret!=0) return ret;
-
- ret = cdio_stream_read (env->tocent[0].data_source, data,
- CDIO_CD_FRAMESIZE_RAW, nblocks);
- } else {
- /* We need to pad out the first 272 bytes with 0's */
- BZERO(data, 272);
-
- ret = cdio_stream_seek (env->tocent[0].data_source, 0, SEEK_SET);
-
- if (ret!=0) return ret;
-
- ret = cdio_stream_read (env->tocent[0].data_source, (uint8_t *) data+272,
- CDIO_CD_FRAMESIZE_RAW - 272, nblocks);
- }
-
- /* ret is number of bytes if okay, but we need to return 0 okay. */
- return ret == 0;
-}
-
-/*!
- Reads a single mode2 sector from cd device into data starting
- from lsn. Returns 0 if no error.
- */
-static int
-_read_mode1_sector_cdrdao (void *user_data, void *data, lsn_t lsn,
- bool b_form2)
-{
- _img_private_t *env = user_data;
- int ret;
- char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, };
-
- ret = cdio_stream_seek (env->tocent[0].data_source,
- lsn * CDIO_CD_FRAMESIZE_RAW, SEEK_SET);
- if (ret!=0) return ret;
-
- /* FIXME: Not completely sure the below is correct. */
- ret = cdio_stream_read (env->tocent[0].data_source, buf,
- CDIO_CD_FRAMESIZE_RAW, 1);
- if (ret==0) return ret;
-
- memcpy (data, buf + CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE,
- b_form2 ? M2RAW_SECTOR_SIZE: CDIO_CD_FRAMESIZE);
-
- return 0;
-}
-
-/*!
- Reads nblocks of mode1 sectors from cd device into data starting
- from lsn.
- Returns 0 if no error.
- */
-static int
-_read_mode1_sectors_cdrdao (void *user_data, void *data, lsn_t lsn,
- bool b_form2, unsigned int nblocks)
-{
- _img_private_t *env = user_data;
- int i;
- int retval;
- unsigned int blocksize = b_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE;
-
- for (i = 0; i < nblocks; i++) {
- if ( (retval = _read_mode1_sector_cdrdao (env,
- ((char *)data) + (blocksize * i),
- lsn + i, b_form2)) )
- return retval;
- }
- return 0;
-}
-
-/*!
- Reads a single mode1 sector from cd device into data starting
- from lsn. Returns 0 if no error.
- */
-static int
-_read_mode2_sector_cdrdao (void *user_data, void *data, lsn_t lsn,
- bool b_form2)
-{
- _img_private_t *env = user_data;
- int ret;
- char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, };
-
- /* NOTE: The logic below seems a bit wrong and convoluted
- to me, but passes the regression tests. (Perhaps it is why we get
- valgrind errors in vcdxrip). Leave it the way it was for now.
- Review this sector 2336 stuff later.
- */
-
- ret = cdio_stream_seek (env->tocent[0].data_source,
- lsn * CDIO_CD_FRAMESIZE_RAW, SEEK_SET);
- if (ret!=0) return ret;
-
- ret = cdio_stream_read (env->tocent[0].data_source, buf,
- CDIO_CD_FRAMESIZE_RAW, 1);
- if (ret==0) return ret;
-
-
- /* See NOTE above. */
- if (b_form2)
- memcpy (data, buf + CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE,
- M2RAW_SECTOR_SIZE);
- else
- memcpy (data, buf + CDIO_CD_XA_SYNC_HEADER, CDIO_CD_FRAMESIZE);
-
- return 0;
-}
-
-/*!
- Reads nblocks of mode2 sectors from cd device into data starting
- from lsn.
- Returns 0 if no error.
- */
-static int
-_read_mode2_sectors_cdrdao (void *user_data, void *data, lsn_t lsn,
- bool b_form2, unsigned int nblocks)
-{
- _img_private_t *env = user_data;
- int i;
- int retval;
-
- for (i = 0; i < nblocks; i++) {
- if ( (retval = _read_mode2_sector_cdrdao (env,
- ((char *)data) + (CDIO_CD_FRAMESIZE * i),
- lsn + i, b_form2)) )
- return retval;
- }
- return 0;
-}
-
-/*!
- Return an array of strings giving possible TOC disk images.
- */
-char **
-cdio_get_devices_cdrdao (void)
-{
- char **drives = NULL;
- unsigned int num_files=0;
-#ifdef HAVE_GLOB_H
- unsigned int i;
- glob_t globbuf;
- globbuf.gl_offs = 0;
- glob("*.toc", GLOB_DOOFFS, NULL, &globbuf);
- for (i=0; i<globbuf.gl_pathc; i++) {
- cdio_add_device_list(&drives, globbuf.gl_pathv[i], &num_files);
- }
- globfree(&globbuf);
-#else
- cdio_add_device_list(&drives, DEFAULT_CDIO_DEVICE, &num_files);
-#endif /*HAVE_GLOB_H*/
- cdio_add_device_list(&drives, NULL, &num_files);
- return drives;
-}
-
-/*!
- Return a string containing the default CD device.
- */
-char *
-cdio_get_default_device_cdrdao(void)
-{
- char **drives = cdio_get_devices_nrg();
- char *drive = (drives[0] == NULL) ? NULL : strdup(drives[0]);
- cdio_free_device_list(drives);
- return drive;
-}
-
-static bool
-get_hwinfo_cdrdao ( const CdIo *p_cdio, /*out*/ cdio_hwinfo_t *hw_info)
-{
- strcpy(hw_info->psz_vendor, "libcdio");
- strcpy(hw_info->psz_model, "cdrdao");
- strcpy(hw_info->psz_revision, CDIO_VERSION);
- return true;
-
-}
-
-/*!
- Return the number of tracks in the current medium.
- CDIO_INVALID_TRACK is returned on error.
-*/
-static track_format_t
-_get_track_format_cdrdao(void *user_data, track_t i_track)
-{
- _img_private_t *env = user_data;
-
- if (!env->gen.init) _init_cdrdao(env);
-
- if (i_track > env->gen.i_tracks || i_track == 0)
- return TRACK_FORMAT_ERROR;
-
- return env->tocent[i_track-env->gen.i_first_track].track_format;
-}
-
-/*!
- Return true if we have XA data (green, mode2 form1) or
- XA data (green, mode2 form2). That is track begins:
- sync - header - subheader
- 12 4 - 8
-
- FIXME: there's gotta be a better design for this and get_track_format?
-*/
-static bool
-_get_track_green_cdrdao(void *user_data, track_t i_track)
-{
- _img_private_t *env = user_data;
-
- if (!env->gen.init) _init_cdrdao(env);
-
- if (i_track > env->gen.i_tracks || i_track == 0)
- return false;
-
- return env->tocent[i_track-env->gen.i_first_track].track_green;
-}
-
-/*!
- Return the starting LSN track number
- i_track in obj. Track numbers start at 1.
- The "leadout" track is specified either by
- using i_track LEADOUT_TRACK or the total tracks+1.
- False is returned if there is no track entry.
-*/
-static lba_t
-_get_lba_track_cdrdao(void *user_data, track_t i_track)
-{
- _img_private_t *env = user_data;
- _init_cdrdao (env);
-
- if (i_track == CDIO_CDROM_LEADOUT_TRACK)
- i_track = env->gen.i_tracks+1;
-
- if (i_track <= env->gen.i_tracks+1 && i_track != 0) {
- return env->tocent[i_track-1].start_lba;
- } else
- return CDIO_INVALID_LBA;
-}
-
-/*!
- Check that a TOC file is valid. We parse the entire file.
-
-*/
-bool
-cdio_is_tocfile(const char *psz_cue_name)
-{
- int i;
-
- if (psz_cue_name == NULL) return false;
-
- i=strlen(psz_cue_name)-strlen("toc");
-
- if (i>0) {
- if ( (psz_cue_name[i]=='t' && psz_cue_name[i+1]=='o' && psz_cue_name[i+2]=='c')
- || (psz_cue_name[i]=='T' && psz_cue_name[i+1]=='O' && psz_cue_name[i+2]=='C') ) {
- return parse_tocfile(NULL, psz_cue_name);
- }
- }
- return false;
-}
-
-/*!
- Initialization routine. This is the only thing that doesn't
- get called via a function pointer. In fact *we* are the
- ones to set that up.
- */
-CdIo *
-cdio_open_am_cdrdao (const char *psz_source_name, const char *psz_access_mode)
-{
- if (psz_access_mode != NULL && strcmp(psz_access_mode, "image"))
- cdio_warn ("there is only one access mode, 'image' for cdrdao. Arg %s ignored",
- psz_access_mode);
- return cdio_open_cdrdao(psz_source_name);
-}
-
-/*!
- Initialization routine. This is the only thing that doesn't
- get called via a function pointer. In fact *we* are the
- ones to set that up.
- */
-CdIo *
-cdio_open_cdrdao (const char *psz_cue_name)
-{
- CdIo *ret;
- _img_private_t *_data;
-
- cdio_funcs _funcs;
-
- memset( &_funcs, 0, sizeof(_funcs) );
-
- _funcs.eject_media = _eject_media_image;
- _funcs.free = _free_image;
- _funcs.get_arg = _get_arg_image;
- _funcs.get_cdtext = get_cdtext_generic;
- _funcs.get_devices = cdio_get_devices_cdrdao;
- _funcs.get_default_device = cdio_get_default_device_cdrdao;
- _funcs.get_discmode = _get_discmode_image;
- _funcs.get_drive_cap = _get_drive_cap_image;
- _funcs.get_first_track_num= _get_first_track_num_image;
- _funcs.get_hwinfo = get_hwinfo_cdrdao;
- _funcs.get_mcn = _get_mcn_image;
- _funcs.get_num_tracks = _get_num_tracks_image;
- _funcs.get_track_format = _get_track_format_cdrdao;
- _funcs.get_track_green = _get_track_green_cdrdao;
- _funcs.get_track_lba = _get_lba_track_cdrdao;
- _funcs.get_track_msf = _get_track_msf_image;
- _funcs.lseek = _lseek_cdrdao;
- _funcs.read = _read_cdrdao;
- _funcs.read_audio_sectors = _read_audio_sectors_cdrdao;
- _funcs.read_mode1_sector = _read_mode1_sector_cdrdao;
- _funcs.read_mode1_sectors = _read_mode1_sectors_cdrdao;
- _funcs.read_mode2_sector = _read_mode2_sector_cdrdao;
- _funcs.read_mode2_sectors = _read_mode2_sectors_cdrdao;
- _funcs.set_arg = _set_arg_image;
- _funcs.stat_size = _stat_size_cdrdao;
-
- if (NULL == psz_cue_name) return NULL;
-
- _data = _cdio_malloc (sizeof (_img_private_t));
- _data->gen.init = false;
- _data->psz_cue_name = NULL;
- _data->gen.data_source = NULL;
- _data->gen.source_name = NULL;
-
- ret = cdio_new ((void *)_data, &_funcs);
-
- if (ret == NULL) {
- free(_data);
- return NULL;
- }
-
- if (!cdio_is_tocfile(psz_cue_name)) {
- cdio_debug ("source name %s is not recognized as a TOC file",
- psz_cue_name);
- return NULL;
- }
-
- _set_arg_image (_data, "cue", psz_cue_name);
- _set_arg_image (_data, "source", psz_cue_name);
-
- if (_init_cdrdao(_data)) {
- return ret;
- } else {
- _free_image(_data);
- free(ret);
- return NULL;
- }
-}
-
-bool
-cdio_have_cdrdao (void)
-{
- return true;
-}
diff --git a/src/input/vcd/libcdio/image/nrg.c b/src/input/vcd/libcdio/image/nrg.c
deleted file mode 100644
index 40e5bbbf7..000000000
--- a/src/input/vcd/libcdio/image/nrg.c
+++ /dev/null
@@ -1,1274 +0,0 @@
-/*
- $Id: nrg.c,v 1.3 2005/05/07 22:07:27 rockyb Exp $
-
- Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
- Copyright (C) 2001, 2003 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-/*! This code implements low-level access functions for the Nero native
- CD-image format residing inside a disk file (*.nrg).
-*/
-
-#include "image.h"
-
-#ifdef HAVE_STDIO_H
-#include <stdio.h>
-#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-#ifdef HAVE_GLOB_H
-#include <glob.h>
-#endif
-
-#include <cdio/bytesex.h>
-#include <cdio/ds.h>
-#include <cdio/logging.h>
-#include <cdio/util.h>
-#include <cdio/version.h>
-#include "cdio_assert.h"
-#include "_cdio_stdio.h"
-#include "nrg.h"
-
-static const char _rcsid[] = "$Id: nrg.c,v 1.3 2005/05/07 22:07:27 rockyb Exp $";
-
-
-/* reader */
-
-#define DEFAULT_CDIO_DEVICE "image.nrg"
-
-/*
- Link element of track structure as a linked list.
- Possibly redundant with above track_info_t */
-typedef struct {
- uint32_t start_lsn;
- uint32_t sec_count; /* Number of sectors in track. Does not
- include pregap before next entry. */
- uint64_t img_offset; /* Bytes offset from beginning of disk image file.*/
- uint32_t blocksize; /* Number of bytes in a block */
- int flags; /* don't copy, 4 channel, pre-emphasis */
-} _mapping_t;
-
-
-typedef struct {
- /* Things common to all drivers like this.
- This must be first. */
- generic_img_private_t gen;
- internal_position_t pos;
-
- /* This is common to all image drivers... */
- char *psz_cue_name;
- char *psz_mcn; /* Media Catalog Number (5.22.3) */
-
- track_info_t tocent[CDIO_CD_MAX_TRACKS+1]; /* entry info for each track
- add 1 for leadout. */
- discmode_t disc_mode;
-
- /* Nero Specific stuff. Note: for the image_free to work, this *must*
- be last. */
- bool is_dao; /* True if some of disk at once. False
- if some sort of track at once. */
- uint32_t mtyp; /* Value of MTYP (media type?) tag */
- uint8_t dtyp; /* Value of DAOX media type tag */
-
- /* This is a hack because I don't really understnad NERO better. */
- bool is_cues;
-
- CdioList *mapping; /* List of track information */
- uint32_t size;
-} _img_private_t;
-
-static bool parse_nrg (_img_private_t *env, const char *psz_cue_name);
-static uint32_t _stat_size_nrg (void *user_data);
-
-#include "image_common.h"
-
-/* Updates internal track TOC, so we can later
- simulate ioctl(CDROMREADTOCENTRY).
- */
-static void
-_register_mapping (_img_private_t *env, lsn_t start_lsn, uint32_t sec_count,
- uint64_t img_offset, uint32_t blocksize,
- track_format_t track_format, bool track_green,
- int flags)
-{
- const int track_num=env->gen.i_tracks;
- track_info_t *this_track=&(env->tocent[env->gen.i_tracks]);
- _mapping_t *_map = _cdio_malloc (sizeof (_mapping_t));
-
- _map->start_lsn = start_lsn;
- _map->sec_count = sec_count;
- _map->img_offset = img_offset;
- _map->blocksize = blocksize;
- _map->flags = flags;
-
- if (!env->mapping) env->mapping = _cdio_list_new ();
- _cdio_list_append (env->mapping, _map);
-
- env->size = MAX (env->size, (start_lsn + sec_count));
-
- /* Update *this_track and track_num. These structures are
- in a sense redundant witht the obj->mapping list. Perhaps one
- or the other can be eliminated.
- */
-
- cdio_lba_to_msf (cdio_lsn_to_lba(start_lsn), &(this_track->start_msf));
- this_track->start_lba = cdio_msf_to_lba(&this_track->start_msf);
- this_track->track_num = track_num+1;
- this_track->blocksize = blocksize;
- if (env->is_cues)
- this_track->datastart = img_offset;
- else
- this_track->datastart = 0;
-
- if (track_green)
- this_track->datastart += CDIO_CD_SUBHEADER_SIZE;
-
- this_track->sec_count = sec_count;
-
- this_track->track_format= track_format;
- this_track->track_green = track_green;
-
- switch (this_track->track_format) {
- case TRACK_FORMAT_AUDIO:
- this_track->blocksize = CDIO_CD_FRAMESIZE_RAW;
- this_track->datasize = CDIO_CD_FRAMESIZE_RAW;
- /*this_track->datastart = 0;*/
- this_track->endsize = 0;
- break;
- case TRACK_FORMAT_CDI:
- this_track->datasize=CDIO_CD_FRAMESIZE;
- break;
- case TRACK_FORMAT_XA:
- if (track_green) {
- this_track->blocksize = CDIO_CD_FRAMESIZE;
- /*this_track->datastart = CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE;*/
- this_track->datasize = M2RAW_SECTOR_SIZE;
- this_track->endsize = 0;
- } else {
- /*this_track->datastart = CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE +
- CDIO_CD_SUBHEADER_SIZE;*/
- this_track->datasize = CDIO_CD_FRAMESIZE;
- this_track->endsize = CDIO_CD_SYNC_SIZE + CDIO_CD_ECC_SIZE;
- }
- break;
- case TRACK_FORMAT_DATA:
- if (track_green) {
- /*this_track->datastart = CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE;*/
- this_track->datasize = CDIO_CD_FRAMESIZE;
- this_track->endsize = CDIO_CD_EDC_SIZE + CDIO_CD_M1F1_ZERO_SIZE
- + CDIO_CD_ECC_SIZE;
- } else {
- /* Is the below correct? */
- /*this_track->datastart = 0;*/
- this_track->datasize = CDIO_CD_FRAMESIZE;
- this_track->endsize = 0;
- }
- break;
- default:
- /*this_track->datasize=CDIO_CD_FRAMESIZE_RAW;*/
- cdio_warn ("track %d has unknown format %d",
- env->gen.i_tracks, this_track->track_format);
- }
-
- env->gen.i_tracks++;
-
- cdio_debug ("start lsn: %lu sector count: %0lu -> %8ld (%08lx)",
- (long unsigned int) start_lsn,
- (long unsigned int) sec_count,
- (long unsigned int) img_offset,
- (long unsigned int) img_offset);
-}
-
-
-/*
- Disk and track information for a Nero file are located at the end
- of the file. This routine extracts that information.
-
- FIXME: right now psz_nrg_name is not used. It will be in the future.
- */
-static bool
-parse_nrg (_img_private_t *env, const char *psz_nrg_name)
-{
- long unsigned int footer_start;
- long unsigned int size;
- char *footer_buf = NULL;
- cdio_log_level_t log_level = (NULL == env) ? CDIO_LOG_INFO : CDIO_LOG_WARN;
-
- size = cdio_stream_stat (env->gen.data_source);
- if (-1 == size) return false;
-
- {
- _footer_t buf;
- cdio_assert (sizeof (buf) == 12);
-
- cdio_stream_seek (env->gen.data_source, size - sizeof (buf), SEEK_SET);
- cdio_stream_read (env->gen.data_source, (void *) &buf, sizeof (buf), 1);
-
- if (buf.v50.ID == UINT32_TO_BE (NERO_ID)) {
- cdio_info ("detected Nero version 5.0 (32-bit offsets) NRG magic");
- footer_start = uint32_to_be (buf.v50.footer_ofs);
- } else if (buf.v55.ID == UINT32_TO_BE (NER5_ID)) {
- cdio_info ("detected Nero version 5.5.x (64-bit offsets) NRG magic");
- footer_start = uint64_from_be (buf.v55.footer_ofs);
- } else {
- cdio_log (log_level, "Image not recognized as either version 5.0 or "
- "version 5.5.x-6.x type NRG");
- return false;
- }
-
- cdio_debug (".NRG footer start = %ld, length = %ld",
- (long) footer_start, (long) (size - footer_start));
-
- cdio_assert (IN ((size - footer_start), 0, 4096));
-
- footer_buf = _cdio_malloc (size - footer_start);
-
- cdio_stream_seek (env->gen.data_source, footer_start, SEEK_SET);
- cdio_stream_read (env->gen.data_source, footer_buf,
- size - footer_start, 1);
- }
- {
- int pos = 0;
-
- while (pos < size - footer_start) {
- _chunk_t *chunk = (void *) (footer_buf + pos);
- uint32_t opcode = UINT32_FROM_BE (chunk->id);
-
- bool break_out = false;
-
- switch (opcode) {
-
- case CUES_ID: /* "CUES" Seems to have sector size 2336 and 150 sector
- pregap seems to be included at beginning of image.
- */
- case CUEX_ID: /* "CUEX" */
- {
- unsigned entries = UINT32_FROM_BE (chunk->len);
- _cuex_array_t *_entries = (void *) chunk->data;
-
- cdio_assert (env->mapping == NULL);
-
- cdio_assert ( sizeof (_cuex_array_t) == 8 );
- cdio_assert ( UINT32_FROM_BE (chunk->len) % sizeof(_cuex_array_t)
- == 0 );
-
- entries /= sizeof (_cuex_array_t);
-
- if (CUES_ID == opcode) {
- lsn_t lsn = UINT32_FROM_BE (_entries[0].lsn);
- int idx;
-
- cdio_info ("CUES type image detected" );
-
- /* CUES LSN has 150 pregap include at beginning? -/
- cdio_assert (lsn == 0?);
- */
-
- env->is_cues = true; /* HACK alert. */
- env->gen.i_tracks = 0;
- env->gen.i_first_track = 1;
- for (idx = 1; idx < entries-1; idx += 2) {
- lsn_t sec_count;
- int addrtype = _entries[idx].addr_ctrl / 16;
- int control = _entries[idx].addr_ctrl % 16;
- int flags = 0;
- if ( 1 == control )
- flags &= ~CDIO_TRACK_FLAG_COPY_PERMITTED;
-
- cdio_assert (_entries[idx].track == _entries[idx + 1].track);
-
- /* lsn and sec_count*2 aren't correct, but it comes closer on the
- single example I have: svcdgs.nrg
- We are picking up the wrong fields and/or not interpreting
- them correctly.
- */
-
- switch (addrtype) {
- case 0:
- lsn = UINT32_FROM_BE (_entries[idx].lsn);
- break;
- case 1:
- {
-#if 0
- msf_t msf = (msf_t) _entries[idx].lsn;
- lsn = cdio_msf_to_lsn(&msf);
-#else
- lsn = CDIO_INVALID_LSN;
-#endif
- cdio_warn ("untested (i.e. probably wrong) CUE MSF code");
- break;
- }
- default:
- lsn = CDIO_INVALID_LSN;
- cdio_warn("unknown addrtype %d", addrtype);
- }
-
- sec_count = UINT32_FROM_BE (_entries[idx + 1].lsn);
-
- _register_mapping (env, lsn, sec_count*2,
- (lsn+CDIO_PREGAP_SECTORS) * M2RAW_SECTOR_SIZE,
- M2RAW_SECTOR_SIZE, TRACK_FORMAT_XA, true,
- flags);
- }
- } else {
- lsn_t lsn = UINT32_FROM_BE (_entries[0].lsn);
- int idx;
-
- cdio_info ("CUEX type image detected");
-
- /* LSN must start at -150 (LBA 0)? */
- cdio_assert (lsn == -150);
-
- for (idx = 2; idx < entries; idx += 2) {
- lsn_t sec_count;
- int addrtype = _entries[idx].addr_ctrl >> 4;
- int control = _entries[idx].addr_ctrl & 0xf;
- int flags = 0;
- if ( 1 == control )
- flags &= ~CDIO_TRACK_FLAG_COPY_PERMITTED;
-
- /* extractnrg.pl has addrtype for LBA's 0, and
- for MSF 1. ???
-
- FIXME: Should decode as appropriate for addrtype.
- */
- cdio_assert ( addrtype == 0 || addrtype == 1 );
-
- cdio_assert (_entries[idx].track != _entries[idx + 1].track);
-
- lsn = UINT32_FROM_BE (_entries[idx].lsn);
- sec_count = UINT32_FROM_BE (_entries[idx + 1].lsn);
-
- _register_mapping (env, lsn, sec_count - lsn,
- (lsn + CDIO_PREGAP_SECTORS)*M2RAW_SECTOR_SIZE,
- M2RAW_SECTOR_SIZE, TRACK_FORMAT_XA, true,
- flags);
- }
- }
- break;
- }
-
- case DAOX_ID: /* "DAOX" */
- case DAOI_ID: /* "DAOI" */
- {
- track_format_t track_format;
- int form2;
-
- /* We include an extra 0 byte so these can be used as C strings.*/
- env->psz_mcn = _cdio_malloc (CDIO_MCN_SIZE+1);
-
- if (DAOX_ID == opcode) {
- _daox_array_t *_entries = (void *) chunk->data;
- form2 = _entries->_unknown[1];
- env->dtyp = _entries->_unknown[19];
- memcpy(env->psz_mcn, &(_entries->psz_mcn), CDIO_MCN_SIZE);
- env->psz_mcn[CDIO_MCN_SIZE] = '\0';
- } else {
- _daoi_array_t *_entries = (void *) chunk->data;
- form2 = _entries->_unknown[1];
- env->dtyp = _entries->_unknown[19];
- memcpy(env->psz_mcn, &(_entries->psz_mcn), CDIO_MCN_SIZE);
- env->psz_mcn[CDIO_MCN_SIZE] = '\0';
- }
-
- env->is_dao = true;
- cdio_debug ("DAO%c tag detected, track format %d, form %x\n",
- opcode==DAOX_ID ? 'X': 'I', env->dtyp, form2);
- switch (env->dtyp) {
- case 0:
- /* Mode 1 */
- track_format = TRACK_FORMAT_DATA;
- env->disc_mode = CDIO_DISC_MODE_CD_DATA;
- break;
- case 2:
- /* Mode 2 form 1 */
- form2 = 0;
- track_format = TRACK_FORMAT_XA;
- env->disc_mode = CDIO_DISC_MODE_CD_XA;
- break;
- case 3:
- /* Mode 2 */
- track_format = TRACK_FORMAT_XA;
- env->disc_mode = CDIO_DISC_MODE_CD_XA; /* ?? */
- break;
- case 0x6:
- /* Mode2 form mix */
- track_format = TRACK_FORMAT_XA;
- env->disc_mode = CDIO_DISC_MODE_CD_MIXED;
- break;
- case 0x20: /* ??? Mode2 form 2, Mode2 raw?? */
- track_format = TRACK_FORMAT_XA;
- env->disc_mode = CDIO_DISC_MODE_CD_XA; /* ??. */
- break;
- case 0x7:
- track_format = TRACK_FORMAT_AUDIO;
- env->disc_mode = CDIO_DISC_MODE_CD_DA;
- break;
- default:
- cdio_log (log_level, "Unknown track format %x\n",
- env->dtyp);
- track_format = TRACK_FORMAT_AUDIO;
- }
- if (0 == form2) {
- int i;
- for (i=0; i<env->gen.i_tracks; i++) {
- cdtext_init (&(env->gen.cdtext_track[i]));
- env->tocent[i].track_format= track_format;
- env->tocent[i].datastart = 0;
- env->tocent[i].track_green = false;
- if (TRACK_FORMAT_AUDIO == track_format) {
- env->tocent[i].blocksize = CDIO_CD_FRAMESIZE_RAW;
- env->tocent[i].datasize = CDIO_CD_FRAMESIZE_RAW;
- env->tocent[i].endsize = 0;
- } else {
- env->tocent[i].datasize = CDIO_CD_FRAMESIZE;
- env->tocent[i].datastart = 0;
- }
- }
- } else if (2 == form2) {
- int i;
- for (i=0; i<env->gen.i_tracks; i++) {
- cdtext_init (&(env->gen.cdtext_track[i]));
- env->tocent[i].track_green = true;
- env->tocent[i].track_format= track_format;
- env->tocent[i].datasize = CDIO_CD_FRAMESIZE;
- if (TRACK_FORMAT_XA == track_format) {
- env->tocent[i].datastart = CDIO_CD_SYNC_SIZE
- + CDIO_CD_HEADER_SIZE + CDIO_CD_SUBHEADER_SIZE;
- env->tocent[i].endsize = CDIO_CD_SYNC_SIZE
- + CDIO_CD_ECC_SIZE;
- } else {
- env->tocent[i].datastart = CDIO_CD_SYNC_SIZE
- + CDIO_CD_HEADER_SIZE;
- env->tocent[i].endsize = CDIO_CD_EDC_SIZE
- + CDIO_CD_M1F1_ZERO_SIZE + CDIO_CD_ECC_SIZE;
-
- }
- }
- } else {
- cdio_log (log_level, "Don't know if form1 or form2 form2: %x\n",
- form2);
- }
- break;
- }
- case NERO_ID:
- case NER5_ID:
- cdio_error ("unexpected nrg magic ID NER%c detected",
- opcode==NERO_ID ? 'O': '5');
- free(footer_buf);
- return false;
- break;
-
- case END1_ID: /* "END!" */
- cdio_debug ("nrg end tag detected");
- break_out = true;
- break;
-
- case ETNF_ID: /* "ETNF" */ {
- unsigned entries = UINT32_FROM_BE (chunk->len);
- _etnf_array_t *_entries = (void *) chunk->data;
-
- cdio_assert (env->mapping == NULL);
-
- cdio_assert ( sizeof (_etnf_array_t) == 20 );
- cdio_assert ( UINT32_FROM_BE(chunk->len) % sizeof(_etnf_array_t)
- == 0 );
-
- entries /= sizeof (_etnf_array_t);
-
- cdio_info ("SAO type image (ETNF) detected");
-
- {
- int idx;
- for (idx = 0; idx < entries; idx++) {
- uint32_t _len = UINT32_FROM_BE (_entries[idx].length);
- uint32_t _start = UINT32_FROM_BE (_entries[idx].start_lsn);
- uint32_t _start2 = UINT32_FROM_BE (_entries[idx].start);
- uint32_t track_mode= uint32_from_be (_entries[idx].type);
- bool track_green = true;
- track_format_t track_format = TRACK_FORMAT_XA;
- uint16_t blocksize;
-
- switch (track_mode) {
- case 0:
- /* Mode 1 */
- track_format = TRACK_FORMAT_DATA;
- track_green = false; /* ?? */
- blocksize = CDIO_CD_FRAMESIZE;
- env->disc_mode = CDIO_DISC_MODE_CD_DATA;
- break;
- case 2:
- /* Mode 2 form 1 */
- track_format = TRACK_FORMAT_XA;
- track_green = false; /* ?? */
- blocksize = CDIO_CD_FRAMESIZE;
- env->disc_mode = CDIO_DISC_MODE_CD_XA;
- break;
- case 3:
- /* Mode 2 */
- track_format = TRACK_FORMAT_XA;
- track_green = true;
- blocksize = M2RAW_SECTOR_SIZE;
- env->disc_mode = CDIO_DISC_MODE_CD_XA; /* ?? */
- break;
- case 06:
- /* Mode2 form mix */
- track_format = TRACK_FORMAT_XA;
- track_green = true;
- blocksize = M2RAW_SECTOR_SIZE;
- env->disc_mode = CDIO_DISC_MODE_CD_MIXED;
- break;
- case 0x20: /* ??? Mode2 form 2, Mode2 raw?? */
- track_format = TRACK_FORMAT_XA;
- track_green = true;
- blocksize = M2RAW_SECTOR_SIZE;
- env->disc_mode = CDIO_DISC_MODE_CD_XA; /* ??. */
- break;
- case 7:
- track_format = TRACK_FORMAT_AUDIO;
- track_green = false;
- blocksize = CDIO_CD_FRAMESIZE_RAW;
- env->disc_mode = CDIO_DISC_MODE_CD_DA;
- break;
- default:
- cdio_log (log_level,
- "Don't know how to handle track mode (%lu)?",
- (long unsigned int) track_mode);
- free(footer_buf);
- return false;
- }
-
- cdio_assert (_len % blocksize == 0);
-
- _len /= blocksize;
-
- cdio_assert (_start * blocksize == _start2);
-
- _start += idx * CDIO_PREGAP_SECTORS;
- _register_mapping (env, _start, _len, _start2, blocksize,
- track_format, track_green, 0);
-
- }
- }
- break;
- }
-
- case ETN2_ID: { /* "ETN2", same as above, but with 64bit stuff instead */
- unsigned entries = uint32_from_be (chunk->len);
- _etn2_array_t *_entries = (void *) chunk->data;
-
- cdio_assert (env->mapping == NULL);
-
- cdio_assert (sizeof (_etn2_array_t) == 32);
- cdio_assert (uint32_from_be (chunk->len) % sizeof (_etn2_array_t) == 0);
-
- entries /= sizeof (_etn2_array_t);
-
- cdio_info ("SAO type image (ETN2) detected");
-
- {
- int idx;
- for (idx = 0; idx < entries; idx++) {
- uint32_t _len = uint64_from_be (_entries[idx].length);
- uint32_t _start = uint32_from_be (_entries[idx].start_lsn);
- uint32_t _start2 = uint64_from_be (_entries[idx].start);
- uint32_t track_mode= uint32_from_be (_entries[idx].type);
- bool track_green = true;
- track_format_t track_format = TRACK_FORMAT_XA;
- uint16_t blocksize;
-
-
- switch (track_mode) {
- case 0:
- track_format = TRACK_FORMAT_DATA;
- track_green = false; /* ?? */
- blocksize = CDIO_CD_FRAMESIZE;
- break;
- case 2:
- track_format = TRACK_FORMAT_XA;
- track_green = false; /* ?? */
- blocksize = CDIO_CD_FRAMESIZE;
- break;
- case 3:
- track_format = TRACK_FORMAT_XA;
- track_green = true;
- blocksize = M2RAW_SECTOR_SIZE;
- break;
- case 7:
- track_format = TRACK_FORMAT_AUDIO;
- track_green = false;
- blocksize = CDIO_CD_FRAMESIZE_RAW;
- break;
- default:
- cdio_log (log_level,
- "Don't know how to handle track mode (%lu)?",
- (long unsigned int) track_mode);
- free(footer_buf);
- return false;
- }
-
- if (_len % blocksize != 0) {
- cdio_log (log_level,
- "length is not a multiple of blocksize "
- "len %lu, size %d, rem %lu",
- (long unsigned int) _len, blocksize,
- (long unsigned int) _len % blocksize);
- if (0 == _len % CDIO_CD_FRAMESIZE) {
- cdio_log(log_level, "Adjusting blocksize to %d",
- CDIO_CD_FRAMESIZE);
- blocksize = CDIO_CD_FRAMESIZE;
- } else if (0 == _len % M2RAW_SECTOR_SIZE) {
- cdio_log(log_level,
- "Adjusting blocksize to %d", M2RAW_SECTOR_SIZE);
- blocksize = M2RAW_SECTOR_SIZE;
- } else if (0 == _len % CDIO_CD_FRAMESIZE_RAW) {
- cdio_log(log_level,
- "Adjusting blocksize to %d", CDIO_CD_FRAMESIZE_RAW);
- blocksize = CDIO_CD_FRAMESIZE_RAW;
- }
- }
-
- _len /= blocksize;
-
- if (_start * blocksize != _start2) {
- cdio_log (log_level,
- "%lu * %d != %lu",
- (long unsigned int) _start, blocksize,
- (long unsigned int) _start2);
- if (_start * CDIO_CD_FRAMESIZE == _start2) {
- cdio_log(log_level,
- "Adjusting blocksize to %d", CDIO_CD_FRAMESIZE);
- blocksize = CDIO_CD_FRAMESIZE;
- } else if (_start * M2RAW_SECTOR_SIZE == _start2) {
- cdio_log(log_level,
- "Adjusting blocksize to %d", M2RAW_SECTOR_SIZE);
- blocksize = M2RAW_SECTOR_SIZE;
- } else if (_start * CDIO_CD_FRAMESIZE_RAW == _start2) {
- cdio_log(log_level,
- "Adjusting blocksize to %d", CDIO_CD_FRAMESIZE_RAW);
- blocksize = CDIO_CD_FRAMESIZE_RAW;
- }
- }
-
- _start += idx * CDIO_PREGAP_SECTORS;
- _register_mapping (env, _start, _len, _start2, blocksize,
- track_format, track_green, 0);
- }
- }
- break;
- }
-
- case SINF_ID: { /* "SINF" */
-
- uint32_t *_sessions = (void *) chunk->data;
-
- cdio_assert (UINT32_FROM_BE (chunk->len) == 4);
-
- cdio_debug ("SINF: %lu sessions",
- (long unsigned int) UINT32_FROM_BE (*_sessions));
- }
- break;
-
- case MTYP_ID: { /* "MTYP" */
- uint32_t *mtyp_p = (void *) chunk->data;
- uint32_t mtyp = UINT32_FROM_BE (*mtyp_p);
-
- cdio_assert (UINT32_FROM_BE (chunk->len) == 4);
-
- cdio_debug ("MTYP: %lu",
- (long unsigned int) UINT32_FROM_BE (*mtyp_p));
-
- if (mtyp != MTYP_AUDIO_CD) {
- cdio_log (log_level,
- "Unknown MTYP value: %u", (unsigned int) mtyp);
- }
- env->mtyp = mtyp;
- }
- break;
-
- case CDTX_ID: { /* "CD TEXT" */
-
- cdio_log (log_level,
- "Don't know how to handle CD TEXT yet" );
- break;
- }
-
- default:
- cdio_log (log_level,
- "unknown tag %8.8x seen",
- (unsigned int) UINT32_FROM_BE (chunk->id));
- break;
- }
-
- if (break_out)
- break;
-
- pos += 8;
- pos += UINT32_FROM_BE (chunk->len);
- }
- }
-
- /* Fake out leadout track. */
- /* Don't use _stat_size_nrg since that will lead to recursion since
- we haven't fully initialized things yet.
- */
- cdio_lsn_to_msf (env->size, &env->tocent[env->gen.i_tracks].start_msf);
- env->tocent[env->gen.i_tracks].start_lba = cdio_lsn_to_lba(env->size);
- env->tocent[env->gen.i_tracks-1].sec_count =
- cdio_lsn_to_lba(env->size - env->tocent[env->gen.i_tracks-1].start_lba);
-
- env->gen.b_cdtext_init = true;
- env->gen.b_cdtext_error = false;
- env->gen.toc_init = true;
- free(footer_buf);
- return true;
-}
-
-/*!
- Initialize image structures.
- */
-static bool
-_init_nrg (_img_private_t *env)
-{
- if (env->gen.init) {
- cdio_error ("init called more than once");
- return false;
- }
-
- if (!(env->gen.data_source = cdio_stdio_new (env->gen.source_name))) {
- cdio_warn ("can't open nrg image file %s for reading",
- env->gen.source_name);
- return false;
- }
-
- env->psz_mcn = NULL;
- env->disc_mode = CDIO_DISC_MODE_NO_INFO;
-
- cdtext_init (&(env->gen.cdtext));
-
- if ( !parse_nrg (env, env->gen.source_name) ) {
- cdio_warn ("image file %s is not a Nero image",
- env->gen.source_name);
- return false;
- }
-
- env->gen.init = true;
- return true;
-
-}
-
-/*!
- Reads into buf the next size bytes.
- Returns -1 on error.
- Would be libc's seek() but we have to adjust for the extra track header
- information in each sector.
-*/
-static off_t
-_lseek_nrg (void *user_data, off_t offset, int whence)
-{
- _img_private_t *env = user_data;
-
- /* real_offset is the real byte offset inside the disk image
- The number below was determined empirically.
- */
- off_t real_offset= env->is_dao ? 0x4b000 : 0;
-
- unsigned int i;
-
- for (i=0; i<env->gen.i_tracks; i++) {
- track_info_t *this_track=&(env->tocent[i]);
- env->pos.index = i;
- if ( (this_track->sec_count*this_track->datasize) >= offset) {
- int blocks = offset / this_track->datasize;
- int rem = offset % this_track->datasize;
- int block_offset = blocks * this_track->blocksize;
- real_offset += block_offset + rem;
- env->pos.buff_offset = rem;
- env->pos.lba += blocks;
- break;
- }
- real_offset += this_track->sec_count*this_track->blocksize;
- offset -= this_track->sec_count*this_track->datasize;
- env->pos.lba += this_track->sec_count;
- }
-
- if (i==env->gen.i_tracks) {
- cdio_warn ("seeking outside range of disk image");
- return -1;
- } else
- real_offset += env->tocent[i].datastart;
- return cdio_stream_seek(env->gen.data_source, real_offset, whence);
-}
-
-/*!
- Reads into buf the next size bytes.
- Returns -1 on error.
- FIXME:
- At present we assume a read doesn't cross sector or track
- boundaries.
-*/
-static ssize_t
-_read_nrg (void *user_data, void *buf, size_t size)
-{
- _img_private_t *env = user_data;
- return cdio_stream_read(env->gen.data_source, buf, size, 1);
-}
-
-static uint32_t
-_stat_size_nrg (void *user_data)
-{
- _img_private_t *env = user_data;
-
- return env->size;
-}
-
-/*!
- Reads a single audio sector from CD device into data starting
- from LSN. Returns 0 if no error.
- */
-static int
-_read_audio_sectors_nrg (void *user_data, void *data, lsn_t lsn,
- unsigned int nblocks)
-{
- _img_private_t *env = user_data;
-
- CdioListNode *node;
-
- if (lsn >= env->size)
- {
- cdio_warn ("trying to read beyond image size (%lu >= %lu)",
- (long unsigned int) lsn, (long unsigned int) env->size);
- return -1;
- }
-
- _CDIO_LIST_FOREACH (node, env->mapping) {
- _mapping_t *_map = _cdio_list_node_data (node);
-
- if (IN (lsn, _map->start_lsn, (_map->start_lsn + _map->sec_count - 1))) {
- int ret;
- long int img_offset = _map->img_offset;
-
- img_offset += (lsn - _map->start_lsn) * CDIO_CD_FRAMESIZE_RAW;
-
- ret = cdio_stream_seek (env->gen.data_source, img_offset,
- SEEK_SET);
- if (ret!=0) return ret;
- ret = cdio_stream_read (env->gen.data_source, data,
- CDIO_CD_FRAMESIZE_RAW, nblocks);
- if (ret==0) return ret;
- break;
- }
- }
-
- if (!node) cdio_warn ("reading into pre gap (lsn %lu)",
- (long unsigned int) lsn);
-
- return 0;
-}
-
-static int
-_read_mode1_sector_nrg (void *user_data, void *data, lsn_t lsn,
- bool b_form2)
-{
- _img_private_t *env = user_data;
- char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, };
-
- CdioListNode *node;
-
- if (lsn >= env->size)
- {
- cdio_warn ("trying to read beyond image size (%lu >= %lu)",
- (long unsigned int) lsn, (long unsigned int) env->size);
- return -1;
- }
-
- _CDIO_LIST_FOREACH (node, env->mapping) {
- _mapping_t *_map = _cdio_list_node_data (node);
-
- if (IN (lsn, _map->start_lsn, (_map->start_lsn + _map->sec_count - 1))) {
- int ret;
- long int img_offset = _map->img_offset;
-
- img_offset += (lsn - _map->start_lsn) * _map->blocksize;
-
- ret = cdio_stream_seek (env->gen.data_source, img_offset,
- SEEK_SET);
- if (ret!=0) return ret;
-
- /* FIXME: Not completely sure the below is correct. */
- ret = cdio_stream_read (env->gen.data_source,
- (M2RAW_SECTOR_SIZE == _map->blocksize)
- ? (buf + CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE)
- : buf,
- _map->blocksize, 1);
- if (ret==0) return ret;
- break;
- }
- }
-
- if (!node)
- cdio_warn ("reading into pre gap (lsn %lu)", (long unsigned int) lsn);
-
- memcpy (data, buf + CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE,
- b_form2 ? M2RAW_SECTOR_SIZE: CDIO_CD_FRAMESIZE);
-
- return 0;
-}
-
-/*!
- Reads nblocks of mode2 sectors from cd device into data starting
- from lsn.
- Returns 0 if no error.
- */
-static int
-_read_mode1_sectors_nrg (void *user_data, void *data, lsn_t lsn,
- bool b_form2, unsigned nblocks)
-{
- _img_private_t *env = user_data;
- int i;
- int retval;
- unsigned int blocksize = b_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE;
-
- for (i = 0; i < nblocks; i++) {
- if ( (retval = _read_mode1_sector_nrg (env,
- ((char *)data) + (blocksize * i),
- lsn + i, b_form2)) )
- return retval;
- }
- return 0;
-}
-
-static int
-_read_mode2_sector_nrg (void *user_data, void *data, lsn_t lsn,
- bool b_form2)
-{
- _img_private_t *env = user_data;
- char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, };
-
- CdioListNode *node;
-
- if (lsn >= env->size)
- {
- cdio_warn ("trying to read beyond image size (%lu >= %lu)",
- (long unsigned int) lsn, (long unsigned int) env->size);
- return -1;
- }
-
- _CDIO_LIST_FOREACH (node, env->mapping) {
- _mapping_t *_map = _cdio_list_node_data (node);
-
- if (IN (lsn, _map->start_lsn, (_map->start_lsn + _map->sec_count - 1))) {
- int ret;
- long int img_offset = _map->img_offset;
-
- img_offset += (lsn - _map->start_lsn) * _map->blocksize;
-
- ret = cdio_stream_seek (env->gen.data_source, img_offset,
- SEEK_SET);
- if (ret!=0) return ret;
- ret = cdio_stream_read (env->gen.data_source,
- (M2RAW_SECTOR_SIZE == _map->blocksize)
- ? (buf + CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE)
- : buf,
- _map->blocksize, 1);
- if (ret==0) return ret;
- break;
- }
- }
-
- if (!node)
- cdio_warn ("reading into pre gap (lsn %lu)", (long unsigned int) lsn);
-
- if (b_form2)
- memcpy (data, buf + CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE,
- M2RAW_SECTOR_SIZE);
- else
- memcpy (data, buf + CDIO_CD_XA_SYNC_HEADER, CDIO_CD_FRAMESIZE);
-
- return 0;
-}
-
-/*!
- Reads nblocks of mode2 sectors from cd device into data starting
- from lsn.
- Returns 0 if no error.
- */
-static int
-_read_mode2_sectors_nrg (void *user_data, void *data, lsn_t lsn,
- bool b_form2, unsigned nblocks)
-{
- _img_private_t *env = user_data;
- int i;
- int retval;
- unsigned int blocksize = b_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE;
-
- for (i = 0; i < nblocks; i++) {
- if ( (retval = _read_mode2_sector_nrg (env,
- ((char *)data) + (blocksize * i),
- lsn + i, b_form2)) )
- return retval;
- }
- return 0;
-}
-
-/*
- Free memory resources associated with NRG object.
-*/
-static void
-_free_nrg (void *user_data)
-{
- _img_private_t *env = user_data;
-
- if (NULL == env) return;
- if (NULL != env->mapping)
- _cdio_list_free (env->mapping, true);
-
- /* The remaining part of the image is like the other image drivers,
- so free that in the same way. */
- _free_image(user_data);
-}
-
-/*!
- Eject media -- there's nothing to do here except free resources.
- We always return 2.
- */
-static int
-_eject_media_nrg(void *obj)
-{
- _free_nrg (obj);
- return 2;
-}
-
-/*!
- Return an array of strings giving possible NRG disk images.
- */
-char **
-cdio_get_devices_nrg (void)
-{
- char **drives = NULL;
- unsigned int num_files=0;
-#ifdef HAVE_GLOB_H
- unsigned int i;
- glob_t globbuf;
- globbuf.gl_offs = 0;
- glob("*.nrg", GLOB_DOOFFS, NULL, &globbuf);
- for (i=0; i<globbuf.gl_pathc; i++) {
- cdio_add_device_list(&drives, globbuf.gl_pathv[i], &num_files);
- }
- globfree(&globbuf);
-#else
- cdio_add_device_list(&drives, DEFAULT_CDIO_DEVICE, &num_files);
-#endif /*HAVE_GLOB_H*/
- cdio_add_device_list(&drives, NULL, &num_files);
- return drives;
-}
-
-/*!
- Return a string containing the default CD device.
- */
-char *
-cdio_get_default_device_nrg(void)
-{
- char **drives = cdio_get_devices_nrg();
- char *drive = (drives[0] == NULL) ? NULL : strdup(drives[0]);
- cdio_free_device_list(drives);
- return drive;
-}
-
-static bool
-get_hwinfo_nrg ( const CdIo *p_cdio, /*out*/ cdio_hwinfo_t *hw_info)
-{
- strcpy(hw_info->psz_vendor, "libcdio");
- strcpy(hw_info->psz_model, "Nero");
- strcpy(hw_info->psz_revision, CDIO_VERSION);
- return true;
-
-}
-
-/*!
- Return the number of tracks in the current medium.
- CDIO_INVALID_TRACK is returned on error.
-*/
-static track_format_t
-get_track_format_nrg(void *user_data, track_t track_num)
-{
- _img_private_t *env = user_data;
-
- if (track_num > env->gen.i_tracks || track_num == 0)
- return TRACK_FORMAT_ERROR;
-
- if ( env->dtyp != DTYP_INVALID) {
- switch (env->dtyp) {
- case DTYP_MODE2_XA:
- return TRACK_FORMAT_XA;
- case DTYP_MODE1:
- return TRACK_FORMAT_DATA;
- default: ;
- }
- }
-
- /*if ( MTYP_AUDIO_CD == env->mtyp) return TRACK_FORMAT_AUDIO; */
- return env->tocent[track_num-1].track_format;
-}
-
-/*!
- Return true if we have XA data (green, mode2 form1) or
- XA data (green, mode2 form2). That is track begins:
- sync - header - subheader
- 12 4 - 8
-
- FIXME: there's gotta be a better design for this and get_track_format?
-*/
-static bool
-_get_track_green_nrg(void *user_data, track_t track_num)
-{
- _img_private_t *env = user_data;
-
- if (track_num > env->gen.i_tracks || track_num == 0)
- return false;
-
- if ( MTYP_AUDIO_CD == env->mtyp) return false;
- return env->tocent[track_num-1].track_green;
-}
-
-/*!
- Check that a NRG file is valid.
-
-*/
-/* Later we'll probably do better. For now though, this gets us
- started for now.
-*/
-bool
-cdio_is_nrg(const char *psz_nrg)
-{
- unsigned int i;
-
- if (psz_nrg == NULL) return false;
-
- i=strlen(psz_nrg)-strlen("nrg");
-
- if (i>0) {
- if (psz_nrg[i]=='n' && psz_nrg[i+1]=='r' && psz_nrg[i+2]=='g') {
- return true;
- }
- else if (psz_nrg[i]=='N' && psz_nrg[i+1]=='R' && psz_nrg[i+2]=='G') {
- return true;
- }
- }
- return false;
-}
-
-/*!
- Initialization routine. This is the only thing that doesn't
- get called via a function pointer. In fact *we* are the
- ones to set that up.
- */
-CdIo *
-cdio_open_am_nrg (const char *psz_source_name, const char *psz_access_mode)
-{
- if (psz_access_mode != NULL && strcmp(psz_access_mode, "image"))
- cdio_warn ("there is only one access mode for nrg. Arg %s ignored",
- psz_access_mode);
- return cdio_open_nrg(psz_source_name);
-}
-
-
-CdIo *
-cdio_open_nrg (const char *psz_source)
-{
- CdIo *ret;
- _img_private_t *_data;
-
- cdio_funcs _funcs;
-
- memset( &_funcs, 0, sizeof(_funcs) );
-
- _funcs.eject_media = _eject_media_nrg;
- _funcs.free = _free_nrg;
- _funcs.get_arg = _get_arg_image;
- _funcs.get_cdtext = get_cdtext_generic;
- _funcs.get_devices = cdio_get_devices_nrg;
- _funcs.get_default_device = cdio_get_default_device_nrg;
- _funcs.get_discmode = _get_discmode_image;
- _funcs.get_drive_cap = _get_drive_cap_image;
- _funcs.get_first_track_num= _get_first_track_num_image;
- _funcs.get_hwinfo = get_hwinfo_nrg;
- _funcs.get_mcn = _get_mcn_image;
- _funcs.get_num_tracks = _get_num_tracks_image;
- _funcs.get_track_format = get_track_format_nrg;
- _funcs.get_track_green = _get_track_green_nrg;
- _funcs.get_track_lba = NULL; /* Will use generic routine via msf */
- _funcs.get_track_msf = _get_track_msf_image;
- _funcs.lseek = _lseek_nrg;
- _funcs.read = _read_nrg;
- _funcs.read_audio_sectors = _read_audio_sectors_nrg;
- _funcs.read_mode1_sector = _read_mode1_sector_nrg;
- _funcs.read_mode1_sectors = _read_mode1_sectors_nrg;
- _funcs.read_mode2_sector = _read_mode2_sector_nrg;
- _funcs.read_mode2_sectors = _read_mode2_sectors_nrg;
- _funcs.set_arg = _set_arg_image;
- _funcs.stat_size = _stat_size_nrg;
-
- _data = _cdio_malloc (sizeof (_img_private_t));
- _data->gen.init = false;
-
- _data->gen.i_tracks = 0;
- _data->mtyp = 0;
- _data->dtyp = DTYP_INVALID;
- _data->gen.i_first_track= 1;
- _data->is_dao = false;
- _data->is_cues = false; /* FIXME: remove is_cues. */
-
- ret = cdio_new ((void *)_data, &_funcs);
-
- if (ret == NULL) {
- free(_data);
- return NULL;
- }
-
- _set_arg_image(_data, "source", (NULL == psz_source)
- ? DEFAULT_CDIO_DEVICE: psz_source);
-
- _data->psz_cue_name = strdup(_get_arg_image(_data, "source"));
-
- if (!cdio_is_nrg(_data->psz_cue_name)) {
- cdio_debug ("source name %s is not recognized as a NRG image",
- _data->psz_cue_name);
- _free_nrg(_data);
- return NULL;
- }
-
- _set_arg_image (_data, "cue", _data->psz_cue_name);
-
- if (_init_nrg(_data))
- return ret;
- else {
- _free_nrg(_data);
- free(ret);
- return NULL;
- }
-
-}
-
-bool
-cdio_have_nrg (void)
-{
- return true;
-}
diff --git a/src/input/vcd/libcdio/image/nrg.h b/src/input/vcd/libcdio/image/nrg.h
deleted file mode 100644
index 2923c78f1..000000000
--- a/src/input/vcd/libcdio/image/nrg.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- $Id: nrg.h,v 1.1 2005/01/01 02:43:59 rockyb Exp $
-
- Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
- Copyright (C) 2001, 2003 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* NERO (NRG) file format structures. */
-
-/* this ugly image format is typical for lazy win32 programmers... at
- least structure were set big endian, so at reverse
- engineering wasn't such a big headache... */
-
-PRAGMA_BEGIN_PACKED
-typedef union {
- struct {
- uint32_t __x GNUC_PACKED;
- uint32_t ID GNUC_PACKED;
- uint32_t footer_ofs GNUC_PACKED;
- } v50;
- struct {
- uint32_t ID GNUC_PACKED;
- uint64_t footer_ofs GNUC_PACKED;
- } v55;
-} _footer_t;
-
-typedef struct {
- uint32_t start GNUC_PACKED;
- uint32_t length GNUC_PACKED;
- uint32_t type GNUC_PACKED; /* 0x0 -> MODE1, 0x2 -> MODE2 form1,
- 0x3 -> MIXED_MODE2 2336 blocksize
- */
- uint32_t start_lsn GNUC_PACKED; /* does not include any pre-gaps! */
- uint32_t _unknown GNUC_PACKED; /* wtf is this for? -- always zero... */
-} _etnf_array_t;
-
-/* Finally they realized that 32-bit offsets are a bit outdated for
- IA64 *eg* */
-typedef struct {
- uint64_t start GNUC_PACKED;
- uint64_t length GNUC_PACKED;
- uint32_t type GNUC_PACKED; /* 0x0 -> MODE1, 0x2 -> MODE2 form1,
- 0x3 -> MIXED_MODE2 2336 blocksize
- */
- uint32_t start_lsn GNUC_PACKED;
- uint64_t _unknown GNUC_PACKED; /* wtf is this for? -- always zero... */
-} _etn2_array_t;
-
-typedef struct {
- uint8_t type GNUC_PACKED; /* has track copy bit and whether audiofile
- or datafile. Is often 0x41 == 'A' */
- uint8_t track GNUC_PACKED; /* binary or BCD?? */
- uint8_t addr_ctrl GNUC_PACKED; /* addresstype: MSF or LBA in lower 4 bits
- control in upper 4 bits.
- makes 0->1 transitions */
- uint8_t res GNUC_PACKED; /* ?? */
- uint32_t lsn GNUC_PACKED;
-} _cuex_array_t;
-
-typedef struct {
- uint32_t _unknown1 GNUC_PACKED;
- char psz_mcn[CDIO_MCN_SIZE] GNUC_PACKED;
- uint8_t _unknown[64-CDIO_MCN_SIZE-sizeof(uint32_t)] GNUC_PACKED;
-} _daox_array_t;
-
-typedef struct {
- uint32_t _unknown1 GNUC_PACKED;
- char psz_mcn[CDIO_MCN_SIZE] GNUC_PACKED;
- uint8_t _unknown[64-CDIO_MCN_SIZE-sizeof(uint32_t)] GNUC_PACKED;
-} _daoi_array_t;
-
-typedef struct {
- uint32_t id GNUC_PACKED;
- uint32_t len GNUC_PACKED;
- char data[EMPTY_ARRAY_SIZE] GNUC_PACKED;
-} _chunk_t;
-
-PRAGMA_END_PACKED
-
-/* Nero images are Big Endian. */
-#define CDTX_ID 0x43445458 /* CD TEXT */
-#define CUEX_ID 0x43554558 /* Nero version 5.5.x-6.x */
-#define CUES_ID 0x43554553 /* Nero pre version 5.5.x-6.x */
-#define DAOX_ID 0x44414f58 /* Nero version 5.5.x-6.x */
-#define DAOI_ID 0x44414f49
-#define END1_ID 0x454e4421
-#define ETN2_ID 0x45544e32
-#define ETNF_ID 0x45544e46
-#define NER5_ID 0x4e455235 /* Nero version 5.5.x */
-#define NERO_ID 0x4e45524f /* Nero pre 5.5.x */
-#define SINF_ID 0x53494e46 /* Session information */
-#define MTYP_ID 0x4d545950 /* Disc Media type? */
-
-#define MTYP_AUDIO_CD 1 /* This isn't correct. But I don't know the
- the right thing is and it sometimes works (and
- sometimes is wrong). */
-
-/* Disk track type Values gleaned from DAOX */
-#define DTYP_MODE1 0
-#define DTYP_MODE2_XA 2
-#define DTYP_INVALID 255
diff --git a/src/input/vcd/libcdio/image_common.h b/src/input/vcd/libcdio/image_common.h
deleted file mode 100644
index 30699c15c..000000000
--- a/src/input/vcd/libcdio/image_common.h
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- $Id: image_common.h,v 1.1 2005/01/01 02:43:57 rockyb Exp $
-
- Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/*! Common image routines.
-
- Because _img_private_t may vary over image formats, the routines are
- included into the image drivers after _img_private_t is defined. In
- order for the below routines to work, there is a large part of
- _img_private_t that is common among image drivers. For example, see
- image.h
-*/
-
-#ifndef __CDIO_IMAGE_COMMON_H__
-#define __CDIO_IMAGE_COMMON_H__
-
-#define free_if_notnull(obj) \
- if (NULL != obj) { free(obj); obj=NULL; };
-
-/*!
- We don't need the image any more. Free all memory associated with
- it.
- */
-static void
-_free_image (void *user_data)
-{
- _img_private_t *p_env = user_data;
- track_t i_track;
-
- if (NULL == p_env) return;
-
- for (i_track=0; i_track < p_env->gen.i_tracks; i_track++) {
- free_if_notnull(p_env->tocent[i_track].filename);
- free_if_notnull(p_env->tocent[i_track].isrc);
- cdtext_destroy(&(p_env->tocent[i_track].cdtext));
- }
-
- free_if_notnull(p_env->psz_mcn);
- free_if_notnull(p_env->psz_cue_name);
- cdtext_destroy(&(p_env->gen.cdtext));
- cdio_generic_stdio_free(p_env);
- free(p_env);
-}
-
-#ifdef NEED_MEDIA_EJECT_IMAGE
-/*!
- Eject media -- there's nothing to do here except free resources.
- We always return 2.
- */
-static int
-_eject_media_image(void *user_data)
-{
- _free_image (user_data);
- return 2;
-}
-#endif
-
-/*!
- Return the value associated with the key "arg".
-*/
-static const char *
-_get_arg_image (void *user_data, const char key[])
-{
- _img_private_t *p_env = user_data;
-
- if (!strcmp (key, "source")) {
- return p_env->gen.source_name;
- } else if (!strcmp (key, "cue")) {
- return p_env->psz_cue_name;
- } else if (!strcmp(key, "access-mode")) {
- return "image";
- }
- return NULL;
-}
-
-/*!
- Get disc type associated with cd_obj.
-*/
-static discmode_t
-_get_discmode_image (void *p_user_data)
-{
- _img_private_t *p_env = p_user_data;
- return p_env->disc_mode;
-}
-
-/*!
- Return the media catalog number (MCN) from the CD or NULL if there
- is none or we don't have the ability to get it.
-
- Note: string is malloc'd so caller has to free() the returned
- string when done with it.
- */
-static char *
-_get_mcn_image(const void *user_data)
-{
- const _img_private_t *env = user_data;
-
- if (NULL == env || NULL == env->psz_mcn) return NULL;
- return strdup(env->psz_mcn);
-}
-
-/*!
- Return the starting MSF (minutes/secs/frames) for the track number
- track_num in obj. Tracks numbers start at 1.
- The "leadout" track is specified either by
- using track_num LEADOUT_TRACK or the total tracks+1.
-
-*/
-static bool
-_get_track_msf_image(void *user_data, track_t track_num, msf_t *msf)
-{
- _img_private_t *env = user_data;
-
- if (NULL == msf) return false;
-
- if (track_num == CDIO_CDROM_LEADOUT_TRACK) track_num = env->gen.i_tracks+1;
-
- if (track_num <= env->gen.i_tracks+1 && track_num != 0) {
- *msf = env->tocent[track_num-env->gen.i_first_track].start_msf;
- return true;
- } else
- return false;
-}
-
-/*!
- Return the number of of the first track.
- CDIO_INVALID_TRACK is returned on error.
-*/
-static track_t
-_get_first_track_num_image(void *user_data)
-{
- _img_private_t *env = user_data;
-
- return env->gen.i_first_track;
-}
-
-/*!
- Return the number of tracks.
-*/
-static track_t
-_get_num_tracks_image(void *user_data)
-{
- _img_private_t *env = user_data;
-
- return env->gen.i_tracks;
-}
-
-/*!
- Set the arg "key" with "value" in the source device.
- Currently "source" to set the source device in I/O operations
- is the only valid key.
-
- 0 is returned if no error was found, and nonzero if there as an error.
-*/
-static int
-_set_arg_image (void *user_data, const char key[], const char value[])
-{
- _img_private_t *env = user_data;
-
- if (!strcmp (key, "source"))
- {
- free_if_notnull (env->gen.source_name);
-
- if (!value)
- return -2;
-
- env->gen.source_name = strdup (value);
- }
- else if (!strcmp (key, "cue"))
- {
- free_if_notnull (env->psz_cue_name);
-
- if (!value)
- return -2;
-
- env->psz_cue_name = strdup (value);
- }
- else
- return -1;
-
- return 0;
-}
-
-/*!
- Return the the kind of drive capabilities of device.
-
- */
-static void
-_get_drive_cap_image (const void *user_data,
- cdio_drive_read_cap_t *p_read_cap,
- cdio_drive_write_cap_t *p_write_cap,
- cdio_drive_misc_cap_t *p_misc_cap)
-{
-
- *p_read_cap = CDIO_DRIVE_CAP_READ_AUDIO
- | CDIO_DRIVE_CAP_READ_CD_G
- | CDIO_DRIVE_CAP_READ_CD_R
- | CDIO_DRIVE_CAP_READ_CD_RW
- ;
-
- *p_write_cap = 0;
-
- /* In the future we may want to simulate
- LOCK, OPEN_TRAY, CLOSE_TRAY, SELECT_SPEED, etc.
- */
- *p_misc_cap = CDIO_DRIVE_CAP_MISC_FILE;
-}
-
-#endif /* __CDIO_IMAGE_COMMON_H__ */
diff --git a/src/input/vcd/libcdio/iso9660.c b/src/input/vcd/libcdio/iso9660.c
deleted file mode 100644
index 91b89d516..000000000
--- a/src/input/vcd/libcdio/iso9660.c
+++ /dev/null
@@ -1,1007 +0,0 @@
-/*
- $Id: iso9660.c,v 1.4 2006/09/26 18:13:11 dgp85 Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
- Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* Private headers */
-#include "iso9660_private.h"
-#include "cdio_assert.h"
-
-/* Public headers */
-#include <cdio/bytesex.h>
-#include <cdio/iso9660.h>
-#include <cdio/util.h>
-
-#include <time.h>
-#include <ctype.h>
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-#ifdef HAVE_STDIO_H
-#include <stdio.h>
-#endif
-
-static const char _rcsid[] = "$Id: iso9660.c,v 1.4 2006/09/26 18:13:11 dgp85 Exp $";
-
-/* some parameters... */
-#define SYSTEM_ID "CD-RTOS CD-BRIDGE"
-#define VOLUME_SET_ID ""
-
-/*!
- Change trailing blanks in str to nulls. Str has a maximum size of
- n characters.
-*/
-static char *
-strip_trail (const char str[], size_t n)
-{
- static char buf[1025];
- int j;
-
- cdio_assert (n < 1024);
-
- strncpy (buf, str, n);
- buf[n] = '\0';
-
- for (j = strlen (buf) - 1; j >= 0; j--)
- {
- if (buf[j] != ' ')
- break;
-
- buf[j] = '\0';
- }
-
- return buf;
-}
-
-static void
-pathtable_get_size_and_entries(const void *pt, unsigned int *size,
- unsigned int *entries);
-
-/*!
- Get time structure from structure in an ISO 9660 directory index
- record. Even though tm_wday and tm_yday fields are not explicitly in
- idr_date, the are calculated from the other fields.
-
- If tm is to reflect the localtime set b_localtime true, otherwise
- tm will reported in GMT.
-*/
-void
-iso9660_get_dtime (const iso9660_dtime_t *idr_date, bool b_localtime,
- /*out*/ struct tm *p_tm)
-{
- time_t t;
- struct tm *p_temp_tm;
-
- if (!idr_date) return;
-
- memset(p_tm, 0, sizeof(struct tm));
- p_tm->tm_year = idr_date->dt_year;
- p_tm->tm_mon = idr_date->dt_month - 1;
- p_tm->tm_mday = idr_date->dt_day;
- p_tm->tm_hour = idr_date->dt_hour;
- p_tm->tm_min = idr_date->dt_minute;
- p_tm->tm_sec = idr_date->dt_second;
-
-#if defined(HAVE_TM_GMTOFF) && defined(HAVE_TZSET)
- if (b_localtime) {
- tzset();
-#if defined(HAVE_TZNAME)
- p_tm->tm_zone = (char *) tzname;
-#endif
-#if defined(HAVE_DAYLIGHT)
- p_tm->tm_isdst = daylight;
- p_tm->tm_gmtoff = timezone;
-#endif
- }
-#endif
-
- /* Recompute tm_wday and tm_yday via mktime. */
- t = mktime(p_tm);
-
- if (b_localtime)
- p_temp_tm = localtime(&t);
- else
- p_temp_tm = gmtime(&t);
-
- memcpy(p_tm, p_temp_tm, sizeof(struct tm));
-}
-
-/*!
- Set time in format used in ISO 9660 directory index record
- from a Unix time structure. */
-void
-iso9660_set_dtime (const struct tm *p_tm, /*out*/ iso9660_dtime_t *p_idr_date)
-{
- memset (p_idr_date, 0, 7);
-
- if (!p_tm) return;
-
- p_idr_date->dt_year = p_tm->tm_year;
- p_idr_date->dt_month = p_tm->tm_mon + 1;
- p_idr_date->dt_day = p_tm->tm_mday;
- p_idr_date->dt_hour = p_tm->tm_hour;
- p_idr_date->dt_minute = p_tm->tm_min;
- p_idr_date->dt_second = p_tm->tm_sec;
-
-#ifdef HAVE_TM_GMTOFF
- /* The ISO 9660 timezone is in the range -48..+52 and each unit
- represents a 15-minute interval. */
- p_idr_date->dt_gmtoff = p_tm->tm_gmtoff / (15 * 60);
-
- if (p_tm->tm_isdst) p_idr_date->dt_gmtoff -= 4;
-
- if (p_idr_date->dt_gmtoff < -48 ) {
-
- cdio_warn ("Converted ISO 9660 timezone %d is less than -48. Adjusted",
- p_idr_date->dt_gmtoff);
- p_idr_date->dt_gmtoff = -48;
- } else if (p_idr_date->dt_gmtoff > 52) {
- cdio_warn ("Converted ISO 9660 timezone %d is over 52. Adjusted",
- p_idr_date->dt_gmtoff);
- p_idr_date->dt_gmtoff = 52;
- }
-#else
- p_idr_date->dt_gmtoff = 0;
-#endif
-}
-
-/*!
- Set "long" time in format used in ISO 9660 primary volume descriptor
- from a Unix time structure. */
-void
-iso9660_set_ltime (const struct tm *_tm, /*out*/ iso9660_ltime_t *pvd_date)
-{
- char *_pvd_date = (char *) pvd_date;
-
- memset (_pvd_date, '0', 16);
- _pvd_date[16] = (int8_t) 0; /* tz */
-
- if (!_tm) return;
-
- snprintf(_pvd_date, 17,
- "%4.4d%2.2d%2.2d" "%2.2d%2.2d%2.2d" "%2.2d",
- _tm->tm_year + 1900, _tm->tm_mon + 1, _tm->tm_mday,
- _tm->tm_hour, _tm->tm_min, _tm->tm_sec,
- 0 /* 1/100 secs */ );
-
- _pvd_date[16] = (int8_t) 0; /* tz */
-}
-
-/*!
- Convert ISO-9660 file name that stored in a directory entry into
- what's usually listed as the file name in a listing.
- Lowercase name, and remove trailing ;1's or .;1's and
- turn the other ;'s into version numbers.
-
- The length of the translated string is returned.
-*/
-int
-iso9660_name_translate(const char *old, char *new)
-{
- return iso9660_name_translate_ext(old, new, 0);
-}
-
-/*!
- Convert ISO-9660 file name that stored in a directory entry into
- what's usually listed as the file name in a listing. Lowercase
- name if not using Joliet extension. Remove trailing ;1's or .;1's and
- turn the other ;'s into version numbers.
-
- The length of the translated string is returned.
-*/
-int
-iso9660_name_translate_ext(const char *old, char *new, uint8_t i_joliet_level)
-{
- int len = strlen(old);
- int i;
-
- for (i = 0; i < len; i++) {
- unsigned char c = old[i];
- if (!c)
- break;
-
- /* Lower case, unless we have Joliet extensions. */
- if (!i_joliet_level && isupper(c)) c = tolower(c);
-
- /* Drop trailing '.;1' (ISO 9660:1988 7.5.1 requires period) */
- if (c == '.' && i == len - 3 && old[i + 1] == ';' && old[i + 2] == '1')
- break;
-
- /* Drop trailing ';1' */
- if (c == ';' && i == len - 2 && old[i + 1] == '1')
- break;
-
- /* Convert remaining ';' to '.' */
- if (c == ';')
- c = '.';
-
- new[i] = c;
- }
- new[i] = '\0';
- return i;
-}
-
-/*!
- Pad string src with spaces to size len and copy this to dst. If
- len is less than the length of src, dst will be truncated to the
- first len characters of src.
-
- src can also be scanned to see if it contains only ACHARs, DCHARs,
- 7-bit ASCII chars depending on the enumeration _check.
-
- In addition to getting changed, dst is the return value.
- Note: this string might not be NULL terminated.
- */
-char *
-iso9660_strncpy_pad(char dst[], const char src[], size_t len,
- enum strncpy_pad_check _check)
-{
- size_t rlen;
-
- cdio_assert (dst != NULL);
- cdio_assert (src != NULL);
- cdio_assert (len > 0);
-
- switch (_check)
- {
- int idx;
- case ISO9660_NOCHECK:
- break;
-
- case ISO9660_7BIT:
- for (idx = 0; src[idx]; idx++)
- if ((int8_t) src[idx] < 0)
- {
- cdio_warn ("string '%s' fails 7bit constraint (pos = %d)",
- src, idx);
- break;
- }
- break;
-
- case ISO9660_ACHARS:
- for (idx = 0; src[idx]; idx++)
- if (!iso9660_isachar (src[idx]))
- {
- cdio_warn ("string '%s' fails a-character constraint (pos = %d)",
- src, idx);
- break;
- }
- break;
-
- case ISO9660_DCHARS:
- for (idx = 0; src[idx]; idx++)
- if (!iso9660_isdchar (src[idx]))
- {
- cdio_warn ("string '%s' fails d-character constraint (pos = %d)",
- src, idx);
- break;
- }
- break;
-
- default:
- cdio_assert_not_reached ();
- break;
- }
-
- rlen = strlen (src);
-
- if (rlen > len)
- cdio_warn ("string '%s' is getting truncated to %d characters",
- src, (unsigned int) len);
-
- strncpy (dst, src, len);
- if (rlen < len)
- memset(dst+rlen, ' ', len-rlen);
- return dst;
-}
-
-/*!
- Return true if c is a DCHAR - a valid ISO-9660 level 1 character.
- These are the ASCSII capital letters A-Z, the digits 0-9 and an
- underscore.
-*/
-bool
-iso9660_isdchar (int c)
-{
- if (!IN (c, 0x30, 0x5f)
- || IN (c, 0x3a, 0x40)
- || IN (c, 0x5b, 0x5e))
- return false;
-
- return true;
-}
-
-
-/*!
- Return true if c is an ACHAR -
- These are the DCHAR's plus some ASCII symbols including the space
- symbol.
-*/
-bool
-iso9660_isachar (int c)
-{
- if (!IN (c, 0x20, 0x5f)
- || IN (c, 0x23, 0x24)
- || c == 0x40
- || IN (c, 0x5b, 0x5e))
- return false;
-
- return true;
-}
-
-void
-iso9660_set_evd(void *pd)
-{
- struct iso_volume_descriptor ied;
-
- cdio_assert (sizeof(struct iso_volume_descriptor) == ISO_BLOCKSIZE);
-
- cdio_assert (pd != NULL);
-
- memset(&ied, 0, sizeof(ied));
-
- ied.type = to_711(ISO_VD_END);
- iso9660_strncpy_pad (ied.id, ISO_STANDARD_ID, sizeof(ied.id), ISO9660_DCHARS);
- ied.version = to_711(ISO_VERSION);
-
- memcpy(pd, &ied, sizeof(ied));
-}
-
-void
-iso9660_set_pvd(void *pd,
- const char volume_id[],
- const char publisher_id[],
- const char preparer_id[],
- const char application_id[],
- uint32_t iso_size,
- const void *root_dir,
- uint32_t path_table_l_extent,
- uint32_t path_table_m_extent,
- uint32_t path_table_size,
- const time_t *pvd_time
- )
-{
- iso9660_pvd_t ipd;
-
- cdio_assert (sizeof(iso9660_pvd_t) == ISO_BLOCKSIZE);
-
- cdio_assert (pd != NULL);
- cdio_assert (volume_id != NULL);
- cdio_assert (application_id != NULL);
-
- memset(&ipd,0,sizeof(ipd)); /* paranoia? */
-
- /* magic stuff ... thatis CD XA marker... */
- strcpy(((char*)&ipd)+ISO_XA_MARKER_OFFSET, ISO_XA_MARKER_STRING);
-
- ipd.type = to_711(ISO_VD_PRIMARY);
- iso9660_strncpy_pad (ipd.id, ISO_STANDARD_ID, 5, ISO9660_DCHARS);
- ipd.version = to_711(ISO_VERSION);
-
- iso9660_strncpy_pad (ipd.system_id, SYSTEM_ID, 32, ISO9660_ACHARS);
- iso9660_strncpy_pad (ipd.volume_id, volume_id, 32, ISO9660_DCHARS);
-
- ipd.volume_space_size = to_733(iso_size);
-
- ipd.volume_set_size = to_723(1);
- ipd.volume_sequence_number = to_723(1);
- ipd.logical_block_size = to_723(ISO_BLOCKSIZE);
-
- ipd.path_table_size = to_733(path_table_size);
- ipd.type_l_path_table = to_731(path_table_l_extent);
- ipd.type_m_path_table = to_732(path_table_m_extent);
-
- /* root_directory_record doesn't contain the 1-byte filename,
- so we add one for that. */
- cdio_assert (sizeof(ipd.root_directory_record) == 33);
- memcpy(&(ipd.root_directory_record), root_dir,
- sizeof(ipd.root_directory_record));
- ipd.root_directory_filename='\0';
- ipd.root_directory_record.length = 33+1;
- iso9660_strncpy_pad (ipd.volume_set_id, VOLUME_SET_ID, 128, ISO9660_DCHARS);
-
- iso9660_strncpy_pad (ipd.publisher_id, publisher_id, 128, ISO9660_ACHARS);
- iso9660_strncpy_pad (ipd.preparer_id, preparer_id, 128, ISO9660_ACHARS);
- iso9660_strncpy_pad (ipd.application_id, application_id, 128, ISO9660_ACHARS);
-
- iso9660_strncpy_pad (ipd.copyright_file_id , "", 37, ISO9660_DCHARS);
- iso9660_strncpy_pad (ipd.abstract_file_id , "", 37, ISO9660_DCHARS);
- iso9660_strncpy_pad (ipd.bibliographic_file_id, "", 37, ISO9660_DCHARS);
-
- iso9660_set_ltime (gmtime (pvd_time), &(ipd.creation_date));
- iso9660_set_ltime (gmtime (pvd_time), &(ipd.modification_date));
- iso9660_set_ltime (NULL, &(ipd.expiration_date));
- iso9660_set_ltime (NULL, &(ipd.effective_date));
-
- ipd.file_structure_version = to_711(1);
-
- /* we leave ipd.application_data = 0 */
-
- memcpy(pd, &ipd, sizeof(ipd)); /* copy stuff to arg ptr */
-}
-
-unsigned int
-iso9660_dir_calc_record_size(unsigned int namelen, unsigned int su_len)
-{
- unsigned int length;
-
- length = sizeof(iso9660_dir_t);
- length += namelen;
- if (length % 2) /* pad to word boundary */
- length++;
- length += su_len;
- if (length % 2) /* pad to word boundary again */
- length++;
-
- return length;
-}
-
-void
-iso9660_dir_add_entry_su(void *dir,
- const char filename[],
- uint32_t extent,
- uint32_t size,
- uint8_t file_flags,
- const void *su_data,
- unsigned int su_size,
- const time_t *entry_time)
-{
- iso9660_dir_t *idr = dir;
- uint8_t *dir8 = dir;
- unsigned int offset = 0;
- uint32_t dsize = from_733(idr->size);
- int length, su_offset;
- cdio_assert (sizeof(iso9660_dir_t) == 33);
-
- if (!dsize && !idr->length)
- dsize = ISO_BLOCKSIZE; /* for when dir lacks '.' entry */
-
- cdio_assert (dsize > 0 && !(dsize % ISO_BLOCKSIZE));
- cdio_assert (dir != NULL);
- cdio_assert (extent > 17);
- cdio_assert (filename != NULL);
- cdio_assert (strlen(filename) <= MAX_ISOPATHNAME);
-
- length = sizeof(iso9660_dir_t);
- length += strlen(filename);
- length = _cdio_ceil2block (length, 2); /* pad to word boundary */
- su_offset = length;
- length += su_size;
- length = _cdio_ceil2block (length, 2); /* pad to word boundary again */
-
- /* find the last entry's end */
- {
- unsigned int ofs_last_rec = 0;
-
- offset = 0;
- while (offset < dsize)
- {
- if (!dir8[offset])
- {
- offset++;
- continue;
- }
-
- offset += dir8[offset];
- ofs_last_rec = offset;
- }
-
- cdio_assert (offset == dsize);
-
- offset = ofs_last_rec;
- }
-
- /* be sure we don't cross sectors boundaries */
- offset = _cdio_ofs_add (offset, length, ISO_BLOCKSIZE);
- offset -= length;
-
- cdio_assert (offset + length <= dsize);
-
- idr = (iso9660_dir_t *) &dir8[offset];
-
- cdio_assert (offset+length < dsize);
-
- memset(idr, 0, length);
-
- idr->length = to_711(length);
- idr->extent = to_733(extent);
- idr->size = to_733(size);
-
- iso9660_set_dtime (gmtime(entry_time), &(idr->recording_time));
-
- idr->file_flags = to_711(file_flags);
-
- idr->volume_sequence_number = to_723(1);
-
- idr->filename_len = to_711(strlen(filename)
- ? strlen(filename) : 1); /* working hack! */
-
- memcpy(idr->filename, filename, from_711(idr->filename_len));
- memcpy(&dir8[offset] + su_offset, su_data, su_size);
-}
-
-void
-iso9660_dir_init_new (void *dir,
- uint32_t self,
- uint32_t ssize,
- uint32_t parent,
- uint32_t psize,
- const time_t *dir_time)
-{
- iso9660_dir_init_new_su (dir, self, ssize, NULL, 0, parent, psize, NULL,
- 0, dir_time);
-}
-
-void
-iso9660_dir_init_new_su (void *dir,
- uint32_t self,
- uint32_t ssize,
- const void *ssu_data,
- unsigned int ssu_size,
- uint32_t parent,
- uint32_t psize,
- const void *psu_data,
- unsigned int psu_size,
- const time_t *dir_time)
-{
- cdio_assert (ssize > 0 && !(ssize % ISO_BLOCKSIZE));
- cdio_assert (psize > 0 && !(psize % ISO_BLOCKSIZE));
- cdio_assert (dir != NULL);
-
- memset (dir, 0, ssize);
-
- /* "\0" -- working hack due to padding */
- iso9660_dir_add_entry_su (dir, "\0", self, ssize, ISO_DIRECTORY, ssu_data,
- ssu_size, dir_time);
-
- iso9660_dir_add_entry_su (dir, "\1", parent, psize, ISO_DIRECTORY, psu_data,
- psu_size, dir_time);
-}
-
-/* Zero's out pathable. Do this first. */
-void
-iso9660_pathtable_init (void *pt)
-{
- cdio_assert (sizeof (struct iso_path_table) == 8);
-
- cdio_assert (pt != NULL);
-
- memset (pt, 0, ISO_BLOCKSIZE); /* fixme */
-}
-
-static const struct iso_path_table*
-pathtable_get_entry (const void *pt, unsigned int entrynum)
-{
- const uint8_t *tmp = pt;
- unsigned int offset = 0;
- unsigned int count = 0;
-
- cdio_assert (pt != NULL);
-
- while (from_711 (*tmp))
- {
- if (count == entrynum)
- break;
-
- cdio_assert (count < entrynum);
-
- offset += sizeof (struct iso_path_table);
- offset += from_711 (*tmp);
- if (offset % 2)
- offset++;
- tmp = (uint8_t *)pt + offset;
- count++;
- }
-
- if (!from_711 (*tmp))
- return NULL;
-
- return (const void *) tmp;
-}
-
-void
-pathtable_get_size_and_entries (const void *pt,
- unsigned int *size,
- unsigned int *entries)
-{
- const uint8_t *tmp = pt;
- unsigned int offset = 0;
- unsigned int count = 0;
-
- cdio_assert (pt != NULL);
-
- while (from_711 (*tmp))
- {
- offset += sizeof (struct iso_path_table);
- offset += from_711 (*tmp);
- if (offset % 2)
- offset++;
- tmp = (uint8_t *)pt + offset;
- count++;
- }
-
- if (size)
- *size = offset;
-
- if (entries)
- *entries = count;
-}
-
-unsigned int
-iso9660_pathtable_get_size (const void *pt)
-{
- unsigned int size = 0;
- pathtable_get_size_and_entries (pt, &size, NULL);
- return size;
-}
-
-uint16_t
-iso9660_pathtable_l_add_entry (void *pt,
- const char name[],
- uint32_t extent,
- uint16_t parent)
-{
- struct iso_path_table *ipt =
- (struct iso_path_table*)((char *)pt + iso9660_pathtable_get_size (pt));
- size_t name_len = strlen (name) ? strlen (name) : 1;
- unsigned int entrynum = 0;
-
- cdio_assert (iso9660_pathtable_get_size (pt) < ISO_BLOCKSIZE); /*fixme */
-
- memset (ipt, 0, sizeof (struct iso_path_table) + name_len); /* paranoia */
-
- ipt->name_len = to_711 (name_len);
- ipt->extent = to_731 (extent);
- ipt->parent = to_721 (parent);
- memcpy (ipt->name, name, name_len);
-
- pathtable_get_size_and_entries (pt, NULL, &entrynum);
-
- if (entrynum > 1)
- {
- const struct iso_path_table *ipt2
- = pathtable_get_entry (pt, entrynum - 2);
-
- cdio_assert (ipt2 != NULL);
-
- cdio_assert (from_721 (ipt2->parent) <= parent);
- }
-
- return entrynum;
-}
-
-uint16_t
-iso9660_pathtable_m_add_entry (void *pt,
- const char name[],
- uint32_t extent,
- uint16_t parent)
-{
- struct iso_path_table *ipt =
- (struct iso_path_table*)((char *)pt + iso9660_pathtable_get_size (pt));
- size_t name_len = strlen (name) ? strlen (name) : 1;
- unsigned int entrynum = 0;
-
- cdio_assert (iso9660_pathtable_get_size(pt) < ISO_BLOCKSIZE); /* fixme */
-
- memset(ipt, 0, sizeof (struct iso_path_table) + name_len); /* paranoia */
-
- ipt->name_len = to_711 (name_len);
- ipt->extent = to_732 (extent);
- ipt->parent = to_722 (parent);
- memcpy (ipt->name, name, name_len);
-
- pathtable_get_size_and_entries (pt, NULL, &entrynum);
-
- if (entrynum > 1)
- {
- const struct iso_path_table *ipt2
- = pathtable_get_entry (pt, entrynum - 2);
-
- cdio_assert (ipt2 != NULL);
-
- cdio_assert (from_722 (ipt2->parent) <= parent);
- }
-
- return entrynum;
-}
-
-/*!
- Check that pathname is a valid ISO-9660 directory name.
-
- A valid directory name should not start out with a slash (/),
- dot (.) or null byte, should be less than 37 characters long,
- have no more than 8 characters in a directory component
- which is separated by a /, and consist of only DCHARs.
- */
-bool
-iso9660_dirname_valid_p (const char pathname[])
-{
- const char *p = pathname;
- int len;
-
- cdio_assert (pathname != NULL);
-
- if (*p == '/' || *p == '.' || *p == '\0')
- return false;
-
- if (strlen (pathname) > MAX_ISOPATHNAME)
- return false;
-
- len = 0;
- for (; *p; p++)
- if (iso9660_isdchar (*p))
- {
- len++;
- if (len > 8)
- return false;
- }
- else if (*p == '/')
- {
- if (!len)
- return false;
- len = 0;
- }
- else
- return false; /* unexpected char */
-
- if (!len)
- return false; /* last char may not be '/' */
-
- return true;
-}
-
-/*!
- Check that pathname is a valid ISO-9660 pathname.
-
- A valid pathname contains a valid directory name, if one appears and
- the filename portion should be no more than 8 characters for the
- file prefix and 3 characters in the extension (or portion after a
- dot). There should be exactly one dot somewhere in the filename
- portion and the filename should be composed of only DCHARs.
-
- True is returned if pathname is valid.
- */
-bool
-iso9660_pathname_valid_p (const char pathname[])
-{
- const char *p = NULL;
-
- cdio_assert (pathname != NULL);
-
- if ((p = strrchr (pathname, '/')))
- {
- bool rc;
- char *_tmp = strdup (pathname);
-
- *strrchr (_tmp, '/') = '\0';
-
- rc = iso9660_dirname_valid_p (_tmp);
-
- free (_tmp);
-
- if (!rc)
- return false;
-
- p++;
- }
- else
- p = pathname;
-
- if (strlen (pathname) > (MAX_ISOPATHNAME - 6))
- return false;
-
- {
- int len = 0;
- int dots = 0;
-
- for (; *p; p++)
- if (iso9660_isdchar (*p))
- {
- len++;
- if (dots == 0 ? len > 8 : len > 3)
- return false;
- }
- else if (*p == '.')
- {
- dots++;
- if (dots > 1)
- return false;
- if (!len)
- return false;
- len = 0;
- }
- else
- return false;
-
- if (dots != 1)
- return false;
- }
-
- return true;
-}
-
-/*!
- Take pathname and a version number and turn that into a ISO-9660
- pathname. (That's just the pathname followd by ";" and the version
- number. For example, mydir/file.ext -> mydir/file.ext;1 for version
- 1. The resulting ISO-9660 pathname is returned.
-*/
-char *
-iso9660_pathname_isofy (const char pathname[], uint16_t version)
-{
- char tmpbuf[1024] = { 0, };
-
- cdio_assert (strlen (pathname) < (sizeof (tmpbuf) - sizeof (";65535")));
-
- snprintf (tmpbuf, sizeof(tmpbuf), "%s;%d", pathname, version);
-
- return strdup (tmpbuf);
-}
-
-/*!
- Return the PVD's application ID.
- NULL is returned if there is some problem in getting this.
-*/
-char *
-iso9660_get_application_id(iso9660_pvd_t *p_pvd)
-{
- if (NULL==p_pvd) return NULL;
- return strdup(strip_trail(p_pvd->application_id, ISO_MAX_APPLICATION_ID));
-}
-
-#if FIXME
-lsn_t
-iso9660_get_dir_extent(const iso9660_dir_t *idr)
-{
- if (NULL == idr) return 0;
- return from_733(idr->extent);
-}
-#endif
-
-uint8_t
-iso9660_get_dir_len(const iso9660_dir_t *idr)
-{
- if (NULL == idr) return 0;
- return idr->length;
-}
-
-#if FIXME
-uint8_t
-iso9660_get_dir_size(const iso9660_dir_t *idr)
-{
- if (NULL == idr) return 0;
- return from_733(idr->size);
-}
-#endif
-
-uint8_t
-iso9660_get_pvd_type(const iso9660_pvd_t *pvd)
-{
- if (NULL == pvd) return 255;
- return(pvd->type);
-}
-
-const char *
-iso9660_get_pvd_id(const iso9660_pvd_t *pvd)
-{
- if (NULL == pvd) return "ERR";
- return(pvd->id);
-}
-
-int
-iso9660_get_pvd_space_size(const iso9660_pvd_t *pvd)
-{
- if (NULL == pvd) return 0;
- return from_733(pvd->volume_space_size);
-}
-
-int
-iso9660_get_pvd_block_size(const iso9660_pvd_t *pvd)
-{
- if (NULL == pvd) return 0;
- return from_723(pvd->logical_block_size);
-}
-
-/*! Return the primary volume id version number (of pvd).
- If there is an error 0 is returned.
- */
-int
-iso9660_get_pvd_version(const iso9660_pvd_t *pvd)
-{
- if (NULL == pvd) return 0;
- return pvd->version;
-}
-
-/*! Return the LSN of the root directory for pvd.
- If there is an error CDIO_INVALID_LSN is returned.
- */
-lsn_t
-iso9660_get_root_lsn(const iso9660_pvd_t *pvd)
-{
- if (NULL == pvd)
- return CDIO_INVALID_LSN;
- else {
- const iso9660_dir_t *idr = &(pvd->root_directory_record);
- if (NULL == idr) return CDIO_INVALID_LSN;
- return(from_733 (idr->extent));
- }
-}
-
-/*!
- Return a string containing the preparer id with trailing
- blanks removed.
-*/
-char *
-iso9660_get_preparer_id(const iso9660_pvd_t *pvd)
-{
- if (NULL==pvd) return NULL;
- return strdup(strip_trail(pvd->preparer_id, ISO_MAX_PREPARER_ID));
-}
-
-/*!
- Return a string containing the publisher id with trailing
- blanks removed.
-*/
-char *
-iso9660_get_publisher_id(const iso9660_pvd_t *pvd)
-{
- if (NULL==pvd) return NULL;
- return strdup(strip_trail(pvd->publisher_id, ISO_MAX_PUBLISHER_ID));
-}
-
-/*!
- Return a string containing the PVD's system id with trailing
- blanks removed.
-*/
-char *
-iso9660_get_system_id(const iso9660_pvd_t *pvd)
-{
- if (NULL==pvd) return NULL;
- return strdup(strip_trail(pvd->system_id, ISO_MAX_SYSTEM_ID));
-}
-
-/*!
- Return the PVD's volume ID.
-*/
-char *
-iso9660_get_volume_id(const iso9660_pvd_t *pvd)
-{
- if (NULL == pvd) return NULL;
- return strdup(strip_trail(pvd->volume_id, ISO_MAX_VOLUME_ID));
-}
-
-/*!
- Return the PVD's volumeset ID.
- NULL is returned if there is some problem in getting this.
-*/
-char *
-iso9660_get_volumeset_id(const iso9660_pvd_t *pvd)
-{
- if ( NULL == pvd ) return NULL;
- return strdup(strip_trail(pvd->volume_set_id, ISO_MAX_VOLUMESET_ID));
-}
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libcdio/iso9660_fs.c b/src/input/vcd/libcdio/iso9660_fs.c
deleted file mode 100644
index fff12cd7c..000000000
--- a/src/input/vcd/libcdio/iso9660_fs.c
+++ /dev/null
@@ -1,1260 +0,0 @@
-/*
- $Id: iso9660_fs.c,v 1.7 2006/12/08 16:26:10 mshopf Exp $
-
- Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
- Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#ifdef HAVE_STRING_H
-# include <string.h>
-#endif
-
-#ifdef HAVE_ERRNO_H
-# include <errno.h>
-#endif
-
-#ifdef HAVE_ICONV
-# include <iconv.h>
-#endif
-
-#ifdef HAVE_NL_LANGINFO
-#include <langinfo.h>
-#endif
-
-#include <cdio/cdio.h>
-#include <cdio/bytesex.h>
-#include <cdio/iso9660.h>
-#include <cdio/util.h>
-
-/* Private headers */
-#include "cdio_assert.h"
-#include "_cdio_stdio.h"
-#include "cdio_private.h"
-
-#include <stdio.h>
-
-static const char _rcsid[] = "$Id: iso9660_fs.c,v 1.7 2006/12/08 16:26:10 mshopf Exp $";
-
-/* Implementation of iso9660_t type */
-struct _iso9660 {
- CdioDataSource *stream; /* Stream pointer */
- bool b_xa; /* true if has XA attributes. */
- uint8_t i_joliet_level;/* 0 = no Joliet extensions.
- 1-3: Joliet level. */
- iso9660_pvd_t pvd;
- iso9660_svd_t svd;
- iso_extension_mask_t iso_extension_mask; /* What extensions we
- tolerate. */
-};
-
-/*!
- Open an ISO 9660 image for reading. Maybe in the future we will have
- a mode. NULL is returned on error.
-*/
-iso9660_t *
-iso9660_open (const char *pathname /*, mode*/)
-{
- return iso9660_open_ext(pathname, ISO_EXTENSION_NONE);
-}
-
-/*!
- Open an ISO 9660 image for reading. Maybe in the future we will have
- a mode. NULL is returned on error.
-*/
-iso9660_t *
-iso9660_open_ext (const char *pathname,
- iso_extension_mask_t iso_extension_mask)
-{
- iso9660_t *p_iso = (iso9660_t *) _cdio_malloc(sizeof(struct _iso9660)) ;
-
- if (NULL == p_iso) return NULL;
-
- p_iso->stream = cdio_stdio_new( pathname );
- if (NULL == p_iso->stream)
- goto error;
-
- if ( !iso9660_ifs_read_superblock(p_iso, iso_extension_mask) )
- goto error;
-
- /* Determine if image has XA attributes. */
-
- p_iso->b_xa = !strncmp ((char *) &(p_iso->pvd) + ISO_XA_MARKER_OFFSET,
- ISO_XA_MARKER_STRING,
- strlen (ISO_XA_MARKER_STRING));
- p_iso->iso_extension_mask = iso_extension_mask;
- return p_iso;
-
- error:
- free(p_iso);
- return NULL;
-}
-
-
-
-/*!
- Close previously opened ISO 9660 image.
- True is unconditionally returned. If there was an error false would
- be returned.
-*/
-bool
-iso9660_close (iso9660_t *p_iso)
-{
- if (NULL != p_iso) {
- cdio_stdio_destroy(p_iso->stream);
- free(p_iso);
- }
- return true;
-}
-
-static bool
-check_pvd (const iso9660_pvd_t *p_pvd)
-{
- if ( ISO_VD_PRIMARY != from_711(p_pvd->type) ) {
- cdio_warn ("unexpected PVD type %d", p_pvd->type);
- return false;
- }
-
- if (strncmp (p_pvd->id, ISO_STANDARD_ID, strlen (ISO_STANDARD_ID)))
- {
- cdio_warn ("unexpected ID encountered (expected `"
- ISO_STANDARD_ID "', got `%.5s'", p_pvd->id);
- return false;
- }
- return true;
-}
-
-#ifdef HAVE_JOLIET
-static bool
-ucs2be_to_locale(ICONV_CONST char *psz_ucs2be, size_t i_inlen,
- char **p_psz_out, size_t i_outlen)
-{
-
- iconv_t ic =
-#if defined(HAVE_NL_LANGINFO)
- iconv_open(nl_langinfo(CODESET), "UCS-2BE");
-#else
- iconv_open("ASCII", "UCS-2BE");
-#endif
-
- int rc;
- char *psz_buf = NULL;
- char *psz_buf2;
- int i_outlen_max = i_outlen;
- int i_outlen_actual;
-
- if (-1 == (size_t) ic) {
-#if defined(HAVE_NL_LANGINFO)
- cdio_info("Failed to get conversion table for locale, trying ASCII");
- ic = iconv_open("ASCII", "UCS-2BE");
- if (-1 == (size_t) ic) {
- cdio_info("Failed to get conversion table for ASCII too");
- return false;
- }
-#else
- cdio_info("Failed to get conversion table for locale");
- return false;
-#endif
- }
-
- psz_buf = (char *) realloc(psz_buf, i_outlen);
- psz_buf2 = psz_buf;
- if (!psz_buf) {
- /* XXX: report out of memory error */
- goto error;
- }
- rc = iconv(ic, &psz_ucs2be, &i_inlen, &psz_buf2, &i_outlen);
- iconv_close(ic);
- if ((rc == -1) && (errno != E2BIG)) {
- /* conversion failed */
- goto error;
- }
- i_outlen_actual = i_outlen_max - i_outlen;
- *p_psz_out = malloc(i_outlen_actual + 1);
- memcpy(*p_psz_out, psz_buf, i_outlen_actual);
- *(*p_psz_out + i_outlen_actual) = '\0';
- free(psz_buf);
- return true;
- error:
- free(psz_buf);
- *p_psz_out = NULL;
- return false;
-}
-#endif /*HAVE_JOLIET*/
-
-/*!
- Return the application ID. NULL is returned in psz_app_id if there
- is some problem in getting this.
-*/
-bool
-iso9660_ifs_get_application_id(iso9660_t *p_iso,
- /*out*/ char **p_psz_app_id)
-{
- if (!p_iso) {
- *p_psz_app_id = NULL;
- return false;
- }
-
-#ifdef HAVE_JOLIET
- if (p_iso->i_joliet_level) {
- /* TODO: check that we haven't reached the maximum size.
- If we have, perhaps we've truncated and if we can get
- longer results *and* have the same character using
- the PVD, do that.
- */
- if ( ucs2be_to_locale(p_iso->svd.application_id,
- ISO_MAX_APPLICATION_ID,
- p_psz_app_id,
- ISO_MAX_APPLICATION_ID))
- return true;
- }
-#endif /*HAVE_JOLIET*/
- *p_psz_app_id = iso9660_get_application_id( &(p_iso->pvd) );
- return *p_psz_app_id != NULL && strlen(*p_psz_app_id);
-}
-
-/*!
- Return the Joliet level recognaized for p_iso.
-*/
-uint8_t iso9660_ifs_get_joliet_level(iso9660_t *p_iso)
-{
- if (!p_iso) return 0;
- return p_iso->i_joliet_level;
-}
-
-/*!
- Return a string containing the preparer id with trailing
- blanks removed.
-*/
-bool
-iso9660_ifs_get_preparer_id(iso9660_t *p_iso,
- /*out*/ char **p_psz_preparer_id)
-{
- if (!p_iso) {
- *p_psz_preparer_id = NULL;
- return false;
- }
-
-#ifdef HAVE_JOLIET
- if (p_iso->i_joliet_level) {
- /* TODO: check that we haven't reached the maximum size.
- If we have, perhaps we've truncated and if we can get
- longer results *and* have the same character using
- the PVD, do that.
- */
- if ( ucs2be_to_locale(p_iso->svd.preparer_id, ISO_MAX_PREPARER_ID,
- p_psz_preparer_id, ISO_MAX_PREPARER_ID) )
- return true;
- }
-#endif /*HAVE_JOLIET*/
- *p_psz_preparer_id = iso9660_get_preparer_id( &(p_iso->pvd) );
- return *p_psz_preparer_id != NULL && strlen(*p_psz_preparer_id);
-}
-
-/*!
- Return a string containing the PVD's publisher id with trailing
- blanks removed.
-*/
-bool iso9660_ifs_get_publisher_id(iso9660_t *p_iso,
- /*out*/ char **p_psz_publisher_id)
-{
- if (!p_iso) {
- *p_psz_publisher_id = NULL;
- return false;
- }
-
-#ifdef HAVE_JOLIET
- if (p_iso->i_joliet_level) {
- /* TODO: check that we haven't reached the maximum size.
- If we have, perhaps we've truncated and if we can get
- longer results *and* have the same character using
- the PVD, do that.
- */
- if( ucs2be_to_locale(p_iso->svd.publisher_id, ISO_MAX_PUBLISHER_ID,
- p_psz_publisher_id, ISO_MAX_PUBLISHER_ID) )
- return true;
- }
-#endif /*HAVE_JOLIET*/
- *p_psz_publisher_id = iso9660_get_publisher_id( &(p_iso->pvd) );
- return *p_psz_publisher_id != NULL && strlen(*p_psz_publisher_id);
-}
-
-
-/*!
- Return a string containing the PVD's publisher id with trailing
- blanks removed.
-*/
-bool iso9660_ifs_get_system_id(iso9660_t *p_iso,
- /*out*/ char **p_psz_system_id)
-{
- if (!p_iso) {
- *p_psz_system_id = NULL;
- return false;
- }
-
-#ifdef HAVE_JOLIET
- if (p_iso->i_joliet_level) {
- /* TODO: check that we haven't reached the maximum size.
- If we have, perhaps we've truncated and if we can get
- longer results *and* have the same character using
- the PVD, do that.
- */
- if ( ucs2be_to_locale(p_iso->svd.system_id, ISO_MAX_SYSTEM_ID,
- p_psz_system_id, ISO_MAX_SYSTEM_ID) )
- return true;
- }
-#endif /*HAVE_JOLIET*/
- *p_psz_system_id = iso9660_get_system_id( &(p_iso->pvd) );
- return *p_psz_system_id != NULL && strlen(*p_psz_system_id);
-}
-
-
-/*!
- Return a string containing the PVD's publisher id with trailing
- blanks removed.
-*/
-bool iso9660_ifs_get_volume_id(iso9660_t *p_iso,
- /*out*/ char **p_psz_volume_id)
-{
- if (!p_iso) {
- *p_psz_volume_id = NULL;
- return false;
- }
-
-#ifdef HAVE_JOLIET
- if (p_iso->i_joliet_level) {
- /* TODO: check that we haven't reached the maximum size.
- If we have, perhaps we've truncated and if we can get
- longer results *and* have the same character using
- the PVD, do that.
- */
- if ( ucs2be_to_locale(p_iso->svd.volume_id, ISO_MAX_VOLUME_ID,
- p_psz_volume_id, ISO_MAX_VOLUME_ID) )
- return true;
- }
-#endif /* HAVE_JOLIET */
- *p_psz_volume_id = iso9660_get_volume_id( &(p_iso->pvd) );
- return *p_psz_volume_id != NULL && strlen(*p_psz_volume_id);
-}
-
-
-/*!
- Return a string containing the PVD's publisher id with trailing
- blanks removed.
-*/
-bool iso9660_ifs_get_volumeset_id(iso9660_t *p_iso,
- /*out*/ char **p_psz_volumeset_id)
-{
- if (!p_iso) {
- *p_psz_volumeset_id = NULL;
- return false;
- }
-
-#ifdef HAVE_JOLIET
- if (p_iso->i_joliet_level) {
- /* TODO: check that we haven't reached the maximum size.
- If we have, perhaps we've truncated and if we can get
- longer results *and* have the same character using
- the PVD, do that.
- */
- if ( ucs2be_to_locale(p_iso->svd.volume_set_id,
- ISO_MAX_VOLUMESET_ID,
- p_psz_volumeset_id,
- ISO_MAX_VOLUMESET_ID) )
- return true;
- }
-#endif /*HAVE_JOLIET*/
- *p_psz_volumeset_id = iso9660_get_volume_id( &(p_iso->pvd) );
- return *p_psz_volumeset_id != NULL && strlen(*p_psz_volumeset_id);
-}
-
-
-/*!
- Read the Primary Volume Descriptor for an ISO 9660 image.
- True is returned if read, and false if there was an error.
-*/
-bool
-iso9660_ifs_read_pvd (const iso9660_t *p_iso, /*out*/ iso9660_pvd_t *p_pvd)
-{
- if (0 == iso9660_iso_seek_read (p_iso, p_pvd, ISO_PVD_SECTOR, 1)) {
- cdio_warn ("error reading PVD sector (%d)", ISO_PVD_SECTOR);
- return false;
- }
- return check_pvd(p_pvd);
-}
-
-
-/*!
- Read the Super block of an ISO 9660 image. This is the
- Primary Volume Descriptor (PVD) and perhaps a Supplemental Volume
- Descriptor if (Joliet) extensions are acceptable.
-*/
-bool
-iso9660_ifs_read_superblock (iso9660_t *p_iso,
- iso_extension_mask_t iso_extension_mask)
-{
- iso9660_svd_t *p_svd; /* Secondary volume descriptor. */
-
- if (!p_iso || !iso9660_ifs_read_pvd(p_iso, &(p_iso->pvd)))
- return false;
-
- p_svd = &(p_iso->svd);
- p_iso->i_joliet_level = 0;
-
- if (0 != iso9660_iso_seek_read (p_iso, p_svd, ISO_PVD_SECTOR+1, 1)) {
- if ( ISO_VD_SUPPLEMENTARY == from_711(p_svd->type) ) {
- if (p_svd->escape_sequences[0] == 0x25
- && p_svd->escape_sequences[1] == 0x2f) {
- switch (p_svd->escape_sequences[2]) {
- case 0x40:
- if (iso_extension_mask & ISO_EXTENSION_JOLIET_LEVEL1)
- p_iso->i_joliet_level = 1;
- break;
- case 0x43:
- if (iso_extension_mask & ISO_EXTENSION_JOLIET_LEVEL2)
- p_iso->i_joliet_level = 2;
- break;
- case 0x45:
- if (iso_extension_mask & ISO_EXTENSION_JOLIET_LEVEL3)
- p_iso->i_joliet_level = 3;
- break;
- default:
- cdio_info("Supplementary Volume Descriptor found, but not Joliet");
- }
- if (p_iso->i_joliet_level > 0) {
- cdio_info("Found Extension: Joliet Level %d", p_iso->i_joliet_level);
- }
- }
- }
- }
-
- return true;
-}
-
-
-/*!
- Read the Primary Volume Descriptor for of CD.
-*/
-bool
-iso9660_fs_read_pvd(const CdIo *p_cdio, /*out*/ iso9660_pvd_t *p_pvd)
-{
- /* A bit of a hack, we'll assume track 1 contains ISO_PVD_SECTOR.*/
- bool b_mode2;
- char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, };
- int i_rc;
-
- switch(cdio_get_track_format(p_cdio, 1)) {
- case TRACK_FORMAT_CDI:
- case TRACK_FORMAT_XA:
- b_mode2 = true;
- break;
- case TRACK_FORMAT_DATA:
- b_mode2 = false;
- break;
- case TRACK_FORMAT_AUDIO:
- case TRACK_FORMAT_PSX:
- case TRACK_FORMAT_ERROR:
- default:
- return false;
- }
-
- i_rc = b_mode2
- ? cdio_read_mode2_sector (p_cdio, buf, ISO_PVD_SECTOR, false)
- : cdio_read_mode1_sector (p_cdio, buf, ISO_PVD_SECTOR, false);
-
- if (i_rc) {
- cdio_warn ("error reading PVD sector (%d)", ISO_PVD_SECTOR);
- return false;
- }
-
- /* The size of a PVD or SVD is smaller than a sector. So we
- allocated a bigger block above (buf) and now we'll copy just
- the part we need to save.
- */
- cdio_assert (sizeof(buf) >= sizeof (iso9660_pvd_t));
- memcpy(p_pvd, buf, sizeof(iso9660_pvd_t));
-
- return check_pvd(p_pvd);
-}
-
-
-/*!
- Read the Super block of an ISO 9660 image. This is the
- Primary Volume Descriptor (PVD) and perhaps a Supplemental Volume
- Descriptor if (Joliet) extensions are acceptable.
-*/
-bool
-iso9660_fs_read_superblock (CdIo *p_cdio,
- iso_extension_mask_t iso_extension_mask)
-{
- if (!p_cdio) return false;
-
- {
- generic_img_private_t *p_env = (generic_img_private_t *) p_cdio->env;
- iso9660_pvd_t *p_pvd = &(p_env->pvd);
- iso9660_svd_t *p_svd = &(p_env->svd);
- char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, };
- bool b_mode2;
- int i_rc;
-
- /* A bit of a hack, we'll assume track 1 contains ISO_PVD_SECTOR.*/
- switch(cdio_get_track_format(p_cdio, 1)) {
- case TRACK_FORMAT_CDI:
- case TRACK_FORMAT_XA:
- b_mode2 = true;
- break;
- case TRACK_FORMAT_DATA:
- b_mode2 = false;
- break;
- case TRACK_FORMAT_AUDIO:
- case TRACK_FORMAT_PSX:
- case TRACK_FORMAT_ERROR:
- default:
- return false;
- }
-
- if ( !iso9660_fs_read_pvd(p_cdio, p_pvd) )
- return false;
-
- p_env->i_joliet_level = 0;
-
- i_rc = (b_mode2)
- ? cdio_read_mode2_sector (p_cdio, buf, ISO_PVD_SECTOR+1, false)
- : cdio_read_mode1_sector (p_cdio, buf, ISO_PVD_SECTOR+1, false);
-
- if (0 == i_rc) {
- /* The size of a PVD or SVD is smaller than a sector. So we
- allocated a bigger block above (buf) and now we'll copy just
- the part we need to save.
- */
- cdio_assert (sizeof(buf) >= sizeof (iso9660_svd_t));
- memcpy(p_svd, buf, sizeof(iso9660_svd_t));
-
- if ( ISO_VD_SUPPLEMENTARY == from_711(p_svd->type) ) {
- if (p_svd->escape_sequences[0] == 0x25
- && p_svd->escape_sequences[1] == 0x2f) {
- switch (p_svd->escape_sequences[2]) {
- case 0x40:
- if (iso_extension_mask & ISO_EXTENSION_JOLIET_LEVEL1)
- p_env->i_joliet_level = 1;
- break;
- case 0x43:
- if (iso_extension_mask & ISO_EXTENSION_JOLIET_LEVEL2)
- p_env->i_joliet_level = 2;
- break;
- case 0x45:
- if (iso_extension_mask & ISO_EXTENSION_JOLIET_LEVEL3)
- p_env->i_joliet_level = 3;
- break;
- default:
- cdio_info("Supplementary Volume Descriptor found, but not Joliet");
- }
- if (p_env->i_joliet_level > 0) {
- cdio_info("Found Extension: Joliet Level %d",
- p_env->i_joliet_level);
- }
- }
- }
- }
- }
-
- return true;
-}
-
-/*!
- Seek to a position and then read n blocks. Size read is returned.
-*/
-long int
-iso9660_iso_seek_read (const iso9660_t *p_iso, void *ptr, lsn_t start,
- long int size)
-{
- long int ret;
- if (NULL == p_iso) return 0;
- ret = cdio_stream_seek (p_iso->stream, start * ISO_BLOCKSIZE, SEEK_SET);
- if (ret!=0) return 0;
- return cdio_stream_read (p_iso->stream, ptr, ISO_BLOCKSIZE, size);
-}
-
-
-static iso9660_stat_t *
-_iso9660_dir_to_statbuf (iso9660_dir_t *p_iso9660_dir,
- bool b_mode2, uint8_t i_joliet_level)
-{
- iso9660_xa_t *xa_data = NULL;
- uint8_t dir_len= iso9660_get_dir_len(p_iso9660_dir);
- unsigned int filename_len;
- unsigned int stat_len;
- iso9660_stat_t *stat;
-
- if (!dir_len) return NULL;
-
- filename_len = from_711(p_iso9660_dir->filename_len);
-
- /* .. string in statbuf is one longer than in p_iso9660_dir's listing '\1' */
- stat_len = sizeof(iso9660_stat_t)+filename_len+2;
-
- stat = _cdio_malloc(stat_len);
- stat->type = (p_iso9660_dir->file_flags & ISO_DIRECTORY)
- ? _STAT_DIR : _STAT_FILE;
- stat->lsn = from_733 (p_iso9660_dir->extent);
- stat->size = from_733 (p_iso9660_dir->size);
- stat->secsize = _cdio_len2blocks (stat->size, ISO_BLOCKSIZE);
-
- if ('\0' == p_iso9660_dir->filename[0] && 1 == filename_len)
- strcpy (stat->filename, ".");
- else if ('\1' == p_iso9660_dir->filename[0] && 1 == filename_len)
- strcpy (stat->filename, "..");
- else {
-#ifdef HAVE_JOLIET
- if (i_joliet_level) {
- int i_inlen = filename_len;
- int i_outlen = (i_inlen / 2);
- char *p_psz_out = NULL;
- ucs2be_to_locale(p_iso9660_dir->filename, i_inlen,
- &p_psz_out, i_outlen);
- strncpy(stat->filename, p_psz_out, filename_len);
- free(p_psz_out);
- } else
-#endif /*HAVE_JOLIET*/
- strncpy (stat->filename, p_iso9660_dir->filename, filename_len);
- }
-
-
- iso9660_get_dtime(&(p_iso9660_dir->recording_time), true, &(stat->tm));
-
- cdio_assert (dir_len >= sizeof (iso9660_dir_t));
-
- if (b_mode2) {
- int su_length = iso9660_get_dir_len(p_iso9660_dir)
- - sizeof (iso9660_dir_t);
- su_length -= filename_len;
-
- if (su_length % 2)
- su_length--;
-
- if (su_length < 0 || su_length < sizeof (iso9660_xa_t))
- return stat;
-
- xa_data = (void *) (((char *) p_iso9660_dir)
- + (iso9660_get_dir_len(p_iso9660_dir) - su_length));
-
- if (xa_data->signature[0] != 'X'
- || xa_data->signature[1] != 'A')
- {
- cdio_warn ("XA signature not found in ISO9660's system use area;"
- " ignoring XA attributes for this file entry.");
- cdio_debug ("%d %d %d, '%c%c' (%d, %d)",
- iso9660_get_dir_len(p_iso9660_dir),
- filename_len,
- su_length,
- xa_data->signature[0], xa_data->signature[1],
- xa_data->signature[0], xa_data->signature[1]);
- return stat;
- }
- stat->xa = *xa_data;
- }
- return stat;
-
-}
-
-/*!
- Return the directory name stored in the iso9660_dir_t
-
- A string is allocated: the caller must deallocate.
- */
-char *
-iso9660_dir_to_name (const iso9660_dir_t *iso9660_dir)
-{
- char namebuf[256] = { 0, };
- uint8_t len=iso9660_get_dir_len(iso9660_dir);
-
- if (!len) return NULL;
-
- cdio_assert (len >= sizeof (iso9660_dir_t));
-
- /* (iso9660_dir->file_flags & ISO_DIRECTORY) */
-
- if (iso9660_dir->filename[0] == '\0')
- strcpy (namebuf, ".");
- else if (iso9660_dir->filename[0] == '\1')
- strcpy (namebuf, "..");
- else
- strncpy (namebuf, iso9660_dir->filename, iso9660_dir->filename_len);
-
- return strdup (namebuf);
-}
-
-/*
- Return a pointer to a ISO 9660 stat buffer or NULL if there's an error
-*/
-static iso9660_stat_t *
-_fs_stat_root (CdIo *p_cdio)
-{
-
- if (!p_cdio) return NULL;
-
- {
- iso_extension_mask_t iso_extension_mask = ISO_EXTENSION_ALL;
- generic_img_private_t *p_env = (generic_img_private_t *) p_cdio->env;
- bool b_mode2 = cdio_get_track_green(p_cdio, 1);
- iso9660_dir_t *p_iso9660_dir;
- iso9660_stat_t *p_stat;
-
- if (!p_env->i_joliet_level)
- iso_extension_mask &= ~ISO_EXTENSION_JOLIET;
-
- /* FIXME try also with Joliet.*/
- if ( !iso9660_fs_read_superblock (p_cdio, iso_extension_mask) ) {
- cdio_warn("Could not read ISO-9660 Superblock.");
- return NULL;
- }
-
-#ifdef HAVE_JOLIET
- p_iso9660_dir = p_env->i_joliet_level
- ? &(p_env->svd.root_directory_record)
- : &(p_env->pvd.root_directory_record) ;
-#else
- p_iso9660_dir = &(p_env->pvd.root_directory_record) ;
-#endif
-
- p_stat = _iso9660_dir_to_statbuf (p_iso9660_dir, b_mode2,
- p_env->i_joliet_level);
- return p_stat;
- }
-
-}
-
-static iso9660_stat_t *
-_fs_stat_iso_root (iso9660_t *p_iso)
-{
- iso9660_stat_t *p_stat;
- iso9660_dir_t *p_iso9660_dir;
-
-#ifdef HAVE_JOLIET
- p_iso9660_dir = p_iso->i_joliet_level
- ? &(p_iso->svd.root_directory_record)
- : &(p_iso->pvd.root_directory_record) ;
-#else
- p_iso9660_dir = &(p_iso->pvd.root_directory_record) ;
-#endif
-
- p_stat = _iso9660_dir_to_statbuf (p_iso9660_dir, true,
- p_iso->i_joliet_level);
- return p_stat;
-}
-
-static iso9660_stat_t *
-_fs_stat_traverse (const CdIo *p_cdio, const iso9660_stat_t *_root,
- char **splitpath, bool b_mode2, bool translate)
-{
- unsigned offset = 0;
- uint8_t *_dirbuf = NULL;
- iso9660_stat_t *p_stat;
- generic_img_private_t *p_env = (generic_img_private_t *) p_cdio->env;
-
- if (!splitpath[0])
- {
- unsigned int len=sizeof(iso9660_stat_t) + strlen(_root->filename)+1;
- p_stat = _cdio_malloc(len);
- memcpy(p_stat, _root, len);
- return p_stat;
- }
-
- if (_root->type == _STAT_FILE)
- return NULL;
-
- cdio_assert (_root->type == _STAT_DIR);
-
- if (_root->size != ISO_BLOCKSIZE * _root->secsize)
- {
- cdio_warn ("bad size for ISO9660 directory (%ud) should be (%lu)!",
- (unsigned) _root->size,
- (unsigned long int) ISO_BLOCKSIZE * _root->secsize);
- }
-
- _dirbuf = _cdio_malloc (_root->secsize * ISO_BLOCKSIZE);
-
- if (b_mode2) {
- if (cdio_read_mode2_sectors (p_cdio, _dirbuf, _root->lsn, false,
- _root->secsize))
- return NULL;
- } else {
- if (cdio_read_mode1_sectors (p_cdio, _dirbuf, _root->lsn, false,
- _root->secsize))
- return NULL;
- }
-
- while (offset < (_root->secsize * ISO_BLOCKSIZE))
- {
- iso9660_dir_t *p_iso9660_dir = (void *) &_dirbuf[offset];
- iso9660_stat_t *p_stat;
- int cmp;
-
- if (!iso9660_get_dir_len(p_iso9660_dir))
- {
- offset++;
- continue;
- }
-
- p_stat = _iso9660_dir_to_statbuf (p_iso9660_dir, b_mode2,
- p_env->i_joliet_level);
-
- if (translate) {
- char *trans_fname = malloc(strlen(p_stat->filename));
- int trans_len;
-
- if (trans_fname == NULL) {
- cdio_warn("can't allocate %lu bytes",
- (long unsigned int) strlen(p_stat->filename));
- return NULL;
- }
- trans_len = iso9660_name_translate_ext(p_stat->filename, trans_fname,
- p_env->i_joliet_level);
- cmp = strcmp(splitpath[0], trans_fname);
- free(trans_fname);
- } else {
- cmp = strcmp(splitpath[0], p_stat->filename);
- }
-
- if (!cmp) {
- iso9660_stat_t *ret_stat
- = _fs_stat_traverse (p_cdio, p_stat, &splitpath[1], b_mode2,
- translate);
- free(p_stat);
- free (_dirbuf);
- return ret_stat;
- }
-
- free(p_stat);
-
- offset += iso9660_get_dir_len(p_iso9660_dir);
- }
-
- cdio_assert (offset == (_root->secsize * ISO_BLOCKSIZE));
-
- /* not found */
- free (_dirbuf);
- return NULL;
-}
-
-static iso9660_stat_t *
-_fs_iso_stat_traverse (iso9660_t *p_iso, const iso9660_stat_t *_root,
- char **splitpath, bool translate)
-{
- unsigned offset = 0;
- uint8_t *_dirbuf = NULL;
- int ret;
-
- if (!splitpath[0])
- {
- iso9660_stat_t *p_stat;
- unsigned int len=sizeof(iso9660_stat_t) + strlen(_root->filename)+1;
- p_stat = _cdio_malloc(len);
- memcpy(p_stat, _root, len);
- return p_stat;
- }
-
- if (_root->type == _STAT_FILE)
- return NULL;
-
- cdio_assert (_root->type == _STAT_DIR);
-
- if (_root->size != ISO_BLOCKSIZE * _root->secsize)
- {
- cdio_warn ("bad size for ISO9660 directory (%ud) should be (%lu)!",
- (unsigned) _root->size,
- (unsigned long int) ISO_BLOCKSIZE * _root->secsize);
- }
-
- _dirbuf = _cdio_malloc (_root->secsize * ISO_BLOCKSIZE);
-
- ret = iso9660_iso_seek_read (p_iso, _dirbuf, _root->lsn, _root->secsize);
- if (ret!=ISO_BLOCKSIZE*_root->secsize) return NULL;
-
- while (offset < (_root->secsize * ISO_BLOCKSIZE))
- {
- iso9660_dir_t *p_iso9660_dir = (void *) &_dirbuf[offset];
- iso9660_stat_t *p_stat;
- int cmp;
-
- if (!iso9660_get_dir_len(p_iso9660_dir))
- {
- offset++;
- continue;
- }
-
- p_stat = _iso9660_dir_to_statbuf (p_iso9660_dir, true,
- p_iso->i_joliet_level);
-
- if (translate) {
- char *trans_fname = malloc(strlen(p_stat->filename)+1);
- int trans_len;
-
- if (trans_fname == NULL) {
- cdio_warn("can't allocate %lu bytes",
- (long unsigned int) strlen(p_stat->filename));
- return NULL;
- }
- trans_len = iso9660_name_translate_ext(p_stat->filename, trans_fname,
- p_iso->i_joliet_level);
- cmp = strcmp(splitpath[0], trans_fname);
- free(trans_fname);
- } else {
- cmp = strcmp(splitpath[0], p_stat->filename);
- }
-
- if (!cmp) {
- iso9660_stat_t *ret_stat
- = _fs_iso_stat_traverse (p_iso, p_stat, &splitpath[1], translate);
- free(p_stat);
- free (_dirbuf);
- return ret_stat;
- }
-
- free(p_stat);
-
- offset += iso9660_get_dir_len(p_iso9660_dir);
- }
-
- cdio_assert (offset == (_root->secsize * ISO_BLOCKSIZE));
-
- /* not found */
- free (_dirbuf);
- return NULL;
-}
-
-/*!
- Get file status for pathname into stat. NULL is returned on error.
- */
-iso9660_stat_t *
-iso9660_fs_stat (CdIo *p_cdio, const char pathname[])
-{
- iso9660_stat_t *p_root;
- char **p_psz_splitpath;
- iso9660_stat_t *p_stat;
- /* A bit of a hack, we'll assume track 1 contains ISO_PVD_SECTOR.*/
- bool b_mode2;
-
- if (!p_cdio) return NULL;
- if (!pathname) return NULL;
-
- p_root = _fs_stat_root (p_cdio);
- if (!p_root) return NULL;
-
- b_mode2 = cdio_get_track_green(p_cdio, 1);
- p_psz_splitpath = _cdio_strsplit (pathname, '/');
- p_stat = _fs_stat_traverse (p_cdio, p_root, p_psz_splitpath, b_mode2, false);
- free(p_root);
- _cdio_strfreev (p_psz_splitpath);
-
- return p_stat;
-}
-
-/*!
- Get file status for pathname into stat. NULL is returned on error.
- pathname version numbers in the ISO 9660
- name are dropped, i.e. ;1 is removed and if level 1 ISO-9660 names
- are lowercased.
- */
-iso9660_stat_t *
-iso9660_fs_stat_translate (CdIo *p_cdio, const char pathname[],
- bool b_mode2)
-{
- iso9660_stat_t *p_root;
- char **p_psz_splitpath;
- iso9660_stat_t *p_stat;
-
- if (!p_cdio) return NULL;
- if (pathname) return NULL;
-
- p_root = _fs_stat_root (p_cdio);
- if (!p_root) return NULL;
-
- p_psz_splitpath = _cdio_strsplit (pathname, '/');
- p_stat = _fs_stat_traverse (p_cdio, p_root, p_psz_splitpath, b_mode2, true);
- free(p_root);
- _cdio_strfreev (p_psz_splitpath);
-
- return p_stat;
-}
-
-/*!
- Get file status for pathname into stat. NULL is returned on error.
- */
-iso9660_stat_t *
-iso9660_ifs_stat (iso9660_t *p_iso, const char pathname[])
-{
- iso9660_stat_t *p_root;
- char **splitpath;
- iso9660_stat_t *stat;
-
- if (!p_iso) return NULL;
- if (!pathname) return NULL;
-
- p_root = _fs_stat_iso_root (p_iso);
- if (!p_root) return NULL;
-
- splitpath = _cdio_strsplit (pathname, '/');
- stat = _fs_iso_stat_traverse (p_iso, p_root, splitpath, false);
- free(p_root);
- /*** FIXME _cdio_strfreev (splitpath); ***/
-
- return stat;
-}
-
-/*!
- Get file status for pathname into stat. NULL is returned on error.
- pathname version numbers in the ISO 9660
- name are dropped, i.e. ;1 is removed and if level 1 ISO-9660 names
- are lowercased.
- */
-iso9660_stat_t *
-iso9660_ifs_stat_translate (iso9660_t *p_iso, const char pathname[])
-{
- iso9660_stat_t *p_root;
- char **p_psz_splitpath;
- iso9660_stat_t *p_stat;
-
- if (!p_iso) return NULL;
- if (!pathname) return NULL;
-
- p_root = _fs_stat_iso_root (p_iso);
- if (NULL == p_root) return NULL;
-
- p_psz_splitpath = _cdio_strsplit (pathname, '/');
- p_stat = _fs_iso_stat_traverse (p_iso, p_root, p_psz_splitpath, true);
- free(p_root);
- _cdio_strfreev (p_psz_splitpath);
-
- return p_stat;
-}
-
-/*!
- Read pathname (a directory) and return a list of iso9660_stat_t
- of the files inside that. The caller must free the returned result.
-*/
-CdioList *
-iso9660_fs_readdir (CdIo *p_cdio, const char pathname[], bool b_mode2)
-{
- generic_img_private_t *p_env;
- iso9660_stat_t *p_stat;
-
- if (!p_cdio) return NULL;
- if (!pathname) return NULL;
-
- p_env = (generic_img_private_t *) p_cdio->env;
-
- p_stat = iso9660_fs_stat (p_cdio, pathname);
- if (!p_stat) return NULL;
-
- if (p_stat->type != _STAT_DIR) {
- free(p_stat);
- return NULL;
- }
-
- {
- unsigned offset = 0;
- uint8_t *_dirbuf = NULL;
- CdioList *retval = _cdio_list_new ();
-
- if (p_stat->size != ISO_BLOCKSIZE * p_stat->secsize)
- {
- cdio_warn ("bad size for ISO9660 directory (%ud) should be (%lu)!",
- (unsigned) p_stat->size,
- (unsigned long int) ISO_BLOCKSIZE * p_stat->secsize);
- }
-
- _dirbuf = _cdio_malloc (p_stat->secsize * ISO_BLOCKSIZE);
-
- if (b_mode2) {
- if (cdio_read_mode2_sectors (p_cdio, _dirbuf, p_stat->lsn, false,
- p_stat->secsize))
- cdio_assert_not_reached ();
- } else {
- if (cdio_read_mode1_sectors (p_cdio, _dirbuf, p_stat->lsn, false,
- p_stat->secsize))
- cdio_assert_not_reached ();
- }
-
- while (offset < (p_stat->secsize * ISO_BLOCKSIZE))
- {
- iso9660_dir_t *p_iso9660_dir = (void *) &_dirbuf[offset];
- iso9660_stat_t *p_iso9660_stat;
-
- if (!iso9660_get_dir_len(p_iso9660_dir))
- {
- offset++;
- continue;
- }
-
- p_iso9660_stat = _iso9660_dir_to_statbuf(p_iso9660_dir, b_mode2,
- p_env->i_joliet_level);
- _cdio_list_append (retval, p_iso9660_stat);
-
- offset += iso9660_get_dir_len(p_iso9660_dir);
- }
-
- cdio_assert (offset == (p_stat->secsize * ISO_BLOCKSIZE));
-
- free (_dirbuf);
- free (p_stat);
- return retval;
- }
-}
-
-/*!
- Read pathname (a directory) and return a list of iso9660_stat_t
- of the files inside that. The caller must free the returned result.
-*/
-CdioList *
-iso9660_ifs_readdir (iso9660_t *p_iso, const char pathname[])
-{
- iso9660_stat_t *p_stat;
-
- if (!p_iso) return NULL;
- if (!pathname) return NULL;
-
- p_stat = iso9660_ifs_stat (p_iso, pathname);
- if (!p_stat) return NULL;
-
- if (p_stat->type != _STAT_DIR) {
- free(p_stat);
- return NULL;
- }
-
- {
- long int ret;
- unsigned offset = 0;
- uint8_t *_dirbuf = NULL;
- CdioList *retval = _cdio_list_new ();
-
- if (p_stat->size != ISO_BLOCKSIZE * p_stat->secsize)
- {
- cdio_warn ("bad size for ISO9660 directory (%ud) should be (%lu)!",
- (unsigned int) p_stat->size,
- (unsigned long int) ISO_BLOCKSIZE * p_stat->secsize);
- }
-
- _dirbuf = _cdio_malloc (p_stat->secsize * ISO_BLOCKSIZE);
-
- ret = iso9660_iso_seek_read (p_iso, _dirbuf, p_stat->lsn, p_stat->secsize);
- if (ret != ISO_BLOCKSIZE*p_stat->secsize) return NULL;
-
- while (offset < (p_stat->secsize * ISO_BLOCKSIZE))
- {
- iso9660_dir_t *p_iso9660_dir = (void *) &_dirbuf[offset];
- iso9660_stat_t *p_iso9660_stat;
-
- if (!iso9660_get_dir_len(p_iso9660_dir))
- {
- offset++;
- continue;
- }
-
- p_iso9660_stat = _iso9660_dir_to_statbuf(p_iso9660_dir, true,
- p_iso->i_joliet_level);
- _cdio_list_append (retval, p_iso9660_stat);
-
- offset += iso9660_get_dir_len(p_iso9660_dir);
- }
-
- cdio_assert (offset == (p_stat->secsize * ISO_BLOCKSIZE));
-
- free (_dirbuf);
- free (p_stat);
- return retval;
- }
-}
-
-static iso9660_stat_t *
-find_fs_lsn_recurse (CdIo *p_cdio, const char pathname[], lsn_t lsn)
-{
- CdioList *entlist = iso9660_fs_readdir (p_cdio, pathname, true);
- CdioList *dirlist = _cdio_list_new ();
- CdioListNode *entnode;
-
- cdio_assert (entlist != NULL);
-
- /* iterate over each entry in the directory */
-
- _CDIO_LIST_FOREACH (entnode, entlist)
- {
- iso9660_stat_t *statbuf = _cdio_list_node_data (entnode);
- char _fullname[4096] = { 0, };
- char *filename = (char *) statbuf->filename;
-
- snprintf (_fullname, sizeof (_fullname), "%s%s/", pathname, filename);
-
- if (statbuf->type == _STAT_DIR
- && strcmp ((char *) statbuf->filename, ".")
- && strcmp ((char *) statbuf->filename, ".."))
- _cdio_list_append (dirlist, strdup (_fullname));
-
- if (statbuf->lsn == lsn) {
- unsigned int len=sizeof(iso9660_stat_t)+strlen(statbuf->filename)+1;
- iso9660_stat_t *ret_stat = _cdio_malloc(len);
- memcpy(ret_stat, statbuf, len);
- _cdio_list_free (entlist, true);
- _cdio_list_free (dirlist, true);
- return ret_stat;
- }
-
- }
-
- _cdio_list_free (entlist, true);
-
- /* now recurse/descend over directories encountered */
-
- _CDIO_LIST_FOREACH (entnode, dirlist)
- {
- char *_fullname = _cdio_list_node_data (entnode);
- iso9660_stat_t *ret_stat = find_fs_lsn_recurse (p_cdio, _fullname, lsn);
-
- if (NULL != ret_stat) {
- _cdio_list_free (dirlist, true);
- return ret_stat;
- }
- }
-
- _cdio_list_free (dirlist, true);
- return NULL;
-}
-
-/*!
- Given a directory pointer, find the filesystem entry that contains
- lsn and return information about it.
-
- Returns stat_t of entry if we found lsn, or NULL otherwise.
- */
-iso9660_stat_t *
-iso9660_find_fs_lsn(CdIo *p_cdio, lsn_t i_lsn)
-{
- return find_fs_lsn_recurse (p_cdio, "/", i_lsn);
-}
-
-/*!
- Return true if ISO 9660 image has extended attrributes (XA).
-*/
-bool
-iso9660_ifs_is_xa (const iso9660_t * p_iso)
-{
- if (!p_iso) return false;
- return p_iso->b_xa;
-}
diff --git a/src/input/vcd/libcdio/iso9660_private.h b/src/input/vcd/libcdio/iso9660_private.h
deleted file mode 100644
index 9a10950aa..000000000
--- a/src/input/vcd/libcdio/iso9660_private.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- $Id: iso9660_private.h,v 1.2 2004/04/11 12:20:31 miguelfreitas Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
- Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
-
- See also iso9660.h by Eric Youngdale (1993).
-
- Copyright 1993 Yggdrasil Computing, Incorporated
- Copyright (c) 1999,2000 J. Schilling
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifndef __CDIO_ISO9660_PRIVATE_H__
-#define __CDIO_ISO9660_PRIVATE_H__
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <cdio/types.h>
-
-#define ISO_VERSION 1
-
-PRAGMA_BEGIN_PACKED
-
-struct iso_volume_descriptor {
- uint8_t type; /* 711 */
- char id[5];
- uint8_t version; /* 711 */
- char data[2041];
-} GNUC_PACKED;
-
-#define struct_iso_volume_descriptor_SIZEOF ISO_BLOCKSIZE
-
-#define struct_iso9660_pvd_SIZEOF ISO_BLOCKSIZE
-
-/*
- * XXX JS: The next structure has an odd length!
- * Some compilers (e.g. on Sun3/mc68020) padd the structures to even length.
- * For this reason, we cannot use sizeof (struct iso_path_table) or
- * sizeof (struct iso_directory_record) to compute on disk sizes.
- * Instead, we use offsetof(..., name) and add the name size.
- * See mkisofs.h
- */
-
-/* We use this to help us look up the parent inode numbers. */
-
-struct iso_path_table {
- uint8_t name_len; /* 711 */
- uint8_t xa_len; /* 711 */
- uint32_t extent; /* 731/732 */
- uint16_t parent; /* 721/722 */
- char name[EMPTY_ARRAY_SIZE];
-} GNUC_PACKED;
-
-#define struct_iso_path_table_SIZEOF 8
-
-#define struct_iso9660_dir_SIZEOF 33
-
-PRAGMA_END_PACKED
-
-#endif /* __CDIO_ISO9660_PRIVATE_H__ */
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libcdio/logging.c b/src/input/vcd/libcdio/logging.c
deleted file mode 100644
index 8d561debe..000000000
--- a/src/input/vcd/libcdio/logging.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- $Id: logging.c,v 1.2 2004/04/11 12:20:31 miguelfreitas Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
- Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <stdlib.h>
-#include <stdarg.h>
-#include <stdio.h>
-
-#include <cdio/logging.h>
-#include "cdio_assert.h"
-
-static const char _rcsid[] = "$Id: logging.c,v 1.2 2004/04/11 12:20:31 miguelfreitas Exp $";
-
-cdio_log_level_t cdio_loglevel_default = CDIO_LOG_WARN;
-
-static void
-default_cdio_log_handler (cdio_log_level_t level, const char message[])
-{
- switch (level)
- {
- case CDIO_LOG_ERROR:
- if (level >= cdio_loglevel_default) {
- fprintf (stderr, "**ERROR: %s\n", message);
- fflush (stderr);
- }
- exit (EXIT_FAILURE);
- break;
- case CDIO_LOG_DEBUG:
- if (level >= cdio_loglevel_default) {
- fprintf (stdout, "--DEBUG: %s\n", message);
- }
- break;
- case CDIO_LOG_WARN:
- if (level >= cdio_loglevel_default) {
- fprintf (stdout, "++ WARN: %s\n", message);
- }
- break;
- case CDIO_LOG_INFO:
- if (level >= cdio_loglevel_default) {
- fprintf (stdout, " INFO: %s\n", message);
- }
- break;
- case CDIO_LOG_ASSERT:
- if (level >= cdio_loglevel_default) {
- fprintf (stderr, "!ASSERT: %s\n", message);
- fflush (stderr);
- }
- abort ();
- break;
- default:
- cdio_assert_not_reached ();
- break;
- }
-
- fflush (stdout);
-}
-
-static cdio_log_handler_t _handler = default_cdio_log_handler;
-
-cdio_log_handler_t
-cdio_log_set_handler (cdio_log_handler_t new_handler)
-{
- cdio_log_handler_t old_handler = _handler;
-
- _handler = new_handler;
-
- return old_handler;
-}
-
-static void
-cdio_logv (cdio_log_level_t level, const char format[], va_list args)
-{
- char buf[1024] = { 0, };
- static int in_recursion = 0;
-
- if (in_recursion)
- cdio_assert_not_reached ();
-
- in_recursion = 1;
-
- vsnprintf(buf, sizeof(buf)-1, format, args);
-
- _handler(level, buf);
-
- in_recursion = 0;
-}
-
-void
-cdio_log (cdio_log_level_t level, const char format[], ...)
-{
- va_list args;
- va_start (args, format);
- cdio_logv (level, format, args);
- va_end (args);
-}
-
-#define CDIO_LOG_TEMPLATE(level, LEVEL) \
-void \
-cdio_ ## level (const char format[], ...) \
-{ \
- va_list args; \
- va_start (args, format); \
- cdio_logv (CDIO_LOG_ ## LEVEL, format, args); \
- va_end (args); \
-}
-
-CDIO_LOG_TEMPLATE(debug, DEBUG)
-CDIO_LOG_TEMPLATE(info, INFO)
-CDIO_LOG_TEMPLATE(warn, WARN)
-CDIO_LOG_TEMPLATE(error, ERROR)
-
-#undef CDIO_LOG_TEMPLATE
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libcdio/portable.h b/src/input/vcd/libcdio/portable.h
deleted file mode 100644
index 3da436245..000000000
--- a/src/input/vcd/libcdio/portable.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- $Id: portable.h,v 1.1 2005/01/01 02:43:57 rockyb Exp $
-
- Copyright (C) Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/*
- This file contains definitions to fill in for differences or
- deficiencies to OS or compiler irregularities. If this file is
- included other routines can be more portable.
-*/
-
-#ifndef __CDIO_PORTABLE_H__
-#define __CDIO_PORTABLE_H__
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#if !defined(HAVE_FTRUNCATE)
-# if defined ( WIN32 )
-# define ftruncate chsize
-# endif
-#endif /*HAVE_FTRUNCATE*/
-
-#if !defined(HAVE_SNPRINTF)
-# if defined ( MSVC )
-# define snprintf _snprintf
-# endif
-#endif /*HAVE_SNPRINTF*/
-
-#if !defined(HAVE_VSNPRINTF)
-# if defined ( MSVC )
-# define snprintf _vsnprintf
-# endif
-#endif /*HAVE_SNPRINTF*/
-
-#ifdef MSVC
-# include <io.h>
-
-# ifndef S_ISBLK
-# define _S_IFBLK 0060000 /* Block Special */
-# define S_ISBLK(x) (x & _S_IFBLK)
-# endif
-
-# ifndef S_ISCHR
-# define _S_IFCHR 0020000 /* character special */
-# define S_ISCHR(x) (x & _S_IFCHR)
-# endif
-#endif /*MSVC*/
-
-#ifdef HAVE_MEMSET
-# define BZERO(ptr, size) memset(ptr, 0, size)
-#elif HAVE_BZERO
-# define BZERO(ptr, size) bzero(ptr, size)
-#else
- Error -- you need either memset or bzero
-#endif
-
-#endif /* __CDIO_PORTABLE_H__ */
diff --git a/src/input/vcd/libcdio/scsi_mmc.c b/src/input/vcd/libcdio/scsi_mmc.c
deleted file mode 100644
index 9b4a456a5..000000000
--- a/src/input/vcd/libcdio/scsi_mmc.c
+++ /dev/null
@@ -1,589 +0,0 @@
-/* Common SCSI Multimedia Command (MMC) routines.
-
- $Id: scsi_mmc.c,v 1.1 2005/01/01 02:43:57 rockyb Exp $
-
- Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <cdio/cdio.h>
-#include <cdio/logging.h>
-#include <cdio/scsi_mmc.h>
-#include "cdio_private.h"
-
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-
-/*!
- On input a MODE_SENSE command was issued and we have the results
- in p. We interpret this and return a bit mask set according to the
- capabilities.
- */
-void
-scsi_mmc_get_drive_cap_buf(const uint8_t *p,
- /*out*/ cdio_drive_read_cap_t *p_read_cap,
- /*out*/ cdio_drive_write_cap_t *p_write_cap,
- /*out*/ cdio_drive_misc_cap_t *p_misc_cap)
-{
- /* Reader */
- if (p[2] & 0x01) *p_read_cap |= CDIO_DRIVE_CAP_READ_CD_R;
- if (p[2] & 0x02) *p_read_cap |= CDIO_DRIVE_CAP_READ_CD_RW;
- if (p[2] & 0x08) *p_read_cap |= CDIO_DRIVE_CAP_READ_DVD_ROM;
- if (p[4] & 0x01) *p_read_cap |= CDIO_DRIVE_CAP_READ_AUDIO;
- if (p[5] & 0x01) *p_read_cap |= CDIO_DRIVE_CAP_READ_CD_DA;
- if (p[5] & 0x10) *p_read_cap |= CDIO_DRIVE_CAP_READ_C2_ERRS;
-
- /* Writer */
- if (p[3] & 0x01) *p_write_cap |= CDIO_DRIVE_CAP_WRITE_CD_R;
- if (p[3] & 0x02) *p_write_cap |= CDIO_DRIVE_CAP_WRITE_CD_RW;
- if (p[3] & 0x10) *p_write_cap |= CDIO_DRIVE_CAP_WRITE_DVD_R;
- if (p[3] & 0x20) *p_write_cap |= CDIO_DRIVE_CAP_WRITE_DVD_RAM;
- if (p[4] & 0x80) *p_misc_cap |= CDIO_DRIVE_CAP_WRITE_BURN_PROOF;
-
- /* Misc */
- if (p[4] & 0x40) *p_misc_cap |= CDIO_DRIVE_CAP_MISC_MULTI_SESSION;
- if (p[6] & 0x01) *p_misc_cap |= CDIO_DRIVE_CAP_MISC_LOCK;
- if (p[6] & 0x08) *p_misc_cap |= CDIO_DRIVE_CAP_MISC_EJECT;
- if (p[6] >> 5 != 0)
- *p_misc_cap |= CDIO_DRIVE_CAP_MISC_CLOSE_TRAY;
-}
-
-/*!
- Return the number of length in bytes of the Command Descriptor
- buffer (CDB) for a given SCSI MMC command. The length will be
- either 6, 10, or 12.
-*/
-uint8_t
-scsi_mmc_get_cmd_len(uint8_t scsi_cmd)
-{
- static const uint8_t scsi_cdblen[8] = {6, 10, 10, 12, 12, 12, 10, 10};
- return scsi_cdblen[((scsi_cmd >> 5) & 7)];
-}
-
-/*!
- Run a SCSI MMC command.
-
- cdio CD structure set by cdio_open().
- i_timeout time in milliseconds we will wait for the command
- to complete. If this value is -1, use the default
- time-out value.
- buf Buffer for data, both sending and receiving
- len Size of buffer
- e_direction direction the transfer is to go
- cdb CDB bytes. All values that are needed should be set on
- input. We'll figure out what the right CDB length should be.
-
- We return 0 if command completed successfully and 1 if not.
- */
-int
-scsi_mmc_run_cmd( const CdIo *p_cdio, unsigned int i_timeout_ms,
- const scsi_mmc_cdb_t *p_cdb,
- scsi_mmc_direction_t e_direction, unsigned int i_buf,
- /*in/out*/ void *p_buf )
-{
- if (p_cdio && p_cdio->op.run_scsi_mmc_cmd) {
- return p_cdio->op.run_scsi_mmc_cmd(p_cdio->env, i_timeout_ms,
- scsi_mmc_get_cmd_len(p_cdb->field[0]),
- p_cdb, e_direction, i_buf, p_buf);
- } else
- return 1;
-}
-
-#define DEFAULT_TIMEOUT_MS 6000
-
-/*!
- * Eject using SCSI MMC commands. Return 0 if successful.
- */
-int
-scsi_mmc_eject_media( const CdIo *cdio )
-{
- int i_status;
- scsi_mmc_cdb_t cdb = {{0, }};
- uint8_t buf[1];
- scsi_mmc_run_cmd_fn_t run_scsi_mmc_cmd;
-
- if ( ! cdio || ! cdio->op.run_scsi_mmc_cmd )
- return -2;
-
- run_scsi_mmc_cmd = cdio->op.run_scsi_mmc_cmd;
-
- CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_ALLOW_MEDIUM_REMOVAL);
-
- i_status = run_scsi_mmc_cmd (cdio->env, DEFAULT_TIMEOUT_MS,
- scsi_mmc_get_cmd_len(cdb.field[0]), &cdb,
- SCSI_MMC_DATA_WRITE, 0, &buf);
- if (0 != i_status)
- return i_status;
-
- CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_START_STOP);
- cdb.field[4] = 1;
- i_status = run_scsi_mmc_cmd (cdio->env, DEFAULT_TIMEOUT_MS,
- scsi_mmc_get_cmd_len(cdb.field[0]), &cdb,
- SCSI_MMC_DATA_WRITE, 0, &buf);
- if (0 != i_status)
- return i_status;
-
- CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_START_STOP);
- cdb.field[4] = 2; /* eject */
-
- return run_scsi_mmc_cmd (cdio->env, DEFAULT_TIMEOUT_MS,
- scsi_mmc_get_cmd_len(cdb.field[0]), &cdb,
- SCSI_MMC_DATA_WRITE, 0, &buf);
-
-}
-
-/*! Packet driver to read mode2 sectors.
- Can read only up to 25 blocks.
-*/
-int
-scsi_mmc_read_sectors ( const CdIo *cdio, void *p_buf, lba_t lba,
- int sector_type, unsigned int nblocks )
-{
- scsi_mmc_cdb_t cdb = {{0, }};
-
- scsi_mmc_run_cmd_fn_t run_scsi_mmc_cmd;
-
- if ( ! cdio || ! cdio->op.run_scsi_mmc_cmd )
- return -2;
-
- run_scsi_mmc_cmd = cdio->op.run_scsi_mmc_cmd;
-
- CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_READ_CD);
- CDIO_MMC_SET_READ_TYPE (cdb.field, sector_type);
- CDIO_MMC_SET_READ_LBA (cdb.field, lba);
- CDIO_MMC_SET_READ_LENGTH24(cdb.field, nblocks);
- CDIO_MMC_SET_MAIN_CHANNEL_SELECTION_BITS(cdb.field,
- CDIO_MMC_MCSB_ALL_HEADERS);
-
- return run_scsi_mmc_cmd (cdio->env, DEFAULT_TIMEOUT_MS,
- scsi_mmc_get_cmd_len(cdb.field[0]), &cdb,
- SCSI_MMC_DATA_READ,
- CDIO_CD_FRAMESIZE_RAW * nblocks,
- p_buf);
-}
-
-int
-scsi_mmc_set_blocksize_private ( const void *p_env,
- const scsi_mmc_run_cmd_fn_t run_scsi_mmc_cmd,
- unsigned int bsize)
-{
- scsi_mmc_cdb_t cdb = {{0, }};
-
- struct
- {
- uint8_t reserved1;
- uint8_t medium;
- uint8_t reserved2;
- uint8_t block_desc_length;
- uint8_t density;
- uint8_t number_of_blocks_hi;
- uint8_t number_of_blocks_med;
- uint8_t number_of_blocks_lo;
- uint8_t reserved3;
- uint8_t block_length_hi;
- uint8_t block_length_med;
- uint8_t block_length_lo;
- } mh;
-
- if ( ! p_env || ! run_scsi_mmc_cmd )
- return -2;
-
- memset (&mh, 0, sizeof (mh));
- mh.block_desc_length = 0x08;
- mh.block_length_hi = (bsize >> 16) & 0xff;
- mh.block_length_med = (bsize >> 8) & 0xff;
- mh.block_length_lo = (bsize >> 0) & 0xff;
-
- CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_MODE_SELECT_6);
-
- cdb.field[1] = 1 << 4;
- cdb.field[4] = 12;
-
- return run_scsi_mmc_cmd (p_env, DEFAULT_TIMEOUT_MS,
- scsi_mmc_get_cmd_len(cdb.field[0]), &cdb,
- SCSI_MMC_DATA_WRITE, sizeof(mh), &mh);
-}
-
-int
-scsi_mmc_set_blocksize ( const CdIo *cdio, unsigned int bsize)
-{
- if ( ! cdio ) return -2;
- return
- scsi_mmc_set_blocksize_private (cdio->env, cdio->op.run_scsi_mmc_cmd,
- bsize);
-}
-
-
-/*!
- Return the the kind of drive capabilities of device.
- */
-void
-scsi_mmc_get_drive_cap_private (const void *p_env,
- const scsi_mmc_run_cmd_fn_t run_scsi_mmc_cmd,
- /*out*/ cdio_drive_read_cap_t *p_read_cap,
- /*out*/ cdio_drive_write_cap_t *p_write_cap,
- /*out*/ cdio_drive_misc_cap_t *p_misc_cap)
-{
- /* Largest buffer size we use. */
-#define BUF_MAX 2048
- uint8_t buf[BUF_MAX] = { 0, };
-
- scsi_mmc_cdb_t cdb = {{0, }};
- int i_status;
- uint16_t i_data = BUF_MAX;
-
- if ( ! p_env || ! run_scsi_mmc_cmd )
- return;
-
- CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_MODE_SENSE_10);
- cdb.field[1] = 0x0;
- cdb.field[2] = CDIO_MMC_ALL_PAGES;
-
- retry:
- CDIO_MMC_SET_READ_LENGTH16(cdb.field, 8);
-
- /* In the first run we run MODE SENSE 10 we are trying to get the
- length of the data features. */
- i_status = run_scsi_mmc_cmd (p_env, DEFAULT_TIMEOUT_MS,
- scsi_mmc_get_cmd_len(cdb.field[0]),
- &cdb, SCSI_MMC_DATA_READ,
- sizeof(buf), &buf);
- if (0 == i_status) {
- uint16_t i_data_try = (uint16_t) CDIO_MMC_GET_LEN16(buf);
- if (i_data_try < BUF_MAX) i_data = i_data_try;
- }
-
- /* Now try getting all features with length set above, possibly
- truncated or the default length if we couldn't get the proper
- length. */
- CDIO_MMC_SET_READ_LENGTH16(cdb.field, i_data);
-
- i_status = run_scsi_mmc_cmd (p_env, DEFAULT_TIMEOUT_MS,
- scsi_mmc_get_cmd_len(cdb.field[0]),
- &cdb, SCSI_MMC_DATA_READ,
- sizeof(buf), &buf);
-
- if (0 != i_status && CDIO_MMC_CAPABILITIES_PAGE != cdb.field[2]) {
- cdb.field[2] = CDIO_MMC_CAPABILITIES_PAGE;
- goto retry;
- }
-
- if (0 == i_status) {
- uint8_t *p;
- uint8_t *p_max = buf + 256;
-
- *p_read_cap = 0;
- *p_write_cap = 0;
- *p_misc_cap = 0;
-
- /* set to first sense mask, and then walk through the masks */
- p = buf + 8;
- while( (p < &(buf[2+i_data])) && (p < p_max) ) {
- uint8_t which_page;
-
- which_page = p[0] & 0x3F;
- switch( which_page )
- {
- case CDIO_MMC_AUDIO_CTL_PAGE:
- case CDIO_MMC_R_W_ERROR_PAGE:
- case CDIO_MMC_CDR_PARMS_PAGE:
- /* Don't handle these yet. */
- break;
- case CDIO_MMC_CAPABILITIES_PAGE:
- scsi_mmc_get_drive_cap_buf(p, p_read_cap, p_write_cap, p_misc_cap);
- break;
- default: ;
- }
- p += (p[1] + 2);
- }
- } else {
- cdio_info("%s: %s\n", "error in MODE_SELECT", strerror(errno));
- *p_read_cap = CDIO_DRIVE_CAP_ERROR;
- *p_write_cap = CDIO_DRIVE_CAP_ERROR;
- *p_misc_cap = CDIO_DRIVE_CAP_ERROR;
- }
- return;
-}
-
-void
-scsi_mmc_get_drive_cap (const CdIo *p_cdio,
- /*out*/ cdio_drive_read_cap_t *p_read_cap,
- /*out*/ cdio_drive_write_cap_t *p_write_cap,
- /*out*/ cdio_drive_misc_cap_t *p_misc_cap)
-{
- if ( ! p_cdio ) return;
- scsi_mmc_get_drive_cap_private (p_cdio->env,
- p_cdio->op.run_scsi_mmc_cmd,
- p_read_cap, p_write_cap, p_misc_cap);
-}
-
-void
-scsi_mmc_get_drive_cap_generic (const void *p_user_data,
- /*out*/ cdio_drive_read_cap_t *p_read_cap,
- /*out*/ cdio_drive_write_cap_t *p_write_cap,
- /*out*/ cdio_drive_misc_cap_t *p_misc_cap)
-{
- const generic_img_private_t *p_env = p_user_data;
- scsi_mmc_get_drive_cap( p_env->cdio,
- p_read_cap, p_write_cap, p_misc_cap );
-}
-
-
-/*!
- Get the DVD type associated with cd object.
-*/
-discmode_t
-scsi_mmc_get_dvd_struct_physical_private ( void *p_env, const
- scsi_mmc_run_cmd_fn_t run_scsi_mmc_cmd,
- cdio_dvd_struct_t *s)
-{
- scsi_mmc_cdb_t cdb = {{0, }};
- unsigned char buf[4 + 4 * 20], *base;
- int i_status;
- uint8_t layer_num = s->physical.layer_num;
-
- cdio_dvd_layer_t *layer;
-
- if ( ! p_env || ! run_scsi_mmc_cmd )
- return -2;
-
- if (layer_num >= CDIO_DVD_MAX_LAYERS)
- return -EINVAL;
-
- CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_READ_DVD_STRUCTURE);
- cdb.field[6] = layer_num;
- cdb.field[7] = CDIO_DVD_STRUCT_PHYSICAL;
- cdb.field[9] = sizeof(buf) & 0xff;
-
- i_status = run_scsi_mmc_cmd(p_env, DEFAULT_TIMEOUT_MS,
- scsi_mmc_get_cmd_len(cdb.field[0]),
- &cdb, SCSI_MMC_DATA_READ,
- sizeof(buf), &buf);
- if (0 != i_status)
- return CDIO_DISC_MODE_ERROR;
-
- base = &buf[4];
- layer = &s->physical.layer[layer_num];
-
- /*
- * place the data... really ugly, but at least we won't have to
- * worry about endianess in userspace.
- */
- memset(layer, 0, sizeof(*layer));
- layer->book_version = base[0] & 0xf;
- layer->book_type = base[0] >> 4;
- layer->min_rate = base[1] & 0xf;
- layer->disc_size = base[1] >> 4;
- layer->layer_type = base[2] & 0xf;
- layer->track_path = (base[2] >> 4) & 1;
- layer->nlayers = (base[2] >> 5) & 3;
- layer->track_density = base[3] & 0xf;
- layer->linear_density = base[3] >> 4;
- layer->start_sector = base[5] << 16 | base[6] << 8 | base[7];
- layer->end_sector = base[9] << 16 | base[10] << 8 | base[11];
- layer->end_sector_l0 = base[13] << 16 | base[14] << 8 | base[15];
- layer->bca = base[16] >> 7;
-
- return 0;
-}
-
-
-/*!
- Get the DVD type associated with cd object.
-*/
-discmode_t
-scsi_mmc_get_dvd_struct_physical ( const CdIo *p_cdio, cdio_dvd_struct_t *s)
-{
- if ( ! p_cdio ) return -2;
- return
- scsi_mmc_get_dvd_struct_physical_private (p_cdio->env,
- p_cdio->op.run_scsi_mmc_cmd,
- s);
-}
-
-/*!
- Get the CD-ROM hardware info via a SCSI MMC INQUIRY command.
- False is returned if we had an error getting the information.
-*/
-bool
-scsi_mmc_get_hwinfo ( const CdIo *p_cdio,
- /*out*/ cdio_hwinfo_t *hw_info )
-{
- int i_status; /* Result of SCSI MMC command */
- char buf[36] = { 0, }; /* Place to hold returned data */
- scsi_mmc_cdb_t cdb = {{0, }}; /* Command Descriptor Block */
-
- CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_INQUIRY);
- cdb.field[4] = sizeof(buf);
-
- if (! p_cdio || ! hw_info ) return false;
-
- i_status = scsi_mmc_run_cmd(p_cdio, DEFAULT_TIMEOUT_MS,
- &cdb, SCSI_MMC_DATA_READ,
- sizeof(buf), &buf);
- if (i_status == 0) {
-
- memcpy(hw_info->psz_vendor,
- buf + 8,
- sizeof(hw_info->psz_vendor)-1);
- hw_info->psz_vendor[sizeof(hw_info->psz_vendor)-1] = '\0';
- memcpy(hw_info->psz_model,
- buf + 8 + CDIO_MMC_HW_VENDOR_LEN,
- sizeof(hw_info->psz_model)-1);
- hw_info->psz_model[sizeof(hw_info->psz_model)-1] = '\0';
- memcpy(hw_info->psz_revision,
- buf + 8 + CDIO_MMC_HW_VENDOR_LEN + CDIO_MMC_HW_MODEL_LEN,
- sizeof(hw_info->psz_revision)-1);
- hw_info->psz_revision[sizeof(hw_info->psz_revision)-1] = '\0';
- return true;
- }
- return false;
-}
-
-/*!
- Return the media catalog number MCN.
-
- Note: string is malloc'd so caller should free() then returned
- string when done with it.
-
- */
-char *
-scsi_mmc_get_mcn_private ( void *p_env,
- const scsi_mmc_run_cmd_fn_t run_scsi_mmc_cmd
- )
-{
- scsi_mmc_cdb_t cdb = {{0, }};
- char buf[28] = { 0, };
- int i_status;
-
- if ( ! p_env || ! run_scsi_mmc_cmd )
- return NULL;
-
- CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_READ_SUBCHANNEL);
- cdb.field[1] = 0x0;
- cdb.field[2] = 0x40;
- cdb.field[3] = CDIO_SUBCHANNEL_MEDIA_CATALOG;
- CDIO_MMC_SET_READ_LENGTH16(cdb.field, sizeof(buf));
-
- i_status = run_scsi_mmc_cmd(p_env, DEFAULT_TIMEOUT_MS,
- scsi_mmc_get_cmd_len(cdb.field[0]),
- &cdb, SCSI_MMC_DATA_READ,
- sizeof(buf), buf);
- if(i_status == 0) {
- return strdup(&buf[9]);
- }
- return NULL;
-}
-
-char *
-scsi_mmc_get_mcn ( const CdIo *p_cdio )
-{
- if ( ! p_cdio ) return NULL;
- return scsi_mmc_get_mcn_private (p_cdio->env,
- p_cdio->op.run_scsi_mmc_cmd );
-}
-
-char *
-scsi_mmc_get_mcn_generic (const void *p_user_data)
-{
- const generic_img_private_t *p_env = p_user_data;
- return scsi_mmc_get_mcn( p_env->cdio );
-}
-
-/*
- Read cdtext information for a CdIo object .
-
- return true on success, false on error or CD-Text information does
- not exist.
-*/
-bool
-scsi_mmc_init_cdtext_private ( void *p_user_data,
- const scsi_mmc_run_cmd_fn_t run_scsi_mmc_cmd,
- set_cdtext_field_fn_t set_cdtext_field_fn
- )
-{
-
- generic_img_private_t *p_env = p_user_data;
- scsi_mmc_cdb_t cdb = {{0, }};
- unsigned char wdata[5000] = { 0, };
- int i_status, i_errno;
-
- if ( ! p_env || ! run_scsi_mmc_cmd || p_env->b_cdtext_error )
- return false;
-
- /* Operation code */
- CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_READ_TOC);
-
- cdb.field[1] = CDIO_CDROM_MSF;
- /* Format */
- cdb.field[2] = CDIO_MMC_READTOC_FMT_CDTEXT;
-
- /* Setup to read header, to get length of data */
- CDIO_MMC_SET_READ_LENGTH16(cdb.field, 4);
-
- errno = 0;
-
-/* Set read timeout 3 minues. */
-#define READ_TIMEOUT 3*60*1000
-
- /* We may need to give CD-Text a little more time to complete. */
- /* First off, just try and read the size */
- i_status = run_scsi_mmc_cmd (p_env, READ_TIMEOUT,
- scsi_mmc_get_cmd_len(cdb.field[0]),
- &cdb, SCSI_MMC_DATA_READ,
- 4, &wdata);
-
- if (i_status != 0) {
- cdio_info ("CD-Text read failed for header: %s\n", strerror(errno));
- i_errno = errno;
- p_env->b_cdtext_error = true;
- return false;
- } else {
- /* Now read the CD-Text data */
- int i_cdtext = CDIO_MMC_GET_LEN16(wdata);
-
- if (i_cdtext > sizeof(wdata)) i_cdtext = sizeof(wdata);
-
- CDIO_MMC_SET_READ_LENGTH16(cdb.field, i_cdtext);
- i_status = run_scsi_mmc_cmd (p_env, READ_TIMEOUT,
- scsi_mmc_get_cmd_len(cdb.field[0]),
- &cdb, SCSI_MMC_DATA_READ,
- i_cdtext, &wdata);
- if (i_status != 0) {
- cdio_info ("CD-Text read for text failed: %s\n", strerror(errno));
- i_errno = errno;
- p_env->b_cdtext_error = true;
- return false;
- }
- p_env->b_cdtext_init = true;
- return cdtext_data_init(p_env, p_env->i_first_track, wdata,
- set_cdtext_field_fn);
- }
-}
-
diff --git a/src/input/vcd/libcdio/scsi_mmc.h b/src/input/vcd/libcdio/scsi_mmc.h
deleted file mode 100644
index b6ea05b7a..000000000
--- a/src/input/vcd/libcdio/scsi_mmc.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- $Id: scsi_mmc.h,v 1.2 2004/04/11 12:20:31 miguelfreitas Exp $
-
- Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/*
- This file contains common definitions/routines for SCSI MMC
- (Multimedia commands).
-*/
-
-#ifndef __SCSI_MMC_H__
-#define __SCSI_MMC_H__
-
-/* Leval values that can go into READ_CD */
-#define CDIO_MMC_READ_TYPE_ANY 0 /* All types */
-#define CDIO_MMC_READ_TYPE_CDDA 1 /* Only CD-DA sectors */
-#define CDIO_MMC_READ_TYPE_MODE1 2 /* Only mode1 sectors (user data = 2048) */
-#define CDIO_MMC_READ_TYPE_MODE2 3 /* mode2 sectors form1 or form2 */
-#define CDIO_MMC_READ_TYPE_M2F1 4 /* mode2 sectors form1 */
-#define CDIO_MMC_READ_TYPE_M2F2 5 /* mode2 sectors form2 */
-
-/* The generic packet command opcodes for CD/DVD Logical Units,
- * From Table 57 of the SFF8090 Ver. 3 (Mt. Fuji) draft standard. */
-#define CDIO_MMC_GPCMD_READ_CD 0xbe
-#define CDIO_MMC_GPCMD_READ_10 0x28
-#define CDIO_MMC_GPCMD_READ_12 0xa8
-
-#define CDIO_MMC_SET_READ_TYPE(rec, sector_type) \
- rec[1] = (sector_type << 2)
-
-
-#define CDIO_MMC_SET_READ_LBA(rec, lba) \
- rec[2] = (lba >> 24) & 0xff; \
- rec[3] = (lba >> 16) & 0xff; \
- rec[4] = (lba >> 8) & 0xff; \
- rec[5] = (lba ) & 0xff
-
-#define CDIO_MMC_SET_READ_LENGTH(rec, len) \
- rec[6] = (len >> 16) & 0xff; \
- rec[7] = (len >> 8) & 0xff; \
- rec[8] = (len ) & 0xff
-
-#define CDIO_MMC_MCSB_ALL_HEADERS 0x78
-
-#define CDIO_MMC_SET_MAIN_CHANNEL_SELECTION_BITS(rec, val) \
- rec[9] = val;
-
-#endif /* __SCSI_MMC_H__ */
diff --git a/src/input/vcd/libcdio/scsi_mmc_private.h b/src/input/vcd/libcdio/scsi_mmc_private.h
deleted file mode 100644
index b3f1e7061..000000000
--- a/src/input/vcd/libcdio/scsi_mmc_private.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/* private MMC helper routines.
-
- $Id: scsi_mmc_private.h,v 1.1 2005/01/01 02:43:57 rockyb Exp $
-
- Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#include <cdio/scsi_mmc.h>
-#include "cdtext_private.h"
-
-/*! Convert milliseconds to seconds taking the ceiling value, i.e.
- 1002 milliseconds gets rounded to 2 seconds.
-*/
-#define SECS2MSECS 1000
-static inline unsigned int
-msecs2secs(unsigned int msecs)
-{
- return (msecs+(SECS2MSECS-1)) / SECS2MSECS;
-}
-#undef SECS2MSECS
-
-typedef
-int (*scsi_mmc_run_cmd_fn_t) ( const void *p_user_data,
- unsigned int i_timeout_ms,
- unsigned int i_cdb,
- const scsi_mmc_cdb_t *p_cdb,
- scsi_mmc_direction_t e_direction,
- unsigned int i_buf, /*in/out*/ void *p_buf );
-
-int scsi_mmc_set_blocksize_mmc_private ( const void *p_env, const
- scsi_mmc_run_cmd_fn_t run_scsi_mmc_cmd,
- unsigned int bsize );
-
-/*!
- Get the DVD type associated with cd object.
-*/
-discmode_t
-scsi_mmc_get_dvd_struct_physical_private ( void *p_env, const
- scsi_mmc_run_cmd_fn_t run_scsi_mmc_cmd,
- cdio_dvd_struct_t *s );
-
-
-int
-scsi_mmc_set_blocksize_private ( const void *p_env,
- const scsi_mmc_run_cmd_fn_t run_scsi_mmc_cmd,
- unsigned int bsize);
-
-char *scsi_mmc_get_mcn_private ( void *p_env,
- const scsi_mmc_run_cmd_fn_t run_scsi_mmc_cmd
- );
-
-char *scsi_mmc_get_mcn_generic (const void *p_user_data);
-
-bool scsi_mmc_init_cdtext_private ( void *user_data, const
- scsi_mmc_run_cmd_fn_t run_scsi_mmc_cmd,
- set_cdtext_field_fn_t set_cdtext_field_fn
- );
-
-/*!
- On input a MODE_SENSE command was issued and we have the results
- in p. We interpret this and return a bit mask set according to the
- capabilities.
- */
-void scsi_mmc_get_drive_cap_buf(const uint8_t *p,
- /*out*/ cdio_drive_read_cap_t *p_read_cap,
- /*out*/ cdio_drive_write_cap_t *p_write_cap,
- /*out*/ cdio_drive_misc_cap_t *p_misc_cap);
-
-/*!
- Return the the kind of drive capabilities of device.
-
- Note: string is malloc'd so caller should free() then returned
- string when done with it.
-
- */
-void
-scsi_mmc_get_drive_cap_private (const void *p_env,
- const scsi_mmc_run_cmd_fn_t run_scsi_mmc_cmd,
- /*out*/ cdio_drive_read_cap_t *p_read_cap,
- /*out*/ cdio_drive_write_cap_t *p_write_cap,
- /*out*/ cdio_drive_misc_cap_t *p_misc_cap);
-void
-scsi_mmc_get_drive_cap_generic (const void *p_user_data,
- /*out*/ cdio_drive_read_cap_t *p_read_cap,
- /*out*/ cdio_drive_write_cap_t *p_write_cap,
- /*out*/ cdio_drive_misc_cap_t *p_misc_cap);
-
-
-
-
-
diff --git a/src/input/vcd/libcdio/sector.c b/src/input/vcd/libcdio/sector.c
deleted file mode 100644
index da49e9908..000000000
--- a/src/input/vcd/libcdio/sector.c
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
- $Id: sector.c,v 1.3 2005/01/01 02:43:57 rockyb Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <cdio/sector.h>
-#include <cdio/util.h>
-#include <cdio/logging.h>
-#include "cdio_assert.h"
-
-#include <stdio.h>
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-#include <ctype.h>
-
-static const char _rcsid[] = "$Id: sector.c,v 1.3 2005/01/01 02:43:57 rockyb Exp $";
-
-lba_t
-cdio_lba_to_lsn (lba_t lba)
-{
- if (CDIO_INVALID_LBA == lba) return CDIO_INVALID_LSN;
- return lba - CDIO_PREGAP_SECTORS;
-}
-
-/*
- The below is adapted from cdparanoia code which claims it is
- straight from the MMC3 spec.
-*/
-
-void
-cdio_lsn_to_msf (lsn_t lsn, msf_t *msf)
-{
- int m, s, f;
-
- cdio_assert (msf != 0);
-
- if ( lsn >= -CDIO_PREGAP_SECTORS ){
- m = (lsn + CDIO_PREGAP_SECTORS) / CDIO_CD_FRAMES_PER_MIN;
- lsn -= m * CDIO_CD_FRAMES_PER_MIN;
- s = (lsn + CDIO_PREGAP_SECTORS) / CDIO_CD_FRAMES_PER_SEC;
- lsn -= s * CDIO_CD_FRAMES_PER_SEC;
- f = lsn + CDIO_PREGAP_SECTORS;
- } else {
- m = (lsn + CDIO_CD_MAX_LSN) / CDIO_CD_FRAMES_PER_MIN;
- lsn -= m * (CDIO_CD_FRAMES_PER_MIN);
- s = (lsn+CDIO_CD_MAX_LSN) / CDIO_CD_FRAMES_PER_SEC;
- lsn -= s * CDIO_CD_FRAMES_PER_SEC;
- f = lsn + CDIO_CD_MAX_LSN;
- }
-
- if (m > 99) {
- cdio_warn ("number of minutes (%d) truncated to 99.", m);
- m = 99;
- }
-
- msf->m = cdio_to_bcd8 (m);
- msf->s = cdio_to_bcd8 (s);
- msf->f = cdio_to_bcd8 (f);
-}
-
-/*!
- Convert an LBA into a string representation of the MSF.
- \warning cdio_lba_to_msf_str returns new allocated string */
-char *
-cdio_lba_to_msf_str (lba_t lba)
-{
-
- if (CDIO_INVALID_LBA == lba) {
- return strdup("*INVALID");
- } else {
- msf_t msf;
- msf.m = msf.s = msf.f = 0;
- cdio_lba_to_msf (lba, &msf);
- return cdio_msf_to_str(&msf);
- }
-}
-
-/*!
- Convert an LSN into the corresponding LBA.
- CDIO_INVALID_LBA is returned if there is an error.
-*/
-lba_t
-cdio_lsn_to_lba (lsn_t lsn)
-{
- if (CDIO_INVALID_LSN == lsn) return CDIO_INVALID_LBA;
- return lsn + CDIO_PREGAP_SECTORS;
-}
-
-/*!
- Convert an LBA into the corresponding MSF.
-*/
-void
-cdio_lba_to_msf (lba_t lba, msf_t *msf)
-{
- cdio_assert (msf != 0);
- cdio_lsn_to_msf(cdio_lba_to_lsn(lba), msf);
-}
-
-/*!
- Convert a MSF into the corresponding LBA.
- CDIO_INVALID_LBA is returned if there is an error.
-*/
-lba_t
-cdio_msf_to_lba (const msf_t *msf)
-{
- uint32_t lba = 0;
-
- cdio_assert (msf != 0);
-
- lba = cdio_from_bcd8 (msf->m);
- lba *= CDIO_CD_SECS_PER_MIN;
-
- lba += cdio_from_bcd8 (msf->s);
- lba *= CDIO_CD_FRAMES_PER_SEC;
-
- lba += cdio_from_bcd8 (msf->f);
-
- return lba;
-}
-
-/*!
- Convert a MSF into the corresponding LSN.
- CDIO_INVALID_LSN is returned if there is an error.
-*/
-lba_t
-cdio_msf_to_lsn (const msf_t *msf)
-{
- return cdio_lba_to_lsn(cdio_msf_to_lba (msf));
-}
-
-/*!
- Convert an LBA into a string representation of the MSF.
- \warning cdio_lba_to_msf_str returns new allocated string */
-char *
-cdio_msf_to_str (const msf_t *msf)
-{
- char buf[16];
-
- snprintf (buf, sizeof (buf), "%2.2x:%2.2x:%2.2x", msf->m, msf->s, msf->f);
- return strdup (buf);
-}
-
-/*!
- Convert a MSF - broken out as 3 integer components into the
- corresponding LBA.
- CDIO_INVALID_LBA is returned if there is an error.
-*/
-lba_t
-cdio_msf3_to_lba (unsigned int minutes, unsigned int seconds,
- unsigned int frames)
-{
- return ((minutes * CDIO_CD_SECS_PER_MIN + seconds) * CDIO_CD_FRAMES_PER_SEC
- + frames);
-}
-
-/*!
- Convert a string of the form MM:SS:FF into the corresponding LBA.
- CDIO_INVALID_LBA is returned if there is an error.
-*/
-lba_t
-cdio_mmssff_to_lba (const char *psz_mmssff)
-{
- int psz_field;
- lba_t ret;
- char c;
-
- if (0 == strcmp (psz_mmssff, "0"))
- return 0;
-
- c = *psz_mmssff++;
- if(c >= '0' && c <= '9')
- psz_field = (c - '0');
- else
- return CDIO_INVALID_LBA;
- while(':' != (c = *psz_mmssff++)) {
- if(c >= '0' && c <= '9')
- psz_field = psz_field * 10 + (c - '0');
- else
- return CDIO_INVALID_LBA;
- }
-
- ret = cdio_msf3_to_lba (psz_field, 0, 0);
-
- c = *psz_mmssff++;
- if(c >= '0' && c <= '9')
- psz_field = (c - '0');
- else
- return CDIO_INVALID_LBA;
- if(':' != (c = *psz_mmssff++)) {
- if(c >= '0' && c <= '9') {
- psz_field = psz_field * 10 + (c - '0');
- c = *psz_mmssff++;
- if(c != ':')
- return CDIO_INVALID_LBA;
- }
- else
- return CDIO_INVALID_LBA;
- }
-
- if(psz_field >= CDIO_CD_SECS_PER_MIN)
- return CDIO_INVALID_LBA;
-
- ret += cdio_msf3_to_lba (0, psz_field, 0);
-
- c = *psz_mmssff++;
- if (isdigit(c))
- psz_field = (c - '0');
- else
- return -1;
- if('\0' != (c = *psz_mmssff++)) {
- if (isdigit(c)) {
- psz_field = psz_field * 10 + (c - '0');
- c = *psz_mmssff++;
- }
- else
- return CDIO_INVALID_LBA;
- }
-
- if('\0' != c)
- return CDIO_INVALID_LBA;
-
- if(psz_field >= CDIO_CD_FRAMES_PER_SEC)
- return CDIO_INVALID_LBA;
-
- ret += psz_field;
-
- return ret;
-}
-
-bool
-cdio_is_discmode_cdrom(discmode_t discmode)
-{
- switch (discmode) {
- case CDIO_DISC_MODE_CD_DA:
- case CDIO_DISC_MODE_CD_DATA:
- case CDIO_DISC_MODE_CD_XA:
- case CDIO_DISC_MODE_CD_MIXED:
- case CDIO_DISC_MODE_NO_INFO:
- return true;
- default:
- return false;
- }
-}
-
-bool
-cdio_is_discmode_dvd(discmode_t discmode)
-{
- switch (discmode) {
- case CDIO_DISC_MODE_DVD_ROM:
- case CDIO_DISC_MODE_DVD_RAM:
- case CDIO_DISC_MODE_DVD_R:
- case CDIO_DISC_MODE_DVD_RW:
- case CDIO_DISC_MODE_DVD_PR:
- case CDIO_DISC_MODE_DVD_PRW:
- return true;
- default:
- return false;
- }
-}
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libcdio/util.c b/src/input/vcd/libcdio/util.c
deleted file mode 100644
index 9c646daf6..000000000
--- a/src/input/vcd/libcdio/util.c
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- $Id: util.c,v 1.3 2005/01/01 02:43:57 rockyb Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
- Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#ifdef HAVE_INTTYPES_H
-#include "inttypes.h"
-#endif
-
-#include "cdio_assert.h"
-#include <cdio/types.h>
-#include <cdio/util.h>
-
-static const char _rcsid[] = "$Id: util.c,v 1.3 2005/01/01 02:43:57 rockyb Exp $";
-
-size_t
-_cdio_strlenv(char **str_array)
-{
- size_t n = 0;
-
- cdio_assert (str_array != NULL);
-
- while(str_array[n])
- n++;
-
- return n;
-}
-
-void
-_cdio_strfreev(char **strv)
-{
- int n;
-
- cdio_assert (strv != NULL);
-
- for(n = 0; strv[n]; n++)
- free(strv[n]);
-
- free(strv);
-}
-
-char *
-_cdio_strjoin (char *strv[], unsigned count, const char delim[])
-{
- size_t len;
- char *new_str;
- unsigned n;
-
- cdio_assert (strv != NULL);
- cdio_assert (delim != NULL);
-
- len = (count-1) * strlen (delim);
-
- for (n = 0;n < count;n++)
- len += strlen (strv[n]);
-
- len++;
-
- new_str = _cdio_malloc (len);
- new_str[0] = '\0';
-
- for (n = 0;n < count;n++)
- {
- if (n)
- strcat (new_str, delim);
- strcat (new_str, strv[n]);
- }
-
- return new_str;
-}
-
-char **
-_cdio_strsplit(const char str[], char delim) /* fixme -- non-reentrant */
-{
- int n;
- char **strv = NULL;
- char *_str, *p;
- char _delim[2] = { 0, 0 };
-
- cdio_assert (str != NULL);
-
- _str = strdup(str);
- _delim[0] = delim;
-
- cdio_assert (_str != NULL);
-
- n = 1;
- p = _str;
- while(*p)
- if (*(p++) == delim)
- n++;
-
- strv = _cdio_malloc (sizeof (char *) * (n+1));
-
- n = 0;
- while((p = strtok(n ? NULL : _str, _delim)) != NULL)
- strv[n++] = strdup(p);
-
- free(_str);
-
- return strv;
-}
-
-void *
-_cdio_malloc (size_t size)
-{
- void *new_mem = malloc (size);
-
- cdio_assert (new_mem != NULL);
-
- memset (new_mem, 0, size);
-
- return new_mem;
-}
-
-void *
-_cdio_memdup (const void *mem, size_t count)
-{
- void *new_mem = NULL;
-
- if (mem)
- {
- new_mem = _cdio_malloc (count);
- memcpy (new_mem, mem, count);
- }
-
- return new_mem;
-}
-
-char *
-_cdio_strdup_upper (const char str[])
-{
- char *new_str = NULL;
-
- if (str)
- {
- char *p;
-
- p = new_str = strdup (str);
-
- while (*p)
- {
- *p = toupper (*p);
- p++;
- }
- }
-
- return new_str;
-}
-
-uint8_t
-cdio_to_bcd8 (uint8_t n)
-{
- /*cdio_assert (n < 100);*/
-
- return ((n/10)<<4) | (n%10);
-}
-
-uint8_t
-cdio_from_bcd8(uint8_t p)
-{
- return (0xf & p)+(10*(p >> 4));
-}
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libcdio/xa.c b/src/input/vcd/libcdio/xa.c
deleted file mode 100644
index f811f7ebd..000000000
--- a/src/input/vcd/libcdio/xa.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- $Id: xa.c,v 1.3 2005/01/01 02:43:57 rockyb Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
- Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-/* Public headers */
-#include <cdio/iso9660.h>
-#include <cdio/util.h>
-#include <cdio/bytesex.h>
-
-/* Private headers */
-#include "cdio_assert.h"
-
-#define BUF_COUNT 16
-#define BUF_SIZE 80
-
-/* Return a pointer to a internal free buffer */
-static char *
-_getbuf (void)
-{
- static char _buf[BUF_COUNT][BUF_SIZE];
- static int _num = -1;
-
- _num++;
- _num %= BUF_COUNT;
-
- memset (_buf[_num], 0, BUF_SIZE);
-
- return _buf[_num];
-}
-
-/*!
- Returns a string which interpreting the extended attribute xa_attr.
- For example:
- \verbatim
- d---1xrxrxr
- ---2--r-r-r
- -a--1xrxrxr
- \endverbatim
-
- A description of the characters in the string follows
- The 1st character is either "d" if the entry is a directory, or "-" if not.
- The 2nd character is either "a" if the entry is CDDA (audio), or "-" if not.
- The 3rd character is either "i" if the entry is interleaved, or "-" if not.
- The 4th character is either "2" if the entry is mode2 form2 or "-" if not.
- The 5th character is either "1" if the entry is mode2 form1 or "-" if not.
- Note that an entry will either be in mode2 form1 or mode form2. That
- is you will either see "2-" or "-1" in the 4th & 5th positions.
-
- The 6th and 7th characters refer to permissions for a user while the
- the 8th and 9th characters refer to permissions for a group while, and
- the 10th and 11th characters refer to permissions for a others.
-
- In each of these pairs the first character (6, 8, 10) is "x" if the
- entry is executable. For a directory this means the directory is
- allowed to be listed or "searched".
- The second character of a pair (7, 9, 11) is "r" if the entry is allowed
- to be read.
-*/
-
-const char *
-iso9660_get_xa_attr_str (uint16_t xa_attr)
-{
- char *result = _getbuf();
-
- xa_attr = uint16_from_be (xa_attr);
-
- result[ 0] = (xa_attr & XA_ATTR_DIRECTORY) ? 'd' : '-';
- result[ 1] = (xa_attr & XA_ATTR_CDDA) ? 'a' : '-';
- result[ 2] = (xa_attr & XA_ATTR_INTERLEAVED) ? 'i' : '-';
- result[ 3] = (xa_attr & XA_ATTR_MODE2FORM2) ? '2' : '-';
- result[ 4] = (xa_attr & XA_ATTR_MODE2FORM1) ? '1' : '-';
-
- result[ 5] = (xa_attr & XA_PERM_XUSR) ? 'x' : '-';
- result[ 6] = (xa_attr & XA_PERM_RUSR) ? 'r' : '-';
-
- result[ 7] = (xa_attr & XA_PERM_XGRP) ? 'x' : '-';
- result[ 8] = (xa_attr & XA_PERM_RGRP) ? 'r' : '-';
-
- /* Hack alert: wonder if this should be ROTH and XOTH? */
- result[ 9] = (xa_attr & XA_PERM_XSYS) ? 'x' : '-';
- result[10] = (xa_attr & XA_PERM_RSYS) ? 'r' : '-';
-
- result[11] = '\0';
-
- return result;
-}
-
-iso9660_xa_t *
-iso9660_xa_init (iso9660_xa_t *_xa, uint16_t uid, uint16_t gid, uint16_t attr,
- uint8_t filenum)
-{
- cdio_assert (_xa != NULL);
-
- _xa->user_id = uint16_to_be (uid);
- _xa->group_id = uint16_to_be (gid);
- _xa->attributes = uint16_to_be (attr);
-
- _xa->signature[0] = 'X';
- _xa->signature[1] = 'A';
-
- _xa->filenum = filenum;
-
- _xa->reserved[0]
- = _xa->reserved[1]
- = _xa->reserved[2]
- = _xa->reserved[3]
- = _xa->reserved[4] = 0x00;
-
- return _xa;
-}
diff --git a/src/input/vcd/libvcd/Makefile.am b/src/input/vcd/libvcd/Makefile.am
deleted file mode 100644
index 01b100aa4..000000000
--- a/src/input/vcd/libvcd/Makefile.am
+++ /dev/null
@@ -1,66 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-SUBDIRS = libvcd
-
-INCLUDES = $(LIBCDIO_CFLAGS) -I$(top_srcdir)/include -I$(top_srcdir)/lib
-
-libvcd_SRCS = \
- vcd.c \
- data_structures.c \
- directory.c \
- files.c \
- image.c \
- image_bincue.c \
- image_cdrdao.c \
- image_nrg.c \
- logging.c \
- mpeg.c \
- mpeg_stream.c \
- pbc.c \
- salloc.c \
- sector.c \
- stream.c \
- stream_stdio.c \
- util.c
-
-libvcdinfo_SRCS = \
- info.c \
- inf.c \
- info_private.c \
- vcd_read.c
-
-EXTRA_DIST = $(libvcd_SRCS) $(libvcdinfo_SRCS)
-
-if ENABLE_VCD
-if HAVE_VCDNAV
-else
-noinst_LTLIBRARIES = libvcd.la libvcdinfo.la
-libvcd_la_SOURCES = $(libvcd_SRCS)
-libvcd_la_LDFLAGS = -avoid-version -module
-libvcd_la_LIBADD = $(LIBCDIO_LIBS) $(LIBISO9660_LIBS)
-libvcdinfo_la_SOURCES = $(libvcdinfo_SRCS)
-libvcdinfo_la_LDFLAGS = -avoid-version -module
-endif
-endif
-
-noinst_HEADERS = \
- vcd_assert.h \
- data_structures.h \
- info_private.h \
- pbc.h \
- stream_stdio.h \
- bitvec.h \
- dict.h \
- mpeg.h \
- salloc.h \
- util.h \
- bytesex_asm.h \
- directory.h \
- mpeg_stream.h \
- sector_private.h \
- vcd.h \
- bytesex.h \
- image_sink.h \
- obj.h \
- stream.h \
- vcd_read.h
diff --git a/src/input/vcd/libvcd/bitvec.h b/src/input/vcd/libvcd/bitvec.h
deleted file mode 100644
index f45059db0..000000000
--- a/src/input/vcd/libvcd/bitvec.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- $Id: bitvec.h,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifndef __VCD_BITVEC_H__
-#define __VCD_BITVEC_H__
-
-#include <libvcd/types.h>
-
-#include "vcd_assert.h"
-
-static inline bool
-_vcd_bit_set_p (const uint32_t n, const unsigned bit)
-{
- return ((n >> bit) & 0x1) == 0x1;
-}
-
-static inline int
-vcd_bitvec_align (int value, const int boundary)
-{
- if (value % boundary)
- value += (boundary - (value % boundary));
-
- return value;
-}
-
-/*
- * PEEK
- */
-
-#define vcd_bitvec_peek_bits16(bitvec, offset) \
- vcd_bitvec_peek_bits ((bitvec), (offset), 16)
-
-static inline uint32_t
-vcd_bitvec_peek_bits (const uint8_t bitvec[],
- const unsigned offset,
- const unsigned bits)
-{
- uint32_t result = 0;
- unsigned i = offset;
-
- vcd_assert (bits > 0 && bits <= 32);
-
-#if 0
- j = 0;
- while (j < bits)
- if (i % 8 || (bits - j) < 8)
- {
- result <<= 1;
- if (_vcd_bit_set_p (bitvec[i >> 3], 7 - (i % 8)))
- result |= 0x1;
- j++, i++;
- }
- else
- {
- result <<= 8;
- result |= bitvec[i >> 3];
- j += 8, i += 8;
- }
-#else
- if (!(offset % 8) && !(bits % 8)) /* optimization */
- for (i = offset; i < (offset + bits); i+= 8)
- {
- result <<= 8;
- result |= bitvec[i >> 3];
- }
- else /* general case */
- for (i = offset; i < (offset + bits); i++)
- {
- result <<= 1;
- if (_vcd_bit_set_p (bitvec[i >> 3], 7 - (i % 8)))
- result |= 0x1;
- }
-#endif
-
- return result;
-}
-
-static inline uint32_t
-vcd_bitvec_peek_bits32 (const uint8_t bitvec[], unsigned offset)
-{
- if (offset % 8)
- return vcd_bitvec_peek_bits (bitvec, offset, 32);
-
- offset >>= 3;
-
- return (bitvec[offset] << 24
- | bitvec[offset + 1] << 16
- | bitvec[offset + 2] << 8
- | bitvec[offset + 3]);
-}
-
-/*
- * READ
- */
-
-static inline uint32_t
-vcd_bitvec_read_bits (const uint8_t bitvec[], unsigned *offset, const unsigned bits)
-{
- const unsigned i = *offset;
-
- *offset += bits;
-
- return vcd_bitvec_peek_bits (bitvec, i, bits);
-}
-
-static inline bool
-vcd_bitvec_read_bit (const uint8_t bitvec[], unsigned *offset)
-{
- const unsigned i = (*offset)++;
-
- return _vcd_bit_set_p (bitvec[i >> 3], 7 - (i % 8));
-}
-
-#endif /* __VCD_BITVEC_H__ */
diff --git a/src/input/vcd/libvcd/bytesex.h b/src/input/vcd/libvcd/bytesex.h
deleted file mode 100644
index 9a212693d..000000000
--- a/src/input/vcd/libvcd/bytesex.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- $Id: bytesex.h,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifndef __VCD_BYTESEX_H__
-#define __VCD_BYTESEX_H__
-
-#include <cdio/cdio.h>
-#include <libvcd/types.h>
-#include <libvcd/logging.h>
-
-/* Private includes */
-#include "bytesex_asm.h"
-
-/* generic byteswap routines */
-
-#define UINT16_SWAP_LE_BE_C(val) ((uint16_t) ( \
- (((uint16_t) (val) & (uint16_t) 0x00ffU) << 8) | \
- (((uint16_t) (val) & (uint16_t) 0xff00U) >> 8)))
-
-#define UINT32_SWAP_LE_BE_C(val) ((uint32_t) ( \
- (((uint32_t) (val) & (uint32_t) 0x000000ffU) << 24) | \
- (((uint32_t) (val) & (uint32_t) 0x0000ff00U) << 8) | \
- (((uint32_t) (val) & (uint32_t) 0x00ff0000U) >> 8) | \
- (((uint32_t) (val) & (uint32_t) 0xff000000U) >> 24)))
-
-#define UINT64_SWAP_LE_BE_C(val) ((uint64_t) ( \
- (((uint64_t) (val) & (uint64_t) UINT64_C(0x00000000000000ff)) << 56) | \
- (((uint64_t) (val) & (uint64_t) UINT64_C(0x000000000000ff00)) << 40) | \
- (((uint64_t) (val) & (uint64_t) UINT64_C(0x0000000000ff0000)) << 24) | \
- (((uint64_t) (val) & (uint64_t) UINT64_C(0x00000000ff000000)) << 8) | \
- (((uint64_t) (val) & (uint64_t) UINT64_C(0x000000ff00000000)) >> 8) | \
- (((uint64_t) (val) & (uint64_t) UINT64_C(0x0000ff0000000000)) >> 24) | \
- (((uint64_t) (val) & (uint64_t) UINT64_C(0x00ff000000000000)) >> 40) | \
- (((uint64_t) (val) & (uint64_t) UINT64_C(0xff00000000000000)) >> 56)))
-
-#ifndef UINT16_SWAP_LE_BE
-# define UINT16_SWAP_LE_BE UINT16_SWAP_LE_BE_C
-#endif
-
-#ifndef UINT32_SWAP_LE_BE
-# define UINT32_SWAP_LE_BE UINT32_SWAP_LE_BE_C
-#endif
-
-#ifndef UINT64_SWAP_LE_BE
-# define UINT64_SWAP_LE_BE UINT64_SWAP_LE_BE_C
-#endif
-
-inline static
-uint16_t uint16_swap_le_be (const uint16_t val)
-{
- return UINT16_SWAP_LE_BE (val);
-}
-
-inline static
-uint32_t uint32_swap_le_be (const uint32_t val)
-{
- return UINT32_SWAP_LE_BE (val);
-}
-
-inline static
-uint64_t uint64_swap_le_be (const uint64_t val)
-{
- return UINT64_SWAP_LE_BE (val);
-}
-
-# define UINT8_TO_BE(val) ((uint8_t) (val))
-# define UINT8_TO_LE(val) ((uint8_t) (val))
-#ifdef WORDS_BIGENDIAN
-# define UINT16_TO_BE(val) ((uint16_t) (val))
-# define UINT16_TO_LE(val) ((uint16_t) UINT16_SWAP_LE_BE(val))
-
-# define UINT32_TO_BE(val) ((uint32_t) (val))
-# define UINT32_TO_LE(val) ((uint32_t) UINT32_SWAP_LE_BE(val))
-
-# define UINT64_TO_BE(val) ((uint64_t) (val))
-# define UINT64_TO_LE(val) ((uint64_t) UINT64_SWAP_LE_BE(val))
-#else
-# define UINT16_TO_BE(val) ((uint16_t) UINT16_SWAP_LE_BE(val))
-# define UINT16_TO_LE(val) ((uint16_t) (val))
-
-# define UINT32_TO_BE(val) ((uint32_t) UINT32_SWAP_LE_BE(val))
-# define UINT32_TO_LE(val) ((uint32_t) (val))
-
-# define UINT64_TO_BE(val) ((uint64_t) UINT64_SWAP_LE_BE(val))
-# define UINT64_TO_LE(val) ((uint64_t) (val))
-#endif
-
-/* symmetric conversions */
-#define UINT8_FROM_BE(val) (UINT8_TO_BE (val))
-#define UINT8_FROM_LE(val) (UINT8_TO_LE (val))
-#define UINT16_FROM_BE(val) (UINT16_TO_BE (val))
-#define UINT16_FROM_LE(val) (UINT16_TO_LE (val))
-#define UINT32_FROM_BE(val) (UINT32_TO_BE (val))
-#define UINT32_FROM_LE(val) (UINT32_TO_LE (val))
-#define UINT64_FROM_BE(val) (UINT64_TO_BE (val))
-#define UINT64_FROM_LE(val) (UINT64_TO_LE (val))
-
-/* converter function template */
-#define CVT_TO_FUNC(bits) \
- static inline uint ## bits ## _t \
- uint ## bits ## _to_be (uint ## bits ## _t val) \
- { return UINT ## bits ## _TO_BE (val); } \
- static inline uint ## bits ## _t \
- uint ## bits ## _to_le (uint ## bits ## _t val) \
- { return UINT ## bits ## _TO_LE (val); } \
-
-CVT_TO_FUNC(8)
-CVT_TO_FUNC(16)
-CVT_TO_FUNC(32)
-CVT_TO_FUNC(64)
-
-#undef CVT_TO_FUNC
-
-#define uint16_from_be(val) (uint16_to_be (val))
-#define uint16_from_le(val) (uint16_to_le (val))
-#define uint32_from_be(val) (uint32_to_be (val))
-#define uint32_from_le(val) (uint32_to_le (val))
-
-#endif /* __VCD_BYTESEX_H__ */
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libvcd/bytesex_asm.h b/src/input/vcd/libvcd/bytesex_asm.h
deleted file mode 100644
index 3265c592b..000000000
--- a/src/input/vcd/libvcd/bytesex_asm.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- $Id: bytesex_asm.h,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
-
- Copyright (C) 2001 Sven Ottemann <ac-logic@freenet.de>
- 2001 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifndef __VCD_BYTESEX_ASM_H__
-#define __VCD_BYTESEX_ASM_H__
-#if !defined(DISABLE_ASM_OPTIMIZE)
-
-#include <libvcd/types.h>
-
-#if defined(__powerpc__) && defined(__GNUC__)
-
-inline static
-uint32_t uint32_swap_le_be_asm(const uint32_t a)
-{
- uint32_t b;
-
- __asm__ ("lwbrx %0,0,%1"
- :"=r"(b)
- :"r"(&a), "m"(a));
-
- return b;
-}
-
-inline static
-uint16_t uint16_swap_le_be_asm(const uint16_t a)
-{
- uint32_t b;
-
- __asm__ ("lhbrx %0,0,%1"
- :"=r"(b)
- :"r"(&a), "m"(a));
-
- return b;
-}
-
-#define UINT16_SWAP_LE_BE uint16_swap_le_be_asm
-#define UINT32_SWAP_LE_BE uint32_swap_le_be_asm
-
-#elif defined(__mc68000__) && defined(__STORMGCC__)
-
-inline static
-uint32_t uint32_swap_le_be_asm(uint32_t a __asm__("d0"))
-{
- /* __asm__("rolw #8,%0; swap %0; rolw #8,%0" : "=d" (val) : "0" (val)); */
-
- __asm__("move.l %1,d0;rol.w #8,d0;swap d0;rol.w #8,d0;move.l d0,%0"
- :"=r"(a)
- :"r"(a));
-
- return(a);
-}
-
-inline static
-uint16_t uint16_swap_le_be_asm(uint16_t a __asm__("d0"))
-{
- __asm__("move.l %1,d0;rol.w #8,d0;move.l d0,%0"
- :"=r"(a)
- :"r"(a));
-
- return(a);
-}
-
-#define UINT16_SWAP_LE_BE uint16_swap_le_be_asm
-#define UINT32_SWAP_LE_BE uint32_swap_le_be_asm
-
-#elif 0 && defined(__i386__) && defined(__GNUC__)
-
-inline static
-uint32_t uint32_swap_le_be_asm(uint32_t a)
-{
- __asm__("xchgb %b0,%h0\n\t" /* swap lower bytes */
- "rorl $16,%0\n\t" /* swap words */
- "xchgb %b0,%h0" /* swap higher bytes */
- :"=q" (a)
- : "0" (a));
-
- return(a);
-}
-
-inline static
-uint16_t uint16_swap_le_be_asm(uint16_t a)
-{
- __asm__("xchgb %b0,%h0" /* swap bytes */
- : "=q" (a)
- : "0" (a));
-
- return(a);
-}
-
-#define UINT16_SWAP_LE_BE uint16_swap_le_be_asm
-#define UINT32_SWAP_LE_BE uint32_swap_le_be_asm
-
-#endif
-
-#endif /* !defined(DISABLE_ASM_OPTIMIZE) */
-#endif /* __VCD_BYTESEX_ASM_H__ */
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libvcd/data_structures.c b/src/input/vcd/libvcd/data_structures.c
deleted file mode 100644
index 1fdca95c9..000000000
--- a/src/input/vcd/libvcd/data_structures.c
+++ /dev/null
@@ -1,342 +0,0 @@
-/*
- $Id: data_structures.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
- Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-
-#include <cdio/cdio.h>
-
-/* Public headers */
-#include <libvcd/types.h>
-
-/* Private headers */
-#include "vcd_assert.h"
-#include "data_structures.h"
-#include "util.h"
-
-static const char _rcsid[] = "$Id: data_structures.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $";
-
-struct _CdioList
-{
- unsigned length;
-
- CdioListNode *begin;
- CdioListNode *end;
-};
-
-struct _CdioListNode
-{
- CdioList *list;
-
- CdioListNode *next;
-
- void *data;
-};
-
-/* impl */
-
-static bool
-_bubble_sort_iteration (CdioList *list, _cdio_list_cmp_func cmp_func)
-{
- CdioListNode **pnode;
- bool changed = false;
-
- for (pnode = &(list->begin);
- (*pnode) != NULL && (*pnode)->next != NULL;
- pnode = &((*pnode)->next))
- {
- CdioListNode *node = *pnode;
-
- if (cmp_func (node->data, node->next->data) <= 0)
- continue; /* n <= n->next */
-
- /* exch n n->next */
- *pnode = node->next;
- node->next = node->next->next;
- (*pnode)->next = node;
-
- changed = true;
-
- if (node->next == NULL)
- list->end = node;
- }
-
- return changed;
-}
-
-void _vcd_list_sort (CdioList *list, _cdio_list_cmp_func cmp_func)
-{
- /* fixme -- this is bubble sort -- worst sorting algo... */
-
- vcd_assert (list != NULL);
- vcd_assert (cmp_func != 0);
-
- while (_bubble_sort_iteration (list, cmp_func));
-}
-
-/* node ops */
-
-CdioListNode *
-_vcd_list_at (CdioList *list, int idx)
-{
- CdioListNode *node = _cdio_list_begin (list);
-
- if (idx < 0)
- return _vcd_list_at (list, _cdio_list_length (list) + idx);
-
- vcd_assert (idx >= 0);
-
- while (node && idx)
- {
- node = _cdio_list_node_next (node);
- idx--;
- }
-
- return node;
-}
-
-/*
- * n-way tree based on list -- somewhat inefficent
- */
-
-struct _VcdTree
-{
- VcdTreeNode *root;
-};
-
-struct _VcdTreeNode
-{
- void *data;
-
- CdioListNode *listnode;
- VcdTree *tree;
- VcdTreeNode *parent;
- CdioList *children;
-};
-
-VcdTree *
-_vcd_tree_new (void *root_data)
-{
- VcdTree *new_tree;
-
- new_tree = _vcd_malloc (sizeof (VcdTree));
-
- new_tree->root = _vcd_malloc (sizeof (VcdTreeNode));
-
- new_tree->root->data = root_data;
- new_tree->root->tree = new_tree;
- new_tree->root->parent = NULL;
- new_tree->root->children = NULL;
- new_tree->root->listnode = NULL;
-
- return new_tree;
-}
-
-void
-_vcd_tree_destroy (VcdTree *tree, bool free_data)
-{
- _vcd_tree_node_destroy (tree->root, free_data);
-
- free (tree->root);
- free (tree);
-}
-
-void
-_vcd_tree_node_destroy (VcdTreeNode *node, bool free_data)
-{
- VcdTreeNode *child, *nxt_child;
-
- vcd_assert (node != NULL);
-
- child = _vcd_tree_node_first_child (node);
- while(child) {
- nxt_child = _vcd_tree_node_next_sibling (child);
- _vcd_tree_node_destroy (child, free_data);
- child = nxt_child;
- }
-
- if (node->children)
- {
- vcd_assert (_cdio_list_length (node->children) == 0);
- _cdio_list_free (node->children, true);
- node->children = NULL;
- }
-
- if (free_data)
- free (_vcd_tree_node_set_data (node, NULL));
-
- if (node->parent)
- _cdio_list_node_free (node->listnode, true);
- else
- _vcd_tree_node_set_data (node, NULL);
-}
-
-VcdTreeNode *
-_vcd_tree_root (VcdTree *tree)
-{
- return tree->root;
-}
-
-void *
-_vcd_tree_node_data (VcdTreeNode *node)
-{
- return node->data;
-}
-
-void *
-_vcd_tree_node_set_data (VcdTreeNode *node, void *new_data)
-{
- void *old_data = node->data;
-
- node->data = new_data;
-
- return old_data;
-}
-
-VcdTreeNode *
-_vcd_tree_node_append_child (VcdTreeNode *pnode, void *cdata)
-{
- VcdTreeNode *nnode;
-
- vcd_assert (pnode != NULL);
-
- if (!pnode->children)
- pnode->children = _cdio_list_new ();
-
- nnode = _vcd_malloc (sizeof (VcdTreeNode));
-
- _cdio_list_append (pnode->children, nnode);
-
- nnode->data = cdata;
- nnode->parent = pnode;
- nnode->tree = pnode->tree;
- nnode->listnode = _cdio_list_end (pnode->children);
-
- return nnode;
-}
-
-VcdTreeNode *
-_vcd_tree_node_first_child (VcdTreeNode *node)
-{
- vcd_assert (node != NULL);
-
- if (!node->children)
- return NULL;
-
- return _cdio_list_node_data (_cdio_list_begin (node->children));
-}
-
-VcdTreeNode *
-_vcd_tree_node_next_sibling (VcdTreeNode *node)
-{
- vcd_assert (node != NULL);
-
- return _cdio_list_node_data (_cdio_list_node_next (node->listnode));
-}
-
-void
-_vcd_tree_node_sort_children (VcdTreeNode *node, _vcd_tree_node_cmp_func cmp_func)
-{
- vcd_assert (node != NULL);
-
- if (node->children)
- _vcd_list_sort (node->children, (_cdio_list_cmp_func) cmp_func);
-}
-
-void
-_vcd_tree_node_traverse (VcdTreeNode *node,
- _vcd_tree_node_traversal_func trav_func,
- void *user_data) /* pre-order */
-{
- VcdTreeNode *child;
-
- vcd_assert (node != NULL);
-
- trav_func (node, user_data);
-
- _VCD_CHILD_FOREACH (child, node)
- {
- _vcd_tree_node_traverse (child, trav_func, user_data);
- }
-}
-
-void
-_vcd_tree_node_traverse_bf (VcdTreeNode *node,
- _vcd_tree_node_traversal_func trav_func,
- void *user_data) /* breath-first */
-{
- CdioList *queue;
-
- vcd_assert (node != NULL);
-
- queue = _cdio_list_new ();
-
- _cdio_list_prepend (queue, node);
-
- while (_cdio_list_length (queue))
- {
- CdioListNode *lastnode = _cdio_list_end (queue);
- VcdTreeNode *treenode = _cdio_list_node_data (lastnode);
- VcdTreeNode *childnode;
-
- _cdio_list_node_free (lastnode, false);
-
- trav_func (treenode, user_data);
-
- _VCD_CHILD_FOREACH (childnode, treenode)
- {
- _cdio_list_prepend (queue, childnode);
- }
- }
-
- _cdio_list_free (queue, false);
-}
-
-VcdTreeNode *_vcd_tree_node_parent (VcdTreeNode *node)
-{
- return node->parent;
-}
-
-VcdTreeNode *_vcd_tree_node_root (VcdTreeNode *node)
-{
- return node->tree->root;
-}
-
-bool _vcd_tree_node_is_root (VcdTreeNode *node)
-{
- return (node->parent == NULL);
-}
-
-/* eof */
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
-
diff --git a/src/input/vcd/libvcd/data_structures.h b/src/input/vcd/libvcd/data_structures.h
deleted file mode 100644
index 70fe88045..000000000
--- a/src/input/vcd/libvcd/data_structures.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- $Id: data_structures.h,v 1.3 2005/01/01 02:43:59 rockyb Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifndef __VCD_DATA_STRUCTURES_H__
-#define __VCD_DATA_STRUCTURES_H__
-
-#include <cdio/ds.h>
-#include <libvcd/types.h>
-
-/* node ops */
-
-CdioListNode *_vcd_list_at (CdioList *list, int idx);
-
-void _vcd_list_sort (CdioList *list, _cdio_list_cmp_func cmp_func);
-
-/* n-way tree */
-
-typedef struct _VcdTree VcdTree;
-typedef struct _VcdTreeNode VcdTreeNode;
-
-#define _VCD_CHILD_FOREACH(child, parent) \
- for (child = _vcd_tree_node_first_child (parent); child; child = _vcd_tree_node_next_sibling (child))
-
-typedef int (*_vcd_tree_node_cmp_func) (VcdTreeNode *node1,
- VcdTreeNode *node2);
-
-typedef void (*_vcd_tree_node_traversal_func) (VcdTreeNode *node,
- void *user_data);
-
-VcdTree *_vcd_tree_new (void *root_data);
-
-void _vcd_tree_destroy (VcdTree *tree, bool free_data);
-
-VcdTreeNode *_vcd_tree_root (VcdTree *tree);
-
-void _vcd_tree_node_sort_children (VcdTreeNode *node,
- _vcd_tree_node_cmp_func cmp_func);
-
-void *_vcd_tree_node_data (VcdTreeNode *node);
-
-void _vcd_tree_node_destroy (VcdTreeNode *node, bool free_data);
-
-void *_vcd_tree_node_set_data (VcdTreeNode *node, void *new_data);
-
-VcdTreeNode *_vcd_tree_node_append_child (VcdTreeNode *pnode, void *cdata);
-
-VcdTreeNode *_vcd_tree_node_first_child (VcdTreeNode *node);
-
-VcdTreeNode *_vcd_tree_node_next_sibling (VcdTreeNode *node);
-
-VcdTreeNode *_vcd_tree_node_parent (VcdTreeNode *node);
-
-VcdTreeNode *_vcd_tree_node_root (VcdTreeNode *node);
-
-bool _vcd_tree_node_is_root (VcdTreeNode *node);
-
-void _vcd_tree_node_traverse (VcdTreeNode *node,
- _vcd_tree_node_traversal_func trav_func,
- void *user_data);
-
-void
-_vcd_tree_node_traverse_bf (VcdTreeNode *node,
- _vcd_tree_node_traversal_func trav_func,
- void *user_data);
-
-#endif /* __VCD_DATA_STRUCTURES_H__ */
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
-
diff --git a/src/input/vcd/libvcd/dict.h b/src/input/vcd/libvcd/dict.h
deleted file mode 100644
index 229ad5706..000000000
--- a/src/input/vcd/libvcd/dict.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- $Id: dict.h,v 1.3 2005/01/01 02:43:59 rockyb Exp $
-
- Copyright (C) 2000, 2004 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifndef __VCD_DICT_H__
-#define __VCD_DICT_H__
-
-/* Public headers */
-#include <libvcd/types.h>
-
-/* Private headers */
-#include "vcd_assert.h"
-#include "obj.h"
-#include "util.h"
-
-struct _dict_t
-{
- char *key;
- uint32_t sector;
- uint32_t length;
- void *buf;
- uint8_t flags;
-};
-
-static void
-_dict_insert (VcdObj *obj, const char key[], uint32_t sector, uint32_t length,
- uint8_t end_flags)
-{
- struct _dict_t *_new_node;
-
- vcd_assert (key != NULL);
- vcd_assert (length > 0);
-
- if ((sector =_vcd_salloc (obj->iso_bitmap, sector, length)) == SECTOR_NIL)
- vcd_assert_not_reached ();
-
- _new_node = _vcd_malloc (sizeof (struct _dict_t));
-
- _new_node->key = strdup (key);
- _new_node->sector = sector;
- _new_node->length = length;
- _new_node->buf = _vcd_malloc (length * ISO_BLOCKSIZE);
- _new_node->flags = end_flags;
-
- _cdio_list_prepend (obj->buffer_dict_list, _new_node);
-}
-
-static
-int _dict_key_cmp (struct _dict_t *a, char *b)
-{
- vcd_assert (a != NULL);
- vcd_assert (b != NULL);
-
- return !strcmp (a->key, b);
-}
-
-static
-int _dict_sector_cmp (struct _dict_t *a, uint32_t *b)
-{
- vcd_assert (a != NULL);
- vcd_assert (b != NULL);
-
- return (a->sector <= *b && (*b - a->sector) < a->length);
-}
-
-static const struct _dict_t *
-_dict_get_bykey (VcdObj *obj, const char key[])
-{
- CdioListNode *node;
-
- vcd_assert (obj != NULL);
- vcd_assert (key != NULL);
-
- node = _cdio_list_find (obj->buffer_dict_list,
- (_cdio_list_iterfunc) _dict_key_cmp,
- (char *) key);
-
- if (node)
- return _cdio_list_node_data (node);
-
- return NULL;
-}
-
-static const struct _dict_t *
-_dict_get_bysector (VcdObj *obj, uint32_t sector)
-{
- CdioListNode *node;
-
- vcd_assert (obj != NULL);
- vcd_assert (sector != SECTOR_NIL);
-
- node = _cdio_list_find (obj->buffer_dict_list,
- (_cdio_list_iterfunc) _dict_sector_cmp,
- &sector);
-
- if (node)
- return _cdio_list_node_data (node);
-
- return NULL;
-}
-
-static uint8_t
-_dict_get_sector_flags (VcdObj *obj, uint32_t sector)
-{
- const struct _dict_t *p;
-
- vcd_assert (sector != SECTOR_NIL);
-
- p = _dict_get_bysector (obj, sector);
-
- if (p)
- return (((sector - p->sector)+1 == p->length)
- ? p->flags : 0);
-
- return 0;
-}
-
-static void *
-_dict_get_sector (VcdObj *obj, uint32_t sector)
-{
- const struct _dict_t *p;
-
- vcd_assert (sector != SECTOR_NIL);
-
- p = _dict_get_bysector (obj, sector);
-
- if (p)
- return ((char *)p->buf) + ((sector - p->sector) * ISO_BLOCKSIZE);
-
- return NULL;
-}
-
-static void
-_dict_clean (VcdObj *obj)
-{
- CdioListNode *node;
-
- while ((node = _cdio_list_begin (obj->buffer_dict_list)))
- {
- struct _dict_t *p = _cdio_list_node_data (node);
-
- free (p->key);
- free (p->buf);
-
- _cdio_list_node_free (node, true);
- }
-}
-
-#endif /* __VCD_DICT_H__ */
diff --git a/src/input/vcd/libvcd/directory.c b/src/input/vcd/libvcd/directory.c
deleted file mode 100644
index 992d728c6..000000000
--- a/src/input/vcd/libvcd/directory.c
+++ /dev/null
@@ -1,507 +0,0 @@
-/*
- $Id: directory.c,v 1.4 2006/09/26 19:26:57 dgp85 Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-
-/* Public headers */
-#include <cdio/bytesex.h>
-#include <cdio/iso9660.h>
-#include <libvcd/logging.h>
-
-/* Private headers */
-#include "vcd_assert.h"
-#include "directory.h"
-#include "util.h"
-
-static const char _rcsid[] = "$Id: directory.c,v 1.4 2006/09/26 19:26:57 dgp85 Exp $";
-
-/* CD-ROM XA */
-
-/* tree data structure */
-
-typedef struct
-{
- bool is_dir;
- char *name;
- uint16_t version;
- uint16_t xa_attributes;
- uint8_t xa_filenum;
- uint32_t extent;
- uint32_t size;
- unsigned pt_id;
-} data_t;
-
-typedef VcdTreeNode VcdDirNode;
-
-#define EXTENT(anode) (DATAP(anode)->extent)
-#define SIZE(anode) (DATAP(anode)->size)
-#define PT_ID(anode) (DATAP(anode)->pt_id)
-
-#define DATAP(anode) ((data_t*) _vcd_tree_node_data (anode))
-
-/* important date to celebrate (for me at least =)
- -- until user customization is implemented... */
-static const time_t _vcd_time = 269222400L;
-
-/* implementation */
-
-static void
-traverse_get_dirsizes(VcdDirNode *node, void *data)
-{
- data_t *d = DATAP(node);
- unsigned *sum = data;
-
- if (d->is_dir)
- {
- vcd_assert (d->size % ISO_BLOCKSIZE == 0);
-
- *sum += (d->size / ISO_BLOCKSIZE);
- }
-}
-
-static unsigned
-get_dirsizes (VcdDirNode* dirnode)
-{
- unsigned result = 0;
-
- _vcd_tree_node_traverse (dirnode, traverse_get_dirsizes, &result);
-
- return result;
-}
-
-static void
-traverse_update_dirextents (VcdDirNode *dirnode, void *data)
-{
- data_t *d = DATAP(dirnode);
-
- if (d->is_dir)
- {
- VcdDirNode* child;
- unsigned dirextent = d->extent;
-
- vcd_assert (d->size % ISO_BLOCKSIZE == 0);
-
- dirextent += d->size / ISO_BLOCKSIZE;
-
- _VCD_CHILD_FOREACH (child, dirnode)
- {
- data_t *d = DATAP(child);
-
- vcd_assert (d != NULL);
-
- if (d->is_dir)
- {
- d->extent = dirextent;
- dirextent += get_dirsizes (child);
- }
- }
- }
-}
-
-static void
-update_dirextents (VcdDirectory *dir, uint32_t extent)
-{
- data_t *dirdata = DATAP(_vcd_tree_root (dir));
-
- dirdata->extent = extent;
- _vcd_tree_node_traverse (_vcd_tree_root (dir),
- traverse_update_dirextents, NULL);
-}
-
-static void
-traverse_update_sizes(VcdDirNode *node, void *data)
-{
- data_t *dirdata = DATAP(node);
-
- if (dirdata->is_dir)
- {
- VcdDirNode* child;
- unsigned offset = 0;
-
- offset += iso9660_dir_calc_record_size (1, sizeof(iso9660_xa_t)); /* '.' */
- offset += iso9660_dir_calc_record_size (1, sizeof(iso9660_xa_t)); /* '..' */
-
- _VCD_CHILD_FOREACH (child, node)
- {
- data_t *d = DATAP(child);
- unsigned reclen;
- char *pathname = (d->is_dir
- ? strdup (d->name)
- : iso9660_pathname_isofy (d->name, d->version));
-
- vcd_assert (d != NULL);
-
- reclen = iso9660_dir_calc_record_size (strlen (pathname),
- sizeof (iso9660_xa_t));
-
- free (pathname);
-
- offset = _vcd_ofs_add (offset, reclen, ISO_BLOCKSIZE);
- }
-
- vcd_assert (offset > 0);
-
- dirdata->size = _vcd_ceil2block (offset, ISO_BLOCKSIZE);
- }
-}
-
-static void
-update_sizes (VcdDirectory *dir)
-{
- _vcd_tree_node_traverse (_vcd_tree_root(dir), traverse_update_sizes, NULL);
-}
-
-
-/* exported stuff: */
-
-VcdDirectory *
-_vcd_directory_new (void)
-{
- data_t *data;
- VcdDirectory *dir = NULL;
-
- vcd_assert (sizeof(iso9660_xa_t) == 14);
-
- data = _vcd_malloc (sizeof (data_t));
- dir = _vcd_tree_new (data);
-
- data->is_dir = true;
- data->name = _vcd_memdup("\0", 2);
- data->xa_attributes = XA_FORM1_DIR;
- data->xa_filenum = 0x00;
-
- return dir;
-}
-
-static void
-traverse_vcd_directory_done (VcdDirNode *node, void *data)
-{
- data_t *dirdata = DATAP (node);
-
- free (dirdata->name);
-}
-
-void
-_vcd_directory_destroy (VcdDirectory *dir)
-{
- vcd_assert (dir != NULL);
-
- _vcd_tree_node_traverse (_vcd_tree_root (dir),
- traverse_vcd_directory_done, NULL);
-
- _vcd_tree_destroy (dir, true);
-}
-
-static VcdDirNode*
-lookup_child (VcdDirNode* node, const char name[])
-{
- VcdDirNode* child;
-
- _VCD_CHILD_FOREACH (child, node)
- {
- data_t *d = DATAP(child);
-
- if (!strcmp (d->name, name))
- return child;
- }
-
- return child; /* NULL */
-}
-
-static int
-_iso_dir_cmp (VcdDirNode *node1, VcdDirNode *node2)
-{
- data_t *d1 = DATAP(node1);
- data_t *d2 = DATAP(node2);
- int result = 0;
-
- result = strcmp (d1->name, d2->name);
-
- return result;
-}
-
-int
-_vcd_directory_mkdir (VcdDirectory *dir, const char pathname[])
-{
- char **splitpath;
- unsigned level, n;
- VcdDirNode* pdir = _vcd_tree_root (dir);
-
- vcd_assert (dir != NULL);
- vcd_assert (pathname != NULL);
-
- splitpath = _vcd_strsplit (pathname, '/');
-
- level = _vcd_strlenv (splitpath);
-
- for (n = 0; n < level-1; n++)
- if (!(pdir = lookup_child(pdir, splitpath[n])))
- {
- vcd_error("mkdir: parent dir `%s' (level=%d) for `%s' missing!",
- splitpath[n], n, pathname);
- vcd_assert_not_reached ();
- }
-
- if (lookup_child (pdir, splitpath[level-1]))
- {
- vcd_error ("mkdir: `%s' already exists", pathname);
- vcd_assert_not_reached ();
- }
-
- {
- data_t *data = _vcd_malloc (sizeof (data_t));
-
- _vcd_tree_node_append_child (pdir, data);
-
- data->is_dir = true;
- data->name = strdup(splitpath[level-1]);
- data->xa_attributes = XA_FORM1_DIR;
- data->xa_filenum = 0x00;
- /* .. */
- }
-
- _vcd_tree_node_sort_children (pdir, _iso_dir_cmp);
-
- _vcd_strfreev (splitpath);
-
- return 0;
-}
-
-int
-_vcd_directory_mkfile (VcdDirectory *dir, const char pathname[],
- uint32_t start, uint32_t size,
- bool form2_flag, uint8_t filenum)
-{
- char **splitpath;
- unsigned level, n;
- const int file_version = 1;
-
- VcdDirNode* pdir = NULL;
-
- vcd_assert (dir != NULL);
- vcd_assert (pathname != NULL);
-
- splitpath = _vcd_strsplit (pathname, '/');
-
- level = _vcd_strlenv (splitpath);
-
- while (!pdir)
- {
- pdir = _vcd_tree_root (dir);
-
- for (n = 0; n < level-1; n++)
- if (!(pdir = lookup_child (pdir, splitpath[n])))
- {
- char *newdir = _vcd_strjoin (splitpath, n+1, "/");
-
- vcd_info ("autocreating directory `%s' for file `%s'",
- newdir, pathname);
-
- _vcd_directory_mkdir (dir, newdir);
-
- free (newdir);
-
- vcd_assert (pdir == NULL);
-
- break;
- }
- else if (!DATAP(pdir)->is_dir)
- {
- char *newdir = _vcd_strjoin (splitpath, n+1, "/");
-
- vcd_error ("mkfile: `%s' not a directory", newdir);
-
- free (newdir);
-
- return -1;
- }
-
- }
-
- if (lookup_child (pdir, splitpath[level-1]))
- {
- vcd_error ("mkfile: `%s' already exists", pathname);
- _vcd_strfreev(splitpath);
- return -1;
- }
-
- {
- data_t *data = _vcd_malloc (sizeof (data_t));
-
- _vcd_tree_node_append_child (pdir, data);
-
- data->is_dir = false;
- data->name = strdup (splitpath[level-1]);
- data->version = file_version;
- data->xa_attributes = form2_flag ? XA_FORM2_FILE : XA_FORM1_FILE;
- data->xa_filenum = filenum;
- data->size = size;
- data->extent = start;
- /* .. */
- }
-
- _vcd_tree_node_sort_children (pdir, _iso_dir_cmp);
-
- _vcd_strfreev (splitpath);
-
- return 0;
-}
-
-uint32_t
-_vcd_directory_get_size (VcdDirectory *dir)
-{
- vcd_assert (dir != NULL);
-
- update_sizes (dir);
- return get_dirsizes (_vcd_tree_root (dir));
-}
-
-static void
-traverse_vcd_directory_dump_entries (VcdDirNode *node, void *data)
-{
- data_t *d = DATAP(node);
- iso9660_xa_t xa_su;
-
- uint32_t root_extent = EXTENT(_vcd_tree_node_root (node));
-
- uint32_t parent_extent =
- (!_vcd_tree_node_is_root (node))
- ? EXTENT(_vcd_tree_node_parent (node))
- : EXTENT(node);
-
- uint32_t parent_size =
- (!_vcd_tree_node_is_root (node))
- ? SIZE(_vcd_tree_node_parent (node))
- : SIZE(node);
-
- void *dirbufp = (char*) data + ISO_BLOCKSIZE * (parent_extent - root_extent);
-
- iso9660_xa_init (&xa_su, 0, 0, d->xa_attributes, d->xa_filenum);
-
- if (!_vcd_tree_node_is_root (node))
- {
- char *pathname = (d->is_dir
- ? strdup (d->name)
- : iso9660_pathname_isofy (d->name, d->version));
-
- iso9660_dir_add_entry_su (dirbufp, pathname, d->extent, d->size,
- d->is_dir ? ISO_DIRECTORY : ISO_FILE,
- &xa_su, sizeof (xa_su),
- &_vcd_time);
-
- free (pathname);
- }
-
- /* if this is a directory, create the new directory node */
- if (d->is_dir)
- {
- dirbufp = (char*)data + ISO_BLOCKSIZE * (d->extent - root_extent);
-
- iso9660_dir_init_new_su (dirbufp,
- d->extent, d->size, &xa_su, sizeof (xa_su),
- parent_extent, parent_size, &xa_su,
- sizeof (xa_su), &_vcd_time);
- }
-}
-
-void
-_vcd_directory_dump_entries (VcdDirectory *dir, void *buf, uint32_t extent)
-{
- vcd_assert (dir != NULL);
-
- update_sizes (dir); /* better call it one time more than one less */
- update_dirextents (dir, extent);
-
- _vcd_tree_node_traverse (_vcd_tree_root (dir),
- traverse_vcd_directory_dump_entries, buf);
-}
-
-typedef struct
-{
- void *ptl;
- void *ptm;
-} _vcd_directory_dump_pathtables_t;
-
-static void
-_dump_pathtables_helper (_vcd_directory_dump_pathtables_t *args,
- data_t *d, uint16_t parent_id)
-{
- uint16_t id_l, id_m;
-
- vcd_assert (args != NULL);
- vcd_assert (d != NULL);
-
- vcd_assert (d->is_dir);
-
- id_l = iso9660_pathtable_l_add_entry (args->ptl, d->name, d->extent,
- parent_id);
-
- id_m = iso9660_pathtable_m_add_entry (args->ptm, d->name, d->extent,
- parent_id);
-
- vcd_assert (id_l == id_m);
-
- d->pt_id = id_m;
-}
-
-static void
-traverse_vcd_directory_dump_pathtables (VcdDirNode *node, void *data)
-{
- _vcd_directory_dump_pathtables_t *args = data;
-
- if (DATAP (node)->is_dir)
- {
- VcdDirNode* parent = _vcd_tree_node_parent (node);
- uint16_t parent_id = parent ? PT_ID (parent) : 1;
-
- _dump_pathtables_helper (args, DATAP (node), parent_id);
- }
-}
-
-void
-_vcd_directory_dump_pathtables (VcdDirectory *dir, void *ptl, void *ptm)
-{
- _vcd_directory_dump_pathtables_t args;
-
- vcd_assert (dir != NULL);
-
- iso9660_pathtable_init (ptl);
- iso9660_pathtable_init (ptm);
-
- args.ptl = ptl;
- args.ptm = ptm;
-
- _vcd_tree_node_traverse_bf (_vcd_tree_root (dir),
- traverse_vcd_directory_dump_pathtables, &args);
-}
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libvcd/directory.h b/src/input/vcd/libvcd/directory.h
deleted file mode 100644
index c4cba9efc..000000000
--- a/src/input/vcd/libvcd/directory.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- $Id: directory.h,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifndef _DIRECTORY_H_
-#define _DIRECTORY_H_
-
-#include <libvcd/types.h>
-
-/* Private headers */
-#include "data_structures.h"
-
-/* opaque data structure representing the ISO directory tree */
-typedef VcdTree VcdDirectory;
-
-VcdDirectory *
-_vcd_directory_new (void);
-
-void
-_vcd_directory_destroy (VcdDirectory *dir);
-
-int
-_vcd_directory_mkdir (VcdDirectory *dir, const char pathname[]);
-
-int
-_vcd_directory_mkfile (VcdDirectory *dir, const char pathname[],
- uint32_t start, uint32_t size,
- bool form2_flag, uint8_t filenum);
-
-uint32_t
-_vcd_directory_get_size (VcdDirectory *dir);
-
-void
-_vcd_directory_dump_entries (VcdDirectory *dir, void *buf, uint32_t extent);
-
-void
-_vcd_directory_dump_pathtables (VcdDirectory *dir, void *ptl, void *ptm);
-
-#endif /* _DIRECTORY_H_ */
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libvcd/files.c b/src/input/vcd/libvcd/files.c
deleted file mode 100644
index 38780edf0..000000000
--- a/src/input/vcd/libvcd/files.c
+++ /dev/null
@@ -1,1020 +0,0 @@
-/*
- $Id: files.c,v 1.4 2006/09/26 21:18:18 dgp85 Exp $
-
- Copyright (C) 2000, 2004 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <string.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <math.h>
-
-#include <cdio/cdio.h>
-#include <cdio/bytesex.h>
-#include <cdio/util.h>
-
-/* Public headers */
-#include <libvcd/files.h>
-#include <libvcd/types.h>
-#include <libvcd/logging.h>
-
-/* FIXME! Make this local */
-#include <libvcd/files_private.h>
-
-/* Private headers */
-#include "vcd_assert.h"
-#include "mpeg_stream.h"
-#include "obj.h"
-#include "pbc.h"
-#include "util.h"
-
-static const char _rcsid[] = "$Id: files.c,v 1.4 2006/09/26 21:18:18 dgp85 Exp $";
-
-inline static bool
-_pal_p (const struct vcd_mpeg_stream_vid_info *_info)
-{
- return (_info->vsize == 288 || _info->vsize == 576);
-}
-
-static int
-_derive_vid_type (const struct vcd_mpeg_stream_info *_info, bool svcd)
-{
- if (_info->shdr[0].seen)
- return _pal_p (&_info->shdr[0]) ? 0x7 : 0x3;
-
- if (_info->shdr[2].seen)
- {
- if (svcd)
- vcd_warn ("stream with 0xE2 still stream id not allowed for IEC62107 compliant SVCDs");
- return _pal_p (&_info->shdr[2]) ? 0x6 : 0x2;
- }
-
- if (_info->shdr[1].seen)
- return _pal_p (&_info->shdr[1]) ? 0x5 : 0x1;
-
- return 0;
-}
-
-static int
-_derive_ogt_type (const struct vcd_mpeg_stream_info *_info, bool svcd)
-{
-
- if (!svcd)
- return 0;
-
- if ((_info->ogt[3] || _info->ogt[2])
- && _info->ogt[1] && _info->ogt[0])
- return 0x3;
-
- if (_info->ogt[1] && _info->ogt[0])
- return 0x2;
-
- if (_info->ogt[0])
- return 0x1;
-
- vcd_debug ("OGT streams available: %d %d %d %d",
- _info->ogt[0], _info->ogt[1],
- _info->ogt[2], _info->ogt[3]);
-
- return 0x0;
-}
-
-static int
-_derive_aud_type (const struct vcd_mpeg_stream_info *_info, bool svcd)
-{
- if (!_info->ahdr[0].seen)
- return 0; /* no MPEG audio */
-
- if (svcd)
- {
- if (_info->ahdr[2].seen)
- return 3; /* MC */
-
- if (_info->ahdr[1].seen)
- return 2; /* 2 streams */
-
- return 1; /* just one stream */
- }
- else
- switch (_info->ahdr[0].mode)
- {
- case MPEG_SINGLE_CHANNEL:
- return 1;
- break;
-
- case MPEG_STEREO:
- case MPEG_JOINT_STEREO:
- return 2;
- break;
-
- case MPEG_DUAL_CHANNEL:
- return 3;
- break;
- }
-
- return 0;
-}
-
-void
-set_entries_vcd (VcdObj *obj, void *buf)
-{
- CdioListNode *node = NULL;
- int idx = 0;
- int track_idx = 0;
- EntriesVcd_t entries_vcd;
-
- vcd_assert (sizeof(EntriesVcd_t) == 2048);
-
- vcd_assert (_cdio_list_length (obj->mpeg_track_list) <= MAX_ENTRIES);
- vcd_assert (_cdio_list_length (obj->mpeg_track_list) > 0);
-
- memset(&entries_vcd, 0, sizeof(entries_vcd)); /* paranoia / fixme */
-
- switch (obj->type)
- {
- case VCD_TYPE_VCD:
- strncpy(entries_vcd.ID, ENTRIES_ID_VCD, 8);
- entries_vcd.version = ENTRIES_VERSION_VCD;
- entries_vcd.sys_prof_tag = ENTRIES_SPTAG_VCD;
- break;
-
- case VCD_TYPE_VCD11:
- strncpy(entries_vcd.ID, ENTRIES_ID_VCD, 8);
- entries_vcd.version = ENTRIES_VERSION_VCD11;
- entries_vcd.sys_prof_tag = ENTRIES_SPTAG_VCD11;
- break;
-
- case VCD_TYPE_VCD2:
- strncpy(entries_vcd.ID, ENTRIES_ID_VCD, 8);
- entries_vcd.version = ENTRIES_VERSION_VCD2;
- entries_vcd.sys_prof_tag = ENTRIES_SPTAG_VCD2;
- break;
-
- case VCD_TYPE_SVCD:
- if (!obj->svcd_vcd3_entrysvd)
- strncpy(entries_vcd.ID, ENTRIES_ID_SVCD, 8);
- else
- {
- vcd_warn ("setting ENTRYSVD signature for *DEPRECATED* VCD 3.0 type SVCD");
- strncpy(entries_vcd.ID, ENTRIES_ID_VCD3, 8);
- }
- entries_vcd.version = ENTRIES_VERSION_SVCD;
- entries_vcd.sys_prof_tag = ENTRIES_SPTAG_SVCD;
- break;
-
- case VCD_TYPE_HQVCD:
- strncpy(entries_vcd.ID, ENTRIES_ID_SVCD, 8);
- entries_vcd.version = ENTRIES_VERSION_HQVCD;
- entries_vcd.sys_prof_tag = ENTRIES_SPTAG_HQVCD;
- break;
-
- default:
- vcd_assert_not_reached ();
- break;
- }
-
- idx = 0;
- track_idx = 2;
- _CDIO_LIST_FOREACH (node, obj->mpeg_sequence_list)
- {
- mpeg_sequence_t *track = _cdio_list_node_data (node);
- uint32_t lsect = track->relative_start_extent;
- CdioListNode *node2;
-
- lsect += obj->iso_size;
-
- entries_vcd.entry[idx].n = cdio_to_bcd8(track_idx);
- cdio_lba_to_msf(cdio_lsn_to_lba(lsect),
- &(entries_vcd.entry[idx].msf));
-
- idx++;
- lsect += obj->track_front_margin;
-
- _CDIO_LIST_FOREACH (node2, track->entry_list)
- {
- entry_t *_entry = _cdio_list_node_data (node2);
- /* additional entries */
-
- vcd_assert (idx < MAX_ENTRIES);
-
- entries_vcd.entry[idx].n = cdio_to_bcd8(track_idx);
- cdio_lba_to_msf(lsect + cdio_lsn_to_lba(_entry->aps.packet_no),
- &(entries_vcd.entry[idx].msf));
-
- idx++;
- }
-
- track_idx++;
- }
-
- entries_vcd.entry_count = uint16_to_be (idx);
-
- memcpy(buf, &entries_vcd, sizeof(entries_vcd));
-}
-
-static void
-_set_bit (uint8_t bitset[], unsigned bitnum)
-{
- unsigned _byte = bitnum / 8;
- unsigned _bit = bitnum % 8;
-
- bitset[_byte] |= (1 << _bit);
-}
-
-uint32_t
-get_psd_size (VcdObj *obj, bool extended)
-{
- if (extended)
- vcd_assert (_vcd_obj_has_cap_p (obj, _CAP_PBC_X));
-
- if (!_vcd_pbc_available (obj))
- return 0;
-
- if (extended)
- return obj->psdx_size;
-
- return obj->psd_size;
-}
-
-void
-set_psd_vcd (VcdObj *obj, void *buf, bool extended)
-{
- CdioListNode *node;
-
- if (extended)
- vcd_assert (_vcd_obj_has_cap_p (obj, _CAP_PBC_X));
-
- vcd_assert (_vcd_pbc_available (obj));
-
- _CDIO_LIST_FOREACH (node, obj->pbc_list)
- {
- pbc_t *_pbc = _cdio_list_node_data (node);
- char *_buf = buf;
- unsigned offset = (extended ? _pbc->offset_ext : _pbc->offset);
-
- vcd_assert (offset % INFO_OFFSET_MULT == 0);
-
- _vcd_pbc_node_write (obj, _pbc, _buf + offset, extended);
- }
-}
-
-void
-set_lot_vcd(VcdObj *obj, void *buf, bool extended)
-{
- LotVcd_t *lot_vcd = NULL;
- CdioListNode *node;
-
- if (extended)
- vcd_assert (_vcd_obj_has_cap_p (obj, _CAP_PBC_X));
-
- vcd_assert (_vcd_pbc_available (obj));
-
- lot_vcd = _vcd_malloc (sizeof (LotVcd_t));
- memset(lot_vcd, 0xff, sizeof(LotVcd_t));
-
- lot_vcd->reserved = 0x0000;
-
- _CDIO_LIST_FOREACH (node, obj->pbc_list)
- {
- pbc_t *_pbc = _cdio_list_node_data (node);
- unsigned int offset = extended ? _pbc->offset_ext : _pbc->offset;
-
- vcd_assert (offset % INFO_OFFSET_MULT == 0);
-
- if (_pbc->rejected)
- continue;
-
- offset /= INFO_OFFSET_MULT;
-
- lot_vcd->offset[_pbc->lid - 1] = uint16_to_be (offset);
- }
-
- memcpy(buf, lot_vcd, sizeof(LotVcd_t));
- free(lot_vcd);
-}
-
-void
-set_info_vcd(VcdObj *obj, void *buf)
-{
- InfoVcd_t info_vcd;
- CdioListNode *node = NULL;
- int n = 0;
-
- vcd_assert (sizeof (InfoVcd_t) == 2048);
- vcd_assert (_cdio_list_length (obj->mpeg_track_list) <= 98);
-
- memset (&info_vcd, 0, sizeof (info_vcd));
-
- switch (obj->type)
- {
- case VCD_TYPE_VCD:
- strncpy (info_vcd.ID, INFO_ID_VCD, sizeof (info_vcd.ID));
- info_vcd.version = INFO_VERSION_VCD;
- info_vcd.sys_prof_tag = INFO_SPTAG_VCD;
- break;
-
- case VCD_TYPE_VCD11:
- strncpy (info_vcd.ID, INFO_ID_VCD, sizeof (info_vcd.ID));
- info_vcd.version = INFO_VERSION_VCD11;
- info_vcd.sys_prof_tag = INFO_SPTAG_VCD11;
- break;
-
- case VCD_TYPE_VCD2:
- strncpy (info_vcd.ID, INFO_ID_VCD, sizeof (info_vcd.ID));
- info_vcd.version = INFO_VERSION_VCD2;
- info_vcd.sys_prof_tag = INFO_SPTAG_VCD2;
- break;
-
- case VCD_TYPE_SVCD:
- strncpy (info_vcd.ID, INFO_ID_SVCD, sizeof (info_vcd.ID));
- info_vcd.version = INFO_VERSION_SVCD;
- info_vcd.sys_prof_tag = INFO_SPTAG_SVCD;
- break;
-
- case VCD_TYPE_HQVCD:
- strncpy (info_vcd.ID, INFO_ID_HQVCD, sizeof (info_vcd.ID));
- info_vcd.version = INFO_VERSION_HQVCD;
- info_vcd.sys_prof_tag = INFO_SPTAG_HQVCD;
- break;
-
- default:
- vcd_assert_not_reached ();
- break;
- }
-
- iso9660_strncpy_pad (info_vcd.album_desc,
- obj->info_album_id,
- sizeof(info_vcd.album_desc), ISO9660_DCHARS);
- /* fixme, maybe it's VCD_ACHARS? */
-
- info_vcd.vol_count = uint16_to_be (obj->info_volume_count);
- info_vcd.vol_id = uint16_to_be (obj->info_volume_number);
-
- if (_vcd_obj_has_cap_p (obj, _CAP_PAL_BITS))
- {
- /* NTSC/PAL bitset */
-
- n = 0;
- _CDIO_LIST_FOREACH (node, obj->mpeg_track_list)
- {
- mpeg_track_t *track = _cdio_list_node_data (node);
-
- const struct vcd_mpeg_stream_vid_info *_info = &track->info->shdr[0];
-
- if (vcd_mpeg_get_norm (_info) == MPEG_NORM_PAL
- || vcd_mpeg_get_norm (_info) == MPEG_NORM_PAL_S)
- _set_bit(info_vcd.pal_flags, n);
- else if (_pal_p (_info))
- {
- vcd_warn ("INFO.{VCD,SVD}: assuming PAL-type resolution for track #%d"
- " -- are we creating a X(S)VCD?", n);
- _set_bit(info_vcd.pal_flags, n);
- }
-
- n++;
- }
- }
-
- if (_vcd_obj_has_cap_p (obj, _CAP_PBC))
- {
- info_vcd.flags.restriction = obj->info_restriction;
- info_vcd.flags.use_lid2 = obj->info_use_lid2;
- info_vcd.flags.use_track3 = obj->info_use_seq2;
-
- if (_vcd_obj_has_cap_p (obj, _CAP_PBC_X)
- &&_vcd_pbc_available (obj))
- info_vcd.flags.pbc_x = true;
-
- info_vcd.psd_size = uint32_to_be (get_psd_size (obj, false));
- info_vcd.offset_mult = _vcd_pbc_available (obj) ? INFO_OFFSET_MULT : 0;
- info_vcd.lot_entries = uint16_to_be (_vcd_pbc_max_lid (obj));
-
- if (_cdio_list_length (obj->mpeg_segment_list))
- {
- unsigned segments = 0;
-
- if (!_vcd_pbc_available (obj))
- vcd_warn ("segment items available, but no PBC items set!"
- " SPIs will be unreachable");
-
- _CDIO_LIST_FOREACH (node, obj->mpeg_segment_list)
- {
- mpeg_segment_t *segment = _cdio_list_node_data (node);
- unsigned idx;
- InfoSpiContents contents = { 0, };
-
- contents.video_type =
- _derive_vid_type (segment->info,
- _vcd_obj_has_cap_p (obj, _CAP_4C_SVCD));
-
- contents.audio_type =
- _derive_aud_type (segment->info,
- _vcd_obj_has_cap_p (obj, _CAP_4C_SVCD));
-
- contents.ogt =
- _derive_ogt_type (segment->info,
- _vcd_obj_has_cap_p (obj, _CAP_4C_SVCD));
-
- if (!contents.video_type && !contents.audio_type)
- vcd_warn ("segment item '%s' seems contains neither video nor audio",
- segment->id);
-
- for (idx = 0; idx < segment->segment_count; idx++)
- {
- vcd_assert (segments + idx < MAX_SEGMENTS);
-
- info_vcd.spi_contents[segments + idx] = contents;
-
- if (!contents.item_cont)
- contents.item_cont = true;
- }
-
- segments += idx;
- }
-
- info_vcd.item_count = uint16_to_be (segments);
-
- cdio_lba_to_msf (cdio_lsn_to_lba(obj->mpeg_segment_start_extent),
- &info_vcd.first_seg_addr);
- }
- }
-
- memcpy(buf, &info_vcd, sizeof(info_vcd));
-}
-
-static void
-set_tracks_svd_v30 (VcdObj *obj, void *buf)
-{
- char tracks_svd_buf[ISO_BLOCKSIZE] = { 0, };
- TracksSVD_v30 *tracks_svd = (void *) tracks_svd_buf;
- CdioListNode *node;
- double playtime;
- int n;
-
- strncpy (tracks_svd->file_id, TRACKS_SVD_FILE_ID,
- sizeof (TRACKS_SVD_FILE_ID)-1);
- tracks_svd->version = TRACKS_SVD_VERSION;
- tracks_svd->tracks = _cdio_list_length (obj->mpeg_track_list);
-
- n = 0;
- playtime = 0;
- _CDIO_LIST_FOREACH (node, obj->mpeg_track_list)
- {
- mpeg_track_t *track = _cdio_list_node_data (node);
- int i;
-
- playtime += track->info->playing_time;
-
- tracks_svd->track[n].audio_info = track->info->ahdr[0].seen ? 0x2 : 0x0; /* fixme */
- tracks_svd->track[n].audio_info |= track->info->ahdr[1].seen ? 0x20 : 0x0; /* fixme */
-
- tracks_svd->track[n].ogt_info = 0x0;
- for (i = 0; i < 4; i++)
- if (track->info->ogt[i])
- tracks_svd->track[n].ogt_info |= 1 << (i * 2); /* fixme */
-
- /* setting playtime */
-
- {
- double i, f;
-
- while (playtime >= 6000.0)
- playtime -= 6000.0;
-
- f = modf(playtime, &i);
-
- cdio_lba_to_msf (i * 75, &tracks_svd->track[n].cum_playing_time);
- tracks_svd->track[n].cum_playing_time.f =
- cdio_to_bcd8 (floor (f * 75.0));
- }
-
- n++;
- }
-
- memcpy (buf, &tracks_svd_buf, sizeof(tracks_svd_buf));
-}
-
-void
-set_tracks_svd (VcdObj *obj, void *buf)
-{
- char tracks_svd[ISO_BLOCKSIZE] = { 0, };
- TracksSVD *tracks_svd1 = (void *) tracks_svd;
- TracksSVD2 *tracks_svd2;
- CdioListNode *node;
- int n;
-
- vcd_assert (_vcd_obj_has_cap_p (obj, _CAP_4C_SVCD));
-
- if (obj->svcd_vcd3_tracksvd)
- {
- set_tracks_svd_v30 (obj, buf);
- return;
- }
-
- vcd_assert (sizeof (SVDTrackContent) == 1);
-
- strncpy (tracks_svd1->file_id, TRACKS_SVD_FILE_ID, sizeof (TRACKS_SVD_FILE_ID)-1);
- tracks_svd1->version = TRACKS_SVD_VERSION;
-
- tracks_svd1->tracks = _cdio_list_length (obj->mpeg_track_list);
-
- tracks_svd2 = (void *) &(tracks_svd1->playing_time[tracks_svd1->tracks]);
-
- n = 0;
-
- _CDIO_LIST_FOREACH (node, obj->mpeg_track_list)
- {
- mpeg_track_t *track = _cdio_list_node_data (node);
- const double playtime = track->info->playing_time;
-
- int _video;
-
- _video = tracks_svd2->contents[n].video =
- _derive_vid_type (track->info, true);
-
- tracks_svd2->contents[n].audio =
- _derive_aud_type (track->info, true);
-
- tracks_svd2->contents[n].ogt =
- _derive_ogt_type (track->info, true);
-
- if (_video != 0x3 && _video != 0x7)
- vcd_warn("SVCD/TRACKS.SVCD: No MPEG motion video for track #%d?", n);
-
- /* setting playtime */
-
- {
- double i, f;
-
- f = modf(playtime, &i);
-
- if (playtime >= 6000.0)
- {
- vcd_warn ("SVCD/TRACKS.SVD: playing time value (%d seconds) to great,"
- " clipping to 100 minutes", (int) i);
- i = 5999.0;
- f = 74.0 / 75.0;
- }
-
- cdio_lba_to_msf (i * 75, &(tracks_svd1->playing_time[n]));
- tracks_svd1->playing_time[n].f = cdio_to_bcd8 (floor (f * 75.0));
- }
-
- n++;
- }
-
- memcpy (buf, &tracks_svd, sizeof(tracks_svd));
-}
-
-static double
-_get_cumulative_playing_time (const VcdObj *obj, unsigned up_to_track_no)
-{
- double result = 0;
- CdioListNode *node;
-
- _CDIO_LIST_FOREACH (node, obj->mpeg_track_list)
- {
- mpeg_track_t *track = _cdio_list_node_data (node);
-
- if (!up_to_track_no)
- break;
-
- result += track->info->playing_time;
- up_to_track_no--;
- }
-
- if (up_to_track_no)
- vcd_warn ("internal error...");
-
- return result;
-}
-
-static unsigned
-_get_scanpoint_count (const VcdObj *obj)
-{
- double total_playing_time;
-
- total_playing_time = _get_cumulative_playing_time (obj, _cdio_list_length (obj->mpeg_track_list));
-
- return ceil (total_playing_time * 2.0);
-}
-
-uint32_t
-get_search_dat_size (const VcdObj *obj)
-{
- return sizeof (SearchDat)
- + (_get_scanpoint_count (obj) * sizeof (msf_t));
-}
-
-static CdioList *
-_make_track_scantable (const VcdObj *obj)
-{
- CdioList *all_aps = _cdio_list_new ();
- CdioList *scantable = _cdio_list_new ();
- unsigned scanpoints = _get_scanpoint_count (obj);
- unsigned track_no;
- CdioListNode *node;
-
- track_no = 0;
- _CDIO_LIST_FOREACH (node, obj->mpeg_track_list)
- {
- mpeg_track_t *track = _cdio_list_node_data (node);
- CdioListNode *node2;
-
- _CDIO_LIST_FOREACH (node2, track->info->shdr[0].aps_list)
- {
- struct aps_data *_data = _vcd_malloc (sizeof (struct aps_data));
-
- *_data = *(struct aps_data *)_cdio_list_node_data (node2);
-
- _data->timestamp += _get_cumulative_playing_time (obj, track_no);
- _data->packet_no += obj->iso_size + track->relative_start_extent;
- _data->packet_no += obj->track_front_margin;
-
- _cdio_list_append (all_aps, _data);
- }
- track_no++;
- }
-
- {
- CdioListNode *aps_node = _cdio_list_begin (all_aps);
- CdioListNode *n;
- struct aps_data *_data;
- double aps_time;
- double playing_time;
- int aps_packet;
- double t;
-
- playing_time = scanpoints;
- playing_time /= 2;
-
- vcd_assert (aps_node != NULL);
-
- _data = _cdio_list_node_data (aps_node);
- aps_time = _data->timestamp;
- aps_packet = _data->packet_no;
-
- for (t = 0; t < playing_time; t += 0.5)
- {
- for(n = _cdio_list_node_next (aps_node); n;
- n = _cdio_list_node_next (n))
- {
- _data = _cdio_list_node_data (n);
-
- if (fabs (_data->timestamp - t) < fabs (aps_time - t))
- {
- aps_node = n;
- aps_time = _data->timestamp;
- aps_packet = _data->packet_no;
- }
- else
- break;
- }
-
- {
- uint32_t *lsect = _vcd_malloc (sizeof (uint32_t));
-
- *lsect = aps_packet;
- _cdio_list_append (scantable, lsect);
- }
-
- }
-
- }
-
- _cdio_list_free (all_aps, true);
-
- vcd_assert (scanpoints == _cdio_list_length (scantable));
-
- return scantable;
-}
-
-void
-set_search_dat (VcdObj *obj, void *buf)
-{
- CdioList *scantable;
- CdioListNode *node;
- SearchDat search_dat;
- unsigned n;
-
- vcd_assert (_vcd_obj_has_cap_p (obj, _CAP_4C_SVCD));
- /* vcd_assert (sizeof (SearchDat) == ?) */
-
- memset (&search_dat, 0, sizeof (search_dat));
-
- strncpy (search_dat.file_id, SEARCH_FILE_ID, sizeof (SEARCH_FILE_ID)-1);
-
- search_dat.version = SEARCH_VERSION;
- search_dat.scan_points = uint16_to_be (_get_scanpoint_count (obj));
- search_dat.time_interval = SEARCH_TIME_INTERVAL;
-
- memcpy (buf, &search_dat, sizeof (search_dat));
-
- scantable = _make_track_scantable (obj);
-
- n = 0;
- _CDIO_LIST_FOREACH (node, scantable)
- {
- SearchDat *search_dat2 = buf;
- uint32_t sect = *(uint32_t *) _cdio_list_node_data (node);
-
- cdio_lba_to_msf(cdio_lsn_to_lba(sect), &(search_dat2->points[n]));
- n++;
- }
-
- vcd_assert (n = _get_scanpoint_count (obj));
-
- _cdio_list_free (scantable, true);
-}
-
-static uint32_t
-_get_scandata_count (const struct vcd_mpeg_stream_info *info)
-{
- return ceil (info->playing_time * 2.0);
-}
-
-static uint32_t *
-_get_scandata_table (const struct vcd_mpeg_stream_info *info)
-{
- CdioListNode *n, *aps_node = _cdio_list_begin (info->shdr[0].aps_list);
- struct aps_data *_data;
- double aps_time, t;
- int aps_packet;
- uint32_t *retval;
- unsigned i;
-
- retval = _vcd_malloc (_get_scandata_count (info) * sizeof (uint32_t));
-
- _data = _cdio_list_node_data (aps_node);
- aps_time = _data->timestamp;
- aps_packet = _data->packet_no;
-
- for (t = 0, i = 0; t < info->playing_time; t += 0.5, i++)
- {
- for(n = _cdio_list_node_next (aps_node); n; n = _cdio_list_node_next (n))
- {
- _data = _cdio_list_node_data (n);
-
- if (fabs (_data->timestamp - t) < fabs (aps_time - t))
- {
- aps_node = n;
- aps_time = _data->timestamp;
- aps_packet = _data->packet_no;
- }
- else
- break;
- }
-
- /* vcd_debug ("%f %f %d", t, aps_time, aps_packet); */
-
- vcd_assert (i < _get_scandata_count (info));
-
- retval[i] = aps_packet;
- }
-
- vcd_assert (i = _get_scandata_count (info));
-
- return retval;
-}
-
-uint32_t
-get_scandata_dat_size (const VcdObj *obj)
-{
- uint32_t retval = 0;
-
- /* struct 1 */
- retval += sizeof (ScandataDat1);
- retval += sizeof (msf_t) * _cdio_list_length (obj->mpeg_track_list);
-
- /* struct 2 */
- /* vcd_assert (sizeof (ScandataDat2) == 0);
- retval += sizeof (ScandataDat2); */
- retval += sizeof (uint16_t) * 0;
-
- /* struct 3 */
- retval += sizeof (ScandataDat3);
- retval += (sizeof (uint8_t) + sizeof (uint16_t)) * _cdio_list_length (obj->mpeg_track_list);
-
- /* struct 4 */
- /* vcd_assert (sizeof (ScandataDat4) == 0);
- retval += sizeof (ScandataDat4); */
- {
- CdioListNode *node;
- _CDIO_LIST_FOREACH (node, obj->mpeg_track_list)
- {
- const mpeg_track_t *track = _cdio_list_node_data (node);
-
- retval += sizeof (msf_t) * _get_scandata_count (track->info);
- }
- }
-
- return retval;
-}
-
-void
-set_scandata_dat (VcdObj *obj, void *buf)
-{
- const unsigned tracks = _cdio_list_length (obj->mpeg_track_list);
-
- ScandataDat1 *scandata_dat1 = (ScandataDat1 *) buf;
- ScandataDat2 *scandata_dat2 =
- (ScandataDat2 *) &(scandata_dat1->cum_playtimes[tracks]);
- ScandataDat3 *scandata_dat3 =
- (ScandataDat3 *) &(scandata_dat2->spi_indexes[0]);
- ScandataDat4 *scandata_dat4 =
- (ScandataDat4 *) &(scandata_dat3->mpeg_track_offsets[tracks]);
-
- const uint16_t _begin_offset =
- __cd_offsetof (ScandataDat3, mpeg_track_offsets[tracks])
- - __cd_offsetof (ScandataDat3, mpeg_track_offsets);
-
- CdioListNode *node;
- unsigned n;
- uint16_t _tmp_offset;
-
- vcd_assert (_vcd_obj_has_cap_p (obj, _CAP_4C_SVCD));
-
- /* memset (buf, 0, get_scandata_dat_size (obj)); */
-
- /* struct 1 */
- strncpy (scandata_dat1->file_id, SCANDATA_FILE_ID, sizeof (SCANDATA_FILE_ID)-1);
-
- scandata_dat1->version = SCANDATA_VERSION_SVCD;
- scandata_dat1->reserved = 0x00;
- scandata_dat1->scandata_count = uint16_to_be (_get_scanpoint_count (obj));
-
- scandata_dat1->track_count = uint16_to_be (tracks);
- scandata_dat1->spi_count = uint16_to_be (0);
-
- for (n = 0; n < tracks; n++)
- {
- double playtime = _get_cumulative_playing_time (obj, n + 1);
- double i = 0, f = 0;
-
- f = modf(playtime, &i);
-
- while (i >= (60 * 100))
- i -= (60 * 100);
-
- vcd_assert (i >= 0);
-
- cdio_lba_to_msf (i * 75, &(scandata_dat1->cum_playtimes[n]));
- scandata_dat1->cum_playtimes[n].f = cdio_to_bcd8 (floor (f * 75.0));
- }
-
- /* struct 2 -- nothing yet */
-
- /* struct 3/4 */
-
- vcd_assert ((_begin_offset % sizeof (msf_t) == 0)
- && _begin_offset > 0);
-
- _tmp_offset = 0;
-
- scandata_dat3->mpegtrack_start_index = uint16_to_be (_begin_offset);
-
- n = 0;
- _CDIO_LIST_FOREACH (node, obj->mpeg_track_list)
- {
- const mpeg_track_t *track = _cdio_list_node_data (node);
- uint32_t *_table;
- const unsigned scanpoints = _get_scandata_count (track->info);
- const unsigned _table_ofs =
- (_tmp_offset * sizeof (msf_t)) + _begin_offset;
- unsigned point;
-
- scandata_dat3->mpeg_track_offsets[n].track_num = n + 2;
- scandata_dat3->mpeg_track_offsets[n].table_offset = uint16_to_be (_table_ofs);
-
- _table = _get_scandata_table (track->info);
-
- for (point = 0; point < scanpoints; point++)
- {
- uint32_t lsect = _table[point];
-
- lsect += obj->iso_size;
- lsect += track->relative_start_extent;
- lsect += obj->track_front_margin;
-
- /* vcd_debug ("lsect %d %d", point, lsect); */
-
- cdio_lba_to_msf(cdio_lsn_to_lba(lsect),
- &(scandata_dat4->scandata_table[_tmp_offset + point]));
- }
-
- free (_table);
-
- _tmp_offset += scanpoints;
- n++;
- }
-
- /* struct 4 */
-
-
-}
-
-vcd_type_t
-vcd_files_info_detect_type (const void *info_buf)
-{
- const InfoVcd_t *_info = info_buf;
- vcd_type_t _type = VCD_TYPE_INVALID;
-
- vcd_assert (info_buf != NULL);
-
- if (!strncmp (_info->ID, INFO_ID_VCD, sizeof (_info->ID)))
- switch (_info->version)
- {
- case INFO_VERSION_VCD2:
- if (_info->sys_prof_tag != INFO_SPTAG_VCD2)
- vcd_warn ("INFO.VCD: unexpected system profile tag %d encountered",
- _info->version);
- _type = VCD_TYPE_VCD2;
- break;
-
- case INFO_VERSION_VCD:
- /* case INFO_VERSION_VCD11: */
- switch (_info->sys_prof_tag)
- {
- case INFO_SPTAG_VCD:
- _type = VCD_TYPE_VCD;
- break;
- case INFO_SPTAG_VCD11:
- _type = VCD_TYPE_VCD11;
- break;
- default:
- vcd_warn ("INFO.VCD: unexpected system profile tag %d "
- "encountered, assuming VCD 1.1", _info->sys_prof_tag);
- break;
- }
- break;
-
- default:
- vcd_warn ("unexpected VCD version %d encountered -- assuming VCD 2.0",
- _info->version);
- break;
- }
- else if (!strncmp (_info->ID, INFO_ID_SVCD, sizeof (_info->ID)))
- switch (_info->version)
- {
- case INFO_VERSION_SVCD:
- if (_info->sys_prof_tag != INFO_SPTAG_SVCD)
- vcd_warn ("INFO.SVD: unexpected system profile tag value %d "
- "-- assuming SVCD", _info->sys_prof_tag);
- _type = VCD_TYPE_SVCD;
- break;
-
- default:
- vcd_warn ("INFO.SVD: unexpected version value %d seen "
- " -- still assuming SVCD", _info->version);
- _type = VCD_TYPE_SVCD;
- break;
- }
- else if (!strncmp (_info->ID, INFO_ID_HQVCD, sizeof (_info->ID)))
- switch (_info->version)
- {
- case INFO_VERSION_HQVCD:
- if (_info->sys_prof_tag != INFO_SPTAG_HQVCD)
- vcd_warn ("INFO.SVD: unexpected system profile tag value -- assuming hqvcd");
- _type = VCD_TYPE_HQVCD;
- break;
-
- default:
- vcd_warn ("INFO.SVD: unexpected version value %d seen "
- "-- still assuming HQVCD", _info->version);
- _type = VCD_TYPE_HQVCD;
- break;
- }
- else
- vcd_warn ("INFO.SVD: signature not found");
-
- return _type;
-}
-
-/* eof */
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libvcd/image.c b/src/input/vcd/libvcd/image.c
deleted file mode 100644
index d26bb0910..000000000
--- a/src/input/vcd/libvcd/image.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- $Id: image.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $
-
- Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
- 2002 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <cdio/cdio.h>
-
-/* Public headers */
-#include <libvcd/sector.h>
-#include <cdio/iso9660.h>
-
-/* Private headers */
-#include "vcd_assert.h"
-#include "image_sink.h"
-#include "util.h"
-
-static const char _rcsid[] = "$Id: image.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $";
-
-/*
- * VcdImageSink routines next.
- */
-
-struct _VcdImageSink {
- void *user_data;
- vcd_image_sink_funcs op;
-};
-
-VcdImageSink *
-vcd_image_sink_new (void *user_data, const vcd_image_sink_funcs *funcs)
-{
- VcdImageSink *new_obj;
-
- new_obj = _vcd_malloc (sizeof (VcdImageSink));
-
- new_obj->user_data = user_data;
- new_obj->op = *funcs;
-
- return new_obj;
-}
-
-void
-vcd_image_sink_destroy (VcdImageSink *obj)
-{
- vcd_assert (obj != NULL);
-
- obj->op.free (obj->user_data);
- free (obj);
-}
-
-int
-vcd_image_sink_set_cuesheet (VcdImageSink *obj, const CdioList *vcd_cue_list)
-{
- vcd_assert (obj != NULL);
-
- return obj->op.set_cuesheet (obj->user_data, vcd_cue_list);
-}
-
-int
-vcd_image_sink_write (VcdImageSink *obj, void *buf, lsn_t lsn)
-{
- vcd_assert (obj != NULL);
-
- return obj->op.write (obj->user_data, buf, lsn);
-}
-
-/*!
- Set the arg "key" with "value" in the target device.
-*/
-
-int
-vcd_image_sink_set_arg (VcdImageSink *obj, const char key[],
- const char value[])
-{
- vcd_assert (obj != NULL);
- vcd_assert (obj->op.set_arg != NULL);
- vcd_assert (key != NULL);
-
- return obj->op.set_arg (obj->user_data, key, value);
-}
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libvcd/image_bincue.c b/src/input/vcd/libvcd/image_bincue.c
deleted file mode 100644
index 9c447a42a..000000000
--- a/src/input/vcd/libvcd/image_bincue.c
+++ /dev/null
@@ -1,259 +0,0 @@
-/*
- $Id: image_bincue.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $
-
- Copyright (C) 2001, 2004 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-
-#include <stdlib.h>
-#include <string.h>
-
-#include <cdio/cdio.h>
-#include <cdio/bytesex.h>
-#include <cdio/iso9660.h>
-
-/* Public headers */
-#include <libvcd/sector.h>
-#include <libvcd/logging.h>
-
-/* Private headers */
-#include "vcd_assert.h"
-#include "image_sink.h"
-#include "stream_stdio.h"
-#include "util.h"
-
-static const char _rcsid[] = "$Id: image_bincue.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $";
-
-/* reader */
-
-#define DEFAULT_VCD_DEVICE "videocd.bin"
-
-/****************************************************************************
- * writer
- */
-
-typedef struct {
- bool sector_2336_flag;
- VcdDataSink *bin_snk;
- VcdDataSink *cue_snk;
- char *bin_fname;
- char *cue_fname;
-
- bool init;
-} _img_bincue_snk_t;
-
-static void
-_sink_init (_img_bincue_snk_t *_obj)
-{
- if (_obj->init)
- return;
-
- if (!(_obj->bin_snk = vcd_data_sink_new_stdio (_obj->bin_fname)))
- vcd_error ("init failed");
-
- if (!(_obj->cue_snk = vcd_data_sink_new_stdio (_obj->cue_fname)))
- vcd_error ("init failed");
-
- _obj->init = true;
-}
-
-static void
-_sink_free (void *user_data)
-{
- _img_bincue_snk_t *_obj = user_data;
-
- vcd_data_sink_destroy (_obj->bin_snk);
- vcd_data_sink_destroy (_obj->cue_snk);
- free (_obj->bin_fname);
- free (_obj->cue_fname);
- free (_obj);
-}
-
-static int
-_set_cuesheet (void *user_data, const CdioList *vcd_cue_list)
-{
- _img_bincue_snk_t *_obj = user_data;
- CdioListNode *node;
- int track_no, index_no;
- const vcd_cue_t *_last_cue = 0;
-
- _sink_init (_obj);
-
- vcd_data_sink_printf (_obj->cue_snk, "FILE \"%s\" BINARY\r\n",
- _obj->bin_fname);
-
- track_no = 0;
- index_no = 0;
- _CDIO_LIST_FOREACH (node, (CdioList *) vcd_cue_list)
- {
- const vcd_cue_t *_cue = _cdio_list_node_data (node);
- char *psz_msf;
-
- msf_t _msf = { 0, 0, 0 };
-
- switch (_cue->type)
- {
- case VCD_CUE_TRACK_START:
- track_no++;
- index_no = 0;
-
- vcd_data_sink_printf (_obj->cue_snk,
- " TRACK %2.2d MODE2/%d\r\n"
- " FLAGS DCP\r\n",
- track_no, (_obj->sector_2336_flag ? 2336 : 2352));
-
- if (_last_cue && _last_cue->type == VCD_CUE_PREGAP_START)
- {
- cdio_lba_to_msf (_last_cue->lsn, &_msf);
- psz_msf = cdio_msf_to_str(&_msf);
-
- vcd_data_sink_printf (_obj->cue_snk,
- " INDEX %2.2d %s\r\n",
- index_no, psz_msf);
- free(psz_msf);
- }
-
- index_no++;
-
- cdio_lba_to_msf (_cue->lsn, &_msf);
- psz_msf = cdio_msf_to_str(&_msf);
-
- vcd_data_sink_printf (_obj->cue_snk,
- " INDEX %2.2d %s\r\n",
- index_no, psz_msf);
- free(psz_msf);
- break;
-
- case VCD_CUE_PREGAP_START:
- /* handled in next iteration */
- break;
-
- case VCD_CUE_SUBINDEX:
- vcd_assert (_last_cue != 0);
-
- index_no++;
- vcd_assert (index_no <= CDIO_CD_MAX_TRACKS);
-
- cdio_lba_to_msf (_cue->lsn, &_msf);
- psz_msf = cdio_msf_to_str(&_msf);
-
- vcd_data_sink_printf (_obj->cue_snk,
- " INDEX %2.2d %s\r\n",
- index_no, psz_msf);
- free(psz_msf);
- break;
-
- case VCD_CUE_END:
- vcd_data_sink_close (_obj->cue_snk);
- return 0;
- break;
-
- case VCD_CUE_LEADIN:
- break;
- }
-
- _last_cue = _cue;
- }
-
- vcd_assert_not_reached ();
-
- return -1;
-}
-
-static int
-_vcd_image_bincue_write (void *user_data, const void *data, lsn_t lsn)
-{
- const char *buf = data;
- _img_bincue_snk_t *_obj = user_data;
- long offset = lsn;
-
- _sink_init (_obj);
-
- offset *= _obj->sector_2336_flag ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE_RAW;
-
- vcd_data_sink_seek(_obj->bin_snk, offset);
-
- if (_obj->sector_2336_flag)
- vcd_data_sink_write(_obj->bin_snk, buf + 12 + 4, M2RAW_SECTOR_SIZE, 1);
- else
- vcd_data_sink_write(_obj->bin_snk, buf, CDIO_CD_FRAMESIZE_RAW, 1);
-
- return 0;
-}
-
-static int
-_sink_set_arg (void *user_data, const char key[], const char value[])
-{
- _img_bincue_snk_t *_obj = user_data;
-
- if (!strcmp (key, "bin"))
- {
- free (_obj->bin_fname);
-
- if (!value)
- return -2;
-
- _obj->bin_fname = strdup (value);
- }
- else if (!strcmp (key, "cue"))
- {
- free (_obj->cue_fname);
-
- if (!value)
- return -2;
-
- _obj->cue_fname = strdup (value);
- }
- else if (!strcmp (key, "sector"))
- {
- if (!strcmp (value, "2336"))
- _obj->sector_2336_flag = true;
- else if (!strcmp (value, "2352"))
- _obj->sector_2336_flag = false;
- else
- return -2;
- }
- else
- return -1;
-
- return 0;
-}
-
-VcdImageSink *
-vcd_image_sink_new_bincue (void)
-{
- _img_bincue_snk_t *_data;
-
- vcd_image_sink_funcs _funcs = {
- .set_cuesheet = _set_cuesheet,
- .write = _vcd_image_bincue_write,
- .free = _sink_free,
- .set_arg = _sink_set_arg
- };
-
- _data = _vcd_malloc (sizeof (_img_bincue_snk_t));
-
- _data->bin_fname = strdup ("videocd.bin");
- _data->cue_fname = strdup ("videocd.cue");
-
- return vcd_image_sink_new (_data, &_funcs);
-}
-
diff --git a/src/input/vcd/libvcd/image_cdrdao.c b/src/input/vcd/libvcd/image_cdrdao.c
deleted file mode 100644
index 5e00c14ee..000000000
--- a/src/input/vcd/libvcd/image_cdrdao.c
+++ /dev/null
@@ -1,313 +0,0 @@
-/*
- $Id: image_cdrdao.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $
-
- Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* Public headers */
-#include <cdio/iso9660.h>
-#include <cdio/bytesex.h>
-#include <libvcd/sector.h>
-#include <libvcd/logging.h>
-
-/* Private headers */
-#include "vcd_assert.h"
-#include "image_sink.h"
-#include "stream_stdio.h"
-#include "util.h"
-#include "vcd.h"
-
-static const char _rcsid[] = "$Id: image_cdrdao.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $";
-
-/* reader */
-
-/****************************************************************************
- * writer
- */
-
-typedef struct {
- bool sector_2336_flag;
- char *toc_fname;
- char *img_base;
-
- VcdDataSink *last_bin_snk;
- int last_snk_idx;
- bool last_pause;
-
- CdioList *vcd_cue_list;
-} _img_cdrdao_snk_t;
-
-static void
-_sink_free (void *user_data)
-{
- _img_cdrdao_snk_t *_obj = user_data;
-
- /* fixme -- destroy cue list */
-
- vcd_data_sink_destroy (_obj->last_bin_snk);
- free (_obj->toc_fname);
- free (_obj->img_base);
- free (_obj);
-}
-
-static int
-_set_cuesheet (void *user_data, const CdioList *vcd_cue_list)
-{
- _img_cdrdao_snk_t *_obj = user_data;
- VcdDataSink *toc_snk = vcd_data_sink_new_stdio (_obj->toc_fname);
-
- CdioListNode *node;
-
- int track_no, index_no;
- const vcd_cue_t *_last_cue = 0;
- unsigned last_track_lsn = 0;
-
- vcd_data_sink_printf (toc_snk,
- "// CDRDAO TOC\n"
- "// generated by %s\n\n"
- "CD_ROM_XA\n", vcd_version_string (false));
-
- _obj->vcd_cue_list = _cdio_list_new ();
-
- index_no = track_no = 0;
- _CDIO_LIST_FOREACH (node, (CdioList *) vcd_cue_list)
- {
- const vcd_cue_t *_cue = _cdio_list_node_data (node);
-
- /* copy cue list while traversing */
- {
- vcd_cue_t *_cue2 = _vcd_malloc (sizeof (vcd_cue_t));
- *_cue2 = *_cue;
- _cdio_list_append (_obj->vcd_cue_list, _cue2);
- }
-
- switch (_cue->type)
- {
- case VCD_CUE_TRACK_START:
- track_no++;
- index_no = 0;
-
- last_track_lsn = _cue->lsn;
-
- vcd_data_sink_printf (toc_snk,
- "\n// Track %d\n"
- "TRACK %s\n COPY\n",
- track_no,
- (_obj->sector_2336_flag ? "MODE2_FORM_MIX" : "MODE2_RAW"));
-
- if (_last_cue && _last_cue->type == VCD_CUE_PREGAP_START)
- vcd_data_sink_printf (toc_snk,
- " DATAFILE \"%s_%.2d_pregap.img\"\n"
- " START\n",
- _obj->img_base, track_no);
-
- index_no++;
-
- vcd_data_sink_printf (toc_snk,
- " DATAFILE \"%s_%.2d.img\"\n",
- _obj->img_base, track_no);
- break;
-
- case VCD_CUE_PREGAP_START:
- /* handled in next iteration */
- break;
-
- case VCD_CUE_SUBINDEX:
- index_no++;
-
- {
- msf_t _msf = { 0, 0, 0 };
- char *psz_msf;
-
- cdio_lba_to_msf (_cue->lsn - last_track_lsn, &_msf);
- psz_msf = cdio_msf_to_str(&_msf);
-
- vcd_data_sink_printf (toc_snk, " INDEX %s\n", psz_msf);
- free(psz_msf);
- }
- break;
-
- case VCD_CUE_LEADIN:
- break;
-
- case VCD_CUE_END:
- vcd_data_sink_printf (toc_snk, "\n// EOF\n");
-
- vcd_data_sink_close (toc_snk);
- vcd_data_sink_destroy (toc_snk);
-
- return 0;
- break;
- }
-
- _last_cue = _cue;
- }
-
- vcd_assert_not_reached ();
-
- return -1;
-}
-
-static int
-_vcd_image_cdrdao_write (void *user_data, const void *data, lsn_t lsn)
-{
- const char *buf = data;
- _img_cdrdao_snk_t *_obj = user_data;
- long offset;
-
- {
- CdioListNode *node;
- uint32_t _last = 0;
- uint32_t _ofs = 0;
- bool _lpregap = false;
- bool _pregap = false;
-
- int num = 0, in_track = 0;
- _CDIO_LIST_FOREACH (node, _obj->vcd_cue_list)
- {
- const vcd_cue_t *_cue = _cdio_list_node_data (node);
-
- switch (_cue->type)
- {
- case VCD_CUE_PREGAP_START:
- case VCD_CUE_END:
- case VCD_CUE_TRACK_START:
- if (_cue->lsn && IN (lsn, _last, _cue->lsn - 1))
- {
- vcd_assert (in_track == 0);
- in_track = num;
- _ofs = _last;
- _pregap = _lpregap;
- }
-
- _last = _cue->lsn;
- _lpregap = (_cue->type == VCD_CUE_PREGAP_START);
-
- if (_cue->type == VCD_CUE_TRACK_START)
- num++;
- break;
-
- default:
- /* noop */
- break;
- }
- }
-
- vcd_assert (in_track != 0);
- vcd_assert (_obj->last_snk_idx <= in_track);
-
- if (_obj->last_snk_idx != in_track
- || _obj->last_pause != _pregap)
- {
- char buf[4096] = { 0, };
-
- if (_obj->last_bin_snk)
- vcd_data_sink_destroy (_obj->last_bin_snk);
-
- snprintf (buf, sizeof (buf),
- "%s_%.2d%s.img",
- _obj->img_base,
- (_pregap ? in_track + 1 : in_track),
- (_pregap ? "_pregap" : ""));
-
- _obj->last_bin_snk = vcd_data_sink_new_stdio (buf);
- _obj->last_snk_idx = in_track;
- _obj->last_pause = _pregap;
- }
-
- vcd_assert (lsn >= _ofs);
- offset = lsn - _ofs;
- }
-
- offset *= _obj->sector_2336_flag ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE_RAW;
-
- vcd_data_sink_seek(_obj->last_bin_snk, offset);
-
- if (_obj->sector_2336_flag)
- vcd_data_sink_write(_obj->last_bin_snk, buf + 12 + 4, M2RAW_SECTOR_SIZE, 1);
- else
- vcd_data_sink_write(_obj->last_bin_snk, buf, CDIO_CD_FRAMESIZE_RAW, 1);
-
- return 0;
-}
-
-static int
-_sink_set_arg (void *user_data, const char key[], const char value[])
-{
- _img_cdrdao_snk_t *_obj = user_data;
-
- if (!strcmp (key, "toc"))
- {
- free (_obj->toc_fname);
-
- if (!value)
- return -2;
-
- _obj->toc_fname = strdup (value);
- }
- else if (!strcmp (key, "img_base"))
- {
- free (_obj->img_base);
-
- if (!value)
- return -2;
-
- _obj->img_base = strdup (value);
- }
- else if (!strcmp (key, "sector"))
- {
- if (!strcmp (value, "2336"))
- _obj->sector_2336_flag = true;
- else if (!strcmp (value, "2352"))
- _obj->sector_2336_flag = false;
- else
- return -2;
- }
- else
- return -1;
-
- return 0;
-}
-
-VcdImageSink *
-vcd_image_sink_new_cdrdao (void)
-{
- _img_cdrdao_snk_t *_data;
-
- vcd_image_sink_funcs _funcs = {
- .set_cuesheet = _set_cuesheet,
- .write = _vcd_image_cdrdao_write,
- .free = _sink_free,
- .set_arg = _sink_set_arg
- };
-
- _data = _vcd_malloc (sizeof (_img_cdrdao_snk_t));
-
- _data->toc_fname = strdup ("videocd.toc");
- _data->img_base = strdup ("videocd");
-
- return vcd_image_sink_new (_data, &_funcs);
-}
-
diff --git a/src/input/vcd/libvcd/image_nrg.c b/src/input/vcd/libvcd/image_nrg.c
deleted file mode 100644
index 1faeb98a9..000000000
--- a/src/input/vcd/libvcd/image_nrg.c
+++ /dev/null
@@ -1,352 +0,0 @@
-/*
- $Id: image_nrg.c,v 1.4 2006/09/27 05:41:40 dgp85 Exp $
-
- Copyright (C) 2001, 2003, 2004 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/*! This code implements low-level access functions for Nero's native
- CD-image format residing inside a disk file (*.nrg).
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <cdio/cdio.h>
-#include <cdio/bytesex.h>
-#include <cdio/iso9660.h>
-
-/* Public headers */
-#include <libvcd/sector.h>
-#include <libvcd/logging.h>
-
-/* Private headers */
-#include "vcd_assert.h"
-#include "image_sink.h"
-#include "stream_stdio.h"
-#include "util.h"
-
-static const char _rcsid[] = "$Id: image_nrg.c,v 1.4 2006/09/27 05:41:40 dgp85 Exp $";
-
-/* structures used */
-
-/* this ugly image format is typical for lazy win32 programmers... at
- least structure were set big endian, so at reverse
- engineering wasn't such a big headache... */
-
-PRAGMA_BEGIN_PACKED
-typedef struct {
- uint32_t start GNUC_PACKED;
- uint32_t length GNUC_PACKED;
- uint32_t type GNUC_PACKED; /* only 0x3 seen so far...
- -> MIXED_MODE2 2336 blocksize */
- uint32_t start_lsn GNUC_PACKED; /* does not include any pre-gaps! */
- uint32_t _unknown GNUC_PACKED; /* wtf is this for? -- always zero... */
-} _etnf_array_t;
-
-/* finally they realized that 32bit offsets are a bit outdated for IA64 *eg* */
-typedef struct {
- uint64_t start GNUC_PACKED;
- uint64_t length GNUC_PACKED;
- uint32_t type GNUC_PACKED;
- uint32_t start_lsn GNUC_PACKED;
- uint64_t _unknown GNUC_PACKED; /* wtf is this for? -- always zero... */
-} _etn2_array_t;
-
-typedef struct {
- uint8_t _unknown1 GNUC_PACKED; /* 0x41 == 'A' */
- uint8_t track GNUC_PACKED; /* binary or BCD?? */
- uint8_t index GNUC_PACKED; /* makes 0->1 transitions */
- uint8_t _unknown2 GNUC_PACKED; /* ?? */
- uint32_t lsn GNUC_PACKED;
-} _cuex_array_t;
-
-typedef struct {
- uint32_t id GNUC_PACKED;
- uint32_t len GNUC_PACKED;
- char data[EMPTY_ARRAY_SIZE] GNUC_PACKED;
-} _chunk_t;
-
-PRAGMA_END_PACKED
-
-/* to be converted into BE */
-#define CUEX_ID 0x43554558
-#define CUES_ID 0x43554553
-#define DAOX_ID 0x44414f58
-#define DAOI_ID 0x44414f49
-#define END1_ID 0x454e4421
-#define ETN2_ID 0x45544e32
-#define ETNF_ID 0x45544e46
-#define NER5_ID 0x4e455235
-#define NERO_ID 0x4e45524f
-#define SINF_ID 0x53494e46
-
-/****************************************************************************
- * writer
- */
-
-typedef struct {
- VcdDataSink *nrg_snk;
- char *nrg_fname;
-
- CdioList *vcd_cue_list;
- int tracks;
- uint32_t cue_end_lsn;
-
- bool init;
-} _img_nrg_snk_t;
-
-static void
-_sink_init (_img_nrg_snk_t *_obj)
-{
- if (_obj->init)
- return;
-
- if (!(_obj->nrg_snk = vcd_data_sink_new_stdio (_obj->nrg_fname)))
- vcd_error ("init failed");
-
- _obj->init = true;
-}
-
-
-static void
-_sink_free (void *user_data)
-{
- _img_nrg_snk_t *_obj = user_data;
-
- free (_obj->nrg_fname);
- vcd_data_sink_destroy (_obj->nrg_snk);
-
- free (_obj);
-}
-
-static int
-_set_cuesheet (void *user_data, const CdioList *vcd_cue_list)
-{
- _img_nrg_snk_t *_obj = user_data;
- CdioListNode *node;
- int num;
-
- _sink_init (_obj);
-
- _obj->vcd_cue_list = _cdio_list_new ();
-
- num = 0;
- _CDIO_LIST_FOREACH (node, (CdioList *) vcd_cue_list)
- {
- const vcd_cue_t *_cue = _cdio_list_node_data (node);
- vcd_cue_t *_cue2 = _vcd_malloc (sizeof (vcd_cue_t));
- *_cue2 = *_cue;
- _cdio_list_append (_obj->vcd_cue_list, _cue2);
-
- if (_cue->type == VCD_CUE_TRACK_START)
- num++;
-
- if (_cue->type == VCD_CUE_END)
- _obj->cue_end_lsn = _cue->lsn;
- }
-
- _obj->tracks = num;
-
- vcd_assert (CDIO_CD_MIN_TRACK_NO >= 1 && num <= CDIO_CD_MAX_TRACKS);
-
- return 0;
-}
-
-static uint32_t
-_map (_img_nrg_snk_t *_obj, uint32_t lsn)
-{
- CdioListNode *node;
- uint32_t result = lsn;
- vcd_cue_t *_cue = NULL, *_last = NULL;
-
- vcd_assert (_obj->cue_end_lsn > lsn);
-
- _CDIO_LIST_FOREACH (node, _obj->vcd_cue_list)
- {
- _cue = _cdio_list_node_data (node);
-
- if (lsn < _cue->lsn)
- break;
-
- switch (_cue->type)
- {
- case VCD_CUE_TRACK_START:
- result -= _cue->lsn;
- break;
- case VCD_CUE_PREGAP_START:
- result += _cue->lsn;
- break;
- default:
- break;
- }
-
- _last = _cue;
- }
-
- vcd_assert (node != NULL);
- vcd_assert (_last != NULL);
-
- switch (_last->type)
- {
- case VCD_CUE_TRACK_START:
- return result;
- break;
-
- case VCD_CUE_PREGAP_START:
- return -1;
- break;
-
- default:
- case VCD_CUE_END:
- vcd_assert_not_reached ();
- break;
- }
-
- return -1;
-}
-
-static int
-_write_tail (_img_nrg_snk_t *_obj, uint32_t offset)
-{
- CdioListNode *node;
- int _size;
- _chunk_t _chunk;
-
- vcd_data_sink_seek (_obj->nrg_snk, offset);
-
- _size = _obj->tracks * sizeof (_etnf_array_t);
- _chunk.id = UINT32_TO_BE (ETNF_ID);
- _chunk.len = uint32_to_be (_size);
-
- vcd_data_sink_write (_obj->nrg_snk, &_chunk, sizeof (_chunk_t), 1);
-
- _CDIO_LIST_FOREACH (node, _obj->vcd_cue_list)
- {
- vcd_cue_t *_cue = _cdio_list_node_data (node);
-
- if (_cue->type == VCD_CUE_TRACK_START)
- {
- vcd_cue_t *_cue2 =
- _cdio_list_node_data (_cdio_list_node_next (node));
-
- _etnf_array_t _etnf = { 0, };
-
- _etnf.type = UINT32_TO_BE (0x3);
- _etnf.start_lsn = uint32_to_be (_map (_obj, _cue->lsn));
- _etnf.start = uint32_to_be (_map (_obj, _cue->lsn) * M2RAW_SECTOR_SIZE);
-
- _etnf.length = uint32_to_be ((_cue2->lsn - _cue->lsn) * M2RAW_SECTOR_SIZE);
-
- vcd_data_sink_write (_obj->nrg_snk, &_etnf, sizeof (_etnf_array_t), 1);
- }
-
- }
-
- {
- uint32_t tracks = uint32_to_be (_obj->tracks);
-
- _chunk.id = UINT32_TO_BE (SINF_ID);
- _chunk.len = UINT32_TO_BE (sizeof (uint32_t));
- vcd_data_sink_write (_obj->nrg_snk, &_chunk, sizeof (_chunk_t), 1);
-
- vcd_data_sink_write (_obj->nrg_snk, &tracks, sizeof (uint32_t), 1);
- }
-
- _chunk.id = UINT32_TO_BE (END1_ID);
- _chunk.len = UINT32_TO_BE (0);
- vcd_data_sink_write (_obj->nrg_snk, &_chunk, sizeof (_chunk_t), 1);
-
- _chunk.id = UINT32_TO_BE (NERO_ID);
- _chunk.len = uint32_to_be (offset);
- vcd_data_sink_write (_obj->nrg_snk, &_chunk, sizeof (_chunk_t), 1);
-
- return 0;
-}
-
-static int
-_vcd_image_nrg_write (void *user_data, const void *data, lsn_t lsn)
-{
- const char *buf = data;
- _img_nrg_snk_t *_obj = user_data;
- uint32_t _lsn = _map (_obj, lsn);
-
- _sink_init (_obj);
-
- if (_lsn == -1)
- {
- /* vcd_debug ("ignoring %d", lsn); */
- return 0;
- }
-
- vcd_data_sink_seek(_obj->nrg_snk, _lsn * M2RAW_SECTOR_SIZE);
- vcd_data_sink_write(_obj->nrg_snk, buf + 12 + 4, M2RAW_SECTOR_SIZE, 1);
-
- if (_obj->cue_end_lsn - 1 == lsn)
- {
- vcd_debug ("ENDLSN reached! (%lu == %lu)",
- (long unsigned int) lsn, (long unsigned int) _lsn);
- return _write_tail (_obj, (_lsn + 1) * M2RAW_SECTOR_SIZE);
- }
-
- return 0;
-}
-
-static int
-_sink_set_arg (void *user_data, const char key[], const char value[])
-{
- _img_nrg_snk_t *_obj = user_data;
-
- if (!strcmp (key, "nrg"))
- {
- free (_obj->nrg_fname);
-
- if (!value)
- return -2;
-
- _obj->nrg_fname = strdup (value);
- }
- else
- return -1;
-
- return 0;
-}
-
-VcdImageSink *
-vcd_image_sink_new_nrg (void)
-{
- _img_nrg_snk_t *_data;
-
- vcd_image_sink_funcs _funcs = {
- .set_cuesheet = _set_cuesheet,
- .write = _vcd_image_nrg_write,
- .free = _sink_free,
- .set_arg = _sink_set_arg
- };
-
- _data = _vcd_malloc (sizeof (_img_nrg_snk_t));
- _data->nrg_fname = strdup ("videocd.nrg");
-
- vcd_warn ("opening TAO NRG image for writing; TAO (S)VCD are NOT 100%% compliant!");
-
- return vcd_image_sink_new (_data, &_funcs);
-}
-
diff --git a/src/input/vcd/libvcd/image_sink.h b/src/input/vcd/libvcd/image_sink.h
deleted file mode 100644
index a71e30199..000000000
--- a/src/input/vcd/libvcd/image_sink.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- $Id: image_sink.h,v 1.3 2005/01/01 02:43:59 rockyb Exp $
-
- Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifndef __VCD_IMAGE_SINK_H__
-#define __VCD_IMAGE_SINK_H__
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <cdio/cdio.h>
-#include <libvcd/types.h>
-
-/* Private includes */
-#include "data_structures.h"
-#include "stream.h"
-
-/* VcdImageSink ( --> image writer) */
-
-typedef struct _VcdImageSink VcdImageSink;
-
-typedef struct {
- uint32_t lsn;
- enum {
- VCD_CUE_TRACK_START = 1, /* INDEX 0 -> 1 transition, TOC entry */
- VCD_CUE_PREGAP_START, /* INDEX = 0 start */
- VCD_CUE_SUBINDEX, /* INDEX++; sub-index */
- VCD_CUE_END, /* lead-out start */
- VCD_CUE_LEADIN, /* lead-in start */
- } type;
-} vcd_cue_t;
-
-typedef struct {
- int (*set_cuesheet) (void *user_data, const CdioList *vcd_cue_list);
- int (*write) (void *user_data, const void *buf, lsn_t lsn);
- void (*free) (void *user_data);
- int (*set_arg) (void *user_data, const char key[], const char value[]);
-} vcd_image_sink_funcs;
-
-VcdImageSink *
-vcd_image_sink_new (void *user_data, const vcd_image_sink_funcs *funcs);
-
-void
-vcd_image_sink_destroy (VcdImageSink *obj);
-
-int
-vcd_image_sink_set_cuesheet (VcdImageSink *obj, const CdioList *vcd_cue_list);
-
-int
-vcd_image_sink_write (VcdImageSink *obj, void *buf, lsn_t lsn);
-
-/*!
- Set the arg "key" with "value" in the target device.
-*/
-int
-vcd_image_sink_set_arg (VcdImageSink *obj, const char key[],
- const char value[]);
-
-VcdImageSink * vcd_image_sink_new_nrg (void);
-VcdImageSink * vcd_image_sink_new_bincue (void);
-VcdImageSink * vcd_image_sink_new_cdrdao (void);
-
-#endif /* __VCD_IMAGE_SINK_H__ */
diff --git a/src/input/vcd/libvcd/inf.c b/src/input/vcd/libvcd/inf.c
deleted file mode 100644
index 588c8e5f7..000000000
--- a/src/input/vcd/libvcd/inf.c
+++ /dev/null
@@ -1,531 +0,0 @@
-/*
- $Id: inf.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $
-
- Copyright (C) 2002,2003 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Foundation
- Software, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/*
- Things here refer to lower-level structures using a structure other
- than vcdinfo_t. For higher-level structures via the vcdinfo_t, see
- info.c
-*/
-
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stddef.h>
-#include <errno.h>
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#include <cdio/cdio.h>
-#include <cdio/bytesex.h>
-#include <cdio/util.h>
-
-/* Eventually move above libvcd includes but having vcdinfo including. */
-#include <libvcd/info.h>
-
-/* Private headers */
-#include "info_private.h"
-#include "pbc.h"
-
-static const char _rcsid[] = "$Id: inf.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $";
-
-#define BUF_COUNT 16
-#define BUF_SIZE 80
-
-/* Return a pointer to a internal free buffer */
-static char *
-_getbuf (void)
-{
- static char _buf[BUF_COUNT][BUF_SIZE];
- static int _num = -1;
-
- _num++;
- _num %= BUF_COUNT;
-
- memset (_buf[_num], 0, BUF_SIZE);
-
- return _buf[_num];
-}
-
-const char *
-vcdinf_area_str (const struct psd_area_t *_area)
-{
- char *buf;
-
- if (!_area->x1
- && !_area->y1
- && !_area->x2
- && !_area->y2)
- return "disabled";
-
- buf = _getbuf ();
-
- snprintf (buf, BUF_SIZE, "[%3d,%3d] - [%3d,%3d]",
- _area->x1, _area->y1,
- _area->x2, _area->y2);
-
- return buf;
-}
-
-/*!
- Return a string containing the VCD album id, or NULL if there is
- some problem in getting this.
-*/
-const char *
-vcdinf_get_album_id(const InfoVcd_t *info)
-{
- if (NULL==info) return NULL;
- return vcdinfo_strip_trail (info->album_desc, MAX_ALBUM_LEN);
-}
-
-/*!
- Get autowait time value for PsdPlayListDescriptor *d.
- Time is in seconds unless it is -1 (unlimited).
-*/
-int
-vcdinf_get_autowait_time (const PsdPlayListDescriptor_t *d)
-{
- return vcdinfo_get_wait_time (d->atime);
-}
-
-/*!
- Return the base selection number. VCD_INVALID_BSN is returned if there
- is an error.
-*/
-unsigned int
-vcdinf_get_bsn(const PsdSelectionListDescriptor_t *psd)
-{
- if (NULL==psd) return VCDINFO_INVALID_BSN;
- return(psd->bsn);
-}
-
-/*!
- Return a string giving VCD format (VCD 1.0 VCD 1.1, SVCD, ...
- for this object.
-*/
-const char *
-vcdinf_get_format_version_str (vcd_type_t vcd_type)
-{
- switch (vcd_type)
- {
- case VCD_TYPE_VCD:
- return ("VCD 1.0");
- break;
- case VCD_TYPE_VCD11:
- return ("VCD 1.1");
- break;
- case VCD_TYPE_VCD2:
- return ("VCD 2.0");
- break;
- case VCD_TYPE_SVCD:
- return ("SVCD");
- break;
- case VCD_TYPE_HQVCD:
- return ("HQVCD");
- break;
- case VCD_TYPE_INVALID:
- return ("INVALID");
- break;
- default:
- return ( "????");
- }
-}
-
-/*!
- Return loop count. 0 is infinite loop.
-*/
-uint16_t
-vcdinf_get_loop_count (const PsdSelectionListDescriptor_t *psd)
-{
- return 0x7f & psd->loop;
-}
-
-/*!
- Return LOT offset
-*/
-uint16_t
-vcdinf_get_lot_offset (const LotVcd_t *lot, unsigned int n)
-{
- return uint16_from_be (lot->offset[n]);
-}
-
-/*!
- Return the number of entries in the VCD.
-*/
-unsigned int
-vcdinf_get_num_entries(const EntriesVcd_t *entries)
-{
- if (NULL==entries) return 0;
- return (uint16_from_be (entries->entry_count));
-}
-
-/*!
- Return the number of segments in the VCD.
-*/
-segnum_t
-vcdinf_get_num_segments(const InfoVcd_t *info)
-{
- if (NULL==info) return 0;
- return (uint16_from_be (info->item_count));
-}
-
-/*!
- Return number of LIDs.
-*/
-lid_t
-vcdinf_get_num_LIDs (const InfoVcd_t *info)
-{
- if (NULL==info) return 0;
- /* Should probably use _vcd_pbc_max_lid instead? */
- return uint16_from_be (info->lot_entries);
-}
-
-/*!
- Return the number of menu selections for selection list descriptor psd.
-*/
-unsigned int
-vcdinf_get_num_selections(const PsdSelectionListDescriptor_t *psd)
-{
- return psd->nos;
-}
-
-/*!
- Get play time value for PsdPlayListDescriptor *d.
- Time is in 1/15-second units.
-*/
-uint16_t
-vcdinf_get_play_time (const PsdPlayListDescriptor_t *d)
-{
- if (NULL==d) return 0;
- return uint16_from_be (d->ptime);
-}
-
-/*!
- Return number of bytes in PSD.
-*/
-uint32_t
-vcdinf_get_psd_size (const InfoVcd_t *info)
-{
- if (NULL==info) return 0;
- return uint32_from_be (info->psd_size);
-}
-
-/*!
- Get timeout wait time value for PsdPlayListDescriptor *d.
- Return VCDINFO_INVALID_OFFSET if d is NULL;
- Time is in seconds unless it is -1 (unlimited).
-*/
-uint16_t
-vcdinf_get_timeout_offset (const PsdSelectionListDescriptor_t *d)
-{
- if (NULL == d) return VCDINFO_INVALID_OFFSET;
- return uint16_from_be (d->timeout_ofs);
-}
-
-/*!
- Get timeout wait time value for PsdPlayListDescriptor *d.
- Time is in seconds unless it is -1 (unlimited).
-*/
-int
-vcdinf_get_timeout_time (const PsdSelectionListDescriptor_t *d)
-{
- return vcdinfo_get_wait_time (d->totime);
-}
-
-/*!
- Return the track number for entry n in obj. The first track starts
- at 1. Note this is one less than the track number reported in vcddump.
- (We don't count the header track?)
-*/
-track_t
-vcdinf_get_track(const EntriesVcd_t *entries, const unsigned int entry_num)
-{
- const unsigned int entry_count = uint16_from_be (entries->entry_count);
- /* Note entry_num is 0 origin. */
- return entry_num < entry_count ?
- cdio_from_bcd8 (entries->entry[entry_num].n):
- VCDINFO_INVALID_TRACK;
-}
-
-/*!
- Return the VCD volume count - the number of CD's in the collection.
-*/
-unsigned int
-vcdinf_get_volume_count(const InfoVcd_t *info)
-{
- if (NULL==info) return 0;
- return(uint16_from_be( info->vol_count));
-}
-
-/*!
- Return the VCD volume num - the number of the CD in the collection.
- This is a number between 1 and the volume count.
-*/
-unsigned int
-vcdinf_get_volume_num(const InfoVcd_t *info)
-{
- if (NULL == info) return 0;
- return uint16_from_be(info->vol_id);
-}
-
-/*!
- Get wait time value for PsdPlayListDescriptor *d.
- Time is in seconds unless it is -1 (unlimited).
-*/
-int
-vcdinf_get_wait_time (const PsdPlayListDescriptor_t *d)
-{
- return vcdinfo_get_wait_time (d->wtime);
-}
-
-/*!
- Return true if loop has a jump delay
-*/
-bool
-vcdinf_has_jump_delay (const PsdSelectionListDescriptor_t *psd)
-{
- if (NULL==psd) return false;
- return ((0x80 & psd->loop) != 0);
-}
-
-/*!
- Comparison routine used in sorting. We compare LIDs and if those are
- equal, use the offset.
- Note: we assume an unassigned LID is 0 and this compares as a high value.
-
- NOTE: Consider making static.
-*/
-int
-vcdinf_lid_t_cmp (vcdinfo_offset_t *a, vcdinfo_offset_t *b)
-{
- if (a->lid && b->lid)
- {
- if (a->lid > b->lid) return +1;
- if (a->lid < b->lid) return -1;
- vcd_warn ("LID %d at offset %d has same nunber as LID of offset %d",
- a->lid, a->offset, b->offset);
- }
- else if (a->lid) return -1;
- else if (b->lid) return +1;
-
- /* Failed to sort on LID, try offset now. */
-
- if (a->offset > b->offset) return +1;
- if (a->offset < b->offset) return -1;
-
- /* LIDS and offsets are equal. */
- return 0;
-}
-
-/* Get the LID from a given play-list descriptor.
- VCDINFO_REJECTED_MASK is returned d on error or pld is NULL.
-*/
-lid_t
-vcdinf_pld_get_lid(const PsdPlayListDescriptor_t *pld)
-{
- return (pld != NULL)
- ? uint16_from_be (pld->lid) & VCDINFO_LID_MASK
- : VCDINFO_REJECTED_MASK;
-}
-
-/**
- \fn vcdinfo_pld_get_next_offset(const PsdPlayListDescriptor *pld);
- \brief Get next offset for a given PSD selector descriptor.
- \return VCDINFO_INVALID_OFFSET is returned on error or if pld has no "next"
- entry or pld is NULL. Otherwise the LID offset is returned.
- */
-uint16_t
-vcdinf_pld_get_next_offset(const PsdPlayListDescriptor_t *pld)
-{
- if (NULL == pld) return VCDINFO_INVALID_OFFSET;
- return uint16_from_be (pld->next_ofs);
-}
-
-/*!
- Return number of items in LIDs. Return 0 if error or not found.
-*/
-int
-vcdinf_pld_get_noi (const PsdPlayListDescriptor_t *pld)
-{
- if ( NULL == pld ) return 0;
- return pld->noi;
-}
-
-/*!
- Return the playlist item i in d.
-*/
-uint16_t
-vcdinf_pld_get_play_item(const PsdPlayListDescriptor_t *pld, unsigned int i)
-{
- if (NULL==pld) return 0;
- return uint16_from_be(pld->itemid[i]);
-}
-
-/**
- \fn vcdinf_pld_get_prev_offset(const PsdPlayListDescriptor *pld);
- \brief Get prev offset for a given PSD selector descriptor.
- \return VCDINFO_INVALID_OFFSET is returned on error or if pld has no "prev"
- entry or pld is NULL. Otherwise the LID offset is returned.
- */
-uint16_t
-vcdinf_pld_get_prev_offset(const PsdPlayListDescriptor_t *pld)
-{
- return (pld != NULL) ?
- uint16_from_be (pld->prev_ofs) : VCDINFO_INVALID_OFFSET;
-}
-
-/**
- \fn vcdinf_pld_get_return_offset(const PsdPlayListDescriptor *pld);
- \brief Get return offset for a given PLD selector descriptor.
- \return VCDINFO_INVALID_OFFSET is returned on error or if pld has no
- "return" entry or pld is NULL. Otherwise the LID offset is returned.
- */
-uint16_t
-vcdinf_pld_get_return_offset(const PsdPlayListDescriptor_t *pld)
-{
- return (pld != NULL) ?
- uint16_from_be (pld->return_ofs) : VCDINFO_INVALID_OFFSET;
-}
-
-/**
- * \fn vcdinfo_psd_get_default_offset(const PsdSelectionListDescriptor *psd);
- * \brief Get next offset for a given PSD selector descriptor.
- * \return VCDINFO_INVALID_OFFSET is returned on error or if psd is
- * NULL. Otherwise the LID offset is returned.
- */
-uint16_t
-vcdinf_psd_get_default_offset(const PsdSelectionListDescriptor_t *psd)
-{
- if (NULL == psd) return VCDINFO_INVALID_OFFSET;
- return uint16_from_be (psd->default_ofs);
-}
-
-/*!
- Get the item id for a given selection-list descriptor.
- VCDINFO_REJECTED_MASK is returned on error or if psd is NULL.
-*/
-uint16_t
-vcdinf_psd_get_itemid(const PsdSelectionListDescriptor_t *psd)
-{
- return (psd != NULL) ? uint16_from_be(psd->itemid) : VCDINFO_REJECTED_MASK;
-}
-
-/*!
- Get the LID from a given selection-list descriptor.
- VCDINFO_REJECTED_MASK is returned on error or psd is NULL.
-*/
-lid_t
-vcdinf_psd_get_lid(const PsdSelectionListDescriptor_t *psd)
-{
- return (psd != NULL)
- ? uint16_from_be (psd->lid) & VCDINFO_LID_MASK
- : VCDINFO_REJECTED_MASK;
-}
-
-/*!
- Get the LID rejected status for a given PSD selector descriptor.
- true is also returned d is NULL.
-*/
-bool
-vcdinf_psd_get_lid_rejected(const PsdSelectionListDescriptor_t *psd)
-{
- return (psd != NULL)
- ? vcdinfo_is_rejected(uint16_from_be(psd->lid))
- : true;
-}
-
-/**
- * \fn vcdinf_psd_get_next_offset(const PsdSelectionListDescriptor *psd);
- * \brief Get "next" offset for a given PSD selector descriptor.
- * \return VCDINFO_INVALID_OFFSET is returned on error or if psd is
- * NULL. Otherwise the LID offset is returned.
- */
-uint16_t
-vcdinf_psd_get_next_offset(const PsdSelectionListDescriptor_t *psd)
-{
- if (NULL == psd) return VCDINFO_INVALID_OFFSET;
- return uint16_from_be (psd->next_ofs);
-}
-
-/**
- * \fn vcdinf_psd_get_offset(const PsdSelectionListDescriptor *d,
- * unsigned int entry_num);
- * \brief Get offset entry_num for a given PSD selector descriptor.
- * \return VCDINFO_INVALID_OFFSET is returned if d on error or d is
- * NULL. Otherwise the LID offset is returned.
- */
-uint16_t
-vcdinf_psd_get_offset(const PsdSelectionListDescriptor_t *psd,
- unsigned int entry_num)
-{
- return (psd != NULL && entry_num < vcdinf_get_num_selections(psd))
- ? uint16_from_be (psd->ofs[entry_num]) : VCDINFO_INVALID_OFFSET;
-}
-
-/**
- \fn vcdinf_psd_get_prev_offset(const PsdSelectionListDescriptor *psd);
- \brief Get "prev" offset for a given PSD selector descriptor.
- \return VCDINFO_INVALID_OFFSET is returned on error or if psd has no "prev"
- entry or psd is NULL. Otherwise the LID offset is returned.
- */
-uint16_t
-vcdinf_psd_get_prev_offset(const PsdSelectionListDescriptor_t *psd)
-{
- return (psd != NULL) ?
- uint16_from_be (psd->prev_ofs) : VCDINFO_INVALID_OFFSET;
-}
-
-/**
- * \fn vcdinf_psd_get_return_offset(const PsdSelectionListDescriptor *psd);
- * \brief Get return offset for a given PSD selector descriptor.
- \return VCDINFO_INVALID_OFFSET is returned on error or if psd has no
- "return" entry or psd is NULL. Otherwise the LID offset is returned.
- */
-uint16_t
-vcdinf_psd_get_return_offset(const PsdSelectionListDescriptor_t *psd)
-{
- return (psd != NULL) ?
- uint16_from_be (psd->return_ofs) : VCDINFO_INVALID_OFFSET;
-}
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libvcd/info.c b/src/input/vcd/libvcd/info.c
deleted file mode 100644
index b01bd6eee..000000000
--- a/src/input/vcd/libvcd/info.c
+++ /dev/null
@@ -1,2103 +0,0 @@
-/*
- $Id: info.c,v 1.8 2007/03/23 21:47:31 dsalt Exp $
-
- Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Foundation
- Software, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-/*
- Things here refer to higher-level structures usually accessed via
- vcdinfo_t. For lower-level access which generally use
- structures other than vcdinfo_t, see inf.c
-*/
-
-
-/* Private headers */
-#include "info_private.h"
-#include "vcd_assert.h"
-#include "pbc.h"
-#include "util.h"
-#include "vcd_read.h"
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#include <cdio/cdio.h>
-#include <cdio/bytesex.h>
-#include <cdio/cd_types.h>
-#include <cdio/util.h>
-
-/* Eventually move above libvcd includes but having vcdinfo including. */
-#include <libvcd/info.h>
-
-#include <stdio.h>
-#include <stddef.h>
-#include <errno.h>
-
-static const char _rcsid[] = "$Id: info.c,v 1.8 2007/03/23 21:47:31 dsalt Exp $";
-
-#define BUF_COUNT 16
-#define BUF_SIZE 80
-
-/* Return a pointer to a internal free buffer */
-static char *
-_getbuf (void)
-{
- static char _buf[BUF_COUNT][BUF_SIZE];
- static int _num = -1;
-
- _num++;
- _num %= BUF_COUNT;
-
- memset (_buf[_num], 0, BUF_SIZE);
-
- return _buf[_num];
-}
-
-/*
- Initialize/allocate segment portion of vcdinfo_obj_t.
-
- Getting exact segments sizes is done in a rather complicated way.
- A simple approach would be to use the fixed size allocated on disk,
- but players have trouble with the internal fragmentation padding.
- More accurate results are obtained by consulting with ISO 9660
- information for the corresponding file entry.
-
- Another approach to get segment sizes is to read/scan the
- MPEGs. That would be rather slow.
-*/
-static void
-_init_segments (vcdinfo_obj_t *obj)
-{
- InfoVcd_t *info = vcdinfo_get_infoVcd(obj);
- segnum_t num_segments = vcdinfo_get_num_segments(obj);
- CdioListNode *entnode;
- CdioList *entlist;
- int i;
- lsn_t last_lsn=0;
-
- obj->first_segment_lsn = cdio_msf_to_lsn(&info->first_seg_addr);
- obj->seg_sizes = _vcd_malloc( num_segments * sizeof(uint32_t *));
-
- if (NULL == obj->seg_sizes || 0 == num_segments) return;
-
- entlist = iso9660_fs_readdir(obj->img, "SEGMENT", true);
-
- i=0;
- _CDIO_LIST_FOREACH (entnode, entlist) {
- iso9660_stat_t *statbuf = _cdio_list_node_data (entnode);
-
- if (statbuf->type == _STAT_DIR) continue;
-
- while(info->spi_contents[i].item_cont) {
- obj->seg_sizes[i] = VCDINFO_SEGMENT_SECTOR_SIZE;
- i++;
- }
-
- /* Should have an entry in the ISO 9660 filesystem. Get and save
- in statbuf.secsize this size.
- */
- obj->seg_sizes[i] = statbuf->secsize;
-
- if (last_lsn >= statbuf->lsn)
- vcd_warn ("Segments if ISO 9660 directory out of order lsn %ul >= %ul",
- (unsigned int) last_lsn, (unsigned int) statbuf->lsn);
- last_lsn = statbuf->lsn;
-
- i++;
- }
-
- while(i < num_segments && info->spi_contents[i].item_cont) {
- obj->seg_sizes[i] = VCDINFO_SEGMENT_SECTOR_SIZE;
- i++;
- }
-
- if (i != num_segments)
- vcd_warn ("Number of segments found %d is not number of segments %d",
- i, num_segments);
-
- _cdio_list_free (entlist, true);
-
-
-#if 0
- /* Figure all of the segment sector sizes */
- for (i=0; i < num_segments; i++) {
-
- obj->seg_sizes[i] = VCDINFO_SEGMENT_SECTOR_SIZE;
-
- if ( !info->spi_contents[i].item_cont ) {
- /* Should have an entry in the ISO 9660 filesystem. Get and save
- in statbuf.secsize this size.
- */
- lsn_t lsn = vcdinfo_get_seg_lsn(obj, i);
- iso9660_stat_t *statbuf =iso9660_find_fs_lsn(obj->img, lsn);
- if (NULL != statbuf) {
- obj->seg_sizes[i] = statbuf->secsize;
- free(statbuf);
- } else {
- vcd_warn ("Trouble finding ISO 9660 size for segment %d.", i);
- }
- }
- }
-#endif
-
-}
-
-/*!
- Return the number of audio channels implied by "audio_type".
- 0 is returned on error.
-*/
-unsigned int
-vcdinfo_audio_type_num_channels(const vcdinfo_obj_t *obj,
- unsigned int audio_type)
-{
- const int audio_types[2][5] =
- {
- { /* VCD 2.0 */
- 0, /* no audio*/
- 1, /* single channel */
- 1, /* stereo */
- 2, /* dual channel */
- 0}, /* error */
-
- { /* SVCD, HQVCD */
- 0, /* no stream */
- 1, /* 1 stream */
- 2, /* 2 streams */
- 1, /* 1 multi-channel stream (surround sound) */
- 0} /* error */
- };
-
- /* We should also check that the second index is in range too. */
- if (audio_type > 4) {
- return 0;
- }
-
- /* Get first index entry into above audio_type array from vcd_type */
- switch (obj->vcd_type) {
-
- case VCD_TYPE_VCD:
- case VCD_TYPE_VCD11:
- return 1;
-
- case VCD_TYPE_VCD2:
- return 3;
- break;
-
- case VCD_TYPE_HQVCD:
- case VCD_TYPE_SVCD:
- return audio_types[1][audio_type];
- break;
-
- case VCD_TYPE_INVALID:
- default:
- /* We have an invalid entry. Set to handle below. */
- return 0;
- }
-}
-
-/*!
- Return a string describing an audio type.
-*/
-const char *
-vcdinfo_audio_type2str(const vcdinfo_obj_t *obj, unsigned int audio_type)
-{
- const char *audio_types[3][5] =
- {
- /* INVALID, VCD 1.0, or VCD 1.1 */
- { "unknown", "invalid", "", "", "" },
-
- /*VCD 2.0 */
- { "no audio", "single channel", "stereo", "dual channel", "error" },
-
- /* SVCD, HQVCD */
- { "no stream", "1 stream", "2 streams",
- "1 multi-channel stream (surround sound)", "error"},
- };
-
- unsigned int first_index = 0;
-
- /* Get first index entry into above audio_type array from vcd_type */
- switch (obj->vcd_type) {
-
- case VCD_TYPE_VCD:
- case VCD_TYPE_VCD11:
- case VCD_TYPE_VCD2:
- first_index=1;
- break;
-
- case VCD_TYPE_HQVCD:
- case VCD_TYPE_SVCD:
- first_index=2;
- break;
-
- case VCD_TYPE_INVALID:
- default:
- /* We have an invalid entry. Set to handle below. */
- audio_type=4;
- }
-
- /* We should also check that the second index is in range too. */
- if (audio_type > 3) {
- first_index=0;
- audio_type=1;
- }
-
- return audio_types[first_index][audio_type];
-}
-
-/*!
- Note first seg_num is 0!
-*/
-const char *
-vcdinfo_ogt2str(const vcdinfo_obj_t *obj, segnum_t seg_num)
-{
- const InfoVcd_t *info = &obj->info;
- const char *ogt_str[] =
- {
- "None",
- "1 available",
- "0 & 1 available",
- "all 4 available"
- };
-
- return ogt_str[info->spi_contents[seg_num].ogt];
-}
-
-
-const char *
-vcdinfo_video_type2str(const vcdinfo_obj_t *obj, segnum_t seg_num)
-{
- const char *video_types[] =
- {
- "no stream",
- "NTSC still",
- "NTSC still (lo+hires)",
- "NTSC motion",
- "reserved (0x4)",
- "PAL still",
- "PAL still (lo+hires)",
- "PAL motion",
- "INVALID ENTRY"
- };
-
- return video_types[vcdinfo_get_video_type(obj, seg_num)];
-}
-
-/*!
- \brief Classify itemid_num into the kind of item it is: track #, entry #,
- segment #.
- \param itemid is set to contain this classification an the converted
- entry number.
-*/
-void
-vcdinfo_classify_itemid (uint16_t itemid_num,
- /*out*/ vcdinfo_itemid_t *itemid)
-{
-
- itemid->num = itemid_num;
- if (itemid_num < 2)
- itemid->type = VCDINFO_ITEM_TYPE_NOTFOUND;
- else if (itemid_num < MIN_ENCODED_TRACK_NUM) {
- itemid->type = VCDINFO_ITEM_TYPE_TRACK;
- itemid->num--;
- } else if (itemid_num < 600) {
- itemid->type = VCDINFO_ITEM_TYPE_ENTRY;
- itemid->num -= MIN_ENCODED_TRACK_NUM;
- } else if (itemid_num < MIN_ENCODED_SEGMENT_NUM)
- itemid->type = VCDINFO_ITEM_TYPE_LID;
- else if (itemid_num <= MAX_ENCODED_SEGMENT_NUM) {
- itemid->type = VCDINFO_ITEM_TYPE_SEGMENT;
- itemid->num -= (MIN_ENCODED_SEGMENT_NUM);
- } else
- itemid->type = VCDINFO_ITEM_TYPE_SPAREID2;
-}
-
-const char *
-vcdinfo_pin2str (uint16_t itemid_num)
-{
- char *buf = _getbuf ();
- vcdinfo_itemid_t itemid;
-
- vcdinfo_classify_itemid(itemid_num, &itemid);
- strcpy (buf, "??");
-
- switch(itemid.type) {
- case VCDINFO_ITEM_TYPE_NOTFOUND:
- snprintf (buf, BUF_SIZE, "play nothing (0x%4.4x)", itemid.num);
- break;
- case VCDINFO_ITEM_TYPE_TRACK:
- snprintf (buf, BUF_SIZE, "SEQUENCE[%d] (0x%4.4x)", itemid.num-1,
- itemid_num);
- break;
- case VCDINFO_ITEM_TYPE_ENTRY:
- snprintf (buf, BUF_SIZE, "ENTRY[%d] (0x%4.4x)", itemid.num, itemid_num);
- break;
- case VCDINFO_ITEM_TYPE_SEGMENT:
- snprintf (buf, BUF_SIZE, "SEGMENT[%d] (0x%4.4x)", itemid.num, itemid_num);
- break;
- case VCDINFO_ITEM_TYPE_LID:
- snprintf (buf, BUF_SIZE, "spare id (0x%4.4x)", itemid.num);
- break;
- case VCDINFO_ITEM_TYPE_SPAREID2:
- snprintf (buf, BUF_SIZE, "spare id2 (0x%4.4x)", itemid.num);
- break;
- }
-
- return buf;
-}
-
-/*!
- Return a string containing the VCD album id, or NULL if there is
- some problem in getting this.
-*/
-const char *
-vcdinfo_get_album_id(const vcdinfo_obj_t *obj)
-{
- if ( NULL == obj ) return (NULL);
- return vcdinf_get_album_id(&obj->info);
-}
-
-/*!
- Return the VCD ID.
- NULL is returned if there is some problem in getting this.
-*/
-char *
-vcdinfo_get_application_id(vcdinfo_obj_t *p_obj)
-{
- if ( NULL == p_obj ) return (NULL);
- return iso9660_get_application_id(&p_obj->pvd);
-}
-
-/*!
- Return a pointer to the cdio structure for the CD image opened or
- NULL if error.
-*/
-CdIo *
-vcdinfo_get_cd_image (const vcdinfo_obj_t *vcd_obj)
-{
- if (NULL == vcd_obj) return NULL;
- return vcd_obj->img;
-}
-
-
-/*!
- \fn vcdinfo_selection_get_lid(const vcdinfo_obj_t *obj, lid_t lid,
- unsigned int selection);
-
- \brief Get offset of a selection for a given lid.
-
- Return the LID offset associated with a the selection number of the
- passed-in LID parameter.
-
- \return VCDINFO_INVALID_LID is returned if obj on error or obj
- is NULL. Otherwise the LID offset is returned.
-*/
-lid_t vcdinfo_selection_get_lid(const vcdinfo_obj_t *obj, lid_t lid,
- unsigned int selection)
-{
- unsigned int offset;
-
- if (NULL == obj) return VCDINFO_INVALID_LID;
-
- offset = vcdinfo_selection_get_offset(obj, lid, selection);
- switch (offset) {
- case VCDINFO_INVALID_OFFSET:
- case PSD_OFS_MULTI_DEF:
- case PSD_OFS_MULTI_DEF_NO_NUM:
- return VCDINFO_INVALID_LID;
- default:
- {
- vcdinfo_offset_t *ofs = vcdinfo_get_offset_t(obj, offset);
- return ofs->lid;
- }
- }
-}
-
-/*!
- \fn vcdinfo_selection_get_offset(const vcdinfo_obj_t *obj, lid_t lid,
- unsigned int selection);
-
- \brief Get offset of a selection for a given lid.
-
- Return the LID offset associated with a the selection number of the
- passed-in LID parameter.
-
- \return VCDINFO_INVALID_OFFSET is returned if error, obj is NULL or
- the lid is not some type of selection list. Otherwise the LID offset
- is returned.
-*/
-uint16_t vcdinfo_selection_get_offset(const vcdinfo_obj_t *obj, lid_t lid,
- unsigned int selection)
-{
- unsigned int bsn;
-
- PsdListDescriptor_t pxd;
- vcdinfo_lid_get_pxd(obj, &pxd, lid);
- if (pxd.descriptor_type != PSD_TYPE_SELECTION_LIST &&
- pxd.descriptor_type != PSD_TYPE_EXT_SELECTION_LIST) {
- vcd_warn( "Requesting selection of LID %i which not a selection list -"
- " type is 0x%x",
- lid, pxd.descriptor_type );
- return VCDINFO_INVALID_OFFSET;
- }
-
- bsn=vcdinf_get_bsn(pxd.psd);
-
- if ( (selection - bsn + 1) > 0) {
- return vcdinfo_lid_get_offset(obj, lid, selection-bsn+1);
- } else {
- vcd_warn( "Selection number %u too small. bsn %u", selection, bsn );
- return VCDINFO_INVALID_OFFSET;
- }
-}
-
-/**
- \fn vcdinfo_get_default_offset(const vcdinfo_obj_t *obj, unsinged int lid);
- \brief Get return offset for a given PLD selector descriptor.
- \return VCDINFO_INVALID_OFFSET is returned on error or if pld has no
- "return" entry or pld is NULL. Otherwise the LID offset is returned.
- */
-uint16_t
-vcdinfo_get_default_offset(const vcdinfo_obj_t *obj, lid_t lid)
-{
- if (NULL != obj) {
-
- PsdListDescriptor_t pxd;
-
- vcdinfo_lid_get_pxd(obj, &pxd, lid);
-
- switch (pxd.descriptor_type) {
- case PSD_TYPE_EXT_SELECTION_LIST:
- case PSD_TYPE_SELECTION_LIST:
- return vcdinf_psd_get_default_offset(pxd.psd);
- break;
- case PSD_TYPE_PLAY_LIST:
- case PSD_TYPE_END_LIST:
- case PSD_TYPE_COMMAND_LIST:
- break;
- }
- }
- return VCDINFO_INVALID_OFFSET;
-}
-
-/*!
- \brief Get default or multi-default LID.
-
- Return the LID offset associated with a the "default" entry of the
- passed-in LID parameter. Note "default" entries are associated
- with PSDs that are (extended) selection lists. If the "default"
- offset is a multi-default, we use entry_num to find the proper
- "default" LID. Otherwise this routine is exactly like
- vcdinfo_get_default_lid with the exception of requiring an
- additional "entry_num" parameter.
-
- \return VCDINFO_INVALID_LID is returned on error, or if the LID
- is not a selection list or no "default" entry. Otherwise the LID
- offset is returned.
-*/
-lid_t
-vcdinfo_get_multi_default_lid(const vcdinfo_obj_t *obj, lid_t lid,
- lsn_t lsn)
-{
- unsigned int offset;
- unsigned int entry_num;
-
- entry_num = vcdinfo_lsn_get_entry(obj, lsn);
- offset = vcdinfo_get_multi_default_offset(obj, lid, entry_num);
-
- switch (offset) {
- case VCDINFO_INVALID_OFFSET:
- case PSD_OFS_MULTI_DEF:
- case PSD_OFS_MULTI_DEF_NO_NUM:
- return VCDINFO_INVALID_LID;
- default:
- {
- vcdinfo_offset_t *ofs = vcdinfo_get_offset_t(obj, offset);
- return ofs->lid;
- }
- }
-}
-
-/*!
- \brief Get default or multi-default LID offset.
-
- Return the LID offset associated with a the "default" entry of the
- passed-in LID parameter. Note "default" entries are associated
- with PSDs that are (extended) selection lists. If the "default"
- offset is a multi-default, we use entry_num to find the proper
- "default" offset. Otherwise this routine is exactly like
- vcdinfo_get_default_offset with the exception of requiring an
- additional "entry_num" parameter.
-
- \return VCDINFO_INVALID_OFFSET is returned on error, or if the LID
- is not a selection list or no "default" entry. Otherwise the LID
- offset is returned.
-*/
-uint16_t
-vcdinfo_get_multi_default_offset(const vcdinfo_obj_t *obj, lid_t lid,
- unsigned int entry_num)
-{
- uint16_t offset=vcdinfo_get_default_offset(obj, lid);
-
- switch (offset) {
- case PSD_OFS_MULTI_DEF:
- case PSD_OFS_MULTI_DEF_NO_NUM:
- {
- /* Have some work todo... Figure the selection number. */
- PsdListDescriptor_t pxd;
-
- vcdinfo_lid_get_pxd(obj, &pxd, lid);
-
- switch (pxd.descriptor_type) {
-
- case PSD_TYPE_SELECTION_LIST:
- case PSD_TYPE_EXT_SELECTION_LIST: {
- vcdinfo_itemid_t selection_itemid;
- uint16_t selection_itemid_num;
- unsigned int start_entry_num;
-
- if (pxd.psd == NULL) return VCDINFO_INVALID_OFFSET;
- selection_itemid_num = vcdinf_psd_get_itemid(pxd.psd);
- vcdinfo_classify_itemid(selection_itemid_num, &selection_itemid);
- if (selection_itemid.type != VCDINFO_ITEM_TYPE_TRACK) {
- return VCDINFO_INVALID_OFFSET;
- }
-
- start_entry_num = vcdinfo_track_get_entry(obj, selection_itemid.num);
- return vcdinfo_selection_get_offset(obj, lid,
- entry_num-start_entry_num);
- }
- default: ;
- }
- }
- default:
- return VCDINFO_INVALID_OFFSET;
- }
-}
-
-/*!
- Return a string containing the default VCD device if none is specified.
- Return NULL we can't get this information.
-*/
-char *
-vcdinfo_get_default_device (const vcdinfo_obj_t *vcd_obj)
-{
-
- /* If device not already open, then we'll open it temporarily and
- let CdIo select a driver, get the default for that and then
- close/destroy the temporary we created.
- */
- CdIo *cdio=NULL;
- if (vcd_obj != NULL && vcd_obj->img != NULL)
- cdio = vcd_obj->img;
-
- return cdio_get_default_device(cdio);
-}
-
-/*!
- Return number of sector units in of an entry. 0 is returned if entry_num
- is out of range.
- The first entry number is 0.
-*/
-uint32_t
-vcdinfo_get_entry_sect_count (const vcdinfo_obj_t *obj, unsigned int entry_num)
-{
- const EntriesVcd_t *entries = &obj->entries;
- const unsigned int entry_count = vcdinf_get_num_entries(entries);
- if (entry_num > entry_count)
- return 0;
- else {
- const lsn_t this_lsn = vcdinfo_get_entry_lsn(obj, entry_num);
- lsn_t next_lsn;
- if (entry_num < entry_count-1) {
- track_t track=vcdinfo_get_track(obj, entry_num);
- track_t next_track=vcdinfo_get_track(obj, entry_num+1);
- next_lsn = vcdinfo_get_entry_lsn(obj, entry_num+1);
- /* If we've changed tracks, don't include pregap sector between
- tracks.
- */
- if (track != next_track) next_lsn -= CDIO_PREGAP_SECTORS;
- } else {
- /* entry_num == entry_count -1. Or the last entry.
- This is really really ugly. There's probably a better
- way to do it.
- Below we get the track of the current entry and then the LBA of the
- beginning of the following (leadout?) track.
-
- Wait! It's uglier than that! Since VCD's can be created
- *without* a pregap to the leadout track, we try not to use
- that if we can get the entry from the ISO 9660 filesystem.
- */
- track_t track = vcdinfo_get_track(obj, entry_num);
- if (track != VCDINFO_INVALID_TRACK) {
- iso9660_stat_t *statbuf;
- const lsn_t lsn = vcdinfo_get_track_lsn(obj, track);
-
- /* Try to get the sector count from the ISO 9660 filesystem */
- statbuf = iso9660_find_fs_lsn(obj->img, lsn);
-
- if (NULL != statbuf) {
- next_lsn = lsn + statbuf->secsize;
- free(statbuf);
- } else {
- /* Failed on ISO 9660 filesystem. Use next track or
- LEADOUT track. */
- next_lsn = vcdinfo_get_track_lsn(obj, track+1);
- }
- if (next_lsn == VCDINFO_NULL_LSN)
- return 0;
- } else {
- /* Something went wrong. Set up size to zero. */
- return 0;
- }
- }
- return (next_lsn - this_lsn);
- }
-}
-
-/*! Return the starting MSF (minutes/secs/frames) for sequence
- entry_num in obj. NULL is returned if there is no entry.
- The first entry number is 0.
-*/
-const msf_t *
-vcdinfo_get_entry_msf(const vcdinfo_obj_t *obj, unsigned int entry_num)
-{
- const EntriesVcd_t *entries = &obj->entries;
- return vcdinf_get_entry_msf(entries, entry_num);
-}
-
-/*! Return the starting LBA (logical block address) for sequence
- entry_num in obj. VCDINFO_NULL_LBA is returned if there is no entry.
-*/
-lba_t
-vcdinfo_get_entry_lba(const vcdinfo_obj_t *obj, unsigned int entry_num)
-{
- if ( NULL == obj ) return VCDINFO_NULL_LBA;
- else {
- const msf_t *msf = vcdinfo_get_entry_msf(obj, entry_num);
- msf = vcdinfo_get_entry_msf(obj, entry_num);
- return (msf != NULL) ? cdio_msf_to_lba(msf) : VCDINFO_NULL_LBA;
- }
-}
-
-/*! Return the starting LBA (logical block address) for sequence
- entry_num in obj. VCDINFO_NULL_LBA is returned if there is no entry.
-*/
-lsn_t
-vcdinfo_get_entry_lsn(const vcdinfo_obj_t *obj, unsigned int entry_num)
-{
- if ( NULL == obj ) return VCDINFO_NULL_LBA;
- else {
- const msf_t *msf = vcdinfo_get_entry_msf(obj, entry_num);
- return (msf != NULL) ? cdio_msf_to_lsn(msf) : VCDINFO_NULL_LSN;
- }
-}
-
-EntriesVcd_t *
-vcdinfo_get_entriesVcd (vcdinfo_obj_t *obj)
-{
- if (NULL == obj) return NULL;
- return &obj->entries;
-}
-
-/*!
- Get the VCD format (VCD 1.0 VCD 1.1, SVCD, ... for this object.
- The type is also set inside obj.
-*/
-vcd_type_t
-vcdinfo_get_format_version (vcdinfo_obj_t *obj)
-{
- return obj->vcd_type;
-}
-
-/*!
- Return a string giving VCD format (VCD 1.0 VCD 1.1, SVCD, ...
- for this object.
-*/
-const char *
-vcdinfo_get_format_version_str (const vcdinfo_obj_t *obj)
-{
- if (NULL == obj) return "*Uninitialized*";
- return vcdinf_get_format_version_str(obj->vcd_type);
-}
-
-InfoVcd_t *
-vcdinfo_get_infoVcd (vcdinfo_obj_t *obj)
-{
- if (NULL == obj) return NULL;
- return &obj->info;
-}
-
-/*! Return the entry number closest and before the given LSN.
- */
-unsigned int
-vcdinfo_lsn_get_entry(const vcdinfo_obj_t *obj, lsn_t lsn)
-{
-
- /* Do a binary search to find the entry. */
- unsigned int i = 0;
- unsigned int j = vcdinfo_get_num_entries(obj);
- unsigned int mid;
- unsigned int mid_lsn;
- do {
- mid = (i+j)/2;
- mid_lsn = vcdinfo_get_entry_lsn(obj, mid);
- if ( lsn <= mid_lsn ) j = mid-1;
- if ( lsn >= mid_lsn ) i = mid+1;
- } while (i <= j);
-
- /* We want the entry closest but before. */
- return (lsn == mid_lsn) ? mid : mid-1;
-}
-
-
-void *
-vcdinfo_get_pvd (vcdinfo_obj_t *obj)
-{
- if (NULL == obj) return NULL;
- return &obj->pvd;
-}
-
-void *
-vcdinfo_get_scandata (vcdinfo_obj_t *obj)
-{
- if (NULL == obj) return NULL;
- return obj->scandata_buf;
-}
-
-void *
-vcdinfo_get_searchDat (vcdinfo_obj_t *obj)
-{
- if (NULL == obj) return NULL;
- return obj->search_buf;
-}
-
-void *
-vcdinfo_get_tracksSVD (vcdinfo_obj_t *obj)
-{
- if (NULL == obj) return NULL;
- return obj->tracks_buf;
-}
-
-/*!
- Get the itemid for a given list ID.
- VCDINFO_REJECTED_MASK is returned on error or if obj is NULL.
-*/
-uint16_t
-vcdinfo_lid_get_itemid(const vcdinfo_obj_t *obj, lid_t lid)
-{
- PsdListDescriptor_t pxd;
-
- if (obj == NULL) return VCDINFO_REJECTED_MASK;
- vcdinfo_lid_get_pxd(obj, &pxd, lid);
- switch (pxd.descriptor_type) {
- case PSD_TYPE_SELECTION_LIST:
- case PSD_TYPE_EXT_SELECTION_LIST:
- if (pxd.psd == NULL) return VCDINFO_REJECTED_MASK;
- return vcdinf_psd_get_itemid(pxd.psd);
- break;
- case PSD_TYPE_PLAY_LIST:
- /* FIXME: There is an array of items */
- case PSD_TYPE_END_LIST:
- case PSD_TYPE_COMMAND_LIST:
- return VCDINFO_REJECTED_MASK;
- }
-
- return VCDINFO_REJECTED_MASK;
-
-}
-
-/*!
- Get the LOT pointer.
-*/
-LotVcd_t *
-vcdinfo_get_lot(const vcdinfo_obj_t *obj)
-{
- if (NULL == obj) return NULL;
- return obj->lot;
-}
-
-/*!
- Get the extended LOT pointer.
-*/
-LotVcd_t *
-vcdinfo_get_lot_x(const vcdinfo_obj_t *obj)
-{
- if (NULL == obj) return NULL;
- return obj->lot_x;
-}
-
-/*!
- Return number of LIDs.
-*/
-lid_t
-vcdinfo_get_num_LIDs (const vcdinfo_obj_t *obj)
-{
- /* Should probably use _vcd_pbc_max_lid instead? */
- if (NULL==obj) return 0;
- return vcdinf_get_num_LIDs(&obj->info);
-}
-
-/*!
- Return the number of entries in the VCD.
-*/
-unsigned int
-vcdinfo_get_num_entries(const vcdinfo_obj_t *obj)
-{
- const EntriesVcd_t *entries = &obj->entries;
- return vcdinf_get_num_entries(entries);
-}
-
-/*!
- Return the number of segments in the VCD. Return 0 if there is some
- problem.
-*/
-segnum_t
-vcdinfo_get_num_segments(const vcdinfo_obj_t *obj)
-{
- if (NULL==obj) return 0;
- return vcdinf_get_num_segments(&obj->info);
-}
-
-/*!
- \fn vcdinfo_get_offset_lid(const vcdinfo_obj_t *obj, unsigned int entry_num);
- \brief Get offset entry_num for a given LID.
- \return VCDINFO_INVALID_OFFSET is returned if obj on error or obj
- is NULL. Otherwise the LID offset is returned.
-*/
-uint16_t
-vcdinfo_lid_get_offset(const vcdinfo_obj_t *obj, lid_t lid,
- unsigned int entry_num)
-{
- PsdListDescriptor_t pxd;
-
- if (obj == NULL) return VCDINFO_INVALID_OFFSET;
- vcdinfo_lid_get_pxd(obj, &pxd, lid);
-
- switch (pxd.descriptor_type) {
- case PSD_TYPE_SELECTION_LIST:
- case PSD_TYPE_EXT_SELECTION_LIST:
- if (pxd.psd == NULL) return VCDINFO_INVALID_OFFSET;
- return vcdinf_psd_get_offset(pxd.psd, entry_num-1);
- break;
- case PSD_TYPE_PLAY_LIST:
- /* FIXME: There is an array of items */
- case PSD_TYPE_END_LIST:
- case PSD_TYPE_COMMAND_LIST:
- return VCDINFO_INVALID_OFFSET;
- }
- return VCDINFO_INVALID_OFFSET;
-
-}
-
-/*!
- NULL is returned on error.
-*/
-static vcdinfo_offset_t *
-_vcdinfo_get_offset_t (const vcdinfo_obj_t *obj, unsigned int offset, bool ext)
-{
- CdioListNode *node;
- CdioList *offset_list = ext ? obj->offset_x_list : obj->offset_list;
-
- switch (offset) {
- case PSD_OFS_DISABLED:
- case PSD_OFS_MULTI_DEF:
- case PSD_OFS_MULTI_DEF_NO_NUM:
- return NULL;
- default: ;
- }
-
- _CDIO_LIST_FOREACH (node, offset_list)
- {
- vcdinfo_offset_t *ofs = _cdio_list_node_data (node);
- if (offset == ofs->offset)
- return ofs;
- }
- return NULL;
-}
-
-/*!
- Get the VCD info list.
-*/
-CdioList *
-vcdinfo_get_offset_list(const vcdinfo_obj_t *obj)
-{
- if (NULL == obj) return NULL;
- return obj->offset_list;
-}
-
-
-/*!
- Get the VCD info extended offset list.
-*/
-CdioList *
-vcdinfo_get_offset_x_list(const vcdinfo_obj_t *obj)
-{
- if (NULL == obj) return NULL;
- return obj->offset_x_list;
-}
-
-/*!
- Get the VCD info offset multiplier.
-*/
-unsigned int vcdinfo_get_offset_mult(const vcdinfo_obj_t *obj)
-{
- if (NULL == obj) return 0xFFFF;
- return obj->info.offset_mult;
-}
-
-/*!
- Get entry in offset list for the item that has offset. This entry
- has for example the LID. NULL is returned on error.
-*/
-vcdinfo_offset_t *
-vcdinfo_get_offset_t (const vcdinfo_obj_t *obj, unsigned int offset)
-{
- vcdinfo_offset_t *off_p= _vcdinfo_get_offset_t (obj, offset, true);
- if (NULL != off_p)
- return off_p;
- return _vcdinfo_get_offset_t (obj, offset, false);
-}
-
-/*!
- Return a string containing the VCD publisher id with trailing
- blanks removed, or NULL if there is some problem in getting this.
-*/
-const char *
-vcdinfo_get_preparer_id(const vcdinfo_obj_t *obj)
-{
- if ( NULL == obj ) return (NULL);
- return iso9660_get_preparer_id(&obj->pvd);
-}
-
-/*!
- Get the PSD.
-*/
-uint8_t *
-vcdinfo_get_psd(const vcdinfo_obj_t *obj)
-{
- if ( NULL == obj ) return (NULL);
- return obj->psd;
-}
-
-/*!
- Get the extended PSD.
-*/
-uint8_t *
-vcdinfo_get_psd_x(const vcdinfo_obj_t *obj)
-{
- if ( NULL == obj ) return (NULL);
- return obj->psd_x;
-}
-
-/*!
- Return number of bytes in PSD. Return 0 if there's an error.
-*/
-uint32_t
-vcdinfo_get_psd_size (const vcdinfo_obj_t *obj)
-{
- if ( NULL == obj ) return 0;
- return vcdinf_get_psd_size(&obj->info);
-}
-
-/*!
- Return number of bytes in the extended PSD. Return 0 if there's an error.
-*/
-uint32_t
-vcdinfo_get_psd_x_size (const vcdinfo_obj_t *obj)
-{
- if ( NULL == obj ) return 0;
- return obj->psd_x_size;
-}
-
-/*!
- Return a string containing the VCD publisher id with trailing
- blanks removed, or NULL if there is some problem in getting this.
-*/
-char *
-vcdinfo_get_publisher_id(const vcdinfo_obj_t *obj)
-{
- if ( NULL == obj ) return (NULL);
- return iso9660_get_publisher_id(&obj->pvd);
-}
-
-/*!
- Get the PSD Selection List Descriptor for a given lid.
- NULL is returned if error or not found.
-*/
-static bool
-_vcdinfo_lid_get_pxd(const vcdinfo_obj_t *obj, PsdListDescriptor_t *pxd,
- uint16_t lid, bool ext)
-{
- CdioListNode *node;
- unsigned mult = obj->info.offset_mult;
- const uint8_t *psd = ext ? obj->psd_x : obj->psd;
- CdioList *offset_list = ext ? obj->offset_x_list : obj->offset_list;
-
- if (offset_list == NULL) return false;
-
- _CDIO_LIST_FOREACH (node, offset_list)
- {
- vcdinfo_offset_t *ofs = _cdio_list_node_data (node);
- unsigned _rofs = ofs->offset * mult;
-
- pxd->descriptor_type = psd[_rofs];
-
- switch (pxd->descriptor_type)
- {
- case PSD_TYPE_PLAY_LIST:
- {
- pxd->pld = (PsdPlayListDescriptor_t *) (psd + _rofs);
- if (vcdinf_pld_get_lid(pxd->pld) == lid) {
- return true;
- }
- break;
- }
-
- case PSD_TYPE_EXT_SELECTION_LIST:
- case PSD_TYPE_SELECTION_LIST:
- {
- pxd->psd = (PsdSelectionListDescriptor_t *) (psd + _rofs);
- if (vcdinf_psd_get_lid(pxd->psd) == lid) {
- return true;
- }
- break;
- }
- default: ;
- }
- }
- return false;
-}
-
-/*!
- Get the PSD Selection List Descriptor for a given lid.
- False is returned if not found.
-*/
-bool
-vcdinfo_lid_get_pxd(const vcdinfo_obj_t *obj, PsdListDescriptor_t *pxd,
- uint16_t lid)
-{
- if (_vcdinfo_lid_get_pxd(obj, pxd, lid, true))
- return true;
- return _vcdinfo_lid_get_pxd(obj, pxd, lid, false);
-}
-
-/**
- \fn vcdinfo_get_return_offset(const vcdinfo_obj_t *obj);
- \brief Get return offset for a given LID.
- \return VCDINFO_INVALID_OFFSET is returned on error or if LID has no
- "return" entry. Otherwise the LID offset is returned.
- */
-uint16_t
-vcdinfo_get_return_offset(const vcdinfo_obj_t *obj, lid_t lid)
-{
- if (NULL != obj) {
-
- PsdListDescriptor_t pxd;
-
- vcdinfo_lid_get_pxd(obj, &pxd, lid);
-
- switch (pxd.descriptor_type) {
- case PSD_TYPE_PLAY_LIST:
- return vcdinf_pld_get_return_offset(pxd.pld);
- case PSD_TYPE_SELECTION_LIST:
- case PSD_TYPE_EXT_SELECTION_LIST:
- return vcdinf_psd_get_return_offset(pxd.psd);
- break;
- case PSD_TYPE_END_LIST:
- case PSD_TYPE_COMMAND_LIST:
- break;
- }
- }
-
- return VCDINFO_INVALID_OFFSET;
-}
-
-/*!
- Return the audio type for a given segment.
- VCDINFO_INVALID_AUDIO_TYPE is returned on error.
-*/
-unsigned int
-vcdinfo_get_seg_audio_type(const vcdinfo_obj_t *obj, segnum_t seg_num)
-{
- if ( NULL == obj || NULL == &obj->info
- || seg_num >= vcdinfo_get_num_segments(obj) )
- return VCDINFO_INVALID_AUDIO_TYPE;
- return(obj->info.spi_contents[seg_num].audio_type);
-}
-
-/*!
- Return true if this segment is supposed to continue to the next one,
- (is part of an "item" or listing in the ISO 9660 filesystem).
-*/
-bool
-vcdinfo_get_seg_continue(const vcdinfo_obj_t *obj, segnum_t seg_num)
-{
- if ( NULL == obj || NULL == &obj->info
- || seg_num >= vcdinfo_get_num_segments(obj) )
- return false;
- return(obj->info.spi_contents[seg_num].item_cont);
-}
-
-/*! Return the starting LBA (logical block address) for segment
- entry_num in obj. VCDINFO_LBA_NULL is returned if there is no entry.
-
- Note first seg_num is 0.
-*/
-lba_t
-vcdinfo_get_seg_lba(const vcdinfo_obj_t *obj, segnum_t seg_num)
-{
- if (obj == NULL) return VCDINFO_NULL_LBA;
- return cdio_lsn_to_lba(vcdinfo_get_seg_lba(obj, seg_num));
-}
-
-/*! Return the starting LBA (logical block address) for segment
- entry_num in obj. VCDINFO_LSN_NULL is returned if there is no entry.
-
- Note first seg_num is 0.
-*/
-lsn_t
-vcdinfo_get_seg_lsn(const vcdinfo_obj_t *obj, segnum_t seg_num)
-{
- if (obj == NULL || seg_num >= vcdinfo_get_num_segments(obj))
- return VCDINFO_NULL_LSN;
- return obj->first_segment_lsn + (VCDINFO_SEGMENT_SECTOR_SIZE * seg_num);
-}
-
-/*! Return the starting MSF (minutes/secs/frames) for segment
- entry_num in obj. NULL is returned if there is no entry.
-
- Note first seg_num is 0!
-*/
-const msf_t *
-vcdinfo_get_seg_msf(const vcdinfo_obj_t *obj, segnum_t seg_num)
-{
- if (obj == NULL || seg_num >= vcdinfo_get_num_segments(obj))
- return NULL;
- else {
- lsn_t lsn = vcdinfo_get_seg_lsn(obj, seg_num);
- static msf_t msf;
- cdio_lsn_to_msf(lsn, &msf);
- return &msf;
- }
-}
-
-/*! Return the x-y resolution for a given segment.
- Note first i_seg is 0.
-*/
-void
-vcdinfo_get_seg_resolution(const vcdinfo_obj_t *p_vcdinfo, segnum_t i_seg,
- /*out*/ uint16_t *max_x, /*out*/ uint16_t *max_y)
-{
- vcdinfo_video_segment_type_t segtype
- = vcdinfo_get_video_type(p_vcdinfo, i_seg);
- segnum_t i_segs = vcdinfo_get_num_segments(p_vcdinfo);
-
- if (i_seg >= i_segs) return;
-
- switch (segtype) {
- case VCDINFO_FILES_VIDEO_NTSC_STILL:
- *max_x = 704;
- *max_y = 480;
- break;
- case VCDINFO_FILES_VIDEO_NTSC_STILL2:
- *max_x = 352;
- *max_y = 240;
- break;
- case VCDINFO_FILES_VIDEO_PAL_STILL:
- *max_x = 704;
- *max_y = 576;
- break;
- case VCDINFO_FILES_VIDEO_PAL_STILL2:
- *max_x = 352;
- *max_y = 288;
- break;
- default:
- /* */
- switch (vcdinfo_get_format_version(p_vcdinfo)) {
- case VCD_TYPE_VCD:
- *max_x = 352;
- *max_y = 240;
- break;
- case VCD_TYPE_VCD11:
- case VCD_TYPE_VCD2:
- *max_x = 352;
- switch(segtype) {
- case VCDINFO_FILES_VIDEO_NTSC_MOTION:
- *max_y = 240;
- break;
- case VCDINFO_FILES_VIDEO_PAL_MOTION:
- *max_y = 288;
- default:
- *max_y = 289;
- }
- break;
- default: ;
- }
- }
-}
-
-
-
-/*!
- Return the number of sectors for segment
- entry_num in obj. 0 is returned if there is no entry.
-
- Use this routine to figure out the actual number of bytes a physical
- region of a disk or CD takes up for a segment.
-
- If an item has been broken up into a number of "continued" segments,
- we will report the item size for the first segment and 0 for the
- remaining ones. We may revisit this decision later.
-*/
-uint32_t
-vcdinfo_get_seg_sector_count(const vcdinfo_obj_t *obj, segnum_t seg_num)
-{
- if (obj == NULL || seg_num >= vcdinfo_get_num_segments(obj))
- return 0;
- return obj->seg_sizes[seg_num];
-}
-
-/*!
- Return a string containing the VCD system id with trailing
- blanks removed, or NULL if there is some problem in getting this.
-*/
-const char *
-vcdinfo_get_system_id(const vcdinfo_obj_t *obj)
-{
- if ( NULL == obj || NULL == &obj->pvd ) return (NULL);
- return(iso9660_get_system_id(&obj->pvd));
-}
-
-/*!
- Return the track number for entry n in obj.
-
- In contrast to libcdio we start numbering at 0 which is the
- ISO9660 and metadata information for the Video CD. Thus track
- 1 is the first track the first complete MPEG track generally.
-*/
-track_t
-vcdinfo_get_track(const vcdinfo_obj_t *obj, const unsigned int entry_num)
-{
- const EntriesVcd_t *entries = &obj->entries;
- const unsigned int entry_count = vcdinf_get_num_entries(entries);
- /* Note entry_num is 0 origin. */
- return entry_num < entry_count ?
- vcdinf_get_track(entries, entry_num)-1: VCDINFO_INVALID_TRACK;
-}
-
-/*!
- Return the audio type for a given track.
- VCDINFO_INVALID_AUDIO_TYPE is returned on error.
-
- Note: track 1 is usually the first track.
-*/
-unsigned int
-vcdinfo_get_track_audio_type(const vcdinfo_obj_t *obj, track_t track_num)
-{
- TracksSVD *tracks;
- TracksSVD2 *tracks2;
- if ( NULL == obj || NULL == &obj->info ) return VCDINFO_INVALID_AUDIO_TYPE;
- tracks = obj->tracks_buf;
-
- if ( NULL == tracks ) return 0;
- tracks2 = (TracksSVD2 *) &(tracks->playing_time[tracks->tracks]);
- return(tracks2->contents[track_num-1].audio);
-}
-
-/*!
- Return the highest track number in the current medium.
-
- Because we track start numbering at 0 (which is the ISO 9660 track
- containing Video CD naviagion and disk information), this is one
- less than the number of tracks.
-
- If there are no tracks, we return -1.
-*/
-unsigned int
-vcdinfo_get_num_tracks(const vcdinfo_obj_t *obj)
-{
- if (obj == NULL || obj->img == NULL) return 0;
-
- return cdio_get_num_tracks(obj->img)-1;
-}
-
-
-/*!
- Return the starting LBA (logical block address) for track number
- track_num in obj.
-
- The IS0-9660 filesystem track has number 0. Tracks associated
- with playable entries numbers start at 1.
-
- The "leadout" track is specified either by
- using track_num LEADOUT_TRACK or the total tracks+1.
- VCDINFO_NULL_LBA is returned on failure.
-*/
-lba_t
-vcdinfo_get_track_lba(const vcdinfo_obj_t *obj, track_t track_num)
-{
- if (NULL == obj || NULL == obj->img)
- return VCDINFO_NULL_LBA;
-
-
- /* CdIo tracks start at 1 rather than 0. */
- return cdio_get_track_lba(obj->img, track_num+1);
-}
-
-/*!
- Return the starting LSN (logical sector number) for track number
- track_num in obj.
-
- The IS0-9660 filesystem track has number 0. Tracks associated
- with playable entries numbers start at 1.
-
- The "leadout" track is specified either by
- using track_num LEADOUT_TRACK or the total tracks+1.
- VCDINFO_NULL_LBA is returned on failure.
-*/
-lsn_t
-vcdinfo_get_track_lsn(const vcdinfo_obj_t *obj, track_t track_num)
-{
- if (NULL == obj || NULL == obj->img)
- return VCDINFO_NULL_LSN;
-
- /* CdIo tracks start at 1 rather than 0. */
- return cdio_get_track_lsn(obj->img, track_num+1);
-}
-
-/*!
- Return the starting MSF (minutes/secs/frames) for track number
- track_num in obj.
-
- The IS0-9660 filesystem track has number 0. Tracks associated
- with playable entries numbers start at 1.
-
- The "leadout" track is specified either by
- using track_num LEADOUT_TRACK or the total tracks+1.
- VCDINFO_NULL_LBA is returned on failure.
-*/
-int
-vcdinfo_get_track_msf(const vcdinfo_obj_t *obj, track_t track_num,
- uint8_t *min, uint8_t *sec, uint8_t *frame)
-{
- msf_t msf;
-
- if (NULL == obj || NULL == obj->img)
- return 1;
-
- /* CdIo tracks start at 1 rather than 0. */
- if (cdio_get_track_msf(obj->img, track_num+1, &msf)) {
- *min = cdio_from_bcd8(msf.m);
- *sec = cdio_from_bcd8(msf.s);
- *frame = cdio_from_bcd8(msf.f);
- return 0;
- }
-
- return 1;
-}
-
-/*!
- Return the size in sectors for track n.
-
- The IS0-9660 filesystem track has number 0. Tracks associated
- with playable entries numbers start at 1.
-
- FIXME: Whether we count the track pregap sectors is a bit haphazard.
- We should add a parameter to indicate whether this is wanted or not.
-
-*/
-unsigned int
-vcdinfo_get_track_sect_count(const vcdinfo_obj_t *obj, const track_t track_num)
-{
- if (NULL == obj || VCDINFO_INVALID_TRACK == track_num)
- return 0;
-
- {
- iso9660_stat_t *statbuf;
- const lsn_t lsn = vcdinfo_get_track_lsn(obj, track_num);
-
- /* Try to get the sector count from the ISO 9660 filesystem */
- if (obj->has_xa && (statbuf = iso9660_find_fs_lsn(obj->img, lsn))) {
- unsigned int secsize = statbuf->secsize;
- free(statbuf);
- return secsize;
- } else {
- const lsn_t next_lsn=vcdinfo_get_track_lsn(obj, track_num+1);
- /* Failed on ISO 9660 filesystem. Use track information. */
- return next_lsn > lsn ? next_lsn - lsn : 0;
- }
- }
- return 0;
-}
-
-/*!
- Return size in bytes for track number for entry n in obj.
-
- The IS0-9660 filesystem track has number 1. Tracks associated
- with playable entries numbers start at 2.
-
- FIXME: Whether we count the track pregap sectors is a bit haphazard.
- We should add a parameter to indicate whether this is wanted or not.
-*/
-unsigned int
-vcdinfo_get_track_size(const vcdinfo_obj_t *obj, track_t track_num)
-{
- if (NULL == obj || VCDINFO_INVALID_TRACK == track_num)
- return 0;
-
- {
- iso9660_stat_t statbuf;
- const lsn_t lsn = cdio_lba_to_lsn(vcdinfo_get_track_lba(obj, track_num));
-
- /* Try to get the sector count from the ISO 9660 filesystem */
- if (obj->has_xa && iso9660_find_fs_lsn(obj->img, lsn)) {
- return statbuf.size;
- }
-#if 0
- else {
- /* Failed on ISO 9660 filesystem. Use track information. */
- if (obj->img != NULL)
- return cdio_get_track_size(obj->img);
- }
-#endif
- }
- return 0;
-}
-
-/*!
- \brief Get the kind of video stream segment of segment seg_num in obj.
- \return VCDINFO_FILES_VIDEO_INVALID is returned if on error or obj is
- null. Otherwise the enumeration type.
-
- Note first seg_num is 0!
-*/
-vcdinfo_video_segment_type_t
-vcdinfo_get_video_type(const vcdinfo_obj_t *obj, segnum_t seg_num)
-{
- const InfoVcd_t *info;
- if (obj == NULL) return VCDINFO_FILES_VIDEO_INVALID;
- info = &obj->info;
- if (info == NULL) return VCDINFO_FILES_VIDEO_INVALID;
- return info->spi_contents[seg_num].video_type;
-}
-
-/*!
- \brief Get the kind of VCD that obj refers to.
-*/
-vcd_type_t
-vcdinfo_get_VCD_type(const vcdinfo_obj_t *obj)
-{
- if (NULL == obj) return VCD_TYPE_INVALID;
- return obj->vcd_type;
-}
-
-
-/*!
- Return the VCD volume count - the number of CD's in the collection.
- O is returned if there is some problem in getting this.
-*/
-unsigned int
-vcdinfo_get_volume_count(const vcdinfo_obj_t *obj)
-{
- if ( NULL == obj ) return 0;
- return vcdinf_get_volume_count(&obj->info);
-}
-
-/*!
- Return the VCD ID.
- NULL is returned if there is some problem in getting this.
-*/
-const char *
-vcdinfo_get_volume_id(const vcdinfo_obj_t *obj)
-{
- if ( NULL == obj || NULL == &obj->pvd ) return (NULL);
- return(iso9660_get_volume_id(&obj->pvd));
-}
-
-/*!
- Return the VCD volumeset ID.
- NULL is returned if there is some problem in getting this.
-*/
-const char *
-vcdinfo_get_volumeset_id(const vcdinfo_obj_t *obj)
-{
- if ( NULL == obj || NULL == &obj->pvd ) return (NULL);
- return(vcdinfo_strip_trail(obj->pvd.volume_set_id, ISO_MAX_VOLUMESET_ID));
-}
-
-/*!
- Return the VCD volume num - the number of the CD in the collection.
- This is a number between 1 and the volume count.
- O is returned if there is some problem in getting this.
-*/
-unsigned int
-vcdinfo_get_volume_num(const vcdinfo_obj_t *obj)
-{
- if ( NULL == obj ) return 0;
- return(uint16_from_be( obj->info.vol_id));
-}
-
-int
-vcdinfo_get_wait_time (uint16_t wtime)
-{
- /* Note: this doesn't agree exactly with _wtime */
- if (wtime < 61)
- return wtime;
- else if (wtime < 255)
- return (wtime - 60) * 10 + 60;
- else
- return -1;
-}
-
-/*!
- Return true is there is playback control.
-*/
-bool
-vcdinfo_has_pbc (const vcdinfo_obj_t *obj)
-{
- return (obj && obj->info.psd_size!=0);
-}
-
-/*!
- Return true if VCD has "extended attributes" (XA). Extended attributes
- add meta-data attributes to a entries of file describing the file.
- See also cdio_get_xa_attr_str() which returns a string similar to
- a string you might get on a Unix filesystem listing ("ls").
-*/
-bool
-vcdinfo_has_xa(const vcdinfo_obj_t *obj)
-{
- return obj->has_xa;
-}
-
-/*!
- Add one to the MSF.
-*/
-void
-vcdinfo_inc_msf (uint8_t *min, uint8_t *sec, int8_t *frame)
-{
- (*frame)++;
- if (*frame>=CDIO_CD_FRAMES_PER_SEC) {
- *frame = 0;
- (*sec)++;
- if (*sec>=CDIO_CD_SECS_PER_MIN) {
- *sec = 0;
- (*min)++;
- }
- }
-}
-
-/*!
- Convert minutes, seconds and frame (MSF components) into a
- logical block address (or LBA).
- See also cdio_msf_to_lba which uses msf_t as its single parameter.
-*/
-lba_t
-vcdinfo_msf2lba (uint8_t min, uint8_t sec, int8_t frame)
-{
- return CDIO_CD_FRAMES_PER_SEC*(CDIO_CD_SECS_PER_MIN*min + sec) + frame;
-}
-
-/*!
- Convert minutes, seconds and frame (MSF components) into a
- logical block address (or LBA).
- See also cdio_msf_to_lba which uses msf_t as its single parameter.
-*/
-void
-vcdinfo_lba2msf (lba_t lba, uint8_t *min, uint8_t *sec, uint8_t *frame)
-{
- *min = lba / (60*75);
- lba %= (60*75);
- *sec = lba / 75;
- *frame = lba % 75;
-}
-
-/*!
- Convert minutes, seconds and frame (MSF components) into a
- logical sector number (or LSN).
-*/
-lsn_t
-vcdinfo_msf2lsn (uint8_t min, uint8_t sec, int8_t frame)
-{
- lba_t lba=75*(60*min + sec) + frame;
- if (lba < CDIO_PREGAP_SECTORS) {
- vcd_error ("lba (%u) less than pregap sector (%u)",
- (unsigned int) lba, CDIO_PREGAP_SECTORS);
- return lba;
- }
- return lba - CDIO_PREGAP_SECTORS;
-}
-
-const char *
-vcdinfo_ofs2str (const vcdinfo_obj_t *obj, unsigned int offset, bool ext)
-{
- vcdinfo_offset_t *ofs;
- char *buf;
-
- switch (offset) {
- case PSD_OFS_DISABLED:
- return "disabled";
- case PSD_OFS_MULTI_DEF:
- return "multi-default";
- case PSD_OFS_MULTI_DEF_NO_NUM:
- return "multi_def_no_num";
- default: ;
- }
-
- buf = _getbuf ();
- ofs = _vcdinfo_get_offset_t(obj, offset, ext);
- if (ofs != NULL) {
- if (ofs->lid)
- snprintf (buf, BUF_SIZE, "LID[%d] @0x%4.4x",
- ofs->lid, ofs->offset);
- else
- snprintf (buf, BUF_SIZE, "PSD[?] @0x%4.4x",
- ofs->offset);
- } else {
- snprintf (buf, BUF_SIZE, "? @0x%4.4x", offset);
- }
- return buf;
-}
-
-bool
-vcdinfo_read_psd (vcdinfo_obj_t *obj)
-{
- unsigned psd_size = vcdinfo_get_psd_size (obj);
-
- if (psd_size)
- {
- if (psd_size > 256*1024)
- {
- vcd_error ("weird psd size (%u) -- aborting", psd_size);
- return false;
- }
-
- obj->lot = _vcd_malloc (ISO_BLOCKSIZE * LOT_VCD_SIZE);
- obj->psd = _vcd_malloc (ISO_BLOCKSIZE * _vcd_len2blocks (psd_size,
- ISO_BLOCKSIZE));
-
- if (cdio_read_mode2_sectors (obj->img, (void *) obj->lot, LOT_VCD_SECTOR,
- false, LOT_VCD_SIZE))
- return false;
-
- if (cdio_read_mode2_sectors (obj->img, (void *) obj->psd, PSD_VCD_SECTOR,
- false, _vcd_len2blocks (psd_size,
- ISO_BLOCKSIZE)))
- return false;
-
- } else {
- return false;
- }
- return true;
-}
-
-/*! Return the entry number for the given track. */
-unsigned int
-vcdinfo_track_get_entry(const vcdinfo_obj_t *obj, track_t i_track)
-{
- /* FIXME: Add structure to directly map track to first entry number.
- Until then...
- */
- lsn_t lsn= vcdinfo_get_track_lsn(obj, i_track);
- return vcdinfo_lsn_get_entry(obj, lsn);
-}
-
-/*!
- Calls recursive routine to populate obj->offset_list or obj->offset_x_list
- by going through LOT.
-
- Returns false if there was some error.
-*/
-bool
-vcdinfo_visit_lot (vcdinfo_obj_t *obj, bool extended)
-{
- struct _vcdinf_pbc_ctx pbc_ctx;
- bool ret;
-
- pbc_ctx.psd_size = vcdinfo_get_psd_size (obj);
- pbc_ctx.psd_x_size = obj->psd_x_size;
- pbc_ctx.offset_mult = 8;
- pbc_ctx.maximum_lid = vcdinfo_get_num_LIDs(obj);
- pbc_ctx.offset_x_list = NULL;
- pbc_ctx.offset_list = NULL;
- pbc_ctx.psd = obj->psd;
- pbc_ctx.psd_x = obj->psd_x;
- pbc_ctx.lot = obj->lot;
- pbc_ctx.lot_x = obj->lot_x;
- pbc_ctx.extended = extended;
-
- ret = vcdinf_visit_lot(&pbc_ctx);
- if (NULL != obj->offset_x_list)
- _cdio_list_free(obj->offset_x_list, true);
- obj->offset_x_list = pbc_ctx.offset_x_list;
- if (NULL != obj->offset_list)
- _cdio_list_free(obj->offset_list, true);
- obj->offset_list = pbc_ctx.offset_list;
- return ret;
-}
-
-/*!
- Change trailing blanks in str to nulls. Str has a maximum size of
- n characters.
-*/
-const char *
-vcdinfo_strip_trail (const char str[], size_t n)
-{
- static char buf[1025];
- int j;
-
- vcd_assert (n < 1024);
-
- strncpy (buf, str, n);
- buf[n] = '\0';
-
- for (j = strlen (buf) - 1; j >= 0; j--)
- {
- if (buf[j] != ' ')
- break;
-
- buf[j] = '\0';
- }
-
- return buf;
-}
-
-/*!
- Return true if offset is "rejected". That is shouldn't be displayed
- in a list of entries.
-*/
-bool
-vcdinfo_is_rejected(uint16_t offset)
-{
- return (offset & VCDINFO_REJECTED_MASK) != 0;
-}
-
-/*!
- Nulls/zeros vcdinfo_obj_t structures; The caller should have
- ensured that obj != NULL.
- routines using obj are called.
-*/
-static void
-_vcdinfo_zero(vcdinfo_obj_t *obj)
-{
- memset(obj, 0, sizeof(vcdinfo_obj_t));
- obj->vcd_type = VCD_TYPE_INVALID;
- obj->img = NULL;
- obj->lot = NULL;
- obj->source_name = NULL;
- obj->seg_sizes = NULL;
-}
-
-/*!
- Initialize the vcdinfo structure "obj". Should be done before other
- routines using obj are called.
-*/
-bool
-vcdinfo_init(vcdinfo_obj_t *obj)
-{
- if (NULL == obj) return false;
- _vcdinfo_zero(obj);
- return cdio_init();
-}
-
-/*!
- Set up vcdinfo structure "obj" for reading from a particular
- medium. This should be done before after initialization but before
- any routines that need to retrieve data.
-
- source_name is the device or file to use for inspection, and
- source_type indicates what driver to use or class of drivers in the
- case of DRIVER_DEVICE.
- access_mode gives the CD access method for reading should the driver
- allow for more than one kind of access method (e.g. MMC versus ioctl
- on GNU/Linux)
-
- If source_name is NULL we'll fill in the appropriate default device
- name for the given source_type. However if in addtion source_type is
- DRIVER_UNKNOWN, then we'll scan for a drive containing a VCD.
-
- VCDINFO_OPEN_VCD is returned if everything went okay;
- VCDINFO_OPEN_ERROR if there was an error and VCDINFO_OPEN_OTHER if the
- medium is something other than a VCD.
- */
-vcdinfo_open_return_t
-vcdinfo_open(vcdinfo_obj_t **obj_p, char *source_name[],
- driver_id_t source_type, const char access_mode[])
-{
- CdIo *img;
- vcdinfo_obj_t *obj = _vcd_malloc(sizeof(vcdinfo_obj_t));
- iso9660_stat_t *statbuf;
-
-
- /* If we don't specify a driver_id or a source_name, scan the
- system for a CD that contains a VCD.
- */
- if (NULL == *source_name && source_type == DRIVER_UNKNOWN) {
- char **cd_drives=NULL;
- cd_drives = cdio_get_devices_with_cap_ret(NULL,
- (CDIO_FS_ANAL_SVCD|CDIO_FS_ANAL_CVD|CDIO_FS_ANAL_VIDEOCD
- |CDIO_FS_UNKNOWN),
- true, &source_type);
- if ( NULL == cd_drives || NULL == cd_drives[0] ) {
- return VCDINFO_OPEN_ERROR;
- }
- *source_name = strdup(cd_drives[0]);
- cdio_free_device_list(cd_drives);
- }
-
- img = cdio_open(*source_name, source_type);
- if (NULL == img) {
- return VCDINFO_OPEN_ERROR;
- }
-
- *obj_p = obj;
-
- if (access_mode != NULL)
- cdio_set_arg (img, "access-mode", access_mode);
-
- if (NULL == *source_name) {
- *source_name = cdio_get_default_device(img);
- if (NULL == *source_name) return VCDINFO_OPEN_ERROR;
- }
-
- memset (obj, 0, sizeof (vcdinfo_obj_t));
- obj->img = img; /* Note we do this after the above wipeout! */
-
- if (!iso9660_fs_read_pvd(obj->img, &(obj->pvd))) {
- return VCDINFO_OPEN_ERROR;
- }
-
- /* Determine if VCD has XA attributes. */
- {
-
- iso9660_pvd_t const *pvd = &obj->pvd;
-
- obj->has_xa = !strncmp ((char *) pvd + ISO_XA_MARKER_OFFSET,
- ISO_XA_MARKER_STRING,
- strlen (ISO_XA_MARKER_STRING));
- }
-
- if (!read_info(obj->img, &(obj->info), &(obj->vcd_type)) ||
- vcdinfo_get_format_version (obj) == VCD_TYPE_INVALID ||
- !read_entries(obj->img, &(obj->entries))) {
- free (obj); /* match 0.7.23's behaviour */
- return VCDINFO_OPEN_OTHER;
- }
-
- {
- size_t len = strlen(*source_name)+1;
- obj->source_name = (char *) malloc(len * sizeof(char));
- strncpy(obj->source_name, *source_name, len);
- }
-
- if (obj->vcd_type == VCD_TYPE_SVCD || obj->vcd_type == VCD_TYPE_HQVCD) {
- statbuf = iso9660_fs_stat (obj->img, "MPEGAV");
-
- if (NULL != statbuf) {
- vcd_warn ("non compliant /MPEGAV folder detected!");
- free(statbuf);
- }
-
-
- statbuf = iso9660_fs_stat (obj->img, "SVCD/TRACKS.SVD;1");
- if (NULL != statbuf) {
- lsn_t lsn = statbuf->lsn;
- if (statbuf->size != ISO_BLOCKSIZE)
- vcd_warn ("TRACKS.SVD filesize != %d!", ISO_BLOCKSIZE);
-
- obj->tracks_buf = _vcd_malloc (ISO_BLOCKSIZE);
-
- free(statbuf);
- if (cdio_read_mode2_sector (obj->img, obj->tracks_buf, lsn, false))
- return VCDINFO_OPEN_ERROR;
- }
- }
-
- _init_segments (obj);
-
- switch (obj->vcd_type) {
- case VCD_TYPE_VCD2: {
- /* FIXME: Can reduce CD reads by using
- iso9660_fs_readdir(img, "EXT", true) and then scanning for
- the files listed below.
- */
- statbuf = iso9660_fs_stat (img, "EXT/PSD_X.VCD;1");
- if (NULL != statbuf) {
- lsn_t lsn = statbuf->lsn;
- uint32_t secsize = statbuf->secsize;
-
- obj->psd_x = _vcd_malloc (ISO_BLOCKSIZE * secsize);
- obj->psd_x_size = statbuf->size;
-
- vcd_debug ("found /EXT/PSD_X.VCD at sector %lu",
- (long unsigned int) lsn);
-
- free(statbuf);
- if (cdio_read_mode2_sectors (img, obj->psd_x, lsn, false, secsize))
- return VCDINFO_OPEN_ERROR;
- }
-
- statbuf = iso9660_fs_stat (img, "EXT/LOT_X.VCD;1");
- if (NULL != statbuf) {
- lsn_t lsn = statbuf->lsn;
- uint32_t secsize = statbuf->secsize;
- obj->lot_x = _vcd_malloc (ISO_BLOCKSIZE * secsize);
-
- vcd_debug ("found /EXT/LOT_X.VCD at sector %lu",
- (unsigned long int) lsn);
-
- if (statbuf->size != LOT_VCD_SIZE * ISO_BLOCKSIZE)
- vcd_warn ("LOT_X.VCD size != 65535");
-
- free(statbuf);
- if (cdio_read_mode2_sectors (img, obj->lot_x, lsn, false, secsize))
- return VCDINFO_OPEN_ERROR;
-
- }
- break;
- }
- case VCD_TYPE_SVCD:
- case VCD_TYPE_HQVCD: {
- /* FIXME: Can reduce CD reads by using
- iso9660_fs_readdir(img, "SVCD", true) and then scanning for
- the files listed below.
- */
- statbuf = iso9660_fs_stat (img, "MPEGAV");
- if (NULL != statbuf) {
- vcd_warn ("non compliant /MPEGAV folder detected!");
- free(statbuf);
- }
-
- statbuf = iso9660_fs_stat (img, "SVCD/TRACKS.SVD;1");
- if (NULL == statbuf)
- vcd_warn ("mandatory /SVCD/TRACKS.SVD not found!");
- else {
- vcd_debug ("found TRACKS.SVD signature at sector %lu",
- (unsigned long int) statbuf->lsn);
- free(statbuf);
- }
-
- statbuf = iso9660_fs_stat (img, "SVCD/SEARCH.DAT;1");
- if (NULL == statbuf)
- vcd_warn ("mandatory /SVCD/SEARCH.DAT not found!");
- else {
- lsn_t lsn = statbuf->lsn;
- uint32_t secsize = statbuf->secsize;
- uint32_t stat_size = statbuf->size;
- uint32_t size;
-
- vcd_debug ("found SEARCH.DAT at sector %lu", (unsigned long int) lsn);
-
- obj->search_buf = _vcd_malloc (ISO_BLOCKSIZE * secsize);
-
- if (cdio_read_mode2_sectors (img, obj->search_buf, lsn, false, secsize))
- return VCDINFO_OPEN_ERROR;
-
- size = (3 * uint16_from_be (((SearchDat *)obj->search_buf)->scan_points))
- + sizeof (SearchDat);
-
- free(statbuf);
- if (size > stat_size) {
- vcd_warn ("number of scanpoints leads to bigger size than "
- "file size of SEARCH.DAT! -- rereading");
-
- free (obj->search_buf);
- obj->search_buf = _vcd_malloc (ISO_BLOCKSIZE
- * _vcd_len2blocks(size, ISO_BLOCKSIZE));
-
- if (cdio_read_mode2_sectors (img, obj->search_buf, lsn, false,
- secsize))
- return VCDINFO_OPEN_ERROR;
- }
- }
- break;
- }
- default:
- ;
- }
-
- statbuf = iso9660_fs_stat (img, "EXT/SCANDATA.DAT;1");
- if (statbuf != NULL) {
- lsn_t lsn = statbuf->lsn;
- uint32_t secsize = statbuf->secsize;
-
- vcd_debug ("found /EXT/SCANDATA.DAT at sector %u", (unsigned int) lsn);
-
- obj->scandata_buf = _vcd_malloc (ISO_BLOCKSIZE * secsize);
-
- free(statbuf);
- if (cdio_read_mode2_sectors (img, obj->scandata_buf, lsn, false, secsize))
- return VCDINFO_OPEN_ERROR;
- }
-
- return VCDINFO_OPEN_VCD;
-
-}
-
-/*!
- Dispose of any resources associated with vcdinfo structure "obj".
- Call this when "obj" it isn't needed anymore.
-
- True is returned is everything went okay, and false if not.
-*/
-bool
-vcdinfo_close(vcdinfo_obj_t *obj)
-{
- if (obj != NULL) {
- if (obj->offset_list != NULL)
- _cdio_list_free(obj->offset_list, true);
- if (obj->offset_x_list != NULL)
- _cdio_list_free(obj->offset_x_list, true);
- free(obj->seg_sizes);
- free(obj->lot);
- free(obj->lot_x);
- if (obj->psd_x) free(obj->psd_x);
- if (obj->psd) free(obj->psd);
- if (obj->scandata_buf) free(obj->scandata_buf);
- free(obj->tracks_buf);
- free(obj->search_buf);
- free(obj->source_name);
-
- if (obj->img != NULL) cdio_destroy (obj->img);
- _vcdinfo_zero(obj);
- }
-
- free(obj);
- return(true);
-}
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libvcd/info_private.c b/src/input/vcd/libvcd/info_private.c
deleted file mode 100644
index 9f89a3dcb..000000000
--- a/src/input/vcd/libvcd/info_private.c
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
- $Id: info_private.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $
-
- Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Foundation
- Software, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-/*
- Like vcdinfo but exposes more of the internal structure. It is probably
- better to use vcdinfo, when possible.
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stddef.h>
-#include <errno.h>
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#include <cdio/cdio.h>
-#include <cdio/bytesex.h>
-#include <cdio/util.h>
-
-#include <libvcd/types.h>
-#include <libvcd/files.h>
-
-#include <libvcd/info.h>
-
-/* Private headers */
-#include "vcd_assert.h"
-#include "data_structures.h"
-#include "info_private.h"
-#include "pbc.h"
-
-static const char _rcsid[] = "$Id: info_private.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $";
-
-/*
- This fills in unassigned LIDs in the offset table. Due to
- "rejected" LOT entries, some of these might not have gotten filled
- in while scanning PBC (if in fact there even was a PBC).
-
- Note: We assume that an unassigned LID is one whose value is 0.
- */
-static void
-vcdinf_update_offset_list(struct _vcdinf_pbc_ctx *obj, bool extended)
-{
- if (NULL==obj) return;
- {
- CdioListNode *node;
- CdioList *unused_lids = _cdio_list_new();
- CdioListNode *next_unused_node = _cdio_list_begin(unused_lids);
-
- unsigned int last_lid=0;
- CdioList *offset_list = extended ? obj->offset_x_list : obj->offset_list;
-
- lid_t max_seen_lid=0;
-
- _CDIO_LIST_FOREACH (node, offset_list)
- {
- vcdinfo_offset_t *ofs = _cdio_list_node_data (node);
- if (!ofs->lid) {
- /* We have a customer! Assign a LID from the free pool
- or take one from the end if no skipped LIDs.
- */
- CdioListNode *node=_cdio_list_node_next(next_unused_node);
- if (node != NULL) {
- lid_t *next_unused_lid=_cdio_list_node_data(node);
- ofs->lid = *next_unused_lid;
- next_unused_node=node;
- } else {
- max_seen_lid++;
- ofs->lid = max_seen_lid;
- }
- } else {
- /* See if we've skipped any LID numbers. */
- last_lid++;
- while (last_lid != ofs->lid ) {
- lid_t * lid=_vcd_malloc (sizeof(lid_t));
- *lid = last_lid;
- _cdio_list_append(unused_lids, lid);
- }
- if (last_lid > max_seen_lid) max_seen_lid=last_lid;
- }
- }
- _cdio_list_free(unused_lids, true);
- }
-}
-
-/*!
- Calls recursive routine to populate obj->offset_list or obj->offset_x_list
- by going through LOT.
-
- Returns false if there was some error.
-*/
-bool
-vcdinf_visit_lot (struct _vcdinf_pbc_ctx *obj)
-{
- const LotVcd_t *lot = obj->extended ? obj->lot_x : obj->lot;
- unsigned int n, tmp;
- bool ret=true;
-
- if (obj->extended) {
- if (!obj->psd_x_size) return false;
- } else if (!obj->psd_size) return false;
-
- for (n = 0; n < LOT_VCD_OFFSETS; n++)
- if ((tmp = vcdinf_get_lot_offset(lot, n)) != PSD_OFS_DISABLED)
- ret &= vcdinf_visit_pbc (obj, n + 1, tmp, true);
-
- _vcd_list_sort (obj->extended ? obj->offset_x_list : obj->offset_list,
- (_cdio_list_cmp_func) vcdinf_lid_t_cmp);
-
- /* Now really complete the offset table with LIDs. This routine
- might obviate the need for vcdinf_visit_pbc() or some of it which is
- more complex. */
- vcdinf_update_offset_list(obj, obj->extended);
- return ret;
-}
-
-/*!
- Recursive routine to populate obj->offset_list or obj->offset_x_list
- by reading playback control entries referred to via lid.
-
- Returns false if there was some error.
-*/
-bool
-vcdinf_visit_pbc (struct _vcdinf_pbc_ctx *obj, lid_t lid, unsigned int offset,
- bool in_lot)
-{
- CdioListNode *node;
- vcdinfo_offset_t *ofs;
- unsigned int psd_size = obj->extended ? obj->psd_x_size : obj->psd_size;
- const uint8_t *psd = obj->extended ? obj->psd_x : obj->psd;
- unsigned int _rofs = offset * obj->offset_mult;
- CdioList *offset_list;
- bool ret=true;
-
- vcd_assert (psd_size % 8 == 0);
-
- switch (offset)
- {
- case PSD_OFS_DISABLED:
- case PSD_OFS_MULTI_DEF:
- case PSD_OFS_MULTI_DEF_NO_NUM:
- return true;
-
- default:
- break;
- }
-
- if (_rofs >= psd_size)
- {
- if (obj->extended)
- vcd_warn ("psd offset out of range in extended PSD (%d >= %d)",
- _rofs, psd_size);
- else
- vcd_warn ("psd offset out of range (%d >= %d)", _rofs, psd_size);
- return false;
- }
-
- if (!obj->offset_list)
- obj->offset_list = _cdio_list_new ();
-
- if (!obj->offset_x_list)
- obj->offset_x_list = _cdio_list_new ();
-
- if (obj->extended) {
- offset_list = obj->offset_x_list;
- } else
- offset_list = obj->offset_list;
-
- _CDIO_LIST_FOREACH (node, offset_list)
- {
- ofs = _cdio_list_node_data (node);
-
- if (offset == ofs->offset)
- {
- if (in_lot)
- ofs->in_lot = true;
-
- if (lid) {
- /* Our caller thinks she knows what our LID is.
- This should help out getting the LID for end descriptors
- if not other things as well.
- */
- ofs->lid = lid;
- }
-
- ofs->ext = obj->extended;
-
- return true; /* already been there... */
- }
- }
-
- ofs = _vcd_malloc (sizeof (vcdinfo_offset_t));
-
- ofs->ext = obj->extended;
- ofs->in_lot = in_lot;
- ofs->lid = lid;
- ofs->offset = offset;
- ofs->type = psd[_rofs];
-
- switch (ofs->type)
- {
- case PSD_TYPE_PLAY_LIST:
- _cdio_list_append (offset_list, ofs);
- {
- const PsdPlayListDescriptor_t *d = (const void *) (psd + _rofs);
- const lid_t lid = vcdinf_pld_get_lid(d);
-
- if (!ofs->lid)
- ofs->lid = lid;
- else
- if (ofs->lid != lid)
- vcd_warn ("LOT entry assigned LID %d, but descriptor has LID %d",
- ofs->lid, lid);
-
- ret &= vcdinf_visit_pbc (obj, 0, vcdinf_pld_get_prev_offset(d), false);
- ret &= vcdinf_visit_pbc (obj, 0, vcdinf_pld_get_next_offset(d), false);
- ret &= vcdinf_visit_pbc (obj, 0, vcdinf_pld_get_return_offset(d),
- false);
- }
- break;
-
- case PSD_TYPE_EXT_SELECTION_LIST:
- case PSD_TYPE_SELECTION_LIST:
- _cdio_list_append (offset_list, ofs);
- {
- const PsdSelectionListDescriptor_t *d =
- (const void *) (psd + _rofs);
-
- int idx;
-
- if (!ofs->lid)
- ofs->lid = uint16_from_be (d->lid) & 0x7fff;
- else
- if (ofs->lid != (uint16_from_be (d->lid) & 0x7fff))
- vcd_warn ("LOT entry assigned LID %d, but descriptor has LID %d",
- ofs->lid, uint16_from_be (d->lid) & 0x7fff);
-
- ret &= vcdinf_visit_pbc (obj, 0, vcdinf_psd_get_prev_offset(d), false);
- ret &= vcdinf_visit_pbc (obj, 0, vcdinf_psd_get_next_offset(d), false);
- ret &= vcdinf_visit_pbc (obj, 0, vcdinf_psd_get_return_offset(d),
- false);
- ret &= vcdinf_visit_pbc (obj, 0, vcdinf_psd_get_default_offset(d),
- false);
- ret &= vcdinf_visit_pbc (obj, 0, uint16_from_be (d->timeout_ofs),
- false);
-
- for (idx = 0; idx < vcdinf_get_num_selections(d); idx++)
- ret &= vcdinf_visit_pbc (obj, 0, vcdinf_psd_get_offset(d, idx),
- false);
- }
- break;
-
- case PSD_TYPE_END_LIST:
- _cdio_list_append (offset_list, ofs);
- break;
-
- default:
- vcd_warn ("corrupt PSD???????");
- free (ofs);
- return false;
- break;
- }
- return ret;
-}
-
-/*! Return the starting LBA (logical block address) for sequence
- entry_num in obj. VCDINFO_NULL_LBA is returned if there is no entry.
-*/
-lba_t
-vcdinf_get_entry_lba(const EntriesVcd_t *entries, unsigned int entry_num)
-{
- const msf_t *msf = vcdinf_get_entry_msf(entries, entry_num);
- return (msf != NULL) ? cdio_msf_to_lba(msf) : VCDINFO_NULL_LBA;
-}
-
-/*! Return the starting MSF (minutes/secs/frames) for sequence
- entry_num in obj. NULL is returned if there is no entry.
- The first entry number is 0.
-*/
-const msf_t *
-vcdinf_get_entry_msf(const EntriesVcd_t *entries, unsigned int entry_num)
-{
- const unsigned int entry_count = uint16_from_be (entries->entry_count);
- return entry_num < entry_count ?
- &(entries->entry[entry_num].msf)
- : NULL;
-}
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libvcd/info_private.h b/src/input/vcd/libvcd/info_private.h
deleted file mode 100644
index d17b6680b..000000000
--- a/src/input/vcd/libvcd/info_private.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*!
- \file vcdinf.h
-
- Copyright (C) 2002,2003 Rocky Bernstein <rocky@panix.com>
-
- \verbatim
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Foundation
- Software, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Like vcdinfo but exposes more of the internal structure. It is probably
- better to use vcdinfo, when possible.
- \endverbatim
-*/
-
-#ifndef _VCD_INFO_PRIVATE_H
-#define _VCD_INFO_PRIVATE_H
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <cdio/cdio.h>
-#include <cdio/ds.h>
-#include <cdio/iso9660.h>
-#include <libvcd/types.h>
-#include <libvcd/files_private.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
- struct _VcdInfo {
- vcd_type_t vcd_type;
-
- CdIo *img;
-
- iso9660_pvd_t pvd;
-
- InfoVcd_t info;
- EntriesVcd_t entries;
-
- CdioList *offset_list;
- CdioList *offset_x_list;
- uint32_t *seg_sizes;
- lsn_t first_segment_lsn;
-
- LotVcd_t *lot;
- LotVcd_t *lot_x;
- uint8_t *psd;
- uint8_t *psd_x;
- unsigned int psd_x_size;
- bool extended;
-
- bool has_xa; /* True if has extended attributes (XA) */
-
- void *tracks_buf;
- void *search_buf;
- void *scandata_buf;
-
- char *source_name; /* VCD device or file currently open */
-
- };
-
- /*! Return the starting MSF (minutes/secs/frames) for sequence
- entry_num in obj. NULL is returned if there is no entry.
- The first entry number is 0.
- */
- const msf_t * vcdinf_get_entry_msf(const EntriesVcd_t *entries,
- unsigned int entry_num);
-
- struct _vcdinf_pbc_ctx {
- unsigned int psd_size;
- lid_t maximum_lid;
- unsigned offset_mult;
- CdioList *offset_x_list;
- CdioList *offset_list;
-
- LotVcd_t *lot;
- LotVcd_t *lot_x;
- uint8_t *psd;
- uint8_t *psd_x;
- unsigned int psd_x_size;
- bool extended;
- };
-
- /*!
- Calls recursive routine to populate obj->offset_list or obj->offset_x_list
- by going through LOT.
-
- Returns false if there was some error.
- */
- bool vcdinf_visit_lot (struct _vcdinf_pbc_ctx *obj);
-
- /*!
- Recursive routine to populate obj->offset_list or obj->offset_x_list
- by reading playback control entries referred to via lid.
-
- Returns false if there was some error.
- */
- bool vcdinf_visit_pbc (struct _vcdinf_pbc_ctx *obj, lid_t lid,
- unsigned int offset, bool in_lot);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /*_VCD_INFO_PRIVATE_H*/
diff --git a/src/input/vcd/libvcd/libvcd/Makefile.am b/src/input/vcd/libvcd/libvcd/Makefile.am
deleted file mode 100644
index ea29859f6..000000000
--- a/src/input/vcd/libvcd/libvcd/Makefile.am
+++ /dev/null
@@ -1,3 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-noinst_HEADERS = files.h inf.h logging.h types.h files_private.h info.h sector.h version.h
diff --git a/src/input/vcd/libvcd/libvcd/files.h b/src/input/vcd/libvcd/libvcd/files.h
deleted file mode 100644
index 91eeafad8..000000000
--- a/src/input/vcd/libvcd/libvcd/files.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- $Id: files.h,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifndef VCDFILES_H
-#define VCDFILES_H
-
-#include <libvcd/types.h>
-
-#define INFO_VCD_SECTOR 150
-#define ENTRIES_VCD_SECTOR 151
-#define LOT_VCD_SECTOR 152
-#define LOT_VCD_SIZE 32
-#define PSD_VCD_SECTOR (LOT_VCD_SECTOR+LOT_VCD_SIZE)
-
-#define MAX_SEGMENTS 1980
-#define MAX_ENTRIES 500
-#define MAX_SEQ_ENTRIES 99
-
-/* these are used for SVCDs only */
-#define TRACKS_SVD_SECTOR (PSD_VCD_SECTOR+1)
-#define SEARCH_DAT_SECTOR (TRACKS_SVD_SECTOR+1)
-
-/* Maximum index of optional LOT.VCD (the List ID Offset Table.) */
-#define LOT_VCD_OFFSETS ((1 << 15)-1)
-
-typedef enum {
- PSD_TYPE_PLAY_LIST = 0x10, /* Play List */
- PSD_TYPE_SELECTION_LIST = 0x18, /* Selection List (+Ext. for SVCD) */
- PSD_TYPE_EXT_SELECTION_LIST = 0x1a, /* Extended Selection List (VCD2.0) */
- PSD_TYPE_END_LIST = 0x1f, /* End List */
- PSD_TYPE_COMMAND_LIST = 0x20 /* Command List */
-} psd_descriptor_types;
-
-#define ENTRIES_ID_VCD "ENTRYVCD"
-#define ENTRIES_ID_VCD3 "ENTRYSVD"
-#define ENTRIES_ID_SVCD "ENTRYVCD" /* not ENTRYSVD! */
-
-#define SCANDATA_VERSION_VCD2 0x02
-#define SCANDATA_VERSION_SVCD 0x01
-
-void
-set_entries_vcd(VcdObj *obj, void *buf);
-
-void
-set_info_vcd (VcdObj *obj, void *buf);
-
-uint32_t
-get_psd_size (VcdObj *obj, bool extended);
-
-void
-set_lot_vcd (VcdObj *obj, void *buf, bool extended);
-
-void
-set_psd_vcd (VcdObj *obj, void *buf, bool extended);
-
-void
-set_tracks_svd (VcdObj *obj, void *buf);
-
-uint32_t
-get_search_dat_size (const VcdObj *obj);
-
-void
-set_search_dat (VcdObj *obj, void *buf);
-
-uint32_t
-get_scandata_dat_size (const VcdObj *obj);
-
-void
-set_scandata_dat (VcdObj *obj, void *buf);
-
-
-vcd_type_t
-vcd_files_info_detect_type (const void *info_buf);
-
-#endif /* VCDFILES_H */
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libvcd/libvcd/files_private.h b/src/input/vcd/libvcd/libvcd/files_private.h
deleted file mode 100644
index aabb6ab0c..000000000
--- a/src/input/vcd/libvcd/libvcd/files_private.h
+++ /dev/null
@@ -1,562 +0,0 @@
-/*
- $Id: files_private.h,v 1.3 2006/09/26 21:16:59 dgp85 Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
- (C) 2000 Jens B. Jorgensen <jbj1@ultraemail.net>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
-
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifndef __VCD_FILES_PRIVATE_H__
-#define __VCD_FILES_PRIVATE_H__
-
-#include <libvcd/files.h>
-#include <libvcd/types.h>
-
-/* random note: most stuff is big endian here */
-
-#define ENTRIES_ID_VCD "ENTRYVCD"
-#define ENTRIES_ID_VCD3 "ENTRYSVD"
-#define ENTRIES_ID_SVCD "ENTRYVCD" /* not ENTRYSVD! */
-
-#define ENTRIES_VERSION_VCD 0x01
-#define ENTRIES_SPTAG_VCD 0x00
-
-#define ENTRIES_VERSION_VCD11 0x01
-#define ENTRIES_SPTAG_VCD11 0x00
-
-#define ENTRIES_VERSION_VCD2 0x02
-#define ENTRIES_SPTAG_VCD2 0x00
-
-#define ENTRIES_VERSION_SVCD 0x01
-#define ENTRIES_SPTAG_SVCD 0x00
-
-#define ENTRIES_VERSION_HQVCD 0x01
-#define ENTRIES_SPTAG_HQVCD 0x00
-
-PRAGMA_BEGIN_PACKED
-
-typedef struct _EntriesVcd_tag {
- char ID[8]; /* "ENTRYVCD" */
- uint8_t version; /* 0x02 --- VCD2.0
- 0x01 --- SVCD, should be
- same as version in
- INFO.SVD */
- uint8_t sys_prof_tag; /* 0x01 if VCD1.1
- 0x00 else */
- uint16_t entry_count; /* 1 <= tracks <= 500 */
- struct { /* all fields are BCD */
- uint8_t n; /* cd track no 2 <= n <= 99 */
- msf_t msf;
- } GNUC_PACKED entry[MAX_ENTRIES];
- uint8_t reserved2[36]; /* RESERVED, must be 0x00 */
-} GNUC_PACKED _EntriesVcd; /* sector 00:04:01 */
-
-#define EntriesVcd_SIZEOF ISO_BLOCKSIZE
-
-
-#define INFO_ID_VCD "VIDEO_CD"
-#define INFO_ID_SVCD "SUPERVCD"
-#define INFO_ID_HQVCD "HQ-VCD "
-
-#define INFO_VERSION_VCD 0x01
-#define INFO_SPTAG_VCD 0x00
-
-#define INFO_VERSION_VCD11 0x01
-#define INFO_SPTAG_VCD11 0x01
-
-#define INFO_VERSION_VCD2 0x02
-#define INFO_SPTAG_VCD2 0x00
-
-#define INFO_VERSION_SVCD 0x01
-#define INFO_SPTAG_SVCD 0x00
-
-#define INFO_VERSION_HQVCD 0x01
-#define INFO_SPTAG_HQVCD 0x01
-
-#define INFO_OFFSET_MULT 0x08
-
-/* This one-byte field describes certain characteristics of the disc */
-typedef struct {
-#if defined(BITFIELD_LSBF)
- bool reserved1 : 1; /* Reserved, must be zero */
- bitfield_t restriction : 2; /* restriction, eg. "unsuitable
- for kids":
- 0x0 ==> unrestricted,
- 0x1 ==> restricted category 1,
- 0x2 ==> restricted category 2,
- 0x3 ==> restricted category 3 */
- bool special_info : 1; /* Special Information is encoded
- in the pictures */
- bool user_data_cc : 1; /* MPEG User Data is used
- for Closed Caption */
- bool use_lid2 : 1; /* If == 1 and the PSD is
- interpreted and the next
- disc has the same album
- id then start the next
- disc at List ID #2,
- otherwise List ID #1 */
- bool use_track3 : 1; /* If == 1 and the PSD is
- not interpreted and
- next disc has same album
- id, then start next disc
- with track 3, otherwise
- start with track 2 */
- bool pbc_x : 1; /* extended PBC available */
-#else
- bool pbc_x : 1;
- bool use_track3 : 1;
- bool use_lid2 : 1;
- bool user_data_cc : 1;
- bool special_info : 1;
- bitfield_t restriction : 2;
- bool reserved1 : 1;
-#endif
-} GNUC_PACKED InfoStatusFlags;
-
-#define InfoStatusFlags_SIZEOF 1
-
-enum {
- VCD_FILES_VIDEO_NOSTREAM = 0,
- VCD_FILES_VIDEO_NTSC_STILL = 1,
- VCD_FILES_VIDEO_NTSC_STILL2 = 2,
- VCD_FILES_VIDEO_NTSC_MOTION = 3,
- VCD_FILES_VIDEO_PAL_STILL = 5,
- VCD_FILES_VIDEO_PAL_STILL2 = 6,
- VCD_FILES_VIDEO_PAL_MOTION = 7
-};
-
-typedef struct
-{
-#if defined(BITFIELD_LSBF)
- bitfield_t audio_type : 2; /* Audio characteristics:
- 0x0 - No MPEG audio stream
- 0x1 - One MPEG1 or MPEG2 audio
- stream without extension
- 0x2 - Two MPEG1 or MPEG2 audio
- streams without extension
- 0x3 - One MPEG2 multi-channel
- audio stream w/ extension*/
- bitfield_t video_type : 3; /* Video characteristics:
- 0x0 - No MPEG video data
- 0x1 - NTSC still picture
- 0x2 - Reserved (NTSC hires?)
- 0x3 - NTSC motion picture
- 0x4 - Reserved
- 0x5 - PAL still picture
- 0x6 - Reserved (PAL hires?)
- 0x7 - PAL motion picture */
- bool item_cont : 1; /* Indicates segment is continuation
- 0x0 - 1st or only segment of item
- 0x1 - 2nd or later
- segment of item */
- bitfield_t ogt : 2; /* 0x0 - no OGT substream
- 0x1 - sub-stream 0 available
- 0x2 - sub-stream 0 & 1 available
- 0x3 - all OGT sub-substreams
- available */
-#else
- bitfield_t ogt : 2;
- bool item_cont : 1;
- bitfield_t video_type : 3;
- bitfield_t audio_type : 2;
-#endif
-} GNUC_PACKED InfoSpiContents;
-
-#define InfoSpiContents_SIZEOF 1
-
-typedef struct _InfoVcd_tag {
- char ID[8]; /* const "VIDEO_CD" for
- VCD, "SUPERVCD" or
- "HQ-VCD " for SVCD */
- uint8_t version; /* 0x02 -- VCD2.0,
- 0x01 for SVCD and VCD1.x */
- uint8_t sys_prof_tag; /* System Profile Tag, used
- to define the set of
- mandatory parts to be
- applied for compatibility;
- 0x00 for "SUPERVCD",
- 0x01 for "HQ-VCD ",
- 0x0n for VCDx.n */
- char album_desc[16]; /* album identification/desc. */
- uint16_t vol_count; /* number of volumes in album */
- uint16_t vol_id; /* number id of this volume in album */
- uint8_t pal_flags[13]; /* bitset of 98 PAL(=set)/NTSC flags */
- InfoStatusFlags flags; /* status flags bit field */
- uint32_t psd_size; /* size of PSD.VCD file */
- msf_t first_seg_addr; /* first segment addresses,
- coded BCD The location
- of the first sector of
- the Segment Play Item
- Area, in the form
- mm:ss:00. Must be
- 00:00:00 if the PSD size
- is 0. */
- uint8_t offset_mult; /* offset multiplier, must be 8 */
- uint16_t lot_entries; /* offsets in lot */
- uint16_t item_count; /* segments used for segmentitems */
- InfoSpiContents spi_contents[MAX_SEGMENTS]; /* The next 1980 bytes
- contain one byte for each possible
- segment play item. Each byte indicates
- contents. */
-
- uint16_t playing_time[5]; /* in seconds */
- char reserved[2]; /* Reserved, must be zero */
-} GNUC_PACKED _InfoVcd;
-
-#define InfoVcd_SIZEOF ISO_BLOCKSIZE
-
-/* LOT.VCD
- This optional file is only necessary if the PSD size is not zero.
- This List ID Offset Table allows you to start playing the PSD from
- lists other than the default List ID number. This table has a fixed length
- of 32 sectors and maps List ID numbers into List Offsets. It's got
- an entry for each List ID Number with the 16-bit offset. Note that
- List ID 1 has an offset of 0x0000. All unused or non-user-accessible
- entries must be 0xffff. */
-
-#define LOT_VCD_OFFSETS ((1 << 15)-1)
-
-typedef struct _LotVcd_tag {
- uint16_t reserved; /* Reserved, must be zero */
- uint16_t offset[LOT_VCD_OFFSETS]; /* offset given in 8 byte units */
-} GNUC_PACKED _LotVcd;
-
-#define LotVcd_SIZEOF (32*ISO_BLOCKSIZE)
-
-/* PSD.VCD
- The PSD controls the "user interaction" mode which can be used to make
- menus, etc. The PSD contains a set of Lists. Each List defines a set of
- Items which are played in sequence. An Item can be an mpeg track (in whole
- or part) or a Segment Play Item which can subsequently be mpeg video
- with or without audio, one more more mpeg still pictures (with or without
- audio) or mpeg audio only.
-
- The Selection List defines the action to be taken in response to a set
- of defined user actions: Next, Previous, Default Select, Numeric, Return.
-
- The End List terminates the control flow or switches to the next
- disc volume.
-
- Each list has a unique list id number. The first must be 1, the others can
- be anything (up to 32767).
-
- References to PSD list addresses are expressed as an offset into the PSD
- file. The offset indicated in the file must be multiplied by the Offset
- Multiplier found in the info file (although this seems to always have to
- be 8). Unused areas are filled with zeros. List ID 1 starts at offset 0.
-*/
-
-/* ...difficult to represent as monolithic C struct... */
-
-typedef struct {
- uint8_t type; /* PSD_TYPE_END_LIST */
- uint8_t next_disc; /* 0x00 to stop PBC or 0xnn to switch to disc no nn */
- uint16_t change_pic; /* 0 or 1000..2979, should be still image */
- uint8_t reserved[4]; /* padded with 0x00 */
-} GNUC_PACKED PsdEndListDescriptor;
-
-#define PsdEndListDescriptor_SIZEOF 8
-
-typedef struct {
-#if defined(BITFIELD_LSBF)
- bool SelectionAreaFlag : 1;
- bool CommandListFlag : 1;
- bitfield_t reserved : 6;
-#else
- bitfield_t reserved : 6;
- bool CommandListFlag : 1;
- bool SelectionAreaFlag : 1;
-#endif
-} GNUC_PACKED PsdSelectionListFlags;
-
-#define PsdSelectionListFlags_SIZEOF 1
-
-typedef struct _PsdSelectionListDescriptor_tag {
- uint8_t type;
- PsdSelectionListFlags flags;
- uint8_t nos;
- uint8_t bsn;
- uint16_t lid;
- uint16_t prev_ofs;
- uint16_t next_ofs;
- uint16_t return_ofs;
- uint16_t default_ofs;
- uint16_t timeout_ofs;
- uint8_t totime;
- uint8_t loop;
- uint16_t itemid;
- uint16_t ofs[EMPTY_ARRAY_SIZE]; /* variable length */
- /* PsdSelectionListDescriptorExtended */
-} GNUC_PACKED _PsdSelectionListDescriptor;
-
-#define PsdSelectionListDescriptor_SIZEOF 20
-
-typedef struct {
- struct psd_area_t prev_area;
- struct psd_area_t next_area;
- struct psd_area_t return_area;
- struct psd_area_t default_area;
- struct psd_area_t area[EMPTY_ARRAY_SIZE]; /* variable length */
-} GNUC_PACKED PsdSelectionListDescriptorExtended;
-
-#define PsdSelectionListDescriptorExtended_SIZEOF 16
-
-typedef struct {
- uint8_t type;
- uint16_t command_count;
- uint16_t lid;
- uint16_t command[EMPTY_ARRAY_SIZE]; /* variable length */
-} GNUC_PACKED PsdCommandListDescriptor;
-
-#define PsdCommandListDescriptor_SIZEOF 5
-
-typedef struct _PsdPlayListDescriptor_tag {
- uint8_t type;
- uint8_t noi; /* number of items */
- uint16_t lid; /* list id: high-bit means this list is rejected in
- the LOT (also, can't use 0) */
- uint16_t prev_ofs; /* previous list offset (0xffff disables) */
- uint16_t next_ofs; /* next list offset (0xffff disables) */
- uint16_t return_ofs; /* return list offset (0xffff disables) */
- uint16_t ptime; /* play time in 1/15 s, 0x0000 meaning full item */
- uint8_t wtime; /* delay after, in seconds, if 1 <= wtime <= 60 wait
- is wtime else if 61 <= wtime <= 254 wait is
- (wtime-60) * 10 + 60 else wtime == 255 wait is
- infinite */
- uint8_t atime; /* auto pause wait time calculated same as wtime,
- used for each item in list if the auto pause flag
- in a sector is true */
- uint16_t itemid[EMPTY_ARRAY_SIZE]; /* item number
- 0 <= n <= 1 - play nothing
- 2 <= n <= 99 - play track n
- 100 <= n <= 599 - play entry
- (n - 99) from entries
- table to end of track
- 600 <= n <= 999 - reserved
- 1000 <= n <= 2979 - play segment
- play item (n - 999)
- 2980 <= n <= 0xffff - reserved */
-} GNUC_PACKED _PsdPlayListDescriptor;
-
-#define PsdPlayListDescriptor_SIZEOF 14
-
-/* TRACKS.SVD
- SVCD\TRACKS.SVD is a mandatory file which describes the numbers and types
- of MPEG tracks on the disc. */
-
-/* SVDTrackContent indicates the audio/video content of an MPEG Track */
-
-typedef struct {
-#if defined(BITFIELD_LSBF)
- bitfield_t audio : 2; /* Audio Content
- 0x00 : No MPEG audio stream
- 0x01 : One MPEG{1|2} audio stream
- 0x02 : Two MPEG{1|2} streams
- 0x03 : One MPEG2 multi-channel
- audio stream with
- extension */
- bitfield_t video : 3; /* Video Content
- 0x00 : No MPEG video
- 0x03 : NTSC video
- 0x07 : PAL video */
- bool reserved1 : 1; /* Reserved, must be zero */
- bitfield_t ogt : 2; /* 0x0 - no OGT substream
- 0x1 - sub-stream 0 available
- 0x2 - sub-stream 0 & 1 available
- 0x3 - all OGT sub-substreams
- available */
-#else
- bitfield_t ogt : 2;
- bool reserved1 : 1;
- bitfield_t video : 3;
- bitfield_t audio : 2;
-#endif
-} GNUC_PACKED SVDTrackContent;
-
-#define SVDTrackContent_SIZEOF 1
-
-/* The file contains a series of structures, one for each
- track, which indicates the track's playing time (in sectors, not actually
- real time) and contents. */
-
-#define TRACKS_SVD_FILE_ID "TRACKSVD"
-#define TRACKS_SVD_VERSION 0x01
-
-typedef struct {
- char file_id[sizeof(TRACKS_SVD_FILE_ID)-1]; /* == "TRACKSVD" */
- uint8_t version; /* == 0x01 */
- uint8_t reserved; /* Reserved, must be zero */
- uint8_t tracks; /* number of MPEG tracks */
- msf_t playing_time[EMPTY_ARRAY_SIZE]; /* per track, BCD coded
- mm:ss:ff */
-} GNUC_PACKED TracksSVD;
-
-#define TracksSVD_SIZEOF 11
-
-typedef struct {
- /* TracksSVD tracks_svd; */
- SVDTrackContent contents[1]; /* should be [], but C99 doesn't allow it
- indicates track contents */
-} GNUC_PACKED TracksSVD2;
-
-#define TracksSVD2_SIZEOF SVDTrackContent_SIZEOF
-
-/* VCD30 tracks svd */
-
-typedef struct {
- char file_id[sizeof(TRACKS_SVD_FILE_ID)-1]; /* == "TRACKSVD" */
- uint8_t version; /* == 0x01 */
- uint8_t reserved; /* Reserved, must be zero */
- uint8_t tracks; /* number of MPEG tracks */
- struct {
- msf_t cum_playing_time; /* BCD coded mm:ss:ff */
- uint8_t ogt_info;
- uint8_t audio_info;
- } GNUC_PACKED track[EMPTY_ARRAY_SIZE];
-} GNUC_PACKED TracksSVD_v30;
-
-#define TracksSVD_v30_SIZEOF 11
-
-/* SEARCH.DAT
- This file defines where the scan points are. It covers all mpeg tracks
- together. A scan point at time T is the nearest I-picture in the MPEG
- stream to the given time T. Scan points are given at every half-second
- for the entire duration of the disc. */
-
-#define SEARCH_FILE_ID "SEARCHSV"
-#define SEARCH_VERSION 0x01
-#define SEARCH_TIME_INTERVAL 0x01
-
-typedef struct {
- char file_id[sizeof(SEARCH_FILE_ID)-1]; /* = "SEARCHSV" */
- uint8_t version; /* = 0x01 */
- uint8_t reserved; /* Reserved, must be zero */
- uint16_t scan_points; /* the number of scan points */
- uint8_t time_interval; /* The interval of time in
- between scan points, in units
- of 0.5 seconds, must be 0x01 */
- msf_t points[EMPTY_ARRAY_SIZE]; /* The series of scan points */
-} GNUC_PACKED SearchDat;
-
-#define SearchDat_SIZEOF 13
-
-/* SPICONTX.SVD
- */
-
-#define SPICONTX_FILE_ID "SPICONSV"
-#define SPICONTX_VERSION 0x01
-
-typedef struct {
- char file_id[sizeof(SPICONTX_FILE_ID)-1]; /* = "SPICONSV" */
- uint8_t version; /* = 0x01 */
- uint8_t reserved; /* Reserved, must be zero */
- struct {
- uint8_t ogt_info;
- uint8_t audio_info;
- } GNUC_PACKED spi[MAX_SEGMENTS];
- uint8_t reserved2[126]; /* 0x00 */
-} GNUC_PACKED SpicontxSvd;
-
-#define SpicontxSvd_SIZEOF (2*ISO_BLOCKSIZE)
-
-/* SCANDATA.DAT for VCD 2.0 */
-
-#define SCANDATA_FILE_ID "SCAN_VCD"
-#define SCANDATA_VERSION_VCD2 0x02
-#define SCANDATA_VERSION_SVCD 0x01
-
-typedef struct {
- char file_id[sizeof(SCANDATA_FILE_ID)-1]; /* = "SCAN_VCD" */
- uint8_t version; /* = 0x02 */
- uint8_t reserved; /* Reserved, must be zero */
- uint16_t scan_points; /* the number of scan points */
- msf_t points[EMPTY_ARRAY_SIZE]; /* actual scan points
- points[time(iframe)/0.5] */
-} GNUC_PACKED ScandataDat_v2;
-
-#define ScandataDat_v2_SIZEOF 12
-
-/* SCANDATA.DAT for SVCD
- This file fulfills much the same purpose of the SEARCH.DAT file except
- that this file is mandatory only if the System Profile Tag of the
- INFO.SVD file is 0x01 (HQ-VCD) and also that it contains sector addresses
- also for each video Segment Play Items in addition to the regular MPEG
- tracks. */
-
-typedef struct {
- char file_id[sizeof(SCANDATA_FILE_ID)-1]; /* = "SCAN_VCD" */
- uint8_t version; /* = 0x01 */
- uint8_t reserved; /* Reserved, must be zero */
- uint16_t scandata_count; /* number of 3-byte entries in
- the table */
- uint16_t track_count; /* number of mpeg tracks on disc */
- uint16_t spi_count; /* number of consecutively recorded
- play item segments (as opposed
- to the number of segment play
- items). */
- msf_t cum_playtimes[EMPTY_ARRAY_SIZE]; /* cumulative playing
- time up to track
- N. Track time just wraps
- at 99:59:74 */
-} GNUC_PACKED ScandataDat1;
-
-#define ScandataDat1_SIZEOF 16
-
-typedef struct {
- /* ScandataDat head; */
- uint16_t spi_indexes[1]; /* should be [], but C doesn't allow that;
- Indexes into the following scandata
- table */
-} GNUC_PACKED ScandataDat2;
-
-#define ScandataDat2_SIZEOF sizeof(uint16_t)
-
-typedef struct {
- /* ScandataDat2 head; */
- uint16_t mpegtrack_start_index; /* Index into the
- following scandata table
- where the MPEG track
- scan points start */
-
- /* The scandata table starts here */
- struct {
- uint8_t track_num; /* Track number as in TOC */
- uint16_t table_offset; /* Index into scandata table */
- } GNUC_PACKED mpeg_track_offsets[EMPTY_ARRAY_SIZE];
-} GNUC_PACKED ScandataDat3;
-
-#define ScandataDat3_SIZEOF 2
-
-typedef struct {
- /* ScandataDat3 head; */
- msf_t scandata_table[1]; /* should be [] but C99 doesn't allow that */
-} GNUC_PACKED ScandataDat4;
-
-#define ScandataDat4_SIZEOF msf_t_SIZEOF
-
-PRAGMA_END_PACKED
-
-#endif /* __VCD_FILES_PRIVATE_H__ */
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libvcd/libvcd/inf.h b/src/input/vcd/libvcd/libvcd/inf.h
deleted file mode 100644
index fcd9098e2..000000000
--- a/src/input/vcd/libvcd/libvcd/inf.h
+++ /dev/null
@@ -1,260 +0,0 @@
-/*!
- \file inf.h
-
- Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com>
-
- \verbatim
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Foundation
- Software, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- \endverbatim
-*/
-
-/*
- Things here refer to lower-level structures using a structure other
- than vcdinfo_t. For higher-level structures via the vcdinfo_t, see
- info.h
-*/
-
-#ifndef _VCD_INF_H
-#define _VCD_INF_H
-
-#include <libvcd/info.h>
-
- const char * vcdinf_area_str (const struct psd_area_t *_area);
-
- /*!
- Return a string containing the VCD album id.
- */
- const char * vcdinf_get_album_id(const InfoVcd_t *info);
-
- /*!
- Get autowait time value for PsdPlayListDescriptor *d.
- Time is in seconds unless it is -1 (unlimited).
- */
- int vcdinf_get_autowait_time (const PsdPlayListDescriptor_t *d);
-
- /*!
- Return the base selection number. VCD_INVALID_BSN is returned if there
- is an error.
- */
- unsigned int vcdinf_get_bsn(const PsdSelectionListDescriptor_t *psd);
-
- /*! Return the starting LBA (logical block address) for sequence
- entry_num in obj. VCDINFO_NULL_LBA is returned if there is no entry.
- The first entry number is 0.
- */
- lba_t vcdinf_get_entry_lba(const EntriesVcd_t *entries,
- unsigned int entry_num);
-
- const char * vcdinf_get_format_version_str (vcd_type_t vcd_type);
-
- /*!
- Return loop count. 0 is infinite loop.
- */
- uint16_t vcdinf_get_loop_count (const PsdSelectionListDescriptor_t *psd);
-
- /*!
- Return LOT offset
- */
- uint16_t vcdinf_get_lot_offset (const LotVcd_t *lot, unsigned int n);
-
- /*!
- Return number of bytes in PSD.
- */
- uint32_t vcdinf_get_psd_size (const InfoVcd_t *info);
-
- /*!
- Return the number of segments in the VCD.
- */
- unsigned int vcdinf_get_num_entries(const EntriesVcd_t *entries);
-
- /*!
- Return number of LIDs.
- */
- lid_t vcdinf_get_num_LIDs (const InfoVcd_t *info);
-
- /*!
- Return the number of segments in the VCD.
- */
- segnum_t vcdinf_get_num_segments(const InfoVcd_t *info);
-
- /*!
- Return the number of menu selections for selection-list descriptor d.
- */
- unsigned int vcdinf_get_num_selections(const PsdSelectionListDescriptor_t *d);
-
- /*!
- Get play-time value for PsdPlayListDescriptor *d.
- Time is in 1/15-second units.
- */
- uint16_t vcdinf_get_play_time (const PsdPlayListDescriptor_t *d);
-
- /*!
- Get timeout offset for PsdPlayListDescriptor *d. Return
- VCDINFO_INVALID_OFFSET if d is NULL;
- Time is in seconds unless it is -1 (unlimited).
- */
- uint16_t vcdinf_get_timeout_offset (const PsdSelectionListDescriptor_t *d);
-
- /*!
- Get timeout wait value for PsdPlayListDescriptor *d.
- Time is in seconds unless it is -1 (unlimited).
- */
- int vcdinf_get_timeout_time (const PsdSelectionListDescriptor_t *d);
-
- /*!
- Return the track number for entry n in obj. The first track starts
- at 1.
- */
- track_t vcdinf_get_track(const EntriesVcd_t *entries,
- const unsigned int entry_num);
-
- /*!
- Return the VCD volume num - the number of the CD in the collection.
- This is a number between 1 and the volume count.
- */
- unsigned int vcdinf_get_volume_num(const InfoVcd_t *info);
-
- /*!
- Return the VCD volume count - the number of CD's in the collection.
- */
- unsigned int vcdinf_get_volume_count(const InfoVcd_t *info);
-
- /*!
- Get wait time value for PsdPlayListDescriptor *d.
- Time is in seconds unless it is -1 (unlimited).
- */
- int vcdinf_get_wait_time (const PsdPlayListDescriptor_t *d);
-
- /*!
- Return true if loop has a jump delay
- */
- bool vcdinf_has_jump_delay (const PsdSelectionListDescriptor_t *psd);
-
- /*!
- Comparison routine used in sorting. We compare LIDs and if those are
- equal, use the offset.
- Note: we assume an unassigned LID is 0 and this compares as a high value.
-
- NOTE: Consider making static.
- */
- int vcdinf_lid_t_cmp (vcdinfo_offset_t *a, vcdinfo_offset_t *b);
-
- /**
- \fn vcdinf_pld_get_next_offset(const PsdPlayListDescriptor *pld);
- \brief Get next offset for a given PSD selector descriptor.
- \return VCDINFO_INVALID_OFFSET is returned on error or if pld has no
- "next" entry or pld is NULL. Otherwise the LID offset is returned.
- */
- uint16_t vcdinf_pld_get_next_offset(const PsdPlayListDescriptor_t *pld);
-
- /*!
- Get the LID from a given play-list descriptor.
- VCDINFO_REJECTED_MASK is returned on error or pld is NULL.
- */
- uint16_t vcdinf_pld_get_lid(const PsdPlayListDescriptor_t *pld);
-
- /*!
- Return the playlist item i in d.
- */
- uint16_t vcdinf_pld_get_play_item(const PsdPlayListDescriptor_t *pld,
- unsigned int i);
-
- /**
- \fn vcdinf_pld_get_prev_offset(const PsdSelectionListDescriptor *pld);
- \brief Get prev offset for a given PSD selector descriptor.
- \return VCDINFO_INVALID_OFFSET is returned on error or if pld has no
- "prev" entry or pld is NULL. Otherwise the LID offset is returned.
- */
- uint16_t vcdinf_pld_get_prev_offset(const PsdPlayListDescriptor_t *pld);
-
- /**
- \fn vcdinf_pld_get_return_offset(const PsdPlayListDescriptor *pld);
- \brief Get return offset for a given PLD selector descriptor.
- \return VCDINFO_INVALID_OFFSET is returned on error or if pld has no
- "return" entry or pld is NULL. Otherwise the LID offset is returned.
- */
- uint16_t vcdinf_pld_get_return_offset(const PsdPlayListDescriptor_t *pld);
-
- /*!
- Return number of items in LIDs. Return 0 if error or not found.
- */
- int vcdinf_pld_get_noi (const PsdPlayListDescriptor_t *pld);
-
- /**
- * \fn vcdinfo_psd_get_default_offset(const PsdSelectionListDescriptor *psd);
- * \brief Get next offset for a given PSD selector descriptor.
- * \return VCDINFO_INVALID_OFFSET is returned on error or if psd is
- * NULL. Otherwise the LID offset is returned.
- */
- uint16_t vcdinf_psd_get_default_offset(const PsdSelectionListDescriptor_t *psd);
-
- /*!
- Get the item id for a given selection-list descriptor.
- VCDINFO_REJECTED_MASK is returned on error or if psd is NULL.
- */
- uint16_t vcdinf_psd_get_itemid(const PsdSelectionListDescriptor_t *psd);
-
- /*!
- Get the LID from a given selection-list descriptor.
- VCDINFO_REJECTED_MASK is returned on error or psd is NULL.
- */
- uint16_t vcdinf_psd_get_lid(const PsdSelectionListDescriptor_t *psd);
-
- /*!
- Get the LID rejected status for a given selection-list descriptor.
- true is also returned d is NULL.
- */
- bool
- vcdinf_psd_get_lid_rejected(const PsdSelectionListDescriptor_t *psd);
-
- /**
- \fn vcdinf_psd_get_next_offset(const PsdSelectionListDescriptor *psd);
- \brief Get "next" offset for a given PSD selector descriptor.
- \return VCDINFO_INVALID_OFFSET is returned on error or if psd has no
- "next" entry or psd is NULL. Otherwise the LID offset is returned.
- */
- lid_t vcdinf_psd_get_next_offset(const PsdSelectionListDescriptor_t *psd);
-
- /*!
- \brief Get offset entry_num for a given PSD selector descriptor.
- \param d PSD selector containing the entry_num we query
- \param entry_num entry number that we want the LID offset for.
- \return VCDINFO_INVALID_OFFSET is returned if d on error or d is
- NULL. Otherwise the LID offset is returned.
- */
- uint16_t vcdinf_psd_get_offset(const PsdSelectionListDescriptor_t *d,
- unsigned int entry_num);
- /**
- \fn vcdinf_psd_get_prev_offset(const PsdPlayListDescriptor *psd);
- \brief Get "prev" offset for a given PSD selector descriptor.
- \return VCDINFO_INVALID_OFFSET is returned on error or if psd has no
- "prev"
- entry or psd is NULL. Otherwise the LID offset is returned.
- */
- uint16_t vcdinf_psd_get_prev_offset(const PsdSelectionListDescriptor_t *psd);
-
- /**
- * \fn vcdinf_psd_get_return_offset(const PsdSelectionListDescriptor *psd);
- * \brief Get "return" offset for a given PSD selector descriptor.
- \return VCDINFO_INVALID_OFFSET is returned on error or if psd has no
- "return" entry or psd is NULL. Otherwise the LID offset is returned.
- */
- uint16_t vcdinf_psd_get_return_offset(const PsdSelectionListDescriptor_t *psd);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /*_VCD_INF_H*/
diff --git a/src/input/vcd/libvcd/libvcd/info.h b/src/input/vcd/libvcd/libvcd/info.h
deleted file mode 100644
index 91b25c956..000000000
--- a/src/input/vcd/libvcd/libvcd/info.h
+++ /dev/null
@@ -1,860 +0,0 @@
-/*!
- \file info.h
-
- Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com>
-
- \verbatim
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Foundation
- Software, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- \endverbatim
-*/
-/*
- Things here refer to higher-level structures usually accessed via
- vcdinfo_t. For lower-level access which generally use
- structures other than vcdinfo_t, see inf.h
-*/
-
-
-#ifndef _VCD_INFO_H
-#define _VCD_INFO_H
-
-#include <libvcd/version.h>
-#include <libvcd/types.h>
-#include <libvcd/files.h>
-#include <cdio/cdio.h>
-#include <cdio/ds.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/*========== Move somewhere else? ================*/
-
-/*! \def Max # characters in an album id. */
-#define MAX_ALBUM_LEN 16
-
-/*! \def Max # of selections allowed in a PBC selection list. */
-#define MAX_PBC_SELECTIONS 99
-
-#define MIN_ENCODED_TRACK_NUM 100
-#define MIN_ENCODED_SEGMENT_NUM 1000
-#define MAX_ENCODED_SEGMENT_NUM 2979
-
-/*!
- Invalid LBA, Note: VCD player uses the fact that this is a very high
- value.
- */
-#define VCDINFO_NULL_LBA CDIO_INVALID_LBA
-
-/*!
- Invalid LSN, Note: VCD player uses the fact that this is a very high
- value.
- */
-#define VCDINFO_NULL_LSN VCDINFO_NULL_LBA
-
-/*========== End move somewhere else? ================*/
-
-/*!
- Portion of uint16_t which determines whether offset is
- rejected or not.
-*/
-#define VCDINFO_REJECTED_MASK (0x8000)
-
-/*!
- Portion of uint16_t which contains the offset.
-*/
-#define VCDINFO_OFFSET_MASK (VCDINFO_REJECTED_MASK-1)
-
-/*!
- Portion of uint16_t which contains the lid.
-*/
-#define VCDINFO_LID_MASK (VCDINFO_REJECTED_MASK-1)
-
-/*!
- Constant for invalid track number
-*/
-#define VCDINFO_INVALID_TRACK 0xFF
-
-/*!
- Constant for invalid LID offset.
-*/
-#define VCDINFO_INVALID_OFFSET 0xFFFF
-
-/*!
- Constant for ending or "leadout" track.
-*/
-#define VCDINFO_LEADOUT_TRACK 0xaa
-
-/*!
- Constant for invalid sequence entry.
-*/
-#define VCDINFO_INVALID_ENTRY 0xFFFF
-
-/*!
- Constant for invalid LID.
- FIXME: player needs these to be the same.
- VCDimager code requres 0 for an UNINITIALIZED LID.
-
-*/
-#define VCDINFO_INVALID_LID VCDINFO_INVALID_ENTRY
-#define VCDINFO_UNINIT_LID 0
-
-/*!
- Constant for invalid itemid
-*/
-#define VCDINFO_INVALID_ITEMID 0xFFFF
-
-/*!
- Constant for invalid audio type
-*/
-#define VCDINFO_INVALID_AUDIO_TYPE 4
-
-/*!
- Constant for invalid base selection number (BSN)
-*/
-#define VCDINFO_INVALID_BSN 200
-
-/* The number of sectors allocated in a Video CD segment is a fixed: 150.
-
- NOTE: The actual number of sectors used is often less and can sometimes
- be gleaned by looking at the correspoinding ISO 9660 file entry (or
- by scanning the MPEG segment which may be slow).
- Some media players get confused by or complain about padding at the end
- a segment.
-*/
-#define VCDINFO_SEGMENT_SECTOR_SIZE 150
-
- /* Opaque type used in most routines below. */
- typedef struct _VcdInfo vcdinfo_obj_t;
-
- /* See enum in vcd_files_private.h */
- typedef enum {
- VCDINFO_FILES_VIDEO_NOSTREAM = 0,
- VCDINFO_FILES_VIDEO_NTSC_STILL = 1,
- VCDINFO_FILES_VIDEO_NTSC_STILL2 = 2, /* lo+hires*/
- VCDINFO_FILES_VIDEO_NTSC_MOTION = 3,
- VCDINFO_FILES_VIDEO_PAL_STILL = 5,
- VCDINFO_FILES_VIDEO_PAL_STILL2 = 6, /* lo+hires*/
- VCDINFO_FILES_VIDEO_PAL_MOTION = 7,
- VCDINFO_FILES_VIDEO_INVALID = 8
- } vcdinfo_video_segment_type_t;
-
- /*!
- Used in working with LOT - list of offsets and lid's
- */
- typedef struct {
- uint8_t type;
- lid_t lid;
- uint16_t offset;
- bool in_lot; /* Is listed in LOT. */
- bool ext; /* True if entry comes from offset_x_list. */
- } vcdinfo_offset_t;
-
- /*!
- The kind of entry associated with an selection-item id
- */
- /* See corresponding enum in vcd_pbc.h. */
- typedef enum {
- VCDINFO_ITEM_TYPE_TRACK,
- VCDINFO_ITEM_TYPE_ENTRY,
- VCDINFO_ITEM_TYPE_SEGMENT,
- VCDINFO_ITEM_TYPE_LID,
- VCDINFO_ITEM_TYPE_SPAREID2,
- VCDINFO_ITEM_TYPE_NOTFOUND
- } vcdinfo_item_enum_t;
-
- typedef struct {
- uint16_t num;
- vcdinfo_item_enum_t type;
- } vcdinfo_itemid_t;
-
- typedef enum {
- VCDINFO_OPEN_ERROR, /* Error */
- VCDINFO_OPEN_VCD, /* Is VCD of some sort */
- VCDINFO_OPEN_OTHER /* Is not VCD but something else */
- } vcdinfo_open_return_t;
-
- typedef struct
- {
-
- psd_descriptor_types descriptor_type;
- /* Only one of pld or psd is used below. Not all
- C compiler accept the anonymous unions commented out below. */
- /* union { */
- PsdPlayListDescriptor_t *pld;
- PsdSelectionListDescriptor_t *psd;
- /* }; */
-
- } PsdListDescriptor_t;
-
- /* For backwards compatibility. Don't use PsdListDescriptor. */
-#define PsdListDescriptor PsdListDescriptor_t
-
- /*!
- Return the number of audio channels implied by "audio_type".
- 0 is returned on error.
- */
- unsigned int
- vcdinfo_audio_type_num_channels(const vcdinfo_obj_t *obj,
- unsigned int audio_type);
-
- /*!
- Return a string describing an audio type.
- */
- const char * vcdinfo_audio_type2str(const vcdinfo_obj_t *obj,
- unsigned int audio_type);
-
- /*!
- Note first seg_num is 0!
- */
- const char *
- vcdinfo_ogt2str(const vcdinfo_obj_t *obj, segnum_t seg_num);
-
- /*!
- Note first seg_num is 0!
- */
- const char *
- vcdinfo_video_type2str(const vcdinfo_obj_t *obj, segnum_t seg_num);
-
- const char *
- vcdinfo_pin2str (uint16_t itemid);
-
- /*!
- \brief Classify itemid_num into the kind of item it is: track #, entry #,
- segment #.
- \param itemid is set to contain this classifcation an the converted
- entry number.
- */
- void
- vcdinfo_classify_itemid (uint16_t itemid_num,
- /*out*/ vcdinfo_itemid_t *itemid);
-
- /*!
- Return a string containing the VCD album id, or NULL if there is
- some problem in getting this.
- */
- const char *
- vcdinfo_get_album_id(const vcdinfo_obj_t *obj);
-
- /*!
- Return the VCD application ID.
- NULL is returned if there is some problem in getting this.
- */
- char *
- vcdinfo_get_application_id(vcdinfo_obj_t *obj);
-
- /*!
- Return a pointer to the cdio structure for the CD image opened or
- NULL if error.
- */
- CdIo *
- vcdinfo_get_cd_image (const vcdinfo_obj_t *vcd_obj);
-
- /*!
- Return a string containing the default VCD device if none is specified.
- This might be something like "/dev/cdrom" on Linux or
- "/vol/dev/aliases/cdrom0" on Solaris, or maybe "VIDEOCD.CUE" for
- if bin/cue I/O routines are in effect.
-
- Return NULL we can't get this information.
- */
- char *
- vcdinfo_get_default_device (const vcdinfo_obj_t *vcd_obj);
-
- /*!
- \brief Get default LID offset.
-
- Return the LID offset associated with a the "default" entry of the
- passed-in LID parameter. Note "default" entries are associated with
- PSDs that are (extended) selection lists.
-
- \return VCDINFO_INVALID_OFFSET is returned on error, or if the LID
- is not a selection list or no "default" entry. Otherwise the LID
- offset is returned.
- */
- uint16_t
- vcdinfo_get_default_offset(const vcdinfo_obj_t *obj, lid_t lid);
-
- /*!
- Return number of sector units in of an entry. 0 is returned if
- entry_num is invalid.
- */
- uint32_t
- vcdinfo_get_entry_sect_count (const vcdinfo_obj_t *obj,
- unsigned int entry_num);
-
- /*! Return the starting LBA (logical block address) for sequence
- entry_num in obj. VCDINFO_NULL_LBA is returned if there is no entry.
- The first entry number is 0.
- */
- lba_t
- vcdinfo_get_entry_lba(const vcdinfo_obj_t *obj, unsigned int entry_num);
-
- /*! Return the starting LSN (logical sector number) for sequence
- entry_num in obj. VCDINFO_NULL_LSN is returned if there is no entry.
- The first entry number is 0.
- */
- lsn_t
- vcdinfo_get_entry_lsn(const vcdinfo_obj_t *obj, unsigned int entry_num);
-
- /*! Return the starting MSF (minutes/secs/frames) for sequence
- entry_num in obj. NULL is returned if there is no entry.
- The first entry number is 0.
- */
- const msf_t *
- vcdinfo_get_entry_msf(const vcdinfo_obj_t *obj, unsigned int entry_num);
-
- /*!
- Get the VCD format (VCD 1.0 VCD 1.1, SVCD, ... for this object.
- The type is also set inside obj.
- The first entry number is 0.
- */
- vcd_type_t
- vcdinfo_get_format_version (vcdinfo_obj_t *obj);
-
- /*!
- Return a string giving VCD format (VCD 1.0 VCD 1.1, SVCD, ...
- for this object.
- */
- const char *
- vcdinfo_get_format_version_str (const vcdinfo_obj_t *obj);
-
- EntriesVcd_t * vcdinfo_get_entriesVcd (vcdinfo_obj_t *obj);
-
- InfoVcd_t * vcdinfo_get_infoVcd (vcdinfo_obj_t *obj);
-
- /*!
- \brief Get default or multi-default LID.
-
- Return the LID offset associated with a the "default" entry of the
- passed-in LID parameter. Note "default" entries are associated
- with PSDs that are (extended) selection lists. If the "default"
- is a multi-default, we use entry_num to find the proper
- "default" LID. Otherwise this routine is exactly like
- vcdinfo_get_default_offset with the exception of requiring an
- additional "entry_num" parameter.
-
- \return VCDINFO_INVALID_LID is returned on error, or if the LID
- is not a selection list or no "default" entry. Otherwise the LID
- offset is returned.
- */
- lid_t
- vcdinfo_get_multi_default_lid(const vcdinfo_obj_t *obj, lid_t lid,
- lsn_t lsn);
-
- /*!
- \brief Get default or multi-default LID offset.
-
- Return the LID offset associated with a the "default" entry of the
- passed-in LID parameter. Note "default" entries are associated
- with PSDs that are (extended) selection lists. If the "default"
- is a multi-default, we use entry_num to find the proper
- "default" offset. Otherwise this routine is exactly like
- vcdinfo_get_default_offset with the exception of requiring an
- additional "entry_num" parameter.
-
- \return VCDINFO_INVALID_OFFSET is returned on error, or if the LID
- is not a selection list or no "default" entry. Otherwise the LID
- offset is returned.
- */
- uint16_t
- vcdinfo_get_multi_default_offset(const vcdinfo_obj_t *obj, lid_t lid,
- unsigned int selection);
-
- void * vcdinfo_get_pvd (vcdinfo_obj_t *obj);
-
- void * vcdinfo_get_scandata (vcdinfo_obj_t *obj);
-
- void * vcdinfo_get_searchDat (vcdinfo_obj_t *obj);
-
- void * vcdinfo_get_tracksSVD (vcdinfo_obj_t *obj);
-
- /*!
- Get the LOT pointer.
- */
- LotVcd_t *
- vcdinfo_get_lot(const vcdinfo_obj_t *obj);
-
- /*!
- Get the extended LOT pointer.
- */
- LotVcd_t *
- vcdinfo_get_lot_x(const vcdinfo_obj_t *obj);
-
- /*!
- Return Number of LIDs.
- */
- lid_t
- vcdinfo_get_num_LIDs (const vcdinfo_obj_t *obj);
-
- /*!
- Return the audio type for a given track.
- VCDINFO_INVALID_AUDIO_TYPE is returned on error.
- */
- unsigned int
- vcdinfo_get_num_audio_channels(unsigned int audio_type);
-
- /*!
- Return the number of entries in the VCD.
- */
- unsigned int
- vcdinfo_get_num_entries(const vcdinfo_obj_t *obj);
-
- /*!
- Return the number of segments in the VCD.
- */
- segnum_t
- vcdinfo_get_num_segments(const vcdinfo_obj_t *obj);
-
- /*!
- Return the highest track number in the current medium.
-
- Because we track start numbering at 0 (which is the ISO 9660 track
- containing Video CD naviagion and disk information), this is one
- less than the number of tracks.
-
- If there are no tracks, we return -1.
- */
- unsigned int
- vcdinfo_get_num_tracks(const vcdinfo_obj_t *obj);
-
- /*!
- Get the VCD info list.
- */
- CdioList *vcdinfo_get_offset_list(const vcdinfo_obj_t *obj);
-
- /*!
- Get the VCD info extended offset list.
- */
- CdioList *vcdinfo_get_offset_x_list(const vcdinfo_obj_t *obj);
-
- /*!
- Get the VCD info offset multiplier.
- */
- unsigned int vcdinfo_get_offset_mult(const vcdinfo_obj_t *obj);
-
- /*!
- Get entry in offset list for the item that has offset. This entry
- has for example the LID. NULL is returned on error.
- */
- vcdinfo_offset_t *
- vcdinfo_get_offset_t (const vcdinfo_obj_t *obj, unsigned int offset);
-
- /*!
- Return a string containing the VCD preparer id with trailing
- blanks removed, or NULL if there is some problem in getting this.
- */
- const char *
- vcdinfo_get_preparer_id(const vcdinfo_obj_t *obj);
-
- /*!
- Get the PSD.
- */
- uint8_t *vcdinfo_get_psd(const vcdinfo_obj_t *obj);
-
- /*!
- Get the extended PSD.
- */
- uint8_t *vcdinfo_get_psd_x(const vcdinfo_obj_t *obj);
-
- /*!
- Return number of bytes in PSD.
- */
- uint32_t vcdinfo_get_psd_size (const vcdinfo_obj_t *obj);
-
- /*!
- Return number of bytes in the extended PSD.
- */
- uint32_t vcdinfo_get_psd_x_size (const vcdinfo_obj_t *obj);
-
- /*!
- Return a string containing the VCD publisher id with trailing
- blanks removed, or NULL if there is some problem in getting this.
- */
- char * vcdinfo_get_publisher_id(const vcdinfo_obj_t *obj);
-
- /**
- \fn vcdinfo_get_return_offset(const vcdinfo_obj_t *obj);
- \brief Get return offset for a given LID.
- \return VCDINFO_INVALID_OFFSET is returned on error or if LID has no
- "return" entry. Otherwise the LID offset is returned.
- */
- lid_t
- vcdinfo_get_return_offset(const vcdinfo_obj_t *obj, lid_t lid);
-
- /*!
- Return the audio type for a given segment.
- VCDINFO_INVALID_AUDIO_TYPE is returned on error.
- */
- unsigned int
- vcdinfo_get_seg_audio_type(const vcdinfo_obj_t *obj, segnum_t seg_num);
-
- /*!
- Return true if this segment is supposed to continue to the next one,
- (is part of an "item" or listing in the ISO 9660 filesystem).
- */
- bool vcdinfo_get_seg_continue(const vcdinfo_obj_t *obj, segnum_t seg_num);
-
- /*! Return the starting LBA (logical block address) for segment
- entry_num in obj. VCDINFO_NULL_LBA is returned if there is no entry.
-
- Note first seg_num is 0.
- */
- lba_t
- vcdinfo_get_seg_lba(const vcdinfo_obj_t *obj, segnum_t seg_num);
-
- /*! Return the starting LSN (logical sector number) for segment
- entry_num in obj. VCDINFO_NULL_LBA is returned if there is no entry.
-
- Note first seg_num is 0.
- */
- lsn_t
- vcdinfo_get_seg_lsn(const vcdinfo_obj_t *obj, segnum_t seg_num);
-
- /*! Return the starting MSF (minutes/secs/frames) for segment
- entry_num in obj. NULL is returned if there is no entry.
-
- Note first seg_num is 0.
- */
- const msf_t *
- vcdinfo_get_seg_msf(const vcdinfo_obj_t *obj, segnum_t seg_num);
-
- /*!
- Return the number of sectors for segment
- entry_num in obj. 0 is returned if there is no entry.
-
- Use this routine to figure out the actual number of bytes a physical
- region of a disk or CD takes up for a segment.
-
- If an item has been broken up into a number of "continued" segments,
- we will report the item size for the first segment and 0 for the
- remaining ones. We may revisit this decision later.
- */
- uint32_t
- vcdinfo_get_seg_sector_count(const vcdinfo_obj_t *obj, segnum_t seg_num);
-
- /*!
- Return a string containing the VCD system id with trailing
- blanks removed, or NULL if there is some problem in getting this.
- */
- const char *
- vcdinfo_get_system_id(const vcdinfo_obj_t *obj);
-
- /*!
- Return the track number for entry n in obj.
-
- In contrast to libcdio we start numbering at 0 which is the
- ISO9660 and metadata information for the Video CD. Thus track
- 1 is the first track the first complete MPEG track generally.
- */
- track_t
- vcdinfo_get_track(const vcdinfo_obj_t *obj, const unsigned int entry_num);
-
- /*!
- Return the audio type for a given track.
- VCDINFO_INVALID_AUDIO_TYPE is returned on error.
-
- Note: track 1 is usually the first track.
- */
- unsigned int
- vcdinfo_get_track_audio_type(const vcdinfo_obj_t *obj, track_t track_num);
-
- /*!
- Return the starting LBA (logical block address) for track number
- track_num in obj.
-
- The IS0-9660 filesystem track has number 0. Tracks associated
- with playable entries numbers start at 1.
-
- The "leadout" track is specified either by
- using track_num LEADOUT_TRACK or the total tracks+1.
- VCDINFO_NULL_LBA is returned on failure.
- */
- lba_t
- vcdinfo_get_track_lba(const vcdinfo_obj_t *obj, track_t track_num);
-
- /*!
- Return the starting LSN (logical sector number) for track number
- track_num in obj.
-
- The IS0-9660 filesystem track has number 0. Tracks associated
- with playable entries numbers start at 1.
-
- The "leadout" track is specified either by
- using track_num LEADOUT_TRACK or the total tracks+1.
- VCDINFO_NULL_LBA is returned on failure.
- */
- lsn_t
- vcdinfo_get_track_lsn(const vcdinfo_obj_t *obj, track_t track_num);
-
- /*!
- Return the starting MSF (minutes/secs/frames) for track number
- track_num in obj.
-
- The IS0-9660 filesystem track has number 0. Tracks associated
- with playable entries numbers start at 1.
-
- The "leadout" track is specified either by
- using track_num LEADOUT_TRACK or the total tracks+1.
- VCDINFO_NULL_LBA is returned on failure.
- */
- int
- vcdinfo_get_track_msf(const vcdinfo_obj_t *obj, track_t track_num,
- uint8_t *min, uint8_t *sec, uint8_t *frame);
-
- /*!
- Return the size in sectors for track n.
-
- The IS0-9660 filesystem track has number 1. Tracks associated
- with playable entries numbers start at 2.
-
- FIXME: Whether we count the track pregap sectors is a bit haphazard.
- We should add a parameter to indicate whether this is wanted or not.
- */
- unsigned int
- vcdinfo_get_track_sect_count(const vcdinfo_obj_t *obj,
- const track_t track_num);
-
- /*!
- Return size in bytes for track number for entry n in obj.
-
- The IS0-9660 filesystem track has number 0. Tracks associated
- with playable entries numbers start at 1.
-
- FIXME: Do we count the track pregap sectors is a bit haphazard.
- We should add a parameter to indicate whether this is wanted or not.
- */
- unsigned int
- vcdinfo_get_track_size(const vcdinfo_obj_t *obj, track_t track_num);
-
- /*!
- \brief Get the kind of video stream segment of segment seg_num in obj.
- \return VCDINFO_FILES_VIDEO_INVALID is returned if on error or obj is
- null. Otherwise the enumeration type.
-
- Note first seg_num is 0!
- */
- vcdinfo_video_segment_type_t
- vcdinfo_get_video_type(const vcdinfo_obj_t *obj, segnum_t seg_num);
-
- /*!
- \brief Get the kind of VCD that obj refers to.
- */
- vcd_type_t
- vcdinfo_get_VCD_type(const vcdinfo_obj_t *obj);
-
- /*!
- Return the VCD volume count - the number of CD's in the collection.
- O is returned if there is some problem in getting this.
- */
- unsigned int
- vcdinfo_get_volume_count(const vcdinfo_obj_t *obj);
-
- /*!
- Return the VCD ID.
- NULL is returned if there is some problem in getting this.
- */
- const char *
- vcdinfo_get_volume_id(const vcdinfo_obj_t *obj);
-
- /*!
- Return the VCD volumeset ID.
- NULL is returned if there is some problem in getting this.
- */
- const char *
- vcdinfo_get_volumeset_id(const vcdinfo_obj_t *obj);
-
- /*!
- Return the VCD volume num - the number of the CD in the collection.
- This is a number between 1 and the volume count.
- O is returned if there is some problem in getting this.
- */
- unsigned int
- vcdinfo_get_volume_num(const vcdinfo_obj_t *obj);
-
- int vcdinfo_get_wait_time (uint16_t wtime);
-
- /*!
- Return true if there is playback control.
- */
- bool vcdinfo_has_pbc (const vcdinfo_obj_t *obj);
-
- /*!
- Return true if VCD has "extended attributes" (XA). Extended attributes
- add meta-data attributes to a entries of file describing the file.
- See also cdio_get_xa_attr_str() which returns a string similar to
- a string you might get on a Unix filesystem listing ("ls").
- */
- bool vcdinfo_has_xa(const vcdinfo_obj_t *obj);
-
- /*!
- Add one to the MSF.
- */
- void vcdinfo_inc_msf (uint8_t *min, uint8_t *sec, int8_t *frame);
-
- /*!
- Convert minutes, seconds and frame (MSF components) into a
- logical block address (or LBA).
- See also msf_to_lba which uses msf_t as its single parameter.
- */
- void
- vcdinfo_lba2msf (lba_t lba, uint8_t *min, uint8_t *sec, uint8_t *frame);
-
- /*!
- Get the item id for a given list ID.
- VCDINFO_REJECTED_MASK is returned on error or if obj is NULL.
- */
- uint16_t
- vcdinfo_lid_get_itemid(const vcdinfo_obj_t *obj, lid_t lid);
-
- /*!
- \fn vcdinfo_lid_get_offset(const vcdinfo_obj_t *obj,
- unsigned int entry_num);
- \brief Get offset entry_num for a given LID.
- \return VCDINFO_INVALID_OFFSET is returned if obj on error or obj
- is NULL. Otherwise the LID offset is returned.
- */
- uint16_t vcdinfo_lid_get_offset(const vcdinfo_obj_t *obj, lid_t lid,
- unsigned int entry_num);
-
- /*!
- Get the PSD Selection List Descriptor for a given lid.
- False is returned if not found.
- */
- bool vcdinfo_lid_get_pxd(const vcdinfo_obj_t *obj, PsdListDescriptor_t *pxd,
- uint16_t lid);
-
- /*! Return the entry number closest and before the given LSN.
- */
- unsigned int
- vcdinfo_lsn_get_entry(const vcdinfo_obj_t *obj, lsn_t lsn);
-
- /*!
- Convert minutes, seconds and frame (MSF components) into a
- logical block address (or LBA).
- See also msf_to_lba which uses msf_t as its single parameter.
- */
- lba_t vcdinfo_msf2lba (uint8_t min, uint8_t sec, int8_t frame);
-
- /*!
- Convert minutes, seconds and frame (MSF components) into a
- logical sector number (or LSN).
- */
- lsn_t vcdinfo_msf2lsn (uint8_t min, uint8_t sec, int8_t frame);
-
- const char *
- vcdinfo_ofs2str (const vcdinfo_obj_t *obj, unsigned int offset, bool ext);
-
- /*!
- Calls recursive routine to populate obj->offset_list or obj->offset_x_list
- by going through LOT.
-
- Returns false if there was some error.
- */
- bool vcdinfo_visit_lot (vcdinfo_obj_t *obj, bool extended);
-
- bool vcdinfo_read_psd (vcdinfo_obj_t *obj);
-
- /*!
- \fn vcdinfo_selection_get_lid(const vcdinfo_obj_t *obj, lid_t lid,
- unsigned int selection);
- \brief Get the "default" lid of a selection for a given lid.
-
- Return the LID offset associated with a the selection number of the
- passed-in LID parameter.
-
- \return VCDINFO_INVALID_LID is returned if obj on error or obj
- is NULL. Otherwise the LID offset is returned.
- */
- lid_t vcdinfo_selection_get_lid(const vcdinfo_obj_t *obj, lid_t lid,
- unsigned int selection);
-
- /*!
- \fn vcdinfo_selection_get_offset(const vcdinfo_obj_t *obj, lid_t lid,
- unsigned int selection);
- \brief Get offset of a selection for a given LID.
-
- Return the LID offset associated with a the selection number of the
- passed-in LID parameter.
-
- \return VCDINFO_INVALID_OFFSET is returned if obj on error or obj
- is NULL. Otherwise the LID offset is returned.
- */
- uint16_t vcdinfo_selection_get_offset(const vcdinfo_obj_t *obj, lid_t lid,
- unsigned int selection);
-
- /*!
- Change trailing blanks in str to nulls. Str has a maximum size of
- n characters.
- */
- const char * vcdinfo_strip_trail (const char str[], size_t n);
-
- /*! Return the entry number for the given track.
- */
- unsigned int
- vcdinfo_track_get_entry(const vcdinfo_obj_t *obj, track_t track);
-
- /*!
- Initialize the vcdinfo structure "obj". Should be done before other
- routines using obj are called.
- */
- bool vcdinfo_init(vcdinfo_obj_t *obj);
-
- /*!
- Set up vcdinfo structure "obj" for reading from a particular
- medium. This should be done before after initialization but before
- any routines that need to retrieve data.
-
- source_name is the device or file to use for inspection, and
- source_type indicates what driver to use or class of drivers in the
- case of DRIVER_DEVICE.
- access_mode gives the CD access method for reading should the driver
- allow for more than one kind of access method (e.g. MMC versus ioctl
- on GNU/Linux)
-
- If source_name is NULL we'll fill in the appropriate default device
- name for the given source_type. However if in addtion source_type is
- DRIVER_UNKNOWN, then we'll scan for a drive containing a VCD.
-
- VCDINFO_OPEN_VCD is returned if everything went okay;
- VCDINFO_OPEN_ERROR if there was an error and VCDINFO_OPEN_OTHER if the
- medium is something other than a VCD.
- */
- vcdinfo_open_return_t
- vcdinfo_open(vcdinfo_obj_t **p_obj, char *source_name[],
- driver_id_t source_type, const char access_mode[]);
-
-
- /*!
- Dispose of any resources associated with vcdinfo structure "obj".
- Call this when "obj" it isn't needed anymore.
-
- True is returned is everything went okay, and false if not.
- */
- bool vcdinfo_close(vcdinfo_obj_t *obj);
-
- /*!
- Return true if offset is "rejected". That is shouldn't be displayed
- in a list of entries.
- */
- bool vcdinfo_is_rejected(uint16_t offset);
-
-/* Include lower-level access as well. */
-#include <libvcd/inf.h>
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /*_VCD_INFO_H*/
diff --git a/src/input/vcd/libvcd/libvcd/logging.h b/src/input/vcd/libvcd/libvcd/logging.h
deleted file mode 100644
index bc088ed1c..000000000
--- a/src/input/vcd/libvcd/libvcd/logging.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- $Id: logging.h,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
- Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifndef __VCD_LOGGING_H__
-#define __VCD_LOGGING_H__
-
-#include <libvcd/types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/**
- * The different log levels supported.
- */
-typedef enum {
- VCD_LOG_DEBUG = 1, /**< Debug-level messages - helps debug what's up. */
- VCD_LOG_INFO, /**< Informational - indicates perhaps something of
- interest. */
- VCD_LOG_WARN, /**< Warning conditions - something that looks funny. */
- VCD_LOG_ERROR, /**< Error conditions - may terminate program. */
- VCD_LOG_ASSERT /**< Critical conditions - may abort program. */
-} vcd_log_level_t;
-
-/**
- * The place to save the preference concerning how much verbosity
- * is desired. This is used by the internal default log handler, but
- * it could be use by applications which provide their own log handler.
- */
-extern vcd_log_level_t vcd_loglevel_default;
-
-/**
- * This type defines the signature of a log handler. For every
- * message being logged, the handler will receive the log level and
- * the message string.
- *
- * @see vcd_log_set_handler
- * @see vcd_log_level_t
- *
- * @param level The log level.
- * @param message The log message.
- */
-typedef void (*vcd_log_handler_t) (vcd_log_level_t level,
- const char message[]);
-
-/**
- * Set a custom log handler for libcdio. The return value is the log
- * handler being replaced. If the provided parameter is NULL, then
- * the handler will be reset to the default handler.
- *
- * @see vcd_log_handler_t
- *
- * @param new_handler The new log handler.
- * @return The previous log handler.
- */
-vcd_log_handler_t
-vcd_log_set_handler (vcd_log_handler_t new_handler);
-
-/**
- * Handle an message with the given log level
- *
- * @see vcd_debug
- * @see vcd_info
- * @see vcd_warn
- * @see vcd_error
-
- * @param level The log level.
- * @param format printf-style format string
- * @param ... remaining arguments needed by format string
- */
-void
-vcd_log (vcd_log_level_t level, const char format[], ...) GNUC_PRINTF(2, 3);
-
-/**
- * Handle a debugging message.
- *
- * @see vcd_log for a more generic routine
- */
-void
-vcd_debug (const char format[], ...) GNUC_PRINTF(1,2);
-
-/**
- * Handle an informative message.
- *
- * @see vcd_log for a more generic routine
- */
-void
-vcd_info (const char format[], ...) GNUC_PRINTF(1,2);
-
-/**
- * Handle a warning message.
- *
- * @see vcd_log for a more generic routine
- */
-void
-vcd_warn (const char format[], ...) GNUC_PRINTF(1,2);
-
-/**
- * Handle an error message.
- *
- * @see vcd_log for a more generic routine.
- */
-void
-vcd_error (const char format[], ...) GNUC_PRINTF(1,2);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __VCD_LOGGING_H__ */
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libvcd/libvcd/sector.h b/src/input/vcd/libvcd/libvcd/sector.h
deleted file mode 100644
index 32c2cc89a..000000000
--- a/src/input/vcd/libvcd/libvcd/sector.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- $Id: sector.h,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifndef _VCD_SECTOR_H_
-#define _VCD_SECTOR_H_
-
-#include <libvcd/types.h>
-
-/* subheader */
-
-/*
-
- SVCD 1.0
- ~~~~~~~~
-
- empty sector: fn=0 cn=0 sm=%00100000 ci=0
- data sector: fn=0 cn=0 sm=%x0001000 ci=0
- mpeg sector: fn=1 cn=1 sm=%x11x001x ci=0x80
-
- VCD 2.0
- ~~~~~~~
-
- /MPEGAV/AVSEQyy.DAT
- empty sector: fn=yy cn=0 sm=%x11x000x ci=0
- video sector: fn=yy cn=1 sm=%x11x001x ci=0x0f
- audio sector: fn=yy cn=1 sm=%x11x010x ci=0x7f
-
- /SEGMENT/ITEMzzzz.DAT
- empty sector: fn=1 cn=0 sm=%x11x000x ci=0
- video sector: fn=1 cn=1 sm=%x11x001x ci=0x0f
- lores still: fn=1 cn=2 sm=%x11x001x ci=0x1f
- hires still: fn=1 cn=3 sm=%x11x001x ci=0x3f
- audio sector: fn=1 cn=1 sm=%x11x010x ci=0x7f
-
- /VCD/ *.VCD
- data sector: fn=0 cn=0 sm=%x000100x ci=0
-
- *.*
- data sector: fn=1 cn=0 sm=%x0001000 ci=0
-
-*/
-
-/* file numbers */
-
-/* dynamic */
-
-/* channel numbers */
-#define CN_VIDEO 0x01
-#define CN_STILL 0x02
-#define CN_STILL2 0x03
-#define CN_AUDIO 0x01
-#define CN_AUDIO2 0x02
-#define CN_OGT 0x02 /* fixme -- is it 0x04 ?? */
-#define CN_PAD 0x00
-#define CN_EMPTY 0x00
-
-/* submode byte */
-#define SM_EOF (1<<7)
-#define SM_REALT (1<<6)
-#define SM_FORM2 (1<<5)
-#define SM_TRIG (1<<4)
-#define SM_DATA (1<<3)
-#define SM_AUDIO (1<<2)
-#define SM_VIDEO (1<<1)
-#define SM_EOR (1<<0)
-
-/* coding information */
-#define CI_VIDEO 0x0f
-#define CI_STILL 0x1f
-#define CI_STILL2 0x3f
-#define CI_AUDIO 0x7f
-#define CI_AUDIO2 0x7f
-#define CI_OGT 0x0f
-#define CI_PAD 0x1f
-#define CI_MPEG2 0x80
-#define CI_EMPTY 0x00
-
-/* make mode 2 form 1/2 sector
- *
- * data must be a buffer of size 2048 or 2324 for SM_FORM2
- * raw_sector must be a writable buffer of size 2352
- */
-void
-_vcd_make_mode2 (void *raw_sector, const void *data, uint32_t extent,
- uint8_t fnum, uint8_t cnum, uint8_t sm, uint8_t ci);
-
-/* ...data must be a buffer of size 2336 */
-
-void
-_vcd_make_raw_mode2 (void *raw_sector, const void *data, uint32_t extent);
-
-#endif /* _VCD_SECTOR_H_ */
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libvcd/libvcd/types.h b/src/input/vcd/libvcd/libvcd/types.h
deleted file mode 100644
index 56a07d447..000000000
--- a/src/input/vcd/libvcd/libvcd/types.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- $Id: types.h,v 1.3 2005/01/01 02:43:59 rockyb Exp $
-
- Copyright (C) 2000, 2004 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifndef __VCD_TYPES_H__
-#define __VCD_TYPES_H__
-
-#include <cdio/types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
- /* Opaque types ... */
-
- /* Defined fully in data_structures.c */
- typedef struct _VcdList VcdList;
- typedef struct _VcdListNode VcdListNode;
-
- /* Defined fully in files_private.h */
- typedef struct _InfoVcd_tag InfoVcd_t;
- typedef struct _EntriesVcd_tag EntriesVcd_t;
- typedef struct _LotVcd_tag LotVcd_t;
-
- typedef struct _PsdPlayListDescriptor_tag PsdPlayListDescriptor_t;
- typedef struct _PsdSelectionListDescriptor_tag PsdSelectionListDescriptor_t;
-
- /* Overall data structure representing a VideoCD object.
- Defined fully in info_private.h.
- */
- typedef struct _VcdObj VcdObj;
-
- /* enum defining supported VideoCD types */
- typedef enum
- {
- VCD_TYPE_INVALID = 0,
- VCD_TYPE_VCD,
- VCD_TYPE_VCD11,
- VCD_TYPE_VCD2,
- VCD_TYPE_SVCD,
- VCD_TYPE_HQVCD
- }
- vcd_type_t;
-
- /* The type of an playback control list ID (LID). */
- typedef uint16_t lid_t;
-
- /* The type of a segment number 0..1980 segment items possible. */
- typedef uint16_t segnum_t;
-
- /* (0,0) == upper left , (255,255) == lower right
- setting all to zero disables area */
- PRAGMA_BEGIN_PACKED
- struct psd_area_t
- {
- uint8_t x1; /* upper left */
- uint8_t y1; /* upper left */
- uint8_t x2; /* lower right */
- uint8_t y2; /* lower right */
- } GNUC_PACKED;
- PRAGMA_END_PACKED
-
-#define struct_psd_area_t_SIZEOF 4
-
-#define PSD_OFS_DISABLED 0xffff
-#define PSD_OFS_MULTI_DEF 0xfffe
-#define PSD_OFS_MULTI_DEF_NO_NUM 0xfffd
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __VCD_TYPES_H__ */
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libvcd/libvcd/version.h b/src/input/vcd/libvcd/libvcd/version.h
deleted file mode 100644
index 0cd2096d3..000000000
--- a/src/input/vcd/libvcd/libvcd/version.h
+++ /dev/null
@@ -1,11 +0,0 @@
-/* $Id: version.h,v 1.4 2005/04/27 23:28:42 rockyb Exp $ */
-/** \file version.h
- * \brief A file simply containing the library version number.
- */
-
-/*! LIBVCD_VERSION can as a string in programs to show what version is used. */
-#define LIBVCD_VERSION "0.7.21-"
-
-/*! LIBCDIO_VERSION_NUM can be used for testing in the C preprocessor */
-#define LIBVCD_VERSION_NUM 21
-
diff --git a/src/input/vcd/libvcd/logging.c b/src/input/vcd/libvcd/logging.c
deleted file mode 100644
index 652a8090b..000000000
--- a/src/input/vcd/libvcd/logging.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- $Id: logging.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
- Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <stdlib.h>
-#include <stdarg.h>
-#include <stdio.h>
-
-/* Public headers */
-#include <libvcd/logging.h>
-
-/* Private headers */
-#include "vcd_assert.h"
-
-static const char _rcsid[] = "$Id: logging.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $";
-
-vcd_log_level_t vcd_loglevel_default = VCD_LOG_WARN;
-
-static void
-default_vcd_log_handler (vcd_log_level_t level, const char message[])
-{
- switch (level)
- {
- case VCD_LOG_ERROR:
- if (level >= vcd_loglevel_default) {
- fprintf (stderr, "**ERROR: %s\n", message);
- fflush (stderr);
- exit (EXIT_FAILURE);
- }
- break;
- case VCD_LOG_DEBUG:
- if (level >= vcd_loglevel_default) {
- fprintf (stdout, "--DEBUG: %s\n", message);
- }
- break;
- case VCD_LOG_WARN:
- if (level >= vcd_loglevel_default) {
- fprintf (stdout, "++ WARN: %s\n", message);
- }
- break;
- case VCD_LOG_INFO:
- if (level >= vcd_loglevel_default) {
- fprintf (stdout, " INFO: %s\n", message);
- }
- break;
- case VCD_LOG_ASSERT:
- if (level >= vcd_loglevel_default) {
- fprintf (stderr, "!ASSERT: %s\n", message);
- fflush (stderr);
- }
- abort ();
- break;
- default:
- vcd_assert_not_reached ();
- break;
- }
-
- fflush (stdout);
-}
-
-static vcd_log_handler_t _handler = default_vcd_log_handler;
-
-vcd_log_handler_t
-vcd_log_set_handler (vcd_log_handler_t new_handler)
-{
- vcd_log_handler_t old_handler = _handler;
-
- _handler = new_handler;
-
- return old_handler;
-}
-
-static void
-vcd_logv (vcd_log_level_t level, const char format[], va_list args)
-{
- char buf[1024] = { 0, };
- static int in_recursion = 0;
-
- if (in_recursion)
- vcd_assert_not_reached ();
-
- in_recursion = 1;
-
- vsnprintf(buf, sizeof(buf)-1, format, args);
-
- _handler(level, buf);
-
- in_recursion = 0;
-}
-
-void
-vcd_log (vcd_log_level_t level, const char format[], ...)
-{
- va_list args;
- va_start (args, format);
- vcd_logv (level, format, args);
- va_end (args);
-}
-
-#define VCD_LOG_TEMPLATE(level, LEVEL) \
-void \
-vcd_ ## level (const char format[], ...) \
-{ \
- va_list args; \
- va_start (args, format); \
- vcd_logv (VCD_LOG_ ## LEVEL, format, args); \
- va_end (args); \
-}
-
-VCD_LOG_TEMPLATE(debug, DEBUG)
-VCD_LOG_TEMPLATE(info, INFO)
-VCD_LOG_TEMPLATE(warn, WARN)
-VCD_LOG_TEMPLATE(error, ERROR)
-
-#undef VCD_LOG_TEMPLATE
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libvcd/mpeg.c b/src/input/vcd/libvcd/mpeg.c
deleted file mode 100644
index 545a44fbc..000000000
--- a/src/input/vcd/libvcd/mpeg.c
+++ /dev/null
@@ -1,1177 +0,0 @@
-/*
- $Id: mpeg.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <stdio.h>
-
-#include <cdio/cdio.h>
-
-/* Private headers */
-#include "bitvec.h"
-#include "mpeg.h"
-#include "util.h"
-
-static const char _rcsid[] = "$Id: mpeg.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $";
-
-#define MPEG_START_CODE_PATTERN ((uint32_t) 0x00000100)
-#define MPEG_START_CODE_MASK ((uint32_t) 0xffffff00)
-
-#define MPEG_PICTURE_CODE ((uint32_t) 0x00000100)
-/* [...slice codes... 0x1a7] */
-
-#define MPEG_USER_CODE ((uint32_t) 0x000001b2)
-#define MPEG_SEQUENCE_CODE ((uint32_t) 0x000001b3)
-#define MPEG_EXT_CODE ((uint32_t) 0x000001b5)
-#define MPEG_SEQ_END_CODE ((uint32_t) 0x000001b7)
-#define MPEG_GOP_CODE ((uint32_t) 0x000001b8)
-#define MPEG_PROGRAM_END_CODE ((uint32_t) 0x000001b9)
-#define MPEG_PACK_HEADER_CODE ((uint32_t) 0x000001ba)
-#define MPEG_SYSTEM_HEADER_CODE ((uint32_t) 0x000001bb)
-#define MPEG_PRIVATE_1_CODE ((uint32_t) 0x000001bd)
-#define MPEG_PAD_CODE ((uint32_t) 0x000001be)
-
-#define MPEG_AUDIO_C0_CODE ((uint32_t) 0x000001c0) /* default */
-#define MPEG_AUDIO_C1_CODE ((uint32_t) 0x000001c1) /* 2nd audio stream id (dual channel) */
-#define MPEG_AUDIO_C2_CODE ((uint32_t) 0x000001c2) /* 3rd audio stream id (surround sound) */
-
-#define MPEG_VIDEO_E0_CODE ((uint32_t) 0x000001e0) /* motion */
-#define MPEG_VIDEO_E1_CODE ((uint32_t) 0x000001e1) /* lowres still */
-#define MPEG_VIDEO_E2_CODE ((uint32_t) 0x000001e2) /* hires still */
-
-#define PICT_TYPE_I 1
-#define PICT_TYPE_P 2
-#define PICT_TYPE_B 3
-#define PICT_TYPE_D 4
-
-static struct {
- mpeg_norm_t norm;
- unsigned hsize;
- unsigned vsize;
- int frate_idx;
-} const norm_table[] = {
- { MPEG_NORM_FILM, 352, 240, 1 },
- { MPEG_NORM_PAL, 352, 288, 3 },
- { MPEG_NORM_NTSC, 352, 240, 4 },
- { MPEG_NORM_PAL_S, 480, 576, 3 },
- { MPEG_NORM_NTSC_S, 480, 480, 4 },
- { MPEG_NORM_OTHER, }
-};
-
-static const double frame_rates[16] = {
- 0.0, 24000.0/1001, 24.0, 25.0,
- 30000.0/1001, 30.0, 50.0, 60000.0/1001,
- 60.0, 0.0,
-};
-
-#ifdef DEBUG
-# define MARKER(buf, offset) \
- vcd_assert (vcd_bitvec_read_bit (buf, offset) == 1)
-#else
-# define MARKER(buf, offset) \
- { if (GNUC_UNLIKELY (vcd_bitvec_read_bit (buf, offset) != 1)) vcd_debug ("mpeg: some marker is not set..."); }
-#endif
-
-static inline bool
-_start_code_p (uint32_t code)
-{
- return (code & MPEG_START_CODE_MASK) == MPEG_START_CODE_PATTERN;
-}
-
-static inline int
-_vid_streamid_idx (uint8_t streamid)
-{
- switch (streamid | MPEG_START_CODE_PATTERN)
- {
- case MPEG_VIDEO_E0_CODE:
- return 0;
- break;
-
- case MPEG_VIDEO_E1_CODE:
- return 1;
- break;
-
- case MPEG_VIDEO_E2_CODE:
- return 2;
- break;
-
- default:
- vcd_assert_not_reached ();
- break;
- }
-
- return -1;
-}
-
-static inline int
-_aud_streamid_idx (uint8_t streamid)
-{
- switch (streamid | MPEG_START_CODE_PATTERN)
- {
- case MPEG_AUDIO_C0_CODE:
- return 0;
- break;
-
- case MPEG_AUDIO_C1_CODE:
- return 1;
- break;
-
- case MPEG_AUDIO_C2_CODE:
- return 2;
- break;
-
- default:
- vcd_assert_not_reached ();
- break;
- }
-
- return -1;
-}
-
-/* used for SCR, PTS and DTS */
-static inline uint64_t
-_parse_timecode (const uint8_t *buf, unsigned *offset)
-{
- uint64_t _retval;
-
- _retval = vcd_bitvec_read_bits (buf, offset, 3);
-
- MARKER (buf, offset);
-
- _retval <<= 15;
- _retval |= vcd_bitvec_read_bits (buf, offset, 15);
-
- MARKER (buf, offset);
-
- _retval <<= 15;
- _retval |= vcd_bitvec_read_bits (buf, offset, 15);
-
- MARKER (buf, offset);
-
- return _retval;
-}
-
-static void
-_parse_sequence_header (uint8_t streamid, const uint8_t *buf,
- VcdMpegStreamCtx *state)
-{
- unsigned offset = 0;
- unsigned hsize, vsize, aratio, frate, brate, bufsize, constr;
- const uint8_t *data = buf;
- const int vid_idx = _vid_streamid_idx (streamid);
-
- const double aspect_ratios[16] =
- {
- 0.0000, 1.0000, 0.6735, 0.7031,
- 0.7615, 0.8055, 0.8437, 0.8935,
- 0.9375, 0.9815, 1.0255, 1.0695,
- 1.1250, 1.1575, 1.2015, 0.0000
- };
-
- if (state->stream.shdr[vid_idx].seen) /* we have it already */
- return;
-
- hsize = vcd_bitvec_read_bits (data, &offset, 12);
-
- vsize = vcd_bitvec_read_bits (data, &offset, 12);
-
- aratio = vcd_bitvec_read_bits (data, &offset, 4);
-
- frate = vcd_bitvec_read_bits (data, &offset, 4);
-
- brate = vcd_bitvec_read_bits (data, &offset, 18);
-
- MARKER (data, &offset);
-
- bufsize = vcd_bitvec_read_bits (data, &offset, 10);
-
- constr = vcd_bitvec_read_bits (data, &offset, 1);
-
- /* skip intra quantizer matrix */
-
- if (vcd_bitvec_read_bits (data, &offset, 1))
- offset += 64 << 3;
-
- /* skip non-intra quantizer matrix */
-
- if (vcd_bitvec_read_bits (data, &offset, 1))
- offset += 64 << 3;
-
- state->stream.shdr[vid_idx].hsize = hsize;
- state->stream.shdr[vid_idx].vsize = vsize;
- state->stream.shdr[vid_idx].aratio = aspect_ratios[aratio];
- state->stream.shdr[vid_idx].frate = frame_rates[frate];
- state->stream.shdr[vid_idx].bitrate = 400 * brate;
- state->stream.shdr[vid_idx].vbvsize = bufsize * 16 * 1024;
- state->stream.shdr[vid_idx].constrained_flag = (constr != 0);
-
- state->stream.shdr[vid_idx].seen = true;
-}
-
-static void
-_parse_gop_header (uint8_t streamid, const uint8_t *buf,
- VcdMpegStreamCtx *state)
-{
- const uint8_t *data = buf;
- unsigned offset = 0;
-
- bool drop_flag;
- /* bool close_gop; */
- /* bool broken_link; */
-
- unsigned hour, minute, second, frame;
-
- drop_flag = vcd_bitvec_read_bits(data, &offset, 1) != 0;
-
- hour = vcd_bitvec_read_bits(data, &offset, 5);
-
- minute = vcd_bitvec_read_bits(data, &offset, 6);
-
- MARKER (data, &offset);
-
- second = vcd_bitvec_read_bits(data, &offset, 6);
-
- frame = vcd_bitvec_read_bits(data, &offset, 6);
-
- /* close_gop = vcd_bitvec_read_bits(data, &offset, 1) != 0; */
-
- /* broken_link = vcd_bitvec_read_bits(data, &offset, 1) != 0; */
-
- state->packet.gop = true;
- state->packet.gop_timecode.h = hour;
- state->packet.gop_timecode.m = minute;
- state->packet.gop_timecode.s = second;
- state->packet.gop_timecode.f = frame;
-}
-
-static inline void
-_check_scan_data (const char str[], const msf_t *msf,
- VcdMpegStreamCtx *state)
-{
- char tmp[16];
-
- if (state->stream.scan_data_warnings > VCD_MPEG_SCAN_DATA_WARNS)
- return;
-
- if (state->stream.scan_data_warnings == VCD_MPEG_SCAN_DATA_WARNS)
- {
- vcd_warn ("mpeg user scan data: from now on, scan information "
- "data errors will not be reported anymore---consider"
- " enabling the 'update scan offsets' option, "
- "if it is not enabled already!");
- state->stream.scan_data_warnings++;
- return;
- }
-
- if (msf->m == 0xff
- && msf->s == 0xff
- && msf->f == 0xff)
- return;
-
- if ((msf->s & 0x80) == 0
- || (msf->f & 0x80) == 0)
- {
- snprintf (tmp, sizeof (tmp), "%.2x:%.2x.%.2x", msf->m, msf->s, msf->f);
-
- vcd_warn ("mpeg user scan data: msb of second or frame field "
- "not set for '%s': [%s]", str, tmp);
-
- state->stream.scan_data_warnings++;
-
- return;
- }
-
- if ((msf->m >> 4) > 9
- || ((0x80 ^ msf->s) >> 4) > 9
- || ((0x80 ^ msf->f) >> 4) > 9
- || (msf->m & 0xf) > 9
- || (msf->s & 0xf) > 9
- || (msf->f & 0xf) > 9)
- {
- snprintf (tmp, sizeof (tmp), "%.2x:%.2x.%.2x",
- msf->m, 0x80 ^ msf->s, 0x80 ^ msf->f);
-
- vcd_warn ("mpeg user scan data: one or more BCD fields out of range "
- "for '%s': [%s]", str, tmp);
-
- state->stream.scan_data_warnings++;
- }
-}
-
-static void
-_parse_user_data (uint8_t streamid, const void *buf, unsigned len,
- unsigned offset,
- VcdMpegStreamCtx *state)
-{
- unsigned pos = 0;
- PRAGMA_BEGIN_PACKED
- struct {
- uint8_t tag;
- uint8_t len;
- uint8_t data[EMPTY_ARRAY_SIZE];
- } GNUC_PACKED const *udg = buf;
- PRAGMA_END_PACKED
-
- if (udg->tag == 0x00) /* if first tag's already 0x00 */
- {
- vcd_debug ("strange (possibly non-compliant) user_data seen...");
- }
- else while (pos + 2 < len)
- {
- if (udg->tag == 0x00)
- break;
-
- if (pos + udg->len >= len)
- break;
-
- if (udg->len < 2)
- break;
-
- switch (udg->tag)
- {
- case 0x00:
- vcd_assert_not_reached ();
- break;
-
- case 0x10: /* scan information */
- {
- struct vcd_mpeg_scan_data_t *usdi = (void *) udg;
- vcd_assert (sizeof (struct vcd_mpeg_scan_data_t) == 14);
-
- if (GNUC_UNLIKELY (usdi->len != 14))
- {
- vcd_warn ("invalid user scan data length (%d != 14)", usdi->len);
- break;
- }
-
- vcd_assert (usdi->len == 14);
- _check_scan_data ("previous_I_offset", &usdi->prev_ofs, state);
- _check_scan_data ("next_I_offset ", &usdi->next_ofs, state);
- _check_scan_data ("backward_I_offset", &usdi->back_ofs, state);
- _check_scan_data ("forward_I_offset ", &usdi->forw_ofs, state);
-
- state->packet.scan_data_ptr = usdi;
- state->stream.scan_data++;
- }
- break;
-
- case 0x11: /* closed caption data */
- vcd_debug ("closed caption data seen -- not supported yet (len = %d)", udg->len);
- break;
-
- default:
- vcd_warn ("unknown user data tag id 0x%.2x encountered", udg->tag);
- return; /* since we cannot rely on udg->len anymore... */
- break;
- }
-
-
- pos += udg->len;
- vcd_assert (udg->len >= 2);
- udg = (void *) &udg->data[udg->len - 2];
- }
-
- vcd_assert (pos <= len);
-}
-
-static int
-_analyze_pes_header (const uint8_t *buf, int len,
- VcdMpegStreamCtx *state)
-{
- bool _has_pts = false;
- bool _has_dts = false;
- int64_t pts = 0;
- mpeg_vers_t pes_mpeg_ver = MPEG_VERS_INVALID;
-
- int pos;
-
- if (vcd_bitvec_peek_bits (buf, 0, 2) == 2) /* %10 - ISO13818-1 */
- {
- unsigned pos2 = 0;
-
- pes_mpeg_ver = MPEG_VERS_MPEG2;
-
- pos2 += 2;
-
- pos2 += 2; /* PES_scrambling_control */
- pos2++; /* PES_priority */
- pos2++; /* data_alignment_indicator */
- pos2++; /* copyright */
- pos2++; /* original_or_copy */
-
- switch (vcd_bitvec_read_bits (buf, &pos2, 2)) /* PTS_DTS_flags */
- {
- case 2: /* %10 */
- _has_pts = true;
- break;
-
- case 3: /* %11 */
- _has_dts = _has_pts = true;
- break;
-
- default:
- /* NOOP */
- break;
- }
-
- pos2++; /* ESCR_flag */
-
- pos2++; /* */
- pos2++; /* */
- pos2++; /* */
- pos2++; /* */
-
- pos2++; /* PES_extension_flag */
-
- pos = vcd_bitvec_read_bits (buf, &pos2, 8); /* PES_header_data_length */
- pos += pos2 >> 3;
-
- if (_has_pts && _has_dts)
- {
- vcd_assert (vcd_bitvec_peek_bits (buf, pos2, 4) == 3); /* %0011 */
- pos2 += 4;
-
- pts = _parse_timecode (buf, &pos2);
-
- vcd_assert (vcd_bitvec_peek_bits (buf, pos2, 4) == 1); /* %0001 */
- pos2 += 4;
-
- /* dts = */ _parse_timecode (buf, &pos2);
- }
- else if (_has_pts)
- {
- vcd_assert (vcd_bitvec_peek_bits (buf, pos2, 4) == 2); /* %0010 */
- pos2 += 4;
-
- pts = _parse_timecode (buf, &pos2);
- }
- }
- else /* ISO11172-1 */
- {
- unsigned pos2 = 0;
-
- pes_mpeg_ver = MPEG_VERS_MPEG1;
-
- /* get rid of stuffing bytes */
- while (((pos2 + 8) < (len << 3))
- && vcd_bitvec_peek_bits (buf, pos2, 8) == 0xff)
- pos2 += 8;
-
- if (vcd_bitvec_peek_bits (buf, pos2, 2) == 1) /* %01 */
- {
- pos2 += 2;
-
- pos2++; /* STD_buffer_scale */
- pos2 += 13; /* STD_buffer_size */
- }
-
- switch (vcd_bitvec_peek_bits (buf, pos2, 4))
- {
- case 0x2: /* %0010 */
- pos2 += 4;
- _has_pts = true;
-
- pts = _parse_timecode (buf, &pos2);
- break;
-
- case 0x3: /* %0011 */
- pos2 += 4;
-
- _has_dts = _has_pts = true;
- pts = _parse_timecode (buf, &pos2);
-
- vcd_assert (vcd_bitvec_peek_bits (buf, pos2, 4) == 1); /* %0001 */
- pos2 += 4;
-
- /* dts = */ _parse_timecode (buf, &pos2);
- break;
-
- case 0x0: /* %0000 */
- vcd_assert (vcd_bitvec_peek_bits (buf, pos2, 8) == 0x0f);
- pos2 += 8;
- break;
-
- case 0xf: /* %1111 - actually a syntax error! */
- vcd_assert (vcd_bitvec_peek_bits (buf, pos2, 8) == 0xff);
- vcd_warn ("Unexpected stuffing byte noticed in ISO11172 PES header!");
- pos2 += 8;
- break;
-
- default:
- vcd_error ("Error in ISO11172 PES header");
- break;
- }
-
- pos = pos2 >> 3;
- }
-
- if (_has_pts)
- {
- double pts2;
-
- pts2 = (double) pts / 90000.0;
-
- if (!state->stream.seen_pts)
- {
- state->stream.max_pts = state->stream.min_pts = pts2;
- state->stream.seen_pts = true;
- }
- else
- {
- state->stream.max_pts = MAX (state->stream.max_pts, pts2);
- state->stream.min_pts = MIN (state->stream.min_pts, pts2);
- }
-
- state->packet.has_pts = true;
- state->packet.pts = pts2;
- }
-
- if (state->stream.version != pes_mpeg_ver)
- vcd_warn ("pack header mpeg version does not match pes header mpeg version");
-
- return pos;
-}
-
-static void
-_analyze_audio_pes (uint8_t streamid, const uint8_t *buf, int len, bool only_pts,
- VcdMpegStreamCtx *state)
-{
- const int aud_idx = _aud_streamid_idx (streamid);
- unsigned bitpos;
-
- vcd_assert (aud_idx != -1);
-
- bitpos = _analyze_pes_header (buf, len, state);
-
- /* if only pts extraction was needed, we are done here... */
- if (only_pts)
- return;
-
- if (state->stream.ahdr[aud_idx].seen)
- return;
-
- bitpos <<= 3;
-
- while (bitpos <= (len << 3))
- {
- unsigned syncword = vcd_bitvec_peek_bits (buf, bitpos, 12);
-
- if (syncword != 0xfff)
- {
- bitpos += 8;
- continue;
- }
-
- bitpos += 12;
-
- if (GNUC_UNLIKELY (!vcd_bitvec_read_bits (buf, &bitpos, 1)))
- {
- vcd_debug ("non-MPEG1 audio stream header seen");
- break;
- }
-
- switch (vcd_bitvec_read_bits (buf, &bitpos, 2)) /* layer */
- {
- case 3: /* %11 */
- state->stream.ahdr[aud_idx].layer = 1;
- break;
- case 2: /* %10 */
- state->stream.ahdr[aud_idx].layer = 2;
- break;
- case 1: /* %01 */
- state->stream.ahdr[aud_idx].layer = 3;
- break;
- case 0: /* %00 */
- state->stream.ahdr[aud_idx].layer = 0;
- break;
- }
-
- bitpos++; /* protection_bit */
-
- {
- const int bits = vcd_bitvec_read_bits (buf, &bitpos, 4);
-
- const unsigned bit_rates[4][16] = {
- {0, },
- {0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 0},
- {0, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 0},
- {0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 0}
- };
-
- vcd_assert (IN(state->stream.ahdr[aud_idx].layer, 0, 3));
- vcd_assert (IN(bits, 0, 15));
-
- state->stream.ahdr[aud_idx].bitrate = 1024 * bit_rates[state->stream.ahdr[aud_idx].layer][bits];
- }
-
- switch (vcd_bitvec_read_bits (buf, &bitpos, 2)) /* sampling_frequency */
- {
- case 0: /* %00 */
- state->stream.ahdr[aud_idx].sampfreq = 44100;
- break;
- case 1: /* %01 */
- state->stream.ahdr[aud_idx].sampfreq = 48000;
- break;
- case 2: /* %10 */
- state->stream.ahdr[aud_idx].sampfreq = 32000;
- break;
- case 3: /* %11 */
- state->stream.ahdr[aud_idx].sampfreq = 0;
- break;
- }
-
- bitpos++; /* padding_bit */
-
- bitpos++; /* private_bit */
-
- state->stream.ahdr[aud_idx].mode = 1 + vcd_bitvec_read_bits (buf, &bitpos, 2); /* mode */
-
- state->stream.ahdr[aud_idx].seen = true;
-
- /* we got the info, let's jump outta here */
- break;
- }
-}
-
-static void
-_analyze_video_pes (uint8_t streamid, const uint8_t *buf, int len, bool only_pts,
- VcdMpegStreamCtx *state)
-{
- const int vid_idx = _vid_streamid_idx (streamid);
-
- int pos, pes_header;
- int sequence_header_pos = -1;
- int gop_header_pos = -1;
- int ipicture_header_pos = -1;
-
- vcd_assert (vid_idx != -1);
-
- pes_header = pos = _analyze_pes_header (buf, len, state);
-
- /* if only pts extraction was needed, we are done here... */
- if (only_pts)
- return;
-
- while (pos + 4 <= len)
- {
- uint32_t code = vcd_bitvec_peek_bits32 (buf, pos << 3);
-
- if (!_start_code_p (code))
- {
- pos++;
- continue;
- }
-
- switch (code)
- {
- case MPEG_PICTURE_CODE:
- pos += 4;
-
- if (vcd_bitvec_peek_bits (buf, (pos << 3) + 10, 3) == 1)
- ipicture_header_pos = pos;
- break;
-
- case MPEG_SEQUENCE_CODE:
- pos += 4;
- sequence_header_pos = pos;
- _parse_sequence_header (streamid, buf + pos, state);
- break;
-
- case MPEG_GOP_CODE:
- pos += 4;
- if (pos + 4 > len)
- break;
- gop_header_pos = pos;
- _parse_gop_header (streamid, buf + pos, state);
- state->packet.gop = true;
- break;
-
- case MPEG_USER_CODE:
- pos += 4;
- if (pos + 4 > len)
- break;
- _parse_user_data (streamid, buf + pos, len - pos, pos, state);
- break;
-
- case MPEG_EXT_CODE:
- default:
- pos += 4;
- break;
- }
- }
-
- /* decide whether this packet qualifies as access point */
- state->packet.aps = APS_NONE; /* paranoia */
-
- if (state->packet.has_pts
- && ipicture_header_pos != -1)
- {
- enum aps_t _aps_type = APS_NONE;
-
- switch (state->stream.version)
- {
- case MPEG_VERS_MPEG1:
- case MPEG_VERS_MPEG2:
- if (sequence_header_pos != -1
- && sequence_header_pos < gop_header_pos
- && gop_header_pos < ipicture_header_pos)
- _aps_type = (sequence_header_pos - 4 == pes_header) ? APS_ASGI : APS_SGI;
- else if (gop_header_pos != 1
- && gop_header_pos < ipicture_header_pos)
- _aps_type = APS_GI;
- else
- _aps_type = APS_I;
-
- break;
-
- default:
- break;
- }
-
- if (_aps_type)
- {
- const double pts2 = state->packet.pts;
-
- if (state->stream.shdr[vid_idx].last_aps_pts > pts2)
- vcd_warn ("APS' pts seems out of order (actual pts %f, last seen pts %f) "
- "-- ignoring this aps",
- pts2, state->stream.shdr[vid_idx].last_aps_pts);
- else
- {
- state->packet.aps_idx = vid_idx;
- state->packet.aps = _aps_type;
- state->packet.aps_pts = pts2;
- state->stream.shdr[vid_idx].last_aps_pts = pts2;
- }
- }
- }
-}
-
-static void
-_register_streamid (uint8_t streamid, VcdMpegStreamCtx *state)
-{
- const uint32_t code = MPEG_START_CODE_PATTERN | streamid;
-
- switch (code)
- {
- case MPEG_VIDEO_E0_CODE:
- case MPEG_VIDEO_E1_CODE:
- case MPEG_VIDEO_E2_CODE:
- state->packet.video[_vid_streamid_idx (streamid)] = true;
- break;
-
- case MPEG_AUDIO_C0_CODE:
- case MPEG_AUDIO_C1_CODE:
- case MPEG_AUDIO_C2_CODE:
- state->packet.audio[_aud_streamid_idx (streamid)] = true;
- break;
-
- case MPEG_PAD_CODE:
- state->packet.padding = true;
- break;
-
- case MPEG_SYSTEM_HEADER_CODE:
- state->packet.system_header = true;
- break;
- }
-}
-
-static void
-_analyze_system_header (const uint8_t *buf, int len,
- VcdMpegStreamCtx *state)
-{
- unsigned bitpos = 0;
-
- MARKER (buf, &bitpos);
-
- bitpos += 22; /* rate_bound */
-
- MARKER (buf, &bitpos);
-
- bitpos += 6; /* audio_bound */
-
- bitpos++; /* fixed_flag */
- bitpos++; /* CSPS_flag */
- bitpos++; /* system_audio_lock_flag */
- bitpos++; /* system_video_lock_flag */
-
- MARKER (buf, &bitpos);
-
- bitpos += 5; /* video_bound */
-
- bitpos += 1; /* packet_rate_restriction_flag -- only ISO 13818-1 */
- bitpos += 7; /* reserved */
-
- while (vcd_bitvec_peek_bits (buf, bitpos, 1) == 1
- && bitpos <= (len << 3))
- {
- const uint8_t stream_id = vcd_bitvec_read_bits (buf, &bitpos, 8);
-
- bitpos += 2; /* %11 */
-
- bitpos++; /* P-STD_buffer_bound_scale */
- bitpos += 13; /* P-STD_buffer_size_bound */
-
- _register_streamid (stream_id, state);
- }
-
- vcd_assert (bitpos <= (len << 3));
-}
-
-static void
-_analyze_private_1_stream (const uint8_t *buf, int len,
- VcdMpegStreamCtx *state)
-{
- unsigned bitpos = _analyze_pes_header (buf, len, state);
- int ogt_idx = -1;
-
- uint8_t private_data_id;
-
- bitpos <<= 3;
-
- private_data_id = vcd_bitvec_read_bits (buf, &bitpos, 8);
-
- switch (private_data_id)
- {
- uint8_t sub_stream_id;
-
- case 0x00:
- case 0x01:
- case 0x02:
- case 0x03:
- /* CVD subs */
- ogt_idx = private_data_id;
-
- if (!state->stream.ogt[ogt_idx])
- vcd_debug ("Assuming CVD-style subtitles for data_id 0x%.2x in private stream 1", ogt_idx);
-
- break;
-
- case 0x70:
- /* SVCD OGT */
- sub_stream_id = vcd_bitvec_read_bits (buf, &bitpos, 8);
-
- if (sub_stream_id < 4)
- {
- ogt_idx = sub_stream_id;
- if (!state->stream.ogt[ogt_idx])
- vcd_debug ("subtitles detect for channel 0x%.2x", ogt_idx);
- }
- else
- vcd_warn ("sub_stream_id out of range (0x%.2x)", sub_stream_id);
- break;
-
- default:
- vcd_warn ("unknown private_data_id for private stream 1 seen (0x%.2x)",
- private_data_id);
- return;
- break;
- }
-
- if (ogt_idx >= 0)
- state->stream.ogt[ogt_idx] = state->packet.ogt[ogt_idx] = true;
-}
-
-int
-vcd_mpeg_parse_packet (const void *_buf, unsigned buflen, bool parse_pes,
- VcdMpegStreamCtx *ctx)
-{
- const uint8_t *buf = _buf;
- int pos;
-
- vcd_assert (buf != NULL);
- vcd_assert (ctx != NULL);
-
- /* clear packet info */
- memset (&(ctx->packet), 0, sizeof (ctx->packet));
-
- ctx->stream.packets++;
-
- for (pos = 0; pos < buflen && !buf[pos]; pos++);
-
- if (pos == buflen)
- {
- ctx->packet.zero = true;
- return buflen;
- }
-
- /* verify the packet begins with a pack header */
- if (vcd_bitvec_peek_bits32 (buf, 0) != MPEG_PACK_HEADER_CODE)
- {
- const uint32_t _code = vcd_bitvec_peek_bits32 (buf, 0);
-
- vcd_warn ("mpeg scan: pack header code (0x%8.8x) expected, "
- "but 0x%8.8x found (buflen = %d)",
- (unsigned int) MPEG_PACK_HEADER_CODE,
- (unsigned int) _code, buflen);
-
- ctx->stream.packets--;
-
- if (!ctx->stream.packets)
- {
- if (_code == MPEG_SEQUENCE_CODE)
- vcd_warn ("...this looks like a elementary video stream"
- " but a multiplexed program stream was required.");
-
- if ((0xfff00000 & _code) == 0xfff00000)
- vcd_warn ("...this looks like a elementary audio stream"
- " but a multiplexed program stream was required.");
-
- if (_code == 0x52494646)
- vcd_warn ("...this looks like a RIFF header"
- " but a plain multiplexed program stream was required.");
- }
- else if (_code == MPEG_PROGRAM_END_CODE)
- vcd_warn ("...PEM (program end marker) found instead of pack header;"
- " should be in last 4 bytes of pack");
-
- return 0;
- }
-
- /* take a look at the pack header */
- pos = 0;
-
- while (pos + 4 <= buflen)
- {
- uint32_t code = vcd_bitvec_peek_bits32 (buf, pos << 3);
-
- /* skip zero bytes... */
- if (!code)
- {
- pos += (pos + 4 == buflen) ? 4 : 2;
- continue;
- }
-
- /* continue until start code seen */
- if (!_start_code_p (code))
- {
- pos++;
- continue;
- }
-
- switch (code)
- {
- uint16_t size;
- int bits;
- unsigned bitpos;
-
- case MPEG_PACK_HEADER_CODE:
- if (pos)
- return pos;
-
- pos += 4;
-
- bitpos = pos << 3;
- bits = vcd_bitvec_peek_bits (buf, bitpos, 4);
-
- if (bits == 0x2) /* %0010 ISO11172-1 */
- {
- uint64_t _scr;
- uint32_t _muxrate;
-
- bitpos += 4;
-
- if (!ctx->stream.version)
- ctx->stream.version = MPEG_VERS_MPEG1;
-
- if (ctx->stream.version != MPEG_VERS_MPEG1)
- vcd_warn ("mixed mpeg versions?");
-
- _scr = _parse_timecode (buf, &bitpos);
-
- MARKER (buf, &bitpos);
-
- _muxrate = vcd_bitvec_read_bits (buf, &bitpos, 22);
-
- MARKER (buf, &bitpos);
-
- vcd_assert (bitpos % 8 == 0);
- pos = bitpos >> 3;
-
- ctx->packet.scr = _scr;
- ctx->stream.muxrate = ctx->packet.muxrate = _muxrate * 50 * 8;
- }
- else if (bits >> 2 == 0x1) /* %01xx ISO13818-1 */
- {
- uint64_t _scr;
- uint32_t _muxrate;
- int tmp;
-
- bitpos += 2;
-
- if (!ctx->stream.version)
- ctx->stream.version = MPEG_VERS_MPEG2;
-
- if (ctx->stream.version != MPEG_VERS_MPEG2)
- vcd_warn ("mixed mpeg versions?");
-
- _scr = _parse_timecode (buf, &bitpos);
-
- _scr *= 300;
- _scr += vcd_bitvec_read_bits (buf, &bitpos, 9); /* SCR ext */
-
- MARKER (buf, &bitpos);
-
- _muxrate = vcd_bitvec_read_bits (buf, &bitpos, 22);
-
- MARKER (buf, &bitpos);
- MARKER (buf, &bitpos);
-
- bitpos += 5; /* reserved */
-
- tmp = vcd_bitvec_read_bits (buf, &bitpos, 3) << 3;
-
- bitpos += tmp;
-
- vcd_assert (bitpos % 8 == 0);
- pos = bitpos >> 3;
-
- ctx->packet.scr = _scr;
- ctx->stream.muxrate = ctx->packet.muxrate = _muxrate * 50 * 8;
- }
- else
- {
- vcd_warn ("packet not recognized as either version 1 or 2 (%d)"
- " -- assuming v1", bits);
- }
-
- break;
-
- case MPEG_SYSTEM_HEADER_CODE:
- case MPEG_PAD_CODE:
- case MPEG_PRIVATE_1_CODE:
- case MPEG_VIDEO_E0_CODE:
- case MPEG_VIDEO_E1_CODE:
- case MPEG_VIDEO_E2_CODE:
- case MPEG_AUDIO_C0_CODE:
- case MPEG_AUDIO_C1_CODE:
- case MPEG_AUDIO_C2_CODE:
- pos += 4;
- size = vcd_bitvec_peek_bits16 (buf, pos << 3);
- pos += 2;
-
- if (pos + size > buflen)
- {
- vcd_warn ("packet length beyond buffer"
- " (pos = %d + size = %d > buflen = %d) "
- "-- stream may be truncated or packet length > 2324 bytes!",
- pos, size, buflen);
- ctx->stream.packets--;
- return 0;
- }
-
- _register_streamid (code & 0xff, ctx);
-
- switch (code)
- {
- case MPEG_SYSTEM_HEADER_CODE:
- _analyze_system_header (buf + pos, size, ctx);
- break;
-
- case MPEG_VIDEO_E0_CODE:
- case MPEG_VIDEO_E1_CODE:
- case MPEG_VIDEO_E2_CODE:
- _analyze_video_pes (code & 0xff, buf + pos, size, !parse_pes, ctx);
- break;
-
- case MPEG_AUDIO_C0_CODE:
- case MPEG_AUDIO_C1_CODE:
- case MPEG_AUDIO_C2_CODE:
- _analyze_audio_pes (code & 0xff, buf + pos, size, !parse_pes, ctx);
- break;
-
- case MPEG_PRIVATE_1_CODE:
- _analyze_private_1_stream (buf + pos, size, ctx);
- break;
- }
-
- pos += size;
- break;
-
- case MPEG_PROGRAM_END_CODE:
- ctx->packet.pem = true;
- pos += 4;
- break;
-
- case MPEG_PICTURE_CODE:
- pos += 3;
- break;
-
- default:
- vcd_debug ("unexpected start code 0x%8.8x", (unsigned int) code);
- pos += 4;
- break;
- }
- }
-
- if (pos != buflen)
- vcd_debug ("pos != buflen (%d != %d)", pos, buflen); /* fixme? */
-
- return buflen;
-}
-
-mpeg_norm_t
-vcd_mpeg_get_norm (const struct vcd_mpeg_stream_vid_info *_info)
-{
- int i;
-
- for (i = 0; norm_table[i].norm != MPEG_NORM_OTHER;i++)
- if (norm_table[i].hsize == _info->hsize
- && norm_table[i].vsize == _info->vsize
- && frame_rates[norm_table[i].frate_idx] == _info->frate)
- break;
-
- return norm_table[i].norm;
-}
-
-enum vcd_mpeg_packet_type
-vcd_mpeg_packet_get_type (const struct vcd_mpeg_packet_info *_info)
-{
- if (_info->video[0]
- || _info->video[1]
- || _info->video[2])
- return PKT_TYPE_VIDEO;
- else if (_info->audio[0]
- || _info->audio[1]
- || _info->audio[2])
- return PKT_TYPE_AUDIO;
- else if (_info->zero)
- return PKT_TYPE_ZERO;
- else if (_info->ogt[0]
- || _info->ogt[1]
- || _info->ogt[2]
- || _info->ogt[3])
- return PKT_TYPE_OGT;
- else if (_info->system_header || _info->padding)
- return PKT_TYPE_EMPTY;
-
- return PKT_TYPE_INVALID;
-}
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libvcd/mpeg.h b/src/input/vcd/libvcd/mpeg.h
deleted file mode 100644
index 2d28d2aef..000000000
--- a/src/input/vcd/libvcd/mpeg.h
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- $Id: mpeg.h,v 1.3 2005/01/01 02:43:59 rockyb Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifndef __VCD_MPEG_H__
-#define __VCD_MPEG_H__
-
-#include <string.h>
-
-/* Public headers */
-#include <libvcd/logging.h>
-#include <libvcd/types.h>
-
-/* Private headers */
-#include "data_structures.h"
-
-typedef enum {
- MPEG_VERS_INVALID = 0,
- MPEG_VERS_MPEG1 = 1,
- MPEG_VERS_MPEG2 = 2
-} mpeg_vers_t;
-
-PRAGMA_BEGIN_PACKED
-struct vcd_mpeg_scan_data_t {
- uint8_t tag;
- uint8_t len;
- msf_t prev_ofs;
- msf_t next_ofs;
- msf_t back_ofs;
- msf_t forw_ofs;
-} GNUC_PACKED;
-PRAGMA_END_PACKED
-
-#define struct_vcd_mpeg_scan_data_t_SIZEOF 14
-
-#define VCD_MPEG_SCAN_DATA_WARNS 8
-
-typedef struct {
- struct vcd_mpeg_packet_info {
- bool video[3];
- bool audio[3];
- bool ogt[4];
-
- bool padding;
- bool pem;
- bool zero;
- bool system_header;
-
- struct vcd_mpeg_scan_data_t *scan_data_ptr; /* points into actual packet memory! */
-
- enum aps_t {
- APS_NONE = 0,
- APS_I, /* iframe */
- APS_GI, /* gop + iframe */
- APS_SGI, /* sequence + gop + iframe */
- APS_ASGI /* aligned sequence + gop + iframe */
- } aps;
- double aps_pts;
- int aps_idx;
-
- bool has_pts;
- double pts;
-
- uint64_t scr;
- unsigned muxrate;
-
- bool gop;
- struct {
- uint8_t h, m, s, f;
- } gop_timecode;
- } packet;
-
- struct vcd_mpeg_stream_info {
- unsigned packets;
-
- mpeg_vers_t version;
-
- bool ogt[4];
-
- struct vcd_mpeg_stream_vid_info {
- bool seen;
- unsigned hsize;
- unsigned vsize;
- double aratio;
- double frate;
- unsigned bitrate;
- unsigned vbvsize;
- bool constrained_flag;
-
- CdioList *aps_list; /* filled up by vcd_mpeg_source */
- double last_aps_pts; /* temp, see ->packet */
-
- } shdr[3];
-
- struct vcd_mpeg_stream_aud_info {
- bool seen;
- unsigned layer;
- unsigned bitrate;
- unsigned sampfreq;
- enum {
- MPEG_STEREO = 1,
- MPEG_JOINT_STEREO,
- MPEG_DUAL_CHANNEL,
- MPEG_SINGLE_CHANNEL
- } mode;
- } ahdr[3];
-
- unsigned muxrate;
-
- bool seen_pts;
- double min_pts;
- double max_pts;
-
- double playing_time;
-
- unsigned scan_data;
- unsigned scan_data_warnings;
- } stream;
-} VcdMpegStreamCtx;
-
-int
-vcd_mpeg_parse_packet (const void *buf, unsigned buflen, bool parse_pes,
- VcdMpegStreamCtx *ctx);
-
-typedef enum {
- MPEG_NORM_OTHER,
- MPEG_NORM_PAL,
- MPEG_NORM_NTSC,
- MPEG_NORM_FILM,
- MPEG_NORM_PAL_S,
- MPEG_NORM_NTSC_S
-} mpeg_norm_t;
-
-mpeg_norm_t
-vcd_mpeg_get_norm (const struct vcd_mpeg_stream_vid_info *_info);
-
-enum vcd_mpeg_packet_type {
- PKT_TYPE_INVALID = 0,
- PKT_TYPE_VIDEO,
- PKT_TYPE_AUDIO,
- PKT_TYPE_OGT,
- PKT_TYPE_ZERO,
- PKT_TYPE_EMPTY
-};
-
-enum vcd_mpeg_packet_type
-vcd_mpeg_packet_get_type (const struct vcd_mpeg_packet_info *_info);
-
-struct vcd_mpeg_stream_vid_type {
- enum {
- VID_TYPE_NONE = 0,
- VID_TYPE_MOTION,
- VID_TYPE_STILL
- } type;
- enum {
- VID_NORM_OTHER = 0,
- VID_NORM_PAL,
- VID_NORM_NTSC
- } norm;
- enum {
- VID_RES_OTHER = 0,
- VID_RES_SIF,
- VID_RES_HALF_D1,
- VID_RES_2_3_D1,
- VID_RES_FULL_D2
- } resolution;
-};
-
-#endif /* __VCD_MPEG_H__ */
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libvcd/mpeg_stream.c b/src/input/vcd/libvcd/mpeg_stream.c
deleted file mode 100644
index e5466766a..000000000
--- a/src/input/vcd/libvcd/mpeg_stream.c
+++ /dev/null
@@ -1,487 +0,0 @@
-/*
- $Id: mpeg_stream.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $
-
- Copyright (C) 2000, 2004 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <cdio/cdio.h>
-#include <cdio/bytesex.h>
-
-#include <libvcd/logging.h>
-
-/* Private headers */
-#include "vcd_assert.h"
-#include "mpeg_stream.h"
-#include "data_structures.h"
-#include "mpeg.h"
-#include "util.h"
-
-static const char _rcsid[] = "$Id: mpeg_stream.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $";
-
-struct _VcdMpegSource
-{
- VcdDataSource *data_source;
-
- bool scanned;
-
- /* _get_packet cache */
- unsigned _read_pkt_pos;
- unsigned _read_pkt_no;
-
- struct vcd_mpeg_stream_info info;
-};
-
-/*
- * access functions
- */
-
-VcdMpegSource *
-vcd_mpeg_source_new (VcdDataSource *mpeg_file)
-{
- VcdMpegSource *new_obj;
-
- vcd_assert (mpeg_file != NULL);
-
- new_obj = _vcd_malloc (sizeof (VcdMpegSource));
-
- new_obj->data_source = mpeg_file;
- new_obj->scanned = false;
-
- return new_obj;
-}
-
-void
-vcd_mpeg_source_destroy (VcdMpegSource *obj, bool destroy_file_obj)
-{
- int i;
- vcd_assert (obj != NULL);
-
- if (destroy_file_obj)
- vcd_data_source_destroy (obj->data_source);
-
- for (i = 0; i < 3; i++)
- if (obj->info.shdr[i].aps_list)
- _cdio_list_free (obj->info.shdr[i].aps_list, true);
-
- free (obj);
-}
-
-const struct vcd_mpeg_stream_info *
-vcd_mpeg_source_get_info (VcdMpegSource *obj)
-{
- vcd_assert (obj != NULL);
-
- vcd_assert (obj->scanned);
-
- return &(obj->info);
-}
-
-long
-vcd_mpeg_source_stat (VcdMpegSource *obj)
-{
- vcd_assert (obj != NULL);
- vcd_assert (!obj->scanned);
-
- return obj->info.packets * 2324;
-}
-
-void
-vcd_mpeg_source_scan (VcdMpegSource *obj, bool strict_aps, bool fix_scan_info,
- vcd_mpeg_prog_cb_t callback, void *user_data)
-{
- unsigned length = 0;
- unsigned pos = 0;
- unsigned pno = 0;
- unsigned padbytes = 0;
- unsigned padpackets = 0;
- VcdMpegStreamCtx state;
- CdioListNode *n;
- vcd_mpeg_prog_info_t _progress = { 0, };
-
- vcd_assert (obj != NULL);
-
- if (obj->scanned)
- {
- vcd_debug ("already scanned... not rescanning");
- return;
- }
-
- vcd_assert (!obj->scanned);
-
- memset (&state, 0, sizeof (state));
-
- if (fix_scan_info)
- state.stream.scan_data_warnings = VCD_MPEG_SCAN_DATA_WARNS + 1;
-
- vcd_data_source_seek (obj->data_source, 0);
- length = vcd_data_source_stat (obj->data_source);
-
- if (callback)
- {
- _progress.length = length;
- callback (&_progress, user_data);
- }
-
-
- while (pos < length)
- {
- char buf[2324] = { 0, };
- int read_len = MIN (sizeof (buf), (length - pos));
- int pkt_len;
-
- vcd_data_source_read (obj->data_source, buf, read_len, 1);
-
- pkt_len = vcd_mpeg_parse_packet (buf, read_len, true, &state);
-
- if (!pkt_len)
- {
- if (!pno)
- vcd_error ("input mpeg stream has been deemed invalid -- aborting");
-
- vcd_warn ("bad packet at packet #%d (stream byte offset %d)"
- " -- remaining %d bytes of stream will be ignored",
- pno, pos, length - pos);
-
- pos = length; /* don't fall into assert... */
- break;
- }
-
- if (callback && (pos - _progress.current_pos) > (length / 100))
- {
- _progress.current_pos = pos;
- _progress.current_pack = pno;
- callback (&_progress, user_data);
- }
-
- switch (state.packet.aps)
- {
- case APS_NONE:
- break;
-
- case APS_I:
- case APS_GI:
- if (strict_aps)
- break; /* allow only if now strict aps */
-
- case APS_SGI:
- case APS_ASGI:
- {
- struct aps_data *_data = _vcd_malloc (sizeof (struct aps_data));
-
- _data->packet_no = pno;
- _data->timestamp = state.packet.aps_pts;
-
- if (!state.stream.shdr[state.packet.aps_idx].aps_list)
- state.stream.shdr[state.packet.aps_idx].aps_list = _cdio_list_new ();
-
- _cdio_list_append (state.stream.shdr[state.packet.aps_idx].aps_list, _data);
- }
- break;
-
- default:
- vcd_assert_not_reached ();
- break;
- }
-
- pos += pkt_len;
- pno++;
-
- if (pkt_len != read_len)
- {
- padbytes += (2324 - pkt_len);
-
- if (!padpackets)
- vcd_warn ("mpeg stream will be padded on the fly -- hope that's ok for you!");
-
- padpackets++;
-
- vcd_data_source_seek (obj->data_source, pos);
- }
- }
-
- vcd_data_source_close (obj->data_source);
-
- if (callback)
- {
- _progress.current_pos = pos;
- _progress.current_pack = pno;
- callback (&_progress, user_data);
- }
-
- vcd_assert (pos == length);
-
- obj->info = state.stream;
- obj->scanned = true;
-
- obj->info.playing_time = obj->info.max_pts - obj->info.min_pts;
-
- if (obj->info.min_pts)
- vcd_debug ("pts start offset %f (max pts = %f)",
- obj->info.min_pts, obj->info.max_pts);
-
- vcd_debug ("playing time %f", obj->info.playing_time);
-
- if (!state.stream.scan_data && state.stream.version == MPEG_VERS_MPEG2)
- vcd_warn ("mpeg stream contained no scan information (user) data");
-
- {
- int i;
-
- for (i = 0; i < 3; i++)
- if (obj->info.shdr[i].aps_list)
- _CDIO_LIST_FOREACH (n, obj->info.shdr[i].aps_list)
- {
- struct aps_data *_data = _cdio_list_node_data (n);
-
- _data->timestamp -= obj->info.min_pts;
- }
- }
-
- if (padpackets)
- vcd_warn ("autopadding requires to insert additional %d zero bytes"
- " into MPEG stream (due to %d unaligned packets of %d total)",
- padbytes, padpackets, state.stream.packets);
-
- obj->info.version = state.stream.version;
-}
-
-static double
-_approx_pts (CdioList *aps_list, uint32_t packet_no)
-{
- double retval = 0;
- CdioListNode *node;
-
- struct aps_data *_laps = NULL;
-
- double last_pts_ratio = 0;
-
- _CDIO_LIST_FOREACH (node, aps_list)
- {
- struct aps_data *_aps = _cdio_list_node_data (node);
-
- if (_laps)
- {
- long p = _aps->packet_no;
- double t = _aps->timestamp;
-
- p -= _laps->packet_no;
- t -= _laps->timestamp;
-
- last_pts_ratio = t / p;
- }
-
- if (_aps->packet_no >= packet_no)
- break;
-
- _laps = _aps;
- }
-
- retval = packet_no;
- retval -= _laps->packet_no;
- retval *= last_pts_ratio;
- retval += _laps->timestamp;
-
- return retval;
-}
-
-static void
-_set_scan_msf (msf_t *_msf, long lsn)
-{
- if (lsn == -1)
- {
- _msf->m = _msf->s = _msf->f = 0xff;
- return;
- }
-
- cdio_lba_to_msf (lsn, _msf);
- _msf->s |= 0x80;
- _msf->f |= 0x80;
-}
-
-static void
-_fix_scan_info (struct vcd_mpeg_scan_data_t *scan_data_ptr,
- unsigned packet_no, double pts, CdioList *aps_list)
-{
- CdioListNode *node;
- long _next = -1, _prev = -1, _forw = -1, _back = -1;
-
- _CDIO_LIST_FOREACH (node, aps_list)
- {
- struct aps_data *_aps = _cdio_list_node_data (node);
-
- if (_aps->packet_no == packet_no)
- continue;
- else if (_aps->packet_no < packet_no)
- {
- _prev = _aps->packet_no;
-
- if (pts - _aps->timestamp < 10 && _back == -1)
- _back = _aps->packet_no;
- }
- else if (_aps->packet_no > packet_no)
- {
- if (_next == -1)
- _next = _aps->packet_no;
-
- if (_aps->timestamp - pts < 10)
- _forw = _aps->packet_no;
- }
- }
-
- if (_back == -1)
- _back = packet_no;
-
- if (_forw == -1)
- _forw = packet_no;
-
- _set_scan_msf (&scan_data_ptr->prev_ofs, _prev);
- _set_scan_msf (&scan_data_ptr->next_ofs, _next);
- _set_scan_msf (&scan_data_ptr->back_ofs, _back);
- _set_scan_msf (&scan_data_ptr->forw_ofs, _forw);
-}
-
-int
-vcd_mpeg_source_get_packet (VcdMpegSource *obj, unsigned long packet_no,
- void *packet_buf, struct vcd_mpeg_packet_info *flags,
- bool fix_scan_info)
-{
- unsigned length;
- unsigned pos;
- unsigned pno;
- VcdMpegStreamCtx state;
-
- vcd_assert (obj != NULL);
- vcd_assert (obj->scanned);
- vcd_assert (packet_buf != NULL);
-
- if (packet_no >= obj->info.packets)
- {
- vcd_error ("invalid argument");
- return -1;
- }
-
- if (packet_no < obj->_read_pkt_no)
- {
- vcd_warn ("rewinding mpeg stream...");
- obj->_read_pkt_no = 0;
- obj->_read_pkt_pos = 0;
- }
-
- memset (&state, 0, sizeof (state));
- state.stream.seen_pts = true;
- state.stream.min_pts = obj->info.min_pts;
- state.stream.scan_data_warnings = VCD_MPEG_SCAN_DATA_WARNS + 1;
-
- pos = obj->_read_pkt_pos;
- pno = obj->_read_pkt_no;
- length = vcd_data_source_stat (obj->data_source);
-
- vcd_data_source_seek (obj->data_source, pos);
-
- while (pos < length)
- {
- char buf[2324] = { 0, };
- int read_len = MIN (sizeof (buf), (length - pos));
- int pkt_len;
-
- vcd_data_source_read (obj->data_source, buf, read_len, 1);
-
- pkt_len = vcd_mpeg_parse_packet (buf, read_len,
- fix_scan_info, &state);
-
- vcd_assert (pkt_len > 0);
-
- if (pno == packet_no)
- {
- /* optimized for sequential access,
- thus save pointer to next mpeg pack */
- obj->_read_pkt_pos = pos + pkt_len;
- obj->_read_pkt_no = pno + 1;
-
- if (fix_scan_info
- && state.packet.scan_data_ptr
- && obj->info.version == MPEG_VERS_MPEG2)
- {
- int vid_idx = 0;
- double _pts;
-
- if (state.packet.video[2])
- vid_idx = 2;
- else if (state.packet.video[1])
- vid_idx = 1;
- else
- vid_idx = 0;
-
- if (state.packet.has_pts)
- _pts = state.packet.pts - obj->info.min_pts;
- else
- _pts = _approx_pts (obj->info.shdr[vid_idx].aps_list, packet_no);
-
- _fix_scan_info (state.packet.scan_data_ptr, packet_no,
- _pts, obj->info.shdr[vid_idx].aps_list);
- }
-
- memset (packet_buf, 0, 2324);
- memcpy (packet_buf, buf, pkt_len);
-
- if (flags)
- {
- *flags = state.packet;
- flags->pts -= obj->info.min_pts;
- }
-
- return 0; /* breaking out */
- }
-
- pos += pkt_len;
- pno++;
-
- if (pkt_len != read_len)
- vcd_data_source_seek (obj->data_source, pos);
- }
-
- vcd_assert (pos == length);
-
- vcd_error ("shouldnt be reached...");
-
- return -1;
-}
-
-void
-vcd_mpeg_source_close (VcdMpegSource *obj)
-{
- vcd_assert (obj != NULL);
-
- vcd_data_source_close (obj->data_source);
-}
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libvcd/mpeg_stream.h b/src/input/vcd/libvcd/mpeg_stream.h
deleted file mode 100644
index 14f73d928..000000000
--- a/src/input/vcd/libvcd/mpeg_stream.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- $Id: mpeg_stream.h,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifndef __VCD_MPEG_STREAM__
-#define __VCD_MPEG_STREAM__
-
-#include <libvcd/types.h>
-
-/* Private includes */
-#include "stream.h"
-#include "data_structures.h"
-#include "mpeg.h"
-
-#define MPEG_PACKET_SIZE 2324
-
-typedef struct _VcdMpegSource VcdMpegSource;
-
-/* used in APS list */
-
-struct aps_data
-{
- uint32_t packet_no;
- double timestamp;
-};
-
-/* enums */
-
-typedef enum {
- MPEG_AUDIO_NOSTREAM = 0,
- MPEG_AUDIO_1STREAM = 1,
- MPEG_AUDIO_2STREAM = 2,
- MPEG_AUDIO_EXT_STREAM = 3
-} mpeg_audio_t;
-
-typedef enum {
- MPEG_VIDEO_NOSTREAM = 0,
- MPEG_VIDEO_NTSC_STILL = 1,
- MPEG_VIDEO_NTSC_STILL2 = 2,
- MPEG_VIDEO_NTSC_MOTION = 3,
-
- MPEG_VIDEO_PAL_STILL = 5,
- MPEG_VIDEO_PAL_STILL2 = 6,
- MPEG_VIDEO_PAL_MOTION = 7
-} mpeg_video_t;
-
-/* mpeg stream info */
-
-struct vcd_mpeg_stream_info;
-
-/* mpeg packet info */
-
-struct vcd_mpeg_packet_info;
-
-/* access functions */
-
-VcdMpegSource *
-vcd_mpeg_source_new (VcdDataSource *mpeg_file);
-
-/* scan the mpeg file... needed to be called only once */
-typedef struct {
- long current_pack;
- long current_pos;
- long length;
-} vcd_mpeg_prog_info_t;
-
-typedef int (*vcd_mpeg_prog_cb_t) (const vcd_mpeg_prog_info_t *progress_info,
- void *user_data);
-
-void
-vcd_mpeg_source_scan (VcdMpegSource *obj, bool strict_aps, bool fix_scan_info,
- vcd_mpeg_prog_cb_t callback, void *user_data);
-
-/* gets the packet at given position */
-int
-vcd_mpeg_source_get_packet (VcdMpegSource *obj, unsigned long packet_no,
- void *packet_buf, struct vcd_mpeg_packet_info *flags,
- bool fix_scan_info);
-
-void
-vcd_mpeg_source_close (VcdMpegSource *obj);
-
-const struct vcd_mpeg_stream_info *
-vcd_mpeg_source_get_info (VcdMpegSource *obj);
-
-long
-vcd_mpeg_source_stat (VcdMpegSource *obj);
-
-void
-vcd_mpeg_source_destroy (VcdMpegSource *obj, bool destroy_file_obj);
-
-#endif /* __VCD_MPEG_STREAM__ */
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libvcd/obj.h b/src/input/vcd/libvcd/obj.h
deleted file mode 100644
index d6849a3ab..000000000
--- a/src/input/vcd/libvcd/obj.h
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- $Id: obj.h,v 1.3 2005/01/01 02:43:59 rockyb Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifndef __VCD_OBJ_H__
-#define __VCD_OBJ_H__
-
-#include <cdio/iso9660.h>
-#include <libvcd/files.h>
-
-/* Private headers */
-#include "data_structures.h"
-#include "directory.h"
-#include "image_sink.h"
-#include "mpeg_stream.h"
-#include "salloc.h"
-#include "vcd.h"
-
-typedef struct {
- double time;
- struct aps_data aps;
- char *id;
-} entry_t;
-
-typedef struct {
- double time;
- char *id;
-} pause_t;
-
-typedef struct {
- VcdMpegSource *source;
- char *id;
- const struct vcd_mpeg_stream_info *info;
-
- CdioList *pause_list; /* pause_t */
-
- char *default_entry_id;
- CdioList *entry_list; /* entry_t */
-
- /* pbc ref check */
- bool referenced;
-
- /* computed on sector allocation */
- unsigned relative_start_extent; /* relative to iso data end */
-} mpeg_sequence_t;
-
-/* work in progress -- fixme rename all occurences */
-#define mpeg_track_t mpeg_sequence_t
-#define mpeg_track_list mpeg_sequence_list
-
-typedef struct {
- VcdMpegSource *source;
- char *id;
- const struct vcd_mpeg_stream_info *info;
-
- CdioList *pause_list; /* pause_t */
-
- /* pbc ref check */
- bool referenced;
-
- /* computed through info */
- unsigned segment_count;
-
- /* computed on sector allocation */
- unsigned start_extent;
-} mpeg_segment_t;
-
-
-typedef struct {
- char *iso_pathname;
- VcdDataSource *file;
- bool raw_flag;
-
- uint32_t size;
- uint32_t start_extent;
- uint32_t sectors;
-} custom_file_t;
-
-struct _VcdObj {
- vcd_type_t type;
-
- /* VCD 3.0 chinese SVCD compat flags */
- bool svcd_vcd3_mpegav;
- bool svcd_vcd3_entrysvd;
- bool svcd_vcd3_tracksvd;
- bool svcd_vcd3_spiconsv;
-
- bool update_scan_offsets;
- bool relaxed_aps;
-
- unsigned leadout_pregap;
- unsigned track_pregap;
- unsigned track_front_margin;
- unsigned track_rear_margin;
-
- /* output */
- VcdImageSink *image_sink;
-
- /* ... */
- unsigned iso_size;
- char *iso_volume_label;
- char *iso_publisher_id;
- char *iso_application_id;
- char *iso_preparer_id;
-
- char *info_album_id;
- unsigned info_volume_count;
- unsigned info_volume_number;
- unsigned info_restriction;
- bool info_use_seq2;
- bool info_use_lid2;
-
- /* input */
- unsigned mpeg_segment_start_extent;
- CdioList *mpeg_segment_list; /* mpeg_segment_t */
-
- CdioList *mpeg_sequence_list; /* mpeg_sequence_t */
-
- unsigned relative_end_extent; /* last mpeg sequence track end extent */
-
- /* PBC */
- CdioList *pbc_list; /* pbc_t */
- unsigned psd_size;
- unsigned psdx_size;
-
- /* custom files */
- unsigned ext_file_start_extent;
- unsigned custom_file_start_extent;
- CdioList *custom_file_list; /* custom_file_t */
- CdioList *custom_dir_list; /* char */
-
- /* dictionary */
- CdioList *buffer_dict_list;
-
- /* aggregates */
- VcdSalloc *iso_bitmap;
-
- VcdDirectory *dir;
-
- /* state info */
- bool in_output;
-
- unsigned sectors_written;
- unsigned in_track;
-
- long last_cb_call;
-
- progress_callback_t progress_callback;
- void *callback_user_data;
-};
-
-/* private functions */
-
-mpeg_sequence_t *
-_vcd_obj_get_sequence_by_id (VcdObj *obj, const char sequence_id[]);
-
-mpeg_sequence_t *
-_vcd_obj_get_sequence_by_entry_id (VcdObj *obj, const char entry_id[]);
-
-mpeg_segment_t *
-_vcd_obj_get_segment_by_id (VcdObj *obj, const char segment_id[]);
-
-enum vcd_capability_t {
- _CAP_VALID,
- _CAP_MPEG1,
- _CAP_MPEG2,
- _CAP_PBC,
- _CAP_PBC_X,
- _CAP_TRACK_MARGINS,
- _CAP_4C_SVCD,
- _CAP_PAL_BITS
-};
-
-bool
-_vcd_obj_has_cap_p (const VcdObj *obj, enum vcd_capability_t capability);
-
-#endif /* __VCD_OBJ_H__ */
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libvcd/pbc.c b/src/input/vcd/libvcd/pbc.c
deleted file mode 100644
index 1b4f1a6c1..000000000
--- a/src/input/vcd/libvcd/pbc.c
+++ /dev/null
@@ -1,880 +0,0 @@
-/*
- $Id: pbc.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $
-
- Copyright (C) 2000, 2004 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <string.h>
-#include <stddef.h>
-#include <math.h>
-
-#include <cdio/cdio.h>
-#include <cdio/bytesex.h>
-
-/* Public headers */
-#include <libvcd/logging.h>
-#include <libvcd/files.h>
-#include <libvcd/types.h>
-#include <libvcd/info.h>
-
-/* FIXME! Make this really private. */
-#include <libvcd/files_private.h>
-
-/* Private headers */
-#include "vcd_assert.h"
-#include "obj.h"
-#include "pbc.h"
-#include "util.h"
-
-static const char _rcsid[] = "$Id: pbc.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $";
-
-static uint8_t
-_wtime (int seconds)
-{
- if (seconds < 0)
- return 255;
-
- if (seconds <= 60)
- return seconds;
-
- if (seconds <= 2000)
- {
- double _tmp;
-
- _tmp = seconds;
- _tmp -= 60;
- _tmp /= 10;
- _tmp += 60;
-
- return rint (_tmp);
- }
-
- vcd_warn ("wait time of %ds clipped to 2000s", seconds);
-
- return 254;
-}
-
-static pbc_t *
-_vcd_pbc_byid(const VcdObj *obj, const char item_id[])
-{
- CdioListNode *node;
-
- _CDIO_LIST_FOREACH (node, obj->pbc_list)
- {
- pbc_t *_pbc = _cdio_list_node_data (node);
-
- if (_pbc->id && !strcmp (item_id, _pbc->id))
- return _pbc;
- }
-
- /* not found */
- return NULL;
-}
-
-unsigned
-_vcd_pbc_lid_lookup (const VcdObj *obj, const char item_id[])
-{
- CdioListNode *node;
- unsigned n = 1;
-
- _CDIO_LIST_FOREACH (node, obj->pbc_list)
- {
- pbc_t *_pbc = _cdio_list_node_data (node);
-
- vcd_assert (n < 0x8000);
-
- if (_pbc->id && !strcmp (item_id, _pbc->id))
- return n;
-
- n++;
- }
-
- /* not found */
- return 0;
-}
-
-static void
-_set_area_helper (pbc_area_t *dest, const pbc_area_t *src, const char sel_id[])
-{
- memset (dest, 0, sizeof (pbc_area_t));
-
- if (src)
- {
- if (src->x1 || src->x2 || src->y1 || src->y2) /* not disabled */
- {
- if (src->x1 >= src->x2)
- vcd_error ("selection '%s': area x1 >= x2 (%d >= %d)",
- sel_id, src->x1, src->x2);
-
- if (src->y1 >= src->y2)
- vcd_error ("selection '%s': area y1 >= y2 (%d >= %d)",
- sel_id, src->y1, src->y2);
- }
-
- *dest = *src;
- }
-}
-
-enum item_type_t
-_vcd_pbc_lookup (const VcdObj *obj, const char item_id[])
-{
- unsigned id;
-
- vcd_assert (item_id != NULL);
-
- if ((id = _vcd_pbc_pin_lookup (obj, item_id)))
- {
- if (id < 2)
- return ITEM_TYPE_NOTFOUND;
- else if (id < MIN_ENCODED_TRACK_NUM)
- return ITEM_TYPE_TRACK;
- else if (id < 600)
- return ITEM_TYPE_ENTRY;
- else if (id <= MAX_ENCODED_SEGMENT_NUM)
- return ITEM_TYPE_SEGMENT;
- else
- vcd_assert_not_reached ();
- }
- else if (_vcd_pbc_lid_lookup (obj, item_id))
- return ITEM_TYPE_PBC;
-
- return ITEM_TYPE_NOTFOUND;
-}
-
-uint16_t
-_vcd_pbc_pin_lookup (const VcdObj *obj, const char item_id[])
-{
- int n;
- CdioListNode *node;
-
- if (!item_id)
- return 0;
-
- /* check sequence items */
-
- n = 0;
- _CDIO_LIST_FOREACH (node, obj->mpeg_sequence_list)
- {
- mpeg_sequence_t *_sequence = _cdio_list_node_data (node);
-
- vcd_assert (n < 98);
-
- if (_sequence->id && !strcmp (item_id, _sequence->id))
- return n + 2;
-
- n++;
- }
-
- /* check entry points */
-
- n = 0;
- _CDIO_LIST_FOREACH (node, obj->mpeg_sequence_list)
- {
- mpeg_sequence_t *_sequence = _cdio_list_node_data (node);
- CdioListNode *node2;
-
- /* default entry point */
-
- if (_sequence->default_entry_id
- && !strcmp (item_id, _sequence->default_entry_id))
- return n + 100;
- n++;
-
- /* additional entry points */
-
- _CDIO_LIST_FOREACH (node2, _sequence->entry_list)
- {
- entry_t *_entry = _cdio_list_node_data (node2);
-
- vcd_assert (n < 500);
-
- if (_entry->id && !strcmp (item_id, _entry->id))
- return n + 100;
-
- n++;
- }
- }
-
- /* check sequence items */
-
- n = 0;
- _CDIO_LIST_FOREACH (node, obj->mpeg_segment_list)
- {
- mpeg_segment_t *_segment = _cdio_list_node_data (node);
-
- vcd_assert (n < 1980);
-
- if (_segment->id && !strcmp (item_id, _segment->id))
- return n + MIN_ENCODED_SEGMENT_NUM;
-
- n += _segment->segment_count;
- }
-
- return 0;
-}
-
-bool
-_vcd_pbc_available (const VcdObj *obj)
-{
- vcd_assert (obj != NULL);
- vcd_assert (obj->pbc_list != NULL);
-
- if (!_cdio_list_length (obj->pbc_list))
- return false;
-
- if (!_vcd_obj_has_cap_p (obj, _CAP_PBC))
- {
- vcd_warn ("PBC list not empty but VCD type not capable of PBC!");
- return false;
- }
-
- return true;
-}
-
-uint16_t
-_vcd_pbc_max_lid (const VcdObj *obj)
-{
- uint16_t retval = 0;
-
- if (_vcd_pbc_available (obj))
- retval = _cdio_list_length (obj->pbc_list);
-
- return retval;
-}
-
-static size_t
-_vcd_pbc_node_length (const VcdObj *obj, const pbc_t *_pbc, bool extended)
-{
- size_t retval = 0;
-
- if (extended)
- vcd_assert (_vcd_obj_has_cap_p (obj, _CAP_PBC_X));
-
- switch (_pbc->type)
- {
- int n;
-
- case PBC_PLAYLIST:
- n = _cdio_list_length (_pbc->item_id_list);
- retval = __cd_offsetof (_PsdPlayListDescriptor, itemid[n]);
- break;
-
- case PBC_SELECTION:
- n = _cdio_list_length (_pbc->select_id_list);
-
- retval = __cd_offsetof (PsdSelectionListDescriptor_t, ofs[n]);
-
- if (extended || _vcd_obj_has_cap_p (obj, _CAP_4C_SVCD))
- retval += __cd_offsetof (PsdSelectionListDescriptorExtended, area[n]);
- break;
-
- case PBC_END:
- retval = sizeof (PsdEndListDescriptor);
- break;
-
- default:
- vcd_assert_not_reached ();
- break;
- }
-
- return retval;
-}
-
-static uint16_t
-_lookup_psd_offset (const VcdObj *obj, const char item_id[], bool extended)
-{
- CdioListNode *node;
-
- if (extended)
- vcd_assert (_vcd_obj_has_cap_p (obj, _CAP_PBC_X));
-
- /* disable it */
- if (!item_id)
- return PSD_OFS_DISABLED;
-
- _CDIO_LIST_FOREACH (node, obj->pbc_list)
- {
- pbc_t *_pbc = _cdio_list_node_data (node);
-
- if (!_pbc->id || strcmp (item_id, _pbc->id))
- continue;
-
- return (extended ? _pbc->offset_ext : _pbc->offset) / INFO_OFFSET_MULT;
- }
-
- vcd_error ("PSD: referenced PSD '%s' not found", item_id);
-
- /* not found */
- return PSD_OFS_DISABLED;
-}
-
-static void
-_vcd_pin_mark_id (const VcdObj *obj, const char _id[])
-{
- mpeg_sequence_t *_seq;
- mpeg_segment_t *_seg;
-
- vcd_assert (obj != NULL);
-
- if (!_id)
- return;
-
- if ((_seq = _vcd_obj_get_sequence_by_id ((VcdObj *) obj, _id)))
- _seq->referenced = true;
-
- if ((_seg = _vcd_obj_get_segment_by_id ((VcdObj *) obj, _id)))
- _seg->referenced = true;
-}
-
-static void
-_vcd_pbc_mark_id (const VcdObj *obj, const char _id[])
-{
- pbc_t *_pbc;
-
- vcd_assert (obj != NULL);
-
- if (!_id)
- return;
-
- _pbc = _vcd_pbc_byid (obj, _id);
-
- if (!_pbc) /* not found */
- return;
-
- if (_pbc->referenced) /* already marked */
- return;
-
- _pbc->referenced = true;
-
- switch (_pbc->type)
- {
- case PBC_PLAYLIST:
- {
- CdioListNode *node;
-
- _vcd_pbc_mark_id (obj, _pbc->prev_id);
- _vcd_pbc_mark_id (obj, _pbc->next_id);
- _vcd_pbc_mark_id (obj, _pbc->retn_id);
-
- _CDIO_LIST_FOREACH (node, _pbc->item_id_list)
- {
- const char *_id = _cdio_list_node_data (node);
-
- _vcd_pin_mark_id (obj, _id);
- }
- }
- break;
-
- case PBC_SELECTION:
- {
- CdioListNode *node;
-
- _vcd_pbc_mark_id (obj, _pbc->prev_id);
- _vcd_pbc_mark_id (obj, _pbc->next_id);
- _vcd_pbc_mark_id (obj, _pbc->retn_id);
-
- if (_pbc->selection_type == _SEL_NORMAL)
- _vcd_pbc_mark_id (obj, _pbc->default_id);
-
- _vcd_pbc_mark_id (obj, _pbc->timeout_id);
-
- _vcd_pin_mark_id (obj, _pbc->item_id);
-
- _CDIO_LIST_FOREACH (node, _pbc->select_id_list)
- {
- const char *_id = _cdio_list_node_data (node);
-
- _vcd_pbc_mark_id (obj, _id);
- }
- }
- break;
-
- case PBC_END:
- _vcd_pin_mark_id (obj, _pbc->image_id);
- break;
-
- default:
- vcd_assert_not_reached ();
- break;
- }
-}
-
-void
-_vcd_pbc_check_unreferenced (const VcdObj *obj)
-{
- CdioListNode *node;
-
- /* clear all flags */
-
- _CDIO_LIST_FOREACH (node, obj->pbc_list)
- {
- pbc_t *_pbc = _cdio_list_node_data (node);
-
- _pbc->referenced = false;
- }
-
- _CDIO_LIST_FOREACH (node, obj->mpeg_sequence_list)
- {
- mpeg_sequence_t *_sequence = _cdio_list_node_data (node);
-
- _sequence->referenced = false;
- }
-
- _CDIO_LIST_FOREACH (node, obj->mpeg_segment_list)
- {
- mpeg_segment_t *_segment = _cdio_list_node_data (node);
-
- _segment->referenced = false;
- }
-
- /* start from non-rejected lists */
-
- _CDIO_LIST_FOREACH (node, obj->pbc_list)
- {
- pbc_t *_pbc = _cdio_list_node_data (node);
-
- vcd_assert (_pbc->id != NULL);
-
- if (_pbc->rejected)
- continue;
-
- _vcd_pbc_mark_id (obj, _pbc->id);
- }
-
- /* collect flags */
-
- _CDIO_LIST_FOREACH (node, obj->pbc_list)
- {
- pbc_t *_pbc = _cdio_list_node_data (node);
-
- if (!_pbc->referenced)
- vcd_warn ("PSD item '%s' is unreachable", _pbc->id);
- }
-
- _CDIO_LIST_FOREACH (node, obj->mpeg_sequence_list)
- {
- mpeg_sequence_t *_sequence = _cdio_list_node_data (node);
-
- if (!_sequence->referenced)
- vcd_warn ("sequence '%s' is not reachable by PBC", _sequence->id);
- }
-
- _CDIO_LIST_FOREACH (node, obj->mpeg_segment_list)
- {
- mpeg_segment_t *_segment = _cdio_list_node_data (node);
-
- if (!_segment->referenced)
- vcd_warn ("segment item '%s' is unreachable", _segment->id);
- }
-
-}
-
-void
-_vcd_pbc_node_write (const VcdObj *obj, const pbc_t *_pbc, void *buf,
- bool extended)
-{
- vcd_assert (obj != NULL);
- vcd_assert (_pbc != NULL);
- vcd_assert (buf != NULL);
-
- if (extended)
- vcd_assert (_vcd_obj_has_cap_p (obj, _CAP_PBC_X));
-
- switch (_pbc->type)
- {
- case PBC_PLAYLIST:
- {
- _PsdPlayListDescriptor *_md = buf;
- CdioListNode *node;
- int n;
-
- _md->type = PSD_TYPE_PLAY_LIST;
- _md->noi = _cdio_list_length (_pbc->item_id_list);
-
- vcd_assert (_pbc->lid < 0x8000);
- _md->lid = uint16_to_be (_pbc->lid | (_pbc->rejected ? 0x8000 : 0));
-
- _md->prev_ofs =
- uint16_to_be (_lookup_psd_offset (obj, _pbc->prev_id, extended));
- _md->next_ofs =
- uint16_to_be (_lookup_psd_offset (obj, _pbc->next_id, extended));
- _md->return_ofs =
- uint16_to_be (_lookup_psd_offset (obj, _pbc->retn_id, extended));
- _md->ptime = uint16_to_be (rint (_pbc->playing_time * 15.0));
- _md->wtime = _wtime (_pbc->wait_time);
- _md->atime = _wtime (_pbc->auto_pause_time);
-
- n = 0;
- _CDIO_LIST_FOREACH (node, _pbc->item_id_list)
- {
- const char *_id = _cdio_list_node_data (node);
- uint16_t _pin;
-
- if (_id)
- {
- _pin = _vcd_pbc_pin_lookup (obj, _id);
-
- if (!_pin)
- vcd_error ("PSD: referenced play item '%s' not found", _id);
-
- _md->itemid[n] = uint16_to_be (_pin);
- }
- else
- _md->itemid[n] = 0; /* play nothing */
-
- n++;
- }
- }
- break;
-
- case PBC_SELECTION:
- {
- PsdSelectionListDescriptor_t *_md = buf;
-
- const unsigned int _nos = _cdio_list_length (_pbc->select_id_list);
-
- if (extended)
- _md->type = PSD_TYPE_EXT_SELECTION_LIST;
- else
- _md->type = PSD_TYPE_SELECTION_LIST;
-
- if (!IN (_pbc->bsn, 1, MAX_PBC_SELECTIONS))
- vcd_error ("selection '%s': BSN (%d) not in range [1..%d]",
- _pbc->id, _pbc->bsn, MAX_PBC_SELECTIONS);
-
- if (!IN (_nos, 0, MAX_PBC_SELECTIONS))
- vcd_error ("selection '%s': too many selections (%d > %d)",
- _pbc->id, _nos, MAX_PBC_SELECTIONS);
-
- if (_nos + _pbc->bsn > 100)
- vcd_error ("selection '%s': BSN + NOS (%d + %d) > 100",
- _pbc->id, _pbc->bsn, _nos);
-
- _md->bsn = _pbc->bsn;
- _md->nos = _nos;
-
- vcd_assert (sizeof (PsdSelectionListFlags) == 1);
-
- /* selection flags */
- if (_vcd_obj_has_cap_p (obj, _CAP_4C_SVCD))
- _md->flags.SelectionAreaFlag = true;
- else
- _md->flags.SelectionAreaFlag = false;
-
- _md->flags.CommandListFlag = false;
-
- vcd_assert (_pbc->lid < 0x8000);
- _md->lid = uint16_to_be (_pbc->lid | (_pbc->rejected ? 0x8000 : 0));
-
- _md->prev_ofs =
- uint16_to_be (_lookup_psd_offset (obj, _pbc->prev_id, extended));
- _md->next_ofs =
- uint16_to_be (_lookup_psd_offset (obj, _pbc->next_id, extended));
- _md->return_ofs =
- uint16_to_be (_lookup_psd_offset (obj, _pbc->retn_id, extended));
-
- switch (_pbc->selection_type)
- {
- case _SEL_NORMAL:
- _md->default_ofs =
- uint16_to_be (_lookup_psd_offset (obj, _pbc->default_id, extended));
- break;
-
- case _SEL_MULTI_DEF:
- _md->default_ofs = uint16_to_be (PSD_OFS_MULTI_DEF);
- if (_pbc->default_id)
- vcd_warn ("ignoring default target '%s' for multi default selection '%s'",
- _pbc->default_id, _pbc->id);
- break;
-
- case _SEL_MULTI_DEF_NO_NUM:
- _md->default_ofs = uint16_to_be (PSD_OFS_MULTI_DEF_NO_NUM);
- if (_pbc->default_id)
- vcd_warn ("ignoring default target '%s' for multi default (w/o num) selection '%s'",
- _pbc->default_id, _pbc->id);
- break;
-
- default:
- vcd_assert_not_reached ();
- break;
- }
-
- _md->timeout_ofs =
- uint16_to_be (_lookup_psd_offset (obj, _pbc->timeout_id, extended));
- _md->totime = _wtime (_pbc->timeout_time);
-
- if (_pbc->loop_count > 0x7f)
- vcd_warn ("loop count %d > 127", _pbc->loop_count);
-
- _md->loop = (_pbc->loop_count > 0x7f) ? 0x7f : _pbc->loop_count;
-
- if (_pbc->jump_delayed)
- _md->loop |= 0x80;
-
- /* timeout related sanity checks */
- if (_pbc->loop_count > 0
- && _pbc->timeout_time >= 0
- && !_pbc->timeout_id
- && !_nos)
- vcd_warn ("PSD: selection '%s': neither timeout nor select target available, but neither loop count is infinite nor timeout wait time", _pbc->id);
-
- if (_pbc->timeout_id && (_pbc->timeout_time < 0 || _pbc->loop_count <= 0))
- vcd_warn ("PSD: selection '%s': timeout target '%s' is never used due to loop count or timeout wait time given", _pbc->id, _pbc->timeout_id);
-
- if (_pbc->item_id)
- {
- const uint16_t _pin = _vcd_pbc_pin_lookup (obj, _pbc->item_id);
-
- if (!_pin)
- vcd_error ("PSD: referenced play item '%s' not found", _pbc->item_id);
-
- _md->itemid = uint16_to_be (_pin);
- }
- else
- _md->itemid = 0; /* play nothing */
-
- /* sanity checks */
- switch (_pbc->selection_type)
- {
- case _SEL_NORMAL:
- break;
-
- case _SEL_MULTI_DEF:
- case _SEL_MULTI_DEF_NO_NUM:
- if (_pbc->jump_delayed)
- vcd_warn ("selection '%s': jump timing shall be immediate", _pbc->id);
-
- if (_pbc->bsn != 1)
- vcd_error ("selection '%s': BSN != 1 for multi default selection",
- _pbc->id);
-
- /* checking NOS == NOE */
- if (!_pbc->item_id)
- vcd_error ("selection '%s': play nothing play item not allowed for multidefault list",
- _pbc->id);
-
- {
- mpeg_sequence_t *_seq;
-
- if ((_seq = _vcd_obj_get_sequence_by_id ((VcdObj *) obj, _pbc->item_id))
- || (_seq = _vcd_obj_get_sequence_by_entry_id ((VcdObj *) obj, _pbc->item_id)))
- {
- const unsigned _entries =
- _cdio_list_length (_seq->entry_list) + 1;
-
- if (_nos != _entries)
- vcd_error ("selection '%s': number of entrypoints"
- " (%d for sequence '%s') != number of selections (%d)",
- _pbc->id, _entries, _pbc->item_id, _nos);
- }
- else
- vcd_error ("selection '%s': play item '%s'"
- " is requried to be sequence or entry point"
- " item for multi default selecton",
- _pbc->id, _pbc->item_id);
- }
-
- break;
-
- default:
- vcd_assert_not_reached ();
- break;
- }
-
- /* fill selection array */
- {
- CdioListNode *node = NULL;
- int idx = 0;
-
- idx = 0;
- _CDIO_LIST_FOREACH (node, _pbc->select_id_list)
- {
- const char *_id = _cdio_list_node_data (node);
-
- _md->ofs[idx] =
- uint16_to_be (_lookup_psd_offset (obj, _id, extended));
-
- idx++;
- }
- }
-
- if (extended || _vcd_obj_has_cap_p (obj, _CAP_4C_SVCD))
- {
- PsdSelectionListDescriptorExtended *_md2;
- CdioListNode *node;
- int n;
-
- /* append extended selection areas */
-
- _md2 = (void *) &_md->ofs[_nos];
-
- _set_area_helper (&_md2->next_area, _pbc->next_area, _pbc->id);
- _set_area_helper (&_md2->prev_area, _pbc->prev_area, _pbc->id);
- _set_area_helper (&_md2->return_area, _pbc->return_area, _pbc->id);
-
- _set_area_helper (&_md2->default_area, _pbc->default_area, _pbc->id);
-
- n = 0;
- if (_pbc->select_area_list)
- _CDIO_LIST_FOREACH (node, _pbc->select_area_list)
- {
- const pbc_area_t *_area = _cdio_list_node_data (node);
-
- _set_area_helper (&_md2->area[n], _area, _pbc->id);
-
- n++;
- }
-
- vcd_assert (n == _nos);
- }
- }
- break;
-
- case PBC_END:
- {
- PsdEndListDescriptor *_md = buf;
-
- _md->type = PSD_TYPE_END_LIST;
-
- if (_vcd_obj_has_cap_p (obj, _CAP_4C_SVCD))
- {
- _md->next_disc = _pbc->next_disc;
-
- if (_pbc->image_id)
- {
- uint16_t _pin = _vcd_pbc_pin_lookup (obj, _pbc->image_id);
- mpeg_segment_t *_segment;
-
- if (!_pbc->next_disc)
- vcd_warn ("PSD: endlist '%s': change disc picture given,"
- " but next volume is 0", _pbc->id);
-
- if (!_pin)
- vcd_error ("PSD: referenced play item '%s' not found",
- _pbc->item_id);
-
- _md->change_pic = uint16_to_be (_pin);
-
- /* sanity checks */
-
- _segment = _vcd_obj_get_segment_by_id ((VcdObj *) obj,
- _pbc->image_id);
-
- if (!_segment)
- vcd_warn ("PSD: endlist '%s': referenced play item '%s'"
- " is not a segment play item",
- _pbc->id, _pbc->image_id);
- else if (_segment->info->shdr[0].seen
- || !(_segment->info->shdr[1].seen || _segment->info->shdr[2].seen))
- vcd_warn ("PSD: endlist '%s': referenced play item '%s'"
- " should be a still picture",
- _pbc->id, _pbc->image_id);
- }
- }
- else if (_pbc->next_disc || _pbc->image_id)
- vcd_warn ("extended end list attributes ignored for non-SVCD");
- }
- break;
-
- default:
- vcd_assert_not_reached ();
- break;
- }
-}
-
-pbc_t *
-vcd_pbc_new (enum pbc_type_t type)
-{
- pbc_t *_pbc;
-
- _pbc = _vcd_malloc (sizeof (pbc_t));
- _pbc->type = type;
-
- switch (type)
- {
- case PBC_PLAYLIST:
- _pbc->item_id_list = _cdio_list_new ();
- break;
-
- case PBC_SELECTION:
- _pbc->select_id_list = _cdio_list_new ();
- _pbc->select_area_list = _cdio_list_new ();
- break;
-
- case PBC_END:
- break;
-
- default:
- vcd_assert_not_reached ();
- break;
- }
-
- return _pbc;
-}
-
-/*
- */
-
-bool
-_vcd_pbc_finalize (VcdObj *obj)
-{
- CdioListNode *node;
- unsigned offset = 0, offset_ext = 0;
- unsigned lid;
-
- lid = 1;
- _CDIO_LIST_FOREACH (node, obj->pbc_list)
- {
- pbc_t *_pbc = _cdio_list_node_data (node);
- unsigned length, length_ext = 0;
-
- length = _vcd_pbc_node_length (obj, _pbc, false);
- if (_vcd_obj_has_cap_p (obj, _CAP_PBC_X))
- length_ext = _vcd_pbc_node_length (obj, _pbc, true);
-
- /* round them up to... */
- length = _vcd_ceil2block (length, INFO_OFFSET_MULT);
- if (_vcd_obj_has_cap_p (obj, _CAP_PBC_X))
- length_ext = _vcd_ceil2block (length_ext, INFO_OFFSET_MULT);
-
- /* node may not cross sector boundary! */
- offset = _vcd_ofs_add (offset, length, ISO_BLOCKSIZE);
- if (_vcd_obj_has_cap_p (obj, _CAP_PBC_X))
- offset_ext = _vcd_ofs_add (offset_ext, length_ext, ISO_BLOCKSIZE);
-
- /* save start offsets */
- _pbc->offset = offset - length;
- if (_vcd_obj_has_cap_p (obj, _CAP_PBC_X))
- _pbc->offset_ext = offset_ext - length_ext;
-
- _pbc->lid = lid;
-
- lid++;
- }
-
- obj->psd_size = offset;
- if (_vcd_obj_has_cap_p (obj, _CAP_PBC_X))
- obj->psdx_size = offset_ext;
-
- vcd_debug ("pbc: psd size %d (extended psd %d)", offset, offset_ext);
-
- return true;
-}
diff --git a/src/input/vcd/libvcd/pbc.h b/src/input/vcd/libvcd/pbc.h
deleted file mode 100644
index 9972c3143..000000000
--- a/src/input/vcd/libvcd/pbc.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- $Id: pbc.h,v 1.3 2005/01/01 02:43:59 rockyb Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifndef __VCD_PBC_H__
-#define __VCD_PBC_H__
-
-#include <libvcd/types.h>
-
-/* Private includes */
-#include "data_structures.h"
-#include "util.h"
-#include "vcd.h"
-
-enum pbc_type_t {
- PBC_INVALID = 0,
- PBC_PLAYLIST,
- PBC_SELECTION,
- PBC_END
-};
-
-typedef struct psd_area_t pbc_area_t; /* fixme */
-#define pbc_area_t_SIZEOF struct_psd_area_t_SIZEOF
-
-static inline pbc_area_t *
-vcd_pbc_area_new (uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2)
-{
- pbc_area_t *_new_area = _vcd_malloc (sizeof (pbc_area_t));
-
- _new_area->x1 = x1;
- _new_area->y1 = y1;
- _new_area->x2 = x2;
- _new_area->y2 = y2;
-
- return _new_area;
-}
-
-/* typedef struct _pbc_t pbc_t; */
-
-struct _pbc_t {
- enum pbc_type_t type;
-
- char *id;
-
- bool rejected;
-
- /* pbc ref check */
- bool referenced;
-
- /* used for play/selection lists */
- char *prev_id;
- char *next_id;
- char *retn_id;
-
- /* used for play lists */
- double playing_time;
- int wait_time;
- int auto_pause_time;
- CdioList *item_id_list; /* char */
-
- /* used for selection lists */
- enum selection_type_t {
- _SEL_NORMAL = 0,
- _SEL_MULTI_DEF,
- _SEL_MULTI_DEF_NO_NUM
- } selection_type;
-
- pbc_area_t *prev_area;
- pbc_area_t *next_area;
- pbc_area_t *return_area;
- pbc_area_t *default_area; /* depends on selection_type */
- CdioList *select_area_list; /* pbc_area_t */
-
- unsigned bsn;
- char *default_id;
- char *timeout_id;
- int timeout_time;
- unsigned loop_count;
- bool jump_delayed;
- char *item_id;
- CdioList *select_id_list; /* char */
-
- /* used for end lists */
- char *image_id;
- unsigned next_disc;
-
- /* computed values */
- unsigned lid;
- unsigned offset;
- unsigned offset_ext;
-};
-
-enum item_type_t {
- ITEM_TYPE_NOTFOUND = 0,
- ITEM_TYPE_NOOP,
- ITEM_TYPE_TRACK,
- ITEM_TYPE_ENTRY,
- ITEM_TYPE_SEGMENT,
- ITEM_TYPE_PBC
-};
-
-/* functions */
-
-pbc_t *
-vcd_pbc_new (enum pbc_type_t type);
-
-pbc_t *
-_vcd_pbc_init (pbc_t *_pbc);
-
-void
-vcd_pbc_destroy (pbc_t *obj);
-
-unsigned
-_vcd_pbc_lid_lookup (const VcdObj *obj, const char item_id[]);
-
-enum item_type_t
-_vcd_pbc_lookup (const VcdObj *obj, const char item_id[]);
-
-uint16_t
-_vcd_pbc_pin_lookup (const VcdObj *obj, const char item_id[]);
-
-unsigned
-_vcd_pbc_list_calc_size (const pbc_t *_pbc, bool extended);
-
-bool
-_vcd_pbc_finalize (VcdObj *obj);
-
-bool
-_vcd_pbc_available (const VcdObj *obj);
-
-uint16_t
-_vcd_pbc_max_lid (const VcdObj *obj);
-
-void
-_vcd_pbc_node_write (const VcdObj *obj, const pbc_t *_pbc, void *buf,
- bool extended);
-
-void
-_vcd_pbc_check_unreferenced (const VcdObj *obj);
-
-#endif /* __VCD_PBC_H__ */
diff --git a/src/input/vcd/libvcd/salloc.c b/src/input/vcd/libvcd/salloc.c
deleted file mode 100644
index d6fc41c68..000000000
--- a/src/input/vcd/libvcd/salloc.c
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- $Id: salloc.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <string.h>
-#include <stdlib.h>
-
-#include <cdio/cdio.h>
-
-/* Public headers */
-#include <libvcd/types.h>
-#include <libvcd/logging.h>
-
-/* Private headers */
-#include "vcd_assert.h"
-#include "salloc.h"
-#include "util.h"
-
-static const char _rcsid[] = "$Id: salloc.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $";
-
-#define VCD_SALLOC_CHUNK_SIZE 16
-
-struct _VcdSalloc
-{
- uint8_t *data;
- uint32_t len;
- uint32_t alloced_chunks;
-};
-
-static void
-_vcd_salloc_set_size (VcdSalloc *bitmap, uint32_t newlen)
-{
- uint32_t new_alloced_chunks;
-
- vcd_assert (bitmap != NULL);
- vcd_assert (newlen >= bitmap->len);
-
- new_alloced_chunks = newlen / VCD_SALLOC_CHUNK_SIZE;
- if (newlen % VCD_SALLOC_CHUNK_SIZE)
- new_alloced_chunks++;
-
- if (bitmap->alloced_chunks < new_alloced_chunks)
- {
- bitmap->data =
- realloc (bitmap->data, new_alloced_chunks * VCD_SALLOC_CHUNK_SIZE);
- memset (bitmap->data + (VCD_SALLOC_CHUNK_SIZE * bitmap->alloced_chunks),
- 0,
- VCD_SALLOC_CHUNK_SIZE * (new_alloced_chunks -
- bitmap->alloced_chunks));
- bitmap->alloced_chunks = new_alloced_chunks;
- }
-
- bitmap->len = newlen;
-}
-
-static bool
-_vcd_salloc_is_set (const VcdSalloc *bitmap, uint32_t sector)
-{
- unsigned _byte = sector / 8;
- unsigned _bit = sector % 8;
-
- if (_byte < bitmap->len)
- return (bitmap->data[_byte] & (1 << _bit)) != 0;
- else
- return false;
-}
-
-static void
-_vcd_salloc_set (VcdSalloc *bitmap, uint32_t sector)
-{
- unsigned _byte = sector / 8;
- unsigned _bit = sector % 8;
-
- if (_byte >= bitmap->len)
- {
- unsigned oldlen = bitmap->len;
- _vcd_salloc_set_size (bitmap, _byte + 1);
- memset (bitmap->data + oldlen, 0x00, _byte + 1 - oldlen);
- }
-
- bitmap->data[_byte] |= (1 << _bit);
-}
-
-static void
-_vcd_salloc_unset (VcdSalloc *bitmap, uint32_t sector)
-{
- unsigned _byte = sector / 8;
- unsigned _bit = sector % 8;
-
- if (_byte >= bitmap->len)
- vcd_assert_not_reached ();
-
- bitmap->data[_byte] &= ~(1 << _bit);
-}
-
-/* exported */
-
-uint32_t _vcd_salloc (VcdSalloc *bitmap, uint32_t hint, uint32_t size)
-{
- if (!size)
- {
- size++;
- vcd_warn
- ("request of 0 sectors allocment fixed up to 1 sector (this is harmless)");
- }
-
- vcd_assert (size > 0);
-
- if (hint != SECTOR_NIL)
- {
- uint32_t i;
- for (i = 0; i < size; i++)
- if (_vcd_salloc_is_set (bitmap, hint + i))
- return SECTOR_NIL;
-
- /* everything's ok for allocing */
-
- i = size;
- while (i)
- _vcd_salloc_set (bitmap, hint + (--i));
- /* we begin with highest byte, in order to minimizing
- realloc's in sector_set */
-
- return hint;
- }
-
- /* find the lowest possible ... */
-
- hint = 0;
-
- while (_vcd_salloc (bitmap, hint, size) == SECTOR_NIL)
- hint++;
-
- return hint;
-}
-
-void
-_vcd_salloc_free (VcdSalloc *bitmap, uint32_t sec, uint32_t size)
-{
- uint32_t i;
-
- for (i = 0; i < size; i++)
- {
- vcd_assert (_vcd_salloc_is_set (bitmap, sec + i));
-
- _vcd_salloc_unset (bitmap, sec + i);
- }
-}
-
-VcdSalloc *
-_vcd_salloc_new (void)
-{
- VcdSalloc *newobj = _vcd_malloc (sizeof (VcdSalloc));
- return newobj;
-}
-
-void
-_vcd_salloc_destroy (VcdSalloc *bitmap)
-{
- vcd_assert (bitmap != NULL);
-
- free (bitmap->data);
- free (bitmap);
-}
-
-uint32_t _vcd_salloc_get_highest (const VcdSalloc *bitmap)
-{
- uint8_t last;
- unsigned n;
-
- vcd_assert (bitmap != NULL);
-
- last = bitmap->data[bitmap->len - 1];
-
- vcd_assert (last != 0);
-
- n = 8;
- while (n)
- if ((1 << --n) & last)
- break;
-
- return (bitmap->len - 1) * 8 + n;
-}
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libvcd/salloc.h b/src/input/vcd/libvcd/salloc.h
deleted file mode 100644
index 4676f9b45..000000000
--- a/src/input/vcd/libvcd/salloc.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- $Id: salloc.h,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* sector allocation management */
-
-#ifndef _SALLOC_H_
-#define _SALLOC_H_
-
-#include <libvcd/types.h>
-
-#define SECTOR_NIL ((uint32_t)(-1))
-
-typedef struct _VcdSalloc VcdSalloc;
-
-VcdSalloc *
-_vcd_salloc_new (void);
-
-void
-_vcd_salloc_destroy (VcdSalloc *bitmap);
-
-uint32_t
-_vcd_salloc (VcdSalloc *bitmap, uint32_t hint, uint32_t size);
-
-void
-_vcd_salloc_free (VcdSalloc *bitmap, uint32_t sec, uint32_t size);
-
-uint32_t
-_vcd_salloc_get_highest (const VcdSalloc *bitmap);
-
-#endif /* _SALLOC_H_ */
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libvcd/sector.c b/src/input/vcd/libvcd/sector.c
deleted file mode 100644
index d072a4f17..000000000
--- a/src/input/vcd/libvcd/sector.c
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- $Id: sector.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
- (C) 1998 Heiko Eissfeldt <heiko@colossus.escape.de>
- portions used & Chris Smith
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <string.h>
-
-#include <cdio/cdio.h>
-
-#include <libvcd/types.h>
-
-#include <libvcd/sector.h>
-
-/* Private includes */
-#include "vcd_assert.h"
-#include "bytesex.h"
-#include "salloc.h"
-#include "sector_private.h"
-
-static const char _rcsid[] = "$Id: sector.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $";
-
-static const uint8_t sync_pattern[12] = {
- 0x00, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0x00
-};
-
-static void
-build_address (void *buf, sectortype_t sectortype, uint32_t address)
-{
- raw_cd_sector_t *sector = buf;
-
- vcd_assert (sizeof(raw_cd_sector_t) == CDIO_CD_FRAMESIZE_RAW-DATA_LEN);
-
- cdio_lba_to_msf(address, &(sector->msf));
-
- switch(sectortype) {
- case MODE_0:
- sector->mode = 0;
- break;
- case MODE_2:
- case MODE_2_FORM_1:
- case MODE_2_FORM_2:
- sector->mode = 2;
- break;
- default:
- vcd_assert_not_reached ();
- break;
- }
-}
-
-/* From cdrtools-1.11a25 */
-static uint32_t
-build_edc(const uint8_t inout[], int from, int upto)
-{
- const uint8_t *p = inout+from;
- uint32_t result = 0;
-
- upto -= from-1;
- upto /= 4;
- while (--upto >= 0) {
- result = EDC_crctable[(result ^ *p++) & 0xffL] ^ (result >> 8);
- result = EDC_crctable[(result ^ *p++) & 0xffL] ^ (result >> 8);
- result = EDC_crctable[(result ^ *p++) & 0xffL] ^ (result >> 8);
- result = EDC_crctable[(result ^ *p++) & 0xffL] ^ (result >> 8);
- }
- return (result);
-}
-
-/* From cdrtools-1.11a40 */
-static void
-encode_L2_Q(uint8_t inout[4 + L2_RAW + 4 + 8 + L2_P + L2_Q])
-{
- uint8_t *dps;
- uint8_t *dp;
- uint8_t *Q;
- int i, j;
-
- Q = inout + 4 + L2_RAW + 4 + 8 + L2_P;
-
- dps = inout;
- for (j = 0; j < 26; j++) {
- uint16_t a, b;
-
- a = b = 0;
- dp = dps;
- for (i = 0; i < 43; i++) {
-
- /* LSB */
- a ^= L2sq[i][*dp++];
-
- /* MSB */
- b ^= L2sq[i][*dp];
-
- dp += 2*44-1;
- if (dp >= &inout[(4 + L2_RAW + 4 + 8 + L2_P)]) {
- dp -= (4 + L2_RAW + 4 + 8 + L2_P);
- }
- }
- Q[0] = a >> 8;
- Q[26*2] = a;
- Q[1] = b >> 8;
- Q[26*2+1] = b;
-
- Q += 2;
- dps += 2*43;
- }
-}
-
-static void
-encode_L2_P (uint8_t inout[4 + L2_RAW + 4 + 8 + L2_P])
-{
- uint8_t *dp;
- unsigned char *P;
- int i, j;
-
- P = inout + 4 + L2_RAW + 4 + 8;
-
- for (j = 0; j < 43; j++) {
- uint16_t a;
- uint16_t b;
-
- a = b = 0;
- dp = inout;
- for (i = 19; i < 43; i++) {
-
- /* LSB */
- a ^= L2sq[i][*dp++];
-
- /* MSB */
- b ^= L2sq[i][*dp];
-
- dp += 2*43 -1;
- }
- P[0] = a >> 8;
- P[43*2] = a;
- P[1] = b >> 8;
- P[43*2+1] = b;
-
- P += 2;
- inout += 2;
- }
-}
-
-/* Layer 2 Product code en/decoder */
-static void
-do_encode_L2 (void *buf, sectortype_t sectortype, uint32_t address)
-{
- raw_cd_sector_t *raw_sector = buf;
-
- vcd_assert (buf != NULL);
-
- vcd_assert (sizeof (sync_pattern) == SYNC_LEN);
- vcd_assert (sizeof (mode2_form1_sector_t) == CDIO_CD_FRAMESIZE_RAW);
- vcd_assert (sizeof (mode2_form2_sector_t) == CDIO_CD_FRAMESIZE_RAW);
- vcd_assert (sizeof (mode0_sector_t) == CDIO_CD_FRAMESIZE_RAW);
- vcd_assert (sizeof (raw_cd_sector_t) == SYNC_LEN+HEADER_LEN);
-
- memset (raw_sector, 0, SYNC_LEN+HEADER_LEN);
- memcpy (raw_sector->sync, sync_pattern, sizeof (sync_pattern));
-
- switch (sectortype) {
- case MODE_0:
- {
- mode0_sector_t *sector = buf;
-
- memset(sector->data, 0, sizeof(sector->data));
- }
- break;
- case MODE_2:
- break;
- case MODE_2_FORM_1:
- {
- mode2_form1_sector_t *sector = buf;
-
- sector->edc = uint32_to_le(build_edc(buf, 16, 16+8+2048-1));
-
- encode_L2_P((uint8_t*)buf+SYNC_LEN);
- encode_L2_Q((uint8_t*)buf+SYNC_LEN);
- }
- break;
- case MODE_2_FORM_2:
- {
- mode2_form2_sector_t *sector = buf;
-
- sector->edc = uint32_to_le(build_edc(buf, 16, 16+8+2324-1));
- }
- break;
- default:
- vcd_assert_not_reached ();
- }
-
- build_address (buf, sectortype, address);
-}
-
-void
-_vcd_make_mode2 (void *raw_sector, const void *data, uint32_t extent,
- uint8_t fnum, uint8_t cnum, uint8_t sm, uint8_t ci)
-{
- uint8_t *subhdr = (uint8_t*)raw_sector+16;
-
- vcd_assert (raw_sector != NULL);
- vcd_assert (data != NULL);
- vcd_assert (extent != SECTOR_NIL);
-
- memset (raw_sector, 0, CDIO_CD_FRAMESIZE_RAW);
-
- subhdr[0] = subhdr[4] = fnum;
- subhdr[1] = subhdr[5] = cnum;
- subhdr[2] = subhdr[6] = sm;
- subhdr[3] = subhdr[7] = ci;
-
- if (sm & SM_FORM2)
- {
- memcpy ((char*)raw_sector+CDIO_CD_XA_SYNC_HEADER, data,
- M2F2_SECTOR_SIZE);
- do_encode_L2 (raw_sector, MODE_2_FORM_2, extent+CDIO_PREGAP_SECTORS);
- }
- else
- {
- memcpy ((char*)raw_sector+CDIO_CD_XA_SYNC_HEADER, data,
- CDIO_CD_FRAMESIZE);
- do_encode_L2 (raw_sector, MODE_2_FORM_1, extent+CDIO_PREGAP_SECTORS);
- }
-}
-
-void
-_vcd_make_raw_mode2 (void *raw_sector, const void *data, uint32_t extent)
-{
- vcd_assert (raw_sector != NULL);
- vcd_assert (data != NULL);
- vcd_assert (extent != SECTOR_NIL);
-
- memset (raw_sector, 0, CDIO_CD_FRAMESIZE_RAW);
-
- memcpy ((char*)raw_sector+12+4, data, M2RAW_SECTOR_SIZE);
- do_encode_L2 (raw_sector, MODE_2, extent+CDIO_PREGAP_SECTORS);
-}
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libvcd/sector_private.h b/src/input/vcd/libvcd/sector_private.h
deleted file mode 100644
index 9411b5420..000000000
--- a/src/input/vcd/libvcd/sector_private.h
+++ /dev/null
@@ -1,1348 +0,0 @@
-/*
- $Id: sector_private.h,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
- (C) 1998 Heiko Eissfeldt <heiko@colossus.escape.de>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifndef __VCD_CD_SECTOR_PRIVATE_H__
-#define __VCD_CD_SECTOR_PRIVATE_H__
-
-#define RS_L12_BITS 8
-
-#define L2_RAW (1024*2)
-#define L2_Q (26*2*2)
-#define L2_P (43*2*2)
-
-typedef enum {
- MODE_0,
- MODE_2,
- MODE_2_FORM_1,
- MODE_2_FORM_2
-} sectortype_t;
-
-#define SYNC_LEN 12
-#define DATA_LEN 2336
-#define HEADER_LEN 4
-
-typedef struct {
- uint8_t sync[SYNC_LEN];
- msf_t msf;
- uint8_t mode;
- uint8_t user_data[EMPTY_ARRAY_SIZE];
-} raw_cd_sector_t;
-
-#define raw_cd_sector_t_SIZEOF (SYNC_LEN+HEADER_LEN)
-
-typedef struct {
- uint8_t sync[SYNC_LEN];
- msf_t msf;
- uint8_t mode;
-} sector_header_t;
-
-#define sector_header_t_SIZEOF (SYNC_LEN+HEADER_LEN)
-
-typedef struct {
- sector_header_t sector_header;
- uint8_t data[M2RAW_SECTOR_SIZE];
-} mode0_sector_t;
-
-#define mode0_sector_t_SIZEOF CDIO_CD_FRAMESIZE_RAW
-
-typedef struct {
- sector_header_t sector_header;
- uint8_t subheader[CDIO_CD_SUBHEADER_SIZE];
- uint8_t data[CDIO_CD_FRAMESIZE];
- uint32_t edc;
- uint8_t l2_p[L2_P];
- uint8_t l2_q[L2_Q];
-} mode2_form1_sector_t;
-
-#define mode2_form1_sector_t_SIZEOF CDIO_CD_FRAMESIZE_RAW
-
-typedef struct {
- sector_header_t sector_header;
- uint8_t subheader[CDIO_CD_SUBHEADER_SIZE];
- uint8_t data[M2F2_SECTOR_SIZE];
- uint32_t edc;
-} mode2_form2_sector_t;
-
-#define mode2_form2_sector_t_SIZEOF CDIO_CD_FRAMESIZE_RAW
-
-/*****************************************************************/
-/* */
-/* CRC LOOKUP TABLE */
-/* ================ */
-/* The following CRC lookup table was generated automagically */
-/* by the Rocksoft^tm Model CRC Algorithm Table Generation */
-/* Program V1.0 using the following model parameters: */
-/* */
-/* Width : 4 bytes. */
-/* Poly : 0x8001801BL */
-/* Reverse : TRUE. */
-/* */
-/* For more information on the Rocksoft^tm Model CRC Algorithm, */
-/* see the document titled "A Painless Guide to CRC Error */
-/* Detection Algorithms" by Ross Williams */
-/* (ross@guest.adelaide.edu.au.). This document is likely to be */
-/* in the FTP archive "ftp.adelaide.edu.au/pub/rocksoft". */
-/* */
-/*****************************************************************/
-
-static const uint32_t EDC_crctable[256] =
-{
- 0x00000000U, 0x90910101U, 0x91210201U, 0x01B00300U,
- 0x92410401U, 0x02D00500U, 0x03600600U, 0x93F10701U,
- 0x94810801U, 0x04100900U, 0x05A00A00U, 0x95310B01U,
- 0x06C00C00U, 0x96510D01U, 0x97E10E01U, 0x07700F00U,
- 0x99011001U, 0x09901100U, 0x08201200U, 0x98B11301U,
- 0x0B401400U, 0x9BD11501U, 0x9A611601U, 0x0AF01700U,
- 0x0D801800U, 0x9D111901U, 0x9CA11A01U, 0x0C301B00U,
- 0x9FC11C01U, 0x0F501D00U, 0x0EE01E00U, 0x9E711F01U,
- 0x82012001U, 0x12902100U, 0x13202200U, 0x83B12301U,
- 0x10402400U, 0x80D12501U, 0x81612601U, 0x11F02700U,
- 0x16802800U, 0x86112901U, 0x87A12A01U, 0x17302B00U,
- 0x84C12C01U, 0x14502D00U, 0x15E02E00U, 0x85712F01U,
- 0x1B003000U, 0x8B913101U, 0x8A213201U, 0x1AB03300U,
- 0x89413401U, 0x19D03500U, 0x18603600U, 0x88F13701U,
- 0x8F813801U, 0x1F103900U, 0x1EA03A00U, 0x8E313B01U,
- 0x1DC03C00U, 0x8D513D01U, 0x8CE13E01U, 0x1C703F00U,
- 0xB4014001U, 0x24904100U, 0x25204200U, 0xB5B14301U,
- 0x26404400U, 0xB6D14501U, 0xB7614601U, 0x27F04700U,
- 0x20804800U, 0xB0114901U, 0xB1A14A01U, 0x21304B00U,
- 0xB2C14C01U, 0x22504D00U, 0x23E04E00U, 0xB3714F01U,
- 0x2D005000U, 0xBD915101U, 0xBC215201U, 0x2CB05300U,
- 0xBF415401U, 0x2FD05500U, 0x2E605600U, 0xBEF15701U,
- 0xB9815801U, 0x29105900U, 0x28A05A00U, 0xB8315B01U,
- 0x2BC05C00U, 0xBB515D01U, 0xBAE15E01U, 0x2A705F00U,
- 0x36006000U, 0xA6916101U, 0xA7216201U, 0x37B06300U,
- 0xA4416401U, 0x34D06500U, 0x35606600U, 0xA5F16701U,
- 0xA2816801U, 0x32106900U, 0x33A06A00U, 0xA3316B01U,
- 0x30C06C00U, 0xA0516D01U, 0xA1E16E01U, 0x31706F00U,
- 0xAF017001U, 0x3F907100U, 0x3E207200U, 0xAEB17301U,
- 0x3D407400U, 0xADD17501U, 0xAC617601U, 0x3CF07700U,
- 0x3B807800U, 0xAB117901U, 0xAAA17A01U, 0x3A307B00U,
- 0xA9C17C01U, 0x39507D00U, 0x38E07E00U, 0xA8717F01U,
- 0xD8018001U, 0x48908100U, 0x49208200U, 0xD9B18301U,
- 0x4A408400U, 0xDAD18501U, 0xDB618601U, 0x4BF08700U,
- 0x4C808800U, 0xDC118901U, 0xDDA18A01U, 0x4D308B00U,
- 0xDEC18C01U, 0x4E508D00U, 0x4FE08E00U, 0xDF718F01U,
- 0x41009000U, 0xD1919101U, 0xD0219201U, 0x40B09300U,
- 0xD3419401U, 0x43D09500U, 0x42609600U, 0xD2F19701U,
- 0xD5819801U, 0x45109900U, 0x44A09A00U, 0xD4319B01U,
- 0x47C09C00U, 0xD7519D01U, 0xD6E19E01U, 0x46709F00U,
- 0x5A00A000U, 0xCA91A101U, 0xCB21A201U, 0x5BB0A300U,
- 0xC841A401U, 0x58D0A500U, 0x5960A600U, 0xC9F1A701U,
- 0xCE81A801U, 0x5E10A900U, 0x5FA0AA00U, 0xCF31AB01U,
- 0x5CC0AC00U, 0xCC51AD01U, 0xCDE1AE01U, 0x5D70AF00U,
- 0xC301B001U, 0x5390B100U, 0x5220B200U, 0xC2B1B301U,
- 0x5140B400U, 0xC1D1B501U, 0xC061B601U, 0x50F0B700U,
- 0x5780B800U, 0xC711B901U, 0xC6A1BA01U, 0x5630BB00U,
- 0xC5C1BC01U, 0x5550BD00U, 0x54E0BE00U, 0xC471BF01U,
- 0x6C00C000U, 0xFC91C101U, 0xFD21C201U, 0x6DB0C300U,
- 0xFE41C401U, 0x6ED0C500U, 0x6F60C600U, 0xFFF1C701U,
- 0xF881C801U, 0x6810C900U, 0x69A0CA00U, 0xF931CB01U,
- 0x6AC0CC00U, 0xFA51CD01U, 0xFBE1CE01U, 0x6B70CF00U,
- 0xF501D001U, 0x6590D100U, 0x6420D200U, 0xF4B1D301U,
- 0x6740D400U, 0xF7D1D501U, 0xF661D601U, 0x66F0D700U,
- 0x6180D800U, 0xF111D901U, 0xF0A1DA01U, 0x6030DB00U,
- 0xF3C1DC01U, 0x6350DD00U, 0x62E0DE00U, 0xF271DF01U,
- 0xEE01E001U, 0x7E90E100U, 0x7F20E200U, 0xEFB1E301U,
- 0x7C40E400U, 0xECD1E501U, 0xED61E601U, 0x7DF0E700U,
- 0x7A80E800U, 0xEA11E901U, 0xEBA1EA01U, 0x7B30EB00U,
- 0xE8C1EC01U, 0x7850ED00U, 0x79E0EE00U, 0xE971EF01U,
- 0x7700F000U, 0xE791F101U, 0xE621F201U, 0x76B0F300U,
- 0xE541F401U, 0x75D0F500U, 0x7460F600U, 0xE4F1F701U,
- 0xE381F801U, 0x7310F900U, 0x72A0FA00U, 0xE231FB01U,
- 0x71C0FC00U, 0xE151FD01U, 0xE0E1FE01U, 0x7070FF00U,
-};
-
-
-static const uint16_t L2sq[43][256] = {
- { 0, 44719, 16707, 61420, 33414, 11305, 50117, 28010, 6417, 47038,
- 22610, 63229, 39831, 13624, 56020, 29819, 12834, 40077, 29537, 56782,
- 45220, 7691, 61927, 24392, 11059, 34204, 27248, 50399, 43445, 1818,
- 59638, 18009, 25668, 51947, 9479, 35752, 59074, 18541, 42881, 2350,
- 32085, 54266, 15382, 37561, 65491, 20860, 48784, 4159, 22118, 63689,
- 5925, 47498, 54496, 31311, 38307, 15116, 20343, 57816, 3636, 41115,
- 52721, 25438, 36018, 8733, 51336, 26151, 35275, 10084, 18958, 58529,
- 2893, 42466, 53657, 32566, 37082, 15989, 21279, 64944, 4700, 48371,
- 64170, 21509, 48105, 5446, 30764, 54915, 14703, 38848, 58299, 19732,
- 41720, 3159, 24893, 53138, 8318, 36561, 44236, 611, 60815, 17184,
- 11850, 32997, 28425, 49574, 46557, 7026, 62622, 23089, 14171, 39412,
- 30232, 55479, 40686, 12353, 57261, 28930, 7272, 45767, 23851, 62340,
- 34815, 10576, 50876, 26643, 1401, 43990, 17466, 60053, 36109, 9122,
- 52302, 25313, 3979, 41252, 20168, 57447, 37916, 15027, 54623, 31728,
- 5786, 47157, 22489, 63862, 48943, 4480, 65132, 20675, 15785, 37638,
- 31978, 53829, 42558, 2193, 59261, 18898, 9400, 35351, 26107, 52052,
- 59721, 18406, 43018, 1701, 27599, 50528, 10892, 33827, 61528, 24311,
- 45339, 8116, 29406, 56433, 13213, 40242, 56171, 30148, 39464, 13447,
- 23021, 63298, 6318, 46593, 49786, 27861, 33593, 11670, 16636, 61011,
- 447, 44816, 17797, 60202, 1222, 43625, 50947, 27052, 34368, 10479,
- 23700, 62011, 7639, 45944, 56850, 28861, 40785, 12798, 30631, 55560,
- 14052, 38987, 62753, 23438, 46178, 6861, 28342, 49177, 12277, 33114,
- 60464, 17055, 44403, 988, 8641, 36718, 24706, 52781, 41799, 3560,
- 57860, 19627, 14544, 38527, 31123, 55100, 47702, 5369, 64277, 21946,
- 5091, 48460, 21152, 64527, 37221, 16330, 53286, 32393, 2802, 42077,
- 19377, 58654, 34932, 9947, 51511, 26520,
- },
- { 0, 55768, 44973, 30325, 17223, 39583, 60650, 13618, 34446, 24406,
- 10531, 61691, 50633, 7185, 27236, 46012, 4353, 51417, 48812, 26484,
- 21062, 35742, 65003, 9267, 38799, 20055, 14370, 57850, 54472, 3344,
- 31589, 41661, 8706, 64474, 36271, 21623, 24901, 47261, 52968, 5936,
- 42124, 32084, 2849, 54009, 59339, 15891, 18534, 37310, 13059, 60123,
- 40110, 17782, 28740, 43420, 57321, 1585, 46477, 27733, 6688, 50168,
- 63178, 12050, 22887, 32959, 17412, 40412, 60329, 12913, 1859, 56987,
- 43246, 28982, 49802, 6994, 27943, 46335, 33229, 22549, 11872, 63416,
- 21765, 36061, 64168, 9072, 5698, 53146, 47599, 24631, 54155, 2643,
- 31782, 42494, 37068, 18708, 16225, 59065, 26118, 49118, 51627, 4211,
- 9537, 64665, 35564, 21300, 57480, 14672, 20261, 38653, 41935, 31255,
- 3170, 54714, 30471, 44767, 55466, 370, 13376, 60824, 39917, 16949,
- 61833, 10321, 24100, 34812, 45774, 27414, 7523, 50363, 34824, 20944,
- 10149, 65149, 52047, 4759, 25826, 48442, 3718, 55134, 41259, 30963,
- 19905, 37913, 57964, 15284, 39177, 16593, 13988, 61308, 55886, 918,
- 30179, 44091, 8071, 50783, 45098, 27122, 23744, 34072, 62317, 10933,
- 43530, 29650, 1447, 56447, 59725, 12437, 18144, 40760, 11396, 62812,
- 33577, 23281, 28611, 46619, 49262, 6582, 47883, 25299, 5286, 52606,
- 63564, 8596, 22497, 36409, 15749, 58461, 37416, 19440, 32450, 42778,
- 53615, 2231, 52236, 5588, 25505, 47737, 36683, 22163, 8422, 63806,
- 19074, 37722, 58671, 15607, 2501, 53277, 42600, 32688, 56589, 1237,
- 29344, 43896, 40522, 18322, 12775, 59455, 23427, 33371, 62510, 11766,
- 6340, 49436, 46953, 28337, 60942, 14294, 16803, 39035, 44361, 29841,
- 740, 56124, 26752, 45400, 50989, 7925, 11207, 61983, 33898, 23986,
- 65295, 9943, 20642, 35194, 48200, 26000, 5093, 51773, 31105, 41049,
- 54828, 4084, 15046, 58142, 38251, 19635,
- },
- { 0, 27757, 55514, 46263, 44457, 49604, 30067, 6430, 18255, 11042,
- 40853, 62456, 60134, 34443, 12860, 24145, 36510, 58099, 22084, 14889,
- 9015, 20314, 64493, 38784, 51665, 42428, 4363, 32102, 25720, 2069,
- 48290, 53455, 289, 27980, 55803, 46486, 44168, 49381, 29778, 6207,
- 18030, 10755, 40628, 62169, 60359, 34730, 13085, 24432, 36799, 58322,
- 22373, 15112, 8726, 20091, 64204, 38561, 51440, 42141, 4138, 31815,
- 25945, 2356, 48515, 53742, 578, 28207, 55960, 46837, 45035, 50054,
- 30513, 7004, 17677, 10592, 40407, 61882, 59556, 33993, 12414, 23571,
- 36060, 57521, 21510, 14443, 8565, 19736, 63919, 38338, 52115, 43006,
- 4937, 32548, 26170, 2647, 48864, 53901, 867, 28430, 56249, 47060,
- 44746, 49831, 30224, 6781, 17452, 10305, 40182, 61595, 59781, 34280,
- 12639, 23858, 36349, 57744, 21799, 14666, 8276, 19513, 63630, 38115,
- 51890, 42719, 4712, 32261, 26395, 2934, 49089, 54188, 1156, 26857,
- 56414, 45107, 43309, 50496, 29175, 7578, 17355, 12198, 39697, 63356,
- 61026, 33295, 14008, 23253, 35354, 58999, 21184, 16045, 10163, 19422,
- 65385, 37636, 52565, 41272, 5519, 31202, 24828, 3217, 47142, 54347,
- 1445, 27080, 56703, 45330, 43020, 50273, 28886, 7355, 17130, 11911,
- 39472, 63069, 61251, 33582, 14233, 23540, 35643, 59222, 21473, 16268,
- 9874, 19199, 65096, 37413, 52340, 40985, 5294, 30915, 25053, 3504,
- 47367, 54634, 1734, 27307, 56860, 45681, 43887, 50946, 29621, 8152,
- 16777, 11748, 39251, 62782, 60448, 32845, 13562, 22679, 34904, 58421,
- 20610, 15599, 9713, 18844, 64811, 37190, 53015, 41850, 6093, 31648,
- 25278, 3795, 47716, 54793, 2023, 27530, 57149, 45904, 43598, 50723,
- 29332, 7929, 16552, 11461, 39026, 62495, 60673, 33132, 13787, 22966,
- 35193, 58644, 20899, 15822, 9424, 18621, 64522, 36967, 52790, 41563,
- 5868, 31361, 25503, 4082, 47941, 55080,
- },
- { 0, 47289, 28015, 54742, 56030, 25191, 47025, 3848, 43425, 4376,
- 50382, 31863, 29567, 52166, 7696, 42665, 20319, 63462, 8752, 39561,
- 38273, 11576, 63726, 16471, 59134, 24135, 35729, 13096, 15392, 33945,
- 20815, 59894, 40638, 9735, 62417, 19304, 17504, 64729, 10511, 37302,
- 14111, 36774, 23152, 58057, 60865, 21880, 32942, 14359, 53729, 26968,
- 48270, 1079, 2879, 45958, 26192, 57065, 30784, 49401, 5423, 44438,
- 41630, 6695, 53233, 30536, 8545, 39384, 19470, 62647, 64447, 17158,
- 38608, 11881, 35008, 12409, 58799, 23830, 21022, 60071, 16241, 34760,
- 28222, 54919, 849, 48104, 46304, 3161, 55695, 24886, 51103, 32550,
- 43760, 4681, 7489, 42488, 28718, 51351, 49119, 1894, 53936, 27145,
- 25857, 56760, 2158, 45271, 5758, 44743, 31505, 50088, 52384, 29721,
- 41423, 6518, 61568, 18489, 40431, 9558, 10846, 37607, 18225, 65416,
- 22817, 57752, 13390, 36087, 33791, 15174, 61072, 22057, 17090, 64123,
- 12205, 38676, 38940, 8357, 62835, 19914, 60259, 21466, 34316, 16053,
- 12733, 35076, 23762, 58475, 3485, 46372, 24818, 55371, 55107, 28666,
- 47660, 661, 42044, 7301, 51539, 29162, 32482, 50779, 5005, 43828,
- 56444, 25797, 45331, 2474, 1698, 48667, 27597, 54132, 30173, 52580,
- 6322, 40971, 44803, 6074, 49772, 31445, 37667, 11162, 65100, 18165,
- 18941, 61764, 9362, 39979, 14978, 33339, 22509, 61268, 57436, 22757,
- 36147, 13706, 25507, 56090, 3788, 46709, 47485, 452, 54290, 27819,
- 51714, 29371, 42861, 8148, 4316, 43109, 32179, 50442, 11516, 37957,
- 16787, 63786, 63010, 20123, 39757, 9204, 34141, 15844, 59442, 20619,
- 24451, 59194, 13036, 35413, 64797, 17828, 36978, 10443, 10179, 40826,
- 19116, 61973, 21692, 60421, 14803, 33130, 36450, 14043, 58125, 23476,
- 45634, 2811, 57133, 26516, 26780, 53285, 1523, 48458, 7139, 41818,
- 30348, 52789, 49469, 31108, 44114, 5355,
- },
- { 0, 53971, 47547, 27496, 28523, 48568, 54992, 1027, 57046, 3077,
- 26477, 46526, 45501, 25454, 2054, 56021, 41393, 29538, 6154, 51929,
- 52954, 7177, 30561, 42418, 32615, 44468, 50908, 5135, 4108, 49887,
- 43447, 31588, 24447, 36268, 59076, 13335, 12308, 58055, 35247, 23420,
- 33193, 21370, 14354, 60097, 61122, 15377, 22393, 34218, 65230, 11293,
- 18293, 38310, 37285, 17270, 10270, 64205, 8216, 62155, 39331, 19312,
- 20339, 40352, 63176, 9243, 48894, 27693, 1861, 54678, 53653, 838,
- 26670, 47869, 24616, 45819, 55699, 2880, 3907, 56720, 46840, 25643,
- 8015, 52636, 42740, 29735, 28708, 41719, 51615, 6988, 49561, 4938,
- 30754, 43761, 44786, 31777, 5961, 50586, 57729, 13138, 22586, 35561,
- 36586, 23609, 14161, 58754, 16215, 60804, 34540, 21567, 20540, 33519,
- 59783, 15188, 16432, 37603, 63883, 11096, 12123, 64904, 38624, 17459,
- 40678, 19509, 10077, 62862, 61837, 9054, 18486, 39653, 25057, 45874,
- 55386, 2697, 3722, 56409, 46897, 26082, 48951, 28132, 1676, 54367,
- 53340, 655, 27111, 47924, 49232, 4739, 31211, 43832, 44859, 32232,
- 5760, 50259, 7814, 52309, 42813, 30190, 29165, 41790, 51286, 6789,
- 16030, 60493, 34597, 22006, 20981, 33574, 59470, 15005, 57416, 12955,
- 23027, 35616, 36643, 24048, 13976, 58443, 40751, 19964, 9876, 62535,
- 61508, 8855, 18943, 39724, 16889, 37674, 63554, 10897, 11922, 64577,
- 38697, 17914, 57119, 3532, 26276, 46199, 45172, 25255, 2511, 56092,
- 457, 54042, 47218, 27297, 28322, 48241, 55065, 1482, 32430, 44157,
- 50965, 5574, 4549, 49942, 43134, 31405, 41080, 29355, 6595, 51984,
- 53011, 7616, 30376, 42107, 32864, 21171, 14811, 60168, 61195, 15832,
- 22192, 33891, 24246, 35941, 59149, 13790, 12765, 58126, 34918, 23221,
- 8657, 62210, 39018, 19129, 20154, 40041, 63233, 9682, 65287, 11732,
- 18108, 37999, 36972, 17087, 10711, 64260,
- },
- { 0, 59366, 54225, 13367, 48063, 23641, 26734, 36744, 27491, 35973,
- 47282, 24404, 53468, 14138, 781, 58603, 54982, 12576, 1303, 58097,
- 28025, 35487, 48808, 22862, 48549, 23107, 28276, 35218, 1562, 57852,
- 54731, 12845, 45457, 22135, 25152, 34214, 2606, 60872, 55807, 15897,
- 56050, 15636, 2339, 61125, 24909, 34475, 45724, 21882, 26455, 32945,
- 46214, 21344, 56552, 15118, 3897, 59615, 3124, 60370, 57317, 14339,
- 46987, 20589, 25690, 33724, 32575, 39129, 44270, 19208, 50304, 9062,
- 5969, 61623, 5212, 62394, 51085, 8299, 45027, 18437, 31794, 39892,
- 43513, 19999, 31272, 40398, 4678, 62880, 49559, 9841, 49818, 9596,
- 4427, 63149, 31013, 40643, 43764, 19730, 52910, 10568, 7551, 64153,
- 29969, 37623, 42688, 16678, 42445, 16939, 30236, 37370, 7794, 63892,
- 52643, 10821, 6248, 65422, 52153, 11359, 41943, 17457, 28678, 38880,
- 29451, 38125, 41178, 18236, 51380, 12114, 7013, 64643, 65150, 6552,
- 11695, 51785, 17857, 41511, 38416, 29174, 38173, 29435, 18124, 41258,
- 11938, 51524, 64883, 6805, 10424, 53086, 64361, 7311, 37639, 29921,
- 16598, 42800, 17371, 42045, 36874, 30700, 63588, 8066, 11189, 52307,
- 20463, 43017, 39998, 31704, 62544, 5046, 10113, 49255, 9356, 50026,
- 63325, 4283, 40755, 30933, 19682, 43780, 39209, 32463, 19192, 44318,
- 8854, 50544, 61767, 5793, 62026, 5548, 8603, 50813, 18933, 44563,
- 39460, 32194, 33089, 26279, 21136, 46454, 15102, 56600, 59695, 3785,
- 59938, 3524, 14835, 56853, 20893, 46715, 33356, 26026, 22407, 45153,
- 33878, 25520, 60472, 3038, 16361, 55311, 15588, 56066, 61237, 2259,
- 34651, 24765, 21642, 45932, 12496, 55094, 58113, 1255, 35695, 27785,
- 22718, 48984, 23475, 48213, 34914, 28548, 57356, 2026, 13277, 54331,
- 58902, 496, 13767, 53793, 23977, 47695, 36472, 27038, 36213, 27283,
- 24228, 47426, 14026, 53548, 58651, 765,
- },
- { 0, 29554, 59108, 38294, 53717, 41639, 14129, 17475, 49079, 52421,
- 22867, 10785, 28258, 7440, 34950, 64500, 25459, 4097, 34199, 63205,
- 45734, 49620, 21570, 10032, 56516, 44982, 14880, 18770, 3345, 32355,
- 60405, 39047, 50918, 46484, 8194, 21360, 5939, 25665, 61911, 33445,
- 31057, 2595, 40885, 60615, 43140, 56310, 20064, 15634, 42389, 55015,
- 17265, 12291, 29760, 1842, 37540, 57814, 6690, 26960, 64710, 36788,
- 52215, 47237, 11539, 24161, 37329, 58019, 30517, 1095, 16388, 13174,
- 42720, 54674, 11878, 23828, 51330, 48112, 65459, 36033, 6487, 27173,
- 62114, 33232, 5190, 26420, 9079, 20485, 50579, 46817, 19733, 15975,
- 44017, 55427, 40128, 61362, 31268, 2390, 22327, 9285, 45523, 49825,
- 34530, 62864, 24582, 4980, 59520, 39922, 3684, 32022, 14677, 18983,
- 57265, 44227, 13380, 18230, 53920, 41426, 58769, 38627, 885, 28679,
- 35827, 63617, 27927, 7781, 23078, 10580, 48322, 53168, 16319, 19661,
- 55643, 43561, 61034, 40216, 2190, 31740, 32776, 62330, 26348, 5534,
- 20957, 8879, 46905, 50251, 23756, 12222, 47656, 51546, 36121, 65131,
- 27645, 6287, 58235, 36873, 1439, 30445, 12974, 16860, 54346, 42808,
- 63833, 35371, 8125, 27855, 10380, 23550, 52840, 48410, 18158, 13724,
- 40970, 54136, 38715, 58441, 29151, 685, 39466, 59736, 31950, 4028,
- 19455, 14477, 44315, 56937, 9629, 22255, 50041, 45067, 62536, 34618,
- 4780, 25054, 44654, 56604, 18570, 15352, 32699, 3273, 39263, 59949,
- 4569, 25259, 63293, 33871, 49164, 45950, 9960, 21914, 52509, 48751,
- 11257, 22667, 7368, 28602, 64044, 35166, 29354, 472, 37966, 59196,
- 41855, 53261, 17819, 14057, 26760, 7162, 36460, 64798, 47453, 51759,
- 24505, 11467, 55103, 42061, 12763, 17065, 1770, 30104, 57358, 37756,
- 3067, 30857, 60703, 40557, 55854, 43356, 15562, 20408, 46156, 51006,
- 21160, 8666, 26009, 5867, 33661, 61455,
- },
- { 0, 14648, 29296, 19272, 58592, 56792, 38544, 44968, 54749, 60645,
- 42925, 40597, 12605, 2053, 17229, 31349, 47015, 36511, 50647, 64751,
- 21319, 27263, 8503, 6159, 25210, 23362, 4106, 10546, 34458, 49058,
- 62698, 52690, 29523, 19051, 291, 14363, 38835, 44683, 58819, 56571,
- 42638, 40886, 54526, 60870, 17006, 31574, 12318, 2342, 50420, 64972,
- 46724, 36796, 8212, 6444, 21092, 27484, 4393, 10257, 25433, 23137,
- 62921, 52465, 34745, 48769, 59046, 57246, 38102, 44526, 582, 15230,
- 28726, 18702, 13179, 2627, 16651, 30771, 55195, 61091, 42475, 40147,
- 20737, 26681, 9073, 6729, 46561, 36057, 51089, 65193, 34012, 48612,
- 63148, 53140, 24636, 22788, 4684, 11124, 38389, 44237, 59269, 57021,
- 28949, 18477, 869, 14941, 16424, 30992, 12888, 2912, 42184, 40432,
- 54968, 61312, 8786, 7018, 20514, 26906, 50866, 65418, 46274, 36346,
- 63375, 52919, 34303, 48327, 4975, 10839, 24863, 22567, 53585, 59497,
- 41761, 39449, 13745, 3209, 18369, 32505, 1164, 15796, 30460, 20420,
- 57452, 55636, 37404, 43812, 26358, 24526, 5254, 11710, 33302, 47918,
- 61542, 51550, 45867, 35347, 49499, 63587, 22475, 28403, 9659, 7299,
- 41474, 39738, 53362, 59722, 18146, 32730, 13458, 3498, 30687, 20199,
- 1455, 15511, 37695, 43527, 57679, 55415, 5541, 11421, 26581, 24301,
- 61765, 51325, 33589, 47629, 49272, 63808, 45576, 35632, 9368, 7584,
- 22248, 28624, 14327, 3791, 17799, 31935, 54039, 59951, 41319, 39007,
- 57898, 56082, 36954, 43362, 1738, 16370, 29882, 19842, 32848, 47464,
- 61984, 51992, 25776, 23944, 5824, 12280, 21901, 27829, 10237, 7877,
- 45421, 34901, 49949, 64037, 17572, 32156, 14036, 4076, 41028, 39292,
- 53812, 60172, 37241, 43073, 58121, 55857, 30105, 19617, 2025, 16081,
- 62211, 51771, 33139, 47179, 6115, 11995, 26003, 23723, 9950, 8166,
- 21678, 28054, 49726, 64262, 45134, 35190,
- },
- { 0, 7197, 14394, 9255, 28788, 27753, 18510, 21587, 57576, 64757,
- 55506, 50383, 37020, 35969, 43174, 46267, 56781, 49616, 58871, 63978,
- 44473, 45476, 38275, 35230, 15653, 8504, 1311, 6402, 19793, 20812,
- 30059, 26998, 42887, 48026, 40893, 33696, 55283, 52206, 61385, 62420,
- 18287, 23410, 32597, 25416, 14107, 11014, 3873, 4924, 31306, 26199,
- 17008, 24173, 2622, 5667, 12804, 11801, 39586, 34495, 41624, 48773,
- 60118, 63179, 53996, 52977, 21267, 20238, 27433, 30516, 9063, 16250,
- 7005, 1856, 46075, 45030, 35777, 38876, 50063, 57234, 64437, 59304,
- 36574, 37571, 46820, 43769, 65194, 58039, 50832, 55949, 28214, 29227,
- 22028, 18961, 7746, 607, 9848, 14949, 62612, 59529, 52398, 53427,
- 34016, 39165, 48346, 41159, 5244, 2145, 11334, 12379, 25608, 30741,
- 23602, 16431, 10585, 13636, 4451, 3454, 22829, 17712, 24855, 32010,
- 51633, 54700, 61835, 60822, 47557, 42456, 33279, 40418, 42534, 47675,
- 40476, 33281, 54866, 51791, 61032, 62069, 18126, 23251, 32500, 25321,
- 14010, 10919, 3712, 4765, 31723, 26614, 17361, 24524, 2975, 6018,
- 13221, 12216, 39683, 34590, 41785, 48932, 60279, 63338, 54093, 53072,
- 417, 7612, 14747, 9606, 29141, 28104, 18927, 22002, 57673, 64852,
- 55667, 50542, 37181, 36128, 43271, 46362, 56428, 49265, 58454, 63563,
- 44056, 45061, 37922, 34879, 15492, 8345, 1214, 6307, 19696, 20717,
- 29898, 26839, 62773, 59688, 52495, 53522, 34113, 39260, 48507, 41318,
- 5597, 2496, 11751, 12794, 26025, 31156, 23955, 16782, 10488, 13541,
- 4290, 3295, 22668, 17553, 24758, 31915, 51216, 54285, 61482, 60471,
- 47204, 42105, 32862, 40003, 21170, 20143, 27272, 30357, 8902, 16091,
- 6908, 1761, 45658, 44615, 35424, 38525, 49710, 56883, 64020, 58889,
- 36735, 37730, 46917, 43864, 65291, 58134, 50993, 56108, 28567, 29578,
- 22445, 19376, 8163, 1022, 10201, 15300,
- },
- { 0, 32897, 7455, 40350, 14910, 47807, 10017, 42912, 29820, 62717,
- 26979, 59874, 20034, 52931, 21341, 54236, 59640, 26745, 62951, 30054,
- 53958, 21063, 53209, 20312, 40068, 7173, 33179, 282, 42682, 9787,
- 48037, 15140, 52717, 19820, 53490, 20595, 63443, 30546, 60108, 27213,
- 47505, 14608, 42126, 9231, 33711, 814, 40624, 7729, 9493, 42388,
- 14346, 47243, 7979, 40874, 564, 33461, 20841, 53736, 19574, 52471,
- 27479, 60374, 30280, 63177, 34759, 1862, 39640, 6745, 48633, 15736,
- 41190, 8295, 62395, 29498, 61092, 28197, 51589, 18692, 54426, 21531,
- 28479, 61374, 29216, 62113, 21761, 54656, 18462, 51359, 6979, 39874,
- 1628, 34525, 8573, 41468, 15458, 48355, 18986, 51883, 22325, 55220,
- 28692, 61589, 27915, 60810, 15958, 48855, 9033, 41928, 1128, 34025,
- 6519, 39414, 41682, 8787, 49101, 16204, 39148, 6253, 34291, 1394,
- 54958, 22063, 52145, 19248, 60560, 27665, 61839, 28942, 5011, 37650,
- 3724, 36365, 10669, 43308, 13490, 46131, 26607, 59246, 31472, 64113,
- 24017, 56656, 16590, 49231, 64363, 31722, 58996, 26357, 49493, 16852,
- 56394, 23755, 36631, 3990, 37384, 4745, 46377, 13736, 43062, 10423,
- 56958, 24319, 50017, 17376, 58432, 25793, 63839, 31198, 43522, 10883,
- 46877, 14236, 36924, 4285, 36131, 3490, 13958, 46599, 11161, 43800,
- 3256, 35897, 4519, 37158, 17146, 49787, 24549, 57188, 30916, 63557,
- 26075, 58714, 37972, 5333, 35147, 2506, 44650, 12011, 45941, 13300,
- 57384, 24745, 64823, 32182, 55830, 23191, 50953, 18312, 31916, 64557,
- 25011, 57650, 18066, 50707, 23437, 56076, 2256, 34897, 5583, 38222,
- 13038, 45679, 12273, 44912, 22969, 55608, 17574, 50215, 25479, 58118,
- 32408, 65049, 11717, 44356, 12506, 45147, 6139, 38778, 2788, 35429,
- 45377, 12736, 44126, 11487, 35711, 3070, 38496, 5857, 50493, 17852,
- 55330, 22691, 65283, 32642, 57884, 25245,
- },
- { 0, 52943, 33155, 20300, 7963, 53716, 40600, 20567, 15926, 61689,
- 49077, 29050, 8493, 61410, 41134, 28257, 31852, 45731, 65007, 13088,
- 25463, 44472, 58100, 11323, 16986, 35989, 50137, 3350, 23873, 37774,
- 56514, 4621, 63704, 13847, 31067, 46996, 59331, 10508, 26176, 43151,
- 50926, 2081, 18285, 35234, 55797, 5946, 22646, 38585, 33972, 19067,
- 1335, 52216, 39855, 21856, 6700, 54499, 47746, 29773, 15105, 62926,
- 42393, 27478, 9242, 60117, 60845, 9058, 27694, 41697, 62134, 15481,
- 29493, 48634, 54171, 7508, 21016, 40151, 52352, 591, 19715, 33740,
- 37313, 24334, 4162, 56973, 36570, 16405, 3929, 49558, 45047, 24888,
- 11892, 57531, 45292, 32291, 12655, 65440, 5493, 56250, 38134, 23097,
- 2670, 50337, 35821, 17698, 11075, 58764, 43712, 25615, 13400, 64151,
- 46555, 31508, 26905, 42966, 59546, 9813, 30210, 47309, 63361, 14670,
- 22319, 39392, 54956, 6243, 18484, 34555, 51639, 1912, 51015, 2440,
- 18116, 34827, 55388, 5779, 23007, 38672, 63857, 14270, 30962, 46653,
- 58986, 10405, 26601, 43302, 47915, 30180, 15016, 62567, 42032, 27391,
- 9651, 60284, 34077, 19410, 1182, 51793, 39430, 21705, 7045, 54602,
- 16287, 61776, 48668, 28883, 8324, 61003, 41223, 28616, 425, 53094,
- 32810, 20197, 7858, 53373, 40753, 20990, 17395, 36156, 49776, 3263,
- 23784, 37415, 56683, 5028, 32197, 45834, 64582, 12937, 25310, 44049,
- 58205, 11666, 10986, 58405, 43881, 26022, 13809, 64318, 46194, 31421,
- 5340, 55827, 38239, 23440, 3015, 50440, 35396, 17547, 22150, 38985,
- 55045, 6602, 18845, 34642, 51230, 1745, 26800, 42623, 59699, 10236,
- 30635, 47460, 63016, 14567, 53810, 7421, 21425, 40318, 52521, 998,
- 19626, 33381, 60420, 8907, 28039, 41800, 62239, 15824, 29340, 48211,
- 44638, 24721, 12253, 57618, 45381, 32650, 12486, 65033, 36968, 24231,
- 4587, 57124, 36723, 16828, 3824, 49215,
- },
- { 0, 59880, 53197, 9765, 33671, 27247, 19530, 42402, 6931, 62203,
- 54494, 15670, 39060, 29052, 22361, 48817, 13862, 57294, 63979, 4099,
- 46497, 23625, 31340, 37764, 11573, 50397, 58104, 2832, 44722, 18266,
- 24959, 34967, 27724, 34212, 41857, 19049, 61387, 1571, 8198, 51694,
- 30559, 40631, 47250, 20858, 62680, 7472, 15125, 54013, 23146, 45954,
- 38311, 31823, 55789, 12293, 5664, 65480, 16761, 43153, 36532, 26460,
- 49918, 11030, 3379, 58587, 55448, 12656, 5973, 65213, 23327, 45815,
- 38098, 32058, 50059, 10851, 3142, 58798, 16396, 43492, 36801, 26153,
- 61118, 1878, 8563, 51355, 27961, 34001, 41716, 19228, 62893, 7237,
- 14944, 54152, 30250, 40898, 47591, 20495, 46292, 23868, 31513, 37617,
- 14163, 57019, 63646, 4470, 44999, 17967, 24586, 35298, 11328, 50600,
- 58253, 2661, 33522, 27418, 19775, 42199, 373, 59549, 52920, 10064,
- 39393, 28681, 22060, 49092, 6758, 62350, 54699, 15427, 44333, 17605,
- 25312, 35592, 11946, 51010, 57703, 2191, 46654, 24534, 31219, 36891,
- 13753, 56401, 64116, 5020, 39691, 29411, 21702, 48430, 6284, 61796,
- 55105, 16041, 32792, 27120, 20437, 42557, 927, 60023, 52306, 9658,
- 49505, 10377, 3756, 59204, 17126, 43790, 36139, 25795, 55922, 13210,
- 5567, 64599, 23029, 45085, 38456, 32720, 63303, 7855, 14474, 53602,
- 29888, 40232, 47885, 21221, 60500, 1468, 9113, 51825, 28627, 34363,
- 40990, 18934, 30133, 40029, 47736, 21392, 63026, 8154, 14847, 53271,
- 28326, 34638, 41323, 18563, 60705, 1225, 8940, 51972, 17299, 43643,
- 35934, 26038, 49172, 10748, 4057, 58929, 22656, 45416, 38733, 32421,
- 56071, 13039, 5322, 64802, 6649, 61457, 54836, 16348, 39550, 29590,
- 21939, 48219, 746, 60162, 52519, 9423, 33133, 26757, 20128, 42824,
- 12255, 50743, 57362, 2554, 44120, 17840, 25493, 35453, 13516, 56612,
- 64257, 4841, 46923, 24227, 30854, 37230,
- },
- { 0, 29813, 59626, 40095, 52681, 47548, 9507, 20822, 34703, 62458,
- 28517, 6928, 19014, 15923, 41644, 55001, 4867, 26486, 64489, 36764,
- 57034, 43711, 13856, 16981, 38028, 57593, 31846, 2067, 22853, 11568,
- 45487, 50650, 9734, 21107, 52972, 47769, 60367, 40890, 805, 30544,
- 41353, 54780, 18787, 15638, 27712, 6197, 33962, 61663, 13573, 16752,
- 56815, 43418, 63692, 36025, 4134, 25683, 45706, 50943, 23136, 11797,
- 32579, 2870, 38825, 58332, 19468, 14457, 42214, 53395, 33221, 62896,
- 26927, 7514, 52099, 49142, 9065, 22300, 1610, 29247, 61088, 39637,
- 24335, 11130, 47077, 50064, 37574, 59059, 31276, 3673, 55424, 44277,
- 12394, 17439, 5449, 24892, 64931, 35286, 27146, 7807, 33504, 63125,
- 42947, 54198, 20265, 15196, 60805, 39408, 1391, 28954, 8268, 21561,
- 51366, 48339, 30985, 3452, 37347, 58774, 46272, 49333, 23594, 10335,
- 65158, 35571, 5740, 25113, 13135, 18234, 56229, 45008, 38936, 60525,
- 28914, 1159, 21969, 8612, 48443, 51534, 8087, 27618, 63357, 33544,
- 53854, 42539, 15028, 20161, 35611, 65390, 25585, 6020, 18130, 12967,
- 44600, 55885, 3220, 30945, 58494, 36875, 49501, 46376, 10679, 24002,
- 48670, 51819, 22260, 8833, 29655, 1954, 39741, 61256, 14737, 19940,
- 53627, 42254, 62552, 32813, 7346, 26823, 44317, 55656, 17911, 12674,
- 24788, 5281, 34878, 64587, 10898, 24295, 49784, 46605, 59227, 37678,
- 4017, 31684, 54292, 41057, 15614, 18571, 6621, 28072, 61751, 34114,
- 21403, 10222, 47985, 52996, 40530, 59943, 30392, 717, 50967, 45922,
- 12285, 23432, 2782, 32427, 57908, 38465, 16536, 13549, 43122, 56327,
- 36177, 63780, 26043, 4558, 61970, 34407, 6904, 28301, 16347, 19374,
- 55089, 41796, 30109, 488, 40311, 59650, 47188, 52257, 20670, 9419,
- 57617, 38244, 2555, 32142, 11480, 22701, 50226, 45127, 26270, 4843,
- 36468, 64001, 43863, 57122, 17341, 14280,
- },
- { 0, 46261, 30071, 49602, 60142, 24155, 40857, 11052, 51649, 32116,
- 48310, 2051, 9007, 38810, 22104, 58093, 36767, 15146, 64232, 20061,
- 25969, 53700, 4102, 42163, 18014, 62187, 13097, 34716, 44208, 6149,
- 55751, 28018, 803, 46998, 30292, 49889, 59853, 23928, 40122, 10255,
- 51938, 32343, 49045, 2848, 8204, 38073, 21883, 57806, 36028, 14345,
- 63947, 19838, 26194, 53991, 4901, 42896, 17789, 61896, 12298, 33983,
- 44947, 6950, 56036, 28241, 1606, 45811, 29489, 51076, 60584, 22557,
- 39391, 11626, 53127, 31538, 47856, 3653, 9577, 37340, 20510, 58539,
- 35289, 15724, 64686, 18459, 25399, 55170, 5696, 41717, 16408, 62637,
- 13679, 33242, 43766, 7747, 57217, 27444, 1381, 45520, 28690, 50343,
- 61323, 23358, 39676, 11849, 52388, 30737, 47571, 3430, 9802, 37631,
- 21309, 59272, 35578, 15951, 65421, 19256, 24596, 54433, 5475, 41430,
- 17211, 63374, 13900, 33529, 43477, 7520, 56482, 26647, 3212, 47161,
- 31227, 52558, 58978, 21207, 37653, 10144, 50509, 29176, 45114, 1167,
- 12195, 39702, 23252, 61025, 33555, 14246, 63076, 17105, 27133, 56648,
- 7306, 43071, 19154, 65127, 16293, 35600, 41020, 5257, 54603, 25086,
- 4015, 47898, 31448, 52845, 58689, 20980, 36918, 9347, 50798, 29403,
- 45849, 1964, 11392, 38965, 23031, 60738, 32816, 13445, 62791, 16882,
- 27358, 56939, 8105, 43804, 18929, 64836, 15494, 34867, 41759, 6058,
- 54888, 25309, 2762, 48767, 32701, 51976, 57380, 21649, 38227, 8678,
- 49931, 30654, 46716, 713, 10725, 40272, 23698, 59431, 34133, 12768,
- 61474, 17559, 28603, 56078, 6860, 44665, 19604, 63521, 14819, 36182,
- 42618, 4815, 54029, 26552, 2537, 48476, 31902, 51243, 58119, 22450,
- 38512, 8901, 49192, 29853, 46431, 490, 10950, 40563, 24497, 60164,
- 34422, 12995, 62209, 18356, 27800, 55341, 6639, 44378, 20407, 64258,
- 15040, 36469, 42329, 4588, 53294, 25755,
- },
- { 0, 54485, 46519, 24930, 30579, 41894, 49860, 5649, 61158, 14899,
- 23377, 36740, 39317, 19776, 11298, 63735, 49617, 5380, 29798, 41139,
- 46754, 25207, 789, 55232, 12087, 64482, 39552, 20053, 22596, 35985,
- 60915, 14630, 40895, 19306, 10760, 65245, 59596, 15385, 23931, 35246,
- 29017, 42380, 50414, 4155, 1578, 54015, 45981, 26440, 24174, 35515,
- 60377, 16140, 10525, 64968, 40106, 18559, 45192, 25693, 1343, 53738,
- 51195, 4910, 29260, 42649, 9059, 63414, 38612, 16897, 21520, 32965,
- 57767, 13682, 52613, 6480, 30770, 44263, 47862, 28195, 3905, 56212,
- 58034, 13927, 22277, 33744, 38337, 16660, 8310, 62627, 3156, 55425,
- 47587, 27958, 31527, 45042, 52880, 6725, 48348, 26633, 2411, 56766,
- 52143, 8058, 32280, 43725, 21050, 34543, 59277, 13144, 9545, 61852,
- 37118, 17451, 32013, 43480, 51386, 7279, 2686, 57003, 49097, 27420,
- 37867, 18238, 9820, 62089, 58520, 12365, 20783, 34298, 18118, 37395,
- 62321, 10148, 12725, 58720, 33794, 20695, 43040, 31989, 7575, 51522,
- 57171, 2950, 27364, 48689, 34583, 21442, 12960, 58997, 61540, 9393,
- 17875, 37126, 27121, 48420, 56390, 2195, 7810, 51799, 43829, 32736,
- 55673, 3500, 27854, 47131, 44554, 31455, 7101, 53096, 14239, 58186,
- 33320, 22269, 16620, 37945, 62811, 8590, 6312, 52349, 44319, 31178,
- 28635, 47886, 55916, 3769, 63054, 8859, 17401, 38700, 33085, 21992,
- 13450, 57439, 26021, 45424, 53266, 1223, 4822, 50691, 42849, 29620,
- 35651, 24470, 16116, 59937, 64560, 10469, 18823, 40274, 42100, 28833,
- 4547, 50454, 54023, 2002, 26288, 45669, 19090, 40519, 65317, 11248,
- 15841, 59700, 34902, 23683, 64026, 11983, 20397, 39800, 36201, 22972,
- 14558, 60427, 5372, 49193, 41291, 30110, 25487, 46938, 54840, 749,
- 15307, 61214, 36476, 23209, 19640, 39021, 63759, 11738, 54573, 504,
- 24730, 46159, 41566, 30347, 6121, 49980,
- },
- { 0, 58597, 54743, 12594, 47027, 21334, 25188, 34433, 29563, 38814,
- 42668, 16969, 50376, 8237, 4383, 62970, 59126, 531, 13089, 55236,
- 20805, 46496, 33938, 24695, 38285, 29032, 16474, 42175, 8766, 50907,
- 63465, 4876, 53745, 13588, 1062, 57539, 26178, 33447, 45973, 22384,
- 41610, 18031, 30557, 37816, 5433, 61916, 49390, 9227, 14087, 54242,
- 58064, 1589, 32948, 25681, 21859, 45446, 17532, 41113, 37291, 30030,
- 62415, 5930, 9752, 49917, 49151, 23322, 27176, 36557, 2124, 60585,
- 56731, 14718, 52356, 10337, 6483, 64950, 31543, 40914, 44768, 18949,
- 22793, 48620, 36062, 26683, 61114, 2655, 15213, 57224, 10866, 52887,
- 65445, 6976, 40385, 31012, 18454, 44275, 28174, 35563, 48089, 24380,
- 55741, 15704, 3178, 59535, 7541, 63888, 51362, 11335, 43718, 20003,
- 32529, 39924, 35064, 27677, 23855, 47562, 16203, 56238, 60060, 3705,
- 64387, 8038, 11860, 51889, 19504, 43221, 39399, 32002, 25571, 34566,
- 46644, 21201, 54352, 12469, 391, 58722, 4248, 62589, 50511, 8618,
- 42795, 17358, 29436, 38425, 34069, 25072, 20674, 46119, 12966, 54851,
- 59249, 916, 63086, 4747, 9145, 51036, 16861, 42296, 37898, 28911,
- 45586, 22263, 26565, 33568, 1441, 57668, 53366, 13459, 49513, 9612,
- 5310, 61531, 30426, 37439, 41741, 18408, 21732, 45057, 33075, 26070,
- 58199, 1970, 13952, 53861, 10143, 50042, 62024, 5805, 36908, 29897,
- 17915, 41246, 56348, 14585, 2507, 60718, 27567, 36682, 48760, 23197,
- 44903, 19330, 31408, 40533, 6356, 64561, 52483, 10726, 15082, 56847,
- 61245, 3032, 36185, 27068, 22670, 48235, 18833, 44404, 40006, 30883,
- 65058, 6855, 11253, 53008, 3565, 59656, 55354, 15583, 47710, 24251,
- 28553, 35692, 32406, 39539, 43841, 20388, 51493, 11712, 7410, 63511,
- 60187, 4094, 16076, 55849, 23720, 47181, 35199, 28058, 39008, 31877,
- 19895, 43346, 12243, 52022, 64004, 7905,
- },
- { 0, 64765, 58855, 6426, 55251, 11054, 12852, 52937, 46011, 20294,
- 22108, 43681, 25704, 39061, 33167, 32114, 31595, 34710, 40588, 25201,
- 44216, 20549, 18783, 46498, 51408, 13357, 11575, 53706, 7939, 58366,
- 64228, 1561, 63190, 2603, 4913, 61388, 8453, 56824, 50402, 14367,
- 17773, 47504, 41098, 23671, 37566, 28227, 30553, 35748, 36285, 28992,
- 26714, 38055, 23150, 42643, 49033, 17268, 15878, 49915, 56289, 10012,
- 59861, 5416, 3122, 61647, 61873, 3404, 5206, 59563, 9826, 55967,
- 50053, 16248, 16906, 48887, 42989, 23312, 38361, 26916, 28734, 36035,
- 35546, 30247, 28477, 37824, 23817, 41460, 47342, 17427, 14689, 50588,
- 56454, 8315, 61106, 4687, 2901, 63400, 1895, 64410, 57984, 7805,
- 53428, 11337, 13651, 51630, 46300, 18465, 20795, 44486, 25359, 40946,
- 34536, 31253, 31756, 33009, 39403, 25878, 43999, 22306, 20024, 45765,
- 53175, 13130, 10832, 54957, 6244, 58521, 64899, 382, 65407, 898,
- 6808, 58981, 10412, 54353, 52555, 12726, 19652, 45113, 43299, 21982,
- 39703, 26602, 32496, 33293, 33812, 30953, 25075, 40206, 21447, 44858,
- 46624, 19165, 14255, 52050, 53832, 11957, 57468, 7297, 1435, 63846,
- 2473, 62804, 60494, 4275, 56954, 8839, 15261, 51040, 47634, 18159,
- 24565, 41736, 28097, 37180, 34854, 29915, 29378, 36415, 38693, 27608,
- 42257, 23020, 16630, 48139, 49529, 15748, 9374, 55395, 5802, 59991,
- 62285, 4016, 3790, 62003, 60201, 6100, 55581, 9696, 15610, 49159,
- 48501, 16776, 22674, 42095, 27302, 38491, 36673, 29628, 30117, 35160,
- 36930, 27839, 41590, 24203, 18321, 47980, 50718, 15075, 9209, 57092,
- 4557, 60720, 62506, 2263, 63512, 1253, 7679, 57602, 12235, 54070,
- 51756, 14033, 19363, 46942, 44612, 21177, 40048, 24717, 31127, 34154,
- 33651, 32654, 26260, 39529, 21664, 43101, 45383, 19898, 12488, 52277,
- 54575, 10706, 59163, 7142, 764, 65025,
- },
- { 0, 61681, 65023, 3342, 59363, 5906, 6684, 60141, 54235, 9002,
- 11812, 57045, 13368, 50377, 51655, 14646, 48043, 19290, 18004, 46757,
- 23624, 44217, 41399, 20806, 26736, 39041, 38287, 25982, 36755, 32610,
- 29292, 33437, 27467, 39866, 38580, 26181, 36008, 31833, 29015, 33190,
- 47248, 18529, 17775, 46494, 24435, 44930, 41612, 21117, 53472, 8209,
- 11551, 56814, 14083, 51186, 51964, 14861, 827, 62410, 65220, 3637,
- 58584, 5161, 6439, 59862, 54934, 9831, 11113, 56216, 12661, 49540,
- 52362, 15483, 1357, 62908, 63666, 2115, 58030, 4703, 8017, 61344,
- 27965, 40396, 37058, 24627, 35550, 31279, 30497, 34768, 48870, 19991,
- 17177, 46056, 22789, 43508, 42234, 21515, 48605, 19756, 16418, 45267,
- 23102, 43727, 42945, 22320, 28166, 40695, 37881, 25352, 35301, 30996,
- 29722, 34027, 1654, 63111, 64393, 2936, 57749, 4452, 7274, 60571,
- 54701, 9564, 10322, 55459, 12878, 49855, 53169, 16192, 45361, 16832,
- 19662, 48191, 22226, 42531, 43821, 23516, 25322, 37403, 40725, 28644,
- 34057, 30200, 30966, 34823, 2714, 64107, 63333, 1940, 60793, 7560,
- 4230, 57463, 55617, 10672, 9406, 54351, 16034, 52819, 50013, 13228,
- 55930, 10891, 10117, 55156, 15769, 52584, 49254, 12439, 2465, 63824,
- 62558, 1199, 60994, 7859, 5053, 58188, 25041, 37152, 39982, 27871,
- 34354, 30403, 31693, 35644, 45578, 17147, 20469, 48900, 21993, 42264,
- 43030, 22759, 26535, 38742, 39512, 27305, 32836, 28853, 32187, 36170,
- 46204, 17549, 18819, 47474, 21407, 41838, 44640, 24209, 56332, 11517,
- 8691, 53506, 15343, 51998, 50704, 14049, 4055, 65318, 61992, 729,
- 59444, 6341, 5579, 58682, 3308, 64541, 61715, 482, 60175, 7166,
- 5872, 58881, 57143, 12230, 8904, 53817, 14548, 51237, 50475, 13786,
- 46919, 18358, 19128, 47689, 20644, 41045, 44379, 23978, 25756, 37997,
- 39267, 27026, 33663, 29582, 32384, 36465,
- },
- { 0, 63223, 61939, 1796, 65531, 2316, 3592, 63743, 58347, 5404,
- 4632, 58607, 7184, 60135, 60899, 6932, 56267, 11580, 10808, 56527,
- 9264, 53959, 54723, 9012, 14368, 52951, 51667, 16164, 51163, 12588,
- 13864, 49375, 43915, 23932, 23160, 44175, 21616, 41607, 42371, 21364,
- 18528, 48791, 47507, 20324, 47003, 16748, 18024, 45215, 28736, 34487,
- 33203, 30532, 36795, 31052, 32328, 35007, 37803, 25948, 25176, 38063,
- 27728, 39591, 40355, 27476, 19211, 48636, 47864, 19471, 46320, 16903,
- 17667, 46068, 43232, 24087, 22803, 45028, 22299, 41452, 42728, 20511,
- 37056, 26167, 24883, 38852, 28475, 39372, 40648, 26687, 29483, 34268,
- 33496, 29743, 36048, 31271, 32035, 35796, 57472, 5751, 4467, 59268,
- 8059, 59788, 61064, 6271, 875, 62876, 62104, 1135, 64656, 2663,
- 3427, 64404, 15179, 52668, 51896, 15439, 50352, 12871, 13635, 50100,
- 55456, 11863, 10579, 57252, 10075, 53676, 54952, 8287, 38422, 24801,
- 26597, 37138, 27117, 40730, 38942, 28393, 30205, 33546, 33806, 29433,
- 35334, 31985, 31733, 36098, 19933, 47914, 48174, 19161, 45606, 17617,
- 17365, 46370, 44598, 22721, 24517, 43314, 20941, 42810, 41022, 22217,
- 15773, 52074, 52334, 15001, 49766, 13457, 13205, 50530, 56950, 10369,
- 12165, 55666, 8589, 55162, 53374, 9865, 58966, 4257, 6053, 57682,
- 6573, 61274, 59486, 7849, 1469, 62282, 62542, 697, 64070, 3249,
- 2997, 64834, 56605, 11242, 11502, 55833, 8934, 54289, 54037, 9698,
- 16118, 51201, 52997, 14834, 49421, 14330, 12542, 50697, 1750, 61473,
- 63269, 466, 63789, 4058, 2270, 65065, 58685, 5066, 5326, 57913,
- 6854, 60465, 60213, 7618, 30358, 32865, 34661, 29074, 35181, 32666,
- 30878, 36457, 38269, 25482, 25742, 37497, 27270, 40049, 39797, 28034,
- 44381, 23466, 23726, 43609, 21158, 42065, 41813, 21922, 20150, 47169,
- 48965, 18866, 45389, 18362, 16574, 46665,
- },
- { 0, 62964, 63477, 513, 62455, 1539, 1026, 61942, 64499, 3591,
- 3078, 63986, 2052, 65008, 65521, 2565, 60411, 7695, 7182, 59898,
- 6156, 60920, 61433, 6669, 4104, 58876, 59389, 4617, 58367, 5643,
- 5130, 57854, 52203, 15903, 15390, 51690, 14364, 52712, 53225, 14877,
- 12312, 50668, 51181, 12825, 50159, 13851, 13338, 49646, 8208, 54756,
- 55269, 8721, 54247, 9747, 9234, 53734, 56291, 11799, 11286, 55778,
- 10260, 56800, 57313, 10773, 35787, 32319, 31806, 35274, 30780, 36296,
- 36809, 31293, 28728, 34252, 34765, 29241, 33743, 30267, 29754, 33230,
- 24624, 38340, 38853, 25137, 37831, 26163, 25650, 37318, 39875, 28215,
- 27702, 39362, 26676, 40384, 40897, 27189, 16416, 46548, 47061, 16929,
- 46039, 17955, 17442, 45526, 48083, 20007, 19494, 47570, 18468, 48592,
- 49105, 18981, 43995, 24111, 23598, 43482, 22572, 44504, 45017, 23085,
- 20520, 42460, 42973, 21033, 41951, 22059, 21546, 41438, 2955, 65151,
- 64638, 2442, 63612, 3464, 3977, 64125, 61560, 1420, 1933, 62073,
- 911, 63099, 62586, 398, 57456, 5508, 6021, 57969, 4999, 58995,
- 58482, 4486, 7043, 61047, 60534, 6530, 59508, 7552, 8065, 60021,
- 49248, 13716, 14229, 49761, 13207, 50787, 50274, 12694, 15251, 52839,
- 52326, 14738, 51300, 15760, 16273, 51813, 11163, 56943, 56430, 10650,
- 55404, 11672, 12185, 55917, 53352, 9628, 10141, 53865, 9119, 54891,
- 54378, 8606, 32832, 30132, 30645, 33345, 29623, 34371, 33858, 29110,
- 31667, 36423, 35910, 31154, 34884, 32176, 32689, 35397, 27579, 40527,
- 40014, 27066, 38988, 28088, 28601, 39501, 36936, 26044, 26557, 37449,
- 25535, 38475, 37962, 25022, 19371, 48735, 48222, 18858, 47196, 19880,
- 20393, 47709, 45144, 17836, 18349, 45657, 17327, 46683, 46170, 16814,
- 41040, 21924, 22437, 41553, 21415, 42579, 42066, 20902, 23459, 44631,
- 44118, 22946, 43092, 23968, 24481, 43605,
- },
- { 0, 31355, 62710, 36493, 62961, 36746, 263, 31612, 63487, 36228,
- 777, 31090, 526, 30837, 63224, 35971, 62435, 35224, 1813, 32110,
- 1554, 31849, 62180, 34975, 1052, 32359, 61674, 35473, 61933, 35734,
- 1307, 32608, 64475, 33184, 3885, 30038, 3626, 29777, 64220, 32935,
- 3108, 30303, 63698, 33449, 63957, 33710, 3363, 30552, 2104, 29251,
- 64718, 34485, 64969, 34738, 2367, 29508, 65479, 34236, 2865, 29002,
- 2614, 28749, 65216, 33979, 60331, 37328, 8029, 25894, 7770, 25633,
- 60076, 37079, 7252, 26159, 59554, 37593, 59813, 37854, 7507, 26408,
- 6216, 25139, 60606, 38597, 60857, 38850, 6479, 25396, 61367, 38348,
- 6977, 24890, 6726, 24637, 61104, 38091, 4208, 27147, 58502, 40701,
- 58753, 40954, 4471, 27404, 59279, 40436, 4985, 26882, 4734, 26629,
- 59016, 40179, 58259, 39400, 5989, 27934, 5730, 27673, 58004, 39151,
- 5228, 28183, 57498, 39649, 57757, 39910, 5483, 28432, 52043, 45360,
- 16317, 17862, 16058, 17601, 51788, 45111, 15540, 18127, 51266, 45625,
- 51525, 45886, 15795, 18376, 14504, 17107, 52318, 46629, 52569, 46882,
- 14767, 17364, 53079, 46380, 15265, 16858, 15014, 16605, 52816, 46123,
- 12432, 19179, 50278, 48669, 50529, 48922, 12695, 19436, 51055, 48404,
- 13209, 18914, 12958, 18661, 50792, 48147, 50035, 47368, 14213, 19966,
- 13954, 19705, 49780, 47119, 13452, 20215, 49274, 47617, 49533, 47878,
- 13707, 20464, 8416, 23195, 54294, 44653, 54545, 44906, 8679, 23452,
- 55071, 44388, 9193, 22930, 8942, 22677, 54808, 44131, 54019, 43384,
- 10229, 23950, 9970, 23689, 53764, 43135, 9468, 24199, 53258, 43633,
- 53517, 43894, 9723, 24448, 56123, 41280, 12237, 21942, 11978, 21681,
- 55868, 41031, 11460, 22207, 55346, 41545, 55605, 41806, 11715, 22456,
- 10456, 21155, 56366, 42581, 56617, 42834, 10719, 21412, 57127, 42332,
- 11217, 20906, 10966, 20653, 56864, 42075,
- },
- { 0, 46002, 31609, 51403, 63218, 17728, 36235, 15929, 61945, 16971,
- 35456, 14642, 1803, 46265, 31858, 53184, 65519, 19549, 33942, 14116,
- 2333, 47791, 29284, 49622, 3606, 48548, 30063, 50909, 63716, 19286,
- 33693, 12335, 58307, 20593, 39098, 11016, 5425, 42627, 28232, 56826,
- 4666, 41352, 26947, 56049, 58568, 22394, 40881, 11267, 7212, 44958,
- 26453, 54503, 60126, 22892, 37287, 8725, 60885, 24167, 38572, 9502,
- 6951, 43157, 24670, 54252, 56219, 26665, 41186, 4944, 11625, 40667,
- 22032, 58786, 10850, 39376, 20763, 58025, 56464, 28450, 42985, 5211,
- 9332, 38854, 24333, 60607, 53894, 24884, 43519, 6733, 54669, 26175,
- 44788, 7494, 9087, 37069, 22534, 60340, 14424, 35818, 17185, 61587,
- 52906, 32024, 46547, 1633, 51617, 31251, 45784, 362, 16211, 36065,
- 17450, 63384, 51127, 29701, 48334, 3964, 12613, 33527, 19004, 63886,
- 13902, 34300, 19767, 65157, 49340, 29454, 48069, 2167, 43819, 6297,
- 53330, 25568, 24025, 61035, 9888, 38162, 23250, 59744, 8619, 37401,
- 44064, 8082, 55129, 25835, 21700, 59254, 12221, 39951, 41526, 4484,
- 55631, 27389, 42301, 5775, 56900, 28150, 21455, 57469, 10422, 39684,
- 18664, 64346, 13201, 32803, 48666, 3496, 50531, 30417, 47377, 2723,
- 49768, 29146, 20451, 64593, 13466, 34600, 46855, 1205, 52350, 32716,
- 16885, 62023, 14988, 35134, 18174, 62796, 15751, 36405, 45068, 958,
- 52085, 30919, 28848, 49922, 3017, 47227, 34370, 13808, 64827, 20105,
- 33097, 13051, 64048, 18818, 30651, 50185, 3266, 49008, 36703, 15597,
- 62502, 18324, 31149, 51743, 724, 45414, 32422, 52500, 1503, 46701,
- 34900, 15334, 62253, 16543, 37747, 8385, 59402, 23480, 25985, 54835,
- 7928, 44362, 25226, 53560, 6643, 43585, 38008, 10186, 61185, 23731,
- 27804, 57134, 6117, 42071, 39534, 10716, 57623, 21157, 40293, 11991,
- 58908, 21934, 27543, 55333, 4334, 41820,
- },
- { 0, 22872, 45744, 60392, 31101, 8229, 52173, 37525, 62202, 43938,
- 16458, 6418, 35719, 53983, 14647, 24687, 63977, 41137, 19289, 4609,
- 32916, 55756, 12836, 27516, 2835, 21067, 47523, 57595, 29294, 11062,
- 49374, 39302, 61391, 46743, 23935, 1063, 38578, 53226, 9218, 32090,
- 7477, 17517, 44933, 63197, 25672, 15632, 55032, 36768, 5670, 20350,
- 42134, 64974, 28507, 13827, 56811, 33971, 58588, 48516, 22124, 3892,
- 40353, 50425, 12049, 30281, 50051, 39643, 28979, 10347, 47870, 58278,
- 2126, 20758, 12665, 26657, 33737, 55953, 18436, 4444, 64180, 41964,
- 14954, 25394, 35034, 53634, 17175, 6735, 61863, 43263, 51344, 37320,
- 31264, 9080, 45549, 59573, 861, 23045, 11340, 29972, 40700, 51108,
- 21809, 3177, 59265, 48857, 57014, 34798, 27654, 13662, 42955, 65171,
- 5499, 19491, 54693, 36093, 26389, 15949, 44248, 62848, 7784, 18224,
- 10079, 32263, 38383, 52407, 24098, 1914, 60562, 46538, 39707, 49731,
- 10667, 28915, 57958, 47934, 20694, 2446, 27105, 12473, 56145, 33289,
- 4252, 18884, 41516, 64372, 25330, 15274, 53314, 35098, 7055, 17111,
- 43327, 61543, 36872, 51536, 8888, 31712, 59765, 45101, 23493, 669,
- 29908, 11660, 50788, 40764, 3497, 21745, 48921, 58945, 34350, 57206,
- 13470, 28102, 65363, 42507, 19939, 5307, 36157, 54373, 16269, 26325,
- 62528, 44312, 18160, 8104, 32711, 9887, 52599, 37935, 1722, 24546,
- 46090, 60754, 22680, 448, 59944, 45936, 8677, 30909, 37717, 51725,
- 43618, 62266, 6354, 16778, 54047, 35399, 25007, 14583, 41329, 63529,
- 5057, 19097, 55308, 33108, 27324, 13284, 21387, 2771, 57659, 47203,
- 10998, 29614, 38982, 49438, 46935, 60943, 1511, 23743, 52778, 38770,
- 31898, 9666, 17837, 7413, 63261, 44613, 15568, 25992, 36448, 55096,
- 20158, 6118, 64526, 42326, 14275, 28315, 34163, 56363, 48196, 58652,
- 3828, 22444, 50489, 40033, 30601, 11985,
- },
- { 0, 11309, 22618, 29815, 45236, 40089, 59630, 50371, 32117, 20824,
- 9519, 2306, 52673, 57836, 38299, 47542, 64234, 54983, 41648, 36509,
- 19038, 26227, 4612, 15913, 34719, 43954, 57285, 62440, 14123, 6918,
- 28529, 17244, 59849, 50660, 45459, 40382, 22909, 30032, 295, 11530,
- 38076, 47249, 52454, 57547, 9224, 2085, 31826, 20607, 4899, 16142,
- 19321, 26452, 41879, 36794, 64461, 55264, 28246, 17019, 13836, 6689,
- 57058, 62159, 34488, 43669, 53135, 58274, 38869, 48120, 32571, 21270,
- 10081, 2892, 45818, 40663, 60064, 50829, 590, 11875, 23060, 30265,
- 13669, 6472, 27967, 16658, 34257, 43516, 56715, 61862, 18448, 25661,
- 4170, 15463, 63652, 54409, 41214, 36051, 9798, 2667, 32284, 21041,
- 38642, 47839, 52904, 57989, 23347, 30494, 873, 12100, 60295, 51114,
- 46045, 40944, 56492, 61569, 34038, 43227, 27672, 16437, 13378, 6255,
- 41433, 36340, 63875, 54702, 4461, 15680, 18743, 25882, 33539, 44846,
- 56153, 63348, 13239, 8090, 27629, 18368, 65142, 53851, 42540, 35329,
- 20162, 25327, 5784, 15029, 31209, 21956, 8627, 3486, 51549, 58736,
- 37127, 48426, 1180, 10417, 23750, 28907, 46120, 38917, 60530, 49247,
- 27338, 18151, 12944, 7869, 55934, 63059, 33316, 44553, 6079, 15250,
- 20453, 25544, 42763, 35622, 65361, 54140, 36896, 48141, 51322, 58455,
- 8340, 3257, 30926, 21731, 60757, 49528, 46351, 39202, 24033, 29132,
- 1467, 10646, 19596, 24737, 5334, 14587, 64568, 53269, 42082, 34895,
- 12793, 7636, 27043, 17806, 33101, 44384, 55575, 62778, 46694, 39499,
- 60988, 49681, 1746, 11007, 24200, 29349, 51987, 59198, 37705, 48996,
- 31655, 22410, 9213, 4048, 42309, 35176, 64799, 53554, 5617, 14812,
- 19883, 24966, 55344, 62493, 32874, 44103, 26756, 17577, 12510, 7411,
- 24495, 29570, 2037, 11224, 61211, 49974, 46913, 39788, 8922, 3831,
- 31360, 22189, 37486, 48707, 51764, 58905,
- },
- { 0, 39065, 11567, 46518, 23134, 49863, 30577, 61416, 46268, 11301,
- 39315, 266, 61154, 30331, 50125, 23380, 30053, 60924, 22602, 49363,
- 12091, 47010, 532, 39565, 49625, 22848, 60662, 29807, 39815, 798,
- 46760, 11825, 60106, 29267, 51173, 24444, 45204, 10253, 40379, 1314,
- 24182, 50927, 29529, 60352, 1064, 40113, 10503, 45470, 40879, 1846,
- 45696, 10777, 50673, 23912, 59614, 28743, 11027, 45962, 1596, 40613,
- 29005, 59860, 23650, 50427, 51593, 20752, 58534, 31807, 37847, 2894,
- 48888, 9825, 32053, 58796, 20506, 51331, 10091, 49138, 2628, 37597,
- 48364, 9333, 37315, 2394, 59058, 32299, 52125, 21252, 2128, 37065,
- 9599, 48614, 21006, 51863, 32545, 59320, 9027, 48090, 3692, 38645,
- 31005, 57732, 21554, 52395, 38911, 3942, 47824, 8777, 52641, 21816,
- 57486, 30743, 22054, 52927, 31497, 58256, 3192, 38113, 8535, 47566,
- 58010, 31235, 53173, 22316, 47300, 8285, 38379, 3442, 36623, 6038,
- 41504, 15033, 54609, 19912, 63614, 24807, 15283, 41770, 5788, 36357,
- 25069, 63860, 19650, 54363, 64106, 25331, 55109, 20444, 41012, 14509,
- 36123, 5506, 20182, 54863, 25593, 64352, 5256, 35857, 14759, 41278,
- 26053, 64860, 18666, 53363, 16283, 42754, 4788, 35373, 53625, 18912,
- 64598, 25807, 35623, 5054, 42504, 16017, 4256, 34873, 15759, 42262,
- 19198, 53863, 26577, 65352, 42012, 15493, 35123, 4522, 65090, 26331,
- 54125, 19444, 18054, 56863, 27561, 62256, 7384, 33857, 12791, 43374,
- 62010, 27299, 57109, 18316, 43108, 12541, 34123, 7634, 13283, 43898,
- 7884, 34389, 27069, 61732, 17554, 56331, 34655, 8134, 43632, 13033,
- 56577, 17816, 61486, 26807, 44108, 13525, 33123, 6650, 62994, 28299,
- 56125, 17316, 6384, 32873, 13791, 44358, 17070, 55863, 28545, 63256,
- 55593, 16816, 62470, 27807, 33655, 7150, 44632, 14017, 28053, 62732,
- 16570, 55331, 14283, 44882, 6884, 33405,
- },
- { 0, 49859, 39323, 23384, 12075, 60904, 46768, 29811, 24150, 40085,
- 51149, 1294, 29053, 46014, 59622, 10789, 48300, 32367, 9527, 59380,
- 37767, 20804, 2588, 51423, 58106, 8249, 31585, 47522, 52689, 3858,
- 21578, 38537, 25925, 42886, 64734, 15901, 19054, 34989, 54261, 4406,
- 15123, 63952, 41608, 24651, 5176, 55035, 36259, 20320, 55785, 6954,
- 16498, 33457, 63170, 13313, 28505, 44442, 34751, 17788, 7716, 56551,
- 43156, 27223, 12559, 62412, 51850, 2121, 21265, 37330, 58785, 10082,
- 31802, 48889, 38108, 22047, 3399, 53124, 48119, 31028, 8812, 57519,
- 30246, 46309, 61373, 11646, 22797, 39886, 49302, 597, 10352, 60083,
- 45547, 29480, 1883, 50584, 40640, 23555, 45007, 27916, 13908, 62615,
- 32996, 16935, 6527, 56252, 61849, 13146, 26626, 43713, 57010, 7281,
- 18217, 34282, 4963, 53664, 35576, 18491, 15432, 65163, 42451, 26384,
- 19765, 36854, 54446, 5741, 25118, 41181, 64389, 14662, 35081, 19402,
- 4242, 53841, 42530, 25825, 16313, 64890, 55135, 5532, 20164, 35847,
- 63604, 15031, 25071, 41772, 13733, 63334, 44094, 28413, 6798, 55373,
- 33557, 16854, 27635, 43312, 62056, 12459, 17624, 34331, 56643, 8064,
- 60492, 11919, 30167, 46868, 50023, 420, 23292, 38975, 45594, 28889,
- 11137, 59714, 40241, 24562, 1194, 50793, 20704, 37411, 51579, 3000,
- 32715, 48392, 58960, 9363, 3766, 52341, 38701, 21998, 8605, 58206,
- 47110, 31429, 17283, 33088, 55832, 6363, 27816, 44651, 62771, 14320,
- 7637, 57110, 33870, 18061, 13054, 61501, 43877, 27046, 65327, 15852,
- 26292, 42103, 53252, 4807, 18847, 35676, 41337, 25530, 14562, 64033,
- 36434, 19601, 6089, 54538, 9926, 58373, 48989, 32158, 2541, 52014,
- 36982, 21173, 30864, 47699, 57611, 9160, 22459, 38264, 52768, 3299,
- 39530, 22697, 1009, 49458, 46401, 30594, 11482, 60953, 50236, 1791,
- 23975, 40804, 60183, 10708, 29324, 45135,
- },
- { 0, 61422, 50113, 11311, 39839, 29809, 22622, 47024, 11043, 50381,
- 59618, 1804, 45244, 24402, 29565, 40083, 22086, 47528, 38279, 31337,
- 52697, 8759, 3608, 57846, 32101, 37515, 48804, 20810, 59130, 2324,
- 9531, 51925, 44172, 17250, 28493, 32931, 14099, 55549, 62674, 6972,
- 34735, 26689, 17518, 43904, 7216, 62430, 57329, 12319, 64202, 5412,
- 14603, 55013, 24917, 36539, 41620, 19834, 53737, 15879, 4648, 64966,
- 19062, 42392, 35255, 26201, 17669, 43755, 34500, 26922, 56986, 12660,
- 7515, 62133, 28198, 33224, 44519, 16905, 62905, 6743, 13944, 55702,
- 4931, 64685, 53378, 16236, 35036, 26418, 19229, 42227, 14432, 55182,
- 64417, 5199, 41983, 19473, 24638, 36816, 59785, 1639, 10824, 50598,
- 29206, 40440, 45527, 24121, 49834, 11588, 363, 61061, 22837, 46811,
- 39668, 29978, 49103, 20513, 31758, 37856, 9296, 52158, 59281, 2175,
- 38124, 31490, 22317, 47299, 3955, 57501, 52402, 9052, 35338, 26084,
- 18891, 42533, 4501, 65147, 53844, 15802, 41257, 20167, 25320, 36102,
- 15030, 54616, 63863, 5785, 56396, 13218, 8077, 61539, 18387, 43069,
- 33810, 27644, 63343, 6273, 13486, 56128, 27888, 33566, 44849, 16607,
- 9862, 51560, 58695, 2729, 48409, 21239, 32472, 37174, 3493, 57931,
- 52836, 8586, 38458, 31188, 22011, 47637, 28864, 40750, 45825, 23791,
- 60255, 1201, 10398, 51056, 23523, 46093, 38946, 30668, 49276, 12178,
- 957, 60499, 53007, 8417, 3278, 58144, 21648, 47998, 38737, 30911,
- 58412, 3010, 10221, 51203, 32691, 36957, 48242, 21404, 39241, 30375,
- 23176, 46438, 726, 60728, 49431, 12025, 45674, 23940, 29099, 40517,
- 10741, 50715, 59956, 1498, 25475, 35949, 41026, 20396, 63516, 6130,
- 15325, 54323, 18592, 42830, 35681, 25743, 54079, 15569, 4350, 65296,
- 13765, 55851, 62980, 6634, 44634, 16820, 28059, 33397, 7910, 61704,
- 56615, 13001, 34169, 27287, 18104, 43350,
- },
- { 0, 30582, 61164, 39322, 49605, 46771, 12073, 22623, 40855, 59617,
- 29051, 1549, 24146, 10532, 45246, 51144, 9011, 21573, 52703, 47785,
- 58102, 38272, 3098, 31596, 48292, 52178, 21064, 9534, 32097, 2583,
- 37773, 58619, 18022, 12560, 43146, 57340, 34723, 61653, 26959, 7737,
- 55793, 44679, 14109, 16491, 6196, 28482, 63192, 33198, 25941, 4643,
- 35769, 64719, 42128, 54246, 19068, 15626, 64194, 36276, 5166, 25432,
- 15111, 19569, 54763, 41629, 36044, 64442, 25120, 5462, 19721, 14975,
- 41957, 54419, 4955, 25645, 64951, 35521, 53918, 42472, 15474, 19204,
- 45055, 55433, 16659, 13925, 28218, 6476, 32982, 63392, 12392, 18206,
- 56964, 43506, 61869, 34523, 8001, 26679, 51882, 48604, 9286, 21296,
- 2927, 31769, 58755, 37621, 21821, 8779, 48081, 52391, 38136, 58254,
- 31252, 3426, 59801, 40687, 1909, 28675, 10332, 24362, 50864, 45510,
- 30222, 376, 39138, 61332, 47051, 49341, 22823, 11857, 1413, 29427,
- 60265, 39967, 50240, 45878, 10924, 24026, 39442, 60772, 29950, 904,
- 23511, 11425, 46395, 49741, 9910, 20928, 51290, 48940, 59251, 36869,
- 2463, 32489, 47393, 52823, 22477, 8379, 30948, 3986, 38408, 57726,
- 17379, 13461, 44303, 55929, 33318, 62800, 27850, 7100, 56436, 43778,
- 12952, 17902, 7601, 27335, 62301, 33835, 24784, 6054, 36412, 63818,
- 41237, 54883, 20473, 14479, 65351, 34865, 4523, 26333, 16002, 18932,
- 53358, 42776, 35145, 65087, 26533, 4307, 18572, 16378, 42592, 53526,
- 5854, 25000, 63538, 36676, 55067, 41069, 14839, 20097, 43642, 56588,
- 17558, 13280, 27583, 7369, 34131, 61989, 13805, 17051, 56065, 44151,
- 62504, 33630, 6852, 28082, 53039, 47193, 8643, 22197, 3818, 31132,
- 57350, 38768, 20664, 10190, 48724, 51490, 37245, 58891, 32657, 2279,
- 60444, 39786, 752, 30086, 11737, 23215, 49973, 46147, 29579, 1277,
- 40295, 59921, 45646, 50488, 23714, 11220,
- },
- { 0, 15162, 30324, 19790, 60648, 55250, 39580, 41382, 50637, 65271,
- 46009, 34947, 10533, 4639, 24401, 25707, 38791, 44221, 57843, 56009,
- 31599, 16469, 3355, 13857, 21066, 26992, 9278, 7940, 48802, 34200,
- 51414, 62444, 13075, 2089, 17767, 32349, 57339, 58561, 43407, 37557,
- 63198, 52708, 32938, 48016, 6710, 8460, 27714, 22392, 42132, 40878,
- 53984, 59866, 18556, 29510, 15880, 1330, 24921, 23139, 5933, 11287,
- 36273, 46731, 64453, 49407, 26150, 23836, 4178, 11112, 35534, 45556,
- 64698, 51072, 41963, 39121, 54687, 61093, 20227, 29753, 14711, 589,
- 61857, 51867, 34773, 48367, 7497, 9843, 27453, 20487, 13420, 3926,
- 16920, 31010, 55428, 58302, 44784, 38346, 21813, 28175, 9025, 6267,
- 47581, 33511, 53161, 62611, 37112, 43970, 59020, 56758, 31760, 18218,
- 2660, 12638, 49842, 63880, 46278, 36860, 11866, 5472, 22574, 25364,
- 1919, 15429, 28939, 18993, 60311, 53421, 40419, 42713, 52300, 63350,
- 47672, 33026, 8356, 7070, 22224, 28138, 2433, 12987, 32757, 17615,
- 58729, 56915, 37661, 43047, 23499, 24817, 11711, 5765, 46883, 35865,
- 49495, 64109, 40454, 42300, 59506, 54088, 29422, 18900, 1178, 16288,
- 65375, 50277, 35115, 45585, 5047, 10381, 26051, 24313, 14994, 424,
- 19686, 30684, 54906, 60736, 40974, 39732, 26840, 21474, 7852, 9622,
- 33840, 48906, 62020, 51582, 44309, 38447, 56161, 57435, 16893, 31431,
- 14217, 3251, 43626, 37200, 56350, 59172, 18050, 32184, 12534, 3020,
- 28583, 21661, 6611, 8937, 33615, 47221, 62779, 52737, 15853, 1751,
- 19353, 28835, 53509, 59967, 42865, 40011, 63520, 49946, 36436, 46446,
- 5320, 12274, 25276, 22918, 39289, 41539, 61197, 54327, 30097, 20139,
- 997, 14559, 23732, 26510, 10944, 4602, 45148, 35686, 50728, 64786,
- 3838, 13764, 30858, 17328, 57878, 55596, 37986, 44888, 52019, 61449,
- 48455, 34429, 10203, 7393, 20911, 27285,
- },
- { 0, 7452, 14904, 10020, 29808, 26988, 20040, 21332, 59616, 62972,
- 53976, 53188, 40080, 33164, 42664, 48052, 52701, 53441, 63461, 60153,
- 47533, 42161, 33685, 40585, 9533, 14369, 7941, 537, 20813, 19537,
- 27509, 30313, 34727, 39611, 48543, 41091, 62423, 61131, 51695, 54515,
- 28487, 29275, 21887, 18531, 6967, 1579, 8463, 15379, 19066, 22374,
- 28738, 27998, 15882, 8982, 1074, 6446, 41626, 49030, 39074, 34238,
- 55018, 52214, 60626, 61902, 4947, 3663, 10603, 13431, 26403, 31295,
- 23835, 16391, 64435, 59055, 49547, 56471, 36803, 37599, 46587, 43239,
- 56974, 50066, 58550, 63914, 43774, 47074, 37062, 36314, 13934, 11122,
- 3158, 4426, 16926, 24322, 30758, 25914, 38132, 35304, 44748, 46032,
- 57476, 64920, 55996, 51104, 31764, 24840, 17964, 23344, 2148, 5496,
- 12892, 12096, 22825, 17461, 25361, 32269, 11609, 12357, 5985, 2685,
- 45513, 44245, 35825, 38637, 50617, 55461, 65409, 58013, 9894, 15290,
- 7326, 386, 21206, 20426, 26862, 30194, 52806, 54106, 62590, 59746,
- 47670, 42794, 32782, 40210, 60283, 63079, 53571, 52319, 40715, 33303,
- 42291, 47151, 923, 7815, 14755, 9407, 30699, 27383, 19923, 20687,
- 41217, 48157, 39737, 34341, 54641, 51309, 61257, 62037, 18913, 21757,
- 29657, 28357, 15761, 8333, 1961, 6837, 27868, 29120, 22244, 19448,
- 6316, 1456, 8852, 16264, 33852, 39200, 48644, 41752, 61516, 60752,
- 51828, 55144, 13813, 10473, 4045, 4817, 16773, 23705, 31677, 26273,
- 56597, 49161, 59181, 64049, 43365, 46201, 37725, 36417, 63528, 58676,
- 49680, 57100, 35928, 37188, 46688, 43900, 4296, 3540, 10992, 14316,
- 25784, 31140, 24192, 17308, 45650, 44878, 34922, 38262, 50722, 56126,
- 64538, 57606, 23218, 18350, 24714, 32150, 11970, 13278, 5370, 2534,
- 32655, 25235, 17847, 22699, 3071, 5859, 12743, 11483, 38767, 35443,
- 44375, 45131, 58143, 65027, 55591, 50235,
- },
- { 0, 3599, 7198, 4625, 14396, 13875, 9250, 10797, 28792, 32375,
- 27750, 25193, 18500, 17995, 21594, 23125, 57584, 61183, 64750, 62177,
- 55500, 54979, 50386, 51933, 37000, 40583, 35990, 33433, 43188, 42683,
- 46250, 47781, 56829, 54258, 49635, 53228, 58817, 60366, 63967, 63440,
- 44421, 41866, 45467, 49044, 38329, 39862, 35239, 34728, 15629, 13058,
- 8467, 12060, 1329, 2878, 6447, 5920, 19829, 17274, 20843, 24420,
- 30025, 31558, 26967, 26456, 42983, 43496, 48121, 46582, 40923, 37332,
- 33733, 36298, 55199, 55696, 52097, 50574, 61347, 57772, 62397, 64946,
- 18199, 18712, 23305, 21766, 32555, 28964, 25397, 27962, 14191, 14688,
- 11121, 9598, 3923, 348, 4941, 7490, 31258, 29717, 26116, 26635,
- 16934, 19497, 24120, 20535, 2658, 1133, 5756, 6259, 12894, 15441,
- 11840, 8271, 39658, 38117, 34548, 35067, 41686, 44249, 48840, 45255,
- 60050, 58525, 63116, 63619, 53934, 56481, 52912, 49343, 21459, 24028,
- 20429, 16834, 27631, 26080, 30705, 31230, 9131, 11684, 16309, 12730,
- 7063, 5528, 1929, 2438, 45859, 48428, 44861, 41266, 35615, 34064,
- 38657, 39182, 50011, 52564, 57157, 53578, 64359, 62824, 59257, 59766,
- 36398, 32801, 37424, 39999, 46610, 47133, 43532, 41987, 65110, 61529,
- 57928, 60487, 50794, 51301, 55924, 54395, 28382, 24785, 29376, 31951,
- 22242, 22765, 19196, 17651, 7846, 4265, 696, 3255, 9882, 10389,
- 14980, 13451, 62516, 64059, 59434, 58917, 52232, 49671, 53270, 56857,
- 33868, 35395, 38994, 38493, 48240, 45695, 41070, 44641, 5316, 6859,
- 2266, 1749, 11512, 8951, 12518, 16105, 25788, 27315, 30882, 30381,
- 23680, 21135, 16542, 20113, 10697, 10182, 13783, 15320, 4597, 8186,
- 3563, 996, 22961, 22462, 17839, 19360, 24973, 28546, 32147, 29596,
- 51513, 50998, 54567, 56104, 61701, 65290, 60699, 58132, 47425, 46926,
- 42335, 43856, 33149, 36722, 40291, 37740,
- },
- { 0, 35208, 3853, 34437, 7706, 38802, 4375, 39071, 15412, 46524,
- 13113, 47793, 8750, 43942, 11555, 42155, 30824, 61920, 30565, 65261,
- 26226, 61434, 27007, 57591, 17500, 52692, 19281, 49881, 23110, 54222,
- 21835, 56515, 61648, 31064, 65501, 30293, 61130, 26434, 57799, 26703,
- 52452, 17772, 50153, 19041, 54014, 23414, 56819, 21627, 35000, 304,
- 34741, 3645, 38562, 7978, 39343, 4135, 46220, 15620, 48001, 12809,
- 43670, 8990, 42395, 11283, 64957, 29749, 62128, 31544, 58279, 27183,
- 60586, 25890, 49545, 18433, 52868, 18188, 57235, 22043, 53406, 22806,
- 34261, 3165, 35544, 848, 39887, 4679, 38082, 7498, 47585, 12393,
- 46828, 16228, 43003, 11891, 43254, 8574, 3437, 34021, 608, 35816,
- 4983, 39679, 7290, 38386, 12633, 47313, 15956, 47068, 12099, 42699,
- 8270, 43462, 29957, 64653, 31240, 62336, 27423, 58007, 25618, 60826,
- 18737, 49337, 17980, 53172, 22315, 56995, 22566, 53678, 59239, 28399,
- 59498, 25058, 63869, 28917, 63088, 32760, 56147, 21211, 54366, 24022,
- 50505, 19649, 51780, 17356, 40719, 5767, 36866, 6538, 33045, 2205,
- 36376, 1936, 41787, 10931, 44086, 9662, 48417, 13481, 45612, 15268,
- 6071, 40511, 6330, 37170, 2477, 32805, 1696, 36648, 11139, 41483,
- 9358, 44294, 13721, 48145, 14996, 45852, 28639, 58967, 24786, 59738,
- 29125, 63565, 32456, 63296, 21483, 55907, 23782, 54638, 19953, 50297,
- 17148, 52084, 6874, 37714, 5591, 40031, 1216, 36168, 3021, 33349,
- 9966, 44902, 10723, 41067, 14580, 45436, 14329, 48753, 25266, 60218,
- 28095, 58423, 31912, 62752, 29605, 64045, 24198, 55054, 20875, 55299,
- 16540, 51476, 20369, 50713, 59914, 25474, 58631, 27791, 62480, 32152,
- 64285, 29333, 54846, 24502, 55603, 20667, 51236, 16812, 50985, 20129,
- 37474, 7146, 40303, 5351, 35960, 1520, 33653, 2813, 44630, 10206,
- 41307, 10451, 45132, 14788, 48961, 14025,
- },
- { 0, 17477, 34954, 52431, 3337, 18764, 34179, 49606, 6674, 24151,
- 37528, 55005, 5915, 21342, 40849, 56276, 13348, 28769, 48302, 63723,
- 14637, 32104, 45479, 62946, 11830, 27251, 42684, 58105, 9023, 26490,
- 43957, 61424, 26696, 11277, 57538, 42119, 25921, 8452, 60875, 43406,
- 29274, 13855, 64208, 48789, 32595, 15126, 63449, 45980, 23660, 6185,
- 54502, 37027, 20837, 5408, 55791, 40362, 18046, 571, 52980, 35505,
- 19319, 3890, 50173, 34744, 53392, 38101, 22554, 7263, 56729, 39388,
- 21779, 4438, 51842, 36551, 16904, 1613, 51083, 33742, 20225, 2884,
- 58548, 41201, 27710, 10363, 59837, 44536, 24887, 9586, 65190, 47843,
- 30252, 12905, 62383, 47082, 31525, 16224, 47320, 64669, 12370, 29719,
- 46545, 61844, 15707, 31006, 41674, 59023, 10816, 28165, 44995, 60294,
- 10057, 25356, 36092, 51385, 1142, 16435, 33269, 50608, 2431, 19770,
- 38638, 53931, 7780, 23073, 39911, 57250, 4973, 22312, 48445, 63864,
- 13751, 29170, 45108, 62577, 14526, 31995, 42799, 58218, 12197, 27616,
- 43558, 61027, 8876, 26345, 35097, 52572, 403, 17878, 33808, 49237,
- 3226, 18655, 37643, 55118, 7041, 24516, 40450, 55879, 5768, 21197,
- 54645, 37168, 24063, 6586, 55420, 39993, 20726, 5299, 53095, 35618,
- 18413, 936, 49774, 34347, 19172, 3745, 57681, 42260, 27099, 11678,
- 60504, 43037, 25810, 8343, 64323, 48902, 29641, 14220, 63050, 45583,
- 32448, 14981, 28077, 10728, 58663, 41314, 24740, 9441, 59438, 44139,
- 30655, 13306, 65333, 47984, 31414, 16115, 62012, 46713, 22921, 7628,
- 53507, 38214, 21632, 4293, 56330, 38991, 17307, 2014, 51985, 36692,
- 20114, 2775, 50712, 33373, 1509, 16800, 36207, 51498, 2284, 19625,
- 32870, 50211, 8183, 23474, 38781, 54072, 4862, 22203, 39540, 56881,
- 12737, 30084, 47435, 64782, 15560, 30861, 46146, 61447, 11219, 28566,
- 41817, 59164, 9946, 25247, 44624, 59925,
- },
- { 0, 44205, 17735, 59882, 35470, 9763, 53193, 25444, 2305, 42412,
- 19526, 57579, 33679, 12066, 50888, 27237, 4610, 48815, 22341, 64488,
- 39052, 13345, 56779, 29030, 6915, 47022, 24132, 62185, 37261, 15648,
- 54474, 30823, 9220, 34985, 24899, 52718, 44682, 551, 60365, 18272,
- 11525, 33192, 26690, 50415, 42891, 2854, 58060, 20065, 13830, 39595,
- 29505, 57324, 48264, 4133, 63951, 21858, 16135, 37802, 31296, 55021,
- 46473, 6436, 61646, 23651, 18440, 58533, 3407, 41442, 49798, 28203,
- 34753, 11116, 16649, 60836, 1102, 43235, 52103, 26410, 36544, 8813,
- 23050, 63143, 8013, 46048, 53380, 31785, 38339, 14702, 21259, 65446,
- 5708, 47841, 55685, 29992, 40130, 12399, 27660, 49313, 10571, 34278,
- 59010, 18991, 41925, 3944, 25869, 51616, 8266, 36071, 61315, 17198,
- 43716, 1641, 32270, 53923, 15177, 38884, 62592, 22573, 45511, 7530,
- 30479, 56226, 12872, 40677, 64897, 20780, 47302, 5227, 36880, 15549,
- 54615, 31226, 6814, 46643, 24537, 62324, 39185, 13756, 56406, 28923,
- 5023, 48946, 22232, 64117, 33298, 11967, 51029, 27640, 2204, 42033,
- 19931, 57718, 35603, 10174, 52820, 25337, 413, 44336, 17626, 59511,
- 46100, 6329, 61779, 24062, 16026, 37431, 31709, 55152, 48405, 4536,
- 63570, 21759, 14235, 39734, 29404, 56945, 42518, 2747, 58193, 20476,
- 11416, 32821, 27103, 50546, 44823, 954, 59984, 18173, 9625, 35124,
- 24798, 52339, 55320, 29877, 40287, 12786, 21142, 65083, 6097, 47996,
- 53529, 32180, 37982, 14579, 23447, 63290, 7888, 45693, 51738, 26295,
- 36701, 9200, 16532, 60473, 1491, 43390, 49947, 28598, 34396, 10993,
- 18837, 58680, 3282, 41087, 64540, 20657, 47451, 5622, 30354, 55871,
- 13269, 40824, 62749, 22960, 45146, 7415, 32659, 54078, 15060, 38521,
- 60958, 17075, 43865, 2036, 25744, 51261, 8663, 36218, 59167, 19378,
- 41560, 3829, 28049, 49468, 10454, 33915,
- },
- { 0, 55513, 44463, 30070, 18243, 40858, 60140, 12853, 36486, 22111,
- 9001, 64496, 51653, 4380, 25706, 48307, 273, 55752, 44222, 29799,
- 18002, 40587, 60413, 13092, 36759, 22350, 8760, 64225, 51412, 4109,
- 25979, 48546, 546, 56059, 44941, 30548, 17761, 40376, 59598, 12311,
- 36004, 21629, 8459, 63954, 52199, 4926, 26184, 48785, 819, 56298,
- 44700, 30277, 17520, 40105, 59871, 12550, 36277, 21868, 8218, 63683,
- 51958, 4655, 26457, 49024, 1092, 56477, 43499, 28978, 17159, 39902,
- 61096, 13937, 35522, 21019, 10093, 65460, 52609, 5464, 24622, 47351,
- 1365, 56716, 43258, 28707, 16918, 39631, 61369, 14176, 35795, 21258,
- 9852, 65189, 52368, 5193, 24895, 47590, 1638, 57023, 43977, 29456,
- 16677, 39420, 60554, 13395, 35040, 20537, 9551, 64918, 53155, 6010,
- 25100, 47829, 1911, 57262, 43736, 29185, 16436, 39149, 60827, 13634,
- 35313, 20776, 9310, 64647, 52914, 5739, 25373, 48068, 2184, 53329,
- 42279, 32254, 20427, 38674, 57956, 15037, 34318, 24279, 11169, 62328,
- 49485, 6548, 27874, 46139, 2457, 53568, 42038, 31983, 20186, 38403,
- 58229, 15276, 34591, 24518, 10928, 62057, 49244, 6277, 28147, 46378,
- 2730, 53875, 42757, 32732, 19945, 38192, 57414, 14495, 33836, 23797,
- 10627, 61786, 50031, 7094, 28352, 46617, 3003, 54114, 42516, 32461,
- 19704, 37921, 57687, 14734, 34109, 24036, 10386, 61515, 49790, 6823,
- 28625, 46856, 3276, 54293, 41315, 31162, 19343, 37718, 58912, 16121,
- 33354, 23187, 12261, 63292, 50441, 7632, 26790, 45183, 3549, 54532,
- 41074, 30891, 19102, 37447, 59185, 16360, 33627, 23426, 12020, 63021,
- 50200, 7361, 27063, 45422, 3822, 54839, 41793, 31640, 18861, 37236,
- 58370, 15579, 32872, 22705, 11719, 62750, 50987, 8178, 27268, 45661,
- 4095, 55078, 41552, 31369, 18620, 36965, 58643, 15818, 33145, 22944,
- 11478, 62479, 50746, 7907, 27541, 45900,
- },
- { 0, 58083, 55771, 15160, 44971, 19784, 30320, 38035, 17227, 41384,
- 39568, 30835, 60640, 3587, 13627, 55256, 34454, 25717, 24397, 48558,
- 10557, 52190, 61670, 4613, 50653, 10046, 7174, 65253, 27254, 34965,
- 45997, 20814, 4401, 62418, 51434, 10761, 48794, 23673, 26433, 34210,
- 21114, 45209, 35745, 26946, 64977, 7986, 9226, 50921, 38823, 30020,
- 20092, 44191, 14348, 56047, 57815, 820, 54508, 13839, 3383, 61396,
- 31559, 39332, 41628, 16511, 8802, 49281, 64441, 6490, 36297, 28458,
- 21522, 46833, 24873, 33738, 47346, 23057, 52866, 11361, 5977, 62906,
- 42228, 17943, 32047, 40908, 2911, 59836, 53892, 12391, 59327, 1372,
- 15972, 56455, 18452, 43767, 37327, 29484, 13139, 53680, 60040, 2155,
- 40184, 32283, 17699, 42944, 28696, 37627, 43459, 19232, 57267, 15696,
- 1640, 58507, 46533, 22310, 27678, 36605, 6766, 63629, 50101, 8534,
- 63118, 5229, 12117, 52662, 22821, 48070, 33022, 25117, 17604, 42535,
- 40223, 32764, 60271, 2444, 12980, 53335, 1935, 58732, 56916, 15543,
- 43044, 19143, 29183, 37660, 49746, 8369, 7049, 63850, 28153, 36634,
- 46114, 22209, 33049, 25594, 22722, 47649, 11954, 52305, 63337, 5514,
- 22005, 46870, 35886, 28365, 64094, 6333, 9093, 49510, 5822, 62557,
- 53093, 11654, 47381, 23542, 24782, 33325, 54115, 12672, 2744, 59483,
- 31944, 40491, 42259, 18416, 36904, 29387, 18931, 43792, 16259, 56672,
- 58968, 1211, 26278, 33861, 49021, 23966, 51469, 11246, 4310, 62005,
- 9709, 50958, 64566, 7893, 35398, 26789, 21405, 45438, 57392, 723,
- 14827, 56072, 20379, 44408, 38464, 29859, 41851, 16792, 31392, 38979,
- 3280, 60979, 54539, 14312, 30615, 38260, 44620, 19631, 55356, 15071,
- 487, 58116, 13532, 54847, 60679, 4068, 39799, 31124, 17068, 41039,
- 61697, 5090, 10458, 51769, 24234, 48201, 34673, 26002, 45642, 20649,
- 27537, 35186, 7649, 65282, 50234, 9945,
- },
- { 0, 65534, 58337, 7199, 56287, 9249, 14398, 51136, 43939, 21597,
- 18498, 47036, 28796, 36738, 37789, 27747, 19291, 46245, 43194, 22340,
- 36996, 28538, 29541, 35995, 57592, 7942, 793, 64743, 15143, 50393,
- 55494, 10040, 38582, 26952, 30039, 35497, 19817, 45719, 44680, 20854,
- 15637, 49899, 57076, 8458, 59082, 6452, 1323, 64213, 56813, 8723,
- 15884, 49650, 1586, 63948, 58835, 6701, 30286, 35248, 38319, 27217,
- 44433, 21103, 20080, 45454, 12657, 52879, 53904, 11630, 60078, 5456,
- 2383, 63153, 39634, 25900, 31027, 34509, 16653, 48883, 41708, 23826,
- 31274, 34260, 39371, 26165, 41461, 24075, 16916, 48618, 53641, 11895,
- 12904, 52630, 2646, 62888, 59831, 5705, 42951, 22585, 17446, 48088,
- 31768, 33766, 40953, 24583, 3172, 62362, 61317, 4219, 55227, 10309,
- 13402, 52132, 60572, 4962, 3965, 61571, 14147, 51389, 54434, 11100,
- 18239, 47297, 42206, 23328, 40160, 25374, 32513, 33023, 25314, 40220,
- 33027, 32509, 47421, 18115, 23260, 42274, 51521, 14015, 10912, 54622,
- 4766, 60768, 61823, 3713, 10681, 54855, 51800, 13734, 62054, 3480,
- 4487, 61049, 33306, 32228, 25083, 40453, 22981, 42555, 47652, 17882,
- 62548, 2986, 6069, 59467, 12171, 53365, 52330, 13204, 24567, 40969,
- 48150, 17384, 33832, 31702, 26569, 38967, 48911, 16625, 23790, 41744,
- 25808, 39726, 34609, 30927, 5292, 60242, 63309, 2227, 53107, 12429,
- 11410, 54124, 21395, 44141, 45170, 20364, 34892, 30642, 27565, 37971,
- 63536, 1998, 7121, 58415, 9199, 56337, 49166, 16368, 6344, 59190,
- 64297, 1239, 49943, 15593, 8438, 57096, 45931, 19605, 20618, 44916,
- 26804, 38730, 35669, 29867, 50469, 15067, 9924, 55610, 7930, 57604,
- 64795, 741, 28294, 37240, 36199, 29337, 46425, 19111, 22200, 43334,
- 36478, 29056, 28063, 37473, 21921, 43615, 46656, 18878, 9693, 55843,
- 50748, 14786, 65026, 508, 7651, 57885,
- },
- { 0, 32638, 65276, 33154, 57829, 40603, 7961, 24679, 57303, 41129,
- 8491, 24149, 15922, 16716, 49358, 49072, 41907, 56525, 23887, 8753,
- 16982, 15656, 48298, 50132, 31844, 794, 33432, 64998, 40321, 58111,
- 25469, 7171, 23419, 9221, 42375, 56057, 47774, 50656, 17506, 15132,
- 33964, 64466, 31312, 1326, 25929, 6711, 39861, 58571, 63688, 34742,
- 1588, 31050, 6445, 26195, 59345, 39087, 10015, 22625, 55779, 42653,
- 50938, 47492, 14342, 18296, 46838, 51592, 18442, 14196, 22291, 10349,
- 43503, 54929, 26913, 5727, 38877, 59555, 35012, 63418, 30264, 2374,
- 5445, 27195, 60345, 38087, 62624, 35806, 2652, 29986, 51858, 46572,
- 13422, 19216, 11127, 21513, 54667, 43765, 60813, 37619, 4977, 27663,
- 3176, 29462, 62100, 36330, 12890, 19748, 52390, 46040, 54207, 44225,
- 11587, 21053, 20030, 12608, 45250, 53180, 45019, 53413, 20775, 11865,
- 37353, 61079, 28437, 4203, 28684, 3954, 36592, 61838, 29169, 3727,
- 36621, 61555, 36884, 61290, 28392, 4502, 44582, 53592, 20698, 12196,
- 20419, 12477, 45375, 52801, 53826, 44348, 11454, 21440, 13223, 19673,
- 52571, 45605, 3477, 29419, 62313, 35863, 60528, 37646, 4748, 28146,
- 10890, 22004, 54390, 43784, 52079, 46097, 13715, 19181, 62813, 35363,
- 2977, 29919, 5304, 27590, 59972, 38202, 35129, 63047, 30661, 2235,
- 26844, 6050, 38432, 59742, 22254, 10640, 43026, 55148, 46859, 51317,
- 18935, 13961, 50951, 47225, 14843, 18053, 9954, 22940, 55326, 42848,
- 6352, 26542, 58924, 39250, 63797, 34379, 1993, 30903, 25780, 7114,
- 39496, 58678, 34129, 64047, 31661, 1235, 47971, 50205, 17823, 15073,
- 23174, 9720, 42106, 56068, 40060, 58114, 25216, 7678, 32153, 743,
- 33637, 64539, 17323, 15573, 48471, 49705, 41550, 56624, 23730, 9164,
- 16335, 16561, 49459, 48717, 56874, 41300, 8406, 24488, 57368, 40806,
- 7908, 24986, 509, 32387, 65281, 32895,
- },
- { 0, 16190, 32380, 16706, 64760, 50118, 33412, 48570, 58861, 56019,
- 39825, 42159, 6421, 9771, 26473, 22615, 55239, 59641, 43451, 38533,
- 11071, 5121, 21827, 27261, 12842, 3348, 19542, 29544, 52946, 61932,
- 45230, 36752, 45971, 36013, 52719, 62161, 20331, 28757, 12567, 3625,
- 22142, 26944, 10242, 5948, 43654, 38328, 54522, 60356, 25684, 23402,
- 6696, 9494, 39084, 42898, 59088, 55790, 33209, 48775, 65477, 49403,
- 32065, 17023, 829, 15363, 31547, 17413, 1351, 14969, 34755, 47357,
- 63935, 50817, 40662, 41448, 57514, 57236, 25134, 23824, 7250, 9068,
- 44284, 37826, 53888, 60862, 20484, 28474, 11896, 4422, 18705, 30255,
- 14189, 2131, 46569, 35543, 52117, 62635, 51368, 63382, 46804, 35306,
- 13392, 2926, 18988, 29970, 11589, 4731, 21305, 27655, 53693, 61059,
- 44993, 37119, 8047, 8273, 24851, 24109, 58263, 56489, 40427, 41685,
- 64130, 50620, 34046, 48064, 1658, 14660, 30726, 18232, 63094, 51528,
- 34826, 46900, 2702, 13744, 29938, 19404, 5019, 11429, 28135, 21209,
- 61283, 53341, 37151, 44577, 8625, 7823, 24525, 24819, 56649, 57975,
- 41781, 39947, 50268, 64354, 47648, 34078, 14500, 1946, 18136, 31206,
- 17893, 31451, 15257, 1191, 47389, 34339, 51041, 63583, 40968, 40758,
- 56948, 57674, 23792, 25550, 8844, 7602, 37410, 44316, 60510, 54112,
- 28378, 20964, 4262, 12184, 30671, 18673, 2483, 13965, 35639, 46089,
- 62795, 51829, 36173, 45683, 62257, 52239, 29109, 20107, 4041, 12535,
- 26784, 22430, 5852, 10722, 37976, 43878, 59940, 54554, 23178, 26036,
- 9462, 7112, 42610, 39244, 55310, 59184, 48999, 32857, 49435, 65061,
- 17311, 31905, 15843, 733, 16094, 480, 16546, 32668, 49702, 64792,
- 48218, 33636, 56115, 58381, 42319, 39537, 10187, 6389, 22967, 26249,
- 59673, 54823, 38757, 43099, 5601, 10975, 27549, 21667, 3316, 13258,
- 29320, 19894, 61452, 53042, 36464, 45390,
- },
- { 0, 7966, 15932, 8482, 31864, 25446, 16964, 23898, 63728, 59374,
- 50892, 55762, 33928, 39830, 47796, 42410, 60925, 62179, 54209, 52447,
- 37253, 36507, 44985, 45223, 5389, 2579, 11057, 13359, 26997, 30315,
- 22345, 18519, 51175, 55545, 63963, 59077, 48031, 42113, 34211, 39613,
- 16151, 8201, 299, 7733, 17263, 23665, 32083, 25165, 10778, 13572,
- 5158, 2872, 22114, 18812, 26718, 30528, 53994, 52724, 60630, 62408,
- 44690, 45452, 37038, 36784, 37843, 36045, 44527, 45809, 61355, 61621,
- 53655, 52873, 27427, 29757, 21791, 18945, 5979, 2117, 10599, 13945,
- 32302, 24880, 16402, 24332, 598, 7496, 15466, 9076, 34526, 39360,
- 47330, 43004, 64166, 58808, 50330, 56196, 21556, 19242, 27144, 29974,
- 10316, 14162, 5744, 2414, 44228, 46042, 37624, 36326, 53436, 53154,
- 61056, 61854, 47561, 42711, 34805, 39147, 50609, 55983, 64397, 58515,
- 16697, 24103, 32517, 24603, 15681, 8799, 893, 7267, 15291, 9381,
- 1415, 6809, 18371, 22749, 31231, 26337, 49995, 56405, 64887, 57961,
- 48947, 41005, 33039, 40465, 54854, 51544, 59514, 63332, 43582, 46368,
- 37890, 35612, 11958, 12712, 4234, 3988, 21198, 19920, 27890, 29676,
- 64604, 58178, 49760, 56702, 32804, 40762, 48664, 41222, 1196, 7090,
- 14992, 9614, 30932, 26570, 18152, 23030, 4513, 3775, 12189, 12419,
- 28121, 29383, 21477, 19707, 59729, 63055, 55149, 51315, 38185, 35383,
- 43797, 46091, 43112, 46966, 38484, 35146, 54288, 51982, 59948, 62770,
- 20632, 20358, 28324, 29114, 11488, 13310, 4828, 3522, 17813, 23179,
- 31657, 25783, 14829, 9971, 2001, 6351, 48485, 41595, 33625, 40007,
- 49437, 56835, 65313, 57407, 28559, 28817, 20915, 20141, 5111, 3305,
- 11723, 13013, 38783, 34913, 43331, 46685, 60167, 62489, 54587, 51749,
- 33394, 40300, 48206, 41808, 65034, 57620, 49206, 57128, 31362, 26012,
- 17598, 23456, 1786, 6628, 14534, 10200,
- },
- { 0, 3854, 7708, 4370, 15416, 13110, 8740, 11562, 30832, 30590,
- 26220, 26978, 17480, 19270, 23124, 21850, 61664, 65518, 61180, 57842,
- 52440, 50134, 53956, 56778, 34960, 34718, 38540, 39298, 46248, 48038,
- 43700, 42426, 64989, 62163, 58305, 60623, 49637, 52971, 57337, 53495,
- 34221, 35491, 39857, 38079, 47509, 46747, 42889, 43143, 3389, 563,
- 4897, 7215, 12549, 15883, 12057, 8215, 30029, 31299, 27473, 25695,
- 18805, 18043, 22377, 22631, 59303, 59561, 63931, 63157, 56223, 54417,
- 50563, 51853, 40919, 37081, 33227, 36549, 41967, 44257, 48627, 45821,
- 5959, 6217, 2395, 1621, 11135, 9329, 13667, 14957, 28471, 24633,
- 28971, 32293, 21263, 23553, 19731, 16925, 6778, 5492, 1126, 2920,
- 9794, 10572, 14430, 14160, 25098, 27908, 31766, 29464, 24114, 20796,
- 16430, 20256, 60058, 58772, 62598, 64392, 54946, 55724, 51390, 51120,
- 37610, 40420, 36086, 33784, 44754, 41436, 45262, 49088, 54099, 56413,
- 52559, 49729, 61291, 57445, 61815, 65145, 43811, 42029, 46399, 47665,
- 38683, 38933, 35079, 34313, 9139, 11453, 15791, 12961, 8075, 4229,
- 407, 3737, 23491, 21709, 17887, 19153, 26619, 26869, 31207, 30441,
- 11918, 8576, 12434, 16284, 4790, 7608, 3242, 932, 22270, 23024,
- 18658, 18412, 27334, 26056, 29914, 31700, 56942, 53600, 49266, 53116,
- 57942, 60760, 64586, 62276, 42526, 43280, 47106, 46860, 39462, 38184,
- 33850, 35636, 13556, 15354, 10984, 9702, 2252, 1986, 5840, 6622,
- 19588, 17290, 21144, 23958, 28860, 32690, 28320, 25006, 50196, 51994,
- 55816, 54534, 63532, 63266, 58928, 59710, 48228, 45930, 41592, 44406,
- 32860, 36690, 40512, 37198, 51497, 50727, 55093, 55355, 62737, 64031,
- 60173, 58371, 45401, 48727, 44869, 41035, 36193, 33391, 37757, 40051,
- 14793, 14023, 10197, 10459, 1521, 2815, 7149, 5347, 16825, 20151,
- 24485, 20651, 32129, 29327, 25501, 27795,
- },
- { 0, 1798, 3596, 2314, 7192, 6942, 4628, 5394, 14384, 16182,
- 13884, 12602, 9256, 9006, 10788, 11554, 28768, 30566, 32364, 31082,
- 27768, 27518, 25204, 25970, 18512, 20310, 18012, 16730, 21576, 21326,
- 23108, 23874, 57536, 59334, 61132, 59850, 64728, 64478, 62164, 62930,
- 55536, 57334, 55036, 53754, 50408, 50158, 51940, 52706, 37024, 38822,
- 40620, 39338, 36024, 35774, 33460, 34226, 43152, 44950, 42652, 41370,
- 46216, 45966, 47748, 48514, 56733, 55963, 54161, 54423, 49541, 50819,
- 53129, 51343, 58797, 58027, 60321, 60583, 63925, 65203, 63417, 61631,
- 44541, 43771, 41969, 42231, 45541, 46819, 49129, 47343, 38349, 37579,
- 39873, 40135, 35285, 36563, 34777, 32991, 15709, 14939, 13137, 13399,
- 8517, 9795, 12105, 10319, 1389, 619, 2913, 3175, 6517, 7795,
- 6009, 4223, 19773, 19003, 17201, 17463, 20773, 22051, 24361, 22575,
- 29965, 29195, 31489, 31751, 26901, 28179, 26393, 24607, 42791, 40993,
- 43307, 44589, 47935, 48185, 46387, 45621, 40727, 38929, 37147, 38429,
- 33551, 33801, 36099, 35333, 55111, 53313, 55627, 56909, 52063, 52313,
- 50515, 49749, 61303, 59505, 57723, 59005, 62319, 62569, 64867, 64101,
- 18407, 16609, 18923, 20205, 23551, 23801, 22003, 21237, 32727, 30929,
- 29147, 30429, 25551, 25801, 28099, 27333, 14215, 12417, 14731, 16013,
- 11167, 11417, 9619, 8853, 4023, 2225, 443, 1725, 5039, 5289,
- 7587, 6821, 31418, 32188, 29878, 29616, 26274, 24996, 26798, 28584,
- 17034, 17804, 19590, 19328, 24210, 22932, 20638, 22424, 2778, 3548,
- 1238, 976, 5826, 4548, 6350, 8136, 13034, 13804, 15590, 15328,
- 12018, 10740, 8446, 10232, 39546, 40316, 38006, 37744, 34402, 33124,
- 34926, 36712, 41546, 42316, 44102, 43840, 48722, 47444, 45150, 46936,
- 59930, 60700, 58390, 58128, 62978, 61700, 63502, 65288, 53802, 54572,
- 56358, 56096, 52786, 51508, 49214, 51000,
- },
- { 0, 770, 1540, 1286, 3080, 3850, 2572, 2318, 6160, 6930,
- 7700, 7446, 5144, 5914, 4636, 4382, 12320, 13090, 13860, 13606,
- 15400, 16170, 14892, 14638, 10288, 11058, 11828, 11574, 9272, 10042,
- 8764, 8510, 24640, 25410, 26180, 25926, 27720, 28490, 27212, 26958,
- 30800, 31570, 32340, 32086, 29784, 30554, 29276, 29022, 20576, 21346,
- 22116, 21862, 23656, 24426, 23148, 22894, 18544, 19314, 20084, 19830,
- 17528, 18298, 17020, 16766, 49280, 50050, 50820, 50566, 52360, 53130,
- 51852, 51598, 55440, 56210, 56980, 56726, 54424, 55194, 53916, 53662,
- 61600, 62370, 63140, 62886, 64680, 65450, 64172, 63918, 59568, 60338,
- 61108, 60854, 58552, 59322, 58044, 57790, 41152, 41922, 42692, 42438,
- 44232, 45002, 43724, 43470, 47312, 48082, 48852, 48598, 46296, 47066,
- 45788, 45534, 37088, 37858, 38628, 38374, 40168, 40938, 39660, 39406,
- 35056, 35826, 36596, 36342, 34040, 34810, 33532, 33278, 40221, 40479,
- 39705, 38939, 37141, 37399, 38673, 37907, 34061, 34319, 33545, 32779,
- 35077, 35335, 36609, 35843, 44349, 44607, 43833, 43067, 41269, 41527,
- 42801, 42035, 46381, 46639, 45865, 45099, 47397, 47655, 48929, 48163,
- 64861, 65119, 64345, 63579, 61781, 62039, 63313, 62547, 58701, 58959,
- 58185, 57419, 59717, 59975, 61249, 60483, 52605, 52863, 52089, 51323,
- 49525, 49783, 51057, 50291, 54637, 54895, 54121, 53355, 55653, 55911,
- 57185, 56419, 23965, 24223, 23449, 22683, 20885, 21143, 22417, 21651,
- 17805, 18063, 17289, 16523, 18821, 19079, 20353, 19587, 28093, 28351,
- 27577, 26811, 25013, 25271, 26545, 25779, 30125, 30383, 29609, 28843,
- 31141, 31399, 32673, 31907, 15837, 16095, 15321, 14555, 12757, 13015,
- 14289, 13523, 9677, 9935, 9161, 8395, 10693, 10951, 12225, 11459,
- 3581, 3839, 3065, 2299, 501, 759, 2033, 1267, 5613, 5871,
- 5097, 4331, 6629, 6887, 8161, 7395,
- },
-};
-
-#endif /* __VCD_CD_SECTOR_PRIVATE_H__ */
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libvcd/stream.c b/src/input/vcd/libvcd/stream.c
deleted file mode 100644
index ccc7cf046..000000000
--- a/src/input/vcd/libvcd/stream.c
+++ /dev/null
@@ -1,276 +0,0 @@
-/*
- $Id: stream.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
-
-#include <cdio/cdio.h>
-
-/* #define STREAM_DEBUG */
-
-/* Public headers */
-
-#include <libvcd/logging.h>
-
-/* Private headers */
-#include "vcd_assert.h"
-#include "stream.h"
-#include "util.h"
-
-static const char _rcsid[] = "$Id: stream.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $";
-
-/*
- * DataSource implementations
- */
-
-struct _VcdDataSink {
- void* user_data;
- vcd_data_sink_io_functions op;
- int is_open;
- long position;
-};
-
-static void
-_vcd_data_sink_open_if_necessary(VcdDataSink *obj)
-{
- vcd_assert (obj != NULL);
-
- if (!obj->is_open) {
- if ((obj->op.open) (obj->user_data))
- vcd_error("could not opening output stream...");
- else {
- obj->is_open = 1;
- obj->position = 0;
- }
- }
-}
-
-VcdDataSink*
-vcd_data_sink_new(void *user_data, const vcd_data_sink_io_functions *funcs)
-{
- VcdDataSink *new_obj;
-
- new_obj = _vcd_malloc(sizeof(VcdDataSink));
-
- new_obj->user_data = user_data;
- memcpy(&(new_obj->op), funcs, sizeof(vcd_data_sink_io_functions));
-
- return new_obj;
-}
-
-long
-vcd_data_sink_seek(VcdDataSink* obj, long offset)
-{
- vcd_assert (obj != NULL);
-
- _vcd_data_sink_open_if_necessary(obj);
-
- if (obj->position != offset) {
- vcd_warn("had to reposition DataSink from %ld to %ld!", obj->position, offset);
- obj->position = offset;
- return obj->op.seek(obj->user_data, offset);
- }
-
- return 0;
-}
-
-long
-vcd_data_sink_write(VcdDataSink* obj, const void *ptr, long size, long nmemb)
-{
- long written;
-
- vcd_assert (obj != NULL);
-
- _vcd_data_sink_open_if_necessary(obj);
-
- written = obj->op.write(obj->user_data, ptr, size*nmemb);
- obj->position += written;
-
- return written;
-}
-
-long
-vcd_data_sink_printf (VcdDataSink *obj, const char format[], ...)
-{
- char buf[4096] = { 0, };
- long retval;
- int len;
-
- va_list args;
- va_start (args, format);
-
- len = vsnprintf (buf, sizeof(buf), format, args);
-
- if (len < 0 || len > (sizeof (buf) - 1))
- vcd_error ("vsnprintf() returned %d", len);
-
- retval = vcd_data_sink_write (obj, buf, 1, len);
-
- va_end (args);
-
- return retval;
-}
-
-void
-vcd_data_sink_close(VcdDataSink* obj)
-{
- vcd_assert (obj != NULL);
-
- if (obj->is_open) {
- obj->op.close(obj->user_data);
- obj->is_open = 0;
- obj->position = 0;
- }
-}
-
-void
-vcd_data_sink_destroy(VcdDataSink* obj)
-{
- vcd_assert (obj != NULL);
-
- vcd_data_sink_close(obj);
-
- obj->op.free(obj->user_data);
-}
-
-/*
- * DataSource implementations
- */
-
-struct _VcdDataSource {
- void* user_data;
- vcd_data_source_io_functions op;
- int is_open;
- long position;
-};
-
-static void
-_vcd_data_source_open_if_necessary(VcdDataSource *obj)
-{
- vcd_assert (obj != NULL);
-
- if (!obj->is_open) {
- if ((obj->op.open) (obj->user_data))
- vcd_error ("could not opening input stream...");
- else {
-#ifdef STREAM_DEBUG
- vcd_debug ("opened source...");
-#endif
- obj->is_open = 1;
- obj->position = 0;
- }
- }
-}
-
-long
-vcd_data_source_seek(VcdDataSource* obj, long offset)
-{
- vcd_assert (obj != NULL);
-
- _vcd_data_source_open_if_necessary(obj);
-
- if (obj->position != offset) {
-#ifdef STREAM_DEBUG
- vcd_warn("had to reposition DataSource from %ld to %ld!", obj->position, offset);
-#endif
- obj->position = offset;
- return obj->op.seek(obj->user_data, offset);
- }
-
- return 0;
-}
-
-VcdDataSource*
-vcd_data_source_new(void *user_data, const vcd_data_source_io_functions *funcs)
-{
- VcdDataSource *new_obj;
-
- new_obj = _vcd_malloc (sizeof (VcdDataSource));
-
- new_obj->user_data = user_data;
- memcpy(&(new_obj->op), funcs, sizeof(vcd_data_source_io_functions));
-
- return new_obj;
-}
-
-long
-vcd_data_source_read(VcdDataSource* obj, void *ptr, long size, long nmemb)
-{
- long read_bytes;
-
- vcd_assert (obj != NULL);
-
- _vcd_data_source_open_if_necessary(obj);
-
- read_bytes = obj->op.read(obj->user_data, ptr, size*nmemb);
- obj->position += read_bytes;
-
- return read_bytes;
-}
-
-long
-vcd_data_source_stat(VcdDataSource* obj)
-{
- vcd_assert (obj != NULL);
-
- _vcd_data_source_open_if_necessary(obj);
-
- return obj->op.stat(obj->user_data);
-}
-
-void
-vcd_data_source_close(VcdDataSource* obj)
-{
- vcd_assert (obj != NULL);
-
- if (obj->is_open) {
-#ifdef STREAM_DEBUG
- vcd_debug ("closed source...");
-#endif
- obj->op.close(obj->user_data);
- obj->is_open = 0;
- obj->position = 0;
- }
-}
-
-void
-vcd_data_source_destroy(VcdDataSource* obj)
-{
- vcd_assert (obj != NULL);
-
- vcd_data_source_close(obj);
-
- obj->op.free(obj->user_data);
-}
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libvcd/stream.h b/src/input/vcd/libvcd/stream.h
deleted file mode 100644
index 43b8c911a..000000000
--- a/src/input/vcd/libvcd/stream.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- $Id: stream.h,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-
-#ifndef __VCD_STREAM_H__
-#define __VCD_STREAM_H__
-
-#include <libvcd/types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/* typedef'ed IO functions prototypes */
-
-typedef int(*vcd_data_open_t)(void *user_data);
-
-typedef long(*vcd_data_read_t)(void *user_data, void *buf, long count);
-
-typedef long(*vcd_data_write_t)(void *user_data, const void *buf,
- long count);
-
-typedef long(*vcd_data_seek_t)(void *user_data, long offset);
-
-typedef long(*vcd_data_stat_t)(void *user_data);
-
-typedef int(*vcd_data_close_t)(void *user_data);
-
-typedef void(*vcd_data_free_t)(void *user_data);
-
-
-/* abstract data sink */
-
-typedef struct _VcdDataSink VcdDataSink;
-
-typedef struct {
- vcd_data_open_t open;
- vcd_data_seek_t seek;
- vcd_data_write_t write;
- vcd_data_close_t close;
- vcd_data_free_t free;
-} vcd_data_sink_io_functions;
-
-VcdDataSink*
-vcd_data_sink_new(void *user_data, const vcd_data_sink_io_functions *funcs);
-
-long
-vcd_data_sink_write(VcdDataSink* obj, const void *ptr, long size, long nmemb);
-
-long
-vcd_data_sink_printf (VcdDataSink *obj, const char format[], ...) GNUC_PRINTF(2, 3);
-
-long
-vcd_data_sink_seek(VcdDataSink* obj, long offset);
-
-void
-vcd_data_sink_destroy(VcdDataSink* obj);
-
-void
-vcd_data_sink_close(VcdDataSink* obj);
-
-/* abstract data source */
-
-typedef struct _VcdDataSource VcdDataSource;
-
-typedef struct {
- vcd_data_open_t open;
- vcd_data_seek_t seek;
- vcd_data_stat_t stat;
- vcd_data_read_t read;
- vcd_data_close_t close;
- vcd_data_free_t free;
-} vcd_data_source_io_functions;
-
-VcdDataSource*
-vcd_data_source_new(void *user_data, const vcd_data_source_io_functions *funcs);
-
-long
-vcd_data_source_read(VcdDataSource* obj, void *ptr, long size, long nmemb);
-
-long
-vcd_data_source_seek(VcdDataSource* obj, long offset);
-
-long
-vcd_data_source_stat(VcdDataSource* obj);
-
-void
-vcd_data_source_destroy(VcdDataSource* obj);
-
-void
-vcd_data_source_close(VcdDataSource* obj);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __VCD_STREAM_H__ */
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libvcd/stream_stdio.c b/src/input/vcd/libvcd/stream_stdio.c
deleted file mode 100644
index 4eac0f6b3..000000000
--- a/src/input/vcd/libvcd/stream_stdio.c
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- $Id: stream_stdio.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/stat.h>
-#include <errno.h>
-
-#include <cdio/cdio.h>
-
-#include <libvcd/logging.h>
-
-/* Private headers */
-#include "stream_stdio.h"
-#include "util.h"
-
-static const char _rcsid[] = "$Id: stream_stdio.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $";
-
-#define VCD_STREAM_STDIO_BUFSIZE (128*1024)
-
-typedef struct {
- char *pathname;
- FILE *fd;
- char *fd_buf;
- off_t st_size; /* used only for source */
-} _UserData;
-
-static int
-_stdio_open_source (void *user_data)
-{
- _UserData *const ud = user_data;
-
- if ((ud->fd = fopen (ud->pathname, "rb")))
- {
- ud->fd_buf = _vcd_malloc (VCD_STREAM_STDIO_BUFSIZE);
- setvbuf (ud->fd, ud->fd_buf, _IOFBF, VCD_STREAM_STDIO_BUFSIZE);
- }
-
- return (ud->fd == NULL);
-}
-
-static int
-_stdio_open_sink (void *user_data)
-{
- _UserData *const ud = user_data;
-
- if ((ud->fd = fopen (ud->pathname, "wb")))
- {
- ud->fd_buf = _vcd_malloc (VCD_STREAM_STDIO_BUFSIZE);
- setvbuf (ud->fd, ud->fd_buf, _IOFBF, VCD_STREAM_STDIO_BUFSIZE);
- }
-
- return (ud->fd == NULL);
-}
-
-static int
-_stdio_close(void *user_data)
-{
- _UserData *const ud = user_data;
-
- if (fclose (ud->fd))
- vcd_error ("fclose (): %s", strerror (errno));
-
- ud->fd = NULL;
-
- free (ud->fd_buf);
- ud->fd_buf = NULL;
-
- return 0;
-}
-
-static void
-_stdio_free(void *user_data)
-{
- _UserData *const ud = user_data;
-
- if (ud->pathname)
- free(ud->pathname);
-
- if (ud->fd) /* should be NULL anyway... */
- _stdio_close(user_data);
-
- free(ud);
-}
-
-static long
-_stdio_seek(void *user_data, long offset)
-{
- _UserData *const ud = user_data;
-
- if (fseek (ud->fd, offset, SEEK_SET))
- vcd_error ("fseek (): %s", strerror (errno));
-
- return offset;
-}
-
-static long
-_stdio_stat(void *user_data)
-{
- const _UserData *const ud = user_data;
-
- return ud->st_size;
-}
-
-static long
-_stdio_read(void *user_data, void *buf, long count)
-{
- _UserData *const ud = user_data;
- long read;
-
- read = fread(buf, 1, count, ud->fd);
-
- if (read != count)
- { /* fixme -- ferror/feof */
- if (feof (ud->fd))
- {
- vcd_debug ("fread (): EOF encountered");
- clearerr (ud->fd);
- }
- else if (ferror (ud->fd))
- {
- vcd_error ("fread (): %s", strerror (errno));
- clearerr (ud->fd);
- }
- else
- vcd_debug ("fread (): short read and no EOF?!?");
- }
-
- return read;
-}
-
-static long
-_stdio_write(void *user_data, const void *buf, long count)
-{
- _UserData *const ud = user_data;
- long written;
-
- written = fwrite(buf, 1, count, ud->fd);
-
- if (written != count)
- vcd_error ("fwrite (): %s", strerror (errno));
-
- return written;
-}
-
-VcdDataSource*
-vcd_data_source_new_stdio(const char pathname[])
-{
- VcdDataSource *new_obj = NULL;
- vcd_data_source_io_functions funcs = { 0, };
- _UserData *ud = NULL;
- struct stat statbuf;
-
- if (stat (pathname, &statbuf) == -1)
- {
- vcd_error ("could not stat() file `%s': %s", pathname, strerror (errno));
- return NULL;
- }
-
- ud = _vcd_malloc (sizeof (_UserData));
-
- ud->pathname = strdup(pathname);
- ud->st_size = statbuf.st_size; /* let's hope it doesn't change... */
-
- funcs.open = _stdio_open_source;
- funcs.seek = _stdio_seek;
- funcs.stat = _stdio_stat;
- funcs.read = _stdio_read;
- funcs.close = _stdio_close;
- funcs.free = _stdio_free;
-
- new_obj = vcd_data_source_new(ud, &funcs);
-
- return new_obj;
-}
-
-
-VcdDataSink*
-vcd_data_sink_new_stdio(const char pathname[])
-{
- VcdDataSink *new_obj = NULL;
- vcd_data_sink_io_functions funcs;
- _UserData *ud = NULL;
- struct stat statbuf;
-
- if (stat (pathname, &statbuf) != -1)
- vcd_warn ("file `%s' exist already, will get overwritten!", pathname);
-
- ud = _vcd_malloc (sizeof (_UserData));
-
- memset (&funcs, 0, sizeof (funcs));
-
- ud->pathname = strdup (pathname);
-
- funcs.open = _stdio_open_sink;
- funcs.seek = _stdio_seek;
- funcs.write = _stdio_write;
- funcs.close = _stdio_close;
- funcs.free = _stdio_free;
-
- new_obj = vcd_data_sink_new (ud, &funcs);
-
- return new_obj;
-}
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libvcd/stream_stdio.h b/src/input/vcd/libvcd/stream_stdio.h
deleted file mode 100644
index 46bca3140..000000000
--- a/src/input/vcd/libvcd/stream_stdio.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- $Id: stream_stdio.h,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-
-#ifndef __VCD_STREAM_STDIO_H__
-#define __VCD_STREAM_STDIO_H__
-
-/* Private headers */
-#include "stream.h"
-
-VcdDataSink*
-vcd_data_sink_new_stdio(const char pathname[]);
-
-VcdDataSource*
-vcd_data_source_new_stdio(const char pathname[]);
-
-#endif /* __VCD_STREAM_STDIO_H__ */
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libvcd/util.c b/src/input/vcd/libvcd/util.c
deleted file mode 100644
index a1e5c57d4..000000000
--- a/src/input/vcd/libvcd/util.c
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- $Id: util.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-/* Private includes */
-#include "vcd_assert.h"
-#include "bytesex.h"
-#include "util.h"
-
-static const char _rcsid[] = "$Id: util.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $";
-
-size_t
-_vcd_strlenv(char **str_array)
-{
- size_t n = 0;
-
- vcd_assert (str_array != NULL);
-
- while(str_array[n])
- n++;
-
- return n;
-}
-
-void
-_vcd_strfreev(char **strv)
-{
- int n;
-
- vcd_assert (strv != NULL);
-
- for(n = 0; strv[n]; n++)
- free(strv[n]);
-
- free(strv);
-}
-
-char *
-_vcd_strjoin (char *strv[], unsigned count, const char delim[])
-{
- size_t len;
- char *new_str;
- unsigned n;
-
- vcd_assert (strv != NULL);
- vcd_assert (delim != NULL);
-
- len = (count-1) * strlen (delim);
-
- for (n = 0;n < count;n++)
- len += strlen (strv[n]);
-
- len++;
-
- new_str = _vcd_malloc (len);
- new_str[0] = '\0';
-
- for (n = 0;n < count;n++)
- {
- if (n)
- strcat (new_str, delim);
- strcat (new_str, strv[n]);
- }
-
- return new_str;
-}
-
-char **
-_vcd_strsplit(const char str[], char delim) /* fixme -- non-reentrant */
-{
- int n;
- char **strv = NULL;
- char *_str, *p;
- char _delim[2] = { 0, 0 };
-
- vcd_assert (str != NULL);
-
- _str = strdup(str);
- _delim[0] = delim;
-
- vcd_assert (_str != NULL);
-
- n = 1;
- p = _str;
- while(*p)
- if (*(p++) == delim)
- n++;
-
- strv = _vcd_malloc (sizeof (char *) * (n+1));
-
- n = 0;
- while((p = strtok(n ? NULL : _str, _delim)) != NULL)
- strv[n++] = strdup(p);
-
- free(_str);
-
- return strv;
-}
-
-void *
-_vcd_malloc (size_t size)
-{
- void *new_mem = malloc (size);
-
- vcd_assert (new_mem != NULL);
-
- memset (new_mem, 0, size);
-
- return new_mem;
-}
-
-void *
-_vcd_memdup (const void *mem, size_t count)
-{
- void *new_mem = NULL;
-
- if (mem)
- {
- new_mem = _vcd_malloc (count);
- memcpy (new_mem, mem, count);
- }
-
- return new_mem;
-}
-
-char *
-_vcd_strdup_upper (const char str[])
-{
- char *new_str = NULL;
-
- if (str)
- {
- char *p;
-
- p = new_str = strdup (str);
-
- while (*p)
- {
- *p = toupper (*p);
- p++;
- }
- }
-
- return new_str;
-}
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libvcd/util.h b/src/input/vcd/libvcd/util.h
deleted file mode 100644
index c5a9ead7c..000000000
--- a/src/input/vcd/libvcd/util.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- $Id: util.h,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifndef __VCD_UTIL_H__
-#define __VCD_UTIL_H__
-
-#include <stdlib.h>
-#include <libvcd/types.h>
-
-#ifndef __CDIO_UTIL_H__
-#undef MAX
-#define MAX(a, b) (((a) > (b)) ? (a) : (b))
-
-#undef MIN
-#define MIN(a, b) (((a) < (b)) ? (a) : (b))
-
-#undef IN
-#define IN(x, low, high) ((x) >= (low) && (x) <= (high))
-
-#undef CLAMP
-#define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
-
-#endif
-
-static inline unsigned
-_vcd_len2blocks (unsigned len, int blocksize)
-{
- unsigned blocks;
-
- blocks = len / blocksize;
- if (len % blocksize)
- blocks++;
-
- return blocks;
-}
-
-/* round up to next block boundary */
-static inline unsigned
-_vcd_ceil2block (unsigned offset, int blocksize)
-{
- return _vcd_len2blocks (offset, blocksize) * blocksize;
-}
-
-static inline unsigned
-_vcd_ofs_add (unsigned offset, unsigned length, int blocksize)
-{
- if (blocksize - (offset % blocksize) < length)
- offset = _vcd_ceil2block (offset, blocksize);
-
- offset += length;
-
- return offset;
-}
-
-size_t
-_vcd_strlenv(char **str_array);
-
-char *
-_vcd_strjoin (char *strv[], unsigned count, const char delim[]);
-
-char **
-_vcd_strsplit(const char str[], char delim);
-
-void
-_vcd_strfreev(char **strv);
-
-void *
-_vcd_malloc (size_t size);
-
-void *
-_vcd_memdup (const void *mem, size_t count);
-
-char *
-_vcd_strdup_upper (const char str[]);
-
-static inline const char *
-_vcd_bool_str (bool b)
-{
- return b ? "yes" : "no";
-}
-
-#endif /* __VCD_UTIL_H__ */
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libvcd/vcd.c b/src/input/vcd/libvcd/vcd.c
deleted file mode 100644
index 0772149ec..000000000
--- a/src/input/vcd/libvcd/vcd.c
+++ /dev/null
@@ -1,2412 +0,0 @@
-/*
- $Id: vcd.c,v 1.4 2006/12/08 16:26:10 mshopf Exp $
-
- Copyright (C) 2000, 2004 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <math.h>
-
-#include <cdio/cdio.h>
-#include <cdio/iso9660.h>
-
-/* public headers */
-#include <libvcd/types.h>
-#include <libvcd/info.h>
-
-#include <libvcd/files.h>
-#include <libvcd/sector.h>
-#include <libvcd/logging.h>
-
-/* Private headers */
-#include "assert.h"
-#include "dict.h"
-#include "directory.h"
-#include "obj.h"
-#include "pbc.h"
-#include "salloc.h"
-#include "util.h"
-#include "vcd.h"
-
-static const char _rcsid[] = "$Id: vcd.c,v 1.4 2006/12/08 16:26:10 mshopf Exp $";
-
-static const char zero[CDIO_CD_FRAMESIZE_RAW] = { 0, };
-
-#define DEFAULT_ISO_PREPARER_ID "GNU VCDImager " VERSION " " HOST_ARCH
-
-/* exported private functions
- */
-
-mpeg_sequence_t *
-_vcd_obj_get_sequence_by_id (VcdObj *obj, const char sequence_id[])
-{
- CdioListNode *node;
-
- vcd_assert (sequence_id != NULL);
- vcd_assert (obj != NULL);
-
- _CDIO_LIST_FOREACH (node, obj->mpeg_sequence_list)
- {
- mpeg_sequence_t *_sequence = _cdio_list_node_data (node);
-
- if (_sequence->id && !strcmp (sequence_id, _sequence->id))
- return _sequence;
- }
-
- return NULL;
-}
-
-mpeg_sequence_t *
-_vcd_obj_get_sequence_by_entry_id (VcdObj *obj, const char entry_id[])
-{
- CdioListNode *node;
-
- vcd_assert (entry_id != NULL);
- vcd_assert (obj != NULL);
-
- _CDIO_LIST_FOREACH (node, obj->mpeg_sequence_list)
- {
- mpeg_sequence_t *_sequence = _cdio_list_node_data (node);
- CdioListNode *node2;
-
- /* default entry point */
- if (_sequence->default_entry_id
- && !strcmp (entry_id, _sequence->default_entry_id))
- return _sequence;
-
- /* additional entry points */
- _CDIO_LIST_FOREACH (node2, _sequence->entry_list)
- {
- entry_t *_entry = _cdio_list_node_data (node2);
-
- if (_entry->id
- && !strcmp (entry_id, _entry->id))
- return _sequence;
- }
- }
-
- /* not found */
-
- return NULL;
-}
-
-mpeg_segment_t *
-_vcd_obj_get_segment_by_id (VcdObj *obj, const char segment_id[])
-{
- CdioListNode *node;
-
- vcd_assert (segment_id != NULL);
- vcd_assert (obj != NULL);
-
- _CDIO_LIST_FOREACH (node, obj->mpeg_segment_list)
- {
- mpeg_segment_t *_segment = _cdio_list_node_data (node);
-
- if (_segment->id && !strcmp (segment_id, _segment->id))
- return _segment;
- }
-
- return NULL;
-}
-
-bool
-_vcd_obj_has_cap_p (const VcdObj *obj, enum vcd_capability_t capability)
-{
- switch (capability)
- {
- case _CAP_VALID:
- switch (obj->type)
- {
- case VCD_TYPE_VCD:
- case VCD_TYPE_VCD11:
- case VCD_TYPE_VCD2:
- case VCD_TYPE_SVCD:
- case VCD_TYPE_HQVCD:
- return true;
- break;
-
- case VCD_TYPE_INVALID:
- return false;
- break;
- }
- break;
-
- case _CAP_MPEG2:
- switch (obj->type)
- {
- case VCD_TYPE_VCD:
- case VCD_TYPE_VCD11:
- case VCD_TYPE_VCD2:
- case VCD_TYPE_INVALID:
- return false;
- break;
-
- case VCD_TYPE_SVCD:
- case VCD_TYPE_HQVCD:
- return true;
- break;
- }
- break;
-
- case _CAP_PBC:
- switch (obj->type)
- {
- case VCD_TYPE_VCD:
- case VCD_TYPE_VCD11:
- case VCD_TYPE_INVALID:
- return false;
- break;
-
- case VCD_TYPE_VCD2:
- case VCD_TYPE_SVCD:
- case VCD_TYPE_HQVCD:
- return true;
- break;
- }
- break;
-
- case _CAP_PBC_X:
- switch (obj->type)
- {
- case VCD_TYPE_VCD:
- case VCD_TYPE_VCD11:
- case VCD_TYPE_INVALID:
- case VCD_TYPE_SVCD:
- case VCD_TYPE_HQVCD:
- return false;
- break;
-
- case VCD_TYPE_VCD2:
- return true;
- break;
- }
- break;
-
- case _CAP_4C_SVCD:
- switch (obj->type)
- {
- case VCD_TYPE_VCD:
- case VCD_TYPE_VCD11:
- case VCD_TYPE_INVALID:
- case VCD_TYPE_VCD2:
- return false;
- break;
-
- case VCD_TYPE_SVCD:
- case VCD_TYPE_HQVCD:
- return true;
- break;
- }
- break;
-
- case _CAP_PAL_BITS:
- return _vcd_obj_has_cap_p (obj, _CAP_PBC); /* for now */
- break;
-
- case _CAP_MPEG1:
- return !_vcd_obj_has_cap_p (obj, _CAP_MPEG2); /* for now */
- break;
-
- case _CAP_TRACK_MARGINS:
- return !_vcd_obj_has_cap_p (obj, _CAP_MPEG2); /* for now */
- break;
- }
-
- vcd_assert_not_reached ();
- return false;
-}
-
-/*
- * public methods
- */
-
-VcdObj *
-vcd_obj_new (vcd_type_t vcd_type)
-{
- VcdObj *new_obj = NULL;
- static bool _first = true;
-
- if (_first)
- {
-#if defined(_DEVELOPMENT_)
- vcd_warn ("initializing libvcd %s [%s]", VERSION, HOST_ARCH);
- vcd_warn (" ");
- vcd_warn (" this is the UNSTABLE development branch!");
- vcd_warn (" use only if you know what you are doing");
- vcd_warn (" see http://www.hvrlab.org/~hvr/vcdimager/ for more information");
- vcd_warn (" ");
-#else
- vcd_debug ("initializing libvcd %s [%s]", VERSION, HOST_ARCH);
-#endif
- _first = false;
- }
-
- new_obj = _vcd_malloc (sizeof (VcdObj));
- new_obj->type = vcd_type;
-
- if (!_vcd_obj_has_cap_p (new_obj, _CAP_VALID))
- {
- vcd_error ("VCD type not supported");
- free (new_obj);
- return NULL;
- }
-
- if (vcd_type == VCD_TYPE_VCD)
- vcd_warn ("VCD 1.0 support is experimental -- user feedback needed!");
-
- new_obj->iso_volume_label = strdup ("");
- new_obj->iso_publisher_id = strdup ("");
- new_obj->iso_application_id = strdup ("");
- new_obj->iso_preparer_id = _vcd_strdup_upper (DEFAULT_ISO_PREPARER_ID);
- new_obj->info_album_id = strdup ("");
- new_obj->info_volume_count = 1;
- new_obj->info_volume_number = 1;
-
- new_obj->custom_file_list = _cdio_list_new ();
- new_obj->custom_dir_list = _cdio_list_new ();
-
-
- new_obj->mpeg_sequence_list = _cdio_list_new ();
-
- new_obj->mpeg_segment_list = _cdio_list_new ();
-
- new_obj->pbc_list = _cdio_list_new ();
-
- /* gap's defined by IEC-10149 / ECMA-130 */
-
- /* pre-gap's for tracks but the first one */
- new_obj->track_pregap = CDIO_PREGAP_SECTORS;
- /* post-gap after last track */
- new_obj->leadout_pregap = CDIO_POSTGAP_SECTORS;
-
- if (_vcd_obj_has_cap_p (new_obj, _CAP_TRACK_MARGINS))
- {
- new_obj->track_front_margin = 30;
- new_obj->track_rear_margin = 45;
- }
- else
- {
- new_obj->track_front_margin = 0;
- new_obj->track_rear_margin = 0;
- }
-
- return new_obj;
-}
-
-int
-vcd_obj_remove_item (VcdObj *obj, const char id[])
-{
- vcd_warn ("vcd_obj_remove_item('%s') not implemented yet!", id);
-
- return -1;
-}
-
-static void
-_vcd_obj_remove_mpeg_track (VcdObj *obj, int track_id)
-{
- int length;
- mpeg_sequence_t *track = NULL;
- CdioListNode *node = NULL;
-
- vcd_assert (track_id >= 0);
-
- node = _vcd_list_at (obj->mpeg_sequence_list, track_id);
-
- vcd_assert (node != NULL);
-
- track = (mpeg_sequence_t *) _cdio_list_node_data (node);
-
- vcd_mpeg_source_destroy (track->source, true);
-
- length = track->info->packets;
- length += obj->track_pregap + obj->track_front_margin + 0 + obj->track_rear_margin;
-
- /* fixup offsets */
- {
- CdioListNode *node2 = node;
- while ((node2 = _cdio_list_node_next (node2)) != NULL)
- ((mpeg_sequence_t *) _cdio_list_node_data (node))->relative_start_extent -= length;
- }
-
- obj->relative_end_extent -= length;
-
- /* shift up */
- _cdio_list_node_free (node, true);
-}
-
-int
-vcd_obj_append_segment_play_item (VcdObj *obj, VcdMpegSource *mpeg_source,
- const char item_id[])
-{
- mpeg_segment_t *segment = NULL;
-
- vcd_assert (obj != NULL);
- vcd_assert (mpeg_source != NULL);
-
- if (!_vcd_obj_has_cap_p (obj, _CAP_PBC))
- {
- vcd_error ("segment play items not supported for this vcd type");
- return -1;
- }
-
- if (!item_id)
- {
- vcd_error ("no id given for segment play item");
- return -1;
- }
-
- if (_vcd_pbc_lookup (obj, item_id))
- {
- vcd_error ("item id (%s) exists already", item_id);
- return -1;
- }
-
- vcd_info ("scanning mpeg segment item #%d for scanpoints...",
- _cdio_list_length (obj->mpeg_segment_list));
-
- vcd_mpeg_source_scan (mpeg_source, !obj->relaxed_aps,
- obj->update_scan_offsets, NULL, NULL);
-
- if (vcd_mpeg_source_get_info (mpeg_source)->packets == 0)
- {
- vcd_error ("mpeg is empty?");
- return -1;
- }
-
- /* create list node */
-
- segment = _vcd_malloc (sizeof (mpeg_sequence_t));
-
- segment->source = mpeg_source;
-
- segment->id = strdup (item_id);
-
- segment->info = vcd_mpeg_source_get_info (mpeg_source);
- segment->segment_count = _vcd_len2blocks (segment->info->packets, 150);
-
- segment->pause_list = _cdio_list_new ();
-
- vcd_debug ("SPI length is %d sector(s), allocated %d segment(s)",
- segment->info->packets,
- segment->segment_count);
-
- _cdio_list_append (obj->mpeg_segment_list, segment);
-
- return 0;
-}
-
-int
-vcd_obj_append_sequence_play_item (VcdObj *obj, VcdMpegSource *mpeg_source,
- const char item_id[],
- const char default_entry_id[])
-{
- unsigned length;
- mpeg_sequence_t *sequence = NULL;
- int track_no = _cdio_list_length (obj->mpeg_sequence_list);
-
- vcd_assert (obj != NULL);
- vcd_assert (mpeg_source != NULL);
-
- if (item_id && _vcd_pbc_lookup (obj, item_id))
- {
- vcd_error ("item id (%s) exist already", item_id);
- return -1;
- }
-
- if (default_entry_id && _vcd_pbc_lookup (obj, default_entry_id))
- {
- vcd_error ("default entry id (%s) exist already", default_entry_id);
- return -1;
- }
-
- if (default_entry_id && item_id && !strcmp (item_id, default_entry_id))
- {
- vcd_error ("default entry id == item id (%s)", item_id);
- return -1;
- }
-
- vcd_info ("scanning mpeg sequence item #%d for scanpoints...", track_no);
- vcd_mpeg_source_scan (mpeg_source, !obj->relaxed_aps,
- obj->update_scan_offsets, NULL, NULL);
-
- sequence = _vcd_malloc (sizeof (mpeg_sequence_t));
-
- sequence->source = mpeg_source;
-
- if (item_id)
- sequence->id = strdup (item_id);
-
- if (default_entry_id)
- sequence->default_entry_id = strdup (default_entry_id);
-
- sequence->info = vcd_mpeg_source_get_info (mpeg_source);
- length = sequence->info->packets;
-
- sequence->entry_list = _cdio_list_new ();
- sequence->pause_list = _cdio_list_new ();
-
- obj->relative_end_extent += obj->track_pregap;
- sequence->relative_start_extent = obj->relative_end_extent;
-
- obj->relative_end_extent += obj->track_front_margin + length + obj->track_rear_margin;
-
- /* sanity checks */
-
- if (length < 75)
- vcd_warn ("mpeg stream shorter than 75 sectors");
-
- if (!_vcd_obj_has_cap_p (obj, _CAP_PAL_BITS)
- && vcd_mpeg_get_norm (&sequence->info->shdr[0]) != MPEG_NORM_FILM
- && vcd_mpeg_get_norm (&sequence->info->shdr[0]) != MPEG_NORM_NTSC)
- vcd_warn ("VCD 1.x should contain only NTSC/FILM video (may work with PAL nevertheless)");
-
- if (!_vcd_obj_has_cap_p (obj, _CAP_MPEG1)
- && sequence->info->version == MPEG_VERS_MPEG1)
- vcd_warn ("this VCD type should not contain MPEG1 streams");
-
- if (!_vcd_obj_has_cap_p (obj, _CAP_MPEG2)
- && sequence->info->version == MPEG_VERS_MPEG2)
- vcd_warn ("this VCD type should not contain MPEG2 streams");
-
- if (!sequence->info->shdr[0].seen
- || sequence->info->shdr[1].seen
- || sequence->info->shdr[2].seen)
- vcd_warn ("sequence items should contain a motion video stream!");
-
- {
- int i;
-
- for (i = 0; i < 3; i++)
- {
- if (sequence->info->ahdr[i].seen)
- {
- if (i && !_vcd_obj_has_cap_p (obj, _CAP_MPEG2))
- vcd_warn ("audio stream #%d not supported by this VCD type", i);
-
- if (sequence->info->ahdr[i].sampfreq != 44100)
- vcd_warn ("audio stream #%d has sampling frequency %d Hz (should be 44100 Hz)",
- i, sequence->info->ahdr[i].sampfreq);
-
- if (sequence->info->ahdr[i].layer != 2)
- vcd_warn ("audio stream #%d is not layer II", i);
-
- if (_vcd_obj_has_cap_p (obj, _CAP_MPEG1)
- && sequence->info->ahdr[i].bitrate != 224*1024)
- vcd_warn ("audio stream #%d has bitrate %d kbps (should be 224 kbps for this vcd type)",
- i, sequence->info->ahdr[i].bitrate);
- }
- else if (!i && !_vcd_obj_has_cap_p (obj, _CAP_MPEG2))
- {
- vcd_warn ("this VCD type requires an audio stream to be present");
- }
- }
- }
-
- /* vcd_debug ("track# %d's detected playing time: %.2f seconds", */
- /* track_no, sequence->info->playing_time); */
-
- _cdio_list_append (obj->mpeg_sequence_list, sequence);
-
- return track_no;
-}
-
-static int
-_pause_cmp (pause_t *ent1, pause_t *ent2)
-{
- if (ent1->time < ent2->time)
- return -1;
-
- if (ent1->time > ent2->time)
- return 1;
-
- return 0;
-}
-
-int
-vcd_obj_add_sequence_pause (VcdObj *obj, const char sequence_id[],
- double pause_time, const char pause_id[])
-{
- mpeg_sequence_t *_sequence;
-
- vcd_assert (obj != NULL);
-
- if (sequence_id)
- _sequence = _vcd_obj_get_sequence_by_id (obj, sequence_id);
- else
- _sequence =
- _cdio_list_node_data (_cdio_list_end (obj->mpeg_sequence_list));
-
- if (!_sequence)
- {
- vcd_error ("sequence id `%s' not found", sequence_id);
- return -1;
- }
-
- if (pause_id)
- vcd_warn ("pause id ignored...");
-
- {
- pause_t *_pause = _vcd_malloc (sizeof (pause_t));
-
- if (pause_id)
- _pause->id = strdup (pause_id);
- _pause->time = pause_time;
-
- _cdio_list_append (_sequence->pause_list, _pause);
- }
-
- _vcd_list_sort (_sequence->pause_list,
- (_cdio_list_cmp_func) _pause_cmp);
-
- vcd_debug ("added autopause point at %f", pause_time);
-
- return 0;
-}
-
-int
-vcd_obj_add_segment_pause (VcdObj *obj, const char segment_id[],
- double pause_time, const char pause_id[])
-{
- mpeg_segment_t *_segment;
-
- vcd_assert (obj != NULL);
-
- if (segment_id)
- _segment = _vcd_obj_get_segment_by_id (obj, segment_id);
- else
- _segment = _cdio_list_node_data (_cdio_list_end (obj->mpeg_segment_list));
-
- if (!_segment)
- {
- vcd_error ("segment id `%s' not found", segment_id);
- return -1;
- }
-
- if (pause_id)
- vcd_warn ("pause id ignored...");
-
- {
- pause_t *_pause = _vcd_malloc (sizeof (pause_t));
-
- if (pause_id)
- _pause->id = strdup (pause_id);
- _pause->time = pause_time;
-
- _cdio_list_append (_segment->pause_list, _pause);
- }
-
- _vcd_list_sort (_segment->pause_list,
- (_cdio_list_cmp_func) _pause_cmp);
-
- vcd_debug ("added autopause point at %f", pause_time);
-
- return 0;
-}
-
-static int
-_entry_cmp (entry_t *ent1, entry_t *ent2)
-{
- if (ent1->time < ent2->time)
- return -1;
-
- if (ent1->time > ent2->time)
- return 1;
-
- return 0;
-}
-
-int
-vcd_obj_add_sequence_entry (VcdObj *obj, const char sequence_id[],
- double entry_time, const char entry_id[])
-{
- mpeg_sequence_t *_sequence;
-
- vcd_assert (obj != NULL);
-
- if (sequence_id)
- _sequence = _vcd_obj_get_sequence_by_id (obj, sequence_id);
- else
- _sequence =
- _cdio_list_node_data (_cdio_list_end (obj->mpeg_sequence_list));
-
- if (!_sequence)
- {
- vcd_error ("sequence id `%s' not found", sequence_id);
- return -1;
- }
-
- if (_cdio_list_length (_sequence->entry_list) >= MAX_SEQ_ENTRIES)
- {
- vcd_error ("only %d entries per sequence allowed!", MAX_SEQ_ENTRIES);
- return -1;
- }
-
- if (entry_id && _vcd_pbc_lookup (obj, entry_id))
- {
- vcd_error ("item id (%s) exists already", entry_id);
- return -1;
- }
-
- {
- entry_t *_entry = _vcd_malloc (sizeof (entry_t));
-
- if (entry_id)
- _entry->id = strdup (entry_id);
- _entry->time = entry_time;
-
- _cdio_list_append (_sequence->entry_list, _entry);
- }
-
- _vcd_list_sort (_sequence->entry_list,
- (_cdio_list_cmp_func) _entry_cmp);
-
- return 0;
-}
-
-void
-vcd_obj_destroy (VcdObj *obj)
-{
- CdioListNode *node;
-
- vcd_assert (obj != NULL);
- vcd_assert (!obj->in_output);
-
- free (obj->iso_volume_label);
- free (obj->iso_application_id);
-
- _CDIO_LIST_FOREACH (node, obj->custom_file_list)
- {
- custom_file_t *p = _cdio_list_node_data (node);
-
- free (p->iso_pathname);
- }
-
- _cdio_list_free (obj->custom_file_list, true);
-
- _cdio_list_free (obj->custom_dir_list, true);
-
- while (_cdio_list_length (obj->mpeg_sequence_list))
- _vcd_obj_remove_mpeg_track (obj, 0);
- _cdio_list_free (obj->mpeg_sequence_list, true);
-
- free (obj);
-}
-
-int
-vcd_obj_set_param_uint (VcdObj *obj, vcd_parm_t param, unsigned arg)
-{
- vcd_assert (obj != NULL);
-
- switch (param)
- {
- case VCD_PARM_VOLUME_COUNT:
- obj->info_volume_count = arg;
- if (!IN (obj->info_volume_count, 1, 65535))
- {
- obj->info_volume_count = CLAMP (obj->info_volume_count, 1, 65535);
- vcd_warn ("volume count out of range, clamping to range");
- }
- vcd_debug ("changed volume count to %u", obj->info_volume_count);
- break;
-
- case VCD_PARM_VOLUME_NUMBER:
- obj->info_volume_number = arg;
- if (!IN (obj->info_volume_number, 0, 65534))
- {
- obj->info_volume_number = CLAMP (obj->info_volume_number, 0, 65534);
- vcd_warn ("volume number out of range, clamping to range");
- }
- vcd_debug ("changed volume number to %u", obj->info_volume_number);
- break;
-
- case VCD_PARM_RESTRICTION:
- obj->info_restriction = arg;
- if (!IN (obj->info_restriction, 0, 3))
- {
- obj->info_restriction = CLAMP (obj->info_restriction, 0, 65534);
- vcd_warn ("restriction out of range, clamping to range");
- }
- vcd_debug ("changed restriction number to %u", obj->info_restriction);
- break;
-
- case VCD_PARM_LEADOUT_PREGAP:
- obj->leadout_pregap = arg;
- if (!IN (obj->leadout_pregap, 0, 300))
- {
- obj->leadout_pregap = CLAMP (obj->leadout_pregap, 0, 300);
- vcd_warn ("ledout pregap out of range, clamping to allowed range");
- }
- if (obj->leadout_pregap < CDIO_PREGAP_SECTORS)
- vcd_warn ("track leadout pregap set below %d sectors; created (s)vcd may be non-working",
- CDIO_PREGAP_SECTORS);
-
- vcd_debug ("changed leadout pregap to %u", obj->leadout_pregap);
- break;
-
- case VCD_PARM_TRACK_PREGAP:
- obj->track_pregap = arg;
- if (!IN (obj->track_pregap, 1, 300))
- {
- obj->track_pregap = CLAMP (obj->track_pregap, 1, 300);
- vcd_warn ("track pregap out of range, clamping to allowed range");
- }
- if (obj->track_pregap < CDIO_PREGAP_SECTORS)
- vcd_warn ("track pre gap set below %d sectors; created (S)VCD may be non-working",
- CDIO_PREGAP_SECTORS);
- vcd_debug ("changed track pregap to %u", obj->track_pregap);
- break;
-
- case VCD_PARM_TRACK_FRONT_MARGIN:
- obj->track_front_margin = arg;
- if (!IN (obj->track_front_margin, 0, CDIO_PREGAP_SECTORS))
- {
- obj->track_front_margin = CLAMP (obj->track_front_margin, 0,
- CDIO_PREGAP_SECTORS);
- vcd_warn ("front margin out of range, clamping to allowed range");
- }
- if (_vcd_obj_has_cap_p (obj, _CAP_TRACK_MARGINS)
- && obj->track_front_margin < 15)
- vcd_warn ("front margin set smaller than recommended (%d < 15 sectors) for disc type used",
- obj->track_front_margin);
-
- vcd_debug ("changed front margin to %u", obj->track_front_margin);
- break;
-
- case VCD_PARM_TRACK_REAR_MARGIN:
- obj->track_rear_margin = arg;
- if (!IN (obj->track_rear_margin, 0, CDIO_POSTGAP_SECTORS))
- {
- obj->track_rear_margin = CLAMP (obj->track_rear_margin, 0,
- CDIO_POSTGAP_SECTORS);
- vcd_warn ("rear margin out of range, clamping to allowed range");
- }
- if (_vcd_obj_has_cap_p (obj, _CAP_TRACK_MARGINS)
- && obj->track_rear_margin < 15)
- vcd_warn ("rear margin set smaller than recommended (%d < 15 sectors) for disc type used",
- obj->track_rear_margin);
- vcd_debug ("changed rear margin to %u", obj->track_rear_margin);
- break;
-
- default:
- vcd_assert_not_reached ();
- break;
- }
-
- return 0;
-}
-
-int
-vcd_obj_set_param_str (VcdObj *obj, vcd_parm_t param, const char *arg)
-{
- vcd_assert (obj != NULL);
- vcd_assert (arg != NULL);
-
- switch (param)
- {
- case VCD_PARM_VOLUME_ID:
- free (obj->iso_volume_label);
- obj->iso_volume_label = strdup (arg);
- if (strlen (obj->iso_volume_label) > 32)
- {
- obj->iso_volume_label[32] = '\0';
- vcd_warn ("Volume label too long, will be truncated");
- }
- vcd_debug ("changed volume label to `%s'", obj->iso_volume_label);
- break;
-
- case VCD_PARM_PUBLISHER_ID:
- free (obj->iso_publisher_id);
- obj->iso_publisher_id = strdup (arg);
- if (strlen (obj->iso_publisher_id) > 128)
- {
- obj->iso_publisher_id[128] = '\0';
- vcd_warn ("Publisher ID too long, will be truncated");
- }
- vcd_debug ("changed publisher id to `%s'", obj->iso_publisher_id);
- break;
-
- case VCD_PARM_PREPARER_ID:
- free (obj->iso_preparer_id);
- obj->iso_preparer_id = strdup (arg);
- if (strlen (obj->iso_preparer_id) > 128)
- {
- obj->iso_preparer_id[128] = '\0';
- vcd_warn ("Preparer ID too long, will be truncated");
- }
- vcd_debug ("changed preparer id to `%s'", obj->iso_preparer_id);
- break;
-
- case VCD_PARM_APPLICATION_ID:
- free (obj->iso_application_id);
- obj->iso_application_id = strdup (arg);
- if (strlen (obj->iso_application_id) > 128)
- {
- obj->iso_application_id[128] = '\0';
- vcd_warn ("Application ID too long, will be truncated");
- }
- vcd_debug ("changed application id to `%s'", obj->iso_application_id);
- break;
-
- case VCD_PARM_ALBUM_ID:
- free (obj->info_album_id);
- obj->info_album_id = strdup (arg);
- if (strlen (obj->info_album_id) > 16)
- {
- obj->info_album_id[16] = '\0';
- vcd_warn ("Album ID too long, will be truncated");
- }
- vcd_debug ("changed album id to `%s'", obj->info_album_id);
- break;
-
- default:
- vcd_assert_not_reached ();
- break;
- }
-
- return 0;
-}
-
-int
-vcd_obj_set_param_bool (VcdObj *obj, vcd_parm_t param, bool arg)
-{
- vcd_assert (obj != NULL);
-
- switch (param)
- {
- case VCD_PARM_RELAXED_APS:
- obj->relaxed_aps = arg ? true : false;
- vcd_debug ("changing 'relaxed aps' to %d", obj->relaxed_aps);
- break;
-
- case VCD_PARM_NEXT_VOL_LID2:
- obj->info_use_lid2 = arg ? true : false;
- vcd_debug ("changing 'next volume use lid 2' to %d", obj->info_use_lid2);
- break;
-
- case VCD_PARM_NEXT_VOL_SEQ2:
- obj->info_use_seq2 = arg ? true : false;
- vcd_debug ("changing 'next volume use sequence 2' to %d", obj->info_use_seq2);
- break;
-
- case VCD_PARM_SVCD_VCD3_MPEGAV:
- if (obj->type == VCD_TYPE_SVCD)
- {
- if ((obj->svcd_vcd3_mpegav = arg ? true : false))
- vcd_warn ("!! enabling deprecated VCD3.0 MPEGAV folder --"
- " SVCD will not be IEC62107 compliant !!");
- }
- else
- vcd_error ("parameter not applicable for vcd type");
- break;
-
- case VCD_PARM_SVCD_VCD3_ENTRYSVD:
- if (obj->type == VCD_TYPE_SVCD)
- {
- if ((obj->svcd_vcd3_entrysvd = arg ? true : false))
- vcd_warn ("!! enabling deprecated VCD3.0 ENTRYSVD signature --"
- " SVCD will not be IEC62107 compliant !!");
- }
- else
- vcd_error ("parameter not applicable for vcd type");
- break;
-
- case VCD_PARM_SVCD_VCD3_TRACKSVD:
- if (obj->type == VCD_TYPE_SVCD)
- {
- if ((obj->svcd_vcd3_tracksvd = arg ? true : false))
- vcd_warn ("!! enabling deprecated VCD3.0 TRACK.SVD format --"
- " SVCD will not be IEC62107 compliant !!");
- }
- else
- vcd_error ("parameter not applicable for vcd type");
- break;
-
- case VCD_PARM_UPDATE_SCAN_OFFSETS:
- if (_vcd_obj_has_cap_p (obj, _CAP_4C_SVCD))
- {
- obj->update_scan_offsets = arg ? true : false;
- vcd_debug ("changing 'update scan offsets' to %d", obj->update_scan_offsets);
- }
- else
- vcd_error ("parameter not applicable for vcd type");
- break;
-
- case VCD_PARM_LEADOUT_PAUSE:
- vcd_warn ("use of 'leadout pause' is deprecated and may be removed in later releases;"
- " use 'leadout pregap' instead");
- vcd_obj_set_param_uint (obj, VCD_PARM_LEADOUT_PREGAP,
- (arg ? CDIO_PREGAP_SECTORS : 0));
- break;
-
- default:
- vcd_assert_not_reached ();
- break;
- }
-
- return 0;
-}
-
-int
-vcd_obj_add_dir (VcdObj *obj, const char iso_pathname[])
-{
- char *_iso_pathname;
-
- vcd_assert (obj != NULL);
- vcd_assert (iso_pathname != NULL);
-
- _iso_pathname = _vcd_strdup_upper (iso_pathname);
-
- if (!iso9660_dirname_valid_p (_iso_pathname))
- {
- vcd_error("pathname `%s' is not a valid iso pathname",
- _iso_pathname);
- free (_iso_pathname);
- return 1;
- }
-
- _cdio_list_append (obj->custom_dir_list, _iso_pathname);
-
- _vcd_list_sort (obj->custom_dir_list,
- (_cdio_list_cmp_func) strcmp);
-
- return 0;
-}
-
-int
-vcd_obj_add_file (VcdObj *obj, const char iso_pathname[],
- VcdDataSource *file, bool raw_flag)
-{
- uint32_t size = 0, sectors = 0;
-
- vcd_assert (obj != NULL);
- vcd_assert (file != NULL);
- vcd_assert (iso_pathname != NULL);
- vcd_assert (strlen (iso_pathname) > 0);
- vcd_assert (file != NULL);
-
- size = vcd_data_source_stat (file);
-
- /* close file to save file descriptors */
- vcd_data_source_close (file);
-
- if (raw_flag)
- {
- if (!size)
- {
- vcd_error("raw mode2 file must not be empty\n");
- return 1;
- }
-
- sectors = size / M2RAW_SECTOR_SIZE;
-
- if (size % M2RAW_SECTOR_SIZE)
- {
- vcd_error("raw mode2 file must have size multiple of %d \n",
- M2RAW_SECTOR_SIZE);
- return 1;
- }
- }
- else
- sectors = _vcd_len2blocks (size, CDIO_CD_FRAMESIZE);
-
- {
- custom_file_t *p;
- char *_iso_pathname = _vcd_strdup_upper (iso_pathname);
-
- if (!iso9660_pathname_valid_p (_iso_pathname))
- {
- vcd_error("pathname `%s' is not a valid iso pathname",
- _iso_pathname);
- free (_iso_pathname);
- return 1;
- }
-
- p = _vcd_malloc (sizeof (custom_file_t));
-
- p->file = file;
- p->iso_pathname = _iso_pathname;
- p->raw_flag = raw_flag;
-
- p->size = size;
- p->start_extent = 0;
- p->sectors = sectors;
-
- _cdio_list_append (obj->custom_file_list, p);
- }
-
- return 0;
-}
-
-static void
-_finalize_vcd_iso_track_allocation (VcdObj *obj)
-{
- int n;
- CdioListNode *node;
-
- uint32_t dir_secs = SECTOR_NIL;
-
- _dict_clean (obj);
-
- /* pre-alloc 16 blocks of ISO9660 required silence */
- if (_vcd_salloc (obj->iso_bitmap, 0, 16) == SECTOR_NIL)
- vcd_assert_not_reached ();
-
- /* keep karaoke sectors blank -- well... guess I'm too paranoid :) */
- if (_vcd_salloc (obj->iso_bitmap, 75, 75) == SECTOR_NIL)
- vcd_assert_not_reached ();
-
- /* pre-alloc descriptors, PVD */
- _dict_insert (obj, "pvd", ISO_PVD_SECTOR, 1, SM_EOR); /* EOR */
- /* EVD */
- _dict_insert (obj, "evd", ISO_EVD_SECTOR, 1, SM_EOR|SM_EOF); /* EOR+EOF */
-
- /* reserve for iso directory */
- dir_secs = _vcd_salloc (obj->iso_bitmap, 18, 75-18);
-
- /* VCD information area */
-
- _dict_insert (obj, "info", INFO_VCD_SECTOR, 1, SM_EOF); /* INFO.VCD */ /* EOF */
- _dict_insert (obj, "entries", ENTRIES_VCD_SECTOR, 1, SM_EOF); /* ENTRIES.VCD */ /* EOF */
-
- /* PBC */
-
- if (_vcd_pbc_available (obj))
- {
- _dict_insert (obj, "lot", LOT_VCD_SECTOR, LOT_VCD_SIZE, SM_EOF); /* LOT.VCD */ /* EOF */
- _dict_insert (obj, "psd", PSD_VCD_SECTOR,
- _vcd_len2blocks (get_psd_size (obj, false), ISO_BLOCKSIZE), SM_EOF); /* PSD.VCD */ /* EOF */
- }
-
- if (_vcd_obj_has_cap_p (obj, _CAP_4C_SVCD))
- {
- _dict_insert (obj, "tracks", SECTOR_NIL, 1, SM_EOF); /* TRACKS.SVD */
- _dict_insert (obj, "search", SECTOR_NIL,
- _vcd_len2blocks (get_search_dat_size (obj), ISO_BLOCKSIZE), SM_EOF); /* SEARCH.DAT */
-
- vcd_assert (_dict_get_bykey (obj, "tracks")->sector > INFO_VCD_SECTOR);
- vcd_assert (_dict_get_bykey (obj, "search")->sector > INFO_VCD_SECTOR);
- }
-
- /* done with primary information area */
-
- obj->mpeg_segment_start_extent =
- _vcd_len2blocks (_vcd_salloc_get_highest (obj->iso_bitmap) + 1, 75) * 75;
-
- /* salloc up to end of vcd sector */
- for(n = 0;n < obj->mpeg_segment_start_extent;n++)
- _vcd_salloc (obj->iso_bitmap, n, 1);
-
- vcd_assert (_vcd_salloc_get_highest (obj->iso_bitmap) + 1 == obj->mpeg_segment_start_extent);
-
- /* insert segments */
-
- _CDIO_LIST_FOREACH (node, obj->mpeg_segment_list)
- {
- mpeg_segment_t *_segment = _cdio_list_node_data (node);
-
- _segment->start_extent =
- _vcd_salloc (obj->iso_bitmap, SECTOR_NIL,
- _segment->segment_count * VCDINFO_SEGMENT_SECTOR_SIZE);
-
- vcd_assert (_segment->start_extent % 75 == 0);
- vcd_assert (_vcd_salloc_get_highest (obj->iso_bitmap) + 1
- == _segment->start_extent
- + _segment->segment_count * VCDINFO_SEGMENT_SECTOR_SIZE);
- }
-
- obj->ext_file_start_extent = _vcd_salloc_get_highest (obj->iso_bitmap) + 1;
-
- vcd_assert (obj->ext_file_start_extent % 75 == 0);
-
- /* go on with EXT area */
-
- if (_vcd_obj_has_cap_p (obj, _CAP_4C_SVCD))
- {
- _dict_insert (obj, "scandata", SECTOR_NIL,
- _vcd_len2blocks (get_scandata_dat_size (obj),
- ISO_BLOCKSIZE),
- SM_EOF);
- }
-
- if (_vcd_obj_has_cap_p (obj, _CAP_PBC_X)
- &&_vcd_pbc_available (obj))
- {
- _dict_insert (obj, "lot_x", SECTOR_NIL, LOT_VCD_SIZE, SM_EOF);
-
- _dict_insert (obj, "psd_x", SECTOR_NIL,
- _vcd_len2blocks (get_psd_size (obj, true), ISO_BLOCKSIZE),
- SM_EOF);
- }
-
-
- obj->custom_file_start_extent =
- _vcd_salloc_get_highest (obj->iso_bitmap) + 1;
-
- /* now for the custom files */
-
- _CDIO_LIST_FOREACH (node, obj->custom_file_list)
- {
- custom_file_t *p = _cdio_list_node_data (node);
-
- if (p->sectors)
- {
- p->start_extent =
- _vcd_salloc(obj->iso_bitmap, SECTOR_NIL, p->sectors);
- vcd_assert (p->start_extent != SECTOR_NIL);
- }
- else /* zero sized files -- set dummy extent */
- p->start_extent = obj->custom_file_start_extent;
- }
-
- /* calculate iso size -- after this point no sector shall be
- allocated anymore */
-
- obj->iso_size =
- MAX (MIN_ISO_SIZE, _vcd_salloc_get_highest (obj->iso_bitmap) + 1);
-
- vcd_debug ("iso9660: highest alloced sector is %lu (using %d as isosize)",
- (unsigned long int) _vcd_salloc_get_highest (obj->iso_bitmap),
- obj->iso_size);
-
- /* after this point the ISO9660's size is frozen */
-}
-
-static void
-_finalize_vcd_iso_track_filesystem (VcdObj *obj)
-{
- int n;
- CdioListNode *node;
-
- /* create filesystem entries */
-
- switch (obj->type) {
- case VCD_TYPE_VCD:
- case VCD_TYPE_VCD11:
- case VCD_TYPE_VCD2:
- /* add only necessary directories! */
- /* _vcd_directory_mkdir (obj->dir, "CDDA"); */
- /* _vcd_directory_mkdir (obj->dir, "CDI"); */
- _vcd_directory_mkdir (obj->dir, "EXT");
- /* _vcd_directory_mkdir (obj->dir, "KARAOKE"); */
- _vcd_directory_mkdir (obj->dir, "MPEGAV");
- _vcd_directory_mkdir (obj->dir, "VCD");
-
- /* add segment dir only when there are actually segment play items */
- if (_cdio_list_length (obj->mpeg_segment_list))
- _vcd_directory_mkdir (obj->dir, "SEGMENT");
-
- _vcd_directory_mkfile (obj->dir, "VCD/ENTRIES.VCD",
- _dict_get_bykey (obj, "entries")->sector,
- ISO_BLOCKSIZE, false, 0);
- _vcd_directory_mkfile (obj->dir, "VCD/INFO.VCD",
- _dict_get_bykey (obj, "info")->sector,
- ISO_BLOCKSIZE, false, 0);
-
- /* only for vcd2.0 */
- if (_vcd_pbc_available (obj))
- {
- _vcd_directory_mkfile (obj->dir, "VCD/LOT.VCD",
- _dict_get_bykey (obj, "lot")->sector,
- ISO_BLOCKSIZE*LOT_VCD_SIZE, false, 0);
- _vcd_directory_mkfile (obj->dir, "VCD/PSD.VCD",
- _dict_get_bykey (obj, "psd")->sector,
- get_psd_size (obj, false), false, 0);
- }
- break;
-
- case VCD_TYPE_SVCD:
- case VCD_TYPE_HQVCD:
- _vcd_directory_mkdir (obj->dir, "EXT");
-
- if (!obj->svcd_vcd3_mpegav)
- _vcd_directory_mkdir (obj->dir, "MPEG2");
- else
- {
- vcd_warn ("adding MPEGAV dir for *DEPRECATED* SVCD VCD30 mode");
- _vcd_directory_mkdir (obj->dir, "MPEGAV");
- }
-
- /* add segment dir only when there are actually segment play items */
- if (_cdio_list_length (obj->mpeg_segment_list))
- _vcd_directory_mkdir (obj->dir, "SEGMENT");
-
- _vcd_directory_mkdir (obj->dir, "SVCD");
-
- _vcd_directory_mkfile (obj->dir, "SVCD/ENTRIES.SVD",
- _dict_get_bykey (obj, "entries")->sector,
- ISO_BLOCKSIZE, false, 0);
- _vcd_directory_mkfile (obj->dir, "SVCD/INFO.SVD",
- _dict_get_bykey (obj, "info")->sector,
- ISO_BLOCKSIZE, false, 0);
-
- if (_vcd_pbc_available (obj))
- {
- _vcd_directory_mkfile (obj->dir, "SVCD/LOT.SVD",
- _dict_get_bykey (obj, "lot")->sector,
- ISO_BLOCKSIZE*LOT_VCD_SIZE, false, 0);
- _vcd_directory_mkfile (obj->dir, "SVCD/PSD.SVD",
- _dict_get_bykey (obj, "psd")->sector,
- get_psd_size (obj, false), false, 0);
- }
-
- _vcd_directory_mkfile (obj->dir, "SVCD/SEARCH.DAT",
- _dict_get_bykey (obj, "search")->sector,
- get_search_dat_size (obj), false, 0);
- _vcd_directory_mkfile (obj->dir, "SVCD/TRACKS.SVD",
- _dict_get_bykey (obj, "tracks")->sector,
- ISO_BLOCKSIZE, false, 0);
- break;
-
- default:
- vcd_assert_not_reached ();
- break;
- }
-
- /* SEGMENTS */
-
- n = 1;
- _CDIO_LIST_FOREACH (node, obj->mpeg_segment_list)
- {
- mpeg_segment_t *segment = _cdio_list_node_data (node);
- char segment_pathname[128] = { 0, };
- const char *fmt = NULL;
- uint8_t fnum = 0;
-
- switch (obj->type)
- {
- case VCD_TYPE_VCD2:
- fmt = "SEGMENT/ITEM%4.4d.DAT";
- fnum = 1;
- break;
- case VCD_TYPE_SVCD:
- case VCD_TYPE_HQVCD:
- fmt = "SEGMENT/ITEM%4.4d.MPG";
- fnum = 0;
- break;
- default:
- vcd_assert_not_reached ();
- }
-
- snprintf (segment_pathname, sizeof (segment_pathname), fmt, n);
-
- _vcd_directory_mkfile (obj->dir, segment_pathname, segment->start_extent,
- segment->info->packets * ISO_BLOCKSIZE,
- true, fnum);
-
- vcd_assert (n <= MAX_SEGMENTS);
-
- n += segment->segment_count;
- }
-
- /* EXT files */
-
- if (_vcd_obj_has_cap_p (obj, _CAP_PBC_X)
- &&_vcd_pbc_available (obj))
- {
- /* psd_x -- extended PSD */
- _vcd_directory_mkfile (obj->dir, "EXT/PSD_X.VCD",
- _dict_get_bykey (obj, "psd_x")->sector,
- get_psd_size (obj, true), false, 1);
-
- /* lot_x -- extended LOT */
- _vcd_directory_mkfile (obj->dir, "EXT/LOT_X.VCD",
- _dict_get_bykey (obj, "lot_x")->sector,
- ISO_BLOCKSIZE*LOT_VCD_SIZE, false, 1);
-
- vcd_assert (obj->type == VCD_TYPE_VCD2);
- }
-
- if (_vcd_obj_has_cap_p (obj, _CAP_4C_SVCD))
- {
- /* scandata.dat -- scanpoints */
- _vcd_directory_mkfile (obj->dir, "EXT/SCANDATA.DAT",
- _dict_get_bykey (obj, "scandata")->sector,
- get_scandata_dat_size (obj), false, 0);
- }
-
- /* custom files/dirs */
- _CDIO_LIST_FOREACH (node, obj->custom_dir_list)
- {
- char *p = _cdio_list_node_data (node);
- _vcd_directory_mkdir (obj->dir, p);
- }
-
- _CDIO_LIST_FOREACH (node, obj->custom_file_list)
- {
- custom_file_t *p = _cdio_list_node_data (node);
-
- _vcd_directory_mkfile (obj->dir, p->iso_pathname, p->start_extent,
- (p->raw_flag
- ? (ISO_BLOCKSIZE * (p->size / M2RAW_SECTOR_SIZE))
- : p->size),
- p->raw_flag, 1);
- }
-
-
- n = 0;
- _CDIO_LIST_FOREACH (node, obj->mpeg_sequence_list)
- {
- char avseq_pathname[128] = { 0, };
- const char *fmt = NULL;
- mpeg_sequence_t *_sequence = _cdio_list_node_data (node);
- uint32_t extent = _sequence->relative_start_extent;
- uint8_t file_num = 0;
-
- extent += obj->iso_size;
-
- switch (obj->type)
- {
- case VCD_TYPE_VCD:
- fmt = "MPEGAV/MUSIC%2.2d.DAT";
- file_num = n + 1;
- break;
-
- case VCD_TYPE_VCD11:
- case VCD_TYPE_VCD2:
- fmt = "MPEGAV/AVSEQ%2.2d.DAT";
- file_num = n + 1;
- break;
- case VCD_TYPE_SVCD:
- case VCD_TYPE_HQVCD:
- fmt = "MPEG2/AVSEQ%2.2d.MPG";
- file_num = 0;
-
- /* if vcd3 compat mode, override */
- if (obj->svcd_vcd3_mpegav)
- {
- fmt = "MPEGAV/AVSEQ%2.2d.MPG";
- file_num = n + 1;
- }
-
- break;
- default:
- vcd_assert_not_reached ();
- }
-
- vcd_assert (n < 98);
-
- snprintf (avseq_pathname, sizeof (avseq_pathname), fmt, n + 1);
-
- /* file entry contains front margin, mpeg stream and rear margin */
- _vcd_directory_mkfile (obj->dir, avseq_pathname, extent,
- (obj->track_front_margin
- + _sequence->info->packets
- + obj->track_rear_margin) * ISO_BLOCKSIZE,
- true, file_num);
-
- n++;
- }
-
- /* register isofs dir structures */
- {
- uint32_t dirs_size = _vcd_directory_get_size (obj->dir);
-
- /* be sure to stay out of information areas */
-
- switch (obj->type)
- {
- case VCD_TYPE_VCD:
- case VCD_TYPE_VCD11:
- case VCD_TYPE_VCD2:
- /* karaoke area starts at 03:00 */
- if (16 + 2 + dirs_size + 2 >= 75)
- vcd_error ("directory section to big for a VCD");
- break;
-
- case VCD_TYPE_SVCD:
- case VCD_TYPE_HQVCD:
- /* since no karaoke exists the next fixed area starts at 04:00 */
- if (16 + 2 + dirs_size + 2 >= 150)
- vcd_error ("directory section to big for a SVCD");
- break;
- default:
- vcd_assert_not_reached ();
- }
-
- /* un-alloc small area */
-
- _vcd_salloc_free (obj->iso_bitmap, 18, dirs_size + 2);
-
- /* alloc it again! */
-
- _dict_insert (obj, "dir", 18, dirs_size, SM_EOR|SM_EOF);
- _dict_insert (obj, "ptl", 18 + dirs_size, 1, SM_EOR|SM_EOF);
- _dict_insert (obj, "ptm", 18 + dirs_size + 1, 1, SM_EOR|SM_EOF);
- }
-}
-
-static void
-_finalize_vcd_iso_track (VcdObj *obj)
-{
- _vcd_pbc_finalize (obj);
- _finalize_vcd_iso_track_allocation (obj);
- _finalize_vcd_iso_track_filesystem (obj);
-}
-
-static int
-_callback_wrapper (VcdObj *obj, int force)
-{
- const int cb_frequency = 75;
-
- if (obj->last_cb_call + cb_frequency > obj->sectors_written && !force)
- return 0;
-
- obj->last_cb_call = obj->sectors_written;
-
- if (obj->progress_callback) {
- progress_info_t _pi;
-
- _pi.sectors_written = obj->sectors_written;
- _pi.total_sectors = obj->relative_end_extent + obj->iso_size;
- _pi.in_track = obj->in_track;
- _pi.total_tracks = _cdio_list_length (obj->mpeg_sequence_list) + 1;
-
- return obj->progress_callback (&_pi, obj->callback_user_data);
- }
- else
- return 0;
-}
-
-static int
-_write_m2_image_sector (VcdObj *obj, const void *data, uint32_t extent,
- uint8_t fnum, uint8_t cnum, uint8_t sm, uint8_t ci)
-{
- char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, };
-
- vcd_assert (extent == obj->sectors_written);
-
- _vcd_make_mode2(buf, data, extent, fnum, cnum, sm, ci);
-
- vcd_image_sink_write (obj->image_sink, buf, extent);
-
- obj->sectors_written++;
-
- return _callback_wrapper (obj, false);
-}
-
-static int
-_write_m2_raw_image_sector (VcdObj *obj, const void *data, uint32_t extent)
-{
- char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, };
-
- vcd_assert (extent == obj->sectors_written);
-
- _vcd_make_raw_mode2(buf, data, extent);
-
- vcd_image_sink_write (obj->image_sink, buf, extent);
-
- obj->sectors_written++;
-
- return _callback_wrapper (obj, false);
-}
-
-static void
-_write_source_mode2_raw (VcdObj *obj, VcdDataSource *source, uint32_t extent)
-{
- int n;
- uint32_t sectors;
-
- sectors = vcd_data_source_stat (source) / M2RAW_SECTOR_SIZE;
-
- vcd_data_source_seek (source, 0);
-
- for (n = 0;n < sectors;n++) {
- char buf[M2RAW_SECTOR_SIZE] = { 0, };
-
- vcd_data_source_read (source, buf, M2RAW_SECTOR_SIZE, 1);
-
- if (_write_m2_raw_image_sector (obj, buf, extent+n))
- break;
- }
-
- vcd_data_source_close (source);
-}
-
-static void
-_write_source_mode2_form1 (VcdObj *obj, VcdDataSource *source, uint32_t extent)
-{
- int n;
- uint32_t sectors, size, last_block_size;
-
- size = vcd_data_source_stat (source);
-
- sectors = _vcd_len2blocks (size, CDIO_CD_FRAMESIZE);
-
- last_block_size = size % CDIO_CD_FRAMESIZE;
- if (!last_block_size)
- last_block_size = CDIO_CD_FRAMESIZE;
-
- vcd_data_source_seek (source, 0);
-
- for (n = 0;n < sectors;n++) {
- char buf[CDIO_CD_FRAMESIZE] = { 0, };
-
- vcd_data_source_read (source, buf,
- ((n + 1 == sectors)
- ? last_block_size
- : CDIO_CD_FRAMESIZE), 1);
-
- if (_write_m2_image_sector (obj, buf, extent+n, 1, 0,
- ((n+1 < sectors)
- ? SM_DATA
- : SM_DATA |SM_EOF),
- 0))
- break;
- }
-
- vcd_data_source_close (source);
-}
-
-static int
-_write_sequence (VcdObj *obj, int track_idx)
-{
- mpeg_sequence_t *track =
- _cdio_list_node_data (_vcd_list_at (obj->mpeg_sequence_list, track_idx));
- CdioListNode *pause_node;
- int n, lastsect = obj->sectors_written;
- char buf[2324];
- struct {
- int audio;
- int video;
- int zero;
- int ogt;
- int unknown;
- } mpeg_packets = {0, };
-
-
- {
- char *norm_str = NULL;
- const struct vcd_mpeg_stream_vid_info *_info = &track->info->shdr[0];
-
- switch (vcd_mpeg_get_norm (_info)) {
- case MPEG_NORM_PAL:
- norm_str = strdup ("PAL SIF (352x288/25fps)");
- break;
- case MPEG_NORM_NTSC:
- norm_str = strdup ("NTSC SIF (352x240/29.97fps)");
- break;
- case MPEG_NORM_FILM:
- norm_str = strdup ("FILM SIF (352x240/24fps)");
- break;
- case MPEG_NORM_PAL_S:
- norm_str = strdup ("PAL 2/3 D1 (480x576/25fps)");
- break;
- case MPEG_NORM_NTSC_S:
- norm_str = strdup ("NTSC 2/3 D1 (480x480/29.97fps)");
- break;
-
- case MPEG_NORM_OTHER:
- {
- char buf[1024] = { 0, };
- switch (_info->vsize)
- {
- case 480:
- case 240:
- snprintf (buf, sizeof (buf), "NTSC UNKNOWN (%dx%d/%2.2ffps)",
- _info->hsize, _info->vsize, _info->frate);
- break;
- case 288:
- case 576:
- snprintf (buf, sizeof (buf), "PAL UNKNOWN (%dx%d/%2.2ffps)",
- _info->hsize, _info->vsize, _info->frate);
- break;
- default:
- snprintf (buf, sizeof (buf), "UNKNOWN (%dx%d/%2.2ffps)",
- _info->hsize, _info->vsize, _info->frate);
- break;
- }
- norm_str = strdup (buf);
- }
- break;
- }
-
- {
- char buf[1024] = { 0, }, buf2[1024] = { 0, };
- int i;
-
- for (i = 0; i < 3; i++)
- if (track->info->ahdr[i].seen)
- {
- const char *_mode_str[] = {
- 0,
- "stereo",
- "jstereo",
- "dual",
- "single",
- 0
- };
-
- snprintf (buf, sizeof (buf), "audio[%d]: l%d/%2.1fkHz/%dkbps/%s ",
- i,
- track->info->ahdr[i].layer,
- track->info->ahdr[i].sampfreq / 1000.0,
- track->info->ahdr[i].bitrate / 1024,
- _mode_str[track->info->ahdr[i].mode]);
-
- strncat (buf2, buf, sizeof(buf2) - strlen(buf2) - 1);
- }
-
- vcd_info ("writing track %d, %s, %s, %s...", track_idx + 2,
- (track->info->version == MPEG_VERS_MPEG1 ? "MPEG1" : "MPEG2"),
- norm_str, buf2);
- }
-
- free (norm_str);
- }
-
- for (n = 0; n < obj->track_pregap; n++)
- _write_m2_image_sector (obj, zero, lastsect++, 0, 0, SM_FORM2, 0);
-
- for (n = 0; n < obj->track_front_margin;n++)
- _write_m2_image_sector (obj, zero, lastsect++, track_idx + 1,
- 0, SM_FORM2|SM_REALT, 0);
-
- pause_node = _cdio_list_begin (track->pause_list);
-
- for (n = 0; n < track->info->packets; n++) {
- int ci = 0, sm = 0, cnum = 0, fnum = 0;
- struct vcd_mpeg_packet_info pkt_flags;
- bool set_trigger = false;
-
- vcd_mpeg_source_get_packet (track->source, n, buf, &pkt_flags,
- obj->update_scan_offsets);
-
- while (pause_node)
- {
- pause_t *_pause = _cdio_list_node_data (pause_node);
-
- if (!pkt_flags.has_pts)
- break; /* no pts */
-
- if (pkt_flags.pts < _pause->time)
- break; /* our time has not come yet */
-
- /* seems it's time to trigger! */
- set_trigger = true;
-
- vcd_debug ("setting auto pause trigger for time %f (pts %f) @%d",
- _pause->time, pkt_flags.pts, n);
-
- pause_node = _cdio_list_node_next (pause_node);
- }
-
- switch (vcd_mpeg_packet_get_type (&pkt_flags))
- {
- case PKT_TYPE_VIDEO:
- mpeg_packets.video++;
- sm = SM_FORM2|SM_REALT|SM_VIDEO;
- ci = CI_VIDEO;
- cnum = CN_VIDEO;
- break;
-
- case PKT_TYPE_OGT:
- mpeg_packets.ogt++;
- sm = SM_FORM2|SM_REALT|SM_VIDEO;
- ci = CI_OGT;
- cnum = CN_OGT;
- break;
-
- case PKT_TYPE_AUDIO:
- mpeg_packets.audio++;
- sm = SM_FORM2|SM_REALT|SM_AUDIO;
- ci = CI_AUDIO;
- cnum = CN_AUDIO;
- if (pkt_flags.audio[1] || pkt_flags.audio[2])
- {
- ci = CI_AUDIO2;
- cnum = CN_AUDIO2;
- }
- break;
-
-
- case PKT_TYPE_ZERO:
- mpeg_packets.zero++;
- mpeg_packets.unknown--;
- case PKT_TYPE_EMPTY:
- mpeg_packets.unknown++;
- sm = SM_FORM2|SM_REALT;
- ci = CI_EMPTY;
- cnum = CN_EMPTY;
- break;
-
- case PKT_TYPE_INVALID:
- vcd_error ("invalid mpeg packet found at packet# %d"
- " -- please fix this mpeg file!", n);
- vcd_mpeg_source_close (track->source);
- return 1;
- break;
-
- default:
- vcd_assert_not_reached ();
- }
-
- if (n == track->info->packets - 1)
- {
- sm |= SM_EOR;
- if (!obj->track_rear_margin) /* if no rear margin... */
- sm |= SM_EOF;
- }
-
- if (set_trigger)
- sm |= SM_TRIG;
-
- fnum = track_idx + 1;
-
- if (_vcd_obj_has_cap_p (obj, _CAP_4C_SVCD)
- && !obj->svcd_vcd3_mpegav) /* IEC62107 SVCDs have a
- simplified subheader */
- {
- fnum = 1;
- ci = CI_MPEG2;
- }
-
- if (_write_m2_image_sector (obj, buf, lastsect++, fnum, cnum, sm, ci))
- break;
- }
-
- vcd_mpeg_source_close (track->source);
-
- for (n = 0; n < obj->track_rear_margin; n++)
- {
- const uint8_t ci = 0, cnum = 0;
- uint8_t fnum = track_idx + 1;
- uint8_t sm = SM_FORM2 | SM_REALT;
-
- if (n + 1 == obj->track_rear_margin)
- sm |= SM_EOF;
-
- _write_m2_image_sector (obj, zero, lastsect++, fnum, cnum, sm, ci);
- }
-
- vcd_debug ("MPEG packet statistics: %d video, %d audio, %d zero, %d ogt, %d unknown",
- mpeg_packets.video, mpeg_packets.audio, mpeg_packets.zero, mpeg_packets.ogt,
- mpeg_packets.unknown);
-
- return 0;
-}
-
-static int
-_write_segment (VcdObj *obj, mpeg_segment_t *_segment)
-{
- CdioListNode *pause_node;
- unsigned packet_no;
- int n = obj->sectors_written;
-
- vcd_assert (_segment->start_extent == n);
-
- pause_node = _cdio_list_begin (_segment->pause_list);
-
- for (packet_no = 0;
- packet_no < (_segment->segment_count * VCDINFO_SEGMENT_SECTOR_SIZE);
- packet_no++)
- {
- uint8_t buf[M2F2_SECTOR_SIZE] = { 0, };
- uint8_t fn, cn, sm, ci;
-
- if (packet_no < _segment->info->packets)
- {
- struct vcd_mpeg_packet_info pkt_flags;
- bool set_trigger = false;
- bool _need_eor = false;
-
- vcd_mpeg_source_get_packet (_segment->source, packet_no,
- buf, &pkt_flags, obj->update_scan_offsets);
-
- fn = 1;
- cn = CN_EMPTY;
- sm = SM_FORM2 | SM_REALT;
- ci = CI_EMPTY;
-
- while (pause_node)
- {
- pause_t *_pause = _cdio_list_node_data (pause_node);
-
- if (!pkt_flags.has_pts)
- break; /* no pts */
-
- if (pkt_flags.pts < _pause->time)
- break; /* our time has not come yet */
-
- /* seems it's time to trigger! */
- set_trigger = true;
-
- vcd_debug ("setting auto pause trigger for time %f (pts %f) @%d",
- _pause->time, pkt_flags.pts, n);
-
- pause_node = _cdio_list_node_next (pause_node);
- }
-
- switch (vcd_mpeg_packet_get_type (&pkt_flags))
- {
- case PKT_TYPE_VIDEO:
- sm = SM_FORM2 | SM_REALT | SM_VIDEO;
-
- ci = CI_VIDEO;
- cn = CN_VIDEO;
-
- if (pkt_flags.video[1])
- ci = CI_STILL, cn = CN_STILL;
- else if (pkt_flags.video[2])
- ci = CI_STILL2, cn = CN_STILL2;
-
- if (pkt_flags.video[1] || pkt_flags.video[2])
- { /* search for endcode -- hack */
- int idx;
-
- for (idx = 0; idx <= 2320; idx++)
- if (buf[idx] == 0x00
- && buf[idx + 1] == 0x00
- && buf[idx + 2] == 0x01
- && buf[idx + 3] == 0xb7)
- {
- _need_eor = true;
- break;
- }
- }
- break;
-
- case PKT_TYPE_AUDIO:
- sm = SM_FORM2 | SM_REALT | SM_AUDIO;
-
- ci = CI_AUDIO;
- cn = CN_AUDIO;
- break;
-
- case PKT_TYPE_EMPTY:
- ci = CI_EMPTY;
- cn = CN_EMPTY;
- break;
-
- default:
- /* fixme -- check.... */
- break;
- }
-
- if (_vcd_obj_has_cap_p (obj, _CAP_4C_SVCD))
- {
- cn = 1;
- sm = SM_FORM2 | SM_REALT | SM_VIDEO;
- ci = CI_MPEG2;
- }
-
- if (packet_no + 1 == _segment->info->packets)
- sm |= SM_EOF;
-
- if (set_trigger)
- sm |= SM_TRIG;
-
- if (_need_eor)
- {
- vcd_debug ("setting EOR for SeqEnd at packet# %d ('%s')",
- packet_no, _segment->id);
- sm |= SM_EOR;
- }
- }
- else
- {
- fn = 1;
- cn = CN_EMPTY;
- sm = SM_FORM2 | SM_REALT;
- ci = CI_EMPTY;
-
- if (_vcd_obj_has_cap_p (obj, _CAP_4C_SVCD))
- {
- fn = 0;
- sm = SM_FORM2;
- }
-
- }
-
- _write_m2_image_sector (obj, buf, n, fn, cn, sm, ci);
-
- n++;
- }
-
- vcd_mpeg_source_close (_segment->source);
-
- return 0;
-}
-
-static uint32_t
-_get_closest_aps (const struct vcd_mpeg_stream_info *_mpeg_info, double t,
- struct aps_data *_best_aps)
-{
- CdioListNode *node;
- struct aps_data best_aps;
- bool first = true;
-
- vcd_assert (_mpeg_info != NULL);
- vcd_assert (_mpeg_info->shdr[0].aps_list != NULL);
-
- _CDIO_LIST_FOREACH (node, _mpeg_info->shdr[0].aps_list)
- {
- struct aps_data *_aps = _cdio_list_node_data (node);
-
- if (first)
- {
- best_aps = *_aps;
- first = false;
- }
- else if (fabs (_aps->timestamp - t) < fabs (best_aps.timestamp - t))
- best_aps = *_aps;
- else
- break;
- }
-
- if (_best_aps)
- *_best_aps = best_aps;
-
- return best_aps.packet_no;
-}
-
-static void
-_update_entry_points (VcdObj *obj)
-{
- CdioListNode *sequence_node;
-
- _CDIO_LIST_FOREACH (sequence_node, obj->mpeg_sequence_list)
- {
- mpeg_sequence_t *_sequence = _cdio_list_node_data (sequence_node);
- CdioListNode *entry_node;
- unsigned last_packet_no = 0;
-
- _CDIO_LIST_FOREACH (entry_node, _sequence->entry_list)
- {
- entry_t *_entry = _cdio_list_node_data (entry_node);
-
- _get_closest_aps (_sequence->info, _entry->time, &_entry->aps);
-
- vcd_log ((fabs (_entry->aps.timestamp - _entry->time) > 1
- ? VCD_LOG_WARN
- : VCD_LOG_DEBUG),
- "requested entry point (id=%s) at %f, "
- "closest possible entry point at %f",
- _entry->id, _entry->time, _entry->aps.timestamp);
-
- if (last_packet_no == _entry->aps.packet_no)
- vcd_warn ("entry point '%s' falls into same sector as previous one!",
- _entry->id);
-
- last_packet_no = _entry->aps.packet_no;
- }
- }
-}
-
-static int
-_write_vcd_iso_track (VcdObj *obj, const time_t *create_time)
-{
- CdioListNode *node;
- int n;
-
- /* generate dir sectors */
-
- _vcd_directory_dump_entries (obj->dir,
- _dict_get_bykey (obj, "dir")->buf,
- _dict_get_bykey (obj, "dir")->sector);
-
- _vcd_directory_dump_pathtables (obj->dir,
- _dict_get_bykey (obj, "ptl")->buf,
- _dict_get_bykey (obj, "ptm")->buf);
-
- /* generate PVD and EVD at last... */
- iso9660_set_pvd (_dict_get_bykey (obj, "pvd")->buf,
- obj->iso_volume_label,
- obj->iso_publisher_id,
- obj->iso_preparer_id,
- obj->iso_application_id,
- obj->iso_size,
- _dict_get_bykey (obj, "dir")->buf,
- _dict_get_bykey (obj, "ptl")->sector,
- _dict_get_bykey (obj, "ptm")->sector,
- iso9660_pathtable_get_size (_dict_get_bykey (obj, "ptm")->buf),
- create_time
-);
-
- iso9660_set_evd (_dict_get_bykey (obj, "evd")->buf);
-
- /* fill VCD relevant files with data */
-
- set_info_vcd (obj, _dict_get_bykey (obj, "info")->buf);
- set_entries_vcd (obj, _dict_get_bykey (obj, "entries")->buf);
-
- if (_vcd_pbc_available (obj))
- {
- if (_vcd_obj_has_cap_p (obj, _CAP_PBC_X))
- {
- set_lot_vcd (obj, _dict_get_bykey (obj, "lot_x")->buf, true);
- set_psd_vcd (obj, _dict_get_bykey (obj, "psd_x")->buf, true);
- }
-
- _vcd_pbc_check_unreferenced (obj);
-
- set_lot_vcd (obj, _dict_get_bykey (obj, "lot")->buf, false);
- set_psd_vcd (obj, _dict_get_bykey (obj, "psd")->buf, false);
- }
-
- if (_vcd_obj_has_cap_p (obj, _CAP_4C_SVCD))
- {
- set_tracks_svd (obj, _dict_get_bykey (obj, "tracks")->buf);
- set_search_dat (obj, _dict_get_bykey (obj, "search")->buf);
- set_scandata_dat (obj, _dict_get_bykey (obj, "scandata")->buf);
- }
-
- /* start actually writing stuff */
-
- vcd_info ("writing track 1 (ISO9660)...");
-
- /* 00:02:00 -> 00:04:74 */
- for (n = 0;n < obj->mpeg_segment_start_extent; n++)
- {
- const void *content = NULL;
- uint8_t flags = SM_DATA;
-
- content = _dict_get_sector (obj, n);
- flags |= _dict_get_sector_flags (obj, n);
-
- if (content == NULL)
- content = zero;
-
- _write_m2_image_sector (obj, content, n, 0, 0, flags, 0);
- }
-
- /* SEGMENTS */
-
- vcd_assert (n == obj->mpeg_segment_start_extent);
-
- _CDIO_LIST_FOREACH (node, obj->mpeg_segment_list)
- {
- mpeg_segment_t *_segment = _cdio_list_node_data (node);
-
- _write_segment (obj, _segment);
- }
-
- n = obj->sectors_written;
-
- /* EXT stuff */
-
- vcd_assert (n == obj->ext_file_start_extent);
-
- for (;n < obj->custom_file_start_extent; n++)
- {
- const void *content = NULL;
- uint8_t flags = SM_DATA;
- uint8_t fileno = _vcd_obj_has_cap_p (obj, _CAP_4C_SVCD) ? 0 : 1;
-
- content = _dict_get_sector (obj, n);
- flags |= _dict_get_sector_flags (obj, n);
-
- if (content == NULL)
- {
- vcd_debug ("unexpected empty EXT sector");
- content = zero;
- }
-
- _write_m2_image_sector (obj, content, n, fileno, 0, flags, 0);
- }
-
- /* write custom files */
-
- vcd_assert (n == obj->custom_file_start_extent);
-
- _CDIO_LIST_FOREACH (node, obj->custom_file_list)
- {
- custom_file_t *p = _cdio_list_node_data (node);
-
- vcd_info ("writing file `%s' (%lu bytes%s)",
- p->iso_pathname, (unsigned long) p->size,
- p->raw_flag ? ", raw sectors file": "");
- if (p->raw_flag)
- _write_source_mode2_raw (obj, p->file, p->start_extent);
- else
- _write_source_mode2_form1 (obj, p->file, p->start_extent);
- }
-
- /* blank unalloced tracks */
- while ((n = _vcd_salloc (obj->iso_bitmap, SECTOR_NIL, 1)) < obj->iso_size)
- _write_m2_image_sector (obj, zero, n, 0, 0, SM_DATA, 0);
-
- return 0;
-}
-
-
-long
-vcd_obj_get_image_size (VcdObj *obj)
-{
- long size_sectors = -1;
-
- vcd_assert (!obj->in_output);
-
- if (_cdio_list_length (obj->mpeg_sequence_list) > 0)
- {
- /* fixme -- make this efficient */
- size_sectors = vcd_obj_begin_output (obj);
- vcd_obj_end_output (obj);
- }
-
- return size_sectors;
-}
-
-long
-vcd_obj_begin_output (VcdObj *obj)
-{
- uint32_t image_size;
-
- vcd_assert (obj != NULL);
- vcd_assert (_cdio_list_length (obj->mpeg_sequence_list) > 0);
-
- vcd_assert (!obj->in_output);
- obj->in_output = true;
-
- obj->in_track = 1;
- obj->sectors_written = 0;
-
- obj->iso_bitmap = _vcd_salloc_new ();
-
- obj->dir = _vcd_directory_new ();
-
- obj->buffer_dict_list = _cdio_list_new ();
-
- _finalize_vcd_iso_track (obj);
-
- _update_entry_points (obj);
-
- image_size = obj->relative_end_extent + obj->iso_size;
-
- image_size += obj->leadout_pregap;
-
- if (image_size > CDIO_CD_MAX_SECTORS)
- vcd_error ("image too big (%d sectors > %d sectors)",
- (unsigned) image_size, (unsigned) CDIO_CD_MAX_SECTORS);
-
- {
- char *_tmp = cdio_lba_to_msf_str (image_size);
-
- if (image_size > CDIO_CD_74MIN_SECTORS)
- vcd_warn ("generated image (%d sectors [%s]) may not fit "
- "on 74min CDRs (%d sectors)",
- (unsigned) image_size, _tmp, (unsigned) CDIO_CD_74MIN_SECTORS);
-
- free (_tmp);
- }
-
- return image_size;
-}
-
-
-void
-vcd_obj_end_output (VcdObj *obj)
-{
- vcd_assert (obj != NULL);
-
- vcd_assert (obj->in_output);
- obj->in_output = false;
-
- _vcd_directory_destroy (obj->dir);
- _vcd_salloc_destroy (obj->iso_bitmap);
-
- _dict_clean (obj);
- _cdio_list_free (obj->buffer_dict_list, true);
-}
-
-int
-vcd_obj_append_pbc_node (VcdObj *obj, struct _pbc_t *_pbc)
-{
- vcd_assert (obj != NULL);
- vcd_assert (_pbc != NULL);
-
- if (!_vcd_obj_has_cap_p (obj, _CAP_PBC))
- {
- vcd_error ("PBC not supported for current VCD type");
- return -1;
- }
-
- if (_pbc->item_id && _vcd_pbc_lookup (obj, _pbc->item_id))
- {
- vcd_error ("item id (%s) exists already", _pbc->item_id);
- return -1;
- }
-
- _cdio_list_append (obj->pbc_list, _pbc);
-
- return 0;
-}
-
-int
-vcd_obj_write_image (VcdObj *obj, VcdImageSink *image_sink,
- progress_callback_t callback, void *user_data,
- const time_t *create_time)
-{
- CdioListNode *node;
-
- vcd_assert (obj != NULL);
- vcd_assert (obj->in_output);
-
- if (!image_sink)
- return -1;
-
- /* start with meta info */
-
- {
- CdioList *cue_list;
- vcd_cue_t *_cue;
-
- cue_list = _cdio_list_new ();
-
- _cdio_list_append (cue_list, (_cue = _vcd_malloc (sizeof (vcd_cue_t))));
-
- _cue->lsn = 0;
- _cue->type = VCD_CUE_TRACK_START;
-
- _CDIO_LIST_FOREACH (node, obj->mpeg_sequence_list)
- {
- mpeg_sequence_t *track = _cdio_list_node_data (node);
- CdioListNode *entry_node;
-
- _cdio_list_append (cue_list,
- (_cue = _vcd_malloc (sizeof (vcd_cue_t))));
-
- _cue->lsn = track->relative_start_extent + obj->iso_size;
- _cue->lsn -= obj->track_pregap;
- _cue->type = VCD_CUE_PREGAP_START;
-
- _cdio_list_append (cue_list,
- (_cue = _vcd_malloc (sizeof (vcd_cue_t))));
-
- _cue->lsn = track->relative_start_extent + obj->iso_size;
- _cue->type = VCD_CUE_TRACK_START;
-
- _CDIO_LIST_FOREACH (entry_node, track->entry_list)
- {
- entry_t *_entry = _cdio_list_node_data (entry_node);
-
- _cdio_list_append (cue_list,
- (_cue = _vcd_malloc (sizeof (vcd_cue_t))));
-
- _cue->lsn = obj->iso_size;
- _cue->lsn += track->relative_start_extent;
- _cue->lsn += obj->track_front_margin;
- _cue->lsn += _entry->aps.packet_no;
-
- _cue->type = VCD_CUE_SUBINDEX;
- }
- }
-
- /* add last one... */
-
- _cdio_list_append (cue_list, (_cue = _vcd_malloc (sizeof (vcd_cue_t))));
-
- _cue->lsn = obj->relative_end_extent + obj->iso_size;
-
- _cue->lsn += obj->leadout_pregap;
-
- _cue->type = VCD_CUE_END;
-
- /* send it to image object */
-
- vcd_image_sink_set_cuesheet (image_sink, cue_list);
-
- _cdio_list_free (cue_list, true);
- }
-
- /* and now for the pay load */
-
- {
- unsigned track;
-
- vcd_assert (obj != NULL);
- vcd_assert (obj->sectors_written == 0);
-
- vcd_assert (obj->in_output);
-
- obj->progress_callback = callback;
- obj->callback_user_data = user_data;
- obj->image_sink = image_sink;
-
- if (_callback_wrapper (obj, true))
- return 1;
-
- if (_write_vcd_iso_track (obj, create_time))
- return 1;
-
- if (obj->update_scan_offsets)
- vcd_info ("'update scan offsets' option enabled for the following tracks!");
-
- for (track = 0;track < _cdio_list_length (obj->mpeg_sequence_list);track++)
- {
- obj->in_track++;
-
- if (_callback_wrapper (obj, true))
- return 1;
-
- if (_write_sequence (obj, track))
- return 1;
- }
-
- if (obj->leadout_pregap)
- {
- int n, lastsect = obj->sectors_written;
-
- vcd_debug ("writting post-gap ('leadout pregap')...");
-
- for (n = 0; n < obj->leadout_pregap; n++)
- _write_m2_image_sector (obj, zero, lastsect++, 0, 0, SM_FORM2, 0);
- }
-
- if (_callback_wrapper (obj, true))
- return 1;
-
- obj->image_sink = NULL;
-
- vcd_image_sink_destroy (image_sink);
-
- return 0; /* ok */
- }
-}
-
-const char *
-vcd_version_string (bool full_text)
-{
- if (!full_text)
- return ("GNU VCDImager " VERSION " [" HOST_ARCH "]");
-
- return ("%s (GNU VCDImager) " VERSION "\n"
- "Written by Herbert Valerio Riedel and Rocky Bernstein.\n"
- "\n"
- "http://www.gnu.org/software/vcdimager/\n"
- "\n"
- "Copyright (C) 2000-2003 Herbert Valerio Riedel <hvr@gnu.org>\n"
- " 2003 Rocky Bernstein <rocky@panix.com>\n"
- "\n"
- "This is free software; see the source for copying conditions. There is NO\n"
- "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n");
-}
-
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libvcd/vcd.h b/src/input/vcd/libvcd/vcd.h
deleted file mode 100644
index 7c001d282..000000000
--- a/src/input/vcd/libvcd/vcd.h
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- $Id: vcd.h,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/* libvcd main header */
-
-#ifndef __VCD_H__
-#define __VCD_H__
-
-/* Private headers */
-#include "image_sink.h"
-#include "mpeg_stream.h"
-#include "stream.h"
-
-#include <libvcd/types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/* allocates and initializes a new VideoCD object */
-VcdObj *
-vcd_obj_new (vcd_type_t vcd_type);
-
-/* VideoCD parameters */
-typedef enum {
- VCD_PARM_INVALID = 0,
- VCD_PARM_VOLUME_ID, /* char * max length 32 */
- VCD_PARM_PUBLISHER_ID, /* char * max length 128 */
- VCD_PARM_PREPARER_ID, /* char * max length 128 */
- VCD_PARM_ALBUM_ID, /* char * max length 16 */
- VCD_PARM_VOLUME_COUNT, /* unsigned [1..65535] */
- VCD_PARM_VOLUME_NUMBER, /* unsigned [0..65535] */
- VCD_PARM_RESTRICTION, /* unsigned [0..3] */
- VCD_PARM_NEXT_VOL_LID2, /* bool */
- VCD_PARM_NEXT_VOL_SEQ2, /* bool */
- VCD_PARM_APPLICATION_ID, /* char * max length 128 */
- VCD_PARM_SEC_TYPE, /* unsigned [2336, 2352] */
- VCD_PARM_SVCD_VCD3_MPEGAV, /* bool */
- VCD_PARM_SVCD_VCD3_ENTRYSVD, /* bool */
- VCD_PARM_SVCD_VCD3_TRACKSVD, /* bool */
- VCD_PARM_UPDATE_SCAN_OFFSETS, /* bool */
- VCD_PARM_RELAXED_APS, /* bool */
- VCD_PARM_LEADOUT_PAUSE, /* bool */
- VCD_PARM_LEADOUT_PREGAP, /* unsigned [0..300] */
- VCD_PARM_TRACK_PREGAP, /* unsigned [1..300] */
- VCD_PARM_TRACK_FRONT_MARGIN, /* unsigned [0..150] */
- VCD_PARM_TRACK_REAR_MARGIN /* unsigned [0..150] */
-} vcd_parm_t;
-
-/* sets VideoCD parameter */
-int
-vcd_obj_set_param_uint (VcdObj *obj, vcd_parm_t param, unsigned arg);
-
-int
-vcd_obj_set_param_str (VcdObj *obj, vcd_parm_t param, const char *arg);
-
-int
-vcd_obj_set_param_bool (VcdObj *obj, vcd_parm_t param, bool arg);
-
-/* add custom files; if raw_flag set, the data source has to include a
- mode2 subheader, and thus needs to be a multiple of 2336 byte blocksize */
-int
-vcd_obj_add_file (VcdObj *obj, const char iso_pathname[],
- VcdDataSource *file, bool raw_flag);
-
-int
-vcd_obj_add_dir (VcdObj *obj, const char iso_pathname[]);
-
-/* this is for actually adding mpeg items to VCD, returns
- a negative value for error.. */
-
-int
-vcd_obj_append_sequence_play_item (VcdObj *obj, VcdMpegSource *mpeg_source,
- const char item_id[],
- const char default_entry_id[]);
-
-int
-vcd_obj_add_sequence_entry (VcdObj *obj, const char sequence_id[],
- double entry_time, const char entry_id[]);
-
-int
-vcd_obj_add_sequence_pause (VcdObj *obj, const char sequence_id[],
- double pause_timestamp, const char pause_id[]);
-
-int
-vcd_obj_add_segment_pause (VcdObj *obj, const char segment_id[],
- double pause_timestamp, const char pause_id[]);
-
-int
-vcd_obj_append_segment_play_item (VcdObj *obj, VcdMpegSource *mpeg_source,
- const char item_id[]);
-
-/* warning -- api will change for pbc */
-typedef struct _pbc_t pbc_t;
-
-int
-vcd_obj_append_pbc_node (VcdObj *obj, struct _pbc_t *_pbc);
-
-/* removes item (sequence, entry, segment, ...) by id, returns
- negative value on error */
-int
-vcd_obj_remove_item (VcdObj *obj, const char id[]);
-
-/* returns image size in sectors */
-long
-vcd_obj_get_image_size (VcdObj *obj);
-
-/* this one is to be called when every parameter has been set and the
- image is about to be written. returns sectors to be written... */
-long
-vcd_obj_begin_output (VcdObj *obj);
-
-/* callback hook called every few (>|<) iterations, if it returns a value != 0
- the writing process gets aborted */
-typedef struct
-{
- long sectors_written;
- long total_sectors;
- int in_track;
- int total_tracks;
-}
-progress_info_t;
-
-typedef int (*progress_callback_t) (const progress_info_t *progress_info,
- void *user_data);
-
-/* writes the actual bin image file; a return value != 0 means the
- action was aborted by user or some other error has occured... */
-int
-vcd_obj_write_image (VcdObj *obj, VcdImageSink *image_sink,
- progress_callback_t callback, void *user_data,
- const time_t *create_time);
-
-/* this should be called writing the bin and/or cue file is done---even if
- an error occurred */
-void
-vcd_obj_end_output (VcdObj *obj);
-
-/* destructor for VideoCD objects; call this to destory a VideoCD
- object created by vcd_obj_new () */
-void
-vcd_obj_destroy (VcdObj *obj);
-
-const char *
-vcd_version_string (bool full_text);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __VCD_H__ */
-
-/*
- * Local variables:
- * c-file-style: "gnu"
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/src/input/vcd/libvcd/vcd_assert.h b/src/input/vcd/libvcd/vcd_assert.h
deleted file mode 100644
index c096b3677..000000000
--- a/src/input/vcd/libvcd/vcd_assert.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- $Id: vcd_assert.h,v 1.1 2004/04/11 12:20:32 miguelfreitas Exp $
-
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifndef __VCD_ASSERT_H__
-#define __VCD_ASSERT_H__
-
-#if defined(__GNUC__)
-
-#include <libvcd/types.h>
-#include <libvcd/logging.h>
-
-#define vcd_assert(expr) \
- { \
- if (GNUC_UNLIKELY (!(expr))) vcd_log (VCD_LOG_ASSERT, \
- "file %s: line %d (%s): assertion failed: (%s)", \
- __FILE__, __LINE__, __PRETTY_FUNCTION__, #expr); \
- }
-
-#define vcd_assert_not_reached() \
- { \
- vcd_log (VCD_LOG_ASSERT, \
- "file %s: line %d (%s): should not be reached", \
- __FILE__, __LINE__, __PRETTY_FUNCTION__); \
- }
-
-#else /* non GNU C */
-
-#include <assert.h>
-
-#define vcd_assert(expr) \
- assert(expr)
-
-#define vcd_assert_not_reached() \
- assert(0)
-
-#endif
-
-#endif /* __VCD_ASSERT_H__ */
diff --git a/src/input/vcd/libvcd/vcd_read.c b/src/input/vcd/libvcd/vcd_read.c
deleted file mode 100644
index dd9d30cfa..000000000
--- a/src/input/vcd/libvcd/vcd_read.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- $Id: vcd_read.c,v 1.4 2005/01/01 02:43:59 rockyb Exp $
-
- Copyright (C) 2001,2003 Herbert Valerio Riedel <hvr@gnu.org>
- Copyright (C) 2003 Rocky Bernstein <rocky@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-
-#include "vcd_read.h"
-#include "vcd_assert.h"
-#include <libvcd/inf.h>
-#include <libvcd/files.h>
-#include <libvcd/logging.h>
-
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-bool
-read_pvd(CdIo *cdio, iso9660_pvd_t *pvd)
-{
- if (cdio_read_mode2_sector (cdio, pvd, ISO_PVD_SECTOR, false)) {
- vcd_error ("error reading PVD sector (%d)", ISO_PVD_SECTOR);
- return false;
- }
-
- if (pvd->type != ISO_VD_PRIMARY) {
- vcd_error ("unexpected PVD type %d", pvd->type);
- return false;
- }
-
- if (strncmp (pvd->id, ISO_STANDARD_ID, strlen (ISO_STANDARD_ID)))
- {
- vcd_error ("unexpected ID encountered (expected `"
- ISO_STANDARD_ID "', got `%.5s'", pvd->id);
- return false;
- }
- return true;
-}
-
-bool
-read_entries(CdIo *cdio, EntriesVcd_t *entries)
-{
- if (cdio_read_mode2_sector (cdio, entries, ENTRIES_VCD_SECTOR, false)) {
- vcd_error ("error reading Entries sector (%d)", ENTRIES_VCD_SECTOR);
- return false;
- }
-
- /* analyze signature/type */
-
- if (!strncmp (entries->ID, ENTRIES_ID_VCD, sizeof (entries->ID)))
- return true;
- else if (!strncmp (entries->ID, "ENTRYSVD", sizeof (entries->ID))) {
- vcd_warn ("found (non-compliant) SVCD ENTRIES.SVD signature");
- return true;
- } else {
- vcd_error ("unexpected ID signature encountered `%.8s'", entries->ID);
- return false;
- }
-}
-
-bool
-read_info(CdIo *cdio, InfoVcd_t *info, vcd_type_t *vcd_type)
-{
- if (cdio_read_mode2_sector (cdio, info, INFO_VCD_SECTOR, false)) {
- vcd_error ("error reading Info sector (%d)", INFO_VCD_SECTOR);
- return false;
- }
-
- *vcd_type = vcd_files_info_detect_type (info);
-
- /* analyze signature/type */
-
- switch (*vcd_type)
- {
- case VCD_TYPE_VCD:
- case VCD_TYPE_VCD11:
- case VCD_TYPE_VCD2:
- case VCD_TYPE_SVCD:
- case VCD_TYPE_HQVCD:
- vcd_debug ("%s detected", vcdinf_get_format_version_str(*vcd_type));
- break;
- case VCD_TYPE_INVALID:
- vcd_error ("unknown ID encountered -- maybe not a proper (S)VCD?");
- return false;
- break;
- default:
- vcd_assert_not_reached ();
- break;
- }
-
- return true;
-}
-
diff --git a/src/input/vcd/libvcd/vcd_read.h b/src/input/vcd/libvcd/vcd_read.h
deleted file mode 100644
index fb9e1509b..000000000
--- a/src/input/vcd/libvcd/vcd_read.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- $Id: vcd_read.h,v 1.3 2005/01/01 02:43:59 rockyb Exp $
-
- Copyright (C) 2003 Rocky Bernstein <rocky@gnu.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <cdio/cdio.h>
-#include <cdio/iso9660.h>
-
-/* FIXME: make this really private: */
-#include <libvcd/files_private.h>
-
-bool read_pvd(CdIo *cdio, iso9660_pvd_t *pvd);
-bool read_entries(CdIo *cdio, EntriesVcd_t *entries);
-bool read_info(CdIo *cdio, InfoVcd_t *info, vcd_type_t *vcd_type);
-
-
-
diff --git a/src/input/vcd/xineplug_inp_vcd.c b/src/input/vcd/xineplug_inp_vcd.c
index 795a2480d..e41eb33d9 100644
--- a/src/input/vcd/xineplug_inp_vcd.c
+++ b/src/input/vcd/xineplug_inp_vcd.c
@@ -1008,7 +1008,7 @@ vcd_plugin_get_mrl (input_plugin_t *this_gen)
return human readable (verbose = 1 line) description for this plugin
*/
-static char *
+static const char *
vcd_class_get_description (input_class_t *this_gen)
{
dbg_print((INPUT_DBG_CALL|INPUT_DBG_EXT), "called\n");
@@ -1822,13 +1822,13 @@ vcd_init (xine_t *xine, void *data)
/*Note: these labels have to be listed in the same order as the
enumeration vcdplayer_autoplay_t in vcdplayer.h.
*/
- static const char *autoplay_modes[] =
+ static const char *const autoplay_modes[] =
{ "MPEG track", "entry", "segment", "playback-control item", NULL };
/*Note: these labels have to be listed in the same order as the
enumeration vcdplayer_slider_length_t in vcdplayer.h.
*/
- static const char *length_reporting_modes[] =
+ static const char *const length_reporting_modes[] =
{ "auto", "track", "entry", NULL };
my_vcd.player.default_autoplay =
diff --git a/src/liba52/Makefile.am b/src/liba52/Makefile.am
deleted file mode 100644
index 508ea9c1b..000000000
--- a/src/liba52/Makefile.am
+++ /dev/null
@@ -1,38 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-if A52
-a52_module = xineplug_decode_a52.la
-endif
-
-xineplug_LTLIBRARIES = $(a52_module)
-
-if EXTERNAL_A52DEC
-internal_sources =
-else
-internal_sources = \
- bitstream.c \
- bit_allocate.c \
- downmix.c \
- imdct.c \
- parse.c
-endif
-
-xineplug_decode_a52_la_SOURCES = \
- xine_a52_decoder.c \
- $(internal_sources)
-
-if EXTERNAL_A52DEC
-xineplug_decode_a52_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) -la52 -lm
-else
-xineplug_decode_a52_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) -lm
-endif
-
-xineplug_decode_a52_la_CFLAGS = $(VISIBILITY_FLAG)
-xineplug_decode_a52_la_LDFLAGS = $(xineplug_ldflags)
-
-noinst_HEADERS = \
- a52.h \
- a52_internal.h \
- bitstream.h \
- tables.h \
- crc.c
diff --git a/src/liba52/a52.h b/src/liba52/a52.h
deleted file mode 100644
index 9db52ccf8..000000000
--- a/src/liba52/a52.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * a52.h
- * Copyright (C) 2000-2002 Michel Lespinasse <walken@zoy.org>
- * Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
- *
- * This file is part of a52dec, a free ATSC A-52 stream decoder.
- * See http://liba52.sourceforge.net/ for updates.
- *
- * a52dec is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * a52dec is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef A52_H
-#define A52_H
-
-#ifndef LIBA52_DOUBLE
-typedef float sample_t;
-#else
-typedef double sample_t;
-#endif
-
-typedef struct a52_state_s a52_state_t;
-
-#define A52_CHANNEL 0
-#define A52_MONO 1
-#define A52_STEREO 2
-#define A52_3F 3
-#define A52_2F1R 4
-#define A52_3F1R 5
-#define A52_2F2R 6
-#define A52_3F2R 7
-#define A52_CHANNEL1 8
-#define A52_CHANNEL2 9
-#define A52_DOLBY 10
-#define A52_CHANNEL_MASK 15
-
-#define A52_LFE 16
-#define A52_ADJUST_LEVEL 32
-
-a52_state_t * a52_init (uint32_t mm_accel);
-sample_t * a52_samples (a52_state_t * state);
-int a52_syncinfo (uint8_t * buf, int * flags,
- int * sample_rate, int * bit_rate);
-int a52_frame (a52_state_t * state, uint8_t * buf, int * flags,
- sample_t * level, sample_t bias);
-void a52_dynrng (a52_state_t * state,
- sample_t (* call) (sample_t, void *), void * data);
-int a52_block (a52_state_t * state);
-void a52_free (a52_state_t * state);
-
-#endif /* A52_H */
diff --git a/src/liba52/a52_internal.h b/src/liba52/a52_internal.h
deleted file mode 100644
index 541d94803..000000000
--- a/src/liba52/a52_internal.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * a52_internal.h
- * Copyright (C) 2000-2002 Michel Lespinasse <walken@zoy.org>
- * Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
- *
- * This file is part of a52dec, a free ATSC A-52 stream decoder.
- * See http://liba52.sourceforge.net/ for updates.
- *
- * a52dec is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * a52dec is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-typedef struct {
- uint8_t bai; /* fine SNR offset, fast gain */
- uint8_t deltbae; /* delta bit allocation exists */
- int8_t deltba[50]; /* per-band delta bit allocation */
-} ba_t;
-
-typedef struct {
- uint8_t exp[256]; /* decoded channel exponents */
- int8_t bap[256]; /* derived channel bit allocation */
-} expbap_t;
-
-struct a52_state_s {
- uint8_t fscod; /* sample rate */
- uint8_t halfrate; /* halfrate factor */
- uint8_t acmod; /* coded channels */
- uint8_t lfeon; /* coded lfe channel */
- sample_t clev; /* centre channel mix level */
- sample_t slev; /* surround channels mix level */
-
- int output; /* type of output */
- sample_t level; /* output level */
- sample_t bias; /* output bias */
-
- int dynrnge; /* apply dynamic range */
- sample_t dynrng; /* dynamic range */
- void * dynrngdata; /* dynamic range callback funtion and data */
- sample_t (* dynrngcall) (sample_t range, void * dynrngdata);
-
- uint8_t chincpl; /* channel coupled */
- uint8_t phsflginu; /* phase flags in use (stereo only) */
- uint8_t cplstrtmant; /* coupling channel start mantissa */
- uint8_t cplendmant; /* coupling channel end mantissa */
- uint32_t cplbndstrc; /* coupling band structure */
- sample_t cplco[5][18]; /* coupling coordinates */
-
- /* derived information */
- uint8_t cplstrtbnd; /* coupling start band (for bit allocation) */
- uint8_t ncplbnd; /* number of coupling bands */
-
- uint8_t rematflg; /* stereo rematrixing */
-
- uint8_t endmant[5]; /* channel end mantissa */
-
- uint16_t bai; /* bit allocation information */
-
- uint32_t * buffer_start;
- uint16_t lfsr_state; /* dither state */
- uint32_t bits_left;
- uint32_t current_word;
-
- uint8_t csnroffst; /* coarse SNR offset */
- ba_t cplba; /* coupling bit allocation parameters */
- ba_t ba[5]; /* channel bit allocation parameters */
- ba_t lfeba; /* lfe bit allocation parameters */
-
- uint8_t cplfleak; /* coupling fast leak init */
- uint8_t cplsleak; /* coupling slow leak init */
-
- expbap_t cpl_expbap;
- expbap_t fbw_expbap[5];
- expbap_t lfe_expbap;
-
- sample_t * samples;
- void * samples_base;
- int downmixed;
-};
-
-#define LEVEL_PLUS6DB 2.0
-#define LEVEL_PLUS3DB 1.4142135623730951
-#define LEVEL_3DB 0.7071067811865476
-#define LEVEL_45DB 0.5946035575013605
-#define LEVEL_6DB 0.5
-
-#define EXP_REUSE (0)
-#define EXP_D15 (1)
-#define EXP_D25 (2)
-#define EXP_D45 (3)
-
-#define DELTA_BIT_REUSE (0)
-#define DELTA_BIT_NEW (1)
-#define DELTA_BIT_NONE (2)
-#define DELTA_BIT_RESERVED (3)
-
-void a52_bit_allocate (a52_state_t * state, ba_t * ba, int bndstart,
- int start, int end, int fastleak, int slowleak,
- expbap_t * expbap);
-
-int a52_downmix_init (int input, int flags, sample_t * level,
- sample_t clev, sample_t slev);
-int a52_downmix_coeff (sample_t * coeff, int acmod, int output, sample_t level,
- sample_t clev, sample_t slev);
-void a52_downmix (sample_t * samples, int acmod, int output, sample_t bias,
- sample_t clev, sample_t slev);
-void a52_upmix (sample_t * samples, int acmod, int output);
-
-void a52_imdct_init (uint32_t mm_accel);
-void a52_imdct_256 (sample_t * data, sample_t * delay, sample_t bias);
-void a52_imdct_512 (sample_t * data, sample_t * delay, sample_t bias);
diff --git a/src/liba52/bit_allocate.c b/src/liba52/bit_allocate.c
deleted file mode 100644
index 0567b2285..000000000
--- a/src/liba52/bit_allocate.c
+++ /dev/null
@@ -1,265 +0,0 @@
-/*
- * bit_allocate.c
- * Copyright (C) 2000-2002 Michel Lespinasse <walken@zoy.org>
- * Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
- *
- * This file is part of a52dec, a free ATSC A-52 stream decoder.
- * See http://liba52.sourceforge.net/ for updates.
- *
- * a52dec is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * a52dec is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "config.h"
-
-#include <inttypes.h>
-
-#include "a52.h"
-#include "a52_internal.h"
-
-static int hthtab[3][50] = {
- {0x730, 0x730, 0x7c0, 0x800, 0x820, 0x840, 0x850, 0x850, 0x860, 0x860,
- 0x860, 0x860, 0x860, 0x870, 0x870, 0x870, 0x880, 0x880, 0x890, 0x890,
- 0x8a0, 0x8a0, 0x8b0, 0x8b0, 0x8c0, 0x8c0, 0x8d0, 0x8e0, 0x8f0, 0x900,
- 0x910, 0x910, 0x910, 0x910, 0x900, 0x8f0, 0x8c0, 0x870, 0x820, 0x7e0,
- 0x7a0, 0x770, 0x760, 0x7a0, 0x7c0, 0x7c0, 0x6e0, 0x400, 0x3c0, 0x3c0},
- {0x710, 0x710, 0x7a0, 0x7f0, 0x820, 0x830, 0x840, 0x850, 0x850, 0x860,
- 0x860, 0x860, 0x860, 0x860, 0x870, 0x870, 0x870, 0x880, 0x880, 0x880,
- 0x890, 0x890, 0x8a0, 0x8a0, 0x8b0, 0x8b0, 0x8c0, 0x8c0, 0x8e0, 0x8f0,
- 0x900, 0x910, 0x910, 0x910, 0x910, 0x900, 0x8e0, 0x8b0, 0x870, 0x820,
- 0x7e0, 0x7b0, 0x760, 0x770, 0x7a0, 0x7c0, 0x780, 0x5d0, 0x3c0, 0x3c0},
- {0x680, 0x680, 0x750, 0x7b0, 0x7e0, 0x810, 0x820, 0x830, 0x840, 0x850,
- 0x850, 0x850, 0x860, 0x860, 0x860, 0x860, 0x860, 0x860, 0x860, 0x860,
- 0x870, 0x870, 0x870, 0x870, 0x880, 0x880, 0x880, 0x890, 0x8a0, 0x8b0,
- 0x8c0, 0x8d0, 0x8e0, 0x8f0, 0x900, 0x910, 0x910, 0x910, 0x900, 0x8f0,
- 0x8d0, 0x8b0, 0x840, 0x7f0, 0x790, 0x760, 0x7a0, 0x7c0, 0x7b0, 0x720}
-};
-
-static int8_t baptab[305] = {
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, /* 93 padding elems */
-
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 14, 14, 14, 14, 14, 14,
- 14, 12, 12, 12, 12, 11, 11, 11, 11, 10, 10, 10, 10, 9, 9, 9,
- 9, 8, 8, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 5, 5, 5,
- 5, 4, 4, -3, -3, 3, 3, 3, -2, -2, -1, -1, -1, -1, -1, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0 /* 148 padding elems */
-};
-
-static int bndtab[30] = {21, 22, 23, 24, 25, 26, 27, 28, 31, 34,
- 37, 40, 43, 46, 49, 55, 61, 67, 73, 79,
- 85, 97, 109, 121, 133, 157, 181, 205, 229, 253};
-
-static int8_t latab[256] = {
- -64, -63, -62, -61, -60, -59, -58, -57, -56, -55, -54, -53,
- -52, -52, -51, -50, -49, -48, -47, -47, -46, -45, -44, -44,
- -43, -42, -41, -41, -40, -39, -38, -38, -37, -36, -36, -35,
- -35, -34, -33, -33, -32, -32, -31, -30, -30, -29, -29, -28,
- -28, -27, -27, -26, -26, -25, -25, -24, -24, -23, -23, -22,
- -22, -21, -21, -21, -20, -20, -19, -19, -19, -18, -18, -18,
- -17, -17, -17, -16, -16, -16, -15, -15, -15, -14, -14, -14,
- -13, -13, -13, -13, -12, -12, -12, -12, -11, -11, -11, -11,
- -10, -10, -10, -10, -10, -9, -9, -9, -9, -9, -8, -8,
- -8, -8, -8, -8, -7, -7, -7, -7, -7, -7, -6, -6,
- -6, -6, -6, -6, -6, -6, -5, -5, -5, -5, -5, -5,
- -5, -5, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4,
- -4, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3,
- -3, -3, -3, -2, -2, -2, -2, -2, -2, -2, -2, -2,
- -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0
-};
-
-#define UPDATE_LEAK() \
-do { \
- fastleak += fdecay; \
- if (fastleak > psd + fgain) \
- fastleak = psd + fgain; \
- slowleak += sdecay; \
- if (slowleak > psd + sgain) \
- slowleak = psd + sgain; \
-} while (0)
-
-#define COMPUTE_MASK() \
-do { \
- if (psd > dbknee) \
- mask -= (psd - dbknee) >> 2; \
- if (mask > hth [i >> halfrate]) \
- mask = hth [i >> halfrate]; \
- mask -= snroffset + 128 * deltba[i]; \
- mask = (mask > 0) ? 0 : ((-mask) >> 5); \
- mask -= floor; \
-} while (0)
-
-void a52_bit_allocate (a52_state_t * state, ba_t * ba, int bndstart,
- int start, int end, int fastleak, int slowleak,
- expbap_t * expbap)
-{
- static int slowgain[4] = {0x540, 0x4d8, 0x478, 0x410};
- static int dbpbtab[4] = {0xc00, 0x500, 0x300, 0x100};
- static int floortab[8] = {0x910, 0x950, 0x990, 0x9d0,
- 0xa10, 0xa90, 0xb10, 0x1400};
-
- int i, j;
- uint8_t * exp;
- int8_t * bap;
- int fdecay, fgain, sdecay, sgain, dbknee, floor, snroffset;
- int psd, mask;
- int8_t * deltba;
- int * hth;
- int halfrate;
-
- halfrate = state->halfrate;
- fdecay = (63 + 20 * ((state->bai >> 7) & 3)) >> halfrate; /* fdcycod */
- fgain = 128 + 128 * (ba->bai & 7); /* fgaincod */
- sdecay = (15 + 2 * (state->bai >> 9)) >> halfrate; /* sdcycod */
- sgain = slowgain[(state->bai >> 5) & 3]; /* sgaincod */
- dbknee = dbpbtab[(state->bai >> 3) & 3]; /* dbpbcod */
- hth = hthtab[state->fscod];
- /*
- * if there is no delta bit allocation, make deltba point to an area
- * known to contain zeroes. baptab+156 here.
- */
- deltba = (ba->deltbae == DELTA_BIT_NONE) ? baptab + 156 : ba->deltba;
- floor = floortab[state->bai & 7]; /* floorcod */
- snroffset = 960 - 64 * state->csnroffst - 4 * (ba->bai >> 3) + floor;
- floor >>= 5;
-
- exp = expbap->exp;
- bap = expbap->bap;
-
- i = bndstart;
- j = start;
- if (start == 0) { /* not the coupling channel */
- int lowcomp;
-
- lowcomp = 0;
- j = end - 1;
- do {
- if (i < j) {
- if (exp[i+1] == exp[i] - 2)
- lowcomp = 384;
- else if (lowcomp && (exp[i+1] > exp[i]))
- lowcomp -= 64;
- }
- psd = 128 * exp[i];
- mask = psd + fgain + lowcomp;
- COMPUTE_MASK ();
- bap[i] = (baptab+156)[mask + 4 * exp[i]];
- i++;
- } while ((i < 3) || ((i < 7) && (exp[i] > exp[i-1])));
- fastleak = psd + fgain;
- slowleak = psd + sgain;
-
- while (i < 7) {
- if (i < j) {
- if (exp[i+1] == exp[i] - 2)
- lowcomp = 384;
- else if (lowcomp && (exp[i+1] > exp[i]))
- lowcomp -= 64;
- }
- psd = 128 * exp[i];
- UPDATE_LEAK ();
- mask = ((fastleak + lowcomp < slowleak) ?
- fastleak + lowcomp : slowleak);
- COMPUTE_MASK ();
- bap[i] = (baptab+156)[mask + 4 * exp[i]];
- i++;
- }
-
- if (end == 7) /* lfe channel */
- return;
-
- do {
- if (exp[i+1] == exp[i] - 2)
- lowcomp = 320;
- else if (lowcomp && (exp[i+1] > exp[i]))
- lowcomp -= 64;
- psd = 128 * exp[i];
- UPDATE_LEAK ();
- mask = ((fastleak + lowcomp < slowleak) ?
- fastleak + lowcomp : slowleak);
- COMPUTE_MASK ();
- bap[i] = (baptab+156)[mask + 4 * exp[i]];
- i++;
- } while (i < 20);
-
- while (lowcomp > 128) { /* two iterations maximum */
- lowcomp -= 128;
- psd = 128 * exp[i];
- UPDATE_LEAK ();
- mask = ((fastleak + lowcomp < slowleak) ?
- fastleak + lowcomp : slowleak);
- COMPUTE_MASK ();
- bap[i] = (baptab+156)[mask + 4 * exp[i]];
- i++;
- }
- j = i;
- }
-
- do {
- int startband, endband;
-
- startband = j;
- endband = ((bndtab-20)[i] < end) ? (bndtab-20)[i] : end;
- psd = 128 * exp[j++];
- while (j < endband) {
- int next, delta;
-
- next = 128 * exp[j++];
- delta = next - psd;
- switch (delta >> 9) {
- case -6: case -5: case -4: case -3: case -2:
- psd = next;
- break;
- case -1:
- psd = next + latab[(-delta) >> 1];
- break;
- case 0:
- psd += latab[delta >> 1];
- break;
- }
- }
- /* minpsd = -289 */
- UPDATE_LEAK ();
- mask = (fastleak < slowleak) ? fastleak : slowleak;
- COMPUTE_MASK ();
- i++;
- j = startband;
- do {
- /* max(mask+4*exp)=147=-(minpsd+fgain-deltba-snroffset)>>5+4*exp */
- /* min(mask+4*exp)=-156=-(sgain-deltba-snroffset)>>5 */
- bap[j] = (baptab+156)[mask + 4 * exp[j]];
- } while (++j < endband);
- } while (j < end);
-}
diff --git a/src/liba52/bitstream.c b/src/liba52/bitstream.c
deleted file mode 100644
index 04e8ca6d0..000000000
--- a/src/liba52/bitstream.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * bitstream.c
- * Copyright (C) 2000-2002 Michel Lespinasse <walken@zoy.org>
- * Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
- *
- * This file is part of a52dec, a free ATSC A-52 stream decoder.
- * See http://liba52.sourceforge.net/ for updates.
- *
- * a52dec is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * a52dec is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "config.h"
-
-#include <inttypes.h>
-
-#include "a52.h"
-#include "a52_internal.h"
-#include "bitstream.h"
-
-#define BUFFER_SIZE 4096
-
-void a52_bitstream_set_ptr (a52_state_t * state, uint8_t * buf)
-{
- int align;
-
- align = (long)buf & 3;
- state->buffer_start = (uint32_t *) (buf - align);
- state->bits_left = 0;
- bitstream_get (state, align * 8);
-}
-
-static inline void bitstream_fill_current (a52_state_t * state)
-{
- uint32_t tmp;
-
- tmp = *(state->buffer_start++);
- state->current_word = swab32 (tmp);
-}
-
-/*
- * The fast paths for _get is in the
- * bitstream.h header file so it can be inlined.
- *
- * The "bottom half" of this routine is suffixed _bh
- *
- * -ah
- */
-
-uint32_t a52_bitstream_get_bh (a52_state_t * state, uint32_t num_bits)
-{
- uint32_t result;
-
- num_bits -= state->bits_left;
- result = ((state->current_word << (32 - state->bits_left)) >>
- (32 - state->bits_left));
-
- bitstream_fill_current (state);
-
- if (num_bits != 0)
- result = (result << num_bits) | (state->current_word >> (32 - num_bits));
-
- state->bits_left = 32 - num_bits;
-
- return result;
-}
-
-int32_t a52_bitstream_get_bh_2 (a52_state_t * state, uint32_t num_bits)
-{
- int32_t result;
-
- num_bits -= state->bits_left;
- result = ((((int32_t)state->current_word) << (32 - state->bits_left)) >>
- (32 - state->bits_left));
-
- bitstream_fill_current(state);
-
- if (num_bits != 0)
- result = (result << num_bits) | (state->current_word >> (32 - num_bits));
-
- state->bits_left = 32 - num_bits;
-
- return result;
-}
diff --git a/src/liba52/bitstream.h b/src/liba52/bitstream.h
deleted file mode 100644
index f242c37c4..000000000
--- a/src/liba52/bitstream.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * bitstream.h
- * Copyright (C) 2000-2002 Michel Lespinasse <walken@zoy.org>
- * Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
- *
- * This file is part of a52dec, a free ATSC A-52 stream decoder.
- * See http://liba52.sourceforge.net/ for updates.
- *
- * a52dec is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * a52dec is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifdef WIN32
-#include <unistd.h>
-#endif
-
-/* (stolen from the kernel) */
-#ifdef WORDS_BIGENDIAN
-
-# define swab32(x) (x)
-
-#else
-
-# if 0 && defined (__i386__)
-
-# define swab32(x) __i386_swab32(x)
- static inline const uint32_t __i386_swab32(uint32_t x)
- {
- __asm__("bswap %0" : "=r" (x) : "0" (x));
- return x;
- }
-
-# else
-
-# define swab32(x)\
-((((uint8_t*)&x)[0] << 24) | (((uint8_t*)&x)[1] << 16) | \
- (((uint8_t*)&x)[2] << 8) | (((uint8_t*)&x)[3]))
-
-# endif
-#endif
-
-void a52_bitstream_set_ptr (a52_state_t * state, uint8_t * buf);
-uint32_t a52_bitstream_get_bh (a52_state_t * state, uint32_t num_bits);
-int32_t a52_bitstream_get_bh_2 (a52_state_t * state, uint32_t num_bits);
-
-static inline uint32_t bitstream_get (a52_state_t * state, uint32_t num_bits)
-{
- uint32_t result;
-
- if (num_bits < state->bits_left) {
- result = (state->current_word << (32 - state->bits_left)) >> (32 - num_bits);
- state->bits_left -= num_bits;
- return result;
- }
-
- return a52_bitstream_get_bh (state, num_bits);
-}
-
-static inline int32_t bitstream_get_2 (a52_state_t * state, uint32_t num_bits)
-{
- int32_t result;
-
- if (num_bits < state->bits_left) {
- result = (((int32_t)state->current_word) << (32 - state->bits_left)) >> (32 - num_bits);
- state->bits_left -= num_bits;
- return result;
- }
-
- return a52_bitstream_get_bh_2 (state, num_bits);
-}
diff --git a/src/liba52/crc.c b/src/liba52/crc.c
deleted file mode 100644
index 38254c9ef..000000000
--- a/src/liba52/crc.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * crc.c
- *
- * Copyright (C) Aaron Holtzman - May 1999
- *
- * This file is part of ac3dec, a free Dolby AC-3 stream decoder.
- *
- * ac3dec is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * ac3dec is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GNU Make; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <inttypes.h>
-
-static const uint16_t crc_lut[256] =
-{
- 0x0000,0x8005,0x800f,0x000a,0x801b,0x001e,0x0014,0x8011,
- 0x8033,0x0036,0x003c,0x8039,0x0028,0x802d,0x8027,0x0022,
- 0x8063,0x0066,0x006c,0x8069,0x0078,0x807d,0x8077,0x0072,
- 0x0050,0x8055,0x805f,0x005a,0x804b,0x004e,0x0044,0x8041,
- 0x80c3,0x00c6,0x00cc,0x80c9,0x00d8,0x80dd,0x80d7,0x00d2,
- 0x00f0,0x80f5,0x80ff,0x00fa,0x80eb,0x00ee,0x00e4,0x80e1,
- 0x00a0,0x80a5,0x80af,0x00aa,0x80bb,0x00be,0x00b4,0x80b1,
- 0x8093,0x0096,0x009c,0x8099,0x0088,0x808d,0x8087,0x0082,
- 0x8183,0x0186,0x018c,0x8189,0x0198,0x819d,0x8197,0x0192,
- 0x01b0,0x81b5,0x81bf,0x01ba,0x81ab,0x01ae,0x01a4,0x81a1,
- 0x01e0,0x81e5,0x81ef,0x01ea,0x81fb,0x01fe,0x01f4,0x81f1,
- 0x81d3,0x01d6,0x01dc,0x81d9,0x01c8,0x81cd,0x81c7,0x01c2,
- 0x0140,0x8145,0x814f,0x014a,0x815b,0x015e,0x0154,0x8151,
- 0x8173,0x0176,0x017c,0x8179,0x0168,0x816d,0x8167,0x0162,
- 0x8123,0x0126,0x012c,0x8129,0x0138,0x813d,0x8137,0x0132,
- 0x0110,0x8115,0x811f,0x011a,0x810b,0x010e,0x0104,0x8101,
- 0x8303,0x0306,0x030c,0x8309,0x0318,0x831d,0x8317,0x0312,
- 0x0330,0x8335,0x833f,0x033a,0x832b,0x032e,0x0324,0x8321,
- 0x0360,0x8365,0x836f,0x036a,0x837b,0x037e,0x0374,0x8371,
- 0x8353,0x0356,0x035c,0x8359,0x0348,0x834d,0x8347,0x0342,
- 0x03c0,0x83c5,0x83cf,0x03ca,0x83db,0x03de,0x03d4,0x83d1,
- 0x83f3,0x03f6,0x03fc,0x83f9,0x03e8,0x83ed,0x83e7,0x03e2,
- 0x83a3,0x03a6,0x03ac,0x83a9,0x03b8,0x83bd,0x83b7,0x03b2,
- 0x0390,0x8395,0x839f,0x039a,0x838b,0x038e,0x0384,0x8381,
- 0x0280,0x8285,0x828f,0x028a,0x829b,0x029e,0x0294,0x8291,
- 0x82b3,0x02b6,0x02bc,0x82b9,0x02a8,0x82ad,0x82a7,0x02a2,
- 0x82e3,0x02e6,0x02ec,0x82e9,0x02f8,0x82fd,0x82f7,0x02f2,
- 0x02d0,0x82d5,0x82df,0x02da,0x82cb,0x02ce,0x02c4,0x82c1,
- 0x8243,0x0246,0x024c,0x8249,0x0258,0x825d,0x8257,0x0252,
- 0x0270,0x8275,0x827f,0x027a,0x826b,0x026e,0x0264,0x8261,
- 0x0220,0x8225,0x822f,0x022a,0x823b,0x023e,0x0234,0x8231,
- 0x8213,0x0216,0x021c,0x8219,0x0208,0x820d,0x8207,0x0202
-};
-
-static uint16_t crc16_block(uint8_t *data,uint32_t num_bytes)
-{
- uint32_t i;
- uint16_t state=0;
-
- for(i=0;i<num_bytes;i++)
- state = crc_lut[data[i] ^ (state>>8)] ^ (state<<8);
-
- return state;
-}
diff --git a/src/liba52/diff_against_release.patch b/src/liba52/diff_against_release.patch
deleted file mode 100644
index d7f7ff2f2..000000000
--- a/src/liba52/diff_against_release.patch
+++ /dev/null
@@ -1,76 +0,0 @@
---- src/liba52/a52_internal.h Sun Jul 28 03:52:06 2002
-+++ src/liba52/a52_internal.h Wed Aug 28 19:01:05 2002
-@@ -84,6 +84,7 @@
- expbap_t lfe_expbap;
-
- sample_t * samples;
-+ void * samples_base;
- int downmixed;
- };
-
---- src/liba52/imdct.c Sun Jul 28 03:52:07 2002
-+++ src/liba52/imdct.c Wed Aug 28 18:55:38 2002
-@@ -38,7 +38,7 @@
-
- #include "a52.h"
- #include "a52_internal.h"
--#include "mm_accel.h"
-+#include "xineutils.h"
-
- typedef struct complex_s {
- sample_t real;
-@@ -425,7 +425,6 @@
- } else
- #endif
- {
-- fprintf (stderr, "liba52:No accelerated IMDCT transform found\n");
- ifft128 = ifft128_c;
- ifft64 = ifft64_c;
- }
---- src/liba52/parse.c Sun Jul 28 03:52:07 2002
-+++ src/liba52/parse.c Wed Aug 28 19:02:21 2002
-@@ -31,14 +31,7 @@
- #include "a52_internal.h"
- #include "bitstream.h"
- #include "tables.h"
--
--#ifdef HAVE_MEMALIGN
--/* some systems have memalign() but no declaration for it */
--void * memalign (size_t align, size_t size);
--#else
--/* assume malloc alignment is sufficient */
--#define memalign(align,size) malloc (size)
--#endif
-+#include "xineutils.h"
-
- typedef struct {
- sample_t q1[2];
-@@ -60,7 +53,7 @@
- if (state == NULL)
- return NULL;
-
-- state->samples = memalign (16, 256 * 12 * sizeof (sample_t));
-+ state->samples = xine_xmalloc_aligned (16, 256 * 12 * sizeof (sample_t), &state->samples_base);
- if (state->samples == NULL) {
- free (state);
- return NULL;
-@@ -896,6 +889,6 @@
-
- void a52_free (a52_state_t * state)
- {
-- free (state->samples);
-+ free (state->samples_base);
- free (state);
- }
---- src/liba52/bitstream.h
-+++ src/liba52/bitstream.h
-@@ -21,6 +21,10 @@
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-+#ifdef WIN32
-+#include <unistd.h>
-+#endif
-+
- /* (stolen from the kernel) */
- #ifdef WORDS_BIGENDIAN
diff --git a/src/liba52/downmix.c b/src/liba52/downmix.c
deleted file mode 100644
index b9ac1fdea..000000000
--- a/src/liba52/downmix.c
+++ /dev/null
@@ -1,655 +0,0 @@
-/*
- * downmix.c
- * Copyright (C) 2000-2002 Michel Lespinasse <walken@zoy.org>
- * Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
- *
- * This file is part of a52dec, a free ATSC A-52 stream decoder.
- * See http://liba52.sourceforge.net/ for updates.
- *
- * a52dec is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * a52dec is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "config.h"
-
-#include <string.h>
-#include <inttypes.h>
-
-#include "a52.h"
-#include "a52_internal.h"
-
-#define CONVERT(acmod,output) (((output) << 3) + (acmod))
-
-int a52_downmix_init (int input, int flags, sample_t * level,
- sample_t clev, sample_t slev)
-{
- static uint8_t table[11][8] = {
- {A52_CHANNEL, A52_DOLBY, A52_STEREO, A52_STEREO,
- A52_STEREO, A52_STEREO, A52_STEREO, A52_STEREO},
- {A52_MONO, A52_MONO, A52_MONO, A52_MONO,
- A52_MONO, A52_MONO, A52_MONO, A52_MONO},
- {A52_CHANNEL, A52_DOLBY, A52_STEREO, A52_STEREO,
- A52_STEREO, A52_STEREO, A52_STEREO, A52_STEREO},
- {A52_CHANNEL, A52_DOLBY, A52_STEREO, A52_3F,
- A52_STEREO, A52_3F, A52_STEREO, A52_3F},
- {A52_CHANNEL, A52_DOLBY, A52_STEREO, A52_STEREO,
- A52_2F1R, A52_2F1R, A52_2F1R, A52_2F1R},
- {A52_CHANNEL, A52_DOLBY, A52_STEREO, A52_STEREO,
- A52_2F1R, A52_3F1R, A52_2F1R, A52_3F1R},
- {A52_CHANNEL, A52_DOLBY, A52_STEREO, A52_3F,
- A52_2F2R, A52_2F2R, A52_2F2R, A52_2F2R},
- {A52_CHANNEL, A52_DOLBY, A52_STEREO, A52_3F,
- A52_2F2R, A52_3F2R, A52_2F2R, A52_3F2R},
- {A52_CHANNEL1, A52_MONO, A52_MONO, A52_MONO,
- A52_MONO, A52_MONO, A52_MONO, A52_MONO},
- {A52_CHANNEL2, A52_MONO, A52_MONO, A52_MONO,
- A52_MONO, A52_MONO, A52_MONO, A52_MONO},
- {A52_CHANNEL, A52_DOLBY, A52_STEREO, A52_DOLBY,
- A52_DOLBY, A52_DOLBY, A52_DOLBY, A52_DOLBY}
- };
- int output;
-
- output = flags & A52_CHANNEL_MASK;
- if (output > A52_DOLBY)
- return -1;
-
- output = table[output][input & 7];
-
- if ((output == A52_STEREO) &&
- ((input == A52_DOLBY) || ((input == A52_3F) && (clev == LEVEL_3DB))))
- output = A52_DOLBY;
-
- if (flags & A52_ADJUST_LEVEL)
- switch (CONVERT (input & 7, output)) {
-
- case CONVERT (A52_3F, A52_MONO):
- *level *= LEVEL_3DB / (1 + clev);
- break;
-
- case CONVERT (A52_STEREO, A52_MONO):
- case CONVERT (A52_2F2R, A52_2F1R):
- case CONVERT (A52_3F2R, A52_3F1R):
- level_3db:
- *level *= LEVEL_3DB;
- break;
-
- case CONVERT (A52_3F2R, A52_2F1R):
- if (clev < LEVEL_PLUS3DB - 1)
- goto level_3db;
- /* break thru */
- case CONVERT (A52_3F, A52_STEREO):
- case CONVERT (A52_3F1R, A52_2F1R):
- case CONVERT (A52_3F1R, A52_2F2R):
- case CONVERT (A52_3F2R, A52_2F2R):
- *level /= 1 + clev;
- break;
-
- case CONVERT (A52_2F1R, A52_MONO):
- *level *= LEVEL_PLUS3DB / (2 + slev);
- break;
-
- case CONVERT (A52_2F1R, A52_STEREO):
- case CONVERT (A52_3F1R, A52_3F):
- *level /= 1 + slev * LEVEL_3DB;
- break;
-
- case CONVERT (A52_3F1R, A52_MONO):
- *level *= LEVEL_3DB / (1 + clev + 0.5 * slev);
- break;
-
- case CONVERT (A52_3F1R, A52_STEREO):
- *level /= 1 + clev + slev * LEVEL_3DB;
- break;
-
- case CONVERT (A52_2F2R, A52_MONO):
- *level *= LEVEL_3DB / (1 + slev);
- break;
-
- case CONVERT (A52_2F2R, A52_STEREO):
- case CONVERT (A52_3F2R, A52_3F):
- *level /= 1 + slev;
- break;
-
- case CONVERT (A52_3F2R, A52_MONO):
- *level *= LEVEL_3DB / (1 + clev + slev);
- break;
-
- case CONVERT (A52_3F2R, A52_STEREO):
- *level /= 1 + clev + slev;
- break;
-
- case CONVERT (A52_MONO, A52_DOLBY):
- *level *= LEVEL_PLUS3DB;
- break;
-
- case CONVERT (A52_3F, A52_DOLBY):
- case CONVERT (A52_2F1R, A52_DOLBY):
- *level *= 1 / (1 + LEVEL_3DB);
- break;
-
- case CONVERT (A52_3F1R, A52_DOLBY):
- case CONVERT (A52_2F2R, A52_DOLBY):
- *level *= 1 / (1 + 2 * LEVEL_3DB);
- break;
-
- case CONVERT (A52_3F2R, A52_DOLBY):
- *level *= 1 / (1 + 3 * LEVEL_3DB);
- break;
- }
-
- return output;
-}
-
-int a52_downmix_coeff (sample_t * coeff, int acmod, int output, sample_t level,
- sample_t clev, sample_t slev)
-{
- switch (CONVERT (acmod, output & A52_CHANNEL_MASK)) {
-
- case CONVERT (A52_CHANNEL, A52_CHANNEL):
- case CONVERT (A52_MONO, A52_MONO):
- case CONVERT (A52_STEREO, A52_STEREO):
- case CONVERT (A52_3F, A52_3F):
- case CONVERT (A52_2F1R, A52_2F1R):
- case CONVERT (A52_3F1R, A52_3F1R):
- case CONVERT (A52_2F2R, A52_2F2R):
- case CONVERT (A52_3F2R, A52_3F2R):
- case CONVERT (A52_STEREO, A52_DOLBY):
- coeff[0] = coeff[1] = coeff[2] = coeff[3] = coeff[4] = level;
- return 0;
-
- case CONVERT (A52_CHANNEL, A52_MONO):
- coeff[0] = coeff[1] = level * LEVEL_6DB;
- return 3;
-
- case CONVERT (A52_STEREO, A52_MONO):
- coeff[0] = coeff[1] = level * LEVEL_3DB;
- return 3;
-
- case CONVERT (A52_3F, A52_MONO):
- coeff[0] = coeff[2] = level * LEVEL_3DB;
- coeff[1] = level * clev * LEVEL_PLUS3DB;
- return 7;
-
- case CONVERT (A52_2F1R, A52_MONO):
- coeff[0] = coeff[1] = level * LEVEL_3DB;
- coeff[2] = level * slev * LEVEL_3DB;
- return 7;
-
- case CONVERT (A52_2F2R, A52_MONO):
- coeff[0] = coeff[1] = level * LEVEL_3DB;
- coeff[2] = coeff[3] = level * slev * LEVEL_3DB;
- return 15;
-
- case CONVERT (A52_3F1R, A52_MONO):
- coeff[0] = coeff[2] = level * LEVEL_3DB;
- coeff[1] = level * clev * LEVEL_PLUS3DB;
- coeff[3] = level * slev * LEVEL_3DB;
- return 15;
-
- case CONVERT (A52_3F2R, A52_MONO):
- coeff[0] = coeff[2] = level * LEVEL_3DB;
- coeff[1] = level * clev * LEVEL_PLUS3DB;
- coeff[3] = coeff[4] = level * slev * LEVEL_3DB;
- return 31;
-
- case CONVERT (A52_MONO, A52_DOLBY):
- coeff[0] = level * LEVEL_3DB;
- return 0;
-
- case CONVERT (A52_3F, A52_DOLBY):
- clev = LEVEL_3DB;
- case CONVERT (A52_3F, A52_STEREO):
- case CONVERT (A52_3F1R, A52_2F1R):
- case CONVERT (A52_3F2R, A52_2F2R):
- coeff[0] = coeff[2] = coeff[3] = coeff[4] = level;
- coeff[1] = level * clev;
- return 7;
-
- case CONVERT (A52_2F1R, A52_DOLBY):
- slev = 1;
- case CONVERT (A52_2F1R, A52_STEREO):
- coeff[0] = coeff[1] = level;
- coeff[2] = level * slev * LEVEL_3DB;
- return 7;
-
- case CONVERT (A52_3F1R, A52_DOLBY):
- clev = LEVEL_3DB;
- slev = 1;
- case CONVERT (A52_3F1R, A52_STEREO):
- coeff[0] = coeff[2] = level;
- coeff[1] = level * clev;
- coeff[3] = level * slev * LEVEL_3DB;
- return 15;
-
- case CONVERT (A52_2F2R, A52_DOLBY):
- slev = LEVEL_3DB;
- case CONVERT (A52_2F2R, A52_STEREO):
- coeff[0] = coeff[1] = level;
- coeff[2] = coeff[3] = level * slev;
- return 15;
-
- case CONVERT (A52_3F2R, A52_DOLBY):
- clev = LEVEL_3DB;
- case CONVERT (A52_3F2R, A52_2F1R):
- slev = LEVEL_3DB;
- case CONVERT (A52_3F2R, A52_STEREO):
- coeff[0] = coeff[2] = level;
- coeff[1] = level * clev;
- coeff[3] = coeff[4] = level * slev;
- return 31;
-
- case CONVERT (A52_3F1R, A52_3F):
- coeff[0] = coeff[1] = coeff[2] = level;
- coeff[3] = level * slev * LEVEL_3DB;
- return 13;
-
- case CONVERT (A52_3F2R, A52_3F):
- coeff[0] = coeff[1] = coeff[2] = level;
- coeff[3] = coeff[4] = level * slev;
- return 29;
-
- case CONVERT (A52_2F2R, A52_2F1R):
- coeff[0] = coeff[1] = level;
- coeff[2] = coeff[3] = level * LEVEL_3DB;
- return 12;
-
- case CONVERT (A52_3F2R, A52_3F1R):
- coeff[0] = coeff[1] = coeff[2] = level;
- coeff[3] = coeff[4] = level * LEVEL_3DB;
- return 24;
-
- case CONVERT (A52_2F1R, A52_2F2R):
- coeff[0] = coeff[1] = level;
- coeff[2] = level * LEVEL_3DB;
- return 0;
-
- case CONVERT (A52_3F1R, A52_2F2R):
- coeff[0] = coeff[2] = level;
- coeff[1] = level * clev;
- coeff[3] = level * LEVEL_3DB;
- return 7;
-
- case CONVERT (A52_3F1R, A52_3F2R):
- coeff[0] = coeff[1] = coeff[2] = level;
- coeff[3] = level * LEVEL_3DB;
- return 0;
-
- case CONVERT (A52_CHANNEL, A52_CHANNEL1):
- coeff[0] = level;
- coeff[1] = 0;
- return 0;
-
- case CONVERT (A52_CHANNEL, A52_CHANNEL2):
- coeff[0] = 0;
- coeff[1] = level;
- return 0;
- }
-
- return -1; /* NOTREACHED */
-}
-
-static void mix2to1 (sample_t * dest, sample_t * src, sample_t bias)
-{
- int i;
-
- for (i = 0; i < 256; i++)
- dest[i] += src[i] + bias;
-}
-
-static void mix3to1 (sample_t * samples, sample_t bias)
-{
- int i;
-
- for (i = 0; i < 256; i++)
- samples[i] += samples[i + 256] + samples[i + 512] + bias;
-}
-
-static void mix4to1 (sample_t * samples, sample_t bias)
-{
- int i;
-
- for (i = 0; i < 256; i++)
- samples[i] += (samples[i + 256] + samples[i + 512] +
- samples[i + 768] + bias);
-}
-
-static void mix5to1 (sample_t * samples, sample_t bias)
-{
- int i;
-
- for (i = 0; i < 256; i++)
- samples[i] += (samples[i + 256] + samples[i + 512] +
- samples[i + 768] + samples[i + 1024] + bias);
-}
-
-static void mix3to2 (sample_t * samples, sample_t bias)
-{
- int i;
- sample_t common;
-
- for (i = 0; i < 256; i++) {
- common = samples[i + 256] + bias;
- samples[i] += common;
- samples[i + 256] = samples[i + 512] + common;
- }
-}
-
-static void mix21to2 (sample_t * left, sample_t * right, sample_t bias)
-{
- int i;
- sample_t common;
-
- for (i = 0; i < 256; i++) {
- common = right[i + 256] + bias;
- left[i] += common;
- right[i] += common;
- }
-}
-
-static void mix21toS (sample_t * samples, sample_t bias)
-{
- int i;
- sample_t surround;
-
- for (i = 0; i < 256; i++) {
- surround = samples[i + 512];
- samples[i] += bias - surround;
- samples[i + 256] += bias + surround;
- }
-}
-
-static void mix31to2 (sample_t * samples, sample_t bias)
-{
- int i;
- sample_t common;
-
- for (i = 0; i < 256; i++) {
- common = samples[i + 256] + samples[i + 768] + bias;
- samples[i] += common;
- samples[i + 256] = samples[i + 512] + common;
- }
-}
-
-static void mix31toS (sample_t * samples, sample_t bias)
-{
- int i;
- sample_t common, surround;
-
- for (i = 0; i < 256; i++) {
- common = samples[i + 256] + bias;
- surround = samples[i + 768];
- samples[i] += common - surround;
- samples[i + 256] = samples[i + 512] + common + surround;
- }
-}
-
-static void mix22toS (sample_t * samples, sample_t bias)
-{
- int i;
- sample_t surround;
-
- for (i = 0; i < 256; i++) {
- surround = samples[i + 512] + samples[i + 768];
- samples[i] += bias - surround;
- samples[i + 256] += bias + surround;
- }
-}
-
-static void mix32to2 (sample_t * samples, sample_t bias)
-{
- int i;
- sample_t common;
-
- for (i = 0; i < 256; i++) {
- common = samples[i + 256] + bias;
- samples[i] += common + samples[i + 768];
- samples[i + 256] = common + samples[i + 512] + samples[i + 1024];
- }
-}
-
-static void mix32toS (sample_t * samples, sample_t bias)
-{
- int i;
- sample_t common, surround;
-
- for (i = 0; i < 256; i++) {
- common = samples[i + 256] + bias;
- surround = samples[i + 768] + samples[i + 1024];
- samples[i] += common - surround;
- samples[i + 256] = samples[i + 512] + common + surround;
- }
-}
-
-static void move2to1 (sample_t * src, sample_t * dest, sample_t bias)
-{
- int i;
-
- for (i = 0; i < 256; i++)
- dest[i] = src[i] + src[i + 256] + bias;
-}
-
-static void zero (sample_t * samples)
-{
- int i;
-
- for (i = 0; i < 256; i++)
- samples[i] = 0;
-}
-
-void a52_downmix (sample_t * samples, int acmod, int output, sample_t bias,
- sample_t clev, sample_t slev)
-{
- switch (CONVERT (acmod, output & A52_CHANNEL_MASK)) {
-
- case CONVERT (A52_CHANNEL, A52_CHANNEL2):
- memcpy (samples, samples + 256, 256 * sizeof (sample_t));
- break;
-
- case CONVERT (A52_CHANNEL, A52_MONO):
- case CONVERT (A52_STEREO, A52_MONO):
- mix_2to1:
- mix2to1 (samples, samples + 256, bias);
- break;
-
- case CONVERT (A52_2F1R, A52_MONO):
- if (slev == 0)
- goto mix_2to1;
- case CONVERT (A52_3F, A52_MONO):
- mix_3to1:
- mix3to1 (samples, bias);
- break;
-
- case CONVERT (A52_3F1R, A52_MONO):
- if (slev == 0)
- goto mix_3to1;
- case CONVERT (A52_2F2R, A52_MONO):
- if (slev == 0)
- goto mix_2to1;
- mix4to1 (samples, bias);
- break;
-
- case CONVERT (A52_3F2R, A52_MONO):
- if (slev == 0)
- goto mix_3to1;
- mix5to1 (samples, bias);
- break;
-
- case CONVERT (A52_MONO, A52_DOLBY):
- memcpy (samples + 256, samples, 256 * sizeof (sample_t));
- break;
-
- case CONVERT (A52_3F, A52_STEREO):
- case CONVERT (A52_3F, A52_DOLBY):
- mix_3to2:
- mix3to2 (samples, bias);
- break;
-
- case CONVERT (A52_2F1R, A52_STEREO):
- if (slev == 0)
- break;
- mix21to2 (samples, samples + 256, bias);
- break;
-
- case CONVERT (A52_2F1R, A52_DOLBY):
- mix21toS (samples, bias);
- break;
-
- case CONVERT (A52_3F1R, A52_STEREO):
- if (slev == 0)
- goto mix_3to2;
- mix31to2 (samples, bias);
- break;
-
- case CONVERT (A52_3F1R, A52_DOLBY):
- mix31toS (samples, bias);
- break;
-
- case CONVERT (A52_2F2R, A52_STEREO):
- if (slev == 0)
- break;
- mix2to1 (samples, samples + 512, bias);
- mix2to1 (samples + 256, samples + 768, bias);
- break;
-
- case CONVERT (A52_2F2R, A52_DOLBY):
- mix22toS (samples, bias);
- break;
-
- case CONVERT (A52_3F2R, A52_STEREO):
- if (slev == 0)
- goto mix_3to2;
- mix32to2 (samples, bias);
- break;
-
- case CONVERT (A52_3F2R, A52_DOLBY):
- mix32toS (samples, bias);
- break;
-
- case CONVERT (A52_3F1R, A52_3F):
- if (slev == 0)
- break;
- mix21to2 (samples, samples + 512, bias);
- break;
-
- case CONVERT (A52_3F2R, A52_3F):
- if (slev == 0)
- break;
- mix2to1 (samples, samples + 768, bias);
- mix2to1 (samples + 512, samples + 1024, bias);
- break;
-
- case CONVERT (A52_3F1R, A52_2F1R):
- mix3to2 (samples, bias);
- memcpy (samples + 512, samples + 768, 256 * sizeof (sample_t));
- break;
-
- case CONVERT (A52_2F2R, A52_2F1R):
- mix2to1 (samples + 512, samples + 768, bias);
- break;
-
- case CONVERT (A52_3F2R, A52_2F1R):
- mix3to2 (samples, bias);
- move2to1 (samples + 768, samples + 512, bias);
- break;
-
- case CONVERT (A52_3F2R, A52_3F1R):
- mix2to1 (samples + 768, samples + 1024, bias);
- break;
-
- case CONVERT (A52_2F1R, A52_2F2R):
- memcpy (samples + 768, samples + 512, 256 * sizeof (sample_t));
- break;
-
- case CONVERT (A52_3F1R, A52_2F2R):
- mix3to2 (samples, bias);
- memcpy (samples + 512, samples + 768, 256 * sizeof (sample_t));
- break;
-
- case CONVERT (A52_3F2R, A52_2F2R):
- mix3to2 (samples, bias);
- memcpy (samples + 512, samples + 768, 256 * sizeof (sample_t));
- memcpy (samples + 768, samples + 1024, 256 * sizeof (sample_t));
- break;
-
- case CONVERT (A52_3F1R, A52_3F2R):
- memcpy (samples + 1027, samples + 768, 256 * sizeof (sample_t));
- break;
- }
-}
-
-void a52_upmix (sample_t * samples, int acmod, int output)
-{
- switch (CONVERT (acmod, output & A52_CHANNEL_MASK)) {
-
- case CONVERT (A52_CHANNEL, A52_CHANNEL2):
- memcpy (samples + 256, samples, 256 * sizeof (sample_t));
- break;
-
- case CONVERT (A52_3F2R, A52_MONO):
- zero (samples + 1024);
- case CONVERT (A52_3F1R, A52_MONO):
- case CONVERT (A52_2F2R, A52_MONO):
- zero (samples + 768);
- case CONVERT (A52_3F, A52_MONO):
- case CONVERT (A52_2F1R, A52_MONO):
- zero (samples + 512);
- case CONVERT (A52_CHANNEL, A52_MONO):
- case CONVERT (A52_STEREO, A52_MONO):
- zero (samples + 256);
- break;
-
- case CONVERT (A52_3F2R, A52_STEREO):
- case CONVERT (A52_3F2R, A52_DOLBY):
- zero (samples + 1024);
- case CONVERT (A52_3F1R, A52_STEREO):
- case CONVERT (A52_3F1R, A52_DOLBY):
- zero (samples + 768);
- case CONVERT (A52_3F, A52_STEREO):
- case CONVERT (A52_3F, A52_DOLBY):
- mix_3to2:
- memcpy (samples + 512, samples + 256, 256 * sizeof (sample_t));
- zero (samples + 256);
- break;
-
- case CONVERT (A52_2F2R, A52_STEREO):
- case CONVERT (A52_2F2R, A52_DOLBY):
- zero (samples + 768);
- case CONVERT (A52_2F1R, A52_STEREO):
- case CONVERT (A52_2F1R, A52_DOLBY):
- zero (samples + 512);
- break;
-
- case CONVERT (A52_3F2R, A52_3F):
- zero (samples + 1024);
- case CONVERT (A52_3F1R, A52_3F):
- case CONVERT (A52_2F2R, A52_2F1R):
- zero (samples + 768);
- break;
-
- case CONVERT (A52_3F2R, A52_3F1R):
- zero (samples + 1024);
- break;
-
- case CONVERT (A52_3F2R, A52_2F1R):
- zero (samples + 1024);
- case CONVERT (A52_3F1R, A52_2F1R):
- mix_31to21:
- memcpy (samples + 768, samples + 512, 256 * sizeof (sample_t));
- goto mix_3to2;
-
- case CONVERT (A52_3F2R, A52_2F2R):
- memcpy (samples + 1024, samples + 768, 256 * sizeof (sample_t));
- goto mix_31to21;
- }
-}
diff --git a/src/liba52/imdct.c b/src/liba52/imdct.c
deleted file mode 100644
index 5835e70a1..000000000
--- a/src/liba52/imdct.c
+++ /dev/null
@@ -1,431 +0,0 @@
-/*
- * imdct.c
- * Copyright (C) 2000-2002 Michel Lespinasse <walken@zoy.org>
- * Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
- *
- * The ifft algorithms in this file have been largely inspired by Dan
- * Bernstein's work, djbfft, available at http://cr.yp.to/djbfft.html
- *
- * This file is part of a52dec, a free ATSC A-52 stream decoder.
- * See http://liba52.sourceforge.net/ for updates.
- *
- * a52dec is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * a52dec is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "config.h"
-
-#include <math.h>
-#include <stdio.h>
-#ifdef LIBA52_DJBFFT
-#include <fftc4.h>
-#endif
-#ifndef M_PI
-#define M_PI 3.1415926535897932384626433832795029
-#endif
-#include <inttypes.h>
-
-#include "a52.h"
-#include "a52_internal.h"
-#include "xineutils.h"
-
-typedef struct complex_s {
- sample_t real;
- sample_t imag;
-} complex_t;
-
-static uint8_t fftorder[] = {
- 0,128, 64,192, 32,160,224, 96, 16,144, 80,208,240,112, 48,176,
- 8,136, 72,200, 40,168,232,104,248,120, 56,184, 24,152,216, 88,
- 4,132, 68,196, 36,164,228,100, 20,148, 84,212,244,116, 52,180,
- 252,124, 60,188, 28,156,220, 92, 12,140, 76,204,236,108, 44,172,
- 2,130, 66,194, 34,162,226, 98, 18,146, 82,210,242,114, 50,178,
- 10,138, 74,202, 42,170,234,106,250,122, 58,186, 26,154,218, 90,
- 254,126, 62,190, 30,158,222, 94, 14,142, 78,206,238,110, 46,174,
- 6,134, 70,198, 38,166,230,102,246,118, 54,182, 22,150,214, 86
-};
-
-/* Root values for IFFT */
-static sample_t roots16[3];
-static sample_t roots32[7];
-static sample_t roots64[15];
-static sample_t roots128[31];
-
-/* Twiddle factors for IMDCT */
-static complex_t pre1[128];
-static complex_t post1[64];
-static complex_t pre2[64];
-static complex_t post2[32];
-
-static sample_t a52_imdct_window[256];
-
-static void (* ifft128) (complex_t * buf);
-static void (* ifft64) (complex_t * buf);
-
-static inline void ifft2 (complex_t * buf)
-{
- double r, i;
-
- r = buf[0].real;
- i = buf[0].imag;
- buf[0].real += buf[1].real;
- buf[0].imag += buf[1].imag;
- buf[1].real = r - buf[1].real;
- buf[1].imag = i - buf[1].imag;
-}
-
-static inline void ifft4 (complex_t * buf)
-{
- double tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp8;
-
- tmp1 = buf[0].real + buf[1].real;
- tmp2 = buf[3].real + buf[2].real;
- tmp3 = buf[0].imag + buf[1].imag;
- tmp4 = buf[2].imag + buf[3].imag;
- tmp5 = buf[0].real - buf[1].real;
- tmp6 = buf[0].imag - buf[1].imag;
- tmp7 = buf[2].imag - buf[3].imag;
- tmp8 = buf[3].real - buf[2].real;
-
- buf[0].real = tmp1 + tmp2;
- buf[0].imag = tmp3 + tmp4;
- buf[2].real = tmp1 - tmp2;
- buf[2].imag = tmp3 - tmp4;
- buf[1].real = tmp5 + tmp7;
- buf[1].imag = tmp6 + tmp8;
- buf[3].real = tmp5 - tmp7;
- buf[3].imag = tmp6 - tmp8;
-}
-
-/* the basic split-radix ifft butterfly */
-
-#define BUTTERFLY(a0,a1,a2,a3,wr,wi) do { \
- tmp5 = a2.real * wr + a2.imag * wi; \
- tmp6 = a2.imag * wr - a2.real * wi; \
- tmp7 = a3.real * wr - a3.imag * wi; \
- tmp8 = a3.imag * wr + a3.real * wi; \
- tmp1 = tmp5 + tmp7; \
- tmp2 = tmp6 + tmp8; \
- tmp3 = tmp6 - tmp8; \
- tmp4 = tmp7 - tmp5; \
- a2.real = a0.real - tmp1; \
- a2.imag = a0.imag - tmp2; \
- a3.real = a1.real - tmp3; \
- a3.imag = a1.imag - tmp4; \
- a0.real += tmp1; \
- a0.imag += tmp2; \
- a1.real += tmp3; \
- a1.imag += tmp4; \
-} while (0)
-
-/* split-radix ifft butterfly, specialized for wr=1 wi=0 */
-
-#define BUTTERFLY_ZERO(a0,a1,a2,a3) do { \
- tmp1 = a2.real + a3.real; \
- tmp2 = a2.imag + a3.imag; \
- tmp3 = a2.imag - a3.imag; \
- tmp4 = a3.real - a2.real; \
- a2.real = a0.real - tmp1; \
- a2.imag = a0.imag - tmp2; \
- a3.real = a1.real - tmp3; \
- a3.imag = a1.imag - tmp4; \
- a0.real += tmp1; \
- a0.imag += tmp2; \
- a1.real += tmp3; \
- a1.imag += tmp4; \
-} while (0)
-
-/* split-radix ifft butterfly, specialized for wr=wi */
-
-#define BUTTERFLY_HALF(a0,a1,a2,a3,w) do { \
- tmp5 = (a2.real + a2.imag) * w; \
- tmp6 = (a2.imag - a2.real) * w; \
- tmp7 = (a3.real - a3.imag) * w; \
- tmp8 = (a3.imag + a3.real) * w; \
- tmp1 = tmp5 + tmp7; \
- tmp2 = tmp6 + tmp8; \
- tmp3 = tmp6 - tmp8; \
- tmp4 = tmp7 - tmp5; \
- a2.real = a0.real - tmp1; \
- a2.imag = a0.imag - tmp2; \
- a3.real = a1.real - tmp3; \
- a3.imag = a1.imag - tmp4; \
- a0.real += tmp1; \
- a0.imag += tmp2; \
- a1.real += tmp3; \
- a1.imag += tmp4; \
-} while (0)
-
-static inline void ifft8 (complex_t * buf)
-{
- double tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp8;
-
- ifft4 (buf);
- ifft2 (buf + 4);
- ifft2 (buf + 6);
- BUTTERFLY_ZERO (buf[0], buf[2], buf[4], buf[6]);
- BUTTERFLY_HALF (buf[1], buf[3], buf[5], buf[7], roots16[1]);
-}
-
-static void ifft_pass (complex_t * buf, sample_t * weight, int n)
-{
- complex_t * buf1;
- complex_t * buf2;
- complex_t * buf3;
- double tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp8;
- int i;
-
- buf++;
- buf1 = buf + n;
- buf2 = buf + 2 * n;
- buf3 = buf + 3 * n;
-
- BUTTERFLY_ZERO (buf[-1], buf1[-1], buf2[-1], buf3[-1]);
-
- i = n - 1;
-
- do {
- BUTTERFLY (buf[0], buf1[0], buf2[0], buf3[0], weight[n], weight[2*i]);
- buf++;
- buf1++;
- buf2++;
- buf3++;
- weight++;
- } while (--i);
-}
-
-static void ifft16 (complex_t * buf)
-{
- ifft8 (buf);
- ifft4 (buf + 8);
- ifft4 (buf + 12);
- ifft_pass (buf, roots16 - 4, 4);
-}
-
-static void ifft32 (complex_t * buf)
-{
- ifft16 (buf);
- ifft8 (buf + 16);
- ifft8 (buf + 24);
- ifft_pass (buf, roots32 - 8, 8);
-}
-
-static void ifft64_c (complex_t * buf)
-{
- ifft32 (buf);
- ifft16 (buf + 32);
- ifft16 (buf + 48);
- ifft_pass (buf, roots64 - 16, 16);
-}
-
-static void ifft128_c (complex_t * buf)
-{
- ifft32 (buf);
- ifft16 (buf + 32);
- ifft16 (buf + 48);
- ifft_pass (buf, roots64 - 16, 16);
-
- ifft32 (buf + 64);
- ifft32 (buf + 96);
- ifft_pass (buf, roots128 - 32, 32);
-}
-
-void a52_imdct_512 (sample_t * data, sample_t * delay, sample_t bias)
-{
- int i, k;
- sample_t t_r, t_i, a_r, a_i, b_r, b_i, w_1, w_2;
- const sample_t * window = a52_imdct_window;
- complex_t buf[128];
-
- for (i = 0; i < 128; i++) {
- k = fftorder[i];
- t_r = pre1[i].real;
- t_i = pre1[i].imag;
-
- buf[i].real = t_i * data[255-k] + t_r * data[k];
- buf[i].imag = t_r * data[255-k] - t_i * data[k];
- }
-
- ifft128 (buf);
-
- /* Post IFFT complex multiply plus IFFT complex conjugate*/
- /* Window and convert to real valued signal */
- for (i = 0; i < 64; i++) {
- /* y[n] = z[n] * (xcos1[n] + j * xsin1[n]) ; */
- t_r = post1[i].real;
- t_i = post1[i].imag;
-
- a_r = t_r * buf[i].real + t_i * buf[i].imag;
- a_i = t_i * buf[i].real - t_r * buf[i].imag;
- b_r = t_i * buf[127-i].real + t_r * buf[127-i].imag;
- b_i = t_r * buf[127-i].real - t_i * buf[127-i].imag;
-
- w_1 = window[2*i];
- w_2 = window[255-2*i];
- data[2*i] = delay[2*i] * w_2 - a_r * w_1 + bias;
- data[255-2*i] = delay[2*i] * w_1 + a_r * w_2 + bias;
- delay[2*i] = a_i;
-
- w_1 = window[2*i+1];
- w_2 = window[254-2*i];
- data[2*i+1] = delay[2*i+1] * w_2 + b_r * w_1 + bias;
- data[254-2*i] = delay[2*i+1] * w_1 - b_r * w_2 + bias;
- delay[2*i+1] = b_i;
- }
-}
-
-void a52_imdct_256(sample_t * data, sample_t * delay, sample_t bias)
-{
- int i, k;
- sample_t t_r, t_i, a_r, a_i, b_r, b_i, c_r, c_i, d_r, d_i, w_1, w_2;
- const sample_t * window = a52_imdct_window;
- complex_t buf1[64], buf2[64];
-
- /* Pre IFFT complex multiply plus IFFT cmplx conjugate */
- for (i = 0; i < 64; i++) {
- k = fftorder[i];
- t_r = pre2[i].real;
- t_i = pre2[i].imag;
-
- buf1[i].real = t_i * data[254-k] + t_r * data[k];
- buf1[i].imag = t_r * data[254-k] - t_i * data[k];
-
- buf2[i].real = t_i * data[255-k] + t_r * data[k+1];
- buf2[i].imag = t_r * data[255-k] - t_i * data[k+1];
- }
-
- ifft64 (buf1);
- ifft64 (buf2);
-
- /* Post IFFT complex multiply */
- /* Window and convert to real valued signal */
- for (i = 0; i < 32; i++) {
- /* y1[n] = z1[n] * (xcos2[n] + j * xs in2[n]) ; */
- t_r = post2[i].real;
- t_i = post2[i].imag;
-
- a_r = t_r * buf1[i].real + t_i * buf1[i].imag;
- a_i = t_i * buf1[i].real - t_r * buf1[i].imag;
- b_r = t_i * buf1[63-i].real + t_r * buf1[63-i].imag;
- b_i = t_r * buf1[63-i].real - t_i * buf1[63-i].imag;
-
- c_r = t_r * buf2[i].real + t_i * buf2[i].imag;
- c_i = t_i * buf2[i].real - t_r * buf2[i].imag;
- d_r = t_i * buf2[63-i].real + t_r * buf2[63-i].imag;
- d_i = t_r * buf2[63-i].real - t_i * buf2[63-i].imag;
-
- w_1 = window[2*i];
- w_2 = window[255-2*i];
- data[2*i] = delay[2*i] * w_2 - a_r * w_1 + bias;
- data[255-2*i] = delay[2*i] * w_1 + a_r * w_2 + bias;
- delay[2*i] = c_i;
-
- w_1 = window[128+2*i];
- w_2 = window[127-2*i];
- data[128+2*i] = delay[127-2*i] * w_2 + a_i * w_1 + bias;
- data[127-2*i] = delay[127-2*i] * w_1 - a_i * w_2 + bias;
- delay[127-2*i] = c_r;
-
- w_1 = window[2*i+1];
- w_2 = window[254-2*i];
- data[2*i+1] = delay[2*i+1] * w_2 - b_i * w_1 + bias;
- data[254-2*i] = delay[2*i+1] * w_1 + b_i * w_2 + bias;
- delay[2*i+1] = d_r;
-
- w_1 = window[129+2*i];
- w_2 = window[126-2*i];
- data[129+2*i] = delay[126-2*i] * w_2 + b_r * w_1 + bias;
- data[126-2*i] = delay[126-2*i] * w_1 - b_r * w_2 + bias;
- delay[126-2*i] = d_i;
- }
-}
-
-static double besselI0 (double x)
-{
- double bessel = 1;
- int i = 100;
-
- do
- bessel = bessel * x / (i * i) + 1;
- while (--i);
- return bessel;
-}
-
-void a52_imdct_init (uint32_t mm_accel)
-{
- int i, k;
- double sum;
-
- /* compute imdct window - kaiser-bessel derived window, alpha = 5.0 */
- sum = 0;
- for (i = 0; i < 256; i++) {
- sum += besselI0 (i * (256 - i) * (5 * M_PI / 256) * (5 * M_PI / 256));
- a52_imdct_window[i] = sum;
- }
- sum++;
- for (i = 0; i < 256; i++)
- a52_imdct_window[i] = sqrt (a52_imdct_window[i] / sum);
-
- for (i = 0; i < 3; i++)
- roots16[i] = cos ((M_PI / 8) * (i + 1));
-
- for (i = 0; i < 7; i++)
- roots32[i] = cos ((M_PI / 16) * (i + 1));
-
- for (i = 0; i < 15; i++)
- roots64[i] = cos ((M_PI / 32) * (i + 1));
-
- for (i = 0; i < 31; i++)
- roots128[i] = cos ((M_PI / 64) * (i + 1));
-
- for (i = 0; i < 64; i++) {
- k = fftorder[i] / 2 + 64;
- pre1[i].real = cos ((M_PI / 256) * (k - 0.25));
- pre1[i].imag = sin ((M_PI / 256) * (k - 0.25));
- }
-
- for (i = 64; i < 128; i++) {
- k = fftorder[i] / 2 + 64;
- pre1[i].real = -cos ((M_PI / 256) * (k - 0.25));
- pre1[i].imag = -sin ((M_PI / 256) * (k - 0.25));
- }
-
- for (i = 0; i < 64; i++) {
- post1[i].real = cos ((M_PI / 256) * (i + 0.5));
- post1[i].imag = sin ((M_PI / 256) * (i + 0.5));
- }
-
- for (i = 0; i < 64; i++) {
- k = fftorder[i] / 4;
- pre2[i].real = cos ((M_PI / 128) * (k - 0.25));
- pre2[i].imag = sin ((M_PI / 128) * (k - 0.25));
- }
-
- for (i = 0; i < 32; i++) {
- post2[i].real = cos ((M_PI / 128) * (i + 0.5));
- post2[i].imag = sin ((M_PI / 128) * (i + 0.5));
- }
-
-#ifdef LIBA52_DJBFFT
- if (mm_accel & MM_ACCEL_DJBFFT) {
- fprintf (stderr, "liba52:Using djbfft for IMDCT transform\n");
- ifft128 = (void (*) (complex_t *)) fftc4_un128;
- ifft64 = (void (*) (complex_t *)) fftc4_un64;
- } else
-#endif
- {
- ifft128 = ifft128_c;
- ifft64 = ifft64_c;
- }
-}
diff --git a/src/liba52/parse.c b/src/liba52/parse.c
deleted file mode 100644
index 0bfd02fce..000000000
--- a/src/liba52/parse.c
+++ /dev/null
@@ -1,894 +0,0 @@
-/*
- * parse.c
- * Copyright (C) 2000-2002 Michel Lespinasse <walken@zoy.org>
- * Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
- *
- * This file is part of a52dec, a free ATSC A-52 stream decoder.
- * See http://liba52.sourceforge.net/ for updates.
- *
- * a52dec is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * a52dec is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "config.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <inttypes.h>
-
-#include "a52.h"
-#include "a52_internal.h"
-#include "bitstream.h"
-#include "tables.h"
-#include "xineutils.h"
-
-typedef struct {
- sample_t q1[2];
- sample_t q2[2];
- sample_t q4;
- int q1_ptr;
- int q2_ptr;
- int q4_ptr;
-} quantizer_t;
-
-static uint8_t halfrate[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3};
-
-a52_state_t * a52_init (uint32_t mm_accel)
-{
- a52_state_t * state;
- int i;
-
- state = xine_xmalloc (sizeof (a52_state_t));
- if (state == NULL)
- return NULL;
-
- state->samples = xine_xmalloc_aligned (16, 256 * 12 * sizeof (sample_t), &state->samples_base);
- if (state->samples == NULL) {
- free (state);
- return NULL;
- }
-
- for (i = 0; i < 256 * 12; i++)
- state->samples[i] = 0;
-
- state->downmixed = 1;
-
- state->lfsr_state = 1;
-
- a52_imdct_init (mm_accel);
-
- return state;
-}
-
-sample_t * a52_samples (a52_state_t * state)
-{
- return state->samples;
-}
-
-int a52_syncinfo (uint8_t * buf, int * flags,
- int * sample_rate, int * bit_rate)
-{
- static int rate[] = { 32, 40, 48, 56, 64, 80, 96, 112,
- 128, 160, 192, 224, 256, 320, 384, 448,
- 512, 576, 640};
- static uint8_t lfeon[8] = {0x10, 0x10, 0x04, 0x04, 0x04, 0x01, 0x04, 0x01};
- int frmsizecod;
- int bitrate;
- int half;
- int acmod;
-
- if ((buf[0] != 0x0b) || (buf[1] != 0x77)) /* syncword */
- return 0;
-
- if (buf[5] >= 0x60) /* bsid >= 12 */
- return 0;
- half = halfrate[buf[5] >> 3];
-
- /* acmod, dsurmod and lfeon */
- acmod = buf[6] >> 5;
- *flags = ((((buf[6] & 0xf8) == 0x50) ? A52_DOLBY : acmod) |
- ((buf[6] & lfeon[acmod]) ? A52_LFE : 0));
-
- frmsizecod = buf[4] & 63;
- if (frmsizecod >= 38)
- return 0;
- bitrate = rate [frmsizecod >> 1];
- *bit_rate = (bitrate * 1000) >> half;
-
- switch (buf[4] & 0xc0) {
- case 0:
- *sample_rate = 48000 >> half;
- return 4 * bitrate;
- case 0x40:
- *sample_rate = 44100 >> half;
- return 2 * (320 * bitrate / 147 + (frmsizecod & 1));
- case 0x80:
- *sample_rate = 32000 >> half;
- return 6 * bitrate;
- default:
- return 0;
- }
-}
-
-int a52_frame (a52_state_t * state, uint8_t * buf, int * flags,
- sample_t * level, sample_t bias)
-{
- static sample_t clev[4] = {LEVEL_3DB, LEVEL_45DB, LEVEL_6DB, LEVEL_45DB};
- static sample_t slev[4] = {LEVEL_3DB, LEVEL_6DB, 0, LEVEL_6DB};
- int chaninfo;
- int acmod;
-
- state->fscod = buf[4] >> 6;
- state->halfrate = halfrate[buf[5] >> 3];
- state->acmod = acmod = buf[6] >> 5;
-
- a52_bitstream_set_ptr (state, buf + 6);
- bitstream_get (state, 3); /* skip acmod we already parsed */
-
- if ((acmod == 2) && (bitstream_get (state, 2) == 2)) /* dsurmod */
- acmod = A52_DOLBY;
-
- if ((acmod & 1) && (acmod != 1))
- state->clev = clev[bitstream_get (state, 2)]; /* cmixlev */
-
- if (acmod & 4)
- state->slev = slev[bitstream_get (state, 2)]; /* surmixlev */
-
- state->lfeon = bitstream_get (state, 1);
-
- state->output = a52_downmix_init (acmod, *flags, level,
- state->clev, state->slev);
- if (state->output < 0)
- return 1;
- if (state->lfeon && (*flags & A52_LFE))
- state->output |= A52_LFE;
- *flags = state->output;
- /* the 2* compensates for differences in imdct */
- state->dynrng = state->level = 2 * *level;
- state->bias = bias;
- state->dynrnge = 1;
- state->dynrngcall = NULL;
- state->cplba.deltbae = DELTA_BIT_NONE;
- state->ba[0].deltbae = state->ba[1].deltbae = state->ba[2].deltbae =
- state->ba[3].deltbae = state->ba[4].deltbae = DELTA_BIT_NONE;
-
- chaninfo = !acmod;
- do {
- bitstream_get (state, 5); /* dialnorm */
- if (bitstream_get (state, 1)) /* compre */
- bitstream_get (state, 8); /* compr */
- if (bitstream_get (state, 1)) /* langcode */
- bitstream_get (state, 8); /* langcod */
- if (bitstream_get (state, 1)) /* audprodie */
- bitstream_get (state, 7); /* mixlevel + roomtyp */
- } while (chaninfo--);
-
- bitstream_get (state, 2); /* copyrightb + origbs */
-
- if (bitstream_get (state, 1)) /* timecod1e */
- bitstream_get (state, 14); /* timecod1 */
- if (bitstream_get (state, 1)) /* timecod2e */
- bitstream_get (state, 14); /* timecod2 */
-
- if (bitstream_get (state, 1)) { /* addbsie */
- int addbsil;
-
- addbsil = bitstream_get (state, 6);
- do {
- bitstream_get (state, 8); /* addbsi */
- } while (addbsil--);
- }
-
- return 0;
-}
-
-void a52_dynrng (a52_state_t * state,
- sample_t (* call) (sample_t, void *), void * data)
-{
- state->dynrnge = 0;
- if (call) {
- state->dynrnge = 1;
- state->dynrngcall = call;
- state->dynrngdata = data;
- }
-}
-
-static int parse_exponents (a52_state_t * state, int expstr, int ngrps,
- uint8_t exponent, uint8_t * dest)
-{
- int exps;
-
- while (ngrps--) {
- exps = bitstream_get (state, 7);
-
- exponent += exp_1[exps];
- if (exponent > 24)
- return 1;
-
- switch (expstr) {
- case EXP_D45:
- *(dest++) = exponent;
- *(dest++) = exponent;
- case EXP_D25:
- *(dest++) = exponent;
- case EXP_D15:
- *(dest++) = exponent;
- }
-
- exponent += exp_2[exps];
- if (exponent > 24)
- return 1;
-
- switch (expstr) {
- case EXP_D45:
- *(dest++) = exponent;
- *(dest++) = exponent;
- case EXP_D25:
- *(dest++) = exponent;
- case EXP_D15:
- *(dest++) = exponent;
- }
-
- exponent += exp_3[exps];
- if (exponent > 24)
- return 1;
-
- switch (expstr) {
- case EXP_D45:
- *(dest++) = exponent;
- *(dest++) = exponent;
- case EXP_D25:
- *(dest++) = exponent;
- case EXP_D15:
- *(dest++) = exponent;
- }
- }
-
- return 0;
-}
-
-static int parse_deltba (a52_state_t * state, int8_t * deltba)
-{
- int deltnseg, deltlen, delta, j;
-
- memset (deltba, 0, 50);
-
- deltnseg = bitstream_get (state, 3);
- j = 0;
- do {
- j += bitstream_get (state, 5);
- deltlen = bitstream_get (state, 4);
- delta = bitstream_get (state, 3);
- delta -= (delta >= 4) ? 3 : 4;
- if (!deltlen)
- continue;
- if (j + deltlen >= 50)
- return 1;
- while (deltlen--)
- deltba[j++] = delta;
- } while (deltnseg--);
-
- return 0;
-}
-
-static inline int zero_snr_offsets (int nfchans, a52_state_t * state)
-{
- int i;
-
- if ((state->csnroffst) ||
- (state->chincpl && state->cplba.bai >> 3) || /* cplinu, fsnroffst */
- (state->lfeon && state->lfeba.bai >> 3)) /* fsnroffst */
- return 0;
- for (i = 0; i < nfchans; i++)
- if (state->ba[i].bai >> 3) /* fsnroffst */
- return 0;
- return 1;
-}
-
-static inline int16_t dither_gen (a52_state_t * state)
-{
- int16_t nstate;
-
- nstate = dither_lut[state->lfsr_state >> 8] ^ (state->lfsr_state << 8);
-
- state->lfsr_state = (uint16_t) nstate;
-
- return nstate;
-}
-
-static void coeff_get (a52_state_t * state, sample_t * coeff,
- expbap_t * expbap, quantizer_t * quantizer,
- sample_t level, int dither, int end)
-{
- int i;
- uint8_t * exp;
- int8_t * bap;
- sample_t factor[25];
-
- for (i = 0; i <= 24; i++)
- factor[i] = scale_factor[i] * level;
-
- exp = expbap->exp;
- bap = expbap->bap;
-
- for (i = 0; i < end; i++) {
- int bapi;
-
- bapi = bap[i];
- switch (bapi) {
- case 0:
- if (dither) {
- coeff[i] = dither_gen (state) * LEVEL_3DB * factor[exp[i]];
- continue;
- } else {
- coeff[i] = 0;
- continue;
- }
-
- case -1:
- if (quantizer->q1_ptr >= 0) {
- coeff[i] = quantizer->q1[quantizer->q1_ptr--] * factor[exp[i]];
- continue;
- } else {
- int code;
-
- code = bitstream_get (state, 5);
-
- quantizer->q1_ptr = 1;
- quantizer->q1[0] = q_1_2[code];
- quantizer->q1[1] = q_1_1[code];
- coeff[i] = q_1_0[code] * factor[exp[i]];
- continue;
- }
-
- case -2:
- if (quantizer->q2_ptr >= 0) {
- coeff[i] = quantizer->q2[quantizer->q2_ptr--] * factor[exp[i]];
- continue;
- } else {
- int code;
-
- code = bitstream_get (state, 7);
-
- quantizer->q2_ptr = 1;
- quantizer->q2[0] = q_2_2[code];
- quantizer->q2[1] = q_2_1[code];
- coeff[i] = q_2_0[code] * factor[exp[i]];
- continue;
- }
-
- case 3:
- coeff[i] = q_3[bitstream_get (state, 3)] * factor[exp[i]];
- continue;
-
- case -3:
- if (quantizer->q4_ptr == 0) {
- quantizer->q4_ptr = -1;
- coeff[i] = quantizer->q4 * factor[exp[i]];
- continue;
- } else {
- int code;
-
- code = bitstream_get (state, 7);
-
- quantizer->q4_ptr = 0;
- quantizer->q4 = q_4_1[code];
- coeff[i] = q_4_0[code] * factor[exp[i]];
- continue;
- }
-
- case 4:
- coeff[i] = q_5[bitstream_get (state, 4)] * factor[exp[i]];
- continue;
-
- default:
- coeff[i] = ((bitstream_get_2 (state, bapi) << (16 - bapi)) *
- factor[exp[i]]);
- }
- }
-}
-
-static void coeff_get_coupling (a52_state_t * state, int nfchans,
- sample_t * coeff, sample_t (* samples)[256],
- quantizer_t * quantizer, uint8_t dithflag[5])
-{
- int cplbndstrc, bnd, i, i_end, ch;
- uint8_t * exp;
- int8_t * bap;
- sample_t cplco[5];
-
- exp = state->cpl_expbap.exp;
- bap = state->cpl_expbap.bap;
- bnd = 0;
- cplbndstrc = state->cplbndstrc;
- i = state->cplstrtmant;
- while (i < state->cplendmant) {
- i_end = i + 12;
- while (cplbndstrc & 1) {
- cplbndstrc >>= 1;
- i_end += 12;
- }
- cplbndstrc >>= 1;
- for (ch = 0; ch < nfchans; ch++)
- cplco[ch] = state->cplco[ch][bnd] * coeff[ch];
- bnd++;
-
- while (i < i_end) {
- sample_t cplcoeff;
- int bapi;
-
- bapi = bap[i];
- switch (bapi) {
- case 0:
- cplcoeff = LEVEL_3DB * scale_factor[exp[i]];
- for (ch = 0; ch < nfchans; ch++)
- if ((state->chincpl >> ch) & 1) {
- if (dithflag[ch])
- samples[ch][i] = (cplcoeff * cplco[ch] *
- dither_gen (state));
- else
- samples[ch][i] = 0;
- }
- i++;
- continue;
-
- case -1:
- if (quantizer->q1_ptr >= 0) {
- cplcoeff = quantizer->q1[quantizer->q1_ptr--];
- break;
- } else {
- int code;
-
- code = bitstream_get (state, 5);
-
- quantizer->q1_ptr = 1;
- quantizer->q1[0] = q_1_2[code];
- quantizer->q1[1] = q_1_1[code];
- cplcoeff = q_1_0[code];
- break;
- }
-
- case -2:
- if (quantizer->q2_ptr >= 0) {
- cplcoeff = quantizer->q2[quantizer->q2_ptr--];
- break;
- } else {
- int code;
-
- code = bitstream_get (state, 7);
-
- quantizer->q2_ptr = 1;
- quantizer->q2[0] = q_2_2[code];
- quantizer->q2[1] = q_2_1[code];
- cplcoeff = q_2_0[code];
- break;
- }
-
- case 3:
- cplcoeff = q_3[bitstream_get (state, 3)];
- break;
-
- case -3:
- if (quantizer->q4_ptr == 0) {
- quantizer->q4_ptr = -1;
- cplcoeff = quantizer->q4;
- break;
- } else {
- int code;
-
- code = bitstream_get (state, 7);
-
- quantizer->q4_ptr = 0;
- quantizer->q4 = q_4_1[code];
- cplcoeff = q_4_0[code];
- break;
- }
-
- case 4:
- cplcoeff = q_5[bitstream_get (state, 4)];
- break;
-
- default:
- cplcoeff = bitstream_get_2 (state, bapi) << (16 - bapi);
- }
-
- cplcoeff *= scale_factor[exp[i]];
- for (ch = 0; ch < nfchans; ch++)
- if ((state->chincpl >> ch) & 1)
- samples[ch][i] = cplcoeff * cplco[ch];
- i++;
- }
- }
-}
-
-int a52_block (a52_state_t * state)
-{
- static const uint8_t nfchans_tbl[] = {2, 1, 2, 3, 3, 4, 4, 5, 1, 1, 2};
- static int rematrix_band[4] = {25, 37, 61, 253};
- int i, nfchans, chaninfo;
- uint8_t cplexpstr, chexpstr[5], lfeexpstr, do_bit_alloc, done_cpl;
- uint8_t blksw[5], dithflag[5];
- sample_t coeff[5];
- int chanbias;
- quantizer_t quantizer;
- sample_t * samples;
-
- nfchans = nfchans_tbl[state->acmod];
-
- for (i = 0; i < nfchans; i++)
- blksw[i] = bitstream_get (state, 1);
-
- for (i = 0; i < nfchans; i++)
- dithflag[i] = bitstream_get (state, 1);
-
- chaninfo = !state->acmod;
- do {
- if (bitstream_get (state, 1)) { /* dynrnge */
- int dynrng;
-
- dynrng = bitstream_get_2 (state, 8);
- if (state->dynrnge) {
- sample_t range;
-
- range = ((((dynrng & 0x1f) | 0x20) << 13) *
- scale_factor[3 - (dynrng >> 5)]);
- if (state->dynrngcall)
- range = state->dynrngcall (range, state->dynrngdata);
- state->dynrng = state->level * range;
- }
- }
- } while (chaninfo--);
-
- if (bitstream_get (state, 1)) { /* cplstre */
- state->chincpl = 0;
- if (bitstream_get (state, 1)) { /* cplinu */
- static uint8_t bndtab[16] = {31, 35, 37, 39, 41, 42, 43, 44,
- 45, 45, 46, 46, 47, 47, 48, 48};
- int cplbegf;
- int cplendf;
- int ncplsubnd;
-
- for (i = 0; i < nfchans; i++)
- state->chincpl |= bitstream_get (state, 1) << i;
- switch (state->acmod) {
- case 0: case 1:
- return 1;
- case 2:
- state->phsflginu = bitstream_get (state, 1);
- }
- cplbegf = bitstream_get (state, 4);
- cplendf = bitstream_get (state, 4);
-
- if (cplendf + 3 - cplbegf < 0)
- return 1;
- state->ncplbnd = ncplsubnd = cplendf + 3 - cplbegf;
- state->cplstrtbnd = bndtab[cplbegf];
- state->cplstrtmant = cplbegf * 12 + 37;
- state->cplendmant = cplendf * 12 + 73;
-
- state->cplbndstrc = 0;
- for (i = 0; i < ncplsubnd - 1; i++)
- if (bitstream_get (state, 1)) {
- state->cplbndstrc |= 1 << i;
- state->ncplbnd--;
- }
- }
- }
-
- if (state->chincpl) { /* cplinu */
- int j, cplcoe;
-
- cplcoe = 0;
- for (i = 0; i < nfchans; i++)
- if ((state->chincpl) >> i & 1)
- if (bitstream_get (state, 1)) { /* cplcoe */
- int mstrcplco, cplcoexp, cplcomant;
-
- cplcoe = 1;
- mstrcplco = 3 * bitstream_get (state, 2);
- for (j = 0; j < state->ncplbnd; j++) {
- cplcoexp = bitstream_get (state, 4);
- cplcomant = bitstream_get (state, 4);
- if (cplcoexp == 15)
- cplcomant <<= 14;
- else
- cplcomant = (cplcomant | 0x10) << 13;
- state->cplco[i][j] =
- cplcomant * scale_factor[cplcoexp + mstrcplco];
- }
- }
- if ((state->acmod == 2) && state->phsflginu && cplcoe)
- for (j = 0; j < state->ncplbnd; j++)
- if (bitstream_get (state, 1)) /* phsflg */
- state->cplco[1][j] = -state->cplco[1][j];
- }
-
- if ((state->acmod == 2) && (bitstream_get (state, 1))) { /* rematstr */
- int end;
-
- state->rematflg = 0;
- end = (state->chincpl) ? state->cplstrtmant : 253; /* cplinu */
- i = 0;
- do
- state->rematflg |= bitstream_get (state, 1) << i;
- while (rematrix_band[i++] < end);
- }
-
- cplexpstr = EXP_REUSE;
- lfeexpstr = EXP_REUSE;
- if (state->chincpl) /* cplinu */
- cplexpstr = bitstream_get (state, 2);
- for (i = 0; i < nfchans; i++)
- chexpstr[i] = bitstream_get (state, 2);
- if (state->lfeon)
- lfeexpstr = bitstream_get (state, 1);
-
- for (i = 0; i < nfchans; i++)
- if (chexpstr[i] != EXP_REUSE) {
- if ((state->chincpl >> i) & 1)
- state->endmant[i] = state->cplstrtmant;
- else {
- int chbwcod;
-
- chbwcod = bitstream_get (state, 6);
- if (chbwcod > 60)
- return 1;
- state->endmant[i] = chbwcod * 3 + 73;
- }
- }
-
- do_bit_alloc = 0;
-
- if (cplexpstr != EXP_REUSE) {
- int cplabsexp, ncplgrps;
-
- do_bit_alloc = 64;
- ncplgrps = ((state->cplendmant - state->cplstrtmant) /
- (3 << (cplexpstr - 1)));
- cplabsexp = bitstream_get (state, 4) << 1;
- if (parse_exponents (state, cplexpstr, ncplgrps, cplabsexp,
- state->cpl_expbap.exp + state->cplstrtmant))
- return 1;
- }
- for (i = 0; i < nfchans; i++)
- if (chexpstr[i] != EXP_REUSE) {
- int grp_size, nchgrps;
-
- do_bit_alloc |= 1 << i;
- grp_size = 3 << (chexpstr[i] - 1);
- nchgrps = (state->endmant[i] + grp_size - 4) / grp_size;
- state->fbw_expbap[i].exp[0] = bitstream_get (state, 4);
- if (parse_exponents (state, chexpstr[i], nchgrps,
- state->fbw_expbap[i].exp[0],
- state->fbw_expbap[i].exp + 1))
- return 1;
- bitstream_get (state, 2); /* gainrng */
- }
- if (lfeexpstr != EXP_REUSE) {
- do_bit_alloc |= 32;
- state->lfe_expbap.exp[0] = bitstream_get (state, 4);
- if (parse_exponents (state, lfeexpstr, 2, state->lfe_expbap.exp[0],
- state->lfe_expbap.exp + 1))
- return 1;
- }
-
- if (bitstream_get (state, 1)) { /* baie */
- do_bit_alloc = -1;
- state->bai = bitstream_get (state, 11);
- }
- if (bitstream_get (state, 1)) { /* snroffste */
- do_bit_alloc = -1;
- state->csnroffst = bitstream_get (state, 6);
- if (state->chincpl) /* cplinu */
- state->cplba.bai = bitstream_get (state, 7);
- for (i = 0; i < nfchans; i++)
- state->ba[i].bai = bitstream_get (state, 7);
- if (state->lfeon)
- state->lfeba.bai = bitstream_get (state, 7);
- }
- if ((state->chincpl) && (bitstream_get (state, 1))) { /* cplleake */
- do_bit_alloc |= 64;
- state->cplfleak = 9 - bitstream_get (state, 3);
- state->cplsleak = 9 - bitstream_get (state, 3);
- }
-
- if (bitstream_get (state, 1)) { /* deltbaie */
- do_bit_alloc = -1;
- if (state->chincpl) /* cplinu */
- state->cplba.deltbae = bitstream_get (state, 2);
- for (i = 0; i < nfchans; i++)
- state->ba[i].deltbae = bitstream_get (state, 2);
- if (state->chincpl && /* cplinu */
- (state->cplba.deltbae == DELTA_BIT_NEW) &&
- parse_deltba (state, state->cplba.deltba))
- return 1;
- for (i = 0; i < nfchans; i++)
- if ((state->ba[i].deltbae == DELTA_BIT_NEW) &&
- parse_deltba (state, state->ba[i].deltba))
- return 1;
- }
-
- if (do_bit_alloc) {
- if (zero_snr_offsets (nfchans, state)) {
- memset (state->cpl_expbap.bap, 0, sizeof (state->cpl_expbap.bap));
- for (i = 0; i < nfchans; i++)
- memset (state->fbw_expbap[i].bap, 0,
- sizeof (state->fbw_expbap[i].bap));
- memset (state->lfe_expbap.bap, 0, sizeof (state->lfe_expbap.bap));
- } else {
- if (state->chincpl && (do_bit_alloc & 64)) /* cplinu */
- a52_bit_allocate (state, &state->cplba, state->cplstrtbnd,
- state->cplstrtmant, state->cplendmant,
- state->cplfleak << 8, state->cplsleak << 8,
- &state->cpl_expbap);
- for (i = 0; i < nfchans; i++)
- if (do_bit_alloc & (1 << i))
- a52_bit_allocate (state, state->ba + i, 0, 0,
- state->endmant[i], 0, 0,
- state->fbw_expbap +i);
- if (state->lfeon && (do_bit_alloc & 32)) {
- state->lfeba.deltbae = DELTA_BIT_NONE;
- a52_bit_allocate (state, &state->lfeba, 0, 0, 7, 0, 0,
- &state->lfe_expbap);
- }
- }
- }
-
- if (bitstream_get (state, 1)) { /* skiple */
- i = bitstream_get (state, 9); /* skipl */
- while (i--)
- bitstream_get (state, 8);
- }
-
- samples = state->samples;
- if (state->output & A52_LFE)
- samples += 256; /* shift for LFE channel */
-
- chanbias = a52_downmix_coeff (coeff, state->acmod, state->output,
- state->dynrng, state->clev, state->slev);
-
- quantizer.q1_ptr = quantizer.q2_ptr = quantizer.q4_ptr = -1;
- done_cpl = 0;
-
- for (i = 0; i < nfchans; i++) {
- int j;
-
- coeff_get (state, samples + 256 * i, state->fbw_expbap +i, &quantizer,
- coeff[i], dithflag[i], state->endmant[i]);
-
- if ((state->chincpl >> i) & 1) {
- if (!done_cpl) {
- done_cpl = 1;
- coeff_get_coupling (state, nfchans, coeff,
- (sample_t (*)[256])samples, &quantizer,
- dithflag);
- }
- j = state->cplendmant;
- } else
- j = state->endmant[i];
- do
- (samples + 256 * i)[j] = 0;
- while (++j < 256);
- }
-
- if (state->acmod == 2) {
- int j, end, band, rematflg;
-
- end = ((state->endmant[0] < state->endmant[1]) ?
- state->endmant[0] : state->endmant[1]);
-
- i = 0;
- j = 13;
- rematflg = state->rematflg;
- do {
- if (! (rematflg & 1)) {
- rematflg >>= 1;
- j = rematrix_band[i++];
- continue;
- }
- rematflg >>= 1;
- band = rematrix_band[i++];
- if (band > end)
- band = end;
- do {
- sample_t tmp0, tmp1;
-
- tmp0 = samples[j];
- tmp1 = (samples+256)[j];
- samples[j] = tmp0 + tmp1;
- (samples+256)[j] = tmp0 - tmp1;
- } while (++j < band);
- } while (j < end);
- }
-
- if (state->lfeon) {
- if (state->output & A52_LFE) {
- coeff_get (state, samples - 256, &state->lfe_expbap, &quantizer,
- state->dynrng, 0, 7);
- for (i = 7; i < 256; i++)
- (samples-256)[i] = 0;
- a52_imdct_512 (samples - 256, samples + 1536 - 256, state->bias);
- } else {
- /* just skip the LFE coefficients */
- coeff_get (state, samples + 1280, &state->lfe_expbap, &quantizer,
- 0, 0, 7);
- }
- }
-
- i = 0;
- if (nfchans_tbl[state->output & A52_CHANNEL_MASK] < nfchans)
- for (i = 1; i < nfchans; i++)
- if (blksw[i] != blksw[0])
- break;
-
- if (i < nfchans) {
- if (state->downmixed) {
- state->downmixed = 0;
- a52_upmix (samples + 1536, state->acmod, state->output);
- }
-
- for (i = 0; i < nfchans; i++) {
- sample_t bias;
-
- bias = 0;
- if (!(chanbias & (1 << i)))
- bias = state->bias;
-
- if (coeff[i]) {
- if (blksw[i])
- a52_imdct_256 (samples + 256 * i, samples + 1536 + 256 * i,
- bias);
- else
- a52_imdct_512 (samples + 256 * i, samples + 1536 + 256 * i,
- bias);
- } else {
- int j;
-
- for (j = 0; j < 256; j++)
- (samples + 256 * i)[j] = bias;
- }
- }
-
- a52_downmix (samples, state->acmod, state->output, state->bias,
- state->clev, state->slev);
- } else {
- nfchans = nfchans_tbl[state->output & A52_CHANNEL_MASK];
-
- a52_downmix (samples, state->acmod, state->output, 0,
- state->clev, state->slev);
-
- if (!state->downmixed) {
- state->downmixed = 1;
- a52_downmix (samples + 1536, state->acmod, state->output, 0,
- state->clev, state->slev);
- }
-
- if (blksw[0])
- for (i = 0; i < nfchans; i++)
- a52_imdct_256 (samples + 256 * i, samples + 1536 + 256 * i,
- state->bias);
- else
- for (i = 0; i < nfchans; i++)
- a52_imdct_512 (samples + 256 * i, samples + 1536 + 256 * i,
- state->bias);
- }
-
- return 0;
-}
-
-void a52_free (a52_state_t * state)
-{
- free (state->samples_base);
- free (state);
-}
diff --git a/src/liba52/tables.h b/src/liba52/tables.h
deleted file mode 100644
index a35543db7..000000000
--- a/src/liba52/tables.h
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * tables.h
- * Copyright (C) 2000-2002 Michel Lespinasse <walken@zoy.org>
- * Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
- *
- * This file is part of a52dec, a free ATSC A-52 stream decoder.
- * See http://liba52.sourceforge.net/ for updates.
- *
- * a52dec is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * a52dec is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-static const int8_t exp_1[128] = {
- -2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 25,25,25
-};
-static const int8_t exp_2[128] = {
- -2,-2,-2,-2,-2,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
- -2,-2,-2,-2,-2,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
- -2,-2,-2,-2,-2,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
- -2,-2,-2,-2,-2,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
- -2,-2,-2,-2,-2,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
- 25,25,25
-};
-static const int8_t exp_3[128] = {
- -2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,
- -2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,
- -2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,
- -2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,
- -2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,
- 25,25,25
-};
-
-#define Q0 ((-2 << 15) / 3.0)
-#define Q1 (0)
-#define Q2 ((2 << 15) / 3.0)
-
-static const sample_t q_1_0[32] = {
- Q0,Q0,Q0,Q0,Q0,Q0,Q0,Q0,Q0,
- Q1,Q1,Q1,Q1,Q1,Q1,Q1,Q1,Q1,
- Q2,Q2,Q2,Q2,Q2,Q2,Q2,Q2,Q2,
- 0,0,0,0,0
-};
-
-static const sample_t q_1_1[32] = {
- Q0,Q0,Q0,Q1,Q1,Q1,Q2,Q2,Q2,
- Q0,Q0,Q0,Q1,Q1,Q1,Q2,Q2,Q2,
- Q0,Q0,Q0,Q1,Q1,Q1,Q2,Q2,Q2,
- 0,0,0,0,0
-};
-
-static const sample_t q_1_2[32] = {
- Q0,Q1,Q2,Q0,Q1,Q2,Q0,Q1,Q2,
- Q0,Q1,Q2,Q0,Q1,Q2,Q0,Q1,Q2,
- Q0,Q1,Q2,Q0,Q1,Q2,Q0,Q1,Q2,
- 0,0,0,0,0
-};
-
-#undef Q0
-#undef Q1
-#undef Q2
-
-#define Q0 ((-4 << 15) / 5.0)
-#define Q1 ((-2 << 15) / 5.0)
-#define Q2 (0)
-#define Q3 ((2 << 15) / 5.0)
-#define Q4 ((4 << 15) / 5.0)
-
-static const sample_t q_2_0[128] = {
- Q0,Q0,Q0,Q0,Q0,Q0,Q0,Q0,Q0,Q0,Q0,Q0,Q0,Q0,Q0,Q0,Q0,Q0,Q0,Q0,Q0,Q0,Q0,Q0,Q0,
- Q1,Q1,Q1,Q1,Q1,Q1,Q1,Q1,Q1,Q1,Q1,Q1,Q1,Q1,Q1,Q1,Q1,Q1,Q1,Q1,Q1,Q1,Q1,Q1,Q1,
- Q2,Q2,Q2,Q2,Q2,Q2,Q2,Q2,Q2,Q2,Q2,Q2,Q2,Q2,Q2,Q2,Q2,Q2,Q2,Q2,Q2,Q2,Q2,Q2,Q2,
- Q3,Q3,Q3,Q3,Q3,Q3,Q3,Q3,Q3,Q3,Q3,Q3,Q3,Q3,Q3,Q3,Q3,Q3,Q3,Q3,Q3,Q3,Q3,Q3,Q3,
- Q4,Q4,Q4,Q4,Q4,Q4,Q4,Q4,Q4,Q4,Q4,Q4,Q4,Q4,Q4,Q4,Q4,Q4,Q4,Q4,Q4,Q4,Q4,Q4,Q4,
- 0,0,0
-};
-
-static const sample_t q_2_1[128] = {
- Q0,Q0,Q0,Q0,Q0,Q1,Q1,Q1,Q1,Q1,Q2,Q2,Q2,Q2,Q2,Q3,Q3,Q3,Q3,Q3,Q4,Q4,Q4,Q4,Q4,
- Q0,Q0,Q0,Q0,Q0,Q1,Q1,Q1,Q1,Q1,Q2,Q2,Q2,Q2,Q2,Q3,Q3,Q3,Q3,Q3,Q4,Q4,Q4,Q4,Q4,
- Q0,Q0,Q0,Q0,Q0,Q1,Q1,Q1,Q1,Q1,Q2,Q2,Q2,Q2,Q2,Q3,Q3,Q3,Q3,Q3,Q4,Q4,Q4,Q4,Q4,
- Q0,Q0,Q0,Q0,Q0,Q1,Q1,Q1,Q1,Q1,Q2,Q2,Q2,Q2,Q2,Q3,Q3,Q3,Q3,Q3,Q4,Q4,Q4,Q4,Q4,
- Q0,Q0,Q0,Q0,Q0,Q1,Q1,Q1,Q1,Q1,Q2,Q2,Q2,Q2,Q2,Q3,Q3,Q3,Q3,Q3,Q4,Q4,Q4,Q4,Q4,
- 0,0,0
-};
-
-static const sample_t q_2_2[128] = {
- Q0,Q1,Q2,Q3,Q4,Q0,Q1,Q2,Q3,Q4,Q0,Q1,Q2,Q3,Q4,Q0,Q1,Q2,Q3,Q4,Q0,Q1,Q2,Q3,Q4,
- Q0,Q1,Q2,Q3,Q4,Q0,Q1,Q2,Q3,Q4,Q0,Q1,Q2,Q3,Q4,Q0,Q1,Q2,Q3,Q4,Q0,Q1,Q2,Q3,Q4,
- Q0,Q1,Q2,Q3,Q4,Q0,Q1,Q2,Q3,Q4,Q0,Q1,Q2,Q3,Q4,Q0,Q1,Q2,Q3,Q4,Q0,Q1,Q2,Q3,Q4,
- Q0,Q1,Q2,Q3,Q4,Q0,Q1,Q2,Q3,Q4,Q0,Q1,Q2,Q3,Q4,Q0,Q1,Q2,Q3,Q4,Q0,Q1,Q2,Q3,Q4,
- Q0,Q1,Q2,Q3,Q4,Q0,Q1,Q2,Q3,Q4,Q0,Q1,Q2,Q3,Q4,Q0,Q1,Q2,Q3,Q4,Q0,Q1,Q2,Q3,Q4,
- 0,0,0
-};
-
-#undef Q0
-#undef Q1
-#undef Q2
-#undef Q3
-#undef Q4
-
-static const sample_t q_3[8] = {
- (-6 << 15)/7.0, (-4 << 15)/7.0, (-2 << 15)/7.0, 0,
- ( 2 << 15)/7.0, ( 4 << 15)/7.0, ( 6 << 15)/7.0, 0
-};
-
-#define Q0 ((-10 << 15) / 11.0)
-#define Q1 ((-8 << 15) / 11.0)
-#define Q2 ((-6 << 15) / 11.0)
-#define Q3 ((-4 << 15) / 11.0)
-#define Q4 ((-2 << 15) / 11.0)
-#define Q5 (0)
-#define Q6 ((2 << 15) / 11.0)
-#define Q7 ((4 << 15) / 11.0)
-#define Q8 ((6 << 15) / 11.0)
-#define Q9 ((8 << 15) / 11.0)
-#define QA ((10 << 15) / 11.0)
-
-static const sample_t q_4_0[128] = {
- Q0, Q0, Q0, Q0, Q0, Q0, Q0, Q0, Q0, Q0, Q0,
- Q1, Q1, Q1, Q1, Q1, Q1, Q1, Q1, Q1, Q1, Q1,
- Q2, Q2, Q2, Q2, Q2, Q2, Q2, Q2, Q2, Q2, Q2,
- Q3, Q3, Q3, Q3, Q3, Q3, Q3, Q3, Q3, Q3, Q3,
- Q4, Q4, Q4, Q4, Q4, Q4, Q4, Q4, Q4, Q4, Q4,
- Q5, Q5, Q5, Q5, Q5, Q5, Q5, Q5, Q5, Q5, Q5,
- Q6, Q6, Q6, Q6, Q6, Q6, Q6, Q6, Q6, Q6, Q6,
- Q7, Q7, Q7, Q7, Q7, Q7, Q7, Q7, Q7, Q7, Q7,
- Q8, Q8, Q8, Q8, Q8, Q8, Q8, Q8, Q8, Q8, Q8,
- Q9, Q9, Q9, Q9, Q9, Q9, Q9, Q9, Q9, Q9, Q9,
- QA, QA, QA, QA, QA, QA, QA, QA, QA, QA, QA,
- 0, 0, 0, 0, 0, 0, 0
-};
-
-static const sample_t q_4_1[128] = {
- Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8, Q9, QA,
- Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8, Q9, QA,
- Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8, Q9, QA,
- Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8, Q9, QA,
- Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8, Q9, QA,
- Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8, Q9, QA,
- Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8, Q9, QA,
- Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8, Q9, QA,
- Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8, Q9, QA,
- Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8, Q9, QA,
- Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8, Q9, QA,
- 0, 0, 0, 0, 0, 0, 0
-};
-
-#undef Q0
-#undef Q1
-#undef Q2
-#undef Q3
-#undef Q4
-#undef Q5
-#undef Q6
-#undef Q7
-#undef Q8
-#undef Q9
-#undef QA
-
-static const sample_t q_5[16] = {
- (-14 << 15)/15.0,(-12 << 15)/15.0,(-10 << 15)/15.0,
- ( -8 << 15)/15.0,( -6 << 15)/15.0,( -4 << 15)/15.0,
- ( -2 << 15)/15.0, 0 ,( 2 << 15)/15.0,
- ( 4 << 15)/15.0,( 6 << 15)/15.0,( 8 << 15)/15.0,
- ( 10 << 15)/15.0,( 12 << 15)/15.0,( 14 << 15)/15.0,
- 0
-};
-
-static const sample_t scale_factor[25] = {
- 0.000030517578125,
- 0.0000152587890625,
- 0.00000762939453125,
- 0.000003814697265625,
- 0.0000019073486328125,
- 0.00000095367431640625,
- 0.000000476837158203125,
- 0.0000002384185791015625,
- 0.00000011920928955078125,
- 0.000000059604644775390625,
- 0.0000000298023223876953125,
- 0.00000001490116119384765625,
- 0.000000007450580596923828125,
- 0.0000000037252902984619140625,
- 0.00000000186264514923095703125,
- 0.000000000931322574615478515625,
- 0.0000000004656612873077392578125,
- 0.00000000023283064365386962890625,
- 0.000000000116415321826934814453125,
- 0.0000000000582076609134674072265625,
- 0.00000000002910383045673370361328125,
- 0.000000000014551915228366851806640625,
- 0.0000000000072759576141834259033203125,
- 0.00000000000363797880709171295166015625,
- 0.000000000001818989403545856475830078125
-};
-
-static const uint16_t dither_lut[256] = {
- 0x0000, 0xa011, 0xe033, 0x4022, 0x6077, 0xc066, 0x8044, 0x2055,
- 0xc0ee, 0x60ff, 0x20dd, 0x80cc, 0xa099, 0x0088, 0x40aa, 0xe0bb,
- 0x21cd, 0x81dc, 0xc1fe, 0x61ef, 0x41ba, 0xe1ab, 0xa189, 0x0198,
- 0xe123, 0x4132, 0x0110, 0xa101, 0x8154, 0x2145, 0x6167, 0xc176,
- 0x439a, 0xe38b, 0xa3a9, 0x03b8, 0x23ed, 0x83fc, 0xc3de, 0x63cf,
- 0x8374, 0x2365, 0x6347, 0xc356, 0xe303, 0x4312, 0x0330, 0xa321,
- 0x6257, 0xc246, 0x8264, 0x2275, 0x0220, 0xa231, 0xe213, 0x4202,
- 0xa2b9, 0x02a8, 0x428a, 0xe29b, 0xc2ce, 0x62df, 0x22fd, 0x82ec,
- 0x8734, 0x2725, 0x6707, 0xc716, 0xe743, 0x4752, 0x0770, 0xa761,
- 0x47da, 0xe7cb, 0xa7e9, 0x07f8, 0x27ad, 0x87bc, 0xc79e, 0x678f,
- 0xa6f9, 0x06e8, 0x46ca, 0xe6db, 0xc68e, 0x669f, 0x26bd, 0x86ac,
- 0x6617, 0xc606, 0x8624, 0x2635, 0x0660, 0xa671, 0xe653, 0x4642,
- 0xc4ae, 0x64bf, 0x249d, 0x848c, 0xa4d9, 0x04c8, 0x44ea, 0xe4fb,
- 0x0440, 0xa451, 0xe473, 0x4462, 0x6437, 0xc426, 0x8404, 0x2415,
- 0xe563, 0x4572, 0x0550, 0xa541, 0x8514, 0x2505, 0x6527, 0xc536,
- 0x258d, 0x859c, 0xc5be, 0x65af, 0x45fa, 0xe5eb, 0xa5c9, 0x05d8,
- 0xae79, 0x0e68, 0x4e4a, 0xee5b, 0xce0e, 0x6e1f, 0x2e3d, 0x8e2c,
- 0x6e97, 0xce86, 0x8ea4, 0x2eb5, 0x0ee0, 0xaef1, 0xeed3, 0x4ec2,
- 0x8fb4, 0x2fa5, 0x6f87, 0xcf96, 0xefc3, 0x4fd2, 0x0ff0, 0xafe1,
- 0x4f5a, 0xef4b, 0xaf69, 0x0f78, 0x2f2d, 0x8f3c, 0xcf1e, 0x6f0f,
- 0xede3, 0x4df2, 0x0dd0, 0xadc1, 0x8d94, 0x2d85, 0x6da7, 0xcdb6,
- 0x2d0d, 0x8d1c, 0xcd3e, 0x6d2f, 0x4d7a, 0xed6b, 0xad49, 0x0d58,
- 0xcc2e, 0x6c3f, 0x2c1d, 0x8c0c, 0xac59, 0x0c48, 0x4c6a, 0xec7b,
- 0x0cc0, 0xacd1, 0xecf3, 0x4ce2, 0x6cb7, 0xcca6, 0x8c84, 0x2c95,
- 0x294d, 0x895c, 0xc97e, 0x696f, 0x493a, 0xe92b, 0xa909, 0x0918,
- 0xe9a3, 0x49b2, 0x0990, 0xa981, 0x89d4, 0x29c5, 0x69e7, 0xc9f6,
- 0x0880, 0xa891, 0xe8b3, 0x48a2, 0x68f7, 0xc8e6, 0x88c4, 0x28d5,
- 0xc86e, 0x687f, 0x285d, 0x884c, 0xa819, 0x0808, 0x482a, 0xe83b,
- 0x6ad7, 0xcac6, 0x8ae4, 0x2af5, 0x0aa0, 0xaab1, 0xea93, 0x4a82,
- 0xaa39, 0x0a28, 0x4a0a, 0xea1b, 0xca4e, 0x6a5f, 0x2a7d, 0x8a6c,
- 0x4b1a, 0xeb0b, 0xab29, 0x0b38, 0x2b6d, 0x8b7c, 0xcb5e, 0x6b4f,
- 0x8bf4, 0x2be5, 0x6bc7, 0xcbd6, 0xeb83, 0x4b92, 0x0bb0, 0xaba1
-};
diff --git a/src/libdts/Makefile.am b/src/libdts/Makefile.am
deleted file mode 100644
index 1329dd49c..000000000
--- a/src/libdts/Makefile.am
+++ /dev/null
@@ -1,28 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-if DTS
-dts_module = xineplug_decode_dts.la
-endif
-
-xineplug_LTLIBRARIES = $(dts_module)
-
-if EXTERNAL_LIBDTS
-fnsa =
-internal_sources =
-else
-fnsa = -fno-strict-aliasing
-internal_sources = bitstream.c downmix.c parse.c
-endif
-
-xineplug_decode_dts_la_SOURCES = xine_dts_decoder.c $(internal_sources)
-xineplug_decode_dts_la_CFLAGS = $(LIBDTS_CFLAGS) $(VISIBILITY_FLAG) $(fnsa)
-xineplug_decode_dts_la_LDFLAGS = $(xineplug_ldflags)
-
-if EXTERNAL_LIBDTS
-xineplug_decode_dts_la_LIBADD = $(XINE_LIB) $(LIBDTS_LIBS) $(LTLIBINTL) -lm
-else
-xineplug_decode_dts_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) -lm
-endif
-
-noinst_HEADERS = bitstream.h internal-dts.h dts_internal.h tables.h tables_adpcm.h \
- tables_fir.h tables_huffman.h tables_quantization.h tables_vq.h
diff --git a/src/libdts/bitstream.c b/src/libdts/bitstream.c
deleted file mode 100644
index 50b2b9fe8..000000000
--- a/src/libdts/bitstream.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * bitstream.c
- * Copyright (C) 2004 Gildas Bazin <gbazin@videolan.org>
- * Copyright (C) 2000-2003 Michel Lespinasse <walken@zoy.org>
- * Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
- *
- * This file is part of dtsdec, a free DTS Coherent Acoustics stream decoder.
- * See http://www.videolan.org/dtsdec.html for updates.
- *
- * dtsdec is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * dtsdec is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "config.h"
-
-#include <inttypes.h>
-
-#include "internal-dts.h"
-#include "dts_internal.h"
-#include "bitstream.h"
-
-#define BUFFER_SIZE 4096
-
-void dts_bitstream_init (dts_state_t * state, uint8_t * buf, int word_mode,
- int bigendian_mode)
-{
- intptr_t align;
-
- align = (uintptr_t)buf & 3;
- state->buffer_start = (uint32_t *) (buf - align);
- state->bits_left = 0;
- state->current_word = 0;
- state->word_mode = word_mode;
- state->bigendian_mode = bigendian_mode;
- bitstream_get (state, align * 8);
-}
-#include<stdio.h>
-static inline void bitstream_fill_current (dts_state_t * state)
-{
- uint32_t tmp;
-
- tmp = *(state->buffer_start++);
-
- if (state->bigendian_mode)
- state->current_word = swab32 (tmp);
- else
- state->current_word = swable32 (tmp);
-
- if (!state->word_mode)
- {
- state->current_word = (state->current_word & 0x00003FFF) |
- ((state->current_word & 0x3FFF0000 ) >> 2);
- }
-}
-
-/*
- * The fast paths for _get is in the
- * bitstream.h header file so it can be inlined.
- *
- * The "bottom half" of this routine is suffixed _bh
- *
- * -ah
- */
-
-uint32_t dts_bitstream_get_bh (dts_state_t * state, uint32_t num_bits)
-{
- uint32_t result;
-
- num_bits -= state->bits_left;
-
- result = ((state->current_word << (32 - state->bits_left)) >>
- (32 - state->bits_left));
-
- if ( !state->word_mode && num_bits > 28 ) {
- bitstream_fill_current (state);
- result = (result << 28) | state->current_word;
- num_bits -= 28;
- }
-
- bitstream_fill_current (state);
-
- if ( state->word_mode )
- {
- if (num_bits != 0)
- result = (result << num_bits) |
- (state->current_word >> (32 - num_bits));
-
- state->bits_left = 32 - num_bits;
- }
- else
- {
- if (num_bits != 0)
- result = (result << num_bits) |
- (state->current_word >> (28 - num_bits));
-
- state->bits_left = 28 - num_bits;
- }
-
- return result;
-}
diff --git a/src/libdts/bitstream.h b/src/libdts/bitstream.h
deleted file mode 100644
index 105dc0e9b..000000000
--- a/src/libdts/bitstream.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * bitstream.h
- * Copyright (C) 2004 Gildas Bazin <gbazin@videolan.org>
- * Copyright (C) 2000-2003 Michel Lespinasse <walken@zoy.org>
- * Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
- *
- * This file is part of dtsdec, a free DTS Coherent Acoustics stream decoder.
- * See http://www.videolan.org/dtsdec.html for updates.
- *
- * dtsdec is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * dtsdec is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifdef WORDS_BIGENDIAN
-
-# define swab32(x) (x)
-
-#else
-
-# define swab32(x)\
-((((uint8_t*)&x)[0] << 24) | (((uint8_t*)&x)[1] << 16) | \
- (((uint8_t*)&x)[2] << 8) | (((uint8_t*)&x)[3]))
-
-#endif
-
-#ifdef WORDS_BIGENDIAN
-
-# define swable32(x)\
-((((uint8_t*)&x)[0] << 16) | (((uint8_t*)&x)[1] << 24) | \
- (((uint8_t*)&x)[2]) | (((uint8_t*)&x)[3] << 8))
-
-#else
-
-# define swable32(x)\
-((((uint16_t*)&x)[0] << 16) | (((uint16_t*)&x)[1]))
-
-#endif
-
-void dts_bitstream_init (dts_state_t * state, uint8_t * buf, int word_mode,
- int endian_mode);
-uint32_t dts_bitstream_get_bh (dts_state_t * state, uint32_t num_bits);
-
-static inline uint32_t bitstream_get (dts_state_t * state, uint32_t num_bits)
-{
- uint32_t result;
-
- if (num_bits < state->bits_left) {
- result = (state->current_word << (32 - state->bits_left))
- >> (32 - num_bits);
-
- state->bits_left -= num_bits;
- return result;
- }
-
- return dts_bitstream_get_bh (state, num_bits);
-}
diff --git a/src/libdts/downmix.c b/src/libdts/downmix.c
deleted file mode 100644
index fe7136a72..000000000
--- a/src/libdts/downmix.c
+++ /dev/null
@@ -1,691 +0,0 @@
-/*
- * downmix.c
- * Copyright (C) 2004 Gildas Bazin <gbazin@videolan.org>
- * Copyright (C) 2000-2003 Michel Lespinasse <walken@zoy.org>
- * Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
- *
- * This file is part of dtsdec, a free DTS Coherent Acoustics stream decoder.
- * See http://www.videolan.org/dtsdec.html for updates.
- *
- * dtsdec is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * dtsdec is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "config.h"
-
-#include <string.h>
-#include <inttypes.h>
-
-#include "internal-dts.h"
-#include "dts_internal.h"
-
-#define CONVERT(acmod,output) (((output) << DTS_CHANNEL_BITS) + (acmod))
-
-int dts_downmix_init (int input, int flags, level_t * level,
- level_t clev, level_t slev)
-{
- static uint8_t table[11][10] = {
- /* DTS_MONO */
- {DTS_MONO, DTS_MONO, DTS_MONO, DTS_MONO,
- DTS_MONO, DTS_MONO, DTS_MONO, DTS_MONO,
- DTS_MONO, DTS_MONO},
- /* DTS_CHANNEL */
- {DTS_MONO, DTS_CHANNEL, DTS_STEREO, DTS_STEREO,
- DTS_STEREO, DTS_STEREO, DTS_STEREO, DTS_STEREO,
- DTS_STEREO, DTS_STEREO},
- /* DTS_STEREO */
- {DTS_MONO, DTS_CHANNEL, DTS_STEREO, DTS_STEREO,
- DTS_STEREO, DTS_STEREO, DTS_STEREO, DTS_STEREO,
- DTS_STEREO, DTS_STEREO},
- /* DTS_STEREO_SUMDIFF */
- {DTS_MONO, DTS_CHANNEL, DTS_STEREO, DTS_STEREO,
- DTS_STEREO, DTS_STEREO, DTS_STEREO, DTS_STEREO,
- DTS_STEREO, DTS_STEREO},
- /* DTS_STEREO_TOTAL */
- {DTS_MONO, DTS_CHANNEL, DTS_STEREO, DTS_STEREO,
- DTS_STEREO, DTS_STEREO, DTS_STEREO, DTS_STEREO,
- DTS_STEREO, DTS_STEREO},
- /* DTS_3F */
- {DTS_MONO, DTS_CHANNEL, DTS_STEREO, DTS_STEREO,
- DTS_STEREO, DTS_3F, DTS_3F, DTS_3F,
- DTS_3F, DTS_3F},
- /* DTS_2F1R */
- {DTS_MONO, DTS_CHANNEL, DTS_STEREO, DTS_STEREO,
- DTS_STEREO, DTS_2F1R, DTS_2F1R, DTS_2F1R,
- DTS_2F1R, DTS_2F1R},
- /* DTS_3F1R */
- {DTS_MONO, DTS_CHANNEL, DTS_STEREO, DTS_STEREO,
- DTS_STEREO, DTS_3F, DTS_3F1R, DTS_3F1R,
- DTS_3F1R, DTS_3F1R},
- /* DTS_2F2R */
- {DTS_MONO, DTS_CHANNEL, DTS_STEREO, DTS_STEREO,
- DTS_STEREO, DTS_STEREO, DTS_2F2R, DTS_2F2R,
- DTS_2F2R, DTS_2F2R},
- /* DTS_3F2R */
- {DTS_MONO, DTS_CHANNEL, DTS_STEREO, DTS_STEREO,
- DTS_STEREO, DTS_3F, DTS_3F2R, DTS_3F2R,
- DTS_3F2R, DTS_3F2R},
- /* DTS_4F2R */
- {DTS_MONO, DTS_CHANNEL, DTS_STEREO, DTS_STEREO,
- DTS_STEREO, DTS_4F2R, DTS_4F2R, DTS_4F2R,
- DTS_4F2R, DTS_4F2R},
- };
- int output;
-
- output = flags & DTS_CHANNEL_MASK;
-
- if (output > DTS_CHANNEL_MAX)
- return -1;
-
- output = table[output][input];
-
- if (output == DTS_STEREO &&
- (input == DTS_DOLBY || (input == DTS_3F && clev == LEVEL (LEVEL_3DB))))
- output = DTS_DOLBY;
-
- if (flags & DTS_ADJUST_LEVEL) {
- level_t adjust;
-
- switch (CONVERT (input & 7, output)) {
-
- case CONVERT (DTS_3F, DTS_MONO):
- adjust = DIV (LEVEL_3DB, LEVEL (1) + clev);
- break;
-
- case CONVERT (DTS_STEREO, DTS_MONO):
- case CONVERT (DTS_2F2R, DTS_2F1R):
- case CONVERT (DTS_3F2R, DTS_3F1R):
- level_3db:
- adjust = LEVEL (LEVEL_3DB);
- break;
-
- case CONVERT (DTS_3F2R, DTS_2F1R):
- if (clev < LEVEL (LEVEL_PLUS3DB - 1))
- goto level_3db;
- /* break thru */
- case CONVERT (DTS_3F, DTS_STEREO):
- case CONVERT (DTS_3F1R, DTS_2F1R):
- case CONVERT (DTS_3F1R, DTS_2F2R):
- case CONVERT (DTS_3F2R, DTS_2F2R):
- adjust = DIV (1, LEVEL (1) + clev);
- break;
-
- case CONVERT (DTS_2F1R, DTS_MONO):
- adjust = DIV (LEVEL_PLUS3DB, LEVEL (2) + slev);
- break;
-
- case CONVERT (DTS_2F1R, DTS_STEREO):
- case CONVERT (DTS_3F1R, DTS_3F):
- adjust = DIV (1, LEVEL (1) + MUL_C (slev, LEVEL_3DB));
- break;
-
- case CONVERT (DTS_3F1R, DTS_MONO):
- adjust = DIV (LEVEL_3DB, LEVEL (1) + clev + MUL_C (slev, 0.5));
- break;
-
- case CONVERT (DTS_3F1R, DTS_STEREO):
- adjust = DIV (1, LEVEL (1) + clev + MUL_C (slev, LEVEL_3DB));
- break;
-
- case CONVERT (DTS_2F2R, DTS_MONO):
- adjust = DIV (LEVEL_3DB, LEVEL (1) + slev);
- break;
-
- case CONVERT (DTS_2F2R, DTS_STEREO):
- case CONVERT (DTS_3F2R, DTS_3F):
- adjust = DIV (1, LEVEL (1) + slev);
- break;
-
- case CONVERT (DTS_3F2R, DTS_MONO):
- adjust = DIV (LEVEL_3DB, LEVEL (1) + clev + slev);
- break;
-
- case CONVERT (DTS_3F2R, DTS_STEREO):
- adjust = DIV (1, LEVEL (1) + clev + slev);
- break;
-
- case CONVERT (DTS_MONO, DTS_DOLBY):
- adjust = LEVEL (LEVEL_PLUS3DB);
- break;
-
- case CONVERT (DTS_3F, DTS_DOLBY):
- case CONVERT (DTS_2F1R, DTS_DOLBY):
- adjust = LEVEL (1 / (1 + LEVEL_3DB));
- break;
-
- case CONVERT (DTS_3F1R, DTS_DOLBY):
- case CONVERT (DTS_2F2R, DTS_DOLBY):
- adjust = LEVEL (1 / (1 + 2 * LEVEL_3DB));
- break;
-
- case CONVERT (DTS_3F2R, DTS_DOLBY):
- adjust = LEVEL (1 / (1 + 3 * LEVEL_3DB));
- break;
-
- default:
- return output;
- }
-
- *level = MUL_L (*level, adjust);
- }
-
- return output;
-}
-
-int dts_downmix_coeff (level_t * coeff, int acmod, int output, level_t level,
- level_t clev, level_t slev)
-{
- level_t level_3db;
-
- level_3db = MUL_C (level, LEVEL_3DB);
-
- switch (CONVERT (acmod, output & DTS_CHANNEL_MASK)) {
-
- case CONVERT (DTS_CHANNEL, DTS_CHANNEL):
- case CONVERT (DTS_MONO, DTS_MONO):
- case CONVERT (DTS_STEREO, DTS_STEREO):
- case CONVERT (DTS_3F, DTS_3F):
- case CONVERT (DTS_2F1R, DTS_2F1R):
- case CONVERT (DTS_3F1R, DTS_3F1R):
- case CONVERT (DTS_2F2R, DTS_2F2R):
- case CONVERT (DTS_3F2R, DTS_3F2R):
- case CONVERT (DTS_STEREO, DTS_DOLBY):
- coeff[0] = coeff[1] = coeff[2] = coeff[3] = coeff[4] = level;
- return 0;
-
- case CONVERT (DTS_CHANNEL, DTS_MONO):
- coeff[0] = coeff[1] = MUL_C (level, LEVEL_6DB);
- return 3;
-
- case CONVERT (DTS_STEREO, DTS_MONO):
- coeff[0] = coeff[1] = level_3db;
- return 3;
-
- case CONVERT (DTS_3F, DTS_MONO):
- coeff[0] = coeff[2] = level_3db;
- coeff[1] = MUL_C (MUL_L (level_3db, clev), LEVEL_PLUS6DB);
- return 7;
-
- case CONVERT (DTS_2F1R, DTS_MONO):
- coeff[0] = coeff[1] = level_3db;
- coeff[2] = MUL_L (level_3db, slev);
- return 7;
-
- case CONVERT (DTS_2F2R, DTS_MONO):
- coeff[0] = coeff[1] = level_3db;
- coeff[2] = coeff[3] = MUL_L (level_3db, slev);
- return 15;
-
- case CONVERT (DTS_3F1R, DTS_MONO):
- coeff[0] = coeff[2] = level_3db;
- coeff[1] = MUL_C (MUL_L (level_3db, clev), LEVEL_PLUS6DB);
- coeff[3] = MUL_L (level_3db, slev);
- return 15;
-
- case CONVERT (DTS_3F2R, DTS_MONO):
- coeff[0] = coeff[2] = level_3db;
- coeff[1] = MUL_C (MUL_L (level_3db, clev), LEVEL_PLUS6DB);
- coeff[3] = coeff[4] = MUL_L (level_3db, slev);
- return 31;
-
- case CONVERT (DTS_MONO, DTS_DOLBY):
- coeff[0] = level_3db;
- return 0;
-
- case CONVERT (DTS_3F, DTS_DOLBY):
- coeff[0] = coeff[2] = coeff[3] = coeff[4] = level;
- coeff[1] = level_3db;
- return 7;
-
- case CONVERT (DTS_3F, DTS_STEREO):
- case CONVERT (DTS_3F1R, DTS_2F1R):
- case CONVERT (DTS_3F2R, DTS_2F2R):
- coeff[0] = coeff[2] = coeff[3] = coeff[4] = level;
- coeff[1] = MUL_L (level, clev);
- return 7;
-
- case CONVERT (DTS_2F1R, DTS_DOLBY):
- coeff[0] = coeff[1] = level;
- coeff[2] = level_3db;
- return 7;
-
- case CONVERT (DTS_2F1R, DTS_STEREO):
- coeff[0] = coeff[1] = level;
- coeff[2] = MUL_L (level_3db, slev);
- return 7;
-
- case CONVERT (DTS_3F1R, DTS_DOLBY):
- coeff[0] = coeff[2] = level;
- coeff[1] = coeff[3] = level_3db;
- return 15;
-
- case CONVERT (DTS_3F1R, DTS_STEREO):
- coeff[0] = coeff[2] = level;
- coeff[1] = MUL_L (level, clev);
- coeff[3] = MUL_L (level_3db, slev);
- return 15;
-
- case CONVERT (DTS_2F2R, DTS_DOLBY):
- coeff[0] = coeff[1] = level;
- coeff[2] = coeff[3] = level_3db;
- return 15;
-
- case CONVERT (DTS_2F2R, DTS_STEREO):
- coeff[0] = coeff[1] = level;
- coeff[2] = coeff[3] = MUL_L (level, slev);
- return 15;
-
- case CONVERT (DTS_3F2R, DTS_DOLBY):
- coeff[0] = coeff[2] = level;
- coeff[1] = coeff[3] = coeff[4] = level_3db;
- return 31;
-
- case CONVERT (DTS_3F2R, DTS_2F1R):
- coeff[0] = coeff[2] = level;
- coeff[1] = MUL_L (level, clev);
- coeff[3] = coeff[4] = level_3db;
- return 31;
-
- case CONVERT (DTS_3F2R, DTS_STEREO):
- coeff[0] = coeff[2] = level;
- coeff[1] = MUL_L (level, clev);
- coeff[3] = coeff[4] = MUL_L (level, slev);
- return 31;
-
- case CONVERT (DTS_3F1R, DTS_3F):
- coeff[0] = coeff[1] = coeff[2] = level;
- coeff[3] = MUL_L (level_3db, slev);
- return 13;
-
- case CONVERT (DTS_3F2R, DTS_3F):
- coeff[0] = coeff[1] = coeff[2] = level;
- coeff[3] = coeff[4] = MUL_L (level, slev);
- return 29;
-
- case CONVERT (DTS_2F2R, DTS_2F1R):
- coeff[0] = coeff[1] = level;
- coeff[2] = coeff[3] = level_3db;
- return 12;
-
- case CONVERT (DTS_3F2R, DTS_3F1R):
- coeff[0] = coeff[1] = coeff[2] = level;
- coeff[3] = coeff[4] = level_3db;
- return 24;
-
- case CONVERT (DTS_2F1R, DTS_2F2R):
- coeff[0] = coeff[1] = level;
- coeff[2] = level_3db;
- return 0;
-
- case CONVERT (DTS_3F1R, DTS_2F2R):
- coeff[0] = coeff[2] = level;
- coeff[1] = MUL_L (level, clev);
- coeff[3] = level_3db;
- return 7;
-
- case CONVERT (DTS_3F1R, DTS_3F2R):
- coeff[0] = coeff[1] = coeff[2] = level;
- coeff[3] = level_3db;
- return 0;
- }
-
- return -1; /* NOTREACHED */
-}
-
-static void mix2to1 (sample_t * dest, sample_t * src, sample_t bias)
-{
- int i;
-
- for (i = 0; i < 256; i++)
- dest[i] += BIAS (src[i]);
-}
-
-static void mix3to1 (sample_t * samples, sample_t bias)
-{
- int i;
-
- for (i = 0; i < 256; i++)
- samples[i] += BIAS (samples[i + 256] + samples[i + 512]);
-}
-
-static void mix4to1 (sample_t * samples, sample_t bias)
-{
- int i;
-
- for (i = 0; i < 256; i++)
- samples[i] += BIAS (samples[i + 256] + samples[i + 512] +
- samples[i + 768]);
-}
-
-static void mix5to1 (sample_t * samples, sample_t bias)
-{
- int i;
-
- for (i = 0; i < 256; i++)
- samples[i] += BIAS (samples[i + 256] + samples[i + 512] +
- samples[i + 768] + samples[i + 1024]);
-}
-
-static void mix3to2 (sample_t * samples, sample_t bias)
-{
- int i;
- sample_t common;
-
- for (i = 0; i < 256; i++) {
- common = BIAS (samples[i]);
- samples[i] = samples[i + 256] + common;
- samples[i + 256] = samples[i + 512] + common;
- }
-}
-
-static void mix21to2 (sample_t * left, sample_t * right, sample_t bias)
-{
- int i;
- sample_t common;
-
- for (i = 0; i < 256; i++) {
- common = BIAS (right[i + 256]);
- left[i] += common;
- right[i] += common;
- }
-}
-
-static void mix21toS (sample_t * samples, sample_t bias)
-{
- int i;
- sample_t surround;
-
- for (i = 0; i < 256; i++) {
- surround = samples[i + 512];
- samples[i] += BIAS (-surround);
- samples[i + 256] += BIAS (surround);
- }
-}
-
-static void mix31to2 (sample_t * samples, sample_t bias)
-{
- int i;
- sample_t common;
-
- for (i = 0; i < 256; i++) {
- common = BIAS (samples[i] + samples[i + 768]);
- samples[i] = samples[i + 256] + common;
- samples[i + 256] = samples[i + 512] + common;
- }
-}
-
-static void mix31toS (sample_t * samples, sample_t bias)
-{
- int i;
- sample_t common, surround;
-
- for (i = 0; i < 256; i++) {
- common = BIAS (samples[i]);
- surround = samples[i + 768];
- samples[i] = samples[i + 256] + common - surround;
- samples[i + 256] = samples[i + 512] + common + surround;
- }
-}
-
-static void mix22toS (sample_t * samples, sample_t bias)
-{
- int i;
- sample_t surround;
-
- for (i = 0; i < 256; i++) {
- surround = samples[i + 512] + samples[i + 768];
- samples[i] += BIAS (-surround);
- samples[i + 256] += BIAS (surround);
- }
-}
-
-static void mix32to2 (sample_t * samples, sample_t bias)
-{
- int i;
- sample_t common;
-
- for (i = 0; i < 256; i++) {
- common = BIAS (samples[i]);
- samples[i] = common + samples[i + 256] + samples[i + 768];
- samples[i + 256] = common + samples[i + 512] + samples[i + 1024];
- }
-}
-
-static void mix32toS (sample_t * samples, sample_t bias)
-{
- int i;
- sample_t common, surround;
-
- for (i = 0; i < 256; i++) {
- common = BIAS (samples[i]);
- surround = samples[i + 768] + samples[i + 1024];
- samples[i] = samples[i + 256] + common - surround;
- samples[i + 256] = samples[i + 512] + common + surround;
- }
-}
-
-static void move2to1 (sample_t * src, sample_t * dest, sample_t bias)
-{
- int i;
-
- for (i = 0; i < 256; i++)
- dest[i] = BIAS (src[i] + src[i + 256]);
-}
-
-static void zero (sample_t * samples)
-{
- int i;
-
- for (i = 0; i < 256; i++)
- samples[i] = 0;
-}
-
-void dts_downmix (sample_t * samples, int acmod, int output, sample_t bias,
- level_t clev, level_t slev)
-{
- switch (CONVERT (acmod, output & DTS_CHANNEL_MASK)) {
-
- case CONVERT (DTS_CHANNEL, DTS_MONO):
- case CONVERT (DTS_STEREO, DTS_MONO):
- mix_2to1:
- mix2to1 (samples, samples + 256, bias);
- break;
-
- case CONVERT (DTS_2F1R, DTS_MONO):
- if (slev == 0)
- goto mix_2to1;
- case CONVERT (DTS_3F, DTS_MONO):
- mix_3to1:
- mix3to1 (samples, bias);
- break;
-
- case CONVERT (DTS_3F1R, DTS_MONO):
- if (slev == 0)
- goto mix_3to1;
- case CONVERT (DTS_2F2R, DTS_MONO):
- if (slev == 0)
- goto mix_2to1;
- mix4to1 (samples, bias);
- break;
-
- case CONVERT (DTS_3F2R, DTS_MONO):
- if (slev == 0)
- goto mix_3to1;
- mix5to1 (samples, bias);
- break;
-
- case CONVERT (DTS_MONO, DTS_DOLBY):
- memcpy (samples + 256, samples, 256 * sizeof (sample_t));
- break;
-
- case CONVERT (DTS_3F, DTS_STEREO):
- case CONVERT (DTS_3F, DTS_DOLBY):
- mix_3to2:
- mix3to2 (samples, bias);
- break;
-
- case CONVERT (DTS_2F1R, DTS_STEREO):
- if (slev == 0)
- break;
- mix21to2 (samples, samples + 256, bias);
- break;
-
- case CONVERT (DTS_2F1R, DTS_DOLBY):
- mix21toS (samples, bias);
- break;
-
- case CONVERT (DTS_3F1R, DTS_STEREO):
- if (slev == 0)
- goto mix_3to2;
- mix31to2 (samples, bias);
- break;
-
- case CONVERT (DTS_3F1R, DTS_DOLBY):
- mix31toS (samples, bias);
- break;
-
- case CONVERT (DTS_2F2R, DTS_STEREO):
- if (slev == 0)
- break;
- mix2to1 (samples, samples + 512, bias);
- mix2to1 (samples + 256, samples + 768, bias);
- break;
-
- case CONVERT (DTS_2F2R, DTS_DOLBY):
- mix22toS (samples, bias);
- break;
-
- case CONVERT (DTS_3F2R, DTS_STEREO):
- if (slev == 0)
- goto mix_3to2;
- mix32to2 (samples, bias);
- break;
-
- case CONVERT (DTS_3F2R, DTS_DOLBY):
- mix32toS (samples, bias);
- break;
-
- case CONVERT (DTS_3F1R, DTS_3F):
- if (slev == 0)
- break;
- mix21to2 (samples, samples + 512, bias);
- break;
-
- case CONVERT (DTS_3F2R, DTS_3F):
- if (slev == 0)
- break;
- mix2to1 (samples, samples + 768, bias);
- mix2to1 (samples + 512, samples + 1024, bias);
- break;
-
- case CONVERT (DTS_3F1R, DTS_2F1R):
- mix3to2 (samples, bias);
- memcpy (samples + 512, samples + 768, 256 * sizeof (sample_t));
- break;
-
- case CONVERT (DTS_2F2R, DTS_2F1R):
- mix2to1 (samples + 512, samples + 768, bias);
- break;
-
- case CONVERT (DTS_3F2R, DTS_2F1R):
- mix3to2 (samples, bias);
- move2to1 (samples + 768, samples + 512, bias);
- break;
-
- case CONVERT (DTS_3F2R, DTS_3F1R):
- mix2to1 (samples + 768, samples + 1024, bias);
- break;
-
- case CONVERT (DTS_2F1R, DTS_2F2R):
- memcpy (samples + 768, samples + 512, 256 * sizeof (sample_t));
- break;
-
- case CONVERT (DTS_3F1R, DTS_2F2R):
- mix3to2 (samples, bias);
- memcpy (samples + 512, samples + 768, 256 * sizeof (sample_t));
- break;
-
- case CONVERT (DTS_3F2R, DTS_2F2R):
- mix3to2 (samples, bias);
- memcpy (samples + 512, samples + 768, 256 * sizeof (sample_t));
- memcpy (samples + 768, samples + 1024, 256 * sizeof (sample_t));
- break;
-
- case CONVERT (DTS_3F1R, DTS_3F2R):
- memcpy (samples + 1024, samples + 768, 256 * sizeof (sample_t));
- break;
- }
-}
-
-void dts_upmix (sample_t * samples, int acmod, int output)
-{
- switch (CONVERT (acmod, output & DTS_CHANNEL_MASK)) {
-
- case CONVERT (DTS_3F2R, DTS_MONO):
- zero (samples + 1024);
- case CONVERT (DTS_3F1R, DTS_MONO):
- case CONVERT (DTS_2F2R, DTS_MONO):
- zero (samples + 768);
- case CONVERT (DTS_3F, DTS_MONO):
- case CONVERT (DTS_2F1R, DTS_MONO):
- zero (samples + 512);
- case CONVERT (DTS_CHANNEL, DTS_MONO):
- case CONVERT (DTS_STEREO, DTS_MONO):
- zero (samples + 256);
- break;
-
- case CONVERT (DTS_3F2R, DTS_STEREO):
- case CONVERT (DTS_3F2R, DTS_DOLBY):
- zero (samples + 1024);
- case CONVERT (DTS_3F1R, DTS_STEREO):
- case CONVERT (DTS_3F1R, DTS_DOLBY):
- zero (samples + 768);
- case CONVERT (DTS_3F, DTS_STEREO):
- case CONVERT (DTS_3F, DTS_DOLBY):
- mix_3to2:
- memcpy (samples + 512, samples + 256, 256 * sizeof (sample_t));
- zero (samples + 256);
- break;
-
- case CONVERT (DTS_2F2R, DTS_STEREO):
- case CONVERT (DTS_2F2R, DTS_DOLBY):
- zero (samples + 768);
- case CONVERT (DTS_2F1R, DTS_STEREO):
- case CONVERT (DTS_2F1R, DTS_DOLBY):
- zero (samples + 512);
- break;
-
- case CONVERT (DTS_3F2R, DTS_3F):
- zero (samples + 1024);
- case CONVERT (DTS_3F1R, DTS_3F):
- case CONVERT (DTS_2F2R, DTS_2F1R):
- zero (samples + 768);
- break;
-
- case CONVERT (DTS_3F2R, DTS_3F1R):
- zero (samples + 1024);
- break;
-
- case CONVERT (DTS_3F2R, DTS_2F1R):
- zero (samples + 1024);
- case CONVERT (DTS_3F1R, DTS_2F1R):
- mix_31to21:
- memcpy (samples + 768, samples + 512, 256 * sizeof (sample_t));
- goto mix_3to2;
-
- case CONVERT (DTS_3F2R, DTS_2F2R):
- memcpy (samples + 1024, samples + 768, 256 * sizeof (sample_t));
- goto mix_31to21;
- }
-}
diff --git a/src/libdts/dts_internal.h b/src/libdts/dts_internal.h
deleted file mode 100644
index e834e96a8..000000000
--- a/src/libdts/dts_internal.h
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * dts_internal.h
- * Copyright (C) 2004 Gildas Bazin <gbazin@videolan.org>
- * Copyright (C) 2000-2003 Michel Lespinasse <walken@zoy.org>
- * Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
- *
- * This file is part of dtsdec, a free DTS Coherent Acoustics stream decoder.
- * See http://www.videolan.org/dtsdec.html for updates.
- *
- * dtsdec is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * dtsdec is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#define DTS_SUBFRAMES_MAX (16)
-#define DTS_PRIM_CHANNELS_MAX (5)
-#define DTS_SUBBANDS (32)
-#define DTS_ABITS_MAX (32) /* Should be 28 */
-#define DTS_SUBSUBFAMES_MAX (4)
-#define DTS_LFE_MAX (3)
-
-struct dts_state_s {
-
- /* Frame header */
- int frame_type; /* type of the current frame */
- int samples_deficit; /* deficit sample count */
- int crc_present; /* crc is present in the bitstream */
- int sample_blocks; /* number of PCM sample blocks */
- int frame_size; /* primary frame byte size */
- int amode; /* audio channels arrangement */
- int sample_rate; /* audio sampling rate */
- int bit_rate; /* transmission bit rate */
-
- int downmix; /* embedded downmix enabled */
- int dynrange; /* embedded dynamic range flag */
- int timestamp; /* embedded time stamp flag */
- int aux_data; /* auxiliary data flag */
- int hdcd; /* source material is mastered in HDCD */
- int ext_descr; /* extension audio descriptor flag */
- int ext_coding; /* extended coding flag */
- int aspf; /* audio sync word insertion flag */
- int lfe; /* low frequency effects flag */
- int predictor_history; /* predictor history flag */
- int header_crc; /* header crc check bytes */
- int multirate_inter; /* multirate interpolator switch */
- int version; /* encoder software revision */
- int copy_history; /* copy history */
- int source_pcm_res; /* source pcm resolution */
- int front_sum; /* front sum/difference flag */
- int surround_sum; /* surround sum/difference flag */
- int dialog_norm; /* dialog normalisation parameter */
-
- /* Primary audio coding header */
- int subframes; /* number of subframes */
- int prim_channels; /* number of primary audio channels */
- /* subband activity count */
- int subband_activity[DTS_PRIM_CHANNELS_MAX];
- /* high frequency vq start subband */
- int vq_start_subband[DTS_PRIM_CHANNELS_MAX];
- /* joint intensity coding index */
- int joint_intensity[DTS_PRIM_CHANNELS_MAX];
- /* transient mode code book */
- int transient_huffman[DTS_PRIM_CHANNELS_MAX];
- /* scale factor code book */
- int scalefactor_huffman[DTS_PRIM_CHANNELS_MAX];
- /* bit allocation quantizer select */
- int bitalloc_huffman[DTS_PRIM_CHANNELS_MAX];
- /* quantization index codebook select */
- int quant_index_huffman[DTS_PRIM_CHANNELS_MAX][DTS_ABITS_MAX];
- /* scale factor adjustment */
- float scalefactor_adj[DTS_PRIM_CHANNELS_MAX][DTS_ABITS_MAX];
-
- /* Primary audio coding side information */
- int subsubframes; /* number of subsubframes */
- int partial_samples; /* partial subsubframe samples count */
- /* prediction mode (ADPCM used or not) */
- int prediction_mode[DTS_PRIM_CHANNELS_MAX][DTS_SUBBANDS];
- /* prediction VQ coefs */
- int prediction_vq[DTS_PRIM_CHANNELS_MAX][DTS_SUBBANDS];
- /* bit allocation index */
- int bitalloc[DTS_PRIM_CHANNELS_MAX][DTS_SUBBANDS];
- /* transition mode (transients) */
- int transition_mode[DTS_PRIM_CHANNELS_MAX][DTS_SUBBANDS];
- /* scale factors (2 if transient)*/
- int scale_factor[DTS_PRIM_CHANNELS_MAX][DTS_SUBBANDS][2];
- /* joint subband scale factors codebook */
- int joint_huff[DTS_PRIM_CHANNELS_MAX];
- /* joint subband scale factors */
- int joint_scale_factor[DTS_PRIM_CHANNELS_MAX][DTS_SUBBANDS];
- /* stereo downmix coefficients */
- int downmix_coef[DTS_PRIM_CHANNELS_MAX][2];
- /* dynamic range coefficient */
- int dynrange_coef;
-
- /* VQ encoded high frequency subbands */
- int high_freq_vq[DTS_PRIM_CHANNELS_MAX][DTS_SUBBANDS];
-
- /* Low frequency effect data */
- double lfe_data[2*DTS_SUBSUBFAMES_MAX*DTS_LFE_MAX * 2 /*history*/];
- int lfe_scale_factor;
-
- /* Subband samples history (for ADPCM) */
- double subband_samples_hist[DTS_PRIM_CHANNELS_MAX][DTS_SUBBANDS][4];
- double subband_fir_hist[DTS_PRIM_CHANNELS_MAX][512];
- double subband_fir_noidea[DTS_PRIM_CHANNELS_MAX][64];
-
- /* Audio output */
- level_t clev; /* centre channel mix level */
- level_t slev; /* surround channels mix level */
-
- int output; /* type of output */
- level_t level; /* output level */
- sample_t bias; /* output bias */
-
- sample_t * samples; /* pointer to the internal audio samples buffer */
- int downmixed;
-
- int dynrnge; /* apply dynamic range */
- level_t dynrng; /* dynamic range */
- void * dynrngdata; /* dynamic range callback funtion and data */
- level_t (* dynrngcall) (level_t range, void * dynrngdata);
-
- /* Bitstream handling */
- uint32_t * buffer_start;
- uint32_t bits_left;
- uint32_t current_word;
- int word_mode; /* 16/14 bits word format (1 -> 16, 0 -> 14) */
- int bigendian_mode; /* endianness (1 -> be, 0 -> le) */
-
- /* Current position in DTS frame */
- int current_subframe;
- int current_subsubframe;
-
- /* Pre-calculated cosine modulation coefs for the QMF */
- double cos_mod[544];
-
- /* Debug flag */
- int debug_flag;
-};
-
-#define LEVEL_PLUS6DB 2.0
-#define LEVEL_PLUS3DB 1.4142135623730951
-#define LEVEL_3DB 0.7071067811865476
-#define LEVEL_45DB 0.5946035575013605
-#define LEVEL_6DB 0.5
-
-int dts_downmix_init (int input, int flags, level_t * level,
- level_t clev, level_t slev);
-int dts_downmix_coeff (level_t * coeff, int acmod, int output, level_t level,
- level_t clev, level_t slev);
-void dts_downmix (sample_t * samples, int acmod, int output, sample_t bias,
- level_t clev, level_t slev);
-void dts_upmix (sample_t * samples, int acmod, int output);
-
-#define ROUND(x) ((int)((x) + ((x) > 0 ? 0.5 : -0.5)))
-
-#ifndef LIBDTS_FIXED
-
-typedef sample_t quantizer_t;
-#define SAMPLE(x) (x)
-#define LEVEL(x) (x)
-#define MUL(a,b) ((a) * (b))
-#define MUL_L(a,b) ((a) * (b))
-#define MUL_C(a,b) ((a) * (b))
-#define DIV(a,b) ((a) / (b))
-#define BIAS(x) ((x) + bias)
-
-#else /* LIBDTS_FIXED */
-
-typedef int16_t quantizer_t;
-#define SAMPLE(x) (sample_t)((x) * (1 << 30))
-#define LEVEL(x) (level_t)((x) * (1 << 26))
-
-#if 0
-#define MUL(a,b) ((int)(((int64_t)(a) * (b) + (1 << 29)) >> 30))
-#define MUL_L(a,b) ((int)(((int64_t)(a) * (b) + (1 << 25)) >> 26))
-#elif 1
-#define MUL(a,b) \
-({ int32_t _ta=(a), _tb=(b), _tc; \
- _tc=(_ta & 0xffff)*(_tb >> 16)+(_ta >> 16)*(_tb & 0xffff); (int32_t)(((_tc >> 14))+ (((_ta >> 16)*(_tb >> 16)) << 2 )); })
-#define MUL_L(a,b) \
-({ int32_t _ta=(a), _tb=(b), _tc; \
- _tc=(_ta & 0xffff)*(_tb >> 16)+(_ta >> 16)*(_tb & 0xffff); (int32_t)((_tc >> 10) + (((_ta >> 16)*(_tb >> 16)) << 6)); })
-#else
-#define MUL(a,b) (((a) >> 15) * ((b) >> 15))
-#define MUL_L(a,b) (((a) >> 13) * ((b) >> 13))
-#endif
-
-#define MUL_C(a,b) MUL_L (a, LEVEL (b))
-#define DIV(a,b) ((((int64_t)LEVEL (a)) << 26) / (b))
-#define BIAS(x) (x)
-
-#endif
diff --git a/src/libdts/internal-dts.h b/src/libdts/internal-dts.h
deleted file mode 100644
index 30f3a197b..000000000
--- a/src/libdts/internal-dts.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * dts.h
- * Copyright (C) 2004 Gildas Bazin <gbazin@videolan.org>
- *
- * This file is part of dtsdec, a free DTS Coherent Acoustics stream decoder.
- * See http://www.videolan.org/dtsdec.html for updates.
- *
- * dtsdec is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * dtsdec is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef DTS_H
-#define DTS_H
-
-/* x86 accelerations */
-#define MM_ACCEL_X86_MMX 0x80000000
-#define MM_ACCEL_X86_3DNOW 0x40000000
-#define MM_ACCEL_X86_MMXEXT 0x20000000
-
-uint32_t mm_accel (void);
-
-#if defined(LIBDTS_FIXED)
-typedef int32_t sample_t;
-typedef int32_t level_t;
-#elif defined(LIBDTS_DOUBLE)
-typedef double sample_t;
-typedef double level_t;
-#else
-typedef float sample_t;
-typedef float level_t;
-#endif
-
-typedef struct dts_state_s dts_state_t;
-
-#define DTS_MONO 0
-#define DTS_CHANNEL 1
-#define DTS_STEREO 2
-#define DTS_STEREO_SUMDIFF 3
-#define DTS_STEREO_TOTAL 4
-#define DTS_3F 5
-#define DTS_2F1R 6
-#define DTS_3F1R 7
-#define DTS_2F2R 8
-#define DTS_3F2R 9
-#define DTS_4F2R 10
-
-#define DTS_DOLBY 101 /* FIXME */
-
-#define DTS_CHANNEL_MAX DTS_3F2R /* We don't handle anything above that */
-#define DTS_CHANNEL_BITS 6
-#define DTS_CHANNEL_MASK 0x3F
-
-#define DTS_LFE 0x80
-#define DTS_ADJUST_LEVEL 0x100
-
-dts_state_t * dts_init (uint32_t mm_accel);
-
-int dts_syncinfo (dts_state_t *state, uint8_t * buf, int * flags,
- int * sample_rate, int * bit_rate, int *frame_length);
-
-int dts_frame (dts_state_t * state, uint8_t * buf, int * flags,
- level_t * level, sample_t bias);
-
-void dts_dynrng (dts_state_t * state,
- level_t (* call) (level_t, void *), void * data);
-
-int dts_blocks_num (dts_state_t * state);
-int dts_block (dts_state_t * state);
-
-sample_t * dts_samples (dts_state_t * state);
-
-void dts_free (dts_state_t * state);
-
-#endif /* DTS_H */
diff --git a/src/libdts/parse.c b/src/libdts/parse.c
deleted file mode 100644
index 67067addb..000000000
--- a/src/libdts/parse.c
+++ /dev/null
@@ -1,1290 +0,0 @@
-/*
- * parse.c
- * Copyright (C) 2004 Gildas Bazin <gbazin@videolan.org>
- *
- * This file is part of dtsdec, a free DTS Coherent Acoustics stream decoder.
- * See http://www.videolan.org/dtsdec.html for updates.
- *
- * dtsdec is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * dtsdec is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "config.h"
-
-#include <stdio.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <inttypes.h>
-
-#include <math.h>
-
-#ifndef M_PI
-#define M_PI 3.1415926535897932384626433832795029
-#endif
-
-#include "internal-dts.h"
-#include "dts_internal.h"
-#include "bitstream.h"
-
-#include "tables.h"
-#include "tables_huffman.h"
-#include "tables_quantization.h"
-#include "tables_adpcm.h"
-#include "tables_fir.h"
-#include "tables_vq.h"
-
-/* #define LOG_DEBUG */
-
-#if defined(HAVE_MEMALIGN) && !defined(__cplusplus)
-/* some systems have memalign() but no declaration for it */
-void * memalign (size_t align, size_t size);
-#else
-/* assume malloc alignment is sufficient */
-#define memalign(align,size) malloc (size)
-#endif
-
-static int decode_blockcode (int code, int levels, int *values);
-
-static void qmf_32_subbands (dts_state_t * state, int chans,
- double samples_in[32][8], sample_t *samples_out,
- double rScale, sample_t bias);
-
-static void lfe_interpolation_fir (int nDecimationSelect, int nNumDeciSample,
- double *samples_in, sample_t *samples_out,
- double rScale, sample_t bias );
-
-static void pre_calc_cosmod( dts_state_t * state );
-
-dts_state_t * dts_init (uint32_t mm_accel)
-{
- dts_state_t * state;
- int i;
-
- state = (dts_state_t *) malloc (sizeof (dts_state_t));
- if (state == NULL)
- return NULL;
-
- memset (state, 0, sizeof(dts_state_t));
-
- state->samples = (sample_t *) memalign (16, 256 * 12 * sizeof (sample_t));
- if (state->samples == NULL) {
- free (state);
- return NULL;
- }
-
- for (i = 0; i < 256 * 12; i++)
- state->samples[i] = 0;
-
- /* Pre-calculate cosine modulation coefficients */
- pre_calc_cosmod( state );
-
- state->downmixed = 1;
-
- return state;
-}
-
-sample_t * dts_samples (dts_state_t * state)
-{
- return state->samples;
-}
-
-int dts_blocks_num (dts_state_t * state)
-{
- /* 8 samples per subsubframe and per subband */
- return state->sample_blocks / 8;
-}
-
-static int syncinfo (dts_state_t * state, int * flags,
- int * sample_rate, int * bit_rate, int * frame_length)
-{
- int frame_size;
-
- /* Sync code */
- bitstream_get (state, 32);
- /* Frame type */
- bitstream_get (state, 1);
- /* Samples deficit */
- bitstream_get (state, 5);
- /* CRC present */
- bitstream_get (state, 1);
-
- *frame_length = (bitstream_get (state, 7) + 1) * 32;
- frame_size = bitstream_get (state, 14) + 1;
- if (!state->word_mode) frame_size = frame_size * 8 / 14 * 2;
-
- /* Audio channel arrangement */
- *flags = bitstream_get (state, 6);
- if (*flags > 63)
- return 0;
-
- *sample_rate = bitstream_get (state, 4);
- if (*sample_rate >= sizeof (dts_sample_rates) / sizeof (int))
- return 0;
- *sample_rate = dts_sample_rates[ *sample_rate ];
- if (!*sample_rate) return 0;
-
- *bit_rate = bitstream_get (state, 5);
- if (*bit_rate >= sizeof (dts_bit_rates) / sizeof (int))
- return 0;
- *bit_rate = dts_bit_rates[ *bit_rate ];
- if (!*bit_rate) return 0;
-
- /* LFE */
- bitstream_get (state, 10);
- if (bitstream_get (state, 2)) *flags |= DTS_LFE;
-
- return frame_size;
-}
-
-int dts_syncinfo (dts_state_t * state, uint8_t * buf, int * flags,
- int * sample_rate, int * bit_rate, int * frame_length)
-{
- /*
- * Look for sync code
- */
-
- /* 14 bits and little endian bitstream */
- if (buf[0] == 0xff && buf[1] == 0x1f &&
- buf[2] == 0x00 && buf[3] == 0xe8 &&
- (buf[4] & 0xf0) == 0xf0 && buf[5] == 0x07)
- {
- int frame_size;
- dts_bitstream_init (state, buf, 0, 0);
- frame_size = syncinfo (state, flags, sample_rate,
- bit_rate, frame_length);
- return frame_size;
- }
-
- /* 14 bits and big endian bitstream */
- if (buf[0] == 0x1f && buf[1] == 0xff &&
- buf[2] == 0xe8 && buf[3] == 0x00 &&
- buf[4] == 0x07 && (buf[5] & 0xf0) == 0xf0)
- {
- int frame_size;
- dts_bitstream_init (state, buf, 0, 1);
- frame_size = syncinfo (state, flags, sample_rate,
- bit_rate, frame_length);
- return frame_size;
- }
-
- /* 16 bits and little endian bitstream */
- if (buf[0] == 0xfe && buf[1] == 0x7f &&
- buf[2] == 0x01 && buf[3] == 0x80)
- {
- int frame_size;
- dts_bitstream_init (state, buf, 1, 0);
- frame_size = syncinfo (state, flags, sample_rate,
- bit_rate, frame_length);
- return frame_size;
- }
-
- /* 16 bits and big endian bitstream */
- if (buf[0] == 0x7f && buf[1] == 0xfe &&
- buf[2] == 0x80 && buf[3] == 0x01)
- {
- int frame_size;
- dts_bitstream_init (state, buf, 1, 1);
- frame_size = syncinfo (state, flags, sample_rate,
- bit_rate, frame_length);
- return frame_size;
- }
-
- return 0;
-}
-
-int dts_frame (dts_state_t * state, uint8_t * buf, int * flags,
- level_t * level, sample_t bias)
-{
- int i, j;
- static float adj_table[] = { 1.0, 1.1250, 1.2500, 1.4375 };
-
- dts_bitstream_init (state, buf, state->word_mode, state->bigendian_mode);
-
- /* Sync code */
- bitstream_get (state, 32);
-
- /* Frame header */
- state->frame_type = bitstream_get (state, 1);
- state->samples_deficit = bitstream_get (state, 5) + 1;
- state->crc_present = bitstream_get (state, 1);
- state->sample_blocks = bitstream_get (state, 7) + 1;
- state->frame_size = bitstream_get (state, 14) + 1;
- state->amode = bitstream_get (state, 6);
- state->sample_rate = bitstream_get (state, 4);
- state->bit_rate = bitstream_get (state, 5);
-
- state->downmix = bitstream_get (state, 1);
- state->dynrange = bitstream_get (state, 1);
- state->timestamp = bitstream_get (state, 1);
- state->aux_data = bitstream_get (state, 1);
- state->hdcd = bitstream_get (state, 1);
- state->ext_descr = bitstream_get (state, 3);
- state->ext_coding = bitstream_get (state, 1);
- state->aspf = bitstream_get (state, 1);
- state->lfe = bitstream_get (state, 2);
- state->predictor_history = bitstream_get (state, 1);
-
- /* TODO: check CRC */
- if (state->crc_present) state->header_crc = bitstream_get (state, 16);
-
- state->multirate_inter = bitstream_get (state, 1);
- state->version = bitstream_get (state, 4);
- state->copy_history = bitstream_get (state, 2);
- state->source_pcm_res = bitstream_get (state, 3);
- state->front_sum = bitstream_get (state, 1);
- state->surround_sum = bitstream_get (state, 1);
- state->dialog_norm = bitstream_get (state, 4);
-
- /* FIME: channels mixing levels */
- state->clev = state->slev = 1;
- state->output = dts_downmix_init (state->amode, *flags, level,
- state->clev, state->slev);
- if (state->output < 0)
- return 1;
-
- if (state->lfe && (*flags & DTS_LFE))
- state->output |= DTS_LFE;
-
- *flags = state->output;
-
- state->dynrng = state->level = MUL_C (*level, 2);
- state->bias = bias;
- state->dynrnge = 1;
- state->dynrngcall = NULL;
-
-#ifdef LOG_DEBUG
- fprintf (stderr, "frame type: %i\n", state->frame_type);
- fprintf (stderr, "samples deficit: %i\n", state->samples_deficit);
- fprintf (stderr, "crc present: %i\n", state->crc_present);
- fprintf (stderr, "sample blocks: %i (%i samples)\n",
- state->sample_blocks, state->sample_blocks * 32);
- fprintf (stderr, "frame size: %i bytes\n", state->frame_size);
- fprintf (stderr, "amode: %i (%i channels)\n",
- state->amode, dts_channels[state->amode]);
- fprintf (stderr, "sample rate: %i (%i Hz)\n",
- state->sample_rate, dts_sample_rates[state->sample_rate]);
- fprintf (stderr, "bit rate: %i (%i bits/s)\n",
- state->bit_rate, dts_bit_rates[state->bit_rate]);
- fprintf (stderr, "downmix: %i\n", state->downmix);
- fprintf (stderr, "dynrange: %i\n", state->dynrange);
- fprintf (stderr, "timestamp: %i\n", state->timestamp);
- fprintf (stderr, "aux_data: %i\n", state->aux_data);
- fprintf (stderr, "hdcd: %i\n", state->hdcd);
- fprintf (stderr, "ext descr: %i\n", state->ext_descr);
- fprintf (stderr, "ext coding: %i\n", state->ext_coding);
- fprintf (stderr, "aspf: %i\n", state->aspf);
- fprintf (stderr, "lfe: %i\n", state->lfe);
- fprintf (stderr, "predictor history: %i\n", state->predictor_history);
- fprintf (stderr, "header crc: %i\n", state->header_crc);
- fprintf (stderr, "multirate inter: %i\n", state->multirate_inter);
- fprintf (stderr, "version number: %i\n", state->version);
- fprintf (stderr, "copy history: %i\n", state->copy_history);
- fprintf (stderr, "source pcm resolution: %i (%i bits/sample)\n",
- state->source_pcm_res,
- dts_bits_per_sample[state->source_pcm_res]);
- fprintf (stderr, "front sum: %i\n", state->front_sum);
- fprintf (stderr, "surround sum: %i\n", state->surround_sum);
- fprintf (stderr, "dialog norm: %i\n", state->dialog_norm);
- fprintf (stderr, "\n");
-#endif
-
- /* Primary audio coding header */
- state->subframes = bitstream_get (state, 4) + 1;
- state->prim_channels = bitstream_get (state, 3) + 1;
-
-#ifdef LOG_DEBUG
- fprintf (stderr, "subframes: %i\n", state->subframes);
- fprintf (stderr, "prim channels: %i\n", state->prim_channels);
-#endif
-
- for (i = 0; i < state->prim_channels; i++)
- {
- state->subband_activity[i] = bitstream_get (state, 5) + 2;
-#ifdef LOG_DEBUG
- fprintf (stderr, "subband activity: %i\n", state->subband_activity[i]);
-#endif
- if (state->subband_activity[i] > DTS_SUBBANDS)
- state->subband_activity[i] = DTS_SUBBANDS;
- }
- for (i = 0; i < state->prim_channels; i++)
- {
- state->vq_start_subband[i] = bitstream_get (state, 5) + 1;
-#ifdef LOG_DEBUG
- fprintf (stderr, "vq start subband: %i\n", state->vq_start_subband[i]);
-#endif
- if (state->vq_start_subband[i] > DTS_SUBBANDS)
- state->vq_start_subband[i] = DTS_SUBBANDS;
- }
- for (i = 0; i < state->prim_channels; i++)
- {
- state->joint_intensity[i] = bitstream_get (state, 3);
-#ifdef LOG_DEBUG
- fprintf (stderr, "joint intensity: %i\n", state->joint_intensity[i]);
- if (state->joint_intensity[i]) {fprintf (stderr, "JOINTINTENSITY\n");}
-#endif
- }
- for (i = 0; i < state->prim_channels; i++)
- {
- state->transient_huffman[i] = bitstream_get (state, 2);
-#ifdef LOG_DEBUG
- fprintf (stderr, "transient mode codebook: %i\n",
- state->transient_huffman[i]);
-#endif
- }
- for (i = 0; i < state->prim_channels; i++)
- {
- state->scalefactor_huffman[i] = bitstream_get (state, 3);
-#ifdef LOG_DEBUG
- fprintf (stderr, "scale factor codebook: %i\n",
- state->scalefactor_huffman[i]);
-#endif
- }
- for (i = 0; i < state->prim_channels; i++)
- {
- state->bitalloc_huffman[i] = bitstream_get (state, 3);
- /* if (state->bitalloc_huffman[i] == 7) bailout */
-#ifdef LOG_DEBUG
- fprintf (stderr, "bit allocation quantizer: %i\n",
- state->bitalloc_huffman[i]);
-#endif
- }
-
- /* Get codebooks quantization indexes */
- for (i = 0; i < state->prim_channels; i++)
- {
- state->quant_index_huffman[i][0] = 0; /* Not transmitted */
- state->quant_index_huffman[i][1] = bitstream_get (state, 1);
- }
- for (j = 2; j < 6; j++)
- for (i = 0; i < state->prim_channels; i++)
- state->quant_index_huffman[i][j] = bitstream_get (state, 2);
- for (j = 6; j < 11; j++)
- for (i = 0; i < state->prim_channels; i++)
- state->quant_index_huffman[i][j] = bitstream_get (state, 3);
- for (j = 11; j < 27; j++)
- for (i = 0; i < state->prim_channels; i++)
- state->quant_index_huffman[i][j] = 0; /* Not transmitted */
-
-#ifdef LOG_DEBUG
- for (i = 0; i < state->prim_channels; i++)
- {
- fprintf( stderr, "quant index huff:" );
- for (j = 0; j < 11; j++)
- fprintf (stderr, " %i", state->quant_index_huffman[i][j]);
- fprintf (stderr, "\n");
- }
-#endif
-
- /* Get scale factor adjustment */
- for (j = 0; j < 11; j++)
- {
- for (i = 0; i < state->prim_channels; i++)
- state->scalefactor_adj[i][j] = 1;
- }
- for (i = 0; i < state->prim_channels; i++)
- {
- if (state->quant_index_huffman[i][1] == 0)
- {
- /* Transmitted only if quant_index_huffman=0 (Huffman code used) */
- state->scalefactor_adj[i][1] = adj_table[bitstream_get (state, 2)];
- }
- }
- for (j = 2; j < 6; j++)
- for (i = 0; i < state->prim_channels; i++)
- if (state->quant_index_huffman[i][j] < 3)
- {
- /* Transmitted only if quant_index_huffman < 3 */
- state->scalefactor_adj[i][j] =
- adj_table[bitstream_get (state, 2)];
- }
- for (j = 6; j < 11; j++)
- for (i = 0; i < state->prim_channels; i++)
- if (state->quant_index_huffman[i][j] < 7)
- {
- /* Transmitted only if quant_index_huffman < 7 */
- state->scalefactor_adj[i][j] =
- adj_table[bitstream_get (state, 2)];
- }
-
-#ifdef LOG_DEBUG
- for (i = 0; i < state->prim_channels; i++)
- {
- fprintf (stderr, "scalefac adj:");
- for (j = 0; j < 11; j++)
- fprintf (stderr, " %1.3f", state->scalefactor_adj[i][j]);
- fprintf (stderr, "\n");
- }
-#endif
-
- if (state->crc_present)
- {
- /* Audio header CRC check */
- bitstream_get (state, 16);
- }
-
- state->current_subframe = 0;
- state->current_subsubframe = 0;
-
- return 0;
-}
-
-static int dts_subframe_header (dts_state_t * state)
-{
- /* Primary audio coding side information */
- int j, k;
-
- /* Subsubframe count */
- state->subsubframes = bitstream_get (state, 2) + 1;
-#ifdef LOG_DEBUG
- fprintf (stderr, "subsubframes: %i\n", state->subsubframes);
-#endif
-
- /* Partial subsubframe sample count */
- state->partial_samples = bitstream_get (state, 3);
-#ifdef LOG_DEBUG
- fprintf (stderr, "partial samples: %i\n", state->partial_samples);
-#endif
-
- /* Get prediction mode for each subband */
- for (j = 0; j < state->prim_channels; j++)
- {
- for (k = 0; k < state->subband_activity[j]; k++)
- state->prediction_mode[j][k] = bitstream_get (state, 1);
-#ifdef LOG_DEBUG
- fprintf (stderr, "prediction mode:");
- for (k = 0; k < state->subband_activity[j]; k++)
- fprintf (stderr, " %i", state->prediction_mode[j][k]);
- fprintf (stderr, "\n");
-#endif
- }
-
- /* Get prediction codebook */
- for (j = 0; j < state->prim_channels; j++)
- {
- for (k = 0; k < state->subband_activity[j]; k++)
- {
- if (state->prediction_mode[j][k] > 0)
- {
- /* (Prediction coefficient VQ address) */
- state->prediction_vq[j][k] = bitstream_get (state, 12);
-#ifdef LOG_DEBUG
- fprintf (stderr, "prediction coefs: %f, %f, %f, %f\n",
- (double)adpcm_vb[state->prediction_vq[j][k]][0]/8192,
- (double)adpcm_vb[state->prediction_vq[j][k]][1]/8192,
- (double)adpcm_vb[state->prediction_vq[j][k]][2]/8192,
- (double)adpcm_vb[state->prediction_vq[j][k]][3]/8192);
-#endif
- }
- }
- }
-
- /* Bit allocation index */
- for (j = 0; j < state->prim_channels; j++)
- {
- for (k = 0; k < state->vq_start_subband[j]; k++)
- {
- if (state->bitalloc_huffman[j] == 6)
- state->bitalloc[j][k] = bitstream_get (state, 5);
- else if (state->bitalloc_huffman[j] == 5)
- state->bitalloc[j][k] = bitstream_get (state, 4);
- else
- {
- state->bitalloc[j][k] = InverseQ (state,
- bitalloc_12[state->bitalloc_huffman[j]]);
- }
-
- if (state->bitalloc[j][k] > 26)
- {
- fprintf (stderr, "bitalloc index [%i][%i] too big (%i)\n",
- j, k, state->bitalloc[j][k]);
- return -1;
- }
- }
-
-#ifdef LOG_DEBUG
- fprintf (stderr, "bitalloc index: ");
- for (k = 0; k < state->vq_start_subband[j]; k++)
- fprintf (stderr, "%2.2i ", state->bitalloc[j][k]);
- fprintf (stderr, "\n");
-#endif
- }
-
- /* Transition mode */
- for (j = 0; j < state->prim_channels; j++)
- {
- for (k = 0; k < state->subband_activity[j]; k++)
- {
- state->transition_mode[j][k] = 0;
- if (state->subsubframes > 1 &&
- k < state->vq_start_subband[j] &&
- state->bitalloc[j][k] > 0)
- {
- state->transition_mode[j][k] = InverseQ (state,
- tmode[state->transient_huffman[j]]);
- }
- }
-#ifdef LOG_DEBUG
- fprintf (stderr, "Transition mode:");
- for (k = 0; k < state->subband_activity[j]; k++)
- fprintf (stderr, " %i", state->transition_mode[j][k]);
- fprintf (stderr, "\n");
-#endif
- }
-
- /* Scale factors */
- for (j = 0; j < state->prim_channels; j++)
- {
- int *scale_table;
- int scale_sum;
-
- for (k = 0; k < state->subband_activity[j]; k++)
- {
- state->scale_factor[j][k][0] = 0;
- state->scale_factor[j][k][1] = 0;
- }
-
- if (state->scalefactor_huffman[j] == 6)
- scale_table = scale_factor_quant7;
- else
- scale_table = scale_factor_quant6;
-
- /* When huffman coded, only the difference is encoded */
- scale_sum = 0;
-
- for (k = 0; k < state->subband_activity[j]; k++)
- {
- if (k >= state->vq_start_subband[j] || state->bitalloc[j][k] > 0)
- {
- if (state->scalefactor_huffman[j] < 5)
- {
- /* huffman encoded */
- scale_sum += InverseQ (state,
- scales_129[state->scalefactor_huffman[j]]);
- }
- else if (state->scalefactor_huffman[j] == 5)
- {
- scale_sum = bitstream_get (state, 6);
- }
- else if (state->scalefactor_huffman[j] == 6)
- {
- scale_sum = bitstream_get (state, 7);
- }
-
- state->scale_factor[j][k][0] = scale_table[scale_sum];
- }
-
- if (k < state->vq_start_subband[j] && state->transition_mode[j][k])
- {
- /* Get second scale factor */
- if (state->scalefactor_huffman[j] < 5)
- {
- /* huffman encoded */
- scale_sum += InverseQ (state,
- scales_129[state->scalefactor_huffman[j]]);
- }
- else if (state->scalefactor_huffman[j] == 5)
- {
- scale_sum = bitstream_get (state, 6);
- }
- else if (state->scalefactor_huffman[j] == 6)
- {
- scale_sum = bitstream_get (state, 7);
- }
-
- state->scale_factor[j][k][1] = scale_table[scale_sum];
- }
- }
-
-#ifdef LOG_DEBUG
- fprintf (stderr, "Scale factor:");
- for (k = 0; k < state->subband_activity[j]; k++)
- {
- if (k >= state->vq_start_subband[j] || state->bitalloc[j][k] > 0)
- fprintf (stderr, " %i", state->scale_factor[j][k][0]);
- if (k < state->vq_start_subband[j] && state->transition_mode[j][k])
- fprintf (stderr, " %i(t)", state->scale_factor[j][k][1]);
- }
- fprintf (stderr, "\n");
-#endif
- }
-
- /* Joint subband scale factor codebook select */
- for (j = 0; j < state->prim_channels; j++)
- {
- /* Transmitted only if joint subband coding enabled */
- if (state->joint_intensity[j] > 0)
- state->joint_huff[j] = bitstream_get (state, 3);
- }
-
- /* Scale factors for joint subband coding */
- for (j = 0; j < state->prim_channels; j++)
- {
- int source_channel;
-
- /* Transmitted only if joint subband coding enabled */
- if (state->joint_intensity[j] > 0)
- {
- int scale = 0;
- source_channel = state->joint_intensity[j] - 1;
-
- /* When huffman coded, only the difference is encoded
- * (is this valid as well for joint scales ???) */
-
- for (k = state->subband_activity[j];
- k < state->subband_activity[source_channel]; k++)
- {
- if (state->joint_huff[j] < 5)
- {
- /* huffman encoded */
- scale = InverseQ (state,
- scales_129[state->joint_huff[j]]);
- }
- else if (state->joint_huff[j] == 5)
- {
- scale = bitstream_get (state, 6);
- }
- else if (state->joint_huff[j] == 6)
- {
- scale = bitstream_get (state, 7);
- }
-
- scale += 64; /* bias */
- state->joint_scale_factor[j][k] = scale;/*joint_scale_table[scale];*/
- }
-
- if (!state->debug_flag & 0x02)
- {
- fprintf (stderr, "Joint stereo coding not supported\n");
- state->debug_flag |= 0x02;
- }
-
-#ifdef LOG_DEBUG
- fprintf (stderr, "Joint scale factor index:\n");
- for (k = state->subband_activity[j];
- k < state->subband_activity[source_channel]; k++)
- fprintf (stderr, " %i", state->joint_scale_factor[j][k]);
- fprintf (stderr, "\n");
-#endif
- }
- }
-
- /* Stereo downmix coefficients */
- if (state->prim_channels > 2 && state->downmix)
- {
- for (j = 0; j < state->prim_channels; j++)
- {
- state->downmix_coef[j][0] = bitstream_get (state, 7);
- state->downmix_coef[j][1] = bitstream_get (state, 7);
- }
- }
-
- /* Dynamic range coefficient */
- if (state->dynrange) state->dynrange_coef = bitstream_get (state, 8);
-
- /* Side information CRC check word */
- if (state->crc_present)
- {
- bitstream_get (state, 16);
- }
-
- /*
- * Primary audio data arrays
- */
-
- /* VQ encoded high frequency subbands */
- for (j = 0; j < state->prim_channels; j++)
- {
- for (k = state->vq_start_subband[j];
- k < state->subband_activity[j]; k++)
- {
- /* 1 vector -> 32 samples */
- state->high_freq_vq[j][k] = bitstream_get (state, 10);
-
-#ifdef LOG_DEBUG
- fprintf( stderr, "VQ index: %i\n", state->high_freq_vq[j][k] );
-#endif
- }
- }
-
- /* Low frequency effect data */
- if (state->lfe)
- {
- /* LFE samples */
- int lfe_samples = 2 * state->lfe * state->subsubframes;
- double lfe_scale;
-
- for (j = lfe_samples; j < lfe_samples * 2; j++)
- {
- /* Signed 8 bits int */
- state->lfe_data[j] =
- (signed int)(signed char)bitstream_get (state, 8);
- }
-
- /* Scale factor index */
- state->lfe_scale_factor =
- scale_factor_quant7[bitstream_get (state, 8)];
-
- /* Quantization step size * scale factor */
- lfe_scale = 0.035 * state->lfe_scale_factor;
-
- for (j = lfe_samples; j < lfe_samples * 2; j++)
- state->lfe_data[j] *= lfe_scale;
-
-#ifdef LOG_DEBUG
- fprintf (stderr, "LFE samples:\n");
- for (j = lfe_samples; j < lfe_samples * 2; j++)
- fprintf (stderr, " %f", state->lfe_data[j]);
- fprintf (stderr, "\n");
-#endif
-
- }
-
- return 0;
-}
-
-static int dts_subsubframe (dts_state_t * state)
-{
- int k, l;
- int subsubframe = state->current_subsubframe;
-
- double *quant_step_table;
-
- /* FIXME */
- double subband_samples[DTS_PRIM_CHANNELS_MAX][DTS_SUBBANDS][8];
-
- /*
- * Audio data
- */
-
- /* Select quantization step size table */
- if (state->bit_rate == 0x1f)
- quant_step_table = lossless_quant_d;
- else
- quant_step_table = lossy_quant_d;
-
- for (k = 0; k < state->prim_channels; k++)
- {
- for (l = 0; l < state->vq_start_subband[k] ; l++)
- {
- int m;
-
- /* Select the mid-tread linear quantizer */
- int abits = state->bitalloc[k][l];
-
- double quant_step_size = quant_step_table[abits];
- double rscale;
-
- /*
- * Determine quantization index code book and its type
- */
-
- /* Select quantization index code book */
- int sel = state->quant_index_huffman[k][abits];
-
- /* Determine its type */
- int q_type = 1; /* (Assume Huffman type by default) */
- if (abits >= 11 || !bitalloc_select[abits][sel])
- {
- /* Not Huffman type */
- if (abits <= 7) q_type = 3; /* Block code */
- else q_type = 2; /* No further encoding */
- }
-
- if (abits == 0) q_type = 0; /* No bits allocated */
-
- /*
- * Extract bits from the bit stream
- */
- switch (q_type)
- {
- case 0: /* No bits allocated */
- for (m=0; m<8; m++)
- subband_samples[k][l][m] = 0;
- break;
-
- case 1: /* Huffman code */
- for (m=0; m<8; m++)
- subband_samples[k][l][m] =
- InverseQ (state, bitalloc_select[abits][sel]);
- break;
-
- case 2: /* No further encoding */
- for (m=0; m<8; m++)
- {
- /* Extract (signed) quantization index */
- int q_index = bitstream_get (state, abits - 3);
- if( q_index & (1 << (abits - 4)) )
- {
- q_index = (1 << (abits - 3)) - q_index;
- q_index = -q_index;
- }
- subband_samples[k][l][m] = q_index;
- }
- break;
-
- case 3: /* Block code */
- {
- int block_code1, block_code2, size, levels;
- int block[8];
-
- switch (abits)
- {
- case 1:
- size = 7;
- levels = 3;
- break;
- case 2:
- size = 10;
- levels = 5;
- break;
- case 3:
- size = 12;
- levels = 7;
- break;
- case 4:
- size = 13;
- levels = 9;
- break;
- case 5:
- size = 15;
- levels = 13;
- break;
- case 6:
- size = 17;
- levels = 17;
- break;
- case 7:
- default:
- size = 19;
- levels = 25;
- break;
- }
-
- block_code1 = bitstream_get (state, size);
- /* Should test return value */
- decode_blockcode (block_code1, levels, block);
- block_code2 = bitstream_get (state, size);
- decode_blockcode (block_code2, levels, &block[4]);
- for (m=0; m<8; m++)
- subband_samples[k][l][m] = block[m];
-
- }
- break;
-
- default: /* Undefined */
- fprintf (stderr, "Unknown quantization index codebook");
- return -1;
- }
-
- /*
- * Account for quantization step and scale factor
- */
-
- /* Deal with transients */
- if (state->transition_mode[k][l] &&
- subsubframe >= state->transition_mode[k][l])
- rscale = quant_step_size * state->scale_factor[k][l][1];
- else
- rscale = quant_step_size * state->scale_factor[k][l][0];
-
- /* Adjustment */
- rscale *= state->scalefactor_adj[k][sel];
- for (m=0; m<8; m++) subband_samples[k][l][m] *= rscale;
-
- /*
- * Inverse ADPCM if in prediction mode
- */
- if (state->prediction_mode[k][l])
- {
- int n;
- for (m=0; m<8; m++)
- {
- for (n=1; n<=4; n++)
- if (m-n >= 0)
- subband_samples[k][l][m] +=
- (adpcm_vb[state->prediction_vq[k][l]][n-1] *
- subband_samples[k][l][m-n]/8192);
- else if (state->predictor_history)
- subband_samples[k][l][m] +=
- (adpcm_vb[state->prediction_vq[k][l]][n-1] *
- state->subband_samples_hist[k][l][m-n+4]/8192);
- }
- }
- }
-
- /*
- * Decode VQ encoded high frequencies
- */
- for (l = state->vq_start_subband[k];
- l < state->subband_activity[k]; l++)
- {
- /* 1 vector -> 32 samples but we only need the 8 samples
- * for this subsubframe. */
- int m;
-
- if (!state->debug_flag & 0x01)
- {
- fprintf (stderr, "Stream with high frequencies VQ coding\n");
- state->debug_flag |= 0x01;
- }
-
- for (m=0; m<8; m++)
- {
- subband_samples[k][l][m] =
- high_freq_vq[state->high_freq_vq[k][l]][subsubframe*8+m]
- * (double)state->scale_factor[k][l][0] / 16.0;
- }
- }
- }
-
- /* Check for DSYNC after subsubframe */
- if (state->aspf || subsubframe == state->subsubframes - 1)
- {
- if (0xFFFF == bitstream_get (state, 16)) /* 0xFFFF */
- {
-#ifdef LOG_DEBUG
- fprintf( stderr, "Got subframe DSYNC\n" );
-#endif
- }
- else
- {
- fprintf( stderr, "Didn't get subframe DSYNC\n" );
- }
- }
-
- /* Backup predictor history for adpcm */
- for (k = 0; k < state->prim_channels; k++)
- {
- for (l = 0; l < state->vq_start_subband[k] ; l++)
- {
- int m;
- for (m = 0; m < 4; m++)
- state->subband_samples_hist[k][l][m] =
- subband_samples[k][l][4+m];
- }
- }
-
- /* 32 subbands QMF */
- for (k = 0; k < state->prim_channels; k++)
- {
- /*static double pcm_to_float[8] =
- {32768.0, 32768.0, 524288.0, 524288.0, 0, 8388608.0, 8388608.0};*/
-
- qmf_32_subbands (state, k,
- subband_samples[k],
- &state->samples[256*k],
- /*WTF ???*/ 32768.0*3/2/*pcm_to_float[state->source_pcm_res]*/,
- 0/*state->bias*/);
- }
-
- /* Down/Up mixing */
- if (state->prim_channels < dts_channels[state->output & DTS_CHANNEL_MASK])
- {
- dts_upmix (state->samples, state->amode, state->output);
- } else
- if (state->prim_channels > dts_channels[state->output & DTS_CHANNEL_MASK])
- {
- dts_downmix (state->samples, state->amode, state->output, state->bias,
- state->clev, state->slev);
- }
-
- /* Generate LFE samples for this subsubframe FIXME!!! */
- if (state->output & DTS_LFE)
- {
- int lfe_samples = 2 * state->lfe * state->subsubframes;
- int i_channels = dts_channels[state->output & DTS_CHANNEL_MASK];
-
- lfe_interpolation_fir (state->lfe, 2 * state->lfe,
- state->lfe_data + lfe_samples +
- 2 * state->lfe * subsubframe,
- &state->samples[256*i_channels],
- 8388608.0, state->bias);
- /* Outputs 20bits pcm samples */
- }
-
- return 0;
-}
-
-static int dts_subframe_footer (dts_state_t * state)
-{
- int aux_data_count = 0, i;
- int lfe_samples;
-
- /*
- * Unpack optional information
- */
-
- /* Time code stamp */
- if (state->timestamp) bitstream_get (state, 32);
-
- /* Auxiliary data byte count */
- if (state->aux_data) aux_data_count = bitstream_get (state, 6);
-
- /* Auxiliary data bytes */
- for(i = 0; i < aux_data_count; i++)
- bitstream_get (state, 8);
-
- /* Optional CRC check bytes */
- if (state->crc_present && (state->downmix || state->dynrange))
- bitstream_get (state, 16);
-
- /* Backup LFE samples history */
- lfe_samples = 2 * state->lfe * state->subsubframes;
- for (i = 0; i < lfe_samples; i++)
- {
- state->lfe_data[i] = state->lfe_data[i+lfe_samples];
- }
-
-#ifdef LOG_DEBUG
- fprintf( stderr, "\n" );
-#endif
-
- return 0;
-}
-
-int dts_block (dts_state_t * state)
-{
- /* Sanity check */
- if (state->current_subframe >= state->subframes)
- {
- fprintf (stderr, "check failed: %i>%i",
- state->current_subframe, state->subframes);
- return -1;
- }
-
- if (!state->current_subsubframe)
- {
-#ifdef LOG_DEBUG
- fprintf (stderr, "DSYNC dts_subframe_header\n");
-#endif
- /* Read subframe header */
- if (dts_subframe_header (state)) return -1;
- }
-
- /* Read subsubframe */
-#ifdef LOG_DEBUG
- fprintf (stderr, "DSYNC dts_subsubframe\n");
-#endif
- if (dts_subsubframe (state)) return -1;
-
- /* Update state */
- state->current_subsubframe++;
- if (state->current_subsubframe >= state->subsubframes)
- {
- state->current_subsubframe = 0;
- state->current_subframe++;
- }
- if (state->current_subframe >= state->subframes)
- {
-#ifdef LOG_DEBUG
- fprintf(stderr, "DSYNC dts_subframe_footer\n");
-#endif
- /* Read subframe footer */
- if (dts_subframe_footer (state)) return -1;
- }
-
- return 0;
-}
-
-/* Very compact version of the block code decoder that does not use table
- * look-up but is slightly slower */
-int decode_blockcode( int code, int levels, int *values )
-{
- int i;
- int offset = (levels - 1) >> 1;
-
- for (i = 0; i < 4; i++)
- {
- values[i] = (code % levels) - offset;
- code /= levels;
- }
-
- if (code == 0)
- return 1;
- else
- {
- fprintf (stderr, "ERROR: block code look-up failed\n");
- return 0;
- }
-}
-
-static void pre_calc_cosmod( dts_state_t * state )
-{
- int i, j, k;
-
- for (j=0,k=0;k<16;k++)
- for (i=0;i<16;i++)
- state->cos_mod[j++] = cos((2*i+1)*(2*k+1)*M_PI/64);
-
- for (k=0;k<16;k++)
- for (i=0;i<16;i++)
- state->cos_mod[j++] = cos((i)*(2*k+1)*M_PI/32);
-
- for (k=0;k<16;k++)
- state->cos_mod[j++] = 0.25/(2*cos((2*k+1)*M_PI/128));
-
- for (k=0;k<16;k++)
- state->cos_mod[j++] = -0.25/(2.0*sin((2*k+1)*M_PI/128));
-}
-
-static void qmf_32_subbands (dts_state_t * state, int chans,
- double samples_in[32][8], sample_t *samples_out,
- double scale, sample_t bias)
-{
- double *prCoeff;
- int i, j, k;
- double raXin[32];
-
- double *subband_fir_hist = state->subband_fir_hist[chans];
- double *subband_fir_hist2 = state->subband_fir_noidea[chans];
-
- int nChIndex = 0, NumSubband = 32, nStart = 0, nEnd = 8, nSubIndex;
-
- /* Select filter */
- if (!state->multirate_inter) /* Non-perfect reconstruction */
- prCoeff = fir_32bands_nonperfect;
- else /* Perfect reconstruction */
- prCoeff = fir_32bands_perfect;
-
- /* Reconstructed channel sample index */
- for (nSubIndex=nStart; nSubIndex<nEnd; nSubIndex++)
- {
- double A[16], B[16], SUM[16], DIFF[16];
-
- /* Load in one sample from each subband */
- for (i=0; i<state->subband_activity[chans]; i++)
- raXin[i] = samples_in[i][nSubIndex];
-
- /* Clear inactive subbands */
- for (i=state->subband_activity[chans]; i<NumSubband; i++)
- raXin[i] = 0.0;
-
- /* Multiply by cosine modulation coefficients and
- * create temporary arrays SUM and DIFF */
- for (j=0,k=0;k<16;k++)
- {
- A[k] = 0.0;
- for (i=0;i<16;i++)
- A[k]+=(raXin[2*i]+raXin[2*i+1])*state->cos_mod[j++];
- }
-
- for (k=0;k<16;k++)
- {
- B[k] = 0.0;
- for (i=0;i<16;i++)
- {
- if(i>0) B[k]+=(raXin[2*i]+raXin[2*i-1])*state->cos_mod[j++];
- else B[k]+=(raXin[2*i])*state->cos_mod[j++];
- }
- SUM[k]=A[k]+B[k];
- DIFF[k]=A[k]-B[k];
- }
-
- /* Store history */
- for (k=0;k<16;k++)
- subband_fir_hist[k]=state->cos_mod[j++]*SUM[k];
- for (k=0;k<16;k++)
- subband_fir_hist[32-k-1]=state->cos_mod[j++]*DIFF[k];
- /* Multiply by filter coefficients */
- for (k=31,i=0;i<32;i++,k--)
- for (j=0;j<512;j+=64)
- subband_fir_hist2[i] += prCoeff[i+j]*
- (subband_fir_hist[i+j] - subband_fir_hist[j+k]);
- for (k=31,i=0;i<32;i++,k--)
- for (j=0;j<512;j+=64)
- subband_fir_hist2[32+i] += prCoeff[32+i+j]*
- (-subband_fir_hist[i+j] - subband_fir_hist[j+k]);
-
- /* Create 32 PCM output samples */
- for (i=0;i<32;i++)
- samples_out[nChIndex++] = subband_fir_hist2[i] / scale + bias;
-
- /* Update working arrays */
- for (i=511;i>=32;i--)
- subband_fir_hist[i] = subband_fir_hist[i-32];
- for (i=0;i<NumSubband;i++)
- subband_fir_hist2[i] = subband_fir_hist2[i+32];
- for (i=0;i<NumSubband;i++)
- subband_fir_hist2[i+32] = 0.0;
- }
-}
-
-static void lfe_interpolation_fir (int nDecimationSelect, int nNumDeciSample,
- double *samples_in, sample_t *samples_out,
- double scale, sample_t bias)
-{
- /* samples_in: An array holding decimated samples.
- * Samples in current subframe starts from samples_in[0],
- * while samples_in[-1], samples_in[-2], ..., stores samples
- * from last subframe as history.
- *
- * samples_out: An array holding interpolated samples
- */
-
- int nDeciFactor, k, J;
- double *prCoeff;
-
- int NumFIRCoef = 512; /* Number of FIR coefficients */
- int nInterpIndex = 0; /* Index to the interpolated samples */
- int nDeciIndex;
-
- /* Select decimation filter */
- if (nDecimationSelect==1)
- {
- /* 128 decimation */
- nDeciFactor = 128;
- /* Pointer to the FIR coefficients array */
- prCoeff = lfe_fir_128;
- } else {
- /* 64 decimation */
- nDeciFactor = 64;
- prCoeff = lfe_fir_64;
- }
-
- /* Interpolation */
- for (nDeciIndex=0; nDeciIndex<nNumDeciSample; nDeciIndex++)
- {
- /* One decimated sample generates nDeciFactor interpolated ones */
- for (k=0; k<nDeciFactor; k++)
- {
- /* Clear accumulation */
- double rTmp = 0.0;
-
- /* Accumulate */
- for (J=0; J<NumFIRCoef/nDeciFactor; J++)
- rTmp += samples_in[nDeciIndex-J]*prCoeff[k+J*nDeciFactor];
-
- /* Save interpolated samples */
- samples_out[nInterpIndex++] = rTmp / scale + bias;
- }
- }
-}
-
-void dts_dynrng (dts_state_t * state,
- level_t (* call) (level_t, void *), void * data)
-{
- state->dynrange = 0;
- if (call) {
- state->dynrange = 1;
- state->dynrngcall = call;
- state->dynrngdata = data;
- }
-}
-
-void dts_free (dts_state_t * state)
-{
- free (state->samples);
- free (state);
-}
diff --git a/src/libdts/tables.h b/src/libdts/tables.h
deleted file mode 100644
index 73d109ea3..000000000
--- a/src/libdts/tables.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * tables.h
- * Copyright (C) 2004 Gildas Bazin <gbazin@videolan.org>
- *
- * This file is part of dtsdec, a free DTS Coherent Acoustics stream decoder.
- * See http://www.videolan.org/dtsdec.html for updates.
- *
- * dtsdec is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * dtsdec is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-static const int dts_sample_rates[] =
-{
- 0, 8000, 16000, 32000, 0, 0, 11025, 22050, 44100, 0, 0,
- 12000, 24000, 48000, 96000, 192000
-};
-
-static const int dts_bit_rates[] =
-{
- 32000, 56000, 64000, 96000, 112000, 128000,
- 192000, 224000, 256000, 320000, 384000,
- 448000, 512000, 576000, 640000, 768000,
- 896000, 1024000, 1152000, 1280000, 1344000,
- 1408000, 1411200, 1472000, 1536000, 1920000,
- 2048000, 3072000, 3840000, 1/*open*/, 2/*variable*/, 3/*lossless*/
-};
-
-static const uint8_t dts_channels[] =
-{
- 1, 2, 2, 2, 2, 3, 3, 4, 4, 5, 6, 6, 6, 7, 8, 8
-};
-
-static const uint8_t dts_bits_per_sample[] =
-{
- 16, 16, 20, 20, 0, 24, 24
-};
diff --git a/src/libdts/tables_adpcm.h b/src/libdts/tables_adpcm.h
deleted file mode 100644
index 0c63a6020..000000000
--- a/src/libdts/tables_adpcm.h
+++ /dev/null
@@ -1,4122 +0,0 @@
-/*
- * tables_adpcm.h
- * Copyright (C) 2004 Gildas Bazin <gbazin@videolan.org>
- *
- * This file is part of dtsdec, a free DTS Coherent Acoustics stream decoder.
- * See http://www.videolan.org/dtsdec.html for updates.
- *
- * dtsdec is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * dtsdec is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* 16bits signed fractional Q13 binary codes */
-static int16_t adpcm_vb[4096][4] =
-{
- { 9928, -2618, -1093, -1263 },
- { 11077, -2876, -1747, -308 },
- { 10503, -1082, -1426, -1167 },
- { 9337, -2403, -1495, 274 },
- { 10698, -2529, -532, -1122 },
- { 10368, -3974, -1264, -750 },
- { 10070, -3667, 346, 863 },
- { 10278, -3093, 311, -576 },
- { 9894, -1330, -1428, -860 },
- { 10544, -1923, -1058, -971 },
- { 10996, -1632, -841, -1404 },
- { 11832, -3465, 1658, -1990 },
- { 10852, -688, -2658, -499 },
- { 10546, -1749, -147, -1733 },
- { 10801, -1004, -708, -1453 },
- { 10588, -441, -2113, -952 },
- { 10141, -3331, -582, -1432 },
- { 9608, -2590, 383, 258 },
- { 11422, -3265, 229, -1544 },
- { 10460, -1338, -713, -1568 },
- { 10306, -1721, -1660, -603 },
- { 9580, -1812, -1235, -1061 },
- { 11471, -2285, -1617, -607 },
- { 10081, -2225, -1408, -868 },
- { 10715, -2624, -1367, -704 },
- { 10616, -1871, -2770, -35 },
- { 9352, -2340, -1024, -1566 },
- { 11065, -1458, -1926, -735 },
- { 11334, -2056, -1041, -1144 },
- { 9825, -2048, -794, -1536 },
- { 11850, -2695, -1123, -867 },
- { 10654, -2226, -1891, -373 },
- { 10024, -1557, -808, -1069 },
- { 11142, -1266, -3238, 128 },
- { 11729, -3282, -514, -1011 },
- { 11402, -2094, -2335, -189 },
- { 10195, -3658, 181, -1875 },
- { 11431, -2626, -404, -1377 },
- { 11001, -3868, -619, -1077 },
- { 10894, -2559, 274, -1758 },
- { 9633, -1482, -2253, -773 },
- { 11245, -3321, 830, -1972 },
- { 9768, -2701, -199, -1859 },
- { 10500, -2042, 525, -2043 },
- { 11669, -4069, 293, -1468 },
- { 9192, -1991, -583, -61 },
- { 10057, -3220, -2015, -473 },
- { 9497, -2315, -2490, -467 },
- { 10455, -3069, -1194, -1007 },
- { 9994, -1936, -60, -1225 },
- { 9295, -2156, -1761, -1134 },
- { 10085, -3748, -1026, 197 },
- { 9334, -2360, 804, -351 },
- { 11561, -2553, 1352, -2313 },
- { 12837, -3998, 1195, -1958 },
- { 10114, -1100, -2414, -394 },
- { 9341, -2530, 315, 755 },
- { 10131, -3164, 1411, -674 },
- { 9535, -905, -1551, 579 },
- { 11717, -1519, -3051, 91 },
- { 9824, -2911, -2775, 192 },
- { 9662, -2934, -561, 1450 },
- { 11085, -3392, -1298, -659 },
- { 8955, -2102, -1899, 703 },
- { 8607, -1742, -4348, 814 },
- { 7640, -2063, -3617, 52 },
- { 7074, -826, -4325, 4375 },
- { 7714, 584, -4238, 1927 },
- { 6355, -952, -4912, 3127 },
- { 7069, -660, -6413, 4087 },
- { 8313, -132, -2964, -876 },
- { 6952, -1422, -3962, -24 },
- { 9299, -734, -3088, -263 },
- { 9484, -574, -4513, 466 },
- { 7246, -91, -3735, -704 },
- { 8325, -1417, -3090, -530 },
- { 6469, -1226, -4757, 829 },
- { 6652, -368, -5682, 1393 },
- { 7971, -1278, -2284, 1205 },
- { 7229, -699, -3556, 1840 },
- { 7994, 1284, -2729, 732 },
- { 9005, -698, -4522, 2189 },
- { 6963, 197, -2727, 380 },
- { 8527, 135, -3991, -213 },
- { 8840, 934, -3014, -567 },
- { 10125, 418, -3284, -371 },
- { 6367, 361, -2318, 2554 },
- { 7892, 172, -5247, 4673 },
- { 6674, 387, -5424, 4398 },
- { 6240, 684, -4047, 1219 },
- { 11170, -794, -5081, 1195 },
- { 11765, -648, -6265, 2052 },
- { 10845, -775, -3837, 366 },
- { 12496, -689, -8260, 3562 },
- { 7893, -1166, -4972, 988 },
- { 8592, 1052, -5986, 3087 },
- { 7277, 1874, -5685, 3579 },
- { 6900, 2016, -4809, 3491 },
- { 8530, -2405, -3250, 1986 },
- { 9426, 494, -7067, 5038 },
- { 10285, 564, -8210, 5370 },
- { 8749, -2207, -3980, 2852 },
- { 9653, -2686, -4300, 1400 },
- { 9770, -2286, -5663, 4233 },
- { 8490, -4, -7048, 4496 },
- { 7697, -1209, -5328, 3183 },
- { 6451, 801, -4324, -554 },
- { 7387, 1806, -5265, 545 },
- { 7450, -2302, -4445, 1418 },
- { 8817, -1370, -5827, 2168 },
- { 10324, -2406, -5629, 2579 },
- { 8863, -2578, -3537, 467 },
- { 6901, -1624, -3169, 3392 },
- { 7846, 156, -6948, 3381 },
- { 7928, -1115, -5972, 4816 },
- { 6089, -599, -4368, -320 },
- { 7833, 1246, -3960, -621 },
- { 8931, 2521, -6768, 2052 },
- { 8900, 1944, -4126, 40 },
- { 7661, -34, -2855, 2480 },
- { 5873, 474, -3262, 3712 },
- { 7535, -234, -4699, 216 },
- { 5856, 143, -5142, 73 },
- { 8944, -106, -5874, 3663 },
- { 7134, 426, -5879, 2895 },
- { 10199, 1011, -4762, 369 },
- { 8454, 264, -5971, 1291 },
- { 7822, -2449, -4333, 4540 },
- { 6200, -2758, -2632, 1497 },
- { 6070, -4315, -2699, 414 },
- { 7047, -3739, -3210, 1060 },
- { 5675, -3801, -2717, -407 },
- { 4789, -4063, -2628, -744 },
- { 4023, -3366, -3133, -726 },
- { 4296, -2407, -3381, -513 },
- { 4388, -2931, -2820, 1512 },
- { 4559, -4233, -1941, 1976 },
- { 6702, -3208, -1755, 1680 },
- { 4416, -3521, -1052, 2984 },
- { 7154, -4266, -1203, 3732 },
- { 3625, -4242, -3244, 1395 },
- { 6518, -2856, -1304, 2887 },
- { 6170, -1949, -3014, 3973 },
- { 5189, -2451, -4020, 3477 },
- { 6218, -2988, -1921, 3844 },
- { 4827, -3688, -1928, 3343 },
- { 6668, -3991, -2805, 3095 },
- { 5297, -3115, -3684, 2390 },
- { 5354, -4614, -2662, 1504 },
- { 4196, -3091, -4147, 1135 },
- { 3540, -2893, -4007, 100 },
- { 5569, -1602, -4007, 1909 },
- { 4341, -2091, -4272, 252 },
- { 5559, -2878, -3832, 498 },
- { 4548, -4479, -2898, -27 },
- { 5176, -2494, -4635, 1476 },
- { 3294, -3485, -3738, 716 },
- { 4920, -1229, -4195, -365 },
- { 3257, -3518, -3349, 2862 },
- { 5286, -1948, -3485, -778 },
- { 6502, -3051, -152, 2854 },
- { 5864, -4192, -1076, 3451 },
- { 4656, -3122, -3448, 179 },
- { 5907, -754, -1596, 3116 },
- { 7229, -3680, -1590, 2892 },
- { 5107, -3888, -3364, 806 },
- { 6764, -2635, -3450, 134 },
- { 5258, -2827, -2844, -1052 },
- { 5798, -1725, -4305, 205 },
- { 5404, -1213, -3362, 449 },
- { 6224, -2738, -3046, -581 },
- { 4223, -2438, -2725, 3745 },
- { 4751, -3411, -2123, 116 },
- { 3868, -3000, -3954, 2297 },
- { 6819, -2899, -4277, 2825 },
- { 4207, -4754, -2808, 865 },
- { 4804, -1494, -1997, 4688 },
- { 5282, -2213, -548, 3559 },
- { 5580, -1912, -566, 4370 },
- { 6168, -2857, -672, 4053 },
- { 6583, -4515, -2850, 1670 },
- { 6511, -3093, -3988, 1421 },
- { 4646, -1790, -1443, 3650 },
- { 5915, -924, -2020, 896 },
- { 7814, -4181, -3152, 2007 },
- { 6190, -2238, -4817, 2279 },
- { 4737, -4034, -3288, 1835 },
- { 8161, -3633, -3423, 3137 },
- { 7415, -2351, -2088, 4290 },
- { 4106, -2517, -62, 2905 },
- { 4909, -3145, -614, 4112 },
- { 4938, -3281, -397, 1100 },
- { -173, 919, 1589, -5363 },
- { -13, 796, -295, -6655 },
- { -1860, -829, 1141, -4555 },
- { 2298, -838, -664, -5005 },
- { -884, -1097, 2074, -4613 },
- { -101, 281, 2846, -4535 },
- { 1166, 453, 2429, -5910 },
- { 879, -664, 2370, -5452 },
- { 1415, -370, -1699, -4727 },
- { -1413, 1277, -669, -6649 },
- { 2133, 304, -968, -4624 },
- { 380, 586, -2087, -4892 },
- { 1336, 275, -82, -5789 },
- { -2459, 1057, -34, -5416 },
- { 2278, -1758, 866, -5653 },
- { 1945, -2295, -149, -5302 },
- { 1287, -3525, 996, -5255 },
- { 2297, 803, 1177, -6067 },
- { 187, -180, -619, -6202 },
- { -793, -2537, 1554, -5057 },
- { -2703, -204, -629, -5853 },
- { -1007, -146, 313, -5582 },
- { 830, 357, 869, -6363 },
- { -228, -575, -3177, -4433 },
- { -1001, -1553, -142, -5708 },
- { -1644, 1683, 1721, -4533 },
- { 893, 1924, -15, -5791 },
- { 2195, 2061, -262, -5471 },
- { 3031, 270, 311, -5096 },
- { 1912, 1638, -1523, -4677 },
- { -3142, -55, 253, -4914 },
- { 356, -1680, 343, -6123 },
- { -2241, -1734, -976, -5939 },
- { -2196, -2893, 547, -4938 },
- { -1245, 126, -1916, -5419 },
- { -249, -3755, -1422, -5594 },
- { 575, -2683, -1926, -4566 },
- { -762, 1885, 192, -5880 },
- { -811, -2562, -1068, -6013 },
- { -2264, -3086, -976, -4775 },
- { 70, -1215, 2880, -4410 },
- { 714, -3760, 2916, -4691 },
- { -244, -3404, 1740, -4493 },
- { 684, -5137, -328, -5608 },
- { -529, -3825, -1786, -4535 },
- { -713, -4743, -1118, -5546 },
- { 2718, -3788, 1798, -5708 },
- { -1639, -3679, -1564, -6095 },
- { 1693, -2642, -1389, -4539 },
- { 505, -1573, -1651, -4878 },
- { -835, -2256, -1941, -5352 },
- { 1464, -411, 1993, -6441 },
- { 493, -3184, -145, -6148 },
- { -1413, 499, -1617, -6479 },
- { -294, 1722, -1419, -5725 },
- { -2937, -1528, -175, -4624 },
- { -594, -5911, -56, -6146 },
- { -300, -4275, 1156, -5947 },
- { 552, -2643, 2669, -3959 },
- { 905, -4158, 1789, -5809 },
- { 1336, -2009, 2108, -5903 },
- { 1555, -3600, 1110, -6759 },
- { -1294, -3464, 77, -6084 },
- { -1139, -4006, -1270, -4181 },
- { -5094, -3296, 1092, -2847 },
- { -5503, -2883, 1984, -2067 },
- { -4671, -4218, -1417, -4132 },
- { -3763, -3818, 1262, -3082 },
- { -5132, -3430, 2928, -728 },
- { -5957, -2877, 1251, -2446 },
- { -4425, -2319, -212, -4276 },
- { -6201, -1993, 1774, -2182 },
- { -5500, -3836, 2201, -1396 },
- { -6934, -2334, 2366, -1293 },
- { -6124, -4140, 1337, -1977 },
- { -6553, -4186, 1756, -1325 },
- { -5126, -1258, 744, -3656 },
- { -5167, -1390, 1581, -2895 },
- { -4525, -3398, 2429, -1865 },
- { -4076, -3183, 2027, -2510 },
- { -6191, -3274, 1838, -1814 },
- { -4454, -2753, 2723, -1185 },
- { -6655, -4797, 251, -2595 },
- { -6332, -2232, 1832, 217 },
- { -5869, -1698, 134, 340 },
- { -6614, -1045, 2126, -1932 },
- { -4859, -2107, 2010, -2435 },
- { -6274, -1622, 2808, -1374 },
- { -3119, -3209, 521, -3988 },
- { -5676, -2082, -420, -2711 },
- { -7073, -3623, 696, -2343 },
- { -5986, -4224, 572, -2454 },
- { -4340, -4521, 882, -2771 },
- { -6178, -1933, 535, -1444 },
- { -4923, -4163, 1744, -2066 },
- { -6410, -1519, 1058, -2683 },
- { -5077, -1185, 856, -2216 },
- { -7091, -2444, 687, -2597 },
- { -5284, -2165, 3239, -993 },
- { -4763, -1497, 197, -3179 },
- { -4128, -4958, -396, -3578 },
- { -5054, -3878, -647, -2672 },
- { -7005, -3348, 1679, -1579 },
- { -5767, -1017, 2582, -1915 },
- { -7069, -2787, 1331, -2070 },
- { -5532, -2296, 706, -2950 },
- { -5059, -3543, -821, -3637 },
- { -6639, -1835, 1016, -696 },
- { -5611, -5220, -694, -3371 },
- { -5994, -2803, 2933, -729 },
- { -5948, -619, 1596, -2676 },
- { -5486, -4419, 153, -3265 },
- { -4329, -3440, 1646, -1439 },
- { -4083, -3978, 177, -3569 },
- { -4289, -2599, 1224, -3075 },
- { -5707, -3253, 1912, -759 },
- { -6606, -3437, 2562, -571 },
- { -5254, -2444, 769, -352 },
- { -6545, -3154, 582, -1103 },
- { -5328, -2241, 2566, -1775 },
- { -7216, -1936, 1538, -1983 },
- { -3730, -2451, 426, -3869 },
- { -5110, -1385, 2031, -1169 },
- { -6470, -2715, 269, -3123 },
- { -5806, -2480, -97, -3832 },
- { -3683, -4916, -490, -4330 },
- { -6341, -2083, -669, -115 },
- { -4913, -4079, -837, -4673 },
- { -3274, -2497, 2334, -2652 },
- { -1286, -1731, 2550, -3756 },
- { -3375, -877, 926, -3977 },
- { -2525, -2079, 2879, -2625 },
- { -5308, -504, 3111, -1607 },
- { -4904, 460, 4093, -1232 },
- { -1993, 1616, 4656, -1913 },
- { -3481, -1176, 3119, -2236 },
- { -4132, -1502, 2339, -2545 },
- { -2542, 1151, 3569, -2550 },
- { -4381, 430, 3147, -2082 },
- { -3888, 867, 3899, -1657 },
- { -2861, 1290, 4202, -1979 },
- { -3893, -253, 2363, -2764 },
- { -1705, 688, 3827, -2923 },
- { -2223, 2312, 3700, -3148 },
- { -1986, -720, 5021, -795 },
- { -3177, 242, 1952, -3352 },
- { -1854, 1509, 2528, -3815 },
- { -3173, 97, 5019, -706 },
- { -2689, -145, 1375, -3915 },
- { -4838, -385, 2488, -2427 },
- { -4557, -355, 1603, -3060 },
- { -3522, 1832, 3292, -2674 },
- { -3769, 780, 2378, -2704 },
- { -4323, -1932, 3414, -1169 },
- { -2740, 1158, 2729, -3273 },
- { -3647, 210, 1464, -2892 },
- { -2342, -2097, 1513, -3727 },
- { -4422, -1242, 3130, -1833 },
- { -1308, -1039, 4290, -1875 },
- { -1754, -2535, 3298, -2314 },
- { -4102, -186, 4037, -1094 },
- { -1008, 1570, 3290, 171 },
- { -3322, -2621, 2791, -1536 },
- { -2539, -2597, 3442, -1672 },
- { -3411, -2015, 3670, -1174 },
- { -2097, 730, 5581, -1399 },
- { -1510, -74, 4820, -2004 },
- { -4086, -868, 4425, -771 },
- { -956, -986, 3640, -2925 },
- { -2087, -1250, 3464, -2458 },
- { -3308, -2411, 1334, -3667 },
- { -2264, -389, 4004, -1854 },
- { -680, 239, 4058, -3388 },
- { -1357, 30, 2993, -3658 },
- { -3601, -552, 1177, -1136 },
- { -2641, 442, 4374, -1625 },
- { -2525, 770, 1640, -3895 },
- { -3172, -891, 3893, -1608 },
- { -2996, 13, 3277, -2414 },
- { -899, 1055, 4470, -2501 },
- { -422, -584, 3475, -3787 },
- { -1978, -593, 2566, -3415 },
- { -3150, -1280, 2362, -3047 },
- { -3592, 224, 1026, -3932 },
- { -4840, -1189, 3633, -879 },
- { -3952, -2255, 2916, -1826 },
- { -1695, 28, 1810, -349 },
- { -745, -2484, 3308, -3293 },
- { -1016, 1563, 5365, -1823 },
- { -2172, -1787, 4266, -1287 },
- { -1241, -1951, 3982, -2413 },
- { -2009, -2639, 2330, -3480 },
- { 5105, -1618, -2588, -2015 },
- { 6497, -1523, -3218, -910 },
- { 6526, -2305, -2029, -1790 },
- { 5289, -99, -3436, -400 },
- { 5781, -1623, -1577, -2617 },
- { 5259, -670, -3125, -1700 },
- { 6343, -1256, -331, -3222 },
- { 7967, -678, -2195, -1462 },
- { 6119, -695, -2988, -1538 },
- { 6108, 494, -3359, -1548 },
- { 5067, 969, -2328, -2707 },
- { 7595, -435, -1497, -2056 },
- { 6929, -719, -2420, -1665 },
- { 5190, 584, -2982, -2103 },
- { 6106, -444, -1411, -2739 },
- { 5584, 289, -1804, -2803 },
- { 5276, 227, -1180, -3361 },
- { 7544, -1525, -1834, -1725 },
- { 5986, -1470, -2606, -1701 },
- { 5096, -765, -1712, -3006 },
- { 5423, -149, -3933, -1157 },
- { 7651, 26, -2445, -1507 },
- { 4745, -464, -1735, -2362 },
- { 5352, -1011, -1094, -1999 },
- { 6300, -672, -542, -1950 },
- { 6675, -1020, -1318, -1059 },
- { 7218, -2036, -603, -2462 },
- { 7755, -1514, -2430, -1229 },
- { 5041, 449, -1056, -2405 },
- { 6710, -2277, -1344, -2284 },
- { 6824, -1347, -2254, 251 },
- { 6068, -1857, -983, -1316 },
- { 5603, -2177, -2730, -1477 },
- { 5838, -1059, -3604, -970 },
- { 5076, -789, -335, -2413 },
- { 6191, -1634, -2000, -2129 },
- { 5092, -1292, -2543, -1034 },
- { 5305, 435, -1710, -1850 },
- { 6140, 561, -2176, -2380 },
- { 6752, 348, -2496, -1890 },
- { 6405, 273, -1098, -2778 },
- { 6942, -1340, -496, -1381 },
- { 5238, -687, -2454, -2349 },
- { 6959, -882, -1833, -2061 },
- { 6292, -253, -2125, -2199 },
- { 5838, -574, -759, -3215 },
- { 6954, -1484, -640, -2771 },
- { 7498, -1706, -1210, -2154 },
- { 6772, -1003, -1235, -2532 },
- { 6014, 228, -2154, -1108 },
- { 6943, -2178, -2644, -1122 },
- { 7262, -763, -3056, -1090 },
- { 6273, -1478, -1072, 177 },
- { 4734, 425, -2912, 357 },
- { 7129, 168, -1537, -2327 },
- { 7204, -434, -746, -2660 },
- { 6879, 57, -3087, -1310 },
- { 4623, -610, -718, -3459 },
- { 6565, -543, -1998, -339 },
- { 4752, -277, -2066, -1405 },
- { 7435, -1416, -1904, -505 },
- { 4076, 150, -1222, -3556 },
- { 7082, -28, -1456, -1174 },
- { 5941, -446, -1326, -1158 },
- { 3870, -1648, -2474, -2589 },
- { 858, 37, -3387, -3721 },
- { 3557, -1503, -1664, -3383 },
- { 3336, -1972, -3079, -2216 },
- { 3186, 60, -4185, -863 },
- { 3456, -773, -3066, -2457 },
- { 4131, -913, -2060, -2601 },
- { 4431, -691, -4114, -972 },
- { 3461, -334, -3680, -1751 },
- { 2006, -459, -2214, -3827 },
- { 1322, 32, -2816, -3203 },
- { 4425, -1897, -2791, -1946 },
- { 4504, 23, -3421, -1909 },
- { 3090, -885, -2366, -3264 },
- { 3209, -2363, -3730, -834 },
- { 3312, -1471, -3641, -1579 },
- { 4184, -1669, -3323, -1248 },
- { 2190, -931, -3302, -2944 },
- { 2947, -229, -4791, -1195 },
- { 2020, -1626, -2700, -3125 },
- { 2214, -326, -4352, -1683 },
- { 3286, -2619, -2412, -2458 },
- { 1000, -2571, -4129, -2158 },
- { 2496, -2627, -3611, -1433 },
- { 2043, -2191, -2167, -3827 },
- { 2571, -2544, -1915, -3222 },
- { 2022, -1501, -3856, -2165 },
- { 2685, -1180, -1461, -4038 },
- { 1610, -2313, -4391, -1173 },
- { 2340, -2490, -4215, -516 },
- { 1742, -2615, -3632, -2146 },
- { 523, -1293, -4246, -2442 },
- { 3725, -2723, -3014, -1576 },
- { 3554, -1381, -4200, -824 },
- { 1291, -1594, -4777, -1430 },
- { 1452, 515, -2960, -3830 },
- { 4264, -894, -3305, -1826 },
- { 2606, -1452, -4522, -966 },
- { 1196, -830, -4807, -1816 },
- { 1054, -775, -2616, -4071 },
- { 4206, 415, -4344, -1132 },
- { 3044, 491, -4126, -1934 },
- { 988, -901, -3353, -3443 },
- { 1729, -3063, -2267, -3370 },
- { 3915, 912, -2989, -2387 },
- { 3781, 300, -2457, -3050 },
- { 2712, 924, -1350, -1206 },
- { 4230, 405, -2343, 665 },
- { 1878, -873, -225, -29 },
- { 3510, 56, -1334, -3420 },
- { 2850, 1447, -2651, -3150 },
- { 1510, -706, -4125, -2483 },
- { 3115, 793, -1692, -3894 },
- { 2667, 213, -2973, -2786 },
- { 1184, -2384, -3051, -3173 },
- { 2139, 796, -2079, -3697 },
- { 1464, -1483, -3726, -2754 },
- { 2407, -1148, -3915, -1569 },
- { 2612, -1779, -3217, -2271 },
- { 2406, -2870, -2937, -2496 },
- { 2140, 126, -3646, -2758 },
- { 2952, -1036, 268, -1423 },
- { 93, -1931, -3841, -3535 },
- { 389, -2953, -3383, -3343 },
- { 8652, -5511, -1662, 565 },
- { 7427, -2791, -2535, -842 },
- { 8541, -4253, -1407, -988 },
- { 8018, -3203, -2998, 105 },
- { 7231, -3926, -958, 1308 },
- { 7331, -3690, -363, 2586 },
- { 6803, -3646, -2226, -903 },
- { 8163, -2811, -477, -2235 },
- { 9356, -3818, -1685, -684 },
- { 8466, -2854, -302, -698 },
- { 8458, -3224, 517, 279 },
- { 8074, -2619, -1326, 2596 },
- { 8779, -2761, -2527, -441 },
- { 6533, -2887, -899, -696 },
- { 7394, -2305, -1642, -120 },
- { 8281, -3780, -22, 1305 },
- { 9158, -4413, -779, 901 },
- { 9031, -5240, -1109, 1678 },
- { 8717, -3650, 410, -1075 },
- { 7317, -3197, -818, -2264 },
- { 7934, -2385, -1214, -1886 },
- { 8256, -4441, -291, -587 },
- { 7358, -3395, 1090, -270 },
- { 9446, -4910, -1343, -473 },
- { 8187, -4726, -808, 1166 },
- { 7504, -3845, -47, 267 },
- { 8029, -2146, -1283, -383 },
- { 7461, -2705, -853, 783 },
- { 9367, -3636, -645, -354 },
- { 8955, -3473, -308, -1947 },
- { 8676, -2683, -2099, 1485 },
- { 7481, -3003, -871, -444 },
- { 8015, -2839, -1673, 1175 },
- { 6947, -4643, -1527, -1047 },
- { 7622, -2575, -137, -960 },
- { 9388, -4279, -707, -1322 },
- { 8382, -5259, -1283, -565 },
- { 6856, -4138, -1030, 630 },
- { 8659, -2571, -1124, -1666 },
- { 8763, -3807, -537, 2543 },
- { 8049, -3578, -2186, -604 },
- { 8272, -2351, -1985, -1214 },
- { 6855, -3796, -1527, -1631 },
- { 7178, -2896, -1600, -1756 },
- { 7040, -2888, -89, -1586 },
- { 6261, -3403, -264, 998 },
- { 7756, -4699, -1543, -834 },
- { 7682, -4622, -758, -1721 },
- { 8839, -4232, -2932, 1959 },
- { 9363, -4679, -1956, 39 },
- { 7883, -3616, -1414, -1432 },
- { 8828, -3188, -1356, -1312 },
- { 7746, -3987, -121, -2424 },
- { 9262, -3256, -693, 818 },
- { 7670, -3420, -148, 3504 },
- { 7344, -3183, 608, 1595 },
- { 8976, -4139, -1848, 1304 },
- { 6708, -4131, 33, -852 },
- { 7840, -4429, -2275, 79 },
- { 8980, -3858, -2838, 453 },
- { 7815, -4604, -2563, 944 },
- { 8372, -4422, -1783, 3071 },
- { 8623, -5128, -1754, 2888 },
- { 7462, -3281, 889, 920 },
- { 8416, -59, -1320, -1825 },
- { 7928, -1488, -414, -2499 },
- { 8110, -977, -1047, -2042 },
- { 8278, -687, -1597, -1550 },
- { 7988, -174, -977, -2106 },
- { 8609, -1547, -1628, -1527 },
- { 9000, -1798, -946, -1761 },
- { 8954, -872, -1404, -1594 },
- { 8939, 466, -748, -1212 },
- { 9549, -329, -177, -1360 },
- { 9411, -18, -1126, -1568 },
- { 8859, -782, -488, -1338 },
- { 8955, -218, -43, -1209 },
- { 9131, -69, -453, -1001 },
- { 9069, -1519, -1091, -1199 },
- { 9247, -1309, -566, -1146 },
- { 8528, -1617, -287, -1313 },
- { 7763, -745, -149, -2040 },
- { 8294, -343, 257, -2633 },
- { 10149, -893, -552, -1649 },
- { 9398, -915, 218, -2042 },
- { 9703, -1194, -675, -1592 },
- { 9586, -700, -427, -1710 },
- { 8930, 497, -1445, -1218 },
- { 9285, -1323, -163, -1552 },
- { 8431, -1289, -985, -1404 },
- { 8965, -655, 653, -1483 },
- { 9542, -1001, -951, -1128 },
- { 9205, -647, -37, -882 },
- { 8603, -56, 514, -1793 },
- { 9300, -12, -1324, -567 },
- { 8773, 238, -184, -1456 },
- { 9941, -1306, -69, -1792 },
- { 9360, 279, -376, -1919 },
- { 9180, -285, 95, -2170 },
- { 9922, -501, -970, -1570 },
- { 8341, -1493, -856, -2092 },
- { 8780, -981, -850, -1014 },
- { 9721, -548, -1504, -1094 },
- { 9973, -1493, 482, -2105 },
- { 8707, -333, -1027, -1087 },
- { 9098, -469, -315, -1723 },
- { 8879, -1050, -661, -2020 },
- { 8857, 602, -866, -1918 },
- { 8945, -1025, -2154, -1071 },
- { 8484, -1930, -468, -2179 },
- { 9177, -1903, -224, -2112 },
- { 8652, -137, -2097, -1214 },
- { 9063, -973, -1405, -772 },
- { 9328, -456, 662, -2469 },
- { 10101, -697, 127, -2113 },
- { 9685, 811, -2359, -1024 },
- { 8586, -94, -460, -1982 },
- { 7924, -141, -509, -2513 },
- { 7773, -669, -107, -2835 },
- { 8636, -1064, -46, -2409 },
- { 9748, 596, -1815, -1349 },
- { 8924, 304, 547, -2614 },
- { 9442, 746, -1153, -1679 },
- { 9454, -278, -529, -1976 },
- { 8488, 561, -32, -2160 },
- { 10083, -63, -1544, -1364 },
- { 9390, -1278, 568, -1131 },
- { 9740, -49, -2253, -910 },
- { 3636, -2391, -1115, -3614 },
- { 6014, -3204, -1902, -1808 },
- { 5787, -3497, -1116, -2590 },
- { 4365, -3046, -1632, -2668 },
- { 4733, -2192, -2029, -2468 },
- { 5412, -2753, -1633, -2464 },
- { 4455, -3375, -767, -3399 },
- { 4456, -1644, -983, -2841 },
- { 4039, -2523, 38, -3967 },
- { 3406, -2662, 72, -4757 },
- { 4279, -2005, 1055, -4399 },
- { 4321, -1377, -860, -3786 },
- { 3743, -5739, -651, -3047 },
- { 3528, -5510, 361, -4060 },
- { 6496, -4886, -136, -2689 },
- { 4513, -5254, 551, -4010 },
- { 6557, -3413, -92, -3063 },
- { 4186, -2059, 187, 47 },
- { 6210, -4117, -1256, -1985 },
- { 6038, -4343, 351, -2124 },
- { 4305, -4780, -2077, -1897 },
- { 4480, -3815, -2228, -1533 },
- { 5582, -3689, 1221, -3429 },
- { 5532, -4874, 1195, -2765 },
- { 6518, -2853, -905, -2568 },
- { 5467, -2192, 470, -4115 },
- { 4139, -1577, 240, -3493 },
- { 5281, -1926, -729, -3340 },
- { 5214, -2870, 1359, -4289 },
- { 3046, -3510, -1536, -3214 },
- { 5433, -2881, -1230, -1184 },
- { 4861, -3932, -1071, -2791 },
- { 5693, -4234, -1906, -1502 },
- { 4004, -3935, -1804, -2383 },
- { 3728, -3792, 681, -4773 },
- { 3621, -3030, -1951, -2598 },
- { 5133, -3903, 44, -3700 },
- { 3561, -3451, 1183, -5301 },
- { 5026, -2762, -2341, -1780 },
- { 5841, -2492, -467, -3210 },
- { 5591, -1791, 497, -2472 },
- { 5054, -3898, -1822, -2097 },
- { 5813, -2792, 83, -1469 },
- { 4432, -4497, 1670, -5193 },
- { 5338, -4653, -1109, -2200 },
- { 3239, -4401, -648, -3655 },
- { 2147, -3598, -1200, -4242 },
- { 4417, -2271, -1552, -3210 },
- { 6494, -4360, 852, -3565 },
- { 2393, -6358, -856, -4524 },
- { 4959, -4196, -847, -1403 },
- { 4924, -5438, -226, -3026 },
- { 4254, -5303, -1306, -2424 },
- { 4121, -3126, -2334, -1981 },
- { 3437, -4443, -1464, -2953 },
- { 3203, -3459, -529, -4339 },
- { 5896, -5945, 543, -3246 },
- { 1987, -4733, -220, -4863 },
- { 4358, -4431, -514, -3081 },
- { 4583, -2416, -492, -2287 },
- { 2943, -5035, 419, -4927 },
- { 5358, -5129, 987, -4309 },
- { 4460, -3392, 1752, -5634 },
- { 3415, -4633, 1507, -5945 },
- { 811, -4692, -445, 2333 },
- { 1009, -5613, -1857, 1360 },
- { 1338, -2712, -2720, 3036 },
- { 1002, -3754, -2582, 2344 },
- { 750, -4608, -2334, 714 },
- { 2043, -3207, -2822, 2173 },
- { -140, -4654, -2953, 357 },
- { -54, -4026, -2376, 2695 },
- { 1858, -5022, -717, 2287 },
- { 2064, -3894, -722, 3255 },
- { 2727, -4558, -332, 2603 },
- { 1810, -5378, 283, 1826 },
- { 3935, -4326, 762, 3383 },
- { -767, -4697, -2510, 1922 },
- { 2146, -4312, -3090, 1641 },
- { 54, -5881, -2114, 921 },
- { 1992, -5766, -640, 1574 },
- { 1200, -5371, -1114, 1828 },
- { 2973, -5337, 34, 2266 },
- { 1531, -5018, -2817, 1192 },
- { 3078, -4570, 117, 1990 },
- { 924, -4286, -1388, 2713 },
- { 142, -5058, -2848, 1487 },
- { -106, -6180, -881, 842 },
- { 673, -5433, -229, 1596 },
- { 783, -5710, -2784, 562 },
- { 1935, -5729, -2009, 856 },
- { -410, -3375, -3326, 2734 },
- { 234, -3000, -2628, 3260 },
- { 733, -3405, -3806, 1589 },
- { 771, -4285, -3544, 1314 },
- { 1192, -3563, -3960, 2178 },
- { 206, -5555, -1250, 1546 },
- { -130, -3815, -1210, 3041 },
- { 646, -3940, -393, 2992 },
- { -184, -4931, -1767, 1925 },
- { 2746, -5120, -2275, 1464 },
- { 2440, -3731, -3352, 2729 },
- { -490, -4942, -3779, 997 },
- { 68, -2636, -4167, 3778 },
- { 48, -3986, -4118, 2106 },
- { -978, -5486, -1336, 1390 },
- { 1126, -5297, -855, 640 },
- { -472, -3975, -3622, 1557 },
- { 2456, -5344, -1523, 1648 },
- { -774, -5652, -2417, 1147 },
- { 995, -6122, -812, 1132 },
- { 3282, -4571, -1763, 2175 },
- { 3655, -3862, -676, 3568 },
- { 3038, -3647, -1672, 3381 },
- { 2595, -2964, -2772, 3263 },
- { 4176, -3353, -1148, 4354 },
- { 1603, -3442, -1500, 3444 },
- { 828, -6226, -1783, 678 },
- { 1421, -3333, -3080, 3403 },
- { 1121, -4727, -1924, 1984 },
- { -186, -5083, -682, 1796 },
- { 819, -2778, -3488, 530 },
- { 421, -2873, -3832, 2596 },
- { 2164, -4263, -1605, 2282 },
- { 585, -4437, -682, -491 },
- { -644, -4452, -1157, 2325 },
- { 1991, -4299, 210, 2834 },
- { 2135, -3632, -2113, 665 },
- { -7482, -2724, -2662, -1380 },
- { -6983, -2166, -3756, -3509 },
- { -7085, -1439, -2397, -3112 },
- { -7760, -3049, -3319, -2822 },
- { -8413, -2760, -4406, -3298 },
- { -5995, -3943, -1260, -3750 },
- { -7879, -1554, -3464, -2606 },
- { -6314, -2034, -3878, -1681 },
- { -8849, -2084, -1399, -1231 },
- { -7153, -2602, -1384, -817 },
- { -8041, -2571, -407, -2785 },
- { -7246, -2233, -1578, 260 },
- { -7336, -3883, -4061, -1342 },
- { -7619, -3908, -2342, 382 },
- { -8684, -3724, -1662, -727 },
- { -7850, -2922, -1770, -3449 },
- { -6766, -2034, -1293, -1988 },
- { -6895, -2116, -968, -3744 },
- { -7136, -5147, -2618, -2809 },
- { -8224, -3724, -2519, -1589 },
- { -6711, -2750, -3021, -219 },
- { -8059, -1638, -1102, -3175 },
- { -8710, -4839, -3963, -3143 },
- { -9363, -4965, -3257, -1002 },
- { -6099, -1751, -3157, -395 },
- { -6453, -3216, -4597, -483 },
- { -7879, -5477, -839, -2638 },
- { -7202, -4038, -526, -2856 },
- { -8022, -1228, -1910, -1646 },
- { -9117, -1393, -1582, -2535 },
- { -9095, -2693, -636, -2605 },
- { -9076, -2580, -3481, -2519 },
- { -8327, -4859, -2422, 83 },
- { -8368, -2129, -2324, -2173 },
- { -8554, -4563, -3842, -2007 },
- { -10462, -4261, -1934, -2084 },
- { -9717, -3187, -2294, -1896 },
- { -9625, -3889, -3020, -3224 },
- { -9857, -4955, -4239, -2184 },
- { -9752, -2351, -2277, -3129 },
- { -7219, -1302, -2639, -1603 },
- { -7477, -4360, -3718, -559 },
- { -5680, -2033, -2326, -3078 },
- { -10190, -5548, -4643, -3601 },
- { -9431, -4121, -879, -2479 },
- { -8365, -5450, -2020, -1439 },
- { -6289, -5178, -1605, -3845 },
- { -8319, -3866, -687, -2792 },
- { -8131, -1031, -3608, -3947 },
- { -10510, -2560, -1199, -2082 },
- { -11015, -3640, -2748, -3041 },
- { -8762, -5022, -5231, -1162 },
- { -10153, -2715, -4648, -4859 },
- { -7930, -5205, -1900, -3600 },
- { -9561, -3548, -4812, -3722 },
- { -7663, -4709, -1180, -1475 },
- { -9073, -5707, -1815, -2980 },
- { -8602, -2363, -2675, -3770 },
- { -9967, -5614, -3575, -3838 },
- { -8324, -1005, -2131, -3254 },
- { -10331, -5737, -2550, -2940 },
- { -8234, -3354, -3361, -4479 },
- { -8140, -1951, -4526, -4545 },
- { -6679, -2662, -2284, -4182 },
- { -1122, -1514, -6427, -212 },
- { 54, -1660, -5424, -1404 },
- { 254, -2778, -5222, 846 },
- { -267, -1661, -6577, 814 },
- { -305, -2021, -5759, 1484 },
- { -1791, -2446, -6867, -86 },
- { -2929, -3158, -6603, -1799 },
- { -1391, -3189, -5557, -1053 },
- { -1602, -884, -6767, -1213 },
- { -361, -318, -6219, -44 },
- { -4078, -2635, -5523, -433 },
- { -956, 478, -4382, 1470 },
- { -3300, -2462, -6021, -2721 },
- { 708, -2434, -5085, -540 },
- { -2435, -3607, -5647, -2110 },
- { -491, -1134, -4681, -2886 },
- { 87, -3435, -4641, -1194 },
- { -586, -2927, -4784, 366 },
- { -1394, -2326, -6021, 350 },
- { 97, -2519, -4678, -2120 },
- { -1547, -1907, -5069, -2993 },
- { 268, -3724, -4719, 127 },
- { -827, -1190, -5912, 1144 },
- { -3959, -2322, -6898, -1974 },
- { -2728, -2228, -6426, -562 },
- { -456, -666, -5785, -1609 },
- { 531, -1096, -5731, -656 },
- { -3569, -688, -3915, 110 },
- { -4752, -1725, -4393, -377 },
- { -3210, -3315, -6960, -840 },
- { -688, -3416, -4971, 1221 },
- { -1833, 77, -6491, -2434 },
- { -239, -255, -6850, -886 },
- { -2112, -1490, -6291, -2689 },
- { -1544, -4579, -5198, -1261 },
- { -2771, -4014, -5520, 683 },
- { -1635, -2829, -5512, 1214 },
- { -958, -2582, -4823, 2360 },
- { -2077, -4566, -4642, 365 },
- { -3112, -4214, -5960, -823 },
- { -2467, -2510, -4858, 1467 },
- { -1561, -3399, -5822, 211 },
- { -775, -1081, -4424, 2636 },
- { -1263, 25, -6378, -1392 },
- { -3476, -366, -5417, -1393 },
- { -3176, -1476, -4149, 1466 },
- { -2479, 518, -4448, -257 },
- { -2992, 158, -4660, -1279 },
- { -1320, -3872, -4479, 1147 },
- { -1475, -312, -5318, 539 },
- { -3527, -1679, -5860, -1681 },
- { -3397, -3438, -5593, 1866 },
- { -4089, -2439, -4763, 1275 },
- { -748, -4513, -4687, -48 },
- { -2166, -4531, -4691, -2856 },
- { -2385, -853, -6035, -627 },
- { -1194, -4091, -4472, -1963 },
- { -682, -3234, -4084, -3033 },
- { -3255, -5015, -5328, -12 },
- { -2313, -3436, -4601, -155 },
- { -2792, -1038, -6947, -2019 },
- { -1244, -1526, -5771, -1882 },
- { -4679, -3731, -5506, 283 },
- { -3062, -66, -3558, -758 },
- { -4895, -1187, 4751, 3728 },
- { -7600, -2752, 3320, 4613 },
- { -5703, -2975, 3944, 2659 },
- { -4972, -1257, -246, 2952 },
- { -4221, -2487, 1702, 4295 },
- { -2900, -1529, 2458, 4935 },
- { -5061, 407, 2416, 4050 },
- { -6931, -3478, 2761, 2213 },
- { -6037, -3921, 3192, 1866 },
- { -6113, -811, 2407, 3782 },
- { -5878, -1716, 1207, 3478 },
- { -5953, -2853, 2207, 2712 },
- { -6807, -3223, 2749, 3595 },
- { -3272, -3157, 1389, 3788 },
- { -5368, -1904, 1980, 5077 },
- { -7235, -1398, 3075, 4548 },
- { -4765, -3487, 2755, 2796 },
- { -7658, -4435, 2694, 2582 },
- { -6997, -4282, 456, 3832 },
- { -5563, -3115, -63, 3713 },
- { -4244, -4220, 1450, 2767 },
- { -3801, -2194, 190, 4303 },
- { -5458, -4119, 1958, 2274 },
- { -7300, -3469, 3514, 3193 },
- { -4594, -2067, 775, 4752 },
- { -3389, -1654, 1464, 5412 },
- { -4845, -3483, 964, 3437 },
- { -6007, -2818, 1666, 4659 },
- { -8709, -5007, 1757, 3287 },
- { -5833, -4389, 1025, 3171 },
- { -5788, -1780, 3944, 3661 },
- { -4430, -920, 1938, 4753 },
- { -7066, -1857, 4591, 4538 },
- { -3549, -513, 1427, 5317 },
- { -7517, -1220, 2883, 3049 },
- { -7605, -2687, 1874, 2735 },
- { -8718, -4035, 2676, 3730 },
- { -7990, -3907, 1185, 2607 },
- { -6058, -1744, 3349, 5157 },
- { -5954, 565, 3161, 3250 },
- { -6478, -612, 1930, 2271 },
- { -6535, -1445, -2, 1618 },
- { -8963, -4151, 1192, 4044 },
- { -7227, -3570, 1600, 4234 },
- { -4674, 79, 595, 3015 },
- { -3974, 430, 2727, 5137 },
- { -5299, 9, 3714, 4779 },
- { -6779, -2699, -8, 2436 },
- { -7016, -1145, 1293, 2310 },
- { -6955, -3312, 1534, 1801 },
- { -4025, 740, 1850, 4054 },
- { -9589, -3460, 4154, 5270 },
- { -4404, -1181, 4298, 5173 },
- { -7356, -4583, -18, 2644 },
- { -6516, -1235, 4439, 6234 },
- { -3453, -301, 4344, 4464 },
- { -4643, 1530, 3315, 4340 },
- { -4575, -2557, 3754, 3682 },
- { -3643, -3501, 2051, 2997 },
- { -5412, -2475, 2301, 1579 },
- { -5846, 259, 1360, 2348 },
- { -5258, -1358, 1050, 838 },
- { -5542, -219, 6377, 5750 },
- { -5713, -2952, 922, 899 },
- { -2049, -1135, 5206, 1033 },
- { -1693, -1886, 4835, -106 },
- { -2344, -3504, 4232, -13 },
- { -2475, -2334, 5043, 1126 },
- { -787, -2549, 3880, 2138 },
- { -3159, -2341, 4830, 2887 },
- { -1780, -1009, 6240, 2061 },
- { -4327, -3363, 2818, 886 },
- { -3376, -2743, 4104, 207 },
- { -3250, -4640, 2718, 1498 },
- { -382, -1075, 4382, 3460 },
- { -2416, -4168, 3530, 816 },
- { -1756, -2708, 4861, 622 },
- { -1879, -2097, 5156, 2889 },
- { -2496, -2418, 3722, 2671 },
- { -2717, -3252, 3341, 1944 },
- { -4063, -4091, 3306, 267 },
- { -3549, -3808, 3747, 842 },
- { -2635, 546, 5794, 1894 },
- { -1857, -1121, 4383, 3964 },
- { -2226, -2166, 3489, 3678 },
- { -3492, -660, 5323, 1063 },
- { -3033, -3130, 4382, 1828 },
- { -2703, -625, 6369, 2851 },
- { -1656, -2842, 4584, -528 },
- { -4781, -2622, 4390, 2097 },
- { -413, -2045, 5081, 3035 },
- { -3810, -2662, 4532, 1095 },
- { -3144, -1858, 5215, 1880 },
- { -3562, -1795, 4928, 670 },
- { -4800, -1509, 5189, 1859 },
- { -1085, -3832, 4169, 900 },
- { -1969, -3270, 2857, 2878 },
- { -4267, -4140, 3176, 1805 },
- { -5145, -3727, 3524, 1168 },
- { -1346, -1876, 5501, 1748 },
- { -4998, -2945, 3699, 338 },
- { -3458, -3096, 3406, -635 },
- { -1751, -3209, 3508, 395 },
- { -2507, 170, 5987, 705 },
- { -3756, -1072, 5647, 3536 },
- { -2870, -1439, 5026, 3212 },
- { -3913, -3225, 3669, 2144 },
- { -3739, 226, 5747, 764 },
- { -2052, -820, 5266, 3093 },
- { -3214, -3820, 2409, 2391 },
- { -4398, -2588, 3501, -218 },
- { -4484, -1763, 4180, -198 },
- { -3368, -1525, 4362, -134 },
- { -2407, 224, 4905, 3533 },
- { -1369, -2937, 4728, 1788 },
- { -4848, -1707, 4159, 851 },
- { -3454, -1749, 4281, 3230 },
- { -1990, -3853, 3487, 1735 },
- { -3117, 92, 6155, 4075 },
- { -2676, -2472, 4078, -589 },
- { -1547, -2012, 2626, 1835 },
- { -4275, -588, 4824, 725 },
- { -601, -2249, 3736, 3548 },
- { -4060, -61, 5333, 3097 },
- { -4303, 7, 6551, 3054 },
- { -5003, -1029, 5786, 3319 },
- { -2810, -728, 5392, 199 },
- { -1232, -200, 5228, 3121 },
- { 2621, 165, -6255, 298 },
- { 3669, 537, -6844, 1564 },
- { 1598, -1190, -6235, 2523 },
- { 2164, -32, -6894, 1383 },
- { 853, -1597, -6069, 1449 },
- { 1377, -1661, -5266, 108 },
- { 2660, 48, -5172, -517 },
- { 1903, -391, -5677, 1010 },
- { 3792, 206, -5274, -11 },
- { 1239, 2776, -2929, 2721 },
- { 4071, 149, -7259, 3125 },
- { 1436, -480, -6156, -196 },
- { 1373, -1960, -5005, 3122 },
- { 3413, -1271, -5176, 3283 },
- { 3060, -68, -6495, 2238 },
- { 2700, -2075, -4681, 91 },
- { 2928, -1728, -5168, 1858 },
- { 4424, 828, -4471, 88 },
- { 2672, -2604, -4038, 2753 },
- { 5223, -123, -6749, 2295 },
- { 4237, -420, -5538, 1353 },
- { 4744, -1281, -4097, 4708 },
- { 1103, -2764, -4751, 2024 },
- { 3747, -1913, -3911, 3960 },
- { 2470, -1416, -5542, 615 },
- { 4847, -1354, -5334, 1733 },
- { 5336, 88, -7593, 4007 },
- { 2388, -2880, -4807, 1037 },
- { 4495, 1391, -5685, -139 },
- { 5253, 1637, -6450, 1533 },
- { 1199, 795, -5515, 1261 },
- { 1397, -1259, -4252, 3838 },
- { 746, 70, -6640, 604 },
- { 1584, 166, -4972, 3072 },
- { 380, -999, -5397, 2267 },
- { 2974, 1707, -3242, 5360 },
- { 5202, -403, -5453, 2832 },
- { 3718, -1731, -4760, 714 },
- { 4150, -975, -4792, 61 },
- { 2925, -818, -4841, 15 },
- { 5301, 577, -4006, 3259 },
- { 5265, 1986, -5679, 3028 },
- { 3752, 1928, -4509, 3729 },
- { 3278, 1925, -6370, 1247 },
- { 5107, 1721, -4853, 3127 },
- { 3279, 2982, -2515, 4005 },
- { 4622, 668, -6204, 759 },
- { 6034, 317, -5763, 4818 },
- { -558, 57, -3785, 2817 },
- { 4476, 1616, -3965, 4536 },
- { 5953, 2056, -8215, 2715 },
- { 4387, 2613, -7463, 868 },
- { 5834, 1088, -4736, 4924 },
- { 6473, -856, -6991, 4172 },
- { 4959, -293, -5162, 76 },
- { 2731, -843, -6119, 3847 },
- { 3245, 1202, -6833, 616 },
- { 2553, 1383, -3829, 3859 },
- { 4332, 2099, -3480, 3622 },
- { 2110, 2683, -2728, 3990 },
- { 876, 1167, -3290, 3466 },
- { 3991, 1709, -2410, 4077 },
- { 5105, 939, -2584, 3256 },
- { 4719, 688, -1566, 3040 },
- { -3632, 4335, 1266, -3303 },
- { -4956, 3207, 1312, -2806 },
- { -4669, 2627, 2663, -2435 },
- { -4282, 3708, 2303, -3038 },
- { -4536, 2297, -175, -3350 },
- { -5234, 2503, -139, -880 },
- { -3978, 1512, 1092, -3619 },
- { -4519, 4649, 1363, -2455 },
- { -5118, 3132, 1961, -1577 },
- { -5196, 3379, -182, -1378 },
- { -6420, 4486, 2397, -1993 },
- { -5030, 5046, 1292, -1118 },
- { -4559, 2573, -927, -1406 },
- { -3501, 3730, 691, -4930 },
- { -4364, 2758, 1007, -3909 },
- { -4026, 2839, -1559, -2340 },
- { -5037, 4053, 836, -1571 },
- { -4727, 5136, 1110, -3588 },
- { -5245, 2799, -999, -2164 },
- { -4954, 1501, 422, -3963 },
- { -5994, 2726, 1462, -2833 },
- { -5621, 5159, 2038, -2512 },
- { -4991, 2291, 1917, -3151 },
- { -5469, 4382, -148, -2978 },
- { -5858, 1983, 807, -2720 },
- { -4709, 3556, 952, -467 },
- { -2489, 2362, 1714, -4230 },
- { -4717, 5004, -1180, -3672 },
- { -5914, 3653, 1359, -1317 },
- { -5506, 2995, 780, -1059 },
- { -5287, 3945, 2480, -2293 },
- { -3849, 4358, 322, -1770 },
- { -3911, 3570, 252, -3185 },
- { -3660, 5128, 158, -3719 },
- { -4599, 3277, -503, -2727 },
- { -3673, 3760, -1252, -3339 },
- { -5161, 2337, 388, -1943 },
- { -3529, 2216, 2156, -3080 },
- { -4309, 4331, 1808, -1460 },
- { -4782, 3820, 480, -2504 },
- { -4166, 3544, -378, -1567 },
- { -5572, 2466, -418, -2909 },
- { -6096, 2930, 119, -1878 },
- { -5963, 3554, 1011, -2233 },
- { -6433, 4335, 935, -2930 },
- { -5004, 3314, -1352, -3430 },
- { -6042, 3463, -1008, -3940 },
- { -4671, 2214, -640, -5040 },
- { -2795, 3759, 1412, -3803 },
- { -3647, 4436, 729, -515 },
- { -3594, 1033, 56, -4148 },
- { -2908, 3027, 2889, -3485 },
- { -3338, 2234, 313, -4285 },
- { -3825, 4497, -561, -2634 },
- { -6167, 3012, -48, -3149 },
- { -4828, 3515, -969, -4475 },
- { -5789, 2757, -539, -4173 },
- { -2452, 3067, 564, -4249 },
- { -4921, 1358, 1331, -2889 },
- { -3127, 4239, -1045, -1523 },
- { -4780, 2326, -1118, -3446 },
- { -3908, 5546, 152, -2622 },
- { -6972, 2976, 337, -2809 },
- { -4839, 4613, -35, -4077 },
- { -1408, 4822, -1149, -4997 },
- { -981, 4979, -912, -6304 },
- { -2098, 5689, -888, -2878 },
- { -3343, 4814, -657, -4434 },
- { -2461, 3601, -967, -4869 },
- { -2652, 3944, 87, -5520 },
- { -1104, 6076, 174, -6407 },
- { 355, 5370, -1721, -5869 },
- { 1242, 4497, -1107, -5091 },
- { -89, 4002, -1491, -5182 },
- { 1059, 5693, -1591, -4905 },
- { 1323, 4682, -2078, -4768 },
- { 818, 3996, -549, -5468 },
- { -287, 4529, 929, -5543 },
- { -919, 5519, -2791, -2844 },
- { -1407, 5679, -3289, -3974 },
- { -189, 6530, -3547, -4002 },
- { -900, 7039, -3371, -4855 },
- { -2983, 7211, -363, -4835 },
- { -814, 6503, -104, -5106 },
- { -2386, 6896, 809, -4919 },
- { 845, 4492, 352, -6621 },
- { -1998, 7237, -1646, -4231 },
- { -3380, 6251, 471, -4577 },
- { -1908, 7059, 84, -5726 },
- { -340, 6346, -803, -6265 },
- { -2279, 5834, -47, -4633 },
- { -1532, 5286, -1748, -1901 },
- { -2757, 6188, -453, -3415 },
- { -1255, 6405, -2043, -6357 },
- { 918, 5581, -121, -5667 },
- { 1840, 5336, -821, -5034 },
- { -2475, 4992, -1825, -3104 },
- { -2413, 5606, -1789, -4298 },
- { 132, 5128, -2389, -4442 },
- { 223, 6400, -2653, -4742 },
- { -673, 5012, 680, -4582 },
- { -1657, 6624, -349, -3596 },
- { -755, 6289, -1860, -3978 },
- { -572, 6894, -1946, -5207 },
- { -1141, 4756, -2665, -5586 },
- { -1073, 4269, -431, -4030 },
- { 186, 5761, 916, -5868 },
- { -1907, 4836, 1017, -5106 },
- { -963, 3363, -1248, -6348 },
- { -3262, 4774, -1818, -5858 },
- { 847, 3812, -2538, -4302 },
- { -1223, 5903, 1360, -5479 },
- { -1094, 6923, -1244, -2381 },
- { 267, 6276, -709, -2846 },
- { -157, 5840, 1124, -4266 },
- { 889, 3206, -910, -5305 },
- { -1736, 3344, 582, -4838 },
- { -2357, 5676, -2695, -6277 },
- { -1916, 6901, -986, -5397 },
- { -3062, 6028, -695, -5687 },
- { 1836, 3566, -1357, -5226 },
- { -2176, 4938, 646, -3872 },
- { -2199, 3055, -208, -6124 },
- { -236, 3032, -821, -5325 },
- { -3989, 7277, -565, -3899 },
- { -595, 4362, 74, -5975 },
- { 684, 5874, -841, -4424 },
- { -2731, 6305, -2389, -5465 },
- { -5775, 1325, -56, -2528 },
- { -7029, -534, -1890, -3278 },
- { -5798, -15, -2734, -2210 },
- { -5504, -1198, -353, -3659 },
- { -5079, 960, -894, -4336 },
- { -6073, -36, -133, -3014 },
- { -5782, -259, -1025, -3986 },
- { -6843, 1262, -807, -1639 },
- { -5263, -918, -3290, -579 },
- { -4840, 461, -2158, -533 },
- { -6014, -50, -620, 504 },
- { -5843, 241, -1359, -282 },
- { -5898, 577, 769, -3271 },
- { -6833, -946, -466, -3347 },
- { -6026, 1459, -512, -729 },
- { -7361, 747, -388, -1110 },
- { -6391, 2142, -1160, -2513 },
- { -6995, 304, 498, -2673 },
- { -6757, 679, -386, -433 },
- { -5222, 1688, -1093, -1032 },
- { -5019, 575, 184, -3627 },
- { -4237, 628, -3507, -1243 },
- { -7479, -456, -1722, -1486 },
- { -6464, 713, -1273, -1153 },
- { -6255, 1682, -606, -3607 },
- { -7033, 1497, -71, -1955 },
- { -6694, 1556, -1721, -3214 },
- { -6114, -356, 813, -2575 },
- { -5308, 632, -1851, -1636 },
- { -5742, -911, -1733, 383 },
- { -6083, -387, -2313, -879 },
- { -6535, -530, -1505, -2083 },
- { -4896, 1223, -2750, -1816 },
- { -6392, -463, -3247, -2093 },
- { -5373, 1264, -2706, -3042 },
- { -3894, -1390, -1020, -891 },
- { -6179, 1168, -1966, -1922 },
- { -5162, 1668, -1617, -1916 },
- { -6453, 920, -1169, -2432 },
- { -6130, 2005, -536, -1519 },
- { -6552, -98, -518, -1938 },
- { -7528, 355, -1101, -1772 },
- { -5745, 610, -247, -1360 },
- { -7003, 177, -2064, -1958 },
- { -6956, -570, -2220, -4225 },
- { -7830, 791, -1394, -2774 },
- { -7634, 480, -3171, -4224 },
- { -7913, 1154, -350, -2381 },
- { -5063, 1704, -1804, -2977 },
- { -4887, -524, -2703, 188 },
- { -5551, 406, -1620, -3063 },
- { -7109, 1342, 381, -3021 },
- { -6846, 631, -458, -3398 },
- { -4606, -605, 11, -3930 },
- { -8134, -225, -1738, -2648 },
- { -7043, 402, -2734, -3059 },
- { -7417, 1825, -2545, -4389 },
- { -6971, -236, -1031, -665 },
- { -5752, 2111, -1632, -3808 },
- { -7660, -78, -624, -3135 },
- { -6358, 619, -1951, -3911 },
- { -8134, 408, -1935, -3695 },
- { -6335, 1911, -2368, -4505 },
- { -7116, 2163, -344, -2753 },
- { 2357, 4488, 2220, -5682 },
- { 1385, 3206, 2300, -5305 },
- { 1419, 2557, 5203, -3516 },
- { 262, 4315, 3920, -1847 },
- { 3316, 3187, 1612, -5609 },
- { 1729, 2350, 1673, -6068 },
- { 1603, 6126, 1467, -2839 },
- { -1339, 3316, 3691, -3530 },
- { -563, 4618, 3180, -4548 },
- { 463, 4624, 3111, -5614 },
- { 1246, 5455, 3356, -5720 },
- { 480, 2149, 5422, -2893 },
- { 1768, 4827, 913, -5579 },
- { -149, 5381, 4366, -3297 },
- { 985, 3672, 2644, -92 },
- { -258, 2911, 5817, -2213 },
- { 3428, 3289, 3351, -3541 },
- { -666, 3295, 4727, -2869 },
- { 35, 6641, 4160, -4052 },
- { 623, 6787, 3156, -4560 },
- { 2654, 4360, 4676, -4632 },
- { 1386, 5246, 4834, -4497 },
- { 3488, 4574, 3856, -5946 },
- { 383, 4481, 4168, -4110 },
- { 1753, 3652, 4288, -3326 },
- { 1344, 4905, 2508, -4660 },
- { 1580, 4106, 3104, -2224 },
- { 2027, 5038, 1683, -1554 },
- { 446, 3699, 5872, -3013 },
- { 4637, 4087, 3578, -5018 },
- { 2629, 3560, 5331, -4900 },
- { 1527, 6674, 2523, -4131 },
- { -1437, 2804, 2528, -4464 },
- { -229, 3355, 2016, -5537 },
- { 3666, 3418, 4374, -4581 },
- { 1192, 3799, 923, -6596 },
- { 2040, 2956, 448, -5322 },
- { 2468, 5768, 4029, -5869 },
- { 3438, 6516, 3529, -6667 },
- { 2737, 5495, 680, -5535 },
- { 3896, 5727, 1801, -4958 },
- { 4988, 4957, 3592, -6518 },
- { -542, 4416, 5794, -2787 },
- { 4136, 4354, 2064, -4696 },
- { 3067, 5936, 1207, -3396 },
- { 2789, 4966, 2405, -3854 },
- { 1731, 3270, 3251, -1063 },
- { 1767, 5537, 2084, -2349 },
- { 465, 3116, 4532, -837 },
- { 1499, 2627, 4610, -2212 },
- { 122, 3095, 3642, -3552 },
- { 2542, 2866, 2705, -6402 },
- { 3134, 4323, 698, -4785 },
- { 731, 1859, 3112, -5242 },
- { 2553, 2980, 3241, -4846 },
- { 1329, 5310, 1607, -6624 },
- { 2468, 1858, 3476, -1034 },
- { -172, 4996, 2000, -5562 },
- { 2621, 4220, 1574, -3386 },
- { -333, 1832, 3362, -4117 },
- { 2169, 6762, 3065, -6225 },
- { 2844, 5528, 3223, -4765 },
- { 526, 5175, 1644, -4267 },
- { 2922, 4426, 2414, -2610 },
- { 452, 1399, -4516, -2636 },
- { 2872, 1720, -4667, -1435 },
- { 1279, 702, -5424, -1984 },
- { 2187, 870, -5021, -1341 },
- { 583, -144, -4628, -2464 },
- { 3, 2237, -5284, -2827 },
- { -19, 1005, -5460, -1819 },
- { 2897, 2084, -5885, -515 },
- { -400, 3370, -5527, -2947 },
- { 1505, 2593, -5518, -1802 },
- { 1341, 4534, -5094, -1899 },
- { 3241, 3670, -5493, -1252 },
- { -1287, 921, -5994, -1675 },
- { 627, 408, -6652, -364 },
- { -260, 1127, -4849, -3247 },
- { 371, 3400, -5976, -2285 },
- { 1533, 1566, -6373, -610 },
- { 2462, 4274, -6184, -1254 },
- { 1782, 3363, -6222, -1381 },
- { 572, 4650, -5673, -2754 },
- { 2674, 3414, -4460, -2154 },
- { 3614, 3820, -6883, -398 },
- { 1136, -1, -5511, -1112 },
- { -1773, 1137, -5647, -2377 },
- { -753, 2104, -6085, -2565 },
- { -204, 3025, -4731, -1418 },
- { -1486, 1438, -4380, -216 },
- { 302, 858, -5786, -264 },
- { 3486, 1495, -5234, -783 },
- { 888, 2327, -3423, -3720 },
- { -259, 772, -6596, -1311 },
- { -1197, 2073, -5174, -1826 },
- { 1500, 3470, -4462, -2645 },
- { 3072, 1960, -3277, -2264 },
- { 1841, 952, -4324, -2340 },
- { 1994, 2200, -3940, -2923 },
- { -1782, 1699, -4667, -1075 },
- { -1464, 2906, -3468, -375 },
- { 366, 2380, -3747, 1467 },
- { -545, 1645, -4619, 376 },
- { 1724, 2350, -2374, -3512 },
- { 3184, 2628, -2996, -3275 },
- { 734, 2010, -6239, -1479 },
- { 524, 3756, -4496, -3263 },
- { 1492, 3570, -3494, -3600 },
- { -932, 618, -5389, -2894 },
- { -133, 2161, -4083, -3267 },
- { 786, 774, -3279, -3731 },
- { 1078, 803, -3843, -3007 },
- { -332, 3405, -3347, 40 },
- { -17, 6, -4005, -3690 },
- { -189, 4372, -4488, -2561 },
- { -450, 3846, -3790, -1370 },
- { 362, 2212, -5272, -15 },
- { -1529, 791, -6802, -2296 },
- { 2145, 4241, -4474, 376 },
- { 1813, 2426, -2932, -2726 },
- { -542, 4557, -3140, -1080 },
- { 1192, 3784, -4371, -20 },
- { 2784, 5188, -6399, -1394 },
- { 431, 4561, -3673, -1398 },
- { 1382, 3096, -4083, 1253 },
- { 1209, 4224, -2930, 1500 },
- { 2798, 2684, -6676, -606 },
- { -2396, 1510, -5381, -2713 },
- { -2625, 2542, -4032, -2880 },
- { -1231, 3967, -4098, -2886 },
- { -1393, 2374, -3862, -4525 },
- { -2495, 1665, -1637, -5445 },
- { -3854, 1759, -1750, -4944 },
- { -2373, 1668, -2856, -6251 },
- { -2668, 1981, -886, -4557 },
- { -2927, 4427, -3451, -6172 },
- { -1925, 2596, -4696, -2527 },
- { -3202, 2847, -3928, -5896 },
- { -3332, 1665, -5025, -3412 },
- { -3212, 3115, -4155, -4062 },
- { -1013, 3205, -5133, -3751 },
- { -2022, 4595, -3947, -5611 },
- { -3556, 1755, -3715, -2300 },
- { -1784, 4114, -2723, -1773 },
- { -3586, 4081, -2733, -4942 },
- { -1608, 3685, -4154, -4573 },
- { -3368, 4042, -4452, -6227 },
- { -1407, 3881, -5729, -3719 },
- { -2751, 3281, -5077, -4999 },
- { -3791, 2410, -4906, -5288 },
- { -730, 2303, -4217, -3755 },
- { -1812, 2311, -5492, -3709 },
- { -610, 4336, -3915, -3783 },
- { -2841, 4337, -4278, -4430 },
- { -1662, 4666, -4661, -3964 },
- { -589, 5209, -4923, -3682 },
- { -4155, 2234, -4076, -4218 },
- { -3951, 2770, -2665, -2805 },
- { -2302, 3228, -3717, -1908 },
- { -3129, 4373, -2264, -2851 },
- { -447, 1363, -3578, -4323 },
- { -2648, 4237, -3159, -3071 },
- { -4072, 3241, -3541, -4605 },
- { -4507, 3458, -2339, -3838 },
- { -1646, 997, -4926, -3970 },
- { -3025, 1614, -3940, -1242 },
- { -1337, 1756, -3163, -5529 },
- { -3203, 1865, -3282, -4354 },
- { -1646, 2118, -2203, -6018 },
- { 174, 1871, -2707, -4639 },
- { -2607, 1485, -4778, -4750 },
- { -2199, 3991, -3134, -4879 },
- { -2962, 3323, -2816, -2419 },
- { -5286, 2495, -4548, -5395 },
- { -2810, 3710, -2274, -4211 },
- { -330, 3006, -2993, -4678 },
- { -1187, 2411, -2743, -5196 },
- { -664, 4033, -3101, -5641 },
- { -1458, 3602, -2816, -5371 },
- { -4116, 4923, -3321, -5630 },
- { -4165, 2528, -2592, -4798 },
- { -2759, 3080, -2333, -5719 },
- { -5157, 3011, -5526, -6348 },
- { -3095, 2126, -5881, -4234 },
- { -4377, 3849, -3600, -6099 },
- { -1994, 4947, -5235, -4753 },
- { -1067, 600, -3258, -5133 },
- { -4992, 3302, -2208, -5051 },
- { -3377, 2981, -1655, -4815 },
- { -3325, 2446, -1787, -6116 },
- { -2341, 2737, -3240, -6347 },
- { -2258, -3732, 3710, -1235 },
- { -1558, -3849, 2694, -3012 },
- { -599, -4837, 3050, -2951 },
- { -2246, -5433, 2798, -1910 },
- { -2255, -4989, 3260, 270 },
- { -3026, -5353, 2693, -1036 },
- { -1151, -6097, 1097, -3782 },
- { -3391, -6012, 2130, -1303 },
- { -2850, -4422, 3375, -480 },
- { -1138, -3779, 1491, -4162 },
- { -551, -3892, 3787, -2082 },
- { -3221, -3676, 3144, -1202 },
- { -3023, -5196, 2650, 605 },
- { -1756, -5729, 2646, 321 },
- { -2693, -4409, 494, -4797 },
- { -1913, -4573, 3372, -1730 },
- { -1277, -3604, 4061, -993 },
- { -420, -4993, 1351, -4796 },
- { -3052, -5333, 1435, -1242 },
- { -602, -5034, 3869, -1141 },
- { -2436, -4680, 1665, -3019 },
- { -2657, -3658, 1459, -3391 },
- { -1220, -6246, 2749, -525 },
- { -3838, -4844, 2265, -1735 },
- { -1247, -5679, 3356, -1417 },
- { -917, -5448, 3342, 105 },
- { -1756, -6839, 2276, -2350 },
- { -412, -5206, 1764, -3539 },
- { -1439, -6915, 1442, -3750 },
- { -1381, -4439, 3863, -282 },
- { -3482, -4953, 2726, -336 },
- { -1376, -5931, 1714, -1987 },
- { -1716, -4405, 2608, 105 },
- { -1590, -5191, 2652, -2704 },
- { -2149, -6442, 2453, -1263 },
- { -3426, -3832, 2334, -1829 },
- { -2747, -5948, 2362, -173 },
- { -2435, -3267, 2966, -1710 },
- { -3979, -4282, 2705, -775 },
- { -356, -4238, 2544, -4343 },
- { -1363, -6471, 2817, -1836 },
- { -2878, -5117, 218, -3149 },
- { -3539, -5196, 1710, -2356 },
- { -2888, -4537, 2746, -1701 },
- { -1870, -4439, 1496, -4121 },
- { -1486, -3388, 3349, -2145 },
- { -3333, -4138, 1467, -2876 },
- { -345, -5340, 1012, -1190 },
- { -1672, -4992, 2289, -1029 },
- { -2146, -5528, 3038, -635 },
- { -316, -3656, 3426, -3152 },
- { -2695, -5812, 2336, -2050 },
- { -2067, -6052, 737, -3258 },
- { -2664, -4205, -350, -1266 },
- { -617, -5406, 80, -4853 },
- { -2418, -3825, 1853, -1326 },
- { -1961, -4339, 583, -4315 },
- { -1495, -5141, -133, -5205 },
- { -3208, -6440, 1691, -2069 },
- { -2632, -3633, 2325, -2761 },
- { -2624, -5670, 1252, -3676 },
- { -3687, -5608, 687, -2833 },
- { -3320, -5707, 16, -3877 },
- { -2738, -6112, 84, -5135 },
- { 2277, -5661, 3076, 843 },
- { 1555, -5769, 2821, -5236 },
- { 536, -6381, 603, -4910 },
- { 734, -4609, 3314, -4092 },
- { 1836, -4547, 3267, -4322 },
- { -13, -5976, 3752, -1607 },
- { 1423, -6318, 2336, 398 },
- { 365, -7779, 1498, -534 },
- { 2104, -8366, 2946, -1345 },
- { 143, -5545, 1898, -3756 },
- { 655, -6852, 1430, 148 },
- { 4, -6653, 2397, -59 },
- { 2346, -5996, 4562, -934 },
- { 1229, -7104, 2963, -598 },
- { -528, -7048, 2887, -1790 },
- { 1451, -6857, 3900, -1637 },
- { 554, -6018, 3336, 9 },
- { 3278, -5758, 4034, 129 },
- { 3541, -7145, 4905, -1575 },
- { 2339, -6907, 3464, -301 },
- { 2775, -7301, 1667, -3894 },
- { 539, -7887, 991, -4156 },
- { 2115, -7421, 3131, -3075 },
- { 2803, -8546, 2564, -5836 },
- { 2869, -5833, 1620, -4561 },
- { 2591, -7281, 3215, -4719 },
- { -1228, -8477, 706, -4782 },
- { 1967, -5243, 4813, -1940 },
- { 701, -7010, 2273, -3893 },
- { 915, -8470, 1918, -5620 },
- { -94, -6715, 156, -3873 },
- { 1074, -5607, 4389, -1017 },
- { 2739, -6551, 1227, -3521 },
- { 725, -7835, 2701, -1291 },
- { -493, -7475, 2263, -1075 },
- { -412, -6508, 2984, -744 },
- { 665, -5451, 3725, -2692 },
- { 1499, -8129, 3564, -2072 },
- { 2870, -6333, 4487, -2108 },
- { 706, -5007, 3911, -152 },
- { -482, -8660, 1483, -2900 },
- { 2481, -6596, 2518, -1715 },
- { 1403, -6414, 1398, -5387 },
- { 652, -6267, 583, -5942 },
- { 694, -7540, 646, -6272 },
- { 2275, -7614, 256, -5015 },
- { 1416, -9727, 1900, -3153 },
- { 2760, -6433, 3875, -3771 },
- { 2325, -11196, 2182, -5155 },
- { 1223, -11061, 1377, -5097 },
- { 108, -10603, 307, -4952 },
- { -118, -8268, 1650, -1572 },
- { 1839, -7943, 1755, -612 },
- { 2501, -9056, 981, -2969 },
- { 2902, -8476, 1491, -5780 },
- { 1995, -11175, 1585, -3643 },
- { 696, -8212, 828, -2474 },
- { 1526, -8649, 1380, -1210 },
- { 461, -7253, 3222, -2229 },
- { 2966, -8641, 4121, -3271 },
- { 833, -6039, 2361, -1086 },
- { 3565, -7312, 1980, -5427 },
- { 2850, -8671, 3760, -1846 },
- { 2643, -7281, 2163, -173 },
- { 3463, -3706, -3132, -923 },
- { 1315, -3825, -3443, 2 },
- { 2594, -4083, -3815, 670 },
- { 1826, -4291, -2741, -155 },
- { 868, -3749, -4175, -298 },
- { 2008, -4237, -3897, -517 },
- { 1242, -3493, -4335, -1335 },
- { -88, -4142, -3390, -1529 },
- { 2176, -3488, -3822, -975 },
- { 1706, -5188, -3415, -637 },
- { 2717, -6159, -2333, -882 },
- { 1276, -3978, -4361, 537 },
- { 2471, -5556, -2866, -208 },
- { 799, -4673, -4086, 56 },
- { 1901, -4786, -3533, 270 },
- { 3036, -3902, -3606, -333 },
- { 2249, -3317, -4319, -144 },
- { 2594, -4207, -2105, -2930 },
- { 4008, -4774, -2626, -902 },
- { 1038, -3659, -3496, -2454 },
- { 2725, -3597, -3298, -1535 },
- { 1662, -5803, -2813, 175 },
- { 705, -3757, -3441, -1484 },
- { 1860, -5987, -2821, -886 },
- { 3786, -4918, -2199, -1929 },
- { 3683, -4235, -2547, -1287 },
- { 2531, -4896, -2956, -1593 },
- { 1005, -5585, -3324, -180 },
- { 1625, -5229, -1756, -3642 },
- { 1494, -5041, -2989, -2685 },
- { 2718, -4655, -3224, -867 },
- { 2374, -6640, -1745, -2975 },
- { 2133, -6436, -2477, -1499 },
- { 1833, -4418, -3523, -1512 },
- { 1128, -4910, -2658, -1106 },
- { 689, -4777, -2831, -2085 },
- { 3593, -5280, -2627, -315 },
- { 3264, -3771, -2673, -1861 },
- { 3202, -5602, -2409, 402 },
- { 552, -4618, -2221, -3002 },
- { 3095, -5356, -2666, -1083 },
- { 3401, -4609, -3146, 45 },
- { 3051, -4662, -2192, -2232 },
- { 2798, -5552, -2462, -1941 },
- { 2354, -5815, -2223, -2619 },
- { 192, -3708, -2807, -2658 },
- { 1886, -4226, -1862, -3529 },
- { 2526, -3976, -2819, -2332 },
- { 1577, -3870, -2711, -2806 },
- { 1288, -5588, -3382, -1403 },
- { 2711, -5399, -1564, -3253 },
- { 1459, -5492, -2222, -322 },
- { 2823, -5091, -2886, 776 },
- { 3559, -5821, -2109, -1360 },
- { 1587, -6331, -2760, -1909 },
- { 2139, -5213, -2874, -2120 },
- { 1318, -4337, -3695, -2098 },
- { 821, -4471, -1849, -565 },
- { 3329, -4782, -1725, -89 },
- { 582, -4914, -4105, -1119 },
- { 417, -4144, -4072, -2529 },
- { -199, -3803, -2765, -4042 },
- { 2731, -4283, -2143, 1 },
- { 2911, -6187, -1951, -2116 },
- { 1573, -6094, -493, -2838 },
- { 2081, -6927, -864, -3211 },
- { 1058, -7826, 79, -364 },
- { 3147, -5570, -684, -978 },
- { 3572, -5856, 1060, 1824 },
- { 1143, -6702, -1478, 338 },
- { 2341, -7220, -88, 260 },
- { 3639, -6861, 668, 815 },
- { 2227, -6268, -1706, 446 },
- { 3390, -6082, -353, 1302 },
- { 1123, -7556, -1237, -430 },
- { 1729, -7742, 729, -218 },
- { 1457, -6774, 587, 579 },
- { 505, -6919, -569, 371 },
- { 1106, -7245, 78, 158 },
- { 2755, -6745, -1122, 338 },
- { 3069, -6040, -1415, 986 },
- { 2174, -7064, -1430, -283 },
- { 1390, -8626, -446, -3031 },
- { 3534, -6890, -431, 547 },
- { 2267, -9618, 475, -2994 },
- { 3672, -7673, 75, -115 },
- { 2131, -7560, -1206, -750 },
- { 2972, -7477, -685, -262 },
- { 1604, -6637, -672, 699 },
- { 1666, -7577, -577, -240 },
- { 1591, -6554, -2158, -94 },
- { 2348, -6286, -353, 1123 },
- { 2017, -8810, -412, -1805 },
- { 2892, -6713, -1765, -554 },
- { 2500, -6828, -1995, -1197 },
- { 3877, -6639, -224, -1655 },
- { 2392, -7872, -91, -333 },
- { 3562, -7370, -532, -2836 },
- { 2552, -7614, 164, -1805 },
- { 990, -6104, 218, 438 },
- { 910, -7861, 312, -1195 },
- { 1472, -6327, 372, -640 },
- { 1576, -7143, -1983, -843 },
- { 422, -7625, -457, -278 },
- { 1797, -8532, 405, -1011 },
- { 1088, -7396, -238, -2277 },
- { 3209, -6753, -1431, -2072 },
- { 2617, -6839, 100, -2573 },
- { 2575, -8573, -387, -3188 },
- { 3618, -6971, -1190, -321 },
- { 2205, -7361, -1695, -2008 },
- { 2985, -6297, 1464, 1179 },
- { 2804, -7310, 1053, 338 },
- { 1362, -6074, -1163, -840 },
- { 3336, -6325, -1794, 21 },
- { 2836, -8109, 818, -329 },
- { 2791, -5879, 560, 1546 },
- { 2392, -6064, 135, 100 },
- { 1838, -6194, 596, 1085 },
- { 1926, -7515, -414, -4901 },
- { 3225, -7298, -1202, -1189 },
- { 3960, -7558, -659, -719 },
- { 3442, -6647, -1692, -1095 },
- { 3381, -6441, 262, -886 },
- { 1431, -8150, -1186, -1406 },
- { 340, -8498, -150, -899 },
- { 3004, -8149, -260, -953 },
- { 2749, -6611, 563, 873 },
- { -6647, -1325, -4517, -4691 },
- { -6005, -1657, -4089, -3797 },
- { -3157, 588, -5213, -3068 },
- { -3311, -1425, -6329, -3726 },
- { -5866, -819, -3857, -2744 },
- { -5001, -1799, -1075, -4621 },
- { -5330, -2650, -2672, -4664 },
- { -4930, -539, -2363, -4010 },
- { -2984, 10, -3863, -5749 },
- { -1055, -2106, -3713, -4267 },
- { -5476, -502, -4279, -6504 },
- { -5231, -1543, -5018, -6425 },
- { -5134, -363, -3165, -5109 },
- { -3953, -771, -4107, -6393 },
- { -2159, -563, -3652, -5342 },
- { -3888, -2321, -919, -5057 },
- { -1236, -597, -4235, -4193 },
- { -4053, 675, -3083, -6174 },
- { -2793, -1089, -5396, -3460 },
- { -3000, -44, -2209, -6575 },
- { -3336, -1531, -4313, -5160 },
- { -2127, 128, -4851, -3692 },
- { -3321, 136, -2067, -5660 },
- { -5215, 1404, -4374, -4356 },
- { -2747, 400, -6340, -3691 },
- { -3926, -599, -5361, -5006 },
- { -2875, -2592, -5143, -4092 },
- { -4991, -1958, -5322, -4891 },
- { -4965, -1318, -6652, -5333 },
- { -4920, -1691, -3388, -5561 },
- { -3644, -3354, -2688, -5982 },
- { -5076, -919, -4563, -2984 },
- { -6114, 250, -3884, -3915 },
- { -4014, 744, -3973, -1924 },
- { -5543, -1041, -5557, -3847 },
- { -4711, -1352, -5649, -2603 },
- { -3362, 775, -5305, -4879 },
- { -5001, 107, -3554, -2888 },
- { -6258, -1651, -6356, -6566 },
- { -4529, 407, -5003, -3865 },
- { -5154, 550, -5278, -5465 },
- { -4195, -467, -1894, -3129 },
- { -5022, 1127, -3349, -3314 },
- { -6075, 1250, -4313, -5641 },
- { -2677, -2283, -2312, -5903 },
- { -4113, 193, -1195, -4833 },
- { -3940, -1048, -1389, -5079 },
- { -3703, 917, -4043, -4451 },
- { -3366, -4231, -1534, -5488 },
- { -3326, -3583, -2091, -4903 },
- { -5144, 1254, -2532, -4949 },
- { -5982, -870, -2545, -4555 },
- { -3925, -157, -5367, -2281 },
- { -6419, -746, -5668, -4371 },
- { -5787, 518, -7096, -5805 },
- { -4258, 954, -6453, -4321 },
- { -4771, -695, -4158, -1639 },
- { -7078, -760, -5195, -5877 },
- { -7348, 83, -4101, -4586 },
- { -2430, 184, -2874, -1679 },
- { -2284, -3943, -2924, -5034 },
- { -1804, -1785, -3002, -4710 },
- { -4399, -2772, -1815, -4637 },
- { -6340, -2626, -2824, -5191 },
- { -4998, -5168, -3480, 1905 },
- { -3958, -5492, -1599, 1579 },
- { -2471, -3755, -276, 3182 },
- { -3033, -5779, -1063, 1554 },
- { -2936, -4829, -1290, 2386 },
- { -1835, -5073, -3051, 1299 },
- { -1724, -3771, -3935, 2324 },
- { -5070, -2550, -3692, 768 },
- { -4326, -5333, -297, 1878 },
- { -3472, -5619, -3094, 992 },
- { -3027, -4384, -3038, 2265 },
- { -3201, -5332, 67, 2200 },
- { -1681, -4373, -1947, 2461 },
- { -3221, -3329, -4238, 2564 },
- { -1262, -2968, -2915, 3227 },
- { -3419, -1878, -3373, 2110 },
- { -2244, -5583, -2012, 1288 },
- { -1971, -5266, -990, 1812 },
- { -2975, -2778, -452, 4063 },
- { -2198, -1165, -3298, 2965 },
- { -4782, -4894, -4767, 664 },
- { -6002, -3950, -2806, 2025 },
- { -3142, -3162, -2859, 3295 },
- { -3262, -3340, -4123, 1596 },
- { -4014, -3918, -1955, 3361 },
- { -1700, -3463, -1346, 3449 },
- { -4245, -4445, -4743, 1644 },
- { -4180, -3969, -401, 3281 },
- { -2782, -5240, -4117, 1156 },
- { -5744, -4040, -1439, 3470 },
- { -5063, -4663, -323, 3172 },
- { -4531, -3319, -844, 3988 },
- { -6226, -5125, -2064, 2976 },
- { -3115, -3267, -1531, 3898 },
- { -4628, -4421, -2864, 2808 },
- { -4559, -2989, -3442, 2024 },
- { -1775, -4487, -656, 2477 },
- { -2664, -1865, -1884, 4081 },
- { -1828, -2575, -3894, 3378 },
- { -6441, -3677, -2025, 1677 },
- { -4141, -2156, -1191, 3474 },
- { -4802, -1623, -1727, 2160 },
- { -5474, -2745, -1475, 2498 },
- { -3664, -1056, -1975, 2491 },
- { -4672, -3062, -2235, 2933 },
- { -4205, -5960, -2849, 1517 },
- { -4995, -5708, -1739, 1805 },
- { -4892, -6080, -4793, 872 },
- { -4270, -4172, -4263, 2185 },
- { -4687, -1470, -2905, 1023 },
- { -6446, -5017, -3919, 1000 },
- { -6046, -5538, -3943, 2006 },
- { -6028, -3750, -3953, 771 },
- { -5959, -4582, -5024, 824 },
- { -5818, -2576, -2249, 1326 },
- { -5659, -5345, -1119, 2500 },
- { -3346, -4155, 606, 2749 },
- { -5680, -4827, -2501, 1838 },
- { -6193, -2543, -1295, 840 },
- { -6871, -4925, -3512, 1801 },
- { -5605, -1788, -1895, 779 },
- { -3922, -5712, -4644, 510 },
- { -4745, -3869, -4533, 99 },
- { -2984, -4907, -399, 1497 },
- { 1847, -478, 3061, -5812 },
- { 4450, -1116, 3609, -6570 },
- { 3139, 99, 3007, -5532 },
- { 2590, -3782, 3138, -4770 },
- { 1881, 1204, 5778, -3404 },
- { 3631, 2060, 5566, -5038 },
- { 3461, 1961, 5167, -3800 },
- { 2947, 273, 4536, -4389 },
- { 4453, -1730, 5788, -4370 },
- { 4032, 1805, 2666, -4534 },
- { 3487, -944, 2313, -6028 },
- { 1313, 34, 4210, -4067 },
- { 5632, -1502, 5825, -5855 },
- { 7736, -547, 4879, -5476 },
- { 4906, -1512, 4760, -5760 },
- { 3843, 447, 1091, -4958 },
- { 2982, -1135, 5442, -4386 },
- { 3579, 271, 3031, -6770 },
- { 3932, -211, 4688, -5507 },
- { 4411, 1720, 2387, -5584 },
- { 5379, -479, 4575, -6280 },
- { 3613, -362, 2012, -4885 },
- { 3744, -2013, 4493, -5073 },
- { 5693, 109, 4379, -3362 },
- { 5475, -621, 5317, -3985 },
- { 6411, -673, 5708, -4752 },
- { 4933, -796, 7262, -4290 },
- { 2804, 444, 6276, -3655 },
- { 4120, -517, 6078, -4531 },
- { 5119, 841, 3486, -3910 },
- { 4738, 1539, 3525, -2970 },
- { 5086, 370, 5895, -5640 },
- { 4235, 2716, 4589, -5044 },
- { 3691, 682, 6199, -4700 },
- { 6111, -570, 6271, -6528 },
- { 2611, 1277, 3756, -4802 },
- { 4395, 970, 3807, -5879 },
- { 5225, 2299, 3242, -4333 },
- { 5144, 1778, 4946, -5545 },
- { 2989, -3016, 3247, -5495 },
- { 2983, 920, 2071, -6059 },
- { 5270, -903, 4434, -2350 },
- { 6415, -585, 3970, -3554 },
- { 3866, -197, 5216, -2884 },
- { 3767, -1298, 6702, -3315 },
- { 6299, 2620, 5284, -6824 },
- { 6654, 646, 3653, -4927 },
- { 4770, 3047, 5160, -6287 },
- { 5364, 434, 2919, -5207 },
- { 2998, 1344, 4801, -2456 },
- { 3896, 1013, 3773, -1864 },
- { 2115, 655, 2999, -6344 },
- { 5170, -981, 2849, -4464 },
- { 2735, -2159, 2717, -5776 },
- { 2430, -1952, 4392, -4559 },
- { 6143, -1180, 3659, -4746 },
- { 4978, -1483, 1726, -4875 },
- { 3486, -2383, 3306, -4301 },
- { 1434, -1372, 4171, -4770 },
- { 3354, -2627, 1525, -5093 },
- { 6790, 2386, 3995, -5909 },
- { 1475, -2674, 3451, -4204 },
- { 1999, -3494, 3693, -5556 },
- { 4764, -2848, 2856, -5589 },
- { -3677, 5131, 2827, -2934 },
- { -2844, 7078, 2852, -3580 },
- { -3902, 6434, 4118, -1911 },
- { -1769, 7530, 3492, -3541 },
- { -1937, 5679, -447, -1127 },
- { -2456, 4680, 4196, -2407 },
- { -2778, 8241, 1698, -4288 },
- { -2876, 6104, 5182, -2387 },
- { -2802, 7341, 4463, -2938 },
- { -1025, 6267, 4752, -3201 },
- { -2349, 5413, 2041, -3794 },
- { -2252, 8225, 2856, -4269 },
- { -1465, 4967, 4976, -2500 },
- { -636, 7565, 3517, -4233 },
- { -1905, 5618, 3904, -2942 },
- { -302, 6816, 3343, -3316 },
- { -2210, 4156, 2817, -3511 },
- { -717, 6568, 1863, -2951 },
- { -3873, 5682, 2164, -575 },
- { -2878, 5835, 440, -2597 },
- { -3228, 7701, 2610, -2514 },
- { -3608, 8888, 3377, -2468 },
- { -2582, 9717, 2519, -3126 },
- { -5238, 6202, 2866, -2831 },
- { -3428, 7370, 3056, -335 },
- { -1681, 8836, 1210, -2010 },
- { -3276, 6724, 1156, -3930 },
- { -894, 8149, 827, -1258 },
- { -2965, 8631, 2549, -1320 },
- { -3961, 6902, 3581, 55 },
- { -1894, 7745, 1750, -841 },
- { -821, 6844, 850, -676 },
- { -608, 6948, -4, -1376 },
- { 615, 6524, 1089, -1147 },
- { -2972, 5668, 1091, -489 },
- { -157, 4649, 2904, -413 },
- { 673, 5121, 1498, -66 },
- { -390, 5902, 1611, -245 },
- { -2349, 5478, 4772, -1320 },
- { 88, 6798, 1972, -1859 },
- { -1213, 5120, 2991, 200 },
- { -2347, 6040, 2839, 376 },
- { -578, 5976, 3364, -1796 },
- { -1391, 5872, 3002, -965 },
- { -564, 4496, 3946, -1186 },
- { -2299, 6386, 3135, -2176 },
- { -2131, 5641, 2011, 1223 },
- { -772, 5807, 1124, 895 },
- { -2837, 6758, 2297, -740 },
- { -3091, 6298, 1415, -2126 },
- { -4197, 6036, 1843, -3022 },
- { -41, 6459, 92, 344 },
- { -2241, 6860, 2095, -4396 },
- { -1931, 7088, 2117, -2135 },
- { -2375, 4422, 1688, -3169 },
- { -1742, 6674, 1538, -119 },
- { -4818, 7749, 4192, -1577 },
- { -2004, 5672, 193, -430 },
- { -3825, 6042, 2128, -1898 },
- { -1108, 8033, 2119, -3013 },
- { -2370, 5453, 1721, 266 },
- { -1570, 7134, 614, -2638 },
- { -1519, 8752, 3503, -4330 },
- { -2050, 3845, 2907, -1126 },
- { 5085, 4412, -335, -1923 },
- { 3618, 1423, -613, -4012 },
- { 4481, 3729, 589, -4631 },
- { 4270, 3216, -1763, -3168 },
- { 4241, 1796, -1701, -2796 },
- { 4787, 2338, -487, -3639 },
- { 2915, 3429, -621, -4753 },
- { 5175, 1660, -1265, -3223 },
- { 4280, 4057, -684, -4079 },
- { 4980, 4419, -1455, -2719 },
- { 5436, 2464, 387, -4197 },
- { 4507, 4018, 1121, -3314 },
- { 6020, 2401, -413, -3201 },
- { 4200, 3789, -333, -2813 },
- { 5229, 2493, -1194, -1878 },
- { 5851, 2695, -492, -2292 },
- { 5743, 3288, -697, -1221 },
- { 5692, 2612, 979, -2227 },
- { 5085, 2067, 1046, -1214 },
- { 3163, 2240, -2098, -3435 },
- { 5228, 1898, 145, -2397 },
- { 5860, 3976, -418, -2872 },
- { 6008, 3399, 1027, -3506 },
- { 4126, 2035, 1865, -893 },
- { 5375, 3596, 511, -2362 },
- { 1937, 1493, -852, -122 },
- { 3473, 4849, 547, -2603 },
- { 4631, 2977, 1141, -1768 },
- { 6149, 3050, -71, -1886 },
- { 4069, 4353, -289, -1429 },
- { 2884, 1225, -1388, 365 },
- { 5485, 2518, -235, -571 },
- { 1216, 4375, 1443, 398 },
- { 4988, 3106, 107, -1435 },
- { 4511, 2801, 307, -444 },
- { 3235, 4386, 327, -676 },
- { 2055, 3708, 1657, -305 },
- { 5839, 2374, 290, -1385 },
- { 5110, 3305, 1936, -4206 },
- { 6416, 2920, 338, -2736 },
- { 3350, 2824, -1269, -3881 },
- { 4840, 1815, 464, 186 },
- { 2399, 3332, 238, 1238 },
- { 3516, 1363, 1582, 688 },
- { 3582, 1874, 154, -4770 },
- { 3261, 2878, 886, 283 },
- { 3877, 2658, -327, 884 },
- { 4151, 3436, 2173, -2923 },
- { 3592, 3674, 1281, -1295 },
- { 4561, 3730, -1114, -1747 },
- { 4595, 3625, -558, -575 },
- { 2577, 2348, 2267, 120 },
- { 5242, 3299, 32, -3412 },
- { 4264, 3637, 709, -2320 },
- { 6556, 3570, -838, -2472 },
- { 5745, 4014, -940, -1973 },
- { 5629, 4475, 477, -3328 },
- { 5269, 3199, 1682, -3085 },
- { 4432, 2416, 1145, -3299 },
- { 4465, 2505, 2162, -2186 },
- { 4643, 4941, -88, -2885 },
- { 4568, 5231, 552, -3915 },
- { 5667, 3075, -1406, -2963 },
- { 5418, 5259, -771, -2818 },
- { -256, -7875, 511, -471 },
- { -1813, -7971, -424, -396 },
- { -306, -7006, 862, 282 },
- { -2306, -6422, -1440, 508 },
- { -245, -6787, 375, -100 },
- { -1309, -6065, -20, 779 },
- { -1656, -6047, -641, 1307 },
- { -1496, -6522, 964, 726 },
- { -2291, -6588, -202, 795 },
- { -762, -7522, 1454, -558 },
- { -2270, -7004, -834, -580 },
- { -1139, -7078, 259, 362 },
- { -2535, -7568, -1040, 49 },
- { -3786, -7280, 934, -476 },
- { -3336, -6368, 606, 1056 },
- { -3602, -6924, 52, 714 },
- { -2278, -6550, 1674, 204 },
- { -2855, -5765, 930, 1530 },
- { -2889, -7325, -215, 305 },
- { -2749, -6080, -237, 1452 },
- { -985, -6667, 1577, 400 },
- { -2036, -6083, 380, 1267 },
- { -2077, -7460, 380, -30 },
- { -1775, -7175, 1540, -386 },
- { -3065, -6927, 989, 168 },
- { -2836, -7602, 117, -3392 },
- { -1058, -6396, 593, -3078 },
- { -844, -6062, 999, -236 },
- { -3261, -6951, 1491, -720 },
- { -2186, -8484, 75, -1287 },
- { -2882, -7756, 456, -510 },
- { -1800, -6879, 960, -1183 },
- { -2554, -7241, 1614, -1474 },
- { -2608, -5305, 392, 851 },
- { -2973, -6562, -859, 858 },
- { -2640, -5989, 1031, -416 },
- { -977, -8366, 705, -1434 },
- { -1213, -7409, -77, -1390 },
- { -1335, -6657, 2125, -123 },
- { -2544, -6862, 1852, -737 },
- { -3235, -6422, 1752, -103 },
- { -1300, -7557, 939, -348 },
- { -3476, -7579, 202, -109 },
- { -2482, -6572, 753, 619 },
- { -2554, -8136, -648, -429 },
- { -1012, -7870, -3, -421 },
- { -3604, -6247, 32, -3102 },
- { -1486, -7271, 2013, -1021 },
- { -578, -6799, -523, 405 },
- { -2841, -5948, 1644, 911 },
- { -2411, -7473, 1084, -484 },
- { -2238, -6033, 294, -1059 },
- { -3459, -6470, -201, -790 },
- { -2027, -6009, 1833, 805 },
- { -1433, -8047, 1531, -1754 },
- { -3258, -7884, 763, -1422 },
- { -1544, -6928, -729, 478 },
- { -2314, -8415, 74, -3757 },
- { -3201, -5684, 95, -2214 },
- { -2423, -8694, 725, -3631 },
- { -3545, -7071, 1162, -1798 },
- { -294, -9662, 403, -2274 },
- { -2290, -5460, 1196, 402 },
- { -1603, -6713, 903, -2363 },
- { 4121, 2491, -3142, -2482 },
- { 4500, 3305, -3671, -1567 },
- { 5973, 3172, -1348, -534 },
- { 4830, 3379, -1549, 643 },
- { 5214, 3938, -2641, -2302 },
- { 4639, 4826, -5532, -847 },
- { 5639, 2731, -2170, -963 },
- { 6084, 3487, -3525, -1346 },
- { 5971, 3154, -2190, -2316 },
- { 5618, 4865, -6927, 116 },
- { 5345, 3568, -7391, 709 },
- { 5429, 5078, -3811, -1524 },
- { 6960, 2037, -3515, -1096 },
- { 7092, 2531, -4557, -588 },
- { 6061, 4247, -5651, -478 },
- { 4595, 3684, -4907, -827 },
- { 7497, 3213, -3048, -424 },
- { 5996, 2137, -3098, -1745 },
- { 6198, 5199, -2223, -2274 },
- { 6888, 2851, -2768, -1675 },
- { 6114, 4210, -2316, -954 },
- { 7127, 4242, -3041, -1408 },
- { 6126, 3668, -1517, -1427 },
- { 6245, 6129, -4225, -1186 },
- { 6816, 3213, -2101, -964 },
- { 5345, 5276, -2643, -847 },
- { 6592, 4665, -4338, 484 },
- { 6746, 3751, -3443, 124 },
- { 5453, 1980, -2738, 2606 },
- { 4662, 2179, -4226, -1059 },
- { 5571, 3208, -3554, 174 },
- { 5256, 4447, -1815, -1481 },
- { 5400, 2570, -1210, 235 },
- { 7056, 2549, -2674, 318 },
- { 4574, 4340, -2892, -130 },
- { 6203, 4587, -3273, -305 },
- { 5103, 1925, -2715, -2137 },
- { 3905, 4296, -1700, 247 },
- { 4421, 4605, -3299, 811 },
- { 5671, 1273, -3870, -924 },
- { 5486, 1805, -4901, 133 },
- { 6437, 2578, -1828, -106 },
- { 5530, 5253, -5058, 1223 },
- { 4816, 2025, -1215, 1443 },
- { 3457, 3525, -2456, 3217 },
- { 3316, 2595, -1108, 2459 },
- { 3068, 3810, -2207, 1926 },
- { 6351, 5436, -6470, 600 },
- { 6324, 4240, -5365, 2416 },
- { 4851, 4774, -4075, 1878 },
- { 4900, 3679, -5198, 1078 },
- { 8347, 3633, -4565, -171 },
- { 5244, 5718, -3853, 173 },
- { 3960, 3492, -2939, 2105 },
- { 6070, 3473, -2351, 161 },
- { 8228, 3034, -3360, -901 },
- { 7006, 3985, -1940, -1926 },
- { 7123, 4681, -4301, -878 },
- { 5122, 4097, -1851, -449 },
- { 6200, 2060, -2251, 1049 },
- { 7106, 3844, -7209, 2625 },
- { 7108, 3370, -6734, 533 },
- { 6859, 2849, -3992, 1360 },
- { 5458, 2278, -3253, 1131 },
- { -1072, -2109, 4783, -1073 },
- { -319, -2604, 4257, -2418 },
- { 2466, 1300, 3476, -314 },
- { 2847, -1502, 5296, -141 },
- { 1667, -1273, 5559, -2725 },
- { 2877, -3402, 6434, 204 },
- { 53, -2637, 5275, -1181 },
- { 1091, -2215, 5803, -1549 },
- { 2397, -922, 4327, 1182 },
- { 219, -3747, 4647, -1564 },
- { -29, -2705, 4812, 1277 },
- { 1499, -2608, 5648, 1407 },
- { 2139, -2399, 4202, 2791 },
- { -426, -2064, 5528, 151 },
- { 2560, -2803, 6179, -2806 },
- { 4537, -2479, 3797, 1095 },
- { 888, -3357, 5341, -415 },
- { 4460, -1814, 5388, -1227 },
- { 3920, -3268, 6364, -703 },
- { 3343, -4698, 4410, 784 },
- { 309, -1897, 6306, 1223 },
- { 958, -3318, 4254, -3167 },
- { -99, 1596, 6018, -1983 },
- { -429, -853, 6407, 878 },
- { 1170, -1322, 6290, -417 },
- { 2288, -505, 6303, -1999 },
- { 3312, -1674, 6749, -2494 },
- { -415, -3401, 4721, -371 },
- { -189, -1210, 4844, -2002 },
- { 888, -4142, 4377, 130 },
- { 2469, -4381, 5398, -2492 },
- { 2879, -2912, 5094, -2598 },
- { -717, -617, 5650, -685 },
- { 1470, -3863, 5352, -1684 },
- { 3935, -96, 3823, -730 },
- { 3769, -430, 3168, 694 },
- { 2556, 385, 3539, 512 },
- { 77, -1415, 5111, 2655 },
- { 2724, -2158, 6715, -822 },
- { 1832, 1001, 5385, -1900 },
- { 900, 2198, 4464, -559 },
- { 441, 69, 5921, -1743 },
- { -1161, 738, 6732, -308 },
- { 257, 2035, 4091, 736 },
- { 1607, 1288, 4355, -23 },
- { -13, 1316, 4180, 1672 },
- { 1511, 1336, 3057, 1435 },
- { 2189, -3813, 4530, 939 },
- { 3632, -706, 2646, 1375 },
- { 4266, -3761, 4241, 1077 },
- { 3101, -427, 5273, -1202 },
- { 2293, 276, 4810, -313 },
- { 3430, -1851, 3101, 2045 },
- { 3453, -2979, 5142, 942 },
- { 1683, -3281, 4802, 2002 },
- { 3954, -4715, 5611, 578 },
- { 1272, -155, 5085, 454 },
- { 128, -194, 5095, 1409 },
- { 820, 880, 5797, -2658 },
- { -1095, 656, 5774, 1095 },
- { 813, -1669, 4320, -3251 },
- { -119, 518, 6372, -651 },
- { 2922, -4299, 6115, -877 },
- { 4205, -4273, 4004, 2642 },
- { -1211, -3892, 224, 3127 },
- { -34, -4371, 1321, 2318 },
- { 77, -6326, 1201, 828 },
- { 3995, -3775, 1958, 3233 },
- { 178, -3301, 1985, 3318 },
- { 2330, -3801, 1033, 3195 },
- { 1413, -5536, 826, 1709 },
- { 2468, -3499, 3653, 3631 },
- { 741, -4617, 1723, 2008 },
- { 1246, -3043, 2978, 3949 },
- { -343, -4308, 2258, 2189 },
- { -682, -4640, 454, 2272 },
- { 1236, -4829, 2491, 1642 },
- { -512, -3766, 1182, 3052 },
- { 119, -3939, 3712, 971 },
- { -1145, -4624, 1360, 2281 },
- { 101, -4746, 2866, 1255 },
- { -1500, -5455, 539, 1637 },
- { -969, -5909, 1414, 1128 },
- { -1261, -4939, -231, 2022 },
- { -226, -5345, 1207, 705 },
- { 2712, -5109, 3205, 1866 },
- { -476, -5913, 273, 1208 },
- { -2039, -4464, 624, 2545 },
- { -2351, -3930, 2019, 2673 },
- { -2675, -4849, 1522, 1990 },
- { -1524, -3461, 1446, 3204 },
- { 477, -5314, 1710, 1577 },
- { 656, -3729, 2346, 2511 },
- { 550, -5917, 1975, 1040 },
- { 1728, -4704, 3067, 1058 },
- { -9, -5247, 506, 1760 },
- { -574, -5135, 1675, 1672 },
- { 2129, -3781, 3444, 2313 },
- { 1144, -4439, 2214, 2529 },
- { 1292, -4160, 3185, 1833 },
- { 2445, -3262, 2534, 3227 },
- { 2266, -4401, 2023, 2400 },
- { -587, -3602, 3408, 2067 },
- { -885, -4951, 3228, 1174 },
- { -728, -2711, 2807, 3552 },
- { 1019, -3043, 3195, 2954 },
- { 1888, -4615, 1140, 2454 },
- { 660, -5616, 754, 800 },
- { -1975, -5371, 1649, 1585 },
- { -1544, -5436, 2422, 1081 },
- { -422, -5882, 2390, 750 },
- { 1336, -5557, 2441, 1230 },
- { 136, -4001, 267, 2854 },
- { -522, -3289, 2226, 2728 },
- { -971, -4580, 2471, 708 },
- { 704, -5306, 3300, 1001 },
- { 325, -3464, 3555, 2398 },
- { 794, -3686, 848, 3169 },
- { 660, -3017, 4584, 3242 },
- { -1486, -3978, 2170, 1644 },
- { -1615, -4650, 2688, 1844 },
- { 750, -4578, 538, 2239 },
- { 1668, -5849, 1455, 1031 },
- { 3486, -4681, 2030, 2183 },
- { 2642, -5429, 1696, 1761 },
- { 4491, -4502, 3538, 2767 },
- { 3545, -4528, 3514, 2982 },
- { 3269, -3676, 2758, 3966 },
- { 5572, 1146, 209, -3379 },
- { 7459, 1053, 593, -1896 },
- { 4480, 200, -310, -4259 },
- { 5577, -939, 242, -3992 },
- { 8142, 442, 1257, -3083 },
- { 5442, 1261, 1424, -3236 },
- { 6260, -183, 3125, -2532 },
- { 7179, 889, 1618, -2548 },
- { 6416, 932, 2379, -2487 },
- { 7094, 2560, 961, -3392 },
- { 7322, 463, 2732, -3735 },
- { 6632, 1577, 1912, -3272 },
- { 6312, 1349, 3028, -3460 },
- { 6105, 386, 1213, -977 },
- { 5478, 1158, 1114, -486 },
- { 6493, 410, 1686, -2180 },
- { 6378, 1881, 1333, -2240 },
- { 5711, 812, 1958, -1300 },
- { 6844, 877, 730, -1189 },
- { 6824, -245, 2249, -2000 },
- { 7515, 1521, 1251, -3058 },
- { 6697, 1051, 1300, -1749 },
- { 6476, 1425, 811, -2773 },
- { 7350, 465, -76, -2849 },
- { 6975, 2095, 567, -2492 },
- { 4691, 1736, 2660, -2289 },
- { 7837, 1456, 340, -2767 },
- { 7930, 507, 838, -2074 },
- { 6106, 1502, 766, -1110 },
- { 4891, -659, 835, -3954 },
- { 7250, 141, 1369, -1523 },
- { 7651, 67, 1651, -2298 },
- { 7364, -305, 601, -3132 },
- { 7179, 193, 2491, -2871 },
- { 6504, -272, 2167, -1322 },
- { 4456, 983, 2300, -421 },
- { 4817, 457, 1695, 371 },
- { 6914, 555, 850, -3159 },
- { 5904, 1030, 202, -1959 },
- { 6258, 880, 2233, -4503 },
- { 6029, 10, 2130, -3600 },
- { 6449, 985, 1129, -3963 },
- { 6616, -18, -111, -3285 },
- { 4496, 775, 817, -4276 },
- { 6134, 2338, 1470, -2973 },
- { 6911, 152, 430, -1946 },
- { 4053, 991, 3218, -1193 },
- { 5435, 1285, 3124, -2412 },
- { 5507, 1836, 1935, -1988 },
- { 5240, 689, 2189, -2670 },
- { 6638, 1719, 606, -1799 },
- { 5556, -180, 129, -2595 },
- { 5644, 1918, 1281, -4316 },
- { 6410, 1088, -282, -3117 },
- { 6503, 1841, 312, -3514 },
- { 6947, 20, 1358, -3886 },
- { 5464, 2109, 2398, -3194 },
- { 5616, -407, 2140, -498 },
- { 6121, 2707, 2379, -4096 },
- { 7303, 1846, 2266, -4095 },
- { 5444, 470, 2718, -1553 },
- { 5817, -645, 3285, -1349 },
- { 5625, 1427, 1103, -1991 },
- { 6041, -806, 1196, -2943 },
- { 3050, -5722, 4070, -5460 },
- { 3420, -4386, 4078, -5155 },
- { 6020, -3982, 7268, -2689 },
- { 7502, -4317, 7894, -3973 },
- { 4156, -3558, 5247, -4316 },
- { 4725, -4401, 7290, -1540 },
- { 6688, -5122, 8216, -3210 },
- { 9176, -6576, 9276, -4963 },
- { 8706, -5708, 7987, -4621 },
- { 7060, -3535, 6532, -3308 },
- { 5600, -2719, 5363, -1568 },
- { 4661, -2803, 6263, -4716 },
- { 3673, -3636, 6147, -3433 },
- { 5305, -2585, 6073, -2638 },
- { 7614, -1962, 6079, -5266 },
- { 6760, -3366, 7382, -4322 },
- { 6385, -3883, 4797, -1353 },
- { 8182, -5120, 4298, -4641 },
- { 9130, -6198, 4975, -3063 },
- { 7421, -5436, 5576, -3713 },
- { 3483, -4898, 5443, -2745 },
- { 4907, -5643, 6390, -4105 },
- { 8119, -7008, 7992, -6764 },
- { 6528, -6122, 6967, -5590 },
- { 5890, -4190, 6624, -5688 },
- { 6815, -7934, 7275, -5456 },
- { 5434, -4306, 5169, -5378 },
- { 4364, -6436, 5376, -2604 },
- { 8152, -3404, 5913, -5048 },
- { 7983, -4863, 4262, -2461 },
- { 8023, -6188, 6238, -5062 },
- { 6753, -3692, 3935, -3723 },
- { 6826, -4760, 3284, -4051 },
- { 7224, -7423, 4492, -3875 },
- { 6904, -2590, 6587, -6248 },
- { 6106, -1944, 7345, -5506 },
- { 4956, -2990, 7808, -3146 },
- { 6908, -6885, 5949, -1288 },
- { 7162, -6058, 3419, -3401 },
- { 7015, -7080, 6907, -3018 },
- { 6971, -6832, 5646, -3273 },
- { 8014, -5546, 5471, -1544 },
- { 6792, -2220, 5105, -2879 },
- { 8494, -3974, 4408, -3999 },
- { 9591, -4866, 6027, -4558 },
- { 5264, -5161, 6101, -738 },
- { 5803, -6141, 5197, -5231 },
- { 4657, -6822, 3232, -5189 },
- { 4791, -5135, 3809, -4665 },
- { 6108, -5103, 2379, -3873 },
- { 4680, -3909, 3234, -5093 },
- { 5802, -3853, 3795, -4984 },
- { 4360, -7483, 4802, -3877 },
- { 5429, -7517, 5911, -3717 },
- { 6866, -2280, 4880, -4634 },
- { 10131, -4628, 4414, -4092 },
- { 10811, -5189, 7746, -5337 },
- { 5663, -8941, 5287, -5680 },
- { 8023, -5991, 7403, -2796 },
- { 9669, -6919, 6525, -4932 },
- { 7275, -3796, 4962, -2547 },
- { 8848, -4806, 5677, -3080 },
- { 8128, -4308, 7749, -6569 },
- { 4032, -5196, 2282, -6239 },
- { 6593, 700, -229, 304 },
- { 8260, 539, -66, -1259 },
- { 6605, 176, -814, -109 },
- { 8057, 0, -1, -136 },
- { 7382, -38, -484, -1129 },
- { 8373, -929, 682, -454 },
- { 7674, 690, -1278, 546 },
- { 7326, -517, 406, -1283 },
- { 7612, -1715, -1167, 1175 },
- { 8590, 441, -782, -710 },
- { 8572, -1202, -291, 260 },
- { 7308, -147, -1785, 414 },
- { 6787, -353, -672, 934 },
- { 5177, -133, 179, 82 },
- { 4161, -34, 447, 1497 },
- { 5997, -902, 1533, -121 },
- { 5727, -871, -1370, 945 },
- { 8386, -252, 293, -823 },
- { 6573, -1354, 682, 616 },
- { 7650, -2096, 725, 457 },
- { 8122, 78, 636, -1400 },
- { 8421, 428, -1620, 131 },
- { 7341, -1292, -717, 186 },
- { 7998, -49, -720, 266 },
- { 5987, -351, 669, 844 },
- { 7314, -1620, 250, -603 },
- { 7219, -1562, -572, 1994 },
- { 8682, -358, -290, -388 },
- { 5810, 155, -178, 1199 },
- { 7246, -12, 1042, -786 },
- { 7357, -923, 1468, -475 },
- { 7801, 621, -212, -724 },
- { 5346, -514, 1210, 1356 },
- { 8459, 36, -127, -779 },
- { 6878, -2429, 854, 1750 },
- { 7280, -1401, -1353, 2845 },
- { 7579, -2148, -1463, 2087 },
- { 6637, 946, -872, 750 },
- { 4807, -1100, 1289, 2602 },
- { 4495, 219, 1551, 1128 },
- { 7639, 506, 446, -1107 },
- { 6359, 188, 1009, -115 },
- { 6641, -1820, 1655, 723 },
- { 5394, -2382, 1604, 2542 },
- { 6021, -2644, 2396, 1407 },
- { 4698, 882, 245, 1525 },
- { 8103, 573, -798, -349 },
- { 8045, -519, 997, -1092 },
- { 7571, -122, 227, -338 },
- { 5347, -1200, 630, 1718 },
- { 7070, 790, 218, -544 },
- { 7440, 728, -527, -20 },
- { 6402, -355, 197, -736 },
- { 4031, 771, 866, 1895 },
- { 6009, 896, 445, -31 },
- { 5160, 1098, -856, 1784 },
- { 7980, -886, -1293, 1396 },
- { 6318, -1361, 2423, 252 },
- { 7547, -699, 133, 506 },
- { 8562, -2344, 940, 264 },
- { 5890, 1187, -1425, 2194 },
- { 6558, -645, -1311, 2621 },
- { 4634, -1671, 2075, 1623 },
- { 5614, 105, -816, 2376 },
- { 6646, 1558, -1365, 630 },
- { 6998, 1150, -2117, -990 },
- { 6555, 2311, -1093, -1783 },
- { 6682, 1430, -2391, -1940 },
- { 7861, 1555, -2977, -1188 },
- { 6745, 1723, -459, -2085 },
- { 7504, 1229, -1666, -2060 },
- { 7937, 671, -2128, -1529 },
- { 7139, 991, -735, -2632 },
- { 6867, 1592, -1303, -2324 },
- { 6401, 2230, -1732, -2508 },
- { 7201, 2184, -2169, -1988 },
- { 6636, 2190, -995, -2840 },
- { 7620, 2306, -2089, -651 },
- { 7584, 1875, -1438, -631 },
- { 9214, 1561, -2464, -1139 },
- { 6154, 1318, -1237, -2917 },
- { 7917, 2847, -1797, -1599 },
- { 8309, 2029, -2555, -465 },
- { 8204, 1282, -584, -2405 },
- { 8440, 1035, -1147, -1137 },
- { 7107, 1858, -60, -1568 },
- { 6781, 2912, -873, -1463 },
- { 7603, 1316, -319, -1249 },
- { 7833, 1335, -78, -1849 },
- { 7930, 1141, -1016, -695 },
- { 7883, 1610, -1017, -1314 },
- { 8069, 1409, -1811, -196 },
- { 8319, 1031, -582, -1590 },
- { 5948, 1537, -2153, -2373 },
- { 8684, 1171, -1871, -850 },
- { 8357, 2484, -2411, -1292 },
- { 6516, 2092, -193, -1167 },
- { 6112, 1697, 22, -525 },
- { 7161, 703, -602, -1879 },
- { 6047, 2351, -807, -219 },
- { 8072, 1854, -1817, -1553 },
- { 6956, 1304, 76, -1011 },
- { 6607, 1481, -544, -162 },
- { 6958, 2541, -265, -1938 },
- { 6416, 2514, -777, -850 },
- { 7272, 2110, -899, -1171 },
- { 7741, 2153, -283, -2614 },
- { 6482, 2041, -1758, -1221 },
- { 6762, 940, -1862, -2281 },
- { 5610, 1194, -1691, -1561 },
- { 7833, 2164, -823, -1952 },
- { 5460, 1438, -848, 1189 },
- { 6011, 1377, -771, -1557 },
- { 7679, 544, -1134, -2214 },
- { 7209, 1292, -2714, -1564 },
- { 5567, 1200, -404, -169 },
- { 5853, 1461, -1465, -518 },
- { 6782, 689, -844, -860 },
- { 7330, 1337, -1152, -71 },
- { 7189, 1506, -653, -685 },
- { 6860, 2116, -1403, -240 },
- { 8804, 1516, -1391, -1760 },
- { 7210, 2689, -1498, -989 },
- { 7030, 3022, -1441, -2083 },
- { 5649, 1836, -407, 525 },
- { 7451, 3099, -717, -2464 },
- { 7384, 1656, -2007, 398 },
- { 6504, 707, -1919, -134 },
- { -1851, 3639, -2279, -695 },
- { -4037, 1644, -77, 1329 },
- { -4025, 1960, -1565, -567 },
- { -3430, 2495, -795, 368 },
- { -4771, 2480, 993, 756 },
- { -3431, 2058, -2539, -971 },
- { -3802, 3418, 380, 217 },
- { -3074, 3350, -1652, -1056 },
- { -3705, 326, -1650, 1535 },
- { -3122, 1281, -1192, 1607 },
- { -4601, 1367, -968, 53 },
- { -3808, 958, 44, 2560 },
- { -2079, 2530, -1485, 1166 },
- { -3707, 343, -2889, 180 },
- { -5249, 1431, -31, 688 },
- { -4990, 125, -704, 1270 },
- { -2771, 1334, -2446, 746 },
- { -2292, 994, -1527, 2630 },
- { -1261, 3070, -2519, 268 },
- { -2544, 3890, -1057, -552 },
- { -4421, 255, -1980, 530 },
- { -2951, 454, -13, 3643 },
- { -2262, 1815, -370, 2880 },
- { -2383, 3657, -649, 576 },
- { -3541, -161, -1389, 2550 },
- { -4241, 1575, 1325, 2561 },
- { -2767, 4037, 1221, 1578 },
- { -3748, 2697, 1148, 1801 },
- { -4686, 2385, -220, 0 },
- { -1531, 1645, -2751, 1327 },
- { -45, 4032, -799, 2298 },
- { -2915, 2280, 709, 2495 },
- { -1199, 3278, -406, 2346 },
- { -2471, 116, -2706, 2060 },
- { -2440, 2173, -2894, -344 },
- { -3375, 2287, 1781, 3226 },
- { -2153, 3568, 1827, 2918 },
- { -862, 2267, -1626, 2527 },
- { -2698, 1135, 301, 4239 },
- { -2364, 2123, 1010, 3710 },
- { -2447, 3281, -81, 1408 },
- { -2660, 4735, 472, 258 },
- { -1053, 3097, 2682, 2398 },
- { -3366, -1037, -1152, -868 },
- { -643, 4242, 2212, 1259 },
- { 971, 3991, 934, 643 },
- { -1617, 2002, 2139, 2195 },
- { -4897, 972, 784, 1719 },
- { -1275, 2992, 1039, 3821 },
- { -392, 4973, -209, 1821 },
- { -1028, 4718, -1479, -137 },
- { 50, 3914, 553, 2210 },
- { 678, 4364, 359, 1303 },
- { -582, 4911, 514, 1671 },
- { 1276, 3914, -1252, 2934 },
- { -1496, 3984, 857, 2330 },
- { 772, 4744, -655, 2332 },
- { -799, 5283, -439, 624 },
- { 1341, 2937, 650, 2027 },
- { -1739, 4892, 1275, 1702 },
- { -892, 2596, -151, 3951 },
- { -3532, 1090, 1292, 32 },
- { 321, 3146, 2647, 1475 },
- { 264, 4199, -1591, 1317 },
- { -452, -2357, 2266, 4192 },
- { 3022, -1033, -2389, 5678 },
- { -1162, -1342, 3543, 4990 },
- { -474, -1477, -1223, 5016 },
- { -699, -2857, 900, 3835 },
- { -461, -2255, -117, 4626 },
- { 1204, -2062, -1211, 4403 },
- { 2192, -3035, -337, 3966 },
- { 108, -831, 279, 5643 },
- { 1457, -620, -2908, 5276 },
- { -2527, -78, 1085, 5460 },
- { -1978, -1918, -949, 4733 },
- { 32, 367, -1904, 5166 },
- { 1890, -1665, 440, 4752 },
- { -518, -348, 2816, 4891 },
- { 3695, -2490, -1374, 4603 },
- { 246, -1965, 3549, 3969 },
- { 1100, -3111, 656, 3737 },
- { -1379, 870, -414, 4575 },
- { 628, -357, -1227, 6179 },
- { -1129, -1318, -2457, 4576 },
- { -425, -98, -73, 6336 },
- { 367, -887, 2990, 4207 },
- { 2091, -1251, 2444, 3557 },
- { -1759, -1610, 2046, 5273 },
- { 3210, 1414, -20, 2616 },
- { 3303, -2636, 1005, 4237 },
- { -327, -3107, -640, 3687 },
- { -197, 764, 572, 5486 },
- { 646, -767, 1388, 5464 },
- { 104, 2742, -228, 3907 },
- { -236, 1829, -579, 4585 },
- { -2150, -474, -1525, 4006 },
- { -23, -2632, -2400, 3892 },
- { -12, -1739, -2910, 4867 },
- { -2310, -368, -102, 4583 },
- { -1991, -2061, 533, 4531 },
- { 3884, -1446, -153, 4393 },
- { 1568, 14, -289, 5268 },
- { -1376, -253, -2797, 3417 },
- { 3193, -2577, 2475, 3566 },
- { 3418, 617, 1350, 1857 },
- { 3792, -24, -272, 3370 },
- { 153, 1159, 2906, 2877 },
- { 511, 2162, 1548, 2741 },
- { 262, 819, -2791, 3734 },
- { 4232, -2015, 1486, 3477 },
- { 2943, -1110, -1014, 5480 },
- { 2842, 369, 703, 3476 },
- { 3011, 1634, -933, 3553 },
- { 4412, -1548, -942, 5021 },
- { -1405, 593, 2372, 5267 },
- { 2093, 2129, 896, 2365 },
- { 4845, -1980, 0, 3823 },
- { -2140, 81, 3278, 5637 },
- { 1484, 2665, -324, 3653 },
- { 10, 192, 1620, 5291 },
- { 2152, 738, -2269, 5000 },
- { 2102, 2748, -1652, 4707 },
- { 2855, -2131, -387, 5188 },
- { 1173, 676, 1338, 3277 },
- { 2340, -2329, -2064, 4095 },
- { 861, -2024, 1296, 5055 },
- { 2189, 3225, -695, 2626 },
- { 6196, -7079, 1943, -822 },
- { 4547, -4813, 3261, 1856 },
- { 4243, -6904, 3443, 448 },
- { 4581, -7503, 946, 506 },
- { 6626, -7754, 3427, 470 },
- { 3407, -9088, 3269, -1496 },
- { 4079, -6464, 2304, 777 },
- { 5621, -9336, 2684, -768 },
- { 5351, -6464, 5238, -214 },
- { 5961, -8007, 1724, -3091 },
- { 4213, -8067, 603, -246 },
- { 7208, -7403, 3168, -1738 },
- { 6098, -7700, 329, -1379 },
- { 6525, -6735, 4248, -1072 },
- { 6073, -6241, 2167, -2378 },
- { 4609, -9218, 3051, -1033 },
- { 6813, -7283, 1581, -1897 },
- { 6126, -6275, 2789, 681 },
- { 4423, -6538, 1621, -1692 },
- { 6272, -8298, 3167, -1855 },
- { 6172, -8558, 4498, -1169 },
- { 4844, -8588, 1647, -366 },
- { 6209, -8807, 1581, -369 },
- { 5389, -8059, 550, -192 },
- { 6654, -9775, 2504, -1063 },
- { 7103, -7998, 806, 530 },
- { 5662, -6736, 1565, -3620 },
- { 4165, -9564, 4191, -2131 },
- { 4526, -7181, 576, -2875 },
- { 4633, -8623, 2807, -4742 },
- { 3709, -7794, 1815, 34 },
- { 3634, -8622, 2313, -826 },
- { 6991, -8447, 2063, -3198 },
- { 7757, -9486, 2255, -558 },
- { 4149, -7778, 4728, -1696 },
- { 5767, -7427, 1113, 707 },
- { 4592, -6261, 2329, 1864 },
- { 3159, -10498, 1677, -4273 },
- { 3534, -9010, 2437, -3565 },
- { 4479, -10821, 2715, -4942 },
- { 3207, -9805, 3054, -3886 },
- { 4627, -8189, 3018, -2354 },
- { 5527, -10566, 3244, -2749 },
- { 4346, -10127, 3335, -3084 },
- { 6132, -10085, 3316, -1308 },
- { 5629, -9704, 2178, -3058 },
- { 3603, -8538, 1246, -624 },
- { 3737, -8488, 395, -3167 },
- { 5465, -11414, 2810, -4640 },
- { 5306, -7745, 2721, -3988 },
- { 7000, -9111, 1695, -1409 },
- { 6663, -7741, 2466, -4079 },
- { 4083, -7175, 1836, -4831 },
- { 3613, -9926, 1342, -3455 },
- { 6588, -8033, 457, -258 },
- { 4720, -8102, 17, -1209 },
- { 7414, -8709, 1294, -344 },
- { 5437, -10030, 4043, -1704 },
- { 4862, -9281, 1558, -1431 },
- { 6800, -6403, 5113, 862 },
- { 4623, -8242, 2667, -228 },
- { 5919, -5083, 3348, 2135 },
- { 5985, -8889, 2733, -5105 },
- { 5029, -5767, 4407, 719 },
- { 354, -6158, -838, -3001 },
- { 351, -5943, -2104, -1534 },
- { -633, -7190, -25, -4798 },
- { -1595, -7235, -3812, -1400 },
- { 103, -6197, -2933, -78 },
- { -1722, -5020, -3441, -4333 },
- { -1963, -5644, -4365, -270 },
- { -846, -5743, -3477, 196 },
- { -191, -5348, -4054, -469 },
- { -2515, -7754, -3495, -818 },
- { -2090, -6710, -2701, 117 },
- { -546, -7036, -1398, 163 },
- { -278, -7091, -2662, -536 },
- { -622, -7962, -2731, -1464 },
- { -1555, -8118, -3612, -2057 },
- { -1094, -6280, -2314, 505 },
- { -2556, -8538, -4024, -2247 },
- { 109, -7134, -3107, -1823 },
- { -900, -6954, -3340, -717 },
- { -605, -7113, -3656, -2154 },
- { 837, -6263, -3211, -2177 },
- { -417, -5810, -3871, -1469 },
- { -1318, -5649, -4207, -3198 },
- { 413, -6765, -2082, -33 },
- { -3101, -6450, -4362, -766 },
- { 755, -6489, -2967, -846 },
- { 1117, -7106, -2452, -1352 },
- { -1202, -8387, -3072, -2897 },
- { -365, -4894, -3561, -2937 },
- { -2372, -8776, -265, -4441 },
- { -1224, -8678, -896, -5074 },
- { -755, -10096, -600, -6623 },
- { 300, -8206, -225, -4568 },
- { -1176, -6824, -2633, -3527 },
- { -2006, -5443, -1526, -5849 },
- { -1115, -5540, -2363, -4785 },
- { 1059, -6812, -2543, -2654 },
- { -1976, -6861, -3062, -5508 },
- { -379, -5328, -2321, -3624 },
- { -2108, -5860, -4518, -1915 },
- { -379, -7885, -1329, -594 },
- { 774, -5389, -581, -5213 },
- { -2601, -5083, -1849, -4921 },
- { -176, -5580, 74, -5075 },
- { -204, -6780, -190, -6232 },
- { 418, -7594, -1987, -820 },
- { -1873, -8529, -2926, -1609 },
- { 1340, -6362, -919, -4975 },
- { 577, -7990, -2044, -1873 },
- { -2572, -7413, -1745, -2224 },
- { -2037, -7030, -1461, -7138 },
- { -2559, -8756, -2039, -5836 },
- { -2079, -6764, -1209, -5669 },
- { -1613, -7801, -2006, -685 },
- { -1865, -6583, -722, -3529 },
- { -589, -6358, -1377, -1003 },
- { -540, -7514, -1331, -3542 },
- { 419, -6192, -1677, -4927 },
- { -2786, -8763, -2966, -5065 },
- { -2172, -8411, -1726, -4675 },
- { -3382, -9833, -3497, -5722 },
- { -2433, -10169, -2077, -5775 },
- { -424, -9451, -1096, -3658 },
- { -537, -8522, -910, -1897 },
- { -5550, 2807, 1683, -693 },
- { -6395, 635, 3573, -1246 },
- { -7544, 2280, 2140, 44 },
- { -8751, 1136, 2951, -794 },
- { -5605, 2709, 2052, 916 },
- { -7650, 654, 869, 135 },
- { -6939, 967, 1409, 870 },
- { -7834, 2123, 3310, 974 },
- { -6935, 2818, 1274, -1678 },
- { -5605, 2233, 1013, 471 },
- { -7095, 1849, 1648, 198 },
- { -6636, 1634, 712, -37 },
- { -7279, 978, 296, -315 },
- { -7664, 3504, 3292, -216 },
- { -7836, 1209, 1221, -257 },
- { -7913, 2201, 1765, -1529 },
- { -7077, 3783, 2632, -1407 },
- { -5565, 1645, 1410, -622 },
- { -6494, 2879, 1181, -759 },
- { -7073, 3137, 3010, 550 },
- { -7249, 1839, 847, -805 },
- { -6630, 2197, 282, -1096 },
- { -8836, 1573, 1988, -1090 },
- { -7809, 1274, 836, -1198 },
- { -7895, 2970, 3511, -1097 },
- { -6960, 1664, 1356, -2442 },
- { -6582, 2866, 2273, 307 },
- { -7221, 821, 2851, -1435 },
- { -6015, 1703, 2001, -2367 },
- { -8082, 1034, 2103, 239 },
- { -5952, 1912, 301, -465 },
- { -6099, 841, 379, 567 },
- { -6343, 50, 494, 658 },
- { -6586, 983, 591, -893 },
- { -5500, 869, 2187, -2479 },
- { -6482, 60, 1545, -979 },
- { -6705, 515, 1974, -53 },
- { -6460, 1755, 1325, -1275 },
- { -6093, 2617, 2465, -623 },
- { -7330, 2161, 594, -2115 },
- { -7324, 762, 1593, -2004 },
- { -6385, 679, 1510, -2514 },
- { -6159, 241, 2976, -1631 },
- { -8583, 3030, 4045, -162 },
- { -6299, 66, 2209, -2103 },
- { -5428, 1279, 3267, -1846 },
- { -6438, 1335, 2728, -1631 },
- { -8012, 1070, 2428, -1151 },
- { -6201, 2781, 2349, -1918 },
- { -5918, 1139, 3121, -148 },
- { -6314, 2481, 3137, -1808 },
- { -7180, 1722, 2435, -1602 },
- { -6750, 1829, 3763, -1145 },
- { -6713, 1777, 2221, 1212 },
- { -7479, 1835, 3627, -479 },
- { -7299, 10, 2406, -1593 },
- { -8249, 3129, 996, -2870 },
- { -8374, 1534, 1333, -1882 },
- { -7507, 3353, 1598, -2299 },
- { -7379, 2701, 2326, -1167 },
- { -8440, 2276, 2796, -542 },
- { -10348, 1527, 2649, -1165 },
- { -8184, 3614, 2574, -1738 },
- { -5539, 1574, 1733, 1138 },
- { 9404, -7652, 67, 79 },
- { 8654, -3972, 1358, -60 },
- { 8617, -4794, 117, 2318 },
- { 7886, -4505, 1784, 1200 },
- { 8636, -6125, 3879, -1003 },
- { 9654, -6836, 1816, 205 },
- { 9374, -6553, 913, 1875 },
- { 8020, -6150, 1134, 2390 },
- { 7786, -4970, 2078, -1857 },
- { 8691, -6119, 711, 708 },
- { 9039, -5568, 2944, -1902 },
- { 9955, -5048, 1433, -601 },
- { 8089, -6927, 3093, -2846 },
- { 8487, -7024, 2415, 19 },
- { 9388, -5287, 3577, -2655 },
- { 8591, -7371, 2300, -996 },
- { 9104, -4763, 1453, -2558 },
- { 7615, -5457, 596, 164 },
- { 9860, -7047, 3433, -614 },
- { 8756, -4404, 2235, -964 },
- { 9462, -4660, 299, -1822 },
- { 10119, -5550, 2689, -1273 },
- { 10915, -7471, 2705, -1007 },
- { 11433, -7090, 1410, -1198 },
- { 9882, -7431, 2965, -1895 },
- { 7628, -5219, 769, -2661 },
- { 8169, -5318, 2262, 70 },
- { 8846, -6320, 1939, -754 },
- { 7147, -5593, 1248, -971 },
- { 10652, -5485, 935, 137 },
- { 7778, -6533, 2564, -1932 },
- { 8878, -5173, 1214, -361 },
- { 9828, -4943, 282, 510 },
- { 10042, -6134, 3895, -1914 },
- { 7965, -6630, 3566, -433 },
- { 8573, -4502, 3574, -1209 },
- { 8398, -4801, 1031, -1347 },
- { 10136, -7772, 2612, 1547 },
- { 9890, -7280, 1768, -1083 },
- { 8407, -6585, -706, -58 },
- { 7976, -7582, 229, -131 },
- { 10481, -8866, 1166, -147 },
- { 10914, -4342, 3189, -2412 },
- { 10440, -5198, -104, -1109 },
- { 11227, -6530, 2381, -2449 },
- { 8487, -8064, 1086, 230 },
- { 9975, -6123, -857, -134 },
- { 8339, -6498, 1232, -2337 },
- { 11042, -4506, 1119, -2098 },
- { 12563, -5592, 1837, -2062 },
- { 11801, -5590, 632, -1296 },
- { 10152, -5617, 1511, -1917 },
- { 7800, -6473, 51, -1337 },
- { 7941, -5560, 2438, -3270 },
- { 6554, -3834, 2100, 1476 },
- { 9065, -5520, -226, -1120 },
- { 10794, -7120, -243, 122 },
- { 10429, -6968, 272, -806 },
- { 8942, -8914, 1442, -392 },
- { 9969, -5051, 2033, -2953 },
- { 7275, -4152, 3058, -64 },
- { 11127, -5488, 4589, -3227 },
- { 9626, -6666, 2739, -2958 },
- { 6943, -5362, 4470, 1008 },
- { -7456, -967, 2936, -1002 },
- { -8622, -333, 6962, 2606 },
- { -7486, -3392, 3668, 1287 },
- { -8053, -827, 5148, 1097 },
- { -6610, 454, 4952, 96 },
- { -7701, -1982, 3161, -468 },
- { -7307, -1132, 4071, -36 },
- { -8125, -271, 5199, 3862 },
- { -9182, -1950, 2813, 1878 },
- { -9855, -952, 4794, 3010 },
- { -7241, 1431, 4202, 2468 },
- { -9646, 157, 4766, 1046 },
- { -9371, 1230, 6009, 2958 },
- { -11514, -64, 8630, 5248 },
- { -6766, 565, 2766, 2140 },
- { -8426, -9, 2852, 1271 },
- { -11291, -1113, 5087, 2937 },
- { -8297, 2092, 4495, 1264 },
- { -9983, 735, 3809, -51 },
- { -9048, -1000, 3191, -308 },
- { -7331, -1987, 2655, 1391 },
- { -7144, -21, 4333, 2161 },
- { -6032, -1540, 3543, 896 },
- { -7987, -1036, 1985, 1529 },
- { -9264, 2004, 5194, 290 },
- { -11308, -840, 5754, 1654 },
- { -9130, -2398, 4292, 2973 },
- { -6248, 838, 3563, 1223 },
- { -6819, -2760, 3511, 119 },
- { -7213, -2006, 4364, 762 },
- { -5431, -1047, 4533, 166 },
- { -7098, -641, 2021, 639 },
- { -8628, -2249, 3588, 399 },
- { -6352, -1498, 3560, -648 },
- { -7033, -2190, 4870, 2562 },
- { -7405, -46, 3772, -581 },
- { -6104, 796, 5143, 1965 },
- { -5787, 943, 5784, 3030 },
- { -8367, 1465, 7192, 4097 },
- { -8259, 789, 5694, 1963 },
- { -10614, -1899, 5748, 2645 },
- { -8258, -805, 3698, 2275 },
- { -6877, -972, 6431, 3160 },
- { -6483, 363, 7018, 3129 },
- { -6283, -1358, 5191, 1524 },
- { -8853, -3157, 4119, 1741 },
- { -6086, -267, 3883, -835 },
- { -7254, 1032, 6613, 4017 },
- { -11470, -3350, 4649, 3426 },
- { -6743, 481, 6148, 1239 },
- { -5394, -166, 5309, 3165 },
- { -7958, 1068, 4268, -240 },
- { -10520, 2256, 7916, 2828 },
- { -5132, -4, 5739, 1176 },
- { -8643, 120, 3255, -629 },
- { -9631, 1974, 8870, 4362 },
- { -10663, -1221, 3733, 589 },
- { -8224, -1843, 5806, 2655 },
- { -8282, 1255, 8647, 3478 },
- { -12311, -1505, 9043, 6256 },
- { -11312, -856, 7136, 4681 },
- { -11944, -722, 7941, 3309 },
- { -7868, -463, 6846, 4196 },
- { -8679, -241, 7410, 5347 },
- { 6759, -4680, -508, 1220 },
- { 5176, -6111, 944, 121 },
- { 6843, -5667, -1368, -533 },
- { 5616, -5884, -1471, -695 },
- { 6030, -5089, -1808, -940 },
- { 7444, -5463, -52, 1881 },
- { 4207, -6079, -506, 1571 },
- { 6785, -4410, -649, 3084 },
- { 4838, -5214, 2026, 2998 },
- { 4201, -5790, 645, 1811 },
- { 6930, -5129, -1940, 1698 },
- { 6332, -4627, 692, 3027 },
- { 6285, -4314, -106, 3644 },
- { 6255, -5450, -1975, 742 },
- { 4199, -4676, -459, 1796 },
- { 5592, -5500, 1345, 1300 },
- { 4358, -5556, -2236, 114 },
- { 4620, -5875, -1563, 888 },
- { 4892, -7550, -327, -419 },
- { 4734, -7085, 7, 613 },
- { 3883, -5562, -1969, 1080 },
- { 5610, -4990, -204, 834 },
- { 4117, -6482, -1271, 341 },
- { 6585, -5107, 892, 1169 },
- { 6632, -3683, 302, 3002 },
- { 6326, -5351, -983, -1250 },
- { 4382, -7192, -730, -158 },
- { 5227, -6540, -451, 1123 },
- { 5468, -6472, -870, -1471 },
- { 5191, -6402, -1365, -127 },
- { 7407, -6317, -973, -336 },
- { 4611, -6530, -820, -1980 },
- { 4963, -5159, -2050, -966 },
- { 4414, -5691, -211, -998 },
- { 5954, -5873, 750, -1749 },
- { 4394, -4796, -1268, 254 },
- { 7161, -6214, -1010, 689 },
- { 4965, -3598, 2372, 1711 },
- { 6248, -6180, 981, 864 },
- { 6473, -5336, 525, -600 },
- { 4591, -6864, -1131, -900 },
- { 6314, -6440, -1021, -375 },
- { 5838, -6209, -1199, 944 },
- { 5308, -5283, -2100, 1267 },
- { 4342, -5860, -1637, -1356 },
- { 5680, -4388, -1227, -104 },
- { 4900, -4098, 1449, 4046 },
- { 4677, -4284, -106, 3190 },
- { 7574, -6173, -848, 1859 },
- { 6493, -7207, -131, 726 },
- { 5513, -5261, -2117, 4 },
- { 6191, -7352, -193, -505 },
- { 5885, -4333, 324, -134 },
- { 6162, -6081, -312, -2044 },
- { 4216, -6200, -1810, -572 },
- { 5652, -7035, -696, -197 },
- { 7131, -7189, -366, -60 },
- { 5032, -4803, -1514, 2832 },
- { 7386, -4610, -606, 3489 },
- { 4211, -5031, 1221, 3047 },
- { 4050, -4653, 1584, 1469 },
- { 6852, -5302, -1861, 206 },
- { 7736, -4816, -1794, 3359 },
- { 6290, -3439, 1522, 2454 },
- { 1768, 5990, -5560, -2594 },
- { 3903, 5326, -1530, -1501 },
- { 2472, 3738, -2117, -4240 },
- { 3260, 5448, -904, -4733 },
- { 1435, 7297, -3676, -4102 },
- { 4096, 5951, -656, -3312 },
- { 2178, 6009, -3146, -3724 },
- { 3787, 5493, -5473, -1633 },
- { 2998, 7286, -3334, -3571 },
- { 2894, 6576, -4708, -2804 },
- { 830, 6163, -4286, -3348 },
- { 4755, 5569, -1730, -2739 },
- { 4604, 6065, -3562, -2605 },
- { 2749, 5141, -3986, -2775 },
- { 3942, 4875, -2143, -3340 },
- { 2819, 8517, -2004, -2724 },
- { 2146, 6298, -689, -3093 },
- { 5196, 6504, -3393, -1475 },
- { 1851, 8386, -1748, -1420 },
- { 3474, 8572, -3534, -2688 },
- { 4503, 7560, -3561, -2245 },
- { 4433, 6219, -2393, -1575 },
- { 3506, 7248, -2275, -1977 },
- { 3490, 7409, -3147, -604 },
- { 4214, 6447, -3520, 516 },
- { 619, 7034, -829, -1705 },
- { 1732, 7395, -356, -2208 },
- { 1226, 5204, -3294, -3732 },
- { 2027, 5619, -1813, -4146 },
- { 3078, 5877, 47, -2651 },
- { 1654, 5458, 424, -682 },
- { 3163, 5464, -2026, -270 },
- { 2884, 5375, -685, -530 },
- { 2950, 7286, -35, -2967 },
- { 1986, 5066, -597, 482 },
- { 3459, 4308, -3845, -2333 },
- { 3155, 7037, -1346, -4345 },
- { 2193, 6696, -717, -1319 },
- { 3677, 5089, -3892, -487 },
- { 2186, 5136, -4186, -1492 },
- { 773, 5796, -917, 817 },
- { 2489, 6546, -3570, -2117 },
- { 1223, 6469, -1362, -33 },
- { 271, 6061, -1466, -1725 },
- { 2540, 5171, -1847, 1032 },
- { 2548, 5251, -2697, 1677 },
- { 771, 7600, -768, -632 },
- { 4710, 6647, -4736, -1275 },
- { 1369, 5917, -2971, -1056 },
- { 163, 5239, -3499, -2275 },
- { 2104, 4285, -3211, -3286 },
- { 1107, 7411, -1972, -1671 },
- { 2196, 7262, -2310, -1926 },
- { -244, 6439, -1745, -839 },
- { 3293, 3832, -2890, -3000 },
- { 419, 6443, -379, -407 },
- { 3077, 4930, -1156, -2869 },
- { 2131, 5874, -2330, 224 },
- { 690, 6538, -2212, -2841 },
- { 1602, 4421, -2515, 1542 },
- { 3318, 9373, -3032, -3477 },
- { 5646, 7462, -5153, -1463 },
- { 4139, 7137, -1539, -3321 },
- { 3481, 9077, -1645, -3653 },
- { -7747, 375, -106, -543 },
- { -8587, -1379, -586, -461 },
- { -10146, -892, 2094, 694 },
- { -8103, 382, 504, -325 },
- { -8548, -92, 94, -656 },
- { -7460, 38, 152, 388 },
- { -8266, -271, -459, -883 },
- { -7935, -664, -1026, -802 },
- { -8341, -109, 853, 161 },
- { -8802, -1355, 1099, 630 },
- { -8957, -6, 1108, -669 },
- { -7260, -1520, -43, -407 },
- { -7555, -174, 668, -2562 },
- { -9014, -126, 227, -1191 },
- { -8184, 769, 290, -1375 },
- { -9476, 55, 962, -1528 },
- { -8679, 541, 755, -1030 },
- { -9842, -1626, 838, -1588 },
- { -8513, -702, 788, -1998 },
- { -10101, -1558, -366, -1841 },
- { -8135, 78, 1479, -1813 },
- { -9128, -454, 313, -1786 },
- { -7554, -1084, 831, -2442 },
- { -7576, -701, 2068, -1665 },
- { -7791, -1481, 1587, -1808 },
- { -6701, -596, -97, 802 },
- { -7418, -15, 684, -963 },
- { -7127, -477, -139, -426 },
- { -8097, -110, -36, -264 },
- { -7620, -1922, -590, -101 },
- { -7647, -1201, 279, 660 },
- { -7856, -1974, 758, -2271 },
- { -8496, -167, 2232, -1143 },
- { -8506, -1359, 624, -740 },
- { -7274, -1052, 1062, -139 },
- { -7800, -217, 91, -1794 },
- { -7030, -1694, -955, 615 },
- { -9020, -1864, 101, -2182 },
- { -9400, -740, 598, -667 },
- { -8448, -1184, 2024, -1272 },
- { -8812, -570, -897, -2384 },
- { -10559, -1286, 538, -1536 },
- { -8728, -888, -1089, -1397 },
- { -7080, -1185, 636, -1252 },
- { -9880, 233, 2344, -782 },
- { -7952, -1326, -378, -1947 },
- { -7207, -378, 1408, -2237 },
- { -8467, -1545, 902, -1987 },
- { -9163, -1474, 924, -1739 },
- { -8159, -992, -77, -2744 },
- { -8343, 148, -423, -1573 },
- { -9105, -649, -254, -1214 },
- { -8939, 456, 281, -1905 },
- { -8837, 179, -394, -2634 },
- { -9145, 757, 1547, -1319 },
- { -9775, -723, 441, -1680 },
- { -8910, -686, 1529, -1525 },
- { -9492, -1134, 2064, -938 },
- { -6111, -943, 677, -31 },
- { -7411, -613, -814, 46 },
- { -9479, -922, -430, -2061 },
- { -11298, -1268, 1318, -1117 },
- { -8190, 832, 671, -2214 },
- { -10453, -550, 1672, -886 },
- { 1044, 9353, -1651, -5423 },
- { 1034, 8149, -455, -6166 },
- { 761, 8293, -3214, -4838 },
- { 938, 8077, 164, -5130 },
- { 1295, 8673, 2582, -5490 },
- { -314, 7973, -2395, -5231 },
- { -507, 9012, -2497, -5775 },
- { 2396, 8314, -1022, -4673 },
- { -1516, 8501, 1950, -4969 },
- { -308, 7401, 1549, -4866 },
- { -112, 8340, 3003, -4920 },
- { -50, 9315, 1371, -5666 },
- { -659, 9449, 2496, -5547 },
- { 2573, 9148, -2270, -4783 },
- { 830, 7104, -438, -3907 },
- { 522, 10672, -677, -6483 },
- { -1190, 10108, -510, -6518 },
- { -427, 8271, -579, -6315 },
- { 1602, 8113, -1927, -4418 },
- { -2266, 8180, 448, -5190 },
- { -1633, 8816, -226, -5771 },
- { 759, 9481, -105, -5813 },
- { 2254, 6679, -466, -5662 },
- { -88, 6946, 895, -5958 },
- { -1705, 10009, 1394, -5574 },
- { 748, 7943, 540, -6692 },
- { 1411, 7009, 232, -6145 },
- { 697, 7290, -1221, -5342 },
- { -1764, 10580, 1944, -3981 },
- { -1334, 9124, 1195, -3903 },
- { -905, 10067, 635, -5039 },
- { 664, 10680, 49, -4625 },
- { 1374, 9536, -777, -3591 },
- { 252, 9698, -597, -2931 },
- { 824, 9164, -1014, -2144 },
- { 2438, 10569, -2289, -4424 },
- { 2101, 7102, 507, -3614 },
- { 294, 8051, -432, -1518 },
- { -665, 10337, 547, -2852 },
- { 1168, 11989, -492, -5427 },
- { 1344, 6416, 302, -5061 },
- { -1727, 12264, 1507, -4543 },
- { 674, 10889, -902, -3605 },
- { -582, 9504, 300, -3618 },
- { 641, 7654, 689, -2109 },
- { 2065, 9243, 508, -4367 },
- { 1055, 8373, 688, -3144 },
- { -641, 8185, 986, -3307 },
- { 1120, 7426, 1785, -3757 },
- { 1660, 8070, -593, -3104 },
- { 2002, 9467, -1722, -3475 },
- { 2361, 8368, 100, -3709 },
- { -772, 7845, -613, -4988 },
- { 1485, 7430, 1896, -6127 },
- { -432, 7823, -947, -2882 },
- { 313, 11122, -760, -4871 },
- { 412, 8412, -283, -4231 },
- { 1585, 10402, -1884, -3267 },
- { 321, 6952, 773, -3016 },
- { -105, 9014, 121, -2249 },
- { 1585, 10313, -977, -4812 },
- { 1619, 11869, 1306, -6876 },
- { -1168, 8886, -81, -2500 },
- { -395, 10886, 733, -6490 },
- { -4949, 4274, 3992, -1054 },
- { -4241, 5299, 4262, -1584 },
- { -2710, 3862, 4552, -1673 },
- { -4608, 2472, 3672, -1715 },
- { -2843, 2816, 4003, -2326 },
- { -5229, 2964, 5636, 90 },
- { -4924, 3442, 5015, -1096 },
- { -1281, 3313, 5537, -2066 },
- { -3808, 1939, 4351, -919 },
- { -1915, 2585, 4939, -1614 },
- { -3470, 1843, 5562, -682 },
- { -3800, 870, 5827, 144 },
- { -4985, 1452, 4728, -709 },
- { -3745, 2750, 7220, 259 },
- { -1875, 1900, 6514, -826 },
- { -4329, 1574, 7192, 1304 },
- { -5408, 1444, 6208, 631 },
- { -3327, 5312, 5707, -1541 },
- { -6966, 3334, 4034, 1028 },
- { -7484, 4245, 4218, -212 },
- { -6567, 5839, 4539, -512 },
- { -5715, 5935, 3747, -1186 },
- { -6410, 4881, 3356, -1610 },
- { -5146, 2590, 2850, 2172 },
- { -5196, 4095, 2569, -373 },
- { -5043, 6025, 4318, 692 },
- { -5525, 4884, 3513, 370 },
- { -6804, 7533, 5812, -488 },
- { -5657, 2480, 4061, 1234 },
- { -3155, 1472, 6071, 1188 },
- { -3427, 5217, 3442, 858 },
- { -4698, 3013, 5517, 2586 },
- { -4449, 2226, 5418, 3580 },
- { -6395, 3547, 5487, 2028 },
- { -3500, 5019, 4787, 1 },
- { -4038, 2578, 3073, 3151 },
- { -2750, 1955, 4469, 3856 },
- { -5696, 1659, 6118, 2469 },
- { -4350, 1241, 6840, 3126 },
- { -5565, 5058, 5196, 1314 },
- { -1642, 4190, 3948, 607 },
- { -1233, 4108, 4850, -640 },
- { -997, 3428, 3239, 1378 },
- { -6488, 2741, 6926, 2792 },
- { -4188, 3763, 4235, 2018 },
- { -3210, 3224, 5646, 1427 },
- { -5526, 6909, 5070, -627 },
- { -2815, 3994, 3425, 1903 },
- { -2163, 2734, 5423, 145 },
- { -4149, 4247, 2355, 734 },
- { -410, 2521, 4138, -16 },
- { -2411, 2385, 4927, 2105 },
- { -6077, 3591, 3114, 594 },
- { -4186, 4834, 5926, -1004 },
- { -7315, 3369, 5966, 448 },
- { -7042, 5721, 5771, 238 },
- { -4466, 3907, 3535, -1751 },
- { -2116, 3970, 6163, -1392 },
- { -7239, 2143, 8407, 3630 },
- { -5431, 4486, 6486, -42 },
- { -1874, 1617, 6333, 519 },
- { -6478, 2629, 4634, -505 },
- { -7784, 2342, 7216, 1365 },
- { -1154, 1432, 4831, 1544 },
- { -4964, -5801, 1797, 506 },
- { -4436, -6905, 1059, -1237 },
- { -5400, -6886, 884, -290 },
- { -6259, -7103, 523, -227 },
- { -4819, -6450, 1412, -450 },
- { -4056, -6213, 1725, -943 },
- { -5642, -6091, 1357, 605 },
- { -4196, -5678, 2187, -173 },
- { -4726, -5126, 2470, 321 },
- { -6642, -5091, 1507, -1005 },
- { -5304, -5250, 1944, 1579 },
- { -7179, -5520, 1468, -425 },
- { -6033, -4895, 1876, -955 },
- { -6595, -5143, 2207, 1291 },
- { -4224, -4943, 1846, 1792 },
- { -7128, -6950, 539, 724 },
- { -4369, -4901, 2590, 1103 },
- { -7413, -5696, 1712, 1440 },
- { -5885, -6821, 418, 871 },
- { -6828, -5599, 710, -1563 },
- { -6123, -5817, 1358, 1631 },
- { -5291, -5622, 578, 2138 },
- { -7171, -6004, 347, 2208 },
- { -6083, -5251, 2132, 425 },
- { -4329, -5721, 407, -2993 },
- { -5326, -5056, 1119, -1837 },
- { -5485, -5856, 185, -2389 },
- { -6529, -5178, 403, -697 },
- { -6719, -4412, 2726, 871 },
- { -5126, -5629, 1835, -771 },
- { -5622, -4361, 2973, 858 },
- { -5282, -5895, 45, -335 },
- { -4357, -5656, 1696, -1558 },
- { -7139, -6659, 627, -409 },
- { -4415, -6328, 35, 1306 },
- { -7639, -6110, 1134, 197 },
- { -3626, -5592, 2019, 901 },
- { -3547, -5064, 1176, 1738 },
- { -5075, -3899, 2087, 266 },
- { -4086, -6311, 1479, 360 },
- { -6210, -5220, -199, -1477 },
- { -3910, -5063, 1356, -15 },
- { -7616, -4977, 461, 2401 },
- { -6118, -6131, 1258, -563 },
- { -6127, -4968, 1286, -27 },
- { -4121, -5852, 1113, 1476 },
- { -5157, -4881, 1162, -662 },
- { -4637, -5031, 1179, 709 },
- { -5509, -5452, -397, 1224 },
- { -4597, -6861, 646, 467 },
- { -6247, -4043, 468, 278 },
- { -5336, -6465, 874, -1472 },
- { -6998, -6346, 78, -1798 },
- { -4915, -4530, 2756, -203 },
- { -6048, -4373, 1468, 1052 },
- { -4273, -7100, 942, -323 },
- { -6552, -4287, 2351, 69 },
- { -6954, -4613, 722, 1521 },
- { -4201, -5361, 763, -1562 },
- { -6881, -5596, -748, 669 },
- { -6695, -3547, -34, 1299 },
- { -3981, -5728, 84, 111 },
- { -4663, -4809, 2173, -1031 },
- { -6599, -6077, 1303, 256 },
- { -7596, -4265, -5791, -4140 },
- { -6610, -2758, -5288, -3936 },
- { -5880, -3865, -6563, -3088 },
- { -7228, -5510, -7677, -3912 },
- { -8854, -6553, -8318, -5361 },
- { -9362, -5249, -6413, -4319 },
- { -4418, -3110, -6368, -4358 },
- { -5544, -4203, -6863, -5013 },
- { -3056, -4316, -5567, -3181 },
- { -3078, -5999, -5051, -2657 },
- { -5884, -6292, -5756, -4013 },
- { -4825, -4549, -5535, -4053 },
- { -4443, -6126, -5316, -1368 },
- { -3972, -6341, -6098, -2686 },
- { -5751, -2781, -5398, -6230 },
- { -4466, -6135, -5570, -3679 },
- { -4291, -5992, -3564, -5189 },
- { -7189, -4429, -7279, -6082 },
- { -5076, -4433, -2748, -5366 },
- { -6225, -2825, -6833, -5663 },
- { -2989, -4792, -3960, -4492 },
- { -7836, -7773, -7722, -5741 },
- { -6559, -5703, -5844, -5589 },
- { -7612, -5438, -4136, -3774 },
- { -4218, -4176, -6591, -2333 },
- { -4837, -5063, -6581, 322 },
- { -6590, -5990, -2980, -3847 },
- { -5558, -2971, -5489, -1932 },
- { -7001, -5323, -4975, -1697 },
- { -4694, -2688, -6904, -3044 },
- { -8511, -5379, -5767, -2549 },
- { -7548, -5412, -6522, -2572 },
- { -6597, -4973, -6423, -1274 },
- { -6415, -4022, -5168, -1072 },
- { -5528, -5530, -7218, -2345 },
- { -4845, -4805, -5943, -1227 },
- { -6049, -7150, -6744, -2161 },
- { -9061, -7299, -8542, -4375 },
- { -5010, -5546, -5416, -82 },
- { -4135, -4205, -5109, -3373 },
- { -3311, -5869, -4007, -5061 },
- { -5993, -6472, -3962, -4718 },
- { -2966, -5832, -2821, -6305 },
- { -4851, -5152, -2067, -3930 },
- { -3620, -4441, -3362, -5836 },
- { -4469, -5221, -4534, -5592 },
- { -4022, -6335, -4321, -6107 },
- { -4899, -4503, -3084, -3725 },
- { -4490, -8276, -4620, -6236 },
- { -6591, -4342, -7365, -4063 },
- { -6498, -5057, -5553, 485 },
- { -6060, -2714, -7093, -4144 },
- { -6199, -7774, -7094, -4057 },
- { -7536, -6424, -6415, -4265 },
- { -7439, -2454, -6348, -4827 },
- { -5333, -7565, -4417, -4639 },
- { -4353, -7103, -4197, -2689 },
- { -5229, -6549, -5129, -6804 },
- { -6129, -7701, -5236, -4836 },
- { -6797, -3983, -3884, -4406 },
- { -6624, -4467, -4745, -5052 },
- { -3324, -7596, -2720, -6553 },
- { -5473, -6284, -1704, -4511 },
- { -4131, -7263, -3180, -5196 },
- { -7116, -5565, -3469, 685 },
- { -6002, -6021, -3858, 576 },
- { -3144, -8203, -1291, -434 },
- { -6096, -7027, -4004, 1353 },
- { -3943, -7709, -2344, -36 },
- { -4510, -6767, -2642, 631 },
- { -3657, -11541, -2570, -3984 },
- { -5959, -8854, -1333, -867 },
- { -6699, -8866, -1606, -344 },
- { -3836, -7961, -2334, -2028 },
- { -3430, -8045, -3037, -672 },
- { -3868, -9184, -3635, -1819 },
- { -4258, -9060, -2621, -1008 },
- { -3595, -8693, -2022, -752 },
- { -4573, -8048, -3166, -2622 },
- { -4852, -7903, -1405, 256 },
- { -4591, -7057, -1560, 965 },
- { -6963, -7655, -980, 808 },
- { -5179, -6641, -3356, 1196 },
- { -7102, -6941, -2798, 2123 },
- { -6867, -5834, -3320, -770 },
- { -5977, -7369, -2500, -778 },
- { -6160, -6400, -934, -2543 },
- { -6741, -7608, -355, -1289 },
- { -6856, -6466, -1433, -1643 },
- { -4786, -6292, -4970, 376 },
- { -5407, -8866, -2255, -400 },
- { -3814, -6506, -1387, -3620 },
- { -4998, -6137, -1200, -4092 },
- { -5123, -9557, -2849, -1306 },
- { -4259, -6444, -4395, -338 },
- { -5221, -6810, -883, 1225 },
- { -6137, -6215, -2165, 554 },
- { -3895, -6557, -3176, -1829 },
- { -3886, -8188, -87, -954 },
- { -7243, -6707, -2216, -316 },
- { -5592, -7606, 85, -432 },
- { -3957, -7945, -504, -144 },
- { -4617, -7624, 218, -312 },
- { -4797, -8737, -844, -1051 },
- { -4478, -8516, -1401, -454 },
- { -4557, -7058, -302, -2332 },
- { -6623, -7736, -271, -50 },
- { -3157, -7532, -1111, -2207 },
- { -3590, -7300, -1271, 517 },
- { -4442, -7306, -507, 590 },
- { -6458, -7524, -2807, 666 },
- { -4991, -8466, -3363, -785 },
- { -7474, -7541, -1056, -1839 },
- { -7501, -8316, -938, -180 },
- { -5329, -7739, -579, -2341 },
- { -4549, -7063, -176, -3539 },
- { -5191, -8612, -1504, -4250 },
- { -3083, -7058, -2251, 32 },
- { -4003, -7043, -1093, -791 },
- { -5523, -8093, -678, -114 },
- { -3022, -10265, -2070, -3109 },
- { -3905, -6274, -182, -3652 },
- { -3269, -9217, -551, -2650 },
- { -3138, -9314, -1726, -1704 },
- { -4420, -10339, -1744, -3459 },
- { -4163, -8609, -2298, -4113 },
- { -5566, -6505, -1241, -463 },
- { -3130, -9746, -2352, -4884 },
- { -7825, -3439, 1451, -1468 },
- { -8451, -3318, 2360, -435 },
- { -8462, -4130, 1438, -1024 },
- { -9425, -4564, 1328, -689 },
- { -11014, -3202, 2278, 2080 },
- { -8269, -2761, -146, -440 },
- { -7497, -2618, -166, 413 },
- { -8250, -3060, 522, -2133 },
- { -8365, -5366, 1347, -451 },
- { -8589, -3979, 2943, 714 },
- { -8111, -2572, 1272, -1748 },
- { -7830, -5193, 605, -1484 },
- { -8119, -4736, 2141, 256 },
- { -7724, -4769, 1463, -812 },
- { -7363, -3911, 2540, 4 },
- { -7974, -3397, 2363, 1366 },
- { -7359, -4204, 1752, -958 },
- { -7622, -3505, 660, 916 },
- { -9934, -3665, 3165, 828 },
- { -8721, -4162, 62, 1718 },
- { -9433, -4768, 2722, 1234 },
- { -7960, -4496, 138, 1528 },
- { -8198, -3454, -443, 631 },
- { -7756, -2246, 655, 1137 },
- { -8841, -3145, 1113, 829 },
- { -7817, -3298, 1251, 230 },
- { -9413, -2733, 323, -1862 },
- { -9408, -4168, 1270, 1549 },
- { -9037, -3892, -942, 283 },
- { -8255, -3849, 1301, 1762 },
- { -9057, -3987, -41, -682 },
- { -9441, -4187, 2019, -111 },
- { -9740, -3178, 1602, -871 },
- { -8344, -2474, 1461, 1506 },
- { -9752, -2925, 1996, 1243 },
- { -9199, -3796, 180, 537 },
- { -9060, -2405, 1140, -1562 },
- { -9348, -2376, 309, -162 },
- { -10786, -3182, -5, -1500 },
- { -8142, -4540, -434, -826 },
- { -7528, -2341, 1104, -73 },
- { -9360, -2658, 3062, 56 },
- { -8267, -2335, 2000, -1193 },
- { -12169, -3154, 1287, -640 },
- { -11398, -2120, 946, -1163 },
- { -8940, -4559, 328, -1696 },
- { -11025, -4213, 2813, 840 },
- { -9224, -3581, 2224, 2039 },
- { -8943, -3337, 1248, -1298 },
- { -7900, -4042, 485, -2080 },
- { -9221, -1947, 2191, -880 },
- { -10762, -1800, 2516, -324 },
- { -10095, -2238, 981, -1335 },
- { -11908, -2808, 3255, 645 },
- { -10640, -4105, 1283, -595 },
- { -7663, -2863, 2467, -797 },
- { -10712, -3854, 3710, 1538 },
- { -10823, -2893, 1408, -801 },
- { -9874, -3832, 256, -1638 },
- { -10394, -3391, 2315, -94 },
- { -11525, -4079, 4153, 2122 },
- { -9546, -2088, 1541, 481 },
- { -8731, -2433, 1042, 2160 },
- { -7852, -3977, -1370, 1677 },
- { 7072, -3420, 1398, -1741 },
- { 6180, -1976, 1280, -3557 },
- { 7692, -1793, 2844, -1700 },
- { 8363, -1773, 3104, -2679 },
- { 9213, -3266, 3756, -3542 },
- { 9650, -2644, 1426, -1318 },
- { 7712, -2796, 3686, -1975 },
- { 7316, -3517, 2821, -622 },
- { 7434, -2594, 2305, -2264 },
- { 7237, -1797, 255, -3114 },
- { 8663, -1983, 1338, -3056 },
- { 6616, -952, 4059, -2652 },
- { 8823, -1327, 1362, -1356 },
- { 9938, -1722, 1287, -2362 },
- { 7207, -1057, 1913, -1315 },
- { 7508, -1585, 870, -1982 },
- { 8217, -3680, 1417, -3170 },
- { 8329, -2541, 1684, -585 },
- { 8062, -2335, 252, -2800 },
- { 8204, -4108, 3097, -2569 },
- { 7701, -3367, 576, -3008 },
- { 7350, -786, 2414, -2129 },
- { 6948, -2568, 1607, -225 },
- { 7684, -2387, 1308, -3449 },
- { 8306, -3458, 2394, -1454 },
- { 8438, -2781, 1043, -1362 },
- { 9175, -2076, 2144, -1987 },
- { 8347, -2709, 3489, -4301 },
- { 5696, -2377, 2870, 851 },
- { 8825, -1243, 2219, -2603 },
- { 8801, -1614, 584, -2513 },
- { 8413, -384, 1421, -2244 },
- { 9228, -3050, 3279, -2164 },
- { 6342, -2698, 3547, -107 },
- { 10053, -2476, 2837, -3168 },
- { 7439, -604, 3177, -3991 },
- { 7749, -1064, 4329, -4855 },
- { 8655, -2177, 2252, -3519 },
- { 8490, -228, 1958, -3233 },
- { 10513, -2968, 1911, -2340 },
- { 8146, -862, 1884, -1723 },
- { 7788, -666, 3004, -2891 },
- { 7785, -1620, 4133, -3417 },
- { 10262, -3731, 3455, -2971 },
- { 8570, -905, 4519, -4649 },
- { 9129, -2562, 463, -2465 },
- { 9451, -3587, 1904, -3056 },
- { 6549, -2236, 3010, -4523 },
- { 7175, -2684, 2967, -3458 },
- { 9872, -3278, 1054, -2472 },
- { 9153, -931, 1217, -2565 },
- { 8789, -3469, 753, -2568 },
- { 6683, -3791, 1797, -3968 },
- { 6801, -1977, 2311, -452 },
- { 6336, -1572, 2612, -3264 },
- { 7996, -1008, 730, -2964 },
- { 7521, -1059, 1573, -3694 },
- { 8148, -3973, 2600, -3572 },
- { 7765, -1532, 2528, -3856 },
- { 7404, -3918, 4472, -143 },
- { 8894, -1398, 3299, -3685 },
- { 5768, -2041, 1487, -637 },
- { 5131, -2865, 2463, -811 },
- { 6439, -1568, 3500, -1550 },
- { -8878, -6798, -5319, -1452 },
- { -6332, -9713, -3112, -990 },
- { -8444, -6316, -3694, -687 },
- { -6123, -10840, -3637, -4358 },
- { -4784, -9580, -4577, -2581 },
- { -6108, -10515, -4859, -2524 },
- { -7605, -7518, -2327, -2797 },
- { -9662, -8775, -2467, -2010 },
- { -6494, -7523, -4715, -118 },
- { -8290, -8982, -1672, -317 },
- { -8798, -11051, -3888, -1426 },
- { -6273, -6623, -6791, -142 },
- { -8313, -7668, -2141, -1275 },
- { -6453, -8412, -3589, -4102 },
- { -6747, -7750, -5690, -2498 },
- { -7814, -6693, -3174, -2446 },
- { -10383, -10130, -3931, -2364 },
- { -10606, -8467, -5539, -2772 },
- { -9475, -6671, -3305, -2271 },
- { -8982, -9457, -5635, -4005 },
- { -10111, -7965, -6515, -4180 },
- { -7301, -6479, -5364, 720 },
- { -9543, -8999, -7921, -912 },
- { -9534, -8562, -3469, -384 },
- { -7601, -10344, -3205, -1127 },
- { -8088, -8620, -4954, -2888 },
- { -8202, -8406, -7038, -3775 },
- { -7312, -8324, -3334, -1775 },
- { -8566, -9262, -8071, -4174 },
- { -7068, -11300, -5573, -2907 },
- { -8295, -8952, -4366, -1544 },
- { -11104, -10210, -2285, -384 },
- { -5213, -7520, -5008, -1339 },
- { -5889, -7940, -5987, -1385 },
- { -10816, -8201, -4153, -1485 },
- { -10277, -8919, -6315, -1652 },
- { -5888, -10320, -3821, -1733 },
- { -10497, -7181, -6083, -3032 },
- { -7721, -9724, -6591, -5336 },
- { -5688, -7894, -3486, -2552 },
- { -10014, -10500, -3247, -820 },
- { -6301, -8765, -4506, -2923 },
- { -8261, -7847, -6213, -1552 },
- { -10212, -7481, -8113, -3954 },
- { -6938, -10874, -6074, -4703 },
- { -7183, -10968, -4446, -1773 },
- { -7120, -9193, -1966, -2509 },
- { -6234, -9263, -2313, -4284 },
- { -8503, -9857, -2429, -608 },
- { -9372, -7844, -8391, -2120 },
- { -7951, -7157, -6535, -11 },
- { -7256, -9473, -2172, -660 },
- { -10063, -9612, -2515, -15 },
- { -6684, -9134, -6109, -4206 },
- { -8204, -11932, -5220, -2306 },
- { -9710, -6706, -4115, -3275 },
- { -6855, -7078, -2409, -4447 },
- { -7344, -7673, -4479, -4116 },
- { -8851, -6842, -4927, -2948 },
- { -8927, -10452, -5633, -2194 },
- { -8627, -9002, -7176, -1575 },
- { -8209, -9722, -7021, -3324 },
- { -3770, -10249, -3623, -4816 },
- { -8183, -7465, -4090, 646 },
- { -8163, -7149, 200, 498 },
- { -8289, -6266, 686, -206 },
- { -10030, -6241, -1032, -1864 },
- { -8793, -8327, -773, -169 },
- { -9149, -6215, 969, -15 },
- { -8303, -5859, -7, 2006 },
- { -9682, -7283, 255, 1322 },
- { -9293, -7227, 71, -231 },
- { -8525, -6215, 287, -837 },
- { -10477, -5379, 1159, 1449 },
- { -10726, -7856, -130, 102 },
- { -8694, -7461, -1210, 690 },
- { -9367, -5324, 1103, 3170 },
- { -10686, -8055, -831, 1633 },
- { -9201, -6873, -2704, 2258 },
- { -8421, -5358, -1405, 226 },
- { -9066, -5830, -307, -1571 },
- { -11150, -7381, -2746, -900 },
- { -9978, -5925, -2006, -437 },
- { -9464, -4741, -273, 1061 },
- { -10543, -6684, -1113, 1660 },
- { -10073, -5576, 1083, -269 },
- { -8826, -5763, 1600, 1486 },
- { -10445, -9071, -1253, -64 },
- { -12085, -5799, 2, 769 },
- { -12939, -6663, 1650, 1437 },
- { -10932, -6434, -1252, -649 },
- { -11650, -7826, -2053, 710 },
- { -12122, -6733, -1889, -731 },
- { -9093, -6095, -2463, -842 },
- { -10977, -4364, 469, 420 },
- { -11488, -6908, -521, 893 },
- { -9669, -5478, -842, 337 },
- { -10606, -5203, -632, -1361 },
- { -10198, -6284, 1662, 1277 },
- { -10135, -5292, 2435, 3493 },
- { -11027, -6561, 655, 56 },
- { -10977, -5030, 1127, -358 },
- { -12766, -3986, 1348, -335 },
- { -14244, -7731, 264, 317 },
- { -15124, -10309, -508, 1447 },
- { -12821, -8638, -608, 137 },
- { -13076, -8693, -2852, -431 },
- { -11156, -5546, -2252, -1600 },
- { -8692, -7366, -819, -1223 },
- { -12507, -9816, -1714, -121 },
- { -10712, -6666, 544, 3349 },
- { -12462, -5890, -2491, -2318 },
- { -12468, -7226, 437, 232 },
- { -11300, -5226, 2068, 687 },
- { -11994, -8320, -626, 2728 },
- { -12222, -5476, 1142, 18 },
- { -10277, -8122, -2418, 2003 },
- { -13418, -6115, -3563, -2802 },
- { -14759, -9834, -1243, 21 },
- { -13699, -5665, 1525, 507 },
- { -16269, -9476, -701, 163 },
- { -12677, -5437, -247, -1019 },
- { -11827, -4295, -181, -1243 },
- { -12847, -4496, 2984, 1123 },
- { -13860, -7915, -1166, -547 },
- { -12276, -8145, -2290, -1527 },
- { -11417, -4830, 2983, 1854 },
- { -11793, -6002, 1163, 1940 },
- { 11443, -4920, -3235, 3151 },
- { 11300, -6616, -1506, 1175 },
- { 9198, -4628, -2060, 2390 },
- { 10532, -4027, -643, 912 },
- { 9902, -3573, -1606, 1327 },
- { 9653, -3536, -2240, 1869 },
- { 9948, -5171, -423, 2662 },
- { 12316, -4004, -1989, 281 },
- { 12125, -4800, -1265, -163 },
- { 10650, -2617, -2337, 1462 },
- { 9909, -4968, -2376, 916 },
- { 12944, -4647, -1958, 460 },
- { 12988, -5283, -1141, 41 },
- { 12321, -2915, -3621, 1025 },
- { 11449, -2894, -2728, 351 },
- { 12087, -3041, -2002, -32 },
- { 11558, -4031, -1343, -399 },
- { 12983, -3740, -3516, 1245 },
- { 12099, -2515, -2752, 225 },
- { 12515, -3465, -2701, 550 },
- { 14683, -5022, -5272, 2996 },
- { 12260, -3383, -1215, -528 },
- { 13810, -5422, -2443, 1166 },
- { 13421, -5378, -1886, 721 },
- { 12961, -4259, -2594, 796 },
- { 12266, -2104, -4768, 1591 },
- { 13523, -4710, -3045, 1342 },
- { 12437, -2099, -5610, 2117 },
- { 11850, -2183, -3497, 661 },
- { 12275, -3936, -597, -697 },
- { 12459, -5253, -517, -544 },
- { 12835, -4094, -1322, -168 },
- { 14360, -5677, -3305, 1859 },
- { 13905, -4552, -4309, 2117 },
- { 11559, -3412, -1847, -81 },
- { 13379, -3167, -5764, 2746 },
- { 11910, -1634, -4342, 1052 },
- { 12662, -4742, 71, -974 },
- { 13057, -3254, -4424, 1705 },
- { 15046, -5706, -4851, 3019 },
- { 14162, -4142, -5514, 2843 },
- { 12764, -1845, -6684, 2888 },
- { 13714, -2374, -7838, 3857 },
- { 13295, -1663, -8293, 4073 },
- { 10032, -4152, -3403, 1421 },
- { 10942, -5386, -2222, 950 },
- { 10532, -6385, -1750, 1925 },
- { 10273, -5972, -1534, 643 },
- { 10605, -4782, -1695, 27 },
- { 10988, -5153, -1123, -341 },
- { 11629, -5884, -1060, 48 },
- { 10441, -4045, -2431, 311 },
- { 10788, -3595, -4171, 1807 },
- { 12110, -5686, -2127, 976 },
- { 11746, -4773, -2639, 891 },
- { 11541, -5299, -3031, 1732 },
- { 11416, -2559, -5359, 2198 },
- { 11583, -5376, -704, 677 },
- { 10416, -3214, -3516, 872 },
- { 9651, -5435, -1618, 3255 },
- { 9973, -5133, -996, 3923 },
- { 11707, -4643, -430, -796 },
- { 10994, -2709, -3587, 2302 },
- { 10716, -5118, -645, 270 },
- { 14100, -10314, 1095, 1531 },
- { 12944, -8049, 1105, -741 },
- { 13276, -7035, -511, 274 },
- { 14008, -7254, -283, 139 },
- { 11594, -6536, -91, 1671 },
- { 11732, -8645, 746, 15 },
- { 14613, -7085, -1578, 1183 },
- { 13083, -6224, -750, -4 },
- { 13988, -6256, -1592, 820 },
- { 14678, -8683, 441, 126 },
- { 15571, -8872, -521, 1139 },
- { 15642, -9533, 341, 697 },
- { 15960, -9586, -168, 1121 },
- { 15464, -10239, 1433, -1 },
- { 14934, -7887, -1046, 1080 },
- { 15252, -7630, -1899, 1628 },
- { 15485, -8384, -1234, 1484 },
- { 15962, -8638, -1815, 1931 },
- { 16501, -10664, 398, 1167 },
- { 16146, -10145, 411, 918 },
- { 14573, -7475, -697, 601 },
- { 14302, -7996, 28, 257 },
- { 14769, -6792, -2286, 1574 },
- { 14144, -6137, -2169, 1257 },
- { 14770, -6271, -3111, 1933 },
- { 14110, -8312, 1083, -531 },
- { 15235, -6991, -2993, 2174 },
- { 13222, -5805, 547, -891 },
- { 14796, -8762, 1254, -246 },
- { 16040, -9181, -1005, 1551 },
- { 16487, -10086, -373, 1420 },
- { 15077, -9479, 966, 51 },
- { 13026, -6468, 932, -1080 },
- { 12703, -6152, -33, -573 },
- { 15641, -6810, -4128, 2874 },
- { 13282, -7673, 1583, -1283 },
- { 12373, -7150, 1512, -917 },
- { 12992, -7751, -678, 783 },
- { 10907, -6858, -313, 2597 },
- { 13026, -8963, 125, 2152 },
- { 12770, -9946, 1957, -505 },
- { 12482, -6849, -1268, 833 },
- { 13790, -6181, -138, -279 },
- { 12709, -8382, 2044, 227 },
- { 12244, -6630, 203, -457 },
- { 14209, -6816, -1032, 632 },
- { 15134, -8267, -288, 640 },
- { 13619, -6157, -1090, 356 },
- { 14044, -7413, 725, -484 },
- { 12958, -7753, 2585, -1980 },
- { 13188, -8396, 2306, -1558 },
- { 14379, -9980, 2132, -688 },
- { 14275, -9857, 1162, 179 },
- { 13690, -8648, 1621, -889 },
- { 11770, -6829, -746, 278 },
- { 12732, -8202, 286, 90 },
- { 13630, -10146, 1867, -207 },
- { 12072, -8740, 1299, -645 },
- { 12852, -9492, 1226, 62 },
- { 11792, -7382, -54, -116 },
- { 13779, -9014, 487, 351 },
- { 11951, -7729, 121, 834 },
- { 11970, -9781, 2276, -4 },
- { 12680, -7984, 2787, -787 },
- { 13300, -14488, 6408, -1927 },
- { 13635, -15355, 9153, -3073 },
- { 12804, -13566, 5517, -1625 },
- { 16624, -10854, 1690, 28 },
- { 20387, -18532, 6162, -261 },
- { 16515, -12642, 3392, -519 },
- { 15800, -11095, 2151, -202 },
- { 16824, -11790, 1651, 599 },
- { 17604, -13213, 2563, 538 },
- { 17892, -14177, 3562, 147 },
- { 16987, -11399, 869, 1052 },
- { 17003, -12456, 2442, 265 },
- { 21657, -21806, 9198, -1250 },
- { 16825, -13341, 3980, -686 },
- { 17525, -12714, 1887, 805 },
- { 16419, -11034, 1216, 617 },
- { 20931, -19939, 7469, -684 },
- { 18452, -15390, 4573, -191 },
- { 14778, -10077, 2841, -1209 },
- { 17402, -13319, 3042, 160 },
- { 19365, -17922, 7087, -1061 },
- { 16298, -11941, 2810, -351 },
- { 19087, -16176, 4775, -84 },
- { 17666, -12289, 938, 1224 },
- { 18581, -15894, 5132, -430 },
- { 19823, -16717, 4142, 545 },
- { 19960, -19423, 8400, -1492 },
- { 18973, -16817, 5906, -594 },
- { 19079, -15431, 3528, 503 },
- { 16667, -12485, 4467, -1302 },
- { 19791, -17797, 6196, -529 },
- { 20005, -17606, 5354, -20 },
- { 20123, -18599, 6886, -728 },
- { 19068, -14805, 2394, 1105 },
- { 14443, -13723, 5631, -2029 },
- { 14730, -14231, 5631, -1450 },
- { 16089, -15959, 7271, -2029 },
- { 13473, -11200, 3236, -924 },
- { 14413, -10902, 2347, -267 },
- { 17666, -18662, 11381, -3496 },
- { 14749, -11042, 3305, -275 },
- { 15304, -10486, 1869, -240 },
- { 14809, -12126, 3369, -616 },
- { 16896, -16561, 7307, -1845 },
- { 15782, -14336, 5380, -1264 },
- { 16395, -15520, 6415, -1588 },
- { 13681, -11114, 2584, -320 },
- { 14244, -12326, 4480, -1632 },
- { 15247, -13119, 4265, -898 },
- { 13987, -12091, 3469, -597 },
- { 13941, -12770, 4240, -839 },
- { 13771, -13627, 5252, -1384 },
- { 15010, -16074, 7592, -2249 },
- { 15852, -17226, 8619, -2655 },
- { 18921, -16916, 6875, -1501 },
- { 14909, -11678, 2768, -295 },
- { 18988, -18353, 8424, -2070 },
- { 15457, -15080, 6218, -1513 },
- { 14916, -15512, 6949, -1883 },
- { 18108, -14702, 4681, -701 },
- { 17600, -15733, 5616, -775 },
- { 14070, -13683, 6472, -2626 },
- { 13832, -11914, 5201, -2232 },
- { 18846, -19009, 9192, -1961 },
- { -11981, -10994, -6324, -2264 },
- { -10976, -9047, -6546, -3828 },
- { -11288, -10532, -7014, -4191 },
- { -10139, -10189, -7799, -2688 },
- { -10555, -9988, -9181, -2040 },
- { -11596, -11339, -10022, -2707 },
- { -13400, -13395, -11306, -4206 },
- { -9774, -12281, -7466, -4133 },
- { -10842, -13125, -8777, -4956 },
- { -11964, -15082, -9779, -5095 },
- { -9382, -10188, -9053, -4927 },
- { -11562, -11296, -3651, -985 },
- { -9287, -10083, -7918, -4069 },
- { -12821, -16556, -11410, -6195 },
- { -12628, -8959, -4521, -1113 },
- { -13845, -11581, -3649, -681 },
- { -12685, -10269, -5483, -1275 },
- { -14988, -12874, -5107, -1189 },
- { -13761, -11367, -6202, -1804 },
- { -13225, -11249, -7820, -3354 },
- { -14809, -11992, -3202, -312 },
- { -15620, -15519, -10210, -3433 },
- { -12954, -10200, -3139, -611 },
- { -11536, -9981, -5284, -923 },
- { -13034, -12417, -4612, -1098 },
- { -16911, -15505, -6123, -1352 },
- { -17396, -17685, -8330, -2171 },
- { -14120, -10764, -2265, -99 },
- { -12598, -7367, -5406, -3530 },
- { -14143, -12793, -10909, -5226 },
- { -14692, -16871, -11626, -5554 },
- { -12581, -11197, -9194, -3837 },
- { -16752, -16726, -9746, -2808 },
- { -10600, -10358, -6560, -1227 },
- { -14573, -13312, -8957, -3393 },
- { -10172, -8463, -8579, -3387 },
- { -11418, -12421, -5522, -1842 },
- { -11855, -14204, -6669, -2625 },
- { -13308, -8191, -3941, -2194 },
- { -10007, -12266, -5022, -1811 },
- { -13532, -15771, -9497, -3175 },
- { -11760, -11148, -10339, -5529 },
- { -12149, -12763, -11198, -3697 },
- { -12029, -12119, -8555, -1792 },
- { -16995, -19957, -11447, -3471 },
- { -13144, -14504, -9988, -3191 },
- { -9938, -11064, -6139, -3162 },
- { -8873, -11550, -8294, -6550 },
- { -9303, -13010, -6150, -2711 },
- { -15463, -10469, -1766, -170 },
- { -15985, -11693, -3007, -650 },
- { -17142, -10671, -1434, 47 },
- { -16063, -13858, -4817, -1058 },
- { -19446, -19599, -9594, -2464 },
- { -20076, -18744, -8313, -1889 },
- { -15047, -16085, -7590, -2250 },
- { -13481, -16195, -8552, -2998 },
- { -13829, -14869, -6704, -1932 },
- { -16357, -18484, -9802, -2959 },
- { -10551, -8393, -9303, -5070 },
- { -11345, -9156, -5641, -3107 },
- { -13217, -13449, -9270, -4541 },
- { -11988, -13732, -9995, -6374 },
- { -11007, -9519, -5168, -4107 },
- { 9930, -7858, 8061, -4375 },
- { 8274, -7867, 5992, -2096 },
- { 9692, -9675, 7621, -3670 },
- { 9589, -8110, 6509, -3010 },
- { 12617, -11976, 10122, -5360 },
- { 11867, -8895, 7948, -5323 },
- { 10388, -10482, 9234, -4324 },
- { 8188, -8220, 7810, -2737 },
- { 10407, -8787, 4806, -1930 },
- { 10348, -8845, 9233, -6614 },
- { 9422, -7091, 4820, -2878 },
- { 9758, -9796, 5584, -2256 },
- { 10188, -7994, 5347, -3343 },
- { 11133, -7455, 4015, -2306 },
- { 10676, -10744, 6093, -2629 },
- { 11522, -12184, 7848, -3375 },
- { 8805, -9883, 5317, -3071 },
- { 9498, -9654, 6555, -3592 },
- { 10488, -8008, 4066, -1252 },
- { 11261, -8930, 6068, -2738 },
- { 12180, -10397, 5027, -1531 },
- { 9138, -8531, 3601, -1959 },
- { 8107, -8380, 4970, -2061 },
- { 9737, -13248, 6438, -2617 },
- { 11178, -10423, 2622, -522 },
- { 9572, -12372, 5199, -2019 },
- { 12057, -12144, 4147, -1099 },
- { 9047, -9925, 2516, -665 },
- { 10790, -8030, 5882, -4386 },
- { 7199, -8426, 6337, -2841 },
- { 7778, -8285, 3529, -3442 },
- { 7559, -10569, 3484, -1332 },
- { 9404, -8115, 7484, -5541 },
- { 7792, -11976, 5546, -2573 },
- { 9313, -10264, 7661, -5195 },
- { 6701, -10725, 4370, -1784 },
- { 4918, -11361, 4507, -4527 },
- { 5147, -12305, 3978, -5556 },
- { 6525, -9899, 4481, -3129 },
- { 7538, -12855, 6060, -4826 },
- { 8659, -12111, 7159, -4430 },
- { 8440, -11304, 4547, -1747 },
- { 9216, -10918, 3507, -1195 },
- { 6165, -9254, 4771, -4677 },
- { 9163, -11019, 5637, -4935 },
- { 13441, -11509, 6676, -2434 },
- { 7912, -9398, 6663, -4048 },
- { 11723, -13745, 8131, -4148 },
- { 6065, -10257, 5005, -6327 },
- { 11618, -12417, 5336, -1894 },
- { 8891, -13924, 8407, -6131 },
- { 9622, -12563, 7908, -5109 },
- { 11479, -10315, 8349, -3991 },
- { 11676, -14103, 6611, -2330 },
- { 11951, -8953, 3829, -1550 },
- { 10486, -8044, 10493, -5920 },
- { 11801, -10769, 9763, -5305 },
- { 6109, -8676, 5827, -1346 },
- { 7030, -9611, 5624, -5761 },
- { 12808, -12886, 8683, -4148 },
- { 13213, -10464, 6381, -3189 },
- { 11796, -13681, 10703, -6075 },
- { 9639, -7949, 9625, -3944 },
- { 8538, -6997, 5309, 453 }
-};
diff --git a/src/libdts/tables_fir.h b/src/libdts/tables_fir.h
deleted file mode 100644
index 892a93204..000000000
--- a/src/libdts/tables_fir.h
+++ /dev/null
@@ -1,2085 +0,0 @@
-/*
- * fir.h
- * Copyright (C) 2004 Gildas Bazin <gbazin@videolan.org>
- *
- * This file is part of dtsdec, a free DTS Coherent Acoustics stream decoder.
- * See http://www.videolan.org/dtsdec.html for updates.
- *
- * dtsdec is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * dtsdec is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-double fir_32bands_perfect[] =
-{
-+1.135985195E-010,
--6.022448247E-007,
-+9.742954035E-007,
-+7.018770981E-011,
--6.628192182E-007,
-+1.085227950E-006,
--1.608403011E-008,
--6.982898526E-007,
-+1.162929266E-006,
--5.083275667E-008,
--7.020648809E-007,
-+1.194632091E-006,
--1.543309907E-007,
--6.767839409E-007,
-+1.179182050E-006,
--3.961981463E-007,
--6.262345096E-007,
-+1.033426656E-006,
--7.342250683E-007,
--5.564140224E-007,
-+9.451737242E-007,
--3.970030775E-007,
-+7.003467317E-007,
-+1.975324267E-006,
--4.741137047E-007,
-+8.419976893E-007,
-+1.190443072E-006,
-+5.234479659E-007,
-+6.402664354E-008,
--1.470520488E-006,
-+2.014677420E-007,
--3.246264413E-008,
--1.853591357E-006,
-+7.834767501E-008,
--3.809887872E-008,
-+7.198007665E-007,
-+8.434094667E-008,
-+3.086857760E-006,
--6.702406963E-010,
-+6.437721822E-008,
-+6.084746474E-006,
--1.613285505E-009,
-+1.189317118E-006,
-+9.561075785E-006,
--2.682709610E-009,
-+2.497214155E-006,
-+1.309637537E-005,
--3.399493131E-009,
-+3.617151151E-006,
-+2.263354872E-005,
-+1.314406006E-008,
-+3.157242645E-006,
-+2.847247197E-005,
-+7.506701927E-009,
-+2.319611212E-006,
-+3.415624451E-005,
-+2.788728892E-008,
-+7.869333785E-006,
-+3.946387005E-005,
-+1.444918922E-007,
-+9.826449968E-006,
-+4.425736552E-005,
-+3.132386439E-007,
-+1.177108606E-005,
-+4.839275425E-005,
-+1.399798180E-006,
-+1.379448349E-005,
-+5.176846025E-005,
-+2.032118118E-006,
-+1.571428584E-005,
-+5.429694284E-005,
-+2.715013807E-006,
-+1.743183020E-005,
-+5.595519906E-005,
-+3.453840463E-006,
-+1.884208177E-005,
-+4.916387297E-006,
-+4.195037945E-006,
-+1.987093310E-005,
-+9.299508747E-006,
-+4.896494374E-006,
-+2.042970118E-005,
-+1.356193479E-005,
-+5.516381407E-006,
--3.144468428E-005,
-+1.751866148E-005,
-+6.015239251E-006,
--3.334947178E-005,
-+2.093936746E-005,
-+6.361419310E-006,
--3.460439257E-005,
-+2.362549276E-005,
-+8.006985809E-006,
--3.515914432E-005,
-+2.537086584E-005,
-+8.087732567E-006,
--3.495384954E-005,
-+2.618136386E-005,
-+7.941360309E-006,
--3.397853652E-005,
-+2.554462844E-005,
-+7.568834008E-006,
--3.225446198E-005,
-+3.018750249E-005,
-+6.986399967E-006,
--2.978993689E-005,
-+2.570833203E-005,
-+6.225028756E-006,
--2.677291741E-005,
-+1.985177369E-005,
-+5.315936960E-006,
--1.806914770E-005,
-+1.191342653E-005,
-+4.429412002E-006,
--1.776598037E-005,
-+2.525620175E-006,
-+3.332600045E-006,
--1.661818715E-005,
--1.521241393E-005,
-+8.427224429E-007,
--1.207003334E-005,
--1.617751332E-005,
-+4.341498823E-007,
--6.993315310E-006,
-+1.992636317E-005,
-+9.458596395E-008,
--5.633860383E-007,
-+1.774702469E-005,
-+2.975164826E-008,
--9.984935332E-007,
-+4.624524081E-005,
-+5.610509834E-005,
--5.729619297E-004,
-+4.244441516E-004,
-+6.568001118E-005,
--6.358824321E-004,
-+2.206075296E-004,
-+7.513730816E-005,
--7.021900383E-004,
--2.719412748E-007,
-+8.413690375E-005,
--7.698345580E-004,
--2.382978710E-004,
-+8.757545584E-005,
--8.385353722E-004,
--4.935106263E-004,
-+9.517164290E-005,
--9.078957955E-004,
--7.658848190E-004,
-+1.020687996E-004,
--9.775133803E-004,
--1.055365428E-003,
-+1.084438481E-004,
--1.046945457E-003,
--1.361547387E-003,
-+1.140582463E-004,
--1.115717343E-003,
--1.684492454E-003,
-+1.187910311E-004,
--1.183370827E-003,
--2.023874084E-003,
-+1.224978914E-004,
--1.252829796E-003,
--2.379294252E-003,
-+1.250260248E-004,
--1.316190348E-003,
--2.750317100E-003,
-+1.262027217E-004,
--1.376571832E-003,
--3.136433195E-003,
-+1.226499153E-004,
--1.433344092E-003,
--3.537061159E-003,
-+1.213575742E-004,
--1.485876855E-003,
--3.951539751E-003,
-+1.180980107E-004,
--1.533520175E-003,
--4.379155114E-003,
-+1.126275165E-004,
--1.575609902E-003,
--4.819062538E-003,
-+1.047207043E-004,
--1.611457788E-003,
--5.270531867E-003,
-+9.417100227E-005,
--1.640390139E-003,
--5.732392892E-003,
-+8.078388782E-005,
--1.661288203E-003,
--6.203945260E-003,
-+6.447290798E-005,
--1.674512983E-003,
--6.683901884E-003,
-+4.491530854E-005,
--1.678415807E-003,
--7.170005701E-003,
-+2.470704203E-005,
--1.672798418E-003,
--7.664063945E-003,
--1.714242217E-006,
--1.656501088E-003,
--8.162760176E-003,
--3.193307566E-005,
--1.633993932E-003,
--8.665001951E-003,
--6.541742187E-005,
--1.593449386E-003,
--9.170533158E-003,
--1.024175072E-004,
-+1.542080659E-003,
--9.676489048E-003,
--1.312203676E-004,
-+1.479332102E-003,
--1.018219907E-002,
--1.774113771E-004,
-+1.395521569E-003,
--1.068630442E-002,
--2.233728592E-004,
-+1.303116791E-003,
--1.118756086E-002,
--2.682086197E-004,
-+1.196175464E-003,
--1.168460958E-002,
--3.347633174E-004,
-+1.073757303E-003,
--1.217562053E-002,
--3.906481725E-004,
-+9.358961834E-004,
--1.265939046E-002,
--4.490280990E-004,
-+7.817269652E-004,
--1.313448418E-002,
--5.099929986E-004,
-+6.114174030E-004,
--1.359948888E-002,
--1.405300573E-002,
-+1.572482102E-002,
-+4.935106263E-004,
--1.449365262E-002,
-+1.533095632E-002,
-+2.382978710E-004,
--1.492007636E-002,
-+1.492007636E-002,
-+2.719412748E-007,
--1.533095632E-002,
-+1.449365262E-002,
--2.206075296E-004,
--1.572482102E-002,
-+1.405300573E-002,
--4.244441516E-004,
--1.610082202E-002,
-+1.359948888E-002,
--6.114174030E-004,
--1.645756140E-002,
-+1.313448418E-002,
--7.817269652E-004,
--1.679391414E-002,
-+1.265939046E-002,
--9.358961834E-004,
--1.710879989E-002,
-+1.217562053E-002,
--1.073757303E-003,
--1.740120351E-002,
-+1.168460958E-002,
--1.196175464E-003,
--1.767017506E-002,
-+1.118756086E-002,
--1.303116791E-003,
--1.791484281E-002,
-+1.068630442E-002,
--1.395521569E-003,
--1.813439466E-002,
-+1.018219907E-002,
--1.479332102E-003,
--1.832821220E-002,
-+9.676489048E-003,
--1.542080659E-003,
--1.849545911E-002,
-+9.170533158E-003,
-+1.593449386E-003,
--1.863567345E-002,
-+8.665001951E-003,
-+1.633993932E-003,
--1.874836907E-002,
-+8.162760176E-003,
-+1.656501088E-003,
--1.883326657E-002,
-+7.664063945E-003,
-+1.672798418E-003,
--1.889026538E-002,
-+7.170005701E-003,
-+1.678415807E-003,
--1.891860925E-002,
-+6.683901884E-003,
-+1.674512983E-003,
-+1.891860925E-002,
-+6.203945260E-003,
-+1.661288203E-003,
-+1.889026538E-002,
-+5.732392892E-003,
-+1.640390139E-003,
-+1.883326657E-002,
-+5.270531867E-003,
-+1.611457788E-003,
-+1.874836907E-002,
-+4.819062538E-003,
-+1.575609902E-003,
-+1.863567345E-002,
-+4.379155114E-003,
-+1.533520175E-003,
-+1.849545911E-002,
-+3.951539751E-003,
-+1.485876855E-003,
-+1.832821220E-002,
-+3.537061159E-003,
-+1.433344092E-003,
-+1.813439466E-002,
-+3.136433195E-003,
-+1.376571832E-003,
-+1.791484281E-002,
-+2.750317100E-003,
-+1.316190348E-003,
-+1.767017506E-002,
-+2.379294252E-003,
-+1.252829796E-003,
-+1.740120351E-002,
-+2.023874084E-003,
-+1.183370827E-003,
-+1.710879989E-002,
-+1.684492454E-003,
-+1.115717343E-003,
-+1.679391414E-002,
-+1.361547387E-003,
-+1.046945457E-003,
-+1.645756140E-002,
-+1.055365428E-003,
-+9.775133803E-004,
-+1.610082202E-002,
-+7.658848190E-004,
-+9.078957955E-004,
-+8.385353722E-004,
--8.757545584E-005,
--6.084746474E-006,
-+7.698345580E-004,
--8.413690375E-005,
--3.086857760E-006,
-+7.021900383E-004,
--7.513730816E-005,
--7.198007665E-007,
-+6.358824321E-004,
--6.568001118E-005,
-+1.853591357E-006,
-+5.729619297E-004,
--5.610509834E-005,
-+1.470520488E-006,
-+5.099929986E-004,
--4.624524081E-005,
-+9.984935332E-007,
-+4.490280990E-004,
--1.774702469E-005,
-+5.633860383E-007,
-+3.906481725E-004,
--1.992636317E-005,
-+6.993315310E-006,
-+3.347633174E-004,
-+1.617751332E-005,
-+1.207003334E-005,
-+2.682086197E-004,
-+1.521241393E-005,
-+1.661818715E-005,
-+2.233728592E-004,
--2.525620175E-006,
-+1.776598037E-005,
-+1.774113771E-004,
--1.191342653E-005,
-+1.806914770E-005,
-+1.312203676E-004,
--1.985177369E-005,
-+2.677291741E-005,
-+1.024175072E-004,
--2.570833203E-005,
-+2.978993689E-005,
-+6.541742187E-005,
--3.018750249E-005,
-+3.225446198E-005,
-+3.193307566E-005,
--2.554462844E-005,
-+3.397853652E-005,
-+1.714242217E-006,
--2.618136386E-005,
-+3.495384954E-005,
--2.470704203E-005,
--2.537086584E-005,
-+3.515914432E-005,
--4.491530854E-005,
--2.362549276E-005,
-+3.460439257E-005,
--6.447290798E-005,
--2.093936746E-005,
-+3.334947178E-005,
--8.078388782E-005,
--1.751866148E-005,
-+3.144468428E-005,
--9.417100227E-005,
--1.356193479E-005,
--2.042970118E-005,
--1.047207043E-004,
--9.299508747E-006,
--1.987093310E-005,
--1.126275165E-004,
--4.916387297E-006,
--1.884208177E-005,
--1.180980107E-004,
--5.595519906E-005,
--1.743183020E-005,
--1.213575742E-004,
--5.429694284E-005,
--1.571428584E-005,
--1.226499153E-004,
--5.176846025E-005,
--1.379448349E-005,
--1.262027217E-004,
--4.839275425E-005,
--1.177108606E-005,
--1.250260248E-004,
--4.425736552E-005,
--9.826449968E-006,
--1.224978914E-004,
--3.946387005E-005,
--7.869333785E-006,
--1.187910311E-004,
--3.415624451E-005,
--2.319611212E-006,
--1.140582463E-004,
--2.847247197E-005,
--3.157242645E-006,
--1.084438481E-004,
--2.263354872E-005,
--3.617151151E-006,
--1.020687996E-004,
--1.309637537E-005,
--2.497214155E-006,
--9.517164290E-005,
--9.561075785E-006,
--1.189317118E-006,
--6.437721822E-008,
--4.195037945E-006,
--1.194632091E-006,
--8.434094667E-008,
--3.453840463E-006,
--1.162929266E-006,
-+3.809887872E-008,
--2.715013807E-006,
--1.085227950E-006,
-+3.246264413E-008,
--2.032118118E-006,
--9.742954035E-007,
--6.402664354E-008,
--1.399798180E-006,
--8.419976893E-007,
--2.975164826E-008,
--3.132386439E-007,
--7.003467317E-007,
--9.458596395E-008,
--1.444918922E-007,
-+5.564140224E-007,
--4.341498823E-007,
--2.788728892E-008,
-+6.262345096E-007,
--8.427224429E-007,
--7.506701927E-009,
-+6.767839409E-007,
--3.332600045E-006,
--1.314406006E-008,
-+7.020648809E-007,
--4.429412002E-006,
-+3.399493131E-009,
-+6.982898526E-007,
--5.315936960E-006,
-+2.682709610E-009,
-+6.628192182E-007,
--6.225028756E-006,
-+1.613285505E-009,
-+6.022448247E-007,
--6.986399967E-006,
-+6.702406963E-010,
-+4.741137047E-007,
--7.568834008E-006,
--7.834767501E-008,
-+3.970030775E-007,
--7.941360309E-006,
--2.014677420E-007,
-+7.342250683E-007,
--8.087732567E-006,
--5.234479659E-007,
-+3.961981463E-007,
--8.006985809E-006,
--1.190443072E-006,
-+1.543309907E-007,
--6.361419310E-006,
--1.975324267E-006,
-+5.083275667E-008,
--6.015239251E-006,
--9.451737242E-007,
-+1.608403011E-008,
--5.516381407E-006,
--1.033426656E-006,
--7.018770981E-011,
--4.896494374E-006,
--1.179182050E-006,
--1.135985195E-010
-};
-
-double fir_32bands_nonperfect[] =
-{
--1.390191784E-007,
--1.693738625E-007,
--2.030677564E-007,
--2.404238444E-007,
--2.818143514E-007,
--3.276689142E-007,
--3.784752209E-007,
--4.347855338E-007,
--4.972276315E-007,
--5.665120852E-007,
--6.434325428E-007,
--7.288739425E-007,
--8.238164355E-007,
--9.293416952E-007,
--1.046637067E-006,
--1.176999604E-006,
--1.321840614E-006,
--1.482681114E-006,
--1.661159786E-006,
--1.859034001E-006,
--2.078171747E-006,
--2.320550948E-006,
--2.588257530E-006,
--2.883470643E-006,
--3.208459020E-006,
--3.565570978E-006,
--3.957220997E-006,
--4.385879038E-006,
--4.854050530E-006,
--5.364252502E-006,
--5.918994248E-006,
--6.520755960E-006,
--7.171964626E-006,
--7.874960829E-006,
--8.631964192E-006,
--9.445050637E-006,
--1.031611009E-005,
--1.124680875E-005,
--1.223855270E-005,
--1.329243969E-005,
--1.440921824E-005,
--1.558924305E-005,
--1.683242772E-005,
--1.813820381E-005,
--1.950545993E-005,
--2.093250441E-005,
--2.241701623E-005,
--2.395598858E-005,
--2.554569073E-005,
--2.718161704E-005,
--2.885844333E-005,
--3.056998685E-005,
--3.230916263E-005,
--3.406793985E-005,
--3.583733633E-005,
--3.760734762E-005,
--3.936696885E-005,
--4.110412556E-005,
--4.280570283E-005,
--4.445751256E-005,
--4.604430433E-005,
--4.754976908E-005,
--4.895655002E-005,
--5.024627535E-005,
-+5.139957648E-005,
-+5.239612074E-005,
-+5.321469871E-005,
-+5.383323878E-005,
-+5.422891263E-005,
-+5.437819709E-005,
-+5.425697600E-005,
-+5.384063843E-005,
-+5.310418419E-005,
-+5.202236207E-005,
-+5.056979353E-005,
-+4.872112549E-005,
-+4.645117951E-005,
-+4.373511547E-005,
-+4.054862075E-005,
-+3.686808850E-005,
-+3.267079956E-005,
-+2.793515523E-005,
-+2.264085742E-005,
-+1.676913780E-005,
-+1.030297699E-005,
-+3.227306706E-006,
--4.470633485E-006,
--1.280130618E-005,
--2.177240640E-005,
--3.138873581E-005,
--4.165195787E-005,
--5.256036457E-005,
--6.410864444E-005,
--7.628766616E-005,
--8.908427117E-005,
--1.024810626E-004,
--1.164562127E-004,
--1.309833024E-004,
--1.460311323E-004,
--1.615635992E-004,
--1.775395358E-004,
--1.939126523E-004,
--2.106313768E-004,
--2.276388550E-004,
--2.448728774E-004,
--2.622658503E-004,
--2.797449124E-004,
--2.972317743E-004,
--3.146430245E-004,
--3.318900708E-004,
--3.488793736E-004,
--3.655125911E-004,
--3.816867538E-004,
--3.972945851E-004,
--4.122247046E-004,
--4.263620067E-004,
--4.395879805E-004,
--4.517810594E-004,
--4.628172028E-004,
--4.725702747E-004,
--4.809123348E-004,
--4.877146275E-004,
--4.928477574E-004,
--4.961824161E-004,
--4.975944757E-004,
--4.969481961E-004,
--4.941228544E-004,
--4.889960401E-004,
-+4.814492422E-004,
-+4.713678791E-004,
-+4.586426076E-004,
-+4.431701091E-004,
-+4.248536134E-004,
-+4.036037717E-004,
-+3.793396754E-004,
-+3.519894381E-004,
-+3.214911267E-004,
-+2.877934603E-004,
-+2.508567995E-004,
-+2.106537577E-004,
-+1.671699720E-004,
-+1.204049113E-004,
-+7.037253090E-005,
-+1.710198012E-005,
--3.936182839E-005,
--9.895755647E-005,
--1.616069785E-004,
--2.272142592E-004,
--2.956659591E-004,
--3.668301215E-004,
--4.405563814E-004,
--5.166754709E-004,
--5.949990009E-004,
--6.753197522E-004,
--7.574109477E-004,
--8.410271257E-004,
--9.259034996E-004,
--1.011756598E-003,
--1.098284614E-003,
--1.185167348E-003,
--1.272067428E-003,
--1.358630019E-003,
--1.444484224E-003,
--1.529243193E-003,
--1.612505526E-003,
--1.693855622E-003,
--1.772865304E-003,
--1.849094522E-003,
--1.922092517E-003,
--1.991399564E-003,
--2.056547208E-003,
--2.117061289E-003,
--2.172462177E-003,
--2.222266514E-003,
--2.265989315E-003,
--2.303145360E-003,
--2.333251061E-003,
--2.355825622E-003,
--2.370394068E-003,
--2.376487479E-003,
--2.373647178E-003,
--2.361423569E-003,
--2.339380793E-003,
--2.307097195E-003,
--2.264167881E-003,
--2.210205887E-003,
--2.144844970E-003,
--2.067740774E-003,
--1.978572691E-003,
--1.877046190E-003,
--1.762894331E-003,
--1.635878929E-003,
-+1.495792647E-003,
-+1.342460280E-003,
-+1.175740734E-003,
-+9.955273708E-004,
-+8.017504588E-004,
-+5.943773431E-004,
-+3.734139318E-004,
-+1.389056415E-004,
--1.090620208E-004,
--3.703625989E-004,
--6.448282511E-004,
--9.322494152E-004,
--1.232374110E-003,
--1.544908970E-003,
--1.869517611E-003,
--2.205822384E-003,
--2.553403843E-003,
--2.911801683E-003,
--3.280514618E-003,
--3.659002949E-003,
--4.046686925E-003,
--4.442950245E-003,
--4.847140983E-003,
--5.258570891E-003,
--5.676518660E-003,
--6.100233644E-003,
--6.528933067E-003,
--6.961807609E-003,
--7.398022339E-003,
--7.836719044E-003,
--8.277016692E-003,
--8.718019351E-003,
--9.158811532E-003,
--9.598465636E-003,
--1.003604382E-002,
--1.047059800E-002,
--1.090117730E-002,
--1.132682897E-002,
--1.174659748E-002,
--1.215953380E-002,
--1.256469358E-002,
--1.296114177E-002,
--1.334795821E-002,
--1.372423489E-002,
--1.408908330E-002,
--1.444163360E-002,
--1.478104480E-002,
--1.510649733E-002,
--1.541720331E-002,
--1.571240649E-002,
--1.599138230E-002,
--1.625344716E-002,
--1.649795473E-002,
--1.672429405E-002,
--1.693190821E-002,
--1.712027565E-002,
--1.728892699E-002,
--1.743743755E-002,
--1.756543480E-002,
--1.767260395E-002,
--1.775865816E-002,
--1.782339066E-002,
--1.786663756E-002,
--1.788828894E-002,
-+1.788828894E-002,
-+1.786663756E-002,
-+1.782339066E-002,
-+1.775865816E-002,
-+1.767260395E-002,
-+1.756543480E-002,
-+1.743743755E-002,
-+1.728892699E-002,
-+1.712027565E-002,
-+1.693190821E-002,
-+1.672429405E-002,
-+1.649795473E-002,
-+1.625344716E-002,
-+1.599138230E-002,
-+1.571240649E-002,
-+1.541720331E-002,
-+1.510649733E-002,
-+1.478104480E-002,
-+1.444163360E-002,
-+1.408908330E-002,
-+1.372423489E-002,
-+1.334795821E-002,
-+1.296114177E-002,
-+1.256469358E-002,
-+1.215953380E-002,
-+1.174659748E-002,
-+1.132682897E-002,
-+1.090117730E-002,
-+1.047059800E-002,
-+1.003604382E-002,
-+9.598465636E-003,
-+9.158811532E-003,
-+8.718019351E-003,
-+8.277016692E-003,
-+7.836719044E-003,
-+7.398022339E-003,
-+6.961807609E-003,
-+6.528933067E-003,
-+6.100233644E-003,
-+5.676518660E-003,
-+5.258570891E-003,
-+4.847140983E-003,
-+4.442950245E-003,
-+4.046686925E-003,
-+3.659002949E-003,
-+3.280514618E-003,
-+2.911801683E-003,
-+2.553403843E-003,
-+2.205822384E-003,
-+1.869517611E-003,
-+1.544908970E-003,
-+1.232374110E-003,
-+9.322494152E-004,
-+6.448282511E-004,
-+3.703625989E-004,
-+1.090620208E-004,
--1.389056415E-004,
--3.734139318E-004,
--5.943773431E-004,
--8.017504588E-004,
--9.955273708E-004,
--1.175740734E-003,
--1.342460280E-003,
--1.495792647E-003,
-+1.635878929E-003,
-+1.762894331E-003,
-+1.877046190E-003,
-+1.978572691E-003,
-+2.067740774E-003,
-+2.144844970E-003,
-+2.210205887E-003,
-+2.264167881E-003,
-+2.307097195E-003,
-+2.339380793E-003,
-+2.361423569E-003,
-+2.373647178E-003,
-+2.376487479E-003,
-+2.370394068E-003,
-+2.355825622E-003,
-+2.333251061E-003,
-+2.303145360E-003,
-+2.265989315E-003,
-+2.222266514E-003,
-+2.172462177E-003,
-+2.117061289E-003,
-+2.056547208E-003,
-+1.991399564E-003,
-+1.922092517E-003,
-+1.849094522E-003,
-+1.772865304E-003,
-+1.693855622E-003,
-+1.612505526E-003,
-+1.529243193E-003,
-+1.444484224E-003,
-+1.358630019E-003,
-+1.272067428E-003,
-+1.185167348E-003,
-+1.098284614E-003,
-+1.011756598E-003,
-+9.259034996E-004,
-+8.410271257E-004,
-+7.574109477E-004,
-+6.753197522E-004,
-+5.949990009E-004,
-+5.166754709E-004,
-+4.405563814E-004,
-+3.668301215E-004,
-+2.956659591E-004,
-+2.272142592E-004,
-+1.616069785E-004,
-+9.895755647E-005,
-+3.936182839E-005,
--1.710198012E-005,
--7.037253090E-005,
--1.204049113E-004,
--1.671699720E-004,
--2.106537577E-004,
--2.508567995E-004,
--2.877934603E-004,
--3.214911267E-004,
--3.519894381E-004,
--3.793396754E-004,
--4.036037717E-004,
--4.248536134E-004,
--4.431701091E-004,
--4.586426076E-004,
--4.713678791E-004,
--4.814492422E-004,
-+4.889960401E-004,
-+4.941228544E-004,
-+4.969481961E-004,
-+4.975944757E-004,
-+4.961824161E-004,
-+4.928477574E-004,
-+4.877146275E-004,
-+4.809123348E-004,
-+4.725702747E-004,
-+4.628172028E-004,
-+4.517810594E-004,
-+4.395879805E-004,
-+4.263620067E-004,
-+4.122247046E-004,
-+3.972945851E-004,
-+3.816867538E-004,
-+3.655125911E-004,
-+3.488793736E-004,
-+3.318900708E-004,
-+3.146430245E-004,
-+2.972317743E-004,
-+2.797449124E-004,
-+2.622658503E-004,
-+2.448728774E-004,
-+2.276388550E-004,
-+2.106313768E-004,
-+1.939126523E-004,
-+1.775395358E-004,
-+1.615635992E-004,
-+1.460311323E-004,
-+1.309833024E-004,
-+1.164562127E-004,
-+1.024810626E-004,
-+8.908427117E-005,
-+7.628766616E-005,
-+6.410864444E-005,
-+5.256036457E-005,
-+4.165195787E-005,
-+3.138873581E-005,
-+2.177240640E-005,
-+1.280130618E-005,
-+4.470633485E-006,
--3.227306706E-006,
--1.030297699E-005,
--1.676913780E-005,
--2.264085742E-005,
--2.793515523E-005,
--3.267079956E-005,
--3.686808850E-005,
--4.054862075E-005,
--4.373511547E-005,
--4.645117951E-005,
--4.872112549E-005,
--5.056979353E-005,
--5.202236207E-005,
--5.310418419E-005,
--5.384063843E-005,
--5.425697600E-005,
--5.437819709E-005,
--5.422891263E-005,
--5.383323878E-005,
--5.321469871E-005,
--5.239612074E-005,
--5.139957648E-005,
-+5.024627535E-005,
-+4.895655002E-005,
-+4.754976908E-005,
-+4.604430433E-005,
-+4.445751256E-005,
-+4.280570283E-005,
-+4.110412556E-005,
-+3.936696885E-005,
-+3.760734762E-005,
-+3.583733633E-005,
-+3.406793985E-005,
-+3.230916263E-005,
-+3.056998685E-005,
-+2.885844333E-005,
-+2.718161704E-005,
-+2.554569073E-005,
-+2.395598858E-005,
-+2.241701623E-005,
-+2.093250441E-005,
-+1.950545993E-005,
-+1.813820381E-005,
-+1.683242772E-005,
-+1.558924305E-005,
-+1.440921824E-005,
-+1.329243969E-005,
-+1.223855270E-005,
-+1.124680875E-005,
-+1.031611009E-005,
-+9.445050637E-006,
-+8.631964192E-006,
-+7.874960829E-006,
-+7.171964626E-006,
-+6.520755960E-006,
-+5.918994248E-006,
-+5.364252502E-006,
-+4.854050530E-006,
-+4.385879038E-006,
-+3.957220997E-006,
-+3.565570978E-006,
-+3.208459020E-006,
-+2.883470643E-006,
-+2.588257530E-006,
-+2.320550948E-006,
-+2.078171747E-006,
-+1.859034001E-006,
-+1.661159786E-006,
-+1.482681114E-006,
-+1.321840614E-006,
-+1.176999604E-006,
-+1.046637067E-006,
-+9.293416952E-007,
-+8.238164355E-007,
-+7.288739425E-007,
-+6.434325428E-007,
-+5.665120852E-007,
-+4.972276315E-007,
-+4.347855338E-007,
-+3.784752209E-007,
-+3.276689142E-007,
-+2.818143514E-007,
-+2.404238444E-007,
-+2.030677564E-007,
-+1.693738625E-007,
-+1.390191784E-007
-};
-
-double lfe_fir_64[] =
-{
-2.6584343868307770E-004,
-8.1793652498163280E-005,
-9.4393239123746760E-005,
-1.0821702744578940E-004,
-1.2333714403212070E-004,
-1.3974857574794440E-004,
-1.5759580128360540E-004,
-1.7699223826639360E-004,
-1.9817386055365200E-004,
-2.2118473134469240E-004,
-2.4602311896160240E-004,
-2.7261159266345200E-004,
-3.0138631700538100E-004,
-3.3283955417573450E-004,
-3.6589911906048660E-004,
-4.0182814700528980E-004,
-4.4018754852004350E-004,
-4.8127761692740020E-004,
-5.2524596685543660E-004,
-5.7215924607589840E-004,
-6.2221300322562460E-004,
-6.7555153509601950E-004,
-7.3241489008069040E-004,
-7.9285167157649990E-004,
-8.5701106581836940E-004,
-9.2511920956894760E-004,
-9.9747709464281800E-004,
-1.0739302961155770E-003,
-1.1550235794857140E-003,
-1.2406768510118130E-003,
-1.3312589144334200E-003,
-1.4268938684836030E-003,
-1.5278297942131760E-003,
-1.6342115122824910E-003,
-1.7463274998590350E-003,
-1.8643775256350640E-003,
-1.9886041991412640E-003,
-2.1191518753767010E-003,
-2.2563596721738580E-003,
-2.4004334118217230E-003,
-2.5515670422464610E-003,
-2.7100932784378530E-003,
-2.8761904686689380E-003,
-3.0501529108732940E-003,
-3.2322725746780640E-003,
-3.4227769356220960E-003,
-3.6219672765582800E-003,
-3.8300913292914630E-003,
-4.0474990382790560E-003,
-4.2744171805679800E-003,
-4.5111598446965220E-003,
-4.7580120153725150E-003,
-5.0153112970292570E-003,
-5.2832840010523800E-003,
-5.5623454973101620E-003,
-5.8526843786239620E-003,
-6.1547122895717620E-003,
-6.4686913974583150E-003,
-6.7949919030070300E-003,
-7.1338820271193980E-003,
-7.4857366271317010E-003,
-7.8508658334612850E-003,
-8.2296309992671010E-003,
-8.6223213002085690E-003,
-9.0293306857347480E-003,
-9.4509534537792200E-003,
-9.8875602707266800E-003,
-1.0339494794607160E-002,
-1.0807084850966930E-002,
-1.1290682479739190E-002,
-1.1790650896728040E-002,
-1.2307321652770040E-002,
-1.2841059826314450E-002,
-1.3392185792326930E-002,
-1.3961089774966240E-002,
-1.4548087492585180E-002,
-1.5153550542891020E-002,
-1.5777811408042910E-002,
-1.6421230509877200E-002,
-1.7084129154682160E-002,
-1.7766902223229410E-002,
-1.8469827249646190E-002,
-1.9193304702639580E-002,
-1.9937623292207720E-002,
-2.0703161135315900E-002,
-2.1490212529897690E-002,
-2.2299138829112050E-002,
-2.3130238056182860E-002,
-2.3983856663107870E-002,
-2.4860285222530360E-002,
-2.5759860873222350E-002,
-2.6682861149311060E-002,
-2.7629608288407320E-002,
-2.8600392863154410E-002,
-2.9595496132969860E-002,
-3.0615204945206640E-002,
-3.1659796833992000E-002,
-3.2729536294937140E-002,
-3.3824689686298370E-002,
-3.4945506602525710E-002,
-3.6092240363359450E-002,
-3.7265110760927200E-002,
-3.8464374840259550E-002,
-3.9690230041742320E-002,
-4.0942888706922530E-002,
-4.2222552001476290E-002,
-4.3529424816370010E-002,
-4.4863656163215640E-002,
-4.6225443482398990E-002,
-4.7614917159080510E-002,
-4.9032241106033330E-002,
-5.0477534532547000E-002,
-5.1950931549072270E-002,
-5.3452525287866590E-002,
-5.4982420057058330E-002,
-5.6540694087743760E-002,
-5.8127421885728840E-002,
-5.9742655605077740E-002,
-6.1386436223983760E-002,
-6.3058786094188690E-002,
-6.4759708940982820E-002,
-6.6489234566688540E-002,
-6.8247318267822270E-002,
-7.0033922791481020E-002,
-7.1849010884761810E-002,
-7.3692522943019870E-002,
-7.5564362108707430E-002,
-7.7464438974857330E-002,
-7.9392634332180020E-002,
-8.1348828971385960E-002,
-8.3332858979702000E-002,
-8.5344567894935610E-002,
-8.7383769452571870E-002,
-8.9450262486934660E-002,
-9.1543838381767280E-002,
-9.3664251267910000E-002,
-9.5811240375041960E-002,
-9.7984537482261660E-002,
-1.0018386691808700E-001,
-1.0240890830755230E-001,
-1.0465932637453080E-001,
-1.0693479329347610E-001,
-1.0923493653535840E-001,
-1.1155936866998670E-001,
-1.1390769481658940E-001,
-1.1627949774265290E-001,
-1.1867434531450270E-001,
-1.2109176814556120E-001,
-1.2353130429983140E-001,
-1.2599244713783260E-001,
-1.2847468256950380E-001,
-1.3097748160362240E-001,
-1.3350030779838560E-001,
-1.3604259490966800E-001,
-1.3860376179218290E-001,
-1.4118319749832150E-001,
-1.4378026127815250E-001,
-1.4639437198638920E-001,
-1.4902481436729430E-001,
-1.5167096257209780E-001,
-1.5433208644390100E-001,
-1.5700751543045040E-001,
-1.5969651937484740E-001,
-1.6239835321903230E-001,
-1.6511227190494540E-001,
-1.6783750057220460E-001,
-1.7057323455810550E-001,
-1.7331869900226590E-001,
-1.7607308924198150E-001,
-1.7883554100990300E-001,
-1.8160524964332580E-001,
-1.8438133597373960E-001,
-1.8716295063495640E-001,
-1.8994916975498200E-001,
-1.9273911416530610E-001,
-1.9553191959857940E-001,
-1.9832661747932440E-001,
-2.0112232863903040E-001,
-2.0391805469989780E-001,
-2.0671287178993220E-001,
-2.0950584113597870E-001,
-2.1229594945907590E-001,
-2.1508227288722990E-001,
-2.1786379814147950E-001,
-2.2063951194286350E-001,
-2.2340846061706540E-001,
-2.2616961598396300E-001,
-2.2892196476459500E-001,
-2.3166447877883910E-001,
-2.3439615964889520E-001,
-2.3711597919464110E-001,
-2.3982289433479310E-001,
-2.4251587688922880E-001,
-2.4519388377666480E-001,
-2.4785590171813960E-001,
-2.5050088763237000E-001,
-2.5312781333923340E-001,
-2.5573557615280150E-001,
-2.5832322239875800E-001,
-2.6088967919349670E-001,
-2.6343390345573420E-001,
-2.6595494151115420E-001,
-2.6845166087150580E-001,
-2.7092313766479490E-001,
-2.7336826920509340E-001,
-2.7578607201576240E-001,
-2.7817553281784060E-001,
-2.8053569793701170E-001,
-2.8286558389663700E-001,
-2.8516408801078800E-001,
-2.8743034601211550E-001,
-2.8966337442398070E-001,
-2.9186218976974480E-001,
-2.9402589797973640E-001,
-2.9615348577499390E-001,
-2.9824411869049070E-001,
-3.0029675364494320E-001,
-3.0231067538261420E-001,
-3.0428490042686460E-001,
-3.0621853470802300E-001,
-3.0811080336570740E-001,
-3.0996081233024600E-001,
-3.1176769733428960E-001,
-3.1353080272674560E-001,
-3.1524917483329780E-001,
-3.1692212820053100E-001,
-3.1854888796806340E-001,
-3.2012873888015740E-001,
-3.2166096568107600E-001,
-3.2314485311508180E-001,
-3.2457971572875980E-001,
-3.2596495747566220E-001,
-3.2729989290237420E-001,
-3.2858389616012580E-001,
-3.2981643080711360E-001,
-3.3099696040153500E-001,
-3.3212485909461980E-001,
-3.3319962024688720E-001,
-3.3422079682350160E-001,
-3.3518791198730470E-001,
-3.3610042929649360E-001,
-3.3695802092552180E-001,
-3.3776029944419860E-001,
-3.3850681781768800E-001,
-3.3919724822044380E-001,
-3.3983129262924200E-001,
-3.4040865302085880E-001,
-3.4092903137207030E-001,
-3.4139221906661980E-001,
-3.4179797768592840E-001,
-3.4214612841606140E-001,
-3.4243649244308470E-001,
-3.4266895055770880E-001,
-3.4284341335296630E-001,
-3.4295973181724550E-001,
-3.4301793575286860E-001,
-3.4301793575286860E-001,
-3.4295973181724550E-001,
-3.4284341335296630E-001,
-3.4266895055770880E-001,
-3.4243649244308470E-001,
-3.4214612841606140E-001,
-3.4179797768592840E-001,
-3.4139221906661980E-001,
-3.4092903137207030E-001,
-3.4040865302085880E-001,
-3.3983129262924200E-001,
-3.3919724822044380E-001,
-3.3850681781768800E-001,
-3.3776029944419860E-001,
-3.3695802092552180E-001,
-3.3610042929649360E-001,
-3.3518791198730470E-001,
-3.3422079682350160E-001,
-3.3319962024688720E-001,
-3.3212485909461980E-001,
-3.3099696040153500E-001,
-3.2981643080711360E-001,
-3.2858389616012580E-001,
-3.2729989290237420E-001,
-3.2596495747566220E-001,
-3.2457971572875980E-001,
-3.2314485311508180E-001,
-3.2166096568107600E-001,
-3.2012873888015740E-001,
-3.1854888796806340E-001,
-3.1692212820053100E-001,
-3.1524917483329780E-001,
-3.1353080272674560E-001,
-3.1176769733428960E-001,
-3.0996081233024600E-001,
-3.0811080336570740E-001,
-3.0621853470802300E-001,
-3.0428490042686460E-001,
-3.0231067538261420E-001,
-3.0029675364494320E-001,
-2.9824411869049070E-001,
-2.9615348577499390E-001,
-2.9402589797973640E-001,
-2.9186218976974480E-001,
-2.8966337442398070E-001,
-2.8743034601211550E-001,
-2.8516408801078800E-001,
-2.8286558389663700E-001,
-2.8053569793701170E-001,
-2.7817553281784060E-001,
-2.7578607201576240E-001,
-2.7336826920509340E-001,
-2.7092313766479490E-001,
-2.6845166087150580E-001,
-2.6595494151115420E-001,
-2.6343390345573420E-001,
-2.6088967919349670E-001,
-2.5832322239875800E-001,
-2.5573557615280150E-001,
-2.5312781333923340E-001,
-2.5050088763237000E-001,
-2.4785590171813960E-001,
-2.4519388377666480E-001,
-2.4251587688922880E-001,
-2.3982289433479310E-001,
-2.3711597919464110E-001,
-2.3439615964889520E-001,
-2.3166447877883910E-001,
-2.2892196476459500E-001,
-2.2616961598396300E-001,
-2.2340846061706540E-001,
-2.2063951194286350E-001,
-2.1786379814147950E-001,
-2.1508227288722990E-001,
-2.1229594945907590E-001,
-2.0950584113597870E-001,
-2.0671287178993220E-001,
-2.0391805469989780E-001,
-2.0112232863903040E-001,
-1.9832661747932440E-001,
-1.9553191959857940E-001,
-1.9273911416530610E-001,
-1.8994916975498200E-001,
-1.8716295063495640E-001,
-1.8438133597373960E-001,
-1.8160524964332580E-001,
-1.7883554100990300E-001,
-1.7607308924198150E-001,
-1.7331869900226590E-001,
-1.7057323455810550E-001,
-1.6783750057220460E-001,
-1.6511227190494540E-001,
-1.6239835321903230E-001,
-1.5969651937484740E-001,
-1.5700751543045040E-001,
-1.5433208644390100E-001,
-1.5167096257209780E-001,
-1.4902481436729430E-001,
-1.4639437198638920E-001,
-1.4378026127815250E-001,
-1.4118319749832150E-001,
-1.3860376179218290E-001,
-1.3604259490966800E-001,
-1.3350030779838560E-001,
-1.3097748160362240E-001,
-1.2847468256950380E-001,
-1.2599244713783260E-001,
-1.2353130429983140E-001,
-1.2109176814556120E-001,
-1.1867434531450270E-001,
-1.1627949774265290E-001,
-1.1390769481658940E-001,
-1.1155936866998670E-001,
-1.0923493653535840E-001,
-1.0693479329347610E-001,
-1.0465932637453080E-001,
-1.0240890830755230E-001,
-1.0018386691808700E-001,
-9.7984537482261660E-002,
-9.5811240375041960E-002,
-9.3664251267910000E-002,
-9.1543838381767280E-002,
-8.9450262486934660E-002,
-8.7383769452571870E-002,
-8.5344567894935610E-002,
-8.3332858979702000E-002,
-8.1348828971385960E-002,
-7.9392634332180020E-002,
-7.7464438974857330E-002,
-7.5564362108707430E-002,
-7.3692522943019870E-002,
-7.1849010884761810E-002,
-7.0033922791481020E-002,
-6.8247318267822270E-002,
-6.6489234566688540E-002,
-6.4759708940982820E-002,
-6.3058786094188690E-002,
-6.1386436223983760E-002,
-5.9742655605077740E-002,
-5.8127421885728840E-002,
-5.6540694087743760E-002,
-5.4982420057058330E-002,
-5.3452525287866590E-002,
-5.1950931549072270E-002,
-5.0477534532547000E-002,
-4.9032241106033330E-002,
-4.7614917159080510E-002,
-4.6225443482398990E-002,
-4.4863656163215640E-002,
-4.3529424816370010E-002,
-4.2222552001476290E-002,
-4.0942888706922530E-002,
-3.9690230041742320E-002,
-3.8464374840259550E-002,
-3.7265110760927200E-002,
-3.6092240363359450E-002,
-3.4945506602525710E-002,
-3.3824689686298370E-002,
-3.2729536294937140E-002,
-3.1659796833992000E-002,
-3.0615204945206640E-002,
-2.9595496132969860E-002,
-2.8600392863154410E-002,
-2.7629608288407320E-002,
-2.6682861149311060E-002,
-2.5759860873222350E-002,
-2.4860285222530360E-002,
-2.3983856663107870E-002,
-2.3130238056182860E-002,
-2.2299138829112050E-002,
-2.1490212529897690E-002,
-2.0703161135315900E-002,
-1.9937623292207720E-002,
-1.9193304702639580E-002,
-1.8469827249646190E-002,
-1.7766902223229410E-002,
-1.7084129154682160E-002,
-1.6421230509877200E-002,
-1.5777811408042910E-002,
-1.5153550542891020E-002,
-1.4548087492585180E-002,
-1.3961089774966240E-002,
-1.3392185792326930E-002,
-1.2841059826314450E-002,
-1.2307321652770040E-002,
-1.1790650896728040E-002,
-1.1290682479739190E-002,
-1.0807084850966930E-002,
-1.0339494794607160E-002,
-9.8875602707266800E-003,
-9.4509534537792200E-003,
-9.0293306857347480E-003,
-8.6223213002085690E-003,
-8.2296309992671010E-003,
-7.8508658334612850E-003,
-7.4857366271317010E-003,
-7.1338820271193980E-003,
-6.7949919030070300E-003,
-6.4686913974583150E-003,
-6.1547122895717620E-003,
-5.8526843786239620E-003,
-5.5623454973101620E-003,
-5.2832840010523800E-003,
-5.0153112970292570E-003,
-4.7580120153725150E-003,
-4.5111598446965220E-003,
-4.2744171805679800E-003,
-4.0474990382790560E-003,
-3.8300913292914630E-003,
-3.6219672765582800E-003,
-3.4227769356220960E-003,
-3.2322725746780640E-003,
-3.0501529108732940E-003,
-2.8761904686689380E-003,
-2.7100932784378530E-003,
-2.5515670422464610E-003,
-2.4004334118217230E-003,
-2.2563596721738580E-003,
-2.1191518753767010E-003,
-1.9886041991412640E-003,
-1.8643775256350640E-003,
-1.7463274998590350E-003,
-1.6342115122824910E-003,
-1.5278297942131760E-003,
-1.4268938684836030E-003,
-1.3312589144334200E-003,
-1.2406768510118130E-003,
-1.1550235794857140E-003,
-1.0739302961155770E-003,
-9.9747709464281800E-004,
-9.2511920956894760E-004,
-8.5701106581836940E-004,
-7.9285167157649990E-004,
-7.3241489008069040E-004,
-6.7555153509601950E-004,
-6.2221300322562460E-004,
-5.7215924607589840E-004,
-5.2524596685543660E-004,
-4.8127761692740020E-004,
-4.4018754852004350E-004,
-4.0182814700528980E-004,
-3.6589911906048660E-004,
-3.3283955417573450E-004,
-3.0138631700538100E-004,
-2.7261159266345200E-004,
-2.4602311896160240E-004,
-2.2118473134469240E-004,
-1.9817386055365200E-004,
-1.7699223826639360E-004,
-1.5759580128360540E-004,
-1.3974857574794440E-004,
-1.2333714403212070E-004,
-1.0821702744578940E-004,
-9.4393239123746760E-005,
-8.1793652498163280E-005,
-2.6584343868307770E-004
-};
-
-double lfe_fir_128[] =
-{
-0.00053168571,
-0.00016358691,
-0.00018878609,
-0.00021643363,
-0.00024667382,
-0.00027949660,
-0.00031519096,
-0.00035398375,
-0.00039634691,
-0.00044236859,
-0.00049204525,
-0.00054522208,
-0.00060277141,
-0.00066567765,
-0.00073179678,
-0.00080365466,
-0.00088037323,
-0.00096255314,
-0.00105048984,
-0.00114431616,
-0.00124442333,
-0.00135110028,
-0.00146482687,
-0.00158570008,
-0.00171401864,
-0.00185023469,
-0.00199495023,
-0.00214785640,
-0.00231004250,
-0.00248134881,
-0.00266251224,
-0.00285378192,
-0.00305565330,
-0.00326841651,
-0.00349264755,
-0.00372874714,
-0.00397720048,
-0.00423829490,
-0.00451271003,
-0.00480085658,
-0.00510312291,
-0.00542017492,
-0.00575236930,
-0.00610029325,
-0.00646453211,
-0.00684553990,
-0.00724391919,
-0.00766016589,
-0.00809498038,
-0.00854881573,
-0.00902230106,
-0.00951600447,
-0.01003060210,
-0.01056654565,
-0.01112466771,
-0.01170534454,
-0.01230939943,
-0.01293735672,
-0.01358995494,
-0.01426773332,
-0.01497144438,
-0.01570170000,
-0.01645922661,
-0.01724460535,
-0.01805862412,
-0.01890186779,
-0.01977507770,
-0.02067894675,
-0.02161412500,
-0.02258131653,
-0.02358125709,
-0.02461459488,
-0.02568206564,
-0.02678431384,
-0.02792212367,
-0.02909611352,
-0.03030703776,
-0.03155555204,
-0.03284239396,
-0.03416819125,
-0.03553372994,
-0.03693958372,
-0.03838652745,
-0.03987516090,
-0.04140623659,
-0.04298033938,
-0.04459818453,
-0.04626038298,
-0.04796761274,
-0.04972046614,
-0.05151961371,
-0.05336561054,
-0.05525910854,
-0.05720067024,
-0.05919086933,
-0.06123027951,
-0.06331945211,
-0.06545893103,
-0.06764923781,
-0.06989086419,
-0.07218432426,
-0.07453006506,
-0.07692859322,
-0.07938029617,
-0.08188561350,
-0.08444493264,
-0.08705867827,
-0.08972713351,
-0.09245070815,
-0.09522963315,
-0.09806428105,
-0.10095486045,
-0.10390164703,
-0.10690483451,
-0.10996460915,
-0.11308115721,
-0.11625462025,
-0.11948505789,
-0.12277261168,
-0.12611730397,
-0.12951917946,
-0.13297818601,
-0.13649433851,
-0.14006754756,
-0.14369773865,
-0.14738474786,
-0.15112841129,
-0.15492856503,
-0.15878495574,
-0.16269733012,
-0.16666537523,
-0.17068879306,
-0.17476719618,
-0.17890018225,
-0.18308731914,
-0.18732811511,
-0.19162209332,
-0.19596865773,
-0.20036731660,
-0.20481738448,
-0.20931822062,
-0.21386915445,
-0.21846942604,
-0.22311829031,
-0.22781492770,
-0.23255851865,
-0.23734821379,
-0.24218304455,
-0.24706205726,
-0.25198432803,
-0.25694879889,
-0.26195442677,
-0.26700007915,
-0.27208462358,
-0.27720692754,
-0.28236576915,
-0.28755992651,
-0.29278811812,
-0.29804900289,
-0.30334126949,
-0.30866351724,
-0.31401440501,
-0.31939238310,
-0.32479602098,
-0.33022382855,
-0.33567428589,
-0.34114575386,
-0.34663668275,
-0.35214546323,
-0.35767036676,
-0.36320972443,
-0.36876192689,
-0.37432509661,
-0.37989753485,
-0.38547745347,
-0.39106300473,
-0.39665243030,
-0.40224379301,
-0.40783521533,
-0.41342487931,
-0.41901078820,
-0.42459106445,
-0.43016362190,
-0.43572667241,
-0.44127810001,
-0.44681602716,
-0.45233830810,
-0.45784294605,
-0.46332800388,
-0.46879136562,
-0.47423094511,
-0.47964480519,
-0.48503074050,
-0.49038675427,
-0.49571081996,
-0.50100076199,
-0.50625455379,
-0.51147013903,
-0.51664537191,
-0.52177828550,
-0.52686679363,
-0.53190881014,
-0.53690224886,
-0.54184508324,
-0.54673534632,
-0.55157101154,
-0.55634999275,
-0.56107026339,
-0.56572991610,
-0.57032698393,
-0.57485944033,
-0.57932555676,
-0.58372318745,
-0.58805054426,
-0.59230577946,
-0.59648692608,
-0.60059231520,
-0.60462015867,
-0.60856848955,
-0.61243581772,
-0.61622029543,
-0.61992025375,
-0.62353414297,
-0.62706029415,
-0.63049703836,
-0.63384294510,
-0.63709646463,
-0.64025616646,
-0.64332056046,
-0.64628833532,
-0.64915806055,
-0.65192854404,
-0.65459835529,
-0.65716648102,
-0.65963155031,
-0.66199249029,
-0.66424828768,
-0.66639786959,
-0.66844022274,
-0.67037439346,
-0.67219948769,
-0.67391467094,
-0.67551922798,
-0.67701220512,
-0.67839306593,
-0.67966115475,
-0.68081587553,
-0.68185669184,
-0.68278300762,
-0.68359452486,
-0.68429082632,
-0.68487155437,
-0.68533653021,
-0.68568539619,
-0.68591803312,
-0.68603444099,
-0.68603444099,
-0.68591803312,
-0.68568539619,
-0.68533653021,
-0.68487155437,
-0.68429082632,
-0.68359452486,
-0.68278300762,
-0.68185669184,
-0.68081587553,
-0.67966115475,
-0.67839306593,
-0.67701220512,
-0.67551922798,
-0.67391467094,
-0.67219948769,
-0.67037439346,
-0.66844022274,
-0.66639786959,
-0.66424828768,
-0.66199249029,
-0.65963155031,
-0.65716648102,
-0.65459835529,
-0.65192854404,
-0.64915806055,
-0.64628833532,
-0.64332056046,
-0.64025616646,
-0.63709646463,
-0.63384294510,
-0.63049703836,
-0.62706029415,
-0.62353414297,
-0.61992025375,
-0.61622029543,
-0.61243581772,
-0.60856848955,
-0.60462015867,
-0.60059231520,
-0.59648692608,
-0.59230577946,
-0.58805054426,
-0.58372318745,
-0.57932555676,
-0.57485944033,
-0.57032698393,
-0.56572991610,
-0.56107026339,
-0.55634999275,
-0.55157101154,
-0.54673534632,
-0.54184508324,
-0.53690224886,
-0.53190881014,
-0.52686679363,
-0.52177828550,
-0.51664537191,
-0.51147013903,
-0.50625455379,
-0.50100076199,
-0.49571081996,
-0.49038675427,
-0.48503074050,
-0.47964480519,
-0.47423094511,
-0.46879136562,
-0.46332800388,
-0.45784294605,
-0.45233830810,
-0.44681602716,
-0.44127810001,
-0.43572667241,
-0.43016362190,
-0.42459106445,
-0.41901078820,
-0.41342487931,
-0.40783521533,
-0.40224379301,
-0.39665243030,
-0.39106300473,
-0.38547745347,
-0.37989753485,
-0.37432509661,
-0.36876192689,
-0.36320972443,
-0.35767036676,
-0.35214546323,
-0.34663668275,
-0.34114575386,
-0.33567428589,
-0.33022382855,
-0.32479602098,
-0.31939238310,
-0.31401440501,
-0.30866351724,
-0.30334126949,
-0.29804900289,
-0.29278811812,
-0.28755992651,
-0.28236576915,
-0.27720692754,
-0.27208462358,
-0.26700007915,
-0.26195442677,
-0.25694879889,
-0.25198432803,
-0.24706205726,
-0.24218304455,
-0.23734821379,
-0.23255851865,
-0.22781492770,
-0.22311829031,
-0.21846942604,
-0.21386915445,
-0.20931822062,
-0.20481738448,
-0.20036731660,
-0.19596865773,
-0.19162209332,
-0.18732811511,
-0.18308731914,
-0.17890018225,
-0.17476719618,
-0.17068879306,
-0.16666537523,
-0.16269733012,
-0.15878495574,
-0.15492856503,
-0.15112841129,
-0.14738474786,
-0.14369773865,
-0.14006754756,
-0.13649433851,
-0.13297818601,
-0.12951917946,
-0.12611730397,
-0.12277261168,
-0.11948505789,
-0.11625462025,
-0.11308115721,
-0.10996460915,
-0.10690483451,
-0.10390164703,
-0.10095486045,
-0.09806428105,
-0.09522963315,
-0.09245070815,
-0.08972713351,
-0.08705867827,
-0.08444493264,
-0.08188561350,
-0.07938029617,
-0.07692859322,
-0.07453006506,
-0.07218432426,
-0.06989086419,
-0.06764923781,
-0.06545893103,
-0.06331945211,
-0.06123027951,
-0.05919086933,
-0.05720067024,
-0.05525910854,
-0.05336561054,
-0.05151961371,
-0.04972046614,
-0.04796761274,
-0.04626038298,
-0.04459818453,
-0.04298033938,
-0.04140623659,
-0.03987516090,
-0.03838652745,
-0.03693958372,
-0.03553372994,
-0.03416819125,
-0.03284239396,
-0.03155555204,
-0.03030703776,
-0.02909611352,
-0.02792212367,
-0.02678431384,
-0.02568206564,
-0.02461459488,
-0.02358125709,
-0.02258131653,
-0.02161412500,
-0.02067894675,
-0.01977507770,
-0.01890186779,
-0.01805862412,
-0.01724460535,
-0.01645922661,
-0.01570170000,
-0.01497144438,
-0.01426773332,
-0.01358995494,
-0.01293735672,
-0.01230939943,
-0.01170534454,
-0.01112466771,
-0.01056654565,
-0.01003060210,
-0.00951600447,
-0.00902230106,
-0.00854881573,
-0.00809498038,
-0.00766016589,
-0.00724391919,
-0.00684553990,
-0.00646453211,
-0.00610029325,
-0.00575236930,
-0.00542017492,
-0.00510312291,
-0.00480085658,
-0.00451271003,
-0.00423829490,
-0.00397720048,
-0.00372874714,
-0.00349264755,
-0.00326841651,
-0.00305565330,
-0.00285378192,
-0.00266251224,
-0.00248134881,
-0.00231004250,
-0.00214785640,
-0.00199495023,
-0.00185023469,
-0.00171401864,
-0.00158570008,
-0.00146482687,
-0.00135110028,
-0.00124442333,
-0.00114431616,
-0.00105048984,
-0.00096255314,
-0.00088037323,
-0.00080365466,
-0.00073179678,
-0.00066567765,
-0.00060277141,
-0.00054522208,
-0.00049204525,
-0.00044236859,
-0.00039634691,
-0.00035398375,
-0.00031519096,
-0.00027949660,
-0.00024667382,
-0.00021643363,
-0.00018878609,
-0.00016358691,
-0.00053168571
-};
diff --git a/src/libdts/tables_huffman.h b/src/libdts/tables_huffman.h
deleted file mode 100644
index 6690d356c..000000000
--- a/src/libdts/tables_huffman.h
+++ /dev/null
@@ -1,1070 +0,0 @@
-/*
- * huffman_tables.h
- * Copyright (C) 2004 Gildas Bazin <gbazin@videolan.org>
- *
- * This file is part of dtsdec, a free DTS Coherent Acoustics stream decoder.
- * See http://www.videolan.org/dtsdec.html for updates.
- *
- * dtsdec is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * dtsdec is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-typedef struct huff_entry_s
-{
- int length;
- int code;
- int value;
-
-} huff_entry_t;
-
-huff_entry_t bitalloc_a_12[] =
-{
- { 1, 0, 1}, { 2, 2, 2}, { 3, 6, 3}, { 4, 14, 4},
- { 5, 30, 5}, { 6, 62, 6}, { 8, 255, 7}, { 8, 254, 8},
- { 9, 507, 9}, { 9, 506, 10}, { 9, 505, 11}, { 9, 504, 12},
- { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_b_12[] =
-{
- { 1, 1, 1}, { 2, 0, 2}, { 3, 2, 3}, { 5, 15, 4},
- { 5, 12, 5}, { 6, 29, 6}, { 7, 57, 7}, { 7, 56, 8},
- { 7, 55, 9}, { 7, 54, 10}, { 7, 53, 11}, { 7, 52, 12},
- { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_c_12[] =
-{
- { 2, 0, 1}, { 3, 7, 2}, { 3, 5, 3}, { 3, 4, 4},
- { 3, 2, 5}, { 4, 13, 6}, { 4, 12, 7}, { 4, 6, 8},
- { 5, 15, 9}, { 6, 29, 10}, { 7, 57, 11}, { 7, 56, 12},
- { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_d_12[] =
-{
- { 2, 3, 1}, { 2, 2, 2}, { 2, 0, 3}, { 3, 2, 4},
- { 4, 6, 5}, { 5, 14, 6}, { 6, 30, 7}, { 7, 62, 8},
- { 8, 126, 9}, { 9, 254, 10}, {10, 511, 11}, {10, 510, 12},
- { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_e_12[] =
-{
- { 1, 1, 1}, { 2, 0, 2}, { 3, 2, 3}, { 4, 6, 4},
- { 5, 14, 5}, { 7, 63, 6}, { 7, 61, 7}, { 8, 124, 8},
- { 8, 121, 9}, { 8, 120, 10}, { 9, 251, 11}, { 9, 250, 12},
- { 0, 0, 0}
-};
-
-huff_entry_t *bitalloc_12[] =
-{
- bitalloc_a_12,
- bitalloc_b_12,
- bitalloc_c_12,
- bitalloc_d_12,
- bitalloc_e_12
-};
-
-huff_entry_t scales_a_129[] =
-{
- { 2, 1, 0}, { 3, 6, 1}, { 3, 5, -1}, { 3, 0, 2},
- { 4, 15, -2}, { 4, 8, 3}, { 4, 3, -3}, { 5, 28, 4},
- { 5, 19, -4}, { 5, 4, 5}, { 6, 59, -5}, { 6, 36, 6},
- { 6, 11, -6}, { 7, 75, 7}, { 7, 74, -7}, { 8, 233, 8},
- { 8, 232, -8}, { 8, 41, 9}, { 8, 40, -9}, { 9, 87, 10},
- { 9, 86,-10}, {10, 937, 11}, {10, 936,-11}, {11, 1877, 12},
- {11, 1876,-12}, {11, 341, 13}, {11, 340,-13}, {12, 686, 14},
- {12, 685,-14}, {13, 1375, 15}, {13, 1374,-15}, {13, 1369, 16},
- {13, 1368,-16}, {13, 1359, 17}, {13, 1358,-17}, {13, 1357, 18},
- {13, 1356,-18}, {13, 1355, 19}, {13, 1354,-19}, {13, 1353, 20},
- {13, 1352,-20}, {13, 1351, 21}, {13, 1350,-21}, {13, 1349, 22},
- {13, 1348,-22}, {13, 1347, 23}, {13, 1346,-23}, {13, 1345, 24},
- {13, 1344,-24}, {14, 15103, 25}, {14, 15102,-25}, {14, 15101, 26},
- {14, 15100,-26}, {14, 15099, 27}, {14, 15098,-27}, {14, 15097, 28},
- {14, 15096,-28}, {14, 15095, 29}, {14, 15094,-29}, {14, 15093, 30},
- {14, 15092,-30}, {14, 15091, 31}, {14, 15090,-31}, {14, 15089, 32},
- {14, 15088,-32}, {14, 15087, 33}, {14, 15086,-33}, {14, 15085, 34},
- {14, 15084,-34}, {14, 15083, 35}, {14, 15082,-35}, {14, 15081, 36},
- {14, 15080,-36}, {14, 15079, 37}, {14, 15078,-37}, {14, 15077, 38},
- {14, 15076,-38}, {14, 15075, 39}, {14, 15074,-39}, {14, 15073, 40},
- {14, 15072,-40}, {14, 15071, 41}, {14, 15070,-41}, {14, 15069, 42},
- {14, 15068,-42}, {14, 15067, 43}, {14, 15066,-43}, {14, 15065, 44},
- {14, 15064,-44}, {14, 15063, 45}, {14, 15062,-45}, {14, 15061, 46},
- {14, 15060,-46}, {14, 15059, 47}, {14, 15058,-47}, {14, 15057, 48},
- {14, 15056,-48}, {14, 15055, 49}, {14, 15054,-49}, {14, 15053, 50},
- {14, 15052,-50}, {14, 15051, 51}, {14, 15050,-51}, {14, 15049, 52},
- {14, 15048,-52}, {14, 15047, 53}, {14, 15046,-53}, {14, 15045, 54},
- {14, 15044,-54}, {14, 15043, 55}, {14, 15042,-55}, {14, 15041, 56},
- {14, 15040,-56}, {14, 15039, 57}, {14, 15038,-57}, {14, 15037, 58},
- {14, 15036,-58}, {14, 15035, 59}, {14, 15034,-59}, {14, 15033, 60},
- {14, 15032,-60}, {14, 15031, 61}, {14, 15030,-61}, {14, 15029, 62},
- {14, 15028,-62}, {14, 15027, 63}, {14, 15026,-63}, {14, 15025, 64},
- {14, 15024,-64}, { 0, 0, 0}
-};
-
-huff_entry_t scales_b_129[] =
-{
- { 3, 3, 0}, { 3, 2, 1}, { 3, 1, -1}, { 4, 15, 2},
- { 4, 14, -2}, { 4, 12, 3}, { 4, 11, -3}, { 4, 10, 4},
- { 4, 9, -4}, { 4, 0, 5}, { 5, 27, -5}, { 5, 17, 6},
- { 5, 16, -6}, { 6, 53, 7}, { 6, 52, -7}, { 6, 5, 8},
- { 6, 4, -8}, { 7, 13, 9}, { 7, 12, -9}, { 8, 29, 10},
- { 8, 28,-10}, { 9, 60, 11}, {10, 127,-11}, {11, 253, 12},
- {11, 252,-12}, {12, 491, 13}, {12, 490,-13}, {13, 979, 14},
- {13, 978,-14}, {14, 1955, 15}, {14, 1954,-15}, {14, 1953, 16},
- {14, 1952,-16}, {15, 4031, 17}, {15, 4030,-17}, {15, 4029, 18},
- {15, 4028,-18}, {15, 4027, 19}, {15, 4026,-19}, {15, 4025, 20},
- {15, 4024,-20}, {15, 4023, 21}, {15, 4022,-21}, {15, 4021, 22},
- {15, 4020,-22}, {15, 4019, 23}, {15, 4018,-23}, {15, 4017, 24},
- {15, 4016,-24}, {15, 4015, 25}, {15, 4014,-25}, {15, 4013, 26},
- {15, 4012,-26}, {15, 4011, 27}, {15, 4010,-27}, {15, 4009, 28},
- {15, 4008,-28}, {15, 4007, 29}, {15, 4006,-29}, {15, 4005, 30},
- {15, 4004,-30}, {15, 4003, 31}, {15, 4002,-31}, {15, 4001, 32},
- {15, 4000,-32}, {15, 3999, 33}, {15, 3998,-33}, {15, 3997, 34},
- {15, 3996,-34}, {15, 3995, 35}, {15, 3994,-35}, {15, 3993, 36},
- {15, 3992,-36}, {15, 3991, 37}, {15, 3990,-37}, {15, 3989, 38},
- {15, 3988,-38}, {15, 3987, 39}, {15, 3986,-39}, {15, 3985, 40},
- {15, 3984,-40}, {15, 3983, 41}, {15, 3982,-41}, {15, 3981, 42},
- {15, 3980,-42}, {15, 3979, 43}, {15, 3978,-43}, {15, 3977, 44},
- {15, 3976,-44}, {15, 3975, 45}, {15, 3974,-45}, {15, 3973, 46},
- {15, 3972,-46}, {15, 3971, 47}, {15, 3970,-47}, {15, 3969, 48},
- {15, 3968,-48}, {15, 3967, 49}, {15, 3966,-49}, {15, 3965, 50},
- {15, 3964,-50}, {15, 3963, 51}, {15, 3962,-51}, {15, 3961, 52},
- {15, 3960,-52}, {15, 3959, 53}, {15, 3958,-53}, {15, 3957, 54},
- {15, 3956,-54}, {15, 3955, 55}, {15, 3954,-55}, {15, 3953, 56},
- {15, 3952,-56}, {15, 3951, 57}, {15, 3950,-57}, {15, 3949, 58},
- {15, 3948,-58}, {15, 3947, 59}, {15, 3946,-59}, {15, 3945, 60},
- {15, 3944,-60}, {15, 3943, 61}, {15, 3942,-61}, {15, 3941, 62},
- {15, 3940,-62}, {15, 3939, 63}, {15, 3938,-63}, {15, 3937, 64},
- {15, 3936,-64}, { 0, 0, 0}
-};
-
-huff_entry_t scales_c_129[] =
-{
- { 3, 4, 0}, { 3, 1, 1}, { 3, 0, -1}, { 4, 13, 2},
- { 4, 12, -2}, { 4, 7, 3}, { 4, 6, -3}, { 5, 31, 4},
- { 5, 30, -4}, { 5, 23, 5}, { 5, 22, -5}, { 5, 11, 6},
- { 5, 10, -6}, { 6, 59, 7}, { 6, 58, -7}, { 6, 43, 8},
- { 6, 42, -8}, { 6, 19, 9}, { 6, 18, -9}, { 7, 115, 10},
- { 7, 114,-10}, { 7, 83, 11}, { 7, 82,-11}, { 7, 35, 12},
- { 7, 34,-12}, { 8, 227, 13}, { 8, 226,-13}, { 8, 162, 14},
- { 8, 161,-14}, { 8, 66, 15}, { 8, 65,-15}, { 9, 450, 16},
- { 9, 449,-16}, { 9, 321, 17}, { 9, 320,-17}, { 9, 129, 18},
- { 9, 128,-18}, {10, 897, 19}, {10, 896,-19}, {10, 652, 20},
- {10, 271,-20}, {10, 268, 21}, {11, 1807,-21}, {11, 1308, 22},
- {11, 1307,-22}, {11, 540, 23}, {11, 539,-23}, {12, 3612, 24},
- {12, 3611,-24}, {12, 2613, 25}, {12, 2612,-25}, {12, 1077, 26},
- {12, 1076,-26}, {13, 7226, 27}, {13, 7221,-27}, {13, 2167, 28},
- {13, 2166,-28}, {13, 2164, 29}, {14, 14455,-29}, {14, 14441, 30},
- {14, 14440,-30}, {14, 4331, 31}, {14, 4330,-31}, {15, 28909, 32},
- {15, 28908,-32}, {15, 28879, 33}, {15, 28878,-33}, {15, 28877, 34},
- {15, 28876,-34}, {15, 28875, 35}, {15, 28874,-35}, {15, 28873, 36},
- {15, 28872,-36}, {15, 28871, 37}, {15, 28870,-37}, {15, 28869, 38},
- {15, 28868,-38}, {15, 28867, 39}, {15, 28866,-39}, {15, 28865, 40},
- {15, 28864,-40}, {15, 20991, 41}, {15, 20990,-41}, {15, 20989, 42},
- {15, 20988,-42}, {15, 20987, 43}, {15, 20986,-43}, {15, 20985, 44},
- {15, 20984,-44}, {15, 20983, 45}, {15, 20982,-45}, {15, 20981, 46},
- {15, 20980,-46}, {15, 20979, 47}, {15, 20978,-47}, {15, 20977, 48},
- {15, 20976,-48}, {15, 20975, 49}, {15, 20974,-49}, {15, 20973, 50},
- {15, 20972,-50}, {15, 20971, 51}, {15, 20970,-51}, {15, 20969, 52},
- {15, 20968,-52}, {15, 20967, 53}, {15, 20966,-53}, {15, 20965, 54},
- {15, 20964,-54}, {15, 20963, 55}, {15, 20962,-55}, {15, 20961, 56},
- {15, 20960,-56}, {15, 20959, 57}, {15, 20958,-57}, {15, 20957, 58},
- {15, 20956,-58}, {15, 20955, 59}, {15, 20954,-59}, {15, 20953, 60},
- {15, 20952,-60}, {15, 20951, 61}, {15, 20950,-61}, {15, 20949, 62},
- {15, 20948,-62}, {15, 20947, 63}, {15, 20946,-63}, {15, 20945, 64},
- {15, 20944,-64}, { 0, 0, 0}
-};
-
-huff_entry_t scales_d_129[] =
-{
- { 2, 0, 0}, { 3, 5, 1}, { 3, 4, -1}, { 4, 15, 2},
- { 4, 14, -2}, { 4, 7, 3}, { 4, 6, -3}, { 5, 26, 4},
- { 5, 25, -4}, { 5, 10, 5}, { 5, 9, -5}, { 6, 54, 6},
- { 6, 49, -6}, { 6, 22, 7}, { 6, 17, -7}, { 7, 110, 8},
- { 7, 97, -8}, { 7, 46, 9}, { 7, 33, -9}, { 8, 193, 10},
- { 8, 192,-10}, { 8, 65, 11}, { 8, 64,-11}, { 9, 444, 12},
- { 9, 191,-12}, { 9, 188, 13}, {10, 895,-13}, {10, 890, 14},
- {10, 381,-14}, {10, 378, 15}, {11, 1789,-15}, {11, 761, 16},
- {11, 760,-16}, {12, 3577, 17}, {12, 3576,-17}, {12, 1519, 18},
- {12, 1518,-18}, {12, 1516, 19}, {13, 7151,-19}, {13, 7128, 20},
- {13, 3035,-20}, {14, 14301, 21}, {14, 14300,-21}, {14, 6069, 22},
- {14, 6068,-22}, {15, 28599, 23}, {15, 28598,-23}, {15, 28597, 24},
- {15, 28596,-24}, {15, 28595, 25}, {15, 28594,-25}, {15, 28593, 26},
- {15, 28592,-26}, {15, 28591, 27}, {15, 28590,-27}, {15, 28589, 28},
- {15, 28588,-28}, {15, 28587, 29}, {15, 28586,-29}, {15, 28585, 30},
- {15, 28584,-30}, {15, 28583, 31}, {15, 28582,-31}, {15, 28581, 32},
- {15, 28580,-32}, {15, 28579, 33}, {15, 28578,-33}, {15, 28577, 34},
- {15, 28576,-34}, {15, 28575, 35}, {15, 28574,-35}, {15, 28573, 36},
- {15, 28572,-36}, {15, 28571, 37}, {15, 28570,-37}, {15, 28569, 38},
- {15, 28568,-38}, {15, 28567, 39}, {15, 28566,-39}, {15, 28565, 40},
- {15, 28564,-40}, {15, 28563, 41}, {15, 28562,-41}, {15, 28561, 42},
- {15, 28560,-42}, {15, 28559, 43}, {15, 28558,-43}, {15, 28557, 44},
- {15, 28556,-44}, {15, 28555, 45}, {15, 28554,-45}, {15, 28553, 46},
- {15, 28552,-46}, {15, 28551, 47}, {15, 28550,-47}, {15, 28549, 48},
- {15, 28548,-48}, {15, 28547, 49}, {15, 28546,-49}, {15, 28545, 50},
- {15, 28544,-50}, {15, 28543, 51}, {15, 28542,-51}, {15, 28541, 52},
- {15, 28540,-52}, {15, 28539, 53}, {15, 28538,-53}, {15, 28537, 54},
- {15, 28536,-54}, {15, 28535, 55}, {15, 28534,-55}, {15, 28533, 56},
- {15, 28532,-56}, {15, 28531, 57}, {15, 28530,-57}, {15, 28529, 58},
- {15, 28528,-58}, {15, 28527, 59}, {15, 28526,-59}, {15, 28525, 60},
- {15, 28524,-60}, {15, 28523, 61}, {15, 28522,-61}, {15, 28521, 62},
- {15, 28520,-62}, {15, 28519, 63}, {15, 28518,-63}, {15, 28517, 64},
- {15, 28516,-64}, { 0, 0, 0}
-};
-
-huff_entry_t scales_e_129[] =
-{
- { 4, 14, 0}, { 4, 11, 1}, { 4, 10, -1}, { 4, 7, 2},
- { 4, 6, -2}, { 4, 3, 3}, { 4, 2, -3}, { 5, 31, 4},
- { 5, 30, -4}, { 5, 25, 5}, { 5, 24, -5}, { 5, 17, 6},
- { 5, 16, -6}, { 5, 9, 7}, { 5, 8, -7}, { 5, 1, 8},
- { 5, 0, -8}, { 6, 53, 9}, { 6, 52, -9}, { 6, 37, 10},
- { 6, 36,-10}, { 6, 21, 11}, { 6, 20,-11}, { 6, 5, 12},
- { 6, 4,-12}, { 7, 109, 13}, { 7, 108,-13}, { 7, 77, 14},
- { 7, 76,-14}, { 7, 45, 15}, { 7, 44,-15}, { 7, 13, 16},
- { 7, 12,-16}, { 8, 221, 17}, { 8, 220,-17}, { 8, 157, 18},
- { 8, 156,-18}, { 8, 93, 19}, { 8, 92,-19}, { 8, 29, 20},
- { 8, 28,-20}, { 9, 445, 21}, { 9, 444,-21}, { 9, 317, 22},
- { 9, 316,-22}, { 9, 189, 23}, { 9, 188,-23}, { 9, 61, 24},
- { 9, 60,-24}, {10, 892, 25}, {10, 639,-25}, {10, 637, 26},
- {10, 636,-26}, {10, 381, 27}, {10, 380,-27}, {10, 125, 28},
- {10, 124,-28}, {11, 1788, 29}, {11, 1787,-29}, {11, 1276, 30},
- {11, 767,-30}, {11, 764, 31}, {11, 255,-31}, {11, 252, 32},
- {12, 3583,-32}, {12, 3579, 33}, {12, 3578,-33}, {12, 2555, 34},
- {12, 2554,-34}, {12, 1531, 35}, {12, 1530,-35}, {12, 507, 36},
- {12, 506,-36}, {13, 7160, 37}, {13, 7147,-37}, {13, 7144, 38},
- {13, 3067,-38}, {13, 3065, 39}, {13, 3064,-39}, {13, 1017, 40},
- {13, 1016,-40}, {14, 14330, 41}, {14, 14329,-41}, {14, 14291, 42},
- {14, 14290,-42}, {14, 6132, 43}, {14, 2039,-43}, {14, 2038, 44},
- {14, 2037,-44}, {15, 28663, 45}, {15, 28662,-45}, {15, 28585, 46},
- {15, 28584,-46}, {15, 12267, 47}, {15, 12266,-47}, {15, 4073, 48},
- {15, 4072,-48}, {16, 57315, 49}, {16, 57314,-49}, {16, 57313, 50},
- {16, 57312,-50}, {16, 57311, 51}, {16, 57310,-51}, {16, 57309, 52},
- {16, 57308,-52}, {16, 57307, 53}, {16, 57306,-53}, {16, 57305, 54},
- {16, 57304,-54}, {16, 57303, 55}, {16, 57302,-55}, {16, 57301, 56},
- {16, 57300,-56}, {16, 57299, 57}, {16, 57298,-57}, {16, 57297, 58},
- {16, 57296,-58}, {16, 57295, 59}, {16, 57294,-59}, {16, 57293, 60},
- {16, 57292,-60}, {16, 57291, 61}, {16, 57290,-61}, {16, 57289, 62},
- {16, 57288,-62}, {16, 57175, 63}, {16, 57174,-63}, {16, 57173, 64},
- {16, 57172,-64}, { 0, 0, 0}
-};
-
-huff_entry_t *scales_129[] =
-{
- scales_a_129,
- scales_b_129,
- scales_c_129,
- scales_d_129,
- scales_e_129
-};
-
-huff_entry_t bitalloc_a_3[] =
-{
- { 1, 0, 0}, { 2, 2, 1}, { 2, 3, -1}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_a_4[] =
-{
- { 1, 0, 0}, { 2, 2, 1}, { 3, 6, 2}, { 3, 7, 3},
- { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_b_4[] =
-{
- { 2, 2, 0}, { 3, 6, 1}, { 3, 7, 2}, { 1, 0, 3},
- { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_c_4[] =
-{
- { 3, 6, 0}, { 3, 7, 1}, { 1, 0, 2}, { 2, 2, 3},
- { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_d_4[] =
-{
- { 2, 0, 0}, { 2, 1, 1}, { 2, 2, 2}, { 2, 3, 3},
- { 0, 0, 0}
-};
-
-huff_entry_t *tmode[] =
-{
- bitalloc_a_4,
- bitalloc_b_4,
- bitalloc_c_4,
- bitalloc_d_4
-};
-
-huff_entry_t bitalloc_a_5[] =
-{
- { 1, 0, 0}, { 2, 2, 1}, { 3, 6, -1}, { 4, 14, 2},
- { 4, 15, -2}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_b_5[] =
-{
- { 2, 2, 0}, { 2, 0, 1}, { 2, 1, -1}, { 3, 6, 2},
- { 3, 7, -2}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_c_5[] =
-{
- { 1, 0, 0}, { 3, 4, 1}, { 3, 5, -1}, { 3, 6, 2},
- { 3, 7, -2}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_a_7[] =
-{
- { 1, 0, 0}, { 3, 6, 1}, { 3, 5, -1}, { 3, 4, 2},
- { 4, 14, -2}, { 5, 31, 3}, { 5, 30, -3}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_b_7[] =
-{
- { 2, 3, 0}, { 2, 1, 1}, { 2, 0, -1}, { 3, 4, 2},
- { 4, 11, -2}, { 5, 21, 3}, { 5, 20, -3}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_c_7[] =
-{
- { 2, 3, 0}, { 2, 2, 1}, { 2, 1, -1}, { 4, 3, 2},
- { 4, 2, -2}, { 4, 1, 3}, { 4, 0, -3}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_a_9[] =
-{
- { 1, 0, 0}, { 3, 7, 1}, { 3, 5, -1}, { 4, 13, 2},
- { 4, 9, -2}, { 4, 8, 3}, { 5, 25, -3}, { 6, 49, 4},
- { 6, 48, -4}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_b_9[] =
-{
- { 2, 2, 0}, { 2, 0, 1}, { 3, 7, -1}, { 3, 3, 2},
- { 3, 2, -2}, { 5, 27, 3}, { 5, 26, -3}, { 5, 25, 4},
- { 5, 24, -4}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_c_9[] =
-{
- { 2, 2, 0}, { 2, 0, 1}, { 3, 7, -1}, { 3, 6, 2},
- { 3, 2, -2}, { 4, 6, 3}, { 5, 15, -3}, { 6, 29, 4},
- { 6, 28, -4}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_a_13[] =
-{
- { 1, 0, 0}, { 3, 4, 1}, { 4, 15, -1}, { 4, 13, 2},
- { 4, 12, -2}, { 4, 10, 3}, { 5, 29, -3}, { 5, 22, 4},
- { 6, 57, -4}, { 6, 47, 5}, { 6, 46, -5}, { 7, 113, 6},
- { 7, 112, -6}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_b_13[] =
-{
- { 2, 0, 0}, { 3, 6, 1}, { 3, 5, -1}, { 3, 2, 2},
- { 4, 15, -2}, { 4, 9, 3}, { 4, 7, -3}, { 4, 6, 4},
- { 5, 29, -4}, { 5, 17, 5}, { 5, 16, -5}, { 6, 57, 6},
- { 6, 56, -6}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_c_13[] =
-{
- { 3, 5, 0}, { 3, 4, 1}, { 3, 3, -1}, { 3, 2, 2},
- { 3, 0, -2}, { 4, 15, 3}, { 4, 14, -3}, { 4, 12, 4},
- { 4, 3, -4}, { 5, 27, 5}, { 5, 26, -5}, { 5, 5, 6},
- { 5, 4, -6}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_a_17[] =
-{
- { 2, 1, 0}, { 3, 7, 1}, { 3, 6, -1}, { 3, 4, 2},
- { 3, 1, -2}, { 4, 11, 3}, { 4, 10, -3}, { 4, 0, 4},
- { 5, 3, -4}, { 6, 4, 5}, { 7, 11, -5}, { 8, 20, 6},
- { 9, 43, -6}, {10, 84, 7}, {11, 171, -7}, {12, 341, 8},
- {12, 340, -8}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_b_17[] =
-{
- { 2, 0, 0}, { 3, 6, 1}, { 3, 5, -1}, { 3, 2, 2},
- { 4, 15, -2}, { 4, 9, 3}, { 4, 8, -3}, { 5, 29, 4},
- { 5, 28, -4}, { 5, 14, 5}, { 5, 13, -5}, { 6, 30, 6},
- { 6, 25, -6}, { 6, 24, 7}, { 7, 63, -7}, { 8, 125, 8},
- { 8, 124, -8}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_c_17[] =
-{
- { 3, 6, 0}, { 3, 4, 1}, { 3, 3, -1}, { 3, 0, 2},
- { 4, 15, -2}, { 4, 11, 3}, { 4, 10, -3}, { 4, 4, 4},
- { 4, 3, -4}, { 5, 29, 5}, { 5, 28, -5}, { 5, 10, 6},
- { 5, 5, -6}, { 5, 4, 7}, { 6, 23, -7}, { 7, 45, 8},
- { 7, 44, -8}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_d_17[] =
-{
- { 1, 0, 0}, { 3, 7, 1}, { 3, 6, -1}, { 4, 11, 2},
- { 4, 10, -2}, { 5, 19, 3}, { 5, 18, -3}, { 6, 35, 4},
- { 6, 34, -4}, { 7, 67, 5}, { 7, 66, -5}, { 8, 131, 6},
- { 8, 130, -6}, { 9, 259, 7}, { 9, 258, -7}, { 9, 257, 8},
- { 9, 256, -8}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_e_17[] =
-{
- { 1, 0, 0}, { 3, 5, 1}, { 3, 4, -1}, { 4, 12, 2},
- { 5, 31, -2}, { 5, 28, 3}, { 5, 27, -3}, { 6, 60, 4},
- { 6, 59, -4}, { 6, 53, 5}, { 6, 52, -5}, { 7, 122, 6},
- { 7, 117, -6}, { 8, 247, 7}, { 8, 246, -7}, { 8, 233, 8},
- { 8, 232, -8}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_f_17[] =
-{
- { 3, 6, 0}, { 3, 5, 1}, { 3, 4, -1}, { 3, 2, 2},
- { 3, 1, -2}, { 4, 15, 3}, { 4, 14, -3}, { 4, 6, 4},
- { 4, 1, -4}, { 5, 14, 5}, { 5, 1, -5}, { 6, 31, 6},
- { 6, 30, -6}, { 6, 0, 7}, { 7, 3, -7}, { 8, 5, 8},
- { 8, 4, -8}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_g_17[] =
-{
- { 2, 2, 0}, { 3, 7, 1}, { 3, 6, -1}, { 3, 1, 2},
- { 3, 0, -2}, { 4, 5, 3}, { 4, 4, -3}, { 5, 14, 4},
- { 5, 13, -4}, { 6, 30, 5}, { 6, 25, -5}, { 7, 62, 6},
- { 7, 49, -6}, { 8, 127, 7}, { 8, 126, -7}, { 8, 97, 8},
- { 8, 96, -8}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_a_25[] =
-{
- { 3, 6, 0}, { 3, 4, 1}, { 3, 3, -1}, { 3, 1, 2},
- { 3, 0, -2}, { 4, 15, 3}, { 4, 14, -3}, { 4, 5, 4},
- { 4, 4, -4}, { 5, 22, 5}, { 5, 21, -5}, { 6, 47, 6},
- { 6, 46, -6}, { 7, 83, 7}, { 7, 82, -7}, { 8, 163, 8},
- { 8, 162, -8}, { 8, 160, 9}, { 9, 323, -9}, {10, 644, 10},
- {11, 1291,-10}, {12, 2580, 11}, {13, 5163,-11}, {14, 10325, 12},
- {14, 10324,-12}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_b_25[] =
-{
- { 3, 5, 0}, { 3, 2, 1}, { 3, 1, -1}, { 4, 15, 2},
- { 4, 14, -2}, { 4, 9, 3}, { 4, 8, -3}, { 4, 6, 4},
- { 4, 1, -4}, { 5, 26, 5}, { 5, 25, -5}, { 5, 15, 6},
- { 5, 14, -6}, { 6, 55, 7}, { 6, 54, -7}, { 6, 49, 8},
- { 6, 48, -8}, { 6, 1, 9}, { 6, 0, -9}, { 7, 6, 10},
- { 7, 5,-10}, { 7, 4, 11}, { 8, 15,-11}, { 9, 29, 12},
- { 9, 28,-12}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_c_25[] =
-{
- { 3, 1, 0}, { 4, 15, 1}, { 4, 14, -1}, { 4, 12, 2},
- { 4, 11, -2}, { 4, 9, 3}, { 4, 8, -3}, { 4, 6, 4},
- { 4, 5, -4}, { 4, 1, 5}, { 4, 0, -5}, { 5, 26, 6},
- { 5, 21, -6}, { 5, 15, 7}, { 5, 14, -7}, { 5, 8, 8},
- { 6, 55, -8}, { 6, 41, 9}, { 6, 40, -9}, { 6, 18, 10},
- { 7, 109,-10}, { 7, 108, 11}, { 7, 39,-11}, { 8, 77, 12},
- { 8, 76,-12}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_d_25[] =
-{
- { 2, 2, 0}, { 3, 7, 1}, { 3, 6, -1}, { 3, 1, 2},
- { 3, 0, -2}, { 4, 5, 3}, { 4, 4, -3}, { 5, 13, 4},
- { 5, 12, -4}, { 6, 29, 5}, { 6, 28, -5}, { 7, 62, 6},
- { 7, 61, -6}, { 8, 126, 7}, { 8, 121, -7}, { 9, 255, 8},
- { 9, 254, -8}, {10, 483, 9}, {10, 482, -9}, {11, 963, 10},
- {11, 962,-10}, {12, 1923, 11}, {12, 1922,-11}, {12, 1921, 12},
- {12, 1920,-12}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_e_25[] =
-{
- { 2, 3, 0}, { 3, 3, 1}, { 3, 2, -1}, { 4, 11, 2},
- { 4, 10, -2}, { 4, 1, 3}, { 4, 0, -3}, { 5, 17, 4},
- { 5, 16, -4}, { 5, 5, 5}, { 5, 4, -5}, { 6, 38, 6},
- { 6, 37, -6}, { 6, 14, 7}, { 6, 13, -7}, { 7, 79, 8},
- { 7, 78, -8}, { 7, 72, 9}, { 7, 31, -9}, { 7, 25, 10},
- { 7, 24,-10}, { 8, 147, 11}, { 8, 146,-11}, { 8, 61, 12},
- { 8, 60,-12}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_f_25[] =
-{
- { 3, 1, 0}, { 3, 0, 1}, { 4, 15, -1}, { 4, 14, 2},
- { 4, 13, -2}, { 4, 11, 3}, { 4, 10, -3}, { 4, 8, 4},
- { 4, 7, -4}, { 4, 5, 5}, { 4, 4, -5}, { 5, 24, 6},
- { 5, 19, -6}, { 5, 13, 7}, { 5, 12, -7}, { 6, 37, 8},
- { 6, 36, -8}, { 7, 102, 9}, { 7, 101, -9}, { 8, 207, 10},
- { 8, 206,-10}, { 8, 200, 11}, { 9, 403,-11}, {10, 805, 12},
- {10, 804,-12}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_g_25[] =
-{
- { 2, 1, 0}, { 3, 6, 1}, { 3, 5, -1}, { 3, 0, 2},
- { 4, 15, -2}, { 4, 8, 3}, { 4, 3, -3}, { 5, 28, 4},
- { 5, 19, -4}, { 5, 4, 5}, { 6, 59, -5}, { 6, 36, 6},
- { 6, 11, -6}, { 7, 116, 7}, { 7, 75, -7}, { 7, 21, 8},
- { 7, 20, -8}, { 8, 149, 9}, { 8, 148, -9}, { 9, 470, 10},
- { 9, 469,-10}, {10, 943, 11}, {10, 942,-11}, {10, 937, 12},
- {10, 936,-12}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_a_33[] =
-{
- { 3, 2, 0}, { 3, 1, 1}, { 3, 0, -1}, { 4, 14, 2},
- { 4, 13, -2}, { 4, 12, 3}, { 4, 11, -3}, { 4, 9, 4},
- { 4, 8, -4}, { 4, 6, 5}, { 5, 31, -5}, { 5, 20, 6},
- { 5, 15, -6}, { 6, 61, 7}, { 6, 60, -7}, { 6, 29, 8},
- { 6, 28, -8}, { 7, 85, 9}, { 7, 84, -9}, { 8, 174, 10},
- { 8, 173,-10}, { 9, 351, 11}, { 9, 350,-11}, {10, 691, 12},
- {10, 690,-12}, {11, 1379, 13}, {11, 1378,-13}, {12, 2755, 14},
- {12, 2754,-14}, {13, 5507, 15}, {13, 5506,-15}, {13, 5505, 16},
- {13, 5504,-16}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_b_33[] =
-{
- { 3, 1, 0}, { 4, 15, 1}, { 4, 14, -1}, { 4, 11, 2},
- { 4, 10, -2}, { 4, 8, 3}, { 4, 7, -3}, { 4, 4, 4},
- { 4, 1, -4}, { 5, 27, 5}, { 5, 26, -5}, { 5, 19, 6},
- { 5, 18, -6}, { 5, 12, 7}, { 5, 11, -7}, { 5, 1, 8},
- { 5, 0, -8}, { 6, 50, 9}, { 6, 49, -9}, { 6, 26, 10},
- { 6, 21,-10}, { 7, 103, 11}, { 7, 102,-11}, { 7, 96, 12},
- { 7, 55,-12}, { 7, 41, 13}, { 7, 40,-13}, { 8, 194, 14},
- { 8, 109,-14}, { 8, 108, 15}, { 9, 391,-15}, {10, 781, 16},
- {10, 780,-16}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_c_33[] =
-{
- { 4, 13, 0}, { 4, 11, 1}, { 4, 10, -1}, { 4, 8, 2},
- { 4, 7, -2}, { 4, 4, 3}, { 4, 3, -3}, { 4, 2, 4},
- { 4, 1, -4}, { 5, 30, 5}, { 5, 29, -5}, { 5, 25, 6},
- { 5, 24, -6}, { 5, 19, 7}, { 5, 18, -7}, { 5, 11, 8},
- { 5, 10, -8}, { 5, 0, 9}, { 6, 63, -9}, { 6, 62, 10},
- { 6, 57,-10}, { 6, 27, 11}, { 6, 26,-11}, { 6, 24, 12},
- { 6, 3,-12}, { 7, 113, 13}, { 7, 112,-13}, { 7, 50, 14},
- { 7, 5,-14}, { 7, 4, 15}, { 8, 103,-15}, { 9, 205, 16},
- { 9, 204,-16}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_d_33[] =
-{
- { 2, 1, 0}, { 3, 6, 1}, { 3, 5, -1}, { 3, 0, 2},
- { 4, 15, -2}, { 4, 8, 3}, { 4, 3, -3}, { 5, 28, 4},
- { 5, 19, -4}, { 5, 4, 5}, { 6, 59, -5}, { 6, 36, 6},
- { 6, 11, -6}, { 7, 116, 7}, { 7, 75, -7}, { 7, 21, 8},
- { 7, 20, -8}, { 8, 149, 9}, { 8, 148, -9}, { 9, 469, 10},
- { 9, 468,-10}, {10, 941, 11}, {10, 940,-11}, {11, 1885, 12},
- {11, 1884,-12}, {12, 3773, 13}, {12, 3772,-13}, {13, 7551, 14},
- {13, 7550,-14}, {14, 15099, 15}, {14, 15098,-15}, {14, 15097, 16},
- {14, 15096,-16}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_e_33[] =
-{
- { 2, 2, 0}, { 3, 2, 1}, { 3, 1, -1}, { 4, 12, 2},
- { 4, 7, -2}, { 4, 0, 3}, { 5, 31, -3}, { 5, 27, 4},
- { 5, 26, -4}, { 5, 3, 5}, { 5, 2, -5}, { 6, 59, 6},
- { 6, 58, -6}, { 6, 27, 7}, { 6, 26, -7}, { 7, 123, 8},
- { 7, 122, -8}, { 7, 120, 9}, { 7, 115, -9}, { 7, 112, 10},
- { 7, 51,-10}, { 7, 49, 11}, { 7, 48,-11}, { 8, 242, 12},
- { 8, 229,-12}, { 8, 227, 13}, { 8, 226,-13}, { 8, 101, 14},
- { 8, 100,-14}, { 9, 487, 15}, { 9, 486,-15}, { 9, 457, 16},
- { 9, 456,-16}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_f_33[] =
-{
- { 4, 13, 0}, { 4, 12, 1}, { 4, 11, -1}, { 4, 9, 2},
- { 4, 8, -2}, { 4, 7, 3}, { 4, 6, -3}, { 4, 4, 4},
- { 4, 3, -4}, { 4, 1, 5}, { 4, 0, -5}, { 5, 30, 6},
- { 5, 29, -6}, { 5, 21, 7}, { 5, 20, -7}, { 5, 10, 8},
- { 5, 5, -8}, { 6, 63, 9}, { 6, 62, -9}, { 6, 56, 10},
- { 6, 23,-10}, { 6, 9, 11}, { 6, 8,-11}, { 7, 45, 12},
- { 7, 44,-12}, { 8, 230, 13}, { 8, 229,-13}, { 9, 463, 14},
- { 9, 462,-14}, { 9, 456, 15}, {10, 915,-15}, {11, 1829, 16},
- {11, 1828,-16}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_g_33[] =
-{
- { 3, 6, 0}, { 3, 3, 1}, { 3, 2, -1}, { 4, 15, 2},
- { 4, 14, -2}, { 4, 9, 3}, { 4, 8, -3}, { 4, 1, 4},
- { 4, 0, -4}, { 5, 22, 5}, { 5, 21, -5}, { 5, 6, 6},
- { 5, 5, -6}, { 6, 46, 7}, { 6, 41, -7}, { 6, 14, 8},
- { 6, 9, -8}, { 7, 94, 9}, { 7, 81, -9}, { 7, 30, 10},
- { 7, 17,-10}, { 8, 191, 11}, { 8, 190,-11}, { 8, 63, 12},
- { 8, 62,-12}, { 8, 32, 13}, { 9, 323,-13}, { 9, 321, 14},
- { 9, 320,-14}, { 9, 67, 15}, { 9, 66,-15}, {10, 645, 16},
- {10, 644,-16}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_a_65[] =
-{
- { 4, 6, 0}, { 4, 5, 1}, { 4, 4, -1}, { 4, 2, 2},
- { 4, 1, -2}, { 4, 0, 3}, { 5, 31, -3}, { 5, 29, 4},
- { 5, 28, -4}, { 5, 27, 5}, { 5, 26, -5}, { 5, 24, 6},
- { 5, 23, -6}, { 5, 21, 7}, { 5, 20, -7}, { 5, 18, 8},
- { 5, 17, -8}, { 5, 14, 9}, { 5, 7, -9}, { 5, 6, 10},
- { 6, 61,-10}, { 6, 50, 11}, { 6, 45,-11}, { 6, 38, 12},
- { 6, 33,-12}, { 6, 31, 13}, { 6, 30,-13}, { 7, 120, 14},
- { 7, 103,-14}, { 7, 89, 15}, { 7, 88,-15}, { 7, 65, 16},
- { 7, 64,-16}, { 8, 205, 17}, { 8, 204,-17}, { 8, 157, 18},
- { 8, 156,-18}, { 9, 486, 19}, { 9, 485,-19}, { 9, 318, 20},
- { 9, 317,-20}, {10, 975, 21}, {10, 974,-21}, {10, 639, 22},
- {10, 638,-22}, {11, 1939, 23}, {11, 1938,-23}, {11, 1936, 24},
- {11, 1267,-24}, {11, 1264, 25}, {12, 3875,-25}, {12, 2532, 26},
- {12, 2531,-26}, {13, 7749, 27}, {13, 7748,-27}, {13, 5061, 28},
- {13, 5060,-28}, {14, 10133, 29}, {14, 10132,-29}, {15, 20269, 30},
- {15, 20268,-30}, {16, 40543, 31}, {16, 40542,-31}, {16, 40541, 32},
- {16, 40540,-32}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_b_65[] =
-{
- { 4, 4, 0}, { 4, 2, 1}, { 4, 1, -1}, { 5, 30, 2},
- { 5, 29, -2}, { 5, 26, 3}, { 5, 25, -3}, { 5, 23, 4},
- { 5, 22, -4}, { 5, 19, 5}, { 5, 18, -5}, { 5, 16, 6},
- { 5, 15, -6}, { 5, 12, 7}, { 5, 11, -7}, { 5, 7, 8},
- { 5, 6, -8}, { 6, 63, 9}, { 6, 62, -9}, { 6, 56, 10},
- { 6, 55,-10}, { 6, 49, 11}, { 6, 48,-11}, { 6, 41, 12},
- { 6, 40,-12}, { 6, 34, 13}, { 6, 29,-13}, { 6, 26, 14},
- { 6, 21,-14}, { 6, 20, 15}, { 6, 3,-15}, { 6, 0, 16},
- { 7, 115,-16}, { 7, 109, 17}, { 7, 108,-17}, { 7, 86, 18},
- { 7, 85,-18}, { 7, 70, 19}, { 7, 57,-19}, { 7, 56, 20},
- { 7, 55,-20}, { 7, 4, 21}, { 7, 3,-21}, { 8, 229, 22},
- { 8, 228,-22}, { 8, 175, 23}, { 8, 174,-23}, { 8, 143, 24},
- { 8, 142,-24}, { 8, 108, 25}, { 8, 11,-25}, { 8, 10, 26},
- { 8, 5,-26}, { 9, 339, 27}, { 9, 338,-27}, { 9, 336, 28},
- { 9, 219,-28}, { 9, 9, 29}, { 9, 8,-29}, {10, 674, 30},
- {10, 437,-30}, {10, 436, 31}, {11, 1351,-31}, {12, 2701, 32},
- {12, 2700,-32}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_c_65[] =
-{
- { 5, 28, 0}, { 5, 25, 1}, { 5, 24, -1}, { 5, 23, 2},
- { 5, 22, -2}, { 5, 19, 3}, { 5, 18, -3}, { 5, 16, 4},
- { 5, 15, -4}, { 5, 13, 5}, { 5, 12, -5}, { 5, 10, 6},
- { 5, 9, -6}, { 5, 7, 7}, { 5, 6, -7}, { 5, 4, 8},
- { 5, 3, -8}, { 5, 1, 9}, { 5, 0, -9}, { 6, 62, 10},
- { 6, 61,-10}, { 6, 59, 11}, { 6, 58,-11}, { 6, 54, 12},
- { 6, 53,-12}, { 6, 43, 13}, { 6, 42,-13}, { 6, 40, 14},
- { 6, 35,-14}, { 6, 29, 15}, { 6, 28,-15}, { 6, 17, 16},
- { 6, 16,-16}, { 6, 11, 17}, { 6, 10,-17}, { 6, 4, 18},
- { 7, 127,-18}, { 7, 121, 19}, { 7, 120,-19}, { 7, 110, 20},
- { 7, 105,-20}, { 7, 83, 21}, { 7, 82,-21}, { 7, 68, 22},
- { 7, 47,-22}, { 7, 46, 23}, { 7, 45,-23}, { 7, 11, 24},
- { 7, 10,-24}, { 8, 252, 25}, { 8, 223,-25}, { 8, 209, 26},
- { 8, 208,-26}, { 8, 138, 27}, { 8, 89,-27}, { 8, 88, 28},
- { 9, 507,-28}, { 9, 445, 29}, { 9, 444,-29}, { 9, 278, 30},
- {10, 1013,-30}, {10, 1012, 31}, {10, 559,-31}, {11, 1117, 32},
- {11, 1116,-32}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_d_65[] =
-{
- { 3, 4, 0}, { 3, 1, 1}, { 3, 0, -1}, { 4, 13, 2},
- { 4, 12, -2}, { 4, 7, 3}, { 4, 6, -3}, { 5, 31, 4},
- { 5, 30, -4}, { 5, 23, 5}, { 5, 22, -5}, { 5, 11, 6},
- { 5, 10, -6}, { 6, 59, 7}, { 6, 58, -7}, { 6, 43, 8},
- { 6, 42, -8}, { 6, 19, 9}, { 6, 18, -9}, { 7, 115, 10},
- { 7, 114,-10}, { 7, 83, 11}, { 7, 82,-11}, { 7, 35, 12},
- { 7, 34,-12}, { 8, 227, 13}, { 8, 226,-13}, { 8, 163, 14},
- { 8, 162,-14}, { 8, 160, 15}, { 8, 67,-15}, { 8, 64, 16},
- { 9, 451,-16}, { 9, 448, 17}, { 9, 323,-17}, { 9, 132, 18},
- { 9, 131,-18}, {10, 900, 19}, {10, 899,-19}, {10, 644, 20},
- {10, 267,-20}, {10, 261, 21}, {10, 260,-21}, {11, 1797, 22},
- {11, 1796,-22}, {11, 533, 23}, {11, 532,-23}, {12, 3605, 24},
- {12, 3604,-24}, {12, 2582, 25}, {12, 2581,-25}, {13, 7215, 26},
- {13, 7214,-26}, {13, 5167, 27}, {13, 5166,-27}, {13, 5160, 28},
- {14, 14427,-28}, {14, 10323, 29}, {14, 10322,-29}, {15, 28853, 30},
- {15, 28852,-30}, {15, 28851, 31}, {15, 28850,-31}, {15, 28849, 32},
- {15, 28848,-32}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_e_65[] =
-{
- { 3, 4, 0}, { 3, 0, 1}, { 4, 15, -1}, { 4, 7, 2},
- { 4, 6, -2}, { 5, 29, 3}, { 5, 28, -3}, { 5, 23, 4},
- { 5, 22, -4}, { 5, 10, 5}, { 5, 9, -5}, { 5, 6, 6},
- { 5, 5, -6}, { 6, 54, 7}, { 6, 53, -7}, { 6, 48, 8},
- { 6, 43, -8}, { 6, 40, 9}, { 6, 23, -9}, { 6, 16, 10},
- { 6, 15,-10}, { 6, 9, 11}, { 6, 8,-11}, { 7, 105, 12},
- { 7, 104,-12}, { 7, 100, 13}, { 7, 99,-13}, { 7, 84, 14},
- { 7, 83,-14}, { 7, 45, 15}, { 7, 44,-15}, { 7, 29, 16},
- { 7, 28,-16}, { 8, 221, 17}, { 8, 220,-17}, { 8, 206, 18},
- { 8, 205,-18}, { 8, 202, 19}, { 8, 197,-19}, { 8, 171, 20},
- { 8, 170,-20}, { 8, 164, 21}, { 8, 71,-21}, { 8, 69, 22},
- { 8, 68,-22}, { 9, 446, 23}, { 9, 445,-23}, { 9, 415, 24},
- { 9, 414,-24}, { 9, 408, 25}, { 9, 407,-25}, { 9, 393, 26},
- { 9, 392,-26}, { 9, 331, 27}, { 9, 330,-27}, { 9, 141, 28},
- { 9, 140,-28}, {10, 895, 29}, {10, 894,-29}, {10, 889, 30},
- {10, 888,-30}, {10, 819, 31}, {10, 818,-31}, {10, 813, 32},
- {10, 812,-32}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_f_65[] =
-{
- { 3, 6, 0}, { 3, 3, 1}, { 3, 2, -1}, { 4, 15, 2},
- { 4, 14, -2}, { 4, 9, 3}, { 4, 8, -3}, { 4, 1, 4},
- { 4, 0, -4}, { 5, 21, 5}, { 5, 20, -5}, { 5, 5, 6},
- { 5, 4, -6}, { 6, 45, 7}, { 6, 44, -7}, { 6, 13, 8},
- { 6, 12, -8}, { 7, 93, 9}, { 7, 92, -9}, { 7, 29, 10},
- { 7, 28,-10}, { 8, 189, 11}, { 8, 188,-11}, { 8, 61, 12},
- { 8, 60,-12}, { 9, 381, 13}, { 9, 380,-13}, { 9, 125, 14},
- { 9, 124,-14}, {10, 765, 15}, {10, 764,-15}, {10, 252, 16},
- {11, 1535,-16}, {11, 1532, 17}, {11, 511,-17}, {11, 506, 18},
- {12, 3069,-18}, {12, 3067, 19}, {12, 3066,-19}, {12, 1015, 20},
- {12, 1014,-20}, {13, 6136, 21}, {13, 2043,-21}, {13, 2035, 22},
- {13, 2034,-22}, {14, 12275, 23}, {14, 12274,-23}, {14, 4085, 24},
- {14, 4084,-24}, {14, 4083, 25}, {14, 4082,-25}, {14, 4081, 26},
- {14, 4080,-26}, {14, 4079, 27}, {14, 4078,-27}, {14, 4077, 28},
- {14, 4076,-28}, {14, 4075, 29}, {14, 4074,-29}, {14, 4073, 30},
- {14, 4072,-30}, {14, 4067, 31}, {14, 4066,-31}, {14, 4065, 32},
- {14, 4064,-32}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_g_65[] =
-{
- { 4, 14, 0}, { 4, 11, 1}, { 4, 10, -1}, { 4, 8, 2},
- { 4, 6, -2}, { 4, 4, 3}, { 4, 3, -3}, { 4, 0, 4},
- { 5, 31, -4}, { 5, 26, 5}, { 5, 25, -5}, { 5, 18, 6},
- { 5, 15, -6}, { 5, 10, 7}, { 5, 5, -7}, { 5, 2, 8},
- { 6, 61, -8}, { 6, 54, 9}, { 6, 49, -9}, { 6, 38, 10},
- { 6, 29,-10}, { 6, 22, 11}, { 6, 9,-11}, { 6, 6, 12},
- { 7, 121,-12}, { 7, 110, 13}, { 7, 97,-13}, { 7, 78, 14},
- { 7, 57,-14}, { 7, 46, 15}, { 7, 17,-15}, { 7, 14, 16},
- { 8, 241,-16}, { 8, 223, 17}, { 8, 222,-17}, { 8, 159, 18},
- { 8, 158,-18}, { 8, 95, 19}, { 8, 94,-19}, { 8, 31, 20},
- { 8, 30,-20}, { 9, 480, 21}, { 9, 387,-21}, { 9, 384, 22},
- { 9, 227,-22}, { 9, 225, 23}, { 9, 224,-23}, { 9, 65, 24},
- { 9, 64,-24}, {10, 962, 25}, {10, 773,-25}, {10, 771, 26},
- {10, 770,-26}, {10, 452, 27}, {10, 135,-27}, {10, 133, 28},
- {10, 132,-28}, {11, 1927, 29}, {11, 1926,-29}, {11, 1545, 30},
- {11, 1544,-30}, {11, 907, 31}, {11, 906,-31}, {11, 269, 32},
- {11, 268,-32}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_a_129[] =
-{
- { 4, 8, 0}, { 4, 10, 1}, { 4, 9, -1}, { 4, 0, 2},
- { 5, 31, -2}, { 5, 24, 3}, { 5, 23, -3}, { 5, 12, 4},
- { 5, 11, -4}, { 5, 5, 5}, { 5, 4, -5}, { 6, 60, 6},
- { 6, 58, -6}, { 6, 54, 7}, { 6, 53, -7}, { 6, 45, 8},
- { 6, 44, -8}, { 6, 28, 9}, { 6, 27, -9}, { 6, 19, 10},
- { 6, 18,-10}, { 6, 14, 11}, { 6, 13,-11}, { 6, 6, 12},
- { 6, 5,-12}, { 7, 122, 13}, { 7, 119,-13}, { 7, 113, 14},
- { 7, 112,-14}, { 7, 104, 15}, { 7, 103,-15}, { 7, 100, 16},
- { 7, 63,-16}, { 7, 60, 17}, { 7, 59,-17}, { 7, 52, 18},
- { 7, 43,-18}, { 7, 40, 19}, { 7, 35,-19}, { 7, 32, 20},
- { 7, 31,-20}, { 7, 15, 21}, { 7, 14,-21}, { 8, 247, 22},
- { 8, 246,-22}, { 8, 231, 23}, { 8, 230,-23}, { 8, 223, 24},
- { 8, 222,-24}, { 8, 211, 25}, { 8, 210,-25}, { 8, 203, 26},
- { 8, 202,-26}, { 8, 123, 27}, { 8, 122,-27}, { 8, 116, 28},
- { 8, 107,-28}, { 8, 84, 29}, { 8, 83,-29}, { 8, 68, 30},
- { 8, 67,-30}, { 8, 60, 31}, { 8, 51,-31}, { 8, 49, 32},
- { 8, 48,-32}, { 8, 17, 33}, { 8, 16,-33}, { 9, 474, 34},
- { 9, 473,-34}, { 9, 458, 35}, { 9, 457,-35}, { 9, 442, 36},
- { 9, 441,-36}, { 9, 411, 37}, { 9, 410,-37}, { 9, 251, 38},
- { 9, 250,-38}, { 9, 248, 39}, { 9, 235,-39}, { 9, 213, 40},
- { 9, 212,-40}, { 9, 170, 41}, { 9, 165,-41}, { 9, 139, 42},
- { 9, 138,-42}, { 9, 132, 43}, { 9, 123,-43}, { 9, 101, 44},
- { 9, 100,-44}, { 9, 37, 45}, { 9, 36,-45}, {10, 950, 46},
- {10, 945,-46}, {10, 919, 47}, {10, 918,-47}, {10, 912, 48},
- {10, 887,-48}, {10, 881, 49}, {10, 880,-49}, {10, 818, 50},
- {10, 817,-50}, {10, 499, 51}, {10, 498,-51}, {10, 469, 52},
- {10, 468,-52}, {10, 343, 53}, {10, 342,-53}, {10, 329, 54},
- {10, 328,-54}, {10, 267, 55}, {10, 266,-55}, {10, 245, 56},
- {10, 244,-56}, {10, 79, 57}, {10, 78,-57}, {10, 77, 58},
- {10, 76,-58}, {11, 1903, 59}, {11, 1902,-59}, {11, 1889, 60},
- {11, 1888,-60}, {11, 1827, 61}, {11, 1826,-61}, {11, 1773, 62},
- {11, 1772,-62}, {11, 1639, 63}, {11, 1638,-63}, {11, 1633, 64},
- {11, 1632,-64}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_b_129[] =
-{
- { 5, 10, 0}, { 5, 7, 1}, { 5, 6, -1}, { 5, 4, 2},
- { 5, 3, -2}, { 5, 0, 3}, { 6, 63, -3}, { 6, 60, 4},
- { 6, 59, -4}, { 6, 57, 5}, { 6, 56, -5}, { 6, 53, 6},
- { 6, 52, -6}, { 6, 50, 7}, { 6, 49, -7}, { 6, 46, 8},
- { 6, 45, -8}, { 6, 43, 9}, { 6, 42, -9}, { 6, 39, 10},
- { 6, 38,-10}, { 6, 35, 11}, { 6, 34,-11}, { 6, 32, 12},
- { 6, 31,-12}, { 6, 28, 13}, { 6, 27,-13}, { 6, 25, 14},
- { 6, 24,-14}, { 6, 22, 15}, { 6, 19,-15}, { 6, 16, 16},
- { 6, 11,-16}, { 6, 5, 17}, { 6, 4,-17}, { 7, 125, 18},
- { 7, 124,-18}, { 7, 122, 19}, { 7, 117,-19}, { 7, 110, 20},
- { 7, 109,-20}, { 7, 103, 21}, { 7, 102,-21}, { 7, 96, 22},
- { 7, 95,-22}, { 7, 89, 23}, { 7, 88,-23}, { 7, 81, 24},
- { 7, 80,-24}, { 7, 74, 25}, { 7, 73,-25}, { 7, 66, 26},
- { 7, 61,-26}, { 7, 59, 27}, { 7, 58,-27}, { 7, 52, 28},
- { 7, 47,-28}, { 7, 37, 29}, { 7, 36,-29}, { 7, 21, 30},
- { 7, 20,-30}, { 7, 6, 31}, { 7, 5,-31}, { 8, 247, 32},
- { 8, 246,-32}, { 8, 223, 33}, { 8, 222,-33}, { 8, 217, 34},
- { 8, 216,-34}, { 8, 189, 35}, { 8, 188,-35}, { 8, 166, 36},
- { 8, 165,-36}, { 8, 151, 37}, { 8, 150,-37}, { 8, 144, 38},
- { 8, 135,-38}, { 8, 121, 39}, { 8, 120,-39}, { 8, 106, 40},
- { 8, 93,-40}, { 8, 71, 41}, { 8, 70,-41}, { 8, 68, 42},
- { 8, 15,-42}, { 8, 9, 43}, { 8, 8,-43}, { 9, 466, 44},
- { 9, 465,-44}, { 9, 391, 45}, { 9, 390,-45}, { 9, 388, 46},
- { 9, 335,-46}, { 9, 329, 47}, { 9, 328,-47}, { 9, 269, 48},
- { 9, 268,-48}, { 9, 215, 49}, { 9, 214,-49}, { 9, 184, 50},
- { 9, 139,-50}, { 9, 29, 51}, { 9, 28,-51}, {10, 934, 52},
- {10, 929,-52}, {10, 779, 53}, {10, 778,-53}, {10, 668, 54},
- {10, 583,-54}, {10, 582, 55}, {10, 581,-55}, {10, 371, 56},
- {10, 370,-56}, {10, 276, 57}, {11, 1871,-57}, {11, 1857, 58},
- {11, 1856,-58}, {11, 1338, 59}, {11, 1161,-59}, {11, 1160, 60},
- {11, 555,-60}, {12, 3741, 61}, {12, 3740,-61}, {12, 2678, 62},
- {12, 1109,-62}, {12, 1108, 63}, {13, 5359,-63}, {14, 10717, 64},
- {14, 10716,-64}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_c_129[] =
-{
- { 6, 58, 0}, { 6, 55, 1}, { 6, 54, -1}, { 6, 52, 2},
- { 6, 51, -2}, { 6, 49, 3}, { 6, 48, -3}, { 6, 46, 4},
- { 6, 45, -4}, { 6, 43, 5}, { 6, 42, -5}, { 6, 40, 6},
- { 6, 39, -6}, { 6, 37, 7}, { 6, 36, -7}, { 6, 34, 8},
- { 6, 33, -8}, { 6, 30, 9}, { 6, 29, -9}, { 6, 27, 10},
- { 6, 26,-10}, { 6, 24, 11}, { 6, 23,-11}, { 6, 21, 12},
- { 6, 20,-12}, { 6, 18, 13}, { 6, 17,-13}, { 6, 14, 14},
- { 6, 13,-14}, { 6, 12, 15}, { 6, 11,-15}, { 6, 8, 16},
- { 6, 7,-16}, { 6, 6, 17}, { 6, 5,-17}, { 6, 3, 18},
- { 6, 2,-18}, { 7, 127, 19}, { 7, 126,-19}, { 7, 124, 20},
- { 7, 123,-20}, { 7, 121, 21}, { 7, 120,-21}, { 7, 118, 22},
- { 7, 115,-22}, { 7, 113, 23}, { 7, 112,-23}, { 7, 106, 24},
- { 7, 101,-24}, { 7, 95, 25}, { 7, 94,-25}, { 7, 88, 26},
- { 7, 83,-26}, { 7, 77, 27}, { 7, 76,-27}, { 7, 70, 28},
- { 7, 65,-28}, { 7, 64, 29}, { 7, 63,-29}, { 7, 56, 30},
- { 7, 51,-30}, { 7, 45, 31}, { 7, 44,-31}, { 7, 39, 32},
- { 7, 38,-32}, { 7, 31, 33}, { 7, 30,-33}, { 7, 20, 34},
- { 7, 19,-34}, { 7, 18, 35}, { 7, 9,-35}, { 7, 3, 36},
- { 7, 2,-36}, { 7, 0, 37}, { 8, 251,-37}, { 8, 245, 38},
- { 8, 244,-38}, { 8, 238, 39}, { 8, 229,-39}, { 8, 215, 40},
- { 8, 214,-40}, { 8, 200, 41}, { 8, 179,-41}, { 8, 165, 42},
- { 8, 164,-42}, { 8, 143, 43}, { 8, 142,-43}, { 8, 124, 44},
- { 8, 115,-44}, { 8, 101, 45}, { 8, 100,-45}, { 8, 66, 46},
- { 8, 65,-46}, { 8, 43, 47}, { 8, 42,-47}, { 8, 17, 48},
- { 8, 16,-48}, { 8, 2, 49}, { 9, 501,-49}, { 9, 479, 50},
- { 9, 478,-50}, { 9, 456, 51}, { 9, 403,-51}, { 9, 357, 52},
- { 9, 356,-52}, { 9, 251, 53}, { 9, 250,-53}, { 9, 228, 54},
- { 9, 135,-54}, { 9, 129, 55}, { 9, 128,-55}, { 9, 6, 56},
- {10, 1001,-56}, {10, 1000, 57}, {10, 915,-57}, {10, 805, 58},
- {10, 804,-58}, {10, 458, 59}, {10, 269,-59}, {10, 268, 60},
- {10, 15,-60}, {11, 1829, 61}, {11, 1828,-61}, {11, 918, 62},
- {11, 29,-62}, {11, 28, 63}, {12, 1839,-63}, {13, 3677, 64},
- {13, 3676,-64}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_d_129[] =
-{
- { 4, 9, 0}, { 4, 6, 1}, { 4, 5, -1}, { 4, 2, 2},
- { 4, 1, -2}, { 5, 30, 3}, { 5, 29, -3}, { 5, 26, 4},
- { 5, 25, -4}, { 5, 22, 5}, { 5, 21, -5}, { 5, 16, 6},
- { 5, 15, -6}, { 5, 8, 7}, { 5, 7, -7}, { 5, 0, 8},
- { 6, 63, -8}, { 6, 56, 9}, { 6, 55, -9}, { 6, 48, 10},
- { 6, 47,-10}, { 6, 40, 11}, { 6, 35,-11}, { 6, 28, 12},
- { 6, 19,-12}, { 6, 12, 13}, { 6, 3,-13}, { 7, 124, 14},
- { 7, 115,-14}, { 7, 108, 15}, { 7, 99,-15}, { 7, 92, 16},
- { 7, 83,-16}, { 7, 68, 17}, { 7, 59,-17}, { 7, 36, 18},
- { 7, 27,-18}, { 7, 4, 19}, { 8, 251,-19}, { 8, 228, 20},
- { 8, 219,-20}, { 8, 196, 21}, { 8, 187,-21}, { 8, 164, 22},
- { 8, 139,-22}, { 8, 116, 23}, { 8, 75,-23}, { 8, 52, 24},
- { 8, 11,-24}, { 9, 501, 25}, { 9, 500,-25}, { 9, 437, 26},
- { 9, 436,-26}, { 9, 373, 27}, { 9, 372,-27}, { 9, 277, 28},
- { 9, 276,-28}, { 9, 149, 29}, { 9, 148,-29}, { 9, 21, 30},
- { 9, 20,-30}, {10, 917, 31}, {10, 916,-31}, {10, 789, 32},
- {10, 788,-32}, {10, 661, 33}, {10, 660,-33}, {10, 469, 34},
- {10, 468,-34}, {10, 214, 35}, {10, 213,-35}, {11, 1838, 36},
- {11, 1837,-36}, {11, 1582, 37}, {11, 1581,-37}, {11, 1326, 38},
- {11, 1325,-38}, {11, 942, 39}, {11, 941,-39}, {11, 431, 40},
- {11, 430,-40}, {12, 3679, 41}, {12, 3678,-41}, {12, 3167, 42},
- {12, 3166,-42}, {12, 3160, 43}, {12, 2655,-43}, {12, 2648, 44},
- {12, 1887,-44}, {12, 1880, 45}, {12, 851,-45}, {12, 849, 46},
- {12, 848,-46}, {13, 7346, 47}, {13, 7345,-47}, {13, 6322, 48},
- {13, 5309,-48}, {13, 3773, 49}, {13, 3772,-49}, {13, 3762, 50},
- {13, 1701,-50}, {14, 14695, 51}, {14, 14694,-51}, {14, 14688, 52},
- {14, 12647,-52}, {14, 10617, 53}, {14, 10616,-53}, {14, 10596, 54},
- {14, 7527,-54}, {14, 3401, 55}, {14, 3400,-55}, {15, 29378, 56},
- {15, 25293,-56}, {15, 21195, 57}, {15, 21194,-57}, {15, 15053, 58},
- {15, 15052,-58}, {16, 58759, 59}, {16, 58758,-59}, {16, 50585, 60},
- {16, 50584,-60}, {16, 42399, 61}, {16, 42398,-61}, {16, 42397, 62},
- {16, 42396,-62}, {16, 42395, 63}, {16, 42394,-63}, {16, 42393, 64},
- {16, 42392,-64}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_e_129[] =
-{
- { 5, 12, 0}, { 5, 11, 1}, { 5, 10, -1}, { 5, 9, 2},
- { 5, 8, -2}, { 5, 7, 3}, { 5, 6, -3}, { 5, 4, 4},
- { 5, 3, -4}, { 5, 2, 5}, { 5, 1, -5}, { 5, 0, 6},
- { 6, 63, -6}, { 6, 61, 7}, { 6, 60, -7}, { 6, 59, 8},
- { 6, 58, -8}, { 6, 56, 9}, { 6, 55, -9}, { 6, 53, 10},
- { 6, 52,-10}, { 6, 51, 11}, { 6, 50,-11}, { 6, 47, 12},
- { 6, 46,-12}, { 6, 45, 13}, { 6, 44,-13}, { 6, 42, 14},
- { 6, 41,-14}, { 6, 38, 15}, { 6, 37,-15}, { 6, 36, 16},
- { 6, 35,-16}, { 6, 32, 17}, { 6, 31,-17}, { 6, 29, 18},
- { 6, 28,-18}, { 6, 26, 19}, { 6, 11,-19}, { 7, 125, 20},
- { 7, 124,-20}, { 7, 109, 21}, { 7, 108,-21}, { 7, 98, 22},
- { 7, 97,-22}, { 7, 87, 23}, { 7, 86,-23}, { 7, 79, 24},
- { 7, 78,-24}, { 7, 68, 25}, { 7, 67,-25}, { 7, 60, 26},
- { 7, 55,-26}, { 7, 21, 27}, { 7, 20,-27}, { 8, 230, 28},
- { 8, 229,-28}, { 8, 198, 29}, { 8, 193,-29}, { 8, 163, 30},
- { 8, 162,-30}, { 8, 139, 31}, { 8, 138,-31}, { 8, 123, 32},
- { 8, 122,-32}, { 8, 108, 33}, { 9, 463,-33}, { 9, 457, 34},
- { 9, 456,-34}, { 9, 385, 35}, { 9, 384,-35}, { 9, 321, 36},
- { 9, 320,-36}, { 9, 266, 37}, { 9, 265,-37}, { 9, 218, 38},
- {10, 925,-38}, {10, 798, 39}, {10, 797,-39}, {10, 646, 40},
- {10, 645,-40}, {10, 535, 41}, {10, 534,-41}, {10, 528, 42},
- {10, 439,-42}, {11, 1848, 43}, {11, 1599,-43}, {11, 1592, 44},
- {11, 1295,-44}, {11, 1288, 45}, {11, 1059,-45}, {11, 877, 46},
- {11, 876,-46}, {12, 3197, 47}, {12, 3196,-47}, {12, 2589, 48},
- {12, 2588,-48}, {12, 2117, 49}, {12, 2116,-49}, {13, 7398, 50},
- {13, 7397,-50}, {13, 6374, 51}, {13, 6373,-51}, {13, 5158, 52},
- {13, 5157,-52}, {14, 14799, 53}, {14, 14798,-53}, {14, 12751, 54},
- {14, 12750,-54}, {14, 10318, 55}, {14, 10313,-55}, {15, 29587, 56},
- {15, 29586,-56}, {15, 29584, 57}, {15, 25491,-57}, {15, 20625, 58},
- {15, 20624,-58}, {16, 59171, 59}, {16, 59170,-59}, {16, 50980, 60},
- {16, 41277,-60}, {16, 50981, 61}, {16, 41278,-61}, {16, 50978, 62},
- {16, 41279,-62}, {16, 50979, 63}, {16, 50976,-63}, {16, 50977, 64},
- {16, 41276,-64}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_f_129[] =
-{
- { 6, 56, 0}, { 6, 55, 1}, { 6, 54, -1}, { 6, 52, 2},
- { 6, 51, -2}, { 6, 50, 3}, { 6, 49, -3}, { 6, 48, 4},
- { 6, 47, -4}, { 6, 46, 5}, { 6, 45, -5}, { 6, 44, 6},
- { 6, 43, -6}, { 6, 41, 7}, { 6, 40, -7}, { 6, 39, 8},
- { 6, 38, -8}, { 6, 36, 9}, { 6, 35, -9}, { 6, 34, 10},
- { 6, 33,-10}, { 6, 31, 11}, { 6, 30,-11}, { 6, 29, 12},
- { 6, 28,-12}, { 6, 26, 13}, { 6, 25,-13}, { 6, 23, 14},
- { 6, 22,-14}, { 6, 21, 15}, { 6, 20,-15}, { 6, 18, 16},
- { 6, 17,-16}, { 6, 15, 17}, { 6, 14,-17}, { 6, 12, 18},
- { 6, 11,-18}, { 6, 9, 19}, { 6, 8,-19}, { 6, 7, 20},
- { 6, 6,-20}, { 6, 3, 21}, { 6, 2,-21}, { 6, 1, 22},
- { 6, 0,-22}, { 7, 125, 23}, { 7, 124,-23}, { 7, 123, 24},
- { 7, 122,-24}, { 7, 120, 25}, { 7, 119,-25}, { 7, 116, 26},
- { 7, 115,-26}, { 7, 114, 27}, { 7, 107,-27}, { 7, 84, 28},
- { 7, 75,-28}, { 7, 65, 29}, { 7, 64,-29}, { 7, 54, 30},
- { 7, 49,-30}, { 7, 39, 31}, { 7, 38,-31}, { 7, 27, 32},
- { 7, 26,-32}, { 7, 20, 33}, { 7, 11,-33}, { 7, 10, 34},
- { 7, 9,-34}, { 8, 254, 35}, { 8, 253,-35}, { 8, 243, 36},
- { 8, 242,-36}, { 8, 235, 37}, { 8, 234,-37}, { 8, 213, 38},
- { 8, 212,-38}, { 8, 149, 39}, { 8, 148,-39}, { 8, 110, 40},
- { 8, 97,-40}, { 8, 66, 41}, { 8, 65,-41}, { 8, 43, 42},
- { 8, 42,-42}, { 8, 16, 43}, { 9, 511,-43}, { 9, 505, 44},
- { 9, 504,-44}, { 9, 474, 45}, { 9, 473,-45}, { 9, 343, 46},
- { 9, 342,-46}, { 9, 340, 47}, { 9, 223,-47}, { 9, 192, 48},
- { 9, 135,-48}, { 9, 129, 49}, { 9, 128,-49}, { 9, 34, 50},
- {10, 1021,-50}, {10, 951, 51}, {10, 950,-51}, {10, 944, 52},
- {10, 683,-52}, {10, 445, 53}, {10, 444,-53}, {10, 269, 54},
- {10, 268,-54}, {10, 71, 55}, {10, 70,-55}, {11, 2040, 56},
- {11, 1891,-56}, {11, 1364, 57}, {11, 775,-57}, {11, 774, 58},
- {11, 773,-58}, {12, 4083, 59}, {12, 4082,-59}, {12, 3780, 60},
- {12, 2731,-60}, {12, 1545, 61}, {12, 1544,-61}, {13, 7562, 62},
- {13, 5461,-62}, {13, 5460, 63}, {14, 15127,-63}, {15, 30253, 64},
- {15, 30252,-64}, { 0, 0, 0}
-};
-
-huff_entry_t bitalloc_g_129[] =
-{
- { 4, 0, 0}, { 5, 29, 1}, { 5, 28, -1}, { 5, 25, 2},
- { 5, 24, -2}, { 5, 21, 3}, { 5, 20, -3}, { 5, 17, 4},
- { 5, 16, -4}, { 5, 13, 5}, { 5, 12, -5}, { 5, 9, 6},
- { 5, 8, -6}, { 5, 5, 7}, { 5, 4, -7}, { 6, 63, 8},
- { 6, 62, -8}, { 6, 55, 9}, { 6, 54, -9}, { 6, 47, 10},
- { 6, 46,-10}, { 6, 39, 11}, { 6, 38,-11}, { 6, 31, 12},
- { 6, 30,-12}, { 6, 23, 13}, { 6, 22,-13}, { 6, 15, 14},
- { 6, 14,-14}, { 6, 7, 15}, { 6, 6,-15}, { 7, 123, 16},
- { 7, 122,-16}, { 7, 107, 17}, { 7, 106,-17}, { 7, 91, 18},
- { 7, 90,-18}, { 7, 75, 19}, { 7, 74,-19}, { 7, 59, 20},
- { 7, 58,-20}, { 7, 43, 21}, { 7, 42,-21}, { 7, 27, 22},
- { 7, 26,-22}, { 7, 11, 23}, { 7, 10,-23}, { 7, 8, 24},
- { 8, 243,-24}, { 8, 240, 25}, { 8, 211,-25}, { 8, 208, 26},
- { 8, 179,-26}, { 8, 176, 27}, { 8, 147,-27}, { 8, 144, 28},
- { 8, 115,-28}, { 8, 112, 29}, { 8, 83,-29}, { 8, 80, 30},
- { 8, 51,-30}, { 8, 48, 31}, { 8, 19,-31}, { 9, 484, 32},
- { 9, 483,-32}, { 9, 421, 33}, { 9, 420,-33}, { 9, 357, 34},
- { 9, 356,-34}, { 9, 293, 35}, { 9, 292,-35}, { 9, 229, 36},
- { 9, 228,-36}, { 9, 226, 37}, { 9, 165,-37}, { 9, 162, 38},
- { 9, 101,-38}, { 9, 98, 39}, { 9, 37,-39}, {10, 970, 40},
- {10, 965,-40}, {10, 839, 41}, {10, 838,-41}, {10, 711, 42},
- {10, 710,-42}, {10, 708, 43}, {10, 583,-43}, {10, 580, 44},
- {10, 455,-44}, {10, 329, 45}, {10, 328,-45}, {10, 201, 46},
- {10, 200,-46}, {10, 198, 47}, {10, 73,-47}, {11, 1942, 48},
- {11, 1929,-48}, {11, 1675, 49}, {11, 1674,-49}, {11, 1672, 50},
- {11, 1419,-50}, {11, 1165, 51}, {11, 1164,-51}, {11, 1162, 52},
- {11, 909,-52}, {11, 655, 53}, {11, 654,-53}, {11, 652, 54},
- {11, 399,-54}, {11, 145, 55}, {11, 144,-55}, {12, 3886, 56},
- {12, 3857,-56}, {12, 3347, 57}, {12, 3346,-57}, {12, 2837, 58},
- {12, 2836,-58}, {12, 2327, 59}, {12, 2326,-59}, {12, 1817, 60},
- {12, 1816,-60}, {12, 1307, 61}, {12, 1306,-61}, {12, 797, 62},
- {12, 796,-62}, {13, 7775, 63}, {13, 7774,-63}, {13, 7713, 64},
- {13, 7712,-64}, { 0, 0, 0}
-};
-
-huff_entry_t *bitalloc_select[11][8] =
-{
- { 0 },
- { bitalloc_a_3, 0 },
- { bitalloc_a_5, bitalloc_b_5, bitalloc_c_5, 0 },
- { bitalloc_a_7, bitalloc_b_7, bitalloc_c_7, 0 },
- { bitalloc_a_9, bitalloc_b_9, bitalloc_c_9, 0 },
- { bitalloc_a_13, bitalloc_b_13, bitalloc_c_13, 0 },
- { bitalloc_a_17, bitalloc_b_17, bitalloc_c_17, bitalloc_d_17,
- bitalloc_e_17, bitalloc_f_17, bitalloc_g_17, 0 },
- { bitalloc_a_25, bitalloc_b_25, bitalloc_c_25, bitalloc_d_25,
- bitalloc_e_25, bitalloc_f_25, bitalloc_g_25, 0 },
- { bitalloc_a_33, bitalloc_b_33, bitalloc_c_33, bitalloc_d_33,
- bitalloc_e_33, bitalloc_f_33, bitalloc_g_33, 0 },
- { bitalloc_a_65, bitalloc_b_65, bitalloc_c_65, bitalloc_d_65,
- bitalloc_e_65, bitalloc_f_65, bitalloc_g_65, 0 },
- { bitalloc_a_129, bitalloc_b_129, bitalloc_c_129, bitalloc_d_129,
- bitalloc_e_129, bitalloc_f_129, bitalloc_g_129, 0 },
-};
-
-static int InverseQ( dts_state_t * state, huff_entry_t * huff )
-{
- int value = 0;
- int length = 0, j;
-
- while( 1 )
- {
- length++;
- value <<= 1;
- value |= bitstream_get (state, 1);
-
- for( j = 0; huff[j].length != 0 && huff[j].length < length; j++ );
-
- if( huff[j].length == 0 ) break;
-
- for( ; huff[j].length == length; j++ )
- {
- if( huff[j].code == value ) return huff[j].value;
- }
- }
-
- return 0;
-}
diff --git a/src/libdts/tables_quantization.h b/src/libdts/tables_quantization.h
deleted file mode 100644
index 904b1014e..000000000
--- a/src/libdts/tables_quantization.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * tables_quantization.h
- * Copyright (C) 2004 Gildas Bazin <gbazin@videolan.org>
- *
- * This file is part of dtsdec, a free DTS Coherent Acoustics stream decoder.
- * See http://www.videolan.org/dtsdec.html for updates.
- *
- * dtsdec is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * dtsdec is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-int scale_factor_quant6[] =
-{
- 1, 2, 2, 3, 3, 4, 6, 7,
- 10, 12, 16, 20, 26, 34, 44, 56,
- 72, 93, 120, 155, 200, 257, 331, 427,
- 550, 708, 912, 1175, 1514, 1950, 2512, 3236,
- 4169, 5370, 6918, 8913, 11482, 14791, 19055, 24547,
- 31623, 40738, 52481, 67608, 87096, 112202, 144544, 186209,
- 239883, 309030, 398107, 512861, 660693, 851138, 1096478, 1412538,
- 1819701, 2344229, 3019952, 3890451, 5011872, 6456542, 8317638, 0
-};
-
-int scale_factor_quant7[] =
-{
- 1, 1, 2, 2, 2, 2, 3, 3,
- 3, 4, 4, 5, 6, 7, 7, 8,
- 10, 11, 12, 14, 16, 18, 20, 23,
- 26, 30, 34, 38, 44, 50, 56, 64,
- 72, 82, 93, 106, 120, 136, 155, 176,
- 200, 226, 257, 292, 331, 376, 427, 484,
- 550, 624, 708, 804, 912, 1035, 1175, 1334,
- 1514, 1718, 1950, 2213, 2512, 2851, 3236, 3673,
- 4169, 4732, 5370, 6095, 6918, 7852, 8913, 10116,
- 11482, 13032, 14791, 16788, 19055, 21627, 24547, 27861,
- 31623, 35892, 40738, 46238, 52481, 59566, 67608, 76736,
- 87096, 98855, 112202, 127350, 144544, 164059, 186209, 211349,
- 239883, 272270, 309030, 350752, 398107, 451856, 512861, 582103,
- 660693, 749894, 851138, 966051, 1096478, 1244515, 1412538, 1603245,
- 1819701, 2065380, 2344229, 2660725, 3019952, 3427678, 3890451, 4415704,
- 5011872, 5688529, 6456542, 7328245, 8317638, 0, 0, 0
-};
-
-/* 20bits unsigned fractional binary codes */
-int lossy_quant[] =
-{
- 0, 6710886, 4194304, 3355443, 2474639, 2097152, 1761608, 1426063,
- 796918, 461373, 251658, 146801, 79692, 46137, 27263, 16777,
- 10486, 5872, 3355, 1887, 1258, 713, 336, 168,
- 84, 42, 21, 0, 0, 0, 0, 0
-};
-
-double lossy_quant_d[] =
-{
- 0, 1.6, 1.0, 0.8, 0.59, 0.50, 0.42, 0.34,
- 0.19, 0.11, 0.06, 0.035, 0.019, 0.011, 0.0065, 0.0040,
- 0.0025, 0.0014, 0.0008, 0.00045, 0.00030, 0.00017, 0.00008, 0.00004,
- 0.00002, 0.00001, 0.000005, 0, 0, 0, 0, 0
-};
-
-/* 20bits unsigned fractional binary codes */
-int lossless_quant[] =
-{
- 0, 4194304, 2097152, 1384120, 1048576, 696254, 524288, 348127,
- 262144, 131072, 65431, 33026, 16450, 8208, 4100, 2049,
- 1024, 512, 256, 128, 64, 32, 16, 8,
- 4, 2, 1, 0, 0, 0, 0, 0
-};
-
-double lossless_quant_d[] =
-{
- 0, 1.0, 0.5, 0.33, 0.25, 0.166, 0.125,
- 0.083, 0.0625, 0.03125, 0.0156, 7.874E-3, 3.922E-3, 1.957E-3,
- 9.775E-4, 4.885E-4, 2.442E-4, 1.221E-4, 6.104E-5, 3.052E-5, 1.526E-5,
- 7.629E-6, 3.815E-6, 1.907E-6, 9.537E-7, 4.768E-7, 2.384E-7, 0,
- 0, 0, 0, 0
-};
diff --git a/src/libdts/tables_vq.h b/src/libdts/tables_vq.h
deleted file mode 100644
index eae1ed94c..000000000
--- a/src/libdts/tables_vq.h
+++ /dev/null
@@ -1,2075 +0,0 @@
-/*
- * tables_vq.h
- * Copyright (C) 2004 Gildas Bazin <gbazin@videolan.org>
- *
- * This file is part of dtsdec, a free DTS Coherent Acoustics stream decoder.
- * See http://www.videolan.org/dtsdec.html for updates.
- *
- * dtsdec is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * dtsdec is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* 8bits signed fractional Q4 binary codes */
-
-static int8_t high_freq_vq[1024][32] =
-{
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
- { -4, -2, 2, 1, -16, -10, 1, 3, 1, 0, 6, 1, -3, 7, 1, -22,
- 2, -4, -3, 11, 14, 6, -1, 1, -13, 29, -28, 10, 10, -8, 0, -9 },
- { -8, 8, -7, 10, -3, -12, -5, -8, 1, -2, 9, -2, -5, -18, 1, 9,
- -8, -8, 3, 41, 7, -9, -9, 22, -42, -29, 14, -18, -14, -32, 1, -15 },
- { -16, 8, 15, 16, -16, 5, 2, 7, -6, -16, -7, 1, 1, -3, -2, 0,
- 8, 20, -26, -11, 2, -17, 0, -3, -34, -37, 10, 44, -2, 22, 2, -4 },
- { 7, 14, 5, 6, 15, -1, 3, -3, -9, -23, -5, -14, 8, -1, -14, -6,
- -5, -8, 54, 31, -6, 18, 2, -19, -2, -11, -30, -6, -19, 2, -2, -14 },
- { 1, 2, -2, -1, -3, -3, 1, -5, 1, -3, -4, -8, 5, -4, 0, 1,
- 3, 7, -5, -4, -3, -12, 3, -2, -3, 12, -53, -51, 6, -1, 6, 8 },
- { 0, -1, 5, 1, -6, -8, 7, 5, -18, -4, -1, 1, 0, -3, -3, -14,
- -1, -6, 0, -14, -1, -1, 5, -3, -11, 1, -20, 10, 2, 19, -2, -2 },
- { 2, 4, 3, 0, 5, 0, 3, 1, -2, 0, -6, -3, -4, -5, -3, -3,
- -7, 0, -34, 4, -43, 17, 0, -53, -13, -7, 24, 14, 5, -18, 9, -20 },
- { 1, 0, -3, 2, 3, -5, -2, 7, -21, 5, -25, 23, 11, -28, 2, 1,
- -11, 9, 13, -6, -12, 5, 7, 2, 4, -11, -6, -1, 8, 0, 1, -2 },
- { 2, -4, -6, -4, 0, -5, -29, 13, -6, -22, -3, -43, 12, -41, 5, 24,
- 18, -9, -36, -6, 4, -7, -4, 13, 4, -15, -1, -5, 1, 2, -5, 4 },
- { 0, -1, 13, -6, -5, 1, 0, -3, 1, -5, 19, -22, 31, -27, 4, -15,
- -6, 15, 9, -13, 1, -9, 10, -17, 4, -1, -1, 4, 2, 0, -3, -5 },
- { -7, 3, -8, 13, 19, -12, 8, -19, -3, -2, -24, 31, 14, 0, 7, -13,
- -18, 0, 3, 6, 13, -2, 1, -12, -21, 9, -2, 30, 21, -14, 2, -14 },
- { -3, -7, 8, -1, -2, -9, 6, 1, -7, 7, 13, 3, -1, -10, 30, 4,
- -10, 12, 5, 6, -13, -7, -4, -2, -2, 7, -3, -6, 3, 4, 1, 2 },
- { -8, 9, 2, -3, -5, 2, 0, 9, 3, 7, -4, -16, -13, 3, 23, -27,
- 18, 46, -38, 6, 4, 43, -1, 0, 8, -7, -4, -1, 11, -7, 6, -3 },
- { 1, 1, 18, -8, -6, 0, 3, 4, 22, -3, -4, -2, -4, -11, 40, -7,
- -3, -13, -14, -7, -10, 14, 7, 5, -14, 11, -5, 7, 21, -2, 9, -3 },
- { 0, 0, -2, 4, -2, 0, 2, 0, -1, 2, -1, 0, 0, 2, 2, 2,
- -1, 1, -3, -1, -15, -2, -63, -27, -21, -47, -14, 1, -14, 10, 0, 2 },
- { 1, 0, -4, 0, -3, -9, 4, 2, 6, -6, 0, -5, 11, -7, -15, 6,
- -7, -6, 3, 7, -15, -5, 23, -13, -6, 12, -8, 9, 2, -3, 3, 4 },
- { 6, 0, 3, 0, -2, -4, 2, 1, 1, -1, 1, -2, -1, -4, -22, -15,
- -46, -66, 10, 20, 2, -17, 12, -6, 1, -2, -2, 0, 1, -5, 1, 2 },
- { -1, 0, 0, 1, 0, -4, 0, 1, -10, -3, -8, 5, 7, -11, 2, -11,
- 29, -25, 11, 10, 0, -1, 5, -7, -2, -5, -2, 4, 4, -3, 5, -2 },
- { 1, -1, -1, -3, -2, 1, -8, -3, 2, -2, 4, -5, -1, -7, -2, 1,
- -14, -7, 3, -30, -15, -14, 3, -4, -1, 3, -13, -1, -3, 1, 2, 3 },
- { -1, -2, -3, 2, 2, -3, 3, 1, -3, 2, 0, -4, 6, 5, -5, 10,
- -57, 3, 22, -50, 1, -2, -5, -6, -1, 5, 1, 2, 2, 1, -2, 2 },
- { 2, 0, -1, -7, 2, 1, 3, 2, 0, 4, 3, -2, 3, -3, 4, -4,
- 24, -35, -3, 38, -6, -5, 15, 20, 3, 16, -7, -5, 0, -4, -5, 0 },
- { 0, 1, 0, 0, 0, -1, -1, 1, 1, -1, 1, -2, 0, 0, 0, 0,
- 0, -1, -2, -1, -5, -2, -43, -3, 46, -52, -10, 7, -8, 11, -2, -1 },
- { 0, 0, -1, 0, -1, 2, -41, 33, -44, -48, -15, -26, -9, 6, 3, 3,
- -3, 2, 2, 2, 2, -1, -1, -2, 1, 3, 0, 0, 5, 2, 3, 1 },
- { -4, 1, 6, 1, -6, -1, -2, 1, -14, -4, 0, -5, -2, 2, -2, 0,
- -6, 1, 0, 8, -21, 32, -3, -36, -6, -2, -1, -7, 3, 0, 1, -6 },
- { -3, -2, 3, 0, 2, 2, 8, -4, -4, 6, 2, 1, 3, -6, 4, 3,
- 13, 0, -12, -1, 25, -20, -2, -23, -15, 7, -3, -11, -3, 6, -1, 0 },
- { 0, 0, -3, -1, 0, 0, -2, -1, -2, -2, 1, -1, 0, 0, 10, 3,
- -2, 3, 3, -7, -6, -5, 0, -4, -60, -16, -6, 38, 5, 6, -5, 0 },
- { 0, 1, 0, 0, 0, 0, 0, 0, 1, -1, -1, 0, 1, 0, 0, 1,
- 0, 0, -1, 0, -8, 2, -9, 10, 40, 31, -56, -21, 4, 20, -4, 7 },
- { -2, -2, 0, 4, -3, -1, 7, 3, 1, 3, -8, 0, 3, 1, 2, 5,
- 1, -2, 14, 5, 4, 5, 5, 5, -5, 9, -66, 0, -20, -2, -8, 4 },
- { -2, -1, 4, -1, -8, -2, -4, -1, -3, -3, 2, -7, -3, 5, 7, -2,
- 45, 31, -17, -16, -2, -2, -1, -22, 1, -1, -3, 3, 5, -3, 5, -1 },
- { -4, 0, 7, 5, 8, 7, 2, 9, -9, -9, -7, -11, -3, -8, 17, -4,
- 34, 32, 18, 22, 1, 2, 1, -7, -5, 6, -1, 6, 4, 10, -2, -7 },
- { 6, 0, 14, 9, 6, -1, -2, -3, 4, -6, -8, 4, 7, -1, 28, 38,
- 15, -1, 16, -11, 5, 8, 4, -10, 3, -10, -17, 5, 3, 3, 3, 1 },
- { 1, 1, 2, -1, 2, 1, 0, 0, -1, 0, 0, -2, 1, -3, 0, 1,
- 2, -2, -4, -2, 0, -1, 1, -3, 1, 1, 1, -1, 8, 8, 66, 33 },
- { -5, 2, -3, -7, 2, -8, -4, 10, 17, -18, -7, 4, -4, -7, -6, -6,
- -5, 5, -12, 2, 0, 6, 8, -2, 1, 4, -11, 2, 1, 8, 31, 19 },
- { 6, 9, 16, -6, -6, -1, -2, -3, -11, -2, 7, 7, 17, 3, 4, 10,
- 2, 5, -13, 8, 7, 1, 4, 5, 7, 6, 7, -8, 9, -8, 33, 6 },
- { 3, -1, 1, 0, -7, -5, 0, 14, -7, 1, -7, 1, 2, -4, 7, 10,
- -16, 12, 1, -6, 3, 8, -1, 10, -13, -6, -12, -23, 12, -3, 30, 14 },
- { -2, -15, 0, 8, 3, -19, 5, -3, 2, 3, 13, 7, 14, -3, -10, 0,
- 8, 5, -6, -16, -8, -8, 14, 2, -1, 1, -9, -11, 11, -5, 27, 9 },
- { -8, 6, -4, 4, -4, -1, 5, 4, 1, -7, -5, -4, -15, 1, 9, 0,
- 8, 4, 1, -17, 11, -2, -19, -1, -6, -8, 3, -12, 3, -17, 33, -10 },
- { -3, -1, 2, 7, 7, -2, 9, 8, -18, -1, -13, -10, -3, -3, 11, 8,
- -2, -12, -8, 1, 4, 9, 14, 10, -3, 0, 2, 1, -2, 3, 31, 10 },
- { -3, -10, 8, -1, -5, -11, 7, -5, 3, 6, 1, 4, -16, 10, 5, -4,
- -2, -10, -1, 13, 6, -5, -7, 12, 7, -3, -17, 1, 12, -4, 29, 8 },
- { 1, 2, 5, 2, -6, -7, 0, -1, 6, -1, 10, 6, -4, 5, 2, 2,
- -2, -8, -6, -11, 14, -13, 27, 3, -2, -12, 5, -16, 2, -26, 20, 15 },
- { -1, -3, -5, -3, -3, 6, -1, 3, -5, 1, 7, 2, 1, 0, -1, -1,
- 0, -1, 9, 7, -6, -3, 4, -5, -4, 8, -8, -25, -8, -4, 34, 23 },
- { -1, -2, 1, 1, -1, -2, -1, 1, -1, 0, 0, 0, 0, -2, -1, 1,
- 0, 2, 1, -1, 4, 0, 0, 1, -1, 0, 5, 3, 12, -9, 68, -16 },
- { 10, 0, -8, 14, -6, 1, -12, 0, 0, -3, -5, -11, -6, 12, 9, -10,
- -3, 5, 0, 7, 11, 2, 4, -3, -8, -3, 7, 4, 3, -3, 34, 4 },
- { -12, 13, -5, 7, -11, -2, -1, 1, -4, -14, -21, 3, -3, -3, -4, -7,
- -9, -4, 3, -17, -2, -13, 10, -2, 12, -4, 0, -9, 1, -5, 31, 10 },
- { -10, 6, 5, 6, 4, -7, 10, 0, -28, -3, 0, -11, -1, -5, 16, -10,
- -16, 7, 20, 2, -4, 2, -5, 0, 15, 6, 5, -10, 7, -9, 20, 4 },
- { 1, -7, -2, -7, 4, -3, -2, -7, -1, -14, 6, -16, 4, -5, -4, -6,
- -5, 0, -2, 2, -6, 9, -5, 4, -18, 8, -10, 8, 15, 0, 32, 1 },
- { -5, 7, -3, 7, 15, -4, 0, -16, 9, 5, -5, 5, 4, -3, -12, -9,
- -18, 10, 2, 2, -3, 7, 3, -1, 6, -9, -10, 3, 15, -4, 35, -7 },
- { -1, -10, 2, 2, -4, -2, 10, 2, -1, 2, -2, 1, -1, -14, -11, 3,
- -8, 5, -8, -2, 6, -1, -7, 1, 7, 5, 7, 8, 30, -4, 30, 14 },
- { 2, -2, 1, 2, 3, -8, 3, 0, -2, 0, -9, 2, 1, 4, -6, -1,
- -2, 5, 0, 1, -2, 12, 6, -3, 9, -3, 4, -12, 21, -39, 24, -2 },
- { 3, 5, 1, -2, -2, -2, -3, 6, -8, -2, -11, -8, -1, 4, 2, 2,
- -4, -10, 12, -5, -11, 1, -15, -34, -11, -7, -11, -1, 7, -14, 38, -1 },
- { -4, 4, 8, 9, 8, 1, -5, -9, 4, -2, 15, -4, 11, -15, 20, -1,
- -1, -3, 4, -9, -2, -2, -2, 8, 6, 12, -5, 0, 11, -12, 27, -4 },
- { 0, 8, -4, 3, -11, 6, -11, 2, 3, 0, 5, -8, -7, -6, -9, -21,
- 4, -11, -1, -16, -7, 16, -3, 7, -7, 4, -5, 0, 11, -7, 31, 3 },
- { 1, 3, 4, 11, -11, -2, -3, -6, 6, 5, 0, 3, -9, -6, 4, -4,
- 0, 4, -8, 13, -6, -13, -1, -5, -1, 4, 0, 0, 9, -22, 24, 18 },
- { -7, 3, 10, -13, -6, 6, -6, 6, 22, 1, 0, -14, 2, 3, 7, -1,
- 8, 20, -1, 5, -4, 13, 9, -9, -9, 6, 0, -4, 0, -8, 31, -4 },
- { -3, -4, 0, 1, 7, 3, -7, 0, 5, -2, 1, 3, 3, 1, -5, -2,
- 5, 2, -11, 4, 0, -1, 12, 0, -3, -13, 15, 8, -6, -27, 34, 0 },
- { -3, -3, 10, -4, 2, -1, -3, 0, -1, -1, -4, 2, 6, -2, 12, 1,
- 3, -6, -7, -6, -5, 4, -19, -6, -8, -34, -4, -8, 10, -7, 23, 10 },
- { -7, 0, -1, -6, 8, 4, -4, 2, -5, -8, -7, -9, -8, 5, 9, 7,
- -6, 1, -12, -12, -1, -16, 5, 0, 16, 3, -7, -8, 27, -4, 23, 15 },
- { -8, 4, 8, 5, 6, 11, -3, 5, 3, -1, -11, 6, -5, 0, 2, -6,
- -3, -6, 4, -1, 5, -5, -12, -6, 7, -5, 9, 3, 6, -7, 29, 1 },
- { 1, 3, -2, -2, -6, -2, 1, 6, -6, -3, 1, 2, 3, 4, 1, 5,
- -1, 0, 4, 2, 11, 6, 2, -3, 13, -9, -19, 18, -15, -10, 36, 21 },
- { -3, -3, 2, -1, -7, 6, -4, 1, -3, -1, -2, 2, 3, -7, -3, 0,
- -2, 0, -2, 6, -19, 3, -8, 2, -6, 7, -1, 0, 29, -6, 28, -10 },
- { -5, 1, -3, -7, -12, -4, 1, 1, -1, 13, -10, -1, -9, -5, -13, 6,
- 13, 3, -4, 2, 3, 11, 2, 6, -25, -16, -6, 0, 14, -1, 27, 16 },
- { -6, -1, -7, -5, -2, -5, -5, -1, 9, 1, 0, 3, -8, -12, -6, 5,
- -6, 5, 3, -9, 1, 4, -7, -10, -9, -7, -17, -5, -15, -23, 25, 3 },
- { -8, -2, 9, -3, -4, 3, -1, 8, -7, -7, -5, -4, -2, 9, 4, -1,
- -7, -4, -5, -16, 3, -6, 18, -13, -9, 16, -15, 8, 15, -10, 24, 5 },
- { 1, -38, 2, 34, 9, 10, 11, 2, 2, -6, 3, 2, -2, 5, 4, -7,
- -1, 1, 4, 0, 3, 1, -8, -1, -6, 5, 4, 2, -4, 5, 2, -1 },
- { 1, -22, 15, 18, -2, 10, -16, -9, -8, -11, 8, 4, 0, 7, -14, -5,
- -1, -7, 12, 17, 9, 5, -7, -4, -12, -6, 7, 0, 7, 2, -2, 1 },
- { -11, -29, 7, 10, 19, -1, -8, -9, 7, 1, 9, 6, 8, -7, -14, 8,
- -3, -11, -13, 0, -7, -23, -2, -8, 12, 9, 2, 14, 19, 1, -1, 5 },
- { -24, -27, -11, 36, 2, 6, -3, 4, -6, 8, 0, 12, -1, -4, -6, 3,
- 4, -1, 2, -3, -2, 3, 2, -1, -2, -4, 0, -1, -2, 7, 2, 3 },
- { -9, -24, 11, 13, -10, -12, 12, -2, 7, 4, 8, 13, -3, -3, 2, 9,
- -3, -4, 4, 13, 5, 13, -6, -3, 1, 15, 7, -3, 0, 19, -2, -9 },
- { -8, -15, 7, 14, -4, -5, 2, -18, -19, -2, 2, 17, 16, 6, -10, 10,
- -9, 14, -1, -5, -1, -6, -7, 2, 9, 11, 13, 6, -5, -12, 3, 2 },
- { -10, -37, 13, 1, 3, -14, 0, -20, 4, -3, 8, 2, -2, -3, -9, -5,
- -3, -17, -1, 13, -11, 2, -6, 4, 4, 0, 3, 1, -9, -4, -5, -4 },
- { -2, -22, -5, 46, -8, 5, 9, -11, 8, 7, 7, -1, -1, -2, -7, 2,
- -3, 3, -1, -2, 7, 0, 2, -1, 1, -2, -2, -3, 6, 0, -4, -6 },
- { -16, -27, 15, 16, -4, 14, -7, -26, 2, -2, 6, 5, -3, 11, 0, 2,
- 3, 9, -7, -1, 2, -4, -4, -1, 6, 10, 1, 1, -3, -2, 3, 0 },
- { -3, -22, 10, 26, 1, 2, -3, 3, 17, -3, -7, 9, 1, -21, -4, 5,
- 3, 0, -7, -6, 3, 3, -8, -7, -9, 3, 7, 1, -8, 12, 6, -7 },
- { -9, -25, 3, 18, 9, -6, -11, 0, -5, -12, 9, -8, -7, -6, -6, 22,
- 2, -6, -3, 15, 3, 2, -2, 9, 14, -10, -7, 15, 13, 6, -2, 11 },
- { 5, -20, -5, 28, 11, 10, -4, -4, 0, -7, 3, 5, 2, -5, -8, 2,
- 6, 10, 9, -9, -18, 3, 14, 1, 3, -3, -1, -6, 7, 7, 2, -1 },
- { -8, -30, 7, 12, 10, 8, 7, -13, -16, 0, 1, -1, -6, -11, -15, 4,
- 1, -2, 10, -15, 1, 11, -2, 8, 9, -7, -7, 9, -5, 2, 7, -18 },
- { -10, -32, 10, 11, 3, -1, 3, -5, 5, 2, 14, -6, 3, 1, 5, -15,
- -11, 6, 20, 4, 0, -12, -7, 3, 1, -1, 10, 6, -1, -9, -4, -1 },
- { 1, -25, -14, 12, -11, 9, 9, -16, -24, -17, 22, -9, 11, -30, -3, -4,
- 6, -7, 9, 2, -1, -5, -6, 2, -1, -1, 10, 1, -3, 3, 4, 8 },
- { -14, -26, -6, 9, 8, 17, -11, -24, -7, -4, -8, -2, 10, 2, 2, -1,
- 2, 13, 12, -7, 4, -6, -10, 6, 6, -13, -11, -7, -16, 0, -2, 5 },
- { -4, -30, -13, 12, 16, -6, 12, -16, -13, 5, 15, -2, -2, -10, -7, 7,
- 11, -1, -4, -2, -4, 7, 4, -8, 1, 3, 0, 11, 3, -2, -5, 4 },
- { -4, -21, 20, 22, 2, 20, -8, 1, -12, -5, -9, 4, -10, -17, -3, -8,
- -3, 3, -12, 1, -3, 0, 7, 4, 7, 7, -3, 7, 5, 3, 1, -5 },
- { -12, -20, 2, 29, 11, -6, 9, -7, -6, -4, 0, 6, 17, -13, -2, -10,
- -17, -1, -18, 2, 0, 14, -6, 1, 0, 3, 2, -10, 1, -5, -2, 5 },
- { 16, -37, -1, 26, -2, -14, 1, -5, -14, 2, 2, 3, 6, 1, 1, 4,
- 0, -1, 0, -2, -2, 4, 9, -6, 0, -2, 10, -7, -2, 4, 1, 0 },
- { -9, -24, -12, 5, 5, 3, -17, -14, 4, 3, 2, -4, 10, -22, -8, -3,
- 6, 1, 12, -8, 4, 1, 9, -1, 18, -3, 6, 5, 3, -5, 9, -5 },
- { -14, -33, -2, 20, -13, -10, 2, -7, -1, 11, -9, -8, 18, -3, 1, 8,
- 0, -2, 10, 7, -2, -13, 9, -3, -4, 5, -2, -2, -1, -5, 1, -7 },
- { -10, -23, 8, 14, 1, 7, 1, -3, -7, 4, 1, 1, 8, -7, 15, -14,
- 13, 14, 2, 5, -13, -5, -8, -1, 6, 3, 6, 9, 6, 15, 14, 5 },
- { -13, -25, -10, 13, -17, -24, -7, -13, -6, -10, -8, 2, 0, -13, -10, -4,
- -8, 4, -9, 9, -4, 4, -3, -3, 3, 3, -5, -9, 1, -2, 11, 2 },
- { -12, -23, 1, 18, -11, -2, 5, 9, -5, 5, 14, -9, -3, -2, -6, 2,
- -2, 11, -13, 1, -3, 11, -9, -4, -2, -6, 8, 10, 1, 4, 2, 1 },
- { -5, -18, 16, 22, 2, 0, 8, -6, -9, -7, 10, -16, 23, 10, -11, -1,
- 7, 2, 7, 2, 1, -5, 6, 1, 0, -4, 9, 2, -3, 1, 0, -4 },
- { -3, -26, 14, 11, 2, -9, 17, -2, -1, -5, -16, -9, -5, 10, -13, 1,
- 6, 12, 10, 11, 0, 0, -3, -14, 6, -2, 0, 4, -5, -1, -7, -1 },
- { -10, -33, 1, 8, 11, -5, 1, -6, 7, 4, 5, 6, 1, -2, -10, -5,
- -6, 12, -11, 5, -10, 4, 12, -1, -1, -3, 4, -1, 9, 0, 16, -17 },
- { -14, -37, 7, 7, -2, 5, -8, -11, 2, -13, 4, -19, 1, 8, 8, 4,
- -9, 2, -4, 3, 12, 2, 4, -4, -8, 8, 1, 4, 8, -1, 6, -2 },
- { -6, -30, 18, 17, 1, -22, -3, 4, -7, -10, 7, 0, -8, 8, -1, 4,
- 2, 8, 6, -2, 2, 7, 4, 4, 3, -6, 2, 1, -3, 1, -1, -5 },
- { -17, -18, -3, 22, -8, 1, 9, -2, -17, 20, -5, -5, -12, -5, 4, -5,
- -9, 8, -2, 16, -3, 0, 19, -8, 8, 1, 2, -4, 0, 11, 0, -3 },
- { -9, -23, 3, 10, 4, 4, -3, -2, -2, -2, 1, -22, 11, 0, -2, 5,
- -2, 14, -9, -11, -4, 7, 5, 32, 1, -3, -7, 0, 21, -9, 7, -6 },
- { 0, 0, 0, 2, -1, 1, 0, 1, 3, 0, 0, 1, 0, 1, 0, 1,
- -3, 0, -1, -2, 0, -1, -1, -3, -1, 1, -4, 1, -1, -5, -69, -19 },
- { -3, -5, -8, -12, 4, -3, -19, -11, -5, 0, -14, 7, 18, -6, 7, 22,
- 8, 14, 15, 10, 3, -1, -3, 5, -1, 7, -7, 1, -6, 3, -26, -11 },
- { -1, -6, 4, -4, -5, -16, 0, -6, -3, 11, 1, 0, 9, 5, 16, 3,
- -4, -33, -4, 4, -7, 0, 1, 6, -11, -2, -13, -2, -18, 20, -25, -16 },
- { 4, 0, -1, 0, -5, 1, 0, 2, 0, 11, -10, 4, -10, 7, 16, 2,
- 16, 15, 2, -1, 2, 9, 2, 8, -3, -5, -2, 0, -3, 0, -33, -2 },
- { -3, -15, 10, 10, -9, -1, 7, 3, 5, -5, -8, -8, -3, 15, -9, 4,
- 12, 13, -13, -14, 10, -6, 9, 22, -27, 23, -1, 5, -24, 2, -30, 5 },
- { 0, -2, 7, -5, -5, 3, 5, 3, -3, -5, 2, 1, -4, 3, -3, -1,
- 1, -2, 10, 22, -3, -4, -2, -2, -7, 3, 8, 1, 14, 4, -37, 9 },
- { -3, -4, -1, 1, -4, 0, 6, 2, 6, -7, -10, -10, -1, -4, 11, -3,
- 7, -6, 4, -12, -1, 5, 1, -7, 10, -6, 17, -4, 8, 3, -40, 13 },
- { 2, 12, 4, -7, 14, -3, 16, -2, 18, 2, 13, 5, 5, 1, 11, -1,
- 0, 9, 2, -6, -1, 2, -6, 2, -5, 3, 5, 1, -1, 1, -32, -7 },
- { -16, 11, 7, -4, 2, -5, -9, 9, 11, 11, 15, -13, -11, 11, 9, 4,
- 3, -8, -10, 12, 12, 0, 0, -16, -9, 13, 2, 9, 4, -13, -33, 3 },
- { 6, 4, 5, 4, 3, -1, 5, 6, 4, 2, -11, -1, -15, -11, -1, 1,
- 11, -3, -2, 24, -4, -6, -25, -10, -15, -8, 0, 0, -5, 4, -30, 2 },
- { 10, -3, -6, 1, -9, -5, 6, 9, -10, -3, 8, -1, 4, -1, 11, -11,
- 3, 9, 11, -3, 6, -17, 5, -8, -33, 9, -13, 19, -2, 9, -25, 2 },
- { 0, 0, -1, -3, 0, -2, 1, 0, 0, 2, 1, 0, -2, 0, -1, 2,
- 0, -1, 4, -1, 2, -3, 4, -2, 3, 3, 1, 0, -15, 12, -63, 27 },
- { -2, 14, 9, -1, 3, 0, 1, 1, -19, 15, 3, 4, 0, -10, 1, -5,
- 3, 0, -5, -10, 2, -16, -4, 8, -12, -6, 7, -5, -10, -1, -33, -4 },
- { 0, 3, 1, 3, 1, 2, 4, 4, 9, -6, -8, -5, 1, -12, 3, 8,
- -10, 6, -1, 1, 13, -5, -5, 2, -4, 13, -18, -10, -7, -9, -33, 10 },
- { -6, -3, -12, 5, -1, 11, -6, 0, -2, 1, 2, -7, 3, 1, 3, -2,
- 1, 8, -10, 7, -1, -3, 3, 0, 13, 1, 6, 7, -16, -7, -39, 8 },
- { -6, -1, 11, 6, -3, 8, 3, -5, 3, 0, -5, -2, -6, -3, -4, 2,
- -3, 13, -11, 1, 7, 5, 19, -5, -3, -15, -1, 7, -1, 6, -33, 8 },
- { -7, 3, -4, -3, -4, 1, 6, -5, -5, 6, -8, -1, -7, 4, -1, -6,
- -2, 1, 7, 0, 1, 1, -5, 2, -2, 0, -13, -2, -31, -14, -39, -12 },
- { -10, 9, 0, -3, 1, -1, -1, 0, 1, -5, -1, -4, -2, 5, 2, -7,
- 18, -8, -2, -19, -7, -7, -12, -14, -11, -1, -9, -13, -7, -12, -31, -9 },
- { -3, -16, 10, 9, 1, -10, -12, 2, -2, 2, 7, -3, -3, 1, -4, -5,
- -9, 5, 7, 3, -1, 4, -11, -8, 4, 13, -10, 13, 10, -4, -36, 1 },
- { -7, -12, 4, -20, -7, -7, 2, 11, -1, -2, 3, -12, 1, 0, -6, -7,
- 6, 4, 13, 3, -3, 4, 3, -6, -12, 5, -5, -22, -13, -8, -37, -6 },
- { -7, 5, 3, 5, 7, 9, -14, -3, 10, 17, -1, 1, -12, 5, -6, 0,
- -4, -9, 0, -11, -14, 3, 13, 6, -25, -8, -12, 4, -10, 18, -30, -1 },
- { -10, 6, -10, 6, 6, 1, -10, 0, -7, 5, -2, 17, -18, -4, 0, -3,
- -16, -6, -3, -8, 5, 1, -4, 6, -7, 16, 6, 10, -1, 0, -32, -11 },
- { -1, 9, 9, -5, 4, 9, 6, 9, -4, -2, 7, 11, 4, 2, -5, -4,
- -6, 0, 2, -3, -1, 5, 10, 0, 12, -10, -18, -3, -1, 14, -33, 2 },
- { 4, -8, -18, -4, -5, -11, 4, -10, -4, 9, 13, -12, 1, -6, 1, 2,
- 4, -9, 8, 3, -6, 21, 13, -1, -2, 1, -2, 6, -7, 0, -30, 1 },
- { 6, -1, 2, -3, -1, -4, 6, -4, 0, 4, 2, 2, -9, 2, 6, 3,
- -2, 4, -1, 9, -6, 0, 7, -8, 5, 19, -2, 9, -5, 2, -33, -8 },
- { 2, 1, 12, -5, -8, 8, 3, -2, -4, 1, -2, 5, -4, -9, -8, -8,
- 7, -11, -4, 6, -10, 7, -1, -1, -2, -1, 16, 32, -7, 20, -33, -6 },
- { -18, 2, 6, 13, 9, 9, -1, 3, -17, 24, -2, -6, 28, 8, -2, 6,
- 3, -10, -34, -16, -13, -4, -15, -11, -12, -3, -10, 4, -8, 4, -31, -4 },
- { -11, 0, 18, 2, -16, -9, -13, -2, -2, -12, -3, -22, 30, 0, 8, 3,
- 9, -4, -16, 1, 0, -11, 15, -2, -4, 6, -5, 6, 1, 2, -25, -12 },
- { 14, -1, 5, 7, 3, -15, -8, 1, 5, -2, 12, 13, 11, -25, 3, 1,
- 0, -2, -4, -16, -23, 0, -5, -17, 7, 5, -9, 6, -5, 2, -32, -7 },
- { 3, -1, 6, 14, 2, -12, -9, -9, 4, 7, 4, 6, 5, -8, 4, 2,
- 4, 5, -2, 8, 8, -6, 0, 10, -20, -1, 3, -1, 8, 23, -33, -5 },
- { -3, 11, -6, 3, -4, 5, 7, 3, 4, 5, -2, 3, -1, 30, 6, 1,
- 8, -6, 0, 0, -9, 6, -9, 4, 2, 9, -6, 1, -12, 0, -34, 18 },
- { -17, 13, 0, 1, 9, -4, -11, 0, 7, 0, -10, -4, -1, 6, -6, 4,
- 1, 6, -9, 3, -5, -6, -11, 2, -4, 14, 23, -3, 2, 5, -30, 12 },
- { -14, 5, -27, 2, 0, 7, 1, 4, 30, 8, 7, 5, 1, -1, 0, 5,
- 8, -10, 48, -11, 12, 33, 6, 8, -15, 20, -2, -5, 32, 5, -19, 10 },
- { -16, -4, -12, -7, -2, 0, 8, -6, -20, -18, 16, -3, 0, 31, -2, 11,
- 2, -9, 49, -19, -12, -23, 10, 26, 16, -2, 4, -21, -14, 13, -11, -9 },
- { -5, -9, -1, 3, -5, -21, 2, 10, 0, 0, 10, -21, -7, 7, -26, -9,
- 22, 32, 58, 11, -3, 11, -5, -8, -13, 6, -5, -9, 1, 10, 14, -8 },
- { 7, 7, 10, 3, -2, -1, -11, -11, -6, -43, -3, 14, -19, -18, 19, 18,
- -32, 10, 45, -6, 6, 21, -20, -12, 2, 4, 6, 6, -4, 3, 3, 1 },
- { 21, 22, -3, -2, -11, -6, -1, -2, 8, 8, 32, -21, 7, 28, -4, -6,
- -3, -2, 50, 2, 2, 27, -5, -8, 12, 7, -5, -1, -4, -17, 27, 6 },
- { 13, 7, 2, -6, -12, 2, -10, -5, -17, 11, 4, 17, -12, -2, 5, -17,
- 37, -16, 48, -14, -18, 29, 8, 24, 11, -5, -9, 11, -1, 1, -13, -3 },
- { 1, 1, -1, 2, 0, 0, 0, -1, 1, -1, 7, 2, -3, 3, 0, 6,
- 2, 10, 54, -25, 7, 54, -5, -6, -1, -15, 9, 13, -24, -15, -12, 3 },
- { 21, 5, 8, 3, -3, -4, -2, -4, 3, -11, -5, -8, 9, 16, 8, -9,
- -10, -3, 46, -46, 2, 1, -10, 10, 17, 11, -20, -36, 10, 14, 0, -5 },
- { 7, -13, -6, -9, -24, 45, 2, 8, 8, 0, 17, 20, 12, -24, 1, -7,
- -15, -3, 46, -13, -2, 20, 1, -13, -11, -13, 2, 15, 1, 10, -1, 3 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, -2, -1,
- -16, -9, 31, -69, -34, 26, 7, 17, -1, -6, -1, 0, 0, 0, 0, 0 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -4,
- -5, -20, 18, -82, 22, 3, -7, 9, 4, 6, 2, -4, -1, 0, -2, 2 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, -1,
- 15, -5, 62, -36, 4, 52, -7, 5, 0, 6, 1, 2, 1, 1, -1, 0 },
- { 3, -19, 19, -20, 13, -4, -11, 8, 8, -16, 10, 1, -14, 30, 1, -33,
- 10, -11, 45, -30, 3, -4, -3, -13, 7, 12, 3, -22, 3, -2, -4, -2 },
- { -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 1,
- 11, 8, 70, 48, -10, 21, 4, 9, -9, -9, -4, -6, 0, -1, 0, 0 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,
- 2, -1, 80, 2, -15, -36, -10, -5, -2, 8, -2, 2, 0, 0, 0, 0 },
- { 10, 8, -8, -8, -24, 12, -1, 0, 20, 9, -1, -2, 2, -2, 12, -10,
- -2, -13, 35, -43, 44, 15, -10, -25, 4, 10, -3, -5, -5, 7, -1, 3 },
- { 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, -2, -1,
- -18, 9, 49, -72, 7, -8, 7, -5, 2, 3, 2, -2, 1, -2, -3, 1 },
- { -1, 4, -3, 10, 19, 4, 3, 20, 6, -24, 6, 9, 8, 15, 18, 18,
- -36, 19, 57, -11, 4, -3, 8, 7, 2, -3, -2, -9, -15, -2, 12, -4 },
- { 20, 3, 11, -9, -4, 22, 42, -25, 1, 5, -10, -19, 0, 9, -16, 5,
- 2, 10, 44, -29, 17, -3, -9, -2, -1, 8, 14, -7, -1, 16, -5, 1 },
- { -7, 16, -11, 12, 6, 33, -15, 14, -23, 2, -26, 8, 2, 10, 0, -5,
- 8, -8, 38, -38, -4, 5, 5, 5, 1, 22, -15, 7, 6, 0, 4, 28 },
- { -1, -12, 2, 10, -2, 0, 7, 17, 12, 22, -4, 10, 25, 29, 5, 18,
- 4, 1, 27, -39, 31, 17, 2, 2, 22, -23, 13, 16, 1, -7, -4, -5 },
- { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, -2, 0, -14, 0,
- -7, -11, 49, -22, -4, 19, 17, -39, 4, -29, 10, 2, 36, -4, 23, -1 },
- { -2, -2, -2, -2, 1, 15, -5, -7, -16, -8, -19, 16, -3, -20, 36, -9,
- -3, 20, 39, -20, 0, 2, 27, -16, 10, 10, -14, -22, -16, -3, 13, -8 },
- { 5, -9, 6, -25, 7, 37, 13, -10, -5, 3, -5, 7, 18, -22, -7, 9,
- -5, -4, 50, -11, -4, -5, -5, 8, -4, -2, -4, -27, 14, 20, 7, -9 },
- { 0, -14, -10, -27, -14, -17, -6, 26, 10, 2, 14, -12, -5, 0, 8, 9,
- 0, -28, 55, -7, -12, -7, 4, -10, 10, 7, -12, 11, 3, 5, 9, -8 },
- { 2, 23, 4, -2, -1, -20, -2, 14, 10, -9, -9, -24, 10, 0, 11, -12,
- 12, 11, 49, -25, -2, 29, 7, -13, 21, -10, 11, -17, 3, 1, -8, 5 },
- { 3, 0, -14, -6, 18, -2, 17, -9, -19, 9, -5, 9, 14, 6, 19, -3,
- 27, 1, 41, -21, 20, -15, 33, 0, 26, 14, 7, 10, 3, 20, -3, -12 },
- { -1, 16, 15, -8, 3, -8, -8, 21, -5, -16, -29, 4, 1, -6, -4, -28,
- 2, 31, 37, -26, -2, 13, 24, 8, -9, -6, -29, 10, 7, 2, 7, 8 },
- { -10, -10, 11, 13, -32, 2, 16, 9, 14, 23, -15, -13, 24, 13, 4, -27,
- 14, 12, 31, -18, 17, 23, -2, -7, -14, 9, -17, -6, -10, 20, 9, 6 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,
- 5, 1, 89, 8, 10, -6, 2, -1, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, -1,
- 4, -7, 64, -50, 7, 37, 2, 5, 0, 0, 0, 0, 0, 0, 0, 0 },
- { -2, 5, 3, -4, -4, -3, 2, -3, 3, -3, 5, 4, 1, -6, -1, 1,
- 6, -2, 50, -35, -7, 43, 7, -7, -5, -26, 24, 21, 3, -15, 5, 6 },
- { -8, 21, -19, 33, -8, 22, -11, 17, 3, 0, 0, -2, 1, -3, 6, -1,
- 10, -8, 4, -11, -4, -5, 0, 8, -4, 3, 1, -4, 4, 2, 8, 4 },
- { -7, 5, -20, 9, -22, 3, -14, 1, 6, 13, 23, -2, -4, -7, 2, 0,
- 11, 4, 6, 3, -7, -11, -7, 4, 5, 5, -12, 8, 2, 4, 7, -3 },
- { -7, 6, -4, 20, -20, 16, -2, 7, 6, 16, 11, 12, -7, -7, 5, 3,
- -9, -4, 1, 2, 5, 2, 1, -9, -2, -17, -4, 6, -10, 7, -7, -6 },
- { -9, 18, -17, 12, -24, 1, -1, 4, 14, 9, 4, 3, 2, 8, -12, -14,
- 4, -8, -4, 7, 7, 6, -1, 13, -9, -4, -1, 1, 0, -4, 15, 8 },
- { -25, 2, -11, 6, -5, 24, -28, -5, 8, 12, -2, 6, 8, -3, 8, -9,
- -1, -5, -1, -5, 6, -1, -1, -1, -4, 8, -12, -2, -13, 7, 2, 1 },
- { -14, 14, -18, 20, -10, 12, -2, 9, 1, 0, 12, -2, 15, -10, 26, -17,
- 16, -11, 10, -10, 9, -2, 4, -8, 2, -3, 4, 4, 2, -3, -5, 1 },
- { -18, 12, -18, 21, -6, 12, -6, 13, -25, 18, 1, 11, -9, -5, 0, 10,
- -5, 3, -3, 8, -9, 7, 4, 2, -9, 0, 5, 0, 2, -3, 9, -8 },
- { -4, 16, 1, 18, -30, 9, 1, 6, -8, 13, 13, -12, -6, -1, 13, 7,
- 6, 2, -15, -3, 5, 5, 1, -6, 1, -5, 0, 2, -16, 0, 3, -4 },
- { -21, 1, -2, 6, -43, 18, -1, 5, -1, 4, 6, -2, -1, -3, -1, -3,
- 0, 1, 2, -9, 0, -1, 0, -2, 0, -1, -1, -2, 6, 0, 1, -2 },
- { -23, 10, 4, 7, -32, -11, -18, 2, -2, -7, -6, -3, -3, -12, 19, 3,
- -5, -6, 16, -6, 16, 2, 16, 16, 8, -2, 13, 8, -15, -11, 2, 10 },
- { -8, 2, -13, 2, -29, 24, -20, 19, 1, 10, -4, 10, 1, 2, -9, 11,
- -1, -2, 9, -5, 19, -7, 16, -9, -2, -18, 11, 1, 1, 0, 7, -3 },
- { -6, 3, 4, 13, -26, 10, -10, 28, -7, 28, 1, 7, 0, -14, 5, 7,
- 4, -4, 3, -2, 3, 3, -11, 7, 6, 4, 0, -1, 2, -1, -3, 2 },
- { -6, 16, -31, 13, -10, 17, -6, 4, -14, 4, 4, -1, -10, 12, -5, 1,
- -14, 15, 0, -8, 1, -5, 3, 3, 9, -5, 7, -20, 7, 4, 11, -5 },
- { -19, 3, -17, 14, -12, 16, -22, 18, 14, 8, -2, 4, 10, 12, -14, 4,
- -3, 2, 3, 7, -7, 7, -6, 2, -2, -4, -5, 0, -5, -2, 2, 1 },
- { -9, -7, -11, 24, -36, -9, -11, 5, 7, -12, -13, 18, -2, 20, 1, -4,
- -1, -10, 15, -6, 14, 1, 0, 2, 1, 2, -9, -16, -11, 7, 13, 0 },
- { -24, 24, -18, 18, -22, 14, -11, 13, -12, 11, -10, 11, -7, 11, -5, -4,
- -1, 1, 5, 2, 3, -1, 1, -5, 7, -4, 5, -6, 8, -7, 8, -6 },
- { -6, 18, -22, 22, 5, 11, -1, 6, 19, 22, 8, 4, -8, 20, -2, 15,
- -6, -18, 0, -33, -9, -12, -1, 6, 5, 2, 5, 5, -5, -17, -3, -3 },
- { 1, 11, -16, 9, -18, 11, -4, 18, 20, 26, -10, 8, 1, -11, 8, -4,
- 0, 7, 3, 5, 2, 2, 10, -2, -4, 4, -4, -2, 1, -4, -5, -1 },
- { -10, 6, -1, 18, -17, 27, -3, 10, -2, 12, -7, -9, 1, 1, -1, 7,
- -12, -1, -7, -6, -1, 8, 3, -15, 8, 9, 3, -7, 4, -1, 1, -1 },
- { -14, 6, -16, 22, 2, 5, 0, 5, -18, 11, 6, -3, 22, -20, -9, -3,
- 6, -6, -7, -15, 1, 15, -8, 11, 8, -3, -8, 1, -8, 2, 6, -2 },
- { -21, 5, -19, 19, -7, 4, -7, 0, -8, 6, 12, 5, -3, -22, -13, -6,
- -1, -3, -2, -14, 6, -3, 1, -8, -7, -5, -6, 11, -3, -10, -5, 2 },
- { -1, 9, -12, 15, -6, 6, -19, 14, -9, 11, 3, 12, -17, -3, 8, -4,
- -3, -4, 1, -5, 4, 5, -7, -15, -7, 15, -6, -5, 1, -5, -3, 1 },
- { -12, 20, -15, 20, -14, 3, -14, 9, -6, 33, -13, 6, -2, 8, -6, 7,
- -5, -6, -3, -3, 0, 8, -3, -3, 1, -2, 2, 2, 6, -5, -5, -2 },
- { -7, 12, -18, 12, -18, 10, -4, 8, 2, 4, 8, 9, 0, 3, -8, 3,
- 6, -12, -4, 1, 25, -5, -9, 6, -7, 0, -9, -7, 3, -5, -4, -4 },
- { -18, 12, -10, 11, -22, 0, -15, 5, -2, 2, -3, 6, -4, -4, -3, -15,
- -2, -3, 21, 6, -12, -11, 19, 3, 3, -14, 7, 0, -11, -22, -10, 0 },
- { -15, 2, -30, 15, -17, 13, -16, 8, -7, 10, -8, 2, 11, 3, 10, -7,
- 7, -22, 12, -10, 3, -12, 6, -10, 12, -10, 7, -8, 5, 2, 9, 1 },
- { -9, 11, -14, 6, -10, 21, 5, 12, -5, 5, 7, 21, 6, 2, -2, -1,
- -1, 4, 2, -20, -18, -1, -14, 3, -1, 4, -7, 10, 1, 11, 4, -4 },
- { -22, 8, -30, 13, -21, -4, 4, -1, 12, 9, -2, -3, 2, -6, 4, -13,
- -2, 8, 8, 1, -7, 3, -4, -5, -1, -7, -2, 8, 8, 7, 8, 0 },
- { -6, -4, -35, 16, -13, 15, -11, 14, -7, 9, -1, 11, 7, 0, 13, 10,
- -1, 8, 1, 1, -2, 8, -1, 2, 2, 3, -10, -1, 7, -13, -3, -7 },
- { -15, 7, -16, 14, -18, 17, -6, 14, 3, 4, 7, -3, 10, -22, 5, -15,
- 4, -4, -11, 15, -15, 11, -11, 20, 1, 0, 2, 1, 11, -3, 11, -7 },
- { -12, 3, 5, 16, -37, -1, 15, 15, -15, 10, 3, -10, 1, 15, 7, -15,
- -13, 8, 9, -3, 2, 12, -8, 2, -5, 0, -3, 4, 5, -9, -4, 5 },
- { -16, 26, -4, 14, -22, 26, 6, -3, -8, 4, 21, 6, 16, -4, -11, 7,
- -10, 3, 3, 7, -4, 2, -9, 8, -2, 2, 5, -2, -4, -2, 7, -1 },
- { -7, -10, 4, 3, 2, -4, -12, -10, -4, -5, 16, 19, -16, 1, 2, -9,
- -10, 0, 9, 7, -8, 3, 12, 8, -6, -11, -13, -1, -3, -20, 6, -5 },
- { -14, -17, 3, -5, 14, -12, -12, 8, -6, -25, 21, 21, 10, -8, -12, 4,
- 10, -4, 3, -9, 11, 9, 0, 4, 2, -15, 1, -14, 4, 1, 0, -4 },
- { -4, -9, -3, -1, 6, 3, -6, 6, -10, -4, 14, 8, 2, -3, -12, -19,
- 0, 11, -20, 1, 6, -2, -27, -6, 10, -17, -14, -17, -9, 8, -8, 3 },
- { -12, -13, 16, -4, -2, 12, -7, -11, 2, -13, 3, 7, -16, -18, -1, -12,
- -2, 1, -12, -9, -2, -6, 2, 9, -22, -3, -4, -14, -7, 7, -1, 2 },
- { -7, -8, -8, 15, 15, 18, 15, 16, -4, -37, 11, 15, -12, -1, -3, 3,
- 6, 6, 0, -5, -3, -5, 9, 1, 1, -11, -1, -8, -6, 2, 3, 0 },
- { -6, 7, -5, -12, 13, 10, -18, -4, -3, -21, 6, 16, -15, -7, -12, -9,
- 1, -12, -1, 10, -2, -1, -3, 4, -4, 1, -16, -1, 12, -9, 5, 9 },
- { -14, -5, 9, 3, 4, 26, -28, 3, -6, -24, 4, 5, 3, 13, 5, -1,
- 3, -1, 3, 1, 1, -5, 3, 0, -7, -8, -7, -3, 3, -5, 4, 0 },
- { -4, 2, -10, -6, 25, 26, -6, 10, -6, -8, 15, 11, -6, -3, 2, -7,
- 5, 14, 9, -1, 0, -12, 4, -4, -10, 1, -3, 3, -2, -2, -6, -1 },
- { -10, 8, -15, -10, 19, 17, -8, 0, -3, -7, 7, 5, -13, -1, 7, -7,
- 1, 13, -12, -13, 17, -12, 1, 26, -18, -3, -5, -6, 4, 5, 8, 1 },
- { 2, -5, 3, 0, 0, 0, 2, -3, -2, -5, 7, 13, -4, 9, 0, -5,
- 4, -1, -11, -8, -4, 0, -13, 2, -47, -23, -8, -11, -4, 4, -2, -3 },
- { -18, -4, 4, 5, -1, 17, -12, -8, 1, -12, 7, 20, -12, 3, -2, -11,
- 16, 12, -6, 1, -13, -16, -6, -3, -3, -5, 4, -12, -5, -9, 10, 1 },
- { -11, 0, 4, 7, 7, 8, 3, -1, 3, -19, 32, 8, -19, -8, 2, 4,
- -12, 15, -16, 3, 1, 9, -2, 1, -2, 8, 5, 6, -4, -1, 11, -8 },
- { 3, -1, 4, -2, 14, 32, -9, -23, -10, -12, 22, 15, -1, -2, 10, 0,
- 4, 6, -8, 4, -15, -2, -1, -4, 0, -8, 4, 1, -8, 3, 4, 1 },
- { -17, -12, 6, -8, 16, 13, -20, -8, -1, -16, 10, 21, -19, 11, -9, -5,
- 7, 18, -6, 7, -7, -18, 13, 2, -2, 8, -12, -9, 2, 4, -5, 16 },
- { 4, 0, 17, -11, 12, 7, -12, 5, -1, -25, 30, -8, -7, -6, -4, -7,
- 9, 8, 7, 3, 3, -16, 8, 0, -2, -2, -18, -3, -4, -5, 1, 4 },
- { -3, -6, 6, -16, 17, 6, -3, 2, -9, -17, 12, 11, 11, 2, -20, 8,
- 1, 1, 0, 2, -2, -6, -21, -13, -9, -15, -1, -8, -6, -8, 0, -2 },
- { -11, -7, 6, -9, 3, 6, 8, 16, 4, -5, 23, 26, -10, -3, 4, 0,
- 2, 2, -4, 4, -2, -12, 12, 10, -11, 0, -10, -16, 3, 0, 0, -10 },
- { -5, -16, 10, -6, 27, 13, -3, 4, -2, -13, 15, 5, 2, 5, 3, -4,
- 13, 12, -11, -7, 0, 1, 11, 12, 2, 13, -15, -8, 9, -2, 3, 8 },
- { -5, -8, 4, 3, 9, 3, -11, 10, 14, -25, 14, 8, -2, 5, -12, -21,
- 2, 10, -7, 2, -3, 2, 0, 2, -1, -3, -5, -6, -1, -16, 2, 8 },
- { -1, 5, 1, -11, 5, 9, -7, 8, -13, -12, 4, 12, -4, 1, -1, -1,
- 27, 29, 10, 15, 2, -6, -3, 4, -21, 10, -9, -11, -6, -1, -9, -3 },
- { -6, -3, -1, -6, 11, -5, 0, -2, -5, -31, 11, 3, -1, 5, -3, 4,
- 5, 7, -10, 5, -10, -13, 4, 12, -15, -2, 2, -7, 1, -9, -3, -10 },
- { -3, -7, 17, -8, -5, 36, 8, -7, -8, -20, 12, 8, 1, -1, 3, 0,
- 1, 4, -10, 3, 1, 4, -2, -3, -2, -3, -10, 4, -1, -7, 3, 2 },
- { -13, -3, -5, 9, 22, 6, -23, 3, -10, -7, 17, 17, 18, -14, -8, -8,
- 2, 4, -8, 2, -3, -8, 6, 4, -1, 7, 0, 0, -3, 0, -12, -3 },
- { -3, -10, -15, -3, 9, 3, -23, -9, -13, -18, 12, 13, -2, 0, 1, 8,
- -1, 2, -7, -12, -5, 14, 2, 1, -22, 6, -10, -8, -9, 28, -7, -14 },
- { -3, 1, 2, -1, 13, 7, -2, -7, 1, -3, 6, 9, -3, -2, 4, -2,
- 2, 1, -10, -2, -2, -22, -2, -7, -10, -5, -11, -27, -12, -16, 4, -7 },
- { 2, -6, -3, 1, 8, 0, -2, 12, -3, -4, 58, 15, -10, -4, -2, 2,
- -2, 0, -2, -6, 2, 4, -1, 1, -4, 1, -1, -5, -4, -3, 3, 1 },
- { 10, -1, 0, 5, 21, 7, -14, 6, -3, -16, 15, 17, -16, 13, 3, -6,
- -4, 6, -12, -5, 1, -4, -7, -8, 2, 3, -6, 6, -1, -8, 5, 4 },
- { -6, -2, -8, -11, 15, 10, 0, 8, -6, -15, 33, 8, -2, 18, -15, -11,
- 5, -1, 0, 15, -15, -4, -4, -1, 10, 7, -13, 4, -4, 0, 8, 3 },
- { -7, -2, 0, -2, 0, -2, -4, -5, -14, -16, 12, 38, 7, 12, 6, -4,
- 0, -1, 0, 3, -2, -6, 0, 2, -9, 1, 0, -1, 0, -2, 4, 1 },
- { -8, -4, 18, 1, 14, 5, -12, -3, 20, -17, 5, 19, -11, -8, 11, -3,
- 3, 9, -7, -8, 9, -17, 2, 15, -10, -11, 5, -5, 7, 15, -6, -2 },
- { -7, 2, 38, 5, 19, 16, -5, 4, -13, -20, 0, 4, -4, 6, 4, 2,
- -7, 6, -8, -2, -5, -7, 6, 3, -4, -3, -2, -3, 7, -6, -4, 0 },
- { -11, -12, 8, -15, -3, 14, -7, -22, -11, 2, 22, 14, -19, 2, -19, -6,
- 1, 3, -18, 14, 2, -6, -2, -8, -3, -6, 5, -7, -8, -4, 1, 1 },
- { 8, 7, 25, -21, 12, -6, -5, -4, -10, 6, 0, 10, 1, -12, 18, -5,
- -15, 4, 1, 14, -1, 5, 8, -7, 1, -7, -3, 9, 10, 1, -1, 0 },
- { 9, 10, 32, -15, 8, 2, 11, -7, -18, -8, 2, -6, -9, -16, -3, 3,
- -1, 3, 1, -5, 4, -2, 1, -8, 0, -6, -3, -11, 1, 5, 0, 0 },
- { 14, 0, 23, -25, 22, 3, 7, 10, 0, -2, 7, 8, 0, 10, 0, 0,
- 3, 2, 3, -10, 0, 10, 0, -7, 0, 10, -1, -5, -7, 1, -1, 2 },
- { 12, 0, 25, -18, -5, -4, 13, -10, 3, -6, 7, 21, 0, -16, 3, -10,
- -6, 5, -7, -3, 2, 5, 3, -6, 4, 9, -8, 12, -2, 3, 2, 4 },
- { 31, 15, 27, -20, 10, -7, 15, -10, 9, -8, 4, -5, 3, -3, 5, 6,
- 11, -2, -12, -2, 6, -2, 1, 2, -1, -1, 1, 1, 3, 1, 1, 2 },
- { 12, -4, 13, -23, 12, -6, 2, 4, -3, 13, 6, -7, 5, -19, -7, 18,
- 1, -7, 7, 1, 16, -7, 3, 0, 3, 0, -12, 8, -11, 9, 4, 7 },
- { 29, 1, 3, -22, -5, 6, 0, 12, -14, 11, 1, 6, -3, 4, 6, -2,
- 4, -13, 12, 1, 1, 3, -11, 9, -10, -1, -7, 16, -11, -1, 3, 9 },
- { 4, 4, 36, -23, -5, -8, -15, 1, -6, 3, 13, -1, -5, -7, 4, 9,
- 2, -11, -3, 5, 1, 3, -6, -1, -4, -4, -2, 2, 3, -1, -5, -2 },
- { 19, 10, 6, -17, 2, -4, -2, -4, -3, 13, 2, 2, -13, -7, -3, -11,
- 9, -6, 1, -9, -5, 4, -5, -9, -18, -7, -11, 9, 4, -11, 8, 4 },
- { 16, -3, 9, -16, 18, -2, -12, -16, -11, 11, -18, 16, -13, 6, 2, 8,
- 3, 8, -4, -16, 10, -11, -1, -3, -8, 5, -9, -4, 9, -4, 0, -3 },
- { 14, 15, 3, -23, -5, 7, -8, -6, 2, 17, 2, 12, -8, -12, 13, -1,
- -9, 3, 1, 1, 19, 15, 4, -1, 1, 2, -3, 2, -3, 1, 5, 3 },
- { 32, 5, -10, -47, -5, -1, 4, 11, -7, 0, 2, -2, 1, -7, 6, -4,
- 6, 2, -4, -2, 2, -2, 0, -4, 1, -6, -5, 2, -2, -1, -3, -4 },
- { 20, 8, 10, -21, -7, -9, -16, 12, 1, 4, 6, -5, 9, -11, -7, 4,
- -11, 28, -3, 2, 4, -6, 10, -8, -5, -5, -9, 9, -2, -1, 6, -5 },
- { 38, 3, 23, -25, -6, -18, 3, -10, -8, 6, -10, 1, -10, 2, 2, 0,
- -7, 2, -4, 5, -1, 8, -3, 0, 3, 3, -1, 1, 0, -4, -4, 0 },
- { 20, 5, 16, -22, 24, -18, 2, -12, -14, -7, -3, 10, 2, 7, -10, 2,
- -8, 1, 8, -1, 4, 1, 4, -2, 5, -9, -18, -8, -13, 5, -11, 10 },
- { 14, 8, -12, -16, 9, -11, -3, -6, -25, -7, 6, 5, -7, -16, 10, 2,
- -7, -1, -9, -3, 16, 4, 3, 3, -3, -3, -15, 13, -3, 4, 13, -7 },
- { 16, -9, 19, -23, 7, -19, -3, -5, -15, 11, -21, 21, -16, 18, -1, 6,
- 10, -10, 18, -14, 16, -15, 6, -5, -9, 5, -17, 13, -10, 13, 0, 10 },
- { 8, -4, 4, -24, 8, -21, -18, 9, -11, 4, -6, 17, 5, -9, -2, -2,
- 2, 15, -2, -3, -2, 1, 7, -13, 15, -10, -8, -11, 3, 3, -1, -1 },
- { 14, 17, 6, -32, 5, -17, -2, 0, 15, -1, -5, 16, 1, -5, -2, 9,
- -3, 8, 4, -2, -2, -4, -3, 1, 0, 7, -3, 4, -5, 0, -7, 2 },
- { 24, 6, 22, -12, 8, 3, -14, 4, -7, 8, 6, 5, 6, 1, 6, -12,
- 15, 10, 4, 11, 9, 6, -7, -4, 10, -9, 2, -1, -5, 11, 15, 3 },
- { 17, 12, 3, -23, 5, -1, -2, 1, -9, -1, -3, 1, 8, 1, -5, 17,
- 11, 0, -2, -11, 7, 4, 0, -27, -7, 1, 2, -8, 9, 7, 5, 3 },
- { 12, 10, 12, -10, -4, 5, -1, 2, -24, 5, -8, 2, 6, -17, 19, 5,
- 12, -2, 16, -7, -6, -14, 4, 1, -3, 13, -16, 5, -1, 4, 1, 1 },
- { 31, 9, 11, -17, 10, -3, -7, 7, 1, 2, 2, 4, -3, -1, 11, 4,
- -5, -8, 1, 4, 15, -6, -28, 1, 8, 3, -6, 5, 17, -2, 2, -4 },
- { 11, 19, 16, -26, 0, -7, -7, 2, -13, -15, -12, 9, -3, 27, 8, 4,
- -6, 1, 4, -6, 11, -1, -6, -7, -3, 0, -6, 4, -6, -7, -3, -1 },
- { 10, 18, 16, -32, 19, -9, -4, -3, -7, 8, 8, -3, -11, -2, -6, -16,
- 13, 13, -6, -1, 10, -2, -2, -9, 0, -3, 9, 4, 11, -2, -6, 6 },
- { 9, 4, 19, -33, 4, 7, -12, 36, -3, -1, 8, -2, 2, -8, -9, -4,
- -8, 0, 1, -1, 0, -4, -4, 3, 0, 3, 6, 0, -6, 2, 0, -2 },
- { 25, 7, 15, -12, 2, -24, -1, 24, -4, 4, 9, 0, -2, -9, 4, 6,
- 3, 13, -3, 1, 5, -1, -3, -5, -1, 7, -2, 3, 4, 4, 1, 0 },
- { 19, 6, 8, -20, 9, -9, 5, -4, -13, 7, 11, -3, 5, -13, -9, 6,
- -11, -1, 0, 4, 11, 26, 3, 6, -7, 12, 6, -3, 1, -9, 7, 1 },
- { 15, 6, 19, -23, -3, -9, 3, 16, -6, -4, 6, -5, -10, 1, 16, -14,
- 2, 0, 2, -13, -3, 8, -6, 3, 1, 1, 2, -5, 12, -4, -8, -3 },
- { 14, 4, 16, -20, 1, 12, 0, 6, -3, 9, 4, 16, 10, -16, 5, 7,
- 5, -4, -4, -18, -3, -11, -4, 4, -7, 3, 13, 7, 3, 3, 2, -7 },
- { 22, 3, -1, -30, 18, -3, -9, 9, -2, 11, -16, -2, -14, 12, 0, 4,
- -5, 4, -1, 3, -20, 12, 4, -10, -2, -2, -12, -12, 10, 6, 11, -3 },
- { 15, 7, 2, -21, 5, 4, 9, -9, -33, 7, 7, 3, -6, -14, -8, 10,
- 12, 0, 2, -1, 5, 4, -2, 0, -7, 0, 2, 4, 0, 1, -3, 8 },
- { -7, 0, 12, 3, 0, -6, 8, -4, 0, 2, 14, -15, 2, -7, -31, -3,
- 14, 0, 14, -15, -1, -4, -15, 10, 1, -3, 1, 2, 5, 2, -8, 1 },
- { -2, 5, 1, 0, -3, 3, 3, -6, -1, 2, -4, 1, -19, 0, -11, 18,
- 11, 10, 21, 5, 6, 2, 10, 3, -6, 0, -2, 13, 5, -1, -2, 9 },
- { -9, 1, -5, 0, 0, -15, 8, 4, 8, 3, 8, 12, -13, -2, -39, -2,
- 4, -4, 5, -3, -4, 3, -3, 3, 10, 5, 3, 2, -3, 5, -2, 8 },
- { -9, 6, 6, -8, 12, -12, 23, -18, 4, -15, -5, 2, -20, 13, -7, 7,
- 7, -12, 14, -12, 6, 1, 1, -3, -8, 9, 0, 1, -7, 3, 7, -6 },
- { -18, 13, 4, 3, -10, -30, -10, -6, -14, 1, -7, -4, -35, 5, -25, 11,
- 9, 8, 19, -4, -7, -3, -18, -8, 1, 5, 10, -4, -14, -9, 3, -4 },
- { -6, -1, 4, -9, -9, 4, 20, 0, 0, 3, 11, 7, -16, -17, -20, 11,
- -6, -14, 1, 4, 19, 2, -8, 6, -15, 3, 6, -5, -14, 3, 7, 2 },
- { 1, 6, -2, -8, -5, -3, 3, -8, 21, 1, 3, 16, -14, -2, -9, -4,
- 13, -2, 18, 14, 14, 19, -13, 5, -10, 2, -3, 3, 5, 5, 1, -1 },
- { -1, -5, -6, -2, -11, -7, 5, -4, 5, -1, 0, 3, -3, 2, -19, 18,
- 16, 4, 14, -22, -2, -11, -22, 1, -1, 11, 1, 2, 11, -10, 7, -12 },
- { 1, 4, 5, -1, -9, -5, 1, 12, 5, 6, 12, 9, -24, 23, 1, 20,
- 14, -11, 13, 5, -2, -2, 5, 6, 2, 1, -9, 6, 10, 5, -4, 11 },
- { -1, -1, 1, 7, -3, -4, 8, -16, 15, -1, -7, 9, -22, -11, -11, 10,
- 16, 9, -2, 4, 13, 10, 6, 16, 4, 7, 1, -8, -7, -14, -7, 4 },
- { 1, 3, -6, 0, 15, -9, -4, 0, 4, 6, 12, 9, -6, -5, -22, 17,
- 7, -11, 15, -5, 1, 3, -19, 0, -15, -3, 16, 5, 5, -7, -11, 12 },
- { -2, -1, 13, 2, 4, -24, 37, -5, -2, -6, 12, 7, -2, -23, -4, 9,
- 2, -3, 3, 2, 3, 3, -14, 11, 0, -4, -2, -2, 3, 10, -10, 4 },
- { 2, 9, 8, -6, -28, 14, 28, -11, 18, -11, 0, 2, -2, 4, -12, 3,
- 6, 0, 7, -7, -6, 2, 5, -1, -1, -1, 5, 2, 3, 0, -3, 9 },
- { -7, 14, 5, -10, -3, 7, 4, -5, 7, -8, -7, 4, -12, 14, -16, 25,
- 3, 0, 1, -5, 12, -10, 0, -10, 0, 12, 12, 17, 12, 10, -1, 0 },
- { -4, -2, 5, -2, -17, -3, 5, -5, 7, -17, 1, 5, -4, 4, -20, 0,
- 11, -15, 13, -8, 10, 1, 1, 5, -12, 9, -8, 0, 6, -1, -11, 4 },
- { -3, 12, 13, -15, -7, -7, 0, 5, 33, 3, 3, -6, -13, -7, -15, 10,
- 3, 3, 3, -5, 2, 7, -1, 0, -12, 2, 11, -6, -9, 0, 5, 11 },
- { -8, 5, 10, -7, -14, -4, 13, 0, 18, -3, -6, 7, 1, -6, 0, 21,
- 8, -7, 10, -8, -3, 17, -9, 0, -5, 1, 4, 8, -3, 11, -5, 0 },
- { -8, 8, -3, -8, 8, -11, 16, -16, 17, 0, 8, 16, -17, 10, -16, 10,
- -8, 6, 11, 0, 10, 7, 4, 5, 7, -5, -5, -6, -7, -5, -1, 16 },
- { -6, 0, 6, 1, -8, -8, 8, -7, -5, -10, -11, 8, -19, 6, -7, 13,
- 5, -3, 4, -8, 7, -1, -18, 9, 0, -5, 6, 26, 3, 8, 2, 4 },
- { -2, -2, 23, -2, -20, 2, 7, -7, -6, -15, 3, 9, -19, -2, -10, 7,
- -2, 7, 9, 11, 0, 4, -4, 6, 9, -2, 4, -3, 4, 3, 2, 8 },
- { -6, 12, 10, -10, -7, 4, 17, 11, -6, 1, 12, 11, -18, 8, -12, 4,
- 1, 13, 6, -13, 23, 9, -5, 8, -2, -5, 1, 3, 0, -2, -4, 4 },
- { 7, 1, 7, -17, -8, 8, -1, -7, 5, -6, 4, -3, -16, 9, -24, 18,
- -3, 10, 13, -11, -6, -11, -4, 10, 0, 11, 8, 2, 6, -5, -11, 4 },
- { -4, 1, -5, -10, 0, -3, 9, -2, 4, -1, 1, 5, -41, -10, -7, 4,
- -3, 3, 1, 0, -12, 4, -3, 0, 2, -1, -2, -5, 3, 2, -7, 5 },
- { -2, 1, 4, 4, -3, -6, 1, 0, 12, -5, 11, 0, -17, -3, -1, 11,
- 4, 1, 27, -12, 0, -14, 2, -15, -3, -9, 0, -7, -3, 15, -8, 6 },
- { -6, 4, 9, 2, 4, 3, 7, -10, 28, 1, -2, 48, 7, 0, -10, 10,
- 1, -9, 2, -1, 0, 3, -5, 5, -4, -2, 7, 7, 1, 3, 2, 5 },
- { -3, 3, -1, 3, -9, 0, -1, 3, 2, -6, 39, -14, -12, 5, -19, 21,
- 7, -6, 4, -1, -4, 0, -4, 1, 0, -9, 1, 10, 0, -2, 0, 7 },
- { 4, 2, -29, 12, 5, -3, 16, -6, 15, -13, -4, -1, -13, 22, -16, 17,
- 16, 4, 9, -4, 4, -6, -4, 11, -8, 7, 8, 4, 3, -3, -7, -13 },
- { 0, 3, 3, -6, -4, 0, 9, 0, 5, 0, 10, 10, 4, -13, -12, 16,
- 23, -4, -12, -6, -4, 20, 2, 0, -4, 23, 1, 8, 11, -4, -5, 15 },
- { -6, 4, -15, -9, -1, -19, 12, -30, -17, -4, 1, -13, -13, 4, -3, 26,
- 5, -25, 11, -14, -6, -13, 0, -7, 9, 2, 8, -1, -8, 1, -8, 13 },
- { 1, 6, 1, -4, -4, 1, 2, 0, -3, 2, 10, 6, -6, -2, -11, 4,
- 32, 15, 15, -47, -8, 3, -12, 4, -5, 4, -1, 0, -5, 5, 1, -7 },
- { 2, -1, 0, 0, -1, -6, 0, -6, 4, -4, 5, 9, -5, 1, -3, 51,
- 4, -5, 4, -14, -1, -4, -3, 1, -4, -1, 0, 2, -8, 0, 1, 2 },
- { 0, 4, -2, -7, -2, -9, 6, -8, 11, -3, -6, 3, -11, -8, -12, 8,
- 11, 5, 19, 3, -24, 19, -14, 11, -5, -18, -8, -12, -5, -4, -1, 4 },
- { 16, 9, 10, 14, -18, -2, -18, -27, 10, -5, 12, 14, 4, 0, -2, -6,
- -12, -7, -1, 3, 4, 7, 11, 10, 5, -5, -7, -16, -3, -6, 6, 9 },
- { 7, 15, -9, 10, -19, 4, -5, -37, -2, -4, 8, 2, 4, -1, 1, 9,
- -5, -5, -12, 1, -1, -8, 3, -3, 4, 6, 9, 3, 3, -1, 2, 4 },
- { 13, 17, 3, 9, -7, -7, -15, -17, -8, -13, -4, -8, 19, 2, 16, 25,
- 7, 15, 2, 16, -5, -6, -10, -9, -7, -6, -2, -7, 7, 2, 4, 5 },
- { 24, 7, 9, 8, -13, -2, 0, -4, 1, -13, 3, 6, 7, 10, -4, 15,
- 5, 7, -4, 5, -5, 3, 13, -7, 5, 15, -11, -2, 7, 5, 8, 6 },
- { 17, 6, -15, 23, -2, -1, -6, -2, 0, -4, 11, -3, 12, 15, 6, -8,
- -15, 10, -9, 7, -1, -11, 2, -8, -4, 3, 4, -10, 4, 4, 11, 1 },
- { 21, 12, -3, 6, -8, 8, -11, -8, -5, -5, 3, 7, -1, -5, 12, 15,
- -10, -11, 3, 15, 8, 4, 2, -15, 0, 14, 1, -8, -1, 3, 10, -7 },
- { 16, 12, 5, 13, -6, 15, -23, 0, -17, -9, 0, 4, -9, 13, 6, 18,
- 0, 0, -4, -1, 0, 14, 5, -1, 8, -4, -8, -6, 5, -2, -2, 0 },
- { 14, 16, -1, 12, -15, -9, -6, -20, 4, 6, 8, 9, 3, 1, -9, -4,
- -1, -11, 9, 11, -12, 1, -14, -7, 2, -8, 11, 9, -4, 10, 4, -16 },
- { 13, 10, 3, 7, 0, -8, -33, -6, 4, -4, 19, -2, 14, 6, 5, 7,
- 6, -3, -1, -10, -10, -9, 4, -3, 5, 9, 2, 2, 10, 9, -2, -3 },
- { 11, 10, 25, 18, -1, -6, -21, -21, -11, -16, 6, 5, 14, 4, 8, 7,
- 0, -10, -7, -9, -5, -4, 3, -1, 1, 6, -1, 6, -2, 2, -3, -9 },
- { 15, 9, 5, 22, -17, 15, -9, 7, 7, -9, 13, 9, 10, -1, 8, -3,
- -2, 6, 1, 17, 8, -14, 7, -3, 12, 9, 1, 0, 1, -5, 17, -18 },
- { 25, 19, -17, 12, -4, -10, 1, -13, -19, -7, -3, 9, 6, -2, 3, 1,
- 4, -2, -11, -14, -1, -7, -5, -9, 7, -1, -3, 4, -5, 1, 0, -1 },
- { 20, 8, -3, -10, -24, 3, -6, -2, 0, -12, 14, 6, 7, 11, 4, 7,
- -12, -5, -8, -10, 5, -1, -4, 4, 16, 7, -14, 6, -1, -2, -7, -11 },
- { 16, 18, 17, 1, -15, -6, -5, -3, -1, -19, 8, -2, 2, 8, 12, -19,
- -12, 8, 0, -3, -1, -1, 4, -14, 9, -1, -12, -1, -7, 10, -3, 5 },
- { 18, 12, -7, 7, 0, -3, -13, 0, -1, -4, 9, -2, 6, -1, 0, 1,
- 15, -21, 1, -8, 25, -19, 13, -9, 2, 12, 5, -7, -3, -1, -3, 1 },
- { 13, 16, -4, 9, -2, 2, -1, -19, -7, -4, 18, -6, 14, 18, -5, 4,
- -6, -3, -19, -14, -1, -12, 10, 6, 7, 17, -12, -13, -10, -4, 5, 4 },
- { 27, 17, 4, 14, -9, -2, -4, -8, 0, -6, 14, -11, -7, 2, -3, -3,
- -2, -3, -13, 12, 16, 1, -5, -9, -10, -11, -2, 3, -7, 5, 11, -7 },
- { 7, 17, -16, -2, -14, -28, -7, -8, 15, -10, 7, 15, 8, 17, 13, -1,
- 4, -7, -12, -11, 0, 0, 2, 3, -3, 7, -6, 6, 1, -16, 1, -2 },
- { 23, 11, -9, 15, -23, -4, -6, -4, 2, -9, -7, 9, -8, 3, -13, -4,
- 8, 18, -6, -2, 1, -5, 6, -14, -5, -2, -6, -5, -3, -2, 4, -5 },
- { 12, 13, 18, 18, -35, 2, 7, -17, 3, -11, 6, 9, -3, -2, 10, -4,
- 3, 3, -2, -7, 0, 2, -4, 0, -4, 0, -6, 5, 10, 4, -3, -1 },
- { 19, 11, 1, 20, -14, 4, -9, -13, -2, 11, 0, 17, -1, -1, -1, -1,
- -5, -8, 0, 5, -1, -8, 5, -1, 3, 2, -12, 21, -2, -24, 5, 7 },
- { 15, 15, -15, 17, -14, -22, 3, -4, -11, -3, -7, 1, 18, 10, 1, 10,
- -6, -3, 8, 2, -7, 0, -2, 1, 1, 2, -9, -2, 1, 2, -3, 4 },
- { 45, 13, 8, 17, -5, 2, -16, 2, 8, -2, 8, -15, 4, 5, -1, 7,
- -6, -2, -6, 2, -3, 0, 0, -9, -1, 7, 2, 3, -3, -3, -1, 5 },
- { 1, 18, -8, 18, -12, -10, 3, 4, -22, -12, 20, 8, -3, 9, 2, 10,
- -10, -3, 9, 3, 6, -3, 10, -1, -3, 2, -2, 4, 2, 3, -3, -18 },
- { 9, 10, -5, 9, -35, -21, -18, -16, -1, -12, -6, -7, -15, -19, 12, 4,
- 4, 9, -7, 2, 14, 1, 4, 0, -1, 6, -7, 2, 1, 1, -4, 4 },
- { 31, 8, -17, 35, -8, 1, -5, -6, -7, -6, 10, -2, -3, 6, 9, 3,
- -6, -2, 3, 3, 5, -3, 0, 6, 0, 1, -5, -3, -2, -4, -1, 0 },
- { 18, 4, -8, 7, -8, -15, -1, -16, 12, 18, 3, 19, 2, 4, 8, 8,
- 0, -5, -8, -12, 10, -5, 0, 1, 0, 4, -3, 16, 11, 11, -2, -6 },
- { 27, 15, -17, -10, -23, -22, -1, -14, -4, -7, 20, -2, -7, 6, 15, -5,
- 32, 4, 9, -11, -3, -8, 11, -4, -1, -4, -8, -6, -4, -5, -2, -7 },
- { 22, 4, -7, 2, -15, -11, -17, -10, 2, 0, 15, 11, 7, 12, -8, 6,
- -10, -18, -6, -12, 7, 3, 22, 3, -7, 14, -5, -2, -13, -7, -1, -7 },
- { 18, 13, 9, 24, -4, -19, -9, -11, 13, 8, 2, 4, -1, 8, 14, 10,
- -12, 0, 0, 5, 10, 5, 4, -1, 5, 1, -1, 11, 2, -4, 0, -9 },
- { 15, 19, -5, 1, -4, -10, -8, -27, 6, 8, 5, 10, 4, 11, 5, -5,
- -11, 0, -11, -14, -4, -9, -8, -8, 6, -9, 4, -5, -1, 1, 5, -4 },
- { 18, 1, -13, 14, -14, 9, -15, -7, 12, 1, 13, -4, -20, 12, 10, 12,
- -12, 7, 1, -13, 10, -6, 5, -3, 4, 8, 10, -13, -3, -6, 9, -3 },
- { 19, -14, 5, -8, -6, 2, -5, 5, -3, -1, -28, 11, 18, -6, -4, -2,
- 11, 14, -43, -42, 9, 2, 20, -23, 6, 32, 0, 5, 0, 6, 9, 5 },
- { 8, 11, -14, -1, 7, 12, -7, 2, -16, 2, 10, -3, -1, -7, -7, -1,
- 1, -10, -60, -23, -18, 42, -13, 9, 18, -11, 0, 1, 0, 2, -5, 1 },
- { -5, -1, 2, 0, 3, -3, 3, -2, -6, 0, -3, -3, 7, 2, 0, -2,
- -2, 3, -34, -15, 37, 47, 10, 20, 9, 1, 3, -21, -25, -33, -14, 8 },
- { 5, 6, 2, -2, -2, -2, 6, 5, -5, 7, -3, 1, -5, -13, 9, 3,
- -17, -19, -2, -79, -12, -7, -8, -6, -2, -2, -1, -1, -7, -13, 6, -1 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -1,
- 0, 3, 4, -87, 6, -11, 16, -9, -1, 8, 0, 5, 0, 1, 2, 1 },
- { -5, 6, 2, -24, 5, -9, -7, 0, 7, 3, -3, 16, -14, -16, 0, 18,
- 15, -9, -14, -28, -17, 53, 14, -6, -28, -1, -3, -10, -7, -14, 19, -15 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -3, 0,
- -13, 0, -53, 3, -22, 63, 19, 16, 1, -11, 0, -3, 0, -3, 0, 1 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1,
- -1, -6, -43, -43, -2, 65, -13, -4, 9, 1, 1, 2, 1, 0, 0, 1 },
- { 0, 1, 0, 0, -1, 0, 1, 1, 0, 0, 1, 2, -1, -1, -3, -1,
- -23, 1, -61, -55, 3, -28, -6, -4, -4, 8, 2, 1, 1, -1, 0, 0 },
- { 0, 1, -1, 1, -1, 0, -1, 0, 1, -1, 0, 1, -1, 0, -9, -4,
- -48, -19, -52, -46, 11, -12, 5, -14, 0, -10, 0, 0, -1, -2, -1, 0 },
- { 0, -3, -1, -4, 2, -1, -7, 3, 1, 3, -1, 1, -3, 0, -7, 0,
- 3, -7, -61, -51, -4, -21, -16, -21, -11, 14, -7, 8, 3, -5, 1, 2 },
- { 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, -1, 9, -3,
- 56, -11, -6, -67, -1, 13, 0, 7, 1, -9, -1, -1, 0, 0, 1, 0 },
- { 14, 9, -2, 14, -10, -10, 9, -5, 1, -8, -23, 30, 8, -7, 23, 8,
- 2, 10, -1, -27, -17, 57, 22, 4, -5, 2, -12, -6, 2, -7, -4, -9 },
- { 1, 5, 12, -2, -2, -3, 2, -3, 6, 0, 4, -2, -8, -6, 0, 16,
- -15, 29, -55, -29, -24, 29, 3, 10, 6, 13, 10, -5, 21, 11, -14, 5 },
- { 4, 2, 26, -6, 10, 11, -23, -10, -27, -20, 3, -24, -11, -10, -13, 25,
- -10, 5, -9, -36, -7, 43, 3, -13, 6, 13, -2, 0, 1, 3, -3, -4 },
- { -1, 0, -1, 0, 0, 0, 0, -1, 1, 0, -1, 0, 0, 0, -1, 1,
- -12, 12, -26, -64, -15, 29, 37, -7, -3, -12, -5, 14, 8, -8, -10, -2 },
- { 19, -4, -11, -16, 8, 14, 5, 19, 3, 22, -11, -21, -1, -6, -11, 11,
- 10, -24, -23, -40, -8, 20, 17, 5, 13, -6, 3, 14, -20, -8, 3, 28 },
- { 2, -12, 10, -14, -18, 26, -22, 4, -2, 5, -21, 8, 3, 1, 19, 0,
- -12, 24, -14, -40, 15, 29, -15, 6, 15, 1, -19, 2, 4, 7, -12, -3 },
- { 0, 17, 13, 7, -5, -11, 2, -19, 3, 38, -21, -3, -6, -4, 7, 1,
- 1, -5, -40, -10, -2, 35, 8, 8, -10, -8, -9, 33, 4, 4, 0, -2 },
- { -2, -12, 7, 29, -24, 2, 16, -1, -7, 16, 10, -2, -2, -2, 13, -2,
- -37, 15, -22, -40, -11, 33, 10, -1, 8, 10, 6, 8, 9, 0, -12, 2 },
- { 15, -8, -9, -2, 7, -17, 7, 19, 14, 4, 12, 27, 11, 10, 4, 11,
- -15, 14, -13, -48, 5, 18, 0, -9, -36, -11, 2, 4, 5, 5, -15, -12 },
- { -12, 0, 3, 4, 7, -5, 5, -14, -24, -18, -6, -15, -8, -20, 1, -7,
- -33, -28, -40, -38, -18, -10, -5, 17, -12, 4, 3, -5, 5, -13, 4, -7 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1,
- -3, -9, -49, -60, -5, 45, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1,
- -3, -9, -49, -60, -5, 45, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0,
- 3, -2, 9, -29, -11, 55, 8, 32, -36, -13, -7, 37, 4, 11, 0, 3 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 4, -1, -39, -4, -30, 63, 28, -17, -6, 10, 7, -14, -9, 11, 9, 7 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1,
- 13, -2, -50, -32, 22, 51, 4, 7, 6, 11, -20, -13, 9, -5, 21, -4 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1,
- -3, -9, -49, -60, -5, 45, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1,
- -3, -9, -49, -60, -5, 45, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0,
- 3, -2, 9, -29, -11, 55, 8, 32, -36, -13, -7, 37, 4, 11, 0, 3 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 4, -1, -39, -4, -30, 63, 28, -17, -6, 10, 7, -14, -9, 11, 9, 7 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1,
- 13, -2, -50, -32, 22, 51, 4, 7, 6, 11, -20, -13, 9, -5, 21, -4 },
- { -8, 2, 1, 22, -31, -6, -25, -3, -3, 1, -15, -11, -2, -3, 4, -13,
- -9, 15, -18, 37, -7, -37, 12, -13, -11, -25, -10, -11, -22, 7, 16, 7 },
- { 14, 10, 4, -10, -1, -5, -7, -3, 16, 13, -5, -15, 5, 11, -1, 8,
- -27, 7, -12, 49, 17, -22, 9, -2, -9, -1, 2, -15, -1, 41, -18, -17 },
- { -4, -9, -15, -3, 3, 4, 4, 2, 7, -3, -7, -8, -5, 17, -19, -7,
- 36, -9, -38, 17, 1, -48, 11, -18, -13, -2, -8, 4, -10, -5, 21, 11 },
- { 15, -13, 4, 2, 1, -5, -2, 1, -10, 7, -1, 3, -6, 0, 11, -11,
- 8, 20, -17, 51, -17, -41, 2, 15, 4, 8, -2, 16, -32, -1, 17, 6 },
- { -8, 8, -18, -5, 4, 6, -3, 8, 0, -4, 2, 0, -1, -4, 5, 8,
- 30, 30, -8, 70, 2, 8, 2, 0, 7, 1, 13, -1, -6, -7, -11, 2 },
- { -8, -7, 9, -10, -13, 6, -11, -14, 13, 25, -26, 5, 2, -5, -5, 5,
- -8, 4, 0, 33, 12, -38, -4, 6, 13, 6, 25, 34, -1, 25, -19, -5 },
- { 18, 3, -17, 4, -8, 7, 20, 1, -1, 5, -5, -2, -8, 8, -35, 15,
- 24, 43, -5, 51, 5, -12, -3, 1, -2, 3, -3, -3, -9, 8, -9, 2 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
- 2, 10, 24, 76, -2, -22, 11, -1, 4, 33, 4, 1, -1, 1, 2, 0 },
- { 0, -1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 2, 0,
- 24, 13, 32, 70, 26, 5, -21, -9, -6, -15, 2, -2, 2, 4, 1, 1 },
- { 5, -4, -11, 4, -4, 22, 10, -2, 13, -11, -4, -21, -17, 0, -7, 4,
- 10, -34, 11, 52, 2, -46, -5, 0, 0, -1, 2, 4, -9, 1, 1, -7 },
- { 0, 1, 1, 0, -1, 0, 1, 0, 1, 1, 0, 1, 0, 0, -3, 1,
- -8, 9, -1, 64, -13, -61, -3, 3, -5, 10, 1, 3, -1, -1, -1, -1 },
- { 0, 1, 0, -1, 0, -1, 0, 0, 1, 0, 0, 0, 1, 1, 2, 1,
- 10, -2, -31, 79, -10, 27, 0, -1, 3, 8, 1, 1, 0, -1, 0, -1 },
- { 3, 12, 10, 26, -19, 10, -9, 6, -4, -15, 10, 3, -16, 6, 11, -19,
- 3, 10, 18, 44, 5, -30, 5, -9, 21, 4, 20, 10, 14, -25, 8, -17 },
- { 0, 0, 0, 1, -1, 0, -1, 0, 1, 0, 1, 1, 0, 0, -6, -2,
- 8, -8, 13, 69, 26, -19, -25, -17, 16, 6, -12, 22, 2, -6, 9, 5 },
- { 0, -1, 0, 1, 0, -1, -1, 0, 0, 1, -2, 1, 0, 0, -4, -1,
- -34, -15, -33, 56, 9, -42, 9, 10, 6, 9, -8, -11, 0, -6, 15, 5 },
- { 10, 2, -14, -3, -15, -35, -1, 7, -18, 14, 8, -1, -15, -26, 6, -15,
- -18, 22, 9, 33, 0, -32, -9, 3, -11, 7, 4, -1, 5, 30, 9, 1 },
- { 4, 15, 0, 6, -5, -11, 9, 6, 6, 6, 14, 2, -1, 10, -24, -25,
- -2, -4, -1, 37, 2, -29, 14, -9, 22, 17, -2, 33, 10, -25, 11, -11 },
- { 0, 5, 2, 18, -12, 21, 22, 33, -7, 21, -9, -7, 7, -15, -7, 16,
- 7, 0, -14, 44, 10, -25, 5, -4, 15, -8, 10, -4, 5, 9, -1, 16 },
- { 3, 13, 12, 12, 8, 25, -23, 8, -22, -3, -18, -8, 15, 12, 9, 19,
- 0, 0, -9, 49, -27, -15, -9, -15, 12, -8, -16, -7, 13, 5, 13, 2 },
- { 12, -6, 7, -2, 20, -9, -14, 12, 13, -5, -17, 22, -8, -4, 2, 7,
- -13, -2, -15, 43, -5, -30, 27, 4, 10, -27, 5, 27, -10, -10, -18, 0 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
- -1, 10, -18, 70, -2, -52, -1, -7, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
- -1, 10, -18, 70, -2, -52, -1, -7, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 15, -13, -20, 16, 2, 13, 5, -11, -8, -5, -3, 2, 24, -23, 30, -7,
- 11, 30, -15, 43, 5, -15, 15, -3, -14, 1, -23, 8, 3, 9, 4, -11 },
- { 0, -1, 0, 1, 0, -1, -1, 0, 0, 1, -2, 1, 0, 0, -4, -1,
- -34, -15, -33, 56, 9, -42, 9, 10, 6, 9, -8, -11, 0, -6, 15, 5 },
- { 10, 2, -14, -3, -15, -35, -1, 7, -18, 14, 8, -1, -15, -26, 6, -15,
- -18, 22, 9, 33, 0, -32, -9, 3, -11, 7, 4, -1, 5, 30, 9, 1 },
- { 4, 15, 0, 6, -5, -11, 9, 6, 6, 6, 14, 2, -1, 10, -24, -25,
- -2, -4, -1, 37, 2, -29, 14, -9, 22, 17, -2, 33, 10, -25, 11, -11 },
- { 0, 5, 2, 18, -12, 21, 22, 33, -7, 21, -9, -7, 7, -15, -7, 16,
- 7, 0, -14, 44, 10, -25, 5, -4, 15, -8, 10, -4, 5, 9, -1, 16 },
- { 3, 13, 12, 12, 8, 25, -23, 8, -22, -3, -18, -8, 15, 12, 9, 19,
- 0, 0, -9, 49, -27, -15, -9, -15, 12, -8, -16, -7, 13, 5, 13, 2 },
- { 12, -6, 7, -2, 20, -9, -14, 12, 13, -5, -17, 22, -8, -4, 2, 7,
- -13, -2, -15, 43, -5, -30, 27, 4, 10, -27, 5, 27, -10, -10, -18, 0 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
- -1, 10, -18, 70, -2, -52, -1, -7, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
- -1, 10, -18, 70, -2, -52, -1, -7, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 15, -13, -20, 16, 2, 13, 5, -11, -8, -5, -3, 2, 24, -23, 30, -7,
- 11, 30, -15, 43, 5, -15, 15, -3, -14, 1, -23, 8, 3, 9, 4, -11 },
- { 16, -18, 7, -4, 31, -15, -9, -13, 20, -12, -6, 0, 12, -6, -2, 4,
- 3, -3, -1, 0, 1, 3, 3, -2, 1, 6, 4, 0, -3, 2, -5, 1 },
- { 38, -5, -13, -4, 8, -15, 11, 1, 2, -4, -1, 9, 13, 4, -12, -7,
- 0, -2, 7, 2, -6, -2, -3, -2, 3, -4, 6, 15, 1, 1, -11, -2 },
- { 47, -22, 9, -26, 3, -5, 2, -7, 4, -2, 2, -2, 3, 0, 3, -4,
- 3, -3, 2, -3, 7, -3, -1, 1, 1, -5, 5, 0, 2, -5, -3, -2 },
- { 14, -16, 2, -6, 7, -2, -7, -4, -4, -7, 14, -3, 7, -19, -14, -17,
- -29, 6, 26, 16, -5, 13, -4, -1, 21, 14, 1, 3, -6, 0, -7, -1 },
- { 29, -11, 5, -3, 4, 11, 4, -10, 1, -22, -3, -10, 5, 4, 2, 8,
- -2, -7, -12, -12, -8, -3, -18, -2, -9, -5, -1, -3, 2, -14, -14, 7 },
- { 28, -12, 5, 3, 9, -7, 0, -2, 2, 1, 4, 0, -7, -3, -2, 4,
- 4, 14, 8, -1, -4, 14, -7, 17, -2, -2, -9, 2, 19, -7, 9, -8 },
- { 31, -18, -22, 8, 15, -5, -10, -15, 1, 10, 6, 7, 6, -8, 2, -1,
- 12, -3, 3, -1, 1, 5, -6, -4, 0, 1, 7, -10, -2, 4, -3, -4 },
- { 53, -30, -4, 12, 2, 3, -3, -3, 0, 1, 6, 5, -5, -4, -7, 1,
- 0, 2, 1, 3, 1, 5, 0, 2, 2, -1, 0, 4, 2, 0, -2, 0 },
- { 27, -18, -3, -2, 4, -8, 3, -2, -11, 2, 10, -8, -8, -4, 0, -2,
- 8, 0, 9, 0, -16, 11, 1, -6, 13, -3, -10, -13, -15, 25, 1, 0 },
- { 35, -5, -1, -8, 23, 11, -14, -3, 2, -2, 8, -6, 17, -2, 7, 0,
- -2, 10, -17, 13, -2, -2, 11, 11, -14, 2, -2, -3, -8, -1, -12, -5 },
- { 29, -9, 7, 3, 2, -10, 0, 3, 9, 0, -3, 5, 1, -10, 10, -5,
- 3, 6, -20, -9, -6, -4, 1, 0, 12, 17, -8, 9, 3, -1, -9, 0 },
- { 15, -16, 18, -19, 16, -15, 17, -18, 13, -16, 17, -14, 15, -9, 13, -17,
- 9, -7, 4, -5, 3, -4, -3, 0, -6, 7, -9, 7, -2, 7, -9, 9 },
- { 21, -10, 7, -2, 12, -7, 13, -17, 11, -2, 20, 3, 5, -11, -6, -6,
- -15, 0, -9, 5, -11, 7, -1, 7, 8, -10, -9, 3, -5, 9, -8, -2 },
- { 23, -22, 15, -5, 16, -4, -3, -12, 9, 3, -1, -2, -8, 2, -2, -16,
- 3, 4, -2, -6, -7, 12, -8, 2, -14, 2, -7, 11, -2, 6, -4, -1 },
- { 34, -17, -4, 8, 4, -6, 1, 8, 4, 16, 3, 6, 12, -1, -1, -15,
- 6, 4, -7, -6, 6, 0, 2, 1, -2, 2, 3, 3, -3, -2, 8, -6 },
- { 18, -18, 2, -2, 10, 1, 18, -23, -3, -10, 0, 4, 20, -19, -3, -4,
- 2, 8, 6, 1, -3, 1, 1, 3, 5, -1, -11, 3, -7, 5, -1, 1 },
- { 15, -14, 2, 3, 10, -8, 12, -13, 13, -15, 6, -8, -4, -10, 14, -9,
- 24, 2, -7, -18, 13, -11, 8, 14, -6, -2, 3, -1, -4, 7, -7, -4 },
- { 20, -12, 13, 5, -1, -10, 15, -6, 8, -1, -3, -10, 17, 0, -6, -19,
- 2, -1, 8, -3, -16, 0, -3, 2, -2, 0, 8, -9, 0, 1, -10, -9 },
- { 32, 0, -9, -5, -1, 5, 13, -11, 8, 3, 11, -11, 0, -8, -2, -14,
- 7, 10, 6, -5, 1, 10, 2, 12, -10, 4, 4, 6, 4, 0, -7, -10 },
- { 16, -14, 10, -7, 11, -11, 11, -11, 18, -13, 8, -15, 16, -11, 13, -9,
- 8, -7, 12, -11, 7, -6, 3, -5, 9, -5, 4, -1, 7, -4, 8, -3 },
- { 24, -27, -1, 5, 8, -5, 12, 7, 4, -3, 3, -1, -9, -11, -13, -5,
- 10, 0, -13, 7, 1, -5, 4, -9, 7, -3, 13, 2, -5, -3, -17, -2 },
- { 23, -19, 15, 1, -10, -18, -12, -6, 8, -3, 12, 0, -12, -10, -4, -4,
- 8, -10, 4, 2, -2, -8, 13, -3, -2, -6, 2, -3, 5, -2, 2, 11 },
- { 25, -12, 4, 2, 24, -3, 3, -6, 14, 11, 0, -21, -3, -3, 1, -8,
- 7, 0, 0, 3, 3, -6, -7, 6, 2, 1, -4, 5, -1, 10, -2, 9 },
- { 24, -8, -6, 7, 16, -12, 13, -1, 11, -21, 2, -6, 3, -12, 0, 9,
- 4, 11, -7, 1, 4, 1, -8, 3, 3, -6, 3, 3, 0, -8, 8, 4 },
- { 25, -21, 13, 14, 13, -18, 4, -3, 0, -5, -4, 5, -3, 0, 4, 12,
- 7, 3, 5, -5, 2, -2, 3, -10, 2, -9, -15, 6, 1, 7, -5, 1 },
- { 23, -16, -2, 10, 4, -1, 3, 1, 32, 3, -5, -2, 9, 10, -1, -4,
- -6, 2, 9, -1, 14, 12, -6, -1, -17, -2, -4, -9, -7, -6, -8, 3 },
- { 50, -8, 5, 2, -11, 10, 0, 0, 6, -3, 7, 0, -3, -2, -3, 0,
- 6, -4, 2, -5, -9, 0, 3, 10, 1, -7, -2, -3, -6, -9, 1, -2 },
- { 28, -17, 0, -2, 2, -9, 1, 5, -4, -1, 0, 0, 19, -27, 5, -12,
- 7, -14, -3, -6, 10, -2, -4, -2, 4, -5, -2, -7, 1, 7, -9, 4 },
- { 22, -19, -6, -6, 3, -22, 3, 5, 20, -8, -14, -5, 1, 1, 20, 2,
- 16, 6, 3, 14, 4, 3, 5, 1, 5, -7, -10, -6, 3, -6, 1, -14 },
- { 29, -14, -8, 13, 8, -10, -6, 4, 4, -6, 5, -7, 1, 12, 14, 11,
- -7, 1, 2, -9, -11, -9, 0, 4, -1, 7, 10, 4, 4, 20, -1, -11 },
- { 18, -9, 4, 1, 7, -29, 12, 1, -1, -9, -2, -1, -2, 2, 9, -8,
- -13, 5, 4, -13, -4, 2, -5, -7, -6, 14, -10, -34, -3, 1, -3, -13 },
- { 38, -9, 24, 8, 11, 4, -6, -11, -2, -12, 1, 1, -11, -8, -5, -2,
- -15, -8, 8, 0, 1, -7, 5, 4, -1, 8, -2, 11, -3, -1, -5, -5 },
- { -20, 11, -4, 24, -11, 1, 15, 4, 0, -28, -10, -1, 10, 10, -6, 5,
- -6, 2, 7, -2, 1, -2, -6, -3, -7, 1, 2, 12, -1, 7, 0, -2 },
- { -9, 10, -23, 27, -4, -17, 20, -6, 14, -17, 5, -1, 5, -9, -7, 5,
- -6, 4, -2, 9, 0, 8, 0, 1, -3, -3, -5, -8, 5, -2, -2, 12 },
- { -10, 19, 4, 9, 1, -16, 17, -2, 9, -29, -16, -11, -4, 7, -5, 4,
- -1, -3, 3, 2, 3, -4, 5, -12, -2, 6, 5, -4, 4, 1, 4, 10 },
- { -20, 10, -24, 14, -5, 11, 9, 0, 16, -20, 10, -5, -6, -6, -1, 2,
- -4, 5, -16, 8, -2, 5, 5, -11, 9, -11, 4, -11, -1, -1, 4, 3 },
- { -9, 11, 3, 19, 24, 4, 5, -14, 30, -17, -4, -2, -17, 7, 2, 3,
- 1, 3, -7, -4, 2, -3, 1, 4, -1, -1, 3, -12, -2, 3, -3, 10 },
- { -19, 18, 11, 19, 19, 19, 10, 4, 13, 6, 5, 4, 8, 3, -2, 12,
- -6, -2, 7, -6, 15, 12, 16, 16, 18, -3, -4, -20, 0, 10, -9, -3 },
- { -21, 9, 20, 12, 0, -3, 5, -9, 15, -13, 5, -5, -6, 24, 2, 9,
- -5, 2, -7, 2, 5, 7, -5, 2, 15, 3, 1, -1, -4, -2, 7, 0 },
- { -18, 16, 13, 15, 2, -10, 14, -11, 4, -11, 5, 12, 12, 20, 8, 30,
- 2, 11, -9, 7, 0, -3, -16, -5, -6, 5, -4, -21, 0, 5, 6, 1 },
- { -26, 8, -13, 9, 6, -10, 2, -11, 7, -4, 6, -19, -11, -6, -12, 16,
- 0, 5, -7, 8, 5, 6, 17, -9, 10, -10, 5, -3, -11, 2, 4, 10 },
- { -11, 17, -3, 22, -5, 18, 3, 1, 4, -5, 14, -27, 5, -7, -4, -5,
- -10, 11, 1, 15, 1, 1, -6, -5, 10, -22, -7, -7, -15, 13, -4, 5 },
- { -17, 14, -7, 13, 3, 0, 13, -6, 9, -14, -22, -1, 1, 19, 14, -3,
- 4, -13, -13, 2, -4, 8, -2, -2, 13, -12, 13, -12, -7, -5, -3, 6 },
- { -17, 17, -1, 33, 6, 3, 9, -16, 3, -14, -8, 6, -17, 8, 3, 13,
- 8, -6, 3, 1, -2, 0, -2, 8, 4, 9, 13, -10, 4, -17, 0, -6 },
- { -20, 7, 7, 21, 1, -3, 7, -3, -2, -12, 9, -7, 2, -3, 14, 1,
- -1, -7, 12, -10, 5, -20, 11, -2, 0, -24, -17, 6, 6, -4, 3, -1 },
- { -8, 10, 6, 7, -1, -6, 28, -6, 10, -33, 1, -20, 0, -12, 10, 1,
- -6, 8, -3, -1, -10, 8, 5, 0, 10, -2, 8, 16, -5, -3, -7, 4 },
- { -17, 13, 3, 15, 1, -5, 27, -5, 6, -6, 12, 2, -4, 8, -1, -3,
- -2, 12, -15, 3, 4, 1, 2, -9, 0, -16, -21, 2, -4, 16, -7, 4 },
- { -15, 20, 8, 17, 5, -14, 15, -11, 21, -11, 13, -13, 2, -15, -13, 1,
- -5, 5, 2, 10, -9, 4, -1, 3, 2, -4, 13, -5, 1, -4, 5, -3 },
- { -21, 8, 2, 16, -1, 2, 15, -16, 13, -12, -12, -7, -8, 2, -7, 11,
- -8, 5, 2, -7, 16, -4, 1, -7, 3, -15, 6, -5, -8, 2, -8, 5 },
- { -15, 17, -6, 3, -3, 3, 9, -7, 14, -23, 11, 1, -1, 4, 7, 6,
- -1, -14, 7, 6, -8, 5, 1, -15, 10, -9, 2, -3, -1, 4, -10, -4 },
- { -10, 18, 3, 11, 1, 4, 14, -14, 7, -4, 15, -10, 10, -11, 10, -4,
- 5, -14, 10, 4, 15, -12, 15, -13, 20, -15, 14, -15, 8, -11, 4, -6 },
- { -7, 23, 2, 20, 7, 8, 19, -5, 9, -16, -8, -17, -5, 1, 5, -6,
- -8, 1, -6, -4, 10, 6, 6, 2, -11, -4, 0, 2, 4, 7, 9, -4 },
- { -15, 20, -5, 22, 11, -8, 9, -5, 10, -13, -8, 8, 2, -2, -3, 7,
- 6, 10, 1, 2, -5, -9, 1, 10, 16, -22, -7, 0, 7, 7, 6, 1 },
- { -26, 19, -5, 3, 5, 25, 18, -5, 9, -14, -8, -6, -2, -6, 2, 3,
- -8, -2, -7, 7, -3, 7, 3, 4, -8, 0, 1, -8, -4, -2, -2, 1 },
- { -20, 14, -10, 6, -3, 7, 8, -32, -2, -7, -2, -10, 16, -12, -9, 15,
- -2, -5, -6, 2, -7, 5, 9, 1, 6, -7, -1, 0, -2, -4, -7, 3 },
- { -14, 16, 4, 11, -8, 1, 23, -4, 17, -13, -10, 1, 12, 9, 12, -4,
- 7, -1, -1, 5, -8, -6, 3, 3, -6, -3, -18, 0, 18, 20, 4, -2 },
- { -33, 19, -10, 30, 15, 2, -3, -1, -4, -14, 7, -7, -1, 7, -8, 9,
- -1, -3, -5, 2, 2, 4, 0, 5, 0, 0, 2, 3, 3, -3, -3, 4 },
- { -6, 20, 0, 5, 17, -10, 18, -17, 9, -16, 4, -13, -6, 2, -14, 14,
- -28, 9, -12, 25, -4, 7, 7, -8, 6, -6, -2, -10, 2, -11, -1, 2 },
- { -12, 14, 12, 52, -3, 5, -5, 4, 8, -13, 2, -5, -4, 2, -2, -1,
- -2, 3, 3, 5, 2, 3, 0, 1, -5, 2, -4, -3, 1, -5, -2, 0 },
- { -13, 6, 9, 24, 0, 8, 14, -15, 18, -9, -11, -8, 3, 15, -2, -4,
- -9, 4, -3, 12, 14, -13, 11, -4, 2, -4, 0, -6, -6, -6, -14, -1 },
- { -10, 28, 3, 12, 9, 3, 11, -28, 6, -11, -7, 4, 0, 7, 8, -9,
- 0, -6, 0, -16, 4, 7, 4, 4, 7, 3, 4, -7, 0, -3, -10, 6 },
- { -11, 14, -2, 19, -1, -1, 7, 9, -2, -27, 10, -14, 15, -4, 12, -4,
- 2, -2, -6, 12, -6, 0, -5, -4, -5, 1, 3, -11, 5, -9, 3, -8 },
- { -18, 7, 13, 16, -4, 3, 9, -10, 10, -10, -3, -22, -4, -12, 3, -16,
- 0, -3, -16, 8, -11, 1, 10, -7, 15, 3, 0, -1, -13, 8, 1, 6 },
- { -20, 10, -10, 10, 8, -1, 6, 0, 16, -12, 9, -10, -1, -5, -4, -13,
- 13, 16, -8, 12, -2, 14, 18, 13, 0, -16, 2, -5, -5, -5, -4, 3 },
- { -14, 5, -7, -17, 5, -13, 23, 20, -4, -1, 1, -6, 13, 5, -1, 4,
- -14, -2, -7, 8, 3, 2, 2, -7, 2, -1, 4, 7, 3, -9, -1, -5 },
- { -19, 3, -24, -28, -9, -7, 19, 3, 2, 19, 7, 5, -13, 8, -15, -17,
- 3, -11, 4, 13, 3, 2, -1, -3, -4, -4, 2, 0, -5, -6, 6, 2 },
- { -17, 18, -30, -20, -2, -3, 1, 15, -1, -11, 6, -4, 11, 11, -4, -5,
- -10, 0, 0, 1, 3, -7, 8, 2, 5, 1, 5, -5, 1, 6, 4, 1 },
- { -6, 1, -30, -25, -1, -8, -2, -9, -17, 16, 3, -1, -2, -9, -6, -7,
- -3, 12, 6, -4, -10, 0, 10, -8, -6, -5, -3, -11, -4, 0, -1, -3 },
- { -1, -1, -34, -28, 1, -10, 2, 9, 4, 16, 2, 6, 14, 17, 0, 7,
- -4, 4, 4, 4, 0, 1, -1, -5, 8, 1, -4, 1, -9, -2, 5, 6 },
- { -11, 14, 1, -31, -7, -24, 9, 7, 6, 5, -13, 1, -1, 3, 4, -1,
- -2, -8, -6, 3, 5, -4, -6, 7, -2, 5, 3, 3, 0, 0, -5, 2 },
- { -25, 8, -11, -18, 1, -4, 8, -3, -4, 15, 6, -5, 8, 2, 3, 4,
- -4, 5, 6, 8, -7, 6, 1, -11, -15, -13, 9, -4, -14, 10, 12, 7 },
- { -20, 11, -15, -25, 3, 4, 18, 13, -4, -5, -9, -1, -5, -2, -2, -7,
- 16, 5, -4, -5, -7, -2, -3, -9, 11, -2, 0, -7, -17, -6, -11, 6 },
- { -11, 18, -5, -20, -15, -3, 9, 11, -20, 12, 5, 5, 11, -3, 7, 1,
- 10, -6, -3, -3, 3, 3, 14, -7, 10, -17, 9, -11, -2, -6, 7, -12 },
- { -20, 8, -14, -17, -9, -13, -3, 0, -27, -14, -3, -14, 4, 3, 6, -6,
- 7, 4, 23, 9, 11, 9, 3, -4, 9, 2, 4, -1, -6, 1, -8, -11 },
- { -9, 14, 2, -37, -7, 13, 6, -11, -6, 9, 18, -11, -6, 2, 12, 4,
- -1, 3, 1, -2, -2, 1, -9, -4, -2, -3, 3, 5, -6, 0, -2, -8 },
- { -29, 8, -1, -13, -2, 8, 23, 2, -10, 7, 13, -6, -5, 11, 13, 0,
- -10, -13, 11, -12, -10, 6, 4, 6, 4, 3, 6, -5, -9, -2, -1, 3 },
- { -18, 6, -10, -55, -4, -11, -2, 0, 1, -3, -9, -6, 3, -2, -1, 6,
- 3, -1, 3, 1, -4, -7, -2, 6, 3, -2, -1, -3, -2, 0, 4, 1 },
- { -14, 5, 3, -21, -8, -16, -4, -2, -11, 27, 15, -20, 3, 0, 1, 1,
- 2, -5, -5, 4, 1, -9, 5, -3, 3, 0, -4, -2, -11, -4, -3, 7 },
- { -17, -1, -9, -17, -8, -18, 12, -13, -9, 13, -3, 3, 3, -3, 1, -2,
- 0, 16, -9, 6, 12, 9, 5, 11, 2, -15, 1, -4, -16, 7, -4, -12 },
- { -18, 8, -6, -11, -8, -7, 13, 7, 1, 6, 8, -1, 21, -4, 14, 15,
- 18, -4, -3, 15, 0, 9, 4, 7, 3, -1, 9, -2, 0, 7, -8, 2 },
- { -10, 7, -18, -29, 3, 12, 12, 9, 11, 4, -1, -15, 1, -1, 8, -2,
- -2, 10, -15, -1, 0, 6, 12, -6, -1, 10, -6, -3, -11, -4, 9, -6 },
- { -14, 14, -9, -21, -12, -2, -1, -7, -5, -10, 5, -8, 0, 6, 9, -11,
- 11, -3, -5, 3, 8, 15, -2, -4, -22, 4, -6, 12, 2, 13, 6, -7 },
- { -12, 11, -5, -29, -25, 4, 12, -13, -11, -7, 4, 2, 2, -5, 5, 8,
- 7, -5, -5, 6, 3, -10, 1, -6, 6, -6, -5, -1, -2, -4, 7, 6 },
- { -15, 11, -5, -16, 0, -13, 26, -23, -6, -3, 5, -2, -2, 21, -6, -3,
- -5, -1, 6, -1, 0, -13, 2, -3, -9, -1, -4, -3, 5, -4, 12, -16 },
- { -9, 9, -1, -17, -3, -6, 12, 6, -18, -2, 11, -14, -6, 3, 14, -12,
- -11, -5, 14, 2, 5, -8, -4, -11, 2, -5, 16, 6, -7, -4, 8, 13 },
- { -13, 5, 3, -28, -14, 0, 6, 23, 5, 4, -1, -17, 1, -3, 0, 0,
- 5, 4, 0, -18, 14, 10, 4, 2, 5, -2, 4, -3, 2, 0, 2, 0 },
- { -15, 4, -13, -16, -3, -12, -2, 2, 7, 10, 9, 3, 11, 4, 23, 14,
- 9, 16, 4, 1, -12, -3, 4, -7, -15, -7, -10, -14, -6, -8, -1, -6 },
- { -7, 10, -5, -10, -3, -13, 16, -1, -12, 7, -3, -12, 2, 13, 13, 2,
- 17, 15, -13, 1, -5, -2, 3, -1, 1, -3, 6, -3, -12, -16, 7, -7 },
- { -11, -5, -12, -30, -6, -22, 1, 4, -6, -3, 12, 6, 7, 0, 16, 6,
- -2, 0, -22, -2, -9, 2, -13, 8, 6, -8, 4, -7, -1, -6, 4, 6 },
- { -14, 5, 1, -27, -4, 2, 1, 14, -11, -7, -8, -4, 1, 8, 0, -6,
- -13, 11, -12, -7, -5, 1, 10, 7, 3, -2, 0, 6, -8, 2, 10, -1 },
- { -10, 10, -25, -13, -20, -4, 19, 3, 13, 5, 5, 7, -8, 2, 4, 2,
- 3, -1, -1, -9, 14, 10, 9, 14, 3, 3, -6, 0, -5, 4, 1, -1 },
- { -9, 15, -18, -17, 4, -11, 6, 7, -12, 8, -1, -11, 2, 3, 7, 16,
- -3, -9, 7, -12, 23, 0, 6, 7, -14, -9, 8, 1, -2, 6, -2, -1 },
- { -6, 9, -16, -26, -14, -11, 9, -6, 5, -2, 13, 17, 21, 7, 18, -19,
- 6, -23, -2, -15, -2, 2, -10, -8, 2, 1, -2, 4, -3, -4, -5, -4 },
- { 0, 6, -5, -28, -17, -32, 2, -10, 11, 3, -5, 9, 10, 3, 11, 11,
- -3, 12, -2, 2, 4, -6, 9, -4, -4, -4, -4, -9, 2, 0, 2, 4 },
- { 0, -8, -18, -34, -9, -7, -4, -11, 10, 15, 11, -1, -8, 15, 6, -13,
- 9, 2, -4, -12, 0, -1, 19, 12, 6, 5, 0, -3, -10, -12, 3, -5 },
- { -10, 6, -9, -17, -12, -11, 9, -6, 11, 11, 18, -7, 0, 16, 4, 2,
- -6, 3, -12, -1, 0, 1, -5, -22, -2, -12, 0, 6, 17, 5, 5, 6 },
- { 12, -5, 7, 1, -5, -2, -1, 2, 2, -4, -3, -3, -3, -2, -29, 11,
- 5, -13, -73, 24, 12, 4, -14, -10, 5, 1, 0, -11, -7, -7, 7, 3 },
- { 10, -3, -1, -3, 4, -11, -5, -2, -8, 7, 9, 2, -8, -6, 6, 7,
- 21, 17, -54, 47, -14, -10, 14, 19, 13, 21, -4, 3, 1, 2, -4, 2 },
- { -12, 4, -16, -12, 5, -9, -4, 19, -7, -22, -22, -17, 3, 0, -6, 8,
- 23, -4, -55, -28, 2, -26, 2, 1, 4, 0, -13, 6, 0, 10, -7, -11 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -1,
- 35, -1, -67, -35, -24, -24, -6, 2, 2, -2, 1, 3, 2, 0, -1, 1 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 5, 0,
- 41, -4, -73, -15, 18, 4, 17, 8, -1, -16, -1, -2, 1, 0, 0, 0 },
- { -4, -4, 4, 6, -1, 2, -16, -10, -15, -10, 21, -2, -6, -2, 14, -7,
- 10, -5, -55, 34, -12, 11, -13, -2, 2, 28, -26, 0, 7, 4, 21, -7 },
- { 2, 1, 15, -22, 10, -3, 14, -6, -2, 15, -2, -7, 20, 6, -15, -7,
- 23, 10, -60, 8, -4, 29, -22, 2, -13, 9, -10, 12, -1, -3, 4, 7 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, -1, -2, 11, -5,
- -21, -11, -60, -27, -17, -39, 6, 36, 0, -8, 2, 2, 0, 0, -2, 3 },
- { 2, -5, 9, -17, -1, 2, -3, -6, 8, 12, 7, -6, -33, -11, -14, -40,
- 10, 36, -46, 0, -19, 5, 0, -10, 3, 12, -6, -8, 6, -12, -7, 1 },
- { 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, -1, 0, 1, 0, -2, 0,
- 4, -2, -87, -3, -2, 2, -2, 20, 2, 6, -1, 6, 0, 0, 2, -1 },
- { 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, 1,
- 1, 7, -76, 41, -7, -24, 0, -6, 3, 6, 0, -2, -1, 1, 0, 0 },
- { 0, -3, 4, 2, 3, 2, 2, 0, 3, -1, 4, 0, -1, 4, -2, -4,
- -32, -11, -64, -29, -9, -43, 2, -11, -1, -7, 0, -4, -2, -2, -2, 2 },
- { 10, -20, 3, -3, 13, 13, 0, -4, 2, 7, -8, 7, -2, 2, -20, -20,
- -19, 3, -47, -18, -16, -6, -15, -42, -17, 14, -6, 8, 12, -10, 11, -12 },
- { -3, -2, -2, -1, -1, 4, -3, -1, -6, -2, 3, 2, -3, 6, -1, -9,
- 10, 13, -68, -9, 26, 3, 5, 3, -21, 10, -15, 21, -22, 19, 11, -14 },
- { 1, 5, 18, -19, -29, -13, -2, 18, -10, 20, 2, 10, -10, 11, 1, 8,
- -16, -17, -41, 10, -14, -25, 0, -14, -19, 17, 7, -12, 14, -11, 14, 5 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -1, -43, 5,
- 6, -12, -48, 19, 8, -38, -8, -3, 22, -21, -10, 15, 20, -9, -5, 8 },
- { 0, 0, 0, 0, -1, 1, -1, 0, 0, 0, 0, 0, 0, 0, 6, -3,
- 22, -14, -71, -24, -2, -33, 23, 7, -8, 7, -3, 2, -4, 1, -8, -2 },
- { 1, 0, -1, 2, 0, -2, 0, 0, -1, 0, 4, 0, 26, -1, 10, -11,
- -17, -32, -58, 14, -14, -11, -2, 15, 2, -8, 12, 10, -9, 13, -33, -14 },
- { 15, -17, -19, 7, -8, -15, -32, -22, 7, 12, 18, 0, 0, -15, -4, 16,
- 37, -2, -46, 11, 2, -8, -10, -8, 14, 9, -4, 5, 7, -17, 4, 3 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0,
- -5, 3, -85, 23, -9, -17, -2, -2, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0,
- -5, 3, -85, 23, -9, -17, -2, -2, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, 1,
- 1, 7, -76, 41, -7, -24, 0, -6, 3, 6, 0, -2, -1, 1, 0, 0 },
- { 0, -3, 4, 2, 3, 2, 2, 0, 3, -1, 4, 0, -1, 4, -2, -4,
- -32, -11, -64, -29, -9, -43, 2, -11, -1, -7, 0, -4, -2, -2, -2, 2 },
- { 10, -20, 3, -3, 13, 13, 0, -4, 2, 7, -8, 7, -2, 2, -20, -20,
- -19, 3, -47, -18, -16, -6, -15, -42, -17, 14, -6, 8, 12, -10, 11, -12 },
- { -3, -2, -2, -1, -1, 4, -3, -1, -6, -2, 3, 2, -3, 6, -1, -9,
- 10, 13, -68, -9, 26, 3, 5, 3, -21, 10, -15, 21, -22, 19, 11, -14 },
- { 1, 5, 18, -19, -29, -13, -2, 18, -10, 20, 2, 10, -10, 11, 1, 8,
- -16, -17, -41, 10, -14, -25, 0, -14, -19, 17, 7, -12, 14, -11, 14, 5 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -1, -43, 5,
- 6, -12, -48, 19, 8, -38, -8, -3, 22, -21, -10, 15, 20, -9, -5, 8 },
- { 0, 0, 0, 0, -1, 1, -1, 0, 0, 0, 0, 0, 0, 0, 6, -3,
- 22, -14, -71, -24, -2, -33, 23, 7, -8, 7, -3, 2, -4, 1, -8, -2 },
- { 1, 0, -1, 2, 0, -2, 0, 0, -1, 0, 4, 0, 26, -1, 10, -11,
- -17, -32, -58, 14, -14, -11, -2, 15, 2, -8, 12, 10, -9, 13, -33, -14 },
- { 15, -17, -19, 7, -8, -15, -32, -22, 7, 12, 18, 0, 0, -15, -4, 16,
- 37, -2, -46, 11, 2, -8, -10, -8, 14, 9, -4, 5, 7, -17, 4, 3 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0,
- -5, 3, -85, 23, -9, -17, -2, -2, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0,
- -5, 3, -85, 23, -9, -17, -2, -2, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 16, 65, -2, -2, 4, 3, 0, -7, 3, 1, 3, 1, 0, 5, 1, -5,
- 0, 2, -1, 3, 0, 0, -1, -2, 6, 0, -2, 0, 0, -1, 1, 1 },
- { 5, 37, -4, 8, -4, -1, 9, 17, 6, -7, 5, -1, 11, 6, -4, 7,
- -2, 4, 1, -3, 11, 3, 3, -9, 6, 0, -2, -4, -5, 4, -12, -11 },
- { 15, 24, -14, 2, 6, 17, 26, 5, 8, 11, -9, -7, -6, -8, 3, -5,
- 9, 10, -3, 10, 0, 1, 4, -9, 4, 9, 3, 0, 4, 0, -5, 3 },
- { 9, 36, -9, -8, 7, 7, 4, 3, -1, -16, -2, 7, -5, -6, 6, 12,
- -11, -12, 9, -1, -3, -9, 12, 6, -6, 2, 2, 5, 0, 5, 6, -6 },
- { 25, 39, -5, 24, 3, 10, 3, -6, 13, -8, 3, -7, 2, -10, -5, 2,
- -2, 3, 5, -2, 1, 5, -2, 3, -4, 1, -5, -4, 0, 1, -2, 0 },
- { 16, 27, -1, 0, -14, 6, 4, -5, 7, -2, -6, 0, -3, -5, 2, -1,
- -1, -19, 5, -8, 0, 11, 12, 5, 0, 3, 10, 6, -14, 14, -13, -15 },
- { 12, 23, -14, 2, 1, 4, -3, 16, 7, -8, 2, -8, 8, 6, -8, -7,
- -3, 0, 2, 8, -13, 7, 13, -6, -4, 6, -13, -16, 14, 11, -7, 5 },
- { 16, 28, -7, -1, 6, -3, 9, 0, -7, 3, 0, 3, -12, 20, 8, 9,
- 8, 23, 8, -13, -2, 4, 9, 3, -5, 13, 5, -2, 12, 14, 5, -1 },
- { 19, 37, 19, 5, 7, 5, 10, 5, 19, 10, 14, 0, 2, 5, 1, -4,
- -4, 2, 2, -5, -2, -1, 2, -6, -4, -4, -5, -3, 2, -2, -2, -2 },
- { 24, 21, 1, -11, -10, 17, -14, 14, 6, -1, -6, -1, 0, -13, -1, -12,
- -2, -5, 6, -4, -12, 14, 5, -2, -8, -8, 15, -7, -30, -12, 4, 0 },
- { 11, 26, -3, 3, 5, -1, -2, 3, -2, 10, 15, -4, 10, -28, 10, -17,
- -8, 1, 2, -7, -1, -6, -15, -1, 4, 5, -7, 9, 0, -5, -4, 4 },
- { 18, 32, 1, 2, -7, 4, 15, 2, -9, -2, 12, -11, 7, 11, 13, 2,
- 0, 5, 9, -10, 16, 3, -3, 5, -9, -23, 2, -2, -1, 5, 2, 11 },
- { 35, 24, -20, 2, 4, -1, 5, 14, -10, -9, 8, -7, 0, 5, -7, -7,
- 11, 1, 5, 3, 2, 0, -2, 3, 0, 1, 4, 0, -2, -8, 0, -4 },
- { 9, 35, -1, 2, -1, -19, -3, 12, -1, 8, 8, -13, -1, -2, 2, 5,
- -8, -1, 13, -2, 11, 1, 0, -10, 0, -3, -7, 2, 1, -12, 3, 12 },
- { 20, 27, -12, -12, 7, 4, -1, -13, -1, -9, 2, 13, -11, 5, 7, -9,
- 9, 1, 1, 8, -9, 0, -6, 7, 4, 2, -2, 7, 3, -2, 1, -9 },
- { 8, 37, -20, -5, 0, -21, 10, -8, 3, 19, -9, 7, -3, -8, 10, -2,
- 0, 5, 6, -4, -2, -1, 0, -7, 6, 1, 0, 4, -5, 6, -8, 2 },
- { 8, 27, 1, -3, -5, 1, 6, 0, 15, 2, 17, -1, 3, -17, 10, 5,
- 5, -6, -6, 6, -10, 18, -5, 0, 0, 13, 7, 10, -5, -6, -2, -4 },
- { 14, 29, -20, -4, -3, 1, -5, -1, 2, 12, -10, -3, 4, -18, 4, 14,
- -4, -1, -9, 15, -2, 2, -5, -3, 2, 9, -2, -14, -3, 4, -4, -7 },
- { 23, 23, -23, -11, 27, 4, 4, -1, 7, 0, -5, 9, 2, -11, 3, 7,
- -2, -5, 2, -7, -7, 13, -3, -6, 2, 3, 3, -4, -1, -8, 5, -2 },
- { 16, 26, -6, 8, -9, -1, -2, -1, -8, 4, -2, 0, -12, 9, -1, 0,
- -17, -9, 30, -5, -15, -16, -13, 0, 10, -11, -7, -3, -1, 0, -11, -2 },
- { 12, 32, -4, -5, 10, 19, -10, 4, -12, 5, -6, 9, -12, -6, -6, -8,
- 4, 1, 3, 0, 8, 0, -3, -4, -7, -4, 10, 8, 6, 5, -1, 4 },
- { 46, 42, -3, -14, -2, -6, 6, -2, -5, -1, -3, -3, 1, -1, 3, 1,
- 1, 4, -1, 2, 3, 1, -2, 6, 0, -1, -2, 4, -2, -1, 2, 2 },
- { 9, 33, -13, 4, -11, 3, -8, 22, 12, -2, 4, 0, -16, 5, 4, -1,
- 7, -6, -9, 1, 7, 5, 0, -5, 5, -1, 10, 3, -2, -1, 3, -2 },
- { 9, 30, 6, -3, 6, 1, -7, 5, 11, 14, 7, 1, 0, 2, 2, -1,
- 8, 7, -6, -13, -10, -2, 1, -6, 10, 7, 6, 5, -2, -5, -1, -16 },
- { 9, 28, -11, -10, 9, -10, 15, 8, 4, 9, -4, -7, 0, -5, 9, 8,
- -7, 2, -15, -23, 4, -4, 4, 16, -8, -3, 0, -8, 14, 5, -3, 15 },
- { 17, 26, -5, -5, -1, -8, 20, 18, -7, -2, 4, -7, -8, -5, -4, 16,
- 0, 0, -7, -2, -13, -5, -2, 3, 12, 1, 3, -5, 2, 2, 0, -1 },
- { 11, 37, 7, -23, 6, -1, 15, 13, 4, -9, 7, 5, 3, -3, -5, -8,
- -2, 3, -5, -1, -8, 7, 2, 13, 1, 3, 0, -3, -1, 2, 0, -2 },
- { 21, 33, 7, 20, 21, -10, 6, -5, -5, -6, -9, 2, 10, 0, 8, -4,
- 10, 2, -2, -2, 0, -10, -6, -2, 0, -5, 3, -11, 3, -9, -3, 1 },
- { 6, 30, -15, -8, 16, 1, 4, 6, 4, 5, 8, -3, 8, -9, -1, -6,
- 8, 2, -2, 4, -2, 5, 11, -21, 3, -10, 16, -11, 24, 10, 14, -6 },
- { 15, 36, -3, -9, -20, 12, 0, -7, -18, -4, -8, -9, 9, -7, -3, -1,
- 2, 7, -5, -8, 6, 2, 2, -1, 7, 1, 1, -3, 3, -4, -8, 1 },
- { 16, 34, 21, 3, -9, 10, 7, 9, -7, 1, -4, -9, -4, -5, -5, 3,
- 3, -19, 1, 5, 4, -2, -6, -5, -10, -11, -8, -2, 2, -5, -8, -7 },
- { 28, 29, -3, 18, -2, 0, -6, 12, -2, 10, -11, -4, -13, -12, -6, -4,
- 0, 4, -1, -8, 6, 4, 12, 11, 10, 10, -3, -6, 1, 2, 1, 7 },
- { 3, 8, 22, -8, 3, 36, -8, -1, 9, 6, -13, -14, 8, -1, 1, 2,
- -2, -8, 0, 3, 1, 2, -1, 5, -1, -8, 0, -2, 2, 2, -1, 1 },
- { 0, 6, 0, 0, 4, 13, -7, -16, -6, 15, -14, -21, -9, -10, -10, -6,
- -21, 5, 4, 2, 12, 4, 12, 11, -4, -6, -6, -10, -7, -18, 1, 4 },
- { -1, 3, 10, 1, -1, 15, 4, -7, -16, 3, 0, -22, 10, 2, -3, -2,
- 13, 5, -8, 16, -5, 4, 0, -11, -10, -22, 0, -4, -17, 5, 2, 1 },
- { 12, 8, -4, -9, 14, 40, -21, 0, 1, -15, -10, -12, 12, 6, -10, 2,
- 8, 6, -12, -10, -11, 1, 0, -11, 2, 1, 13, 0, 6, 3, 8, 4 },
- { -10, 3, 5, -4, -3, 3, 0, -9, 2, 8, -22, -23, 17, 8, -17, -3,
- 14, -8, -4, 1, -8, 3, 0, 5, -1, -3, -2, -4, 1, -10, 0, -2 },
- { 0, -1, 5, -7, 4, 12, -2, 0, -7, 2, -16, -15, 12, 21, -7, -4,
- 7, -7, -11, -15, -7, -9, -5, -8, 0, -6, 8, -3, -8, 22, -7, -9 },
- { 7, 19, 4, -9, 24, 22, 2, -6, 8, 13, -14, -20, -4, 11, 8, -4,
- -1, 2, 0, -7, 5, -17, -3, 3, -6, 5, 3, 4, -5, -7, -3, 14 },
- { -2, 6, 2, 8, -2, 5, -4, -2, -10, 3, -45, -30, -3, -3, -12, -4,
- -3, -3, -1, 9, -6, -6, 5, -4, 0, 5, -1, -2, -1, 0, -6, -1 },
- { -3, 14, -16, -10, 10, 0, -2, -40, -9, 12, 2, -19, 15, -4, 4, 3,
- 3, -4, 7, 1, -4, -5, 0, 4, -1, 0, -9, -2, -4, -1, -2, 0 },
- { 7, 16, 2, -7, 8, 2, 0, 1, 5, 21, -10, -26, 7, 2, -9, -7,
- -3, -16, 8, 5, 5, -6, 10, 4, -14, -6, 5, 3, -2, -2, -4, 1 },
- { -9, 14, -1, 3, 3, 11, 1, -5, -3, 13, -16, -18, 20, 6, -5, 0,
- -3, 2, 8, 4, -19, -9, 12, 0, -8, 2, 2, 1, 6, 13, -7, -11 },
- { 2, 5, 16, -4, 19, 15, 4, 0, -11, 7, -10, -10, -16, 18, -11, -12,
- -9, -4, 7, -4, -4, -17, 1, 1, -8, -3, -3, 5, -2, -6, -11, -5 },
- { 2, 12, 0, -9, -10, 14, 6, 2, -3, 2, -12, -28, 12, 1, -1, 2,
- 0, -3, -4, 7, 16, 5, -7, 8, -4, -3, -1, 3, -12, 4, -17, -5 },
- { -4, 7, 11, 6, 1, 14, -4, -6, 5, 5, -6, -24, 23, -9, -15, 13,
- -7, -9, -15, 10, -1, 8, -5, 1, 12, 6, 2, 0, 4, -2, 9, -10 },
- { 1, 5, 11, 3, 6, 12, -3, 8, -21, 5, -7, -20, 12, -2, -9, -3,
- 17, -7, -8, -9, -14, 3, -13, 18, -8, 9, 2, -8, 4, -8, -5, -2 },
- { -3, -3, -1, 5, -2, 15, 3, 2, 1, -8, 1, -39, -6, 13, -13, 0,
- -2, -5, -6, -3, 0, -5, -2, 15, -9, 5, -3, -6, -2, 7, 0, -13 },
- { 2, 8, 5, -12, -13, 22, 8, -16, 11, 5, -2, -32, -2, -4, 11, 5,
- 5, -6, 1, 3, 1, 5, 3, 6, -5, 4, 4, -8, 8, 4, 1, 3 },
- { 13, 9, 5, -4, 9, 18, -11, 2, -1, 15, -10, -19, -2, 14, 0, -10,
- 1, 1, -18, 3, 2, -6, -8, 20, 7, -8, 16, 9, 9, -13, -3, -2 },
- { -13, 11, 11, -9, -10, 13, -3, -18, 2, 10, 5, -21, 6, 15, -11, -21,
- 3, 14, 0, -12, 9, -1, -2, -4, 3, -3, -9, -8, -5, -2, -8, 2 },
- { 3, 3, 11, 4, 0, 13, 1, -8, 10, 13, -6, -26, 2, 12, -3, -5,
- 12, -2, 1, 8, -7, -17, -19, 5, 10, 7, -3, 2, -3, 0, 5, 0 },
- { 5, 0, 3, -3, -9, 5, -15, -5, -5, 17, -5, -31, 0, 13, 13, 5,
- -1, -6, -14, 7, -8, 9, -14, -2, -16, -4, -4, -6, 6, -6, -10, 6 },
- { 13, 3, 1, 7, -3, 4, -1, -2, -1, 4, -8, -32, -1, -4, 0, 3,
- -10, 7, 10, -10, 4, -1, 6, 2, -16, -9, 4, 3, 13, -23, -3, -4 },
- { 4, 11, -4, -9, 4, 11, -12, -12, -12, 6, 1, -28, -3, 14, 18, -2,
- -12, 7, 15, -3, -5, -7, -3, 2, -6, 4, 4, -2, -5, -3, 2, -13 },
- { 8, 7, -7, 0, 13, 7, -8, -7, 8, 36, -10, -22, 3, 23, -3, -10,
- -3, 11, 1, -7, 3, 3, -1, -7, -4, 2, 3, 2, 5, 3, -4, -1 },
- { -1, 1, 13, 1, -6, -1, -6, -9, -18, 17, -5, -37, -1, -1, -6, -4,
- 1, -6, -15, 2, 17, -9, 0, -3, 0, 4, 0, -5, 0, 4, 1, -5 },
- { 0, 14, 5, 0, -7, 2, -6, 17, -6, -9, 7, -16, -5, 23, -14, -13,
- 8, -15, 11, 10, -11, -13, -33, -5, -2, 1, 6, 8, 0, -13, -9, 5 },
- { 11, 7, -2, -8, 9, 11, 25, -14, 7, 3, -1, -33, 14, 8, -6, -19,
- 3, 3, 2, -1, -3, -1, -2, -10, -3, 1, 2, 1, 4, 2, -3, 4 },
- { -2, 8, 4, -2, 9, 13, -4, -2, -15, -3, 19, -37, 9, 25, -9, 2,
- -5, -2, -2, -4, 4, 2, 2, 0, 3, 3, 3, 5, -2, -3, -4, -3 },
- { 10, 13, -1, -15, 4, 6, -18, -4, 25, 1, -23, -17, 15, 13, -8, -8,
- 7, 4, -5, 3, 6, 9, -7, 6, 0, -5, 8, 0, -6, -1, -2, -2 },
- { 1, 3, 9, -5, 27, 15, -9, -31, -1, 23, -2, -9, 1, 8, -1, -7,
- -2, -8, -4, -4, -2, -1, 3, 5, 0, 0, -1, 1, -7, 7, -3, -3 },
- { -8, 7, 3, -6, 8, 3, -11, -2, 36, 14, 1, -30, 6, 10, -12, -6,
- -6, -2, -4, -3, -5, 0, 9, 4, -5, -5, -8, 12, 4, -3, 1, -8 },
- { -2, 9, 33, 0, 12, -3, -7, -4, -4, -1, 6, -25, 11, -6, -9, -11,
- -2, -4, -2, 6, -1, -3, -6, 15, -6, 3, 10, -4, 1, 0, 5, 8 },
- { -22, -21, -9, -19, -5, -7, -12, -15, -8, 9, -19, 14, -7, -4, 5, -8,
- -2, 7, 1, -3, 4, -4, 6, 11, 2, 6, -3, -5, 2, -2, 0, -3 },
- { -32, -13, 3, -24, 3, -8, 4, 1, -10, 14, -15, 0, 4, 6, -1, 6,
- 7, -1, 6, 4, -3, -17, 1, 4, -6, -1, 1, 0, 3, 3, -7, -4 },
- { -32, -11, 7, -8, -12, 13, -5, -22, -4, 12, -16, 2, 0, 4, 0, 1,
- 0, 6, -5, -8, 2, 6, 5, 0, -3, -6, 5, 6, 5, 5, 13, -4 },
- { -44, -33, 6, -4, 2, 0, -9, 10, 3, 4, 7, 0, -1, 7, 5, 1,
- 1, -3, 1, 6, -1, 0, 2, 3, -4, 0, 0, 1, 0, -1, -2, -1 },
- { -30, -18, -24, -8, 5, 0, -2, 14, 7, 0, 1, 12, 6, 4, -9, 7,
- 5, 7, -11, -5, 1, -8, -1, 2, 2, -9, 7, -1, 7, 5, 6, 6 },
- { -22, -20, -13, -9, 20, -3, 10, -8, 6, -4, 2, -7, 10, 8, 0, -1,
- 2, -3, 6, -19, 2, 4, 3, 3, -7, 2, -1, -6, 1, 1, 6, -2 },
- { -27, -8, -1, 3, -1, -11, 24, 4, -1, 1, -8, 8, 5, -11, 15, -3,
- -15, -1, -1, -13, -1, 1, -5, 5, 2, 3, -9, 0, 4, 3, -7, 6 },
- { -33, -16, -1, -8, 10, -23, 6, 13, -1, -3, -9, 0, 5, -7, -5, -12,
- -2, 3, 3, 6, -2, -3, 2, -3, 9, -6, -3, -2, 0, 5, -3, -4 },
- { -22, -17, 11, -3, 3, 1, -1, -5, 17, 2, -15, -2, 10, -9, 6, 14,
- -16, -12, 20, -1, -7, 6, -3, -12, 1, 10, -10, -1, 7, -3, -1, 10 },
- { -28, -13, 1, -3, -1, -1, 0, 3, 3, 5, 1, 10, -10, -3, 7, 2,
- 4, 19, -1, -1, 10, 5, -8, 1, 11, -15, -4, -3, -5, 4, -13, 3 },
- { -22, -13, 42, -20, 5, -13, 7, -11, 1, 1, -1, 1, 6, 3, 6, -11,
- 3, 3, -2, 0, -4, 4, -3, -1, -5, 2, 0, 0, -9, -1, 4, 4 },
- { -26, -15, -2, -6, -4, -2, 16, 8, 21, 8, 1, -3, -10, 7, -8, -12,
- -5, 12, -9, 3, -2, -3, 18, 1, -12, -15, -4, 5, -3, 0, 12, 7 },
- { -26, -16, 5, 6, 14, -3, 15, 6, 1, -7, -13, 16, -15, 5, 11, -2,
- 9, -7, -4, -2, 0, 0, -2, 7, -8, -6, -5, 2, 7, -3, 2, 12 },
- { -31, -17, -8, -30, 4, 14, 6, -6, 6, -11, 0, 3, -4, 0, 0, -4,
- 0, -4, 1, 4, 3, 4, 0, -5, 3, 2, 2, 0, 2, 1, 3, 5 },
- { -61, -10, 4, 10, 4, 7, 0, -3, 0, 1, 0, -3, 0, 1, 0, -2,
- -1, 1, 2, -2, 4, -3, 1, 1, -1, 1, -2, -4, -4, 4, 0, 0 },
- { -28, -13, -8, -4, 3, -3, 2, 1, 11, 14, 3, 9, 1, 13, 3, 5,
- -3, -2, -2, -12, -14, -9, -11, -15, -12, -5, -4, -12, 3, -3, 0, -5 },
- { -41, 0, 12, -24, 13, 4, 5, 16, -5, -4, 0, 0, 13, -4, 1, -9,
- 9, -6, -1, 6, -2, 5, 2, 9, 6, -9, -8, 8, -2, -3, -6, -4 },
- { -26, -19, -2, -15, 4, -14, 6, 0, 26, 20, 8, 9, 9, 3, -4, -5,
- -8, 1, 0, -1, 5, 9, 3, 4, 4, 7, 1, 3, -2, -2, -10, 0 },
- { -29, -18, 9, -4, 1, -5, -14, -12, 5, -10, -5, 4, -5, 0, -1, -1,
- 4, -5, 7, -16, -11, 2, 7, -15, 2, -4, 6, -4, -6, 7, -3, 7 },
- { -27, -16, 9, -14, 3, -8, 9, 0, 7, -4, -3, -7, 0, -10, -1, 2,
- 1, -2, 15, -10, 14, 7, 6, 17, 3, -4, 3, -10, 8, -8, 3, 11 },
- { -21, -20, -8, -8, 4, 5, -3, -2, 0, -5, 14, -10, 11, -4, 13, 0,
- 5, -11, 19, -18, 18, 3, -5, -3, -4, -8, 11, -10, 10, 3, 4, -9 },
- { -35, -15, 13, -12, 4, 0, -2, -4, -12, -3, -8, -24, -7, 1, 7, 8,
- -3, 0, -2, -1, 3, -2, -2, -6, 8, 1, 0, 1, -6, -1, 2, -6 },
- { -19, -14, 13, -10, 9, -1, 1, 3, -12, 5, -16, 7, 13, 9, 4, -4,
- 6, -5, 4, 9, -3, 17, -4, 12, -11, -6, -5, -6, 13, 2, 7, -9 },
- { -34, -8, -4, 1, 2, -1, 3, 6, -20, -11, 8, -1, 4, 2, -9, 4,
- -4, -5, 16, 10, -4, 14, -13, 1, -6, 0, 2, -10, 0, -3, -3, 7 },
- { -36, -10, -8, -3, 2, -2, 14, -4, -1, -7, -4, 10, -1, -3, 15, -11,
- 0, 2, 3, -1, 4, 0, 8, -1, 0, 18, -11, -5, 15, -5, 13, -12 },
- { -22, -13, 14, -20, 15, 25, 16, 10, 8, -2, -10, -5, -1, -8, 11, 8,
- -1, -2, -4, 1, 2, -1, -7, 0, 0, 0, -3, 0, 2, -1, 0, 2 },
- { -31, -22, 7, 6, -2, 5, -20, 14, -6, 7, 0, 14, 3, -7, 3, -6,
- -2, 1, -3, -5, 1, -10, 1, -24, 6, -2, 3, -7, 1, -7, 8, 7 },
- { -25, -20, -3, -9, 10, 6, 12, 7, 5, 4, -3, 6, -1, -5, -6, -8,
- 3, 5, 6, 5, -10, 10, -4, -15, -15, -2, -9, 2, 18, 1, 8, 12 },
- { -24, -19, -2, -4, -7, 11, 6, 9, 16, 2, -7, 18, 6, -7, 6, 6,
- -2, -9, 3, 12, -2, 3, -1, 6, 7, 8, 0, 8, -11, 8, 4, 2 },
- { -26, -20, -12, -12, -2, -3, 1, -5, -1, -2, 0, 3, 7, 9, -2, 2,
- 9, 22, 13, 4, -4, -1, -2, -14, 5, 15, -8, -5, -7, -11, -14, -6 },
- { -21, -18, -1, -4, 0, 3, 7, -2, 10, 8, -8, -1, 15, 1, -9, 3,
- 1, 3, -5, -2, 2, 4, 0, -1, 10, 2, -19, -8, 8, 30, -7, 8 },
- { -25, -6, 26, 4, -8, 4, -2, 21, 5, -4, -16, 5, 13, 4, -10, -1,
- -6, -2, 2, -10, -13, 1, 3, -3, -6, -8, 2, 11, 1, -7, 0, 5 },
- { 0, -1, -2, 19, -12, -48, -6, 11, 8, -2, -4, -2, -7, 5, -3, 2,
- -2, -1, -1, -7, 0, -3, -3, -4, -4, 4, 1, 3, -3, -1, -2, -5 },
- { -11, -8, -28, 18, 16, -24, -8, 19, 4, 8, -12, 9, -4, -2, 4, -7,
- 6, 2, 3, 3, -4, 0, 1, -6, -4, -2, 2, 6, 0, -3, 1, -16 },
- { -9, -5, -26, 7, -3, -37, -16, -2, 2, -7, 4, -13, 0, -4, -6, -5,
- -6, -4, 0, 3, 4, -3, -4, -4, 4, -3, 9, -4, -2, 2, 7, -4 },
- { 2, 9, -18, 7, 29, -24, -1, 7, 14, 10, 3, -3, -2, -5, 6, -10,
- -6, -3, -8, 0, 5, 1, 4, 3, -12, 2, 6, 1, 3, 4, 1, -3 },
- { -20, 2, 8, 20, -9, -24, -4, 18, 3, 11, -1, -11, 6, 9, -1, -3,
- 1, -1, -15, 3, 15, 9, 3, 2, -13, 2, -8, 8, 1, -1, 1, -8 },
- { -12, 5, -11, 6, 19, -26, -17, -6, 4, 14, 6, -8, 9, 5, -6, -5,
- 2, -1, 20, 1, -11, -10, -18, 20, -7, 0, -3, 4, 2, 0, 10, 4 },
- { -15, 1, -2, 13, -8, -21, -22, 4, 4, 3, 3, -7, -31, 4, -10, -14,
- 0, 8, 4, 5, 8, 11, 2, -8, 6, 7, 0, -2, 6, 8, 8, 7 },
- { -13, -10, -9, 12, 19, -16, -3, -2, 9, 2, 11, -29, -1, 9, 4, -3,
- 1, -10, -10, 16, 1, 7, -7, -6, -4, -1, -5, 3, 6, 0, 3, 1 },
- { -17, -1, -5, 19, 12, -9, -21, -5, 2, 12, -7, -7, -3, 8, 7, -2,
- 6, -9, -9, 1, -4, 1, 1, 3, -14, 2, -8, 0, 10, 1, -12, -6 },
- { -13, -5, 8, 15, 0, -20, -2, 20, 8, -8, 8, -19, 12, 10, 2, -11,
- 0, 12, 1, -11, 0, -11, -15, 5, -11, 2, 4, -4, -11, 5, -4, -5 },
- { 3, -11, -7, 8, 0, -17, -26, 15, 19, -7, 10, -9, -5, -5, 14, -25,
- 0, -8, 2, -9, -3, 9, 1, -6, 4, -4, 3, -9, -1, 6, 2, 2 },
- { -12, 5, 5, 9, 14, -18, -19, 4, 2, 16, 14, -21, -15, -9, -1, 16,
- 12, -11, -10, -5, -7, 4, 15, -8, -5, -1, 1, 14, 13, -7, -1, -4 },
- { -10, -5, -1, 8, 7, -23, -10, 14, 6, 11, 10, -16, -3, 16, 6, 0,
- 0, 9, 6, -2, -7, 1, 22, 5, 3, -8, 0, 3, -2, -10, 3, 0 },
- { -2, -14, 2, 16, 15, -17, -17, 6, 19, 4, -10, -15, -1, 15, 11, -14,
- -8, 5, 8, 8, -2, -8, -11, 10, 10, -8, -14, 2, 13, 4, -2, -12 },
- { -10, 3, 6, 4, 19, -23, -19, 1, 4, -9, -30, 3, -6, 18, 0, 2,
- 0, -11, 0, 3, 7, -2, 8, 5, 2, -3, 6, -9, 1, -4, 7, -6 },
- { 9, 5, -2, 21, 20, -33, -13, 7, -10, 8, 8, -15, -6, -4, 1, 5,
- 3, 7, -2, -9, -1, 4, -6, 1, 0, 9, -1, -5, 2, 1, -3, 3 },
- { -9, -3, 3, 15, -3, -30, -7, -7, -25, 6, 2, -6, 1, 19, 1, -12,
- 1, -8, -13, 9, 13, 1, 8, 2, 5, 15, -2, 3, -9, 0, -4, 4 },
- { -6, -12, -17, 25, 22, -13, -10, 9, 2, 11, -7, -16, 4, 6, 1, 0,
- 0, 18, -4, -5, 4, -2, -1, -5, 0, -4, 6, 1, 6, -1, 7, 0 },
- { -1, 0, -10, 8, 8, -27, 0, -2, 29, 16, -2, -4, 9, -1, 2, 0,
- 6, 10, 6, 4, 2, -7, 9, -18, 3, 3, 3, -10, 17, 10, 9, -6 },
- { -3, -12, -6, 11, 20, -32, 5, 21, 3, -4, -9, 2, -10, 1, 7, -4,
- 5, 0, 0, -1, -8, -9, -7, 4, -10, 5, 0, 2, -5, 4, 9, 1 },
- { -5, -1, -5, 1, 2, -19, -13, 1, 6, 12, 2, -16, -17, 11, 10, 13,
- 16, -12, -11, 3, -6, 0, 6, 4, -3, 1, 8, 2, 5, -11, 3, -14 },
- { -19, 5, 10, 11, 2, -23, -9, 16, -2, 7, 0, -11, -7, 10, 6, -7,
- 26, -15, -4, 8, 6, -4, 7, -9, -15, 1, 8, -4, 4, 2, -12, 16 },
- { -11, 1, 11, -4, 1, -31, -13, -1, 8, 5, 4, -2, 0, 13, 7, -17,
- 7, -10, -6, 1, 4, -1, 2, -9, -4, 9, 3, 3, -4, -5, 3, 4 },
- { -3, 1, 10, -1, 0, -15, -22, 4, 40, -11, -4, -3, -14, 9, 11, -1,
- 9, -1, -6, 6, 3, -6, 0, 0, -12, 7, -2, 0, 9, 3, 1, 3 },
- { -1, -1, -1, 14, 8, -24, -14, -8, 5, 8, 5, -12, -17, 8, 2, 7,
- 10, -8, 0, 4, -6, -6, -10, 8, 4, -12, 3, -9, -12, 5, 4, -3 },
- { -5, 1, -11, 8, 9, -24, 0, 2, 2, 14, -12, -13, 1, 6, 7, 0,
- 7, -6, 9, 26, 11, -14, 8, 10, 1, 9, 0, 11, -2, 6, 2, -10 },
- { -13, 1, 4, 34, 19, -17, -15, 0, 3, -2, -7, -1, 0, -3, -3, -1,
- 1, -1, -10, 8, 5, 0, -8, 4, -17, 9, -2, 0, 0, 6, 2, -3 },
- { -6, -4, 1, 2, 2, -14, -29, 0, 9, 34, -3, -5, -14, 6, -10, -9,
- -5, -1, 0, 3, 3, 0, 1, -1, -2, -1, -1, -3, -3, -4, 3, -3 },
- { -4, 6, 3, 14, 14, -8, -29, 31, 11, 14, -4, -5, -6, 10, 6, -9,
- -1, -11, -7, 1, 7, 4, 1, -6, 4, 0, 10, -7, -5, -1, 2, 4 },
- { -4, -4, -2, 14, 6, -32, -6, -14, 14, -5, -11, 10, -18, -4, 6, -8,
- 9, 5, -4, 1, -4, 5, -2, -9, 3, 5, 2, -10, -6, -17, 3, 17 },
- { -16, 9, 21, 19, 4, -20, -17, 14, 9, 15, -6, -17, -1, 1, 6, -3,
- 1, 1, 8, -3, -6, 6, 9, 4, 9, -9, -5, 1, -1, 0, -1, 2 },
- { -7, -5, 3, 19, 1, -20, -9, 14, 21, -7, -18, -9, 26, -7, -17, -7,
- 12, 6, 0, -9, -6, 14, 9, -9, -8, 4, 15, -7, -9, -1, 9, 1 },
- { -20, 30, -6, 11, 24, -4, 0, -6, -2, 8, -4, 12, -8, -17, 0, 5,
- -4, 1, -1, 3, -3, 5, 3, 3, 7, -2, -3, -2, 4, 0, 0, -1 },
- { -35, 17, 6, 1, -9, -1, -16, 3, -20, -13, 8, 7, -4, -7, -4, -20,
- 7, 12, -5, 5, -5, -11, 12, -1, 15, -9, -6, 16, -4, -9, -13, 4 },
- { -21, 36, -19, 9, 0, -7, -8, 9, -4, -3, 3, 0, 7, -8, -2, -2,
- -11, 13, -1, 5, -3, 7, 2, 3, -1, -2, -5, 1, -1, -2, -5, -3 },
- { -12, 33, -4, 1, -12, -9, 0, -13, -1, 2, -8, 4, -10, 6, -16, -7,
- -1, -4, -10, 15, -1, 0, -5, -8, 5, 5, -3, 0, 2, -7, 1, -7 },
- { -14, 32, 5, -7, -15, 3, -5, 8, 14, 5, 9, 13, 3, 18, -3, 7,
- 4, -10, -10, 10, -1, 2, 0, -2, -11, 5, -3, -4, 2, 2, 7, 4 },
- { -14, 34, 1, 20, -1, -12, 0, -3, -7, -4, 7, 18, 9, -3, 14, -7,
- -9, -20, -7, -4, -13, 12, 1, 12, 5, -6, 2, -4, 0, -15, 1, 3 },
- { -21, 23, 7, -8, 3, -13, -3, 0, -6, -2, -7, 6, -12, 9, -6, -2,
- -2, -4, -1, 6, 9, 5, -9, 15, 0, 8, -8, 7, 6, -15, 3, -5 },
- { -27, 32, -1, -4, -2, 4, -10, 12, -3, 8, 13, 7, 0, -15, 4, -2,
- 3, 5, 7, -4, 9, -12, -1, -2, -1, -4, 0, -4, 2, -5, 6, -6 },
- { -17, 29, 15, 0, -1, -4, -10, 13, 12, -1, -8, -10, -10, 4, 7, -2,
- 6, -5, -13, 19, 6, 1, -7, 2, -9, -2, 12, -4, -8, -3, 2, 4 },
- { -38, 27, 16, -15, -6, 3, -7, -4, 0, -1, 6, -2, -3, -6, 6, -6,
- -3, 0, 2, 0, -4, 6, 1, -1, 0, 4, -1, 3, 4, 1, -2, 5 },
- { -33, 40, -4, 2, 1, 0, 0, -10, -14, 0, -7, 4, -1, 3, -2, 5,
- 7, 6, -1, 4, 1, 3, 1, -7, 1, -4, 5, 7, 0, 4, 3, -4 },
- { -20, 25, 12, -4, 16, -4, 2, 2, -14, -2, -3, 29, -1, 1, 3, 1,
- 9, -5, 2, -8, -3, 1, -7, -2, -7, 1, 0, 4, 16, -2, -1, -1 },
- { -10, 30, 17, 3, -5, -2, 0, -5, -22, 4, 5, 5, -3, -18, -6, 10,
- -5, -7, 2, 8, 7, -7, -11, -2, 0, -3, 3, 2, 11, -4, 4, -4 },
- { -11, 30, 11, 4, -3, -8, 1, -2, 4, 18, 3, 1, -1, 0, -8, -4,
- -3, 10, 13, 14, 5, -5, 1, 1, -10, 2, 15, 4, 9, -1, -5, -3 },
- { -17, 32, 18, -18, -3, -5, 6, 10, 1, -15, -5, 9, 8, -12, -10, -6,
- 11, 9, -5, -8, -7, 10, 5, -10, -14, -4, -3, 1, 9, -11, 2, 1 },
- { -13, 28, -11, -1, 2, -16, -2, 7, -24, 0, 3, 6, 3, -1, -8, -7,
- -12, 2, 2, -20, 10, 4, 0, -13, -2, -2, 1, 8, -14, 0, 4, 1 },
- { -14, 23, 12, 8, 8, -26, 2, -4, -14, 13, -14, 15, 3, -9, -1, -13,
- -10, -2, -10, 6, -16, 12, 8, 0, 9, -10, -7, -4, -4, 7, -8, 8 },
- { -20, 45, 10, -14, 4, 16, 8, -9, 1, -8, 10, 5, -7, -2, 2, -5,
- -1, 0, -5, 4, -6, -2, 4, 1, 3, 4, -4, 2, -2, -2, 5, 1 },
- { -20, 26, -4, 1, 7, 4, -8, 1, -5, -13, 2, 13, -7, -3, 6, -6,
- 22, 0, 5, 11, -4, -11, 8, -9, 2, -2, -4, -2, 2, -13, -4, -8 },
- { -28, 18, 17, 3, -8, -23, -16, -6, 5, -10, 14, 10, 5, -1, -8, 4,
- -2, 13, -3, -2, 3, 4, 3, -2, -3, -4, 0, 1, 3, 4, 0, 4 },
- { -12, 32, -6, -16, 18, 12, -16, 0, 7, 13, -4, 5, -8, -1, -3, 4,
- 6, -2, -1, -13, 4, -1, 3, 12, -3, -10, 1, 6, 8, -11, -2, 4 },
- { -18, 26, 2, 5, 0, -9, -17, 14, 5, 1, 7, -3, -8, -3, 11, 7,
- -5, -12, -8, 7, 0, -7, 2, -12, -9, 13, -11, 9, 6, -11, -5, 11 },
- { -24, 22, -15, -9, 8, 1, -7, -12, -9, 3, 11, 15, 14, -11, 12, -15,
- -5, 7, -2, 0, -8, 3, 3, -1, 2, 11, -11, 14, -6, 13, 1, -6 },
- { -20, 28, 18, -4, -6, -5, 12, 14, 2, 10, -13, -6, -8, -6, -13, -1,
- -26, 22, -3, -14, 6, 0, 10, -15, -13, -9, 6, -7, 1, -5, -4, -1 },
- { -19, 26, -8, -3, -14, -6, -9, -4, -8, 15, -8, 3, -12, -4, -2, -7,
- -5, 3, 13, -3, -4, -25, 4, -1, 5, -12, -1, -13, 5, 2, 0, 6 },
- { -18, 43, 14, -8, 1, -23, -2, -2, 1, 3, -7, 0, 0, 8, -1, -3,
- -5, 1, 5, 2, 0, -2, -2, -2, 1, -1, -1, -7, 0, 3, -3, 9 },
- { -11, 30, 10, -14, 3, 1, 10, -11, 1, -7, -4, 14, 2, 1, -9, 1,
- -11, -2, -7, 5, -11, 1, 3, 14, 1, -16, -8, 3, -5, 7, -4, 4 },
- { -18, 24, 6, 3, 8, 7, -22, -7, -7, 3, -8, 4, 23, 9, 3, -1,
- 3, 6, 7, -1, -7, 6, 4, 1, -3, 1, -6, -1, 2, -7, 3, 3 },
- { -15, 38, -7, -1, -11, 2, -17, -24, 24, 8, 7, -4, -5, 2, 2, -7,
- 1, 4, 0, -9, 5, 0, -1, 1, -1, -5, -6, 3, 0, 7, 8, -3 },
- { -14, 22, 1, -5, 9, -12, -9, -5, -6, 5, 7, 8, -1, -4, -9, -3,
- -33, -16, -9, -1, 12, -11, 17, -7, -3, -1, -7, 3, 2, -3, 16, -4 },
- { -14, 20, 6, 4, -10, -4, -4, -4, 1, -7, 2, 6, 8, -12, 4, 1,
- -1, 12, 10, 3, -14, -10, -3, 18, -2, 33, -5, -17, 17, -5, 9, 7 },
- { -12, 23, 13, 0, -11, -8, -11, 12, -5, -9, -16, 11, 6, 4, 12, -5,
- 5, -13, 7, -12, -3, 1, 2, 12, 1, -4, -1, 5, 4, 11, -12, -3 },
- { 15, 2, 14, 7, 1, 2, 1, 12, 10, 23, 4, 6, -20, -10, 4, 26,
- -6, 13, 4, 3, 2, -11, 5, -7, -10, 4, 9, 1, 10, -4, 11, 4 },
- { 17, 15, 31, 17, 18, 16, 11, 24, 2, 4, 2, 3, -8, -3, 7, -3,
- -5, -7, -2, -6, -4, -5, -4, -1, -4, -2, -5, -6, 2, -1, 4, -2 },
- { 16, 8, 15, 14, 3, 7, 21, 9, 8, 15, 21, 6, 8, 12, 5, -5,
- 7, -3, 10, 2, -3, 8, 6, 0, 5, 5, 6, -3, 2, 4, 0, -5 },
- { 5, -4, 6, 12, 6, 13, 24, 17, -5, 17, -1, -6, -7, -10, -8, -18,
- 3, -2, 2, 7, -15, -11, 12, -3, -2, -2, -4, -7, 2, 0, 5, 5 },
- { 10, -6, 8, 11, 12, 20, 22, -11, -3, 15, -3, 15, -2, -2, 0, 2,
- 5, -8, 4, -5, -9, -4, -1, 2, -1, -3, 1, 3, 13, -1, 9, 7 },
- { -5, 8, 5, 11, 14, -5, 14, -9, 2, 35, 8, 15, 1, -2, 2, -2,
- 4, -9, -3, -14, -12, -2, -2, -4, -2, -8, -3, 1, -6, 3, 10, 0 },
- { 16, 0, -6, 15, -3, 4, 4, 3, 3, 20, 5, -4, 10, 9, -9, -3,
- -10, -2, -7, 11, -11, -10, 17, -1, 3, -15, 2, 9, -15, -10, 16, 10 },
- { 14, 4, -7, 19, 3, 0, 19, 8, 16, 34, -9, 6, -13, -1, 6, 5,
- -1, -2, 4, 3, 2, 1, 1, -1, 0, -7, 2, -1, 1, 0, 6, -1 },
- { 1, 6, 9, 13, 9, 10, 15, 16, 10, 18, 13, 17, 3, -1, -7, 2,
- -15, -11, -10, -4, -13, -6, -17, -13, -6, -14, 1, -10, 6, 4, -1, -1 },
- { 13, 1, 7, 10, 14, 13, -7, 5, 5, 28, 14, 14, -2, 2, 3, -3,
- -13, -4, 10, -9, 19, -4, -3, 4, -5, -5, 0, 5, -5, 0, 3, -4 },
- { 1, 0, 6, 22, 9, 18, 18, -3, 5, 10, 12, -2, 1, -3, -8, -12,
- 9, -10, -7, 1, -1, 19, 0, 2, -8, -11, -10, 9, 6, 11, 0, 3 },
- { 10, 11, 19, 44, 0, 14, 1, -7, 6, 22, 2, -1, 9, 2, 0, -4,
- 4, 0, -6, -6, 3, 0, 0, -2, 2, -5, 1, -2, 0, 1, 1, 1 },
- { 5, 7, 0, 32, 30, 26, 5, 4, -7, -3, 15, -6, 3, -10, 7, 6,
- -8, -7, 2, -13, -5, -1, -3, 7, 3, -2, -8, 0, 6, 4, 5, 0 },
- { 9, 8, -2, 4, 2, 11, 4, 29, -5, 14, 8, -5, -14, 8, 0, 9,
- 8, -10, 5, -15, -6, -9, 9, -1, 18, -16, 9, -21, -3, -13, -2, 8 },
- { 25, 7, -9, 23, 20, 18, 6, 16, -9, 8, 8, -5, 11, 13, -8, 7,
- 4, 10, -2, -1, -7, -9, -7, -9, -4, 1, 1, -5, -10, 8, 4, -5 },
- { 9, 2, 16, 14, -5, 14, 1, 0, -21, 17, -1, 9, 12, -3, -3, 4,
- -4, 14, 10, 3, 0, -10, 7, 4, 4, -11, 2, 4, -1, -3, 9, -1 },
- { 17, 8, 11, 26, 15, -3, 14, -1, 12, 9, 10, -8, 8, -18, -11, -3,
- -14, -7, 7, -3, -3, -4, 1, -7, -3, 2, -3, 16, 10, 0, 9, 6 },
- { 9, 8, 3, 8, 18, 14, 11, 1, 10, 6, 1, -4, -16, -2, 14, -2,
- 1, 8, 12, 14, 3, -3, 8, 8, 12, -15, 3, -3, 3, -2, 14, 10 },
- { 22, -3, -11, 13, -7, 11, 4, 11, 3, 14, 0, -6, -2, -9, 4, 2,
- -2, 0, -5, -27, -10, 3, -1, 5, 8, -24, -3, -11, -3, 2, 11, -1 },
- { 19, 2, 8, 36, 5, -6, 3, 15, -3, -4, -5, 14, -10, 1, -12, -10,
- -3, -4, 3, -2, 1, -8, 4, 3, 5, -3, 0, 4, 8, -2, 8, 4 },
- { 8, 14, 15, 9, -4, 10, 5, 11, 9, 10, 8, 9, -15, 15, 6, -8,
- -10, -13, 5, -8, -20, -13, -6, -11, -1, -3, -6, -4, -1, 0, 13, 15 },
- { -2, -1, 9, 12, 2, 2, 13, 3, -23, 33, 15, 2, -4, -1, 3, 8,
- 8, 6, 6, -7, 8, 6, 9, -1, 3, -8, 0, -4, 1, -8, 11, -1 },
- { 6, 5, -6, 16, 2, -3, 31, 21, -9, 12, 0, -1, -4, 1, -12, 3,
- -13, -18, 2, -11, -9, 2, -8, -6, 11, -3, -1, 0, -1, 0, 13, 5 },
- { 5, -1, 2, 0, 25, 5, 10, 16, -5, 21, 14, 12, 13, 2, -5, 5,
- 5, -3, -2, -14, 0, -12, 7, 11, -1, -7, 19, -1, -1, -1, 8, -1 },
- { 10, 7, 3, 11, 0, 8, 22, 3, 3, 19, -4, 12, 15, 9, 5, 15,
- 2, 1, 2, -10, -10, 0, 2, -1, 0, 1, -12, -1, 21, 16, 9, -7 },
- { 11, -4, -5, 24, -7, 11, 20, 11, -15, 18, 5, -13, -15, 0, -5, 9,
- 1, 0, -1, -9, 4, -8, 6, -8, 1, -2, -7, 20, 9, 3, 9, 3 },
- { 20, 0, -12, -6, 9, 31, 9, 12, 8, 27, 15, 7, -16, 5, -3, -7,
- -1, -9, -2, -7, -3, 4, -8, -3, 3, -6, -2, -2, -3, -6, -1, 2 },
- { 6, -6, 48, 8, -3, 19, 12, 11, -7, 2, 3, 0, -1, 1, 8, -4,
- 4, -6, 0, -4, -4, -3, 3, 6, 3, -13, -8, 5, -3, -7, 8, 5 },
- { 7, -2, 6, 11, 12, 2, 14, 4, -5, 12, 2, 9, 4, 2, 0, -1,
- 2, 0, -15, -9, -16, -2, 8, -17, -5, -22, -19, -5, -1, -10, 1, -2 },
- { 11, -9, 3, 12, 6, 6, 1, 17, -6, 19, 14, 7, -7, -1, -1, -9,
- 9, -11, -17, 0, -6, 16, 0, 1, 9, -24, 3, 3, -9, -3, 3, -2 },
- { 9, 0, 1, 8, 1, 7, 2, -5, -3, 8, -1, 7, 2, 6, -3, -6,
- 5, -2, 6, -2, -4, -3, 0, -3, 13, -50, 1, -2, 2, 4, 4, 3 },
- { 7, 0, 26, 21, -4, 2, 17, 8, 7, 11, -7, 1, -1, -15, -1, -15,
- -11, -4, -17, -4, 1, -7, 3, 6, 3, -9, 2, 3, 6, 10, 6, 12 },
- { 1, -2, 2, -1, -10, -4, 6, -3, -5, -2, -8, 2, 2, 2, 8, 0,
- 1, 1, 6, 0, 11, 13, 3, 4, 0, -12, 11, -5, 19, 20, 2, 5 },
- { 5, 3, -13, -2, 1, -12, 11, -7, -12, 7, 10, 0, 7, 0, -2, 4,
- -6, -9, -11, -12, -23, 12, 10, -3, 0, 6, 19, -1, 24, 18, 9, 12 },
- { 6, -3, 2, 5, 2, 2, -2, -5, -8, -11, -4, 3, -8, -4, 5, -3,
- -16, -4, 3, -12, -4, 3, 32, 7, 2, 8, 32, -18, -1, 12, 1, 7 },
- { 0, -8, -1, 0, -8, 7, -8, -1, -1, 4, -12, -1, 3, 0, 1, -18,
- 8, 8, -14, -10, -11, 19, 9, 5, -7, 6, 8, -4, 26, 12, -1, 6 },
- { 3, 5, -14, 7, 14, 8, 20, -13, -16, -10, -2, 17, -7, 4, -8, -9,
- 14, -5, 3, -4, -12, 7, 14, -10, -19, -20, 35, 8, 13, 14, -2, 9 },
- { -2, -4, -1, 1, -3, 0, -1, 1, 2, 2, 6, 0, 0, 4, 5, -2,
- 3, 3, 3, -2, -7, -3, -3, -1, 6, -2, 29, 22, 13, 34, 0, 14 },
- { -3, -9, 3, 1, 5, -4, 2, 0, 7, -9, 0, 2, -5, -3, 0, 6,
- -1, -1, -1, 2, 2, 4, 8, 7, 20, -6, 7, 16, 33, 20, 6, -1 },
- { -11, 1, -3, -3, -11, 3, -9, -25, -1, -16, 4, -8, 15, 1, -2, 7,
- 8, 23, 2, 18, -13, 16, 3, -7, 6, 3, 16, -8, 12, 16, 3, 4 },
- { 0, 5, 5, -5, 1, -1, 2, -3, -2, 1, -13, 2, 2, 10, 6, 7,
- 18, 18, 7, 9, 8, 9, 21, 14, 7, 12, 15, 14, 15, 12, 11, 5 },
- { 1, -5, 11, -2, 17, 8, 3, 0, -1, 6, 11, -7, 6, 6, 7, 5,
- -15, 14, 1, 11, 4, 10, 12, 1, 2, 4, 30, 1, 11, 1, 6, 13 },
- { 2, 4, 3, -7, 5, 8, -11, 7, -5, 9, -10, 6, 8, -10, -3, 10,
- 1, -29, -4, -26, 5, -8, 13, 4, 3, 6, 35, 1, 3, 6, 3, 0 },
- { -2, 1, 0, 0, -1, -3, -7, -3, -9, -3, -1, -6, 3, 4, 4, 0,
- 5, -1, -2, -2, -1, -4, -10, 8, 0, -6, 10, -4, 46, 12, 2, 28 },
- { 4, -1, 4, 1, 0, 4, -2, -2, -2, -1, 2, -4, 1, 5, 0, -3,
- 1, 1, -2, 0, 1, -2, -1, -1, 3, -6, 35, -11, 13, 53, -3, -1 },
- { -5, -2, 0, -13, -16, 5, -12, -11, 1, -30, 3, -18, -24, -8, -5, -19,
- 1, -3, -8, 7, -7, -8, 15, -19, 4, 10, 30, 24, 6, 1, -9, 10 },
- { -4, 8, -7, -4, -6, 12, -1, -9, -4, 2, -9, 3, 2, -2, 4, 2,
- 22, 9, 4, -5, 0, 5, -2, -9, -3, 1, 18, -12, 18, 16, 4, 16 },
- { -5, -8, -3, -5, -3, 6, -7, -3, -2, -5, -3, 1, 2, 2, 4, -6,
- 10, 3, 12, -3, 20, 0, 27, -4, 16, 5, 18, -3, 23, 4, 12, 11 },
- { 0, 1, 0, 1, -2, 1, 2, 1, -1, 0, -2, 2, -2, -4, 1, -2,
- -2, -1, -5, -2, 0, 0, -2, 2, 9, 7, 63, 5, 12, -1, 1, 0 },
- { 4, -3, -7, -5, -11, -5, -12, -10, -10, -12, -15, -12, -14, -14, 1, 1,
- 10, -10, 16, 6, 2, 9, 11, 9, 9, 8, 12, -1, 13, 12, 6, 3 },
- { 7, -3, -2, 4, 6, -8, 2, -3, -12, -5, -9, -8, -10, 15, -2, -4,
- 8, 9, 7, -13, -18, 34, -5, 7, 12, 22, 16, -11, 13, 25, -15, -11 },
- { -3, -2, 0, -4, 1, 0, -3, -13, -7, 13, 12, -7, -10, 13, 19, 6,
- 16, 15, -12, -15, -3, 34, 1, 5, 1, -9, 11, 21, 8, 17, -5, -6 },
- { 3, -5, 0, -4, 0, 4, -11, 4, -7, -3, -1, -8, 3, -2, 2, 1,
- 11, 5, 6, 14, -3, 2, -4, -7, 0, 31, 15, -2, 24, 11, 5, 4 },
- { -1, -4, -9, 5, -8, -18, -4, -9, -20, -18, 7, -14, -16, 3, 8, -3,
- 29, 11, -13, -13, 7, 1, 17, 6, 6, 21, 11, 1, 14, -8, 2, 5 },
- { -3, 8, -10, -6, 12, 2, 1, 3, 3, 3, 3, -6, -8, -14, 15, -5,
- 16, 4, 16, 0, 7, -1, 0, 16, 2, 1, 22, 4, 19, 13, -11, 1 },
- { 2, -3, 10, 20, -4, -1, -8, 5, -8, -9, -6, -2, -4, -7, 8, -10,
- 0, 8, -6, 1, -8, 14, 13, 5, 17, -6, 26, -1, 7, -1, 0, 12 },
- { -4, -7, -31, -2, -7, -1, 5, -5, -5, -12, 4, -7, -6, 3, 15, -2,
- 5, -2, 7, -1, 10, 7, 8, -1, 14, 20, 14, 9, 16, 16, 8, 24 },
- { -7, 0, -3, -6, 1, 3, -13, -6, -4, -4, -5, -9, -1, -10, -4, -8,
- 2, 0, -1, 1, 24, 24, 21, 31, 5, 2, 11, 12, 7, 4, 3, 6 },
- { -3, -5, 6, -4, -3, -1, 2, -1, -2, 1, 0, -8, -1, 2, 0, -4,
- 6, 22, -1, -5, 8, 12, -1, -2, 28, 27, 20, -27, 14, 1, 2, -3 },
- { 1, -5, -2, -2, 6, -2, 9, 1, -2, -5, 3, 4, 11, 5, 2, 8,
- -3, -1, 1, -2, -3, -5, 5, 8, 49, 12, 8, -3, 9, 20, 12, 17 },
- { -6, 0, 1, 7, 0, 9, -2, -4, 8, 0, -2, -10, 0, 7, 21, -1,
- 0, 1, 17, -7, -5, 2, 4, 16, -2, 17, 14, -20, 15, 14, 4, 15 },
- { 0, 3, -4, 9, -4, 0, 6, 4, -6, -6, -5, -7, 2, -9, -10, -2,
- -5, 0, -3, -21, 9, 14, -11, 13, 29, 2, 25, 4, 22, -1, 2, -3 },
- { 2, 12, -11, 2, 16, 9, -4, 7, 1, -10, -15, 11, -4, 3, -2, 4,
- 4, -5, -10, 1, 4, 19, -15, 6, -4, -2, 30, -7, 11, 21, -12, 5 },
- { -2, -3, -2, 4, -1, -5, -3, -7, -5, 1, 0, -6, 1, -6, 7, 0,
- 8, -7, -3, -2, 2, 14, 2, -3, -26, -1, 26, 22, 32, 1, -2, 6 },
- { 1, -38, -1, -20, -2, -3, -6, -4, 2, 2, 7, 0, 3, 5, 3, 10,
- 6, 1, -3, -5, 7, 5, -5, -4, 8, 3, 1, -14, -1, -9, -5, -4 },
- { -5, -26, -7, -19, -10, -5, -11, 5, -11, -25, -8, -14, -9, -16, -8, -6,
- -17, -14, -1, -1, 6, 2, 2, 2, 3, 0, 2, 8, -8, 3, 0, -3 },
- { 17, -49, -3, -23, -1, 11, 7, 3, 4, -4, 0, 0, -1, 4, 2, 4,
- -2, -4, 2, -2, -1, -2, 2, 0, 0, -1, 0, 0, 1, 2, 0, 0 },
- { 4, -34, -6, -9, 1, 21, -7, 3, -2, -1, -3, 18, 2, -16, 7, -3,
- 8, 7, -5, 7, 2, 4, 8, -6, -7, -2, -5, -1, 4, 1, 2, -4 },
- { 5, -29, 13, -2, -14, 3, 1, 18, -15, 4, -8, 8, -10, 8, 2, 1,
- -8, 15, 3, -10, -4, -4, -2, 0, -3, -4, 2, -3, -4, -3, 12, -6 },
- { 13, -20, 3, -18, -17, 4, -14, 13, 28, 11, -8, -6, 16, 6, 0, 10,
- 3, 4, -9, 13, 5, -7, 12, -5, 0, -7, 5, 1, 3, 3, 2, 1 },
- { 3, -27, -5, -11, -21, -11, -12, 0, -5, 7, -22, 1, 3, 5, 0, -5,
- 8, 7, 1, -5, -7, 2, -5, 4, 1, 3, -8, -2, 0, 4, -2, 6 },
- { 31, -45, 0, -1, -12, 1, 2, -6, 4, 3, -1, 3, 3, 0, 5, 3,
- -5, 12, 4, 6, 2, 1, -2, 1, 3, 2, 5, 2, 2, 2, 3, -1 },
- { 9, -45, 6, 5, -1, -17, -2, 18, -3, 2, 0, 1, 0, -1, 10, 8,
- -7, -2, -5, -8, 6, -1, 0, 4, 6, -3, 12, -1, -2, 0, 5, -7 },
- { 3, -26, -2, -12, -12, 2, -10, 16, -3, 12, 4, 5, 11, 8, -16, -17,
- -2, -3, -3, 2, 5, -9, 13, 1, 10, 11, 3, 5, -2, 2, 2, -7 },
- { 8, -26, 32, -7, -5, 22, 2, 14, -10, -8, -7, 3, 3, 7, 0, -5,
- 0, -1, -3, 0, 8, 4, -5, -7, 6, -1, 4, 8, 1, 1, 7, -6 },
- { 4, -31, 2, -14, 2, 0, 1, 8, -6, -1, 17, -3, 13, -6, 5, -10,
- -2, -10, -2, -10, -3, 7, 1, 5, -8, 8, -14, -3, -15, 7, -10, -6 },
- { 16, -27, 13, -4, -23, 7, -9, 6, -7, 5, 4, 2, -1, -3, 23, -18,
- 7, 0, -3, 4, -3, 9, -6, -2, -1, 8, -6, 2, 6, -3, 2, -2 },
- { -1, -35, -2, -8, 11, -1, -7, -3, -2, 11, 7, 6, -6, -10, 9, 6,
- -3, -5, -6, -3, 9, 16, -16, -9, -20, 12, 3, 5, -3, 1, -9, 4 },
- { 2, -24, 1, -12, -16, 5, -4, 3, -4, -1, -11, -11, -8, -14, 14, 10,
- -8, 20, 8, -3, -11, 1, 1, -4, -4, -7, -3, 15, 2, -6, -2, 7 },
- { 9, -21, 2, -19, -7, -5, -8, 25, 3, 17, 5, -3, 9, -12, 8, 2,
- -4, 3, 3, 1, 11, -9, -4, -3, 4, 3, -22, 6, 4, 6, 11, -5 },
- { 16, -23, 13, -17, -21, -12, 5, 9, -20, 7, 6, -6, 0, 2, -9, 6,
- -6, -13, -7, -1, 5, -3, 5, -7, -10, 1, 0, 8, -9, 11, 0, -8 },
- { 10, -26, -9, -7, -19, -4, 6, 16, -7, 5, -4, 4, 8, 0, 4, -1,
- 6, -7, 1, -8, -11, 10, -14, 0, -16, 6, -3, 5, -1, 14, 12, 1 },
- { 8, -27, 12, -14, -1, -1, -19, 10, -11, 21, -14, 9, -8, -3, 8, -1,
- 12, -13, 3, -4, -2, 0, -9, 0, -7, 2, -3, 12, 1, -3, 3, 1 },
- { 18, -20, -14, -14, -16, -3, -24, 6, -17, 2, -3, -11, 2, -3, 12, 10,
- 10, 1, 10, 7, 8, 5, 5, 4, -1, 7, 2, 2, 0, 4, 7, 0 },
- { 0, -30, 9, -16, -18, 15, 12, -3, 4, -4, -5, -11, -4, -12, -10, 0,
- 2, -2, -4, -1, 2, 0, -1, -6, 2, -3, 4, -5, 7, 3, 5, 7 },
- { 25, -24, -1, -6, -9, 6, -13, -2, 3, 15, -3, 11, 4, -8, -11, 2,
- 0, -9, -2, 7, 4, 8, 5, -8, 5, 6, -1, -11, -15, -5, 0, 11 },
- { 0, -34, -7, -11, -7, 9, -3, 19, 4, -8, 3, -11, 11, -3, -9, 12,
- 9, 9, 2, 1, -7, 1, -3, 0, -6, -2, -1, 3, 0, -7, -2, -5 },
- { 6, -34, -4, -5, -3, -9, 2, 9, -1, 9, -5, -3, -26, -12, 8, -6,
- -7, 11, -8, 4, 4, 1, -1, 0, 8, 9, -4, 7, -1, 1, -3, -1 },
- { 3, -30, 5, 6, -10, 3, -7, 6, 3, 3, -26, -19, -3, 1, 7, 5,
- -4, -5, 6, 10, 13, -10, 4, -7, -4, 5, -3, 9, -6, 3, 9, 5 },
- { 4, -24, 9, -19, 2, -4, -5, 8, -3, 2, 0, -15, -1, 9, -4, 22,
- 6, 9, 3, 7, 11, -9, 0, -3, 4, 5, -5, 10, -8, 5, -7, -3 },
- { 8, -27, 7, -3, -1, 2, -9, 13, 7, 12, -4, -6, -6, 5, 0, 7,
- 5, 1, 15, -3, -4, 0, -5, -2, 7, -5, -7, 1, -2, 13, -8, 13 },
- { 17, -22, -15, -11, -8, 16, -14, 18, 2, -1, 14, -7, 14, -6, -6, -7,
- -8, 17, 6, 4, 4, -7, -5, -9, -14, -6, -1, 9, -3, 1, 6, -5 },
- { 25, -30, 2, -12, -13, 18, -18, 16, 8, -3, 10, -8, -3, -1, -6, 3,
- -5, -7, 4, 6, 7, 1, 1, -11, -5, 6, 2, -4, 9, -1, -5, -2 },
- { 7, -23, 7, -15, -1, -3, -1, 0, -10, 12, 2, 5, -4, 0, 4, 6,
- -1, 5, -9, -1, -1, -7, 1, 17, 9, -17, -16, 8, 4, -14, 11, 14 },
- { 0, -31, 7, -13, 3, -11, -7, 6, 1, -11, 8, -7, 15, -3, 16, -11,
- -1, -15, 16, -3, 5, 0, -2, -2, -6, 11, 5, 6, 5, -5, 6, 3 },
- { 13, -24, -2, -20, -10, 7, -3, -1, 15, 2, 6, -5, -7, -10, -20, 1,
- -4, 14, 8, -2, 3, -13, -3, 1, -4, 1, -3, 2, 8, -7, 16, -4 },
- { 1, -2, -2, -3, -4, -7, 0, 3, 6, 7, 3, 2, 1, -2, -1, 0,
- -6, 4, 2, -4, -3, -4, 5, 9, 5, 0, -3, -3, -4, -7, -31, -50 },
- { -1, -3, 7, 2, -1, 2, 4, 6, 0, 10, -2, 0, -20, -6, -3, 9,
- -20, -22, -1, -1, 15, 9, -12, 10, -13, -20, 12, 3, 5, 6, -7, -26 },
- { 0, 4, -2, -14, -12, 6, -13, 11, -10, 3, 22, 6, 16, -2, -5, 1,
- -3, -11, 0, -7, 5, -5, 0, 1, -1, -6, 8, 8, 10, 9, -5, -27 },
- { -5, 10, -2, 7, 9, -9, 5, -9, 5, 4, -15, 14, 1, 3, -10, 5,
- 0, -2, 7, 3, -13, 6, 9, -6, 5, -14, -17, -1, 11, 14, -2, -26 },
- { 0, 6, -3, 0, -8, 6, 0, 1, 4, -8, 2, -5, 4, 7, 15, 11,
- 9, 19, -2, 14, -8, 7, -1, 3, -3, -3, -10, -2, 12, -2, -12, -29 },
- { -12, -5, 0, -3, -2, 6, 3, -3, 2, -2, 1, 11, 2, -7, 5, 1,
- 2, -2, -14, 0, -1, -5, 3, 8, -28, -26, 6, -6, 3, 8, -10, -27 },
- { -1, -3, 6, 2, 4, 15, 1, 0, 2, -2, -2, 13, 3, 6, 0, 6,
- -1, -4, -1, -5, 8, -1, 5, -5, -15, 11, -8, -5, 14, -6, -14, -29 },
- { -5, -6, 0, 1, 0, 6, -3, 2, -5, -1, 5, -3, 2, -10, 3, 4,
- 3, 0, 13, -3, -1, 4, -4, -6, 2, 9, 8, 2, -3, 28, -11, -31 },
- { 1, -4, -10, -9, -4, -3, -15, -6, 1, 5, -3, -6, 5, -6, -22, 27,
- -13, 5, 3, -7, -4, 20, -7, -12, -1, -24, -4, -13, -8, -11, -15, -21 },
- { -6, -4, 19, -6, 2, 11, -6, 1, -3, -10, 9, -9, 12, -10, 2, 1,
- -9, 1, 15, 7, -5, 5, -29, -35, 4, -30, 9, 9, 19, 17, 2, -17 },
- { -3, 3, -3, 1, 2, 5, -1, 5, -2, -3, 1, -3, -8, 3, -4, -2,
- -4, -1, 12, 0, 2, -8, -6, -4, 16, -1, -14, -2, 25, -6, -15, -36 },
- { 0, -1, 3, -4, -4, -1, 7, -4, 8, 0, 10, 9, -4, 1, 10, -1,
- -3, -13, -5, -4, -1, -4, 8, 11, 14, -7, -5, 16, 12, 13, -1, -28 },
- { 1, -2, 2, -3, -8, 10, 4, 9, 12, 3, 5, 0, 8, -3, -6, 2,
- 16, -11, 11, 0, 1, 6, 1, 18, -10, -16, -1, -4, 5, -14, -15, -20 },
- { 1, -12, 5, 4, -7, 8, -1, -17, -2, -9, -14, -11, 6, -9, 5, -4,
- 3, -2, 7, 18, -5, 5, 6, -1, -11, -2, -10, -3, 8, -3, -2, -32 },
- { -12, 5, 20, -5, -6, -11, -6, -6, -13, 4, -6, 19, -8, 2, 3, -9,
- -4, -4, -1, 9, -1, 21, -1, 7, 15, -10, -1, -3, 9, -3, 2, -24 },
- { 0, -3, 2, -6, 4, -1, -9, -2, -1, -3, 6, -1, -5, -6, -5, -8,
- 0, -2, -6, 9, -4, 3, 2, -13, 1, -7, 23, -13, 4, -3, -15, -33 },
- { -7, 2, -15, 11, -10, 14, 0, -11, 3, -1, 12, -4, -4, 9, 11, -13,
- -13, -3, -14, 1, 3, 6, -5, 8, 0, 5, 5, -10, 4, 5, -6, -30 },
- { -6, 4, 0, -5, 4, 1, -1, -1, 3, 6, 5, -2, -5, 0, -2, 5,
- -4, -2, -4, -2, 4, 7, -7, -1, 1, -4, -3, -19, 37, 12, 10, -40 },
- { -7, 2, -7, -12, 17, 11, -7, 2, 2, 3, 1, -1, 3, 4, -2, -5,
- 9, -9, 6, 4, 9, 12, 11, -5, 2, -1, 0, 9, 5, -7, -2, -24 },
- { -7, 6, 1, 3, 1, 0, 6, 0, 4, -12, -2, -2, 1, -9, 10, -2,
- 11, -1, 21, -12, 15, -5, 10, -5, 5, -5, 14, -6, 5, -7, -3, -29 },
- { -2, 0, -5, -2, -3, 1, -3, 0, 4, 2, 3, 0, 2, -2, 7, -2,
- 3, -5, 2, -1, 6, -4, 0, -3, 8, -11, 19, -8, 22, -34, 13, -35 },
- { -1, -3, -1, 9, 11, -3, -3, -1, 7, 18, 11, -5, 2, -12, -11, 18,
- 9, -5, 1, -6, -9, 12, 1, -3, -3, -9, -14, 9, 9, 8, -6, -26 },
- { 0, 5, -5, -1, -1, -2, 4, 6, 8, 2, -1, -2, 5, 1, -5, -4,
- 1, 1, 18, 1, 7, -10, 3, -2, 12, -1, -15, 9, 12, -14, 13, -38 },
- { 3, 0, -8, -1, 0, 8, -9, -3, -8, 16, 3, 16, -5, -9, 0, -1,
- -7, -1, -4, 13, 7, 0, 1, 2, -1, -16, 0, -2, 1, 8, -8, -28 },
- { 7, 9, -5, -3, -2, 2, 0, 3, 11, -6, -4, -2, -2, -5, 28, -18,
- -6, 2, 15, -10, -15, -10, -2, 0, -2, -2, 4, -3, 7, 11, 5, -30 },
- { 9, 0, -7, -1, -4, -7, 2, 2, 9, -2, 2, 3, -8, -6, -6, 3,
- -10, 4, 10, 5, 21, -4, 14, -18, 1, 3, -10, -2, 6, 14, -8, -26 },
- { -14, -1, 2, 3, -3, 7, 1, -22, -1, -1, 0, 1, 12, -14, 3, -5,
- 0, 10, -3, 1, -5, 12, -3, 10, -8, -22, -11, -13, -7, -10, -13, -25 },
- { -2, -5, -4, -4, -9, -18, 9, -3, -5, 17, 13, 5, 6, 11, 3, 8,
- 20, 4, 2, 9, 8, 5, 6, 1, 7, -7, -6, -2, -7, 0, -17, -23 },
- { -5, -5, 2, 0, 6, 2, -2, 2, -3, 4, 4, 0, -5, -2, -4, 6,
- 8, 10, -1, 1, -5, 5, -14, -2, -11, 8, 6, 25, 7, -1, 0, -43 },
- { -4, 0, 4, -2, 7, 0, 3, 17, 5, 2, -5, 1, 21, 3, -2, -10,
- -16, -9, 7, -12, 9, -8, 2, 5, -5, -10, -2, -11, -5, -1, -9, -30 },
- { -2, 3, 1, -4, -1, 0, 8, 1, 12, 4, -1, -1, 3, -17, 13, 9,
- 0, 7, -6, -5, 9, 1, 5, 4, -10, -18, 0, 14, 11, -4, -16, -28 },
- { -1, 0, 2, -1, 4, 1, -1, 1, -1, -2, -1, -2, 3, 0, 0, -1,
- -1, 1, 2, -2, 3, 3, -2, 4, -2, -1, -6, 1, -1, -1, 6, -70 },
- { 7, 3, -11, -1, 12, -4, -14, 4, 4, -4, 4, -2, 2, -12, -4, 15,
- -17, -4, -3, 6, 8, -5, 22, -22, 5, -11, 15, -4, 4, -1, -21, -1 },
- { 10, -2, -13, 11, 4, 14, 4, 9, 8, 8, 19, 15, 14, 15, 5, 10,
- 8, 15, -5, 4, 14, -8, 1, 1, 2, 1, -1, -3, 21, 8, -29, 13 },
- { -6, 0, -6, 6, -1, 2, 8, -4, -5, 4, -4, -5, 0, -2, -4, 0,
- 9, -2, 1, -2, 26, -19, 21, -10, 4, 1, -8, 5, 22, -10, -13, 15 },
- { 11, -5, 1, 0, 6, 3, 7, -2, -2, -3, -5, -1, -2, -6, 1, 1,
- -8, -5, -13, 13, -2, -3, -1, -9, -28, 4, 2, -11, 18, -20, -24, 9 },
- { 7, 4, -3, 6, 6, -6, -7, -5, -7, -4, -4, 0, -7, -5, -6, -5,
- 2, -13, -12, 2, 0, 5, 18, 15, -13, -7, 13, -20, 16, -10, -19, 6 },
- { 5, -8, -1, 5, 10, 2, -1, -10, -11, 23, 8, -5, -8, 4, -5, -4,
- -5, -5, -11, -8, 5, 1, 7, -9, -9, -6, 12, 14, 17, -12, -22, 3 },
- { -5, -8, -3, 3, 12, -1, 0, -4, -5, 1, 1, 6, 1, 5, -5, 7,
- -2, 7, 1, 6, 6, 2, 0, -5, 17, -4, -5, -24, 13, -20, -27, 14 },
- { -1, 2, -3, 1, -3, 1, -3, 0, -2, 3, -2, 1, 2, -1, -2, -1,
- -2, -5, 5, -2, 0, -7, 1, -6, 8, 8, 11, -5, 24, -43, -13, 2 },
- { -2, 4, 7, -3, -4, 4, 13, -4, 0, 0, -2, 9, 0, -3, -6, 1,
- -7, 1, -1, 10, 0, 5, -1, -24, 25, -15, 7, 2, 22, -10, -21, 0 },
- { -5, 2, 6, -2, 13, 3, 5, -12, -11, 16, 6, 10, -5, 0, -3, 6,
- 5, -5, -5, 10, 12, 10, 11, -7, 8, -14, 2, -15, 13, -14, -8, -3 },
- { 5, 6, -7, -5, 5, 2, 9, 5, 0, -1, -4, 2, 8, 0, 3, 5,
- -12, 3, -3, -6, 2, -1, -5, 14, 11, -20, -21, -25, 24, -1, -10, 6 },
- { -5, 5, -2, 9, 4, -4, -1, -6, 11, -6, 5, 0, 2, -3, 6, -1,
- -17, -18, -4, -13, 9, -1, 9, -7, -4, -8, 2, -3, 12, -31, -18, 5 },
- { -7, -11, 6, -8, 4, -3, -12, 0, -1, -6, -3, 0, 5, 9, 7, 2,
- 1, -8, -6, 8, 2, -5, 7, -1, 16, -10, 16, -12, 18, -1, -25, -12 },
- { 3, -12, 1, 2, -2, -18, -8, -15, -10, -9, 2, -7, 11, -11, 2, -1,
- -1, -1, -9, -6, 3, -14, -2, -1, 2, -13, -7, -9, 19, -5, -17, 2 },
- { 7, 1, -8, 7, 17, -13, -10, 5, 7, 1, -6, 4, 9, -4, 0, 3,
- 8, 1, -14, -9, 4, 7, -9, 0, 6, -5, -12, -2, 25, -2, -19, 1 },
- { 7, -3, 6, -3, 1, 6, -7, 0, 10, 0, 4, -5, -17, -4, 4, -1,
- 0, -3, -7, 19, 24, -1, 21, 8, 10, 9, 8, -1, 23, -2, -18, -2 },
- { 3, -3, 0, 5, 8, -2, -9, 2, 9, 6, 19, 8, 2, 6, -9, -2,
- -4, -3, -8, 7, -7, -8, 5, 4, 26, -6, 7, 18, 24, 0, -13, 4 },
- { 0, -13, -11, -1, 3, -9, 5, 4, -7, 3, 0, 2, -1, 4, -5, 2,
- 9, -2, -11, 15, 1, -21, 1, -1, 0, 4, -14, -4, 24, -16, -13, 1 },
- { 1, -9, -8, 0, 0, -4, 11, -1, 14, 16, 0, 17, -2, -9, -12, 0,
- -1, -14, -9, -14, 0, -2, 19, 4, 6, 4, 4, -11, 8, -17, -19, -5 },
- { -3, 1, 2, 12, -4, -18, -1, -4, -7, 14, -3, 2, 0, -7, -8, 12,
- -5, -9, 14, 12, -9, -2, 4, -6, 4, 18, -1, -25, 22, 2, -23, -5 },
- { -2, 0, 0, 0, 1, 3, 5, -1, 5, -2, -2, 2, -3, 0, 1, 2,
- 0, -1, 2, -1, -9, -6, -7, -4, -2, 4, -7, -5, 64, -3, -25, 4 },
- { 12, -2, -3, 0, 8, -9, 13, -7, 6, -3, -12, 12, 15, -9, -4, 2,
- 9, -4, -12, 3, 14, 1, 7, -15, 15, 0, -6, -12, 0, -3, -20, 6 },
- { 2, -1, -4, 5, 9, 6, -7, 2, -2, -7, -2, 0, -1, -18, -4, -6,
- -15, -5, 11, 5, -10, -1, 2, 7, 12, -19, -7, 8, 21, -4, -15, 4 },
- { 4, 2, 5, 5, -5, 1, 3, 2, -8, 13, 0, -5, -2, -14, -11, 6,
- 2, 17, 8, -13, 26, -2, 5, -15, -4, -14, 12, -9, 13, -21, -23, -4 },
- { 2, -3, -2, -3, 3, -2, 6, 9, -9, 13, 4, 2, 12, -3, -3, 1,
- -17, -22, -3, 4, 3, -2, 1, -9, 1, -6, 11, -13, 14, 0, -15, 6 },
- { -16, -4, 17, -2, -20, -11, 11, 10, 5, -8, 16, 2, -17, -14, 11, 11,
- -6, -11, -7, 12, 12, -10, -6, 5, 8, -4, -2, -5, 28, 3, -13, 4 },
- { 0, -3, 3, -7, 6, 8, -12, 20, -19, 18, -11, 10, -5, 0, -9, 11,
- 3, 0, -2, 9, -7, -5, 18, 3, -2, -16, 1, 6, 12, -7, -16, 1 },
- { 4, 1, 5, -5, 15, 2, -8, 3, 5, -11, 15, -3, 8, -8, -1, 7,
- 4, 7, -2, 6, -9, 5, 12, 2, 33, -2, -6, -18, 4, 0, -18, 11 },
- { 3, -1, 1, -1, 0, 1, 4, -1, -5, 0, 1, 0, 4, 2, -1, 4,
- -3, 2, 0, -2, 4, 6, -1, 6, 42, 19, -4, -37, 19, 1, -15, -4 },
- { 2, 0, -5, 0, 10, 0, 0, -5, 3, 0, 0, -3, -3, 0, 2, -4,
- -10, 2, -6, 4, 4, 1, 27, -7, 17, -34, 5, -9, 15, -16, -7, -5 },
- { -2, 7, 7, -2, 9, -2, -15, 11, 11, 7, 5, 1, 15, 1, -9, 31,
- 2, -15, 2, 4, 3, 4, -1, -8, 2, -7, 6, -17, 11, -14, -11, 2 },
- { 1, 1, -11, 9, 9, -6, -14, -11, -10, 8, -3, 11, 16, -9, -8, -13,
- -8, 9, 0, 6, 6, -2, 13, -8, -2, 3, 13, -3, 10, -6, -17, 4 },
- { 14, 5, 4, -6, -12, 10, -7, 8, 21, -8, -30, 15, -2, 1, 11, -9,
- -5, 1, 0, -1, -1, -6, -2, 3, -5, 7, 9, 5, -5, 2, 0, 1 },
- { -1, 2, 20, -17, -15, 3, 3, 7, 11, -17, -13, -6, -3, 18, 17, -15,
- -4, -4, -5, 22, 14, -14, -2, -10, -7, 11, 8, -7, -3, 0, -7, 11 },
- { 7, -11, -7, -8, -14, 22, 5, 2, 6, 13, -12, -2, 10, 3, 0, -21,
- -4, 20, 3, 10, 21, -10, -12, 8, 11, 2, -5, 2, 1, 3, -1, 15 },
- { -1, -2, -1, -2, -13, 8, -4, 0, 7, -2, -17, 8, 18, 5, 3, 8,
- -8, -2, 3, -4, 14, -18, -13, 14, 15, -13, -1, -2, 4, 11, 1, 12 },
- { 13, -6, -4, -16, -17, 16, 21, -2, 5, -11, -9, 19, 21, -17, -3, -17,
- 3, 12, 8, -12, -6, 1, -7, 9, 9, -7, -5, -1, -3, 5, -6, -4 },
- { 11, 5, 12, -20, -6, 10, 4, 12, 8, -5, -10, 15, 13, 14, 10, -15,
- -13, 1, 6, 14, 15, -17, -13, 4, -5, 10, 7, -6, -8, -3, -4, 12 },
- { 25, -1, 7, -5, -7, 11, 1, 17, 13, -15, -14, -4, 5, 3, 8, -3,
- -2, 2, 0, 6, 16, -12, -6, -4, 4, -3, 7, -10, -3, -7, -13, 7 },
- { -8, 10, -3, -13, 5, 2, 4, 9, 9, -17, -13, 2, 11, 1, 6, -4,
- 8, -10, 4, 1, 19, -15, -4, 12, 31, 7, -5, -17, -4, 9, -2, 7 },
- { 14, -6, -6, -6, -14, 13, 17, -5, 4, -14, -9, 7, 7, -9, 3, -16,
- -15, 11, 11, 6, 4, -11, -19, 3, 5, 8, 13, -14, -14, 3, -4, 12 },
- { -2, -4, 10, -4, -7, -1, 27, 5, 2, -16, -18, 4, 12, -2, -3, -2,
- -1, 1, -8, -12, 3, -4, 8, 15, 2, 4, 9, -13, -14, 9, -7, 5 },
- { 4, 2, -10, -5, -7, 2, 1, 4, -1, -6, -15, 6, 1, 10, 5, -10,
- -9, -1, 13, -3, 5, -21, -11, 8, 8, 5, 27, -21, -18, -5, -1, 15 },
- { 11, 1, -16, -8, -11, 0, 5, -8, -12, -13, -17, 22, 4, -6, -1, -18,
- -10, 0, 19, 2, -2, -8, -7, -3, 2, -2, -9, -17, -5, 4, 4, 10 },
- { 8, -6, -19, -5, -4, 12, 14, 15, 10, -9, -1, -9, 19, 12, 0, -1,
- 2, 4, 7, 9, 16, -16, -14, 9, -4, 3, 1, 0, -2, 10, -1, -1 },
- { 12, -8, 12, -9, 0, 25, 7, 9, 2, -31, -9, -4, 15, 4, -5, 1,
- -10, 11, 8, 10, 0, -6, 5, 11, -1, -6, 4, -10, -9, 6, 4, 5 },
- { 14, 6, -17, -2, 17, 12, -9, 2, 0, -25, -14, 5, 20, 14, 8, -20,
- 5, 2, -2, -3, 9, -13, -3, -1, -6, 3, 7, -6, 0, 2, 3, 1 },
- { 8, 4, -15, -3, 10, 18, -4, 13, 8, -22, -10, 9, 19, -15, 7, -5,
- -13, 12, -4, 9, 2, -9, -6, 0, 2, 1, -9, -6, 6, 1, -1, 11 },
- { 4, 1, 4, -5, -10, 18, 7, 2, -4, -9, -11, 0, 32, -7, 4, -16,
- -1, 0, 6, 3, 6, -3, -14, 16, 9, -2, 7, -1, 0, -5, 5, -3 },
- { -3, 2, 3, -8, -6, 4, 6, 2, 4, -12, -15, 2, 8, 8, 9, -3,
- -18, 6, 34, 11, 12, -15, -1, 2, 9, 2, -4, -4, 2, 4, 2, -3 },
- { 18, -6, -12, -8, -1, 15, 20, -4, -1, -11, -5, 6, 6, -11, -15, -7,
- 3, 7, 10, 2, 8, -10, -5, 8, 15, -5, 5, -17, -13, 13, 11, 7 },
- { 8, -4, -6, -1, -14, -3, 6, -2, 1, -5, -1, 10, 10, -15, 5, 0,
- -10, -4, -3, 7, -4, -19, -15, 27, 11, 18, 3, -19, -2, 6, 0, 12 },
- { 12, 0, -5, 0, 4, -5, 1, 5, 10, -7, -11, 21, 29, 1, -2, 1,
- -4, -11, -1, 13, 11, -20, -1, 4, 4, 4, -5, 6, -13, -2, 11, 9 },
- { 2, -7, -7, -3, -10, -1, 20, 12, 1, -19, -19, -1, 5, 4, -7, -25,
- 14, 1, -3, 2, 12, -4, -3, -3, -2, 6, 1, 0, 3, 2, 5, -1 },
- { 12, -8, 3, -12, -10, 10, 13, 0, 23, -14, -18, 10, 0, 15, 3, -12,
- -3, -5, 5, -4, 2, -14, -10, 8, 2, 9, -1, -11, -3, 5, 13, 2 },
- { 9, -6, 7, -7, -30, 17, 6, 13, 1, -14, 0, -1, 6, -9, 8, 3,
- -4, 0, -1, -7, -5, -13, -19, -3, -4, 4, -6, -2, -13, 1, -2, 3 },
- { 10, 1, 3, -18, -26, 17, 4, -16, 4, -3, -13, -4, -6, -11, -4, -21,
- 7, 8, 2, 5, 13, -6, 1, 5, 8, 7, 9, -6, -6, 1, -1, 2 },
- { -3, -1, 0, -2, -2, 0, -1, 3, 4, -14, -8, -9, 13, 2, 50, -23,
- -8, 8, 7, 11, 16, 3, -7, 0, -2, 6, 5, -1, 1, -2, 4, 3 },
- { 1, 3, 1, 1, -6, 3, 6, 6, 2, -2, -3, 10, 2, -8, -5, -5,
- 5, 4, 4, -2, 10, -8, -40, -1, 21, 8, 3, -4, -1, 13, 4, 7 },
- { 2, 0, -4, -8, 5, 2, 7, -5, 5, -8, -4, -1, 12, 2, 12, -13,
- -9, 0, 1, -12, 9, -43, 1, -5, 12, 1, 3, 6, 1, -1, 3, -2 },
- { 6, -2, -1, 1, 0, 4, 8, 14, 4, -7, -23, -5, 23, -17, -6, -15,
- -8, 7, 10, -1, 7, -16, 4, -6, 2, 3, -3, -3, -1, 8, -1, 4 },
- { 10, 4, -4, 1, 7, -3, 2, 11, 4, -6, -3, 8, 5, 4, 1, -45,
- -6, -4, 4, 2, 1, -14, -10, 1, 1, 6, 2, -8, -1, -3, 3, 3 },
- { 1, -1, 2, -3, -8, 9, 3, 3, -2, -5, -8, 8, 7, -7, -4, -6,
- 5, -9, 11, -2, 46, -5, -1, 9, -2, 0, 3, -5, -3, -5, 7, 0 },
- { -4, 1, -2, -1, -11, 11, 8, -3, -2, -10, 0, 4, 9, 9, -17, -17,
- -34, -4, -5, -7, -3, -12, -3, 11, 18, 3, -2, -5, -18, -5, -3, 6 },
- { 7, -5, -3, 1, -4, -3, -5, -1, 2, 5, -2, 3, -10, 12, -18, -5,
- -10, 12, -9, 4, -6, 2, 0, 16, -17, 15, 14, -12, -10, -2, -9, -1 },
- { 4, -5, -3, -5, -3, -1, 7, 18, -7, 12, 3, 5, -8, -4, -20, 1,
- -25, 1, -8, 13, -10, 8, -19, -1, -8, 10, 6, -9, -1, 0, 12, 4 },
- { -4, 5, 0, -1, 2, 5, -8, -2, -6, 4, -8, 9, 3, 2, -7, 4,
- -25, 13, -23, 10, 14, 15, -11, 3, -18, 4, 16, -4, 1, -10, -10, 3 },
- { 5, -3, -1, -3, 4, 1, -3, -4, -5, 1, -12, 14, -7, 11, -15, 6,
- -6, 24, -4, 13, -1, 15, -13, 8, 3, 7, -5, 2, 2, 0, 3, -7 },
- { -3, 1, 0, 8, 6, -1, 6, 5, -5, -2, -12, 4, 0, -2, -3, 5,
- -6, 0, -8, 9, -10, 4, -28, 12, -20, 11, -13, 7, -18, 1, -11, 1 },
- { 1, -4, -15, 5, 0, -13, -5, 13, -11, 4, -4, -5, 5, -14, -16, 0,
- -14, 5, -20, 12, 10, -7, -5, 6, 6, 22, 6, -4, -2, 3, 8, 11 },
- { 13, -11, -2, 16, 16, -7, 0, 20, -7, -1, 0, 5, -9, 12, -2, -5,
- -22, 5, -10, 12, -6, 11, 9, 21, -8, 15, 4, 0, -8, -4, -4, 10 },
- { 18, -4, -13, 0, 1, -15, -1, -3, 2, 10, -1, 6, 1, -4, -20, -5,
- -8, 6, -8, 17, -5, 5, -10, 8, -22, 6, -5, -2, 8, -17, 8, 2 },
- { 1, -2, -9, 6, -31, -8, -8, 8, 0, 5, -9, -4, 2, 3, -12, 11,
- -18, 10, -5, 3, -11, 13, -6, 11, -3, 12, -7, 3, -9, -1, 2, 11 },
- { -9, -6, 21, -8, -15, 4, -11, 12, -11, 17, -1, 2, -6, 0, -15, 13,
- -12, 19, 0, 2, -6, -3, -9, 10, 3, 17, -2, 5, -10, -3, 0, 1 },
- { 4, -6, 5, -10, 1, -5, 1, 0, 0, 0, 2, 7, -2, 2, -2, 0,
- -4, 3, -4, 1, -12, 6, -49, 16, -10, 13, 0, -2, 8, 6, 1, 8 },
- { 5, -8, -7, 9, 13, -5, 7, 0, 10, 11, -4, -3, -1, 13, -14, 6,
- -15, -6, -14, 16, 15, 1, -18, -4, -20, 20, -7, -1, -9, -2, -10, 10 },
- { -12, 4, 0, 10, 0, 3, 8, 4, -27, -1, -2, 19, -4, 2, -13, 3,
- 1, 9, -12, 1, -22, 19, -5, 4, -9, 12, 2, -9, -8, 11, -3, 7 },
- { 4, -5, 11, -6, 17, -17, 5, -4, -2, -6, 1, -5, 2, 4, -14, 6,
- -20, 19, -20, 12, -21, 5, -14, 13, -2, 11, 4, -3, 0, -10, -4, -2 },
- { -2, -1, -3, 8, -9, -7, -22, -3, -24, 13, -2, 10, -15, 5, -9, 4,
- -7, 0, -5, 15, -8, 11, -13, 6, -4, 19, -8, 12, -4, 6, 9, 7 },
- { 2, -3, 2, -1, 0, 3, 1, 2, 1, -4, -2, -3, 1, 5, -12, 6,
- -16, 14, -23, 10, -14, 17, -15, 16, -2, 9, -25, 9, -10, 16, 4, 9 },
- { -3, 7, -8, -3, 2, 2, -4, -8, -9, 10, 3, -11, 25, -10, -28, 27,
- -9, 7, -13, 9, -2, 4, -12, -8, -14, 6, 7, -10, 3, 3, -3, 5 },
- { -8, -3, 1, -10, 8, -3, -9, -4, 13, 7, 2, 4, -10, 4, 3, 7,
- -18, 2, -22, 15, 4, 20, -7, 5, -6, 13, -1, 4, -7, -6, 6, 13 },
- { -2, 3, 0, 2, -4, -2, 0, 0, 1, 2, -2, -5, 0, 1, -4, 0,
- -2, -3, 1, 2, -1, 2, -8, -1, -24, 68, -3, 8, 3, 3, -1, -1 },
- { -15, -2, -9, -7, -1, 8, -14, 8, 3, 6, 0, -1, -8, 8, -23, 2,
- -14, 17, -15, 8, -4, 7, -18, 0, -8, -3, -1, -4, -10, 4, -1, 4 },
- { 8, 0, 2, -7, 0, 5, 1, 3, -11, 4, -8, 14, 3, 20, 1, 26,
- -11, 13, -13, 20, -2, 0, -8, 2, -6, 6, -1, 9, 3, -6, -3, 10 },
- { 5, 0, -1, -7, 10, 1, -3, 5, 4, 7, -5, -1, -3, -1, 12, -3,
- -15, 7, -9, 22, -19, 8, -9, 4, -23, 13, -14, 6, -6, -14, -4, 7 },
- { 14, -5, -8, -10, 25, 3, -23, -7, -28, 0, -1, -9, 4, 1, -13, 20,
- -8, 10, -16, 8, 12, -13, -21, 5, -13, 11, -2, 1, 12, -7, 2, -10 },
- { -5, -4, 9, 5, -6, 35, -7, 8, 15, 2, -1, -9, -6, 2, -18, 7,
- -15, 6, -3, 2, 8, 12, -30, 7, -4, 20, 2, 6, 13, -6, -4, 0 },
- { 1, 8, -9, 9, -5, 12, -9, 16, -9, 16, -17, 14, -13, 15, -18, 14,
- -15, 17, -12, 14, -13, 7, -16, 13, -9, 5, -11, 10, -9, 6, -12, 13 },
- { -10, -4, 5, 3, 1, 6, 8, -14, -5, 15, 7, 4, 8, 7, -22, 8,
- -7, -8, -15, 26, 1, 13, -3, 17, -5, 9, -2, 4, -6, 3, -8, 9 },
- { 8, -3, 2, 3, 3, 1, -2, -1, -11, 8, -4, 0, -6, -5, -1, 13,
- -37, 9, 1, -6, -10, -2, -10, 11, 8, 13, -3, -2, -6, 8, -4, 13 },
- { 3, 2, -3, -4, -4, 7, -8, 9, -8, 9, -20, 12, -19, 15, -18, 17,
- -15, 7, -1, 20, -11, 6, -6, 3, 1, 9, 2, -14, -2, -2, 2, 1 },
- { -7, 1, -1, -3, -6, 4, 4, -3, 3, -1, 5, -4, 3, 2, -1, 9,
- -59, 5, -4, 30, 3, 3, -2, -3, -1, 2, 2, 1, -1, -1, -2, 1 },
- { 0, -3, 2, 0, -1, -8, 0, 2, -3, 4, -4, 1, 10, 6, -6, 8,
- -7, 4, 10, 11, -41, 27, -20, 3, -3, 8, 1, 11, -5, -8, 0, 4 },
- { 5, 1, 4, -2, 1, 2, -1, 6, -7, 2, 11, 4, 0, 0, -8, 7,
- -10, 0, 0, 8, 2, 10, -1, 1, -2, 44, -2, -21, -12, -3, -1, 2 },
- { -4, 4, -2, -2, 6, -8, 2, 1, -10, 14, 8, 6, 5, 1, -2, 4,
- -13, 4, 2, 5, 10, -2, -21, 32, -3, 18, 9, -6, -9, -9, 10, 2 },
- { 9, -16, -6, -2, 1, 4, 22, 2, -2, 1, -3, -2, -9, 3, 16, 19,
- -24, -6, -6, -5, -8, -7, 8, -7, -1, -12, 5, -3, 0, 4, 2, -3 },
- { 10, 3, -16, -4, -1, 13, 4, 4, 1, -3, 1, -6, -14, 18, 3, 8,
- -8, -28, -16, 4, 4, 2, 12, 7, 9, -4, -4, 5, -1, -1, 2, 2 },
- { -5, -13, -22, -3, -8, 21, -2, -9, 21, -4, -9, 5, -8, 15, 5, 1,
- -5, -9, -7, -2, -5, -5, -1, -5, -5, -5, 3, 10, -4, 0, -7, -2 },
- { 5, -10, -18, 2, 20, 4, 13, -10, 8, -15, -11, -3, -1, 16, 10, 9,
- -8, 6, 7, -5, 6, 11, 5, 17, -4, 7, -11, 5, -3, -6, 2, 1 },
- { 3, -5, -19, 1, 1, -3, -2, -25, -11, -17, 0, -13, -4, 10, 10, 2,
- -5, 4, 0, 3, -3, -5, -10, -2, 13, -22, 0, 3, -11, -5, 7, -1 },
- { 12, -14, -29, 6, -1, 10, 7, -17, -12, 14, 3, 9, -9, 9, 7, 6,
- -3, -13, 0, 5, 3, -1, -6, -1, 0, 2, 4, -12, -5, -1, 2, 11 },
- { 12, -15, -7, -2, -12, 17, 20, -16, -2, -12, -6, 15, -6, 12, 11, 9,
- 7, -6, 7, -4, -19, 6, 2, 2, 3, -11, -10, -4, -5, -3, 3, 2 },
- { 11, -22, -6, 0, 8, 18, 3, -11, -4, -7, -15, -17, -12, 6, 16, 4,
- -9, 4, -5, 3, 6, -16, 10, -7, -7, -3, 5, 0, 1, -15, -4, 5 },
- { 12, -22, -16, 5, -6, 8, 12, -4, -9, -17, -11, 3, 5, 8, -17, 0,
- 11, -4, -13, -6, 2, -1, -1, 3, 3, -11, -12, -1, 1, 1, 12, -2 },
- { 8, -10, -33, -5, -3, -6, 1, -7, -8, -4, -6, -1, 5, -4, -6, -12,
- -16, -8, 11, 8, -14, 7, 12, 11, 4, -14, -3, 6, -7, -5, -3, 3 },
- { 0, -8, -7, 2, -4, 24, 2, -9, -11, -3, -7, 11, -12, 17, 1, -1,
- 3, -5, -7, 12, 4, 11, 0, 3, 2, -18, -3, 4, 7, -6, 3, 15 },
- { 10, -15, -16, -2, -4, -9, 7, -15, -6, 2, -16, 13, -8, 7, 19, -21,
- -4, -12, -9, -3, -3, 6, 11, -3, -1, -19, 3, -7, -9, -4, 3, -6 },
- { -5, -10, -21, 0, -3, -7, 18, -21, 15, -5, -12, -4, -13, 2, 6, -9,
- -9, -11, -4, 13, -3, 6, 4, -1, 7, -9, -4, 9, 5, 2, 6, 3 },
- { 15, -1, -27, -2, 10, 3, 7, -8, 9, -2, 7, 1, -2, -5, 18, 9,
- -11, -17, -2, 7, -9, 11, 10, 0, -8, 6, -16, -3, 2, -7, 3, 11 },
- { 4, -9, -39, 19, 6, -13, 13, -5, -5, -15, -2, 9, 0, 4, 14, 6,
- -10, -4, -5, 2, -4, -2, 5, -11, 3, 3, -2, -2, -7, 9, 7, -10 },
- { 5, -11, -8, 10, -2, 12, 16, 0, 12, -2, -6, 8, 14, 8, 7, 1,
- 18, -30, 4, 10, -4, -6, 2, -11, 9, -10, -8, 5, 0, 0, -7, 6 },
- { -1, -16, -10, 11, 0, 13, 12, -4, -4, -5, -21, 12, 4, 13, 14, -7,
- 6, -16, -13, 8, 2, 9, 15, -12, 1, -9, -22, 10, -9, 9, 9, -7 },
- { 4, -12, -27, 1, -2, 11, 15, 3, 14, -14, -9, 0, -9, 16, 22, 10,
- 16, -10, 5, -5, -9, 1, 1, 6, 6, -4, 2, -17, -5, -6, -15, -1 },
- { 7, -12, -17, 1, -9, 5, 20, -7, 3, 23, -8, -8, -8, -1, 13, 17,
- -7, -13, 4, -4, 7, 14, 8, 11, -3, -3, 4, 0, 4, 6, -1, -9 },
- { 7, -15, -15, -4, 10, 12, 3, -13, 6, 14, 9, -8, -15, 14, 23, -5,
- -10, -5, 1, 15, -10, -7, 1, 9, 4, -13, -10, 10, 7, -3, 2, 3 },
- { 4, -10, -14, 0, 3, 4, 0, -9, -3, -4, -11, 2, -17, 8, 2, 15,
- 6, -12, -12, 15, -5, 17, 18, 3, -3, -3, -4, -6, -8, 13, 4, 10 },
- { -2, -18, -26, 10, -4, 10, 13, 4, -4, -16, -7, -17, -3, 5, -4, 2,
- -15, -10, -1, -8, -7, -3, 2, 2, 8, -10, -7, 2, 2, -4, 4, -1 },
- { 4, -19, -5, -1, -1, -6, 2, -8, 10, -16, -28, -6, 8, -1, 11, 28,
- 2, -10, -4, 6, -6, 6, 11, 15, -4, -2, 7, 3, 7, -7, 4, 1 },
- { -3, -6, -10, -5, 13, 18, 10, -15, -5, -3, -13, 5, 1, 2, 18, -5,
- -10, -10, -7, 4, 2, 1, 5, 4, 2, 5, 4, 8, -9, -17, 7, 7 },
- { 20, -12, -2, -4, 5, 14, 7, -11, -1, -16, -6, -4, -11, 17, 14, 0,
- -8, -10, -8, 10, 3, 5, 10, -16, 3, -8, -14, 10, 3, 9, 0, 3 },
- { 12, -10, -36, 0, 7, 15, 2, -16, 2, -1, 0, -1, 5, 4, 5, -3,
- 1, -10, 5, -1, -15, -3, -12, 12, 2, 5, -1, 5, 6, -3, -2, 2 },
- { 17, -15, -31, 23, -4, 15, -2, -3, 6, -7, -5, 1, -12, 4, 6, 8,
- -10, 8, 3, 5, -4, 1, 5, 3, -1, -4, -3, 1, 10, -4, -2, -2 },
- { 6, -18, -5, 12, 10, 12, 14, -11, 15, 2, -9, -6, -5, -2, -9, 4,
- -5, -28, -4, 14, 0, -16, 9, 14, -1, 3, -4, -4, 2, 1, 0, 4 },
- { -5, -14, -31, 8, 16, 7, 13, -13, 5, 6, -16, 10, -5, 2, -2, 2,
- 14, -5, 8, -5, 7, -16, 6, -13, -5, 0, -5, 8, -3, -1, 4, 3 },
- { 1, -2, -1, 0, 6, 5, 2, -4, -3, -1, 0, 1, 4, 2, 43, 28,
- -12, -35, -2, -2, -7, -1, 0, 2, -1, -2, -2, 1, -4, 0, -2, 3 },
- { 2, -9, -22, 12, 3, 3, -7, -4, -19, -22, -14, -4, -1, 21, 9, -3,
- -15, -16, -13, 1, -11, 4, -9, 1, -7, -1, -1, 0, -2, 9, -13, -3 },
- { -1, -3, -23, 0, 2, 12, 3, -9, -4, 7, 3, 9, -10, 1, 27, 28,
- 0, 9, -15, -2, -2, 1, 6, 8, -8, 7, -3, 20, 0, 0, -1, -6 },
- { -1, 11, 8, -2, 1, 5, -6, -1, 4, 2, -4, 0, -1, -5, 4, -6,
- -10, -12, 19, 1, -7, 9, -8, -9, -16, -11, -2, 12, 14, 4, 4, 34 },
- { 17, 7, -6, 1, 4, -10, -5, 4, -11, 3, -18, 4, 14, -13, -3, 1,
- 0, 0, -11, 0, 7, -17, -4, 4, -11, -6, -8, 18, 0, 0, 0, 26 },
- { -6, -7, -1, -1, 11, -8, 1, 3, 2, 11, -6, -6, 10, -3, 1, -3,
- 7, 4, -12, -8, 0, -9, 8, -22, -5, 0, -6, 22, -2, 11, -13, 24 },
- { -3, 4, 0, 3, 9, 10, -1, 3, -9, -12, 1, -5, 18, 0, -3, 8,
- 25, 15, -8, 2, 2, -2, 4, 8, 9, -1, -5, 10, -3, 1, -1, 23 },
- { -5, 2, -9, -1, -3, 0, 3, -1, -10, -4, 0, -13, 16, 9, -1, -14,
- 2, 6, -2, -6, -5, -2, -7, 7, 5, 3, 11, -2, -14, 0, -9, 30 },
- { 4, 6, 6, 5, -3, -1, 4, 5, 10, 0, 5, -4, 7, -11, 14, 14,
- 7, 34, -9, 0, -10, 22, -7, -1, 7, -9, 2, -8, 0, -7, -5, 29 },
- { -4, 3, -1, -4, -3, 5, 1, -4, 0, 2, 4, 2, 1, -1, -10, 1,
- 6, -6, -4, 1, 4, -3, -3, -5, 0, 3, 7, -12, 0, -2, -10, 55 },
- { 5, 9, -1, 0, 4, 9, -21, -9, 4, 2, 6, -7, 11, -7, 1, -5,
- 0, -4, 2, -3, -13, -8, 0, -9, -4, 2, 16, -2, -15, -7, -11, 31 },
- { 8, 2, -1, 0, 3, -5, -5, 5, 1, -1, -9, 1, 0, -6, -2, -1,
- 5, 2, 0, 0, 12, 20, -19, 1, 8, -12, -11, 0, 6, -5, 2, 31 },
- { -1, -1, -2, 1, -1, 3, -9, -5, 8, -2, 5, -1, 0, -2, 4, -2,
- -3, -12, 0, -2, 3, 0, 9, 4, -1, 21, -8, 3, -4, 9, -6, 30 },
- { -4, 0, -7, 17, 10, -12, -2, -10, -12, -3, 10, 0, 11, -4, -13, -3,
- 5, 6, 10, 7, -8, 0, -7, -13, 1, 0, -2, 7, -12, 4, -3, 24 },
- { -13, 9, 4, -2, 2, -4, -14, -1, -3, -5, -10, 4, 13, -2, 5, 13,
- 8, 3, -2, 1, 5, -6, 7, -18, -10, 1, -1, 5, 4, 1, 0, 25 },
- { -5, -1, 18, 12, 8, 8, -16, -1, 1, 1, 1, -4, -5, 3, 3, 4,
- 4, -11, -12, -16, -6, 2, 12, -13, 0, 9, 7, 9, -9, 0, -10, 24 },
- { -4, 1, -3, 0, 2, -4, 4, 1, 5, 0, -3, 2, -3, -2, 2, -1,
- 1, 4, -1, -2, -2, 1, -1, -1, -4, -1, -4, -2, -6, 6, 12, 69 },
- { 8, 5, 11, 0, -15, -4, 13, 6, 0, -4, 9, 1, -5, -3, 15, 0,
- 1, 6, -5, 0, 1, 6, 5, 8, 0, 7, 1, -1, -4, -11, -9, 41 },
- { -4, -9, 32, -6, 0, 7, -4, 6, -6, 1, -6, -2, 4, -8, -5, -3,
- -16, -1, -2, -6, 1, 15, 0, 21, 3, -3, -4, 3, -12, 16, 2, 27 },
- { -6, -5, 1, -9, -5, 3, 7, -3, 5, 5, 14, 13, 20, -7, -1, 12,
- -1, 10, -11, -11, -7, -4, -14, 7, -14, 13, 22, 18, -1, 0, 14, 28 },
- { -8, 3, -2, 0, 5, 6, -1, -4, 1, 3, -7, 3, 1, -15, 4, -9,
- 22, -10, -9, -4, 1, 8, -4, 9, -15, 2, -6, -4, -16, 12, -10, 23 },
- { 0, 0, 2, 0, -1, 3, -3, -1, 3, -5, 7, 1, 5, -5, -8, 1,
- 13, -15, -5, -7, 12, -6, -2, 3, 10, -5, -8, 17, -5, -11, -14, 23 },
- { -7, -4, 6, -4, 5, -6, -5, 2, -4, 11, 9, -4, 2, -2, -4, 6,
- 15, 3, -3, 18, -15, -2, -6, 3, 3, -20, 17, 11, -4, 2, 3, 29 },
- { 6, 1, -6, 2, 3, 0, 0, -3, 3, 3, -1, 3, -4, -6, -6, -7,
- -3, -2, -7, -2, -4, 5, 3, -5, -20, -13, -4, 10, -14, -29, 14, 37 },
- { 3, 4, 3, -6, -4, 5, 0, 3, 2, 3, 0, -2, 4, 0, -3, -5,
- -4, 4, -4, 4, 4, 3, 1, -4, -4, -9, -14, 20, -30, 3, -18, 33 },
- { 0, 2, 5, -2, -4, -2, -1, 2, -6, -3, -2, -2, 2, -5, -1, 4,
- 3, 2, -3, 0, -1, -1, -10, -7, 2, -4, -18, 2, -37, -1, 12, 40 },
- { -7, 2, -1, 0, -2, 4, -8, 1, -4, 12, 7, 4, 15, -7, 1, -9,
- 18, 0, 12, -17, -3, -1, 0, 0, 0, 2, -6, 0, -4, -3, -1, 26 },
- { -6, 4, 8, -5, -6, -2, 2, -1, 1, -1, -15, 8, 7, -1, -17, -4,
- 1, 5, 6, -11, -6, 14, 17, -5, -15, 11, 8, 0, -3, -15, -6, 28 },
- { -1, 0, 0, 0, 1, 0, -1, 0, 1, 3, 2, -2, 3, -1, -1, 2,
- 2, -1, -1, -7, 1, 2, -9, 0, -1, -4, -18, 7, -10, 49, -13, 32 },
- { -1, -3, 4, 1, 2, -5, 1, -7, -1, 5, -9, 4, 4, 25, 1, -1,
- 2, -5, 2, -7, 17, -2, 10, -5, 0, 2, -15, 3, -9, 7, -9, 30 },
- { -5, -1, 0, 2, 1, -1, 2, 5, -33, 3, -5, 14, 11, 7, 5, -3,
- 2, -8, -4, -2, -7, -6, 4, -8, -1, -8, 2, -2, -8, -1, -4, 27 },
- { -1, 0, -1, -2, 1, -1, -2, -1, 2, 0, 1, 2, 2, 4, 1, 3,
- 4, 2, 1, -7, -4, 1, -3, -4, -35, -25, 17, 10, -3, -26, -7, 32 },
- { -5, 1, 6, -2, 6, 6, -9, 3, -1, -4, 5, -4, -2, -2, -9, 2,
- -5, 2, 2, 4, 3, 5, -5, -16, -31, -12, -11, 2, -19, 20, -2, 21 },
- { -5, 2, 7, -7, -7, 5, -7, 2, 0, 0, -4, 3, -1, 0, -1, -2,
- 0, -3, 5, -11, -8, -3, -7, -7, 28, -11, -7, 0, -16, -11, -4, 29 },
- { 2, 1, -3, -2, -1, 3, 4, 0, 1, 0, -1, -5, 4, -5, -12, 2,
- -2, -5, -22, -2, -1, 11, 8, -7, -12, 0, -34, 6, -5, 11, -8, 19 },
- { -1, -3, 5, 11, 18, -2, -2, -5, -2, 4, -1, 8, 5, -6, 1, -1,
- 2, 8, 4, -5, -8, -2, 5, -18, 7, 12, 7, 19, -18, 2, -6, -13 },
- { 9, 0, 0, 5, 4, 3, -6, 4, 1, -4, 5, -1, -4, 8, 8, 6,
- -8, -6, 0, 6, -3, 3, 5, -3, 17, 31, 16, 10, -13, 0, -9, -19 },
- { 12, -10, 2, -2, -2, -1, -3, 6, -12, -5, -2, 14, -16, 4, 12, 12,
- 17, 4, 7, -16, 7, -6, 11, 7, 7, 2, -25, 23, -24, 5, -7, -9 },
- { 10, 4, 13, 10, 10, 3, -6, 3, 3, 2, -1, -6, 8, 4, 10, 0,
- 1, 2, -4, 2, -3, -8, 0, -1, 9, 9, -10, -3, -29, 1, -1, -27 },
- { 2, 2, 0, 7, 9, -2, -10, -1, -1, 1, -9, -5, 8, 4, 1, 2,
- -10, 1, 13, 12, -3, 15, -9, 2, -7, 1, -10, 23, -20, -18, -9, -15 },
- { -3, -5, -1, 8, 0, -5, -1, 4, 7, -1, -7, 2, -8, -5, 11, 7,
- -6, 3, -3, -9, 7, 9, -22, 1, 6, -4, 14, 27, -25, -14, 3, -5 },
- { 1, 3, 8, 4, 7, 6, 12, -17, -15, 1, -8, -10, 7, -14, -8, 6,
- -2, -2, -11, -11, -7, 13, -2, -2, 4, 5, -5, 13, -23, -6, -17, -8 },
- { -5, 4, -14, -5, -4, -5, 6, 5, -8, -5, -2, -11, -7, -12, 3, -11,
- 2, -6, 4, -10, -5, -7, 14, 5, 23, 11, 7, 12, -16, -6, -4, -16 },
- { 5, 6, 2, 5, -2, -5, -5, -6, -5, -19, -13, -1, -3, -13, 5, 0,
- 6, -2, -2, -6, -7, -7, -1, -9, 4, 14, 17, -12, -27, 3, 0, -1 },
- { 7, -1, 9, -10, 8, 2, -7, -2, 5, 2, -3, -7, 3, 0, 6, 4,
- 12, 5, 11, 14, -13, -1, 8, 1, 13, 9, 12, 12, -18, -14, -11, -16 },
- { -7, -5, -6, -5, 0, -1, -3, 2, 2, 1, 4, 9, 2, 3, 5, -2,
- 2, 1, 8, 0, 3, 0, -2, 2, 1, 7, 29, 0, -36, -5, -9, -21 },
- { 14, -6, -9, 0, -1, -8, -8, -11, 2, 2, -9, -12, 12, -4, 5, 3,
- -5, -9, 11, -1, -3, 12, -21, -3, 12, 5, 3, 11, -18, -15, 1, -2 },
- { -1, 3, -9, -3, 7, -7, -18, 2, 4, 12, -10, 2, 8, -3, -14, 13,
- 17, -5, 5, -9, 13, -3, -7, -18, 17, -2, 5, 7, -20, -3, -6, -11 },
- { -3, 3, 3, -1, 1, -6, -5, 1, 5, -3, -14, -6, -5, -8, 14, -6,
- 7, -1, 5, 1, 15, -1, -7, -4, 6, -11, 9, -2, -37, 16, -7, -3 },
- { -1, 0, 6, 1, -3, -9, 0, 11, -8, 2, -2, 0, 5, 2, 12, -10,
- 10, 13, 2, 7, -6, 2, -10, -10, 21, -5, 5, 5, -12, -23, 3, -14 },
- { 6, 0, -2, 1, 0, 1, 0, -4, 1, 1, 8, -2, 2, -5, -2, 1,
- 8, -4, -1, -1, 4, -1, 2, 6, 32, 1, -5, -20, -40, -4, -18, -14 },
- { 2, 2, -7, -2, 4, 4, -1, 2, 0, -2, -4, -7, 3, 5, 0, -5,
- 1, 2, -6, 4, -1, -2, -1, -15, 8, 3, 9, 46, -7, -18, 6, -11 },
- { 5, 5, 16, 21, 3, -11, -4, 11, -12, 2, 4, -12, -1, 11, 8, 1,
- -4, 11, -11, -21, 1, 1, -11, 3, 13, 1, 5, 12, -25, 1, -3, -2 },
- { 1, 6, -7, 4, 2, 3, 1, -5, 8, 9, -15, 3, -3, -14, 17, 4,
- -8, 14, -2, -8, -4, 5, 8, -7, 8, 9, 7, 6, -29, -17, 8, 4 },
- { -7, -7, 4, 0, 13, 1, 0, 4, 4, -16, -10, -7, 5, 9, -15, -10,
- -10, 8, -4, -1, -11, -1, -10, -15, 3, 3, 14, 10, -19, 2, -18, -12 },
- { -4, 0, 2, 0, 5, -2, -9, 0, 4, -4, 2, -1, -2, 2, -4, 9,
- 2, -6, -4, -2, -1, -3, -3, -1, 2, 5, -1, 11, -24, -44, -9, -15 },
- { -1, -10, 6, 21, 11, 15, -7, 10, -14, -9, -8, -8, 4, 6, 19, 1,
- -6, 1, -5, -17, -8, -10, 9, 5, 11, 18, -1, 10, -16, -7, -9, -8 },
- { 3, -5, 0, 0, -2, -2, -6, 4, -4, 1, -1, 0, 7, -3, 4, -4,
- -7, 7, 17, -20, 6, 4, 1, -6, -12, 31, 13, 19, -14, -10, -7, -2 },
- { -2, 6, -10, 3, 9, 6, -14, 15, 2, -5, 2, -11, 9, -8, 4, 6,
- 20, -15, -3, -3, -1, 32, -21, 6, 1, 9, 11, 17, -19, 6, -1, -3 },
- { 8, 10, -2, 0, -8, -16, 7, 7, 6, 10, 4, -14, 7, -6, 21, -7,
- 10, 5, 5, 0, -7, 2, -6, 0, -7, 11, -9, 15, -20, -7, -11, 2 },
- { 0, -7, 5, 2, 0, -3, -6, -4, -2, -1, -4, -5, -13, -1, 27, -9,
- -6, -11, -7, 1, 11, -4, -4, -14, -2, 11, 6, 10, -19, -6, -15, 2 },
- { 0, 7, -1, 2, -7, -15, -2, -3, 13, -5, -5, 12, 3, 0, 5, -5,
- -22, 2, 7, 22, 13, 0, -1, 2, 3, 2, -7, 7, -27, -4, -4, -12 },
- { 11, 1, -16, 6, -15, 1, 3, 2, 0, 2, -3, 2, 5, -2, -5, 9,
- 5, -3, 3, -2, -11, 3, 9, 6, 9, 3, -1, 12, -41, 8, -6, 9 },
- { 3, -7, 3, 2, 5, 5, 0, -1, 1, 3, -5, -2, -13, 7, -1, -2,
- -2, -6, 4, -6, 0, 2, -2, 2, 4, 1, -4, 1, -47, -21, 7, -6 },
- { 3, 16, -7, 13, -4, -2, 10, -3, -1, 18, -13, 7, -13, -4, 8, 4,
- 8, 9, -5, 13, 8, -5, 3, -6, 7, 18, -8, 10, -25, -3, -12, -12 },
- { 1, -1, -1, 0, 2, 5, -5, -3, 0, -5, -1, 0, -4, -8, -2, 3,
- 2, -2, -17, -6, -4, 1, 33, -6, -20, -6, 8, 31, -26, -8, -1, -4 },
- { 3, -3, -3, 5, -3, -2, 1, 7, 0, 3, 6, 3, 6, -2, 9, 15,
- -10, -3, -15, -5, -3, -4, -6, -30, 17, -8, -2, 2, -20, 0, -8, -2 },
- { -2, -1, -1, -1, 3, -5, -2, -3, 4, -2, 0, 5, 8, -3, 1, -4,
- 1, 1, -3, 4, 4, -14, 3, 11, -5, 3, -3, 7, -3, 13, 23, -16 },
- { 2, -6, 1, -3, 5, 0, -6, -11, -7, -4, -1, 2, -7, -1, -1, 7,
- 1, -2, 6, 12, -6, 8, -13, 17, 25, -23, -19, -7, -12, 9, 16, -17 },
- { 9, 4, 4, 4, -3, -1, 6, -2, -3, 0, 13, -4, -7, 14, 1, -7,
- 0, -5, 3, -19, -3, 5, 3, 9, -1, 9, -13, 13, -17, 4, 21, -26 },
- { 0, -5, 0, 0, -4, -5, 2, -6, -4, 5, -7, 10, 0, 2, 0, -2,
- -2, 0, 4, -6, 7, -2, 6, 5, -5, 2, -12, 1, -29, 29, 27, 12 },
- { 9, -10, -22, 6, -1, -1, 9, -14, -12, -2, 1, -1, 10, -11, -16, 0,
- 3, 11, 13, -14, -9, -2, -1, 6, 4, -14, 0, -10, -2, 16, 17, -11 },
- { 2, 0, -1, -2, 4, 3, -6, -2, 1, -1, 1, 3, -4, 1, 3, -4,
- -1, -1, 4, -1, 1, 0, 1, 6, -5, -7, 2, 1, -47, -3, 50, -17 },
- { 8, -4, -11, -7, 11, 11, 14, -7, 12, -7, 6, 2, 13, -6, -3, -2,
- -14, 6, 6, 6, 0, 2, -1, 5, -20, 2, -1, 4, -5, 6, 21, -11 },
- { -2, -9, 3, 0, -6, 7, 8, -8, 1, -3, 4, 1, 5, -2, -3, -7,
- 4, 7, -12, -9, -2, 10, -6, 13, 6, 5, 20, 2, -15, 9, 28, -7 },
- { 0, -5, -6, -6, -6, 1, -6, 6, -2, 4, 8, -3, 12, -1, -4, -2,
- 6, 16, -14, 9, -14, -2, -8, -27, -3, 18, -1, -7, -3, 8, 23, -23 },
- { 1, 4, -9, -1, -5, 10, -2, 1, -11, 1, -9, 4, 7, 14, -9, -2,
- -3, 2, -5, -1, -6, -10, -7, 11, 20, 2, 3, -19, 3, 15, 30, -9 },
- { 7, 2, -14, -4, 0, -2, 5, 2, 5, -2, 8, -3, -7, 6, 6, -11,
- -14, 1, 10, -1, -7, -8, 1, 10, 3, -6, -15, -12, -17, 4, 30, -6 },
- { 4, 2, 1, -2, 3, 0, 1, 0, 2, 0, 1, 6, -7, 0, 3, 4,
- 4, -4, -2, -5, -2, 2, -1, -2, 0, -2, -11, -7, -3, 42, 24, -14 },
- { 4, 1, 3, 2, 0, -2, -3, -2, 2, -1, 4, 11, -2, 2, 3, -4,
- -5, 9, 2, -4, -9, 5, 8, -1, -7, 1, 24, -13, -28, 20, 15, -22 },
- { -3, 7, 6, 3, -2, -5, -10, -2, -2, -1, -6, -6, -2, -14, -16, -6,
- -5, 0, 18, 0, 9, 1, 7, -13, -5, -6, -9, 11, -15, 9, 22, -11 },
- { 9, -2, 6, 5, 2, 9, -10, 1, 1, 5, -4, 12, 2, 2, -10, -7,
- -4, -6, 7, 9, 6, 15, 6, 6, -10, 10, 5, -13, -5, 6, 24, -12 },
- { 1, 3, -3, -3, 8, 1, -6, 2, -5, -3, 7, 2, 14, 6, 9, -6,
- -5, -4, 27, 7, -3, 8, -6, 3, -8, 8, 22, -5, -6, -2, 22, -17 },
- { -2, -2, 3, 10, 9, 9, 12, -15, -1, -11, -13, 3, -2, 1, -3, -11,
- 7, 9, 16, -3, -10, -5, -5, 1, 8, -3, 9, 9, -5, 3, 31, -12 },
- { 7, -5, 10, -4, -8, 2, 16, -2, 10, 10, -3, -2, 3, -8, -3, 3,
- -13, -6, 15, 20, -9, -3, -12, 1, -2, -16, 8, 8, -1, 16, 22, -5 },
- { 5, -3, -15, -2, 12, -8, 8, -5, 2, -8, 20, -18, 14, -4, 3, 3,
- 7, -13, -16, 1, -10, 7, 16, 7, 4, -14, -4, -5, -9, 8, 23, -6 },
- { 5, -4, -5, -4, 1, 8, 4, -7, -5, 8, 10, 6, -6, -10, -2, 6,
- 9, -17, -14, 11, 12, -3, -13, -7, 2, 18, 3, -25, -16, 18, 22, -5 },
- { 5, 6, -7, -20, -4, 2, 8, 4, -24, -4, 1, 4, -5, -2, 1, -10,
- -2, 9, 3, -4, -3, -4, -4, -4, 10, 10, 3, 0, -6, 25, 21, -11 },
- { 0, 7, -1, 14, -6, -4, -10, 5, 4, 4, 4, -5, 3, 4, -1, -7,
- 8, -19, 0, 6, 2, 3, -18, -3, -6, 2, 8, 14, -26, 22, 27, -13 },
- { -2, -6, 7, -5, 12, -7, 8, -1, 3, -2, 4, 1, 8, -2, 0, 14,
- 6, -5, 6, -4, -7, 7, -21, 8, 1, 8, -9, -4, -3, 11, 25, -13 },
- { 4, 4, -1, -6, 4, 9, -8, 1, -3, -10, -2, 0, 15, -9, -16, 11,
- 1, 1, 6, 3, -9, -5, 16, 26, 1, -14, 1, -3, -14, 7, 15, -9 },
- { -12, -2, -9, -13, 2, 6, 14, 0, 1, 0, -1, -13, 0, 10, -1, 6,
- 9, -7, 8, 8, 19, 6, -1, 9, 10, -4, 1, -7, -22, -2, 29, -7 },
- { 2, 4, 13, -12, -8, -4, -5, 13, 12, -5, -3, -3, -4, 1, -1, 10,
- 15, -6, -1, -11, -30, 4, 15, -1, 9, -7, 0, -2, -7, 10, 25, -16 },
- { 7, -15, -7, -7, -1, -5, -5, -11, -20, 10, 3, -10, -3, 5, 20, -4,
- 0, -2, -2, 17, 2, 0, -3, 3, 6, 5, -1, -12, -3, 15, 22, -16 },
- { 4, -1, 3, 4, -5, 0, -1, -5, -24, -29, 4, -9, 1, -3, 0, 0,
- 0, -4, 7, -4, -4, -4, 3, 1, -6, 5, -3, -5, -10, 3, 25, -10 },
- { -2, -1, -1, 4, 4, -1, 2, 0, -4, -4, 2, -1, -3, -1, -2, -2,
- 1, -3, -5, -1, 2, -3, -4, -4, -3, 5, -9, 1, -11, 7, 46, -46 },
- { 0, -9, 3, 4, 4, 3, -5, -6, 5, -4, 4, -2, 1, 7, -4, -10,
- 13, 1, 3, -6, 4, -4, 7, 2, -19, -25, -3, -16, -12, 16, 20, -1 },
- { 18, 6, 4, -12, 0, -14, 9, -6, -1, -4, -5, 2, 1, 12, 4, 2,
- 7, 0, 2, 5, -11, -5, -2, 2, -4, 10, 0, -9, -7, 9, 25, -8 },
- { 5, 0, -6, 5, 6, 3, 3, -10, -5, 1, -1, 4, 3, -11, -8, 5,
- 4, -5, 5, -5, -7, -5, 11, 5, 20, -8, -16, 21, -4, 27, 23, -5 }
-};
diff --git a/src/libfaad/Makefile.am b/src/libfaad/Makefile.am
deleted file mode 100644
index 2ecefaa4c..000000000
--- a/src/libfaad/Makefile.am
+++ /dev/null
@@ -1,106 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-SUBDIRS = codebook
-
-if BUILD_FAAD
-faad_module = xineplug_decode_faad.la
-endif
-
-xineplug_LTLIBRARIES = $(faad_module)
-
-VPATH = @srcdir@:@srcdir@/codebook:
-
-xineplug_decode_faad_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS) -fno-strict-aliasing
-xineplug_decode_faad_la_SOURCES = \
- bits.c \
- cfft.c \
- common.c \
- decoder.c \
- drc.c \
- drm_dec.c \
- error.c \
- filtbank.c \
- hcr.c \
- huffman.c \
- ic_predict.c \
- is.c \
- lt_predict.c \
- mdct.c \
- mp4.c \
- ms.c \
- output.c \
- pns.c \
- ps_dec.c \
- ps_syntax.c \
- pulse.c \
- rvlc.c \
- sbr_dct.c \
- sbr_dec.c \
- sbr_e_nf.c \
- sbr_fbt.c \
- sbr_hfadj.c \
- sbr_hfgen.c \
- sbr_huff.c \
- sbr_qmf.c \
- sbr_syntax.c \
- sbr_tf_grid.c \
- specrec.c \
- ssr.c \
- ssr_fb.c \
- ssr_ipqf.c \
- syntax.c \
- tns.c \
- xine_faad_decoder.c
-
-xineplug_decode_faad_la_LDFLAGS = $(xineplug_ldflags)
-xineplug_decode_faad_la_LIBADD = -lm $(XINE_LIB) $(LTLIBINTL)
-
-noinst_HEADERS = \
- analysis.h \
- bits.h \
- cfft.h \
- cfft_tab.h \
- common.h \
- decoder.h \
- drc.h \
- drm_dec.h \
- error.h \
- filtbank.h \
- fixed.h \
- huffman.h \
- ic_predict.h \
- is.h \
- iq_table.h \
- kbd_win.h \
- lt_predict.h \
- mdct.h \
- mdct_tab.h \
- mp4.h \
- ms.h \
- output.h \
- pns.h \
- ps_dec.h \
- ps_tables.h \
- pulse.h \
- rvlc.h \
- sbr_dct.h \
- sbr_dec.h \
- sbr_e_nf.h \
- sbr_fbt.h \
- sbr_hfadj.h \
- sbr_hfgen.h \
- sbr_huff.h \
- sbr_noise.h \
- sbr_qmf.h \
- sbr_qmf_c.h \
- sbr_syntax.h \
- sbr_tf_grid.h \
- sine_win.h \
- specrec.h \
- ssr.h \
- ssr_fb.h \
- ssr_ipqf.h \
- ssr_win.h \
- structs.h \
- syntax.h \
- tns.h
diff --git a/src/libfaad/analysis.h b/src/libfaad/analysis.h
deleted file mode 100644
index 810a95f3b..000000000
--- a/src/libfaad/analysis.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: analysis.h,v 1.7 2005/10/29 23:57:06 tmmm Exp $
-**/
-
-#ifndef __ANALYSIS_H__
-#define __ANALYSIS_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#ifdef ANALYSIS
-#define DEBUGDEC ,uint8_t print,uint16_t var,uint8_t *dbg
-#define DEBUGVAR(A,B,C) ,A,B,C
-extern uint16_t dbg_count;
-#else
-#define DEBUGDEC
-#define DEBUGVAR(A,B,C)
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/libfaad/bits.c b/src/libfaad/bits.c
deleted file mode 100644
index ae273c7d8..000000000
--- a/src/libfaad/bits.c
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: bits.c,v 1.9 2005/10/29 23:57:06 tmmm Exp $
-**/
-
-#include "common.h"
-#include "structs.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include "bits.h"
-
-/* initialize buffer, call once before first getbits or showbits */
-void faad_initbits(bitfile *ld, const void *_buffer, const uint32_t buffer_size)
-{
- uint32_t tmp;
-
- if (ld == NULL)
- return;
-
- memset(ld, 0, sizeof(bitfile));
-
- if (buffer_size == 0 || _buffer == NULL)
- {
- ld->error = 1;
- ld->no_more_reading = 1;
- return;
- }
-
- ld->buffer = faad_malloc((buffer_size+12)*sizeof(uint8_t));
- memset(ld->buffer, 0, (buffer_size+12)*sizeof(uint8_t));
- memcpy(ld->buffer, _buffer, buffer_size*sizeof(uint8_t));
-
- ld->buffer_size = buffer_size;
-
- tmp = getdword((uint32_t*)ld->buffer);
- ld->bufa = tmp;
-
- tmp = getdword((uint32_t*)ld->buffer + 1);
- ld->bufb = tmp;
-
- ld->start = (uint32_t*)ld->buffer;
- ld->tail = ((uint32_t*)ld->buffer + 2);
-
- ld->bits_left = 32;
-
- ld->bytes_used = 0;
- ld->no_more_reading = 0;
- ld->error = 0;
-}
-
-void faad_endbits(bitfile *ld)
-{
- if (ld)
- {
- if (ld->buffer)
- {
- faad_free(ld->buffer);
- ld->buffer = NULL;
- }
- }
-}
-
-uint32_t faad_get_processed_bits(bitfile *ld)
-{
- return (uint32_t)(8 * (4*(ld->tail - ld->start) - 4) - (ld->bits_left));
-}
-
-uint8_t faad_byte_align(bitfile *ld)
-{
- uint8_t remainder = (uint8_t)((32 - ld->bits_left) % 8);
-
- if (remainder)
- {
- faad_flushbits(ld, 8 - remainder);
- return (8 - remainder);
- }
- return 0;
-}
-
-void faad_flushbits_ex(bitfile *ld, uint32_t bits)
-{
- uint32_t tmp;
-
- ld->bufa = ld->bufb;
- if (ld->no_more_reading == 0)
- {
- tmp = getdword(ld->tail);
- ld->tail++;
- } else {
- tmp = 0;
- }
- ld->bufb = tmp;
- ld->bits_left += (32 - bits);
- ld->bytes_used += 4;
- if (ld->bytes_used == ld->buffer_size)
- ld->no_more_reading = 1;
- if (ld->bytes_used > ld->buffer_size)
- ld->error = 1;
-}
-
-/* rewind to beginning */
-void faad_rewindbits(bitfile *ld)
-{
- uint32_t tmp;
-
- tmp = ld->start[0];
-#ifndef ARCH_IS_BIG_ENDIAN
- BSWAP(tmp);
-#endif
- ld->bufa = tmp;
-
- tmp = ld->start[1];
-#ifndef ARCH_IS_BIG_ENDIAN
- BSWAP(tmp);
-#endif
- ld->bufb = tmp;
- ld->bits_left = 32;
- ld->tail = &ld->start[2];
- ld->bytes_used = 0;
- ld->no_more_reading = 0;
-}
-
-uint8_t *faad_getbitbuffer(bitfile *ld, uint32_t bits
- DEBUGDEC)
-{
- uint16_t i;
- uint8_t temp;
- uint16_t bytes = (uint16_t)bits / 8;
- uint8_t remainder = (uint8_t)bits % 8;
-
- uint8_t *buffer = (uint8_t*)faad_malloc((bytes+1)*sizeof(uint8_t));
-
- for (i = 0; i < bytes; i++)
- {
- buffer[i] = (uint8_t)faad_getbits(ld, 8 DEBUGVAR(print,var,dbg));
- }
-
- if (remainder)
- {
- temp = (uint8_t)faad_getbits(ld, remainder DEBUGVAR(print,var,dbg)) << (8-remainder);
-
- buffer[bytes] = temp;
- }
-
- return buffer;
-}
-
-#ifdef DRM
-/* return the original data buffer */
-void *faad_origbitbuffer(bitfile *ld)
-{
- return (void*)ld->start;
-}
-
-/* return the original data buffer size */
-uint32_t faad_origbitbuffer_size(bitfile *ld)
-{
- return ld->buffer_size;
-}
-#endif
-
-/* reversed bit reading routines, used for RVLC and HCR */
-void faad_initbits_rev(bitfile *ld, void *buffer,
- uint32_t bits_in_buffer)
-{
- uint32_t tmp;
- int32_t index;
-
- ld->buffer_size = bit2byte(bits_in_buffer);
-
- index = (bits_in_buffer+31)/32 - 1;
-
- ld->start = (uint32_t*)buffer + index - 2;
-
- tmp = getdword((uint32_t*)buffer + index);
- ld->bufa = tmp;
-
- tmp = getdword((uint32_t*)buffer + index - 1);
- ld->bufb = tmp;
-
- ld->tail = (uint32_t*)buffer + index;
-
- ld->bits_left = bits_in_buffer % 32;
- if (ld->bits_left == 0)
- ld->bits_left = 32;
-
- ld->bytes_used = 0;
- ld->no_more_reading = 0;
- ld->error = 0;
-}
diff --git a/src/libfaad/bits.h b/src/libfaad/bits.h
deleted file mode 100644
index 05460f0cc..000000000
--- a/src/libfaad/bits.h
+++ /dev/null
@@ -1,382 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: bits.h,v 1.11 2005/10/30 01:21:53 tmmm Exp $
-**/
-
-#ifndef __BITS_H__
-#define __BITS_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "analysis.h"
-#ifdef ANALYSIS
-#include <stdio.h>
-#endif
-
-#define BYTE_NUMBIT 8
-#define bit2byte(a) ((a+7)/BYTE_NUMBIT)
-
-typedef struct _bitfile
-{
- /* bit input */
- uint32_t bufa;
- uint32_t bufb;
- uint32_t bits_left;
- uint32_t buffer_size; /* size of the buffer in bytes */
- uint32_t bytes_used;
- uint8_t no_more_reading;
- uint8_t error;
- uint32_t *tail;
- uint32_t *start;
- void *buffer;
-} bitfile;
-
-
-#if defined(_MSC_VER)
-#define BSWAP(a) __asm mov eax,a __asm bswap eax __asm mov a, eax
-#elif defined(LINUX) || defined(DJGPP) || defined (__MINGW32__) || defined (__CYGWIN__)
-#define BSWAP(a) __asm__ ( "bswapl %0\n" : "=r" (a) : "0" (a) )
-#else
-#define BSWAP(a) \
- ((a) = ( ((a)&0xff)<<24) | (((a)&0xff00)<<8) | (((a)>>8)&0xff00) | (((a)>>24)&0xff))
-#endif
-
-static uint32_t bitmask[] = {
- 0x0, 0x1, 0x3, 0x7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF, 0x1FF,
- 0x3FF, 0x7FF, 0xFFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF,
- 0x1FFFF, 0x3FFFF, 0x7FFFF, 0xFFFFF, 0x1FFFFF, 0x3FFFFF,
- 0x7FFFFF, 0xFFFFFF, 0x1FFFFFF, 0x3FFFFFF, 0x7FFFFFF,
- 0xFFFFFFF, 0x1FFFFFFF, 0x3FFFFFFF, 0x7FFFFFFF
- /* added bitmask 32, correct?!?!?! */
- , 0xFFFFFFFF
-};
-
-void faad_initbits(bitfile *ld, const void *buffer, const uint32_t buffer_size);
-void faad_endbits(bitfile *ld);
-void faad_initbits_rev(bitfile *ld, void *buffer,
- uint32_t bits_in_buffer);
-uint8_t faad_byte_align(bitfile *ld);
-uint32_t faad_get_processed_bits(bitfile *ld);
-void faad_flushbits_ex(bitfile *ld, uint32_t bits);
-void faad_rewindbits(bitfile *ld);
-uint8_t *faad_getbitbuffer(bitfile *ld, uint32_t bits
- DEBUGDEC);
-#ifdef DRM
-void *faad_origbitbuffer(bitfile *ld);
-uint32_t faad_origbitbuffer_size(bitfile *ld);
-#endif
-
-/* circumvent memory alignment errors on ARM */
-static INLINE uint32_t getdword(void *mem)
-{
-#ifdef ARM
- uint32_t tmp;
-#ifndef ARCH_IS_BIG_ENDIAN
- ((uint8_t*)&tmp)[0] = ((uint8_t*)mem)[3];
- ((uint8_t*)&tmp)[1] = ((uint8_t*)mem)[2];
- ((uint8_t*)&tmp)[2] = ((uint8_t*)mem)[1];
- ((uint8_t*)&tmp)[3] = ((uint8_t*)mem)[0];
-#else
- ((uint8_t*)&tmp)[0] = ((uint8_t*)mem)[0];
- ((uint8_t*)&tmp)[1] = ((uint8_t*)mem)[1];
- ((uint8_t*)&tmp)[2] = ((uint8_t*)mem)[2];
- ((uint8_t*)&tmp)[3] = ((uint8_t*)mem)[3];
-#endif
-
- return tmp;
-#else
- uint32_t tmp;
- tmp = *(uint32_t*)mem;
-#ifndef ARCH_IS_BIG_ENDIAN
- BSWAP(tmp);
-#endif
- return tmp;
-#endif
-}
-
-static INLINE uint32_t faad_showbits(bitfile *ld, uint32_t bits)
-{
- if (bits <= ld->bits_left)
- {
- return (ld->bufa >> (ld->bits_left - bits)) & bitmask[bits];
- }
-
- bits -= ld->bits_left;
- return ((ld->bufa & bitmask[ld->bits_left]) << bits) | (ld->bufb >> (32 - bits));
-}
-
-static INLINE void faad_flushbits(bitfile *ld, uint32_t bits)
-{
- /* do nothing if error */
- if (ld->error != 0)
- return;
-
- if (bits < ld->bits_left)
- {
- ld->bits_left -= bits;
- } else {
- faad_flushbits_ex(ld, bits);
- }
-}
-
-/* return next n bits (right adjusted) */
-static INLINE uint32_t faad_getbits(bitfile *ld, uint32_t n DEBUGDEC)
-{
- uint32_t ret;
-
- if (ld->no_more_reading || n == 0)
- return 0;
-
- ret = faad_showbits(ld, n);
- faad_flushbits(ld, n);
-
-#ifdef ANALYSIS
- if (print)
- fprintf(stdout, "%4d %2d bits, val: %4d, variable: %d %s\n", dbg_count++, n, ret, var, dbg);
-#endif
-
- return ret;
-}
-
-static INLINE uint8_t faad_get1bit(bitfile *ld DEBUGDEC)
-{
- uint8_t r;
-
- if (ld->bits_left > 0)
- {
- ld->bits_left--;
- r = (uint8_t)((ld->bufa >> ld->bits_left) & 1);
- return r;
- }
-
- /* bits_left == 0 */
-#if 0
- r = (uint8_t)(ld->bufb >> 31);
- faad_flushbits_ex(ld, 1);
-#else
- r = (uint8_t)faad_getbits(ld, 1);
-#endif
- return r;
-}
-
-/* reversed bitreading routines */
-static INLINE uint32_t faad_showbits_rev(bitfile *ld, uint32_t bits)
-{
- uint8_t i;
- uint32_t B = 0;
-
- if (bits <= ld->bits_left)
- {
- for (i = 0; i < bits; i++)
- {
- if (ld->bufa & (1 << (i + (32 - ld->bits_left))))
- B |= (1 << (bits - i - 1));
- }
- return B;
- } else {
- for (i = 0; i < ld->bits_left; i++)
- {
- if (ld->bufa & (1 << (i + (32 - ld->bits_left))))
- B |= (1 << (bits - i - 1));
- }
- for (i = 0; i < bits - ld->bits_left; i++)
- {
- if (ld->bufb & (1 << (i + (32-ld->bits_left))))
- B |= (1 << (bits - ld->bits_left - i - 1));
- }
- return B;
- }
-}
-
-static INLINE void faad_flushbits_rev(bitfile *ld, uint32_t bits)
-{
- /* do nothing if error */
- if (ld->error != 0)
- return;
-
- if (bits < ld->bits_left)
- {
- ld->bits_left -= bits;
- } else {
- uint32_t tmp;
-
- ld->bufa = ld->bufb;
- tmp = getdword(ld->start);
- ld->bufb = tmp;
- ld->start--;
- ld->bits_left += (32 - bits);
-
- ld->bytes_used += 4;
- if (ld->bytes_used == ld->buffer_size)
- ld->no_more_reading = 1;
- if (ld->bytes_used > ld->buffer_size)
- ld->error = 1;
- }
-}
-
-static INLINE uint32_t faad_getbits_rev(bitfile *ld, uint32_t n
- DEBUGDEC)
-{
- uint32_t ret;
-
- if (ld->no_more_reading)
- return 0;
-
- if (n == 0)
- return 0;
-
- ret = faad_showbits_rev(ld, n);
- faad_flushbits_rev(ld, n);
-
-#ifdef ANALYSIS
- if (print)
- fprintf(stdout, "%4d %2d bits, val: %4d, variable: %d %s\n", dbg_count++, n, ret, var, dbg);
-#endif
-
- return ret;
-}
-
-#ifdef DRM
-static uint8_t faad_check_CRC(bitfile *ld, uint16_t len)
-{
- uint8_t CRC;
- uint16_t r=255; /* Initialize to all ones */
-
- /* CRC polynome used x^8 + x^4 + x^3 + x^2 +1 */
-#define GPOLY 0435
-
- faad_rewindbits(ld);
-
- CRC = (uint8_t) ~faad_getbits(ld, 8
- DEBUGVAR(1,999,"faad_check_CRC(): CRC")); /* CRC is stored inverted */
-
- for (; len>0; len--)
- {
- r = ( (r << 1) ^ (( ( faad_get1bit(ld
- DEBUGVAR(1,998,"")) & 1) ^ ((r >> 7) & 1)) * GPOLY )) & 0xFF;
- }
-
- if (r != CRC)
- {
- return 8;
- } else {
- return 0;
- }
-}
-
-static uint8_t tabFlipbits[256] = {
- 0,128,64,192,32,160,96,224,16,144,80,208,48,176,112,240,
- 8,136,72,200,40,168,104,232,24,152,88,216,56,184,120,248,
- 4,132,68,196,36,164,100,228,20,148,84,212,52,180,116,244,
- 12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,
- 2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,
- 10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,
- 6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,
- 14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,
- 1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,
- 9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,
- 5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,
- 13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,
- 3,131,67,195,35,163,99,227,19,147,83,211,51,179,115,243,
- 11,139,75,203,43,171,107,235,27,155,91,219,59,187,123,251,
- 7,135,71,199,39,167,103,231,23,151,87,215,55,183,119,247,
- 15,143,79,207,47,175,111,239,31,159,95,223,63,191,127,255
-};
-#endif
-
-#ifdef ERROR_RESILIENCE
-
-/* Modified bit reading functions for HCR */
-
-typedef struct
-{
- /* bit input */
- uint32_t bufa;
- uint32_t bufb;
- int8_t len;
-} bits_t;
-
-
-static INLINE uint32_t showbits_hcr(bits_t *ld, uint8_t bits)
-{
- if (bits == 0) return 0;
- if (ld->len <= 32)
- {
- /* huffman_spectral_data_2 needs to read more than may be available, bits maybe
- > ld->len, deliver 0 than */
- if (ld->len >= bits)
- return ((ld->bufa >> (ld->len - bits)) & (0xFFFFFFFF >> (32 - bits)));
- else
- return ((ld->bufa << (bits - ld->len)) & (0xFFFFFFFF >> (32 - bits)));
- } else {
- if ((ld->len - bits) < 32)
- {
- return ( (ld->bufb & (0xFFFFFFFF >> (64 - ld->len))) << (bits - ld->len + 32)) |
- (ld->bufa >> (ld->len - bits));
- } else {
- return ((ld->bufb >> (ld->len - bits - 32)) & (0xFFFFFFFF >> (32 - bits)));
- }
- }
-}
-
-/* return 1 if position is outside of buffer, 0 otherwise */
-static INLINE int8_t flushbits_hcr( bits_t *ld, uint8_t bits)
-{
- ld->len -= bits;
-
- if (ld->len <0)
- {
- ld->len = 0;
- return 1;
- } else {
- return 0;
- }
-}
-
-static INLINE int8_t getbits_hcr(bits_t *ld, uint8_t n, uint32_t *result)
-{
- *result = showbits_hcr(ld, n);
- return flushbits_hcr(ld, n);
-}
-
-static INLINE int8_t get1bit_hcr(bits_t *ld, uint8_t *result)
-{
- uint32_t res;
- int8_t ret;
-
- ret = getbits_hcr(ld, 1, &res);
- *result = (int8_t)(res & 1);
- return ret;
-}
-
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/libfaad/cfft.c b/src/libfaad/cfft.c
deleted file mode 100644
index 61cac2fd5..000000000
--- a/src/libfaad/cfft.c
+++ /dev/null
@@ -1,1004 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: cfft.c,v 1.12 2006/09/26 18:00:31 dgp85 Exp $
-**/
-
-/*
- * Algorithmically based on Fortran-77 FFTPACK
- * by Paul N. Swarztrauber(Version 4, 1985).
- *
- * Does even sized fft only
- */
-
-/* isign is +1 for backward and -1 for forward transforms */
-
-#include "common.h"
-#include "structs.h"
-
-#include <stdlib.h>
-
-#include "cfft.h"
-#include "cfft_tab.h"
-
-
-/* static function declarations */
-static void passf2pos(const uint16_t ido, const uint16_t l1, const complex_t *cc,
- complex_t *ch, const complex_t *wa);
-static void passf2neg(const uint16_t ido, const uint16_t l1, const complex_t *cc,
- complex_t *ch, const complex_t *wa);
-static void passf3(const uint16_t ido, const uint16_t l1, const complex_t *cc,
- complex_t *ch, const complex_t *wa1, const complex_t *wa2, const int8_t isign);
-static void passf4pos(const uint16_t ido, const uint16_t l1, const complex_t *cc, complex_t *ch,
- const complex_t *wa1, const complex_t *wa2, const complex_t *wa3);
-static void passf4neg(const uint16_t ido, const uint16_t l1, const complex_t *cc, complex_t *ch,
- const complex_t *wa1, const complex_t *wa2, const complex_t *wa3);
-static void passf5(const uint16_t ido, const uint16_t l1, const complex_t *cc, complex_t *ch,
- const complex_t *wa1, const complex_t *wa2, const complex_t *wa3,
- const complex_t *wa4, const int8_t isign);
-INLINE void cfftf1(uint16_t n, complex_t *c, complex_t *ch,
- const uint16_t *ifac, const complex_t *wa, const int8_t isign);
-static void cffti1(uint16_t n, complex_t *wa, uint16_t *ifac);
-
-
-/*----------------------------------------------------------------------
- passf2, passf3, passf4, passf5. Complex FFT passes fwd and bwd.
- ----------------------------------------------------------------------*/
-
-static void passf2pos(const uint16_t ido, const uint16_t l1, const complex_t *cc,
- complex_t *ch, const complex_t *wa)
-{
- uint16_t i, k, ah, ac;
-
- if (ido == 1)
- {
- for (k = 0; k < l1; k++)
- {
- ah = 2*k;
- ac = 4*k;
-
- RE(ch[ah]) = RE(cc[ac]) + RE(cc[ac+1]);
- RE(ch[ah+l1]) = RE(cc[ac]) - RE(cc[ac+1]);
- IM(ch[ah]) = IM(cc[ac]) + IM(cc[ac+1]);
- IM(ch[ah+l1]) = IM(cc[ac]) - IM(cc[ac+1]);
- }
- } else {
- for (k = 0; k < l1; k++)
- {
- ah = k*ido;
- ac = 2*k*ido;
-
- for (i = 0; i < ido; i++)
- {
- complex_t t2;
-
- RE(ch[ah+i]) = RE(cc[ac+i]) + RE(cc[ac+i+ido]);
- RE(t2) = RE(cc[ac+i]) - RE(cc[ac+i+ido]);
-
- IM(ch[ah+i]) = IM(cc[ac+i]) + IM(cc[ac+i+ido]);
- IM(t2) = IM(cc[ac+i]) - IM(cc[ac+i+ido]);
-
-#if 1
- ComplexMult(&IM(ch[ah+i+l1*ido]), &RE(ch[ah+i+l1*ido]),
- IM(t2), RE(t2), RE(wa[i]), IM(wa[i]));
-#else
- ComplexMult(&RE(ch[ah+i+l1*ido]), &IM(ch[ah+i+l1*ido]),
- RE(t2), IM(t2), RE(wa[i]), IM(wa[i]));
-#endif
- }
- }
- }
-}
-
-static void passf2neg(const uint16_t ido, const uint16_t l1, const complex_t *cc,
- complex_t *ch, const complex_t *wa)
-{
- uint16_t i, k, ah, ac;
-
- if (ido == 1)
- {
- for (k = 0; k < l1; k++)
- {
- ah = 2*k;
- ac = 4*k;
-
- RE(ch[ah]) = RE(cc[ac]) + RE(cc[ac+1]);
- RE(ch[ah+l1]) = RE(cc[ac]) - RE(cc[ac+1]);
- IM(ch[ah]) = IM(cc[ac]) + IM(cc[ac+1]);
- IM(ch[ah+l1]) = IM(cc[ac]) - IM(cc[ac+1]);
- }
- } else {
- for (k = 0; k < l1; k++)
- {
- ah = k*ido;
- ac = 2*k*ido;
-
- for (i = 0; i < ido; i++)
- {
- complex_t t2;
-
- RE(ch[ah+i]) = RE(cc[ac+i]) + RE(cc[ac+i+ido]);
- RE(t2) = RE(cc[ac+i]) - RE(cc[ac+i+ido]);
-
- IM(ch[ah+i]) = IM(cc[ac+i]) + IM(cc[ac+i+ido]);
- IM(t2) = IM(cc[ac+i]) - IM(cc[ac+i+ido]);
-
-#if 1
- ComplexMult(&RE(ch[ah+i+l1*ido]), &IM(ch[ah+i+l1*ido]),
- RE(t2), IM(t2), RE(wa[i]), IM(wa[i]));
-#else
- ComplexMult(&IM(ch[ah+i+l1*ido]), &RE(ch[ah+i+l1*ido]),
- IM(t2), RE(t2), RE(wa[i]), IM(wa[i]));
-#endif
- }
- }
- }
-}
-
-
-static void passf3(const uint16_t ido, const uint16_t l1, const complex_t *cc,
- complex_t *ch, const complex_t *wa1, const complex_t *wa2,
- const int8_t isign)
-{
- static real_t taur = FRAC_CONST(-0.5);
- static real_t taui = FRAC_CONST(0.866025403784439);
- uint16_t i, k, ac, ah;
- complex_t c2, c3, d2, d3, t2;
-
- if (ido == 1)
- {
- if (isign == 1)
- {
- for (k = 0; k < l1; k++)
- {
- ac = 3*k+1;
- ah = k;
-
- RE(t2) = RE(cc[ac]) + RE(cc[ac+1]);
- IM(t2) = IM(cc[ac]) + IM(cc[ac+1]);
- RE(c2) = RE(cc[ac-1]) + MUL_F(RE(t2),taur);
- IM(c2) = IM(cc[ac-1]) + MUL_F(IM(t2),taur);
-
- RE(ch[ah]) = RE(cc[ac-1]) + RE(t2);
- IM(ch[ah]) = IM(cc[ac-1]) + IM(t2);
-
- RE(c3) = MUL_F((RE(cc[ac]) - RE(cc[ac+1])), taui);
- IM(c3) = MUL_F((IM(cc[ac]) - IM(cc[ac+1])), taui);
-
- RE(ch[ah+l1]) = RE(c2) - IM(c3);
- IM(ch[ah+l1]) = IM(c2) + RE(c3);
- RE(ch[ah+2*l1]) = RE(c2) + IM(c3);
- IM(ch[ah+2*l1]) = IM(c2) - RE(c3);
- }
- } else {
- for (k = 0; k < l1; k++)
- {
- ac = 3*k+1;
- ah = k;
-
- RE(t2) = RE(cc[ac]) + RE(cc[ac+1]);
- IM(t2) = IM(cc[ac]) + IM(cc[ac+1]);
- RE(c2) = RE(cc[ac-1]) + MUL_F(RE(t2),taur);
- IM(c2) = IM(cc[ac-1]) + MUL_F(IM(t2),taur);
-
- RE(ch[ah]) = RE(cc[ac-1]) + RE(t2);
- IM(ch[ah]) = IM(cc[ac-1]) + IM(t2);
-
- RE(c3) = MUL_F((RE(cc[ac]) - RE(cc[ac+1])), taui);
- IM(c3) = MUL_F((IM(cc[ac]) - IM(cc[ac+1])), taui);
-
- RE(ch[ah+l1]) = RE(c2) + IM(c3);
- IM(ch[ah+l1]) = IM(c2) - RE(c3);
- RE(ch[ah+2*l1]) = RE(c2) - IM(c3);
- IM(ch[ah+2*l1]) = IM(c2) + RE(c3);
- }
- }
- } else {
- if (isign == 1)
- {
- for (k = 0; k < l1; k++)
- {
- for (i = 0; i < ido; i++)
- {
- ac = i + (3*k+1)*ido;
- ah = i + k * ido;
-
- RE(t2) = RE(cc[ac]) + RE(cc[ac+ido]);
- RE(c2) = RE(cc[ac-ido]) + MUL_F(RE(t2),taur);
- IM(t2) = IM(cc[ac]) + IM(cc[ac+ido]);
- IM(c2) = IM(cc[ac-ido]) + MUL_F(IM(t2),taur);
-
- RE(ch[ah]) = RE(cc[ac-ido]) + RE(t2);
- IM(ch[ah]) = IM(cc[ac-ido]) + IM(t2);
-
- RE(c3) = MUL_F((RE(cc[ac]) - RE(cc[ac+ido])), taui);
- IM(c3) = MUL_F((IM(cc[ac]) - IM(cc[ac+ido])), taui);
-
- RE(d2) = RE(c2) - IM(c3);
- IM(d3) = IM(c2) - RE(c3);
- RE(d3) = RE(c2) + IM(c3);
- IM(d2) = IM(c2) + RE(c3);
-
-#if 1
- ComplexMult(&IM(ch[ah+l1*ido]), &RE(ch[ah+l1*ido]),
- IM(d2), RE(d2), RE(wa1[i]), IM(wa1[i]));
- ComplexMult(&IM(ch[ah+2*l1*ido]), &RE(ch[ah+2*l1*ido]),
- IM(d3), RE(d3), RE(wa2[i]), IM(wa2[i]));
-#else
- ComplexMult(&RE(ch[ah+l1*ido]), &IM(ch[ah+l1*ido]),
- RE(d2), IM(d2), RE(wa1[i]), IM(wa1[i]));
- ComplexMult(&RE(ch[ah+2*l1*ido]), &IM(ch[ah+2*l1*ido]),
- RE(d3), IM(d3), RE(wa2[i]), IM(wa2[i]));
-#endif
- }
- }
- } else {
- for (k = 0; k < l1; k++)
- {
- for (i = 0; i < ido; i++)
- {
- ac = i + (3*k+1)*ido;
- ah = i + k * ido;
-
- RE(t2) = RE(cc[ac]) + RE(cc[ac+ido]);
- RE(c2) = RE(cc[ac-ido]) + MUL_F(RE(t2),taur);
- IM(t2) = IM(cc[ac]) + IM(cc[ac+ido]);
- IM(c2) = IM(cc[ac-ido]) + MUL_F(IM(t2),taur);
-
- RE(ch[ah]) = RE(cc[ac-ido]) + RE(t2);
- IM(ch[ah]) = IM(cc[ac-ido]) + IM(t2);
-
- RE(c3) = MUL_F((RE(cc[ac]) - RE(cc[ac+ido])), taui);
- IM(c3) = MUL_F((IM(cc[ac]) - IM(cc[ac+ido])), taui);
-
- RE(d2) = RE(c2) + IM(c3);
- IM(d3) = IM(c2) + RE(c3);
- RE(d3) = RE(c2) - IM(c3);
- IM(d2) = IM(c2) - RE(c3);
-
-#if 1
- ComplexMult(&RE(ch[ah+l1*ido]), &IM(ch[ah+l1*ido]),
- RE(d2), IM(d2), RE(wa1[i]), IM(wa1[i]));
- ComplexMult(&RE(ch[ah+2*l1*ido]), &IM(ch[ah+2*l1*ido]),
- RE(d3), IM(d3), RE(wa2[i]), IM(wa2[i]));
-#else
- ComplexMult(&IM(ch[ah+l1*ido]), &RE(ch[ah+l1*ido]),
- IM(d2), RE(d2), RE(wa1[i]), IM(wa1[i]));
- ComplexMult(&IM(ch[ah+2*l1*ido]), &RE(ch[ah+2*l1*ido]),
- IM(d3), RE(d3), RE(wa2[i]), IM(wa2[i]));
-#endif
- }
- }
- }
- }
-}
-
-
-static void passf4pos(const uint16_t ido, const uint16_t l1, const complex_t *cc,
- complex_t *ch, const complex_t *wa1, const complex_t *wa2,
- const complex_t *wa3)
-{
- uint16_t i, k, ac, ah;
-
- if (ido == 1)
- {
- for (k = 0; k < l1; k++)
- {
- complex_t t1, t2, t3, t4;
-
- ac = 4*k;
- ah = k;
-
- RE(t2) = RE(cc[ac]) + RE(cc[ac+2]);
- RE(t1) = RE(cc[ac]) - RE(cc[ac+2]);
- IM(t2) = IM(cc[ac]) + IM(cc[ac+2]);
- IM(t1) = IM(cc[ac]) - IM(cc[ac+2]);
- RE(t3) = RE(cc[ac+1]) + RE(cc[ac+3]);
- IM(t4) = RE(cc[ac+1]) - RE(cc[ac+3]);
- IM(t3) = IM(cc[ac+3]) + IM(cc[ac+1]);
- RE(t4) = IM(cc[ac+3]) - IM(cc[ac+1]);
-
- RE(ch[ah]) = RE(t2) + RE(t3);
- RE(ch[ah+2*l1]) = RE(t2) - RE(t3);
-
- IM(ch[ah]) = IM(t2) + IM(t3);
- IM(ch[ah+2*l1]) = IM(t2) - IM(t3);
-
- RE(ch[ah+l1]) = RE(t1) + RE(t4);
- RE(ch[ah+3*l1]) = RE(t1) - RE(t4);
-
- IM(ch[ah+l1]) = IM(t1) + IM(t4);
- IM(ch[ah+3*l1]) = IM(t1) - IM(t4);
- }
- } else {
- for (k = 0; k < l1; k++)
- {
- ac = 4*k*ido;
- ah = k*ido;
-
- for (i = 0; i < ido; i++)
- {
- complex_t c2, c3, c4, t1, t2, t3, t4;
-
- RE(t2) = RE(cc[ac+i]) + RE(cc[ac+i+2*ido]);
- RE(t1) = RE(cc[ac+i]) - RE(cc[ac+i+2*ido]);
- IM(t2) = IM(cc[ac+i]) + IM(cc[ac+i+2*ido]);
- IM(t1) = IM(cc[ac+i]) - IM(cc[ac+i+2*ido]);
- RE(t3) = RE(cc[ac+i+ido]) + RE(cc[ac+i+3*ido]);
- IM(t4) = RE(cc[ac+i+ido]) - RE(cc[ac+i+3*ido]);
- IM(t3) = IM(cc[ac+i+3*ido]) + IM(cc[ac+i+ido]);
- RE(t4) = IM(cc[ac+i+3*ido]) - IM(cc[ac+i+ido]);
-
- RE(c2) = RE(t1) + RE(t4);
- RE(c4) = RE(t1) - RE(t4);
-
- IM(c2) = IM(t1) + IM(t4);
- IM(c4) = IM(t1) - IM(t4);
-
- RE(ch[ah+i]) = RE(t2) + RE(t3);
- RE(c3) = RE(t2) - RE(t3);
-
- IM(ch[ah+i]) = IM(t2) + IM(t3);
- IM(c3) = IM(t2) - IM(t3);
-
-#if 1
- ComplexMult(&IM(ch[ah+i+l1*ido]), &RE(ch[ah+i+l1*ido]),
- IM(c2), RE(c2), RE(wa1[i]), IM(wa1[i]));
- ComplexMult(&IM(ch[ah+i+2*l1*ido]), &RE(ch[ah+i+2*l1*ido]),
- IM(c3), RE(c3), RE(wa2[i]), IM(wa2[i]));
- ComplexMult(&IM(ch[ah+i+3*l1*ido]), &RE(ch[ah+i+3*l1*ido]),
- IM(c4), RE(c4), RE(wa3[i]), IM(wa3[i]));
-#else
- ComplexMult(&RE(ch[ah+i+l1*ido]), &IM(ch[ah+i+l1*ido]),
- RE(c2), IM(c2), RE(wa1[i]), IM(wa1[i]));
- ComplexMult(&RE(ch[ah+i+2*l1*ido]), &IM(ch[ah+i+2*l1*ido]),
- RE(c3), IM(c3), RE(wa2[i]), IM(wa2[i]));
- ComplexMult(&RE(ch[ah+i+3*l1*ido]), &IM(ch[ah+i+3*l1*ido]),
- RE(c4), IM(c4), RE(wa3[i]), IM(wa3[i]));
-#endif
- }
- }
- }
-}
-
-static void passf4neg(const uint16_t ido, const uint16_t l1, const complex_t *cc,
- complex_t *ch, const complex_t *wa1, const complex_t *wa2,
- const complex_t *wa3)
-{
- uint16_t i, k, ac, ah;
-
- if (ido == 1)
- {
- for (k = 0; k < l1; k++)
- {
- complex_t t1, t2, t3, t4;
-
- ac = 4*k;
- ah = k;
-
- RE(t2) = RE(cc[ac]) + RE(cc[ac+2]);
- RE(t1) = RE(cc[ac]) - RE(cc[ac+2]);
- IM(t2) = IM(cc[ac]) + IM(cc[ac+2]);
- IM(t1) = IM(cc[ac]) - IM(cc[ac+2]);
- RE(t3) = RE(cc[ac+1]) + RE(cc[ac+3]);
- IM(t4) = RE(cc[ac+1]) - RE(cc[ac+3]);
- IM(t3) = IM(cc[ac+3]) + IM(cc[ac+1]);
- RE(t4) = IM(cc[ac+3]) - IM(cc[ac+1]);
-
- RE(ch[ah]) = RE(t2) + RE(t3);
- RE(ch[ah+2*l1]) = RE(t2) - RE(t3);
-
- IM(ch[ah]) = IM(t2) + IM(t3);
- IM(ch[ah+2*l1]) = IM(t2) - IM(t3);
-
- RE(ch[ah+l1]) = RE(t1) - RE(t4);
- RE(ch[ah+3*l1]) = RE(t1) + RE(t4);
-
- IM(ch[ah+l1]) = IM(t1) - IM(t4);
- IM(ch[ah+3*l1]) = IM(t1) + IM(t4);
- }
- } else {
- for (k = 0; k < l1; k++)
- {
- ac = 4*k*ido;
- ah = k*ido;
-
- for (i = 0; i < ido; i++)
- {
- complex_t c2, c3, c4, t1, t2, t3, t4;
-
- RE(t2) = RE(cc[ac+i]) + RE(cc[ac+i+2*ido]);
- RE(t1) = RE(cc[ac+i]) - RE(cc[ac+i+2*ido]);
- IM(t2) = IM(cc[ac+i]) + IM(cc[ac+i+2*ido]);
- IM(t1) = IM(cc[ac+i]) - IM(cc[ac+i+2*ido]);
- RE(t3) = RE(cc[ac+i+ido]) + RE(cc[ac+i+3*ido]);
- IM(t4) = RE(cc[ac+i+ido]) - RE(cc[ac+i+3*ido]);
- IM(t3) = IM(cc[ac+i+3*ido]) + IM(cc[ac+i+ido]);
- RE(t4) = IM(cc[ac+i+3*ido]) - IM(cc[ac+i+ido]);
-
- RE(c2) = RE(t1) - RE(t4);
- RE(c4) = RE(t1) + RE(t4);
-
- IM(c2) = IM(t1) - IM(t4);
- IM(c4) = IM(t1) + IM(t4);
-
- RE(ch[ah+i]) = RE(t2) + RE(t3);
- RE(c3) = RE(t2) - RE(t3);
-
- IM(ch[ah+i]) = IM(t2) + IM(t3);
- IM(c3) = IM(t2) - IM(t3);
-
-#if 1
- ComplexMult(&RE(ch[ah+i+l1*ido]), &IM(ch[ah+i+l1*ido]),
- RE(c2), IM(c2), RE(wa1[i]), IM(wa1[i]));
- ComplexMult(&RE(ch[ah+i+2*l1*ido]), &IM(ch[ah+i+2*l1*ido]),
- RE(c3), IM(c3), RE(wa2[i]), IM(wa2[i]));
- ComplexMult(&RE(ch[ah+i+3*l1*ido]), &IM(ch[ah+i+3*l1*ido]),
- RE(c4), IM(c4), RE(wa3[i]), IM(wa3[i]));
-#else
- ComplexMult(&IM(ch[ah+i+l1*ido]), &RE(ch[ah+i+l1*ido]),
- IM(c2), RE(c2), RE(wa1[i]), IM(wa1[i]));
- ComplexMult(&IM(ch[ah+i+2*l1*ido]), &RE(ch[ah+i+2*l1*ido]),
- IM(c3), RE(c3), RE(wa2[i]), IM(wa2[i]));
- ComplexMult(&IM(ch[ah+i+3*l1*ido]), &RE(ch[ah+i+3*l1*ido]),
- IM(c4), RE(c4), RE(wa3[i]), IM(wa3[i]));
-#endif
- }
- }
- }
-}
-
-static void passf5(const uint16_t ido, const uint16_t l1, const complex_t *cc,
- complex_t *ch, const complex_t *wa1, const complex_t *wa2, const complex_t *wa3,
- const complex_t *wa4, const int8_t isign)
-{
- static real_t tr11 = FRAC_CONST(0.309016994374947);
- static real_t ti11 = FRAC_CONST(0.951056516295154);
- static real_t tr12 = FRAC_CONST(-0.809016994374947);
- static real_t ti12 = FRAC_CONST(0.587785252292473);
- uint16_t i, k, ac, ah;
- complex_t c2, c3, c4, c5, d3, d4, d5, d2, t2, t3, t4, t5;
-
- if (ido == 1)
- {
- if (isign == 1)
- {
- for (k = 0; k < l1; k++)
- {
- ac = 5*k + 1;
- ah = k;
-
- RE(t2) = RE(cc[ac]) + RE(cc[ac+3]);
- IM(t2) = IM(cc[ac]) + IM(cc[ac+3]);
- RE(t3) = RE(cc[ac+1]) + RE(cc[ac+2]);
- IM(t3) = IM(cc[ac+1]) + IM(cc[ac+2]);
- RE(t4) = RE(cc[ac+1]) - RE(cc[ac+2]);
- IM(t4) = IM(cc[ac+1]) - IM(cc[ac+2]);
- RE(t5) = RE(cc[ac]) - RE(cc[ac+3]);
- IM(t5) = IM(cc[ac]) - IM(cc[ac+3]);
-
- RE(ch[ah]) = RE(cc[ac-1]) + RE(t2) + RE(t3);
- IM(ch[ah]) = IM(cc[ac-1]) + IM(t2) + IM(t3);
-
- RE(c2) = RE(cc[ac-1]) + MUL_F(RE(t2),tr11) + MUL_F(RE(t3),tr12);
- IM(c2) = IM(cc[ac-1]) + MUL_F(IM(t2),tr11) + MUL_F(IM(t3),tr12);
- RE(c3) = RE(cc[ac-1]) + MUL_F(RE(t2),tr12) + MUL_F(RE(t3),tr11);
- IM(c3) = IM(cc[ac-1]) + MUL_F(IM(t2),tr12) + MUL_F(IM(t3),tr11);
-
- ComplexMult(&RE(c5), &RE(c4),
- ti11, ti12, RE(t5), RE(t4));
- ComplexMult(&IM(c5), &IM(c4),
- ti11, ti12, IM(t5), IM(t4));
-
- RE(ch[ah+l1]) = RE(c2) - IM(c5);
- IM(ch[ah+l1]) = IM(c2) + RE(c5);
- RE(ch[ah+2*l1]) = RE(c3) - IM(c4);
- IM(ch[ah+2*l1]) = IM(c3) + RE(c4);
- RE(ch[ah+3*l1]) = RE(c3) + IM(c4);
- IM(ch[ah+3*l1]) = IM(c3) - RE(c4);
- RE(ch[ah+4*l1]) = RE(c2) + IM(c5);
- IM(ch[ah+4*l1]) = IM(c2) - RE(c5);
- }
- } else {
- for (k = 0; k < l1; k++)
- {
- ac = 5*k + 1;
- ah = k;
-
- RE(t2) = RE(cc[ac]) + RE(cc[ac+3]);
- IM(t2) = IM(cc[ac]) + IM(cc[ac+3]);
- RE(t3) = RE(cc[ac+1]) + RE(cc[ac+2]);
- IM(t3) = IM(cc[ac+1]) + IM(cc[ac+2]);
- RE(t4) = RE(cc[ac+1]) - RE(cc[ac+2]);
- IM(t4) = IM(cc[ac+1]) - IM(cc[ac+2]);
- RE(t5) = RE(cc[ac]) - RE(cc[ac+3]);
- IM(t5) = IM(cc[ac]) - IM(cc[ac+3]);
-
- RE(ch[ah]) = RE(cc[ac-1]) + RE(t2) + RE(t3);
- IM(ch[ah]) = IM(cc[ac-1]) + IM(t2) + IM(t3);
-
- RE(c2) = RE(cc[ac-1]) + MUL_F(RE(t2),tr11) + MUL_F(RE(t3),tr12);
- IM(c2) = IM(cc[ac-1]) + MUL_F(IM(t2),tr11) + MUL_F(IM(t3),tr12);
- RE(c3) = RE(cc[ac-1]) + MUL_F(RE(t2),tr12) + MUL_F(RE(t3),tr11);
- IM(c3) = IM(cc[ac-1]) + MUL_F(IM(t2),tr12) + MUL_F(IM(t3),tr11);
-
- ComplexMult(&RE(c4), &RE(c5),
- ti12, ti11, RE(t5), RE(t4));
- ComplexMult(&IM(c4), &IM(c5),
- ti12, ti12, IM(t5), IM(t4));
-
- RE(ch[ah+l1]) = RE(c2) + IM(c5);
- IM(ch[ah+l1]) = IM(c2) - RE(c5);
- RE(ch[ah+2*l1]) = RE(c3) + IM(c4);
- IM(ch[ah+2*l1]) = IM(c3) - RE(c4);
- RE(ch[ah+3*l1]) = RE(c3) - IM(c4);
- IM(ch[ah+3*l1]) = IM(c3) + RE(c4);
- RE(ch[ah+4*l1]) = RE(c2) - IM(c5);
- IM(ch[ah+4*l1]) = IM(c2) + RE(c5);
- }
- }
- } else {
- if (isign == 1)
- {
- for (k = 0; k < l1; k++)
- {
- for (i = 0; i < ido; i++)
- {
- ac = i + (k*5 + 1) * ido;
- ah = i + k * ido;
-
- RE(t2) = RE(cc[ac]) + RE(cc[ac+3*ido]);
- IM(t2) = IM(cc[ac]) + IM(cc[ac+3*ido]);
- RE(t3) = RE(cc[ac+ido]) + RE(cc[ac+2*ido]);
- IM(t3) = IM(cc[ac+ido]) + IM(cc[ac+2*ido]);
- RE(t4) = RE(cc[ac+ido]) - RE(cc[ac+2*ido]);
- IM(t4) = IM(cc[ac+ido]) - IM(cc[ac+2*ido]);
- RE(t5) = RE(cc[ac]) - RE(cc[ac+3*ido]);
- IM(t5) = IM(cc[ac]) - IM(cc[ac+3*ido]);
-
- RE(ch[ah]) = RE(cc[ac-ido]) + RE(t2) + RE(t3);
- IM(ch[ah]) = IM(cc[ac-ido]) + IM(t2) + IM(t3);
-
- RE(c2) = RE(cc[ac-ido]) + MUL_F(RE(t2),tr11) + MUL_F(RE(t3),tr12);
- IM(c2) = IM(cc[ac-ido]) + MUL_F(IM(t2),tr11) + MUL_F(IM(t3),tr12);
- RE(c3) = RE(cc[ac-ido]) + MUL_F(RE(t2),tr12) + MUL_F(RE(t3),tr11);
- IM(c3) = IM(cc[ac-ido]) + MUL_F(IM(t2),tr12) + MUL_F(IM(t3),tr11);
-
- ComplexMult(&RE(c5), &RE(c4),
- ti11, ti12, RE(t5), RE(t4));
- ComplexMult(&IM(c5), &IM(c4),
- ti11, ti12, IM(t5), IM(t4));
-
- IM(d2) = IM(c2) + RE(c5);
- IM(d3) = IM(c3) + RE(c4);
- RE(d4) = RE(c3) + IM(c4);
- RE(d5) = RE(c2) + IM(c5);
- RE(d2) = RE(c2) - IM(c5);
- IM(d5) = IM(c2) - RE(c5);
- RE(d3) = RE(c3) - IM(c4);
- IM(d4) = IM(c3) - RE(c4);
-
-#if 1
- ComplexMult(&IM(ch[ah+l1*ido]), &RE(ch[ah+l1*ido]),
- IM(d2), RE(d2), RE(wa1[i]), IM(wa1[i]));
- ComplexMult(&IM(ch[ah+2*l1*ido]), &RE(ch[ah+2*l1*ido]),
- IM(d3), RE(d3), RE(wa2[i]), IM(wa2[i]));
- ComplexMult(&IM(ch[ah+3*l1*ido]), &RE(ch[ah+3*l1*ido]),
- IM(d4), RE(d4), RE(wa3[i]), IM(wa3[i]));
- ComplexMult(&IM(ch[ah+4*l1*ido]), &RE(ch[ah+4*l1*ido]),
- IM(d5), RE(d5), RE(wa4[i]), IM(wa4[i]));
-#else
- ComplexMult(&RE(ch[ah+l1*ido]), &IM(ch[ah+l1*ido]),
- RE(d2), IM(d2), RE(wa1[i]), IM(wa1[i]));
- ComplexMult(&RE(ch[ah+2*l1*ido]), &IM(ch[ah+2*l1*ido]),
- RE(d3), IM(d3), RE(wa2[i]), IM(wa2[i]));
- ComplexMult(&RE(ch[ah+3*l1*ido]), &IM(ch[ah+3*l1*ido]),
- RE(d4), IM(d4), RE(wa3[i]), IM(wa3[i]));
- ComplexMult(&RE(ch[ah+4*l1*ido]), &IM(ch[ah+4*l1*ido]),
- RE(d5), IM(d5), RE(wa4[i]), IM(wa4[i]));
-#endif
- }
- }
- } else {
- for (k = 0; k < l1; k++)
- {
- for (i = 0; i < ido; i++)
- {
- ac = i + (k*5 + 1) * ido;
- ah = i + k * ido;
-
- RE(t2) = RE(cc[ac]) + RE(cc[ac+3*ido]);
- IM(t2) = IM(cc[ac]) + IM(cc[ac+3*ido]);
- RE(t3) = RE(cc[ac+ido]) + RE(cc[ac+2*ido]);
- IM(t3) = IM(cc[ac+ido]) + IM(cc[ac+2*ido]);
- RE(t4) = RE(cc[ac+ido]) - RE(cc[ac+2*ido]);
- IM(t4) = IM(cc[ac+ido]) - IM(cc[ac+2*ido]);
- RE(t5) = RE(cc[ac]) - RE(cc[ac+3*ido]);
- IM(t5) = IM(cc[ac]) - IM(cc[ac+3*ido]);
-
- RE(ch[ah]) = RE(cc[ac-ido]) + RE(t2) + RE(t3);
- IM(ch[ah]) = IM(cc[ac-ido]) + IM(t2) + IM(t3);
-
- RE(c2) = RE(cc[ac-ido]) + MUL_F(RE(t2),tr11) + MUL_F(RE(t3),tr12);
- IM(c2) = IM(cc[ac-ido]) + MUL_F(IM(t2),tr11) + MUL_F(IM(t3),tr12);
- RE(c3) = RE(cc[ac-ido]) + MUL_F(RE(t2),tr12) + MUL_F(RE(t3),tr11);
- IM(c3) = IM(cc[ac-ido]) + MUL_F(IM(t2),tr12) + MUL_F(IM(t3),tr11);
-
- ComplexMult(&RE(c4), &RE(c5),
- ti12, ti11, RE(t5), RE(t4));
- ComplexMult(&IM(c4), &IM(c5),
- ti12, ti12, IM(t5), IM(t4));
-
- IM(d2) = IM(c2) - RE(c5);
- IM(d3) = IM(c3) - RE(c4);
- RE(d4) = RE(c3) - IM(c4);
- RE(d5) = RE(c2) - IM(c5);
- RE(d2) = RE(c2) + IM(c5);
- IM(d5) = IM(c2) + RE(c5);
- RE(d3) = RE(c3) + IM(c4);
- IM(d4) = IM(c3) + RE(c4);
-
-#if 1
- ComplexMult(&RE(ch[ah+l1*ido]), &IM(ch[ah+l1*ido]),
- RE(d2), IM(d2), RE(wa1[i]), IM(wa1[i]));
- ComplexMult(&RE(ch[ah+2*l1*ido]), &IM(ch[ah+2*l1*ido]),
- RE(d3), IM(d3), RE(wa2[i]), IM(wa2[i]));
- ComplexMult(&RE(ch[ah+3*l1*ido]), &IM(ch[ah+3*l1*ido]),
- RE(d4), IM(d4), RE(wa3[i]), IM(wa3[i]));
- ComplexMult(&RE(ch[ah+4*l1*ido]), &IM(ch[ah+4*l1*ido]),
- RE(d5), IM(d5), RE(wa4[i]), IM(wa4[i]));
-#else
- ComplexMult(&IM(ch[ah+l1*ido]), &RE(ch[ah+l1*ido]),
- IM(d2), RE(d2), RE(wa1[i]), IM(wa1[i]));
- ComplexMult(&IM(ch[ah+2*l1*ido]), &RE(ch[ah+2*l1*ido]),
- IM(d3), RE(d3), RE(wa2[i]), IM(wa2[i]));
- ComplexMult(&IM(ch[ah+3*l1*ido]), &RE(ch[ah+3*l1*ido]),
- IM(d4), RE(d4), RE(wa3[i]), IM(wa3[i]));
- ComplexMult(&IM(ch[ah+4*l1*ido]), &RE(ch[ah+4*l1*ido]),
- IM(d5), RE(d5), RE(wa4[i]), IM(wa4[i]));
-#endif
- }
- }
- }
- }
-}
-
-
-/*----------------------------------------------------------------------
- cfftf1, cfftf, cfftb, cffti1, cffti. Complex FFTs.
- ----------------------------------------------------------------------*/
-
-static INLINE void cfftf1pos(uint16_t n, complex_t *c, complex_t *ch,
- const uint16_t *ifac, const complex_t *wa,
- const int8_t isign)
-{
- uint16_t i;
- uint16_t k1, l1, l2;
- uint16_t na, nf, ip, iw, ix2, ix3, ix4, ido, idl1;
-
- nf = ifac[1];
- na = 0;
- l1 = 1;
- iw = 0;
-
- for (k1 = 2; k1 <= nf+1; k1++)
- {
- ip = ifac[k1];
- l2 = ip*l1;
- ido = n / l2;
- idl1 = ido*l1;
-
- switch (ip)
- {
- case 4:
- ix2 = iw + ido;
- ix3 = ix2 + ido;
-
- if (na == 0)
- passf4pos((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], &wa[ix3]);
- else
- passf4pos((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], &wa[ix3]);
-
- na = 1 - na;
- break;
- case 2:
- if (na == 0)
- passf2pos((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw]);
- else
- passf2pos((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw]);
-
- na = 1 - na;
- break;
- case 3:
- ix2 = iw + ido;
-
- if (na == 0)
- passf3((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], isign);
- else
- passf3((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], isign);
-
- na = 1 - na;
- break;
- case 5:
- ix2 = iw + ido;
- ix3 = ix2 + ido;
- ix4 = ix3 + ido;
-
- if (na == 0)
- passf5((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], &wa[ix3], &wa[ix4], isign);
- else
- passf5((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], &wa[ix3], &wa[ix4], isign);
-
- na = 1 - na;
- break;
- }
-
- l1 = l2;
- iw += (ip-1) * ido;
- }
-
- if (na == 0)
- return;
-
- for (i = 0; i < n; i++)
- {
- RE(c[i]) = RE(ch[i]);
- IM(c[i]) = IM(ch[i]);
- }
-}
-
-static INLINE void cfftf1neg(uint16_t n, complex_t *c, complex_t *ch,
- const uint16_t *ifac, const complex_t *wa,
- const int8_t isign)
-{
- uint16_t i;
- uint16_t k1, l1, l2;
- uint16_t na, nf, ip, iw, ix2, ix3, ix4, ido, idl1;
-
- nf = ifac[1];
- na = 0;
- l1 = 1;
- iw = 0;
-
- for (k1 = 2; k1 <= nf+1; k1++)
- {
- ip = ifac[k1];
- l2 = ip*l1;
- ido = n / l2;
- idl1 = ido*l1;
-
- switch (ip)
- {
- case 4:
- ix2 = iw + ido;
- ix3 = ix2 + ido;
-
- if (na == 0)
- passf4neg((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], &wa[ix3]);
- else
- passf4neg((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], &wa[ix3]);
-
- na = 1 - na;
- break;
- case 2:
- if (na == 0)
- passf2neg((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw]);
- else
- passf2neg((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw]);
-
- na = 1 - na;
- break;
- case 3:
- ix2 = iw + ido;
-
- if (na == 0)
- passf3((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], isign);
- else
- passf3((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], isign);
-
- na = 1 - na;
- break;
- case 5:
- ix2 = iw + ido;
- ix3 = ix2 + ido;
- ix4 = ix3 + ido;
-
- if (na == 0)
- passf5((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], &wa[ix3], &wa[ix4], isign);
- else
- passf5((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], &wa[ix3], &wa[ix4], isign);
-
- na = 1 - na;
- break;
- }
-
- l1 = l2;
- iw += (ip-1) * ido;
- }
-
- if (na == 0)
- return;
-
- for (i = 0; i < n; i++)
- {
- RE(c[i]) = RE(ch[i]);
- IM(c[i]) = IM(ch[i]);
- }
-}
-
-void cfftf(cfft_info *cfft, complex_t *c)
-{
- cfftf1neg(cfft->n, c, cfft->work, (const uint16_t*)cfft->ifac, (const complex_t*)cfft->tab, -1);
-}
-
-void cfftb(cfft_info *cfft, complex_t *c)
-{
- cfftf1pos(cfft->n, c, cfft->work, (const uint16_t*)cfft->ifac, (const complex_t*)cfft->tab, +1);
-}
-
-static void cffti1(uint16_t n, complex_t *wa, uint16_t *ifac)
-{
- static uint16_t ntryh[4] = {3, 4, 2, 5};
-#ifndef FIXED_POINT
- real_t arg, argh, argld, fi;
- uint16_t ido, ipm;
- uint16_t i1, k1, l1, l2;
- uint16_t ld, ii, ip;
-#endif
- uint16_t ntry = 0, i, j;
- uint16_t ib;
- uint16_t nf, nl, nq, nr;
-
- nl = n;
- nf = 0;
- j = 0;
-
-startloop:
- j++;
-
- if (j <= 4)
- ntry = ntryh[j-1];
- else
- ntry += 2;
-
- do
- {
- nq = nl / ntry;
- nr = nl - ntry*nq;
-
- if (nr != 0)
- goto startloop;
-
- nf++;
- ifac[nf+1] = ntry;
- nl = nq;
-
- if (ntry == 2 && nf != 1)
- {
- for (i = 2; i <= nf; i++)
- {
- ib = nf - i + 2;
- ifac[ib+1] = ifac[ib];
- }
- ifac[2] = 2;
- }
- } while (nl != 1);
-
- ifac[0] = n;
- ifac[1] = nf;
-
-#ifndef FIXED_POINT
- argh = (real_t)2.0*(real_t)M_PI / (real_t)n;
- i = 0;
- l1 = 1;
-
- for (k1 = 1; k1 <= nf; k1++)
- {
- ip = ifac[k1+1];
- ld = 0;
- l2 = l1*ip;
- ido = n / l2;
- ipm = ip - 1;
-
- for (j = 0; j < ipm; j++)
- {
- i1 = i;
- RE(wa[i]) = 1.0;
- IM(wa[i]) = 0.0;
- ld += l1;
- fi = 0;
- argld = ld*argh;
-
- for (ii = 0; ii < ido; ii++)
- {
- i++;
- fi++;
- arg = fi * argld;
- RE(wa[i]) = (real_t)cos(arg);
-#if 1
- IM(wa[i]) = (real_t)sin(arg);
-#else
- IM(wa[i]) = (real_t)-sin(arg);
-#endif
- }
-
- if (ip > 5)
- {
- RE(wa[i1]) = RE(wa[i]);
- IM(wa[i1]) = IM(wa[i]);
- }
- }
- l1 = l2;
- }
-#endif
-}
-
-cfft_info *cffti(uint16_t n)
-{
- cfft_info *cfft = (cfft_info*)faad_malloc(sizeof(cfft_info));
-
- cfft->n = n;
- cfft->work = (complex_t*)faad_malloc(n*sizeof(complex_t));
-
-#ifndef FIXED_POINT
- cfft->tab = (complex_t*)faad_malloc(n*sizeof(complex_t));
-
- cffti1(n, cfft->tab, cfft->ifac);
-#else
- cffti1(n, NULL, cfft->ifac);
-
- switch (n)
- {
- case 64: cfft->tab = (complex_t*)cfft_tab_64; break;
- case 512: cfft->tab = (complex_t*)cfft_tab_512; break;
-#ifdef LD_DEC
- case 256: cfft->tab = (complex_t*)cfft_tab_256; break;
-#endif
-
-#ifdef ALLOW_SMALL_FRAMELENGTH
- case 60: cfft->tab = (complex_t*)cfft_tab_60; break;
- case 480: cfft->tab = (complex_t*)cfft_tab_480; break;
-#ifdef LD_DEC
- case 240: cfft->tab = (complex_t*)cfft_tab_240; break;
-#endif
-#endif
- case 128: cfft->tab = (complex_t*)cfft_tab_128; break;
- }
-#endif
-
- return cfft;
-}
-
-void cfftu(cfft_info *cfft)
-{
- if ( ! cfft ) return;
-
- faad_free(cfft->work);
-#ifndef FIXED_POINT
- faad_free(cfft->tab);
-#endif
-
- faad_free(cfft);
-}
-
diff --git a/src/libfaad/cfft.h b/src/libfaad/cfft.h
deleted file mode 100644
index a29537bed..000000000
--- a/src/libfaad/cfft.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: cfft.h,v 1.9 2005/10/29 23:57:06 tmmm Exp $
-**/
-
-#ifndef __CFFT_H__
-#define __CFFT_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct
-{
- uint16_t n;
- uint16_t ifac[15];
- complex_t *work;
- complex_t *tab;
-} cfft_info;
-
-
-void cfftf(cfft_info *cfft, complex_t *c);
-void cfftb(cfft_info *cfft, complex_t *c);
-cfft_info *cffti(uint16_t n);
-void cfftu(cfft_info *cfft);
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/libfaad/cfft_tab.h b/src/libfaad/cfft_tab.h
deleted file mode 100644
index 072a991f1..000000000
--- a/src/libfaad/cfft_tab.h
+++ /dev/null
@@ -1,1820 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: cfft_tab.h,v 1.6 2005/10/29 23:57:06 tmmm Exp $
-**/
-
-#ifndef __CFFT_TAB_H__
-#define __CFFT_TAB_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef FIXED_POINT
-
-ALIGN static const complex_t cfft_tab_512[] =
-{
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.999924719333649), FRAC_CONST(0.012271538376808) },
- { FRAC_CONST(0.999698817729950), FRAC_CONST(0.024541229009628) },
- { FRAC_CONST(0.999322354793549), FRAC_CONST(0.036807224154472) },
- { FRAC_CONST(0.998795449733734), FRAC_CONST(0.049067676067352) },
- { FRAC_CONST(0.998118102550507), FRAC_CONST(0.061320740729570) },
- { FRAC_CONST(0.997290432453156), FRAC_CONST(0.073564566671848) },
- { FRAC_CONST(0.996312618255615), FRAC_CONST(0.085797317326069) },
- { FRAC_CONST(0.995184719562531), FRAC_CONST(0.098017141222954) },
- { FRAC_CONST(0.993906974792480), FRAC_CONST(0.110222205519676) },
- { FRAC_CONST(0.992479562759399), FRAC_CONST(0.122410677373409) },
- { FRAC_CONST(0.990902662277222), FRAC_CONST(0.134580716490746) },
- { FRAC_CONST(0.989176511764526), FRAC_CONST(0.146730467677116) },
- { FRAC_CONST(0.987301409244537), FRAC_CONST(0.158858150243759) },
- { FRAC_CONST(0.985277652740479), FRAC_CONST(0.170961901545525) },
- { FRAC_CONST(0.983105480670929), FRAC_CONST(0.183039888739586) },
- { FRAC_CONST(0.980785250663757), FRAC_CONST(0.195090323686600) },
- { FRAC_CONST(0.978317379951477), FRAC_CONST(0.207111388444901) },
- { FRAC_CONST(0.975702106952667), FRAC_CONST(0.219101235270500) },
- { FRAC_CONST(0.972939968109131), FRAC_CONST(0.231058120727539) },
- { FRAC_CONST(0.970031261444092), FRAC_CONST(0.242980197072029) },
- { FRAC_CONST(0.966976463794708), FRAC_CONST(0.254865676164627) },
- { FRAC_CONST(0.963776051998138), FRAC_CONST(0.266712784767151) },
- { FRAC_CONST(0.960430502891541), FRAC_CONST(0.278519690036774) },
- { FRAC_CONST(0.956940352916718), FRAC_CONST(0.290284663438797) },
- { FRAC_CONST(0.953306019306183), FRAC_CONST(0.302005946636200) },
- { FRAC_CONST(0.949528157711029), FRAC_CONST(0.313681751489639) },
- { FRAC_CONST(0.945607304573059), FRAC_CONST(0.325310319662094) },
- { FRAC_CONST(0.941544055938721), FRAC_CONST(0.336889863014221) },
- { FRAC_CONST(0.937339007854462), FRAC_CONST(0.348418682813644) },
- { FRAC_CONST(0.932992815971375), FRAC_CONST(0.359895050525665) },
- { FRAC_CONST(0.928506076335907), FRAC_CONST(0.371317207813263) },
- { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
- { FRAC_CONST(0.919113874435425), FRAC_CONST(0.393992066383362) },
- { FRAC_CONST(0.914209723472595), FRAC_CONST(0.405241340398788) },
- { FRAC_CONST(0.909167945384979), FRAC_CONST(0.416429579257965) },
- { FRAC_CONST(0.903989315032959), FRAC_CONST(0.427555084228516) },
- { FRAC_CONST(0.898674488067627), FRAC_CONST(0.438616245985031) },
- { FRAC_CONST(0.893224298954010), FRAC_CONST(0.449611335992813) },
- { FRAC_CONST(0.887639641761780), FRAC_CONST(0.460538715124130) },
- { FRAC_CONST(0.881921231746674), FRAC_CONST(0.471396744251251) },
- { FRAC_CONST(0.876070082187653), FRAC_CONST(0.482183754444122) },
- { FRAC_CONST(0.870086967945099), FRAC_CONST(0.492898225784302) },
- { FRAC_CONST(0.863972842693329), FRAC_CONST(0.503538370132446) },
- { FRAC_CONST(0.857728600502014), FRAC_CONST(0.514102756977081) },
- { FRAC_CONST(0.851355195045471), FRAC_CONST(0.524589717388153) },
- { FRAC_CONST(0.844853579998016), FRAC_CONST(0.534997642040253) },
- { FRAC_CONST(0.838224709033966), FRAC_CONST(0.545324981212616) },
- { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
- { FRAC_CONST(0.824589252471924), FRAC_CONST(0.565731823444366) },
- { FRAC_CONST(0.817584812641144), FRAC_CONST(0.575808227062225) },
- { FRAC_CONST(0.810457170009613), FRAC_CONST(0.585797905921936) },
- { FRAC_CONST(0.803207516670227), FRAC_CONST(0.595699310302734) },
- { FRAC_CONST(0.795836925506592), FRAC_CONST(0.605511009693146) },
- { FRAC_CONST(0.788346409797668), FRAC_CONST(0.615231633186340) },
- { FRAC_CONST(0.780737221240997), FRAC_CONST(0.624859511852264) },
- { FRAC_CONST(0.773010432720184), FRAC_CONST(0.634393334388733) },
- { FRAC_CONST(0.765167236328125), FRAC_CONST(0.643831551074982) },
- { FRAC_CONST(0.757208824157715), FRAC_CONST(0.653172850608826) },
- { FRAC_CONST(0.749136388301849), FRAC_CONST(0.662415802478790) },
- { FRAC_CONST(0.740951120853424), FRAC_CONST(0.671558976173401) },
- { FRAC_CONST(0.732654273509979), FRAC_CONST(0.680601000785828) },
- { FRAC_CONST(0.724247097969055), FRAC_CONST(0.689540565013886) },
- { FRAC_CONST(0.715730786323547), FRAC_CONST(0.698376297950745) },
- { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(0.698376238346100), FRAC_CONST(0.715730845928192) },
- { FRAC_CONST(0.689540505409241), FRAC_CONST(0.724247097969055) },
- { FRAC_CONST(0.680601000785828), FRAC_CONST(0.732654273509979) },
- { FRAC_CONST(0.671558916568756), FRAC_CONST(0.740951180458069) },
- { FRAC_CONST(0.662415742874146), FRAC_CONST(0.749136388301849) },
- { FRAC_CONST(0.653172791004181), FRAC_CONST(0.757208883762360) },
- { FRAC_CONST(0.643831551074982), FRAC_CONST(0.765167295932770) },
- { FRAC_CONST(0.634393274784088), FRAC_CONST(0.773010432720184) },
- { FRAC_CONST(0.624859452247620), FRAC_CONST(0.780737280845642) },
- { FRAC_CONST(0.615231573581696), FRAC_CONST(0.788346409797668) },
- { FRAC_CONST(0.605511009693146), FRAC_CONST(0.795836925506592) },
- { FRAC_CONST(0.595699310302734), FRAC_CONST(0.803207516670227) },
- { FRAC_CONST(0.585797846317291), FRAC_CONST(0.810457170009613) },
- { FRAC_CONST(0.575808167457581), FRAC_CONST(0.817584812641144) },
- { FRAC_CONST(0.565731823444366), FRAC_CONST(0.824589312076569) },
- { FRAC_CONST(0.555570185184479), FRAC_CONST(0.831469655036926) },
- { FRAC_CONST(0.545324981212616), FRAC_CONST(0.838224709033966) },
- { FRAC_CONST(0.534997642040253), FRAC_CONST(0.844853579998016) },
- { FRAC_CONST(0.524589657783508), FRAC_CONST(0.851355195045471) },
- { FRAC_CONST(0.514102697372437), FRAC_CONST(0.857728660106659) },
- { FRAC_CONST(0.503538429737091), FRAC_CONST(0.863972842693329) },
- { FRAC_CONST(0.492898195981979), FRAC_CONST(0.870086967945099) },
- { FRAC_CONST(0.482183724641800), FRAC_CONST(0.876070141792297) },
- { FRAC_CONST(0.471396654844284), FRAC_CONST(0.881921291351318) },
- { FRAC_CONST(0.460538715124130), FRAC_CONST(0.887639641761780) },
- { FRAC_CONST(0.449611306190491), FRAC_CONST(0.893224298954010) },
- { FRAC_CONST(0.438616186380386), FRAC_CONST(0.898674488067627) },
- { FRAC_CONST(0.427555114030838), FRAC_CONST(0.903989315032959) },
- { FRAC_CONST(0.416429549455643), FRAC_CONST(0.909168004989624) },
- { FRAC_CONST(0.405241280794144), FRAC_CONST(0.914209783077240) },
- { FRAC_CONST(0.393991947174072), FRAC_CONST(0.919113874435425) },
- { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(0.371317148208618), FRAC_CONST(0.928506076335907) },
- { FRAC_CONST(0.359894961118698), FRAC_CONST(0.932992815971375) },
- { FRAC_CONST(0.348418682813644), FRAC_CONST(0.937339007854462) },
- { FRAC_CONST(0.336889833211899), FRAC_CONST(0.941544055938721) },
- { FRAC_CONST(0.325310230255127), FRAC_CONST(0.945607364177704) },
- { FRAC_CONST(0.313681662082672), FRAC_CONST(0.949528217315674) },
- { FRAC_CONST(0.302005946636200), FRAC_CONST(0.953306019306183) },
- { FRAC_CONST(0.290284633636475), FRAC_CONST(0.956940352916718) },
- { FRAC_CONST(0.278519600629807), FRAC_CONST(0.960430562496185) },
- { FRAC_CONST(0.266712754964828), FRAC_CONST(0.963776051998138) },
- { FRAC_CONST(0.254865646362305), FRAC_CONST(0.966976463794708) },
- { FRAC_CONST(0.242980122566223), FRAC_CONST(0.970031261444092) },
- { FRAC_CONST(0.231058135628700), FRAC_CONST(0.972939968109131) },
- { FRAC_CONST(0.219101220369339), FRAC_CONST(0.975702106952667) },
- { FRAC_CONST(0.207111328840256), FRAC_CONST(0.978317379951477) },
- { FRAC_CONST(0.195090234279633), FRAC_CONST(0.980785310268402) },
- { FRAC_CONST(0.183039888739586), FRAC_CONST(0.983105480670929) },
- { FRAC_CONST(0.170961856842041), FRAC_CONST(0.985277652740479) },
- { FRAC_CONST(0.158858075737953), FRAC_CONST(0.987301409244537) },
- { FRAC_CONST(0.146730497479439), FRAC_CONST(0.989176511764526) },
- { FRAC_CONST(0.134580686688423), FRAC_CONST(0.990902662277222) },
- { FRAC_CONST(0.122410625219345), FRAC_CONST(0.992479562759399) },
- { FRAC_CONST(0.110222116112709), FRAC_CONST(0.993906974792480) },
- { FRAC_CONST(0.098017133772373), FRAC_CONST(0.995184719562531) },
- { FRAC_CONST(0.085797272622585), FRAC_CONST(0.996312618255615) },
- { FRAC_CONST(0.073564492166042), FRAC_CONST(0.997290432453156) },
- { FRAC_CONST(0.061320748180151), FRAC_CONST(0.998118102550507) },
- { FRAC_CONST(0.049067649990320), FRAC_CONST(0.998795449733734) },
- { FRAC_CONST(0.036807164549828), FRAC_CONST(0.999322414398193) },
- { FRAC_CONST(0.024541135877371), FRAC_CONST(0.999698817729950) },
- { FRAC_CONST(0.012271529063582), FRAC_CONST(0.999924719333649) },
- { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
- { FRAC_CONST(-0.012271616607904), FRAC_CONST(0.999924719333649) },
- { FRAC_CONST(-0.024541223421693), FRAC_CONST(0.999698817729950) },
- { FRAC_CONST(-0.036807250231504), FRAC_CONST(0.999322354793549) },
- { FRAC_CONST(-0.049067739397287), FRAC_CONST(0.998795449733734) },
- { FRAC_CONST(-0.061320833861828), FRAC_CONST(0.998118102550507) },
- { FRAC_CONST(-0.073564574122429), FRAC_CONST(0.997290432453156) },
- { FRAC_CONST(-0.085797362029552), FRAC_CONST(0.996312618255615) },
- { FRAC_CONST(-0.098017223179340), FRAC_CONST(0.995184719562531) },
- { FRAC_CONST(-0.110222205519676), FRAC_CONST(0.993906974792480) },
- { FRAC_CONST(-0.122410707175732), FRAC_CONST(0.992479503154755) },
- { FRAC_CONST(-0.134580776095390), FRAC_CONST(0.990902602672577) },
- { FRAC_CONST(-0.146730571985245), FRAC_CONST(0.989176511764526) },
- { FRAC_CONST(-0.158858165144920), FRAC_CONST(0.987301409244537) },
- { FRAC_CONST(-0.170961946249008), FRAC_CONST(0.985277652740479) },
- { FRAC_CONST(-0.183039978146553), FRAC_CONST(0.983105480670929) },
- { FRAC_CONST(-0.195090323686600), FRAC_CONST(0.980785250663757) },
- { FRAC_CONST(-0.207111418247223), FRAC_CONST(0.978317379951477) },
- { FRAC_CONST(-0.219101309776306), FRAC_CONST(0.975702106952667) },
- { FRAC_CONST(-0.231058210134506), FRAC_CONST(0.972939908504486) },
- { FRAC_CONST(-0.242980197072029), FRAC_CONST(0.970031261444092) },
- { FRAC_CONST(-0.254865705966949), FRAC_CONST(0.966976463794708) },
- { FRAC_CONST(-0.266712844371796), FRAC_CONST(0.963776051998138) },
- { FRAC_CONST(-0.278519690036774), FRAC_CONST(0.960430502891541) },
- { FRAC_CONST(-0.290284723043442), FRAC_CONST(0.956940293312073) },
- { FRAC_CONST(-0.302006036043167), FRAC_CONST(0.953306019306183) },
- { FRAC_CONST(-0.313681721687317), FRAC_CONST(0.949528157711029) },
- { FRAC_CONST(-0.325310319662094), FRAC_CONST(0.945607304573059) },
- { FRAC_CONST(-0.336889922618866), FRAC_CONST(0.941544055938721) },
- { FRAC_CONST(-0.348418772220612), FRAC_CONST(0.937338948249817) },
- { FRAC_CONST(-0.359895050525665), FRAC_CONST(0.932992815971375) },
- { FRAC_CONST(-0.371317237615585), FRAC_CONST(0.928506076335907) },
- { FRAC_CONST(-0.382683515548706), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(-0.393992036581039), FRAC_CONST(0.919113874435425) },
- { FRAC_CONST(-0.405241340398788), FRAC_CONST(0.914209723472595) },
- { FRAC_CONST(-0.416429519653320), FRAC_CONST(0.909168004989624) },
- { FRAC_CONST(-0.427555084228516), FRAC_CONST(0.903989315032959) },
- { FRAC_CONST(-0.438616245985031), FRAC_CONST(0.898674428462982) },
- { FRAC_CONST(-0.449611365795136), FRAC_CONST(0.893224298954010) },
- { FRAC_CONST(-0.460538804531097), FRAC_CONST(0.887639582157135) },
- { FRAC_CONST(-0.471396833658218), FRAC_CONST(0.881921231746674) },
- { FRAC_CONST(-0.482183903455734), FRAC_CONST(0.876070022583008) },
- { FRAC_CONST(-0.492898166179657), FRAC_CONST(0.870087027549744) },
- { FRAC_CONST(-0.503538370132446), FRAC_CONST(0.863972842693329) },
- { FRAC_CONST(-0.514102756977081), FRAC_CONST(0.857728600502014) },
- { FRAC_CONST(-0.524589717388153), FRAC_CONST(0.851355135440826) },
- { FRAC_CONST(-0.534997701644897), FRAC_CONST(0.844853520393372) },
- { FRAC_CONST(-0.545325100421906), FRAC_CONST(0.838224649429321) },
- { FRAC_CONST(-0.555570363998413), FRAC_CONST(0.831469535827637) },
- { FRAC_CONST(-0.565731763839722), FRAC_CONST(0.824589312076569) },
- { FRAC_CONST(-0.575808167457581), FRAC_CONST(0.817584812641144) },
- { FRAC_CONST(-0.585797905921936), FRAC_CONST(0.810457170009613) },
- { FRAC_CONST(-0.595699369907379), FRAC_CONST(0.803207516670227) },
- { FRAC_CONST(-0.605511128902435), FRAC_CONST(0.795836865901947) },
- { FRAC_CONST(-0.615231692790985), FRAC_CONST(0.788346350193024) },
- { FRAC_CONST(-0.624859631061554), FRAC_CONST(0.780737102031708) },
- { FRAC_CONST(-0.634393274784088), FRAC_CONST(0.773010492324829) },
- { FRAC_CONST(-0.643831551074982), FRAC_CONST(0.765167236328125) },
- { FRAC_CONST(-0.653172850608826), FRAC_CONST(0.757208824157715) },
- { FRAC_CONST(-0.662415802478790), FRAC_CONST(0.749136328697205) },
- { FRAC_CONST(-0.671559035778046), FRAC_CONST(0.740951061248779) },
- { FRAC_CONST(-0.680601119995117), FRAC_CONST(0.732654154300690) },
- { FRAC_CONST(-0.689540684223175), FRAC_CONST(0.724246978759766) },
- { FRAC_CONST(-0.698376238346100), FRAC_CONST(0.715730845928192) },
- { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(-0.715730845928192), FRAC_CONST(0.698376238346100) },
- { FRAC_CONST(-0.724247157573700), FRAC_CONST(0.689540505409241) },
- { FRAC_CONST(-0.732654333114624), FRAC_CONST(0.680600941181183) },
- { FRAC_CONST(-0.740951240062714), FRAC_CONST(0.671558856964111) },
- { FRAC_CONST(-0.749136507511139), FRAC_CONST(0.662415623664856) },
- { FRAC_CONST(-0.757208824157715), FRAC_CONST(0.653172850608826) },
- { FRAC_CONST(-0.765167295932770), FRAC_CONST(0.643831551074982) },
- { FRAC_CONST(-0.773010492324829), FRAC_CONST(0.634393274784088) },
- { FRAC_CONST(-0.780737280845642), FRAC_CONST(0.624859452247620) },
- { FRAC_CONST(-0.788346469402313), FRAC_CONST(0.615231513977051) },
- { FRAC_CONST(-0.795836985111237), FRAC_CONST(0.605510950088501) },
- { FRAC_CONST(-0.803207635879517), FRAC_CONST(0.595699131488800) },
- { FRAC_CONST(-0.810457170009613), FRAC_CONST(0.585797846317291) },
- { FRAC_CONST(-0.817584812641144), FRAC_CONST(0.575808167457581) },
- { FRAC_CONST(-0.824589312076569), FRAC_CONST(0.565731763839722) },
- { FRAC_CONST(-0.831469655036926), FRAC_CONST(0.555570185184479) },
- { FRAC_CONST(-0.838224768638611), FRAC_CONST(0.545324862003326) },
- { FRAC_CONST(-0.844853639602661), FRAC_CONST(0.534997463226318) },
- { FRAC_CONST(-0.851355314254761), FRAC_CONST(0.524589538574219) },
- { FRAC_CONST(-0.857728600502014), FRAC_CONST(0.514102756977081) },
- { FRAC_CONST(-0.863972842693329), FRAC_CONST(0.503538370132446) },
- { FRAC_CONST(-0.870087027549744), FRAC_CONST(0.492898136377335) },
- { FRAC_CONST(-0.876070141792297), FRAC_CONST(0.482183694839478) },
- { FRAC_CONST(-0.881921350955963), FRAC_CONST(0.471396625041962) },
- { FRAC_CONST(-0.887639701366425), FRAC_CONST(0.460538566112518) },
- { FRAC_CONST(-0.893224298954010), FRAC_CONST(0.449611365795136) },
- { FRAC_CONST(-0.898674488067627), FRAC_CONST(0.438616245985031) },
- { FRAC_CONST(-0.903989315032959), FRAC_CONST(0.427555054426193) },
- { FRAC_CONST(-0.909168004989624), FRAC_CONST(0.416429489850998) },
- { FRAC_CONST(-0.914209783077240), FRAC_CONST(0.405241221189499) },
- { FRAC_CONST(-0.919113874435425), FRAC_CONST(0.393991917371750) },
- { FRAC_CONST(-0.923879623413086), FRAC_CONST(0.382683277130127) },
- { FRAC_CONST(-0.928506076335907), FRAC_CONST(0.371317237615585) },
- { FRAC_CONST(-0.932992815971375), FRAC_CONST(0.359895050525665) },
- { FRAC_CONST(-0.937339007854462), FRAC_CONST(0.348418653011322) },
- { FRAC_CONST(-0.941544115543365), FRAC_CONST(0.336889803409576) },
- { FRAC_CONST(-0.945607364177704), FRAC_CONST(0.325310200452805) },
- { FRAC_CONST(-0.949528217315674), FRAC_CONST(0.313681602478027) },
- { FRAC_CONST(-0.953306078910828), FRAC_CONST(0.302005797624588) },
- { FRAC_CONST(-0.956940352916718), FRAC_CONST(0.290284723043442) },
- { FRAC_CONST(-0.960430502891541), FRAC_CONST(0.278519690036774) },
- { FRAC_CONST(-0.963776051998138), FRAC_CONST(0.266712725162506) },
- { FRAC_CONST(-0.966976463794708), FRAC_CONST(0.254865586757660) },
- { FRAC_CONST(-0.970031261444092), FRAC_CONST(0.242980077862740) },
- { FRAC_CONST(-0.972939968109131), FRAC_CONST(0.231057971715927) },
- { FRAC_CONST(-0.975702166557312), FRAC_CONST(0.219101071357727) },
- { FRAC_CONST(-0.978317379951477), FRAC_CONST(0.207111403346062) },
- { FRAC_CONST(-0.980785310268402), FRAC_CONST(0.195090308785439) },
- { FRAC_CONST(-0.983105480670929), FRAC_CONST(0.183039844036102) },
- { FRAC_CONST(-0.985277652740479), FRAC_CONST(0.170961812138557) },
- { FRAC_CONST(-0.987301409244537), FRAC_CONST(0.158858031034470) },
- { FRAC_CONST(-0.989176511764526), FRAC_CONST(0.146730333566666) },
- { FRAC_CONST(-0.990902662277222), FRAC_CONST(0.134580522775650) },
- { FRAC_CONST(-0.992479503154755), FRAC_CONST(0.122410699725151) },
- { FRAC_CONST(-0.993906974792480), FRAC_CONST(0.110222198069096) },
- { FRAC_CONST(-0.995184719562531), FRAC_CONST(0.098017096519470) },
- { FRAC_CONST(-0.996312618255615), FRAC_CONST(0.085797227919102) },
- { FRAC_CONST(-0.997290492057800), FRAC_CONST(0.073564447462559) },
- { FRAC_CONST(-0.998118102550507), FRAC_CONST(0.061320584267378) },
- { FRAC_CONST(-0.998795449733734), FRAC_CONST(0.049067486077547) },
- { FRAC_CONST(-0.999322354793549), FRAC_CONST(0.036807239055634) },
- { FRAC_CONST(-0.999698817729950), FRAC_CONST(0.024541210383177) },
- { FRAC_CONST(-0.999924719333649), FRAC_CONST(0.012271485291421) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.999698817729950), FRAC_CONST(0.024541229009628) },
- { FRAC_CONST(0.998795449733734), FRAC_CONST(0.049067676067352) },
- { FRAC_CONST(0.997290432453156), FRAC_CONST(0.073564566671848) },
- { FRAC_CONST(0.995184719562531), FRAC_CONST(0.098017141222954) },
- { FRAC_CONST(0.992479562759399), FRAC_CONST(0.122410677373409) },
- { FRAC_CONST(0.989176511764526), FRAC_CONST(0.146730467677116) },
- { FRAC_CONST(0.985277652740479), FRAC_CONST(0.170961901545525) },
- { FRAC_CONST(0.980785250663757), FRAC_CONST(0.195090323686600) },
- { FRAC_CONST(0.975702106952667), FRAC_CONST(0.219101235270500) },
- { FRAC_CONST(0.970031261444092), FRAC_CONST(0.242980197072029) },
- { FRAC_CONST(0.963776051998138), FRAC_CONST(0.266712784767151) },
- { FRAC_CONST(0.956940352916718), FRAC_CONST(0.290284663438797) },
- { FRAC_CONST(0.949528157711029), FRAC_CONST(0.313681751489639) },
- { FRAC_CONST(0.941544055938721), FRAC_CONST(0.336889863014221) },
- { FRAC_CONST(0.932992815971375), FRAC_CONST(0.359895050525665) },
- { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
- { FRAC_CONST(0.914209723472595), FRAC_CONST(0.405241340398788) },
- { FRAC_CONST(0.903989315032959), FRAC_CONST(0.427555084228516) },
- { FRAC_CONST(0.893224298954010), FRAC_CONST(0.449611335992813) },
- { FRAC_CONST(0.881921231746674), FRAC_CONST(0.471396744251251) },
- { FRAC_CONST(0.870086967945099), FRAC_CONST(0.492898225784302) },
- { FRAC_CONST(0.857728600502014), FRAC_CONST(0.514102756977081) },
- { FRAC_CONST(0.844853579998016), FRAC_CONST(0.534997642040253) },
- { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
- { FRAC_CONST(0.817584812641144), FRAC_CONST(0.575808227062225) },
- { FRAC_CONST(0.803207516670227), FRAC_CONST(0.595699310302734) },
- { FRAC_CONST(0.788346409797668), FRAC_CONST(0.615231633186340) },
- { FRAC_CONST(0.773010432720184), FRAC_CONST(0.634393334388733) },
- { FRAC_CONST(0.757208824157715), FRAC_CONST(0.653172850608826) },
- { FRAC_CONST(0.740951120853424), FRAC_CONST(0.671558976173401) },
- { FRAC_CONST(0.724247097969055), FRAC_CONST(0.689540565013886) },
- { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(0.689540505409241), FRAC_CONST(0.724247097969055) },
- { FRAC_CONST(0.671558916568756), FRAC_CONST(0.740951180458069) },
- { FRAC_CONST(0.653172791004181), FRAC_CONST(0.757208883762360) },
- { FRAC_CONST(0.634393274784088), FRAC_CONST(0.773010432720184) },
- { FRAC_CONST(0.615231573581696), FRAC_CONST(0.788346409797668) },
- { FRAC_CONST(0.595699310302734), FRAC_CONST(0.803207516670227) },
- { FRAC_CONST(0.575808167457581), FRAC_CONST(0.817584812641144) },
- { FRAC_CONST(0.555570185184479), FRAC_CONST(0.831469655036926) },
- { FRAC_CONST(0.534997642040253), FRAC_CONST(0.844853579998016) },
- { FRAC_CONST(0.514102697372437), FRAC_CONST(0.857728660106659) },
- { FRAC_CONST(0.492898195981979), FRAC_CONST(0.870086967945099) },
- { FRAC_CONST(0.471396654844284), FRAC_CONST(0.881921291351318) },
- { FRAC_CONST(0.449611306190491), FRAC_CONST(0.893224298954010) },
- { FRAC_CONST(0.427555114030838), FRAC_CONST(0.903989315032959) },
- { FRAC_CONST(0.405241280794144), FRAC_CONST(0.914209783077240) },
- { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(0.359894961118698), FRAC_CONST(0.932992815971375) },
- { FRAC_CONST(0.336889833211899), FRAC_CONST(0.941544055938721) },
- { FRAC_CONST(0.313681662082672), FRAC_CONST(0.949528217315674) },
- { FRAC_CONST(0.290284633636475), FRAC_CONST(0.956940352916718) },
- { FRAC_CONST(0.266712754964828), FRAC_CONST(0.963776051998138) },
- { FRAC_CONST(0.242980122566223), FRAC_CONST(0.970031261444092) },
- { FRAC_CONST(0.219101220369339), FRAC_CONST(0.975702106952667) },
- { FRAC_CONST(0.195090234279633), FRAC_CONST(0.980785310268402) },
- { FRAC_CONST(0.170961856842041), FRAC_CONST(0.985277652740479) },
- { FRAC_CONST(0.146730497479439), FRAC_CONST(0.989176511764526) },
- { FRAC_CONST(0.122410625219345), FRAC_CONST(0.992479562759399) },
- { FRAC_CONST(0.098017133772373), FRAC_CONST(0.995184719562531) },
- { FRAC_CONST(0.073564492166042), FRAC_CONST(0.997290432453156) },
- { FRAC_CONST(0.049067649990320), FRAC_CONST(0.998795449733734) },
- { FRAC_CONST(0.024541135877371), FRAC_CONST(0.999698817729950) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.998795449733734), FRAC_CONST(0.049067676067352) },
- { FRAC_CONST(0.995184719562531), FRAC_CONST(0.098017141222954) },
- { FRAC_CONST(0.989176511764526), FRAC_CONST(0.146730467677116) },
- { FRAC_CONST(0.980785250663757), FRAC_CONST(0.195090323686600) },
- { FRAC_CONST(0.970031261444092), FRAC_CONST(0.242980197072029) },
- { FRAC_CONST(0.956940352916718), FRAC_CONST(0.290284663438797) },
- { FRAC_CONST(0.941544055938721), FRAC_CONST(0.336889863014221) },
- { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
- { FRAC_CONST(0.903989315032959), FRAC_CONST(0.427555084228516) },
- { FRAC_CONST(0.881921231746674), FRAC_CONST(0.471396744251251) },
- { FRAC_CONST(0.857728600502014), FRAC_CONST(0.514102756977081) },
- { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
- { FRAC_CONST(0.803207516670227), FRAC_CONST(0.595699310302734) },
- { FRAC_CONST(0.773010432720184), FRAC_CONST(0.634393334388733) },
- { FRAC_CONST(0.740951120853424), FRAC_CONST(0.671558976173401) },
- { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(0.671558916568756), FRAC_CONST(0.740951180458069) },
- { FRAC_CONST(0.634393274784088), FRAC_CONST(0.773010432720184) },
- { FRAC_CONST(0.595699310302734), FRAC_CONST(0.803207516670227) },
- { FRAC_CONST(0.555570185184479), FRAC_CONST(0.831469655036926) },
- { FRAC_CONST(0.514102697372437), FRAC_CONST(0.857728660106659) },
- { FRAC_CONST(0.471396654844284), FRAC_CONST(0.881921291351318) },
- { FRAC_CONST(0.427555114030838), FRAC_CONST(0.903989315032959) },
- { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(0.336889833211899), FRAC_CONST(0.941544055938721) },
- { FRAC_CONST(0.290284633636475), FRAC_CONST(0.956940352916718) },
- { FRAC_CONST(0.242980122566223), FRAC_CONST(0.970031261444092) },
- { FRAC_CONST(0.195090234279633), FRAC_CONST(0.980785310268402) },
- { FRAC_CONST(0.146730497479439), FRAC_CONST(0.989176511764526) },
- { FRAC_CONST(0.098017133772373), FRAC_CONST(0.995184719562531) },
- { FRAC_CONST(0.049067649990320), FRAC_CONST(0.998795449733734) },
- { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
- { FRAC_CONST(-0.049067739397287), FRAC_CONST(0.998795449733734) },
- { FRAC_CONST(-0.098017223179340), FRAC_CONST(0.995184719562531) },
- { FRAC_CONST(-0.146730571985245), FRAC_CONST(0.989176511764526) },
- { FRAC_CONST(-0.195090323686600), FRAC_CONST(0.980785250663757) },
- { FRAC_CONST(-0.242980197072029), FRAC_CONST(0.970031261444092) },
- { FRAC_CONST(-0.290284723043442), FRAC_CONST(0.956940293312073) },
- { FRAC_CONST(-0.336889922618866), FRAC_CONST(0.941544055938721) },
- { FRAC_CONST(-0.382683515548706), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(-0.427555084228516), FRAC_CONST(0.903989315032959) },
- { FRAC_CONST(-0.471396833658218), FRAC_CONST(0.881921231746674) },
- { FRAC_CONST(-0.514102756977081), FRAC_CONST(0.857728600502014) },
- { FRAC_CONST(-0.555570363998413), FRAC_CONST(0.831469535827637) },
- { FRAC_CONST(-0.595699369907379), FRAC_CONST(0.803207516670227) },
- { FRAC_CONST(-0.634393274784088), FRAC_CONST(0.773010492324829) },
- { FRAC_CONST(-0.671559035778046), FRAC_CONST(0.740951061248779) },
- { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(-0.740951240062714), FRAC_CONST(0.671558856964111) },
- { FRAC_CONST(-0.773010492324829), FRAC_CONST(0.634393274784088) },
- { FRAC_CONST(-0.803207635879517), FRAC_CONST(0.595699131488800) },
- { FRAC_CONST(-0.831469655036926), FRAC_CONST(0.555570185184479) },
- { FRAC_CONST(-0.857728600502014), FRAC_CONST(0.514102756977081) },
- { FRAC_CONST(-0.881921350955963), FRAC_CONST(0.471396625041962) },
- { FRAC_CONST(-0.903989315032959), FRAC_CONST(0.427555054426193) },
- { FRAC_CONST(-0.923879623413086), FRAC_CONST(0.382683277130127) },
- { FRAC_CONST(-0.941544115543365), FRAC_CONST(0.336889803409576) },
- { FRAC_CONST(-0.956940352916718), FRAC_CONST(0.290284723043442) },
- { FRAC_CONST(-0.970031261444092), FRAC_CONST(0.242980077862740) },
- { FRAC_CONST(-0.980785310268402), FRAC_CONST(0.195090308785439) },
- { FRAC_CONST(-0.989176511764526), FRAC_CONST(0.146730333566666) },
- { FRAC_CONST(-0.995184719562531), FRAC_CONST(0.098017096519470) },
- { FRAC_CONST(-0.998795449733734), FRAC_CONST(0.049067486077547) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.997290432453156), FRAC_CONST(0.073564566671848) },
- { FRAC_CONST(0.989176511764526), FRAC_CONST(0.146730467677116) },
- { FRAC_CONST(0.975702106952667), FRAC_CONST(0.219101235270500) },
- { FRAC_CONST(0.956940352916718), FRAC_CONST(0.290284663438797) },
- { FRAC_CONST(0.932992815971375), FRAC_CONST(0.359895050525665) },
- { FRAC_CONST(0.903989315032959), FRAC_CONST(0.427555084228516) },
- { FRAC_CONST(0.870086967945099), FRAC_CONST(0.492898225784302) },
- { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
- { FRAC_CONST(0.788346469402313), FRAC_CONST(0.615231573581696) },
- { FRAC_CONST(0.740951120853424), FRAC_CONST(0.671558976173401) },
- { FRAC_CONST(0.689540505409241), FRAC_CONST(0.724247097969055) },
- { FRAC_CONST(0.634393274784088), FRAC_CONST(0.773010432720184) },
- { FRAC_CONST(0.575808227062225), FRAC_CONST(0.817584812641144) },
- { FRAC_CONST(0.514102697372437), FRAC_CONST(0.857728660106659) },
- { FRAC_CONST(0.449611306190491), FRAC_CONST(0.893224298954010) },
- { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(0.313681751489639), FRAC_CONST(0.949528157711029) },
- { FRAC_CONST(0.242980241775513), FRAC_CONST(0.970031261444092) },
- { FRAC_CONST(0.170961856842041), FRAC_CONST(0.985277652740479) },
- { FRAC_CONST(0.098017133772373), FRAC_CONST(0.995184719562531) },
- { FRAC_CONST(0.024541255086660), FRAC_CONST(0.999698817729950) },
- { FRAC_CONST(-0.049067739397287), FRAC_CONST(0.998795449733734) },
- { FRAC_CONST(-0.122410707175732), FRAC_CONST(0.992479503154755) },
- { FRAC_CONST(-0.195090323686600), FRAC_CONST(0.980785250663757) },
- { FRAC_CONST(-0.266712725162506), FRAC_CONST(0.963776051998138) },
- { FRAC_CONST(-0.336889803409576), FRAC_CONST(0.941544055938721) },
- { FRAC_CONST(-0.405241340398788), FRAC_CONST(0.914209723472595) },
- { FRAC_CONST(-0.471396833658218), FRAC_CONST(0.881921231746674) },
- { FRAC_CONST(-0.534997701644897), FRAC_CONST(0.844853520393372) },
- { FRAC_CONST(-0.595699369907379), FRAC_CONST(0.803207516670227) },
- { FRAC_CONST(-0.653172850608826), FRAC_CONST(0.757208824157715) },
- { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(-0.757208824157715), FRAC_CONST(0.653172850608826) },
- { FRAC_CONST(-0.803207516670227), FRAC_CONST(0.595699369907379) },
- { FRAC_CONST(-0.844853520393372), FRAC_CONST(0.534997701644897) },
- { FRAC_CONST(-0.881921231746674), FRAC_CONST(0.471396833658218) },
- { FRAC_CONST(-0.914209783077240), FRAC_CONST(0.405241221189499) },
- { FRAC_CONST(-0.941544115543365), FRAC_CONST(0.336889803409576) },
- { FRAC_CONST(-0.963776051998138), FRAC_CONST(0.266712725162506) },
- { FRAC_CONST(-0.980785310268402), FRAC_CONST(0.195090308785439) },
- { FRAC_CONST(-0.992479503154755), FRAC_CONST(0.122410699725151) },
- { FRAC_CONST(-0.998795449733734), FRAC_CONST(0.049067724496126) },
- { FRAC_CONST(-0.999698817729950), FRAC_CONST(-0.024541147053242) },
- { FRAC_CONST(-0.995184719562531), FRAC_CONST(-0.098017267882824) },
- { FRAC_CONST(-0.985277652740479), FRAC_CONST(-0.170961990952492) },
- { FRAC_CONST(-0.970031261444092), FRAC_CONST(-0.242980241775513) },
- { FRAC_CONST(-0.949528157711029), FRAC_CONST(-0.313681781291962) },
- { FRAC_CONST(-0.923879504203796), FRAC_CONST(-0.382683426141739) },
- { FRAC_CONST(-0.893224298954010), FRAC_CONST(-0.449611306190491) },
- { FRAC_CONST(-0.857728660106659), FRAC_CONST(-0.514102697372437) },
- { FRAC_CONST(-0.817584872245789), FRAC_CONST(-0.575808107852936) },
- { FRAC_CONST(-0.773010551929474), FRAC_CONST(-0.634393215179443) },
- { FRAC_CONST(-0.724247038364410), FRAC_CONST(-0.689540624618530) },
- { FRAC_CONST(-0.671558916568756), FRAC_CONST(-0.740951180458069) },
- { FRAC_CONST(-0.615231573581696), FRAC_CONST(-0.788346469402313) },
- { FRAC_CONST(-0.555570006370544), FRAC_CONST(-0.831469774246216) },
- { FRAC_CONST(-0.492898195981979), FRAC_CONST(-0.870086967945099) },
- { FRAC_CONST(-0.427554935216904), FRAC_CONST(-0.903989374637604) },
- { FRAC_CONST(-0.359895110130310), FRAC_CONST(-0.932992756366730) },
- { FRAC_CONST(-0.290284544229507), FRAC_CONST(-0.956940352916718) },
- { FRAC_CONST(-0.219101369380951), FRAC_CONST(-0.975702106952667) },
- { FRAC_CONST(-0.146730408072472), FRAC_CONST(-0.989176511764526) },
- { FRAC_CONST(-0.073564760386944), FRAC_CONST(-0.997290432453156) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.995184719562531), FRAC_CONST(0.098017141222954) },
- { FRAC_CONST(0.980785250663757), FRAC_CONST(0.195090323686600) },
- { FRAC_CONST(0.956940352916718), FRAC_CONST(0.290284663438797) },
- { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
- { FRAC_CONST(0.881921231746674), FRAC_CONST(0.471396744251251) },
- { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
- { FRAC_CONST(0.773010432720184), FRAC_CONST(0.634393334388733) },
- { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(0.634393274784088), FRAC_CONST(0.773010432720184) },
- { FRAC_CONST(0.555570185184479), FRAC_CONST(0.831469655036926) },
- { FRAC_CONST(0.471396654844284), FRAC_CONST(0.881921291351318) },
- { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(0.290284633636475), FRAC_CONST(0.956940352916718) },
- { FRAC_CONST(0.195090234279633), FRAC_CONST(0.980785310268402) },
- { FRAC_CONST(0.098017133772373), FRAC_CONST(0.995184719562531) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.980785250663757), FRAC_CONST(0.195090323686600) },
- { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
- { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
- { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(0.555570185184479), FRAC_CONST(0.831469655036926) },
- { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(0.195090234279633), FRAC_CONST(0.980785310268402) },
- { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
- { FRAC_CONST(-0.195090323686600), FRAC_CONST(0.980785250663757) },
- { FRAC_CONST(-0.382683515548706), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(-0.555570363998413), FRAC_CONST(0.831469535827637) },
- { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(-0.831469655036926), FRAC_CONST(0.555570185184479) },
- { FRAC_CONST(-0.923879623413086), FRAC_CONST(0.382683277130127) },
- { FRAC_CONST(-0.980785310268402), FRAC_CONST(0.195090308785439) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.956940352916718), FRAC_CONST(0.290284663438797) },
- { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
- { FRAC_CONST(0.634393274784088), FRAC_CONST(0.773010432720184) },
- { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(0.098017133772373), FRAC_CONST(0.995184719562531) },
- { FRAC_CONST(-0.195090323686600), FRAC_CONST(0.980785250663757) },
- { FRAC_CONST(-0.471396833658218), FRAC_CONST(0.881921231746674) },
- { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(-0.881921231746674), FRAC_CONST(0.471396833658218) },
- { FRAC_CONST(-0.980785310268402), FRAC_CONST(0.195090308785439) },
- { FRAC_CONST(-0.995184719562531), FRAC_CONST(-0.098017267882824) },
- { FRAC_CONST(-0.923879504203796), FRAC_CONST(-0.382683426141739) },
- { FRAC_CONST(-0.773010551929474), FRAC_CONST(-0.634393215179443) },
- { FRAC_CONST(-0.555570006370544), FRAC_CONST(-0.831469774246216) },
- { FRAC_CONST(-0.290284544229507), FRAC_CONST(-0.956940352916718) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
- { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
- { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(-0.923879504203796), FRAC_CONST(-0.382683426141739) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.000000011924881), FRAC_CONST(-1.000000000000000) }
-};
-
-#ifdef ALLOW_SMALL_FRAMELENGTH
-ALIGN static const complex_t cfft_tab_480[] =
-{
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.999914348125458), FRAC_CONST(0.013089596293867) },
- { FRAC_CONST(0.999657332897186), FRAC_CONST(0.026176949962974) },
- { FRAC_CONST(0.999229013919830), FRAC_CONST(0.039259817451239) },
- { FRAC_CONST(0.998629510402679), FRAC_CONST(0.052335958927870) },
- { FRAC_CONST(0.997858941555023), FRAC_CONST(0.065403133630753) },
- { FRAC_CONST(0.996917307376862), FRAC_CONST(0.078459098935127) },
- { FRAC_CONST(0.995804905891418), FRAC_CONST(0.091501623392105) },
- { FRAC_CONST(0.994521915912628), FRAC_CONST(0.104528464376926) },
- { FRAC_CONST(0.993068456649780), FRAC_CONST(0.117537401616573) },
- { FRAC_CONST(0.991444885730743), FRAC_CONST(0.130526199936867) },
- { FRAC_CONST(0.989651381969452), FRAC_CONST(0.143492624163628) },
- { FRAC_CONST(0.987688362598419), FRAC_CONST(0.156434476375580) },
- { FRAC_CONST(0.985556066036224), FRAC_CONST(0.169349506497383) },
- { FRAC_CONST(0.983254909515381), FRAC_CONST(0.182235524058342) },
- { FRAC_CONST(0.980785250663757), FRAC_CONST(0.195090323686600) },
- { FRAC_CONST(0.978147625923157), FRAC_CONST(0.207911700010300) },
- { FRAC_CONST(0.975342333316803), FRAC_CONST(0.220697447657585) },
- { FRAC_CONST(0.972369909286499), FRAC_CONST(0.233445376157761) },
- { FRAC_CONST(0.969230890274048), FRAC_CONST(0.246153295040131) },
- { FRAC_CONST(0.965925812721252), FRAC_CONST(0.258819043636322) },
- { FRAC_CONST(0.962455213069916), FRAC_CONST(0.271440446376801) },
- { FRAC_CONST(0.958819746971130), FRAC_CONST(0.284015357494354) },
- { FRAC_CONST(0.955019950866699), FRAC_CONST(0.296541601419449) },
- { FRAC_CONST(0.951056540012360), FRAC_CONST(0.309017002582550) },
- { FRAC_CONST(0.946930110454559), FRAC_CONST(0.321439445018768) },
- { FRAC_CONST(0.942641496658325), FRAC_CONST(0.333806872367859) },
- { FRAC_CONST(0.938191354274750), FRAC_CONST(0.346117079257965) },
- { FRAC_CONST(0.933580398559570), FRAC_CONST(0.358367949724197) },
- { FRAC_CONST(0.928809583187103), FRAC_CONST(0.370557427406311) },
- { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
- { FRAC_CONST(0.918791174888611), FRAC_CONST(0.394743889570236) },
- { FRAC_CONST(0.913545429706573), FRAC_CONST(0.406736642122269) },
- { FRAC_CONST(0.908143162727356), FRAC_CONST(0.418659746646881) },
- { FRAC_CONST(0.902585268020630), FRAC_CONST(0.430511116981506) },
- { FRAC_CONST(0.896872758865356), FRAC_CONST(0.442288726568222) },
- { FRAC_CONST(0.891006529331207), FRAC_CONST(0.453990519046783) },
- { FRAC_CONST(0.884987652301788), FRAC_CONST(0.465614527463913) },
- { FRAC_CONST(0.878817081451416), FRAC_CONST(0.477158784866333) },
- { FRAC_CONST(0.872496008872986), FRAC_CONST(0.488621264696121) },
- { FRAC_CONST(0.866025388240814), FRAC_CONST(0.500000000000000) },
- { FRAC_CONST(0.859406411647797), FRAC_CONST(0.511293113231659) },
- { FRAC_CONST(0.852640151977539), FRAC_CONST(0.522498548030853) },
- { FRAC_CONST(0.845727801322937), FRAC_CONST(0.533614516258240) },
- { FRAC_CONST(0.838670551776886), FRAC_CONST(0.544639050960541) },
- { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
- { FRAC_CONST(0.824126183986664), FRAC_CONST(0.566406250000000) },
- { FRAC_CONST(0.816641509532928), FRAC_CONST(0.577145218849182) },
- { FRAC_CONST(0.809017002582550), FRAC_CONST(0.587785243988037) },
- { FRAC_CONST(0.801253795623779), FRAC_CONST(0.598324596881866) },
- { FRAC_CONST(0.793353319168091), FRAC_CONST(0.608761429786682) },
- { FRAC_CONST(0.785316884517670), FRAC_CONST(0.619093954563141) },
- { FRAC_CONST(0.777145922183990), FRAC_CONST(0.629320383071899) },
- { FRAC_CONST(0.768841803073883), FRAC_CONST(0.639438986778259) },
- { FRAC_CONST(0.760405957698822), FRAC_CONST(0.649448096752167) },
- { FRAC_CONST(0.751839756965637), FRAC_CONST(0.659345865249634) },
- { FRAC_CONST(0.743144810199738), FRAC_CONST(0.669130623340607) },
- { FRAC_CONST(0.734322488307953), FRAC_CONST(0.678800761699677) },
- { FRAC_CONST(0.725374400615692), FRAC_CONST(0.688354551792145) },
- { FRAC_CONST(0.716301918029785), FRAC_CONST(0.697790503501892) },
- { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(0.697790443897247), FRAC_CONST(0.716301977634430) },
- { FRAC_CONST(0.688354551792145), FRAC_CONST(0.725374400615692) },
- { FRAC_CONST(0.678800702095032), FRAC_CONST(0.734322547912598) },
- { FRAC_CONST(0.669130563735962), FRAC_CONST(0.743144869804382) },
- { FRAC_CONST(0.659345805644989), FRAC_CONST(0.751839816570282) },
- { FRAC_CONST(0.649448037147522), FRAC_CONST(0.760405957698822) },
- { FRAC_CONST(0.639438986778259), FRAC_CONST(0.768841862678528) },
- { FRAC_CONST(0.629320383071899), FRAC_CONST(0.777145981788635) },
- { FRAC_CONST(0.619093954563141), FRAC_CONST(0.785316944122314) },
- { FRAC_CONST(0.608761370182037), FRAC_CONST(0.793353378772736) },
- { FRAC_CONST(0.598324596881866), FRAC_CONST(0.801253855228424) },
- { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
- { FRAC_CONST(0.577145159244537), FRAC_CONST(0.816641569137573) },
- { FRAC_CONST(0.566406250000000), FRAC_CONST(0.824126183986664) },
- { FRAC_CONST(0.555570185184479), FRAC_CONST(0.831469655036926) },
- { FRAC_CONST(0.544638991355896), FRAC_CONST(0.838670611381531) },
- { FRAC_CONST(0.533614516258240), FRAC_CONST(0.845727801322937) },
- { FRAC_CONST(0.522498488426209), FRAC_CONST(0.852640211582184) },
- { FRAC_CONST(0.511293113231659), FRAC_CONST(0.859406411647797) },
- { FRAC_CONST(0.499999970197678), FRAC_CONST(0.866025447845459) },
- { FRAC_CONST(0.488621175289154), FRAC_CONST(0.872496068477631) },
- { FRAC_CONST(0.477158755064011), FRAC_CONST(0.878817141056061) },
- { FRAC_CONST(0.465614467859268), FRAC_CONST(0.884987652301788) },
- { FRAC_CONST(0.453990519046783), FRAC_CONST(0.891006529331207) },
- { FRAC_CONST(0.442288666963577), FRAC_CONST(0.896872758865356) },
- { FRAC_CONST(0.430511027574539), FRAC_CONST(0.902585327625275) },
- { FRAC_CONST(0.418659746646881), FRAC_CONST(0.908143162727356) },
- { FRAC_CONST(0.406736612319946), FRAC_CONST(0.913545489311218) },
- { FRAC_CONST(0.394743800163269), FRAC_CONST(0.918791234493256) },
- { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(0.370557397603989), FRAC_CONST(0.928809583187103) },
- { FRAC_CONST(0.358367860317230), FRAC_CONST(0.933580458164215) },
- { FRAC_CONST(0.346117049455643), FRAC_CONST(0.938191354274750) },
- { FRAC_CONST(0.333806812763214), FRAC_CONST(0.942641496658325) },
- { FRAC_CONST(0.321439474821091), FRAC_CONST(0.946930110454559) },
- { FRAC_CONST(0.309016972780228), FRAC_CONST(0.951056540012360) },
- { FRAC_CONST(0.296541512012482), FRAC_CONST(0.955019950866699) },
- { FRAC_CONST(0.284015327692032), FRAC_CONST(0.958819746971130) },
- { FRAC_CONST(0.271440386772156), FRAC_CONST(0.962455272674561) },
- { FRAC_CONST(0.258819073438644), FRAC_CONST(0.965925812721252) },
- { FRAC_CONST(0.246153265237808), FRAC_CONST(0.969230890274048) },
- { FRAC_CONST(0.233445301651955), FRAC_CONST(0.972369909286499) },
- { FRAC_CONST(0.220697447657585), FRAC_CONST(0.975342333316803) },
- { FRAC_CONST(0.207911655306816), FRAC_CONST(0.978147625923157) },
- { FRAC_CONST(0.195090234279633), FRAC_CONST(0.980785310268402) },
- { FRAC_CONST(0.182235524058342), FRAC_CONST(0.983254909515381) },
- { FRAC_CONST(0.169349446892738), FRAC_CONST(0.985556066036224) },
- { FRAC_CONST(0.156434372067451), FRAC_CONST(0.987688362598419) },
- { FRAC_CONST(0.143492594361305), FRAC_CONST(0.989651381969452) },
- { FRAC_CONST(0.130526125431061), FRAC_CONST(0.991444885730743) },
- { FRAC_CONST(0.117537401616573), FRAC_CONST(0.993068456649780) },
- { FRAC_CONST(0.104528419673443), FRAC_CONST(0.994521915912628) },
- { FRAC_CONST(0.091501533985138), FRAC_CONST(0.995804905891418) },
- { FRAC_CONST(0.078459084033966), FRAC_CONST(0.996917307376862) },
- { FRAC_CONST(0.065403074026108), FRAC_CONST(0.997858941555023) },
- { FRAC_CONST(0.052335973829031), FRAC_CONST(0.998629510402679) },
- { FRAC_CONST(0.039259787648916), FRAC_CONST(0.999229013919830) },
- { FRAC_CONST(0.026176875457168), FRAC_CONST(0.999657332897186) },
- { FRAC_CONST(0.013089597225189), FRAC_CONST(0.999914348125458) },
- { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
- { FRAC_CONST(-0.013089684769511), FRAC_CONST(0.999914348125458) },
- { FRAC_CONST(-0.026176963001490), FRAC_CONST(0.999657332897186) },
- { FRAC_CONST(-0.039259877055883), FRAC_CONST(0.999229013919830) },
- { FRAC_CONST(-0.052336059510708), FRAC_CONST(0.998629510402679) },
- { FRAC_CONST(-0.065403163433075), FRAC_CONST(0.997858941555023) },
- { FRAC_CONST(-0.078459173440933), FRAC_CONST(0.996917307376862) },
- { FRAC_CONST(-0.091501623392105), FRAC_CONST(0.995804905891418) },
- { FRAC_CONST(-0.104528509080410), FRAC_CONST(0.994521915912628) },
- { FRAC_CONST(-0.117537491023541), FRAC_CONST(0.993068456649780) },
- { FRAC_CONST(-0.130526214838028), FRAC_CONST(0.991444885730743) },
- { FRAC_CONST(-0.143492683768272), FRAC_CONST(0.989651381969452) },
- { FRAC_CONST(-0.156434446573257), FRAC_CONST(0.987688362598419) },
- { FRAC_CONST(-0.169349536299706), FRAC_CONST(0.985556066036224) },
- { FRAC_CONST(-0.182235598564148), FRAC_CONST(0.983254909515381) },
- { FRAC_CONST(-0.195090323686600), FRAC_CONST(0.980785250663757) },
- { FRAC_CONST(-0.207911744713783), FRAC_CONST(0.978147566318512) },
- { FRAC_CONST(-0.220697522163391), FRAC_CONST(0.975342273712158) },
- { FRAC_CONST(-0.233445391058922), FRAC_CONST(0.972369909286499) },
- { FRAC_CONST(-0.246153354644775), FRAC_CONST(0.969230890274048) },
- { FRAC_CONST(-0.258819162845612), FRAC_CONST(0.965925812721252) },
- { FRAC_CONST(-0.271440476179123), FRAC_CONST(0.962455213069916) },
- { FRAC_CONST(-0.284015417098999), FRAC_CONST(0.958819687366486) },
- { FRAC_CONST(-0.296541571617126), FRAC_CONST(0.955019950866699) },
- { FRAC_CONST(-0.309017032384872), FRAC_CONST(0.951056480407715) },
- { FRAC_CONST(-0.321439564228058), FRAC_CONST(0.946930110454559) },
- { FRAC_CONST(-0.333806872367859), FRAC_CONST(0.942641496658325) },
- { FRAC_CONST(-0.346117109060287), FRAC_CONST(0.938191294670105) },
- { FRAC_CONST(-0.358367949724197), FRAC_CONST(0.933580458164215) },
- { FRAC_CONST(-0.370557487010956), FRAC_CONST(0.928809523582459) },
- { FRAC_CONST(-0.382683515548706), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(-0.394743859767914), FRAC_CONST(0.918791234493256) },
- { FRAC_CONST(-0.406736701726913), FRAC_CONST(0.913545429706573) },
- { FRAC_CONST(-0.418659836053848), FRAC_CONST(0.908143103122711) },
- { FRAC_CONST(-0.430511116981506), FRAC_CONST(0.902585268020630) },
- { FRAC_CONST(-0.442288637161255), FRAC_CONST(0.896872758865356) },
- { FRAC_CONST(-0.453990608453751), FRAC_CONST(0.891006469726563) },
- { FRAC_CONST(-0.465614557266235), FRAC_CONST(0.884987592697144) },
- { FRAC_CONST(-0.477158725261688), FRAC_CONST(0.878817141056061) },
- { FRAC_CONST(-0.488621354103088), FRAC_CONST(0.872495949268341) },
- { FRAC_CONST(-0.500000059604645), FRAC_CONST(0.866025388240814) },
- { FRAC_CONST(-0.511293053627014), FRAC_CONST(0.859406411647797) },
- { FRAC_CONST(-0.522498667240143), FRAC_CONST(0.852640092372894) },
- { FRAC_CONST(-0.533614575862885), FRAC_CONST(0.845727801322937) },
- { FRAC_CONST(-0.544639050960541), FRAC_CONST(0.838670551776886) },
- { FRAC_CONST(-0.555570363998413), FRAC_CONST(0.831469535827637) },
- { FRAC_CONST(-0.566406309604645), FRAC_CONST(0.824126124382019) },
- { FRAC_CONST(-0.577145218849182), FRAC_CONST(0.816641569137573) },
- { FRAC_CONST(-0.587785184383392), FRAC_CONST(0.809017002582550) },
- { FRAC_CONST(-0.598324656486511), FRAC_CONST(0.801253736019135) },
- { FRAC_CONST(-0.608761429786682), FRAC_CONST(0.793353319168091) },
- { FRAC_CONST(-0.619093894958496), FRAC_CONST(0.785316944122314) },
- { FRAC_CONST(-0.629320502281189), FRAC_CONST(0.777145862579346) },
- { FRAC_CONST(-0.639439046382904), FRAC_CONST(0.768841803073883) },
- { FRAC_CONST(-0.649448037147522), FRAC_CONST(0.760405957698822) },
- { FRAC_CONST(-0.659345924854279), FRAC_CONST(0.751839697360992) },
- { FRAC_CONST(-0.669130682945251), FRAC_CONST(0.743144810199738) },
- { FRAC_CONST(-0.678800761699677), FRAC_CONST(0.734322488307953) },
- { FRAC_CONST(-0.688354671001434), FRAC_CONST(0.725374281406403) },
- { FRAC_CONST(-0.697790503501892), FRAC_CONST(0.716301858425140) },
- { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(-0.716302037239075), FRAC_CONST(0.697790324687958) },
- { FRAC_CONST(-0.725374460220337), FRAC_CONST(0.688354492187500) },
- { FRAC_CONST(-0.734322547912598), FRAC_CONST(0.678800702095032) },
- { FRAC_CONST(-0.743144929409027), FRAC_CONST(0.669130444526672) },
- { FRAC_CONST(-0.751839876174927), FRAC_CONST(0.659345746040344) },
- { FRAC_CONST(-0.760406017303467), FRAC_CONST(0.649448037147522) },
- { FRAC_CONST(-0.768841803073883), FRAC_CONST(0.639439046382904) },
- { FRAC_CONST(-0.777146041393280), FRAC_CONST(0.629320263862610) },
- { FRAC_CONST(-0.785316944122314), FRAC_CONST(0.619093894958496) },
- { FRAC_CONST(-0.793353319168091), FRAC_CONST(0.608761429786682) },
- { FRAC_CONST(-0.801253914833069), FRAC_CONST(0.598324477672577) },
- { FRAC_CONST(-0.809017062187195), FRAC_CONST(0.587785184383392) },
- { FRAC_CONST(-0.816641569137573), FRAC_CONST(0.577145218849182) },
- { FRAC_CONST(-0.824126303195953), FRAC_CONST(0.566406130790710) },
- { FRAC_CONST(-0.831469655036926), FRAC_CONST(0.555570185184479) },
- { FRAC_CONST(-0.838670551776886), FRAC_CONST(0.544639050960541) },
- { FRAC_CONST(-0.845727920532227), FRAC_CONST(0.533614337444305) },
- { FRAC_CONST(-0.852640211582184), FRAC_CONST(0.522498488426209) },
- { FRAC_CONST(-0.859406411647797), FRAC_CONST(0.511293053627014) },
- { FRAC_CONST(-0.866025388240814), FRAC_CONST(0.500000059604645) },
- { FRAC_CONST(-0.872496068477631), FRAC_CONST(0.488621145486832) },
- { FRAC_CONST(-0.878817141056061), FRAC_CONST(0.477158725261688) },
- { FRAC_CONST(-0.884987652301788), FRAC_CONST(0.465614557266235) },
- { FRAC_CONST(-0.891006588935852), FRAC_CONST(0.453990370035172) },
- { FRAC_CONST(-0.896872758865356), FRAC_CONST(0.442288637161255) },
- { FRAC_CONST(-0.902585268020630), FRAC_CONST(0.430511116981506) },
- { FRAC_CONST(-0.908143222332001), FRAC_CONST(0.418659597635269) },
- { FRAC_CONST(-0.913545489311218), FRAC_CONST(0.406736582517624) },
- { FRAC_CONST(-0.918791234493256), FRAC_CONST(0.394743859767914) },
- { FRAC_CONST(-0.923879623413086), FRAC_CONST(0.382683277130127) },
- { FRAC_CONST(-0.928809583187103), FRAC_CONST(0.370557337999344) },
- { FRAC_CONST(-0.933580458164215), FRAC_CONST(0.358367919921875) },
- { FRAC_CONST(-0.938191413879395), FRAC_CONST(0.346116900444031) },
- { FRAC_CONST(-0.942641556262970), FRAC_CONST(0.333806753158569) },
- { FRAC_CONST(-0.946930170059204), FRAC_CONST(0.321439445018768) },
- { FRAC_CONST(-0.951056599617004), FRAC_CONST(0.309016793966293) },
- { FRAC_CONST(-0.955020010471344), FRAC_CONST(0.296541452407837) },
- { FRAC_CONST(-0.958819746971130), FRAC_CONST(0.284015297889709) },
- { FRAC_CONST(-0.962455213069916), FRAC_CONST(0.271440476179123) },
- { FRAC_CONST(-0.965925872325897), FRAC_CONST(0.258818924427032) },
- { FRAC_CONST(-0.969230949878693), FRAC_CONST(0.246153235435486) },
- { FRAC_CONST(-0.972369909286499), FRAC_CONST(0.233445376157761) },
- { FRAC_CONST(-0.975342333316803), FRAC_CONST(0.220697283744812) },
- { FRAC_CONST(-0.978147625923157), FRAC_CONST(0.207911610603333) },
- { FRAC_CONST(-0.980785310268402), FRAC_CONST(0.195090308785439) },
- { FRAC_CONST(-0.983254909515381), FRAC_CONST(0.182235360145569) },
- { FRAC_CONST(-0.985556066036224), FRAC_CONST(0.169349402189255) },
- { FRAC_CONST(-0.987688362598419), FRAC_CONST(0.156434446573257) },
- { FRAC_CONST(-0.989651441574097), FRAC_CONST(0.143492430448532) },
- { FRAC_CONST(-0.991444885730743), FRAC_CONST(0.130526080727577) },
- { FRAC_CONST(-0.993068456649780), FRAC_CONST(0.117537356913090) },
- { FRAC_CONST(-0.994521915912628), FRAC_CONST(0.104528494179249) },
- { FRAC_CONST(-0.995804965496063), FRAC_CONST(0.091501489281654) },
- { FRAC_CONST(-0.996917366981506), FRAC_CONST(0.078459039330482) },
- { FRAC_CONST(-0.997858941555023), FRAC_CONST(0.065403148531914) },
- { FRAC_CONST(-0.998629570007324), FRAC_CONST(0.052335809916258) },
- { FRAC_CONST(-0.999229013919830), FRAC_CONST(0.039259742945433) },
- { FRAC_CONST(-0.999657332897186), FRAC_CONST(0.026176951825619) },
- { FRAC_CONST(-0.999914348125458), FRAC_CONST(0.013089434243739) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.999657332897186), FRAC_CONST(0.026176949962974) },
- { FRAC_CONST(0.998629510402679), FRAC_CONST(0.052335958927870) },
- { FRAC_CONST(0.996917307376862), FRAC_CONST(0.078459098935127) },
- { FRAC_CONST(0.994521915912628), FRAC_CONST(0.104528464376926) },
- { FRAC_CONST(0.991444885730743), FRAC_CONST(0.130526199936867) },
- { FRAC_CONST(0.987688362598419), FRAC_CONST(0.156434476375580) },
- { FRAC_CONST(0.983254909515381), FRAC_CONST(0.182235524058342) },
- { FRAC_CONST(0.978147625923157), FRAC_CONST(0.207911700010300) },
- { FRAC_CONST(0.972369909286499), FRAC_CONST(0.233445376157761) },
- { FRAC_CONST(0.965925812721252), FRAC_CONST(0.258819043636322) },
- { FRAC_CONST(0.958819746971130), FRAC_CONST(0.284015357494354) },
- { FRAC_CONST(0.951056540012360), FRAC_CONST(0.309017002582550) },
- { FRAC_CONST(0.942641496658325), FRAC_CONST(0.333806872367859) },
- { FRAC_CONST(0.933580398559570), FRAC_CONST(0.358367949724197) },
- { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
- { FRAC_CONST(0.913545429706573), FRAC_CONST(0.406736642122269) },
- { FRAC_CONST(0.902585268020630), FRAC_CONST(0.430511116981506) },
- { FRAC_CONST(0.891006529331207), FRAC_CONST(0.453990519046783) },
- { FRAC_CONST(0.878817081451416), FRAC_CONST(0.477158784866333) },
- { FRAC_CONST(0.866025388240814), FRAC_CONST(0.500000000000000) },
- { FRAC_CONST(0.852640151977539), FRAC_CONST(0.522498548030853) },
- { FRAC_CONST(0.838670551776886), FRAC_CONST(0.544639050960541) },
- { FRAC_CONST(0.824126183986664), FRAC_CONST(0.566406250000000) },
- { FRAC_CONST(0.809017002582550), FRAC_CONST(0.587785243988037) },
- { FRAC_CONST(0.793353319168091), FRAC_CONST(0.608761429786682) },
- { FRAC_CONST(0.777145922183990), FRAC_CONST(0.629320383071899) },
- { FRAC_CONST(0.760405957698822), FRAC_CONST(0.649448096752167) },
- { FRAC_CONST(0.743144810199738), FRAC_CONST(0.669130623340607) },
- { FRAC_CONST(0.725374400615692), FRAC_CONST(0.688354551792145) },
- { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(0.688354551792145), FRAC_CONST(0.725374400615692) },
- { FRAC_CONST(0.669130563735962), FRAC_CONST(0.743144869804382) },
- { FRAC_CONST(0.649448037147522), FRAC_CONST(0.760405957698822) },
- { FRAC_CONST(0.629320383071899), FRAC_CONST(0.777145981788635) },
- { FRAC_CONST(0.608761370182037), FRAC_CONST(0.793353378772736) },
- { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
- { FRAC_CONST(0.566406250000000), FRAC_CONST(0.824126183986664) },
- { FRAC_CONST(0.544638991355896), FRAC_CONST(0.838670611381531) },
- { FRAC_CONST(0.522498488426209), FRAC_CONST(0.852640211582184) },
- { FRAC_CONST(0.499999970197678), FRAC_CONST(0.866025447845459) },
- { FRAC_CONST(0.477158755064011), FRAC_CONST(0.878817141056061) },
- { FRAC_CONST(0.453990519046783), FRAC_CONST(0.891006529331207) },
- { FRAC_CONST(0.430511027574539), FRAC_CONST(0.902585327625275) },
- { FRAC_CONST(0.406736612319946), FRAC_CONST(0.913545489311218) },
- { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(0.358367860317230), FRAC_CONST(0.933580458164215) },
- { FRAC_CONST(0.333806812763214), FRAC_CONST(0.942641496658325) },
- { FRAC_CONST(0.309016972780228), FRAC_CONST(0.951056540012360) },
- { FRAC_CONST(0.284015327692032), FRAC_CONST(0.958819746971130) },
- { FRAC_CONST(0.258819073438644), FRAC_CONST(0.965925812721252) },
- { FRAC_CONST(0.233445301651955), FRAC_CONST(0.972369909286499) },
- { FRAC_CONST(0.207911655306816), FRAC_CONST(0.978147625923157) },
- { FRAC_CONST(0.182235524058342), FRAC_CONST(0.983254909515381) },
- { FRAC_CONST(0.156434372067451), FRAC_CONST(0.987688362598419) },
- { FRAC_CONST(0.130526125431061), FRAC_CONST(0.991444885730743) },
- { FRAC_CONST(0.104528419673443), FRAC_CONST(0.994521915912628) },
- { FRAC_CONST(0.078459084033966), FRAC_CONST(0.996917307376862) },
- { FRAC_CONST(0.052335973829031), FRAC_CONST(0.998629510402679) },
- { FRAC_CONST(0.026176875457168), FRAC_CONST(0.999657332897186) },
- { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
- { FRAC_CONST(-0.026176963001490), FRAC_CONST(0.999657332897186) },
- { FRAC_CONST(-0.052336059510708), FRAC_CONST(0.998629510402679) },
- { FRAC_CONST(-0.078459173440933), FRAC_CONST(0.996917307376862) },
- { FRAC_CONST(-0.104528509080410), FRAC_CONST(0.994521915912628) },
- { FRAC_CONST(-0.130526214838028), FRAC_CONST(0.991444885730743) },
- { FRAC_CONST(-0.156434446573257), FRAC_CONST(0.987688362598419) },
- { FRAC_CONST(-0.182235598564148), FRAC_CONST(0.983254909515381) },
- { FRAC_CONST(-0.207911744713783), FRAC_CONST(0.978147566318512) },
- { FRAC_CONST(-0.233445391058922), FRAC_CONST(0.972369909286499) },
- { FRAC_CONST(-0.258819162845612), FRAC_CONST(0.965925812721252) },
- { FRAC_CONST(-0.284015417098999), FRAC_CONST(0.958819687366486) },
- { FRAC_CONST(-0.309017032384872), FRAC_CONST(0.951056480407715) },
- { FRAC_CONST(-0.333806872367859), FRAC_CONST(0.942641496658325) },
- { FRAC_CONST(-0.358367949724197), FRAC_CONST(0.933580458164215) },
- { FRAC_CONST(-0.382683515548706), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(-0.406736701726913), FRAC_CONST(0.913545429706573) },
- { FRAC_CONST(-0.430511116981506), FRAC_CONST(0.902585268020630) },
- { FRAC_CONST(-0.453990608453751), FRAC_CONST(0.891006469726563) },
- { FRAC_CONST(-0.477158725261688), FRAC_CONST(0.878817141056061) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.998629510402679), FRAC_CONST(0.052335958927870) },
- { FRAC_CONST(0.994521915912628), FRAC_CONST(0.104528464376926) },
- { FRAC_CONST(0.987688362598419), FRAC_CONST(0.156434476375580) },
- { FRAC_CONST(0.978147625923157), FRAC_CONST(0.207911700010300) },
- { FRAC_CONST(0.965925812721252), FRAC_CONST(0.258819043636322) },
- { FRAC_CONST(0.951056540012360), FRAC_CONST(0.309017002582550) },
- { FRAC_CONST(0.933580398559570), FRAC_CONST(0.358367949724197) },
- { FRAC_CONST(0.913545429706573), FRAC_CONST(0.406736642122269) },
- { FRAC_CONST(0.891006529331207), FRAC_CONST(0.453990519046783) },
- { FRAC_CONST(0.866025388240814), FRAC_CONST(0.500000000000000) },
- { FRAC_CONST(0.838670551776886), FRAC_CONST(0.544639050960541) },
- { FRAC_CONST(0.809017002582550), FRAC_CONST(0.587785243988037) },
- { FRAC_CONST(0.777145922183990), FRAC_CONST(0.629320383071899) },
- { FRAC_CONST(0.743144810199738), FRAC_CONST(0.669130623340607) },
- { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(0.669130563735962), FRAC_CONST(0.743144869804382) },
- { FRAC_CONST(0.629320383071899), FRAC_CONST(0.777145981788635) },
- { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
- { FRAC_CONST(0.544638991355896), FRAC_CONST(0.838670611381531) },
- { FRAC_CONST(0.499999970197678), FRAC_CONST(0.866025447845459) },
- { FRAC_CONST(0.453990519046783), FRAC_CONST(0.891006529331207) },
- { FRAC_CONST(0.406736612319946), FRAC_CONST(0.913545489311218) },
- { FRAC_CONST(0.358367860317230), FRAC_CONST(0.933580458164215) },
- { FRAC_CONST(0.309016972780228), FRAC_CONST(0.951056540012360) },
- { FRAC_CONST(0.258819073438644), FRAC_CONST(0.965925812721252) },
- { FRAC_CONST(0.207911655306816), FRAC_CONST(0.978147625923157) },
- { FRAC_CONST(0.156434372067451), FRAC_CONST(0.987688362598419) },
- { FRAC_CONST(0.104528419673443), FRAC_CONST(0.994521915912628) },
- { FRAC_CONST(0.052335973829031), FRAC_CONST(0.998629510402679) },
- { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
- { FRAC_CONST(-0.052336059510708), FRAC_CONST(0.998629510402679) },
- { FRAC_CONST(-0.104528509080410), FRAC_CONST(0.994521915912628) },
- { FRAC_CONST(-0.156434446573257), FRAC_CONST(0.987688362598419) },
- { FRAC_CONST(-0.207911744713783), FRAC_CONST(0.978147566318512) },
- { FRAC_CONST(-0.258819162845612), FRAC_CONST(0.965925812721252) },
- { FRAC_CONST(-0.309017032384872), FRAC_CONST(0.951056480407715) },
- { FRAC_CONST(-0.358367949724197), FRAC_CONST(0.933580458164215) },
- { FRAC_CONST(-0.406736701726913), FRAC_CONST(0.913545429706573) },
- { FRAC_CONST(-0.453990608453751), FRAC_CONST(0.891006469726563) },
- { FRAC_CONST(-0.500000059604645), FRAC_CONST(0.866025388240814) },
- { FRAC_CONST(-0.544639050960541), FRAC_CONST(0.838670551776886) },
- { FRAC_CONST(-0.587785184383392), FRAC_CONST(0.809017002582550) },
- { FRAC_CONST(-0.629320502281189), FRAC_CONST(0.777145862579346) },
- { FRAC_CONST(-0.669130682945251), FRAC_CONST(0.743144810199738) },
- { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(-0.743144929409027), FRAC_CONST(0.669130444526672) },
- { FRAC_CONST(-0.777146041393280), FRAC_CONST(0.629320263862610) },
- { FRAC_CONST(-0.809017062187195), FRAC_CONST(0.587785184383392) },
- { FRAC_CONST(-0.838670551776886), FRAC_CONST(0.544639050960541) },
- { FRAC_CONST(-0.866025388240814), FRAC_CONST(0.500000059604645) },
- { FRAC_CONST(-0.891006588935852), FRAC_CONST(0.453990370035172) },
- { FRAC_CONST(-0.913545489311218), FRAC_CONST(0.406736582517624) },
- { FRAC_CONST(-0.933580458164215), FRAC_CONST(0.358367919921875) },
- { FRAC_CONST(-0.951056599617004), FRAC_CONST(0.309016793966293) },
- { FRAC_CONST(-0.965925872325897), FRAC_CONST(0.258818924427032) },
- { FRAC_CONST(-0.978147625923157), FRAC_CONST(0.207911610603333) },
- { FRAC_CONST(-0.987688362598419), FRAC_CONST(0.156434446573257) },
- { FRAC_CONST(-0.994521915912628), FRAC_CONST(0.104528494179249) },
- { FRAC_CONST(-0.998629570007324), FRAC_CONST(0.052335809916258) },
- { FRAC_CONST(-1.000000000000000), FRAC_CONST(-0.000000087422777) },
- { FRAC_CONST(-0.998629510402679), FRAC_CONST(-0.052335985004902) },
- { FRAC_CONST(-0.994521856307983), FRAC_CONST(-0.104528672993183) },
- { FRAC_CONST(-0.987688302993774), FRAC_CONST(-0.156434610486031) },
- { FRAC_CONST(-0.978147566318512), FRAC_CONST(-0.207911789417267) },
- { FRAC_CONST(-0.965925812721252), FRAC_CONST(-0.258819073438644) },
- { FRAC_CONST(-0.951056540012360), FRAC_CONST(-0.309016972780228) },
- { FRAC_CONST(-0.933580398559570), FRAC_CONST(-0.358368098735809) },
- { FRAC_CONST(-0.913545429706573), FRAC_CONST(-0.406736731529236) },
- { FRAC_CONST(-0.891006529331207), FRAC_CONST(-0.453990548849106) },
- { FRAC_CONST(-0.866025269031525), FRAC_CONST(-0.500000178813934) },
- { FRAC_CONST(-0.838670492172241), FRAC_CONST(-0.544639170169830) },
- { FRAC_CONST(-0.809016942977905), FRAC_CONST(-0.587785363197327) },
- { FRAC_CONST(-0.777145922183990), FRAC_CONST(-0.629320442676544) },
- { FRAC_CONST(-0.743144810199738), FRAC_CONST(-0.669130623340607) },
- { FRAC_CONST(-0.707106649875641), FRAC_CONST(-0.707106888294220) },
- { FRAC_CONST(-0.669130504131317), FRAC_CONST(-0.743144869804382) },
- { FRAC_CONST(-0.629320323467255), FRAC_CONST(-0.777145981788635) },
- { FRAC_CONST(-0.587785065174103), FRAC_CONST(-0.809017121791840) },
- { FRAC_CONST(-0.544639110565186), FRAC_CONST(-0.838670551776886) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.996917307376862), FRAC_CONST(0.078459098935127) },
- { FRAC_CONST(0.987688362598419), FRAC_CONST(0.156434476375580) },
- { FRAC_CONST(0.972369909286499), FRAC_CONST(0.233445376157761) },
- { FRAC_CONST(0.951056540012360), FRAC_CONST(0.309017002582550) },
- { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
- { FRAC_CONST(0.891006529331207), FRAC_CONST(0.453990519046783) },
- { FRAC_CONST(0.852640151977539), FRAC_CONST(0.522498548030853) },
- { FRAC_CONST(0.809017002582550), FRAC_CONST(0.587785243988037) },
- { FRAC_CONST(0.760405957698822), FRAC_CONST(0.649448096752167) },
- { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(0.649448037147522), FRAC_CONST(0.760405957698822) },
- { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
- { FRAC_CONST(0.522498488426209), FRAC_CONST(0.852640211582184) },
- { FRAC_CONST(0.453990519046783), FRAC_CONST(0.891006529331207) },
- { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(0.309016972780228), FRAC_CONST(0.951056540012360) },
- { FRAC_CONST(0.233445301651955), FRAC_CONST(0.972369909286499) },
- { FRAC_CONST(0.156434372067451), FRAC_CONST(0.987688362598419) },
- { FRAC_CONST(0.078459084033966), FRAC_CONST(0.996917307376862) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.987688362598419), FRAC_CONST(0.156434476375580) },
- { FRAC_CONST(0.951056540012360), FRAC_CONST(0.309017002582550) },
- { FRAC_CONST(0.891006529331207), FRAC_CONST(0.453990519046783) },
- { FRAC_CONST(0.809017002582550), FRAC_CONST(0.587785243988037) },
- { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
- { FRAC_CONST(0.453990519046783), FRAC_CONST(0.891006529331207) },
- { FRAC_CONST(0.309016972780228), FRAC_CONST(0.951056540012360) },
- { FRAC_CONST(0.156434372067451), FRAC_CONST(0.987688362598419) },
- { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
- { FRAC_CONST(-0.156434446573257), FRAC_CONST(0.987688362598419) },
- { FRAC_CONST(-0.309017032384872), FRAC_CONST(0.951056480407715) },
- { FRAC_CONST(-0.453990608453751), FRAC_CONST(0.891006469726563) },
- { FRAC_CONST(-0.587785184383392), FRAC_CONST(0.809017002582550) },
- { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(-0.809017062187195), FRAC_CONST(0.587785184383392) },
- { FRAC_CONST(-0.891006588935852), FRAC_CONST(0.453990370035172) },
- { FRAC_CONST(-0.951056599617004), FRAC_CONST(0.309016793966293) },
- { FRAC_CONST(-0.987688362598419), FRAC_CONST(0.156434446573257) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.972369909286499), FRAC_CONST(0.233445376157761) },
- { FRAC_CONST(0.891006529331207), FRAC_CONST(0.453990519046783) },
- { FRAC_CONST(0.760405957698822), FRAC_CONST(0.649448096752167) },
- { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
- { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(0.156434372067451), FRAC_CONST(0.987688362598419) },
- { FRAC_CONST(-0.078459173440933), FRAC_CONST(0.996917307376862) },
- { FRAC_CONST(-0.309017032384872), FRAC_CONST(0.951056480407715) },
- { FRAC_CONST(-0.522498667240143), FRAC_CONST(0.852640092372894) },
- { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(-0.852640211582184), FRAC_CONST(0.522498488426209) },
- { FRAC_CONST(-0.951056599617004), FRAC_CONST(0.309016793966293) },
- { FRAC_CONST(-0.996917366981506), FRAC_CONST(0.078459039330482) },
- { FRAC_CONST(-0.987688302993774), FRAC_CONST(-0.156434610486031) },
- { FRAC_CONST(-0.923879504203796), FRAC_CONST(-0.382683426141739) },
- { FRAC_CONST(-0.809016942977905), FRAC_CONST(-0.587785363197327) },
- { FRAC_CONST(-0.649447917938232), FRAC_CONST(-0.760406076908112) },
- { FRAC_CONST(-0.453990221023560), FRAC_CONST(-0.891006648540497) },
- { FRAC_CONST(-0.233445450663567), FRAC_CONST(-0.972369909286499) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.951056540012360), FRAC_CONST(0.309017002582550) },
- { FRAC_CONST(0.809017002582550), FRAC_CONST(0.587785243988037) },
- { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
- { FRAC_CONST(0.309016972780228), FRAC_CONST(0.951056540012360) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.809017002582550), FRAC_CONST(0.587785243988037) },
- { FRAC_CONST(0.309016972780228), FRAC_CONST(0.951056540012360) },
- { FRAC_CONST(-0.309017032384872), FRAC_CONST(0.951056480407715) },
- { FRAC_CONST(-0.809017062187195), FRAC_CONST(0.587785184383392) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
- { FRAC_CONST(-0.309017032384872), FRAC_CONST(0.951056480407715) },
- { FRAC_CONST(-0.951056599617004), FRAC_CONST(0.309016793966293) },
- { FRAC_CONST(-0.809016942977905), FRAC_CONST(-0.587785363197327) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.309017121791840), FRAC_CONST(-0.951056480407715) }
-};
-#endif
-
-ALIGN static const complex_t cfft_tab_64[] =
-{
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.995184719562531), FRAC_CONST(0.098017141222954) },
- { FRAC_CONST(0.980785250663757), FRAC_CONST(0.195090323686600) },
- { FRAC_CONST(0.956940352916718), FRAC_CONST(0.290284663438797) },
- { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
- { FRAC_CONST(0.881921231746674), FRAC_CONST(0.471396744251251) },
- { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
- { FRAC_CONST(0.773010432720184), FRAC_CONST(0.634393334388733) },
- { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(0.634393274784088), FRAC_CONST(0.773010432720184) },
- { FRAC_CONST(0.555570185184479), FRAC_CONST(0.831469655036926) },
- { FRAC_CONST(0.471396654844284), FRAC_CONST(0.881921291351318) },
- { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(0.290284633636475), FRAC_CONST(0.956940352916718) },
- { FRAC_CONST(0.195090234279633), FRAC_CONST(0.980785310268402) },
- { FRAC_CONST(0.098017133772373), FRAC_CONST(0.995184719562531) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.980785250663757), FRAC_CONST(0.195090323686600) },
- { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
- { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
- { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(0.555570185184479), FRAC_CONST(0.831469655036926) },
- { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(0.195090234279633), FRAC_CONST(0.980785310268402) },
- { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
- { FRAC_CONST(-0.195090323686600), FRAC_CONST(0.980785250663757) },
- { FRAC_CONST(-0.382683515548706), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(-0.555570363998413), FRAC_CONST(0.831469535827637) },
- { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(-0.831469655036926), FRAC_CONST(0.555570185184479) },
- { FRAC_CONST(-0.923879623413086), FRAC_CONST(0.382683277130127) },
- { FRAC_CONST(-0.980785310268402), FRAC_CONST(0.195090308785439) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.956940352916718), FRAC_CONST(0.290284663438797) },
- { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
- { FRAC_CONST(0.634393274784088), FRAC_CONST(0.773010432720184) },
- { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(0.098017133772373), FRAC_CONST(0.995184719562531) },
- { FRAC_CONST(-0.195090323686600), FRAC_CONST(0.980785250663757) },
- { FRAC_CONST(-0.471396833658218), FRAC_CONST(0.881921231746674) },
- { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(-0.881921231746674), FRAC_CONST(0.471396833658218) },
- { FRAC_CONST(-0.980785310268402), FRAC_CONST(0.195090308785439) },
- { FRAC_CONST(-0.995184719562531), FRAC_CONST(-0.098017267882824) },
- { FRAC_CONST(-0.923879504203796), FRAC_CONST(-0.382683426141739) },
- { FRAC_CONST(-0.773010551929474), FRAC_CONST(-0.634393215179443) },
- { FRAC_CONST(-0.555570006370544), FRAC_CONST(-0.831469774246216) },
- { FRAC_CONST(-0.290284544229507), FRAC_CONST(-0.956940352916718) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
- { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
- { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(-0.923879504203796), FRAC_CONST(-0.382683426141739) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.000000011924881), FRAC_CONST(-1.000000000000000) }
-};
-
-#ifdef ALLOW_SMALL_FRAMELENGTH
-ALIGN static const complex_t cfft_tab_60[] =
-{
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.994521915912628), FRAC_CONST(0.104528464376926) },
- { FRAC_CONST(0.978147625923157), FRAC_CONST(0.207911700010300) },
- { FRAC_CONST(0.951056540012360), FRAC_CONST(0.309017002582550) },
- { FRAC_CONST(0.913545429706573), FRAC_CONST(0.406736642122269) },
- { FRAC_CONST(0.866025388240814), FRAC_CONST(0.500000000000000) },
- { FRAC_CONST(0.809017002582550), FRAC_CONST(0.587785243988037) },
- { FRAC_CONST(0.743144810199738), FRAC_CONST(0.669130623340607) },
- { FRAC_CONST(0.669130563735962), FRAC_CONST(0.743144869804382) },
- { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
- { FRAC_CONST(0.499999970197678), FRAC_CONST(0.866025447845459) },
- { FRAC_CONST(0.406736612319946), FRAC_CONST(0.913545489311218) },
- { FRAC_CONST(0.309016972780228), FRAC_CONST(0.951056540012360) },
- { FRAC_CONST(0.207911655306816), FRAC_CONST(0.978147625923157) },
- { FRAC_CONST(0.104528419673443), FRAC_CONST(0.994521915912628) },
- { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
- { FRAC_CONST(-0.104528509080410), FRAC_CONST(0.994521915912628) },
- { FRAC_CONST(-0.207911744713783), FRAC_CONST(0.978147566318512) },
- { FRAC_CONST(-0.309017032384872), FRAC_CONST(0.951056480407715) },
- { FRAC_CONST(-0.406736701726913), FRAC_CONST(0.913545429706573) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.978147625923157), FRAC_CONST(0.207911700010300) },
- { FRAC_CONST(0.913545429706573), FRAC_CONST(0.406736642122269) },
- { FRAC_CONST(0.809017002582550), FRAC_CONST(0.587785243988037) },
- { FRAC_CONST(0.669130563735962), FRAC_CONST(0.743144869804382) },
- { FRAC_CONST(0.499999970197678), FRAC_CONST(0.866025447845459) },
- { FRAC_CONST(0.309016972780228), FRAC_CONST(0.951056540012360) },
- { FRAC_CONST(0.104528419673443), FRAC_CONST(0.994521915912628) },
- { FRAC_CONST(-0.104528509080410), FRAC_CONST(0.994521915912628) },
- { FRAC_CONST(-0.309017032384872), FRAC_CONST(0.951056480407715) },
- { FRAC_CONST(-0.500000059604645), FRAC_CONST(0.866025388240814) },
- { FRAC_CONST(-0.669130682945251), FRAC_CONST(0.743144810199738) },
- { FRAC_CONST(-0.809017062187195), FRAC_CONST(0.587785184383392) },
- { FRAC_CONST(-0.913545489311218), FRAC_CONST(0.406736582517624) },
- { FRAC_CONST(-0.978147625923157), FRAC_CONST(0.207911610603333) },
- { FRAC_CONST(-1.000000000000000), FRAC_CONST(-0.000000087422777) },
- { FRAC_CONST(-0.978147566318512), FRAC_CONST(-0.207911789417267) },
- { FRAC_CONST(-0.913545429706573), FRAC_CONST(-0.406736731529236) },
- { FRAC_CONST(-0.809016942977905), FRAC_CONST(-0.587785363197327) },
- { FRAC_CONST(-0.669130504131317), FRAC_CONST(-0.743144869804382) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.951056540012360), FRAC_CONST(0.309017002582550) },
- { FRAC_CONST(0.809017002582550), FRAC_CONST(0.587785243988037) },
- { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
- { FRAC_CONST(0.309016972780228), FRAC_CONST(0.951056540012360) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.809017002582550), FRAC_CONST(0.587785243988037) },
- { FRAC_CONST(0.309016972780228), FRAC_CONST(0.951056540012360) },
- { FRAC_CONST(-0.309017032384872), FRAC_CONST(0.951056480407715) },
- { FRAC_CONST(-0.809017062187195), FRAC_CONST(0.587785184383392) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
- { FRAC_CONST(-0.309017032384872), FRAC_CONST(0.951056480407715) },
- { FRAC_CONST(-0.951056599617004), FRAC_CONST(0.309016793966293) },
- { FRAC_CONST(-0.809016942977905), FRAC_CONST(-0.587785363197327) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.309017121791840), FRAC_CONST(-0.951056480407715) }
-};
-#endif
-
-#ifdef LD_DEC
-
-ALIGN static const complex_t cfft_tab_256[] =
-{
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.999698817729950), FRAC_CONST(0.024541229009628) },
- { FRAC_CONST(0.998795449733734), FRAC_CONST(0.049067676067352) },
- { FRAC_CONST(0.997290432453156), FRAC_CONST(0.073564566671848) },
- { FRAC_CONST(0.995184719562531), FRAC_CONST(0.098017141222954) },
- { FRAC_CONST(0.992479562759399), FRAC_CONST(0.122410677373409) },
- { FRAC_CONST(0.989176511764526), FRAC_CONST(0.146730467677116) },
- { FRAC_CONST(0.985277652740479), FRAC_CONST(0.170961901545525) },
- { FRAC_CONST(0.980785250663757), FRAC_CONST(0.195090323686600) },
- { FRAC_CONST(0.975702106952667), FRAC_CONST(0.219101235270500) },
- { FRAC_CONST(0.970031261444092), FRAC_CONST(0.242980197072029) },
- { FRAC_CONST(0.963776051998138), FRAC_CONST(0.266712784767151) },
- { FRAC_CONST(0.956940352916718), FRAC_CONST(0.290284663438797) },
- { FRAC_CONST(0.949528157711029), FRAC_CONST(0.313681751489639) },
- { FRAC_CONST(0.941544055938721), FRAC_CONST(0.336889863014221) },
- { FRAC_CONST(0.932992815971375), FRAC_CONST(0.359895050525665) },
- { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
- { FRAC_CONST(0.914209723472595), FRAC_CONST(0.405241340398788) },
- { FRAC_CONST(0.903989315032959), FRAC_CONST(0.427555084228516) },
- { FRAC_CONST(0.893224298954010), FRAC_CONST(0.449611335992813) },
- { FRAC_CONST(0.881921231746674), FRAC_CONST(0.471396744251251) },
- { FRAC_CONST(0.870086967945099), FRAC_CONST(0.492898225784302) },
- { FRAC_CONST(0.857728600502014), FRAC_CONST(0.514102756977081) },
- { FRAC_CONST(0.844853579998016), FRAC_CONST(0.534997642040253) },
- { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
- { FRAC_CONST(0.817584812641144), FRAC_CONST(0.575808227062225) },
- { FRAC_CONST(0.803207516670227), FRAC_CONST(0.595699310302734) },
- { FRAC_CONST(0.788346409797668), FRAC_CONST(0.615231633186340) },
- { FRAC_CONST(0.773010432720184), FRAC_CONST(0.634393334388733) },
- { FRAC_CONST(0.757208824157715), FRAC_CONST(0.653172850608826) },
- { FRAC_CONST(0.740951120853424), FRAC_CONST(0.671558976173401) },
- { FRAC_CONST(0.724247097969055), FRAC_CONST(0.689540565013886) },
- { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(0.689540505409241), FRAC_CONST(0.724247097969055) },
- { FRAC_CONST(0.671558916568756), FRAC_CONST(0.740951180458069) },
- { FRAC_CONST(0.653172791004181), FRAC_CONST(0.757208883762360) },
- { FRAC_CONST(0.634393274784088), FRAC_CONST(0.773010432720184) },
- { FRAC_CONST(0.615231573581696), FRAC_CONST(0.788346409797668) },
- { FRAC_CONST(0.595699310302734), FRAC_CONST(0.803207516670227) },
- { FRAC_CONST(0.575808167457581), FRAC_CONST(0.817584812641144) },
- { FRAC_CONST(0.555570185184479), FRAC_CONST(0.831469655036926) },
- { FRAC_CONST(0.534997642040253), FRAC_CONST(0.844853579998016) },
- { FRAC_CONST(0.514102697372437), FRAC_CONST(0.857728660106659) },
- { FRAC_CONST(0.492898195981979), FRAC_CONST(0.870086967945099) },
- { FRAC_CONST(0.471396654844284), FRAC_CONST(0.881921291351318) },
- { FRAC_CONST(0.449611306190491), FRAC_CONST(0.893224298954010) },
- { FRAC_CONST(0.427555114030838), FRAC_CONST(0.903989315032959) },
- { FRAC_CONST(0.405241280794144), FRAC_CONST(0.914209783077240) },
- { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(0.359894961118698), FRAC_CONST(0.932992815971375) },
- { FRAC_CONST(0.336889833211899), FRAC_CONST(0.941544055938721) },
- { FRAC_CONST(0.313681662082672), FRAC_CONST(0.949528217315674) },
- { FRAC_CONST(0.290284633636475), FRAC_CONST(0.956940352916718) },
- { FRAC_CONST(0.266712754964828), FRAC_CONST(0.963776051998138) },
- { FRAC_CONST(0.242980122566223), FRAC_CONST(0.970031261444092) },
- { FRAC_CONST(0.219101220369339), FRAC_CONST(0.975702106952667) },
- { FRAC_CONST(0.195090234279633), FRAC_CONST(0.980785310268402) },
- { FRAC_CONST(0.170961856842041), FRAC_CONST(0.985277652740479) },
- { FRAC_CONST(0.146730497479439), FRAC_CONST(0.989176511764526) },
- { FRAC_CONST(0.122410625219345), FRAC_CONST(0.992479562759399) },
- { FRAC_CONST(0.098017133772373), FRAC_CONST(0.995184719562531) },
- { FRAC_CONST(0.073564492166042), FRAC_CONST(0.997290432453156) },
- { FRAC_CONST(0.049067649990320), FRAC_CONST(0.998795449733734) },
- { FRAC_CONST(0.024541135877371), FRAC_CONST(0.999698817729950) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.998795449733734), FRAC_CONST(0.049067676067352) },
- { FRAC_CONST(0.995184719562531), FRAC_CONST(0.098017141222954) },
- { FRAC_CONST(0.989176511764526), FRAC_CONST(0.146730467677116) },
- { FRAC_CONST(0.980785250663757), FRAC_CONST(0.195090323686600) },
- { FRAC_CONST(0.970031261444092), FRAC_CONST(0.242980197072029) },
- { FRAC_CONST(0.956940352916718), FRAC_CONST(0.290284663438797) },
- { FRAC_CONST(0.941544055938721), FRAC_CONST(0.336889863014221) },
- { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
- { FRAC_CONST(0.903989315032959), FRAC_CONST(0.427555084228516) },
- { FRAC_CONST(0.881921231746674), FRAC_CONST(0.471396744251251) },
- { FRAC_CONST(0.857728600502014), FRAC_CONST(0.514102756977081) },
- { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
- { FRAC_CONST(0.803207516670227), FRAC_CONST(0.595699310302734) },
- { FRAC_CONST(0.773010432720184), FRAC_CONST(0.634393334388733) },
- { FRAC_CONST(0.740951120853424), FRAC_CONST(0.671558976173401) },
- { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(0.671558916568756), FRAC_CONST(0.740951180458069) },
- { FRAC_CONST(0.634393274784088), FRAC_CONST(0.773010432720184) },
- { FRAC_CONST(0.595699310302734), FRAC_CONST(0.803207516670227) },
- { FRAC_CONST(0.555570185184479), FRAC_CONST(0.831469655036926) },
- { FRAC_CONST(0.514102697372437), FRAC_CONST(0.857728660106659) },
- { FRAC_CONST(0.471396654844284), FRAC_CONST(0.881921291351318) },
- { FRAC_CONST(0.427555114030838), FRAC_CONST(0.903989315032959) },
- { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(0.336889833211899), FRAC_CONST(0.941544055938721) },
- { FRAC_CONST(0.290284633636475), FRAC_CONST(0.956940352916718) },
- { FRAC_CONST(0.242980122566223), FRAC_CONST(0.970031261444092) },
- { FRAC_CONST(0.195090234279633), FRAC_CONST(0.980785310268402) },
- { FRAC_CONST(0.146730497479439), FRAC_CONST(0.989176511764526) },
- { FRAC_CONST(0.098017133772373), FRAC_CONST(0.995184719562531) },
- { FRAC_CONST(0.049067649990320), FRAC_CONST(0.998795449733734) },
- { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
- { FRAC_CONST(-0.049067739397287), FRAC_CONST(0.998795449733734) },
- { FRAC_CONST(-0.098017223179340), FRAC_CONST(0.995184719562531) },
- { FRAC_CONST(-0.146730571985245), FRAC_CONST(0.989176511764526) },
- { FRAC_CONST(-0.195090323686600), FRAC_CONST(0.980785250663757) },
- { FRAC_CONST(-0.242980197072029), FRAC_CONST(0.970031261444092) },
- { FRAC_CONST(-0.290284723043442), FRAC_CONST(0.956940293312073) },
- { FRAC_CONST(-0.336889922618866), FRAC_CONST(0.941544055938721) },
- { FRAC_CONST(-0.382683515548706), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(-0.427555084228516), FRAC_CONST(0.903989315032959) },
- { FRAC_CONST(-0.471396833658218), FRAC_CONST(0.881921231746674) },
- { FRAC_CONST(-0.514102756977081), FRAC_CONST(0.857728600502014) },
- { FRAC_CONST(-0.555570363998413), FRAC_CONST(0.831469535827637) },
- { FRAC_CONST(-0.595699369907379), FRAC_CONST(0.803207516670227) },
- { FRAC_CONST(-0.634393274784088), FRAC_CONST(0.773010492324829) },
- { FRAC_CONST(-0.671559035778046), FRAC_CONST(0.740951061248779) },
- { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(-0.740951240062714), FRAC_CONST(0.671558856964111) },
- { FRAC_CONST(-0.773010492324829), FRAC_CONST(0.634393274784088) },
- { FRAC_CONST(-0.803207635879517), FRAC_CONST(0.595699131488800) },
- { FRAC_CONST(-0.831469655036926), FRAC_CONST(0.555570185184479) },
- { FRAC_CONST(-0.857728600502014), FRAC_CONST(0.514102756977081) },
- { FRAC_CONST(-0.881921350955963), FRAC_CONST(0.471396625041962) },
- { FRAC_CONST(-0.903989315032959), FRAC_CONST(0.427555054426193) },
- { FRAC_CONST(-0.923879623413086), FRAC_CONST(0.382683277130127) },
- { FRAC_CONST(-0.941544115543365), FRAC_CONST(0.336889803409576) },
- { FRAC_CONST(-0.956940352916718), FRAC_CONST(0.290284723043442) },
- { FRAC_CONST(-0.970031261444092), FRAC_CONST(0.242980077862740) },
- { FRAC_CONST(-0.980785310268402), FRAC_CONST(0.195090308785439) },
- { FRAC_CONST(-0.989176511764526), FRAC_CONST(0.146730333566666) },
- { FRAC_CONST(-0.995184719562531), FRAC_CONST(0.098017096519470) },
- { FRAC_CONST(-0.998795449733734), FRAC_CONST(0.049067486077547) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.997290432453156), FRAC_CONST(0.073564566671848) },
- { FRAC_CONST(0.989176511764526), FRAC_CONST(0.146730467677116) },
- { FRAC_CONST(0.975702106952667), FRAC_CONST(0.219101235270500) },
- { FRAC_CONST(0.956940352916718), FRAC_CONST(0.290284663438797) },
- { FRAC_CONST(0.932992815971375), FRAC_CONST(0.359895050525665) },
- { FRAC_CONST(0.903989315032959), FRAC_CONST(0.427555084228516) },
- { FRAC_CONST(0.870086967945099), FRAC_CONST(0.492898225784302) },
- { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
- { FRAC_CONST(0.788346469402313), FRAC_CONST(0.615231573581696) },
- { FRAC_CONST(0.740951120853424), FRAC_CONST(0.671558976173401) },
- { FRAC_CONST(0.689540505409241), FRAC_CONST(0.724247097969055) },
- { FRAC_CONST(0.634393274784088), FRAC_CONST(0.773010432720184) },
- { FRAC_CONST(0.575808227062225), FRAC_CONST(0.817584812641144) },
- { FRAC_CONST(0.514102697372437), FRAC_CONST(0.857728660106659) },
- { FRAC_CONST(0.449611306190491), FRAC_CONST(0.893224298954010) },
- { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(0.313681751489639), FRAC_CONST(0.949528157711029) },
- { FRAC_CONST(0.242980241775513), FRAC_CONST(0.970031261444092) },
- { FRAC_CONST(0.170961856842041), FRAC_CONST(0.985277652740479) },
- { FRAC_CONST(0.098017133772373), FRAC_CONST(0.995184719562531) },
- { FRAC_CONST(0.024541255086660), FRAC_CONST(0.999698817729950) },
- { FRAC_CONST(-0.049067739397287), FRAC_CONST(0.998795449733734) },
- { FRAC_CONST(-0.122410707175732), FRAC_CONST(0.992479503154755) },
- { FRAC_CONST(-0.195090323686600), FRAC_CONST(0.980785250663757) },
- { FRAC_CONST(-0.266712725162506), FRAC_CONST(0.963776051998138) },
- { FRAC_CONST(-0.336889803409576), FRAC_CONST(0.941544055938721) },
- { FRAC_CONST(-0.405241340398788), FRAC_CONST(0.914209723472595) },
- { FRAC_CONST(-0.471396833658218), FRAC_CONST(0.881921231746674) },
- { FRAC_CONST(-0.534997701644897), FRAC_CONST(0.844853520393372) },
- { FRAC_CONST(-0.595699369907379), FRAC_CONST(0.803207516670227) },
- { FRAC_CONST(-0.653172850608826), FRAC_CONST(0.757208824157715) },
- { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(-0.757208824157715), FRAC_CONST(0.653172850608826) },
- { FRAC_CONST(-0.803207516670227), FRAC_CONST(0.595699369907379) },
- { FRAC_CONST(-0.844853520393372), FRAC_CONST(0.534997701644897) },
- { FRAC_CONST(-0.881921231746674), FRAC_CONST(0.471396833658218) },
- { FRAC_CONST(-0.914209783077240), FRAC_CONST(0.405241221189499) },
- { FRAC_CONST(-0.941544115543365), FRAC_CONST(0.336889803409576) },
- { FRAC_CONST(-0.963776051998138), FRAC_CONST(0.266712725162506) },
- { FRAC_CONST(-0.980785310268402), FRAC_CONST(0.195090308785439) },
- { FRAC_CONST(-0.992479503154755), FRAC_CONST(0.122410699725151) },
- { FRAC_CONST(-0.998795449733734), FRAC_CONST(0.049067724496126) },
- { FRAC_CONST(-0.999698817729950), FRAC_CONST(-0.024541147053242) },
- { FRAC_CONST(-0.995184719562531), FRAC_CONST(-0.098017267882824) },
- { FRAC_CONST(-0.985277652740479), FRAC_CONST(-0.170961990952492) },
- { FRAC_CONST(-0.970031261444092), FRAC_CONST(-0.242980241775513) },
- { FRAC_CONST(-0.949528157711029), FRAC_CONST(-0.313681781291962) },
- { FRAC_CONST(-0.923879504203796), FRAC_CONST(-0.382683426141739) },
- { FRAC_CONST(-0.893224298954010), FRAC_CONST(-0.449611306190491) },
- { FRAC_CONST(-0.857728660106659), FRAC_CONST(-0.514102697372437) },
- { FRAC_CONST(-0.817584872245789), FRAC_CONST(-0.575808107852936) },
- { FRAC_CONST(-0.773010551929474), FRAC_CONST(-0.634393215179443) },
- { FRAC_CONST(-0.724247038364410), FRAC_CONST(-0.689540624618530) },
- { FRAC_CONST(-0.671558916568756), FRAC_CONST(-0.740951180458069) },
- { FRAC_CONST(-0.615231573581696), FRAC_CONST(-0.788346469402313) },
- { FRAC_CONST(-0.555570006370544), FRAC_CONST(-0.831469774246216) },
- { FRAC_CONST(-0.492898195981979), FRAC_CONST(-0.870086967945099) },
- { FRAC_CONST(-0.427554935216904), FRAC_CONST(-0.903989374637604) },
- { FRAC_CONST(-0.359895110130310), FRAC_CONST(-0.932992756366730) },
- { FRAC_CONST(-0.290284544229507), FRAC_CONST(-0.956940352916718) },
- { FRAC_CONST(-0.219101369380951), FRAC_CONST(-0.975702106952667) },
- { FRAC_CONST(-0.146730408072472), FRAC_CONST(-0.989176511764526) },
- { FRAC_CONST(-0.073564760386944), FRAC_CONST(-0.997290432453156) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.995184719562531), FRAC_CONST(0.098017141222954) },
- { FRAC_CONST(0.980785250663757), FRAC_CONST(0.195090323686600) },
- { FRAC_CONST(0.956940352916718), FRAC_CONST(0.290284663438797) },
- { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
- { FRAC_CONST(0.881921231746674), FRAC_CONST(0.471396744251251) },
- { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
- { FRAC_CONST(0.773010432720184), FRAC_CONST(0.634393334388733) },
- { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(0.634393274784088), FRAC_CONST(0.773010432720184) },
- { FRAC_CONST(0.555570185184479), FRAC_CONST(0.831469655036926) },
- { FRAC_CONST(0.471396654844284), FRAC_CONST(0.881921291351318) },
- { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(0.290284633636475), FRAC_CONST(0.956940352916718) },
- { FRAC_CONST(0.195090234279633), FRAC_CONST(0.980785310268402) },
- { FRAC_CONST(0.098017133772373), FRAC_CONST(0.995184719562531) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.980785250663757), FRAC_CONST(0.195090323686600) },
- { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
- { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
- { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(0.555570185184479), FRAC_CONST(0.831469655036926) },
- { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(0.195090234279633), FRAC_CONST(0.980785310268402) },
- { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
- { FRAC_CONST(-0.195090323686600), FRAC_CONST(0.980785250663757) },
- { FRAC_CONST(-0.382683515548706), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(-0.555570363998413), FRAC_CONST(0.831469535827637) },
- { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(-0.831469655036926), FRAC_CONST(0.555570185184479) },
- { FRAC_CONST(-0.923879623413086), FRAC_CONST(0.382683277130127) },
- { FRAC_CONST(-0.980785310268402), FRAC_CONST(0.195090308785439) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.956940352916718), FRAC_CONST(0.290284663438797) },
- { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
- { FRAC_CONST(0.634393274784088), FRAC_CONST(0.773010432720184) },
- { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(0.098017133772373), FRAC_CONST(0.995184719562531) },
- { FRAC_CONST(-0.195090323686600), FRAC_CONST(0.980785250663757) },
- { FRAC_CONST(-0.471396833658218), FRAC_CONST(0.881921231746674) },
- { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(-0.881921231746674), FRAC_CONST(0.471396833658218) },
- { FRAC_CONST(-0.980785310268402), FRAC_CONST(0.195090308785439) },
- { FRAC_CONST(-0.995184719562531), FRAC_CONST(-0.098017267882824) },
- { FRAC_CONST(-0.923879504203796), FRAC_CONST(-0.382683426141739) },
- { FRAC_CONST(-0.773010551929474), FRAC_CONST(-0.634393215179443) },
- { FRAC_CONST(-0.555570006370544), FRAC_CONST(-0.831469774246216) },
- { FRAC_CONST(-0.290284544229507), FRAC_CONST(-0.956940352916718) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
- { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
- { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(-0.923879504203796), FRAC_CONST(-0.382683426141739) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.000000011924881), FRAC_CONST(-1.000000000000000) }
-};
-
-#ifdef ALLOW_SMALL_FRAMELENGTH
-ALIGN static const complex_t cfft_tab_240[] =
-{
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.999657332897186), FRAC_CONST(0.026176949962974) },
- { FRAC_CONST(0.998629510402679), FRAC_CONST(0.052335958927870) },
- { FRAC_CONST(0.996917307376862), FRAC_CONST(0.078459098935127) },
- { FRAC_CONST(0.994521915912628), FRAC_CONST(0.104528464376926) },
- { FRAC_CONST(0.991444885730743), FRAC_CONST(0.130526199936867) },
- { FRAC_CONST(0.987688362598419), FRAC_CONST(0.156434476375580) },
- { FRAC_CONST(0.983254909515381), FRAC_CONST(0.182235524058342) },
- { FRAC_CONST(0.978147625923157), FRAC_CONST(0.207911700010300) },
- { FRAC_CONST(0.972369909286499), FRAC_CONST(0.233445376157761) },
- { FRAC_CONST(0.965925812721252), FRAC_CONST(0.258819043636322) },
- { FRAC_CONST(0.958819746971130), FRAC_CONST(0.284015357494354) },
- { FRAC_CONST(0.951056540012360), FRAC_CONST(0.309017002582550) },
- { FRAC_CONST(0.942641496658325), FRAC_CONST(0.333806872367859) },
- { FRAC_CONST(0.933580398559570), FRAC_CONST(0.358367949724197) },
- { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
- { FRAC_CONST(0.913545429706573), FRAC_CONST(0.406736642122269) },
- { FRAC_CONST(0.902585268020630), FRAC_CONST(0.430511116981506) },
- { FRAC_CONST(0.891006529331207), FRAC_CONST(0.453990519046783) },
- { FRAC_CONST(0.878817081451416), FRAC_CONST(0.477158784866333) },
- { FRAC_CONST(0.866025388240814), FRAC_CONST(0.500000000000000) },
- { FRAC_CONST(0.852640151977539), FRAC_CONST(0.522498548030853) },
- { FRAC_CONST(0.838670551776886), FRAC_CONST(0.544639050960541) },
- { FRAC_CONST(0.824126183986664), FRAC_CONST(0.566406250000000) },
- { FRAC_CONST(0.809017002582550), FRAC_CONST(0.587785243988037) },
- { FRAC_CONST(0.793353319168091), FRAC_CONST(0.608761429786682) },
- { FRAC_CONST(0.777145922183990), FRAC_CONST(0.629320383071899) },
- { FRAC_CONST(0.760405957698822), FRAC_CONST(0.649448096752167) },
- { FRAC_CONST(0.743144810199738), FRAC_CONST(0.669130623340607) },
- { FRAC_CONST(0.725374400615692), FRAC_CONST(0.688354551792145) },
- { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(0.688354551792145), FRAC_CONST(0.725374400615692) },
- { FRAC_CONST(0.669130563735962), FRAC_CONST(0.743144869804382) },
- { FRAC_CONST(0.649448037147522), FRAC_CONST(0.760405957698822) },
- { FRAC_CONST(0.629320383071899), FRAC_CONST(0.777145981788635) },
- { FRAC_CONST(0.608761370182037), FRAC_CONST(0.793353378772736) },
- { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
- { FRAC_CONST(0.566406250000000), FRAC_CONST(0.824126183986664) },
- { FRAC_CONST(0.544638991355896), FRAC_CONST(0.838670611381531) },
- { FRAC_CONST(0.522498488426209), FRAC_CONST(0.852640211582184) },
- { FRAC_CONST(0.499999970197678), FRAC_CONST(0.866025447845459) },
- { FRAC_CONST(0.477158755064011), FRAC_CONST(0.878817141056061) },
- { FRAC_CONST(0.453990519046783), FRAC_CONST(0.891006529331207) },
- { FRAC_CONST(0.430511027574539), FRAC_CONST(0.902585327625275) },
- { FRAC_CONST(0.406736612319946), FRAC_CONST(0.913545489311218) },
- { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(0.358367860317230), FRAC_CONST(0.933580458164215) },
- { FRAC_CONST(0.333806812763214), FRAC_CONST(0.942641496658325) },
- { FRAC_CONST(0.309016972780228), FRAC_CONST(0.951056540012360) },
- { FRAC_CONST(0.284015327692032), FRAC_CONST(0.958819746971130) },
- { FRAC_CONST(0.258819073438644), FRAC_CONST(0.965925812721252) },
- { FRAC_CONST(0.233445301651955), FRAC_CONST(0.972369909286499) },
- { FRAC_CONST(0.207911655306816), FRAC_CONST(0.978147625923157) },
- { FRAC_CONST(0.182235524058342), FRAC_CONST(0.983254909515381) },
- { FRAC_CONST(0.156434372067451), FRAC_CONST(0.987688362598419) },
- { FRAC_CONST(0.130526125431061), FRAC_CONST(0.991444885730743) },
- { FRAC_CONST(0.104528419673443), FRAC_CONST(0.994521915912628) },
- { FRAC_CONST(0.078459084033966), FRAC_CONST(0.996917307376862) },
- { FRAC_CONST(0.052335973829031), FRAC_CONST(0.998629510402679) },
- { FRAC_CONST(0.026176875457168), FRAC_CONST(0.999657332897186) },
- { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
- { FRAC_CONST(-0.026176963001490), FRAC_CONST(0.999657332897186) },
- { FRAC_CONST(-0.052336059510708), FRAC_CONST(0.998629510402679) },
- { FRAC_CONST(-0.078459173440933), FRAC_CONST(0.996917307376862) },
- { FRAC_CONST(-0.104528509080410), FRAC_CONST(0.994521915912628) },
- { FRAC_CONST(-0.130526214838028), FRAC_CONST(0.991444885730743) },
- { FRAC_CONST(-0.156434446573257), FRAC_CONST(0.987688362598419) },
- { FRAC_CONST(-0.182235598564148), FRAC_CONST(0.983254909515381) },
- { FRAC_CONST(-0.207911744713783), FRAC_CONST(0.978147566318512) },
- { FRAC_CONST(-0.233445391058922), FRAC_CONST(0.972369909286499) },
- { FRAC_CONST(-0.258819162845612), FRAC_CONST(0.965925812721252) },
- { FRAC_CONST(-0.284015417098999), FRAC_CONST(0.958819687366486) },
- { FRAC_CONST(-0.309017032384872), FRAC_CONST(0.951056480407715) },
- { FRAC_CONST(-0.333806872367859), FRAC_CONST(0.942641496658325) },
- { FRAC_CONST(-0.358367949724197), FRAC_CONST(0.933580458164215) },
- { FRAC_CONST(-0.382683515548706), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(-0.406736701726913), FRAC_CONST(0.913545429706573) },
- { FRAC_CONST(-0.430511116981506), FRAC_CONST(0.902585268020630) },
- { FRAC_CONST(-0.453990608453751), FRAC_CONST(0.891006469726563) },
- { FRAC_CONST(-0.477158725261688), FRAC_CONST(0.878817141056061) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.998629510402679), FRAC_CONST(0.052335958927870) },
- { FRAC_CONST(0.994521915912628), FRAC_CONST(0.104528464376926) },
- { FRAC_CONST(0.987688362598419), FRAC_CONST(0.156434476375580) },
- { FRAC_CONST(0.978147625923157), FRAC_CONST(0.207911700010300) },
- { FRAC_CONST(0.965925812721252), FRAC_CONST(0.258819043636322) },
- { FRAC_CONST(0.951056540012360), FRAC_CONST(0.309017002582550) },
- { FRAC_CONST(0.933580398559570), FRAC_CONST(0.358367949724197) },
- { FRAC_CONST(0.913545429706573), FRAC_CONST(0.406736642122269) },
- { FRAC_CONST(0.891006529331207), FRAC_CONST(0.453990519046783) },
- { FRAC_CONST(0.866025388240814), FRAC_CONST(0.500000000000000) },
- { FRAC_CONST(0.838670551776886), FRAC_CONST(0.544639050960541) },
- { FRAC_CONST(0.809017002582550), FRAC_CONST(0.587785243988037) },
- { FRAC_CONST(0.777145922183990), FRAC_CONST(0.629320383071899) },
- { FRAC_CONST(0.743144810199738), FRAC_CONST(0.669130623340607) },
- { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(0.669130563735962), FRAC_CONST(0.743144869804382) },
- { FRAC_CONST(0.629320383071899), FRAC_CONST(0.777145981788635) },
- { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
- { FRAC_CONST(0.544638991355896), FRAC_CONST(0.838670611381531) },
- { FRAC_CONST(0.499999970197678), FRAC_CONST(0.866025447845459) },
- { FRAC_CONST(0.453990519046783), FRAC_CONST(0.891006529331207) },
- { FRAC_CONST(0.406736612319946), FRAC_CONST(0.913545489311218) },
- { FRAC_CONST(0.358367860317230), FRAC_CONST(0.933580458164215) },
- { FRAC_CONST(0.309016972780228), FRAC_CONST(0.951056540012360) },
- { FRAC_CONST(0.258819073438644), FRAC_CONST(0.965925812721252) },
- { FRAC_CONST(0.207911655306816), FRAC_CONST(0.978147625923157) },
- { FRAC_CONST(0.156434372067451), FRAC_CONST(0.987688362598419) },
- { FRAC_CONST(0.104528419673443), FRAC_CONST(0.994521915912628) },
- { FRAC_CONST(0.052335973829031), FRAC_CONST(0.998629510402679) },
- { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
- { FRAC_CONST(-0.052336059510708), FRAC_CONST(0.998629510402679) },
- { FRAC_CONST(-0.104528509080410), FRAC_CONST(0.994521915912628) },
- { FRAC_CONST(-0.156434446573257), FRAC_CONST(0.987688362598419) },
- { FRAC_CONST(-0.207911744713783), FRAC_CONST(0.978147566318512) },
- { FRAC_CONST(-0.258819162845612), FRAC_CONST(0.965925812721252) },
- { FRAC_CONST(-0.309017032384872), FRAC_CONST(0.951056480407715) },
- { FRAC_CONST(-0.358367949724197), FRAC_CONST(0.933580458164215) },
- { FRAC_CONST(-0.406736701726913), FRAC_CONST(0.913545429706573) },
- { FRAC_CONST(-0.453990608453751), FRAC_CONST(0.891006469726563) },
- { FRAC_CONST(-0.500000059604645), FRAC_CONST(0.866025388240814) },
- { FRAC_CONST(-0.544639050960541), FRAC_CONST(0.838670551776886) },
- { FRAC_CONST(-0.587785184383392), FRAC_CONST(0.809017002582550) },
- { FRAC_CONST(-0.629320502281189), FRAC_CONST(0.777145862579346) },
- { FRAC_CONST(-0.669130682945251), FRAC_CONST(0.743144810199738) },
- { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(-0.743144929409027), FRAC_CONST(0.669130444526672) },
- { FRAC_CONST(-0.777146041393280), FRAC_CONST(0.629320263862610) },
- { FRAC_CONST(-0.809017062187195), FRAC_CONST(0.587785184383392) },
- { FRAC_CONST(-0.838670551776886), FRAC_CONST(0.544639050960541) },
- { FRAC_CONST(-0.866025388240814), FRAC_CONST(0.500000059604645) },
- { FRAC_CONST(-0.891006588935852), FRAC_CONST(0.453990370035172) },
- { FRAC_CONST(-0.913545489311218), FRAC_CONST(0.406736582517624) },
- { FRAC_CONST(-0.933580458164215), FRAC_CONST(0.358367919921875) },
- { FRAC_CONST(-0.951056599617004), FRAC_CONST(0.309016793966293) },
- { FRAC_CONST(-0.965925872325897), FRAC_CONST(0.258818924427032) },
- { FRAC_CONST(-0.978147625923157), FRAC_CONST(0.207911610603333) },
- { FRAC_CONST(-0.987688362598419), FRAC_CONST(0.156434446573257) },
- { FRAC_CONST(-0.994521915912628), FRAC_CONST(0.104528494179249) },
- { FRAC_CONST(-0.998629570007324), FRAC_CONST(0.052335809916258) },
- { FRAC_CONST(-1.000000000000000), FRAC_CONST(-0.000000087422777) },
- { FRAC_CONST(-0.998629510402679), FRAC_CONST(-0.052335985004902) },
- { FRAC_CONST(-0.994521856307983), FRAC_CONST(-0.104528672993183) },
- { FRAC_CONST(-0.987688302993774), FRAC_CONST(-0.156434610486031) },
- { FRAC_CONST(-0.978147566318512), FRAC_CONST(-0.207911789417267) },
- { FRAC_CONST(-0.965925812721252), FRAC_CONST(-0.258819073438644) },
- { FRAC_CONST(-0.951056540012360), FRAC_CONST(-0.309016972780228) },
- { FRAC_CONST(-0.933580398559570), FRAC_CONST(-0.358368098735809) },
- { FRAC_CONST(-0.913545429706573), FRAC_CONST(-0.406736731529236) },
- { FRAC_CONST(-0.891006529331207), FRAC_CONST(-0.453990548849106) },
- { FRAC_CONST(-0.866025269031525), FRAC_CONST(-0.500000178813934) },
- { FRAC_CONST(-0.838670492172241), FRAC_CONST(-0.544639170169830) },
- { FRAC_CONST(-0.809016942977905), FRAC_CONST(-0.587785363197327) },
- { FRAC_CONST(-0.777145922183990), FRAC_CONST(-0.629320442676544) },
- { FRAC_CONST(-0.743144810199738), FRAC_CONST(-0.669130623340607) },
- { FRAC_CONST(-0.707106649875641), FRAC_CONST(-0.707106888294220) },
- { FRAC_CONST(-0.669130504131317), FRAC_CONST(-0.743144869804382) },
- { FRAC_CONST(-0.629320323467255), FRAC_CONST(-0.777145981788635) },
- { FRAC_CONST(-0.587785065174103), FRAC_CONST(-0.809017121791840) },
- { FRAC_CONST(-0.544639110565186), FRAC_CONST(-0.838670551776886) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.996917307376862), FRAC_CONST(0.078459098935127) },
- { FRAC_CONST(0.987688362598419), FRAC_CONST(0.156434476375580) },
- { FRAC_CONST(0.972369909286499), FRAC_CONST(0.233445376157761) },
- { FRAC_CONST(0.951056540012360), FRAC_CONST(0.309017002582550) },
- { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
- { FRAC_CONST(0.891006529331207), FRAC_CONST(0.453990519046783) },
- { FRAC_CONST(0.852640151977539), FRAC_CONST(0.522498548030853) },
- { FRAC_CONST(0.809017002582550), FRAC_CONST(0.587785243988037) },
- { FRAC_CONST(0.760405957698822), FRAC_CONST(0.649448096752167) },
- { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(0.649448037147522), FRAC_CONST(0.760405957698822) },
- { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
- { FRAC_CONST(0.522498488426209), FRAC_CONST(0.852640211582184) },
- { FRAC_CONST(0.453990519046783), FRAC_CONST(0.891006529331207) },
- { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(0.309016972780228), FRAC_CONST(0.951056540012360) },
- { FRAC_CONST(0.233445301651955), FRAC_CONST(0.972369909286499) },
- { FRAC_CONST(0.156434372067451), FRAC_CONST(0.987688362598419) },
- { FRAC_CONST(0.078459084033966), FRAC_CONST(0.996917307376862) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.987688362598419), FRAC_CONST(0.156434476375580) },
- { FRAC_CONST(0.951056540012360), FRAC_CONST(0.309017002582550) },
- { FRAC_CONST(0.891006529331207), FRAC_CONST(0.453990519046783) },
- { FRAC_CONST(0.809017002582550), FRAC_CONST(0.587785243988037) },
- { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
- { FRAC_CONST(0.453990519046783), FRAC_CONST(0.891006529331207) },
- { FRAC_CONST(0.309016972780228), FRAC_CONST(0.951056540012360) },
- { FRAC_CONST(0.156434372067451), FRAC_CONST(0.987688362598419) },
- { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
- { FRAC_CONST(-0.156434446573257), FRAC_CONST(0.987688362598419) },
- { FRAC_CONST(-0.309017032384872), FRAC_CONST(0.951056480407715) },
- { FRAC_CONST(-0.453990608453751), FRAC_CONST(0.891006469726563) },
- { FRAC_CONST(-0.587785184383392), FRAC_CONST(0.809017002582550) },
- { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(-0.809017062187195), FRAC_CONST(0.587785184383392) },
- { FRAC_CONST(-0.891006588935852), FRAC_CONST(0.453990370035172) },
- { FRAC_CONST(-0.951056599617004), FRAC_CONST(0.309016793966293) },
- { FRAC_CONST(-0.987688362598419), FRAC_CONST(0.156434446573257) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.972369909286499), FRAC_CONST(0.233445376157761) },
- { FRAC_CONST(0.891006529331207), FRAC_CONST(0.453990519046783) },
- { FRAC_CONST(0.760405957698822), FRAC_CONST(0.649448096752167) },
- { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
- { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(0.156434372067451), FRAC_CONST(0.987688362598419) },
- { FRAC_CONST(-0.078459173440933), FRAC_CONST(0.996917307376862) },
- { FRAC_CONST(-0.309017032384872), FRAC_CONST(0.951056480407715) },
- { FRAC_CONST(-0.522498667240143), FRAC_CONST(0.852640092372894) },
- { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(-0.852640211582184), FRAC_CONST(0.522498488426209) },
- { FRAC_CONST(-0.951056599617004), FRAC_CONST(0.309016793966293) },
- { FRAC_CONST(-0.996917366981506), FRAC_CONST(0.078459039330482) },
- { FRAC_CONST(-0.987688302993774), FRAC_CONST(-0.156434610486031) },
- { FRAC_CONST(-0.923879504203796), FRAC_CONST(-0.382683426141739) },
- { FRAC_CONST(-0.809016942977905), FRAC_CONST(-0.587785363197327) },
- { FRAC_CONST(-0.649447917938232), FRAC_CONST(-0.760406076908112) },
- { FRAC_CONST(-0.453990221023560), FRAC_CONST(-0.891006648540497) },
- { FRAC_CONST(-0.233445450663567), FRAC_CONST(-0.972369909286499) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.951056540012360), FRAC_CONST(0.309017002582550) },
- { FRAC_CONST(0.809017002582550), FRAC_CONST(0.587785243988037) },
- { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
- { FRAC_CONST(0.309016972780228), FRAC_CONST(0.951056540012360) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.809017002582550), FRAC_CONST(0.587785243988037) },
- { FRAC_CONST(0.309016972780228), FRAC_CONST(0.951056540012360) },
- { FRAC_CONST(-0.309017032384872), FRAC_CONST(0.951056480407715) },
- { FRAC_CONST(-0.809017062187195), FRAC_CONST(0.587785184383392) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.587785243988037), FRAC_CONST(0.809017002582550) },
- { FRAC_CONST(-0.309017032384872), FRAC_CONST(0.951056480407715) },
- { FRAC_CONST(-0.951056599617004), FRAC_CONST(0.309016793966293) },
- { FRAC_CONST(-0.809016942977905), FRAC_CONST(-0.587785363197327) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.309017121791840), FRAC_CONST(-0.951056480407715) }
-};
-#endif
-
-#endif
-
-ALIGN static const complex_t cfft_tab_128[] =
-{
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.998795449733734), FRAC_CONST(0.049067676067352) },
- { FRAC_CONST(0.995184719562531), FRAC_CONST(0.098017141222954) },
- { FRAC_CONST(0.989176511764526), FRAC_CONST(0.146730467677116) },
- { FRAC_CONST(0.980785250663757), FRAC_CONST(0.195090323686600) },
- { FRAC_CONST(0.970031261444092), FRAC_CONST(0.242980197072029) },
- { FRAC_CONST(0.956940352916718), FRAC_CONST(0.290284663438797) },
- { FRAC_CONST(0.941544055938721), FRAC_CONST(0.336889863014221) },
- { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
- { FRAC_CONST(0.903989315032959), FRAC_CONST(0.427555084228516) },
- { FRAC_CONST(0.881921231746674), FRAC_CONST(0.471396744251251) },
- { FRAC_CONST(0.857728600502014), FRAC_CONST(0.514102756977081) },
- { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
- { FRAC_CONST(0.803207516670227), FRAC_CONST(0.595699310302734) },
- { FRAC_CONST(0.773010432720184), FRAC_CONST(0.634393334388733) },
- { FRAC_CONST(0.740951120853424), FRAC_CONST(0.671558976173401) },
- { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(0.671558916568756), FRAC_CONST(0.740951180458069) },
- { FRAC_CONST(0.634393274784088), FRAC_CONST(0.773010432720184) },
- { FRAC_CONST(0.595699310302734), FRAC_CONST(0.803207516670227) },
- { FRAC_CONST(0.555570185184479), FRAC_CONST(0.831469655036926) },
- { FRAC_CONST(0.514102697372437), FRAC_CONST(0.857728660106659) },
- { FRAC_CONST(0.471396654844284), FRAC_CONST(0.881921291351318) },
- { FRAC_CONST(0.427555114030838), FRAC_CONST(0.903989315032959) },
- { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(0.336889833211899), FRAC_CONST(0.941544055938721) },
- { FRAC_CONST(0.290284633636475), FRAC_CONST(0.956940352916718) },
- { FRAC_CONST(0.242980122566223), FRAC_CONST(0.970031261444092) },
- { FRAC_CONST(0.195090234279633), FRAC_CONST(0.980785310268402) },
- { FRAC_CONST(0.146730497479439), FRAC_CONST(0.989176511764526) },
- { FRAC_CONST(0.098017133772373), FRAC_CONST(0.995184719562531) },
- { FRAC_CONST(0.049067649990320), FRAC_CONST(0.998795449733734) },
- { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
- { FRAC_CONST(-0.049067739397287), FRAC_CONST(0.998795449733734) },
- { FRAC_CONST(-0.098017223179340), FRAC_CONST(0.995184719562531) },
- { FRAC_CONST(-0.146730571985245), FRAC_CONST(0.989176511764526) },
- { FRAC_CONST(-0.195090323686600), FRAC_CONST(0.980785250663757) },
- { FRAC_CONST(-0.242980197072029), FRAC_CONST(0.970031261444092) },
- { FRAC_CONST(-0.290284723043442), FRAC_CONST(0.956940293312073) },
- { FRAC_CONST(-0.336889922618866), FRAC_CONST(0.941544055938721) },
- { FRAC_CONST(-0.382683515548706), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(-0.427555084228516), FRAC_CONST(0.903989315032959) },
- { FRAC_CONST(-0.471396833658218), FRAC_CONST(0.881921231746674) },
- { FRAC_CONST(-0.514102756977081), FRAC_CONST(0.857728600502014) },
- { FRAC_CONST(-0.555570363998413), FRAC_CONST(0.831469535827637) },
- { FRAC_CONST(-0.595699369907379), FRAC_CONST(0.803207516670227) },
- { FRAC_CONST(-0.634393274784088), FRAC_CONST(0.773010492324829) },
- { FRAC_CONST(-0.671559035778046), FRAC_CONST(0.740951061248779) },
- { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(-0.740951240062714), FRAC_CONST(0.671558856964111) },
- { FRAC_CONST(-0.773010492324829), FRAC_CONST(0.634393274784088) },
- { FRAC_CONST(-0.803207635879517), FRAC_CONST(0.595699131488800) },
- { FRAC_CONST(-0.831469655036926), FRAC_CONST(0.555570185184479) },
- { FRAC_CONST(-0.857728600502014), FRAC_CONST(0.514102756977081) },
- { FRAC_CONST(-0.881921350955963), FRAC_CONST(0.471396625041962) },
- { FRAC_CONST(-0.903989315032959), FRAC_CONST(0.427555054426193) },
- { FRAC_CONST(-0.923879623413086), FRAC_CONST(0.382683277130127) },
- { FRAC_CONST(-0.941544115543365), FRAC_CONST(0.336889803409576) },
- { FRAC_CONST(-0.956940352916718), FRAC_CONST(0.290284723043442) },
- { FRAC_CONST(-0.970031261444092), FRAC_CONST(0.242980077862740) },
- { FRAC_CONST(-0.980785310268402), FRAC_CONST(0.195090308785439) },
- { FRAC_CONST(-0.989176511764526), FRAC_CONST(0.146730333566666) },
- { FRAC_CONST(-0.995184719562531), FRAC_CONST(0.098017096519470) },
- { FRAC_CONST(-0.998795449733734), FRAC_CONST(0.049067486077547) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.995184719562531), FRAC_CONST(0.098017141222954) },
- { FRAC_CONST(0.980785250663757), FRAC_CONST(0.195090323686600) },
- { FRAC_CONST(0.956940352916718), FRAC_CONST(0.290284663438797) },
- { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
- { FRAC_CONST(0.881921231746674), FRAC_CONST(0.471396744251251) },
- { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
- { FRAC_CONST(0.773010432720184), FRAC_CONST(0.634393334388733) },
- { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(0.634393274784088), FRAC_CONST(0.773010432720184) },
- { FRAC_CONST(0.555570185184479), FRAC_CONST(0.831469655036926) },
- { FRAC_CONST(0.471396654844284), FRAC_CONST(0.881921291351318) },
- { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(0.290284633636475), FRAC_CONST(0.956940352916718) },
- { FRAC_CONST(0.195090234279633), FRAC_CONST(0.980785310268402) },
- { FRAC_CONST(0.098017133772373), FRAC_CONST(0.995184719562531) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.980785250663757), FRAC_CONST(0.195090323686600) },
- { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
- { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
- { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(0.555570185184479), FRAC_CONST(0.831469655036926) },
- { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(0.195090234279633), FRAC_CONST(0.980785310268402) },
- { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
- { FRAC_CONST(-0.195090323686600), FRAC_CONST(0.980785250663757) },
- { FRAC_CONST(-0.382683515548706), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(-0.555570363998413), FRAC_CONST(0.831469535827637) },
- { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(-0.831469655036926), FRAC_CONST(0.555570185184479) },
- { FRAC_CONST(-0.923879623413086), FRAC_CONST(0.382683277130127) },
- { FRAC_CONST(-0.980785310268402), FRAC_CONST(0.195090308785439) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.956940352916718), FRAC_CONST(0.290284663438797) },
- { FRAC_CONST(0.831469595432281), FRAC_CONST(0.555570244789124) },
- { FRAC_CONST(0.634393274784088), FRAC_CONST(0.773010432720184) },
- { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(0.098017133772373), FRAC_CONST(0.995184719562531) },
- { FRAC_CONST(-0.195090323686600), FRAC_CONST(0.980785250663757) },
- { FRAC_CONST(-0.471396833658218), FRAC_CONST(0.881921231746674) },
- { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(-0.881921231746674), FRAC_CONST(0.471396833658218) },
- { FRAC_CONST(-0.980785310268402), FRAC_CONST(0.195090308785439) },
- { FRAC_CONST(-0.995184719562531), FRAC_CONST(-0.098017267882824) },
- { FRAC_CONST(-0.923879504203796), FRAC_CONST(-0.382683426141739) },
- { FRAC_CONST(-0.773010551929474), FRAC_CONST(-0.634393215179443) },
- { FRAC_CONST(-0.555570006370544), FRAC_CONST(-0.831469774246216) },
- { FRAC_CONST(-0.290284544229507), FRAC_CONST(-0.956940352916718) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.923879504203796), FRAC_CONST(0.382683455944061) },
- { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(-0.000000043711388), FRAC_CONST(1.000000000000000) },
- { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.382683426141739), FRAC_CONST(0.923879504203796) },
- { FRAC_CONST(-0.707106769084930), FRAC_CONST(0.707106769084930) },
- { FRAC_CONST(-0.923879504203796), FRAC_CONST(-0.382683426141739) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(1.000000000000000), FRAC_CONST(0.000000000000000) },
- { FRAC_CONST(0.000000011924881), FRAC_CONST(-1.000000000000000) }
-};
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/libfaad/codebook/Makefile.am b/src/libfaad/codebook/Makefile.am
deleted file mode 100644
index e4691f4b9..000000000
--- a/src/libfaad/codebook/Makefile.am
+++ /dev/null
@@ -1,15 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-EXTRA_DIST = hcb.h \
- hcb_1.h \
- hcb_2.h \
- hcb_3.h \
- hcb_4.h \
- hcb_5.h \
- hcb_6.h \
- hcb_7.h \
- hcb_8.h \
- hcb_9.h \
- hcb_10.h \
- hcb_11.h \
- hcb_sf.h
diff --git a/src/libfaad/codebook/hcb.h b/src/libfaad/codebook/hcb.h
deleted file mode 100644
index 96093300c..000000000
--- a/src/libfaad/codebook/hcb.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: hcb.h,v 1.6 2005/10/29 23:57:08 tmmm Exp $
-**/
-
-#ifndef __HCB_H__
-#define __HCB_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Optimal huffman decoding for AAC taken from:
- * "SELECTING AN OPTIMAL HUFFMAN DECODER FOR AAC" by
- * VLADIMIR Z. MESAROVIC , RAGHUNATH RAO, MIROSLAV V. DOKIC, and SACHIN DEO
- * AES paper 5436
- *
- * 2 methods are used for huffman decoding:
- * - binary search
- * - 2-step table lookup
- *
- * The choice of the "optimal" method is based on the fact that if the
- * memory size for the Two-step is exorbitantly high then the decision
- * is Binary search for that codebook. However, for marginally more memory
- * size, if Twostep outperforms even the best case of Binary then the
- * decision is Two-step for that codebook.
- *
- * The following methods are used for the different tables.
- * codebook "optimal" method
- * HCB_1 2-Step
- * HCB_2 2-Step
- * HCB_3 Binary
- * HCB_4 2-Step
- * HCB_5 Binary
- * HCB_6 2-Step
- * HCB_7 Binary
- * HCB_8 2-Step
- * HCB_9 Binary
- * HCB_10 2-Step
- * HCB_11 2-Step
- * HCB_SF Binary
- *
- */
-
-
-#define ZERO_HCB 0
-#define FIRST_PAIR_HCB 5
-#define ESC_HCB 11
-#define QUAD_LEN 4
-#define PAIR_LEN 2
-#define NOISE_HCB 13
-#define INTENSITY_HCB2 14
-#define INTENSITY_HCB 15
-
-/* 1st step table */
-typedef struct
-{
- uint8_t offset;
- uint8_t extra_bits;
-} hcb;
-
-/* 2nd step table with quadruple data */
-typedef struct
-{
- uint8_t bits;
- int8_t x;
- int8_t y;
-} hcb_2_pair;
-
-typedef struct
-{
- uint8_t bits;
- int8_t x;
- int8_t y;
- int8_t v;
- int8_t w;
-} hcb_2_quad;
-
-/* binary search table */
-typedef struct
-{
- uint8_t is_leaf;
- int8_t data[4];
-} hcb_bin_quad;
-
-typedef struct
-{
- uint8_t is_leaf;
- int8_t data[2];
-} hcb_bin_pair;
-
-hcb *hcb_table[];
-hcb_2_quad *hcb_2_quad_table[];
-hcb_2_pair *hcb_2_pair_table[];
-hcb_bin_pair *hcb_bin_table[];
-uint8_t hcbN[];
-uint8_t unsigned_cb[];
-int hcb_2_quad_table_size[];
-int hcb_2_pair_table_size[];
-int hcb_bin_table_size[];
-
-#include "codebook/hcb_1.h"
-#include "codebook/hcb_2.h"
-#include "codebook/hcb_3.h"
-#include "codebook/hcb_4.h"
-#include "codebook/hcb_5.h"
-#include "codebook/hcb_6.h"
-#include "codebook/hcb_7.h"
-#include "codebook/hcb_8.h"
-#include "codebook/hcb_9.h"
-#include "codebook/hcb_10.h"
-#include "codebook/hcb_11.h"
-#include "codebook/hcb_sf.h"
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/libfaad/codebook/hcb_1.h b/src/libfaad/codebook/hcb_1.h
deleted file mode 100644
index 220299c55..000000000
--- a/src/libfaad/codebook/hcb_1.h
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: hcb_1.h,v 1.4 2005/10/29 23:57:08 tmmm Exp $
-**/
-
-/* 2-step huffman table HCB_1 */
-
-
-/* 1st step: 5 bits
- * 2^5 = 32 entries
- *
- * Used to find offset into 2nd step table and number of extra bits to get
- */
-static hcb hcb1_1[] = {
- { /* 00000 */ 0, 0 },
- { /* */ 0, 0 },
- { /* */ 0, 0 },
- { /* */ 0, 0 },
- { /* */ 0, 0 },
- { /* */ 0, 0 },
- { /* */ 0, 0 },
- { /* */ 0, 0 },
- { /* */ 0, 0 },
- { /* */ 0, 0 },
- { /* */ 0, 0 },
- { /* */ 0, 0 },
- { /* */ 0, 0 },
- { /* */ 0, 0 },
- { /* */ 0, 0 },
- { /* */ 0, 0 },
- { /* 10000 */ 1, 0 },
- { /* 10001 */ 2, 0 },
- { /* 10010 */ 3, 0 },
- { /* 10011 */ 4, 0 },
- { /* 10100 */ 5, 0 },
- { /* 10101 */ 6, 0 },
- { /* 10110 */ 7, 0 },
- { /* 10111 */ 8, 0 },
-
- /* 7 bit codewords */
- { /* 11000 */ 9, 2 },
- { /* 11001 */ 13, 2 },
- { /* 11010 */ 17, 2 },
- { /* 11011 */ 21, 2 },
- { /* 11100 */ 25, 2 },
- { /* 11101 */ 29, 2 },
-
- /* 9 bit codewords */
- { /* 11110 */ 33, 4 },
-
- /* 9/10/11 bit codewords */
- { /* 11111 */ 49, 6 }
-};
-
-/* 2nd step table
- *
- * Gives size of codeword and actual data (x,y,v,w)
- */
-static hcb_2_quad hcb1_2[] = {
- /* 1 bit codeword */
- { 1, 0, 0, 0, 0 },
-
- /* 5 bit codewords */
- { 5, 1, 0, 0, 0 },
- { 5, -1, 0, 0, 0 },
- { 5, 0, 0, 0, -1 },
- { 5, 0, 1, 0, 0 },
- { 5, 0, 0, 0, 1 },
- { 5, 0, 0, -1, 0 },
- { 5, 0, 0, 1, 0 },
- { 5, 0, -1, 0, 0 },
-
- /* 7 bit codewords */
- /* first 5 bits: 11000 */
- { 7, 1, -1, 0, 0 },
- { 7, -1, 1, 0, 0 },
- { 7, 0, 0, -1, 1 },
- { 7, 0, 1, -1, 0 },
- /* first 5 bits: 11001 */
- { 7, 0, -1, 1, 0 },
- { 7, 0, 0, 1, -1 },
- { 7, 1, 1, 0, 0 },
- { 7, 0, 0, -1, -1 },
- /* first 5 bits: 11010 */
- { 7, -1, -1, 0, 0 },
- { 7, 0, -1, -1, 0 },
- { 7, 1, 0, -1, 0 },
- { 7, 0, 1, 0, -1 },
- /* first 5 bits: 11011 */
- { 7, -1, 0, 1, 0 },
- { 7, 0, 0, 1, 1 },
- { 7, 1, 0, 1, 0 },
- { 7, 0, -1, 0, 1 },
- /* first 5 bits: 11100 */
- { 7, 0, 1, 1, 0 },
- { 7, 0, 1, 0, 1 },
- { 7, -1, 0, -1, 0 },
- { 7, 1, 0, 0, 1 },
- /* first 5 bits: 11101 */
- { 7, -1, 0, 0, -1 },
- { 7, 1, 0, 0, -1 },
- { 7, -1, 0, 0, 1 },
- { 7, 0, -1, 0, -1 },
-
- /* 9 bit codeword */
- /* first 5 bits: 11110 */
- { 9, 1, 1, -1, 0 },
- { 9, -1, 1, -1, 0 },
- { 9, 1, -1, 1, 0 },
- { 9, 0, 1, 1, -1 },
- { 9, 0, 1, -1, 1 },
- { 9, 0, -1, 1, 1 },
- { 9, 0, -1, 1, -1 },
- { 9, 1, -1, -1, 0 },
- { 9, 1, 0, -1, 1 },
- { 9, 0, 1, -1, -1 },
- { 9, -1, 1, 1, 0 },
- { 9, -1, 0, 1, -1 },
- { 9, -1, -1, 1, 0 },
- { 9, 0, -1, -1, 1 },
- { 9, 1, -1, 0, 1 },
- { 9, 1, -1, 0, -1 },
-
- /* 9/10/11 bit codewords */
- /* first 5 bits: 11111 */
- /* 9 bit: reading 11 bits -> 2 too much so 4 entries for each codeword */
- { 9, -1, 1, 0, -1 }, { 9, -1, 1, 0, -1 }, { 9, -1, 1, 0, -1 }, { 9, -1, 1, 0, -1 },
- { 9, -1, -1, -1, 0 }, { 9, -1, -1, -1, 0 }, { 9, -1, -1, -1, 0 }, { 9, -1, -1, -1, 0 },
- { 9, 0, -1, -1, -1 }, { 9, 0, -1, -1, -1 }, { 9, 0, -1, -1, -1 }, { 9, 0, -1, -1, -1 },
- { 9, 0, 1, 1, 1 }, { 9, 0, 1, 1, 1 }, { 9, 0, 1, 1, 1 }, { 9, 0, 1, 1, 1 },
- { 9, 1, 0, 1, -1 }, { 9, 1, 0, 1, -1 }, { 9, 1, 0, 1, -1 }, { 9, 1, 0, 1, -1 },
- { 9, 1, 1, 0, 1 }, { 9, 1, 1, 0, 1 }, { 9, 1, 1, 0, 1 }, { 9, 1, 1, 0, 1 },
- { 9, -1, 1, 0, 1 }, { 9, -1, 1, 0, 1 }, { 9, -1, 1, 0, 1 }, { 9, -1, 1, 0, 1 },
- { 9, 1, 1, 1, 0 }, { 9, 1, 1, 1, 0 }, { 9, 1, 1, 1, 0 }, { 9, 1, 1, 1, 0 },
- /* 10 bit: reading 11 bits -> 1 too much so 2 entries for each codeword */
- { 10, -1, -1, 0, 1 }, { 10, -1, -1, 0, 1 },
- { 10, -1, 0, -1, -1 }, { 10, -1, 0, -1, -1 },
- { 10, 1, 1, 0, -1 }, { 10, 1, 1, 0, -1 },
- { 10, 1, 0, -1, -1 }, { 10, 1, 0, -1, -1 },
- { 10, -1, 0, -1, 1 }, { 10, -1, 0, -1, 1 },
- { 10, -1, -1, 0, -1 }, { 10, -1, -1, 0, -1 },
- { 10, -1, 0, 1, 1 }, { 10, -1, 0, 1, 1 },
- { 10, 1, 0, 1, 1 }, { 10, 1, 0, 1, 1 },
- /* 11 bit */
- { 11, 1, -1, 1, -1 },
- { 11, -1, 1, -1, 1 },
- { 11, -1, 1, 1, -1 },
- { 11, 1, -1, -1, 1 },
- { 11, 1, 1, 1, 1 },
- { 11, -1, -1, 1, 1 },
- { 11, 1, 1, -1, -1 },
- { 11, -1, -1, 1, -1 },
- { 11, -1, -1, -1, -1 },
- { 11, 1, 1, -1, 1 },
- { 11, 1, -1, 1, 1 },
- { 11, -1, 1, 1, 1 },
- { 11, -1, 1, -1, -1 },
- { 11, -1, -1, -1, 1 },
- { 11, 1, -1, -1, -1 },
- { 11, 1, 1, 1, -1 }
-};
diff --git a/src/libfaad/codebook/hcb_10.h b/src/libfaad/codebook/hcb_10.h
deleted file mode 100644
index 60bcab90a..000000000
--- a/src/libfaad/codebook/hcb_10.h
+++ /dev/null
@@ -1,309 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: hcb_10.h,v 1.4 2005/10/29 23:57:08 tmmm Exp $
-**/
-
-/* 2-step huffman table HCB_10 */
-
-
-/* 1st step: 6 bits
- * 2^6 = 64 entries
- *
- * Used to find offset into 2nd step table and number of extra bits to get
- */
-static hcb hcb10_1[] = {
- /* 4 bit codewords */
- { /* 000000 */ 0, 0 },
- { /* */ 0, 0 },
- { /* */ 0, 0 },
- { /* */ 0, 0 },
- { /* 000100 */ 1, 0 },
- { /* */ 1, 0 },
- { /* */ 1, 0 },
- { /* */ 1, 0 },
- { /* 001000 */ 2, 0 },
- { /* */ 2, 0 },
- { /* */ 2, 0 },
- { /* */ 2, 0 },
- /* 5 bit codewords */
- { /* 001100 */ 3, 0 },
- { /* */ 3, 0 },
- { /* 001110 */ 4, 0 },
- { /* */ 4, 0 },
- { /* 010000 */ 5, 0 },
- { /* */ 5, 0 },
- { /* 010010 */ 6, 0 },
- { /* */ 6, 0 },
- { /* 010100 */ 7, 0 },
- { /* */ 7, 0 },
- { /* 010110 */ 8, 0 },
- { /* */ 8, 0 },
- { /* 011000 */ 9, 0 },
- { /* */ 9, 0 },
- { /* 011010 */ 10, 0 },
- { /* */ 10, 0 },
- /* 6 bit codewords */
- { /* 011100 */ 11, 0 },
- { /* 011101 */ 12, 0 },
- { /* 011110 */ 13, 0 },
- { /* 011111 */ 14, 0 },
- { /* 100000 */ 15, 0 },
- { /* 100001 */ 16, 0 },
- { /* 100010 */ 17, 0 },
- { /* 100011 */ 18, 0 },
- { /* 100100 */ 19, 0 },
- { /* 100101 */ 20, 0 },
- { /* 100110 */ 21, 0 },
- { /* 100111 */ 22, 0 },
- { /* 101000 */ 23, 0 },
- { /* 101001 */ 24, 0 },
- /* 7 bit codewords */
- { /* 101010 */ 25, 1 },
- { /* 101011 */ 27, 1 },
- { /* 101100 */ 29, 1 },
- { /* 101101 */ 31, 1 },
- { /* 101110 */ 33, 1 },
- { /* 101111 */ 35, 1 },
- { /* 110000 */ 37, 1 },
- { /* 110001 */ 39, 1 },
- /* 7/8 bit codewords */
- { /* 110010 */ 41, 2 },
- /* 8 bit codewords */
- { /* 110011 */ 45, 2 },
- { /* 110100 */ 49, 2 },
- { /* 110101 */ 53, 2 },
- { /* 110110 */ 57, 2 },
- { /* 110111 */ 61, 2 },
- /* 8/9 bit codewords */
- { /* 111000 */ 65, 3 },
- /* 9 bit codewords */
- { /* 111001 */ 73, 3 },
- { /* 111010 */ 81, 3 },
- { /* 111011 */ 89, 3 },
- /* 9/10 bit codewords */
- { /* 111100 */ 97, 4 },
- /* 10 bit codewords */
- { /* 111101 */ 113, 4 },
- { /* 111110 */ 129, 4 },
- /* 10/11/12 bit codewords */
- { /* 111111 */ 145, 6 }
-};
-
-/* 2nd step table
- *
- * Gives size of codeword and actual data (x,y,v,w)
- */
-static hcb_2_pair hcb10_2[] = {
- /* 4 bit codewords */
- { 4, 1, 1 },
- { 4, 1, 2 },
- { 4, 2, 1 },
-
- /* 5 bit codewords */
- { 5, 2, 2 },
- { 5, 1, 0 },
- { 5, 0, 1 },
- { 5, 1, 3 },
- { 5, 3, 2 },
- { 5, 3, 1 },
- { 5, 2, 3 },
- { 5, 3, 3 },
-
- /* 6 bit codewords */
- { 6, 2, 0 },
- { 6, 0, 2 },
- { 6, 2, 4 },
- { 6, 4, 2 },
- { 6, 1, 4 },
- { 6, 4, 1 },
- { 6, 0, 0 },
- { 6, 4, 3 },
- { 6, 3, 4 },
- { 6, 3, 0 },
- { 6, 0, 3 },
- { 6, 4, 4 },
- { 6, 2, 5 },
- { 6, 5, 2 },
-
- /* 7 bit codewords */
- { 7, 1, 5 },
- { 7, 5, 1 },
- { 7, 5, 3 },
- { 7, 3, 5 },
- { 7, 5, 4 },
- { 7, 4, 5 },
- { 7, 6, 2 },
- { 7, 2, 6 },
- { 7, 6, 3 },
- { 7, 4, 0 },
- { 7, 6, 1 },
- { 7, 0, 4 },
- { 7, 1, 6 },
- { 7, 3, 6 },
- { 7, 5, 5 },
- { 7, 6, 4 },
-
- /* 7/8 bit codewords */
- { 7, 4, 6 }, { 7, 4, 6 },
- { 8, 6, 5 },
- { 8, 7, 2 },
-
- /* 8 bit codewords */
- { 8, 3, 7 },
- { 8, 2, 7 },
- { 8, 5, 6 },
- { 8, 8, 2 },
- { 8, 7, 3 },
- { 8, 5, 0 },
- { 8, 7, 1 },
- { 8, 0, 5 },
- { 8, 8, 1 },
- { 8, 1, 7 },
- { 8, 8, 3 },
- { 8, 7, 4 },
- { 8, 4, 7 },
- { 8, 2, 8 },
- { 8, 6, 6 },
- { 8, 7, 5 },
- { 8, 1, 8 },
- { 8, 3, 8 },
- { 8, 8, 4 },
- { 8, 4, 8 },
-
- /* 8/9 bit codewords */
- { 8, 5, 7 }, { 8, 5, 7 },
- { 8, 8, 5 }, { 8, 8, 5 },
- { 8, 5, 8 }, { 8, 5, 8 },
- { 9, 7, 6 },
- { 9, 6, 7 },
-
- /* 9 bit codewords */
- { 9, 9, 2 },
- { 9, 6, 0 },
- { 9, 6, 8 },
- { 9, 9, 3 },
- { 9, 3, 9 },
- { 9, 9, 1 },
- { 9, 2, 9 },
- { 9, 0, 6 },
- { 9, 8, 6 },
- { 9, 9, 4 },
- { 9, 4, 9 },
- { 9, 10, 2 },
- { 9, 1, 9 },
- { 9, 7, 7 },
- { 9, 8, 7 },
- { 9, 9, 5 },
- { 9, 7, 8 },
- { 9, 10, 3 },
- { 9, 5, 9 },
- { 9, 10, 4 },
- { 9, 2, 10 },
- { 9, 10, 1 },
- { 9, 3, 10 },
- { 9, 9, 6 },
-
- /* 9/10 bit codewords */
- { 9, 6, 9 }, { 9, 6, 9 },
- { 9, 8, 0 }, { 9, 8, 0 },
- { 9, 4, 10 }, { 9, 4, 10 },
- { 9, 7, 0 }, { 9, 7, 0 },
- { 9, 11, 2 }, { 9, 11, 2 },
- { 10, 7, 9 },
- { 10, 11, 3 },
- { 10, 10, 6 },
- { 10, 1, 10 },
- { 10, 11, 1 },
- { 10, 9, 7 },
-
- /* 10 bit codewords */
- { 10, 0, 7 },
- { 10, 8, 8 },
- { 10, 10, 5 },
- { 10, 3, 11 },
- { 10, 5, 10 },
- { 10, 8, 9 },
- { 10, 11, 5 },
- { 10, 0, 8 },
- { 10, 11, 4 },
- { 10, 2, 11 },
- { 10, 7, 10 },
- { 10, 6, 10 },
- { 10, 10, 7 },
- { 10, 4, 11 },
- { 10, 1, 11 },
- { 10, 12, 2 },
- { 10, 9, 8 },
- { 10, 12, 3 },
- { 10, 11, 6 },
- { 10, 5, 11 },
- { 10, 12, 4 },
- { 10, 11, 7 },
- { 10, 12, 5 },
- { 10, 3, 12 },
- { 10, 6, 11 },
- { 10, 9, 0 },
- { 10, 10, 8 },
- { 10, 10, 0 },
- { 10, 12, 1 },
- { 10, 0, 9 },
- { 10, 4, 12 },
- { 10, 9, 9 },
-
- /* 10/11/12 bit codewords */
- { 10, 12, 6 }, { 10, 12, 6 }, { 10, 12, 6 }, { 10, 12, 6 },
- { 10, 2, 12 }, { 10, 2, 12 }, { 10, 2, 12 }, { 10, 2, 12 },
- { 10, 8, 10 }, { 10, 8, 10 }, { 10, 8, 10 }, { 10, 8, 10 },
- { 11, 9, 10 }, { 11, 9, 10 },
- { 11, 1, 12 }, { 11, 1, 12 },
- { 11, 11, 8 }, { 11, 11, 8 },
- { 11, 12, 7 }, { 11, 12, 7 },
- { 11, 7, 11 }, { 11, 7, 11 },
- { 11, 5, 12 }, { 11, 5, 12 },
- { 11, 6, 12 }, { 11, 6, 12 },
- { 11, 10, 9 }, { 11, 10, 9 },
- { 11, 8, 11 }, { 11, 8, 11 },
- { 11, 12, 8 }, { 11, 12, 8 },
- { 11, 0, 10 }, { 11, 0, 10 },
- { 11, 7, 12 }, { 11, 7, 12 },
- { 11, 11, 0 }, { 11, 11, 0 },
- { 11, 10, 10 }, { 11, 10, 10 },
- { 11, 11, 9 }, { 11, 11, 9 },
- { 11, 11, 10 }, { 11, 11, 10 },
- { 11, 0, 11 }, { 11, 0, 11 },
- { 11, 11, 11 }, { 11, 11, 11 },
- { 11, 9, 11 }, { 11, 9, 11 },
- { 11, 10, 11 }, { 11, 10, 11 },
- { 11, 12, 0 }, { 11, 12, 0 },
- { 11, 8, 12 }, { 11, 8, 12 },
- { 12, 12, 9 },
- { 12, 10, 12 },
- { 12, 9, 12 },
- { 12, 11, 12 },
- { 12, 12, 11 },
- { 12, 0, 12 },
- { 12, 12, 10 },
- { 12, 12, 12 }
-};
diff --git a/src/libfaad/codebook/hcb_11.h b/src/libfaad/codebook/hcb_11.h
deleted file mode 100644
index bd4f647e6..000000000
--- a/src/libfaad/codebook/hcb_11.h
+++ /dev/null
@@ -1,412 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: hcb_11.h,v 1.4 2005/10/29 23:57:08 tmmm Exp $
-**/
-
-/* 2-step huffman table HCB_11 */
-
-
-/* 1st step: 5 bits
- * 2^5 = 32 entries
- *
- * Used to find offset into 2nd step table and number of extra bits to get
- */
-static hcb hcb11_1[] = {
- /* 4 bits */
- { /* 00000 */ 0, 0 },
- { /* */ 0, 0 },
- { /* 00010 */ 1, 0 },
- { /* */ 1, 0 },
-
- /* 5 bits */
- { /* 00100 */ 2, 0 },
- { /* 00101 */ 3, 0 },
- { /* 00110 */ 4, 0 },
- { /* 00111 */ 5, 0 },
- { /* 01000 */ 6, 0 },
- { /* 01001 */ 7, 0 },
-
- /* 6 bits */
- { /* 01010 */ 8, 1 },
- { /* 01011 */ 10, 1 },
- { /* 01100 */ 12, 1 },
-
- /* 6/7 bits */
- { /* 01101 */ 14, 2 },
-
- /* 7 bits */
- { /* 01110 */ 18, 2 },
- { /* 01111 */ 22, 2 },
- { /* 10000 */ 26, 2 },
-
- /* 7/8 bits */
- { /* 10001 */ 30, 3 },
-
- /* 8 bits */
- { /* 10010 */ 38, 3 },
- { /* 10011 */ 46, 3 },
- { /* 10100 */ 54, 3 },
- { /* 10101 */ 62, 3 },
- { /* 10110 */ 70, 3 },
- { /* 10111 */ 78, 3 },
-
- /* 8/9 bits */
- { /* 11000 */ 86, 4 },
-
- /* 9 bits */
- { /* 11001 */ 102, 4 },
- { /* 11010 */ 118, 4 },
- { /* 11011 */ 134, 4 },
-
- /* 9/10 bits */
- { /* 11100 */ 150, 5 },
-
- /* 10 bits */
- { /* 11101 */ 182, 5 },
- { /* 11110 */ 214, 5 },
-
- /* 10/11/12 bits */
- { /* 11111 */ 246, 7 }
-};
-
-/* 2nd step table
- *
- * Gives size of codeword and actual data (x,y,v,w)
- */
-static hcb_2_pair hcb11_2[] = {
- /* 4 */
- { 4, 0, 0 },
- { 4, 1, 1 },
-
- /* 5 */
- { 5, 16, 16 },
- { 5, 1, 0 },
- { 5, 0, 1 },
- { 5, 2, 1 },
- { 5, 1, 2 },
- { 5, 2, 2 },
-
- /* 6 */
- { 6, 1, 3 },
- { 6, 3, 1 },
- { 6, 3, 2 },
- { 6, 2, 0 },
- { 6, 2, 3 },
- { 6, 0, 2 },
-
- /* 6/7 */
- { 6, 3, 3 }, { 6, 3, 3 },
- { 7, 4, 1 },
- { 7, 1, 4 },
-
- /* 7 */
- { 7, 4, 2 },
- { 7, 2, 4 },
- { 7, 4, 3 },
- { 7, 3, 4 },
- { 7, 3, 0 },
- { 7, 0, 3 },
- { 7, 5, 1 },
- { 7, 5, 2 },
- { 7, 2, 5 },
- { 7, 4, 4 },
- { 7, 1, 5 },
- { 7, 5, 3 },
-
- /* 7/8 */
- { 7, 3, 5 }, { 7, 3, 5 },
- { 7, 5, 4 }, { 7, 5, 4 },
- { 8, 4, 5 },
- { 8, 6, 2 },
- { 8, 2, 6 },
- { 8, 6, 1 },
-
- /* 8 */
- { 8, 6, 3 },
- { 8, 3, 6 },
- { 8, 1, 6 },
- { 8, 4, 16 },
- { 8, 3, 16 },
- { 8, 16, 5 },
- { 8, 16, 3 },
- { 8, 16, 4 },
- { 8, 6, 4 },
- { 8, 16, 6 },
- { 8, 4, 0 },
- { 8, 4, 6 },
- { 8, 0, 4 },
- { 8, 2, 16 },
- { 8, 5, 5 },
- { 8, 5, 16 },
- { 8, 16, 7 },
- { 8, 16, 2 },
- { 8, 16, 8 },
- { 8, 2, 7 },
- { 8, 7, 2 },
- { 8, 3, 7 },
- { 8, 6, 5 },
- { 8, 5, 6 },
- { 8, 6, 16 },
- { 8, 16, 10 },
- { 8, 7, 3 },
- { 8, 7, 1 },
- { 8, 16, 9 },
- { 8, 7, 16 },
- { 8, 1, 16 },
- { 8, 1, 7 },
- { 8, 4, 7 },
- { 8, 16, 11 },
- { 8, 7, 4 },
- { 8, 16, 12 },
- { 8, 8, 16 },
- { 8, 16, 1 },
- { 8, 6, 6 },
- { 8, 9, 16 },
- { 8, 2, 8 },
- { 8, 5, 7 },
- { 8, 10, 16 },
- { 8, 16, 13 },
- { 8, 8, 3 },
- { 8, 8, 2 },
- { 8, 3, 8 },
- { 8, 5, 0 },
-
- /* 8/9 */
- { 8, 16, 14 }, { 8, 16, 14 },
- { 8, 11, 16 }, { 8, 11, 16 },
- { 8, 7, 5 }, { 8, 7, 5 },
- { 8, 4, 8 }, { 8, 4, 8 },
- { 8, 6, 7 }, { 8, 6, 7 },
- { 8, 7, 6 }, { 8, 7, 6 },
- { 8, 0, 5 }, { 8, 0, 5 },
- { 9, 8, 4 },
- { 9, 16, 15 },
-
- /* 9 */
- { 9, 12, 16 },
- { 9, 1, 8 },
- { 9, 8, 1 },
- { 9, 14, 16 },
- { 9, 5, 8 },
- { 9, 13, 16 },
- { 9, 3, 9 },
- { 9, 8, 5 },
- { 9, 7, 7 },
- { 9, 2, 9 },
- { 9, 8, 6 },
- { 9, 9, 2 },
- { 9, 9, 3 },
- { 9, 15, 16 },
- { 9, 4, 9 },
- { 9, 6, 8 },
- { 9, 6, 0 },
- { 9, 9, 4 },
- { 9, 5, 9 },
- { 9, 8, 7 },
- { 9, 7, 8 },
- { 9, 1, 9 },
- { 9, 10, 3 },
- { 9, 0, 6 },
- { 9, 10, 2 },
- { 9, 9, 1 },
- { 9, 9, 5 },
- { 9, 4, 10 },
- { 9, 2, 10 },
- { 9, 9, 6 },
- { 9, 3, 10 },
- { 9, 6, 9 },
- { 9, 10, 4 },
- { 9, 8, 8 },
- { 9, 10, 5 },
- { 9, 9, 7 },
- { 9, 11, 3 },
- { 9, 1, 10 },
- { 9, 7, 0 },
- { 9, 10, 6 },
- { 9, 7, 9 },
- { 9, 3, 11 },
- { 9, 5, 10 },
- { 9, 10, 1 },
- { 9, 4, 11 },
- { 9, 11, 2 },
- { 9, 13, 2 },
- { 9, 6, 10 },
-
- /* 9/10 */
- { 9, 13, 3 }, { 9, 13, 3 },
- { 9, 2, 11 }, { 9, 2, 11 },
- { 9, 16, 0 }, { 9, 16, 0 },
- { 9, 5, 11 }, { 9, 5, 11 },
- { 9, 11, 5 }, { 9, 11, 5 },
- { 10, 11, 4 },
- { 10, 9, 8 },
- { 10, 7, 10 },
- { 10, 8, 9 },
- { 10, 0, 16 },
- { 10, 4, 13 },
- { 10, 0, 7 },
- { 10, 3, 13 },
- { 10, 11, 6 },
- { 10, 13, 1 },
- { 10, 13, 4 },
- { 10, 12, 3 },
- { 10, 2, 13 },
- { 10, 13, 5 },
- { 10, 8, 10 },
- { 10, 6, 11 },
- { 10, 10, 8 },
- { 10, 10, 7 },
- { 10, 14, 2 },
- { 10, 12, 4 },
- { 10, 1, 11 },
- { 10, 4, 12 },
-
- /* 10 */
- { 10, 11, 1 },
- { 10, 3, 12 },
- { 10, 1, 13 },
- { 10, 12, 2 },
- { 10, 7, 11 },
- { 10, 3, 14 },
- { 10, 5, 12 },
- { 10, 5, 13 },
- { 10, 14, 4 },
- { 10, 4, 14 },
- { 10, 11, 7 },
- { 10, 14, 3 },
- { 10, 12, 5 },
- { 10, 13, 6 },
- { 10, 12, 6 },
- { 10, 8, 0 },
- { 10, 11, 8 },
- { 10, 2, 12 },
- { 10, 9, 9 },
- { 10, 14, 5 },
- { 10, 6, 13 },
- { 10, 10, 10 },
- { 10, 15, 2 },
- { 10, 8, 11 },
- { 10, 9, 10 },
- { 10, 14, 6 },
- { 10, 10, 9 },
- { 10, 5, 14 },
- { 10, 11, 9 },
- { 10, 14, 1 },
- { 10, 2, 14 },
- { 10, 6, 12 },
- { 10, 1, 12 },
- { 10, 13, 8 },
- { 10, 0, 8 },
- { 10, 13, 7 },
- { 10, 7, 12 },
- { 10, 12, 7 },
- { 10, 7, 13 },
- { 10, 15, 3 },
- { 10, 12, 1 },
- { 10, 6, 14 },
- { 10, 2, 15 },
- { 10, 15, 5 },
- { 10, 15, 4 },
- { 10, 1, 14 },
- { 10, 9, 11 },
- { 10, 4, 15 },
- { 10, 14, 7 },
- { 10, 8, 13 },
- { 10, 13, 9 },
- { 10, 8, 12 },
- { 10, 5, 15 },
- { 10, 3, 15 },
- { 10, 10, 11 },
- { 10, 11, 10 },
- { 10, 12, 8 },
- { 10, 15, 6 },
- { 10, 15, 7 },
- { 10, 8, 14 },
- { 10, 15, 1 },
- { 10, 7, 14 },
- { 10, 9, 0 },
- { 10, 0, 9 },
-
- /* 10/11/12 */
- { 10, 9, 13 }, { 10, 9, 13 }, { 10, 9, 13 }, { 10, 9, 13 },
- { 10, 9, 12 }, { 10, 9, 12 }, { 10, 9, 12 }, { 10, 9, 12 },
- { 10, 12, 9 }, { 10, 12, 9 }, { 10, 12, 9 }, { 10, 12, 9 },
- { 10, 14, 8 }, { 10, 14, 8 }, { 10, 14, 8 }, { 10, 14, 8 },
- { 10, 10, 13 }, { 10, 10, 13 }, { 10, 10, 13 }, { 10, 10, 13 },
- { 10, 14, 9 }, { 10, 14, 9 }, { 10, 14, 9 }, { 10, 14, 9 },
- { 10, 12, 10 }, { 10, 12, 10 }, { 10, 12, 10 }, { 10, 12, 10 },
- { 10, 6, 15 }, { 10, 6, 15 }, { 10, 6, 15 }, { 10, 6, 15 },
- { 10, 7, 15 }, { 10, 7, 15 }, { 10, 7, 15 }, { 10, 7, 15 },
-
- { 11, 9, 14 }, { 11, 9, 14 },
- { 11, 15, 8 }, { 11, 15, 8 },
- { 11, 11, 11 }, { 11, 11, 11 },
- { 11, 11, 14 }, { 11, 11, 14 },
- { 11, 1, 15 }, { 11, 1, 15 },
- { 11, 10, 12 }, { 11, 10, 12 },
- { 11, 10, 14 }, { 11, 10, 14 },
- { 11, 13, 11 }, { 11, 13, 11 },
- { 11, 13, 10 }, { 11, 13, 10 },
- { 11, 11, 13 }, { 11, 11, 13 },
- { 11, 11, 12 }, { 11, 11, 12 },
- { 11, 8, 15 }, { 11, 8, 15 },
- { 11, 14, 11 }, { 11, 14, 11 },
- { 11, 13, 12 }, { 11, 13, 12 },
- { 11, 12, 13 }, { 11, 12, 13 },
- { 11, 15, 9 }, { 11, 15, 9 },
- { 11, 14, 10 }, { 11, 14, 10 },
- { 11, 10, 0 }, { 11, 10, 0 },
- { 11, 12, 11 }, { 11, 12, 11 },
- { 11, 9, 15 }, { 11, 9, 15 },
- { 11, 0, 10 }, { 11, 0, 10 },
- { 11, 12, 12 }, { 11, 12, 12 },
- { 11, 11, 0 }, { 11, 11, 0 },
- { 11, 12, 14 }, { 11, 12, 14 },
- { 11, 10, 15 }, { 11, 10, 15 },
- { 11, 13, 13 }, { 11, 13, 13 },
- { 11, 0, 13 }, { 11, 0, 13 },
- { 11, 14, 12 }, { 11, 14, 12 },
- { 11, 15, 10 }, { 11, 15, 10 },
- { 11, 15, 11 }, { 11, 15, 11 },
- { 11, 11, 15 }, { 11, 11, 15 },
- { 11, 14, 13 }, { 11, 14, 13 },
- { 11, 13, 0 }, { 11, 13, 0 },
- { 11, 0, 11 }, { 11, 0, 11 },
- { 11, 13, 14 }, { 11, 13, 14 },
- { 11, 15, 12 }, { 11, 15, 12 },
- { 11, 15, 13 }, { 11, 15, 13 },
- { 11, 12, 15 }, { 11, 12, 15 },
- { 11, 14, 0 }, { 11, 14, 0 },
- { 11, 14, 14 }, { 11, 14, 14 },
- { 11, 13, 15 }, { 11, 13, 15 },
- { 11, 12, 0 }, { 11, 12, 0 },
- { 11, 14, 15 }, { 11, 14, 15 },
- { 12, 0, 14 },
- { 12, 0, 12 },
- { 12, 15, 14 },
- { 12, 15, 0 },
- { 12, 0, 15 },
- { 12, 15, 15 }
-};
diff --git a/src/libfaad/codebook/hcb_2.h b/src/libfaad/codebook/hcb_2.h
deleted file mode 100644
index 6aff6b12b..000000000
--- a/src/libfaad/codebook/hcb_2.h
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: hcb_2.h,v 1.4 2005/10/29 23:57:08 tmmm Exp $
-**/
-
-/* 2-step huffman table HCB_2 */
-
-
-/* 1st step: 5 bits
- * 2^5 = 32 entries
- *
- * Used to find offset into 2nd step table and number of extra bits to get
- */
-static hcb hcb2_1[] = {
- { /* 00000 */ 0, 0 },
- { /* */ 0, 0 },
- { /* */ 0, 0 },
- { /* */ 0, 0 },
- { /* 00100 */ 1, 0 },
- { /* */ 1, 0 },
- { /* 00110 */ 2, 0 },
- { /* 00111 */ 3, 0 },
- { /* 01000 */ 4, 0 },
- { /* 01001 */ 5, 0 },
- { /* 01010 */ 6, 0 },
- { /* 01011 */ 7, 0 },
- { /* 01100 */ 8, 0 },
-
- /* 6 bit codewords */
- { /* 01101 */ 9, 1 },
- { /* 01110 */ 11, 1 },
- { /* 01111 */ 13, 1 },
- { /* 10000 */ 15, 1 },
- { /* 10001 */ 17, 1 },
- { /* 10010 */ 19, 1 },
- { /* 10011 */ 21, 1 },
- { /* 10100 */ 23, 1 },
- { /* 10101 */ 25, 1 },
- { /* 10110 */ 27, 1 },
- { /* 10111 */ 29, 1 },
- { /* 11000 */ 31, 1 },
-
- /* 7 bit codewords */
- { /* 11001 */ 33, 2 },
- { /* 11010 */ 37, 2 },
- { /* 11011 */ 41, 2 },
-
- /* 7/8 bit codewords */
- { /* 11100 */ 45, 3 },
-
- /* 8 bit codewords */
- { /* 11101 */ 53, 3 },
- { /* 11110 */ 61, 3 },
-
- /* 8/9 bit codewords */
- { /* 11111 */ 69, 4 }
-};
-
-/* 2nd step table
- *
- * Gives size of codeword and actual data (x,y,v,w)
- */
-static hcb_2_quad hcb2_2[] = {
- /* 3 bit codeword */
- { 3, 0, 0, 0, 0 },
-
- /* 4 bit codeword */
- { 4, 1, 0, 0, 0 },
-
- /* 5 bit codewords */
- { 5, -1, 0, 0, 0 },
- { 5, 0, 0, 0, 1 },
- { 5, 0, 0, -1, 0 },
- { 5, 0, 0, 0, -1 },
- { 5, 0, -1, 0, 0 },
- { 5, 0, 0, 1, 0 },
- { 5, 0, 1, 0, 0 },
-
- /* 6 bit codewords */
- { 6, 0, -1, 1, 0 },
- { 6, -1, 1, 0, 0 },
- { 6, 0, 1, -1, 0 },
- { 6, 0, 0, 1, -1 },
- { 6, 0, 1, 0, -1 },
- { 6, 0, 0, -1, 1 },
- { 6, -1, 0, 0, -1 },
- { 6, 1, -1, 0, 0 },
- { 6, 1, 0, -1, 0 },
- { 6, -1, -1, 0, 0 },
- { 6, 0, 0, -1, -1 },
- { 6, 1, 0, 1, 0 },
- { 6, 1, 0, 0, 1 },
- { 6, 0, -1, 0, 1 },
- { 6, -1, 0, 1, 0 },
- { 6, 0, 1, 0, 1 },
- { 6, 0, -1, -1, 0 },
- { 6, -1, 0, 0, 1 },
- { 6, 0, -1, 0, -1 },
- { 6, -1, 0, -1, 0 },
- { 6, 1, 1, 0, 0 },
- { 6, 0, 1, 1, 0 },
- { 6, 0, 0, 1, 1 },
- { 6, 1, 0, 0, -1 },
-
- /* 7 bit codewords */
- { 7, 0, 1, -1, 1 },
- { 7, 1, 0, -1, 1 },
- { 7, -1, 1, -1, 0 },
- { 7, 0, -1, 1, -1 },
- { 7, 1, -1, 1, 0 },
- { 7, 1, 1, 0, -1 },
- { 7, 1, 0, 1, 1 },
- { 7, -1, 1, 1, 0 },
- { 7, 0, -1, -1, 1 },
- { 7, 1, 1, 1, 0 },
- { 7, -1, 0, 1, -1 },
- { 7, -1, -1, -1, 0 },
-
- /* 7/8 bit codewords */
- { 7, -1, 0, -1, 1 }, { 7, -1, 0, -1, 1 },
- { 7, 1, -1, -1, 0 }, { 7, 1, -1, -1, 0 },
- { 7, 1, 1, -1, 0 }, { 7, 1, 1, -1, 0 },
- { 8, 1, -1, 0, 1 },
- { 8, -1, 1, 0, -1 },
-
- /* 8 bit codewords */
- { 8, -1, -1, 1, 0 },
- { 8, -1, 0, 1, 1 },
- { 8, -1, -1, 0, 1 },
- { 8, -1, -1, 0, -1 },
- { 8, 0, -1, -1, -1 },
- { 8, 1, 0, 1, -1 },
- { 8, 1, 0, -1, -1 },
- { 8, 0, 1, -1, -1 },
- { 8, 0, 1, 1, 1 },
- { 8, -1, 1, 0, 1 },
- { 8, -1, 0, -1, -1 },
- { 8, 0, 1, 1, -1 },
- { 8, 1, -1, 0, -1 },
- { 8, 0, -1, 1, 1 },
- { 8, 1, 1, 0, 1 },
- { 8, 1, -1, 1, -1 },
-
- /* 8/9 bit codewords */
- { 8, -1, 1, -1, 1 }, { 8, -1, 1, -1, 1 },
- { 9, 1, -1, -1, 1 },
- { 9, -1, -1, -1, -1 },
- { 9, -1, 1, 1, -1 },
- { 9, -1, 1, 1, 1 },
- { 9, 1, 1, 1, 1 },
- { 9, -1, -1, 1, -1 },
- { 9, 1, -1, 1, 1 },
- { 9, -1, 1, -1, -1 },
- { 9, -1, -1, 1, 1 },
- { 9, 1, 1, -1, -1 },
- { 9, 1, -1, -1, -1 },
- { 9, -1, -1, -1, 1 },
- { 9, 1, 1, -1, 1 },
- { 9, 1, 1, 1, -1 }
-};
diff --git a/src/libfaad/codebook/hcb_3.h b/src/libfaad/codebook/hcb_3.h
deleted file mode 100644
index 25b54da90..000000000
--- a/src/libfaad/codebook/hcb_3.h
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: hcb_3.h,v 1.4 2005/10/29 23:57:08 tmmm Exp $
-**/
-
-/* Binary search huffman table HCB_3 */
-
-
-static hcb_bin_quad hcb3[] = {
- { /* 0 */ 0, { 1, 2, 0, 0 } },
- { /* 1 */ 1, { 0, 0, 0, 0 } }, /* 0 */
- { /* 2 */ 0, { 1, 2, 0, 0 } },
- { /* 3 */ 0, { 2, 3, 0, 0 } },
- { /* 4 */ 0, { 3, 4, 0, 0 } },
- { /* 5 */ 0, { 4, 5, 0, 0 } },
- { /* 6 */ 0, { 5, 6, 0, 0 } },
- { /* 7 */ 0, { 6, 7, 0, 0 } },
- { /* 8 */ 0, { 7, 8, 0, 0 } },
- { /* 9 */ 1, { 1, 0, 0, 0 } }, /* 1000 */
- { /* 10 */ 1, { 0, 0, 0, 1 } }, /* 1001 */
- { /* 11 */ 1, { 0, 1, 0, 0 } }, /* 1010 */
- { /* 12 */ 1, { 0, 0, 1, 0 } }, /* 1011 */
- { /* 13 */ 0, { 4, 5, 0, 0 } },
- { /* 14 */ 0, { 5, 6, 0, 0 } },
- { /* 15 */ 0, { 6, 7, 0, 0 } },
- { /* 16 */ 0, { 7, 8, 0, 0 } },
- { /* 17 */ 1, { 1, 1, 0, 0 } },
- { /* 18 */ 1, { 0, 0, 1, 1 } },
- { /* 19 */ 0, { 6, 7, 0, 0 } },
- { /* 20 */ 0, { 7, 8, 0, 0 } },
- { /* 21 */ 0, { 8, 9, 0, 0 } },
- { /* 22 */ 0, { 9, 10, 0, 0 } },
- { /* 23 */ 0, { 10, 11, 0, 0 } },
- { /* 24 */ 0, { 11, 12, 0, 0 } },
- { /* 25 */ 1, { 0, 1, 1, 0 } }, /* 110100 */
- { /* 26 */ 1, { 0, 1, 0, 1 } }, /* 110101 */
- { /* 27 */ 1, { 1, 0, 1, 0 } }, /* 110110 */
- { /* 28 */ 1, { 0, 1, 1, 1 } }, /* 110111 */
- { /* 29 */ 1, { 1, 0, 0, 1 } }, /* 111000 */
- { /* 30 */ 1, { 1, 1, 1, 0 } }, /* 111001 */
- { /* 31 */ 0, { 6, 7, 0, 0 } },
- { /* 32 */ 0, { 7, 8, 0, 0 } },
- { /* 33 */ 0, { 8, 9, 0, 0 } },
- { /* 34 */ 0, { 9, 10, 0, 0 } },
- { /* 35 */ 0, { 10, 11, 0, 0 } },
- { /* 36 */ 0, { 11, 12, 0, 0 } },
- { /* 37 */ 1, { 1, 1, 1, 1 } }, /* 1110100 */
- { /* 38 */ 1, { 1, 0, 1, 1 } }, /* 1110101 */
- { /* 39 */ 1, { 1, 1, 0, 1 } }, /* 1110110 */
- { /* 40 */ 0, { 9, 10, 0, 0 } },
- { /* 41 */ 0, { 10, 11, 0, 0 } },
- { /* 42 */ 0, { 11, 12, 0, 0 } },
- { /* 43 */ 0, { 12, 13, 0, 0 } },
- { /* 44 */ 0, { 13, 14, 0, 0 } },
- { /* 45 */ 0, { 14, 15, 0, 0 } },
- { /* 46 */ 0, { 15, 16, 0, 0 } },
- { /* 47 */ 0, { 16, 17, 0, 0 } },
- { /* 48 */ 0, { 17, 18, 0, 0 } },
- { /* 49 */ 1, { 2, 0, 0, 0 } }, /* 11101110 */
- { /* 50 */ 1, { 0, 0, 0, 2 } }, /* 11101111 */
- { /* 51 */ 1, { 0, 0, 1, 2 } }, /* 11110000 */
- { /* 52 */ 1, { 2, 1, 0, 0 } }, /* 11110001 */
- { /* 53 */ 1, { 1, 2, 1, 0 } }, /* 11110010 */
- { /* 54 */ 0, { 13, 14, 0, 0 } },
- { /* 55 */ 0, { 14, 15, 0, 0 } },
- { /* 56 */ 0, { 15, 16, 0, 0 } },
- { /* 57 */ 0, { 16, 17, 0, 0 } },
- { /* 58 */ 0, { 17, 18, 0, 0 } },
- { /* 59 */ 0, { 18, 19, 0, 0 } },
- { /* 60 */ 0, { 19, 20, 0, 0 } },
- { /* 61 */ 0, { 20, 21, 0, 0 } },
- { /* 62 */ 0, { 21, 22, 0, 0 } },
- { /* 63 */ 0, { 22, 23, 0, 0 } },
- { /* 64 */ 0, { 23, 24, 0, 0 } },
- { /* 65 */ 0, { 24, 25, 0, 0 } },
- { /* 66 */ 0, { 25, 26, 0, 0 } },
- { /* 67 */ 1, { 0, 0, 2, 1 } },
- { /* 68 */ 1, { 0, 1, 2, 1 } },
- { /* 69 */ 1, { 1, 2, 0, 0 } },
- { /* 70 */ 1, { 0, 1, 1, 2 } },
- { /* 71 */ 1, { 2, 1, 1, 0 } },
- { /* 72 */ 1, { 0, 0, 2, 0 } },
- { /* 73 */ 1, { 0, 2, 1, 0 } },
- { /* 74 */ 1, { 0, 1, 2, 0 } },
- { /* 75 */ 1, { 0, 2, 0, 0 } },
- { /* 76 */ 1, { 0, 1, 0, 2 } },
- { /* 77 */ 1, { 2, 0, 1, 0 } },
- { /* 78 */ 1, { 1, 2, 1, 1 } },
- { /* 79 */ 1, { 0, 2, 1, 1 } },
- { /* 80 */ 1, { 1, 1, 2, 0 } },
- { /* 81 */ 1, { 1, 1, 2, 1 } },
- { /* 82 */ 0, { 11, 12, 0, 0 } },
- { /* 83 */ 0, { 12, 13, 0, 0 } },
- { /* 84 */ 0, { 13, 14, 0, 0 } },
- { /* 85 */ 0, { 14, 15, 0, 0 } },
- { /* 86 */ 0, { 15, 16, 0, 0 } },
- { /* 87 */ 0, { 16, 17, 0, 0 } },
- { /* 88 */ 0, { 17, 18, 0, 0 } },
- { /* 89 */ 0, { 18, 19, 0, 0 } },
- { /* 90 */ 0, { 19, 20, 0, 0 } },
- { /* 91 */ 0, { 20, 21, 0, 0 } },
- { /* 92 */ 0, { 21, 22, 0, 0 } },
- { /* 93 */ 1, { 1, 2, 0, 1 } }, /* 1111101010 */
- { /* 94 */ 1, { 1, 0, 2, 0 } }, /* 1111101011 */
- { /* 95 */ 1, { 1, 0, 2, 1 } }, /* 1111101100 */
- { /* 96 */ 1, { 0, 2, 0, 1 } }, /* 1111101101 */
- { /* 97 */ 1, { 2, 1, 1, 1 } }, /* 1111101110 */
- { /* 98 */ 1, { 1, 1, 1, 2 } }, /* 1111101111 */
- { /* 99 */ 1, { 2, 1, 0, 1 } }, /* 1111110000 */
- { /* 00 */ 1, { 1, 0, 1, 2 } }, /* 1111110001 */
- { /* 01 */ 1, { 0, 0, 2, 2 } }, /* 1111110010 */
- { /* 02 */ 1, { 0, 1, 2, 2 } }, /* 1111110011 */
- { /* 03 */ 1, { 2, 2, 1, 0 } }, /* 1111110100 */
- { /* 04 */ 1, { 1, 2, 2, 0 } }, /* 1111110101 */
- { /* 05 */ 1, { 1, 0, 0, 2 } }, /* 1111110110 */
- { /* 06 */ 1, { 2, 0, 0, 1 } }, /* 1111110111 */
- { /* 07 */ 1, { 0, 2, 2, 1 } }, /* 1111111000 */
- { /* 08 */ 0, { 7, 8, 0, 0 } },
- { /* 09 */ 0, { 8, 9, 0, 0 } },
- { /* 10 */ 0, { 9, 10, 0, 0 } },
- { /* 11 */ 0, { 10, 11, 0, 0 } },
- { /* 12 */ 0, { 11, 12, 0, 0 } },
- { /* 13 */ 0, { 12, 13, 0, 0 } },
- { /* 14 */ 0, { 13, 14, 0, 0 } },
- { /* 15 */ 1, { 2, 2, 0, 0 } }, /* 11111110010 */
- { /* 16 */ 1, { 1, 2, 2, 1 } }, /* 11111110011 */
- { /* 17 */ 1, { 1, 1, 0, 2 } }, /* 11111110100 */
- { /* 18 */ 1, { 2, 0, 1, 1 } }, /* 11111110101 */
- { /* 19 */ 1, { 1, 1, 2, 2 } }, /* 11111110110 */
- { /* 20 */ 1, { 2, 2, 1, 1 } }, /* 11111110111 */
- { /* 21 */ 1, { 0, 2, 2, 0 } }, /* 11111111000 */
- { /* 22 */ 1, { 0, 2, 1, 2 } }, /* 11111111001 */
- { /* 23 */ 0, { 6, 7, 0, 0 } },
- { /* 24 */ 0, { 7, 8, 0, 0 } },
- { /* 25 */ 0, { 8, 9, 0, 0 } },
- { /* 26 */ 0, { 9, 10, 0, 0 } },
- { /* 27 */ 0, { 10, 11, 0, 0 } },
- { /* 28 */ 0, { 11, 12, 0, 0 } },
- { /* 29 */ 1, { 1, 0, 2, 2 } }, /* 111111110100 */
- { /* 30 */ 1, { 2, 2, 0, 1 } }, /* 111111110101 */
- { /* 31 */ 1, { 2, 1, 2, 0 } }, /* 111111110110 */
- { /* 32 */ 1, { 2, 2, 2, 0 } }, /* 111111110111 */
- { /* 33 */ 1, { 0, 2, 2, 2 } }, /* 111111111000 */
- { /* 34 */ 1, { 2, 2, 2, 1 } }, /* 111111111001 */
- { /* 35 */ 1, { 2, 1, 2, 1 } }, /* 111111111010 */
- { /* 36 */ 1, { 1, 2, 1, 2 } }, /* 111111111011 */
- { /* 37 */ 1, { 1, 2, 2, 2 } }, /* 111111111100 */
- { /* 38 */ 0, { 3, 4, 0, 0 } },
- { /* 39 */ 0, { 4, 5, 0, 0 } },
- { /* 40 */ 0, { 5, 6, 0, 0 } },
- { /* 41 */ 1, { 0, 2, 0, 2 } }, /* 1111111111010 */
- { /* 42 */ 1, { 2, 0, 2, 0 } }, /* 1111111111011 */
- { /* 43 */ 1, { 1, 2, 0, 2 } }, /* 1111111111100 */
- { /* 44 */ 0, { 3, 4, 0, 0 } },
- { /* 45 */ 0, { 4, 5, 0, 0 } },
- { /* 46 */ 0, { 5, 6, 0, 0 } },
- { /* 47 */ 1, { 2, 0, 2, 1 } }, /* 11111111111010 */
- { /* 48 */ 1, { 2, 1, 1, 2 } }, /* 11111111111011 */
- { /* 49 */ 1, { 2, 1, 0, 2 } }, /* 11111111111100 */
- { /* 50 */ 0, { 3, 4, 0, 0 } },
- { /* 51 */ 0, { 4, 5, 0, 0 } },
- { /* 52 */ 0, { 5, 6, 0, 0 } },
- { /* 53 */ 1, { 2, 2, 2, 2 } }, /* 111111111111010 */
- { /* 54 */ 1, { 2, 2, 1, 2 } }, /* 111111111111011 */
- { /* 55 */ 1, { 2, 1, 2, 2 } }, /* 111111111111100 */
- { /* 56 */ 1, { 2, 0, 1, 2 } }, /* 111111111111101 */
- { /* 57 */ 1, { 2, 0, 0, 2 } }, /* 111111111111110 */
- { /* 58 */ 0, { 1, 2, 0, 0 } },
- { /* 59 */ 1, { 2, 2, 0, 2 } }, /* 1111111111111110 */
- { /* 60 */ 1, { 2, 0, 2, 2 } } /* 1111111111111111 */
-};
diff --git a/src/libfaad/codebook/hcb_4.h b/src/libfaad/codebook/hcb_4.h
deleted file mode 100644
index 9378b0980..000000000
--- a/src/libfaad/codebook/hcb_4.h
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: hcb_4.h,v 1.4 2005/10/29 23:57:08 tmmm Exp $
-**/
-
-/* 2-step huffman table HCB_4 */
-
-
-/* 1st step: 5 bits
- * 2^5 = 32 entries
- *
- * Used to find offset into 2nd step table and number of extra bits to get
- */
-static hcb hcb4_1[] = {
- /* 4 bit codewords */
- { /* 00000 */ 0, 0 },
- { /* */ 0, 0 },
- { /* 00010 */ 1, 0 },
- { /* */ 1, 0 },
- { /* 00100 */ 2, 0 },
- { /* */ 2, 0 },
- { /* 00110 */ 3, 0 },
- { /* */ 3, 0 },
- { /* 01000 */ 4, 0 },
- { /* */ 4, 0 },
- { /* 01010 */ 5, 0 },
- { /* */ 5, 0 },
- { /* 01100 */ 6, 0 },
- { /* */ 6, 0 },
- { /* 01110 */ 7, 0 },
- { /* */ 7, 0 },
- { /* 10000 */ 8, 0 },
- { /* */ 8, 0 },
- { /* 10010 */ 9, 0 },
- { /* */ 9, 0 },
-
- /* 5 bit codewords */
- { /* 10100 */ 10, 0 },
- { /* 10101 */ 11, 0 },
- { /* 10110 */ 12, 0 },
- { /* 10111 */ 13, 0 },
- { /* 11000 */ 14, 0 },
- { /* 11001 */ 15, 0 },
-
- /* 7 bit codewords */
- { /* 11010 */ 16, 2 },
- { /* 11011 */ 20, 2 },
-
- /* 7/8 bit codewords */
- { /* 11100 */ 24, 3 },
-
- /* 8 bit codewords */
- { /* 11101 */ 32, 3 },
-
- /* 8/9 bit codewords */
- { /* 11110 */ 40, 4 },
-
- /* 9/10/11/12 bit codewords */
- { /* 11111 */ 56, 7 }
-};
-
-/* 2nd step table
- *
- * Gives size of codeword and actual data (x,y,v,w)
- */
-static hcb_2_quad hcb4_2[] = {
- /* 4 bit codewords */
- { 4, 1, 1, 1, 1 },
- { 4, 0, 1, 1, 1 },
- { 4, 1, 1, 0, 1 },
- { 4, 1, 1, 1, 0 },
- { 4, 1, 0, 1, 1 },
- { 4, 1, 0, 0, 0 },
- { 4, 1, 1, 0, 0 },
- { 4, 0, 0, 0, 0 },
- { 4, 0, 0, 1, 1 },
- { 4, 1, 0, 1, 0 },
-
- /* 5 bit codewords */
- { 5, 1, 0, 0, 1 },
- { 5, 0, 1, 1, 0 },
- { 5, 0, 0, 0, 1 },
- { 5, 0, 1, 0, 1 },
- { 5, 0, 0, 1, 0 },
- { 5, 0, 1, 0, 0 },
-
- /* 7 bit codewords */
- /* first 5 bits: 11010 */
- { 7, 2, 1, 1, 1 },
- { 7, 1, 1, 2, 1 },
- { 7, 1, 2, 1, 1 },
- { 7, 1, 1, 1, 2 },
- /* first 5 bits: 11011 */
- { 7, 2, 1, 1, 0 },
- { 7, 2, 1, 0, 1 },
- { 7, 1, 2, 1, 0 },
- { 7, 2, 0, 1, 1 },
-
- /* 7/8 bit codewords */
- /* first 5 bits: 11100 */
- { 7, 0, 1, 2, 1 }, { 7, 0, 1, 2, 1 },
- { 8, 0, 1, 1, 2 },
- { 8, 1, 1, 2, 0 },
- { 8, 0, 2, 1, 1 },
- { 8, 1, 0, 1, 2 },
- { 8, 1, 2, 0, 1 },
- { 8, 1, 1, 0, 2 },
-
- /* 8 bit codewords */
- { 8, 1, 0, 2, 1 },
- { 8, 2, 1, 0, 0 },
- { 8, 2, 0, 1, 0 },
- { 8, 1, 2, 0, 0 },
- { 8, 2, 0, 0, 1 },
- { 8, 0, 1, 0, 2 },
- { 8, 0, 2, 1, 0 },
- { 8, 0, 0, 1, 2 },
-
- /* 8/9 bit codewords */
- { 8, 0, 1, 2, 0 }, { 8, 0, 1, 2, 0 },
- { 8, 0, 2, 0, 1 }, { 8, 0, 2, 0, 1 },
- { 8, 1, 0, 0, 2 }, { 8, 1, 0, 0, 2 },
- { 8, 0, 0, 2, 1 }, { 8, 0, 0, 2, 1 },
- { 8, 1, 0, 2, 0 }, { 8, 1, 0, 2, 0 },
- { 8, 2, 0, 0, 0 }, { 8, 2, 0, 0, 0 },
- { 8, 0, 0, 0, 2 }, { 8, 0, 0, 0, 2 },
- { 9, 0, 2, 0, 0 },
- { 9, 0, 0, 2, 0 },
-
- /* 9/10/11 bit codewords */
- /* 9 bit codewords repeated 2^3 = 8 times */
- { 9, 1, 2, 2, 1 }, { 9, 1, 2, 2, 1 }, { 9, 1, 2, 2, 1 }, { 9, 1, 2, 2, 1 },
- { 9, 1, 2, 2, 1 }, { 9, 1, 2, 2, 1 }, { 9, 1, 2, 2, 1 }, { 9, 1, 2, 2, 1 },
- { 9, 2, 2, 1, 1 }, { 9, 2, 2, 1, 1 }, { 9, 2, 2, 1, 1 }, { 9, 2, 2, 1, 1 },
- { 9, 2, 2, 1, 1 }, { 9, 2, 2, 1, 1 }, { 9, 2, 2, 1, 1 }, { 9, 2, 2, 1, 1 },
- { 9, 2, 1, 2, 1 }, { 9, 2, 1, 2, 1 }, { 9, 2, 1, 2, 1 }, { 9, 2, 1, 2, 1 },
- { 9, 2, 1, 2, 1 }, { 9, 2, 1, 2, 1 }, { 9, 2, 1, 2, 1 }, { 9, 2, 1, 2, 1 },
- { 9, 1, 1, 2, 2 }, { 9, 1, 1, 2, 2 }, { 9, 1, 1, 2, 2 }, { 9, 1, 1, 2, 2 },
- { 9, 1, 1, 2, 2 }, { 9, 1, 1, 2, 2 }, { 9, 1, 1, 2, 2 }, { 9, 1, 1, 2, 2 },
- { 9, 1, 2, 1, 2 }, { 9, 1, 2, 1, 2 }, { 9, 1, 2, 1, 2 }, { 9, 1, 2, 1, 2 },
- { 9, 1, 2, 1, 2 }, { 9, 1, 2, 1, 2 }, { 9, 1, 2, 1, 2 }, { 9, 1, 2, 1, 2 },
- { 9, 2, 1, 1, 2 }, { 9, 2, 1, 1, 2 }, { 9, 2, 1, 1, 2 }, { 9, 2, 1, 1, 2 },
- { 9, 2, 1, 1, 2 }, { 9, 2, 1, 1, 2 }, { 9, 2, 1, 1, 2 }, { 9, 2, 1, 1, 2 },
- /* 10 bit codewords repeated 2^2 = 4 times */
- { 10, 1, 2, 2, 0 }, { 10, 1, 2, 2, 0 }, { 10, 1, 2, 2, 0 }, { 10, 1, 2, 2, 0 },
- { 10, 2, 2, 1, 0 }, { 10, 2, 2, 1, 0 }, { 10, 2, 2, 1, 0 }, { 10, 2, 2, 1, 0 },
- { 10, 2, 1, 2, 0 }, { 10, 2, 1, 2, 0 }, { 10, 2, 1, 2, 0 }, { 10, 2, 1, 2, 0 },
- { 10, 0, 2, 2, 1 }, { 10, 0, 2, 2, 1 }, { 10, 0, 2, 2, 1 }, { 10, 0, 2, 2, 1 },
- { 10, 0, 1, 2, 2 }, { 10, 0, 1, 2, 2 }, { 10, 0, 1, 2, 2 }, { 10, 0, 1, 2, 2 },
- { 10, 2, 2, 0, 1 }, { 10, 2, 2, 0, 1 }, { 10, 2, 2, 0, 1 }, { 10, 2, 2, 0, 1 },
- { 10, 0, 2, 1, 2 }, { 10, 0, 2, 1, 2 }, { 10, 0, 2, 1, 2 }, { 10, 0, 2, 1, 2 },
- { 10, 2, 0, 2, 1 }, { 10, 2, 0, 2, 1 }, { 10, 2, 0, 2, 1 }, { 10, 2, 0, 2, 1 },
- { 10, 1, 0, 2, 2 }, { 10, 1, 0, 2, 2 }, { 10, 1, 0, 2, 2 }, { 10, 1, 0, 2, 2 },
- { 10, 2, 2, 2, 1 }, { 10, 2, 2, 2, 1 }, { 10, 2, 2, 2, 1 }, { 10, 2, 2, 2, 1 },
- { 10, 1, 2, 0, 2 }, { 10, 1, 2, 0, 2 }, { 10, 1, 2, 0, 2 }, { 10, 1, 2, 0, 2 },
- { 10, 2, 0, 1, 2 }, { 10, 2, 0, 1, 2 }, { 10, 2, 0, 1, 2 }, { 10, 2, 0, 1, 2 },
- { 10, 2, 1, 0, 2 }, { 10, 2, 1, 0, 2 }, { 10, 2, 1, 0, 2 }, { 10, 2, 1, 0, 2 },
- { 10, 1, 2, 2, 2 }, { 10, 1, 2, 2, 2 }, { 10, 1, 2, 2, 2 }, { 10, 1, 2, 2, 2 },
- /* 11 bit codewords repeated 2^1 = 2 times */
- { 11, 2, 1, 2, 2 }, { 11, 2, 1, 2, 2 },
- { 11, 2, 2, 1, 2 }, { 11, 2, 2, 1, 2 },
- { 11, 0, 2, 2, 0 }, { 11, 0, 2, 2, 0 },
- { 11, 2, 2, 0, 0 }, { 11, 2, 2, 0, 0 },
- { 11, 0, 0, 2, 2 }, { 11, 0, 0, 2, 2 },
- { 11, 2, 0, 2, 0 }, { 11, 2, 0, 2, 0 },
- { 11, 0, 2, 0, 2 }, { 11, 0, 2, 0, 2 },
- { 11, 2, 0, 0, 2 }, { 11, 2, 0, 0, 2 },
- { 11, 2, 2, 2, 2 }, { 11, 2, 2, 2, 2 },
- { 11, 0, 2, 2, 2 }, { 11, 0, 2, 2, 2 },
- { 11, 2, 2, 2, 0 }, { 11, 2, 2, 2, 0 },
- /* 12 bit codewords */
- { 12, 2, 2, 0, 2 },
- { 12, 2, 0, 2, 2 },
-};
diff --git a/src/libfaad/codebook/hcb_5.h b/src/libfaad/codebook/hcb_5.h
deleted file mode 100644
index 7e50207e3..000000000
--- a/src/libfaad/codebook/hcb_5.h
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: hcb_5.h,v 1.4 2005/10/29 23:57:08 tmmm Exp $
-**/
-
-/* Binary search huffman table HCB_5 */
-
-
-static hcb_bin_pair hcb5[] = {
- { /* 0 */ 0, { 1, 2 } },
- { /* 1 */ 1, { 0, 0 } }, /* 0 */
- { /* 2 */ 0, { 1, 2 } },
- { /* 3 */ 0, { 2, 3 } },
- { /* 4 */ 0, { 3, 4 } },
- { /* 5 */ 0, { 4, 5 } },
- { /* 6 */ 0, { 5, 6 } },
- { /* 7 */ 0, { 6, 7 } },
- { /* 8 */ 0, { 7, 8 } },
- { /* 9 */ 1, { -1, 0 } }, /* 1000 */
- { /* 10 */ 1, { 1, 0 } }, /* 1001 */
- { /* 11 */ 1, { 0, 1 } }, /* 1010 */
- { /* 12 */ 1, { 0, -1 } }, /* 1011 */
- { /* 13 */ 0, { 4, 5 } },
- { /* 14 */ 0, { 5, 6 } },
- { /* 15 */ 0, { 6, 7 } },
- { /* 16 */ 0, { 7, 8 } },
- { /* 17 */ 1, { 1, -1 } },
- { /* 18 */ 1, { -1, 1 } },
- { /* 19 */ 1, { -1, -1 } },
- { /* 20 */ 1, { 1, 1 } },
- { /* 21 */ 0, { 4, 5 } },
- { /* 22 */ 0, { 5, 6 } },
- { /* 23 */ 0, { 6, 7 } },
- { /* 24 */ 0, { 7, 8 } },
- { /* 25 */ 0, { 8, 9 } },
- { /* 26 */ 0, { 9, 10 } },
- { /* 27 */ 0, { 10, 11 } },
- { /* 28 */ 0, { 11, 12 } },
- { /* 29 */ 0, { 12, 13 } },
- { /* 30 */ 0, { 13, 14 } },
- { /* 31 */ 0, { 14, 15 } },
- { /* 32 */ 0, { 15, 16 } },
- { /* 33 */ 1, { -2, 0 } },
- { /* 34 */ 1, { 0, 2 } },
- { /* 35 */ 1, { 2, 0 } },
- { /* 36 */ 1, { 0, -2 } },
- { /* 37 */ 0, { 12, 13 } },
- { /* 38 */ 0, { 13, 14 } },
- { /* 39 */ 0, { 14, 15 } },
- { /* 40 */ 0, { 15, 16 } },
- { /* 41 */ 0, { 16, 17 } },
- { /* 42 */ 0, { 17, 18 } },
- { /* 43 */ 0, { 18, 19 } },
- { /* 44 */ 0, { 19, 20 } },
- { /* 45 */ 0, { 20, 21 } },
- { /* 46 */ 0, { 21, 22 } },
- { /* 47 */ 0, { 22, 23 } },
- { /* 48 */ 0, { 23, 24 } },
- { /* 49 */ 1, { -2, -1 } },
- { /* 50 */ 1, { 2, 1 } },
- { /* 51 */ 1, { -1, -2 } },
- { /* 52 */ 1, { 1, 2 } },
- { /* 53 */ 1, { -2, 1 } },
- { /* 54 */ 1, { 2, -1 } },
- { /* 55 */ 1, { -1, 2 } },
- { /* 56 */ 1, { 1, -2 } },
- { /* 57 */ 1, { -3, 0 } },
- { /* 58 */ 1, { 3, 0 } },
- { /* 59 */ 1, { 0, -3 } },
- { /* 60 */ 1, { 0, 3 } },
- { /* 61 */ 0, { 12, 13 } },
- { /* 62 */ 0, { 13, 14 } },
- { /* 63 */ 0, { 14, 15 } },
- { /* 64 */ 0, { 15, 16 } },
- { /* 65 */ 0, { 16, 17 } },
- { /* 66 */ 0, { 17, 18 } },
- { /* 67 */ 0, { 18, 19 } },
- { /* 68 */ 0, { 19, 20 } },
- { /* 69 */ 0, { 20, 21 } },
- { /* 70 */ 0, { 21, 22 } },
- { /* 71 */ 0, { 22, 23 } },
- { /* 72 */ 0, { 23, 24 } },
- { /* 73 */ 1, { -3, -1 } },
- { /* 74 */ 1, { 1, 3 } },
- { /* 75 */ 1, { 3, 1 } },
- { /* 76 */ 1, { -1, -3 } },
- { /* 77 */ 1, { -3, 1 } },
- { /* 78 */ 1, { 3, -1 } },
- { /* 79 */ 1, { 1, -3 } },
- { /* 80 */ 1, { -1, 3 } },
- { /* 81 */ 1, { -2, 2 } },
- { /* 82 */ 1, { 2, 2 } },
- { /* 83 */ 1, { -2, -2 } },
- { /* 84 */ 1, { 2, -2 } },
- { /* 85 */ 0, { 12, 13 } },
- { /* 86 */ 0, { 13, 14 } },
- { /* 87 */ 0, { 14, 15 } },
- { /* 88 */ 0, { 15, 16 } },
- { /* 89 */ 0, { 16, 17 } },
- { /* 90 */ 0, { 17, 18 } },
- { /* 91 */ 0, { 18, 19 } },
- { /* 92 */ 0, { 19, 20 } },
- { /* 93 */ 0, { 20, 21 } },
- { /* 94 */ 0, { 21, 22 } },
- { /* 95 */ 0, { 22, 23 } },
- { /* 96 */ 0, { 23, 24 } },
- { /* 97 */ 1, { -3, -2 } },
- { /* 98 */ 1, { 3, -2 } },
- { /* 99 */ 1, { -2, 3 } },
- { /* 00 */ 1, { 2, -3 } },
- { /* 01 */ 1, { 3, 2 } },
- { /* 02 */ 1, { 2, 3 } },
- { /* 03 */ 1, { -3, 2 } },
- { /* 04 */ 1, { -2, -3 } },
- { /* 05 */ 1, { 0, -4 } },
- { /* 06 */ 1, { -4, 0 } },
- { /* 07 */ 1, { 4, 1 } },
- { /* 08 */ 1, { 4, 0 } },
- { /* 09 */ 0, { 12, 13 } },
- { /* 10 */ 0, { 13, 14 } },
- { /* 11 */ 0, { 14, 15 } },
- { /* 12 */ 0, { 15, 16 } },
- { /* 13 */ 0, { 16, 17 } },
- { /* 14 */ 0, { 17, 18 } },
- { /* 15 */ 0, { 18, 19 } },
- { /* 16 */ 0, { 19, 20 } },
- { /* 17 */ 0, { 20, 21 } },
- { /* 18 */ 0, { 21, 22 } },
- { /* 19 */ 0, { 22, 23 } },
- { /* 20 */ 0, { 23, 24 } },
- { /* 21 */ 1, { -4, -1 } },
- { /* 22 */ 1, { 0, 4 } },
- { /* 23 */ 1, { 4, -1 } },
- { /* 24 */ 1, { -1, -4 } },
- { /* 25 */ 1, { 1, 4 } },
- { /* 26 */ 1, { -1, 4 } },
- { /* 27 */ 1, { -4, 1 } },
- { /* 28 */ 1, { 1, -4 } },
- { /* 29 */ 1, { 3, -3 } },
- { /* 30 */ 1, { -3, -3 } },
- { /* 31 */ 1, { -3, 3 } },
- { /* 32 */ 1, { -2, 4 } },
- { /* 33 */ 1, { -4, -2 } },
- { /* 34 */ 1, { 4, 2 } },
- { /* 35 */ 1, { 2, -4 } },
- { /* 36 */ 1, { 2, 4 } },
- { /* 37 */ 1, { 3, 3 } },
- { /* 38 */ 1, { -4, 2 } },
- { /* 39 */ 0, { 6, 7 } },
- { /* 40 */ 0, { 7, 8 } },
- { /* 41 */ 0, { 8, 9 } },
- { /* 42 */ 0, { 9, 10 } },
- { /* 43 */ 0, { 10, 11 } },
- { /* 44 */ 0, { 11, 12 } },
- { /* 45 */ 1, { -2, -4 } },
- { /* 46 */ 1, { 4, -2 } },
- { /* 47 */ 1, { 3, -4 } },
- { /* 48 */ 1, { -4, -3 } },
- { /* 49 */ 1, { -4, 3 } },
- { /* 50 */ 1, { 3, 4 } },
- { /* 51 */ 1, { -3, 4 } },
- { /* 52 */ 1, { 4, 3 } },
- { /* 53 */ 1, { 4, -3 } },
- { /* 54 */ 1, { -3, -4 } },
- { /* 55 */ 0, { 2, 3 } },
- { /* 56 */ 0, { 3, 4 } },
- { /* 57 */ 1, { 4, -4 } },
- { /* 58 */ 1, { -4, 4 } },
- { /* 59 */ 1, { 4, 4 } },
- { /* 60 */ 1, { -4, -4 } }
-};
diff --git a/src/libfaad/codebook/hcb_6.h b/src/libfaad/codebook/hcb_6.h
deleted file mode 100644
index 12417d997..000000000
--- a/src/libfaad/codebook/hcb_6.h
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: hcb_6.h,v 1.4 2005/10/29 23:57:08 tmmm Exp $
-**/
-
-/* 2-step huffman table HCB_6 */
-
-
-/* 1st step: 5 bits
- * 2^5 = 32 entries
- *
- * Used to find offset into 2nd step table and number of extra bits to get
- */
-static hcb hcb6_1[] = {
- /* 4 bit codewords */
- { /* 00000 */ 0, 0 },
- { /* */ 0, 0 },
- { /* 00010 */ 1, 0 },
- { /* */ 1, 0 },
- { /* 00100 */ 2, 0 },
- { /* */ 2, 0 },
- { /* 00110 */ 3, 0 },
- { /* */ 3, 0 },
- { /* 01000 */ 4, 0 },
- { /* */ 4, 0 },
- { /* 01010 */ 5, 0 },
- { /* */ 5, 0 },
- { /* 01100 */ 6, 0 },
- { /* */ 6, 0 },
- { /* 01110 */ 7, 0 },
- { /* */ 7, 0 },
- { /* 10000 */ 8, 0 },
- { /* */ 8, 0 },
-
- /* 6 bit codewords */
- { /* 10010 */ 9, 1 },
- { /* 10011 */ 11, 1 },
- { /* 10100 */ 13, 1 },
- { /* 10101 */ 15, 1 },
- { /* 10110 */ 17, 1 },
- { /* 10111 */ 19, 1 },
- { /* 11000 */ 21, 1 },
- { /* 11001 */ 23, 1 },
-
- /* 7 bit codewords */
- { /* 11010 */ 25, 2 },
- { /* 11011 */ 29, 2 },
- { /* 11100 */ 33, 2 },
-
- /* 7/8 bit codewords */
- { /* 11101 */ 37, 3 },
-
- /* 8/9 bit codewords */
- { /* 11110 */ 45, 4 },
-
- /* 9/10/11 bit codewords */
- { /* 11111 */ 61, 6 }
-};
-
-/* 2nd step table
- *
- * Gives size of codeword and actual data (x,y,v,w)
- */
-static hcb_2_pair hcb6_2[] = {
- /* 4 bit codewords */
- { 4, 0, 0 },
- { 4, 1, 0 },
- { 4, 0, -1 },
- { 4, 0, 1 },
- { 4, -1, 0 },
- { 4, 1, 1 },
- { 4, -1, 1 },
- { 4, 1, -1 },
- { 4, -1, -1 },
-
- /* 6 bit codewords */
- { 6, 2, -1 },
- { 6, 2, 1 },
- { 6, -2, 1 },
- { 6, -2, -1 },
- { 6, -2, 0 },
- { 6, -1, 2 },
- { 6, 2, 0 },
- { 6, 1, -2 },
- { 6, 1, 2 },
- { 6, 0, -2 },
- { 6, -1, -2 },
- { 6, 0, 2 },
- { 6, 2, -2 },
- { 6, -2, 2 },
- { 6, -2, -2 },
- { 6, 2, 2 },
-
- /* 7 bit codewords */
- { 7, -3, 1 },
- { 7, 3, 1 },
- { 7, 3, -1 },
- { 7, -1, 3 },
- { 7, -3, -1 },
- { 7, 1, 3 },
- { 7, 1, -3 },
- { 7, -1, -3 },
- { 7, 3, 0 },
- { 7, -3, 0 },
- { 7, 0, -3 },
- { 7, 0, 3 },
-
- /* 7/8 bit codewords */
- { 7, 3, 2 }, { 7, 3, 2 },
- { 8, -3, -2 },
- { 8, -2, 3 },
- { 8, 2, 3 },
- { 8, 3, -2 },
- { 8, 2, -3 },
- { 8, -2, -3 },
-
- /* 8 bit codewords */
- { 8, -3, 2 }, { 8, -3, 2 },
- { 8, 3, 3 }, { 8, 3, 3 },
- { 9, 3, -3 },
- { 9, -3, -3 },
- { 9, -3, 3 },
- { 9, 1, -4 },
- { 9, -1, -4 },
- { 9, 4, 1 },
- { 9, -4, 1 },
- { 9, -4, -1 },
- { 9, 1, 4 },
- { 9, 4, -1 },
- { 9, -1, 4 },
- { 9, 0, -4 },
-
- /* 9/10/11 bit codewords */
- { 9, -4, 2 }, { 9, -4, 2 }, { 9, -4, 2 }, { 9, -4, 2 },
- { 9, -4, -2 }, { 9, -4, -2 }, { 9, -4, -2 }, { 9, -4, -2 },
- { 9, 2, 4 }, { 9, 2, 4 }, { 9, 2, 4 }, { 9, 2, 4 },
- { 9, -2, -4 }, { 9, -2, -4 }, { 9, -2, -4 }, { 9, -2, -4 },
- { 9, -4, 0 }, { 9, -4, 0 }, { 9, -4, 0 }, { 9, -4, 0 },
- { 9, 4, 2 }, { 9, 4, 2 }, { 9, 4, 2 }, { 9, 4, 2 },
- { 9, 4, -2 }, { 9, 4, -2 }, { 9, 4, -2 }, { 9, 4, -2 },
- { 9, -2, 4 }, { 9, -2, 4 }, { 9, -2, 4 }, { 9, -2, 4 },
- { 9, 4, 0 }, { 9, 4, 0 }, { 9, 4, 0 }, { 9, 4, 0 },
- { 9, 2, -4 }, { 9, 2, -4 }, { 9, 2, -4 }, { 9, 2, -4 },
- { 9, 0, 4 }, { 9, 0, 4 }, { 9, 0, 4 }, { 9, 0, 4 },
- { 10, -3, -4 }, { 10, -3, -4 },
- { 10, -3, 4 }, { 10, -3, 4 },
- { 10, 3, -4 }, { 10, 3, -4 },
- { 10, 4, -3 }, { 10, 4, -3 },
- { 10, 3, 4 }, { 10, 3, 4 },
- { 10, 4, 3 }, { 10, 4, 3 },
- { 10, -4, 3 }, { 10, -4, 3 },
- { 10, -4, -3 }, { 10, -4, -3 },
- { 11, 4, 4 },
- { 11, -4, 4 },
- { 11, -4, -4 },
- { 11, 4, -4 }
-};
diff --git a/src/libfaad/codebook/hcb_7.h b/src/libfaad/codebook/hcb_7.h
deleted file mode 100644
index e5392326d..000000000
--- a/src/libfaad/codebook/hcb_7.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: hcb_7.h,v 1.4 2005/10/29 23:57:08 tmmm Exp $
-**/
-
-/* Binary search huffman table HCB_7 */
-
-
-static hcb_bin_pair hcb7[] = {
- { /* 0 */ 0, { 1, 2 } },
- { /* 1 */ 1, { 0, 0 } },
- { /* 2 */ 0, { 1, 2 } },
- { /* 3 */ 0, { 2, 3 } },
- { /* 4 */ 0, { 3, 4 } },
- { /* 5 */ 1, { 1, 0 } },
- { /* 6 */ 1, { 0, 1 } },
- { /* 7 */ 0, { 2, 3 } },
- { /* 8 */ 0, { 3, 4 } },
- { /* 9 */ 1, { 1, 1 } },
- { /* 10 */ 0, { 3, 4 } },
- { /* 11 */ 0, { 4, 5 } },
- { /* 12 */ 0, { 5, 6 } },
- { /* 13 */ 0, { 6, 7 } },
- { /* 14 */ 0, { 7, 8 } },
- { /* 15 */ 0, { 8, 9 } },
- { /* 16 */ 0, { 9, 10 } },
- { /* 17 */ 0, { 10, 11 } },
- { /* 18 */ 0, { 11, 12 } },
- { /* 19 */ 1, { 2, 1 } },
- { /* 20 */ 1, { 1, 2 } },
- { /* 21 */ 1, { 2, 0 } },
- { /* 22 */ 1, { 0, 2 } },
- { /* 23 */ 0, { 8, 9 } },
- { /* 24 */ 0, { 9, 10 } },
- { /* 25 */ 0, { 10, 11 } },
- { /* 26 */ 0, { 11, 12 } },
- { /* 27 */ 0, { 12, 13 } },
- { /* 28 */ 0, { 13, 14 } },
- { /* 29 */ 0, { 14, 15 } },
- { /* 30 */ 0, { 15, 16 } },
- { /* 31 */ 1, { 3, 1 } },
- { /* 32 */ 1, { 1, 3 } },
- { /* 33 */ 1, { 2, 2 } },
- { /* 34 */ 1, { 3, 0 } },
- { /* 35 */ 1, { 0, 3 } },
- { /* 36 */ 0, { 11, 12 } },
- { /* 37 */ 0, { 12, 13 } },
- { /* 38 */ 0, { 13, 14 } },
- { /* 39 */ 0, { 14, 15 } },
- { /* 40 */ 0, { 15, 16 } },
- { /* 41 */ 0, { 16, 17 } },
- { /* 42 */ 0, { 17, 18 } },
- { /* 43 */ 0, { 18, 19 } },
- { /* 44 */ 0, { 19, 20 } },
- { /* 45 */ 0, { 20, 21 } },
- { /* 46 */ 0, { 21, 22 } },
- { /* 47 */ 1, { 2, 3 } },
- { /* 48 */ 1, { 3, 2 } },
- { /* 49 */ 1, { 1, 4 } },
- { /* 50 */ 1, { 4, 1 } },
- { /* 51 */ 1, { 1, 5 } },
- { /* 52 */ 1, { 5, 1 } },
- { /* 53 */ 1, { 3, 3 } },
- { /* 54 */ 1, { 2, 4 } },
- { /* 55 */ 1, { 0, 4 } },
- { /* 56 */ 1, { 4, 0 } },
- { /* 57 */ 0, { 12, 13 } },
- { /* 58 */ 0, { 13, 14 } },
- { /* 59 */ 0, { 14, 15 } },
- { /* 60 */ 0, { 15, 16 } },
- { /* 61 */ 0, { 16, 17 } },
- { /* 62 */ 0, { 17, 18 } },
- { /* 63 */ 0, { 18, 19 } },
- { /* 64 */ 0, { 19, 20 } },
- { /* 65 */ 0, { 20, 21 } },
- { /* 66 */ 0, { 21, 22 } },
- { /* 67 */ 0, { 22, 23 } },
- { /* 68 */ 0, { 23, 24 } },
- { /* 69 */ 1, { 4, 2 } },
- { /* 70 */ 1, { 2, 5 } },
- { /* 71 */ 1, { 5, 2 } },
- { /* 72 */ 1, { 0, 5 } },
- { /* 73 */ 1, { 6, 1 } },
- { /* 74 */ 1, { 5, 0 } },
- { /* 75 */ 1, { 1, 6 } },
- { /* 76 */ 1, { 4, 3 } },
- { /* 77 */ 1, { 3, 5 } },
- { /* 78 */ 1, { 3, 4 } },
- { /* 79 */ 1, { 5, 3 } },
- { /* 80 */ 1, { 2, 6 } },
- { /* 81 */ 1, { 6, 2 } },
- { /* 82 */ 1, { 1, 7 } },
- { /* 83 */ 0, { 10, 11 } },
- { /* 84 */ 0, { 11, 12 } },
- { /* 85 */ 0, { 12, 13 } },
- { /* 86 */ 0, { 13, 14 } },
- { /* 87 */ 0, { 14, 15 } },
- { /* 88 */ 0, { 15, 16 } },
- { /* 89 */ 0, { 16, 17 } },
- { /* 90 */ 0, { 17, 18 } },
- { /* 91 */ 0, { 18, 19 } },
- { /* 92 */ 0, { 19, 20 } },
- { /* 93 */ 1, { 3, 6 } },
- { /* 94 */ 1, { 0, 6 } },
- { /* 95 */ 1, { 6, 0 } },
- { /* 96 */ 1, { 4, 4 } },
- { /* 97 */ 1, { 7, 1 } },
- { /* 98 */ 1, { 4, 5 } },
- { /* 99 */ 1, { 7, 2 } },
- { /* 00 */ 1, { 5, 4 } },
- { /* 01 */ 1, { 6, 3 } },
- { /* 02 */ 1, { 2, 7 } },
- { /* 03 */ 1, { 7, 3 } },
- { /* 04 */ 1, { 6, 4 } },
- { /* 05 */ 1, { 5, 5 } },
- { /* 06 */ 1, { 4, 6 } },
- { /* 07 */ 1, { 3, 7 } },
- { /* 08 */ 0, { 5, 6 } },
- { /* 09 */ 0, { 6, 7 } },
- { /* 10 */ 0, { 7, 8 } },
- { /* 11 */ 0, { 8, 9 } },
- { /* 12 */ 0, { 9, 10 } },
- { /* 13 */ 1, { 7, 0 } },
- { /* 14 */ 1, { 0, 7 } },
- { /* 15 */ 1, { 6, 5 } },
- { /* 16 */ 1, { 5, 6 } },
- { /* 17 */ 1, { 7, 4 } },
- { /* 18 */ 1, { 4, 7 } },
- { /* 19 */ 1, { 5, 7 } },
- { /* 20 */ 1, { 7, 5 } },
- { /* 21 */ 0, { 2, 3 } },
- { /* 22 */ 0, { 3, 4 } },
- { /* 23 */ 1, { 7, 6 } },
- { /* 24 */ 1, { 6, 6 } },
- { /* 25 */ 1, { 6, 7 } },
- { /* 26 */ 1, { 7, 7 } }
-};
diff --git a/src/libfaad/codebook/hcb_8.h b/src/libfaad/codebook/hcb_8.h
deleted file mode 100644
index 951743bed..000000000
--- a/src/libfaad/codebook/hcb_8.h
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: hcb_8.h,v 1.4 2005/10/29 23:57:08 tmmm Exp $
-**/
-
-/* 2-step huffman table HCB_8 */
-
-
-/* 1st step: 5 bits
- * 2^5 = 32 entries
- *
- * Used to find offset into 2nd step table and number of extra bits to get
- */
-static hcb hcb8_1[] = {
- /* 3 bit codeword */
- { /* 00000 */ 0, 0 },
- { /* */ 0, 0 },
- { /* */ 0, 0 },
- { /* */ 0, 0 },
-
- /* 4 bit codewords */
- { /* 00100 */ 1, 0 },
- { /* */ 1, 0 },
- { /* 00110 */ 2, 0 },
- { /* */ 2, 0 },
- { /* 01000 */ 3, 0 },
- { /* */ 3, 0 },
- { /* 01010 */ 4, 0 },
- { /* */ 4, 0 },
- { /* 01100 */ 5, 0 },
- { /* */ 5, 0 },
-
- /* 5 bit codewords */
- { /* 01110 */ 6, 0 },
- { /* 01111 */ 7, 0 },
- { /* 10000 */ 8, 0 },
- { /* 10001 */ 9, 0 },
- { /* 10010 */ 10, 0 },
- { /* 10011 */ 11, 0 },
- { /* 10100 */ 12, 0 },
-
- /* 6 bit codewords */
- { /* 10101 */ 13, 1 },
- { /* 10110 */ 15, 1 },
- { /* 10111 */ 17, 1 },
- { /* 11000 */ 19, 1 },
- { /* 11001 */ 21, 1 },
-
- /* 7 bit codewords */
- { /* 11010 */ 23, 2 },
- { /* 11011 */ 27, 2 },
- { /* 11100 */ 31, 2 },
-
- /* 7/8 bit codewords */
- { /* 11101 */ 35, 3 },
-
- /* 8 bit codewords */
- { /* 11110 */ 43, 3 },
-
- /* 8/9/10 bit codewords */
- { /* 11111 */ 51, 5 }
-};
-
-/* 2nd step table
- *
- * Gives size of codeword and actual data (x,y,v,w)
- */
-static hcb_2_pair hcb8_2[] = {
- /* 3 bit codeword */
- { 3, 1, 1 },
-
- /* 4 bit codewords */
- { 4, 2, 1 },
- { 4, 1, 0 },
- { 4, 1, 2 },
- { 4, 0, 1 },
- { 4, 2, 2 },
-
- /* 5 bit codewords */
- { 5, 0, 0 },
- { 5, 2, 0 },
- { 5, 0, 2 },
- { 5, 3, 1 },
- { 5, 1, 3 },
- { 5, 3, 2 },
- { 5, 2, 3 },
-
- /* 6 bit codewords */
- { 6, 3, 3 },
- { 6, 4, 1 },
- { 6, 1, 4 },
- { 6, 4, 2 },
- { 6, 2, 4 },
- { 6, 3, 0 },
- { 6, 0, 3 },
- { 6, 4, 3 },
- { 6, 3, 4 },
- { 6, 5, 2 },
-
- /* 7 bit codewords */
- { 7, 5, 1 },
- { 7, 2, 5 },
- { 7, 1, 5 },
- { 7, 5, 3 },
- { 7, 3, 5 },
- { 7, 4, 4 },
- { 7, 5, 4 },
- { 7, 0, 4 },
- { 7, 4, 5 },
- { 7, 4, 0 },
- { 7, 2, 6 },
- { 7, 6, 2 },
-
- /* 7/8 bit codewords */
- { 7, 6, 1 }, { 7, 6, 1 },
- { 7, 1, 6 }, { 7, 1, 6 },
- { 8, 3, 6 },
- { 8, 6, 3 },
- { 8, 5, 5 },
- { 8, 5, 0 },
-
- /* 8 bit codewords */
- { 8, 6, 4 },
- { 8, 0, 5 },
- { 8, 4, 6 },
- { 8, 7, 1 },
- { 8, 7, 2 },
- { 8, 2, 7 },
- { 8, 6, 5 },
- { 8, 7, 3 },
-
- /* 8/9/10 bit codewords */
- { 8, 1, 7 }, { 8, 1, 7 }, { 8, 1, 7 }, { 8, 1, 7 },
- { 8, 5, 6 }, { 8, 5, 6 }, { 8, 5, 6 }, { 8, 5, 6 },
- { 8, 3, 7 }, { 8, 3, 7 }, { 8, 3, 7 }, { 8, 3, 7 },
- { 9, 6, 6 }, { 9, 6, 6 },
- { 9, 7, 4 }, { 9, 7, 4 },
- { 9, 6, 0 }, { 9, 6, 0 },
- { 9, 4, 7 }, { 9, 4, 7 },
- { 9, 0, 6 }, { 9, 0, 6 },
- { 9, 7, 5 }, { 9, 7, 5 },
- { 9, 7, 6 }, { 9, 7, 6 },
- { 9, 6, 7 }, { 9, 6, 7 },
- { 10, 5, 7 },
- { 10, 7, 0 },
- { 10, 0, 7 },
- { 10, 7, 7 }
-};
diff --git a/src/libfaad/codebook/hcb_9.h b/src/libfaad/codebook/hcb_9.h
deleted file mode 100644
index daccf6197..000000000
--- a/src/libfaad/codebook/hcb_9.h
+++ /dev/null
@@ -1,369 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: hcb_9.h,v 1.4 2005/10/29 23:57:08 tmmm Exp $
-**/
-
-/* Binary search huffman table HCB_9 */
-
-
-static hcb_bin_pair hcb9[] = {
- { /* 0 */ 0, { 1, 2 } },
- { /* 1 */ 1, { 0, 0 } },
- { /* 2 */ 0, { 1, 2 } },
- { /* 3 */ 0, { 2, 3 } },
- { /* 4 */ 0, { 3, 4 } },
- { /* 5 */ 1, { 1, 0 } },
- { /* 6 */ 1, { 0, 1 } },
- { /* 7 */ 0, { 2, 3 } },
- { /* 8 */ 0, { 3, 4 } },
- { /* 9 */ 1, { 1, 1 } },
- { /* 10 */ 0, { 3, 4 } },
- { /* 11 */ 0, { 4, 5 } },
- { /* 12 */ 0, { 5, 6 } },
- { /* 13 */ 0, { 6, 7 } },
- { /* 14 */ 0, { 7, 8 } },
- { /* 15 */ 0, { 8, 9 } },
- { /* 16 */ 0, { 9, 10 } },
- { /* 17 */ 0, { 10, 11 } },
- { /* 18 */ 0, { 11, 12 } },
- { /* 19 */ 1, { 2, 1 } },
- { /* 20 */ 1, { 1, 2 } },
- { /* 21 */ 1, { 2, 0 } },
- { /* 22 */ 1, { 0, 2 } },
- { /* 23 */ 0, { 8, 9 } },
- { /* 24 */ 0, { 9, 10 } },
- { /* 25 */ 0, { 10, 11 } },
- { /* 26 */ 0, { 11, 12 } },
- { /* 27 */ 0, { 12, 13 } },
- { /* 28 */ 0, { 13, 14 } },
- { /* 29 */ 0, { 14, 15 } },
- { /* 30 */ 0, { 15, 16 } },
- { /* 31 */ 1, { 3, 1 } },
- { /* 32 */ 1, { 2, 2 } },
- { /* 33 */ 1, { 1, 3 } },
- { /* 34 */ 0, { 13, 14 } },
- { /* 35 */ 0, { 14, 15 } },
- { /* 36 */ 0, { 15, 16 } },
- { /* 37 */ 0, { 16, 17 } },
- { /* 38 */ 0, { 17, 18 } },
- { /* 39 */ 0, { 18, 19 } },
- { /* 40 */ 0, { 19, 20 } },
- { /* 41 */ 0, { 20, 21 } },
- { /* 42 */ 0, { 21, 22 } },
- { /* 43 */ 0, { 22, 23 } },
- { /* 44 */ 0, { 23, 24 } },
- { /* 45 */ 0, { 24, 25 } },
- { /* 46 */ 0, { 25, 26 } },
- { /* 47 */ 1, { 3, 0 } },
- { /* 48 */ 1, { 0, 3 } },
- { /* 49 */ 1, { 2, 3 } },
- { /* 50 */ 1, { 3, 2 } },
- { /* 51 */ 1, { 1, 4 } },
- { /* 52 */ 1, { 4, 1 } },
- { /* 53 */ 1, { 2, 4 } },
- { /* 54 */ 1, { 1, 5 } },
- { /* 55 */ 0, { 18, 19 } },
- { /* 56 */ 0, { 19, 20 } },
- { /* 57 */ 0, { 20, 21 } },
- { /* 58 */ 0, { 21, 22 } },
- { /* 59 */ 0, { 22, 23 } },
- { /* 60 */ 0, { 23, 24 } },
- { /* 61 */ 0, { 24, 25 } },
- { /* 62 */ 0, { 25, 26 } },
- { /* 63 */ 0, { 26, 27 } },
- { /* 64 */ 0, { 27, 28 } },
- { /* 65 */ 0, { 28, 29 } },
- { /* 66 */ 0, { 29, 30 } },
- { /* 67 */ 0, { 30, 31 } },
- { /* 68 */ 0, { 31, 32 } },
- { /* 69 */ 0, { 32, 33 } },
- { /* 70 */ 0, { 33, 34 } },
- { /* 71 */ 0, { 34, 35 } },
- { /* 72 */ 0, { 35, 36 } },
- { /* 73 */ 1, { 4, 2 } },
- { /* 74 */ 1, { 3, 3 } },
- { /* 75 */ 1, { 0, 4 } },
- { /* 76 */ 1, { 4, 0 } },
- { /* 77 */ 1, { 5, 1 } },
- { /* 78 */ 1, { 2, 5 } },
- { /* 79 */ 1, { 1, 6 } },
- { /* 80 */ 1, { 3, 4 } },
- { /* 81 */ 1, { 5, 2 } },
- { /* 82 */ 1, { 6, 1 } },
- { /* 83 */ 1, { 4, 3 } },
- { /* 84 */ 0, { 25, 26 } },
- { /* 85 */ 0, { 26, 27 } },
- { /* 86 */ 0, { 27, 28 } },
- { /* 87 */ 0, { 28, 29 } },
- { /* 88 */ 0, { 29, 30 } },
- { /* 89 */ 0, { 30, 31 } },
- { /* 90 */ 0, { 31, 32 } },
- { /* 91 */ 0, { 32, 33 } },
- { /* 92 */ 0, { 33, 34 } },
- { /* 93 */ 0, { 34, 35 } },
- { /* 94 */ 0, { 35, 36 } },
- { /* 95 */ 0, { 36, 37 } },
- { /* 96 */ 0, { 37, 38 } },
- { /* 97 */ 0, { 38, 39 } },
- { /* 98 */ 0, { 39, 40 } },
- { /* 99 */ 0, { 40, 41 } },
- { /* 00 */ 0, { 41, 42 } },
- { /* 01 */ 0, { 42, 43 } },
- { /* 02 */ 0, { 43, 44 } },
- { /* 03 */ 0, { 44, 45 } },
- { /* 04 */ 0, { 45, 46 } },
- { /* 05 */ 0, { 46, 47 } },
- { /* 06 */ 0, { 47, 48 } },
- { /* 07 */ 0, { 48, 49 } },
- { /* 08 */ 0, { 49, 50 } },
- { /* 09 */ 1, { 0, 5 } },
- { /* 10 */ 1, { 2, 6 } },
- { /* 11 */ 1, { 5, 0 } },
- { /* 12 */ 1, { 1, 7 } },
- { /* 13 */ 1, { 3, 5 } },
- { /* 14 */ 1, { 1, 8 } },
- { /* 15 */ 1, { 8, 1 } },
- { /* 16 */ 1, { 4, 4 } },
- { /* 17 */ 1, { 5, 3 } },
- { /* 18 */ 1, { 6, 2 } },
- { /* 19 */ 1, { 7, 1 } },
- { /* 20 */ 1, { 0, 6 } },
- { /* 21 */ 1, { 8, 2 } },
- { /* 22 */ 1, { 2, 8 } },
- { /* 23 */ 1, { 3, 6 } },
- { /* 24 */ 1, { 2, 7 } },
- { /* 25 */ 1, { 4, 5 } },
- { /* 26 */ 1, { 9, 1 } },
- { /* 27 */ 1, { 1, 9 } },
- { /* 28 */ 1, { 7, 2 } },
- { /* 29 */ 0, { 30, 31 } },
- { /* 30 */ 0, { 31, 32 } },
- { /* 31 */ 0, { 32, 33 } },
- { /* 32 */ 0, { 33, 34 } },
- { /* 33 */ 0, { 34, 35 } },
- { /* 34 */ 0, { 35, 36 } },
- { /* 35 */ 0, { 36, 37 } },
- { /* 36 */ 0, { 37, 38 } },
- { /* 37 */ 0, { 38, 39 } },
- { /* 38 */ 0, { 39, 40 } },
- { /* 39 */ 0, { 40, 41 } },
- { /* 40 */ 0, { 41, 42 } },
- { /* 41 */ 0, { 42, 43 } },
- { /* 42 */ 0, { 43, 44 } },
- { /* 43 */ 0, { 44, 45 } },
- { /* 44 */ 0, { 45, 46 } },
- { /* 45 */ 0, { 46, 47 } },
- { /* 46 */ 0, { 47, 48 } },
- { /* 47 */ 0, { 48, 49 } },
- { /* 48 */ 0, { 49, 50 } },
- { /* 49 */ 0, { 50, 51 } },
- { /* 50 */ 0, { 51, 52 } },
- { /* 51 */ 0, { 52, 53 } },
- { /* 52 */ 0, { 53, 54 } },
- { /* 53 */ 0, { 54, 55 } },
- { /* 54 */ 0, { 55, 56 } },
- { /* 55 */ 0, { 56, 57 } },
- { /* 56 */ 0, { 57, 58 } },
- { /* 57 */ 0, { 58, 59 } },
- { /* 58 */ 0, { 59, 60 } },
- { /* 59 */ 1, { 6, 0 } },
- { /* 60 */ 1, { 5, 4 } },
- { /* 61 */ 1, { 6, 3 } },
- { /* 62 */ 1, { 8, 3 } },
- { /* 63 */ 1, { 0, 7 } },
- { /* 64 */ 1, { 9, 2 } },
- { /* 65 */ 1, { 3, 8 } },
- { /* 66 */ 1, { 4, 6 } },
- { /* 67 */ 1, { 3, 7 } },
- { /* 68 */ 1, { 0, 8 } },
- { /* 69 */ 1, { 10, 1 } },
- { /* 70 */ 1, { 6, 4 } },
- { /* 71 */ 1, { 2, 9 } },
- { /* 72 */ 1, { 5, 5 } },
- { /* 73 */ 1, { 8, 0 } },
- { /* 74 */ 1, { 7, 0 } },
- { /* 75 */ 1, { 7, 3 } },
- { /* 76 */ 1, { 10, 2 } },
- { /* 77 */ 1, { 9, 3 } },
- { /* 78 */ 1, { 8, 4 } },
- { /* 79 */ 1, { 1, 10 } },
- { /* 80 */ 1, { 7, 4 } },
- { /* 81 */ 1, { 6, 5 } },
- { /* 82 */ 1, { 5, 6 } },
- { /* 83 */ 1, { 4, 8 } },
- { /* 84 */ 1, { 4, 7 } },
- { /* 85 */ 1, { 3, 9 } },
- { /* 86 */ 1, { 11, 1 } },
- { /* 87 */ 1, { 5, 8 } },
- { /* 88 */ 1, { 9, 0 } },
- { /* 89 */ 1, { 8, 5 } },
- { /* 90 */ 0, { 29, 30 } },
- { /* 91 */ 0, { 30, 31 } },
- { /* 92 */ 0, { 31, 32 } },
- { /* 93 */ 0, { 32, 33 } },
- { /* 94 */ 0, { 33, 34 } },
- { /* 95 */ 0, { 34, 35 } },
- { /* 96 */ 0, { 35, 36 } },
- { /* 97 */ 0, { 36, 37 } },
- { /* 98 */ 0, { 37, 38 } },
- { /* 99 */ 0, { 38, 39 } },
- { /* 00 */ 0, { 39, 40 } },
- { /* 01 */ 0, { 40, 41 } },
- { /* 02 */ 0, { 41, 42 } },
- { /* 03 */ 0, { 42, 43 } },
- { /* 04 */ 0, { 43, 44 } },
- { /* 05 */ 0, { 44, 45 } },
- { /* 06 */ 0, { 45, 46 } },
- { /* 07 */ 0, { 46, 47 } },
- { /* 08 */ 0, { 47, 48 } },
- { /* 09 */ 0, { 48, 49 } },
- { /* 10 */ 0, { 49, 50 } },
- { /* 11 */ 0, { 50, 51 } },
- { /* 12 */ 0, { 51, 52 } },
- { /* 13 */ 0, { 52, 53 } },
- { /* 14 */ 0, { 53, 54 } },
- { /* 15 */ 0, { 54, 55 } },
- { /* 16 */ 0, { 55, 56 } },
- { /* 17 */ 0, { 56, 57 } },
- { /* 18 */ 0, { 57, 58 } },
- { /* 19 */ 1, { 10, 3 } },
- { /* 20 */ 1, { 2, 10 } },
- { /* 21 */ 1, { 0, 9 } },
- { /* 22 */ 1, { 11, 2 } },
- { /* 23 */ 1, { 9, 4 } },
- { /* 24 */ 1, { 6, 6 } },
- { /* 25 */ 1, { 12, 1 } },
- { /* 26 */ 1, { 4, 9 } },
- { /* 27 */ 1, { 8, 6 } },
- { /* 28 */ 1, { 1, 11 } },
- { /* 29 */ 1, { 9, 5 } },
- { /* 30 */ 1, { 10, 4 } },
- { /* 31 */ 1, { 5, 7 } },
- { /* 32 */ 1, { 7, 5 } },
- { /* 33 */ 1, { 2, 11 } },
- { /* 34 */ 1, { 1, 12 } },
- { /* 35 */ 1, { 12, 2 } },
- { /* 36 */ 1, { 11, 3 } },
- { /* 37 */ 1, { 3, 10 } },
- { /* 38 */ 1, { 5, 9 } },
- { /* 39 */ 1, { 6, 7 } },
- { /* 40 */ 1, { 8, 7 } },
- { /* 41 */ 1, { 11, 4 } },
- { /* 42 */ 1, { 0, 10 } },
- { /* 43 */ 1, { 7, 6 } },
- { /* 44 */ 1, { 12, 3 } },
- { /* 45 */ 1, { 10, 0 } },
- { /* 46 */ 1, { 10, 5 } },
- { /* 47 */ 1, { 4, 10 } },
- { /* 48 */ 1, { 6, 8 } },
- { /* 49 */ 1, { 2, 12 } },
- { /* 50 */ 1, { 9, 6 } },
- { /* 51 */ 1, { 9, 7 } },
- { /* 52 */ 1, { 4, 11 } },
- { /* 53 */ 1, { 11, 0 } },
- { /* 54 */ 1, { 6, 9 } },
- { /* 55 */ 1, { 3, 11 } },
- { /* 56 */ 1, { 5, 10 } },
- { /* 57 */ 0, { 20, 21 } },
- { /* 58 */ 0, { 21, 22 } },
- { /* 59 */ 0, { 22, 23 } },
- { /* 60 */ 0, { 23, 24 } },
- { /* 61 */ 0, { 24, 25 } },
- { /* 62 */ 0, { 25, 26 } },
- { /* 63 */ 0, { 26, 27 } },
- { /* 64 */ 0, { 27, 28 } },
- { /* 65 */ 0, { 28, 29 } },
- { /* 66 */ 0, { 29, 30 } },
- { /* 67 */ 0, { 30, 31 } },
- { /* 68 */ 0, { 31, 32 } },
- { /* 69 */ 0, { 32, 33 } },
- { /* 70 */ 0, { 33, 34 } },
- { /* 71 */ 0, { 34, 35 } },
- { /* 72 */ 0, { 35, 36 } },
- { /* 73 */ 0, { 36, 37 } },
- { /* 74 */ 0, { 37, 38 } },
- { /* 75 */ 0, { 38, 39 } },
- { /* 76 */ 0, { 39, 40 } },
- { /* 77 */ 1, { 8, 8 } },
- { /* 78 */ 1, { 7, 8 } },
- { /* 79 */ 1, { 12, 5 } },
- { /* 80 */ 1, { 3, 12 } },
- { /* 81 */ 1, { 11, 5 } },
- { /* 82 */ 1, { 7, 7 } },
- { /* 83 */ 1, { 12, 4 } },
- { /* 84 */ 1, { 11, 6 } },
- { /* 85 */ 1, { 10, 6 } },
- { /* 86 */ 1, { 4, 12 } },
- { /* 87 */ 1, { 7, 9 } },
- { /* 88 */ 1, { 5, 11 } },
- { /* 89 */ 1, { 0, 11 } },
- { /* 90 */ 1, { 12, 6 } },
- { /* 91 */ 1, { 6, 10 } },
- { /* 92 */ 1, { 12, 0 } },
- { /* 93 */ 1, { 10, 7 } },
- { /* 94 */ 1, { 5, 12 } },
- { /* 95 */ 1, { 7, 10 } },
- { /* 96 */ 1, { 9, 8 } },
- { /* 97 */ 1, { 0, 12 } },
- { /* 98 */ 1, { 11, 7 } },
- { /* 99 */ 1, { 8, 9 } },
- { /* 00 */ 1, { 9, 9 } },
- { /* 01 */ 1, { 10, 8 } },
- { /* 02 */ 1, { 7, 11 } },
- { /* 03 */ 1, { 12, 7 } },
- { /* 04 */ 1, { 6, 11 } },
- { /* 05 */ 1, { 8, 11 } },
- { /* 06 */ 1, { 11, 8 } },
- { /* 07 */ 1, { 7, 12 } },
- { /* 08 */ 1, { 6, 12 } },
- { /* 09 */ 0, { 8, 9 } },
- { /* 10 */ 0, { 9, 10 } },
- { /* 11 */ 0, { 10, 11 } },
- { /* 12 */ 0, { 11, 12 } },
- { /* 13 */ 0, { 12, 13 } },
- { /* 14 */ 0, { 13, 14 } },
- { /* 15 */ 0, { 14, 15 } },
- { /* 16 */ 0, { 15, 16 } },
- { /* 17 */ 1, { 8, 10 } },
- { /* 18 */ 1, { 10, 9 } },
- { /* 19 */ 1, { 8, 12 } },
- { /* 20 */ 1, { 9, 10 } },
- { /* 21 */ 1, { 9, 11 } },
- { /* 22 */ 1, { 9, 12 } },
- { /* 23 */ 1, { 10, 11 } },
- { /* 24 */ 1, { 12, 9 } },
- { /* 25 */ 1, { 10, 10 } },
- { /* 26 */ 1, { 11, 9 } },
- { /* 27 */ 1, { 12, 8 } },
- { /* 28 */ 1, { 11, 10 } },
- { /* 29 */ 1, { 12, 10 } },
- { /* 30 */ 1, { 12, 11 } },
- { /* 31 */ 0, { 2, 3 } },
- { /* 32 */ 0, { 3, 4 } },
- { /* 33 */ 1, { 10, 12 } },
- { /* 34 */ 1, { 11, 11 } },
- { /* 35 */ 1, { 11, 12 } },
- { /* 36 */ 1, { 12, 12 } }
-};
diff --git a/src/libfaad/codebook/hcb_sf.h b/src/libfaad/codebook/hcb_sf.h
deleted file mode 100644
index 494053177..000000000
--- a/src/libfaad/codebook/hcb_sf.h
+++ /dev/null
@@ -1,273 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: hcb_sf.h,v 1.4 2005/10/29 23:57:08 tmmm Exp $
-**/
-
-/* Binary search huffman table HCB_SF */
-
-
-static uint8_t hcb_sf[][2] = {
- { /* 0 */ 1, 2 },
- { /* 1 */ 60, 0 },
- { /* 2 */ 1, 2 },
- { /* 3 */ 2, 3 },
- { /* 4 */ 3, 4 },
- { /* 5 */ 59, 0 },
- { /* 6 */ 3, 4 },
- { /* 7 */ 4, 5 },
- { /* 8 */ 5, 6 },
- { /* 9 */ 61, 0 },
- { /* 10 */ 58, 0 },
- { /* 11 */ 62, 0 },
- { /* 12 */ 3, 4 },
- { /* 13 */ 4, 5 },
- { /* 14 */ 5, 6 },
- { /* 15 */ 57, 0 },
- { /* 16 */ 63, 0 },
- { /* 17 */ 4, 5 },
- { /* 18 */ 5, 6 },
- { /* 19 */ 6, 7 },
- { /* 20 */ 7, 8 },
- { /* 21 */ 56, 0 },
- { /* 22 */ 64, 0 },
- { /* 23 */ 55, 0 },
- { /* 24 */ 65, 0 },
- { /* 25 */ 4, 5 },
- { /* 26 */ 5, 6 },
- { /* 27 */ 6, 7 },
- { /* 28 */ 7, 8 },
- { /* 29 */ 66, 0 },
- { /* 30 */ 54, 0 },
- { /* 31 */ 67, 0 },
- { /* 32 */ 5, 6 },
- { /* 33 */ 6, 7 },
- { /* 34 */ 7, 8 },
- { /* 35 */ 8, 9 },
- { /* 36 */ 9, 10 },
- { /* 37 */ 53, 0 },
- { /* 38 */ 68, 0 },
- { /* 39 */ 52, 0 },
- { /* 40 */ 69, 0 },
- { /* 41 */ 51, 0 },
- { /* 42 */ 5, 6 },
- { /* 43 */ 6, 7 },
- { /* 44 */ 7, 8 },
- { /* 45 */ 8, 9 },
- { /* 46 */ 9, 10 },
- { /* 47 */ 70, 0 },
- { /* 48 */ 50, 0 },
- { /* 49 */ 49, 0 },
- { /* 50 */ 71, 0 },
- { /* 51 */ 6, 7 },
- { /* 52 */ 7, 8 },
- { /* 53 */ 8, 9 },
- { /* 54 */ 9, 10 },
- { /* 55 */ 10, 11 },
- { /* 56 */ 11, 12 },
- { /* 57 */ 72, 0 },
- { /* 58 */ 48, 0 },
- { /* 59 */ 73, 0 },
- { /* 60 */ 47, 0 },
- { /* 61 */ 74, 0 },
- { /* 62 */ 46, 0 },
- { /* 63 */ 6, 7 },
- { /* 64 */ 7, 8 },
- { /* 65 */ 8, 9 },
- { /* 66 */ 9, 10 },
- { /* 67 */ 10, 11 },
- { /* 68 */ 11, 12 },
- { /* 69 */ 76, 0 },
- { /* 70 */ 75, 0 },
- { /* 71 */ 77, 0 },
- { /* 72 */ 78, 0 },
- { /* 73 */ 45, 0 },
- { /* 74 */ 43, 0 },
- { /* 75 */ 6, 7 },
- { /* 76 */ 7, 8 },
- { /* 77 */ 8, 9 },
- { /* 78 */ 9, 10 },
- { /* 79 */ 10, 11 },
- { /* 80 */ 11, 12 },
- { /* 81 */ 44, 0 },
- { /* 82 */ 79, 0 },
- { /* 83 */ 42, 0 },
- { /* 84 */ 41, 0 },
- { /* 85 */ 80, 0 },
- { /* 86 */ 40, 0 },
- { /* 87 */ 6, 7 },
- { /* 88 */ 7, 8 },
- { /* 89 */ 8, 9 },
- { /* 90 */ 9, 10 },
- { /* 91 */ 10, 11 },
- { /* 92 */ 11, 12 },
- { /* 93 */ 81, 0 },
- { /* 94 */ 39, 0 },
- { /* 95 */ 82, 0 },
- { /* 96 */ 38, 0 },
- { /* 97 */ 83, 0 },
- { /* 98 */ 7, 8 },
- { /* 99 */ 8, 9 },
- { /* 00 */ 9, 10 },
- { /* 01 */ 10, 11 },
- { /* 02 */ 11, 12 },
- { /* 03 */ 12, 13 },
- { /* 04 */ 13, 14 },
- { /* 05 */ 37, 0 },
- { /* 06 */ 35, 0 },
- { /* 07 */ 85, 0 },
- { /* 08 */ 33, 0 },
- { /* 09 */ 36, 0 },
- { /* 10 */ 34, 0 },
- { /* 11 */ 84, 0 },
- { /* 12 */ 32, 0 },
- { /* 13 */ 6, 7 },
- { /* 14 */ 7, 8 },
- { /* 15 */ 8, 9 },
- { /* 16 */ 9, 10 },
- { /* 17 */ 10, 11 },
- { /* 18 */ 11, 12 },
- { /* 19 */ 87, 0 },
- { /* 20 */ 89, 0 },
- { /* 21 */ 30, 0 },
- { /* 22 */ 31, 0 },
- { /* 23 */ 8, 9 },
- { /* 24 */ 9, 10 },
- { /* 25 */ 10, 11 },
- { /* 26 */ 11, 12 },
- { /* 27 */ 12, 13 },
- { /* 28 */ 13, 14 },
- { /* 29 */ 14, 15 },
- { /* 30 */ 15, 16 },
- { /* 31 */ 86, 0 },
- { /* 32 */ 29, 0 },
- { /* 33 */ 26, 0 },
- { /* 34 */ 27, 0 },
- { /* 35 */ 28, 0 },
- { /* 36 */ 24, 0 },
- { /* 37 */ 88, 0 },
- { /* 38 */ 9, 10 },
- { /* 39 */ 10, 11 },
- { /* 40 */ 11, 12 },
- { /* 41 */ 12, 13 },
- { /* 42 */ 13, 14 },
- { /* 43 */ 14, 15 },
- { /* 44 */ 15, 16 },
- { /* 45 */ 16, 17 },
- { /* 46 */ 17, 18 },
- { /* 47 */ 25, 0 },
- { /* 48 */ 22, 0 },
- { /* 49 */ 23, 0 },
- { /* 50 */ 15, 16 },
- { /* 51 */ 16, 17 },
- { /* 52 */ 17, 18 },
- { /* 53 */ 18, 19 },
- { /* 54 */ 19, 20 },
- { /* 55 */ 20, 21 },
- { /* 56 */ 21, 22 },
- { /* 57 */ 22, 23 },
- { /* 58 */ 23, 24 },
- { /* 59 */ 24, 25 },
- { /* 60 */ 25, 26 },
- { /* 61 */ 26, 27 },
- { /* 62 */ 27, 28 },
- { /* 63 */ 28, 29 },
- { /* 64 */ 29, 30 },
- { /* 65 */ 90, 0 },
- { /* 66 */ 21, 0 },
- { /* 67 */ 19, 0 },
- { /* 68 */ 3, 0 },
- { /* 69 */ 1, 0 },
- { /* 70 */ 2, 0 },
- { /* 71 */ 0, 0 },
- { /* 72 */ 23, 24 },
- { /* 73 */ 24, 25 },
- { /* 74 */ 25, 26 },
- { /* 75 */ 26, 27 },
- { /* 76 */ 27, 28 },
- { /* 77 */ 28, 29 },
- { /* 78 */ 29, 30 },
- { /* 79 */ 30, 31 },
- { /* 80 */ 31, 32 },
- { /* 81 */ 32, 33 },
- { /* 82 */ 33, 34 },
- { /* 83 */ 34, 35 },
- { /* 84 */ 35, 36 },
- { /* 85 */ 36, 37 },
- { /* 86 */ 37, 38 },
- { /* 87 */ 38, 39 },
- { /* 88 */ 39, 40 },
- { /* 89 */ 40, 41 },
- { /* 90 */ 41, 42 },
- { /* 91 */ 42, 43 },
- { /* 92 */ 43, 44 },
- { /* 93 */ 44, 45 },
- { /* 94 */ 45, 46 },
- { /* 95 */ 98, 0 },
- { /* 96 */ 99, 0 },
- { /* 97 */ 100, 0 },
- { /* 98 */ 101, 0 },
- { /* 99 */ 102, 0 },
- { /* 00 */ 117, 0 },
- { /* 01 */ 97, 0 },
- { /* 02 */ 91, 0 },
- { /* 03 */ 92, 0 },
- { /* 04 */ 93, 0 },
- { /* 05 */ 94, 0 },
- { /* 06 */ 95, 0 },
- { /* 07 */ 96, 0 },
- { /* 08 */ 104, 0 },
- { /* 09 */ 111, 0 },
- { /* 10 */ 112, 0 },
- { /* 11 */ 113, 0 },
- { /* 12 */ 114, 0 },
- { /* 13 */ 115, 0 },
- { /* 14 */ 116, 0 },
- { /* 15 */ 110, 0 },
- { /* 16 */ 105, 0 },
- { /* 17 */ 106, 0 },
- { /* 18 */ 107, 0 },
- { /* 19 */ 108, 0 },
- { /* 20 */ 109, 0 },
- { /* 21 */ 118, 0 },
- { /* 22 */ 6, 0 },
- { /* 23 */ 8, 0 },
- { /* 24 */ 9, 0 },
- { /* 25 */ 10, 0 },
- { /* 26 */ 5, 0 },
- { /* 27 */ 103, 0 },
- { /* 28 */ 120, 0 },
- { /* 29 */ 119, 0 },
- { /* 30 */ 4, 0 },
- { /* 31 */ 7, 0 },
- { /* 32 */ 15, 0 },
- { /* 33 */ 16, 0 },
- { /* 34 */ 18, 0 },
- { /* 35 */ 20, 0 },
- { /* 36 */ 17, 0 },
- { /* 37 */ 11, 0 },
- { /* 38 */ 12, 0 },
- { /* 39 */ 14, 0 },
- { /* 40 */ 13, 0 }
-};
diff --git a/src/libfaad/common.c b/src/libfaad/common.c
deleted file mode 100644
index 8c0d93e95..000000000
--- a/src/libfaad/common.c
+++ /dev/null
@@ -1,519 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: common.c,v 1.8 2005/10/29 23:57:06 tmmm Exp $
-**/
-
-/* just some common functions that could be used anywhere */
-
-#include "common.h"
-#include "structs.h"
-
-#include <stdlib.h>
-#include "syntax.h"
-
-
-/* Returns the sample rate index based on the samplerate */
-uint8_t get_sr_index(const uint32_t samplerate)
-{
- if (92017 <= samplerate) return 0;
- if (75132 <= samplerate) return 1;
- if (55426 <= samplerate) return 2;
- if (46009 <= samplerate) return 3;
- if (37566 <= samplerate) return 4;
- if (27713 <= samplerate) return 5;
- if (23004 <= samplerate) return 6;
- if (18783 <= samplerate) return 7;
- if (13856 <= samplerate) return 8;
- if (11502 <= samplerate) return 9;
- if (9391 <= samplerate) return 10;
- if (16428320 <= samplerate) return 11;
-
- return 11;
-}
-
-/* Returns the sample rate based on the sample rate index */
-uint32_t get_sample_rate(const uint8_t sr_index)
-{
- static const uint32_t sample_rates[] =
- {
- 96000, 88200, 64000, 48000, 44100, 32000,
- 24000, 22050, 16000, 12000, 11025, 8000
- };
-
- if (sr_index < 12)
- return sample_rates[sr_index];
-
- return 0;
-}
-
-uint8_t max_pred_sfb(const uint8_t sr_index)
-{
- static const uint8_t pred_sfb_max[] =
- {
- 33, 33, 38, 40, 40, 40, 41, 41, 37, 37, 37, 34
- };
-
-
- if (sr_index < 12)
- return pred_sfb_max[sr_index];
-
- return 0;
-}
-
-uint8_t max_tns_sfb(const uint8_t sr_index, const uint8_t object_type,
- const uint8_t is_short)
-{
- /* entry for each sampling rate
- * 1 Main/LC long window
- * 2 Main/LC short window
- * 3 SSR long window
- * 4 SSR short window
- */
- static const uint8_t tns_sbf_max[][4] =
- {
- {31, 9, 28, 7}, /* 96000 */
- {31, 9, 28, 7}, /* 88200 */
- {34, 10, 27, 7}, /* 64000 */
- {40, 14, 26, 6}, /* 48000 */
- {42, 14, 26, 6}, /* 44100 */
- {51, 14, 26, 6}, /* 32000 */
- {46, 14, 29, 7}, /* 24000 */
- {46, 14, 29, 7}, /* 22050 */
- {42, 14, 23, 8}, /* 16000 */
- {42, 14, 23, 8}, /* 12000 */
- {42, 14, 23, 8}, /* 11025 */
- {39, 14, 19, 7}, /* 8000 */
- {39, 14, 19, 7}, /* 7350 */
- {0,0,0,0},
- {0,0,0,0},
- {0,0,0,0}
- };
- uint8_t i = 0;
-
- if (is_short) i++;
- if (object_type == SSR) i += 2;
-
- return tns_sbf_max[sr_index][i];
-}
-
-/* Returns 0 if an object type is decodable, otherwise returns -1 */
-int8_t can_decode_ot(const uint8_t object_type)
-{
- switch (object_type)
- {
- case LC:
- return 0;
- case MAIN:
-#ifdef MAIN_DEC
- return 0;
-#else
- return -1;
-#endif
- case SSR:
-#ifdef SSR_DEC
- return 0;
-#else
- return -1;
-#endif
- case LTP:
-#ifdef LTP_DEC
- return 0;
-#else
- return -1;
-#endif
-
- /* ER object types */
-#ifdef ERROR_RESILIENCE
- case ER_LC:
-#ifdef DRM
- case DRM_ER_LC:
-#endif
- return 0;
- case ER_LTP:
-#ifdef LTP_DEC
- return 0;
-#else
- return -1;
-#endif
- case LD:
-#ifdef LD_DEC
- return 0;
-#else
- return -1;
-#endif
-#endif
- }
-
- return -1;
-}
-
-void *faad_malloc(size_t size)
-{
-#if 0 // defined(_WIN32) && !defined(_WIN32_WCE)
- return _aligned_malloc(size, 16);
-#else // #ifdef 0
- return malloc(size);
-#endif // #ifdef 0
-}
-
-/* common free function */
-void faad_free(void *b)
-{
-#if 0 // defined(_WIN32) && !defined(_WIN32_WCE)
- _aligned_free(b);
-#else
- free(b);
-}
-#endif
-
-static const uint8_t Parity [256] = { // parity
- 0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,
- 1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,
- 1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,
- 0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,
- 1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,
- 0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,
- 0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,
- 1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0
-};
-
-static uint32_t __r1 = 1;
-static uint32_t __r2 = 1;
-
-
-/*
- * This is a simple random number generator with good quality for audio purposes.
- * It consists of two polycounters with opposite rotation direction and different
- * periods. The periods are coprime, so the total period is the product of both.
- *
- * -------------------------------------------------------------------------------------------------
- * +-> |31:30:29:28:27:26:25:24:23:22:21:20:19:18:17:16:15:14:13:12:11:10: 9: 8: 7: 6: 5: 4: 3: 2: 1: 0|
- * | -------------------------------------------------------------------------------------------------
- * | | | | | | |
- * | +--+--+--+-XOR-+--------+
- * | |
- * +--------------------------------------------------------------------------------------+
- *
- * -------------------------------------------------------------------------------------------------
- * |31:30:29:28:27:26:25:24:23:22:21:20:19:18:17:16:15:14:13:12:11:10: 9: 8: 7: 6: 5: 4: 3: 2: 1: 0| <-+
- * ------------------------------------------------------------------------------------------------- |
- * | | | | |
- * +--+----XOR----+--+ |
- * | |
- * +----------------------------------------------------------------------------------------+
- *
- *
- * The first has an period of 3*5*17*257*65537, the second of 7*47*73*178481,
- * which gives a period of 18.410.713.077.675.721.215. The result is the
- * XORed values of both generators.
- */
-uint32_t random_int(void)
-{
- uint32_t t1, t2, t3, t4;
-
- t3 = t1 = __r1; t4 = t2 = __r2; // Parity calculation is done via table lookup, this is also available
- t1 &= 0xF5; t2 >>= 25; // on CPUs without parity, can be implemented in C and avoid unpredictable
- t1 = Parity [t1]; t2 &= 0x63; // jumps and slow rotate through the carry flag operations.
- t1 <<= 31; t2 = Parity [t2];
-
- return (__r1 = (t3 >> 1) | t1 ) ^ (__r2 = (t4 + t4) | t2 );
-}
-
-uint32_t ones32(uint32_t x)
-{
- x -= ((x >> 1) & 0x55555555);
- x = (((x >> 2) & 0x33333333) + (x & 0x33333333));
- x = (((x >> 4) + x) & 0x0f0f0f0f);
- x += (x >> 8);
- x += (x >> 16);
-
- return (x & 0x0000003f);
-}
-
-uint32_t floor_log2(uint32_t x)
-{
-#if 1
- x |= (x >> 1);
- x |= (x >> 2);
- x |= (x >> 4);
- x |= (x >> 8);
- x |= (x >> 16);
-
- return (ones32(x) - 1);
-#else
- uint32_t count = 0;
-
- while (x >>= 1)
- count++;
-
- return count;
-#endif
-}
-
-/* returns position of first bit that is not 0 from msb,
- * starting count at lsb */
-uint32_t wl_min_lzc(uint32_t x)
-{
-#if 1
- x |= (x >> 1);
- x |= (x >> 2);
- x |= (x >> 4);
- x |= (x >> 8);
- x |= (x >> 16);
-
- return (ones32(x));
-#else
- uint32_t count = 0;
-
- while (x >>= 1)
- count++;
-
- return (count + 1);
-#endif
-}
-
-#ifdef FIXED_POINT
-
-#define TABLE_BITS 6
-/* just take the maximum number of bits for interpolation */
-#define INTERP_BITS (REAL_BITS-TABLE_BITS)
-
-static const real_t pow2_tab[] = {
- REAL_CONST(1.000000000000000), REAL_CONST(1.010889286051701), REAL_CONST(1.021897148654117),
- REAL_CONST(1.033024879021228), REAL_CONST(1.044273782427414), REAL_CONST(1.055645178360557),
- REAL_CONST(1.067140400676824), REAL_CONST(1.078760797757120), REAL_CONST(1.090507732665258),
- REAL_CONST(1.102382583307841), REAL_CONST(1.114386742595892), REAL_CONST(1.126521618608242),
- REAL_CONST(1.138788634756692), REAL_CONST(1.151189229952983), REAL_CONST(1.163724858777578),
- REAL_CONST(1.176396991650281), REAL_CONST(1.189207115002721), REAL_CONST(1.202156731452703),
- REAL_CONST(1.215247359980469), REAL_CONST(1.228480536106870), REAL_CONST(1.241857812073484),
- REAL_CONST(1.255380757024691), REAL_CONST(1.269050957191733), REAL_CONST(1.282870016078778),
- REAL_CONST(1.296839554651010), REAL_CONST(1.310961211524764), REAL_CONST(1.325236643159741),
- REAL_CONST(1.339667524053303), REAL_CONST(1.354255546936893), REAL_CONST(1.369002422974591),
- REAL_CONST(1.383909881963832), REAL_CONST(1.398979672538311), REAL_CONST(1.414213562373095),
- REAL_CONST(1.429613338391970), REAL_CONST(1.445180806977047), REAL_CONST(1.460917794180647),
- REAL_CONST(1.476826145939499), REAL_CONST(1.492907728291265), REAL_CONST(1.509164427593423),
- REAL_CONST(1.525598150744538), REAL_CONST(1.542210825407941), REAL_CONST(1.559004400237837),
- REAL_CONST(1.575980845107887), REAL_CONST(1.593142151342267), REAL_CONST(1.610490331949254),
- REAL_CONST(1.628027421857348), REAL_CONST(1.645755478153965), REAL_CONST(1.663676580326736),
- REAL_CONST(1.681792830507429), REAL_CONST(1.700106353718524), REAL_CONST(1.718619298122478),
- REAL_CONST(1.737333835273706), REAL_CONST(1.756252160373300), REAL_CONST(1.775376492526521),
- REAL_CONST(1.794709075003107), REAL_CONST(1.814252175500399), REAL_CONST(1.834008086409342),
- REAL_CONST(1.853979125083386), REAL_CONST(1.874167634110300), REAL_CONST(1.894575981586966),
- REAL_CONST(1.915206561397147), REAL_CONST(1.936061793492294), REAL_CONST(1.957144124175400),
- REAL_CONST(1.978456026387951), REAL_CONST(2.000000000000000)
-};
-
-static const real_t log2_tab[] = {
- REAL_CONST(0.000000000000000), REAL_CONST(0.022367813028455), REAL_CONST(0.044394119358453),
- REAL_CONST(0.066089190457772), REAL_CONST(0.087462841250339), REAL_CONST(0.108524456778169),
- REAL_CONST(0.129283016944966), REAL_CONST(0.149747119504682), REAL_CONST(0.169925001442312),
- REAL_CONST(0.189824558880017), REAL_CONST(0.209453365628950), REAL_CONST(0.228818690495881),
- REAL_CONST(0.247927513443585), REAL_CONST(0.266786540694901), REAL_CONST(0.285402218862248),
- REAL_CONST(0.303780748177103), REAL_CONST(0.321928094887362), REAL_CONST(0.339850002884625),
- REAL_CONST(0.357552004618084), REAL_CONST(0.375039431346925), REAL_CONST(0.392317422778760),
- REAL_CONST(0.409390936137702), REAL_CONST(0.426264754702098), REAL_CONST(0.442943495848728),
- REAL_CONST(0.459431618637297), REAL_CONST(0.475733430966398), REAL_CONST(0.491853096329675),
- REAL_CONST(0.507794640198696), REAL_CONST(0.523561956057013), REAL_CONST(0.539158811108031),
- REAL_CONST(0.554588851677637), REAL_CONST(0.569855608330948), REAL_CONST(0.584962500721156),
- REAL_CONST(0.599912842187128), REAL_CONST(0.614709844115208), REAL_CONST(0.629356620079610),
- REAL_CONST(0.643856189774725), REAL_CONST(0.658211482751795), REAL_CONST(0.672425341971496),
- REAL_CONST(0.686500527183218), REAL_CONST(0.700439718141092), REAL_CONST(0.714245517666123),
- REAL_CONST(0.727920454563199), REAL_CONST(0.741466986401147), REAL_CONST(0.754887502163469),
- REAL_CONST(0.768184324776926), REAL_CONST(0.781359713524660), REAL_CONST(0.794415866350106),
- REAL_CONST(0.807354922057604), REAL_CONST(0.820178962415188), REAL_CONST(0.832890014164742),
- REAL_CONST(0.845490050944375), REAL_CONST(0.857980995127572), REAL_CONST(0.870364719583405),
- REAL_CONST(0.882643049361841), REAL_CONST(0.894817763307943), REAL_CONST(0.906890595608519),
- REAL_CONST(0.918863237274595), REAL_CONST(0.930737337562886), REAL_CONST(0.942514505339240),
- REAL_CONST(0.954196310386875), REAL_CONST(0.965784284662087), REAL_CONST(0.977279923499917),
- REAL_CONST(0.988684686772166), REAL_CONST(1.000000000000000)
-};
-
-real_t pow2_fix(real_t val)
-{
- uint32_t x1, x2;
- uint32_t errcorr;
- uint32_t index_frac;
- real_t retval;
- int32_t whole = (val >> REAL_BITS);
-
- /* rest = [0..1] */
- int32_t rest = val - (whole << REAL_BITS);
-
- /* index into pow2_tab */
- int32_t index = rest >> (REAL_BITS-TABLE_BITS);
-
-
- if (val == 0)
- return (1<<REAL_BITS);
-
- /* leave INTERP_BITS bits */
- index_frac = rest >> (REAL_BITS-TABLE_BITS-INTERP_BITS);
- index_frac = index_frac & ((1<<INTERP_BITS)-1);
-
- if (whole > 0)
- {
- retval = 1 << whole;
- } else {
- retval = REAL_CONST(1) >> -whole;
- }
-
- x1 = pow2_tab[index & ((1<<TABLE_BITS)-1)];
- x2 = pow2_tab[(index & ((1<<TABLE_BITS)-1)) + 1];
- errcorr = ( (index_frac*(x2-x1))) >> INTERP_BITS;
-
- if (whole > 0)
- {
- retval = retval * (errcorr + x1);
- } else {
- retval = MUL_R(retval, (errcorr + x1));
- }
-
- return retval;
-}
-
-int32_t pow2_int(real_t val)
-{
- uint32_t x1, x2;
- uint32_t errcorr;
- uint32_t index_frac;
- real_t retval;
- int32_t whole = (val >> REAL_BITS);
-
- /* rest = [0..1] */
- int32_t rest = val - (whole << REAL_BITS);
-
- /* index into pow2_tab */
- int32_t index = rest >> (REAL_BITS-TABLE_BITS);
-
-
- if (val == 0)
- return 1;
-
- /* leave INTERP_BITS bits */
- index_frac = rest >> (REAL_BITS-TABLE_BITS-INTERP_BITS);
- index_frac = index_frac & ((1<<INTERP_BITS)-1);
-
- if (whole > 0)
- retval = 1 << whole;
- else
- retval = 0;
-
- x1 = pow2_tab[index & ((1<<TABLE_BITS)-1)];
- x2 = pow2_tab[(index & ((1<<TABLE_BITS)-1)) + 1];
- errcorr = ( (index_frac*(x2-x1))) >> INTERP_BITS;
-
- retval = MUL_R(retval, (errcorr + x1));
-
- return retval;
-}
-
-/* ld(x) = ld(x*y/y) = ld(x/y) + ld(y), with y=2^N and [1 <= (x/y) < 2] */
-int32_t log2_int(uint32_t val)
-{
- uint32_t frac;
- uint32_t whole = (val);
- int32_t exp = 0;
- uint32_t index;
- uint32_t index_frac;
- uint32_t x1, x2;
- uint32_t errcorr;
-
- /* error */
- if (val == 0)
- return -10000;
-
- exp = floor_log2(val);
- exp -= REAL_BITS;
-
- /* frac = [1..2] */
- if (exp >= 0)
- frac = val >> exp;
- else
- frac = val << -exp;
-
- /* index in the log2 table */
- index = frac >> (REAL_BITS-TABLE_BITS);
-
- /* leftover part for linear interpolation */
- index_frac = frac & ((1<<(REAL_BITS-TABLE_BITS))-1);
-
- /* leave INTERP_BITS bits */
- index_frac = index_frac >> (REAL_BITS-TABLE_BITS-INTERP_BITS);
-
- x1 = log2_tab[index & ((1<<TABLE_BITS)-1)];
- x2 = log2_tab[(index & ((1<<TABLE_BITS)-1)) + 1];
-
- /* linear interpolation */
- /* retval = exp + ((index_frac)*x2 + (1-index_frac)*x1) */
-
- errcorr = (index_frac * (x2-x1)) >> INTERP_BITS;
-
- return ((exp+REAL_BITS) << REAL_BITS) + errcorr + x1;
-}
-
-/* ld(x) = ld(x*y/y) = ld(x/y) + ld(y), with y=2^N and [1 <= (x/y) < 2] */
-real_t log2_fix(uint32_t val)
-{
- uint32_t frac;
- uint32_t whole = (val >> REAL_BITS);
- int8_t exp = 0;
- uint32_t index;
- uint32_t index_frac;
- uint32_t x1, x2;
- uint32_t errcorr;
-
- /* error */
- if (val == 0)
- return -100000;
-
- exp = floor_log2(val);
- exp -= REAL_BITS;
-
- /* frac = [1..2] */
- if (exp >= 0)
- frac = val >> exp;
- else
- frac = val << -exp;
-
- /* index in the log2 table */
- index = frac >> (REAL_BITS-TABLE_BITS);
-
- /* leftover part for linear interpolation */
- index_frac = frac & ((1<<(REAL_BITS-TABLE_BITS))-1);
-
- /* leave INTERP_BITS bits */
- index_frac = index_frac >> (REAL_BITS-TABLE_BITS-INTERP_BITS);
-
- x1 = log2_tab[index & ((1<<TABLE_BITS)-1)];
- x2 = log2_tab[(index & ((1<<TABLE_BITS)-1)) + 1];
-
- /* linear interpolation */
- /* retval = exp + ((index_frac)*x2 + (1-index_frac)*x1) */
-
- errcorr = (index_frac * (x2-x1)) >> INTERP_BITS;
-
- return (exp << REAL_BITS) + errcorr + x1;
-}
-#endif
diff --git a/src/libfaad/common.h b/src/libfaad/common.h
deleted file mode 100644
index 31f07708a..000000000
--- a/src/libfaad/common.h
+++ /dev/null
@@ -1,426 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: common.h,v 1.17 2006/06/17 20:43:57 dgp85 Exp $
-**/
-
-#ifndef __COMMON_H__
-#define __COMMON_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __CYGWIN__
-#define __STRICT_ANSI__
-#endif
-
-#include "config.h"
-
-#define INLINE __inline
-#if 0 //defined(_WIN32) && !defined(_WIN32_WCE)
-#define ALIGN __declspec(align(16))
-#else
-#define ALIGN
-#endif
-
-#ifndef max
-#define max(a, b) (((a) > (b)) ? (a) : (b))
-#endif
-#ifndef min
-#define min(a, b) (((a) < (b)) ? (a) : (b))
-#endif
-
-/* COMPILE TIME DEFINITIONS */
-
-/* use double precision */
-/* #define USE_DOUBLE_PRECISION */
-/* use fixed point reals */
-//#define FIXED_POINT
-//#define BIG_IQ_TABLE
-
-/* Use if target platform has address generators with autoincrement */
-//#define PREFER_POINTERS
-
-#if defined(_WIN32_WCE) || defined(__arm__)
-#define FIXED_POINT
-#endif
-
-
-#define ERROR_RESILIENCE
-
-
-/* Allow decoding of MAIN profile AAC */
-#define MAIN_DEC
-/* Allow decoding of SSR profile AAC */
-//#define SSR_DEC
-/* Allow decoding of LTP profile AAC */
-#define LTP_DEC
-/* Allow decoding of LD profile AAC */
-#define LD_DEC
-/* Allow decoding of scalable profiles */
-//#define SCALABLE_DEC
-/* Allow decoding of Digital Radio Mondiale (DRM) */
-//#define DRM
-//#define DRM_PS
-
-/* LD can't do without LTP */
-#ifdef LD_DEC
-#ifndef ERROR_RESILIENCE
-#define ERROR_RESILIENCE
-#endif
-#ifndef LTP_DEC
-#define LTP_DEC
-#endif
-#endif
-
-#define ALLOW_SMALL_FRAMELENGTH
-
-
-// Define LC_ONLY_DECODER if you want a pure AAC LC decoder (independant of SBR_DEC and PS_DEC)
-//#define LC_ONLY_DECODER
-#ifdef LC_ONLY_DECODER
- #undef LD_DEC
- #undef LTP_DEC
- #undef MAIN_DEC
- #undef SSR_DEC
- #undef DRM
- #undef ALLOW_SMALL_FRAMELENGTH
- #undef ERROR_RESILIENCE
-#endif
-
-#define SBR_DEC
-//#define SBR_LOW_POWER
-#define PS_DEC
-
-/* FIXED POINT: No MAIN decoding */
-#ifdef FIXED_POINT
-# ifdef MAIN_DEC
-# undef MAIN_DEC
-# endif
-# ifdef SBR_DEC
-# undef SBR_DEC
-# endif
-#endif // FIXED_POINT
-
-#ifdef DRM
-# ifndef SCALABLE_DEC
-# define SCALABLE_DEC
-# endif
-#endif
-
-
-#ifdef FIXED_POINT
-#define DIV_R(A, B) (((int64_t)A << REAL_BITS)/B)
-#define DIV_C(A, B) (((int64_t)A << COEF_BITS)/B)
-#else
-#define DIV_R(A, B) ((A)/(B))
-#define DIV_C(A, B) ((A)/(B))
-#endif
-
-#ifndef SBR_LOW_POWER
-#define qmf_t complex_t
-#define QMF_RE(A) RE(A)
-#define QMF_IM(A) IM(A)
-#else
-#define qmf_t real_t
-#define QMF_RE(A) (A)
-#define QMF_IM(A)
-#endif
-
-
-/* END COMPILE TIME DEFINITIONS */
-
-#include <stdio.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#if STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#else
-# if HAVE_STDLIB_H
-# include <stdlib.h>
-# endif
-#endif
-#if HAVE_STRING_H
-# if !STDC_HEADERS && HAVE_MEMORY_H
-# include <memory.h>
-# endif
-# include <string.h>
-#endif
-#if HAVE_STRINGS_H
-# include <strings.h>
-#endif
-
-/* precedence defining int-types by header files for all platforms */
-#if HAVE_INTTYPES_H
-# include <inttypes.h>
-#else
-# if HAVE_STDINT_H
-# include <stdint.h>
-# else
-/* we need these... */
-# ifdef WIN32
-typedef unsigned __int64 uint64_t;
-typedef unsigned __int32 uint32_t;
-typedef unsigned __int16 uint16_t;
-typedef unsigned __int8 uint8_t;
-typedef __int64 int64_t;
-typedef __int32 int32_t;
-typedef __int16 int16_t;
-typedef __int8 int8_t;
-# else /* WIN32 */
-typedef float float32_t;
-typedef unsigned long long uint64_t;
-typedef unsigned long uint32_t;
-typedef unsigned short uint16_t;
-typedef unsigned char uint8_t;
-typedef long long int64_t;
-typedef long int32_t;
-typedef short int16_t;
-typedef char int8_t;
-# endif /* WIN32 */
-# endif
-#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
-#ifndef HAVE_FLOAT32_T
-typedef float float32_t;
-#endif
-
-#if STDC_HEADERS
-# include <string.h>
-#else
-# if !HAVE_STRCHR
-# define strchr index
-# define strrchr rindex
-# endif
-char *strchr(), *strrchr();
-# if !HAVE_MEMCPY
-# define memcpy(d, s, n) bcopy((s), (d), (n))
-# define memmove(d, s, n) bcopy((s), (d), (n))
-# endif
-#endif
-
-#ifdef WORDS_BIGENDIAN
-#define ARCH_IS_BIG_ENDIAN
-#endif
-
-/* FIXED_POINT doesn't work with MAIN and SSR yet */
-#ifdef FIXED_POINT
- #undef MAIN_DEC
- #undef SSR_DEC
-#endif
-
-
-#if defined(FIXED_POINT)
-
- #include "fixed.h"
-
-#elif defined(USE_DOUBLE_PRECISION)
-
- typedef double real_t;
-
- #include <math.h>
-
- #define MUL_R(A,B) ((A)*(B))
- #define MUL_C(A,B) ((A)*(B))
- #define MUL_F(A,B) ((A)*(B))
-
- /* Complex multiplication */
- static INLINE void ComplexMult(real_t *y1, real_t *y2,
- real_t x1, real_t x2, real_t c1, real_t c2)
- {
- *y1 = MUL_F(x1, c1) + MUL_F(x2, c2);
- *y2 = MUL_F(x2, c1) - MUL_F(x1, c2);
- }
-
- #define REAL_CONST(A) ((real_t)(A))
- #define COEF_CONST(A) ((real_t)(A))
- #define Q2_CONST(A) ((real_t)(A))
- #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
-
-#else /* Normal floating point operation */
-
- typedef float real_t;
-
- #define MUL_R(A,B) ((A)*(B))
- #define MUL_C(A,B) ((A)*(B))
- #define MUL_F(A,B) ((A)*(B))
-
- #define REAL_CONST(A) ((real_t)(A))
- #define COEF_CONST(A) ((real_t)(A))
- #define Q2_CONST(A) ((real_t)(A))
- #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
-
- /* Complex multiplication */
- static INLINE void ComplexMult(real_t *y1, real_t *y2,
- real_t x1, real_t x2, real_t c1, real_t c2)
- {
- *y1 = MUL_F(x1, c1) + MUL_F(x2, c2);
- *y2 = MUL_F(x2, c1) - MUL_F(x1, c2);
- }
-
-
-#ifndef HAVE_LRINTF
- #if defined(_WIN32) && !defined(__MINGW32__)
- #define HAS_LRINTF
- static INLINE int lrintf(float f)
- {
- int i;
- __asm
- {
- fld f
- fistp i
- }
- return i;
- }
- #elif (defined(__i386__) && defined(__GNUC__))
- #define HAS_LRINTF
- // from http://www.stereopsis.com/FPU.html
- static INLINE int lrintf(float f)
- {
- int i;
- __asm__ __volatile__ (
- "flds %1 \n\t"
- "fistpl %0 \n\t"
- : "=m" (i)
- : "m" (f));
- return i;
- }
- #endif
-#endif
-
- #ifdef __ICL /* only Intel C compiler has fmath ??? */
-
- #include <mathf.h>
-
- #define sin sinf
- #define cos cosf
- #define log logf
- #define floor floorf
- #define ceil ceilf
- #define sqrt sqrtf
-
- #else
-
-#include <math.h>
-
-#ifdef HAVE_LRINTF
-# define HAS_LRINTF
-# define _ISOC9X_SOURCE 1
-# define _ISOC99_SOURCE 1
-# define __USE_ISOC9X 1
-# define __USE_ISOC99 1
-#endif
-
-#ifdef HAVE_SINF
-# define sin sinf
-#error
-#endif
-#ifdef HAVE_COSF
-# define cos cosf
-#endif
-#ifdef HAVE_LOGF
-# define log logf
-#endif
-#ifdef HAVE_EXPF
-# define exp expf
-#endif
-#ifdef HAVE_FLOORF
-# define floor floorf
-#endif
-#ifdef HAVE_CEILF
-# define ceil ceilf
-#endif
-#ifdef HAVE_SQRTF
-# define sqrt sqrtf
-#endif
-
- #endif
-
-#endif
-
-#ifndef HAS_LRINTF
-/* standard cast */
-#define lrintf(f) ((int32_t)(f))
-#endif
-
-typedef real_t complex_t[2];
-#define RE(A) A[0]
-#define IM(A) A[1]
-
-
-/* common functions */
-uint8_t cpu_has_sse(void);
-uint32_t random_int(void);
-uint32_t ones32(uint32_t x);
-uint32_t floor_log2(uint32_t x);
-uint32_t wl_min_lzc(uint32_t x);
-#ifdef FIXED_POINT
-#define LOG2_MIN_INF REAL_CONST(-10000)
-int32_t log2_int(uint32_t val);
-int32_t log2_fix(uint32_t val);
-int32_t pow2_int(real_t val);
-real_t pow2_fix(real_t val);
-#endif
-uint8_t get_sr_index(const uint32_t samplerate);
-uint8_t max_pred_sfb(const uint8_t sr_index);
-uint8_t max_tns_sfb(const uint8_t sr_index, const uint8_t object_type,
- const uint8_t is_short);
-uint32_t get_sample_rate(const uint8_t sr_index);
-int8_t can_decode_ot(const uint8_t object_type);
-
-void *faad_malloc(size_t size);
-void faad_free(void *b);
-
-//#define PROFILE
-#ifdef PROFILE
-static int64_t faad_get_ts()
-{
- __asm
- {
- rdtsc
- }
-}
-#endif
-
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-#ifndef M_PI_2 /* PI/2 */
-#define M_PI_2 1.57079632679489661923
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/libfaad/decoder.c b/src/libfaad/decoder.c
deleted file mode 100644
index 33aee247e..000000000
--- a/src/libfaad/decoder.c
+++ /dev/null
@@ -1,1024 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: decoder.c,v 1.10 2005/10/29 23:57:06 tmmm Exp $
-**/
-
-#include "common.h"
-#include "structs.h"
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "decoder.h"
-#include "mp4.h"
-#include "syntax.h"
-#include "error.h"
-#include "output.h"
-#include "filtbank.h"
-#include "drc.h"
-#ifdef SBR_DEC
-#include "sbr_dec.h"
-#include "sbr_syntax.h"
-#endif
-#ifdef SSR_DEC
-#include "ssr.h"
-#endif
-
-#ifdef ANALYSIS
-uint16_t dbg_count;
-#endif
-
-/* static function declarations */
-static void* aac_frame_decode(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo,
- uint8_t *buffer, uint32_t buffer_size,
- void **sample_buffer, uint32_t sample_buffer_size);
-static void create_channel_config(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo);
-
-
-char* NEAACDECAPI NeAACDecGetErrorMessage(uint8_t errcode)
-{
- if (errcode >= NUM_ERROR_MESSAGES)
- return NULL;
- return err_msg[errcode];
-}
-
-uint32_t NEAACDECAPI NeAACDecGetCapabilities(void)
-{
- uint32_t cap = 0;
-
- /* can't do without it */
- cap += LC_DEC_CAP;
-
-#ifdef MAIN_DEC
- cap += MAIN_DEC_CAP;
-#endif
-#ifdef LTP_DEC
- cap += LTP_DEC_CAP;
-#endif
-#ifdef LD_DEC
- cap += LD_DEC_CAP;
-#endif
-#ifdef ERROR_RESILIENCE
- cap += ERROR_RESILIENCE_CAP;
-#endif
-#ifdef FIXED_POINT
- cap += FIXED_POINT_CAP;
-#endif
-
- return cap;
-}
-
-NeAACDecHandle NEAACDECAPI NeAACDecOpen(void)
-{
- uint8_t i;
- NeAACDecHandle hDecoder = NULL;
-
- if ((hDecoder = (NeAACDecHandle)faad_malloc(sizeof(NeAACDecStruct))) == NULL)
- return NULL;
-
- memset(hDecoder, 0, sizeof(NeAACDecStruct));
-
- hDecoder->config.outputFormat = FAAD_FMT_16BIT;
- hDecoder->config.defObjectType = MAIN;
- hDecoder->config.defSampleRate = 44100; /* Default: 44.1kHz */
- hDecoder->config.downMatrix = 0;
- hDecoder->adts_header_present = 0;
- hDecoder->adif_header_present = 0;
-#ifdef ERROR_RESILIENCE
- hDecoder->aacSectionDataResilienceFlag = 0;
- hDecoder->aacScalefactorDataResilienceFlag = 0;
- hDecoder->aacSpectralDataResilienceFlag = 0;
-#endif
- hDecoder->frameLength = 1024;
-
- hDecoder->frame = 0;
- hDecoder->sample_buffer = NULL;
-
- for (i = 0; i < MAX_CHANNELS; i++)
- {
- hDecoder->window_shape_prev[i] = 0;
- hDecoder->time_out[i] = NULL;
- hDecoder->fb_intermed[i] = NULL;
-#ifdef SSR_DEC
- hDecoder->ssr_overlap[i] = NULL;
- hDecoder->prev_fmd[i] = NULL;
-#endif
-#ifdef MAIN_DEC
- hDecoder->pred_stat[i] = NULL;
-#endif
-#ifdef LTP_DEC
- hDecoder->ltp_lag[i] = 0;
- hDecoder->lt_pred_stat[i] = NULL;
-#endif
- }
-
-#ifdef SBR_DEC
- for (i = 0; i < MAX_SYNTAX_ELEMENTS; i++)
- {
- hDecoder->sbr[i] = NULL;
- }
-#endif
-
- hDecoder->drc = drc_init(REAL_CONST(1.0), REAL_CONST(1.0));
-
- return hDecoder;
-}
-
-NeAACDecConfigurationPtr NEAACDECAPI NeAACDecGetCurrentConfiguration(NeAACDecHandle hDecoder)
-{
- if (hDecoder)
- {
- NeAACDecConfigurationPtr config = &(hDecoder->config);
-
- return config;
- }
-
- return NULL;
-}
-
-uint8_t NEAACDECAPI NeAACDecSetConfiguration(NeAACDecHandle hDecoder,
- NeAACDecConfigurationPtr config)
-{
- if (hDecoder && config)
- {
- /* check if we can decode this object type */
- if (can_decode_ot(config->defObjectType) < 0)
- return 0;
- hDecoder->config.defObjectType = config->defObjectType;
-
- /* samplerate: anything but 0 should be possible */
- if (config->defSampleRate == 0)
- return 0;
- hDecoder->config.defSampleRate = config->defSampleRate;
-
- /* check output format */
-#ifdef FIXED_POINT
- if ((config->outputFormat < 1) || (config->outputFormat > 4))
- return 0;
-#else
- if ((config->outputFormat < 1) || (config->outputFormat > 5))
- return 0;
-#endif
- hDecoder->config.outputFormat = config->outputFormat;
-
- if (config->downMatrix > 1)
- return 0;
- hDecoder->config.downMatrix = config->downMatrix;
-
- /* OK */
- return 1;
- }
-
- return 0;
-}
-
-int32_t NEAACDECAPI NeAACDecInit(NeAACDecHandle hDecoder, uint8_t *buffer,
- uint32_t buffer_size,
- uint32_t *samplerate, uint8_t *channels)
-{
- uint32_t bits = 0;
- bitfile ld;
- adif_header adif;
- adts_header adts;
-
- if ((hDecoder == NULL) || (samplerate == NULL) || (channels == NULL))
- return -1;
-
- hDecoder->sf_index = get_sr_index(hDecoder->config.defSampleRate);
- hDecoder->object_type = hDecoder->config.defObjectType;
- *samplerate = get_sample_rate(hDecoder->sf_index);
- *channels = 1;
-
- if (buffer != NULL)
- {
- faad_initbits(&ld, buffer, buffer_size);
-
- /* Check if an ADIF header is present */
- if ((buffer[0] == 'A') && (buffer[1] == 'D') &&
- (buffer[2] == 'I') && (buffer[3] == 'F'))
- {
- hDecoder->adif_header_present = 1;
-
- get_adif_header(&adif, &ld);
- faad_byte_align(&ld);
-
- hDecoder->sf_index = adif.pce[0].sf_index;
- hDecoder->object_type = adif.pce[0].object_type + 1;
-
- *samplerate = get_sample_rate(hDecoder->sf_index);
- *channels = adif.pce[0].channels;
-
- memcpy(&(hDecoder->pce), &(adif.pce[0]), sizeof(program_config));
- hDecoder->pce_set = 1;
-
- bits = bit2byte(faad_get_processed_bits(&ld));
-
- /* Check if an ADTS header is present */
- } else if (faad_showbits(&ld, 12) == 0xfff) {
- hDecoder->adts_header_present = 1;
-
- adts.old_format = hDecoder->config.useOldADTSFormat;
- adts_frame(&adts, &ld);
-
- hDecoder->sf_index = adts.sf_index;
- hDecoder->object_type = adts.profile + 1;
-
- *samplerate = get_sample_rate(hDecoder->sf_index);
- *channels = (adts.channel_configuration > 6) ?
- 2 : adts.channel_configuration;
- }
-
- if (ld.error)
- {
- faad_endbits(&ld);
- return -1;
- }
- faad_endbits(&ld);
- }
- hDecoder->channelConfiguration = *channels;
-
-#if (defined(PS_DEC) || defined(DRM_PS))
- /* check if we have a mono file */
- if (*channels == 1)
- {
- /* upMatrix to 2 channels for implicit signalling of PS */
- *channels = 2;
- }
-#endif
-
-#ifdef SBR_DEC
- /* implicit signalling */
- if (*samplerate <= 24000 && !(hDecoder->config.dontUpSampleImplicitSBR))
- {
- *samplerate *= 2;
- hDecoder->forceUpSampling = 1;
- } else if (*samplerate > 24000 && !(hDecoder->config.dontUpSampleImplicitSBR)) {
- hDecoder->downSampledSBR = 1;
- }
-#endif
-
- /* must be done before frameLength is divided by 2 for LD */
-#ifdef SSR_DEC
- if (hDecoder->object_type == SSR)
- hDecoder->fb = ssr_filter_bank_init(hDecoder->frameLength/SSR_BANDS);
- else
-#endif
- hDecoder->fb = filter_bank_init(hDecoder->frameLength);
-
-#ifdef LD_DEC
- if (hDecoder->object_type == LD)
- hDecoder->frameLength >>= 1;
-#endif
-
- if (can_decode_ot(hDecoder->object_type) < 0)
- return -1;
-
- return bits;
-}
-
-/* Init the library using a DecoderSpecificInfo */
-int8_t NEAACDECAPI NeAACDecInit2(NeAACDecHandle hDecoder, uint8_t *pBuffer,
- uint32_t SizeOfDecoderSpecificInfo,
- uint32_t *samplerate, uint8_t *channels)
-{
- int8_t rc;
- mp4AudioSpecificConfig mp4ASC;
-
- if((hDecoder == NULL)
- || (pBuffer == NULL)
- || (SizeOfDecoderSpecificInfo < 2)
- || (samplerate == NULL)
- || (channels == NULL))
- {
- return -1;
- }
-
- hDecoder->adif_header_present = 0;
- hDecoder->adts_header_present = 0;
-
- /* decode the audio specific config */
- rc = AudioSpecificConfig2(pBuffer, SizeOfDecoderSpecificInfo, &mp4ASC,
- &(hDecoder->pce));
-
- /* copy the relevant info to the decoder handle */
- *samplerate = mp4ASC.samplingFrequency;
- if (mp4ASC.channelsConfiguration)
- {
- *channels = mp4ASC.channelsConfiguration;
- } else {
- *channels = hDecoder->pce.channels;
- hDecoder->pce_set = 1;
- }
-#if (defined(PS_DEC) || defined(DRM_PS))
- /* check if we have a mono file */
- if (*channels == 1)
- {
- /* upMatrix to 2 channels for implicit signalling of PS */
- *channels = 2;
- }
-#endif
- hDecoder->sf_index = mp4ASC.samplingFrequencyIndex;
- hDecoder->object_type = mp4ASC.objectTypeIndex;
-#ifdef ERROR_RESILIENCE
- hDecoder->aacSectionDataResilienceFlag = mp4ASC.aacSectionDataResilienceFlag;
- hDecoder->aacScalefactorDataResilienceFlag = mp4ASC.aacScalefactorDataResilienceFlag;
- hDecoder->aacSpectralDataResilienceFlag = mp4ASC.aacSpectralDataResilienceFlag;
-#endif
-#ifdef SBR_DEC
- hDecoder->sbr_present_flag = mp4ASC.sbr_present_flag;
- hDecoder->downSampledSBR = mp4ASC.downSampledSBR;
- if (hDecoder->config.dontUpSampleImplicitSBR == 0)
- hDecoder->forceUpSampling = mp4ASC.forceUpSampling;
- else
- hDecoder->forceUpSampling = 0;
-
- /* AAC core decoder samplerate is 2 times as low */
- if (((hDecoder->sbr_present_flag == 1)&&(!hDecoder->downSampledSBR)) || hDecoder->forceUpSampling == 1)
- {
- hDecoder->sf_index = get_sr_index(mp4ASC.samplingFrequency / 2);
- }
-#endif
-
- if (rc != 0)
- {
- return rc;
- }
- hDecoder->channelConfiguration = mp4ASC.channelsConfiguration;
- if (mp4ASC.frameLengthFlag)
-#ifdef ALLOW_SMALL_FRAMELENGTH
- hDecoder->frameLength = 960;
-#else
- return -1;
-#endif
-
- /* must be done before frameLength is divided by 2 for LD */
-#ifdef SSR_DEC
- if (hDecoder->object_type == SSR)
- hDecoder->fb = ssr_filter_bank_init(hDecoder->frameLength/SSR_BANDS);
- else
-#endif
- hDecoder->fb = filter_bank_init(hDecoder->frameLength);
-
-#ifdef LD_DEC
- if (hDecoder->object_type == LD)
- hDecoder->frameLength >>= 1;
-#endif
-
- return 0;
-}
-
-#ifdef DRM
-int8_t NEAACDECAPI NeAACDecInitDRM(NeAACDecHandle *hDecoder, uint32_t samplerate,
- uint8_t channels)
-{
- if (hDecoder == NULL)
- return 1; /* error */
-
- NeAACDecClose(*hDecoder);
-
- *hDecoder = NeAACDecOpen();
-
- /* Special object type defined for DRM */
- (*hDecoder)->config.defObjectType = DRM_ER_LC;
-
- (*hDecoder)->config.defSampleRate = samplerate;
-#ifdef ERROR_RESILIENCE // This shoudl always be defined for DRM
- (*hDecoder)->aacSectionDataResilienceFlag = 1; /* VCB11 */
- (*hDecoder)->aacScalefactorDataResilienceFlag = 0; /* no RVLC */
- (*hDecoder)->aacSpectralDataResilienceFlag = 1; /* HCR */
-#endif
- (*hDecoder)->frameLength = 960;
- (*hDecoder)->sf_index = get_sr_index((*hDecoder)->config.defSampleRate);
- (*hDecoder)->object_type = (*hDecoder)->config.defObjectType;
-
- if ((channels == DRMCH_STEREO) || (channels == DRMCH_SBR_STEREO))
- (*hDecoder)->channelConfiguration = 2;
- else
- (*hDecoder)->channelConfiguration = 1;
-
-#ifdef SBR_DEC
- if ((channels == DRMCH_MONO) || (channels == DRMCH_STEREO))
- (*hDecoder)->sbr_present_flag = 0;
- else
- (*hDecoder)->sbr_present_flag = 1;
-#endif
-
- (*hDecoder)->fb = filter_bank_init((*hDecoder)->frameLength);
-
- return 0;
-}
-#endif
-
-void NEAACDECAPI NeAACDecClose(NeAACDecHandle hDecoder)
-{
- uint8_t i;
-
- if (hDecoder == NULL)
- return;
-
-#ifdef PROFILE
- printf("AAC decoder total: %I64d cycles\n", hDecoder->cycles);
- printf("requant: %I64d cycles\n", hDecoder->requant_cycles);
- printf("spectral_data: %I64d cycles\n", hDecoder->spectral_cycles);
- printf("scalefactors: %I64d cycles\n", hDecoder->scalefac_cycles);
- printf("output: %I64d cycles\n", hDecoder->output_cycles);
-#endif
-
- for (i = 0; i < MAX_CHANNELS; i++)
- {
- if (hDecoder->time_out[i]) faad_free(hDecoder->time_out[i]);
- if (hDecoder->fb_intermed[i]) faad_free(hDecoder->fb_intermed[i]);
-#ifdef SSR_DEC
- if (hDecoder->ssr_overlap[i]) faad_free(hDecoder->ssr_overlap[i]);
- if (hDecoder->prev_fmd[i]) faad_free(hDecoder->prev_fmd[i]);
-#endif
-#ifdef MAIN_DEC
- if (hDecoder->pred_stat[i]) faad_free(hDecoder->pred_stat[i]);
-#endif
-#ifdef LTP_DEC
- if (hDecoder->lt_pred_stat[i]) faad_free(hDecoder->lt_pred_stat[i]);
-#endif
- }
-
-#ifdef SSR_DEC
- if (hDecoder->object_type == SSR)
- ssr_filter_bank_end(hDecoder->fb);
- else
-#endif
- filter_bank_end(hDecoder->fb);
-
- drc_end(hDecoder->drc);
-
- if (hDecoder->sample_buffer) faad_free(hDecoder->sample_buffer);
-
-#ifdef SBR_DEC
- for (i = 0; i < MAX_SYNTAX_ELEMENTS; i++)
- {
- if (hDecoder->sbr[i])
- sbrDecodeEnd(hDecoder->sbr[i]);
- }
-#endif
-
- if (hDecoder) faad_free(hDecoder);
-}
-
-void NEAACDECAPI NeAACDecPostSeekReset(NeAACDecHandle hDecoder, int32_t frame)
-{
- if (hDecoder)
- {
- hDecoder->postSeekResetFlag = 1;
-
- if (frame != -1)
- hDecoder->frame = frame;
- }
-}
-
-static void create_channel_config(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo)
-{
- hInfo->num_front_channels = 0;
- hInfo->num_side_channels = 0;
- hInfo->num_back_channels = 0;
- hInfo->num_lfe_channels = 0;
- memset(hInfo->channel_position, 0, MAX_CHANNELS*sizeof(uint8_t));
-
- if (hDecoder->downMatrix)
- {
- hInfo->num_front_channels = 2;
- hInfo->channel_position[0] = FRONT_CHANNEL_LEFT;
- hInfo->channel_position[1] = FRONT_CHANNEL_RIGHT;
- return;
- }
-
- /* check if there is a PCE */
- if (hDecoder->pce_set)
- {
- uint8_t i, chpos = 0;
- uint8_t chdir, back_center = 0;
-
- hInfo->num_front_channels = hDecoder->pce.num_front_channels;
- hInfo->num_side_channels = hDecoder->pce.num_side_channels;
- hInfo->num_back_channels = hDecoder->pce.num_back_channels;
- hInfo->num_lfe_channels = hDecoder->pce.num_lfe_channels;
-
- chdir = hInfo->num_front_channels;
- if (chdir & 1)
- {
- hInfo->channel_position[chpos++] = FRONT_CHANNEL_CENTER;
- chdir--;
- }
- for (i = 0; i < chdir; i += 2)
- {
- hInfo->channel_position[chpos++] = FRONT_CHANNEL_LEFT;
- hInfo->channel_position[chpos++] = FRONT_CHANNEL_RIGHT;
- }
-
- for (i = 0; i < hInfo->num_side_channels; i += 2)
- {
- hInfo->channel_position[chpos++] = SIDE_CHANNEL_LEFT;
- hInfo->channel_position[chpos++] = SIDE_CHANNEL_RIGHT;
- }
-
- chdir = hInfo->num_back_channels;
- if (chdir & 1)
- {
- back_center = 1;
- chdir--;
- }
- for (i = 0; i < chdir; i += 2)
- {
- hInfo->channel_position[chpos++] = BACK_CHANNEL_LEFT;
- hInfo->channel_position[chpos++] = BACK_CHANNEL_RIGHT;
- }
- if (back_center)
- {
- hInfo->channel_position[chpos++] = BACK_CHANNEL_CENTER;
- }
-
- for (i = 0; i < hInfo->num_lfe_channels; i++)
- {
- hInfo->channel_position[chpos++] = LFE_CHANNEL;
- }
-
- } else {
- switch (hDecoder->channelConfiguration)
- {
- case 1:
- hInfo->num_front_channels = 1;
- hInfo->channel_position[0] = FRONT_CHANNEL_CENTER;
- break;
- case 2:
- hInfo->num_front_channels = 2;
- hInfo->channel_position[0] = FRONT_CHANNEL_LEFT;
- hInfo->channel_position[1] = FRONT_CHANNEL_RIGHT;
- break;
- case 3:
- hInfo->num_front_channels = 3;
- hInfo->channel_position[0] = FRONT_CHANNEL_CENTER;
- hInfo->channel_position[1] = FRONT_CHANNEL_LEFT;
- hInfo->channel_position[2] = FRONT_CHANNEL_RIGHT;
- break;
- case 4:
- hInfo->num_front_channels = 3;
- hInfo->num_back_channels = 1;
- hInfo->channel_position[0] = FRONT_CHANNEL_CENTER;
- hInfo->channel_position[1] = FRONT_CHANNEL_LEFT;
- hInfo->channel_position[2] = FRONT_CHANNEL_RIGHT;
- hInfo->channel_position[3] = BACK_CHANNEL_CENTER;
- break;
- case 5:
- hInfo->num_front_channels = 3;
- hInfo->num_back_channels = 2;
- hInfo->channel_position[0] = FRONT_CHANNEL_CENTER;
- hInfo->channel_position[1] = FRONT_CHANNEL_LEFT;
- hInfo->channel_position[2] = FRONT_CHANNEL_RIGHT;
- hInfo->channel_position[3] = BACK_CHANNEL_LEFT;
- hInfo->channel_position[4] = BACK_CHANNEL_RIGHT;
- break;
- case 6:
- hInfo->num_front_channels = 3;
- hInfo->num_back_channels = 2;
- hInfo->num_lfe_channels = 1;
- hInfo->channel_position[0] = FRONT_CHANNEL_CENTER;
- hInfo->channel_position[1] = FRONT_CHANNEL_LEFT;
- hInfo->channel_position[2] = FRONT_CHANNEL_RIGHT;
- hInfo->channel_position[3] = BACK_CHANNEL_LEFT;
- hInfo->channel_position[4] = BACK_CHANNEL_RIGHT;
- hInfo->channel_position[5] = LFE_CHANNEL;
- break;
- case 7:
- hInfo->num_front_channels = 3;
- hInfo->num_side_channels = 2;
- hInfo->num_back_channels = 2;
- hInfo->num_lfe_channels = 1;
- hInfo->channel_position[0] = FRONT_CHANNEL_CENTER;
- hInfo->channel_position[1] = FRONT_CHANNEL_LEFT;
- hInfo->channel_position[2] = FRONT_CHANNEL_RIGHT;
- hInfo->channel_position[3] = SIDE_CHANNEL_LEFT;
- hInfo->channel_position[4] = SIDE_CHANNEL_RIGHT;
- hInfo->channel_position[5] = BACK_CHANNEL_LEFT;
- hInfo->channel_position[6] = BACK_CHANNEL_RIGHT;
- hInfo->channel_position[7] = LFE_CHANNEL;
- break;
- default: /* channelConfiguration == 0 || channelConfiguration > 7 */
- {
- uint8_t i;
- uint8_t ch = hDecoder->fr_channels - hDecoder->has_lfe;
- if (ch & 1) /* there's either a center front or a center back channel */
- {
- uint8_t ch1 = (ch-1)/2;
- if (hDecoder->first_syn_ele == ID_SCE)
- {
- hInfo->num_front_channels = ch1 + 1;
- hInfo->num_back_channels = ch1;
- hInfo->channel_position[0] = FRONT_CHANNEL_CENTER;
- for (i = 1; i <= ch1; i+=2)
- {
- hInfo->channel_position[i] = FRONT_CHANNEL_LEFT;
- hInfo->channel_position[i+1] = FRONT_CHANNEL_RIGHT;
- }
- for (i = ch1+1; i < ch; i+=2)
- {
- hInfo->channel_position[i] = BACK_CHANNEL_LEFT;
- hInfo->channel_position[i+1] = BACK_CHANNEL_RIGHT;
- }
- } else {
- hInfo->num_front_channels = ch1;
- hInfo->num_back_channels = ch1 + 1;
- for (i = 0; i < ch1; i+=2)
- {
- hInfo->channel_position[i] = FRONT_CHANNEL_LEFT;
- hInfo->channel_position[i+1] = FRONT_CHANNEL_RIGHT;
- }
- for (i = ch1; i < ch-1; i+=2)
- {
- hInfo->channel_position[i] = BACK_CHANNEL_LEFT;
- hInfo->channel_position[i+1] = BACK_CHANNEL_RIGHT;
- }
- hInfo->channel_position[ch-1] = BACK_CHANNEL_CENTER;
- }
- } else {
- uint8_t ch1 = (ch)/2;
- hInfo->num_front_channels = ch1;
- hInfo->num_back_channels = ch1;
- if (ch1 & 1)
- {
- hInfo->channel_position[0] = FRONT_CHANNEL_CENTER;
- for (i = 1; i <= ch1; i+=2)
- {
- hInfo->channel_position[i] = FRONT_CHANNEL_LEFT;
- hInfo->channel_position[i+1] = FRONT_CHANNEL_RIGHT;
- }
- for (i = ch1+1; i < ch-1; i+=2)
- {
- hInfo->channel_position[i] = BACK_CHANNEL_LEFT;
- hInfo->channel_position[i+1] = BACK_CHANNEL_RIGHT;
- }
- hInfo->channel_position[ch-1] = BACK_CHANNEL_CENTER;
- } else {
- for (i = 0; i < ch1; i+=2)
- {
- hInfo->channel_position[i] = FRONT_CHANNEL_LEFT;
- hInfo->channel_position[i+1] = FRONT_CHANNEL_RIGHT;
- }
- for (i = ch1; i < ch; i+=2)
- {
- hInfo->channel_position[i] = BACK_CHANNEL_LEFT;
- hInfo->channel_position[i+1] = BACK_CHANNEL_RIGHT;
- }
- }
- }
- hInfo->num_lfe_channels = hDecoder->has_lfe;
- for (i = ch; i < hDecoder->fr_channels; i++)
- {
- hInfo->channel_position[i] = LFE_CHANNEL;
- }
- }
- break;
- }
- }
-}
-
-void* NEAACDECAPI NeAACDecDecode(NeAACDecHandle hDecoder,
- NeAACDecFrameInfo *hInfo,
- uint8_t *buffer, uint32_t buffer_size)
-{
- return aac_frame_decode(hDecoder, hInfo, buffer, buffer_size, NULL, 0);
-}
-
-void* NEAACDECAPI NeAACDecDecode2(NeAACDecHandle hDecoder,
- NeAACDecFrameInfo *hInfo,
- uint8_t *buffer, uint32_t buffer_size,
- void **sample_buffer, uint32_t sample_buffer_size)
-{
- if ((sample_buffer == NULL) || (sample_buffer_size == 0))
- {
- hInfo->error = 27;
- return NULL;
- }
-
- return aac_frame_decode(hDecoder, hInfo, buffer, buffer_size,
- sample_buffer, sample_buffer_size);
-}
-
-static void* aac_frame_decode(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo,
- uint8_t *buffer, uint32_t buffer_size,
- void **sample_buffer2, uint32_t sample_buffer_size)
-{
- uint8_t channels = 0;
- uint8_t output_channels = 0;
- bitfile ld;
- uint32_t bitsconsumed;
- uint16_t frame_len;
- void *sample_buffer;
-
-#ifdef PROFILE
- int64_t count = faad_get_ts();
-#endif
-
- /* safety checks */
- if ((hDecoder == NULL) || (hInfo == NULL) || (buffer == NULL))
- {
- return NULL;
- }
-
-#if 0
- printf("%d\n", buffer_size*8);
-#endif
-
- frame_len = hDecoder->frameLength;
-
-
- memset(hInfo, 0, sizeof(NeAACDecFrameInfo));
- memset(hDecoder->internal_channel, 0, MAX_CHANNELS*sizeof(hDecoder->internal_channel[0]));
-
- /* initialize the bitstream */
- faad_initbits(&ld, buffer, buffer_size);
-
-#if 0
- {
- int i;
- for (i = 0; i < ((buffer_size+3)>>2); i++)
- {
- uint8_t *buf;
- uint32_t temp = 0;
- buf = faad_getbitbuffer(&ld, 32);
- //temp = getdword((void*)buf);
- temp = *((uint32_t*)buf);
- printf("0x%.8X\n", temp);
- free(buf);
- }
- faad_endbits(&ld);
- faad_initbits(&ld, buffer, buffer_size);
- }
-#endif
-
-#ifdef DRM
- if (hDecoder->object_type == DRM_ER_LC)
- {
- /* We do not support stereo right now */
- if (0) //(hDecoder->channelConfiguration == 2)
- {
- hInfo->error = 8; // Throw CRC error
- goto error;
- }
-
- faad_getbits(&ld, 8
- DEBUGVAR(1,1,"NeAACDecDecode(): skip CRC"));
- }
-#endif
-
- if (hDecoder->adts_header_present)
- {
- adts_header adts;
-
- adts.old_format = hDecoder->config.useOldADTSFormat;
- if ((hInfo->error = adts_frame(&adts, &ld)) > 0)
- goto error;
-
- /* MPEG2 does byte_alignment() here,
- * but ADTS header is always multiple of 8 bits in MPEG2
- * so not needed to actually do it.
- */
- }
-
-#ifdef ANALYSIS
- dbg_count = 0;
-#endif
-
- /* decode the complete bitstream */
-#ifdef SCALABLE_DEC
- if ((hDecoder->object_type == 6) || (hDecoder->object_type == DRM_ER_LC))
- {
- aac_scalable_main_element(hDecoder, hInfo, &ld, &hDecoder->pce, hDecoder->drc);
- } else {
-#endif
- raw_data_block(hDecoder, hInfo, &ld, &hDecoder->pce, hDecoder->drc);
-#ifdef SCALABLE_DEC
- }
-#endif
-
- channels = hDecoder->fr_channels;
-
- if (hInfo->error > 0)
- goto error;
-
- /* safety check */
- if (channels == 0 || channels > MAX_CHANNELS)
- {
- /* invalid number of channels */
- hInfo->error = 12;
- goto error;
- }
-
- /* no more bit reading after this */
- bitsconsumed = faad_get_processed_bits(&ld);
- hInfo->bytesconsumed = bit2byte(bitsconsumed);
- if (ld.error)
- {
- hInfo->error = 14;
- goto error;
- }
- faad_endbits(&ld);
-
-
- if (!hDecoder->adts_header_present && !hDecoder->adif_header_present)
- {
- if (hDecoder->channelConfiguration == 0)
- hDecoder->channelConfiguration = channels;
-
- if (channels == 8) /* 7.1 */
- hDecoder->channelConfiguration = 7;
- if (channels == 7) /* not a standard channelConfiguration */
- hDecoder->channelConfiguration = 0;
- }
-
- if ((channels == 5 || channels == 6) && hDecoder->config.downMatrix)
- {
- hDecoder->downMatrix = 1;
- output_channels = 2;
- } else {
- output_channels = channels;
- }
-
-#if (defined(PS_DEC) || defined(DRM_PS))
- hDecoder->upMatrix = 0;
- /* check if we have a mono file */
- if (output_channels == 1)
- {
- /* upMatrix to 2 channels for implicit signalling of PS */
- hDecoder->upMatrix = 1;
- output_channels = 2;
- }
-#endif
-
- /* Make a channel configuration based on either a PCE or a channelConfiguration */
- create_channel_config(hDecoder, hInfo);
-
- /* number of samples in this frame */
- hInfo->samples = frame_len*output_channels;
- /* number of channels in this frame */
- hInfo->channels = output_channels;
- /* samplerate */
- hInfo->samplerate = get_sample_rate(hDecoder->sf_index);
- /* object type */
- hInfo->object_type = hDecoder->object_type;
- /* sbr */
- hInfo->sbr = NO_SBR;
- /* header type */
- hInfo->header_type = RAW;
- if (hDecoder->adif_header_present)
- hInfo->header_type = ADIF;
- if (hDecoder->adts_header_present)
- hInfo->header_type = ADTS;
-#if (defined(PS_DEC) || defined(DRM_PS))
- hInfo->ps = hDecoder->ps_used_global;
-#endif
-
- /* check if frame has channel elements */
- if (channels == 0)
- {
- hDecoder->frame++;
- return NULL;
- }
-
- /* allocate the buffer for the final samples */
- if ((hDecoder->sample_buffer == NULL) ||
- (hDecoder->alloced_channels != output_channels))
- {
- static const uint8_t str[] = { sizeof(int16_t), sizeof(int32_t), sizeof(int32_t),
- sizeof(float32_t), sizeof(double), sizeof(int16_t), sizeof(int16_t),
- sizeof(int16_t), sizeof(int16_t), 0, 0, 0
- };
- uint8_t stride = str[hDecoder->config.outputFormat-1];
-#ifdef SBR_DEC
- if (((hDecoder->sbr_present_flag == 1)&&(!hDecoder->downSampledSBR)) || (hDecoder->forceUpSampling == 1))
- {
- stride = 2 * stride;
- }
-#endif
- /* check if we want to use internal sample_buffer */
- if (sample_buffer_size == 0)
- {
- if (hDecoder->sample_buffer)
- faad_free(hDecoder->sample_buffer);
- hDecoder->sample_buffer = NULL;
- hDecoder->sample_buffer = faad_malloc(frame_len*output_channels*stride);
- } else if (sample_buffer_size < frame_len*output_channels*stride) {
- /* provided sample buffer is not big enough */
- hInfo->error = 27;
- return NULL;
- }
- hDecoder->alloced_channels = output_channels;
- }
-
- if (sample_buffer_size == 0)
- {
- sample_buffer = hDecoder->sample_buffer;
- } else {
- sample_buffer = *sample_buffer2;
- }
-
-#ifdef SBR_DEC
- if ((hDecoder->sbr_present_flag == 1) || (hDecoder->forceUpSampling == 1))
- {
- uint8_t ele;
-
- /* this data is different when SBR is used or when the data is upsampled */
- if (!hDecoder->downSampledSBR)
- {
- frame_len *= 2;
- hInfo->samples *= 2;
- hInfo->samplerate *= 2;
- }
-
- /* check if every element was provided with SBR data */
- for (ele = 0; ele < hDecoder->fr_ch_ele; ele++)
- {
- if (hDecoder->sbr[ele] == NULL)
- {
- hInfo->error = 25;
- goto error;
- }
- }
-
- /* sbr */
- if (hDecoder->sbr_present_flag == 1)
- {
- hInfo->object_type = HE_AAC;
- hInfo->sbr = SBR_UPSAMPLED;
- } else {
- hInfo->sbr = NO_SBR_UPSAMPLED;
- }
- if (hDecoder->downSampledSBR)
- {
- hInfo->sbr = SBR_DOWNSAMPLED;
- }
- }
-#endif
-
- sample_buffer = output_to_PCM(hDecoder, hDecoder->time_out, sample_buffer,
- output_channels, frame_len, hDecoder->config.outputFormat);
-
-
- hDecoder->postSeekResetFlag = 0;
-
- hDecoder->frame++;
-#ifdef LD_DEC
- if (hDecoder->object_type != LD)
- {
-#endif
- if (hDecoder->frame <= 1)
- hInfo->samples = 0;
-#ifdef LD_DEC
- } else {
- /* LD encoders will give lower delay */
- if (hDecoder->frame <= 0)
- hInfo->samples = 0;
- }
-#endif
-
- /* cleanup */
-#ifdef ANALYSIS
- fflush(stdout);
-#endif
-
-#ifdef PROFILE
- count = faad_get_ts() - count;
- hDecoder->cycles += count;
-#endif
-
- return sample_buffer;
-
-error:
-
- faad_endbits(&ld);
-
- /* cleanup */
-#ifdef ANALYSIS
- fflush(stdout);
-#endif
-
- return NULL;
-}
diff --git a/src/libfaad/decoder.h b/src/libfaad/decoder.h
deleted file mode 100644
index 5a3a2663f..000000000
--- a/src/libfaad/decoder.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: decoder.h,v 1.9 2005/10/29 23:57:06 tmmm Exp $
-**/
-
-#ifndef __DECODER_H__
-#define __DECODER_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef _WIN32
- #pragma pack(push, 8)
- #ifndef NEAACDECAPI
- #define NEAACDECAPI __cdecl
- #endif
-#else
- #ifndef NEAACDECAPI
- #define NEAACDECAPI
- #endif
-#endif
-
-
-/* library output formats */
-#define FAAD_FMT_16BIT 1
-#define FAAD_FMT_24BIT 2
-#define FAAD_FMT_32BIT 3
-#define FAAD_FMT_FLOAT 4
-#define FAAD_FMT_FIXED FAAD_FMT_FLOAT
-#define FAAD_FMT_DOUBLE 5
-
-#define LC_DEC_CAP (1<<0)
-#define MAIN_DEC_CAP (1<<1)
-#define LTP_DEC_CAP (1<<2)
-#define LD_DEC_CAP (1<<3)
-#define ERROR_RESILIENCE_CAP (1<<4)
-#define FIXED_POINT_CAP (1<<5)
-
-#define FRONT_CHANNEL_CENTER (1)
-#define FRONT_CHANNEL_LEFT (2)
-#define FRONT_CHANNEL_RIGHT (3)
-#define SIDE_CHANNEL_LEFT (4)
-#define SIDE_CHANNEL_RIGHT (5)
-#define BACK_CHANNEL_LEFT (6)
-#define BACK_CHANNEL_RIGHT (7)
-#define BACK_CHANNEL_CENTER (8)
-#define LFE_CHANNEL (9)
-#define UNKNOWN_CHANNEL (0)
-
-char* NEAACDECAPI NeAACDecGetErrorMessage(uint8_t errcode);
-
-uint32_t NEAACDECAPI NeAACDecGetCapabilities(void);
-
-NeAACDecHandle NEAACDECAPI NeAACDecOpen(void);
-
-NeAACDecConfigurationPtr NEAACDECAPI NeAACDecGetCurrentConfiguration(NeAACDecHandle hDecoder);
-
-uint8_t NEAACDECAPI NeAACDecSetConfiguration(NeAACDecHandle hDecoder,
- NeAACDecConfigurationPtr config);
-
-/* Init the library based on info from the AAC file (ADTS/ADIF) */
-int32_t NEAACDECAPI NeAACDecInit(NeAACDecHandle hDecoder,
- uint8_t *buffer,
- uint32_t buffer_size,
- uint32_t *samplerate,
- uint8_t *channels);
-
-/* Init the library using a DecoderSpecificInfo */
-int8_t NEAACDECAPI NeAACDecInit2(NeAACDecHandle hDecoder, uint8_t *pBuffer,
- uint32_t SizeOfDecoderSpecificInfo,
- uint32_t *samplerate, uint8_t *channels);
-
-/* Init the library for DRM */
-int8_t NEAACDECAPI NeAACDecInitDRM(NeAACDecHandle *hDecoder, uint32_t samplerate,
- uint8_t channels);
-
-void NEAACDECAPI NeAACDecClose(NeAACDecHandle hDecoder);
-
-void NEAACDECAPI NeAACDecPostSeekReset(NeAACDecHandle hDecoder, int32_t frame);
-
-void* NEAACDECAPI NeAACDecDecode(NeAACDecHandle hDecoder,
- NeAACDecFrameInfo *hInfo,
- uint8_t *buffer,
- uint32_t buffer_size);
-
-void* NEAACDECAPI NeAACDecDecode2(NeAACDecHandle hDecoder,
- NeAACDecFrameInfo *hInfo,
- uint8_t *buffer, uint32_t buffer_size,
- void **sample_buffer, uint32_t sample_buffer_size);
-
-#ifdef _WIN32
- #pragma pack(pop)
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/libfaad/diff_to_faad2_cvs.patch b/src/libfaad/diff_to_faad2_cvs.patch
deleted file mode 100644
index 0d8490f2e..000000000
--- a/src/libfaad/diff_to_faad2_cvs.patch
+++ /dev/null
@@ -1,101 +0,0 @@
---- faad2-cvs-15092004/libfaad/common.h 2004-09-08 03:43:12.000000000 -0600
-+++ libfaad/common.h 2005-10-29 19:21:53.000000000 -0600
-@@ -147,23 +147,6 @@
-
- /* END COMPILE TIME DEFINITIONS */
-
--#if defined(_WIN32) && !defined(__MINGW32__)
--
--#include <stdlib.h>
--
--typedef unsigned __int64 uint64_t;
--typedef unsigned __int32 uint32_t;
--typedef unsigned __int16 uint16_t;
--typedef unsigned __int8 uint8_t;
--typedef __int64 int64_t;
--typedef __int32 int32_t;
--typedef __int16 int16_t;
--typedef __int8 int8_t;
--typedef float float32_t;
--
--
--#else
--
- #include <stdio.h>
- #if HAVE_SYS_TYPES_H
- # include <sys/types.h>
-@@ -188,6 +171,8 @@
- #if HAVE_STRINGS_H
- # include <strings.h>
- #endif
-+
-+/* precedence defining int-types by header files for all platforms */
- #if HAVE_INTTYPES_H
- # include <inttypes.h>
- #else
-@@ -195,6 +180,17 @@
- # include <stdint.h>
- # else
- /* we need these... */
-+# ifdef WIN32
-+typedef unsigned __int64 uint64_t;
-+typedef unsigned __int32 uint32_t;
-+typedef unsigned __int16 uint16_t;
-+typedef unsigned __int8 uint8_t;
-+typedef __int64 int64_t;
-+typedef __int32 int32_t;
-+typedef __int16 int16_t;
-+typedef __int8 int8_t;
-+# else /* WIN32 */
-+typedef float float32_t;
- typedef unsigned long long uint64_t;
- typedef unsigned long uint32_t;
- typedef unsigned short uint16_t;
-@@ -203,6 +199,7 @@
- typedef long int32_t;
- typedef short int16_t;
- typedef char int8_t;
-+# endif /* WIN32 */
- # endif
- #endif
- #if HAVE_UNISTD_H
-@@ -227,8 +224,6 @@
- # endif
- #endif
-
--#endif
--
- #ifdef WORDS_BIGENDIAN
- #define ARCH_IS_BIG_ENDIAN
- #endif
-@@ -289,6 +284,7 @@
- }
-
-
-+#ifndef HAVE_LRINTF
- #if defined(_WIN32) && !defined(__MINGW32__)
- #define HAS_LRINTF
- static INLINE int lrintf(float f)
-@@ -315,7 +311,7 @@
- return i;
- }
- #endif
--
-+#endif
-
- #ifdef __ICL /* only Intel C compiler has fmath ??? */
-
---- faad2-cvs-15092004/libfaad/bits.h 2004-09-04 08:56:28.000000000 -0600
-+++ libfaad/bits.h 2005-10-29 19:21:53.000000000 -0600
-@@ -56,9 +56,9 @@
- } bitfile;
-
-
--#if defined (_WIN32) && !defined(_WIN32_WCE) && !defined(__MINGW32__)
-+#if defined(_MSC_VER)
- #define BSWAP(a) __asm mov eax,a __asm bswap eax __asm mov a, eax
--#elif defined(LINUX) || defined(DJGPP) || defined(__MINGW32__)
-+#elif defined(LINUX) || defined(DJGPP) || defined (__MINGW32__) || defined (__CYGWIN__)
- #define BSWAP(a) __asm__ ( "bswapl %0\n" : "=r" (a) : "0" (a) )
- #else
- #define BSWAP(a) \
diff --git a/src/libfaad/drc.c b/src/libfaad/drc.c
deleted file mode 100644
index ef4b6a96e..000000000
--- a/src/libfaad/drc.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: drc.c,v 1.7 2005/10/29 23:57:06 tmmm Exp $
-**/
-
-#include "common.h"
-#include "structs.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include "syntax.h"
-#include "drc.h"
-
-drc_info *drc_init(real_t cut, real_t boost)
-{
- drc_info *drc = (drc_info*)faad_malloc(sizeof(drc_info));
- memset(drc, 0, sizeof(drc_info));
-
- drc->ctrl1 = cut;
- drc->ctrl2 = boost;
-
- drc->num_bands = 1;
- drc->band_top[0] = 1024/4 - 1;
- drc->dyn_rng_sgn[0] = 1;
- drc->dyn_rng_ctl[0] = 0;
-
- return drc;
-}
-
-void drc_end(drc_info *drc)
-{
- if (drc) faad_free(drc);
-}
-
-#ifdef FIXED_POINT
-static real_t drc_pow2_table[] =
-{
- COEF_CONST(0.5146511183),
- COEF_CONST(0.5297315472),
- COEF_CONST(0.5452538663),
- COEF_CONST(0.5612310242),
- COEF_CONST(0.5776763484),
- COEF_CONST(0.5946035575),
- COEF_CONST(0.6120267717),
- COEF_CONST(0.6299605249),
- COEF_CONST(0.6484197773),
- COEF_CONST(0.6674199271),
- COEF_CONST(0.6869768237),
- COEF_CONST(0.7071067812),
- COEF_CONST(0.7278265914),
- COEF_CONST(0.7491535384),
- COEF_CONST(0.7711054127),
- COEF_CONST(0.7937005260),
- COEF_CONST(0.8169577266),
- COEF_CONST(0.8408964153),
- COEF_CONST(0.8655365610),
- COEF_CONST(0.8908987181),
- COEF_CONST(0.9170040432),
- COEF_CONST(0.9438743127),
- COEF_CONST(0.9715319412),
- COEF_CONST(1.0000000000),
- COEF_CONST(1.0293022366),
- COEF_CONST(1.0594630944),
- COEF_CONST(1.0905077327),
- COEF_CONST(1.1224620483),
- COEF_CONST(1.1553526969),
- COEF_CONST(1.1892071150),
- COEF_CONST(1.2240535433),
- COEF_CONST(1.2599210499),
- COEF_CONST(1.2968395547),
- COEF_CONST(1.3348398542),
- COEF_CONST(1.3739536475),
- COEF_CONST(1.4142135624),
- COEF_CONST(1.4556531828),
- COEF_CONST(1.4983070769),
- COEF_CONST(1.5422108254),
- COEF_CONST(1.5874010520),
- COEF_CONST(1.6339154532),
- COEF_CONST(1.6817928305),
- COEF_CONST(1.7310731220),
- COEF_CONST(1.7817974363),
- COEF_CONST(1.8340080864),
- COEF_CONST(1.8877486254),
- COEF_CONST(1.9430638823)
-};
-#endif
-
-void drc_decode(drc_info *drc, real_t *spec)
-{
- uint16_t i, bd, top;
-#ifdef FIXED_POINT
- int32_t exp, frac;
-#else
- real_t factor, exp;
-#endif
- uint16_t bottom = 0;
-
- if (drc->num_bands == 1)
- drc->band_top[0] = 1024/4 - 1;
-
- for (bd = 0; bd < drc->num_bands; bd++)
- {
- top = 4 * (drc->band_top[bd] + 1);
-
-#ifndef FIXED_POINT
- /* Decode DRC gain factor */
- if (drc->dyn_rng_sgn[bd]) /* compress */
- exp = -drc->ctrl1 * (drc->dyn_rng_ctl[bd] - (DRC_REF_LEVEL - drc->prog_ref_level))/REAL_CONST(24.0);
- else /* boost */
- exp = drc->ctrl2 * (drc->dyn_rng_ctl[bd] - (DRC_REF_LEVEL - drc->prog_ref_level))/REAL_CONST(24.0);
- factor = (real_t)pow(2.0, exp);
-
- /* Apply gain factor */
- for (i = bottom; i < top; i++)
- spec[i] *= factor;
-#else
- /* Decode DRC gain factor */
- if (drc->dyn_rng_sgn[bd]) /* compress */
- {
- exp = -1 * (drc->dyn_rng_ctl[bd] - (DRC_REF_LEVEL - drc->prog_ref_level))/ 24;
- frac = -1 * (drc->dyn_rng_ctl[bd] - (DRC_REF_LEVEL - drc->prog_ref_level)) % 24;
- } else { /* boost */
- exp = (drc->dyn_rng_ctl[bd] - (DRC_REF_LEVEL - drc->prog_ref_level))/ 24;
- frac = (drc->dyn_rng_ctl[bd] - (DRC_REF_LEVEL - drc->prog_ref_level)) % 24;
- }
-
- /* Apply gain factor */
- if (exp < 0)
- {
- for (i = bottom; i < top; i++)
- {
- spec[i] >>= -exp;
- if (frac)
- spec[i] = MUL_R(spec[i],drc_pow2_table[frac+23]);
- }
- } else {
- for (i = bottom; i < top; i++)
- {
- spec[i] <<= exp;
- if (frac)
- spec[i] = MUL_R(spec[i],drc_pow2_table[frac+23]);
- }
- }
-#endif
-
- bottom = top;
- }
-}
diff --git a/src/libfaad/drc.h b/src/libfaad/drc.h
deleted file mode 100644
index 046ecbc3e..000000000
--- a/src/libfaad/drc.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: drc.h,v 1.7 2005/10/29 23:57:06 tmmm Exp $
-**/
-
-#ifndef __DRC_H__
-#define __DRC_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define DRC_REF_LEVEL 20*4 /* -20 dB */
-
-
-drc_info *drc_init(real_t cut, real_t boost);
-void drc_end(drc_info *drc);
-void drc_decode(drc_info *drc, real_t *spec);
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/libfaad/drm_dec.c b/src/libfaad/drm_dec.c
deleted file mode 100644
index a782b0f22..000000000
--- a/src/libfaad/drm_dec.c
+++ /dev/null
@@ -1,990 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR and PS decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: drm_dec.c,v 1.1 2005/10/30 00:50:19 tmmm Exp $
-**/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-#include "common.h"
-
-#ifdef DRM
-
-#include "sbr_dec.h"
-#include "drm_dec.h"
-#include "bits.h"
-
-/* constants */
-#define DECAY_CUTOFF 3
-#define DECAY_SLOPE 0.05f
-
-/* type definitaions */
-typedef const int8_t (*drm_ps_huff_tab)[2];
-
-
-/* binary search huffman tables */
-static const int8_t f_huffman_sa[][2] =
-{
- { /*0*/ -15, 1 }, /* index 0: 1 bits: x */
- { 2, 3 }, /* index 1: 2 bits: 1x */
- { /*7*/ -8, 4 }, /* index 2: 3 bits: 10x */
- { 5, 6 }, /* index 3: 3 bits: 11x */
- { /*1*/ -14, /*-1*/ -16 }, /* index 4: 4 bits: 101x */
- { /*-2*/ -17, 7 }, /* index 5: 4 bits: 110x */
- { 8, 9 }, /* index 6: 4 bits: 111x */
- { /*2*/ -13, /*-3*/ -18 }, /* index 7: 5 bits: 1101x */
- { /*3*/ -12, 10 }, /* index 8: 5 bits: 1110x */
- { 11, 12 }, /* index 9: 5 bits: 1111x */
- { /*4*/ -11, /*5*/ -10 }, /* index 10: 6 bits: 11101x */
- { /*-4*/ -19, /*-5*/ -20 }, /* index 11: 6 bits: 11110x */
- { /*6*/ -9, 13 }, /* index 12: 6 bits: 11111x */
- { /*-7*/ -22, /*-6*/ -21 } /* index 13: 7 bits: 111111x */
-};
-
-static const int8_t t_huffman_sa[][2] =
-{
- { /*0*/ -15, 1 }, /* index 0: 1 bits: x */
- { 2, 3 }, /* index 1: 2 bits: 1x */
- { /*-1*/ -16, /*1*/ -14 }, /* index 2: 3 bits: 10x */
- { 4, 5 }, /* index 3: 3 bits: 11x */
- { /*-2*/ -17, /*2*/ -13 }, /* index 4: 4 bits: 110x */
- { 6, 7 }, /* index 5: 4 bits: 111x */
- { /*-3*/ -18, /*3*/ -12 }, /* index 6: 5 bits: 1110x */
- { 8, 9 }, /* index 7: 5 bits: 1111x */
- { /*-4*/ -19, /*4*/ -11 }, /* index 8: 6 bits: 11110x */
- { 10, 11 }, /* index 9: 6 bits: 11111x */
- { /*-5*/ -20, /*5*/ -10 }, /* index 10: 7 bits: 111110x */
- { /*-6*/ -21, 12 }, /* index 11: 7 bits: 111111x */
- { /*-7*/ -22, 13 }, /* index 12: 8 bits: 1111111x */
- { /*6*/ -9, /*7*/ -8 } /* index 13: 9 bits: 11111111x */
-};
-
-static const int8_t f_huffman_pan[][2] =
-{
- { /*0*/ -15, 1 }, /* index 0: 1 bits: x */
- { /*-1*/ -16, 2 }, /* index 1: 2 bits: 1x */
- { /*1*/ -14, 3 }, /* index 2: 3 bits: 11x */
- { 4, 5 }, /* index 3: 4 bits: 111x */
- { /*-2*/ -17, /*2*/ -13 }, /* index 4: 5 bits: 1110x */
- { 6, 7 }, /* index 5: 5 bits: 1111x */
- { /*-3*/ -18, /*3*/ -12 }, /* index 6: 6 bits: 11110x */
- { 8, 9 }, /* index 7: 6 bits: 11111x */
- { /*-4*/ -19, /*4*/ -11 }, /* index 8: 7 bits: 111110x */
- { 10, 11 }, /* index 9: 7 bits: 111111x */
- { /*-5*/ -20, /*5*/ -10 }, /* index 10: 8 bits: 1111110x */
- { 12, 13 }, /* index 11: 8 bits: 1111111x */
- { /*-6*/ -21, /*6*/ -9 }, /* index 12: 9 bits: 11111110x */
- { /*-7*/ -22, 14 }, /* index 13: 9 bits: 11111111x */
- { /*7*/ -8, 15 }, /* index 14: 10 bits: 111111111x */
- { 16, 17 }, /* index 15: 11 bits: 1111111111x */
- { /*-8*/ -23, /*8*/ -7 }, /* index 16: 12 bits: 11111111110x */
- { 18, 19 }, /* index 17: 12 bits: 11111111111x */
- { /*-10*/ -25, 20 }, /* index 18: 13 bits: 111111111110x */
- { 21, 22 }, /* index 19: 13 bits: 111111111111x */
- { /*-9*/ -24, /*9*/ -6 }, /* index 20: 14 bits: 1111111111101x */
- { /*10*/ -5, 23 }, /* index 21: 14 bits: 1111111111110x */
- { 24, 25 }, /* index 22: 14 bits: 1111111111111x */
- { /*-13*/ -28, /*-11*/ -26 }, /* index 23: 15 bits: 11111111111101x */
- { /*11*/ -4, /*13*/ -2 }, /* index 24: 15 bits: 11111111111110x */
- { 26, 27 }, /* index 25: 15 bits: 11111111111111x */
- { /*-14*/ -29, /*-12*/ -27 }, /* index 26: 16 bits: 111111111111110x */
- { /*12*/ -3, /*14*/ -1 } /* index 27: 16 bits: 111111111111111x */
-};
-
-static const int8_t t_huffman_pan[][2] =
-{
- { /*0*/ -15, 1 }, /* index 0: 1 bits: x */
- { /*-1*/ -16, 2 }, /* index 1: 2 bits: 1x */
- { /*1*/ -14, 3 }, /* index 2: 3 bits: 11x */
- { /*-2*/ -17, 4 }, /* index 3: 4 bits: 111x */
- { /*2*/ -13, 5 }, /* index 4: 5 bits: 1111x */
- { /*-3*/ -18, 6 }, /* index 5: 6 bits: 11111x */
- { /*3*/ -12, 7 }, /* index 6: 7 bits: 111111x */
- { /*-4*/ -19, 8 }, /* index 7: 8 bits: 1111111x */
- { /*4*/ -11, 9 }, /* index 8: 9 bits: 11111111x */
- { 10, 11 }, /* index 9: 10 bits: 111111111x */
- { /*-5*/ -20, /*5*/ -10 }, /* index 10: 11 bits: 1111111110x */
- { 12, 13 }, /* index 11: 11 bits: 1111111111x */
- { /*-6*/ -21, /*6*/ -9 }, /* index 12: 12 bits: 11111111110x */
- { 14, 15 }, /* index 13: 12 bits: 11111111111x */
- { /*-7*/ -22, /*7*/ -8 }, /* index 14: 13 bits: 111111111110x */
- { 16, 17 }, /* index 15: 13 bits: 111111111111x */
- { /*-8*/ -23, /*8*/ -7 }, /* index 16: 14 bits: 1111111111110x */
- { 18, 19 }, /* index 17: 14 bits: 1111111111111x */
- { /*-10*/ -25, /*10*/ -5 }, /* index 18: 15 bits: 11111111111110x */
- { 20, 21 }, /* index 19: 15 bits: 11111111111111x */
- { /*-9*/ -24, /*9*/ -6 }, /* index 20: 16 bits: 111111111111110x */
- { 22, 23 }, /* index 21: 16 bits: 111111111111111x */
- { 24, 25 }, /* index 22: 17 bits: 1111111111111110x */
- { 26, 27 }, /* index 23: 17 bits: 1111111111111111x */
- { /*-14*/ -29, /*-13*/ -28 }, /* index 24: 18 bits: 11111111111111100x */
- { /*-12*/ -27, /*-11*/ -26 }, /* index 25: 18 bits: 11111111111111101x */
- { /*11*/ -4, /*12*/ -3 }, /* index 26: 18 bits: 11111111111111110x */
- { /*13*/ -2, /*14*/ -1 } /* index 27: 18 bits: 11111111111111111x */
-};
-
-/* There are 3 classes in the standard but the last 2 are identical */
-static const real_t sa_quant[8][2] =
-{
- { FRAC_CONST(0.0000), FRAC_CONST(0.0000) },
- { FRAC_CONST(0.0501), FRAC_CONST(0.1778) },
- { FRAC_CONST(0.0706), FRAC_CONST(0.2818) },
- { FRAC_CONST(0.0995), FRAC_CONST(0.4467) },
- { FRAC_CONST(0.1399), FRAC_CONST(0.5623) },
- { FRAC_CONST(0.1957), FRAC_CONST(0.7079) },
- { FRAC_CONST(0.2713), FRAC_CONST(0.8913) },
- { FRAC_CONST(0.3699), FRAC_CONST(1.0000) },
-};
-
-/* We don't need the actual quantizer values */
-#if 0
-static const real_t pan_quant[8][5] =
-{
- { COEF_CONST(0.0000), COEF_CONST(0.0000), COEF_CONST(0.0000), COEF_CONST(0.0000), COEF_CONST(0.0000) },
- { COEF_CONST(0.1661), COEF_CONST(0.1661), COEF_CONST(0.3322), COEF_CONST(0.3322), COEF_CONST(0.3322) },
- { COEF_CONST(0.3322), COEF_CONST(0.3322), COEF_CONST(0.6644), COEF_CONST(0.8305), COEF_CONST(0.8305) },
- { COEF_CONST(0.4983), COEF_CONST(0.6644), COEF_CONST(0.9966), COEF_CONST(1.4949), COEF_CONST(1.6610) },
- { COEF_CONST(0.6644), COEF_CONST(0.9966), COEF_CONST(1.4949), COEF_CONST(2.1593), COEF_CONST(2.4914) },
- { COEF_CONST(0.8305), COEF_CONST(1.3288), COEF_CONST(2.1593), COEF_CONST(2.9897), COEF_CONST(3.4880) },
- { COEF_CONST(0.9966), COEF_CONST(1.8271), COEF_CONST(2.8236), COEF_CONST(3.8202), COEF_CONST(4.6507) },
- { COEF_CONST(1.3288), COEF_CONST(2.3253), COEF_CONST(3.4880), COEF_CONST(4.6507), COEF_CONST(5.8134) },
-};
-#endif
-
-/* 2^(pan_quant[x][y] */
-static const real_t pan_pow_2_pos[8][5] = {
- { REAL_CONST(1.0000000), REAL_CONST(1.0000000), REAL_CONST(1.0000000), REAL_CONST(1.0000000), REAL_CONST(1.0000000) },
- { REAL_CONST(1.1220021), REAL_CONST(1.1220021), REAL_CONST(1.2589312), REAL_CONST(1.2589312), REAL_CONST(1.2589312) },
- { REAL_CONST(1.2589312), REAL_CONST(1.2589312), REAL_CONST(1.5849090), REAL_CONST(1.7783016), REAL_CONST(1.7783016) },
- { REAL_CONST(1.4125481), REAL_CONST(1.5849090), REAL_CONST(1.9952921), REAL_CONST(2.8184461), REAL_CONST(3.1623565) },
- { REAL_CONST(1.5849090), REAL_CONST(1.9952922), REAL_CONST(2.8184461), REAL_CONST(4.4669806), REAL_CONST(5.6232337) },
- { REAL_CONST(1.7783016), REAL_CONST(2.5119365), REAL_CONST(4.4669806), REAL_CONST(7.9430881), REAL_CONST(11.219994) },
- { REAL_CONST(1.9952921), REAL_CONST(3.5482312), REAL_CONST(7.0792671), REAL_CONST(14.125206), REAL_CONST(25.118876) },
- { REAL_CONST(2.5119365), REAL_CONST(5.0116998), REAL_CONST(11.219994), REAL_CONST(25.118876), REAL_CONST(56.235140) }
-};
-
-/* 2^(-pan_quant[x][y] */
-static const real_t pan_pow_2_neg[8][5] = {
- { REAL_CONST(1), REAL_CONST(1), REAL_CONST(1), REAL_CONST(1), REAL_CONST(1) },
- { REAL_CONST(0.8912487), REAL_CONST(0.8912487), REAL_CONST(0.7943242), REAL_CONST(0.7943242), REAL_CONST(0.7943242) },
- { REAL_CONST(0.7943242), REAL_CONST(0.7943242), REAL_CONST(0.6309511), REAL_CONST(0.5623344), REAL_CONST(0.5623344) },
- { REAL_CONST(0.7079405), REAL_CONST(0.6309511), REAL_CONST(0.5011797), REAL_CONST(0.3548054), REAL_CONST(0.3162199) },
- { REAL_CONST(0.6309511), REAL_CONST(0.5011797), REAL_CONST(0.3548054), REAL_CONST(0.2238649), REAL_CONST(0.1778336) },
- { REAL_CONST(0.5623343), REAL_CONST(0.3980992), REAL_CONST(0.2238649), REAL_CONST(0.1258956), REAL_CONST(0.0891266) },
- { REAL_CONST(0.5011797), REAL_CONST(0.2818306), REAL_CONST(0.1412576), REAL_CONST(0.0707954), REAL_CONST(0.0398107) },
- { REAL_CONST(0.3980992), REAL_CONST(0.1995331), REAL_CONST(0.0891267), REAL_CONST(0.0398107), REAL_CONST(0.0177825) }
-};
-
-/* 2^(pan_quant[x][y]/30) */
-static const real_t pan_pow_2_30_pos[8][5] = {
- { COEF_CONST(1), COEF_CONST(1), COEF_CONST(1), COEF_CONST(1), COEF_CONST(1) },
- { COEF_CONST(1.003845098), COEF_CONST(1.003845098), COEF_CONST(1.007704982), COEF_CONST(1.007704982), COEF_CONST(1.007704982) },
- { COEF_CONST(1.007704982), COEF_CONST(1.007704982), COEF_CONST(1.01546933), COEF_CONST(1.019373909), COEF_CONST(1.019373909) },
- { COEF_CONST(1.011579706), COEF_CONST(1.01546933), COEF_CONST(1.023293502), COEF_CONST(1.035142941), COEF_CONST(1.039123167) },
- { COEF_CONST(1.01546933), COEF_CONST(1.023293502), COEF_CONST(1.035142941), COEF_CONST(1.051155908), COEF_CONST(1.059252598) },
- { COEF_CONST(1.019373909), COEF_CONST(1.03117796), COEF_CONST(1.051155908), COEF_CONST(1.071518432), COEF_CONST(1.0839263) },
- { COEF_CONST(1.023293502), COEF_CONST(1.043118698), COEF_CONST(1.067414119), COEF_CONST(1.092277933), COEF_CONST(1.113439626) },
- { COEF_CONST(1.03117796), COEF_CONST(1.055195268), COEF_CONST(1.0839263), COEF_CONST(1.113439626), COEF_CONST(1.143756546) }
-};
-
-/* 2^(-pan_quant[x][y]/30) */
-static const real_t pan_pow_2_30_neg[8][5] = {
- { COEF_CONST(1), COEF_CONST(1), COEF_CONST(1), COEF_CONST(1), COEF_CONST(1) },
- { COEF_CONST(0.99616963), COEF_CONST(0.99616963), COEF_CONST(0.992353931), COEF_CONST(0.992353931), COEF_CONST(0.99235393) },
- { COEF_CONST(0.992353931), COEF_CONST(0.992353931), COEF_CONST(0.984766325), COEF_CONST(0.980994305), COEF_CONST(0.980994305) },
- { COEF_CONST(0.988552848), COEF_CONST(0.984766325), COEF_CONST(0.977236734), COEF_CONST(0.966050157), COEF_CONST(0.962349827) },
- { COEF_CONST(0.984766325), COEF_CONST(0.977236734), COEF_CONST(0.966050157), COEF_CONST(0.951333663), COEF_CONST(0.944061881) },
- { COEF_CONST(0.980994305), COEF_CONST(0.969764715), COEF_CONST(0.951333663), COEF_CONST(0.933255062), COEF_CONST(0.922571949) },
- { COEF_CONST(0.977236734), COEF_CONST(0.958663671), COEF_CONST(0.936843519), COEF_CONST(0.915517901), COEF_CONST(0.898117847) },
- { COEF_CONST(0.969764715), COEF_CONST(0.947691892), COEF_CONST(0.922571949), COEF_CONST(0.898117847), COEF_CONST(0.874311936) }
-};
-
-static const real_t g_decayslope[MAX_SA_BAND] = {
- FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(0.95),FRAC_CONST(0.9), FRAC_CONST(0.85), FRAC_CONST(0.8),
- FRAC_CONST(0.75),FRAC_CONST(0.7), FRAC_CONST(0.65),FRAC_CONST(0.6), FRAC_CONST(0.55),FRAC_CONST(0.5), FRAC_CONST(0.45),
- FRAC_CONST(0.4), FRAC_CONST(0.35),FRAC_CONST(0.3), FRAC_CONST(0.25),FRAC_CONST(0.2), FRAC_CONST(0.15), FRAC_CONST(0.1),
- FRAC_CONST(0.05),FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0),
- FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0),
- FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0),
- FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0)
-};
-
-static const real_t sa_sqrt_1_minus[8][2] = {
- { FRAC_CONST(1), FRAC_CONST(1) },
- { FRAC_CONST(0.998744206), FRAC_CONST(0.984066644) },
- { FRAC_CONST(0.997504707), FRAC_CONST(0.959473168) },
- { FRAC_CONST(0.995037562), FRAC_CONST(0.894683804) },
- { FRAC_CONST(0.990165638), FRAC_CONST(0.826933317) },
- { FRAC_CONST(0.980663811), FRAC_CONST(0.706312672) },
- { FRAC_CONST(0.962494836), FRAC_CONST(0.45341406) },
- { FRAC_CONST(0.929071574), FRAC_CONST(0) }
-};
-
-static const uint8_t sa_freq_scale[9][2] =
-{
- { 0, 0},
- { 1, 1},
- { 2, 2},
- { 3, 3},
- { 5, 5},
- { 7, 7},
- {10,10},
- {13,13},
- {46,23}
-};
-
-static const uint8_t pan_freq_scale[21] =
-{
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
- 11, 12, 13, 14, 15, 18, 22, 26, 32, 64
-};
-
-static const uint8_t pan_quant_class[20] =
-{
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 2, 2, 2, 2, 3, 3, 3, 4, 4, 4
-};
-
-/* Inverse mapping lookup */
-static const uint8_t pan_inv_freq[64] = {
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19
-};
-
-static const uint8_t sa_inv_freq[MAX_SA_BAND] = {
- 0, 1, 2, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7
-};
-
-static const real_t filter_coeff[] =
-{
- FRAC_CONST(0.65143905754106),
- FRAC_CONST(0.56471812200776),
- FRAC_CONST(0.48954165955695)
-};
-
-static const uint8_t delay_length[][2] =
-{
- { 1, 3 }, { 2, 4 }, { 3, 5 }
-};
-
-static const real_t delay_fraction[] =
-{
- FRAC_CONST(0.43), FRAC_CONST(0.75), FRAC_CONST(0.347)
-};
-
-static const real_t peak_decay[2] =
-{
- FRAC_CONST(0.58664621951003), FRAC_CONST(0.76592833836465)
-};
-
-static const real_t smooth_coeff[2] =
-{
- FRAC_CONST(0.6), FRAC_CONST(0.25)
-};
-
-/* Please note that these are the same tables as in plain PS */
-static const complex_t Q_Fract_allpass_Qmf[][3] = {
- { { FRAC_CONST(0.7804303765), FRAC_CONST(0.6252426505) }, { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(0.8550928831), FRAC_CONST(0.5184748173) } },
- { { FRAC_CONST(-0.4399392009), FRAC_CONST(0.8980275393) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(-0.0643581524), FRAC_CONST(0.9979268909) } },
- { { FRAC_CONST(-0.9723699093), FRAC_CONST(-0.2334454209) }, { FRAC_CONST(0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(-0.9146071672), FRAC_CONST(0.4043435752) } },
- { { FRAC_CONST(0.0157073960), FRAC_CONST(-0.9998766184) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(-0.7814115286), FRAC_CONST(-0.6240159869) } },
- { { FRAC_CONST(0.9792228341), FRAC_CONST(-0.2027871907) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(0.1920081824), FRAC_CONST(-0.9813933372) } },
- { { FRAC_CONST(0.4115142524), FRAC_CONST(0.9114032984) }, { FRAC_CONST(0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(0.9589683414), FRAC_CONST(-0.2835132182) } },
- { { FRAC_CONST(-0.7996847630), FRAC_CONST(0.6004201174) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(0.6947838664), FRAC_CONST(0.7192186117) } },
- { { FRAC_CONST(-0.7604058385), FRAC_CONST(-0.6494481564) }, { FRAC_CONST(0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(-0.3164770305), FRAC_CONST(0.9486001730) } },
- { { FRAC_CONST(0.4679299891), FRAC_CONST(-0.8837655187) }, { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(-0.9874414206), FRAC_CONST(0.1579856575) } },
- { { FRAC_CONST(0.9645573497), FRAC_CONST(0.2638732493) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(-0.5966450572), FRAC_CONST(-0.8025052547) } },
- { { FRAC_CONST(-0.0471066870), FRAC_CONST(0.9988898635) }, { FRAC_CONST(0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.4357025325), FRAC_CONST(-0.9000906944) } },
- { { FRAC_CONST(-0.9851093888), FRAC_CONST(0.1719288528) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(0.9995546937), FRAC_CONST(-0.0298405960) } },
- { { FRAC_CONST(-0.3826831877), FRAC_CONST(-0.9238796234) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(0.4886211455), FRAC_CONST(0.8724960685) } },
- { { FRAC_CONST(0.8181498647), FRAC_CONST(-0.5750049949) }, { FRAC_CONST(0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.5477093458), FRAC_CONST(0.8366686702) } },
- { { FRAC_CONST(0.7396308780), FRAC_CONST(0.6730127335) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.9951074123), FRAC_CONST(-0.0987988561) } },
- { { FRAC_CONST(-0.4954589605), FRAC_CONST(0.8686313629) }, { FRAC_CONST(0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(-0.3725017905), FRAC_CONST(-0.9280315042) } },
- { { FRAC_CONST(-0.9557929039), FRAC_CONST(-0.2940406799) }, { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(0.6506417990), FRAC_CONST(-0.7593847513) } },
- { { FRAC_CONST(0.0784594864), FRAC_CONST(-0.9969173074) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.9741733670), FRAC_CONST(0.2258014232) } },
- { { FRAC_CONST(0.9900237322), FRAC_CONST(-0.1409008205) }, { FRAC_CONST(0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.2502108514), FRAC_CONST(0.9681913853) } },
- { { FRAC_CONST(0.3534744382), FRAC_CONST(0.9354441762) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(-0.7427945137), FRAC_CONST(0.6695194840) } },
- { { FRAC_CONST(-0.8358076215), FRAC_CONST(0.5490224361) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(-0.9370992780), FRAC_CONST(-0.3490629196) } },
- { { FRAC_CONST(-0.7181259394), FRAC_CONST(-0.6959131360) }, { FRAC_CONST(0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.1237744763), FRAC_CONST(-0.9923103452) } },
- { { FRAC_CONST(0.5224990249), FRAC_CONST(-0.8526399136) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(0.8226406574), FRAC_CONST(-0.5685616732) } },
- { { FRAC_CONST(0.9460852146), FRAC_CONST(0.3239179254) }, { FRAC_CONST(0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(0.8844994903), FRAC_CONST(0.4665412009) } },
- { { FRAC_CONST(-0.1097348556), FRAC_CONST(0.9939609170) }, { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(-0.0047125919), FRAC_CONST(0.9999889135) } },
- { { FRAC_CONST(-0.9939610362), FRAC_CONST(0.1097337380) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(-0.8888573647), FRAC_CONST(0.4581840038) } },
- { { FRAC_CONST(-0.3239168525), FRAC_CONST(-0.9460855722) }, { FRAC_CONST(0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(-0.8172453642), FRAC_CONST(-0.5762898922) } },
- { { FRAC_CONST(0.8526405096), FRAC_CONST(-0.5224980116) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(0.1331215799), FRAC_CONST(-0.9910997152) } },
- { { FRAC_CONST(0.6959123611), FRAC_CONST(0.7181267142) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(0.9403476119), FRAC_CONST(-0.3402152061) } },
- { { FRAC_CONST(-0.5490233898), FRAC_CONST(0.8358070254) }, { FRAC_CONST(0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(0.7364512086), FRAC_CONST(0.6764906645) } },
- { { FRAC_CONST(-0.9354437590), FRAC_CONST(-0.3534754813) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.2593250275), FRAC_CONST(0.9657900929) } },
- { { FRAC_CONST(0.1409019381), FRAC_CONST(-0.9900235534) }, { FRAC_CONST(0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(-0.9762582779), FRAC_CONST(0.2166097313) } },
- { { FRAC_CONST(0.9969173670), FRAC_CONST(-0.0784583688) }, { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(-0.6434556246), FRAC_CONST(-0.7654833794) } },
- { { FRAC_CONST(0.2940396070), FRAC_CONST(0.9557932615) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.3812320232), FRAC_CONST(-0.9244794250) } },
- { { FRAC_CONST(-0.8686318994), FRAC_CONST(0.4954580069) }, { FRAC_CONST(0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.9959943891), FRAC_CONST(-0.0894154981) } },
- { { FRAC_CONST(-0.6730118990), FRAC_CONST(-0.7396316528) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(0.5397993922), FRAC_CONST(0.8417937160) } },
- { { FRAC_CONST(0.5750059485), FRAC_CONST(-0.8181492686) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(-0.4968227744), FRAC_CONST(0.8678520322) } },
- { { FRAC_CONST(0.9238792062), FRAC_CONST(0.3826842010) }, { FRAC_CONST(0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.9992290139), FRAC_CONST(-0.0392601527) } },
- { { FRAC_CONST(-0.1719299555), FRAC_CONST(0.9851091504) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.4271997511), FRAC_CONST(-0.9041572809) } },
- { { FRAC_CONST(-0.9988899231), FRAC_CONST(0.0471055657) }, { FRAC_CONST(0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(0.6041822433), FRAC_CONST(-0.7968461514) } },
- { { FRAC_CONST(-0.2638721764), FRAC_CONST(-0.9645576477) }, { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(0.9859085083), FRAC_CONST(0.1672853529) } },
- { { FRAC_CONST(0.8837660551), FRAC_CONST(-0.4679289758) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.3075223565), FRAC_CONST(0.9515408874) } },
- { { FRAC_CONST(0.6494473219), FRAC_CONST(0.7604066133) }, { FRAC_CONST(0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(-0.7015317082), FRAC_CONST(0.7126382589) } },
- { { FRAC_CONST(-0.6004210114), FRAC_CONST(0.7996840477) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(-0.9562535882), FRAC_CONST(-0.2925389707) } },
- { { FRAC_CONST(-0.9114028811), FRAC_CONST(-0.4115152657) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(-0.1827499419), FRAC_CONST(-0.9831594229) } },
- { { FRAC_CONST(0.2027882934), FRAC_CONST(-0.9792225957) }, { FRAC_CONST(0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(0.7872582674), FRAC_CONST(-0.6166234016) } },
- { { FRAC_CONST(0.9998766780), FRAC_CONST(-0.0157062728) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(0.9107555747), FRAC_CONST(0.4129458666) } },
- { { FRAC_CONST(0.2334443331), FRAC_CONST(0.9723701477) }, { FRAC_CONST(0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(0.0549497530), FRAC_CONST(0.9984891415) } },
- { { FRAC_CONST(-0.8980280757), FRAC_CONST(0.4399381876) }, { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(-0.8599416018), FRAC_CONST(0.5103924870) } },
- { { FRAC_CONST(-0.6252418160), FRAC_CONST(-0.7804310918) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(-0.8501682281), FRAC_CONST(-0.5265110731) } },
- { { FRAC_CONST(0.6252435446), FRAC_CONST(-0.7804297209) }, { FRAC_CONST(0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.0737608299), FRAC_CONST(-0.9972759485) } },
- { { FRAC_CONST(0.8980270624), FRAC_CONST(0.4399402142) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(0.9183775187), FRAC_CONST(-0.3957053721) } },
- { { FRAC_CONST(-0.2334465086), FRAC_CONST(0.9723696709) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(0.7754954696), FRAC_CONST(0.6313531399) } },
- { { FRAC_CONST(-0.9998766184), FRAC_CONST(-0.0157085191) }, { FRAC_CONST(0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.2012493610), FRAC_CONST(0.9795400500) } },
- { { FRAC_CONST(-0.2027861029), FRAC_CONST(-0.9792230725) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.9615978599), FRAC_CONST(0.2744622827) } },
- { { FRAC_CONST(0.9114037752), FRAC_CONST(-0.4115132093) }, { FRAC_CONST(0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(-0.6879743338), FRAC_CONST(-0.7257350087) } },
- { { FRAC_CONST(0.6004192233), FRAC_CONST(0.7996854186) }, { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(0.3254036009), FRAC_CONST(-0.9455752373) } },
- { { FRAC_CONST(-0.6494490504), FRAC_CONST(0.7604051232) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.9888865948), FRAC_CONST(-0.1486719251) } },
- { { FRAC_CONST(-0.8837650418), FRAC_CONST(-0.4679309726) }, { FRAC_CONST(0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.5890548825), FRAC_CONST(0.8080930114) } },
- { { FRAC_CONST(0.2638743520), FRAC_CONST(-0.9645570517) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(-0.4441666007), FRAC_CONST(0.8959442377) } },
- { { FRAC_CONST(0.9988898039), FRAC_CONST(0.0471078083) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(-0.9997915030), FRAC_CONST(0.0204183888) } },
- { { FRAC_CONST(0.1719277352), FRAC_CONST(0.9851095676) }, { FRAC_CONST(0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.4803760946), FRAC_CONST(-0.8770626187) } },
- { { FRAC_CONST(-0.9238800406), FRAC_CONST(0.3826821446) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(0.5555707216), FRAC_CONST(-0.8314692974) } },
- { { FRAC_CONST(-0.5750041008), FRAC_CONST(-0.8181505203) }, { FRAC_CONST(0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(0.9941320419), FRAC_CONST(0.1081734300) } }
-};
-
-static const complex_t Phi_Fract_Qmf[] = {
- { FRAC_CONST(0.8181497455), FRAC_CONST(0.5750052333) },
- { FRAC_CONST(-0.2638730407), FRAC_CONST(0.9645574093) },
- { FRAC_CONST(-0.9969173074), FRAC_CONST(0.0784590989) },
- { FRAC_CONST(-0.4115143716), FRAC_CONST(-0.9114032984) },
- { FRAC_CONST(0.7181262970), FRAC_CONST(-0.6959127784) },
- { FRAC_CONST(0.8980275989), FRAC_CONST(0.4399391711) },
- { FRAC_CONST(-0.1097343117), FRAC_CONST(0.9939609766) },
- { FRAC_CONST(-0.9723699093), FRAC_CONST(0.2334453613) },
- { FRAC_CONST(-0.5490227938), FRAC_CONST(-0.8358073831) },
- { FRAC_CONST(0.6004202366), FRAC_CONST(-0.7996846437) },
- { FRAC_CONST(0.9557930231), FRAC_CONST(0.2940403223) },
- { FRAC_CONST(0.0471064523), FRAC_CONST(0.9988898635) },
- { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) },
- { FRAC_CONST(-0.6730124950), FRAC_CONST(-0.7396311164) },
- { FRAC_CONST(0.4679298103), FRAC_CONST(-0.8837656379) },
- { FRAC_CONST(0.9900236726), FRAC_CONST(0.1409012377) },
- { FRAC_CONST(0.2027872950), FRAC_CONST(0.9792228341) },
- { FRAC_CONST(-0.8526401520), FRAC_CONST(0.5224985480) },
- { FRAC_CONST(-0.7804304361), FRAC_CONST(-0.6252426505) },
- { FRAC_CONST(0.3239174187), FRAC_CONST(-0.9460853338) },
- { FRAC_CONST(0.9998766184), FRAC_CONST(-0.0157073177) },
- { FRAC_CONST(0.3534748554), FRAC_CONST(0.9354440570) },
- { FRAC_CONST(-0.7604059577), FRAC_CONST(0.6494480371) },
- { FRAC_CONST(-0.8686315417), FRAC_CONST(-0.4954586625) },
- { FRAC_CONST(0.1719291061), FRAC_CONST(-0.9851093292) },
- { FRAC_CONST(0.9851093292), FRAC_CONST(-0.1719291061) },
- { FRAC_CONST(0.4954586625), FRAC_CONST(0.8686315417) },
- { FRAC_CONST(-0.6494480371), FRAC_CONST(0.7604059577) },
- { FRAC_CONST(-0.9354440570), FRAC_CONST(-0.3534748554) },
- { FRAC_CONST(0.0157073177), FRAC_CONST(-0.9998766184) },
- { FRAC_CONST(0.9460853338), FRAC_CONST(-0.3239174187) },
- { FRAC_CONST(0.6252426505), FRAC_CONST(0.7804304361) },
- { FRAC_CONST(-0.5224985480), FRAC_CONST(0.8526401520) },
- { FRAC_CONST(-0.9792228341), FRAC_CONST(-0.2027872950) },
- { FRAC_CONST(-0.1409012377), FRAC_CONST(-0.9900236726) },
- { FRAC_CONST(0.8837656379), FRAC_CONST(-0.4679298103) },
- { FRAC_CONST(0.7396311164), FRAC_CONST(0.6730124950) },
- { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) },
- { FRAC_CONST(-0.9988898635), FRAC_CONST(-0.0471064523) },
- { FRAC_CONST(-0.2940403223), FRAC_CONST(-0.9557930231) },
- { FRAC_CONST(0.7996846437), FRAC_CONST(-0.6004202366) },
- { FRAC_CONST(0.8358073831), FRAC_CONST(0.5490227938) },
- { FRAC_CONST(-0.2334453613), FRAC_CONST(0.9723699093) },
- { FRAC_CONST(-0.9939609766), FRAC_CONST(0.1097343117) },
- { FRAC_CONST(-0.4399391711), FRAC_CONST(-0.8980275989) },
- { FRAC_CONST(0.6959127784), FRAC_CONST(-0.7181262970) },
- { FRAC_CONST(0.9114032984), FRAC_CONST(0.4115143716) },
- { FRAC_CONST(-0.0784590989), FRAC_CONST(0.9969173074) },
- { FRAC_CONST(-0.9645574093), FRAC_CONST(0.2638730407) },
- { FRAC_CONST(-0.5750052333), FRAC_CONST(-0.8181497455) },
- { FRAC_CONST(0.5750052333), FRAC_CONST(-0.8181497455) },
- { FRAC_CONST(0.9645574093), FRAC_CONST(0.2638730407) },
- { FRAC_CONST(0.0784590989), FRAC_CONST(0.9969173074) },
- { FRAC_CONST(-0.9114032984), FRAC_CONST(0.4115143716) },
- { FRAC_CONST(-0.6959127784), FRAC_CONST(-0.7181262970) },
- { FRAC_CONST(0.4399391711), FRAC_CONST(-0.8980275989) },
- { FRAC_CONST(0.9939609766), FRAC_CONST(0.1097343117) },
- { FRAC_CONST(0.2334453613), FRAC_CONST(0.9723699093) },
- { FRAC_CONST(-0.8358073831), FRAC_CONST(0.5490227938) },
- { FRAC_CONST(-0.7996846437), FRAC_CONST(-0.6004202366) },
- { FRAC_CONST(0.2940403223), FRAC_CONST(-0.9557930231) },
- { FRAC_CONST(0.9988898635), FRAC_CONST(-0.0471064523) },
- { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) },
- { FRAC_CONST(-0.7396311164), FRAC_CONST(0.6730124950) }
-};
-
-
-/* static function declarations */
-static void drm_ps_sa_element(drm_ps_info *ps, bitfile *ld);
-static void drm_ps_pan_element(drm_ps_info *ps, bitfile *ld);
-static int8_t huff_dec(bitfile *ld, drm_ps_huff_tab huff);
-
-
-uint16_t drm_ps_data(drm_ps_info *ps, bitfile *ld)
-{
- uint16_t bits = (uint16_t)faad_get_processed_bits(ld);
-
- ps->drm_ps_data_available = 1;
-
- ps->bs_enable_sa = faad_get1bit(ld);
- ps->bs_enable_pan = faad_get1bit(ld);
-
- if (ps->bs_enable_sa)
- {
- drm_ps_sa_element(ps, ld);
- }
-
- if (ps->bs_enable_pan)
- {
- drm_ps_pan_element(ps, ld);
- }
-
- bits = (uint16_t)faad_get_processed_bits(ld) - bits;
-
- return bits;
-}
-
-static void drm_ps_sa_element(drm_ps_info *ps, bitfile *ld)
-{
- drm_ps_huff_tab huff;
- uint8_t band;
-
- ps->bs_sa_dt_flag = faad_get1bit(ld);
- if (ps->bs_sa_dt_flag)
- {
- huff = t_huffman_sa;
- } else {
- huff = f_huffman_sa;
- }
-
- for (band = 0; band < DRM_NUM_SA_BANDS; band++)
- {
- ps->bs_sa_data[band] = huff_dec(ld, huff);
- }
-}
-
-static void drm_ps_pan_element(drm_ps_info *ps, bitfile *ld)
-{
- drm_ps_huff_tab huff;
- uint8_t band;
-
- ps->bs_pan_dt_flag = faad_get1bit(ld);
- if (ps->bs_pan_dt_flag)
- {
- huff = t_huffman_pan;
- } else {
- huff = f_huffman_pan;
- }
-
- for (band = 0; band < DRM_NUM_PAN_BANDS; band++)
- {
- ps->bs_pan_data[band] = huff_dec(ld, huff);
- }
-}
-
-/* binary search huffman decoding */
-static int8_t huff_dec(bitfile *ld, drm_ps_huff_tab huff)
-{
- uint8_t bit;
- int16_t index = 0;
-
- while (index >= 0)
- {
- bit = (uint8_t)faad_get1bit(ld);
- index = huff[index][bit];
- }
-
- return index + 15;
-}
-
-
-static int8_t sa_delta_clip(drm_ps_info *ps, int8_t i)
-{
- if (i < 0) {
- /* printf(" SAminclip %d", i); */
- ps->sa_decode_error = 1;
- return 0;
- } else if (i > 7) {
- /* printf(" SAmaxclip %d", i); */
- ps->sa_decode_error = 1;
- return 7;
- } else
- return i;
-}
-
-static int8_t pan_delta_clip(drm_ps_info *ps, int8_t i)
-{
- if (i < -7) {
- /* printf(" PANminclip %d", i); */
- ps->pan_decode_error = 1;
- return -7;
- } else if (i > 7) {
- /* printf(" PANmaxclip %d", i); */
- ps->pan_decode_error = 1;
- return 7;
- } else
- return i;
-}
-
-static void drm_ps_delta_decode(drm_ps_info *ps)
-{
- uint8_t band;
-
- if (ps->bs_enable_sa)
- {
- if (ps->bs_sa_dt_flag && !ps->g_last_had_sa)
- {
- for (band = 0; band < DRM_NUM_SA_BANDS; band++)
- {
- ps->g_prev_sa_index[band] = 0;
- }
- }
- if (ps->bs_sa_dt_flag)
- {
- ps->g_sa_index[0] = sa_delta_clip(ps, ps->g_prev_sa_index[0]+ps->bs_sa_data[0]);
-
- } else {
- ps->g_sa_index[0] = sa_delta_clip(ps,ps->bs_sa_data[0]);
- }
-
- for (band = 1; band < DRM_NUM_SA_BANDS; band++)
- {
- if (ps->bs_sa_dt_flag)
- {
- ps->g_sa_index[band] = sa_delta_clip(ps, ps->g_prev_sa_index[band] + ps->bs_sa_data[band]);
- } else {
- ps->g_sa_index[band] = sa_delta_clip(ps, ps->g_sa_index[band-1] + ps->bs_sa_data[band]);
- }
- }
- }
-
- /* An error during SA decoding implies PAN data will be undecodable, too */
- /* Also, we don't like on/off switching in PS, so we force to last settings */
- if (ps->sa_decode_error) {
- ps->pan_decode_error = 1;
- ps->bs_enable_pan = ps->g_last_had_pan;
- ps->bs_enable_sa = ps->g_last_had_sa;
- }
-
-
- if (ps->bs_enable_sa)
- {
- if (ps->sa_decode_error) {
- for (band = 0; band < DRM_NUM_SA_BANDS; band++)
- {
- ps->g_sa_index[band] = ps->g_last_good_sa_index[band];
- }
- } else {
- for (band = 0; band < DRM_NUM_SA_BANDS; band++)
- {
- ps->g_last_good_sa_index[band] = ps->g_sa_index[band];
- }
- }
- }
-
- if (ps->bs_enable_pan)
- {
- if (ps->bs_pan_dt_flag && !ps->g_last_had_pan)
- {
-/* The DRM PS spec doesn't say anything about this case. (deltacoded in time without a previous frame)
- AAC PS spec you must tread previous frame as 0, so that's what we try.
-*/
- for (band = 0; band < DRM_NUM_PAN_BANDS; band++)
- {
- ps->g_prev_pan_index[band] = 0;
- }
- }
-
- if (ps->bs_pan_dt_flag)
- {
- ps->g_pan_index[0] = pan_delta_clip(ps, ps->g_prev_pan_index[0]+ps->bs_pan_data[0]);
- } else {
- ps->g_pan_index[0] = pan_delta_clip(ps, ps->bs_pan_data[0]);
- }
-
- for (band = 1; band < DRM_NUM_PAN_BANDS; band++)
- {
- if (ps->bs_pan_dt_flag)
- {
- ps->g_pan_index[band] = pan_delta_clip(ps, ps->g_prev_pan_index[band] + ps->bs_pan_data[band]);
- } else {
- ps->g_pan_index[band] = pan_delta_clip(ps, ps->g_pan_index[band-1] + ps->bs_pan_data[band]);
- }
- }
-
- if (ps->pan_decode_error) {
- for (band = 0; band < DRM_NUM_PAN_BANDS; band++)
- {
- ps->g_pan_index[band] = ps->g_last_good_pan_index[band];
- }
- } else {
- for (band = 0; band < DRM_NUM_PAN_BANDS; band++)
- {
- ps->g_last_good_pan_index[band] = ps->g_pan_index[band];
- }
- }
- }
-}
-
-static void drm_calc_sa_side_signal(drm_ps_info *ps, qmf_t X[38][64], uint8_t rateselect)
-{
- uint8_t s, b, k;
- complex_t qfrac, tmp0, tmp, in, R0;
- real_t peakdiff;
- real_t nrg;
- real_t power;
- real_t transratio;
- real_t new_delay_slopes[NUM_OF_LINKS];
- uint8_t temp_delay_ser[NUM_OF_LINKS];
- complex_t Phi_Fract;
-#ifdef FIXED_POINT
- uint32_t in_re, in_im;
-#endif
-
- for (b = 0; b < sa_freq_scale[DRM_NUM_SA_BANDS][rateselect]; b++)
- {
- /* set delay indices */
- for (k = 0; k < NUM_OF_LINKS; k++)
- temp_delay_ser[k] = ps->delay_buf_index_ser[k];
-
- RE(Phi_Fract) = RE(Phi_Fract_Qmf[b]);
- IM(Phi_Fract) = IM(Phi_Fract_Qmf[b]);
-
- for (s = 0; s < NUM_OF_SUBSAMPLES; s++)
- {
- const real_t gamma = REAL_CONST(1.5);
- const real_t sigma = REAL_CONST(1.5625);
-
- RE(in) = QMF_RE(X[s][b]);
- IM(in) = QMF_IM(X[s][b]);
-
-#ifdef FIXED_POINT
- /* NOTE: all input is scaled by 2^(-5) because of fixed point QMF
- * meaning that P will be scaled by 2^(-10) compared to floating point version
- */
- in_re = ((abs(RE(in))+(1<<(REAL_BITS-1)))>>REAL_BITS);
- in_im = ((abs(IM(in))+(1<<(REAL_BITS-1)))>>REAL_BITS);
- power = in_re*in_re + in_im*in_im;
-#else
- power = MUL_R(RE(in),RE(in)) + MUL_R(IM(in),IM(in));
-#endif
-
- ps->peakdecay_fast[b] = MUL_F(ps->peakdecay_fast[b], peak_decay[rateselect]);
- if (ps->peakdecay_fast[b] < power)
- ps->peakdecay_fast[b] = power;
-
- peakdiff = ps->prev_peakdiff[b];
- peakdiff += MUL_F((ps->peakdecay_fast[b] - power - ps->prev_peakdiff[b]), smooth_coeff[rateselect]);
- ps->prev_peakdiff[b] = peakdiff;
-
- nrg = ps->prev_nrg[b];
- nrg += MUL_F((power - ps->prev_nrg[b]), smooth_coeff[rateselect]);
- ps->prev_nrg[b] = nrg;
-
- if (MUL_R(peakdiff, gamma) <= nrg) {
- transratio = sigma;
- } else {
- transratio = MUL_R(DIV_R(nrg, MUL_R(peakdiff, gamma)), sigma);
- }
-
- for (k = 0; k < NUM_OF_LINKS; k++)
- {
- new_delay_slopes[k] = MUL_F(g_decayslope[b], filter_coeff[k]);
- }
-
- RE(tmp0) = RE(ps->d_buff[0][b]);
- IM(tmp0) = IM(ps->d_buff[0][b]);
-
- RE(ps->d_buff[0][b]) = RE(ps->d_buff[1][b]);
- IM(ps->d_buff[0][b]) = IM(ps->d_buff[1][b]);
-
- RE(ps->d_buff[1][b]) = RE(in);
- IM(ps->d_buff[1][b]) = IM(in);
-
- ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Phi_Fract), IM(Phi_Fract));
-
- RE(R0) = RE(tmp);
- IM(R0) = IM(tmp);
-
- for (k = 0; k < NUM_OF_LINKS; k++)
- {
- RE(qfrac) = RE(Q_Fract_allpass_Qmf[b][k]);
- IM(qfrac) = IM(Q_Fract_allpass_Qmf[b][k]);
-
- RE(tmp0) = RE(ps->d2_buff[k][temp_delay_ser[k]][b]);
- IM(tmp0) = IM(ps->d2_buff[k][temp_delay_ser[k]][b]);
-
- ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(qfrac), IM(qfrac));
-
- RE(tmp) += -MUL_F(new_delay_slopes[k], RE(R0));
- IM(tmp) += -MUL_F(new_delay_slopes[k], IM(R0));
-
- RE(ps->d2_buff[k][temp_delay_ser[k]][b]) = RE(R0) + MUL_F(new_delay_slopes[k], RE(tmp));
- IM(ps->d2_buff[k][temp_delay_ser[k]][b]) = IM(R0) + MUL_F(new_delay_slopes[k], IM(tmp));
-
- RE(R0) = RE(tmp);
- IM(R0) = IM(tmp);
- }
-
- QMF_RE(ps->SA[s][b]) = MUL_R(RE(R0), transratio);
- QMF_IM(ps->SA[s][b]) = MUL_R(IM(R0), transratio);
-
- for (k = 0; k < NUM_OF_LINKS; k++)
- {
- if (++temp_delay_ser[k] >= delay_length[k][rateselect])
- temp_delay_ser[k] = 0;
- }
- }
- }
-
- for (k = 0; k < NUM_OF_LINKS; k++)
- ps->delay_buf_index_ser[k] = temp_delay_ser[k];
-}
-
-static void drm_add_ambiance(drm_ps_info *ps, uint8_t rateselect, qmf_t X_left[38][64], qmf_t X_right[38][64])
-{
- uint8_t s, b, ifreq, qclass;
- real_t sa_map[MAX_SA_BAND], sa_dir_map[MAX_SA_BAND], k_sa_map[MAX_SA_BAND], k_sa_dir_map[MAX_SA_BAND];
- real_t new_dir_map, new_sa_map;
-
- if (ps->bs_enable_sa)
- {
- /* Instead of dequantization and mapping, we use an inverse mapping
- to look up all the values we need */
- for (b = 0; b < sa_freq_scale[DRM_NUM_SA_BANDS][rateselect]; b++)
- {
- const real_t inv_f_num_of_subsamples = FRAC_CONST(0.03333333333);
-
- ifreq = sa_inv_freq[b];
- qclass = (b != 0);
-
- sa_map[b] = sa_quant[ps->g_prev_sa_index[ifreq]][qclass];
- new_sa_map = sa_quant[ps->g_sa_index[ifreq]][qclass];
-
- k_sa_map[b] = MUL_F(inv_f_num_of_subsamples, (new_sa_map - sa_map[b]));
-
- sa_dir_map[b] = sa_sqrt_1_minus[ps->g_prev_sa_index[ifreq]][qclass];
- new_dir_map = sa_sqrt_1_minus[ps->g_sa_index[ifreq]][qclass];
-
- k_sa_dir_map[b] = MUL_F(inv_f_num_of_subsamples, (new_dir_map - sa_dir_map[b]));
-
- }
-
- for (s = 0; s < NUM_OF_SUBSAMPLES; s++)
- {
- for (b = 0; b < sa_freq_scale[DRM_NUM_SA_BANDS][rateselect]; b++)
- {
- QMF_RE(X_right[s][b]) = MUL_F(QMF_RE(X_left[s][b]), sa_dir_map[b]) - MUL_F(QMF_RE(ps->SA[s][b]), sa_map[b]);
- QMF_IM(X_right[s][b]) = MUL_F(QMF_IM(X_left[s][b]), sa_dir_map[b]) - MUL_F(QMF_IM(ps->SA[s][b]), sa_map[b]);
- QMF_RE(X_left[s][b]) = MUL_F(QMF_RE(X_left[s][b]), sa_dir_map[b]) + MUL_F(QMF_RE(ps->SA[s][b]), sa_map[b]);
- QMF_IM(X_left[s][b]) = MUL_F(QMF_IM(X_left[s][b]), sa_dir_map[b]) + MUL_F(QMF_IM(ps->SA[s][b]), sa_map[b]);
-
- sa_map[b] += k_sa_map[b];
- sa_dir_map[b] += k_sa_dir_map[b];
- }
- for (b = sa_freq_scale[DRM_NUM_SA_BANDS][rateselect]; b < NUM_OF_QMF_CHANNELS; b++)
- {
- QMF_RE(X_right[s][b]) = QMF_RE(X_left[s][b]);
- QMF_IM(X_right[s][b]) = QMF_IM(X_left[s][b]);
- }
- }
- }
- else {
- for (s = 0; s < NUM_OF_SUBSAMPLES; s++)
- {
- for (b = 0; b < NUM_OF_QMF_CHANNELS; b++)
- {
- QMF_RE(X_right[s][b]) = QMF_RE(X_left[s][b]);
- QMF_IM(X_right[s][b]) = QMF_IM(X_left[s][b]);
- }
- }
- }
-}
-
-static void drm_add_pan(drm_ps_info *ps, uint8_t rateselect, qmf_t X_left[38][64], qmf_t X_right[38][64])
-{
- uint8_t s, b, qclass, ifreq;
- real_t tmp, coeff1, coeff2;
- real_t pan_base[MAX_PAN_BAND];
- real_t pan_delta[MAX_PAN_BAND];
- qmf_t temp_l, temp_r;
-
- if (ps->bs_enable_pan)
- {
- for (b = 0; b < NUM_OF_QMF_CHANNELS; b++)
- {
- /* Instead of dequantization, 20->64 mapping and 2^G(x,y) we do an
- inverse mapping 64->20 and look up the 2^G(x,y) values directly */
- ifreq = pan_inv_freq[b];
- qclass = pan_quant_class[ifreq];
-
- if (ps->g_prev_pan_index[ifreq] >= 0)
- {
- pan_base[b] = pan_pow_2_pos[ps->g_prev_pan_index[ifreq]][qclass];
- } else {
- pan_base[b] = pan_pow_2_neg[-ps->g_prev_pan_index[ifreq]][qclass];
- }
-
- /* 2^((a-b)/30) = 2^(a/30) * 1/(2^(b/30)) */
- /* a en b can be negative so we may need to inverse parts */
- if (ps->g_pan_index[ifreq] >= 0)
- {
- if (ps->g_prev_pan_index[ifreq] >= 0)
- {
- pan_delta[b] = MUL_C(pan_pow_2_30_pos[ps->g_pan_index[ifreq]][qclass],
- pan_pow_2_30_neg[ps->g_prev_pan_index[ifreq]][qclass]);
- } else {
- pan_delta[b] = MUL_C(pan_pow_2_30_pos[ps->g_pan_index[ifreq]][qclass],
- pan_pow_2_30_pos[-ps->g_prev_pan_index[ifreq]][qclass]);
- }
- } else {
- if (ps->g_prev_pan_index[ifreq] >= 0)
- {
- pan_delta[b] = MUL_C(pan_pow_2_30_neg[-ps->g_pan_index[ifreq]][qclass],
- pan_pow_2_30_neg[ps->g_prev_pan_index[ifreq]][qclass]);
- } else {
- pan_delta[b] = MUL_C(pan_pow_2_30_neg[-ps->g_pan_index[ifreq]][qclass],
- pan_pow_2_30_pos[-ps->g_prev_pan_index[ifreq]][qclass]);
- }
- }
- }
-
- for (s = 0; s < NUM_OF_SUBSAMPLES; s++)
- {
- /* PAN always uses all 64 channels */
- for (b = 0; b < NUM_OF_QMF_CHANNELS; b++)
- {
- tmp = pan_base[b];
-
- coeff2 = DIV_R(REAL_CONST(2.0), (REAL_CONST(1.0) + tmp));
- coeff1 = MUL_R(coeff2, tmp);
-
- QMF_RE(temp_l) = QMF_RE(X_left[s][b]);
- QMF_IM(temp_l) = QMF_IM(X_left[s][b]);
- QMF_RE(temp_r) = QMF_RE(X_right[s][b]);
- QMF_IM(temp_r) = QMF_IM(X_right[s][b]);
-
- QMF_RE(X_left[s][b]) = MUL_R(QMF_RE(temp_l), coeff1);
- QMF_IM(X_left[s][b]) = MUL_R(QMF_IM(temp_l), coeff1);
- QMF_RE(X_right[s][b]) = MUL_R(QMF_RE(temp_r), coeff2);
- QMF_IM(X_right[s][b]) = MUL_R(QMF_IM(temp_r), coeff2);
-
- /* 2^(a+k*b) = 2^a * 2^b * ... * 2^b */
- /* ^^^^^^^^^^^^^^^ k times */
- pan_base[b] = MUL_C(pan_base[b], pan_delta[b]);
- }
- }
- }
-}
-
-drm_ps_info *drm_ps_init(void)
-{
- drm_ps_info *ps = (drm_ps_info*)faad_malloc(sizeof(drm_ps_info));
-
- memset(ps, 0, sizeof(drm_ps_info));
-
- return ps;
-}
-
-void drm_ps_free(drm_ps_info *ps)
-{
- faad_free(ps);
-}
-
-/* main DRM PS decoding function */
-uint8_t drm_ps_decode(drm_ps_info *ps, uint8_t guess, uint32_t samplerate, qmf_t X_left[38][64], qmf_t X_right[38][64])
-{
- uint8_t rateselect = (samplerate >= 24000);
-
- if (ps == NULL)
- {
- memcpy(X_right, X_left, sizeof(qmf_t)*30*64);
- return 0;
- }
-
- if (!ps->drm_ps_data_available && !guess)
- {
- memcpy(X_right, X_left, sizeof(qmf_t)*30*64);
- memset(ps->g_prev_sa_index, 0, sizeof(ps->g_prev_sa_index));
- memset(ps->g_prev_pan_index, 0, sizeof(ps->g_prev_pan_index));
- return 0;
- }
-
- /* if SBR CRC doesn't match out, we can assume decode errors to start with,
- and we'll guess what the parameters should be */
- if (!guess)
- {
- ps->sa_decode_error = 0;
- ps->pan_decode_error = 0;
- drm_ps_delta_decode(ps);
- } else
- {
- ps->sa_decode_error = 1;
- ps->pan_decode_error = 1;
- /* don't even bother decoding */
- }
-
- ps->drm_ps_data_available = 0;
-
- drm_calc_sa_side_signal(ps, X_left, rateselect);
- drm_add_ambiance(ps, rateselect, X_left, X_right);
-
- if (ps->bs_enable_sa)
- {
- ps->g_last_had_sa = 1;
-
- memcpy(ps->g_prev_sa_index, ps->g_sa_index, sizeof(int8_t) * DRM_NUM_SA_BANDS);
-
- } else {
- ps->g_last_had_sa = 0;
- }
-
- if (ps->bs_enable_pan)
- {
- drm_add_pan(ps, rateselect, X_left, X_right);
-
- ps->g_last_had_pan = 1;
-
- memcpy(ps->g_prev_pan_index, ps->g_pan_index, sizeof(int8_t) * DRM_NUM_PAN_BANDS);
-
- } else {
- ps->g_last_had_pan = 0;
- }
-
-
- return 0;
-}
-
-#endif
diff --git a/src/libfaad/drm_dec.h b/src/libfaad/drm_dec.h
deleted file mode 100644
index bb7d6dc93..000000000
--- a/src/libfaad/drm_dec.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: drm_dec.h,v 1.1 2005/10/30 00:50:19 tmmm Exp $
-**/
-
-#ifndef __DRM_DEC_H__
-#define __DRM_DEC_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "bits.h"
-
-#define DRM_PARAMETRIC_STEREO 0
-#define DRM_NUM_SA_BANDS 8
-#define DRM_NUM_PAN_BANDS 20
-#define NUM_OF_LINKS 3
-#define NUM_OF_QMF_CHANNELS 64
-#define NUM_OF_SUBSAMPLES 30
-#define MAX_SA_BAND 46
-#define MAX_PAN_BAND 64
-#define MAX_DELAY 5
-
-typedef struct
-{
- uint8_t drm_ps_data_available;
- uint8_t bs_enable_sa;
- uint8_t bs_enable_pan;
-
- uint8_t bs_sa_dt_flag;
- uint8_t bs_pan_dt_flag;
-
- uint8_t g_last_had_sa;
- uint8_t g_last_had_pan;
-
- int8_t bs_sa_data[DRM_NUM_SA_BANDS];
- int8_t bs_pan_data[DRM_NUM_PAN_BANDS];
-
- int8_t g_sa_index[DRM_NUM_SA_BANDS];
- int8_t g_pan_index[DRM_NUM_PAN_BANDS];
- int8_t g_prev_sa_index[DRM_NUM_SA_BANDS];
- int8_t g_prev_pan_index[DRM_NUM_PAN_BANDS];
-
- int8_t sa_decode_error;
- int8_t pan_decode_error;
-
- int8_t g_last_good_sa_index[DRM_NUM_SA_BANDS];
- int8_t g_last_good_pan_index[DRM_NUM_PAN_BANDS];
-
- qmf_t SA[NUM_OF_SUBSAMPLES][MAX_SA_BAND];
-
- complex_t d_buff[2][MAX_SA_BAND];
- complex_t d2_buff[NUM_OF_LINKS][MAX_DELAY][MAX_SA_BAND];
-
- uint8_t delay_buf_index_ser[NUM_OF_LINKS];
-
- real_t prev_nrg[MAX_SA_BAND];
- real_t prev_peakdiff[MAX_SA_BAND];
- real_t peakdecay_fast[MAX_SA_BAND];
-} drm_ps_info;
-
-
-uint16_t drm_ps_data(drm_ps_info *ps, bitfile *ld);
-
-drm_ps_info *drm_ps_init(void);
-void drm_ps_free(drm_ps_info *ps);
-
-uint8_t drm_ps_decode(drm_ps_info *ps, uint8_t guess, uint32_t samplerate, qmf_t X_left[38][64], qmf_t X_right[38][64]);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
diff --git a/src/libfaad/error.c b/src/libfaad/error.c
deleted file mode 100644
index 2fbe08fc1..000000000
--- a/src/libfaad/error.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: error.c,v 1.8 2005/10/29 23:57:06 tmmm Exp $
-**/
-
-#include "common.h"
-#include "error.h"
-
-char *err_msg[] = {
- "No error",
- "Gain control not yet implemented",
- "Pulse coding not allowed in short blocks",
- "Invalid huffman codebook",
- "Scalefactor out of range",
- "Unable to find ADTS syncword",
- "Channel coupling not yet implemented",
- "Channel configuration not allowed in error resilient frame",
- "Bit error in error resilient scalefactor decoding",
- "Error decoding huffman scalefactor (bitstream error)",
- "Error decoding huffman codeword (bitstream error)",
- "Non existent huffman codebook number found",
- "Invalid number of channels",
- "Maximum number of bitstream elements exceeded",
- "Input data buffer too small",
- "Array index out of range",
- "Maximum number of scalefactor bands exceeded",
- "Quantised value out of range",
- "LTP lag out of range",
- "Invalid SBR parameter decoded",
- "SBR called without being initialised",
- "Unexpected channel configuration change",
- "Error in program_config_element",
- "First SBR frame is not the same as first AAC frame",
- "Unexpected fill element with SBR data",
- "Not all elements were provided with SBR data",
- "LTP decoding not available",
- "Output data buffer too small"
-};
-
diff --git a/src/libfaad/error.h b/src/libfaad/error.h
deleted file mode 100644
index 1009a9f57..000000000
--- a/src/libfaad/error.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: error.h,v 1.7 2005/10/29 23:57:06 tmmm Exp $
-**/
-
-#ifndef __ERROR_H__
-#define __ERROR_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define NUM_ERROR_MESSAGES 28
-extern char *err_msg[];
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/libfaad/faad.h b/src/libfaad/faad.h
deleted file mode 100644
index e46c31d87..000000000
--- a/src/libfaad/faad.h
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: faad.h,v 1.7 2004/12/03 01:15:30 tmattern Exp $
-**/
-
-#ifndef __AACDEC_H__
-#define __AACDEC_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#ifdef _WIN32
- #pragma pack(push, 8)
- #ifndef FAADAPI
- #define FAADAPI __cdecl
- #endif
-#else
- #ifndef FAADAPI
- #define FAADAPI
- #endif
-#endif
-
-#define FAAD2_VERSION "2.0 "
-
-/* object types for AAC */
-#define MAIN 1
-#define LC 2
-#define SSR 3
-#define LTP 4
-#define HE_AAC 5
-#define ER_LC 17
-#define ER_LTP 19
-#define LD 23
-#define DRM_ER_LC 27 /* special object type for DRM */
-
-/* header types */
-#define RAW 0
-#define ADIF 1
-#define ADTS 2
-
-/* SBR signalling */
-#define NO_SBR 0
-#define SBR_UPSAMPLED 1
-#define SBR_DOWNSAMPLED 2
-#define NO_SBR_UPSAMPLED 3
-
-/* library output formats */
-#define FAAD_FMT_16BIT 1
-#define FAAD_FMT_24BIT 2
-#define FAAD_FMT_32BIT 3
-#define FAAD_FMT_FLOAT 4
-#define FAAD_FMT_DOUBLE 5
-
-/* Capabilities */
-#define LC_DEC_CAP (1<<0) /* Can decode LC */
-#define MAIN_DEC_CAP (1<<1) /* Can decode MAIN */
-#define LTP_DEC_CAP (1<<2) /* Can decode LTP */
-#define LD_DEC_CAP (1<<3) /* Can decode LD */
-#define ERROR_RESILIENCE_CAP (1<<4) /* Can decode ER */
-#define FIXED_POINT_CAP (1<<5) /* Fixed point */
-
-/* Channel definitions */
-#define FRONT_CHANNEL_CENTER (1)
-#define FRONT_CHANNEL_LEFT (2)
-#define FRONT_CHANNEL_RIGHT (3)
-#define SIDE_CHANNEL_LEFT (4)
-#define SIDE_CHANNEL_RIGHT (5)
-#define BACK_CHANNEL_LEFT (6)
-#define BACK_CHANNEL_RIGHT (7)
-#define BACK_CHANNEL_CENTER (8)
-#define LFE_CHANNEL (9)
-#define UNKNOWN_CHANNEL (0)
-
-/* DRM channel definitions */
-#define DRMCH_MONO 1
-#define DRMCH_STEREO 2
-#define DRMCH_SBR_MONO 3
-#define DRMCH_SBR_LC_STEREO 4
-#define DRMCH_SBR_STEREO 5
-
-
-/* A decode call can eat up to FAAD_MIN_STREAMSIZE bytes per decoded channel,
- so at least so much bytes per channel should be available in this stream */
-#define FAAD_MIN_STREAMSIZE 768 /* 6144 bits/channel */
-
-
-typedef void *faacDecHandle;
-
-typedef struct mp4AudioSpecificConfig
-{
- /* Audio Specific Info */
- unsigned char objectTypeIndex;
- unsigned char samplingFrequencyIndex;
- unsigned long samplingFrequency;
- unsigned char channelsConfiguration;
-
- /* GA Specific Info */
- unsigned char frameLengthFlag;
- unsigned char dependsOnCoreCoder;
- unsigned short coreCoderDelay;
- unsigned char extensionFlag;
- unsigned char aacSectionDataResilienceFlag;
- unsigned char aacScalefactorDataResilienceFlag;
- unsigned char aacSpectralDataResilienceFlag;
- unsigned char epConfig;
-
- char sbr_present_flag;
- char forceUpSampling;
-} mp4AudioSpecificConfig;
-
-typedef struct faacDecConfiguration
-{
- unsigned char defObjectType;
- unsigned long defSampleRate;
- unsigned char outputFormat;
- unsigned char downMatrix;
- unsigned char useOldADTSFormat;
- unsigned char dontUpSampleImplicitSBR;
-} faacDecConfiguration, *faacDecConfigurationPtr;
-
-typedef struct faacDecFrameInfo
-{
- unsigned long bytesconsumed;
- unsigned long samples;
- unsigned char channels;
- unsigned char error;
- unsigned long samplerate;
-
- /* SBR: 0: off, 1: on; upsample, 2: on; downsampled, 3: off; upsampled */
- unsigned char sbr;
-
- /* MPEG-4 ObjectType */
- unsigned char object_type;
-
- /* AAC header type; MP4 will be signalled as RAW also */
- unsigned char header_type;
-
- /* multichannel configuration */
- unsigned char num_front_channels;
- unsigned char num_side_channels;
- unsigned char num_back_channels;
- unsigned char num_lfe_channels;
- unsigned char channel_position[64];
-} faacDecFrameInfo;
-
-char* FAADAPI faacDecGetErrorMessage(unsigned char errcode);
-
-unsigned long FAADAPI faacDecGetCapabilities(void);
-
-faacDecHandle FAADAPI faacDecOpen(void);
-
-faacDecConfigurationPtr FAADAPI faacDecGetCurrentConfiguration(faacDecHandle hDecoder);
-
-unsigned char FAADAPI faacDecSetConfiguration(faacDecHandle hDecoder,
- faacDecConfigurationPtr config);
-
-/* Init the library based on info from the AAC file (ADTS/ADIF) */
-long FAADAPI faacDecInit(faacDecHandle hDecoder,
- unsigned char *buffer,
- unsigned long buffer_size,
- unsigned long *samplerate,
- unsigned char *channels);
-
-/* Init the library using a DecoderSpecificInfo */
-char FAADAPI faacDecInit2(faacDecHandle hDecoder, unsigned char *pBuffer,
- unsigned long SizeOfDecoderSpecificInfo,
- unsigned long *samplerate, unsigned char *channels);
-
-/* Init the library for DRM */
-char FAADAPI faacDecInitDRM(faacDecHandle hDecoder, unsigned long samplerate,
- unsigned char channels);
-
-void FAADAPI faacDecPostSeekReset(faacDecHandle hDecoder, long frame);
-
-void FAADAPI faacDecClose(faacDecHandle hDecoder);
-
-void* FAADAPI faacDecDecode(faacDecHandle hDecoder,
- faacDecFrameInfo *hInfo,
- unsigned char *buffer,
- unsigned long buffer_size);
-
-char FAADAPI AudioSpecificConfig(unsigned char *pBuffer,
- unsigned long buffer_size,
- mp4AudioSpecificConfig *mp4ASC);
-
-#ifdef _WIN32
- #pragma pack(pop)
-#endif
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif
diff --git a/src/libfaad/filtbank.c b/src/libfaad/filtbank.c
deleted file mode 100644
index 2919b5be3..000000000
--- a/src/libfaad/filtbank.c
+++ /dev/null
@@ -1,404 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: filtbank.c,v 1.10 2005/10/29 23:57:06 tmmm Exp $
-**/
-
-#include "common.h"
-#include "structs.h"
-
-#include <stdlib.h>
-#include <string.h>
-#ifdef _WIN32_WCE
-#define assert(x)
-#else
-#include <assert.h>
-#endif
-
-#include "filtbank.h"
-#include "decoder.h"
-#include "syntax.h"
-#include "kbd_win.h"
-#include "sine_win.h"
-#include "mdct.h"
-
-
-fb_info *filter_bank_init(uint16_t frame_len)
-{
- uint16_t nshort = frame_len/8;
-#ifdef LD_DEC
- uint16_t frame_len_ld = frame_len/2;
-#endif
-
- fb_info *fb = (fb_info*)faad_malloc(sizeof(fb_info));
- memset(fb, 0, sizeof(fb_info));
-
- /* normal */
- fb->mdct256 = faad_mdct_init(2*nshort);
- fb->mdct2048 = faad_mdct_init(2*frame_len);
-#ifdef LD_DEC
- /* LD */
- fb->mdct1024 = faad_mdct_init(2*frame_len_ld);
-#endif
-
-#ifdef ALLOW_SMALL_FRAMELENGTH
- if (frame_len == 1024)
- {
-#endif
- fb->long_window[0] = sine_long_1024;
- fb->short_window[0] = sine_short_128;
- fb->long_window[1] = kbd_long_1024;
- fb->short_window[1] = kbd_short_128;
-#ifdef LD_DEC
- fb->ld_window[0] = sine_mid_512;
- fb->ld_window[1] = ld_mid_512;
-#endif
-#ifdef ALLOW_SMALL_FRAMELENGTH
- } else /* (frame_len == 960) */ {
- fb->long_window[0] = sine_long_960;
- fb->short_window[0] = sine_short_120;
- fb->long_window[1] = kbd_long_960;
- fb->short_window[1] = kbd_short_120;
-#ifdef LD_DEC
- fb->ld_window[0] = sine_mid_480;
- fb->ld_window[1] = ld_mid_480;
-#endif
- }
-#endif
-
- return fb;
-}
-
-void filter_bank_end(fb_info *fb)
-{
- if (fb != NULL)
- {
-#ifdef PROFILE
- printf("FB: %I64d cycles\n", fb->cycles);
-#endif
-
- faad_mdct_end(fb->mdct256);
- faad_mdct_end(fb->mdct2048);
-#ifdef LD_DEC
- faad_mdct_end(fb->mdct1024);
-#endif
-
- faad_free(fb);
- }
-}
-
-static INLINE void imdct_long(fb_info *fb, real_t *in_data, real_t *out_data, uint16_t len)
-{
-#ifdef LD_DEC
- mdct_info *mdct = NULL;
-
- switch (len)
- {
- case 2048:
- case 1920:
- mdct = fb->mdct2048;
- break;
- case 1024:
- case 960:
- mdct = fb->mdct1024;
- break;
- }
-
- faad_imdct(mdct, in_data, out_data);
-#else
- faad_imdct(fb->mdct2048, in_data, out_data);
-#endif
-}
-
-
-#ifdef LTP_DEC
-static INLINE void mdct(fb_info *fb, real_t *in_data, real_t *out_data, uint16_t len)
-{
- mdct_info *mdct = NULL;
-
- switch (len)
- {
- case 2048:
- case 1920:
- mdct = fb->mdct2048;
- break;
- case 256:
- case 240:
- mdct = fb->mdct256;
- break;
-#ifdef LD_DEC
- case 1024:
- case 960:
- mdct = fb->mdct1024;
- break;
-#endif
- }
-
- faad_mdct(mdct, in_data, out_data);
-}
-#endif
-
-void ifilter_bank(fb_info *fb, uint8_t window_sequence, uint8_t window_shape,
- uint8_t window_shape_prev, real_t *freq_in,
- real_t *time_out, real_t *overlap,
- uint8_t object_type, uint16_t frame_len)
-{
- int16_t i;
- ALIGN real_t transf_buf[2*1024] = {0};
-
- const real_t *window_long = NULL;
- const real_t *window_long_prev = NULL;
- const real_t *window_short = NULL;
- const real_t *window_short_prev = NULL;
-
- uint16_t nlong = frame_len;
- uint16_t nshort = frame_len/8;
- uint16_t trans = nshort/2;
-
- uint16_t nflat_ls = (nlong-nshort)/2;
-
-#ifdef PROFILE
- int64_t count = faad_get_ts();
-#endif
-
- /* select windows of current frame and previous frame (Sine or KBD) */
-#ifdef LD_DEC
- if (object_type == LD)
- {
- window_long = fb->ld_window[window_shape];
- window_long_prev = fb->ld_window[window_shape_prev];
- } else {
-#endif
- window_long = fb->long_window[window_shape];
- window_long_prev = fb->long_window[window_shape_prev];
- window_short = fb->short_window[window_shape];
- window_short_prev = fb->short_window[window_shape_prev];
-#ifdef LD_DEC
- }
-#endif
-
-#if 0
- for (i = 0; i < 1024; i++)
- {
- printf("%d\n", freq_in[i]);
- }
-#endif
-
-#if 0
- printf("%d %d\n", window_sequence, window_shape);
-#endif
-
- switch (window_sequence)
- {
- case ONLY_LONG_SEQUENCE:
- /* perform iMDCT */
- imdct_long(fb, freq_in, transf_buf, 2*nlong);
-
- /* add second half output of previous frame to windowed output of current frame */
- for (i = 0; i < nlong; i+=4)
- {
- time_out[i] = overlap[i] + MUL_F(transf_buf[i],window_long_prev[i]);
- time_out[i+1] = overlap[i+1] + MUL_F(transf_buf[i+1],window_long_prev[i+1]);
- time_out[i+2] = overlap[i+2] + MUL_F(transf_buf[i+2],window_long_prev[i+2]);
- time_out[i+3] = overlap[i+3] + MUL_F(transf_buf[i+3],window_long_prev[i+3]);
- }
-
- /* window the second half and save as overlap for next frame */
- for (i = 0; i < nlong; i+=4)
- {
- overlap[i] = MUL_F(transf_buf[nlong+i],window_long[nlong-1-i]);
- overlap[i+1] = MUL_F(transf_buf[nlong+i+1],window_long[nlong-2-i]);
- overlap[i+2] = MUL_F(transf_buf[nlong+i+2],window_long[nlong-3-i]);
- overlap[i+3] = MUL_F(transf_buf[nlong+i+3],window_long[nlong-4-i]);
- }
- break;
-
- case LONG_START_SEQUENCE:
- /* perform iMDCT */
- imdct_long(fb, freq_in, transf_buf, 2*nlong);
-
- /* add second half output of previous frame to windowed output of current frame */
- for (i = 0; i < nlong; i+=4)
- {
- time_out[i] = overlap[i] + MUL_F(transf_buf[i],window_long_prev[i]);
- time_out[i+1] = overlap[i+1] + MUL_F(transf_buf[i+1],window_long_prev[i+1]);
- time_out[i+2] = overlap[i+2] + MUL_F(transf_buf[i+2],window_long_prev[i+2]);
- time_out[i+3] = overlap[i+3] + MUL_F(transf_buf[i+3],window_long_prev[i+3]);
- }
-
- /* window the second half and save as overlap for next frame */
- /* construct second half window using padding with 1's and 0's */
- for (i = 0; i < nflat_ls; i++)
- overlap[i] = transf_buf[nlong+i];
- for (i = 0; i < nshort; i++)
- overlap[nflat_ls+i] = MUL_F(transf_buf[nlong+nflat_ls+i],window_short[nshort-i-1]);
- for (i = 0; i < nflat_ls; i++)
- overlap[nflat_ls+nshort+i] = 0;
- break;
-
- case EIGHT_SHORT_SEQUENCE:
- /* perform iMDCT for each short block */
- faad_imdct(fb->mdct256, freq_in+0*nshort, transf_buf+2*nshort*0);
- faad_imdct(fb->mdct256, freq_in+1*nshort, transf_buf+2*nshort*1);
- faad_imdct(fb->mdct256, freq_in+2*nshort, transf_buf+2*nshort*2);
- faad_imdct(fb->mdct256, freq_in+3*nshort, transf_buf+2*nshort*3);
- faad_imdct(fb->mdct256, freq_in+4*nshort, transf_buf+2*nshort*4);
- faad_imdct(fb->mdct256, freq_in+5*nshort, transf_buf+2*nshort*5);
- faad_imdct(fb->mdct256, freq_in+6*nshort, transf_buf+2*nshort*6);
- faad_imdct(fb->mdct256, freq_in+7*nshort, transf_buf+2*nshort*7);
-
- /* add second half output of previous frame to windowed output of current frame */
- for (i = 0; i < nflat_ls; i++)
- time_out[i] = overlap[i];
- for(i = 0; i < nshort; i++)
- {
- time_out[nflat_ls+ i] = overlap[nflat_ls+ i] + MUL_F(transf_buf[nshort*0+i],window_short_prev[i]);
- time_out[nflat_ls+1*nshort+i] = overlap[nflat_ls+nshort*1+i] + MUL_F(transf_buf[nshort*1+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*2+i],window_short[i]);
- time_out[nflat_ls+2*nshort+i] = overlap[nflat_ls+nshort*2+i] + MUL_F(transf_buf[nshort*3+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*4+i],window_short[i]);
- time_out[nflat_ls+3*nshort+i] = overlap[nflat_ls+nshort*3+i] + MUL_F(transf_buf[nshort*5+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*6+i],window_short[i]);
- if (i < trans)
- time_out[nflat_ls+4*nshort+i] = overlap[nflat_ls+nshort*4+i] + MUL_F(transf_buf[nshort*7+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*8+i],window_short[i]);
- }
-
- /* window the second half and save as overlap for next frame */
- for(i = 0; i < nshort; i++)
- {
- if (i >= trans)
- overlap[nflat_ls+4*nshort+i-nlong] = MUL_F(transf_buf[nshort*7+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*8+i],window_short[i]);
- overlap[nflat_ls+5*nshort+i-nlong] = MUL_F(transf_buf[nshort*9+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*10+i],window_short[i]);
- overlap[nflat_ls+6*nshort+i-nlong] = MUL_F(transf_buf[nshort*11+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*12+i],window_short[i]);
- overlap[nflat_ls+7*nshort+i-nlong] = MUL_F(transf_buf[nshort*13+i],window_short[nshort-1-i]) + MUL_F(transf_buf[nshort*14+i],window_short[i]);
- overlap[nflat_ls+8*nshort+i-nlong] = MUL_F(transf_buf[nshort*15+i],window_short[nshort-1-i]);
- }
- for (i = 0; i < nflat_ls; i++)
- overlap[nflat_ls+nshort+i] = 0;
- break;
-
- case LONG_STOP_SEQUENCE:
- /* perform iMDCT */
- imdct_long(fb, freq_in, transf_buf, 2*nlong);
-
- /* add second half output of previous frame to windowed output of current frame */
- /* construct first half window using padding with 1's and 0's */
- for (i = 0; i < nflat_ls; i++)
- time_out[i] = overlap[i];
- for (i = 0; i < nshort; i++)
- time_out[nflat_ls+i] = overlap[nflat_ls+i] + MUL_F(transf_buf[nflat_ls+i],window_short_prev[i]);
- for (i = 0; i < nflat_ls; i++)
- time_out[nflat_ls+nshort+i] = overlap[nflat_ls+nshort+i] + transf_buf[nflat_ls+nshort+i];
-
- /* window the second half and save as overlap for next frame */
- for (i = 0; i < nlong; i++)
- overlap[i] = MUL_F(transf_buf[nlong+i],window_long[nlong-1-i]);
- break;
- }
-
-#if 0
- for (i = 0; i < 1024; i++)
- {
- printf("%d\n", time_out[i]);
- //printf("0x%.8X\n", time_out[i]);
- }
-#endif
-
-
-#ifdef PROFILE
- count = faad_get_ts() - count;
- fb->cycles += count;
-#endif
-}
-
-
-#ifdef LTP_DEC
-/* only works for LTP -> no overlapping, no short blocks */
-void filter_bank_ltp(fb_info *fb, uint8_t window_sequence, uint8_t window_shape,
- uint8_t window_shape_prev, real_t *in_data, real_t *out_mdct,
- uint8_t object_type, uint16_t frame_len)
-{
- int16_t i;
- ALIGN real_t windowed_buf[2*1024] = {0};
-
- const real_t *window_long = NULL;
- const real_t *window_long_prev = NULL;
- const real_t *window_short = NULL;
- const real_t *window_short_prev = NULL;
-
- uint16_t nlong = frame_len;
- uint16_t nshort = frame_len/8;
- uint16_t nflat_ls = (nlong-nshort)/2;
-
- assert(window_sequence != EIGHT_SHORT_SEQUENCE);
-
-#ifdef LD_DEC
- if (object_type == LD)
- {
- window_long = fb->ld_window[window_shape];
- window_long_prev = fb->ld_window[window_shape_prev];
- } else {
-#endif
- window_long = fb->long_window[window_shape];
- window_long_prev = fb->long_window[window_shape_prev];
- window_short = fb->short_window[window_shape];
- window_short_prev = fb->short_window[window_shape_prev];
-#ifdef LD_DEC
- }
-#endif
-
- switch(window_sequence)
- {
- case ONLY_LONG_SEQUENCE:
- for (i = nlong-1; i >= 0; i--)
- {
- windowed_buf[i] = MUL_F(in_data[i], window_long_prev[i]);
- windowed_buf[i+nlong] = MUL_F(in_data[i+nlong], window_long[nlong-1-i]);
- }
- mdct(fb, windowed_buf, out_mdct, 2*nlong);
- break;
-
- case LONG_START_SEQUENCE:
- for (i = 0; i < nlong; i++)
- windowed_buf[i] = MUL_F(in_data[i], window_long_prev[i]);
- for (i = 0; i < nflat_ls; i++)
- windowed_buf[i+nlong] = in_data[i+nlong];
- for (i = 0; i < nshort; i++)
- windowed_buf[i+nlong+nflat_ls] = MUL_F(in_data[i+nlong+nflat_ls], window_short[nshort-1-i]);
- for (i = 0; i < nflat_ls; i++)
- windowed_buf[i+nlong+nflat_ls+nshort] = 0;
- mdct(fb, windowed_buf, out_mdct, 2*nlong);
- break;
-
- case LONG_STOP_SEQUENCE:
- for (i = 0; i < nflat_ls; i++)
- windowed_buf[i] = 0;
- for (i = 0; i < nshort; i++)
- windowed_buf[i+nflat_ls] = MUL_F(in_data[i+nflat_ls], window_short_prev[i]);
- for (i = 0; i < nflat_ls; i++)
- windowed_buf[i+nflat_ls+nshort] = in_data[i+nflat_ls+nshort];
- for (i = 0; i < nlong; i++)
- windowed_buf[i+nlong] = MUL_F(in_data[i+nlong], window_long[nlong-1-i]);
- mdct(fb, windowed_buf, out_mdct, 2*nlong);
- break;
- }
-}
-#endif
diff --git a/src/libfaad/filtbank.h b/src/libfaad/filtbank.h
deleted file mode 100644
index 54c72c0ef..000000000
--- a/src/libfaad/filtbank.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: filtbank.h,v 1.7 2005/10/29 23:57:06 tmmm Exp $
-**/
-
-#ifndef __FILTBANK_H__
-#define __FILTBANK_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-fb_info *filter_bank_init(uint16_t frame_len);
-void filter_bank_end(fb_info *fb);
-
-#ifdef LTP_DEC
-void filter_bank_ltp(fb_info *fb,
- uint8_t window_sequence,
- uint8_t window_shape,
- uint8_t window_shape_prev,
- real_t *in_data,
- real_t *out_mdct,
- uint8_t object_type,
- uint16_t frame_len);
-#endif
-
-void ifilter_bank(fb_info *fb, uint8_t window_sequence, uint8_t window_shape,
- uint8_t window_shape_prev, real_t *freq_in,
- real_t *time_out, real_t *overlap,
- uint8_t object_type, uint16_t frame_len);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/libfaad/fixed.h b/src/libfaad/fixed.h
deleted file mode 100644
index c58ee26cb..000000000
--- a/src/libfaad/fixed.h
+++ /dev/null
@@ -1,265 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: fixed.h,v 1.7 2005/10/29 23:57:06 tmmm Exp $
-**/
-
-#ifndef __FIXED_H__
-#define __FIXED_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if defined(_WIN32_WCE) && defined(_ARM_)
-#include <cmnintrin.h>
-#endif
-
-#define COEF_BITS 28
-#define COEF_PRECISION (1 << COEF_BITS)
-#define REAL_BITS 14 // MAXIMUM OF 14 FOR FIXED POINT SBR
-#define REAL_PRECISION (1 << REAL_BITS)
-
-/* FRAC is the fractional only part of the fixed point number [0.0..1.0) */
-#define FRAC_SIZE 32 /* frac is a 32 bit integer */
-#define FRAC_BITS 31
-#define FRAC_PRECISION ((uint32_t)(1 << FRAC_BITS))
-#define FRAC_MAX 0x7FFFFFFF
-
-typedef int32_t real_t;
-
-
-#define REAL_CONST(A) (((A) >= 0) ? ((real_t)((A)*(REAL_PRECISION)+0.5)) : ((real_t)((A)*(REAL_PRECISION)-0.5)))
-#define COEF_CONST(A) (((A) >= 0) ? ((real_t)((A)*(COEF_PRECISION)+0.5)) : ((real_t)((A)*(COEF_PRECISION)-0.5)))
-#define FRAC_CONST(A) (((A) == 1.00) ? ((real_t)FRAC_MAX) : (((A) >= 0) ? ((real_t)((A)*(FRAC_PRECISION)+0.5)) : ((real_t)((A)*(FRAC_PRECISION)-0.5))))
-//#define FRAC_CONST(A) (((A) >= 0) ? ((real_t)((A)*(FRAC_PRECISION)+0.5)) : ((real_t)((A)*(FRAC_PRECISION)-0.5)))
-
-#define Q2_BITS 22
-#define Q2_PRECISION (1 << Q2_BITS)
-#define Q2_CONST(A) (((A) >= 0) ? ((real_t)((A)*(Q2_PRECISION)+0.5)) : ((real_t)((A)*(Q2_PRECISION)-0.5)))
-
-#if defined(_WIN32) && !defined(_WIN32_WCE)
-
-/* multiply with real shift */
-static INLINE real_t MUL_R(real_t A, real_t B)
-{
- _asm {
- mov eax,A
- imul B
- shrd eax,edx,REAL_BITS
- }
-}
-
-/* multiply with coef shift */
-static INLINE real_t MUL_C(real_t A, real_t B)
-{
- _asm {
- mov eax,A
- imul B
- shrd eax,edx,COEF_BITS
- }
-}
-
-static INLINE real_t MUL_Q2(real_t A, real_t B)
-{
- _asm {
- mov eax,A
- imul B
- shrd eax,edx,Q2_BITS
- }
-}
-
-static INLINE real_t MUL_SHIFT6(real_t A, real_t B)
-{
- _asm {
- mov eax,A
- imul B
- shrd eax,edx,6
- }
-}
-
-static INLINE real_t MUL_SHIFT23(real_t A, real_t B)
-{
- _asm {
- mov eax,A
- imul B
- shrd eax,edx,23
- }
-}
-
-#if 1
-static INLINE real_t _MulHigh(real_t A, real_t B)
-{
- _asm {
- mov eax,A
- imul B
- mov eax,edx
- }
-}
-
-/* multiply with fractional shift */
-static INLINE real_t MUL_F(real_t A, real_t B)
-{
- return _MulHigh(A,B) << (FRAC_SIZE-FRAC_BITS);
-}
-
-/* Complex multiplication */
-static INLINE void ComplexMult(real_t *y1, real_t *y2,
- real_t x1, real_t x2, real_t c1, real_t c2)
-{
- *y1 = (_MulHigh(x1, c1) + _MulHigh(x2, c2))<<(FRAC_SIZE-FRAC_BITS);
- *y2 = (_MulHigh(x2, c1) - _MulHigh(x1, c2))<<(FRAC_SIZE-FRAC_BITS);
-}
-#else
-static INLINE real_t MUL_F(real_t A, real_t B)
-{
- _asm {
- mov eax,A
- imul B
- shrd eax,edx,FRAC_BITS
- }
-}
-
-/* Complex multiplication */
-static INLINE void ComplexMult(real_t *y1, real_t *y2,
- real_t x1, real_t x2, real_t c1, real_t c2)
-{
- *y1 = MUL_F(x1, c1) + MUL_F(x2, c2);
- *y2 = MUL_F(x2, c1) - MUL_F(x1, c2);
-}
-#endif
-
-#elif defined(__GNUC__) && defined (__arm__)
-
-/* taken from MAD */
-#define arm_mul(x, y, SCALEBITS) \
-({ \
- uint32_t __hi; \
- uint32_t __lo; \
- uint32_t __result; \
- asm("smull %0, %1, %3, %4\n\t" \
- "movs %0, %0, lsr %5\n\t" \
- "adc %2, %0, %1, lsl %6" \
- : "=&r" (__lo), "=&r" (__hi), "=r" (__result) \
- : "%r" (x), "r" (y), \
- "M" (SCALEBITS), "M" (32 - (SCALEBITS)) \
- : "cc"); \
- __result; \
-})
-
-static INLINE real_t MUL_R(real_t A, real_t B)
-{
- return arm_mul(A, B, REAL_BITS);
-}
-
-static INLINE real_t MUL_C(real_t A, real_t B)
-{
- return arm_mul(A, B, COEF_BITS);
-}
-
-static INLINE real_t MUL_Q2(real_t A, real_t B)
-{
- return arm_mul(A, B, Q2_BITS);
-}
-
-static INLINE real_t MUL_SHIFT6(real_t A, real_t B)
-{
- return arm_mul(A, B, 6);
-}
-
-static INLINE real_t MUL_SHIFT23(real_t A, real_t B)
-{
- return arm_mul(A, B, 23);
-}
-
-static INLINE real_t _MulHigh(real_t x, real_t y)
-{
- uint32_t __lo;
- uint32_t __hi;
- asm("smull\t%0, %1, %2, %3"
- : "=&r"(__lo),"=&r"(__hi)
- : "%r"(x),"r"(y)
- : "cc");
- return __hi;
-}
-
-static INLINE real_t MUL_F(real_t A, real_t B)
-{
- return _MulHigh(A, B) << (FRAC_SIZE-FRAC_BITS);
-}
-
-/* Complex multiplication */
-static INLINE void ComplexMult(real_t *y1, real_t *y2,
- real_t x1, real_t x2, real_t c1, real_t c2)
-{
- int32_t tmp, yt1, yt2;
- asm("smull %0, %1, %4, %6\n\t"
- "smlal %0, %1, %5, %7\n\t"
- "rsb %3, %4, #0\n\t"
- "smull %0, %2, %5, %6\n\t"
- "smlal %0, %2, %3, %7"
- : "=&r" (tmp), "=&r" (yt1), "=&r" (yt2), "=r" (x1)
- : "3" (x1), "r" (x2), "r" (c1), "r" (c2)
- : "cc" );
- *y1 = yt1 << (FRAC_SIZE-FRAC_BITS);
- *y2 = yt2 << (FRAC_SIZE-FRAC_BITS);
-}
-
-#else
-
- /* multiply with real shift */
- #define MUL_R(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (REAL_BITS-1))) >> REAL_BITS)
- /* multiply with coef shift */
- #define MUL_C(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (COEF_BITS-1))) >> COEF_BITS)
- /* multiply with fractional shift */
-#if defined(_WIN32_WCE) && defined(_ARM_)
- /* eVC for PocketPC has an intrinsic function that returns only the high 32 bits of a 32x32 bit multiply */
- static INLINE real_t MUL_F(real_t A, real_t B)
- {
- return _MulHigh(A,B) << (32-FRAC_BITS);
- }
-#else
- #define _MulHigh(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (FRAC_SIZE-1))) >> FRAC_SIZE)
- #define MUL_F(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (FRAC_BITS-1))) >> FRAC_BITS)
-#endif
- #define MUL_Q2(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (Q2_BITS-1))) >> Q2_BITS)
- #define MUL_SHIFT6(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (6-1))) >> 6)
- #define MUL_SHIFT23(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (23-1))) >> 23)
-
-/* Complex multiplication */
-static INLINE void ComplexMult(real_t *y1, real_t *y2,
- real_t x1, real_t x2, real_t c1, real_t c2)
-{
- *y1 = (_MulHigh(x1, c1) + _MulHigh(x2, c2))<<(FRAC_SIZE-FRAC_BITS);
- *y2 = (_MulHigh(x2, c1) - _MulHigh(x1, c2))<<(FRAC_SIZE-FRAC_BITS);
-}
-
-#endif
-
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/libfaad/hcr.c b/src/libfaad/hcr.c
deleted file mode 100644
index 94f08fd2a..000000000
--- a/src/libfaad/hcr.c
+++ /dev/null
@@ -1,409 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2004 G.C. Pascutto, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: hcr.c,v 1.7 2005/10/29 23:57:06 tmmm Exp $
-**/
-
-#include "common.h"
-#include "structs.h"
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "specrec.h"
-#include "huffman.h"
-
-/* ISO/IEC 14496-3/Amd.1
- * 8.5.3.3: Huffman Codeword Reordering for AAC spectral data (HCR)
- *
- * HCR devides the spectral data in known fixed size segments, and
- * sorts it by the importance of the data. The importance is firstly
- * the (lower) position in the spectrum, and secondly the largest
- * value in the used codebook.
- * The most important data is written at the start of each segment
- * (at known positions), the remaining data is interleaved inbetween,
- * with the writing direction alternating.
- * Data length is not increased.
-*/
-
-#ifdef ERROR_RESILIENCE
-
-/* 8.5.3.3.1 Pre-sorting */
-
-#define NUM_CB 6
-#define NUM_CB_ER 22
-#define MAX_CB 32
-#define VCB11_FIRST 16
-#define VCB11_LAST 31
-
-static const uint8_t PreSortCB_STD[NUM_CB] =
- { 11, 9, 7, 5, 3, 1};
-
-static const uint8_t PreSortCB_ER[NUM_CB_ER] =
- { 11, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 9, 7, 5, 3, 1};
-
-/* 8.5.3.3.2 Derivation of segment width */
-
-static const uint8_t maxCwLen[MAX_CB] = {0, 11, 9, 20, 16, 13, 11, 14, 12, 17, 14, 49,
- 0, 0, 0, 0, 14, 17, 21, 21, 25, 25, 29, 29, 29, 29, 33, 33, 33, 37, 37, 41};
-
-#define segmentWidth(cb) min(maxCwLen[cb], ics->length_of_longest_codeword)
-
-/* bit-twiddling helpers */
-static const uint8_t S[] = {1, 2, 4, 8, 16};
-static const uint32_t B[] = {0x55555555, 0x33333333, 0x0F0F0F0F, 0x00FF00FF, 0x0000FFFF};
-
-typedef struct
-{
- uint8_t cb;
- uint8_t decoded;
- uint16_t sp_offset;
- bits_t bits;
-} codeword_t;
-
-/* rewind and reverse */
-/* 32 bit version */
-static uint32_t rewrev_word(uint32_t v, const uint8_t len)
-{
- /* 32 bit reverse */
- v = ((v >> S[0]) & B[0]) | ((v << S[0]) & ~B[0]);
- v = ((v >> S[1]) & B[1]) | ((v << S[1]) & ~B[1]);
- v = ((v >> S[2]) & B[2]) | ((v << S[2]) & ~B[2]);
- v = ((v >> S[3]) & B[3]) | ((v << S[3]) & ~B[3]);
- v = ((v >> S[4]) & B[4]) | ((v << S[4]) & ~B[4]);
-
- /* shift off low bits */
- v >>= (32 - len);
-
- return v;
-}
-
-/* 64 bit version */
-static void rewrev_lword(uint32_t *hi, uint32_t *lo, const uint8_t len)
-{
- if (len <= 32) {
- *hi = 0;
- *lo = rewrev_word(*lo, len);
- } else
- {
- uint32_t t = *hi, v = *lo;
-
- /* double 32 bit reverse */
- v = ((v >> S[0]) & B[0]) | ((v << S[0]) & ~B[0]);
- t = ((t >> S[0]) & B[0]) | ((t << S[0]) & ~B[0]);
- v = ((v >> S[1]) & B[1]) | ((v << S[1]) & ~B[1]);
- t = ((t >> S[1]) & B[1]) | ((t << S[1]) & ~B[1]);
- v = ((v >> S[2]) & B[2]) | ((v << S[2]) & ~B[2]);
- t = ((t >> S[2]) & B[2]) | ((t << S[2]) & ~B[2]);
- v = ((v >> S[3]) & B[3]) | ((v << S[3]) & ~B[3]);
- t = ((t >> S[3]) & B[3]) | ((t << S[3]) & ~B[3]);
- v = ((v >> S[4]) & B[4]) | ((v << S[4]) & ~B[4]);
- t = ((t >> S[4]) & B[4]) | ((t << S[4]) & ~B[4]);
-
- /* last 32<>32 bit swap is implicit below */
-
- /* shift off low bits (this is really only one 64 bit shift) */
- *lo = (t >> (64 - len)) | (v << (len - 32));
- *hi = v >> (64 - len);
- }
-}
-
-
-/* bits_t version */
-static void rewrev_bits(bits_t *bits)
-{
- if (bits->len == 0) return;
- rewrev_lword(&bits->bufb, &bits->bufa, bits->len);
-}
-
-
-/* merge bits of a to b */
-static void concat_bits(bits_t *b, bits_t *a)
-{
- uint32_t bl, bh, al, ah;
-
- if (a->len == 0) return;
-
- al = a->bufa;
- ah = a->bufb;
-
- if (b->len > 32)
- {
- /* maskoff superfluous high b bits */
- bl = b->bufa;
- bh = b->bufb & ((1 << (b->len-32)) - 1);
- /* left shift a b->len bits */
- ah = al << (b->len - 32);
- al = 0;
- } else {
- bl = b->bufa & ((1 << (b->len)) - 1);
- bh = 0;
- ah = (ah << (b->len)) | (al >> (32 - b->len));
- al = al << b->len;
- }
-
- /* merge */
- b->bufa = bl | al;
- b->bufb = bh | ah;
-
- b->len += a->len;
-}
-
-uint8_t is_good_cb(uint8_t this_CB, uint8_t this_sec_CB)
-{
- /* only want spectral data CB's */
- if ((this_sec_CB > ZERO_HCB && this_sec_CB <= ESC_HCB) || (this_sec_CB >= VCB11_FIRST && this_sec_CB <= VCB11_LAST))
- {
- if (this_CB < ESC_HCB)
- {
- /* normal codebook pairs */
- return ((this_sec_CB == this_CB) || (this_sec_CB == this_CB + 1));
- } else
- {
- /* escape codebook */
- return (this_sec_CB == this_CB);
- }
- }
- return 0;
-}
-
-void read_segment(bits_t *segment, uint8_t segwidth, bitfile *ld)
-{
- segment->len = segwidth;
-
- if (segwidth > 32)
- {
- segment->bufb = faad_getbits(ld, segwidth - 32);
- segment->bufa = faad_getbits(ld, 32);
-
- } else {
- segment->bufa = faad_getbits(ld, segwidth);
- segment->bufb = 0;
- }
-}
-
-void fill_in_codeword(codeword_t *codeword, uint16_t index, uint16_t sp, uint8_t cb)
-{
- codeword[index].sp_offset = sp;
- codeword[index].cb = cb;
- codeword[index].decoded = 0;
- codeword[index].bits.len = 0;
-}
-
-uint8_t reordered_spectral_data(NeAACDecHandle hDecoder, ic_stream *ics,
- bitfile *ld, int16_t *spectral_data)
-{
- uint16_t PCWs_done;
- uint16_t numberOfSegments, numberOfSets, numberOfCodewords;
-
- codeword_t codeword[512];
- bits_t segment[512];
-
- uint16_t sp_offset[8];
- uint16_t g, i, sortloop, set, bitsread;
- uint8_t w_idx, sfb, this_CB, last_CB, this_sec_CB;
-
- const uint16_t nshort = hDecoder->frameLength/8;
- const uint16_t sp_data_len = ics->length_of_reordered_spectral_data;
-
- const uint8_t *PreSortCb;
-
- /* no data (e.g. silence) */
- if (sp_data_len == 0)
- return 0;
-
- /* since there is spectral data, at least one codeword has nonzero length */
- if (ics->length_of_longest_codeword == 0)
- return 10;
-
- if (sp_data_len < ics->length_of_longest_codeword)
- return 10;
-
- sp_offset[0] = 0;
- for (g = 1; g < ics->num_window_groups; g++)
- {
- sp_offset[g] = sp_offset[g-1] + nshort*ics->window_group_length[g-1];
- }
-
- PCWs_done = 0;
- numberOfSegments = 0;
- numberOfCodewords = 0;
- bitsread = 0;
-
- /* VCB11 code books in use */
- if (hDecoder->aacSectionDataResilienceFlag)
- {
- PreSortCb = PreSortCB_ER;
- last_CB = NUM_CB_ER;
- } else
- {
- PreSortCb = PreSortCB_STD;
- last_CB = NUM_CB;
- }
-
- /* step 1: decode PCW's (set 0), and stuff data in easier-to-use format */
- for (sortloop = 0; sortloop < last_CB; sortloop++)
- {
- /* select codebook to process this pass */
- this_CB = PreSortCb[sortloop];
-
- /* loop over sfbs */
- for (sfb = 0; sfb < ics->max_sfb; sfb++)
- {
- /* loop over all in this sfb, 4 lines per loop */
- for (w_idx = 0; 4*w_idx < (ics->swb_offset[sfb+1] - ics->swb_offset[sfb]); w_idx++)
- {
- for(g = 0; g < ics->num_window_groups; g++)
- {
- for (i = 0; i < ics->num_sec[g]; i++)
- {
- /* check whether sfb used here is the one we want to process */
- if ((ics->sect_start[g][i] <= sfb) && (ics->sect_end[g][i] > sfb))
- {
- /* check whether codebook used here is the one we want to process */
- this_sec_CB = ics->sect_cb[g][i];
-
- if (is_good_cb(this_CB, this_sec_CB))
- {
- /* precalculate some stuff */
- uint16_t sect_sfb_size = ics->sect_sfb_offset[g][sfb+1] - ics->sect_sfb_offset[g][sfb];
- uint8_t inc = (this_sec_CB < FIRST_PAIR_HCB) ? QUAD_LEN : PAIR_LEN;
- uint16_t group_cws_count = (4*ics->window_group_length[g])/inc;
- uint8_t segwidth = segmentWidth(this_sec_CB);
- uint16_t cws;
-
- /* read codewords until end of sfb or end of window group (shouldn't only 1 trigger?) */
- for (cws = 0; (cws < group_cws_count) && ((cws + w_idx*group_cws_count) < sect_sfb_size); cws++)
- {
- uint16_t sp = sp_offset[g] + ics->sect_sfb_offset[g][sfb] + inc * (cws + w_idx*group_cws_count);
-
- /* read and decode PCW */
- if (!PCWs_done)
- {
- /* read in normal segments */
- if (bitsread + segwidth <= sp_data_len)
- {
- read_segment(&segment[numberOfSegments], segwidth, ld);
- bitsread += segwidth;
-
- huffman_spectral_data_2(this_sec_CB, &segment[numberOfSegments], &spectral_data[sp]);
-
- /* keep leftover bits */
- rewrev_bits(&segment[numberOfSegments]);
-
- numberOfSegments++;
- } else {
- /* remaining stuff after last segment, we unfortunately couldn't read
- this in earlier because it might not fit in 64 bits. since we already
- decoded (and removed) the PCW it is now guaranteed to fit */
- if (bitsread < sp_data_len)
- {
- const uint8_t additional_bits = sp_data_len - bitsread;
-
- read_segment(&segment[numberOfSegments], additional_bits, ld);
- segment[numberOfSegments].len += segment[numberOfSegments-1].len;
- rewrev_bits(&segment[numberOfSegments]);
-
- if (segment[numberOfSegments-1].len > 32)
- {
- segment[numberOfSegments-1].bufb = segment[numberOfSegments].bufb +
- showbits_hcr(&segment[numberOfSegments-1], segment[numberOfSegments-1].len - 32);
- segment[numberOfSegments-1].bufa = segment[numberOfSegments].bufa +
- showbits_hcr(&segment[numberOfSegments-1], 32);
- } else {
- segment[numberOfSegments-1].bufa = segment[numberOfSegments].bufa +
- showbits_hcr(&segment[numberOfSegments-1], segment[numberOfSegments-1].len);
- segment[numberOfSegments-1].bufb = segment[numberOfSegments].bufb;
- }
- segment[numberOfSegments-1].len += additional_bits;
- }
- bitsread = sp_data_len;
- PCWs_done = 1;
-
- fill_in_codeword(codeword, 0, sp, this_sec_CB);
- }
- } else {
- fill_in_codeword(codeword, numberOfCodewords - numberOfSegments, sp, this_sec_CB);
- }
- numberOfCodewords++;
- }
- }
- }
- }
- }
- }
- }
- }
-
- if (numberOfSegments == 0)
- return 10;
-
- numberOfSets = numberOfCodewords / numberOfSegments;
-
- /* step 2: decode nonPCWs */
- for (set = 1; set <= numberOfSets; set++)
- {
- uint16_t trial;
-
- for (trial = 0; trial < numberOfSegments; trial++)
- {
- uint16_t codewordBase;
-
- for (codewordBase = 0; codewordBase < numberOfSegments; codewordBase++)
- {
- const uint16_t segment_idx = (trial + codewordBase) % numberOfSegments;
- const uint16_t codeword_idx = codewordBase + set*numberOfSegments - numberOfSegments;
-
- /* data up */
- if (codeword_idx >= numberOfCodewords - numberOfSegments) break;
-
- if (!codeword[codeword_idx].decoded && segment[segment_idx].len > 0)
- {
- uint8_t tmplen;
-
- if (codeword[codeword_idx].bits.len != 0)
- concat_bits(&segment[segment_idx], &codeword[codeword_idx].bits);
-
- tmplen = segment[segment_idx].len;
-
- if (huffman_spectral_data_2(codeword[codeword_idx].cb, &segment[segment_idx],
- &spectral_data[codeword[codeword_idx].sp_offset]) >= 0)
- {
- codeword[codeword_idx].decoded = 1;
- } else
- {
- codeword[codeword_idx].bits = segment[segment_idx];
- codeword[codeword_idx].bits.len = tmplen;
- }
-
- }
- }
- }
- for (i = 0; i < numberOfSegments; i++)
- rewrev_bits(&segment[i]);
- }
-
- return 0;
-}
-#endif
diff --git a/src/libfaad/huffman.c b/src/libfaad/huffman.c
deleted file mode 100644
index 6c24a6cec..000000000
--- a/src/libfaad/huffman.c
+++ /dev/null
@@ -1,556 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: huffman.c,v 1.5 2005/10/29 23:57:06 tmmm Exp $
-**/
-
-#include "common.h"
-#include "structs.h"
-
-#include <stdlib.h>
-#ifdef ANALYSIS
-#include <stdio.h>
-#endif
-
-#include "bits.h"
-#include "huffman.h"
-#include "codebook/hcb.h"
-
-
-/* static function declarations */
-static INLINE void huffman_sign_bits(bitfile *ld, int16_t *sp, uint8_t len);
-static INLINE int16_t huffman_getescape(bitfile *ld, int16_t sp);
-static uint8_t huffman_2step_quad(uint8_t cb, bitfile *ld, int16_t *sp);
-static uint8_t huffman_2step_quad_sign(uint8_t cb, bitfile *ld, int16_t *sp);
-static uint8_t huffman_2step_pair(uint8_t cb, bitfile *ld, int16_t *sp);
-static uint8_t huffman_2step_pair_sign(uint8_t cb, bitfile *ld, int16_t *sp);
-static uint8_t huffman_binary_quad(uint8_t cb, bitfile *ld, int16_t *sp);
-static uint8_t huffman_binary_quad_sign(uint8_t cb, bitfile *ld, int16_t *sp);
-static uint8_t huffman_binary_pair(uint8_t cb, bitfile *ld, int16_t *sp);
-static uint8_t huffman_binary_pair_sign(uint8_t cb, bitfile *ld, int16_t *sp);
-static int16_t huffman_codebook(uint8_t i);
-static void vcb11_check_LAV(uint8_t cb, int16_t *sp);
-
-int8_t huffman_scale_factor(bitfile *ld)
-{
- uint16_t offset = 0;
-
- while (hcb_sf[offset][1])
- {
- uint8_t b = faad_get1bit(ld
- DEBUGVAR(1,255,"huffman_scale_factor()"));
- offset += hcb_sf[offset][b];
-
- if (offset > 240)
- {
- /* printf("ERROR: offset into hcb_sf = %d >240!\n", offset); */
- return -1;
- }
- }
-
- return hcb_sf[offset][0];
-}
-
-
-hcb *hcb_table[] = {
- 0, hcb1_1, hcb2_1, 0, hcb4_1, 0, hcb6_1, 0, hcb8_1, 0, hcb10_1, hcb11_1
-};
-
-hcb_2_quad *hcb_2_quad_table[] = {
- 0, hcb1_2, hcb2_2, 0, hcb4_2, 0, 0, 0, 0, 0, 0, 0
-};
-
-hcb_2_pair *hcb_2_pair_table[] = {
- 0, 0, 0, 0, 0, 0, hcb6_2, 0, hcb8_2, 0, hcb10_2, hcb11_2
-};
-
-hcb_bin_pair *hcb_bin_table[] = {
- 0, 0, 0, 0, 0, hcb5, 0, hcb7, 0, hcb9, 0, 0
-};
-
-uint8_t hcbN[] = { 0, 5, 5, 0, 5, 0, 5, 0, 5, 0, 6, 5 };
-
-/* defines whether a huffman codebook is unsigned or not */
-/* Table 4.6.2 */
-uint8_t unsigned_cb[] = { 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0,
- /* codebook 16 to 31 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
-};
-
-int hcb_2_quad_table_size[] = { 0, 114, 86, 0, 185, 0, 0, 0, 0, 0, 0, 0 };
-int hcb_2_pair_table_size[] = { 0, 0, 0, 0, 0, 0, 126, 0, 83, 0, 210, 373 };
-int hcb_bin_table_size[] = { 0, 0, 0, 161, 0, 161, 0, 127, 0, 337, 0, 0 };
-
-static INLINE void huffman_sign_bits(bitfile *ld, int16_t *sp, uint8_t len)
-{
- uint8_t i;
-
- for (i = 0; i < len; i++)
- {
- if(sp[i])
- {
- if(faad_get1bit(ld
- DEBUGVAR(1,5,"huffman_sign_bits(): sign bit")) & 1)
- {
- sp[i] = -sp[i];
- }
- }
- }
-}
-
-static INLINE int16_t huffman_getescape(bitfile *ld, int16_t sp)
-{
- uint8_t neg, i;
- int16_t j;
- int16_t off;
-
- if (sp < 0)
- {
- if (sp != -16)
- return sp;
- neg = 1;
- } else {
- if (sp != 16)
- return sp;
- neg = 0;
- }
-
- for (i = 4; ; i++)
- {
- if (faad_get1bit(ld
- DEBUGVAR(1,6,"huffman_getescape(): escape size")) == 0)
- {
- break;
- }
- }
-
- off = (int16_t)faad_getbits(ld, i
- DEBUGVAR(1,9,"huffman_getescape(): escape"));
-
- j = off | (1<<i);
- if (neg)
- j = -j;
-
- return j;
-}
-
-static uint8_t huffman_2step_quad(uint8_t cb, bitfile *ld, int16_t *sp)
-{
- uint32_t cw;
- uint16_t offset = 0;
- uint8_t extra_bits;
-
- cw = faad_showbits(ld, hcbN[cb]);
- offset = hcb_table[cb][cw].offset;
- extra_bits = hcb_table[cb][cw].extra_bits;
-
- if (extra_bits)
- {
- /* we know for sure it's more than hcbN[cb] bits long */
- faad_flushbits(ld, hcbN[cb]);
- offset += (uint16_t)faad_showbits(ld, extra_bits);
- faad_flushbits(ld, hcb_2_quad_table[cb][offset].bits - hcbN[cb]);
- } else {
- faad_flushbits(ld, hcb_2_quad_table[cb][offset].bits);
- }
-
- if (offset > hcb_2_quad_table_size[cb])
- {
- /* printf("ERROR: offset into hcb_2_quad_table = %d >%d!\n", offset,
- hcb_2_quad_table_size[cb]); */
- return 10;
- }
-
- sp[0] = hcb_2_quad_table[cb][offset].x;
- sp[1] = hcb_2_quad_table[cb][offset].y;
- sp[2] = hcb_2_quad_table[cb][offset].v;
- sp[3] = hcb_2_quad_table[cb][offset].w;
-
- return 0;
-}
-
-static uint8_t huffman_2step_quad_sign(uint8_t cb, bitfile *ld, int16_t *sp)
-{
- uint8_t err = huffman_2step_quad(cb, ld, sp);
- huffman_sign_bits(ld, sp, QUAD_LEN);
-
- return err;
-}
-
-static uint8_t huffman_2step_pair(uint8_t cb, bitfile *ld, int16_t *sp)
-{
- uint32_t cw;
- uint16_t offset = 0;
- uint8_t extra_bits;
-
- cw = faad_showbits(ld, hcbN[cb]);
- offset = hcb_table[cb][cw].offset;
- extra_bits = hcb_table[cb][cw].extra_bits;
-
- if (extra_bits)
- {
- /* we know for sure it's more than hcbN[cb] bits long */
- faad_flushbits(ld, hcbN[cb]);
- offset += (uint16_t)faad_showbits(ld, extra_bits);
- faad_flushbits(ld, hcb_2_pair_table[cb][offset].bits - hcbN[cb]);
- } else {
- faad_flushbits(ld, hcb_2_pair_table[cb][offset].bits);
- }
-
- if (offset > hcb_2_pair_table_size[cb])
- {
- /* printf("ERROR: offset into hcb_2_pair_table = %d >%d!\n", offset,
- hcb_2_pair_table_size[cb]); */
- return 10;
- }
-
- sp[0] = hcb_2_pair_table[cb][offset].x;
- sp[1] = hcb_2_pair_table[cb][offset].y;
-
- return 0;
-}
-
-static uint8_t huffman_2step_pair_sign(uint8_t cb, bitfile *ld, int16_t *sp)
-{
- uint8_t err = huffman_2step_pair(cb, ld, sp);
- huffman_sign_bits(ld, sp, PAIR_LEN);
-
- return err;
-}
-
-static uint8_t huffman_binary_quad(uint8_t cb, bitfile *ld, int16_t *sp)
-{
- uint16_t offset = 0;
-
- while (!hcb3[offset].is_leaf)
- {
- uint8_t b = faad_get1bit(ld
- DEBUGVAR(1,255,"huffman_spectral_data():3"));
- offset += hcb3[offset].data[b];
- }
-
- if (offset > hcb_bin_table_size[cb])
- {
- /* printf("ERROR: offset into hcb_bin_table = %d >%d!\n", offset,
- hcb_bin_table_size[cb]); */
- return 10;
- }
-
- sp[0] = hcb3[offset].data[0];
- sp[1] = hcb3[offset].data[1];
- sp[2] = hcb3[offset].data[2];
- sp[3] = hcb3[offset].data[3];
-
- return 0;
-}
-
-static uint8_t huffman_binary_quad_sign(uint8_t cb, bitfile *ld, int16_t *sp)
-{
- uint8_t err = huffman_binary_quad(cb, ld, sp);
- huffman_sign_bits(ld, sp, QUAD_LEN);
-
- return err;
-}
-
-static uint8_t huffman_binary_pair(uint8_t cb, bitfile *ld, int16_t *sp)
-{
- uint16_t offset = 0;
-
- while (!hcb_bin_table[cb][offset].is_leaf)
- {
- uint8_t b = faad_get1bit(ld
- DEBUGVAR(1,255,"huffman_spectral_data():9"));
- offset += hcb_bin_table[cb][offset].data[b];
- }
-
- if (offset > hcb_bin_table_size[cb])
- {
- /* printf("ERROR: offset into hcb_bin_table = %d >%d!\n", offset,
- hcb_bin_table_size[cb]); */
- return 10;
- }
-
- sp[0] = hcb_bin_table[cb][offset].data[0];
- sp[1] = hcb_bin_table[cb][offset].data[1];
-
- return 0;
-}
-
-static uint8_t huffman_binary_pair_sign(uint8_t cb, bitfile *ld, int16_t *sp)
-{
- uint8_t err = huffman_binary_pair(cb, ld, sp);
- huffman_sign_bits(ld, sp, PAIR_LEN);
-
- return err;
-}
-
-static int16_t huffman_codebook(uint8_t i)
-{
- static const uint32_t data = 16428320;
- if (i == 0) return (int16_t)(data >> 16) & 0xFFFF;
- else return (int16_t)data & 0xFFFF;
-}
-
-static void vcb11_check_LAV(uint8_t cb, int16_t *sp)
-{
- static const uint16_t vcb11_LAV_tab[] = {
- 16, 31, 47, 63, 95, 127, 159, 191, 223,
- 255, 319, 383, 511, 767, 1023, 2047
- };
- uint16_t max = 0;
-
- if (cb < 16 || cb > 31)
- return;
-
- max = vcb11_LAV_tab[cb - 16];
-
- if ((abs(sp[0]) > max) || (abs(sp[1]) > max))
- {
- sp[0] = 0;
- sp[1] = 0;
- }
-}
-
-uint8_t huffman_spectral_data(uint8_t cb, bitfile *ld, int16_t *sp)
-{
- switch (cb)
- {
- case 1: /* 2-step method for data quadruples */
- case 2:
- return huffman_2step_quad(cb, ld, sp);
- case 3: /* binary search for data quadruples */
- return huffman_binary_quad_sign(cb, ld, sp);
- case 4: /* 2-step method for data quadruples */
- return huffman_2step_quad_sign(cb, ld, sp);
- case 5: /* binary search for data pairs */
- return huffman_binary_pair(cb, ld, sp);
- case 6: /* 2-step method for data pairs */
- return huffman_2step_pair(cb, ld, sp);
- case 7: /* binary search for data pairs */
- case 9:
- return huffman_binary_pair_sign(cb, ld, sp);
- case 8: /* 2-step method for data pairs */
- case 10:
- return huffman_2step_pair_sign(cb, ld, sp);
- case 12: {
- uint8_t err = huffman_2step_pair(11, ld, sp);
- sp[0] = huffman_codebook(0); sp[1] = huffman_codebook(1);
- return err; }
- case 11:
- {
- uint8_t err = huffman_2step_pair_sign(11, ld, sp);
- sp[0] = huffman_getescape(ld, sp[0]);
- sp[1] = huffman_getescape(ld, sp[1]);
- return err;
- }
-#ifdef ERROR_RESILIENCE
- /* VCB11 uses codebook 11 */
- case 16: case 17: case 18: case 19: case 20: case 21: case 22: case 23:
- case 24: case 25: case 26: case 27: case 28: case 29: case 30: case 31:
- {
- uint8_t err = huffman_2step_pair_sign(11, ld, sp);
- sp[0] = huffman_getescape(ld, sp[0]);
- sp[1] = huffman_getescape(ld, sp[1]);
-
- /* check LAV (Largest Absolute Value) */
- /* this finds errors in the ESCAPE signal */
- vcb11_check_LAV(cb, sp);
-
- return err;
- }
-#endif
- default:
- /* Non existent codebook number, something went wrong */
- return 11;
- }
-
- return 0;
-}
-
-
-#ifdef ERROR_RESILIENCE
-
-/* Special version of huffman_spectral_data
-Will not read from a bitfile but a bits_t structure.
-Will keep track of the bits decoded and return the number of bits remaining.
-Do not read more than ld->len, return -1 if codeword would be longer */
-
-int8_t huffman_spectral_data_2(uint8_t cb, bits_t *ld, int16_t *sp)
-{
- uint32_t cw;
- uint16_t offset = 0;
- uint8_t extra_bits;
- uint8_t i, vcb11 = 0;
-
-
- switch (cb)
- {
- case 1: /* 2-step method for data quadruples */
- case 2:
- case 4:
-
- cw = showbits_hcr(ld, hcbN[cb]);
- offset = hcb_table[cb][cw].offset;
- extra_bits = hcb_table[cb][cw].extra_bits;
-
- if (extra_bits)
- {
- /* we know for sure it's more than hcbN[cb] bits long */
- if ( flushbits_hcr(ld, hcbN[cb]) ) return -1;
- offset += (uint16_t)showbits_hcr(ld, extra_bits);
- if ( flushbits_hcr(ld, hcb_2_quad_table[cb][offset].bits - hcbN[cb]) ) return -1;
- } else {
- if ( flushbits_hcr(ld, hcb_2_quad_table[cb][offset].bits) ) return -1;
- }
-
- sp[0] = hcb_2_quad_table[cb][offset].x;
- sp[1] = hcb_2_quad_table[cb][offset].y;
- sp[2] = hcb_2_quad_table[cb][offset].v;
- sp[3] = hcb_2_quad_table[cb][offset].w;
- break;
-
- case 6: /* 2-step method for data pairs */
- case 8:
- case 10:
- case 11:
- /* VCB11 uses codebook 11 */
- case 16: case 17: case 18: case 19: case 20: case 21: case 22: case 23:
- case 24: case 25: case 26: case 27: case 28: case 29: case 30: case 31:
-
- if (cb >= 16)
- {
- /* store the virtual codebook */
- vcb11 = cb;
- cb = 11;
- }
-
- cw = showbits_hcr(ld, hcbN[cb]);
- offset = hcb_table[cb][cw].offset;
- extra_bits = hcb_table[cb][cw].extra_bits;
-
- if (extra_bits)
- {
- /* we know for sure it's more than hcbN[cb] bits long */
- if ( flushbits_hcr(ld, hcbN[cb]) ) return -1;
- offset += (uint16_t)showbits_hcr(ld, extra_bits);
- if ( flushbits_hcr(ld, hcb_2_pair_table[cb][offset].bits - hcbN[cb]) ) return -1;
- } else {
- if ( flushbits_hcr(ld, hcb_2_pair_table[cb][offset].bits) ) return -1;
- }
- sp[0] = hcb_2_pair_table[cb][offset].x;
- sp[1] = hcb_2_pair_table[cb][offset].y;
- break;
-
- case 3: /* binary search for data quadruples */
-
- while (!hcb3[offset].is_leaf)
- {
- uint8_t b;
-
- if ( get1bit_hcr(ld, &b) ) return -1;
- offset += hcb3[offset].data[b];
- }
-
- sp[0] = hcb3[offset].data[0];
- sp[1] = hcb3[offset].data[1];
- sp[2] = hcb3[offset].data[2];
- sp[3] = hcb3[offset].data[3];
-
- break;
-
- case 5: /* binary search for data pairs */
- case 7:
- case 9:
-
- while (!hcb_bin_table[cb][offset].is_leaf)
- {
- uint8_t b;
-
- if (get1bit_hcr(ld, &b) ) return -1;
- offset += hcb_bin_table[cb][offset].data[b];
- }
-
- sp[0] = hcb_bin_table[cb][offset].data[0];
- sp[1] = hcb_bin_table[cb][offset].data[1];
-
- break;
- }
-
- /* decode sign bits */
- if (unsigned_cb[cb])
- {
- for(i = 0; i < ((cb < FIRST_PAIR_HCB) ? QUAD_LEN : PAIR_LEN); i++)
- {
- if(sp[i])
- {
- uint8_t b;
- if ( get1bit_hcr(ld, &b) ) return -1;
- if (b != 0) {
- sp[i] = -sp[i];
- }
- }
- }
- }
-
- /* decode huffman escape bits */
- if ((cb == ESC_HCB) || (cb >= 16))
- {
- uint8_t k;
- for (k = 0; k < 2; k++)
- {
- if ((sp[k] == 16) || (sp[k] == -16))
- {
- uint8_t neg, i;
- int32_t j;
- uint32_t off;
-
- neg = (sp[k] < 0) ? 1 : 0;
-
- for (i = 4; ; i++)
- {
- uint8_t b;
- if (get1bit_hcr(ld, &b))
- return -1;
- if (b == 0)
- break;
- }
-
- if (getbits_hcr(ld, i, &off))
- return -1;
- j = off + (1<<i);
- sp[k] = (int16_t)((neg) ? -j : j);
- }
- }
-
- if (vcb11 != 0)
- {
- /* check LAV (Largest Absolute Value) */
- /* this finds errors in the ESCAPE signal */
- vcb11_check_LAV(vcb11, sp);
- }
- }
- return ld->len;
-}
-
-#endif
-
diff --git a/src/libfaad/huffman.h b/src/libfaad/huffman.h
deleted file mode 100644
index cffe23093..000000000
--- a/src/libfaad/huffman.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: huffman.h,v 1.7 2005/10/29 23:57:06 tmmm Exp $
-**/
-
-#ifndef __HUFFMAN_H__
-#define __HUFFMAN_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int8_t huffman_scale_factor(bitfile *ld);
-uint8_t huffman_spectral_data(uint8_t cb, bitfile *ld, int16_t *sp);
-#ifdef ERROR_RESILIENCE
-int8_t huffman_spectral_data_2(uint8_t cb, bits_t *ld, int16_t *sp);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/libfaad/ic_predict.c b/src/libfaad/ic_predict.c
deleted file mode 100644
index 82753a9f2..000000000
--- a/src/libfaad/ic_predict.c
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: ic_predict.c,v 1.7 2005/10/29 23:57:06 tmmm Exp $
-**/
-
-#include "common.h"
-#include "structs.h"
-
-#ifdef MAIN_DEC
-
-#include "syntax.h"
-#include "ic_predict.h"
-#include "pns.h"
-
-
-static void flt_round(float32_t *pf)
-{
- int32_t flg;
- uint32_t tmp, tmp1, tmp2;
-
- tmp = *(uint32_t*)pf;
- flg = tmp & (uint32_t)0x00008000;
- tmp &= (uint32_t)0xffff0000;
- tmp1 = tmp;
- /* round 1/2 lsb toward infinity */
- if (flg)
- {
- tmp &= (uint32_t)0xff800000; /* extract exponent and sign */
- tmp |= (uint32_t)0x00010000; /* insert 1 lsb */
- tmp2 = tmp; /* add 1 lsb and elided one */
- tmp &= (uint32_t)0xff800000; /* extract exponent and sign */
-
- *pf = *(float32_t*)&tmp1 + *(float32_t*)&tmp2 - *(float32_t*)&tmp;
- } else {
- *pf = *(float32_t*)&tmp;
- }
-}
-
-static int16_t quant_pred(float32_t x)
-{
- int16_t q;
- uint32_t *tmp = (uint32_t*)&x;
-
- q = (int16_t)(*tmp>>16);
-
- return q;
-}
-
-static float32_t inv_quant_pred(int16_t q)
-{
- float32_t x;
- uint32_t *tmp = (uint32_t*)&x;
- *tmp = ((uint32_t)q)<<16;
-
- return x;
-}
-
-static void ic_predict(pred_state *state, real_t input, real_t *output, uint8_t pred)
-{
- uint16_t tmp;
- int16_t i, j;
- real_t dr1, predictedvalue;
- real_t e0, e1;
- real_t k1, k2;
-
- real_t r[2];
- real_t COR[2];
- real_t VAR[2];
-
- r[0] = inv_quant_pred(state->r[0]);
- r[1] = inv_quant_pred(state->r[1]);
- COR[0] = inv_quant_pred(state->COR[0]);
- COR[1] = inv_quant_pred(state->COR[1]);
- VAR[0] = inv_quant_pred(state->VAR[0]);
- VAR[1] = inv_quant_pred(state->VAR[1]);
-
-
-#if 1
- tmp = state->VAR[0];
- j = (tmp >> 7);
- i = tmp & 0x7f;
- if (j >= 128)
- {
- j -= 128;
- k1 = COR[0] * exp_table[j] * mnt_table[i];
- } else {
- k1 = REAL_CONST(0);
- }
-#else
-
- {
-#define B 0.953125
- real_t c = COR[0];
- real_t v = VAR[0];
- real_t tmp;
- if (c == 0 || v <= 1)
- {
- k1 = 0;
- } else {
- tmp = B / v;
- flt_round(&tmp);
- k1 = c * tmp;
- }
- }
-#endif
-
- if (pred)
- {
-#if 1
- tmp = state->VAR[1];
- j = (tmp >> 7);
- i = tmp & 0x7f;
- if (j >= 128)
- {
- j -= 128;
- k2 = COR[1] * exp_table[j] * mnt_table[i];
- } else {
- k2 = REAL_CONST(0);
- }
-#else
-
-#define B 0.953125
- real_t c = COR[1];
- real_t v = VAR[1];
- real_t tmp;
- if (c == 0 || v <= 1)
- {
- k2 = 0;
- } else {
- tmp = B / v;
- flt_round(&tmp);
- k2 = c * tmp;
- }
-#endif
-
- predictedvalue = k1*r[0] + k2*r[1];
- flt_round(&predictedvalue);
- *output = input + predictedvalue;
- }
-
- /* calculate new state data */
- e0 = *output;
- e1 = e0 - k1*r[0];
- dr1 = k1*e0;
-
- VAR[0] = ALPHA*VAR[0] + 0.5f * (r[0]*r[0] + e0*e0);
- COR[0] = ALPHA*COR[0] + r[0]*e0;
- VAR[1] = ALPHA*VAR[1] + 0.5f * (r[1]*r[1] + e1*e1);
- COR[1] = ALPHA*COR[1] + r[1]*e1;
-
- r[1] = A * (r[0]-dr1);
- r[0] = A * e0;
-
- state->r[0] = quant_pred(r[0]);
- state->r[1] = quant_pred(r[1]);
- state->COR[0] = quant_pred(COR[0]);
- state->COR[1] = quant_pred(COR[1]);
- state->VAR[0] = quant_pred(VAR[0]);
- state->VAR[1] = quant_pred(VAR[1]);
-}
-
-static void reset_pred_state(pred_state *state)
-{
- state->r[0] = 0;
- state->r[1] = 0;
- state->COR[0] = 0;
- state->COR[1] = 0;
- state->VAR[0] = 0x3F80;
- state->VAR[1] = 0x3F80;
-}
-
-void pns_reset_pred_state(ic_stream *ics, pred_state *state)
-{
- uint8_t sfb, g, b;
- uint16_t i, offs, offs2;
-
- /* prediction only for long blocks */
- if (ics->window_sequence == EIGHT_SHORT_SEQUENCE)
- return;
-
- for (g = 0; g < ics->num_window_groups; g++)
- {
- for (b = 0; b < ics->window_group_length[g]; b++)
- {
- for (sfb = 0; sfb < ics->max_sfb; sfb++)
- {
- if (is_noise(ics, g, sfb))
- {
- offs = ics->swb_offset[sfb];
- offs2 = ics->swb_offset[sfb+1];
-
- for (i = offs; i < offs2; i++)
- reset_pred_state(&state[i]);
- }
- }
- }
- }
-}
-
-void reset_all_predictors(pred_state *state, uint16_t frame_len)
-{
- uint16_t i;
-
- for (i = 0; i < frame_len; i++)
- reset_pred_state(&state[i]);
-}
-
-/* intra channel prediction */
-void ic_prediction(ic_stream *ics, real_t *spec, pred_state *state,
- uint16_t frame_len, uint8_t sf_index)
-{
- uint8_t sfb;
- uint16_t bin;
-
- if (ics->window_sequence == EIGHT_SHORT_SEQUENCE)
- {
- reset_all_predictors(state, frame_len);
- } else {
- for (sfb = 0; sfb < max_pred_sfb(sf_index); sfb++)
- {
- uint16_t low = ics->swb_offset[sfb];
- uint16_t high = ics->swb_offset[sfb+1];
-
- for (bin = low; bin < high; bin++)
- {
- ic_predict(&state[bin], spec[bin], &spec[bin],
- (ics->predictor_data_present && ics->pred.prediction_used[sfb]));
- }
- }
-
- if (ics->predictor_data_present)
- {
- if (ics->pred.predictor_reset)
- {
- for (bin = ics->pred.predictor_reset_group_number - 1;
- bin < frame_len; bin += 30)
- {
- reset_pred_state(&state[bin]);
- }
- }
- }
- }
-}
-
-#endif
diff --git a/src/libfaad/ic_predict.h b/src/libfaad/ic_predict.h
deleted file mode 100644
index 233992b96..000000000
--- a/src/libfaad/ic_predict.h
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: ic_predict.h,v 1.7 2005/10/29 23:57:06 tmmm Exp $
-**/
-
-#ifdef MAIN_DEC
-
-#ifndef __IC_PREDICT_H__
-#define __IC_PREDICT_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define ALPHA REAL_CONST(0.90625)
-#define A REAL_CONST(0.953125)
-
-
-void pns_reset_pred_state(ic_stream *ics, pred_state *state);
-void reset_all_predictors(pred_state *state, uint16_t frame_len);
-void ic_prediction(ic_stream *ics, real_t *spec, pred_state *state,
- uint16_t frame_len, uint8_t sf_index);
-
-ALIGN static const real_t mnt_table[128] = {
- COEF_CONST(0.9531250000), COEF_CONST(0.9453125000),
- COEF_CONST(0.9375000000), COEF_CONST(0.9296875000),
- COEF_CONST(0.9257812500), COEF_CONST(0.9179687500),
- COEF_CONST(0.9101562500), COEF_CONST(0.9023437500),
- COEF_CONST(0.8984375000), COEF_CONST(0.8906250000),
- COEF_CONST(0.8828125000), COEF_CONST(0.8789062500),
- COEF_CONST(0.8710937500), COEF_CONST(0.8671875000),
- COEF_CONST(0.8593750000), COEF_CONST(0.8515625000),
- COEF_CONST(0.8476562500), COEF_CONST(0.8398437500),
- COEF_CONST(0.8359375000), COEF_CONST(0.8281250000),
- COEF_CONST(0.8242187500), COEF_CONST(0.8203125000),
- COEF_CONST(0.8125000000), COEF_CONST(0.8085937500),
- COEF_CONST(0.8007812500), COEF_CONST(0.7968750000),
- COEF_CONST(0.7929687500), COEF_CONST(0.7851562500),
- COEF_CONST(0.7812500000), COEF_CONST(0.7773437500),
- COEF_CONST(0.7734375000), COEF_CONST(0.7656250000),
- COEF_CONST(0.7617187500), COEF_CONST(0.7578125000),
- COEF_CONST(0.7539062500), COEF_CONST(0.7500000000),
- COEF_CONST(0.7421875000), COEF_CONST(0.7382812500),
- COEF_CONST(0.7343750000), COEF_CONST(0.7304687500),
- COEF_CONST(0.7265625000), COEF_CONST(0.7226562500),
- COEF_CONST(0.7187500000), COEF_CONST(0.7148437500),
- COEF_CONST(0.7109375000), COEF_CONST(0.7070312500),
- COEF_CONST(0.6992187500), COEF_CONST(0.6953125000),
- COEF_CONST(0.6914062500), COEF_CONST(0.6875000000),
- COEF_CONST(0.6835937500), COEF_CONST(0.6796875000),
- COEF_CONST(0.6796875000), COEF_CONST(0.6757812500),
- COEF_CONST(0.6718750000), COEF_CONST(0.6679687500),
- COEF_CONST(0.6640625000), COEF_CONST(0.6601562500),
- COEF_CONST(0.6562500000), COEF_CONST(0.6523437500),
- COEF_CONST(0.6484375000), COEF_CONST(0.6445312500),
- COEF_CONST(0.6406250000), COEF_CONST(0.6406250000),
- COEF_CONST(0.6367187500), COEF_CONST(0.6328125000),
- COEF_CONST(0.6289062500), COEF_CONST(0.6250000000),
- COEF_CONST(0.6210937500), COEF_CONST(0.6210937500),
- COEF_CONST(0.6171875000), COEF_CONST(0.6132812500),
- COEF_CONST(0.6093750000), COEF_CONST(0.6054687500),
- COEF_CONST(0.6054687500), COEF_CONST(0.6015625000),
- COEF_CONST(0.5976562500), COEF_CONST(0.5937500000),
- COEF_CONST(0.5937500000), COEF_CONST(0.5898437500),
- COEF_CONST(0.5859375000), COEF_CONST(0.5820312500),
- COEF_CONST(0.5820312500), COEF_CONST(0.5781250000),
- COEF_CONST(0.5742187500), COEF_CONST(0.5742187500),
- COEF_CONST(0.5703125000), COEF_CONST(0.5664062500),
- COEF_CONST(0.5664062500), COEF_CONST(0.5625000000),
- COEF_CONST(0.5585937500), COEF_CONST(0.5585937500),
- COEF_CONST(0.5546875000), COEF_CONST(0.5507812500),
- COEF_CONST(0.5507812500), COEF_CONST(0.5468750000),
- COEF_CONST(0.5429687500), COEF_CONST(0.5429687500),
- COEF_CONST(0.5390625000), COEF_CONST(0.5390625000),
- COEF_CONST(0.5351562500), COEF_CONST(0.5312500000),
- COEF_CONST(0.5312500000), COEF_CONST(0.5273437500),
- COEF_CONST(0.5273437500), COEF_CONST(0.5234375000),
- COEF_CONST(0.5195312500), COEF_CONST(0.5195312500),
- COEF_CONST(0.5156250000), COEF_CONST(0.5156250000),
- COEF_CONST(0.5117187500), COEF_CONST(0.5117187500),
- COEF_CONST(0.5078125000), COEF_CONST(0.5078125000),
- COEF_CONST(0.5039062500), COEF_CONST(0.5039062500),
- COEF_CONST(0.5000000000), COEF_CONST(0.4980468750),
- COEF_CONST(0.4960937500), COEF_CONST(0.4941406250),
- COEF_CONST(0.4921875000), COEF_CONST(0.4902343750),
- COEF_CONST(0.4882812500), COEF_CONST(0.4863281250),
- COEF_CONST(0.4843750000), COEF_CONST(0.4824218750),
- COEF_CONST(0.4804687500), COEF_CONST(0.4785156250)
-};
-
-ALIGN static const real_t exp_table[128] = {
- COEF_CONST(0.50000000000000000000000000000000000000000000000000),
- COEF_CONST(0.25000000000000000000000000000000000000000000000000),
- COEF_CONST(0.12500000000000000000000000000000000000000000000000),
- COEF_CONST(0.06250000000000000000000000000000000000000000000000),
- COEF_CONST(0.03125000000000000000000000000000000000000000000000),
- COEF_CONST(0.01562500000000000000000000000000000000000000000000),
- COEF_CONST(0.00781250000000000000000000000000000000000000000000),
- COEF_CONST(0.00390625000000000000000000000000000000000000000000),
- COEF_CONST(0.00195312500000000000000000000000000000000000000000),
- COEF_CONST(0.00097656250000000000000000000000000000000000000000),
- COEF_CONST(0.00048828125000000000000000000000000000000000000000),
- COEF_CONST(0.00024414062500000000000000000000000000000000000000),
- COEF_CONST(0.00012207031250000000000000000000000000000000000000),
- COEF_CONST(0.00006103515625000000000000000000000000000000000000),
- COEF_CONST(0.00003051757812500000000000000000000000000000000000),
- COEF_CONST(0.00001525878906250000000000000000000000000000000000),
- COEF_CONST(0.00000762939453125000000000000000000000000000000000),
- COEF_CONST(0.00000381469726562500000000000000000000000000000000),
- COEF_CONST(0.00000190734863281250000000000000000000000000000000),
- COEF_CONST(0.00000095367431640625000000000000000000000000000000),
- COEF_CONST(0.00000047683715820312500000000000000000000000000000),
- COEF_CONST(0.00000023841857910156250000000000000000000000000000),
- COEF_CONST(0.00000011920928955078125000000000000000000000000000),
- COEF_CONST(0.00000005960464477539062500000000000000000000000000),
- COEF_CONST(0.00000002980232238769531300000000000000000000000000),
- COEF_CONST(0.00000001490116119384765600000000000000000000000000),
- COEF_CONST(0.00000000745058059692382810000000000000000000000000),
- COEF_CONST(0.00000000372529029846191410000000000000000000000000),
- COEF_CONST(0.00000000186264514923095700000000000000000000000000),
- COEF_CONST(0.00000000093132257461547852000000000000000000000000),
- COEF_CONST(0.00000000046566128730773926000000000000000000000000),
- COEF_CONST(0.00000000023283064365386963000000000000000000000000),
- COEF_CONST(0.00000000011641532182693481000000000000000000000000),
- COEF_CONST(0.00000000005820766091346740700000000000000000000000),
- COEF_CONST(0.00000000002910383045673370400000000000000000000000),
- COEF_CONST(0.00000000001455191522836685200000000000000000000000),
- COEF_CONST(0.00000000000727595761418342590000000000000000000000),
- COEF_CONST(0.00000000000363797880709171300000000000000000000000),
- COEF_CONST(0.00000000000181898940354585650000000000000000000000),
- COEF_CONST(0.00000000000090949470177292824000000000000000000000),
- COEF_CONST(0.00000000000045474735088646412000000000000000000000),
- COEF_CONST(0.00000000000022737367544323206000000000000000000000),
- COEF_CONST(0.00000000000011368683772161603000000000000000000000),
- COEF_CONST(0.00000000000005684341886080801500000000000000000000),
- COEF_CONST(0.00000000000002842170943040400700000000000000000000),
- COEF_CONST(0.00000000000001421085471520200400000000000000000000),
- COEF_CONST(0.00000000000000710542735760100190000000000000000000),
- COEF_CONST(0.00000000000000355271367880050090000000000000000000),
- COEF_CONST(0.00000000000000177635683940025050000000000000000000),
- COEF_CONST(0.00000000000000088817841970012523000000000000000000),
- COEF_CONST(0.00000000000000044408920985006262000000000000000000),
- COEF_CONST(0.00000000000000022204460492503131000000000000000000),
- COEF_CONST(0.00000000000000011102230246251565000000000000000000),
- COEF_CONST(0.00000000000000005551115123125782700000000000000000),
- COEF_CONST(0.00000000000000002775557561562891400000000000000000),
- COEF_CONST(0.00000000000000001387778780781445700000000000000000),
- COEF_CONST(0.00000000000000000693889390390722840000000000000000),
- COEF_CONST(0.00000000000000000346944695195361420000000000000000),
- COEF_CONST(0.00000000000000000173472347597680710000000000000000),
- COEF_CONST(0.00000000000000000086736173798840355000000000000000),
- COEF_CONST(0.00000000000000000043368086899420177000000000000000),
- COEF_CONST(0.00000000000000000021684043449710089000000000000000),
- COEF_CONST(0.00000000000000000010842021724855044000000000000000),
- COEF_CONST(0.00000000000000000005421010862427522200000000000000),
- COEF_CONST(0.00000000000000000002710505431213761100000000000000),
- COEF_CONST(0.00000000000000000001355252715606880500000000000000),
- COEF_CONST(0.00000000000000000000677626357803440270000000000000),
- COEF_CONST(0.00000000000000000000338813178901720140000000000000),
- COEF_CONST(0.00000000000000000000169406589450860070000000000000),
- COEF_CONST(0.00000000000000000000084703294725430034000000000000),
- COEF_CONST(0.00000000000000000000042351647362715017000000000000),
- COEF_CONST(0.00000000000000000000021175823681357508000000000000),
- COEF_CONST(0.00000000000000000000010587911840678754000000000000),
- COEF_CONST(0.00000000000000000000005293955920339377100000000000),
- COEF_CONST(0.00000000000000000000002646977960169688600000000000),
- COEF_CONST(0.00000000000000000000001323488980084844300000000000),
- COEF_CONST(0.00000000000000000000000661744490042422140000000000),
- COEF_CONST(0.00000000000000000000000330872245021211070000000000),
- COEF_CONST(0.00000000000000000000000165436122510605530000000000),
- COEF_CONST(0.00000000000000000000000082718061255302767000000000),
- COEF_CONST(0.00000000000000000000000041359030627651384000000000),
- COEF_CONST(0.00000000000000000000000020679515313825692000000000),
- COEF_CONST(0.00000000000000000000000010339757656912846000000000),
- COEF_CONST(0.00000000000000000000000005169878828456423000000000),
- COEF_CONST(0.00000000000000000000000002584939414228211500000000),
- COEF_CONST(0.00000000000000000000000001292469707114105700000000),
- COEF_CONST(0.00000000000000000000000000646234853557052870000000),
- COEF_CONST(0.00000000000000000000000000323117426778526440000000),
- COEF_CONST(0.00000000000000000000000000161558713389263220000000),
- COEF_CONST(0.00000000000000000000000000080779356694631609000000),
- COEF_CONST(0.00000000000000000000000000040389678347315804000000),
- COEF_CONST(0.00000000000000000000000000020194839173657902000000),
- COEF_CONST(0.00000000000000000000000000010097419586828951000000),
- COEF_CONST(0.00000000000000000000000000005048709793414475600000),
- COEF_CONST(0.00000000000000000000000000002524354896707237800000),
- COEF_CONST(0.00000000000000000000000000001262177448353618900000),
- COEF_CONST(0.00000000000000000000000000000631088724176809440000),
- COEF_CONST(0.00000000000000000000000000000315544362088404720000),
- COEF_CONST(0.00000000000000000000000000000157772181044202360000),
- COEF_CONST(0.00000000000000000000000000000078886090522101181000),
- COEF_CONST(0.00000000000000000000000000000039443045261050590000),
- COEF_CONST(0.00000000000000000000000000000019721522630525295000),
- COEF_CONST(0.00000000000000000000000000000009860761315262647600),
- COEF_CONST(0.00000000000000000000000000000004930380657631323800),
- COEF_CONST(0.00000000000000000000000000000002465190328815661900),
- COEF_CONST(0.00000000000000000000000000000001232595164407830900),
- COEF_CONST(0.00000000000000000000000000000000616297582203915470),
- COEF_CONST(0.00000000000000000000000000000000308148791101957740),
- COEF_CONST(0.00000000000000000000000000000000154074395550978870),
- COEF_CONST(0.00000000000000000000000000000000077037197775489434),
- COEF_CONST(0.00000000000000000000000000000000038518598887744717),
- COEF_CONST(0.00000000000000000000000000000000019259299443872359),
- COEF_CONST(0.00000000000000000000000000000000009629649721936179),
- COEF_CONST(0.00000000000000000000000000000000004814824860968090),
- COEF_CONST(0.00000000000000000000000000000000002407412430484045),
- COEF_CONST(0.00000000000000000000000000000000001203706215242022),
- COEF_CONST(0.00000000000000000000000000000000000601853107621011),
- COEF_CONST(0.00000000000000000000000000000000000300926553810506),
- COEF_CONST(0.00000000000000000000000000000000000150463276905253),
- COEF_CONST(0.00000000000000000000000000000000000075231638452626),
- COEF_CONST(0.00000000000000000000000000000000000037615819226313),
- COEF_CONST(0.00000000000000000000000000000000000018807909613157),
- COEF_CONST(0.00000000000000000000000000000000000009403954806578),
- COEF_CONST(0.00000000000000000000000000000000000004701977403289),
- COEF_CONST(0.00000000000000000000000000000000000002350988701645),
- COEF_CONST(0.00000000000000000000000000000000000001175494350822),
- COEF_CONST(0.0 /* 0000000000000000000000000000000000000587747175411 "floating point underflow" */),
- COEF_CONST(0.0)
-};
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
-#endif
diff --git a/src/libfaad/iq_table.h b/src/libfaad/iq_table.h
deleted file mode 100644
index 9002e15d7..000000000
--- a/src/libfaad/iq_table.h
+++ /dev/null
@@ -1,16455 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: iq_table.h,v 1.6 2005/10/29 23:57:06 tmmm Exp $
-**/
-
-#ifndef IQ_TABLE_H__
-#define IQ_TABLE_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/* !!!DON'T CHANGE IQ_TABLE_SIZE!!! */
-
-
-#ifndef FIXED_POINT
-
-#define IQ_TABLE_SIZE 8192
-
-#ifdef _MSC_VER
-#pragma warning(disable:4305)
-#pragma warning(disable:4244)
-#endif
-
-ALIGN static const real_t iq_table[IQ_TABLE_SIZE] =
-{
- 0,
- 1,
- 2.5198420997897464,
- 4.3267487109222245,
- 6.3496042078727974,
- 8.5498797333834844,
- 10.902723556992836,
- 13.390518279406722,
- 15.999999999999998,
- 18.720754407467133,
- 21.544346900318832,
- 24.463780996262464,
- 27.47314182127996,
- 30.567350940369842,
- 33.741991698453212,
- 36.993181114957046,
- 40.317473596635935,
- 43.711787041189993,
- 47.173345095760126,
- 50.699631325716943,
- 54.288352331898118,
- 57.937407704003519,
- 61.6448652744185,
- 65.408940536585988,
- 69.227979374755591,
- 73.100443455321638,
- 77.024897778591622,
- 80.999999999999986,
- 85.024491212518527,
- 89.097187944889555,
- 93.216975178615741,
- 97.382800224133163,
- 101.59366732596474,
- 105.84863288986224,
- 110.14680124343441,
- 114.4873208566006,
- 118.86938096020653,
- 123.29220851090024,
- 127.75506545836058,
- 132.25724627755247,
- 136.79807573413572,
- 141.37690685569191,
- 145.99311908523086,
- 150.6461165966291,
- 155.33532675434674,
- 160.06019870205279,
- 164.82020206673349,
- 169.61482576651861,
- 174.44357691188537,
- 179.30597979112557,
- 184.20157493201927,
- 189.12991823257562,
- 194.09058015449685,
- 199.08314497371677,
- 204.1072100829694,
- 209.16238534187647,
- 214.24829247050752,
- 219.36456448277784,
- 224.51084515641216,
- 229.6867885365223,
- 234.89205847013176,
- 240.12632816923249,
- 245.38927980018505,
- 250.68060409747261,
- 255.99999999999991,
- 261.34717430828869,
- 266.72184136106449,
- 272.12372272986045,
- 277.55254693037961,
- 283.0080491494619,
- 288.48997098659891,
- 293.99806020902247,
- 299.53207051947408,
- 305.0917613358298,
- 310.67689758182206,
- 316.28724948815585,
- 321.92259240337177,
- 327.58270661385535,
- 333.26737717243742,
- 338.97639373507025,
- 344.70955040510125,
- 350.46664558470013,
- 356.24748183302603,
- 362.05186573075139,
- 367.87960775058258,
- 373.73052213344511,
- 379.60442677002078,
- 385.50114308734607,
- 391.42049594019937,
- 397.36231350702371,
- 403.32642719014467,
- 409.31267152006262,
- 415.32088406360799,
- 421.35090533576471,
- 427.40257871497619,
- 433.4757503617617,
- 439.5702691404793,
- 445.68598654408271,
- 451.82275662172759,
- 457.98043590909128,
- 464.15888336127773,
- 470.35796028818726,
- 476.5775302922363,
- 482.81745920832043,
- 489.07761504591741,
- 495.35786793323581,
- 501.65809006331688,
- 507.97815564200368,
- 514.31794083769648,
- 520.67732373281672,
- 527.05618427690604,
- 533.45440424129174,
- 539.87186717525128,
- 546.30845836361505,
- 552.76406478574609,
- 559.23857507584194,
- 565.73187948450413,
- 572.24386984152341,
- 578.77443951983378,
- 585.32348340058843,
- 591.89089783931263,
- 598.47658063309257,
- 605.08043098876044,
- 611.70234949203643,
- 618.3422380775919,
- 624.99999999999977,
- 631.67553980553748,
- 638.36876330481164,
- 645.07957754617485,
- 651.80789078990415,
- 658.55361248311499,
- 665.31665323538357,
- 672.09692479505225,
- 678.8943400261943,
- 685.70881288621433,
- 692.540258404062,
- 699.38859265903977,
- 706.25373276018058,
- 713.13559682617972,
- 720.03410396586037,
- 726.94917425915435,
- 733.88072873858209,
- 740.82868937121543,
- 747.79297904110535,
- 754.77352153216191,
- 761.77024151147043,
- 768.78306451302956,
- 775.81191692189896,
- 782.85672595874246,
- 789.91741966475445,
- 796.99392688695798,
- 804.08617726386274,
- 811.19410121147098,
- 818.31762990962227,
- 825.45669528866563,
- 832.61123001644864,
- 839.78116748561604,
- 846.96644180120552,
- 854.16698776853514,
- 861.38274088137143,
- 868.61363731036977,
- 875.85961389178203,
- 883.12060811641959,
- 890.39655811886757,
- 897.68740266694181,
- 904.99308115138172,
- 912.31353357577188,
- 919.64870054668756,
- 926.99852326405619,
- 934.36294351172899,
- 941.74190364825859,
- 949.13534659787422,
- 956.54321584165211,
- 963.96545540887348,
- 971.40200986856541,
- 978.85282432122176,
- 986.31784439069588,
- 993.7970162162635,
- 1001.29028644485,
- 1008.797602223418,
- 1016.3189111915103,
- 1023.8541614739464,
- 1031.4033016736653,
- 1038.9662808647138,
- 1046.5430485853758,
- 1054.1335548314366,
- 1061.7377500495838,
- 1069.3555851309357,
- 1076.9870114046978,
- 1084.6319806319441,
- 1092.2904449995174,
- 1099.9623571140482,
- 1107.6476699960892,
- 1115.3463370743607,
- 1123.058312180106,
- 1130.7835495415541,
- 1138.5220037784854,
- 1146.273629896901,
- 1154.0383832837879,
- 1161.816219701986,
- 1169.607095285146,
- 1177.4109665327808,
- 1185.2277903054078,
- 1193.0575238197798,
- 1200.9001246442001,
- 1208.7555506939248,
- 1216.6237602266442,
- 1224.5047118380478,
- 1232.3983644574657,
- 1240.3046773435874,
- 1248.2236100802568,
- 1256.1551225723395,
- 1264.099175041662,
- 1272.0557280230228,
- 1280.0247423602691,
- 1288.0061792024444,
- 1295.9999999999995,
- 1304.006166501068,
- 1312.0246407478062,
- 1320.0553850727929,
- 1328.0983620954903,
- 1336.1535347187651,
- 1344.2208661254647,
- 1352.3003197750522,
- 1360.3918594002962,
- 1368.4954490040145,
- 1376.6110528558709,
- 1384.7386354892244,
- 1392.8781616980295,
- 1401.0295965337855,
- 1409.1929053025353,
- 1417.3680535619119,
- 1425.5550071182327,
- 1433.7537320236374,
- 1441.9641945732744,
- 1450.1863613025282,
- 1458.4201989842913,
- 1466.6656746262797,
- 1474.9227554683875,
- 1483.1914089800841,
- 1491.4716028578516,
- 1499.7633050226596,
- 1508.0664836174794,
- 1516.3811070048375,
- 1524.7071437644029,
- 1533.0445626906128,
- 1541.3933327903342,
- 1549.7534232805581,
- 1558.1248035861302,
- 1566.507443337515,
- 1574.9013123685909,
- 1583.3063807144795,
- 1591.7226186094069,
- 1600.1499964845941,
- 1608.58848496618,
- 1617.0380548731737,
- 1625.4986772154357,
- 1633.9703231916887,
- 1642.4529641875577,
- 1650.9465717736346,
- 1659.4511177035752,
- 1667.9665739122186,
- 1676.4929125137353,
- 1685.030105799801,
- 1693.5781262377957,
- 1702.136946469027,
- 1710.7065393069795,
- 1719.2868777355877,
- 1727.8779349075323,
- 1736.4796841425596,
- 1745.092098925825,
- 1753.7151529062583,
- 1762.3488198949503,
- 1770.9930738635628,
- 1779.6478889427597,
- 1788.3132394206564,
- 1796.9890997412947,
- 1805.6754445031333,
- 1814.3722484575621,
- 1823.0794865074322,
- 1831.7971337056094,
- 1840.5251652535437,
- 1849.2635564998579,
- 1858.0122829389563,
- 1866.7713202096493,
- 1875.5406440937966,
- 1884.3202305149687,
- 1893.110055537124,
- 1901.9100953633042,
- 1910.7203263343454,
- 1919.5407249276057,
- 1928.3712677557098,
- 1937.2119315653083,
- 1946.0626932358525,
- 1954.923529778386,
- 1963.79441833435,
- 1972.6753361744036,
- 1981.5662606972594,
- 1990.467169428533,
- 1999.3780400196069,
- 2008.2988502465078,
- 2017.2295780087982,
- 2026.1702013284819,
- 2035.1206983489212,
- 2044.0810473337688,
- 2053.0512266659125,
- 2062.0312148464309,
- 2071.0209904935646,
- 2080.0205323416958,
- 2089.0298192403443,
- 2098.0488301531714,
- 2107.0775441569995,
- 2116.115940440839,
- 2125.1639983049317,
- 2134.2216971597995,
- 2143.2890165253098,
- 2152.3659360297484,
- 2161.4524354089031,
- 2170.5484945051617,
- 2179.6540932666144,
- 2188.7692117461711,
- 2197.8938301006888,
- 2207.0279285901042,
- 2216.1714875765838,
- 2225.324487523676,
- 2234.4869089954782,
- 2243.6587326558101,
- 2252.8399392673982,
- 2262.0305096910702,
- 2271.2304248849537,
- 2280.4396659036897,
- 2289.6582138976523,
- 2298.8860501121762,
- 2308.1231558867926,
- 2317.3695126544767,
- 2326.6251019409005,
- 2335.8899053636933,
- 2345.1639046317132,
- 2354.4470815443233,
- 2363.7394179906792,
- 2373.0408959490205,
- 2382.3514974859731,
- 2391.6712047558558,
- 2400.9999999999991,
- 2410.3378655460651,
- 2419.6847838073813,
- 2429.0407372822747,
- 2438.4057085534191,
- 2447.7796802871858,
- 2457.1626352330004,
- 2466.5545562227112,
- 2475.9554261699564,
- 2485.3652280695474,
- 2494.7839449968492,
- 2504.2115601071737,
- 2513.6480566351788,
- 2523.0934178942675,
- 2532.5476272760025,
- 2542.0106682495189,
- 2551.482524360948,
- 2560.9631792328441,
- 2570.4526165636184,
- 2579.9508201269791,
- 2589.4577737713744,
- 2598.9734614194458,
- 2608.4978670674823,
- 2618.0309747848837,
- 2627.5727687136259,
- 2637.1232330677353,
- 2646.6823521327647,
- 2656.2501102652768,
- 2665.8264918923328,
- 2675.4114815109842,
- 2685.0050636877722,
- 2694.6072230582295,
- 2704.2179443263894,
- 2713.8372122642972,
- 2723.4650117115279,
- 2733.1013275747096,
- 2742.7461448270483,
- 2752.3994485078601,
- 2762.0612237221085,
- 2771.7314556399419,
- 2781.4101294962406,
- 2791.0972305901655,
- 2800.7927442847094,
- 2810.4966560062589,
- 2820.2089512441521,
- 2829.9296155502466,
- 2839.6586345384894,
- 2849.3959938844923,
- 2859.1416793251065,
- 2868.8956766580086,
- 2878.6579717412847,
- 2888.4285504930212,
- 2898.2073988908974,
- 2907.9945029717837,
- 2917.789848831344,
- 2927.5934226236377,
- 2937.4052105607311,
- 2947.2251989123079,
- 2957.0533740052865,
- 2966.8897222234368,
- 2976.734230007005,
- 2986.5868838523397,
- 2996.4476703115197,
- 3006.3165759919889,
- 3016.1935875561908,
- 3026.0786917212095,
- 3035.9718752584108,
- 3045.8731249930906,
- 3055.7824278041207,
- 3065.6997706236039,
- 3075.625140436528,
- 3085.5585242804245,
- 3095.4999092450298,
- 3105.4492824719491,
- 3115.4066311543256,
- 3125.3719425365089,
- 3135.3452039137287,
- 3145.3264026317715,
- 3155.3155260866592,
- 3165.3125617243295,
- 3175.3174970403229,
- 3185.3303195794679,
- 3195.35101693557,
- 3205.3795767511078,
- 3215.4159867169251,
- 3225.460234571929,
- 3235.5123081027928,
- 3245.5721951436558,
- 3255.63988357583,
- 3265.7153613275095,
- 3275.7986163734795,
- 3285.8896367348289,
- 3295.9884104786665,
- 3306.0949257178395,
- 3316.2091706106517,
- 3326.331133360588,
- 3336.4608022160378,
- 3346.5981654700231,
- 3356.7432114599264,
- 3366.8959285672249,
- 3377.0563052172211,
- 3387.2243298787821,
- 3397.3999910640764,
- 3407.5832773283128,
- 3417.7741772694862,
- 3427.9726795281199,
- 3438.1787727870123,
- 3448.3924457709873,
- 3458.6136872466445,
- 3468.8424860221107,
- 3479.0788309467976,
- 3489.3227109111554,
- 3499.5741148464344,
- 3509.8330317244445,
- 3520.0994505573185,
- 3530.3733603972751,
- 3540.6547503363886,
- 3550.9436095063534,
- 3561.239927078258,
- 3571.5436922623535,
- 3581.8548943078308,
- 3592.1735225025936,
- 3602.4995661730372,
- 3612.8330146838275,
- 3623.1738574376814,
- 3633.5220838751502,
- 3643.8776834744031,
- 3654.2406457510142,
- 3664.6109602577494,
- 3674.9886165843564,
- 3685.3736043573545,
- 3695.7659132398294,
- 3706.1655329312248,
- 3716.5724531671399,
- 3726.9866637191262,
- 3737.4081543944876,
- 3747.8369150360782,
- 3758.2729355221072,
- 3768.7162057659411,
- 3779.1667157159077,
- 3789.6244553551055,
- 3800.0894147012082,
- 3810.5615838062768,
- 3821.0409527565694,
- 3831.5275116723533,
- 3842.0212507077194,
- 3852.522160050396,
- 3863.0302299215673,
- 3873.5454505756893,
- 3884.0678123003108,
- 3894.5973054158922,
- 3905.1339202756285,
- 3915.6776472652732,
- 3926.2284768029604,
- 3936.7863993390338,
- 3947.3514053558706,
- 3957.9234853677135,
- 3968.5026299204969,
- 3979.0888295916798,
- 3989.6820749900776,
- 4000.2823567556948,
- 4010.8896655595613,
- 4021.5039921035655,
- 4032.1253271202945,
- 4042.7536613728694,
- 4053.3889856547858,
- 4064.0312907897551,
- 4074.6805676315448,
- 4085.3368070638221,
- 4095.9999999999982,
- 4106.6701373830711,
- 4117.347210185475,
- 4128.0312094089259,
- 4138.722126084268,
- 4149.4199512713267,
- 4160.1246760587583,
- 4170.8362915638982,
- 4181.5547889326181,
- 4192.2801593391769,
- 4203.0123939860741,
- 4213.7514841039101,
- 4224.4974209512384,
- 4235.2501958144258,
- 4246.0098000075095,
- 4256.7762248720574,
- 4267.549461777031,
- 4278.3295021186423,
- 4289.1163373202198,
- 4299.9099588320714,
- 4310.7103581313495,
- 4321.5175267219138,
- 4332.3314561342004,
- 4343.152137925088,
- 4353.9795636777671,
- 4364.8137250016052,
- 4375.6546135320223,
- 4386.5022209303588,
- 4397.3565388837469,
- 4408.2175591049827,
- 4419.0852733324018,
- 4429.9596733297531,
- 4440.8407508860728,
- 4451.7284978155603,
- 4462.6229059574571,
- 4473.5239671759227,
- 4484.4316733599126,
- 4495.3460164230582,
- 4506.2669883035496,
- 4517.1945809640119,
- 4528.1287863913894,
- 4539.069596596828,
- 4550.0170036155587,
- 4560.9709995067806,
- 4571.931576353546,
- 4582.898726262647,
- 4593.8724413645004,
- 4604.8527138130348,
- 4615.8395357855816,
- 4626.8328994827571,
- 4637.8327971283588,
- 4648.8392209692511,
- 4659.8521632752563,
- 4670.8716163390473,
- 4681.8975724760394,
- 4692.9300240242837,
- 4703.9689633443595,
- 4715.0143828192668,
- 4726.0662748543255,
- 4737.1246318770682,
- 4748.1894463371373,
- 4759.2607107061804,
- 4770.3384174777493,
- 4781.4225591671993,
- 4792.5131283115852,
- 4803.6101174695614,
- 4814.7135192212854,
- 4825.8233261683154,
- 4836.9395309335096,
- 4848.0621261609349,
- 4859.1911045157631,
- 4870.3264586841779,
- 4881.4681813732768,
- 4892.6162653109768,
- 4903.7707032459193,
- 4914.931487947375,
- 4926.0986122051509,
- 4937.2720688294967,
- 4948.4518506510112,
- 4959.637950520555,
- 4970.8303613091521,
- 4982.0290759079044,
- 4993.2340872278974,
- 5004.4453882001153,
- 5015.6629717753467,
- 5026.8868309241007,
- 5038.1169586365131,
- 5049.353347922266,
- 5060.5959918104927,
- 5071.8448833496996,
- 5083.1000156076734,
- 5094.3613816713996,
- 5105.6289746469747,
- 5116.9027876595246,
- 5128.18281385312,
- 5139.4690463906918,
- 5150.7614784539473,
- 5162.0601032432933,
- 5173.3649139777472,
- 5184.6759038948594,
- 5195.9930662506322,
- 5207.3163943194386,
- 5218.6458813939435,
- 5229.9815207850224,
- 5241.3233058216847,
- 5252.6712298509919,
- 5264.025286237983,
- 5275.3854683655954,
- 5286.7517696345885,
- 5298.1241834634639,
- 5309.5027032883945,
- 5320.887322563146,
- 5332.2780347589978,
- 5343.6748333646756,
- 5355.0777118862716,
- 5366.4866638471722,
- 5377.901682787985,
- 5389.3227622664635,
- 5400.749895857437,
- 5412.1830771527357,
- 5423.622299761123,
- 5435.067557308219,
- 5446.5188434364318,
- 5457.9761518048872,
- 5469.4394760893592,
- 5480.9088099821975,
- 5492.3841471922606,
- 5503.8654814448455,
- 5515.3528064816201,
- 5526.846116060552,
- 5538.3454039558474,
- 5549.8506639578736,
- 5561.3618898731029,
- 5572.8790755240361,
- 5584.4022147491451,
- 5595.9313014027975,
- 5607.4663293552012,
- 5619.0072924923297,
- 5630.5541847158656,
- 5642.1069999431284,
- 5653.665732107017,
- 5665.230375155943,
- 5676.8009230537655,
- 5688.3773697797333,
- 5699.9597093284156,
- 5711.5479357096474,
- 5723.1420429484588,
- 5734.7420250850209,
- 5746.347876174581,
- 5757.9595902874016,
- 5769.5771615087006,
- 5781.2005839385911,
- 5792.8298516920213,
- 5804.4649588987149,
- 5816.1058997031105,
- 5827.7526682643065,
- 5839.4052587559972,
- 5851.0636653664196,
- 5862.7278822982908,
- 5874.3979037687541,
- 5886.0737240093204,
- 5897.7553372658094,
- 5909.4427377982956,
- 5921.1359198810505,
- 5932.8348778024874,
- 5944.5396058651031,
- 5956.2500983854261,
- 5967.9663496939575,
- 5979.6883541351208,
- 5991.4161060672022,
- 6003.1495998623004,
- 6014.8888299062692,
- 6026.6337905986684,
- 6038.3844763527022,
- 6050.1408815951781,
- 6061.9030007664414,
- 6073.6708283203316,
- 6085.4443587241267,
- 6097.2235864584891,
- 6109.0085060174197,
- 6120.7991119081998,
- 6132.595398651345,
- 6144.3973607805519,
- 6156.2049928426459,
- 6168.0182893975361,
- 6179.8372450181578,
- 6191.6618542904307,
- 6203.4921118132024,
- 6215.3280121982016,
- 6227.1695500699925,
- 6239.0167200659189,
- 6250.8695168360628,
- 6262.7279350431891,
- 6274.5919693627056,
- 6286.4616144826068,
- 6298.3368651034316,
- 6310.2177159382172,
- 6322.1041617124456,
- 6333.9961971640032,
- 6345.8938170431311,
- 6357.7970161123785,
- 6369.7057891465583,
- 6381.6201309327007,
- 6393.5400362700075,
- 6405.4654999698032,
- 6417.3965168554978,
- 6429.3330817625329,
- 6441.2751895383453,
- 6453.2228350423138,
- 6465.176013145724,
- 6477.134718731716,
- 6489.0989466952469,
- 6501.0686919430445,
- 6513.0439493935628,
- 6525.0247139769417,
- 6537.010980634961,
- 6549.002744321001,
- 6560.9999999999973,
- 6573.0027426483985,
- 6585.0109672541284,
- 6597.0246688165371,
- 6609.0438423463656,
- 6621.0684828657004,
- 6633.0985854079354,
- 6645.134145017727,
- 6657.1751567509573,
- 6669.2216156746908,
- 6681.2735168671343,
- 6693.3308554176001,
- 6705.3936264264594,
- 6717.461825005108,
- 6729.535446275926,
- 6741.6144853722335,
- 6753.6989374382601,
- 6765.7887976290967,
- 6777.8840611106634,
- 6789.9847230596661,
- 6802.0907786635626,
- 6814.2022231205201,
- 6826.3190516393797,
- 6838.4412594396181,
- 6850.5688417513074,
- 6862.701793815083,
- 6874.840110882099,
- 6886.9837882139991,
- 6899.1328210828724,
- 6911.2872047712199,
- 6923.4469345719199,
- 6935.6120057881863,
- 6947.7824137335365,
- 6959.9581537317536,
- 6972.1392211168532,
- 6984.3256112330409,
- 6996.5173194346862,
- 7008.7143410862773,
- 7020.9166715623942,
- 7033.1243062476678,
- 7045.3372405367481,
- 7057.5554698342685,
- 7069.7789895548103,
- 7082.0077951228714,
- 7094.2418819728273,
- 7106.4812455489018,
- 7118.7258813051285,
- 7130.9757847053224,
- 7143.2309512230404,
- 7155.4913763415516,
- 7167.7570555538041,
- 7180.0279843623894,
- 7192.3041582795131,
- 7204.5855728269571,
- 7216.8722235360519,
- 7229.1641059476406,
- 7241.4612156120484,
- 7253.7635480890503,
- 7266.0710989478375,
- 7278.3838637669869,
- 7290.7018381344296,
- 7303.0250176474174,
- 7315.3533979124932,
- 7327.6869745454596,
- 7340.0257431713462,
- 7352.3696994243801,
- 7364.7188389479543,
- 7377.0731573945968,
- 7389.4326504259407,
- 7401.7973137126937,
- 7414.1671429346061,
- 7426.5421337804428,
- 7438.922281947951,
- 7451.3075831438346,
- 7463.6980330837177,
- 7476.0936274921214,
- 7488.4943621024304,
- 7500.9002326568652,
- 7513.3112349064522,
- 7525.7273646109943,
- 7538.1486175390446,
- 7550.5749894678729,
- 7563.0064761834419,
- 7575.4430734803736,
- 7587.8847771619248,
- 7600.3315830399597,
- 7612.7834869349153,
- 7625.24048467578,
- 7637.7025721000637,
- 7650.1697450537677,
- 7662.6419993913596,
- 7675.1193309757446,
- 7687.6017356782404,
- 7700.0892093785433,
- 7712.5817479647112,
- 7725.079347333125,
- 7737.5820033884729,
- 7750.0897120437139,
- 7762.6024692200581,
- 7775.1202708469355,
- 7787.6431128619733,
- 7800.1709912109645,
- 7812.7039018478481,
- 7825.2418407346768,
- 7837.7848038415968,
- 7850.3327871468155,
- 7862.8857866365806,
- 7875.4437983051539,
- 7888.006818154784,
- 7900.5748421956796,
- 7913.1478664459901,
- 7925.725886931772,
- 7938.3088996869719,
- 7950.8969007533951,
- 7963.4898861806851,
- 7976.0878520262959,
- 7988.6907943554688,
- 8001.2987092412086,
- 8013.911592764257,
- 8026.5294410130691,
- 8039.1522500837891,
- 8051.7800160802271,
- 8064.412735113835,
- 8077.0504033036796,
- 8089.6930167764222,
- 8102.3405716662946,
- 8114.9930641150731,
- 8127.6504902720571,
- 8140.3128462940449,
- 8152.9801283453098,
- 8165.6523325975786,
- 8178.3294552300049,
- 8191.0114924291529,
- 8203.6984403889655,
- 8216.3902953107463,
- 8229.0870534031419,
- 8241.7887108821069,
- 8254.4952639708936,
- 8267.2067089000211,
- 8279.9230419072574,
- 8292.6442592375952,
- 8305.3703571432306,
- 8318.101331883543,
- 8330.8371797250657,
- 8343.577896941475,
- 8356.3234798135582,
- 8369.0739246291978,
- 8381.8292276833508,
- 8394.5893852780209,
- 8407.3543937222421,
- 8420.1242493320569,
- 8432.8989484304948,
- 8445.6784873475499,
- 8458.4628624201578,
- 8471.2520699921806,
- 8484.0461064143838,
- 8496.8449680444082,
- 8509.6486512467636,
- 8522.4571523927953,
- 8535.270467860666,
- 8548.0885940353437,
- 8560.9115273085663,
- 8573.7392640788403,
- 8586.5718007514006,
- 8599.4091337382069,
- 8612.2512594579148,
- 8625.0981743358552,
- 8637.9498748040205,
- 8650.8063573010386,
- 8663.6676182721567,
- 8676.533654169225,
- 8689.4044614506638,
- 8702.2800365814601,
- 8715.1603760331418,
- 8728.0454762837508,
- 8740.9353338178389,
- 8753.8299451264356,
- 8766.7293067070332,
- 8779.6334150635721,
- 8792.5422667064158,
- 8805.4558581523324,
- 8818.3741859244819,
- 8831.2972465523908,
- 8844.2250365719356,
- 8857.1575525253265,
- 8870.0947909610859,
- 8883.0367484340295,
- 8895.9834215052524,
- 8908.934806742107,
- 8921.8909007181846,
- 8934.8517000132997,
- 8947.817201213471,
- 8960.7874009109,
- 8973.7622957039603,
- 8986.7418821971733,
- 8999.7261570011924,
- 9012.7151167327884,
- 9025.7087580148236,
- 9038.7070774762469,
- 9051.7100717520643,
- 9064.7177374833282,
- 9077.7300713171153,
- 9090.7470699065179,
- 9103.7687299106146,
- 9116.7950479944648,
- 9129.8260208290812,
- 9142.8616450914233,
- 9155.9019174643727,
- 9168.9468346367157,
- 9181.9963933031358,
- 9195.0505901641845,
- 9208.1094219262741,
- 9221.1728853016557,
- 9234.240977008405,
- 9247.3136937704076,
- 9260.3910323173386,
- 9273.472989384647,
- 9286.5595617135423,
- 9299.6507460509747,
- 9312.7465391496207,
- 9325.8469377678684,
- 9338.9519386698012,
- 9352.0615386251757,
- 9365.1757344094131,
- 9378.2945228035842,
- 9391.4179005943843,
- 9404.5458645741273,
- 9417.6784115407263,
- 9430.8155382976747,
- 9443.9572416540359,
- 9457.1035184244265,
- 9470.2543654290002,
- 9483.4097794934296,
- 9496.5697574488931,
- 9509.7342961320664,
- 9522.9033923850911,
- 9536.0770430555804,
- 9549.2552449965824,
- 9562.4379950665825,
- 9575.6252901294793,
- 9588.8171270545736,
- 9602.0135027165488,
- 9615.2144139954635,
- 9628.4198577767274,
- 9641.629830951093,
- 9654.844330414644,
- 9668.0633530687719,
- 9681.286895820167,
- 9694.5149555808002,
- 9707.7475292679192,
- 9720.9846138040157,
- 9734.2262061168276,
- 9747.4723031393187,
- 9760.7229018096641,
- 9773.9779990712323,
- 9787.2375918725811,
- 9800.5016771674327,
- 9813.7702519146696,
- 9827.0433130783094,
- 9840.3208576275028,
- 9853.602882536512,
- 9866.8893847846994,
- 9880.1803613565116,
- 9893.4758092414686,
- 9906.7757254341523,
- 9920.0801069341851,
- 9933.3889507462245,
- 9946.7022538799429,
- 9960.0200133500221,
- 9973.3422261761298,
- 9986.6688893829159,
- 9999.9999999999945,
- 10013.335555061929,
- 10026.675551608221,
- 10040.019986683301,
- 10053.368857336509,
- 10066.722160622081,
- 10080.079893599144,
- 10093.442053331697,
- 10106.808636888598,
- 10120.179641343551,
- 10133.555063775095,
- 10146.934901266595,
- 10160.31915090622,
- 10173.707809786936,
- 10187.100875006496,
- 10200.498343667417,
- 10213.900212876984,
- 10227.306479747222,
- 10240.717141394889,
- 10254.132194941467,
- 10267.551637513146,
- 10280.975466240814,
- 10294.40367826004,
- 10307.836270711066,
- 10321.273240738796,
- 10334.71458549278,
- 10348.160302127204,
- 10361.610387800878,
- 10375.064839677221,
- 10388.523654924258,
- 10401.986830714593,
- 10415.454364225412,
- 10428.926252638465,
- 10442.402493140049,
- 10455.883082921007,
- 10469.368019176709,
- 10482.85729910704,
- 10496.350919916393,
- 10509.848878813653,
- 10523.351173012188,
- 10536.857799729838,
- 10550.3687561889,
- 10563.884039616123,
- 10577.403647242685,
- 10590.927576304197,
- 10604.455824040679,
- 10617.988387696556,
- 10631.525264520642,
- 10645.066451766135,
- 10658.611946690598,
- 10672.161746555956,
- 10685.715848628475,
- 10699.274250178762,
- 10712.836948481747,
- 10726.403940816675,
- 10739.975224467091,
- 10753.550796720834,
- 10767.130654870027,
- 10780.714796211059,
- 10794.303218044579,
- 10807.895917675487,
- 10821.492892412922,
- 10835.094139570248,
- 10848.699656465047,
- 10862.309440419107,
- 10875.923488758415,
- 10889.541798813138,
- 10903.16436791762,
- 10916.791193410372,
- 10930.422272634056,
- 10944.05760293548,
- 10957.697181665582,
- 10971.341006179427,
- 10984.98907383619,
- 10998.641381999149,
- 11012.297928035676,
- 11025.958709317223,
- 11039.623723219316,
- 11053.292967121541,
- 11066.966438407539,
- 11080.64413446499,
- 11094.326052685608,
- 11108.012190465128,
- 11121.702545203296,
- 11135.397114303863,
- 11149.095895174571,
- 11162.798885227143,
- 11176.506081877278,
- 11190.217482544635,
- 11203.933084652828,
- 11217.652885629415,
- 11231.376882905886,
- 11245.105073917659,
- 11258.837456104062,
- 11272.574026908333,
- 11286.314783777601,
- 11300.059724162888,
- 11313.808845519083,
- 11327.562145304952,
- 11341.319620983111,
- 11355.081270020033,
- 11368.847089886023,
- 11382.617078055218,
- 11396.391232005579,
- 11410.169549218874,
- 11423.952027180676,
- 11437.738663380349,
- 11451.529455311042,
- 11465.324400469679,
- 11479.123496356951,
- 11492.926740477304,
- 11506.734130338931,
- 11520.545663453764,
- 11534.361337337466,
- 11548.181149509423,
- 11562.005097492724,
- 11575.83317881417,
- 11589.665391004253,
- 11603.501731597149,
- 11617.342198130715,
- 11631.186788146468,
- 11645.035499189589,
- 11658.888328808911,
- 11672.745274556904,
- 11686.606333989675,
- 11700.471504666955,
- 11714.340784152086,
- 11728.214170012021,
- 11742.091659817312,
- 11755.973251142101,
- 11769.858941564111,
- 11783.748728664636,
- 11797.642610028539,
- 11811.540583244237,
- 11825.442645903697,
- 11839.34879560242,
- 11853.259029939445,
- 11867.173346517333,
- 11881.091742942155,
- 11895.014216823492,
- 11908.940765774427,
- 11922.871387411526,
- 11936.806079354839,
- 11950.744839227897,
- 11964.687664657684,
- 11978.634553274653,
- 11992.585502712702,
- 12006.540510609168,
- 12020.499574604828,
- 12034.462692343877,
- 12048.429861473938,
- 12062.401079646032,
- 12076.376344514589,
- 12090.355653737433,
- 12104.339004975769,
- 12118.326395894188,
- 12132.317824160644,
- 12146.313287446457,
- 12160.312783426305,
- 12174.316309778205,
- 12188.323864183525,
- 12202.335444326955,
- 12216.351047896511,
- 12230.370672583531,
- 12244.394316082657,
- 12258.421976091831,
- 12272.453650312296,
- 12286.489336448574,
- 12300.529032208471,
- 12314.572735303058,
- 12328.620443446678,
- 12342.672154356922,
- 12356.727865754638,
- 12370.787575363909,
- 12384.851280912055,
- 12398.918980129623,
- 12412.990670750381,
- 12427.066350511306,
- 12441.146017152583,
- 12455.229668417589,
- 12469.317302052901,
- 12483.40891580827,
- 12497.50450743663,
- 12511.604074694078,
- 12525.707615339878,
- 12539.815127136444,
- 12553.926607849342,
- 12568.042055247275,
- 12582.161467102082,
- 12596.284841188726,
- 12610.41217528529,
- 12624.543467172971,
- 12638.678714636069,
- 12652.817915461985,
- 12666.961067441209,
- 12681.108168367316,
- 12695.259216036962,
- 12709.414208249869,
- 12723.573142808827,
- 12737.736017519681,
- 12751.902830191326,
- 12766.073578635704,
- 12780.248260667788,
- 12794.426874105588,
- 12808.609416770132,
- 12822.795886485468,
- 12836.986281078653,
- 12851.180598379744,
- 12865.378836221802,
- 12879.580992440871,
- 12893.787064875984,
- 12907.997051369144,
- 12922.210949765335,
- 12936.428757912496,
- 12950.650473661524,
- 12964.876094866273,
- 12979.105619383534,
- 12993.339045073039,
- 13007.576369797454,
- 13021.817591422368,
- 13036.062707816285,
- 13050.311716850629,
- 13064.564616399723,
- 13078.821404340792,
- 13093.082078553954,
- 13107.346636922217,
- 13121.615077331464,
- 13135.887397670458,
- 13150.163595830827,
- 13164.44366970706,
- 13178.727617196502,
- 13193.015436199352,
- 13207.307124618648,
- 13221.602680360265,
- 13235.902101332911,
- 13250.205385448118,
- 13264.512530620239,
- 13278.823534766434,
- 13293.138395806676,
- 13307.457111663734,
- 13321.779680263176,
- 13336.106099533356,
- 13350.436367405409,
- 13364.77048181325,
- 13379.108440693562,
- 13393.450241985796,
- 13407.795883632158,
- 13422.145363577607,
- 13436.498679769853,
- 13450.855830159346,
- 13465.216812699266,
- 13479.581625345529,
- 13493.950266056772,
- 13508.32273279435,
- 13522.699023522329,
- 13537.079136207483,
- 13551.463068819286,
- 13565.850819329906,
- 13580.2423857142,
- 13594.63776594971,
- 13609.036958016657,
- 13623.439959897927,
- 13637.846769579081,
- 13652.257385048335,
- 13666.67180429656,
- 13681.090025317284,
- 13695.512046106669,
- 13709.937864663521,
- 13724.367478989278,
- 13738.800887088004,
- 13753.238086966385,
- 13767.679076633727,
- 13782.123854101939,
- 13796.572417385545,
- 13811.024764501659,
- 13825.480893469998,
- 13839.94080231286,
- 13854.404489055134,
- 13868.871951724283,
- 13883.34318835034,
- 13897.818196965914,
- 13912.296975606168,
- 13926.779522308825,
- 13941.26583511416,
- 13955.755912064991,
- 13970.249751206682,
- 13984.747350587126,
- 13999.248708256751,
- 14013.753822268511,
- 14028.262690677873,
- 14042.775311542828,
- 14057.291682923867,
- 14071.811802883994,
- 14086.335669488704,
- 14100.863280805994,
- 14115.394634906341,
- 14129.92972986271,
- 14144.468563750548,
- 14159.01113464777,
- 14173.55744063476,
- 14188.107479794369,
- 14202.661250211901,
- 14217.218749975118,
- 14231.779977174227,
- 14246.344929901879,
- 14260.913606253163,
- 14275.486004325601,
- 14290.062122219146,
- 14304.641958036171,
- 14319.225509881464,
- 14333.812775862236,
- 14348.403754088098,
- 14362.998442671067,
- 14377.59683972556,
- 14392.198943368388,
- 14406.804751718748,
- 14421.414262898223,
- 14436.027475030774,
- 14450.64438624274,
- 14465.264994662828,
- 14479.889298422106,
- 14494.517295654005,
- 14509.148984494313,
- 14523.784363081166,
- 14538.423429555049,
- 14553.066182058781,
- 14567.712618737527,
- 14582.362737738777,
- 14597.016537212348,
- 14611.674015310382,
- 14626.33517018734,
- 14640.999999999993,
- 14655.668502907418,
- 14670.340677071003,
- 14685.016520654426,
- 14699.696031823671,
- 14714.379208746999,
- 14729.066049594967,
- 14743.756552540408,
- 14758.45071575843,
- 14773.148537426418,
- 14787.850015724018,
- 14802.555148833142,
- 14817.263934937961,
- 14831.976372224897,
- 14846.692458882624,
- 14861.41219310206,
- 14876.135573076363,
- 14890.862597000923,
- 14905.593263073371,
- 14920.327569493558,
- 14935.065514463557,
- 14949.807096187662,
- 14964.552312872382,
- 14979.301162726431,
- 14994.053643960735,
- 15008.809754788414,
- 15023.569493424788,
- 15038.332858087369,
- 15053.099846995858,
- 15067.870458372134,
- 15082.644690440264,
- 15097.422541426484,
- 15112.204009559202,
- 15126.989093068994,
- 15141.777790188597,
- 15156.570099152905,
- 15171.366018198967,
- 15186.165545565986,
- 15200.968679495301,
- 15215.775418230402,
- 15230.585760016909,
- 15245.399703102579,
- 15260.217245737298,
- 15275.038386173073,
- 15289.863122664035,
- 15304.691453466432,
- 15319.523376838621,
- 15334.358891041069,
- 15349.197994336346,
- 15364.040684989128,
- 15378.886961266177,
- 15393.736821436356,
- 15408.590263770609,
- 15423.447286541972,
- 15438.307888025554,
- 15453.172066498542,
- 15468.039820240196,
- 15482.91114753184,
- 15497.786046656869,
- 15512.664515900733,
- 15527.546553550939,
- 15542.432157897045,
- 15557.32132723066,
- 15572.214059845435,
- 15587.110354037064,
- 15602.010208103273,
- 15616.913620343823,
- 15631.820589060506,
- 15646.731112557136,
- 15661.645189139546,
- 15676.562817115593,
- 15691.483994795139,
- 15706.408720490062,
- 15721.336992514242,
- 15736.268809183561,
- 15751.204168815901,
- 15766.143069731135,
- 15781.085510251132,
- 15796.03148869974,
- 15810.981003402798,
- 15825.934052688119,
- 15840.890634885489,
- 15855.850748326673,
- 15870.814391345401,
- 15885.781562277361,
- 15900.752259460214,
- 15915.726481233565,
- 15930.704225938984,
- 15945.685491919978,
- 15960.670277522009,
- 15975.658581092481,
- 15990.65040098073,
- 16005.645735538035,
- 16020.644583117599,
- 16035.646942074556,
- 16050.652810765967,
- 16065.662187550806,
- 16080.675070789974,
- 16095.691458846273,
- 16110.711350084424,
- 16125.734742871053,
- 16140.761635574685,
- 16155.792026565747,
- 16170.825914216561,
- 16185.863296901338,
- 16200.904172996183,
- 16215.948540879079,
- 16230.996398929899,
- 16246.047745530386,
- 16261.102579064163,
- 16276.160897916721,
- 16291.22270047542,
- 16306.287985129484,
- 16321.356750269995,
- 16336.428994289896,
- 16351.504715583982,
- 16366.5839125489,
- 16381.666583583141,
- 16396.752727087041,
- 16411.842341462776,
- 16426.935425114363,
- 16442.031976447644,
- 16457.131993870298,
- 16472.235475791829,
- 16487.342420623561,
- 16502.452826778641,
- 16517.566692672033,
- 16532.684016720516,
- 16547.804797342676,
- 16562.929032958902,
- 16578.056721991394,
- 16593.18786286415,
- 16608.322454002962,
- 16623.460493835417,
- 16638.601980790896,
- 16653.746913300558,
- 16668.895289797354,
- 16684.047108716015,
- 16699.202368493046,
- 16714.361067566726,
- 16729.523204377107,
- 16744.688777366009,
- 16759.857784977012,
- 16775.030225655464,
- 16790.206097848466,
- 16805.385400004874,
- 16820.568130575302,
- 16835.754288012104,
- 16850.943870769381,
- 16866.136877302983,
- 16881.333306070494,
- 16896.53315553123,
- 16911.736424146249,
- 16926.943110378332,
- 16942.153212691992,
- 16957.366729553454,
- 16972.583659430682,
- 16987.804000793338,
- 17003.027752112816,
- 17018.254911862205,
- 17033.485478516312,
- 17048.719450551645,
- 17063.956826446421,
- 17079.197604680547,
- 17094.44178373563,
- 17109.689362094967,
- 17124.940338243552,
- 17140.194710668064,
- 17155.452477856852,
- 17170.713638299967,
- 17185.978190489128,
- 17201.246132917724,
- 17216.517464080825,
- 17231.792182475165,
- 17247.070286599141,
- 17262.351774952826,
- 17277.636646037936,
- 17292.924898357855,
- 17308.216530417623,
- 17323.511540723921,
- 17338.809927785089,
- 17354.111690111105,
- 17369.416826213594,
- 17384.725334605821,
- 17400.037213802683,
- 17415.352462320716,
- 17430.67107867809,
- 17445.993061394587,
- 17461.318408991636,
- 17476.647119992274,
- 17491.979192921168,
- 17507.314626304586,
- 17522.653418670423,
- 17537.995568548187,
- 17553.341074468986,
- 17568.689934965536,
- 17584.042148572156,
- 17599.397713824768,
- 17614.75662926089,
- 17630.118893419625,
- 17645.484504841683,
- 17660.853462069354,
- 17676.225763646511,
- 17691.601408118619,
- 17706.980394032718,
- 17722.362719937424,
- 17737.748384382936,
- 17753.137385921014,
- 17768.529723104999,
- 17783.92539448979,
- 17799.324398631856,
- 17814.726734089225,
- 17830.13239942148,
- 17845.541393189767,
- 17860.95371395678,
- 17876.369360286772,
- 17891.788330745527,
- 17907.210623900395,
- 17922.636238320254,
- 17938.065172575527,
- 17953.497425238176,
- 17968.932994881692,
- 17984.371880081104,
- 17999.814079412972,
- 18015.259591455371,
- 18030.708414787914,
- 18046.160547991731,
- 18061.615989649465,
- 18077.074738345284,
- 18092.536792664861,
- 18108.002151195393,
- 18123.470812525571,
- 18138.942775245599,
- 18154.418037947191,
- 18169.896599223546,
- 18185.37845766938,
- 18200.863611880886,
- 18216.352060455767,
- 18231.843801993204,
- 18247.338835093873,
- 18262.837158359936,
- 18278.338770395032,
- 18293.84366980429,
- 18309.351855194309,
- 18324.863325173166,
- 18340.378078350412,
- 18355.896113337069,
- 18371.417428745623,
- 18386.942023190033,
- 18402.469895285718,
- 18418.00104364955,
- 18433.53546689987,
- 18449.073163656474,
- 18464.614132540602,
- 18480.158372174956,
- 18495.705881183676,
- 18511.256658192357,
- 18526.810701828035,
- 18542.368010719183,
- 18557.928583495715,
- 18573.492418788985,
- 18589.059515231773,
- 18604.629871458303,
- 18620.203486104212,
- 18635.78035780658,
- 18651.360485203899,
- 18666.943866936086,
- 18682.53050164448,
- 18698.120387971841,
- 18713.713524562332,
- 18729.30991006154,
- 18744.909543116457,
- 18760.512422375479,
- 18776.118546488418,
- 18791.727914106479,
- 18807.340523882274,
- 18822.95637446981,
- 18838.575464524489,
- 18854.197792703111,
- 18869.823357663863,
- 18885.452158066328,
- 18901.08419257147,
- 18916.719459841639,
- 18932.357958540564,
- 18947.999687333362,
- 18963.644644886521,
- 18979.292829867907,
- 18994.944240946759,
- 19010.598876793687,
- 19026.256736080668,
- 19041.917817481048,
- 19057.582119669532,
- 19073.2496413222,
- 19088.920381116473,
- 19104.594337731145,
- 19120.271509846356,
- 19135.951896143604,
- 19151.635495305738,
- 19167.322306016948,
- 19183.012326962784,
- 19198.705556830122,
- 19214.401994307198,
- 19230.101638083579,
- 19245.804486850167,
- 19261.510539299208,
- 19277.219794124274,
- 19292.932250020265,
- 19308.647905683421,
- 19324.366759811302,
- 19340.088811102793,
- 19355.8140582581,
- 19371.542499978754,
- 19387.2741349676,
- 19403.008961928797,
- 19418.746979567823,
- 19434.488186591469,
- 19450.232581707827,
- 19465.980163626304,
- 19481.730931057613,
- 19497.484882713761,
- 19513.242017308068,
- 19529.002333555141,
- 19544.765830170898,
- 19560.532505872539,
- 19576.302359378566,
- 19592.075389408761,
- 19607.851594684209,
- 19623.630973927269,
- 19639.41352586159,
- 19655.199249212103,
- 19670.988142705017,
- 19686.780205067826,
- 19702.575435029288,
- 19718.373831319448,
- 19734.175392669615,
- 19749.980117812371,
- 19765.788005481569,
- 19781.599054412323,
- 19797.413263341008,
- 19813.230631005274,
- 19829.051156144014,
- 19844.874837497395,
- 19860.701673806827,
- 19876.531663814985,
- 19892.364806265789,
- 19908.201099904403,
- 19924.040543477258,
- 19939.883135732012,
- 19955.728875417579,
- 19971.577761284105,
- 19987.429792082985,
- 20003.284966566847,
- 20019.14328348956,
- 20035.004741606219,
- 20050.869339673161,
- 20066.737076447946,
- 20082.607950689362,
- 20098.481961157428,
- 20114.359106613385,
- 20130.239385819699,
- 20146.122797540058,
- 20162.009340539353,
- 20177.899013583716,
- 20193.791815440476,
- 20209.687744878182,
- 20225.586800666591,
- 20241.488981576669,
- 20257.394286380597,
- 20273.302713851754,
- 20289.214262764715,
- 20305.128931895277,
- 20321.046720020415,
- 20336.967625918318,
- 20352.891648368361,
- 20368.818786151114,
- 20384.749038048347,
- 20400.682402843009,
- 20416.618879319249,
- 20432.558466262391,
- 20448.501162458953,
- 20464.446966696629,
- 20480.395877764302,
- 20496.347894452025,
- 20512.303015551031,
- 20528.261239853735,
- 20544.22256615372,
- 20560.186993245738,
- 20576.15451992572,
- 20592.125144990758,
- 20608.098867239107,
- 20624.075685470198,
- 20640.055598484618,
- 20656.038605084115,
- 20672.024704071595,
- 20688.013894251126,
- 20704.006174427926,
- 20720.001543408373,
- 20735.999999999989,
- 20752.001543011454,
- 20768.006171252597,
- 20784.013883534382,
- 20800.024678668931,
- 20816.038555469506,
- 20832.055512750507,
- 20848.075549327474,
- 20864.098664017085,
- 20880.124855637161,
- 20896.154123006647,
- 20912.186464945626,
- 20928.221880275312,
- 20944.260367818049,
- 20960.301926397311,
- 20976.346554837684,
- 20992.394251964895,
- 21008.445016605787,
- 21024.498847588318,
- 21040.555743741574,
- 21056.615703895754,
- 21072.678726882168,
- 21088.744811533252,
- 21104.813956682538,
- 21120.886161164683,
- 21136.961423815443,
- 21153.039743471683,
- 21169.121118971379,
- 21185.205549153605,
- 21201.293032858535,
- 21217.383568927453,
- 21233.477156202731,
- 21249.573793527841,
- 21265.673479747358,
- 21281.776213706937,
- 21297.881994253334,
- 21313.990820234398,
- 21330.102690499054,
- 21346.21760389733,
- 21362.335559280327,
- 21378.456555500241,
- 21394.580591410333,
- 21410.707665864964,
- 21426.83777771956,
- 21442.970925830628,
- 21459.107109055756,
- 21475.246326253604,
- 21491.388576283895,
- 21507.533858007431,
- 21523.682170286087,
- 21539.833511982797,
- 21555.987881961566,
- 21572.145279087465,
- 21588.305702226615,
- 21604.469150246216,
- 21620.635622014521,
- 21636.805116400832,
- 21652.977632275521,
- 21669.153168510009,
- 21685.331723976764,
- 21701.513297549318,
- 21717.697888102244,
- 21733.885494511167,
- 21750.076115652759,
- 21766.269750404736,
- 21782.466397645861,
- 21798.666056255934,
- 21814.868725115801,
- 21831.074403107345,
- 21847.283089113484,
- 21863.494782018177,
- 21879.709480706417,
- 21895.927184064229,
- 21912.147890978667,
- 21928.371600337818,
- 21944.598311030797,
- 21960.828021947746,
- 21977.060731979829,
- 21993.296440019243,
- 22009.535144959198,
- 22025.77684569393,
- 22042.021541118691,
- 22058.269230129757,
- 22074.519911624411,
- 22090.773584500959,
- 22107.030247658717,
- 22123.289899998013,
- 22139.552540420187,
- 22155.818167827587,
- 22172.086781123569,
- 22188.358379212495,
- 22204.632960999726,
- 22220.910525391639,
- 22237.191071295601,
- 22253.474597619981,
- 22269.761103274148,
- 22286.050587168469,
- 22302.343048214312,
- 22318.638485324027,
- 22334.936897410968,
- 22351.23828338947,
- 22367.542642174871,
- 22383.849972683485,
- 22400.160273832618,
- 22416.473544540564,
- 22432.789783726603,
- 22449.108990310986,
- 22465.431163214958,
- 22481.75630136074,
- 22498.084403671528,
- 22514.415469071497,
- 22530.749496485802,
- 22547.086484840562,
- 22563.426433062879,
- 22579.769340080824,
- 22596.115204823436,
- 22612.464026220721,
- 22628.815803203655,
- 22645.170534704179,
- 22661.5282196552,
- 22677.888856990587,
- 22694.252445645168,
- 22710.618984554734,
- 22726.988472656034,
- 22743.360908886778,
- 22759.736292185622,
- 22776.114621492186,
- 22792.495895747044,
- 22808.880113891719,
- 22825.267274868678,
- 22841.657377621348,
- 22858.050421094096,
- 22874.446404232243,
- 22890.845325982053,
- 22907.247185290722,
- 22923.651981106406,
- 22940.059712378195,
- 22956.470378056114,
- 22972.883977091129,
- 22989.300508435153,
- 23005.719971041017,
- 23022.142363862498,
- 23038.567685854305,
- 23054.995935972078,
- 23071.427113172387,
- 23087.86121641273,
- 23104.298244651531,
- 23120.738196848146,
- 23137.181071962848,
- 23153.626868956846,
- 23170.075586792263,
- 23186.527224432142,
- 23202.981780840448,
- 23219.439254982066,
- 23235.899645822796,
- 23252.362952329357,
- 23268.829173469378,
- 23285.298308211408,
- 23301.770355524899,
- 23318.245314380223,
- 23334.723183748658,
- 23351.203962602387,
- 23367.687649914504,
- 23384.174244659007,
- 23400.663745810798,
- 23417.15615234568,
- 23433.651463240367,
- 23450.149677472462,
- 23466.650794020472,
- 23483.154811863806,
- 23499.661729982763,
- 23516.171547358543,
- 23532.684262973235,
- 23549.199875809823,
- 23565.718384852185,
- 23582.239789085092,
- 23598.764087494197,
- 23615.291279066041,
- 23631.821362788058,
- 23648.354337648565,
- 23664.890202636761,
- 23681.428956742733,
- 23697.970598957443,
- 23714.515128272738,
- 23731.062543681343,
- 23747.612844176863,
- 23764.166028753778,
- 23780.72209640744,
- 23797.281046134085,
- 23813.842876930816,
- 23830.407587795606,
- 23846.975177727301,
- 23863.545645725622,
- 23880.11899079115,
- 23896.695211925336,
- 23913.274308130498,
- 23929.856278409821,
- 23946.441121767348,
- 23963.028837207989,
- 23979.619423737513,
- 23996.212880362549,
- 24012.809206090584,
- 24029.408399929966,
- 24046.010460889898,
- 24062.615387980433,
- 24079.223180212492,
- 24095.833836597827,
- 24112.447356149063,
- 24129.063737879667,
- 24145.682980803951,
- 24162.305083937081,
- 24178.930046295067,
- 24195.557866894767,
- 24212.188544753884,
- 24228.822078890964,
- 24245.458468325389,
- 24262.097712077397,
- 24278.739809168052,
- 24295.384758619261,
- 24312.032559453768,
- 24328.683210695162,
- 24345.336711367858,
- 24361.993060497109,
- 24378.652257108995,
- 24395.314300230442,
- 24411.979188889192,
- 24428.646922113825,
- 24445.317498933746,
- 24461.990918379193,
- 24478.667179481225,
- 24495.346281271726,
- 24512.028222783407,
- 24528.713003049801,
- 24545.400621105266,
- 24562.091075984976,
- 24578.784366724925,
- 24595.480492361927,
- 24612.179451933614,
- 24628.881244478438,
- 24645.585869035654,
- 24662.293324645343,
- 24679.003610348394,
- 24695.716725186514,
- 24712.432668202211,
- 24729.151438438807,
- 24745.873034940436,
- 24762.597456752032,
- 24779.324702919344,
- 24796.054772488926,
- 24812.787664508123,
- 24829.5233780251,
- 24846.261912088819,
- 24863.003265749034,
- 24879.747438056307,
- 24896.494428062004,
- 24913.244234818278,
- 24929.996857378079,
- 24946.752294795166,
- 24963.510546124078,
- 24980.271610420157,
- 24997.035486739525,
- 25013.802174139113,
- 25030.571671676629,
- 25047.343978410572,
- 25064.119093400237,
- 25080.897015705697,
- 25097.677744387816,
- 25114.461278508239,
- 25131.2476171294,
- 25148.036759314517,
- 25164.828704127583,
- 25181.623450633375,
- 25198.42099789745,
- 25215.221344986145,
- 25232.024490966574,
- 25248.830434906627,
- 25265.639175874974,
- 25282.450712941049,
- 25299.265045175071,
- 25316.082171648024,
- 25332.902091431668,
- 25349.724803598532,
- 25366.550307221914,
- 25383.378601375884,
- 25400.209685135269,
- 25417.043557575678,
- 25433.880217773472,
- 25450.719664805783,
- 25467.561897750507,
- 25484.406915686297,
- 25501.254717692573,
- 25518.105302849512,
- 25534.958670238051,
- 25551.814818939893,
- 25568.67374803748,
- 25585.535456614027,
- 25602.399943753502,
- 25619.267208540619,
- 25636.137250060852,
- 25653.010067400432,
- 25669.885659646327,
- 25686.76402588627,
- 25703.645165208734,
- 25720.529076702944,
- 25737.415759458876,
- 25754.305212567244,
- 25771.197435119517,
- 25788.092426207899,
- 25804.990184925344,
- 25821.890710365547,
- 25838.794001622944,
- 25855.700057792714,
- 25872.608877970775,
- 25889.520461253778,
- 25906.434806739118,
- 25923.351913524923,
- 25940.271780710063,
- 25957.194407394138,
- 25974.11979267748,
- 25991.047935661154,
- 26007.978835446964,
- 26024.912491137442,
- 26041.848901835841,
- 26058.788066646157,
- 26075.729984673108,
- 26092.674655022136,
- 26109.622076799409,
- 26126.572249111829,
- 26143.525171067016,
- 26160.480841773315,
- 26177.43926033979,
- 26194.400425876229,
- 26211.364337493149,
- 26228.330994301767,
- 26245.30039541404,
- 26262.272539942627,
- 26279.247427000919,
- 26296.225055703002,
- 26313.205425163702,
- 26330.188534498539,
- 26347.174382823756,
- 26364.162969256304,
- 26381.154292913852,
- 26398.148352914774,
- 26415.145148378149,
- 26432.144678423778,
- 26449.146942172156,
- 26466.151938744493,
- 26483.159667262702,
- 26500.170126849403,
- 26517.183316627921,
- 26534.199235722277,
- 26551.217883257199,
- 26568.239258358124,
- 26585.263360151173,
- 26602.290187763181,
- 26619.319740321676,
- 26636.352016954883,
- 26653.387016791727,
- 26670.424738961825,
- 26687.465182595493,
- 26704.508346823739,
- 26721.554230778267,
- 26738.602833591467,
- 26755.65415439643,
- 26772.708192326929,
- 26789.764946517433,
- 26806.824416103096,
- 26823.886600219761,
- 26840.95149800396,
- 26858.019108592915,
- 26875.089431124517,
- 26892.162464737365,
- 26909.238208570721,
- 26926.316661764544,
- 26943.397823459472,
- 26960.481692796813,
- 26977.568268918571,
- 26994.657550967422,
- 27011.749538086722,
- 27028.844229420498,
- 27045.941624113464,
- 27063.041721311005,
- 27080.144520159181,
- 27097.250019804727,
- 27114.35821939505,
- 27131.469118078236,
- 27148.582715003027,
- 27165.699009318858,
- 27182.818000175819,
- 27199.939686724665,
- 27217.064068116837,
- 27234.191143504428,
- 27251.320912040203,
- 27268.453372877593,
- 27285.588525170693,
- 27302.726368074269,
- 27319.866900743735,
- 27337.010122335181,
- 27354.156032005358,
- 27371.304628911668,
- 27388.455912212183,
- 27405.609881065626,
- 27422.766534631384,
- 27439.925872069507,
- 27457.087892540683,
- 27474.252595206275,
- 27491.419979228293,
- 27508.5900437694,
- 27525.762787992917,
- 27542.93821106281,
- 27560.116312143706,
- 27577.297090400876,
- 27594.480545000242,
- 27611.666675108383,
- 27628.855479892518,
- 27646.046958520514,
- 27663.241110160889,
- 27680.437933982801,
- 27697.637429156068,
- 27714.839594851132,
- 27732.04443023909,
- 27749.251934491687,
- 27766.462106781299,
- 27783.674946280949,
- 27800.890452164302,
- 27818.108623605654,
- 27835.329459779954,
- 27852.55295986278,
- 27869.779123030345,
- 27887.007948459504,
- 27904.239435327745,
- 27921.473582813196,
- 27938.710390094613,
- 27955.949856351392,
- 27973.19198076355,
- 27990.436762511745,
- 28007.684200777272,
- 28024.934294742041,
- 28042.187043588601,
- 28059.442446500128,
- 28076.700502660427,
- 28093.961211253929,
- 28111.224571465693,
- 28128.490582481401,
- 28145.759243487362,
- 28163.030553670509,
- 28180.304512218394,
- 28197.581118319198,
- 28214.860371161725,
- 28232.14226993539,
- 28249.42681383024,
- 28266.71400203693,
- 28284.003833746745,
- 28301.296308151585,
- 28318.591424443959,
- 28335.889181817001,
- 28353.189579464462,
- 28370.492616580705,
- 28387.798292360701,
- 28405.106606000048,
- 28422.417556694945,
- 28439.731143642206,
- 28457.047366039264,
- 28474.366223084147,
- 28491.687713975512,
- 28509.011837912611,
- 28526.338594095305,
- 28543.667981724069,
- 28560.999999999982,
- 28578.334648124732,
- 28595.671925300605,
- 28613.011830730498,
- 28630.354363617909,
- 28647.699523166943,
- 28665.0473085823,
- 28682.397719069289,
- 28699.750753833818,
- 28717.10641208239,
- 28734.464693022121,
- 28751.825595860708,
- 28769.189119806462,
- 28786.55526406828,
- 28803.924027855664,
- 28821.295410378701,
- 28838.669410848088,
- 28856.046028475103,
- 28873.425262471628,
- 28890.80711205013,
- 28908.191576423673,
- 28925.578654805915,
- 28942.968346411097,
- 28960.360650454055,
- 28977.755566150216,
- 28995.153092715591,
- 29012.553229366786,
- 29029.955975320987,
- 29047.361329795975,
- 29064.769292010107,
- 29082.179861182336,
- 29099.593036532187,
- 29117.00881727978,
- 29134.427202645813,
- 29151.848191851568,
- 29169.271784118911,
- 29186.697978670283,
- 29204.126774728706,
- 29221.55817151779,
- 29238.992168261717,
- 29256.42876418525,
- 29273.867958513725,
- 29291.309750473058,
- 29308.754139289747,
- 29326.201124190855,
- 29343.65070440403,
- 29361.102879157483,
- 29378.557647680012,
- 29396.015009200975,
- 29413.474962950309,
- 29430.937508158524,
- 29448.402644056692,
- 29465.870369876469,
- 29483.340684850071,
- 29500.81358821028,
- 29518.289079190454,
- 29535.767157024511,
- 29553.247820946945,
- 29570.731070192807,
- 29588.216903997723,
- 29605.70532159787,
- 29623.19632223,
- 29640.689905131429,
- 29658.186069540028,
- 29675.684814694236,
- 29693.186139833047,
- 29710.690044196028,
- 29728.196527023298,
- 29745.705587555527,
- 29763.217225033964,
- 29780.731438700397,
- 29798.248227797183,
- 29815.76759156723,
- 29833.289529254005,
- 29850.81404010153,
- 29868.341123354381,
- 29885.870778257693,
- 29903.403004057145,
- 29920.937799998974,
- 29938.475165329975,
- 29956.015099297485,
- 29973.557601149394,
- 29991.102670134147,
- 30008.650305500738,
- 30026.200506498706,
- 30043.753272378144,
- 30061.308602389683,
- 30078.866495784507,
- 30096.426951814352,
- 30113.989969731494,
- 30131.55554878875,
- 30149.123688239491,
- 30166.694387337629,
- 30184.267645337608,
- 30201.843461494434,
- 30219.42183506364,
- 30237.002765301309,
- 30254.586251464058,
- 30272.172292809046,
- 30289.760888593977,
- 30307.35203807709,
- 30324.94574051716,
- 30342.541995173502,
- 30360.140801305966,
- 30377.742158174944,
- 30395.346065041358,
- 30412.952521166666,
- 30430.561525812864,
- 30448.173078242475,
- 30465.787177718561,
- 30483.403823504719,
- 30501.02301486507,
- 30518.644751064272,
- 30536.269031367516,
- 30553.895855040515,
- 30571.525221349519,
- 30589.157129561307,
- 30606.791578943175,
- 30624.428568762964,
- 30642.06809828903,
- 30659.710166790261,
- 30677.35477353607,
- 30695.001917796391,
- 30712.651598841687,
- 30730.303815942945,
- 30747.958568371676,
- 30765.615855399912,
- 30783.275676300211,
- 30800.938030345646,
- 30818.602916809814,
- 30836.270334966837,
- 30853.940284091354,
- 30871.612763458521,
- 30889.287772344011,
- 30906.965310024025,
- 30924.645375775272,
- 30942.327968874983,
- 30960.013088600903,
- 30977.700734231294,
- 30995.390905044929,
- 31013.083600321101,
- 31030.778819339619,
- 31048.476561380798,
- 31066.17682572547,
- 31083.879611654978,
- 31101.584918451179,
- 31119.29274539644,
- 31137.003091773637,
- 31154.715956866155,
- 31172.431339957893,
- 31190.14924033326,
- 31207.869657277162,
- 31225.592590075023,
- 31243.318038012771,
- 31261.046000376838,
- 31278.776476454172,
- 31296.50946553221,
- 31314.24496689891,
- 31331.98297984272,
- 31349.7235036526,
- 31367.466537618013,
- 31385.212081028923,
- 31402.960133175795,
- 31420.710693349596,
- 31438.463760841791,
- 31456.219334944351,
- 31473.977414949743,
- 31491.738000150934,
- 31509.501089841389,
- 31527.266683315069,
- 31545.034779866437,
- 31562.80537879045,
- 31580.578479382562,
- 31598.35408093872,
- 31616.132182755369,
- 31633.91278412945,
- 31651.695884358396,
- 31669.481482740131,
- 31687.269578573076,
- 31705.060171156143,
- 31722.853259788735,
- 31740.648843770748,
- 31758.446922402567,
- 31776.247494985066,
- 31794.050560819614,
- 31811.85611920806,
- 31829.664169452753,
- 31847.474710856521,
- 31865.287742722685,
- 31883.103264355046,
- 31900.921275057899,
- 31918.741774136019,
- 31936.564760894671,
- 31954.390234639599,
- 31972.21819467704,
- 31990.048640313704,
- 32007.881570856793,
- 32025.716985613984,
- 32043.554883893445,
- 32061.395265003815,
- 32079.238128254223,
- 32097.083472954269,
- 32114.931298414049,
- 32132.781603944117,
- 32150.634388855524,
- 32168.48965245979,
- 32186.347394068915,
- 32204.207612995371,
- 32222.07030855212,
- 32239.935480052583,
- 32257.803126810672,
- 32275.673248140767,
- 32293.545843357719,
- 32311.420911776862,
- 32329.298452713996,
- 32347.178465485395,
- 32365.060949407813,
- 32382.945903798463,
- 32400.83332797504,
- 32418.723221255706,
- 32436.615582959093,
- 32454.510412404306,
- 32472.407708910916,
- 32490.307471798966,
- 32508.209700388961,
- 32526.114394001877,
- 32544.021551959166,
- 32561.931173582732,
- 32579.843258194956,
- 32597.757805118679,
- 32615.674813677211,
- 32633.594283194328,
- 32651.516212994258,
- 32669.440602401712,
- 32687.367450741847,
- 32705.296757340297,
- 32723.228521523146,
- 32741.162742616943,
- 32759.099419948703,
- 32777.038552845901,
- 32794.980140636464,
- 32812.924182648792,
- 32830.87067821173,
- 32848.819626654593,
- 32866.77102730715,
- 32884.724879499619,
- 32902.681182562686,
- 32920.639935827494,
- 32938.601138625643,
- 32956.56479028918,
- 32974.530890150607,
- 32992.499437542894,
- 33010.470431799447,
- 33028.443872254145,
- 33046.419758241311,
- 33064.39808909571,
- 33082.378864152583,
- 33100.36208274759,
- 33118.347744216881,
- 33136.335847897026,
- 33154.326393125062,
- 33172.31937923847,
- 33190.314805575174,
- 33208.312671473555,
- 33226.312976272442,
- 33244.315719311111,
- 33262.320899929284,
- 33280.328517467125,
- 33298.33857126526,
- 33316.351060664747,
- 33334.365985007091,
- 33352.383343634239,
- 33370.403135888591,
- 33388.42536111299,
- 33406.450018650721,
- 33424.477107845501,
- 33442.506628041512,
- 33460.53857858335,
- 33478.572958816083,
- 33496.609768085189,
- 33514.649005736617,
- 33532.690671116739,
- 33550.734763572356,
- 33568.781282450735,
- 33586.830227099563,
- 33604.881596866973,
- 33622.935391101528,
- 33640.991609152239,
- 33659.050250368542,
- 33677.111314100322,
- 33695.174799697881,
- 33713.240706511984,
- 33731.309033893805,
- 33749.37978119497,
- 33767.452947767531,
- 33785.528532963974,
- 33803.606536137209,
- 33821.686956640602,
- 33839.769793827938,
- 33857.855047053425,
- 33875.942715671707,
- 33894.032799037872,
- 33912.125296507431,
- 33930.220207436316,
- 33948.317531180888,
- 33966.417267097961,
- 33984.519414544746,
- 34002.623972878901,
- 34020.730941458511,
- 34038.840319642077,
- 34056.952106788536,
- 34075.066302257255,
- 34093.182905408015,
- 34111.301915601027,
- 34129.42333219693,
- 34147.547154556785,
- 34165.673382042078,
- 34183.80201401472,
- 34201.933049837033,
- 34220.06648887178,
- 34238.202330482141,
- 34256.340574031703,
- 34274.481218884495,
- 34292.624264404949,
- 34310.769709957938,
- 34328.91755490873,
- 34347.067798623029,
- 34365.220440466954,
- 34383.375479807051,
- 34401.532916010263,
- 34419.692748443973,
- 34437.854976475966,
- 34456.01959947445,
- 34474.18661680806,
- 34492.356027845817,
- 34510.527831957188,
- 34528.702028512052,
- 34546.878616880676,
- 34565.05759643377,
- 34583.238966542449,
- 34601.422726578232,
- 34619.608875913065,
- 34637.797413919296,
- 34655.988339969692,
- 34674.181653437423,
- 34692.37735369608,
- 34710.575440119668,
- 34728.775912082579,
- 34746.978768959649,
- 34765.184010126082,
- 34783.391634957537,
- 34801.60164283005,
- 34819.814033120063,
- 34838.028805204456,
- 34856.24595846048,
- 34874.465492265823,
- 34892.687405998557,
- 34910.911699037177,
- 34929.138370760564,
- 34947.367420548027,
- 34965.598847779271,
- 34983.832651834389,
- 35002.068832093908,
- 35020.307387938738,
- 35038.548318750189,
- 35056.79162390998,
- 35075.03730280025,
- 35093.285354803513,
- 35111.535779302685,
- 35129.788575681116,
- 35148.043743322516,
- 35166.301281611013,
- 35184.561189931141,
- 35202.823467667826,
- 35221.088114206388,
- 35239.355128932555,
- 35257.624511232447,
- 35275.896260492584,
- 35294.170376099886,
- 35312.446857441668,
- 35330.725703905628,
- 35349.006914879887,
- 35367.290489752944,
- 35385.576427913686,
- 35403.864728751418,
- 35422.155391655811,
- 35440.448416016967,
- 35458.743801225341,
- 35477.041546671804,
- 35495.341651747622,
- 35513.644115844436,
- 35531.948938354304,
- 35550.256118669655,
- 35568.565656183309,
- 35586.877550288496,
- 35605.191800378816,
- 35623.508405848268,
- 35641.827366091238,
- 35660.148680502505,
- 35678.472348477233,
- 35696.798369410979,
- 35715.126742699678,
- 35733.457467739659,
- 35751.790543927644,
- 35770.125970660738,
- 35788.46374733642,
- 35806.803873352568,
- 35825.146348107453,
- 35843.49117099971,
- 35861.838341428367,
- 35880.187858792851,
- 35898.539722492955,
- 35916.893931928862,
- 35935.250486501129,
- 35953.609385610718,
- 35971.970628658957,
- 35990.334215047558,
- 36008.700144178612,
- 36027.068415454596,
- 36045.439028278372,
- 36063.811982053165,
- 36082.187276182609,
- 36100.564910070694,
- 36118.944883121789,
- 36137.327194740654,
- 36155.711844332429,
- 36174.098831302617,
- 36192.488155057115,
- 36210.87981500219,
- 36229.273810544473,
- 36247.670141091003,
- 36266.068806049167,
- 36284.469804826738,
- 36302.873136831862,
- 36321.278801473069,
- 36339.686798159251,
- 36358.097126299683,
- 36376.509785304013,
- 36394.924774582258,
- 36413.342093544816,
- 36431.761741602444,
- 36450.183718166292,
- 36468.608022647859,
- 36487.034654459028,
- 36505.463613012063,
- 36523.894897719583,
- 36542.328507994578,
- 36560.764443250409,
- 36579.202702900831,
- 36597.643286359926,
- 36616.086193042182,
- 36634.531422362437,
- 36652.978973735895,
- 36671.428846578143,
- 36689.881040305125,
- 36708.335554333149,
- 36726.792388078902,
- 36745.251540959427,
- 36763.713012392138,
- 36782.176801794812,
- 36800.642908585593,
- 36819.111332182983,
- 36837.582072005869,
- 36856.055127473483,
- 36874.530498005421,
- 36893.008183021651,
- 36911.488181942506,
- 36929.970494188674,
- 36948.455119181206,
- 36966.942056341519,
- 36985.431305091392,
- 37003.922864852961,
- 37022.416735048733,
- 37040.912915101559,
- 37059.411404434657,
- 37077.91220247162,
- 37096.415308636388,
- 37114.920722353243,
- 37133.428443046862,
- 37151.938470142253,
- 37170.450803064785,
- 37188.965441240209,
- 37207.482384094597,
- 37226.001631054402,
- 37244.523181546429,
- 37263.047034997842,
- 37281.573190836149,
- 37300.101648489224,
- 37318.632407385296,
- 37337.165466952945,
- 37355.700826621112,
- 37374.238485819085,
- 37392.778443976509,
- 37411.320700523385,
- 37429.865254890057,
- 37448.412106507232,
- 37466.961254805974,
- 37485.512699217681,
- 37504.066439174116,
- 37522.622474107404,
- 37541.180803449992,
- 37559.741426634704,
- 37578.304343094693,
- 37596.869552263488,
- 37615.43705357494,
- 37634.006846463279,
- 37652.578930363044,
- 37671.153304709165,
- 37689.729968936896,
- 37708.308922481847,
- 37726.890164779965,
- 37745.473695267559,
- 37764.059513381275,
- 37782.647618558112,
- 37801.238010235415,
- 37819.830687850859,
- 37838.425650842495,
- 37857.022898648691,
- 37875.622430708172,
- 37894.224246460013,
- 37912.828345343616,
- 37931.434726798747,
- 37950.043390265506,
- 37968.654335184328,
- 37987.267560995999,
- 38005.883067141665,
- 38024.500853062775,
- 38043.120918201159,
- 38061.743261998963,
- 38080.367883898682,
- 38098.994783343158,
- 38117.623959775563,
- 38136.255412639417,
- 38154.889141378575,
- 38173.525145437234,
- 38192.163424259939,
- 38210.803977291551,
- 38229.446803977284,
- 38248.091903762703,
- 38266.739276093685,
- 38285.388920416466,
- 38304.040836177606,
- 38322.695022824002,
- 38341.351479802899,
- 38360.010206561863,
- 38378.671202548816,
- 38397.334467211993,
- 38415.999999999978,
- 38434.667800361683,
- 38453.33786774637,
- 38472.010201603611,
- 38490.684801383337,
- 38509.361666535784,
- 38528.040796511552,
- 38546.722190761553,
- 38565.405848737035,
- 38584.091769889594,
- 38602.779953671132,
- 38621.470399533908,
- 38640.163106930493,
- 38658.858075313794,
- 38677.555304137059,
- 38696.254792853862,
- 38714.956540918094,
- 38733.660547783991,
- 38752.366812906112,
- 38771.075335739348,
- 38789.78611573892,
- 38808.499152360368,
- 38827.214445059573,
- 38845.931993292739,
- 38864.651796516388,
- 38883.373854187383,
- 38902.098165762916,
- 38920.824730700486,
- 38939.553548457938,
- 38958.284618493431,
- 38977.017940265461,
- 38995.753513232834,
- 39014.491336854699,
- 39033.231410590517,
- 39051.973733900079,
- 39070.718306243485,
- 39089.465127081188,
- 39108.214195873945,
- 39126.965512082832,
- 39145.719075169261,
- 39164.474884594965,
- 39183.232939821988,
- 39201.99324031271,
- 39220.755785529815,
- 39239.52057493633,
- 39258.287607995589,
- 39277.056884171245,
- 39295.828402927284,
- 39314.602163728006,
- 39333.378166038019,
- 39352.15640932227,
- 39370.936893046004,
- 39389.719616674811,
- 39408.504579674584,
- 39427.291781511522,
- 39446.081221652174,
- 39464.872899563372,
- 39483.666814712291,
- 39502.462966566411,
- 39521.261354593538,
- 39540.06197826178,
- 39558.864837039568,
- 39577.669930395656,
- 39596.47725779911,
- 39615.286818719302,
- 39634.098612625923,
- 39652.912638988993,
- 39671.728897278823,
- 39690.547386966064,
- 39709.368107521652,
- 39728.191058416858,
- 39747.016239123259,
- 39765.84364911275,
- 39784.673287857528,
- 39803.505154830105,
- 39822.339249503319,
- 39841.175571350293,
- 39860.014119844491,
- 39878.854894459677,
- 39897.697894669909,
- 39916.54311994958,
- 39935.390569773372,
- 39954.240243616303,
- 39973.092140953675,
- 39991.946261261117,
- 40010.802604014549,
- 40029.661168690225,
- 40048.521954764678,
- 40067.384961714779,
- 40086.250189017679,
- 40105.117636150855,
- 40123.98730259209,
- 40142.859187819471,
- 40161.733291311379,
- 40180.609612546526,
- 40199.488151003912,
- 40218.368906162854,
- 40237.25187750296,
- 40256.137064504153,
- 40275.024466646668,
- 40293.914083411029,
- 40312.805914278084,
- 40331.699958728961,
- 40350.596216245103,
- 40369.494686308273,
- 40388.39536840051,
- 40407.298262004173,
- 40426.20336660192,
- 40445.110681676706,
- 40464.020206711793,
- 40482.931941190756,
- 40501.845884597446,
- 40520.762036416032,
- 40539.680396130985,
- 40558.600963227072,
- 40577.523737189367,
- 40596.448717503234,
- 40615.375903654342,
- 40634.305295128659,
- 40653.236891412453,
- 40672.170691992294,
- 40691.106696355047,
- 40710.044903987873,
- 40728.985314378238,
- 40747.927927013901,
- 40766.872741382918,
- 40785.819756973651,
- 40804.768973274746,
- 40823.720389775161,
- 40842.674005964131,
- 40861.629821331211,
- 40880.587835366234,
- 40899.548047559321,
- 40918.510457400931,
- 40937.475064381761,
- 40956.441867992849,
- 40975.410867725499,
- 40994.382063071331,
- 41013.355453522236,
- 41032.331038570417,
- 41051.308817708363,
- 41070.288790428858,
- 41089.270956224987,
- 41108.255314590111,
- 41127.241865017888,
- 41146.23060700229,
- 41165.221540037543,
- 41184.214663618193,
- 41203.209977239079,
- 41222.207480395307,
- 41241.207172582297,
- 41260.209053295752,
- 41279.213122031659,
- 41298.219378286303,
- 41317.227821556255,
- 41336.23845133838,
- 41355.251267129832,
- 41374.266268428037,
- 41393.283454730743,
- 41412.302825535953,
- 41431.324380341983,
- 41450.348118647416,
- 41469.374039951144,
- 41488.402143752326,
- 41507.432429550427,
- 41526.464896845187,
- 41545.499545136627,
- 41564.536373925075,
- 41583.575382711126,
- 41602.616570995662,
- 41621.659938279874,
- 41640.705484065205,
- 41659.753207853406,
- 41678.803109146495,
- 41697.855187446803,
- 41716.909442256911,
- 41735.965873079709,
- 41755.02447941836,
- 41774.085260776315,
- 41793.148216657297,
- 41812.213346565331,
- 41831.280650004708,
- 41850.350126480014,
- 41869.421775496106,
- 41888.495596558132,
- 41907.571589171515,
- 41926.649752841957,
- 41945.730087075463,
- 41964.812591378286,
- 41983.897265256979,
- 42002.984108218378,
- 42022.073119769593,
- 42041.164299418015,
- 42060.257646671307,
- 42079.353161037419,
- 42098.450842024591,
- 42117.550689141324,
- 42136.652701896404,
- 42155.756879798893,
- 42174.863222358137,
- 42193.971729083758,
- 42213.082399485655,
- 42232.195233074002,
- 42251.310229359246,
- 42270.427387852127,
- 42289.546708063644,
- 42308.668189505079,
- 42327.791831687995,
- 42346.917634124227,
- 42366.045596325886,
- 42385.175717805352,
- 42404.307998075295,
- 42423.442436648642,
- 42442.579033038608,
- 42461.717786758672,
- 42480.858697322597,
- 42500.001764244422,
- 42519.146987038446,
- 42538.294365219248,
- 42557.443898301688,
- 42576.595585800882,
- 42595.749427232236,
- 42614.90542211142,
- 42634.063569954378,
- 42653.223870277317,
- 42672.386322596729,
- 42691.55092642938,
- 42710.717681292292,
- 42729.886586702756,
- 42749.057642178363,
- 42768.23084723694,
- 42787.406201396603,
- 42806.58370417574,
- 42825.76335509299,
- 42844.945153667286,
- 42864.129099417805,
- 42883.315191864014,
- 42902.503430525649,
- 42921.693814922692,
- 42940.88634457541,
- 42960.081019004348,
- 42979.277837730297,
- 42998.476800274322,
- 43017.677906157769,
- 43036.881154902228,
- 43056.086546029583,
- 43075.294079061961,
- 43094.503753521763,
- 43113.715568931671,
- 43132.929524814601,
- 43152.145620693766,
- 43171.363856092619,
- 43190.584230534907,
- 43209.806743544621,
- 43229.031394646016,
- 43248.258183363621,
- 43267.487109222224,
- 43286.718171746885,
- 43305.951370462906,
- 43325.186704895881,
- 43344.42417457165,
- 43363.663779016322,
- 43382.905517756262,
- 43402.149390318104,
- 43421.395396228749,
- 43440.643535015348,
- 43459.89380620532,
- 43479.146209326354,
- 43498.400743906379,
- 43517.657409473606,
- 43536.916205556496,
- 43556.177131683784,
- 43575.44018738444,
- 43594.705372187724,
- 43613.972685623135,
- 43633.242127220445,
- 43652.513696509668,
- 43671.787393021099,
- 43691.063216285271,
- 43710.341165833001,
- 43729.621241195346,
- 43748.903441903625,
- 43768.187767489413,
- 43787.474217484552,
- 43806.762791421126,
- 43826.053488831501,
- 43845.346309248278,
- 43864.641252204325,
- 43883.938317232765,
- 43903.237503866971,
- 43922.538811640596,
- 43941.842240087513,
- 43961.147788741881,
- 43980.455457138101,
- 43999.765244810835,
- 44019.077151295001,
- 44038.391176125755,
- 44057.70731883854,
- 44077.02557896902,
- 44096.345956053141,
- 44115.668449627083,
- 44134.993059227287,
- 44154.319784390456,
- 44173.648624653535,
- 44192.979579553728,
- 44212.312648628489,
- 44231.647831415532,
- 44250.985127452805,
- 44270.324536278538,
- 44289.666057431183,
- 44309.009690449464,
- 44328.355434872348,
- 44347.703290239064,
- 44367.053256089079,
- 44386.405331962109,
- 44405.759517398139,
- 44425.115811937387,
- 44444.474215120332,
- 44463.834726487694,
- 44483.197345580462,
- 44502.562071939843,
- 44521.928905107328,
- 44541.297844624634,
- 44560.668890033732,
- 44580.042040876848,
- 44599.417296696454,
- 44618.794657035272,
- 44638.174121436256,
- 44657.555689442641,
- 44676.939360597877,
- 44696.325134445673,
- 44715.713010530002,
- 44735.102988395054,
- 44754.495067585296,
- 44773.88924764542,
- 44793.285528120374,
- 44812.683908555344,
- 44832.084388495779,
- 44851.486967487363,
- 44870.891645076015,
- 44890.298420807922,
- 44909.707294229491,
- 44929.118264887409,
- 44948.531332328566,
- 44967.946496100136,
- 44987.363755749502,
- 45006.783110824319,
- 45026.204560872473,
- 45045.628105442098,
- 45065.053744081561,
- 45084.48147633949,
- 45103.911301764747,
- 45123.343219906426,
- 45142.777230313885,
- 45162.21333253671,
- 45181.651526124733,
- 45201.091810628037,
- 45220.534185596924,
- 45239.978650581965,
- 45259.425205133957,
- 45278.873848803938,
- 45298.324581143192,
- 45317.777401703235,
- 45337.232310035848,
- 45356.68930569302,
- 45376.148388226997,
- 45395.60955719027,
- 45415.072812135557,
- 45434.538152615823,
- 45454.005578184282,
- 45473.475088394356,
- 45492.946682799746,
- 45512.420360954362,
- 45531.896122412363,
- 45551.373966728155,
- 45570.853893456362,
- 45590.33590215187,
- 45609.819992369776,
- 45629.306163665438,
- 45648.794415594442,
- 45668.284747712612,
- 45687.777159576006,
- 45707.27165074092,
- 45726.768220763894,
- 45746.266869201696,
- 45765.767595611323,
- 45785.270399550034,
- 45804.775280575297,
- 45824.282238244828,
- 45843.79127211657,
- 45863.302381748719,
- 45882.815566699683,
- 45902.33082652813,
- 45921.848160792935,
- 45941.367569053225,
- 45960.889050868354,
- 45980.41260579793,
- 45999.938233401757,
- 46019.465933239902,
- 46038.995704872657,
- 46058.527547860547,
- 46078.06146176433,
- 46097.597446144995,
- 46117.135500563774,
- 46136.675624582109,
- 46156.217817761702,
- 46175.762079664462,
- 46195.308409852543,
- 46214.856807888333,
- 46234.407273334444,
- 46253.959805753715,
- 46273.51440470924,
- 46293.071069764315,
- 46312.629800482478,
- 46332.190596427499,
- 46351.753457163381,
- 46371.318382254351,
- 46390.885371264863,
- 46410.45442375962,
- 46430.025539303526,
- 46449.598717461733,
- 46469.17395779962,
- 46488.751259882782,
- 46508.33062327707,
- 46527.912047548532,
- 46547.495532263471,
- 46567.081076988397,
- 46586.668681290059,
- 46606.258344735434,
- 46625.850066891719,
- 46645.443847326351,
- 46665.039685606986,
- 46684.637581301497,
- 46704.237533978005,
- 46723.839543204842,
- 46743.443608550573,
- 46763.049729583989,
- 46782.657905874104,
- 46802.268136990162,
- 46821.880422501628,
- 46841.494761978196,
- 46861.111154989776,
- 46880.729601106526,
- 46900.350099898795,
- 46919.97265093719,
- 46939.597253792526,
- 46959.223908035841,
- 46978.852613238392,
- 46998.483368971691,
- 47018.11617480743,
- 47037.751030317551,
- 47057.387935074221,
- 47077.026888649809,
- 47096.66789061694,
- 47116.310940548428,
- 47135.956038017328,
- 47155.603182596918,
- 47175.252373860698,
- 47194.903611382375,
- 47214.556894735892,
- 47234.212223495422,
- 47253.869597235338,
- 47273.52901553025,
- 47293.19047795498,
- 47312.853984084577,
- 47332.519533494306,
- 47352.187125759658,
- 47371.856760456343,
- 47391.528437160297,
- 47411.202155447652,
- 47430.877914894787,
- 47450.555715078299,
- 47470.235555574982,
- 47489.917435961863,
- 47509.601355816201,
- 47529.287314715453,
- 47548.975312237308,
- 47568.665347959672,
- 47588.357421460656,
- 47608.051532318605,
- 47627.747680112072,
- 47647.445864419846,
- 47667.14608482091,
- 47686.848340894474,
- 47706.552632219973,
- 47726.258958377046,
- 47745.967318945557,
- 47765.677713505589,
- 47785.390141637428,
- 47805.104602921601,
- 47824.821096938824,
- 47844.539623270044,
- 47864.260181496429,
- 47883.982771199349,
- 47903.707391960394,
- 47923.434043361369,
- 47943.162724984308,
- 47962.893436411439,
- 47982.626177225218,
- 48002.36094700831,
- 48022.097745343599,
- 48041.836571814172,
- 48061.57742600335,
- 48081.32030749465,
- 48101.065215871815,
- 48120.81215071879,
- 48140.56111161974,
- 48160.312098159047,
- 48180.065109921306,
- 48199.820146491307,
- 48219.577207454073,
- 48239.336292394844,
- 48259.097400899045,
- 48278.860532552339,
- 48298.625686940592,
- 48318.392863649875,
- 48338.162062266485,
- 48357.933282376915,
- 48377.706523567889,
- 48397.481785426316,
- 48417.259067539344,
- 48437.038369494308,
- 48456.819690878765,
- 48476.603031280487,
- 48496.388390287451,
- 48516.175767487839,
- 48535.965162470042,
- 48555.756574822684,
- 48575.550004134566,
- 48595.345449994718,
- 48615.142911992378,
- 48634.942389716991,
- 48654.743882758201,
- 48674.547390705877,
- 48694.352913150084,
- 48714.160449681112,
- 48733.969999889443,
- 48753.781563365759,
- 48773.595139700978,
- 48793.410728486211,
- 48813.228329312769,
- 48833.047941772187,
- 48852.869565456189,
- 48872.693199956717,
- 48892.518844865925,
- 48912.346499776155,
- 48932.176164279976,
- 48952.007837970152,
- 48971.841520439666,
- 48991.677211281676,
- 49011.514910089587,
- 49031.354616456978,
- 49051.196329977654,
- 49071.04005024561,
- 49090.885776855059,
- 49110.733509400408,
- 49130.583247476279,
- 49150.434990677488,
- 49170.288738599062,
- 49190.144490836232,
- 49210.002246984441,
- 49229.86200663932,
- 49249.723769396718,
- 49269.587534852675,
- 49289.453302603448,
- 49309.32107224549,
- 49329.190843375451,
- 49349.062615590192,
- 49368.936388486785,
- 49388.812161662492,
- 49408.689934714785,
- 49428.569707241324,
- 49448.45147883999,
- 49468.335249108866,
- 49488.22101764621,
- 49508.108784050521,
- 49527.99854792047,
- 49547.890308854934,
- 49567.784066453009,
- 49587.679820313977,
- 49607.57757003732,
- 49627.477315222721,
- 49647.379055470075,
- 49667.28279037946,
- 49687.188519551179,
- 49707.096242585707,
- 49727.005959083741,
- 49746.917668646165,
- 49766.831370874068,
- 49786.747065368734,
- 49806.66475173166,
- 49826.584429564515,
- 49846.506098469203,
- 49866.429758047794,
- 49886.355407902578,
- 49906.283047636032,
- 49926.212676850846,
- 49946.144295149883,
- 49966.077902136225,
- 49986.013497413151,
- 50005.951080584135,
- 50025.890651252834,
- 50045.832209023123,
- 50065.775753499074,
- 50085.721284284933,
- 50105.668800985164,
- 50125.618303204428,
- 50145.569790547575,
- 50165.523262619652,
- 50185.478719025901,
- 50205.436159371769,
- 50225.395583262893,
- 50245.356990305103,
- 50265.320380104429,
- 50285.285752267104,
- 50305.253106399534,
- 50325.222442108337,
- 50345.193759000336,
- 50365.16705668252,
- 50385.142334762102,
- 50405.119592846473,
- 50425.098830543218,
- 50445.080047460127,
- 50465.063243205179,
- 50485.048417386541,
- 50505.035569612577,
- 50525.024699491856,
- 50545.015806633128,
- 50565.008890645338,
- 50585.003951137631,
- 50605.00098771933,
- 50624.999999999971,
- 50645.000987589265,
- 50665.003950097132,
- 50685.008887133677,
- 50705.015798309192,
- 50725.024683234165,
- 50745.035541519283,
- 50765.048372775411,
- 50785.063176613621,
- 50805.079952645159,
- 50825.098700481489,
- 50845.119419734241,
- 50865.142110015244,
- 50885.166770936521,
- 50905.193402110279,
- 50925.222003148934,
- 50945.252573665071,
- 50965.285113271471,
- 50985.319621581119,
- 51005.356098207172,
- 51025.394542762981,
- 51045.434954862096,
- 51065.477334118244,
- 51085.521680145357,
- 51105.567992557546,
- 51125.616270969113,
- 51145.66651499454,
- 51165.718724248516,
- 51185.772898345916,
- 51205.829036901778,
- 51225.887139531362,
- 51245.947205850105,
- 51266.009235473619,
- 51286.073228017718,
- 51306.139183098399,
- 51326.207100331856,
- 51346.276979334456,
- 51366.348819722756,
- 51386.42262111351,
- 51406.498383123653,
- 51426.57610537031,
- 51446.655787470787,
- 51466.737429042587,
- 51486.82102970338,
- 51506.906589071048,
- 51526.994106763632,
- 51547.083582399391,
- 51567.175015596738,
- 51587.268405974297,
- 51607.363753150858,
- 51627.461056745415,
- 51647.56031637713,
- 51667.661531665362,
- 51687.764702229651,
- 51707.869827689727,
- 51727.976907665499,
- 51748.085941777055,
- 51768.196929644677,
- 51788.309870888836,
- 51808.42476513017,
- 51828.541611989524,
- 51848.660411087905,
- 51868.781162046515,
- 51888.90386448674,
- 51909.028518030143,
- 51929.155122298485,
- 51949.283676913685,
- 51969.414181497872,
- 51989.546635673345,
- 52009.681039062583,
- 52029.817391288263,
- 52049.955691973213,
- 52070.095940740481,
- 52090.238137213273,
- 52110.382281014987,
- 52130.5283717692,
- 52150.676409099666,
- 52170.826392630333,
- 52190.97832198532,
- 52211.132196788931,
- 52231.288016665654,
- 52251.445781240145,
- 52271.60549013727,
- 52291.76714298204,
- 52311.930739399664,
- 52332.096279015546,
- 52352.263761455244,
- 52372.433186344519,
- 52392.604553309284,
- 52412.777861975665,
- 52432.953111969946,
- 52453.130302918595,
- 52473.309434448267,
- 52493.490506185793,
- 52513.67351775818,
- 52533.858468792605,
- 52554.045358916446,
- 52574.234187757254,
- 52594.42495494274,
- 52614.617660100812,
- 52634.812302859558,
- 52655.008882847229,
- 52675.20739969227,
- 52695.407853023295,
- 52715.610242469098,
- 52735.814567658657,
- 52756.02082822111,
- 52776.229023785803,
- 52796.439153982225,
- 52816.651218440056,
- 52836.865216789171,
- 52857.081148659599,
- 52877.29901368155,
- 52897.518811485425,
- 52917.740541701773,
- 52937.964203961354,
- 52958.18979789508,
- 52978.417323134046,
- 52998.646779309529,
- 53018.878166052978,
- 53039.111482996006,
- 53059.346729770419,
- 53079.583906008193,
- 53099.823011341483,
- 53120.0640454026,
- 53140.307007824063,
- 53160.551898238533,
- 53180.79871627887,
- 53201.047461578091,
- 53221.2981337694,
- 53241.550732486176,
- 53261.805257361964,
- 53282.061708030487,
- 53302.32008412564,
- 53322.580385281493,
- 53342.842611132299,
- 53363.106761312469,
- 53383.372835456597,
- 53403.640833199453,
- 53423.910754175973,
- 53444.18259802126,
- 53464.456364370613,
- 53484.732052859479,
- 53505.009663123499,
- 53525.289194798468,
- 53545.570647520362,
- 53565.854020925333,
- 53586.139314649699,
- 53606.426528329954,
- 53626.715661602764,
- 53647.006714104959,
- 53667.299685473547,
- 53687.59457534572,
- 53707.891383358816,
- 53728.190109150361,
- 53748.490752358055,
- 53768.793312619753,
- 53789.09778957349,
- 53809.404182857485,
- 53829.712492110106,
- 53850.022716969899,
- 53870.334857075584,
- 53890.648912066055,
- 53910.964881580367,
- 53931.28276525774,
- 53951.602562737586,
- 53971.924273659461,
- 53992.24789766311,
- 54012.57343438844,
- 54032.90088347553,
- 54053.23024456462,
- 54073.561517296133,
- 54093.894701310644,
- 54114.22979624891,
- 54134.566801751855,
- 54154.90571746057,
- 54175.246543016314,
- 54195.589278060506,
- 54215.933922234755,
- 54236.280475180814,
- 54256.628936540626,
- 54276.97930595628,
- 54297.331583070045,
- 54317.685767524359,
- 54338.041858961828,
- 54358.399857025215,
- 54378.759761357462,
- 54399.121571601667,
- 54419.485287401105,
- 54439.850908399218,
- 54460.218434239614,
- 54480.587864566056,
- 54500.95919902248,
- 54521.332437252997,
- 54541.707578901878,
- 54562.084623613555,
- 54582.46357103264,
- 54602.844420803893,
- 54623.227172572246,
- 54643.611825982807,
- 54663.998380680838,
- 54684.386836311773,
- 54704.777192521207,
- 54725.169448954897,
- 54745.563605258772,
- 54765.959661078923,
- 54786.357616061614,
- 54806.757469853255,
- 54827.159222100439,
- 54847.562872449904,
- 54867.968420548583,
- 54888.375866043534,
- 54908.785208582012,
- 54929.196447811417,
- 54949.609583379322,
- 54970.024614933463,
- 54990.441542121727,
- 55010.86036459219,
- 55031.28108199306,
- 55051.703693972733,
- 55072.128200179759,
- 55092.554600262847,
- 55112.982893870874,
- 55133.413080652877,
- 55153.845160258061,
- 55174.279132335789,
- 55194.714996535586,
- 55215.152752507143,
- 55235.592399900306,
- 55256.033938365079,
- 55276.477367551655,
- 55296.92268711036,
- 55317.369896691685,
- 55337.818995946305,
- 55358.269984525024,
- 55378.72286207883,
- 55399.177628258869,
- 55419.634282716441,
- 55440.092825103013,
- 55460.553255070205,
- 55481.015572269804,
- 55501.479776353764,
- 55521.945866974187,
- 55542.413843783339,
- 55562.883706433655,
- 55583.355454577715,
- 55603.82908786826,
- 55624.304605958219,
- 55644.782008500639,
- 55665.261295148754,
- 55685.742465555952,
- 55706.225519375774,
- 55726.710456261928,
- 55747.197275868275,
- 55767.685977848843,
- 55788.176561857814,
- 55808.669027549528,
- 55829.163374578478,
- 55849.659602599328,
- 55870.157711266889,
- 55890.657700236145,
- 55911.159569162221,
- 55931.663317700411,
- 55952.168945506164,
- 55972.676452235086,
- 55993.185837542944,
- 56013.697101085651,
- 56034.210242519301,
- 56054.72526150012,
- 56075.242157684508,
- 56095.760930729011,
- 56116.281580290342,
- 56136.804106025367,
- 56157.328507591104,
- 56177.85478464474,
- 56198.382936843598,
- 56218.912963845185,
- 56239.444865307138,
- 56259.978640887268,
- 56280.514290243525,
- 56301.051813034042,
- 56321.591208917082,
- 56342.13247755108,
- 56362.675618594607,
- 56383.220631706419,
- 56403.767516545398,
- 56424.316272770608,
- 56444.866900041241,
- 56465.419398016667,
- 56485.973766356394,
- 56506.530004720102,
- 56527.088112767611,
- 56547.648090158902,
- 56568.209936554107,
- 56588.773651613519,
- 56609.339234997584,
- 56629.9066863669,
- 56650.47600538221,
- 56671.04719170442,
- 56691.620244994599,
- 56712.195164913959,
- 56732.771951123868,
- 56753.350603285835,
- 56773.931121061541,
- 56794.513504112823,
- 56815.097752101647,
- 56835.683864690152,
- 56856.271841540627,
- 56876.86168231551,
- 56897.453386677393,
- 56918.046954289028,
- 56938.642384813298,
- 56959.239677913261,
- 56979.838833252121,
- 57000.439850493225,
- 57021.04272930009,
- 57041.647469336371,
- 57062.254070265873,
- 57082.862531752558,
- 57103.472853460553,
- 57124.085035054108,
- 57144.699076197649,
- 57165.314976555739,
- 57185.932735793103,
- 57206.552353574611,
- 57227.173829565276,
- 57247.797163430281,
- 57268.42235483494,
- 57289.049403444733,
- 57309.678308925286,
- 57330.30907094237,
- 57350.941689161911,
- 57371.576163249985,
- 57392.212492872815,
- 57412.850677696784,
- 57433.490717388406,
- 57454.132611614368,
- 57474.776360041491,
- 57495.421962336746,
- 57516.069418167266,
- 57536.718727200314,
- 57557.36988910332,
- 57578.022903543861,
- 57598.677770189643,
- 57619.334488708548,
- 57639.993058768589,
- 57660.653480037938,
- 57681.315752184906,
- 57701.979874877965,
- 57722.64584778573,
- 57743.31367057695,
- 57763.983342920546,
- 57784.654864485572,
- 57805.328234941233,
- 57826.003453956881,
- 57846.680521202026,
- 57867.359436346305,
- 57888.040199059527,
- 57908.722809011633,
- 57929.407265872709,
- 57950.093569313001,
- 57970.781719002895,
- 57991.471714612911,
- 58012.16355581375,
- 58032.857242276223,
- 58053.552773671312,
- 58074.25014967013,
- 58094.949369943948,
- 58115.650434164185,
- 58136.353342002389,
- 58157.058093130276,
- 58177.764687219693,
- 58198.47312394264,
- 58219.183402971255,
- 58239.895523977837,
- 58260.609486634821,
- 58281.325290614775,
- 58302.042935590434,
- 58322.762421234678,
- 58343.483747220511,
- 58364.206913221096,
- 58384.931918909751,
- 58405.658763959924,
- 58426.3874480452,
- 58447.117970839339,
- 58467.85033201622,
- 58488.584531249864,
- 58509.320568214462,
- 58530.058442584334,
- 58550.798154033931,
- 58571.539702237875,
- 58592.283086870906,
- 58613.028307607929,
- 58633.775364123983,
- 58654.52425609425,
- 58675.274983194053,
- 58696.027545098877,
- 58716.781941484325,
- 58737.538172026158,
- 58758.296236400274,
- 58779.056134282728,
- 58799.817865349694,
- 58820.581429277503,
- 58841.346825742643,
- 58862.114054421712,
- 58882.883114991484,
- 58903.654007128847,
- 58924.426730510851,
- 58945.201284814684,
- 58965.977669717664,
- 58986.755884897269,
- 59007.535930031117,
- 59028.317804796949,
- 59049.101508872664,
- 59069.887041936301,
- 59090.674403666046,
- 59111.463593740213,
- 59132.254611837263,
- 59153.047457635803,
- 59173.84213081457,
- 59194.638631052461,
- 59215.436958028506,
- 59236.237111421855,
- 59257.039090911829,
- 59277.842896177877,
- 59298.648526899589,
- 59319.455982756685,
- 59340.26526342905,
- 59361.076368596696,
- 59381.889297939757,
- 59402.704051138542,
- 59423.520627873484,
- 59444.339027825139,
- 59465.159250674224,
- 59485.9812961016,
- 59506.805163788253,
- 59527.630853415307,
- 59548.458364664046,
- 59569.287697215863,
- 59590.118850752311,
- 59610.951824955089,
- 59631.786619506012,
- 59652.623234087048,
- 59673.461668380311,
- 59694.301922068029,
- 59715.143994832593,
- 59735.987886356525,
- 59756.833596322482,
- 59777.681124413255,
- 59798.530470311794,
- 59819.381633701159,
- 59840.234614264569,
- 59861.089411685381,
- 59881.94602564707,
- 59902.804455833269,
- 59923.664701927737,
- 59944.526763614384,
- 59965.390640577243,
- 59986.256332500488,
- 60007.123839068438,
- 60027.993159965539,
- 60048.864294876381,
- 60069.737243485688,
- 60090.612005478324,
- 60111.488580539284,
- 60132.366968353708,
- 60153.247168606867,
- 60174.129180984164,
- 60195.013005171153,
- 60215.898640853513,
- 60236.786087717061,
- 60257.675345447751,
- 60278.566413731671,
- 60299.459292255044,
- 60320.353980704247,
- 60341.25047876576,
- 60362.148786126229,
- 60383.048902472423,
- 60403.950827491237,
- 60424.854560869717,
- 60445.76010229504,
- 60466.667451454516,
- 60487.57660803559,
- 60508.487571725847,
- 60529.400342212997,
- 60550.314919184893,
- 60571.231302329521,
- 60592.149491335003,
- 60613.069485889588,
- 60633.991285681674,
- 60654.914890399785,
- 60675.840299732568,
- 60696.767513368832,
- 60717.696530997484,
- 60738.627352307602,
- 60759.55997698837,
- 60780.494404729128,
- 60801.430635219323,
- 60822.368668148556,
- 60843.308503206565,
- 60864.250140083204,
- 60885.193578468468,
- 60906.138818052495,
- 60927.085858525541,
- 60948.034699578006,
- 60968.985340900421,
- 60989.937782183442,
- 61010.892023117864,
- 61031.848063394616,
- 61052.805902704764,
- 61073.765540739492,
- 61094.726977190134,
- 61115.690211748137,
- 61136.655244105103,
- 61157.622073952742,
- 61178.590700982917,
- 61199.561124887616,
- 61220.533345358948,
- 61241.507362089171,
- 61262.483174770663,
- 61283.460783095943,
- 61304.440186757645,
- 61325.421385448557,
- 61346.404378861582,
- 61367.389166689762,
- 61388.375748626262,
- 61409.364124364387,
- 61430.354293597571,
- 61451.346256019373,
- 61472.340011323497,
- 61493.335559203762,
- 61514.332899354122,
- 61535.332031468672,
- 61556.332955241618,
- 61577.335670367313,
- 61598.340176540238,
- 61619.346473454993,
- 61640.354560806329,
- 61661.3644382891,
- 61682.376105598312,
- 61703.389562429089,
- 61724.404808476691,
- 61745.42184343651,
- 61766.440667004063,
- 61787.461278874987,
- 61808.483678745069,
- 61829.507866310203,
- 61850.533841266435,
- 61871.561603309929,
- 61892.591152136971,
- 61913.622487443987,
- 61934.655608927525,
- 61955.690516284267,
- 61976.727209211022,
- 61997.765687404724,
- 62018.805950562448,
- 62039.847998381381,
- 62060.891830558845,
- 62081.93744679229,
- 62102.984846779298,
- 62124.034030217575,
- 62145.084996804966,
- 62166.137746239416,
- 62187.19227821903,
- 62208.248592442025,
- 62229.306688606739,
- 62250.366566411656,
- 62271.428225555377,
- 62292.491665736627,
- 62313.556886654267,
- 62334.623888007271,
- 62355.692669494762,
- 62376.763230815974,
- 62397.835571670272,
- 62418.909691757144,
- 62439.98559077621,
- 62461.063268427228,
- 62482.142724410049,
- 62503.223958424685,
- 62524.306970171267,
- 62545.39175935003,
- 62566.478325661366,
- 62587.566668805768,
- 62608.656788483881,
- 62629.748684396451,
- 62650.842356244357,
- 62671.937803728622,
- 62693.035026550366,
- 62714.134024410858,
- 62735.234797011479,
- 62756.337344053733,
- 62777.441665239276,
- 62798.547760269852,
- 62819.655628847358,
- 62840.765270673801,
- 62861.876685451323,
- 62882.989872882186,
- 62904.104832668774,
- 62925.221564513602,
- 62946.340068119309,
- 62967.460343188657,
- 62988.582389424526,
- 63009.70620652994,
- 63030.831794208025,
- 63051.959152162039,
- 63073.08828009537,
- 63094.219177711529,
- 63115.351844714154,
- 63136.486280806988,
- 63157.622485693922,
- 63178.760459078956,
- 63199.900200666219,
- 63221.041710159967,
- 63242.184987264569,
- 63263.330031684534,
- 63284.476843124474,
- 63305.625421289144,
- 63326.775765883409,
- 63347.927876612259,
- 63369.081753180813,
- 63390.237395294316,
- 63411.39480265812,
- 63432.553974977716,
- 63453.714911958712,
- 63474.877613306839,
- 63496.042078727944,
- 63517.208307927998,
- 63538.376300613119,
- 63559.546056489504,
- 63580.717575263516,
- 63601.890856641607,
- 63623.065900330374,
- 63644.242706036515,
- 63665.421273466869,
- 63686.601602328381,
- 63707.783692328136,
- 63728.967543173334,
- 63750.153154571279,
- 63771.340526229418,
- 63792.529657855317,
- 63813.720549156649,
- 63834.913199841227,
- 63856.107609616978,
- 63877.303778191941,
- 63898.501705274284,
- 63919.7013905723,
- 63940.902833794404,
- 63962.106034649114,
- 63983.310992845094,
- 64004.517708091109,
- 64025.726180096048,
- 64046.936408568938,
- 64068.1483932189,
- 64089.362133755196,
- 64110.577629887193,
- 64131.794881324393,
- 64153.013887776404,
- 64174.234648952966,
- 64195.457164563937,
- 64216.681434319289,
- 64237.907457929112,
- 64259.135235103626,
- 64280.36476555316,
- 64301.596048988169,
- 64322.829085119236,
- 64344.06387365704,
- 64365.300414312398,
- 64386.538706796251,
- 64407.778750819634,
- 64429.020546093721,
- 64450.26409232981,
- 64471.509389239291,
- 64492.756436533709,
- 64514.005233924705,
- 64535.255781124033,
- 64556.50807784358,
- 64577.762123795357,
- 64599.017918691468,
- 64620.275462244172,
- 64641.534754165805,
- 64662.795794168844,
- 64684.058581965895,
- 64705.323117269661,
- 64726.589399792974,
- 64747.857429248776,
- 64769.127205350138,
- 64790.398727810236,
- 64811.671996342375,
- 64832.947010659969,
- 64854.223770476558,
- 64875.502275505794,
- 64896.782525461451,
- 64918.064520057414,
- 64939.348259007682,
- 64960.633742026388,
- 64981.920968827762,
- 65003.209939126165,
- 65024.500652636067,
- 65045.793109072067,
- 65067.087308148861,
- 65088.383249581282,
- 65109.680933084259,
- 65130.980358372864,
- 65152.28152516226,
- 65173.584433167736,
- 65194.889082104703,
- 65216.195471688683,
- 65237.503601635319,
- 65258.813471660353,
- 65280.125081479666,
- 65301.438430809241,
- 65322.753519365178,
- 65344.070346863708,
- 65365.388913021146,
- 65386.709217553958,
- 65408.031260178701,
- 65429.355040612056,
- 65450.680558570821,
- 65472.00781377191,
- 65493.336805932355,
- 65514.66753476928,
- 65535.999999999956,
- 65557.334201341757,
- 65578.670138512171,
- 65600.007811228788,
- 65621.347219209332,
- 65642.688362171626,
- 65664.031239833639,
- 65685.375851913413,
- 65706.722198129137,
- 65728.070278199084,
- 65749.420091841661,
- 65770.771638775404,
- 65792.124918718939,
- 65813.479931391004,
- 65834.836676510458,
- 65856.195153796303,
- 65877.5553629676,
- 65898.917303743554,
- 65920.280975843489,
- 65941.646378986843,
- 65963.013512893158,
- 65984.382377282076,
- 66005.752971873386,
- 66027.125296386963,
- 66048.499350542799,
- 66069.875134061018,
- 66091.252646661844,
- 66112.631888065618,
- 66134.01285799277,
- 66155.395556163887,
- 66176.779982299631,
- 66198.166136120795,
- 66219.554017348273,
- 66240.943625703105,
- 66262.334960906388,
- 66283.728022679396,
- 66305.122810743444,
- 66326.519324820023,
- 66347.917564630698,
- 66369.317529897162,
- 66390.719220341227,
- 66412.122635684791,
- 66433.527775649884,
- 66454.934639958636,
- 66476.343228333324,
- 66497.753540496284,
- 66519.165576169995,
- 66540.57933507704,
- 66561.994816940118,
- 66583.412021482043,
- 66604.830948425733,
- 66626.251597494222,
- 66647.673968410629,
- 66669.098060898235,
- 66690.523874680381,
- 66711.951409480564,
- 66733.380665022371,
- 66754.811641029475,
- 66776.244337225711,
- 66797.678753334985,
- 66819.11488908132,
- 66840.552744188884,
- 66861.992318381905,
- 66883.433611384738,
- 66904.876622921889,
- 66926.321352717903,
- 66947.767800497502,
- 66969.215965985466,
- 66990.665848906734,
- 67012.117448986304,
- 67033.570765949335,
- 67055.025799521056,
- 67076.482549426815,
- 67097.941015392076,
- 67119.401197142433,
- 67140.863094403554,
- 67162.326706901222,
- 67183.792034361351,
- 67205.259076509959,
- 67226.72783307315,
- 67248.198303777172,
- 67269.670488348347,
- 67291.144386513144,
- 67312.619997998088,
- 67334.09732252988,
- 67355.576359835293,
- 67377.057109641188,
- 67398.53957167457,
- 67420.023745662547,
- 67441.50963133233,
- 67462.99722841123,
- 67484.486536626689,
- 67505.977555706224,
- 67527.470285377494,
- 67548.964725368263,
- 67570.460875406367,
- 67591.9587352198,
- 67613.458304536631,
- 67634.95958308503,
- 67656.462570593329,
- 67677.967266789899,
- 67699.473671403248,
- 67720.981784162024,
- 67742.491604794923,
- 67764.003133030797,
- 67785.516368598575,
- 67807.031311227314,
- 67828.547960646174,
- 67850.066316584402,
- 67871.58637877139,
- 67893.108146936589,
- 67914.63162080961,
- 67936.156800120138,
- 67957.683684597971,
- 67979.212273973011,
- 68000.742567975263,
- 68022.274566334876,
- 68043.808268782057,
- 68065.343675047145,
- 68086.880784860579,
- 68108.419597952918,
- 68129.960114054789,
- 68151.502332896969,
- 68173.04625421032,
- 68194.591877725834,
- 68216.139203174564,
- 68237.688230287706,
- 68259.238958796544,
- 68280.791388432481,
- 68302.345518927032,
- 68323.901350011787,
- 68345.458881418483,
- 68367.018112878912,
- 68388.579044125028,
- 68410.141674888844,
- 68431.706004902502,
- 68453.272033898262,
- 68474.839761608455,
- 68496.409187765545,
- 68517.980312102081,
- 68539.553134350732,
- 68561.127654244279,
- 68582.70387151558,
- 68604.281785897634,
- 68625.861397123503,
- 68647.44270492639,
- 68669.025709039604,
- 68690.610409196524,
- 68712.196805130661,
- 68733.784896575627,
- 68755.374683265123,
- 68776.966164932994,
- 68798.559341313128,
- 68820.154212139591,
- 68841.750777146473,
- 68863.349036068044,
- 68884.948988638629,
- 68906.550634592684,
- 68928.153973664739,
- 68949.75900558944,
- 68971.365730101577,
- 68992.974146935987,
- 69014.584255827634,
- 69036.196056511588,
- 69057.809548723017,
- 69079.424732197207,
- 69101.041606669532,
- 69122.660171875468,
- 69144.280427550606,
- 69165.902373430625,
- 69187.526009251334,
- 69209.151334748618,
- 69230.778349658474,
- 69252.40705371699,
- 69274.037446660412,
- 69295.669528225,
- 69317.303298147192,
- 69338.938756163494,
- 69360.575902010532,
- 69382.214735425005,
- 69403.855256143754,
- 69425.497463903681,
- 69447.141358441833,
- 69468.78693949533,
- 69490.434206801394,
- 69512.083160097391,
- 69533.733799120717,
- 69555.386123608929,
- 69577.04013329967,
- 69598.695827930685,
- 69620.353207239794,
- 69642.012270964973,
- 69663.67301884426,
- 69685.335450615792,
- 69706.999566017839,
- 69728.665364788743,
- 69750.332846666963,
- 69772.002011391058,
- 69793.672858699691,
- 69815.345388331611,
- 69837.019600025669,
- 69858.695493520849,
- 69880.373068556204,
- 69902.052324870907,
- 69923.733262204216,
- 69945.415880295492,
- 69967.100178884211,
- 69988.786157709939,
- 70010.473816512356,
- 70032.163155031216,
- 70053.854173006403,
- 70075.546870177874,
- 70097.241246285717,
- 70118.937301070109,
- 70140.635034271298,
- 70162.334445629691,
- 70184.035534885741,
- 70205.738301780017,
- 70227.442746053217,
- 70249.1488674461,
- 70270.856665699539,
- 70292.566140554511,
- 70314.277291752107,
- 70335.990119033493,
- 70357.704622139936,
- 70379.420800812819,
- 70401.138654793613,
- 70422.85818382389,
- 70444.579387645339,
- 70466.302265999722,
- 70488.026818628918,
- 70509.753045274876,
- 70531.480945679708,
- 70553.210519585555,
- 70574.941766734701,
- 70596.674686869505,
- 70618.409279732456,
- 70640.145545066101,
- 70661.883482613106,
- 70683.623092116264,
- 70705.364373318414,
- 70727.107325962526,
- 70748.851949791671,
- 70770.598244549008,
- 70792.346209977783,
- 70814.095845821372,
- 70835.847151823225,
- 70857.600127726895,
- 70879.354773276034,
- 70901.111088214413,
- 70922.869072285859,
- 70944.628725234332,
- 70966.390046803877,
- 70988.153036738629,
- 71009.917694782853,
- 71031.684020680885,
- 71053.45201417715,
- 71075.221675016204,
- 71096.993002942661,
- 71118.765997701266,
- 71140.540659036851,
- 71162.316986694335,
- 71184.09498041874,
- 71205.874639955218,
- 71227.655965048951,
- 71249.438955445294,
- 71271.223610889632,
- 71293.009931127483,
- 71314.797915904477,
- 71336.587564966307,
- 71358.378878058764,
- 71380.171854927772,
- 71401.966495319313,
- 71423.762798979486,
- 71445.560765654489,
- 71467.360395090596,
- 71489.161687034211,
- 71510.964641231811,
- 71532.769257429973,
- 71554.575535375348,
- 71576.383474814749,
- 71598.19307549503,
- 71620.004337163133,
- 71641.817259566145,
- 71663.631842451214,
- 71685.4480855656,
- 71707.26598865664,
- 71729.085551471784,
- 71750.906773758586,
- 71772.729655264673,
- 71794.554195737772,
- 71816.380394925713,
- 71838.208252576442,
- 71860.037768437964,
- 71881.868942258385,
- 71903.701773785942,
- 71925.536262768932,
- 71947.372408955751,
- 71969.210212094898,
- 71991.049671934976,
- 72012.890788224686,
- 72034.73356071279,
- 72056.577989148165,
- 72078.424073279821,
- 72100.271812856794,
- 72122.121207628254,
- 72143.97225734347,
- 72165.824961751801,
- 72187.679320602692,
- 72209.53533364569,
- 72231.393000630429,
- 72253.252321306645,
- 72275.113295424177,
- 72296.975922732949,
- 72318.840202982959,
- 72340.706135924338,
- 72362.573721307272,
- 72384.442958882093,
- 72406.313848399179,
- 72428.186389609036,
- 72450.060582262216,
- 72471.936426109431,
- 72493.813920901433,
- 72515.693066389096,
- 72537.573862323392,
- 72559.456308455352,
- 72581.340404536139,
- 72603.226150316987,
- 72625.113545549248,
- 72647.002589984331,
- 72668.893283373764,
- 72690.785625469172,
- 72712.679616022273,
- 72734.575254784853,
- 72756.472541508803,
- 72778.371475946144,
- 72800.272057848939,
- 72822.174286969355,
- 72844.07816305969,
- 72865.983685872285,
- 72887.890855159596,
- 72909.799670674183,
- 72931.710132168693,
- 72953.622239395845,
- 72975.535992108475,
- 72997.451390059519,
- 73019.368433001961,
- 73041.287120688925,
- 73063.207452873612,
- 73085.129429309294,
- 73107.053049749389,
- 73128.978313947344,
- 73150.905221656736,
- 73172.833772631217,
- 73194.763966624567,
- 73216.695803390612,
- 73238.62928268328,
- 73260.564404256627,
- 73282.501167864757,
- 73304.439573261901,
- 73326.379620202337,
- 73348.321308440485,
- 73370.264637730841,
- 73392.209607827957,
- 73414.156218486532,
- 73436.104469461323,
- 73458.054360507173,
- 73480.005891379056,
- 73501.959061831993,
- 73523.913871621116,
- 73545.870320501665,
- 73567.828408228932,
- 73589.78813455833,
- 73611.749499245358,
- 73633.712502045615,
- 73655.677142714747,
- 73677.643421008557,
- 73699.611336682879,
- 73721.580889493693,
- 73743.552079197019,
- 73765.524905548999,
- 73787.499368305856,
- 73809.475467223907,
- 73831.453202059551,
- 73853.432572569291,
- 73875.413578509717,
- 73897.396219637507,
- 73919.380495709411,
- 73941.36640648231,
- 73963.353951713143,
- 73985.343131158952,
- 74007.333944576865,
- 74029.326391724098,
- 74051.320472357969,
- 74073.316186235883,
- 74095.313533115303,
- 74117.312512753837,
- 74139.313124909138,
- 74161.315369338976,
- 74183.319245801191,
- 74205.324754053727,
- 74227.331893854629,
- 74249.340664961986,
- 74271.351067134034,
- 74293.363100129049,
- 74315.376763705441,
- 74337.392057621662,
- 74359.408981636298,
- 74381.427535508003,
- 74403.447718995507,
- 74425.469531857671,
- 74447.492973853383,
- 74469.518044741693,
- 74491.54474428168,
- 74513.573072232539,
- 74535.603028353551,
- 74557.634612404087,
- 74579.667824143602,
- 74601.702663331642,
- 74623.739129727837,
- 74645.777223091936,
- 74667.816943183716,
- 74689.858289763113,
- 74711.901262590094,
- 74733.945861424741,
- 74755.992086027225,
- 74778.039936157802,
- 74800.089411576817,
- 74822.140512044702,
- 74844.193237321961,
- 74866.24758716923,
- 74888.303561347187,
- 74910.36115961663,
- 74932.420381738411,
- 74954.481227473516,
- 74976.543696582972,
- 74998.607788827925,
- 75020.673503969607,
- 75042.740841769322,
- 75064.809801988464,
- 75086.88038438854,
- 75108.952588731103,
- 75131.026414777836,
- 75153.101862290467,
- 75175.178931030852,
- 75197.257620760924,
- 75219.33793124267,
- 75241.419862238225,
- 75263.503413509738,
- 75285.588584819503,
- 75307.675375929874,
- 75329.763786603318,
- 75351.853816602365,
- 75373.945465689612,
- 75396.038733627807,
- 75418.133620179724,
- 75440.230125108254,
- 75462.32824817636,
- 75484.427989147109,
- 75506.529347783653,
- 75528.63232384919,
- 75550.736917107075,
- 75572.843127320695,
- 75594.950954253538,
- 75617.060397669193,
- 75639.171457331307,
- 75661.284133003646,
- 75683.398424450032,
- 75705.514331434402,
- 75727.631853720741,
- 75749.750991073175,
- 75771.871743255862,
- 75793.994110033076,
- 75816.118091169177,
- 75838.243686428585,
- 75860.370895575848,
- 75882.499718375562,
- 75904.630154592422,
- 75926.762203991224,
- 75948.895866336825,
- 75971.031141394182,
- 75993.168028928325,
- 76015.306528704401,
- 76037.4466404876,
- 76059.588364043215,
- 76081.731699136653,
- 76103.876645533353,
- 76126.023202998884,
- 76148.171371298871,
- 76170.321150199044,
- 76192.472539465205,
- 76214.625538863256,
- 76236.780148159174,
- 76258.936367119008,
- 76281.094195508922,
- 76303.253633095141,
- 76325.414679643975,
- 76347.577334921851,
- 76369.741598695226,
- 76391.907470730686,
- 76414.074950794879,
- 76436.244038654564,
- 76458.414734076548,
- 76480.587036827754,
- 76502.760946675175,
- 76524.936463385893,
- 76547.11358672705,
- 76569.292316465915,
- 76591.472652369819,
- 76613.654594206164,
- 76635.838141742468,
- 76658.023294746308,
- 76680.210052985349,
- 76702.398416227341,
- 76724.588384240138,
- 76746.779956791637,
- 76768.973133649866,
- 76791.167914582897,
- 76813.364299358902,
- 76835.562287746157,
- 76857.761879512967,
- 76879.963074427797,
- 76902.165872259109,
- 76924.37027277553,
- 76946.576275745727,
- 76968.783880938441,
- 76990.993088122515,
- 77013.203897066895,
- 77035.416307540567,
- 77057.630319312622,
- 77079.845932152239,
- 77102.063145828695,
- 77124.281960111301,
- 77146.50237476948,
- 77168.724389572759,
- 77190.948004290723,
- 77213.173218693031,
- 77235.400032549442,
- 77257.628445629802,
- 77279.858457704031,
- 77302.090068542122,
- 77324.323277914169,
- 77346.558085590339,
- 77368.794491340886,
- 77391.032494936138,
- 77413.272096146524,
- 77435.51329474253,
- 77457.756090494731,
- 77480.000483173804,
- 77502.246472550498,
- 77524.494058395634,
- 77546.743240480107,
- 77568.994018574944,
- 77591.246392451198,
- 77613.500361880026,
- 77635.755926632657,
- 77658.013086480438,
- 77680.271841194757,
- 77702.532190547092,
- 77724.794134309021,
- 77747.057672252195,
- 77769.322804148323,
- 77791.589529769248,
- 77813.857848886837,
- 77836.127761273063,
- 77858.399266699998,
- 77880.67236493979,
- 77902.947055764627,
- 77925.223338946831,
- 77947.50121425878,
- 77969.780681472927,
- 77992.061740361838,
- 78014.344390698127,
- 78036.628632254491,
- 78058.914464803747,
- 78081.201888118725,
- 78103.490901972415,
- 78125.781506137821,
- 78148.073700388064,
- 78170.367484496339,
- 78192.662858235926,
- 78214.959821380166,
- 78237.258373702498,
- 78259.558514976452,
- 78281.860244975614,
- 78304.163563473659,
- 78326.468470244363,
- 78348.77496506153,
- 78371.083047699125,
- 78393.392717931114,
- 78415.703975531578,
- 78438.016820274701,
- 78460.331251934695,
- 78482.647270285903,
- 78504.964875102727,
- 78527.284066159627,
- 78549.604843231195,
- 78571.927206092048,
- 78594.251154516911,
- 78616.576688280606,
- 78638.903807157985,
- 78661.232510924034,
- 78683.562799353778,
- 78705.894672222363,
- 78728.228129304945,
- 78750.563170376859,
- 78772.899795213423,
- 78795.238003590101,
- 78817.577795282399,
- 78839.919170065928,
- 78862.262127716356,
- 78884.606668009452,
- 78906.952790721043,
- 78929.300495627045,
- 78951.64978250346,
- 78974.000651126378,
- 78996.353101271932,
- 79018.707132716358,
- 79041.062745235977,
- 79063.41993860717,
- 79085.778712606436,
- 79108.139067010285,
- 79130.501001595389,
- 79152.864516138419,
- 79175.22961041618,
- 79197.596284205531,
- 79219.96453728342,
- 79242.33436942687,
- 79264.705780412987,
- 79287.078770018954,
- 79309.453338022009,
- 79331.829484199508,
- 79354.207208328866,
- 79376.586510187582,
- 79398.967389553218,
- 79421.349846203433,
- 79443.733879915948,
- 79466.119490468584,
- 79488.50667763922,
- 79510.895441205823,
- 79533.285780946433,
- 79555.677696639163,
- 79578.071188062226,
- 79600.466254993895,
- 79622.862897212515,
- 79645.261114496549,
- 79667.660906624471,
- 79690.062273374875,
- 79712.465214526455,
- 79734.869729857935,
- 79757.275819148126,
- 79779.683482175955,
- 79802.092718720378,
- 79824.503528560454,
- 79846.915911475327,
- 79869.329867244203,
- 79891.745395646343,
- 79914.162496461155,
- 79936.581169468045,
- 79959.001414446553,
- 79981.423231176261,
- 80003.846619436852,
- 80026.271579008084,
- 80048.698109669771,
- 80071.12621120183,
- 80093.555883384237,
- 80115.987125997053,
- 80138.419938820414,
- 80160.854321634528,
- 80183.290274219689,
- 80205.727796356281,
- 80228.166887824715,
- 80250.607548405547,
- 80273.049777879336,
- 80295.493576026798,
- 80317.938942628651,
- 80340.385877465727,
- 80362.834380318949,
- 80385.28445096928,
- 80407.736089197788,
- 80430.189294785596,
- 80452.644067513917,
- 80475.100407164035,
- 80497.558313517322,
- 80520.017786355209,
- 80542.478825459213,
- 80564.941430610925,
- 80587.405601592007,
- 80609.871338184195,
- 80632.338640169342,
- 80654.8075073293,
- 80677.277939446067,
- 80699.749936301683,
- 80722.223497678278,
- 80744.698623358039,
- 80767.17531312324,
- 80789.653566756242,
- 80812.133384039465,
- 80834.614764755403,
- 80857.097708686648,
- 80879.582215615854,
- 80902.068285325731,
- 80924.555917599093,
- 80947.045112218824,
- 80969.535868967869,
- 80992.028187629272,
- 81014.522067986123,
- 81037.017509821613,
- 81059.514512919006,
- 81082.013077061609,
- 81104.513202032831,
- 81127.014887616184,
- 81149.518133595193,
- 81172.022939753486,
- 81194.529305874807,
- 81217.037231742899,
- 81239.546717141639,
- 81262.057761854958,
- 81284.570365666848,
- 81307.084528361403,
- 81329.600249722775,
- 81352.117529535186,
- 81374.636367582949,
- 81397.156763650448,
- 81419.678717522125,
- 81442.202228982511,
- 81464.727297816222,
- 81487.253923807933,
- 81509.782106742379,
- 81532.311846404409,
- 81554.843142578902,
- 81577.375995050839,
- 81599.910403605274,
- 81622.446368027333,
- 81644.983888102215,
- 81667.522963615178,
- 81690.063594351581,
- 81712.605780096841,
- 81735.149520636449,
- 81757.694815755967,
- 81780.241665241047,
- 81802.79006887741,
- 81825.340026450824,
- 81847.891537747171,
- 81870.444602552379,
- 81892.999220652477,
- 81915.555391833506,
- 81938.113115881672,
- 81960.672392583176,
- 81983.233221724338,
- 82005.795603091537,
- 82028.359536471224,
- 82050.925021649906,
- 82073.492058414209,
- 82096.060646550788,
- 82118.630785846399,
- 82141.202476087841,
- 82163.775717062032,
- 82186.35050855593,
- 82208.926850356569,
- 82231.504742251054,
- 82254.084184026578,
- 82276.665175470393,
- 82299.24771636985,
- 82321.831806512317,
- 82344.417445685307,
- 82367.004633676348,
- 82389.593370273054,
- 82412.183655263143,
- 82434.775488434374,
- 82457.368869574595,
- 82479.963798471697,
- 82502.560274913689,
- 82525.158298688606,
- 82547.757869584602,
- 82570.35898738986,
- 82592.961651892678,
- 82615.565862881398,
- 82638.171620144421,
- 82660.778923470265,
- 82683.387772647475,
- 82705.998167464713,
- 82728.610107710658,
- 82751.223593174116,
- 82773.83862364394,
- 82796.45519890904,
- 82819.073318758441,
- 82841.692982981185,
- 82864.314191366429,
- 82886.936943703375,
- 82909.561239781324,
- 82932.187079389638,
- 82954.814462317736,
- 82977.443388355125,
- 83000.073857291369,
- 83022.70586891612,
- 83045.339423019104,
- 83067.974519390089,
- 83090.611157818959,
- 83113.249338095629,
- 83135.8890600101,
- 83158.530323352461,
- 83181.173127912858,
- 83203.817473481497,
- 83226.463359848669,
- 83249.11078680474,
- 83271.759754140134,
- 83294.410261645375,
- 83317.062309111003,
- 83339.715896327703,
- 83362.371023086147,
- 83385.027689177165,
- 83407.685894391587,
- 83430.345638520361,
- 83453.006921354478,
- 83475.669742685001,
- 83498.334102303095,
- 83520.999999999942,
- 83543.667435566866,
- 83566.336408795192,
- 83589.006919476349,
- 83611.678967401851,
- 83634.352552363242,
- 83657.027674152167,
- 83679.704332560359,
- 83702.382527379552,
- 83725.062258401638,
- 83747.743525418511,
- 83770.42632822218,
- 83793.110666604684,
- 83815.796540358162,
- 83838.483949274829,
- 83861.172893146941,
- 83883.863371766842,
- 83906.555384926964,
- 83929.248932419752,
- 83951.944014037799,
- 83974.640629573696,
- 83997.338778820151,
- 84020.038461569929,
- 84042.739677615857,
- 84065.442426750829,
- 84088.146708767847,
- 84110.852523459922,
- 84133.559870620171,
- 84156.268750041796,
- 84178.979161518029,
- 84201.691104842204,
- 84224.404579807713,
- 84247.119586208006,
- 84269.83612383662,
- 84292.55419248715,
- 84315.273791953281,
- 84337.994922028738,
- 84360.717582507335,
- 84383.441773182945,
- 84406.167493849513,
- 84428.894744301069,
- 84451.623524331691,
- 84474.353833735542,
- 84497.085672306828,
- 84519.819039839858,
- 84542.553936128999,
- 84565.290360968676,
- 84588.028314153402,
- 84610.767795477717,
- 84633.508804736295,
- 84656.251341723822,
- 84678.995406235073,
- 84701.740998064924,
- 84724.488117008252,
- 84747.236762860062,
- 84769.986935415407,
- 84792.73863446941,
- 84815.491859817252,
- 84838.246611254188,
- 84861.002888575575,
- 84883.760691576768,
- 84906.520020053256,
- 84929.28087380057,
- 84952.043252614312,
- 84974.807156290146,
- 84997.572584623806,
- 85020.339537411113,
- 85043.108014447949,
- 85065.878015530237,
- 85088.649540453989,
- 85111.422589015303,
- 85134.197161010321,
- 85156.973256235244,
- 85179.750874486374,
- 85202.530015560071,
- 85225.310679252725,
- 85248.092865360857,
- 85270.876573681016,
- 85293.661804009811,
- 85316.448556143951,
- 85339.236829880188,
- 85362.026625015351,
- 85384.817941346351,
- 85407.610778670132,
- 85430.405136783724,
- 85453.201015484257,
- 85475.998414568865,
- 85498.797333834795,
- 85521.597773079353,
- 85544.399732099904,
- 85567.203210693886,
- 85590.008208658808,
- 85612.814725792239,
- 85635.62276189182,
- 85658.432316755265,
- 85681.243390180331,
- 85704.055981964877,
- 85726.870091906807,
- 85749.685719804082,
- 85772.502865454764,
- 85795.321528656961,
- 85818.141709208852,
- 85840.963406908675,
- 85863.78662155474,
- 85886.611352945445,
- 85909.437600879217,
- 85932.26536515457,
- 85955.094645570091,
- 85977.92544192441,
- 86000.757754016275,
- 86023.591581644432,
- 86046.426924607746,
- 86069.263782705122,
- 86092.102155735556,
- 86114.942043498071,
- 86137.783445791807,
- 86160.626362415918,
- 86183.470793169676,
- 86206.316737852379,
- 86229.164196263402,
- 86252.013168202204,
- 86274.863653468303,
- 86297.715651861261,
- 86320.569163180728,
- 86343.424187226425,
- 86366.280723798132,
- 86389.138772695675,
- 86411.998333718977,
- 86434.859406668009,
- 86457.721991342827,
- 86480.586087543532,
- 86503.451695070296,
- 86526.318813723352,
- 86549.187443303032,
- 86572.057583609683,
- 86594.929234443756,
- 86617.802395605773,
- 86640.677066896271,
- 86663.553248115903,
- 86686.43093906538,
- 86709.310139545443,
- 86732.190849356964,
- 86755.073068300815,
- 86777.956796177954,
- 86800.842032789442,
- 86823.728777936354,
- 86846.617031419853,
- 86869.506793041175,
- 86892.398062601613,
- 86915.290839902518,
- 86938.185124745316,
- 86961.080916931489,
- 86983.978216262592,
- 87006.87702254027,
- 87029.777335566177,
- 87052.67915514209,
- 87075.582481069796,
- 87098.487313151185,
- 87121.39365118822,
- 87144.301494982894,
- 87167.210844337285,
- 87190.121699053532,
- 87213.034058933845,
- 87235.947923780506,
- 87258.863293395829,
- 87281.780167582241,
- 87304.698546142172,
- 87327.618428878181,
- 87350.539815592856,
- 87373.462706088845,
- 87396.387100168897,
- 87419.312997635774,
- 87442.240398292357,
- 87465.16930194154,
- 87488.099708386319,
- 87511.031617429733,
- 87533.965028874911,
- 87556.899942525008,
- 87579.836358183282,
- 87602.774275653021,
- 87625.713694737613,
- 87648.654615240492,
- 87671.597036965148,
- 87694.540959715145,
- 87717.486383294105,
- 87740.433307505737,
- 87763.381732153779,
- 87786.331657042057,
- 87809.283081974456,
- 87832.236006754916,
- 87855.190431187453,
- 87878.146355076155,
- 87901.103778225151,
- 87924.062700438633,
- 87947.023121520891,
- 87969.985041276246,
- 87992.948459509105,
- 88015.913376023906,
- 88038.879790625171,
- 88061.847703117513,
- 88084.817113305573,
- 88107.788020994049,
- 88130.760425987726,
- 88153.734328091465,
- 88176.709727110137,
- 88199.686622848749,
- 88222.665015112303,
- 88245.644903705906,
- 88268.626288434709,
- 88291.609169103947,
- 88314.593545518903,
- 88337.579417484914,
- 88360.566784807408,
- 88383.555647291854,
- 88406.546004743795,
- 88429.537856968818,
- 88452.531203772611,
- 88475.52604496089,
- 88498.522380339447,
- 88521.52020971413,
- 88544.519532890874,
- 88567.520349675644,
- 88590.522659874507,
- 88613.526463293543,
- 88636.531759738922,
- 88659.538549016899,
- 88682.546830933745,
- 88705.556605295846,
- 88728.567871909589,
- 88751.580630581491,
- 88774.594881118086,
- 88797.610623325963,
- 88820.62785701183,
- 88843.646581982393,
- 88866.666798044462,
- 88889.688505004888,
- 88912.711702670611,
- 88935.7363908486,
- 88958.762569345898,
- 88981.790237969632,
- 89004.81939652696,
- 89027.850044825114,
- 89050.882182671412,
- 89073.9158098732,
- 89096.950926237885,
- 89119.987531572973,
- 89143.025625686001,
- 89166.065208384563,
- 89189.106279476357,
- 89212.148838769106,
- 89235.192886070581,
- 89258.238421188667,
- 89281.285443931265,
- 89304.333954106376,
- 89327.383951522017,
- 89350.435435986306,
- 89373.488407307406,
- 89396.542865293537,
- 89419.598809753006,
- 89442.656240494165,
- 89465.715157325409,
- 89488.775560055219,
- 89511.837448492137,
- 89534.900822444746,
- 89557.965681721733,
- 89581.032026131812,
- 89604.099855483742,
- 89627.169169586399,
- 89650.239968248672,
- 89673.312251279538,
- 89696.386018488018,
- 89719.461269683205,
- 89742.53800467425,
- 89765.616223270365,
- 89788.69592528083,
- 89811.777110514988,
- 89834.859778782207,
- 89857.943929891975,
- 89881.029563653807,
- 89904.116679877261,
- 89927.205278372014,
- 89950.29535894774,
- 89973.386921414218,
- 89996.479965581268,
- 90019.574491258769,
- 90042.670498256688,
- 90065.767986385021,
- 90088.866955453836,
- 90111.967405273259,
- 90135.069335653476,
- 90158.172746404758,
- 90181.277637337407,
- 90204.384008261797,
- 90227.49185898836,
- 90250.601189327586,
- 90273.711999090039,
- 90296.824288086325,
- 90319.938056127125,
- 90343.053303023189,
- 90366.170028585286,
- 90389.288232624298,
- 90412.407914951138,
- 90435.529075376777,
- 90458.651713712257,
- 90481.775829768681,
- 90504.901423357209,
- 90528.028494289058,
- 90551.157042375504,
- 90574.287067427911,
- 90597.418569257643,
- 90620.551547676194,
- 90643.686002495073,
- 90666.821933525847,
- 90689.959340580186,
- 90713.098223469773,
- 90736.238582006365,
- 90759.380416001804,
- 90782.523725267951,
- 90805.668509616764,
- 90828.814768860233,
- 90851.962502810435,
- 90875.11171127946,
- 90898.262394079517,
- 90921.414551022855,
- 90944.568181921743,
- 90967.72328658856,
- 90990.879864835719,
- 91014.037916475718,
- 91037.19744132107,
- 91060.358439184391,
- 91083.520909878338,
- 91106.684853215629,
- 91129.850269009039,
- 91153.017157071401,
- 91176.185517215621,
- 91199.355349254649,
- 91222.526653001492,
- 91245.699428269247,
- 91268.873674871036,
- 91292.049392620058,
- 91315.226581329553,
- 91338.405240812834,
- 91361.585370883287,
- 91384.766971354344,
- 91407.950042039476,
- 91431.134582752245,
- 91454.320593306256,
- 91477.508073515171,
- 91500.697023192712,
- 91523.887442152685,
- 91547.07933020893,
- 91570.272687175326,
- 91593.467512865856,
- 91616.663807094534,
- 91639.861569675442,
- 91663.060800422725,
- 91686.261499150554,
- 91709.463665673218,
- 91732.66729980502,
- 91755.872401360321,
- 91779.078970153569,
- 91802.287005999257,
- 91825.49650871192,
- 91848.707478106167,
- 91871.91991399668,
- 91895.133816198169,
- 91918.349184525418,
- 91941.566018793281,
- 91964.784318816659,
- 91988.004084410495,
- 92011.22531538982,
- 92034.448011569708,
- 92057.672172765277,
- 92080.897798791746,
- 92104.124889464365,
- 92127.353444598411,
- 92150.58346400928,
- 92173.814947512379,
- 92197.04789492322,
- 92220.282306057314,
- 92243.518180730272,
- 92266.755518757753,
- 92289.994319955469,
- 92313.234584139194,
- 92336.476311124774,
- 92359.719500728082,
- 92382.964152765067,
- 92406.210267051734,
- 92429.457843404161,
- 92452.706881638471,
- 92475.957381570814,
- 92499.209343017443,
- 92522.462765794655,
- 92545.717649718805,
- 92568.973994606305,
- 92592.231800273614,
- 92615.491066537259,
- 92638.751793213814,
- 92662.01398011994,
- 92685.277627072326,
- 92708.54273388772,
- 92731.809300382942,
- 92755.077326374871,
- 92778.346811680414,
- 92801.617756116568,
- 92824.890159500384,
- 92848.164021648947,
- 92871.439342379424,
- 92894.716121509016,
- 92917.994358855023,
- 92941.274054234746,
- 92964.555207465572,
- 92987.837818364962,
- 93011.121886750407,
- 93034.407412439468,
- 93057.694395249753,
- 93080.982834998955,
- 93104.272731504767,
- 93127.564084584999,
- 93150.856894057491,
- 93174.15115974014,
- 93197.446881450916,
- 93220.744059007804,
- 93244.04269222889,
- 93267.342780932304,
- 93290.644324936235,
- 93313.947324058914,
- 93337.251778118633,
- 93360.557686933767,
- 93383.865050322696,
- 93407.173868103928,
- 93430.484140095941,
- 93453.795866117362,
- 93477.109045986799,
- 93500.423679522952,
- 93523.739766544561,
- 93547.057306870454,
- 93570.376300319491,
- 93593.696746710571,
- 93617.018645862699,
- 93640.341997594893,
- 93663.666801726242,
- 93686.993058075881,
- 93710.320766463032,
- 93733.64992670693,
- 93756.980538626914,
- 93780.312602042337,
- 93803.646116772637,
- 93826.981082637285,
- 93850.317499455836,
- 93873.655367047861,
- 93896.994685233032,
- 93920.335453831038,
- 93943.677672661666,
- 93967.021341544707,
- 93990.366460300051,
- 94013.713028747632,
- 94037.061046707429,
- 94060.410513999494,
- 94083.761430443905,
- 94107.113795860845,
- 94130.467610070496,
- 94153.822872893157,
- 94177.179584149111,
- 94200.537743658759,
- 94223.897351242529,
- 94247.25840672091,
- 94270.620909914433,
- 94293.98486064373,
- 94317.350258729421,
- 94340.71710399224,
- 94364.085396252936,
- 94387.455135332348,
- 94410.82632105134,
- 94434.198953230851,
- 94457.573031691878,
- 94480.948556255447,
- 94504.325526742658,
- 94527.70394297468,
- 94551.083804772716,
- 94574.465111958023,
- 94597.847864351934,
- 94621.232061775823,
- 94644.617704051096,
- 94668.004790999272,
- 94691.393322441872,
- 94714.783298200506,
- 94738.174718096794,
- 94761.567581952477,
- 94784.961889589307,
- 94808.357640829097,
- 94831.754835493703,
- 94855.153473405066,
- 94878.553554385173,
- 94901.955078256055,
- 94925.358044839784,
- 94948.762453958523,
- 94972.168305434476,
- 94995.575599089891,
- 95018.984334747074,
- 95042.394512228391,
- 95065.806131356265,
- 95089.219191953176,
- 95112.633693841635,
- 95136.04963684424,
- 95159.467020783617,
- 95182.885845482466,
- 95206.306110763529,
- 95229.727816449609,
- 95253.150962363579,
- 95276.575548328314,
- 95300.001574166803,
- 95323.429039702052,
- 95346.857944757154,
- 95370.288289155214,
- 95393.720072719429,
- 95417.153295273019,
- 95440.587956639298,
- 95464.024056641589,
- 95487.461595103305,
- 95510.900571847902,
- 95534.340986698866,
- 95557.782839479783,
- 95581.226130014256,
- 95604.670858125959,
- 95628.117023638595,
- 95651.564626375985,
- 95675.013666161918,
- 95698.464142820303,
- 95721.916056175076,
- 95745.369406050231,
- 95768.824192269807,
- 95792.280414657915,
- 95815.738073038709,
- 95839.197167236387,
- 95862.657697075221,
- 95886.11966237954,
- 95909.583062973688,
- 95933.047898682111,
- 95956.514169329268,
- 95979.981874739708,
- 96003.451014738006,
- 96026.921589148798,
- 96050.393597796792,
- 96073.867040506724,
- 96097.341917103375,
- 96120.818227411626,
- 96144.295971256375,
- 96167.775148462577,
- 96191.255758855244,
- 96214.737802259449,
- 96238.221278500292,
- 96261.70618740299,
- 96285.192528792715,
- 96308.680302494788,
- 96332.169508334526,
- 96355.660146137321,
- 96379.152215728609,
- 96402.645716933868,
- 96426.14064957868,
- 96449.637013488609,
- 96473.134808489311,
- 96496.63403440651,
- 96520.134691065963,
- 96543.636778293469,
- 96567.140295914898,
- 96590.645243756153,
- 96614.151621643221,
- 96637.659429402134,
- 96661.168666858954,
- 96684.679333839798,
- 96708.191430170875,
- 96731.70495567839,
- 96755.219910188665,
- 96778.736293528011,
- 96802.254105522836,
- 96825.77334599958,
- 96849.29401478474,
- 96872.816111704873,
- 96896.339636586577,
- 96919.864589256511,
- 96943.390969541389,
- 96966.918777267958,
- 96990.448012263048,
- 97013.978674353522,
- 97037.510763366285,
- 97061.044279128328,
- 97084.579221466673,
- 97108.115590208385,
- 97131.653385180587,
- 97155.19260621049,
- 97178.733253125291,
- 97202.2753257523,
- 97225.81882391886,
- 97249.363747452342,
- 97272.910096180189,
- 97296.457869929916,
- 97320.007068529041,
- 97343.557691805196,
- 97367.109739586012,
- 97390.663211699197,
- 97414.218107972498,
- 97437.774428233737,
- 97461.332172310766,
- 97484.891340031507,
- 97508.451931223899,
- 97532.013945715982,
- 97555.577383335811,
- 97579.142243911512,
- 97602.708527271257,
- 97626.276233243261,
- 97649.845361655811,
- 97673.415912337223,
- 97696.987885115886,
- 97720.561279820206,
- 97744.1360962787,
- 97767.712334319876,
- 97791.289993772341,
- 97814.869074464703,
- 97838.449576225685,
- 97862.031498883996,
- 97885.614842268449,
- 97909.199606207883,
- 97932.785790531183,
- 97956.37339506732,
- 97979.962419645264,
- 98003.552864094076,
- 98027.144728242856,
- 98050.738011920766,
- 98074.332714956996,
- 98097.928837180807,
- 98121.526378421506,
- 98145.125338508456,
- 98168.725717271067,
- 98192.327514538789,
- 98215.930730141132,
- 98239.535363907664,
- 98263.141415668011,
- 98286.748885251814,
- 98310.357772488816,
- 98333.968077208759,
- 98357.579799241488,
- 98381.192938416847,
- 98404.807494564782,
- 98428.42346751524,
- 98452.040857098269,
- 98475.659663143917,
- 98499.27988548232,
- 98522.901523943656,
- 98546.524578358163,
- 98570.149048556093,
- 98593.774934367786,
- 98617.402235623624,
- 98641.030952154048,
- 98664.661083789513,
- 98688.292630360564,
- 98711.925591697771,
- 98735.559967631794,
- 98759.195757993293,
- 98782.832962613014,
- 98806.471581321734,
- 98830.111613950285,
- 98853.753060329575,
- 98877.39592029051,
- 98901.040193664099,
- 98924.68588028138,
- 98948.33297997342,
- 98971.981492571387,
- 98995.63141790645,
- 99019.282755809851,
- 99042.935506112874,
- 99066.589668646877,
- 99090.245243243233,
- 99113.902229733401,
- 99137.560627948857,
- 99161.220437721131,
- 99184.881658881859,
- 99208.544291262631,
- 99232.208334695169,
- 99255.87378901121,
- 99279.540654042547,
- 99303.208929621018,
- 99326.878615578535,
- 99350.549711746993,
- 99374.222217958435,
- 99397.896134044888,
- 99421.571459838422,
- 99445.248195171211,
- 99468.926339875441,
- 99492.605893783344,
- 99516.286856727209,
- 99539.969228539398,
- 99563.653009052287,
- 99587.338198098325,
- 99611.024795510006,
- 99634.712801119866,
- 99658.402214760499,
- 99682.093036264545,
- 99705.785265464699,
- 99729.478902193689,
- 99753.173946284325,
- 99776.870397569437,
- 99800.56825588191,
- 99824.267521054688,
- 99847.968192920773,
- 99871.670271313182,
- 99895.373756065004,
- 99919.078647009388,
- 99942.78494397951,
- 99966.492646808634,
- 99990.20175533001,
- 100013.91226937699,
- 100037.62418878295,
- 100061.33751338134,
- 100085.05224300563,
- 100108.76837748935,
- 100132.4859166661,
- 100156.2048603695,
- 100179.92520843323,
- 100203.64696069101,
- 100227.37011697664,
- 100251.09467712394,
- 100274.82064096678,
- 100298.54800833909,
- 100322.27677907483,
- 100346.00695300807,
- 100369.73852997283,
- 100393.47150980328,
- 100417.20589233354,
- 100440.94167739789,
- 100464.67886483055,
- 100488.41745446586,
- 100512.1574461382,
- 100535.89883968196,
- 100559.64163493161,
- 100583.38583172169,
- 100607.13142988674,
- 100630.87842926137,
- 100654.62682968024,
- 100678.37663097809,
- 100702.12783298964,
- 100725.88043554971,
- 100749.63443849317,
- 100773.38984165489,
- 100797.14664486986,
- 100820.90484797307,
- 100844.66445079957,
- 100868.42545318443,
- 100892.18785496285,
- 100915.95165596998,
- 100939.71685604109,
- 100963.48345501146,
- 100987.25145271645,
- 101011.02084899142,
- 101034.79164367182,
- 101058.56383659317,
- 101082.33742759094,
- 101106.11241650078,
- 101129.88880315828,
- 101153.66658739912,
- 101177.44576905905,
- 101201.22634797383,
- 101225.00832397929,
- 101248.7916969113,
- 101272.57646660579,
- 101296.36263289873,
- 101320.15019562612,
- 101343.93915462404,
- 101367.7295097286,
- 101391.52126077596,
- 101415.31440760233,
- 101439.10895004397,
- 101462.9048879372,
- 101486.70222111834,
- 101510.50094942382,
- 101534.30107269008,
- 101558.10259075361,
- 101581.90550345098,
- 101605.70981061876,
- 101629.5155120936,
- 101653.32260771218,
- 101677.13109731126,
- 101700.9409807276,
- 101724.75225779804,
- 101748.56492835947,
- 101772.37899224881,
- 101796.19444930303,
- 101820.01129935916,
- 101843.82954225427,
- 101867.64917782549,
- 101891.47020590997,
- 101915.29262634492,
- 101939.11643896763,
- 101962.94164361537,
- 101986.76824012553,
- 102010.59622833549,
- 102034.42560808272,
- 102058.25637920471,
- 102082.08854153901,
- 102105.9220949232,
- 102129.75703919494,
- 102153.59337419191,
- 102177.43109975185,
- 102201.27021571253,
- 102225.1107219118,
- 102248.95261818753,
- 102272.79590437764,
- 102296.64058032009,
- 102320.48664585294,
- 102344.33410081422,
- 102368.18294504205,
- 102392.03317837461,
- 102415.88480065008,
- 102439.73781170673,
- 102463.59221138287,
- 102487.44799951684,
- 102511.30517594704,
- 102535.1637405119,
- 102559.02369304992,
- 102582.88503339965,
- 102606.74776139967,
- 102630.61187688859,
- 102654.4773797051,
- 102678.34426968795,
- 102702.21254667587,
- 102726.08221050771,
- 102749.95326102231,
- 102773.8256980586,
- 102797.69952145554,
- 102821.57473105213,
- 102845.45132668741,
- 102869.32930820051,
- 102893.20867543056,
- 102917.08942821674,
- 102940.97156639832,
- 102964.85508981455,
- 102988.73999830478,
- 103012.6262917084,
- 103036.51396986481,
- 103060.40303261351,
- 103084.293479794,
- 103108.18531124585,
- 103132.07852680866,
- 103155.97312632212,
- 103179.8691096259,
- 103203.76647655977,
- 103227.66522696352,
- 103251.56536067701,
- 103275.46687754011,
- 103299.36977739276,
- 103323.27406007495,
- 103347.1797254267,
- 103371.0867732881,
- 103394.99520349925,
- 103418.90501590034,
- 103442.81621033157,
- 103466.72878663319,
- 103490.64274464553,
- 103514.55808420894,
- 103538.4748051638,
- 103562.39290735057,
- 103586.31239060973,
- 103610.23325478184,
- 103634.15549970744,
- 103658.07912522719,
- 103682.00413118176,
- 103705.93051741188,
- 103729.85828375829,
- 103753.78743006183,
- 103777.71795616332,
- 103801.64986190372,
- 103825.58314712394,
- 103849.51781166498,
- 103873.4538553679,
- 103897.39127807376,
- 103921.33007962372,
- 103945.27025985894,
- 103969.21181862066,
- 103993.15475575015,
- 104017.0990710887,
- 104041.0447644777,
- 104064.99183575854,
- 104088.94028477269,
- 104112.89011136163,
- 104136.84131536692,
- 104160.79389663014,
- 104184.74785499295,
- 104208.70319029699,
- 104232.65990238401,
- 104256.61799109577,
- 104280.57745627411,
- 104304.53829776087,
- 104328.50051539797,
- 104352.46410902737,
- 104376.42907849104,
- 104400.39542363105,
- 104424.36314428948,
- 104448.33224030846,
- 104472.3027115302,
- 104496.27455779689,
- 104520.24777895081,
- 104544.22237483428,
- 104568.19834528965,
- 104592.17569015936,
- 104616.15440928582,
- 104640.13450251156,
- 104664.1159696791,
- 104688.09881063103,
- 104712.08302520998,
- 104736.06861325864,
- 104760.05557461972,
- 104784.043909136,
- 104808.03361665027,
- 104832.0246970054,
- 104856.01715004431,
- 104880.01097560991,
- 104904.00617354522,
- 104928.00274369326,
- 104952.00068589712,
- 104975.99999999993,
- 105000.00068584486,
- 105024.00274327511,
- 105048.00617213396,
- 105072.0109722647,
- 105096.0171435107,
- 105120.02468571534,
- 105144.03359872208,
- 105168.04388237436,
- 105192.05553651576,
- 105216.06856098982,
- 105240.08295564017,
- 105264.09872031047,
- 105288.11585484444,
- 105312.13435908582,
- 105336.1542328784,
- 105360.17547606604,
- 105384.19808849262,
- 105408.22207000206,
- 105432.24742043833,
- 105456.27413964548,
- 105480.30222746753,
- 105504.33168374863,
- 105528.36250833291,
- 105552.39470106458,
- 105576.42826178786,
- 105600.46319034706,
- 105624.49948658649,
- 105648.53715035053,
- 105672.5761814836,
- 105696.61657983017,
- 105720.65834523473,
- 105744.70147754184,
- 105768.7459765961,
- 105792.79184224214,
- 105816.83907432464,
- 105840.88767268835,
- 105864.93763717801,
- 105888.98896763846,
- 105913.04166391456,
- 105937.09572585119,
- 105961.15115329332,
- 105985.20794608595,
- 106009.26610407409,
- 106033.32562710284,
- 106057.38651501729,
- 106081.44876766266,
- 106105.51238488412,
- 106129.57736652695,
- 106153.64371243643,
- 106177.71142245791,
- 106201.78049643678,
- 106225.85093421848,
- 106249.92273564848,
- 106273.99590057228,
- 106298.07042883546,
- 106322.14632028362,
- 106346.22357476239,
- 106370.30219211751,
- 106394.38217219469,
- 106418.46351483969,
- 106442.54621989837,
- 106466.63028721658,
- 106490.71571664025,
- 106514.80250801529,
- 106538.89066118775,
- 106562.98017600364,
- 106587.07105230905,
- 106611.16328995011,
- 106635.25688877302,
- 106659.35184862395,
- 106683.44816934918,
- 106707.54585079502,
- 106731.64489280782,
- 106755.74529523395,
- 106779.84705791986,
- 106803.95018071201,
- 106828.05466345693,
- 106852.16050600118,
- 106876.26770819137,
- 106900.37626987413,
- 106924.48619089619,
- 106948.59747110425,
- 106972.71011034511,
- 106996.82410846559,
- 107020.93946531253,
- 107045.05618073288,
- 107069.17425457356,
- 107093.29368668159,
- 107117.41447690397,
- 107141.53662508781,
- 107165.66013108024,
- 107189.7849947284,
- 107213.91121587952,
- 107238.03879438085,
- 107262.16773007967,
- 107286.29802282334,
- 107310.42967245923,
- 107334.56267883476,
- 107358.69704179741,
- 107382.83276119467,
- 107406.96983687414,
- 107431.10826868335,
- 107455.24805646999,
- 107479.38920008171,
- 107503.53169936626,
- 107527.67555417139,
- 107551.82076434491,
- 107575.96732973469,
- 107600.11525018861,
- 107624.26452555459,
- 107648.41515568066,
- 107672.56714041479,
- 107696.72047960508,
- 107720.87517309963,
- 107745.03122074658,
- 107769.18862239413,
- 107793.34737789053,
- 107817.50748708403,
- 107841.66894982298,
- 107865.83176595572,
- 107889.99593533068,
- 107914.16145779629,
- 107938.32833320105,
- 107962.49656139348,
- 107986.66614222217,
- 108010.83707553572,
- 108035.00936118282,
- 108059.18299901215,
- 108083.35798887245,
- 108107.53433061253,
- 108131.71202408121,
- 108155.89106912735,
- 108180.07146559987,
- 108204.25321334775,
- 108228.43631221994,
- 108252.62076206553,
- 108276.80656273357,
- 108300.99371407321,
- 108325.18221593359,
- 108349.37206816394,
- 108373.56327061349,
- 108397.75582313156,
- 108421.94972556747,
- 108446.1449777706,
- 108470.34157959036,
- 108494.53953087622,
- 108518.73883147769,
- 108542.93948124432,
- 108567.14148002568,
- 108591.34482767139,
- 108615.54952403114,
- 108639.75556895464,
- 108663.96296229165,
- 108688.17170389196,
- 108712.38179360541,
- 108736.59323128188,
- 108760.80601677128,
- 108785.02014992358,
- 108809.23563058881,
- 108833.45245861699,
- 108857.67063385822,
- 108881.89015616261,
- 108906.11102538036,
- 108930.33324136167,
- 108954.55680395682,
- 108978.78171301607,
- 109003.00796838976,
- 109027.23556992831,
- 109051.46451748211,
- 109075.69481090162,
- 109099.92645003737,
- 109124.15943473989,
- 109148.39376485976,
- 109172.62944024763,
- 109196.86646075416,
- 109221.10482623006,
- 109245.34453652608,
- 109269.58559149304,
- 109293.82799098175,
- 109318.07173484311,
- 109342.31682292801,
- 109366.56325508743,
- 109390.81103117237,
- 109415.06015103387,
- 109439.31061452301,
- 109463.56242149093,
- 109487.8155717888,
- 109512.07006526781,
- 109536.3259017792,
- 109560.58308117429,
- 109584.8416033044,
- 109609.1014680209,
- 109633.36267517522,
- 109657.62522461878,
- 109681.88911620311,
- 109706.15434977971,
- 109730.4209252002,
- 109754.68884231619,
- 109778.95810097932,
- 109803.22870104131,
- 109827.50064235389,
- 109851.77392476884,
- 109876.04854813802,
- 109900.32451231324,
- 109924.60181714644,
- 109948.88046248957,
- 109973.1604481946,
- 109997.44177411357,
- 110021.72444009855,
- 110046.00844600165,
- 110070.29379167501,
- 110094.58047697082,
- 110118.86850174134,
- 110143.15786583882,
- 110167.44856911557,
- 110191.74061142397,
- 110216.03399261639,
- 110240.32871254528,
- 110264.62477106311,
- 110288.9221680224,
- 110313.22090327571,
- 110337.52097667565,
- 110361.82238807483,
- 110386.12513732594,
- 110410.42922428172,
- 110434.73464879491,
- 110459.04141071832,
- 110483.34950990479,
- 110507.6589462072,
- 110531.96971947847,
- 110556.28182957157,
- 110580.5952763395,
- 110604.91005963532,
- 110629.22617931209,
- 110653.54363522294,
- 110677.86242722106,
- 110702.18255515963,
- 110726.50401889188,
- 110750.82681827113,
- 110775.1509531507,
- 110799.47642338395,
- 110823.80322882428,
- 110848.13136932514,
- 110872.46084474004,
- 110896.79165492248,
- 110921.12379972603,
- 110945.4572790043,
- 110969.79209261097,
- 110994.12824039967,
- 111018.46572222417,
- 111042.80453793822,
- 111067.14468739564,
- 111091.48617045028,
- 111115.82898695602,
- 111140.1731367668,
- 111164.51861973655,
- 111188.86543571933,
- 111213.21358456917,
- 111237.56306614014,
- 111261.91388028639,
- 111286.26602686207,
- 111310.61950572141,
- 111334.97431671864,
- 111359.33045970804,
- 111383.68793454397,
- 111408.04674108078,
- 111432.40687917286,
- 111456.76834867468,
- 111481.13114944073,
- 111505.49528132551,
- 111529.86074418361,
- 111554.22753786964,
- 111578.59566223821,
- 111602.96511714405,
- 111627.33590244185,
- 111651.7080179864,
- 111676.08146363248,
- 111700.45623923496,
- 111724.8323446487,
- 111749.20977972864,
- 111773.58854432974,
- 111797.96863830699,
- 111822.35006151545,
- 111846.73281381019,
- 111871.11689504632,
- 111895.50230507903,
- 111919.8890437635,
- 111944.27711095495,
- 111968.6665065087,
- 111993.05723028004,
- 112017.44928212435,
- 112041.842661897,
- 112066.23736945343,
- 112090.63340464912,
- 112115.03076733962,
- 112139.42945738042,
- 112163.82947462716,
- 112188.23081893545,
- 112212.63349016097,
- 112237.03748815943,
- 112261.44281278658,
- 112285.84946389822,
- 112310.25744135017,
- 112334.66674499828,
- 112359.07737469849,
- 112383.48933030672,
- 112407.90261167898,
- 112432.31721867126,
- 112456.73315113965,
- 112481.15040894024,
- 112505.56899192919,
- 112529.98889996267,
- 112554.41013289688,
- 112578.8326905881,
- 112603.25657289263,
- 112627.68177966679,
- 112652.10831076698,
- 112676.53616604958,
- 112700.96534537108,
- 112725.39584858794,
- 112749.82767555672,
- 112774.26082613398,
- 112798.6953001763,
- 112823.13109754038,
- 112847.56821808286,
- 112872.00666166049,
- 112896.44642813003,
- 112920.88751734827,
- 112945.32992917208,
- 112969.77366345831,
- 112994.21872006389,
- 113018.66509884578,
- 113043.11279966099,
- 113067.56182236652,
- 113092.01216681948,
- 113116.46383287695,
- 113140.9168203961,
- 113165.37112923413,
- 113189.82675924824,
- 113214.28371029573,
- 113238.74198223387,
- 113263.20157492002,
- 113287.66248821157,
- 113312.12472196593,
- 113336.58827604055,
- 113361.05315029295,
- 113385.51934458067,
- 113409.98685876124,
- 113434.45569269233,
- 113458.92584623155,
- 113483.39731923661,
- 113507.87011156522,
- 113532.34422307517,
- 113556.81965362425,
- 113581.2964030703,
- 113605.77447127122,
- 113630.25385808491,
- 113654.73456336933,
- 113679.2165869825,
- 113703.69992878241,
- 113728.18458862718,
- 113752.67056637487,
- 113777.15786188368,
- 113801.64647501177,
- 113826.13640561736,
- 113850.62765355874,
- 113875.12021869418,
- 113899.61410088204,
- 113924.1092999807,
- 113948.60581584855,
- 113973.10364834407,
- 113997.60279732574,
- 114022.1032626521,
- 114046.60504418171,
- 114071.10814177318,
- 114095.61255528514,
- 114120.11828457628,
- 114144.62532950533,
- 114169.13368993104,
- 114193.6433657122,
- 114218.15435670764,
- 114242.66666277625,
- 114267.18028377694,
- 114291.69521956862,
- 114316.21147001031,
- 114340.72903496103,
- 114365.24791427983,
- 114389.7681078258,
- 114414.2896154581,
- 114438.81243703589,
- 114463.33657241837,
- 114487.8620214648,
- 114512.38878403447,
- 114536.91685998671,
- 114561.44624918087,
- 114585.97695147636,
- 114610.5089667326,
- 114635.04229480909,
- 114659.57693556532,
- 114684.11288886084,
- 114708.65015455526,
- 114733.18873250818,
- 114757.72862257928,
- 114782.26982462825,
- 114806.81233851484,
- 114831.35616409882,
- 114855.90130123998,
- 114880.44774979822,
- 114904.99550963337,
- 114929.5445806054,
- 114954.09496257425,
- 114978.64665539992,
- 115003.19965894247,
- 115027.75397306195,
- 115052.30959761847,
- 115076.86653247218,
- 115101.42477748329,
- 115125.984332512,
- 115150.54519741859,
- 115175.10737206334,
- 115199.67085630659,
- 115224.23565000873,
- 115248.80175303014,
- 115273.3691652313,
- 115297.93788647266,
- 115322.50791661476,
- 115347.07925551817,
- 115371.65190304347,
- 115396.22585905129,
- 115420.80112340231,
- 115445.37769595724,
- 115469.95557657682,
- 115494.53476512182,
- 115519.11526145306,
- 115543.69706543141,
- 115568.28017691776,
- 115592.86459577303,
- 115617.4503218582,
- 115642.03735503425,
- 115666.62569516223,
- 115691.21534210323,
- 115715.80629571836,
- 115740.39855586876,
- 115764.99212241563,
- 115789.58699522018,
- 115814.18317414368,
- 115838.78065904744,
- 115863.37944979276,
- 115887.97954624105,
- 115912.5809482537,
- 115937.18365569216,
- 115961.78766841792,
- 115986.39298629249,
- 116010.99960917742,
- 116035.60753693432,
- 116060.21676942479,
- 116084.82730651053,
- 116109.43914805322,
- 116134.0522939146,
- 116158.66674395646,
- 116183.2824980406,
- 116207.89955602887,
- 116232.51791778316,
- 116257.13758316539,
- 116281.75855203751,
- 116306.38082426153,
- 116331.00439969949,
- 116355.62927821343,
- 116380.25545966547,
- 116404.88294391775,
- 116429.51173083246,
- 116454.14182027178,
- 116478.77321209799,
- 116503.40590617337,
- 116528.03990236025,
- 116552.67520052097,
- 116577.31180051794,
- 116601.94970221359,
- 116626.5889054704,
- 116651.22941015086,
- 116675.87121611751,
- 116700.51432323294,
- 116725.15873135976,
- 116749.8044403606,
- 116774.45145009817,
- 116799.0997604352,
- 116823.74937123443,
- 116848.40028235866,
- 116873.05249367072,
- 116897.70600503348,
- 116922.36081630984,
- 116947.01692736275,
- 116971.67433805518,
- 116996.33304825013,
- 117020.99305781067,
- 117045.65436659988,
- 117070.31697448085,
- 117094.98088131678,
- 117119.64608697082,
- 117144.31259130624,
- 117168.98039418629,
- 117193.64949547425,
- 117218.31989503348,
- 117242.99159272734,
- 117267.66458841923,
- 117292.33888197262,
- 117317.01447325097,
- 117341.6913621178,
- 117366.36954843666,
- 117391.04903207115,
- 117415.72981288488,
- 117440.41189074152,
- 117465.09526550474,
- 117489.77993703831,
- 117514.46590520597,
- 117539.15316987153,
- 117563.84173089883,
- 117588.53158815173,
- 117613.22274149416,
- 117637.91519079007,
- 117662.60893590341,
- 117687.30397669821,
- 117712.00031303853,
- 117736.69794478847,
- 117761.39687181212,
- 117786.09709397367,
- 117810.7986111373,
- 117835.50142316725,
- 117860.20552992777,
- 117884.91093128319,
- 117909.6176270978,
- 117934.32561723603,
- 117959.03490156225,
- 117983.74547994092,
- 118008.45735223651,
- 118033.17051831353,
- 118057.88497803656,
- 118082.60073127014,
- 118107.31777787894,
- 118132.03611772758,
- 118156.75575068076,
- 118181.47667660323,
- 118206.19889535972,
- 118230.92240681504,
- 118255.64721083404,
- 118280.37330728157,
- 118305.10069602253,
- 118329.82937692189,
- 118354.55934984458,
- 118379.29061465565,
- 118404.02317122012,
- 118428.75701940308,
- 118453.49215906965,
- 118478.22859008498,
- 118502.96631231424,
- 118527.70532562268,
- 118552.44562987552,
- 118577.18722493808,
- 118601.93011067568,
- 118626.67428695368,
- 118651.41975363747,
- 118676.16651059251,
- 118700.91455768423,
- 118725.66389477813,
- 118750.41452173979,
- 118775.16643843475,
- 118799.91964472862,
- 118824.67414048707,
- 118849.42992557574,
- 118874.18699986035,
- 118898.94536320666,
- 118923.70501548045,
- 118948.46595654752,
- 118973.22818627374,
- 118997.99170452499,
- 119022.7565111672,
- 119047.52260606633,
- 119072.28998908834,
- 119097.0586600993,
- 119121.82861896523,
- 119146.59986555226,
- 119171.3723997265,
- 119196.14622135412,
- 119220.92133030134,
- 119245.69772643436,
- 119270.47540961947,
- 119295.25437972297,
- 119320.03463661121,
- 119344.81618015055,
- 119369.5990102074,
- 119394.38312664822,
- 119419.16852933947,
- 119443.95521814766,
- 119468.74319293935,
- 119493.53245358112,
- 119518.32299993958,
- 119543.11483188139,
- 119567.90794927324,
- 119592.70235198183,
- 119617.49803987393,
- 119642.29501281632,
- 119667.09327067583,
- 119691.89281331931,
- 119716.69364061367,
- 119741.49575242582,
- 119766.29914862274,
- 119791.10382907141,
- 119815.90979363887,
- 119840.71704219218,
- 119865.52557459843,
- 119890.33539072477,
- 119915.14649043836,
- 119939.95887360642,
- 119964.77254009615,
- 119989.58748977486,
- 120014.40372250983,
- 120039.22123816841,
- 120064.04003661797,
- 120088.86011772591,
- 120113.6814813597,
- 120138.5041273868,
- 120163.3280556747,
- 120188.15326609099,
- 120212.97975850321,
- 120237.807532779,
- 120262.63658878599,
- 120287.46692639188,
- 120312.29854546436,
- 120337.13144587121,
- 120361.9656274802,
- 120386.80109015915,
- 120411.63783377589,
- 120436.47585819835,
- 120461.31516329442,
- 120486.15574893207,
- 120510.99761497928,
- 120535.84076130406,
- 120560.68518777451,
- 120585.53089425867,
- 120610.3778806247,
- 120635.22614674074,
- 120660.07569247499,
- 120684.92651769568,
- 120709.77862227106,
- 120734.63200606944,
- 120759.48666895913,
- 120784.3426108085,
- 120809.19983148595,
- 120834.05833085992,
- 120858.91810879884,
- 120883.77916517125,
- 120908.64149984565,
- 120933.5051126906,
- 120958.37000357473,
- 120983.23617236665,
- 121008.10361893504,
- 121032.97234314861,
- 121057.84234487606,
- 121082.71362398617,
- 121107.58618034775,
- 121132.46001382964,
- 121157.33512430069,
- 121182.21151162982,
- 121207.08917568595,
- 121231.96811633807,
- 121256.84833345517,
- 121281.72982690629,
- 121306.61259656049,
- 121331.49664228689,
- 121356.38196395461,
- 121381.26856143285,
- 121406.15643459078,
- 121431.04558329767,
- 121455.93600742276,
- 121480.82770683538,
- 121505.72068140487,
- 121530.61493100057,
- 121555.51045549192,
- 121580.40725474835,
- 121605.30532863933,
- 121630.20467703436,
- 121655.10529980299,
- 121680.00719681478,
- 121704.91036793934,
- 121729.81481304632,
- 121754.72053200539,
- 121779.62752468624,
- 121804.53579095862,
- 121829.44533069231,
- 121854.3561437571,
- 121879.26823002285,
- 121904.1815893594,
- 121929.09622163669,
- 121954.01212672464,
- 121978.92930449323,
- 122003.84775481246,
- 122028.76747755238,
- 122053.68847258303,
- 122078.61073977455,
- 122103.53427899707,
- 122128.45909012076,
- 122153.38517301581,
- 122178.31252755247,
- 122203.24115360099,
- 122228.17105103172,
- 122253.10221971494,
- 122278.03465952107,
- 122302.96837032049,
- 122327.90335198362,
- 122352.83960438096,
- 122377.777127383,
- 122402.71592086025,
- 122427.65598468333,
- 122452.59731872278,
- 122477.53992284928,
- 122502.48379693348,
- 122527.42894084606,
- 122552.37535445779,
- 122577.32303763942,
- 122602.27199026172,
- 122627.22221219557,
- 122652.17370331181,
- 122677.12646348133,
- 122702.08049257506,
- 122727.03579046397,
- 122751.99235701906,
- 122776.95019211136,
- 122801.9092956119,
- 122826.8696673918,
- 122851.83130732219,
- 122876.79421527422,
- 122901.75839111909,
- 122926.72383472799,
- 122951.69054597223,
- 122976.65852472307,
- 123001.62777085182,
- 123026.59828422987,
- 123051.57006472857,
- 123076.54311221937,
- 123101.5174265737,
- 123126.49300766307,
- 123151.46985535898,
- 123176.44796953299,
- 123201.42735005668,
- 123226.40799680166,
- 123251.38990963959,
- 123276.37308844214,
- 123301.35753308103,
- 123326.343243428,
- 123351.33021935483,
- 123376.31846073334,
- 123401.30796743535,
- 123426.29873933276,
- 123451.29077629748,
- 123476.28407820144,
- 123501.2786449166,
- 123526.27447631498,
- 123551.27157226863,
- 123576.26993264959,
- 123601.26955732999,
- 123626.27044618195,
- 123651.27259907764,
- 123676.27601588926,
- 123701.28069648903,
- 123726.28664074924,
- 123751.29384854218,
- 123776.30231974016,
- 123801.31205421555,
- 123826.32305184075,
- 123851.33531248817,
- 123876.34883603029,
- 123901.36362233957,
- 123926.37967128855,
- 123951.39698274979,
- 123976.41555659588,
- 124001.43539269941,
- 124026.45649093305,
- 124051.47885116948,
- 124076.50247328142,
- 124101.5273571416,
- 124126.55350262282,
- 124151.58090959788,
- 124176.60957793961,
- 124201.63950752091,
- 124226.67069821467,
- 124251.70314989384,
- 124276.73686243138,
- 124301.7718357003,
- 124326.80806957364,
- 124351.84556392446,
- 124376.88431862585,
- 124401.92433355095,
- 124426.96560857294,
- 124452.00814356498,
- 124477.05193840031,
- 124502.0969929522,
- 124527.14330709392,
- 124552.19088069882,
- 124577.23971364023,
- 124602.28980579154,
- 124627.34115702618,
- 124652.3937672176,
- 124677.44763623926,
- 124702.50276396469,
- 124727.55915026742,
- 124752.61679502104,
- 124777.67569809916,
- 124802.73585937542,
- 124827.79727872348,
- 124852.85995601704,
- 124877.92389112986,
- 124902.98908393568,
- 124928.05553430831,
- 124953.1232421216,
- 124978.19220724938,
- 125003.26242956554,
- 125028.33390894404,
- 125053.40664525882,
- 125078.48063838384,
- 125103.55588819318,
- 125128.63239456083,
- 125153.71015736091,
- 125178.78917646752,
- 125203.86945175481,
- 125228.95098309696,
- 125254.03377036817,
- 125279.1178134427,
- 125304.20311219479,
- 125329.28966649878,
- 125354.37747622898,
- 125379.46654125977,
- 125404.55686146552,
- 125429.6484367207,
- 125454.74126689974,
- 125479.83535187715,
- 125504.93069152744,
- 125530.02728572517,
- 125555.12513434493,
- 125580.22423726133,
- 125605.32459434902,
- 125630.4262054827,
- 125655.52907053704,
- 125680.63318938682,
- 125705.73856190679,
- 125730.84518797178,
- 125755.9530674566,
- 125781.06220023613,
- 125806.17258618528,
- 125831.28422517896,
- 125856.39711709213,
- 125881.51126179981,
- 125906.62665917698,
- 125931.74330909875,
- 125956.86121144016,
- 125981.98036607634,
- 126007.10077288245,
- 126032.22243173365,
- 126057.34534250517,
- 126082.46950507225,
- 126107.59491931014,
- 126132.72158509417,
- 126157.84950229966,
- 126182.97867080198,
- 126208.10909047653,
- 126233.24076119871,
- 126258.37368284403,
- 126283.50785528794,
- 126308.64327840599,
- 126333.77995207369,
- 126358.91787616667,
- 126384.0570505605,
- 126409.19747513086,
- 126434.3391497534,
- 126459.48207430386,
- 126484.62624865794,
- 126509.77167269142,
- 126534.9183462801,
- 126560.06626929982,
- 126585.21544162642,
- 126610.36586313581,
- 126635.51753370393,
- 126660.67045320668,
- 126685.82462152008,
- 126710.98003852014,
- 126736.13670408291,
- 126761.29461808444,
- 126786.45378040087,
- 126811.61419090834,
- 126836.77584948298,
- 126861.93875600102,
- 126887.10291033868,
- 126912.26831237224,
- 126937.43496197795,
- 126962.60285903217,
- 126987.77200341123,
- 127012.94239499152,
- 127038.11403364947,
- 127063.2869192615,
- 127088.46105170409,
- 127113.63643085376,
- 127138.81305658702,
- 127163.99092878048,
- 127189.17004731069,
- 127214.35041205429,
- 127239.53202288797,
- 127264.71487968838,
- 127289.89898233226,
- 127315.08433069635,
- 127340.27092465744,
- 127365.45876409234,
- 127390.64784887788,
- 127415.83817889093,
- 127441.02975400841,
- 127466.22257410725,
- 127491.41663906439,
- 127516.61194875685,
- 127541.80850306165,
- 127567.00630185583,
- 127592.20534501647,
- 127617.4056324207,
- 127642.60716394568,
- 127667.80993946856,
- 127693.01395886653,
- 127718.21922201688,
- 127743.42572879682,
- 127768.63347908368,
- 127793.84247275478,
- 127819.05270968749,
- 127844.26418975917,
- 127869.47691284724,
- 127894.69087882918,
- 127919.90608758242,
- 127945.12253898452,
- 127970.34023291297,
- 127995.55916924537,
- 128020.77934785932,
- 128046.00076863244,
- 128071.22343144237,
- 128096.44733616684,
- 128121.67248268353,
- 128146.89887087021,
- 128172.12650060465,
- 128197.35537176467,
- 128222.5854842281,
- 128247.81683787282,
- 128273.04943257671,
- 128298.28326821771,
- 128323.51834467379,
- 128348.75466182294,
- 128373.99221954317,
- 128399.23101771252,
- 128424.47105620909,
- 128449.71233491098,
- 128474.95485369631,
- 128500.19861244329,
- 128525.44361103009,
- 128550.68984933494,
- 128575.93732723613,
- 128601.18604461191,
- 128626.43600134061,
- 128651.68719730059,
- 128676.93963237021,
- 128702.1933064279,
- 128727.44821935208,
- 128752.70437102125,
- 128777.96176131385,
- 128803.22039010846,
- 128828.48025728362,
- 128853.74136271792,
- 128879.00370628996,
- 128904.26728787841,
- 128929.53210736193,
- 128954.79816461923,
- 128980.06545952905,
- 129005.33399197015,
- 129030.60376182134,
- 129055.87476896142,
- 129081.14701326926,
- 129106.42049462376,
- 129131.6952129038,
- 129156.97116798835,
- 129182.24835975636,
- 129207.52678808685,
- 129232.80645285884,
- 129258.08735395141,
- 129283.36949124365,
- 129308.65286461466,
- 129333.9374739436,
- 129359.22331910966,
- 129384.51039999202,
- 129409.79871646997,
- 129435.08826842274,
- 129460.37905572963,
- 129485.67107826998,
- 129510.96433592314,
- 129536.25882856851,
- 129561.55455608548,
- 129586.85151835352,
- 129612.14971525209,
- 129637.4491466607,
- 129662.74981245887,
- 129688.0517125262,
- 129713.35484674224,
- 129738.65921498663,
- 129763.96481713903,
- 129789.27165307909,
- 129814.57972268655,
- 129839.88902584116,
- 129865.19956242264,
- 129890.51133231082,
- 129915.82433538554,
- 129941.13857152662,
- 129966.45404061397,
- 129991.7707425275,
- 130017.08867714716,
- 130042.4078443529,
- 130067.72824402474,
- 130093.04987604271,
- 130118.37274028687,
- 130143.69683663732,
- 130169.02216497416,
- 130194.34872517755,
- 130219.67651712766,
- 130245.0055407047,
- 130270.33579578891,
- 130295.66728226055,
- 130320.99999999991,
- 130346.33394888733,
- 130371.66912880314,
- 130397.00553962773,
- 130422.34318124152,
- 130447.68205352494,
- 130473.02215635845,
- 130498.36348962256,
- 130523.70605319779,
- 130549.0498469647,
- 130574.39487080388,
- 130599.74112459592,
- 130625.08860822149,
- 130650.43732156123,
- 130675.78726449587,
- 130701.13843690613,
- 130726.49083867275,
- 130751.84446967654,
- 130777.19932979831,
- 130802.5554189189,
- 130827.91273691918,
- 130853.27128368006,
- 130878.63105908247,
- 130903.99206300738,
- 130929.35429533575,
- 130954.71775594862,
- 130980.08244472703,
- 131005.44836155206,
- 131030.81550630482,
- 131056.18387886642,
- 131081.55347911804,
- 131106.92430694087,
- 131132.29636221612,
- 131157.66964482504,
- 131183.0441546489,
- 131208.41989156904,
- 131233.79685546676,
- 131259.17504622342,
- 131284.55446372041,
- 131309.93510783918,
- 131335.31697846117,
- 131360.70007546784,
- 131386.0843987407,
- 131411.46994816128,
- 131436.85672361116,
- 131462.24472497194,
- 131487.63395212521,
- 131513.02440495262,
- 131538.41608333588,
- 131563.80898715663,
- 131589.2031162967,
- 131614.59847063778,
- 131639.9950500617,
- 131665.39285445024,
- 131690.79188368531,
- 131716.19213764873,
- 131741.59361622241,
- 131766.99631928833,
- 131792.40024672839,
- 131817.80539842462,
- 131843.21177425905,
- 131868.61937411371,
- 131894.02819787065,
- 131919.43824541202,
- 131944.84951661993,
- 131970.26201137656,
- 131995.67572956407,
- 132021.09067106468,
- 132046.50683576067,
- 132071.9242235343,
- 132097.34283426782,
- 132122.76266784366,
- 132148.1837241441,
- 132173.60600305157,
- 132199.02950444847,
- 132224.45422821722,
- 132249.88017424036,
- 132275.30734240031,
- 132300.73573257966,
- 132326.16534466096,
- 132351.59617852676,
- 132377.02823405969,
- 132402.46151114244,
- 132427.89600965759,
- 132453.33172948789,
- 132478.76867051609,
- 132504.20683262491,
- 132529.64621569714,
- 132555.08681961559,
- 132580.5286442631,
- 132605.97168952253,
- 132631.41595527678,
- 132656.86144140881,
- 132682.30814780149,
- 132707.75607433787,
- 132733.20522090094,
- 132758.65558737374,
- 132784.10717363929,
- 132809.55997958075,
- 132835.01400508118,
- 132860.46925002377,
- 132885.92571429166,
- 132911.38339776811,
- 132936.84230033628,
- 132962.30242187946,
- 132987.76376228096,
- 133013.22632142407,
- 133038.69009919214,
- 133064.15509546854,
- 133089.62131013666,
- 133115.08874307995,
- 133140.55739418184,
- 133166.02726332581,
- 133191.49835039541,
- 133216.97065527414,
- 133242.44417784561,
- 133267.91891799335,
- 133293.39487560102,
- 133318.87205055228,
- 133344.35044273079,
- 133369.83005202023,
- 133395.31087830439,
- 133420.79292146701,
- 133446.27618139185,
- 133471.76065796276,
- 133497.24635106357,
- 133522.73326057816,
- 133548.22138639039,
- 133573.71072838426,
- 133599.20128644365,
- 133624.69306045261,
- 133650.1860502951,
- 133675.68025585517,
- 133701.1756770169,
- 133726.67231366437,
- 133752.17016568172,
- 133777.66923295305,
- 133803.16951536259,
- 133828.67101279454,
- 133854.17372513309,
- 133879.67765226253,
- 133905.18279406714,
- 133930.68915043125,
- 133956.19672123916,
- 133981.70550637526,
- 134007.21550572399,
- 134032.7267191697,
- 134058.23914659687,
- 134083.75278789,
- 134109.26764293358,
- 134134.78371161217,
- 134160.30099381026,
- 134185.8194894125,
- 134211.33919830353,
- 134236.8601203679,
- 134262.38225549037,
- 134287.90560355558,
- 134313.43016444831,
- 134338.95593805326,
- 134364.48292425525,
- 134390.01112293909,
- 134415.54053398955,
- 134441.07115729159,
- 134466.60299273001,
- 134492.1360401898,
- 134517.67029955584,
- 134543.20577071316,
- 134568.74245354676,
- 134594.28034794159,
- 134619.81945378278,
- 134645.35977095537,
- 134670.90129934452,
- 134696.4440388353,
- 134721.98798931291,
- 134747.53315066252,
- 134773.07952276937,
- 134798.62710551871,
- 134824.17589879577,
- 134849.72590248589,
- 134875.27711647438,
- 134900.82954064661,
- 134926.38317488792,
- 134951.93801908373,
- 134977.49407311951,
- 135003.05133688069,
- 135028.60981025276,
- 135054.16949312127,
- 135079.73038537172,
- 135105.29248688967,
- 135130.85579756077,
- 135156.42031727062,
- 135181.98604590484,
- 135207.55298334916,
- 135233.12112948924,
- 135258.69048421088,
- 135284.26104739975,
- 135309.83281894168,
- 135335.4057987225,
- 135360.97998662802,
- 135386.55538254412,
- 135412.13198635669,
- 135437.70979795168,
- 135463.28881721498,
- 135488.86904403262,
- 135514.45047829056,
- 135540.03311987486,
- 135565.61696867159,
- 135591.20202456677,
- 135616.78828744654,
- 135642.37575719706,
- 135667.96443370447,
- 135693.55431685498,
- 135719.14540653475,
- 135744.73770263011,
- 135770.33120502727,
- 135795.92591361253,
- 135821.52182827223,
- 135847.11894889272,
- 135872.7172753604,
- 135898.31680756161,
- 135923.91754538284,
- 135949.51948871053,
- 135975.12263743114,
- 136000.72699143123,
- 136026.33255059729,
- 136051.93931481591,
- 136077.54728397369,
- 136103.15645795723,
- 136128.76683665317,
- 136154.37841994822,
- 136179.99120772901,
- 136205.60519988232,
- 136231.2203962949,
- 136256.83679685349,
- 136282.45440144493,
- 136308.07320995603,
- 136333.69322227367,
- 136359.31443828469,
- 136384.93685787608,
- 136410.56048093468,
- 136436.18530734754,
- 136461.81133700156,
- 136487.43856978384,
- 136513.06700558143,
- 136538.6966442813,
- 136564.32748577066,
- 136589.95952993655,
- 136615.59277666616,
- 136641.22722584667,
- 136666.86287736523,
- 136692.49973110916,
- 136718.13778696564,
- 136743.77704482197,
- 136769.41750456547,
- 136795.05916608346,
- 136820.70202926331,
- 136846.34609399244,
- 136871.99136015819,
- 136897.63782764805,
- 136923.28549634948,
- 136948.93436614997,
- 136974.58443693706,
- 137000.23570859825,
- 137025.88818102115,
- 137051.54185409332,
- 137077.19672770242,
- 137102.85280173609,
- 137128.51007608202,
- 137154.16855062786,
- 137179.82822526142,
- 137205.48909987041,
- 137231.15117434258,
- 137256.8144485658,
- 137282.47892242789,
- 137308.14459581667,
- 137333.81146862009,
- 137359.47954072602,
- 137385.14881202241,
- 137410.81928239719,
- 137436.49095173844,
- 137462.16381993407,
- 137487.83788687221,
- 137513.51315244089,
- 137539.18961652822,
- 137564.86727902229,
- 137590.54613981131,
- 137616.22619878338,
- 137641.90745582676,
- 137667.58991082967,
- 137693.27356368033,
- 137718.95841426702,
- 137744.64446247809,
- 137770.33170820182,
- 137796.02015132661,
- 137821.70979174081,
- 137847.40062933284,
- 137873.09266399115,
- 137898.78589560417,
- 137924.48032406042,
- 137950.17594924837,
- 137975.8727710566,
- 138001.57078937365,
- 138027.27000408815,
- 138052.97041508864,
- 138078.67202226384,
- 138104.3748255024,
- 138130.07882469296,
- 138155.78401972432,
- 138181.49041048516,
- 138207.1979968643,
- 138232.9067787505,
- 138258.61675603263,
- 138284.32792859949,
- 138310.04029633995,
- 138335.75385914298,
- 138361.46861689744,
- 138387.18456949232,
- 138412.90171681659,
- 138438.62005875923,
- 138464.33959520931,
- 138490.06032605586,
- 138515.78225118798,
- 138541.50537049473,
- 138567.2296838653,
- 138592.95519118884,
- 138618.68189235451,
- 138644.40978725153,
- 138670.13887576913,
- 138695.86915779658,
- 138721.60063322316,
- 138747.33330193823,
- 138773.06716383106,
- 138798.80221879104,
- 138824.53846670757,
- 138850.27590747006,
- 138876.01454096794,
- 138901.7543670907,
- 138927.49538572782,
- 138953.2375967688,
- 138978.9810001032,
- 139004.72559562061,
- 139030.47138321059,
- 139056.2183627628,
- 139081.96653416683,
- 139107.71589731239,
- 139133.46645208917,
- 139159.21819838689,
- 139184.97113609532,
- 139210.72526510421,
- 139236.48058530336,
- 139262.23709658257,
- 139287.99479883176,
- 139313.75369194071,
- 139339.51377579942,
- 139365.27505029776,
- 139391.03751532568,
- 139416.80117077316,
- 139442.56601653024,
- 139468.33205248689,
- 139494.09927853322,
- 139519.86769455927,
- 139545.63730045516,
- 139571.408096111,
- 139597.18008141697,
- 139622.95325626322,
- 139648.72762054001,
- 139674.5031741375,
- 139700.27991694602,
- 139726.05784885579,
- 139751.83696975713,
- 139777.61727954043,
- 139803.39877809596,
- 139829.18146531415,
- 139854.96534108539,
- 139880.75040530015,
- 139906.53665784886,
- 139932.32409862199,
- 139958.11272751007,
- 139983.90254440365,
- 140009.69354919327,
- 140035.48574176949,
- 140061.27912202294,
- 140087.07368984428,
- 140112.86944512415,
- 140138.66638775321,
- 140164.4645176222,
- 140190.26383462184,
- 140216.06433864293,
- 140241.86602957622,
- 140267.66890731253,
- 140293.47297174268,
- 140319.27822275754,
- 140345.08466024802,
- 140370.89228410498,
- 140396.70109421943,
- 140422.51109048226,
- 140448.32227278448,
- 140474.13464101712,
- 140499.94819507122,
- 140525.76293483781,
- 140551.57886020801,
- 140577.3959710729,
- 140603.21426732364,
- 140629.03374885136,
- 140654.85441554731,
- 140680.67626730262,
- 140706.49930400858,
- 140732.32352555645,
- 140758.1489318375,
- 140783.97552274304,
- 140809.80329816442,
- 140835.63225799298,
- 140861.46240212015,
- 140887.29373043729,
- 140913.12624283586,
- 140938.95993920733,
- 140964.79481944317,
- 140990.63088343487,
- 141016.46813107401,
- 141042.30656225214,
- 141068.14617686081,
- 141093.98697479168,
- 141119.82895593636,
- 141145.6721201865,
- 141171.51646743377,
- 141197.36199756994,
- 141223.20871048668,
- 141249.05660607578,
- 141274.90568422904,
- 141300.75594483822,
- 141326.6073877952,
- 141352.4600129918,
- 141378.31382031992,
- 141404.16880967148,
- 141430.02498093838,
- 141455.8823340126,
- 141481.74086878612,
- 141507.60058515094,
- 141533.46148299909,
- 141559.32356222265,
- 141585.18682271364,
- 141611.05126436421,
- 141636.9168870665,
- 141662.78369071262,
- 141688.65167519479,
- 141714.5208404052,
- 141740.39118623605,
- 141766.26271257963,
- 141792.1354193282,
- 141818.00930637406,
- 141843.88437360956,
- 141869.760620927,
- 141895.6380482188,
- 141921.51665537735,
- 141947.39644229505,
- 141973.27740886438,
- 141999.15955497778,
- 142025.04288052776,
- 142050.92738540689,
- 142076.81306950765,
- 142102.69993272264,
- 142128.58797494444,
- 142154.47719606571,
- 142180.36759597904,
- 142206.25917457714,
- 142232.15193175265,
- 142258.04586739838,
- 142283.94098140698,
- 142309.83727367126,
- 142335.73474408401,
- 142361.63339253806,
- 142387.5332189262,
- 142413.43422314132,
- 142439.33640507635,
- 142465.23976462413,
- 142491.14430167765,
- 142517.05001612983,
- 142542.95690787368,
- 142568.86497680223,
- 142594.77422280848,
- 142620.68464578551,
- 142646.5962456264,
- 142672.50902222423,
- 142698.42297547215,
- 142724.33810526333,
- 142750.25441149093,
- 142776.17189404817,
- 142802.09055282827,
- 142828.01038772447,
- 142853.93139863008,
- 142879.85358543837,
- 142905.77694804268,
- 142931.70148633636,
- 142957.62720021277,
- 142983.55408956532,
- 143009.48215428743,
- 143035.41139427255,
- 143061.34180941415,
- 143087.27339960571,
- 143113.20616474075,
- 143139.14010471283,
- 143165.07521941551,
- 143191.01150874238,
- 143216.94897258704,
- 143242.88761084314,
- 143268.82742340435,
- 143294.76841016437,
- 143320.71057101688,
- 143346.65390585564,
- 143372.59841457437,
- 143398.54409706692,
- 143424.49095322701,
- 143450.43898294857,
- 143476.38818612538,
- 143502.33856265133,
- 143528.29011242036,
- 143554.24283532638,
- 143580.19673126334,
- 143606.1518001252,
- 143632.10804180597,
- 143658.06545619969,
- 143684.02404320039,
- 143709.98380270213,
- 143735.944734599,
- 143761.90683878519,
- 143787.87011515474,
- 143813.83456360188,
- 143839.8001840208,
- 143865.76697630569,
- 143891.73494035081,
- 143917.7040760504,
- 143943.67438329876,
- 143969.6458619902,
- 143995.61851201905,
- 144021.59233327967,
- 144047.56732566646,
- 144073.54348907378,
- 144099.52082339607,
- 144125.49932852783,
- 144151.4790043635,
- 144177.45985079758,
- 144203.44186772458,
- 144229.42505503909,
- 144255.40941263564,
- 144281.39494040885,
- 144307.38163825331,
- 144333.36950606373,
- 144359.35854373468,
- 144385.34875116093,
- 144411.34012823718,
- 144437.33267485813,
- 144463.32639091855,
- 144489.32127631325,
- 144515.31733093705,
- 144541.31455468474,
- 144567.3129474512,
- 144593.3125091313,
- 144619.31323961995,
- 144645.31513881206,
- 144671.31820660262,
- 144697.32244288657,
- 144723.32784755889,
- 144749.33442051467,
- 144775.34216164888,
- 144801.35107085665,
- 144827.36114803303,
- 144853.37239307314,
- 144879.38480587213,
- 144905.39838632516,
- 144931.41313432742,
- 144957.4290497741,
- 144983.44613256046,
- 145009.46438258173,
- 145035.48379973322,
- 145061.50438391021,
- 145087.52613500805,
- 145113.54905292206,
- 145139.57313754765,
- 145165.59838878017,
- 145191.62480651509,
- 145217.65239064783,
- 145243.68114107384,
- 145269.71105768863,
- 145295.74214038774,
- 145321.77438906668,
- 145347.80780362099,
- 145373.84238394629,
- 145399.87812993818,
- 145425.91504149229,
- 145451.95311850426,
- 145477.9923608698,
- 145504.03276848458,
- 145530.07434124436,
- 145556.11707904484,
- 145582.16098178181,
- 145608.20604935108,
- 145634.25228164849,
- 145660.29967856981,
- 145686.34824001096,
- 145712.39796586783,
- 145738.4488560363,
- 145764.50091041232,
- 145790.55412889185,
- 145816.60851137087,
- 145842.66405774537,
- 145868.72076791141,
- 145894.77864176501,
- 145920.83767920226,
- 145946.89788011924,
- 145972.95924441208,
- 145999.02177197693,
- 146025.08546270995,
- 146051.15031650732,
- 146077.21633326527,
- 146103.28351288004,
- 146129.35185524789,
- 146155.42136026506,
- 146181.49202782792,
- 146207.56385783272,
- 146233.63685017588,
- 146259.71100475377,
- 146285.78632146274,
- 146311.86280019928,
- 146337.94044085976,
- 146364.01924334071,
- 146390.09920753856,
- 146416.18033334985,
- 146442.26262067116,
- 146468.34606939898,
- 146494.43067942993,
- 146520.51645066062,
- 146546.60338298764,
- 146572.69147630769,
- 146598.78073051744,
- 146624.87114551352,
- 146650.96272119274,
- 146677.05545745179,
- 146703.14935418745,
- 146729.2444112965,
- 146755.34062867577,
- 146781.43800622207,
- 146807.53654383228,
- 146833.63624140329,
- 146859.73709883197,
- 146885.83911601527,
- 146911.94229285014,
- 146938.04662923355,
- 146964.15212506248,
- 146990.25878023397,
- 147016.36659464505,
- 147042.47556819281,
- 147068.58570077427,
- 147094.6969922866,
- 147120.80944262692,
- 147146.92305169237,
- 147173.03781938017,
- 147199.15374558745,
- 147225.27083021149,
- 147251.38907314953,
- 147277.50847429881,
- 147303.62903355664,
- 147329.75075082036,
- 147355.87362598727,
- 147381.99765895473,
- 147408.12284962015,
- 147434.24919788091,
- 147460.37670363448,
- 147486.50536677826,
- 147512.63518720976,
- 147538.76616482646,
- 147564.89829952587,
- 147591.03159120557,
- 147617.16603976308,
- 147643.30164509601,
- 147669.43840710199,
- 147695.57632567859,
- 147721.71540072354,
- 147747.85563213445,
- 147773.99701980909,
- 147800.13956364512,
- 147826.28326354033,
- 147852.42811939248,
- 147878.57413109933,
- 147904.72129855872,
- 147930.86962166851,
- 147957.01910032652,
- 147983.16973443062,
- 148009.32152387875,
- 148035.47446856883,
- 148061.62856839882,
- 148087.78382326665,
- 148113.94023307035,
- 148140.09779770792,
- 148166.25651707739,
- 148192.41639107687,
- 148218.57741960438,
- 148244.73960255808,
- 148270.90293983606,
- 148297.0674313365,
- 148323.23307695755,
- 148349.39987659742,
- 148375.56783015432,
- 148401.73693752653,
- 148427.90719861226,
- 148454.07861330983,
- 148480.25118151752,
- 148506.42490313368,
- 148532.59977805667,
- 148558.77580618486,
- 148584.95298741665,
- 148611.13132165043,
- 148637.31080878471,
- 148663.49144871789,
- 148689.6732413485,
- 148715.85618657502,
- 148742.040284296,
- 148768.22553440998,
- 148794.41193681557,
- 148820.59949141133,
- 148846.78819809589,
- 148872.97805676793,
- 148899.16906732606,
- 148925.36122966901,
- 148951.55454369547,
- 148977.74900930419,
- 149003.9446263939,
- 149030.1413948634,
- 149056.33931461151,
- 149082.53838553699,
- 149108.73860753875,
- 149134.9399805156,
- 149161.14250436646,
- 149187.34617899026,
- 149213.5510042859,
- 149239.75698015234,
- 149265.96410648854,
- 149292.17238319354,
- 149318.38181016635,
- 149344.59238730598,
- 149370.80411451156,
- 149397.01699168212,
- 149423.23101871679,
- 149449.44619551473,
- 149475.66252197503,
- 149501.87999799693,
- 149528.0986234796,
- 149554.31839832227,
- 149580.53932242419,
- 149606.76139568459,
- 149632.98461800278,
- 149659.20898927809,
- 149685.43450940982,
- 149711.66117829733,
- 149737.88899584001,
- 149764.11796193724,
- 149790.34807648844,
- 149816.57933939309,
- 149842.81175055061,
- 149869.04530986046,
- 149895.28001722222,
- 149921.51587253538,
- 149947.75287569952,
- 149973.99102661415,
- 150000.23032517891,
- 150026.47077129342,
- 150052.71236485732,
- 150078.95510577026,
- 150105.1989939319,
- 150131.444029242,
- 150157.69021160025,
- 150183.93754090639,
- 150210.18601706024,
- 150236.43563996154,
- 150262.68640951012,
- 150288.93832560582,
- 150315.19138814852,
- 150341.44559703805,
- 150367.70095217437,
- 150393.95745345735,
- 150420.21510078697,
- 150446.47389406321,
- 150472.73383318601,
- 150498.99491805542,
- 150525.25714857146,
- 150551.52052463419,
- 150577.78504614369,
- 150604.05071300003,
- 150630.31752510337,
- 150656.58548235384,
- 150682.85458465159,
- 150709.1248318968,
- 150735.39622398972,
- 150761.66876083051,
- 150787.9424423195,
- 150814.21726835691,
- 150840.49323884305,
- 150866.77035367821,
- 150893.04861276277,
- 150919.32801599705,
- 150945.60856328148,
- 150971.89025451642,
- 150998.17308960229,
- 151024.45706843957,
- 151050.74219092872,
- 151077.02845697021,
- 151103.31586646455,
- 151129.60441931229,
- 151155.894115414,
- 151182.1849546702,
- 151208.47693698155,
- 151234.77006224863,
- 151261.06433037209,
- 151287.35974125259,
- 151313.65629479082,
- 151339.95399088747,
- 151366.25282944329,
- 151392.55281035902,
- 151418.85393353543,
- 151445.1561988733,
- 151471.45960627345,
- 151497.76415563675,
- 151524.06984686397,
- 151550.37667985607,
- 151576.68465451393,
- 151602.99377073845,
- 151629.30402843058,
- 151655.61542749128,
- 151681.92796782157,
- 151708.24164932242,
- 151734.55647189484,
- 151760.87243543993,
- 151787.18953985872,
- 151813.50778505235,
- 151839.82717092187,
- 151866.14769736846,
- 151892.46936429327,
- 151918.79217159748,
- 151945.11611918229,
- 151971.44120694889,
- 151997.76743479856,
- 152024.09480263255,
- 152050.42331035214,
- 152076.75295785864,
- 152103.08374505339,
- 152129.41567183775,
- 152155.74873811303,
- 152182.08294378067,
- 152208.41828874208,
- 152234.75477289871,
- 152261.09239615197,
- 152287.43115840337,
- 152313.77105955439,
- 152340.11209950657,
- 152366.45427816146,
- 152392.79759542056,
- 152419.14205118554,
- 152445.48764535793,
- 152471.8343778394,
- 152498.18224853161,
- 152524.53125733617,
- 152550.88140415482,
- 152577.23268888926,
- 152603.58511144121,
- 152629.93867171241,
- 152656.29336960468,
- 152682.64920501978,
- 152709.00617785956,
- 152735.36428802583,
- 152761.72353542043,
- 152788.08391994529,
- 152814.44544150229,
- 152840.80809999333,
- 152867.17189532038,
- 152893.53682738543,
- 152919.90289609041,
- 152946.27010133737,
- 152972.63844302832,
- 152999.00792106529,
- 153025.37853535041,
- 153051.7502857857,
- 153078.12317227334,
- 153104.4971947154,
- 153130.8723530141,
- 153157.24864707157,
- 153183.62607679001,
- 153210.00464207167,
- 153236.38434281875,
- 153262.76517893354,
- 153289.14715031831,
- 153315.53025687535,
- 153341.91449850702,
- 153368.2998751156,
- 153394.68638660354,
- 153421.07403287315,
- 153447.46281382689,
- 153473.85272936718,
- 153500.24377939643,
- 153526.63596381716,
- 153553.02928253182,
- 153579.42373544298,
- 153605.81932245308,
- 153632.21604346478,
- 153658.61389838057,
- 153685.0128871031,
- 153711.41300953497,
- 153737.81426557881,
- 153764.21665513728,
- 153790.62017811305,
- 153817.02483440886,
- 153843.43062392739,
- 153869.83754657139,
- 153896.24560224367,
- 153922.65479084692,
- 153949.06511228404,
- 153975.4765664578,
- 154001.88915327107,
- 154028.30287262669,
- 154054.71772442761,
- 154081.13370857667,
- 154107.55082497682,
- 154133.96907353101,
- 154160.38845414223,
- 154186.80896671346,
- 154213.23061114774,
- 154239.65338734805,
- 154266.07729521746,
- 154292.50233465908,
- 154318.92850557598,
- 154345.35580787127,
- 154371.7842414481,
- 154398.21380620965,
- 154424.64450205903,
- 154451.07632889951,
- 154477.50928663427,
- 154503.94337516659,
- 154530.37859439969,
- 154556.81494423689,
- 154583.25242458144,
- 154609.69103533673,
- 154636.13077640603,
- 154662.57164769279,
- 154689.01364910032,
- 154715.45678053208,
- 154741.90104189145,
- 154768.34643308193,
- 154794.79295400696,
- 154821.24060457002,
- 154847.68938467462,
- 154874.13929422433,
- 154900.59033312264,
- 154927.04250127316,
- 154953.49579857948,
- 154979.95022494521,
- 155006.40578027396,
- 155032.86246446942,
- 155059.32027743524,
- 155085.77921907514,
- 155112.2392892928,
- 155138.70048799197,
- 155165.16281507642,
- 155191.62627044989,
- 155218.09085401625,
- 155244.55656567923,
- 155271.02340534274,
- 155297.49137291059,
- 155323.96046828668,
- 155350.4306913749,
- 155376.90204207919,
- 155403.37452030348,
- 155429.84812595171,
- 155456.32285892789,
- 155482.79871913602,
- 155509.27570648011,
- 155535.75382086422,
- 155562.23306219239,
- 155588.71343036872,
- 155615.19492529731,
- 155641.67754688227,
- 155668.16129502779,
- 155694.64616963797,
- 155721.13217061706,
- 155747.61929786921,
- 155774.10755129869,
- 155800.59693080973,
- 155827.08743630661,
- 155853.57906769359,
- 155880.07182487496,
- 155906.56570775513,
- 155933.06071623837,
- 155959.55685022907,
- 155986.05410963166,
- 156012.5524943505,
- 156039.05200429002,
- 156065.55263935472,
- 156092.054399449,
- 156118.5572844774,
- 156145.06129434443,
- 156171.5664289546,
- 156198.07268821247,
- 156224.5800720226,
- 156251.08858028959,
- 156277.59821291809,
- 156304.10896981266,
- 156330.62085087801,
- 156357.1338560188,
- 156383.64798513969,
- 156410.16323814544,
- 156436.67961494075,
- 156463.1971154304,
- 156489.71573951913,
- 156516.23548711176,
- 156542.75635811311,
- 156569.27835242799,
- 156595.80146996127,
- 156622.32571061782,
- 156648.85107430254,
- 156675.37756092031,
- 156701.90517037612,
- 156728.43390257491,
- 156754.96375742162,
- 156781.49473482129,
- 156808.02683467892,
- 156834.5600568995,
- 156861.09440138817,
- 156887.62986804993,
- 156914.16645678994,
- 156940.70416751326,
- 156967.24300012505,
- 156993.78295453047,
- 157020.32403063469,
- 157046.8662283429,
- 157073.40954756032,
- 157099.9539881922,
- 157126.49955014378,
- 157153.04623332032,
- 157179.59403762716,
- 157206.14296296958,
- 157232.69300925292,
- 157259.24417638258,
- 157285.79646426387,
- 157312.34987280221,
- 157338.90440190304,
- 157365.46005147175,
- 157392.01682141385,
- 157418.57471163478,
- 157445.13372204005,
- 157471.69385253513,
- 157498.25510302564,
- 157524.81747341706,
- 157551.38096361503,
- 157577.9455735251,
- 157604.51130305286,
- 157631.07815210402,
- 157657.64612058419,
- 157684.21520839902,
- 157710.78541545427,
- 157737.35674165559,
- 157763.92918690876,
- 157790.50275111952,
- 157817.07743419363,
- 157843.65323603692,
- 157870.23015655516,
- 157896.80819565422,
- 157923.3873532399,
- 157949.96762921812,
- 157976.54902349479,
- 158003.13153597576,
- 158029.71516656701,
- 158056.29991517449,
- 158082.88578170416,
- 158109.47276606198,
- 158136.06086815402,
- 158162.65008788629,
- 158189.24042516484,
- 158215.83187989573,
- 158242.42445198505,
- 158269.01814133892,
- 158295.61294786347,
- 158322.20887146486,
- 158348.80591204923,
- 158375.4040695228,
- 158402.00334379176,
- 158428.60373476235,
- 158455.2052423408,
- 158481.80786643337,
- 158508.41160694641,
- 158535.01646378616,
- 158561.62243685898,
- 158588.2295260712,
- 158614.8377313292,
- 158641.44705253936,
- 158668.05748960807,
- 158694.66904244179,
- 158721.28171094693,
- 158747.89549502998,
- 158774.5103945974,
- 158801.12640955573,
- 158827.74353981143,
- 158854.36178527112,
- 158880.9811458413,
- 158907.60162142856,
- 158934.22321193956,
- 158960.84591728085,
- 158987.46973735912,
- 159014.09467208097,
- 159040.72072135314,
- 159067.3478850823,
- 159093.97616317519,
- 159120.60555553852,
- 159147.23606207906,
- 159173.8676827036,
- 159200.50041731889,
- 159227.13426583182,
- 159253.76922814918,
- 159280.40530417781,
- 159307.04249382461,
- 159333.68079699649,
- 159360.32021360032,
- 159386.96074354305,
- 159413.60238673165,
- 159440.24514307309,
- 159466.88901247433,
- 159493.53399484244,
- 159520.18009008438,
- 159546.82729810724,
- 159573.47561881805,
- 159600.12505212394,
- 159626.77559793202,
- 159653.42725614941,
- 159680.08002668325,
- 159706.73390944069,
- 159733.38890432892,
- 159760.04501125516,
- 159786.70223012666,
- 159813.36056085059,
- 159840.02000333427,
- 159866.68055748497,
- 159893.34222320997,
- 159920.00500041663,
- 159946.66888901225,
- 159973.33388890422,
- 159999.99999999988,
- 160026.66722220668,
- 160053.33555543202,
- 160080.0049995833,
- 160106.67555456801,
- 160133.3472202936,
- 160160.0199966676,
- 160186.6938835975,
- 160213.36888099083,
- 160240.04498875517,
- 160266.72220679806,
- 160293.40053502709,
- 160320.07997334987,
- 160346.76052167406,
- 160373.44217990729,
- 160400.1249479572,
- 160426.80882573154,
- 160453.49381313793,
- 160480.17991008417,
- 160506.86711647795,
- 160533.55543222709,
- 160560.24485723933,
- 160586.93539142248,
- 160613.62703468435,
- 160640.31978693281,
- 160667.01364807569,
- 160693.70861802087,
- 160720.40469667627,
- 160747.1018839498,
- 160773.80017974938,
- 160800.49958398298,
- 160827.20009655855,
- 160853.90171738411,
- 160880.60444636765,
- 160907.30828341722,
- 160934.01322844089,
- 160960.71928134665,
- 160987.42644204266,
- 161014.13471043704,
- 161040.84408643784,
- 161067.55456995327,
- 161094.26616089148,
- 161120.97885916062,
- 161147.69266466892,
- 161174.40757732463,
- 161201.12359703594,
- 161227.84072371112,
- 161254.55895725847,
- 161281.27829758628,
- 161307.99874460287,
- 161334.72029821656,
- 161361.44295833571,
- 161388.1667248687,
- 161414.89159772391,
- 161441.61757680977,
- 161468.34466203468,
- 161495.07285330712,
- 161521.80215053557,
- 161548.53255362847,
- 161575.26406249436,
- 161601.99667704175,
- 161628.7303971792,
- 161655.46522281526,
- 161682.20115385848,
- 161708.93819021754,
- 161735.67633180099,
- 161762.41557851751,
- 161789.15593027571,
- 161815.89738698432,
- 161842.63994855201,
- 161869.38361488748,
- 161896.1283858995,
- 161922.87426149679,
- 161949.62124158812,
- 161976.36932608229,
- 162003.1185148881,
- 162029.8688079144,
- 162056.62020507001,
- 162083.37270626382,
- 162110.12631140469,
- 162136.88102040152,
- 162163.63683316324,
- 162190.39374959879,
- 162217.15176961714,
- 162243.91089312723,
- 162270.67112003808,
- 162297.43245025873,
- 162324.19488369819,
- 162350.9584202655,
- 162377.72305986975,
- 162404.48880242003,
- 162431.25564782543,
- 162458.02359599507,
- 162484.79264683815,
- 162511.56280026378,
- 162538.33405618116,
- 162565.10641449949,
- 162591.87987512801,
- 162618.65443797593,
- 162645.43010295252,
- 162672.20686996708,
- 162698.98473892888,
- 162725.76370974723,
- 162752.54378233149,
- 162779.32495659095,
- 162806.10723243505,
- 162832.89060977317,
- 162859.67508851466,
- 162886.46066856899,
- 162913.24734984562,
- 162940.03513225398,
- 162966.82401570358,
- 162993.6140001039,
- 163020.40508536444,
- 163047.19727139481,
- 163073.99055810447,
- 163100.78494540305,
- 163127.58043320014,
- 163154.37702140535,
- 163181.17470992831,
- 163207.97349867865,
- 163234.77338756606,
- 163261.57437650024,
- 163288.37646539087,
- 163315.17965414765,
- 163341.98394268038,
- 163368.78933089875,
- 163395.59581871261,
- 163422.40340603172,
- 163449.2120927659,
- 163476.02187882498,
- 163502.83276411882,
- 163529.6447485573,
- 163556.45783205028,
- 163583.2720145077,
- 163610.08729583945,
- 163636.90367595552,
- 163663.72115476584,
- 163690.53973218042,
- 163717.35940810922,
- 163744.18018246227,
- 163771.00205514964,
- 163797.82502608138,
- 163824.64909516752,
- 163851.4742623182,
- 163878.3005274435,
- 163905.12789045356,
- 163931.95635125853,
- 163958.78590976857,
- 163985.61656589387,
- 164012.44831954464,
- 164039.28117063109,
- 164066.11511906344,
- 164092.95016475199,
- 164119.78630760699,
- 164146.62354753874,
- 164173.46188445756,
- 164200.30131827376,
- 164227.14184889771,
- 164253.98347623978,
- 164280.82620021031,
- 164307.67002071979,
- 164334.51493767856,
- 164361.3609509971,
- 164388.20806058586,
- 164415.05626635533,
- 164441.905568216,
- 164468.75596607837,
- 164495.607459853,
- 164522.4600494504,
- 164549.31373478117,
- 164576.16851575591,
- 164603.02439228518,
- 164629.88136427966,
- 164656.73943164994,
- 164683.59859430668,
- 164710.45885216061,
- 164737.32020512238,
- 164764.1826531027,
- 164791.04619601235,
- 164817.91083376206,
- 164844.77656626256,
- 164871.64339342469,
- 164898.51131515924,
- 164925.38033137703,
- 164952.25044198887,
- 164979.1216469057,
- 165005.9939460383,
- 165032.86733929763,
- 165059.7418265946,
- 165086.61740784015,
- 165113.4940829452
-};
-
-#else
-
-#ifdef BIG_IQ_TABLE
-#define IQ_TABLE_SIZE 8192
-#else
-#define IQ_TABLE_SIZE 1026
-#endif
-
-ALIGN static const real_t iq_table[IQ_TABLE_SIZE] =
-{
- REAL_CONST(0.0),
- REAL_CONST(1.0/8.0),
- REAL_CONST(2.5198420997897464/8.0),
- REAL_CONST(4.3267487109222245/8.0),
- REAL_CONST(6.3496042078727974/8.0),
- REAL_CONST(8.5498797333834844/8.0),
- REAL_CONST(10.902723556992836/8.0),
- REAL_CONST(13.390518279406722/8.0),
- REAL_CONST(15.999999999999998/8.0),
- REAL_CONST(18.720754407467133/8.0),
- REAL_CONST(21.544346900318832/8.0),
- REAL_CONST(24.463780996262464/8.0),
- REAL_CONST(27.47314182127996/8.0),
- REAL_CONST(30.567350940369842/8.0),
- REAL_CONST(33.741991698453212/8.0),
- REAL_CONST(36.993181114957046/8.0),
- REAL_CONST(40.317473596635935/8.0),
- REAL_CONST(43.711787041189993/8.0),
- REAL_CONST(47.173345095760126/8.0),
- REAL_CONST(50.699631325716943/8.0),
- REAL_CONST(54.288352331898118/8.0),
- REAL_CONST(57.937407704003519/8.0),
- REAL_CONST(61.6448652744185/8.0),
- REAL_CONST(65.408940536585988/8.0),
- REAL_CONST(69.227979374755591/8.0),
- REAL_CONST(73.100443455321638/8.0),
- REAL_CONST(77.024897778591622/8.0),
- REAL_CONST(80.999999999999986/8.0),
- REAL_CONST(85.024491212518527/8.0),
- REAL_CONST(89.097187944889555/8.0),
- REAL_CONST(93.216975178615741/8.0),
- REAL_CONST(97.382800224133163/8.0),
- REAL_CONST(101.59366732596474/8.0),
- REAL_CONST(105.84863288986224/8.0),
- REAL_CONST(110.14680124343441/8.0),
- REAL_CONST(114.4873208566006/8.0),
- REAL_CONST(118.86938096020653/8.0),
- REAL_CONST(123.29220851090024/8.0),
- REAL_CONST(127.75506545836058/8.0),
- REAL_CONST(132.25724627755247/8.0),
- REAL_CONST(136.79807573413572/8.0),
- REAL_CONST(141.37690685569191/8.0),
- REAL_CONST(145.99311908523086/8.0),
- REAL_CONST(150.6461165966291/8.0),
- REAL_CONST(155.33532675434674/8.0),
- REAL_CONST(160.06019870205279/8.0),
- REAL_CONST(164.82020206673349/8.0),
- REAL_CONST(169.61482576651861/8.0),
- REAL_CONST(174.44357691188537/8.0),
- REAL_CONST(179.30597979112557/8.0),
- REAL_CONST(184.20157493201927/8.0),
- REAL_CONST(189.12991823257562/8.0),
- REAL_CONST(194.09058015449685/8.0),
- REAL_CONST(199.08314497371677/8.0),
- REAL_CONST(204.1072100829694/8.0),
- REAL_CONST(209.16238534187647/8.0),
- REAL_CONST(214.24829247050752/8.0),
- REAL_CONST(219.36456448277784/8.0),
- REAL_CONST(224.51084515641216/8.0),
- REAL_CONST(229.6867885365223/8.0),
- REAL_CONST(234.89205847013176/8.0),
- REAL_CONST(240.12632816923249/8.0),
- REAL_CONST(245.38927980018505/8.0),
- REAL_CONST(250.68060409747261/8.0),
- REAL_CONST(255.99999999999991/8.0),
- REAL_CONST(261.34717430828869/8.0),
- REAL_CONST(266.72184136106449/8.0),
- REAL_CONST(272.12372272986045/8.0),
- REAL_CONST(277.55254693037961/8.0),
- REAL_CONST(283.0080491494619/8.0),
- REAL_CONST(288.48997098659891/8.0),
- REAL_CONST(293.99806020902247/8.0),
- REAL_CONST(299.53207051947408/8.0),
- REAL_CONST(305.0917613358298/8.0),
- REAL_CONST(310.67689758182206/8.0),
- REAL_CONST(316.28724948815585/8.0),
- REAL_CONST(321.92259240337177/8.0),
- REAL_CONST(327.58270661385535/8.0),
- REAL_CONST(333.26737717243742/8.0),
- REAL_CONST(338.97639373507025/8.0),
- REAL_CONST(344.70955040510125/8.0),
- REAL_CONST(350.46664558470013/8.0),
- REAL_CONST(356.24748183302603/8.0),
- REAL_CONST(362.05186573075139/8.0),
- REAL_CONST(367.87960775058258/8.0),
- REAL_CONST(373.73052213344511/8.0),
- REAL_CONST(379.60442677002078/8.0),
- REAL_CONST(385.50114308734607/8.0),
- REAL_CONST(391.42049594019937/8.0),
- REAL_CONST(397.36231350702371/8.0),
- REAL_CONST(403.32642719014467/8.0),
- REAL_CONST(409.31267152006262/8.0),
- REAL_CONST(415.32088406360799/8.0),
- REAL_CONST(421.35090533576471/8.0),
- REAL_CONST(427.40257871497619/8.0),
- REAL_CONST(433.4757503617617/8.0),
- REAL_CONST(439.5702691404793/8.0),
- REAL_CONST(445.68598654408271/8.0),
- REAL_CONST(451.82275662172759/8.0),
- REAL_CONST(457.98043590909128/8.0),
- REAL_CONST(464.15888336127773/8.0),
- REAL_CONST(470.35796028818726/8.0),
- REAL_CONST(476.5775302922363/8.0),
- REAL_CONST(482.81745920832043/8.0),
- REAL_CONST(489.07761504591741/8.0),
- REAL_CONST(495.35786793323581/8.0),
- REAL_CONST(501.65809006331688/8.0),
- REAL_CONST(507.97815564200368/8.0),
- REAL_CONST(514.31794083769648/8.0),
- REAL_CONST(520.67732373281672/8.0),
- REAL_CONST(527.05618427690604/8.0),
- REAL_CONST(533.45440424129174/8.0),
- REAL_CONST(539.87186717525128/8.0),
- REAL_CONST(546.30845836361505/8.0),
- REAL_CONST(552.76406478574609/8.0),
- REAL_CONST(559.23857507584194/8.0),
- REAL_CONST(565.73187948450413/8.0),
- REAL_CONST(572.24386984152341/8.0),
- REAL_CONST(578.77443951983378/8.0),
- REAL_CONST(585.32348340058843/8.0),
- REAL_CONST(591.89089783931263/8.0),
- REAL_CONST(598.47658063309257/8.0),
- REAL_CONST(605.08043098876044/8.0),
- REAL_CONST(611.70234949203643/8.0),
- REAL_CONST(618.3422380775919/8.0),
- REAL_CONST(624.99999999999977/8.0),
- REAL_CONST(631.67553980553748/8.0),
- REAL_CONST(638.36876330481164/8.0),
- REAL_CONST(645.07957754617485/8.0),
- REAL_CONST(651.80789078990415/8.0),
- REAL_CONST(658.55361248311499/8.0),
- REAL_CONST(665.31665323538357/8.0),
- REAL_CONST(672.09692479505225/8.0),
- REAL_CONST(678.8943400261943/8.0),
- REAL_CONST(685.70881288621433/8.0),
- REAL_CONST(692.540258404062/8.0),
- REAL_CONST(699.38859265903977/8.0),
- REAL_CONST(706.25373276018058/8.0),
- REAL_CONST(713.13559682617972/8.0),
- REAL_CONST(720.03410396586037/8.0),
- REAL_CONST(726.94917425915435/8.0),
- REAL_CONST(733.88072873858209/8.0),
- REAL_CONST(740.82868937121543/8.0),
- REAL_CONST(747.79297904110535/8.0),
- REAL_CONST(754.77352153216191/8.0),
- REAL_CONST(761.77024151147043/8.0),
- REAL_CONST(768.78306451302956/8.0),
- REAL_CONST(775.81191692189896/8.0),
- REAL_CONST(782.85672595874246/8.0),
- REAL_CONST(789.91741966475445/8.0),
- REAL_CONST(796.99392688695798/8.0),
- REAL_CONST(804.08617726386274/8.0),
- REAL_CONST(811.19410121147098/8.0),
- REAL_CONST(818.31762990962227/8.0),
- REAL_CONST(825.45669528866563/8.0),
- REAL_CONST(832.61123001644864/8.0),
- REAL_CONST(839.78116748561604/8.0),
- REAL_CONST(846.96644180120552/8.0),
- REAL_CONST(854.16698776853514/8.0),
- REAL_CONST(861.38274088137143/8.0),
- REAL_CONST(868.61363731036977/8.0),
- REAL_CONST(875.85961389178203/8.0),
- REAL_CONST(883.12060811641959/8.0),
- REAL_CONST(890.39655811886757/8.0),
- REAL_CONST(897.68740266694181/8.0),
- REAL_CONST(904.99308115138172/8.0),
- REAL_CONST(912.31353357577188/8.0),
- REAL_CONST(919.64870054668756/8.0),
- REAL_CONST(926.99852326405619/8.0),
- REAL_CONST(934.36294351172899/8.0),
- REAL_CONST(941.74190364825859/8.0),
- REAL_CONST(949.13534659787422/8.0),
- REAL_CONST(956.54321584165211/8.0),
- REAL_CONST(963.96545540887348/8.0),
- REAL_CONST(971.40200986856541/8.0),
- REAL_CONST(978.85282432122176/8.0),
- REAL_CONST(986.31784439069588/8.0),
- REAL_CONST(993.7970162162635/8.0),
- REAL_CONST(1001.29028644485/8.0),
- REAL_CONST(1008.797602223418/8.0),
- REAL_CONST(1016.3189111915103/8.0),
- REAL_CONST(1023.8541614739464/8.0),
- REAL_CONST(1031.4033016736653/8.0),
- REAL_CONST(1038.9662808647138/8.0),
- REAL_CONST(1046.5430485853758/8.0),
- REAL_CONST(1054.1335548314366/8.0),
- REAL_CONST(1061.7377500495838/8.0),
- REAL_CONST(1069.3555851309357/8.0),
- REAL_CONST(1076.9870114046978/8.0),
- REAL_CONST(1084.6319806319441/8.0),
- REAL_CONST(1092.2904449995174/8.0),
- REAL_CONST(1099.9623571140482/8.0),
- REAL_CONST(1107.6476699960892/8.0),
- REAL_CONST(1115.3463370743607/8.0),
- REAL_CONST(1123.058312180106/8.0),
- REAL_CONST(1130.7835495415541/8.0),
- REAL_CONST(1138.5220037784854/8.0),
- REAL_CONST(1146.273629896901/8.0),
- REAL_CONST(1154.0383832837879/8.0),
- REAL_CONST(1161.816219701986/8.0),
- REAL_CONST(1169.607095285146/8.0),
- REAL_CONST(1177.4109665327808/8.0),
- REAL_CONST(1185.2277903054078/8.0),
- REAL_CONST(1193.0575238197798/8.0),
- REAL_CONST(1200.9001246442001/8.0),
- REAL_CONST(1208.7555506939248/8.0),
- REAL_CONST(1216.6237602266442/8.0),
- REAL_CONST(1224.5047118380478/8.0),
- REAL_CONST(1232.3983644574657/8.0),
- REAL_CONST(1240.3046773435874/8.0),
- REAL_CONST(1248.2236100802568/8.0),
- REAL_CONST(1256.1551225723395/8.0),
- REAL_CONST(1264.099175041662/8.0),
- REAL_CONST(1272.0557280230228/8.0),
- REAL_CONST(1280.0247423602691/8.0),
- REAL_CONST(1288.0061792024444/8.0),
- REAL_CONST(1295.9999999999995/8.0),
- REAL_CONST(1304.006166501068/8.0),
- REAL_CONST(1312.0246407478062/8.0),
- REAL_CONST(1320.0553850727929/8.0),
- REAL_CONST(1328.0983620954903/8.0),
- REAL_CONST(1336.1535347187651/8.0),
- REAL_CONST(1344.2208661254647/8.0),
- REAL_CONST(1352.3003197750522/8.0),
- REAL_CONST(1360.3918594002962/8.0),
- REAL_CONST(1368.4954490040145/8.0),
- REAL_CONST(1376.6110528558709/8.0),
- REAL_CONST(1384.7386354892244/8.0),
- REAL_CONST(1392.8781616980295/8.0),
- REAL_CONST(1401.0295965337855/8.0),
- REAL_CONST(1409.1929053025353/8.0),
- REAL_CONST(1417.3680535619119/8.0),
- REAL_CONST(1425.5550071182327/8.0),
- REAL_CONST(1433.7537320236374/8.0),
- REAL_CONST(1441.9641945732744/8.0),
- REAL_CONST(1450.1863613025282/8.0),
- REAL_CONST(1458.4201989842913/8.0),
- REAL_CONST(1466.6656746262797/8.0),
- REAL_CONST(1474.9227554683875/8.0),
- REAL_CONST(1483.1914089800841/8.0),
- REAL_CONST(1491.4716028578516/8.0),
- REAL_CONST(1499.7633050226596/8.0),
- REAL_CONST(1508.0664836174794/8.0),
- REAL_CONST(1516.3811070048375/8.0),
- REAL_CONST(1524.7071437644029/8.0),
- REAL_CONST(1533.0445626906128/8.0),
- REAL_CONST(1541.3933327903342/8.0),
- REAL_CONST(1549.7534232805581/8.0),
- REAL_CONST(1558.1248035861302/8.0),
- REAL_CONST(1566.507443337515/8.0),
- REAL_CONST(1574.9013123685909/8.0),
- REAL_CONST(1583.3063807144795/8.0),
- REAL_CONST(1591.7226186094069/8.0),
- REAL_CONST(1600.1499964845941/8.0),
- REAL_CONST(1608.58848496618/8.0),
- REAL_CONST(1617.0380548731737/8.0),
- REAL_CONST(1625.4986772154357/8.0),
- REAL_CONST(1633.9703231916887/8.0),
- REAL_CONST(1642.4529641875577/8.0),
- REAL_CONST(1650.9465717736346/8.0),
- REAL_CONST(1659.4511177035752/8.0),
- REAL_CONST(1667.9665739122186/8.0),
- REAL_CONST(1676.4929125137353/8.0),
- REAL_CONST(1685.030105799801/8.0),
- REAL_CONST(1693.5781262377957/8.0),
- REAL_CONST(1702.136946469027/8.0),
- REAL_CONST(1710.7065393069795/8.0),
- REAL_CONST(1719.2868777355877/8.0),
- REAL_CONST(1727.8779349075323/8.0),
- REAL_CONST(1736.4796841425596/8.0),
- REAL_CONST(1745.092098925825/8.0),
- REAL_CONST(1753.7151529062583/8.0),
- REAL_CONST(1762.3488198949503/8.0),
- REAL_CONST(1770.9930738635628/8.0),
- REAL_CONST(1779.6478889427597/8.0),
- REAL_CONST(1788.3132394206564/8.0),
- REAL_CONST(1796.9890997412947/8.0),
- REAL_CONST(1805.6754445031333/8.0),
- REAL_CONST(1814.3722484575621/8.0),
- REAL_CONST(1823.0794865074322/8.0),
- REAL_CONST(1831.7971337056094/8.0),
- REAL_CONST(1840.5251652535437/8.0),
- REAL_CONST(1849.2635564998579/8.0),
- REAL_CONST(1858.0122829389563/8.0),
- REAL_CONST(1866.7713202096493/8.0),
- REAL_CONST(1875.5406440937966/8.0),
- REAL_CONST(1884.3202305149687/8.0),
- REAL_CONST(1893.110055537124/8.0),
- REAL_CONST(1901.9100953633042/8.0),
- REAL_CONST(1910.7203263343454/8.0),
- REAL_CONST(1919.5407249276057/8.0),
- REAL_CONST(1928.3712677557098/8.0),
- REAL_CONST(1937.2119315653083/8.0),
- REAL_CONST(1946.0626932358525/8.0),
- REAL_CONST(1954.923529778386/8.0),
- REAL_CONST(1963.79441833435/8.0),
- REAL_CONST(1972.6753361744036/8.0),
- REAL_CONST(1981.5662606972594/8.0),
- REAL_CONST(1990.467169428533/8.0),
- REAL_CONST(1999.3780400196069/8.0),
- REAL_CONST(2008.2988502465078/8.0),
- REAL_CONST(2017.2295780087982/8.0),
- REAL_CONST(2026.1702013284819/8.0),
- REAL_CONST(2035.1206983489212/8.0),
- REAL_CONST(2044.0810473337688/8.0),
- REAL_CONST(2053.0512266659125/8.0),
- REAL_CONST(2062.0312148464309/8.0),
- REAL_CONST(2071.0209904935646/8.0),
- REAL_CONST(2080.0205323416958/8.0),
- REAL_CONST(2089.0298192403443/8.0),
- REAL_CONST(2098.0488301531714/8.0),
- REAL_CONST(2107.0775441569995/8.0),
- REAL_CONST(2116.115940440839/8.0),
- REAL_CONST(2125.1639983049317/8.0),
- REAL_CONST(2134.2216971597995/8.0),
- REAL_CONST(2143.2890165253098/8.0),
- REAL_CONST(2152.3659360297484/8.0),
- REAL_CONST(2161.4524354089031/8.0),
- REAL_CONST(2170.5484945051617/8.0),
- REAL_CONST(2179.6540932666144/8.0),
- REAL_CONST(2188.7692117461711/8.0),
- REAL_CONST(2197.8938301006888/8.0),
- REAL_CONST(2207.0279285901042/8.0),
- REAL_CONST(2216.1714875765838/8.0),
- REAL_CONST(2225.324487523676/8.0),
- REAL_CONST(2234.4869089954782/8.0),
- REAL_CONST(2243.6587326558101/8.0),
- REAL_CONST(2252.8399392673982/8.0),
- REAL_CONST(2262.0305096910702/8.0),
- REAL_CONST(2271.2304248849537/8.0),
- REAL_CONST(2280.4396659036897/8.0),
- REAL_CONST(2289.6582138976523/8.0),
- REAL_CONST(2298.8860501121762/8.0),
- REAL_CONST(2308.1231558867926/8.0),
- REAL_CONST(2317.3695126544767/8.0),
- REAL_CONST(2326.6251019409005/8.0),
- REAL_CONST(2335.8899053636933/8.0),
- REAL_CONST(2345.1639046317132/8.0),
- REAL_CONST(2354.4470815443233/8.0),
- REAL_CONST(2363.7394179906792/8.0),
- REAL_CONST(2373.0408959490205/8.0),
- REAL_CONST(2382.3514974859731/8.0),
- REAL_CONST(2391.6712047558558/8.0),
- REAL_CONST(2400.9999999999991/8.0),
- REAL_CONST(2410.3378655460651/8.0),
- REAL_CONST(2419.6847838073813/8.0),
- REAL_CONST(2429.0407372822747/8.0),
- REAL_CONST(2438.4057085534191/8.0),
- REAL_CONST(2447.7796802871858/8.0),
- REAL_CONST(2457.1626352330004/8.0),
- REAL_CONST(2466.5545562227112/8.0),
- REAL_CONST(2475.9554261699564/8.0),
- REAL_CONST(2485.3652280695474/8.0),
- REAL_CONST(2494.7839449968492/8.0),
- REAL_CONST(2504.2115601071737/8.0),
- REAL_CONST(2513.6480566351788/8.0),
- REAL_CONST(2523.0934178942675/8.0),
- REAL_CONST(2532.5476272760025/8.0),
- REAL_CONST(2542.0106682495189/8.0),
- REAL_CONST(2551.482524360948/8.0),
- REAL_CONST(2560.9631792328441/8.0),
- REAL_CONST(2570.4526165636184/8.0),
- REAL_CONST(2579.9508201269791/8.0),
- REAL_CONST(2589.4577737713744/8.0),
- REAL_CONST(2598.9734614194458/8.0),
- REAL_CONST(2608.4978670674823/8.0),
- REAL_CONST(2618.0309747848837/8.0),
- REAL_CONST(2627.5727687136259/8.0),
- REAL_CONST(2637.1232330677353/8.0),
- REAL_CONST(2646.6823521327647/8.0),
- REAL_CONST(2656.2501102652768/8.0),
- REAL_CONST(2665.8264918923328/8.0),
- REAL_CONST(2675.4114815109842/8.0),
- REAL_CONST(2685.0050636877722/8.0),
- REAL_CONST(2694.6072230582295/8.0),
- REAL_CONST(2704.2179443263894/8.0),
- REAL_CONST(2713.8372122642972/8.0),
- REAL_CONST(2723.4650117115279/8.0),
- REAL_CONST(2733.1013275747096/8.0),
- REAL_CONST(2742.7461448270483/8.0),
- REAL_CONST(2752.3994485078601/8.0),
- REAL_CONST(2762.0612237221085/8.0),
- REAL_CONST(2771.7314556399419/8.0),
- REAL_CONST(2781.4101294962406/8.0),
- REAL_CONST(2791.0972305901655/8.0),
- REAL_CONST(2800.7927442847094/8.0),
- REAL_CONST(2810.4966560062589/8.0),
- REAL_CONST(2820.2089512441521/8.0),
- REAL_CONST(2829.9296155502466/8.0),
- REAL_CONST(2839.6586345384894/8.0),
- REAL_CONST(2849.3959938844923/8.0),
- REAL_CONST(2859.1416793251065/8.0),
- REAL_CONST(2868.8956766580086/8.0),
- REAL_CONST(2878.6579717412847/8.0),
- REAL_CONST(2888.4285504930212/8.0),
- REAL_CONST(2898.2073988908974/8.0),
- REAL_CONST(2907.9945029717837/8.0),
- REAL_CONST(2917.789848831344/8.0),
- REAL_CONST(2927.5934226236377/8.0),
- REAL_CONST(2937.4052105607311/8.0),
- REAL_CONST(2947.2251989123079/8.0),
- REAL_CONST(2957.0533740052865/8.0),
- REAL_CONST(2966.8897222234368/8.0),
- REAL_CONST(2976.734230007005/8.0),
- REAL_CONST(2986.5868838523397/8.0),
- REAL_CONST(2996.4476703115197/8.0),
- REAL_CONST(3006.3165759919889/8.0),
- REAL_CONST(3016.1935875561908/8.0),
- REAL_CONST(3026.0786917212095/8.0),
- REAL_CONST(3035.9718752584108/8.0),
- REAL_CONST(3045.8731249930906/8.0),
- REAL_CONST(3055.7824278041207/8.0),
- REAL_CONST(3065.6997706236039/8.0),
- REAL_CONST(3075.625140436528/8.0),
- REAL_CONST(3085.5585242804245/8.0),
- REAL_CONST(3095.4999092450298/8.0),
- REAL_CONST(3105.4492824719491/8.0),
- REAL_CONST(3115.4066311543256/8.0),
- REAL_CONST(3125.3719425365089/8.0),
- REAL_CONST(3135.3452039137287/8.0),
- REAL_CONST(3145.3264026317715/8.0),
- REAL_CONST(3155.3155260866592/8.0),
- REAL_CONST(3165.3125617243295/8.0),
- REAL_CONST(3175.3174970403229/8.0),
- REAL_CONST(3185.3303195794679/8.0),
- REAL_CONST(3195.35101693557/8.0),
- REAL_CONST(3205.3795767511078/8.0),
- REAL_CONST(3215.4159867169251/8.0),
- REAL_CONST(3225.460234571929/8.0),
- REAL_CONST(3235.5123081027928/8.0),
- REAL_CONST(3245.5721951436558/8.0),
- REAL_CONST(3255.63988357583/8.0),
- REAL_CONST(3265.7153613275095/8.0),
- REAL_CONST(3275.7986163734795/8.0),
- REAL_CONST(3285.8896367348289/8.0),
- REAL_CONST(3295.9884104786665/8.0),
- REAL_CONST(3306.0949257178395/8.0),
- REAL_CONST(3316.2091706106517/8.0),
- REAL_CONST(3326.331133360588/8.0),
- REAL_CONST(3336.4608022160378/8.0),
- REAL_CONST(3346.5981654700231/8.0),
- REAL_CONST(3356.7432114599264/8.0),
- REAL_CONST(3366.8959285672249/8.0),
- REAL_CONST(3377.0563052172211/8.0),
- REAL_CONST(3387.2243298787821/8.0),
- REAL_CONST(3397.3999910640764/8.0),
- REAL_CONST(3407.5832773283128/8.0),
- REAL_CONST(3417.7741772694862/8.0),
- REAL_CONST(3427.9726795281199/8.0),
- REAL_CONST(3438.1787727870123/8.0),
- REAL_CONST(3448.3924457709873/8.0),
- REAL_CONST(3458.6136872466445/8.0),
- REAL_CONST(3468.8424860221107/8.0),
- REAL_CONST(3479.0788309467976/8.0),
- REAL_CONST(3489.3227109111554/8.0),
- REAL_CONST(3499.5741148464344/8.0),
- REAL_CONST(3509.8330317244445/8.0),
- REAL_CONST(3520.0994505573185/8.0),
- REAL_CONST(3530.3733603972751/8.0),
- REAL_CONST(3540.6547503363886/8.0),
- REAL_CONST(3550.9436095063534/8.0),
- REAL_CONST(3561.239927078258/8.0),
- REAL_CONST(3571.5436922623535/8.0),
- REAL_CONST(3581.8548943078308/8.0),
- REAL_CONST(3592.1735225025936/8.0),
- REAL_CONST(3602.4995661730372/8.0),
- REAL_CONST(3612.8330146838275/8.0),
- REAL_CONST(3623.1738574376814/8.0),
- REAL_CONST(3633.5220838751502/8.0),
- REAL_CONST(3643.8776834744031/8.0),
- REAL_CONST(3654.2406457510142/8.0),
- REAL_CONST(3664.6109602577494/8.0),
- REAL_CONST(3674.9886165843564/8.0),
- REAL_CONST(3685.3736043573545/8.0),
- REAL_CONST(3695.7659132398294/8.0),
- REAL_CONST(3706.1655329312248/8.0),
- REAL_CONST(3716.5724531671399/8.0),
- REAL_CONST(3726.9866637191262/8.0),
- REAL_CONST(3737.4081543944876/8.0),
- REAL_CONST(3747.8369150360782/8.0),
- REAL_CONST(3758.2729355221072/8.0),
- REAL_CONST(3768.7162057659411/8.0),
- REAL_CONST(3779.1667157159077/8.0),
- REAL_CONST(3789.6244553551055/8.0),
- REAL_CONST(3800.0894147012082/8.0),
- REAL_CONST(3810.5615838062768/8.0),
- REAL_CONST(3821.0409527565694/8.0),
- REAL_CONST(3831.5275116723533/8.0),
- REAL_CONST(3842.0212507077194/8.0),
- REAL_CONST(3852.522160050396/8.0),
- REAL_CONST(3863.0302299215673/8.0),
- REAL_CONST(3873.5454505756893/8.0),
- REAL_CONST(3884.0678123003108/8.0),
- REAL_CONST(3894.5973054158922/8.0),
- REAL_CONST(3905.1339202756285/8.0),
- REAL_CONST(3915.6776472652732/8.0),
- REAL_CONST(3926.2284768029604/8.0),
- REAL_CONST(3936.7863993390338/8.0),
- REAL_CONST(3947.3514053558706/8.0),
- REAL_CONST(3957.9234853677135/8.0),
- REAL_CONST(3968.5026299204969/8.0),
- REAL_CONST(3979.0888295916798/8.0),
- REAL_CONST(3989.6820749900776/8.0),
- REAL_CONST(4000.2823567556948/8.0),
- REAL_CONST(4010.8896655595613/8.0),
- REAL_CONST(4021.5039921035655/8.0),
- REAL_CONST(4032.1253271202945/8.0),
- REAL_CONST(4042.7536613728694/8.0),
- REAL_CONST(4053.3889856547858/8.0),
- REAL_CONST(4064.0312907897551/8.0),
- REAL_CONST(4074.6805676315448/8.0),
- REAL_CONST(4085.3368070638221/8.0),
- REAL_CONST(4095.9999999999982/8.0),
- REAL_CONST(4106.6701373830711/8.0),
- REAL_CONST(4117.347210185475/8.0),
- REAL_CONST(4128.0312094089259/8.0),
- REAL_CONST(4138.722126084268/8.0),
- REAL_CONST(4149.4199512713267/8.0),
- REAL_CONST(4160.1246760587583/8.0),
- REAL_CONST(4170.8362915638982/8.0),
- REAL_CONST(4181.5547889326181/8.0),
- REAL_CONST(4192.2801593391769/8.0),
- REAL_CONST(4203.0123939860741/8.0),
- REAL_CONST(4213.7514841039101/8.0),
- REAL_CONST(4224.4974209512384/8.0),
- REAL_CONST(4235.2501958144258/8.0),
- REAL_CONST(4246.0098000075095/8.0),
- REAL_CONST(4256.7762248720574/8.0),
- REAL_CONST(4267.549461777031/8.0),
- REAL_CONST(4278.3295021186423/8.0),
- REAL_CONST(4289.1163373202198/8.0),
- REAL_CONST(4299.9099588320714/8.0),
- REAL_CONST(4310.7103581313495/8.0),
- REAL_CONST(4321.5175267219138/8.0),
- REAL_CONST(4332.3314561342004/8.0),
- REAL_CONST(4343.152137925088/8.0),
- REAL_CONST(4353.9795636777671/8.0),
- REAL_CONST(4364.8137250016052/8.0),
- REAL_CONST(4375.6546135320223/8.0),
- REAL_CONST(4386.5022209303588/8.0),
- REAL_CONST(4397.3565388837469/8.0),
- REAL_CONST(4408.2175591049827/8.0),
- REAL_CONST(4419.0852733324018/8.0),
- REAL_CONST(4429.9596733297531/8.0),
- REAL_CONST(4440.8407508860728/8.0),
- REAL_CONST(4451.7284978155603/8.0),
- REAL_CONST(4462.6229059574571/8.0),
- REAL_CONST(4473.5239671759227/8.0),
- REAL_CONST(4484.4316733599126/8.0),
- REAL_CONST(4495.3460164230582/8.0),
- REAL_CONST(4506.2669883035496/8.0),
- REAL_CONST(4517.1945809640119/8.0),
- REAL_CONST(4528.1287863913894/8.0),
- REAL_CONST(4539.069596596828/8.0),
- REAL_CONST(4550.0170036155587/8.0),
- REAL_CONST(4560.9709995067806/8.0),
- REAL_CONST(4571.931576353546/8.0),
- REAL_CONST(4582.898726262647/8.0),
- REAL_CONST(4593.8724413645004/8.0),
- REAL_CONST(4604.8527138130348/8.0),
- REAL_CONST(4615.8395357855816/8.0),
- REAL_CONST(4626.8328994827571/8.0),
- REAL_CONST(4637.8327971283588/8.0),
- REAL_CONST(4648.8392209692511/8.0),
- REAL_CONST(4659.8521632752563/8.0),
- REAL_CONST(4670.8716163390473/8.0),
- REAL_CONST(4681.8975724760394/8.0),
- REAL_CONST(4692.9300240242837/8.0),
- REAL_CONST(4703.9689633443595/8.0),
- REAL_CONST(4715.0143828192668/8.0),
- REAL_CONST(4726.0662748543255/8.0),
- REAL_CONST(4737.1246318770682/8.0),
- REAL_CONST(4748.1894463371373/8.0),
- REAL_CONST(4759.2607107061804/8.0),
- REAL_CONST(4770.3384174777493/8.0),
- REAL_CONST(4781.4225591671993/8.0),
- REAL_CONST(4792.5131283115852/8.0),
- REAL_CONST(4803.6101174695614/8.0),
- REAL_CONST(4814.7135192212854/8.0),
- REAL_CONST(4825.8233261683154/8.0),
- REAL_CONST(4836.9395309335096/8.0),
- REAL_CONST(4848.0621261609349/8.0),
- REAL_CONST(4859.1911045157631/8.0),
- REAL_CONST(4870.3264586841779/8.0),
- REAL_CONST(4881.4681813732768/8.0),
- REAL_CONST(4892.6162653109768/8.0),
- REAL_CONST(4903.7707032459193/8.0),
- REAL_CONST(4914.931487947375/8.0),
- REAL_CONST(4926.0986122051509/8.0),
- REAL_CONST(4937.2720688294967/8.0),
- REAL_CONST(4948.4518506510112/8.0),
- REAL_CONST(4959.637950520555/8.0),
- REAL_CONST(4970.8303613091521/8.0),
- REAL_CONST(4982.0290759079044/8.0),
- REAL_CONST(4993.2340872278974/8.0),
- REAL_CONST(5004.4453882001153/8.0),
- REAL_CONST(5015.6629717753467/8.0),
- REAL_CONST(5026.8868309241007/8.0),
- REAL_CONST(5038.1169586365131/8.0),
- REAL_CONST(5049.353347922266/8.0),
- REAL_CONST(5060.5959918104927/8.0),
- REAL_CONST(5071.8448833496996/8.0),
- REAL_CONST(5083.1000156076734/8.0),
- REAL_CONST(5094.3613816713996/8.0),
- REAL_CONST(5105.6289746469747/8.0),
- REAL_CONST(5116.9027876595246/8.0),
- REAL_CONST(5128.18281385312/8.0),
- REAL_CONST(5139.4690463906918/8.0),
- REAL_CONST(5150.7614784539473/8.0),
- REAL_CONST(5162.0601032432933/8.0),
- REAL_CONST(5173.3649139777472/8.0),
- REAL_CONST(5184.6759038948594/8.0),
- REAL_CONST(5195.9930662506322/8.0),
- REAL_CONST(5207.3163943194386/8.0),
- REAL_CONST(5218.6458813939435/8.0),
- REAL_CONST(5229.9815207850224/8.0),
- REAL_CONST(5241.3233058216847/8.0),
- REAL_CONST(5252.6712298509919/8.0),
- REAL_CONST(5264.025286237983/8.0),
- REAL_CONST(5275.3854683655954/8.0),
- REAL_CONST(5286.7517696345885/8.0),
- REAL_CONST(5298.1241834634639/8.0),
- REAL_CONST(5309.5027032883945/8.0),
- REAL_CONST(5320.887322563146/8.0),
- REAL_CONST(5332.2780347589978/8.0),
- REAL_CONST(5343.6748333646756/8.0),
- REAL_CONST(5355.0777118862716/8.0),
- REAL_CONST(5366.4866638471722/8.0),
- REAL_CONST(5377.901682787985/8.0),
- REAL_CONST(5389.3227622664635/8.0),
- REAL_CONST(5400.749895857437/8.0),
- REAL_CONST(5412.1830771527357/8.0),
- REAL_CONST(5423.622299761123/8.0),
- REAL_CONST(5435.067557308219/8.0),
- REAL_CONST(5446.5188434364318/8.0),
- REAL_CONST(5457.9761518048872/8.0),
- REAL_CONST(5469.4394760893592/8.0),
- REAL_CONST(5480.9088099821975/8.0),
- REAL_CONST(5492.3841471922606/8.0),
- REAL_CONST(5503.8654814448455/8.0),
- REAL_CONST(5515.3528064816201/8.0),
- REAL_CONST(5526.846116060552/8.0),
- REAL_CONST(5538.3454039558474/8.0),
- REAL_CONST(5549.8506639578736/8.0),
- REAL_CONST(5561.3618898731029/8.0),
- REAL_CONST(5572.8790755240361/8.0),
- REAL_CONST(5584.4022147491451/8.0),
- REAL_CONST(5595.9313014027975/8.0),
- REAL_CONST(5607.4663293552012/8.0),
- REAL_CONST(5619.0072924923297/8.0),
- REAL_CONST(5630.5541847158656/8.0),
- REAL_CONST(5642.1069999431284/8.0),
- REAL_CONST(5653.665732107017/8.0),
- REAL_CONST(5665.230375155943/8.0),
- REAL_CONST(5676.8009230537655/8.0),
- REAL_CONST(5688.3773697797333/8.0),
- REAL_CONST(5699.9597093284156/8.0),
- REAL_CONST(5711.5479357096474/8.0),
- REAL_CONST(5723.1420429484588/8.0),
- REAL_CONST(5734.7420250850209/8.0),
- REAL_CONST(5746.347876174581/8.0),
- REAL_CONST(5757.9595902874016/8.0),
- REAL_CONST(5769.5771615087006/8.0),
- REAL_CONST(5781.2005839385911/8.0),
- REAL_CONST(5792.8298516920213/8.0),
- REAL_CONST(5804.4649588987149/8.0),
- REAL_CONST(5816.1058997031105/8.0),
- REAL_CONST(5827.7526682643065/8.0),
- REAL_CONST(5839.4052587559972/8.0),
- REAL_CONST(5851.0636653664196/8.0),
- REAL_CONST(5862.7278822982908/8.0),
- REAL_CONST(5874.3979037687541/8.0),
- REAL_CONST(5886.0737240093204/8.0),
- REAL_CONST(5897.7553372658094/8.0),
- REAL_CONST(5909.4427377982956/8.0),
- REAL_CONST(5921.1359198810505/8.0),
- REAL_CONST(5932.8348778024874/8.0),
- REAL_CONST(5944.5396058651031/8.0),
- REAL_CONST(5956.2500983854261/8.0),
- REAL_CONST(5967.9663496939575/8.0),
- REAL_CONST(5979.6883541351208/8.0),
- REAL_CONST(5991.4161060672022/8.0),
- REAL_CONST(6003.1495998623004/8.0),
- REAL_CONST(6014.8888299062692/8.0),
- REAL_CONST(6026.6337905986684/8.0),
- REAL_CONST(6038.3844763527022/8.0),
- REAL_CONST(6050.1408815951781/8.0),
- REAL_CONST(6061.9030007664414/8.0),
- REAL_CONST(6073.6708283203316/8.0),
- REAL_CONST(6085.4443587241267/8.0),
- REAL_CONST(6097.2235864584891/8.0),
- REAL_CONST(6109.0085060174197/8.0),
- REAL_CONST(6120.7991119081998/8.0),
- REAL_CONST(6132.595398651345/8.0),
- REAL_CONST(6144.3973607805519/8.0),
- REAL_CONST(6156.2049928426459/8.0),
- REAL_CONST(6168.0182893975361/8.0),
- REAL_CONST(6179.8372450181578/8.0),
- REAL_CONST(6191.6618542904307/8.0),
- REAL_CONST(6203.4921118132024/8.0),
- REAL_CONST(6215.3280121982016/8.0),
- REAL_CONST(6227.1695500699925/8.0),
- REAL_CONST(6239.0167200659189/8.0),
- REAL_CONST(6250.8695168360628/8.0),
- REAL_CONST(6262.7279350431891/8.0),
- REAL_CONST(6274.5919693627056/8.0),
- REAL_CONST(6286.4616144826068/8.0),
- REAL_CONST(6298.3368651034316/8.0),
- REAL_CONST(6310.2177159382172/8.0),
- REAL_CONST(6322.1041617124456/8.0),
- REAL_CONST(6333.9961971640032/8.0),
- REAL_CONST(6345.8938170431311/8.0),
- REAL_CONST(6357.7970161123785/8.0),
- REAL_CONST(6369.7057891465583/8.0),
- REAL_CONST(6381.6201309327007/8.0),
- REAL_CONST(6393.5400362700075/8.0),
- REAL_CONST(6405.4654999698032/8.0),
- REAL_CONST(6417.3965168554978/8.0),
- REAL_CONST(6429.3330817625329/8.0),
- REAL_CONST(6441.2751895383453/8.0),
- REAL_CONST(6453.2228350423138/8.0),
- REAL_CONST(6465.176013145724/8.0),
- REAL_CONST(6477.134718731716/8.0),
- REAL_CONST(6489.0989466952469/8.0),
- REAL_CONST(6501.0686919430445/8.0),
- REAL_CONST(6513.0439493935628/8.0),
- REAL_CONST(6525.0247139769417/8.0),
- REAL_CONST(6537.010980634961/8.0),
- REAL_CONST(6549.002744321001/8.0),
- REAL_CONST(6560.9999999999973/8.0),
- REAL_CONST(6573.0027426483985/8.0),
- REAL_CONST(6585.0109672541284/8.0),
- REAL_CONST(6597.0246688165371/8.0),
- REAL_CONST(6609.0438423463656/8.0),
- REAL_CONST(6621.0684828657004/8.0),
- REAL_CONST(6633.0985854079354/8.0),
- REAL_CONST(6645.134145017727/8.0),
- REAL_CONST(6657.1751567509573/8.0),
- REAL_CONST(6669.2216156746908/8.0),
- REAL_CONST(6681.2735168671343/8.0),
- REAL_CONST(6693.3308554176001/8.0),
- REAL_CONST(6705.3936264264594/8.0),
- REAL_CONST(6717.461825005108/8.0),
- REAL_CONST(6729.535446275926/8.0),
- REAL_CONST(6741.6144853722335/8.0),
- REAL_CONST(6753.6989374382601/8.0),
- REAL_CONST(6765.7887976290967/8.0),
- REAL_CONST(6777.8840611106634/8.0),
- REAL_CONST(6789.9847230596661/8.0),
- REAL_CONST(6802.0907786635626/8.0),
- REAL_CONST(6814.2022231205201/8.0),
- REAL_CONST(6826.3190516393797/8.0),
- REAL_CONST(6838.4412594396181/8.0),
- REAL_CONST(6850.5688417513074/8.0),
- REAL_CONST(6862.701793815083/8.0),
- REAL_CONST(6874.840110882099/8.0),
- REAL_CONST(6886.9837882139991/8.0),
- REAL_CONST(6899.1328210828724/8.0),
- REAL_CONST(6911.2872047712199/8.0),
- REAL_CONST(6923.4469345719199/8.0),
- REAL_CONST(6935.6120057881863/8.0),
- REAL_CONST(6947.7824137335365/8.0),
- REAL_CONST(6959.9581537317536/8.0),
- REAL_CONST(6972.1392211168532/8.0),
- REAL_CONST(6984.3256112330409/8.0),
- REAL_CONST(6996.5173194346862/8.0),
- REAL_CONST(7008.7143410862773/8.0),
- REAL_CONST(7020.9166715623942/8.0),
- REAL_CONST(7033.1243062476678/8.0),
- REAL_CONST(7045.3372405367481/8.0),
- REAL_CONST(7057.5554698342685/8.0),
- REAL_CONST(7069.7789895548103/8.0),
- REAL_CONST(7082.0077951228714/8.0),
- REAL_CONST(7094.2418819728273/8.0),
- REAL_CONST(7106.4812455489018/8.0),
- REAL_CONST(7118.7258813051285/8.0),
- REAL_CONST(7130.9757847053224/8.0),
- REAL_CONST(7143.2309512230404/8.0),
- REAL_CONST(7155.4913763415516/8.0),
- REAL_CONST(7167.7570555538041/8.0),
- REAL_CONST(7180.0279843623894/8.0),
- REAL_CONST(7192.3041582795131/8.0),
- REAL_CONST(7204.5855728269571/8.0),
- REAL_CONST(7216.8722235360519/8.0),
- REAL_CONST(7229.1641059476406/8.0),
- REAL_CONST(7241.4612156120484/8.0),
- REAL_CONST(7253.7635480890503/8.0),
- REAL_CONST(7266.0710989478375/8.0),
- REAL_CONST(7278.3838637669869/8.0),
- REAL_CONST(7290.7018381344296/8.0),
- REAL_CONST(7303.0250176474174/8.0),
- REAL_CONST(7315.3533979124932/8.0),
- REAL_CONST(7327.6869745454596/8.0),
- REAL_CONST(7340.0257431713462/8.0),
- REAL_CONST(7352.3696994243801/8.0),
- REAL_CONST(7364.7188389479543/8.0),
- REAL_CONST(7377.0731573945968/8.0),
- REAL_CONST(7389.4326504259407/8.0),
- REAL_CONST(7401.7973137126937/8.0),
- REAL_CONST(7414.1671429346061/8.0),
- REAL_CONST(7426.5421337804428/8.0),
- REAL_CONST(7438.922281947951/8.0),
- REAL_CONST(7451.3075831438346/8.0),
- REAL_CONST(7463.6980330837177/8.0),
- REAL_CONST(7476.0936274921214/8.0),
- REAL_CONST(7488.4943621024304/8.0),
- REAL_CONST(7500.9002326568652/8.0),
- REAL_CONST(7513.3112349064522/8.0),
- REAL_CONST(7525.7273646109943/8.0),
- REAL_CONST(7538.1486175390446/8.0),
- REAL_CONST(7550.5749894678729/8.0),
- REAL_CONST(7563.0064761834419/8.0),
- REAL_CONST(7575.4430734803736/8.0),
- REAL_CONST(7587.8847771619248/8.0),
- REAL_CONST(7600.3315830399597/8.0),
- REAL_CONST(7612.7834869349153/8.0),
- REAL_CONST(7625.24048467578/8.0),
- REAL_CONST(7637.7025721000637/8.0),
- REAL_CONST(7650.1697450537677/8.0),
- REAL_CONST(7662.6419993913596/8.0),
- REAL_CONST(7675.1193309757446/8.0),
- REAL_CONST(7687.6017356782404/8.0),
- REAL_CONST(7700.0892093785433/8.0),
- REAL_CONST(7712.5817479647112/8.0),
- REAL_CONST(7725.079347333125/8.0),
- REAL_CONST(7737.5820033884729/8.0),
- REAL_CONST(7750.0897120437139/8.0),
- REAL_CONST(7762.6024692200581/8.0),
- REAL_CONST(7775.1202708469355/8.0),
- REAL_CONST(7787.6431128619733/8.0),
- REAL_CONST(7800.1709912109645/8.0),
- REAL_CONST(7812.7039018478481/8.0),
- REAL_CONST(7825.2418407346768/8.0),
- REAL_CONST(7837.7848038415968/8.0),
- REAL_CONST(7850.3327871468155/8.0),
- REAL_CONST(7862.8857866365806/8.0),
- REAL_CONST(7875.4437983051539/8.0),
- REAL_CONST(7888.006818154784/8.0),
- REAL_CONST(7900.5748421956796/8.0),
- REAL_CONST(7913.1478664459901/8.0),
- REAL_CONST(7925.725886931772/8.0),
- REAL_CONST(7938.3088996869719/8.0),
- REAL_CONST(7950.8969007533951/8.0),
- REAL_CONST(7963.4898861806851/8.0),
- REAL_CONST(7976.0878520262959/8.0),
- REAL_CONST(7988.6907943554688/8.0),
- REAL_CONST(8001.2987092412086/8.0),
- REAL_CONST(8013.911592764257/8.0),
- REAL_CONST(8026.5294410130691/8.0),
- REAL_CONST(8039.1522500837891/8.0),
- REAL_CONST(8051.7800160802271/8.0),
- REAL_CONST(8064.412735113835/8.0),
- REAL_CONST(8077.0504033036796/8.0),
- REAL_CONST(8089.6930167764222/8.0),
- REAL_CONST(8102.3405716662946/8.0),
- REAL_CONST(8114.9930641150731/8.0),
- REAL_CONST(8127.6504902720571/8.0),
- REAL_CONST(8140.3128462940449/8.0),
- REAL_CONST(8152.9801283453098/8.0),
- REAL_CONST(8165.6523325975786/8.0),
- REAL_CONST(8178.3294552300049/8.0),
- REAL_CONST(8191.0114924291529/8.0),
- REAL_CONST(8203.6984403889655/8.0),
- REAL_CONST(8216.3902953107463/8.0),
- REAL_CONST(8229.0870534031419/8.0),
- REAL_CONST(8241.7887108821069/8.0),
- REAL_CONST(8254.4952639708936/8.0),
- REAL_CONST(8267.2067089000211/8.0),
- REAL_CONST(8279.9230419072574/8.0),
- REAL_CONST(8292.6442592375952/8.0),
- REAL_CONST(8305.3703571432306/8.0),
- REAL_CONST(8318.101331883543/8.0),
- REAL_CONST(8330.8371797250657/8.0),
- REAL_CONST(8343.577896941475/8.0),
- REAL_CONST(8356.3234798135582/8.0),
- REAL_CONST(8369.0739246291978/8.0),
- REAL_CONST(8381.8292276833508/8.0),
- REAL_CONST(8394.5893852780209/8.0),
- REAL_CONST(8407.3543937222421/8.0),
- REAL_CONST(8420.1242493320569/8.0),
- REAL_CONST(8432.8989484304948/8.0),
- REAL_CONST(8445.6784873475499/8.0),
- REAL_CONST(8458.4628624201578/8.0),
- REAL_CONST(8471.2520699921806/8.0),
- REAL_CONST(8484.0461064143838/8.0),
- REAL_CONST(8496.8449680444082/8.0),
- REAL_CONST(8509.6486512467636/8.0),
- REAL_CONST(8522.4571523927953/8.0),
- REAL_CONST(8535.270467860666/8.0),
- REAL_CONST(8548.0885940353437/8.0),
- REAL_CONST(8560.9115273085663/8.0),
- REAL_CONST(8573.7392640788403/8.0),
- REAL_CONST(8586.5718007514006/8.0),
- REAL_CONST(8599.4091337382069/8.0),
- REAL_CONST(8612.2512594579148/8.0),
- REAL_CONST(8625.0981743358552/8.0),
- REAL_CONST(8637.9498748040205/8.0),
- REAL_CONST(8650.8063573010386/8.0),
- REAL_CONST(8663.6676182721567/8.0),
- REAL_CONST(8676.533654169225/8.0),
- REAL_CONST(8689.4044614506638/8.0),
- REAL_CONST(8702.2800365814601/8.0),
- REAL_CONST(8715.1603760331418/8.0),
- REAL_CONST(8728.0454762837508/8.0),
- REAL_CONST(8740.9353338178389/8.0),
- REAL_CONST(8753.8299451264356/8.0),
- REAL_CONST(8766.7293067070332/8.0),
- REAL_CONST(8779.6334150635721/8.0),
- REAL_CONST(8792.5422667064158/8.0),
- REAL_CONST(8805.4558581523324/8.0),
- REAL_CONST(8818.3741859244819/8.0),
- REAL_CONST(8831.2972465523908/8.0),
- REAL_CONST(8844.2250365719356/8.0),
- REAL_CONST(8857.1575525253265/8.0),
- REAL_CONST(8870.0947909610859/8.0),
- REAL_CONST(8883.0367484340295/8.0),
- REAL_CONST(8895.9834215052524/8.0),
- REAL_CONST(8908.934806742107/8.0),
- REAL_CONST(8921.8909007181846/8.0),
- REAL_CONST(8934.8517000132997/8.0),
- REAL_CONST(8947.817201213471/8.0),
- REAL_CONST(8960.7874009109/8.0),
- REAL_CONST(8973.7622957039603/8.0),
- REAL_CONST(8986.7418821971733/8.0),
- REAL_CONST(8999.7261570011924/8.0),
- REAL_CONST(9012.7151167327884/8.0),
- REAL_CONST(9025.7087580148236/8.0),
- REAL_CONST(9038.7070774762469/8.0),
- REAL_CONST(9051.7100717520643/8.0),
- REAL_CONST(9064.7177374833282/8.0),
- REAL_CONST(9077.7300713171153/8.0),
- REAL_CONST(9090.7470699065179/8.0),
- REAL_CONST(9103.7687299106146/8.0),
- REAL_CONST(9116.7950479944648/8.0),
- REAL_CONST(9129.8260208290812/8.0),
- REAL_CONST(9142.8616450914233/8.0),
- REAL_CONST(9155.9019174643727/8.0),
- REAL_CONST(9168.9468346367157/8.0),
- REAL_CONST(9181.9963933031358/8.0),
- REAL_CONST(9195.0505901641845/8.0),
- REAL_CONST(9208.1094219262741/8.0),
- REAL_CONST(9221.1728853016557/8.0),
- REAL_CONST(9234.240977008405/8.0),
- REAL_CONST(9247.3136937704076/8.0),
- REAL_CONST(9260.3910323173386/8.0),
- REAL_CONST(9273.472989384647/8.0),
- REAL_CONST(9286.5595617135423/8.0),
- REAL_CONST(9299.6507460509747/8.0),
- REAL_CONST(9312.7465391496207/8.0),
- REAL_CONST(9325.8469377678684/8.0),
- REAL_CONST(9338.9519386698012/8.0),
- REAL_CONST(9352.0615386251757/8.0),
- REAL_CONST(9365.1757344094131/8.0),
- REAL_CONST(9378.2945228035842/8.0),
- REAL_CONST(9391.4179005943843/8.0),
- REAL_CONST(9404.5458645741273/8.0),
- REAL_CONST(9417.6784115407263/8.0),
- REAL_CONST(9430.8155382976747/8.0),
- REAL_CONST(9443.9572416540359/8.0),
- REAL_CONST(9457.1035184244265/8.0),
- REAL_CONST(9470.2543654290002/8.0),
- REAL_CONST(9483.4097794934296/8.0),
- REAL_CONST(9496.5697574488931/8.0),
- REAL_CONST(9509.7342961320664/8.0),
- REAL_CONST(9522.9033923850911/8.0),
- REAL_CONST(9536.0770430555804/8.0),
- REAL_CONST(9549.2552449965824/8.0),
- REAL_CONST(9562.4379950665825/8.0),
- REAL_CONST(9575.6252901294793/8.0),
- REAL_CONST(9588.8171270545736/8.0),
- REAL_CONST(9602.0135027165488/8.0),
- REAL_CONST(9615.2144139954635/8.0),
- REAL_CONST(9628.4198577767274/8.0),
- REAL_CONST(9641.629830951093/8.0),
- REAL_CONST(9654.844330414644/8.0),
- REAL_CONST(9668.0633530687719/8.0),
- REAL_CONST(9681.286895820167/8.0),
- REAL_CONST(9694.5149555808002/8.0),
- REAL_CONST(9707.7475292679192/8.0),
- REAL_CONST(9720.9846138040157/8.0),
- REAL_CONST(9734.2262061168276/8.0),
- REAL_CONST(9747.4723031393187/8.0),
- REAL_CONST(9760.7229018096641/8.0),
- REAL_CONST(9773.9779990712323/8.0),
- REAL_CONST(9787.2375918725811/8.0),
- REAL_CONST(9800.5016771674327/8.0),
- REAL_CONST(9813.7702519146696/8.0),
- REAL_CONST(9827.0433130783094/8.0),
- REAL_CONST(9840.3208576275028/8.0),
- REAL_CONST(9853.602882536512/8.0),
- REAL_CONST(9866.8893847846994/8.0),
- REAL_CONST(9880.1803613565116/8.0),
- REAL_CONST(9893.4758092414686/8.0),
- REAL_CONST(9906.7757254341523/8.0),
- REAL_CONST(9920.0801069341851/8.0),
- REAL_CONST(9933.3889507462245/8.0),
- REAL_CONST(9946.7022538799429/8.0),
- REAL_CONST(9960.0200133500221/8.0),
- REAL_CONST(9973.3422261761298/8.0),
- REAL_CONST(9986.6688893829159/8.0),
- REAL_CONST(9999.9999999999945/8.0),
- REAL_CONST(10013.335555061929/8.0),
- REAL_CONST(10026.675551608221/8.0),
- REAL_CONST(10040.019986683301/8.0),
- REAL_CONST(10053.368857336509/8.0),
- REAL_CONST(10066.722160622081/8.0),
- REAL_CONST(10080.079893599144/8.0),
- REAL_CONST(10093.442053331697/8.0),
- REAL_CONST(10106.808636888598/8.0),
- REAL_CONST(10120.179641343551/8.0),
- REAL_CONST(10133.555063775095/8.0),
- REAL_CONST(10146.934901266595/8.0),
- REAL_CONST(10160.31915090622/8.0),
- REAL_CONST(10173.707809786936/8.0),
- REAL_CONST(10187.100875006496/8.0),
- REAL_CONST(10200.498343667417/8.0),
- REAL_CONST(10213.900212876984/8.0),
- REAL_CONST(10227.306479747222/8.0),
- REAL_CONST(10240.717141394889/8.0),
- REAL_CONST(10254.132194941467/8.0),
- REAL_CONST(10267.551637513146/8.0),
- REAL_CONST(10280.975466240814/8.0),
- REAL_CONST(10294.40367826004/8.0),
- REAL_CONST(10307.836270711066/8.0),
- REAL_CONST(10321.273240738796/8.0),
- REAL_CONST(10334.71458549278/8.0)
-#ifdef BIG_IQ_TABLE
- ,REAL_CONST(10348.160302127204/8.0),
- REAL_CONST(10361.610387800878/8.0),
- REAL_CONST(10375.064839677221/8.0),
- REAL_CONST(10388.523654924258/8.0),
- REAL_CONST(10401.986830714593/8.0),
- REAL_CONST(10415.454364225412/8.0),
- REAL_CONST(10428.926252638465/8.0),
- REAL_CONST(10442.402493140049/8.0),
- REAL_CONST(10455.883082921007/8.0),
- REAL_CONST(10469.368019176709/8.0),
- REAL_CONST(10482.85729910704/8.0),
- REAL_CONST(10496.350919916393/8.0),
- REAL_CONST(10509.848878813653/8.0),
- REAL_CONST(10523.351173012188/8.0),
- REAL_CONST(10536.857799729838/8.0),
- REAL_CONST(10550.3687561889/8.0),
- REAL_CONST(10563.884039616123/8.0),
- REAL_CONST(10577.403647242685/8.0),
- REAL_CONST(10590.927576304197/8.0),
- REAL_CONST(10604.455824040679/8.0),
- REAL_CONST(10617.988387696556/8.0),
- REAL_CONST(10631.525264520642/8.0),
- REAL_CONST(10645.066451766135/8.0),
- REAL_CONST(10658.611946690598/8.0),
- REAL_CONST(10672.161746555956/8.0),
- REAL_CONST(10685.715848628475/8.0),
- REAL_CONST(10699.274250178762/8.0),
- REAL_CONST(10712.836948481747/8.0),
- REAL_CONST(10726.403940816675/8.0),
- REAL_CONST(10739.975224467091/8.0),
- REAL_CONST(10753.550796720834/8.0),
- REAL_CONST(10767.130654870027/8.0),
- REAL_CONST(10780.714796211059/8.0),
- REAL_CONST(10794.303218044579/8.0),
- REAL_CONST(10807.895917675487/8.0),
- REAL_CONST(10821.492892412922/8.0),
- REAL_CONST(10835.094139570248/8.0),
- REAL_CONST(10848.699656465047/8.0),
- REAL_CONST(10862.309440419107/8.0),
- REAL_CONST(10875.923488758415/8.0),
- REAL_CONST(10889.541798813138/8.0),
- REAL_CONST(10903.16436791762/8.0),
- REAL_CONST(10916.791193410372/8.0),
- REAL_CONST(10930.422272634056/8.0),
- REAL_CONST(10944.05760293548/8.0),
- REAL_CONST(10957.697181665582/8.0),
- REAL_CONST(10971.341006179427/8.0),
- REAL_CONST(10984.98907383619/8.0),
- REAL_CONST(10998.641381999149/8.0),
- REAL_CONST(11012.297928035676/8.0),
- REAL_CONST(11025.958709317223/8.0),
- REAL_CONST(11039.623723219316/8.0),
- REAL_CONST(11053.292967121541/8.0),
- REAL_CONST(11066.966438407539/8.0),
- REAL_CONST(11080.64413446499/8.0),
- REAL_CONST(11094.326052685608/8.0),
- REAL_CONST(11108.012190465128/8.0),
- REAL_CONST(11121.702545203296/8.0),
- REAL_CONST(11135.397114303863/8.0),
- REAL_CONST(11149.095895174571/8.0),
- REAL_CONST(11162.798885227143/8.0),
- REAL_CONST(11176.506081877278/8.0),
- REAL_CONST(11190.217482544635/8.0),
- REAL_CONST(11203.933084652828/8.0),
- REAL_CONST(11217.652885629415/8.0),
- REAL_CONST(11231.376882905886/8.0),
- REAL_CONST(11245.105073917659/8.0),
- REAL_CONST(11258.837456104062/8.0),
- REAL_CONST(11272.574026908333/8.0),
- REAL_CONST(11286.314783777601/8.0),
- REAL_CONST(11300.059724162888/8.0),
- REAL_CONST(11313.808845519083/8.0),
- REAL_CONST(11327.562145304952/8.0),
- REAL_CONST(11341.319620983111/8.0),
- REAL_CONST(11355.081270020033/8.0),
- REAL_CONST(11368.847089886023/8.0),
- REAL_CONST(11382.617078055218/8.0),
- REAL_CONST(11396.391232005579/8.0),
- REAL_CONST(11410.169549218874/8.0),
- REAL_CONST(11423.952027180676/8.0),
- REAL_CONST(11437.738663380349/8.0),
- REAL_CONST(11451.529455311042/8.0),
- REAL_CONST(11465.324400469679/8.0),
- REAL_CONST(11479.123496356951/8.0),
- REAL_CONST(11492.926740477304/8.0),
- REAL_CONST(11506.734130338931/8.0),
- REAL_CONST(11520.545663453764/8.0),
- REAL_CONST(11534.361337337466/8.0),
- REAL_CONST(11548.181149509423/8.0),
- REAL_CONST(11562.005097492724/8.0),
- REAL_CONST(11575.83317881417/8.0),
- REAL_CONST(11589.665391004253/8.0),
- REAL_CONST(11603.501731597149/8.0),
- REAL_CONST(11617.342198130715/8.0),
- REAL_CONST(11631.186788146468/8.0),
- REAL_CONST(11645.035499189589/8.0),
- REAL_CONST(11658.888328808911/8.0),
- REAL_CONST(11672.745274556904/8.0),
- REAL_CONST(11686.606333989675/8.0),
- REAL_CONST(11700.471504666955/8.0),
- REAL_CONST(11714.340784152086/8.0),
- REAL_CONST(11728.214170012021/8.0),
- REAL_CONST(11742.091659817312/8.0),
- REAL_CONST(11755.973251142101/8.0),
- REAL_CONST(11769.858941564111/8.0),
- REAL_CONST(11783.748728664636/8.0),
- REAL_CONST(11797.642610028539/8.0),
- REAL_CONST(11811.540583244237/8.0),
- REAL_CONST(11825.442645903697/8.0),
- REAL_CONST(11839.34879560242/8.0),
- REAL_CONST(11853.259029939445/8.0),
- REAL_CONST(11867.173346517333/8.0),
- REAL_CONST(11881.091742942155/8.0),
- REAL_CONST(11895.014216823492/8.0),
- REAL_CONST(11908.940765774427/8.0),
- REAL_CONST(11922.871387411526/8.0),
- REAL_CONST(11936.806079354839/8.0),
- REAL_CONST(11950.744839227897/8.0),
- REAL_CONST(11964.687664657684/8.0),
- REAL_CONST(11978.634553274653/8.0),
- REAL_CONST(11992.585502712702/8.0),
- REAL_CONST(12006.540510609168/8.0),
- REAL_CONST(12020.499574604828/8.0),
- REAL_CONST(12034.462692343877/8.0),
- REAL_CONST(12048.429861473938/8.0),
- REAL_CONST(12062.401079646032/8.0),
- REAL_CONST(12076.376344514589/8.0),
- REAL_CONST(12090.355653737433/8.0),
- REAL_CONST(12104.339004975769/8.0),
- REAL_CONST(12118.326395894188/8.0),
- REAL_CONST(12132.317824160644/8.0),
- REAL_CONST(12146.313287446457/8.0),
- REAL_CONST(12160.312783426305/8.0),
- REAL_CONST(12174.316309778205/8.0),
- REAL_CONST(12188.323864183525/8.0),
- REAL_CONST(12202.335444326955/8.0),
- REAL_CONST(12216.351047896511/8.0),
- REAL_CONST(12230.370672583531/8.0),
- REAL_CONST(12244.394316082657/8.0),
- REAL_CONST(12258.421976091831/8.0),
- REAL_CONST(12272.453650312296/8.0),
- REAL_CONST(12286.489336448574/8.0),
- REAL_CONST(12300.529032208471/8.0),
- REAL_CONST(12314.572735303058/8.0),
- REAL_CONST(12328.620443446678/8.0),
- REAL_CONST(12342.672154356922/8.0),
- REAL_CONST(12356.727865754638/8.0),
- REAL_CONST(12370.787575363909/8.0),
- REAL_CONST(12384.851280912055/8.0),
- REAL_CONST(12398.918980129623/8.0),
- REAL_CONST(12412.990670750381/8.0),
- REAL_CONST(12427.066350511306/8.0),
- REAL_CONST(12441.146017152583/8.0),
- REAL_CONST(12455.229668417589/8.0),
- REAL_CONST(12469.317302052901/8.0),
- REAL_CONST(12483.40891580827/8.0),
- REAL_CONST(12497.50450743663/8.0),
- REAL_CONST(12511.604074694078/8.0),
- REAL_CONST(12525.707615339878/8.0),
- REAL_CONST(12539.815127136444/8.0),
- REAL_CONST(12553.926607849342/8.0),
- REAL_CONST(12568.042055247275/8.0),
- REAL_CONST(12582.161467102082/8.0),
- REAL_CONST(12596.284841188726/8.0),
- REAL_CONST(12610.41217528529/8.0),
- REAL_CONST(12624.543467172971/8.0),
- REAL_CONST(12638.678714636069/8.0),
- REAL_CONST(12652.817915461985/8.0),
- REAL_CONST(12666.961067441209/8.0),
- REAL_CONST(12681.108168367316/8.0),
- REAL_CONST(12695.259216036962/8.0),
- REAL_CONST(12709.414208249869/8.0),
- REAL_CONST(12723.573142808827/8.0),
- REAL_CONST(12737.736017519681/8.0),
- REAL_CONST(12751.902830191326/8.0),
- REAL_CONST(12766.073578635704/8.0),
- REAL_CONST(12780.248260667788/8.0),
- REAL_CONST(12794.426874105588/8.0),
- REAL_CONST(12808.609416770132/8.0),
- REAL_CONST(12822.795886485468/8.0),
- REAL_CONST(12836.986281078653/8.0),
- REAL_CONST(12851.180598379744/8.0),
- REAL_CONST(12865.378836221802/8.0),
- REAL_CONST(12879.580992440871/8.0),
- REAL_CONST(12893.787064875984/8.0),
- REAL_CONST(12907.997051369144/8.0),
- REAL_CONST(12922.210949765335/8.0),
- REAL_CONST(12936.428757912496/8.0),
- REAL_CONST(12950.650473661524/8.0),
- REAL_CONST(12964.876094866273/8.0),
- REAL_CONST(12979.105619383534/8.0),
- REAL_CONST(12993.339045073039/8.0),
- REAL_CONST(13007.576369797454/8.0),
- REAL_CONST(13021.817591422368/8.0),
- REAL_CONST(13036.062707816285/8.0),
- REAL_CONST(13050.311716850629/8.0),
- REAL_CONST(13064.564616399723/8.0),
- REAL_CONST(13078.821404340792/8.0),
- REAL_CONST(13093.082078553954/8.0),
- REAL_CONST(13107.346636922217/8.0),
- REAL_CONST(13121.615077331464/8.0),
- REAL_CONST(13135.887397670458/8.0),
- REAL_CONST(13150.163595830827/8.0),
- REAL_CONST(13164.44366970706/8.0),
- REAL_CONST(13178.727617196502/8.0),
- REAL_CONST(13193.015436199352/8.0),
- REAL_CONST(13207.307124618648/8.0),
- REAL_CONST(13221.602680360265/8.0),
- REAL_CONST(13235.902101332911/8.0),
- REAL_CONST(13250.205385448118/8.0),
- REAL_CONST(13264.512530620239/8.0),
- REAL_CONST(13278.823534766434/8.0),
- REAL_CONST(13293.138395806676/8.0),
- REAL_CONST(13307.457111663734/8.0),
- REAL_CONST(13321.779680263176/8.0),
- REAL_CONST(13336.106099533356/8.0),
- REAL_CONST(13350.436367405409/8.0),
- REAL_CONST(13364.77048181325/8.0),
- REAL_CONST(13379.108440693562/8.0),
- REAL_CONST(13393.450241985796/8.0),
- REAL_CONST(13407.795883632158/8.0),
- REAL_CONST(13422.145363577607/8.0),
- REAL_CONST(13436.498679769853/8.0),
- REAL_CONST(13450.855830159346/8.0),
- REAL_CONST(13465.216812699266/8.0),
- REAL_CONST(13479.581625345529/8.0),
- REAL_CONST(13493.950266056772/8.0),
- REAL_CONST(13508.32273279435/8.0),
- REAL_CONST(13522.699023522329/8.0),
- REAL_CONST(13537.079136207483/8.0),
- REAL_CONST(13551.463068819286/8.0),
- REAL_CONST(13565.850819329906/8.0),
- REAL_CONST(13580.2423857142/8.0),
- REAL_CONST(13594.63776594971/8.0),
- REAL_CONST(13609.036958016657/8.0),
- REAL_CONST(13623.439959897927/8.0),
- REAL_CONST(13637.846769579081/8.0),
- REAL_CONST(13652.257385048335/8.0),
- REAL_CONST(13666.67180429656/8.0),
- REAL_CONST(13681.090025317284/8.0),
- REAL_CONST(13695.512046106669/8.0),
- REAL_CONST(13709.937864663521/8.0),
- REAL_CONST(13724.367478989278/8.0),
- REAL_CONST(13738.800887088004/8.0),
- REAL_CONST(13753.238086966385/8.0),
- REAL_CONST(13767.679076633727/8.0),
- REAL_CONST(13782.123854101939/8.0),
- REAL_CONST(13796.572417385545/8.0),
- REAL_CONST(13811.024764501659/8.0),
- REAL_CONST(13825.480893469998/8.0),
- REAL_CONST(13839.94080231286/8.0),
- REAL_CONST(13854.404489055134/8.0),
- REAL_CONST(13868.871951724283/8.0),
- REAL_CONST(13883.34318835034/8.0),
- REAL_CONST(13897.818196965914/8.0),
- REAL_CONST(13912.296975606168/8.0),
- REAL_CONST(13926.779522308825/8.0),
- REAL_CONST(13941.26583511416/8.0),
- REAL_CONST(13955.755912064991/8.0),
- REAL_CONST(13970.249751206682/8.0),
- REAL_CONST(13984.747350587126/8.0),
- REAL_CONST(13999.248708256751/8.0),
- REAL_CONST(14013.753822268511/8.0),
- REAL_CONST(14028.262690677873/8.0),
- REAL_CONST(14042.775311542828/8.0),
- REAL_CONST(14057.291682923867/8.0),
- REAL_CONST(14071.811802883994/8.0),
- REAL_CONST(14086.335669488704/8.0),
- REAL_CONST(14100.863280805994/8.0),
- REAL_CONST(14115.394634906341/8.0),
- REAL_CONST(14129.92972986271/8.0),
- REAL_CONST(14144.468563750548/8.0),
- REAL_CONST(14159.01113464777/8.0),
- REAL_CONST(14173.55744063476/8.0),
- REAL_CONST(14188.107479794369/8.0),
- REAL_CONST(14202.661250211901/8.0),
- REAL_CONST(14217.218749975118/8.0),
- REAL_CONST(14231.779977174227/8.0),
- REAL_CONST(14246.344929901879/8.0),
- REAL_CONST(14260.913606253163/8.0),
- REAL_CONST(14275.486004325601/8.0),
- REAL_CONST(14290.062122219146/8.0),
- REAL_CONST(14304.641958036171/8.0),
- REAL_CONST(14319.225509881464/8.0),
- REAL_CONST(14333.812775862236/8.0),
- REAL_CONST(14348.403754088098/8.0),
- REAL_CONST(14362.998442671067/8.0),
- REAL_CONST(14377.59683972556/8.0),
- REAL_CONST(14392.198943368388/8.0),
- REAL_CONST(14406.804751718748/8.0),
- REAL_CONST(14421.414262898223/8.0),
- REAL_CONST(14436.027475030774/8.0),
- REAL_CONST(14450.64438624274/8.0),
- REAL_CONST(14465.264994662828/8.0),
- REAL_CONST(14479.889298422106/8.0),
- REAL_CONST(14494.517295654005/8.0),
- REAL_CONST(14509.148984494313/8.0),
- REAL_CONST(14523.784363081166/8.0),
- REAL_CONST(14538.423429555049/8.0),
- REAL_CONST(14553.066182058781/8.0),
- REAL_CONST(14567.712618737527/8.0),
- REAL_CONST(14582.362737738777/8.0),
- REAL_CONST(14597.016537212348/8.0),
- REAL_CONST(14611.674015310382/8.0),
- REAL_CONST(14626.33517018734/8.0),
- REAL_CONST(14640.999999999993/8.0),
- REAL_CONST(14655.668502907418/8.0),
- REAL_CONST(14670.340677071003/8.0),
- REAL_CONST(14685.016520654426/8.0),
- REAL_CONST(14699.696031823671/8.0),
- REAL_CONST(14714.379208746999/8.0),
- REAL_CONST(14729.066049594967/8.0),
- REAL_CONST(14743.756552540408/8.0),
- REAL_CONST(14758.45071575843/8.0),
- REAL_CONST(14773.148537426418/8.0),
- REAL_CONST(14787.850015724018/8.0),
- REAL_CONST(14802.555148833142/8.0),
- REAL_CONST(14817.263934937961/8.0),
- REAL_CONST(14831.976372224897/8.0),
- REAL_CONST(14846.692458882624/8.0),
- REAL_CONST(14861.41219310206/8.0),
- REAL_CONST(14876.135573076363/8.0),
- REAL_CONST(14890.862597000923/8.0),
- REAL_CONST(14905.593263073371/8.0),
- REAL_CONST(14920.327569493558/8.0),
- REAL_CONST(14935.065514463557/8.0),
- REAL_CONST(14949.807096187662/8.0),
- REAL_CONST(14964.552312872382/8.0),
- REAL_CONST(14979.301162726431/8.0),
- REAL_CONST(14994.053643960735/8.0),
- REAL_CONST(15008.809754788414/8.0),
- REAL_CONST(15023.569493424788/8.0),
- REAL_CONST(15038.332858087369/8.0),
- REAL_CONST(15053.099846995858/8.0),
- REAL_CONST(15067.870458372134/8.0),
- REAL_CONST(15082.644690440264/8.0),
- REAL_CONST(15097.422541426484/8.0),
- REAL_CONST(15112.204009559202/8.0),
- REAL_CONST(15126.989093068994/8.0),
- REAL_CONST(15141.777790188597/8.0),
- REAL_CONST(15156.570099152905/8.0),
- REAL_CONST(15171.366018198967/8.0),
- REAL_CONST(15186.165545565986/8.0),
- REAL_CONST(15200.968679495301/8.0),
- REAL_CONST(15215.775418230402/8.0),
- REAL_CONST(15230.585760016909/8.0),
- REAL_CONST(15245.399703102579/8.0),
- REAL_CONST(15260.217245737298/8.0),
- REAL_CONST(15275.038386173073/8.0),
- REAL_CONST(15289.863122664035/8.0),
- REAL_CONST(15304.691453466432/8.0),
- REAL_CONST(15319.523376838621/8.0),
- REAL_CONST(15334.358891041069/8.0),
- REAL_CONST(15349.197994336346/8.0),
- REAL_CONST(15364.040684989128/8.0),
- REAL_CONST(15378.886961266177/8.0),
- REAL_CONST(15393.736821436356/8.0),
- REAL_CONST(15408.590263770609/8.0),
- REAL_CONST(15423.447286541972/8.0),
- REAL_CONST(15438.307888025554/8.0),
- REAL_CONST(15453.172066498542/8.0),
- REAL_CONST(15468.039820240196/8.0),
- REAL_CONST(15482.91114753184/8.0),
- REAL_CONST(15497.786046656869/8.0),
- REAL_CONST(15512.664515900733/8.0),
- REAL_CONST(15527.546553550939/8.0),
- REAL_CONST(15542.432157897045/8.0),
- REAL_CONST(15557.32132723066/8.0),
- REAL_CONST(15572.214059845435/8.0),
- REAL_CONST(15587.110354037064/8.0),
- REAL_CONST(15602.010208103273/8.0),
- REAL_CONST(15616.913620343823/8.0),
- REAL_CONST(15631.820589060506/8.0),
- REAL_CONST(15646.731112557136/8.0),
- REAL_CONST(15661.645189139546/8.0),
- REAL_CONST(15676.562817115593/8.0),
- REAL_CONST(15691.483994795139/8.0),
- REAL_CONST(15706.408720490062/8.0),
- REAL_CONST(15721.336992514242/8.0),
- REAL_CONST(15736.268809183561/8.0),
- REAL_CONST(15751.204168815901/8.0),
- REAL_CONST(15766.143069731135/8.0),
- REAL_CONST(15781.085510251132/8.0),
- REAL_CONST(15796.03148869974/8.0),
- REAL_CONST(15810.981003402798/8.0),
- REAL_CONST(15825.934052688119/8.0),
- REAL_CONST(15840.890634885489/8.0),
- REAL_CONST(15855.850748326673/8.0),
- REAL_CONST(15870.814391345401/8.0),
- REAL_CONST(15885.781562277361/8.0),
- REAL_CONST(15900.752259460214/8.0),
- REAL_CONST(15915.726481233565/8.0),
- REAL_CONST(15930.704225938984/8.0),
- REAL_CONST(15945.685491919978/8.0),
- REAL_CONST(15960.670277522009/8.0),
- REAL_CONST(15975.658581092481/8.0),
- REAL_CONST(15990.65040098073/8.0),
- REAL_CONST(16005.645735538035/8.0),
- REAL_CONST(16020.644583117599/8.0),
- REAL_CONST(16035.646942074556/8.0),
- REAL_CONST(16050.652810765967/8.0),
- REAL_CONST(16065.662187550806/8.0),
- REAL_CONST(16080.675070789974/8.0),
- REAL_CONST(16095.691458846273/8.0),
- REAL_CONST(16110.711350084424/8.0),
- REAL_CONST(16125.734742871053/8.0),
- REAL_CONST(16140.761635574685/8.0),
- REAL_CONST(16155.792026565747/8.0),
- REAL_CONST(16170.825914216561/8.0),
- REAL_CONST(16185.863296901338/8.0),
- REAL_CONST(16200.904172996183/8.0),
- REAL_CONST(16215.948540879079/8.0),
- REAL_CONST(16230.996398929899/8.0),
- REAL_CONST(16246.047745530386/8.0),
- REAL_CONST(16261.102579064163/8.0),
- REAL_CONST(16276.160897916721/8.0),
- REAL_CONST(16291.22270047542/8.0),
- REAL_CONST(16306.287985129484/8.0),
- REAL_CONST(16321.356750269995/8.0),
- REAL_CONST(16336.428994289896/8.0),
- REAL_CONST(16351.504715583982/8.0),
- REAL_CONST(16366.5839125489/8.0),
- REAL_CONST(16381.666583583141/8.0),
- REAL_CONST(16396.752727087041/8.0),
- REAL_CONST(16411.842341462776/8.0),
- REAL_CONST(16426.935425114363/8.0),
- REAL_CONST(16442.031976447644/8.0),
- REAL_CONST(16457.131993870298/8.0),
- REAL_CONST(16472.235475791829/8.0),
- REAL_CONST(16487.342420623561/8.0),
- REAL_CONST(16502.452826778641/8.0),
- REAL_CONST(16517.566692672033/8.0),
- REAL_CONST(16532.684016720516/8.0),
- REAL_CONST(16547.804797342676/8.0),
- REAL_CONST(16562.929032958902/8.0),
- REAL_CONST(16578.056721991394/8.0),
- REAL_CONST(16593.18786286415/8.0),
- REAL_CONST(16608.322454002962/8.0),
- REAL_CONST(16623.460493835417/8.0),
- REAL_CONST(16638.601980790896/8.0),
- REAL_CONST(16653.746913300558/8.0),
- REAL_CONST(16668.895289797354/8.0),
- REAL_CONST(16684.047108716015/8.0),
- REAL_CONST(16699.202368493046/8.0),
- REAL_CONST(16714.361067566726/8.0),
- REAL_CONST(16729.523204377107/8.0),
- REAL_CONST(16744.688777366009/8.0),
- REAL_CONST(16759.857784977012/8.0),
- REAL_CONST(16775.030225655464/8.0),
- REAL_CONST(16790.206097848466/8.0),
- REAL_CONST(16805.385400004874/8.0),
- REAL_CONST(16820.568130575302/8.0),
- REAL_CONST(16835.754288012104/8.0),
- REAL_CONST(16850.943870769381/8.0),
- REAL_CONST(16866.136877302983/8.0),
- REAL_CONST(16881.333306070494/8.0),
- REAL_CONST(16896.53315553123/8.0),
- REAL_CONST(16911.736424146249/8.0),
- REAL_CONST(16926.943110378332/8.0),
- REAL_CONST(16942.153212691992/8.0),
- REAL_CONST(16957.366729553454/8.0),
- REAL_CONST(16972.583659430682/8.0),
- REAL_CONST(16987.804000793338/8.0),
- REAL_CONST(17003.027752112816/8.0),
- REAL_CONST(17018.254911862205/8.0),
- REAL_CONST(17033.485478516312/8.0),
- REAL_CONST(17048.719450551645/8.0),
- REAL_CONST(17063.956826446421/8.0),
- REAL_CONST(17079.197604680547/8.0),
- REAL_CONST(17094.44178373563/8.0),
- REAL_CONST(17109.689362094967/8.0),
- REAL_CONST(17124.940338243552/8.0),
- REAL_CONST(17140.194710668064/8.0),
- REAL_CONST(17155.452477856852/8.0),
- REAL_CONST(17170.713638299967/8.0),
- REAL_CONST(17185.978190489128/8.0),
- REAL_CONST(17201.246132917724/8.0),
- REAL_CONST(17216.517464080825/8.0),
- REAL_CONST(17231.792182475165/8.0),
- REAL_CONST(17247.070286599141/8.0),
- REAL_CONST(17262.351774952826/8.0),
- REAL_CONST(17277.636646037936/8.0),
- REAL_CONST(17292.924898357855/8.0),
- REAL_CONST(17308.216530417623/8.0),
- REAL_CONST(17323.511540723921/8.0),
- REAL_CONST(17338.809927785089/8.0),
- REAL_CONST(17354.111690111105/8.0),
- REAL_CONST(17369.416826213594/8.0),
- REAL_CONST(17384.725334605821/8.0),
- REAL_CONST(17400.037213802683/8.0),
- REAL_CONST(17415.352462320716/8.0),
- REAL_CONST(17430.67107867809/8.0),
- REAL_CONST(17445.993061394587/8.0),
- REAL_CONST(17461.318408991636/8.0),
- REAL_CONST(17476.647119992274/8.0),
- REAL_CONST(17491.979192921168/8.0),
- REAL_CONST(17507.314626304586/8.0),
- REAL_CONST(17522.653418670423/8.0),
- REAL_CONST(17537.995568548187/8.0),
- REAL_CONST(17553.341074468986/8.0),
- REAL_CONST(17568.689934965536/8.0),
- REAL_CONST(17584.042148572156/8.0),
- REAL_CONST(17599.397713824768/8.0),
- REAL_CONST(17614.75662926089/8.0),
- REAL_CONST(17630.118893419625/8.0),
- REAL_CONST(17645.484504841683/8.0),
- REAL_CONST(17660.853462069354/8.0),
- REAL_CONST(17676.225763646511/8.0),
- REAL_CONST(17691.601408118619/8.0),
- REAL_CONST(17706.980394032718/8.0),
- REAL_CONST(17722.362719937424/8.0),
- REAL_CONST(17737.748384382936/8.0),
- REAL_CONST(17753.137385921014/8.0),
- REAL_CONST(17768.529723104999/8.0),
- REAL_CONST(17783.92539448979/8.0),
- REAL_CONST(17799.324398631856/8.0),
- REAL_CONST(17814.726734089225/8.0),
- REAL_CONST(17830.13239942148/8.0),
- REAL_CONST(17845.541393189767/8.0),
- REAL_CONST(17860.95371395678/8.0),
- REAL_CONST(17876.369360286772/8.0),
- REAL_CONST(17891.788330745527/8.0),
- REAL_CONST(17907.210623900395/8.0),
- REAL_CONST(17922.636238320254/8.0),
- REAL_CONST(17938.065172575527/8.0),
- REAL_CONST(17953.497425238176/8.0),
- REAL_CONST(17968.932994881692/8.0),
- REAL_CONST(17984.371880081104/8.0),
- REAL_CONST(17999.814079412972/8.0),
- REAL_CONST(18015.259591455371/8.0),
- REAL_CONST(18030.708414787914/8.0),
- REAL_CONST(18046.160547991731/8.0),
- REAL_CONST(18061.615989649465/8.0),
- REAL_CONST(18077.074738345284/8.0),
- REAL_CONST(18092.536792664861/8.0),
- REAL_CONST(18108.002151195393/8.0),
- REAL_CONST(18123.470812525571/8.0),
- REAL_CONST(18138.942775245599/8.0),
- REAL_CONST(18154.418037947191/8.0),
- REAL_CONST(18169.896599223546/8.0),
- REAL_CONST(18185.37845766938/8.0),
- REAL_CONST(18200.863611880886/8.0),
- REAL_CONST(18216.352060455767/8.0),
- REAL_CONST(18231.843801993204/8.0),
- REAL_CONST(18247.338835093873/8.0),
- REAL_CONST(18262.837158359936/8.0),
- REAL_CONST(18278.338770395032/8.0),
- REAL_CONST(18293.84366980429/8.0),
- REAL_CONST(18309.351855194309/8.0),
- REAL_CONST(18324.863325173166/8.0),
- REAL_CONST(18340.378078350412/8.0),
- REAL_CONST(18355.896113337069/8.0),
- REAL_CONST(18371.417428745623/8.0),
- REAL_CONST(18386.942023190033/8.0),
- REAL_CONST(18402.469895285718/8.0),
- REAL_CONST(18418.00104364955/8.0),
- REAL_CONST(18433.53546689987/8.0),
- REAL_CONST(18449.073163656474/8.0),
- REAL_CONST(18464.614132540602/8.0),
- REAL_CONST(18480.158372174956/8.0),
- REAL_CONST(18495.705881183676/8.0),
- REAL_CONST(18511.256658192357/8.0),
- REAL_CONST(18526.810701828035/8.0),
- REAL_CONST(18542.368010719183/8.0),
- REAL_CONST(18557.928583495715/8.0),
- REAL_CONST(18573.492418788985/8.0),
- REAL_CONST(18589.059515231773/8.0),
- REAL_CONST(18604.629871458303/8.0),
- REAL_CONST(18620.203486104212/8.0),
- REAL_CONST(18635.78035780658/8.0),
- REAL_CONST(18651.360485203899/8.0),
- REAL_CONST(18666.943866936086/8.0),
- REAL_CONST(18682.53050164448/8.0),
- REAL_CONST(18698.120387971841/8.0),
- REAL_CONST(18713.713524562332/8.0),
- REAL_CONST(18729.30991006154/8.0),
- REAL_CONST(18744.909543116457/8.0),
- REAL_CONST(18760.512422375479/8.0),
- REAL_CONST(18776.118546488418/8.0),
- REAL_CONST(18791.727914106479/8.0),
- REAL_CONST(18807.340523882274/8.0),
- REAL_CONST(18822.95637446981/8.0),
- REAL_CONST(18838.575464524489/8.0),
- REAL_CONST(18854.197792703111/8.0),
- REAL_CONST(18869.823357663863/8.0),
- REAL_CONST(18885.452158066328/8.0),
- REAL_CONST(18901.08419257147/8.0),
- REAL_CONST(18916.719459841639/8.0),
- REAL_CONST(18932.357958540564/8.0),
- REAL_CONST(18947.999687333362/8.0),
- REAL_CONST(18963.644644886521/8.0),
- REAL_CONST(18979.292829867907/8.0),
- REAL_CONST(18994.944240946759/8.0),
- REAL_CONST(19010.598876793687/8.0),
- REAL_CONST(19026.256736080668/8.0),
- REAL_CONST(19041.917817481048/8.0),
- REAL_CONST(19057.582119669532/8.0),
- REAL_CONST(19073.2496413222/8.0),
- REAL_CONST(19088.920381116473/8.0),
- REAL_CONST(19104.594337731145/8.0),
- REAL_CONST(19120.271509846356/8.0),
- REAL_CONST(19135.951896143604/8.0),
- REAL_CONST(19151.635495305738/8.0),
- REAL_CONST(19167.322306016948/8.0),
- REAL_CONST(19183.012326962784/8.0),
- REAL_CONST(19198.705556830122/8.0),
- REAL_CONST(19214.401994307198/8.0),
- REAL_CONST(19230.101638083579/8.0),
- REAL_CONST(19245.804486850167/8.0),
- REAL_CONST(19261.510539299208/8.0),
- REAL_CONST(19277.219794124274/8.0),
- REAL_CONST(19292.932250020265/8.0),
- REAL_CONST(19308.647905683421/8.0),
- REAL_CONST(19324.366759811302/8.0),
- REAL_CONST(19340.088811102793/8.0),
- REAL_CONST(19355.8140582581/8.0),
- REAL_CONST(19371.542499978754/8.0),
- REAL_CONST(19387.2741349676/8.0),
- REAL_CONST(19403.008961928797/8.0),
- REAL_CONST(19418.746979567823/8.0),
- REAL_CONST(19434.488186591469/8.0),
- REAL_CONST(19450.232581707827/8.0),
- REAL_CONST(19465.980163626304/8.0),
- REAL_CONST(19481.730931057613/8.0),
- REAL_CONST(19497.484882713761/8.0),
- REAL_CONST(19513.242017308068/8.0),
- REAL_CONST(19529.002333555141/8.0),
- REAL_CONST(19544.765830170898/8.0),
- REAL_CONST(19560.532505872539/8.0),
- REAL_CONST(19576.302359378566/8.0),
- REAL_CONST(19592.075389408761/8.0),
- REAL_CONST(19607.851594684209/8.0),
- REAL_CONST(19623.630973927269/8.0),
- REAL_CONST(19639.41352586159/8.0),
- REAL_CONST(19655.199249212103/8.0),
- REAL_CONST(19670.988142705017/8.0),
- REAL_CONST(19686.780205067826/8.0),
- REAL_CONST(19702.575435029288/8.0),
- REAL_CONST(19718.373831319448/8.0),
- REAL_CONST(19734.175392669615/8.0),
- REAL_CONST(19749.980117812371/8.0),
- REAL_CONST(19765.788005481569/8.0),
- REAL_CONST(19781.599054412323/8.0),
- REAL_CONST(19797.413263341008/8.0),
- REAL_CONST(19813.230631005274/8.0),
- REAL_CONST(19829.051156144014/8.0),
- REAL_CONST(19844.874837497395/8.0),
- REAL_CONST(19860.701673806827/8.0),
- REAL_CONST(19876.531663814985/8.0),
- REAL_CONST(19892.364806265789/8.0),
- REAL_CONST(19908.201099904403/8.0),
- REAL_CONST(19924.040543477258/8.0),
- REAL_CONST(19939.883135732012/8.0),
- REAL_CONST(19955.728875417579/8.0),
- REAL_CONST(19971.577761284105/8.0),
- REAL_CONST(19987.429792082985/8.0),
- REAL_CONST(20003.284966566847/8.0),
- REAL_CONST(20019.14328348956/8.0),
- REAL_CONST(20035.004741606219/8.0),
- REAL_CONST(20050.869339673161/8.0),
- REAL_CONST(20066.737076447946/8.0),
- REAL_CONST(20082.607950689362/8.0),
- REAL_CONST(20098.481961157428/8.0),
- REAL_CONST(20114.359106613385/8.0),
- REAL_CONST(20130.239385819699/8.0),
- REAL_CONST(20146.122797540058/8.0),
- REAL_CONST(20162.009340539353/8.0),
- REAL_CONST(20177.899013583716/8.0),
- REAL_CONST(20193.791815440476/8.0),
- REAL_CONST(20209.687744878182/8.0),
- REAL_CONST(20225.586800666591/8.0),
- REAL_CONST(20241.488981576669/8.0),
- REAL_CONST(20257.394286380597/8.0),
- REAL_CONST(20273.302713851754/8.0),
- REAL_CONST(20289.214262764715/8.0),
- REAL_CONST(20305.128931895277/8.0),
- REAL_CONST(20321.046720020415/8.0),
- REAL_CONST(20336.967625918318/8.0),
- REAL_CONST(20352.891648368361/8.0),
- REAL_CONST(20368.818786151114/8.0),
- REAL_CONST(20384.749038048347/8.0),
- REAL_CONST(20400.682402843009/8.0),
- REAL_CONST(20416.618879319249/8.0),
- REAL_CONST(20432.558466262391/8.0),
- REAL_CONST(20448.501162458953/8.0),
- REAL_CONST(20464.446966696629/8.0),
- REAL_CONST(20480.395877764302/8.0),
- REAL_CONST(20496.347894452025/8.0),
- REAL_CONST(20512.303015551031/8.0),
- REAL_CONST(20528.261239853735/8.0),
- REAL_CONST(20544.22256615372/8.0),
- REAL_CONST(20560.186993245738/8.0),
- REAL_CONST(20576.15451992572/8.0),
- REAL_CONST(20592.125144990758/8.0),
- REAL_CONST(20608.098867239107/8.0),
- REAL_CONST(20624.075685470198/8.0),
- REAL_CONST(20640.055598484618/8.0),
- REAL_CONST(20656.038605084115/8.0),
- REAL_CONST(20672.024704071595/8.0),
- REAL_CONST(20688.013894251126/8.0),
- REAL_CONST(20704.006174427926/8.0),
- REAL_CONST(20720.001543408373/8.0),
- REAL_CONST(20735.999999999989/8.0),
- REAL_CONST(20752.001543011454/8.0),
- REAL_CONST(20768.006171252597/8.0),
- REAL_CONST(20784.013883534382/8.0),
- REAL_CONST(20800.024678668931/8.0),
- REAL_CONST(20816.038555469506/8.0),
- REAL_CONST(20832.055512750507/8.0),
- REAL_CONST(20848.075549327474/8.0),
- REAL_CONST(20864.098664017085/8.0),
- REAL_CONST(20880.124855637161/8.0),
- REAL_CONST(20896.154123006647/8.0),
- REAL_CONST(20912.186464945626/8.0),
- REAL_CONST(20928.221880275312/8.0),
- REAL_CONST(20944.260367818049/8.0),
- REAL_CONST(20960.301926397311/8.0),
- REAL_CONST(20976.346554837684/8.0),
- REAL_CONST(20992.394251964895/8.0),
- REAL_CONST(21008.445016605787/8.0),
- REAL_CONST(21024.498847588318/8.0),
- REAL_CONST(21040.555743741574/8.0),
- REAL_CONST(21056.615703895754/8.0),
- REAL_CONST(21072.678726882168/8.0),
- REAL_CONST(21088.744811533252/8.0),
- REAL_CONST(21104.813956682538/8.0),
- REAL_CONST(21120.886161164683/8.0),
- REAL_CONST(21136.961423815443/8.0),
- REAL_CONST(21153.039743471683/8.0),
- REAL_CONST(21169.121118971379/8.0),
- REAL_CONST(21185.205549153605/8.0),
- REAL_CONST(21201.293032858535/8.0),
- REAL_CONST(21217.383568927453/8.0),
- REAL_CONST(21233.477156202731/8.0),
- REAL_CONST(21249.573793527841/8.0),
- REAL_CONST(21265.673479747358/8.0),
- REAL_CONST(21281.776213706937/8.0),
- REAL_CONST(21297.881994253334/8.0),
- REAL_CONST(21313.990820234398/8.0),
- REAL_CONST(21330.102690499054/8.0),
- REAL_CONST(21346.21760389733/8.0),
- REAL_CONST(21362.335559280327/8.0),
- REAL_CONST(21378.456555500241/8.0),
- REAL_CONST(21394.580591410333/8.0),
- REAL_CONST(21410.707665864964/8.0),
- REAL_CONST(21426.83777771956/8.0),
- REAL_CONST(21442.970925830628/8.0),
- REAL_CONST(21459.107109055756/8.0),
- REAL_CONST(21475.246326253604/8.0),
- REAL_CONST(21491.388576283895/8.0),
- REAL_CONST(21507.533858007431/8.0),
- REAL_CONST(21523.682170286087/8.0),
- REAL_CONST(21539.833511982797/8.0),
- REAL_CONST(21555.987881961566/8.0),
- REAL_CONST(21572.145279087465/8.0),
- REAL_CONST(21588.305702226615/8.0),
- REAL_CONST(21604.469150246216/8.0),
- REAL_CONST(21620.635622014521/8.0),
- REAL_CONST(21636.805116400832/8.0),
- REAL_CONST(21652.977632275521/8.0),
- REAL_CONST(21669.153168510009/8.0),
- REAL_CONST(21685.331723976764/8.0),
- REAL_CONST(21701.513297549318/8.0),
- REAL_CONST(21717.697888102244/8.0),
- REAL_CONST(21733.885494511167/8.0),
- REAL_CONST(21750.076115652759/8.0),
- REAL_CONST(21766.269750404736/8.0),
- REAL_CONST(21782.466397645861/8.0),
- REAL_CONST(21798.666056255934/8.0),
- REAL_CONST(21814.868725115801/8.0),
- REAL_CONST(21831.074403107345/8.0),
- REAL_CONST(21847.283089113484/8.0),
- REAL_CONST(21863.494782018177/8.0),
- REAL_CONST(21879.709480706417/8.0),
- REAL_CONST(21895.927184064229/8.0),
- REAL_CONST(21912.147890978667/8.0),
- REAL_CONST(21928.371600337818/8.0),
- REAL_CONST(21944.598311030797/8.0),
- REAL_CONST(21960.828021947746/8.0),
- REAL_CONST(21977.060731979829/8.0),
- REAL_CONST(21993.296440019243/8.0),
- REAL_CONST(22009.535144959198/8.0),
- REAL_CONST(22025.77684569393/8.0),
- REAL_CONST(22042.021541118691/8.0),
- REAL_CONST(22058.269230129757/8.0),
- REAL_CONST(22074.519911624411/8.0),
- REAL_CONST(22090.773584500959/8.0),
- REAL_CONST(22107.030247658717/8.0),
- REAL_CONST(22123.289899998013/8.0),
- REAL_CONST(22139.552540420187/8.0),
- REAL_CONST(22155.818167827587/8.0),
- REAL_CONST(22172.086781123569/8.0),
- REAL_CONST(22188.358379212495/8.0),
- REAL_CONST(22204.632960999726/8.0),
- REAL_CONST(22220.910525391639/8.0),
- REAL_CONST(22237.191071295601/8.0),
- REAL_CONST(22253.474597619981/8.0),
- REAL_CONST(22269.761103274148/8.0),
- REAL_CONST(22286.050587168469/8.0),
- REAL_CONST(22302.343048214312/8.0),
- REAL_CONST(22318.638485324027/8.0),
- REAL_CONST(22334.936897410968/8.0),
- REAL_CONST(22351.23828338947/8.0),
- REAL_CONST(22367.542642174871/8.0),
- REAL_CONST(22383.849972683485/8.0),
- REAL_CONST(22400.160273832618/8.0),
- REAL_CONST(22416.473544540564/8.0),
- REAL_CONST(22432.789783726603/8.0),
- REAL_CONST(22449.108990310986/8.0),
- REAL_CONST(22465.431163214958/8.0),
- REAL_CONST(22481.75630136074/8.0),
- REAL_CONST(22498.084403671528/8.0),
- REAL_CONST(22514.415469071497/8.0),
- REAL_CONST(22530.749496485802/8.0),
- REAL_CONST(22547.086484840562/8.0),
- REAL_CONST(22563.426433062879/8.0),
- REAL_CONST(22579.769340080824/8.0),
- REAL_CONST(22596.115204823436/8.0),
- REAL_CONST(22612.464026220721/8.0),
- REAL_CONST(22628.815803203655/8.0),
- REAL_CONST(22645.170534704179/8.0),
- REAL_CONST(22661.5282196552/8.0),
- REAL_CONST(22677.888856990587/8.0),
- REAL_CONST(22694.252445645168/8.0),
- REAL_CONST(22710.618984554734/8.0),
- REAL_CONST(22726.988472656034/8.0),
- REAL_CONST(22743.360908886778/8.0),
- REAL_CONST(22759.736292185622/8.0),
- REAL_CONST(22776.114621492186/8.0),
- REAL_CONST(22792.495895747044/8.0),
- REAL_CONST(22808.880113891719/8.0),
- REAL_CONST(22825.267274868678/8.0),
- REAL_CONST(22841.657377621348/8.0),
- REAL_CONST(22858.050421094096/8.0),
- REAL_CONST(22874.446404232243/8.0),
- REAL_CONST(22890.845325982053/8.0),
- REAL_CONST(22907.247185290722/8.0),
- REAL_CONST(22923.651981106406/8.0),
- REAL_CONST(22940.059712378195/8.0),
- REAL_CONST(22956.470378056114/8.0),
- REAL_CONST(22972.883977091129/8.0),
- REAL_CONST(22989.300508435153/8.0),
- REAL_CONST(23005.719971041017/8.0),
- REAL_CONST(23022.142363862498/8.0),
- REAL_CONST(23038.567685854305/8.0),
- REAL_CONST(23054.995935972078/8.0),
- REAL_CONST(23071.427113172387/8.0),
- REAL_CONST(23087.86121641273/8.0),
- REAL_CONST(23104.298244651531/8.0),
- REAL_CONST(23120.738196848146/8.0),
- REAL_CONST(23137.181071962848/8.0),
- REAL_CONST(23153.626868956846/8.0),
- REAL_CONST(23170.075586792263/8.0),
- REAL_CONST(23186.527224432142/8.0),
- REAL_CONST(23202.981780840448/8.0),
- REAL_CONST(23219.439254982066/8.0),
- REAL_CONST(23235.899645822796/8.0),
- REAL_CONST(23252.362952329357/8.0),
- REAL_CONST(23268.829173469378/8.0),
- REAL_CONST(23285.298308211408/8.0),
- REAL_CONST(23301.770355524899/8.0),
- REAL_CONST(23318.245314380223/8.0),
- REAL_CONST(23334.723183748658/8.0),
- REAL_CONST(23351.203962602387/8.0),
- REAL_CONST(23367.687649914504/8.0),
- REAL_CONST(23384.174244659007/8.0),
- REAL_CONST(23400.663745810798/8.0),
- REAL_CONST(23417.15615234568/8.0),
- REAL_CONST(23433.651463240367/8.0),
- REAL_CONST(23450.149677472462/8.0),
- REAL_CONST(23466.650794020472/8.0),
- REAL_CONST(23483.154811863806/8.0),
- REAL_CONST(23499.661729982763/8.0),
- REAL_CONST(23516.171547358543/8.0),
- REAL_CONST(23532.684262973235/8.0),
- REAL_CONST(23549.199875809823/8.0),
- REAL_CONST(23565.718384852185/8.0),
- REAL_CONST(23582.239789085092/8.0),
- REAL_CONST(23598.764087494197/8.0),
- REAL_CONST(23615.291279066041/8.0),
- REAL_CONST(23631.821362788058/8.0),
- REAL_CONST(23648.354337648565/8.0),
- REAL_CONST(23664.890202636761/8.0),
- REAL_CONST(23681.428956742733/8.0),
- REAL_CONST(23697.970598957443/8.0),
- REAL_CONST(23714.515128272738/8.0),
- REAL_CONST(23731.062543681343/8.0),
- REAL_CONST(23747.612844176863/8.0),
- REAL_CONST(23764.166028753778/8.0),
- REAL_CONST(23780.72209640744/8.0),
- REAL_CONST(23797.281046134085/8.0),
- REAL_CONST(23813.842876930816/8.0),
- REAL_CONST(23830.407587795606/8.0),
- REAL_CONST(23846.975177727301/8.0),
- REAL_CONST(23863.545645725622/8.0),
- REAL_CONST(23880.11899079115/8.0),
- REAL_CONST(23896.695211925336/8.0),
- REAL_CONST(23913.274308130498/8.0),
- REAL_CONST(23929.856278409821/8.0),
- REAL_CONST(23946.441121767348/8.0),
- REAL_CONST(23963.028837207989/8.0),
- REAL_CONST(23979.619423737513/8.0),
- REAL_CONST(23996.212880362549/8.0),
- REAL_CONST(24012.809206090584/8.0),
- REAL_CONST(24029.408399929966/8.0),
- REAL_CONST(24046.010460889898/8.0),
- REAL_CONST(24062.615387980433/8.0),
- REAL_CONST(24079.223180212492/8.0),
- REAL_CONST(24095.833836597827/8.0),
- REAL_CONST(24112.447356149063/8.0),
- REAL_CONST(24129.063737879667/8.0),
- REAL_CONST(24145.682980803951/8.0),
- REAL_CONST(24162.305083937081/8.0),
- REAL_CONST(24178.930046295067/8.0),
- REAL_CONST(24195.557866894767/8.0),
- REAL_CONST(24212.188544753884/8.0),
- REAL_CONST(24228.822078890964/8.0),
- REAL_CONST(24245.458468325389/8.0),
- REAL_CONST(24262.097712077397/8.0),
- REAL_CONST(24278.739809168052/8.0),
- REAL_CONST(24295.384758619261/8.0),
- REAL_CONST(24312.032559453768/8.0),
- REAL_CONST(24328.683210695162/8.0),
- REAL_CONST(24345.336711367858/8.0),
- REAL_CONST(24361.993060497109/8.0),
- REAL_CONST(24378.652257108995/8.0),
- REAL_CONST(24395.314300230442/8.0),
- REAL_CONST(24411.979188889192/8.0),
- REAL_CONST(24428.646922113825/8.0),
- REAL_CONST(24445.317498933746/8.0),
- REAL_CONST(24461.990918379193/8.0),
- REAL_CONST(24478.667179481225/8.0),
- REAL_CONST(24495.346281271726/8.0),
- REAL_CONST(24512.028222783407/8.0),
- REAL_CONST(24528.713003049801/8.0),
- REAL_CONST(24545.400621105266/8.0),
- REAL_CONST(24562.091075984976/8.0),
- REAL_CONST(24578.784366724925/8.0),
- REAL_CONST(24595.480492361927/8.0),
- REAL_CONST(24612.179451933614/8.0),
- REAL_CONST(24628.881244478438/8.0),
- REAL_CONST(24645.585869035654/8.0),
- REAL_CONST(24662.293324645343/8.0),
- REAL_CONST(24679.003610348394/8.0),
- REAL_CONST(24695.716725186514/8.0),
- REAL_CONST(24712.432668202211/8.0),
- REAL_CONST(24729.151438438807/8.0),
- REAL_CONST(24745.873034940436/8.0),
- REAL_CONST(24762.597456752032/8.0),
- REAL_CONST(24779.324702919344/8.0),
- REAL_CONST(24796.054772488926/8.0),
- REAL_CONST(24812.787664508123/8.0),
- REAL_CONST(24829.5233780251/8.0),
- REAL_CONST(24846.261912088819/8.0),
- REAL_CONST(24863.003265749034/8.0),
- REAL_CONST(24879.747438056307/8.0),
- REAL_CONST(24896.494428062004/8.0),
- REAL_CONST(24913.244234818278/8.0),
- REAL_CONST(24929.996857378079/8.0),
- REAL_CONST(24946.752294795166/8.0),
- REAL_CONST(24963.510546124078/8.0),
- REAL_CONST(24980.271610420157/8.0),
- REAL_CONST(24997.035486739525/8.0),
- REAL_CONST(25013.802174139113/8.0),
- REAL_CONST(25030.571671676629/8.0),
- REAL_CONST(25047.343978410572/8.0),
- REAL_CONST(25064.119093400237/8.0),
- REAL_CONST(25080.897015705697/8.0),
- REAL_CONST(25097.677744387816/8.0),
- REAL_CONST(25114.461278508239/8.0),
- REAL_CONST(25131.2476171294/8.0),
- REAL_CONST(25148.036759314517/8.0),
- REAL_CONST(25164.828704127583/8.0),
- REAL_CONST(25181.623450633375/8.0),
- REAL_CONST(25198.42099789745/8.0),
- REAL_CONST(25215.221344986145/8.0),
- REAL_CONST(25232.024490966574/8.0),
- REAL_CONST(25248.830434906627/8.0),
- REAL_CONST(25265.639175874974/8.0),
- REAL_CONST(25282.450712941049/8.0),
- REAL_CONST(25299.265045175071/8.0),
- REAL_CONST(25316.082171648024/8.0),
- REAL_CONST(25332.902091431668/8.0),
- REAL_CONST(25349.724803598532/8.0),
- REAL_CONST(25366.550307221914/8.0),
- REAL_CONST(25383.378601375884/8.0),
- REAL_CONST(25400.209685135269/8.0),
- REAL_CONST(25417.043557575678/8.0),
- REAL_CONST(25433.880217773472/8.0),
- REAL_CONST(25450.719664805783/8.0),
- REAL_CONST(25467.561897750507/8.0),
- REAL_CONST(25484.406915686297/8.0),
- REAL_CONST(25501.254717692573/8.0),
- REAL_CONST(25518.105302849512/8.0),
- REAL_CONST(25534.958670238051/8.0),
- REAL_CONST(25551.814818939893/8.0),
- REAL_CONST(25568.67374803748/8.0),
- REAL_CONST(25585.535456614027/8.0),
- REAL_CONST(25602.399943753502/8.0),
- REAL_CONST(25619.267208540619/8.0),
- REAL_CONST(25636.137250060852/8.0),
- REAL_CONST(25653.010067400432/8.0),
- REAL_CONST(25669.885659646327/8.0),
- REAL_CONST(25686.76402588627/8.0),
- REAL_CONST(25703.645165208734/8.0),
- REAL_CONST(25720.529076702944/8.0),
- REAL_CONST(25737.415759458876/8.0),
- REAL_CONST(25754.305212567244/8.0),
- REAL_CONST(25771.197435119517/8.0),
- REAL_CONST(25788.092426207899/8.0),
- REAL_CONST(25804.990184925344/8.0),
- REAL_CONST(25821.890710365547/8.0),
- REAL_CONST(25838.794001622944/8.0),
- REAL_CONST(25855.700057792714/8.0),
- REAL_CONST(25872.608877970775/8.0),
- REAL_CONST(25889.520461253778/8.0),
- REAL_CONST(25906.434806739118/8.0),
- REAL_CONST(25923.351913524923/8.0),
- REAL_CONST(25940.271780710063/8.0),
- REAL_CONST(25957.194407394138/8.0),
- REAL_CONST(25974.11979267748/8.0),
- REAL_CONST(25991.047935661154/8.0),
- REAL_CONST(26007.978835446964/8.0),
- REAL_CONST(26024.912491137442/8.0),
- REAL_CONST(26041.848901835841/8.0),
- REAL_CONST(26058.788066646157/8.0),
- REAL_CONST(26075.729984673108/8.0),
- REAL_CONST(26092.674655022136/8.0),
- REAL_CONST(26109.622076799409/8.0),
- REAL_CONST(26126.572249111829/8.0),
- REAL_CONST(26143.525171067016/8.0),
- REAL_CONST(26160.480841773315/8.0),
- REAL_CONST(26177.43926033979/8.0),
- REAL_CONST(26194.400425876229/8.0),
- REAL_CONST(26211.364337493149/8.0),
- REAL_CONST(26228.330994301767/8.0),
- REAL_CONST(26245.30039541404/8.0),
- REAL_CONST(26262.272539942627/8.0),
- REAL_CONST(26279.247427000919/8.0),
- REAL_CONST(26296.225055703002/8.0),
- REAL_CONST(26313.205425163702/8.0),
- REAL_CONST(26330.188534498539/8.0),
- REAL_CONST(26347.174382823756/8.0),
- REAL_CONST(26364.162969256304/8.0),
- REAL_CONST(26381.154292913852/8.0),
- REAL_CONST(26398.148352914774/8.0),
- REAL_CONST(26415.145148378149/8.0),
- REAL_CONST(26432.144678423778/8.0),
- REAL_CONST(26449.146942172156/8.0),
- REAL_CONST(26466.151938744493/8.0),
- REAL_CONST(26483.159667262702/8.0),
- REAL_CONST(26500.170126849403/8.0),
- REAL_CONST(26517.183316627921/8.0),
- REAL_CONST(26534.199235722277/8.0),
- REAL_CONST(26551.217883257199/8.0),
- REAL_CONST(26568.239258358124/8.0),
- REAL_CONST(26585.263360151173/8.0),
- REAL_CONST(26602.290187763181/8.0),
- REAL_CONST(26619.319740321676/8.0),
- REAL_CONST(26636.352016954883/8.0),
- REAL_CONST(26653.387016791727/8.0),
- REAL_CONST(26670.424738961825/8.0),
- REAL_CONST(26687.465182595493/8.0),
- REAL_CONST(26704.508346823739/8.0),
- REAL_CONST(26721.554230778267/8.0),
- REAL_CONST(26738.602833591467/8.0),
- REAL_CONST(26755.65415439643/8.0),
- REAL_CONST(26772.708192326929/8.0),
- REAL_CONST(26789.764946517433/8.0),
- REAL_CONST(26806.824416103096/8.0),
- REAL_CONST(26823.886600219761/8.0),
- REAL_CONST(26840.95149800396/8.0),
- REAL_CONST(26858.019108592915/8.0),
- REAL_CONST(26875.089431124517/8.0),
- REAL_CONST(26892.162464737365/8.0),
- REAL_CONST(26909.238208570721/8.0),
- REAL_CONST(26926.316661764544/8.0),
- REAL_CONST(26943.397823459472/8.0),
- REAL_CONST(26960.481692796813/8.0),
- REAL_CONST(26977.568268918571/8.0),
- REAL_CONST(26994.657550967422/8.0),
- REAL_CONST(27011.749538086722/8.0),
- REAL_CONST(27028.844229420498/8.0),
- REAL_CONST(27045.941624113464/8.0),
- REAL_CONST(27063.041721311005/8.0),
- REAL_CONST(27080.144520159181/8.0),
- REAL_CONST(27097.250019804727/8.0),
- REAL_CONST(27114.35821939505/8.0),
- REAL_CONST(27131.469118078236/8.0),
- REAL_CONST(27148.582715003027/8.0),
- REAL_CONST(27165.699009318858/8.0),
- REAL_CONST(27182.818000175819/8.0),
- REAL_CONST(27199.939686724665/8.0),
- REAL_CONST(27217.064068116837/8.0),
- REAL_CONST(27234.191143504428/8.0),
- REAL_CONST(27251.320912040203/8.0),
- REAL_CONST(27268.453372877593/8.0),
- REAL_CONST(27285.588525170693/8.0),
- REAL_CONST(27302.726368074269/8.0),
- REAL_CONST(27319.866900743735/8.0),
- REAL_CONST(27337.010122335181/8.0),
- REAL_CONST(27354.156032005358/8.0),
- REAL_CONST(27371.304628911668/8.0),
- REAL_CONST(27388.455912212183/8.0),
- REAL_CONST(27405.609881065626/8.0),
- REAL_CONST(27422.766534631384/8.0),
- REAL_CONST(27439.925872069507/8.0),
- REAL_CONST(27457.087892540683/8.0),
- REAL_CONST(27474.252595206275/8.0),
- REAL_CONST(27491.419979228293/8.0),
- REAL_CONST(27508.5900437694/8.0),
- REAL_CONST(27525.762787992917/8.0),
- REAL_CONST(27542.93821106281/8.0),
- REAL_CONST(27560.116312143706/8.0),
- REAL_CONST(27577.297090400876/8.0),
- REAL_CONST(27594.480545000242/8.0),
- REAL_CONST(27611.666675108383/8.0),
- REAL_CONST(27628.855479892518/8.0),
- REAL_CONST(27646.046958520514/8.0),
- REAL_CONST(27663.241110160889/8.0),
- REAL_CONST(27680.437933982801/8.0),
- REAL_CONST(27697.637429156068/8.0),
- REAL_CONST(27714.839594851132/8.0),
- REAL_CONST(27732.04443023909/8.0),
- REAL_CONST(27749.251934491687/8.0),
- REAL_CONST(27766.462106781299/8.0),
- REAL_CONST(27783.674946280949/8.0),
- REAL_CONST(27800.890452164302/8.0),
- REAL_CONST(27818.108623605654/8.0),
- REAL_CONST(27835.329459779954/8.0),
- REAL_CONST(27852.55295986278/8.0),
- REAL_CONST(27869.779123030345/8.0),
- REAL_CONST(27887.007948459504/8.0),
- REAL_CONST(27904.239435327745/8.0),
- REAL_CONST(27921.473582813196/8.0),
- REAL_CONST(27938.710390094613/8.0),
- REAL_CONST(27955.949856351392/8.0),
- REAL_CONST(27973.19198076355/8.0),
- REAL_CONST(27990.436762511745/8.0),
- REAL_CONST(28007.684200777272/8.0),
- REAL_CONST(28024.934294742041/8.0),
- REAL_CONST(28042.187043588601/8.0),
- REAL_CONST(28059.442446500128/8.0),
- REAL_CONST(28076.700502660427/8.0),
- REAL_CONST(28093.961211253929/8.0),
- REAL_CONST(28111.224571465693/8.0),
- REAL_CONST(28128.490582481401/8.0),
- REAL_CONST(28145.759243487362/8.0),
- REAL_CONST(28163.030553670509/8.0),
- REAL_CONST(28180.304512218394/8.0),
- REAL_CONST(28197.581118319198/8.0),
- REAL_CONST(28214.860371161725/8.0),
- REAL_CONST(28232.14226993539/8.0),
- REAL_CONST(28249.42681383024/8.0),
- REAL_CONST(28266.71400203693/8.0),
- REAL_CONST(28284.003833746745/8.0),
- REAL_CONST(28301.296308151585/8.0),
- REAL_CONST(28318.591424443959/8.0),
- REAL_CONST(28335.889181817001/8.0),
- REAL_CONST(28353.189579464462/8.0),
- REAL_CONST(28370.492616580705/8.0),
- REAL_CONST(28387.798292360701/8.0),
- REAL_CONST(28405.106606000048/8.0),
- REAL_CONST(28422.417556694945/8.0),
- REAL_CONST(28439.731143642206/8.0),
- REAL_CONST(28457.047366039264/8.0),
- REAL_CONST(28474.366223084147/8.0),
- REAL_CONST(28491.687713975512/8.0),
- REAL_CONST(28509.011837912611/8.0),
- REAL_CONST(28526.338594095305/8.0),
- REAL_CONST(28543.667981724069/8.0),
- REAL_CONST(28560.999999999982/8.0),
- REAL_CONST(28578.334648124732/8.0),
- REAL_CONST(28595.671925300605/8.0),
- REAL_CONST(28613.011830730498/8.0),
- REAL_CONST(28630.354363617909/8.0),
- REAL_CONST(28647.699523166943/8.0),
- REAL_CONST(28665.0473085823/8.0),
- REAL_CONST(28682.397719069289/8.0),
- REAL_CONST(28699.750753833818/8.0),
- REAL_CONST(28717.10641208239/8.0),
- REAL_CONST(28734.464693022121/8.0),
- REAL_CONST(28751.825595860708/8.0),
- REAL_CONST(28769.189119806462/8.0),
- REAL_CONST(28786.55526406828/8.0),
- REAL_CONST(28803.924027855664/8.0),
- REAL_CONST(28821.295410378701/8.0),
- REAL_CONST(28838.669410848088/8.0),
- REAL_CONST(28856.046028475103/8.0),
- REAL_CONST(28873.425262471628/8.0),
- REAL_CONST(28890.80711205013/8.0),
- REAL_CONST(28908.191576423673/8.0),
- REAL_CONST(28925.578654805915/8.0),
- REAL_CONST(28942.968346411097/8.0),
- REAL_CONST(28960.360650454055/8.0),
- REAL_CONST(28977.755566150216/8.0),
- REAL_CONST(28995.153092715591/8.0),
- REAL_CONST(29012.553229366786/8.0),
- REAL_CONST(29029.955975320987/8.0),
- REAL_CONST(29047.361329795975/8.0),
- REAL_CONST(29064.769292010107/8.0),
- REAL_CONST(29082.179861182336/8.0),
- REAL_CONST(29099.593036532187/8.0),
- REAL_CONST(29117.00881727978/8.0),
- REAL_CONST(29134.427202645813/8.0),
- REAL_CONST(29151.848191851568/8.0),
- REAL_CONST(29169.271784118911/8.0),
- REAL_CONST(29186.697978670283/8.0),
- REAL_CONST(29204.126774728706/8.0),
- REAL_CONST(29221.55817151779/8.0),
- REAL_CONST(29238.992168261717/8.0),
- REAL_CONST(29256.42876418525/8.0),
- REAL_CONST(29273.867958513725/8.0),
- REAL_CONST(29291.309750473058/8.0),
- REAL_CONST(29308.754139289747/8.0),
- REAL_CONST(29326.201124190855/8.0),
- REAL_CONST(29343.65070440403/8.0),
- REAL_CONST(29361.102879157483/8.0),
- REAL_CONST(29378.557647680012/8.0),
- REAL_CONST(29396.015009200975/8.0),
- REAL_CONST(29413.474962950309/8.0),
- REAL_CONST(29430.937508158524/8.0),
- REAL_CONST(29448.402644056692/8.0),
- REAL_CONST(29465.870369876469/8.0),
- REAL_CONST(29483.340684850071/8.0),
- REAL_CONST(29500.81358821028/8.0),
- REAL_CONST(29518.289079190454/8.0),
- REAL_CONST(29535.767157024511/8.0),
- REAL_CONST(29553.247820946945/8.0),
- REAL_CONST(29570.731070192807/8.0),
- REAL_CONST(29588.216903997723/8.0),
- REAL_CONST(29605.70532159787/8.0),
- REAL_CONST(29623.19632223/8.0),
- REAL_CONST(29640.689905131429/8.0),
- REAL_CONST(29658.186069540028/8.0),
- REAL_CONST(29675.684814694236/8.0),
- REAL_CONST(29693.186139833047/8.0),
- REAL_CONST(29710.690044196028/8.0),
- REAL_CONST(29728.196527023298/8.0),
- REAL_CONST(29745.705587555527/8.0),
- REAL_CONST(29763.217225033964/8.0),
- REAL_CONST(29780.731438700397/8.0),
- REAL_CONST(29798.248227797183/8.0),
- REAL_CONST(29815.76759156723/8.0),
- REAL_CONST(29833.289529254005/8.0),
- REAL_CONST(29850.81404010153/8.0),
- REAL_CONST(29868.341123354381/8.0),
- REAL_CONST(29885.870778257693/8.0),
- REAL_CONST(29903.403004057145/8.0),
- REAL_CONST(29920.937799998974/8.0),
- REAL_CONST(29938.475165329975/8.0),
- REAL_CONST(29956.015099297485/8.0),
- REAL_CONST(29973.557601149394/8.0),
- REAL_CONST(29991.102670134147/8.0),
- REAL_CONST(30008.650305500738/8.0),
- REAL_CONST(30026.200506498706/8.0),
- REAL_CONST(30043.753272378144/8.0),
- REAL_CONST(30061.308602389683/8.0),
- REAL_CONST(30078.866495784507/8.0),
- REAL_CONST(30096.426951814352/8.0),
- REAL_CONST(30113.989969731494/8.0),
- REAL_CONST(30131.55554878875/8.0),
- REAL_CONST(30149.123688239491/8.0),
- REAL_CONST(30166.694387337629/8.0),
- REAL_CONST(30184.267645337608/8.0),
- REAL_CONST(30201.843461494434/8.0),
- REAL_CONST(30219.42183506364/8.0),
- REAL_CONST(30237.002765301309/8.0),
- REAL_CONST(30254.586251464058/8.0),
- REAL_CONST(30272.172292809046/8.0),
- REAL_CONST(30289.760888593977/8.0),
- REAL_CONST(30307.35203807709/8.0),
- REAL_CONST(30324.94574051716/8.0),
- REAL_CONST(30342.541995173502/8.0),
- REAL_CONST(30360.140801305966/8.0),
- REAL_CONST(30377.742158174944/8.0),
- REAL_CONST(30395.346065041358/8.0),
- REAL_CONST(30412.952521166666/8.0),
- REAL_CONST(30430.561525812864/8.0),
- REAL_CONST(30448.173078242475/8.0),
- REAL_CONST(30465.787177718561/8.0),
- REAL_CONST(30483.403823504719/8.0),
- REAL_CONST(30501.02301486507/8.0),
- REAL_CONST(30518.644751064272/8.0),
- REAL_CONST(30536.269031367516/8.0),
- REAL_CONST(30553.895855040515/8.0),
- REAL_CONST(30571.525221349519/8.0),
- REAL_CONST(30589.157129561307/8.0),
- REAL_CONST(30606.791578943175/8.0),
- REAL_CONST(30624.428568762964/8.0),
- REAL_CONST(30642.06809828903/8.0),
- REAL_CONST(30659.710166790261/8.0),
- REAL_CONST(30677.35477353607/8.0),
- REAL_CONST(30695.001917796391/8.0),
- REAL_CONST(30712.651598841687/8.0),
- REAL_CONST(30730.303815942945/8.0),
- REAL_CONST(30747.958568371676/8.0),
- REAL_CONST(30765.615855399912/8.0),
- REAL_CONST(30783.275676300211/8.0),
- REAL_CONST(30800.938030345646/8.0),
- REAL_CONST(30818.602916809814/8.0),
- REAL_CONST(30836.270334966837/8.0),
- REAL_CONST(30853.940284091354/8.0),
- REAL_CONST(30871.612763458521/8.0),
- REAL_CONST(30889.287772344011/8.0),
- REAL_CONST(30906.965310024025/8.0),
- REAL_CONST(30924.645375775272/8.0),
- REAL_CONST(30942.327968874983/8.0),
- REAL_CONST(30960.013088600903/8.0),
- REAL_CONST(30977.700734231294/8.0),
- REAL_CONST(30995.390905044929/8.0),
- REAL_CONST(31013.083600321101/8.0),
- REAL_CONST(31030.778819339619/8.0),
- REAL_CONST(31048.476561380798/8.0),
- REAL_CONST(31066.17682572547/8.0),
- REAL_CONST(31083.879611654978/8.0),
- REAL_CONST(31101.584918451179/8.0),
- REAL_CONST(31119.29274539644/8.0),
- REAL_CONST(31137.003091773637/8.0),
- REAL_CONST(31154.715956866155/8.0),
- REAL_CONST(31172.431339957893/8.0),
- REAL_CONST(31190.14924033326/8.0),
- REAL_CONST(31207.869657277162/8.0),
- REAL_CONST(31225.592590075023/8.0),
- REAL_CONST(31243.318038012771/8.0),
- REAL_CONST(31261.046000376838/8.0),
- REAL_CONST(31278.776476454172/8.0),
- REAL_CONST(31296.50946553221/8.0),
- REAL_CONST(31314.24496689891/8.0),
- REAL_CONST(31331.98297984272/8.0),
- REAL_CONST(31349.7235036526/8.0),
- REAL_CONST(31367.466537618013/8.0),
- REAL_CONST(31385.212081028923/8.0),
- REAL_CONST(31402.960133175795/8.0),
- REAL_CONST(31420.710693349596/8.0),
- REAL_CONST(31438.463760841791/8.0),
- REAL_CONST(31456.219334944351/8.0),
- REAL_CONST(31473.977414949743/8.0),
- REAL_CONST(31491.738000150934/8.0),
- REAL_CONST(31509.501089841389/8.0),
- REAL_CONST(31527.266683315069/8.0),
- REAL_CONST(31545.034779866437/8.0),
- REAL_CONST(31562.80537879045/8.0),
- REAL_CONST(31580.578479382562/8.0),
- REAL_CONST(31598.35408093872/8.0),
- REAL_CONST(31616.132182755369/8.0),
- REAL_CONST(31633.91278412945/8.0),
- REAL_CONST(31651.695884358396/8.0),
- REAL_CONST(31669.481482740131/8.0),
- REAL_CONST(31687.269578573076/8.0),
- REAL_CONST(31705.060171156143/8.0),
- REAL_CONST(31722.853259788735/8.0),
- REAL_CONST(31740.648843770748/8.0),
- REAL_CONST(31758.446922402567/8.0),
- REAL_CONST(31776.247494985066/8.0),
- REAL_CONST(31794.050560819614/8.0),
- REAL_CONST(31811.85611920806/8.0),
- REAL_CONST(31829.664169452753/8.0),
- REAL_CONST(31847.474710856521/8.0),
- REAL_CONST(31865.287742722685/8.0),
- REAL_CONST(31883.103264355046/8.0),
- REAL_CONST(31900.921275057899/8.0),
- REAL_CONST(31918.741774136019/8.0),
- REAL_CONST(31936.564760894671/8.0),
- REAL_CONST(31954.390234639599/8.0),
- REAL_CONST(31972.21819467704/8.0),
- REAL_CONST(31990.048640313704/8.0),
- REAL_CONST(32007.881570856793/8.0),
- REAL_CONST(32025.716985613984/8.0),
- REAL_CONST(32043.554883893445/8.0),
- REAL_CONST(32061.395265003815/8.0),
- REAL_CONST(32079.238128254223/8.0),
- REAL_CONST(32097.083472954269/8.0),
- REAL_CONST(32114.931298414049/8.0),
- REAL_CONST(32132.781603944117/8.0),
- REAL_CONST(32150.634388855524/8.0),
- REAL_CONST(32168.48965245979/8.0),
- REAL_CONST(32186.347394068915/8.0),
- REAL_CONST(32204.207612995371/8.0),
- REAL_CONST(32222.07030855212/8.0),
- REAL_CONST(32239.935480052583/8.0),
- REAL_CONST(32257.803126810672/8.0),
- REAL_CONST(32275.673248140767/8.0),
- REAL_CONST(32293.545843357719/8.0),
- REAL_CONST(32311.420911776862/8.0),
- REAL_CONST(32329.298452713996/8.0),
- REAL_CONST(32347.178465485395/8.0),
- REAL_CONST(32365.060949407813/8.0),
- REAL_CONST(32382.945903798463/8.0),
- REAL_CONST(32400.83332797504/8.0),
- REAL_CONST(32418.723221255706/8.0),
- REAL_CONST(32436.615582959093/8.0),
- REAL_CONST(32454.510412404306/8.0),
- REAL_CONST(32472.407708910916/8.0),
- REAL_CONST(32490.307471798966/8.0),
- REAL_CONST(32508.209700388961/8.0),
- REAL_CONST(32526.114394001877/8.0),
- REAL_CONST(32544.021551959166/8.0),
- REAL_CONST(32561.931173582732/8.0),
- REAL_CONST(32579.843258194956/8.0),
- REAL_CONST(32597.757805118679/8.0),
- REAL_CONST(32615.674813677211/8.0),
- REAL_CONST(32633.594283194328/8.0),
- REAL_CONST(32651.516212994258/8.0),
- REAL_CONST(32669.440602401712/8.0),
- REAL_CONST(32687.367450741847/8.0),
- REAL_CONST(32705.296757340297/8.0),
- REAL_CONST(32723.228521523146/8.0),
- REAL_CONST(32741.162742616943/8.0),
- REAL_CONST(32759.099419948703/8.0),
- REAL_CONST(32777.038552845901/8.0),
- REAL_CONST(32794.980140636464/8.0),
- REAL_CONST(32812.924182648792/8.0),
- REAL_CONST(32830.87067821173/8.0),
- REAL_CONST(32848.819626654593/8.0),
- REAL_CONST(32866.77102730715/8.0),
- REAL_CONST(32884.724879499619/8.0),
- REAL_CONST(32902.681182562686/8.0),
- REAL_CONST(32920.639935827494/8.0),
- REAL_CONST(32938.601138625643/8.0),
- REAL_CONST(32956.56479028918/8.0),
- REAL_CONST(32974.530890150607/8.0),
- REAL_CONST(32992.499437542894/8.0),
- REAL_CONST(33010.470431799447/8.0),
- REAL_CONST(33028.443872254145/8.0),
- REAL_CONST(33046.419758241311/8.0),
- REAL_CONST(33064.39808909571/8.0),
- REAL_CONST(33082.378864152583/8.0),
- REAL_CONST(33100.36208274759/8.0),
- REAL_CONST(33118.347744216881/8.0),
- REAL_CONST(33136.335847897026/8.0),
- REAL_CONST(33154.326393125062/8.0),
- REAL_CONST(33172.31937923847/8.0),
- REAL_CONST(33190.314805575174/8.0),
- REAL_CONST(33208.312671473555/8.0),
- REAL_CONST(33226.312976272442/8.0),
- REAL_CONST(33244.315719311111/8.0),
- REAL_CONST(33262.320899929284/8.0),
- REAL_CONST(33280.328517467125/8.0),
- REAL_CONST(33298.33857126526/8.0),
- REAL_CONST(33316.351060664747/8.0),
- REAL_CONST(33334.365985007091/8.0),
- REAL_CONST(33352.383343634239/8.0),
- REAL_CONST(33370.403135888591/8.0),
- REAL_CONST(33388.42536111299/8.0),
- REAL_CONST(33406.450018650721/8.0),
- REAL_CONST(33424.477107845501/8.0),
- REAL_CONST(33442.506628041512/8.0),
- REAL_CONST(33460.53857858335/8.0),
- REAL_CONST(33478.572958816083/8.0),
- REAL_CONST(33496.609768085189/8.0),
- REAL_CONST(33514.649005736617/8.0),
- REAL_CONST(33532.690671116739/8.0),
- REAL_CONST(33550.734763572356/8.0),
- REAL_CONST(33568.781282450735/8.0),
- REAL_CONST(33586.830227099563/8.0),
- REAL_CONST(33604.881596866973/8.0),
- REAL_CONST(33622.935391101528/8.0),
- REAL_CONST(33640.991609152239/8.0),
- REAL_CONST(33659.050250368542/8.0),
- REAL_CONST(33677.111314100322/8.0),
- REAL_CONST(33695.174799697881/8.0),
- REAL_CONST(33713.240706511984/8.0),
- REAL_CONST(33731.309033893805/8.0),
- REAL_CONST(33749.37978119497/8.0),
- REAL_CONST(33767.452947767531/8.0),
- REAL_CONST(33785.528532963974/8.0),
- REAL_CONST(33803.606536137209/8.0),
- REAL_CONST(33821.686956640602/8.0),
- REAL_CONST(33839.769793827938/8.0),
- REAL_CONST(33857.855047053425/8.0),
- REAL_CONST(33875.942715671707/8.0),
- REAL_CONST(33894.032799037872/8.0),
- REAL_CONST(33912.125296507431/8.0),
- REAL_CONST(33930.220207436316/8.0),
- REAL_CONST(33948.317531180888/8.0),
- REAL_CONST(33966.417267097961/8.0),
- REAL_CONST(33984.519414544746/8.0),
- REAL_CONST(34002.623972878901/8.0),
- REAL_CONST(34020.730941458511/8.0),
- REAL_CONST(34038.840319642077/8.0),
- REAL_CONST(34056.952106788536/8.0),
- REAL_CONST(34075.066302257255/8.0),
- REAL_CONST(34093.182905408015/8.0),
- REAL_CONST(34111.301915601027/8.0),
- REAL_CONST(34129.42333219693/8.0),
- REAL_CONST(34147.547154556785/8.0),
- REAL_CONST(34165.673382042078/8.0),
- REAL_CONST(34183.80201401472/8.0),
- REAL_CONST(34201.933049837033/8.0),
- REAL_CONST(34220.06648887178/8.0),
- REAL_CONST(34238.202330482141/8.0),
- REAL_CONST(34256.340574031703/8.0),
- REAL_CONST(34274.481218884495/8.0),
- REAL_CONST(34292.624264404949/8.0),
- REAL_CONST(34310.769709957938/8.0),
- REAL_CONST(34328.91755490873/8.0),
- REAL_CONST(34347.067798623029/8.0),
- REAL_CONST(34365.220440466954/8.0),
- REAL_CONST(34383.375479807051/8.0),
- REAL_CONST(34401.532916010263/8.0),
- REAL_CONST(34419.692748443973/8.0),
- REAL_CONST(34437.854976475966/8.0),
- REAL_CONST(34456.01959947445/8.0),
- REAL_CONST(34474.18661680806/8.0),
- REAL_CONST(34492.356027845817/8.0),
- REAL_CONST(34510.527831957188/8.0),
- REAL_CONST(34528.702028512052/8.0),
- REAL_CONST(34546.878616880676/8.0),
- REAL_CONST(34565.05759643377/8.0),
- REAL_CONST(34583.238966542449/8.0),
- REAL_CONST(34601.422726578232/8.0),
- REAL_CONST(34619.608875913065/8.0),
- REAL_CONST(34637.797413919296/8.0),
- REAL_CONST(34655.988339969692/8.0),
- REAL_CONST(34674.181653437423/8.0),
- REAL_CONST(34692.37735369608/8.0),
- REAL_CONST(34710.575440119668/8.0),
- REAL_CONST(34728.775912082579/8.0),
- REAL_CONST(34746.978768959649/8.0),
- REAL_CONST(34765.184010126082/8.0),
- REAL_CONST(34783.391634957537/8.0),
- REAL_CONST(34801.60164283005/8.0),
- REAL_CONST(34819.814033120063/8.0),
- REAL_CONST(34838.028805204456/8.0),
- REAL_CONST(34856.24595846048/8.0),
- REAL_CONST(34874.465492265823/8.0),
- REAL_CONST(34892.687405998557/8.0),
- REAL_CONST(34910.911699037177/8.0),
- REAL_CONST(34929.138370760564/8.0),
- REAL_CONST(34947.367420548027/8.0),
- REAL_CONST(34965.598847779271/8.0),
- REAL_CONST(34983.832651834389/8.0),
- REAL_CONST(35002.068832093908/8.0),
- REAL_CONST(35020.307387938738/8.0),
- REAL_CONST(35038.548318750189/8.0),
- REAL_CONST(35056.79162390998/8.0),
- REAL_CONST(35075.03730280025/8.0),
- REAL_CONST(35093.285354803513/8.0),
- REAL_CONST(35111.535779302685/8.0),
- REAL_CONST(35129.788575681116/8.0),
- REAL_CONST(35148.043743322516/8.0),
- REAL_CONST(35166.301281611013/8.0),
- REAL_CONST(35184.561189931141/8.0),
- REAL_CONST(35202.823467667826/8.0),
- REAL_CONST(35221.088114206388/8.0),
- REAL_CONST(35239.355128932555/8.0),
- REAL_CONST(35257.624511232447/8.0),
- REAL_CONST(35275.896260492584/8.0),
- REAL_CONST(35294.170376099886/8.0),
- REAL_CONST(35312.446857441668/8.0),
- REAL_CONST(35330.725703905628/8.0),
- REAL_CONST(35349.006914879887/8.0),
- REAL_CONST(35367.290489752944/8.0),
- REAL_CONST(35385.576427913686/8.0),
- REAL_CONST(35403.864728751418/8.0),
- REAL_CONST(35422.155391655811/8.0),
- REAL_CONST(35440.448416016967/8.0),
- REAL_CONST(35458.743801225341/8.0),
- REAL_CONST(35477.041546671804/8.0),
- REAL_CONST(35495.341651747622/8.0),
- REAL_CONST(35513.644115844436/8.0),
- REAL_CONST(35531.948938354304/8.0),
- REAL_CONST(35550.256118669655/8.0),
- REAL_CONST(35568.565656183309/8.0),
- REAL_CONST(35586.877550288496/8.0),
- REAL_CONST(35605.191800378816/8.0),
- REAL_CONST(35623.508405848268/8.0),
- REAL_CONST(35641.827366091238/8.0),
- REAL_CONST(35660.148680502505/8.0),
- REAL_CONST(35678.472348477233/8.0),
- REAL_CONST(35696.798369410979/8.0),
- REAL_CONST(35715.126742699678/8.0),
- REAL_CONST(35733.457467739659/8.0),
- REAL_CONST(35751.790543927644/8.0),
- REAL_CONST(35770.125970660738/8.0),
- REAL_CONST(35788.46374733642/8.0),
- REAL_CONST(35806.803873352568/8.0),
- REAL_CONST(35825.146348107453/8.0),
- REAL_CONST(35843.49117099971/8.0),
- REAL_CONST(35861.838341428367/8.0),
- REAL_CONST(35880.187858792851/8.0),
- REAL_CONST(35898.539722492955/8.0),
- REAL_CONST(35916.893931928862/8.0),
- REAL_CONST(35935.250486501129/8.0),
- REAL_CONST(35953.609385610718/8.0),
- REAL_CONST(35971.970628658957/8.0),
- REAL_CONST(35990.334215047558/8.0),
- REAL_CONST(36008.700144178612/8.0),
- REAL_CONST(36027.068415454596/8.0),
- REAL_CONST(36045.439028278372/8.0),
- REAL_CONST(36063.811982053165/8.0),
- REAL_CONST(36082.187276182609/8.0),
- REAL_CONST(36100.564910070694/8.0),
- REAL_CONST(36118.944883121789/8.0),
- REAL_CONST(36137.327194740654/8.0),
- REAL_CONST(36155.711844332429/8.0),
- REAL_CONST(36174.098831302617/8.0),
- REAL_CONST(36192.488155057115/8.0),
- REAL_CONST(36210.87981500219/8.0),
- REAL_CONST(36229.273810544473/8.0),
- REAL_CONST(36247.670141091003/8.0),
- REAL_CONST(36266.068806049167/8.0),
- REAL_CONST(36284.469804826738/8.0),
- REAL_CONST(36302.873136831862/8.0),
- REAL_CONST(36321.278801473069/8.0),
- REAL_CONST(36339.686798159251/8.0),
- REAL_CONST(36358.097126299683/8.0),
- REAL_CONST(36376.509785304013/8.0),
- REAL_CONST(36394.924774582258/8.0),
- REAL_CONST(36413.342093544816/8.0),
- REAL_CONST(36431.761741602444/8.0),
- REAL_CONST(36450.183718166292/8.0),
- REAL_CONST(36468.608022647859/8.0),
- REAL_CONST(36487.034654459028/8.0),
- REAL_CONST(36505.463613012063/8.0),
- REAL_CONST(36523.894897719583/8.0),
- REAL_CONST(36542.328507994578/8.0),
- REAL_CONST(36560.764443250409/8.0),
- REAL_CONST(36579.202702900831/8.0),
- REAL_CONST(36597.643286359926/8.0),
- REAL_CONST(36616.086193042182/8.0),
- REAL_CONST(36634.531422362437/8.0),
- REAL_CONST(36652.978973735895/8.0),
- REAL_CONST(36671.428846578143/8.0),
- REAL_CONST(36689.881040305125/8.0),
- REAL_CONST(36708.335554333149/8.0),
- REAL_CONST(36726.792388078902/8.0),
- REAL_CONST(36745.251540959427/8.0),
- REAL_CONST(36763.713012392138/8.0),
- REAL_CONST(36782.176801794812/8.0),
- REAL_CONST(36800.642908585593/8.0),
- REAL_CONST(36819.111332182983/8.0),
- REAL_CONST(36837.582072005869/8.0),
- REAL_CONST(36856.055127473483/8.0),
- REAL_CONST(36874.530498005421/8.0),
- REAL_CONST(36893.008183021651/8.0),
- REAL_CONST(36911.488181942506/8.0),
- REAL_CONST(36929.970494188674/8.0),
- REAL_CONST(36948.455119181206/8.0),
- REAL_CONST(36966.942056341519/8.0),
- REAL_CONST(36985.431305091392/8.0),
- REAL_CONST(37003.922864852961/8.0),
- REAL_CONST(37022.416735048733/8.0),
- REAL_CONST(37040.912915101559/8.0),
- REAL_CONST(37059.411404434657/8.0),
- REAL_CONST(37077.91220247162/8.0),
- REAL_CONST(37096.415308636388/8.0),
- REAL_CONST(37114.920722353243/8.0),
- REAL_CONST(37133.428443046862/8.0),
- REAL_CONST(37151.938470142253/8.0),
- REAL_CONST(37170.450803064785/8.0),
- REAL_CONST(37188.965441240209/8.0),
- REAL_CONST(37207.482384094597/8.0),
- REAL_CONST(37226.001631054402/8.0),
- REAL_CONST(37244.523181546429/8.0),
- REAL_CONST(37263.047034997842/8.0),
- REAL_CONST(37281.573190836149/8.0),
- REAL_CONST(37300.101648489224/8.0),
- REAL_CONST(37318.632407385296/8.0),
- REAL_CONST(37337.165466952945/8.0),
- REAL_CONST(37355.700826621112/8.0),
- REAL_CONST(37374.238485819085/8.0),
- REAL_CONST(37392.778443976509/8.0),
- REAL_CONST(37411.320700523385/8.0),
- REAL_CONST(37429.865254890057/8.0),
- REAL_CONST(37448.412106507232/8.0),
- REAL_CONST(37466.961254805974/8.0),
- REAL_CONST(37485.512699217681/8.0),
- REAL_CONST(37504.066439174116/8.0),
- REAL_CONST(37522.622474107404/8.0),
- REAL_CONST(37541.180803449992/8.0),
- REAL_CONST(37559.741426634704/8.0),
- REAL_CONST(37578.304343094693/8.0),
- REAL_CONST(37596.869552263488/8.0),
- REAL_CONST(37615.43705357494/8.0),
- REAL_CONST(37634.006846463279/8.0),
- REAL_CONST(37652.578930363044/8.0),
- REAL_CONST(37671.153304709165/8.0),
- REAL_CONST(37689.729968936896/8.0),
- REAL_CONST(37708.308922481847/8.0),
- REAL_CONST(37726.890164779965/8.0),
- REAL_CONST(37745.473695267559/8.0),
- REAL_CONST(37764.059513381275/8.0),
- REAL_CONST(37782.647618558112/8.0),
- REAL_CONST(37801.238010235415/8.0),
- REAL_CONST(37819.830687850859/8.0),
- REAL_CONST(37838.425650842495/8.0),
- REAL_CONST(37857.022898648691/8.0),
- REAL_CONST(37875.622430708172/8.0),
- REAL_CONST(37894.224246460013/8.0),
- REAL_CONST(37912.828345343616/8.0),
- REAL_CONST(37931.434726798747/8.0),
- REAL_CONST(37950.043390265506/8.0),
- REAL_CONST(37968.654335184328/8.0),
- REAL_CONST(37987.267560995999/8.0),
- REAL_CONST(38005.883067141665/8.0),
- REAL_CONST(38024.500853062775/8.0),
- REAL_CONST(38043.120918201159/8.0),
- REAL_CONST(38061.743261998963/8.0),
- REAL_CONST(38080.367883898682/8.0),
- REAL_CONST(38098.994783343158/8.0),
- REAL_CONST(38117.623959775563/8.0),
- REAL_CONST(38136.255412639417/8.0),
- REAL_CONST(38154.889141378575/8.0),
- REAL_CONST(38173.525145437234/8.0),
- REAL_CONST(38192.163424259939/8.0),
- REAL_CONST(38210.803977291551/8.0),
- REAL_CONST(38229.446803977284/8.0),
- REAL_CONST(38248.091903762703/8.0),
- REAL_CONST(38266.739276093685/8.0),
- REAL_CONST(38285.388920416466/8.0),
- REAL_CONST(38304.040836177606/8.0),
- REAL_CONST(38322.695022824002/8.0),
- REAL_CONST(38341.351479802899/8.0),
- REAL_CONST(38360.010206561863/8.0),
- REAL_CONST(38378.671202548816/8.0),
- REAL_CONST(38397.334467211993/8.0),
- REAL_CONST(38415.999999999978/8.0),
- REAL_CONST(38434.667800361683/8.0),
- REAL_CONST(38453.33786774637/8.0),
- REAL_CONST(38472.010201603611/8.0),
- REAL_CONST(38490.684801383337/8.0),
- REAL_CONST(38509.361666535784/8.0),
- REAL_CONST(38528.040796511552/8.0),
- REAL_CONST(38546.722190761553/8.0),
- REAL_CONST(38565.405848737035/8.0),
- REAL_CONST(38584.091769889594/8.0),
- REAL_CONST(38602.779953671132/8.0),
- REAL_CONST(38621.470399533908/8.0),
- REAL_CONST(38640.163106930493/8.0),
- REAL_CONST(38658.858075313794/8.0),
- REAL_CONST(38677.555304137059/8.0),
- REAL_CONST(38696.254792853862/8.0),
- REAL_CONST(38714.956540918094/8.0),
- REAL_CONST(38733.660547783991/8.0),
- REAL_CONST(38752.366812906112/8.0),
- REAL_CONST(38771.075335739348/8.0),
- REAL_CONST(38789.78611573892/8.0),
- REAL_CONST(38808.499152360368/8.0),
- REAL_CONST(38827.214445059573/8.0),
- REAL_CONST(38845.931993292739/8.0),
- REAL_CONST(38864.651796516388/8.0),
- REAL_CONST(38883.373854187383/8.0),
- REAL_CONST(38902.098165762916/8.0),
- REAL_CONST(38920.824730700486/8.0),
- REAL_CONST(38939.553548457938/8.0),
- REAL_CONST(38958.284618493431/8.0),
- REAL_CONST(38977.017940265461/8.0),
- REAL_CONST(38995.753513232834/8.0),
- REAL_CONST(39014.491336854699/8.0),
- REAL_CONST(39033.231410590517/8.0),
- REAL_CONST(39051.973733900079/8.0),
- REAL_CONST(39070.718306243485/8.0),
- REAL_CONST(39089.465127081188/8.0),
- REAL_CONST(39108.214195873945/8.0),
- REAL_CONST(39126.965512082832/8.0),
- REAL_CONST(39145.719075169261/8.0),
- REAL_CONST(39164.474884594965/8.0),
- REAL_CONST(39183.232939821988/8.0),
- REAL_CONST(39201.99324031271/8.0),
- REAL_CONST(39220.755785529815/8.0),
- REAL_CONST(39239.52057493633/8.0),
- REAL_CONST(39258.287607995589/8.0),
- REAL_CONST(39277.056884171245/8.0),
- REAL_CONST(39295.828402927284/8.0),
- REAL_CONST(39314.602163728006/8.0),
- REAL_CONST(39333.378166038019/8.0),
- REAL_CONST(39352.15640932227/8.0),
- REAL_CONST(39370.936893046004/8.0),
- REAL_CONST(39389.719616674811/8.0),
- REAL_CONST(39408.504579674584/8.0),
- REAL_CONST(39427.291781511522/8.0),
- REAL_CONST(39446.081221652174/8.0),
- REAL_CONST(39464.872899563372/8.0),
- REAL_CONST(39483.666814712291/8.0),
- REAL_CONST(39502.462966566411/8.0),
- REAL_CONST(39521.261354593538/8.0),
- REAL_CONST(39540.06197826178/8.0),
- REAL_CONST(39558.864837039568/8.0),
- REAL_CONST(39577.669930395656/8.0),
- REAL_CONST(39596.47725779911/8.0),
- REAL_CONST(39615.286818719302/8.0),
- REAL_CONST(39634.098612625923/8.0),
- REAL_CONST(39652.912638988993/8.0),
- REAL_CONST(39671.728897278823/8.0),
- REAL_CONST(39690.547386966064/8.0),
- REAL_CONST(39709.368107521652/8.0),
- REAL_CONST(39728.191058416858/8.0),
- REAL_CONST(39747.016239123259/8.0),
- REAL_CONST(39765.84364911275/8.0),
- REAL_CONST(39784.673287857528/8.0),
- REAL_CONST(39803.505154830105/8.0),
- REAL_CONST(39822.339249503319/8.0),
- REAL_CONST(39841.175571350293/8.0),
- REAL_CONST(39860.014119844491/8.0),
- REAL_CONST(39878.854894459677/8.0),
- REAL_CONST(39897.697894669909/8.0),
- REAL_CONST(39916.54311994958/8.0),
- REAL_CONST(39935.390569773372/8.0),
- REAL_CONST(39954.240243616303/8.0),
- REAL_CONST(39973.092140953675/8.0),
- REAL_CONST(39991.946261261117/8.0),
- REAL_CONST(40010.802604014549/8.0),
- REAL_CONST(40029.661168690225/8.0),
- REAL_CONST(40048.521954764678/8.0),
- REAL_CONST(40067.384961714779/8.0),
- REAL_CONST(40086.250189017679/8.0),
- REAL_CONST(40105.117636150855/8.0),
- REAL_CONST(40123.98730259209/8.0),
- REAL_CONST(40142.859187819471/8.0),
- REAL_CONST(40161.733291311379/8.0),
- REAL_CONST(40180.609612546526/8.0),
- REAL_CONST(40199.488151003912/8.0),
- REAL_CONST(40218.368906162854/8.0),
- REAL_CONST(40237.25187750296/8.0),
- REAL_CONST(40256.137064504153/8.0),
- REAL_CONST(40275.024466646668/8.0),
- REAL_CONST(40293.914083411029/8.0),
- REAL_CONST(40312.805914278084/8.0),
- REAL_CONST(40331.699958728961/8.0),
- REAL_CONST(40350.596216245103/8.0),
- REAL_CONST(40369.494686308273/8.0),
- REAL_CONST(40388.39536840051/8.0),
- REAL_CONST(40407.298262004173/8.0),
- REAL_CONST(40426.20336660192/8.0),
- REAL_CONST(40445.110681676706/8.0),
- REAL_CONST(40464.020206711793/8.0),
- REAL_CONST(40482.931941190756/8.0),
- REAL_CONST(40501.845884597446/8.0),
- REAL_CONST(40520.762036416032/8.0),
- REAL_CONST(40539.680396130985/8.0),
- REAL_CONST(40558.600963227072/8.0),
- REAL_CONST(40577.523737189367/8.0),
- REAL_CONST(40596.448717503234/8.0),
- REAL_CONST(40615.375903654342/8.0),
- REAL_CONST(40634.305295128659/8.0),
- REAL_CONST(40653.236891412453/8.0),
- REAL_CONST(40672.170691992294/8.0),
- REAL_CONST(40691.106696355047/8.0),
- REAL_CONST(40710.044903987873/8.0),
- REAL_CONST(40728.985314378238/8.0),
- REAL_CONST(40747.927927013901/8.0),
- REAL_CONST(40766.872741382918/8.0),
- REAL_CONST(40785.819756973651/8.0),
- REAL_CONST(40804.768973274746/8.0),
- REAL_CONST(40823.720389775161/8.0),
- REAL_CONST(40842.674005964131/8.0),
- REAL_CONST(40861.629821331211/8.0),
- REAL_CONST(40880.587835366234/8.0),
- REAL_CONST(40899.548047559321/8.0),
- REAL_CONST(40918.510457400931/8.0),
- REAL_CONST(40937.475064381761/8.0),
- REAL_CONST(40956.441867992849/8.0),
- REAL_CONST(40975.410867725499/8.0),
- REAL_CONST(40994.382063071331/8.0),
- REAL_CONST(41013.355453522236/8.0),
- REAL_CONST(41032.331038570417/8.0),
- REAL_CONST(41051.308817708363/8.0),
- REAL_CONST(41070.288790428858/8.0),
- REAL_CONST(41089.270956224987/8.0),
- REAL_CONST(41108.255314590111/8.0),
- REAL_CONST(41127.241865017888/8.0),
- REAL_CONST(41146.23060700229/8.0),
- REAL_CONST(41165.221540037543/8.0),
- REAL_CONST(41184.214663618193/8.0),
- REAL_CONST(41203.209977239079/8.0),
- REAL_CONST(41222.207480395307/8.0),
- REAL_CONST(41241.207172582297/8.0),
- REAL_CONST(41260.209053295752/8.0),
- REAL_CONST(41279.213122031659/8.0),
- REAL_CONST(41298.219378286303/8.0),
- REAL_CONST(41317.227821556255/8.0),
- REAL_CONST(41336.23845133838/8.0),
- REAL_CONST(41355.251267129832/8.0),
- REAL_CONST(41374.266268428037/8.0),
- REAL_CONST(41393.283454730743/8.0),
- REAL_CONST(41412.302825535953/8.0),
- REAL_CONST(41431.324380341983/8.0),
- REAL_CONST(41450.348118647416/8.0),
- REAL_CONST(41469.374039951144/8.0),
- REAL_CONST(41488.402143752326/8.0),
- REAL_CONST(41507.432429550427/8.0),
- REAL_CONST(41526.464896845187/8.0),
- REAL_CONST(41545.499545136627/8.0),
- REAL_CONST(41564.536373925075/8.0),
- REAL_CONST(41583.575382711126/8.0),
- REAL_CONST(41602.616570995662/8.0),
- REAL_CONST(41621.659938279874/8.0),
- REAL_CONST(41640.705484065205/8.0),
- REAL_CONST(41659.753207853406/8.0),
- REAL_CONST(41678.803109146495/8.0),
- REAL_CONST(41697.855187446803/8.0),
- REAL_CONST(41716.909442256911/8.0),
- REAL_CONST(41735.965873079709/8.0),
- REAL_CONST(41755.02447941836/8.0),
- REAL_CONST(41774.085260776315/8.0),
- REAL_CONST(41793.148216657297/8.0),
- REAL_CONST(41812.213346565331/8.0),
- REAL_CONST(41831.280650004708/8.0),
- REAL_CONST(41850.350126480014/8.0),
- REAL_CONST(41869.421775496106/8.0),
- REAL_CONST(41888.495596558132/8.0),
- REAL_CONST(41907.571589171515/8.0),
- REAL_CONST(41926.649752841957/8.0),
- REAL_CONST(41945.730087075463/8.0),
- REAL_CONST(41964.812591378286/8.0),
- REAL_CONST(41983.897265256979/8.0),
- REAL_CONST(42002.984108218378/8.0),
- REAL_CONST(42022.073119769593/8.0),
- REAL_CONST(42041.164299418015/8.0),
- REAL_CONST(42060.257646671307/8.0),
- REAL_CONST(42079.353161037419/8.0),
- REAL_CONST(42098.450842024591/8.0),
- REAL_CONST(42117.550689141324/8.0),
- REAL_CONST(42136.652701896404/8.0),
- REAL_CONST(42155.756879798893/8.0),
- REAL_CONST(42174.863222358137/8.0),
- REAL_CONST(42193.971729083758/8.0),
- REAL_CONST(42213.082399485655/8.0),
- REAL_CONST(42232.195233074002/8.0),
- REAL_CONST(42251.310229359246/8.0),
- REAL_CONST(42270.427387852127/8.0),
- REAL_CONST(42289.546708063644/8.0),
- REAL_CONST(42308.668189505079/8.0),
- REAL_CONST(42327.791831687995/8.0),
- REAL_CONST(42346.917634124227/8.0),
- REAL_CONST(42366.045596325886/8.0),
- REAL_CONST(42385.175717805352/8.0),
- REAL_CONST(42404.307998075295/8.0),
- REAL_CONST(42423.442436648642/8.0),
- REAL_CONST(42442.579033038608/8.0),
- REAL_CONST(42461.717786758672/8.0),
- REAL_CONST(42480.858697322597/8.0),
- REAL_CONST(42500.001764244422/8.0),
- REAL_CONST(42519.146987038446/8.0),
- REAL_CONST(42538.294365219248/8.0),
- REAL_CONST(42557.443898301688/8.0),
- REAL_CONST(42576.595585800882/8.0),
- REAL_CONST(42595.749427232236/8.0),
- REAL_CONST(42614.90542211142/8.0),
- REAL_CONST(42634.063569954378/8.0),
- REAL_CONST(42653.223870277317/8.0),
- REAL_CONST(42672.386322596729/8.0),
- REAL_CONST(42691.55092642938/8.0),
- REAL_CONST(42710.717681292292/8.0),
- REAL_CONST(42729.886586702756/8.0),
- REAL_CONST(42749.057642178363/8.0),
- REAL_CONST(42768.23084723694/8.0),
- REAL_CONST(42787.406201396603/8.0),
- REAL_CONST(42806.58370417574/8.0),
- REAL_CONST(42825.76335509299/8.0),
- REAL_CONST(42844.945153667286/8.0),
- REAL_CONST(42864.129099417805/8.0),
- REAL_CONST(42883.315191864014/8.0),
- REAL_CONST(42902.503430525649/8.0),
- REAL_CONST(42921.693814922692/8.0),
- REAL_CONST(42940.88634457541/8.0),
- REAL_CONST(42960.081019004348/8.0),
- REAL_CONST(42979.277837730297/8.0),
- REAL_CONST(42998.476800274322/8.0),
- REAL_CONST(43017.677906157769/8.0),
- REAL_CONST(43036.881154902228/8.0),
- REAL_CONST(43056.086546029583/8.0),
- REAL_CONST(43075.294079061961/8.0),
- REAL_CONST(43094.503753521763/8.0),
- REAL_CONST(43113.715568931671/8.0),
- REAL_CONST(43132.929524814601/8.0),
- REAL_CONST(43152.145620693766/8.0),
- REAL_CONST(43171.363856092619/8.0),
- REAL_CONST(43190.584230534907/8.0),
- REAL_CONST(43209.806743544621/8.0),
- REAL_CONST(43229.031394646016/8.0),
- REAL_CONST(43248.258183363621/8.0),
- REAL_CONST(43267.487109222224/8.0),
- REAL_CONST(43286.718171746885/8.0),
- REAL_CONST(43305.951370462906/8.0),
- REAL_CONST(43325.186704895881/8.0),
- REAL_CONST(43344.42417457165/8.0),
- REAL_CONST(43363.663779016322/8.0),
- REAL_CONST(43382.905517756262/8.0),
- REAL_CONST(43402.149390318104/8.0),
- REAL_CONST(43421.395396228749/8.0),
- REAL_CONST(43440.643535015348/8.0),
- REAL_CONST(43459.89380620532/8.0),
- REAL_CONST(43479.146209326354/8.0),
- REAL_CONST(43498.400743906379/8.0),
- REAL_CONST(43517.657409473606/8.0),
- REAL_CONST(43536.916205556496/8.0),
- REAL_CONST(43556.177131683784/8.0),
- REAL_CONST(43575.44018738444/8.0),
- REAL_CONST(43594.705372187724/8.0),
- REAL_CONST(43613.972685623135/8.0),
- REAL_CONST(43633.242127220445/8.0),
- REAL_CONST(43652.513696509668/8.0),
- REAL_CONST(43671.787393021099/8.0),
- REAL_CONST(43691.063216285271/8.0),
- REAL_CONST(43710.341165833001/8.0),
- REAL_CONST(43729.621241195346/8.0),
- REAL_CONST(43748.903441903625/8.0),
- REAL_CONST(43768.187767489413/8.0),
- REAL_CONST(43787.474217484552/8.0),
- REAL_CONST(43806.762791421126/8.0),
- REAL_CONST(43826.053488831501/8.0),
- REAL_CONST(43845.346309248278/8.0),
- REAL_CONST(43864.641252204325/8.0),
- REAL_CONST(43883.938317232765/8.0),
- REAL_CONST(43903.237503866971/8.0),
- REAL_CONST(43922.538811640596/8.0),
- REAL_CONST(43941.842240087513/8.0),
- REAL_CONST(43961.147788741881/8.0),
- REAL_CONST(43980.455457138101/8.0),
- REAL_CONST(43999.765244810835/8.0),
- REAL_CONST(44019.077151295001/8.0),
- REAL_CONST(44038.391176125755/8.0),
- REAL_CONST(44057.70731883854/8.0),
- REAL_CONST(44077.02557896902/8.0),
- REAL_CONST(44096.345956053141/8.0),
- REAL_CONST(44115.668449627083/8.0),
- REAL_CONST(44134.993059227287/8.0),
- REAL_CONST(44154.319784390456/8.0),
- REAL_CONST(44173.648624653535/8.0),
- REAL_CONST(44192.979579553728/8.0),
- REAL_CONST(44212.312648628489/8.0),
- REAL_CONST(44231.647831415532/8.0),
- REAL_CONST(44250.985127452805/8.0),
- REAL_CONST(44270.324536278538/8.0),
- REAL_CONST(44289.666057431183/8.0),
- REAL_CONST(44309.009690449464/8.0),
- REAL_CONST(44328.355434872348/8.0),
- REAL_CONST(44347.703290239064/8.0),
- REAL_CONST(44367.053256089079/8.0),
- REAL_CONST(44386.405331962109/8.0),
- REAL_CONST(44405.759517398139/8.0),
- REAL_CONST(44425.115811937387/8.0),
- REAL_CONST(44444.474215120332/8.0),
- REAL_CONST(44463.834726487694/8.0),
- REAL_CONST(44483.197345580462/8.0),
- REAL_CONST(44502.562071939843/8.0),
- REAL_CONST(44521.928905107328/8.0),
- REAL_CONST(44541.297844624634/8.0),
- REAL_CONST(44560.668890033732/8.0),
- REAL_CONST(44580.042040876848/8.0),
- REAL_CONST(44599.417296696454/8.0),
- REAL_CONST(44618.794657035272/8.0),
- REAL_CONST(44638.174121436256/8.0),
- REAL_CONST(44657.555689442641/8.0),
- REAL_CONST(44676.939360597877/8.0),
- REAL_CONST(44696.325134445673/8.0),
- REAL_CONST(44715.713010530002/8.0),
- REAL_CONST(44735.102988395054/8.0),
- REAL_CONST(44754.495067585296/8.0),
- REAL_CONST(44773.88924764542/8.0),
- REAL_CONST(44793.285528120374/8.0),
- REAL_CONST(44812.683908555344/8.0),
- REAL_CONST(44832.084388495779/8.0),
- REAL_CONST(44851.486967487363/8.0),
- REAL_CONST(44870.891645076015/8.0),
- REAL_CONST(44890.298420807922/8.0),
- REAL_CONST(44909.707294229491/8.0),
- REAL_CONST(44929.118264887409/8.0),
- REAL_CONST(44948.531332328566/8.0),
- REAL_CONST(44967.946496100136/8.0),
- REAL_CONST(44987.363755749502/8.0),
- REAL_CONST(45006.783110824319/8.0),
- REAL_CONST(45026.204560872473/8.0),
- REAL_CONST(45045.628105442098/8.0),
- REAL_CONST(45065.053744081561/8.0),
- REAL_CONST(45084.48147633949/8.0),
- REAL_CONST(45103.911301764747/8.0),
- REAL_CONST(45123.343219906426/8.0),
- REAL_CONST(45142.777230313885/8.0),
- REAL_CONST(45162.21333253671/8.0),
- REAL_CONST(45181.651526124733/8.0),
- REAL_CONST(45201.091810628037/8.0),
- REAL_CONST(45220.534185596924/8.0),
- REAL_CONST(45239.978650581965/8.0),
- REAL_CONST(45259.425205133957/8.0),
- REAL_CONST(45278.873848803938/8.0),
- REAL_CONST(45298.324581143192/8.0),
- REAL_CONST(45317.777401703235/8.0),
- REAL_CONST(45337.232310035848/8.0),
- REAL_CONST(45356.68930569302/8.0),
- REAL_CONST(45376.148388226997/8.0),
- REAL_CONST(45395.60955719027/8.0),
- REAL_CONST(45415.072812135557/8.0),
- REAL_CONST(45434.538152615823/8.0),
- REAL_CONST(45454.005578184282/8.0),
- REAL_CONST(45473.475088394356/8.0),
- REAL_CONST(45492.946682799746/8.0),
- REAL_CONST(45512.420360954362/8.0),
- REAL_CONST(45531.896122412363/8.0),
- REAL_CONST(45551.373966728155/8.0),
- REAL_CONST(45570.853893456362/8.0),
- REAL_CONST(45590.33590215187/8.0),
- REAL_CONST(45609.819992369776/8.0),
- REAL_CONST(45629.306163665438/8.0),
- REAL_CONST(45648.794415594442/8.0),
- REAL_CONST(45668.284747712612/8.0),
- REAL_CONST(45687.777159576006/8.0),
- REAL_CONST(45707.27165074092/8.0),
- REAL_CONST(45726.768220763894/8.0),
- REAL_CONST(45746.266869201696/8.0),
- REAL_CONST(45765.767595611323/8.0),
- REAL_CONST(45785.270399550034/8.0),
- REAL_CONST(45804.775280575297/8.0),
- REAL_CONST(45824.282238244828/8.0),
- REAL_CONST(45843.79127211657/8.0),
- REAL_CONST(45863.302381748719/8.0),
- REAL_CONST(45882.815566699683/8.0),
- REAL_CONST(45902.33082652813/8.0),
- REAL_CONST(45921.848160792935/8.0),
- REAL_CONST(45941.367569053225/8.0),
- REAL_CONST(45960.889050868354/8.0),
- REAL_CONST(45980.41260579793/8.0),
- REAL_CONST(45999.938233401757/8.0),
- REAL_CONST(46019.465933239902/8.0),
- REAL_CONST(46038.995704872657/8.0),
- REAL_CONST(46058.527547860547/8.0),
- REAL_CONST(46078.06146176433/8.0),
- REAL_CONST(46097.597446144995/8.0),
- REAL_CONST(46117.135500563774/8.0),
- REAL_CONST(46136.675624582109/8.0),
- REAL_CONST(46156.217817761702/8.0),
- REAL_CONST(46175.762079664462/8.0),
- REAL_CONST(46195.308409852543/8.0),
- REAL_CONST(46214.856807888333/8.0),
- REAL_CONST(46234.407273334444/8.0),
- REAL_CONST(46253.959805753715/8.0),
- REAL_CONST(46273.51440470924/8.0),
- REAL_CONST(46293.071069764315/8.0),
- REAL_CONST(46312.629800482478/8.0),
- REAL_CONST(46332.190596427499/8.0),
- REAL_CONST(46351.753457163381/8.0),
- REAL_CONST(46371.318382254351/8.0),
- REAL_CONST(46390.885371264863/8.0),
- REAL_CONST(46410.45442375962/8.0),
- REAL_CONST(46430.025539303526/8.0),
- REAL_CONST(46449.598717461733/8.0),
- REAL_CONST(46469.17395779962/8.0),
- REAL_CONST(46488.751259882782/8.0),
- REAL_CONST(46508.33062327707/8.0),
- REAL_CONST(46527.912047548532/8.0),
- REAL_CONST(46547.495532263471/8.0),
- REAL_CONST(46567.081076988397/8.0),
- REAL_CONST(46586.668681290059/8.0),
- REAL_CONST(46606.258344735434/8.0),
- REAL_CONST(46625.850066891719/8.0),
- REAL_CONST(46645.443847326351/8.0),
- REAL_CONST(46665.039685606986/8.0),
- REAL_CONST(46684.637581301497/8.0),
- REAL_CONST(46704.237533978005/8.0),
- REAL_CONST(46723.839543204842/8.0),
- REAL_CONST(46743.443608550573/8.0),
- REAL_CONST(46763.049729583989/8.0),
- REAL_CONST(46782.657905874104/8.0),
- REAL_CONST(46802.268136990162/8.0),
- REAL_CONST(46821.880422501628/8.0),
- REAL_CONST(46841.494761978196/8.0),
- REAL_CONST(46861.111154989776/8.0),
- REAL_CONST(46880.729601106526/8.0),
- REAL_CONST(46900.350099898795/8.0),
- REAL_CONST(46919.97265093719/8.0),
- REAL_CONST(46939.597253792526/8.0),
- REAL_CONST(46959.223908035841/8.0),
- REAL_CONST(46978.852613238392/8.0),
- REAL_CONST(46998.483368971691/8.0),
- REAL_CONST(47018.11617480743/8.0),
- REAL_CONST(47037.751030317551/8.0),
- REAL_CONST(47057.387935074221/8.0),
- REAL_CONST(47077.026888649809/8.0),
- REAL_CONST(47096.66789061694/8.0),
- REAL_CONST(47116.310940548428/8.0),
- REAL_CONST(47135.956038017328/8.0),
- REAL_CONST(47155.603182596918/8.0),
- REAL_CONST(47175.252373860698/8.0),
- REAL_CONST(47194.903611382375/8.0),
- REAL_CONST(47214.556894735892/8.0),
- REAL_CONST(47234.212223495422/8.0),
- REAL_CONST(47253.869597235338/8.0),
- REAL_CONST(47273.52901553025/8.0),
- REAL_CONST(47293.19047795498/8.0),
- REAL_CONST(47312.853984084577/8.0),
- REAL_CONST(47332.519533494306/8.0),
- REAL_CONST(47352.187125759658/8.0),
- REAL_CONST(47371.856760456343/8.0),
- REAL_CONST(47391.528437160297/8.0),
- REAL_CONST(47411.202155447652/8.0),
- REAL_CONST(47430.877914894787/8.0),
- REAL_CONST(47450.555715078299/8.0),
- REAL_CONST(47470.235555574982/8.0),
- REAL_CONST(47489.917435961863/8.0),
- REAL_CONST(47509.601355816201/8.0),
- REAL_CONST(47529.287314715453/8.0),
- REAL_CONST(47548.975312237308/8.0),
- REAL_CONST(47568.665347959672/8.0),
- REAL_CONST(47588.357421460656/8.0),
- REAL_CONST(47608.051532318605/8.0),
- REAL_CONST(47627.747680112072/8.0),
- REAL_CONST(47647.445864419846/8.0),
- REAL_CONST(47667.14608482091/8.0),
- REAL_CONST(47686.848340894474/8.0),
- REAL_CONST(47706.552632219973/8.0),
- REAL_CONST(47726.258958377046/8.0),
- REAL_CONST(47745.967318945557/8.0),
- REAL_CONST(47765.677713505589/8.0),
- REAL_CONST(47785.390141637428/8.0),
- REAL_CONST(47805.104602921601/8.0),
- REAL_CONST(47824.821096938824/8.0),
- REAL_CONST(47844.539623270044/8.0),
- REAL_CONST(47864.260181496429/8.0),
- REAL_CONST(47883.982771199349/8.0),
- REAL_CONST(47903.707391960394/8.0),
- REAL_CONST(47923.434043361369/8.0),
- REAL_CONST(47943.162724984308/8.0),
- REAL_CONST(47962.893436411439/8.0),
- REAL_CONST(47982.626177225218/8.0),
- REAL_CONST(48002.36094700831/8.0),
- REAL_CONST(48022.097745343599/8.0),
- REAL_CONST(48041.836571814172/8.0),
- REAL_CONST(48061.57742600335/8.0),
- REAL_CONST(48081.32030749465/8.0),
- REAL_CONST(48101.065215871815/8.0),
- REAL_CONST(48120.81215071879/8.0),
- REAL_CONST(48140.56111161974/8.0),
- REAL_CONST(48160.312098159047/8.0),
- REAL_CONST(48180.065109921306/8.0),
- REAL_CONST(48199.820146491307/8.0),
- REAL_CONST(48219.577207454073/8.0),
- REAL_CONST(48239.336292394844/8.0),
- REAL_CONST(48259.097400899045/8.0),
- REAL_CONST(48278.860532552339/8.0),
- REAL_CONST(48298.625686940592/8.0),
- REAL_CONST(48318.392863649875/8.0),
- REAL_CONST(48338.162062266485/8.0),
- REAL_CONST(48357.933282376915/8.0),
- REAL_CONST(48377.706523567889/8.0),
- REAL_CONST(48397.481785426316/8.0),
- REAL_CONST(48417.259067539344/8.0),
- REAL_CONST(48437.038369494308/8.0),
- REAL_CONST(48456.819690878765/8.0),
- REAL_CONST(48476.603031280487/8.0),
- REAL_CONST(48496.388390287451/8.0),
- REAL_CONST(48516.175767487839/8.0),
- REAL_CONST(48535.965162470042/8.0),
- REAL_CONST(48555.756574822684/8.0),
- REAL_CONST(48575.550004134566/8.0),
- REAL_CONST(48595.345449994718/8.0),
- REAL_CONST(48615.142911992378/8.0),
- REAL_CONST(48634.942389716991/8.0),
- REAL_CONST(48654.743882758201/8.0),
- REAL_CONST(48674.547390705877/8.0),
- REAL_CONST(48694.352913150084/8.0),
- REAL_CONST(48714.160449681112/8.0),
- REAL_CONST(48733.969999889443/8.0),
- REAL_CONST(48753.781563365759/8.0),
- REAL_CONST(48773.595139700978/8.0),
- REAL_CONST(48793.410728486211/8.0),
- REAL_CONST(48813.228329312769/8.0),
- REAL_CONST(48833.047941772187/8.0),
- REAL_CONST(48852.869565456189/8.0),
- REAL_CONST(48872.693199956717/8.0),
- REAL_CONST(48892.518844865925/8.0),
- REAL_CONST(48912.346499776155/8.0),
- REAL_CONST(48932.176164279976/8.0),
- REAL_CONST(48952.007837970152/8.0),
- REAL_CONST(48971.841520439666/8.0),
- REAL_CONST(48991.677211281676/8.0),
- REAL_CONST(49011.514910089587/8.0),
- REAL_CONST(49031.354616456978/8.0),
- REAL_CONST(49051.196329977654/8.0),
- REAL_CONST(49071.04005024561/8.0),
- REAL_CONST(49090.885776855059/8.0),
- REAL_CONST(49110.733509400408/8.0),
- REAL_CONST(49130.583247476279/8.0),
- REAL_CONST(49150.434990677488/8.0),
- REAL_CONST(49170.288738599062/8.0),
- REAL_CONST(49190.144490836232/8.0),
- REAL_CONST(49210.002246984441/8.0),
- REAL_CONST(49229.86200663932/8.0),
- REAL_CONST(49249.723769396718/8.0),
- REAL_CONST(49269.587534852675/8.0),
- REAL_CONST(49289.453302603448/8.0),
- REAL_CONST(49309.32107224549/8.0),
- REAL_CONST(49329.190843375451/8.0),
- REAL_CONST(49349.062615590192/8.0),
- REAL_CONST(49368.936388486785/8.0),
- REAL_CONST(49388.812161662492/8.0),
- REAL_CONST(49408.689934714785/8.0),
- REAL_CONST(49428.569707241324/8.0),
- REAL_CONST(49448.45147883999/8.0),
- REAL_CONST(49468.335249108866/8.0),
- REAL_CONST(49488.22101764621/8.0),
- REAL_CONST(49508.108784050521/8.0),
- REAL_CONST(49527.99854792047/8.0),
- REAL_CONST(49547.890308854934/8.0),
- REAL_CONST(49567.784066453009/8.0),
- REAL_CONST(49587.679820313977/8.0),
- REAL_CONST(49607.57757003732/8.0),
- REAL_CONST(49627.477315222721/8.0),
- REAL_CONST(49647.379055470075/8.0),
- REAL_CONST(49667.28279037946/8.0),
- REAL_CONST(49687.188519551179/8.0),
- REAL_CONST(49707.096242585707/8.0),
- REAL_CONST(49727.005959083741/8.0),
- REAL_CONST(49746.917668646165/8.0),
- REAL_CONST(49766.831370874068/8.0),
- REAL_CONST(49786.747065368734/8.0),
- REAL_CONST(49806.66475173166/8.0),
- REAL_CONST(49826.584429564515/8.0),
- REAL_CONST(49846.506098469203/8.0),
- REAL_CONST(49866.429758047794/8.0),
- REAL_CONST(49886.355407902578/8.0),
- REAL_CONST(49906.283047636032/8.0),
- REAL_CONST(49926.212676850846/8.0),
- REAL_CONST(49946.144295149883/8.0),
- REAL_CONST(49966.077902136225/8.0),
- REAL_CONST(49986.013497413151/8.0),
- REAL_CONST(50005.951080584135/8.0),
- REAL_CONST(50025.890651252834/8.0),
- REAL_CONST(50045.832209023123/8.0),
- REAL_CONST(50065.775753499074/8.0),
- REAL_CONST(50085.721284284933/8.0),
- REAL_CONST(50105.668800985164/8.0),
- REAL_CONST(50125.618303204428/8.0),
- REAL_CONST(50145.569790547575/8.0),
- REAL_CONST(50165.523262619652/8.0),
- REAL_CONST(50185.478719025901/8.0),
- REAL_CONST(50205.436159371769/8.0),
- REAL_CONST(50225.395583262893/8.0),
- REAL_CONST(50245.356990305103/8.0),
- REAL_CONST(50265.320380104429/8.0),
- REAL_CONST(50285.285752267104/8.0),
- REAL_CONST(50305.253106399534/8.0),
- REAL_CONST(50325.222442108337/8.0),
- REAL_CONST(50345.193759000336/8.0),
- REAL_CONST(50365.16705668252/8.0),
- REAL_CONST(50385.142334762102/8.0),
- REAL_CONST(50405.119592846473/8.0),
- REAL_CONST(50425.098830543218/8.0),
- REAL_CONST(50445.080047460127/8.0),
- REAL_CONST(50465.063243205179/8.0),
- REAL_CONST(50485.048417386541/8.0),
- REAL_CONST(50505.035569612577/8.0),
- REAL_CONST(50525.024699491856/8.0),
- REAL_CONST(50545.015806633128/8.0),
- REAL_CONST(50565.008890645338/8.0),
- REAL_CONST(50585.003951137631/8.0),
- REAL_CONST(50605.00098771933/8.0),
- REAL_CONST(50624.999999999971/8.0),
- REAL_CONST(50645.000987589265/8.0),
- REAL_CONST(50665.003950097132/8.0),
- REAL_CONST(50685.008887133677/8.0),
- REAL_CONST(50705.015798309192/8.0),
- REAL_CONST(50725.024683234165/8.0),
- REAL_CONST(50745.035541519283/8.0),
- REAL_CONST(50765.048372775411/8.0),
- REAL_CONST(50785.063176613621/8.0),
- REAL_CONST(50805.079952645159/8.0),
- REAL_CONST(50825.098700481489/8.0),
- REAL_CONST(50845.119419734241/8.0),
- REAL_CONST(50865.142110015244/8.0),
- REAL_CONST(50885.166770936521/8.0),
- REAL_CONST(50905.193402110279/8.0),
- REAL_CONST(50925.222003148934/8.0),
- REAL_CONST(50945.252573665071/8.0),
- REAL_CONST(50965.285113271471/8.0),
- REAL_CONST(50985.319621581119/8.0),
- REAL_CONST(51005.356098207172/8.0),
- REAL_CONST(51025.394542762981/8.0),
- REAL_CONST(51045.434954862096/8.0),
- REAL_CONST(51065.477334118244/8.0),
- REAL_CONST(51085.521680145357/8.0),
- REAL_CONST(51105.567992557546/8.0),
- REAL_CONST(51125.616270969113/8.0),
- REAL_CONST(51145.66651499454/8.0),
- REAL_CONST(51165.718724248516/8.0),
- REAL_CONST(51185.772898345916/8.0),
- REAL_CONST(51205.829036901778/8.0),
- REAL_CONST(51225.887139531362/8.0),
- REAL_CONST(51245.947205850105/8.0),
- REAL_CONST(51266.009235473619/8.0),
- REAL_CONST(51286.073228017718/8.0),
- REAL_CONST(51306.139183098399/8.0),
- REAL_CONST(51326.207100331856/8.0),
- REAL_CONST(51346.276979334456/8.0),
- REAL_CONST(51366.348819722756/8.0),
- REAL_CONST(51386.42262111351/8.0),
- REAL_CONST(51406.498383123653/8.0),
- REAL_CONST(51426.57610537031/8.0),
- REAL_CONST(51446.655787470787/8.0),
- REAL_CONST(51466.737429042587/8.0),
- REAL_CONST(51486.82102970338/8.0),
- REAL_CONST(51506.906589071048/8.0),
- REAL_CONST(51526.994106763632/8.0),
- REAL_CONST(51547.083582399391/8.0),
- REAL_CONST(51567.175015596738/8.0),
- REAL_CONST(51587.268405974297/8.0),
- REAL_CONST(51607.363753150858/8.0),
- REAL_CONST(51627.461056745415/8.0),
- REAL_CONST(51647.56031637713/8.0),
- REAL_CONST(51667.661531665362/8.0),
- REAL_CONST(51687.764702229651/8.0),
- REAL_CONST(51707.869827689727/8.0),
- REAL_CONST(51727.976907665499/8.0),
- REAL_CONST(51748.085941777055/8.0),
- REAL_CONST(51768.196929644677/8.0),
- REAL_CONST(51788.309870888836/8.0),
- REAL_CONST(51808.42476513017/8.0),
- REAL_CONST(51828.541611989524/8.0),
- REAL_CONST(51848.660411087905/8.0),
- REAL_CONST(51868.781162046515/8.0),
- REAL_CONST(51888.90386448674/8.0),
- REAL_CONST(51909.028518030143/8.0),
- REAL_CONST(51929.155122298485/8.0),
- REAL_CONST(51949.283676913685/8.0),
- REAL_CONST(51969.414181497872/8.0),
- REAL_CONST(51989.546635673345/8.0),
- REAL_CONST(52009.681039062583/8.0),
- REAL_CONST(52029.817391288263/8.0),
- REAL_CONST(52049.955691973213/8.0),
- REAL_CONST(52070.095940740481/8.0),
- REAL_CONST(52090.238137213273/8.0),
- REAL_CONST(52110.382281014987/8.0),
- REAL_CONST(52130.5283717692/8.0),
- REAL_CONST(52150.676409099666/8.0),
- REAL_CONST(52170.826392630333/8.0),
- REAL_CONST(52190.97832198532/8.0),
- REAL_CONST(52211.132196788931/8.0),
- REAL_CONST(52231.288016665654/8.0),
- REAL_CONST(52251.445781240145/8.0),
- REAL_CONST(52271.60549013727/8.0),
- REAL_CONST(52291.76714298204/8.0),
- REAL_CONST(52311.930739399664/8.0),
- REAL_CONST(52332.096279015546/8.0),
- REAL_CONST(52352.263761455244/8.0),
- REAL_CONST(52372.433186344519/8.0),
- REAL_CONST(52392.604553309284/8.0),
- REAL_CONST(52412.777861975665/8.0),
- REAL_CONST(52432.953111969946/8.0),
- REAL_CONST(52453.130302918595/8.0),
- REAL_CONST(52473.309434448267/8.0),
- REAL_CONST(52493.490506185793/8.0),
- REAL_CONST(52513.67351775818/8.0),
- REAL_CONST(52533.858468792605/8.0),
- REAL_CONST(52554.045358916446/8.0),
- REAL_CONST(52574.234187757254/8.0),
- REAL_CONST(52594.42495494274/8.0),
- REAL_CONST(52614.617660100812/8.0),
- REAL_CONST(52634.812302859558/8.0),
- REAL_CONST(52655.008882847229/8.0),
- REAL_CONST(52675.20739969227/8.0),
- REAL_CONST(52695.407853023295/8.0),
- REAL_CONST(52715.610242469098/8.0),
- REAL_CONST(52735.814567658657/8.0),
- REAL_CONST(52756.02082822111/8.0),
- REAL_CONST(52776.229023785803/8.0),
- REAL_CONST(52796.439153982225/8.0),
- REAL_CONST(52816.651218440056/8.0),
- REAL_CONST(52836.865216789171/8.0),
- REAL_CONST(52857.081148659599/8.0),
- REAL_CONST(52877.29901368155/8.0),
- REAL_CONST(52897.518811485425/8.0),
- REAL_CONST(52917.740541701773/8.0),
- REAL_CONST(52937.964203961354/8.0),
- REAL_CONST(52958.18979789508/8.0),
- REAL_CONST(52978.417323134046/8.0),
- REAL_CONST(52998.646779309529/8.0),
- REAL_CONST(53018.878166052978/8.0),
- REAL_CONST(53039.111482996006/8.0),
- REAL_CONST(53059.346729770419/8.0),
- REAL_CONST(53079.583906008193/8.0),
- REAL_CONST(53099.823011341483/8.0),
- REAL_CONST(53120.0640454026/8.0),
- REAL_CONST(53140.307007824063/8.0),
- REAL_CONST(53160.551898238533/8.0),
- REAL_CONST(53180.79871627887/8.0),
- REAL_CONST(53201.047461578091/8.0),
- REAL_CONST(53221.2981337694/8.0),
- REAL_CONST(53241.550732486176/8.0),
- REAL_CONST(53261.805257361964/8.0),
- REAL_CONST(53282.061708030487/8.0),
- REAL_CONST(53302.32008412564/8.0),
- REAL_CONST(53322.580385281493/8.0),
- REAL_CONST(53342.842611132299/8.0),
- REAL_CONST(53363.106761312469/8.0),
- REAL_CONST(53383.372835456597/8.0),
- REAL_CONST(53403.640833199453/8.0),
- REAL_CONST(53423.910754175973/8.0),
- REAL_CONST(53444.18259802126/8.0),
- REAL_CONST(53464.456364370613/8.0),
- REAL_CONST(53484.732052859479/8.0),
- REAL_CONST(53505.009663123499/8.0),
- REAL_CONST(53525.289194798468/8.0),
- REAL_CONST(53545.570647520362/8.0),
- REAL_CONST(53565.854020925333/8.0),
- REAL_CONST(53586.139314649699/8.0),
- REAL_CONST(53606.426528329954/8.0),
- REAL_CONST(53626.715661602764/8.0),
- REAL_CONST(53647.006714104959/8.0),
- REAL_CONST(53667.299685473547/8.0),
- REAL_CONST(53687.59457534572/8.0),
- REAL_CONST(53707.891383358816/8.0),
- REAL_CONST(53728.190109150361/8.0),
- REAL_CONST(53748.490752358055/8.0),
- REAL_CONST(53768.793312619753/8.0),
- REAL_CONST(53789.09778957349/8.0),
- REAL_CONST(53809.404182857485/8.0),
- REAL_CONST(53829.712492110106/8.0),
- REAL_CONST(53850.022716969899/8.0),
- REAL_CONST(53870.334857075584/8.0),
- REAL_CONST(53890.648912066055/8.0),
- REAL_CONST(53910.964881580367/8.0),
- REAL_CONST(53931.28276525774/8.0),
- REAL_CONST(53951.602562737586/8.0),
- REAL_CONST(53971.924273659461/8.0),
- REAL_CONST(53992.24789766311/8.0),
- REAL_CONST(54012.57343438844/8.0),
- REAL_CONST(54032.90088347553/8.0),
- REAL_CONST(54053.23024456462/8.0),
- REAL_CONST(54073.561517296133/8.0),
- REAL_CONST(54093.894701310644/8.0),
- REAL_CONST(54114.22979624891/8.0),
- REAL_CONST(54134.566801751855/8.0),
- REAL_CONST(54154.90571746057/8.0),
- REAL_CONST(54175.246543016314/8.0),
- REAL_CONST(54195.589278060506/8.0),
- REAL_CONST(54215.933922234755/8.0),
- REAL_CONST(54236.280475180814/8.0),
- REAL_CONST(54256.628936540626/8.0),
- REAL_CONST(54276.97930595628/8.0),
- REAL_CONST(54297.331583070045/8.0),
- REAL_CONST(54317.685767524359/8.0),
- REAL_CONST(54338.041858961828/8.0),
- REAL_CONST(54358.399857025215/8.0),
- REAL_CONST(54378.759761357462/8.0),
- REAL_CONST(54399.121571601667/8.0),
- REAL_CONST(54419.485287401105/8.0),
- REAL_CONST(54439.850908399218/8.0),
- REAL_CONST(54460.218434239614/8.0),
- REAL_CONST(54480.587864566056/8.0),
- REAL_CONST(54500.95919902248/8.0),
- REAL_CONST(54521.332437252997/8.0),
- REAL_CONST(54541.707578901878/8.0),
- REAL_CONST(54562.084623613555/8.0),
- REAL_CONST(54582.46357103264/8.0),
- REAL_CONST(54602.844420803893/8.0),
- REAL_CONST(54623.227172572246/8.0),
- REAL_CONST(54643.611825982807/8.0),
- REAL_CONST(54663.998380680838/8.0),
- REAL_CONST(54684.386836311773/8.0),
- REAL_CONST(54704.777192521207/8.0),
- REAL_CONST(54725.169448954897/8.0),
- REAL_CONST(54745.563605258772/8.0),
- REAL_CONST(54765.959661078923/8.0),
- REAL_CONST(54786.357616061614/8.0),
- REAL_CONST(54806.757469853255/8.0),
- REAL_CONST(54827.159222100439/8.0),
- REAL_CONST(54847.562872449904/8.0),
- REAL_CONST(54867.968420548583/8.0),
- REAL_CONST(54888.375866043534/8.0),
- REAL_CONST(54908.785208582012/8.0),
- REAL_CONST(54929.196447811417/8.0),
- REAL_CONST(54949.609583379322/8.0),
- REAL_CONST(54970.024614933463/8.0),
- REAL_CONST(54990.441542121727/8.0),
- REAL_CONST(55010.86036459219/8.0),
- REAL_CONST(55031.28108199306/8.0),
- REAL_CONST(55051.703693972733/8.0),
- REAL_CONST(55072.128200179759/8.0),
- REAL_CONST(55092.554600262847/8.0),
- REAL_CONST(55112.982893870874/8.0),
- REAL_CONST(55133.413080652877/8.0),
- REAL_CONST(55153.845160258061/8.0),
- REAL_CONST(55174.279132335789/8.0),
- REAL_CONST(55194.714996535586/8.0),
- REAL_CONST(55215.152752507143/8.0),
- REAL_CONST(55235.592399900306/8.0),
- REAL_CONST(55256.033938365079/8.0),
- REAL_CONST(55276.477367551655/8.0),
- REAL_CONST(55296.92268711036/8.0),
- REAL_CONST(55317.369896691685/8.0),
- REAL_CONST(55337.818995946305/8.0),
- REAL_CONST(55358.269984525024/8.0),
- REAL_CONST(55378.72286207883/8.0),
- REAL_CONST(55399.177628258869/8.0),
- REAL_CONST(55419.634282716441/8.0),
- REAL_CONST(55440.092825103013/8.0),
- REAL_CONST(55460.553255070205/8.0),
- REAL_CONST(55481.015572269804/8.0),
- REAL_CONST(55501.479776353764/8.0),
- REAL_CONST(55521.945866974187/8.0),
- REAL_CONST(55542.413843783339/8.0),
- REAL_CONST(55562.883706433655/8.0),
- REAL_CONST(55583.355454577715/8.0),
- REAL_CONST(55603.82908786826/8.0),
- REAL_CONST(55624.304605958219/8.0),
- REAL_CONST(55644.782008500639/8.0),
- REAL_CONST(55665.261295148754/8.0),
- REAL_CONST(55685.742465555952/8.0),
- REAL_CONST(55706.225519375774/8.0),
- REAL_CONST(55726.710456261928/8.0),
- REAL_CONST(55747.197275868275/8.0),
- REAL_CONST(55767.685977848843/8.0),
- REAL_CONST(55788.176561857814/8.0),
- REAL_CONST(55808.669027549528/8.0),
- REAL_CONST(55829.163374578478/8.0),
- REAL_CONST(55849.659602599328/8.0),
- REAL_CONST(55870.157711266889/8.0),
- REAL_CONST(55890.657700236145/8.0),
- REAL_CONST(55911.159569162221/8.0),
- REAL_CONST(55931.663317700411/8.0),
- REAL_CONST(55952.168945506164/8.0),
- REAL_CONST(55972.676452235086/8.0),
- REAL_CONST(55993.185837542944/8.0),
- REAL_CONST(56013.697101085651/8.0),
- REAL_CONST(56034.210242519301/8.0),
- REAL_CONST(56054.72526150012/8.0),
- REAL_CONST(56075.242157684508/8.0),
- REAL_CONST(56095.760930729011/8.0),
- REAL_CONST(56116.281580290342/8.0),
- REAL_CONST(56136.804106025367/8.0),
- REAL_CONST(56157.328507591104/8.0),
- REAL_CONST(56177.85478464474/8.0),
- REAL_CONST(56198.382936843598/8.0),
- REAL_CONST(56218.912963845185/8.0),
- REAL_CONST(56239.444865307138/8.0),
- REAL_CONST(56259.978640887268/8.0),
- REAL_CONST(56280.514290243525/8.0),
- REAL_CONST(56301.051813034042/8.0),
- REAL_CONST(56321.591208917082/8.0),
- REAL_CONST(56342.13247755108/8.0),
- REAL_CONST(56362.675618594607/8.0),
- REAL_CONST(56383.220631706419/8.0),
- REAL_CONST(56403.767516545398/8.0),
- REAL_CONST(56424.316272770608/8.0),
- REAL_CONST(56444.866900041241/8.0),
- REAL_CONST(56465.419398016667/8.0),
- REAL_CONST(56485.973766356394/8.0),
- REAL_CONST(56506.530004720102/8.0),
- REAL_CONST(56527.088112767611/8.0),
- REAL_CONST(56547.648090158902/8.0),
- REAL_CONST(56568.209936554107/8.0),
- REAL_CONST(56588.773651613519/8.0),
- REAL_CONST(56609.339234997584/8.0),
- REAL_CONST(56629.9066863669/8.0),
- REAL_CONST(56650.47600538221/8.0),
- REAL_CONST(56671.04719170442/8.0),
- REAL_CONST(56691.620244994599/8.0),
- REAL_CONST(56712.195164913959/8.0),
- REAL_CONST(56732.771951123868/8.0),
- REAL_CONST(56753.350603285835/8.0),
- REAL_CONST(56773.931121061541/8.0),
- REAL_CONST(56794.513504112823/8.0),
- REAL_CONST(56815.097752101647/8.0),
- REAL_CONST(56835.683864690152/8.0),
- REAL_CONST(56856.271841540627/8.0),
- REAL_CONST(56876.86168231551/8.0),
- REAL_CONST(56897.453386677393/8.0),
- REAL_CONST(56918.046954289028/8.0),
- REAL_CONST(56938.642384813298/8.0),
- REAL_CONST(56959.239677913261/8.0),
- REAL_CONST(56979.838833252121/8.0),
- REAL_CONST(57000.439850493225/8.0),
- REAL_CONST(57021.04272930009/8.0),
- REAL_CONST(57041.647469336371/8.0),
- REAL_CONST(57062.254070265873/8.0),
- REAL_CONST(57082.862531752558/8.0),
- REAL_CONST(57103.472853460553/8.0),
- REAL_CONST(57124.085035054108/8.0),
- REAL_CONST(57144.699076197649/8.0),
- REAL_CONST(57165.314976555739/8.0),
- REAL_CONST(57185.932735793103/8.0),
- REAL_CONST(57206.552353574611/8.0),
- REAL_CONST(57227.173829565276/8.0),
- REAL_CONST(57247.797163430281/8.0),
- REAL_CONST(57268.42235483494/8.0),
- REAL_CONST(57289.049403444733/8.0),
- REAL_CONST(57309.678308925286/8.0),
- REAL_CONST(57330.30907094237/8.0),
- REAL_CONST(57350.941689161911/8.0),
- REAL_CONST(57371.576163249985/8.0),
- REAL_CONST(57392.212492872815/8.0),
- REAL_CONST(57412.850677696784/8.0),
- REAL_CONST(57433.490717388406/8.0),
- REAL_CONST(57454.132611614368/8.0),
- REAL_CONST(57474.776360041491/8.0),
- REAL_CONST(57495.421962336746/8.0),
- REAL_CONST(57516.069418167266/8.0),
- REAL_CONST(57536.718727200314/8.0),
- REAL_CONST(57557.36988910332/8.0),
- REAL_CONST(57578.022903543861/8.0),
- REAL_CONST(57598.677770189643/8.0),
- REAL_CONST(57619.334488708548/8.0),
- REAL_CONST(57639.993058768589/8.0),
- REAL_CONST(57660.653480037938/8.0),
- REAL_CONST(57681.315752184906/8.0),
- REAL_CONST(57701.979874877965/8.0),
- REAL_CONST(57722.64584778573/8.0),
- REAL_CONST(57743.31367057695/8.0),
- REAL_CONST(57763.983342920546/8.0),
- REAL_CONST(57784.654864485572/8.0),
- REAL_CONST(57805.328234941233/8.0),
- REAL_CONST(57826.003453956881/8.0),
- REAL_CONST(57846.680521202026/8.0),
- REAL_CONST(57867.359436346305/8.0),
- REAL_CONST(57888.040199059527/8.0),
- REAL_CONST(57908.722809011633/8.0),
- REAL_CONST(57929.407265872709/8.0),
- REAL_CONST(57950.093569313001/8.0),
- REAL_CONST(57970.781719002895/8.0),
- REAL_CONST(57991.471714612911/8.0),
- REAL_CONST(58012.16355581375/8.0),
- REAL_CONST(58032.857242276223/8.0),
- REAL_CONST(58053.552773671312/8.0),
- REAL_CONST(58074.25014967013/8.0),
- REAL_CONST(58094.949369943948/8.0),
- REAL_CONST(58115.650434164185/8.0),
- REAL_CONST(58136.353342002389/8.0),
- REAL_CONST(58157.058093130276/8.0),
- REAL_CONST(58177.764687219693/8.0),
- REAL_CONST(58198.47312394264/8.0),
- REAL_CONST(58219.183402971255/8.0),
- REAL_CONST(58239.895523977837/8.0),
- REAL_CONST(58260.609486634821/8.0),
- REAL_CONST(58281.325290614775/8.0),
- REAL_CONST(58302.042935590434/8.0),
- REAL_CONST(58322.762421234678/8.0),
- REAL_CONST(58343.483747220511/8.0),
- REAL_CONST(58364.206913221096/8.0),
- REAL_CONST(58384.931918909751/8.0),
- REAL_CONST(58405.658763959924/8.0),
- REAL_CONST(58426.3874480452/8.0),
- REAL_CONST(58447.117970839339/8.0),
- REAL_CONST(58467.85033201622/8.0),
- REAL_CONST(58488.584531249864/8.0),
- REAL_CONST(58509.320568214462/8.0),
- REAL_CONST(58530.058442584334/8.0),
- REAL_CONST(58550.798154033931/8.0),
- REAL_CONST(58571.539702237875/8.0),
- REAL_CONST(58592.283086870906/8.0),
- REAL_CONST(58613.028307607929/8.0),
- REAL_CONST(58633.775364123983/8.0),
- REAL_CONST(58654.52425609425/8.0),
- REAL_CONST(58675.274983194053/8.0),
- REAL_CONST(58696.027545098877/8.0),
- REAL_CONST(58716.781941484325/8.0),
- REAL_CONST(58737.538172026158/8.0),
- REAL_CONST(58758.296236400274/8.0),
- REAL_CONST(58779.056134282728/8.0),
- REAL_CONST(58799.817865349694/8.0),
- REAL_CONST(58820.581429277503/8.0),
- REAL_CONST(58841.346825742643/8.0),
- REAL_CONST(58862.114054421712/8.0),
- REAL_CONST(58882.883114991484/8.0),
- REAL_CONST(58903.654007128847/8.0),
- REAL_CONST(58924.426730510851/8.0),
- REAL_CONST(58945.201284814684/8.0),
- REAL_CONST(58965.977669717664/8.0),
- REAL_CONST(58986.755884897269/8.0),
- REAL_CONST(59007.535930031117/8.0),
- REAL_CONST(59028.317804796949/8.0),
- REAL_CONST(59049.101508872664/8.0),
- REAL_CONST(59069.887041936301/8.0),
- REAL_CONST(59090.674403666046/8.0),
- REAL_CONST(59111.463593740213/8.0),
- REAL_CONST(59132.254611837263/8.0),
- REAL_CONST(59153.047457635803/8.0),
- REAL_CONST(59173.84213081457/8.0),
- REAL_CONST(59194.638631052461/8.0),
- REAL_CONST(59215.436958028506/8.0),
- REAL_CONST(59236.237111421855/8.0),
- REAL_CONST(59257.039090911829/8.0),
- REAL_CONST(59277.842896177877/8.0),
- REAL_CONST(59298.648526899589/8.0),
- REAL_CONST(59319.455982756685/8.0),
- REAL_CONST(59340.26526342905/8.0),
- REAL_CONST(59361.076368596696/8.0),
- REAL_CONST(59381.889297939757/8.0),
- REAL_CONST(59402.704051138542/8.0),
- REAL_CONST(59423.520627873484/8.0),
- REAL_CONST(59444.339027825139/8.0),
- REAL_CONST(59465.159250674224/8.0),
- REAL_CONST(59485.9812961016/8.0),
- REAL_CONST(59506.805163788253/8.0),
- REAL_CONST(59527.630853415307/8.0),
- REAL_CONST(59548.458364664046/8.0),
- REAL_CONST(59569.287697215863/8.0),
- REAL_CONST(59590.118850752311/8.0),
- REAL_CONST(59610.951824955089/8.0),
- REAL_CONST(59631.786619506012/8.0),
- REAL_CONST(59652.623234087048/8.0),
- REAL_CONST(59673.461668380311/8.0),
- REAL_CONST(59694.301922068029/8.0),
- REAL_CONST(59715.143994832593/8.0),
- REAL_CONST(59735.987886356525/8.0),
- REAL_CONST(59756.833596322482/8.0),
- REAL_CONST(59777.681124413255/8.0),
- REAL_CONST(59798.530470311794/8.0),
- REAL_CONST(59819.381633701159/8.0),
- REAL_CONST(59840.234614264569/8.0),
- REAL_CONST(59861.089411685381/8.0),
- REAL_CONST(59881.94602564707/8.0),
- REAL_CONST(59902.804455833269/8.0),
- REAL_CONST(59923.664701927737/8.0),
- REAL_CONST(59944.526763614384/8.0),
- REAL_CONST(59965.390640577243/8.0),
- REAL_CONST(59986.256332500488/8.0),
- REAL_CONST(60007.123839068438/8.0),
- REAL_CONST(60027.993159965539/8.0),
- REAL_CONST(60048.864294876381/8.0),
- REAL_CONST(60069.737243485688/8.0),
- REAL_CONST(60090.612005478324/8.0),
- REAL_CONST(60111.488580539284/8.0),
- REAL_CONST(60132.366968353708/8.0),
- REAL_CONST(60153.247168606867/8.0),
- REAL_CONST(60174.129180984164/8.0),
- REAL_CONST(60195.013005171153/8.0),
- REAL_CONST(60215.898640853513/8.0),
- REAL_CONST(60236.786087717061/8.0),
- REAL_CONST(60257.675345447751/8.0),
- REAL_CONST(60278.566413731671/8.0),
- REAL_CONST(60299.459292255044/8.0),
- REAL_CONST(60320.353980704247/8.0),
- REAL_CONST(60341.25047876576/8.0),
- REAL_CONST(60362.148786126229/8.0),
- REAL_CONST(60383.048902472423/8.0),
- REAL_CONST(60403.950827491237/8.0),
- REAL_CONST(60424.854560869717/8.0),
- REAL_CONST(60445.76010229504/8.0),
- REAL_CONST(60466.667451454516/8.0),
- REAL_CONST(60487.57660803559/8.0),
- REAL_CONST(60508.487571725847/8.0),
- REAL_CONST(60529.400342212997/8.0),
- REAL_CONST(60550.314919184893/8.0),
- REAL_CONST(60571.231302329521/8.0),
- REAL_CONST(60592.149491335003/8.0),
- REAL_CONST(60613.069485889588/8.0),
- REAL_CONST(60633.991285681674/8.0),
- REAL_CONST(60654.914890399785/8.0),
- REAL_CONST(60675.840299732568/8.0),
- REAL_CONST(60696.767513368832/8.0),
- REAL_CONST(60717.696530997484/8.0),
- REAL_CONST(60738.627352307602/8.0),
- REAL_CONST(60759.55997698837/8.0),
- REAL_CONST(60780.494404729128/8.0),
- REAL_CONST(60801.430635219323/8.0),
- REAL_CONST(60822.368668148556/8.0),
- REAL_CONST(60843.308503206565/8.0),
- REAL_CONST(60864.250140083204/8.0),
- REAL_CONST(60885.193578468468/8.0),
- REAL_CONST(60906.138818052495/8.0),
- REAL_CONST(60927.085858525541/8.0),
- REAL_CONST(60948.034699578006/8.0),
- REAL_CONST(60968.985340900421/8.0),
- REAL_CONST(60989.937782183442/8.0),
- REAL_CONST(61010.892023117864/8.0),
- REAL_CONST(61031.848063394616/8.0),
- REAL_CONST(61052.805902704764/8.0),
- REAL_CONST(61073.765540739492/8.0),
- REAL_CONST(61094.726977190134/8.0),
- REAL_CONST(61115.690211748137/8.0),
- REAL_CONST(61136.655244105103/8.0),
- REAL_CONST(61157.622073952742/8.0),
- REAL_CONST(61178.590700982917/8.0),
- REAL_CONST(61199.561124887616/8.0),
- REAL_CONST(61220.533345358948/8.0),
- REAL_CONST(61241.507362089171/8.0),
- REAL_CONST(61262.483174770663/8.0),
- REAL_CONST(61283.460783095943/8.0),
- REAL_CONST(61304.440186757645/8.0),
- REAL_CONST(61325.421385448557/8.0),
- REAL_CONST(61346.404378861582/8.0),
- REAL_CONST(61367.389166689762/8.0),
- REAL_CONST(61388.375748626262/8.0),
- REAL_CONST(61409.364124364387/8.0),
- REAL_CONST(61430.354293597571/8.0),
- REAL_CONST(61451.346256019373/8.0),
- REAL_CONST(61472.340011323497/8.0),
- REAL_CONST(61493.335559203762/8.0),
- REAL_CONST(61514.332899354122/8.0),
- REAL_CONST(61535.332031468672/8.0),
- REAL_CONST(61556.332955241618/8.0),
- REAL_CONST(61577.335670367313/8.0),
- REAL_CONST(61598.340176540238/8.0),
- REAL_CONST(61619.346473454993/8.0),
- REAL_CONST(61640.354560806329/8.0),
- REAL_CONST(61661.3644382891/8.0),
- REAL_CONST(61682.376105598312/8.0),
- REAL_CONST(61703.389562429089/8.0),
- REAL_CONST(61724.404808476691/8.0),
- REAL_CONST(61745.42184343651/8.0),
- REAL_CONST(61766.440667004063/8.0),
- REAL_CONST(61787.461278874987/8.0),
- REAL_CONST(61808.483678745069/8.0),
- REAL_CONST(61829.507866310203/8.0),
- REAL_CONST(61850.533841266435/8.0),
- REAL_CONST(61871.561603309929/8.0),
- REAL_CONST(61892.591152136971/8.0),
- REAL_CONST(61913.622487443987/8.0),
- REAL_CONST(61934.655608927525/8.0),
- REAL_CONST(61955.690516284267/8.0),
- REAL_CONST(61976.727209211022/8.0),
- REAL_CONST(61997.765687404724/8.0),
- REAL_CONST(62018.805950562448/8.0),
- REAL_CONST(62039.847998381381/8.0),
- REAL_CONST(62060.891830558845/8.0),
- REAL_CONST(62081.93744679229/8.0),
- REAL_CONST(62102.984846779298/8.0),
- REAL_CONST(62124.034030217575/8.0),
- REAL_CONST(62145.084996804966/8.0),
- REAL_CONST(62166.137746239416/8.0),
- REAL_CONST(62187.19227821903/8.0),
- REAL_CONST(62208.248592442025/8.0),
- REAL_CONST(62229.306688606739/8.0),
- REAL_CONST(62250.366566411656/8.0),
- REAL_CONST(62271.428225555377/8.0),
- REAL_CONST(62292.491665736627/8.0),
- REAL_CONST(62313.556886654267/8.0),
- REAL_CONST(62334.623888007271/8.0),
- REAL_CONST(62355.692669494762/8.0),
- REAL_CONST(62376.763230815974/8.0),
- REAL_CONST(62397.835571670272/8.0),
- REAL_CONST(62418.909691757144/8.0),
- REAL_CONST(62439.98559077621/8.0),
- REAL_CONST(62461.063268427228/8.0),
- REAL_CONST(62482.142724410049/8.0),
- REAL_CONST(62503.223958424685/8.0),
- REAL_CONST(62524.306970171267/8.0),
- REAL_CONST(62545.39175935003/8.0),
- REAL_CONST(62566.478325661366/8.0),
- REAL_CONST(62587.566668805768/8.0),
- REAL_CONST(62608.656788483881/8.0),
- REAL_CONST(62629.748684396451/8.0),
- REAL_CONST(62650.842356244357/8.0),
- REAL_CONST(62671.937803728622/8.0),
- REAL_CONST(62693.035026550366/8.0),
- REAL_CONST(62714.134024410858/8.0),
- REAL_CONST(62735.234797011479/8.0),
- REAL_CONST(62756.337344053733/8.0),
- REAL_CONST(62777.441665239276/8.0),
- REAL_CONST(62798.547760269852/8.0),
- REAL_CONST(62819.655628847358/8.0),
- REAL_CONST(62840.765270673801/8.0),
- REAL_CONST(62861.876685451323/8.0),
- REAL_CONST(62882.989872882186/8.0),
- REAL_CONST(62904.104832668774/8.0),
- REAL_CONST(62925.221564513602/8.0),
- REAL_CONST(62946.340068119309/8.0),
- REAL_CONST(62967.460343188657/8.0),
- REAL_CONST(62988.582389424526/8.0),
- REAL_CONST(63009.70620652994/8.0),
- REAL_CONST(63030.831794208025/8.0),
- REAL_CONST(63051.959152162039/8.0),
- REAL_CONST(63073.08828009537/8.0),
- REAL_CONST(63094.219177711529/8.0),
- REAL_CONST(63115.351844714154/8.0),
- REAL_CONST(63136.486280806988/8.0),
- REAL_CONST(63157.622485693922/8.0),
- REAL_CONST(63178.760459078956/8.0),
- REAL_CONST(63199.900200666219/8.0),
- REAL_CONST(63221.041710159967/8.0),
- REAL_CONST(63242.184987264569/8.0),
- REAL_CONST(63263.330031684534/8.0),
- REAL_CONST(63284.476843124474/8.0),
- REAL_CONST(63305.625421289144/8.0),
- REAL_CONST(63326.775765883409/8.0),
- REAL_CONST(63347.927876612259/8.0),
- REAL_CONST(63369.081753180813/8.0),
- REAL_CONST(63390.237395294316/8.0),
- REAL_CONST(63411.39480265812/8.0),
- REAL_CONST(63432.553974977716/8.0),
- REAL_CONST(63453.714911958712/8.0),
- REAL_CONST(63474.877613306839/8.0),
- REAL_CONST(63496.042078727944/8.0),
- REAL_CONST(63517.208307927998/8.0),
- REAL_CONST(63538.376300613119/8.0),
- REAL_CONST(63559.546056489504/8.0),
- REAL_CONST(63580.717575263516/8.0),
- REAL_CONST(63601.890856641607/8.0),
- REAL_CONST(63623.065900330374/8.0),
- REAL_CONST(63644.242706036515/8.0),
- REAL_CONST(63665.421273466869/8.0),
- REAL_CONST(63686.601602328381/8.0),
- REAL_CONST(63707.783692328136/8.0),
- REAL_CONST(63728.967543173334/8.0),
- REAL_CONST(63750.153154571279/8.0),
- REAL_CONST(63771.340526229418/8.0),
- REAL_CONST(63792.529657855317/8.0),
- REAL_CONST(63813.720549156649/8.0),
- REAL_CONST(63834.913199841227/8.0),
- REAL_CONST(63856.107609616978/8.0),
- REAL_CONST(63877.303778191941/8.0),
- REAL_CONST(63898.501705274284/8.0),
- REAL_CONST(63919.7013905723/8.0),
- REAL_CONST(63940.902833794404/8.0),
- REAL_CONST(63962.106034649114/8.0),
- REAL_CONST(63983.310992845094/8.0),
- REAL_CONST(64004.517708091109/8.0),
- REAL_CONST(64025.726180096048/8.0),
- REAL_CONST(64046.936408568938/8.0),
- REAL_CONST(64068.1483932189/8.0),
- REAL_CONST(64089.362133755196/8.0),
- REAL_CONST(64110.577629887193/8.0),
- REAL_CONST(64131.794881324393/8.0),
- REAL_CONST(64153.013887776404/8.0),
- REAL_CONST(64174.234648952966/8.0),
- REAL_CONST(64195.457164563937/8.0),
- REAL_CONST(64216.681434319289/8.0),
- REAL_CONST(64237.907457929112/8.0),
- REAL_CONST(64259.135235103626/8.0),
- REAL_CONST(64280.36476555316/8.0),
- REAL_CONST(64301.596048988169/8.0),
- REAL_CONST(64322.829085119236/8.0),
- REAL_CONST(64344.06387365704/8.0),
- REAL_CONST(64365.300414312398/8.0),
- REAL_CONST(64386.538706796251/8.0),
- REAL_CONST(64407.778750819634/8.0),
- REAL_CONST(64429.020546093721/8.0),
- REAL_CONST(64450.26409232981/8.0),
- REAL_CONST(64471.509389239291/8.0),
- REAL_CONST(64492.756436533709/8.0),
- REAL_CONST(64514.005233924705/8.0),
- REAL_CONST(64535.255781124033/8.0),
- REAL_CONST(64556.50807784358/8.0),
- REAL_CONST(64577.762123795357/8.0),
- REAL_CONST(64599.017918691468/8.0),
- REAL_CONST(64620.275462244172/8.0),
- REAL_CONST(64641.534754165805/8.0),
- REAL_CONST(64662.795794168844/8.0),
- REAL_CONST(64684.058581965895/8.0),
- REAL_CONST(64705.323117269661/8.0),
- REAL_CONST(64726.589399792974/8.0),
- REAL_CONST(64747.857429248776/8.0),
- REAL_CONST(64769.127205350138/8.0),
- REAL_CONST(64790.398727810236/8.0),
- REAL_CONST(64811.671996342375/8.0),
- REAL_CONST(64832.947010659969/8.0),
- REAL_CONST(64854.223770476558/8.0),
- REAL_CONST(64875.502275505794/8.0),
- REAL_CONST(64896.782525461451/8.0),
- REAL_CONST(64918.064520057414/8.0),
- REAL_CONST(64939.348259007682/8.0),
- REAL_CONST(64960.633742026388/8.0),
- REAL_CONST(64981.920968827762/8.0),
- REAL_CONST(65003.209939126165/8.0),
- REAL_CONST(65024.500652636067/8.0),
- REAL_CONST(65045.793109072067/8.0),
- REAL_CONST(65067.087308148861/8.0),
- REAL_CONST(65088.383249581282/8.0),
- REAL_CONST(65109.680933084259/8.0),
- REAL_CONST(65130.980358372864/8.0),
- REAL_CONST(65152.28152516226/8.0),
- REAL_CONST(65173.584433167736/8.0),
- REAL_CONST(65194.889082104703/8.0),
- REAL_CONST(65216.195471688683/8.0),
- REAL_CONST(65237.503601635319/8.0),
- REAL_CONST(65258.813471660353/8.0),
- REAL_CONST(65280.125081479666/8.0),
- REAL_CONST(65301.438430809241/8.0),
- REAL_CONST(65322.753519365178/8.0),
- REAL_CONST(65344.070346863708/8.0),
- REAL_CONST(65365.388913021146/8.0),
- REAL_CONST(65386.709217553958/8.0),
- REAL_CONST(65408.031260178701/8.0),
- REAL_CONST(65429.355040612056/8.0),
- REAL_CONST(65450.680558570821/8.0),
- REAL_CONST(65472.00781377191/8.0),
- REAL_CONST(65493.336805932355/8.0),
- REAL_CONST(65514.66753476928/8.0),
- REAL_CONST(65535.999999999956/8.0),
- REAL_CONST(65557.334201341757/8.0),
- REAL_CONST(65578.670138512171/8.0),
- REAL_CONST(65600.007811228788/8.0),
- REAL_CONST(65621.347219209332/8.0),
- REAL_CONST(65642.688362171626/8.0),
- REAL_CONST(65664.031239833639/8.0),
- REAL_CONST(65685.375851913413/8.0),
- REAL_CONST(65706.722198129137/8.0),
- REAL_CONST(65728.070278199084/8.0),
- REAL_CONST(65749.420091841661/8.0),
- REAL_CONST(65770.771638775404/8.0),
- REAL_CONST(65792.124918718939/8.0),
- REAL_CONST(65813.479931391004/8.0),
- REAL_CONST(65834.836676510458/8.0),
- REAL_CONST(65856.195153796303/8.0),
- REAL_CONST(65877.5553629676/8.0),
- REAL_CONST(65898.917303743554/8.0),
- REAL_CONST(65920.280975843489/8.0),
- REAL_CONST(65941.646378986843/8.0),
- REAL_CONST(65963.013512893158/8.0),
- REAL_CONST(65984.382377282076/8.0),
- REAL_CONST(66005.752971873386/8.0),
- REAL_CONST(66027.125296386963/8.0),
- REAL_CONST(66048.499350542799/8.0),
- REAL_CONST(66069.875134061018/8.0),
- REAL_CONST(66091.252646661844/8.0),
- REAL_CONST(66112.631888065618/8.0),
- REAL_CONST(66134.01285799277/8.0),
- REAL_CONST(66155.395556163887/8.0),
- REAL_CONST(66176.779982299631/8.0),
- REAL_CONST(66198.166136120795/8.0),
- REAL_CONST(66219.554017348273/8.0),
- REAL_CONST(66240.943625703105/8.0),
- REAL_CONST(66262.334960906388/8.0),
- REAL_CONST(66283.728022679396/8.0),
- REAL_CONST(66305.122810743444/8.0),
- REAL_CONST(66326.519324820023/8.0),
- REAL_CONST(66347.917564630698/8.0),
- REAL_CONST(66369.317529897162/8.0),
- REAL_CONST(66390.719220341227/8.0),
- REAL_CONST(66412.122635684791/8.0),
- REAL_CONST(66433.527775649884/8.0),
- REAL_CONST(66454.934639958636/8.0),
- REAL_CONST(66476.343228333324/8.0),
- REAL_CONST(66497.753540496284/8.0),
- REAL_CONST(66519.165576169995/8.0),
- REAL_CONST(66540.57933507704/8.0),
- REAL_CONST(66561.994816940118/8.0),
- REAL_CONST(66583.412021482043/8.0),
- REAL_CONST(66604.830948425733/8.0),
- REAL_CONST(66626.251597494222/8.0),
- REAL_CONST(66647.673968410629/8.0),
- REAL_CONST(66669.098060898235/8.0),
- REAL_CONST(66690.523874680381/8.0),
- REAL_CONST(66711.951409480564/8.0),
- REAL_CONST(66733.380665022371/8.0),
- REAL_CONST(66754.811641029475/8.0),
- REAL_CONST(66776.244337225711/8.0),
- REAL_CONST(66797.678753334985/8.0),
- REAL_CONST(66819.11488908132/8.0),
- REAL_CONST(66840.552744188884/8.0),
- REAL_CONST(66861.992318381905/8.0),
- REAL_CONST(66883.433611384738/8.0),
- REAL_CONST(66904.876622921889/8.0),
- REAL_CONST(66926.321352717903/8.0),
- REAL_CONST(66947.767800497502/8.0),
- REAL_CONST(66969.215965985466/8.0),
- REAL_CONST(66990.665848906734/8.0),
- REAL_CONST(67012.117448986304/8.0),
- REAL_CONST(67033.570765949335/8.0),
- REAL_CONST(67055.025799521056/8.0),
- REAL_CONST(67076.482549426815/8.0),
- REAL_CONST(67097.941015392076/8.0),
- REAL_CONST(67119.401197142433/8.0),
- REAL_CONST(67140.863094403554/8.0),
- REAL_CONST(67162.326706901222/8.0),
- REAL_CONST(67183.792034361351/8.0),
- REAL_CONST(67205.259076509959/8.0),
- REAL_CONST(67226.72783307315/8.0),
- REAL_CONST(67248.198303777172/8.0),
- REAL_CONST(67269.670488348347/8.0),
- REAL_CONST(67291.144386513144/8.0),
- REAL_CONST(67312.619997998088/8.0),
- REAL_CONST(67334.09732252988/8.0),
- REAL_CONST(67355.576359835293/8.0),
- REAL_CONST(67377.057109641188/8.0),
- REAL_CONST(67398.53957167457/8.0),
- REAL_CONST(67420.023745662547/8.0),
- REAL_CONST(67441.50963133233/8.0),
- REAL_CONST(67462.99722841123/8.0),
- REAL_CONST(67484.486536626689/8.0),
- REAL_CONST(67505.977555706224/8.0),
- REAL_CONST(67527.470285377494/8.0),
- REAL_CONST(67548.964725368263/8.0),
- REAL_CONST(67570.460875406367/8.0),
- REAL_CONST(67591.9587352198/8.0),
- REAL_CONST(67613.458304536631/8.0),
- REAL_CONST(67634.95958308503/8.0),
- REAL_CONST(67656.462570593329/8.0),
- REAL_CONST(67677.967266789899/8.0),
- REAL_CONST(67699.473671403248/8.0),
- REAL_CONST(67720.981784162024/8.0),
- REAL_CONST(67742.491604794923/8.0),
- REAL_CONST(67764.003133030797/8.0),
- REAL_CONST(67785.516368598575/8.0),
- REAL_CONST(67807.031311227314/8.0),
- REAL_CONST(67828.547960646174/8.0),
- REAL_CONST(67850.066316584402/8.0),
- REAL_CONST(67871.58637877139/8.0),
- REAL_CONST(67893.108146936589/8.0),
- REAL_CONST(67914.63162080961/8.0),
- REAL_CONST(67936.156800120138/8.0),
- REAL_CONST(67957.683684597971/8.0),
- REAL_CONST(67979.212273973011/8.0),
- REAL_CONST(68000.742567975263/8.0),
- REAL_CONST(68022.274566334876/8.0),
- REAL_CONST(68043.808268782057/8.0),
- REAL_CONST(68065.343675047145/8.0),
- REAL_CONST(68086.880784860579/8.0),
- REAL_CONST(68108.419597952918/8.0),
- REAL_CONST(68129.960114054789/8.0),
- REAL_CONST(68151.502332896969/8.0),
- REAL_CONST(68173.04625421032/8.0),
- REAL_CONST(68194.591877725834/8.0),
- REAL_CONST(68216.139203174564/8.0),
- REAL_CONST(68237.688230287706/8.0),
- REAL_CONST(68259.238958796544/8.0),
- REAL_CONST(68280.791388432481/8.0),
- REAL_CONST(68302.345518927032/8.0),
- REAL_CONST(68323.901350011787/8.0),
- REAL_CONST(68345.458881418483/8.0),
- REAL_CONST(68367.018112878912/8.0),
- REAL_CONST(68388.579044125028/8.0),
- REAL_CONST(68410.141674888844/8.0),
- REAL_CONST(68431.706004902502/8.0),
- REAL_CONST(68453.272033898262/8.0),
- REAL_CONST(68474.839761608455/8.0),
- REAL_CONST(68496.409187765545/8.0),
- REAL_CONST(68517.980312102081/8.0),
- REAL_CONST(68539.553134350732/8.0),
- REAL_CONST(68561.127654244279/8.0),
- REAL_CONST(68582.70387151558/8.0),
- REAL_CONST(68604.281785897634/8.0),
- REAL_CONST(68625.861397123503/8.0),
- REAL_CONST(68647.44270492639/8.0),
- REAL_CONST(68669.025709039604/8.0),
- REAL_CONST(68690.610409196524/8.0),
- REAL_CONST(68712.196805130661/8.0),
- REAL_CONST(68733.784896575627/8.0),
- REAL_CONST(68755.374683265123/8.0),
- REAL_CONST(68776.966164932994/8.0),
- REAL_CONST(68798.559341313128/8.0),
- REAL_CONST(68820.154212139591/8.0),
- REAL_CONST(68841.750777146473/8.0),
- REAL_CONST(68863.349036068044/8.0),
- REAL_CONST(68884.948988638629/8.0),
- REAL_CONST(68906.550634592684/8.0),
- REAL_CONST(68928.153973664739/8.0),
- REAL_CONST(68949.75900558944/8.0),
- REAL_CONST(68971.365730101577/8.0),
- REAL_CONST(68992.974146935987/8.0),
- REAL_CONST(69014.584255827634/8.0),
- REAL_CONST(69036.196056511588/8.0),
- REAL_CONST(69057.809548723017/8.0),
- REAL_CONST(69079.424732197207/8.0),
- REAL_CONST(69101.041606669532/8.0),
- REAL_CONST(69122.660171875468/8.0),
- REAL_CONST(69144.280427550606/8.0),
- REAL_CONST(69165.902373430625/8.0),
- REAL_CONST(69187.526009251334/8.0),
- REAL_CONST(69209.151334748618/8.0),
- REAL_CONST(69230.778349658474/8.0),
- REAL_CONST(69252.40705371699/8.0),
- REAL_CONST(69274.037446660412/8.0),
- REAL_CONST(69295.669528225/8.0),
- REAL_CONST(69317.303298147192/8.0),
- REAL_CONST(69338.938756163494/8.0),
- REAL_CONST(69360.575902010532/8.0),
- REAL_CONST(69382.214735425005/8.0),
- REAL_CONST(69403.855256143754/8.0),
- REAL_CONST(69425.497463903681/8.0),
- REAL_CONST(69447.141358441833/8.0),
- REAL_CONST(69468.78693949533/8.0),
- REAL_CONST(69490.434206801394/8.0),
- REAL_CONST(69512.083160097391/8.0),
- REAL_CONST(69533.733799120717/8.0),
- REAL_CONST(69555.386123608929/8.0),
- REAL_CONST(69577.04013329967/8.0),
- REAL_CONST(69598.695827930685/8.0),
- REAL_CONST(69620.353207239794/8.0),
- REAL_CONST(69642.012270964973/8.0),
- REAL_CONST(69663.67301884426/8.0),
- REAL_CONST(69685.335450615792/8.0),
- REAL_CONST(69706.999566017839/8.0),
- REAL_CONST(69728.665364788743/8.0),
- REAL_CONST(69750.332846666963/8.0),
- REAL_CONST(69772.002011391058/8.0),
- REAL_CONST(69793.672858699691/8.0),
- REAL_CONST(69815.345388331611/8.0),
- REAL_CONST(69837.019600025669/8.0),
- REAL_CONST(69858.695493520849/8.0),
- REAL_CONST(69880.373068556204/8.0),
- REAL_CONST(69902.052324870907/8.0),
- REAL_CONST(69923.733262204216/8.0),
- REAL_CONST(69945.415880295492/8.0),
- REAL_CONST(69967.100178884211/8.0),
- REAL_CONST(69988.786157709939/8.0),
- REAL_CONST(70010.473816512356/8.0),
- REAL_CONST(70032.163155031216/8.0),
- REAL_CONST(70053.854173006403/8.0),
- REAL_CONST(70075.546870177874/8.0),
- REAL_CONST(70097.241246285717/8.0),
- REAL_CONST(70118.937301070109/8.0),
- REAL_CONST(70140.635034271298/8.0),
- REAL_CONST(70162.334445629691/8.0),
- REAL_CONST(70184.035534885741/8.0),
- REAL_CONST(70205.738301780017/8.0),
- REAL_CONST(70227.442746053217/8.0),
- REAL_CONST(70249.1488674461/8.0),
- REAL_CONST(70270.856665699539/8.0),
- REAL_CONST(70292.566140554511/8.0),
- REAL_CONST(70314.277291752107/8.0),
- REAL_CONST(70335.990119033493/8.0),
- REAL_CONST(70357.704622139936/8.0),
- REAL_CONST(70379.420800812819/8.0),
- REAL_CONST(70401.138654793613/8.0),
- REAL_CONST(70422.85818382389/8.0),
- REAL_CONST(70444.579387645339/8.0),
- REAL_CONST(70466.302265999722/8.0),
- REAL_CONST(70488.026818628918/8.0),
- REAL_CONST(70509.753045274876/8.0),
- REAL_CONST(70531.480945679708/8.0),
- REAL_CONST(70553.210519585555/8.0),
- REAL_CONST(70574.941766734701/8.0),
- REAL_CONST(70596.674686869505/8.0),
- REAL_CONST(70618.409279732456/8.0),
- REAL_CONST(70640.145545066101/8.0),
- REAL_CONST(70661.883482613106/8.0),
- REAL_CONST(70683.623092116264/8.0),
- REAL_CONST(70705.364373318414/8.0),
- REAL_CONST(70727.107325962526/8.0),
- REAL_CONST(70748.851949791671/8.0),
- REAL_CONST(70770.598244549008/8.0),
- REAL_CONST(70792.346209977783/8.0),
- REAL_CONST(70814.095845821372/8.0),
- REAL_CONST(70835.847151823225/8.0),
- REAL_CONST(70857.600127726895/8.0),
- REAL_CONST(70879.354773276034/8.0),
- REAL_CONST(70901.111088214413/8.0),
- REAL_CONST(70922.869072285859/8.0),
- REAL_CONST(70944.628725234332/8.0),
- REAL_CONST(70966.390046803877/8.0),
- REAL_CONST(70988.153036738629/8.0),
- REAL_CONST(71009.917694782853/8.0),
- REAL_CONST(71031.684020680885/8.0),
- REAL_CONST(71053.45201417715/8.0),
- REAL_CONST(71075.221675016204/8.0),
- REAL_CONST(71096.993002942661/8.0),
- REAL_CONST(71118.765997701266/8.0),
- REAL_CONST(71140.540659036851/8.0),
- REAL_CONST(71162.316986694335/8.0),
- REAL_CONST(71184.09498041874/8.0),
- REAL_CONST(71205.874639955218/8.0),
- REAL_CONST(71227.655965048951/8.0),
- REAL_CONST(71249.438955445294/8.0),
- REAL_CONST(71271.223610889632/8.0),
- REAL_CONST(71293.009931127483/8.0),
- REAL_CONST(71314.797915904477/8.0),
- REAL_CONST(71336.587564966307/8.0),
- REAL_CONST(71358.378878058764/8.0),
- REAL_CONST(71380.171854927772/8.0),
- REAL_CONST(71401.966495319313/8.0),
- REAL_CONST(71423.762798979486/8.0),
- REAL_CONST(71445.560765654489/8.0),
- REAL_CONST(71467.360395090596/8.0),
- REAL_CONST(71489.161687034211/8.0),
- REAL_CONST(71510.964641231811/8.0),
- REAL_CONST(71532.769257429973/8.0),
- REAL_CONST(71554.575535375348/8.0),
- REAL_CONST(71576.383474814749/8.0),
- REAL_CONST(71598.19307549503/8.0),
- REAL_CONST(71620.004337163133/8.0),
- REAL_CONST(71641.817259566145/8.0),
- REAL_CONST(71663.631842451214/8.0),
- REAL_CONST(71685.4480855656/8.0),
- REAL_CONST(71707.26598865664/8.0),
- REAL_CONST(71729.085551471784/8.0),
- REAL_CONST(71750.906773758586/8.0),
- REAL_CONST(71772.729655264673/8.0),
- REAL_CONST(71794.554195737772/8.0),
- REAL_CONST(71816.380394925713/8.0),
- REAL_CONST(71838.208252576442/8.0),
- REAL_CONST(71860.037768437964/8.0),
- REAL_CONST(71881.868942258385/8.0),
- REAL_CONST(71903.701773785942/8.0),
- REAL_CONST(71925.536262768932/8.0),
- REAL_CONST(71947.372408955751/8.0),
- REAL_CONST(71969.210212094898/8.0),
- REAL_CONST(71991.049671934976/8.0),
- REAL_CONST(72012.890788224686/8.0),
- REAL_CONST(72034.73356071279/8.0),
- REAL_CONST(72056.577989148165/8.0),
- REAL_CONST(72078.424073279821/8.0),
- REAL_CONST(72100.271812856794/8.0),
- REAL_CONST(72122.121207628254/8.0),
- REAL_CONST(72143.97225734347/8.0),
- REAL_CONST(72165.824961751801/8.0),
- REAL_CONST(72187.679320602692/8.0),
- REAL_CONST(72209.53533364569/8.0),
- REAL_CONST(72231.393000630429/8.0),
- REAL_CONST(72253.252321306645/8.0),
- REAL_CONST(72275.113295424177/8.0),
- REAL_CONST(72296.975922732949/8.0),
- REAL_CONST(72318.840202982959/8.0),
- REAL_CONST(72340.706135924338/8.0),
- REAL_CONST(72362.573721307272/8.0),
- REAL_CONST(72384.442958882093/8.0),
- REAL_CONST(72406.313848399179/8.0),
- REAL_CONST(72428.186389609036/8.0),
- REAL_CONST(72450.060582262216/8.0),
- REAL_CONST(72471.936426109431/8.0),
- REAL_CONST(72493.813920901433/8.0),
- REAL_CONST(72515.693066389096/8.0),
- REAL_CONST(72537.573862323392/8.0),
- REAL_CONST(72559.456308455352/8.0),
- REAL_CONST(72581.340404536139/8.0),
- REAL_CONST(72603.226150316987/8.0),
- REAL_CONST(72625.113545549248/8.0),
- REAL_CONST(72647.002589984331/8.0),
- REAL_CONST(72668.893283373764/8.0),
- REAL_CONST(72690.785625469172/8.0),
- REAL_CONST(72712.679616022273/8.0),
- REAL_CONST(72734.575254784853/8.0),
- REAL_CONST(72756.472541508803/8.0),
- REAL_CONST(72778.371475946144/8.0),
- REAL_CONST(72800.272057848939/8.0),
- REAL_CONST(72822.174286969355/8.0),
- REAL_CONST(72844.07816305969/8.0),
- REAL_CONST(72865.983685872285/8.0),
- REAL_CONST(72887.890855159596/8.0),
- REAL_CONST(72909.799670674183/8.0),
- REAL_CONST(72931.710132168693/8.0),
- REAL_CONST(72953.622239395845/8.0),
- REAL_CONST(72975.535992108475/8.0),
- REAL_CONST(72997.451390059519/8.0),
- REAL_CONST(73019.368433001961/8.0),
- REAL_CONST(73041.287120688925/8.0),
- REAL_CONST(73063.207452873612/8.0),
- REAL_CONST(73085.129429309294/8.0),
- REAL_CONST(73107.053049749389/8.0),
- REAL_CONST(73128.978313947344/8.0),
- REAL_CONST(73150.905221656736/8.0),
- REAL_CONST(73172.833772631217/8.0),
- REAL_CONST(73194.763966624567/8.0),
- REAL_CONST(73216.695803390612/8.0),
- REAL_CONST(73238.62928268328/8.0),
- REAL_CONST(73260.564404256627/8.0),
- REAL_CONST(73282.501167864757/8.0),
- REAL_CONST(73304.439573261901/8.0),
- REAL_CONST(73326.379620202337/8.0),
- REAL_CONST(73348.321308440485/8.0),
- REAL_CONST(73370.264637730841/8.0),
- REAL_CONST(73392.209607827957/8.0),
- REAL_CONST(73414.156218486532/8.0),
- REAL_CONST(73436.104469461323/8.0),
- REAL_CONST(73458.054360507173/8.0),
- REAL_CONST(73480.005891379056/8.0),
- REAL_CONST(73501.959061831993/8.0),
- REAL_CONST(73523.913871621116/8.0),
- REAL_CONST(73545.870320501665/8.0),
- REAL_CONST(73567.828408228932/8.0),
- REAL_CONST(73589.78813455833/8.0),
- REAL_CONST(73611.749499245358/8.0),
- REAL_CONST(73633.712502045615/8.0),
- REAL_CONST(73655.677142714747/8.0),
- REAL_CONST(73677.643421008557/8.0),
- REAL_CONST(73699.611336682879/8.0),
- REAL_CONST(73721.580889493693/8.0),
- REAL_CONST(73743.552079197019/8.0),
- REAL_CONST(73765.524905548999/8.0),
- REAL_CONST(73787.499368305856/8.0),
- REAL_CONST(73809.475467223907/8.0),
- REAL_CONST(73831.453202059551/8.0),
- REAL_CONST(73853.432572569291/8.0),
- REAL_CONST(73875.413578509717/8.0),
- REAL_CONST(73897.396219637507/8.0),
- REAL_CONST(73919.380495709411/8.0),
- REAL_CONST(73941.36640648231/8.0),
- REAL_CONST(73963.353951713143/8.0),
- REAL_CONST(73985.343131158952/8.0),
- REAL_CONST(74007.333944576865/8.0),
- REAL_CONST(74029.326391724098/8.0),
- REAL_CONST(74051.320472357969/8.0),
- REAL_CONST(74073.316186235883/8.0),
- REAL_CONST(74095.313533115303/8.0),
- REAL_CONST(74117.312512753837/8.0),
- REAL_CONST(74139.313124909138/8.0),
- REAL_CONST(74161.315369338976/8.0),
- REAL_CONST(74183.319245801191/8.0),
- REAL_CONST(74205.324754053727/8.0),
- REAL_CONST(74227.331893854629/8.0),
- REAL_CONST(74249.340664961986/8.0),
- REAL_CONST(74271.351067134034/8.0),
- REAL_CONST(74293.363100129049/8.0),
- REAL_CONST(74315.376763705441/8.0),
- REAL_CONST(74337.392057621662/8.0),
- REAL_CONST(74359.408981636298/8.0),
- REAL_CONST(74381.427535508003/8.0),
- REAL_CONST(74403.447718995507/8.0),
- REAL_CONST(74425.469531857671/8.0),
- REAL_CONST(74447.492973853383/8.0),
- REAL_CONST(74469.518044741693/8.0),
- REAL_CONST(74491.54474428168/8.0),
- REAL_CONST(74513.573072232539/8.0),
- REAL_CONST(74535.603028353551/8.0),
- REAL_CONST(74557.634612404087/8.0),
- REAL_CONST(74579.667824143602/8.0),
- REAL_CONST(74601.702663331642/8.0),
- REAL_CONST(74623.739129727837/8.0),
- REAL_CONST(74645.777223091936/8.0),
- REAL_CONST(74667.816943183716/8.0),
- REAL_CONST(74689.858289763113/8.0),
- REAL_CONST(74711.901262590094/8.0),
- REAL_CONST(74733.945861424741/8.0),
- REAL_CONST(74755.992086027225/8.0),
- REAL_CONST(74778.039936157802/8.0),
- REAL_CONST(74800.089411576817/8.0),
- REAL_CONST(74822.140512044702/8.0),
- REAL_CONST(74844.193237321961/8.0),
- REAL_CONST(74866.24758716923/8.0),
- REAL_CONST(74888.303561347187/8.0),
- REAL_CONST(74910.36115961663/8.0),
- REAL_CONST(74932.420381738411/8.0),
- REAL_CONST(74954.481227473516/8.0),
- REAL_CONST(74976.543696582972/8.0),
- REAL_CONST(74998.607788827925/8.0),
- REAL_CONST(75020.673503969607/8.0),
- REAL_CONST(75042.740841769322/8.0),
- REAL_CONST(75064.809801988464/8.0),
- REAL_CONST(75086.88038438854/8.0),
- REAL_CONST(75108.952588731103/8.0),
- REAL_CONST(75131.026414777836/8.0),
- REAL_CONST(75153.101862290467/8.0),
- REAL_CONST(75175.178931030852/8.0),
- REAL_CONST(75197.257620760924/8.0),
- REAL_CONST(75219.33793124267/8.0),
- REAL_CONST(75241.419862238225/8.0),
- REAL_CONST(75263.503413509738/8.0),
- REAL_CONST(75285.588584819503/8.0),
- REAL_CONST(75307.675375929874/8.0),
- REAL_CONST(75329.763786603318/8.0),
- REAL_CONST(75351.853816602365/8.0),
- REAL_CONST(75373.945465689612/8.0),
- REAL_CONST(75396.038733627807/8.0),
- REAL_CONST(75418.133620179724/8.0),
- REAL_CONST(75440.230125108254/8.0),
- REAL_CONST(75462.32824817636/8.0),
- REAL_CONST(75484.427989147109/8.0),
- REAL_CONST(75506.529347783653/8.0),
- REAL_CONST(75528.63232384919/8.0),
- REAL_CONST(75550.736917107075/8.0),
- REAL_CONST(75572.843127320695/8.0),
- REAL_CONST(75594.950954253538/8.0),
- REAL_CONST(75617.060397669193/8.0),
- REAL_CONST(75639.171457331307/8.0),
- REAL_CONST(75661.284133003646/8.0),
- REAL_CONST(75683.398424450032/8.0),
- REAL_CONST(75705.514331434402/8.0),
- REAL_CONST(75727.631853720741/8.0),
- REAL_CONST(75749.750991073175/8.0),
- REAL_CONST(75771.871743255862/8.0),
- REAL_CONST(75793.994110033076/8.0),
- REAL_CONST(75816.118091169177/8.0),
- REAL_CONST(75838.243686428585/8.0),
- REAL_CONST(75860.370895575848/8.0),
- REAL_CONST(75882.499718375562/8.0),
- REAL_CONST(75904.630154592422/8.0),
- REAL_CONST(75926.762203991224/8.0),
- REAL_CONST(75948.895866336825/8.0),
- REAL_CONST(75971.031141394182/8.0),
- REAL_CONST(75993.168028928325/8.0),
- REAL_CONST(76015.306528704401/8.0),
- REAL_CONST(76037.4466404876/8.0),
- REAL_CONST(76059.588364043215/8.0),
- REAL_CONST(76081.731699136653/8.0),
- REAL_CONST(76103.876645533353/8.0),
- REAL_CONST(76126.023202998884/8.0),
- REAL_CONST(76148.171371298871/8.0),
- REAL_CONST(76170.321150199044/8.0),
- REAL_CONST(76192.472539465205/8.0),
- REAL_CONST(76214.625538863256/8.0),
- REAL_CONST(76236.780148159174/8.0),
- REAL_CONST(76258.936367119008/8.0),
- REAL_CONST(76281.094195508922/8.0),
- REAL_CONST(76303.253633095141/8.0),
- REAL_CONST(76325.414679643975/8.0),
- REAL_CONST(76347.577334921851/8.0),
- REAL_CONST(76369.741598695226/8.0),
- REAL_CONST(76391.907470730686/8.0),
- REAL_CONST(76414.074950794879/8.0),
- REAL_CONST(76436.244038654564/8.0),
- REAL_CONST(76458.414734076548/8.0),
- REAL_CONST(76480.587036827754/8.0),
- REAL_CONST(76502.760946675175/8.0),
- REAL_CONST(76524.936463385893/8.0),
- REAL_CONST(76547.11358672705/8.0),
- REAL_CONST(76569.292316465915/8.0),
- REAL_CONST(76591.472652369819/8.0),
- REAL_CONST(76613.654594206164/8.0),
- REAL_CONST(76635.838141742468/8.0),
- REAL_CONST(76658.023294746308/8.0),
- REAL_CONST(76680.210052985349/8.0),
- REAL_CONST(76702.398416227341/8.0),
- REAL_CONST(76724.588384240138/8.0),
- REAL_CONST(76746.779956791637/8.0),
- REAL_CONST(76768.973133649866/8.0),
- REAL_CONST(76791.167914582897/8.0),
- REAL_CONST(76813.364299358902/8.0),
- REAL_CONST(76835.562287746157/8.0),
- REAL_CONST(76857.761879512967/8.0),
- REAL_CONST(76879.963074427797/8.0),
- REAL_CONST(76902.165872259109/8.0),
- REAL_CONST(76924.37027277553/8.0),
- REAL_CONST(76946.576275745727/8.0),
- REAL_CONST(76968.783880938441/8.0),
- REAL_CONST(76990.993088122515/8.0),
- REAL_CONST(77013.203897066895/8.0),
- REAL_CONST(77035.416307540567/8.0),
- REAL_CONST(77057.630319312622/8.0),
- REAL_CONST(77079.845932152239/8.0),
- REAL_CONST(77102.063145828695/8.0),
- REAL_CONST(77124.281960111301/8.0),
- REAL_CONST(77146.50237476948/8.0),
- REAL_CONST(77168.724389572759/8.0),
- REAL_CONST(77190.948004290723/8.0),
- REAL_CONST(77213.173218693031/8.0),
- REAL_CONST(77235.400032549442/8.0),
- REAL_CONST(77257.628445629802/8.0),
- REAL_CONST(77279.858457704031/8.0),
- REAL_CONST(77302.090068542122/8.0),
- REAL_CONST(77324.323277914169/8.0),
- REAL_CONST(77346.558085590339/8.0),
- REAL_CONST(77368.794491340886/8.0),
- REAL_CONST(77391.032494936138/8.0),
- REAL_CONST(77413.272096146524/8.0),
- REAL_CONST(77435.51329474253/8.0),
- REAL_CONST(77457.756090494731/8.0),
- REAL_CONST(77480.000483173804/8.0),
- REAL_CONST(77502.246472550498/8.0),
- REAL_CONST(77524.494058395634/8.0),
- REAL_CONST(77546.743240480107/8.0),
- REAL_CONST(77568.994018574944/8.0),
- REAL_CONST(77591.246392451198/8.0),
- REAL_CONST(77613.500361880026/8.0),
- REAL_CONST(77635.755926632657/8.0),
- REAL_CONST(77658.013086480438/8.0),
- REAL_CONST(77680.271841194757/8.0),
- REAL_CONST(77702.532190547092/8.0),
- REAL_CONST(77724.794134309021/8.0),
- REAL_CONST(77747.057672252195/8.0),
- REAL_CONST(77769.322804148323/8.0),
- REAL_CONST(77791.589529769248/8.0),
- REAL_CONST(77813.857848886837/8.0),
- REAL_CONST(77836.127761273063/8.0),
- REAL_CONST(77858.399266699998/8.0),
- REAL_CONST(77880.67236493979/8.0),
- REAL_CONST(77902.947055764627/8.0),
- REAL_CONST(77925.223338946831/8.0),
- REAL_CONST(77947.50121425878/8.0),
- REAL_CONST(77969.780681472927/8.0),
- REAL_CONST(77992.061740361838/8.0),
- REAL_CONST(78014.344390698127/8.0),
- REAL_CONST(78036.628632254491/8.0),
- REAL_CONST(78058.914464803747/8.0),
- REAL_CONST(78081.201888118725/8.0),
- REAL_CONST(78103.490901972415/8.0),
- REAL_CONST(78125.781506137821/8.0),
- REAL_CONST(78148.073700388064/8.0),
- REAL_CONST(78170.367484496339/8.0),
- REAL_CONST(78192.662858235926/8.0),
- REAL_CONST(78214.959821380166/8.0),
- REAL_CONST(78237.258373702498/8.0),
- REAL_CONST(78259.558514976452/8.0),
- REAL_CONST(78281.860244975614/8.0),
- REAL_CONST(78304.163563473659/8.0),
- REAL_CONST(78326.468470244363/8.0),
- REAL_CONST(78348.77496506153/8.0),
- REAL_CONST(78371.083047699125/8.0),
- REAL_CONST(78393.392717931114/8.0),
- REAL_CONST(78415.703975531578/8.0),
- REAL_CONST(78438.016820274701/8.0),
- REAL_CONST(78460.331251934695/8.0),
- REAL_CONST(78482.647270285903/8.0),
- REAL_CONST(78504.964875102727/8.0),
- REAL_CONST(78527.284066159627/8.0),
- REAL_CONST(78549.604843231195/8.0),
- REAL_CONST(78571.927206092048/8.0),
- REAL_CONST(78594.251154516911/8.0),
- REAL_CONST(78616.576688280606/8.0),
- REAL_CONST(78638.903807157985/8.0),
- REAL_CONST(78661.232510924034/8.0),
- REAL_CONST(78683.562799353778/8.0),
- REAL_CONST(78705.894672222363/8.0),
- REAL_CONST(78728.228129304945/8.0),
- REAL_CONST(78750.563170376859/8.0),
- REAL_CONST(78772.899795213423/8.0),
- REAL_CONST(78795.238003590101/8.0),
- REAL_CONST(78817.577795282399/8.0),
- REAL_CONST(78839.919170065928/8.0),
- REAL_CONST(78862.262127716356/8.0),
- REAL_CONST(78884.606668009452/8.0),
- REAL_CONST(78906.952790721043/8.0),
- REAL_CONST(78929.300495627045/8.0),
- REAL_CONST(78951.64978250346/8.0),
- REAL_CONST(78974.000651126378/8.0),
- REAL_CONST(78996.353101271932/8.0),
- REAL_CONST(79018.707132716358/8.0),
- REAL_CONST(79041.062745235977/8.0),
- REAL_CONST(79063.41993860717/8.0),
- REAL_CONST(79085.778712606436/8.0),
- REAL_CONST(79108.139067010285/8.0),
- REAL_CONST(79130.501001595389/8.0),
- REAL_CONST(79152.864516138419/8.0),
- REAL_CONST(79175.22961041618/8.0),
- REAL_CONST(79197.596284205531/8.0),
- REAL_CONST(79219.96453728342/8.0),
- REAL_CONST(79242.33436942687/8.0),
- REAL_CONST(79264.705780412987/8.0),
- REAL_CONST(79287.078770018954/8.0),
- REAL_CONST(79309.453338022009/8.0),
- REAL_CONST(79331.829484199508/8.0),
- REAL_CONST(79354.207208328866/8.0),
- REAL_CONST(79376.586510187582/8.0),
- REAL_CONST(79398.967389553218/8.0),
- REAL_CONST(79421.349846203433/8.0),
- REAL_CONST(79443.733879915948/8.0),
- REAL_CONST(79466.119490468584/8.0),
- REAL_CONST(79488.50667763922/8.0),
- REAL_CONST(79510.895441205823/8.0),
- REAL_CONST(79533.285780946433/8.0),
- REAL_CONST(79555.677696639163/8.0),
- REAL_CONST(79578.071188062226/8.0),
- REAL_CONST(79600.466254993895/8.0),
- REAL_CONST(79622.862897212515/8.0),
- REAL_CONST(79645.261114496549/8.0),
- REAL_CONST(79667.660906624471/8.0),
- REAL_CONST(79690.062273374875/8.0),
- REAL_CONST(79712.465214526455/8.0),
- REAL_CONST(79734.869729857935/8.0),
- REAL_CONST(79757.275819148126/8.0),
- REAL_CONST(79779.683482175955/8.0),
- REAL_CONST(79802.092718720378/8.0),
- REAL_CONST(79824.503528560454/8.0),
- REAL_CONST(79846.915911475327/8.0),
- REAL_CONST(79869.329867244203/8.0),
- REAL_CONST(79891.745395646343/8.0),
- REAL_CONST(79914.162496461155/8.0),
- REAL_CONST(79936.581169468045/8.0),
- REAL_CONST(79959.001414446553/8.0),
- REAL_CONST(79981.423231176261/8.0),
- REAL_CONST(80003.846619436852/8.0),
- REAL_CONST(80026.271579008084/8.0),
- REAL_CONST(80048.698109669771/8.0),
- REAL_CONST(80071.12621120183/8.0),
- REAL_CONST(80093.555883384237/8.0),
- REAL_CONST(80115.987125997053/8.0),
- REAL_CONST(80138.419938820414/8.0),
- REAL_CONST(80160.854321634528/8.0),
- REAL_CONST(80183.290274219689/8.0),
- REAL_CONST(80205.727796356281/8.0),
- REAL_CONST(80228.166887824715/8.0),
- REAL_CONST(80250.607548405547/8.0),
- REAL_CONST(80273.049777879336/8.0),
- REAL_CONST(80295.493576026798/8.0),
- REAL_CONST(80317.938942628651/8.0),
- REAL_CONST(80340.385877465727/8.0),
- REAL_CONST(80362.834380318949/8.0),
- REAL_CONST(80385.28445096928/8.0),
- REAL_CONST(80407.736089197788/8.0),
- REAL_CONST(80430.189294785596/8.0),
- REAL_CONST(80452.644067513917/8.0),
- REAL_CONST(80475.100407164035/8.0),
- REAL_CONST(80497.558313517322/8.0),
- REAL_CONST(80520.017786355209/8.0),
- REAL_CONST(80542.478825459213/8.0),
- REAL_CONST(80564.941430610925/8.0),
- REAL_CONST(80587.405601592007/8.0),
- REAL_CONST(80609.871338184195/8.0),
- REAL_CONST(80632.338640169342/8.0),
- REAL_CONST(80654.8075073293/8.0),
- REAL_CONST(80677.277939446067/8.0),
- REAL_CONST(80699.749936301683/8.0),
- REAL_CONST(80722.223497678278/8.0),
- REAL_CONST(80744.698623358039/8.0),
- REAL_CONST(80767.17531312324/8.0),
- REAL_CONST(80789.653566756242/8.0),
- REAL_CONST(80812.133384039465/8.0),
- REAL_CONST(80834.614764755403/8.0),
- REAL_CONST(80857.097708686648/8.0),
- REAL_CONST(80879.582215615854/8.0),
- REAL_CONST(80902.068285325731/8.0),
- REAL_CONST(80924.555917599093/8.0),
- REAL_CONST(80947.045112218824/8.0),
- REAL_CONST(80969.535868967869/8.0),
- REAL_CONST(80992.028187629272/8.0),
- REAL_CONST(81014.522067986123/8.0),
- REAL_CONST(81037.017509821613/8.0),
- REAL_CONST(81059.514512919006/8.0),
- REAL_CONST(81082.013077061609/8.0),
- REAL_CONST(81104.513202032831/8.0),
- REAL_CONST(81127.014887616184/8.0),
- REAL_CONST(81149.518133595193/8.0),
- REAL_CONST(81172.022939753486/8.0),
- REAL_CONST(81194.529305874807/8.0),
- REAL_CONST(81217.037231742899/8.0),
- REAL_CONST(81239.546717141639/8.0),
- REAL_CONST(81262.057761854958/8.0),
- REAL_CONST(81284.570365666848/8.0),
- REAL_CONST(81307.084528361403/8.0),
- REAL_CONST(81329.600249722775/8.0),
- REAL_CONST(81352.117529535186/8.0),
- REAL_CONST(81374.636367582949/8.0),
- REAL_CONST(81397.156763650448/8.0),
- REAL_CONST(81419.678717522125/8.0),
- REAL_CONST(81442.202228982511/8.0),
- REAL_CONST(81464.727297816222/8.0),
- REAL_CONST(81487.253923807933/8.0),
- REAL_CONST(81509.782106742379/8.0),
- REAL_CONST(81532.311846404409/8.0),
- REAL_CONST(81554.843142578902/8.0),
- REAL_CONST(81577.375995050839/8.0),
- REAL_CONST(81599.910403605274/8.0),
- REAL_CONST(81622.446368027333/8.0),
- REAL_CONST(81644.983888102215/8.0),
- REAL_CONST(81667.522963615178/8.0),
- REAL_CONST(81690.063594351581/8.0),
- REAL_CONST(81712.605780096841/8.0),
- REAL_CONST(81735.149520636449/8.0),
- REAL_CONST(81757.694815755967/8.0),
- REAL_CONST(81780.241665241047/8.0),
- REAL_CONST(81802.79006887741/8.0),
- REAL_CONST(81825.340026450824/8.0),
- REAL_CONST(81847.891537747171/8.0),
- REAL_CONST(81870.444602552379/8.0),
- REAL_CONST(81892.999220652477/8.0),
- REAL_CONST(81915.555391833506/8.0),
- REAL_CONST(81938.113115881672/8.0),
- REAL_CONST(81960.672392583176/8.0),
- REAL_CONST(81983.233221724338/8.0),
- REAL_CONST(82005.795603091537/8.0),
- REAL_CONST(82028.359536471224/8.0),
- REAL_CONST(82050.925021649906/8.0),
- REAL_CONST(82073.492058414209/8.0),
- REAL_CONST(82096.060646550788/8.0),
- REAL_CONST(82118.630785846399/8.0),
- REAL_CONST(82141.202476087841/8.0),
- REAL_CONST(82163.775717062032/8.0),
- REAL_CONST(82186.35050855593/8.0),
- REAL_CONST(82208.926850356569/8.0),
- REAL_CONST(82231.504742251054/8.0),
- REAL_CONST(82254.084184026578/8.0),
- REAL_CONST(82276.665175470393/8.0),
- REAL_CONST(82299.24771636985/8.0),
- REAL_CONST(82321.831806512317/8.0),
- REAL_CONST(82344.417445685307/8.0),
- REAL_CONST(82367.004633676348/8.0),
- REAL_CONST(82389.593370273054/8.0),
- REAL_CONST(82412.183655263143/8.0),
- REAL_CONST(82434.775488434374/8.0),
- REAL_CONST(82457.368869574595/8.0),
- REAL_CONST(82479.963798471697/8.0),
- REAL_CONST(82502.560274913689/8.0),
- REAL_CONST(82525.158298688606/8.0),
- REAL_CONST(82547.757869584602/8.0),
- REAL_CONST(82570.35898738986/8.0),
- REAL_CONST(82592.961651892678/8.0),
- REAL_CONST(82615.565862881398/8.0),
- REAL_CONST(82638.171620144421/8.0),
- REAL_CONST(82660.778923470265/8.0),
- REAL_CONST(82683.387772647475/8.0),
- REAL_CONST(82705.998167464713/8.0),
- REAL_CONST(82728.610107710658/8.0),
- REAL_CONST(82751.223593174116/8.0),
- REAL_CONST(82773.83862364394/8.0),
- REAL_CONST(82796.45519890904/8.0),
- REAL_CONST(82819.073318758441/8.0),
- REAL_CONST(82841.692982981185/8.0),
- REAL_CONST(82864.314191366429/8.0),
- REAL_CONST(82886.936943703375/8.0),
- REAL_CONST(82909.561239781324/8.0),
- REAL_CONST(82932.187079389638/8.0),
- REAL_CONST(82954.814462317736/8.0),
- REAL_CONST(82977.443388355125/8.0),
- REAL_CONST(83000.073857291369/8.0),
- REAL_CONST(83022.70586891612/8.0),
- REAL_CONST(83045.339423019104/8.0),
- REAL_CONST(83067.974519390089/8.0),
- REAL_CONST(83090.611157818959/8.0),
- REAL_CONST(83113.249338095629/8.0),
- REAL_CONST(83135.8890600101/8.0),
- REAL_CONST(83158.530323352461/8.0),
- REAL_CONST(83181.173127912858/8.0),
- REAL_CONST(83203.817473481497/8.0),
- REAL_CONST(83226.463359848669/8.0),
- REAL_CONST(83249.11078680474/8.0),
- REAL_CONST(83271.759754140134/8.0),
- REAL_CONST(83294.410261645375/8.0),
- REAL_CONST(83317.062309111003/8.0),
- REAL_CONST(83339.715896327703/8.0),
- REAL_CONST(83362.371023086147/8.0),
- REAL_CONST(83385.027689177165/8.0),
- REAL_CONST(83407.685894391587/8.0),
- REAL_CONST(83430.345638520361/8.0),
- REAL_CONST(83453.006921354478/8.0),
- REAL_CONST(83475.669742685001/8.0),
- REAL_CONST(83498.334102303095/8.0),
- REAL_CONST(83520.999999999942/8.0),
- REAL_CONST(83543.667435566866/8.0),
- REAL_CONST(83566.336408795192/8.0),
- REAL_CONST(83589.006919476349/8.0),
- REAL_CONST(83611.678967401851/8.0),
- REAL_CONST(83634.352552363242/8.0),
- REAL_CONST(83657.027674152167/8.0),
- REAL_CONST(83679.704332560359/8.0),
- REAL_CONST(83702.382527379552/8.0),
- REAL_CONST(83725.062258401638/8.0),
- REAL_CONST(83747.743525418511/8.0),
- REAL_CONST(83770.42632822218/8.0),
- REAL_CONST(83793.110666604684/8.0),
- REAL_CONST(83815.796540358162/8.0),
- REAL_CONST(83838.483949274829/8.0),
- REAL_CONST(83861.172893146941/8.0),
- REAL_CONST(83883.863371766842/8.0),
- REAL_CONST(83906.555384926964/8.0),
- REAL_CONST(83929.248932419752/8.0),
- REAL_CONST(83951.944014037799/8.0),
- REAL_CONST(83974.640629573696/8.0),
- REAL_CONST(83997.338778820151/8.0),
- REAL_CONST(84020.038461569929/8.0),
- REAL_CONST(84042.739677615857/8.0),
- REAL_CONST(84065.442426750829/8.0),
- REAL_CONST(84088.146708767847/8.0),
- REAL_CONST(84110.852523459922/8.0),
- REAL_CONST(84133.559870620171/8.0),
- REAL_CONST(84156.268750041796/8.0),
- REAL_CONST(84178.979161518029/8.0),
- REAL_CONST(84201.691104842204/8.0),
- REAL_CONST(84224.404579807713/8.0),
- REAL_CONST(84247.119586208006/8.0),
- REAL_CONST(84269.83612383662/8.0),
- REAL_CONST(84292.55419248715/8.0),
- REAL_CONST(84315.273791953281/8.0),
- REAL_CONST(84337.994922028738/8.0),
- REAL_CONST(84360.717582507335/8.0),
- REAL_CONST(84383.441773182945/8.0),
- REAL_CONST(84406.167493849513/8.0),
- REAL_CONST(84428.894744301069/8.0),
- REAL_CONST(84451.623524331691/8.0),
- REAL_CONST(84474.353833735542/8.0),
- REAL_CONST(84497.085672306828/8.0),
- REAL_CONST(84519.819039839858/8.0),
- REAL_CONST(84542.553936128999/8.0),
- REAL_CONST(84565.290360968676/8.0),
- REAL_CONST(84588.028314153402/8.0),
- REAL_CONST(84610.767795477717/8.0),
- REAL_CONST(84633.508804736295/8.0),
- REAL_CONST(84656.251341723822/8.0),
- REAL_CONST(84678.995406235073/8.0),
- REAL_CONST(84701.740998064924/8.0),
- REAL_CONST(84724.488117008252/8.0),
- REAL_CONST(84747.236762860062/8.0),
- REAL_CONST(84769.986935415407/8.0),
- REAL_CONST(84792.73863446941/8.0),
- REAL_CONST(84815.491859817252/8.0),
- REAL_CONST(84838.246611254188/8.0),
- REAL_CONST(84861.002888575575/8.0),
- REAL_CONST(84883.760691576768/8.0),
- REAL_CONST(84906.520020053256/8.0),
- REAL_CONST(84929.28087380057/8.0),
- REAL_CONST(84952.043252614312/8.0),
- REAL_CONST(84974.807156290146/8.0),
- REAL_CONST(84997.572584623806/8.0),
- REAL_CONST(85020.339537411113/8.0),
- REAL_CONST(85043.108014447949/8.0),
- REAL_CONST(85065.878015530237/8.0),
- REAL_CONST(85088.649540453989/8.0),
- REAL_CONST(85111.422589015303/8.0),
- REAL_CONST(85134.197161010321/8.0),
- REAL_CONST(85156.973256235244/8.0),
- REAL_CONST(85179.750874486374/8.0),
- REAL_CONST(85202.530015560071/8.0),
- REAL_CONST(85225.310679252725/8.0),
- REAL_CONST(85248.092865360857/8.0),
- REAL_CONST(85270.876573681016/8.0),
- REAL_CONST(85293.661804009811/8.0),
- REAL_CONST(85316.448556143951/8.0),
- REAL_CONST(85339.236829880188/8.0),
- REAL_CONST(85362.026625015351/8.0),
- REAL_CONST(85384.817941346351/8.0),
- REAL_CONST(85407.610778670132/8.0),
- REAL_CONST(85430.405136783724/8.0),
- REAL_CONST(85453.201015484257/8.0),
- REAL_CONST(85475.998414568865/8.0),
- REAL_CONST(85498.797333834795/8.0),
- REAL_CONST(85521.597773079353/8.0),
- REAL_CONST(85544.399732099904/8.0),
- REAL_CONST(85567.203210693886/8.0),
- REAL_CONST(85590.008208658808/8.0),
- REAL_CONST(85612.814725792239/8.0),
- REAL_CONST(85635.62276189182/8.0),
- REAL_CONST(85658.432316755265/8.0),
- REAL_CONST(85681.243390180331/8.0),
- REAL_CONST(85704.055981964877/8.0),
- REAL_CONST(85726.870091906807/8.0),
- REAL_CONST(85749.685719804082/8.0),
- REAL_CONST(85772.502865454764/8.0),
- REAL_CONST(85795.321528656961/8.0),
- REAL_CONST(85818.141709208852/8.0),
- REAL_CONST(85840.963406908675/8.0),
- REAL_CONST(85863.78662155474/8.0),
- REAL_CONST(85886.611352945445/8.0),
- REAL_CONST(85909.437600879217/8.0),
- REAL_CONST(85932.26536515457/8.0),
- REAL_CONST(85955.094645570091/8.0),
- REAL_CONST(85977.92544192441/8.0),
- REAL_CONST(86000.757754016275/8.0),
- REAL_CONST(86023.591581644432/8.0),
- REAL_CONST(86046.426924607746/8.0),
- REAL_CONST(86069.263782705122/8.0),
- REAL_CONST(86092.102155735556/8.0),
- REAL_CONST(86114.942043498071/8.0),
- REAL_CONST(86137.783445791807/8.0),
- REAL_CONST(86160.626362415918/8.0),
- REAL_CONST(86183.470793169676/8.0),
- REAL_CONST(86206.316737852379/8.0),
- REAL_CONST(86229.164196263402/8.0),
- REAL_CONST(86252.013168202204/8.0),
- REAL_CONST(86274.863653468303/8.0),
- REAL_CONST(86297.715651861261/8.0),
- REAL_CONST(86320.569163180728/8.0),
- REAL_CONST(86343.424187226425/8.0),
- REAL_CONST(86366.280723798132/8.0),
- REAL_CONST(86389.138772695675/8.0),
- REAL_CONST(86411.998333718977/8.0),
- REAL_CONST(86434.859406668009/8.0),
- REAL_CONST(86457.721991342827/8.0),
- REAL_CONST(86480.586087543532/8.0),
- REAL_CONST(86503.451695070296/8.0),
- REAL_CONST(86526.318813723352/8.0),
- REAL_CONST(86549.187443303032/8.0),
- REAL_CONST(86572.057583609683/8.0),
- REAL_CONST(86594.929234443756/8.0),
- REAL_CONST(86617.802395605773/8.0),
- REAL_CONST(86640.677066896271/8.0),
- REAL_CONST(86663.553248115903/8.0),
- REAL_CONST(86686.43093906538/8.0),
- REAL_CONST(86709.310139545443/8.0),
- REAL_CONST(86732.190849356964/8.0),
- REAL_CONST(86755.073068300815/8.0),
- REAL_CONST(86777.956796177954/8.0),
- REAL_CONST(86800.842032789442/8.0),
- REAL_CONST(86823.728777936354/8.0),
- REAL_CONST(86846.617031419853/8.0),
- REAL_CONST(86869.506793041175/8.0),
- REAL_CONST(86892.398062601613/8.0),
- REAL_CONST(86915.290839902518/8.0),
- REAL_CONST(86938.185124745316/8.0),
- REAL_CONST(86961.080916931489/8.0),
- REAL_CONST(86983.978216262592/8.0),
- REAL_CONST(87006.87702254027/8.0),
- REAL_CONST(87029.777335566177/8.0),
- REAL_CONST(87052.67915514209/8.0),
- REAL_CONST(87075.582481069796/8.0),
- REAL_CONST(87098.487313151185/8.0),
- REAL_CONST(87121.39365118822/8.0),
- REAL_CONST(87144.301494982894/8.0),
- REAL_CONST(87167.210844337285/8.0),
- REAL_CONST(87190.121699053532/8.0),
- REAL_CONST(87213.034058933845/8.0),
- REAL_CONST(87235.947923780506/8.0),
- REAL_CONST(87258.863293395829/8.0),
- REAL_CONST(87281.780167582241/8.0),
- REAL_CONST(87304.698546142172/8.0),
- REAL_CONST(87327.618428878181/8.0),
- REAL_CONST(87350.539815592856/8.0),
- REAL_CONST(87373.462706088845/8.0),
- REAL_CONST(87396.387100168897/8.0),
- REAL_CONST(87419.312997635774/8.0),
- REAL_CONST(87442.240398292357/8.0),
- REAL_CONST(87465.16930194154/8.0),
- REAL_CONST(87488.099708386319/8.0),
- REAL_CONST(87511.031617429733/8.0),
- REAL_CONST(87533.965028874911/8.0),
- REAL_CONST(87556.899942525008/8.0),
- REAL_CONST(87579.836358183282/8.0),
- REAL_CONST(87602.774275653021/8.0),
- REAL_CONST(87625.713694737613/8.0),
- REAL_CONST(87648.654615240492/8.0),
- REAL_CONST(87671.597036965148/8.0),
- REAL_CONST(87694.540959715145/8.0),
- REAL_CONST(87717.486383294105/8.0),
- REAL_CONST(87740.433307505737/8.0),
- REAL_CONST(87763.381732153779/8.0),
- REAL_CONST(87786.331657042057/8.0),
- REAL_CONST(87809.283081974456/8.0),
- REAL_CONST(87832.236006754916/8.0),
- REAL_CONST(87855.190431187453/8.0),
- REAL_CONST(87878.146355076155/8.0),
- REAL_CONST(87901.103778225151/8.0),
- REAL_CONST(87924.062700438633/8.0),
- REAL_CONST(87947.023121520891/8.0),
- REAL_CONST(87969.985041276246/8.0),
- REAL_CONST(87992.948459509105/8.0),
- REAL_CONST(88015.913376023906/8.0),
- REAL_CONST(88038.879790625171/8.0),
- REAL_CONST(88061.847703117513/8.0),
- REAL_CONST(88084.817113305573/8.0),
- REAL_CONST(88107.788020994049/8.0),
- REAL_CONST(88130.760425987726/8.0),
- REAL_CONST(88153.734328091465/8.0),
- REAL_CONST(88176.709727110137/8.0),
- REAL_CONST(88199.686622848749/8.0),
- REAL_CONST(88222.665015112303/8.0),
- REAL_CONST(88245.644903705906/8.0),
- REAL_CONST(88268.626288434709/8.0),
- REAL_CONST(88291.609169103947/8.0),
- REAL_CONST(88314.593545518903/8.0),
- REAL_CONST(88337.579417484914/8.0),
- REAL_CONST(88360.566784807408/8.0),
- REAL_CONST(88383.555647291854/8.0),
- REAL_CONST(88406.546004743795/8.0),
- REAL_CONST(88429.537856968818/8.0),
- REAL_CONST(88452.531203772611/8.0),
- REAL_CONST(88475.52604496089/8.0),
- REAL_CONST(88498.522380339447/8.0),
- REAL_CONST(88521.52020971413/8.0),
- REAL_CONST(88544.519532890874/8.0),
- REAL_CONST(88567.520349675644/8.0),
- REAL_CONST(88590.522659874507/8.0),
- REAL_CONST(88613.526463293543/8.0),
- REAL_CONST(88636.531759738922/8.0),
- REAL_CONST(88659.538549016899/8.0),
- REAL_CONST(88682.546830933745/8.0),
- REAL_CONST(88705.556605295846/8.0),
- REAL_CONST(88728.567871909589/8.0),
- REAL_CONST(88751.580630581491/8.0),
- REAL_CONST(88774.594881118086/8.0),
- REAL_CONST(88797.610623325963/8.0),
- REAL_CONST(88820.62785701183/8.0),
- REAL_CONST(88843.646581982393/8.0),
- REAL_CONST(88866.666798044462/8.0),
- REAL_CONST(88889.688505004888/8.0),
- REAL_CONST(88912.711702670611/8.0),
- REAL_CONST(88935.7363908486/8.0),
- REAL_CONST(88958.762569345898/8.0),
- REAL_CONST(88981.790237969632/8.0),
- REAL_CONST(89004.81939652696/8.0),
- REAL_CONST(89027.850044825114/8.0),
- REAL_CONST(89050.882182671412/8.0),
- REAL_CONST(89073.9158098732/8.0),
- REAL_CONST(89096.950926237885/8.0),
- REAL_CONST(89119.987531572973/8.0),
- REAL_CONST(89143.025625686001/8.0),
- REAL_CONST(89166.065208384563/8.0),
- REAL_CONST(89189.106279476357/8.0),
- REAL_CONST(89212.148838769106/8.0),
- REAL_CONST(89235.192886070581/8.0),
- REAL_CONST(89258.238421188667/8.0),
- REAL_CONST(89281.285443931265/8.0),
- REAL_CONST(89304.333954106376/8.0),
- REAL_CONST(89327.383951522017/8.0),
- REAL_CONST(89350.435435986306/8.0),
- REAL_CONST(89373.488407307406/8.0),
- REAL_CONST(89396.542865293537/8.0),
- REAL_CONST(89419.598809753006/8.0),
- REAL_CONST(89442.656240494165/8.0),
- REAL_CONST(89465.715157325409/8.0),
- REAL_CONST(89488.775560055219/8.0),
- REAL_CONST(89511.837448492137/8.0),
- REAL_CONST(89534.900822444746/8.0),
- REAL_CONST(89557.965681721733/8.0),
- REAL_CONST(89581.032026131812/8.0),
- REAL_CONST(89604.099855483742/8.0),
- REAL_CONST(89627.169169586399/8.0),
- REAL_CONST(89650.239968248672/8.0),
- REAL_CONST(89673.312251279538/8.0),
- REAL_CONST(89696.386018488018/8.0),
- REAL_CONST(89719.461269683205/8.0),
- REAL_CONST(89742.53800467425/8.0),
- REAL_CONST(89765.616223270365/8.0),
- REAL_CONST(89788.69592528083/8.0),
- REAL_CONST(89811.777110514988/8.0),
- REAL_CONST(89834.859778782207/8.0),
- REAL_CONST(89857.943929891975/8.0),
- REAL_CONST(89881.029563653807/8.0),
- REAL_CONST(89904.116679877261/8.0),
- REAL_CONST(89927.205278372014/8.0),
- REAL_CONST(89950.29535894774/8.0),
- REAL_CONST(89973.386921414218/8.0),
- REAL_CONST(89996.479965581268/8.0),
- REAL_CONST(90019.574491258769/8.0),
- REAL_CONST(90042.670498256688/8.0),
- REAL_CONST(90065.767986385021/8.0),
- REAL_CONST(90088.866955453836/8.0),
- REAL_CONST(90111.967405273259/8.0),
- REAL_CONST(90135.069335653476/8.0),
- REAL_CONST(90158.172746404758/8.0),
- REAL_CONST(90181.277637337407/8.0),
- REAL_CONST(90204.384008261797/8.0),
- REAL_CONST(90227.49185898836/8.0),
- REAL_CONST(90250.601189327586/8.0),
- REAL_CONST(90273.711999090039/8.0),
- REAL_CONST(90296.824288086325/8.0),
- REAL_CONST(90319.938056127125/8.0),
- REAL_CONST(90343.053303023189/8.0),
- REAL_CONST(90366.170028585286/8.0),
- REAL_CONST(90389.288232624298/8.0),
- REAL_CONST(90412.407914951138/8.0),
- REAL_CONST(90435.529075376777/8.0),
- REAL_CONST(90458.651713712257/8.0),
- REAL_CONST(90481.775829768681/8.0),
- REAL_CONST(90504.901423357209/8.0),
- REAL_CONST(90528.028494289058/8.0),
- REAL_CONST(90551.157042375504/8.0),
- REAL_CONST(90574.287067427911/8.0),
- REAL_CONST(90597.418569257643/8.0),
- REAL_CONST(90620.551547676194/8.0),
- REAL_CONST(90643.686002495073/8.0),
- REAL_CONST(90666.821933525847/8.0),
- REAL_CONST(90689.959340580186/8.0),
- REAL_CONST(90713.098223469773/8.0),
- REAL_CONST(90736.238582006365/8.0),
- REAL_CONST(90759.380416001804/8.0),
- REAL_CONST(90782.523725267951/8.0),
- REAL_CONST(90805.668509616764/8.0),
- REAL_CONST(90828.814768860233/8.0),
- REAL_CONST(90851.962502810435/8.0),
- REAL_CONST(90875.11171127946/8.0),
- REAL_CONST(90898.262394079517/8.0),
- REAL_CONST(90921.414551022855/8.0),
- REAL_CONST(90944.568181921743/8.0),
- REAL_CONST(90967.72328658856/8.0),
- REAL_CONST(90990.879864835719/8.0),
- REAL_CONST(91014.037916475718/8.0),
- REAL_CONST(91037.19744132107/8.0),
- REAL_CONST(91060.358439184391/8.0),
- REAL_CONST(91083.520909878338/8.0),
- REAL_CONST(91106.684853215629/8.0),
- REAL_CONST(91129.850269009039/8.0),
- REAL_CONST(91153.017157071401/8.0),
- REAL_CONST(91176.185517215621/8.0),
- REAL_CONST(91199.355349254649/8.0),
- REAL_CONST(91222.526653001492/8.0),
- REAL_CONST(91245.699428269247/8.0),
- REAL_CONST(91268.873674871036/8.0),
- REAL_CONST(91292.049392620058/8.0),
- REAL_CONST(91315.226581329553/8.0),
- REAL_CONST(91338.405240812834/8.0),
- REAL_CONST(91361.585370883287/8.0),
- REAL_CONST(91384.766971354344/8.0),
- REAL_CONST(91407.950042039476/8.0),
- REAL_CONST(91431.134582752245/8.0),
- REAL_CONST(91454.320593306256/8.0),
- REAL_CONST(91477.508073515171/8.0),
- REAL_CONST(91500.697023192712/8.0),
- REAL_CONST(91523.887442152685/8.0),
- REAL_CONST(91547.07933020893/8.0),
- REAL_CONST(91570.272687175326/8.0),
- REAL_CONST(91593.467512865856/8.0),
- REAL_CONST(91616.663807094534/8.0),
- REAL_CONST(91639.861569675442/8.0),
- REAL_CONST(91663.060800422725/8.0),
- REAL_CONST(91686.261499150554/8.0),
- REAL_CONST(91709.463665673218/8.0),
- REAL_CONST(91732.66729980502/8.0),
- REAL_CONST(91755.872401360321/8.0),
- REAL_CONST(91779.078970153569/8.0),
- REAL_CONST(91802.287005999257/8.0),
- REAL_CONST(91825.49650871192/8.0),
- REAL_CONST(91848.707478106167/8.0),
- REAL_CONST(91871.91991399668/8.0),
- REAL_CONST(91895.133816198169/8.0),
- REAL_CONST(91918.349184525418/8.0),
- REAL_CONST(91941.566018793281/8.0),
- REAL_CONST(91964.784318816659/8.0),
- REAL_CONST(91988.004084410495/8.0),
- REAL_CONST(92011.22531538982/8.0),
- REAL_CONST(92034.448011569708/8.0),
- REAL_CONST(92057.672172765277/8.0),
- REAL_CONST(92080.897798791746/8.0),
- REAL_CONST(92104.124889464365/8.0),
- REAL_CONST(92127.353444598411/8.0),
- REAL_CONST(92150.58346400928/8.0),
- REAL_CONST(92173.814947512379/8.0),
- REAL_CONST(92197.04789492322/8.0),
- REAL_CONST(92220.282306057314/8.0),
- REAL_CONST(92243.518180730272/8.0),
- REAL_CONST(92266.755518757753/8.0),
- REAL_CONST(92289.994319955469/8.0),
- REAL_CONST(92313.234584139194/8.0),
- REAL_CONST(92336.476311124774/8.0),
- REAL_CONST(92359.719500728082/8.0),
- REAL_CONST(92382.964152765067/8.0),
- REAL_CONST(92406.210267051734/8.0),
- REAL_CONST(92429.457843404161/8.0),
- REAL_CONST(92452.706881638471/8.0),
- REAL_CONST(92475.957381570814/8.0),
- REAL_CONST(92499.209343017443/8.0),
- REAL_CONST(92522.462765794655/8.0),
- REAL_CONST(92545.717649718805/8.0),
- REAL_CONST(92568.973994606305/8.0),
- REAL_CONST(92592.231800273614/8.0),
- REAL_CONST(92615.491066537259/8.0),
- REAL_CONST(92638.751793213814/8.0),
- REAL_CONST(92662.01398011994/8.0),
- REAL_CONST(92685.277627072326/8.0),
- REAL_CONST(92708.54273388772/8.0),
- REAL_CONST(92731.809300382942/8.0),
- REAL_CONST(92755.077326374871/8.0),
- REAL_CONST(92778.346811680414/8.0),
- REAL_CONST(92801.617756116568/8.0),
- REAL_CONST(92824.890159500384/8.0),
- REAL_CONST(92848.164021648947/8.0),
- REAL_CONST(92871.439342379424/8.0),
- REAL_CONST(92894.716121509016/8.0),
- REAL_CONST(92917.994358855023/8.0),
- REAL_CONST(92941.274054234746/8.0),
- REAL_CONST(92964.555207465572/8.0),
- REAL_CONST(92987.837818364962/8.0),
- REAL_CONST(93011.121886750407/8.0),
- REAL_CONST(93034.407412439468/8.0),
- REAL_CONST(93057.694395249753/8.0),
- REAL_CONST(93080.982834998955/8.0),
- REAL_CONST(93104.272731504767/8.0),
- REAL_CONST(93127.564084584999/8.0),
- REAL_CONST(93150.856894057491/8.0),
- REAL_CONST(93174.15115974014/8.0),
- REAL_CONST(93197.446881450916/8.0),
- REAL_CONST(93220.744059007804/8.0),
- REAL_CONST(93244.04269222889/8.0),
- REAL_CONST(93267.342780932304/8.0),
- REAL_CONST(93290.644324936235/8.0),
- REAL_CONST(93313.947324058914/8.0),
- REAL_CONST(93337.251778118633/8.0),
- REAL_CONST(93360.557686933767/8.0),
- REAL_CONST(93383.865050322696/8.0),
- REAL_CONST(93407.173868103928/8.0),
- REAL_CONST(93430.484140095941/8.0),
- REAL_CONST(93453.795866117362/8.0),
- REAL_CONST(93477.109045986799/8.0),
- REAL_CONST(93500.423679522952/8.0),
- REAL_CONST(93523.739766544561/8.0),
- REAL_CONST(93547.057306870454/8.0),
- REAL_CONST(93570.376300319491/8.0),
- REAL_CONST(93593.696746710571/8.0),
- REAL_CONST(93617.018645862699/8.0),
- REAL_CONST(93640.341997594893/8.0),
- REAL_CONST(93663.666801726242/8.0),
- REAL_CONST(93686.993058075881/8.0),
- REAL_CONST(93710.320766463032/8.0),
- REAL_CONST(93733.64992670693/8.0),
- REAL_CONST(93756.980538626914/8.0),
- REAL_CONST(93780.312602042337/8.0),
- REAL_CONST(93803.646116772637/8.0),
- REAL_CONST(93826.981082637285/8.0),
- REAL_CONST(93850.317499455836/8.0),
- REAL_CONST(93873.655367047861/8.0),
- REAL_CONST(93896.994685233032/8.0),
- REAL_CONST(93920.335453831038/8.0),
- REAL_CONST(93943.677672661666/8.0),
- REAL_CONST(93967.021341544707/8.0),
- REAL_CONST(93990.366460300051/8.0),
- REAL_CONST(94013.713028747632/8.0),
- REAL_CONST(94037.061046707429/8.0),
- REAL_CONST(94060.410513999494/8.0),
- REAL_CONST(94083.761430443905/8.0),
- REAL_CONST(94107.113795860845/8.0),
- REAL_CONST(94130.467610070496/8.0),
- REAL_CONST(94153.822872893157/8.0),
- REAL_CONST(94177.179584149111/8.0),
- REAL_CONST(94200.537743658759/8.0),
- REAL_CONST(94223.897351242529/8.0),
- REAL_CONST(94247.25840672091/8.0),
- REAL_CONST(94270.620909914433/8.0),
- REAL_CONST(94293.98486064373/8.0),
- REAL_CONST(94317.350258729421/8.0),
- REAL_CONST(94340.71710399224/8.0),
- REAL_CONST(94364.085396252936/8.0),
- REAL_CONST(94387.455135332348/8.0),
- REAL_CONST(94410.82632105134/8.0),
- REAL_CONST(94434.198953230851/8.0),
- REAL_CONST(94457.573031691878/8.0),
- REAL_CONST(94480.948556255447/8.0),
- REAL_CONST(94504.325526742658/8.0),
- REAL_CONST(94527.70394297468/8.0),
- REAL_CONST(94551.083804772716/8.0),
- REAL_CONST(94574.465111958023/8.0),
- REAL_CONST(94597.847864351934/8.0),
- REAL_CONST(94621.232061775823/8.0),
- REAL_CONST(94644.617704051096/8.0),
- REAL_CONST(94668.004790999272/8.0),
- REAL_CONST(94691.393322441872/8.0),
- REAL_CONST(94714.783298200506/8.0),
- REAL_CONST(94738.174718096794/8.0),
- REAL_CONST(94761.567581952477/8.0),
- REAL_CONST(94784.961889589307/8.0),
- REAL_CONST(94808.357640829097/8.0),
- REAL_CONST(94831.754835493703/8.0),
- REAL_CONST(94855.153473405066/8.0),
- REAL_CONST(94878.553554385173/8.0),
- REAL_CONST(94901.955078256055/8.0),
- REAL_CONST(94925.358044839784/8.0),
- REAL_CONST(94948.762453958523/8.0),
- REAL_CONST(94972.168305434476/8.0),
- REAL_CONST(94995.575599089891/8.0),
- REAL_CONST(95018.984334747074/8.0),
- REAL_CONST(95042.394512228391/8.0),
- REAL_CONST(95065.806131356265/8.0),
- REAL_CONST(95089.219191953176/8.0),
- REAL_CONST(95112.633693841635/8.0),
- REAL_CONST(95136.04963684424/8.0),
- REAL_CONST(95159.467020783617/8.0),
- REAL_CONST(95182.885845482466/8.0),
- REAL_CONST(95206.306110763529/8.0),
- REAL_CONST(95229.727816449609/8.0),
- REAL_CONST(95253.150962363579/8.0),
- REAL_CONST(95276.575548328314/8.0),
- REAL_CONST(95300.001574166803/8.0),
- REAL_CONST(95323.429039702052/8.0),
- REAL_CONST(95346.857944757154/8.0),
- REAL_CONST(95370.288289155214/8.0),
- REAL_CONST(95393.720072719429/8.0),
- REAL_CONST(95417.153295273019/8.0),
- REAL_CONST(95440.587956639298/8.0),
- REAL_CONST(95464.024056641589/8.0),
- REAL_CONST(95487.461595103305/8.0),
- REAL_CONST(95510.900571847902/8.0),
- REAL_CONST(95534.340986698866/8.0),
- REAL_CONST(95557.782839479783/8.0),
- REAL_CONST(95581.226130014256/8.0),
- REAL_CONST(95604.670858125959/8.0),
- REAL_CONST(95628.117023638595/8.0),
- REAL_CONST(95651.564626375985/8.0),
- REAL_CONST(95675.013666161918/8.0),
- REAL_CONST(95698.464142820303/8.0),
- REAL_CONST(95721.916056175076/8.0),
- REAL_CONST(95745.369406050231/8.0),
- REAL_CONST(95768.824192269807/8.0),
- REAL_CONST(95792.280414657915/8.0),
- REAL_CONST(95815.738073038709/8.0),
- REAL_CONST(95839.197167236387/8.0),
- REAL_CONST(95862.657697075221/8.0),
- REAL_CONST(95886.11966237954/8.0),
- REAL_CONST(95909.583062973688/8.0),
- REAL_CONST(95933.047898682111/8.0),
- REAL_CONST(95956.514169329268/8.0),
- REAL_CONST(95979.981874739708/8.0),
- REAL_CONST(96003.451014738006/8.0),
- REAL_CONST(96026.921589148798/8.0),
- REAL_CONST(96050.393597796792/8.0),
- REAL_CONST(96073.867040506724/8.0),
- REAL_CONST(96097.341917103375/8.0),
- REAL_CONST(96120.818227411626/8.0),
- REAL_CONST(96144.295971256375/8.0),
- REAL_CONST(96167.775148462577/8.0),
- REAL_CONST(96191.255758855244/8.0),
- REAL_CONST(96214.737802259449/8.0),
- REAL_CONST(96238.221278500292/8.0),
- REAL_CONST(96261.70618740299/8.0),
- REAL_CONST(96285.192528792715/8.0),
- REAL_CONST(96308.680302494788/8.0),
- REAL_CONST(96332.169508334526/8.0),
- REAL_CONST(96355.660146137321/8.0),
- REAL_CONST(96379.152215728609/8.0),
- REAL_CONST(96402.645716933868/8.0),
- REAL_CONST(96426.14064957868/8.0),
- REAL_CONST(96449.637013488609/8.0),
- REAL_CONST(96473.134808489311/8.0),
- REAL_CONST(96496.63403440651/8.0),
- REAL_CONST(96520.134691065963/8.0),
- REAL_CONST(96543.636778293469/8.0),
- REAL_CONST(96567.140295914898/8.0),
- REAL_CONST(96590.645243756153/8.0),
- REAL_CONST(96614.151621643221/8.0),
- REAL_CONST(96637.659429402134/8.0),
- REAL_CONST(96661.168666858954/8.0),
- REAL_CONST(96684.679333839798/8.0),
- REAL_CONST(96708.191430170875/8.0),
- REAL_CONST(96731.70495567839/8.0),
- REAL_CONST(96755.219910188665/8.0),
- REAL_CONST(96778.736293528011/8.0),
- REAL_CONST(96802.254105522836/8.0),
- REAL_CONST(96825.77334599958/8.0),
- REAL_CONST(96849.29401478474/8.0),
- REAL_CONST(96872.816111704873/8.0),
- REAL_CONST(96896.339636586577/8.0),
- REAL_CONST(96919.864589256511/8.0),
- REAL_CONST(96943.390969541389/8.0),
- REAL_CONST(96966.918777267958/8.0),
- REAL_CONST(96990.448012263048/8.0),
- REAL_CONST(97013.978674353522/8.0),
- REAL_CONST(97037.510763366285/8.0),
- REAL_CONST(97061.044279128328/8.0),
- REAL_CONST(97084.579221466673/8.0),
- REAL_CONST(97108.115590208385/8.0),
- REAL_CONST(97131.653385180587/8.0),
- REAL_CONST(97155.19260621049/8.0),
- REAL_CONST(97178.733253125291/8.0),
- REAL_CONST(97202.2753257523/8.0),
- REAL_CONST(97225.81882391886/8.0),
- REAL_CONST(97249.363747452342/8.0),
- REAL_CONST(97272.910096180189/8.0),
- REAL_CONST(97296.457869929916/8.0),
- REAL_CONST(97320.007068529041/8.0),
- REAL_CONST(97343.557691805196/8.0),
- REAL_CONST(97367.109739586012/8.0),
- REAL_CONST(97390.663211699197/8.0),
- REAL_CONST(97414.218107972498/8.0),
- REAL_CONST(97437.774428233737/8.0),
- REAL_CONST(97461.332172310766/8.0),
- REAL_CONST(97484.891340031507/8.0),
- REAL_CONST(97508.451931223899/8.0),
- REAL_CONST(97532.013945715982/8.0),
- REAL_CONST(97555.577383335811/8.0),
- REAL_CONST(97579.142243911512/8.0),
- REAL_CONST(97602.708527271257/8.0),
- REAL_CONST(97626.276233243261/8.0),
- REAL_CONST(97649.845361655811/8.0),
- REAL_CONST(97673.415912337223/8.0),
- REAL_CONST(97696.987885115886/8.0),
- REAL_CONST(97720.561279820206/8.0),
- REAL_CONST(97744.1360962787/8.0),
- REAL_CONST(97767.712334319876/8.0),
- REAL_CONST(97791.289993772341/8.0),
- REAL_CONST(97814.869074464703/8.0),
- REAL_CONST(97838.449576225685/8.0),
- REAL_CONST(97862.031498883996/8.0),
- REAL_CONST(97885.614842268449/8.0),
- REAL_CONST(97909.199606207883/8.0),
- REAL_CONST(97932.785790531183/8.0),
- REAL_CONST(97956.37339506732/8.0),
- REAL_CONST(97979.962419645264/8.0),
- REAL_CONST(98003.552864094076/8.0),
- REAL_CONST(98027.144728242856/8.0),
- REAL_CONST(98050.738011920766/8.0),
- REAL_CONST(98074.332714956996/8.0),
- REAL_CONST(98097.928837180807/8.0),
- REAL_CONST(98121.526378421506/8.0),
- REAL_CONST(98145.125338508456/8.0),
- REAL_CONST(98168.725717271067/8.0),
- REAL_CONST(98192.327514538789/8.0),
- REAL_CONST(98215.930730141132/8.0),
- REAL_CONST(98239.535363907664/8.0),
- REAL_CONST(98263.141415668011/8.0),
- REAL_CONST(98286.748885251814/8.0),
- REAL_CONST(98310.357772488816/8.0),
- REAL_CONST(98333.968077208759/8.0),
- REAL_CONST(98357.579799241488/8.0),
- REAL_CONST(98381.192938416847/8.0),
- REAL_CONST(98404.807494564782/8.0),
- REAL_CONST(98428.42346751524/8.0),
- REAL_CONST(98452.040857098269/8.0),
- REAL_CONST(98475.659663143917/8.0),
- REAL_CONST(98499.27988548232/8.0),
- REAL_CONST(98522.901523943656/8.0),
- REAL_CONST(98546.524578358163/8.0),
- REAL_CONST(98570.149048556093/8.0),
- REAL_CONST(98593.774934367786/8.0),
- REAL_CONST(98617.402235623624/8.0),
- REAL_CONST(98641.030952154048/8.0),
- REAL_CONST(98664.661083789513/8.0),
- REAL_CONST(98688.292630360564/8.0),
- REAL_CONST(98711.925591697771/8.0),
- REAL_CONST(98735.559967631794/8.0),
- REAL_CONST(98759.195757993293/8.0),
- REAL_CONST(98782.832962613014/8.0),
- REAL_CONST(98806.471581321734/8.0),
- REAL_CONST(98830.111613950285/8.0),
- REAL_CONST(98853.753060329575/8.0),
- REAL_CONST(98877.39592029051/8.0),
- REAL_CONST(98901.040193664099/8.0),
- REAL_CONST(98924.68588028138/8.0),
- REAL_CONST(98948.33297997342/8.0),
- REAL_CONST(98971.981492571387/8.0),
- REAL_CONST(98995.63141790645/8.0),
- REAL_CONST(99019.282755809851/8.0),
- REAL_CONST(99042.935506112874/8.0),
- REAL_CONST(99066.589668646877/8.0),
- REAL_CONST(99090.245243243233/8.0),
- REAL_CONST(99113.902229733401/8.0),
- REAL_CONST(99137.560627948857/8.0),
- REAL_CONST(99161.220437721131/8.0),
- REAL_CONST(99184.881658881859/8.0),
- REAL_CONST(99208.544291262631/8.0),
- REAL_CONST(99232.208334695169/8.0),
- REAL_CONST(99255.87378901121/8.0),
- REAL_CONST(99279.540654042547/8.0),
- REAL_CONST(99303.208929621018/8.0),
- REAL_CONST(99326.878615578535/8.0),
- REAL_CONST(99350.549711746993/8.0),
- REAL_CONST(99374.222217958435/8.0),
- REAL_CONST(99397.896134044888/8.0),
- REAL_CONST(99421.571459838422/8.0),
- REAL_CONST(99445.248195171211/8.0),
- REAL_CONST(99468.926339875441/8.0),
- REAL_CONST(99492.605893783344/8.0),
- REAL_CONST(99516.286856727209/8.0),
- REAL_CONST(99539.969228539398/8.0),
- REAL_CONST(99563.653009052287/8.0),
- REAL_CONST(99587.338198098325/8.0),
- REAL_CONST(99611.024795510006/8.0),
- REAL_CONST(99634.712801119866/8.0),
- REAL_CONST(99658.402214760499/8.0),
- REAL_CONST(99682.093036264545/8.0),
- REAL_CONST(99705.785265464699/8.0),
- REAL_CONST(99729.478902193689/8.0),
- REAL_CONST(99753.173946284325/8.0),
- REAL_CONST(99776.870397569437/8.0),
- REAL_CONST(99800.56825588191/8.0),
- REAL_CONST(99824.267521054688/8.0),
- REAL_CONST(99847.968192920773/8.0),
- REAL_CONST(99871.670271313182/8.0),
- REAL_CONST(99895.373756065004/8.0),
- REAL_CONST(99919.078647009388/8.0),
- REAL_CONST(99942.78494397951/8.0),
- REAL_CONST(99966.492646808634/8.0),
- REAL_CONST(99990.20175533001/8.0),
- REAL_CONST(100013.91226937699/8.0),
- REAL_CONST(100037.62418878295/8.0),
- REAL_CONST(100061.33751338134/8.0),
- REAL_CONST(100085.05224300563/8.0),
- REAL_CONST(100108.76837748935/8.0),
- REAL_CONST(100132.4859166661/8.0),
- REAL_CONST(100156.2048603695/8.0),
- REAL_CONST(100179.92520843323/8.0),
- REAL_CONST(100203.64696069101/8.0),
- REAL_CONST(100227.37011697664/8.0),
- REAL_CONST(100251.09467712394/8.0),
- REAL_CONST(100274.82064096678/8.0),
- REAL_CONST(100298.54800833909/8.0),
- REAL_CONST(100322.27677907483/8.0),
- REAL_CONST(100346.00695300807/8.0),
- REAL_CONST(100369.73852997283/8.0),
- REAL_CONST(100393.47150980328/8.0),
- REAL_CONST(100417.20589233354/8.0),
- REAL_CONST(100440.94167739789/8.0),
- REAL_CONST(100464.67886483055/8.0),
- REAL_CONST(100488.41745446586/8.0),
- REAL_CONST(100512.1574461382/8.0),
- REAL_CONST(100535.89883968196/8.0),
- REAL_CONST(100559.64163493161/8.0),
- REAL_CONST(100583.38583172169/8.0),
- REAL_CONST(100607.13142988674/8.0),
- REAL_CONST(100630.87842926137/8.0),
- REAL_CONST(100654.62682968024/8.0),
- REAL_CONST(100678.37663097809/8.0),
- REAL_CONST(100702.12783298964/8.0),
- REAL_CONST(100725.88043554971/8.0),
- REAL_CONST(100749.63443849317/8.0),
- REAL_CONST(100773.38984165489/8.0),
- REAL_CONST(100797.14664486986/8.0),
- REAL_CONST(100820.90484797307/8.0),
- REAL_CONST(100844.66445079957/8.0),
- REAL_CONST(100868.42545318443/8.0),
- REAL_CONST(100892.18785496285/8.0),
- REAL_CONST(100915.95165596998/8.0),
- REAL_CONST(100939.71685604109/8.0),
- REAL_CONST(100963.48345501146/8.0),
- REAL_CONST(100987.25145271645/8.0),
- REAL_CONST(101011.02084899142/8.0),
- REAL_CONST(101034.79164367182/8.0),
- REAL_CONST(101058.56383659317/8.0),
- REAL_CONST(101082.33742759094/8.0),
- REAL_CONST(101106.11241650078/8.0),
- REAL_CONST(101129.88880315828/8.0),
- REAL_CONST(101153.66658739912/8.0),
- REAL_CONST(101177.44576905905/8.0),
- REAL_CONST(101201.22634797383/8.0),
- REAL_CONST(101225.00832397929/8.0),
- REAL_CONST(101248.7916969113/8.0),
- REAL_CONST(101272.57646660579/8.0),
- REAL_CONST(101296.36263289873/8.0),
- REAL_CONST(101320.15019562612/8.0),
- REAL_CONST(101343.93915462404/8.0),
- REAL_CONST(101367.7295097286/8.0),
- REAL_CONST(101391.52126077596/8.0),
- REAL_CONST(101415.31440760233/8.0),
- REAL_CONST(101439.10895004397/8.0),
- REAL_CONST(101462.9048879372/8.0),
- REAL_CONST(101486.70222111834/8.0),
- REAL_CONST(101510.50094942382/8.0),
- REAL_CONST(101534.30107269008/8.0),
- REAL_CONST(101558.10259075361/8.0),
- REAL_CONST(101581.90550345098/8.0),
- REAL_CONST(101605.70981061876/8.0),
- REAL_CONST(101629.5155120936/8.0),
- REAL_CONST(101653.32260771218/8.0),
- REAL_CONST(101677.13109731126/8.0),
- REAL_CONST(101700.9409807276/8.0),
- REAL_CONST(101724.75225779804/8.0),
- REAL_CONST(101748.56492835947/8.0),
- REAL_CONST(101772.37899224881/8.0),
- REAL_CONST(101796.19444930303/8.0),
- REAL_CONST(101820.01129935916/8.0),
- REAL_CONST(101843.82954225427/8.0),
- REAL_CONST(101867.64917782549/8.0),
- REAL_CONST(101891.47020590997/8.0),
- REAL_CONST(101915.29262634492/8.0),
- REAL_CONST(101939.11643896763/8.0),
- REAL_CONST(101962.94164361537/8.0),
- REAL_CONST(101986.76824012553/8.0),
- REAL_CONST(102010.59622833549/8.0),
- REAL_CONST(102034.42560808272/8.0),
- REAL_CONST(102058.25637920471/8.0),
- REAL_CONST(102082.08854153901/8.0),
- REAL_CONST(102105.9220949232/8.0),
- REAL_CONST(102129.75703919494/8.0),
- REAL_CONST(102153.59337419191/8.0),
- REAL_CONST(102177.43109975185/8.0),
- REAL_CONST(102201.27021571253/8.0),
- REAL_CONST(102225.1107219118/8.0),
- REAL_CONST(102248.95261818753/8.0),
- REAL_CONST(102272.79590437764/8.0),
- REAL_CONST(102296.64058032009/8.0),
- REAL_CONST(102320.48664585294/8.0),
- REAL_CONST(102344.33410081422/8.0),
- REAL_CONST(102368.18294504205/8.0),
- REAL_CONST(102392.03317837461/8.0),
- REAL_CONST(102415.88480065008/8.0),
- REAL_CONST(102439.73781170673/8.0),
- REAL_CONST(102463.59221138287/8.0),
- REAL_CONST(102487.44799951684/8.0),
- REAL_CONST(102511.30517594704/8.0),
- REAL_CONST(102535.1637405119/8.0),
- REAL_CONST(102559.02369304992/8.0),
- REAL_CONST(102582.88503339965/8.0),
- REAL_CONST(102606.74776139967/8.0),
- REAL_CONST(102630.61187688859/8.0),
- REAL_CONST(102654.4773797051/8.0),
- REAL_CONST(102678.34426968795/8.0),
- REAL_CONST(102702.21254667587/8.0),
- REAL_CONST(102726.08221050771/8.0),
- REAL_CONST(102749.95326102231/8.0),
- REAL_CONST(102773.8256980586/8.0),
- REAL_CONST(102797.69952145554/8.0),
- REAL_CONST(102821.57473105213/8.0),
- REAL_CONST(102845.45132668741/8.0),
- REAL_CONST(102869.32930820051/8.0),
- REAL_CONST(102893.20867543056/8.0),
- REAL_CONST(102917.08942821674/8.0),
- REAL_CONST(102940.97156639832/8.0),
- REAL_CONST(102964.85508981455/8.0),
- REAL_CONST(102988.73999830478/8.0),
- REAL_CONST(103012.6262917084/8.0),
- REAL_CONST(103036.51396986481/8.0),
- REAL_CONST(103060.40303261351/8.0),
- REAL_CONST(103084.293479794/8.0),
- REAL_CONST(103108.18531124585/8.0),
- REAL_CONST(103132.07852680866/8.0),
- REAL_CONST(103155.97312632212/8.0),
- REAL_CONST(103179.8691096259/8.0),
- REAL_CONST(103203.76647655977/8.0),
- REAL_CONST(103227.66522696352/8.0),
- REAL_CONST(103251.56536067701/8.0),
- REAL_CONST(103275.46687754011/8.0),
- REAL_CONST(103299.36977739276/8.0),
- REAL_CONST(103323.27406007495/8.0),
- REAL_CONST(103347.1797254267/8.0),
- REAL_CONST(103371.0867732881/8.0),
- REAL_CONST(103394.99520349925/8.0),
- REAL_CONST(103418.90501590034/8.0),
- REAL_CONST(103442.81621033157/8.0),
- REAL_CONST(103466.72878663319/8.0),
- REAL_CONST(103490.64274464553/8.0),
- REAL_CONST(103514.55808420894/8.0),
- REAL_CONST(103538.4748051638/8.0),
- REAL_CONST(103562.39290735057/8.0),
- REAL_CONST(103586.31239060973/8.0),
- REAL_CONST(103610.23325478184/8.0),
- REAL_CONST(103634.15549970744/8.0),
- REAL_CONST(103658.07912522719/8.0),
- REAL_CONST(103682.00413118176/8.0),
- REAL_CONST(103705.93051741188/8.0),
- REAL_CONST(103729.85828375829/8.0),
- REAL_CONST(103753.78743006183/8.0),
- REAL_CONST(103777.71795616332/8.0),
- REAL_CONST(103801.64986190372/8.0),
- REAL_CONST(103825.58314712394/8.0),
- REAL_CONST(103849.51781166498/8.0),
- REAL_CONST(103873.4538553679/8.0),
- REAL_CONST(103897.39127807376/8.0),
- REAL_CONST(103921.33007962372/8.0),
- REAL_CONST(103945.27025985894/8.0),
- REAL_CONST(103969.21181862066/8.0),
- REAL_CONST(103993.15475575015/8.0),
- REAL_CONST(104017.0990710887/8.0),
- REAL_CONST(104041.0447644777/8.0),
- REAL_CONST(104064.99183575854/8.0),
- REAL_CONST(104088.94028477269/8.0),
- REAL_CONST(104112.89011136163/8.0),
- REAL_CONST(104136.84131536692/8.0),
- REAL_CONST(104160.79389663014/8.0),
- REAL_CONST(104184.74785499295/8.0),
- REAL_CONST(104208.70319029699/8.0),
- REAL_CONST(104232.65990238401/8.0),
- REAL_CONST(104256.61799109577/8.0),
- REAL_CONST(104280.57745627411/8.0),
- REAL_CONST(104304.53829776087/8.0),
- REAL_CONST(104328.50051539797/8.0),
- REAL_CONST(104352.46410902737/8.0),
- REAL_CONST(104376.42907849104/8.0),
- REAL_CONST(104400.39542363105/8.0),
- REAL_CONST(104424.36314428948/8.0),
- REAL_CONST(104448.33224030846/8.0),
- REAL_CONST(104472.3027115302/8.0),
- REAL_CONST(104496.27455779689/8.0),
- REAL_CONST(104520.24777895081/8.0),
- REAL_CONST(104544.22237483428/8.0),
- REAL_CONST(104568.19834528965/8.0),
- REAL_CONST(104592.17569015936/8.0),
- REAL_CONST(104616.15440928582/8.0),
- REAL_CONST(104640.13450251156/8.0),
- REAL_CONST(104664.1159696791/8.0),
- REAL_CONST(104688.09881063103/8.0),
- REAL_CONST(104712.08302520998/8.0),
- REAL_CONST(104736.06861325864/8.0),
- REAL_CONST(104760.05557461972/8.0),
- REAL_CONST(104784.043909136/8.0),
- REAL_CONST(104808.03361665027/8.0),
- REAL_CONST(104832.0246970054/8.0),
- REAL_CONST(104856.01715004431/8.0),
- REAL_CONST(104880.01097560991/8.0),
- REAL_CONST(104904.00617354522/8.0),
- REAL_CONST(104928.00274369326/8.0),
- REAL_CONST(104952.00068589712/8.0),
- REAL_CONST(104975.99999999993/8.0),
- REAL_CONST(105000.00068584486/8.0),
- REAL_CONST(105024.00274327511/8.0),
- REAL_CONST(105048.00617213396/8.0),
- REAL_CONST(105072.0109722647/8.0),
- REAL_CONST(105096.0171435107/8.0),
- REAL_CONST(105120.02468571534/8.0),
- REAL_CONST(105144.03359872208/8.0),
- REAL_CONST(105168.04388237436/8.0),
- REAL_CONST(105192.05553651576/8.0),
- REAL_CONST(105216.06856098982/8.0),
- REAL_CONST(105240.08295564017/8.0),
- REAL_CONST(105264.09872031047/8.0),
- REAL_CONST(105288.11585484444/8.0),
- REAL_CONST(105312.13435908582/8.0),
- REAL_CONST(105336.1542328784/8.0),
- REAL_CONST(105360.17547606604/8.0),
- REAL_CONST(105384.19808849262/8.0),
- REAL_CONST(105408.22207000206/8.0),
- REAL_CONST(105432.24742043833/8.0),
- REAL_CONST(105456.27413964548/8.0),
- REAL_CONST(105480.30222746753/8.0),
- REAL_CONST(105504.33168374863/8.0),
- REAL_CONST(105528.36250833291/8.0),
- REAL_CONST(105552.39470106458/8.0),
- REAL_CONST(105576.42826178786/8.0),
- REAL_CONST(105600.46319034706/8.0),
- REAL_CONST(105624.49948658649/8.0),
- REAL_CONST(105648.53715035053/8.0),
- REAL_CONST(105672.5761814836/8.0),
- REAL_CONST(105696.61657983017/8.0),
- REAL_CONST(105720.65834523473/8.0),
- REAL_CONST(105744.70147754184/8.0),
- REAL_CONST(105768.7459765961/8.0),
- REAL_CONST(105792.79184224214/8.0),
- REAL_CONST(105816.83907432464/8.0),
- REAL_CONST(105840.88767268835/8.0),
- REAL_CONST(105864.93763717801/8.0),
- REAL_CONST(105888.98896763846/8.0),
- REAL_CONST(105913.04166391456/8.0),
- REAL_CONST(105937.09572585119/8.0),
- REAL_CONST(105961.15115329332/8.0),
- REAL_CONST(105985.20794608595/8.0),
- REAL_CONST(106009.26610407409/8.0),
- REAL_CONST(106033.32562710284/8.0),
- REAL_CONST(106057.38651501729/8.0),
- REAL_CONST(106081.44876766266/8.0),
- REAL_CONST(106105.51238488412/8.0),
- REAL_CONST(106129.57736652695/8.0),
- REAL_CONST(106153.64371243643/8.0),
- REAL_CONST(106177.71142245791/8.0),
- REAL_CONST(106201.78049643678/8.0),
- REAL_CONST(106225.85093421848/8.0),
- REAL_CONST(106249.92273564848/8.0),
- REAL_CONST(106273.99590057228/8.0),
- REAL_CONST(106298.07042883546/8.0),
- REAL_CONST(106322.14632028362/8.0),
- REAL_CONST(106346.22357476239/8.0),
- REAL_CONST(106370.30219211751/8.0),
- REAL_CONST(106394.38217219469/8.0),
- REAL_CONST(106418.46351483969/8.0),
- REAL_CONST(106442.54621989837/8.0),
- REAL_CONST(106466.63028721658/8.0),
- REAL_CONST(106490.71571664025/8.0),
- REAL_CONST(106514.80250801529/8.0),
- REAL_CONST(106538.89066118775/8.0),
- REAL_CONST(106562.98017600364/8.0),
- REAL_CONST(106587.07105230905/8.0),
- REAL_CONST(106611.16328995011/8.0),
- REAL_CONST(106635.25688877302/8.0),
- REAL_CONST(106659.35184862395/8.0),
- REAL_CONST(106683.44816934918/8.0),
- REAL_CONST(106707.54585079502/8.0),
- REAL_CONST(106731.64489280782/8.0),
- REAL_CONST(106755.74529523395/8.0),
- REAL_CONST(106779.84705791986/8.0),
- REAL_CONST(106803.95018071201/8.0),
- REAL_CONST(106828.05466345693/8.0),
- REAL_CONST(106852.16050600118/8.0),
- REAL_CONST(106876.26770819137/8.0),
- REAL_CONST(106900.37626987413/8.0),
- REAL_CONST(106924.48619089619/8.0),
- REAL_CONST(106948.59747110425/8.0),
- REAL_CONST(106972.71011034511/8.0),
- REAL_CONST(106996.82410846559/8.0),
- REAL_CONST(107020.93946531253/8.0),
- REAL_CONST(107045.05618073288/8.0),
- REAL_CONST(107069.17425457356/8.0),
- REAL_CONST(107093.29368668159/8.0),
- REAL_CONST(107117.41447690397/8.0),
- REAL_CONST(107141.53662508781/8.0),
- REAL_CONST(107165.66013108024/8.0),
- REAL_CONST(107189.7849947284/8.0),
- REAL_CONST(107213.91121587952/8.0),
- REAL_CONST(107238.03879438085/8.0),
- REAL_CONST(107262.16773007967/8.0),
- REAL_CONST(107286.29802282334/8.0),
- REAL_CONST(107310.42967245923/8.0),
- REAL_CONST(107334.56267883476/8.0),
- REAL_CONST(107358.69704179741/8.0),
- REAL_CONST(107382.83276119467/8.0),
- REAL_CONST(107406.96983687414/8.0),
- REAL_CONST(107431.10826868335/8.0),
- REAL_CONST(107455.24805646999/8.0),
- REAL_CONST(107479.38920008171/8.0),
- REAL_CONST(107503.53169936626/8.0),
- REAL_CONST(107527.67555417139/8.0),
- REAL_CONST(107551.82076434491/8.0),
- REAL_CONST(107575.96732973469/8.0),
- REAL_CONST(107600.11525018861/8.0),
- REAL_CONST(107624.26452555459/8.0),
- REAL_CONST(107648.41515568066/8.0),
- REAL_CONST(107672.56714041479/8.0),
- REAL_CONST(107696.72047960508/8.0),
- REAL_CONST(107720.87517309963/8.0),
- REAL_CONST(107745.03122074658/8.0),
- REAL_CONST(107769.18862239413/8.0),
- REAL_CONST(107793.34737789053/8.0),
- REAL_CONST(107817.50748708403/8.0),
- REAL_CONST(107841.66894982298/8.0),
- REAL_CONST(107865.83176595572/8.0),
- REAL_CONST(107889.99593533068/8.0),
- REAL_CONST(107914.16145779629/8.0),
- REAL_CONST(107938.32833320105/8.0),
- REAL_CONST(107962.49656139348/8.0),
- REAL_CONST(107986.66614222217/8.0),
- REAL_CONST(108010.83707553572/8.0),
- REAL_CONST(108035.00936118282/8.0),
- REAL_CONST(108059.18299901215/8.0),
- REAL_CONST(108083.35798887245/8.0),
- REAL_CONST(108107.53433061253/8.0),
- REAL_CONST(108131.71202408121/8.0),
- REAL_CONST(108155.89106912735/8.0),
- REAL_CONST(108180.07146559987/8.0),
- REAL_CONST(108204.25321334775/8.0),
- REAL_CONST(108228.43631221994/8.0),
- REAL_CONST(108252.62076206553/8.0),
- REAL_CONST(108276.80656273357/8.0),
- REAL_CONST(108300.99371407321/8.0),
- REAL_CONST(108325.18221593359/8.0),
- REAL_CONST(108349.37206816394/8.0),
- REAL_CONST(108373.56327061349/8.0),
- REAL_CONST(108397.75582313156/8.0),
- REAL_CONST(108421.94972556747/8.0),
- REAL_CONST(108446.1449777706/8.0),
- REAL_CONST(108470.34157959036/8.0),
- REAL_CONST(108494.53953087622/8.0),
- REAL_CONST(108518.73883147769/8.0),
- REAL_CONST(108542.93948124432/8.0),
- REAL_CONST(108567.14148002568/8.0),
- REAL_CONST(108591.34482767139/8.0),
- REAL_CONST(108615.54952403114/8.0),
- REAL_CONST(108639.75556895464/8.0),
- REAL_CONST(108663.96296229165/8.0),
- REAL_CONST(108688.17170389196/8.0),
- REAL_CONST(108712.38179360541/8.0),
- REAL_CONST(108736.59323128188/8.0),
- REAL_CONST(108760.80601677128/8.0),
- REAL_CONST(108785.02014992358/8.0),
- REAL_CONST(108809.23563058881/8.0),
- REAL_CONST(108833.45245861699/8.0),
- REAL_CONST(108857.67063385822/8.0),
- REAL_CONST(108881.89015616261/8.0),
- REAL_CONST(108906.11102538036/8.0),
- REAL_CONST(108930.33324136167/8.0),
- REAL_CONST(108954.55680395682/8.0),
- REAL_CONST(108978.78171301607/8.0),
- REAL_CONST(109003.00796838976/8.0),
- REAL_CONST(109027.23556992831/8.0),
- REAL_CONST(109051.46451748211/8.0),
- REAL_CONST(109075.69481090162/8.0),
- REAL_CONST(109099.92645003737/8.0),
- REAL_CONST(109124.15943473989/8.0),
- REAL_CONST(109148.39376485976/8.0),
- REAL_CONST(109172.62944024763/8.0),
- REAL_CONST(109196.86646075416/8.0),
- REAL_CONST(109221.10482623006/8.0),
- REAL_CONST(109245.34453652608/8.0),
- REAL_CONST(109269.58559149304/8.0),
- REAL_CONST(109293.82799098175/8.0),
- REAL_CONST(109318.07173484311/8.0),
- REAL_CONST(109342.31682292801/8.0),
- REAL_CONST(109366.56325508743/8.0),
- REAL_CONST(109390.81103117237/8.0),
- REAL_CONST(109415.06015103387/8.0),
- REAL_CONST(109439.31061452301/8.0),
- REAL_CONST(109463.56242149093/8.0),
- REAL_CONST(109487.8155717888/8.0),
- REAL_CONST(109512.07006526781/8.0),
- REAL_CONST(109536.3259017792/8.0),
- REAL_CONST(109560.58308117429/8.0),
- REAL_CONST(109584.8416033044/8.0),
- REAL_CONST(109609.1014680209/8.0),
- REAL_CONST(109633.36267517522/8.0),
- REAL_CONST(109657.62522461878/8.0),
- REAL_CONST(109681.88911620311/8.0),
- REAL_CONST(109706.15434977971/8.0),
- REAL_CONST(109730.4209252002/8.0),
- REAL_CONST(109754.68884231619/8.0),
- REAL_CONST(109778.95810097932/8.0),
- REAL_CONST(109803.22870104131/8.0),
- REAL_CONST(109827.50064235389/8.0),
- REAL_CONST(109851.77392476884/8.0),
- REAL_CONST(109876.04854813802/8.0),
- REAL_CONST(109900.32451231324/8.0),
- REAL_CONST(109924.60181714644/8.0),
- REAL_CONST(109948.88046248957/8.0),
- REAL_CONST(109973.1604481946/8.0),
- REAL_CONST(109997.44177411357/8.0),
- REAL_CONST(110021.72444009855/8.0),
- REAL_CONST(110046.00844600165/8.0),
- REAL_CONST(110070.29379167501/8.0),
- REAL_CONST(110094.58047697082/8.0),
- REAL_CONST(110118.86850174134/8.0),
- REAL_CONST(110143.15786583882/8.0),
- REAL_CONST(110167.44856911557/8.0),
- REAL_CONST(110191.74061142397/8.0),
- REAL_CONST(110216.03399261639/8.0),
- REAL_CONST(110240.32871254528/8.0),
- REAL_CONST(110264.62477106311/8.0),
- REAL_CONST(110288.9221680224/8.0),
- REAL_CONST(110313.22090327571/8.0),
- REAL_CONST(110337.52097667565/8.0),
- REAL_CONST(110361.82238807483/8.0),
- REAL_CONST(110386.12513732594/8.0),
- REAL_CONST(110410.42922428172/8.0),
- REAL_CONST(110434.73464879491/8.0),
- REAL_CONST(110459.04141071832/8.0),
- REAL_CONST(110483.34950990479/8.0),
- REAL_CONST(110507.6589462072/8.0),
- REAL_CONST(110531.96971947847/8.0),
- REAL_CONST(110556.28182957157/8.0),
- REAL_CONST(110580.5952763395/8.0),
- REAL_CONST(110604.91005963532/8.0),
- REAL_CONST(110629.22617931209/8.0),
- REAL_CONST(110653.54363522294/8.0),
- REAL_CONST(110677.86242722106/8.0),
- REAL_CONST(110702.18255515963/8.0),
- REAL_CONST(110726.50401889188/8.0),
- REAL_CONST(110750.82681827113/8.0),
- REAL_CONST(110775.1509531507/8.0),
- REAL_CONST(110799.47642338395/8.0),
- REAL_CONST(110823.80322882428/8.0),
- REAL_CONST(110848.13136932514/8.0),
- REAL_CONST(110872.46084474004/8.0),
- REAL_CONST(110896.79165492248/8.0),
- REAL_CONST(110921.12379972603/8.0),
- REAL_CONST(110945.4572790043/8.0),
- REAL_CONST(110969.79209261097/8.0),
- REAL_CONST(110994.12824039967/8.0),
- REAL_CONST(111018.46572222417/8.0),
- REAL_CONST(111042.80453793822/8.0),
- REAL_CONST(111067.14468739564/8.0),
- REAL_CONST(111091.48617045028/8.0),
- REAL_CONST(111115.82898695602/8.0),
- REAL_CONST(111140.1731367668/8.0),
- REAL_CONST(111164.51861973655/8.0),
- REAL_CONST(111188.86543571933/8.0),
- REAL_CONST(111213.21358456917/8.0),
- REAL_CONST(111237.56306614014/8.0),
- REAL_CONST(111261.91388028639/8.0),
- REAL_CONST(111286.26602686207/8.0),
- REAL_CONST(111310.61950572141/8.0),
- REAL_CONST(111334.97431671864/8.0),
- REAL_CONST(111359.33045970804/8.0),
- REAL_CONST(111383.68793454397/8.0),
- REAL_CONST(111408.04674108078/8.0),
- REAL_CONST(111432.40687917286/8.0),
- REAL_CONST(111456.76834867468/8.0),
- REAL_CONST(111481.13114944073/8.0),
- REAL_CONST(111505.49528132551/8.0),
- REAL_CONST(111529.86074418361/8.0),
- REAL_CONST(111554.22753786964/8.0),
- REAL_CONST(111578.59566223821/8.0),
- REAL_CONST(111602.96511714405/8.0),
- REAL_CONST(111627.33590244185/8.0),
- REAL_CONST(111651.7080179864/8.0),
- REAL_CONST(111676.08146363248/8.0),
- REAL_CONST(111700.45623923496/8.0),
- REAL_CONST(111724.8323446487/8.0),
- REAL_CONST(111749.20977972864/8.0),
- REAL_CONST(111773.58854432974/8.0),
- REAL_CONST(111797.96863830699/8.0),
- REAL_CONST(111822.35006151545/8.0),
- REAL_CONST(111846.73281381019/8.0),
- REAL_CONST(111871.11689504632/8.0),
- REAL_CONST(111895.50230507903/8.0),
- REAL_CONST(111919.8890437635/8.0),
- REAL_CONST(111944.27711095495/8.0),
- REAL_CONST(111968.6665065087/8.0),
- REAL_CONST(111993.05723028004/8.0),
- REAL_CONST(112017.44928212435/8.0),
- REAL_CONST(112041.842661897/8.0),
- REAL_CONST(112066.23736945343/8.0),
- REAL_CONST(112090.63340464912/8.0),
- REAL_CONST(112115.03076733962/8.0),
- REAL_CONST(112139.42945738042/8.0),
- REAL_CONST(112163.82947462716/8.0),
- REAL_CONST(112188.23081893545/8.0),
- REAL_CONST(112212.63349016097/8.0),
- REAL_CONST(112237.03748815943/8.0),
- REAL_CONST(112261.44281278658/8.0),
- REAL_CONST(112285.84946389822/8.0),
- REAL_CONST(112310.25744135017/8.0),
- REAL_CONST(112334.66674499828/8.0),
- REAL_CONST(112359.07737469849/8.0),
- REAL_CONST(112383.48933030672/8.0),
- REAL_CONST(112407.90261167898/8.0),
- REAL_CONST(112432.31721867126/8.0),
- REAL_CONST(112456.73315113965/8.0),
- REAL_CONST(112481.15040894024/8.0),
- REAL_CONST(112505.56899192919/8.0),
- REAL_CONST(112529.98889996267/8.0),
- REAL_CONST(112554.41013289688/8.0),
- REAL_CONST(112578.8326905881/8.0),
- REAL_CONST(112603.25657289263/8.0),
- REAL_CONST(112627.68177966679/8.0),
- REAL_CONST(112652.10831076698/8.0),
- REAL_CONST(112676.53616604958/8.0),
- REAL_CONST(112700.96534537108/8.0),
- REAL_CONST(112725.39584858794/8.0),
- REAL_CONST(112749.82767555672/8.0),
- REAL_CONST(112774.26082613398/8.0),
- REAL_CONST(112798.6953001763/8.0),
- REAL_CONST(112823.13109754038/8.0),
- REAL_CONST(112847.56821808286/8.0),
- REAL_CONST(112872.00666166049/8.0),
- REAL_CONST(112896.44642813003/8.0),
- REAL_CONST(112920.88751734827/8.0),
- REAL_CONST(112945.32992917208/8.0),
- REAL_CONST(112969.77366345831/8.0),
- REAL_CONST(112994.21872006389/8.0),
- REAL_CONST(113018.66509884578/8.0),
- REAL_CONST(113043.11279966099/8.0),
- REAL_CONST(113067.56182236652/8.0),
- REAL_CONST(113092.01216681948/8.0),
- REAL_CONST(113116.46383287695/8.0),
- REAL_CONST(113140.9168203961/8.0),
- REAL_CONST(113165.37112923413/8.0),
- REAL_CONST(113189.82675924824/8.0),
- REAL_CONST(113214.28371029573/8.0),
- REAL_CONST(113238.74198223387/8.0),
- REAL_CONST(113263.20157492002/8.0),
- REAL_CONST(113287.66248821157/8.0),
- REAL_CONST(113312.12472196593/8.0),
- REAL_CONST(113336.58827604055/8.0),
- REAL_CONST(113361.05315029295/8.0),
- REAL_CONST(113385.51934458067/8.0),
- REAL_CONST(113409.98685876124/8.0),
- REAL_CONST(113434.45569269233/8.0),
- REAL_CONST(113458.92584623155/8.0),
- REAL_CONST(113483.39731923661/8.0),
- REAL_CONST(113507.87011156522/8.0),
- REAL_CONST(113532.34422307517/8.0),
- REAL_CONST(113556.81965362425/8.0),
- REAL_CONST(113581.2964030703/8.0),
- REAL_CONST(113605.77447127122/8.0),
- REAL_CONST(113630.25385808491/8.0),
- REAL_CONST(113654.73456336933/8.0),
- REAL_CONST(113679.2165869825/8.0),
- REAL_CONST(113703.69992878241/8.0),
- REAL_CONST(113728.18458862718/8.0),
- REAL_CONST(113752.67056637487/8.0),
- REAL_CONST(113777.15786188368/8.0),
- REAL_CONST(113801.64647501177/8.0),
- REAL_CONST(113826.13640561736/8.0),
- REAL_CONST(113850.62765355874/8.0),
- REAL_CONST(113875.12021869418/8.0),
- REAL_CONST(113899.61410088204/8.0),
- REAL_CONST(113924.1092999807/8.0),
- REAL_CONST(113948.60581584855/8.0),
- REAL_CONST(113973.10364834407/8.0),
- REAL_CONST(113997.60279732574/8.0),
- REAL_CONST(114022.1032626521/8.0),
- REAL_CONST(114046.60504418171/8.0),
- REAL_CONST(114071.10814177318/8.0),
- REAL_CONST(114095.61255528514/8.0),
- REAL_CONST(114120.11828457628/8.0),
- REAL_CONST(114144.62532950533/8.0),
- REAL_CONST(114169.13368993104/8.0),
- REAL_CONST(114193.6433657122/8.0),
- REAL_CONST(114218.15435670764/8.0),
- REAL_CONST(114242.66666277625/8.0),
- REAL_CONST(114267.18028377694/8.0),
- REAL_CONST(114291.69521956862/8.0),
- REAL_CONST(114316.21147001031/8.0),
- REAL_CONST(114340.72903496103/8.0),
- REAL_CONST(114365.24791427983/8.0),
- REAL_CONST(114389.7681078258/8.0),
- REAL_CONST(114414.2896154581/8.0),
- REAL_CONST(114438.81243703589/8.0),
- REAL_CONST(114463.33657241837/8.0),
- REAL_CONST(114487.8620214648/8.0),
- REAL_CONST(114512.38878403447/8.0),
- REAL_CONST(114536.91685998671/8.0),
- REAL_CONST(114561.44624918087/8.0),
- REAL_CONST(114585.97695147636/8.0),
- REAL_CONST(114610.5089667326/8.0),
- REAL_CONST(114635.04229480909/8.0),
- REAL_CONST(114659.57693556532/8.0),
- REAL_CONST(114684.11288886084/8.0),
- REAL_CONST(114708.65015455526/8.0),
- REAL_CONST(114733.18873250818/8.0),
- REAL_CONST(114757.72862257928/8.0),
- REAL_CONST(114782.26982462825/8.0),
- REAL_CONST(114806.81233851484/8.0),
- REAL_CONST(114831.35616409882/8.0),
- REAL_CONST(114855.90130123998/8.0),
- REAL_CONST(114880.44774979822/8.0),
- REAL_CONST(114904.99550963337/8.0),
- REAL_CONST(114929.5445806054/8.0),
- REAL_CONST(114954.09496257425/8.0),
- REAL_CONST(114978.64665539992/8.0),
- REAL_CONST(115003.19965894247/8.0),
- REAL_CONST(115027.75397306195/8.0),
- REAL_CONST(115052.30959761847/8.0),
- REAL_CONST(115076.86653247218/8.0),
- REAL_CONST(115101.42477748329/8.0),
- REAL_CONST(115125.984332512/8.0),
- REAL_CONST(115150.54519741859/8.0),
- REAL_CONST(115175.10737206334/8.0),
- REAL_CONST(115199.67085630659/8.0),
- REAL_CONST(115224.23565000873/8.0),
- REAL_CONST(115248.80175303014/8.0),
- REAL_CONST(115273.3691652313/8.0),
- REAL_CONST(115297.93788647266/8.0),
- REAL_CONST(115322.50791661476/8.0),
- REAL_CONST(115347.07925551817/8.0),
- REAL_CONST(115371.65190304347/8.0),
- REAL_CONST(115396.22585905129/8.0),
- REAL_CONST(115420.80112340231/8.0),
- REAL_CONST(115445.37769595724/8.0),
- REAL_CONST(115469.95557657682/8.0),
- REAL_CONST(115494.53476512182/8.0),
- REAL_CONST(115519.11526145306/8.0),
- REAL_CONST(115543.69706543141/8.0),
- REAL_CONST(115568.28017691776/8.0),
- REAL_CONST(115592.86459577303/8.0),
- REAL_CONST(115617.4503218582/8.0),
- REAL_CONST(115642.03735503425/8.0),
- REAL_CONST(115666.62569516223/8.0),
- REAL_CONST(115691.21534210323/8.0),
- REAL_CONST(115715.80629571836/8.0),
- REAL_CONST(115740.39855586876/8.0),
- REAL_CONST(115764.99212241563/8.0),
- REAL_CONST(115789.58699522018/8.0),
- REAL_CONST(115814.18317414368/8.0),
- REAL_CONST(115838.78065904744/8.0),
- REAL_CONST(115863.37944979276/8.0),
- REAL_CONST(115887.97954624105/8.0),
- REAL_CONST(115912.5809482537/8.0),
- REAL_CONST(115937.18365569216/8.0),
- REAL_CONST(115961.78766841792/8.0),
- REAL_CONST(115986.39298629249/8.0),
- REAL_CONST(116010.99960917742/8.0),
- REAL_CONST(116035.60753693432/8.0),
- REAL_CONST(116060.21676942479/8.0),
- REAL_CONST(116084.82730651053/8.0),
- REAL_CONST(116109.43914805322/8.0),
- REAL_CONST(116134.0522939146/8.0),
- REAL_CONST(116158.66674395646/8.0),
- REAL_CONST(116183.2824980406/8.0),
- REAL_CONST(116207.89955602887/8.0),
- REAL_CONST(116232.51791778316/8.0),
- REAL_CONST(116257.13758316539/8.0),
- REAL_CONST(116281.75855203751/8.0),
- REAL_CONST(116306.38082426153/8.0),
- REAL_CONST(116331.00439969949/8.0),
- REAL_CONST(116355.62927821343/8.0),
- REAL_CONST(116380.25545966547/8.0),
- REAL_CONST(116404.88294391775/8.0),
- REAL_CONST(116429.51173083246/8.0),
- REAL_CONST(116454.14182027178/8.0),
- REAL_CONST(116478.77321209799/8.0),
- REAL_CONST(116503.40590617337/8.0),
- REAL_CONST(116528.03990236025/8.0),
- REAL_CONST(116552.67520052097/8.0),
- REAL_CONST(116577.31180051794/8.0),
- REAL_CONST(116601.94970221359/8.0),
- REAL_CONST(116626.5889054704/8.0),
- REAL_CONST(116651.22941015086/8.0),
- REAL_CONST(116675.87121611751/8.0),
- REAL_CONST(116700.51432323294/8.0),
- REAL_CONST(116725.15873135976/8.0),
- REAL_CONST(116749.8044403606/8.0),
- REAL_CONST(116774.45145009817/8.0),
- REAL_CONST(116799.0997604352/8.0),
- REAL_CONST(116823.74937123443/8.0),
- REAL_CONST(116848.40028235866/8.0),
- REAL_CONST(116873.05249367072/8.0),
- REAL_CONST(116897.70600503348/8.0),
- REAL_CONST(116922.36081630984/8.0),
- REAL_CONST(116947.01692736275/8.0),
- REAL_CONST(116971.67433805518/8.0),
- REAL_CONST(116996.33304825013/8.0),
- REAL_CONST(117020.99305781067/8.0),
- REAL_CONST(117045.65436659988/8.0),
- REAL_CONST(117070.31697448085/8.0),
- REAL_CONST(117094.98088131678/8.0),
- REAL_CONST(117119.64608697082/8.0),
- REAL_CONST(117144.31259130624/8.0),
- REAL_CONST(117168.98039418629/8.0),
- REAL_CONST(117193.64949547425/8.0),
- REAL_CONST(117218.31989503348/8.0),
- REAL_CONST(117242.99159272734/8.0),
- REAL_CONST(117267.66458841923/8.0),
- REAL_CONST(117292.33888197262/8.0),
- REAL_CONST(117317.01447325097/8.0),
- REAL_CONST(117341.6913621178/8.0),
- REAL_CONST(117366.36954843666/8.0),
- REAL_CONST(117391.04903207115/8.0),
- REAL_CONST(117415.72981288488/8.0),
- REAL_CONST(117440.41189074152/8.0),
- REAL_CONST(117465.09526550474/8.0),
- REAL_CONST(117489.77993703831/8.0),
- REAL_CONST(117514.46590520597/8.0),
- REAL_CONST(117539.15316987153/8.0),
- REAL_CONST(117563.84173089883/8.0),
- REAL_CONST(117588.53158815173/8.0),
- REAL_CONST(117613.22274149416/8.0),
- REAL_CONST(117637.91519079007/8.0),
- REAL_CONST(117662.60893590341/8.0),
- REAL_CONST(117687.30397669821/8.0),
- REAL_CONST(117712.00031303853/8.0),
- REAL_CONST(117736.69794478847/8.0),
- REAL_CONST(117761.39687181212/8.0),
- REAL_CONST(117786.09709397367/8.0),
- REAL_CONST(117810.7986111373/8.0),
- REAL_CONST(117835.50142316725/8.0),
- REAL_CONST(117860.20552992777/8.0),
- REAL_CONST(117884.91093128319/8.0),
- REAL_CONST(117909.6176270978/8.0),
- REAL_CONST(117934.32561723603/8.0),
- REAL_CONST(117959.03490156225/8.0),
- REAL_CONST(117983.74547994092/8.0),
- REAL_CONST(118008.45735223651/8.0),
- REAL_CONST(118033.17051831353/8.0),
- REAL_CONST(118057.88497803656/8.0),
- REAL_CONST(118082.60073127014/8.0),
- REAL_CONST(118107.31777787894/8.0),
- REAL_CONST(118132.03611772758/8.0),
- REAL_CONST(118156.75575068076/8.0),
- REAL_CONST(118181.47667660323/8.0),
- REAL_CONST(118206.19889535972/8.0),
- REAL_CONST(118230.92240681504/8.0),
- REAL_CONST(118255.64721083404/8.0),
- REAL_CONST(118280.37330728157/8.0),
- REAL_CONST(118305.10069602253/8.0),
- REAL_CONST(118329.82937692189/8.0),
- REAL_CONST(118354.55934984458/8.0),
- REAL_CONST(118379.29061465565/8.0),
- REAL_CONST(118404.02317122012/8.0),
- REAL_CONST(118428.75701940308/8.0),
- REAL_CONST(118453.49215906965/8.0),
- REAL_CONST(118478.22859008498/8.0),
- REAL_CONST(118502.96631231424/8.0),
- REAL_CONST(118527.70532562268/8.0),
- REAL_CONST(118552.44562987552/8.0),
- REAL_CONST(118577.18722493808/8.0),
- REAL_CONST(118601.93011067568/8.0),
- REAL_CONST(118626.67428695368/8.0),
- REAL_CONST(118651.41975363747/8.0),
- REAL_CONST(118676.16651059251/8.0),
- REAL_CONST(118700.91455768423/8.0),
- REAL_CONST(118725.66389477813/8.0),
- REAL_CONST(118750.41452173979/8.0),
- REAL_CONST(118775.16643843475/8.0),
- REAL_CONST(118799.91964472862/8.0),
- REAL_CONST(118824.67414048707/8.0),
- REAL_CONST(118849.42992557574/8.0),
- REAL_CONST(118874.18699986035/8.0),
- REAL_CONST(118898.94536320666/8.0),
- REAL_CONST(118923.70501548045/8.0),
- REAL_CONST(118948.46595654752/8.0),
- REAL_CONST(118973.22818627374/8.0),
- REAL_CONST(118997.99170452499/8.0),
- REAL_CONST(119022.7565111672/8.0),
- REAL_CONST(119047.52260606633/8.0),
- REAL_CONST(119072.28998908834/8.0),
- REAL_CONST(119097.0586600993/8.0),
- REAL_CONST(119121.82861896523/8.0),
- REAL_CONST(119146.59986555226/8.0),
- REAL_CONST(119171.3723997265/8.0),
- REAL_CONST(119196.14622135412/8.0),
- REAL_CONST(119220.92133030134/8.0),
- REAL_CONST(119245.69772643436/8.0),
- REAL_CONST(119270.47540961947/8.0),
- REAL_CONST(119295.25437972297/8.0),
- REAL_CONST(119320.03463661121/8.0),
- REAL_CONST(119344.81618015055/8.0),
- REAL_CONST(119369.5990102074/8.0),
- REAL_CONST(119394.38312664822/8.0),
- REAL_CONST(119419.16852933947/8.0),
- REAL_CONST(119443.95521814766/8.0),
- REAL_CONST(119468.74319293935/8.0),
- REAL_CONST(119493.53245358112/8.0),
- REAL_CONST(119518.32299993958/8.0),
- REAL_CONST(119543.11483188139/8.0),
- REAL_CONST(119567.90794927324/8.0),
- REAL_CONST(119592.70235198183/8.0),
- REAL_CONST(119617.49803987393/8.0),
- REAL_CONST(119642.29501281632/8.0),
- REAL_CONST(119667.09327067583/8.0),
- REAL_CONST(119691.89281331931/8.0),
- REAL_CONST(119716.69364061367/8.0),
- REAL_CONST(119741.49575242582/8.0),
- REAL_CONST(119766.29914862274/8.0),
- REAL_CONST(119791.10382907141/8.0),
- REAL_CONST(119815.90979363887/8.0),
- REAL_CONST(119840.71704219218/8.0),
- REAL_CONST(119865.52557459843/8.0),
- REAL_CONST(119890.33539072477/8.0),
- REAL_CONST(119915.14649043836/8.0),
- REAL_CONST(119939.95887360642/8.0),
- REAL_CONST(119964.77254009615/8.0),
- REAL_CONST(119989.58748977486/8.0),
- REAL_CONST(120014.40372250983/8.0),
- REAL_CONST(120039.22123816841/8.0),
- REAL_CONST(120064.04003661797/8.0),
- REAL_CONST(120088.86011772591/8.0),
- REAL_CONST(120113.6814813597/8.0),
- REAL_CONST(120138.5041273868/8.0),
- REAL_CONST(120163.3280556747/8.0),
- REAL_CONST(120188.15326609099/8.0),
- REAL_CONST(120212.97975850321/8.0),
- REAL_CONST(120237.807532779/8.0),
- REAL_CONST(120262.63658878599/8.0),
- REAL_CONST(120287.46692639188/8.0),
- REAL_CONST(120312.29854546436/8.0),
- REAL_CONST(120337.13144587121/8.0),
- REAL_CONST(120361.9656274802/8.0),
- REAL_CONST(120386.80109015915/8.0),
- REAL_CONST(120411.63783377589/8.0),
- REAL_CONST(120436.47585819835/8.0),
- REAL_CONST(120461.31516329442/8.0),
- REAL_CONST(120486.15574893207/8.0),
- REAL_CONST(120510.99761497928/8.0),
- REAL_CONST(120535.84076130406/8.0),
- REAL_CONST(120560.68518777451/8.0),
- REAL_CONST(120585.53089425867/8.0),
- REAL_CONST(120610.3778806247/8.0),
- REAL_CONST(120635.22614674074/8.0),
- REAL_CONST(120660.07569247499/8.0),
- REAL_CONST(120684.92651769568/8.0),
- REAL_CONST(120709.77862227106/8.0),
- REAL_CONST(120734.63200606944/8.0),
- REAL_CONST(120759.48666895913/8.0),
- REAL_CONST(120784.3426108085/8.0),
- REAL_CONST(120809.19983148595/8.0),
- REAL_CONST(120834.05833085992/8.0),
- REAL_CONST(120858.91810879884/8.0),
- REAL_CONST(120883.77916517125/8.0),
- REAL_CONST(120908.64149984565/8.0),
- REAL_CONST(120933.5051126906/8.0),
- REAL_CONST(120958.37000357473/8.0),
- REAL_CONST(120983.23617236665/8.0),
- REAL_CONST(121008.10361893504/8.0),
- REAL_CONST(121032.97234314861/8.0),
- REAL_CONST(121057.84234487606/8.0),
- REAL_CONST(121082.71362398617/8.0),
- REAL_CONST(121107.58618034775/8.0),
- REAL_CONST(121132.46001382964/8.0),
- REAL_CONST(121157.33512430069/8.0),
- REAL_CONST(121182.21151162982/8.0),
- REAL_CONST(121207.08917568595/8.0),
- REAL_CONST(121231.96811633807/8.0),
- REAL_CONST(121256.84833345517/8.0),
- REAL_CONST(121281.72982690629/8.0),
- REAL_CONST(121306.61259656049/8.0),
- REAL_CONST(121331.49664228689/8.0),
- REAL_CONST(121356.38196395461/8.0),
- REAL_CONST(121381.26856143285/8.0),
- REAL_CONST(121406.15643459078/8.0),
- REAL_CONST(121431.04558329767/8.0),
- REAL_CONST(121455.93600742276/8.0),
- REAL_CONST(121480.82770683538/8.0),
- REAL_CONST(121505.72068140487/8.0),
- REAL_CONST(121530.61493100057/8.0),
- REAL_CONST(121555.51045549192/8.0),
- REAL_CONST(121580.40725474835/8.0),
- REAL_CONST(121605.30532863933/8.0),
- REAL_CONST(121630.20467703436/8.0),
- REAL_CONST(121655.10529980299/8.0),
- REAL_CONST(121680.00719681478/8.0),
- REAL_CONST(121704.91036793934/8.0),
- REAL_CONST(121729.81481304632/8.0),
- REAL_CONST(121754.72053200539/8.0),
- REAL_CONST(121779.62752468624/8.0),
- REAL_CONST(121804.53579095862/8.0),
- REAL_CONST(121829.44533069231/8.0),
- REAL_CONST(121854.3561437571/8.0),
- REAL_CONST(121879.26823002285/8.0),
- REAL_CONST(121904.1815893594/8.0),
- REAL_CONST(121929.09622163669/8.0),
- REAL_CONST(121954.01212672464/8.0),
- REAL_CONST(121978.92930449323/8.0),
- REAL_CONST(122003.84775481246/8.0),
- REAL_CONST(122028.76747755238/8.0),
- REAL_CONST(122053.68847258303/8.0),
- REAL_CONST(122078.61073977455/8.0),
- REAL_CONST(122103.53427899707/8.0),
- REAL_CONST(122128.45909012076/8.0),
- REAL_CONST(122153.38517301581/8.0),
- REAL_CONST(122178.31252755247/8.0),
- REAL_CONST(122203.24115360099/8.0),
- REAL_CONST(122228.17105103172/8.0),
- REAL_CONST(122253.10221971494/8.0),
- REAL_CONST(122278.03465952107/8.0),
- REAL_CONST(122302.96837032049/8.0),
- REAL_CONST(122327.90335198362/8.0),
- REAL_CONST(122352.83960438096/8.0),
- REAL_CONST(122377.777127383/8.0),
- REAL_CONST(122402.71592086025/8.0),
- REAL_CONST(122427.65598468333/8.0),
- REAL_CONST(122452.59731872278/8.0),
- REAL_CONST(122477.53992284928/8.0),
- REAL_CONST(122502.48379693348/8.0),
- REAL_CONST(122527.42894084606/8.0),
- REAL_CONST(122552.37535445779/8.0),
- REAL_CONST(122577.32303763942/8.0),
- REAL_CONST(122602.27199026172/8.0),
- REAL_CONST(122627.22221219557/8.0),
- REAL_CONST(122652.17370331181/8.0),
- REAL_CONST(122677.12646348133/8.0),
- REAL_CONST(122702.08049257506/8.0),
- REAL_CONST(122727.03579046397/8.0),
- REAL_CONST(122751.99235701906/8.0),
- REAL_CONST(122776.95019211136/8.0),
- REAL_CONST(122801.9092956119/8.0),
- REAL_CONST(122826.8696673918/8.0),
- REAL_CONST(122851.83130732219/8.0),
- REAL_CONST(122876.79421527422/8.0),
- REAL_CONST(122901.75839111909/8.0),
- REAL_CONST(122926.72383472799/8.0),
- REAL_CONST(122951.69054597223/8.0),
- REAL_CONST(122976.65852472307/8.0),
- REAL_CONST(123001.62777085182/8.0),
- REAL_CONST(123026.59828422987/8.0),
- REAL_CONST(123051.57006472857/8.0),
- REAL_CONST(123076.54311221937/8.0),
- REAL_CONST(123101.5174265737/8.0),
- REAL_CONST(123126.49300766307/8.0),
- REAL_CONST(123151.46985535898/8.0),
- REAL_CONST(123176.44796953299/8.0),
- REAL_CONST(123201.42735005668/8.0),
- REAL_CONST(123226.40799680166/8.0),
- REAL_CONST(123251.38990963959/8.0),
- REAL_CONST(123276.37308844214/8.0),
- REAL_CONST(123301.35753308103/8.0),
- REAL_CONST(123326.343243428/8.0),
- REAL_CONST(123351.33021935483/8.0),
- REAL_CONST(123376.31846073334/8.0),
- REAL_CONST(123401.30796743535/8.0),
- REAL_CONST(123426.29873933276/8.0),
- REAL_CONST(123451.29077629748/8.0),
- REAL_CONST(123476.28407820144/8.0),
- REAL_CONST(123501.2786449166/8.0),
- REAL_CONST(123526.27447631498/8.0),
- REAL_CONST(123551.27157226863/8.0),
- REAL_CONST(123576.26993264959/8.0),
- REAL_CONST(123601.26955732999/8.0),
- REAL_CONST(123626.27044618195/8.0),
- REAL_CONST(123651.27259907764/8.0),
- REAL_CONST(123676.27601588926/8.0),
- REAL_CONST(123701.28069648903/8.0),
- REAL_CONST(123726.28664074924/8.0),
- REAL_CONST(123751.29384854218/8.0),
- REAL_CONST(123776.30231974016/8.0),
- REAL_CONST(123801.31205421555/8.0),
- REAL_CONST(123826.32305184075/8.0),
- REAL_CONST(123851.33531248817/8.0),
- REAL_CONST(123876.34883603029/8.0),
- REAL_CONST(123901.36362233957/8.0),
- REAL_CONST(123926.37967128855/8.0),
- REAL_CONST(123951.39698274979/8.0),
- REAL_CONST(123976.41555659588/8.0),
- REAL_CONST(124001.43539269941/8.0),
- REAL_CONST(124026.45649093305/8.0),
- REAL_CONST(124051.47885116948/8.0),
- REAL_CONST(124076.50247328142/8.0),
- REAL_CONST(124101.5273571416/8.0),
- REAL_CONST(124126.55350262282/8.0),
- REAL_CONST(124151.58090959788/8.0),
- REAL_CONST(124176.60957793961/8.0),
- REAL_CONST(124201.63950752091/8.0),
- REAL_CONST(124226.67069821467/8.0),
- REAL_CONST(124251.70314989384/8.0),
- REAL_CONST(124276.73686243138/8.0),
- REAL_CONST(124301.7718357003/8.0),
- REAL_CONST(124326.80806957364/8.0),
- REAL_CONST(124351.84556392446/8.0),
- REAL_CONST(124376.88431862585/8.0),
- REAL_CONST(124401.92433355095/8.0),
- REAL_CONST(124426.96560857294/8.0),
- REAL_CONST(124452.00814356498/8.0),
- REAL_CONST(124477.05193840031/8.0),
- REAL_CONST(124502.0969929522/8.0),
- REAL_CONST(124527.14330709392/8.0),
- REAL_CONST(124552.19088069882/8.0),
- REAL_CONST(124577.23971364023/8.0),
- REAL_CONST(124602.28980579154/8.0),
- REAL_CONST(124627.34115702618/8.0),
- REAL_CONST(124652.3937672176/8.0),
- REAL_CONST(124677.44763623926/8.0),
- REAL_CONST(124702.50276396469/8.0),
- REAL_CONST(124727.55915026742/8.0),
- REAL_CONST(124752.61679502104/8.0),
- REAL_CONST(124777.67569809916/8.0),
- REAL_CONST(124802.73585937542/8.0),
- REAL_CONST(124827.79727872348/8.0),
- REAL_CONST(124852.85995601704/8.0),
- REAL_CONST(124877.92389112986/8.0),
- REAL_CONST(124902.98908393568/8.0),
- REAL_CONST(124928.05553430831/8.0),
- REAL_CONST(124953.1232421216/8.0),
- REAL_CONST(124978.19220724938/8.0),
- REAL_CONST(125003.26242956554/8.0),
- REAL_CONST(125028.33390894404/8.0),
- REAL_CONST(125053.40664525882/8.0),
- REAL_CONST(125078.48063838384/8.0),
- REAL_CONST(125103.55588819318/8.0),
- REAL_CONST(125128.63239456083/8.0),
- REAL_CONST(125153.71015736091/8.0),
- REAL_CONST(125178.78917646752/8.0),
- REAL_CONST(125203.86945175481/8.0),
- REAL_CONST(125228.95098309696/8.0),
- REAL_CONST(125254.03377036817/8.0),
- REAL_CONST(125279.1178134427/8.0),
- REAL_CONST(125304.20311219479/8.0),
- REAL_CONST(125329.28966649878/8.0),
- REAL_CONST(125354.37747622898/8.0),
- REAL_CONST(125379.46654125977/8.0),
- REAL_CONST(125404.55686146552/8.0),
- REAL_CONST(125429.6484367207/8.0),
- REAL_CONST(125454.74126689974/8.0),
- REAL_CONST(125479.83535187715/8.0),
- REAL_CONST(125504.93069152744/8.0),
- REAL_CONST(125530.02728572517/8.0),
- REAL_CONST(125555.12513434493/8.0),
- REAL_CONST(125580.22423726133/8.0),
- REAL_CONST(125605.32459434902/8.0),
- REAL_CONST(125630.4262054827/8.0),
- REAL_CONST(125655.52907053704/8.0),
- REAL_CONST(125680.63318938682/8.0),
- REAL_CONST(125705.73856190679/8.0),
- REAL_CONST(125730.84518797178/8.0),
- REAL_CONST(125755.9530674566/8.0),
- REAL_CONST(125781.06220023613/8.0),
- REAL_CONST(125806.17258618528/8.0),
- REAL_CONST(125831.28422517896/8.0),
- REAL_CONST(125856.39711709213/8.0),
- REAL_CONST(125881.51126179981/8.0),
- REAL_CONST(125906.62665917698/8.0),
- REAL_CONST(125931.74330909875/8.0),
- REAL_CONST(125956.86121144016/8.0),
- REAL_CONST(125981.98036607634/8.0),
- REAL_CONST(126007.10077288245/8.0),
- REAL_CONST(126032.22243173365/8.0),
- REAL_CONST(126057.34534250517/8.0),
- REAL_CONST(126082.46950507225/8.0),
- REAL_CONST(126107.59491931014/8.0),
- REAL_CONST(126132.72158509417/8.0),
- REAL_CONST(126157.84950229966/8.0),
- REAL_CONST(126182.97867080198/8.0),
- REAL_CONST(126208.10909047653/8.0),
- REAL_CONST(126233.24076119871/8.0),
- REAL_CONST(126258.37368284403/8.0),
- REAL_CONST(126283.50785528794/8.0),
- REAL_CONST(126308.64327840599/8.0),
- REAL_CONST(126333.77995207369/8.0),
- REAL_CONST(126358.91787616667/8.0),
- REAL_CONST(126384.0570505605/8.0),
- REAL_CONST(126409.19747513086/8.0),
- REAL_CONST(126434.3391497534/8.0),
- REAL_CONST(126459.48207430386/8.0),
- REAL_CONST(126484.62624865794/8.0),
- REAL_CONST(126509.77167269142/8.0),
- REAL_CONST(126534.9183462801/8.0),
- REAL_CONST(126560.06626929982/8.0),
- REAL_CONST(126585.21544162642/8.0),
- REAL_CONST(126610.36586313581/8.0),
- REAL_CONST(126635.51753370393/8.0),
- REAL_CONST(126660.67045320668/8.0),
- REAL_CONST(126685.82462152008/8.0),
- REAL_CONST(126710.98003852014/8.0),
- REAL_CONST(126736.13670408291/8.0),
- REAL_CONST(126761.29461808444/8.0),
- REAL_CONST(126786.45378040087/8.0),
- REAL_CONST(126811.61419090834/8.0),
- REAL_CONST(126836.77584948298/8.0),
- REAL_CONST(126861.93875600102/8.0),
- REAL_CONST(126887.10291033868/8.0),
- REAL_CONST(126912.26831237224/8.0),
- REAL_CONST(126937.43496197795/8.0),
- REAL_CONST(126962.60285903217/8.0),
- REAL_CONST(126987.77200341123/8.0),
- REAL_CONST(127012.94239499152/8.0),
- REAL_CONST(127038.11403364947/8.0),
- REAL_CONST(127063.2869192615/8.0),
- REAL_CONST(127088.46105170409/8.0),
- REAL_CONST(127113.63643085376/8.0),
- REAL_CONST(127138.81305658702/8.0),
- REAL_CONST(127163.99092878048/8.0),
- REAL_CONST(127189.17004731069/8.0),
- REAL_CONST(127214.35041205429/8.0),
- REAL_CONST(127239.53202288797/8.0),
- REAL_CONST(127264.71487968838/8.0),
- REAL_CONST(127289.89898233226/8.0),
- REAL_CONST(127315.08433069635/8.0),
- REAL_CONST(127340.27092465744/8.0),
- REAL_CONST(127365.45876409234/8.0),
- REAL_CONST(127390.64784887788/8.0),
- REAL_CONST(127415.83817889093/8.0),
- REAL_CONST(127441.02975400841/8.0),
- REAL_CONST(127466.22257410725/8.0),
- REAL_CONST(127491.41663906439/8.0),
- REAL_CONST(127516.61194875685/8.0),
- REAL_CONST(127541.80850306165/8.0),
- REAL_CONST(127567.00630185583/8.0),
- REAL_CONST(127592.20534501647/8.0),
- REAL_CONST(127617.4056324207/8.0),
- REAL_CONST(127642.60716394568/8.0),
- REAL_CONST(127667.80993946856/8.0),
- REAL_CONST(127693.01395886653/8.0),
- REAL_CONST(127718.21922201688/8.0),
- REAL_CONST(127743.42572879682/8.0),
- REAL_CONST(127768.63347908368/8.0),
- REAL_CONST(127793.84247275478/8.0),
- REAL_CONST(127819.05270968749/8.0),
- REAL_CONST(127844.26418975917/8.0),
- REAL_CONST(127869.47691284724/8.0),
- REAL_CONST(127894.69087882918/8.0),
- REAL_CONST(127919.90608758242/8.0),
- REAL_CONST(127945.12253898452/8.0),
- REAL_CONST(127970.34023291297/8.0),
- REAL_CONST(127995.55916924537/8.0),
- REAL_CONST(128020.77934785932/8.0),
- REAL_CONST(128046.00076863244/8.0),
- REAL_CONST(128071.22343144237/8.0),
- REAL_CONST(128096.44733616684/8.0),
- REAL_CONST(128121.67248268353/8.0),
- REAL_CONST(128146.89887087021/8.0),
- REAL_CONST(128172.12650060465/8.0),
- REAL_CONST(128197.35537176467/8.0),
- REAL_CONST(128222.5854842281/8.0),
- REAL_CONST(128247.81683787282/8.0),
- REAL_CONST(128273.04943257671/8.0),
- REAL_CONST(128298.28326821771/8.0),
- REAL_CONST(128323.51834467379/8.0),
- REAL_CONST(128348.75466182294/8.0),
- REAL_CONST(128373.99221954317/8.0),
- REAL_CONST(128399.23101771252/8.0),
- REAL_CONST(128424.47105620909/8.0),
- REAL_CONST(128449.71233491098/8.0),
- REAL_CONST(128474.95485369631/8.0),
- REAL_CONST(128500.19861244329/8.0),
- REAL_CONST(128525.44361103009/8.0),
- REAL_CONST(128550.68984933494/8.0),
- REAL_CONST(128575.93732723613/8.0),
- REAL_CONST(128601.18604461191/8.0),
- REAL_CONST(128626.43600134061/8.0),
- REAL_CONST(128651.68719730059/8.0),
- REAL_CONST(128676.93963237021/8.0),
- REAL_CONST(128702.1933064279/8.0),
- REAL_CONST(128727.44821935208/8.0),
- REAL_CONST(128752.70437102125/8.0),
- REAL_CONST(128777.96176131385/8.0),
- REAL_CONST(128803.22039010846/8.0),
- REAL_CONST(128828.48025728362/8.0),
- REAL_CONST(128853.74136271792/8.0),
- REAL_CONST(128879.00370628996/8.0),
- REAL_CONST(128904.26728787841/8.0),
- REAL_CONST(128929.53210736193/8.0),
- REAL_CONST(128954.79816461923/8.0),
- REAL_CONST(128980.06545952905/8.0),
- REAL_CONST(129005.33399197015/8.0),
- REAL_CONST(129030.60376182134/8.0),
- REAL_CONST(129055.87476896142/8.0),
- REAL_CONST(129081.14701326926/8.0),
- REAL_CONST(129106.42049462376/8.0),
- REAL_CONST(129131.6952129038/8.0),
- REAL_CONST(129156.97116798835/8.0),
- REAL_CONST(129182.24835975636/8.0),
- REAL_CONST(129207.52678808685/8.0),
- REAL_CONST(129232.80645285884/8.0),
- REAL_CONST(129258.08735395141/8.0),
- REAL_CONST(129283.36949124365/8.0),
- REAL_CONST(129308.65286461466/8.0),
- REAL_CONST(129333.9374739436/8.0),
- REAL_CONST(129359.22331910966/8.0),
- REAL_CONST(129384.51039999202/8.0),
- REAL_CONST(129409.79871646997/8.0),
- REAL_CONST(129435.08826842274/8.0),
- REAL_CONST(129460.37905572963/8.0),
- REAL_CONST(129485.67107826998/8.0),
- REAL_CONST(129510.96433592314/8.0),
- REAL_CONST(129536.25882856851/8.0),
- REAL_CONST(129561.55455608548/8.0),
- REAL_CONST(129586.85151835352/8.0),
- REAL_CONST(129612.14971525209/8.0),
- REAL_CONST(129637.4491466607/8.0),
- REAL_CONST(129662.74981245887/8.0),
- REAL_CONST(129688.0517125262/8.0),
- REAL_CONST(129713.35484674224/8.0),
- REAL_CONST(129738.65921498663/8.0),
- REAL_CONST(129763.96481713903/8.0),
- REAL_CONST(129789.27165307909/8.0),
- REAL_CONST(129814.57972268655/8.0),
- REAL_CONST(129839.88902584116/8.0),
- REAL_CONST(129865.19956242264/8.0),
- REAL_CONST(129890.51133231082/8.0),
- REAL_CONST(129915.82433538554/8.0),
- REAL_CONST(129941.13857152662/8.0),
- REAL_CONST(129966.45404061397/8.0),
- REAL_CONST(129991.7707425275/8.0),
- REAL_CONST(130017.08867714716/8.0),
- REAL_CONST(130042.4078443529/8.0),
- REAL_CONST(130067.72824402474/8.0),
- REAL_CONST(130093.04987604271/8.0),
- REAL_CONST(130118.37274028687/8.0),
- REAL_CONST(130143.69683663732/8.0),
- REAL_CONST(130169.02216497416/8.0),
- REAL_CONST(130194.34872517755/8.0),
- REAL_CONST(130219.67651712766/8.0),
- REAL_CONST(130245.0055407047/8.0),
- REAL_CONST(130270.33579578891/8.0),
- REAL_CONST(130295.66728226055/8.0),
- REAL_CONST(130320.99999999991/8.0),
- REAL_CONST(130346.33394888733/8.0),
- REAL_CONST(130371.66912880314/8.0),
- REAL_CONST(130397.00553962773/8.0),
- REAL_CONST(130422.34318124152/8.0),
- REAL_CONST(130447.68205352494/8.0),
- REAL_CONST(130473.02215635845/8.0),
- REAL_CONST(130498.36348962256/8.0),
- REAL_CONST(130523.70605319779/8.0),
- REAL_CONST(130549.0498469647/8.0),
- REAL_CONST(130574.39487080388/8.0),
- REAL_CONST(130599.74112459592/8.0),
- REAL_CONST(130625.08860822149/8.0),
- REAL_CONST(130650.43732156123/8.0),
- REAL_CONST(130675.78726449587/8.0),
- REAL_CONST(130701.13843690613/8.0),
- REAL_CONST(130726.49083867275/8.0),
- REAL_CONST(130751.84446967654/8.0),
- REAL_CONST(130777.19932979831/8.0),
- REAL_CONST(130802.5554189189/8.0),
- REAL_CONST(130827.91273691918/8.0),
- REAL_CONST(130853.27128368006/8.0),
- REAL_CONST(130878.63105908247/8.0),
- REAL_CONST(130903.99206300738/8.0),
- REAL_CONST(130929.35429533575/8.0),
- REAL_CONST(130954.71775594862/8.0),
- REAL_CONST(130980.08244472703/8.0),
- REAL_CONST(131005.44836155206/8.0),
- REAL_CONST(131030.81550630482/8.0),
- REAL_CONST(131056.18387886642/8.0),
- REAL_CONST(131081.55347911804/8.0),
- REAL_CONST(131106.92430694087/8.0),
- REAL_CONST(131132.29636221612/8.0),
- REAL_CONST(131157.66964482504/8.0),
- REAL_CONST(131183.0441546489/8.0),
- REAL_CONST(131208.41989156904/8.0),
- REAL_CONST(131233.79685546676/8.0),
- REAL_CONST(131259.17504622342/8.0),
- REAL_CONST(131284.55446372041/8.0),
- REAL_CONST(131309.93510783918/8.0),
- REAL_CONST(131335.31697846117/8.0),
- REAL_CONST(131360.70007546784/8.0),
- REAL_CONST(131386.0843987407/8.0),
- REAL_CONST(131411.46994816128/8.0),
- REAL_CONST(131436.85672361116/8.0),
- REAL_CONST(131462.24472497194/8.0),
- REAL_CONST(131487.63395212521/8.0),
- REAL_CONST(131513.02440495262/8.0),
- REAL_CONST(131538.41608333588/8.0),
- REAL_CONST(131563.80898715663/8.0),
- REAL_CONST(131589.2031162967/8.0),
- REAL_CONST(131614.59847063778/8.0),
- REAL_CONST(131639.9950500617/8.0),
- REAL_CONST(131665.39285445024/8.0),
- REAL_CONST(131690.79188368531/8.0),
- REAL_CONST(131716.19213764873/8.0),
- REAL_CONST(131741.59361622241/8.0),
- REAL_CONST(131766.99631928833/8.0),
- REAL_CONST(131792.40024672839/8.0),
- REAL_CONST(131817.80539842462/8.0),
- REAL_CONST(131843.21177425905/8.0),
- REAL_CONST(131868.61937411371/8.0),
- REAL_CONST(131894.02819787065/8.0),
- REAL_CONST(131919.43824541202/8.0),
- REAL_CONST(131944.84951661993/8.0),
- REAL_CONST(131970.26201137656/8.0),
- REAL_CONST(131995.67572956407/8.0),
- REAL_CONST(132021.09067106468/8.0),
- REAL_CONST(132046.50683576067/8.0),
- REAL_CONST(132071.9242235343/8.0),
- REAL_CONST(132097.34283426782/8.0),
- REAL_CONST(132122.76266784366/8.0),
- REAL_CONST(132148.1837241441/8.0),
- REAL_CONST(132173.60600305157/8.0),
- REAL_CONST(132199.02950444847/8.0),
- REAL_CONST(132224.45422821722/8.0),
- REAL_CONST(132249.88017424036/8.0),
- REAL_CONST(132275.30734240031/8.0),
- REAL_CONST(132300.73573257966/8.0),
- REAL_CONST(132326.16534466096/8.0),
- REAL_CONST(132351.59617852676/8.0),
- REAL_CONST(132377.02823405969/8.0),
- REAL_CONST(132402.46151114244/8.0),
- REAL_CONST(132427.89600965759/8.0),
- REAL_CONST(132453.33172948789/8.0),
- REAL_CONST(132478.76867051609/8.0),
- REAL_CONST(132504.20683262491/8.0),
- REAL_CONST(132529.64621569714/8.0),
- REAL_CONST(132555.08681961559/8.0),
- REAL_CONST(132580.5286442631/8.0),
- REAL_CONST(132605.97168952253/8.0),
- REAL_CONST(132631.41595527678/8.0),
- REAL_CONST(132656.86144140881/8.0),
- REAL_CONST(132682.30814780149/8.0),
- REAL_CONST(132707.75607433787/8.0),
- REAL_CONST(132733.20522090094/8.0),
- REAL_CONST(132758.65558737374/8.0),
- REAL_CONST(132784.10717363929/8.0),
- REAL_CONST(132809.55997958075/8.0),
- REAL_CONST(132835.01400508118/8.0),
- REAL_CONST(132860.46925002377/8.0),
- REAL_CONST(132885.92571429166/8.0),
- REAL_CONST(132911.38339776811/8.0),
- REAL_CONST(132936.84230033628/8.0),
- REAL_CONST(132962.30242187946/8.0),
- REAL_CONST(132987.76376228096/8.0),
- REAL_CONST(133013.22632142407/8.0),
- REAL_CONST(133038.69009919214/8.0),
- REAL_CONST(133064.15509546854/8.0),
- REAL_CONST(133089.62131013666/8.0),
- REAL_CONST(133115.08874307995/8.0),
- REAL_CONST(133140.55739418184/8.0),
- REAL_CONST(133166.02726332581/8.0),
- REAL_CONST(133191.49835039541/8.0),
- REAL_CONST(133216.97065527414/8.0),
- REAL_CONST(133242.44417784561/8.0),
- REAL_CONST(133267.91891799335/8.0),
- REAL_CONST(133293.39487560102/8.0),
- REAL_CONST(133318.87205055228/8.0),
- REAL_CONST(133344.35044273079/8.0),
- REAL_CONST(133369.83005202023/8.0),
- REAL_CONST(133395.31087830439/8.0),
- REAL_CONST(133420.79292146701/8.0),
- REAL_CONST(133446.27618139185/8.0),
- REAL_CONST(133471.76065796276/8.0),
- REAL_CONST(133497.24635106357/8.0),
- REAL_CONST(133522.73326057816/8.0),
- REAL_CONST(133548.22138639039/8.0),
- REAL_CONST(133573.71072838426/8.0),
- REAL_CONST(133599.20128644365/8.0),
- REAL_CONST(133624.69306045261/8.0),
- REAL_CONST(133650.1860502951/8.0),
- REAL_CONST(133675.68025585517/8.0),
- REAL_CONST(133701.1756770169/8.0),
- REAL_CONST(133726.67231366437/8.0),
- REAL_CONST(133752.17016568172/8.0),
- REAL_CONST(133777.66923295305/8.0),
- REAL_CONST(133803.16951536259/8.0),
- REAL_CONST(133828.67101279454/8.0),
- REAL_CONST(133854.17372513309/8.0),
- REAL_CONST(133879.67765226253/8.0),
- REAL_CONST(133905.18279406714/8.0),
- REAL_CONST(133930.68915043125/8.0),
- REAL_CONST(133956.19672123916/8.0),
- REAL_CONST(133981.70550637526/8.0),
- REAL_CONST(134007.21550572399/8.0),
- REAL_CONST(134032.7267191697/8.0),
- REAL_CONST(134058.23914659687/8.0),
- REAL_CONST(134083.75278789/8.0),
- REAL_CONST(134109.26764293358/8.0),
- REAL_CONST(134134.78371161217/8.0),
- REAL_CONST(134160.30099381026/8.0),
- REAL_CONST(134185.8194894125/8.0),
- REAL_CONST(134211.33919830353/8.0),
- REAL_CONST(134236.8601203679/8.0),
- REAL_CONST(134262.38225549037/8.0),
- REAL_CONST(134287.90560355558/8.0),
- REAL_CONST(134313.43016444831/8.0),
- REAL_CONST(134338.95593805326/8.0),
- REAL_CONST(134364.48292425525/8.0),
- REAL_CONST(134390.01112293909/8.0),
- REAL_CONST(134415.54053398955/8.0),
- REAL_CONST(134441.07115729159/8.0),
- REAL_CONST(134466.60299273001/8.0),
- REAL_CONST(134492.1360401898/8.0),
- REAL_CONST(134517.67029955584/8.0),
- REAL_CONST(134543.20577071316/8.0),
- REAL_CONST(134568.74245354676/8.0),
- REAL_CONST(134594.28034794159/8.0),
- REAL_CONST(134619.81945378278/8.0),
- REAL_CONST(134645.35977095537/8.0),
- REAL_CONST(134670.90129934452/8.0),
- REAL_CONST(134696.4440388353/8.0),
- REAL_CONST(134721.98798931291/8.0),
- REAL_CONST(134747.53315066252/8.0),
- REAL_CONST(134773.07952276937/8.0),
- REAL_CONST(134798.62710551871/8.0),
- REAL_CONST(134824.17589879577/8.0),
- REAL_CONST(134849.72590248589/8.0),
- REAL_CONST(134875.27711647438/8.0),
- REAL_CONST(134900.82954064661/8.0),
- REAL_CONST(134926.38317488792/8.0),
- REAL_CONST(134951.93801908373/8.0),
- REAL_CONST(134977.49407311951/8.0),
- REAL_CONST(135003.05133688069/8.0),
- REAL_CONST(135028.60981025276/8.0),
- REAL_CONST(135054.16949312127/8.0),
- REAL_CONST(135079.73038537172/8.0),
- REAL_CONST(135105.29248688967/8.0),
- REAL_CONST(135130.85579756077/8.0),
- REAL_CONST(135156.42031727062/8.0),
- REAL_CONST(135181.98604590484/8.0),
- REAL_CONST(135207.55298334916/8.0),
- REAL_CONST(135233.12112948924/8.0),
- REAL_CONST(135258.69048421088/8.0),
- REAL_CONST(135284.26104739975/8.0),
- REAL_CONST(135309.83281894168/8.0),
- REAL_CONST(135335.4057987225/8.0),
- REAL_CONST(135360.97998662802/8.0),
- REAL_CONST(135386.55538254412/8.0),
- REAL_CONST(135412.13198635669/8.0),
- REAL_CONST(135437.70979795168/8.0),
- REAL_CONST(135463.28881721498/8.0),
- REAL_CONST(135488.86904403262/8.0),
- REAL_CONST(135514.45047829056/8.0),
- REAL_CONST(135540.03311987486/8.0),
- REAL_CONST(135565.61696867159/8.0),
- REAL_CONST(135591.20202456677/8.0),
- REAL_CONST(135616.78828744654/8.0),
- REAL_CONST(135642.37575719706/8.0),
- REAL_CONST(135667.96443370447/8.0),
- REAL_CONST(135693.55431685498/8.0),
- REAL_CONST(135719.14540653475/8.0),
- REAL_CONST(135744.73770263011/8.0),
- REAL_CONST(135770.33120502727/8.0),
- REAL_CONST(135795.92591361253/8.0),
- REAL_CONST(135821.52182827223/8.0),
- REAL_CONST(135847.11894889272/8.0),
- REAL_CONST(135872.7172753604/8.0),
- REAL_CONST(135898.31680756161/8.0),
- REAL_CONST(135923.91754538284/8.0),
- REAL_CONST(135949.51948871053/8.0),
- REAL_CONST(135975.12263743114/8.0),
- REAL_CONST(136000.72699143123/8.0),
- REAL_CONST(136026.33255059729/8.0),
- REAL_CONST(136051.93931481591/8.0),
- REAL_CONST(136077.54728397369/8.0),
- REAL_CONST(136103.15645795723/8.0),
- REAL_CONST(136128.76683665317/8.0),
- REAL_CONST(136154.37841994822/8.0),
- REAL_CONST(136179.99120772901/8.0),
- REAL_CONST(136205.60519988232/8.0),
- REAL_CONST(136231.2203962949/8.0),
- REAL_CONST(136256.83679685349/8.0),
- REAL_CONST(136282.45440144493/8.0),
- REAL_CONST(136308.07320995603/8.0),
- REAL_CONST(136333.69322227367/8.0),
- REAL_CONST(136359.31443828469/8.0),
- REAL_CONST(136384.93685787608/8.0),
- REAL_CONST(136410.56048093468/8.0),
- REAL_CONST(136436.18530734754/8.0),
- REAL_CONST(136461.81133700156/8.0),
- REAL_CONST(136487.43856978384/8.0),
- REAL_CONST(136513.06700558143/8.0),
- REAL_CONST(136538.6966442813/8.0),
- REAL_CONST(136564.32748577066/8.0),
- REAL_CONST(136589.95952993655/8.0),
- REAL_CONST(136615.59277666616/8.0),
- REAL_CONST(136641.22722584667/8.0),
- REAL_CONST(136666.86287736523/8.0),
- REAL_CONST(136692.49973110916/8.0),
- REAL_CONST(136718.13778696564/8.0),
- REAL_CONST(136743.77704482197/8.0),
- REAL_CONST(136769.41750456547/8.0),
- REAL_CONST(136795.05916608346/8.0),
- REAL_CONST(136820.70202926331/8.0),
- REAL_CONST(136846.34609399244/8.0),
- REAL_CONST(136871.99136015819/8.0),
- REAL_CONST(136897.63782764805/8.0),
- REAL_CONST(136923.28549634948/8.0),
- REAL_CONST(136948.93436614997/8.0),
- REAL_CONST(136974.58443693706/8.0),
- REAL_CONST(137000.23570859825/8.0),
- REAL_CONST(137025.88818102115/8.0),
- REAL_CONST(137051.54185409332/8.0),
- REAL_CONST(137077.19672770242/8.0),
- REAL_CONST(137102.85280173609/8.0),
- REAL_CONST(137128.51007608202/8.0),
- REAL_CONST(137154.16855062786/8.0),
- REAL_CONST(137179.82822526142/8.0),
- REAL_CONST(137205.48909987041/8.0),
- REAL_CONST(137231.15117434258/8.0),
- REAL_CONST(137256.8144485658/8.0),
- REAL_CONST(137282.47892242789/8.0),
- REAL_CONST(137308.14459581667/8.0),
- REAL_CONST(137333.81146862009/8.0),
- REAL_CONST(137359.47954072602/8.0),
- REAL_CONST(137385.14881202241/8.0),
- REAL_CONST(137410.81928239719/8.0),
- REAL_CONST(137436.49095173844/8.0),
- REAL_CONST(137462.16381993407/8.0),
- REAL_CONST(137487.83788687221/8.0),
- REAL_CONST(137513.51315244089/8.0),
- REAL_CONST(137539.18961652822/8.0),
- REAL_CONST(137564.86727902229/8.0),
- REAL_CONST(137590.54613981131/8.0),
- REAL_CONST(137616.22619878338/8.0),
- REAL_CONST(137641.90745582676/8.0),
- REAL_CONST(137667.58991082967/8.0),
- REAL_CONST(137693.27356368033/8.0),
- REAL_CONST(137718.95841426702/8.0),
- REAL_CONST(137744.64446247809/8.0),
- REAL_CONST(137770.33170820182/8.0),
- REAL_CONST(137796.02015132661/8.0),
- REAL_CONST(137821.70979174081/8.0),
- REAL_CONST(137847.40062933284/8.0),
- REAL_CONST(137873.09266399115/8.0),
- REAL_CONST(137898.78589560417/8.0),
- REAL_CONST(137924.48032406042/8.0),
- REAL_CONST(137950.17594924837/8.0),
- REAL_CONST(137975.8727710566/8.0),
- REAL_CONST(138001.57078937365/8.0),
- REAL_CONST(138027.27000408815/8.0),
- REAL_CONST(138052.97041508864/8.0),
- REAL_CONST(138078.67202226384/8.0),
- REAL_CONST(138104.3748255024/8.0),
- REAL_CONST(138130.07882469296/8.0),
- REAL_CONST(138155.78401972432/8.0),
- REAL_CONST(138181.49041048516/8.0),
- REAL_CONST(138207.1979968643/8.0),
- REAL_CONST(138232.9067787505/8.0),
- REAL_CONST(138258.61675603263/8.0),
- REAL_CONST(138284.32792859949/8.0),
- REAL_CONST(138310.04029633995/8.0),
- REAL_CONST(138335.75385914298/8.0),
- REAL_CONST(138361.46861689744/8.0),
- REAL_CONST(138387.18456949232/8.0),
- REAL_CONST(138412.90171681659/8.0),
- REAL_CONST(138438.62005875923/8.0),
- REAL_CONST(138464.33959520931/8.0),
- REAL_CONST(138490.06032605586/8.0),
- REAL_CONST(138515.78225118798/8.0),
- REAL_CONST(138541.50537049473/8.0),
- REAL_CONST(138567.2296838653/8.0),
- REAL_CONST(138592.95519118884/8.0),
- REAL_CONST(138618.68189235451/8.0),
- REAL_CONST(138644.40978725153/8.0),
- REAL_CONST(138670.13887576913/8.0),
- REAL_CONST(138695.86915779658/8.0),
- REAL_CONST(138721.60063322316/8.0),
- REAL_CONST(138747.33330193823/8.0),
- REAL_CONST(138773.06716383106/8.0),
- REAL_CONST(138798.80221879104/8.0),
- REAL_CONST(138824.53846670757/8.0),
- REAL_CONST(138850.27590747006/8.0),
- REAL_CONST(138876.01454096794/8.0),
- REAL_CONST(138901.7543670907/8.0),
- REAL_CONST(138927.49538572782/8.0),
- REAL_CONST(138953.2375967688/8.0),
- REAL_CONST(138978.9810001032/8.0),
- REAL_CONST(139004.72559562061/8.0),
- REAL_CONST(139030.47138321059/8.0),
- REAL_CONST(139056.2183627628/8.0),
- REAL_CONST(139081.96653416683/8.0),
- REAL_CONST(139107.71589731239/8.0),
- REAL_CONST(139133.46645208917/8.0),
- REAL_CONST(139159.21819838689/8.0),
- REAL_CONST(139184.97113609532/8.0),
- REAL_CONST(139210.72526510421/8.0),
- REAL_CONST(139236.48058530336/8.0),
- REAL_CONST(139262.23709658257/8.0),
- REAL_CONST(139287.99479883176/8.0),
- REAL_CONST(139313.75369194071/8.0),
- REAL_CONST(139339.51377579942/8.0),
- REAL_CONST(139365.27505029776/8.0),
- REAL_CONST(139391.03751532568/8.0),
- REAL_CONST(139416.80117077316/8.0),
- REAL_CONST(139442.56601653024/8.0),
- REAL_CONST(139468.33205248689/8.0),
- REAL_CONST(139494.09927853322/8.0),
- REAL_CONST(139519.86769455927/8.0),
- REAL_CONST(139545.63730045516/8.0),
- REAL_CONST(139571.408096111/8.0),
- REAL_CONST(139597.18008141697/8.0),
- REAL_CONST(139622.95325626322/8.0),
- REAL_CONST(139648.72762054001/8.0),
- REAL_CONST(139674.5031741375/8.0),
- REAL_CONST(139700.27991694602/8.0),
- REAL_CONST(139726.05784885579/8.0),
- REAL_CONST(139751.83696975713/8.0),
- REAL_CONST(139777.61727954043/8.0),
- REAL_CONST(139803.39877809596/8.0),
- REAL_CONST(139829.18146531415/8.0),
- REAL_CONST(139854.96534108539/8.0),
- REAL_CONST(139880.75040530015/8.0),
- REAL_CONST(139906.53665784886/8.0),
- REAL_CONST(139932.32409862199/8.0),
- REAL_CONST(139958.11272751007/8.0),
- REAL_CONST(139983.90254440365/8.0),
- REAL_CONST(140009.69354919327/8.0),
- REAL_CONST(140035.48574176949/8.0),
- REAL_CONST(140061.27912202294/8.0),
- REAL_CONST(140087.07368984428/8.0),
- REAL_CONST(140112.86944512415/8.0),
- REAL_CONST(140138.66638775321/8.0),
- REAL_CONST(140164.4645176222/8.0),
- REAL_CONST(140190.26383462184/8.0),
- REAL_CONST(140216.06433864293/8.0),
- REAL_CONST(140241.86602957622/8.0),
- REAL_CONST(140267.66890731253/8.0),
- REAL_CONST(140293.47297174268/8.0),
- REAL_CONST(140319.27822275754/8.0),
- REAL_CONST(140345.08466024802/8.0),
- REAL_CONST(140370.89228410498/8.0),
- REAL_CONST(140396.70109421943/8.0),
- REAL_CONST(140422.51109048226/8.0),
- REAL_CONST(140448.32227278448/8.0),
- REAL_CONST(140474.13464101712/8.0),
- REAL_CONST(140499.94819507122/8.0),
- REAL_CONST(140525.76293483781/8.0),
- REAL_CONST(140551.57886020801/8.0),
- REAL_CONST(140577.3959710729/8.0),
- REAL_CONST(140603.21426732364/8.0),
- REAL_CONST(140629.03374885136/8.0),
- REAL_CONST(140654.85441554731/8.0),
- REAL_CONST(140680.67626730262/8.0),
- REAL_CONST(140706.49930400858/8.0),
- REAL_CONST(140732.32352555645/8.0),
- REAL_CONST(140758.1489318375/8.0),
- REAL_CONST(140783.97552274304/8.0),
- REAL_CONST(140809.80329816442/8.0),
- REAL_CONST(140835.63225799298/8.0),
- REAL_CONST(140861.46240212015/8.0),
- REAL_CONST(140887.29373043729/8.0),
- REAL_CONST(140913.12624283586/8.0),
- REAL_CONST(140938.95993920733/8.0),
- REAL_CONST(140964.79481944317/8.0),
- REAL_CONST(140990.63088343487/8.0),
- REAL_CONST(141016.46813107401/8.0),
- REAL_CONST(141042.30656225214/8.0),
- REAL_CONST(141068.14617686081/8.0),
- REAL_CONST(141093.98697479168/8.0),
- REAL_CONST(141119.82895593636/8.0),
- REAL_CONST(141145.6721201865/8.0),
- REAL_CONST(141171.51646743377/8.0),
- REAL_CONST(141197.36199756994/8.0),
- REAL_CONST(141223.20871048668/8.0),
- REAL_CONST(141249.05660607578/8.0),
- REAL_CONST(141274.90568422904/8.0),
- REAL_CONST(141300.75594483822/8.0),
- REAL_CONST(141326.6073877952/8.0),
- REAL_CONST(141352.4600129918/8.0),
- REAL_CONST(141378.31382031992/8.0),
- REAL_CONST(141404.16880967148/8.0),
- REAL_CONST(141430.02498093838/8.0),
- REAL_CONST(141455.8823340126/8.0),
- REAL_CONST(141481.74086878612/8.0),
- REAL_CONST(141507.60058515094/8.0),
- REAL_CONST(141533.46148299909/8.0),
- REAL_CONST(141559.32356222265/8.0),
- REAL_CONST(141585.18682271364/8.0),
- REAL_CONST(141611.05126436421/8.0),
- REAL_CONST(141636.9168870665/8.0),
- REAL_CONST(141662.78369071262/8.0),
- REAL_CONST(141688.65167519479/8.0),
- REAL_CONST(141714.5208404052/8.0),
- REAL_CONST(141740.39118623605/8.0),
- REAL_CONST(141766.26271257963/8.0),
- REAL_CONST(141792.1354193282/8.0),
- REAL_CONST(141818.00930637406/8.0),
- REAL_CONST(141843.88437360956/8.0),
- REAL_CONST(141869.760620927/8.0),
- REAL_CONST(141895.6380482188/8.0),
- REAL_CONST(141921.51665537735/8.0),
- REAL_CONST(141947.39644229505/8.0),
- REAL_CONST(141973.27740886438/8.0),
- REAL_CONST(141999.15955497778/8.0),
- REAL_CONST(142025.04288052776/8.0),
- REAL_CONST(142050.92738540689/8.0),
- REAL_CONST(142076.81306950765/8.0),
- REAL_CONST(142102.69993272264/8.0),
- REAL_CONST(142128.58797494444/8.0),
- REAL_CONST(142154.47719606571/8.0),
- REAL_CONST(142180.36759597904/8.0),
- REAL_CONST(142206.25917457714/8.0),
- REAL_CONST(142232.15193175265/8.0),
- REAL_CONST(142258.04586739838/8.0),
- REAL_CONST(142283.94098140698/8.0),
- REAL_CONST(142309.83727367126/8.0),
- REAL_CONST(142335.73474408401/8.0),
- REAL_CONST(142361.63339253806/8.0),
- REAL_CONST(142387.5332189262/8.0),
- REAL_CONST(142413.43422314132/8.0),
- REAL_CONST(142439.33640507635/8.0),
- REAL_CONST(142465.23976462413/8.0),
- REAL_CONST(142491.14430167765/8.0),
- REAL_CONST(142517.05001612983/8.0),
- REAL_CONST(142542.95690787368/8.0),
- REAL_CONST(142568.86497680223/8.0),
- REAL_CONST(142594.77422280848/8.0),
- REAL_CONST(142620.68464578551/8.0),
- REAL_CONST(142646.5962456264/8.0),
- REAL_CONST(142672.50902222423/8.0),
- REAL_CONST(142698.42297547215/8.0),
- REAL_CONST(142724.33810526333/8.0),
- REAL_CONST(142750.25441149093/8.0),
- REAL_CONST(142776.17189404817/8.0),
- REAL_CONST(142802.09055282827/8.0),
- REAL_CONST(142828.01038772447/8.0),
- REAL_CONST(142853.93139863008/8.0),
- REAL_CONST(142879.85358543837/8.0),
- REAL_CONST(142905.77694804268/8.0),
- REAL_CONST(142931.70148633636/8.0),
- REAL_CONST(142957.62720021277/8.0),
- REAL_CONST(142983.55408956532/8.0),
- REAL_CONST(143009.48215428743/8.0),
- REAL_CONST(143035.41139427255/8.0),
- REAL_CONST(143061.34180941415/8.0),
- REAL_CONST(143087.27339960571/8.0),
- REAL_CONST(143113.20616474075/8.0),
- REAL_CONST(143139.14010471283/8.0),
- REAL_CONST(143165.07521941551/8.0),
- REAL_CONST(143191.01150874238/8.0),
- REAL_CONST(143216.94897258704/8.0),
- REAL_CONST(143242.88761084314/8.0),
- REAL_CONST(143268.82742340435/8.0),
- REAL_CONST(143294.76841016437/8.0),
- REAL_CONST(143320.71057101688/8.0),
- REAL_CONST(143346.65390585564/8.0),
- REAL_CONST(143372.59841457437/8.0),
- REAL_CONST(143398.54409706692/8.0),
- REAL_CONST(143424.49095322701/8.0),
- REAL_CONST(143450.43898294857/8.0),
- REAL_CONST(143476.38818612538/8.0),
- REAL_CONST(143502.33856265133/8.0),
- REAL_CONST(143528.29011242036/8.0),
- REAL_CONST(143554.24283532638/8.0),
- REAL_CONST(143580.19673126334/8.0),
- REAL_CONST(143606.1518001252/8.0),
- REAL_CONST(143632.10804180597/8.0),
- REAL_CONST(143658.06545619969/8.0),
- REAL_CONST(143684.02404320039/8.0),
- REAL_CONST(143709.98380270213/8.0),
- REAL_CONST(143735.944734599/8.0),
- REAL_CONST(143761.90683878519/8.0),
- REAL_CONST(143787.87011515474/8.0),
- REAL_CONST(143813.83456360188/8.0),
- REAL_CONST(143839.8001840208/8.0),
- REAL_CONST(143865.76697630569/8.0),
- REAL_CONST(143891.73494035081/8.0),
- REAL_CONST(143917.7040760504/8.0),
- REAL_CONST(143943.67438329876/8.0),
- REAL_CONST(143969.6458619902/8.0),
- REAL_CONST(143995.61851201905/8.0),
- REAL_CONST(144021.59233327967/8.0),
- REAL_CONST(144047.56732566646/8.0),
- REAL_CONST(144073.54348907378/8.0),
- REAL_CONST(144099.52082339607/8.0),
- REAL_CONST(144125.49932852783/8.0),
- REAL_CONST(144151.4790043635/8.0),
- REAL_CONST(144177.45985079758/8.0),
- REAL_CONST(144203.44186772458/8.0),
- REAL_CONST(144229.42505503909/8.0),
- REAL_CONST(144255.40941263564/8.0),
- REAL_CONST(144281.39494040885/8.0),
- REAL_CONST(144307.38163825331/8.0),
- REAL_CONST(144333.36950606373/8.0),
- REAL_CONST(144359.35854373468/8.0),
- REAL_CONST(144385.34875116093/8.0),
- REAL_CONST(144411.34012823718/8.0),
- REAL_CONST(144437.33267485813/8.0),
- REAL_CONST(144463.32639091855/8.0),
- REAL_CONST(144489.32127631325/8.0),
- REAL_CONST(144515.31733093705/8.0),
- REAL_CONST(144541.31455468474/8.0),
- REAL_CONST(144567.3129474512/8.0),
- REAL_CONST(144593.3125091313/8.0),
- REAL_CONST(144619.31323961995/8.0),
- REAL_CONST(144645.31513881206/8.0),
- REAL_CONST(144671.31820660262/8.0),
- REAL_CONST(144697.32244288657/8.0),
- REAL_CONST(144723.32784755889/8.0),
- REAL_CONST(144749.33442051467/8.0),
- REAL_CONST(144775.34216164888/8.0),
- REAL_CONST(144801.35107085665/8.0),
- REAL_CONST(144827.36114803303/8.0),
- REAL_CONST(144853.37239307314/8.0),
- REAL_CONST(144879.38480587213/8.0),
- REAL_CONST(144905.39838632516/8.0),
- REAL_CONST(144931.41313432742/8.0),
- REAL_CONST(144957.4290497741/8.0),
- REAL_CONST(144983.44613256046/8.0),
- REAL_CONST(145009.46438258173/8.0),
- REAL_CONST(145035.48379973322/8.0),
- REAL_CONST(145061.50438391021/8.0),
- REAL_CONST(145087.52613500805/8.0),
- REAL_CONST(145113.54905292206/8.0),
- REAL_CONST(145139.57313754765/8.0),
- REAL_CONST(145165.59838878017/8.0),
- REAL_CONST(145191.62480651509/8.0),
- REAL_CONST(145217.65239064783/8.0),
- REAL_CONST(145243.68114107384/8.0),
- REAL_CONST(145269.71105768863/8.0),
- REAL_CONST(145295.74214038774/8.0),
- REAL_CONST(145321.77438906668/8.0),
- REAL_CONST(145347.80780362099/8.0),
- REAL_CONST(145373.84238394629/8.0),
- REAL_CONST(145399.87812993818/8.0),
- REAL_CONST(145425.91504149229/8.0),
- REAL_CONST(145451.95311850426/8.0),
- REAL_CONST(145477.9923608698/8.0),
- REAL_CONST(145504.03276848458/8.0),
- REAL_CONST(145530.07434124436/8.0),
- REAL_CONST(145556.11707904484/8.0),
- REAL_CONST(145582.16098178181/8.0),
- REAL_CONST(145608.20604935108/8.0),
- REAL_CONST(145634.25228164849/8.0),
- REAL_CONST(145660.29967856981/8.0),
- REAL_CONST(145686.34824001096/8.0),
- REAL_CONST(145712.39796586783/8.0),
- REAL_CONST(145738.4488560363/8.0),
- REAL_CONST(145764.50091041232/8.0),
- REAL_CONST(145790.55412889185/8.0),
- REAL_CONST(145816.60851137087/8.0),
- REAL_CONST(145842.66405774537/8.0),
- REAL_CONST(145868.72076791141/8.0),
- REAL_CONST(145894.77864176501/8.0),
- REAL_CONST(145920.83767920226/8.0),
- REAL_CONST(145946.89788011924/8.0),
- REAL_CONST(145972.95924441208/8.0),
- REAL_CONST(145999.02177197693/8.0),
- REAL_CONST(146025.08546270995/8.0),
- REAL_CONST(146051.15031650732/8.0),
- REAL_CONST(146077.21633326527/8.0),
- REAL_CONST(146103.28351288004/8.0),
- REAL_CONST(146129.35185524789/8.0),
- REAL_CONST(146155.42136026506/8.0),
- REAL_CONST(146181.49202782792/8.0),
- REAL_CONST(146207.56385783272/8.0),
- REAL_CONST(146233.63685017588/8.0),
- REAL_CONST(146259.71100475377/8.0),
- REAL_CONST(146285.78632146274/8.0),
- REAL_CONST(146311.86280019928/8.0),
- REAL_CONST(146337.94044085976/8.0),
- REAL_CONST(146364.01924334071/8.0),
- REAL_CONST(146390.09920753856/8.0),
- REAL_CONST(146416.18033334985/8.0),
- REAL_CONST(146442.26262067116/8.0),
- REAL_CONST(146468.34606939898/8.0),
- REAL_CONST(146494.43067942993/8.0),
- REAL_CONST(146520.51645066062/8.0),
- REAL_CONST(146546.60338298764/8.0),
- REAL_CONST(146572.69147630769/8.0),
- REAL_CONST(146598.78073051744/8.0),
- REAL_CONST(146624.87114551352/8.0),
- REAL_CONST(146650.96272119274/8.0),
- REAL_CONST(146677.05545745179/8.0),
- REAL_CONST(146703.14935418745/8.0),
- REAL_CONST(146729.2444112965/8.0),
- REAL_CONST(146755.34062867577/8.0),
- REAL_CONST(146781.43800622207/8.0),
- REAL_CONST(146807.53654383228/8.0),
- REAL_CONST(146833.63624140329/8.0),
- REAL_CONST(146859.73709883197/8.0),
- REAL_CONST(146885.83911601527/8.0),
- REAL_CONST(146911.94229285014/8.0),
- REAL_CONST(146938.04662923355/8.0),
- REAL_CONST(146964.15212506248/8.0),
- REAL_CONST(146990.25878023397/8.0),
- REAL_CONST(147016.36659464505/8.0),
- REAL_CONST(147042.47556819281/8.0),
- REAL_CONST(147068.58570077427/8.0),
- REAL_CONST(147094.6969922866/8.0),
- REAL_CONST(147120.80944262692/8.0),
- REAL_CONST(147146.92305169237/8.0),
- REAL_CONST(147173.03781938017/8.0),
- REAL_CONST(147199.15374558745/8.0),
- REAL_CONST(147225.27083021149/8.0),
- REAL_CONST(147251.38907314953/8.0),
- REAL_CONST(147277.50847429881/8.0),
- REAL_CONST(147303.62903355664/8.0),
- REAL_CONST(147329.75075082036/8.0),
- REAL_CONST(147355.87362598727/8.0),
- REAL_CONST(147381.99765895473/8.0),
- REAL_CONST(147408.12284962015/8.0),
- REAL_CONST(147434.24919788091/8.0),
- REAL_CONST(147460.37670363448/8.0),
- REAL_CONST(147486.50536677826/8.0),
- REAL_CONST(147512.63518720976/8.0),
- REAL_CONST(147538.76616482646/8.0),
- REAL_CONST(147564.89829952587/8.0),
- REAL_CONST(147591.03159120557/8.0),
- REAL_CONST(147617.16603976308/8.0),
- REAL_CONST(147643.30164509601/8.0),
- REAL_CONST(147669.43840710199/8.0),
- REAL_CONST(147695.57632567859/8.0),
- REAL_CONST(147721.71540072354/8.0),
- REAL_CONST(147747.85563213445/8.0),
- REAL_CONST(147773.99701980909/8.0),
- REAL_CONST(147800.13956364512/8.0),
- REAL_CONST(147826.28326354033/8.0),
- REAL_CONST(147852.42811939248/8.0),
- REAL_CONST(147878.57413109933/8.0),
- REAL_CONST(147904.72129855872/8.0),
- REAL_CONST(147930.86962166851/8.0),
- REAL_CONST(147957.01910032652/8.0),
- REAL_CONST(147983.16973443062/8.0),
- REAL_CONST(148009.32152387875/8.0),
- REAL_CONST(148035.47446856883/8.0),
- REAL_CONST(148061.62856839882/8.0),
- REAL_CONST(148087.78382326665/8.0),
- REAL_CONST(148113.94023307035/8.0),
- REAL_CONST(148140.09779770792/8.0),
- REAL_CONST(148166.25651707739/8.0),
- REAL_CONST(148192.41639107687/8.0),
- REAL_CONST(148218.57741960438/8.0),
- REAL_CONST(148244.73960255808/8.0),
- REAL_CONST(148270.90293983606/8.0),
- REAL_CONST(148297.0674313365/8.0),
- REAL_CONST(148323.23307695755/8.0),
- REAL_CONST(148349.39987659742/8.0),
- REAL_CONST(148375.56783015432/8.0),
- REAL_CONST(148401.73693752653/8.0),
- REAL_CONST(148427.90719861226/8.0),
- REAL_CONST(148454.07861330983/8.0),
- REAL_CONST(148480.25118151752/8.0),
- REAL_CONST(148506.42490313368/8.0),
- REAL_CONST(148532.59977805667/8.0),
- REAL_CONST(148558.77580618486/8.0),
- REAL_CONST(148584.95298741665/8.0),
- REAL_CONST(148611.13132165043/8.0),
- REAL_CONST(148637.31080878471/8.0),
- REAL_CONST(148663.49144871789/8.0),
- REAL_CONST(148689.6732413485/8.0),
- REAL_CONST(148715.85618657502/8.0),
- REAL_CONST(148742.040284296/8.0),
- REAL_CONST(148768.22553440998/8.0),
- REAL_CONST(148794.41193681557/8.0),
- REAL_CONST(148820.59949141133/8.0),
- REAL_CONST(148846.78819809589/8.0),
- REAL_CONST(148872.97805676793/8.0),
- REAL_CONST(148899.16906732606/8.0),
- REAL_CONST(148925.36122966901/8.0),
- REAL_CONST(148951.55454369547/8.0),
- REAL_CONST(148977.74900930419/8.0),
- REAL_CONST(149003.9446263939/8.0),
- REAL_CONST(149030.1413948634/8.0),
- REAL_CONST(149056.33931461151/8.0),
- REAL_CONST(149082.53838553699/8.0),
- REAL_CONST(149108.73860753875/8.0),
- REAL_CONST(149134.9399805156/8.0),
- REAL_CONST(149161.14250436646/8.0),
- REAL_CONST(149187.34617899026/8.0),
- REAL_CONST(149213.5510042859/8.0),
- REAL_CONST(149239.75698015234/8.0),
- REAL_CONST(149265.96410648854/8.0),
- REAL_CONST(149292.17238319354/8.0),
- REAL_CONST(149318.38181016635/8.0),
- REAL_CONST(149344.59238730598/8.0),
- REAL_CONST(149370.80411451156/8.0),
- REAL_CONST(149397.01699168212/8.0),
- REAL_CONST(149423.23101871679/8.0),
- REAL_CONST(149449.44619551473/8.0),
- REAL_CONST(149475.66252197503/8.0),
- REAL_CONST(149501.87999799693/8.0),
- REAL_CONST(149528.0986234796/8.0),
- REAL_CONST(149554.31839832227/8.0),
- REAL_CONST(149580.53932242419/8.0),
- REAL_CONST(149606.76139568459/8.0),
- REAL_CONST(149632.98461800278/8.0),
- REAL_CONST(149659.20898927809/8.0),
- REAL_CONST(149685.43450940982/8.0),
- REAL_CONST(149711.66117829733/8.0),
- REAL_CONST(149737.88899584001/8.0),
- REAL_CONST(149764.11796193724/8.0),
- REAL_CONST(149790.34807648844/8.0),
- REAL_CONST(149816.57933939309/8.0),
- REAL_CONST(149842.81175055061/8.0),
- REAL_CONST(149869.04530986046/8.0),
- REAL_CONST(149895.28001722222/8.0),
- REAL_CONST(149921.51587253538/8.0),
- REAL_CONST(149947.75287569952/8.0),
- REAL_CONST(149973.99102661415/8.0),
- REAL_CONST(150000.23032517891/8.0),
- REAL_CONST(150026.47077129342/8.0),
- REAL_CONST(150052.71236485732/8.0),
- REAL_CONST(150078.95510577026/8.0),
- REAL_CONST(150105.1989939319/8.0),
- REAL_CONST(150131.444029242/8.0),
- REAL_CONST(150157.69021160025/8.0),
- REAL_CONST(150183.93754090639/8.0),
- REAL_CONST(150210.18601706024/8.0),
- REAL_CONST(150236.43563996154/8.0),
- REAL_CONST(150262.68640951012/8.0),
- REAL_CONST(150288.93832560582/8.0),
- REAL_CONST(150315.19138814852/8.0),
- REAL_CONST(150341.44559703805/8.0),
- REAL_CONST(150367.70095217437/8.0),
- REAL_CONST(150393.95745345735/8.0),
- REAL_CONST(150420.21510078697/8.0),
- REAL_CONST(150446.47389406321/8.0),
- REAL_CONST(150472.73383318601/8.0),
- REAL_CONST(150498.99491805542/8.0),
- REAL_CONST(150525.25714857146/8.0),
- REAL_CONST(150551.52052463419/8.0),
- REAL_CONST(150577.78504614369/8.0),
- REAL_CONST(150604.05071300003/8.0),
- REAL_CONST(150630.31752510337/8.0),
- REAL_CONST(150656.58548235384/8.0),
- REAL_CONST(150682.85458465159/8.0),
- REAL_CONST(150709.1248318968/8.0),
- REAL_CONST(150735.39622398972/8.0),
- REAL_CONST(150761.66876083051/8.0),
- REAL_CONST(150787.9424423195/8.0),
- REAL_CONST(150814.21726835691/8.0),
- REAL_CONST(150840.49323884305/8.0),
- REAL_CONST(150866.77035367821/8.0),
- REAL_CONST(150893.04861276277/8.0),
- REAL_CONST(150919.32801599705/8.0),
- REAL_CONST(150945.60856328148/8.0),
- REAL_CONST(150971.89025451642/8.0),
- REAL_CONST(150998.17308960229/8.0),
- REAL_CONST(151024.45706843957/8.0),
- REAL_CONST(151050.74219092872/8.0),
- REAL_CONST(151077.02845697021/8.0),
- REAL_CONST(151103.31586646455/8.0),
- REAL_CONST(151129.60441931229/8.0),
- REAL_CONST(151155.894115414/8.0),
- REAL_CONST(151182.1849546702/8.0),
- REAL_CONST(151208.47693698155/8.0),
- REAL_CONST(151234.77006224863/8.0),
- REAL_CONST(151261.06433037209/8.0),
- REAL_CONST(151287.35974125259/8.0),
- REAL_CONST(151313.65629479082/8.0),
- REAL_CONST(151339.95399088747/8.0),
- REAL_CONST(151366.25282944329/8.0),
- REAL_CONST(151392.55281035902/8.0),
- REAL_CONST(151418.85393353543/8.0),
- REAL_CONST(151445.1561988733/8.0),
- REAL_CONST(151471.45960627345/8.0),
- REAL_CONST(151497.76415563675/8.0),
- REAL_CONST(151524.06984686397/8.0),
- REAL_CONST(151550.37667985607/8.0),
- REAL_CONST(151576.68465451393/8.0),
- REAL_CONST(151602.99377073845/8.0),
- REAL_CONST(151629.30402843058/8.0),
- REAL_CONST(151655.61542749128/8.0),
- REAL_CONST(151681.92796782157/8.0),
- REAL_CONST(151708.24164932242/8.0),
- REAL_CONST(151734.55647189484/8.0),
- REAL_CONST(151760.87243543993/8.0),
- REAL_CONST(151787.18953985872/8.0),
- REAL_CONST(151813.50778505235/8.0),
- REAL_CONST(151839.82717092187/8.0),
- REAL_CONST(151866.14769736846/8.0),
- REAL_CONST(151892.46936429327/8.0),
- REAL_CONST(151918.79217159748/8.0),
- REAL_CONST(151945.11611918229/8.0),
- REAL_CONST(151971.44120694889/8.0),
- REAL_CONST(151997.76743479856/8.0),
- REAL_CONST(152024.09480263255/8.0),
- REAL_CONST(152050.42331035214/8.0),
- REAL_CONST(152076.75295785864/8.0),
- REAL_CONST(152103.08374505339/8.0),
- REAL_CONST(152129.41567183775/8.0),
- REAL_CONST(152155.74873811303/8.0),
- REAL_CONST(152182.08294378067/8.0),
- REAL_CONST(152208.41828874208/8.0),
- REAL_CONST(152234.75477289871/8.0),
- REAL_CONST(152261.09239615197/8.0),
- REAL_CONST(152287.43115840337/8.0),
- REAL_CONST(152313.77105955439/8.0),
- REAL_CONST(152340.11209950657/8.0),
- REAL_CONST(152366.45427816146/8.0),
- REAL_CONST(152392.79759542056/8.0),
- REAL_CONST(152419.14205118554/8.0),
- REAL_CONST(152445.48764535793/8.0),
- REAL_CONST(152471.8343778394/8.0),
- REAL_CONST(152498.18224853161/8.0),
- REAL_CONST(152524.53125733617/8.0),
- REAL_CONST(152550.88140415482/8.0),
- REAL_CONST(152577.23268888926/8.0),
- REAL_CONST(152603.58511144121/8.0),
- REAL_CONST(152629.93867171241/8.0),
- REAL_CONST(152656.29336960468/8.0),
- REAL_CONST(152682.64920501978/8.0),
- REAL_CONST(152709.00617785956/8.0),
- REAL_CONST(152735.36428802583/8.0),
- REAL_CONST(152761.72353542043/8.0),
- REAL_CONST(152788.08391994529/8.0),
- REAL_CONST(152814.44544150229/8.0),
- REAL_CONST(152840.80809999333/8.0),
- REAL_CONST(152867.17189532038/8.0),
- REAL_CONST(152893.53682738543/8.0),
- REAL_CONST(152919.90289609041/8.0),
- REAL_CONST(152946.27010133737/8.0),
- REAL_CONST(152972.63844302832/8.0),
- REAL_CONST(152999.00792106529/8.0),
- REAL_CONST(153025.37853535041/8.0),
- REAL_CONST(153051.7502857857/8.0),
- REAL_CONST(153078.12317227334/8.0),
- REAL_CONST(153104.4971947154/8.0),
- REAL_CONST(153130.8723530141/8.0),
- REAL_CONST(153157.24864707157/8.0),
- REAL_CONST(153183.62607679001/8.0),
- REAL_CONST(153210.00464207167/8.0),
- REAL_CONST(153236.38434281875/8.0),
- REAL_CONST(153262.76517893354/8.0),
- REAL_CONST(153289.14715031831/8.0),
- REAL_CONST(153315.53025687535/8.0),
- REAL_CONST(153341.91449850702/8.0),
- REAL_CONST(153368.2998751156/8.0),
- REAL_CONST(153394.68638660354/8.0),
- REAL_CONST(153421.07403287315/8.0),
- REAL_CONST(153447.46281382689/8.0),
- REAL_CONST(153473.85272936718/8.0),
- REAL_CONST(153500.24377939643/8.0),
- REAL_CONST(153526.63596381716/8.0),
- REAL_CONST(153553.02928253182/8.0),
- REAL_CONST(153579.42373544298/8.0),
- REAL_CONST(153605.81932245308/8.0),
- REAL_CONST(153632.21604346478/8.0),
- REAL_CONST(153658.61389838057/8.0),
- REAL_CONST(153685.0128871031/8.0),
- REAL_CONST(153711.41300953497/8.0),
- REAL_CONST(153737.81426557881/8.0),
- REAL_CONST(153764.21665513728/8.0),
- REAL_CONST(153790.62017811305/8.0),
- REAL_CONST(153817.02483440886/8.0),
- REAL_CONST(153843.43062392739/8.0),
- REAL_CONST(153869.83754657139/8.0),
- REAL_CONST(153896.24560224367/8.0),
- REAL_CONST(153922.65479084692/8.0),
- REAL_CONST(153949.06511228404/8.0),
- REAL_CONST(153975.4765664578/8.0),
- REAL_CONST(154001.88915327107/8.0),
- REAL_CONST(154028.30287262669/8.0),
- REAL_CONST(154054.71772442761/8.0),
- REAL_CONST(154081.13370857667/8.0),
- REAL_CONST(154107.55082497682/8.0),
- REAL_CONST(154133.96907353101/8.0),
- REAL_CONST(154160.38845414223/8.0),
- REAL_CONST(154186.80896671346/8.0),
- REAL_CONST(154213.23061114774/8.0),
- REAL_CONST(154239.65338734805/8.0),
- REAL_CONST(154266.07729521746/8.0),
- REAL_CONST(154292.50233465908/8.0),
- REAL_CONST(154318.92850557598/8.0),
- REAL_CONST(154345.35580787127/8.0),
- REAL_CONST(154371.7842414481/8.0),
- REAL_CONST(154398.21380620965/8.0),
- REAL_CONST(154424.64450205903/8.0),
- REAL_CONST(154451.07632889951/8.0),
- REAL_CONST(154477.50928663427/8.0),
- REAL_CONST(154503.94337516659/8.0),
- REAL_CONST(154530.37859439969/8.0),
- REAL_CONST(154556.81494423689/8.0),
- REAL_CONST(154583.25242458144/8.0),
- REAL_CONST(154609.69103533673/8.0),
- REAL_CONST(154636.13077640603/8.0),
- REAL_CONST(154662.57164769279/8.0),
- REAL_CONST(154689.01364910032/8.0),
- REAL_CONST(154715.45678053208/8.0),
- REAL_CONST(154741.90104189145/8.0),
- REAL_CONST(154768.34643308193/8.0),
- REAL_CONST(154794.79295400696/8.0),
- REAL_CONST(154821.24060457002/8.0),
- REAL_CONST(154847.68938467462/8.0),
- REAL_CONST(154874.13929422433/8.0),
- REAL_CONST(154900.59033312264/8.0),
- REAL_CONST(154927.04250127316/8.0),
- REAL_CONST(154953.49579857948/8.0),
- REAL_CONST(154979.95022494521/8.0),
- REAL_CONST(155006.40578027396/8.0),
- REAL_CONST(155032.86246446942/8.0),
- REAL_CONST(155059.32027743524/8.0),
- REAL_CONST(155085.77921907514/8.0),
- REAL_CONST(155112.2392892928/8.0),
- REAL_CONST(155138.70048799197/8.0),
- REAL_CONST(155165.16281507642/8.0),
- REAL_CONST(155191.62627044989/8.0),
- REAL_CONST(155218.09085401625/8.0),
- REAL_CONST(155244.55656567923/8.0),
- REAL_CONST(155271.02340534274/8.0),
- REAL_CONST(155297.49137291059/8.0),
- REAL_CONST(155323.96046828668/8.0),
- REAL_CONST(155350.4306913749/8.0),
- REAL_CONST(155376.90204207919/8.0),
- REAL_CONST(155403.37452030348/8.0),
- REAL_CONST(155429.84812595171/8.0),
- REAL_CONST(155456.32285892789/8.0),
- REAL_CONST(155482.79871913602/8.0),
- REAL_CONST(155509.27570648011/8.0),
- REAL_CONST(155535.75382086422/8.0),
- REAL_CONST(155562.23306219239/8.0),
- REAL_CONST(155588.71343036872/8.0),
- REAL_CONST(155615.19492529731/8.0),
- REAL_CONST(155641.67754688227/8.0),
- REAL_CONST(155668.16129502779/8.0),
- REAL_CONST(155694.64616963797/8.0),
- REAL_CONST(155721.13217061706/8.0),
- REAL_CONST(155747.61929786921/8.0),
- REAL_CONST(155774.10755129869/8.0),
- REAL_CONST(155800.59693080973/8.0),
- REAL_CONST(155827.08743630661/8.0),
- REAL_CONST(155853.57906769359/8.0),
- REAL_CONST(155880.07182487496/8.0),
- REAL_CONST(155906.56570775513/8.0),
- REAL_CONST(155933.06071623837/8.0),
- REAL_CONST(155959.55685022907/8.0),
- REAL_CONST(155986.05410963166/8.0),
- REAL_CONST(156012.5524943505/8.0),
- REAL_CONST(156039.05200429002/8.0),
- REAL_CONST(156065.55263935472/8.0),
- REAL_CONST(156092.054399449/8.0),
- REAL_CONST(156118.5572844774/8.0),
- REAL_CONST(156145.06129434443/8.0),
- REAL_CONST(156171.5664289546/8.0),
- REAL_CONST(156198.07268821247/8.0),
- REAL_CONST(156224.5800720226/8.0),
- REAL_CONST(156251.08858028959/8.0),
- REAL_CONST(156277.59821291809/8.0),
- REAL_CONST(156304.10896981266/8.0),
- REAL_CONST(156330.62085087801/8.0),
- REAL_CONST(156357.1338560188/8.0),
- REAL_CONST(156383.64798513969/8.0),
- REAL_CONST(156410.16323814544/8.0),
- REAL_CONST(156436.67961494075/8.0),
- REAL_CONST(156463.1971154304/8.0),
- REAL_CONST(156489.71573951913/8.0),
- REAL_CONST(156516.23548711176/8.0),
- REAL_CONST(156542.75635811311/8.0),
- REAL_CONST(156569.27835242799/8.0),
- REAL_CONST(156595.80146996127/8.0),
- REAL_CONST(156622.32571061782/8.0),
- REAL_CONST(156648.85107430254/8.0),
- REAL_CONST(156675.37756092031/8.0),
- REAL_CONST(156701.90517037612/8.0),
- REAL_CONST(156728.43390257491/8.0),
- REAL_CONST(156754.96375742162/8.0),
- REAL_CONST(156781.49473482129/8.0),
- REAL_CONST(156808.02683467892/8.0),
- REAL_CONST(156834.5600568995/8.0),
- REAL_CONST(156861.09440138817/8.0),
- REAL_CONST(156887.62986804993/8.0),
- REAL_CONST(156914.16645678994/8.0),
- REAL_CONST(156940.70416751326/8.0),
- REAL_CONST(156967.24300012505/8.0),
- REAL_CONST(156993.78295453047/8.0),
- REAL_CONST(157020.32403063469/8.0),
- REAL_CONST(157046.8662283429/8.0),
- REAL_CONST(157073.40954756032/8.0),
- REAL_CONST(157099.9539881922/8.0),
- REAL_CONST(157126.49955014378/8.0),
- REAL_CONST(157153.04623332032/8.0),
- REAL_CONST(157179.59403762716/8.0),
- REAL_CONST(157206.14296296958/8.0),
- REAL_CONST(157232.69300925292/8.0),
- REAL_CONST(157259.24417638258/8.0),
- REAL_CONST(157285.79646426387/8.0),
- REAL_CONST(157312.34987280221/8.0),
- REAL_CONST(157338.90440190304/8.0),
- REAL_CONST(157365.46005147175/8.0),
- REAL_CONST(157392.01682141385/8.0),
- REAL_CONST(157418.57471163478/8.0),
- REAL_CONST(157445.13372204005/8.0),
- REAL_CONST(157471.69385253513/8.0),
- REAL_CONST(157498.25510302564/8.0),
- REAL_CONST(157524.81747341706/8.0),
- REAL_CONST(157551.38096361503/8.0),
- REAL_CONST(157577.9455735251/8.0),
- REAL_CONST(157604.51130305286/8.0),
- REAL_CONST(157631.07815210402/8.0),
- REAL_CONST(157657.64612058419/8.0),
- REAL_CONST(157684.21520839902/8.0),
- REAL_CONST(157710.78541545427/8.0),
- REAL_CONST(157737.35674165559/8.0),
- REAL_CONST(157763.92918690876/8.0),
- REAL_CONST(157790.50275111952/8.0),
- REAL_CONST(157817.07743419363/8.0),
- REAL_CONST(157843.65323603692/8.0),
- REAL_CONST(157870.23015655516/8.0),
- REAL_CONST(157896.80819565422/8.0),
- REAL_CONST(157923.3873532399/8.0),
- REAL_CONST(157949.96762921812/8.0),
- REAL_CONST(157976.54902349479/8.0),
- REAL_CONST(158003.13153597576/8.0),
- REAL_CONST(158029.71516656701/8.0),
- REAL_CONST(158056.29991517449/8.0),
- REAL_CONST(158082.88578170416/8.0),
- REAL_CONST(158109.47276606198/8.0),
- REAL_CONST(158136.06086815402/8.0),
- REAL_CONST(158162.65008788629/8.0),
- REAL_CONST(158189.24042516484/8.0),
- REAL_CONST(158215.83187989573/8.0),
- REAL_CONST(158242.42445198505/8.0),
- REAL_CONST(158269.01814133892/8.0),
- REAL_CONST(158295.61294786347/8.0),
- REAL_CONST(158322.20887146486/8.0),
- REAL_CONST(158348.80591204923/8.0),
- REAL_CONST(158375.4040695228/8.0),
- REAL_CONST(158402.00334379176/8.0),
- REAL_CONST(158428.60373476235/8.0),
- REAL_CONST(158455.2052423408/8.0),
- REAL_CONST(158481.80786643337/8.0),
- REAL_CONST(158508.41160694641/8.0),
- REAL_CONST(158535.01646378616/8.0),
- REAL_CONST(158561.62243685898/8.0),
- REAL_CONST(158588.2295260712/8.0),
- REAL_CONST(158614.8377313292/8.0),
- REAL_CONST(158641.44705253936/8.0),
- REAL_CONST(158668.05748960807/8.0),
- REAL_CONST(158694.66904244179/8.0),
- REAL_CONST(158721.28171094693/8.0),
- REAL_CONST(158747.89549502998/8.0),
- REAL_CONST(158774.5103945974/8.0),
- REAL_CONST(158801.12640955573/8.0),
- REAL_CONST(158827.74353981143/8.0),
- REAL_CONST(158854.36178527112/8.0),
- REAL_CONST(158880.9811458413/8.0),
- REAL_CONST(158907.60162142856/8.0),
- REAL_CONST(158934.22321193956/8.0),
- REAL_CONST(158960.84591728085/8.0),
- REAL_CONST(158987.46973735912/8.0),
- REAL_CONST(159014.09467208097/8.0),
- REAL_CONST(159040.72072135314/8.0),
- REAL_CONST(159067.3478850823/8.0),
- REAL_CONST(159093.97616317519/8.0),
- REAL_CONST(159120.60555553852/8.0),
- REAL_CONST(159147.23606207906/8.0),
- REAL_CONST(159173.8676827036/8.0),
- REAL_CONST(159200.50041731889/8.0),
- REAL_CONST(159227.13426583182/8.0),
- REAL_CONST(159253.76922814918/8.0),
- REAL_CONST(159280.40530417781/8.0),
- REAL_CONST(159307.04249382461/8.0),
- REAL_CONST(159333.68079699649/8.0),
- REAL_CONST(159360.32021360032/8.0),
- REAL_CONST(159386.96074354305/8.0),
- REAL_CONST(159413.60238673165/8.0),
- REAL_CONST(159440.24514307309/8.0),
- REAL_CONST(159466.88901247433/8.0),
- REAL_CONST(159493.53399484244/8.0),
- REAL_CONST(159520.18009008438/8.0),
- REAL_CONST(159546.82729810724/8.0),
- REAL_CONST(159573.47561881805/8.0),
- REAL_CONST(159600.12505212394/8.0),
- REAL_CONST(159626.77559793202/8.0),
- REAL_CONST(159653.42725614941/8.0),
- REAL_CONST(159680.08002668325/8.0),
- REAL_CONST(159706.73390944069/8.0),
- REAL_CONST(159733.38890432892/8.0),
- REAL_CONST(159760.04501125516/8.0),
- REAL_CONST(159786.70223012666/8.0),
- REAL_CONST(159813.36056085059/8.0),
- REAL_CONST(159840.02000333427/8.0),
- REAL_CONST(159866.68055748497/8.0),
- REAL_CONST(159893.34222320997/8.0),
- REAL_CONST(159920.00500041663/8.0),
- REAL_CONST(159946.66888901225/8.0),
- REAL_CONST(159973.33388890422/8.0),
- REAL_CONST(159999.99999999988/8.0),
- REAL_CONST(160026.66722220668/8.0),
- REAL_CONST(160053.33555543202/8.0),
- REAL_CONST(160080.0049995833/8.0),
- REAL_CONST(160106.67555456801/8.0),
- REAL_CONST(160133.3472202936/8.0),
- REAL_CONST(160160.0199966676/8.0),
- REAL_CONST(160186.6938835975/8.0),
- REAL_CONST(160213.36888099083/8.0),
- REAL_CONST(160240.04498875517/8.0),
- REAL_CONST(160266.72220679806/8.0),
- REAL_CONST(160293.40053502709/8.0),
- REAL_CONST(160320.07997334987/8.0),
- REAL_CONST(160346.76052167406/8.0),
- REAL_CONST(160373.44217990729/8.0),
- REAL_CONST(160400.1249479572/8.0),
- REAL_CONST(160426.80882573154/8.0),
- REAL_CONST(160453.49381313793/8.0),
- REAL_CONST(160480.17991008417/8.0),
- REAL_CONST(160506.86711647795/8.0),
- REAL_CONST(160533.55543222709/8.0),
- REAL_CONST(160560.24485723933/8.0),
- REAL_CONST(160586.93539142248/8.0),
- REAL_CONST(160613.62703468435/8.0),
- REAL_CONST(160640.31978693281/8.0),
- REAL_CONST(160667.01364807569/8.0),
- REAL_CONST(160693.70861802087/8.0),
- REAL_CONST(160720.40469667627/8.0),
- REAL_CONST(160747.1018839498/8.0),
- REAL_CONST(160773.80017974938/8.0),
- REAL_CONST(160800.49958398298/8.0),
- REAL_CONST(160827.20009655855/8.0),
- REAL_CONST(160853.90171738411/8.0),
- REAL_CONST(160880.60444636765/8.0),
- REAL_CONST(160907.30828341722/8.0),
- REAL_CONST(160934.01322844089/8.0),
- REAL_CONST(160960.71928134665/8.0),
- REAL_CONST(160987.42644204266/8.0),
- REAL_CONST(161014.13471043704/8.0),
- REAL_CONST(161040.84408643784/8.0),
- REAL_CONST(161067.55456995327/8.0),
- REAL_CONST(161094.26616089148/8.0),
- REAL_CONST(161120.97885916062/8.0),
- REAL_CONST(161147.69266466892/8.0),
- REAL_CONST(161174.40757732463/8.0),
- REAL_CONST(161201.12359703594/8.0),
- REAL_CONST(161227.84072371112/8.0),
- REAL_CONST(161254.55895725847/8.0),
- REAL_CONST(161281.27829758628/8.0),
- REAL_CONST(161307.99874460287/8.0),
- REAL_CONST(161334.72029821656/8.0),
- REAL_CONST(161361.44295833571/8.0),
- REAL_CONST(161388.1667248687/8.0),
- REAL_CONST(161414.89159772391/8.0),
- REAL_CONST(161441.61757680977/8.0),
- REAL_CONST(161468.34466203468/8.0),
- REAL_CONST(161495.07285330712/8.0),
- REAL_CONST(161521.80215053557/8.0),
- REAL_CONST(161548.53255362847/8.0),
- REAL_CONST(161575.26406249436/8.0),
- REAL_CONST(161601.99667704175/8.0),
- REAL_CONST(161628.7303971792/8.0),
- REAL_CONST(161655.46522281526/8.0),
- REAL_CONST(161682.20115385848/8.0),
- REAL_CONST(161708.93819021754/8.0),
- REAL_CONST(161735.67633180099/8.0),
- REAL_CONST(161762.41557851751/8.0),
- REAL_CONST(161789.15593027571/8.0),
- REAL_CONST(161815.89738698432/8.0),
- REAL_CONST(161842.63994855201/8.0),
- REAL_CONST(161869.38361488748/8.0),
- REAL_CONST(161896.1283858995/8.0),
- REAL_CONST(161922.87426149679/8.0),
- REAL_CONST(161949.62124158812/8.0),
- REAL_CONST(161976.36932608229/8.0),
- REAL_CONST(162003.1185148881/8.0),
- REAL_CONST(162029.8688079144/8.0),
- REAL_CONST(162056.62020507001/8.0),
- REAL_CONST(162083.37270626382/8.0),
- REAL_CONST(162110.12631140469/8.0),
- REAL_CONST(162136.88102040152/8.0),
- REAL_CONST(162163.63683316324/8.0),
- REAL_CONST(162190.39374959879/8.0),
- REAL_CONST(162217.15176961714/8.0),
- REAL_CONST(162243.91089312723/8.0),
- REAL_CONST(162270.67112003808/8.0),
- REAL_CONST(162297.43245025873/8.0),
- REAL_CONST(162324.19488369819/8.0),
- REAL_CONST(162350.9584202655/8.0),
- REAL_CONST(162377.72305986975/8.0),
- REAL_CONST(162404.48880242003/8.0),
- REAL_CONST(162431.25564782543/8.0),
- REAL_CONST(162458.02359599507/8.0),
- REAL_CONST(162484.79264683815/8.0),
- REAL_CONST(162511.56280026378/8.0),
- REAL_CONST(162538.33405618116/8.0),
- REAL_CONST(162565.10641449949/8.0),
- REAL_CONST(162591.87987512801/8.0),
- REAL_CONST(162618.65443797593/8.0),
- REAL_CONST(162645.43010295252/8.0),
- REAL_CONST(162672.20686996708/8.0),
- REAL_CONST(162698.98473892888/8.0),
- REAL_CONST(162725.76370974723/8.0),
- REAL_CONST(162752.54378233149/8.0),
- REAL_CONST(162779.32495659095/8.0),
- REAL_CONST(162806.10723243505/8.0),
- REAL_CONST(162832.89060977317/8.0),
- REAL_CONST(162859.67508851466/8.0),
- REAL_CONST(162886.46066856899/8.0),
- REAL_CONST(162913.24734984562/8.0),
- REAL_CONST(162940.03513225398/8.0),
- REAL_CONST(162966.82401570358/8.0),
- REAL_CONST(162993.6140001039/8.0),
- REAL_CONST(163020.40508536444/8.0),
- REAL_CONST(163047.19727139481/8.0),
- REAL_CONST(163073.99055810447/8.0),
- REAL_CONST(163100.78494540305/8.0),
- REAL_CONST(163127.58043320014/8.0),
- REAL_CONST(163154.37702140535/8.0),
- REAL_CONST(163181.17470992831/8.0),
- REAL_CONST(163207.97349867865/8.0),
- REAL_CONST(163234.77338756606/8.0),
- REAL_CONST(163261.57437650024/8.0),
- REAL_CONST(163288.37646539087/8.0),
- REAL_CONST(163315.17965414765/8.0),
- REAL_CONST(163341.98394268038/8.0),
- REAL_CONST(163368.78933089875/8.0),
- REAL_CONST(163395.59581871261/8.0),
- REAL_CONST(163422.40340603172/8.0),
- REAL_CONST(163449.2120927659/8.0),
- REAL_CONST(163476.02187882498/8.0),
- REAL_CONST(163502.83276411882/8.0),
- REAL_CONST(163529.6447485573/8.0),
- REAL_CONST(163556.45783205028/8.0),
- REAL_CONST(163583.2720145077/8.0),
- REAL_CONST(163610.08729583945/8.0),
- REAL_CONST(163636.90367595552/8.0),
- REAL_CONST(163663.72115476584/8.0),
- REAL_CONST(163690.53973218042/8.0),
- REAL_CONST(163717.35940810922/8.0),
- REAL_CONST(163744.18018246227/8.0),
- REAL_CONST(163771.00205514964/8.0),
- REAL_CONST(163797.82502608138/8.0),
- REAL_CONST(163824.64909516752/8.0),
- REAL_CONST(163851.4742623182/8.0),
- REAL_CONST(163878.3005274435/8.0),
- REAL_CONST(163905.12789045356/8.0),
- REAL_CONST(163931.95635125853/8.0),
- REAL_CONST(163958.78590976857/8.0),
- REAL_CONST(163985.61656589387/8.0),
- REAL_CONST(164012.44831954464/8.0),
- REAL_CONST(164039.28117063109/8.0),
- REAL_CONST(164066.11511906344/8.0),
- REAL_CONST(164092.95016475199/8.0),
- REAL_CONST(164119.78630760699/8.0),
- REAL_CONST(164146.62354753874/8.0),
- REAL_CONST(164173.46188445756/8.0),
- REAL_CONST(164200.30131827376/8.0),
- REAL_CONST(164227.14184889771/8.0),
- REAL_CONST(164253.98347623978/8.0),
- REAL_CONST(164280.82620021031/8.0),
- REAL_CONST(164307.67002071979/8.0),
- REAL_CONST(164334.51493767856/8.0),
- REAL_CONST(164361.3609509971/8.0),
- REAL_CONST(164388.20806058586/8.0),
- REAL_CONST(164415.05626635533/8.0),
- REAL_CONST(164441.905568216/8.0),
- REAL_CONST(164468.75596607837/8.0),
- REAL_CONST(164495.607459853/8.0),
- REAL_CONST(164522.4600494504/8.0),
- REAL_CONST(164549.31373478117/8.0),
- REAL_CONST(164576.16851575591/8.0),
- REAL_CONST(164603.02439228518/8.0),
- REAL_CONST(164629.88136427966/8.0),
- REAL_CONST(164656.73943164994/8.0),
- REAL_CONST(164683.59859430668/8.0),
- REAL_CONST(164710.45885216061/8.0),
- REAL_CONST(164737.32020512238/8.0),
- REAL_CONST(164764.1826531027/8.0),
- REAL_CONST(164791.04619601235/8.0),
- REAL_CONST(164817.91083376206/8.0),
- REAL_CONST(164844.77656626256/8.0),
- REAL_CONST(164871.64339342469/8.0),
- REAL_CONST(164898.51131515924/8.0),
- REAL_CONST(164925.38033137703/8.0),
- REAL_CONST(164952.25044198887/8.0),
- REAL_CONST(164979.1216469057/8.0),
- REAL_CONST(165005.9939460383/8.0),
- REAL_CONST(165032.86733929763/8.0),
- REAL_CONST(165059.7418265946/8.0),
- REAL_CONST(165086.61740784015/8.0),
- REAL_CONST(165113.4940829452/8.0)
-#endif
-};
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/libfaad/is.c b/src/libfaad/is.c
deleted file mode 100644
index 9fcdbcbb5..000000000
--- a/src/libfaad/is.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: is.c,v 1.7 2005/10/29 23:57:06 tmmm Exp $
-**/
-
-#include "common.h"
-#include "structs.h"
-
-#include "syntax.h"
-#include "is.h"
-
-#ifdef FIXED_POINT
-static real_t pow05_table[] = {
- COEF_CONST(1.68179283050743), /* 0.5^(-3/4) */
- COEF_CONST(1.41421356237310), /* 0.5^(-2/4) */
- COEF_CONST(1.18920711500272), /* 0.5^(-1/4) */
- COEF_CONST(1.0), /* 0.5^( 0/4) */
- COEF_CONST(0.84089641525371), /* 0.5^(+1/4) */
- COEF_CONST(0.70710678118655), /* 0.5^(+2/4) */
- COEF_CONST(0.59460355750136) /* 0.5^(+3/4) */
-};
-#endif
-
-void is_decode(ic_stream *ics, ic_stream *icsr, real_t *l_spec, real_t *r_spec,
- uint16_t frame_len)
-{
- uint8_t g, sfb, b;
- uint16_t i;
-#ifndef FIXED_POINT
- real_t scale;
-#else
- int32_t exp, frac;
-#endif
-
- uint16_t nshort = frame_len/8;
- uint8_t group = 0;
-
- for (g = 0; g < icsr->num_window_groups; g++)
- {
- /* Do intensity stereo decoding */
- for (b = 0; b < icsr->window_group_length[g]; b++)
- {
- for (sfb = 0; sfb < icsr->max_sfb; sfb++)
- {
- if (is_intensity(icsr, g, sfb))
- {
-#ifdef MAIN_DEC
- /* For scalefactor bands coded in intensity stereo the
- corresponding predictors in the right channel are
- switched to "off".
- */
- ics->pred.prediction_used[sfb] = 0;
- icsr->pred.prediction_used[sfb] = 0;
-#endif
-
-#ifndef FIXED_POINT
- scale = (real_t)pow(0.5, (0.25*icsr->scale_factors[g][sfb]));
-#else
- exp = icsr->scale_factors[g][sfb] >> 2;
- frac = icsr->scale_factors[g][sfb] & 3;
-#endif
-
- /* Scale from left to right channel,
- do not touch left channel */
- for (i = icsr->swb_offset[sfb]; i < icsr->swb_offset[sfb+1]; i++)
- {
-#ifndef FIXED_POINT
- r_spec[(group*nshort)+i] = MUL_R(l_spec[(group*nshort)+i], scale);
-#else
- if (exp < 0)
- r_spec[(group*nshort)+i] = l_spec[(group*nshort)+i] << -exp;
- else
- r_spec[(group*nshort)+i] = l_spec[(group*nshort)+i] >> exp;
- r_spec[(group*nshort)+i] = MUL_C(r_spec[(group*nshort)+i], pow05_table[frac + 3]);
-#endif
- if (is_intensity(icsr, g, sfb) != invert_intensity(ics, g, sfb))
- r_spec[(group*nshort)+i] = -r_spec[(group*nshort)+i];
- }
- }
- }
- group++;
- }
- }
-}
diff --git a/src/libfaad/is.h b/src/libfaad/is.h
deleted file mode 100644
index 0786f7258..000000000
--- a/src/libfaad/is.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: is.h,v 1.7 2005/10/29 23:57:06 tmmm Exp $
-**/
-
-#ifndef __IS_H__
-#define __IS_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "syntax.h"
-
-void is_decode(ic_stream *ics, ic_stream *icsr, real_t *l_spec, real_t *r_spec,
- uint16_t frame_len);
-
-static INLINE int8_t is_intensity(ic_stream *ics, uint8_t group, uint8_t sfb)
-{
- switch (ics->sfb_cb[group][sfb])
- {
- case INTENSITY_HCB:
- return 1;
- case INTENSITY_HCB2:
- return -1;
- default:
- return 0;
- }
-}
-
-static INLINE int8_t invert_intensity(ic_stream *ics, uint8_t group, uint8_t sfb)
-{
- if (ics->ms_mask_present == 1)
- return (1-2*ics->ms_used[group][sfb]);
- return 1;
-}
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/libfaad/kbd_win.h b/src/libfaad/kbd_win.h
deleted file mode 100644
index 046b6b995..000000000
--- a/src/libfaad/kbd_win.h
+++ /dev/null
@@ -1,2294 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: kbd_win.h,v 1.7 2005/10/29 23:57:06 tmmm Exp $
-**/
-
-#ifndef __KBD_WIN_H__
-#define __KBD_WIN_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef _MSC_VER
-#pragma warning(disable:4305)
-#pragma warning(disable:4244)
-#endif
-
-ALIGN static const real_t kbd_long_1024[] =
-{
- FRAC_CONST(0.00029256153896361),
- FRAC_CONST(0.00042998567353047),
- FRAC_CONST(0.00054674074589540),
- FRAC_CONST(0.00065482304299792),
- FRAC_CONST(0.00075870195068747),
- FRAC_CONST(0.00086059331713336),
- FRAC_CONST(0.00096177541439010),
- FRAC_CONST(0.0010630609410878),
- FRAC_CONST(0.0011650036308132),
- FRAC_CONST(0.0012680012194148),
- FRAC_CONST(0.0013723517232956),
- FRAC_CONST(0.0014782864109136),
- FRAC_CONST(0.0015859901976719),
- FRAC_CONST(0.0016956148252373),
- FRAC_CONST(0.0018072876903517),
- FRAC_CONST(0.0019211179405514),
- FRAC_CONST(0.0020372007924215),
- FRAC_CONST(0.0021556206591754),
- FRAC_CONST(0.0022764534599614),
- FRAC_CONST(0.0023997683540995),
- FRAC_CONST(0.0025256290631156),
- FRAC_CONST(0.0026540948920831),
- FRAC_CONST(0.0027852215281403),
- FRAC_CONST(0.0029190616715331),
- FRAC_CONST(0.0030556655443223),
- FRAC_CONST(0.0031950812943391),
- FRAC_CONST(0.0033373553240392),
- FRAC_CONST(0.0034825325586930),
- FRAC_CONST(0.0036306566699199),
- FRAC_CONST(0.0037817702604646),
- FRAC_CONST(0.0039359150179719),
- FRAC_CONST(0.0040931318437260),
- FRAC_CONST(0.0042534609610026),
- FRAC_CONST(0.0044169420066964),
- FRAC_CONST(0.0045836141091341),
- FRAC_CONST(0.0047535159544086),
- FRAC_CONST(0.0049266858431214),
- FRAC_CONST(0.0051031617390698),
- FRAC_CONST(0.0052829813111335),
- FRAC_CONST(0.0054661819693975),
- FRAC_CONST(0.0056528008963682),
- FRAC_CONST(0.0058428750739943),
- FRAC_CONST(0.0060364413070882),
- FRAC_CONST(0.0062335362436492),
- FRAC_CONST(0.0064341963925079),
- FRAC_CONST(0.0066384581386503),
- FRAC_CONST(0.0068463577565218),
- FRAC_CONST(0.0070579314215715),
- FRAC_CONST(0.0072732152202559),
- FRAC_CONST(0.0074922451586909),
- FRAC_CONST(0.0077150571701162),
- FRAC_CONST(0.0079416871213115),
- FRAC_CONST(0.0081721708180857),
- FRAC_CONST(0.0084065440099458),
- FRAC_CONST(0.0086448423940363),
- FRAC_CONST(0.0088871016184291),
- FRAC_CONST(0.0091333572848345),
- FRAC_CONST(0.0093836449507939),
- FRAC_CONST(0.0096380001314086),
- FRAC_CONST(0.0098964583006517),
- FRAC_CONST(0.010159054892306),
- FRAC_CONST(0.010425825300561),
- FRAC_CONST(0.010696804880310),
- FRAC_CONST(0.010972028947167),
- FRAC_CONST(0.011251532777236),
- FRAC_CONST(0.011535351606646),
- FRAC_CONST(0.011823520630897),
- FRAC_CONST(0.012116075003993),
- FRAC_CONST(0.012413049837429),
- FRAC_CONST(0.012714480198999),
- FRAC_CONST(0.013020401111478),
- FRAC_CONST(0.013330847551161),
- FRAC_CONST(0.013645854446288),
- FRAC_CONST(0.013965456675352),
- FRAC_CONST(0.014289689065314),
- FRAC_CONST(0.014618586389712),
- FRAC_CONST(0.014952183366697),
- FRAC_CONST(0.015290514656976),
- FRAC_CONST(0.015633614861688),
- FRAC_CONST(0.015981518520214),
- FRAC_CONST(0.016334260107915),
- FRAC_CONST(0.016691874033817),
- FRAC_CONST(0.017054394638241),
- FRAC_CONST(0.017421856190380),
- FRAC_CONST(0.017794292885832),
- FRAC_CONST(0.018171738844085),
- FRAC_CONST(0.018554228105962),
- FRAC_CONST(0.018941794631032),
- FRAC_CONST(0.019334472294980),
- FRAC_CONST(0.019732294886947),
- FRAC_CONST(0.020135296106839),
- FRAC_CONST(0.020543509562604),
- FRAC_CONST(0.020956968767488),
- FRAC_CONST(0.021375707137257),
- FRAC_CONST(0.021799757987407),
- FRAC_CONST(0.022229154530343),
- FRAC_CONST(0.022663929872540),
- FRAC_CONST(0.023104117011689),
- FRAC_CONST(0.023549748833816),
- FRAC_CONST(0.024000858110398),
- FRAC_CONST(0.024457477495451),
- FRAC_CONST(0.024919639522613),
- FRAC_CONST(0.025387376602207),
- FRAC_CONST(0.025860721018295),
- FRAC_CONST(0.026339704925726),
- FRAC_CONST(0.026824360347160),
- FRAC_CONST(0.027314719170100),
- FRAC_CONST(0.027810813143900),
- FRAC_CONST(0.028312673876775),
- FRAC_CONST(0.028820332832801),
- FRAC_CONST(0.029333821328905),
- FRAC_CONST(0.029853170531859),
- FRAC_CONST(0.030378411455255),
- FRAC_CONST(0.030909574956490),
- FRAC_CONST(0.031446691733739),
- FRAC_CONST(0.031989792322926),
- FRAC_CONST(0.032538907094693),
- FRAC_CONST(0.033094066251369),
- FRAC_CONST(0.033655299823935),
- FRAC_CONST(0.034222637668991),
- FRAC_CONST(0.034796109465717),
- FRAC_CONST(0.035375744712844),
- FRAC_CONST(0.035961572725616),
- FRAC_CONST(0.036553622632758),
- FRAC_CONST(0.037151923373446),
- FRAC_CONST(0.037756503694277),
- FRAC_CONST(0.038367392146243),
- FRAC_CONST(0.038984617081711),
- FRAC_CONST(0.039608206651398),
- FRAC_CONST(0.040238188801359),
- FRAC_CONST(0.040874591269976),
- FRAC_CONST(0.041517441584950),
- FRAC_CONST(0.042166767060301),
- FRAC_CONST(0.042822594793376),
- FRAC_CONST(0.043484951661852),
- FRAC_CONST(0.044153864320760),
- FRAC_CONST(0.044829359199509),
- FRAC_CONST(0.045511462498913),
- FRAC_CONST(0.046200200188234),
- FRAC_CONST(0.046895598002228),
- FRAC_CONST(0.047597681438201),
- FRAC_CONST(0.048306475753074),
- FRAC_CONST(0.049022005960455),
- FRAC_CONST(0.049744296827725),
- FRAC_CONST(0.050473372873129),
- FRAC_CONST(0.051209258362879),
- FRAC_CONST(0.051951977308273),
- FRAC_CONST(0.052701553462813),
- FRAC_CONST(0.053458010319350),
- FRAC_CONST(0.054221371107223),
- FRAC_CONST(0.054991658789428),
- FRAC_CONST(0.055768896059787),
- FRAC_CONST(0.056553105340134),
- FRAC_CONST(0.057344308777513),
- FRAC_CONST(0.058142528241393),
- FRAC_CONST(0.058947785320893),
- FRAC_CONST(0.059760101322019),
- FRAC_CONST(0.060579497264926),
- FRAC_CONST(0.061405993881180),
- FRAC_CONST(0.062239611611049),
- FRAC_CONST(0.063080370600799),
- FRAC_CONST(0.063928290700012),
- FRAC_CONST(0.064783391458919),
- FRAC_CONST(0.065645692125747),
- FRAC_CONST(0.066515211644086),
- FRAC_CONST(0.067391968650269),
- FRAC_CONST(0.068275981470777),
- FRAC_CONST(0.069167268119652),
- FRAC_CONST(0.070065846295935),
- FRAC_CONST(0.070971733381121),
- FRAC_CONST(0.071884946436630),
- FRAC_CONST(0.072805502201299),
- FRAC_CONST(0.073733417088896),
- FRAC_CONST(0.074668707185649),
- FRAC_CONST(0.075611388247794),
- FRAC_CONST(0.076561475699152),
- FRAC_CONST(0.077518984628715),
- FRAC_CONST(0.078483929788261),
- FRAC_CONST(0.079456325589986),
- FRAC_CONST(0.080436186104162),
- FRAC_CONST(0.081423525056808),
- FRAC_CONST(0.082418355827392),
- FRAC_CONST(0.083420691446553),
- FRAC_CONST(0.084430544593841),
- FRAC_CONST(0.085447927595483),
- FRAC_CONST(0.086472852422178),
- FRAC_CONST(0.087505330686900),
- FRAC_CONST(0.088545373642744),
- FRAC_CONST(0.089592992180780),
- FRAC_CONST(0.090648196827937),
- FRAC_CONST(0.091710997744919),
- FRAC_CONST(0.092781404724131),
- FRAC_CONST(0.093859427187640),
- FRAC_CONST(0.094945074185163),
- FRAC_CONST(0.096038354392069),
- FRAC_CONST(0.097139276107423),
- FRAC_CONST(0.098247847252041),
- FRAC_CONST(0.099364075366580),
- FRAC_CONST(0.10048796760965),
- FRAC_CONST(0.10161953075597),
- FRAC_CONST(0.10275877119451),
- FRAC_CONST(0.10390569492671),
- FRAC_CONST(0.10506030756469),
- FRAC_CONST(0.10622261432949),
- FRAC_CONST(0.10739262004941),
- FRAC_CONST(0.10857032915821),
- FRAC_CONST(0.10975574569357),
- FRAC_CONST(0.11094887329534),
- FRAC_CONST(0.11214971520402),
- FRAC_CONST(0.11335827425914),
- FRAC_CONST(0.11457455289772),
- FRAC_CONST(0.11579855315274),
- FRAC_CONST(0.11703027665170),
- FRAC_CONST(0.11826972461510),
- FRAC_CONST(0.11951689785504),
- FRAC_CONST(0.12077179677383),
- FRAC_CONST(0.12203442136263),
- FRAC_CONST(0.12330477120008),
- FRAC_CONST(0.12458284545102),
- FRAC_CONST(0.12586864286523),
- FRAC_CONST(0.12716216177615),
- FRAC_CONST(0.12846340009971),
- FRAC_CONST(0.12977235533312),
- FRAC_CONST(0.13108902455375),
- FRAC_CONST(0.13241340441801),
- FRAC_CONST(0.13374549116025),
- FRAC_CONST(0.13508528059173),
- FRAC_CONST(0.13643276809961),
- FRAC_CONST(0.13778794864595),
- FRAC_CONST(0.13915081676677),
- FRAC_CONST(0.14052136657114),
- FRAC_CONST(0.14189959174027),
- FRAC_CONST(0.14328548552671),
- FRAC_CONST(0.14467904075349),
- FRAC_CONST(0.14608024981336),
- FRAC_CONST(0.14748910466804),
- FRAC_CONST(0.14890559684750),
- FRAC_CONST(0.15032971744929),
- FRAC_CONST(0.15176145713790),
- FRAC_CONST(0.15320080614414),
- FRAC_CONST(0.15464775426459),
- FRAC_CONST(0.15610229086100),
- FRAC_CONST(0.15756440485987),
- FRAC_CONST(0.15903408475193),
- FRAC_CONST(0.16051131859170),
- FRAC_CONST(0.16199609399712),
- FRAC_CONST(0.16348839814917),
- FRAC_CONST(0.16498821779156),
- FRAC_CONST(0.16649553923042),
- FRAC_CONST(0.16801034833404),
- FRAC_CONST(0.16953263053270),
- FRAC_CONST(0.17106237081842),
- FRAC_CONST(0.17259955374484),
- FRAC_CONST(0.17414416342714),
- FRAC_CONST(0.17569618354193),
- FRAC_CONST(0.17725559732720),
- FRAC_CONST(0.17882238758238),
- FRAC_CONST(0.18039653666830),
- FRAC_CONST(0.18197802650733),
- FRAC_CONST(0.18356683858343),
- FRAC_CONST(0.18516295394233),
- FRAC_CONST(0.18676635319174),
- FRAC_CONST(0.18837701650148),
- FRAC_CONST(0.18999492360384),
- FRAC_CONST(0.19162005379380),
- FRAC_CONST(0.19325238592940),
- FRAC_CONST(0.19489189843209),
- FRAC_CONST(0.19653856928714),
- FRAC_CONST(0.19819237604409),
- FRAC_CONST(0.19985329581721),
- FRAC_CONST(0.20152130528605),
- FRAC_CONST(0.20319638069594),
- FRAC_CONST(0.20487849785865),
- FRAC_CONST(0.20656763215298),
- FRAC_CONST(0.20826375852540),
- FRAC_CONST(0.20996685149083),
- FRAC_CONST(0.21167688513330),
- FRAC_CONST(0.21339383310678),
- FRAC_CONST(0.21511766863598),
- FRAC_CONST(0.21684836451719),
- FRAC_CONST(0.21858589311922),
- FRAC_CONST(0.22033022638425),
- FRAC_CONST(0.22208133582887),
- FRAC_CONST(0.22383919254503),
- FRAC_CONST(0.22560376720111),
- FRAC_CONST(0.22737503004300),
- FRAC_CONST(0.22915295089517),
- FRAC_CONST(0.23093749916189),
- FRAC_CONST(0.23272864382838),
- FRAC_CONST(0.23452635346201),
- FRAC_CONST(0.23633059621364),
- FRAC_CONST(0.23814133981883),
- FRAC_CONST(0.23995855159925),
- FRAC_CONST(0.24178219846403),
- FRAC_CONST(0.24361224691114),
- FRAC_CONST(0.24544866302890),
- FRAC_CONST(0.24729141249740),
- FRAC_CONST(0.24914046059007),
- FRAC_CONST(0.25099577217522),
- FRAC_CONST(0.25285731171763),
- FRAC_CONST(0.25472504328019),
- FRAC_CONST(0.25659893052556),
- FRAC_CONST(0.25847893671788),
- FRAC_CONST(0.26036502472451),
- FRAC_CONST(0.26225715701781),
- FRAC_CONST(0.26415529567692),
- FRAC_CONST(0.26605940238966),
- FRAC_CONST(0.26796943845439),
- FRAC_CONST(0.26988536478190),
- FRAC_CONST(0.27180714189742),
- FRAC_CONST(0.27373472994256),
- FRAC_CONST(0.27566808867736),
- FRAC_CONST(0.27760717748238),
- FRAC_CONST(0.27955195536071),
- FRAC_CONST(0.28150238094021),
- FRAC_CONST(0.28345841247557),
- FRAC_CONST(0.28542000785059),
- FRAC_CONST(0.28738712458038),
- FRAC_CONST(0.28935971981364),
- FRAC_CONST(0.29133775033492),
- FRAC_CONST(0.29332117256704),
- FRAC_CONST(0.29530994257338),
- FRAC_CONST(0.29730401606034),
- FRAC_CONST(0.29930334837974),
- FRAC_CONST(0.30130789453132),
- FRAC_CONST(0.30331760916521),
- FRAC_CONST(0.30533244658452),
- FRAC_CONST(0.30735236074785),
- FRAC_CONST(0.30937730527195),
- FRAC_CONST(0.31140723343430),
- FRAC_CONST(0.31344209817583),
- FRAC_CONST(0.31548185210356),
- FRAC_CONST(0.31752644749341),
- FRAC_CONST(0.31957583629288),
- FRAC_CONST(0.32162997012390),
- FRAC_CONST(0.32368880028565),
- FRAC_CONST(0.32575227775738),
- FRAC_CONST(0.32782035320134),
- FRAC_CONST(0.32989297696566),
- FRAC_CONST(0.33197009908736),
- FRAC_CONST(0.33405166929523),
- FRAC_CONST(0.33613763701295),
- FRAC_CONST(0.33822795136203),
- FRAC_CONST(0.34032256116495),
- FRAC_CONST(0.34242141494820),
- FRAC_CONST(0.34452446094547),
- FRAC_CONST(0.34663164710072),
- FRAC_CONST(0.34874292107143),
- FRAC_CONST(0.35085823023181),
- FRAC_CONST(0.35297752167598),
- FRAC_CONST(0.35510074222129),
- FRAC_CONST(0.35722783841160),
- FRAC_CONST(0.35935875652060),
- FRAC_CONST(0.36149344255514),
- FRAC_CONST(0.36363184225864),
- FRAC_CONST(0.36577390111444),
- FRAC_CONST(0.36791956434930),
- FRAC_CONST(0.37006877693676),
- FRAC_CONST(0.37222148360070),
- FRAC_CONST(0.37437762881878),
- FRAC_CONST(0.37653715682603),
- FRAC_CONST(0.37870001161834),
- FRAC_CONST(0.38086613695607),
- FRAC_CONST(0.38303547636766),
- FRAC_CONST(0.38520797315322),
- FRAC_CONST(0.38738357038821),
- FRAC_CONST(0.38956221092708),
- FRAC_CONST(0.39174383740701),
- FRAC_CONST(0.39392839225157),
- FRAC_CONST(0.39611581767449),
- FRAC_CONST(0.39830605568342),
- FRAC_CONST(0.40049904808370),
- FRAC_CONST(0.40269473648218),
- FRAC_CONST(0.40489306229101),
- FRAC_CONST(0.40709396673153),
- FRAC_CONST(0.40929739083810),
- FRAC_CONST(0.41150327546197),
- FRAC_CONST(0.41371156127524),
- FRAC_CONST(0.41592218877472),
- FRAC_CONST(0.41813509828594),
- FRAC_CONST(0.42035022996702),
- FRAC_CONST(0.42256752381274),
- FRAC_CONST(0.42478691965848),
- FRAC_CONST(0.42700835718423),
- FRAC_CONST(0.42923177591866),
- FRAC_CONST(0.43145711524314),
- FRAC_CONST(0.43368431439580),
- FRAC_CONST(0.43591331247564),
- FRAC_CONST(0.43814404844658),
- FRAC_CONST(0.44037646114161),
- FRAC_CONST(0.44261048926688),
- FRAC_CONST(0.44484607140589),
- FRAC_CONST(0.44708314602359),
- FRAC_CONST(0.44932165147057),
- FRAC_CONST(0.45156152598727),
- FRAC_CONST(0.45380270770813),
- FRAC_CONST(0.45604513466581),
- FRAC_CONST(0.45828874479543),
- FRAC_CONST(0.46053347593880),
- FRAC_CONST(0.46277926584861),
- FRAC_CONST(0.46502605219277),
- FRAC_CONST(0.46727377255861),
- FRAC_CONST(0.46952236445718),
- FRAC_CONST(0.47177176532752),
- FRAC_CONST(0.47402191254100),
- FRAC_CONST(0.47627274340557),
- FRAC_CONST(0.47852419517009),
- FRAC_CONST(0.48077620502869),
- FRAC_CONST(0.48302871012505),
- FRAC_CONST(0.48528164755674),
- FRAC_CONST(0.48753495437962),
- FRAC_CONST(0.48978856761212),
- FRAC_CONST(0.49204242423966),
- FRAC_CONST(0.49429646121898),
- FRAC_CONST(0.49655061548250),
- FRAC_CONST(0.49880482394273),
- FRAC_CONST(0.50105902349665),
- FRAC_CONST(0.50331315103004),
- FRAC_CONST(0.50556714342194),
- FRAC_CONST(0.50782093754901),
- FRAC_CONST(0.51007447028990),
- FRAC_CONST(0.51232767852971),
- FRAC_CONST(0.51458049916433),
- FRAC_CONST(0.51683286910489),
- FRAC_CONST(0.51908472528213),
- FRAC_CONST(0.52133600465083),
- FRAC_CONST(0.52358664419420),
- FRAC_CONST(0.52583658092832),
- FRAC_CONST(0.52808575190648),
- FRAC_CONST(0.53033409422367),
- FRAC_CONST(0.53258154502092),
- FRAC_CONST(0.53482804148974),
- FRAC_CONST(0.53707352087652),
- FRAC_CONST(0.53931792048690),
- FRAC_CONST(0.54156117769021),
- FRAC_CONST(0.54380322992385),
- FRAC_CONST(0.54604401469766),
- FRAC_CONST(0.54828346959835),
- FRAC_CONST(0.55052153229384),
- FRAC_CONST(0.55275814053768),
- FRAC_CONST(0.55499323217338),
- FRAC_CONST(0.55722674513883),
- FRAC_CONST(0.55945861747062),
- FRAC_CONST(0.56168878730842),
- FRAC_CONST(0.56391719289930),
- FRAC_CONST(0.56614377260214),
- FRAC_CONST(0.56836846489188),
- FRAC_CONST(0.57059120836390),
- FRAC_CONST(0.57281194173835),
- FRAC_CONST(0.57503060386439),
- FRAC_CONST(0.57724713372458),
- FRAC_CONST(0.57946147043912),
- FRAC_CONST(0.58167355327012),
- FRAC_CONST(0.58388332162591),
- FRAC_CONST(0.58609071506528),
- FRAC_CONST(0.58829567330173),
- FRAC_CONST(0.59049813620770),
- FRAC_CONST(0.59269804381879),
- FRAC_CONST(0.59489533633802),
- FRAC_CONST(0.59708995413996),
- FRAC_CONST(0.59928183777495),
- FRAC_CONST(0.60147092797329),
- FRAC_CONST(0.60365716564937),
- FRAC_CONST(0.60584049190582),
- FRAC_CONST(0.60802084803764),
- FRAC_CONST(0.61019817553632),
- FRAC_CONST(0.61237241609393),
- FRAC_CONST(0.61454351160718),
- FRAC_CONST(0.61671140418155),
- FRAC_CONST(0.61887603613527),
- FRAC_CONST(0.62103735000336),
- FRAC_CONST(0.62319528854167),
- FRAC_CONST(0.62534979473088),
- FRAC_CONST(0.62750081178042),
- FRAC_CONST(0.62964828313250),
- FRAC_CONST(0.63179215246597),
- FRAC_CONST(0.63393236370030),
- FRAC_CONST(0.63606886099946),
- FRAC_CONST(0.63820158877577),
- FRAC_CONST(0.64033049169379),
- FRAC_CONST(0.64245551467413),
- FRAC_CONST(0.64457660289729),
- FRAC_CONST(0.64669370180740),
- FRAC_CONST(0.64880675711607),
- FRAC_CONST(0.65091571480603),
- FRAC_CONST(0.65302052113494),
- FRAC_CONST(0.65512112263906),
- FRAC_CONST(0.65721746613689),
- FRAC_CONST(0.65930949873289),
- FRAC_CONST(0.66139716782102),
- FRAC_CONST(0.66348042108842),
- FRAC_CONST(0.66555920651892),
- FRAC_CONST(0.66763347239664),
- FRAC_CONST(0.66970316730947),
- FRAC_CONST(0.67176824015260),
- FRAC_CONST(0.67382864013196),
- FRAC_CONST(0.67588431676768),
- FRAC_CONST(0.67793521989751),
- FRAC_CONST(0.67998129968017),
- FRAC_CONST(0.68202250659876),
- FRAC_CONST(0.68405879146403),
- FRAC_CONST(0.68609010541774),
- FRAC_CONST(0.68811639993588),
- FRAC_CONST(0.69013762683195),
- FRAC_CONST(0.69215373826012),
- FRAC_CONST(0.69416468671849),
- FRAC_CONST(0.69617042505214),
- FRAC_CONST(0.69817090645634),
- FRAC_CONST(0.70016608447958),
- FRAC_CONST(0.70215591302664),
- FRAC_CONST(0.70414034636163),
- FRAC_CONST(0.70611933911096),
- FRAC_CONST(0.70809284626630),
- FRAC_CONST(0.71006082318751),
- FRAC_CONST(0.71202322560554),
- FRAC_CONST(0.71398000962530),
- FRAC_CONST(0.71593113172842),
- FRAC_CONST(0.71787654877613),
- FRAC_CONST(0.71981621801195),
- FRAC_CONST(0.72175009706445),
- FRAC_CONST(0.72367814394990),
- FRAC_CONST(0.72560031707496),
- FRAC_CONST(0.72751657523927),
- FRAC_CONST(0.72942687763803),
- FRAC_CONST(0.73133118386457),
- FRAC_CONST(0.73322945391280),
- FRAC_CONST(0.73512164817975),
- FRAC_CONST(0.73700772746796),
- FRAC_CONST(0.73888765298787),
- FRAC_CONST(0.74076138636020),
- FRAC_CONST(0.74262888961827),
- FRAC_CONST(0.74449012521027),
- FRAC_CONST(0.74634505600152),
- FRAC_CONST(0.74819364527663),
- FRAC_CONST(0.75003585674175),
- FRAC_CONST(0.75187165452661),
- FRAC_CONST(0.75370100318668),
- FRAC_CONST(0.75552386770515),
- FRAC_CONST(0.75734021349500),
- FRAC_CONST(0.75915000640095),
- FRAC_CONST(0.76095321270137),
- FRAC_CONST(0.76274979911019),
- FRAC_CONST(0.76453973277875),
- FRAC_CONST(0.76632298129757),
- FRAC_CONST(0.76809951269819),
- FRAC_CONST(0.76986929545481),
- FRAC_CONST(0.77163229848604),
- FRAC_CONST(0.77338849115651),
- FRAC_CONST(0.77513784327849),
- FRAC_CONST(0.77688032511340),
- FRAC_CONST(0.77861590737340),
- FRAC_CONST(0.78034456122283),
- FRAC_CONST(0.78206625827961),
- FRAC_CONST(0.78378097061667),
- FRAC_CONST(0.78548867076330),
- FRAC_CONST(0.78718933170643),
- FRAC_CONST(0.78888292689189),
- FRAC_CONST(0.79056943022564),
- FRAC_CONST(0.79224881607494),
- FRAC_CONST(0.79392105926949),
- FRAC_CONST(0.79558613510249),
- FRAC_CONST(0.79724401933170),
- FRAC_CONST(0.79889468818046),
- FRAC_CONST(0.80053811833858),
- FRAC_CONST(0.80217428696334),
- FRAC_CONST(0.80380317168028),
- FRAC_CONST(0.80542475058405),
- FRAC_CONST(0.80703900223920),
- FRAC_CONST(0.80864590568089),
- FRAC_CONST(0.81024544041560),
- FRAC_CONST(0.81183758642175),
- FRAC_CONST(0.81342232415032),
- FRAC_CONST(0.81499963452540),
- FRAC_CONST(0.81656949894467),
- FRAC_CONST(0.81813189927991),
- FRAC_CONST(0.81968681787738),
- FRAC_CONST(0.82123423755821),
- FRAC_CONST(0.82277414161874),
- FRAC_CONST(0.82430651383076),
- FRAC_CONST(0.82583133844180),
- FRAC_CONST(0.82734860017528),
- FRAC_CONST(0.82885828423070),
- FRAC_CONST(0.83036037628369),
- FRAC_CONST(0.83185486248609),
- FRAC_CONST(0.83334172946597),
- FRAC_CONST(0.83482096432759),
- FRAC_CONST(0.83629255465130),
- FRAC_CONST(0.83775648849344),
- FRAC_CONST(0.83921275438615),
- FRAC_CONST(0.84066134133716),
- FRAC_CONST(0.84210223882952),
- FRAC_CONST(0.84353543682130),
- FRAC_CONST(0.84496092574524),
- FRAC_CONST(0.84637869650833),
- FRAC_CONST(0.84778874049138),
- FRAC_CONST(0.84919104954855),
- FRAC_CONST(0.85058561600677),
- FRAC_CONST(0.85197243266520),
- FRAC_CONST(0.85335149279457),
- FRAC_CONST(0.85472279013653),
- FRAC_CONST(0.85608631890295),
- FRAC_CONST(0.85744207377513),
- FRAC_CONST(0.85879004990298),
- FRAC_CONST(0.86013024290422),
- FRAC_CONST(0.86146264886346),
- FRAC_CONST(0.86278726433124),
- FRAC_CONST(0.86410408632306),
- FRAC_CONST(0.86541311231838),
- FRAC_CONST(0.86671434025950),
- FRAC_CONST(0.86800776855046),
- FRAC_CONST(0.86929339605590),
- FRAC_CONST(0.87057122209981),
- FRAC_CONST(0.87184124646433),
- FRAC_CONST(0.87310346938840),
- FRAC_CONST(0.87435789156650),
- FRAC_CONST(0.87560451414719),
- FRAC_CONST(0.87684333873173),
- FRAC_CONST(0.87807436737261),
- FRAC_CONST(0.87929760257204),
- FRAC_CONST(0.88051304728038),
- FRAC_CONST(0.88172070489456),
- FRAC_CONST(0.88292057925645),
- FRAC_CONST(0.88411267465117),
- FRAC_CONST(0.88529699580537),
- FRAC_CONST(0.88647354788545),
- FRAC_CONST(0.88764233649580),
- FRAC_CONST(0.88880336767692),
- FRAC_CONST(0.88995664790351),
- FRAC_CONST(0.89110218408260),
- FRAC_CONST(0.89223998355154),
- FRAC_CONST(0.89337005407600),
- FRAC_CONST(0.89449240384793),
- FRAC_CONST(0.89560704148345),
- FRAC_CONST(0.89671397602074),
- FRAC_CONST(0.89781321691786),
- FRAC_CONST(0.89890477405053),
- FRAC_CONST(0.89998865770993),
- FRAC_CONST(0.90106487860034),
- FRAC_CONST(0.90213344783689),
- FRAC_CONST(0.90319437694315),
- FRAC_CONST(0.90424767784873),
- FRAC_CONST(0.90529336288690),
- FRAC_CONST(0.90633144479201),
- FRAC_CONST(0.90736193669708),
- FRAC_CONST(0.90838485213119),
- FRAC_CONST(0.90940020501694),
- FRAC_CONST(0.91040800966776),
- FRAC_CONST(0.91140828078533),
- FRAC_CONST(0.91240103345685),
- FRAC_CONST(0.91338628315231),
- FRAC_CONST(0.91436404572173),
- FRAC_CONST(0.91533433739238),
- FRAC_CONST(0.91629717476594),
- FRAC_CONST(0.91725257481564),
- FRAC_CONST(0.91820055488334),
- FRAC_CONST(0.91914113267664),
- FRAC_CONST(0.92007432626589),
- FRAC_CONST(0.92100015408120),
- FRAC_CONST(0.92191863490944),
- FRAC_CONST(0.92282978789113),
- FRAC_CONST(0.92373363251740),
- FRAC_CONST(0.92463018862687),
- FRAC_CONST(0.92551947640245),
- FRAC_CONST(0.92640151636824),
- FRAC_CONST(0.92727632938624),
- FRAC_CONST(0.92814393665320),
- FRAC_CONST(0.92900435969727),
- FRAC_CONST(0.92985762037477),
- FRAC_CONST(0.93070374086684),
- FRAC_CONST(0.93154274367610),
- FRAC_CONST(0.93237465162328),
- FRAC_CONST(0.93319948784382),
- FRAC_CONST(0.93401727578443),
- FRAC_CONST(0.93482803919967),
- FRAC_CONST(0.93563180214841),
- FRAC_CONST(0.93642858899043),
- FRAC_CONST(0.93721842438279),
- FRAC_CONST(0.93800133327637),
- FRAC_CONST(0.93877734091223),
- FRAC_CONST(0.93954647281807),
- FRAC_CONST(0.94030875480458),
- FRAC_CONST(0.94106421296182),
- FRAC_CONST(0.94181287365556),
- FRAC_CONST(0.94255476352362),
- FRAC_CONST(0.94328990947213),
- FRAC_CONST(0.94401833867184),
- FRAC_CONST(0.94474007855439),
- FRAC_CONST(0.94545515680855),
- FRAC_CONST(0.94616360137644),
- FRAC_CONST(0.94686544044975),
- FRAC_CONST(0.94756070246592),
- FRAC_CONST(0.94824941610434),
- FRAC_CONST(0.94893161028248),
- FRAC_CONST(0.94960731415209),
- FRAC_CONST(0.95027655709525),
- FRAC_CONST(0.95093936872056),
- FRAC_CONST(0.95159577885924),
- FRAC_CONST(0.95224581756115),
- FRAC_CONST(0.95288951509097),
- FRAC_CONST(0.95352690192417),
- FRAC_CONST(0.95415800874314),
- FRAC_CONST(0.95478286643320),
- FRAC_CONST(0.95540150607863),
- FRAC_CONST(0.95601395895871),
- FRAC_CONST(0.95662025654373),
- FRAC_CONST(0.95722043049100),
- FRAC_CONST(0.95781451264084),
- FRAC_CONST(0.95840253501260),
- FRAC_CONST(0.95898452980058),
- FRAC_CONST(0.95956052937008),
- FRAC_CONST(0.96013056625336),
- FRAC_CONST(0.96069467314557),
- FRAC_CONST(0.96125288290073),
- FRAC_CONST(0.96180522852773),
- FRAC_CONST(0.96235174318622),
- FRAC_CONST(0.96289246018262),
- FRAC_CONST(0.96342741296604),
- FRAC_CONST(0.96395663512424),
- FRAC_CONST(0.96448016037959),
- FRAC_CONST(0.96499802258499),
- FRAC_CONST(0.96551025571985),
- FRAC_CONST(0.96601689388602),
- FRAC_CONST(0.96651797130376),
- FRAC_CONST(0.96701352230768),
- FRAC_CONST(0.96750358134269),
- FRAC_CONST(0.96798818295998),
- FRAC_CONST(0.96846736181297),
- FRAC_CONST(0.96894115265327),
- FRAC_CONST(0.96940959032667),
- FRAC_CONST(0.96987270976912),
- FRAC_CONST(0.97033054600270),
- FRAC_CONST(0.97078313413161),
- FRAC_CONST(0.97123050933818),
- FRAC_CONST(0.97167270687887),
- FRAC_CONST(0.97210976208030),
- FRAC_CONST(0.97254171033525),
- FRAC_CONST(0.97296858709871),
- FRAC_CONST(0.97339042788392),
- FRAC_CONST(0.97380726825843),
- FRAC_CONST(0.97421914384017),
- FRAC_CONST(0.97462609029350),
- FRAC_CONST(0.97502814332534),
- FRAC_CONST(0.97542533868127),
- FRAC_CONST(0.97581771214160),
- FRAC_CONST(0.97620529951759),
- FRAC_CONST(0.97658813664749),
- FRAC_CONST(0.97696625939282),
- FRAC_CONST(0.97733970363445),
- FRAC_CONST(0.97770850526884),
- FRAC_CONST(0.97807270020427),
- FRAC_CONST(0.97843232435704),
- FRAC_CONST(0.97878741364771),
- FRAC_CONST(0.97913800399743),
- FRAC_CONST(0.97948413132414),
- FRAC_CONST(0.97982583153895),
- FRAC_CONST(0.98016314054243),
- FRAC_CONST(0.98049609422096),
- FRAC_CONST(0.98082472844313),
- FRAC_CONST(0.98114907905608),
- FRAC_CONST(0.98146918188197),
- FRAC_CONST(0.98178507271438),
- FRAC_CONST(0.98209678731477),
- FRAC_CONST(0.98240436140902),
- FRAC_CONST(0.98270783068385),
- FRAC_CONST(0.98300723078342),
- FRAC_CONST(0.98330259730589),
- FRAC_CONST(0.98359396579995),
- FRAC_CONST(0.98388137176152),
- FRAC_CONST(0.98416485063031),
- FRAC_CONST(0.98444443778651),
- FRAC_CONST(0.98472016854752),
- FRAC_CONST(0.98499207816463),
- FRAC_CONST(0.98526020181980),
- FRAC_CONST(0.98552457462240),
- FRAC_CONST(0.98578523160609),
- FRAC_CONST(0.98604220772560),
- FRAC_CONST(0.98629553785362),
- FRAC_CONST(0.98654525677772),
- FRAC_CONST(0.98679139919726),
- FRAC_CONST(0.98703399972035),
- FRAC_CONST(0.98727309286089),
- FRAC_CONST(0.98750871303556),
- FRAC_CONST(0.98774089456089),
- FRAC_CONST(0.98796967165036),
- FRAC_CONST(0.98819507841154),
- FRAC_CONST(0.98841714884323),
- FRAC_CONST(0.98863591683269),
- FRAC_CONST(0.98885141615285),
- FRAC_CONST(0.98906368045957),
- FRAC_CONST(0.98927274328896),
- FRAC_CONST(0.98947863805473),
- FRAC_CONST(0.98968139804554),
- FRAC_CONST(0.98988105642241),
- FRAC_CONST(0.99007764621618),
- FRAC_CONST(0.99027120032501),
- FRAC_CONST(0.99046175151186),
- FRAC_CONST(0.99064933240208),
- FRAC_CONST(0.99083397548099),
- FRAC_CONST(0.99101571309153),
- FRAC_CONST(0.99119457743191),
- FRAC_CONST(0.99137060055337),
- FRAC_CONST(0.99154381435784),
- FRAC_CONST(0.99171425059582),
- FRAC_CONST(0.99188194086414),
- FRAC_CONST(0.99204691660388),
- FRAC_CONST(0.99220920909823),
- FRAC_CONST(0.99236884947045),
- FRAC_CONST(0.99252586868186),
- FRAC_CONST(0.99268029752989),
- FRAC_CONST(0.99283216664606),
- FRAC_CONST(0.99298150649419),
- FRAC_CONST(0.99312834736847),
- FRAC_CONST(0.99327271939167),
- FRAC_CONST(0.99341465251338),
- FRAC_CONST(0.99355417650825),
- FRAC_CONST(0.99369132097430),
- FRAC_CONST(0.99382611533130),
- FRAC_CONST(0.99395858881910),
- FRAC_CONST(0.99408877049612),
- FRAC_CONST(0.99421668923778),
- FRAC_CONST(0.99434237373503),
- FRAC_CONST(0.99446585249289),
- FRAC_CONST(0.99458715382906),
- FRAC_CONST(0.99470630587254),
- FRAC_CONST(0.99482333656229),
- FRAC_CONST(0.99493827364600),
- FRAC_CONST(0.99505114467878),
- FRAC_CONST(0.99516197702200),
- FRAC_CONST(0.99527079784214),
- FRAC_CONST(0.99537763410962),
- FRAC_CONST(0.99548251259777),
- FRAC_CONST(0.99558545988178),
- FRAC_CONST(0.99568650233767),
- FRAC_CONST(0.99578566614138),
- FRAC_CONST(0.99588297726783),
- FRAC_CONST(0.99597846149005),
- FRAC_CONST(0.99607214437834),
- FRAC_CONST(0.99616405129947),
- FRAC_CONST(0.99625420741595),
- FRAC_CONST(0.99634263768527),
- FRAC_CONST(0.99642936685928),
- FRAC_CONST(0.99651441948352),
- FRAC_CONST(0.99659781989663),
- FRAC_CONST(0.99667959222978),
- FRAC_CONST(0.99675976040620),
- FRAC_CONST(0.99683834814063),
- FRAC_CONST(0.99691537893895),
- FRAC_CONST(0.99699087609774),
- FRAC_CONST(0.99706486270391),
- FRAC_CONST(0.99713736163442),
- FRAC_CONST(0.99720839555593),
- FRAC_CONST(0.99727798692461),
- FRAC_CONST(0.99734615798589),
- FRAC_CONST(0.99741293077431),
- FRAC_CONST(0.99747832711337),
- FRAC_CONST(0.99754236861541),
- FRAC_CONST(0.99760507668158),
- FRAC_CONST(0.99766647250181),
- FRAC_CONST(0.99772657705478),
- FRAC_CONST(0.99778541110799),
- FRAC_CONST(0.99784299521785),
- FRAC_CONST(0.99789934972976),
- FRAC_CONST(0.99795449477828),
- FRAC_CONST(0.99800845028730),
- FRAC_CONST(0.99806123597027),
- FRAC_CONST(0.99811287133042),
- FRAC_CONST(0.99816337566108),
- FRAC_CONST(0.99821276804596),
- FRAC_CONST(0.99826106735952),
- FRAC_CONST(0.99830829226732),
- FRAC_CONST(0.99835446122649),
- FRAC_CONST(0.99839959248609),
- FRAC_CONST(0.99844370408765),
- FRAC_CONST(0.99848681386566),
- FRAC_CONST(0.99852893944805),
- FRAC_CONST(0.99857009825685),
- FRAC_CONST(0.99861030750869),
- FRAC_CONST(0.99864958421549),
- FRAC_CONST(0.99868794518504),
- FRAC_CONST(0.99872540702178),
- FRAC_CONST(0.99876198612738),
- FRAC_CONST(0.99879769870160),
- FRAC_CONST(0.99883256074295),
- FRAC_CONST(0.99886658804953),
- FRAC_CONST(0.99889979621983),
- FRAC_CONST(0.99893220065356),
- FRAC_CONST(0.99896381655254),
- FRAC_CONST(0.99899465892154),
- FRAC_CONST(0.99902474256924),
- FRAC_CONST(0.99905408210916),
- FRAC_CONST(0.99908269196056),
- FRAC_CONST(0.99911058634952),
- FRAC_CONST(0.99913777930986),
- FRAC_CONST(0.99916428468421),
- FRAC_CONST(0.99919011612505),
- FRAC_CONST(0.99921528709576),
- FRAC_CONST(0.99923981087174),
- FRAC_CONST(0.99926370054150),
- FRAC_CONST(0.99928696900779),
- FRAC_CONST(0.99930962898876),
- FRAC_CONST(0.99933169301910),
- FRAC_CONST(0.99935317345126),
- FRAC_CONST(0.99937408245662),
- FRAC_CONST(0.99939443202674),
- FRAC_CONST(0.99941423397457),
- FRAC_CONST(0.99943349993572),
- FRAC_CONST(0.99945224136972),
- FRAC_CONST(0.99947046956130),
- FRAC_CONST(0.99948819562171),
- FRAC_CONST(0.99950543049000),
- FRAC_CONST(0.99952218493439),
- FRAC_CONST(0.99953846955355),
- FRAC_CONST(0.99955429477803),
- FRAC_CONST(0.99956967087154),
- FRAC_CONST(0.99958460793242),
- FRAC_CONST(0.99959911589494),
- FRAC_CONST(0.99961320453077),
- FRAC_CONST(0.99962688345035),
- FRAC_CONST(0.99964016210433),
- FRAC_CONST(0.99965304978499),
- FRAC_CONST(0.99966555562769),
- FRAC_CONST(0.99967768861231),
- FRAC_CONST(0.99968945756473),
- FRAC_CONST(0.99970087115825),
- FRAC_CONST(0.99971193791510),
- FRAC_CONST(0.99972266620792),
- FRAC_CONST(0.99973306426121),
- FRAC_CONST(0.99974314015288),
- FRAC_CONST(0.99975290181568),
- FRAC_CONST(0.99976235703876),
- FRAC_CONST(0.99977151346914),
- FRAC_CONST(0.99978037861326),
- FRAC_CONST(0.99978895983845),
- FRAC_CONST(0.99979726437448),
- FRAC_CONST(0.99980529931507),
- FRAC_CONST(0.99981307161943),
- FRAC_CONST(0.99982058811377),
- FRAC_CONST(0.99982785549283),
- FRAC_CONST(0.99983488032144),
- FRAC_CONST(0.99984166903600),
- FRAC_CONST(0.99984822794606),
- FRAC_CONST(0.99985456323584),
- FRAC_CONST(0.99986068096572),
- FRAC_CONST(0.99986658707386),
- FRAC_CONST(0.99987228737764),
- FRAC_CONST(0.99987778757524),
- FRAC_CONST(0.99988309324717),
- FRAC_CONST(0.99988820985777),
- FRAC_CONST(0.99989314275675),
- FRAC_CONST(0.99989789718072),
- FRAC_CONST(0.99990247825468),
- FRAC_CONST(0.99990689099357),
- FRAC_CONST(0.99991114030376),
- FRAC_CONST(0.99991523098456),
- FRAC_CONST(0.99991916772971),
- FRAC_CONST(0.99992295512891),
- FRAC_CONST(0.99992659766930),
- FRAC_CONST(0.99993009973692),
- FRAC_CONST(0.99993346561824),
- FRAC_CONST(0.99993669950161),
- FRAC_CONST(0.99993980547870),
- FRAC_CONST(0.99994278754604),
- FRAC_CONST(0.99994564960642),
- FRAC_CONST(0.99994839547033),
- FRAC_CONST(0.99995102885747),
- FRAC_CONST(0.99995355339809),
- FRAC_CONST(0.99995597263451),
- FRAC_CONST(0.99995829002249),
- FRAC_CONST(0.99996050893264),
- FRAC_CONST(0.99996263265183),
- FRAC_CONST(0.99996466438460),
- FRAC_CONST(0.99996660725452),
- FRAC_CONST(0.99996846430558),
- FRAC_CONST(0.99997023850356),
- FRAC_CONST(0.99997193273736),
- FRAC_CONST(0.99997354982037),
- FRAC_CONST(0.99997509249183),
- FRAC_CONST(0.99997656341810),
- FRAC_CONST(0.99997796519400),
- FRAC_CONST(0.99997930034415),
- FRAC_CONST(0.99998057132421),
- FRAC_CONST(0.99998178052220),
- FRAC_CONST(0.99998293025975),
- FRAC_CONST(0.99998402279338),
- FRAC_CONST(0.99998506031574),
- FRAC_CONST(0.99998604495686),
- FRAC_CONST(0.99998697878536),
- FRAC_CONST(0.99998786380966),
- FRAC_CONST(0.99998870197921),
- FRAC_CONST(0.99998949518567),
- FRAC_CONST(0.99999024526408),
- FRAC_CONST(0.99999095399401),
- FRAC_CONST(0.99999162310077),
- FRAC_CONST(0.99999225425649),
- FRAC_CONST(0.99999284908128),
- FRAC_CONST(0.99999340914435),
- FRAC_CONST(0.99999393596510),
- FRAC_CONST(0.99999443101421),
- FRAC_CONST(0.99999489571473),
- FRAC_CONST(0.99999533144314),
- FRAC_CONST(0.99999573953040),
- FRAC_CONST(0.99999612126300),
- FRAC_CONST(0.99999647788395),
- FRAC_CONST(0.99999681059383),
- FRAC_CONST(0.99999712055178),
- FRAC_CONST(0.99999740887647),
- FRAC_CONST(0.99999767664709),
- FRAC_CONST(0.99999792490431),
- FRAC_CONST(0.99999815465123),
- FRAC_CONST(0.99999836685427),
- FRAC_CONST(0.99999856244415),
- FRAC_CONST(0.99999874231676),
- FRAC_CONST(0.99999890733405),
- FRAC_CONST(0.99999905832493),
- FRAC_CONST(0.99999919608613),
- FRAC_CONST(0.99999932138304),
- FRAC_CONST(0.99999943495056),
- FRAC_CONST(0.99999953749392),
- FRAC_CONST(0.99999962968950),
- FRAC_CONST(0.99999971218563),
- FRAC_CONST(0.99999978560337),
- FRAC_CONST(0.99999985053727),
- FRAC_CONST(0.99999990755616),
- FRAC_CONST(0.99999995720387)
-};
-
-#ifdef ALLOW_SMALL_FRAMELENGTH
-ALIGN static const real_t kbd_long_960[] = {
- FRAC_CONST(0.0003021562530949),
- FRAC_CONST(0.0004452267024786),
- FRAC_CONST(0.0005674947527496),
- FRAC_CONST(0.0006812465553466),
- FRAC_CONST(0.0007910496776387),
- FRAC_CONST(0.0008991655033895),
- FRAC_CONST(0.0010068978259384),
- FRAC_CONST(0.0011150758515751),
- FRAC_CONST(0.0012242653193642),
- FRAC_CONST(0.0013348735658205),
- FRAC_CONST(0.0014472068670273),
- FRAC_CONST(0.0015615039850448),
- FRAC_CONST(0.0016779568885263),
- FRAC_CONST(0.0017967241232412),
- FRAC_CONST(0.0019179397560955),
- FRAC_CONST(0.0020417195415393),
- FRAC_CONST(0.0021681652836642),
- FRAC_CONST(0.0022973679910599),
- FRAC_CONST(0.0024294102029937),
- FRAC_CONST(0.0025643677339078),
- FRAC_CONST(0.0027023110014772),
- FRAC_CONST(0.0028433060512612),
- FRAC_CONST(0.0029874153568025),
- FRAC_CONST(0.0031346984511728),
- FRAC_CONST(0.0032852124303662),
- FRAC_CONST(0.0034390123581190),
- FRAC_CONST(0.0035961515940931),
- FRAC_CONST(0.0037566820618961),
- FRAC_CONST(0.0039206544694386),
- FRAC_CONST(0.0040881184912194),
- FRAC_CONST(0.0042591229199617),
- FRAC_CONST(0.0044337157933972),
- FRAC_CONST(0.0046119445007641),
- FRAC_CONST(0.0047938558726415),
- FRAC_CONST(0.0049794962570131),
- FRAC_CONST(0.0051689115838900),
- FRAC_CONST(0.0053621474203763),
- FRAC_CONST(0.0055592490177131),
- FRAC_CONST(0.0057602613515573),
- FRAC_CONST(0.0059652291565289),
- FRAC_CONST(0.0061741969558843),
- FRAC_CONST(0.0063872090870253),
- FRAC_CONST(0.0066043097234387),
- FRAC_CONST(0.0068255428935640),
- FRAC_CONST(0.0070509524970088),
- FRAC_CONST(0.0072805823184660),
- FRAC_CONST(0.0075144760396340),
- FRAC_CONST(0.0077526772493942),
- FRAC_CONST(0.0079952294524673),
- FRAC_CONST(0.0082421760767325),
- FRAC_CONST(0.0084935604793733),
- FRAC_CONST(0.0087494259519870),
- FRAC_CONST(0.0090098157247792),
- FRAC_CONST(0.0092747729699467),
- FRAC_CONST(0.0095443408043399),
- FRAC_CONST(0.0098185622914832),
- FRAC_CONST(0.0100974804430226),
- FRAC_CONST(0.0103811382196612),
- FRAC_CONST(0.0106695785316351),
- FRAC_CONST(0.0109628442387771),
- FRAC_CONST(0.0112609781502091),
- FRAC_CONST(0.0115640230236993),
- FRAC_CONST(0.0118720215647169),
- FRAC_CONST(0.0121850164252137),
- FRAC_CONST(0.0125030502021561),
- FRAC_CONST(0.0128261654358321),
- FRAC_CONST(0.0131544046079532),
- FRAC_CONST(0.0134878101395681),
- FRAC_CONST(0.0138264243888068),
- FRAC_CONST(0.0141702896484671),
- FRAC_CONST(0.0145194481434592),
- FRAC_CONST(0.0148739420281182),
- FRAC_CONST(0.0152338133833959),
- FRAC_CONST(0.0155991042139432),
- FRAC_CONST(0.0159698564450882),
- FRAC_CONST(0.0163461119197227),
- FRAC_CONST(0.0167279123950996),
- FRAC_CONST(0.0171152995395520),
- FRAC_CONST(0.0175083149291368),
- FRAC_CONST(0.0179070000442104),
- FRAC_CONST(0.0183113962659409),
- FRAC_CONST(0.0187215448727609),
- FRAC_CONST(0.0191374870367659),
- FRAC_CONST(0.0195592638200623),
- FRAC_CONST(0.0199869161710679),
- FRAC_CONST(0.0204204849207691),
- FRAC_CONST(0.0208600107789370),
- FRAC_CONST(0.0213055343303066),
- FRAC_CONST(0.0217570960307201),
- FRAC_CONST(0.0222147362032386),
- FRAC_CONST(0.0226784950342228),
- FRAC_CONST(0.0231484125693867),
- FRAC_CONST(0.0236245287098244),
- FRAC_CONST(0.0241068832080138),
- FRAC_CONST(0.0245955156637973),
- FRAC_CONST(0.0250904655203431),
- FRAC_CONST(0.0255917720600868),
- FRAC_CONST(0.0260994744006559),
- FRAC_CONST(0.0266136114907790),
- FRAC_CONST(0.0271342221061795),
- FRAC_CONST(0.0276613448454576),
- FRAC_CONST(0.0281950181259587),
- FRAC_CONST(0.0287352801796329),
- FRAC_CONST(0.0292821690488833),
- FRAC_CONST(0.0298357225824074),
- FRAC_CONST(0.0303959784310299),
- FRAC_CONST(0.0309629740435296),
- FRAC_CONST(0.0315367466624615),
- FRAC_CONST(0.0321173333199732),
- FRAC_CONST(0.0327047708336193),
- FRAC_CONST(0.0332990958021720),
- FRAC_CONST(0.0339003446014307),
- FRAC_CONST(0.0345085533800302),
- FRAC_CONST(0.0351237580552491),
- FRAC_CONST(0.0357459943088193),
- FRAC_CONST(0.0363752975827358),
- FRAC_CONST(0.0370117030750704),
- FRAC_CONST(0.0376552457357870),
- FRAC_CONST(0.0383059602625614),
- FRAC_CONST(0.0389638810966056),
- FRAC_CONST(0.0396290424184964),
- FRAC_CONST(0.0403014781440112),
- FRAC_CONST(0.0409812219199691),
- FRAC_CONST(0.0416683071200799),
- FRAC_CONST(0.0423627668408009),
- FRAC_CONST(0.0430646338972016),
- FRAC_CONST(0.0437739408188385),
- FRAC_CONST(0.0444907198456388),
- FRAC_CONST(0.0452150029237951),
- FRAC_CONST(0.0459468217016708),
- FRAC_CONST(0.0466862075257170),
- FRAC_CONST(0.0474331914364021),
- FRAC_CONST(0.0481878041641539),
- FRAC_CONST(0.0489500761253148),
- FRAC_CONST(0.0497200374181119),
- FRAC_CONST(0.0504977178186404),
- FRAC_CONST(0.0512831467768636),
- FRAC_CONST(0.0520763534126273),
- FRAC_CONST(0.0528773665116913),
- FRAC_CONST(0.0536862145217772),
- FRAC_CONST(0.0545029255486345),
- FRAC_CONST(0.0553275273521232),
- FRAC_CONST(0.0561600473423164),
- FRAC_CONST(0.0570005125756209),
- FRAC_CONST(0.0578489497509179),
- FRAC_CONST(0.0587053852057233),
- FRAC_CONST(0.0595698449123695),
- FRAC_CONST(0.0604423544742077),
- FRAC_CONST(0.0613229391218317),
- FRAC_CONST(0.0622116237093247),
- FRAC_CONST(0.0631084327105284),
- FRAC_CONST(0.0640133902153352),
- FRAC_CONST(0.0649265199260043),
- FRAC_CONST(0.0658478451535027),
- FRAC_CONST(0.0667773888138695),
- FRAC_CONST(0.0677151734246072),
- FRAC_CONST(0.0686612211010977),
- FRAC_CONST(0.0696155535530446),
- FRAC_CONST(0.0705781920809429),
- FRAC_CONST(0.0715491575725758),
- FRAC_CONST(0.0725284704995383),
- FRAC_CONST(0.0735161509137906),
- FRAC_CONST(0.0745122184442388),
- FRAC_CONST(0.0755166922933461),
- FRAC_CONST(0.0765295912337720),
- FRAC_CONST(0.0775509336050437),
- FRAC_CONST(0.0785807373102561),
- FRAC_CONST(0.0796190198128044),
- FRAC_CONST(0.0806657981331473),
- FRAC_CONST(0.0817210888456026),
- FRAC_CONST(0.0827849080751753),
- FRAC_CONST(0.0838572714944183),
- FRAC_CONST(0.0849381943203265),
- FRAC_CONST(0.0860276913112652),
- FRAC_CONST(0.0871257767639319),
- FRAC_CONST(0.0882324645103534),
- FRAC_CONST(0.0893477679149177),
- FRAC_CONST(0.0904716998714418),
- FRAC_CONST(0.0916042728002747),
- FRAC_CONST(0.0927454986454381),
- FRAC_CONST(0.0938953888718020),
- FRAC_CONST(0.0950539544622996),
- FRAC_CONST(0.0962212059151784),
- FRAC_CONST(0.0973971532412897),
- FRAC_CONST(0.0985818059614169),
- FRAC_CONST(0.0997751731036425),
- FRAC_CONST(0.1009772632007537),
- FRAC_CONST(0.1021880842876888),
- FRAC_CONST(0.1034076438990227),
- FRAC_CONST(0.1046359490664932),
- FRAC_CONST(0.1058730063165681),
- FRAC_CONST(0.1071188216680533),
- FRAC_CONST(0.1083734006297428),
- FRAC_CONST(0.1096367481981100),
- FRAC_CONST(0.1109088688550422),
- FRAC_CONST(0.1121897665656167),
- FRAC_CONST(0.1134794447759207),
- FRAC_CONST(0.1147779064109143),
- FRAC_CONST(0.1160851538723372),
- FRAC_CONST(0.1174011890366591),
- FRAC_CONST(0.1187260132530751),
- FRAC_CONST(0.1200596273415457),
- FRAC_CONST(0.1214020315908810),
- FRAC_CONST(0.1227532257568719),
- FRAC_CONST(0.1241132090604651),
- FRAC_CONST(0.1254819801859856),
- FRAC_CONST(0.1268595372794049),
- FRAC_CONST(0.1282458779466558),
- FRAC_CONST(0.1296409992519942),
- FRAC_CONST(0.1310448977164081),
- FRAC_CONST(0.1324575693160745),
- FRAC_CONST(0.1338790094808633),
- FRAC_CONST(0.1353092130928902),
- FRAC_CONST(0.1367481744851168),
- FRAC_CONST(0.1381958874400010),
- FRAC_CONST(0.1396523451881945),
- FRAC_CONST(0.1411175404072910),
- FRAC_CONST(0.1425914652206223),
- FRAC_CONST(0.1440741111961058),
- FRAC_CONST(0.1455654693451402),
- FRAC_CONST(0.1470655301215526),
- FRAC_CONST(0.1485742834205956),
- FRAC_CONST(0.1500917185779945),
- FRAC_CONST(0.1516178243690463),
- FRAC_CONST(0.1531525890077689),
- FRAC_CONST(0.1546960001461024),
- FRAC_CONST(0.1562480448731608),
- FRAC_CONST(0.1578087097145364),
- FRAC_CONST(0.1593779806316558),
- FRAC_CONST(0.1609558430211876),
- FRAC_CONST(0.1625422817145027),
- FRAC_CONST(0.1641372809771871),
- FRAC_CONST(0.1657408245086070),
- FRAC_CONST(0.1673528954415270),
- FRAC_CONST(0.1689734763417811),
- FRAC_CONST(0.1706025492079969),
- FRAC_CONST(0.1722400954713725),
- FRAC_CONST(0.1738860959955082),
- FRAC_CONST(0.1755405310762898),
- FRAC_CONST(0.1772033804418275),
- FRAC_CONST(0.1788746232524467),
- FRAC_CONST(0.1805542381007349),
- FRAC_CONST(0.1822422030116404),
- FRAC_CONST(0.1839384954426268),
- FRAC_CONST(0.1856430922838810),
- FRAC_CONST(0.1873559698585756),
- FRAC_CONST(0.1890771039231862),
- FRAC_CONST(0.1908064696678625),
- FRAC_CONST(0.1925440417168546),
- FRAC_CONST(0.1942897941289937),
- FRAC_CONST(0.1960437003982277),
- FRAC_CONST(0.1978057334542116),
- FRAC_CONST(0.1995758656629525),
- FRAC_CONST(0.2013540688275098),
- FRAC_CONST(0.2031403141887507),
- FRAC_CONST(0.2049345724261595),
- FRAC_CONST(0.2067368136587033),
- FRAC_CONST(0.2085470074457521),
- FRAC_CONST(0.2103651227880538),
- FRAC_CONST(0.2121911281287646),
- FRAC_CONST(0.2140249913545346),
- FRAC_CONST(0.2158666797966480),
- FRAC_CONST(0.2177161602322188),
- FRAC_CONST(0.2195733988854414),
- FRAC_CONST(0.2214383614288963),
- FRAC_CONST(0.2233110129849106),
- FRAC_CONST(0.2251913181269740),
- FRAC_CONST(0.2270792408812093),
- FRAC_CONST(0.2289747447278976),
- FRAC_CONST(0.2308777926030592),
- FRAC_CONST(0.2327883469000885),
- FRAC_CONST(0.2347063694714437),
- FRAC_CONST(0.2366318216303919),
- FRAC_CONST(0.2385646641528076),
- FRAC_CONST(0.2405048572790267),
- FRAC_CONST(0.2424523607157545),
- FRAC_CONST(0.2444071336380283),
- FRAC_CONST(0.2463691346912334),
- FRAC_CONST(0.2483383219931741),
- FRAC_CONST(0.2503146531361985),
- FRAC_CONST(0.2522980851893767),
- FRAC_CONST(0.2542885747007335),
- FRAC_CONST(0.2562860776995335),
- FRAC_CONST(0.2582905496986215),
- FRAC_CONST(0.2603019456968142),
- FRAC_CONST(0.2623202201813464),
- FRAC_CONST(0.2643453271303700),
- FRAC_CONST(0.2663772200155053),
- FRAC_CONST(0.2684158518044454),
- FRAC_CONST(0.2704611749636135),
- FRAC_CONST(0.2725131414608710),
- FRAC_CONST(0.2745717027682799),
- FRAC_CONST(0.2766368098649151),
- FRAC_CONST(0.2787084132397296),
- FRAC_CONST(0.2807864628944707),
- FRAC_CONST(0.2828709083466482),
- FRAC_CONST(0.2849616986325523),
- FRAC_CONST(0.2870587823103237),
- FRAC_CONST(0.2891621074630737),
- FRAC_CONST(0.2912716217020546),
- FRAC_CONST(0.2933872721698803),
- FRAC_CONST(0.2955090055437973),
- FRAC_CONST(0.2976367680390041),
- FRAC_CONST(0.2997705054120213),
- FRAC_CONST(0.3019101629641097),
- FRAC_CONST(0.3040556855447379),
- FRAC_CONST(0.3062070175550981),
- FRAC_CONST(0.3083641029516701),
- FRAC_CONST(0.3105268852498334),
- FRAC_CONST(0.3126953075275265),
- FRAC_CONST(0.3148693124289546),
- FRAC_CONST(0.3170488421683428),
- FRAC_CONST(0.3192338385337370),
- FRAC_CONST(0.3214242428908514),
- FRAC_CONST(0.3236199961869606),
- FRAC_CONST(0.3258210389548392),
- FRAC_CONST(0.3280273113167459),
- FRAC_CONST(0.3302387529884521),
- FRAC_CONST(0.3324553032833160),
- FRAC_CONST(0.3346769011164010),
- FRAC_CONST(0.3369034850086373),
- FRAC_CONST(0.3391349930910280),
- FRAC_CONST(0.3413713631088974),
- FRAC_CONST(0.3436125324261830),
- FRAC_CONST(0.3458584380297697),
- FRAC_CONST(0.3481090165338656),
- FRAC_CONST(0.3503642041844199),
- FRAC_CONST(0.3526239368635820),
- FRAC_CONST(0.3548881500942010),
- FRAC_CONST(0.3571567790443668),
- FRAC_CONST(0.3594297585319891),
- FRAC_CONST(0.3617070230294185),
- FRAC_CONST(0.3639885066681048),
- FRAC_CONST(0.3662741432432950),
- FRAC_CONST(0.3685638662187693),
- FRAC_CONST(0.3708576087316147),
- FRAC_CONST(0.3731553035970366),
- FRAC_CONST(0.3754568833132069),
- FRAC_CONST(0.3777622800661488),
- FRAC_CONST(0.3800714257346570),
- FRAC_CONST(0.3823842518952546),
- FRAC_CONST(0.3847006898271841),
- FRAC_CONST(0.3870206705174334),
- FRAC_CONST(0.3893441246657958),
- FRAC_CONST(0.3916709826899639),
- FRAC_CONST(0.3940011747306560),
- FRAC_CONST(0.3963346306567764),
- FRAC_CONST(0.3986712800706062),
- FRAC_CONST(0.4010110523130271),
- FRAC_CONST(0.4033538764687756),
- FRAC_CONST(0.4056996813717284),
- FRAC_CONST(0.4080483956102172),
- FRAC_CONST(0.4103999475323736),
- FRAC_CONST(0.4127542652515031),
- FRAC_CONST(0.4151112766514873),
- FRAC_CONST(0.4174709093922143),
- FRAC_CONST(0.4198330909150365),
- FRAC_CONST(0.4221977484482556),
- FRAC_CONST(0.4245648090126334),
- FRAC_CONST(0.4269341994269293),
- FRAC_CONST(0.4293058463134616),
- FRAC_CONST(0.4316796761036958),
- FRAC_CONST(0.4340556150438547),
- FRAC_CONST(0.4364335892005536),
- FRAC_CONST(0.4388135244664580),
- FRAC_CONST(0.4411953465659639),
- FRAC_CONST(0.4435789810609000),
- FRAC_CONST(0.4459643533562509),
- FRAC_CONST(0.4483513887059016),
- FRAC_CONST(0.4507400122184019),
- FRAC_CONST(0.4531301488627497),
- FRAC_CONST(0.4555217234741947),
- FRAC_CONST(0.4579146607600593),
- FRAC_CONST(0.4603088853055777),
- FRAC_CONST(0.4627043215797521),
- FRAC_CONST(0.4651008939412254),
- FRAC_CONST(0.4674985266441709),
- FRAC_CONST(0.4698971438441951),
- FRAC_CONST(0.4722966696042580),
- FRAC_CONST(0.4746970279006055),
- FRAC_CONST(0.4770981426287164),
- FRAC_CONST(0.4794999376092619),
- FRAC_CONST(0.4819023365940778),
- FRAC_CONST(0.4843052632721476),
- FRAC_CONST(0.4867086412755978),
- FRAC_CONST(0.4891123941857028),
- FRAC_CONST(0.4915164455388997),
- FRAC_CONST(0.4939207188328126),
- FRAC_CONST(0.4963251375322855),
- FRAC_CONST(0.4987296250754225),
- FRAC_CONST(0.5011341048796359),
- FRAC_CONST(0.5035385003477012),
- FRAC_CONST(0.5059427348738168),
- FRAC_CONST(0.5083467318496706),
- FRAC_CONST(0.5107504146705106),
- FRAC_CONST(0.5131537067412193),
- FRAC_CONST(0.5155565314823923),
- FRAC_CONST(0.5179588123364193),
- FRAC_CONST(0.5203604727735667),
- FRAC_CONST(0.5227614362980630),
- FRAC_CONST(0.5251616264541841),
- FRAC_CONST(0.5275609668323384),
- FRAC_CONST(0.5299593810751532),
- FRAC_CONST(0.5323567928835578),
- FRAC_CONST(0.5347531260228663),
- FRAC_CONST(0.5371483043288580),
- FRAC_CONST(0.5395422517138538),
- FRAC_CONST(0.5419348921727899),
- FRAC_CONST(0.5443261497892862),
- FRAC_CONST(0.5467159487417104),
- FRAC_CONST(0.5491042133092364),
- FRAC_CONST(0.5514908678778958),
- FRAC_CONST(0.5538758369466227),
- FRAC_CONST(0.5562590451332913),
- FRAC_CONST(0.5586404171807443),
- FRAC_CONST(0.5610198779628133),
- FRAC_CONST(0.5633973524903286),
- FRAC_CONST(0.5657727659171199),
- FRAC_CONST(0.5681460435460047),
- FRAC_CONST(0.5705171108347663),
- FRAC_CONST(0.5728858934021188),
- FRAC_CONST(0.5752523170336598),
- FRAC_CONST(0.5776163076878088),
- FRAC_CONST(0.5799777915017323),
- FRAC_CONST(0.5823366947972535),
- FRAC_CONST(0.5846929440867458),
- FRAC_CONST(0.5870464660790119),
- FRAC_CONST(0.5893971876851449),
- FRAC_CONST(0.5917450360243719),
- FRAC_CONST(0.5940899384298793),
- FRAC_CONST(0.5964318224546208),
- FRAC_CONST(0.5987706158771039),
- FRAC_CONST(0.6011062467071583),
- FRAC_CONST(0.6034386431916822),
- FRAC_CONST(0.6057677338203681),
- FRAC_CONST(0.6080934473314057),
- FRAC_CONST(0.6104157127171639),
- FRAC_CONST(0.6127344592298474),
- FRAC_CONST(0.6150496163871310),
- FRAC_CONST(0.6173611139777690),
- FRAC_CONST(0.6196688820671789),
- FRAC_CONST(0.6219728510029997),
- FRAC_CONST(0.6242729514206247),
- FRAC_CONST(0.6265691142487051),
- FRAC_CONST(0.6288612707146283),
- FRAC_CONST(0.6311493523499663),
- FRAC_CONST(0.6334332909958958),
- FRAC_CONST(0.6357130188085891),
- FRAC_CONST(0.6379884682645743),
- FRAC_CONST(0.6402595721660647),
- FRAC_CONST(0.6425262636462578),
- FRAC_CONST(0.6447884761746012),
- FRAC_CONST(0.6470461435620266),
- FRAC_CONST(0.6492991999661505),
- FRAC_CONST(0.6515475798964411),
- FRAC_CONST(0.6537912182193508),
- FRAC_CONST(0.6560300501634142),
- FRAC_CONST(0.6582640113243098),
- FRAC_CONST(0.6604930376698862),
- FRAC_CONST(0.6627170655451516),
- FRAC_CONST(0.6649360316772256),
- FRAC_CONST(0.6671498731802533),
- FRAC_CONST(0.6693585275602818),
- FRAC_CONST(0.6715619327200959),
- FRAC_CONST(0.6737600269640164),
- FRAC_CONST(0.6759527490026566),
- FRAC_CONST(0.6781400379576392),
- FRAC_CONST(0.6803218333662715),
- FRAC_CONST(0.6824980751861787),
- FRAC_CONST(0.6846687037998949),
- FRAC_CONST(0.6868336600194123),
- FRAC_CONST(0.6889928850906855),
- FRAC_CONST(0.6911463206980928),
- FRAC_CONST(0.6932939089688525),
- FRAC_CONST(0.6954355924773949),
- FRAC_CONST(0.6975713142496884),
- FRAC_CONST(0.6997010177675195),
- FRAC_CONST(0.7018246469727265),
- FRAC_CONST(0.7039421462713862),
- FRAC_CONST(0.7060534605379528),
- FRAC_CONST(0.7081585351193496),
- FRAC_CONST(0.7102573158390105),
- FRAC_CONST(0.7123497490008750),
- FRAC_CONST(0.7144357813933307),
- FRAC_CONST(0.7165153602931092),
- FRAC_CONST(0.7185884334691287),
- FRAC_CONST(0.7206549491862871),
- FRAC_CONST(0.7227148562092042),
- FRAC_CONST(0.7247681038059106),
- FRAC_CONST(0.7268146417514855),
- FRAC_CONST(0.7288544203316418),
- FRAC_CONST(0.7308873903462577),
- FRAC_CONST(0.7329135031128549),
- FRAC_CONST(0.7349327104700221),
- FRAC_CONST(0.7369449647807855),
- FRAC_CONST(0.7389502189359237),
- FRAC_CONST(0.7409484263572271),
- FRAC_CONST(0.7429395410007016),
- FRAC_CONST(0.7449235173597176),
- FRAC_CONST(0.7469003104681008),
- FRAC_CONST(0.7488698759031670),
- FRAC_CONST(0.7508321697887005),
- FRAC_CONST(0.7527871487978728),
- FRAC_CONST(0.7547347701561059),
- FRAC_CONST(0.7566749916438754),
- FRAC_CONST(0.7586077715994560),
- FRAC_CONST(0.7605330689216074),
- FRAC_CONST(0.7624508430722016),
- FRAC_CONST(0.7643610540787891),
- FRAC_CONST(0.7662636625371070),
- FRAC_CONST(0.7681586296135255),
- FRAC_CONST(0.7700459170474343),
- FRAC_CONST(0.7719254871535672),
- FRAC_CONST(0.7737973028242671),
- FRAC_CONST(0.7756613275316875),
- FRAC_CONST(0.7775175253299340),
- FRAC_CONST(0.7793658608571425),
- FRAC_CONST(0.7812062993374951),
- FRAC_CONST(0.7830388065831744),
- FRAC_CONST(0.7848633489962533),
- FRAC_CONST(0.7866798935705233),
- FRAC_CONST(0.7884884078932579),
- FRAC_CONST(0.7902888601469138),
- FRAC_CONST(0.7920812191107668),
- FRAC_CONST(0.7938654541624850),
- FRAC_CONST(0.7956415352796368),
- FRAC_CONST(0.7974094330411343),
- FRAC_CONST(0.7991691186286133),
- FRAC_CONST(0.8009205638277465),
- FRAC_CONST(0.8026637410294932),
- FRAC_CONST(0.8043986232312831),
- FRAC_CONST(0.8061251840381346),
- FRAC_CONST(0.8078433976637077),
- FRAC_CONST(0.8095532389312917),
- FRAC_CONST(0.8112546832747255),
- FRAC_CONST(0.8129477067392539),
- FRAC_CONST(0.8146322859823164),
- FRAC_CONST(0.8163083982742698),
- FRAC_CONST(0.8179760214990457),
- FRAC_CONST(0.8196351341547393),
- FRAC_CONST(0.8212857153541345),
- FRAC_CONST(0.8229277448251595),
- FRAC_CONST(0.8245612029112778),
- FRAC_CONST(0.8261860705718113),
- FRAC_CONST(0.8278023293821971),
- FRAC_CONST(0.8294099615341773),
- FRAC_CONST(0.8310089498359212),
- FRAC_CONST(0.8325992777120815),
- FRAC_CONST(0.8341809292037831),
- FRAC_CONST(0.8357538889685445),
- FRAC_CONST(0.8373181422801330),
- FRAC_CONST(0.8388736750283521),
- FRAC_CONST(0.8404204737187619),
- FRAC_CONST(0.8419585254723335),
- FRAC_CONST(0.8434878180250348),
- FRAC_CONST(0.8450083397273509),
- FRAC_CONST(0.8465200795437368),
- FRAC_CONST(0.8480230270520029),
- FRAC_CONST(0.8495171724426350),
- FRAC_CONST(0.8510025065180464),
- FRAC_CONST(0.8524790206917633),
- FRAC_CONST(0.8539467069875448),
- FRAC_CONST(0.8554055580384357),
- FRAC_CONST(0.8568555670857525),
- FRAC_CONST(0.8582967279780043),
- FRAC_CONST(0.8597290351697464),
- FRAC_CONST(0.8611524837203691),
- FRAC_CONST(0.8625670692928198),
- FRAC_CONST(0.8639727881522599),
- FRAC_CONST(0.8653696371646555),
- FRAC_CONST(0.8667576137953045),
- FRAC_CONST(0.8681367161072958),
- FRAC_CONST(0.8695069427599065),
- FRAC_CONST(0.8708682930069319),
- FRAC_CONST(0.8722207666949527),
- FRAC_CONST(0.8735643642615368),
- FRAC_CONST(0.8748990867333771),
- FRAC_CONST(0.8762249357243662),
- FRAC_CONST(0.8775419134336067),
- FRAC_CONST(0.8788500226433579),
- FRAC_CONST(0.8801492667169208),
- FRAC_CONST(0.8814396495964587),
- FRAC_CONST(0.8827211758007560),
- FRAC_CONST(0.8839938504229149),
- FRAC_CONST(0.8852576791279895),
- FRAC_CONST(0.8865126681505587),
- FRAC_CONST(0.8877588242922386),
- FRAC_CONST(0.8889961549191320),
- FRAC_CONST(0.8902246679592184),
- FRAC_CONST(0.8914443718996848),
- FRAC_CONST(0.8926552757841945),
- FRAC_CONST(0.8938573892100969),
- FRAC_CONST(0.8950507223255798),
- FRAC_CONST(0.8962352858267605),
- FRAC_CONST(0.8974110909547198),
- FRAC_CONST(0.8985781494924783),
- FRAC_CONST(0.8997364737619142),
- FRAC_CONST(0.9008860766206249),
- FRAC_CONST(0.9020269714587307),
- FRAC_CONST(0.9031591721956235),
- FRAC_CONST(0.9042826932766591),
- FRAC_CONST(0.9053975496697941),
- FRAC_CONST(0.9065037568621681),
- FRAC_CONST(0.9076013308566311),
- FRAC_CONST(0.9086902881682180),
- FRAC_CONST(0.9097706458205682),
- FRAC_CONST(0.9108424213422940),
- FRAC_CONST(0.9119056327632955),
- FRAC_CONST(0.9129602986110235),
- FRAC_CONST(0.9140064379066919),
- FRAC_CONST(0.9150440701614393),
- FRAC_CONST(0.9160732153724396),
- FRAC_CONST(0.9170938940189634),
- FRAC_CONST(0.9181061270583908),
- FRAC_CONST(0.9191099359221748),
- FRAC_CONST(0.9201053425117579),
- FRAC_CONST(0.9210923691944400),
- FRAC_CONST(0.9220710387992010),
- FRAC_CONST(0.9230413746124764),
- FRAC_CONST(0.9240034003738882),
- FRAC_CONST(0.9249571402719298),
- FRAC_CONST(0.9259026189396085),
- FRAC_CONST(0.9268398614500427),
- FRAC_CONST(0.9277688933120170),
- FRAC_CONST(0.9286897404654957),
- FRAC_CONST(0.9296024292770939),
- FRAC_CONST(0.9305069865355076),
- FRAC_CONST(0.9314034394469048),
- FRAC_CONST(0.9322918156302762),
- FRAC_CONST(0.9331721431127471),
- FRAC_CONST(0.9340444503248519),
- FRAC_CONST(0.9349087660957711),
- FRAC_CONST(0.9357651196485313),
- FRAC_CONST(0.9366135405951697),
- FRAC_CONST(0.9374540589318637),
- FRAC_CONST(0.9382867050340261),
- FRAC_CONST(0.9391115096513655),
- FRAC_CONST(0.9399285039029165),
- FRAC_CONST(0.9407377192720349),
- FRAC_CONST(0.9415391876013639),
- FRAC_CONST(0.9423329410877687),
- FRAC_CONST(0.9431190122772415),
- FRAC_CONST(0.9438974340597782),
- FRAC_CONST(0.9446682396642262),
- FRAC_CONST(0.9454314626531054),
- FRAC_CONST(0.9461871369174033),
- FRAC_CONST(0.9469352966713429),
- FRAC_CONST(0.9476759764471278),
- FRAC_CONST(0.9484092110896616),
- FRAC_CONST(0.9491350357512457),
- FRAC_CONST(0.9498534858862532),
- FRAC_CONST(0.9505645972457831),
- FRAC_CONST(0.9512684058722927),
- FRAC_CONST(0.9519649480942105),
- FRAC_CONST(0.9526542605205314),
- FRAC_CONST(0.9533363800353921),
- FRAC_CONST(0.9540113437926313),
- FRAC_CONST(0.9546791892103320),
- FRAC_CONST(0.9553399539653500),
- FRAC_CONST(0.9559936759878265),
- FRAC_CONST(0.9566403934556893),
- FRAC_CONST(0.9572801447891388),
- FRAC_CONST(0.9579129686451244),
- FRAC_CONST(0.9585389039118085),
- FRAC_CONST(0.9591579897030224),
- FRAC_CONST(0.9597702653527108),
- FRAC_CONST(0.9603757704093711),
- FRAC_CONST(0.9609745446304828),
- FRAC_CONST(0.9615666279769324),
- FRAC_CONST(0.9621520606074324),
- FRAC_CONST(0.9627308828729358),
- FRAC_CONST(0.9633031353110477),
- FRAC_CONST(0.9638688586404335),
- FRAC_CONST(0.9644280937552258),
- FRAC_CONST(0.9649808817194311),
- FRAC_CONST(0.9655272637613366),
- FRAC_CONST(0.9660672812679171),
- FRAC_CONST(0.9666009757792454),
- FRAC_CONST(0.9671283889829055),
- FRAC_CONST(0.9676495627084089),
- FRAC_CONST(0.9681645389216160),
- FRAC_CONST(0.9686733597191652),
- FRAC_CONST(0.9691760673229058),
- FRAC_CONST(0.9696727040743406),
- FRAC_CONST(0.9701633124290767),
- FRAC_CONST(0.9706479349512860),
- FRAC_CONST(0.9711266143081750),
- FRAC_CONST(0.9715993932644684),
- FRAC_CONST(0.9720663146769026),
- FRAC_CONST(0.9725274214887337),
- FRAC_CONST(0.9729827567242596),
- FRAC_CONST(0.9734323634833574),
- FRAC_CONST(0.9738762849360358),
- FRAC_CONST(0.9743145643170059),
- FRAC_CONST(0.9747472449202687),
- FRAC_CONST(0.9751743700937215),
- FRAC_CONST(0.9755959832337850),
- FRAC_CONST(0.9760121277800496),
- FRAC_CONST(0.9764228472099433),
- FRAC_CONST(0.9768281850334235),
- FRAC_CONST(0.9772281847876897),
- FRAC_CONST(0.9776228900319223),
- FRAC_CONST(0.9780123443420448),
- FRAC_CONST(0.9783965913055132),
- FRAC_CONST(0.9787756745161313),
- FRAC_CONST(0.9791496375688939),
- FRAC_CONST(0.9795185240548578),
- FRAC_CONST(0.9798823775560431),
- FRAC_CONST(0.9802412416403639),
- FRAC_CONST(0.9805951598565897),
- FRAC_CONST(0.9809441757293399),
- FRAC_CONST(0.9812883327541090),
- FRAC_CONST(0.9816276743923267),
- FRAC_CONST(0.9819622440664515),
- FRAC_CONST(0.9822920851550995),
- FRAC_CONST(0.9826172409882086),
- FRAC_CONST(0.9829377548422400),
- FRAC_CONST(0.9832536699354163),
- FRAC_CONST(0.9835650294229984),
- FRAC_CONST(0.9838718763926001),
- FRAC_CONST(0.9841742538595437),
- FRAC_CONST(0.9844722047622547),
- FRAC_CONST(0.9847657719576983),
- FRAC_CONST(0.9850549982168574),
- FRAC_CONST(0.9853399262202529),
- FRAC_CONST(0.9856205985535073),
- FRAC_CONST(0.9858970577029519),
- FRAC_CONST(0.9861693460512790),
- FRAC_CONST(0.9864375058732389),
- FRAC_CONST(0.9867015793313820),
- FRAC_CONST(0.9869616084718489),
- FRAC_CONST(0.9872176352202061),
- FRAC_CONST(0.9874697013773301),
- FRAC_CONST(0.9877178486153397),
- FRAC_CONST(0.9879621184735767),
- FRAC_CONST(0.9882025523546365),
- FRAC_CONST(0.9884391915204485),
- FRAC_CONST(0.9886720770884069),
- FRAC_CONST(0.9889012500275530),
- FRAC_CONST(0.9891267511548089),
- FRAC_CONST(0.9893486211312621),
- FRAC_CONST(0.9895669004585049),
- FRAC_CONST(0.9897816294750255),
- FRAC_CONST(0.9899928483526520),
- FRAC_CONST(0.9902005970930525),
- FRAC_CONST(0.9904049155242876),
- FRAC_CONST(0.9906058432974180),
- FRAC_CONST(0.9908034198831690),
- FRAC_CONST(0.9909976845686489),
- FRAC_CONST(0.9911886764541239),
- FRAC_CONST(0.9913764344498495),
- FRAC_CONST(0.9915609972729590),
- FRAC_CONST(0.9917424034444086),
- FRAC_CONST(0.9919206912859797),
- FRAC_CONST(0.9920958989173397),
- FRAC_CONST(0.9922680642531603),
- FRAC_CONST(0.9924372250002933),
- FRAC_CONST(0.9926034186550070),
- FRAC_CONST(0.9927666825002789),
- FRAC_CONST(0.9929270536031491),
- FRAC_CONST(0.9930845688121325),
- FRAC_CONST(0.9932392647546895),
- FRAC_CONST(0.9933911778347579),
- FRAC_CONST(0.9935403442303433),
- FRAC_CONST(0.9936867998911693),
- FRAC_CONST(0.9938305805363887),
- FRAC_CONST(0.9939717216523539),
- FRAC_CONST(0.9941102584904481),
- FRAC_CONST(0.9942462260649764),
- FRAC_CONST(0.9943796591511174),
- FRAC_CONST(0.9945105922829353),
- FRAC_CONST(0.9946390597514524),
- FRAC_CONST(0.9947650956027824),
- FRAC_CONST(0.9948887336363228),
- FRAC_CONST(0.9950100074030103),
- FRAC_CONST(0.9951289502036336),
- FRAC_CONST(0.9952455950872091),
- FRAC_CONST(0.9953599748494155),
- FRAC_CONST(0.9954721220310890),
- FRAC_CONST(0.9955820689167787),
- FRAC_CONST(0.9956898475333619),
- FRAC_CONST(0.9957954896487196),
- FRAC_CONST(0.9958990267704713),
- FRAC_CONST(0.9960004901447701),
- FRAC_CONST(0.9960999107551559),
- FRAC_CONST(0.9961973193214694),
- FRAC_CONST(0.9962927462988245),
- FRAC_CONST(0.9963862218766388),
- FRAC_CONST(0.9964777759777242),
- FRAC_CONST(0.9965674382574342),
- FRAC_CONST(0.9966552381028704),
- FRAC_CONST(0.9967412046321465),
- FRAC_CONST(0.9968253666937095),
- FRAC_CONST(0.9969077528657186),
- FRAC_CONST(0.9969883914554805),
- FRAC_CONST(0.9970673104989413),
- FRAC_CONST(0.9971445377602348),
- FRAC_CONST(0.9972201007312871),
- FRAC_CONST(0.9972940266314749),
- FRAC_CONST(0.9973663424073412),
- FRAC_CONST(0.9974370747323638),
- FRAC_CONST(0.9975062500067785),
- FRAC_CONST(0.9975738943574574),
- FRAC_CONST(0.9976400336378379),
- FRAC_CONST(0.9977046934279079),
- FRAC_CONST(0.9977678990342401),
- FRAC_CONST(0.9978296754900812),
- FRAC_CONST(0.9978900475554902),
- FRAC_CONST(0.9979490397175296),
- FRAC_CONST(0.9980066761905056),
- FRAC_CONST(0.9980629809162593),
- FRAC_CONST(0.9981179775645063),
- FRAC_CONST(0.9981716895332257),
- FRAC_CONST(0.9982241399490979),
- FRAC_CONST(0.9982753516679893),
- FRAC_CONST(0.9983253472754841),
- FRAC_CONST(0.9983741490874634),
- FRAC_CONST(0.9984217791507299),
- FRAC_CONST(0.9984682592436778),
- FRAC_CONST(0.9985136108770075),
- FRAC_CONST(0.9985578552944850),
- FRAC_CONST(0.9986010134737439),
- FRAC_CONST(0.9986431061271304),
- FRAC_CONST(0.9986841537025921),
- FRAC_CONST(0.9987241763846056),
- FRAC_CONST(0.9987631940951476),
- FRAC_CONST(0.9988012264947044),
- FRAC_CONST(0.9988382929833222),
- FRAC_CONST(0.9988744127016956),
- FRAC_CONST(0.9989096045322947),
- FRAC_CONST(0.9989438871005292),
- FRAC_CONST(0.9989772787759494),
- FRAC_CONST(0.9990097976734847),
- FRAC_CONST(0.9990414616547146),
- FRAC_CONST(0.9990722883291779),
- FRAC_CONST(0.9991022950557125),
- FRAC_CONST(0.9991314989438310),
- FRAC_CONST(0.9991599168551279),
- FRAC_CONST(0.9991875654047181),
- FRAC_CONST(0.9992144609627068),
- FRAC_CONST(0.9992406196556911),
- FRAC_CONST(0.9992660573682882),
- FRAC_CONST(0.9992907897446957),
- FRAC_CONST(0.9993148321902777),
- FRAC_CONST(0.9993381998731797),
- FRAC_CONST(0.9993609077259696),
- FRAC_CONST(0.9993829704473038),
- FRAC_CONST(0.9994044025036201),
- FRAC_CONST(0.9994252181308537),
- FRAC_CONST(0.9994454313361775),
- FRAC_CONST(0.9994650558997651),
- FRAC_CONST(0.9994841053765757),
- FRAC_CONST(0.9995025930981609),
- FRAC_CONST(0.9995205321744921),
- FRAC_CONST(0.9995379354958073),
- FRAC_CONST(0.9995548157344778),
- FRAC_CONST(0.9995711853468930),
- FRAC_CONST(0.9995870565753632),
- FRAC_CONST(0.9996024414500382),
- FRAC_CONST(0.9996173517908444),
- FRAC_CONST(0.9996317992094352),
- FRAC_CONST(0.9996457951111574),
- FRAC_CONST(0.9996593506970310),
- FRAC_CONST(0.9996724769657434),
- FRAC_CONST(0.9996851847156547),
- FRAC_CONST(0.9996974845468164),
- FRAC_CONST(0.9997093868630000),
- FRAC_CONST(0.9997209018737374),
- FRAC_CONST(0.9997320395963699),
- FRAC_CONST(0.9997428098581069),
- FRAC_CONST(0.9997532222980933),
- FRAC_CONST(0.9997632863694836),
- FRAC_CONST(0.9997730113415246),
- FRAC_CONST(0.9997824063016426),
- FRAC_CONST(0.9997914801575380),
- FRAC_CONST(0.9998002416392840),
- FRAC_CONST(0.9998086993014300),
- FRAC_CONST(0.9998168615251084),
- FRAC_CONST(0.9998247365201450),
- FRAC_CONST(0.9998323323271717),
- FRAC_CONST(0.9998396568197407),
- FRAC_CONST(0.9998467177064404),
- FRAC_CONST(0.9998535225330116),
- FRAC_CONST(0.9998600786844637),
- FRAC_CONST(0.9998663933871905),
- FRAC_CONST(0.9998724737110845),
- FRAC_CONST(0.9998783265716498),
- FRAC_CONST(0.9998839587321121),
- FRAC_CONST(0.9998893768055266),
- FRAC_CONST(0.9998945872568815),
- FRAC_CONST(0.9998995964051983),
- FRAC_CONST(0.9999044104256269),
- FRAC_CONST(0.9999090353515359),
- FRAC_CONST(0.9999134770765971),
- FRAC_CONST(0.9999177413568642),
- FRAC_CONST(0.9999218338128448),
- FRAC_CONST(0.9999257599315647),
- FRAC_CONST(0.9999295250686255),
- FRAC_CONST(0.9999331344502529),
- FRAC_CONST(0.9999365931753376),
- FRAC_CONST(0.9999399062174669),
- FRAC_CONST(0.9999430784269460),
- FRAC_CONST(0.9999461145328103),
- FRAC_CONST(0.9999490191448277),
- FRAC_CONST(0.9999517967554878),
- FRAC_CONST(0.9999544517419835),
- FRAC_CONST(0.9999569883681778),
- FRAC_CONST(0.9999594107865607),
- FRAC_CONST(0.9999617230401926),
- FRAC_CONST(0.9999639290646355),
- FRAC_CONST(0.9999660326898712),
- FRAC_CONST(0.9999680376422052),
- FRAC_CONST(0.9999699475461585),
- FRAC_CONST(0.9999717659263435),
- FRAC_CONST(0.9999734962093266),
- FRAC_CONST(0.9999751417254756),
- FRAC_CONST(0.9999767057107922),
- FRAC_CONST(0.9999781913087290),
- FRAC_CONST(0.9999796015719915),
- FRAC_CONST(0.9999809394643231),
- FRAC_CONST(0.9999822078622751),
- FRAC_CONST(0.9999834095569596),
- FRAC_CONST(0.9999845472557860),
- FRAC_CONST(0.9999856235841805),
- FRAC_CONST(0.9999866410872889),
- FRAC_CONST(0.9999876022316609),
- FRAC_CONST(0.9999885094069193),
- FRAC_CONST(0.9999893649274085),
- FRAC_CONST(0.9999901710338274),
- FRAC_CONST(0.9999909298948430),
- FRAC_CONST(0.9999916436086862),
- FRAC_CONST(0.9999923142047299),
- FRAC_CONST(0.9999929436450469),
- FRAC_CONST(0.9999935338259505),
- FRAC_CONST(0.9999940865795161),
- FRAC_CONST(0.9999946036750835),
- FRAC_CONST(0.9999950868207405),
- FRAC_CONST(0.9999955376647868),
- FRAC_CONST(0.9999959577971798),
- FRAC_CONST(0.9999963487509599),
- FRAC_CONST(0.9999967120036571),
- FRAC_CONST(0.9999970489786785),
- FRAC_CONST(0.9999973610466748),
- FRAC_CONST(0.9999976495268890),
- FRAC_CONST(0.9999979156884846),
- FRAC_CONST(0.9999981607518545),
- FRAC_CONST(0.9999983858899099),
- FRAC_CONST(0.9999985922293493),
- FRAC_CONST(0.9999987808519092),
- FRAC_CONST(0.9999989527955938),
- FRAC_CONST(0.9999991090558848),
- FRAC_CONST(0.9999992505869332),
- FRAC_CONST(0.9999993783027293),
- FRAC_CONST(0.9999994930782556),
- FRAC_CONST(0.9999995957506171),
- FRAC_CONST(0.9999996871201549),
- FRAC_CONST(0.9999997679515386),
- FRAC_CONST(0.9999998389748399),
- FRAC_CONST(0.9999999008865869),
- FRAC_CONST(0.9999999543507984)
-};
-#endif
-
-ALIGN static const real_t kbd_short_128[] =
-{
- FRAC_CONST(4.3795702929468881e-005),
- FRAC_CONST(0.00011867384265436617),
- FRAC_CONST(0.0002307165763996192),
- FRAC_CONST(0.00038947282760568383),
- FRAC_CONST(0.00060581272288302553),
- FRAC_CONST(0.00089199695169487453),
- FRAC_CONST(0.0012617254423430522),
- FRAC_CONST(0.0017301724373162003),
- FRAC_CONST(0.0023140071937421476),
- FRAC_CONST(0.0030313989666022221),
- FRAC_CONST(0.0039020049735530842),
- FRAC_CONST(0.0049469401815512024),
- FRAC_CONST(0.0061887279335368318),
- FRAC_CONST(0.0076512306364647726),
- FRAC_CONST(0.0093595599562652423),
- FRAC_CONST(0.011339966208377799),
- FRAC_CONST(0.013619706891715299),
- FRAC_CONST(0.016226894586323766),
- FRAC_CONST(0.019190324717288168),
- FRAC_CONST(0.022539283975960878),
- FRAC_CONST(0.026303340480472455),
- FRAC_CONST(0.030512117046644357),
- FRAC_CONST(0.03519504922365594),
- FRAC_CONST(0.040381130021856941),
- FRAC_CONST(0.046098643518702249),
- FRAC_CONST(0.052374889768730587),
- FRAC_CONST(0.059235903660769147),
- FRAC_CONST(0.066706170556282418),
- FRAC_CONST(0.074808341703430481),
- FRAC_CONST(0.083562952548726227),
- FRAC_CONST(0.092988147159339674),
- FRAC_CONST(0.1030994120216919),
- FRAC_CONST(0.11390932249409955),
- FRAC_CONST(0.12542730516149531),
- FRAC_CONST(0.13765941926783826),
- FRAC_CONST(0.15060816028651081),
- FRAC_CONST(0.16427228853114245),
- FRAC_CONST(0.17864668550988483),
- FRAC_CONST(0.19372224048676889),
- FRAC_CONST(0.20948576943658073),
- FRAC_CONST(0.22591996826744942),
- FRAC_CONST(0.24300340184133981),
- FRAC_CONST(0.26071052995068139),
- FRAC_CONST(0.27901177101369551),
- FRAC_CONST(0.29787360383626599),
- FRAC_CONST(0.3172587073594233),
- FRAC_CONST(0.33712613787396362),
- FRAC_CONST(0.35743154274286698),
- FRAC_CONST(0.37812740923363009),
- FRAC_CONST(0.39916334663203618),
- FRAC_CONST(0.42048639939189658),
- FRAC_CONST(0.4420413886774246),
- FRAC_CONST(0.4637712792815169),
- FRAC_CONST(0.4856175685594023),
- FRAC_CONST(0.50752069370766872),
- FRAC_CONST(0.52942045344797806),
- FRAC_CONST(0.55125643994680196),
- FRAC_CONST(0.57296847662071559),
- FRAC_CONST(0.59449705734411495),
- FRAC_CONST(0.61578378249506627),
- FRAC_CONST(0.63677178724712891),
- FRAC_CONST(0.65740615754163356),
- FRAC_CONST(0.67763432925662526),
- FRAC_CONST(0.69740646622548552),
- FRAC_CONST(0.71667581294953808),
- FRAC_CONST(0.73539901809352737),
- FRAC_CONST(0.75353642514900732),
- FRAC_CONST(0.77105232699609816),
- FRAC_CONST(0.78791518148597028),
- FRAC_CONST(0.80409778560147072),
- FRAC_CONST(0.81957740622770781),
- FRAC_CONST(0.83433586607383625),
- FRAC_CONST(0.84835958382689225),
- FRAC_CONST(0.86163956818294229),
- FRAC_CONST(0.87417136598406997),
- FRAC_CONST(0.88595496528524853),
- FRAC_CONST(0.89699465477567619),
- FRAC_CONST(0.90729884157670959),
- FRAC_CONST(0.91687983002436779),
- FRAC_CONST(0.92575356460899649),
- FRAC_CONST(0.93393934077779084),
- FRAC_CONST(0.94145948779657318),
- FRAC_CONST(0.94833902830402828),
- FRAC_CONST(0.95460531956280026),
- FRAC_CONST(0.96028768170574896),
- FRAC_CONST(0.96541701848104766),
- FRAC_CONST(0.97002543610646474),
- FRAC_CONST(0.97414586584250062),
- FRAC_CONST(0.97781169577969584),
- FRAC_CONST(0.98105641710392333),
- FRAC_CONST(0.98391328975491177),
- FRAC_CONST(0.98641503193166202),
- FRAC_CONST(0.98859353733226141),
- FRAC_CONST(0.99047962335771556),
- FRAC_CONST(0.9921028127769449),
- FRAC_CONST(0.99349115056397752),
- FRAC_CONST(0.99467105680259038),
- FRAC_CONST(0.9956672157341897),
- FRAC_CONST(0.99650250022834352),
- FRAC_CONST(0.99719793020823266),
- FRAC_CONST(0.99777266288955657),
- FRAC_CONST(0.99824401211201486),
- FRAC_CONST(0.99862749357391212),
- FRAC_CONST(0.99893689243401962),
- FRAC_CONST(0.99918434952623147),
- FRAC_CONST(0.99938046234161726),
- FRAC_CONST(0.99953439696357238),
- FRAC_CONST(0.99965400728430465),
- FRAC_CONST(0.99974595807027455),
- FRAC_CONST(0.99981584876278362),
- FRAC_CONST(0.99986833527824281),
- FRAC_CONST(0.99990724749057802),
- FRAC_CONST(0.99993570051598468),
- FRAC_CONST(0.99995619835942084),
- FRAC_CONST(0.99997072890647543),
- FRAC_CONST(0.9999808496399144),
- FRAC_CONST(0.99998776381655818),
- FRAC_CONST(0.99999238714961569),
- FRAC_CONST(0.99999540529959718),
- FRAC_CONST(0.99999732268176988),
- FRAC_CONST(0.99999850325054862),
- FRAC_CONST(0.99999920402413744),
- FRAC_CONST(0.9999996021706401),
- FRAC_CONST(0.99999981649545566),
- FRAC_CONST(0.99999992415545547),
- FRAC_CONST(0.99999997338493041),
- FRAC_CONST(0.99999999295825959),
- FRAC_CONST(0.99999999904096815)
-};
-
-#ifdef ALLOW_SMALL_FRAMELENGTH
-ALIGN static const real_t kbd_short_120[] =
-{
- FRAC_CONST(0.0000452320086910),
- FRAC_CONST(0.0001274564692111),
- FRAC_CONST(0.0002529398385345),
- FRAC_CONST(0.0004335140496648),
- FRAC_CONST(0.0006827100966952),
- FRAC_CONST(0.0010158708222246),
- FRAC_CONST(0.0014502162869659),
- FRAC_CONST(0.0020048865156264),
- FRAC_CONST(0.0027009618393178),
- FRAC_CONST(0.0035614590925043),
- FRAC_CONST(0.0046113018122711),
- FRAC_CONST(0.0058772627936484),
- FRAC_CONST(0.0073878776584103),
- FRAC_CONST(0.0091733284512589),
- FRAC_CONST(0.0112652966728373),
- FRAC_CONST(0.0136967855861945),
- FRAC_CONST(0.0165019120857793),
- FRAC_CONST(0.0197156688892217),
- FRAC_CONST(0.0233736582950619),
- FRAC_CONST(0.0275117992367496),
- FRAC_CONST(0.0321660098468534),
- FRAC_CONST(0.0373718682174417),
- FRAC_CONST(0.0431642544948834),
- FRAC_CONST(0.0495769778717676),
- FRAC_CONST(0.0566423924273392),
- FRAC_CONST(0.0643910061132260),
- FRAC_CONST(0.0728510874761729),
- FRAC_CONST(0.0820482749475221),
- FRAC_CONST(0.0920051937045235),
- FRAC_CONST(0.1027410852163450),
- FRAC_CONST(0.1142714546239370),
- FRAC_CONST(0.1266077410648368),
- FRAC_CONST(0.1397570159398145),
- FRAC_CONST(0.1537217139274270),
- FRAC_CONST(0.1684994012857075),
- FRAC_CONST(0.1840825856392944),
- FRAC_CONST(0.2004585710384133),
- FRAC_CONST(0.2176093615976121),
- FRAC_CONST(0.2355116164824983),
- FRAC_CONST(0.2541366584185075),
- FRAC_CONST(0.2734505372545160),
- FRAC_CONST(0.2934141494343369),
- FRAC_CONST(0.3139834135200387),
- FRAC_CONST(0.3351095011824163),
- FRAC_CONST(0.3567391223361566),
- FRAC_CONST(0.3788148623608774),
- FRAC_CONST(0.4012755686250732),
- FRAC_CONST(0.4240567828288110),
- FRAC_CONST(0.4470912150133537),
- FRAC_CONST(0.4703092544619664),
- FRAC_CONST(0.4936395121456694),
- FRAC_CONST(0.5170093888596962),
- FRAC_CONST(0.5403456627591340),
- FRAC_CONST(0.5635750896430154),
- FRAC_CONST(0.5866250090612892),
- FRAC_CONST(0.6094239491338723),
- FRAC_CONST(0.6319022228794100),
- FRAC_CONST(0.6539925088563087),
- FRAC_CONST(0.6756304090216887),
- FRAC_CONST(0.6967549769155277),
- FRAC_CONST(0.7173092095766250),
- FRAC_CONST(0.7372404969921184),
- FRAC_CONST(0.7565010233699827),
- FRAC_CONST(0.7750481150999984),
- FRAC_CONST(0.7928445309277697),
- FRAC_CONST(0.8098586906021583),
- FRAC_CONST(0.8260648390616000),
- FRAC_CONST(0.8414431440907889),
- FRAC_CONST(0.8559797262966709),
- FRAC_CONST(0.8696666212110165),
- FRAC_CONST(0.8825016743142358),
- FRAC_CONST(0.8944883707784486),
- FRAC_CONST(0.9056356027326216),
- FRAC_CONST(0.9159573778427816),
- FRAC_CONST(0.9254724739583072),
- FRAC_CONST(0.9342040454819434),
- FRAC_CONST(0.9421791879559176),
- FRAC_CONST(0.9494284680976784),
- FRAC_CONST(0.9559854271440150),
- FRAC_CONST(0.9618860658493898),
- FRAC_CONST(0.9671683198119525),
- FRAC_CONST(0.9718715339497299),
- FRAC_CONST(0.9760359449042233),
- FRAC_CONST(0.9797021798981759),
- FRAC_CONST(0.9829107801140203),
- FRAC_CONST(0.9857017559923277),
- FRAC_CONST(0.9881141809867999),
- FRAC_CONST(0.9901858292742826),
- FRAC_CONST(0.9919528617340944),
- FRAC_CONST(0.9934495632180476),
- FRAC_CONST(0.9947081327749199),
- FRAC_CONST(0.9957585271195989),
- FRAC_CONST(0.9966283562984427),
- FRAC_CONST(0.9973428292485683),
- FRAC_CONST(0.9979247458259197),
- FRAC_CONST(0.9983945309245774),
- FRAC_CONST(0.9987703055583410),
- FRAC_CONST(0.9990679892449266),
- FRAC_CONST(0.9993014277313617),
- FRAC_CONST(0.9994825400228521),
- FRAC_CONST(0.9996214788122335),
- FRAC_CONST(0.9997267987294857),
- FRAC_CONST(0.9998056273097539),
- FRAC_CONST(0.9998638341781910),
- FRAC_CONST(0.9999061946325793),
- FRAC_CONST(0.9999365445321382),
- FRAC_CONST(0.9999579241373735),
- FRAC_CONST(0.9999727092594598),
- FRAC_CONST(0.9999827287418790),
- FRAC_CONST(0.9999893678912771),
- FRAC_CONST(0.9999936579844555),
- FRAC_CONST(0.9999963523959187),
- FRAC_CONST(0.9999979902130101),
- FRAC_CONST(0.9999989484358076),
- FRAC_CONST(0.9999994840031031),
- FRAC_CONST(0.9999997669534347),
- FRAC_CONST(0.9999999060327799),
- FRAC_CONST(0.9999999680107184),
- FRAC_CONST(0.9999999918774242),
- FRAC_CONST(0.9999999989770326)
-};
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/libfaad/lt_predict.c b/src/libfaad/lt_predict.c
deleted file mode 100644
index 3aab00426..000000000
--- a/src/libfaad/lt_predict.c
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: lt_predict.c,v 1.7 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-
-#include "common.h"
-#include "structs.h"
-
-#ifdef LTP_DEC
-
-#include <stdlib.h>
-#include "syntax.h"
-#include "lt_predict.h"
-#include "filtbank.h"
-#include "tns.h"
-
-
-/* static function declarations */
-static int16_t real_to_int16(real_t sig_in);
-
-
-/* check if the object type is an object type that can have LTP */
-uint8_t is_ltp_ot(uint8_t object_type)
-{
-#ifdef LTP_DEC
- if ((object_type == LTP)
-#ifdef ERROR_RESILIENCE
- || (object_type == ER_LTP)
-#endif
-#ifdef LD_DEC
- || (object_type == LD)
-#endif
-#ifdef SCALABLE_DEC
- || (object_type == 6) /* TODO */
-#endif
- )
- {
- return 1;
- }
-#endif
-
- return 0;
-}
-
-ALIGN static const real_t codebook[8] =
-{
- REAL_CONST(0.570829),
- REAL_CONST(0.696616),
- REAL_CONST(0.813004),
- REAL_CONST(0.911304),
- REAL_CONST(0.984900),
- REAL_CONST(1.067894),
- REAL_CONST(1.194601),
- REAL_CONST(1.369533)
-};
-
-void lt_prediction(ic_stream *ics, ltp_info *ltp, real_t *spec,
- int16_t *lt_pred_stat, fb_info *fb, uint8_t win_shape,
- uint8_t win_shape_prev, uint8_t sr_index,
- uint8_t object_type, uint16_t frame_len)
-{
- uint8_t sfb;
- uint16_t bin, i, num_samples;
- ALIGN real_t x_est[2048];
- ALIGN real_t X_est[2048];
-
- if (ics->window_sequence != EIGHT_SHORT_SEQUENCE)
- {
- if (ltp->data_present)
- {
- num_samples = frame_len << 1;
-
- for(i = 0; i < num_samples; i++)
- {
- /* The extra lookback M (N/2 for LD, 0 for LTP) is handled
- in the buffer updating */
-
-#if 0
- x_est[i] = MUL_R_C(lt_pred_stat[num_samples + i - ltp->lag],
- codebook[ltp->coef]);
-#else
- /* lt_pred_stat is a 16 bit int, multiplied with the fixed point real
- this gives a real for x_est
- */
- x_est[i] = (real_t)lt_pred_stat[num_samples + i - ltp->lag] * codebook[ltp->coef];
-#endif
- }
-
- filter_bank_ltp(fb, ics->window_sequence, win_shape, win_shape_prev,
- x_est, X_est, object_type, frame_len);
-
- tns_encode_frame(ics, &(ics->tns), sr_index, object_type, X_est,
- frame_len);
-
- for (sfb = 0; sfb < ltp->last_band; sfb++)
- {
- if (ltp->long_used[sfb])
- {
- uint16_t low = ics->swb_offset[sfb];
- uint16_t high = ics->swb_offset[sfb+1];
-
- for (bin = low; bin < high; bin++)
- {
- spec[bin] += X_est[bin];
- }
- }
- }
- }
- }
-}
-
-#ifdef FIXED_POINT
-static INLINE int16_t real_to_int16(real_t sig_in)
-{
- if (sig_in >= 0)
- {
- sig_in += (1 << (REAL_BITS-1));
- if (sig_in >= REAL_CONST(32768))
- return 32767;
- } else {
- sig_in += -(1 << (REAL_BITS-1));
- if (sig_in <= REAL_CONST(-32768))
- return -32768;
- }
-
- return (sig_in >> REAL_BITS);
-}
-#else
-static INLINE int16_t real_to_int16(real_t sig_in)
-{
- if (sig_in >= 0)
- {
-#ifndef HAS_LRINTF
- sig_in += 0.5f;
-#endif
- if (sig_in >= 32768.0f)
- return 32767;
- } else {
-#ifndef HAS_LRINTF
- sig_in += -0.5f;
-#endif
- if (sig_in <= -32768.0f)
- return -32768;
- }
-
- return lrintf(sig_in);
-}
-#endif
-
-void lt_update_state(int16_t *lt_pred_stat, real_t *time, real_t *overlap,
- uint16_t frame_len, uint8_t object_type)
-{
- uint16_t i;
-
- /*
- * The reference point for index i and the content of the buffer
- * lt_pred_stat are arranged so that lt_pred_stat(0 ... N/2 - 1) contains the
- * last aliased half window from the IMDCT, and lt_pred_stat(N/2 ... N-1)
- * is always all zeros. The rest of lt_pred_stat (i<0) contains the previous
- * fully reconstructed time domain samples, i.e., output of the decoder.
- *
- * These values are shifted up by N*2 to avoid (i<0)
- *
- * For the LD object type an extra 512 samples lookback is accomodated here.
- */
-#ifdef LD_DEC
- if (object_type == LD)
- {
- for (i = 0; i < frame_len; i++)
- {
- lt_pred_stat[i] /* extra 512 */ = lt_pred_stat[i + frame_len];
- lt_pred_stat[frame_len + i] = lt_pred_stat[i + (frame_len * 2)];
- lt_pred_stat[(frame_len * 2) + i] = real_to_int16(time[i]);
- lt_pred_stat[(frame_len * 3) + i] = real_to_int16(overlap[i]);
- }
- } else {
-#endif
- for (i = 0; i < frame_len; i++)
- {
- lt_pred_stat[i] = lt_pred_stat[i + frame_len];
- lt_pred_stat[frame_len + i] = real_to_int16(time[i]);
- lt_pred_stat[(frame_len * 2) + i] = real_to_int16(overlap[i]);
-#if 0 /* set to zero once upon initialisation */
- lt_pred_stat[(frame_len * 3) + i] = 0;
-#endif
- }
-#ifdef LD_DEC
- }
-#endif
-}
-
-#endif
diff --git a/src/libfaad/lt_predict.h b/src/libfaad/lt_predict.h
deleted file mode 100644
index faa2fbca7..000000000
--- a/src/libfaad/lt_predict.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: lt_predict.h,v 1.7 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifdef LTP_DEC
-
-#ifndef __LT_PREDICT_H__
-#define __LT_PREDICT_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "filtbank.h"
-
-uint8_t is_ltp_ot(uint8_t object_type);
-
-void lt_prediction(ic_stream *ics,
- ltp_info *ltp,
- real_t *spec,
- int16_t *lt_pred_stat,
- fb_info *fb,
- uint8_t win_shape,
- uint8_t win_shape_prev,
- uint8_t sr_index,
- uint8_t object_type,
- uint16_t frame_len);
-
-void lt_update_state(int16_t *lt_pred_stat,
- real_t *time,
- real_t *overlap,
- uint16_t frame_len,
- uint8_t object_type);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
-#endif
diff --git a/src/libfaad/mdct.c b/src/libfaad/mdct.c
deleted file mode 100644
index 0df3d6aae..000000000
--- a/src/libfaad/mdct.c
+++ /dev/null
@@ -1,298 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: mdct.c,v 1.11 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-/*
- * Fast (I)MDCT Implementation using (I)FFT ((Inverse) Fast Fourier Transform)
- * and consists of three steps: pre-(I)FFT complex multiplication, complex
- * (I)FFT, post-(I)FFT complex multiplication,
- *
- * As described in:
- * P. Duhamel, Y. Mahieux, and J.P. Petit, "A Fast Algorithm for the
- * Implementation of Filter Banks Based on 'Time Domain Aliasing
- * Cancellation'," IEEE Proc. on ICASSP'91, 1991, pp. 2209-2212.
- *
- *
- * As of April 6th 2002 completely rewritten.
- * This (I)MDCT can now be used for any data size n, where n is divisible by 8.
- *
- */
-
-#include "common.h"
-#include "structs.h"
-
-#include <stdlib.h>
-#ifdef _WIN32_WCE
-#define assert(x)
-#else
-#include <assert.h>
-#endif
-
-#include "cfft.h"
-#include "mdct.h"
-#include "mdct_tab.h"
-
-
-mdct_info *faad_mdct_init(uint16_t N)
-{
- mdct_info *mdct = (mdct_info*)faad_malloc(sizeof(mdct_info));
-
- assert(N % 8 == 0);
-
- mdct->N = N;
-
- /* NOTE: For "small framelengths" in FIXED_POINT the coefficients need to be
- * scaled by sqrt("(nearest power of 2) > N" / N) */
-
- /* RE(mdct->sincos[k]) = scale*(real_t)(cos(2.0*M_PI*(k+1./8.) / (real_t)N));
- * IM(mdct->sincos[k]) = scale*(real_t)(sin(2.0*M_PI*(k+1./8.) / (real_t)N)); */
- /* scale is 1 for fixed point, sqrt(N) for floating point */
- switch (N)
- {
- case 2048: mdct->sincos = (complex_t*)mdct_tab_2048; break;
- case 256: mdct->sincos = (complex_t*)mdct_tab_256; break;
-#ifdef LD_DEC
- case 1024: mdct->sincos = (complex_t*)mdct_tab_1024; break;
-#endif
-#ifdef ALLOW_SMALL_FRAMELENGTH
- case 1920: mdct->sincos = (complex_t*)mdct_tab_1920; break;
- case 240: mdct->sincos = (complex_t*)mdct_tab_240; break;
-#ifdef LD_DEC
- case 960: mdct->sincos = (complex_t*)mdct_tab_960; break;
-#endif
-#endif
-#ifdef SSR_DEC
- case 512: mdct->sincos = (complex_t*)mdct_tab_512; break;
- case 64: mdct->sincos = (complex_t*)mdct_tab_64; break;
-#endif
- }
-
- /* initialise fft */
- mdct->cfft = cffti(N/4);
-
-#ifdef PROFILE
- mdct->cycles = 0;
- mdct->fft_cycles = 0;
-#endif
-
- return mdct;
-}
-
-void faad_mdct_end(mdct_info *mdct)
-{
- if (mdct != NULL)
- {
-#ifdef PROFILE
- printf("MDCT[%.4d]: %I64d cycles\n", mdct->N, mdct->cycles);
- printf("CFFT[%.4d]: %I64d cycles\n", mdct->N/4, mdct->fft_cycles);
-#endif
-
- cfftu(mdct->cfft);
-
- faad_free(mdct);
- }
-}
-
-void faad_imdct(mdct_info *mdct, real_t *X_in, real_t *X_out)
-{
- uint16_t k;
-
- complex_t x;
-#ifdef ALLOW_SMALL_FRAMELENGTH
-#ifdef FIXED_POINT
- real_t scale, b_scale = 0;
-#endif
-#endif
- ALIGN complex_t Z1[512];
- complex_t *sincos = mdct->sincos;
-
- uint16_t N = mdct->N;
- uint16_t N2 = N >> 1;
- uint16_t N4 = N >> 2;
- uint16_t N8 = N >> 3;
-
-#ifdef PROFILE
- int64_t count1, count2 = faad_get_ts();
-#endif
-
-#ifdef ALLOW_SMALL_FRAMELENGTH
-#ifdef FIXED_POINT
- /* detect non-power of 2 */
- if (N & (N-1))
- {
- /* adjust scale for non-power of 2 MDCT */
- /* 2048/1920 */
- b_scale = 1;
- scale = COEF_CONST(1.0666666666666667);
- }
-#endif
-#endif
-
- /* pre-IFFT complex multiplication */
- for (k = 0; k < N4; k++)
- {
- ComplexMult(&IM(Z1[k]), &RE(Z1[k]),
- X_in[2*k], X_in[N2 - 1 - 2*k], RE(sincos[k]), IM(sincos[k]));
- }
-
-#ifdef PROFILE
- count1 = faad_get_ts();
-#endif
-
- /* complex IFFT, any non-scaling FFT can be used here */
- cfftb(mdct->cfft, Z1);
-
-#ifdef PROFILE
- count1 = faad_get_ts() - count1;
-#endif
-
- /* post-IFFT complex multiplication */
- for (k = 0; k < N4; k++)
- {
- RE(x) = RE(Z1[k]);
- IM(x) = IM(Z1[k]);
- ComplexMult(&IM(Z1[k]), &RE(Z1[k]),
- IM(x), RE(x), RE(sincos[k]), IM(sincos[k]));
-
-#ifdef ALLOW_SMALL_FRAMELENGTH
-#ifdef FIXED_POINT
- /* non-power of 2 MDCT scaling */
- if (b_scale)
- {
- RE(Z1[k]) = MUL_C(RE(Z1[k]), scale);
- IM(Z1[k]) = MUL_C(IM(Z1[k]), scale);
- }
-#endif
-#endif
- }
-
- /* reordering */
- for (k = 0; k < N8; k+=2)
- {
- X_out[ 2*k] = IM(Z1[N8 + k]);
- X_out[ 2 + 2*k] = IM(Z1[N8 + 1 + k]);
-
- X_out[ 1 + 2*k] = -RE(Z1[N8 - 1 - k]);
- X_out[ 3 + 2*k] = -RE(Z1[N8 - 2 - k]);
-
- X_out[N4 + 2*k] = RE(Z1[ k]);
- X_out[N4 + + 2 + 2*k] = RE(Z1[ 1 + k]);
-
- X_out[N4 + 1 + 2*k] = -IM(Z1[N4 - 1 - k]);
- X_out[N4 + 3 + 2*k] = -IM(Z1[N4 - 2 - k]);
-
- X_out[N2 + 2*k] = RE(Z1[N8 + k]);
- X_out[N2 + + 2 + 2*k] = RE(Z1[N8 + 1 + k]);
-
- X_out[N2 + 1 + 2*k] = -IM(Z1[N8 - 1 - k]);
- X_out[N2 + 3 + 2*k] = -IM(Z1[N8 - 2 - k]);
-
- X_out[N2 + N4 + 2*k] = -IM(Z1[ k]);
- X_out[N2 + N4 + 2 + 2*k] = -IM(Z1[ 1 + k]);
-
- X_out[N2 + N4 + 1 + 2*k] = RE(Z1[N4 - 1 - k]);
- X_out[N2 + N4 + 3 + 2*k] = RE(Z1[N4 - 2 - k]);
- }
-
-#ifdef PROFILE
- count2 = faad_get_ts() - count2;
- mdct->fft_cycles += count1;
- mdct->cycles += (count2 - count1);
-#endif
-}
-
-#ifdef LTP_DEC
-void faad_mdct(mdct_info *mdct, real_t *X_in, real_t *X_out)
-{
- uint16_t k;
-
- complex_t x;
- ALIGN complex_t Z1[512];
- complex_t *sincos = mdct->sincos;
-
- uint16_t N = mdct->N;
- uint16_t N2 = N >> 1;
- uint16_t N4 = N >> 2;
- uint16_t N8 = N >> 3;
-
-#ifndef FIXED_POINT
- real_t scale = REAL_CONST(N);
-#else
- real_t scale = REAL_CONST(4.0/N);
-#endif
-
-#ifdef ALLOW_SMALL_FRAMELENGTH
-#ifdef FIXED_POINT
- /* detect non-power of 2 */
- if (N & (N-1))
- {
- /* adjust scale for non-power of 2 MDCT */
- /* *= sqrt(2048/1920) */
- scale = MUL_C(scale, COEF_CONST(1.0327955589886444));
- }
-#endif
-#endif
-
- /* pre-FFT complex multiplication */
- for (k = 0; k < N8; k++)
- {
- uint16_t n = k << 1;
- RE(x) = X_in[N - N4 - 1 - n] + X_in[N - N4 + n];
- IM(x) = X_in[ N4 + n] - X_in[ N4 - 1 - n];
-
- ComplexMult(&RE(Z1[k]), &IM(Z1[k]),
- RE(x), IM(x), RE(sincos[k]), IM(sincos[k]));
-
- RE(Z1[k]) = MUL_R(RE(Z1[k]), scale);
- IM(Z1[k]) = MUL_R(IM(Z1[k]), scale);
-
- RE(x) = X_in[N2 - 1 - n] - X_in[ n];
- IM(x) = X_in[N2 + n] + X_in[N - 1 - n];
-
- ComplexMult(&RE(Z1[k + N8]), &IM(Z1[k + N8]),
- RE(x), IM(x), RE(sincos[k + N8]), IM(sincos[k + N8]));
-
- RE(Z1[k + N8]) = MUL_R(RE(Z1[k + N8]), scale);
- IM(Z1[k + N8]) = MUL_R(IM(Z1[k + N8]), scale);
- }
-
- /* complex FFT, any non-scaling FFT can be used here */
- cfftf(mdct->cfft, Z1);
-
- /* post-FFT complex multiplication */
- for (k = 0; k < N4; k++)
- {
- uint16_t n = k << 1;
- ComplexMult(&RE(x), &IM(x),
- RE(Z1[k]), IM(Z1[k]), RE(sincos[k]), IM(sincos[k]));
-
- X_out[ n] = -RE(x);
- X_out[N2 - 1 - n] = IM(x);
- X_out[N2 + n] = -IM(x);
- X_out[N - 1 - n] = RE(x);
- }
-}
-#endif
diff --git a/src/libfaad/mdct.h b/src/libfaad/mdct.h
deleted file mode 100644
index c2b738795..000000000
--- a/src/libfaad/mdct.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: mdct.h,v 1.8 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __MDCT_H__
-#define __MDCT_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-mdct_info *faad_mdct_init(uint16_t N);
-void faad_mdct_end(mdct_info *mdct);
-void faad_imdct(mdct_info *mdct, real_t *X_in, real_t *X_out);
-void faad_mdct(mdct_info *mdct, real_t *X_in, real_t *X_out);
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/libfaad/mdct_tab.h b/src/libfaad/mdct_tab.h
deleted file mode 100644
index 7dd17166b..000000000
--- a/src/libfaad/mdct_tab.h
+++ /dev/null
@@ -1,3652 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: mdct_tab.h,v 1.1 2005/10/30 00:50:19 tmmm Exp $
-**/
-
-#ifndef __MDCT_TAB_H__
-#define __MDCT_TAB_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef FIXED_POINT
-
-/* 256 (N/4) complex twiddle factors */
-ALIGN static const complex_t mdct_tab_2048[] =
-{
- { FRAC_CONST(0.999999926465718), FRAC_CONST(0.000383495187571) },
- { FRAC_CONST(0.999994043728986), FRAC_CONST(0.003451449920136) },
- { FRAC_CONST(0.999978748667469), FRAC_CONST(0.006519372166339) },
- { FRAC_CONST(0.999954041425130), FRAC_CONST(0.009587233049729) },
- { FRAC_CONST(0.999919922234523), FRAC_CONST(0.012655003694430) },
- { FRAC_CONST(0.999876391416790), FRAC_CONST(0.015722655225417) },
- { FRAC_CONST(0.999823449381662), FRAC_CONST(0.018790158768785) },
- { FRAC_CONST(0.999761096627447), FRAC_CONST(0.021857485452022) },
- { FRAC_CONST(0.999689333741034), FRAC_CONST(0.024924606404281) },
- { FRAC_CONST(0.999608161397882), FRAC_CONST(0.027991492756653) },
- { FRAC_CONST(0.999517580362017), FRAC_CONST(0.031058115642435) },
- { FRAC_CONST(0.999417591486022), FRAC_CONST(0.034124446197403) },
- { FRAC_CONST(0.999308195711029), FRAC_CONST(0.037190455560088) },
- { FRAC_CONST(0.999189394066715), FRAC_CONST(0.040256114872041) },
- { FRAC_CONST(0.999061187671285), FRAC_CONST(0.043321395278110) },
- { FRAC_CONST(0.998923577731466), FRAC_CONST(0.046386267926707) },
- { FRAC_CONST(0.998776565542496), FRAC_CONST(0.049450703970085) },
- { FRAC_CONST(0.998620152488109), FRAC_CONST(0.052514674564603) },
- { FRAC_CONST(0.998454340040525), FRAC_CONST(0.055578150871005) },
- { FRAC_CONST(0.998279129760433), FRAC_CONST(0.058641104054683) },
- { FRAC_CONST(0.998094523296980), FRAC_CONST(0.061703505285957) },
- { FRAC_CONST(0.997900522387752), FRAC_CONST(0.064765325740340) },
- { FRAC_CONST(0.997697128858759), FRAC_CONST(0.067826536598811) },
- { FRAC_CONST(0.997484344624418), FRAC_CONST(0.070887109048088) },
- { FRAC_CONST(0.997262171687536), FRAC_CONST(0.073947014280897) },
- { FRAC_CONST(0.997030612139289), FRAC_CONST(0.077006223496246) },
- { FRAC_CONST(0.996789668159205), FRAC_CONST(0.080064707899691) },
- { FRAC_CONST(0.996539342015138), FRAC_CONST(0.083122438703613) },
- { FRAC_CONST(0.996279636063255), FRAC_CONST(0.086179387127485) },
- { FRAC_CONST(0.996010552748006), FRAC_CONST(0.089235524398144) },
- { FRAC_CONST(0.995732094602106), FRAC_CONST(0.092290821750062) },
- { FRAC_CONST(0.995444264246510), FRAC_CONST(0.095345250425618) },
- { FRAC_CONST(0.995147064390386), FRAC_CONST(0.098398781675364) },
- { FRAC_CONST(0.994840497831093), FRAC_CONST(0.101451386758302) },
- { FRAC_CONST(0.994524567454152), FRAC_CONST(0.104503036942151) },
- { FRAC_CONST(0.994199276233219), FRAC_CONST(0.107553703503616) },
- { FRAC_CONST(0.993864627230060), FRAC_CONST(0.110603357728662) },
- { FRAC_CONST(0.993520623594518), FRAC_CONST(0.113651970912782) },
- { FRAC_CONST(0.993167268564487), FRAC_CONST(0.116699514361268) },
- { FRAC_CONST(0.992804565465879), FRAC_CONST(0.119745959389480) },
- { FRAC_CONST(0.992432517712594), FRAC_CONST(0.122791277323117) },
- { FRAC_CONST(0.992051128806486), FRAC_CONST(0.125835439498487) },
- { FRAC_CONST(0.991660402337333), FRAC_CONST(0.128878417262777) },
- { FRAC_CONST(0.991260341982802), FRAC_CONST(0.131920181974320) },
- { FRAC_CONST(0.990850951508414), FRAC_CONST(0.134960705002869) },
- { FRAC_CONST(0.990432234767506), FRAC_CONST(0.137999957729863) },
- { FRAC_CONST(0.990004195701201), FRAC_CONST(0.141037911548698) },
- { FRAC_CONST(0.989566838338365), FRAC_CONST(0.144074537864995) },
- { FRAC_CONST(0.989120166795573), FRAC_CONST(0.147109808096872) },
- { FRAC_CONST(0.988664185277066), FRAC_CONST(0.150143693675208) },
- { FRAC_CONST(0.988198898074718), FRAC_CONST(0.153176166043918) },
- { FRAC_CONST(0.987724309567987), FRAC_CONST(0.156207196660216) },
- { FRAC_CONST(0.987240424223882), FRAC_CONST(0.159236756994888) },
- { FRAC_CONST(0.986747246596917), FRAC_CONST(0.162264818532558) },
- { FRAC_CONST(0.986244781329065), FRAC_CONST(0.165291352771958) },
- { FRAC_CONST(0.985733033149723), FRAC_CONST(0.168316331226195) },
- { FRAC_CONST(0.985212006875659), FRAC_CONST(0.171339725423019) },
- { FRAC_CONST(0.984681707410971), FRAC_CONST(0.174361506905094) },
- { FRAC_CONST(0.984142139747039), FRAC_CONST(0.177381647230260) },
- { FRAC_CONST(0.983593308962479), FRAC_CONST(0.180400117971807) },
- { FRAC_CONST(0.983035220223096), FRAC_CONST(0.183416890718739) },
- { FRAC_CONST(0.982467878781833), FRAC_CONST(0.186431937076042) },
- { FRAC_CONST(0.981891289978725), FRAC_CONST(0.189445228664950) },
- { FRAC_CONST(0.981305459240845), FRAC_CONST(0.192456737123217) },
- { FRAC_CONST(0.980710392082254), FRAC_CONST(0.195466434105377) },
- { FRAC_CONST(0.980106094103952), FRAC_CONST(0.198474291283016) },
- { FRAC_CONST(0.979492570993821), FRAC_CONST(0.201480280345038) },
- { FRAC_CONST(0.978869828526574), FRAC_CONST(0.204484372997927) },
- { FRAC_CONST(0.978237872563701), FRAC_CONST(0.207486540966021) },
- { FRAC_CONST(0.977596709053412), FRAC_CONST(0.210486755991770) },
- { FRAC_CONST(0.976946344030582), FRAC_CONST(0.213484989836008) },
- { FRAC_CONST(0.976286783616694), FRAC_CONST(0.216481214278217) },
- { FRAC_CONST(0.975618034019782), FRAC_CONST(0.219475401116790) },
- { FRAC_CONST(0.974940101534372), FRAC_CONST(0.222467522169302) },
- { FRAC_CONST(0.974252992541423), FRAC_CONST(0.225457549272769) },
- { FRAC_CONST(0.973556713508266), FRAC_CONST(0.228445454283916) },
- { FRAC_CONST(0.972851270988544), FRAC_CONST(0.231431209079446) },
- { FRAC_CONST(0.972136671622152), FRAC_CONST(0.234414785556295) },
- { FRAC_CONST(0.971412922135171), FRAC_CONST(0.237396155631907) },
- { FRAC_CONST(0.970680029339806), FRAC_CONST(0.240375291244489) },
- { FRAC_CONST(0.969938000134324), FRAC_CONST(0.243352164353285) },
- { FRAC_CONST(0.969186841502986), FRAC_CONST(0.246326746938829) },
- { FRAC_CONST(0.968426560515983), FRAC_CONST(0.249299011003218) },
- { FRAC_CONST(0.967657164329370), FRAC_CONST(0.252268928570371) },
- { FRAC_CONST(0.966878660184996), FRAC_CONST(0.255236471686292) },
- { FRAC_CONST(0.966091055410439), FRAC_CONST(0.258201612419335) },
- { FRAC_CONST(0.965294357418935), FRAC_CONST(0.261164322860466) },
- { FRAC_CONST(0.964488573709308), FRAC_CONST(0.264124575123528) },
- { FRAC_CONST(0.963673711865903), FRAC_CONST(0.267082341345496) },
- { FRAC_CONST(0.962849779558509), FRAC_CONST(0.270037593686751) },
- { FRAC_CONST(0.962016784542291), FRAC_CONST(0.272990304331330) },
- { FRAC_CONST(0.961174734657714), FRAC_CONST(0.275940445487197) },
- { FRAC_CONST(0.960323637830474), FRAC_CONST(0.278887989386500) },
- { FRAC_CONST(0.959463502071418), FRAC_CONST(0.281832908285833) },
- { FRAC_CONST(0.958594335476470), FRAC_CONST(0.284775174466498) },
- { FRAC_CONST(0.957716146226559), FRAC_CONST(0.287714760234765) },
- { FRAC_CONST(0.956828942587535), FRAC_CONST(0.290651637922133) },
- { FRAC_CONST(0.955932732910098), FRAC_CONST(0.293585779885591) },
- { FRAC_CONST(0.955027525629714), FRAC_CONST(0.296517158507877) },
- { FRAC_CONST(0.954113329266539), FRAC_CONST(0.299445746197740) },
- { FRAC_CONST(0.953190152425337), FRAC_CONST(0.302371515390196) },
- { FRAC_CONST(0.952258003795400), FRAC_CONST(0.305294438546792) },
- { FRAC_CONST(0.951316892150466), FRAC_CONST(0.308214488155861) },
- { FRAC_CONST(0.950366826348636), FRAC_CONST(0.311131636732785) },
- { FRAC_CONST(0.949407815332292), FRAC_CONST(0.314045856820251) },
- { FRAC_CONST(0.948439868128010), FRAC_CONST(0.316957120988508) },
- { FRAC_CONST(0.947462993846478), FRAC_CONST(0.319865401835631) },
- { FRAC_CONST(0.946477201682409), FRAC_CONST(0.322770671987771) },
- { FRAC_CONST(0.945482500914454), FRAC_CONST(0.325672904099420) },
- { FRAC_CONST(0.944478900905116), FRAC_CONST(0.328572070853664) },
- { FRAC_CONST(0.943466411100659), FRAC_CONST(0.331468144962441) },
- { FRAC_CONST(0.942445041031025), FRAC_CONST(0.334361099166799) },
- { FRAC_CONST(0.941414800309736), FRAC_CONST(0.337250906237151) },
- { FRAC_CONST(0.940375698633812), FRAC_CONST(0.340137538973532) },
- { FRAC_CONST(0.939327745783671), FRAC_CONST(0.343020970205856) },
- { FRAC_CONST(0.938270951623047), FRAC_CONST(0.345901172794169) },
- { FRAC_CONST(0.937205326098888), FRAC_CONST(0.348778119628908) },
- { FRAC_CONST(0.936130879241267), FRAC_CONST(0.351651783631155) },
- { FRAC_CONST(0.935047621163287), FRAC_CONST(0.354522137752887) },
- { FRAC_CONST(0.933955562060987), FRAC_CONST(0.357389154977241) },
- { FRAC_CONST(0.932854712213241), FRAC_CONST(0.360252808318757) },
- { FRAC_CONST(0.931745081981669), FRAC_CONST(0.363113070823639) },
- { FRAC_CONST(0.930626681810532), FRAC_CONST(0.365969915570009) },
- { FRAC_CONST(0.929499522226639), FRAC_CONST(0.368823315668154) },
- { FRAC_CONST(0.928363613839244), FRAC_CONST(0.371673244260787) },
- { FRAC_CONST(0.927218967339952), FRAC_CONST(0.374519674523293) },
- { FRAC_CONST(0.926065593502609), FRAC_CONST(0.377362579663988) },
- { FRAC_CONST(0.924903503183211), FRAC_CONST(0.380201932924366) },
- { FRAC_CONST(0.923732707319793), FRAC_CONST(0.383037707579352) },
- { FRAC_CONST(0.922553216932333), FRAC_CONST(0.385869876937555) },
- { FRAC_CONST(0.921365043122642), FRAC_CONST(0.388698414341519) },
- { FRAC_CONST(0.920168197074266), FRAC_CONST(0.391523293167972) },
- { FRAC_CONST(0.918962690052376), FRAC_CONST(0.394344486828080) },
- { FRAC_CONST(0.917748533403661), FRAC_CONST(0.397161968767692) },
- { FRAC_CONST(0.916525738556228), FRAC_CONST(0.399975712467595) },
- { FRAC_CONST(0.915294317019487), FRAC_CONST(0.402785691443764) },
- { FRAC_CONST(0.914054280384047), FRAC_CONST(0.405591879247604) },
- { FRAC_CONST(0.912805640321604), FRAC_CONST(0.408394249466208) },
- { FRAC_CONST(0.911548408584834), FRAC_CONST(0.411192775722600) },
- { FRAC_CONST(0.910282597007282), FRAC_CONST(0.413987431675985) },
- { FRAC_CONST(0.909008217503247), FRAC_CONST(0.416778191021998) },
- { FRAC_CONST(0.907725282067676), FRAC_CONST(0.419565027492947) },
- { FRAC_CONST(0.906433802776045), FRAC_CONST(0.422347914858067) },
- { FRAC_CONST(0.905133791784250), FRAC_CONST(0.425126826923762) },
- { FRAC_CONST(0.903825261328488), FRAC_CONST(0.427901737533854) },
- { FRAC_CONST(0.902508223725146), FRAC_CONST(0.430672620569827) },
- { FRAC_CONST(0.901182691370685), FRAC_CONST(0.433439449951074) },
- { FRAC_CONST(0.899848676741519), FRAC_CONST(0.436202199635144) },
- { FRAC_CONST(0.898506192393902), FRAC_CONST(0.438960843617984) },
- { FRAC_CONST(0.897155250963809), FRAC_CONST(0.441715355934187) },
- { FRAC_CONST(0.895795865166814), FRAC_CONST(0.444465710657234) },
- { FRAC_CONST(0.894428047797974), FRAC_CONST(0.447211881899738) },
- { FRAC_CONST(0.893051811731707), FRAC_CONST(0.449953843813691) },
- { FRAC_CONST(0.891667169921672), FRAC_CONST(0.452691570590701) },
- { FRAC_CONST(0.890274135400645), FRAC_CONST(0.455425036462242) },
- { FRAC_CONST(0.888872721280396), FRAC_CONST(0.458154215699893) },
- { FRAC_CONST(0.887462940751569), FRAC_CONST(0.460879082615579) },
- { FRAC_CONST(0.886044807083556), FRAC_CONST(0.463599611561814) },
- { FRAC_CONST(0.884618333624370), FRAC_CONST(0.466315776931944) },
- { FRAC_CONST(0.883183533800523), FRAC_CONST(0.469027553160387) },
- { FRAC_CONST(0.881740421116898), FRAC_CONST(0.471734914722871) },
- { FRAC_CONST(0.880289009156621), FRAC_CONST(0.474437836136679) },
- { FRAC_CONST(0.878829311580933), FRAC_CONST(0.477136291960885) },
- { FRAC_CONST(0.877361342129065), FRAC_CONST(0.479830256796594) },
- { FRAC_CONST(0.875885114618104), FRAC_CONST(0.482519705287184) },
- { FRAC_CONST(0.874400642942865), FRAC_CONST(0.485204612118542) },
- { FRAC_CONST(0.872907941075761), FRAC_CONST(0.487884952019301) },
- { FRAC_CONST(0.871407023066671), FRAC_CONST(0.490560699761082) },
- { FRAC_CONST(0.869897903042806), FRAC_CONST(0.493231830158728) },
- { FRAC_CONST(0.868380595208580), FRAC_CONST(0.495898318070542) },
- { FRAC_CONST(0.866855113845470), FRAC_CONST(0.498560138398525) },
- { FRAC_CONST(0.865321473311890), FRAC_CONST(0.501217266088610) },
- { FRAC_CONST(0.863779688043047), FRAC_CONST(0.503869676130899) },
- { FRAC_CONST(0.862229772550811), FRAC_CONST(0.506517343559899) },
- { FRAC_CONST(0.860671741423578), FRAC_CONST(0.509160243454755) },
- { FRAC_CONST(0.859105609326130), FRAC_CONST(0.511798350939487) },
- { FRAC_CONST(0.857531390999499), FRAC_CONST(0.514431641183223) },
- { FRAC_CONST(0.855949101260827), FRAC_CONST(0.517060089400432) },
- { FRAC_CONST(0.854358755003227), FRAC_CONST(0.519683670851158) },
- { FRAC_CONST(0.852760367195645), FRAC_CONST(0.522302360841255) },
- { FRAC_CONST(0.851153952882715), FRAC_CONST(0.524916134722613) },
- { FRAC_CONST(0.849539527184621), FRAC_CONST(0.527524967893398) },
- { FRAC_CONST(0.847917105296951), FRAC_CONST(0.530128835798279) },
- { FRAC_CONST(0.846286702490560), FRAC_CONST(0.532727713928659) },
- { FRAC_CONST(0.844648334111418), FRAC_CONST(0.535321577822907) },
- { FRAC_CONST(0.843002015580473), FRAC_CONST(0.537910403066589) },
- { FRAC_CONST(0.841347762393502), FRAC_CONST(0.540494165292695) },
- { FRAC_CONST(0.839685590120966), FRAC_CONST(0.543072840181872) },
- { FRAC_CONST(0.838015514407864), FRAC_CONST(0.545646403462649) },
- { FRAC_CONST(0.836337550973584), FRAC_CONST(0.548214830911668) },
- { FRAC_CONST(0.834651715611756), FRAC_CONST(0.550778098353912) },
- { FRAC_CONST(0.832958024190107), FRAC_CONST(0.553336181662932) },
- { FRAC_CONST(0.831256492650303), FRAC_CONST(0.555889056761074) },
- { FRAC_CONST(0.829547137007809), FRAC_CONST(0.558436699619704) },
- { FRAC_CONST(0.827829973351730), FRAC_CONST(0.560979086259438) },
- { FRAC_CONST(0.826105017844665), FRAC_CONST(0.563516192750365) },
- { FRAC_CONST(0.824372286722551), FRAC_CONST(0.566047995212271) },
- { FRAC_CONST(0.822631796294515), FRAC_CONST(0.568574469814869) },
- { FRAC_CONST(0.820883562942715), FRAC_CONST(0.571095592778017) },
- { FRAC_CONST(0.819127603122188), FRAC_CONST(0.573611340371945) },
- { FRAC_CONST(0.817363933360698), FRAC_CONST(0.576121688917478) },
- { FRAC_CONST(0.815592570258577), FRAC_CONST(0.578626614786261) },
- { FRAC_CONST(0.813813530488567), FRAC_CONST(0.581126094400978) },
- { FRAC_CONST(0.812026830795670), FRAC_CONST(0.583620104235573) },
- { FRAC_CONST(0.810232487996982), FRAC_CONST(0.586108620815476) },
- { FRAC_CONST(0.808430518981543), FRAC_CONST(0.588591620717823) },
- { FRAC_CONST(0.806620940710170), FRAC_CONST(0.591069080571671) },
- { FRAC_CONST(0.804803770215303), FRAC_CONST(0.593540977058226) },
- { FRAC_CONST(0.802979024600843), FRAC_CONST(0.596007286911057) },
- { FRAC_CONST(0.801146721041991), FRAC_CONST(0.598467986916314) },
- { FRAC_CONST(0.799306876785086), FRAC_CONST(0.600923053912954) },
- { FRAC_CONST(0.797459509147442), FRAC_CONST(0.603372464792950) },
- { FRAC_CONST(0.795604635517188), FRAC_CONST(0.605816196501515) },
- { FRAC_CONST(0.793742273353100), FRAC_CONST(0.608254226037314) },
- { FRAC_CONST(0.791872440184440), FRAC_CONST(0.610686530452686) },
- { FRAC_CONST(0.789995153610791), FRAC_CONST(0.613113086853855) },
- { FRAC_CONST(0.788110431301888), FRAC_CONST(0.615533872401147) },
- { FRAC_CONST(0.786218290997456), FRAC_CONST(0.617948864309208) },
- { FRAC_CONST(0.784318750507039), FRAC_CONST(0.620358039847214) },
- { FRAC_CONST(0.782411827709837), FRAC_CONST(0.622761376339086) },
- { FRAC_CONST(0.780497540554532), FRAC_CONST(0.625158851163708) },
- { FRAC_CONST(0.778575907059125), FRAC_CONST(0.627550441755132) },
- { FRAC_CONST(0.776646945310762), FRAC_CONST(0.629936125602796) },
- { FRAC_CONST(0.774710673465566), FRAC_CONST(0.632315880251738) },
- { FRAC_CONST(0.772767109748464), FRAC_CONST(0.634689683302798) },
- { FRAC_CONST(0.770816272453019), FRAC_CONST(0.637057512412839) },
- { FRAC_CONST(0.768858179941253), FRAC_CONST(0.639419345294951) },
- { FRAC_CONST(0.766892850643481), FRAC_CONST(0.641775159718664) },
- { FRAC_CONST(0.764920303058128), FRAC_CONST(0.644124933510155) },
- { FRAC_CONST(0.762940555751566), FRAC_CONST(0.646468644552458) },
- { FRAC_CONST(0.760953627357928), FRAC_CONST(0.648806270785673) },
- { FRAC_CONST(0.758959536578942), FRAC_CONST(0.651137790207170) },
- { FRAC_CONST(0.756958302183750), FRAC_CONST(0.653463180871802) },
- { FRAC_CONST(0.754949943008733), FRAC_CONST(0.655782420892106) },
- { FRAC_CONST(0.752934477957330), FRAC_CONST(0.658095488438511) },
- { FRAC_CONST(0.750911925999868), FRAC_CONST(0.660402361739545) },
- { FRAC_CONST(0.748882306173375), FRAC_CONST(0.662703019082037) },
- { FRAC_CONST(0.746845637581407), FRAC_CONST(0.664997438811325) },
- { FRAC_CONST(0.744801939393863), FRAC_CONST(0.667285599331456) },
- { FRAC_CONST(0.742751230846809), FRAC_CONST(0.669567479105392) },
- { FRAC_CONST(0.740693531242296), FRAC_CONST(0.671843056655212) },
- { FRAC_CONST(0.738628859948175), FRAC_CONST(0.674112310562312) },
- { FRAC_CONST(0.736557236397919), FRAC_CONST(0.676375219467612) },
- { FRAC_CONST(0.734478680090438), FRAC_CONST(0.678631762071749) },
- { FRAC_CONST(0.732393210589896), FRAC_CONST(0.680881917135287) },
- { FRAC_CONST(0.730300847525525), FRAC_CONST(0.683125663478909) },
- { FRAC_CONST(0.728201610591445), FRAC_CONST(0.685362979983619) },
- { FRAC_CONST(0.726095519546471), FRAC_CONST(0.687593845590942) },
- { FRAC_CONST(0.723982594213936), FRAC_CONST(0.689818239303122) },
- { FRAC_CONST(0.721862854481496), FRAC_CONST(0.692036140183319) },
- { FRAC_CONST(0.719736320300951), FRAC_CONST(0.694247527355803) },
- { FRAC_CONST(0.717603011688049), FRAC_CONST(0.696452380006158) },
- { FRAC_CONST(0.715462948722304), FRAC_CONST(0.698650677381469) },
- { FRAC_CONST(0.713316151546803), FRAC_CONST(0.700842398790526) },
- { FRAC_CONST(0.711162640368018), FRAC_CONST(0.703027523604011) },
- { FRAC_CONST(0.709002435455618), FRAC_CONST(0.705206031254698) },
- { FRAC_CONST(0.706835557142274), FRAC_CONST(0.707377901237642) },
- { FRAC_CONST(0.704662025823469), FRAC_CONST(0.709543113110377) },
- { FRAC_CONST(0.702481861957308), FRAC_CONST(0.711701646493103) },
- { FRAC_CONST(0.700295086064324), FRAC_CONST(0.713853481068882) },
- { FRAC_CONST(0.698101718727284), FRAC_CONST(0.715998596583829) },
- { FRAC_CONST(0.695901780590997), FRAC_CONST(0.718136972847297) },
- { FRAC_CONST(0.693695292362118), FRAC_CONST(0.720268589732077) },
- { FRAC_CONST(0.691482274808956), FRAC_CONST(0.722393427174578) },
- { FRAC_CONST(0.689262748761273), FRAC_CONST(0.724511465175020) },
- { FRAC_CONST(0.687036735110096), FRAC_CONST(0.726622683797623) },
- { FRAC_CONST(0.684804254807511), FRAC_CONST(0.728727063170794) },
- { FRAC_CONST(0.682565328866473), FRAC_CONST(0.730824583487312) },
- { FRAC_CONST(0.680319978360607), FRAC_CONST(0.732915225004518) },
- { FRAC_CONST(0.678068224424007), FRAC_CONST(0.734998968044497) },
- { FRAC_CONST(0.675810088251037), FRAC_CONST(0.737075792994266) },
- { FRAC_CONST(0.673545591096136), FRAC_CONST(0.739145680305957) },
- { FRAC_CONST(0.671274754273613), FRAC_CONST(0.741208610497004) },
- { FRAC_CONST(0.668997599157450), FRAC_CONST(0.743264564150321) },
- { FRAC_CONST(0.666714147181098), FRAC_CONST(0.745313521914490) },
- { FRAC_CONST(0.664424419837275), FRAC_CONST(0.747355464503940) },
- { FRAC_CONST(0.662128438677769), FRAC_CONST(0.749390372699130) },
- { FRAC_CONST(0.659826225313227), FRAC_CONST(0.751418227346727) },
- { FRAC_CONST(0.657517801412960), FRAC_CONST(0.753439009359794) },
- { FRAC_CONST(0.655203188704732), FRAC_CONST(0.755452699717958) },
- { FRAC_CONST(0.652882408974559), FRAC_CONST(0.757459279467601) },
- { FRAC_CONST(0.650555484066504), FRAC_CONST(0.759458729722028) },
- { FRAC_CONST(0.648222435882470), FRAC_CONST(0.761451031661654) },
- { FRAC_CONST(0.645883286381996), FRAC_CONST(0.763436166534172) },
- { FRAC_CONST(0.643538057582048), FRAC_CONST(0.765414115654738) },
- { FRAC_CONST(0.641186771556811), FRAC_CONST(0.767384860406142) },
- { FRAC_CONST(0.638829450437486), FRAC_CONST(0.769348382238982) },
- { FRAC_CONST(0.636466116412077), FRAC_CONST(0.771304662671845) },
- { FRAC_CONST(0.634096791725184), FRAC_CONST(0.773253683291473) },
- { FRAC_CONST(0.631721498677792), FRAC_CONST(0.775195425752941) },
- { FRAC_CONST(0.629340259627066), FRAC_CONST(0.777129871779832) },
- { FRAC_CONST(0.626953096986133), FRAC_CONST(0.779057003164401) },
- { FRAC_CONST(0.624560033223877), FRAC_CONST(0.780976801767754) },
- { FRAC_CONST(0.622161090864727), FRAC_CONST(0.782889249520015) },
- { FRAC_CONST(0.619756292488441), FRAC_CONST(0.784794328420499) },
- { FRAC_CONST(0.617345660729897), FRAC_CONST(0.786692020537877) },
- { FRAC_CONST(0.614929218278880), FRAC_CONST(0.788582308010347) },
- { FRAC_CONST(0.612506987879866), FRAC_CONST(0.790465173045805) },
- { FRAC_CONST(0.610078992331810), FRAC_CONST(0.792340597922007) },
- { FRAC_CONST(0.607645254487931), FRAC_CONST(0.794208564986741) },
- { FRAC_CONST(0.605205797255497), FRAC_CONST(0.796069056657988) },
- { FRAC_CONST(0.602760643595607), FRAC_CONST(0.797922055424093) },
- { FRAC_CONST(0.600309816522980), FRAC_CONST(0.799767543843926) },
- { FRAC_CONST(0.597853339105734), FRAC_CONST(0.801605504547046) },
- { FRAC_CONST(0.595391234465169), FRAC_CONST(0.803435920233868) },
- { FRAC_CONST(0.592923525775551), FRAC_CONST(0.805258773675822) },
- { FRAC_CONST(0.590450236263896), FRAC_CONST(0.807074047715518) },
- { FRAC_CONST(0.587971389209745), FRAC_CONST(0.808881725266904) },
- { FRAC_CONST(0.585487007944951), FRAC_CONST(0.810681789315431) },
- { FRAC_CONST(0.582997115853458), FRAC_CONST(0.812474222918210) },
- { FRAC_CONST(0.580501736371077), FRAC_CONST(0.814259009204175) },
- { FRAC_CONST(0.578000892985270), FRAC_CONST(0.816036131374237) },
- { FRAC_CONST(0.575494609234928), FRAC_CONST(0.817805572701444) },
- { FRAC_CONST(0.572982908710149), FRAC_CONST(0.819567316531142) },
- { FRAC_CONST(0.570465815052013), FRAC_CONST(0.821321346281127) },
- { FRAC_CONST(0.567943351952366), FRAC_CONST(0.823067645441802) },
- { FRAC_CONST(0.565415543153590), FRAC_CONST(0.824806197576334) },
- { FRAC_CONST(0.562882412448385), FRAC_CONST(0.826536986320810) },
- { FRAC_CONST(0.560343983679541), FRAC_CONST(0.828259995384386) },
- { FRAC_CONST(0.557800280739717), FRAC_CONST(0.829975208549444) },
- { FRAC_CONST(0.555251327571214), FRAC_CONST(0.831682609671745) },
- { FRAC_CONST(0.552697148165750), FRAC_CONST(0.833382182680580) },
- { FRAC_CONST(0.550137766564234), FRAC_CONST(0.835073911578919) },
- { FRAC_CONST(0.547573206856540), FRAC_CONST(0.836757780443567) },
- { FRAC_CONST(0.545003493181281), FRAC_CONST(0.838433773425308) },
- { FRAC_CONST(0.542428649725581), FRAC_CONST(0.840101874749058) },
- { FRAC_CONST(0.539848700724848), FRAC_CONST(0.841762068714012) },
- { FRAC_CONST(0.537263670462543), FRAC_CONST(0.843414339693793) },
- { FRAC_CONST(0.534673583269956), FRAC_CONST(0.845058672136595) },
- { FRAC_CONST(0.532078463525974), FRAC_CONST(0.846695050565337) },
- { FRAC_CONST(0.529478335656852), FRAC_CONST(0.848323459577802) },
- { FRAC_CONST(0.526873224135985), FRAC_CONST(0.849943883846782) },
- { FRAC_CONST(0.524263153483673), FRAC_CONST(0.851556308120229) },
- { FRAC_CONST(0.521648148266897), FRAC_CONST(0.853160717221390) },
- { FRAC_CONST(0.519028233099081), FRAC_CONST(0.854757096048957) },
- { FRAC_CONST(0.516403432639864), FRAC_CONST(0.856345429577204) },
- { FRAC_CONST(0.513773771594868), FRAC_CONST(0.857925702856130) },
- { FRAC_CONST(0.511139274715464), FRAC_CONST(0.859497901011602) },
- { FRAC_CONST(0.508499966798541), FRAC_CONST(0.861062009245491) },
- { FRAC_CONST(0.505855872686269), FRAC_CONST(0.862618012835817) },
- { FRAC_CONST(0.503207017265869), FRAC_CONST(0.864165897136879) },
- { FRAC_CONST(0.500553425469378), FRAC_CONST(0.865705647579402) },
- { FRAC_CONST(0.497895122273411), FRAC_CONST(0.867237249670668) },
- { FRAC_CONST(0.495232132698931), FRAC_CONST(0.868760688994655) },
- { FRAC_CONST(0.492564481811011), FRAC_CONST(0.870275951212172) },
- { FRAC_CONST(0.489892194718595), FRAC_CONST(0.871783022060993) },
- { FRAC_CONST(0.487215296574269), FRAC_CONST(0.873281887355994) },
- { FRAC_CONST(0.484533812574016), FRAC_CONST(0.874772532989284) },
- { FRAC_CONST(0.481847767956986), FRAC_CONST(0.876254944930338) },
- { FRAC_CONST(0.479157188005253), FRAC_CONST(0.877729109226132) },
- { FRAC_CONST(0.476462098043581), FRAC_CONST(0.879195012001267) },
- { FRAC_CONST(0.473762523439183), FRAC_CONST(0.880652639458111) },
- { FRAC_CONST(0.471058489601483), FRAC_CONST(0.882101977876918) },
- { FRAC_CONST(0.468350021981877), FRAC_CONST(0.883543013615962) },
- { FRAC_CONST(0.465637146073494), FRAC_CONST(0.884975733111667) },
- { FRAC_CONST(0.462919887410955), FRAC_CONST(0.886400122878730) },
- { FRAC_CONST(0.460198271570134), FRAC_CONST(0.887816169510255) },
- { FRAC_CONST(0.457472324167916), FRAC_CONST(0.889223859677868) },
- { FRAC_CONST(0.454742070861955), FRAC_CONST(0.890623180131856) },
- { FRAC_CONST(0.452007537350437), FRAC_CONST(0.892014117701280) },
- { FRAC_CONST(0.449268749371830), FRAC_CONST(0.893396659294108) },
- { FRAC_CONST(0.446525732704651), FRAC_CONST(0.894770791897330) },
- { FRAC_CONST(0.443778513167218), FRAC_CONST(0.896136502577087) },
- { FRAC_CONST(0.441027116617407), FRAC_CONST(0.897493778478790) },
- { FRAC_CONST(0.438271568952410), FRAC_CONST(0.898842606827242) },
- { FRAC_CONST(0.435511896108492), FRAC_CONST(0.900182974926757) },
- { FRAC_CONST(0.432748124060744), FRAC_CONST(0.901514870161279) },
- { FRAC_CONST(0.429980278822841), FRAC_CONST(0.902838279994503) },
- { FRAC_CONST(0.427208386446796), FRAC_CONST(0.904153191969992) },
- { FRAC_CONST(0.424432473022717), FRAC_CONST(0.905459593711293) },
- { FRAC_CONST(0.421652564678558), FRAC_CONST(0.906757472922057) },
- { FRAC_CONST(0.418868687579875), FRAC_CONST(0.908046817386148) },
- { FRAC_CONST(0.416080867929579), FRAC_CONST(0.909327614967767) },
- { FRAC_CONST(0.413289131967691), FRAC_CONST(0.910599853611559) },
- { FRAC_CONST(0.410493505971093), FRAC_CONST(0.911863521342729) },
- { FRAC_CONST(0.407694016253280), FRAC_CONST(0.913118606267154) },
- { FRAC_CONST(0.404890689164118), FRAC_CONST(0.914365096571498) },
- { FRAC_CONST(0.402083551089587), FRAC_CONST(0.915602980523320) },
- { FRAC_CONST(0.399272628451541), FRAC_CONST(0.916832246471184) },
- { FRAC_CONST(0.396457947707454), FRAC_CONST(0.918052882844770) },
- { FRAC_CONST(0.393639535350173), FRAC_CONST(0.919264878154985) },
- { FRAC_CONST(0.390817417907669), FRAC_CONST(0.920468220994067) },
- { FRAC_CONST(0.387991621942785), FRAC_CONST(0.921662900035695) },
- { FRAC_CONST(0.385162174052990), FRAC_CONST(0.922848904035094) },
- { FRAC_CONST(0.382329100870125), FRAC_CONST(0.924026221829144) },
- { FRAC_CONST(0.379492429060153), FRAC_CONST(0.925194842336480) },
- { FRAC_CONST(0.376652185322910), FRAC_CONST(0.926354754557603) },
- { FRAC_CONST(0.373808396391851), FRAC_CONST(0.927505947574975) },
- { FRAC_CONST(0.370961089033802), FRAC_CONST(0.928648410553131) },
- { FRAC_CONST(0.368110290048703), FRAC_CONST(0.929782132738772) },
- { FRAC_CONST(0.365256026269360), FRAC_CONST(0.930907103460875) },
- { FRAC_CONST(0.362398324561191), FRAC_CONST(0.932023312130786) },
- { FRAC_CONST(0.359537211821973), FRAC_CONST(0.933130748242325) },
- { FRAC_CONST(0.356672714981588), FRAC_CONST(0.934229401371881) },
- { FRAC_CONST(0.353804861001772), FRAC_CONST(0.935319261178512) },
- { FRAC_CONST(0.350933676875858), FRAC_CONST(0.936400317404042) },
- { FRAC_CONST(0.348059189628526), FRAC_CONST(0.937472559873159) },
- { FRAC_CONST(0.345181426315543), FRAC_CONST(0.938535978493509) },
- { FRAC_CONST(0.342300414023514), FRAC_CONST(0.939590563255789) },
- { FRAC_CONST(0.339416179869623), FRAC_CONST(0.940636304233848) },
- { FRAC_CONST(0.336528751001382), FRAC_CONST(0.941673191584771) },
- { FRAC_CONST(0.333638154596371), FRAC_CONST(0.942701215548982) },
- { FRAC_CONST(0.330744417861983), FRAC_CONST(0.943720366450326) },
- { FRAC_CONST(0.327847568035171), FRAC_CONST(0.944730634696168) },
- { FRAC_CONST(0.324947632382188), FRAC_CONST(0.945732010777477) },
- { FRAC_CONST(0.322044638198335), FRAC_CONST(0.946724485268921) },
- { FRAC_CONST(0.319138612807696), FRAC_CONST(0.947708048828952) },
- { FRAC_CONST(0.316229583562890), FRAC_CONST(0.948682692199895) },
- { FRAC_CONST(0.313317577844809), FRAC_CONST(0.949648406208035) },
- { FRAC_CONST(0.310402623062359), FRAC_CONST(0.950605181763705) },
- { FRAC_CONST(0.307484746652204), FRAC_CONST(0.951553009861369) },
- { FRAC_CONST(0.304563976078509), FRAC_CONST(0.952491881579706) },
- { FRAC_CONST(0.301640338832679), FRAC_CONST(0.953421788081700) },
- { FRAC_CONST(0.298713862433100), FRAC_CONST(0.954342720614716) },
- { FRAC_CONST(0.295784574424884), FRAC_CONST(0.955254670510587) },
- { FRAC_CONST(0.292852502379605), FRAC_CONST(0.956157629185692) },
- { FRAC_CONST(0.289917673895041), FRAC_CONST(0.957051588141041) },
- { FRAC_CONST(0.286980116594916), FRAC_CONST(0.957936538962351) },
- { FRAC_CONST(0.284039858128637), FRAC_CONST(0.958812473320129) },
- { FRAC_CONST(0.281096926171038), FRAC_CONST(0.959679382969747) },
- { FRAC_CONST(0.278151348422115), FRAC_CONST(0.960537259751520) },
- { FRAC_CONST(0.275203152606767), FRAC_CONST(0.961386095590786) },
- { FRAC_CONST(0.272252366474537), FRAC_CONST(0.962225882497979) },
- { FRAC_CONST(0.269299017799346), FRAC_CONST(0.963056612568704) },
- { FRAC_CONST(0.266343134379238), FRAC_CONST(0.963878277983814) },
- { FRAC_CONST(0.263384744036113), FRAC_CONST(0.964690871009481) },
- { FRAC_CONST(0.260423874615468), FRAC_CONST(0.965494383997270) },
- { FRAC_CONST(0.257460553986133), FRAC_CONST(0.966288809384210) },
- { FRAC_CONST(0.254494810040011), FRAC_CONST(0.967074139692867) },
- { FRAC_CONST(0.251526670691813), FRAC_CONST(0.967850367531414) },
- { FRAC_CONST(0.248556163878797), FRAC_CONST(0.968617485593698) },
- { FRAC_CONST(0.245583317560504), FRAC_CONST(0.969375486659311) },
- { FRAC_CONST(0.242608159718497), FRAC_CONST(0.970124363593660) },
- { FRAC_CONST(0.239630718356094), FRAC_CONST(0.970864109348029) },
- { FRAC_CONST(0.236651021498106), FRAC_CONST(0.971594716959650) },
- { FRAC_CONST(0.233669097190577), FRAC_CONST(0.972316179551765) },
- { FRAC_CONST(0.230684973500512), FRAC_CONST(0.973028490333694) },
- { FRAC_CONST(0.227698678515621), FRAC_CONST(0.973731642600896) },
- { FRAC_CONST(0.224710240344050), FRAC_CONST(0.974425629735035) },
- { FRAC_CONST(0.221719687114115), FRAC_CONST(0.975110445204039) },
- { FRAC_CONST(0.218727046974045), FRAC_CONST(0.975786082562164) },
- { FRAC_CONST(0.215732348091706), FRAC_CONST(0.976452535450054) },
- { FRAC_CONST(0.212735618654346), FRAC_CONST(0.977109797594801) },
- { FRAC_CONST(0.209736886868323), FRAC_CONST(0.977757862810003) },
- { FRAC_CONST(0.206736180958844), FRAC_CONST(0.978396724995823) },
- { FRAC_CONST(0.203733529169694), FRAC_CONST(0.979026378139048) },
- { FRAC_CONST(0.200728959762976), FRAC_CONST(0.979646816313141) },
- { FRAC_CONST(0.197722501018842), FRAC_CONST(0.980258033678304) },
- { FRAC_CONST(0.194714181235226), FRAC_CONST(0.980860024481524) },
- { FRAC_CONST(0.191704028727580), FRAC_CONST(0.981452783056636) },
- { FRAC_CONST(0.188692071828605), FRAC_CONST(0.982036303824369) },
- { FRAC_CONST(0.185678338887988), FRAC_CONST(0.982610581292405) },
- { FRAC_CONST(0.182662858272129), FRAC_CONST(0.983175610055424) },
- { FRAC_CONST(0.179645658363882), FRAC_CONST(0.983731384795162) },
- { FRAC_CONST(0.176626767562281), FRAC_CONST(0.984277900280454) },
- { FRAC_CONST(0.173606214282275), FRAC_CONST(0.984815151367289) },
- { FRAC_CONST(0.170584026954464), FRAC_CONST(0.985343132998855) },
- { FRAC_CONST(0.167560234024824), FRAC_CONST(0.985861840205587) },
- { FRAC_CONST(0.164534863954446), FRAC_CONST(0.986371268105216) },
- { FRAC_CONST(0.161507945219266), FRAC_CONST(0.986871411902812) },
- { FRAC_CONST(0.158479506309796), FRAC_CONST(0.987362266890832) },
- { FRAC_CONST(0.155449575730856), FRAC_CONST(0.987843828449162) },
- { FRAC_CONST(0.152418182001307), FRAC_CONST(0.988316092045160) },
- { FRAC_CONST(0.149385353653780), FRAC_CONST(0.988779053233702) },
- { FRAC_CONST(0.146351119234411), FRAC_CONST(0.989232707657220) },
- { FRAC_CONST(0.143315507302572), FRAC_CONST(0.989677051045747) },
- { FRAC_CONST(0.140278546430595), FRAC_CONST(0.990112079216954) },
- { FRAC_CONST(0.137240265203516), FRAC_CONST(0.990537788076189) },
- { FRAC_CONST(0.134200692218792), FRAC_CONST(0.990954173616519) },
- { FRAC_CONST(0.131159856086043), FRAC_CONST(0.991361231918763) },
- { FRAC_CONST(0.128117785426777), FRAC_CONST(0.991758959151536) },
- { FRAC_CONST(0.125074508874121), FRAC_CONST(0.992147351571276) },
- { FRAC_CONST(0.122030055072553), FRAC_CONST(0.992526405522286) },
- { FRAC_CONST(0.118984452677633), FRAC_CONST(0.992896117436766) },
- { FRAC_CONST(0.115937730355728), FRAC_CONST(0.993256483834846) },
- { FRAC_CONST(0.112889916783750), FRAC_CONST(0.993607501324622) },
- { FRAC_CONST(0.109841040648883), FRAC_CONST(0.993949166602181) },
- { FRAC_CONST(0.106791130648307), FRAC_CONST(0.994281476451642) },
- { FRAC_CONST(0.103740215488939), FRAC_CONST(0.994604427745176) },
- { FRAC_CONST(0.100688323887154), FRAC_CONST(0.994918017443043) },
- { FRAC_CONST(0.097635484568517), FRAC_CONST(0.995222242593618) },
- { FRAC_CONST(0.094581726267515), FRAC_CONST(0.995517100333418) },
- { FRAC_CONST(0.091527077727285), FRAC_CONST(0.995802587887129) },
- { FRAC_CONST(0.088471567699341), FRAC_CONST(0.996078702567634) },
- { FRAC_CONST(0.085415224943307), FRAC_CONST(0.996345441776036) },
- { FRAC_CONST(0.082358078226647), FRAC_CONST(0.996602803001684) },
- { FRAC_CONST(0.079300156324388), FRAC_CONST(0.996850783822197) },
- { FRAC_CONST(0.076241488018856), FRAC_CONST(0.997089381903483) },
- { FRAC_CONST(0.073182102099403), FRAC_CONST(0.997318594999769) },
- { FRAC_CONST(0.070122027362134), FRAC_CONST(0.997538420953611) },
- { FRAC_CONST(0.067061292609637), FRAC_CONST(0.997748857695926) },
- { FRAC_CONST(0.063999926650714), FRAC_CONST(0.997949903246001) },
- { FRAC_CONST(0.060937958300107), FRAC_CONST(0.998141555711521) },
- { FRAC_CONST(0.057875416378229), FRAC_CONST(0.998323813288578) },
- { FRAC_CONST(0.054812329710890), FRAC_CONST(0.998496674261695) },
- { FRAC_CONST(0.051748727129028), FRAC_CONST(0.998660137003838) },
- { FRAC_CONST(0.048684637468439), FRAC_CONST(0.998814199976435) },
- { FRAC_CONST(0.045620089569500), FRAC_CONST(0.998958861729386) },
- { FRAC_CONST(0.042555112276904), FRAC_CONST(0.999094120901079) },
- { FRAC_CONST(0.039489734439384), FRAC_CONST(0.999219976218404) },
- { FRAC_CONST(0.036423984909444), FRAC_CONST(0.999336426496761) },
- { FRAC_CONST(0.033357892543086), FRAC_CONST(0.999443470640078) },
- { FRAC_CONST(0.030291486199539), FRAC_CONST(0.999541107640813) },
- { FRAC_CONST(0.027224794740988), FRAC_CONST(0.999629336579970) },
- { FRAC_CONST(0.024157847032300), FRAC_CONST(0.999708156627105) },
- { FRAC_CONST(0.021090671940755), FRAC_CONST(0.999777567040333) },
- { FRAC_CONST(0.018023298335774), FRAC_CONST(0.999837567166337) },
- { FRAC_CONST(0.014955755088644), FRAC_CONST(0.999888156440373) },
- { FRAC_CONST(0.011888071072252), FRAC_CONST(0.999929334386276) },
- { FRAC_CONST(0.008820275160808), FRAC_CONST(0.999961100616463) },
- { FRAC_CONST(0.005752396229574), FRAC_CONST(0.999983454831938) },
- { FRAC_CONST(0.002684463154596), FRAC_CONST(0.999996396822294) }
-};
-
-/* 64 (N/4) complex twiddle factors */
-ALIGN static const complex_t mdct_tab_256[] =
-{
- { FRAC_CONST(0.999995293809576), FRAC_CONST(0.003067956762966) },
- { FRAC_CONST(0.999618822495179), FRAC_CONST(0.027608145778966) },
- { FRAC_CONST(0.998640218180265), FRAC_CONST(0.052131704680283) },
- { FRAC_CONST(0.997060070339483), FRAC_CONST(0.076623861392031) },
- { FRAC_CONST(0.994879330794806), FRAC_CONST(0.101069862754828) },
- { FRAC_CONST(0.992099313142192), FRAC_CONST(0.125454983411546) },
- { FRAC_CONST(0.988721691960324), FRAC_CONST(0.149764534677322) },
- { FRAC_CONST(0.984748501801904), FRAC_CONST(0.173983873387464) },
- { FRAC_CONST(0.980182135968117), FRAC_CONST(0.198098410717954) },
- { FRAC_CONST(0.975025345066994), FRAC_CONST(0.222093620973204) },
- { FRAC_CONST(0.969281235356549), FRAC_CONST(0.245955050335795) },
- { FRAC_CONST(0.962953266873684), FRAC_CONST(0.269668325572915) },
- { FRAC_CONST(0.956045251349996), FRAC_CONST(0.293219162694259) },
- { FRAC_CONST(0.948561349915730), FRAC_CONST(0.316593375556166) },
- { FRAC_CONST(0.940506070593268), FRAC_CONST(0.339776884406827) },
- { FRAC_CONST(0.931884265581668), FRAC_CONST(0.362755724367397) },
- { FRAC_CONST(0.922701128333879), FRAC_CONST(0.385516053843919) },
- { FRAC_CONST(0.912962190428398), FRAC_CONST(0.408044162864979) },
- { FRAC_CONST(0.902673318237259), FRAC_CONST(0.430326481340083) },
- { FRAC_CONST(0.891840709392343), FRAC_CONST(0.452349587233771) },
- { FRAC_CONST(0.880470889052161), FRAC_CONST(0.474100214650550) },
- { FRAC_CONST(0.868570705971341), FRAC_CONST(0.495565261825773) },
- { FRAC_CONST(0.856147328375194), FRAC_CONST(0.516731799017650) },
- { FRAC_CONST(0.843208239641845), FRAC_CONST(0.537587076295645) },
- { FRAC_CONST(0.829761233794523), FRAC_CONST(0.558118531220556) },
- { FRAC_CONST(0.815814410806734), FRAC_CONST(0.578313796411656) },
- { FRAC_CONST(0.801376171723140), FRAC_CONST(0.598160706996342) },
- { FRAC_CONST(0.786455213599086), FRAC_CONST(0.617647307937804) },
- { FRAC_CONST(0.771060524261814), FRAC_CONST(0.636761861236284) },
- { FRAC_CONST(0.755201376896537), FRAC_CONST(0.655492852999615) },
- { FRAC_CONST(0.738887324460615), FRAC_CONST(0.673829000378756) },
- { FRAC_CONST(0.722128193929215), FRAC_CONST(0.691759258364158) },
- { FRAC_CONST(0.704934080375905), FRAC_CONST(0.709272826438866) },
- { FRAC_CONST(0.687315340891759), FRAC_CONST(0.726359155084346) },
- { FRAC_CONST(0.669282588346636), FRAC_CONST(0.743007952135122) },
- { FRAC_CONST(0.650846684996381), FRAC_CONST(0.759209188978388) },
- { FRAC_CONST(0.632018735939809), FRAC_CONST(0.774953106594874) },
- { FRAC_CONST(0.612810082429410), FRAC_CONST(0.790230221437310) },
- { FRAC_CONST(0.593232295039800), FRAC_CONST(0.805031331142964) },
- { FRAC_CONST(0.573297166698042), FRAC_CONST(0.819347520076797) },
- { FRAC_CONST(0.553016705580028), FRAC_CONST(0.833170164701913) },
- { FRAC_CONST(0.532403127877198), FRAC_CONST(0.846490938774052) },
- { FRAC_CONST(0.511468850437971), FRAC_CONST(0.859301818357008) },
- { FRAC_CONST(0.490226483288291), FRAC_CONST(0.871595086655951) },
- { FRAC_CONST(0.468688822035828), FRAC_CONST(0.883363338665732) },
- { FRAC_CONST(0.446868840162374), FRAC_CONST(0.894599485631383) },
- { FRAC_CONST(0.424779681209109), FRAC_CONST(0.905296759318119) },
- { FRAC_CONST(0.402434650859419), FRAC_CONST(0.915448716088268) },
- { FRAC_CONST(0.379847208924051), FRAC_CONST(0.925049240782678) },
- { FRAC_CONST(0.357030961233430), FRAC_CONST(0.934092550404259) },
- { FRAC_CONST(0.333999651442009), FRAC_CONST(0.942573197601447) },
- { FRAC_CONST(0.310767152749611), FRAC_CONST(0.950486073949482) },
- { FRAC_CONST(0.287347459544730), FRAC_CONST(0.957826413027533) },
- { FRAC_CONST(0.263754678974832), FRAC_CONST(0.964589793289813) },
- { FRAC_CONST(0.240003022448742), FRAC_CONST(0.970772140728950) },
- { FRAC_CONST(0.216106797076220), FRAC_CONST(0.976369731330021) },
- { FRAC_CONST(0.192080397049892), FRAC_CONST(0.981379193313755) },
- { FRAC_CONST(0.167938294974731), FRAC_CONST(0.985797509167567) },
- { FRAC_CONST(0.143695033150295), FRAC_CONST(0.989622017463201) },
- { FRAC_CONST(0.119365214810991), FRAC_CONST(0.992850414459865) },
- { FRAC_CONST(0.094963495329639), FRAC_CONST(0.995480755491927) },
- { FRAC_CONST(0.070504573389614), FRAC_CONST(0.997511456140303) },
- { FRAC_CONST(0.046003182130915), FRAC_CONST(0.998941293186857) },
- { FRAC_CONST(0.021474080275470), FRAC_CONST(0.999769405351215) }
-};
-
-#ifdef LD_DEC
-/* 256 (N/4) complex twiddle factors */
-ALIGN static const complex_t mdct_tab_1024[] =
-{
- { FRAC_CONST(0.999999705862882), FRAC_CONST(0.000766990318743) },
- { FRAC_CONST(0.999976174986898), FRAC_CONST(0.006902858724730) },
- { FRAC_CONST(0.999914995573113), FRAC_CONST(0.013038467241987) },
- { FRAC_CONST(0.999816169924900), FRAC_CONST(0.019173584868323) },
- { FRAC_CONST(0.999679701762988), FRAC_CONST(0.025307980620025) },
- { FRAC_CONST(0.999505596225325), FRAC_CONST(0.031441423540560) },
- { FRAC_CONST(0.999293859866888), FRAC_CONST(0.037573682709270) },
- { FRAC_CONST(0.999044500659429), FRAC_CONST(0.043704527250063) },
- { FRAC_CONST(0.998757527991183), FRAC_CONST(0.049833726340107) },
- { FRAC_CONST(0.998432952666508), FRAC_CONST(0.055961049218521) },
- { FRAC_CONST(0.998070786905482), FRAC_CONST(0.062086265195060) },
- { FRAC_CONST(0.997671044343441), FRAC_CONST(0.068209143658806) },
- { FRAC_CONST(0.997233740030466), FRAC_CONST(0.074329454086846) },
- { FRAC_CONST(0.996758890430818), FRAC_CONST(0.080446966052950) },
- { FRAC_CONST(0.996246513422316), FRAC_CONST(0.086561449236251) },
- { FRAC_CONST(0.995696628295664), FRAC_CONST(0.092672673429913) },
- { FRAC_CONST(0.995109255753726), FRAC_CONST(0.098780408549800) },
- { FRAC_CONST(0.994484417910748), FRAC_CONST(0.104884424643135) },
- { FRAC_CONST(0.993822138291520), FRAC_CONST(0.110984491897163) },
- { FRAC_CONST(0.993122441830496), FRAC_CONST(0.117080380647801) },
- { FRAC_CONST(0.992385354870852), FRAC_CONST(0.123171861388280) },
- { FRAC_CONST(0.991610905163495), FRAC_CONST(0.129258704777796) },
- { FRAC_CONST(0.990799121866020), FRAC_CONST(0.135340681650134) },
- { FRAC_CONST(0.989950035541609), FRAC_CONST(0.141417563022303) },
- { FRAC_CONST(0.989063678157882), FRAC_CONST(0.147489120103154) },
- { FRAC_CONST(0.988140083085693), FRAC_CONST(0.153555124301993) },
- { FRAC_CONST(0.987179285097874), FRAC_CONST(0.159615347237193) },
- { FRAC_CONST(0.986181320367928), FRAC_CONST(0.165669560744784) },
- { FRAC_CONST(0.985146226468662), FRAC_CONST(0.171717536887050) },
- { FRAC_CONST(0.984074042370776), FRAC_CONST(0.177759047961107) },
- { FRAC_CONST(0.982964808441396), FRAC_CONST(0.183793866507478) },
- { FRAC_CONST(0.981818566442553), FRAC_CONST(0.189821765318656) },
- { FRAC_CONST(0.980635359529608), FRAC_CONST(0.195842517447658) },
- { FRAC_CONST(0.979415232249635), FRAC_CONST(0.201855896216568) },
- { FRAC_CONST(0.978158230539735), FRAC_CONST(0.207861675225075) },
- { FRAC_CONST(0.976864401725313), FRAC_CONST(0.213859628358994) },
- { FRAC_CONST(0.975533794518291), FRAC_CONST(0.219849529798779) },
- { FRAC_CONST(0.974166459015280), FRAC_CONST(0.225831154028026) },
- { FRAC_CONST(0.972762446695689), FRAC_CONST(0.231804275841965) },
- { FRAC_CONST(0.971321810419786), FRAC_CONST(0.237768670355934) },
- { FRAC_CONST(0.969844604426715), FRAC_CONST(0.243724113013852) },
- { FRAC_CONST(0.968330884332445), FRAC_CONST(0.249670379596669) },
- { FRAC_CONST(0.966780707127683), FRAC_CONST(0.255607246230807) },
- { FRAC_CONST(0.965194131175725), FRAC_CONST(0.261534489396596) },
- { FRAC_CONST(0.963571216210257), FRAC_CONST(0.267451885936678) },
- { FRAC_CONST(0.961912023333112), FRAC_CONST(0.273359213064419) },
- { FRAC_CONST(0.960216615011963), FRAC_CONST(0.279256248372291) },
- { FRAC_CONST(0.958485055077976), FRAC_CONST(0.285142769840249) },
- { FRAC_CONST(0.956717408723403), FRAC_CONST(0.291018555844085) },
- { FRAC_CONST(0.954913742499131), FRAC_CONST(0.296883385163778) },
- { FRAC_CONST(0.953074124312172), FRAC_CONST(0.302737036991819) },
- { FRAC_CONST(0.951198623423113), FRAC_CONST(0.308579290941525) },
- { FRAC_CONST(0.949287310443502), FRAC_CONST(0.314409927055337) },
- { FRAC_CONST(0.947340257333192), FRAC_CONST(0.320228725813100) },
- { FRAC_CONST(0.945357537397632), FRAC_CONST(0.326035468140330) },
- { FRAC_CONST(0.943339225285108), FRAC_CONST(0.331829935416461) },
- { FRAC_CONST(0.941285396983929), FRAC_CONST(0.337611909483075) },
- { FRAC_CONST(0.939196129819570), FRAC_CONST(0.343381172652115) },
- { FRAC_CONST(0.937071502451759), FRAC_CONST(0.349137507714085) },
- { FRAC_CONST(0.934911594871516), FRAC_CONST(0.354880697946223) },
- { FRAC_CONST(0.932716488398140), FRAC_CONST(0.360610527120662) },
- { FRAC_CONST(0.930486265676150), FRAC_CONST(0.366326779512574) },
- { FRAC_CONST(0.928221010672169), FRAC_CONST(0.372029239908285) },
- { FRAC_CONST(0.925920808671770), FRAC_CONST(0.377717693613386) },
- { FRAC_CONST(0.923585746276257), FRAC_CONST(0.383391926460809) },
- { FRAC_CONST(0.921215911399409), FRAC_CONST(0.389051724818894) },
- { FRAC_CONST(0.918811393264170), FRAC_CONST(0.394696875599434) },
- { FRAC_CONST(0.916372282399289), FRAC_CONST(0.400327166265690) },
- { FRAC_CONST(0.913898670635912), FRAC_CONST(0.405942384840403) },
- { FRAC_CONST(0.911390651104122), FRAC_CONST(0.411542319913765) },
- { FRAC_CONST(0.908848318229439), FRAC_CONST(0.417126760651388) },
- { FRAC_CONST(0.906271767729258), FRAC_CONST(0.422695496802233) },
- { FRAC_CONST(0.903661096609248), FRAC_CONST(0.428248318706532) },
- { FRAC_CONST(0.901016403159702), FRAC_CONST(0.433785017303679) },
- { FRAC_CONST(0.898337786951834), FRAC_CONST(0.439305384140100) },
- { FRAC_CONST(0.895625348834030), FRAC_CONST(0.444809211377105) },
- { FRAC_CONST(0.892879190928052), FRAC_CONST(0.450296291798709) },
- { FRAC_CONST(0.890099416625192), FRAC_CONST(0.455766418819435) },
- { FRAC_CONST(0.887286130582383), FRAC_CONST(0.461219386492092) },
- { FRAC_CONST(0.884439438718254), FRAC_CONST(0.466654989515531) },
- { FRAC_CONST(0.881559448209144), FRAC_CONST(0.472073023242369) },
- { FRAC_CONST(0.878646267485068), FRAC_CONST(0.477473283686698) },
- { FRAC_CONST(0.875700006225635), FRAC_CONST(0.482855567531766) },
- { FRAC_CONST(0.872720775355914), FRAC_CONST(0.488219672137627) },
- { FRAC_CONST(0.869708687042266), FRAC_CONST(0.493565395548775) },
- { FRAC_CONST(0.866663854688111), FRAC_CONST(0.498892536501745) },
- { FRAC_CONST(0.863586392929668), FRAC_CONST(0.504200894432690) },
- { FRAC_CONST(0.860476417631632), FRAC_CONST(0.509490269484936) },
- { FRAC_CONST(0.857334045882816), FRAC_CONST(0.514760462516501) },
- { FRAC_CONST(0.854159395991739), FRAC_CONST(0.520011275107596) },
- { FRAC_CONST(0.850952587482176), FRAC_CONST(0.525242509568095) },
- { FRAC_CONST(0.847713741088654), FRAC_CONST(0.530453968944976) },
- { FRAC_CONST(0.844442978751911), FRAC_CONST(0.535645457029741) },
- { FRAC_CONST(0.841140423614298), FRAC_CONST(0.540816778365797) },
- { FRAC_CONST(0.837806200015151), FRAC_CONST(0.545967738255818) },
- { FRAC_CONST(0.834440433486103), FRAC_CONST(0.551098142769075) },
- { FRAC_CONST(0.831043250746362), FRAC_CONST(0.556207798748740) },
- { FRAC_CONST(0.827614779697938), FRAC_CONST(0.561296513819151) },
- { FRAC_CONST(0.824155149420829), FRAC_CONST(0.566364096393064) },
- { FRAC_CONST(0.820664490168157), FRAC_CONST(0.571410355678857) },
- { FRAC_CONST(0.817142933361273), FRAC_CONST(0.576435101687722) },
- { FRAC_CONST(0.813590611584799), FRAC_CONST(0.581438145240810) },
- { FRAC_CONST(0.810007658581641), FRAC_CONST(0.586419297976361) },
- { FRAC_CONST(0.806394209247956), FRAC_CONST(0.591378372356788) },
- { FRAC_CONST(0.802750399628069), FRAC_CONST(0.596315181675744) },
- { FRAC_CONST(0.799076366909352), FRAC_CONST(0.601229540065149) },
- { FRAC_CONST(0.795372249417061), FRAC_CONST(0.606121262502186) },
- { FRAC_CONST(0.791638186609126), FRAC_CONST(0.610990164816272) },
- { FRAC_CONST(0.787874319070900), FRAC_CONST(0.615836063695985) },
- { FRAC_CONST(0.784080788509870), FRAC_CONST(0.620658776695972) },
- { FRAC_CONST(0.780257737750317), FRAC_CONST(0.625458122243814) },
- { FRAC_CONST(0.776405310727940), FRAC_CONST(0.630233919646864) },
- { FRAC_CONST(0.772523652484441), FRAC_CONST(0.634985989099049) },
- { FRAC_CONST(0.768612909162058), FRAC_CONST(0.639714151687640) },
- { FRAC_CONST(0.764673227998067), FRAC_CONST(0.644418229399988) },
- { FRAC_CONST(0.760704757319237), FRAC_CONST(0.649098045130226) },
- { FRAC_CONST(0.756707646536246), FRAC_CONST(0.653753422685936) },
- { FRAC_CONST(0.752682046138055), FRAC_CONST(0.658384186794785) },
- { FRAC_CONST(0.748628107686245), FRAC_CONST(0.662990163111121) },
- { FRAC_CONST(0.744545983809307), FRAC_CONST(0.667571178222540) },
- { FRAC_CONST(0.740435828196898), FRAC_CONST(0.672127059656412) },
- { FRAC_CONST(0.736297795594053), FRAC_CONST(0.676657635886375) },
- { FRAC_CONST(0.732132041795361), FRAC_CONST(0.681162736338795) },
- { FRAC_CONST(0.727938723639099), FRAC_CONST(0.685642191399187) },
- { FRAC_CONST(0.723717999001324), FRAC_CONST(0.690095832418600) },
- { FRAC_CONST(0.719470026789933), FRAC_CONST(0.694523491719966) },
- { FRAC_CONST(0.715194966938680), FRAC_CONST(0.698925002604414) },
- { FRAC_CONST(0.710892980401152), FRAC_CONST(0.703300199357549) },
- { FRAC_CONST(0.706564229144710), FRAC_CONST(0.707648917255684) },
- { FRAC_CONST(0.702208876144392), FRAC_CONST(0.711970992572050) },
- { FRAC_CONST(0.697827085376777), FRAC_CONST(0.716266262582953) },
- { FRAC_CONST(0.693419021813812), FRAC_CONST(0.720534565573905) },
- { FRAC_CONST(0.688984851416597), FRAC_CONST(0.724775740845711) },
- { FRAC_CONST(0.684524741129142), FRAC_CONST(0.728989628720519) },
- { FRAC_CONST(0.680038858872079), FRAC_CONST(0.733176070547833) },
- { FRAC_CONST(0.675527373536339), FRAC_CONST(0.737334908710483) },
- { FRAC_CONST(0.670990454976794), FRAC_CONST(0.741465986630563) },
- { FRAC_CONST(0.666428274005865), FRAC_CONST(0.745569148775325) },
- { FRAC_CONST(0.661841002387087), FRAC_CONST(0.749644240663033) },
- { FRAC_CONST(0.657228812828643), FRAC_CONST(0.753691108868781) },
- { FRAC_CONST(0.652591878976863), FRAC_CONST(0.757709601030268) },
- { FRAC_CONST(0.647930375409685), FRAC_CONST(0.761699565853535) },
- { FRAC_CONST(0.643244477630086), FRAC_CONST(0.765660853118662) },
- { FRAC_CONST(0.638534362059467), FRAC_CONST(0.769593313685423) },
- { FRAC_CONST(0.633800206031017), FRAC_CONST(0.773496799498899) },
- { FRAC_CONST(0.629042187783036), FRAC_CONST(0.777371163595056) },
- { FRAC_CONST(0.624260486452221), FRAC_CONST(0.781216260106276) },
- { FRAC_CONST(0.619455282066924), FRAC_CONST(0.785031944266848) },
- { FRAC_CONST(0.614626755540375), FRAC_CONST(0.788818072418420) },
- { FRAC_CONST(0.609775088663868), FRAC_CONST(0.792574502015408) },
- { FRAC_CONST(0.604900464099920), FRAC_CONST(0.796301091630359) },
- { FRAC_CONST(0.600003065375389), FRAC_CONST(0.799997700959282) },
- { FRAC_CONST(0.595083076874570), FRAC_CONST(0.803664190826924) },
- { FRAC_CONST(0.590140683832249), FRAC_CONST(0.807300423192014) },
- { FRAC_CONST(0.585176072326730), FRAC_CONST(0.810906261152460) },
- { FRAC_CONST(0.580189429272832), FRAC_CONST(0.814481568950499) },
- { FRAC_CONST(0.575180942414845), FRAC_CONST(0.818026211977813) },
- { FRAC_CONST(0.570150800319470), FRAC_CONST(0.821540056780598) },
- { FRAC_CONST(0.565099192368714), FRAC_CONST(0.825022971064580) },
- { FRAC_CONST(0.560026308752760), FRAC_CONST(0.828474823700007) },
- { FRAC_CONST(0.554932340462810), FRAC_CONST(0.831895484726578) },
- { FRAC_CONST(0.549817479283891), FRAC_CONST(0.835284825358337) },
- { FRAC_CONST(0.544681917787635), FRAC_CONST(0.838642717988527) },
- { FRAC_CONST(0.539525849325029), FRAC_CONST(0.841969036194388) },
- { FRAC_CONST(0.534349468019138), FRAC_CONST(0.845263654741918) },
- { FRAC_CONST(0.529152968757791), FRAC_CONST(0.848526449590593) },
- { FRAC_CONST(0.523936547186249), FRAC_CONST(0.851757297898029) },
- { FRAC_CONST(0.518700399699835), FRAC_CONST(0.854956078024615) },
- { FRAC_CONST(0.513444723436544), FRAC_CONST(0.858122669538086) },
- { FRAC_CONST(0.508169716269615), FRAC_CONST(0.861256953218062) },
- { FRAC_CONST(0.502875576800087), FRAC_CONST(0.864358811060534) },
- { FRAC_CONST(0.497562504349319), FRAC_CONST(0.867428126282307) },
- { FRAC_CONST(0.492230698951486), FRAC_CONST(0.870464783325398) },
- { FRAC_CONST(0.486880361346047), FRAC_CONST(0.873468667861385) },
- { FRAC_CONST(0.481511692970190), FRAC_CONST(0.876439666795714) },
- { FRAC_CONST(0.476124895951244), FRAC_CONST(0.879377668271953) },
- { FRAC_CONST(0.470720173099072), FRAC_CONST(0.882282561676009) },
- { FRAC_CONST(0.465297727898435), FRAC_CONST(0.885154237640285) },
- { FRAC_CONST(0.459857764501330), FRAC_CONST(0.887992588047806) },
- { FRAC_CONST(0.454400487719304), FRAC_CONST(0.890797506036281) },
- { FRAC_CONST(0.448926103015743), FRAC_CONST(0.893568886002136) },
- { FRAC_CONST(0.443434816498138), FRAC_CONST(0.896306623604480) },
- { FRAC_CONST(0.437926834910323), FRAC_CONST(0.899010615769039) },
- { FRAC_CONST(0.432402365624690), FRAC_CONST(0.901680760692038) },
- { FRAC_CONST(0.426861616634386), FRAC_CONST(0.904316957844028) },
- { FRAC_CONST(0.421304796545480), FRAC_CONST(0.906919107973678) },
- { FRAC_CONST(0.415732114569105), FRAC_CONST(0.909487113111505) },
- { FRAC_CONST(0.410143780513590), FRAC_CONST(0.912020876573568) },
- { FRAC_CONST(0.404540004776553), FRAC_CONST(0.914520302965104) },
- { FRAC_CONST(0.398920998336983), FRAC_CONST(0.916985298184123) },
- { FRAC_CONST(0.393286972747297), FRAC_CONST(0.919415769424947) },
- { FRAC_CONST(0.387638140125373), FRAC_CONST(0.921811625181708) },
- { FRAC_CONST(0.381974713146567), FRAC_CONST(0.924172775251791) },
- { FRAC_CONST(0.376296905035705), FRAC_CONST(0.926499130739231) },
- { FRAC_CONST(0.370604929559052), FRAC_CONST(0.928790604058057) },
- { FRAC_CONST(0.364899001016267), FRAC_CONST(0.931047108935595) },
- { FRAC_CONST(0.359179334232337), FRAC_CONST(0.933268560415712) },
- { FRAC_CONST(0.353446144549481), FRAC_CONST(0.935454874862015) },
- { FRAC_CONST(0.347699647819051), FRAC_CONST(0.937605969961000) },
- { FRAC_CONST(0.341940060393402), FRAC_CONST(0.939721764725153) },
- { FRAC_CONST(0.336167599117745), FRAC_CONST(0.941802179495998) },
- { FRAC_CONST(0.330382481321983), FRAC_CONST(0.943847135947093) },
- { FRAC_CONST(0.324584924812532), FRAC_CONST(0.945856557086984) },
- { FRAC_CONST(0.318775147864118), FRAC_CONST(0.947830367262101) },
- { FRAC_CONST(0.312953369211560), FRAC_CONST(0.949768492159607) },
- { FRAC_CONST(0.307119808041533), FRAC_CONST(0.951670858810194) },
- { FRAC_CONST(0.301274683984318), FRAC_CONST(0.953537395590833) },
- { FRAC_CONST(0.295418217105532), FRAC_CONST(0.955368032227470) },
- { FRAC_CONST(0.289550627897843), FRAC_CONST(0.957162699797670) },
- { FRAC_CONST(0.283672137272669), FRAC_CONST(0.958921330733213) },
- { FRAC_CONST(0.277782966551858), FRAC_CONST(0.960643858822638) },
- { FRAC_CONST(0.271883337459360), FRAC_CONST(0.962330219213737) },
- { FRAC_CONST(0.265973472112876), FRAC_CONST(0.963980348415994) },
- { FRAC_CONST(0.260053593015495), FRAC_CONST(0.965594184302977) },
- { FRAC_CONST(0.254123923047321), FRAC_CONST(0.967171666114677) },
- { FRAC_CONST(0.248184685457075), FRAC_CONST(0.968712734459795) },
- { FRAC_CONST(0.242236103853696), FRAC_CONST(0.970217331317979) },
- { FRAC_CONST(0.236278402197920), FRAC_CONST(0.971685400042009) },
- { FRAC_CONST(0.230311804793846), FRAC_CONST(0.973116885359925) },
- { FRAC_CONST(0.224336536280494), FRAC_CONST(0.974511733377116) },
- { FRAC_CONST(0.218352821623346), FRAC_CONST(0.975869891578341) },
- { FRAC_CONST(0.212360886105879), FRAC_CONST(0.977191308829712) },
- { FRAC_CONST(0.206360955321076), FRAC_CONST(0.978475935380617) },
- { FRAC_CONST(0.200353255162940), FRAC_CONST(0.979723722865591) },
- { FRAC_CONST(0.194338011817989), FRAC_CONST(0.980934624306142) },
- { FRAC_CONST(0.188315451756732), FRAC_CONST(0.982108594112514) },
- { FRAC_CONST(0.182285801725153), FRAC_CONST(0.983245588085407) },
- { FRAC_CONST(0.176249288736168), FRAC_CONST(0.984345563417642) },
- { FRAC_CONST(0.170206140061078), FRAC_CONST(0.985408478695768) },
- { FRAC_CONST(0.164156583221016), FRAC_CONST(0.986434293901627) },
- { FRAC_CONST(0.158100845978377), FRAC_CONST(0.987422970413855) },
- { FRAC_CONST(0.152039156328246), FRAC_CONST(0.988374471009341) },
- { FRAC_CONST(0.145971742489812), FRAC_CONST(0.989288759864625) },
- { FRAC_CONST(0.139898832897777), FRAC_CONST(0.990165802557248) },
- { FRAC_CONST(0.133820656193755), FRAC_CONST(0.991005566067049) },
- { FRAC_CONST(0.127737441217662), FRAC_CONST(0.991808018777406) },
- { FRAC_CONST(0.121649416999106), FRAC_CONST(0.992573130476429) },
- { FRAC_CONST(0.115556812748755), FRAC_CONST(0.993300872358093) },
- { FRAC_CONST(0.109459857849718), FRAC_CONST(0.993991217023329) },
- { FRAC_CONST(0.103358781848900), FRAC_CONST(0.994644138481051) },
- { FRAC_CONST(0.097253814448363), FRAC_CONST(0.995259612149133) },
- { FRAC_CONST(0.091145185496681), FRAC_CONST(0.995837614855342) },
- { FRAC_CONST(0.085033124980280), FRAC_CONST(0.996378124838200) },
- { FRAC_CONST(0.078917863014785), FRAC_CONST(0.996881121747814) },
- { FRAC_CONST(0.072799629836352), FRAC_CONST(0.997346586646633) },
- { FRAC_CONST(0.066678655793002), FRAC_CONST(0.997774502010168) },
- { FRAC_CONST(0.060555171335948), FRAC_CONST(0.998164851727646) },
- { FRAC_CONST(0.054429407010919), FRAC_CONST(0.998517621102622) },
- { FRAC_CONST(0.048301593449480), FRAC_CONST(0.998832796853528) },
- { FRAC_CONST(0.042171961360348), FRAC_CONST(0.999110367114175) },
- { FRAC_CONST(0.036040741520706), FRAC_CONST(0.999350321434199) },
- { FRAC_CONST(0.029908164767517), FRAC_CONST(0.999552650779457) },
- { FRAC_CONST(0.023774461988828), FRAC_CONST(0.999717347532362) },
- { FRAC_CONST(0.017639864115082), FRAC_CONST(0.999844405492175) },
- { FRAC_CONST(0.011504602110423), FRAC_CONST(0.999933819875236) },
- { FRAC_CONST(0.005368906963996), FRAC_CONST(0.999985587315143) }
-};
-#endif // LD_DEC
-
-#ifdef ALLOW_SMALL_FRAMELENGTH
-/* 480 (N/4) complex twiddle factors */
-ALIGN static const complex_t mdct_tab_1920[] =
-{
- { FRAC_CONST(0.999999916334328), FRAC_CONST(0.000409061532028) },
- { FRAC_CONST(0.999993223088129), FRAC_CONST(0.003681545574400) },
- { FRAC_CONST(0.999975820717897), FRAC_CONST(0.006953990190376) },
- { FRAC_CONST(0.999947709409999), FRAC_CONST(0.010226360334704) },
- { FRAC_CONST(0.999908889465485), FRAC_CONST(0.013498620962929) },
- { FRAC_CONST(0.999859361300084), FRAC_CONST(0.016770737031768) },
- { FRAC_CONST(0.999799125444203), FRAC_CONST(0.020042673499487) },
- { FRAC_CONST(0.999728182542920), FRAC_CONST(0.023314395326274) },
- { FRAC_CONST(0.999646533355977), FRAC_CONST(0.026585867474619) },
- { FRAC_CONST(0.999554178757770), FRAC_CONST(0.029857054909681) },
- { FRAC_CONST(0.999451119737344), FRAC_CONST(0.033127922599673) },
- { FRAC_CONST(0.999337357398377), FRAC_CONST(0.036398435516228) },
- { FRAC_CONST(0.999212892959173), FRAC_CONST(0.039668558634781) },
- { FRAC_CONST(0.999077727752645), FRAC_CONST(0.042938256934941) },
- { FRAC_CONST(0.998931863226306), FRAC_CONST(0.046207495400865) },
- { FRAC_CONST(0.998775300942246), FRAC_CONST(0.049476239021636) },
- { FRAC_CONST(0.998608042577122), FRAC_CONST(0.052744452791636) },
- { FRAC_CONST(0.998430089922136), FRAC_CONST(0.056012101710921) },
- { FRAC_CONST(0.998241444883019), FRAC_CONST(0.059279150785597) },
- { FRAC_CONST(0.998042109480008), FRAC_CONST(0.062545565028192) },
- { FRAC_CONST(0.997832085847824), FRAC_CONST(0.065811309458034) },
- { FRAC_CONST(0.997611376235651), FRAC_CONST(0.069076349101624) },
- { FRAC_CONST(0.997379983007114), FRAC_CONST(0.072340648993011) },
- { FRAC_CONST(0.997137908640245), FRAC_CONST(0.075604174174166) },
- { FRAC_CONST(0.996885155727469), FRAC_CONST(0.078866889695354) },
- { FRAC_CONST(0.996621726975566), FRAC_CONST(0.082128760615515) },
- { FRAC_CONST(0.996347625205645), FRAC_CONST(0.085389752002632) },
- { FRAC_CONST(0.996062853353117), FRAC_CONST(0.088649828934106) },
- { FRAC_CONST(0.995767414467660), FRAC_CONST(0.091908956497133) },
- { FRAC_CONST(0.995461311713186), FRAC_CONST(0.095167099789075) },
- { FRAC_CONST(0.995144548367810), FRAC_CONST(0.098424223917834) },
- { FRAC_CONST(0.994817127823813), FRAC_CONST(0.101680294002229) },
- { FRAC_CONST(0.994479053587606), FRAC_CONST(0.104935275172364) },
- { FRAC_CONST(0.994130329279692), FRAC_CONST(0.108189132570007) },
- { FRAC_CONST(0.993770958634630), FRAC_CONST(0.111441831348957) },
- { FRAC_CONST(0.993400945500988), FRAC_CONST(0.114693336675426) },
- { FRAC_CONST(0.993020293841312), FRAC_CONST(0.117943613728403) },
- { FRAC_CONST(0.992629007732074), FRAC_CONST(0.121192627700032) },
- { FRAC_CONST(0.992227091363634), FRAC_CONST(0.124440343795983) },
- { FRAC_CONST(0.991814549040194), FRAC_CONST(0.127686727235827) },
- { FRAC_CONST(0.991391385179751), FRAC_CONST(0.130931743253405) },
- { FRAC_CONST(0.990957604314048), FRAC_CONST(0.134175357097202) },
- { FRAC_CONST(0.990513211088533), FRAC_CONST(0.137417534030720) },
- { FRAC_CONST(0.990058210262297), FRAC_CONST(0.140658239332849) },
- { FRAC_CONST(0.989592606708036), FRAC_CONST(0.143897438298239) },
- { FRAC_CONST(0.989116405411988), FRAC_CONST(0.147135096237670) },
- { FRAC_CONST(0.988629611473887), FRAC_CONST(0.150371178478428) },
- { FRAC_CONST(0.988132230106905), FRAC_CONST(0.153605650364672) },
- { FRAC_CONST(0.987624266637598), FRAC_CONST(0.156838477257806) },
- { FRAC_CONST(0.987105726505845), FRAC_CONST(0.160069624536852) },
- { FRAC_CONST(0.986576615264794), FRAC_CONST(0.163299057598817) },
- { FRAC_CONST(0.986036938580803), FRAC_CONST(0.166526741859069) },
- { FRAC_CONST(0.985486702233375), FRAC_CONST(0.169752642751702) },
- { FRAC_CONST(0.984925912115099), FRAC_CONST(0.172976725729910) },
- { FRAC_CONST(0.984354574231587), FRAC_CONST(0.176198956266353) },
- { FRAC_CONST(0.983772694701407), FRAC_CONST(0.179419299853531) },
- { FRAC_CONST(0.983180279756024), FRAC_CONST(0.182637722004152) },
- { FRAC_CONST(0.982577335739725), FRAC_CONST(0.185854188251500) },
- { FRAC_CONST(0.981963869109555), FRAC_CONST(0.189068664149806) },
- { FRAC_CONST(0.981339886435250), FRAC_CONST(0.192281115274616) },
- { FRAC_CONST(0.980705394399163), FRAC_CONST(0.195491507223158) },
- { FRAC_CONST(0.980060399796194), FRAC_CONST(0.198699805614714) },
- { FRAC_CONST(0.979404909533716), FRAC_CONST(0.201905976090986) },
- { FRAC_CONST(0.978738930631504), FRAC_CONST(0.205109984316464) },
- { FRAC_CONST(0.978062470221657), FRAC_CONST(0.208311795978794) },
- { FRAC_CONST(0.977375535548522), FRAC_CONST(0.211511376789145) },
- { FRAC_CONST(0.976678133968618), FRAC_CONST(0.214708692482577) },
- { FRAC_CONST(0.975970272950556), FRAC_CONST(0.217903708818409) },
- { FRAC_CONST(0.975251960074958), FRAC_CONST(0.221096391580581) },
- { FRAC_CONST(0.974523203034377), FRAC_CONST(0.224286706578026) },
- { FRAC_CONST(0.973784009633218), FRAC_CONST(0.227474619645035) },
- { FRAC_CONST(0.973034387787646), FRAC_CONST(0.230660096641619) },
- { FRAC_CONST(0.972274345525510), FRAC_CONST(0.233843103453878) },
- { FRAC_CONST(0.971503890986252), FRAC_CONST(0.237023605994367) },
- { FRAC_CONST(0.970723032420820), FRAC_CONST(0.240201570202459) },
- { FRAC_CONST(0.969931778191584), FRAC_CONST(0.243376962044711) },
- { FRAC_CONST(0.969130136772239), FRAC_CONST(0.246549747515226) },
- { FRAC_CONST(0.968318116747721), FRAC_CONST(0.249719892636022) },
- { FRAC_CONST(0.967495726814114), FRAC_CONST(0.252887363457390) },
- { FRAC_CONST(0.966662975778551), FRAC_CONST(0.256052126058264) },
- { FRAC_CONST(0.965819872559127), FRAC_CONST(0.259214146546579) },
- { FRAC_CONST(0.964966426184802), FRAC_CONST(0.262373391059634) },
- { FRAC_CONST(0.964102645795299), FRAC_CONST(0.265529825764461) },
- { FRAC_CONST(0.963228540641012), FRAC_CONST(0.268683416858178) },
- { FRAC_CONST(0.962344120082907), FRAC_CONST(0.271834130568359) },
- { FRAC_CONST(0.961449393592416), FRAC_CONST(0.274981933153391) },
- { FRAC_CONST(0.960544370751341), FRAC_CONST(0.278126790902837) },
- { FRAC_CONST(0.959629061251750), FRAC_CONST(0.281268670137799) },
- { FRAC_CONST(0.958703474895872), FRAC_CONST(0.284407537211272) },
- { FRAC_CONST(0.957767621595993), FRAC_CONST(0.287543358508512) },
- { FRAC_CONST(0.956821511374351), FRAC_CONST(0.290676100447394) },
- { FRAC_CONST(0.955865154363025), FRAC_CONST(0.293805729478766) },
- { FRAC_CONST(0.954898560803832), FRAC_CONST(0.296932212086818) },
- { FRAC_CONST(0.953921741048211), FRAC_CONST(0.300055514789431) },
- { FRAC_CONST(0.952934705557117), FRAC_CONST(0.303175604138543) },
- { FRAC_CONST(0.951937464900908), FRAC_CONST(0.306292446720504) },
- { FRAC_CONST(0.950930029759229), FRAC_CONST(0.309406009156434) },
- { FRAC_CONST(0.949912410920903), FRAC_CONST(0.312516258102580) },
- { FRAC_CONST(0.948884619283808), FRAC_CONST(0.315623160250676) },
- { FRAC_CONST(0.947846665854767), FRAC_CONST(0.318726682328294) },
- { FRAC_CONST(0.946798561749429), FRAC_CONST(0.321826791099207) },
- { FRAC_CONST(0.945740318192145), FRAC_CONST(0.324923453363742) },
- { FRAC_CONST(0.944671946515855), FRAC_CONST(0.328016635959131) },
- { FRAC_CONST(0.943593458161960), FRAC_CONST(0.331106305759876) },
- { FRAC_CONST(0.942504864680205), FRAC_CONST(0.334192429678095) },
- { FRAC_CONST(0.941406177728551), FRAC_CONST(0.337274974663880) },
- { FRAC_CONST(0.940297409073052), FRAC_CONST(0.340353907705650) },
- { FRAC_CONST(0.939178570587730), FRAC_CONST(0.343429195830507) },
- { FRAC_CONST(0.938049674254446), FRAC_CONST(0.346500806104585) },
- { FRAC_CONST(0.936910732162774), FRAC_CONST(0.349568705633406) },
- { FRAC_CONST(0.935761756509868), FRAC_CONST(0.352632861562230) },
- { FRAC_CONST(0.934602759600334), FRAC_CONST(0.355693241076410) },
- { FRAC_CONST(0.933433753846097), FRAC_CONST(0.358749811401739) },
- { FRAC_CONST(0.932254751766271), FRAC_CONST(0.361802539804806) },
- { FRAC_CONST(0.931065765987021), FRAC_CONST(0.364851393593340) },
- { FRAC_CONST(0.929866809241428), FRAC_CONST(0.367896340116568) },
- { FRAC_CONST(0.928657894369357), FRAC_CONST(0.370937346765559) },
- { FRAC_CONST(0.927439034317314), FRAC_CONST(0.373974380973575) },
- { FRAC_CONST(0.926210242138311), FRAC_CONST(0.377007410216418) },
- { FRAC_CONST(0.924971530991726), FRAC_CONST(0.380036402012783) },
- { FRAC_CONST(0.923722914143160), FRAC_CONST(0.383061323924602) },
- { FRAC_CONST(0.922464404964295), FRAC_CONST(0.386082143557389) },
- { FRAC_CONST(0.921196016932755), FRAC_CONST(0.389098828560595) },
- { FRAC_CONST(0.919917763631956), FRAC_CONST(0.392111346627946) },
- { FRAC_CONST(0.918629658750963), FRAC_CONST(0.395119665497795) },
- { FRAC_CONST(0.917331716084346), FRAC_CONST(0.398123752953462) },
- { FRAC_CONST(0.916023949532027), FRAC_CONST(0.401123576823585) },
- { FRAC_CONST(0.914706373099136), FRAC_CONST(0.404119104982459) },
- { FRAC_CONST(0.913379000895858), FRAC_CONST(0.407110305350386) },
- { FRAC_CONST(0.912041847137282), FRAC_CONST(0.410097145894012) },
- { FRAC_CONST(0.910694926143251), FRAC_CONST(0.413079594626675) },
- { FRAC_CONST(0.909338252338207), FRAC_CONST(0.416057619608744) },
- { FRAC_CONST(0.907971840251037), FRAC_CONST(0.419031188947965) },
- { FRAC_CONST(0.906595704514915), FRAC_CONST(0.422000270799800) },
- { FRAC_CONST(0.905209859867151), FRAC_CONST(0.424964833367766) },
- { FRAC_CONST(0.903814321149027), FRAC_CONST(0.427924844903780) },
- { FRAC_CONST(0.902409103305641), FRAC_CONST(0.430880273708497) },
- { FRAC_CONST(0.900994221385748), FRAC_CONST(0.433831088131649) },
- { FRAC_CONST(0.899569690541596), FRAC_CONST(0.436777256572384) },
- { FRAC_CONST(0.898135526028766), FRAC_CONST(0.439718747479604) },
- { FRAC_CONST(0.896691743206008), FRAC_CONST(0.442655529352306) },
- { FRAC_CONST(0.895238357535076), FRAC_CONST(0.445587570739915) },
- { FRAC_CONST(0.893775384580563), FRAC_CONST(0.448514840242624) },
- { FRAC_CONST(0.892302840009734), FRAC_CONST(0.451437306511726) },
- { FRAC_CONST(0.890820739592359), FRAC_CONST(0.454354938249958) },
- { FRAC_CONST(0.889329099200541), FRAC_CONST(0.457267704211826) },
- { FRAC_CONST(0.887827934808551), FRAC_CONST(0.460175573203949) },
- { FRAC_CONST(0.886317262492655), FRAC_CONST(0.463078514085383) },
- { FRAC_CONST(0.884797098430938), FRAC_CONST(0.465976495767966) },
- { FRAC_CONST(0.883267458903136), FRAC_CONST(0.468869487216642) },
- { FRAC_CONST(0.881728360290461), FRAC_CONST(0.471757457449795) },
- { FRAC_CONST(0.880179819075421), FRAC_CONST(0.474640375539586) },
- { FRAC_CONST(0.878621851841649), FRAC_CONST(0.477518210612278) },
- { FRAC_CONST(0.877054475273722), FRAC_CONST(0.480390931848569) },
- { FRAC_CONST(0.875477706156984), FRAC_CONST(0.483258508483922) },
- { FRAC_CONST(0.873891561377366), FRAC_CONST(0.486120909808896) },
- { FRAC_CONST(0.872296057921204), FRAC_CONST(0.488978105169472) },
- { FRAC_CONST(0.870691212875058), FRAC_CONST(0.491830063967383) },
- { FRAC_CONST(0.869077043425529), FRAC_CONST(0.494676755660442) },
- { FRAC_CONST(0.867453566859076), FRAC_CONST(0.497518149762867) },
- { FRAC_CONST(0.865820800561827), FRAC_CONST(0.500354215845611) },
- { FRAC_CONST(0.864178762019399), FRAC_CONST(0.503184923536685) },
- { FRAC_CONST(0.862527468816704), FRAC_CONST(0.506010242521482) },
- { FRAC_CONST(0.860866938637767), FRAC_CONST(0.508830142543107) },
- { FRAC_CONST(0.859197189265532), FRAC_CONST(0.511644593402696) },
- { FRAC_CONST(0.857518238581672), FRAC_CONST(0.514453564959741) },
- { FRAC_CONST(0.855830104566401), FRAC_CONST(0.517257027132414) },
- { FRAC_CONST(0.854132805298278), FRAC_CONST(0.520054949897887) },
- { FRAC_CONST(0.852426358954015), FRAC_CONST(0.522847303292655) },
- { FRAC_CONST(0.850710783808280), FRAC_CONST(0.525634057412856) },
- { FRAC_CONST(0.848986098233506), FRAC_CONST(0.528415182414593) },
- { FRAC_CONST(0.847252320699689), FRAC_CONST(0.531190648514252) },
- { FRAC_CONST(0.845509469774194), FRAC_CONST(0.533960425988819) },
- { FRAC_CONST(0.843757564121554), FRAC_CONST(0.536724485176205) },
- { FRAC_CONST(0.841996622503271), FRAC_CONST(0.539482796475555) },
- { FRAC_CONST(0.840226663777615), FRAC_CONST(0.542235330347571) },
- { FRAC_CONST(0.838447706899422), FRAC_CONST(0.544982057314827) },
- { FRAC_CONST(0.836659770919891), FRAC_CONST(0.547722947962084) },
- { FRAC_CONST(0.834862874986380), FRAC_CONST(0.550457972936605) },
- { FRAC_CONST(0.833057038342201), FRAC_CONST(0.553187102948470) },
- { FRAC_CONST(0.831242280326413), FRAC_CONST(0.555910308770889) },
- { FRAC_CONST(0.829418620373617), FRAC_CONST(0.558627561240515) },
- { FRAC_CONST(0.827586078013746), FRAC_CONST(0.561338831257758) },
- { FRAC_CONST(0.825744672871856), FRAC_CONST(0.564044089787093) },
- { FRAC_CONST(0.823894424667918), FRAC_CONST(0.566743307857377) },
- { FRAC_CONST(0.822035353216601), FRAC_CONST(0.569436456562150) },
- { FRAC_CONST(0.820167478427070), FRAC_CONST(0.572123507059955) },
- { FRAC_CONST(0.818290820302761), FRAC_CONST(0.574804430574639) },
- { FRAC_CONST(0.816405398941175), FRAC_CONST(0.577479198395666) },
- { FRAC_CONST(0.814511234533661), FRAC_CONST(0.580147781878420) },
- { FRAC_CONST(0.812608347365198), FRAC_CONST(0.582810152444517) },
- { FRAC_CONST(0.810696757814178), FRAC_CONST(0.585466281582107) },
- { FRAC_CONST(0.808776486352191), FRAC_CONST(0.588116140846181) },
- { FRAC_CONST(0.806847553543799), FRAC_CONST(0.590759701858874) },
- { FRAC_CONST(0.804909980046325), FRAC_CONST(0.593396936309773) },
- { FRAC_CONST(0.802963786609623), FRAC_CONST(0.596027815956215) },
- { FRAC_CONST(0.801008994075862), FRAC_CONST(0.598652312623592) },
- { FRAC_CONST(0.799045623379300), FRAC_CONST(0.601270398205654) },
- { FRAC_CONST(0.797073695546059), FRAC_CONST(0.603882044664808) },
- { FRAC_CONST(0.795093231693901), FRAC_CONST(0.606487224032418) },
- { FRAC_CONST(0.793104253032005), FRAC_CONST(0.609085908409106) },
- { FRAC_CONST(0.791106780860733), FRAC_CONST(0.611678069965050) },
- { FRAC_CONST(0.789100836571407), FRAC_CONST(0.614263680940283) },
- { FRAC_CONST(0.787086441646080), FRAC_CONST(0.616842713644988) },
- { FRAC_CONST(0.785063617657302), FRAC_CONST(0.619415140459796) },
- { FRAC_CONST(0.783032386267894), FRAC_CONST(0.621980933836084) },
- { FRAC_CONST(0.780992769230711), FRAC_CONST(0.624540066296266) },
- { FRAC_CONST(0.778944788388414), FRAC_CONST(0.627092510434089) },
- { FRAC_CONST(0.776888465673232), FRAC_CONST(0.629638238914927) },
- { FRAC_CONST(0.774823823106730), FRAC_CONST(0.632177224476073) },
- { FRAC_CONST(0.772750882799570), FRAC_CONST(0.634709439927031) },
- { FRAC_CONST(0.770669666951277), FRAC_CONST(0.637234858149809) },
- { FRAC_CONST(0.768580197850002), FRAC_CONST(0.639753452099206) },
- { FRAC_CONST(0.766482497872280), FRAC_CONST(0.642265194803105) },
- { FRAC_CONST(0.764376589482793), FRAC_CONST(0.644770059362758) },
- { FRAC_CONST(0.762262495234126), FRAC_CONST(0.647268018953079) },
- { FRAC_CONST(0.760140237766532), FRAC_CONST(0.649759046822928) },
- { FRAC_CONST(0.758009839807683), FRAC_CONST(0.652243116295397) },
- { FRAC_CONST(0.755871324172429), FRAC_CONST(0.654720200768098) },
- { FRAC_CONST(0.753724713762555), FRAC_CONST(0.657190273713446) },
- { FRAC_CONST(0.751570031566534), FRAC_CONST(0.659653308678945) },
- { FRAC_CONST(0.749407300659280), FRAC_CONST(0.662109279287469) },
- { FRAC_CONST(0.747236544201905), FRAC_CONST(0.664558159237545) },
- { FRAC_CONST(0.745057785441466), FRAC_CONST(0.666999922303638) },
- { FRAC_CONST(0.742871047710719), FRAC_CONST(0.669434542336425) },
- { FRAC_CONST(0.740676354427868), FRAC_CONST(0.671861993263083) },
- { FRAC_CONST(0.738473729096316), FRAC_CONST(0.674282249087562) },
- { FRAC_CONST(0.736263195304409), FRAC_CONST(0.676695283890867) },
- { FRAC_CONST(0.734044776725190), FRAC_CONST(0.679101071831334) },
- { FRAC_CONST(0.731818497116138), FRAC_CONST(0.681499587144906) },
- { FRAC_CONST(0.729584380318920), FRAC_CONST(0.683890804145412) },
- { FRAC_CONST(0.727342450259131), FRAC_CONST(0.686274697224838) },
- { FRAC_CONST(0.725092730946042), FRAC_CONST(0.688651240853606) },
- { FRAC_CONST(0.722835246472338), FRAC_CONST(0.691020409580841) },
- { FRAC_CONST(0.720570021013866), FRAC_CONST(0.693382178034651) },
- { FRAC_CONST(0.718297078829369), FRAC_CONST(0.695736520922392) },
- { FRAC_CONST(0.716016444260233), FRAC_CONST(0.698083413030944) },
- { FRAC_CONST(0.713728141730222), FRAC_CONST(0.700422829226978) },
- { FRAC_CONST(0.711432195745216), FRAC_CONST(0.702754744457225) },
- { FRAC_CONST(0.709128630892954), FRAC_CONST(0.705079133748748) },
- { FRAC_CONST(0.706817471842764), FRAC_CONST(0.707395972209203) },
- { FRAC_CONST(0.704498743345302), FRAC_CONST(0.709705235027113) },
- { FRAC_CONST(0.702172470232289), FRAC_CONST(0.712006897472128) },
- { FRAC_CONST(0.699838677416240), FRAC_CONST(0.714300934895292) },
- { FRAC_CONST(0.697497389890200), FRAC_CONST(0.716587322729308) },
- { FRAC_CONST(0.695148632727480), FRAC_CONST(0.718866036488799) },
- { FRAC_CONST(0.692792431081381), FRAC_CONST(0.721137051770570) },
- { FRAC_CONST(0.690428810184929), FRAC_CONST(0.723400344253874) },
- { FRAC_CONST(0.688057795350606), FRAC_CONST(0.725655889700665) },
- { FRAC_CONST(0.685679411970075), FRAC_CONST(0.727903663955865) },
- { FRAC_CONST(0.683293685513912), FRAC_CONST(0.730143642947616) },
- { FRAC_CONST(0.680900641531330), FRAC_CONST(0.732375802687543) },
- { FRAC_CONST(0.678500305649909), FRAC_CONST(0.734600119271009) },
- { FRAC_CONST(0.676092703575316), FRAC_CONST(0.736816568877370) },
- { FRAC_CONST(0.673677861091036), FRAC_CONST(0.739025127770231) },
- { FRAC_CONST(0.671255804058092), FRAC_CONST(0.741225772297702) },
- { FRAC_CONST(0.668826558414768), FRAC_CONST(0.743418478892647) },
- { FRAC_CONST(0.666390150176334), FRAC_CONST(0.745603224072940) },
- { FRAC_CONST(0.663946605434765), FRAC_CONST(0.747779984441716) },
- { FRAC_CONST(0.661495950358462), FRAC_CONST(0.749948736687619) },
- { FRAC_CONST(0.659038211191971), FRAC_CONST(0.752109457585056) },
- { FRAC_CONST(0.656573414255705), FRAC_CONST(0.754262123994441) },
- { FRAC_CONST(0.654101585945659), FRAC_CONST(0.756406712862448) },
- { FRAC_CONST(0.651622752733128), FRAC_CONST(0.758543201222251) },
- { FRAC_CONST(0.649136941164425), FRAC_CONST(0.760671566193777) },
- { FRAC_CONST(0.646644177860593), FRAC_CONST(0.762791784983948) },
- { FRAC_CONST(0.644144489517126), FRAC_CONST(0.764903834886923) },
- { FRAC_CONST(0.641637902903677), FRAC_CONST(0.767007693284345) },
- { FRAC_CONST(0.639124444863776), FRAC_CONST(0.769103337645580) },
- { FRAC_CONST(0.636604142314538), FRAC_CONST(0.771190745527961) },
- { FRAC_CONST(0.634077022246379), FRAC_CONST(0.773269894577026) },
- { FRAC_CONST(0.631543111722725), FRAC_CONST(0.775340762526760) },
- { FRAC_CONST(0.629002437879721), FRAC_CONST(0.777403327199831) },
- { FRAC_CONST(0.626455027925944), FRAC_CONST(0.779457566507828) },
- { FRAC_CONST(0.623900909142107), FRAC_CONST(0.781503458451498) },
- { FRAC_CONST(0.621340108880771), FRAC_CONST(0.783540981120982) },
- { FRAC_CONST(0.618772654566049), FRAC_CONST(0.785570112696050) },
- { FRAC_CONST(0.616198573693314), FRAC_CONST(0.787590831446332) },
- { FRAC_CONST(0.613617893828905), FRAC_CONST(0.789603115731555) },
- { FRAC_CONST(0.611030642609828), FRAC_CONST(0.791606944001769) },
- { FRAC_CONST(0.608436847743468), FRAC_CONST(0.793602294797585) },
- { FRAC_CONST(0.605836537007281), FRAC_CONST(0.795589146750397) },
- { FRAC_CONST(0.603229738248508), FRAC_CONST(0.797567478582619) },
- { FRAC_CONST(0.600616479383869), FRAC_CONST(0.799537269107905) },
- { FRAC_CONST(0.597996788399267), FRAC_CONST(0.801498497231381) },
- { FRAC_CONST(0.595370693349487), FRAC_CONST(0.803451141949871) },
- { FRAC_CONST(0.592738222357898), FRAC_CONST(0.805395182352117) },
- { FRAC_CONST(0.590099403616149), FRAC_CONST(0.807330597619008) },
- { FRAC_CONST(0.587454265383869), FRAC_CONST(0.809257367023803) },
- { FRAC_CONST(0.584802835988364), FRAC_CONST(0.811175469932349) },
- { FRAC_CONST(0.582145143824311), FRAC_CONST(0.813084885803304) },
- { FRAC_CONST(0.579481217353460), FRAC_CONST(0.814985594188359) },
- { FRAC_CONST(0.576811085104321), FRAC_CONST(0.816877574732454) },
- { FRAC_CONST(0.574134775671867), FRAC_CONST(0.818760807173997) },
- { FRAC_CONST(0.571452317717222), FRAC_CONST(0.820635271345081) },
- { FRAC_CONST(0.568763739967354), FRAC_CONST(0.822500947171703) },
- { FRAC_CONST(0.566069071214772), FRAC_CONST(0.824357814673971) },
- { FRAC_CONST(0.563368340317214), FRAC_CONST(0.826205853966327) },
- { FRAC_CONST(0.560661576197336), FRAC_CONST(0.828045045257756) },
- { FRAC_CONST(0.557948807842409), FRAC_CONST(0.829875368851995) },
- { FRAC_CONST(0.555230064304002), FRAC_CONST(0.831696805147750) },
- { FRAC_CONST(0.552505374697674), FRAC_CONST(0.833509334638900) },
- { FRAC_CONST(0.549774768202663), FRAC_CONST(0.835312937914713) },
- { FRAC_CONST(0.547038274061568), FRAC_CONST(0.837107595660044) },
- { FRAC_CONST(0.544295921580046), FRAC_CONST(0.838893288655553) },
- { FRAC_CONST(0.541547740126486), FRAC_CONST(0.840669997777901) },
- { FRAC_CONST(0.538793759131706), FRAC_CONST(0.842437703999961) },
- { FRAC_CONST(0.536034008088628), FRAC_CONST(0.844196388391019) },
- { FRAC_CONST(0.533268516551970), FRAC_CONST(0.845946032116980) },
- { FRAC_CONST(0.530497314137923), FRAC_CONST(0.847686616440563) },
- { FRAC_CONST(0.527720430523840), FRAC_CONST(0.849418122721510) },
- { FRAC_CONST(0.524937895447912), FRAC_CONST(0.851140532416778) },
- { FRAC_CONST(0.522149738708856), FRAC_CONST(0.852853827080745) },
- { FRAC_CONST(0.519355990165590), FRAC_CONST(0.854557988365401) },
- { FRAC_CONST(0.516556679736915), FRAC_CONST(0.856252998020546) },
- { FRAC_CONST(0.513751837401199), FRAC_CONST(0.857938837893991) },
- { FRAC_CONST(0.510941493196049), FRAC_CONST(0.859615489931744) },
- { FRAC_CONST(0.508125677217994), FRAC_CONST(0.861282936178208) },
- { FRAC_CONST(0.505304419622159), FRAC_CONST(0.862941158776375) },
- { FRAC_CONST(0.502477750621949), FRAC_CONST(0.864590139968012) },
- { FRAC_CONST(0.499645700488717), FRAC_CONST(0.866229862093855) },
- { FRAC_CONST(0.496808299551444), FRAC_CONST(0.867860307593799) },
- { FRAC_CONST(0.493965578196415), FRAC_CONST(0.869481459007080) },
- { FRAC_CONST(0.491117566866892), FRAC_CONST(0.871093298972471) },
- { FRAC_CONST(0.488264296062789), FRAC_CONST(0.872695810228461) },
- { FRAC_CONST(0.485405796340343), FRAC_CONST(0.874288975613440) },
- { FRAC_CONST(0.482542098311789), FRAC_CONST(0.875872778065888) },
- { FRAC_CONST(0.479673232645033), FRAC_CONST(0.877447200624553) },
- { FRAC_CONST(0.476799230063322), FRAC_CONST(0.879012226428633) },
- { FRAC_CONST(0.473920121344914), FRAC_CONST(0.880567838717962) },
- { FRAC_CONST(0.471035937322751), FRAC_CONST(0.882114020833179) },
- { FRAC_CONST(0.468146708884125), FRAC_CONST(0.883650756215917) },
- { FRAC_CONST(0.465252466970353), FRAC_CONST(0.885178028408975) },
- { FRAC_CONST(0.462353242576441), FRAC_CONST(0.886695821056495) },
- { FRAC_CONST(0.459449066750752), FRAC_CONST(0.888204117904136) },
- { FRAC_CONST(0.456539970594675), FRAC_CONST(0.889702902799251) },
- { FRAC_CONST(0.453625985262295), FRAC_CONST(0.891192159691058) },
- { FRAC_CONST(0.450707141960053), FRAC_CONST(0.892671872630812) },
- { FRAC_CONST(0.447783471946415), FRAC_CONST(0.894142025771977) },
- { FRAC_CONST(0.444855006531538), FRAC_CONST(0.895602603370393) },
- { FRAC_CONST(0.441921777076935), FRAC_CONST(0.897053589784447) },
- { FRAC_CONST(0.438983814995137), FRAC_CONST(0.898494969475242) },
- { FRAC_CONST(0.436041151749356), FRAC_CONST(0.899926727006758) },
- { FRAC_CONST(0.433093818853152), FRAC_CONST(0.901348847046022) },
- { FRAC_CONST(0.430141847870093), FRAC_CONST(0.902761314363272) },
- { FRAC_CONST(0.427185270413416), FRAC_CONST(0.904164113832116) },
- { FRAC_CONST(0.424224118145690), FRAC_CONST(0.905557230429701) },
- { FRAC_CONST(0.421258422778478), FRAC_CONST(0.906940649236866) },
- { FRAC_CONST(0.418288216071994), FRAC_CONST(0.908314355438308) },
- { FRAC_CONST(0.415313529834766), FRAC_CONST(0.909678334322736) },
- { FRAC_CONST(0.412334395923293), FRAC_CONST(0.911032571283032) },
- { FRAC_CONST(0.409350846241706), FRAC_CONST(0.912377051816407) },
- { FRAC_CONST(0.406362912741425), FRAC_CONST(0.913711761524555) },
- { FRAC_CONST(0.403370627420818), FRAC_CONST(0.915036686113806) },
- { FRAC_CONST(0.400374022324857), FRAC_CONST(0.916351811395282) },
- { FRAC_CONST(0.397373129544774), FRAC_CONST(0.917657123285050) },
- { FRAC_CONST(0.394367981217720), FRAC_CONST(0.918952607804266) },
- { FRAC_CONST(0.391358609526420), FRAC_CONST(0.920238251079332) },
- { FRAC_CONST(0.388345046698826), FRAC_CONST(0.921514039342042) },
- { FRAC_CONST(0.385327325007776), FRAC_CONST(0.922779958929729) },
- { FRAC_CONST(0.382305476770645), FRAC_CONST(0.924035996285410) },
- { FRAC_CONST(0.379279534348999), FRAC_CONST(0.925282137957935) },
- { FRAC_CONST(0.376249530148250), FRAC_CONST(0.926518370602127) },
- { FRAC_CONST(0.373215496617310), FRAC_CONST(0.927744680978929) },
- { FRAC_CONST(0.370177466248239), FRAC_CONST(0.928961055955541) },
- { FRAC_CONST(0.367135471575903), FRAC_CONST(0.930167482505564) },
- { FRAC_CONST(0.364089545177621), FRAC_CONST(0.931363947709140) },
- { FRAC_CONST(0.361039719672816), FRAC_CONST(0.932550438753087) },
- { FRAC_CONST(0.357986027722671), FRAC_CONST(0.933726942931039) },
- { FRAC_CONST(0.354928502029772), FRAC_CONST(0.934893447643582) },
- { FRAC_CONST(0.351867175337763), FRAC_CONST(0.936049940398387) },
- { FRAC_CONST(0.348802080430994), FRAC_CONST(0.937196408810347) },
- { FRAC_CONST(0.345733250134169), FRAC_CONST(0.938332840601705) },
- { FRAC_CONST(0.342660717311994), FRAC_CONST(0.939459223602190) },
- { FRAC_CONST(0.339584514868829), FRAC_CONST(0.940575545749145) },
- { FRAC_CONST(0.336504675748328), FRAC_CONST(0.941681795087657) },
- { FRAC_CONST(0.333421232933097), FRAC_CONST(0.942777959770684) },
- { FRAC_CONST(0.330334219444328), FRAC_CONST(0.943864028059183) },
- { FRAC_CONST(0.327243668341457), FRAC_CONST(0.944939988322235) },
- { FRAC_CONST(0.324149612721804), FRAC_CONST(0.946005829037171) },
- { FRAC_CONST(0.321052085720218), FRAC_CONST(0.947061538789691) },
- { FRAC_CONST(0.317951120508725), FRAC_CONST(0.948107106273994) },
- { FRAC_CONST(0.314846750296171), FRAC_CONST(0.949142520292891) },
- { FRAC_CONST(0.311739008327867), FRAC_CONST(0.950167769757930) },
- { FRAC_CONST(0.308627927885232), FRAC_CONST(0.951182843689513) },
- { FRAC_CONST(0.305513542285440), FRAC_CONST(0.952187731217013) },
- { FRAC_CONST(0.302395884881056), FRAC_CONST(0.953182421578893) },
- { FRAC_CONST(0.299274989059689), FRAC_CONST(0.954166904122818) },
- { FRAC_CONST(0.296150888243624), FRAC_CONST(0.955141168305771) },
- { FRAC_CONST(0.293023615889471), FRAC_CONST(0.956105203694164) },
- { FRAC_CONST(0.289893205487806), FRAC_CONST(0.957058999963955) },
- { FRAC_CONST(0.286759690562807), FRAC_CONST(0.958002546900750) },
- { FRAC_CONST(0.283623104671904), FRAC_CONST(0.958935834399920) },
- { FRAC_CONST(0.280483481405410), FRAC_CONST(0.959858852466706) },
- { FRAC_CONST(0.277340854386169), FRAC_CONST(0.960771591216325) },
- { FRAC_CONST(0.274195257269191), FRAC_CONST(0.961674040874080) },
- { FRAC_CONST(0.271046723741295), FRAC_CONST(0.962566191775459) },
- { FRAC_CONST(0.267895287520743), FRAC_CONST(0.963448034366243) },
- { FRAC_CONST(0.264740982356888), FRAC_CONST(0.964319559202607) },
- { FRAC_CONST(0.261583842029803), FRAC_CONST(0.965180756951218) },
- { FRAC_CONST(0.258423900349924), FRAC_CONST(0.966031618389343) },
- { FRAC_CONST(0.255261191157689), FRAC_CONST(0.966872134404937) },
- { FRAC_CONST(0.252095748323171), FRAC_CONST(0.967702295996750) },
- { FRAC_CONST(0.248927605745720), FRAC_CONST(0.968522094274417) },
- { FRAC_CONST(0.245756797353599), FRAC_CONST(0.969331520458559) },
- { FRAC_CONST(0.242583357103617), FRAC_CONST(0.970130565880871) },
- { FRAC_CONST(0.239407318980770), FRAC_CONST(0.970919221984218) },
- { FRAC_CONST(0.236228716997876), FRAC_CONST(0.971697480322728) },
- { FRAC_CONST(0.233047585195206), FRAC_CONST(0.972465332561878) },
- { FRAC_CONST(0.229863957640129), FRAC_CONST(0.973222770478587) },
- { FRAC_CONST(0.226677868426735), FRAC_CONST(0.973969785961306) },
- { FRAC_CONST(0.223489351675482), FRAC_CONST(0.974706371010097) },
- { FRAC_CONST(0.220298441532823), FRAC_CONST(0.975432517736727) },
- { FRAC_CONST(0.217105172170841), FRAC_CONST(0.976148218364747) },
- { FRAC_CONST(0.213909577786886), FRAC_CONST(0.976853465229579) },
- { FRAC_CONST(0.210711692603206), FRAC_CONST(0.977548250778596) },
- { FRAC_CONST(0.207511550866582), FRAC_CONST(0.978232567571202) },
- { FRAC_CONST(0.204309186847962), FRAC_CONST(0.978906408278914) },
- { FRAC_CONST(0.201104634842092), FRAC_CONST(0.979569765685441) },
- { FRAC_CONST(0.197897929167148), FRAC_CONST(0.980222632686756) },
- { FRAC_CONST(0.194689104164373), FRAC_CONST(0.980865002291179) },
- { FRAC_CONST(0.191478194197704), FRAC_CONST(0.981496867619447) },
- { FRAC_CONST(0.188265233653407), FRAC_CONST(0.982118221904791) },
- { FRAC_CONST(0.185050256939710), FRAC_CONST(0.982729058493005) },
- { FRAC_CONST(0.181833298486427), FRAC_CONST(0.983329370842520) },
- { FRAC_CONST(0.178614392744603), FRAC_CONST(0.983919152524473) },
- { FRAC_CONST(0.175393574186129), FRAC_CONST(0.984498397222776) },
- { FRAC_CONST(0.172170877303385), FRAC_CONST(0.985067098734184) },
- { FRAC_CONST(0.168946336608867), FRAC_CONST(0.985625250968360) },
- { FRAC_CONST(0.165719986634814), FRAC_CONST(0.986172847947943) },
- { FRAC_CONST(0.162491861932842), FRAC_CONST(0.986709883808609) },
- { FRAC_CONST(0.159261997073573), FRAC_CONST(0.987236352799134) },
- { FRAC_CONST(0.156030426646266), FRAC_CONST(0.987752249281460) },
- { FRAC_CONST(0.152797185258443), FRAC_CONST(0.988257567730749) },
- { FRAC_CONST(0.149562307535523), FRAC_CONST(0.988752302735447) },
- { FRAC_CONST(0.146325828120446), FRAC_CONST(0.989236448997339) },
- { FRAC_CONST(0.143087781673307), FRAC_CONST(0.989710001331608) },
- { FRAC_CONST(0.139848202870981), FRAC_CONST(0.990172954666889) },
- { FRAC_CONST(0.136607126406757), FRAC_CONST(0.990625304045323) },
- { FRAC_CONST(0.133364586989957), FRAC_CONST(0.991067044622612) },
- { FRAC_CONST(0.130120619345575), FRAC_CONST(0.991498171668069) },
- { FRAC_CONST(0.126875258213898), FRAC_CONST(0.991918680564670) },
- { FRAC_CONST(0.123628538350136), FRAC_CONST(0.992328566809103) },
- { FRAC_CONST(0.120380494524051), FRAC_CONST(0.992727826011815) },
- { FRAC_CONST(0.117131161519582), FRAC_CONST(0.993116453897061) },
- { FRAC_CONST(0.113880574134475), FRAC_CONST(0.993494446302948) },
- { FRAC_CONST(0.110628767179910), FRAC_CONST(0.993861799181482) },
- { FRAC_CONST(0.107375775480128), FRAC_CONST(0.994218508598608) },
- { FRAC_CONST(0.104121633872055), FRAC_CONST(0.994564570734255) },
- { FRAC_CONST(0.100866377204933), FRAC_CONST(0.994899981882376) },
- { FRAC_CONST(0.097610040339947), FRAC_CONST(0.995224738450986) },
- { FRAC_CONST(0.094352658149849), FRAC_CONST(0.995538836962204) },
- { FRAC_CONST(0.091094265518583), FRAC_CONST(0.995842274052287) },
- { FRAC_CONST(0.087834897340919), FRAC_CONST(0.996135046471667) },
- { FRAC_CONST(0.084574588522070), FRAC_CONST(0.996417151084987) },
- { FRAC_CONST(0.081313373977324), FRAC_CONST(0.996688584871134) },
- { FRAC_CONST(0.078051288631670), FRAC_CONST(0.996949344923269) },
- { FRAC_CONST(0.074788367419420), FRAC_CONST(0.997199428448862) },
- { FRAC_CONST(0.071524645283840), FRAC_CONST(0.997438832769720) },
- { FRAC_CONST(0.068260157176771), FRAC_CONST(0.997667555322013) },
- { FRAC_CONST(0.064994938058259), FRAC_CONST(0.997885593656308) },
- { FRAC_CONST(0.061729022896176), FRAC_CONST(0.998092945437590) },
- { FRAC_CONST(0.058462446665851), FRAC_CONST(0.998289608445286) },
- { FRAC_CONST(0.055195244349690), FRAC_CONST(0.998475580573295) },
- { FRAC_CONST(0.051927450936806), FRAC_CONST(0.998650859830004) },
- { FRAC_CONST(0.048659101422640), FRAC_CONST(0.998815444338313) },
- { FRAC_CONST(0.045390230808591), FRAC_CONST(0.998969332335654) },
- { FRAC_CONST(0.042120874101635), FRAC_CONST(0.999112522174011) },
- { FRAC_CONST(0.038851066313958), FRAC_CONST(0.999245012319936) },
- { FRAC_CONST(0.035580842462574), FRAC_CONST(0.999366801354564) },
- { FRAC_CONST(0.032310237568951), FRAC_CONST(0.999477887973635) },
- { FRAC_CONST(0.029039286658643), FRAC_CONST(0.999578270987499) },
- { FRAC_CONST(0.025768024760904), FRAC_CONST(0.999667949321134) },
- { FRAC_CONST(0.022496486908322), FRAC_CONST(0.999746922014158) },
- { FRAC_CONST(0.019224708136438), FRAC_CONST(0.999815188220837) },
- { FRAC_CONST(0.015952723483375), FRAC_CONST(0.999872747210095) },
- { FRAC_CONST(0.012680567989461), FRAC_CONST(0.999919598365521) },
- { FRAC_CONST(0.009408276696850), FRAC_CONST(0.999955741185376) },
- { FRAC_CONST(0.006135884649155), FRAC_CONST(0.999981175282601) },
- { FRAC_CONST(0.002863426891064), FRAC_CONST(0.999995900384816) }
-};
-
-#ifdef LD_DEC
-/* 240 (N/4) complex twiddle factors */
-ALIGN static const complex_t mdct_tab_960[] =
-{
- { FRAC_CONST(0.999999665337326), FRAC_CONST(0.000818122995607) },
- { FRAC_CONST(0.999972892444367), FRAC_CONST(0.007363041249780) },
- { FRAC_CONST(0.999903284040864), FRAC_CONST(0.013907644095771) },
- { FRAC_CONST(0.999790843108610), FRAC_CONST(0.020451651184577) },
- { FRAC_CONST(0.999635574464198), FRAC_CONST(0.026994782192715) },
- { FRAC_CONST(0.999437484758823), FRAC_CONST(0.033536756834230) },
- { FRAC_CONST(0.999196582477986), FRAC_CONST(0.040077294872701) },
- { FRAC_CONST(0.998912877941140), FRAC_CONST(0.046616116133247) },
- { FRAC_CONST(0.998586383301244), FRAC_CONST(0.053152940514528) },
- { FRAC_CONST(0.998217112544241), FRAC_CONST(0.059687488000744) },
- { FRAC_CONST(0.997805081488460), FRAC_CONST(0.066219478673630) },
- { FRAC_CONST(0.997350307783942), FRAC_CONST(0.072748632724445) },
- { FRAC_CONST(0.996852810911678), FRAC_CONST(0.079274670465961) },
- { FRAC_CONST(0.996312612182778), FRAC_CONST(0.085797312344440) },
- { FRAC_CONST(0.995729734737558), FRAC_CONST(0.092316278951614) },
- { FRAC_CONST(0.995104203544548), FRAC_CONST(0.098831291036650) },
- { FRAC_CONST(0.994436045399422), FRAC_CONST(0.105342069518114) },
- { FRAC_CONST(0.993725288923851), FRAC_CONST(0.111848335495926) },
- { FRAC_CONST(0.992971964564277), FRAC_CONST(0.118349810263305) },
- { FRAC_CONST(0.992176104590608), FRAC_CONST(0.124846215318711) },
- { FRAC_CONST(0.991337743094838), FRAC_CONST(0.131337272377774) },
- { FRAC_CONST(0.990456915989581), FRAC_CONST(0.137822703385212) },
- { FRAC_CONST(0.989533661006540), FRAC_CONST(0.144302230526747) },
- { FRAC_CONST(0.988568017694885), FRAC_CONST(0.150775576241001) },
- { FRAC_CONST(0.987560027419562), FRAC_CONST(0.157242463231389) },
- { FRAC_CONST(0.986509733359519), FRAC_CONST(0.163702614477995) },
- { FRAC_CONST(0.985417180505858), FRAC_CONST(0.170155753249442) },
- { FRAC_CONST(0.984282415659907), FRAC_CONST(0.176601603114742) },
- { FRAC_CONST(0.983105487431216), FRAC_CONST(0.183039887955141) },
- { FRAC_CONST(0.981886446235473), FRAC_CONST(0.189470331975943) },
- { FRAC_CONST(0.980625344292344), FRAC_CONST(0.195892659718330) },
- { FRAC_CONST(0.979322235623241), FRAC_CONST(0.202306596071156) },
- { FRAC_CONST(0.977977176049000), FRAC_CONST(0.208711866282735) },
- { FRAC_CONST(0.976590223187499), FRAC_CONST(0.215108195972610) },
- { FRAC_CONST(0.975161436451181), FRAC_CONST(0.221495311143304) },
- { FRAC_CONST(0.973690877044515), FRAC_CONST(0.227872938192063) },
- { FRAC_CONST(0.972178607961371), FRAC_CONST(0.234240803922570) },
- { FRAC_CONST(0.970624693982323), FRAC_CONST(0.240598635556650) },
- { FRAC_CONST(0.969029201671875), FRAC_CONST(0.246946160745958) },
- { FRAC_CONST(0.967392199375607), FRAC_CONST(0.253283107583640) },
- { FRAC_CONST(0.965713757217249), FRAC_CONST(0.259609204615985) },
- { FRAC_CONST(0.963993947095677), FRAC_CONST(0.265924180854051) },
- { FRAC_CONST(0.962232842681832), FRAC_CONST(0.272227765785273) },
- { FRAC_CONST(0.960430519415566), FRAC_CONST(0.278519689385053) },
- { FRAC_CONST(0.958587054502409), FRAC_CONST(0.284799682128326) },
- { FRAC_CONST(0.956702526910263), FRAC_CONST(0.291067475001103) },
- { FRAC_CONST(0.954777017366017), FRAC_CONST(0.297322799511998) },
- { FRAC_CONST(0.952810608352092), FRAC_CONST(0.303565387703730) },
- { FRAC_CONST(0.950803384102905), FRAC_CONST(0.309794972164597) },
- { FRAC_CONST(0.948755430601263), FRAC_CONST(0.316011286039934) },
- { FRAC_CONST(0.946666835574676), FRAC_CONST(0.322214063043544) },
- { FRAC_CONST(0.944537688491606), FRAC_CONST(0.328403037469105) },
- { FRAC_CONST(0.942368080557626), FRAC_CONST(0.334577944201551) },
- { FRAC_CONST(0.940158104711519), FRAC_CONST(0.340738518728429) },
- { FRAC_CONST(0.937907855621296), FRAC_CONST(0.346884497151231) },
- { FRAC_CONST(0.935617429680138), FRAC_CONST(0.353015616196696) },
- { FRAC_CONST(0.933286925002268), FRAC_CONST(0.359131613228090) },
- { FRAC_CONST(0.930916441418752), FRAC_CONST(0.365232226256457) },
- { FRAC_CONST(0.928506080473216), FRAC_CONST(0.371317193951838) },
- { FRAC_CONST(0.926055945417500), FRAC_CONST(0.377386255654469) },
- { FRAC_CONST(0.923566141207236), FRAC_CONST(0.383439151385947) },
- { FRAC_CONST(0.921036774497350), FRAC_CONST(0.389475621860365) },
- { FRAC_CONST(0.918467953637492), FRAC_CONST(0.395495408495417) },
- { FRAC_CONST(0.915859788667400), FRAC_CONST(0.401498253423481) },
- { FRAC_CONST(0.913212391312179), FRAC_CONST(0.407483899502658) },
- { FRAC_CONST(0.910525874977521), FRAC_CONST(0.413452090327791) },
- { FRAC_CONST(0.907800354744844), FRAC_CONST(0.419402570241451) },
- { FRAC_CONST(0.905035947366364), FRAC_CONST(0.425335084344881) },
- { FRAC_CONST(0.902232771260093), FRAC_CONST(0.431249378508924) },
- { FRAC_CONST(0.899390946504764), FRAC_CONST(0.437145199384900) },
- { FRAC_CONST(0.896510594834693), FRAC_CONST(0.443022294415467) },
- { FRAC_CONST(0.893591839634558), FRAC_CONST(0.448880411845433) },
- { FRAC_CONST(0.890634805934118), FRAC_CONST(0.454719300732547) },
- { FRAC_CONST(0.887639620402854), FRAC_CONST(0.460538710958240) },
- { FRAC_CONST(0.884606411344546), FRAC_CONST(0.466338393238348) },
- { FRAC_CONST(0.881535308691775), FRAC_CONST(0.472118099133784) },
- { FRAC_CONST(0.878426444000357), FRAC_CONST(0.477877581061184) },
- { FRAC_CONST(0.875279950443708), FRAC_CONST(0.483616592303511) },
- { FRAC_CONST(0.872095962807140), FRAC_CONST(0.489334887020625) },
- { FRAC_CONST(0.868874617482085), FRAC_CONST(0.495032220259813) },
- { FRAC_CONST(0.865616052460258), FRAC_CONST(0.500708347966279) },
- { FRAC_CONST(0.862320407327736), FRAC_CONST(0.506363026993605) },
- { FRAC_CONST(0.858987823258990), FRAC_CONST(0.511996015114162) },
- { FRAC_CONST(0.855618443010829), FRAC_CONST(0.517607071029487) },
- { FRAC_CONST(0.852212410916289), FRAC_CONST(0.523195954380619) },
- { FRAC_CONST(0.848769872878448), FRAC_CONST(0.528762425758396) },
- { FRAC_CONST(0.845290976364179), FRAC_CONST(0.534306246713712) },
- { FRAC_CONST(0.841775870397828), FRAC_CONST(0.539827179767727) },
- { FRAC_CONST(0.838224705554838), FRAC_CONST(0.545324988422046) },
- { FRAC_CONST(0.834637633955290), FRAC_CONST(0.550799437168844) },
- { FRAC_CONST(0.831014809257393), FRAC_CONST(0.556250291500956) },
- { FRAC_CONST(0.827356386650900), FRAC_CONST(0.561677317921925) },
- { FRAC_CONST(0.823662522850458), FRAC_CONST(0.567080283956001) },
- { FRAC_CONST(0.819933376088899), FRAC_CONST(0.572458958158102) },
- { FRAC_CONST(0.816169106110459), FRAC_CONST(0.577813110123727) },
- { FRAC_CONST(0.812369874163934), FRAC_CONST(0.583142510498826) },
- { FRAC_CONST(0.808535842995778), FRAC_CONST(0.588446930989624) },
- { FRAC_CONST(0.804667176843123), FRAC_CONST(0.593726144372402) },
- { FRAC_CONST(0.800764041426753), FRAC_CONST(0.598979924503229) },
- { FRAC_CONST(0.796826603943998), FRAC_CONST(0.604208046327650) },
- { FRAC_CONST(0.792855033061574), FRAC_CONST(0.609410285890327) },
- { FRAC_CONST(0.788849498908361), FRAC_CONST(0.614586420344631) },
- { FRAC_CONST(0.784810173068109), FRAC_CONST(0.619736227962191) },
- { FRAC_CONST(0.780737228572094), FRAC_CONST(0.624859488142386) },
- { FRAC_CONST(0.776630839891703), FRAC_CONST(0.629955981421804) },
- { FRAC_CONST(0.772491182930959), FRAC_CONST(0.635025489483633) },
- { FRAC_CONST(0.768318435018988), FRAC_CONST(0.640067795167023) },
- { FRAC_CONST(0.764112774902423), FRAC_CONST(0.645082682476378) },
- { FRAC_CONST(0.759874382737746), FRAC_CONST(0.650069936590618) },
- { FRAC_CONST(0.755603440083571), FRAC_CONST(0.655029343872374) },
- { FRAC_CONST(0.751300129892866), FRAC_CONST(0.659960691877147) },
- { FRAC_CONST(0.746964636505118), FRAC_CONST(0.664863769362399) },
- { FRAC_CONST(0.742597145638433), FRAC_CONST(0.669738366296610) },
- { FRAC_CONST(0.738197844381584), FRAC_CONST(0.674584273868271) },
- { FRAC_CONST(0.733766921185995), FRAC_CONST(0.679401284494831) },
- { FRAC_CONST(0.729304565857668), FRAC_CONST(0.684189191831585) },
- { FRAC_CONST(0.724810969549055), FRAC_CONST(0.688947790780520) },
- { FRAC_CONST(0.720286324750863), FRAC_CONST(0.693676877499095) },
- { FRAC_CONST(0.715730825283819), FRAC_CONST(0.698376249408973) },
- { FRAC_CONST(0.711144666290356), FRAC_CONST(0.703045705204703) },
- { FRAC_CONST(0.706528044226263), FRAC_CONST(0.707685044862340) },
- { FRAC_CONST(0.701881156852263), FRAC_CONST(0.712294069648014) },
- { FRAC_CONST(0.697204203225545), FRAC_CONST(0.716872582126442) },
- { FRAC_CONST(0.692497383691237), FRAC_CONST(0.721420386169390) },
- { FRAC_CONST(0.687760899873822), FRAC_CONST(0.725937286964068) },
- { FRAC_CONST(0.682994954668502), FRAC_CONST(0.730423091021479) },
- { FRAC_CONST(0.678199752232508), FRAC_CONST(0.734877606184707) },
- { FRAC_CONST(0.673375497976352), FRAC_CONST(0.739300641637149) },
- { FRAC_CONST(0.668522398555031), FRAC_CONST(0.743692007910687) },
- { FRAC_CONST(0.663640661859171), FRAC_CONST(0.748051516893805) },
- { FRAC_CONST(0.658730497006124), FRAC_CONST(0.752378981839648) },
- { FRAC_CONST(0.653792114331011), FRAC_CONST(0.756674217374021) },
- { FRAC_CONST(0.648825725377709), FRAC_CONST(0.760937039503328) },
- { FRAC_CONST(0.643831542889792), FRAC_CONST(0.765167265622459) },
- { FRAC_CONST(0.638809780801414), FRAC_CONST(0.769364714522605) },
- { FRAC_CONST(0.633760654228152), FRAC_CONST(0.773529206399025) },
- { FRAC_CONST(0.628684379457781), FRAC_CONST(0.777660562858748) },
- { FRAC_CONST(0.623581173941019), FRAC_CONST(0.781758606928213) },
- { FRAC_CONST(0.618451256282204), FRAC_CONST(0.785823163060853) },
- { FRAC_CONST(0.613294846229936), FRAC_CONST(0.789854057144609) },
- { FRAC_CONST(0.608112164667659), FRAC_CONST(0.793851116509396) },
- { FRAC_CONST(0.602903433604202), FRAC_CONST(0.797814169934493) },
- { FRAC_CONST(0.597668876164268), FRAC_CONST(0.801743047655882) },
- { FRAC_CONST(0.592408716578875), FRAC_CONST(0.805637581373517) },
- { FRAC_CONST(0.587123180175754), FRAC_CONST(0.809497604258536) },
- { FRAC_CONST(0.581812493369691), FRAC_CONST(0.813322950960406) },
- { FRAC_CONST(0.576476883652835), FRAC_CONST(0.817113457614006) },
- { FRAC_CONST(0.571116579584947), FRAC_CONST(0.820868961846646) },
- { FRAC_CONST(0.565731810783613), FRAC_CONST(0.824589302785025) },
- { FRAC_CONST(0.560322807914407), FRAC_CONST(0.828274321062119) },
- { FRAC_CONST(0.554889802681009), FRAC_CONST(0.831923858824010) },
- { FRAC_CONST(0.549433027815281), FRAC_CONST(0.835537759736646) },
- { FRAC_CONST(0.543952717067296), FRAC_CONST(0.839115868992540) },
- { FRAC_CONST(0.538449105195327), FRAC_CONST(0.842658033317402) },
- { FRAC_CONST(0.532922427955790), FRAC_CONST(0.846164100976699) },
- { FRAC_CONST(0.527372922093142), FRAC_CONST(0.849633921782164) },
- { FRAC_CONST(0.521800825329746), FRAC_CONST(0.853067347098221) },
- { FRAC_CONST(0.516206376355680), FRAC_CONST(0.856464229848356) },
- { FRAC_CONST(0.510589814818519), FRAC_CONST(0.859824424521420) },
- { FRAC_CONST(0.504951381313066), FRAC_CONST(0.863147787177854) },
- { FRAC_CONST(0.499291317371047), FRAC_CONST(0.866434175455865) },
- { FRAC_CONST(0.493609865450762), FRAC_CONST(0.869683448577516) },
- { FRAC_CONST(0.487907268926702), FRAC_CONST(0.872895467354761) },
- { FRAC_CONST(0.482183772079123), FRAC_CONST(0.876070094195407) },
- { FRAC_CONST(0.476439620083580), FRAC_CONST(0.879207193109004) },
- { FRAC_CONST(0.470675059000427), FRAC_CONST(0.882306629712678) },
- { FRAC_CONST(0.464890335764274), FRAC_CONST(0.885368271236879) },
- { FRAC_CONST(0.459085698173413), FRAC_CONST(0.888391986531075) },
- { FRAC_CONST(0.453261394879198), FRAC_CONST(0.891377646069366) },
- { FRAC_CONST(0.447417675375397), FRAC_CONST(0.894325121956035) },
- { FRAC_CONST(0.441554789987504), FRAC_CONST(0.897234287931024) },
- { FRAC_CONST(0.435672989862017), FRAC_CONST(0.900105019375345) },
- { FRAC_CONST(0.429772526955677), FRAC_CONST(0.902937193316419) },
- { FRAC_CONST(0.423853654024676), FRAC_CONST(0.905730688433339) },
- { FRAC_CONST(0.417916624613831), FRAC_CONST(0.908485385062073) },
- { FRAC_CONST(0.411961693045722), FRAC_CONST(0.911201165200584) },
- { FRAC_CONST(0.405989114409798), FRAC_CONST(0.913877912513892) },
- { FRAC_CONST(0.399999144551449), FRAC_CONST(0.916515512339049) },
- { FRAC_CONST(0.393992040061048), FRAC_CONST(0.919113851690058) },
- { FRAC_CONST(0.387968058262959), FRAC_CONST(0.921672819262709) },
- { FRAC_CONST(0.381927457204511), FRAC_CONST(0.924192305439348) },
- { FRAC_CONST(0.375870495644949), FRAC_CONST(0.926672202293573) },
- { FRAC_CONST(0.369797433044349), FRAC_CONST(0.929112403594856) },
- { FRAC_CONST(0.363708529552499), FRAC_CONST(0.931512804813095) },
- { FRAC_CONST(0.357604045997758), FRAC_CONST(0.933873303123091) },
- { FRAC_CONST(0.351484243875885), FRAC_CONST(0.936193797408954) },
- { FRAC_CONST(0.345349385338836), FRAC_CONST(0.938474188268430) },
- { FRAC_CONST(0.339199733183530), FRAC_CONST(0.940714378017165) },
- { FRAC_CONST(0.333035550840599), FRAC_CONST(0.942914270692887) },
- { FRAC_CONST(0.326857102363098), FRAC_CONST(0.945073772059514) },
- { FRAC_CONST(0.320664652415198), FRAC_CONST(0.947192789611197) },
- { FRAC_CONST(0.314458466260842), FRAC_CONST(0.949271232576274) },
- { FRAC_CONST(0.308238809752391), FRAC_CONST(0.951309011921168) },
- { FRAC_CONST(0.302005949319228), FRAC_CONST(0.953306040354194) },
- { FRAC_CONST(0.295760151956351), FRAC_CONST(0.955262232329299) },
- { FRAC_CONST(0.289501685212929), FRAC_CONST(0.957177504049732) },
- { FRAC_CONST(0.283230817180850), FRAC_CONST(0.959051773471624) },
- { FRAC_CONST(0.276947816483228), FRAC_CONST(0.960884960307514) },
- { FRAC_CONST(0.270652952262902), FRAC_CONST(0.962676986029777) },
- { FRAC_CONST(0.264346494170904), FRAC_CONST(0.964427773873996) },
- { FRAC_CONST(0.258028712354909), FRAC_CONST(0.966137248842248) },
- { FRAC_CONST(0.251699877447663), FRAC_CONST(0.967805337706313) },
- { FRAC_CONST(0.245360260555389), FRAC_CONST(0.969431969010818) },
- { FRAC_CONST(0.239010133246176), FRAC_CONST(0.971017073076290) },
- { FRAC_CONST(0.232649767538342), FRAC_CONST(0.972560582002147) },
- { FRAC_CONST(0.226279435888785), FRAC_CONST(0.974062429669605) },
- { FRAC_CONST(0.219899411181310), FRAC_CONST(0.975522551744506) },
- { FRAC_CONST(0.213509966714943), FRAC_CONST(0.976940885680082) },
- { FRAC_CONST(0.207111376192219), FRAC_CONST(0.978317370719628) },
- { FRAC_CONST(0.200703913707458), FRAC_CONST(0.979651947899104) },
- { FRAC_CONST(0.194287853735029), FRAC_CONST(0.980944560049668) },
- { FRAC_CONST(0.187863471117585), FRAC_CONST(0.982195151800116) },
- { FRAC_CONST(0.181431041054297), FRAC_CONST(0.983403669579260) },
- { FRAC_CONST(0.174990839089060), FRAC_CONST(0.984570061618221) },
- { FRAC_CONST(0.168543141098691), FRAC_CONST(0.985694277952645) },
- { FRAC_CONST(0.162088223281113), FRAC_CONST(0.986776270424848) },
- { FRAC_CONST(0.155626362143520), FRAC_CONST(0.987815992685872) },
- { FRAC_CONST(0.149157834490539), FRAC_CONST(0.988813400197476) },
- { FRAC_CONST(0.142682917412363), FRAC_CONST(0.989768450234042) },
- { FRAC_CONST(0.136201888272891), FRAC_CONST(0.990681101884405) },
- { FRAC_CONST(0.129715024697841), FRAC_CONST(0.991551316053606) },
- { FRAC_CONST(0.123222604562857), FRAC_CONST(0.992379055464567) },
- { FRAC_CONST(0.116724905981611), FRAC_CONST(0.993164284659685) },
- { FRAC_CONST(0.110222207293883), FRAC_CONST(0.993906970002356) },
- { FRAC_CONST(0.103714787053643), FRAC_CONST(0.994607079678411) },
- { FRAC_CONST(0.097202924017115), FRAC_CONST(0.995264583697482) },
- { FRAC_CONST(0.090686897130838), FRAC_CONST(0.995879453894286) },
- { FRAC_CONST(0.084166985519718), FRAC_CONST(0.996451663929828) },
- { FRAC_CONST(0.077643468475068), FRAC_CONST(0.996981189292537) },
- { FRAC_CONST(0.071116625442645), FRAC_CONST(0.997468007299307) },
- { FRAC_CONST(0.064586736010684), FRAC_CONST(0.997912097096476) },
- { FRAC_CONST(0.058054079897912), FRAC_CONST(0.998313439660714) },
- { FRAC_CONST(0.051518936941578), FRAC_CONST(0.998672017799843) },
- { FRAC_CONST(0.044981587085452), FRAC_CONST(0.998987816153567) },
- { FRAC_CONST(0.038442310367847), FRAC_CONST(0.999260821194138) },
- { FRAC_CONST(0.031901386909611), FRAC_CONST(0.999491021226926) },
- { FRAC_CONST(0.025359096902136), FRAC_CONST(0.999678406390929) },
- { FRAC_CONST(0.018815720595351), FRAC_CONST(0.999822968659191) },
- { FRAC_CONST(0.012271538285720), FRAC_CONST(0.999924701839145) },
- { FRAC_CONST(0.005726830304231), FRAC_CONST(0.999983601572879) }
-};
-#endif // LD_DEC
-
-/* 60 (N/4) complex twiddle factors */
-ALIGN static const complex_t mdct_tab_240[] =
-{
- { FRAC_CONST(0.999994645401696), FRAC_CONST(0.003272486506527) },
- { FRAC_CONST(0.999566308502021), FRAC_CONST(0.029448173247963) },
- { FRAC_CONST(0.998452918783950), FRAC_CONST(0.055603677682425) },
- { FRAC_CONST(0.996655239309180), FRAC_CONST(0.081721074133668) },
- { FRAC_CONST(0.994174502117428), FRAC_CONST(0.107782463042759) },
- { FRAC_CONST(0.991012407382049), FRAC_CONST(0.133769983235535) },
- { FRAC_CONST(0.987171122244825), FRAC_CONST(0.159665824163761) },
- { FRAC_CONST(0.982653279330712), FRAC_CONST(0.185452238111591) },
- { FRAC_CONST(0.977461974943572), FRAC_CONST(0.211111552358965) },
- { FRAC_CONST(0.971600766944121), FRAC_CONST(0.236626181293610) },
- { FRAC_CONST(0.965073672311547), FRAC_CONST(0.261978638463337) },
- { FRAC_CONST(0.957885164390477), FRAC_CONST(0.287151548560387) },
- { FRAC_CONST(0.950040169825165), FRAC_CONST(0.312127659329594) },
- { FRAC_CONST(0.941544065183021), FRAC_CONST(0.336889853392220) },
- { FRAC_CONST(0.932402673269775), FRAC_CONST(0.361421159977355) },
- { FRAC_CONST(0.922622259138823), FRAC_CONST(0.385704766552831) },
- { FRAC_CONST(0.912209525797468), FRAC_CONST(0.409724030347695) },
- { FRAC_CONST(0.901171609613013), FRAC_CONST(0.433462489758331) },
- { FRAC_CONST(0.889516075421856), FRAC_CONST(0.456903875630421) },
- { FRAC_CONST(0.877250911344924), FRAC_CONST(0.480032122409011) },
- { FRAC_CONST(0.864384523313017), FRAC_CONST(0.502831379149042) },
- { FRAC_CONST(0.850925729305802), FRAC_CONST(0.525286020378792) },
- { FRAC_CONST(0.836883753308409), FRAC_CONST(0.547380656808797) },
- { FRAC_CONST(0.822268218989775), FRAC_CONST(0.569100145878898) },
- { FRAC_CONST(0.807089143107059), FRAC_CONST(0.590429602136201) },
- { FRAC_CONST(0.791356928640660), FRAC_CONST(0.611354407436816) },
- { FRAC_CONST(0.775082357664531), FRAC_CONST(0.631860220964409) },
- { FRAC_CONST(0.758276583956687), FRAC_CONST(0.651932989058674) },
- { FRAC_CONST(0.740951125354959), FRAC_CONST(0.671558954847018) },
- { FRAC_CONST(0.723117855863248), FRAC_CONST(0.690724667672829) },
- { FRAC_CONST(0.704788997513670), FRAC_CONST(0.709416992313883) },
- { FRAC_CONST(0.685977111990193), FRAC_CONST(0.727623117984575) },
- { FRAC_CONST(0.666695092019479), FRAC_CONST(0.745330567115786) },
- { FRAC_CONST(0.646956152534857), FRAC_CONST(0.762527203906388) },
- { FRAC_CONST(0.626773821619469), FRAC_CONST(0.779201242640517) },
- { FRAC_CONST(0.606161931234795), FRAC_CONST(0.795341255764910) },
- { FRAC_CONST(0.585134607740916), FRAC_CONST(0.810936181720784) },
- { FRAC_CONST(0.563706262215017), FRAC_CONST(0.825975332524873) },
- { FRAC_CONST(0.541891580574752), FRAC_CONST(0.840448401094438) },
- { FRAC_CONST(0.519705513513249), FRAC_CONST(0.854345468311227) },
- { FRAC_CONST(0.497163266252654), FRAC_CONST(0.867657009819544) },
- { FRAC_CONST(0.474280288123229), FRAC_CONST(0.880373902553765) },
- { FRAC_CONST(0.451072261975153), FRAC_CONST(0.892487430990834) },
- { FRAC_CONST(0.427555093430282), FRAC_CONST(0.903989293123443) },
- { FRAC_CONST(0.403744899981227), FRAC_CONST(0.914871606149819) },
- { FRAC_CONST(0.379657999945233), FRAC_CONST(0.925126911876195) },
- { FRAC_CONST(0.355310901280416), FRAC_CONST(0.934748181828292) },
- { FRAC_CONST(0.330720290272038), FRAC_CONST(0.943728822068278) },
- { FRAC_CONST(0.305903020096554), FRAC_CONST(0.952062677713924) },
- { FRAC_CONST(0.280876099271292), FRAC_CONST(0.959744037156857) },
- { FRAC_CONST(0.255656679997665), FRAC_CONST(0.966767635977008) },
- { FRAC_CONST(0.230262046405902), FRAC_CONST(0.973128660550580) },
- { FRAC_CONST(0.204709602709380), FRAC_CONST(0.978822751349072) },
- { FRAC_CONST(0.179016861276633), FRAC_CONST(0.983846005927077) },
- { FRAC_CONST(0.153201430629259), FRAC_CONST(0.988194981596825) },
- { FRAC_CONST(0.127281003373913), FRAC_CONST(0.991866697787626) },
- { FRAC_CONST(0.101273344076683), FRAC_CONST(0.994858638088611) },
- { FRAC_CONST(0.075196277088140), FRAC_CONST(0.997168751973348) },
- { FRAC_CONST(0.049067674327418), FRAC_CONST(0.998795456205172) },
- { FRAC_CONST(0.022905443033697), FRAC_CONST(0.999737635922260) }
-};
-#endif // ALLOW_SMALL_FRAMELENGTH
-
-#ifdef SSR_DEC
-/* 128 (N/4) complex twiddle factors */
-ALIGN static const complex_t mdct_tab_512[] =
-{
- { FRAC_CONST(0.999998823451702), FRAC_CONST(0.001533980186285) },
- { FRAC_CONST(0.999904701082853), FRAC_CONST(0.013805388528060) },
- { FRAC_CONST(0.999659996743959), FRAC_CONST(0.026074717829104) },
- { FRAC_CONST(0.999264747286594), FRAC_CONST(0.038340120373553) },
- { FRAC_CONST(0.998719012233873), FRAC_CONST(0.050599749036899) },
- { FRAC_CONST(0.998022873771486), FRAC_CONST(0.062851757564161) },
- { FRAC_CONST(0.997176436735326), FRAC_CONST(0.075094300847921) },
- { FRAC_CONST(0.996179828595697), FRAC_CONST(0.087325535206192) },
- { FRAC_CONST(0.995033199438119), FRAC_CONST(0.099543618660069) },
- { FRAC_CONST(0.993736721940725), FRAC_CONST(0.111746711211127) },
- { FRAC_CONST(0.992290591348257), FRAC_CONST(0.123932975118512) },
- { FRAC_CONST(0.990695025442665), FRAC_CONST(0.136100575175706) },
- { FRAC_CONST(0.988950264510303), FRAC_CONST(0.148247678986896) },
- { FRAC_CONST(0.987056571305751), FRAC_CONST(0.160372457242928) },
- { FRAC_CONST(0.985014231012240), FRAC_CONST(0.172473083996796) },
- { FRAC_CONST(0.982823551198705), FRAC_CONST(0.184547736938620) },
- { FRAC_CONST(0.980484861773469), FRAC_CONST(0.196594597670080) },
- { FRAC_CONST(0.977998514934557), FRAC_CONST(0.208611851978263) },
- { FRAC_CONST(0.975364885116657), FRAC_CONST(0.220597690108874) },
- { FRAC_CONST(0.972584368934732), FRAC_CONST(0.232550307038775) },
- { FRAC_CONST(0.969657385124292), FRAC_CONST(0.244467902747824) },
- { FRAC_CONST(0.966584374478333), FRAC_CONST(0.256348682489943) },
- { FRAC_CONST(0.963365799780954), FRAC_CONST(0.268190857063403) },
- { FRAC_CONST(0.960002145737666), FRAC_CONST(0.279992643080273) },
- { FRAC_CONST(0.956493918902395), FRAC_CONST(0.291752263234989) },
- { FRAC_CONST(0.952841647601199), FRAC_CONST(0.303467946572011) },
- { FRAC_CONST(0.949045881852701), FRAC_CONST(0.315137928752522) },
- { FRAC_CONST(0.945107193285261), FRAC_CONST(0.326760452320132) },
- { FRAC_CONST(0.941026175050889), FRAC_CONST(0.338333766965541) },
- { FRAC_CONST(0.936803441735922), FRAC_CONST(0.349856129790135) },
- { FRAC_CONST(0.932439629268462), FRAC_CONST(0.361325805568454) },
- { FRAC_CONST(0.927935394822618), FRAC_CONST(0.372741067009516) },
- { FRAC_CONST(0.923291416719528), FRAC_CONST(0.384100195016935) },
- { FRAC_CONST(0.918508394325212), FRAC_CONST(0.395401478947816) },
- { FRAC_CONST(0.913587047945251), FRAC_CONST(0.406643216870369) },
- { FRAC_CONST(0.908528118716306), FRAC_CONST(0.417823715820212) },
- { FRAC_CONST(0.903332368494512), FRAC_CONST(0.428941292055329) },
- { FRAC_CONST(0.898000579740740), FRAC_CONST(0.439994271309633) },
- { FRAC_CONST(0.892533555402765), FRAC_CONST(0.450980989045104) },
- { FRAC_CONST(0.886932118794342), FRAC_CONST(0.461899790702463) },
- { FRAC_CONST(0.881197113471222), FRAC_CONST(0.472749031950343) },
- { FRAC_CONST(0.875329403104111), FRAC_CONST(0.483527078932919) },
- { FRAC_CONST(0.869329871348607), FRAC_CONST(0.494232308515960) },
- { FRAC_CONST(0.863199421712124), FRAC_CONST(0.504863108531268) },
- { FRAC_CONST(0.856938977417829), FRAC_CONST(0.515417878019463) },
- { FRAC_CONST(0.850549481265603), FRAC_CONST(0.525895027471085) },
- { FRAC_CONST(0.844031895490066), FRAC_CONST(0.536292979065963) },
- { FRAC_CONST(0.837387201615662), FRAC_CONST(0.546610166910835) },
- { FRAC_CONST(0.830616400308846), FRAC_CONST(0.556845037275160) },
- { FRAC_CONST(0.823720511227391), FRAC_CONST(0.566996048825109) },
- { FRAC_CONST(0.816700572866828), FRAC_CONST(0.577061672855679) },
- { FRAC_CONST(0.809557642404051), FRAC_CONST(0.587040393520918) },
- { FRAC_CONST(0.802292795538116), FRAC_CONST(0.596930708062197) },
- { FRAC_CONST(0.794907126328237), FRAC_CONST(0.606731127034524) },
- { FRAC_CONST(0.787401747029031), FRAC_CONST(0.616440174530854) },
- { FRAC_CONST(0.779777787923015), FRAC_CONST(0.626056388404344) },
- { FRAC_CONST(0.772036397150385), FRAC_CONST(0.635578320488556) },
- { FRAC_CONST(0.764178740536117), FRAC_CONST(0.645004536815544) },
- { FRAC_CONST(0.756206001414395), FRAC_CONST(0.654333617831800) },
- { FRAC_CONST(0.748119380450404), FRAC_CONST(0.663564158612040) },
- { FRAC_CONST(0.739920095459516), FRAC_CONST(0.672694769070773) },
- { FRAC_CONST(0.731609381223893), FRAC_CONST(0.681724074171650) },
- { FRAC_CONST(0.723188489306527), FRAC_CONST(0.690650714134535) },
- { FRAC_CONST(0.714658687862769), FRAC_CONST(0.699473344640284) },
- { FRAC_CONST(0.706021261449340), FRAC_CONST(0.708190637033195) },
- { FRAC_CONST(0.697277510830887), FRAC_CONST(0.716801278521100) },
- { FRAC_CONST(0.688428752784091), FRAC_CONST(0.725303972373061) },
- { FRAC_CONST(0.679476319899365), FRAC_CONST(0.733697438114660) },
- { FRAC_CONST(0.670421560380173), FRAC_CONST(0.741980411720831) },
- { FRAC_CONST(0.661265837839992), FRAC_CONST(0.750151645806215) },
- { FRAC_CONST(0.652010531096960), FRAC_CONST(0.758209909813015) },
- { FRAC_CONST(0.642657033966227), FRAC_CONST(0.766153990196313) },
- { FRAC_CONST(0.633206755050057), FRAC_CONST(0.773982690606823) },
- { FRAC_CONST(0.623661117525695), FRAC_CONST(0.781694832071059) },
- { FRAC_CONST(0.614021558931038), FRAC_CONST(0.789289253168886) },
- { FRAC_CONST(0.604289530948156), FRAC_CONST(0.796764810208419) },
- { FRAC_CONST(0.594466499184665), FRAC_CONST(0.804120377398266) },
- { FRAC_CONST(0.584553942953015), FRAC_CONST(0.811354847017064) },
- { FRAC_CONST(0.574553355047716), FRAC_CONST(0.818467129580299) },
- { FRAC_CONST(0.564466241520520), FRAC_CONST(0.825456154004377) },
- { FRAC_CONST(0.554294121453620), FRAC_CONST(0.832320867767930) },
- { FRAC_CONST(0.544038526730884), FRAC_CONST(0.839060237070313) },
- { FRAC_CONST(0.533701001807153), FRAC_CONST(0.845673246987299) },
- { FRAC_CONST(0.523283103475656), FRAC_CONST(0.852158901623920) },
- { FRAC_CONST(0.512786400633563), FRAC_CONST(0.858516224264443) },
- { FRAC_CONST(0.502212474045711), FRAC_CONST(0.864744257519462) },
- { FRAC_CONST(0.491562916106550), FRAC_CONST(0.870842063470079) },
- { FRAC_CONST(0.480839330600334), FRAC_CONST(0.876808723809146) },
- { FRAC_CONST(0.470043332459596), FRAC_CONST(0.882643339979563) },
- { FRAC_CONST(0.459176547521944), FRAC_CONST(0.888345033309596) },
- { FRAC_CONST(0.448240612285220), FRAC_CONST(0.893912945145203) },
- { FRAC_CONST(0.437237173661044), FRAC_CONST(0.899346236979341) },
- { FRAC_CONST(0.426167888726800), FRAC_CONST(0.904644090578246) },
- { FRAC_CONST(0.415034424476082), FRAC_CONST(0.909805708104652) },
- { FRAC_CONST(0.403838457567654), FRAC_CONST(0.914830312237946) },
- { FRAC_CONST(0.392581674072952), FRAC_CONST(0.919717146291227) },
- { FRAC_CONST(0.381265769222162), FRAC_CONST(0.924465474325263) },
- { FRAC_CONST(0.369892447148934), FRAC_CONST(0.929074581259316) },
- { FRAC_CONST(0.358463420633737), FRAC_CONST(0.933543772978836) },
- { FRAC_CONST(0.346980410845924), FRAC_CONST(0.937872376439990) },
- { FRAC_CONST(0.335445147084532), FRAC_CONST(0.942059739771017) },
- { FRAC_CONST(0.323859366517853), FRAC_CONST(0.946105232370403) },
- { FRAC_CONST(0.312224813921825), FRAC_CONST(0.950008245001843) },
- { FRAC_CONST(0.300543241417273), FRAC_CONST(0.953768189885990) },
- { FRAC_CONST(0.288816408206049), FRAC_CONST(0.957384500788976) },
- { FRAC_CONST(0.277046080306100), FRAC_CONST(0.960856633107680) },
- { FRAC_CONST(0.265234030285512), FRAC_CONST(0.964184063951746) },
- { FRAC_CONST(0.253382036995570), FRAC_CONST(0.967366292222329) },
- { FRAC_CONST(0.241491885302869), FRAC_CONST(0.970402838687556) },
- { FRAC_CONST(0.229565365820519), FRAC_CONST(0.973293246054698) },
- { FRAC_CONST(0.217604274638484), FRAC_CONST(0.976037079039039) },
- { FRAC_CONST(0.205610413053099), FRAC_CONST(0.978633924429423) },
- { FRAC_CONST(0.193585587295804), FRAC_CONST(0.981083391150487) },
- { FRAC_CONST(0.181531608261125), FRAC_CONST(0.983385110321551) },
- { FRAC_CONST(0.169450291233968), FRAC_CONST(0.985538735312176) },
- { FRAC_CONST(0.157343455616238), FRAC_CONST(0.987543941794359) },
- { FRAC_CONST(0.145212924652848), FRAC_CONST(0.989400427791380) },
- { FRAC_CONST(0.133060525157139), FRAC_CONST(0.991107913723277) },
- { FRAC_CONST(0.120888087235777), FRAC_CONST(0.992666142448948) },
- { FRAC_CONST(0.108697444013139), FRAC_CONST(0.994074879304879) },
- { FRAC_CONST(0.096490431355253), FRAC_CONST(0.995333912140482) },
- { FRAC_CONST(0.084268887593324), FRAC_CONST(0.996443051350043) },
- { FRAC_CONST(0.072034653246889), FRAC_CONST(0.997402129901275) },
- { FRAC_CONST(0.059789570746640), FRAC_CONST(0.998211003360478) },
- { FRAC_CONST(0.047535484156959), FRAC_CONST(0.998869549914284) },
- { FRAC_CONST(0.035274238898214), FRAC_CONST(0.999377670388003) },
- { FRAC_CONST(0.023007681468839), FRAC_CONST(0.999735288260562) },
- { FRAC_CONST(0.010737659167265), FRAC_CONST(0.999942349676024) }
-};
-
-/* 16 (N/4) complex twiddle factors */
-ALIGN static const complex_t mdct_tab_64[] =
-{
- { FRAC_CONST(0.999924701839145), FRAC_CONST(0.012271538285720) },
- { FRAC_CONST(0.993906970002356), FRAC_CONST(0.110222207293883) },
- { FRAC_CONST(0.978317370719628), FRAC_CONST(0.207111376192219) },
- { FRAC_CONST(0.953306040354194), FRAC_CONST(0.302005949319228) },
- { FRAC_CONST(0.919113851690058), FRAC_CONST(0.393992040061048) },
- { FRAC_CONST(0.876070094195407), FRAC_CONST(0.482183772079123) },
- { FRAC_CONST(0.824589302785025), FRAC_CONST(0.565731810783613) },
- { FRAC_CONST(0.765167265622459), FRAC_CONST(0.643831542889791) },
- { FRAC_CONST(0.698376249408973), FRAC_CONST(0.715730825283819) },
- { FRAC_CONST(0.624859488142386), FRAC_CONST(0.780737228572094) },
- { FRAC_CONST(0.545324988422046), FRAC_CONST(0.838224705554838) },
- { FRAC_CONST(0.460538710958240), FRAC_CONST(0.887639620402854) },
- { FRAC_CONST(0.371317193951838), FRAC_CONST(0.928506080473215) },
- { FRAC_CONST(0.278519689385053), FRAC_CONST(0.960430519415566) },
- { FRAC_CONST(0.183039887955141), FRAC_CONST(0.983105487431216) },
- { FRAC_CONST(0.085797312344440), FRAC_CONST(0.996312612182778) }
-};
-#endif // SSR_DEC
-
-#else // FIXED_POINT
-
-/* 256 (N/4) complex twiddle factors */
-ALIGN static const complex_t mdct_tab_2048[] =
-{
- { FRAC_CONST(0.031249997702054), FRAC_CONST(0.000011984224612) },
- { FRAC_CONST(0.031249813866531), FRAC_CONST(0.000107857810004) },
- { FRAC_CONST(0.031249335895858), FRAC_CONST(0.000203730380198) },
- { FRAC_CONST(0.031248563794535), FRAC_CONST(0.000299601032804) },
- { FRAC_CONST(0.031247497569829), FRAC_CONST(0.000395468865451) },
- { FRAC_CONST(0.031246137231775), FRAC_CONST(0.000491332975794) },
- { FRAC_CONST(0.031244482793177), FRAC_CONST(0.000587192461525) },
- { FRAC_CONST(0.031242534269608), FRAC_CONST(0.000683046420376) },
- { FRAC_CONST(0.031240291679407), FRAC_CONST(0.000778893950134) },
- { FRAC_CONST(0.031237755043684), FRAC_CONST(0.000874734148645) },
- { FRAC_CONST(0.031234924386313), FRAC_CONST(0.000970566113826) },
- { FRAC_CONST(0.031231799733938), FRAC_CONST(0.001066388943669) },
- { FRAC_CONST(0.031228381115970), FRAC_CONST(0.001162201736253) },
- { FRAC_CONST(0.031224668564585), FRAC_CONST(0.001258003589751) },
- { FRAC_CONST(0.031220662114728), FRAC_CONST(0.001353793602441) },
- { FRAC_CONST(0.031216361804108), FRAC_CONST(0.001449570872710) },
- { FRAC_CONST(0.031211767673203), FRAC_CONST(0.001545334499065) },
- { FRAC_CONST(0.031206879765253), FRAC_CONST(0.001641083580144) },
- { FRAC_CONST(0.031201698126266), FRAC_CONST(0.001736817214719) },
- { FRAC_CONST(0.031196222805014), FRAC_CONST(0.001832534501709) },
- { FRAC_CONST(0.031190453853031), FRAC_CONST(0.001928234540186) },
- { FRAC_CONST(0.031184391324617), FRAC_CONST(0.002023916429386) },
- { FRAC_CONST(0.031178035276836), FRAC_CONST(0.002119579268713) },
- { FRAC_CONST(0.031171385769513), FRAC_CONST(0.002215222157753) },
- { FRAC_CONST(0.031164442865236), FRAC_CONST(0.002310844196278) },
- { FRAC_CONST(0.031157206629353), FRAC_CONST(0.002406444484258) },
- { FRAC_CONST(0.031149677129975), FRAC_CONST(0.002502022121865) },
- { FRAC_CONST(0.031141854437973), FRAC_CONST(0.002597576209488) },
- { FRAC_CONST(0.031133738626977), FRAC_CONST(0.002693105847734) },
- { FRAC_CONST(0.031125329773375), FRAC_CONST(0.002788610137442) },
- { FRAC_CONST(0.031116627956316), FRAC_CONST(0.002884088179689) },
- { FRAC_CONST(0.031107633257703), FRAC_CONST(0.002979539075801) },
- { FRAC_CONST(0.031098345762200), FRAC_CONST(0.003074961927355) },
- { FRAC_CONST(0.031088765557222), FRAC_CONST(0.003170355836197) },
- { FRAC_CONST(0.031078892732942), FRAC_CONST(0.003265719904442) },
- { FRAC_CONST(0.031068727382288), FRAC_CONST(0.003361053234488) },
- { FRAC_CONST(0.031058269600939), FRAC_CONST(0.003456354929021) },
- { FRAC_CONST(0.031047519487329), FRAC_CONST(0.003551624091024) },
- { FRAC_CONST(0.031036477142640), FRAC_CONST(0.003646859823790) },
- { FRAC_CONST(0.031025142670809), FRAC_CONST(0.003742061230921) },
- { FRAC_CONST(0.031013516178519), FRAC_CONST(0.003837227416347) },
- { FRAC_CONST(0.031001597775203), FRAC_CONST(0.003932357484328) },
- { FRAC_CONST(0.030989387573042), FRAC_CONST(0.004027450539462) },
- { FRAC_CONST(0.030976885686963), FRAC_CONST(0.004122505686697) },
- { FRAC_CONST(0.030964092234638), FRAC_CONST(0.004217522031340) },
- { FRAC_CONST(0.030951007336485), FRAC_CONST(0.004312498679058) },
- { FRAC_CONST(0.030937631115663), FRAC_CONST(0.004407434735897) },
- { FRAC_CONST(0.030923963698074), FRAC_CONST(0.004502329308281) },
- { FRAC_CONST(0.030910005212362), FRAC_CONST(0.004597181503027) },
- { FRAC_CONST(0.030895755789908), FRAC_CONST(0.004691990427350) },
- { FRAC_CONST(0.030881215564835), FRAC_CONST(0.004786755188872) },
- { FRAC_CONST(0.030866384674000), FRAC_CONST(0.004881474895632) },
- { FRAC_CONST(0.030851263256996), FRAC_CONST(0.004976148656090) },
- { FRAC_CONST(0.030835851456154), FRAC_CONST(0.005070775579142) },
- { FRAC_CONST(0.030820149416533), FRAC_CONST(0.005165354774124) },
- { FRAC_CONST(0.030804157285929), FRAC_CONST(0.005259885350819) },
- { FRAC_CONST(0.030787875214864), FRAC_CONST(0.005354366419469) },
- { FRAC_CONST(0.030771303356593), FRAC_CONST(0.005448797090784) },
- { FRAC_CONST(0.030754441867095), FRAC_CONST(0.005543176475946) },
- { FRAC_CONST(0.030737290905077), FRAC_CONST(0.005637503686619) },
- { FRAC_CONST(0.030719850631972), FRAC_CONST(0.005731777834961) },
- { FRAC_CONST(0.030702121211932), FRAC_CONST(0.005825998033626) },
- { FRAC_CONST(0.030684102811835), FRAC_CONST(0.005920163395780) },
- { FRAC_CONST(0.030665795601276), FRAC_CONST(0.006014273035101) },
- { FRAC_CONST(0.030647199752570), FRAC_CONST(0.006108326065793) },
- { FRAC_CONST(0.030628315440748), FRAC_CONST(0.006202321602594) },
- { FRAC_CONST(0.030609142843557), FRAC_CONST(0.006296258760782) },
- { FRAC_CONST(0.030589682141455), FRAC_CONST(0.006390136656185) },
- { FRAC_CONST(0.030569933517616), FRAC_CONST(0.006483954405188) },
- { FRAC_CONST(0.030549897157919), FRAC_CONST(0.006577711124743) },
- { FRAC_CONST(0.030529573250956), FRAC_CONST(0.006671405932375) },
- { FRAC_CONST(0.030508961988022), FRAC_CONST(0.006765037946194) },
- { FRAC_CONST(0.030488063563118), FRAC_CONST(0.006858606284900) },
- { FRAC_CONST(0.030466878172949), FRAC_CONST(0.006952110067791) },
- { FRAC_CONST(0.030445406016919), FRAC_CONST(0.007045548414774) },
- { FRAC_CONST(0.030423647297133), FRAC_CONST(0.007138920446372) },
- { FRAC_CONST(0.030401602218392), FRAC_CONST(0.007232225283733) },
- { FRAC_CONST(0.030379270988192), FRAC_CONST(0.007325462048634) },
- { FRAC_CONST(0.030356653816724), FRAC_CONST(0.007418629863497) },
- { FRAC_CONST(0.030333750916869), FRAC_CONST(0.007511727851390) },
- { FRAC_CONST(0.030310562504198), FRAC_CONST(0.007604755136040) },
- { FRAC_CONST(0.030287088796968), FRAC_CONST(0.007697710841838) },
- { FRAC_CONST(0.030263330016124), FRAC_CONST(0.007790594093851) },
- { FRAC_CONST(0.030239286385293), FRAC_CONST(0.007883404017824) },
- { FRAC_CONST(0.030214958130781), FRAC_CONST(0.007976139740197) },
- { FRAC_CONST(0.030190345481576), FRAC_CONST(0.008068800388104) },
- { FRAC_CONST(0.030165448669342), FRAC_CONST(0.008161385089390) },
- { FRAC_CONST(0.030140267928416), FRAC_CONST(0.008253892972610) },
- { FRAC_CONST(0.030114803495809), FRAC_CONST(0.008346323167047) },
- { FRAC_CONST(0.030089055611203), FRAC_CONST(0.008438674802711) },
- { FRAC_CONST(0.030063024516947), FRAC_CONST(0.008530947010354) },
- { FRAC_CONST(0.030036710458054), FRAC_CONST(0.008623138921475) },
- { FRAC_CONST(0.030010113682202), FRAC_CONST(0.008715249668328) },
- { FRAC_CONST(0.029983234439732), FRAC_CONST(0.008807278383932) },
- { FRAC_CONST(0.029956072983640), FRAC_CONST(0.008899224202078) },
- { FRAC_CONST(0.029928629569580), FRAC_CONST(0.008991086257336) },
- { FRAC_CONST(0.029900904455860), FRAC_CONST(0.009082863685067) },
- { FRAC_CONST(0.029872897903441), FRAC_CONST(0.009174555621425) },
- { FRAC_CONST(0.029844610175929), FRAC_CONST(0.009266161203371) },
- { FRAC_CONST(0.029816041539579), FRAC_CONST(0.009357679568679) },
- { FRAC_CONST(0.029787192263292), FRAC_CONST(0.009449109855944) },
- { FRAC_CONST(0.029758062618606), FRAC_CONST(0.009540451204587) },
- { FRAC_CONST(0.029728652879702), FRAC_CONST(0.009631702754871) },
- { FRAC_CONST(0.029698963323395), FRAC_CONST(0.009722863647900) },
- { FRAC_CONST(0.029668994229134), FRAC_CONST(0.009813933025633) },
- { FRAC_CONST(0.029638745879000), FRAC_CONST(0.009904910030891) },
- { FRAC_CONST(0.029608218557702), FRAC_CONST(0.009995793807363) },
- { FRAC_CONST(0.029577412552575), FRAC_CONST(0.010086583499618) },
- { FRAC_CONST(0.029546328153577), FRAC_CONST(0.010177278253107) },
- { FRAC_CONST(0.029514965653285), FRAC_CONST(0.010267877214177) },
- { FRAC_CONST(0.029483325346896), FRAC_CONST(0.010358379530076) },
- { FRAC_CONST(0.029451407532220), FRAC_CONST(0.010448784348962) },
- { FRAC_CONST(0.029419212509679), FRAC_CONST(0.010539090819911) },
- { FRAC_CONST(0.029386740582307), FRAC_CONST(0.010629298092923) },
- { FRAC_CONST(0.029353992055740), FRAC_CONST(0.010719405318933) },
- { FRAC_CONST(0.029320967238220), FRAC_CONST(0.010809411649818) },
- { FRAC_CONST(0.029287666440590), FRAC_CONST(0.010899316238403) },
- { FRAC_CONST(0.029254089976290), FRAC_CONST(0.010989118238474) },
- { FRAC_CONST(0.029220238161353), FRAC_CONST(0.011078816804778) },
- { FRAC_CONST(0.029186111314406), FRAC_CONST(0.011168411093039) },
- { FRAC_CONST(0.029151709756664), FRAC_CONST(0.011257900259961) },
- { FRAC_CONST(0.029117033811927), FRAC_CONST(0.011347283463239) },
- { FRAC_CONST(0.029082083806579), FRAC_CONST(0.011436559861563) },
- { FRAC_CONST(0.029046860069582), FRAC_CONST(0.011525728614630) },
- { FRAC_CONST(0.029011362932476), FRAC_CONST(0.011614788883150) },
- { FRAC_CONST(0.028975592729373), FRAC_CONST(0.011703739828853) },
- { FRAC_CONST(0.028939549796957), FRAC_CONST(0.011792580614500) },
- { FRAC_CONST(0.028903234474475), FRAC_CONST(0.011881310403886) },
- { FRAC_CONST(0.028866647103744), FRAC_CONST(0.011969928361855) },
- { FRAC_CONST(0.028829788029135), FRAC_CONST(0.012058433654299) },
- { FRAC_CONST(0.028792657597583), FRAC_CONST(0.012146825448172) },
- { FRAC_CONST(0.028755256158571), FRAC_CONST(0.012235102911499) },
- { FRAC_CONST(0.028717584064137), FRAC_CONST(0.012323265213377) },
- { FRAC_CONST(0.028679641668864), FRAC_CONST(0.012411311523990) },
- { FRAC_CONST(0.028641429329882), FRAC_CONST(0.012499241014612) },
- { FRAC_CONST(0.028602947406859), FRAC_CONST(0.012587052857618) },
- { FRAC_CONST(0.028564196262001), FRAC_CONST(0.012674746226488) },
- { FRAC_CONST(0.028525176260050), FRAC_CONST(0.012762320295819) },
- { FRAC_CONST(0.028485887768276), FRAC_CONST(0.012849774241331) },
- { FRAC_CONST(0.028446331156478), FRAC_CONST(0.012937107239875) },
- { FRAC_CONST(0.028406506796976), FRAC_CONST(0.013024318469437) },
- { FRAC_CONST(0.028366415064615), FRAC_CONST(0.013111407109155) },
- { FRAC_CONST(0.028326056336751), FRAC_CONST(0.013198372339315) },
- { FRAC_CONST(0.028285430993258), FRAC_CONST(0.013285213341368) },
- { FRAC_CONST(0.028244539416515), FRAC_CONST(0.013371929297933) },
- { FRAC_CONST(0.028203381991411), FRAC_CONST(0.013458519392807) },
- { FRAC_CONST(0.028161959105334), FRAC_CONST(0.013544982810971) },
- { FRAC_CONST(0.028120271148172), FRAC_CONST(0.013631318738598) },
- { FRAC_CONST(0.028078318512309), FRAC_CONST(0.013717526363062) },
- { FRAC_CONST(0.028036101592619), FRAC_CONST(0.013803604872943) },
- { FRAC_CONST(0.027993620786463), FRAC_CONST(0.013889553458039) },
- { FRAC_CONST(0.027950876493687), FRAC_CONST(0.013975371309367) },
- { FRAC_CONST(0.027907869116616), FRAC_CONST(0.014061057619178) },
- { FRAC_CONST(0.027864599060052), FRAC_CONST(0.014146611580959) },
- { FRAC_CONST(0.027821066731270), FRAC_CONST(0.014232032389445) },
- { FRAC_CONST(0.027777272540012), FRAC_CONST(0.014317319240622) },
- { FRAC_CONST(0.027733216898487), FRAC_CONST(0.014402471331737) },
- { FRAC_CONST(0.027688900221361), FRAC_CONST(0.014487487861307) },
- { FRAC_CONST(0.027644322925762), FRAC_CONST(0.014572368029123) },
- { FRAC_CONST(0.027599485431266), FRAC_CONST(0.014657111036262) },
- { FRAC_CONST(0.027554388159903), FRAC_CONST(0.014741716085090) },
- { FRAC_CONST(0.027509031536144), FRAC_CONST(0.014826182379271) },
- { FRAC_CONST(0.027463415986904), FRAC_CONST(0.014910509123778) },
- { FRAC_CONST(0.027417541941533), FRAC_CONST(0.014994695524894) },
- { FRAC_CONST(0.027371409831816), FRAC_CONST(0.015078740790225) },
- { FRAC_CONST(0.027325020091965), FRAC_CONST(0.015162644128704) },
- { FRAC_CONST(0.027278373158618), FRAC_CONST(0.015246404750603) },
- { FRAC_CONST(0.027231469470833), FRAC_CONST(0.015330021867534) },
- { FRAC_CONST(0.027184309470088), FRAC_CONST(0.015413494692460) },
- { FRAC_CONST(0.027136893600268), FRAC_CONST(0.015496822439704) },
- { FRAC_CONST(0.027089222307671), FRAC_CONST(0.015580004324954) },
- { FRAC_CONST(0.027041296040997), FRAC_CONST(0.015663039565269) },
- { FRAC_CONST(0.026993115251345), FRAC_CONST(0.015745927379091) },
- { FRAC_CONST(0.026944680392213), FRAC_CONST(0.015828666986247) },
- { FRAC_CONST(0.026895991919487), FRAC_CONST(0.015911257607961) },
- { FRAC_CONST(0.026847050291442), FRAC_CONST(0.015993698466859) },
- { FRAC_CONST(0.026797855968734), FRAC_CONST(0.016075988786976) },
- { FRAC_CONST(0.026748409414401), FRAC_CONST(0.016158127793763) },
- { FRAC_CONST(0.026698711093851), FRAC_CONST(0.016240114714099) },
- { FRAC_CONST(0.026648761474864), FRAC_CONST(0.016321948776289) },
- { FRAC_CONST(0.026598561027585), FRAC_CONST(0.016403629210082) },
- { FRAC_CONST(0.026548110224519), FRAC_CONST(0.016485155246669) },
- { FRAC_CONST(0.026497409540530), FRAC_CONST(0.016566526118696) },
- { FRAC_CONST(0.026446459452830), FRAC_CONST(0.016647741060271) },
- { FRAC_CONST(0.026395260440982), FRAC_CONST(0.016728799306966) },
- { FRAC_CONST(0.026343812986890), FRAC_CONST(0.016809700095831) },
- { FRAC_CONST(0.026292117574797), FRAC_CONST(0.016890442665397) },
- { FRAC_CONST(0.026240174691280), FRAC_CONST(0.016971026255683) },
- { FRAC_CONST(0.026187984825246), FRAC_CONST(0.017051450108208) },
- { FRAC_CONST(0.026135548467924), FRAC_CONST(0.017131713465990) },
- { FRAC_CONST(0.026082866112867), FRAC_CONST(0.017211815573560) },
- { FRAC_CONST(0.026029938255941), FRAC_CONST(0.017291755676967) },
- { FRAC_CONST(0.025976765395322), FRAC_CONST(0.017371533023784) },
- { FRAC_CONST(0.025923348031494), FRAC_CONST(0.017451146863116) },
- { FRAC_CONST(0.025869686667242), FRAC_CONST(0.017530596445607) },
- { FRAC_CONST(0.025815781807646), FRAC_CONST(0.017609881023449) },
- { FRAC_CONST(0.025761633960080), FRAC_CONST(0.017688999850383) },
- { FRAC_CONST(0.025707243634204), FRAC_CONST(0.017767952181715) },
- { FRAC_CONST(0.025652611341960), FRAC_CONST(0.017846737274313) },
- { FRAC_CONST(0.025597737597568), FRAC_CONST(0.017925354386623) },
- { FRAC_CONST(0.025542622917522), FRAC_CONST(0.018003802778671) },
- { FRAC_CONST(0.025487267820581), FRAC_CONST(0.018082081712071) },
- { FRAC_CONST(0.025431672827768), FRAC_CONST(0.018160190450031) },
- { FRAC_CONST(0.025375838462365), FRAC_CONST(0.018238128257362) },
- { FRAC_CONST(0.025319765249906), FRAC_CONST(0.018315894400484) },
- { FRAC_CONST(0.025263453718173), FRAC_CONST(0.018393488147432) },
- { FRAC_CONST(0.025206904397193), FRAC_CONST(0.018470908767865) },
- { FRAC_CONST(0.025150117819228), FRAC_CONST(0.018548155533070) },
- { FRAC_CONST(0.025093094518776), FRAC_CONST(0.018625227715971) },
- { FRAC_CONST(0.025035835032562), FRAC_CONST(0.018702124591135) },
- { FRAC_CONST(0.024978339899534), FRAC_CONST(0.018778845434780) },
- { FRAC_CONST(0.024920609660858), FRAC_CONST(0.018855389524780) },
- { FRAC_CONST(0.024862644859912), FRAC_CONST(0.018931756140672) },
- { FRAC_CONST(0.024804446042284), FRAC_CONST(0.019007944563666) },
- { FRAC_CONST(0.024746013755764), FRAC_CONST(0.019083954076646) },
- { FRAC_CONST(0.024687348550337), FRAC_CONST(0.019159783964183) },
- { FRAC_CONST(0.024628450978184), FRAC_CONST(0.019235433512536) },
- { FRAC_CONST(0.024569321593670), FRAC_CONST(0.019310902009663) },
- { FRAC_CONST(0.024509960953345), FRAC_CONST(0.019386188745225) },
- { FRAC_CONST(0.024450369615932), FRAC_CONST(0.019461293010596) },
- { FRAC_CONST(0.024390548142329), FRAC_CONST(0.019536214098866) },
- { FRAC_CONST(0.024330497095598), FRAC_CONST(0.019610951304848) },
- { FRAC_CONST(0.024270217040961), FRAC_CONST(0.019685503925087) },
- { FRAC_CONST(0.024209708545799), FRAC_CONST(0.019759871257867) },
- { FRAC_CONST(0.024148972179639), FRAC_CONST(0.019834052603212) },
- { FRAC_CONST(0.024088008514157), FRAC_CONST(0.019908047262901) },
- { FRAC_CONST(0.024026818123164), FRAC_CONST(0.019981854540467) },
- { FRAC_CONST(0.023965401582609), FRAC_CONST(0.020055473741208) },
- { FRAC_CONST(0.023903759470567), FRAC_CONST(0.020128904172192) },
- { FRAC_CONST(0.023841892367236), FRAC_CONST(0.020202145142264) },
- { FRAC_CONST(0.023779800854935), FRAC_CONST(0.020275195962052) },
- { FRAC_CONST(0.023717485518092), FRAC_CONST(0.020348055943974) },
- { FRAC_CONST(0.023654946943242), FRAC_CONST(0.020420724402244) },
- { FRAC_CONST(0.023592185719023), FRAC_CONST(0.020493200652878) },
- { FRAC_CONST(0.023529202436167), FRAC_CONST(0.020565484013703) },
- { FRAC_CONST(0.023465997687496), FRAC_CONST(0.020637573804361) },
- { FRAC_CONST(0.023402572067918), FRAC_CONST(0.020709469346314) },
- { FRAC_CONST(0.023338926174419), FRAC_CONST(0.020781169962854) },
- { FRAC_CONST(0.023275060606058), FRAC_CONST(0.020852674979108) },
- { FRAC_CONST(0.023210975963963), FRAC_CONST(0.020923983722044) },
- { FRAC_CONST(0.023146672851322), FRAC_CONST(0.020995095520475) },
- { FRAC_CONST(0.023082151873380), FRAC_CONST(0.021066009705072) },
- { FRAC_CONST(0.023017413637435), FRAC_CONST(0.021136725608363) },
- { FRAC_CONST(0.022952458752826), FRAC_CONST(0.021207242564742) },
- { FRAC_CONST(0.022887287830934), FRAC_CONST(0.021277559910478) },
- { FRAC_CONST(0.022821901485173), FRAC_CONST(0.021347676983716) },
- { FRAC_CONST(0.022756300330983), FRAC_CONST(0.021417593124488) },
- { FRAC_CONST(0.022690484985827), FRAC_CONST(0.021487307674717) },
- { FRAC_CONST(0.022624456069185), FRAC_CONST(0.021556819978223) },
- { FRAC_CONST(0.022558214202547), FRAC_CONST(0.021626129380729) },
- { FRAC_CONST(0.022491760009405), FRAC_CONST(0.021695235229869) },
- { FRAC_CONST(0.022425094115252), FRAC_CONST(0.021764136875192) },
- { FRAC_CONST(0.022358217147572), FRAC_CONST(0.021832833668171) },
- { FRAC_CONST(0.022291129735838), FRAC_CONST(0.021901324962204) },
- { FRAC_CONST(0.022223832511501), FRAC_CONST(0.021969610112625) },
- { FRAC_CONST(0.022156326107988), FRAC_CONST(0.022037688476709) },
- { FRAC_CONST(0.022088611160696), FRAC_CONST(0.022105559413676) },
- { FRAC_CONST(0.022020688306983), FRAC_CONST(0.022173222284699) },
- { FRAC_CONST(0.021952558186166), FRAC_CONST(0.022240676452909) },
- { FRAC_CONST(0.021884221439510), FRAC_CONST(0.022307921283403) },
- { FRAC_CONST(0.021815678710228), FRAC_CONST(0.022374956143245) },
- { FRAC_CONST(0.021746930643469), FRAC_CONST(0.022441780401478) },
- { FRAC_CONST(0.021677977886316), FRAC_CONST(0.022508393429127) },
- { FRAC_CONST(0.021608821087780), FRAC_CONST(0.022574794599206) },
- { FRAC_CONST(0.021539460898790), FRAC_CONST(0.022640983286719) },
- { FRAC_CONST(0.021469897972190), FRAC_CONST(0.022706958868676) },
- { FRAC_CONST(0.021400132962735), FRAC_CONST(0.022772720724087) },
- { FRAC_CONST(0.021330166527077), FRAC_CONST(0.022838268233979) },
- { FRAC_CONST(0.021259999323769), FRAC_CONST(0.022903600781391) },
- { FRAC_CONST(0.021189632013250), FRAC_CONST(0.022968717751391) },
- { FRAC_CONST(0.021119065257845), FRAC_CONST(0.023033618531071) },
- { FRAC_CONST(0.021048299721754), FRAC_CONST(0.023098302509561) },
- { FRAC_CONST(0.020977336071050), FRAC_CONST(0.023162769078031) },
- { FRAC_CONST(0.020906174973670), FRAC_CONST(0.023227017629698) },
- { FRAC_CONST(0.020834817099409), FRAC_CONST(0.023291047559828) },
- { FRAC_CONST(0.020763263119915), FRAC_CONST(0.023354858265748) },
- { FRAC_CONST(0.020691513708680), FRAC_CONST(0.023418449146848) },
- { FRAC_CONST(0.020619569541038), FRAC_CONST(0.023481819604585) },
- { FRAC_CONST(0.020547431294155), FRAC_CONST(0.023544969042494) },
- { FRAC_CONST(0.020475099647023), FRAC_CONST(0.023607896866186) },
- { FRAC_CONST(0.020402575280455), FRAC_CONST(0.023670602483363) },
- { FRAC_CONST(0.020329858877078), FRAC_CONST(0.023733085303813) },
- { FRAC_CONST(0.020256951121327), FRAC_CONST(0.023795344739427) },
- { FRAC_CONST(0.020183852699437), FRAC_CONST(0.023857380204193) },
- { FRAC_CONST(0.020110564299439), FRAC_CONST(0.023919191114211) },
- { FRAC_CONST(0.020037086611150), FRAC_CONST(0.023980776887692) },
- { FRAC_CONST(0.019963420326171), FRAC_CONST(0.024042136944968) },
- { FRAC_CONST(0.019889566137877), FRAC_CONST(0.024103270708495) },
- { FRAC_CONST(0.019815524741412), FRAC_CONST(0.024164177602859) },
- { FRAC_CONST(0.019741296833681), FRAC_CONST(0.024224857054779) },
- { FRAC_CONST(0.019666883113346), FRAC_CONST(0.024285308493120) },
- { FRAC_CONST(0.019592284280817), FRAC_CONST(0.024345531348888) },
- { FRAC_CONST(0.019517501038246), FRAC_CONST(0.024405525055242) },
- { FRAC_CONST(0.019442534089523), FRAC_CONST(0.024465289047500) },
- { FRAC_CONST(0.019367384140264), FRAC_CONST(0.024524822763141) },
- { FRAC_CONST(0.019292051897809), FRAC_CONST(0.024584125641809) },
- { FRAC_CONST(0.019216538071215), FRAC_CONST(0.024643197125323) },
- { FRAC_CONST(0.019140843371246), FRAC_CONST(0.024702036657681) },
- { FRAC_CONST(0.019064968510369), FRAC_CONST(0.024760643685063) },
- { FRAC_CONST(0.018988914202748), FRAC_CONST(0.024819017655836) },
- { FRAC_CONST(0.018912681164234), FRAC_CONST(0.024877158020562) },
- { FRAC_CONST(0.018836270112363), FRAC_CONST(0.024935064232003) },
- { FRAC_CONST(0.018759681766343), FRAC_CONST(0.024992735745123) },
- { FRAC_CONST(0.018682916847054), FRAC_CONST(0.025050172017095) },
- { FRAC_CONST(0.018605976077037), FRAC_CONST(0.025107372507308) },
- { FRAC_CONST(0.018528860180486), FRAC_CONST(0.025164336677369) },
- { FRAC_CONST(0.018451569883247), FRAC_CONST(0.025221063991110) },
- { FRAC_CONST(0.018374105912805), FRAC_CONST(0.025277553914591) },
- { FRAC_CONST(0.018296468998280), FRAC_CONST(0.025333805916107) },
- { FRAC_CONST(0.018218659870421), FRAC_CONST(0.025389819466194) },
- { FRAC_CONST(0.018140679261596), FRAC_CONST(0.025445594037630) },
- { FRAC_CONST(0.018062527905790), FRAC_CONST(0.025501129105445) },
- { FRAC_CONST(0.017984206538592), FRAC_CONST(0.025556424146920) },
- { FRAC_CONST(0.017905715897192), FRAC_CONST(0.025611478641598) },
- { FRAC_CONST(0.017827056720375), FRAC_CONST(0.025666292071285) },
- { FRAC_CONST(0.017748229748511), FRAC_CONST(0.025720863920056) },
- { FRAC_CONST(0.017669235723550), FRAC_CONST(0.025775193674260) },
- { FRAC_CONST(0.017590075389012), FRAC_CONST(0.025829280822525) },
- { FRAC_CONST(0.017510749489986), FRAC_CONST(0.025883124855762) },
- { FRAC_CONST(0.017431258773116), FRAC_CONST(0.025936725267170) },
- { FRAC_CONST(0.017351603986600), FRAC_CONST(0.025990081552242) },
- { FRAC_CONST(0.017271785880180), FRAC_CONST(0.026043193208768) },
- { FRAC_CONST(0.017191805205132), FRAC_CONST(0.026096059736841) },
- { FRAC_CONST(0.017111662714267), FRAC_CONST(0.026148680638861) },
- { FRAC_CONST(0.017031359161915), FRAC_CONST(0.026201055419541) },
- { FRAC_CONST(0.016950895303924), FRAC_CONST(0.026253183585908) },
- { FRAC_CONST(0.016870271897651), FRAC_CONST(0.026305064647313) },
- { FRAC_CONST(0.016789489701954), FRAC_CONST(0.026356698115431) },
- { FRAC_CONST(0.016708549477186), FRAC_CONST(0.026408083504269) },
- { FRAC_CONST(0.016627451985187), FRAC_CONST(0.026459220330167) },
- { FRAC_CONST(0.016546197989277), FRAC_CONST(0.026510108111806) },
- { FRAC_CONST(0.016464788254250), FRAC_CONST(0.026560746370212) },
- { FRAC_CONST(0.016383223546365), FRAC_CONST(0.026611134628757) },
- { FRAC_CONST(0.016301504633341), FRAC_CONST(0.026661272413168) },
- { FRAC_CONST(0.016219632284346), FRAC_CONST(0.026711159251530) },
- { FRAC_CONST(0.016137607269996), FRAC_CONST(0.026760794674288) },
- { FRAC_CONST(0.016055430362340), FRAC_CONST(0.026810178214254) },
- { FRAC_CONST(0.015973102334858), FRAC_CONST(0.026859309406613) },
- { FRAC_CONST(0.015890623962454), FRAC_CONST(0.026908187788922) },
- { FRAC_CONST(0.015807996021446), FRAC_CONST(0.026956812901119) },
- { FRAC_CONST(0.015725219289558), FRAC_CONST(0.027005184285527) },
- { FRAC_CONST(0.015642294545918), FRAC_CONST(0.027053301486856) },
- { FRAC_CONST(0.015559222571044), FRAC_CONST(0.027101164052208) },
- { FRAC_CONST(0.015476004146842), FRAC_CONST(0.027148771531083) },
- { FRAC_CONST(0.015392640056594), FRAC_CONST(0.027196123475380) },
- { FRAC_CONST(0.015309131084956), FRAC_CONST(0.027243219439406) },
- { FRAC_CONST(0.015225478017946), FRAC_CONST(0.027290058979875) },
- { FRAC_CONST(0.015141681642938), FRAC_CONST(0.027336641655915) },
- { FRAC_CONST(0.015057742748656), FRAC_CONST(0.027382967029073) },
- { FRAC_CONST(0.014973662125164), FRAC_CONST(0.027429034663317) },
- { FRAC_CONST(0.014889440563862), FRAC_CONST(0.027474844125040) },
- { FRAC_CONST(0.014805078857474), FRAC_CONST(0.027520394983066) },
- { FRAC_CONST(0.014720577800046), FRAC_CONST(0.027565686808654) },
- { FRAC_CONST(0.014635938186934), FRAC_CONST(0.027610719175499) },
- { FRAC_CONST(0.014551160814797), FRAC_CONST(0.027655491659740) },
- { FRAC_CONST(0.014466246481592), FRAC_CONST(0.027700003839960) },
- { FRAC_CONST(0.014381195986567), FRAC_CONST(0.027744255297195) },
- { FRAC_CONST(0.014296010130247), FRAC_CONST(0.027788245614933) },
- { FRAC_CONST(0.014210689714436), FRAC_CONST(0.027831974379120) },
- { FRAC_CONST(0.014125235542201), FRAC_CONST(0.027875441178165) },
- { FRAC_CONST(0.014039648417870), FRAC_CONST(0.027918645602941) },
- { FRAC_CONST(0.013953929147020), FRAC_CONST(0.027961587246792) },
- { FRAC_CONST(0.013868078536476), FRAC_CONST(0.028004265705534) },
- { FRAC_CONST(0.013782097394294), FRAC_CONST(0.028046680577462) },
- { FRAC_CONST(0.013695986529763), FRAC_CONST(0.028088831463351) },
- { FRAC_CONST(0.013609746753390), FRAC_CONST(0.028130717966461) },
- { FRAC_CONST(0.013523378876898), FRAC_CONST(0.028172339692540) },
- { FRAC_CONST(0.013436883713214), FRAC_CONST(0.028213696249828) },
- { FRAC_CONST(0.013350262076462), FRAC_CONST(0.028254787249062) },
- { FRAC_CONST(0.013263514781960), FRAC_CONST(0.028295612303478) },
- { FRAC_CONST(0.013176642646205), FRAC_CONST(0.028336171028814) },
- { FRAC_CONST(0.013089646486871), FRAC_CONST(0.028376463043317) },
- { FRAC_CONST(0.013002527122799), FRAC_CONST(0.028416487967743) },
- { FRAC_CONST(0.012915285373990), FRAC_CONST(0.028456245425361) },
- { FRAC_CONST(0.012827922061597), FRAC_CONST(0.028495735041960) },
- { FRAC_CONST(0.012740438007915), FRAC_CONST(0.028534956445849) },
- { FRAC_CONST(0.012652834036379), FRAC_CONST(0.028573909267859) },
- { FRAC_CONST(0.012565110971550), FRAC_CONST(0.028612593141354) },
- { FRAC_CONST(0.012477269639111), FRAC_CONST(0.028651007702224) },
- { FRAC_CONST(0.012389310865858), FRAC_CONST(0.028689152588899) },
- { FRAC_CONST(0.012301235479693), FRAC_CONST(0.028727027442343) },
- { FRAC_CONST(0.012213044309615), FRAC_CONST(0.028764631906065) },
- { FRAC_CONST(0.012124738185712), FRAC_CONST(0.028801965626115) },
- { FRAC_CONST(0.012036317939156), FRAC_CONST(0.028839028251097) },
- { FRAC_CONST(0.011947784402191), FRAC_CONST(0.028875819432161) },
- { FRAC_CONST(0.011859138408130), FRAC_CONST(0.028912338823015) },
- { FRAC_CONST(0.011770380791341), FRAC_CONST(0.028948586079925) },
- { FRAC_CONST(0.011681512387245), FRAC_CONST(0.028984560861718) },
- { FRAC_CONST(0.011592534032306), FRAC_CONST(0.029020262829785) },
- { FRAC_CONST(0.011503446564022), FRAC_CONST(0.029055691648087) },
- { FRAC_CONST(0.011414250820918), FRAC_CONST(0.029090846983152) },
- { FRAC_CONST(0.011324947642537), FRAC_CONST(0.029125728504087) },
- { FRAC_CONST(0.011235537869437), FRAC_CONST(0.029160335882573) },
- { FRAC_CONST(0.011146022343175), FRAC_CONST(0.029194668792871) },
- { FRAC_CONST(0.011056401906305), FRAC_CONST(0.029228726911828) },
- { FRAC_CONST(0.010966677402371), FRAC_CONST(0.029262509918876) },
- { FRAC_CONST(0.010876849675891), FRAC_CONST(0.029296017496036) },
- { FRAC_CONST(0.010786919572361), FRAC_CONST(0.029329249327922) },
- { FRAC_CONST(0.010696887938235), FRAC_CONST(0.029362205101743) },
- { FRAC_CONST(0.010606755620926), FRAC_CONST(0.029394884507308) },
- { FRAC_CONST(0.010516523468793), FRAC_CONST(0.029427287237024) },
- { FRAC_CONST(0.010426192331137), FRAC_CONST(0.029459412985906) },
- { FRAC_CONST(0.010335763058187), FRAC_CONST(0.029491261451573) },
- { FRAC_CONST(0.010245236501099), FRAC_CONST(0.029522832334255) },
- { FRAC_CONST(0.010154613511943), FRAC_CONST(0.029554125336796) },
- { FRAC_CONST(0.010063894943698), FRAC_CONST(0.029585140164654) },
- { FRAC_CONST(0.009973081650240), FRAC_CONST(0.029615876525905) },
- { FRAC_CONST(0.009882174486340), FRAC_CONST(0.029646334131247) },
- { FRAC_CONST(0.009791174307650), FRAC_CONST(0.029676512694001) },
- { FRAC_CONST(0.009700081970699), FRAC_CONST(0.029706411930116) },
- { FRAC_CONST(0.009608898332881), FRAC_CONST(0.029736031558168) },
- { FRAC_CONST(0.009517624252453), FRAC_CONST(0.029765371299366) },
- { FRAC_CONST(0.009426260588521), FRAC_CONST(0.029794430877553) },
- { FRAC_CONST(0.009334808201034), FRAC_CONST(0.029823210019210) },
- { FRAC_CONST(0.009243267950778), FRAC_CONST(0.029851708453456) },
- { FRAC_CONST(0.009151640699363), FRAC_CONST(0.029879925912053) },
- { FRAC_CONST(0.009059927309220), FRAC_CONST(0.029907862129408) },
- { FRAC_CONST(0.008968128643591), FRAC_CONST(0.029935516842573) },
- { FRAC_CONST(0.008876245566520), FRAC_CONST(0.029962889791254) },
- { FRAC_CONST(0.008784278942845), FRAC_CONST(0.029989980717805) },
- { FRAC_CONST(0.008692229638191), FRAC_CONST(0.030016789367235) },
- { FRAC_CONST(0.008600098518961), FRAC_CONST(0.030043315487212) },
- { FRAC_CONST(0.008507886452329), FRAC_CONST(0.030069558828062) },
- { FRAC_CONST(0.008415594306230), FRAC_CONST(0.030095519142772) },
- { FRAC_CONST(0.008323222949351), FRAC_CONST(0.030121196186994) },
- { FRAC_CONST(0.008230773251129), FRAC_CONST(0.030146589719046) },
- { FRAC_CONST(0.008138246081733), FRAC_CONST(0.030171699499915) },
- { FRAC_CONST(0.008045642312067), FRAC_CONST(0.030196525293257) },
- { FRAC_CONST(0.007952962813750), FRAC_CONST(0.030221066865402) },
- { FRAC_CONST(0.007860208459119), FRAC_CONST(0.030245323985357) },
- { FRAC_CONST(0.007767380121212), FRAC_CONST(0.030269296424803) },
- { FRAC_CONST(0.007674478673766), FRAC_CONST(0.030292983958103) },
- { FRAC_CONST(0.007581504991203), FRAC_CONST(0.030316386362302) },
- { FRAC_CONST(0.007488459948628), FRAC_CONST(0.030339503417126) },
- { FRAC_CONST(0.007395344421816), FRAC_CONST(0.030362334904989) },
- { FRAC_CONST(0.007302159287206), FRAC_CONST(0.030384880610993) },
- { FRAC_CONST(0.007208905421891), FRAC_CONST(0.030407140322928) },
- { FRAC_CONST(0.007115583703613), FRAC_CONST(0.030429113831278) },
- { FRAC_CONST(0.007022195010752), FRAC_CONST(0.030450800929220) },
- { FRAC_CONST(0.006928740222316), FRAC_CONST(0.030472201412626) },
- { FRAC_CONST(0.006835220217939), FRAC_CONST(0.030493315080068) },
- { FRAC_CONST(0.006741635877866), FRAC_CONST(0.030514141732814) },
- { FRAC_CONST(0.006647988082948), FRAC_CONST(0.030534681174838) },
- { FRAC_CONST(0.006554277714635), FRAC_CONST(0.030554933212813) },
- { FRAC_CONST(0.006460505654964), FRAC_CONST(0.030574897656119) },
- { FRAC_CONST(0.006366672786553), FRAC_CONST(0.030594574316845) },
- { FRAC_CONST(0.006272779992593), FRAC_CONST(0.030613963009786) },
- { FRAC_CONST(0.006178828156839), FRAC_CONST(0.030633063552447) },
- { FRAC_CONST(0.006084818163601), FRAC_CONST(0.030651875765048) },
- { FRAC_CONST(0.005990750897737), FRAC_CONST(0.030670399470520) },
- { FRAC_CONST(0.005896627244644), FRAC_CONST(0.030688634494512) },
- { FRAC_CONST(0.005802448090250), FRAC_CONST(0.030706580665388) },
- { FRAC_CONST(0.005708214321004), FRAC_CONST(0.030724237814232) },
- { FRAC_CONST(0.005613926823871), FRAC_CONST(0.030741605774849) },
- { FRAC_CONST(0.005519586486321), FRAC_CONST(0.030758684383764) },
- { FRAC_CONST(0.005425194196321), FRAC_CONST(0.030775473480228) },
- { FRAC_CONST(0.005330750842327), FRAC_CONST(0.030791972906214) },
- { FRAC_CONST(0.005236257313276), FRAC_CONST(0.030808182506425) },
- { FRAC_CONST(0.005141714498576), FRAC_CONST(0.030824102128288) },
- { FRAC_CONST(0.005047123288102), FRAC_CONST(0.030839731621963) },
- { FRAC_CONST(0.004952484572181), FRAC_CONST(0.030855070840339) },
- { FRAC_CONST(0.004857799241589), FRAC_CONST(0.030870119639036) },
- { FRAC_CONST(0.004763068187541), FRAC_CONST(0.030884877876411) },
- { FRAC_CONST(0.004668292301681), FRAC_CONST(0.030899345413553) },
- { FRAC_CONST(0.004573472476075), FRAC_CONST(0.030913522114288) },
- { FRAC_CONST(0.004478609603205), FRAC_CONST(0.030927407845180) },
- { FRAC_CONST(0.004383704575956), FRAC_CONST(0.030941002475530) },
- { FRAC_CONST(0.004288758287610), FRAC_CONST(0.030954305877381) },
- { FRAC_CONST(0.004193771631837), FRAC_CONST(0.030967317925516) },
- { FRAC_CONST(0.004098745502689), FRAC_CONST(0.030980038497461) },
- { FRAC_CONST(0.004003680794587), FRAC_CONST(0.030992467473486) },
- { FRAC_CONST(0.003908578402316), FRAC_CONST(0.031004604736602) },
- { FRAC_CONST(0.003813439221017), FRAC_CONST(0.031016450172571) },
- { FRAC_CONST(0.003718264146176), FRAC_CONST(0.031028003669899) },
- { FRAC_CONST(0.003623054073616), FRAC_CONST(0.031039265119839) },
- { FRAC_CONST(0.003527809899492), FRAC_CONST(0.031050234416394) },
- { FRAC_CONST(0.003432532520278), FRAC_CONST(0.031060911456318) },
- { FRAC_CONST(0.003337222832760), FRAC_CONST(0.031071296139114) },
- { FRAC_CONST(0.003241881734029), FRAC_CONST(0.031081388367037) },
- { FRAC_CONST(0.003146510121474), FRAC_CONST(0.031091188045095) },
- { FRAC_CONST(0.003051108892766), FRAC_CONST(0.031100695081051) },
- { FRAC_CONST(0.002955678945860), FRAC_CONST(0.031109909385419) },
- { FRAC_CONST(0.002860221178978), FRAC_CONST(0.031118830871473) },
- { FRAC_CONST(0.002764736490604), FRAC_CONST(0.031127459455239) },
- { FRAC_CONST(0.002669225779478), FRAC_CONST(0.031135795055501) },
- { FRAC_CONST(0.002573689944583), FRAC_CONST(0.031143837593803) },
- { FRAC_CONST(0.002478129885137), FRAC_CONST(0.031151586994444) },
- { FRAC_CONST(0.002382546500589), FRAC_CONST(0.031159043184484) },
- { FRAC_CONST(0.002286940690606), FRAC_CONST(0.031166206093743) },
- { FRAC_CONST(0.002191313355067), FRAC_CONST(0.031173075654800) },
- { FRAC_CONST(0.002095665394051), FRAC_CONST(0.031179651802998) },
- { FRAC_CONST(0.001999997707835), FRAC_CONST(0.031185934476438) },
- { FRAC_CONST(0.001904311196878), FRAC_CONST(0.031191923615985) },
- { FRAC_CONST(0.001808606761820), FRAC_CONST(0.031197619165268) },
- { FRAC_CONST(0.001712885303465), FRAC_CONST(0.031203021070678) },
- { FRAC_CONST(0.001617147722782), FRAC_CONST(0.031208129281370) },
- { FRAC_CONST(0.001521394920889), FRAC_CONST(0.031212943749264) },
- { FRAC_CONST(0.001425627799047), FRAC_CONST(0.031217464429043) },
- { FRAC_CONST(0.001329847258653), FRAC_CONST(0.031221691278159) },
- { FRAC_CONST(0.001234054201231), FRAC_CONST(0.031225624256825) },
- { FRAC_CONST(0.001138249528420), FRAC_CONST(0.031229263328024) },
- { FRAC_CONST(0.001042434141971), FRAC_CONST(0.031232608457502) },
- { FRAC_CONST(0.000946608943736), FRAC_CONST(0.031235659613775) },
- { FRAC_CONST(0.000850774835656), FRAC_CONST(0.031238416768124) },
- { FRAC_CONST(0.000754932719759), FRAC_CONST(0.031240879894597) },
- { FRAC_CONST(0.000659083498149), FRAC_CONST(0.031243048970010) },
- { FRAC_CONST(0.000563228072993), FRAC_CONST(0.031244923973948) },
- { FRAC_CONST(0.000467367346520), FRAC_CONST(0.031246504888762) },
- { FRAC_CONST(0.000371502221008), FRAC_CONST(0.031247791699571) },
- { FRAC_CONST(0.000275633598775), FRAC_CONST(0.031248784394264) },
- { FRAC_CONST(0.000179762382174), FRAC_CONST(0.031249482963498) },
- { FRAC_CONST(0.000083889473581), FRAC_CONST(0.031249887400697) }
-};
-
-/* 64 (N/4) complex twiddle factors */
-ALIGN static const complex_t mdct_tab_256[] =
-{
- { FRAC_CONST(0.088387931675923), FRAC_CONST(0.000271171628935) },
- { FRAC_CONST(0.088354655998507), FRAC_CONST(0.002440238387037) },
- { FRAC_CONST(0.088268158780110), FRAC_CONST(0.004607835236780) },
- { FRAC_CONST(0.088128492123423), FRAC_CONST(0.006772656498875) },
- { FRAC_CONST(0.087935740158418), FRAC_CONST(0.008933398165942) },
- { FRAC_CONST(0.087690018991670), FRAC_CONST(0.011088758687994) },
- { FRAC_CONST(0.087391476636423), FRAC_CONST(0.013237439756448) },
- { FRAC_CONST(0.087040292923427), FRAC_CONST(0.015378147086172) },
- { FRAC_CONST(0.086636679392621), FRAC_CONST(0.017509591195118) },
- { FRAC_CONST(0.086180879165703), FRAC_CONST(0.019630488181053) },
- { FRAC_CONST(0.085673166799686), FRAC_CONST(0.021739560494940) },
- { FRAC_CONST(0.085113848121515), FRAC_CONST(0.023835537710479) },
- { FRAC_CONST(0.084503260043847), FRAC_CONST(0.025917157289369) },
- { FRAC_CONST(0.083841770362110), FRAC_CONST(0.027983165341813) },
- { FRAC_CONST(0.083129777532952), FRAC_CONST(0.030032317381813) },
- { FRAC_CONST(0.082367710434230), FRAC_CONST(0.032063379076803) },
- { FRAC_CONST(0.081556028106671), FRAC_CONST(0.034075126991164) },
- { FRAC_CONST(0.080695219477356), FRAC_CONST(0.036066349323177) },
- { FRAC_CONST(0.079785803065216), FRAC_CONST(0.038035846634965) },
- { FRAC_CONST(0.078828326668693), FRAC_CONST(0.039982432574992) },
- { FRAC_CONST(0.077823367035766), FRAC_CONST(0.041904934592675) },
- { FRAC_CONST(0.076771529516540), FRAC_CONST(0.043802194644686) },
- { FRAC_CONST(0.075673447698606), FRAC_CONST(0.045673069892513) },
- { FRAC_CONST(0.074529783025390), FRAC_CONST(0.047516433390863) },
- { FRAC_CONST(0.073341224397728), FRAC_CONST(0.049331174766491) },
- { FRAC_CONST(0.072108487758894), FRAC_CONST(0.051116200887052) },
- { FRAC_CONST(0.070832315663343), FRAC_CONST(0.052870436519557) },
- { FRAC_CONST(0.069513476829429), FRAC_CONST(0.054592824978055) },
- { FRAC_CONST(0.068152765676348), FRAC_CONST(0.056282328760143) },
- { FRAC_CONST(0.066751001845620), FRAC_CONST(0.057937930171918) },
- { FRAC_CONST(0.065309029707361), FRAC_CONST(0.059558631940996) },
- { FRAC_CONST(0.063827717851668), FRAC_CONST(0.061143457817234) },
- { FRAC_CONST(0.062307958565413), FRAC_CONST(0.062691453160784) },
- { FRAC_CONST(0.060750667294763), FRAC_CONST(0.064201685517134) },
- { FRAC_CONST(0.059156782093749), FRAC_CONST(0.065673245178784) },
- { FRAC_CONST(0.057527263059216), FRAC_CONST(0.067105245733220) },
- { FRAC_CONST(0.055863091752499), FRAC_CONST(0.068496824596852) },
- { FRAC_CONST(0.054165270608165), FRAC_CONST(0.069847143534609) },
- { FRAC_CONST(0.052434822330188), FRAC_CONST(0.071155389164853) },
- { FRAC_CONST(0.050672789275903), FRAC_CONST(0.072420773449336) },
- { FRAC_CONST(0.048880232828135), FRAC_CONST(0.073642534167879) },
- { FRAC_CONST(0.047058232755862), FRAC_CONST(0.074819935377512) },
- { FRAC_CONST(0.045207886563797), FRAC_CONST(0.075952267855771) },
- { FRAC_CONST(0.043330308831298), FRAC_CONST(0.077038849527912) },
- { FRAC_CONST(0.041426630540984), FRAC_CONST(0.078079025877766) },
- { FRAC_CONST(0.039497998397473), FRAC_CONST(0.079072170341994) },
- { FRAC_CONST(0.037545574136653), FRAC_CONST(0.080017684687506) },
- { FRAC_CONST(0.035570533825892), FRAC_CONST(0.080914999371817) },
- { FRAC_CONST(0.033574067155622), FRAC_CONST(0.081763573886112) },
- { FRAC_CONST(0.031557376722714), FRAC_CONST(0.082562897080836) },
- { FRAC_CONST(0.029521677306074), FRAC_CONST(0.083312487473584) },
- { FRAC_CONST(0.027468195134911), FRAC_CONST(0.084011893539132) },
- { FRAC_CONST(0.025398167150101), FRAC_CONST(0.084660693981419) },
- { FRAC_CONST(0.023312840259098), FRAC_CONST(0.085258497987320) },
- { FRAC_CONST(0.021213470584847), FRAC_CONST(0.085804945462053) },
- { FRAC_CONST(0.019101322709138), FRAC_CONST(0.086299707246093) },
- { FRAC_CONST(0.016977668910873), FRAC_CONST(0.086742485313442) },
- { FRAC_CONST(0.014843788399692), FRAC_CONST(0.087133012951149) },
- { FRAC_CONST(0.012700966545425), FRAC_CONST(0.087471054919968) },
- { FRAC_CONST(0.010550494103830), FRAC_CONST(0.087756407596056) },
- { FRAC_CONST(0.008393666439096), FRAC_CONST(0.087988899093631) },
- { FRAC_CONST(0.006231782743558), FRAC_CONST(0.088168389368510) },
- { FRAC_CONST(0.004066145255116), FRAC_CONST(0.088294770302461) },
- { FRAC_CONST(0.001898058472816), FRAC_CONST(0.088367965768336) }
-};
-
-#ifdef LD_DEC
-/* 128 (N/4) complex twiddle factors */
-ALIGN static const complex_t mdct_tab_1024[] =
-{
- { FRAC_CONST(0.044194160825012), FRAC_CONST(0.000033896503468) },
- { FRAC_CONST(0.044193120897389), FRAC_CONST(0.000305066138364) },
- { FRAC_CONST(0.044190417123742), FRAC_CONST(0.000576224287693) },
- { FRAC_CONST(0.044186049605866), FRAC_CONST(0.000847360742503) },
- { FRAC_CONST(0.044180018508197), FRAC_CONST(0.001118465294660) },
- { FRAC_CONST(0.044172324057802), FRAC_CONST(0.001389527737231) },
- { FRAC_CONST(0.044162966544372), FRAC_CONST(0.001660537864867) },
- { FRAC_CONST(0.044151946320213), FRAC_CONST(0.001931485474192) },
- { FRAC_CONST(0.044139263800230), FRAC_CONST(0.002202360364180) },
- { FRAC_CONST(0.044124919461912), FRAC_CONST(0.002473152336546) },
- { FRAC_CONST(0.044108913845316), FRAC_CONST(0.002743851196123) },
- { FRAC_CONST(0.044091247553044), FRAC_CONST(0.003014446751254) },
- { FRAC_CONST(0.044071921250223), FRAC_CONST(0.003284928814169) },
- { FRAC_CONST(0.044050935664476), FRAC_CONST(0.003555287201370) },
- { FRAC_CONST(0.044028291585898), FRAC_CONST(0.003825511734018) },
- { FRAC_CONST(0.044003989867028), FRAC_CONST(0.004095592238311) },
- { FRAC_CONST(0.043978031422810), FRAC_CONST(0.004365518545871) },
- { FRAC_CONST(0.043950417230565), FRAC_CONST(0.004635280494126) },
- { FRAC_CONST(0.043921148329953), FRAC_CONST(0.004904867926689) },
- { FRAC_CONST(0.043890225822930), FRAC_CONST(0.005174270693748) },
- { FRAC_CONST(0.043857650873712), FRAC_CONST(0.005443478652439) },
- { FRAC_CONST(0.043823424708727), FRAC_CONST(0.005712481667236) },
- { FRAC_CONST(0.043787548616571), FRAC_CONST(0.005981269610326) },
- { FRAC_CONST(0.043750023947958), FRAC_CONST(0.006249832361997) },
- { FRAC_CONST(0.043710852115672), FRAC_CONST(0.006518159811011) },
- { FRAC_CONST(0.043670034594508), FRAC_CONST(0.006786241854993) },
- { FRAC_CONST(0.043627572921225), FRAC_CONST(0.007054068400804) },
- { FRAC_CONST(0.043583468694479), FRAC_CONST(0.007321629364927) },
- { FRAC_CONST(0.043537723574771), FRAC_CONST(0.007588914673843) },
- { FRAC_CONST(0.043490339284377), FRAC_CONST(0.007855914264410) },
- { FRAC_CONST(0.043441317607290), FRAC_CONST(0.008122618084246) },
- { FRAC_CONST(0.043390660389149), FRAC_CONST(0.008389016092101) },
- { FRAC_CONST(0.043338369537168), FRAC_CONST(0.008655098258243) },
- { FRAC_CONST(0.043284447020070), FRAC_CONST(0.008920854564826) },
- { FRAC_CONST(0.043228894868005), FRAC_CONST(0.009186275006278) },
- { FRAC_CONST(0.043171715172482), FRAC_CONST(0.009451349589667) },
- { FRAC_CONST(0.043112910086283), FRAC_CONST(0.009716068335087) },
- { FRAC_CONST(0.043052481823387), FRAC_CONST(0.009980421276025) },
- { FRAC_CONST(0.042990432658884), FRAC_CONST(0.010244398459743) },
- { FRAC_CONST(0.042926764928889), FRAC_CONST(0.010507989947649) },
- { FRAC_CONST(0.042861481030457), FRAC_CONST(0.010771185815673) },
- { FRAC_CONST(0.042794583421490), FRAC_CONST(0.011033976154639) },
- { FRAC_CONST(0.042726074620644), FRAC_CONST(0.011296351070639) },
- { FRAC_CONST(0.042655957207238), FRAC_CONST(0.011558300685406) },
- { FRAC_CONST(0.042584233821153), FRAC_CONST(0.011819815136685) },
- { FRAC_CONST(0.042510907162732), FRAC_CONST(0.012080884578604) },
- { FRAC_CONST(0.042435979992684), FRAC_CONST(0.012341499182048) },
- { FRAC_CONST(0.042359455131975), FRAC_CONST(0.012601649135022) },
- { FRAC_CONST(0.042281335461721), FRAC_CONST(0.012861324643029) },
- { FRAC_CONST(0.042201623923085), FRAC_CONST(0.013120515929433) },
- { FRAC_CONST(0.042120323517160), FRAC_CONST(0.013379213235827) },
- { FRAC_CONST(0.042037437304862), FRAC_CONST(0.013637406822406) },
- { FRAC_CONST(0.041952968406809), FRAC_CONST(0.013895086968325) },
- { FRAC_CONST(0.041866920003207), FRAC_CONST(0.014152243972073) },
- { FRAC_CONST(0.041779295333730), FRAC_CONST(0.014408868151835) },
- { FRAC_CONST(0.041690097697398), FRAC_CONST(0.014664949845855) },
- { FRAC_CONST(0.041599330452450), FRAC_CONST(0.014920479412801) },
- { FRAC_CONST(0.041506997016224), FRAC_CONST(0.015175447232131) },
- { FRAC_CONST(0.041413100865019), FRAC_CONST(0.015429843704450) },
- { FRAC_CONST(0.041317645533974), FRAC_CONST(0.015683659251874) },
- { FRAC_CONST(0.041220634616927), FRAC_CONST(0.015936884318392) },
- { FRAC_CONST(0.041122071766285), FRAC_CONST(0.016189509370223) },
- { FRAC_CONST(0.041021960692883), FRAC_CONST(0.016441524896177) },
- { FRAC_CONST(0.040920305165846), FRAC_CONST(0.016692921408010) },
- { FRAC_CONST(0.040817109012449), FRAC_CONST(0.016943689440788) },
- { FRAC_CONST(0.040712376117967), FRAC_CONST(0.017193819553235) },
- { FRAC_CONST(0.040606110425535), FRAC_CONST(0.017443302328094) },
- { FRAC_CONST(0.040498315935996), FRAC_CONST(0.017692128372479) },
- { FRAC_CONST(0.040388996707752), FRAC_CONST(0.017940288318230) },
- { FRAC_CONST(0.040278156856609), FRAC_CONST(0.018187772822267) },
- { FRAC_CONST(0.040165800555627), FRAC_CONST(0.018434572566936) },
- { FRAC_CONST(0.040051932034955), FRAC_CONST(0.018680678260367) },
- { FRAC_CONST(0.039936555581679), FRAC_CONST(0.018926080636820) },
- { FRAC_CONST(0.039819675539659), FRAC_CONST(0.019170770457035) },
- { FRAC_CONST(0.039701296309360), FRAC_CONST(0.019414738508577) },
- { FRAC_CONST(0.039581422347694), FRAC_CONST(0.019657975606187) },
- { FRAC_CONST(0.039460058167849), FRAC_CONST(0.019900472592126) },
- { FRAC_CONST(0.039337208339116), FRAC_CONST(0.020142220336521) },
- { FRAC_CONST(0.039212877486723), FRAC_CONST(0.020383209737704) },
- { FRAC_CONST(0.039087070291656), FRAC_CONST(0.020623431722561) },
- { FRAC_CONST(0.038959791490485), FRAC_CONST(0.020862877246870) },
- { FRAC_CONST(0.038831045875184), FRAC_CONST(0.021101537295642) },
- { FRAC_CONST(0.038700838292953), FRAC_CONST(0.021339402883462) },
- { FRAC_CONST(0.038569173646034), FRAC_CONST(0.021576465054824) },
- { FRAC_CONST(0.038436056891527), FRAC_CONST(0.021812714884472) },
- { FRAC_CONST(0.038301493041202), FRAC_CONST(0.022048143477734) },
- { FRAC_CONST(0.038165487161312), FRAC_CONST(0.022282741970855) },
- { FRAC_CONST(0.038028044372402), FRAC_CONST(0.022516501531335) },
- { FRAC_CONST(0.037889169849115), FRAC_CONST(0.022749413358259) },
- { FRAC_CONST(0.037748868819998), FRAC_CONST(0.022981468682628) },
- { FRAC_CONST(0.037607146567305), FRAC_CONST(0.023212658767690) },
- { FRAC_CONST(0.037464008426800), FRAC_CONST(0.023442974909269) },
- { FRAC_CONST(0.037319459787553), FRAC_CONST(0.023672408436094) },
- { FRAC_CONST(0.037173506091737), FRAC_CONST(0.023900950710120) },
- { FRAC_CONST(0.037026152834428), FRAC_CONST(0.024128593126861) },
- { FRAC_CONST(0.036877405563392), FRAC_CONST(0.024355327115708) },
- { FRAC_CONST(0.036727269878879), FRAC_CONST(0.024581144140255) },
- { FRAC_CONST(0.036575751433414), FRAC_CONST(0.024806035698618) },
- { FRAC_CONST(0.036422855931580), FRAC_CONST(0.025029993323758) },
- { FRAC_CONST(0.036268589129807), FRAC_CONST(0.025253008583796) },
- { FRAC_CONST(0.036112956836151), FRAC_CONST(0.025475073082334) },
- { FRAC_CONST(0.035955964910083), FRAC_CONST(0.025696178458769) },
- { FRAC_CONST(0.035797619262257), FRAC_CONST(0.025916316388609) },
- { FRAC_CONST(0.035637925854300), FRAC_CONST(0.026135478583784) },
- { FRAC_CONST(0.035476890698576), FRAC_CONST(0.026353656792963) },
- { FRAC_CONST(0.035314519857970), FRAC_CONST(0.026570842801858) },
- { FRAC_CONST(0.035150819445650), FRAC_CONST(0.026787028433540) },
- { FRAC_CONST(0.034985795624846), FRAC_CONST(0.027002205548742) },
- { FRAC_CONST(0.034819454608610), FRAC_CONST(0.027216366046166) },
- { FRAC_CONST(0.034651802659589), FRAC_CONST(0.027429501862792) },
- { FRAC_CONST(0.034482846089783), FRAC_CONST(0.027641604974175) },
- { FRAC_CONST(0.034312591260311), FRAC_CONST(0.027852667394755) },
- { FRAC_CONST(0.034141044581172), FRAC_CONST(0.028062681178149) },
- { FRAC_CONST(0.033968212511001), FRAC_CONST(0.028271638417458) },
- { FRAC_CONST(0.033794101556828), FRAC_CONST(0.028479531245560) },
- { FRAC_CONST(0.033618718273831), FRAC_CONST(0.028686351835407) },
- { FRAC_CONST(0.033442069265093), FRAC_CONST(0.028892092400321) },
- { FRAC_CONST(0.033264161181349), FRAC_CONST(0.029096745194286) },
- { FRAC_CONST(0.033085000720737), FRAC_CONST(0.029300302512241) },
- { FRAC_CONST(0.032904594628548), FRAC_CONST(0.029502756690366) },
- { FRAC_CONST(0.032722949696969), FRAC_CONST(0.029704100106376) },
- { FRAC_CONST(0.032540072764829), FRAC_CONST(0.029904325179807) },
- { FRAC_CONST(0.032355970717341), FRAC_CONST(0.030103424372297) },
- { FRAC_CONST(0.032170650485843), FRAC_CONST(0.030301390187873) },
- { FRAC_CONST(0.031984119047537), FRAC_CONST(0.030498215173235) },
- { FRAC_CONST(0.031796383425227), FRAC_CONST(0.030693891918034) },
- { FRAC_CONST(0.031607450687052), FRAC_CONST(0.030888413055150) },
- { FRAC_CONST(0.031417327946223), FRAC_CONST(0.031081771260973) },
- { FRAC_CONST(0.031226022360754), FRAC_CONST(0.031273959255676) },
- { FRAC_CONST(0.031033541133193), FRAC_CONST(0.031464969803488) },
- { FRAC_CONST(0.030839891510348), FRAC_CONST(0.031654795712972) },
- { FRAC_CONST(0.030645080783018), FRAC_CONST(0.031843429837288) },
- { FRAC_CONST(0.030449116285718), FRAC_CONST(0.032030865074469) },
- { FRAC_CONST(0.030252005396399), FRAC_CONST(0.032217094367684) },
- { FRAC_CONST(0.030053755536176), FRAC_CONST(0.032402110705505) },
- { FRAC_CONST(0.029854374169043), FRAC_CONST(0.032585907122172) },
- { FRAC_CONST(0.029653868801596), FRAC_CONST(0.032768476697853) },
- { FRAC_CONST(0.029452246982750), FRAC_CONST(0.032949812558907) },
- { FRAC_CONST(0.029249516303451), FRAC_CONST(0.033129907878142) },
- { FRAC_CONST(0.029045684396395), FRAC_CONST(0.033308755875070) },
- { FRAC_CONST(0.028840758935738), FRAC_CONST(0.033486349816166) },
- { FRAC_CONST(0.028634747636808), FRAC_CONST(0.033662683015118) },
- { FRAC_CONST(0.028427658255815), FRAC_CONST(0.033837748833080) },
- { FRAC_CONST(0.028219498589555), FRAC_CONST(0.034011540678924) },
- { FRAC_CONST(0.028010276475123), FRAC_CONST(0.034184052009485) },
- { FRAC_CONST(0.027799999789613), FRAC_CONST(0.034355276329809) },
- { FRAC_CONST(0.027588676449824), FRAC_CONST(0.034525207193396) },
- { FRAC_CONST(0.027376314411959), FRAC_CONST(0.034693838202447) },
- { FRAC_CONST(0.027162921671330), FRAC_CONST(0.034861163008098) },
- { FRAC_CONST(0.026948506262053), FRAC_CONST(0.035027175310665) },
- { FRAC_CONST(0.026733076256746), FRAC_CONST(0.035191868859880) },
- { FRAC_CONST(0.026516639766228), FRAC_CONST(0.035355237455122) },
- { FRAC_CONST(0.026299204939210), FRAC_CONST(0.035517274945657) },
- { FRAC_CONST(0.026080779961991), FRAC_CONST(0.035677975230865) },
- { FRAC_CONST(0.025861373058146), FRAC_CONST(0.035837332260471) },
- { FRAC_CONST(0.025640992488223), FRAC_CONST(0.035995340034772) },
- { FRAC_CONST(0.025419646549425), FRAC_CONST(0.036151992604866) },
- { FRAC_CONST(0.025197343575302), FRAC_CONST(0.036307284072871) },
- { FRAC_CONST(0.024974091935435), FRAC_CONST(0.036461208592152) },
- { FRAC_CONST(0.024749900035122), FRAC_CONST(0.036613760367538) },
- { FRAC_CONST(0.024524776315061), FRAC_CONST(0.036764933655540) },
- { FRAC_CONST(0.024298729251033), FRAC_CONST(0.036914722764569) },
- { FRAC_CONST(0.024071767353583), FRAC_CONST(0.037063122055150) },
- { FRAC_CONST(0.023843899167697), FRAC_CONST(0.037210125940135) },
- { FRAC_CONST(0.023615133272485), FRAC_CONST(0.037355728884908) },
- { FRAC_CONST(0.023385478280852), FRAC_CONST(0.037499925407603) },
- { FRAC_CONST(0.023154942839179), FRAC_CONST(0.037642710079302) },
- { FRAC_CONST(0.022923535626995), FRAC_CONST(0.037784077524241) },
- { FRAC_CONST(0.022691265356652), FRAC_CONST(0.037924022420018) },
- { FRAC_CONST(0.022458140772993), FRAC_CONST(0.038062539497785) },
- { FRAC_CONST(0.022224170653027), FRAC_CONST(0.038199623542453) },
- { FRAC_CONST(0.021989363805598), FRAC_CONST(0.038335269392885) },
- { FRAC_CONST(0.021753729071049), FRAC_CONST(0.038469471942092) },
- { FRAC_CONST(0.021517275320897), FRAC_CONST(0.038602226137423) },
- { FRAC_CONST(0.021280011457490), FRAC_CONST(0.038733526980758) },
- { FRAC_CONST(0.021041946413679), FRAC_CONST(0.038863369528695) },
- { FRAC_CONST(0.020803089152479), FRAC_CONST(0.038991748892734) },
- { FRAC_CONST(0.020563448666730), FRAC_CONST(0.039118660239466) },
- { FRAC_CONST(0.020323033978761), FRAC_CONST(0.039244098790750) },
- { FRAC_CONST(0.020081854140050), FRAC_CONST(0.039368059823895) },
- { FRAC_CONST(0.019839918230880), FRAC_CONST(0.039490538671839) },
- { FRAC_CONST(0.019597235360003), FRAC_CONST(0.039611530723322) },
- { FRAC_CONST(0.019353814664291), FRAC_CONST(0.039731031423061) },
- { FRAC_CONST(0.019109665308395), FRAC_CONST(0.039849036271924) },
- { FRAC_CONST(0.018864796484402), FRAC_CONST(0.039965540827094) },
- { FRAC_CONST(0.018619217411483), FRAC_CONST(0.040080540702240) },
- { FRAC_CONST(0.018372937335552), FRAC_CONST(0.040194031567683) },
- { FRAC_CONST(0.018125965528915), FRAC_CONST(0.040306009150554) },
- { FRAC_CONST(0.017878311289921), FRAC_CONST(0.040416469234963) },
- { FRAC_CONST(0.017629983942612), FRAC_CONST(0.040525407662148) },
- { FRAC_CONST(0.017380992836371), FRAC_CONST(0.040632820330639) },
- { FRAC_CONST(0.017131347345575), FRAC_CONST(0.040738703196411) },
- { FRAC_CONST(0.016881056869233), FRAC_CONST(0.040843052273033) },
- { FRAC_CONST(0.016630130830641), FRAC_CONST(0.040945863631822) },
- { FRAC_CONST(0.016378578677023), FRAC_CONST(0.041047133401988) },
- { FRAC_CONST(0.016126409879175), FRAC_CONST(0.041146857770781) },
- { FRAC_CONST(0.015873633931110), FRAC_CONST(0.041245032983635) },
- { FRAC_CONST(0.015620260349699), FRAC_CONST(0.041341655344309) },
- { FRAC_CONST(0.015366298674314), FRAC_CONST(0.041436721215026) },
- { FRAC_CONST(0.015111758466470), FRAC_CONST(0.041530227016609) },
- { FRAC_CONST(0.014856649309460), FRAC_CONST(0.041622169228618) },
- { FRAC_CONST(0.014600980808001), FRAC_CONST(0.041712544389481) },
- { FRAC_CONST(0.014344762587867), FRAC_CONST(0.041801349096623) },
- { FRAC_CONST(0.014088004295529), FRAC_CONST(0.041888580006598) },
- { FRAC_CONST(0.013830715597792), FRAC_CONST(0.041974233835211) },
- { FRAC_CONST(0.013572906181430), FRAC_CONST(0.042058307357645) },
- { FRAC_CONST(0.013314585752822), FRAC_CONST(0.042140797408577) },
- { FRAC_CONST(0.013055764037585), FRAC_CONST(0.042221700882306) },
- { FRAC_CONST(0.012796450780212), FRAC_CONST(0.042301014732860) },
- { FRAC_CONST(0.012536655743699), FRAC_CONST(0.042378735974118) },
- { FRAC_CONST(0.012276388709183), FRAC_CONST(0.042454861679919) },
- { FRAC_CONST(0.012015659475571), FRAC_CONST(0.042529388984173) },
- { FRAC_CONST(0.011754477859172), FRAC_CONST(0.042602315080970) },
- { FRAC_CONST(0.011492853693324), FRAC_CONST(0.042673637224683) },
- { FRAC_CONST(0.011230796828031), FRAC_CONST(0.042743352730074) },
- { FRAC_CONST(0.010968317129584), FRAC_CONST(0.042811458972393) },
- { FRAC_CONST(0.010705424480197), FRAC_CONST(0.042877953387479) },
- { FRAC_CONST(0.010442128777629), FRAC_CONST(0.042942833471854) },
- { FRAC_CONST(0.010178439934815), FRAC_CONST(0.043006096782821) },
- { FRAC_CONST(0.009914367879490), FRAC_CONST(0.043067740938551) },
- { FRAC_CONST(0.009649922553818), FRAC_CONST(0.043127763618177) },
- { FRAC_CONST(0.009385113914016), FRAC_CONST(0.043186162561878) },
- { FRAC_CONST(0.009119951929979), FRAC_CONST(0.043242935570968) },
- { FRAC_CONST(0.008854446584907), FRAC_CONST(0.043298080507974) },
- { FRAC_CONST(0.008588607874926), FRAC_CONST(0.043351595296722) },
- { FRAC_CONST(0.008322445808712), FRAC_CONST(0.043403477922409) },
- { FRAC_CONST(0.008055970407118), FRAC_CONST(0.043453726431684) },
- { FRAC_CONST(0.007789191702791), FRAC_CONST(0.043502338932719) },
- { FRAC_CONST(0.007522119739798), FRAC_CONST(0.043549313595281) },
- { FRAC_CONST(0.007254764573250), FRAC_CONST(0.043594648650800) },
- { FRAC_CONST(0.006987136268915), FRAC_CONST(0.043638342392438) },
- { FRAC_CONST(0.006719244902849), FRAC_CONST(0.043680393175148) },
- { FRAC_CONST(0.006451100561010), FRAC_CONST(0.043720799415744) },
- { FRAC_CONST(0.006182713338881), FRAC_CONST(0.043759559592953) },
- { FRAC_CONST(0.005914093341090), FRAC_CONST(0.043796672247476) },
- { FRAC_CONST(0.005645250681027), FRAC_CONST(0.043832135982044) },
- { FRAC_CONST(0.005376195480466), FRAC_CONST(0.043865949461465) },
- { FRAC_CONST(0.005106937869184), FRAC_CONST(0.043898111412683) },
- { FRAC_CONST(0.004837487984578), FRAC_CONST(0.043928620624817) },
- { FRAC_CONST(0.004567855971284), FRAC_CONST(0.043957475949213) },
- { FRAC_CONST(0.004298051980793), FRAC_CONST(0.043984676299484) },
- { FRAC_CONST(0.004028086171076), FRAC_CONST(0.044010220651553) },
- { FRAC_CONST(0.003757968706190), FRAC_CONST(0.044034108043689) },
- { FRAC_CONST(0.003487709755907), FRAC_CONST(0.044056337576546) },
- { FRAC_CONST(0.003217319495322), FRAC_CONST(0.044076908413193) },
- { FRAC_CONST(0.002946808104477), FRAC_CONST(0.044095819779151) },
- { FRAC_CONST(0.002676185767973), FRAC_CONST(0.044113070962418) },
- { FRAC_CONST(0.002405462674586), FRAC_CONST(0.044128661313495) },
- { FRAC_CONST(0.002134649016890), FRAC_CONST(0.044142590245416) },
- { FRAC_CONST(0.001863754990865), FRAC_CONST(0.044154857233763) },
- { FRAC_CONST(0.001592790795518), FRAC_CONST(0.044165461816692) },
- { FRAC_CONST(0.001321766632497), FRAC_CONST(0.044174403594946) },
- { FRAC_CONST(0.001050692705710), FRAC_CONST(0.044181682231873) },
- { FRAC_CONST(0.000779579220936), FRAC_CONST(0.044187297453434) },
- { FRAC_CONST(0.000508436385446), FRAC_CONST(0.044191249048222) },
- { FRAC_CONST(0.000237274407613), FRAC_CONST(0.044193536867459) }
-};
-#endif // LD_DEC
-
-#ifdef ALLOW_SMALL_FRAMELENGTH
-/* 480 (N/4) complex twiddle factors */
-ALIGN static const complex_t mdct_tab_1920[] =
-{
- { FRAC_CONST(0.032274858518097), FRAC_CONST(0.000013202404176) },
- { FRAC_CONST(0.032274642494505), FRAC_CONST(0.000118821372483) },
- { FRAC_CONST(0.032274080835421), FRAC_CONST(0.000224439068308) },
- { FRAC_CONST(0.032273173546860), FRAC_CONST(0.000330054360572) },
- { FRAC_CONST(0.032271920638538), FRAC_CONST(0.000435666118218) },
- { FRAC_CONST(0.032270322123873), FRAC_CONST(0.000541273210231) },
- { FRAC_CONST(0.032268378019984), FRAC_CONST(0.000646874505642) },
- { FRAC_CONST(0.032266088347691), FRAC_CONST(0.000752468873546) },
- { FRAC_CONST(0.032263453131514), FRAC_CONST(0.000858055183114) },
- { FRAC_CONST(0.032260472399674), FRAC_CONST(0.000963632303600) },
- { FRAC_CONST(0.032257146184092), FRAC_CONST(0.001069199104358) },
- { FRAC_CONST(0.032253474520390), FRAC_CONST(0.001174754454853) },
- { FRAC_CONST(0.032249457447888), FRAC_CONST(0.001280297224671) },
- { FRAC_CONST(0.032245095009606), FRAC_CONST(0.001385826283535) },
- { FRAC_CONST(0.032240387252262), FRAC_CONST(0.001491340501313) },
- { FRAC_CONST(0.032235334226272), FRAC_CONST(0.001596838748031) },
- { FRAC_CONST(0.032229935985750), FRAC_CONST(0.001702319893890) },
- { FRAC_CONST(0.032224192588507), FRAC_CONST(0.001807782809271) },
- { FRAC_CONST(0.032218104096050), FRAC_CONST(0.001913226364749) },
- { FRAC_CONST(0.032211670573582), FRAC_CONST(0.002018649431111) },
- { FRAC_CONST(0.032204892090000), FRAC_CONST(0.002124050879359) },
- { FRAC_CONST(0.032197768717898), FRAC_CONST(0.002229429580728) },
- { FRAC_CONST(0.032190300533560), FRAC_CONST(0.002334784406698) },
- { FRAC_CONST(0.032182487616965), FRAC_CONST(0.002440114229003) },
- { FRAC_CONST(0.032174330051782), FRAC_CONST(0.002545417919644) },
- { FRAC_CONST(0.032165827925374), FRAC_CONST(0.002650694350905) },
- { FRAC_CONST(0.032156981328790), FRAC_CONST(0.002755942395358) },
- { FRAC_CONST(0.032147790356771), FRAC_CONST(0.002861160925883) },
- { FRAC_CONST(0.032138255107744), FRAC_CONST(0.002966348815672) },
- { FRAC_CONST(0.032128375683825), FRAC_CONST(0.003071504938250) },
- { FRAC_CONST(0.032118152190814), FRAC_CONST(0.003176628167476) },
- { FRAC_CONST(0.032107584738196), FRAC_CONST(0.003281717377568) },
- { FRAC_CONST(0.032096673439141), FRAC_CONST(0.003386771443102) },
- { FRAC_CONST(0.032085418410500), FRAC_CONST(0.003491789239036) },
- { FRAC_CONST(0.032073819772804), FRAC_CONST(0.003596769640711) },
- { FRAC_CONST(0.032061877650267), FRAC_CONST(0.003701711523874) },
- { FRAC_CONST(0.032049592170778), FRAC_CONST(0.003806613764680) },
- { FRAC_CONST(0.032036963465906), FRAC_CONST(0.003911475239711) },
- { FRAC_CONST(0.032023991670893), FRAC_CONST(0.004016294825985) },
- { FRAC_CONST(0.032010676924657), FRAC_CONST(0.004121071400967) },
- { FRAC_CONST(0.031997019369789), FRAC_CONST(0.004225803842586) },
- { FRAC_CONST(0.031983019152549), FRAC_CONST(0.004330491029241) },
- { FRAC_CONST(0.031968676422869), FRAC_CONST(0.004435131839816) },
- { FRAC_CONST(0.031953991334348), FRAC_CONST(0.004539725153692) },
- { FRAC_CONST(0.031938964044252), FRAC_CONST(0.004644269850758) },
- { FRAC_CONST(0.031923594713510), FRAC_CONST(0.004748764811426) },
- { FRAC_CONST(0.031907883506716), FRAC_CONST(0.004853208916638) },
- { FRAC_CONST(0.031891830592124), FRAC_CONST(0.004957601047881) },
- { FRAC_CONST(0.031875436141648), FRAC_CONST(0.005061940087200) },
- { FRAC_CONST(0.031858700330859), FRAC_CONST(0.005166224917208) },
- { FRAC_CONST(0.031841623338985), FRAC_CONST(0.005270454421097) },
- { FRAC_CONST(0.031824205348907), FRAC_CONST(0.005374627482653) },
- { FRAC_CONST(0.031806446547156), FRAC_CONST(0.005478742986267) },
- { FRAC_CONST(0.031788347123916), FRAC_CONST(0.005582799816945) },
- { FRAC_CONST(0.031769907273017), FRAC_CONST(0.005686796860323) },
- { FRAC_CONST(0.031751127191935), FRAC_CONST(0.005790733002674) },
- { FRAC_CONST(0.031732007081789), FRAC_CONST(0.005894607130928) },
- { FRAC_CONST(0.031712547147340), FRAC_CONST(0.005998418132675) },
- { FRAC_CONST(0.031692747596989), FRAC_CONST(0.006102164896182) },
- { FRAC_CONST(0.031672608642773), FRAC_CONST(0.006205846310406) },
- { FRAC_CONST(0.031652130500364), FRAC_CONST(0.006309461265002) },
- { FRAC_CONST(0.031631313389067), FRAC_CONST(0.006413008650337) },
- { FRAC_CONST(0.031610157531816), FRAC_CONST(0.006516487357501) },
- { FRAC_CONST(0.031588663155172), FRAC_CONST(0.006619896278321) },
- { FRAC_CONST(0.031566830489325), FRAC_CONST(0.006723234305370) },
- { FRAC_CONST(0.031544659768083), FRAC_CONST(0.006826500331981) },
- { FRAC_CONST(0.031522151228878), FRAC_CONST(0.006929693252258) },
- { FRAC_CONST(0.031499305112758), FRAC_CONST(0.007032811961088) },
- { FRAC_CONST(0.031476121664387), FRAC_CONST(0.007135855354151) },
- { FRAC_CONST(0.031452601132040), FRAC_CONST(0.007238822327937) },
- { FRAC_CONST(0.031428743767604), FRAC_CONST(0.007341711779751) },
- { FRAC_CONST(0.031404549826572), FRAC_CONST(0.007444522607730) },
- { FRAC_CONST(0.031380019568042), FRAC_CONST(0.007547253710853) },
- { FRAC_CONST(0.031355153254712), FRAC_CONST(0.007649903988952) },
- { FRAC_CONST(0.031329951152882), FRAC_CONST(0.007752472342725) },
- { FRAC_CONST(0.031304413532445), FRAC_CONST(0.007854957673748) },
- { FRAC_CONST(0.031278540666888), FRAC_CONST(0.007957358884484) },
- { FRAC_CONST(0.031252332833290), FRAC_CONST(0.008059674878300) },
- { FRAC_CONST(0.031225790312316), FRAC_CONST(0.008161904559473) },
- { FRAC_CONST(0.031198913388214), FRAC_CONST(0.008264046833205) },
- { FRAC_CONST(0.031171702348814), FRAC_CONST(0.008366100605636) },
- { FRAC_CONST(0.031144157485525), FRAC_CONST(0.008468064783849) },
- { FRAC_CONST(0.031116279093331), FRAC_CONST(0.008569938275893) },
- { FRAC_CONST(0.031088067470786), FRAC_CONST(0.008671719990782) },
- { FRAC_CONST(0.031059522920014), FRAC_CONST(0.008773408838517) },
- { FRAC_CONST(0.031030645746705), FRAC_CONST(0.008875003730092) },
- { FRAC_CONST(0.031001436260110), FRAC_CONST(0.008976503577507) },
- { FRAC_CONST(0.030971894773039), FRAC_CONST(0.009077907293780) },
- { FRAC_CONST(0.030942021601857), FRAC_CONST(0.009179213792959) },
- { FRAC_CONST(0.030911817066483), FRAC_CONST(0.009280421990133) },
- { FRAC_CONST(0.030881281490382), FRAC_CONST(0.009381530801444) },
- { FRAC_CONST(0.030850415200566), FRAC_CONST(0.009482539144097) },
- { FRAC_CONST(0.030819218527589), FRAC_CONST(0.009583445936373) },
- { FRAC_CONST(0.030787691805541), FRAC_CONST(0.009684250097643) },
- { FRAC_CONST(0.030755835372048), FRAC_CONST(0.009784950548375) },
- { FRAC_CONST(0.030723649568268), FRAC_CONST(0.009885546210147) },
- { FRAC_CONST(0.030691134738883), FRAC_CONST(0.009986036005661) },
- { FRAC_CONST(0.030658291232103), FRAC_CONST(0.010086418858753) },
- { FRAC_CONST(0.030625119399655), FRAC_CONST(0.010186693694402) },
- { FRAC_CONST(0.030591619596781), FRAC_CONST(0.010286859438745) },
- { FRAC_CONST(0.030557792182239), FRAC_CONST(0.010386915019088) },
- { FRAC_CONST(0.030523637518292), FRAC_CONST(0.010486859363916) },
- { FRAC_CONST(0.030489155970710), FRAC_CONST(0.010586691402906) },
- { FRAC_CONST(0.030454347908763), FRAC_CONST(0.010686410066936) },
- { FRAC_CONST(0.030419213705216), FRAC_CONST(0.010786014288099) },
- { FRAC_CONST(0.030383753736329), FRAC_CONST(0.010885502999714) },
- { FRAC_CONST(0.030347968381849), FRAC_CONST(0.010984875136338) },
- { FRAC_CONST(0.030311858025010), FRAC_CONST(0.011084129633775) },
- { FRAC_CONST(0.030275423052523), FRAC_CONST(0.011183265429088) },
- { FRAC_CONST(0.030238663854579), FRAC_CONST(0.011282281460612) },
- { FRAC_CONST(0.030201580824838), FRAC_CONST(0.011381176667967) },
- { FRAC_CONST(0.030164174360430), FRAC_CONST(0.011479949992062) },
- { FRAC_CONST(0.030126444861948), FRAC_CONST(0.011578600375117) },
- { FRAC_CONST(0.030088392733446), FRAC_CONST(0.011677126760663) },
- { FRAC_CONST(0.030050018382430), FRAC_CONST(0.011775528093563) },
- { FRAC_CONST(0.030011322219859), FRAC_CONST(0.011873803320018) },
- { FRAC_CONST(0.029972304660138), FRAC_CONST(0.011971951387578) },
- { FRAC_CONST(0.029932966121114), FRAC_CONST(0.012069971245157) },
- { FRAC_CONST(0.029893307024070), FRAC_CONST(0.012167861843041) },
- { FRAC_CONST(0.029853327793724), FRAC_CONST(0.012265622132901) },
- { FRAC_CONST(0.029813028858222), FRAC_CONST(0.012363251067801) },
- { FRAC_CONST(0.029772410649132), FRAC_CONST(0.012460747602215) },
- { FRAC_CONST(0.029731473601443), FRAC_CONST(0.012558110692033) },
- { FRAC_CONST(0.029690218153558), FRAC_CONST(0.012655339294575) },
- { FRAC_CONST(0.029648644747289), FRAC_CONST(0.012752432368600) },
- { FRAC_CONST(0.029606753827855), FRAC_CONST(0.012849388874320) },
- { FRAC_CONST(0.029564545843872), FRAC_CONST(0.012946207773407) },
- { FRAC_CONST(0.029522021247356), FRAC_CONST(0.013042888029011) },
- { FRAC_CONST(0.029479180493710), FRAC_CONST(0.013139428605762) },
- { FRAC_CONST(0.029436024041725), FRAC_CONST(0.013235828469789) },
- { FRAC_CONST(0.029392552353570), FRAC_CONST(0.013332086588727) },
- { FRAC_CONST(0.029348765894794), FRAC_CONST(0.013428201931728) },
- { FRAC_CONST(0.029304665134313), FRAC_CONST(0.013524173469475) },
- { FRAC_CONST(0.029260250544412), FRAC_CONST(0.013620000174189) },
- { FRAC_CONST(0.029215522600735), FRAC_CONST(0.013715681019643) },
- { FRAC_CONST(0.029170481782283), FRAC_CONST(0.013811214981173) },
- { FRAC_CONST(0.029125128571406), FRAC_CONST(0.013906601035686) },
- { FRAC_CONST(0.029079463453801), FRAC_CONST(0.014001838161674) },
- { FRAC_CONST(0.029033486918505), FRAC_CONST(0.014096925339225) },
- { FRAC_CONST(0.028987199457889), FRAC_CONST(0.014191861550031) },
- { FRAC_CONST(0.028940601567655), FRAC_CONST(0.014286645777401) },
- { FRAC_CONST(0.028893693746829), FRAC_CONST(0.014381277006273) },
- { FRAC_CONST(0.028846476497755), FRAC_CONST(0.014475754223221) },
- { FRAC_CONST(0.028798950326094), FRAC_CONST(0.014570076416472) },
- { FRAC_CONST(0.028751115740811), FRAC_CONST(0.014664242575910) },
- { FRAC_CONST(0.028702973254178), FRAC_CONST(0.014758251693091) },
- { FRAC_CONST(0.028654523381760), FRAC_CONST(0.014852102761253) },
- { FRAC_CONST(0.028605766642418), FRAC_CONST(0.014945794775326) },
- { FRAC_CONST(0.028556703558297), FRAC_CONST(0.015039326731945) },
- { FRAC_CONST(0.028507334654823), FRAC_CONST(0.015132697629457) },
- { FRAC_CONST(0.028457660460698), FRAC_CONST(0.015225906467935) },
- { FRAC_CONST(0.028407681507891), FRAC_CONST(0.015318952249187) },
- { FRAC_CONST(0.028357398331639), FRAC_CONST(0.015411833976768) },
- { FRAC_CONST(0.028306811470432), FRAC_CONST(0.015504550655988) },
- { FRAC_CONST(0.028255921466016), FRAC_CONST(0.015597101293927) },
- { FRAC_CONST(0.028204728863381), FRAC_CONST(0.015689484899442) },
- { FRAC_CONST(0.028153234210760), FRAC_CONST(0.015781700483179) },
- { FRAC_CONST(0.028101438059619), FRAC_CONST(0.015873747057582) },
- { FRAC_CONST(0.028049340964652), FRAC_CONST(0.015965623636907) },
- { FRAC_CONST(0.027996943483779), FRAC_CONST(0.016057329237229) },
- { FRAC_CONST(0.027944246178133), FRAC_CONST(0.016148862876456) },
- { FRAC_CONST(0.027891249612061), FRAC_CONST(0.016240223574335) },
- { FRAC_CONST(0.027837954353113), FRAC_CONST(0.016331410352467) },
- { FRAC_CONST(0.027784360972039), FRAC_CONST(0.016422422234315) },
- { FRAC_CONST(0.027730470042780), FRAC_CONST(0.016513258245214) },
- { FRAC_CONST(0.027676282142466), FRAC_CONST(0.016603917412384) },
- { FRAC_CONST(0.027621797851405), FRAC_CONST(0.016694398764938) },
- { FRAC_CONST(0.027567017753080), FRAC_CONST(0.016784701333894) },
- { FRAC_CONST(0.027511942434143), FRAC_CONST(0.016874824152183) },
- { FRAC_CONST(0.027456572484404), FRAC_CONST(0.016964766254662) },
- { FRAC_CONST(0.027400908496833), FRAC_CONST(0.017054526678124) },
- { FRAC_CONST(0.027344951067546), FRAC_CONST(0.017144104461307) },
- { FRAC_CONST(0.027288700795801), FRAC_CONST(0.017233498644904) },
- { FRAC_CONST(0.027232158283994), FRAC_CONST(0.017322708271577) },
- { FRAC_CONST(0.027175324137651), FRAC_CONST(0.017411732385960) },
- { FRAC_CONST(0.027118198965418), FRAC_CONST(0.017500570034678) },
- { FRAC_CONST(0.027060783379060), FRAC_CONST(0.017589220266351) },
- { FRAC_CONST(0.027003077993454), FRAC_CONST(0.017677682131607) },
- { FRAC_CONST(0.026945083426576), FRAC_CONST(0.017765954683088) },
- { FRAC_CONST(0.026886800299502), FRAC_CONST(0.017854036975468) },
- { FRAC_CONST(0.026828229236397), FRAC_CONST(0.017941928065456) },
- { FRAC_CONST(0.026769370864511), FRAC_CONST(0.018029627011808) },
- { FRAC_CONST(0.026710225814170), FRAC_CONST(0.018117132875340) },
- { FRAC_CONST(0.026650794718768), FRAC_CONST(0.018204444718934) },
- { FRAC_CONST(0.026591078214767), FRAC_CONST(0.018291561607551) },
- { FRAC_CONST(0.026531076941680), FRAC_CONST(0.018378482608238) },
- { FRAC_CONST(0.026470791542075), FRAC_CONST(0.018465206790142) },
- { FRAC_CONST(0.026410222661558), FRAC_CONST(0.018551733224515) },
- { FRAC_CONST(0.026349370948775), FRAC_CONST(0.018638060984730) },
- { FRAC_CONST(0.026288237055398), FRAC_CONST(0.018724189146286) },
- { FRAC_CONST(0.026226821636121), FRAC_CONST(0.018810116786819) },
- { FRAC_CONST(0.026165125348656), FRAC_CONST(0.018895842986112) },
- { FRAC_CONST(0.026103148853718), FRAC_CONST(0.018981366826109) },
- { FRAC_CONST(0.026040892815028), FRAC_CONST(0.019066687390916) },
- { FRAC_CONST(0.025978357899296), FRAC_CONST(0.019151803766819) },
- { FRAC_CONST(0.025915544776223), FRAC_CONST(0.019236715042290) },
- { FRAC_CONST(0.025852454118485), FRAC_CONST(0.019321420307998) },
- { FRAC_CONST(0.025789086601733), FRAC_CONST(0.019405918656817) },
- { FRAC_CONST(0.025725442904582), FRAC_CONST(0.019490209183837) },
- { FRAC_CONST(0.025661523708606), FRAC_CONST(0.019574290986376) },
- { FRAC_CONST(0.025597329698327), FRAC_CONST(0.019658163163984) },
- { FRAC_CONST(0.025532861561211), FRAC_CONST(0.019741824818458) },
- { FRAC_CONST(0.025468119987662), FRAC_CONST(0.019825275053848) },
- { FRAC_CONST(0.025403105671008), FRAC_CONST(0.019908512976470) },
- { FRAC_CONST(0.025337819307501), FRAC_CONST(0.019991537694913) },
- { FRAC_CONST(0.025272261596305), FRAC_CONST(0.020074348320047) },
- { FRAC_CONST(0.025206433239491), FRAC_CONST(0.020156943965039) },
- { FRAC_CONST(0.025140334942028), FRAC_CONST(0.020239323745355) },
- { FRAC_CONST(0.025073967411776), FRAC_CONST(0.020321486778774) },
- { FRAC_CONST(0.025007331359476), FRAC_CONST(0.020403432185395) },
- { FRAC_CONST(0.024940427498748), FRAC_CONST(0.020485159087650) },
- { FRAC_CONST(0.024873256546079), FRAC_CONST(0.020566666610309) },
- { FRAC_CONST(0.024805819220816), FRAC_CONST(0.020647953880491) },
- { FRAC_CONST(0.024738116245157), FRAC_CONST(0.020729020027676) },
- { FRAC_CONST(0.024670148344147), FRAC_CONST(0.020809864183709) },
- { FRAC_CONST(0.024601916245669), FRAC_CONST(0.020890485482816) },
- { FRAC_CONST(0.024533420680433), FRAC_CONST(0.020970883061607) },
- { FRAC_CONST(0.024464662381971), FRAC_CONST(0.021051056059087) },
- { FRAC_CONST(0.024395642086630), FRAC_CONST(0.021131003616670) },
- { FRAC_CONST(0.024326360533561), FRAC_CONST(0.021210724878181) },
- { FRAC_CONST(0.024256818464715), FRAC_CONST(0.021290218989868) },
- { FRAC_CONST(0.024187016624830), FRAC_CONST(0.021369485100415) },
- { FRAC_CONST(0.024116955761430), FRAC_CONST(0.021448522360944) },
- { FRAC_CONST(0.024046636624808), FRAC_CONST(0.021527329925030) },
- { FRAC_CONST(0.023976059968027), FRAC_CONST(0.021605906948708) },
- { FRAC_CONST(0.023905226546906), FRAC_CONST(0.021684252590480) },
- { FRAC_CONST(0.023834137120014), FRAC_CONST(0.021762366011328) },
- { FRAC_CONST(0.023762792448662), FRAC_CONST(0.021840246374720) },
- { FRAC_CONST(0.023691193296893), FRAC_CONST(0.021917892846620) },
- { FRAC_CONST(0.023619340431478), FRAC_CONST(0.021995304595495) },
- { FRAC_CONST(0.023547234621902), FRAC_CONST(0.022072480792330) },
- { FRAC_CONST(0.023474876640361), FRAC_CONST(0.022149420610628) },
- { FRAC_CONST(0.023402267261751), FRAC_CONST(0.022226123226426) },
- { FRAC_CONST(0.023329407263659), FRAC_CONST(0.022302587818300) },
- { FRAC_CONST(0.023256297426359), FRAC_CONST(0.022378813567377) },
- { FRAC_CONST(0.023182938532797), FRAC_CONST(0.022454799657339) },
- { FRAC_CONST(0.023109331368588), FRAC_CONST(0.022530545274437) },
- { FRAC_CONST(0.023035476722006), FRAC_CONST(0.022606049607496) },
- { FRAC_CONST(0.022961375383975), FRAC_CONST(0.022681311847926) },
- { FRAC_CONST(0.022887028148061), FRAC_CONST(0.022756331189727) },
- { FRAC_CONST(0.022812435810462), FRAC_CONST(0.022831106829504) },
- { FRAC_CONST(0.022737599170003), FRAC_CONST(0.022905637966469) },
- { FRAC_CONST(0.022662519028125), FRAC_CONST(0.022979923802453) },
- { FRAC_CONST(0.022587196188874), FRAC_CONST(0.023053963541915) },
- { FRAC_CONST(0.022511631458899), FRAC_CONST(0.023127756391950) },
- { FRAC_CONST(0.022435825647437), FRAC_CONST(0.023201301562294) },
- { FRAC_CONST(0.022359779566306), FRAC_CONST(0.023274598265338) },
- { FRAC_CONST(0.022283494029900), FRAC_CONST(0.023347645716133) },
- { FRAC_CONST(0.022206969855176), FRAC_CONST(0.023420443132400) },
- { FRAC_CONST(0.022130207861645), FRAC_CONST(0.023492989734537) },
- { FRAC_CONST(0.022053208871367), FRAC_CONST(0.023565284745628) },
- { FRAC_CONST(0.021975973708940), FRAC_CONST(0.023637327391451) },
- { FRAC_CONST(0.021898503201489), FRAC_CONST(0.023709116900488) },
- { FRAC_CONST(0.021820798178663), FRAC_CONST(0.023780652503931) },
- { FRAC_CONST(0.021742859472618), FRAC_CONST(0.023851933435691) },
- { FRAC_CONST(0.021664687918017), FRAC_CONST(0.023922958932406) },
- { FRAC_CONST(0.021586284352013), FRAC_CONST(0.023993728233451) },
- { FRAC_CONST(0.021507649614247), FRAC_CONST(0.024064240580942) },
- { FRAC_CONST(0.021428784546832), FRAC_CONST(0.024134495219750) },
- { FRAC_CONST(0.021349689994350), FRAC_CONST(0.024204491397504) },
- { FRAC_CONST(0.021270366803840), FRAC_CONST(0.024274228364600) },
- { FRAC_CONST(0.021190815824791), FRAC_CONST(0.024343705374213) },
- { FRAC_CONST(0.021111037909128), FRAC_CONST(0.024412921682298) },
- { FRAC_CONST(0.021031033911210), FRAC_CONST(0.024481876547605) },
- { FRAC_CONST(0.020950804687815), FRAC_CONST(0.024550569231683) },
- { FRAC_CONST(0.020870351098134), FRAC_CONST(0.024618998998889) },
- { FRAC_CONST(0.020789674003759), FRAC_CONST(0.024687165116394) },
- { FRAC_CONST(0.020708774268678), FRAC_CONST(0.024755066854194) },
- { FRAC_CONST(0.020627652759262), FRAC_CONST(0.024822703485116) },
- { FRAC_CONST(0.020546310344257), FRAC_CONST(0.024890074284826) },
- { FRAC_CONST(0.020464747894775), FRAC_CONST(0.024957178531837) },
- { FRAC_CONST(0.020382966284284), FRAC_CONST(0.025024015507516) },
- { FRAC_CONST(0.020300966388600), FRAC_CONST(0.025090584496093) },
- { FRAC_CONST(0.020218749085876), FRAC_CONST(0.025156884784668) },
- { FRAC_CONST(0.020136315256592), FRAC_CONST(0.025222915663218) },
- { FRAC_CONST(0.020053665783549), FRAC_CONST(0.025288676424605) },
- { FRAC_CONST(0.019970801551857), FRAC_CONST(0.025354166364584) },
- { FRAC_CONST(0.019887723448925), FRAC_CONST(0.025419384781811) },
- { FRAC_CONST(0.019804432364452), FRAC_CONST(0.025484330977848) },
- { FRAC_CONST(0.019720929190419), FRAC_CONST(0.025549004257175) },
- { FRAC_CONST(0.019637214821078), FRAC_CONST(0.025613403927192) },
- { FRAC_CONST(0.019553290152943), FRAC_CONST(0.025677529298230) },
- { FRAC_CONST(0.019469156084779), FRAC_CONST(0.025741379683559) },
- { FRAC_CONST(0.019384813517595), FRAC_CONST(0.025804954399392) },
- { FRAC_CONST(0.019300263354632), FRAC_CONST(0.025868252764895) },
- { FRAC_CONST(0.019215506501354), FRAC_CONST(0.025931274102193) },
- { FRAC_CONST(0.019130543865439), FRAC_CONST(0.025994017736379) },
- { FRAC_CONST(0.019045376356769), FRAC_CONST(0.026056482995518) },
- { FRAC_CONST(0.018960004887419), FRAC_CONST(0.026118669210657) },
- { FRAC_CONST(0.018874430371648), FRAC_CONST(0.026180575715833) },
- { FRAC_CONST(0.018788653725892), FRAC_CONST(0.026242201848076) },
- { FRAC_CONST(0.018702675868750), FRAC_CONST(0.026303546947421) },
- { FRAC_CONST(0.018616497720974), FRAC_CONST(0.026364610356909) },
- { FRAC_CONST(0.018530120205464), FRAC_CONST(0.026425391422602) },
- { FRAC_CONST(0.018443544247254), FRAC_CONST(0.026485889493583) },
- { FRAC_CONST(0.018356770773502), FRAC_CONST(0.026546103921965) },
- { FRAC_CONST(0.018269800713483), FRAC_CONST(0.026606034062902) },
- { FRAC_CONST(0.018182634998576), FRAC_CONST(0.026665679274589) },
- { FRAC_CONST(0.018095274562256), FRAC_CONST(0.026725038918274) },
- { FRAC_CONST(0.018007720340083), FRAC_CONST(0.026784112358263) },
- { FRAC_CONST(0.017919973269692), FRAC_CONST(0.026842898961926) },
- { FRAC_CONST(0.017832034290785), FRAC_CONST(0.026901398099707) },
- { FRAC_CONST(0.017743904345116), FRAC_CONST(0.026959609145127) },
- { FRAC_CONST(0.017655584376488), FRAC_CONST(0.027017531474792) },
- { FRAC_CONST(0.017567075330734), FRAC_CONST(0.027075164468401) },
- { FRAC_CONST(0.017478378155718), FRAC_CONST(0.027132507508750) },
- { FRAC_CONST(0.017389493801313), FRAC_CONST(0.027189559981742) },
- { FRAC_CONST(0.017300423219401), FRAC_CONST(0.027246321276391) },
- { FRAC_CONST(0.017211167363854), FRAC_CONST(0.027302790784828) },
- { FRAC_CONST(0.017121727190533), FRAC_CONST(0.027358967902310) },
- { FRAC_CONST(0.017032103657269), FRAC_CONST(0.027414852027226) },
- { FRAC_CONST(0.016942297723858), FRAC_CONST(0.027470442561102) },
- { FRAC_CONST(0.016852310352050), FRAC_CONST(0.027525738908608) },
- { FRAC_CONST(0.016762142505537), FRAC_CONST(0.027580740477564) },
- { FRAC_CONST(0.016671795149944), FRAC_CONST(0.027635446678948) },
- { FRAC_CONST(0.016581269252819), FRAC_CONST(0.027689856926900) },
- { FRAC_CONST(0.016490565783622), FRAC_CONST(0.027743970638730) },
- { FRAC_CONST(0.016399685713714), FRAC_CONST(0.027797787234924) },
- { FRAC_CONST(0.016308630016347), FRAC_CONST(0.027851306139149) },
- { FRAC_CONST(0.016217399666655), FRAC_CONST(0.027904526778260) },
- { FRAC_CONST(0.016125995641641), FRAC_CONST(0.027957448582309) },
- { FRAC_CONST(0.016034418920170), FRAC_CONST(0.028010070984544) },
- { FRAC_CONST(0.015942670482954), FRAC_CONST(0.028062393421421) },
- { FRAC_CONST(0.015850751312545), FRAC_CONST(0.028114415332610) },
- { FRAC_CONST(0.015758662393324), FRAC_CONST(0.028166136160998) },
- { FRAC_CONST(0.015666404711489), FRAC_CONST(0.028217555352697) },
- { FRAC_CONST(0.015573979255046), FRAC_CONST(0.028268672357047) },
- { FRAC_CONST(0.015481387013797), FRAC_CONST(0.028319486626627) },
- { FRAC_CONST(0.015388628979331), FRAC_CONST(0.028369997617257) },
- { FRAC_CONST(0.015295706145012), FRAC_CONST(0.028420204788004) },
- { FRAC_CONST(0.015202619505968), FRAC_CONST(0.028470107601191) },
- { FRAC_CONST(0.015109370059084), FRAC_CONST(0.028519705522399) },
- { FRAC_CONST(0.015015958802984), FRAC_CONST(0.028568998020472) },
- { FRAC_CONST(0.014922386738030), FRAC_CONST(0.028617984567529) },
- { FRAC_CONST(0.014828654866302), FRAC_CONST(0.028666664638963) },
- { FRAC_CONST(0.014734764191593), FRAC_CONST(0.028715037713449) },
- { FRAC_CONST(0.014640715719398), FRAC_CONST(0.028763103272951) },
- { FRAC_CONST(0.014546510456900), FRAC_CONST(0.028810860802724) },
- { FRAC_CONST(0.014452149412962), FRAC_CONST(0.028858309791325) },
- { FRAC_CONST(0.014357633598114), FRAC_CONST(0.028905449730613) },
- { FRAC_CONST(0.014262964024545), FRAC_CONST(0.028952280115756) },
- { FRAC_CONST(0.014168141706090), FRAC_CONST(0.028998800445240) },
- { FRAC_CONST(0.014073167658220), FRAC_CONST(0.029045010220868) },
- { FRAC_CONST(0.013978042898030), FRAC_CONST(0.029090908947771) },
- { FRAC_CONST(0.013882768444231), FRAC_CONST(0.029136496134411) },
- { FRAC_CONST(0.013787345317136), FRAC_CONST(0.029181771292585) },
- { FRAC_CONST(0.013691774538648), FRAC_CONST(0.029226733937433) },
- { FRAC_CONST(0.013596057132255), FRAC_CONST(0.029271383587441) },
- { FRAC_CONST(0.013500194123014), FRAC_CONST(0.029315719764447) },
- { FRAC_CONST(0.013404186537539), FRAC_CONST(0.029359741993647) },
- { FRAC_CONST(0.013308035403995), FRAC_CONST(0.029403449803598) },
- { FRAC_CONST(0.013211741752084), FRAC_CONST(0.029446842726223) },
- { FRAC_CONST(0.013115306613032), FRAC_CONST(0.029489920296820) },
- { FRAC_CONST(0.013018731019584), FRAC_CONST(0.029532682054063) },
- { FRAC_CONST(0.012922016005985), FRAC_CONST(0.029575127540008) },
- { FRAC_CONST(0.012825162607977), FRAC_CONST(0.029617256300097) },
- { FRAC_CONST(0.012728171862781), FRAC_CONST(0.029659067883165) },
- { FRAC_CONST(0.012631044809089), FRAC_CONST(0.029700561841444) },
- { FRAC_CONST(0.012533782487056), FRAC_CONST(0.029741737730567) },
- { FRAC_CONST(0.012436385938281), FRAC_CONST(0.029782595109573) },
- { FRAC_CONST(0.012338856205805), FRAC_CONST(0.029823133540913) },
- { FRAC_CONST(0.012241194334091), FRAC_CONST(0.029863352590452) },
- { FRAC_CONST(0.012143401369021), FRAC_CONST(0.029903251827477) },
- { FRAC_CONST(0.012045478357878), FRAC_CONST(0.029942830824699) },
- { FRAC_CONST(0.011947426349339), FRAC_CONST(0.029982089158259) },
- { FRAC_CONST(0.011849246393462), FRAC_CONST(0.030021026407731) },
- { FRAC_CONST(0.011750939541676), FRAC_CONST(0.030059642156129) },
- { FRAC_CONST(0.011652506846768), FRAC_CONST(0.030097935989909) },
- { FRAC_CONST(0.011553949362874), FRAC_CONST(0.030135907498976) },
- { FRAC_CONST(0.011455268145464), FRAC_CONST(0.030173556276684) },
- { FRAC_CONST(0.011356464251335), FRAC_CONST(0.030210881919845) },
- { FRAC_CONST(0.011257538738598), FRAC_CONST(0.030247884028732) },
- { FRAC_CONST(0.011158492666665), FRAC_CONST(0.030284562207083) },
- { FRAC_CONST(0.011059327096240), FRAC_CONST(0.030320916062102) },
- { FRAC_CONST(0.010960043089307), FRAC_CONST(0.030356945204470) },
- { FRAC_CONST(0.010860641709118), FRAC_CONST(0.030392649248343) },
- { FRAC_CONST(0.010761124020182), FRAC_CONST(0.030428027811361) },
- { FRAC_CONST(0.010661491088253), FRAC_CONST(0.030463080514646) },
- { FRAC_CONST(0.010561743980319), FRAC_CONST(0.030497806982812) },
- { FRAC_CONST(0.010461883764593), FRAC_CONST(0.030532206843968) },
- { FRAC_CONST(0.010361911510496), FRAC_CONST(0.030566279729717) },
- { FRAC_CONST(0.010261828288652), FRAC_CONST(0.030600025275167) },
- { FRAC_CONST(0.010161635170872), FRAC_CONST(0.030633443118931) },
- { FRAC_CONST(0.010061333230142), FRAC_CONST(0.030666532903129) },
- { FRAC_CONST(0.009960923540617), FRAC_CONST(0.030699294273397) },
- { FRAC_CONST(0.009860407177603), FRAC_CONST(0.030731726878888) },
- { FRAC_CONST(0.009759785217550), FRAC_CONST(0.030763830372273) },
- { FRAC_CONST(0.009659058738038), FRAC_CONST(0.030795604409750) },
- { FRAC_CONST(0.009558228817767), FRAC_CONST(0.030827048651045) },
- { FRAC_CONST(0.009457296536545), FRAC_CONST(0.030858162759415) },
- { FRAC_CONST(0.009356262975275), FRAC_CONST(0.030888946401653) },
- { FRAC_CONST(0.009255129215945), FRAC_CONST(0.030919399248091) },
- { FRAC_CONST(0.009153896341616), FRAC_CONST(0.030949520972603) },
- { FRAC_CONST(0.009052565436412), FRAC_CONST(0.030979311252611) },
- { FRAC_CONST(0.008951137585505), FRAC_CONST(0.031008769769084) },
- { FRAC_CONST(0.008849613875105), FRAC_CONST(0.031037896206544) },
- { FRAC_CONST(0.008747995392451), FRAC_CONST(0.031066690253072) },
- { FRAC_CONST(0.008646283225794), FRAC_CONST(0.031095151600306) },
- { FRAC_CONST(0.008544478464390), FRAC_CONST(0.031123279943448) },
- { FRAC_CONST(0.008442582198486), FRAC_CONST(0.031151074981266) },
- { FRAC_CONST(0.008340595519310), FRAC_CONST(0.031178536416098) },
- { FRAC_CONST(0.008238519519057), FRAC_CONST(0.031205663953853) },
- { FRAC_CONST(0.008136355290878), FRAC_CONST(0.031232457304017) },
- { FRAC_CONST(0.008034103928871), FRAC_CONST(0.031258916179656) },
- { FRAC_CONST(0.007931766528065), FRAC_CONST(0.031285040297416) },
- { FRAC_CONST(0.007829344184412), FRAC_CONST(0.031310829377528) },
- { FRAC_CONST(0.007726837994772), FRAC_CONST(0.031336283143813) },
- { FRAC_CONST(0.007624249056906), FRAC_CONST(0.031361401323680) },
- { FRAC_CONST(0.007521578469457), FRAC_CONST(0.031386183648135) },
- { FRAC_CONST(0.007418827331946), FRAC_CONST(0.031410629851778) },
- { FRAC_CONST(0.007315996744755), FRAC_CONST(0.031434739672811) },
- { FRAC_CONST(0.007213087809115), FRAC_CONST(0.031458512853036) },
- { FRAC_CONST(0.007110101627101), FRAC_CONST(0.031481949137863) },
- { FRAC_CONST(0.007007039301610), FRAC_CONST(0.031505048276306) },
- { FRAC_CONST(0.006903901936357), FRAC_CONST(0.031527810020993) },
- { FRAC_CONST(0.006800690635862), FRAC_CONST(0.031550234128164) },
- { FRAC_CONST(0.006697406505433), FRAC_CONST(0.031572320357675) },
- { FRAC_CONST(0.006594050651161), FRAC_CONST(0.031594068473000) },
- { FRAC_CONST(0.006490624179905), FRAC_CONST(0.031615478241233) },
- { FRAC_CONST(0.006387128199278), FRAC_CONST(0.031636549433095) },
- { FRAC_CONST(0.006283563817639), FRAC_CONST(0.031657281822929) },
- { FRAC_CONST(0.006179932144080), FRAC_CONST(0.031677675188707) },
- { FRAC_CONST(0.006076234288412), FRAC_CONST(0.031697729312034) },
- { FRAC_CONST(0.005972471361157), FRAC_CONST(0.031717443978146) },
- { FRAC_CONST(0.005868644473532), FRAC_CONST(0.031736818975914) },
- { FRAC_CONST(0.005764754737440), FRAC_CONST(0.031755854097848) },
- { FRAC_CONST(0.005660803265456), FRAC_CONST(0.031774549140098) },
- { FRAC_CONST(0.005556791170816), FRAC_CONST(0.031792903902453) },
- { FRAC_CONST(0.005452719567407), FRAC_CONST(0.031810918188350) },
- { FRAC_CONST(0.005348589569753), FRAC_CONST(0.031828591804869) },
- { FRAC_CONST(0.005244402293001), FRAC_CONST(0.031845924562742) },
- { FRAC_CONST(0.005140158852914), FRAC_CONST(0.031862916276347) },
- { FRAC_CONST(0.005035860365855), FRAC_CONST(0.031879566763717) },
- { FRAC_CONST(0.004931507948778), FRAC_CONST(0.031895875846539) },
- { FRAC_CONST(0.004827102719212), FRAC_CONST(0.031911843350155) },
- { FRAC_CONST(0.004722645795254), FRAC_CONST(0.031927469103567) },
- { FRAC_CONST(0.004618138295554), FRAC_CONST(0.031942752939435) },
- { FRAC_CONST(0.004513581339303), FRAC_CONST(0.031957694694082) },
- { FRAC_CONST(0.004408976046222), FRAC_CONST(0.031972294207493) },
- { FRAC_CONST(0.004304323536549), FRAC_CONST(0.031986551323320) },
- { FRAC_CONST(0.004199624931030), FRAC_CONST(0.032000465888879) },
- { FRAC_CONST(0.004094881350902), FRAC_CONST(0.032014037755158) },
- { FRAC_CONST(0.003990093917884), FRAC_CONST(0.032027266776813) },
- { FRAC_CONST(0.003885263754166), FRAC_CONST(0.032040152812170) },
- { FRAC_CONST(0.003780391982394), FRAC_CONST(0.032052695723232) },
- { FRAC_CONST(0.003675479725661), FRAC_CONST(0.032064895375674) },
- { FRAC_CONST(0.003570528107494), FRAC_CONST(0.032076751638847) },
- { FRAC_CONST(0.003465538251839), FRAC_CONST(0.032088264385780) },
- { FRAC_CONST(0.003360511283053), FRAC_CONST(0.032099433493181) },
- { FRAC_CONST(0.003255448325892), FRAC_CONST(0.032110258841438) },
- { FRAC_CONST(0.003150350505494), FRAC_CONST(0.032120740314619) },
- { FRAC_CONST(0.003045218947373), FRAC_CONST(0.032130877800478) },
- { FRAC_CONST(0.002940054777404), FRAC_CONST(0.032140671190449) },
- { FRAC_CONST(0.002834859121810), FRAC_CONST(0.032150120379653) },
- { FRAC_CONST(0.002729633107153), FRAC_CONST(0.032159225266897) },
- { FRAC_CONST(0.002624377860318), FRAC_CONST(0.032167985754674) },
- { FRAC_CONST(0.002519094508504), FRAC_CONST(0.032176401749168) },
- { FRAC_CONST(0.002413784179212), FRAC_CONST(0.032184473160250) },
- { FRAC_CONST(0.002308448000231), FRAC_CONST(0.032192199901481) },
- { FRAC_CONST(0.002203087099626), FRAC_CONST(0.032199581890114) },
- { FRAC_CONST(0.002097702605728), FRAC_CONST(0.032206619047093) },
- { FRAC_CONST(0.001992295647121), FRAC_CONST(0.032213311297057) },
- { FRAC_CONST(0.001886867352628), FRAC_CONST(0.032219658568338) },
- { FRAC_CONST(0.001781418851302), FRAC_CONST(0.032225660792960) },
- { FRAC_CONST(0.001675951272410), FRAC_CONST(0.032231317906644) },
- { FRAC_CONST(0.001570465745428), FRAC_CONST(0.032236629848809) },
- { FRAC_CONST(0.001464963400018), FRAC_CONST(0.032241596562566) },
- { FRAC_CONST(0.001359445366028), FRAC_CONST(0.032246217994727) },
- { FRAC_CONST(0.001253912773470), FRAC_CONST(0.032250494095799) },
- { FRAC_CONST(0.001148366752513), FRAC_CONST(0.032254424819990) },
- { FRAC_CONST(0.001042808433471), FRAC_CONST(0.032258010125204) },
- { FRAC_CONST(0.000937238946789), FRAC_CONST(0.032261249973045) },
- { FRAC_CONST(0.000831659423030), FRAC_CONST(0.032264144328817) },
- { FRAC_CONST(0.000726070992868), FRAC_CONST(0.032266693161525) },
- { FRAC_CONST(0.000620474787068), FRAC_CONST(0.032268896443871) },
- { FRAC_CONST(0.000514871936481), FRAC_CONST(0.032270754152261) },
- { FRAC_CONST(0.000409263572030), FRAC_CONST(0.032272266266801) },
- { FRAC_CONST(0.000303650824695), FRAC_CONST(0.032273432771295) },
- { FRAC_CONST(0.000198034825504), FRAC_CONST(0.032274253653254) },
- { FRAC_CONST(0.000092416705518), FRAC_CONST(0.032274728903884) }
-};
-
-#ifdef LD_DEC
-/* 240 (N/4) complex twiddle factors */
-ALIGN static const complex_t mdct_tab_960[] =
-{
- { FRAC_CONST(0.045643531183573), FRAC_CONST(0.000037342034959) },
- { FRAC_CONST(0.045642309173789), FRAC_CONST(0.000336075315362) },
- { FRAC_CONST(0.045639131999390), FRAC_CONST(0.000634794199417) },
- { FRAC_CONST(0.045633999796474), FRAC_CONST(0.000933485891002) },
- { FRAC_CONST(0.045626912784890), FRAC_CONST(0.001232137595157) },
- { FRAC_CONST(0.045617871268219), FRAC_CONST(0.001530736518639) },
- { FRAC_CONST(0.045606875633772), FRAC_CONST(0.001829269870464) },
- { FRAC_CONST(0.045593926352564), FRAC_CONST(0.002127724862455) },
- { FRAC_CONST(0.045579023979299), FRAC_CONST(0.002426088709795) },
- { FRAC_CONST(0.045562169152346), FRAC_CONST(0.002724348631569) },
- { FRAC_CONST(0.045543362593709), FRAC_CONST(0.003022491851315) },
- { FRAC_CONST(0.045522605108999), FRAC_CONST(0.003320505597570) },
- { FRAC_CONST(0.045499897587396), FRAC_CONST(0.003618377104416) },
- { FRAC_CONST(0.045475241001617), FRAC_CONST(0.003916093612031) },
- { FRAC_CONST(0.045448636407866), FRAC_CONST(0.004213642367228) },
- { FRAC_CONST(0.045420084945797), FRAC_CONST(0.004511010624011) },
- { FRAC_CONST(0.045389587838458), FRAC_CONST(0.004808185644112) },
- { FRAC_CONST(0.045357146392244), FRAC_CONST(0.005105154697544) },
- { FRAC_CONST(0.045322761996840), FRAC_CONST(0.005401905063139) },
- { FRAC_CONST(0.045286436125157), FRAC_CONST(0.005698424029100) },
- { FRAC_CONST(0.045248170333275), FRAC_CONST(0.005994698893542) },
- { FRAC_CONST(0.045207966260374), FRAC_CONST(0.006290716965035) },
- { FRAC_CONST(0.045165825628663), FRAC_CONST(0.006586465563151) },
- { FRAC_CONST(0.045121750243305), FRAC_CONST(0.006881932019003) },
- { FRAC_CONST(0.045075741992343), FRAC_CONST(0.007177103675792) },
- { FRAC_CONST(0.045027802846618), FRAC_CONST(0.007471967889347) },
- { FRAC_CONST(0.044977934859683), FRAC_CONST(0.007766512028667) },
- { FRAC_CONST(0.044926140167717), FRAC_CONST(0.008060723476460) },
- { FRAC_CONST(0.044872420989432), FRAC_CONST(0.008354589629687) },
- { FRAC_CONST(0.044816779625979), FRAC_CONST(0.008648097900101) },
- { FRAC_CONST(0.044759218460849), FRAC_CONST(0.008941235714784) },
- { FRAC_CONST(0.044699739959770), FRAC_CONST(0.009233990516688) },
- { FRAC_CONST(0.044638346670603), FRAC_CONST(0.009526349765171) },
- { FRAC_CONST(0.044575041223233), FRAC_CONST(0.009818300936537) },
- { FRAC_CONST(0.044509826329454), FRAC_CONST(0.010109831524568) },
- { FRAC_CONST(0.044442704782856), FRAC_CONST(0.010400929041064) },
- { FRAC_CONST(0.044373679458701), FRAC_CONST(0.010691581016378) },
- { FRAC_CONST(0.044302753313806), FRAC_CONST(0.010981774999945) },
- { FRAC_CONST(0.044229929386409), FRAC_CONST(0.011271498560822) },
- { FRAC_CONST(0.044155210796046), FRAC_CONST(0.011560739288214) },
- { FRAC_CONST(0.044078600743413), FRAC_CONST(0.011849484792012) },
- { FRAC_CONST(0.044000102510229), FRAC_CONST(0.012137722703321) },
- { FRAC_CONST(0.043919719459097), FRAC_CONST(0.012425440674986) },
- { FRAC_CONST(0.043837455033359), FRAC_CONST(0.012712626382127) },
- { FRAC_CONST(0.043753312756950), FRAC_CONST(0.012999267522665) },
- { FRAC_CONST(0.043667296234245), FRAC_CONST(0.013285351817848) },
- { FRAC_CONST(0.043579409149906), FRAC_CONST(0.013570867012776) },
- { FRAC_CONST(0.043489655268722), FRAC_CONST(0.013855800876928) },
- { FRAC_CONST(0.043398038435451), FRAC_CONST(0.014140141204686) },
- { FRAC_CONST(0.043304562574653), FRAC_CONST(0.014423875815857) },
- { FRAC_CONST(0.043209231690524), FRAC_CONST(0.014706992556195) },
- { FRAC_CONST(0.043112049866720), FRAC_CONST(0.014989479297920) },
- { FRAC_CONST(0.043013021266188), FRAC_CONST(0.015271323940241) },
- { FRAC_CONST(0.042912150130984), FRAC_CONST(0.015552514409871) },
- { FRAC_CONST(0.042809440782090), FRAC_CONST(0.015833038661547) },
- { FRAC_CONST(0.042704897619235), FRAC_CONST(0.016112884678543) },
- { FRAC_CONST(0.042598525120698), FRAC_CONST(0.016392040473187) },
- { FRAC_CONST(0.042490327843124), FRAC_CONST(0.016670494087374) },
- { FRAC_CONST(0.042380310421324), FRAC_CONST(0.016948233593079) },
- { FRAC_CONST(0.042268477568078), FRAC_CONST(0.017225247092864) },
- { FRAC_CONST(0.042154834073934), FRAC_CONST(0.017501522720393) },
- { FRAC_CONST(0.042039384807000), FRAC_CONST(0.017777048640940) },
- { FRAC_CONST(0.041922134712739), FRAC_CONST(0.018051813051888) },
- { FRAC_CONST(0.041803088813754), FRAC_CONST(0.018325804183247) },
- { FRAC_CONST(0.041682252209576), FRAC_CONST(0.018599010298148) },
- { FRAC_CONST(0.041559630076443), FRAC_CONST(0.018871419693350) },
- { FRAC_CONST(0.041435227667079), FRAC_CONST(0.019143020699741) },
- { FRAC_CONST(0.041309050310468), FRAC_CONST(0.019413801682838) },
- { FRAC_CONST(0.041181103411629), FRAC_CONST(0.019683751043285) },
- { FRAC_CONST(0.041051392451382), FRAC_CONST(0.019952857217350) },
- { FRAC_CONST(0.040919922986111), FRAC_CONST(0.020221108677421) },
- { FRAC_CONST(0.040786700647532), FRAC_CONST(0.020488493932496) },
- { FRAC_CONST(0.040651731142446), FRAC_CONST(0.020755001528683) },
- { FRAC_CONST(0.040515020252497), FRAC_CONST(0.021020620049682) },
- { FRAC_CONST(0.040376573833925), FRAC_CONST(0.021285338117280) },
- { FRAC_CONST(0.040236397817314), FRAC_CONST(0.021549144391836) },
- { FRAC_CONST(0.040094498207337), FRAC_CONST(0.021812027572768) },
- { FRAC_CONST(0.039950881082502), FRAC_CONST(0.022073976399034) },
- { FRAC_CONST(0.039805552594888), FRAC_CONST(0.022334979649620) },
- { FRAC_CONST(0.039658518969884), FRAC_CONST(0.022595026144014) },
- { FRAC_CONST(0.039509786505922), FRAC_CONST(0.022854104742690) },
- { FRAC_CONST(0.039359361574204), FRAC_CONST(0.023112204347583) },
- { FRAC_CONST(0.039207250618434), FRAC_CONST(0.023369313902565) },
- { FRAC_CONST(0.039053460154540), FRAC_CONST(0.023625422393919) },
- { FRAC_CONST(0.038897996770393), FRAC_CONST(0.023880518850809) },
- { FRAC_CONST(0.038740867125527), FRAC_CONST(0.024134592345752) },
- { FRAC_CONST(0.038582077950852), FRAC_CONST(0.024387631995085) },
- { FRAC_CONST(0.038421636048370), FRAC_CONST(0.024639626959432) },
- { FRAC_CONST(0.038259548290876), FRAC_CONST(0.024890566444167) },
- { FRAC_CONST(0.038095821621671), FRAC_CONST(0.025140439699877) },
- { FRAC_CONST(0.037930463054261), FRAC_CONST(0.025389236022825) },
- { FRAC_CONST(0.037763479672055), FRAC_CONST(0.025636944755403) },
- { FRAC_CONST(0.037594878628068), FRAC_CONST(0.025883555286595) },
- { FRAC_CONST(0.037424667144605), FRAC_CONST(0.026129057052425) },
- { FRAC_CONST(0.037252852512960), FRAC_CONST(0.026373439536415) },
- { FRAC_CONST(0.037079442093102), FRAC_CONST(0.026616692270033) },
- { FRAC_CONST(0.036904443313354), FRAC_CONST(0.026858804833142) },
- { FRAC_CONST(0.036727863670081), FRAC_CONST(0.027099766854444) },
- { FRAC_CONST(0.036549710727369), FRAC_CONST(0.027339568011930) },
- { FRAC_CONST(0.036369992116697), FRAC_CONST(0.027578198033315) },
- { FRAC_CONST(0.036188715536611), FRAC_CONST(0.027815646696484) },
- { FRAC_CONST(0.036005888752396), FRAC_CONST(0.028051903829926) },
- { FRAC_CONST(0.035821519595745), FRAC_CONST(0.028286959313171) },
- { FRAC_CONST(0.035635615964417), FRAC_CONST(0.028520803077226) },
- { FRAC_CONST(0.035448185821906), FRAC_CONST(0.028753425105002) },
- { FRAC_CONST(0.035259237197095), FRAC_CONST(0.028984815431745) },
- { FRAC_CONST(0.035068778183914), FRAC_CONST(0.029214964145465) },
- { FRAC_CONST(0.034876816940994), FRAC_CONST(0.029443861387355) },
- { FRAC_CONST(0.034683361691315), FRAC_CONST(0.029671497352220) },
- { FRAC_CONST(0.034488420721856), FRAC_CONST(0.029897862288892) },
- { FRAC_CONST(0.034292002383240), FRAC_CONST(0.030122946500652) },
- { FRAC_CONST(0.034094115089375), FRAC_CONST(0.030346740345641) },
- { FRAC_CONST(0.033894767317093), FRAC_CONST(0.030569234237276) },
- { FRAC_CONST(0.033693967605790), FRAC_CONST(0.030790418644658) },
- { FRAC_CONST(0.033491724557057), FRAC_CONST(0.031010284092984) },
- { FRAC_CONST(0.033288046834313), FRAC_CONST(0.031228821163949) },
- { FRAC_CONST(0.033082943162434), FRAC_CONST(0.031446020496153) },
- { FRAC_CONST(0.032876422327378), FRAC_CONST(0.031661872785500) },
- { FRAC_CONST(0.032668493175811), FRAC_CONST(0.031876368785596) },
- { FRAC_CONST(0.032459164614726), FRAC_CONST(0.032089499308145) },
- { FRAC_CONST(0.032248445611061), FRAC_CONST(0.032301255223347) },
- { FRAC_CONST(0.032036345191317), FRAC_CONST(0.032511627460281) },
- { FRAC_CONST(0.031822872441171), FRAC_CONST(0.032720607007302) },
- { FRAC_CONST(0.031608036505083), FRAC_CONST(0.032928184912422) },
- { FRAC_CONST(0.031391846585912), FRAC_CONST(0.033134352283693) },
- { FRAC_CONST(0.031174311944513), FRAC_CONST(0.033339100289593) },
- { FRAC_CONST(0.030955441899347), FRAC_CONST(0.033542420159397) },
- { FRAC_CONST(0.030735245826077), FRAC_CONST(0.033744303183559) },
- { FRAC_CONST(0.030513733157171), FRAC_CONST(0.033944740714083) },
- { FRAC_CONST(0.030290913381494), FRAC_CONST(0.034143724164891) },
- { FRAC_CONST(0.030066796043904), FRAC_CONST(0.034341245012195) },
- { FRAC_CONST(0.029841390744841), FRAC_CONST(0.034537294794860) },
- { FRAC_CONST(0.029614707139919), FRAC_CONST(0.034731865114764) },
- { FRAC_CONST(0.029386754939508), FRAC_CONST(0.034924947637164) },
- { FRAC_CONST(0.029157543908322), FRAC_CONST(0.035116534091046) },
- { FRAC_CONST(0.028927083864999), FRAC_CONST(0.035306616269485) },
- { FRAC_CONST(0.028695384681680), FRAC_CONST(0.035495186029992) },
- { FRAC_CONST(0.028462456283587), FRAC_CONST(0.035682235294866) },
- { FRAC_CONST(0.028228308648598), FRAC_CONST(0.035867756051541) },
- { FRAC_CONST(0.027992951806817), FRAC_CONST(0.036051740352923) },
- { FRAC_CONST(0.027756395840148), FRAC_CONST(0.036234180317738) },
- { FRAC_CONST(0.027518650881862), FRAC_CONST(0.036415068130865) },
- { FRAC_CONST(0.027279727116161), FRAC_CONST(0.036594396043672) },
- { FRAC_CONST(0.027039634777745), FRAC_CONST(0.036772156374348) },
- { FRAC_CONST(0.026798384151369), FRAC_CONST(0.036948341508233) },
- { FRAC_CONST(0.026555985571409), FRAC_CONST(0.037122943898140) },
- { FRAC_CONST(0.026312449421412), FRAC_CONST(0.037295956064686) },
- { FRAC_CONST(0.026067786133656), FRAC_CONST(0.037467370596605) },
- { FRAC_CONST(0.025822006188702), FRAC_CONST(0.037637180151068) },
- { FRAC_CONST(0.025575120114946), FRAC_CONST(0.037805377454000) },
- { FRAC_CONST(0.025327138488165), FRAC_CONST(0.037971955300388) },
- { FRAC_CONST(0.025078071931066), FRAC_CONST(0.038136906554591) },
- { FRAC_CONST(0.024827931112832), FRAC_CONST(0.038300224150647) },
- { FRAC_CONST(0.024576726748663), FRAC_CONST(0.038461901092573) },
- { FRAC_CONST(0.024324469599317), FRAC_CONST(0.038621930454668) },
- { FRAC_CONST(0.024071170470652), FRAC_CONST(0.038780305381806) },
- { FRAC_CONST(0.023816840213160), FRAC_CONST(0.038937019089732) },
- { FRAC_CONST(0.023561489721501), FRAC_CONST(0.039092064865353) },
- { FRAC_CONST(0.023305129934041), FRAC_CONST(0.039245436067023) },
- { FRAC_CONST(0.023047771832380), FRAC_CONST(0.039397126124832) },
- { FRAC_CONST(0.022789426440883), FRAC_CONST(0.039547128540881) },
- { FRAC_CONST(0.022530104826206), FRAC_CONST(0.039695436889566) },
- { FRAC_CONST(0.022269818096825), FRAC_CONST(0.039842044817851) },
- { FRAC_CONST(0.022008577402555), FRAC_CONST(0.039986946045542) },
- { FRAC_CONST(0.021746393934081), FRAC_CONST(0.040130134365550) },
- { FRAC_CONST(0.021483278922467), FRAC_CONST(0.040271603644166) },
- { FRAC_CONST(0.021219243638687), FRAC_CONST(0.040411347821316) },
- { FRAC_CONST(0.020954299393132), FRAC_CONST(0.040549360910825) },
- { FRAC_CONST(0.020688457535133), FRAC_CONST(0.040685637000671) },
- { FRAC_CONST(0.020421729452469), FRAC_CONST(0.040820170253240) },
- { FRAC_CONST(0.020154126570884), FRAC_CONST(0.040952954905576) },
- { FRAC_CONST(0.019885660353596), FRAC_CONST(0.041083985269625) },
- { FRAC_CONST(0.019616342300802), FRAC_CONST(0.041213255732484) },
- { FRAC_CONST(0.019346183949192), FRAC_CONST(0.041340760756635) },
- { FRAC_CONST(0.019075196871451), FRAC_CONST(0.041466494880189) },
- { FRAC_CONST(0.018803392675763), FRAC_CONST(0.041590452717113) },
- { FRAC_CONST(0.018530783005316), FRAC_CONST(0.041712628957466) },
- { FRAC_CONST(0.018257379537800), FRAC_CONST(0.041833018367625) },
- { FRAC_CONST(0.017983193984910), FRAC_CONST(0.041951615790509) },
- { FRAC_CONST(0.017708238091842), FRAC_CONST(0.042068416145797) },
- { FRAC_CONST(0.017432523636792), FRAC_CONST(0.042183414430153) },
- { FRAC_CONST(0.017156062430449), FRAC_CONST(0.042296605717432) },
- { FRAC_CONST(0.016878866315491), FRAC_CONST(0.042407985158896) },
- { FRAC_CONST(0.016600947166078), FRAC_CONST(0.042517547983420) },
- { FRAC_CONST(0.016322316887341), FRAC_CONST(0.042625289497698) },
- { FRAC_CONST(0.016042987414872), FRAC_CONST(0.042731205086442) },
- { FRAC_CONST(0.015762970714219), FRAC_CONST(0.042835290212581) },
- { FRAC_CONST(0.015482278780363), FRAC_CONST(0.042937540417454) },
- { FRAC_CONST(0.015200923637213), FRAC_CONST(0.043037951321002) },
- { FRAC_CONST(0.014918917337087), FRAC_CONST(0.043136518621958) },
- { FRAC_CONST(0.014636271960196), FRAC_CONST(0.043233238098025) },
- { FRAC_CONST(0.014352999614128), FRAC_CONST(0.043328105606063) },
- { FRAC_CONST(0.014069112433327), FRAC_CONST(0.043421117082265) },
- { FRAC_CONST(0.013784622578575), FRAC_CONST(0.043512268542327) },
- { FRAC_CONST(0.013499542236471), FRAC_CONST(0.043601556081625) },
- { FRAC_CONST(0.013213883618907), FRAC_CONST(0.043688975875378) },
- { FRAC_CONST(0.012927658962548), FRAC_CONST(0.043774524178812) },
- { FRAC_CONST(0.012640880528305), FRAC_CONST(0.043858197327323) },
- { FRAC_CONST(0.012353560600813), FRAC_CONST(0.043939991736633) },
- { FRAC_CONST(0.012065711487901), FRAC_CONST(0.044019903902940) },
- { FRAC_CONST(0.011777345520066), FRAC_CONST(0.044097930403073) },
- { FRAC_CONST(0.011488475049948), FRAC_CONST(0.044174067894638) },
- { FRAC_CONST(0.011199112451794), FRAC_CONST(0.044248313116156) },
- { FRAC_CONST(0.010909270120937), FRAC_CONST(0.044320662887211) },
- { FRAC_CONST(0.010618960473257), FRAC_CONST(0.044391114108577) },
- { FRAC_CONST(0.010328195944653), FRAC_CONST(0.044459663762361) },
- { FRAC_CONST(0.010036988990509), FRAC_CONST(0.044526308912122) },
- { FRAC_CONST(0.009745352085163), FRAC_CONST(0.044591046703005) },
- { FRAC_CONST(0.009453297721368), FRAC_CONST(0.044653874361857) },
- { FRAC_CONST(0.009160838409762), FRAC_CONST(0.044714789197351) },
- { FRAC_CONST(0.008867986678328), FRAC_CONST(0.044773788600099) },
- { FRAC_CONST(0.008574755071860), FRAC_CONST(0.044830870042761) },
- { FRAC_CONST(0.008281156151424), FRAC_CONST(0.044886031080160) },
- { FRAC_CONST(0.007987202493820), FRAC_CONST(0.044939269349379) },
- { FRAC_CONST(0.007692906691044), FRAC_CONST(0.044990582569869) },
- { FRAC_CONST(0.007398281349750), FRAC_CONST(0.045039968543542) },
- { FRAC_CONST(0.007103339090706), FRAC_CONST(0.045087425154868) },
- { FRAC_CONST(0.006808092548258), FRAC_CONST(0.045132950370962) },
- { FRAC_CONST(0.006512554369783), FRAC_CONST(0.045176542241676) },
- { FRAC_CONST(0.006216737215155), FRAC_CONST(0.045218198899680) },
- { FRAC_CONST(0.005920653756196), FRAC_CONST(0.045257918560541) },
- { FRAC_CONST(0.005624316676135), FRAC_CONST(0.045295699522801) },
- { FRAC_CONST(0.005327738669067), FRAC_CONST(0.045331540168049) },
- { FRAC_CONST(0.005030932439406), FRAC_CONST(0.045365438960992) },
- { FRAC_CONST(0.004733910701344), FRAC_CONST(0.045397394449517) },
- { FRAC_CONST(0.004436686178303), FRAC_CONST(0.045427405264758) },
- { FRAC_CONST(0.004139271602393), FRAC_CONST(0.045455470121152) },
- { FRAC_CONST(0.003841679713863), FRAC_CONST(0.045481587816494) },
- { FRAC_CONST(0.003543923260561), FRAC_CONST(0.045505757231988) },
- { FRAC_CONST(0.003246014997382), FRAC_CONST(0.045527977332297) },
- { FRAC_CONST(0.002947967685724), FRAC_CONST(0.045548247165585) },
- { FRAC_CONST(0.002649794092941), FRAC_CONST(0.045566565863562) },
- { FRAC_CONST(0.002351506991799), FRAC_CONST(0.045582932641515) },
- { FRAC_CONST(0.002053119159924), FRAC_CONST(0.045597346798344) },
- { FRAC_CONST(0.001754643379257), FRAC_CONST(0.045609807716597) },
- { FRAC_CONST(0.001456092435508), FRAC_CONST(0.045620314862489) },
- { FRAC_CONST(0.001157479117605), FRAC_CONST(0.045628867785927) },
- { FRAC_CONST(0.000858816217149), FRAC_CONST(0.045635466120535) },
- { FRAC_CONST(0.000560116527865), FRAC_CONST(0.045640109583661) },
- { FRAC_CONST(0.000261392845053), FRAC_CONST(0.045642797976394) }
-};
-#endif // LD_DEC
-
-/* 60 (N/4) complex twiddle factors */
-ALIGN static const complex_t mdct_tab_240[] =
-{
- { FRAC_CONST(0.091286604111815), FRAC_CONST(0.000298735779793) },
- { FRAC_CONST(0.091247502481454), FRAC_CONST(0.002688238127538) },
- { FRAC_CONST(0.091145864370807), FRAC_CONST(0.005075898091152) },
- { FRAC_CONST(0.090981759437558), FRAC_CONST(0.007460079287760) },
- { FRAC_CONST(0.090755300151030), FRAC_CONST(0.009839147718664) },
- { FRAC_CONST(0.090466641715108), FRAC_CONST(0.012211472889198) },
- { FRAC_CONST(0.090115981961863), FRAC_CONST(0.014575428926191) },
- { FRAC_CONST(0.089703561215976), FRAC_CONST(0.016929395692256) },
- { FRAC_CONST(0.089229662130024), FRAC_CONST(0.019271759896156) },
- { FRAC_CONST(0.088694609490769), FRAC_CONST(0.021600916198470) },
- { FRAC_CONST(0.088098769996564), FRAC_CONST(0.023915268311810) },
- { FRAC_CONST(0.087442552006035), FRAC_CONST(0.026213230094844) },
- { FRAC_CONST(0.086726405258214), FRAC_CONST(0.028493226639351) },
- { FRAC_CONST(0.085950820564309), FRAC_CONST(0.030753695349588) },
- { FRAC_CONST(0.085116329471329), FRAC_CONST(0.032993087013213) },
- { FRAC_CONST(0.084223503897785), FRAC_CONST(0.035209866863042) },
- { FRAC_CONST(0.083272955741727), FRAC_CONST(0.037402515628894) },
- { FRAC_CONST(0.082265336461381), FRAC_CONST(0.039569530578832) },
- { FRAC_CONST(0.081201336628670), FRAC_CONST(0.041709426549053) },
- { FRAC_CONST(0.080081685455930), FRAC_CONST(0.043820736961749) },
- { FRAC_CONST(0.078907150296148), FRAC_CONST(0.045902014830227) },
- { FRAC_CONST(0.077678536117054), FRAC_CONST(0.047951833750597) },
- { FRAC_CONST(0.076396684949434), FRAC_CONST(0.049968788879362) },
- { FRAC_CONST(0.075062475310050), FRAC_CONST(0.051951497896226) },
- { FRAC_CONST(0.073676821599542), FRAC_CONST(0.053898601951466) },
- { FRAC_CONST(0.072240673475749), FRAC_CONST(0.055808766597225) },
- { FRAC_CONST(0.070755015202858), FRAC_CONST(0.057680682702068) },
- { FRAC_CONST(0.069220864976840), FRAC_CONST(0.059513067348201) },
- { FRAC_CONST(0.067639274227625), FRAC_CONST(0.061304664710718) },
- { FRAC_CONST(0.066011326898512), FRAC_CONST(0.063054246918278) },
- { FRAC_CONST(0.064338138703282), FRAC_CONST(0.064760614894630) },
- { FRAC_CONST(0.062620856361546), FRAC_CONST(0.066422599180399) },
- { FRAC_CONST(0.060860656812842), FRAC_CONST(0.068039060734572) },
- { FRAC_CONST(0.059058746410016), FRAC_CONST(0.069608891715145) },
- { FRAC_CONST(0.057216360092450), FRAC_CONST(0.071131016238378) },
- { FRAC_CONST(0.055334760539699), FRAC_CONST(0.072604391116154) },
- { FRAC_CONST(0.053415237306106), FRAC_CONST(0.074028006570930) },
- { FRAC_CONST(0.051459105937014), FRAC_CONST(0.075400886927784) },
- { FRAC_CONST(0.049467707067153), FRAC_CONST(0.076722091283096) },
- { FRAC_CONST(0.047442405501835), FRAC_CONST(0.077990714149396) },
- { FRAC_CONST(0.045384589281588), FRAC_CONST(0.079205886075941) },
- { FRAC_CONST(0.043295668730857), FRAC_CONST(0.080366774244592) },
- { FRAC_CONST(0.041177075491445), FRAC_CONST(0.081472583040586) },
- { FRAC_CONST(0.039030261541332), FRAC_CONST(0.082522554597810) },
- { FRAC_CONST(0.036856698199564), FRAC_CONST(0.083515969318206) },
- { FRAC_CONST(0.034657875117883), FRAC_CONST(0.084452146364948) },
- { FRAC_CONST(0.032435299259796), FRAC_CONST(0.085330444129049) },
- { FRAC_CONST(0.030190493867775), FRAC_CONST(0.086150260669096) },
- { FRAC_CONST(0.027924997419306), FRAC_CONST(0.086911034123781) },
- { FRAC_CONST(0.025640362572491), FRAC_CONST(0.087612243096981) },
- { FRAC_CONST(0.023338155101933), FRAC_CONST(0.088253407015092) },
- { FRAC_CONST(0.021019952825636), FRAC_CONST(0.088834086456390) },
- { FRAC_CONST(0.018687344523641), FRAC_CONST(0.089353883452193) },
- { FRAC_CONST(0.016341928849164), FRAC_CONST(0.089812441759604) },
- { FRAC_CONST(0.013985313232951), FRAC_CONST(0.090209447105664) },
- { FRAC_CONST(0.011619112781631), FRAC_CONST(0.090544627402740) },
- { FRAC_CONST(0.009244949170797), FRAC_CONST(0.090817752935000) },
- { FRAC_CONST(0.006864449533597), FRAC_CONST(0.091028636515846) },
- { FRAC_CONST(0.004479245345574), FRAC_CONST(0.091177133616206) },
- { FRAC_CONST(0.002090971306534), FRAC_CONST(0.091263142463585) }
-};
-#endif // ALLOW_SMALL_FRAMELENGTH
-
-#ifdef SSR_DEC
-/* 128 (N/4) complex twiddle factors */
-ALIGN static const complex_t mdct_tab_512[] =
-{
- { FRAC_CONST(0.062499926465731), FRAC_CONST(0.000095873761643) },
- { FRAC_CONST(0.062494043817678), FRAC_CONST(0.000862836783004) },
- { FRAC_CONST(0.062478749796497), FRAC_CONST(0.001629669864319) },
- { FRAC_CONST(0.062454046705412), FRAC_CONST(0.002396257523347) },
- { FRAC_CONST(0.062419938264617), FRAC_CONST(0.003162484314806) },
- { FRAC_CONST(0.062376429610718), FRAC_CONST(0.003928234847760) },
- { FRAC_CONST(0.062323527295958), FRAC_CONST(0.004693393802995) },
- { FRAC_CONST(0.062261239287231), FRAC_CONST(0.005457845950387) },
- { FRAC_CONST(0.062189574964882), FRAC_CONST(0.006221476166254) },
- { FRAC_CONST(0.062108545121295), FRAC_CONST(0.006984169450695) },
- { FRAC_CONST(0.062018161959266), FRAC_CONST(0.007745810944907) },
- { FRAC_CONST(0.061918439090167), FRAC_CONST(0.008506285948482) },
- { FRAC_CONST(0.061809391531894), FRAC_CONST(0.009265479936681) },
- { FRAC_CONST(0.061691035706609), FRAC_CONST(0.010023278577683) },
- { FRAC_CONST(0.061563389438265), FRAC_CONST(0.010779567749800) },
- { FRAC_CONST(0.061426471949919), FRAC_CONST(0.011534233558664) },
- { FRAC_CONST(0.061280303860842), FRAC_CONST(0.012287162354380) },
- { FRAC_CONST(0.061124907183410), FRAC_CONST(0.013038240748641) },
- { FRAC_CONST(0.060960305319791), FRAC_CONST(0.013787355631805) },
- { FRAC_CONST(0.060786523058421), FRAC_CONST(0.014534394189923) },
- { FRAC_CONST(0.060603586570268), FRAC_CONST(0.015279243921739) },
- { FRAC_CONST(0.060411523404896), FRAC_CONST(0.016021792655621) },
- { FRAC_CONST(0.060210362486310), FRAC_CONST(0.016761928566463) },
- { FRAC_CONST(0.060000134108604), FRAC_CONST(0.017499540192517) },
- { FRAC_CONST(0.059780869931400), FRAC_CONST(0.018234516452187) },
- { FRAC_CONST(0.059552602975075), FRAC_CONST(0.018966746660751) },
- { FRAC_CONST(0.059315367615794), FRAC_CONST(0.019696120547033) },
- { FRAC_CONST(0.059069199580329), FRAC_CONST(0.020422528270008) },
- { FRAC_CONST(0.058814135940681), FRAC_CONST(0.021145860435346) },
- { FRAC_CONST(0.058550215108495), FRAC_CONST(0.021866008111883) },
- { FRAC_CONST(0.058277476829279), FRAC_CONST(0.022582862848028) },
- { FRAC_CONST(0.057995962176414), FRAC_CONST(0.023296316688095) },
- { FRAC_CONST(0.057705713544970), FRAC_CONST(0.024006262188558) },
- { FRAC_CONST(0.057406774645326), FRAC_CONST(0.024712592434239) },
- { FRAC_CONST(0.057099190496578), FRAC_CONST(0.025415201054398) },
- { FRAC_CONST(0.056783007419769), FRAC_CONST(0.026113982238763) },
- { FRAC_CONST(0.056458273030907), FRAC_CONST(0.026808830753458) },
- { FRAC_CONST(0.056125036233796), FRAC_CONST(0.027499641956852) },
- { FRAC_CONST(0.055783347212673), FRAC_CONST(0.028186311815319) },
- { FRAC_CONST(0.055433257424646), FRAC_CONST(0.028868736918904) },
- { FRAC_CONST(0.055074819591951), FRAC_CONST(0.029546814496896) },
- { FRAC_CONST(0.054708087694007), FRAC_CONST(0.030220442433307) },
- { FRAC_CONST(0.054333116959288), FRAC_CONST(0.030889519282247) },
- { FRAC_CONST(0.053949963857008), FRAC_CONST(0.031553944283204) },
- { FRAC_CONST(0.053558686088614), FRAC_CONST(0.032213617376216) },
- { FRAC_CONST(0.053159342579100), FRAC_CONST(0.032868439216943) },
- { FRAC_CONST(0.052751993468129), FRAC_CONST(0.033518311191623) },
- { FRAC_CONST(0.052336700100979), FRAC_CONST(0.034163135431927) },
- { FRAC_CONST(0.051913525019303), FRAC_CONST(0.034802814829698) },
- { FRAC_CONST(0.051482531951712), FRAC_CONST(0.035437253051569) },
- { FRAC_CONST(0.051043785804177), FRAC_CONST(0.036066354553480) },
- { FRAC_CONST(0.050597352650253), FRAC_CONST(0.036690024595057) },
- { FRAC_CONST(0.050143299721132), FRAC_CONST(0.037308169253887) },
- { FRAC_CONST(0.049681695395515), FRAC_CONST(0.037920695439658) },
- { FRAC_CONST(0.049212609189314), FRAC_CONST(0.038527510908178) },
- { FRAC_CONST(0.048736111745188), FRAC_CONST(0.039128524275271) },
- { FRAC_CONST(0.048252274821899), FRAC_CONST(0.039723645030535) },
- { FRAC_CONST(0.047761171283507), FRAC_CONST(0.040312783550971) },
- { FRAC_CONST(0.047262875088400), FRAC_CONST(0.040895851114488) },
- { FRAC_CONST(0.046757461278150), FRAC_CONST(0.041472759913252) },
- { FRAC_CONST(0.046245005966220), FRAC_CONST(0.042043423066923) },
- { FRAC_CONST(0.045725586326493), FRAC_CONST(0.042607754635728) },
- { FRAC_CONST(0.045199280581658), FRAC_CONST(0.043165669633408) },
- { FRAC_CONST(0.044666167991423), FRAC_CONST(0.043717084040018) },
- { FRAC_CONST(0.044126328840584), FRAC_CONST(0.044261914814575) },
- { FRAC_CONST(0.043579844426930), FRAC_CONST(0.044800079907569) },
- { FRAC_CONST(0.043026797049006), FRAC_CONST(0.045331498273316) },
- { FRAC_CONST(0.042467269993710), FRAC_CONST(0.045856089882166) },
- { FRAC_CONST(0.041901347523761), FRAC_CONST(0.046373775732552) },
- { FRAC_CONST(0.041329114865000), FRAC_CONST(0.046884477862888) },
- { FRAC_CONST(0.040750658193560), FRAC_CONST(0.047388119363313) },
- { FRAC_CONST(0.040166064622889), FRAC_CONST(0.047884624387270) },
- { FRAC_CONST(0.039575422190629), FRAC_CONST(0.048373918162926) },
- { FRAC_CONST(0.038978819845356), FRAC_CONST(0.048855927004441) },
- { FRAC_CONST(0.038376347433190), FRAC_CONST(0.049330578323055) },
- { FRAC_CONST(0.037768095684260), FRAC_CONST(0.049797800638026) },
- { FRAC_CONST(0.037154156199042), FRAC_CONST(0.050257523587392) },
- { FRAC_CONST(0.036534621434563), FRAC_CONST(0.050709677938566) },
- { FRAC_CONST(0.035909584690482), FRAC_CONST(0.051154195598769) },
- { FRAC_CONST(0.035279140095032), FRAC_CONST(0.051591009625274) },
- { FRAC_CONST(0.034643382590851), FRAC_CONST(0.052020054235496) },
- { FRAC_CONST(0.034002407920680), FRAC_CONST(0.052441264816895) },
- { FRAC_CONST(0.033356312612947), FRAC_CONST(0.052854577936706) },
- { FRAC_CONST(0.032705193967229), FRAC_CONST(0.053259931351495) },
- { FRAC_CONST(0.032049150039598), FRAC_CONST(0.053657264016528) },
- { FRAC_CONST(0.031388279627857), FRAC_CONST(0.054046516094966) },
- { FRAC_CONST(0.030722682256659), FRAC_CONST(0.054427628966880) },
- { FRAC_CONST(0.030052458162521), FRAC_CONST(0.054800545238072) },
- { FRAC_CONST(0.029377708278725), FRAC_CONST(0.055165208748723) },
- { FRAC_CONST(0.028698534220122), FRAC_CONST(0.055521564581850) },
- { FRAC_CONST(0.028015038267826), FRAC_CONST(0.055869559071575) },
- { FRAC_CONST(0.027327323353815), FRAC_CONST(0.056209139811209) },
- { FRAC_CONST(0.026635493045425), FRAC_CONST(0.056540255661140) },
- { FRAC_CONST(0.025939651529755), FRAC_CONST(0.056862856756541) },
- { FRAC_CONST(0.025239903597978), FRAC_CONST(0.057176894514872) },
- { FRAC_CONST(0.024536354629559), FRAC_CONST(0.057482321643202) },
- { FRAC_CONST(0.023829110576385), FRAC_CONST(0.057779092145329) },
- { FRAC_CONST(0.023118277946808), FRAC_CONST(0.058067161328707) },
- { FRAC_CONST(0.022403963789609), FRAC_CONST(0.058346485811177) },
- { FRAC_CONST(0.021686275677870), FRAC_CONST(0.058617023527499) },
- { FRAC_CONST(0.020965321692783), FRAC_CONST(0.058878733735689) },
- { FRAC_CONST(0.020241210407366), FRAC_CONST(0.059131577023150) },
- { FRAC_CONST(0.019514050870114), FRAC_CONST(0.059375515312615) },
- { FRAC_CONST(0.018783952588580), FRAC_CONST(0.059610511867874) },
- { FRAC_CONST(0.018051025512878), FRAC_CONST(0.059836531299311) },
- { FRAC_CONST(0.017315380019131), FRAC_CONST(0.060053539569230) },
- { FRAC_CONST(0.016577126892844), FRAC_CONST(0.060261503996984) },
- { FRAC_CONST(0.015836377312223), FRAC_CONST(0.060460393263896) },
- { FRAC_CONST(0.015093242831429), FRAC_CONST(0.060650177417972) },
- { FRAC_CONST(0.014347835363782), FRAC_CONST(0.060830827878419) },
- { FRAC_CONST(0.013600267164905), FRAC_CONST(0.061002317439940) },
- { FRAC_CONST(0.012850650815819), FRAC_CONST(0.061164620276839) },
- { FRAC_CONST(0.012099099205988), FRAC_CONST(0.061317711946905) },
- { FRAC_CONST(0.011345725516320), FRAC_CONST(0.061461569395097) },
- { FRAC_CONST(0.010590643202123), FRAC_CONST(0.061596170957011) },
- { FRAC_CONST(0.009833965976015), FRAC_CONST(0.061721496362147) },
- { FRAC_CONST(0.009075807790803), FRAC_CONST(0.061837526736961) },
- { FRAC_CONST(0.008316282822321), FRAC_CONST(0.061944244607705) },
- { FRAC_CONST(0.007555505452236), FRAC_CONST(0.062041633903059) },
- { FRAC_CONST(0.006793590250821), FRAC_CONST(0.062129679956555) },
- { FRAC_CONST(0.006030651959703), FRAC_CONST(0.062208369508780) },
- { FRAC_CONST(0.005266805474583), FRAC_CONST(0.062277690709378) },
- { FRAC_CONST(0.004502165827931), FRAC_CONST(0.062337633118830) },
- { FRAC_CONST(0.003736848171665), FRAC_CONST(0.062388187710030) },
- { FRAC_CONST(0.002970967759810), FRAC_CONST(0.062429346869643) },
- { FRAC_CONST(0.002204639931138), FRAC_CONST(0.062461104399250) },
- { FRAC_CONST(0.001437980091802), FRAC_CONST(0.062483455516285) },
- { FRAC_CONST(0.000671103697954), FRAC_CONST(0.062496396854751) }
-};
-
-/* 16 (N/4) complex twiddle factors */
-ALIGN static const complex_t mdct_tab_64[] =
-{
- { FRAC_CONST(0.176763384336599), FRAC_CONST(0.002169321984356) },
- { FRAC_CONST(0.175699589589310), FRAC_CONST(0.019484717553714) },
- { FRAC_CONST(0.172943711747111), FRAC_CONST(0.036612464641599) },
- { FRAC_CONST(0.168522291420137), FRAC_CONST(0.053387613680577) },
- { FRAC_CONST(0.162477909303132), FRAC_CONST(0.069648610815172) },
- { FRAC_CONST(0.154868776100077), FRAC_CONST(0.085238853753814) },
- { FRAC_CONST(0.145768171923295), FRAC_CONST(0.100008199934509) },
- { FRAC_CONST(0.135263740565902), FRAC_CONST(0.113814412479792) },
- { FRAC_CONST(0.123456645444178), FRAC_CONST(0.126524530015608) },
- { FRAC_CONST(0.110460595338559), FRAC_CONST(0.138016147162030) },
- { FRAC_CONST(0.096400749315926), FRAC_CONST(0.148178593363981) },
- { FRAC_CONST(0.081412511379371), FRAC_CONST(0.156913998709178) },
- { FRAC_CONST(0.065640226453626), FRAC_CONST(0.164138236468888) },
- { FRAC_CONST(0.049235790264535), FRAC_CONST(0.169781733284316) },
- { FRAC_CONST(0.032357186500177), FRAC_CONST(0.173790139196080) },
- { FRAC_CONST(0.015166965341583), FRAC_CONST(0.176124851064031) }
-};
-#endif // SSR_DEC
-
-#endif // FIXED_POINT
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/libfaad/mp4.c b/src/libfaad/mp4.c
deleted file mode 100644
index 651280805..000000000
--- a/src/libfaad/mp4.c
+++ /dev/null
@@ -1,299 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: mp4.c,v 1.9 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#include "common.h"
-#include "structs.h"
-
-#include <stdlib.h>
-
-#include "bits.h"
-#include "mp4.h"
-#include "syntax.h"
-
-/* defines if an object type can be decoded by this library or not */
-static uint8_t ObjectTypesTable[32] = {
- 0, /* 0 NULL */
-#ifdef MAIN_DEC
- 1, /* 1 AAC Main */
-#else
- 0, /* 1 AAC Main */
-#endif
- 1, /* 2 AAC LC */
-#ifdef SSR_DEC
- 1, /* 3 AAC SSR */
-#else
- 0, /* 3 AAC SSR */
-#endif
-#ifdef LTP_DEC
- 1, /* 4 AAC LTP */
-#else
- 0, /* 4 AAC LTP */
-#endif
-#ifdef SBR_DEC
- 1, /* 5 SBR */
-#else
- 0, /* 5 SBR */
-#endif
-#ifdef SCALABLE_DEC
- 1, /* 6 AAC Scalable */
-#else
- 0, /* 6 AAC Scalable */
-#endif
- 0, /* 7 TwinVQ */
- 0, /* 8 CELP */
- 0, /* 9 HVXC */
- 0, /* 10 Reserved */
- 0, /* 11 Reserved */
- 0, /* 12 TTSI */
- 0, /* 13 Main synthetic */
- 0, /* 14 Wavetable synthesis */
- 0, /* 15 General MIDI */
- 0, /* 16 Algorithmic Synthesis and Audio FX */
-
- /* MPEG-4 Version 2 */
-#ifdef ERROR_RESILIENCE
- 1, /* 17 ER AAC LC */
- 0, /* 18 (Reserved) */
-#ifdef LTP_DEC
- 1, /* 19 ER AAC LTP */
-#else
- 0, /* 19 ER AAC LTP */
-#endif
-#ifdef SCALABLE_DEC
- 1, /* 20 ER AAC scalable */
-#else
- 0, /* 20 ER AAC scalable */
-#endif
- 0, /* 21 ER TwinVQ */
- 0, /* 22 ER BSAC */
-#ifdef LD_DEC
- 1, /* 23 ER AAC LD */
-#else
- 0, /* 23 ER AAC LD */
-#endif
- 0, /* 24 ER CELP */
- 0, /* 25 ER HVXC */
- 0, /* 26 ER HILN */
- 0, /* 27 ER Parametric */
-#else /* No ER defined */
- 0, /* 17 ER AAC LC */
- 0, /* 18 (Reserved) */
- 0, /* 19 ER AAC LTP */
- 0, /* 20 ER AAC scalable */
- 0, /* 21 ER TwinVQ */
- 0, /* 22 ER BSAC */
- 0, /* 23 ER AAC LD */
- 0, /* 24 ER CELP */
- 0, /* 25 ER HVXC */
- 0, /* 26 ER HILN */
- 0, /* 27 ER Parametric */
-#endif
- 0, /* 28 (Reserved) */
- 0, /* 29 (Reserved) */
- 0, /* 30 (Reserved) */
- 0 /* 31 (Reserved) */
-};
-
-/* Table 1.6.1 */
-int8_t NEAACDECAPI NeAACDecAudioSpecificConfig(uint8_t *pBuffer,
- uint32_t buffer_size,
- mp4AudioSpecificConfig *mp4ASC)
-{
- return AudioSpecificConfig2(pBuffer, buffer_size, mp4ASC, NULL);
-}
-
-int8_t AudioSpecificConfig2(uint8_t *pBuffer,
- uint32_t buffer_size,
- mp4AudioSpecificConfig *mp4ASC,
- program_config *pce)
-{
- bitfile ld;
- int8_t result = 0;
-#ifdef SBR_DEC
- int8_t bits_to_decode = 0;
-#endif
-
- if (pBuffer == NULL)
- return -7;
- if (mp4ASC == NULL)
- return -8;
-
- memset(mp4ASC, 0, sizeof(mp4AudioSpecificConfig));
-
- faad_initbits(&ld, pBuffer, buffer_size);
- faad_byte_align(&ld);
-
- mp4ASC->objectTypeIndex = (uint8_t)faad_getbits(&ld, 5
- DEBUGVAR(1,1,"parse_audio_decoder_specific_info(): ObjectTypeIndex"));
-
- mp4ASC->samplingFrequencyIndex = (uint8_t)faad_getbits(&ld, 4
- DEBUGVAR(1,2,"parse_audio_decoder_specific_info(): SamplingFrequencyIndex"));
-
- mp4ASC->channelsConfiguration = (uint8_t)faad_getbits(&ld, 4
- DEBUGVAR(1,3,"parse_audio_decoder_specific_info(): ChannelsConfiguration"));
-
- mp4ASC->samplingFrequency = get_sample_rate(mp4ASC->samplingFrequencyIndex);
-
- if (ObjectTypesTable[mp4ASC->objectTypeIndex] != 1)
- {
- faad_endbits(&ld);
- return -1;
- }
-
- if (mp4ASC->samplingFrequency == 0)
- {
- faad_endbits(&ld);
- return -2;
- }
-
- if (mp4ASC->channelsConfiguration > 7)
- {
- faad_endbits(&ld);
- return -3;
- }
-
-#if (defined(PS_DEC) || defined(DRM_PS))
- /* check if we have a mono file */
- if (mp4ASC->channelsConfiguration == 1)
- {
- /* upMatrix to 2 channels for implicit signalling of PS */
- mp4ASC->channelsConfiguration = 2;
- }
-#endif
-
-#ifdef SBR_DEC
- mp4ASC->sbr_present_flag = -1;
- if (mp4ASC->objectTypeIndex == 5)
- {
- uint8_t tmp;
-
- mp4ASC->sbr_present_flag = 1;
- tmp = (uint8_t)faad_getbits(&ld, 4
- DEBUGVAR(1,5,"parse_audio_decoder_specific_info(): extensionSamplingFrequencyIndex"));
- /* check for downsampled SBR */
- if (tmp == mp4ASC->samplingFrequencyIndex)
- mp4ASC->downSampledSBR = 1;
- mp4ASC->samplingFrequencyIndex = tmp;
- if (mp4ASC->samplingFrequencyIndex == 15)
- {
- mp4ASC->samplingFrequency = (uint32_t)faad_getbits(&ld, 24
- DEBUGVAR(1,6,"parse_audio_decoder_specific_info(): extensionSamplingFrequencyIndex"));
- } else {
- mp4ASC->samplingFrequency = get_sample_rate(mp4ASC->samplingFrequencyIndex);
- }
- mp4ASC->objectTypeIndex = (uint8_t)faad_getbits(&ld, 5
- DEBUGVAR(1,7,"parse_audio_decoder_specific_info(): ObjectTypeIndex"));
- }
-#endif
-
- /* get GASpecificConfig */
- if (mp4ASC->objectTypeIndex == 1 || mp4ASC->objectTypeIndex == 2 ||
- mp4ASC->objectTypeIndex == 3 || mp4ASC->objectTypeIndex == 4 ||
- mp4ASC->objectTypeIndex == 6 || mp4ASC->objectTypeIndex == 7)
- {
- result = GASpecificConfig(&ld, mp4ASC, pce);
-
-#ifdef ERROR_RESILIENCE
- } else if (mp4ASC->objectTypeIndex >= ER_OBJECT_START) { /* ER */
- result = GASpecificConfig(&ld, mp4ASC, pce);
- mp4ASC->epConfig = (uint8_t)faad_getbits(&ld, 2
- DEBUGVAR(1,143,"parse_audio_decoder_specific_info(): epConfig"));
-
- if (mp4ASC->epConfig != 0)
- result = -5;
-#endif
-
- } else {
- result = -4;
- }
-
-#ifdef SSR_DEC
- /* shorter frames not allowed for SSR */
- if ((mp4ASC->objectTypeIndex == 4) && mp4ASC->frameLengthFlag)
- return -6;
-#endif
-
-
-#ifdef SBR_DEC
- bits_to_decode = (int8_t)(buffer_size*8 - faad_get_processed_bits(&ld));
-
- if ((mp4ASC->objectTypeIndex != 5) && (bits_to_decode >= 16))
- {
- int16_t syncExtensionType = (int16_t)faad_getbits(&ld, 11
- DEBUGVAR(1,9,"parse_audio_decoder_specific_info(): syncExtensionType"));
-
- if (syncExtensionType == 0x2b7)
- {
- mp4ASC->objectTypeIndex = (uint8_t)faad_getbits(&ld, 5
- DEBUGVAR(1,10,"parse_audio_decoder_specific_info(): extensionAudioObjectType"));
-
- if (mp4ASC->objectTypeIndex == 5)
- {
- mp4ASC->sbr_present_flag = (uint8_t)faad_get1bit(&ld
- DEBUGVAR(1,11,"parse_audio_decoder_specific_info(): sbr_present_flag"));
-
- if (mp4ASC->sbr_present_flag)
- {
- uint8_t tmp;
- tmp = (uint8_t)faad_getbits(&ld, 4
- DEBUGVAR(1,12,"parse_audio_decoder_specific_info(): extensionSamplingFrequencyIndex"));
-
- /* check for downsampled SBR */
- if (tmp == mp4ASC->samplingFrequencyIndex)
- mp4ASC->downSampledSBR = 1;
- mp4ASC->samplingFrequencyIndex = tmp;
-
- if (mp4ASC->samplingFrequencyIndex == 15)
- {
- mp4ASC->samplingFrequency = (uint32_t)faad_getbits(&ld, 24
- DEBUGVAR(1,13,"parse_audio_decoder_specific_info(): extensionSamplingFrequencyIndex"));
- } else {
- mp4ASC->samplingFrequency = get_sample_rate(mp4ASC->samplingFrequencyIndex);
- }
- }
- }
- }
- }
-
- /* no SBR signalled, this could mean either implicit signalling or no SBR in this file */
- /* MPEG specification states: assume SBR on files with samplerate <= 24000 Hz */
- if (mp4ASC->sbr_present_flag == -1)
- {
- if (mp4ASC->samplingFrequency <= 24000)
- {
- mp4ASC->samplingFrequency *= 2;
- mp4ASC->forceUpSampling = 1;
- } else /* > 24000*/ {
- mp4ASC->downSampledSBR = 1;
- }
- }
-#endif
-
- faad_endbits(&ld);
-
- return result;
-}
diff --git a/src/libfaad/mp4.h b/src/libfaad/mp4.h
deleted file mode 100644
index 478c9b9be..000000000
--- a/src/libfaad/mp4.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: mp4.h,v 1.8 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __MP4_H__
-#define __MP4_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "decoder.h"
-
-int8_t NEAACDECAPI NeAACDecAudioSpecificConfig(uint8_t *pBuffer,
- uint32_t buffer_size,
- mp4AudioSpecificConfig *mp4ASC);
-
-int8_t AudioSpecificConfig2(uint8_t *pBuffer,
- uint32_t buffer_size,
- mp4AudioSpecificConfig *mp4ASC,
- program_config *pce);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/libfaad/ms.c b/src/libfaad/ms.c
deleted file mode 100644
index 93b0a2051..000000000
--- a/src/libfaad/ms.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: ms.c,v 1.7 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#include "common.h"
-#include "structs.h"
-
-#include "syntax.h"
-#include "ms.h"
-#include "is.h"
-#include "pns.h"
-
-void ms_decode(ic_stream *ics, ic_stream *icsr, real_t *l_spec, real_t *r_spec,
- uint16_t frame_len)
-{
- uint8_t g, b, sfb;
- uint8_t group = 0;
- uint16_t nshort = frame_len/8;
-
- uint16_t i, k;
- real_t tmp;
-
- if (ics->ms_mask_present >= 1)
- {
- for (g = 0; g < ics->num_window_groups; g++)
- {
- for (b = 0; b < ics->window_group_length[g]; b++)
- {
- for (sfb = 0; sfb < ics->max_sfb; sfb++)
- {
- /* If intensity stereo coding or noise substitution is on
- for a particular scalefactor band, no M/S stereo decoding
- is carried out.
- */
- if ((ics->ms_used[g][sfb] || ics->ms_mask_present == 2) &&
- !is_intensity(icsr, g, sfb) && !is_noise(ics, g, sfb))
- {
- for (i = ics->swb_offset[sfb]; i < ics->swb_offset[sfb+1]; i++)
- {
- k = (group*nshort) + i;
- tmp = l_spec[k] - r_spec[k];
- l_spec[k] = l_spec[k] + r_spec[k];
- r_spec[k] = tmp;
- }
- }
- }
- group++;
- }
- }
- }
-}
diff --git a/src/libfaad/ms.h b/src/libfaad/ms.h
deleted file mode 100644
index 4bc7c8175..000000000
--- a/src/libfaad/ms.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: ms.h,v 1.7 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __MS_H__
-#define __MS_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void ms_decode(ic_stream *ics, ic_stream *icsr, real_t *l_spec, real_t *r_spec,
- uint16_t frame_len);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/libfaad/output.c b/src/libfaad/output.c
deleted file mode 100644
index 33ebed39c..000000000
--- a/src/libfaad/output.c
+++ /dev/null
@@ -1,609 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: output.c,v 1.9 2006/06/30 21:36:27 dgp85 Exp $
-**/
-
-#include "common.h"
-#include "structs.h"
-
-#include "output.h"
-#include "decoder.h"
-
-#ifndef FIXED_POINT
-
-
-#define FLOAT_SCALE (1.0f/(1<<15))
-
-#define DM_MUL REAL_CONST(0.3203772410170407) // 1/(1+sqrt(2) + 1/sqrt(2))
-#define RSQRT2 REAL_CONST(0.7071067811865475244) // 1/sqrt(2)
-
-
-static INLINE real_t get_sample(real_t **input, uint8_t channel, uint16_t sample,
- uint8_t down_matrix, uint8_t *internal_channel)
-{
- if (!down_matrix)
- return input[internal_channel[channel]][sample];
-
- if (channel == 0)
- {
- return DM_MUL * (input[internal_channel[1]][sample] +
- input[internal_channel[0]][sample] * RSQRT2 +
- input[internal_channel[3]][sample] * RSQRT2);
- } else {
- return DM_MUL * (input[internal_channel[2]][sample] +
- input[internal_channel[0]][sample] * RSQRT2 +
- input[internal_channel[4]][sample] * RSQRT2);
- }
-}
-
-#ifndef HAS_LRINTF
-#define CLIP(sample, max, min) \
-if (sample >= 0.0f) \
-{ \
- sample += 0.5f; \
- if (sample >= max) \
- sample = max; \
-} else { \
- sample += -0.5f; \
- if (sample <= min) \
- sample = min; \
-}
-#else
-#define CLIP(sample, max, min) \
-if (sample >= 0.0f) \
-{ \
- if (sample >= max) \
- sample = max; \
-} else { \
- if (sample <= min) \
- sample = min; \
-}
-#endif
-
-#define CONV(a,b) ((a<<1)|(b&0x1))
-
-static void to_PCM_16bit(NeAACDecHandle hDecoder, real_t **input,
- uint8_t channels, uint16_t frame_len,
- int16_t **sample_buffer)
-{
- uint8_t ch, ch1;
- uint16_t i;
-
- switch (CONV(channels,hDecoder->downMatrix))
- {
- case CONV(1,0):
- case CONV(1,1):
- for(i = 0; i < frame_len; i++)
- {
- real_t inp = input[hDecoder->internal_channel[0]][i];
-
- CLIP(inp, 32767.0f, -32768.0f);
-
- (*sample_buffer)[i] = (int16_t)lrintf(inp);
- }
- break;
- case CONV(2,0):
- if (hDecoder->upMatrix)
- {
- ch = hDecoder->internal_channel[0];
- for(i = 0; i < frame_len; i++)
- {
- real_t inp0 = input[ch][i];
-
- CLIP(inp0, 32767.0f, -32768.0f);
-
- (*sample_buffer)[(i*2)+0] = (int16_t)lrintf(inp0);
- (*sample_buffer)[(i*2)+1] = (int16_t)lrintf(inp0);
- }
- } else {
- ch = hDecoder->internal_channel[0];
- ch1 = hDecoder->internal_channel[1];
- for(i = 0; i < frame_len; i++)
- {
- real_t inp0 = input[ch ][i];
- real_t inp1 = input[ch1][i];
-
- CLIP(inp0, 32767.0f, -32768.0f);
- CLIP(inp1, 32767.0f, -32768.0f);
-
- (*sample_buffer)[(i*2)+0] = (int16_t)lrintf(inp0);
- (*sample_buffer)[(i*2)+1] = (int16_t)lrintf(inp1);
- }
- }
- break;
- default:
- for (ch = 0; ch < channels; ch++)
- {
- for(i = 0; i < frame_len; i++)
- {
- real_t inp = get_sample(input, ch, i, hDecoder->downMatrix, hDecoder->internal_channel);
-
- CLIP(inp, 32767.0f, -32768.0f);
-
- (*sample_buffer)[(i*channels)+ch] = (int16_t)lrintf(inp);
- }
- }
- break;
- }
-}
-
-static void to_PCM_24bit(NeAACDecHandle hDecoder, real_t **input,
- uint8_t channels, uint16_t frame_len,
- int32_t **sample_buffer)
-{
- uint8_t ch, ch1;
- uint16_t i;
-
- switch (CONV(channels,hDecoder->downMatrix))
- {
- case CONV(1,0):
- case CONV(1,1):
- for(i = 0; i < frame_len; i++)
- {
- real_t inp = input[hDecoder->internal_channel[0]][i];
-
- inp *= 256.0f;
- CLIP(inp, 8388607.0f, -8388608.0f);
-
- (*sample_buffer)[i] = (int32_t)lrintf(inp);
- }
- break;
- case CONV(2,0):
- if (hDecoder->upMatrix)
- {
- ch = hDecoder->internal_channel[0];
- for(i = 0; i < frame_len; i++)
- {
- real_t inp0 = input[ch][i];
-
- inp0 *= 256.0f;
- CLIP(inp0, 8388607.0f, -8388608.0f);
-
- (*sample_buffer)[(i*2)+0] = (int32_t)lrintf(inp0);
- (*sample_buffer)[(i*2)+1] = (int32_t)lrintf(inp0);
- }
- } else {
- ch = hDecoder->internal_channel[0];
- ch1 = hDecoder->internal_channel[1];
- for(i = 0; i < frame_len; i++)
- {
- real_t inp0 = input[ch ][i];
- real_t inp1 = input[ch1][i];
-
- inp0 *= 256.0f;
- inp1 *= 256.0f;
- CLIP(inp0, 8388607.0f, -8388608.0f);
- CLIP(inp1, 8388607.0f, -8388608.0f);
-
- (*sample_buffer)[(i*2)+0] = (int32_t)lrintf(inp0);
- (*sample_buffer)[(i*2)+1] = (int32_t)lrintf(inp1);
- }
- }
- break;
- default:
- for (ch = 0; ch < channels; ch++)
- {
- for(i = 0; i < frame_len; i++)
- {
- real_t inp = get_sample(input, ch, i, hDecoder->downMatrix, hDecoder->internal_channel);
-
- inp *= 256.0f;
- CLIP(inp, 8388607.0f, -8388608.0f);
-
- (*sample_buffer)[(i*channels)+ch] = (int32_t)lrintf(inp);
- }
- }
- break;
- }
-}
-
-static void to_PCM_32bit(NeAACDecHandle hDecoder, real_t **input,
- uint8_t channels, uint16_t frame_len,
- int32_t **sample_buffer)
-{
- uint8_t ch, ch1;
- uint16_t i;
-
- switch (CONV(channels,hDecoder->downMatrix))
- {
- case CONV(1,0):
- case CONV(1,1):
- for(i = 0; i < frame_len; i++)
- {
- real_t inp = input[hDecoder->internal_channel[0]][i];
-
- inp *= 65536.0f;
- CLIP(inp, 2147483647.0f, -2147483648.0f);
-
- (*sample_buffer)[i] = (int32_t)lrintf(inp);
- }
- break;
- case CONV(2,0):
- if (hDecoder->upMatrix)
- {
- ch = hDecoder->internal_channel[0];
- for(i = 0; i < frame_len; i++)
- {
- real_t inp0 = input[ch][i];
-
- inp0 *= 65536.0f;
- CLIP(inp0, 2147483647.0f, -2147483648.0f);
-
- (*sample_buffer)[(i*2)+0] = (int32_t)lrintf(inp0);
- (*sample_buffer)[(i*2)+1] = (int32_t)lrintf(inp0);
- }
- } else {
- ch = hDecoder->internal_channel[0];
- ch1 = hDecoder->internal_channel[1];
- for(i = 0; i < frame_len; i++)
- {
- real_t inp0 = input[ch ][i];
- real_t inp1 = input[ch1][i];
-
- inp0 *= 65536.0f;
- inp1 *= 65536.0f;
- CLIP(inp0, 2147483647.0f, -2147483648.0f);
- CLIP(inp1, 2147483647.0f, -2147483648.0f);
-
- (*sample_buffer)[(i*2)+0] = (int32_t)lrintf(inp0);
- (*sample_buffer)[(i*2)+1] = (int32_t)lrintf(inp1);
- }
- }
- break;
- default:
- for (ch = 0; ch < channels; ch++)
- {
- for(i = 0; i < frame_len; i++)
- {
- real_t inp = get_sample(input, ch, i, hDecoder->downMatrix, hDecoder->internal_channel);
-
- inp *= 65536.0f;
- CLIP(inp, 2147483647.0f, -2147483648.0f);
-
- (*sample_buffer)[(i*channels)+ch] = (int32_t)lrintf(inp);
- }
- }
- break;
- }
-}
-
-static void to_PCM_float(NeAACDecHandle hDecoder, real_t **input,
- uint8_t channels, uint16_t frame_len,
- float32_t **sample_buffer)
-{
- uint8_t ch, ch1;
- uint16_t i;
-
- switch (CONV(channels,hDecoder->downMatrix))
- {
- case CONV(1,0):
- case CONV(1,1):
- for(i = 0; i < frame_len; i++)
- {
- real_t inp = input[hDecoder->internal_channel[0]][i];
- (*sample_buffer)[i] = inp*FLOAT_SCALE;
- }
- break;
- case CONV(2,0):
- if (hDecoder->upMatrix)
- {
- ch = hDecoder->internal_channel[0];
- for(i = 0; i < frame_len; i++)
- {
- real_t inp0 = input[ch][i];
- (*sample_buffer)[(i*2)+0] = inp0*FLOAT_SCALE;
- (*sample_buffer)[(i*2)+1] = inp0*FLOAT_SCALE;
- }
- } else {
- ch = hDecoder->internal_channel[0];
- ch1 = hDecoder->internal_channel[1];
- for(i = 0; i < frame_len; i++)
- {
- real_t inp0 = input[ch ][i];
- real_t inp1 = input[ch1][i];
- (*sample_buffer)[(i*2)+0] = inp0*FLOAT_SCALE;
- (*sample_buffer)[(i*2)+1] = inp1*FLOAT_SCALE;
- }
- }
- break;
- default:
- for (ch = 0; ch < channels; ch++)
- {
- for(i = 0; i < frame_len; i++)
- {
- real_t inp = get_sample(input, ch, i, hDecoder->downMatrix, hDecoder->internal_channel);
- (*sample_buffer)[(i*channels)+ch] = inp*FLOAT_SCALE;
- }
- }
- break;
- }
-}
-
-static void to_PCM_double(NeAACDecHandle hDecoder, real_t **input,
- uint8_t channels, uint16_t frame_len,
- double **sample_buffer)
-{
- uint8_t ch, ch1;
- uint16_t i;
-
- switch (CONV(channels,hDecoder->downMatrix))
- {
- case CONV(1,0):
- case CONV(1,1):
- for(i = 0; i < frame_len; i++)
- {
- real_t inp = input[hDecoder->internal_channel[0]][i];
- (*sample_buffer)[i] = (double)inp*FLOAT_SCALE;
- }
- break;
- case CONV(2,0):
- if (hDecoder->upMatrix)
- {
- ch = hDecoder->internal_channel[0];
- for(i = 0; i < frame_len; i++)
- {
- real_t inp0 = input[ch][i];
- (*sample_buffer)[(i*2)+0] = (double)inp0*FLOAT_SCALE;
- (*sample_buffer)[(i*2)+1] = (double)inp0*FLOAT_SCALE;
- }
- } else {
- ch = hDecoder->internal_channel[0];
- ch1 = hDecoder->internal_channel[1];
- for(i = 0; i < frame_len; i++)
- {
- real_t inp0 = input[ch ][i];
- real_t inp1 = input[ch1][i];
- (*sample_buffer)[(i*2)+0] = (double)inp0*FLOAT_SCALE;
- (*sample_buffer)[(i*2)+1] = (double)inp1*FLOAT_SCALE;
- }
- }
- break;
- default:
- for (ch = 0; ch < channels; ch++)
- {
- for(i = 0; i < frame_len; i++)
- {
- real_t inp = get_sample(input, ch, i, hDecoder->downMatrix, hDecoder->internal_channel);
- (*sample_buffer)[(i*channels)+ch] = (double)inp*FLOAT_SCALE;
- }
- }
- break;
- }
-}
-
-void *output_to_PCM(NeAACDecHandle hDecoder,
- real_t **input, void *sample_buffer, uint8_t channels,
- uint16_t frame_len, uint8_t format)
-{
- int16_t *short_sample_buffer = (int16_t*)sample_buffer;
- int32_t *int_sample_buffer = (int32_t*)sample_buffer;
- float32_t *float_sample_buffer = (float32_t*)sample_buffer;
- double *double_sample_buffer = (double*)sample_buffer;
-
-#ifdef PROFILE
- int64_t count = faad_get_ts();
-#endif
-
- /* Copy output to a standard PCM buffer */
- switch (format)
- {
- case FAAD_FMT_16BIT:
- to_PCM_16bit(hDecoder, input, channels, frame_len, &short_sample_buffer);
- break;
- case FAAD_FMT_24BIT:
- to_PCM_24bit(hDecoder, input, channels, frame_len, &int_sample_buffer);
- break;
- case FAAD_FMT_32BIT:
- to_PCM_32bit(hDecoder, input, channels, frame_len, &int_sample_buffer);
- break;
- case FAAD_FMT_FLOAT:
- to_PCM_float(hDecoder, input, channels, frame_len, &float_sample_buffer);
- break;
- case FAAD_FMT_DOUBLE:
- to_PCM_double(hDecoder, input, channels, frame_len, &double_sample_buffer);
- break;
- }
-
-#ifdef PROFILE
- count = faad_get_ts() - count;
- hDecoder->output_cycles += count;
-#endif
-
- return sample_buffer;
-}
-
-#else
-
-#define DM_MUL FRAC_CONST(0.3203772410170407) // 1/(1+sqrt(2) + 1/sqrt(2))
-#define RSQRT2 FRAC_CONST(0.7071067811865475244) // 1/sqrt(2)
-
-static INLINE real_t get_sample(real_t **input, uint8_t channel, uint16_t sample,
- uint8_t down_matrix, uint8_t up_matrix,
- uint8_t *internal_channel)
-{
- if (up_matrix == 1)
- return input[internal_channel[0]][sample];
-
- if (!down_matrix)
- return input[internal_channel[channel]][sample];
-
- if (channel == 0)
- {
- real_t C = MUL_F(input[internal_channel[0]][sample], RSQRT2);
- real_t L_S = MUL_F(input[internal_channel[3]][sample], RSQRT2);
- real_t cum = input[internal_channel[1]][sample] + C + L_S;
- return MUL_F(cum, DM_MUL);
- } else {
- real_t C = MUL_F(input[internal_channel[0]][sample], RSQRT2);
- real_t R_S = MUL_F(input[internal_channel[4]][sample], RSQRT2);
- real_t cum = input[internal_channel[2]][sample] + C + R_S;
- return MUL_F(cum, DM_MUL);
- }
-}
-
-static void* output_to_PCM_orig(NeAACDecHandle hDecoder,
- real_t **input, void *sample_buffer, uint8_t channels,
- uint16_t frame_len, uint8_t format)
-{
- uint8_t ch;
- uint16_t i;
- int16_t *short_sample_buffer = (int16_t*)sample_buffer;
- int32_t *int_sample_buffer = (int32_t*)sample_buffer;
-
- /* Copy output to a standard PCM buffer */
- for (ch = 0; ch < channels; ch++)
- {
- switch (format)
- {
- case FAAD_FMT_16BIT:
- for(i = 0; i < frame_len; i++)
- {
- int32_t tmp = get_sample(input, ch, i, hDecoder->downMatrix, hDecoder->upMatrix,
- hDecoder->internal_channel);
- if (tmp >= 0)
- {
- tmp += (1 << (REAL_BITS-1));
- if (tmp >= REAL_CONST(32767))
- {
- tmp = REAL_CONST(32767);
- }
- } else {
- tmp += -(1 << (REAL_BITS-1));
- if (tmp <= REAL_CONST(-32768))
- {
- tmp = REAL_CONST(-32768);
- }
- }
- tmp >>= REAL_BITS;
- short_sample_buffer[(i*channels)+ch] = (int16_t)tmp;
- }
- break;
- case FAAD_FMT_24BIT:
- for(i = 0; i < frame_len; i++)
- {
- int32_t tmp = get_sample(input, ch, i, hDecoder->downMatrix, hDecoder->upMatrix,
- hDecoder->internal_channel);
- if (tmp >= 0)
- {
- tmp += (1 << (REAL_BITS-9));
- tmp >>= (REAL_BITS-8);
- if (tmp >= 8388607)
- {
- tmp = 8388607;
- }
- } else {
- tmp += -(1 << (REAL_BITS-9));
- tmp >>= (REAL_BITS-8);
- if (tmp <= -8388608)
- {
- tmp = -8388608;
- }
- }
- int_sample_buffer[(i*channels)+ch] = (int32_t)tmp;
- }
- break;
- case FAAD_FMT_32BIT:
- for(i = 0; i < frame_len; i++)
- {
- int32_t tmp = get_sample(input, ch, i, hDecoder->downMatrix, hDecoder->upMatrix,
- hDecoder->internal_channel);
- if (tmp >= 0)
- {
- tmp += (1 << (16-REAL_BITS-1));
- tmp <<= (16-REAL_BITS);
- } else {
- tmp += -(1 << (16-REAL_BITS-1));
- tmp <<= (16-REAL_BITS);
- }
- int_sample_buffer[(i*channels)+ch] = (int32_t)tmp;
- }
- break;
- case FAAD_FMT_FIXED:
- for(i = 0; i < frame_len; i++)
- {
- real_t tmp = get_sample(input, ch, i, hDecoder->downMatrix, hDecoder->upMatrix,
- hDecoder->internal_channel);
- int_sample_buffer[(i*channels)+ch] = (int32_t)tmp;
- }
- break;
- }
- }
-
- return sample_buffer;
-}
-
-void *output_to_PCM(NeAACDecHandle hDecoder,
- real_t **input, void *sample_buffer, uint8_t channels,
- uint16_t frame_len, uint8_t format)
-{
- int ch, i;
- int16_t *short_sample_buffer;
- real_t *ch0, *ch1, *ch2, *ch3, *ch4;
-
- if (format != FAAD_FMT_16BIT)
- return output_to_PCM_orig(hDecoder, input, sample_buffer, channels, frame_len, format);
-
- short_sample_buffer = (int16_t *)sample_buffer;
- ch0 = input[hDecoder->internal_channel[0]];
- ch1 = input[hDecoder->internal_channel[1]];
- ch2 = input[hDecoder->internal_channel[2]];
- ch3 = input[hDecoder->internal_channel[3]];
- ch4 = input[hDecoder->internal_channel[4]];
-
- if (hDecoder->downMatrix)
- {
- for (i = 0; i < frame_len; ++i)
- {
- int32_t tmp = (ch1[i] + ((ch0[i] + ch3[i]) >> 1) + ((ch0[i] + ch3[i]) >> 2) + (1 << (REAL_BITS))) >> (REAL_BITS + 1);
- if ((tmp + 0x8000) & ~0xffff)
- tmp = ~(tmp >> 31) - 0x8000;
- short_sample_buffer[0] = tmp;
- tmp = (ch2[i] + ((ch0[i] + ch4[i]) >> 1) + ((ch0[i] + ch4[i]) >> 2) + (1 << (REAL_BITS))) >> (REAL_BITS + 1);
- if ((tmp + 0x8000) & ~0xffff)
- tmp = ~(tmp >> 31) - 0x8000;
- short_sample_buffer[1] = tmp;
- short_sample_buffer += channels;
- }
- return sample_buffer;
- }
-
- /* Copy output to a standard PCM buffer */
- for (i = 0; i < frame_len; ++i)
- {
- for (ch = 0; ch < channels; ++ch)
- {
- int32_t tmp = input[hDecoder->internal_channel[ch]][i];
- tmp += (1 << (REAL_BITS - 1));
- tmp >>= REAL_BITS;
- if ((tmp + 0x8000) & ~0xffff)
- tmp = ~(tmp >> 31) - 0x8000;
- *(short_sample_buffer++) = tmp;
- }
- }
-
- return sample_buffer;
-}
-
-#endif
diff --git a/src/libfaad/output.h b/src/libfaad/output.h
deleted file mode 100644
index 1b15dae58..000000000
--- a/src/libfaad/output.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: output.h,v 1.7 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __OUTPUT_H__
-#define __OUTPUT_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void* output_to_PCM(NeAACDecHandle hDecoder,
- real_t **input,
- void *samplebuffer,
- uint8_t channels,
- uint16_t frame_len,
- uint8_t format);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/libfaad/pns.c b/src/libfaad/pns.c
deleted file mode 100644
index 5266d8eef..000000000
--- a/src/libfaad/pns.c
+++ /dev/null
@@ -1,265 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: pns.c,v 1.8 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#include "common.h"
-#include "structs.h"
-
-#include "pns.h"
-
-
-/* static function declarations */
-static void gen_rand_vector(real_t *spec, int16_t scale_factor, uint16_t size,
- uint8_t sub);
-
-
-#ifdef FIXED_POINT
-
-#define DIV(A, B) (((int64_t)A << REAL_BITS)/B)
-
-#define step(shift) \
- if ((0x40000000l >> shift) + root <= value) \
- { \
- value -= (0x40000000l >> shift) + root; \
- root = (root >> 1) | (0x40000000l >> shift); \
- } else { \
- root = root >> 1; \
- }
-
-/* fixed point square root approximation */
-/* !!!! ONLY WORKS FOR EVEN %REAL_BITS% !!!! */
-real_t fp_sqrt(real_t value)
-{
- real_t root = 0;
-
- step( 0); step( 2); step( 4); step( 6);
- step( 8); step(10); step(12); step(14);
- step(16); step(18); step(20); step(22);
- step(24); step(26); step(28); step(30);
-
- if (root < value)
- ++root;
-
- root <<= (REAL_BITS/2);
-
- return root;
-}
-
-static real_t pow2_table[] =
-{
- COEF_CONST(1.0),
- COEF_CONST(1.18920711500272),
- COEF_CONST(1.41421356237310),
- COEF_CONST(1.68179283050743)
-};
-#endif
-
-/* The function gen_rand_vector(addr, size) generates a vector of length
- <size> with signed random values of average energy MEAN_NRG per random
- value. A suitable random number generator can be realized using one
- multiplication/accumulation per random value.
-*/
-static INLINE void gen_rand_vector(real_t *spec, int16_t scale_factor, uint16_t size,
- uint8_t sub)
-{
-#ifndef FIXED_POINT
- uint16_t i;
- real_t energy = 0.0;
-
- real_t scale = (real_t)1.0/(real_t)size;
-
- for (i = 0; i < size; i++)
- {
- real_t tmp = scale*(real_t)(int32_t)random_int();
- spec[i] = tmp;
- energy += tmp*tmp;
- }
-
- scale = (real_t)1.0/(real_t)sqrt(energy);
- scale *= (real_t)pow(2.0, 0.25 * scale_factor);
- for (i = 0; i < size; i++)
- {
- spec[i] *= scale;
- }
-#else
- uint16_t i;
- real_t energy = 0, scale;
- int32_t exp, frac;
-
- for (i = 0; i < size; i++)
- {
- /* this can be replaced by a 16 bit random generator!!!! */
- real_t tmp = (int32_t)random_int();
- if (tmp < 0)
- tmp = -(tmp & ((1<<(REAL_BITS-1))-1));
- else
- tmp = (tmp & ((1<<(REAL_BITS-1))-1));
-
- energy += MUL_R(tmp,tmp);
-
- spec[i] = tmp;
- }
-
- energy = fp_sqrt(energy);
- if (energy > 0)
- {
- scale = DIV(REAL_CONST(1),energy);
-
- exp = scale_factor >> 2;
- frac = scale_factor & 3;
-
- /* IMDCT pre-scaling */
- exp -= sub;
-
- if (exp < 0)
- scale >>= -exp;
- else
- scale <<= exp;
-
- if (frac)
- scale = MUL_C(scale, pow2_table[frac]);
-
- for (i = 0; i < size; i++)
- {
- spec[i] = MUL_R(spec[i], scale);
- }
- }
-#endif
-}
-
-void pns_decode(ic_stream *ics_left, ic_stream *ics_right,
- real_t *spec_left, real_t *spec_right, uint16_t frame_len,
- uint8_t channel_pair, uint8_t object_type)
-{
- uint8_t g, sfb, b;
- uint16_t size, offs;
-
- uint8_t group = 0;
- uint16_t nshort = frame_len >> 3;
-
- uint8_t sub = 0;
-
-#ifdef FIXED_POINT
- /* IMDCT scaling */
- if (object_type == LD)
- {
- sub = 9 /*9*/;
- } else {
- if (ics_left->window_sequence == EIGHT_SHORT_SEQUENCE)
- sub = 7 /*7*/;
- else
- sub = 10 /*10*/;
- }
-#endif
-
- for (g = 0; g < ics_left->num_window_groups; g++)
- {
- /* Do perceptual noise substitution decoding */
- for (b = 0; b < ics_left->window_group_length[g]; b++)
- {
- for (sfb = 0; sfb < ics_left->max_sfb; sfb++)
- {
- if (is_noise(ics_left, g, sfb))
- {
-#ifdef LTP_DEC
- /* Simultaneous use of LTP and PNS is not prevented in the
- syntax. If both LTP, and PNS are enabled on the same
- scalefactor band, PNS takes precedence, and no prediction
- is applied to this band.
- */
- ics_left->ltp.long_used[sfb] = 0;
- ics_left->ltp2.long_used[sfb] = 0;
-#endif
-
-#ifdef MAIN_DEC
- /* For scalefactor bands coded using PNS the corresponding
- predictors are switched to "off".
- */
- ics_left->pred.prediction_used[sfb] = 0;
-#endif
-
- offs = ics_left->swb_offset[sfb];
- size = ics_left->swb_offset[sfb+1] - offs;
-
- /* Generate random vector */
- gen_rand_vector(&spec_left[(group*nshort)+offs],
- ics_left->scale_factors[g][sfb], size, sub);
- }
-
-/* From the spec:
- If the same scalefactor band and group is coded by perceptual noise
- substitution in both channels of a channel pair, the correlation of
- the noise signal can be controlled by means of the ms_used field: While
- the default noise generation process works independently for each channel
- (separate generation of random vectors), the same random vector is used
- for both channels if ms_used[] is set for a particular scalefactor band
- and group. In this case, no M/S stereo coding is carried out (because M/S
- stereo coding and noise substitution coding are mutually exclusive).
- If the same scalefactor band and group is coded by perceptual noise
- substitution in only one channel of a channel pair the setting of ms_used[]
- is not evaluated.
-*/
- if (channel_pair)
- {
- if (is_noise(ics_right, g, sfb))
- {
- if (((ics_left->ms_mask_present == 1) &&
- (ics_left->ms_used[g][sfb])) ||
- (ics_left->ms_mask_present == 2))
- {
- uint16_t c;
-
- offs = ics_right->swb_offset[sfb];
- size = ics_right->swb_offset[sfb+1] - offs;
-
- for (c = 0; c < size; c++)
- {
- spec_right[(group*nshort) + offs + c] =
- spec_left[(group*nshort) + offs + c];
- }
- } else /*if (ics_left->ms_mask_present == 0)*/ {
-#ifdef LTP_DEC
- ics_right->ltp.long_used[sfb] = 0;
- ics_right->ltp2.long_used[sfb] = 0;
-#endif
-#ifdef MAIN_DEC
- ics_right->pred.prediction_used[sfb] = 0;
-#endif
-
- offs = ics_right->swb_offset[sfb];
- size = ics_right->swb_offset[sfb+1] - offs;
-
- /* Generate random vector */
- gen_rand_vector(&spec_right[(group*nshort)+offs],
- ics_right->scale_factors[g][sfb], size, sub);
- }
- }
- }
- } /* sfb */
- group++;
- } /* b */
- } /* g */
-}
diff --git a/src/libfaad/pns.h b/src/libfaad/pns.h
deleted file mode 100644
index 2f246cc4f..000000000
--- a/src/libfaad/pns.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: pns.h,v 1.7 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __PNS_H__
-#define __PNS_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "syntax.h"
-
-#define NOISE_OFFSET 90
-
-void pns_decode(ic_stream *ics_left, ic_stream *ics_right,
- real_t *spec_left, real_t *spec_right, uint16_t frame_len,
- uint8_t channel_pair, uint8_t object_type);
-
-static INLINE uint8_t is_noise(ic_stream *ics, uint8_t group, uint8_t sfb)
-{
- if (ics->sfb_cb[group][sfb] == NOISE_HCB)
- return 1;
- return 0;
-}
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/libfaad/ps_dec.c b/src/libfaad/ps_dec.c
deleted file mode 100644
index 3b957bfda..000000000
--- a/src/libfaad/ps_dec.c
+++ /dev/null
@@ -1,1977 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR and PS decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: ps_dec.c,v 1.3 2006/09/26 17:55:59 dgp85 Exp $
-**/
-
-#include "common.h"
-
-#ifdef PS_DEC
-
-#include <stdlib.h>
-#include "ps_dec.h"
-#include "ps_tables.h"
-
-/* constants */
-#define NEGATE_IPD_MASK (0x1000)
-#define DECAY_SLOPE FRAC_CONST(0.05)
-#define COEF_SQRT2 COEF_CONST(1.4142135623731)
-
-/* tables */
-/* filters are mirrored in coef 6, second half left out */
-static const real_t p8_13_20[7] =
-{
- FRAC_CONST(0.00746082949812),
- FRAC_CONST(0.02270420949825),
- FRAC_CONST(0.04546865930473),
- FRAC_CONST(0.07266113929591),
- FRAC_CONST(0.09885108575264),
- FRAC_CONST(0.11793710567217),
- FRAC_CONST(0.125)
-};
-
-static const real_t p2_13_20[7] =
-{
- FRAC_CONST(0.0),
- FRAC_CONST(0.01899487526049),
- FRAC_CONST(0.0),
- FRAC_CONST(-0.07293139167538),
- FRAC_CONST(0.0),
- FRAC_CONST(0.30596630545168),
- FRAC_CONST(0.5)
-};
-
-static const real_t p12_13_34[7] =
-{
- FRAC_CONST(0.04081179924692),
- FRAC_CONST(0.03812810994926),
- FRAC_CONST(0.05144908135699),
- FRAC_CONST(0.06399831151592),
- FRAC_CONST(0.07428313801106),
- FRAC_CONST(0.08100347892914),
- FRAC_CONST(0.08333333333333)
-};
-
-static const real_t p8_13_34[7] =
-{
- FRAC_CONST(0.01565675600122),
- FRAC_CONST(0.03752716391991),
- FRAC_CONST(0.05417891378782),
- FRAC_CONST(0.08417044116767),
- FRAC_CONST(0.10307344158036),
- FRAC_CONST(0.12222452249753),
- FRAC_CONST(0.125)
-};
-
-static const real_t p4_13_34[7] =
-{
- FRAC_CONST(-0.05908211155639),
- FRAC_CONST(-0.04871498374946),
- FRAC_CONST(0.0),
- FRAC_CONST(0.07778723915851),
- FRAC_CONST(0.16486303567403),
- FRAC_CONST(0.23279856662996),
- FRAC_CONST(0.25)
-};
-
-#ifdef PARAM_32KHZ
-static const uint8_t delay_length_d[2][NO_ALLPASS_LINKS] = {
- { 1, 2, 3 } /* d_24kHz */,
- { 3, 4, 5 } /* d_48kHz */
-};
-#else
-static const uint8_t delay_length_d[NO_ALLPASS_LINKS] = {
- 3, 4, 5 /* d_48kHz */
-};
-#endif
-static const real_t filter_a[NO_ALLPASS_LINKS] = { /* a(m) = exp(-d_48kHz(m)/7) */
- FRAC_CONST(0.65143905753106),
- FRAC_CONST(0.56471812200776),
- FRAC_CONST(0.48954165955695)
-};
-
-static const uint8_t group_border20[10+12 + 1] =
-{
- 6, 7, 0, 1, 2, 3, /* 6 subqmf subbands */
- 9, 8, /* 2 subqmf subbands */
- 10, 11, /* 2 subqmf subbands */
- 3, 4, 5, 6, 7, 8, 9, 11, 14, 18, 23, 35, 64
-};
-
-static const uint8_t group_border34[32+18 + 1] =
-{
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, /* 12 subqmf subbands */
- 12, 13, 14, 15, 16, 17, 18, 19, /* 8 subqmf subbands */
- 20, 21, 22, 23, /* 4 subqmf subbands */
- 24, 25, 26, 27, /* 4 subqmf subbands */
- 28, 29, 30, 31, /* 4 subqmf subbands */
- 32-27, 33-27, 34-27, 35-27, 36-27, 37-27, 38-27, 40-27, 42-27, 44-27, 46-27, 48-27, 51-27, 54-27, 57-27, 60-27, 64-27, 68-27, 91-27
-};
-
-static const uint16_t map_group2bk20[10+12] =
-{
- (NEGATE_IPD_MASK | 1), (NEGATE_IPD_MASK | 0),
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19
-};
-
-static const uint16_t map_group2bk34[32+18] =
-{
- 0, 1, 2, 3, 4, 5, 6, 6, 7, (NEGATE_IPD_MASK | 2), (NEGATE_IPD_MASK | 1), (NEGATE_IPD_MASK | 0),
- 10, 10, 4, 5, 6, 7, 8, 9,
- 10, 11, 12, 9,
- 14, 11, 12, 13,
- 14, 15, 16, 13,
- 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33
-};
-
-/* type definitions */
-typedef struct
-{
- uint8_t frame_len;
- uint8_t resolution20[3];
- uint8_t resolution34[5];
-
- qmf_t *work;
- qmf_t **buffer;
- qmf_t **temp;
-} hyb_info;
-
-/* static function declarations */
-static void ps_data_decode(ps_info *ps);
-static hyb_info *hybrid_init(void);
-static void channel_filter2(hyb_info *hyb, uint8_t frame_len, const real_t *filter,
- qmf_t *buffer, qmf_t **X_hybrid);
-static void INLINE DCT3_4_unscaled(real_t *y, real_t *x);
-static void channel_filter8(hyb_info *hyb, uint8_t frame_len, const real_t *filter,
- qmf_t *buffer, qmf_t **X_hybrid);
-static void hybrid_analysis(hyb_info *hyb, qmf_t X[32][64], qmf_t X_hybrid[32][32],
- uint8_t use34);
-static void hybrid_synthesis(hyb_info *hyb, qmf_t X[32][64], qmf_t X_hybrid[32][32],
- uint8_t use34);
-static int8_t delta_clip(int8_t i, int8_t min, int8_t max);
-static void delta_decode(uint8_t enable, int8_t *index, int8_t *index_prev,
- uint8_t dt_flag, uint8_t nr_par, uint8_t stride,
- int8_t min_index, int8_t max_index);
-static void delta_modulo_decode(uint8_t enable, int8_t *index, int8_t *index_prev,
- uint8_t dt_flag, uint8_t nr_par, uint8_t stride,
- int8_t log2modulo);
-static void map20indexto34(int8_t *index, uint8_t bins);
-#ifdef PS_LOW_POWER
-static void map34indexto20(int8_t *index, uint8_t bins);
-#endif
-static void ps_data_decode(ps_info *ps);
-static void ps_decorrelate(ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38][64],
- qmf_t X_hybrid_left[32][32], qmf_t X_hybrid_right[32][32]);
-static void ps_mix_phase(ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38][64],
- qmf_t X_hybrid_left[32][32], qmf_t X_hybrid_right[32][32]);
-
-/* */
-
-
-static hyb_info *hybrid_init(void)
-{
- uint8_t i;
-
- hyb_info *hyb = (hyb_info*)faad_malloc(sizeof(hyb_info));
-
- hyb->resolution34[0] = 12;
- hyb->resolution34[1] = 8;
- hyb->resolution34[2] = 4;
- hyb->resolution34[3] = 4;
- hyb->resolution34[4] = 4;
-
- hyb->resolution20[0] = 8;
- hyb->resolution20[1] = 2;
- hyb->resolution20[2] = 2;
-
- hyb->frame_len = 32;
-
- hyb->work = (qmf_t*)faad_malloc((hyb->frame_len+12) * sizeof(qmf_t));
- memset(hyb->work, 0, (hyb->frame_len+12) * sizeof(qmf_t));
-
- hyb->buffer = (qmf_t**)faad_malloc(5 * sizeof(qmf_t*));
- for (i = 0; i < 5; i++)
- {
- hyb->buffer[i] = (qmf_t*)faad_malloc(hyb->frame_len * sizeof(qmf_t));
- memset(hyb->buffer[i], 0, hyb->frame_len * sizeof(qmf_t));
- }
-
- hyb->temp = (qmf_t**)faad_malloc(hyb->frame_len * sizeof(qmf_t*));
- for (i = 0; i < hyb->frame_len; i++)
- {
- hyb->temp[i] = (qmf_t*)faad_malloc(12 /*max*/ * sizeof(qmf_t));
- }
-
- return hyb;
-}
-
-static void hybrid_free(hyb_info *hyb)
-{
- uint8_t i;
-
- faad_free(hyb->work);
-
- for (i = 0; i < 5; i++)
- faad_free(hyb->buffer[i]);
- faad_free(hyb->buffer);
-
- for (i = 0; i < hyb->frame_len; i++)
- faad_free(hyb->temp[i]);
-
- faad_free(hyb->temp);
-}
-
-/* real filter, size 2 */
-static void channel_filter2(hyb_info *hyb, uint8_t frame_len, const real_t *filter,
- qmf_t *buffer, qmf_t **X_hybrid)
-{
- uint8_t i;
-
- for (i = 0; i < frame_len; i++)
- {
- real_t r0 = MUL_F(filter[0],(QMF_RE(buffer[0+i]) + QMF_RE(buffer[12+i])));
- real_t r1 = MUL_F(filter[1],(QMF_RE(buffer[1+i]) + QMF_RE(buffer[11+i])));
- real_t r2 = MUL_F(filter[2],(QMF_RE(buffer[2+i]) + QMF_RE(buffer[10+i])));
- real_t r3 = MUL_F(filter[3],(QMF_RE(buffer[3+i]) + QMF_RE(buffer[9+i])));
- real_t r4 = MUL_F(filter[4],(QMF_RE(buffer[4+i]) + QMF_RE(buffer[8+i])));
- real_t r5 = MUL_F(filter[5],(QMF_RE(buffer[5+i]) + QMF_RE(buffer[7+i])));
- real_t r6 = MUL_F(filter[6],QMF_RE(buffer[6+i]));
- real_t i0 = MUL_F(filter[0],(QMF_IM(buffer[0+i]) + QMF_IM(buffer[12+i])));
- real_t i1 = MUL_F(filter[1],(QMF_IM(buffer[1+i]) + QMF_IM(buffer[11+i])));
- real_t i2 = MUL_F(filter[2],(QMF_IM(buffer[2+i]) + QMF_IM(buffer[10+i])));
- real_t i3 = MUL_F(filter[3],(QMF_IM(buffer[3+i]) + QMF_IM(buffer[9+i])));
- real_t i4 = MUL_F(filter[4],(QMF_IM(buffer[4+i]) + QMF_IM(buffer[8+i])));
- real_t i5 = MUL_F(filter[5],(QMF_IM(buffer[5+i]) + QMF_IM(buffer[7+i])));
- real_t i6 = MUL_F(filter[6],QMF_IM(buffer[6+i]));
-
- /* q = 0 */
- QMF_RE(X_hybrid[i][0]) = r0 + r1 + r2 + r3 + r4 + r5 + r6;
- QMF_IM(X_hybrid[i][0]) = i0 + i1 + i2 + i3 + i4 + i5 + i6;
-
- /* q = 1 */
- QMF_RE(X_hybrid[i][1]) = r0 - r1 + r2 - r3 + r4 - r5 + r6;
- QMF_IM(X_hybrid[i][1]) = i0 - i1 + i2 - i3 + i4 - i5 + i6;
- }
-}
-
-/* complex filter, size 4 */
-static void channel_filter4(hyb_info *hyb, uint8_t frame_len, const real_t *filter,
- qmf_t *buffer, qmf_t **X_hybrid)
-{
- uint8_t i;
- real_t input_re1[2], input_re2[2], input_im1[2], input_im2[2];
-
- for (i = 0; i < frame_len; i++)
- {
- input_re1[0] = -MUL_F(filter[2], (QMF_RE(buffer[i+2]) + QMF_RE(buffer[i+10]))) +
- MUL_F(filter[6], QMF_RE(buffer[i+6]));
- input_re1[1] = MUL_F(FRAC_CONST(-0.70710678118655),
- (MUL_F(filter[1], (QMF_RE(buffer[i+1]) + QMF_RE(buffer[i+11]))) +
- MUL_F(filter[3], (QMF_RE(buffer[i+3]) + QMF_RE(buffer[i+9]))) -
- MUL_F(filter[5], (QMF_RE(buffer[i+5]) + QMF_RE(buffer[i+7])))));
-
- input_im1[0] = MUL_F(filter[0], (QMF_IM(buffer[i+0]) - QMF_IM(buffer[i+12]))) -
- MUL_F(filter[4], (QMF_IM(buffer[i+4]) - QMF_IM(buffer[i+8])));
- input_im1[1] = MUL_F(FRAC_CONST(0.70710678118655),
- (MUL_F(filter[1], (QMF_IM(buffer[i+1]) - QMF_IM(buffer[i+11]))) -
- MUL_F(filter[3], (QMF_IM(buffer[i+3]) - QMF_IM(buffer[i+9]))) -
- MUL_F(filter[5], (QMF_IM(buffer[i+5]) - QMF_IM(buffer[i+7])))));
-
- input_re2[0] = MUL_F(filter[0], (QMF_RE(buffer[i+0]) - QMF_RE(buffer[i+12]))) -
- MUL_F(filter[4], (QMF_RE(buffer[i+4]) - QMF_RE(buffer[i+8])));
- input_re2[1] = MUL_F(FRAC_CONST(0.70710678118655),
- (MUL_F(filter[1], (QMF_RE(buffer[i+1]) - QMF_RE(buffer[i+11]))) -
- MUL_F(filter[3], (QMF_RE(buffer[i+3]) - QMF_RE(buffer[i+9]))) -
- MUL_F(filter[5], (QMF_RE(buffer[i+5]) - QMF_RE(buffer[i+7])))));
-
- input_im2[0] = -MUL_F(filter[2], (QMF_IM(buffer[i+2]) + QMF_IM(buffer[i+10]))) +
- MUL_F(filter[6], QMF_IM(buffer[i+6]));
- input_im2[1] = MUL_F(FRAC_CONST(-0.70710678118655),
- (MUL_F(filter[1], (QMF_IM(buffer[i+1]) + QMF_IM(buffer[i+11]))) +
- MUL_F(filter[3], (QMF_IM(buffer[i+3]) + QMF_IM(buffer[i+9]))) -
- MUL_F(filter[5], (QMF_IM(buffer[i+5]) + QMF_IM(buffer[i+7])))));
-
- /* q == 0 */
- QMF_RE(X_hybrid[i][0]) = input_re1[0] + input_re1[1] + input_im1[0] + input_im1[1];
- QMF_IM(X_hybrid[i][0]) = -input_re2[0] - input_re2[1] + input_im2[0] + input_im2[1];
-
- /* q == 1 */
- QMF_RE(X_hybrid[i][1]) = input_re1[0] - input_re1[1] - input_im1[0] + input_im1[1];
- QMF_IM(X_hybrid[i][1]) = input_re2[0] - input_re2[1] + input_im2[0] - input_im2[1];
-
- /* q == 2 */
- QMF_RE(X_hybrid[i][2]) = input_re1[0] - input_re1[1] + input_im1[0] - input_im1[1];
- QMF_IM(X_hybrid[i][2]) = -input_re2[0] + input_re2[1] + input_im2[0] - input_im2[1];
-
- /* q == 3 */
- QMF_RE(X_hybrid[i][3]) = input_re1[0] + input_re1[1] - input_im1[0] - input_im1[1];
- QMF_IM(X_hybrid[i][3]) = input_re2[0] + input_re2[1] + input_im2[0] + input_im2[1];
- }
-}
-
-static void INLINE DCT3_4_unscaled(real_t *y, real_t *x)
-{
- real_t f0, f1, f2, f3, f4, f5, f6, f7, f8;
-
- f0 = MUL_F(x[2], FRAC_CONST(0.7071067811865476));
- f1 = x[0] - f0;
- f2 = x[0] + f0;
- f3 = x[1] + x[3];
- f4 = MUL_C(x[1], COEF_CONST(1.3065629648763766));
- f5 = MUL_F(f3, FRAC_CONST(-0.9238795325112866));
- f6 = MUL_F(x[3], FRAC_CONST(-0.5411961001461967));
- f7 = f4 + f5;
- f8 = f6 - f5;
- y[3] = f2 - f8;
- y[0] = f2 + f8;
- y[2] = f1 - f7;
- y[1] = f1 + f7;
-}
-
-/* complex filter, size 8 */
-static void channel_filter8(hyb_info *hyb, uint8_t frame_len, const real_t *filter,
- qmf_t *buffer, qmf_t **X_hybrid)
-{
- uint8_t i, n;
- real_t input_re1[4], input_re2[4], input_im1[4], input_im2[4];
- real_t x[4];
-
- for (i = 0; i < frame_len; i++)
- {
- input_re1[0] = MUL_F(filter[6],QMF_RE(buffer[6+i]));
- input_re1[1] = MUL_F(filter[5],(QMF_RE(buffer[5+i]) + QMF_RE(buffer[7+i])));
- input_re1[2] = -MUL_F(filter[0],(QMF_RE(buffer[0+i]) + QMF_RE(buffer[12+i]))) + MUL_F(filter[4],(QMF_RE(buffer[4+i]) + QMF_RE(buffer[8+i])));
- input_re1[3] = -MUL_F(filter[1],(QMF_RE(buffer[1+i]) + QMF_RE(buffer[11+i]))) + MUL_F(filter[3],(QMF_RE(buffer[3+i]) + QMF_RE(buffer[9+i])));
-
- input_im1[0] = MUL_F(filter[5],(QMF_IM(buffer[7+i]) - QMF_IM(buffer[5+i])));
- input_im1[1] = MUL_F(filter[0],(QMF_IM(buffer[12+i]) - QMF_IM(buffer[0+i]))) + MUL_F(filter[4],(QMF_IM(buffer[8+i]) - QMF_IM(buffer[4+i])));
- input_im1[2] = MUL_F(filter[1],(QMF_IM(buffer[11+i]) - QMF_IM(buffer[1+i]))) + MUL_F(filter[3],(QMF_IM(buffer[9+i]) - QMF_IM(buffer[3+i])));
- input_im1[3] = MUL_F(filter[2],(QMF_IM(buffer[10+i]) - QMF_IM(buffer[2+i])));
-
- for (n = 0; n < 4; n++)
- {
- x[n] = input_re1[n] - input_im1[3-n];
- }
- DCT3_4_unscaled(x, x);
- QMF_RE(X_hybrid[i][7]) = x[0];
- QMF_RE(X_hybrid[i][5]) = x[2];
- QMF_RE(X_hybrid[i][3]) = x[3];
- QMF_RE(X_hybrid[i][1]) = x[1];
-
- for (n = 0; n < 4; n++)
- {
- x[n] = input_re1[n] + input_im1[3-n];
- }
- DCT3_4_unscaled(x, x);
- QMF_RE(X_hybrid[i][6]) = x[1];
- QMF_RE(X_hybrid[i][4]) = x[3];
- QMF_RE(X_hybrid[i][2]) = x[2];
- QMF_RE(X_hybrid[i][0]) = x[0];
-
- input_im2[0] = MUL_F(filter[6],QMF_IM(buffer[6+i]));
- input_im2[1] = MUL_F(filter[5],(QMF_IM(buffer[5+i]) + QMF_IM(buffer[7+i])));
- input_im2[2] = -MUL_F(filter[0],(QMF_IM(buffer[0+i]) + QMF_IM(buffer[12+i]))) + MUL_F(filter[4],(QMF_IM(buffer[4+i]) + QMF_IM(buffer[8+i])));
- input_im2[3] = -MUL_F(filter[1],(QMF_IM(buffer[1+i]) + QMF_IM(buffer[11+i]))) + MUL_F(filter[3],(QMF_IM(buffer[3+i]) + QMF_IM(buffer[9+i])));
-
- input_re2[0] = MUL_F(filter[5],(QMF_RE(buffer[7+i]) - QMF_RE(buffer[5+i])));
- input_re2[1] = MUL_F(filter[0],(QMF_RE(buffer[12+i]) - QMF_RE(buffer[0+i]))) + MUL_F(filter[4],(QMF_RE(buffer[8+i]) - QMF_RE(buffer[4+i])));
- input_re2[2] = MUL_F(filter[1],(QMF_RE(buffer[11+i]) - QMF_RE(buffer[1+i]))) + MUL_F(filter[3],(QMF_RE(buffer[9+i]) - QMF_RE(buffer[3+i])));
- input_re2[3] = MUL_F(filter[2],(QMF_RE(buffer[10+i]) - QMF_RE(buffer[2+i])));
-
- for (n = 0; n < 4; n++)
- {
- x[n] = input_im2[n] + input_re2[3-n];
- }
- DCT3_4_unscaled(x, x);
- QMF_IM(X_hybrid[i][7]) = x[0];
- QMF_IM(X_hybrid[i][5]) = x[2];
- QMF_IM(X_hybrid[i][3]) = x[3];
- QMF_IM(X_hybrid[i][1]) = x[1];
-
- for (n = 0; n < 4; n++)
- {
- x[n] = input_im2[n] - input_re2[3-n];
- }
- DCT3_4_unscaled(x, x);
- QMF_IM(X_hybrid[i][6]) = x[1];
- QMF_IM(X_hybrid[i][4]) = x[3];
- QMF_IM(X_hybrid[i][2]) = x[2];
- QMF_IM(X_hybrid[i][0]) = x[0];
- }
-}
-
-static void INLINE DCT3_6_unscaled(real_t *y, real_t *x)
-{
- real_t f0, f1, f2, f3, f4, f5, f6, f7;
-
- f0 = MUL_F(x[3], FRAC_CONST(0.70710678118655));
- f1 = x[0] + f0;
- f2 = x[0] - f0;
- f3 = MUL_F((x[1] - x[5]), FRAC_CONST(0.70710678118655));
- f4 = MUL_F(x[2], FRAC_CONST(0.86602540378444)) + MUL_F(x[4], FRAC_CONST(0.5));
- f5 = f4 - x[4];
- f6 = MUL_F(x[1], FRAC_CONST(0.96592582628907)) + MUL_F(x[5], FRAC_CONST(0.25881904510252));
- f7 = f6 - f3;
- y[0] = f1 + f6 + f4;
- y[1] = f2 + f3 - x[4];
- y[2] = f7 + f2 - f5;
- y[3] = f1 - f7 - f5;
- y[4] = f1 - f3 - x[4];
- y[5] = f2 - f6 + f4;
-}
-
-/* complex filter, size 12 */
-static void channel_filter12(hyb_info *hyb, uint8_t frame_len, const real_t *filter,
- qmf_t *buffer, qmf_t **X_hybrid)
-{
- uint8_t i, n;
- real_t input_re1[6], input_re2[6], input_im1[6], input_im2[6];
- real_t out_re1[6], out_re2[6], out_im1[6], out_im2[6];
-
- for (i = 0; i < frame_len; i++)
- {
- for (n = 0; n < 6; n++)
- {
- if (n == 0)
- {
- input_re1[0] = MUL_F(QMF_RE(buffer[6+i]), filter[6]);
- input_re2[0] = MUL_F(QMF_IM(buffer[6+i]), filter[6]);
- } else {
- input_re1[6-n] = MUL_F((QMF_RE(buffer[n+i]) + QMF_RE(buffer[12-n+i])), filter[n]);
- input_re2[6-n] = MUL_F((QMF_IM(buffer[n+i]) + QMF_IM(buffer[12-n+i])), filter[n]);
- }
- input_im2[n] = MUL_F((QMF_RE(buffer[n+i]) - QMF_RE(buffer[12-n+i])), filter[n]);
- input_im1[n] = MUL_F((QMF_IM(buffer[n+i]) - QMF_IM(buffer[12-n+i])), filter[n]);
- }
-
- DCT3_6_unscaled(out_re1, input_re1);
- DCT3_6_unscaled(out_re2, input_re2);
-
- DCT3_6_unscaled(out_im1, input_im1);
- DCT3_6_unscaled(out_im2, input_im2);
-
- for (n = 0; n < 6; n += 2)
- {
- QMF_RE(X_hybrid[i][n]) = out_re1[n] - out_im1[n];
- QMF_IM(X_hybrid[i][n]) = out_re2[n] + out_im2[n];
- QMF_RE(X_hybrid[i][n+1]) = out_re1[n+1] + out_im1[n+1];
- QMF_IM(X_hybrid[i][n+1]) = out_re2[n+1] - out_im2[n+1];
-
- QMF_RE(X_hybrid[i][10-n]) = out_re1[n+1] - out_im1[n+1];
- QMF_IM(X_hybrid[i][10-n]) = out_re2[n+1] + out_im2[n+1];
- QMF_RE(X_hybrid[i][11-n]) = out_re1[n] + out_im1[n];
- QMF_IM(X_hybrid[i][11-n]) = out_re2[n] - out_im2[n];
- }
- }
-}
-
-/* Hybrid analysis: further split up QMF subbands
- * to improve frequency resolution
- */
-static void hybrid_analysis(hyb_info *hyb, qmf_t X[32][64], qmf_t X_hybrid[32][32],
- uint8_t use34)
-{
- uint8_t k, n, band;
- uint8_t offset = 0;
- uint8_t qmf_bands = (use34) ? 5 : 3;
- uint8_t *resolution = (use34) ? hyb->resolution34 : hyb->resolution20;
-
- for (band = 0; band < qmf_bands; band++)
- {
- /* build working buffer */
- memcpy(hyb->work, hyb->buffer[band], 12 * sizeof(qmf_t));
-
- /* add new samples */
- for (n = 0; n < hyb->frame_len; n++)
- {
- QMF_RE(hyb->work[12 + n]) = QMF_RE(X[n + 6 /*delay*/][band]);
- QMF_IM(hyb->work[12 + n]) = QMF_IM(X[n + 6 /*delay*/][band]);
- }
-
- /* store samples */
- memcpy(hyb->buffer[band], hyb->work + hyb->frame_len, 12 * sizeof(qmf_t));
-
-
- switch(resolution[band])
- {
- case 2:
- /* Type B real filter, Q[p] = 2 */
- channel_filter2(hyb, hyb->frame_len, p2_13_20, hyb->work, hyb->temp);
- break;
- case 4:
- /* Type A complex filter, Q[p] = 4 */
- channel_filter4(hyb, hyb->frame_len, p4_13_34, hyb->work, hyb->temp);
- break;
- case 8:
- /* Type A complex filter, Q[p] = 8 */
- channel_filter8(hyb, hyb->frame_len, (use34) ? p8_13_34 : p8_13_20,
- hyb->work, hyb->temp);
- break;
- case 12:
- /* Type A complex filter, Q[p] = 12 */
- channel_filter12(hyb, hyb->frame_len, p12_13_34, hyb->work, hyb->temp);
- break;
- }
-
- for (n = 0; n < hyb->frame_len; n++)
- {
- for (k = 0; k < resolution[band]; k++)
- {
- QMF_RE(X_hybrid[n][offset + k]) = QMF_RE(hyb->temp[n][k]);
- QMF_IM(X_hybrid[n][offset + k]) = QMF_IM(hyb->temp[n][k]);
- }
- }
- offset += resolution[band];
- }
-
- /* group hybrid channels */
- if (!use34)
- {
- for (n = 0; n < 32 /*30?*/; n++)
- {
- QMF_RE(X_hybrid[n][3]) += QMF_RE(X_hybrid[n][4]);
- QMF_IM(X_hybrid[n][3]) += QMF_IM(X_hybrid[n][4]);
- QMF_RE(X_hybrid[n][4]) = 0;
- QMF_IM(X_hybrid[n][4]) = 0;
-
- QMF_RE(X_hybrid[n][2]) += QMF_RE(X_hybrid[n][5]);
- QMF_IM(X_hybrid[n][2]) += QMF_IM(X_hybrid[n][5]);
- QMF_RE(X_hybrid[n][5]) = 0;
- QMF_IM(X_hybrid[n][5]) = 0;
- }
- }
-}
-
-static void hybrid_synthesis(hyb_info *hyb, qmf_t X[32][64], qmf_t X_hybrid[32][32],
- uint8_t use34)
-{
- uint8_t k, n, band;
- uint8_t offset = 0;
- uint8_t qmf_bands = (use34) ? 5 : 3;
- uint8_t *resolution = (use34) ? hyb->resolution34 : hyb->resolution20;
-
- for(band = 0; band < qmf_bands; band++)
- {
- for (n = 0; n < hyb->frame_len; n++)
- {
- QMF_RE(X[n][band]) = 0;
- QMF_IM(X[n][band]) = 0;
-
- for (k = 0; k < resolution[band]; k++)
- {
- QMF_RE(X[n][band]) += QMF_RE(X_hybrid[n][offset + k]);
- QMF_IM(X[n][band]) += QMF_IM(X_hybrid[n][offset + k]);
- }
- }
- offset += resolution[band];
- }
-}
-
-/* limits the value i to the range [min,max] */
-static int8_t delta_clip(int8_t i, int8_t min, int8_t max)
-{
- if (i < min)
- return min;
- else if (i > max)
- return max;
- else
- return i;
-}
-
-//int iid = 0;
-
-/* delta decode array */
-static void delta_decode(uint8_t enable, int8_t *index, int8_t *index_prev,
- uint8_t dt_flag, uint8_t nr_par, uint8_t stride,
- int8_t min_index, int8_t max_index)
-{
- int8_t i;
-
- if (enable == 1)
- {
- if (dt_flag == 0)
- {
- /* delta coded in frequency direction */
- index[0] = 0 + index[0];
- index[0] = delta_clip(index[0], min_index, max_index);
-
- for (i = 1; i < nr_par; i++)
- {
- index[i] = index[i-1] + index[i];
- index[i] = delta_clip(index[i], min_index, max_index);
- }
- } else {
- /* delta coded in time direction */
- for (i = 0; i < nr_par; i++)
- {
- //int8_t tmp2;
- //int8_t tmp = index[i];
-
- //printf("%d %d\n", index_prev[i*stride], index[i]);
- //printf("%d\n", index[i]);
-
- index[i] = index_prev[i*stride] + index[i];
- //tmp2 = index[i];
- index[i] = delta_clip(index[i], min_index, max_index);
-
- //if (iid)
- //{
- // if (index[i] == 7)
- // {
- // printf("%d %d %d\n", index_prev[i*stride], tmp, tmp2);
- // }
- //}
- }
- }
- } else {
- /* set indices to zero */
- for (i = 0; i < nr_par; i++)
- {
- index[i] = 0;
- }
- }
-
- /* coarse */
- if (stride == 2)
- {
- for (i = (nr_par<<1)-1; i > 0; i--)
- {
- index[i] = index[i>>1];
- }
- }
-}
-
-/* delta modulo decode array */
-/* in: log2 value of the modulo value to allow using AND instead of MOD */
-static void delta_modulo_decode(uint8_t enable, int8_t *index, int8_t *index_prev,
- uint8_t dt_flag, uint8_t nr_par, uint8_t stride,
- int8_t log2modulo)
-{
- int8_t i;
-
- if (enable == 1)
- {
- if (dt_flag == 0)
- {
- /* delta coded in frequency direction */
- index[0] = 0 + index[0];
- index[0] &= log2modulo;
-
- for (i = 1; i < nr_par; i++)
- {
- index[i] = index[i-1] + index[i];
- index[i] &= log2modulo;
- }
- } else {
- /* delta coded in time direction */
- for (i = 0; i < nr_par; i++)
- {
- index[i] = index_prev[i*stride] + index[i];
- index[i] &= log2modulo;
- }
- }
- } else {
- /* set indices to zero */
- for (i = 0; i < nr_par; i++)
- {
- index[i] = 0;
- }
- }
-
- /* coarse */
- if (stride == 2)
- {
- index[0] = 0;
- for (i = (nr_par<<1)-1; i > 0; i--)
- {
- index[i] = index[i>>1];
- }
- }
-}
-
-#ifdef PS_LOW_POWER
-static void map34indexto20(int8_t *index, uint8_t bins)
-{
- index[0] = (2*index[0]+index[1])/3;
- index[1] = (index[1]+2*index[2])/3;
- index[2] = (2*index[3]+index[4])/3;
- index[3] = (index[4]+2*index[5])/3;
- index[4] = (index[6]+index[7])/2;
- index[5] = (index[8]+index[9])/2;
- index[6] = index[10];
- index[7] = index[11];
- index[8] = (index[12]+index[13])/2;
- index[9] = (index[14]+index[15])/2;
- index[10] = index[16];
-
- if (bins == 34)
- {
- index[11] = index[17];
- index[12] = index[18];
- index[13] = index[19];
- index[14] = (index[20]+index[21])/2;
- index[15] = (index[22]+index[23])/2;
- index[16] = (index[24]+index[25])/2;
- index[17] = (index[26]+index[27])/2;
- index[18] = (index[28]+index[29]+index[30]+index[31])/4;
- index[19] = (index[32]+index[33])/2;
- }
-}
-#endif
-
-static void map20indexto34(int8_t *index, uint8_t bins)
-{
- index[0] = index[0];
- index[1] = (index[0] + index[1])/2;
- index[2] = index[1];
- index[3] = index[2];
- index[4] = (index[2] + index[3])/2;
- index[5] = index[3];
- index[6] = index[4];
- index[7] = index[4];
- index[8] = index[5];
- index[9] = index[5];
- index[10] = index[6];
- index[11] = index[7];
- index[12] = index[8];
- index[13] = index[8];
- index[14] = index[9];
- index[15] = index[9];
- index[16] = index[10];
-
- if (bins == 34)
- {
- index[17] = index[11];
- index[18] = index[12];
- index[19] = index[13];
- index[20] = index[14];
- index[21] = index[14];
- index[22] = index[15];
- index[23] = index[15];
- index[24] = index[16];
- index[25] = index[16];
- index[26] = index[17];
- index[27] = index[17];
- index[28] = index[18];
- index[29] = index[18];
- index[30] = index[18];
- index[31] = index[18];
- index[32] = index[19];
- index[33] = index[19];
- }
-}
-
-/* parse the bitstream data decoded in ps_data() */
-static void ps_data_decode(ps_info *ps)
-{
- uint8_t env, bin;
-
- /* ps data not available, use data from previous frame */
- if (ps->ps_data_available == 0)
- {
- ps->num_env = 0;
- }
-
- for (env = 0; env < ps->num_env; env++)
- {
- int8_t *iid_index_prev;
- int8_t *icc_index_prev;
- int8_t *ipd_index_prev;
- int8_t *opd_index_prev;
-
- int8_t num_iid_steps = (ps->iid_mode < 3) ? 7 : 15 /*fine quant*/;
-
- if (env == 0)
- {
- /* take last envelope from previous frame */
- iid_index_prev = ps->iid_index_prev;
- icc_index_prev = ps->icc_index_prev;
- ipd_index_prev = ps->ipd_index_prev;
- opd_index_prev = ps->opd_index_prev;
- } else {
- /* take index values from previous envelope */
- iid_index_prev = ps->iid_index[env - 1];
- icc_index_prev = ps->icc_index[env - 1];
- ipd_index_prev = ps->ipd_index[env - 1];
- opd_index_prev = ps->opd_index[env - 1];
- }
-
-// iid = 1;
- /* delta decode iid parameters */
- delta_decode(ps->enable_iid, ps->iid_index[env], iid_index_prev,
- ps->iid_dt[env], ps->nr_iid_par,
- (ps->iid_mode == 0 || ps->iid_mode == 3) ? 2 : 1,
- -num_iid_steps, num_iid_steps);
-// iid = 0;
-
- /* delta decode icc parameters */
- delta_decode(ps->enable_icc, ps->icc_index[env], icc_index_prev,
- ps->icc_dt[env], ps->nr_icc_par,
- (ps->icc_mode == 0 || ps->icc_mode == 3) ? 2 : 1,
- 0, 7);
-
- /* delta modulo decode ipd parameters */
- delta_modulo_decode(ps->enable_ipdopd, ps->ipd_index[env], ipd_index_prev,
- ps->ipd_dt[env], ps->nr_ipdopd_par, 1, /*log2(8)*/ 3);
-
- /* delta modulo decode opd parameters */
- delta_modulo_decode(ps->enable_ipdopd, ps->opd_index[env], opd_index_prev,
- ps->opd_dt[env], ps->nr_ipdopd_par, 1, /*log2(8)*/ 3);
- }
-
- /* handle error case */
- if (ps->num_env == 0)
- {
- /* force to 1 */
- ps->num_env = 1;
-
- if (ps->enable_iid)
- {
- for (bin = 0; bin < 34; bin++)
- ps->iid_index[0][bin] = ps->iid_index_prev[bin];
- } else {
- for (bin = 0; bin < 34; bin++)
- ps->iid_index[0][bin] = 0;
- }
-
- if (ps->enable_icc)
- {
- for (bin = 0; bin < 34; bin++)
- ps->icc_index[0][bin] = ps->icc_index_prev[bin];
- } else {
- for (bin = 0; bin < 34; bin++)
- ps->icc_index[0][bin] = 0;
- }
-
- if (ps->enable_ipdopd)
- {
- for (bin = 0; bin < 17; bin++)
- {
- ps->ipd_index[0][bin] = ps->ipd_index_prev[bin];
- ps->opd_index[0][bin] = ps->opd_index_prev[bin];
- }
- } else {
- for (bin = 0; bin < 17; bin++)
- {
- ps->ipd_index[0][bin] = 0;
- ps->opd_index[0][bin] = 0;
- }
- }
- }
-
- /* update previous indices */
- for (bin = 0; bin < 34; bin++)
- ps->iid_index_prev[bin] = ps->iid_index[ps->num_env-1][bin];
- for (bin = 0; bin < 34; bin++)
- ps->icc_index_prev[bin] = ps->icc_index[ps->num_env-1][bin];
- for (bin = 0; bin < 17; bin++)
- {
- ps->ipd_index_prev[bin] = ps->ipd_index[ps->num_env-1][bin];
- ps->opd_index_prev[bin] = ps->opd_index[ps->num_env-1][bin];
- }
-
- ps->ps_data_available = 0;
-
- if (ps->frame_class == 0)
- {
- ps->border_position[0] = 0;
- for (env = 1; env < ps->num_env; env++)
- {
- ps->border_position[env] = (env * 32 /* 30 for 960? */) / ps->num_env;
- }
- ps->border_position[ps->num_env] = 32 /* 30 for 960? */;
- } else {
- ps->border_position[0] = 0;
-
- if (ps->border_position[ps->num_env] < 32 /* 30 for 960? */)
- {
- ps->num_env++;
- ps->border_position[ps->num_env] = 32 /* 30 for 960? */;
- for (bin = 0; bin < 34; bin++)
- {
- ps->iid_index[ps->num_env][bin] = ps->iid_index[ps->num_env-1][bin];
- ps->icc_index[ps->num_env][bin] = ps->icc_index[ps->num_env-1][bin];
- }
- for (bin = 0; bin < 17; bin++)
- {
- ps->ipd_index[ps->num_env][bin] = ps->ipd_index[ps->num_env-1][bin];
- ps->opd_index[ps->num_env][bin] = ps->opd_index[ps->num_env-1][bin];
- }
- }
-
- for (env = 1; env < ps->num_env; env++)
- {
- int8_t thr = 32 /* 30 for 960? */ - (ps->num_env - env);
-
- if (ps->border_position[env] > thr)
- {
- ps->border_position[env] = thr;
- } else {
- thr = ps->border_position[env-1]+1;
- if (ps->border_position[env] < thr)
- {
- ps->border_position[env] = thr;
- }
- }
- }
- }
-
- /* make sure that the indices of all parameters can be mapped
- * to the same hybrid synthesis filterbank
- */
-#ifdef PS_LOW_POWER
- for (env = 0; env < ps->num_env; env++)
- {
- if (ps->iid_mode == 2 || ps->iid_mode == 5)
- map34indexto20(ps->iid_index[env], 34);
- if (ps->icc_mode == 2 || ps->icc_mode == 5)
- map34indexto20(ps->icc_index[env], 34);
-
- /* disable ipd/opd */
- for (bin = 0; bin < 17; bin++)
- {
- ps->aaIpdIndex[env][bin] = 0;
- ps->aaOpdIndex[env][bin] = 0;
- }
- }
-#else
- if (ps->use34hybrid_bands)
- {
- for (env = 0; env < ps->num_env; env++)
- {
- if (ps->iid_mode != 2 && ps->iid_mode != 5)
- map20indexto34(ps->iid_index[env], 34);
- if (ps->icc_mode != 2 && ps->icc_mode != 5)
- map20indexto34(ps->icc_index[env], 34);
- if (ps->ipd_mode != 2 && ps->ipd_mode != 5)
- {
- map20indexto34(ps->ipd_index[env], 17);
- map20indexto34(ps->opd_index[env], 17);
- }
- }
- }
-#endif
-
-#if 0
- for (env = 0; env < ps->num_env; env++)
- {
- printf("iid[env:%d]:", env);
- for (bin = 0; bin < 34; bin++)
- {
- printf(" %d", ps->iid_index[env][bin]);
- }
- printf("\n");
- }
- for (env = 0; env < ps->num_env; env++)
- {
- printf("icc[env:%d]:", env);
- for (bin = 0; bin < 34; bin++)
- {
- printf(" %d", ps->icc_index[env][bin]);
- }
- printf("\n");
- }
- for (env = 0; env < ps->num_env; env++)
- {
- printf("ipd[env:%d]:", env);
- for (bin = 0; bin < 17; bin++)
- {
- printf(" %d", ps->ipd_index[env][bin]);
- }
- printf("\n");
- }
- for (env = 0; env < ps->num_env; env++)
- {
- printf("opd[env:%d]:", env);
- for (bin = 0; bin < 17; bin++)
- {
- printf(" %d", ps->opd_index[env][bin]);
- }
- printf("\n");
- }
- printf("\n");
-#endif
-}
-
-/* decorrelate the mono signal using an allpass filter */
-static void ps_decorrelate(ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38][64],
- qmf_t X_hybrid_left[32][32], qmf_t X_hybrid_right[32][32])
-{
- uint8_t gr, n, m, bk;
- uint8_t temp_delay;
- uint8_t sb, maxsb;
- const complex_t *Phi_Fract_SubQmf;
- uint8_t temp_delay_ser[NO_ALLPASS_LINKS];
- real_t P_SmoothPeakDecayDiffNrg, nrg;
- real_t P[32][34];
- real_t G_TransientRatio[32][34] = {{0}};
- complex_t inputLeft;
-
-
- /* chose hybrid filterbank: 20 or 34 band case */
- if (ps->use34hybrid_bands)
- {
- Phi_Fract_SubQmf = Phi_Fract_SubQmf34;
- } else{
- Phi_Fract_SubQmf = Phi_Fract_SubQmf20;
- }
-
- /* clear the energy values */
- for (n = 0; n < 32; n++)
- {
- for (bk = 0; bk < 34; bk++)
- {
- P[n][bk] = 0;
- }
- }
-
- /* calculate the energy in each parameter band b(k) */
- for (gr = 0; gr < ps->num_groups; gr++)
- {
- /* select the parameter index b(k) to which this group belongs */
- bk = (~NEGATE_IPD_MASK) & ps->map_group2bk[gr];
-
- /* select the upper subband border for this group */
- maxsb = (gr < ps->num_hybrid_groups) ? ps->group_border[gr]+1 : ps->group_border[gr+1];
-
- for (sb = ps->group_border[gr]; sb < maxsb; sb++)
- {
- for (n = ps->border_position[0]; n < ps->border_position[ps->num_env]; n++)
- {
-#ifdef FIXED_POINT
- uint32_t in_re, in_im;
-#endif
-
- /* input from hybrid subbands or QMF subbands */
- if (gr < ps->num_hybrid_groups)
- {
- RE(inputLeft) = QMF_RE(X_hybrid_left[n][sb]);
- IM(inputLeft) = QMF_IM(X_hybrid_left[n][sb]);
- } else {
- RE(inputLeft) = QMF_RE(X_left[n][sb]);
- IM(inputLeft) = QMF_IM(X_left[n][sb]);
- }
-
- /* accumulate energy */
-#ifdef FIXED_POINT
- /* NOTE: all input is scaled by 2^(-5) because of fixed point QMF
- * meaning that P will be scaled by 2^(-10) compared to floating point version
- */
- in_re = ((abs(RE(inputLeft))+(1<<(REAL_BITS-1)))>>REAL_BITS);
- in_im = ((abs(IM(inputLeft))+(1<<(REAL_BITS-1)))>>REAL_BITS);
- P[n][bk] += in_re*in_re + in_im*in_im;
-#else
- P[n][bk] += MUL_R(RE(inputLeft),RE(inputLeft)) + MUL_R(IM(inputLeft),IM(inputLeft));
-#endif
- }
- }
- }
-
-#if 0
- for (n = 0; n < 32; n++)
- {
- for (bk = 0; bk < 34; bk++)
- {
-#ifdef FIXED_POINT
- printf("%d %d: %d\n", n, bk, P[n][bk] /*/(float)REAL_PRECISION*/);
-#else
- printf("%d %d: %f\n", n, bk, P[n][bk]/1024.0);
-#endif
- }
- }
-#endif
-
- /* calculate transient reduction ratio for each parameter band b(k) */
- for (bk = 0; bk < ps->nr_par_bands; bk++)
- {
- for (n = ps->border_position[0]; n < ps->border_position[ps->num_env]; n++)
- {
- const real_t gamma = COEF_CONST(1.5);
-
- ps->P_PeakDecayNrg[bk] = MUL_F(ps->P_PeakDecayNrg[bk], ps->alpha_decay);
- if (ps->P_PeakDecayNrg[bk] < P[n][bk])
- ps->P_PeakDecayNrg[bk] = P[n][bk];
-
- /* apply smoothing filter to peak decay energy */
- P_SmoothPeakDecayDiffNrg = ps->P_SmoothPeakDecayDiffNrg_prev[bk];
- P_SmoothPeakDecayDiffNrg += MUL_F((ps->P_PeakDecayNrg[bk] - P[n][bk] - ps->P_SmoothPeakDecayDiffNrg_prev[bk]), ps->alpha_smooth);
- ps->P_SmoothPeakDecayDiffNrg_prev[bk] = P_SmoothPeakDecayDiffNrg;
-
- /* apply smoothing filter to energy */
- nrg = ps->P_prev[bk];
- nrg += MUL_F((P[n][bk] - ps->P_prev[bk]), ps->alpha_smooth);
- ps->P_prev[bk] = nrg;
-
- /* calculate transient ratio */
- if (MUL_C(P_SmoothPeakDecayDiffNrg, gamma) <= nrg)
- {
- G_TransientRatio[n][bk] = REAL_CONST(1.0);
- } else {
- G_TransientRatio[n][bk] = DIV_R(nrg, (MUL_C(P_SmoothPeakDecayDiffNrg, gamma)));
- }
- }
- }
-
-#if 0
- for (n = 0; n < 32; n++)
- {
- for (bk = 0; bk < 34; bk++)
- {
-#ifdef FIXED_POINT
- printf("%d %d: %f\n", n, bk, G_TransientRatio[n][bk]/(float)REAL_PRECISION);
-#else
- printf("%d %d: %f\n", n, bk, G_TransientRatio[n][bk]);
-#endif
- }
- }
-#endif
-
- /* apply stereo decorrelation filter to the signal */
- for (gr = 0; gr < ps->num_groups; gr++)
- {
- if (gr < ps->num_hybrid_groups)
- maxsb = ps->group_border[gr] + 1;
- else
- maxsb = ps->group_border[gr + 1];
-
- /* QMF channel */
- for (sb = ps->group_border[gr]; sb < maxsb; sb++)
- {
- real_t g_DecaySlope;
- real_t g_DecaySlope_filt[NO_ALLPASS_LINKS];
-
- /* g_DecaySlope: [0..1] */
- if (gr < ps->num_hybrid_groups || sb <= ps->decay_cutoff)
- {
- g_DecaySlope = FRAC_CONST(1.0);
- } else {
- int8_t decay = ps->decay_cutoff - sb;
- if (decay <= -20 /* -1/DECAY_SLOPE */)
- {
- g_DecaySlope = 0;
- } else {
- /* decay(int)*decay_slope(frac) = g_DecaySlope(frac) */
- g_DecaySlope = FRAC_CONST(1.0) + DECAY_SLOPE * decay;
- }
- }
-
- /* calculate g_DecaySlope_filt for every m multiplied by filter_a[m] */
- for (m = 0; m < NO_ALLPASS_LINKS; m++)
- {
- g_DecaySlope_filt[m] = MUL_F(g_DecaySlope, filter_a[m]);
- }
-
-
- /* set delay indices */
- temp_delay = ps->saved_delay;
- for (n = 0; n < NO_ALLPASS_LINKS; n++)
- temp_delay_ser[n] = ps->delay_buf_index_ser[n];
-
- for (n = ps->border_position[0]; n < ps->border_position[ps->num_env]; n++)
- {
- complex_t tmp, tmp0, R0;
-
- if (gr < ps->num_hybrid_groups)
- {
- /* hybrid filterbank input */
- RE(inputLeft) = QMF_RE(X_hybrid_left[n][sb]);
- IM(inputLeft) = QMF_IM(X_hybrid_left[n][sb]);
- } else {
- /* QMF filterbank input */
- RE(inputLeft) = QMF_RE(X_left[n][sb]);
- IM(inputLeft) = QMF_IM(X_left[n][sb]);
- }
-
- if (sb > ps->nr_allpass_bands && gr >= ps->num_hybrid_groups)
- {
- /* delay */
-
- /* never hybrid subbands here, always QMF subbands */
- RE(tmp) = RE(ps->delay_Qmf[ps->delay_buf_index_delay[sb]][sb]);
- IM(tmp) = IM(ps->delay_Qmf[ps->delay_buf_index_delay[sb]][sb]);
- RE(R0) = RE(tmp);
- IM(R0) = IM(tmp);
- RE(ps->delay_Qmf[ps->delay_buf_index_delay[sb]][sb]) = RE(inputLeft);
- IM(ps->delay_Qmf[ps->delay_buf_index_delay[sb]][sb]) = IM(inputLeft);
- } else {
- /* allpass filter */
- uint8_t m;
- complex_t Phi_Fract;
-
- /* fetch parameters */
- if (gr < ps->num_hybrid_groups)
- {
- /* select data from the hybrid subbands */
- RE(tmp0) = RE(ps->delay_SubQmf[temp_delay][sb]);
- IM(tmp0) = IM(ps->delay_SubQmf[temp_delay][sb]);
-
- RE(ps->delay_SubQmf[temp_delay][sb]) = RE(inputLeft);
- IM(ps->delay_SubQmf[temp_delay][sb]) = IM(inputLeft);
-
- RE(Phi_Fract) = RE(Phi_Fract_SubQmf[sb]);
- IM(Phi_Fract) = IM(Phi_Fract_SubQmf[sb]);
- } else {
- /* select data from the QMF subbands */
- RE(tmp0) = RE(ps->delay_Qmf[temp_delay][sb]);
- IM(tmp0) = IM(ps->delay_Qmf[temp_delay][sb]);
-
- RE(ps->delay_Qmf[temp_delay][sb]) = RE(inputLeft);
- IM(ps->delay_Qmf[temp_delay][sb]) = IM(inputLeft);
-
- RE(Phi_Fract) = RE(Phi_Fract_Qmf[sb]);
- IM(Phi_Fract) = IM(Phi_Fract_Qmf[sb]);
- }
-
- /* z^(-2) * Phi_Fract[k] */
- ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Phi_Fract), IM(Phi_Fract));
-
- RE(R0) = RE(tmp);
- IM(R0) = IM(tmp);
- for (m = 0; m < NO_ALLPASS_LINKS; m++)
- {
- complex_t Q_Fract_allpass, tmp2;
-
- /* fetch parameters */
- if (gr < ps->num_hybrid_groups)
- {
- /* select data from the hybrid subbands */
- RE(tmp0) = RE(ps->delay_SubQmf_ser[m][temp_delay_ser[m]][sb]);
- IM(tmp0) = IM(ps->delay_SubQmf_ser[m][temp_delay_ser[m]][sb]);
-
- if (ps->use34hybrid_bands)
- {
- RE(Q_Fract_allpass) = RE(Q_Fract_allpass_SubQmf34[sb][m]);
- IM(Q_Fract_allpass) = IM(Q_Fract_allpass_SubQmf34[sb][m]);
- } else {
- RE(Q_Fract_allpass) = RE(Q_Fract_allpass_SubQmf20[sb][m]);
- IM(Q_Fract_allpass) = IM(Q_Fract_allpass_SubQmf20[sb][m]);
- }
- } else {
- /* select data from the QMF subbands */
- RE(tmp0) = RE(ps->delay_Qmf_ser[m][temp_delay_ser[m]][sb]);
- IM(tmp0) = IM(ps->delay_Qmf_ser[m][temp_delay_ser[m]][sb]);
-
- RE(Q_Fract_allpass) = RE(Q_Fract_allpass_Qmf[sb][m]);
- IM(Q_Fract_allpass) = IM(Q_Fract_allpass_Qmf[sb][m]);
- }
-
- /* delay by a fraction */
- /* z^(-d(m)) * Q_Fract_allpass[k,m] */
- ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Q_Fract_allpass), IM(Q_Fract_allpass));
-
- /* -a(m) * g_DecaySlope[k] */
- RE(tmp) += -MUL_F(g_DecaySlope_filt[m], RE(R0));
- IM(tmp) += -MUL_F(g_DecaySlope_filt[m], IM(R0));
-
- /* -a(m) * g_DecaySlope[k] * Q_Fract_allpass[k,m] * z^(-d(m)) */
- RE(tmp2) = RE(R0) + MUL_F(g_DecaySlope_filt[m], RE(tmp));
- IM(tmp2) = IM(R0) + MUL_F(g_DecaySlope_filt[m], IM(tmp));
-
- /* store sample */
- if (gr < ps->num_hybrid_groups)
- {
- RE(ps->delay_SubQmf_ser[m][temp_delay_ser[m]][sb]) = RE(tmp2);
- IM(ps->delay_SubQmf_ser[m][temp_delay_ser[m]][sb]) = IM(tmp2);
- } else {
- RE(ps->delay_Qmf_ser[m][temp_delay_ser[m]][sb]) = RE(tmp2);
- IM(ps->delay_Qmf_ser[m][temp_delay_ser[m]][sb]) = IM(tmp2);
- }
-
- /* store for next iteration (or as output value if last iteration) */
- RE(R0) = RE(tmp);
- IM(R0) = IM(tmp);
- }
- }
-
- /* select b(k) for reading the transient ratio */
- bk = (~NEGATE_IPD_MASK) & ps->map_group2bk[gr];
-
- /* duck if a past transient is found */
- RE(R0) = MUL_R(G_TransientRatio[n][bk], RE(R0));
- IM(R0) = MUL_R(G_TransientRatio[n][bk], IM(R0));
-
- if (gr < ps->num_hybrid_groups)
- {
- /* hybrid */
- QMF_RE(X_hybrid_right[n][sb]) = RE(R0);
- QMF_IM(X_hybrid_right[n][sb]) = IM(R0);
- } else {
- /* QMF */
- QMF_RE(X_right[n][sb]) = RE(R0);
- QMF_IM(X_right[n][sb]) = IM(R0);
- }
-
- /* Update delay buffer index */
- if (++temp_delay >= 2)
- {
- temp_delay = 0;
- }
-
- /* update delay indices */
- if (sb > ps->nr_allpass_bands && gr >= ps->num_hybrid_groups)
- {
- /* delay_D depends on the samplerate, it can hold the values 14 and 1 */
- if (++ps->delay_buf_index_delay[sb] >= ps->delay_D[sb])
- {
- ps->delay_buf_index_delay[sb] = 0;
- }
- }
-
- for (m = 0; m < NO_ALLPASS_LINKS; m++)
- {
- if (++temp_delay_ser[m] >= ps->num_sample_delay_ser[m])
- {
- temp_delay_ser[m] = 0;
- }
- }
- }
- }
- }
-
- /* update delay indices */
- ps->saved_delay = temp_delay;
- for (m = 0; m < NO_ALLPASS_LINKS; m++)
- ps->delay_buf_index_ser[m] = temp_delay_ser[m];
-}
-
-#ifdef FIXED_POINT
-#define step(shift) \
- if ((0x40000000l >> shift) + root <= value) \
- { \
- value -= (0x40000000l >> shift) + root; \
- root = (root >> 1) | (0x40000000l >> shift); \
- } else { \
- root = root >> 1; \
- }
-
-/* fixed point square root approximation */
-static real_t ps_sqrt(real_t value)
-{
- real_t root = 0;
-
- step( 0); step( 2); step( 4); step( 6);
- step( 8); step(10); step(12); step(14);
- step(16); step(18); step(20); step(22);
- step(24); step(26); step(28); step(30);
-
- if (root < value)
- ++root;
-
- root <<= (REAL_BITS/2);
-
- return root;
-}
-#else
-#define ps_sqrt(A) sqrt(A)
-#endif
-
-static const real_t ipdopd_cos_tab[] = {
- FRAC_CONST(1.000000000000000),
- FRAC_CONST(0.707106781186548),
- FRAC_CONST(0.000000000000000),
- FRAC_CONST(-0.707106781186547),
- FRAC_CONST(-1.000000000000000),
- FRAC_CONST(-0.707106781186548),
- FRAC_CONST(-0.000000000000000),
- FRAC_CONST(0.707106781186547),
- FRAC_CONST(1.000000000000000)
-};
-
-static const real_t ipdopd_sin_tab[] = {
- FRAC_CONST(0.000000000000000),
- FRAC_CONST(0.707106781186547),
- FRAC_CONST(1.000000000000000),
- FRAC_CONST(0.707106781186548),
- FRAC_CONST(0.000000000000000),
- FRAC_CONST(-0.707106781186547),
- FRAC_CONST(-1.000000000000000),
- FRAC_CONST(-0.707106781186548),
- FRAC_CONST(-0.000000000000000)
-};
-
-static void ps_mix_phase(ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38][64],
- qmf_t X_hybrid_left[32][32], qmf_t X_hybrid_right[32][32])
-{
- uint8_t n;
- uint8_t gr;
- uint8_t bk = 0;
- uint8_t sb, maxsb;
- uint8_t env;
- uint8_t nr_ipdopd_par;
- complex_t h11, h12, h21, h22;
- complex_t H11, H12, H21, H22;
- complex_t deltaH11, deltaH12, deltaH21, deltaH22;
- complex_t tempLeft;
- complex_t tempRight;
- complex_t phaseLeft;
- complex_t phaseRight;
- real_t L;
- const real_t *sf_iid;
- uint8_t no_iid_steps;
-
- if (ps->iid_mode >= 3)
- {
- no_iid_steps = 15;
- sf_iid = sf_iid_fine;
- } else {
- no_iid_steps = 7;
- sf_iid = sf_iid_normal;
- }
-
- if (ps->ipd_mode == 0 || ps->ipd_mode == 3)
- {
- nr_ipdopd_par = 11; /* resolution */
- } else {
- nr_ipdopd_par = ps->nr_ipdopd_par;
- }
-
- for (gr = 0; gr < ps->num_groups; gr++)
- {
- bk = (~NEGATE_IPD_MASK) & ps->map_group2bk[gr];
-
- /* use one channel per group in the subqmf domain */
- maxsb = (gr < ps->num_hybrid_groups) ? ps->group_border[gr] + 1 : ps->group_border[gr + 1];
-
- for (env = 0; env < ps->num_env; env++)
- {
- if (ps->icc_mode < 3)
- {
- /* type 'A' mixing as described in 8.6.4.6.2.1 */
- real_t c_1, c_2;
- real_t cosa, sina;
- real_t cosb, sinb;
- real_t ab1, ab2;
- real_t ab3, ab4;
-
- /*
- c_1 = sqrt(2.0 / (1.0 + pow(10.0, quant_iid[no_iid_steps + iid_index] / 10.0)));
- c_2 = sqrt(2.0 / (1.0 + pow(10.0, quant_iid[no_iid_steps - iid_index] / 10.0)));
- alpha = 0.5 * acos(quant_rho[icc_index]);
- beta = alpha * ( c_1 - c_2 ) / sqrt(2.0);
- */
-
- //printf("%d\n", ps->iid_index[env][bk]);
-
- /* calculate the scalefactors c_1 and c_2 from the intensity differences */
- c_1 = sf_iid[no_iid_steps + ps->iid_index[env][bk]];
- c_2 = sf_iid[no_iid_steps - ps->iid_index[env][bk]];
-
- /* calculate alpha and beta using the ICC parameters */
- cosa = cos_alphas[ps->icc_index[env][bk]];
- sina = sin_alphas[ps->icc_index[env][bk]];
-
- if (ps->iid_mode >= 3)
- {
- if (ps->iid_index[env][bk] < 0)
- {
- cosb = cos_betas_fine[-ps->iid_index[env][bk]][ps->icc_index[env][bk]];
- sinb = -sin_betas_fine[-ps->iid_index[env][bk]][ps->icc_index[env][bk]];
- } else {
- cosb = cos_betas_fine[ps->iid_index[env][bk]][ps->icc_index[env][bk]];
- sinb = sin_betas_fine[ps->iid_index[env][bk]][ps->icc_index[env][bk]];
- }
- } else {
- if (ps->iid_index[env][bk] < 0)
- {
- cosb = cos_betas_normal[-ps->iid_index[env][bk]][ps->icc_index[env][bk]];
- sinb = -sin_betas_normal[-ps->iid_index[env][bk]][ps->icc_index[env][bk]];
- } else {
- cosb = cos_betas_normal[ps->iid_index[env][bk]][ps->icc_index[env][bk]];
- sinb = sin_betas_normal[ps->iid_index[env][bk]][ps->icc_index[env][bk]];
- }
- }
-
- ab1 = MUL_C(cosb, cosa);
- ab2 = MUL_C(sinb, sina);
- ab3 = MUL_C(sinb, cosa);
- ab4 = MUL_C(cosb, sina);
-
- /* h_xy: COEF */
- RE(h11) = MUL_C(c_2, (ab1 - ab2));
- RE(h12) = MUL_C(c_1, (ab1 + ab2));
- RE(h21) = MUL_C(c_2, (ab3 + ab4));
- RE(h22) = MUL_C(c_1, (ab3 - ab4));
- } else {
- /* type 'B' mixing as described in 8.6.4.6.2.2 */
- real_t sina, cosa;
- real_t cosg, sing;
-
- /*
- real_t c, rho, mu, alpha, gamma;
- uint8_t i;
-
- i = ps->iid_index[env][bk];
- c = (real_t)pow(10.0, ((i)?(((i>0)?1:-1)*quant_iid[((i>0)?i:-i)-1]):0.)/20.0);
- rho = quant_rho[ps->icc_index[env][bk]];
-
- if (rho == 0.0f && c == 1.)
- {
- alpha = (real_t)M_PI/4.0f;
- rho = 0.05f;
- } else {
- if (rho <= 0.05f)
- {
- rho = 0.05f;
- }
- alpha = 0.5f*(real_t)atan( (2.0f*c*rho) / (c*c-1.0f) );
-
- if (alpha < 0.)
- {
- alpha += (real_t)M_PI/2.0f;
- }
- if (rho < 0.)
- {
- alpha += (real_t)M_PI;
- }
- }
- mu = c+1.0f/c;
- mu = 1+(4.0f*rho*rho-4.0f)/(mu*mu);
- gamma = (real_t)atan(sqrt((1.0f-sqrt(mu))/(1.0f+sqrt(mu))));
- */
-
- if (ps->iid_mode >= 3)
- {
- uint8_t abs_iid = abs(ps->iid_index[env][bk]);
-
- cosa = sincos_alphas_B_fine[no_iid_steps + ps->iid_index[env][bk]][ps->icc_index[env][bk]];
- sina = sincos_alphas_B_fine[30 - (no_iid_steps + ps->iid_index[env][bk])][ps->icc_index[env][bk]];
- cosg = cos_gammas_fine[abs_iid][ps->icc_index[env][bk]];
- sing = sin_gammas_fine[abs_iid][ps->icc_index[env][bk]];
- } else {
- uint8_t abs_iid = abs(ps->iid_index[env][bk]);
-
- cosa = sincos_alphas_B_normal[no_iid_steps + ps->iid_index[env][bk]][ps->icc_index[env][bk]];
- sina = sincos_alphas_B_normal[14 - (no_iid_steps + ps->iid_index[env][bk])][ps->icc_index[env][bk]];
- cosg = cos_gammas_normal[abs_iid][ps->icc_index[env][bk]];
- sing = sin_gammas_normal[abs_iid][ps->icc_index[env][bk]];
- }
-
- RE(h11) = MUL_C(COEF_SQRT2, MUL_C(cosa, cosg));
- RE(h12) = MUL_C(COEF_SQRT2, MUL_C(sina, cosg));
- RE(h21) = MUL_C(COEF_SQRT2, MUL_C(-cosa, sing));
- RE(h22) = MUL_C(COEF_SQRT2, MUL_C(sina, sing));
- }
-
- /* calculate phase rotation parameters H_xy */
- /* note that the imaginary part of these parameters are only calculated when
- IPD and OPD are enabled
- */
- if ((ps->enable_ipdopd) && (bk < nr_ipdopd_par))
- {
- int8_t i;
- real_t xxyy, ppqq;
- real_t yq, xp, xq, py, tmp;
-
- /* ringbuffer index */
- i = ps->phase_hist;
-
- /* previous value */
-#ifdef FIXED_POINT
- /* divide by 4, shift right 2 bits */
- RE(tempLeft) = RE(ps->ipd_prev[bk][i]) >> 2;
- IM(tempLeft) = IM(ps->ipd_prev[bk][i]) >> 2;
- RE(tempRight) = RE(ps->opd_prev[bk][i]) >> 2;
- IM(tempRight) = IM(ps->opd_prev[bk][i]) >> 2;
-#else
- RE(tempLeft) = MUL_F(RE(ps->ipd_prev[bk][i]), FRAC_CONST(0.25));
- IM(tempLeft) = MUL_F(IM(ps->ipd_prev[bk][i]), FRAC_CONST(0.25));
- RE(tempRight) = MUL_F(RE(ps->opd_prev[bk][i]), FRAC_CONST(0.25));
- IM(tempRight) = MUL_F(IM(ps->opd_prev[bk][i]), FRAC_CONST(0.25));
-#endif
-
- /* save current value */
- RE(ps->ipd_prev[bk][i]) = ipdopd_cos_tab[abs(ps->ipd_index[env][bk])];
- IM(ps->ipd_prev[bk][i]) = ipdopd_sin_tab[abs(ps->ipd_index[env][bk])];
- RE(ps->opd_prev[bk][i]) = ipdopd_cos_tab[abs(ps->opd_index[env][bk])];
- IM(ps->opd_prev[bk][i]) = ipdopd_sin_tab[abs(ps->opd_index[env][bk])];
-
- /* add current value */
- RE(tempLeft) += RE(ps->ipd_prev[bk][i]);
- IM(tempLeft) += IM(ps->ipd_prev[bk][i]);
- RE(tempRight) += RE(ps->opd_prev[bk][i]);
- IM(tempRight) += IM(ps->opd_prev[bk][i]);
-
- /* ringbuffer index */
- if (i == 0)
- {
- i = 2;
- }
- i--;
-
- /* get value before previous */
-#ifdef FIXED_POINT
- /* dividing by 2, shift right 1 bit */
- RE(tempLeft) += (RE(ps->ipd_prev[bk][i]) >> 1);
- IM(tempLeft) += (IM(ps->ipd_prev[bk][i]) >> 1);
- RE(tempRight) += (RE(ps->opd_prev[bk][i]) >> 1);
- IM(tempRight) += (IM(ps->opd_prev[bk][i]) >> 1);
-#else
- RE(tempLeft) += MUL_F(RE(ps->ipd_prev[bk][i]), FRAC_CONST(0.5));
- IM(tempLeft) += MUL_F(IM(ps->ipd_prev[bk][i]), FRAC_CONST(0.5));
- RE(tempRight) += MUL_F(RE(ps->opd_prev[bk][i]), FRAC_CONST(0.5));
- IM(tempRight) += MUL_F(IM(ps->opd_prev[bk][i]), FRAC_CONST(0.5));
-#endif
-
-#if 0 /* original code */
- ipd = (float)atan2(IM(tempLeft), RE(tempLeft));
- opd = (float)atan2(IM(tempRight), RE(tempRight));
-
- /* phase rotation */
- RE(phaseLeft) = (float)cos(opd);
- IM(phaseLeft) = (float)sin(opd);
- opd -= ipd;
- RE(phaseRight) = (float)cos(opd);
- IM(phaseRight) = (float)sin(opd);
-#else
- // x = IM(tempLeft)
- // y = RE(tempLeft)
- // p = IM(tempRight)
- // q = RE(tempRight)
- // cos(atan2(x,y)) = 1/sqrt(1 + (x*x)/(y*y))
- // sin(atan2(x,y)) = x/(y*sqrt(1 + (x*x)/(y*y)))
- // cos(atan2(x,y)-atan2(p,q)) = (y*q+x*p)/(y*q * sqrt(1 + (x*x)/(y*y)) * sqrt(1 + (p*p)/(q*q)));
- // sin(atan2(x,y)-atan2(p,q)) = (x*q-p*y)/(y*q * sqrt(1 + (x*x)/(y*y)) * sqrt(1 + (p*p)/(q*q)));
-
- /* (x*x)/(y*y) (REAL > 0) */
- xxyy = DIV_R(MUL_C(IM(tempLeft),IM(tempLeft)), MUL_C(RE(tempLeft),RE(tempLeft)));
- ppqq = DIV_R(MUL_C(IM(tempRight),IM(tempRight)), MUL_C(RE(tempRight),RE(tempRight)));
-
- /* 1 + (x*x)/(y*y) (REAL > 1) */
- xxyy += REAL_CONST(1);
- ppqq += REAL_CONST(1);
-
- /* 1 / sqrt(1 + (x*x)/(y*y)) (FRAC <= 1) */
- xxyy = DIV_R(FRAC_CONST(1), ps_sqrt(xxyy));
- ppqq = DIV_R(FRAC_CONST(1), ps_sqrt(ppqq));
-
- /* COEF */
- yq = MUL_C(RE(tempLeft), RE(tempRight));
- xp = MUL_C(IM(tempLeft), IM(tempRight));
- xq = MUL_C(IM(tempLeft), RE(tempRight));
- py = MUL_C(RE(tempLeft), IM(tempRight));
-
- RE(phaseLeft) = xxyy;
- IM(phaseLeft) = MUL_R(xxyy, (DIV_R(IM(tempLeft), RE(tempLeft))));
-
- tmp = DIV_C(MUL_F(xxyy, ppqq), yq);
-
- /* MUL_C(FRAC,COEF) = FRAC */
- RE(phaseRight) = MUL_C(tmp, (yq+xp));
- IM(phaseRight) = MUL_C(tmp, (xq-py));
-#endif
-
- /* MUL_F(COEF, FRAC) = COEF */
- IM(h11) = MUL_F(RE(h11), IM(phaseLeft));
- IM(h12) = MUL_F(RE(h12), IM(phaseRight));
- IM(h21) = MUL_F(RE(h21), IM(phaseLeft));
- IM(h22) = MUL_F(RE(h22), IM(phaseRight));
-
- RE(h11) = MUL_F(RE(h11), RE(phaseLeft));
- RE(h12) = MUL_F(RE(h12), RE(phaseRight));
- RE(h21) = MUL_F(RE(h21), RE(phaseLeft));
- RE(h22) = MUL_F(RE(h22), RE(phaseRight));
- }
-
- /* length of the envelope n_e+1 - n_e (in time samples) */
- /* 0 < L <= 32: integer */
- L = (real_t)(ps->border_position[env + 1] - ps->border_position[env]);
-
- /* obtain final H_xy by means of linear interpolation */
- RE(deltaH11) = (RE(h11) - RE(ps->h11_prev[gr])) / L;
- RE(deltaH12) = (RE(h12) - RE(ps->h12_prev[gr])) / L;
- RE(deltaH21) = (RE(h21) - RE(ps->h21_prev[gr])) / L;
- RE(deltaH22) = (RE(h22) - RE(ps->h22_prev[gr])) / L;
-
- RE(H11) = RE(ps->h11_prev[gr]);
- RE(H12) = RE(ps->h12_prev[gr]);
- RE(H21) = RE(ps->h21_prev[gr]);
- RE(H22) = RE(ps->h22_prev[gr]);
-
- RE(ps->h11_prev[gr]) = RE(h11);
- RE(ps->h12_prev[gr]) = RE(h12);
- RE(ps->h21_prev[gr]) = RE(h21);
- RE(ps->h22_prev[gr]) = RE(h22);
-
- /* only calculate imaginary part when needed */
- if ((ps->enable_ipdopd) && (bk < nr_ipdopd_par))
- {
- /* obtain final H_xy by means of linear interpolation */
- IM(deltaH11) = (IM(h11) - IM(ps->h11_prev[gr])) / L;
- IM(deltaH12) = (IM(h12) - IM(ps->h12_prev[gr])) / L;
- IM(deltaH21) = (IM(h21) - IM(ps->h21_prev[gr])) / L;
- IM(deltaH22) = (IM(h22) - IM(ps->h22_prev[gr])) / L;
-
- IM(H11) = IM(ps->h11_prev[gr]);
- IM(H12) = IM(ps->h12_prev[gr]);
- IM(H21) = IM(ps->h21_prev[gr]);
- IM(H22) = IM(ps->h22_prev[gr]);
-
- if ((NEGATE_IPD_MASK & ps->map_group2bk[gr]) != 0)
- {
- IM(deltaH11) = -IM(deltaH11);
- IM(deltaH12) = -IM(deltaH12);
- IM(deltaH21) = -IM(deltaH21);
- IM(deltaH22) = -IM(deltaH22);
-
- IM(H11) = -IM(H11);
- IM(H12) = -IM(H12);
- IM(H21) = -IM(H21);
- IM(H22) = -IM(H22);
- }
-
- IM(ps->h11_prev[gr]) = IM(h11);
- IM(ps->h12_prev[gr]) = IM(h12);
- IM(ps->h21_prev[gr]) = IM(h21);
- IM(ps->h22_prev[gr]) = IM(h22);
- }
-
- /* apply H_xy to the current envelope band of the decorrelated subband */
- for (n = ps->border_position[env]; n < ps->border_position[env + 1]; n++)
- {
- /* addition finalises the interpolation over every n */
- RE(H11) += RE(deltaH11);
- RE(H12) += RE(deltaH12);
- RE(H21) += RE(deltaH21);
- RE(H22) += RE(deltaH22);
- if ((ps->enable_ipdopd) && (bk < nr_ipdopd_par))
- {
- IM(H11) += IM(deltaH11);
- IM(H12) += IM(deltaH12);
- IM(H21) += IM(deltaH21);
- IM(H22) += IM(deltaH22);
- }
-
- /* channel is an alias to the subband */
- for (sb = ps->group_border[gr]; sb < maxsb; sb++)
- {
- complex_t inLeft, inRight;
-
- /* load decorrelated samples */
- if (gr < ps->num_hybrid_groups)
- {
- RE(inLeft) = RE(X_hybrid_left[n][sb]);
- IM(inLeft) = IM(X_hybrid_left[n][sb]);
- RE(inRight) = RE(X_hybrid_right[n][sb]);
- IM(inRight) = IM(X_hybrid_right[n][sb]);
- } else {
- RE(inLeft) = RE(X_left[n][sb]);
- IM(inLeft) = IM(X_left[n][sb]);
- RE(inRight) = RE(X_right[n][sb]);
- IM(inRight) = IM(X_right[n][sb]);
- }
-
- /* apply mixing */
- RE(tempLeft) = MUL_C(RE(H11), RE(inLeft)) + MUL_C(RE(H21), RE(inRight));
- IM(tempLeft) = MUL_C(RE(H11), IM(inLeft)) + MUL_C(RE(H21), IM(inRight));
- RE(tempRight) = MUL_C(RE(H12), RE(inLeft)) + MUL_C(RE(H22), RE(inRight));
- IM(tempRight) = MUL_C(RE(H12), IM(inLeft)) + MUL_C(RE(H22), IM(inRight));
-
- /* only perform imaginary operations when needed */
- if ((ps->enable_ipdopd) && (bk < nr_ipdopd_par))
- {
- /* apply rotation */
- RE(tempLeft) -= MUL_C(IM(H11), IM(inLeft)) + MUL_C(IM(H21), IM(inRight));
- IM(tempLeft) += MUL_C(IM(H11), RE(inLeft)) + MUL_C(IM(H21), RE(inRight));
- RE(tempRight) -= MUL_C(IM(H12), IM(inLeft)) + MUL_C(IM(H22), IM(inRight));
- IM(tempRight) += MUL_C(IM(H12), RE(inLeft)) + MUL_C(IM(H22), RE(inRight));
- }
-
- /* store final samples */
- if (gr < ps->num_hybrid_groups)
- {
- RE(X_hybrid_left[n][sb]) = RE(tempLeft);
- IM(X_hybrid_left[n][sb]) = IM(tempLeft);
- RE(X_hybrid_right[n][sb]) = RE(tempRight);
- IM(X_hybrid_right[n][sb]) = IM(tempRight);
- } else {
- RE(X_left[n][sb]) = RE(tempLeft);
- IM(X_left[n][sb]) = IM(tempLeft);
- RE(X_right[n][sb]) = RE(tempRight);
- IM(X_right[n][sb]) = IM(tempRight);
- }
- }
- }
-
- /* shift phase smoother's circular buffer index */
- ps->phase_hist++;
- if (ps->phase_hist == 2)
- {
- ps->phase_hist = 0;
- }
- }
- }
-}
-
-void ps_free(ps_info *ps)
-{
- /* free hybrid filterbank structures */
- hybrid_free(ps->hyb);
-
- faad_free(ps);
-}
-
-ps_info *ps_init(uint8_t sr_index)
-{
- uint8_t i;
- uint8_t short_delay_band;
-
- ps_info *ps = (ps_info*)faad_malloc(sizeof(ps_info));
- memset(ps, 0, sizeof(ps_info));
-
- ps->hyb = hybrid_init();
-
- ps->ps_data_available = 0;
-
- /* delay stuff*/
- ps->saved_delay = 0;
-
- for (i = 0; i < 64; i++)
- {
- ps->delay_buf_index_delay[i] = 0;
- }
-
- for (i = 0; i < NO_ALLPASS_LINKS; i++)
- {
- ps->delay_buf_index_ser[i] = 0;
-#ifdef PARAM_32KHZ
- if (sr_index <= 5) /* >= 32 kHz*/
- {
- ps->num_sample_delay_ser[i] = delay_length_d[1][i];
- } else {
- ps->num_sample_delay_ser[i] = delay_length_d[0][i];
- }
-#else
- /* THESE ARE CONSTANTS NOW */
- ps->num_sample_delay_ser[i] = delay_length_d[i];
-#endif
- }
-
-#ifdef PARAM_32KHZ
- if (sr_index <= 5) /* >= 32 kHz*/
- {
- short_delay_band = 35;
- ps->nr_allpass_bands = 22;
- ps->alpha_decay = FRAC_CONST(0.76592833836465);
- ps->alpha_smooth = FRAC_CONST(0.25);
- } else {
- short_delay_band = 64;
- ps->nr_allpass_bands = 45;
- ps->alpha_decay = FRAC_CONST(0.58664621951003);
- ps->alpha_smooth = FRAC_CONST(0.6);
- }
-#else
- /* THESE ARE CONSTANTS NOW */
- short_delay_band = 35;
- ps->nr_allpass_bands = 22;
- ps->alpha_decay = FRAC_CONST(0.76592833836465);
- ps->alpha_smooth = FRAC_CONST(0.25);
-#endif
-
- /* THESE ARE CONSTANT NOW IF PS IS INDEPENDANT OF SAMPLERATE */
- for (i = 0; i < short_delay_band; i++)
- {
- ps->delay_D[i] = 14;
- }
- for (i = short_delay_band; i < 64; i++)
- {
- ps->delay_D[i] = 1;
- }
-
- /* mixing and phase */
- for (i = 0; i < 50; i++)
- {
- RE(ps->h11_prev[i]) = 1;
- IM(ps->h12_prev[i]) = 1;
- RE(ps->h11_prev[i]) = 1;
- IM(ps->h12_prev[i]) = 1;
- }
-
- ps->phase_hist = 0;
-
- for (i = 0; i < 20; i++)
- {
- RE(ps->ipd_prev[i][0]) = 0;
- IM(ps->ipd_prev[i][0]) = 0;
- RE(ps->ipd_prev[i][1]) = 0;
- IM(ps->ipd_prev[i][1]) = 0;
- RE(ps->opd_prev[i][0]) = 0;
- IM(ps->opd_prev[i][0]) = 0;
- RE(ps->opd_prev[i][1]) = 0;
- IM(ps->opd_prev[i][1]) = 0;
- }
-
- return ps;
-}
-
-/* main Parametric Stereo decoding function */
-uint8_t ps_decode(ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38][64])
-{
- qmf_t X_hybrid_left[32][32] = {{{0}}};
- qmf_t X_hybrid_right[32][32] = {{{0}}};
-
- /* delta decoding of the bitstream data */
- ps_data_decode(ps);
-
- /* set up some parameters depending on filterbank type */
- if (ps->use34hybrid_bands)
- {
- ps->group_border = (uint8_t*)group_border34;
- ps->map_group2bk = (uint16_t*)map_group2bk34;
- ps->num_groups = 32+18;
- ps->num_hybrid_groups = 32;
- ps->nr_par_bands = 34;
- ps->decay_cutoff = 5;
- } else {
- ps->group_border = (uint8_t*)group_border20;
- ps->map_group2bk = (uint16_t*)map_group2bk20;
- ps->num_groups = 10+12;
- ps->num_hybrid_groups = 10;
- ps->nr_par_bands = 20;
- ps->decay_cutoff = 3;
- }
-
- /* Perform further analysis on the lowest subbands to get a higher
- * frequency resolution
- */
- hybrid_analysis((hyb_info*)ps->hyb, X_left, X_hybrid_left,
- ps->use34hybrid_bands);
-
- /* decorrelate mono signal */
- ps_decorrelate(ps, X_left, X_right, X_hybrid_left, X_hybrid_right);
-
- /* apply mixing and phase parameters */
- ps_mix_phase(ps, X_left, X_right, X_hybrid_left, X_hybrid_right);
-
- /* hybrid synthesis, to rebuild the SBR QMF matrices */
- hybrid_synthesis((hyb_info*)ps->hyb, X_left, X_hybrid_left,
- ps->use34hybrid_bands);
-
- hybrid_synthesis((hyb_info*)ps->hyb, X_right, X_hybrid_right,
- ps->use34hybrid_bands);
-
- return 0;
-}
-
-#endif
-
diff --git a/src/libfaad/ps_dec.h b/src/libfaad/ps_dec.h
deleted file mode 100644
index 978161fff..000000000
--- a/src/libfaad/ps_dec.h
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: ps_dec.h,v 1.1 2005/10/30 00:50:19 tmmm Exp $
-**/
-
-#ifndef __PS_DEC_H__
-#define __PS_DEC_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "bits.h"
-
-#define EXTENSION_ID_PS 2
-
-#define MAX_PS_ENVELOPES 5
-#define NO_ALLPASS_LINKS 3
-
-typedef struct
-{
- /* bitstream parameters */
- uint8_t enable_iid;
- uint8_t enable_icc;
- uint8_t enable_ext;
-
- uint8_t iid_mode;
- uint8_t icc_mode;
- uint8_t nr_iid_par;
- uint8_t nr_ipdopd_par;
- uint8_t nr_icc_par;
-
- uint8_t frame_class;
- uint8_t num_env;
-
- uint8_t border_position[MAX_PS_ENVELOPES+1];
-
- uint8_t iid_dt[MAX_PS_ENVELOPES];
- uint8_t icc_dt[MAX_PS_ENVELOPES];
-
- uint8_t enable_ipdopd;
- uint8_t ipd_mode;
- uint8_t ipd_dt[MAX_PS_ENVELOPES];
- uint8_t opd_dt[MAX_PS_ENVELOPES];
-
- /* indices */
- int8_t iid_index_prev[34];
- int8_t icc_index_prev[34];
- int8_t ipd_index_prev[17];
- int8_t opd_index_prev[17];
- int8_t iid_index[MAX_PS_ENVELOPES][34];
- int8_t icc_index[MAX_PS_ENVELOPES][34];
- int8_t ipd_index[MAX_PS_ENVELOPES][17];
- int8_t opd_index[MAX_PS_ENVELOPES][17];
-
- int8_t ipd_index_1[17];
- int8_t opd_index_1[17];
- int8_t ipd_index_2[17];
- int8_t opd_index_2[17];
-
- /* ps data was correctly read */
- uint8_t ps_data_available;
-
- /* a header has been read */
- uint8_t header_read;
-
- /* hybrid filterbank parameters */
- void *hyb;
- uint8_t use34hybrid_bands;
-
- /**/
- uint8_t num_groups;
- uint8_t num_hybrid_groups;
- uint8_t nr_par_bands;
- uint8_t nr_allpass_bands;
- uint8_t decay_cutoff;
-
- uint8_t *group_border;
- uint16_t *map_group2bk;
-
- /* filter delay handling */
- uint8_t saved_delay;
- uint8_t delay_buf_index_ser[NO_ALLPASS_LINKS];
- uint8_t num_sample_delay_ser[NO_ALLPASS_LINKS];
- uint8_t delay_D[64];
- uint8_t delay_buf_index_delay[64];
-
- complex_t delay_Qmf[14][64]; /* 14 samples delay max, 64 QMF channels */
- complex_t delay_SubQmf[2][32]; /* 2 samples delay max (SubQmf is always allpass filtered) */
- complex_t delay_Qmf_ser[NO_ALLPASS_LINKS][5][64]; /* 5 samples delay max (table 8.34), 64 QMF channels */
- complex_t delay_SubQmf_ser[NO_ALLPASS_LINKS][5][32]; /* 5 samples delay max (table 8.34) */
-
- /* transients */
- real_t alpha_decay;
- real_t alpha_smooth;
-
- real_t P_PeakDecayNrg[34];
- real_t P_prev[34];
- real_t P_SmoothPeakDecayDiffNrg_prev[34];
-
- /* mixing and phase */
- complex_t h11_prev[50];
- complex_t h12_prev[50];
- complex_t h21_prev[50];
- complex_t h22_prev[50];
- uint8_t phase_hist;
- complex_t ipd_prev[20][2];
- complex_t opd_prev[20][2];
-
-} ps_info;
-
-/* ps_syntax.c */
-uint16_t ps_data(ps_info *ps, bitfile *ld, uint8_t *header);
-
-/* ps_dec.c */
-ps_info *ps_init(uint8_t sr_index);
-void ps_free(ps_info *ps);
-
-uint8_t ps_decode(ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38][64]);
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
diff --git a/src/libfaad/ps_syntax.c b/src/libfaad/ps_syntax.c
deleted file mode 100644
index fc2f9e7f2..000000000
--- a/src/libfaad/ps_syntax.c
+++ /dev/null
@@ -1,545 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR and PS decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: ps_syntax.c,v 1.1 2005/10/30 00:50:19 tmmm Exp $
-**/
-
-#include "common.h"
-
-#ifdef PS_DEC
-
-#include "bits.h"
-#include "ps_dec.h"
-
-/* type definitaions */
-typedef const int8_t (*ps_huff_tab)[2];
-
-/* static data tables */
-static const uint8_t nr_iid_par_tab[] = {
- 10, 20, 34, 10, 20, 34, 0, 0
-};
-static const uint8_t nr_ipdopd_par_tab[] = {
- 5, 11, 17, 5, 11, 17, 0, 0
-};
-static const uint8_t nr_icc_par_tab[] = {
- 10, 20, 34, 10, 20, 34, 0, 0
-};
-static const uint8_t num_env_tab[][4] = {
- { 0, 1, 2, 4 },
- { 1, 2, 3, 4 }
-};
-
-/* binary lookup huffman tables */
-static const int8_t f_huff_iid_def[][2] = {
- { /*0*/ -31, 1 }, /* index 0: 1 bits: x */
- { 2, 3 }, /* index 1: 2 bits: 1x */
- { /*1*/ -30, /*-1*/ -32 }, /* index 2: 3 bits: 10x */
- { 4, 5 }, /* index 3: 3 bits: 11x */
- { /*2*/ -29, /*-2*/ -33 }, /* index 4: 4 bits: 110x */
- { 6, 7 }, /* index 5: 4 bits: 111x */
- { /*3*/ -28, /*-3*/ -34 }, /* index 6: 5 bits: 1110x */
- { 8, 9 }, /* index 7: 5 bits: 1111x */
- { /*-4*/ -35, /*4*/ -27 }, /* index 8: 6 bits: 11110x */
- { /*5*/ -26, 10 }, /* index 9: 6 bits: 11111x */
- { /*-5*/ -36, 11 }, /* index 10: 7 bits: 111111x */
- { /*6*/ -25, 12 }, /* index 11: 8 bits: 1111111x */
- { /*-6*/ -37, 13 }, /* index 12: 9 bits: 11111111x */
- { /*-7*/ -38, 14 }, /* index 13: 10 bits: 111111111x */
- { /*7*/ -24, 15 }, /* index 14: 11 bits: 1111111111x */
- { 16, 17 }, /* index 15: 12 bits: 11111111111x */
- { /*8*/ -23, /*-8*/ -39 }, /* index 16: 13 bits: 111111111110x */
- { 18, 19 }, /* index 17: 13 bits: 111111111111x */
- { /*9*/ -22, /*10*/ -21 }, /* index 18: 14 bits: 1111111111110x */
- { 20, 21 }, /* index 19: 14 bits: 1111111111111x */
- { /*-9*/ -40, /*11*/ -20 }, /* index 20: 15 bits: 11111111111110x */
- { 22, 23 }, /* index 21: 15 bits: 11111111111111x */
- { /*-10*/ -41, 24 }, /* index 22: 16 bits: 111111111111110x */
- { 25, 26 }, /* index 23: 16 bits: 111111111111111x */
- { /*-11*/ -42, /*-14*/ -45 }, /* index 24: 17 bits: 1111111111111101x */
- { /*-13*/ -44, /*-12*/ -43 }, /* index 25: 17 bits: 1111111111111110x */
- { /*12*/ -19, 27 }, /* index 26: 17 bits: 1111111111111111x */
- { /*13*/ -18, /*14*/ -17 } /* index 27: 18 bits: 11111111111111111x */
-};
-
-static const int8_t t_huff_iid_def[][2] = {
- { /*0*/ -31, 1 }, /* index 0: 1 bits: x */
- { /*-1*/ -32, 2 }, /* index 1: 2 bits: 1x */
- { /*1*/ -30, 3 }, /* index 2: 3 bits: 11x */
- { /*-2*/ -33, 4 }, /* index 3: 4 bits: 111x */
- { /*2*/ -29, 5 }, /* index 4: 5 bits: 1111x */
- { /*-3*/ -34, 6 }, /* index 5: 6 bits: 11111x */
- { /*3*/ -28, 7 }, /* index 6: 7 bits: 111111x */
- { /*-4*/ -35, 8 }, /* index 7: 8 bits: 1111111x */
- { /*4*/ -27, 9 }, /* index 8: 9 bits: 11111111x */
- { /*-5*/ -36, 10 }, /* index 9: 10 bits: 111111111x */
- { /*5*/ -26, 11 }, /* index 10: 11 bits: 1111111111x */
- { /*-6*/ -37, 12 }, /* index 11: 12 bits: 11111111111x */
- { /*6*/ -25, 13 }, /* index 12: 13 bits: 111111111111x */
- { /*7*/ -24, 14 }, /* index 13: 14 bits: 1111111111111x */
- { /*-7*/ -38, 15 }, /* index 14: 15 bits: 11111111111111x */
- { 16, 17 }, /* index 15: 16 bits: 111111111111111x */
- { /*8*/ -23, /*-8*/ -39 }, /* index 16: 17 bits: 1111111111111110x */
- { 18, 19 }, /* index 17: 17 bits: 1111111111111111x */
- { 20, 21 }, /* index 18: 18 bits: 11111111111111110x */
- { 22, 23 }, /* index 19: 18 bits: 11111111111111111x */
- { /*9*/ -22, /*-14*/ -45 }, /* index 20: 19 bits: 111111111111111100x */
- { /*-13*/ -44, /*-12*/ -43 }, /* index 21: 19 bits: 111111111111111101x */
- { 24, 25 }, /* index 22: 19 bits: 111111111111111110x */
- { 26, 27 }, /* index 23: 19 bits: 111111111111111111x */
- { /*-11*/ -42, /*-10*/ -41 }, /* index 24: 20 bits: 1111111111111111100x */
- { /*-9*/ -40, /*10*/ -21 }, /* index 25: 20 bits: 1111111111111111101x */
- { /*11*/ -20, /*12*/ -19 }, /* index 26: 20 bits: 1111111111111111110x */
- { /*13*/ -18, /*14*/ -17 } /* index 27: 20 bits: 1111111111111111111x */
-};
-
-static const int8_t f_huff_iid_fine[][2] = {
- { 1, /*0*/ -31 }, /* index 0: 1 bits: x */
- { 2, 3 }, /* index 1: 2 bits: 0x */
- { 4, /*-1*/ -32 }, /* index 2: 3 bits: 00x */
- { /*1*/ -30, 5 }, /* index 3: 3 bits: 01x */
- { /*-2*/ -33, /*2*/ -29 }, /* index 4: 4 bits: 000x */
- { 6, 7 }, /* index 5: 4 bits: 011x */
- { /*-3*/ -34, /*3*/ -28 }, /* index 6: 5 bits: 0110x */
- { 8, 9 }, /* index 7: 5 bits: 0111x */
- { /*-4*/ -35, /*4*/ -27 }, /* index 8: 6 bits: 01110x */
- { 10, 11 }, /* index 9: 6 bits: 01111x */
- { /*-5*/ -36, /*5*/ -26 }, /* index 10: 7 bits: 011110x */
- { 12, 13 }, /* index 11: 7 bits: 011111x */
- { /*-6*/ -37, /*6*/ -25 }, /* index 12: 8 bits: 0111110x */
- { 14, 15 }, /* index 13: 8 bits: 0111111x */
- { /*7*/ -24, 16 }, /* index 14: 9 bits: 01111110x */
- { 17, 18 }, /* index 15: 9 bits: 01111111x */
- { 19, /*-8*/ -39 }, /* index 16: 10 bits: 011111101x */
- { /*8*/ -23, 20 }, /* index 17: 10 bits: 011111110x */
- { 21, /*-7*/ -38 }, /* index 18: 10 bits: 011111111x */
- { /*10*/ -21, 22 }, /* index 19: 11 bits: 0111111010x */
- { 23, /*-9*/ -40 }, /* index 20: 11 bits: 0111111101x */
- { /*9*/ -22, 24 }, /* index 21: 11 bits: 0111111110x */
- { /*-11*/ -42, /*11*/ -20 }, /* index 22: 12 bits: 01111110101x */
- { 25, 26 }, /* index 23: 12 bits: 01111111010x */
- { 27, /*-10*/ -41 }, /* index 24: 12 bits: 01111111101x */
- { 28, /*-12*/ -43 }, /* index 25: 13 bits: 011111110100x */
- { /*12*/ -19, 29 }, /* index 26: 13 bits: 011111110101x */
- { 30, 31 }, /* index 27: 13 bits: 011111111010x */
- { 32, /*-14*/ -45 }, /* index 28: 14 bits: 0111111101000x */
- { /*14*/ -17, 33 }, /* index 29: 14 bits: 0111111101011x */
- { 34, /*-13*/ -44 }, /* index 30: 14 bits: 0111111110100x */
- { /*13*/ -18, 35 }, /* index 31: 14 bits: 0111111110101x */
- { 36, 37 }, /* index 32: 15 bits: 01111111010000x */
- { 38, /*-15*/ -46 }, /* index 33: 15 bits: 01111111010111x */
- { /*15*/ -16, 39 }, /* index 34: 15 bits: 01111111101000x */
- { 40, 41 }, /* index 35: 15 bits: 01111111101011x */
- { 42, 43 }, /* index 36: 16 bits: 011111110100000x */
- { /*-17*/ -48, /*17*/ -14 }, /* index 37: 16 bits: 011111110100001x */
- { 44, 45 }, /* index 38: 16 bits: 011111110101110x */
- { 46, 47 }, /* index 39: 16 bits: 011111111010001x */
- { 48, 49 }, /* index 40: 16 bits: 011111111010110x */
- { /*-16*/ -47, /*16*/ -15 }, /* index 41: 16 bits: 011111111010111x */
- { /*-21*/ -52, /*21*/ -10 }, /* index 42: 17 bits: 0111111101000000x */
- { /*-19*/ -50, /*19*/ -12 }, /* index 43: 17 bits: 0111111101000001x */
- { /*-18*/ -49, /*18*/ -13 }, /* index 44: 17 bits: 0111111101011100x */
- { 50, 51 }, /* index 45: 17 bits: 0111111101011101x */
- { 52, 53 }, /* index 46: 17 bits: 0111111110100010x */
- { 54, 55 }, /* index 47: 17 bits: 0111111110100011x */
- { 56, 57 }, /* index 48: 17 bits: 0111111110101100x */
- { 58, 59 }, /* index 49: 17 bits: 0111111110101101x */
- { /*-26*/ -57, /*-25*/ -56 }, /* index 50: 18 bits: 01111111010111010x */
- { /*-28*/ -59, /*-27*/ -58 }, /* index 51: 18 bits: 01111111010111011x */
- { /*-22*/ -53, /*22*/ -9 }, /* index 52: 18 bits: 01111111101000100x */
- { /*-24*/ -55, /*-23*/ -54 }, /* index 53: 18 bits: 01111111101000101x */
- { /*25*/ -6, /*26*/ -5 }, /* index 54: 18 bits: 01111111101000110x */
- { /*23*/ -8, /*24*/ -7 }, /* index 55: 18 bits: 01111111101000111x */
- { /*29*/ -2, /*30*/ -1 }, /* index 56: 18 bits: 01111111101011000x */
- { /*27*/ -4, /*28*/ -3 }, /* index 57: 18 bits: 01111111101011001x */
- { /*-30*/ -61, /*-29*/ -60 }, /* index 58: 18 bits: 01111111101011010x */
- { /*-20*/ -51, /*20*/ -11 } /* index 59: 18 bits: 01111111101011011x */
-};
-
-static const int8_t t_huff_iid_fine[][2] = {
- { 1, /*0*/ -31 }, /* index 0: 1 bits: x */
- { /*1*/ -30, 2 }, /* index 1: 2 bits: 0x */
- { 3, /*-1*/ -32 }, /* index 2: 3 bits: 01x */
- { 4, 5 }, /* index 3: 4 bits: 010x */
- { 6, 7 }, /* index 4: 5 bits: 0100x */
- { /*-2*/ -33, /*2*/ -29 }, /* index 5: 5 bits: 0101x */
- { 8, /*-3*/ -34 }, /* index 6: 6 bits: 01000x */
- { /*3*/ -28, 9 }, /* index 7: 6 bits: 01001x */
- { /*-4*/ -35, /*4*/ -27 }, /* index 8: 7 bits: 010000x */
- { 10, 11 }, /* index 9: 7 bits: 010011x */
- { /*5*/ -26, 12 }, /* index 10: 8 bits: 0100110x */
- { 13, 14 }, /* index 11: 8 bits: 0100111x */
- { /*-6*/ -37, /*6*/ -25 }, /* index 12: 9 bits: 01001101x */
- { 15, 16 }, /* index 13: 9 bits: 01001110x */
- { 17, /*-5*/ -36 }, /* index 14: 9 bits: 01001111x */
- { 18, /*-7*/ -38 }, /* index 15: 10 bits: 010011100x */
- { /*7*/ -24, 19 }, /* index 16: 10 bits: 010011101x */
- { 20, 21 }, /* index 17: 10 bits: 010011110x */
- { /*9*/ -22, 22 }, /* index 18: 11 bits: 0100111000x */
- { 23, 24 }, /* index 19: 11 bits: 0100111011x */
- { /*-8*/ -39, /*8*/ -23 }, /* index 20: 11 bits: 0100111100x */
- { 25, 26 }, /* index 21: 11 bits: 0100111101x */
- { /*11*/ -20, 27 }, /* index 22: 12 bits: 01001110001x */
- { 28, 29 }, /* index 23: 12 bits: 01001110110x */
- { /*-10*/ -41, /*10*/ -21 }, /* index 24: 12 bits: 01001110111x */
- { 30, 31 }, /* index 25: 12 bits: 01001111010x */
- { 32, /*-9*/ -40 }, /* index 26: 12 bits: 01001111011x */
- { 33, /*-13*/ -44 }, /* index 27: 13 bits: 010011100011x */
- { /*13*/ -18, 34 }, /* index 28: 13 bits: 010011101100x */
- { 35, 36 }, /* index 29: 13 bits: 010011101101x */
- { 37, /*-12*/ -43 }, /* index 30: 13 bits: 010011110100x */
- { /*12*/ -19, 38 }, /* index 31: 13 bits: 010011110101x */
- { 39, /*-11*/ -42 }, /* index 32: 13 bits: 010011110110x */
- { 40, 41 }, /* index 33: 14 bits: 0100111000110x */
- { 42, 43 }, /* index 34: 14 bits: 0100111011001x */
- { 44, 45 }, /* index 35: 14 bits: 0100111011010x */
- { 46, /*-15*/ -46 }, /* index 36: 14 bits: 0100111011011x */
- { /*15*/ -16, 47 }, /* index 37: 14 bits: 0100111101000x */
- { /*-14*/ -45, /*14*/ -17 }, /* index 38: 14 bits: 0100111101011x */
- { 48, 49 }, /* index 39: 14 bits: 0100111101100x */
- { /*-21*/ -52, /*-20*/ -51 }, /* index 40: 15 bits: 01001110001100x */
- { /*18*/ -13, /*19*/ -12 }, /* index 41: 15 bits: 01001110001101x */
- { /*-19*/ -50, /*-18*/ -49 }, /* index 42: 15 bits: 01001110110010x */
- { 50, 51 }, /* index 43: 15 bits: 01001110110011x */
- { 52, 53 }, /* index 44: 15 bits: 01001110110100x */
- { 54, 55 }, /* index 45: 15 bits: 01001110110101x */
- { 56, /*-17*/ -48 }, /* index 46: 15 bits: 01001110110110x */
- { /*17*/ -14, 57 }, /* index 47: 15 bits: 01001111010001x */
- { 58, /*-16*/ -47 }, /* index 48: 15 bits: 01001111011000x */
- { /*16*/ -15, 59 }, /* index 49: 15 bits: 01001111011001x */
- { /*-26*/ -57, /*26*/ -5 }, /* index 50: 16 bits: 010011101100110x */
- { /*-28*/ -59, /*-27*/ -58 }, /* index 51: 16 bits: 010011101100111x */
- { /*29*/ -2, /*30*/ -1 }, /* index 52: 16 bits: 010011101101000x */
- { /*27*/ -4, /*28*/ -3 }, /* index 53: 16 bits: 010011101101001x */
- { /*-30*/ -61, /*-29*/ -60 }, /* index 54: 16 bits: 010011101101010x */
- { /*-25*/ -56, /*25*/ -6 }, /* index 55: 16 bits: 010011101101011x */
- { /*-24*/ -55, /*24*/ -7 }, /* index 56: 16 bits: 010011101101100x */
- { /*-23*/ -54, /*23*/ -8 }, /* index 57: 16 bits: 010011110100011x */
- { /*-22*/ -53, /*22*/ -9 }, /* index 58: 16 bits: 010011110110000x */
- { /*20*/ -11, /*21*/ -10 } /* index 59: 16 bits: 010011110110011x */
-};
-
-static const int8_t f_huff_icc[][2] = {
- { /*0*/ -31, 1 }, /* index 0: 1 bits: x */
- { /*1*/ -30, 2 }, /* index 1: 2 bits: 1x */
- { /*-1*/ -32, 3 }, /* index 2: 3 bits: 11x */
- { /*2*/ -29, 4 }, /* index 3: 4 bits: 111x */
- { /*-2*/ -33, 5 }, /* index 4: 5 bits: 1111x */
- { /*3*/ -28, 6 }, /* index 5: 6 bits: 11111x */
- { /*-3*/ -34, 7 }, /* index 6: 7 bits: 111111x */
- { /*4*/ -27, 8 }, /* index 7: 8 bits: 1111111x */
- { /*5*/ -26, 9 }, /* index 8: 9 bits: 11111111x */
- { /*-4*/ -35, 10 }, /* index 9: 10 bits: 111111111x */
- { /*6*/ -25, 11 }, /* index 10: 11 bits: 1111111111x */
- { /*-5*/ -36, 12 }, /* index 11: 12 bits: 11111111111x */
- { /*7*/ -24, 13 }, /* index 12: 13 bits: 111111111111x */
- { /*-6*/ -37, /*-7*/ -38 } /* index 13: 14 bits: 1111111111111x */
-};
-
-static const int8_t t_huff_icc[][2] = {
- { /*0*/ -31, 1 }, /* index 0: 1 bits: x */
- { /*1*/ -30, 2 }, /* index 1: 2 bits: 1x */
- { /*-1*/ -32, 3 }, /* index 2: 3 bits: 11x */
- { /*2*/ -29, 4 }, /* index 3: 4 bits: 111x */
- { /*-2*/ -33, 5 }, /* index 4: 5 bits: 1111x */
- { /*3*/ -28, 6 }, /* index 5: 6 bits: 11111x */
- { /*-3*/ -34, 7 }, /* index 6: 7 bits: 111111x */
- { /*4*/ -27, 8 }, /* index 7: 8 bits: 1111111x */
- { /*-4*/ -35, 9 }, /* index 8: 9 bits: 11111111x */
- { /*5*/ -26, 10 }, /* index 9: 10 bits: 111111111x */
- { /*-5*/ -36, 11 }, /* index 10: 11 bits: 1111111111x */
- { /*6*/ -25, 12 }, /* index 11: 12 bits: 11111111111x */
- { /*-6*/ -37, 13 }, /* index 12: 13 bits: 111111111111x */
- { /*-7*/ -38, /*7*/ -24 } /* index 13: 14 bits: 1111111111111x */
-};
-
-static const int8_t f_huff_ipd[][2] = {
- { 1, /*0*/ -31 }, /* index 0: 1 bits: x */
- { 2, 3 }, /* index 1: 2 bits: 0x */
- { /*1*/ -30, 4 }, /* index 2: 3 bits: 00x */
- { 5, 6 }, /* index 3: 3 bits: 01x */
- { /*4*/ -27, /*5*/ -26 }, /* index 4: 4 bits: 001x */
- { /*3*/ -28, /*6*/ -25 }, /* index 5: 4 bits: 010x */
- { /*2*/ -29, /*7*/ -24 } /* index 6: 4 bits: 011x */
-};
-
-static const int8_t t_huff_ipd[][2] = {
- { 1, /*0*/ -31 }, /* index 0: 1 bits: x */
- { 2, 3 }, /* index 1: 2 bits: 0x */
- { 4, 5 }, /* index 2: 3 bits: 00x */
- { /*1*/ -30, /*7*/ -24 }, /* index 3: 3 bits: 01x */
- { /*5*/ -26, 6 }, /* index 4: 4 bits: 000x */
- { /*2*/ -29, /*6*/ -25 }, /* index 5: 4 bits: 001x */
- { /*4*/ -27, /*3*/ -28 } /* index 6: 5 bits: 0001x */
-};
-
-static const int8_t f_huff_opd[][2] = {
- { 1, /*0*/ -31 }, /* index 0: 1 bits: x */
- { 2, 3 }, /* index 1: 2 bits: 0x */
- { /*7*/ -24, /*1*/ -30 }, /* index 2: 3 bits: 00x */
- { 4, 5 }, /* index 3: 3 bits: 01x */
- { /*3*/ -28, /*6*/ -25 }, /* index 4: 4 bits: 010x */
- { /*2*/ -29, 6 }, /* index 5: 4 bits: 011x */
- { /*5*/ -26, /*4*/ -27 } /* index 6: 5 bits: 0111x */
-};
-
-static const int8_t t_huff_opd[][2] = {
- { 1, /*0*/ -31 }, /* index 0: 1 bits: x */
- { 2, 3 }, /* index 1: 2 bits: 0x */
- { 4, 5 }, /* index 2: 3 bits: 00x */
- { /*1*/ -30, /*7*/ -24 }, /* index 3: 3 bits: 01x */
- { /*5*/ -26, 6 }, /* index 4: 4 bits: 000x */
- { /*2*/ -29, /*6*/ -25 }, /* index 5: 4 bits: 001x */
- { /*4*/ -27, /*3*/ -28 } /* index 6: 5 bits: 0001x */
-};
-
-/* static function declarations */
-static uint16_t ps_extension(ps_info *ps, bitfile *ld,
- const uint8_t ps_extension_id,
- const uint16_t num_bits_left);
-static void huff_data(bitfile *ld, const uint8_t dt, const uint8_t nr_par,
- ps_huff_tab t_huff, ps_huff_tab f_huff, int8_t *par);
-static INLINE int8_t ps_huff_dec(bitfile *ld, ps_huff_tab t_huff);
-
-
-uint16_t ps_data(ps_info *ps, bitfile *ld, uint8_t *header)
-{
- uint8_t tmp, n;
- uint16_t bits = (uint16_t)faad_get_processed_bits(ld);
-
- *header = 0;
-
- /* check for new PS header */
- if (faad_get1bit(ld
- DEBUGVAR(1,1000,"ps_data(): enable_ps_header")))
- {
- *header = 1;
-
- ps->header_read = 1;
-
- ps->use34hybrid_bands = 0;
-
- /* Inter-channel Intensity Difference (IID) parameters enabled */
- ps->enable_iid = (uint8_t)faad_get1bit(ld
- DEBUGVAR(1,1001,"ps_data(): enable_iid"));
-
- if (ps->enable_iid)
- {
- ps->iid_mode = (uint8_t)faad_getbits(ld, 3
- DEBUGVAR(1,1002,"ps_data(): iid_mode"));
-
- ps->nr_iid_par = nr_iid_par_tab[ps->iid_mode];
- ps->nr_ipdopd_par = nr_ipdopd_par_tab[ps->iid_mode];
-
- if (ps->iid_mode == 2 || ps->iid_mode == 5)
- ps->use34hybrid_bands = 1;
-
- /* IPD freq res equal to IID freq res */
- ps->ipd_mode = ps->iid_mode;
- }
-
- /* Inter-channel Coherence (ICC) parameters enabled */
- ps->enable_icc = (uint8_t)faad_get1bit(ld
- DEBUGVAR(1,1003,"ps_data(): enable_icc"));
-
- if (ps->enable_icc)
- {
- ps->icc_mode = (uint8_t)faad_getbits(ld, 3
- DEBUGVAR(1,1004,"ps_data(): icc_mode"));
-
- ps->nr_icc_par = nr_icc_par_tab[ps->icc_mode];
-
- if (ps->icc_mode == 2 || ps->icc_mode == 5)
- ps->use34hybrid_bands = 1;
- }
-
- /* PS extension layer enabled */
- ps->enable_ext = (uint8_t)faad_get1bit(ld
- DEBUGVAR(1,1005,"ps_data(): enable_ext"));
- }
-
- /* we are here, but no header has been read yet */
- if (ps->header_read == 0)
- return 1;
-
- ps->frame_class = (uint8_t)faad_get1bit(ld
- DEBUGVAR(1,1006,"ps_data(): frame_class"));
- tmp = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,1007,"ps_data(): num_env_idx"));
-
- ps->num_env = num_env_tab[ps->frame_class][tmp];
-
- if (ps->frame_class)
- {
- for (n = 1; n < ps->num_env+1; n++)
- {
- ps->border_position[n] = (uint8_t)faad_getbits(ld, 5
- DEBUGVAR(1,1008,"ps_data(): border_position"));
- }
- }
-
- if (ps->enable_iid)
- {
- for (n = 0; n < ps->num_env; n++)
- {
- ps->iid_dt[n] = (uint8_t)faad_get1bit(ld
- DEBUGVAR(1,1009,"ps_data(): iid_dt"));
-
- /* iid_data */
- if (ps->iid_mode < 3)
- {
- huff_data(ld, ps->iid_dt[n], ps->nr_iid_par, t_huff_iid_def,
- f_huff_iid_def, ps->iid_index[n]);
- } else {
- huff_data(ld, ps->iid_dt[n], ps->nr_iid_par, t_huff_iid_fine,
- f_huff_iid_fine, ps->iid_index[n]);
- }
- }
- }
-
- if (ps->enable_icc)
- {
- for (n = 0; n < ps->num_env; n++)
- {
- ps->icc_dt[n] = (uint8_t)faad_get1bit(ld
- DEBUGVAR(1,1010,"ps_data(): icc_dt"));
-
- /* icc_data */
- huff_data(ld, ps->icc_dt[n], ps->nr_icc_par, t_huff_icc,
- f_huff_icc, ps->icc_index[n]);
- }
- }
-
- if (ps->enable_ext)
- {
- uint16_t num_bits_left;
- uint16_t cnt = (uint16_t)faad_getbits(ld, 4
- DEBUGVAR(1,1011,"ps_data(): ps_extension_size"));
- if (cnt == 15)
- {
- cnt += (uint16_t)faad_getbits(ld, 8
- DEBUGVAR(1,1012,"ps_data(): esc_count"));
- }
-
- num_bits_left = 8 * cnt;
- while (num_bits_left > 7)
- {
- uint8_t ps_extension_id = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,1013,"ps_data(): ps_extension_size"));
-
- num_bits_left -= 2;
- num_bits_left -= ps_extension(ps, ld, ps_extension_id, num_bits_left);
- }
-
- faad_getbits(ld, num_bits_left
- DEBUGVAR(1,1014,"ps_data(): fill_bits"));
- }
-
- bits = (uint16_t)faad_get_processed_bits(ld) - bits;
-
- ps->ps_data_available = 1;
-
- return bits;
-}
-
-static uint16_t ps_extension(ps_info *ps, bitfile *ld,
- const uint8_t ps_extension_id,
- const uint16_t num_bits_left)
-{
- uint8_t n;
- uint16_t bits = (uint16_t)faad_get_processed_bits(ld);
-
- if (ps_extension_id == 0)
- {
- ps->enable_ipdopd = (uint8_t)faad_get1bit(ld
- DEBUGVAR(1,1015,"ps_extension(): enable_ipdopd"));
-
- if (ps->enable_ipdopd)
- {
- for (n = 0; n < ps->num_env; n++)
- {
- ps->ipd_dt[n] = (uint8_t)faad_get1bit(ld
- DEBUGVAR(1,1016,"ps_extension(): ipd_dt"));
-
- /* ipd_data */
- huff_data(ld, ps->ipd_dt[n], ps->nr_ipdopd_par, t_huff_ipd,
- f_huff_ipd, ps->ipd_index[n]);
-
- ps->opd_dt[n] = (uint8_t)faad_get1bit(ld
- DEBUGVAR(1,1017,"ps_extension(): opd_dt"));
-
- /* opd_data */
- huff_data(ld, ps->opd_dt[n], ps->nr_ipdopd_par, t_huff_opd,
- f_huff_opd, ps->opd_index[n]);
- }
- }
- faad_get1bit(ld
- DEBUGVAR(1,1018,"ps_extension(): reserved_ps"));
- }
-
- /* return number of bits read */
- bits = (uint16_t)faad_get_processed_bits(ld) - bits;
-
- return bits;
-}
-
-/* read huffman data coded in either the frequency or the time direction */
-static void huff_data(bitfile *ld, const uint8_t dt, const uint8_t nr_par,
- ps_huff_tab t_huff, ps_huff_tab f_huff, int8_t *par)
-{
- uint8_t n;
-
- if (dt)
- {
- /* coded in time direction */
- for (n = 0; n < nr_par; n++)
- {
- par[n] = ps_huff_dec(ld, t_huff);
- }
- } else {
- /* coded in frequency direction */
- par[0] = ps_huff_dec(ld, f_huff);
-
- for (n = 1; n < nr_par; n++)
- {
- par[n] = ps_huff_dec(ld, f_huff);
- }
- }
-}
-
-/* binary search huffman decoding */
-static INLINE int8_t ps_huff_dec(bitfile *ld, ps_huff_tab t_huff)
-{
- uint8_t bit;
- int16_t index = 0;
-
- while (index >= 0)
- {
- bit = (uint8_t)faad_get1bit(ld);
- index = t_huff[index][bit];
- }
-
- return index + 31;
-}
-
-#endif
diff --git a/src/libfaad/ps_tables.h b/src/libfaad/ps_tables.h
deleted file mode 100644
index c71489617..000000000
--- a/src/libfaad/ps_tables.h
+++ /dev/null
@@ -1,547 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: ps_tables.h,v 1.1 2005/10/30 00:50:19 tmmm Exp $
-**/
-
-#ifndef __PS_TABLES_H__
-#define __PS_TABLES_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef _MSC_VER
-#pragma warning(disable:4305)
-#pragma warning(disable:4244)
-#endif
-
-#if 0
-#if 0
-float f_center_20[12] = {
- 0.5/4, 1.5/4, 2.5/4, 3.5/4,
- 4.5/4*0, 5.5/4*0, -1.5/4, -0.5/4,
- 3.5/2, 2.5/2, 4.5/2, 5.5/2
-};
-#else
-float f_center_20[12] = {
- 0.5/8, 1.5/8, 2.5/8, 3.5/8,
- 4.5/8*0, 5.5/8*0, -1.5/8, -0.5/8,
- 3.5/4, 2.5/4, 4.5/4, 5.5/4
-};
-#endif
-
-float f_center_34[32] = {
- 1/12, 3/12, 5/12, 7/12,
- 9/12, 11/12, 13/12, 15/12,
- 17/12, -5/12, -3/12, -1/12,
- 17/8, 19/8, 5/8, 7/8,
- 9/8, 11/8, 13/8, 15/8,
- 9/4, 11/4, 13/4, 7/4,
- 17/4, 11/4, 13/4, 15/4,
- 17/4, 19/4, 21/4, 15/4
-};
-
-static const real_t frac_delay_q[] = {
- FRAC_CONST(0.43),
- FRAC_CONST(0.75),
- FRAC_CONST(0.347)
-};
-#endif
-
-/* RE(ps->Phi_Fract_Qmf[j]) = (float)cos(M_PI*(j+0.5)*(0.39)); */
-/* IM(ps->Phi_Fract_Qmf[j]) = (float)sin(M_PI*(j+0.5)*(0.39)); */
-static const complex_t Phi_Fract_Qmf[] = {
- { FRAC_CONST(0.8181497455), FRAC_CONST(0.5750052333) },
- { FRAC_CONST(-0.2638730407), FRAC_CONST(0.9645574093) },
- { FRAC_CONST(-0.9969173074), FRAC_CONST(0.0784590989) },
- { FRAC_CONST(-0.4115143716), FRAC_CONST(-0.9114032984) },
- { FRAC_CONST(0.7181262970), FRAC_CONST(-0.6959127784) },
- { FRAC_CONST(0.8980275989), FRAC_CONST(0.4399391711) },
- { FRAC_CONST(-0.1097343117), FRAC_CONST(0.9939609766) },
- { FRAC_CONST(-0.9723699093), FRAC_CONST(0.2334453613) },
- { FRAC_CONST(-0.5490227938), FRAC_CONST(-0.8358073831) },
- { FRAC_CONST(0.6004202366), FRAC_CONST(-0.7996846437) },
- { FRAC_CONST(0.9557930231), FRAC_CONST(0.2940403223) },
- { FRAC_CONST(0.0471064523), FRAC_CONST(0.9988898635) },
- { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) },
- { FRAC_CONST(-0.6730124950), FRAC_CONST(-0.7396311164) },
- { FRAC_CONST(0.4679298103), FRAC_CONST(-0.8837656379) },
- { FRAC_CONST(0.9900236726), FRAC_CONST(0.1409012377) },
- { FRAC_CONST(0.2027872950), FRAC_CONST(0.9792228341) },
- { FRAC_CONST(-0.8526401520), FRAC_CONST(0.5224985480) },
- { FRAC_CONST(-0.7804304361), FRAC_CONST(-0.6252426505) },
- { FRAC_CONST(0.3239174187), FRAC_CONST(-0.9460853338) },
- { FRAC_CONST(0.9998766184), FRAC_CONST(-0.0157073177) },
- { FRAC_CONST(0.3534748554), FRAC_CONST(0.9354440570) },
- { FRAC_CONST(-0.7604059577), FRAC_CONST(0.6494480371) },
- { FRAC_CONST(-0.8686315417), FRAC_CONST(-0.4954586625) },
- { FRAC_CONST(0.1719291061), FRAC_CONST(-0.9851093292) },
- { FRAC_CONST(0.9851093292), FRAC_CONST(-0.1719291061) },
- { FRAC_CONST(0.4954586625), FRAC_CONST(0.8686315417) },
- { FRAC_CONST(-0.6494480371), FRAC_CONST(0.7604059577) },
- { FRAC_CONST(-0.9354440570), FRAC_CONST(-0.3534748554) },
- { FRAC_CONST(0.0157073177), FRAC_CONST(-0.9998766184) },
- { FRAC_CONST(0.9460853338), FRAC_CONST(-0.3239174187) },
- { FRAC_CONST(0.6252426505), FRAC_CONST(0.7804304361) },
- { FRAC_CONST(-0.5224985480), FRAC_CONST(0.8526401520) },
- { FRAC_CONST(-0.9792228341), FRAC_CONST(-0.2027872950) },
- { FRAC_CONST(-0.1409012377), FRAC_CONST(-0.9900236726) },
- { FRAC_CONST(0.8837656379), FRAC_CONST(-0.4679298103) },
- { FRAC_CONST(0.7396311164), FRAC_CONST(0.6730124950) },
- { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) },
- { FRAC_CONST(-0.9988898635), FRAC_CONST(-0.0471064523) },
- { FRAC_CONST(-0.2940403223), FRAC_CONST(-0.9557930231) },
- { FRAC_CONST(0.7996846437), FRAC_CONST(-0.6004202366) },
- { FRAC_CONST(0.8358073831), FRAC_CONST(0.5490227938) },
- { FRAC_CONST(-0.2334453613), FRAC_CONST(0.9723699093) },
- { FRAC_CONST(-0.9939609766), FRAC_CONST(0.1097343117) },
- { FRAC_CONST(-0.4399391711), FRAC_CONST(-0.8980275989) },
- { FRAC_CONST(0.6959127784), FRAC_CONST(-0.7181262970) },
- { FRAC_CONST(0.9114032984), FRAC_CONST(0.4115143716) },
- { FRAC_CONST(-0.0784590989), FRAC_CONST(0.9969173074) },
- { FRAC_CONST(-0.9645574093), FRAC_CONST(0.2638730407) },
- { FRAC_CONST(-0.5750052333), FRAC_CONST(-0.8181497455) },
- { FRAC_CONST(0.5750052333), FRAC_CONST(-0.8181497455) },
- { FRAC_CONST(0.9645574093), FRAC_CONST(0.2638730407) },
- { FRAC_CONST(0.0784590989), FRAC_CONST(0.9969173074) },
- { FRAC_CONST(-0.9114032984), FRAC_CONST(0.4115143716) },
- { FRAC_CONST(-0.6959127784), FRAC_CONST(-0.7181262970) },
- { FRAC_CONST(0.4399391711), FRAC_CONST(-0.8980275989) },
- { FRAC_CONST(0.9939609766), FRAC_CONST(0.1097343117) },
- { FRAC_CONST(0.2334453613), FRAC_CONST(0.9723699093) },
- { FRAC_CONST(-0.8358073831), FRAC_CONST(0.5490227938) },
- { FRAC_CONST(-0.7996846437), FRAC_CONST(-0.6004202366) },
- { FRAC_CONST(0.2940403223), FRAC_CONST(-0.9557930231) },
- { FRAC_CONST(0.9988898635), FRAC_CONST(-0.0471064523) },
- { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) },
- { FRAC_CONST(-0.7396311164), FRAC_CONST(0.6730124950) }
-};
-
-/* RE(Phi_Fract_SubQmf20[j]) = (float)cos(M_PI*f_center_20[j]*0.39); */
-/* IM(Phi_Fract_SubQmf20[j]) = (float)sin(M_PI*f_center_20[j]*0.39); */
-static const complex_t Phi_Fract_SubQmf20[] = {
- { FRAC_CONST(0.9882950187), FRAC_CONST(0.1525546312) },
- { FRAC_CONST(0.8962930441), FRAC_CONST(0.4434623122) },
- { FRAC_CONST(0.7208535671), FRAC_CONST(0.6930873394) },
- { FRAC_CONST(0.4783087075), FRAC_CONST(0.8781917691) },
- { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) },
- { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) },
- { FRAC_CONST(0.8962930441), FRAC_CONST(-0.4434623122) },
- { FRAC_CONST(0.9882950187), FRAC_CONST(-0.1525546312) },
- { FRAC_CONST(-0.5424415469), FRAC_CONST(0.8400935531) },
- { FRAC_CONST(0.0392598175), FRAC_CONST(0.9992290139) },
- { FRAC_CONST(-0.9268565774), FRAC_CONST(0.3754155636) },
- { FRAC_CONST(-0.9741733670), FRAC_CONST(-0.2258012742) }
-};
-
-/* RE(Phi_Fract_SubQmf34[j]) = (float)cos(M_PI*f_center_34[j]*0.39); */
-/* IM(Phi_Fract_SubQmf34[j]) = (float)sin(M_PI*f_center_34[j]*0.39); */
-static const complex_t Phi_Fract_SubQmf34[] = {
- { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) },
- { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) },
- { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) },
- { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) },
- { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) },
- { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) },
- { FRAC_CONST(0.3387379348), FRAC_CONST(0.9408807755) },
- { FRAC_CONST(0.3387379348), FRAC_CONST(0.9408807755) },
- { FRAC_CONST(0.3387379348), FRAC_CONST(0.9408807755) },
- { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) },
- { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) },
- { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) },
- { FRAC_CONST(-0.7705132365), FRAC_CONST(0.6374239922) },
- { FRAC_CONST(-0.7705132365), FRAC_CONST(0.6374239922) },
- { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) },
- { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) },
- { FRAC_CONST(0.3387379348), FRAC_CONST(0.9408807755) },
- { FRAC_CONST(0.3387379348), FRAC_CONST(0.9408807755) },
- { FRAC_CONST(0.3387379348), FRAC_CONST(0.9408807755) },
- { FRAC_CONST(0.3387379348), FRAC_CONST(0.9408807755) },
- { FRAC_CONST(-0.7705132365), FRAC_CONST(0.6374239922) },
- { FRAC_CONST(-0.7705132365), FRAC_CONST(0.6374239922) },
- { FRAC_CONST(-0.8607420325), FRAC_CONST(-0.5090414286) },
- { FRAC_CONST(0.3387379348), FRAC_CONST(0.9408807755) },
- { FRAC_CONST(0.1873813123), FRAC_CONST(-0.9822872281) },
- { FRAC_CONST(-0.7705132365), FRAC_CONST(0.6374239922) },
- { FRAC_CONST(-0.8607420325), FRAC_CONST(-0.5090414286) },
- { FRAC_CONST(-0.8607420325), FRAC_CONST(-0.5090414286) },
- { FRAC_CONST(0.1873813123), FRAC_CONST(-0.9822872281) },
- { FRAC_CONST(0.1873813123), FRAC_CONST(-0.9822872281) },
- { FRAC_CONST(0.9876883626), FRAC_CONST(-0.1564344615) },
- { FRAC_CONST(-0.8607420325), FRAC_CONST(-0.5090414286) }
-};
-
-/* RE(Q_Fract_allpass_Qmf[j][i]) = (float)cos(M_PI*(j+0.5)*(frac_delay_q[i])); */
-/* IM(Q_Fract_allpass_Qmf[j][i]) = (float)sin(M_PI*(j+0.5)*(frac_delay_q[i])); */
-static const complex_t Q_Fract_allpass_Qmf[][3] = {
- { { FRAC_CONST(0.7804303765), FRAC_CONST(0.6252426505) }, { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(0.8550928831), FRAC_CONST(0.5184748173) } },
- { { FRAC_CONST(-0.4399392009), FRAC_CONST(0.8980275393) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(-0.0643581524), FRAC_CONST(0.9979268909) } },
- { { FRAC_CONST(-0.9723699093), FRAC_CONST(-0.2334454209) }, { FRAC_CONST(0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(-0.9146071672), FRAC_CONST(0.4043435752) } },
- { { FRAC_CONST(0.0157073960), FRAC_CONST(-0.9998766184) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(-0.7814115286), FRAC_CONST(-0.6240159869) } },
- { { FRAC_CONST(0.9792228341), FRAC_CONST(-0.2027871907) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(0.1920081824), FRAC_CONST(-0.9813933372) } },
- { { FRAC_CONST(0.4115142524), FRAC_CONST(0.9114032984) }, { FRAC_CONST(0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(0.9589683414), FRAC_CONST(-0.2835132182) } },
- { { FRAC_CONST(-0.7996847630), FRAC_CONST(0.6004201174) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(0.6947838664), FRAC_CONST(0.7192186117) } },
- { { FRAC_CONST(-0.7604058385), FRAC_CONST(-0.6494481564) }, { FRAC_CONST(0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(-0.3164770305), FRAC_CONST(0.9486001730) } },
- { { FRAC_CONST(0.4679299891), FRAC_CONST(-0.8837655187) }, { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(-0.9874414206), FRAC_CONST(0.1579856575) } },
- { { FRAC_CONST(0.9645573497), FRAC_CONST(0.2638732493) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(-0.5966450572), FRAC_CONST(-0.8025052547) } },
- { { FRAC_CONST(-0.0471066870), FRAC_CONST(0.9988898635) }, { FRAC_CONST(0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.4357025325), FRAC_CONST(-0.9000906944) } },
- { { FRAC_CONST(-0.9851093888), FRAC_CONST(0.1719288528) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(0.9995546937), FRAC_CONST(-0.0298405960) } },
- { { FRAC_CONST(-0.3826831877), FRAC_CONST(-0.9238796234) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(0.4886211455), FRAC_CONST(0.8724960685) } },
- { { FRAC_CONST(0.8181498647), FRAC_CONST(-0.5750049949) }, { FRAC_CONST(0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.5477093458), FRAC_CONST(0.8366686702) } },
- { { FRAC_CONST(0.7396308780), FRAC_CONST(0.6730127335) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.9951074123), FRAC_CONST(-0.0987988561) } },
- { { FRAC_CONST(-0.4954589605), FRAC_CONST(0.8686313629) }, { FRAC_CONST(0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(-0.3725017905), FRAC_CONST(-0.9280315042) } },
- { { FRAC_CONST(-0.9557929039), FRAC_CONST(-0.2940406799) }, { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(0.6506417990), FRAC_CONST(-0.7593847513) } },
- { { FRAC_CONST(0.0784594864), FRAC_CONST(-0.9969173074) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.9741733670), FRAC_CONST(0.2258014232) } },
- { { FRAC_CONST(0.9900237322), FRAC_CONST(-0.1409008205) }, { FRAC_CONST(0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.2502108514), FRAC_CONST(0.9681913853) } },
- { { FRAC_CONST(0.3534744382), FRAC_CONST(0.9354441762) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(-0.7427945137), FRAC_CONST(0.6695194840) } },
- { { FRAC_CONST(-0.8358076215), FRAC_CONST(0.5490224361) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(-0.9370992780), FRAC_CONST(-0.3490629196) } },
- { { FRAC_CONST(-0.7181259394), FRAC_CONST(-0.6959131360) }, { FRAC_CONST(0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.1237744763), FRAC_CONST(-0.9923103452) } },
- { { FRAC_CONST(0.5224990249), FRAC_CONST(-0.8526399136) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(0.8226406574), FRAC_CONST(-0.5685616732) } },
- { { FRAC_CONST(0.9460852146), FRAC_CONST(0.3239179254) }, { FRAC_CONST(0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(0.8844994903), FRAC_CONST(0.4665412009) } },
- { { FRAC_CONST(-0.1097348556), FRAC_CONST(0.9939609170) }, { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(-0.0047125919), FRAC_CONST(0.9999889135) } },
- { { FRAC_CONST(-0.9939610362), FRAC_CONST(0.1097337380) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(-0.8888573647), FRAC_CONST(0.4581840038) } },
- { { FRAC_CONST(-0.3239168525), FRAC_CONST(-0.9460855722) }, { FRAC_CONST(0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(-0.8172453642), FRAC_CONST(-0.5762898922) } },
- { { FRAC_CONST(0.8526405096), FRAC_CONST(-0.5224980116) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(0.1331215799), FRAC_CONST(-0.9910997152) } },
- { { FRAC_CONST(0.6959123611), FRAC_CONST(0.7181267142) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(0.9403476119), FRAC_CONST(-0.3402152061) } },
- { { FRAC_CONST(-0.5490233898), FRAC_CONST(0.8358070254) }, { FRAC_CONST(0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(0.7364512086), FRAC_CONST(0.6764906645) } },
- { { FRAC_CONST(-0.9354437590), FRAC_CONST(-0.3534754813) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.2593250275), FRAC_CONST(0.9657900929) } },
- { { FRAC_CONST(0.1409019381), FRAC_CONST(-0.9900235534) }, { FRAC_CONST(0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(-0.9762582779), FRAC_CONST(0.2166097313) } },
- { { FRAC_CONST(0.9969173670), FRAC_CONST(-0.0784583688) }, { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(-0.6434556246), FRAC_CONST(-0.7654833794) } },
- { { FRAC_CONST(0.2940396070), FRAC_CONST(0.9557932615) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.3812320232), FRAC_CONST(-0.9244794250) } },
- { { FRAC_CONST(-0.8686318994), FRAC_CONST(0.4954580069) }, { FRAC_CONST(0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.9959943891), FRAC_CONST(-0.0894154981) } },
- { { FRAC_CONST(-0.6730118990), FRAC_CONST(-0.7396316528) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(0.5397993922), FRAC_CONST(0.8417937160) } },
- { { FRAC_CONST(0.5750059485), FRAC_CONST(-0.8181492686) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(-0.4968227744), FRAC_CONST(0.8678520322) } },
- { { FRAC_CONST(0.9238792062), FRAC_CONST(0.3826842010) }, { FRAC_CONST(0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.9992290139), FRAC_CONST(-0.0392601527) } },
- { { FRAC_CONST(-0.1719299555), FRAC_CONST(0.9851091504) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.4271997511), FRAC_CONST(-0.9041572809) } },
- { { FRAC_CONST(-0.9988899231), FRAC_CONST(0.0471055657) }, { FRAC_CONST(0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(0.6041822433), FRAC_CONST(-0.7968461514) } },
- { { FRAC_CONST(-0.2638721764), FRAC_CONST(-0.9645576477) }, { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(0.9859085083), FRAC_CONST(0.1672853529) } },
- { { FRAC_CONST(0.8837660551), FRAC_CONST(-0.4679289758) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.3075223565), FRAC_CONST(0.9515408874) } },
- { { FRAC_CONST(0.6494473219), FRAC_CONST(0.7604066133) }, { FRAC_CONST(0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(-0.7015317082), FRAC_CONST(0.7126382589) } },
- { { FRAC_CONST(-0.6004210114), FRAC_CONST(0.7996840477) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(-0.9562535882), FRAC_CONST(-0.2925389707) } },
- { { FRAC_CONST(-0.9114028811), FRAC_CONST(-0.4115152657) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(-0.1827499419), FRAC_CONST(-0.9831594229) } },
- { { FRAC_CONST(0.2027882934), FRAC_CONST(-0.9792225957) }, { FRAC_CONST(0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(0.7872582674), FRAC_CONST(-0.6166234016) } },
- { { FRAC_CONST(0.9998766780), FRAC_CONST(-0.0157062728) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(0.9107555747), FRAC_CONST(0.4129458666) } },
- { { FRAC_CONST(0.2334443331), FRAC_CONST(0.9723701477) }, { FRAC_CONST(0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(0.0549497530), FRAC_CONST(0.9984891415) } },
- { { FRAC_CONST(-0.8980280757), FRAC_CONST(0.4399381876) }, { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(-0.8599416018), FRAC_CONST(0.5103924870) } },
- { { FRAC_CONST(-0.6252418160), FRAC_CONST(-0.7804310918) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(-0.8501682281), FRAC_CONST(-0.5265110731) } },
- { { FRAC_CONST(0.6252435446), FRAC_CONST(-0.7804297209) }, { FRAC_CONST(0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.0737608299), FRAC_CONST(-0.9972759485) } },
- { { FRAC_CONST(0.8980270624), FRAC_CONST(0.4399402142) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(0.9183775187), FRAC_CONST(-0.3957053721) } },
- { { FRAC_CONST(-0.2334465086), FRAC_CONST(0.9723696709) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(0.7754954696), FRAC_CONST(0.6313531399) } },
- { { FRAC_CONST(-0.9998766184), FRAC_CONST(-0.0157085191) }, { FRAC_CONST(0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.2012493610), FRAC_CONST(0.9795400500) } },
- { { FRAC_CONST(-0.2027861029), FRAC_CONST(-0.9792230725) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.9615978599), FRAC_CONST(0.2744622827) } },
- { { FRAC_CONST(0.9114037752), FRAC_CONST(-0.4115132093) }, { FRAC_CONST(0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(-0.6879743338), FRAC_CONST(-0.7257350087) } },
- { { FRAC_CONST(0.6004192233), FRAC_CONST(0.7996854186) }, { FRAC_CONST(0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(0.3254036009), FRAC_CONST(-0.9455752373) } },
- { { FRAC_CONST(-0.6494490504), FRAC_CONST(0.7604051232) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.9888865948), FRAC_CONST(-0.1486719251) } },
- { { FRAC_CONST(-0.8837650418), FRAC_CONST(-0.4679309726) }, { FRAC_CONST(0.9238795042), FRAC_CONST(-0.3826834261) }, { FRAC_CONST(0.5890548825), FRAC_CONST(0.8080930114) } },
- { { FRAC_CONST(0.2638743520), FRAC_CONST(-0.9645570517) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(0.9238795042) }, { FRAC_CONST(-0.4441666007), FRAC_CONST(0.8959442377) } },
- { { FRAC_CONST(0.9988898039), FRAC_CONST(0.0471078083) }, { FRAC_CONST(-0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(-0.9997915030), FRAC_CONST(0.0204183888) } },
- { { FRAC_CONST(0.1719277352), FRAC_CONST(0.9851095676) }, { FRAC_CONST(0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(-0.4803760946), FRAC_CONST(-0.8770626187) } },
- { { FRAC_CONST(-0.9238800406), FRAC_CONST(0.3826821446) }, { FRAC_CONST(-0.9238795042), FRAC_CONST(0.3826834261) }, { FRAC_CONST(0.5555707216), FRAC_CONST(-0.8314692974) } },
- { { FRAC_CONST(-0.5750041008), FRAC_CONST(-0.8181505203) }, { FRAC_CONST(0.3826834261), FRAC_CONST(-0.9238795042) }, { FRAC_CONST(0.9941320419), FRAC_CONST(0.1081734300) } }
-};
-
-/* RE(Q_Fract_allpass_SubQmf20[j][i]) = (float)cos(M_PI*f_center_20[j]*frac_delay_q[i]); */
-/* IM(Q_Fract_allpass_SubQmf20[j][i]) = (float)sin(M_PI*f_center_20[j]*frac_delay_q[i]); */
-static const complex_t Q_Fract_allpass_SubQmf20[][3] = {
- { { FRAC_CONST(0.9857769012), FRAC_CONST(0.1680592746) }, { FRAC_CONST(0.9569403529), FRAC_CONST(0.2902846634) }, { FRAC_CONST(0.9907300472), FRAC_CONST(0.1358452588) } },
- { { FRAC_CONST(0.8744080663), FRAC_CONST(0.4851911962) }, { FRAC_CONST(0.6343932748), FRAC_CONST(0.7730104327) }, { FRAC_CONST(0.9175986052), FRAC_CONST(0.3975082636) } },
- { { FRAC_CONST(0.6642524004), FRAC_CONST(0.7475083470) }, { FRAC_CONST(0.0980171412), FRAC_CONST(0.9951847196) }, { FRAC_CONST(0.7767338753), FRAC_CONST(0.6298289299) } },
- { { FRAC_CONST(0.3790524006), FRAC_CONST(0.9253752232) }, { FRAC_CONST(-0.4713967443), FRAC_CONST(0.8819212914) }, { FRAC_CONST(0.5785340071), FRAC_CONST(0.8156582713) } },
- { { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) } },
- { { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) } },
- { { FRAC_CONST(0.8744080663), FRAC_CONST(-0.4851911962) }, { FRAC_CONST(0.6343932748), FRAC_CONST(-0.7730104327) }, { FRAC_CONST(0.9175986052), FRAC_CONST(-0.3975082636) } },
- { { FRAC_CONST(0.9857769012), FRAC_CONST(-0.1680592746) }, { FRAC_CONST(0.9569403529), FRAC_CONST(-0.2902846634) }, { FRAC_CONST(0.9907300472), FRAC_CONST(-0.1358452588) } },
- { { FRAC_CONST(-0.7126385570), FRAC_CONST(0.7015314102) }, { FRAC_CONST(-0.5555702448), FRAC_CONST(-0.8314695954) }, { FRAC_CONST(-0.3305967748), FRAC_CONST(0.9437720776) } },
- { { FRAC_CONST(-0.1175374240), FRAC_CONST(0.9930684566) }, { FRAC_CONST(-0.9807852507), FRAC_CONST(0.1950903237) }, { FRAC_CONST(0.2066311091), FRAC_CONST(0.9784189463) } },
- { { FRAC_CONST(-0.9947921634), FRAC_CONST(0.1019244045) }, { FRAC_CONST(0.5555702448), FRAC_CONST(-0.8314695954) }, { FRAC_CONST(-0.7720130086), FRAC_CONST(0.6356067061) } },
- { { FRAC_CONST(-0.8400934935), FRAC_CONST(-0.5424416065) }, { FRAC_CONST(0.9807852507), FRAC_CONST(0.1950903237) }, { FRAC_CONST(-0.9896889329), FRAC_CONST(0.1432335079) } }
-};
-
-/* RE(Q_Fract_allpass_SubQmf34[j][i]) = (float)cos(M_PI*f_center_34[j]*frac_delay_q[i]); */
-/* IM(Q_Fract_allpass_SubQmf34[j][i]) = (float)sin(M_PI*f_center_34[j]*frac_delay_q[i]); */
-static const complex_t Q_Fract_allpass_SubQmf34[][3] = {
- { { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) } },
- { { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) } },
- { { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) } },
- { { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) } },
- { { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) } },
- { { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) } },
- { { FRAC_CONST(0.2181432247), FRAC_CONST(0.9759167433) }, { FRAC_CONST(-0.7071067691), FRAC_CONST(0.7071067691) }, { FRAC_CONST(0.4623677433), FRAC_CONST(0.8866882324) } },
- { { FRAC_CONST(0.2181432247), FRAC_CONST(0.9759167433) }, { FRAC_CONST(-0.7071067691), FRAC_CONST(0.7071067691) }, { FRAC_CONST(0.4623677433), FRAC_CONST(0.8866882324) } },
- { { FRAC_CONST(0.2181432247), FRAC_CONST(0.9759167433) }, { FRAC_CONST(-0.7071067691), FRAC_CONST(0.7071067691) }, { FRAC_CONST(0.4623677433), FRAC_CONST(0.8866882324) } },
- { { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) } },
- { { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) } },
- { { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) } },
- { { FRAC_CONST(-0.9048270583), FRAC_CONST(0.4257792532) }, { FRAC_CONST(-0.0000000000), FRAC_CONST(-1.0000000000) }, { FRAC_CONST(-0.5724321604), FRAC_CONST(0.8199520707) } },
- { { FRAC_CONST(-0.9048270583), FRAC_CONST(0.4257792532) }, { FRAC_CONST(-0.0000000000), FRAC_CONST(-1.0000000000) }, { FRAC_CONST(-0.5724321604), FRAC_CONST(0.8199520707) } },
- { { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) } },
- { { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(1.0000000000), FRAC_CONST(0.0000000000) } },
- { { FRAC_CONST(0.2181432247), FRAC_CONST(0.9759167433) }, { FRAC_CONST(-0.7071067691), FRAC_CONST(0.7071067691) }, { FRAC_CONST(0.4623677433), FRAC_CONST(0.8866882324) } },
- { { FRAC_CONST(0.2181432247), FRAC_CONST(0.9759167433) }, { FRAC_CONST(-0.7071067691), FRAC_CONST(0.7071067691) }, { FRAC_CONST(0.4623677433), FRAC_CONST(0.8866882324) } },
- { { FRAC_CONST(0.2181432247), FRAC_CONST(0.9759167433) }, { FRAC_CONST(-0.7071067691), FRAC_CONST(0.7071067691) }, { FRAC_CONST(0.4623677433), FRAC_CONST(0.8866882324) } },
- { { FRAC_CONST(0.2181432247), FRAC_CONST(0.9759167433) }, { FRAC_CONST(-0.7071067691), FRAC_CONST(0.7071067691) }, { FRAC_CONST(0.4623677433), FRAC_CONST(0.8866882324) } },
- { { FRAC_CONST(-0.9048270583), FRAC_CONST(0.4257792532) }, { FRAC_CONST(-0.0000000000), FRAC_CONST(-1.0000000000) }, { FRAC_CONST(-0.5724321604), FRAC_CONST(0.8199520707) } },
- { { FRAC_CONST(-0.9048270583), FRAC_CONST(0.4257792532) }, { FRAC_CONST(-0.0000000000), FRAC_CONST(-1.0000000000) }, { FRAC_CONST(-0.5724321604), FRAC_CONST(0.8199520707) } },
- { { FRAC_CONST(-0.6129069924), FRAC_CONST(-0.7901550531) }, { FRAC_CONST(0.7071067691), FRAC_CONST(0.7071067691) }, { FRAC_CONST(-0.9917160273), FRAC_CONST(-0.1284494549) } },
- { { FRAC_CONST(0.2181432247), FRAC_CONST(0.9759167433) }, { FRAC_CONST(-0.7071067691), FRAC_CONST(0.7071067691) }, { FRAC_CONST(0.4623677433), FRAC_CONST(0.8866882324) } },
- { { FRAC_CONST(0.6374240518), FRAC_CONST(-0.7705131769) }, { FRAC_CONST(-1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(-0.3446428776), FRAC_CONST(-0.9387338758) } },
- { { FRAC_CONST(-0.9048270583), FRAC_CONST(0.4257792532) }, { FRAC_CONST(-0.0000000000), FRAC_CONST(-1.0000000000) }, { FRAC_CONST(-0.5724321604), FRAC_CONST(0.8199520707) } },
- { { FRAC_CONST(-0.6129069924), FRAC_CONST(-0.7901550531) }, { FRAC_CONST(0.7071067691), FRAC_CONST(0.7071067691) }, { FRAC_CONST(-0.9917160273), FRAC_CONST(-0.1284494549) } },
- { { FRAC_CONST(-0.6129069924), FRAC_CONST(-0.7901550531) }, { FRAC_CONST(0.7071067691), FRAC_CONST(0.7071067691) }, { FRAC_CONST(-0.9917160273), FRAC_CONST(-0.1284494549) } },
- { { FRAC_CONST(0.6374240518), FRAC_CONST(-0.7705131769) }, { FRAC_CONST(-1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(-0.3446428776), FRAC_CONST(-0.9387338758) } },
- { { FRAC_CONST(0.6374240518), FRAC_CONST(-0.7705131769) }, { FRAC_CONST(-1.0000000000), FRAC_CONST(0.0000000000) }, { FRAC_CONST(-0.3446428776), FRAC_CONST(-0.9387338758) } },
- { { FRAC_CONST(0.8910064697), FRAC_CONST(0.4539906085) }, { FRAC_CONST(0.7071067691), FRAC_CONST(-0.7071067691) }, { FRAC_CONST(0.6730125546), FRAC_CONST(-0.7396310568) } },
- { { FRAC_CONST(-0.6129069924), FRAC_CONST(-0.7901550531) }, { FRAC_CONST(0.7071067691), FRAC_CONST(0.7071067691) }, { FRAC_CONST(-0.9917160273), FRAC_CONST(-0.1284494549) } }
-};
-
-#if 0
-static float quant_rho[8] =
-{
- FRAC_CONST(1.0), FRAC_CONST(0.937), FRAC_CONST(0.84118), FRAC_CONST(0.60092),
- FRAC_CONST(0.36764), FRAC_CONST(0.0), FRAC_CONST(-0.589), FRAC_CONST(-1.0)
-};
-
-static const uint8_t quant_iid_normal[7] =
-{
- 2, 4, 7, 10, 14, 18, 25
-};
-
-static const uint8_t quant_iid_fine[15] =
-{
- 2, 4, 6, 8, 10, 13, 16, 19, 22, 25, 30, 35, 40, 45, 50
-};
-#endif
-
-static const real_t cos_alphas[] = {
- COEF_CONST(1.0000000000), COEF_CONST(0.9841239700), COEF_CONST(0.9594738210),
- COEF_CONST(0.8946843079), COEF_CONST(0.8269340931), COEF_CONST(0.7071067812),
- COEF_CONST(0.4533210856), COEF_CONST(0.0000000000)
-};
-
-static const real_t sin_alphas[] = {
- COEF_CONST(0.0000000000), COEF_CONST(0.1774824264), COEF_CONST(0.2817977763),
- COEF_CONST(0.4466989918), COEF_CONST(0.5622988580), COEF_CONST(0.7071067812),
- COEF_CONST(0.8913472911), COEF_CONST(1.0000000000)
-};
-
-static const real_t cos_betas_normal[][8] = {
- { COEF_CONST(1.0000000000), COEF_CONST(1.0000000000), COEF_CONST(1.0000000000), COEF_CONST(1.0000000000), COEF_CONST(1.0000000000), COEF_CONST(1.0000000000), COEF_CONST(1.0000000000), COEF_CONST(1.0000000000) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9995871699), COEF_CONST(0.9989419133), COEF_CONST(0.9972204583), COEF_CONST(0.9953790839), COEF_CONST(0.9920112747), COEF_CONST(0.9843408180), COEF_CONST(0.9681727381) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9984497744), COEF_CONST(0.9960279377), COEF_CONST(0.9895738413), COEF_CONST(0.9826814632), COEF_CONST(0.9701058164), COEF_CONST(0.9416098832), COEF_CONST(0.8822105900) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9959398908), COEF_CONST(0.9896038018), COEF_CONST(0.9727589768), COEF_CONST(0.9548355329), COEF_CONST(0.9223070404), COEF_CONST(0.8494349490), COEF_CONST(0.7013005535) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9932417400), COEF_CONST(0.9827071856), COEF_CONST(0.9547730996), COEF_CONST(0.9251668930), COEF_CONST(0.8717461589), COEF_CONST(0.7535520592), COEF_CONST(0.5198827312) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9902068095), COEF_CONST(0.9749613872), COEF_CONST(0.9346538534), COEF_CONST(0.8921231300), COEF_CONST(0.8158851259), COEF_CONST(0.6495964302), COEF_CONST(0.3313370772) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9880510933), COEF_CONST(0.9694670261), COEF_CONST(0.9204347876), COEF_CONST(0.8688622825), COEF_CONST(0.7768516704), COEF_CONST(0.5782161800), COEF_CONST(0.2069970356) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9858996945), COEF_CONST(0.9639898866), COEF_CONST(0.9063034786), COEF_CONST(0.8458214608), COEF_CONST(0.7384262300), COEF_CONST(0.5089811277), COEF_CONST(0.0905465944) }
-};
-
-static const real_t sin_betas_normal[][8] = {
- { COEF_CONST(0.0000000000), COEF_CONST(0.0000000000), COEF_CONST(0.0000000000), COEF_CONST(0.0000000000), COEF_CONST(0.0000000000), COEF_CONST(0.0000000000), COEF_CONST(0.0000000000), COEF_CONST(0.0000000000) },
- { COEF_CONST(0.0000000000), COEF_CONST(-0.0287313368), COEF_CONST(-0.0459897147), COEF_CONST(-0.0745074328), COEF_CONST(-0.0960233266), COEF_CONST(-0.1261492408), COEF_CONST(-0.1762757894), COEF_CONST(-0.2502829383) },
- { COEF_CONST(0.0000000000), COEF_CONST(-0.0556601118), COEF_CONST(-0.0890412670), COEF_CONST(-0.1440264301), COEF_CONST(-0.1853028382), COEF_CONST(-0.2426823129), COEF_CONST(-0.3367058477), COEF_CONST(-0.4708550466) },
- { COEF_CONST(0.0000000000), COEF_CONST(-0.0900207420), COEF_CONST(-0.1438204281), COEF_CONST(-0.2318188366), COEF_CONST(-0.2971348264), COEF_CONST(-0.3864579191), COEF_CONST(-0.5276933461), COEF_CONST(-0.7128657193) },
- { COEF_CONST(0.0000000000), COEF_CONST(-0.1160639735), COEF_CONST(-0.1851663774), COEF_CONST(-0.2973353800), COEF_CONST(-0.3795605619), COEF_CONST(-0.4899577884), COEF_CONST(-0.6573882369), COEF_CONST(-0.8542376401) },
- { COEF_CONST(0.0000000000), COEF_CONST(-0.1396082894), COEF_CONST(-0.2223742196), COEF_CONST(-0.3555589603), COEF_CONST(-0.4517923427), COEF_CONST(-0.5782140273), COEF_CONST(-0.7602792104), COEF_CONST(-0.9435124489) },
- { COEF_CONST(0.0000000000), COEF_CONST(-0.1541266914), COEF_CONST(-0.2452217065), COEF_CONST(-0.3908961522), COEF_CONST(-0.4950538699), COEF_CONST(-0.6296836366), COEF_CONST(-0.8158836002), COEF_CONST(-0.9783415698) },
- { COEF_CONST(0.0000000000), COEF_CONST(-0.1673373610), COEF_CONST(-0.2659389001), COEF_CONST(-0.4226275012), COEF_CONST(-0.5334660781), COEF_CONST(-0.6743342664), COEF_CONST(-0.8607776784), COEF_CONST(-0.9958922202) }
-};
-
-static const real_t cos_betas_fine[][8] = {
- { COEF_CONST(1.0000000000), COEF_CONST(1.0000000000), COEF_CONST(1.0000000000), COEF_CONST(1.0000000000), COEF_CONST(1.0000000000), COEF_CONST(1.0000000000), COEF_CONST(1.0000000000), COEF_CONST(1.0000000000) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9995871699), COEF_CONST(0.9989419133), COEF_CONST(0.9972204583), COEF_CONST(0.9953790839), COEF_CONST(0.9920112747), COEF_CONST(0.9843408180), COEF_CONST(0.9681727381) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9984497744), COEF_CONST(0.9960279377), COEF_CONST(0.9895738413), COEF_CONST(0.9826814632), COEF_CONST(0.9701058164), COEF_CONST(0.9416098832), COEF_CONST(0.8822105900) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9968361371), COEF_CONST(0.9918968104), COEF_CONST(0.9787540479), COEF_CONST(0.9647515190), COEF_CONST(0.9392903010), COEF_CONST(0.8820167114), COEF_CONST(0.7645325390) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9950262915), COEF_CONST(0.9872675041), COEF_CONST(0.9666584578), COEF_CONST(0.9447588606), COEF_CONST(0.9050918405), COEF_CONST(0.8165997379), COEF_CONST(0.6383824796) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9932417400), COEF_CONST(0.9827071856), COEF_CONST(0.9547730996), COEF_CONST(0.9251668930), COEF_CONST(0.8717461589), COEF_CONST(0.7535520592), COEF_CONST(0.5198827312) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9908827998), COEF_CONST(0.9766855904), COEF_CONST(0.9391249214), COEF_CONST(0.8994531782), COEF_CONST(0.8282352693), COEF_CONST(0.6723983174), COEF_CONST(0.3719473225) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9890240165), COEF_CONST(0.9719459866), COEF_CONST(0.9268448110), COEF_CONST(0.8793388536), COEF_CONST(0.7944023271), COEF_CONST(0.6101812098), COEF_CONST(0.2621501145) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9876350461), COEF_CONST(0.9684073447), COEF_CONST(0.9176973944), COEF_CONST(0.8643930070), COEF_CONST(0.7693796058), COEF_CONST(0.5646720713), COEF_CONST(0.1838899556) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9866247085), COEF_CONST(0.9658349704), COEF_CONST(0.9110590761), COEF_CONST(0.8535668048), COEF_CONST(0.7513165426), COEF_CONST(0.5320914819), COEF_CONST(0.1289530943) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9858996945), COEF_CONST(0.9639898866), COEF_CONST(0.9063034786), COEF_CONST(0.8458214608), COEF_CONST(0.7384262300), COEF_CONST(0.5089811277), COEF_CONST(0.0905465944) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9851245614), COEF_CONST(0.9620180268), COEF_CONST(0.9012265590), COEF_CONST(0.8375623272), COEF_CONST(0.7247108045), COEF_CONST(0.4845204297), COEF_CONST(0.0504115003) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9846869856), COEF_CONST(0.9609052357), COEF_CONST(0.8983639533), COEF_CONST(0.8329098386), COEF_CONST(0.7169983441), COEF_CONST(0.4708245354), COEF_CONST(0.0281732509) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9844406325), COEF_CONST(0.9602788522), COEF_CONST(0.8967533934), COEF_CONST(0.8302936455), COEF_CONST(0.7126658102), COEF_CONST(0.4631492839), COEF_CONST(0.0157851140) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9843020502), COEF_CONST(0.9599265269), COEF_CONST(0.8958477331), COEF_CONST(0.8288229094), COEF_CONST(0.7102315840), COEF_CONST(0.4588429315), COEF_CONST(0.0088578059) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9842241136), COEF_CONST(0.9597283916), COEF_CONST(0.8953385094), COEF_CONST(0.8279961409), COEF_CONST(0.7088635748), COEF_CONST(0.4564246834), COEF_CONST(0.0049751355) }
-};
-
-static const real_t sin_betas_fine[][8] = {
- { COEF_CONST(0.0000000000), COEF_CONST(0.0000000000), COEF_CONST(0.0000000000), COEF_CONST(0.0000000000), COEF_CONST(0.0000000000), COEF_CONST(0.0000000000), COEF_CONST(0.0000000000), COEF_CONST(0.0000000000) },
- { COEF_CONST(0.0000000000), COEF_CONST(-0.0287313368), COEF_CONST(-0.0459897147), COEF_CONST(-0.0745074328), COEF_CONST(-0.0960233266), COEF_CONST(-0.1261492408), COEF_CONST(-0.1762757894), COEF_CONST(-0.2502829383) },
- { COEF_CONST(0.0000000000), COEF_CONST(-0.0556601118), COEF_CONST(-0.0890412670), COEF_CONST(-0.1440264301), COEF_CONST(-0.1853028382), COEF_CONST(-0.2426823129), COEF_CONST(-0.3367058477), COEF_CONST(-0.4708550466) },
- { COEF_CONST(0.0000000000), COEF_CONST(-0.0794840594), COEF_CONST(-0.1270461238), COEF_CONST(-0.2050378347), COEF_CONST(-0.2631625097), COEF_CONST(-0.3431234916), COEF_CONST(-0.4712181245), COEF_CONST(-0.6445851354) },
- { COEF_CONST(0.0000000000), COEF_CONST(-0.0996126459), COEF_CONST(-0.1590687758), COEF_CONST(-0.2560691819), COEF_CONST(-0.3277662204), COEF_CONST(-0.4252161335), COEF_CONST(-0.5772043556), COEF_CONST(-0.7697193058) },
- { COEF_CONST(0.0000000000), COEF_CONST(-0.1160639735), COEF_CONST(-0.1851663774), COEF_CONST(-0.2973353800), COEF_CONST(-0.3795605619), COEF_CONST(-0.4899577884), COEF_CONST(-0.6573882369), COEF_CONST(-0.8542376401) },
- { COEF_CONST(0.0000000000), COEF_CONST(-0.1347266752), COEF_CONST(-0.2146747714), COEF_CONST(-0.3435758752), COEF_CONST(-0.4370171396), COEF_CONST(-0.5603805303), COEF_CONST(-0.7401895046), COEF_CONST(-0.9282538388) },
- { COEF_CONST(0.0000000000), COEF_CONST(-0.1477548470), COEF_CONST(-0.2352041647), COEF_CONST(-0.3754446647), COEF_CONST(-0.4761965776), COEF_CONST(-0.6073919186), COEF_CONST(-0.7922618830), COEF_CONST(-0.9650271071) },
- { COEF_CONST(0.0000000000), COEF_CONST(-0.1567705832), COEF_CONST(-0.2493736450), COEF_CONST(-0.3972801182), COEF_CONST(-0.5028167951), COEF_CONST(-0.6387918458), COEF_CONST(-0.8253153651), COEF_CONST(-0.9829468369) },
- { COEF_CONST(0.0000000000), COEF_CONST(-0.1630082348), COEF_CONST(-0.2591578860), COEF_CONST(-0.4122758299), COEF_CONST(-0.5209834064), COEF_CONST(-0.6599420072), COEF_CONST(-0.8466868694), COEF_CONST(-0.9916506943) },
- { COEF_CONST(0.0000000000), COEF_CONST(-0.1673373610), COEF_CONST(-0.2659389001), COEF_CONST(-0.4226275012), COEF_CONST(-0.5334660781), COEF_CONST(-0.6743342664), COEF_CONST(-0.8607776784), COEF_CONST(-0.9958922202) },
- { COEF_CONST(0.0000000000), COEF_CONST(-0.1718417832), COEF_CONST(-0.2729859267), COEF_CONST(-0.4333482310), COEF_CONST(-0.5463417868), COEF_CONST(-0.6890531546), COEF_CONST(-0.8747799456), COEF_CONST(-0.9987285320) },
- { COEF_CONST(0.0000000000), COEF_CONST(-0.1743316967), COEF_CONST(-0.2768774604), COEF_CONST(-0.4392518725), COEF_CONST(-0.5534087104), COEF_CONST(-0.6970748701), COEF_CONST(-0.8822268738), COEF_CONST(-0.9996030552) },
- { COEF_CONST(0.0000000000), COEF_CONST(-0.1757175038), COEF_CONST(-0.2790421580), COEF_CONST(-0.4425306221), COEF_CONST(-0.5573261722), COEF_CONST(-0.7015037013), COEF_CONST(-0.8862802834), COEF_CONST(-0.9998754073) },
- { COEF_CONST(0.0000000000), COEF_CONST(-0.1764921355), COEF_CONST(-0.2802517850), COEF_CONST(-0.4443611583), COEF_CONST(-0.5595110229), COEF_CONST(-0.7039681080), COEF_CONST(-0.8885173967), COEF_CONST(-0.9999607689) },
- { COEF_CONST(0.0000000000), COEF_CONST(-0.1769262394), COEF_CONST(-0.2809295540), COEF_CONST(-0.4453862969), COEF_CONST(-0.5607337966), COEF_CONST(-0.7053456119), COEF_CONST(-0.8897620516), COEF_CONST(-0.9999876239) }
-};
-
-static const real_t sincos_alphas_B_normal[][8] = {
- { COEF_CONST(0.0561454100), COEF_CONST(0.0526385859), COEF_CONST(0.0472937334), COEF_CONST(0.0338410641), COEF_CONST(0.0207261065), COEF_CONST(0.0028205635), COEF_CONST(0.0028205635), COEF_CONST(0.0028205635) },
- { COEF_CONST(0.1249065138), COEF_CONST(0.1173697697), COEF_CONST(0.1057888284), COEF_CONST(0.0761985131), COEF_CONST(0.0468732723), COEF_CONST(0.0063956103), COEF_CONST(0.0063956103), COEF_CONST(0.0063956103) },
- { COEF_CONST(0.1956693050), COEF_CONST(0.1846090179), COEF_CONST(0.1673645109), COEF_CONST(0.1220621836), COEF_CONST(0.0757362479), COEF_CONST(0.0103882630), COEF_CONST(0.0103882630), COEF_CONST(0.0103882630) },
- { COEF_CONST(0.3015113269), COEF_CONST(0.2870525790), COEF_CONST(0.2637738799), COEF_CONST(0.1984573949), COEF_CONST(0.1260749909), COEF_CONST(0.0175600126), COEF_CONST(0.0175600126), COEF_CONST(0.0175600126) },
- { COEF_CONST(0.4078449476), COEF_CONST(0.3929852420), COEF_CONST(0.3680589270), COEF_CONST(0.2911029124), COEF_CONST(0.1934512363), COEF_CONST(0.0278686716), COEF_CONST(0.0278686716), COEF_CONST(0.0278686716) },
- { COEF_CONST(0.5336171261), COEF_CONST(0.5226637762), COEF_CONST(0.5033652606), COEF_CONST(0.4349162672), COEF_CONST(0.3224682122), COEF_CONST(0.0521999036), COEF_CONST(0.0521999036), COEF_CONST(0.0521999036) },
- { COEF_CONST(0.6219832023), COEF_CONST(0.6161847276), COEF_CONST(0.6057251063), COEF_CONST(0.5654342668), COEF_CONST(0.4826149915), COEF_CONST(0.1058044758), COEF_CONST(0.1058044758), COEF_CONST(0.1058044758) },
- { COEF_CONST(0.7071067657), COEF_CONST(0.7071067657), COEF_CONST(0.7071067657), COEF_CONST(0.7071067657), COEF_CONST(0.7071067657), COEF_CONST(0.7071067657), COEF_CONST(0.7071067657), COEF_CONST(0.7071067657) },
- { COEF_CONST(0.7830305572), COEF_CONST(0.7876016373), COEF_CONST(0.7956739618), COEF_CONST(0.8247933372), COEF_CONST(0.8758325942), COEF_CONST(0.9943869542), COEF_CONST(0.9943869542), COEF_CONST(0.9943869542) },
- { COEF_CONST(0.8457261833), COEF_CONST(0.8525388778), COEF_CONST(0.8640737401), COEF_CONST(0.9004708933), COEF_CONST(0.9465802987), COEF_CONST(0.9986366532), COEF_CONST(0.9986366532), COEF_CONST(0.9986366532) },
- { COEF_CONST(0.9130511848), COEF_CONST(0.9195447612), COEF_CONST(0.9298024282), COEF_CONST(0.9566917233), COEF_CONST(0.9811098801), COEF_CONST(0.9996115928), COEF_CONST(0.9996115928), COEF_CONST(0.9996115928) },
- { COEF_CONST(0.9534625907), COEF_CONST(0.9579148236), COEF_CONST(0.9645845234), COEF_CONST(0.9801095128), COEF_CONST(0.9920207064), COEF_CONST(0.9998458099), COEF_CONST(0.9998458099), COEF_CONST(0.9998458099) },
- { COEF_CONST(0.9806699215), COEF_CONST(0.9828120260), COEF_CONST(0.9858950861), COEF_CONST(0.9925224431), COEF_CONST(0.9971278825), COEF_CONST(0.9999460406), COEF_CONST(0.9999460406), COEF_CONST(0.9999460406) },
- { COEF_CONST(0.9921685024), COEF_CONST(0.9930882705), COEF_CONST(0.9943886135), COEF_CONST(0.9970926648), COEF_CONST(0.9989008403), COEF_CONST(0.9999795479), COEF_CONST(0.9999795479), COEF_CONST(0.9999795479) },
- { COEF_CONST(0.9984226014), COEF_CONST(0.9986136287), COEF_CONST(0.9988810254), COEF_CONST(0.9994272242), COEF_CONST(0.9997851906), COEF_CONST(0.9999960221), COEF_CONST(0.9999960221), COEF_CONST(0.9999960221) }
-};
-
-static const real_t sincos_alphas_B_fine[][8] = {
- { COEF_CONST(0.0031622158), COEF_CONST(0.0029630181), COEF_CONST(0.0026599892), COEF_CONST(0.0019002704), COEF_CONST(0.0011626042), COEF_CONST(0.0001580278), COEF_CONST(0.0001580278), COEF_CONST(0.0001580278) },
- { COEF_CONST(0.0056232673), COEF_CONST(0.0052689825), COEF_CONST(0.0047302825), COEF_CONST(0.0033791756), COEF_CONST(0.0020674015), COEF_CONST(0.0002811710), COEF_CONST(0.0002811710), COEF_CONST(0.0002811710) },
- { COEF_CONST(0.0099994225), COEF_CONST(0.0093696693), COEF_CONST(0.0084117414), COEF_CONST(0.0060093796), COEF_CONST(0.0036766009), COEF_CONST(0.0005000392), COEF_CONST(0.0005000392), COEF_CONST(0.0005000392) },
- { COEF_CONST(0.0177799194), COEF_CONST(0.0166607102), COEF_CONST(0.0149581377), COEF_CONST(0.0106875809), COEF_CONST(0.0065392545), COEF_CONST(0.0008893767), COEF_CONST(0.0008893767), COEF_CONST(0.0008893767) },
- { COEF_CONST(0.0316069684), COEF_CONST(0.0296211579), COEF_CONST(0.0265987295), COEF_CONST(0.0190113813), COEF_CONST(0.0116349973), COEF_CONST(0.0015826974), COEF_CONST(0.0015826974), COEF_CONST(0.0015826974) },
- { COEF_CONST(0.0561454100), COEF_CONST(0.0526385859), COEF_CONST(0.0472937334), COEF_CONST(0.0338410641), COEF_CONST(0.0207261065), COEF_CONST(0.0028205635), COEF_CONST(0.0028205635), COEF_CONST(0.0028205635) },
- { COEF_CONST(0.0791834041), COEF_CONST(0.0742798103), COEF_CONST(0.0667907269), COEF_CONST(0.0478705292), COEF_CONST(0.0293500747), COEF_CONST(0.0039966755), COEF_CONST(0.0039966755), COEF_CONST(0.0039966755) },
- { COEF_CONST(0.1115021177), COEF_CONST(0.1047141985), COEF_CONST(0.0943053154), COEF_CONST(0.0678120561), COEF_CONST(0.0416669150), COEF_CONST(0.0056813213), COEF_CONST(0.0056813213), COEF_CONST(0.0056813213) },
- { COEF_CONST(0.1565355066), COEF_CONST(0.1473258371), COEF_CONST(0.1330924027), COEF_CONST(0.0963282233), COEF_CONST(0.0594509113), COEF_CONST(0.0081277946), COEF_CONST(0.0081277946), COEF_CONST(0.0081277946) },
- { COEF_CONST(0.2184643682), COEF_CONST(0.2064579524), COEF_CONST(0.1876265439), COEF_CONST(0.1375744167), COEF_CONST(0.0856896681), COEF_CONST(0.0117817338), COEF_CONST(0.0117817338), COEF_CONST(0.0117817338) },
- { COEF_CONST(0.3015113269), COEF_CONST(0.2870525790), COEF_CONST(0.2637738799), COEF_CONST(0.1984573949), COEF_CONST(0.1260749909), COEF_CONST(0.0175600126), COEF_CONST(0.0175600126), COEF_CONST(0.0175600126) },
- { COEF_CONST(0.3698741335), COEF_CONST(0.3547727297), COEF_CONST(0.3298252076), COEF_CONST(0.2556265829), COEF_CONST(0.1665990017), COEF_CONST(0.0236344541), COEF_CONST(0.0236344541), COEF_CONST(0.0236344541) },
- { COEF_CONST(0.4480623975), COEF_CONST(0.4339410024), COEF_CONST(0.4098613774), COEF_CONST(0.3322709108), COEF_CONST(0.2266784729), COEF_CONST(0.0334094131), COEF_CONST(0.0334094131), COEF_CONST(0.0334094131) },
- { COEF_CONST(0.5336171261), COEF_CONST(0.5226637762), COEF_CONST(0.5033652606), COEF_CONST(0.4349162672), COEF_CONST(0.3224682122), COEF_CONST(0.0521999036), COEF_CONST(0.0521999036), COEF_CONST(0.0521999036) },
- { COEF_CONST(0.6219832023), COEF_CONST(0.6161847276), COEF_CONST(0.6057251063), COEF_CONST(0.5654342668), COEF_CONST(0.4826149915), COEF_CONST(0.1058044758), COEF_CONST(0.1058044758), COEF_CONST(0.1058044758) },
- { COEF_CONST(0.7071067657), COEF_CONST(0.7071067657), COEF_CONST(0.7071067657), COEF_CONST(0.7071067657), COEF_CONST(0.7071067657), COEF_CONST(0.7071067657), COEF_CONST(0.7071067657), COEF_CONST(0.7071067657) },
- { COEF_CONST(0.7830305572), COEF_CONST(0.7876016373), COEF_CONST(0.7956739618), COEF_CONST(0.8247933372), COEF_CONST(0.8758325942), COEF_CONST(0.9943869542), COEF_CONST(0.9943869542), COEF_CONST(0.9943869542) },
- { COEF_CONST(0.8457261833), COEF_CONST(0.8525388778), COEF_CONST(0.8640737401), COEF_CONST(0.9004708933), COEF_CONST(0.9465802987), COEF_CONST(0.9986366532), COEF_CONST(0.9986366532), COEF_CONST(0.9986366532) },
- { COEF_CONST(0.8940022267), COEF_CONST(0.9009412572), COEF_CONST(0.9121477564), COEF_CONST(0.9431839770), COEF_CONST(0.9739696219), COEF_CONST(0.9994417480), COEF_CONST(0.9994417480), COEF_CONST(0.9994417480) },
- { COEF_CONST(0.9290818561), COEF_CONST(0.9349525662), COEF_CONST(0.9440420138), COEF_CONST(0.9667755833), COEF_CONST(0.9860247275), COEF_CONST(0.9997206664), COEF_CONST(0.9997206664), COEF_CONST(0.9997206664) },
- { COEF_CONST(0.9534625907), COEF_CONST(0.9579148236), COEF_CONST(0.9645845234), COEF_CONST(0.9801095128), COEF_CONST(0.9920207064), COEF_CONST(0.9998458099), COEF_CONST(0.9998458099), COEF_CONST(0.9998458099) },
- { COEF_CONST(0.9758449068), COEF_CONST(0.9784554646), COEF_CONST(0.9822404252), COEF_CONST(0.9904914275), COEF_CONST(0.9963218730), COEF_CONST(0.9999305926), COEF_CONST(0.9999305926), COEF_CONST(0.9999305926) },
- { COEF_CONST(0.9876723320), COEF_CONST(0.9890880155), COEF_CONST(0.9911036356), COEF_CONST(0.9953496173), COEF_CONST(0.9982312259), COEF_CONST(0.9999669685), COEF_CONST(0.9999669685), COEF_CONST(0.9999669685) },
- { COEF_CONST(0.9937641889), COEF_CONST(0.9945023501), COEF_CONST(0.9955433130), COEF_CONST(0.9976981117), COEF_CONST(0.9991315558), COEF_CONST(0.9999838610), COEF_CONST(0.9999838610), COEF_CONST(0.9999838610) },
- { COEF_CONST(0.9968600642), COEF_CONST(0.9972374385), COEF_CONST(0.9977670024), COEF_CONST(0.9988535464), COEF_CONST(0.9995691924), COEF_CONST(0.9999920129), COEF_CONST(0.9999920129), COEF_CONST(0.9999920129) },
- { COEF_CONST(0.9984226014), COEF_CONST(0.9986136287), COEF_CONST(0.9988810254), COEF_CONST(0.9994272242), COEF_CONST(0.9997851906), COEF_CONST(0.9999960221), COEF_CONST(0.9999960221), COEF_CONST(0.9999960221) },
- { COEF_CONST(0.9995003746), COEF_CONST(0.9995611974), COEF_CONST(0.9996461891), COEF_CONST(0.9998192657), COEF_CONST(0.9999323103), COEF_CONST(0.9999987475), COEF_CONST(0.9999987475), COEF_CONST(0.9999987475) },
- { COEF_CONST(0.9998419236), COEF_CONST(0.9998611991), COEF_CONST(0.9998881193), COEF_CONST(0.9999428861), COEF_CONST(0.9999786185), COEF_CONST(0.9999996045), COEF_CONST(0.9999996045), COEF_CONST(0.9999996045) },
- { COEF_CONST(0.9999500038), COEF_CONST(0.9999561034), COEF_CONST(0.9999646206), COEF_CONST(0.9999819429), COEF_CONST(0.9999932409), COEF_CONST(0.9999998750), COEF_CONST(0.9999998750), COEF_CONST(0.9999998750) },
- { COEF_CONST(0.9999841890), COEF_CONST(0.9999861183), COEF_CONST(0.9999888121), COEF_CONST(0.9999942902), COEF_CONST(0.9999978628), COEF_CONST(0.9999999605), COEF_CONST(0.9999999605), COEF_CONST(0.9999999605) },
- { COEF_CONST(0.9999950000), COEF_CONST(0.9999956102), COEF_CONST(0.9999964621), COEF_CONST(0.9999981945), COEF_CONST(0.9999993242), COEF_CONST(0.9999999875), COEF_CONST(0.9999999875), COEF_CONST(0.9999999875) }
-};
-
-static const real_t cos_gammas_normal[][8] = {
- { COEF_CONST(1.0000000000), COEF_CONST(0.9841239707), COEF_CONST(0.9594738226), COEF_CONST(0.8946843024), COEF_CONST(0.8269341029), COEF_CONST(0.7245688486), COEF_CONST(0.7245688486), COEF_CONST(0.7245688486) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9849690570), COEF_CONST(0.9617776789), COEF_CONST(0.9020941550), COEF_CONST(0.8436830391), COEF_CONST(0.7846832804), COEF_CONST(0.7846832804), COEF_CONST(0.7846832804) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9871656089), COEF_CONST(0.9676774734), COEF_CONST(0.9199102884), COEF_CONST(0.8785067015), COEF_CONST(0.8464232214), COEF_CONST(0.8464232214), COEF_CONST(0.8464232214) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9913533967), COEF_CONST(0.9786000177), COEF_CONST(0.9496063381), COEF_CONST(0.9277157252), COEF_CONST(0.9133354077), COEF_CONST(0.9133354077), COEF_CONST(0.9133354077) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9948924435), COEF_CONST(0.9875319180), COEF_CONST(0.9716329849), COEF_CONST(0.9604805241), COEF_CONST(0.9535949574), COEF_CONST(0.9535949574), COEF_CONST(0.9535949574) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9977406278), COEF_CONST(0.9945423840), COEF_CONST(0.9878736667), COEF_CONST(0.9833980494), COEF_CONST(0.9807207440), COEF_CONST(0.9807207440), COEF_CONST(0.9807207440) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9990607067), COEF_CONST(0.9977417734), COEF_CONST(0.9950323970), COEF_CONST(0.9932453273), COEF_CONST(0.9921884740), COEF_CONST(0.9921884740), COEF_CONST(0.9921884740) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9998081748), COEF_CONST(0.9995400312), COEF_CONST(0.9989936459), COEF_CONST(0.9986365356), COEF_CONST(0.9984265591), COEF_CONST(0.9984265591), COEF_CONST(0.9984265591) }
-};
-
-static const real_t cos_gammas_fine[][8] = {
- { COEF_CONST(1.0000000000), COEF_CONST(0.9841239707), COEF_CONST(0.9594738226), COEF_CONST(0.8946843024), COEF_CONST(0.8269341029), COEF_CONST(0.7245688486), COEF_CONST(0.7245688486), COEF_CONST(0.7245688486) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9849690570), COEF_CONST(0.9617776789), COEF_CONST(0.9020941550), COEF_CONST(0.8436830391), COEF_CONST(0.7846832804), COEF_CONST(0.7846832804), COEF_CONST(0.7846832804) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9871656089), COEF_CONST(0.9676774734), COEF_CONST(0.9199102884), COEF_CONST(0.8785067015), COEF_CONST(0.8464232214), COEF_CONST(0.8464232214), COEF_CONST(0.8464232214) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9899597309), COEF_CONST(0.9750098690), COEF_CONST(0.9402333855), COEF_CONST(0.9129698759), COEF_CONST(0.8943765944), COEF_CONST(0.8943765944), COEF_CONST(0.8943765944) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9926607607), COEF_CONST(0.9819295710), COEF_CONST(0.9580160104), COEF_CONST(0.9404993670), COEF_CONST(0.9293004472), COEF_CONST(0.9293004472), COEF_CONST(0.9293004472) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9948924435), COEF_CONST(0.9875319180), COEF_CONST(0.9716329849), COEF_CONST(0.9604805241), COEF_CONST(0.9535949574), COEF_CONST(0.9535949574), COEF_CONST(0.9535949574) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9972074644), COEF_CONST(0.9932414270), COEF_CONST(0.9849197629), COEF_CONST(0.9792926592), COEF_CONST(0.9759092525), COEF_CONST(0.9759092525), COEF_CONST(0.9759092525) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9985361982), COEF_CONST(0.9964742028), COEF_CONST(0.9922136306), COEF_CONST(0.9893845420), COEF_CONST(0.9877041371), COEF_CONST(0.9877041371), COEF_CONST(0.9877041371) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9992494366), COEF_CONST(0.9981967170), COEF_CONST(0.9960386625), COEF_CONST(0.9946185834), COEF_CONST(0.9937800239), COEF_CONST(0.9937800239), COEF_CONST(0.9937800239) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9996194722), COEF_CONST(0.9990869422), COEF_CONST(0.9979996269), COEF_CONST(0.9972873651), COEF_CONST(0.9968679747), COEF_CONST(0.9968679747), COEF_CONST(0.9968679747) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9998081748), COEF_CONST(0.9995400312), COEF_CONST(0.9989936459), COEF_CONST(0.9986365356), COEF_CONST(0.9984265591), COEF_CONST(0.9984265591), COEF_CONST(0.9984265591) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9999390971), COEF_CONST(0.9998540271), COEF_CONST(0.9996809352), COEF_CONST(0.9995679735), COEF_CONST(0.9995016284), COEF_CONST(0.9995016284), COEF_CONST(0.9995016284) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9999807170), COEF_CONST(0.9999537862), COEF_CONST(0.9998990191), COEF_CONST(0.9998632947), COEF_CONST(0.9998423208), COEF_CONST(0.9998423208), COEF_CONST(0.9998423208) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9999938979), COEF_CONST(0.9999853814), COEF_CONST(0.9999680568), COEF_CONST(0.9999567596), COEF_CONST(0.9999501270), COEF_CONST(0.9999501270), COEF_CONST(0.9999501270) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9999980703), COEF_CONST(0.9999953731), COEF_CONST(0.9999898968), COEF_CONST(0.9999863277), COEF_CONST(0.9999842265), COEF_CONST(0.9999842265), COEF_CONST(0.9999842265) },
- { COEF_CONST(1.0000000000), COEF_CONST(0.9999993891), COEF_CONST(0.9999985397), COEF_CONST(0.9999968037), COEF_CONST(0.9999956786), COEF_CONST(0.9999950155), COEF_CONST(0.9999950155), COEF_CONST(0.9999950155) }
-};
-
-static const real_t sin_gammas_normal[][8] = {
- { COEF_CONST(0.0000000000), COEF_CONST(0.1774824223), COEF_CONST(0.2817977711), COEF_CONST(0.4466990028), COEF_CONST(0.5622988435), COEF_CONST(0.6892024258), COEF_CONST(0.6892024258), COEF_CONST(0.6892024258) },
- { COEF_CONST(0.0000000000), COEF_CONST(0.1727308798), COEF_CONST(0.2738315110), COEF_CONST(0.4315392630), COEF_CONST(0.5368416242), COEF_CONST(0.6198968861), COEF_CONST(0.6198968861), COEF_CONST(0.6198968861) },
- { COEF_CONST(0.0000000000), COEF_CONST(0.1596999079), COEF_CONST(0.2521910140), COEF_CONST(0.3921288836), COEF_CONST(0.4777300236), COEF_CONST(0.5325107795), COEF_CONST(0.5325107795), COEF_CONST(0.5325107795) },
- { COEF_CONST(0.0000000000), COEF_CONST(0.1312190642), COEF_CONST(0.2057717310), COEF_CONST(0.3134450552), COEF_CONST(0.3732874674), COEF_CONST(0.4072080955), COEF_CONST(0.4072080955), COEF_CONST(0.4072080955) },
- { COEF_CONST(0.0000000000), COEF_CONST(0.1009407043), COEF_CONST(0.1574189028), COEF_CONST(0.2364938532), COEF_CONST(0.2783471983), COEF_CONST(0.3010924396), COEF_CONST(0.3010924396), COEF_CONST(0.3010924396) },
- { COEF_CONST(0.0000000000), COEF_CONST(0.0671836269), COEF_CONST(0.1043333428), COEF_CONST(0.1552598422), COEF_CONST(0.1814615013), COEF_CONST(0.1954144885), COEF_CONST(0.1954144885), COEF_CONST(0.1954144885) },
- { COEF_CONST(0.0000000000), COEF_CONST(0.0433324862), COEF_CONST(0.0671666110), COEF_CONST(0.0995516398), COEF_CONST(0.1160332699), COEF_CONST(0.1247478739), COEF_CONST(0.1247478739), COEF_CONST(0.1247478739) },
- { COEF_CONST(0.0000000000), COEF_CONST(0.0195860576), COEF_CONST(0.0303269852), COEF_CONST(0.0448519274), COEF_CONST(0.0522022017), COEF_CONST(0.0560750040), COEF_CONST(0.0560750040), COEF_CONST(0.0560750040) }
-};
-
-static const real_t sin_gammas_fine[][8] = {
- { COEF_CONST(0.0000000000), COEF_CONST(0.1774824223), COEF_CONST(0.2817977711), COEF_CONST(0.4466990028), COEF_CONST(0.5622988435), COEF_CONST(0.6892024258), COEF_CONST(0.6892024258), COEF_CONST(0.6892024258) },
- { COEF_CONST(0.0000000000), COEF_CONST(0.1727308798), COEF_CONST(0.2738315110), COEF_CONST(0.4315392630), COEF_CONST(0.5368416242), COEF_CONST(0.6198968861), COEF_CONST(0.6198968861), COEF_CONST(0.6198968861) },
- { COEF_CONST(0.0000000000), COEF_CONST(0.1596999079), COEF_CONST(0.2521910140), COEF_CONST(0.3921288836), COEF_CONST(0.4777300236), COEF_CONST(0.5325107795), COEF_CONST(0.5325107795), COEF_CONST(0.5325107795) },
- { COEF_CONST(0.0000000000), COEF_CONST(0.1413496768), COEF_CONST(0.2221615526), COEF_CONST(0.3405307340), COEF_CONST(0.4080269669), COEF_CONST(0.4473147744), COEF_CONST(0.4473147744), COEF_CONST(0.4473147744) },
- { COEF_CONST(0.0000000000), COEF_CONST(0.1209322714), COEF_CONST(0.1892467110), COEF_CONST(0.2867147079), COEF_CONST(0.3397954394), COEF_CONST(0.3693246252), COEF_CONST(0.3693246252), COEF_CONST(0.3693246252) },
- { COEF_CONST(0.0000000000), COEF_CONST(0.1009407043), COEF_CONST(0.1574189028), COEF_CONST(0.2364938532), COEF_CONST(0.2783471983), COEF_CONST(0.3010924396), COEF_CONST(0.3010924396), COEF_CONST(0.3010924396) },
- { COEF_CONST(0.0000000000), COEF_CONST(0.0746811420), COEF_CONST(0.1160666523), COEF_CONST(0.1730117353), COEF_CONST(0.2024497161), COEF_CONST(0.2181768341), COEF_CONST(0.2181768341), COEF_CONST(0.2181768341) },
- { COEF_CONST(0.0000000000), COEF_CONST(0.0540875291), COEF_CONST(0.0838997203), COEF_CONST(0.1245476266), COEF_CONST(0.1453211203), COEF_CONST(0.1563346972), COEF_CONST(0.1563346972), COEF_CONST(0.1563346972) },
- { COEF_CONST(0.0000000000), COEF_CONST(0.0387371058), COEF_CONST(0.0600276114), COEF_CONST(0.0889212171), COEF_CONST(0.1036044086), COEF_CONST(0.1113609634), COEF_CONST(0.1113609634), COEF_CONST(0.1113609634) },
- { COEF_CONST(0.0000000000), COEF_CONST(0.0275846110), COEF_CONST(0.0427233177), COEF_CONST(0.0632198125), COEF_CONST(0.0736064637), COEF_CONST(0.0790837596), COEF_CONST(0.0790837596), COEF_CONST(0.0790837596) },
- { COEF_CONST(0.0000000000), COEF_CONST(0.0195860576), COEF_CONST(0.0303269852), COEF_CONST(0.0448519274), COEF_CONST(0.0522022017), COEF_CONST(0.0560750040), COEF_CONST(0.0560750040), COEF_CONST(0.0560750040) },
- { COEF_CONST(0.0000000000), COEF_CONST(0.0110363955), COEF_CONST(0.0170857974), COEF_CONST(0.0252592108), COEF_CONST(0.0293916021), COEF_CONST(0.0315673054), COEF_CONST(0.0315673054), COEF_CONST(0.0315673054) },
- { COEF_CONST(0.0000000000), COEF_CONST(0.0062101284), COEF_CONST(0.0096138203), COEF_CONST(0.0142109649), COEF_CONST(0.0165345659), COEF_CONST(0.0177576316), COEF_CONST(0.0177576316), COEF_CONST(0.0177576316) },
- { COEF_CONST(0.0000000000), COEF_CONST(0.0034934509), COEF_CONST(0.0054071189), COEF_CONST(0.0079928316), COEF_CONST(0.0092994041), COEF_CONST(0.0099871631), COEF_CONST(0.0099871631), COEF_CONST(0.0099871631) },
- { COEF_CONST(0.0000000000), COEF_CONST(0.0019645397), COEF_CONST(0.0030419905), COEF_CONST(0.0044951511), COEF_CONST(0.0052291853), COEF_CONST(0.0056166498), COEF_CONST(0.0056166498), COEF_CONST(0.0056166498) },
- { COEF_CONST(0.0000000000), COEF_CONST(0.0011053943), COEF_CONST(0.0017089869), COEF_CONST(0.0025283670), COEF_CONST(0.0029398552), COEF_CONST(0.0031573685), COEF_CONST(0.0031573685), COEF_CONST(0.0031573685) }
-};
-
-static const real_t sf_iid_normal[] = {
- COEF_CONST(1.4119827747), COEF_CONST(1.4031381607), COEF_CONST(1.3868767023),
- COEF_CONST(1.3483997583), COEF_CONST(1.2912493944), COEF_CONST(1.1960374117),
- COEF_CONST(1.1073724031), COEF_CONST(1.0000000000), COEF_CONST(0.8796171546),
- COEF_CONST(0.7546485662), COEF_CONST(0.5767799020), COEF_CONST(0.4264014363),
- COEF_CONST(0.2767182887), COEF_CONST(0.1766446233), COEF_CONST(0.0794016272)
-};
-
-static const real_t sf_iid_fine[] = {
- COEF_CONST(1.4142065048), COEF_CONST(1.4141912460), COEF_CONST(1.4141428471),
- COEF_CONST(1.4139900208), COEF_CONST(1.4135069847), COEF_CONST(1.4119827747),
- COEF_CONST(1.4097729921), COEF_CONST(1.4053947926), COEF_CONST(1.3967796564),
- COEF_CONST(1.3800530434), COEF_CONST(1.3483997583), COEF_CONST(1.3139201403),
- COEF_CONST(1.2643101215), COEF_CONST(1.1960374117), COEF_CONST(1.1073724031),
- COEF_CONST(1.0000000000), COEF_CONST(0.8796171546), COEF_CONST(0.7546485662),
- COEF_CONST(0.6336560845), COEF_CONST(0.5230810642), COEF_CONST(0.4264014363),
- COEF_CONST(0.3089554012), COEF_CONST(0.2213746458), COEF_CONST(0.1576878875),
- COEF_CONST(0.1119822487), COEF_CONST(0.0794016272), COEF_CONST(0.0446990170),
- COEF_CONST(0.0251446925), COEF_CONST(0.0141414283), COEF_CONST(0.0079525812),
- COEF_CONST(0.0044721137)
-};
-
-#ifdef __cplusplus
-
-#endif
-#endif
-
diff --git a/src/libfaad/pulse.c b/src/libfaad/pulse.c
deleted file mode 100644
index 9e0a705e6..000000000
--- a/src/libfaad/pulse.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: pulse.c,v 1.8 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#include "common.h"
-#include "structs.h"
-
-#include "syntax.h"
-#include "pulse.h"
-
-uint8_t pulse_decode(ic_stream *ics, int16_t *spec_data, uint16_t framelen)
-{
- uint8_t i;
- uint16_t k;
- pulse_info *pul = &(ics->pul);
-
- k = ics->swb_offset[pul->pulse_start_sfb];
-
- for (i = 0; i <= pul->number_pulse; i++)
- {
- k += pul->pulse_offset[i];
-
- if (k >= framelen)
- return 15; /* should not be possible */
-
- if (spec_data[k] > 0)
- spec_data[k] += pul->pulse_amp[i];
- else
- spec_data[k] -= pul->pulse_amp[i];
- }
-
- return 0;
-}
diff --git a/src/libfaad/pulse.h b/src/libfaad/pulse.h
deleted file mode 100644
index a057c0d3b..000000000
--- a/src/libfaad/pulse.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: pulse.h,v 1.8 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __PULSE_H__
-#define __PULSE_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-uint8_t pulse_decode(ic_stream *ics, int16_t *spec_coef, uint16_t framelen);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/libfaad/rvlc.c b/src/libfaad/rvlc.c
deleted file mode 100644
index bad49a0c6..000000000
--- a/src/libfaad/rvlc.c
+++ /dev/null
@@ -1,530 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: rvlc.c,v 1.7 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-/* RVLC scalefactor decoding
- *
- * RVLC works like this:
- * 1. Only symmetric huffman codewords are used
- * 2. Total length of the scalefactor data is stored in the bitsream
- * 3. Scalefactors are DPCM coded
- * 4. Next to the starting value for DPCM the ending value is also stored
- *
- * With all this it is possible to read the scalefactor data from 2 sides.
- * If there is a bit error in the scalefactor data it is possible to start
- * decoding from the other end of the data, to find all but 1 scalefactor.
- */
-
-#include "common.h"
-#include "structs.h"
-
-#include <stdlib.h>
-
-#include "syntax.h"
-#include "bits.h"
-#include "rvlc.h"
-
-
-#ifdef ERROR_RESILIENCE
-
-//#define PRINT_RVLC
-
-/* static function declarations */
-static uint8_t rvlc_decode_sf_forward(ic_stream *ics,
- bitfile *ld_sf,
- bitfile *ld_esc,
- uint8_t *is_used);
-#if 0
-static uint8_t rvlc_decode_sf_reverse(ic_stream *ics,
- bitfile *ld_sf,
- bitfile *ld_esc,
- uint8_t is_used);
-#endif
-static int8_t rvlc_huffman_sf(bitfile *ld_sf, bitfile *ld_esc,
- int8_t direction);
-static int8_t rvlc_huffman_esc(bitfile *ld_esc, int8_t direction);
-
-
-uint8_t rvlc_scale_factor_data(ic_stream *ics, bitfile *ld)
-{
- uint8_t bits = 9;
-
- ics->sf_concealment = faad_get1bit(ld
- DEBUGVAR(1,149,"rvlc_scale_factor_data(): sf_concealment"));
- ics->rev_global_gain = (uint8_t)faad_getbits(ld, 8
- DEBUGVAR(1,150,"rvlc_scale_factor_data(): rev_global_gain"));
-
- if (ics->window_sequence == EIGHT_SHORT_SEQUENCE)
- bits = 11;
-
- /* the number of bits used for the huffman codewords */
- ics->length_of_rvlc_sf = (uint16_t)faad_getbits(ld, bits
- DEBUGVAR(1,151,"rvlc_scale_factor_data(): length_of_rvlc_sf"));
-
- if (ics->noise_used)
- {
- ics->dpcm_noise_nrg = (uint16_t)faad_getbits(ld, 9
- DEBUGVAR(1,152,"rvlc_scale_factor_data(): dpcm_noise_nrg"));
-
- ics->length_of_rvlc_sf -= 9;
- }
-
- ics->sf_escapes_present = faad_get1bit(ld
- DEBUGVAR(1,153,"rvlc_scale_factor_data(): sf_escapes_present"));
-
- if (ics->sf_escapes_present)
- {
- ics->length_of_rvlc_escapes = (uint8_t)faad_getbits(ld, 8
- DEBUGVAR(1,154,"rvlc_scale_factor_data(): length_of_rvlc_escapes"));
- }
-
- if (ics->noise_used)
- {
- ics->dpcm_noise_last_position = (uint16_t)faad_getbits(ld, 9
- DEBUGVAR(1,155,"rvlc_scale_factor_data(): dpcm_noise_last_position"));
- }
-
- return 0;
-}
-
-uint8_t rvlc_decode_scale_factors(ic_stream *ics, bitfile *ld)
-{
- uint8_t result;
- uint8_t intensity_used = 0;
- uint8_t *rvlc_sf_buffer = NULL;
- uint8_t *rvlc_esc_buffer = NULL;
- bitfile ld_rvlc_sf, ld_rvlc_esc;
-// bitfile ld_rvlc_sf_rev, ld_rvlc_esc_rev;
-
- if (ics->length_of_rvlc_sf > 0)
- {
- /* We read length_of_rvlc_sf bits here to put it in a
- seperate bitfile.
- */
- rvlc_sf_buffer = faad_getbitbuffer(ld, ics->length_of_rvlc_sf
- DEBUGVAR(1,156,"rvlc_decode_scale_factors(): bitbuffer: length_of_rvlc_sf"));
-
- faad_initbits(&ld_rvlc_sf, (void*)rvlc_sf_buffer, bit2byte(ics->length_of_rvlc_sf));
-// faad_initbits_rev(&ld_rvlc_sf_rev, (void*)rvlc_sf_buffer,
-// ics->length_of_rvlc_sf);
- }
-
- if (ics->sf_escapes_present)
- {
- /* We read length_of_rvlc_escapes bits here to put it in a
- seperate bitfile.
- */
- rvlc_esc_buffer = faad_getbitbuffer(ld, ics->length_of_rvlc_escapes
- DEBUGVAR(1,157,"rvlc_decode_scale_factors(): bitbuffer: length_of_rvlc_escapes"));
-
- faad_initbits(&ld_rvlc_esc, (void*)rvlc_esc_buffer, bit2byte(ics->length_of_rvlc_escapes));
-// faad_initbits_rev(&ld_rvlc_esc_rev, (void*)rvlc_esc_buffer,
-// ics->length_of_rvlc_escapes);
- }
-
- /* decode the rvlc scale factors and escapes */
- result = rvlc_decode_sf_forward(ics, &ld_rvlc_sf,
- &ld_rvlc_esc, &intensity_used);
-// result = rvlc_decode_sf_reverse(ics, &ld_rvlc_sf_rev,
-// &ld_rvlc_esc_rev, intensity_used);
-
-
- if (rvlc_esc_buffer) faad_free(rvlc_esc_buffer);
- if (rvlc_sf_buffer) faad_free(rvlc_sf_buffer);
-
- if (ics->length_of_rvlc_sf > 0)
- faad_endbits(&ld_rvlc_sf);
- if (ics->sf_escapes_present)
- faad_endbits(&ld_rvlc_esc);
-
- return result;
-}
-
-static uint8_t rvlc_decode_sf_forward(ic_stream *ics, bitfile *ld_sf, bitfile *ld_esc,
- uint8_t *intensity_used)
-{
- int8_t g, sfb;
- int8_t t = 0;
- int8_t error = 0;
- int8_t noise_pcm_flag = 1;
-
- int16_t scale_factor = ics->global_gain;
- int16_t is_position = 0;
- int16_t noise_energy = ics->global_gain - 90 - 256;
-
-#ifdef PRINT_RVLC
- printf("\nglobal_gain: %d\n", ics->global_gain);
-#endif
-
- for (g = 0; g < ics->num_window_groups; g++)
- {
- for (sfb = 0; sfb < ics->max_sfb; sfb++)
- {
- if (error)
- {
- ics->scale_factors[g][sfb] = 0;
- } else {
- switch (ics->sfb_cb[g][sfb])
- {
- case ZERO_HCB: /* zero book */
- ics->scale_factors[g][sfb] = 0;
- break;
- case INTENSITY_HCB: /* intensity books */
- case INTENSITY_HCB2:
-
- *intensity_used = 1;
-
- /* decode intensity position */
- t = rvlc_huffman_sf(ld_sf, ld_esc, +1);
-
- is_position += t;
- ics->scale_factors[g][sfb] = is_position;
-
- break;
- case NOISE_HCB: /* noise books */
-
- /* decode noise energy */
- if (noise_pcm_flag)
- {
- int16_t n = ics->dpcm_noise_nrg;
- noise_pcm_flag = 0;
- noise_energy += n;
- } else {
- t = rvlc_huffman_sf(ld_sf, ld_esc, +1);
- noise_energy += t;
- }
-
- ics->scale_factors[g][sfb] = noise_energy;
-
- break;
- default: /* spectral books */
-
- /* decode scale factor */
- t = rvlc_huffman_sf(ld_sf, ld_esc, +1);
-
- scale_factor += t;
- if (scale_factor < 0)
- return 4;
-
- ics->scale_factors[g][sfb] = scale_factor;
-
- break;
- }
-#ifdef PRINT_RVLC
- printf("%3d:%4d%4d\n", sfb, ics->sfb_cb[g][sfb],
- ics->scale_factors[g][sfb]);
-#endif
- if (t == 99)
- {
- error = 1;
- }
- }
- }
- }
-#ifdef PRINT_RVLC
- printf("\n\n");
-#endif
-
- return 0;
-}
-
-#if 0 // not used right now, doesn't work correctly yet
-static uint8_t rvlc_decode_sf_reverse(ic_stream *ics, bitfile *ld_sf, bitfile *ld_esc,
- uint8_t intensity_used)
-{
- int8_t g, sfb;
- int8_t t = 0;
- int8_t error = 0;
- int8_t noise_pcm_flag = 1, is_pcm_flag = 1, sf_pcm_flag = 1;
-
- int16_t scale_factor = ics->rev_global_gain;
- int16_t is_position = 0;
- int16_t noise_energy = ics->rev_global_gain;
-
-#ifdef PRINT_RVLC
- printf("\nrev_global_gain: %d\n", ics->rev_global_gain);
-#endif
-
- if (intensity_used)
- {
- is_position = rvlc_huffman_sf(ld_sf, ld_esc, -1);
-#ifdef PRINT_RVLC
- printf("is_position: %d\n", is_position);
-#endif
- }
-
- for (g = ics->num_window_groups-1; g >= 0; g--)
- {
- for (sfb = ics->max_sfb-1; sfb >= 0; sfb--)
- {
- if (error)
- {
- ics->scale_factors[g][sfb] = 0;
- } else {
- switch (ics->sfb_cb[g][sfb])
- {
- case ZERO_HCB: /* zero book */
- ics->scale_factors[g][sfb] = 0;
- break;
- case INTENSITY_HCB: /* intensity books */
- case INTENSITY_HCB2:
-
- if (is_pcm_flag)
- {
- is_pcm_flag = 0;
- ics->scale_factors[g][sfb] = is_position;
- } else {
- t = rvlc_huffman_sf(ld_sf, ld_esc, -1);
- is_position -= t;
-
- ics->scale_factors[g][sfb] = (uint8_t)is_position;
- }
- break;
- case NOISE_HCB: /* noise books */
-
- /* decode noise energy */
- if (noise_pcm_flag)
- {
- noise_pcm_flag = 0;
- noise_energy = ics->dpcm_noise_last_position;
- } else {
- t = rvlc_huffman_sf(ld_sf, ld_esc, -1);
- noise_energy -= t;
- }
-
- ics->scale_factors[g][sfb] = (uint8_t)noise_energy;
- break;
- default: /* spectral books */
-
- if (sf_pcm_flag || (sfb == 0))
- {
- sf_pcm_flag = 0;
- if (sfb == 0)
- scale_factor = ics->global_gain;
- } else {
- /* decode scale factor */
- t = rvlc_huffman_sf(ld_sf, ld_esc, -1);
- scale_factor -= t;
- }
-
- if (scale_factor < 0)
- return 4;
-
- ics->scale_factors[g][sfb] = (uint8_t)scale_factor;
- break;
- }
-#ifdef PRINT_RVLC
- printf("%3d:%4d%4d\n", sfb, ics->sfb_cb[g][sfb],
- ics->scale_factors[g][sfb]);
-#endif
- if (t == 99)
- {
- error = 1;
- }
- }
- }
- }
-
-#ifdef PRINT_RVLC
- printf("\n\n");
-#endif
-
- return 0;
-}
-#endif
-
-/* index == 99 means not allowed codeword */
-static rvlc_huff_table book_rvlc[] = {
- /*index length codeword */
- { 0, 1, 0 }, /* 0 */
- { -1, 3, 5 }, /* 101 */
- { 1, 3, 7 }, /* 111 */
- { -2, 4, 9 }, /* 1001 */
- { -3, 5, 17 }, /* 10001 */
- { 2, 5, 27 }, /* 11011 */
- { -4, 6, 33 }, /* 100001 */
- { 99, 6, 50 }, /* 110010 */
- { 3, 6, 51 }, /* 110011 */
- { 99, 6, 52 }, /* 110100 */
- { -7, 7, 65 }, /* 1000001 */
- { 99, 7, 96 }, /* 1100000 */
- { 99, 7, 98 }, /* 1100010 */
- { 7, 7, 99 }, /* 1100011 */
- { 4, 7, 107 }, /* 1101011 */
- { -5, 8, 129 }, /* 10000001 */
- { 99, 8, 194 }, /* 11000010 */
- { 5, 8, 195 }, /* 11000011 */
- { 99, 8, 212 }, /* 11010100 */
- { 99, 9, 256 }, /* 100000000 */
- { -6, 9, 257 }, /* 100000001 */
- { 99, 9, 426 }, /* 110101010 */
- { 6, 9, 427 }, /* 110101011 */
- { 99, 10, 0 } /* Shouldn't come this far */
-};
-
-static rvlc_huff_table book_escape[] = {
- /*index length codeword */
- { 1, 2, 0 },
- { 0, 2, 2 },
- { 3, 3, 2 },
- { 2, 3, 6 },
- { 4, 4, 14 },
- { 7, 5, 13 },
- { 6, 5, 15 },
- { 5, 5, 31 },
- { 11, 6, 24 },
- { 10, 6, 25 },
- { 9, 6, 29 },
- { 8, 6, 61 },
- { 13, 7, 56 },
- { 12, 7, 120 },
- { 15, 8, 114 },
- { 14, 8, 242 },
- { 17, 9, 230 },
- { 16, 9, 486 },
- { 19, 10, 463 },
- { 18, 10, 974 },
- { 22, 11, 925 },
- { 20, 11, 1950 },
- { 21, 11, 1951 },
- { 23, 12, 1848 },
- { 25, 13, 3698 },
- { 24, 14, 7399 },
- { 26, 15, 14797 },
- { 49, 19, 236736 },
- { 50, 19, 236737 },
- { 51, 19, 236738 },
- { 52, 19, 236739 },
- { 53, 19, 236740 },
- { 27, 20, 473482 },
- { 28, 20, 473483 },
- { 29, 20, 473484 },
- { 30, 20, 473485 },
- { 31, 20, 473486 },
- { 32, 20, 473487 },
- { 33, 20, 473488 },
- { 34, 20, 473489 },
- { 35, 20, 473490 },
- { 36, 20, 473491 },
- { 37, 20, 473492 },
- { 38, 20, 473493 },
- { 39, 20, 473494 },
- { 40, 20, 473495 },
- { 41, 20, 473496 },
- { 42, 20, 473497 },
- { 43, 20, 473498 },
- { 44, 20, 473499 },
- { 45, 20, 473500 },
- { 46, 20, 473501 },
- { 47, 20, 473502 },
- { 48, 20, 473503 },
- { 99, 21, 0 } /* Shouldn't come this far */
-};
-
-static int8_t rvlc_huffman_sf(bitfile *ld_sf, bitfile *ld_esc,
- int8_t direction)
-{
- uint8_t i, j;
- int8_t index;
- uint32_t cw;
- rvlc_huff_table *h = book_rvlc;
-
- i = h->len;
- if (direction > 0)
- cw = faad_getbits(ld_sf, i DEBUGVAR(1,0,""));
- else
- cw = faad_getbits_rev(ld_sf, i DEBUGVAR(1,0,""));
-
- while ((cw != h->cw)
- && (i < 10))
- {
- h++;
- j = h->len-i;
- i += j;
- cw <<= j;
- if (direction > 0)
- cw |= faad_getbits(ld_sf, j DEBUGVAR(1,0,""));
- else
- cw |= faad_getbits_rev(ld_sf, j DEBUGVAR(1,0,""));
- }
-
- index = h->index;
-
- if (index == +ESC_VAL)
- {
- int8_t esc = rvlc_huffman_esc(ld_esc, direction);
- if (esc == 99)
- return 99;
- index += esc;
-#ifdef PRINT_RVLC
- printf("esc: %d - ", esc);
-#endif
- }
- if (index == -ESC_VAL)
- {
- int8_t esc = rvlc_huffman_esc(ld_esc, direction);
- if (esc == 99)
- return 99;
- index -= esc;
-#ifdef PRINT_RVLC
- printf("esc: %d - ", esc);
-#endif
- }
-
- return index;
-}
-
-static int8_t rvlc_huffman_esc(bitfile *ld,
- int8_t direction)
-{
- uint8_t i, j;
- uint32_t cw;
- rvlc_huff_table *h = book_escape;
-
- i = h->len;
- if (direction > 0)
- cw = faad_getbits(ld, i DEBUGVAR(1,0,""));
- else
- cw = faad_getbits_rev(ld, i DEBUGVAR(1,0,""));
-
- while ((cw != h->cw)
- && (i < 21))
- {
- h++;
- j = h->len-i;
- i += j;
- cw <<= j;
- if (direction > 0)
- cw |= faad_getbits(ld, j DEBUGVAR(1,0,""));
- else
- cw |= faad_getbits_rev(ld, j DEBUGVAR(1,0,""));
- }
-
- return h->index;
-}
-
-#endif
-
diff --git a/src/libfaad/rvlc.h b/src/libfaad/rvlc.h
deleted file mode 100644
index 867468580..000000000
--- a/src/libfaad/rvlc.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: rvlc.h,v 1.6 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __RVLC_SCF_H__
-#define __RVLC_SCF_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct
-{
- int8_t index;
- uint8_t len;
- uint32_t cw;
-} rvlc_huff_table;
-
-
-#define ESC_VAL 7
-
-
-uint8_t rvlc_scale_factor_data(ic_stream *ics, bitfile *ld);
-uint8_t rvlc_decode_scale_factors(ic_stream *ics, bitfile *ld);
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/libfaad/sbr_dct.c b/src/libfaad/sbr_dct.c
deleted file mode 100644
index ba8bbaf9b..000000000
--- a/src/libfaad/sbr_dct.c
+++ /dev/null
@@ -1,2271 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_dct.c,v 1.5 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#include "common.h"
-
-#ifdef SBR_DEC
-
-#ifdef _MSC_VER
-#pragma warning(disable:4305)
-#pragma warning(disable:4244)
-#endif
-
-
-#include "sbr_dct.h"
-
-void DCT4_32(real_t *y, real_t *x)
-{
- real_t f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10;
- real_t f11, f12, f13, f14, f15, f16, f17, f18, f19, f20;
- real_t f21, f22, f23, f24, f25, f26, f27, f28, f29, f30;
- real_t f31, f32, f33, f34, f35, f36, f37, f38, f39, f40;
- real_t f41, f42, f43, f44, f45, f46, f47, f48, f49, f50;
- real_t f51, f52, f53, f54, f55, f56, f57, f58, f59, f60;
- real_t f61, f62, f63, f64, f65, f66, f67, f68, f69, f70;
- real_t f71, f72, f73, f74, f75, f76, f77, f78, f79, f80;
- real_t f81, f82, f83, f84, f85, f86, f87, f88, f89, f90;
- real_t f91, f92, f93, f94, f95, f96, f97, f98, f99, f100;
- real_t f101, f102, f103, f104, f105, f106, f107, f108, f109, f110;
- real_t f111, f112, f113, f114, f115, f116, f117, f118, f119, f120;
- real_t f121, f122, f123, f124, f125, f126, f127, f128, f129, f130;
- real_t f131, f132, f133, f134, f135, f136, f137, f138, f139, f140;
- real_t f141, f142, f143, f144, f145, f146, f147, f148, f149, f150;
- real_t f151, f152, f153, f154, f155, f156, f157, f158, f159, f160;
- real_t f161, f162, f163, f164, f165, f166, f167, f168, f169, f170;
- real_t f171, f172, f173, f174, f175, f176, f177, f178, f179, f180;
- real_t f181, f182, f183, f184, f185, f186, f187, f188, f189, f190;
- real_t f191, f192, f193, f194, f195, f196, f197, f198, f199, f200;
- real_t f201, f202, f203, f204, f205, f206, f207, f208, f209, f210;
- real_t f211, f212, f213, f214, f215, f216, f217, f218, f219, f220;
- real_t f221, f222, f223, f224, f225, f226, f227, f228, f229, f230;
- real_t f231, f232, f233, f234, f235, f236, f237, f238, f239, f240;
- real_t f241, f242, f243, f244, f245, f246, f247, f248, f249, f250;
- real_t f251, f252, f253, f254, f255, f256, f257, f258, f259, f260;
- real_t f261, f262, f263, f264, f265, f266, f267, f268, f269, f270;
- real_t f271, f272, f273, f274, f275, f276, f277, f278, f279, f280;
- real_t f281, f282, f283, f284, f285, f286, f287, f288, f289, f290;
- real_t f291, f292, f293, f294, f295, f296, f297, f298, f299, f300;
- real_t f301, f302, f303, f304, f305, f306, f307, f310, f311, f312;
- real_t f313, f316, f317, f318, f319, f322, f323, f324, f325, f328;
- real_t f329, f330, f331, f334, f335, f336, f337, f340, f341, f342;
- real_t f343, f346, f347, f348, f349, f352, f353, f354, f355, f358;
- real_t f359, f360, f361, f364, f365, f366, f367, f370, f371, f372;
- real_t f373, f376, f377, f378, f379, f382, f383, f384, f385, f388;
- real_t f389, f390, f391, f394, f395, f396, f397;
-
- f0 = x[15] - x[16];
- f1 = x[15] + x[16];
- f2 = MUL_F(FRAC_CONST(0.7071067811865476), f1);
- f3 = MUL_F(FRAC_CONST(0.7071067811865476), f0);
- f4 = x[8] - x[23];
- f5 = x[8] + x[23];
- f6 = MUL_F(FRAC_CONST(0.7071067811865476), f5);
- f7 = MUL_F(FRAC_CONST(0.7071067811865476), f4);
- f8 = x[12] - x[19];
- f9 = x[12] + x[19];
- f10 = MUL_F(FRAC_CONST(0.7071067811865476), f9);
- f11 = MUL_F(FRAC_CONST(0.7071067811865476), f8);
- f12 = x[11] - x[20];
- f13 = x[11] + x[20];
- f14 = MUL_F(FRAC_CONST(0.7071067811865476), f13);
- f15 = MUL_F(FRAC_CONST(0.7071067811865476), f12);
- f16 = x[14] - x[17];
- f17 = x[14] + x[17];
- f18 = MUL_F(FRAC_CONST(0.7071067811865476), f17);
- f19 = MUL_F(FRAC_CONST(0.7071067811865476), f16);
- f20 = x[9] - x[22];
- f21 = x[9] + x[22];
- f22 = MUL_F(FRAC_CONST(0.7071067811865476), f21);
- f23 = MUL_F(FRAC_CONST(0.7071067811865476), f20);
- f24 = x[13] - x[18];
- f25 = x[13] + x[18];
- f26 = MUL_F(FRAC_CONST(0.7071067811865476), f25);
- f27 = MUL_F(FRAC_CONST(0.7071067811865476), f24);
- f28 = x[10] - x[21];
- f29 = x[10] + x[21];
- f30 = MUL_F(FRAC_CONST(0.7071067811865476), f29);
- f31 = MUL_F(FRAC_CONST(0.7071067811865476), f28);
- f32 = x[0] - f2;
- f33 = x[0] + f2;
- f34 = x[31] - f3;
- f35 = x[31] + f3;
- f36 = x[7] - f6;
- f37 = x[7] + f6;
- f38 = x[24] - f7;
- f39 = x[24] + f7;
- f40 = x[3] - f10;
- f41 = x[3] + f10;
- f42 = x[28] - f11;
- f43 = x[28] + f11;
- f44 = x[4] - f14;
- f45 = x[4] + f14;
- f46 = x[27] - f15;
- f47 = x[27] + f15;
- f48 = x[1] - f18;
- f49 = x[1] + f18;
- f50 = x[30] - f19;
- f51 = x[30] + f19;
- f52 = x[6] - f22;
- f53 = x[6] + f22;
- f54 = x[25] - f23;
- f55 = x[25] + f23;
- f56 = x[2] - f26;
- f57 = x[2] + f26;
- f58 = x[29] - f27;
- f59 = x[29] + f27;
- f60 = x[5] - f30;
- f61 = x[5] + f30;
- f62 = x[26] - f31;
- f63 = x[26] + f31;
- f64 = f39 + f37;
- f65 = MUL_F(FRAC_CONST(-0.5411961001461969), f39);
- f66 = MUL_F(FRAC_CONST(0.9238795325112867), f64);
- f67 = MUL_C(COEF_CONST(1.3065629648763766), f37);
- f68 = f65 + f66;
- f69 = f67 - f66;
- f70 = f38 + f36;
- f71 = MUL_C(COEF_CONST(1.3065629648763770), f38);
- f72 = MUL_F(FRAC_CONST(-0.3826834323650904), f70);
- f73 = MUL_F(FRAC_CONST(0.5411961001461961), f36);
- f74 = f71 + f72;
- f75 = f73 - f72;
- f76 = f47 + f45;
- f77 = MUL_F(FRAC_CONST(-0.5411961001461969), f47);
- f78 = MUL_F(FRAC_CONST(0.9238795325112867), f76);
- f79 = MUL_C(COEF_CONST(1.3065629648763766), f45);
- f80 = f77 + f78;
- f81 = f79 - f78;
- f82 = f46 + f44;
- f83 = MUL_C(COEF_CONST(1.3065629648763770), f46);
- f84 = MUL_F(FRAC_CONST(-0.3826834323650904), f82);
- f85 = MUL_F(FRAC_CONST(0.5411961001461961), f44);
- f86 = f83 + f84;
- f87 = f85 - f84;
- f88 = f55 + f53;
- f89 = MUL_F(FRAC_CONST(-0.5411961001461969), f55);
- f90 = MUL_F(FRAC_CONST(0.9238795325112867), f88);
- f91 = MUL_C(COEF_CONST(1.3065629648763766), f53);
- f92 = f89 + f90;
- f93 = f91 - f90;
- f94 = f54 + f52;
- f95 = MUL_C(COEF_CONST(1.3065629648763770), f54);
- f96 = MUL_F(FRAC_CONST(-0.3826834323650904), f94);
- f97 = MUL_F(FRAC_CONST(0.5411961001461961), f52);
- f98 = f95 + f96;
- f99 = f97 - f96;
- f100 = f63 + f61;
- f101 = MUL_F(FRAC_CONST(-0.5411961001461969), f63);
- f102 = MUL_F(FRAC_CONST(0.9238795325112867), f100);
- f103 = MUL_C(COEF_CONST(1.3065629648763766), f61);
- f104 = f101 + f102;
- f105 = f103 - f102;
- f106 = f62 + f60;
- f107 = MUL_C(COEF_CONST(1.3065629648763770), f62);
- f108 = MUL_F(FRAC_CONST(-0.3826834323650904), f106);
- f109 = MUL_F(FRAC_CONST(0.5411961001461961), f60);
- f110 = f107 + f108;
- f111 = f109 - f108;
- f112 = f33 - f68;
- f113 = f33 + f68;
- f114 = f35 - f69;
- f115 = f35 + f69;
- f116 = f32 - f74;
- f117 = f32 + f74;
- f118 = f34 - f75;
- f119 = f34 + f75;
- f120 = f41 - f80;
- f121 = f41 + f80;
- f122 = f43 - f81;
- f123 = f43 + f81;
- f124 = f40 - f86;
- f125 = f40 + f86;
- f126 = f42 - f87;
- f127 = f42 + f87;
- f128 = f49 - f92;
- f129 = f49 + f92;
- f130 = f51 - f93;
- f131 = f51 + f93;
- f132 = f48 - f98;
- f133 = f48 + f98;
- f134 = f50 - f99;
- f135 = f50 + f99;
- f136 = f57 - f104;
- f137 = f57 + f104;
- f138 = f59 - f105;
- f139 = f59 + f105;
- f140 = f56 - f110;
- f141 = f56 + f110;
- f142 = f58 - f111;
- f143 = f58 + f111;
- f144 = f123 + f121;
- f145 = MUL_F(FRAC_CONST(-0.7856949583871021), f123);
- f146 = MUL_F(FRAC_CONST(0.9807852804032304), f144);
- f147 = MUL_C(COEF_CONST(1.1758756024193588), f121);
- f148 = f145 + f146;
- f149 = f147 - f146;
- f150 = f127 + f125;
- f151 = MUL_F(FRAC_CONST(0.2758993792829431), f127);
- f152 = MUL_F(FRAC_CONST(0.5555702330196022), f150);
- f153 = MUL_C(COEF_CONST(1.3870398453221475), f125);
- f154 = f151 + f152;
- f155 = f153 - f152;
- f156 = f122 + f120;
- f157 = MUL_C(COEF_CONST(1.1758756024193591), f122);
- f158 = MUL_F(FRAC_CONST(-0.1950903220161287), f156);
- f159 = MUL_F(FRAC_CONST(0.7856949583871016), f120);
- f160 = f157 + f158;
- f161 = f159 - f158;
- f162 = f126 + f124;
- f163 = MUL_C(COEF_CONST(1.3870398453221473), f126);
- f164 = MUL_F(FRAC_CONST(-0.8314696123025455), f162);
- f165 = MUL_F(FRAC_CONST(-0.2758993792829436), f124);
- f166 = f163 + f164;
- f167 = f165 - f164;
- f168 = f139 + f137;
- f169 = MUL_F(FRAC_CONST(-0.7856949583871021), f139);
- f170 = MUL_F(FRAC_CONST(0.9807852804032304), f168);
- f171 = MUL_C(COEF_CONST(1.1758756024193588), f137);
- f172 = f169 + f170;
- f173 = f171 - f170;
- f174 = f143 + f141;
- f175 = MUL_F(FRAC_CONST(0.2758993792829431), f143);
- f176 = MUL_F(FRAC_CONST(0.5555702330196022), f174);
- f177 = MUL_C(COEF_CONST(1.3870398453221475), f141);
- f178 = f175 + f176;
- f179 = f177 - f176;
- f180 = f138 + f136;
- f181 = MUL_C(COEF_CONST(1.1758756024193591), f138);
- f182 = MUL_F(FRAC_CONST(-0.1950903220161287), f180);
- f183 = MUL_F(FRAC_CONST(0.7856949583871016), f136);
- f184 = f181 + f182;
- f185 = f183 - f182;
- f186 = f142 + f140;
- f187 = MUL_C(COEF_CONST(1.3870398453221473), f142);
- f188 = MUL_F(FRAC_CONST(-0.8314696123025455), f186);
- f189 = MUL_F(FRAC_CONST(-0.2758993792829436), f140);
- f190 = f187 + f188;
- f191 = f189 - f188;
- f192 = f113 - f148;
- f193 = f113 + f148;
- f194 = f115 - f149;
- f195 = f115 + f149;
- f196 = f117 - f154;
- f197 = f117 + f154;
- f198 = f119 - f155;
- f199 = f119 + f155;
- f200 = f112 - f160;
- f201 = f112 + f160;
- f202 = f114 - f161;
- f203 = f114 + f161;
- f204 = f116 - f166;
- f205 = f116 + f166;
- f206 = f118 - f167;
- f207 = f118 + f167;
- f208 = f129 - f172;
- f209 = f129 + f172;
- f210 = f131 - f173;
- f211 = f131 + f173;
- f212 = f133 - f178;
- f213 = f133 + f178;
- f214 = f135 - f179;
- f215 = f135 + f179;
- f216 = f128 - f184;
- f217 = f128 + f184;
- f218 = f130 - f185;
- f219 = f130 + f185;
- f220 = f132 - f190;
- f221 = f132 + f190;
- f222 = f134 - f191;
- f223 = f134 + f191;
- f224 = f211 + f209;
- f225 = MUL_F(FRAC_CONST(-0.8971675863426361), f211);
- f226 = MUL_F(FRAC_CONST(0.9951847266721968), f224);
- f227 = MUL_C(COEF_CONST(1.0932018670017576), f209);
- f228 = f225 + f226;
- f229 = f227 - f226;
- f230 = f215 + f213;
- f231 = MUL_F(FRAC_CONST(-0.4105245275223571), f215);
- f232 = MUL_F(FRAC_CONST(0.8819212643483549), f230);
- f233 = MUL_C(COEF_CONST(1.3533180011743529), f213);
- f234 = f231 + f232;
- f235 = f233 - f232;
- f236 = f219 + f217;
- f237 = MUL_F(FRAC_CONST(0.1386171691990915), f219);
- f238 = MUL_F(FRAC_CONST(0.6343932841636455), f236);
- f239 = MUL_C(COEF_CONST(1.4074037375263826), f217);
- f240 = f237 + f238;
- f241 = f239 - f238;
- f242 = f223 + f221;
- f243 = MUL_F(FRAC_CONST(0.6666556584777466), f223);
- f244 = MUL_F(FRAC_CONST(0.2902846772544623), f242);
- f245 = MUL_C(COEF_CONST(1.2472250129866711), f221);
- f246 = f243 + f244;
- f247 = f245 - f244;
- f248 = f210 + f208;
- f249 = MUL_C(COEF_CONST(1.0932018670017574), f210);
- f250 = MUL_F(FRAC_CONST(-0.0980171403295605), f248);
- f251 = MUL_F(FRAC_CONST(0.8971675863426364), f208);
- f252 = f249 + f250;
- f253 = f251 - f250;
- f254 = f214 + f212;
- f255 = MUL_C(COEF_CONST(1.3533180011743529), f214);
- f256 = MUL_F(FRAC_CONST(-0.4713967368259979), f254);
- f257 = MUL_F(FRAC_CONST(0.4105245275223569), f212);
- f258 = f255 + f256;
- f259 = f257 - f256;
- f260 = f218 + f216;
- f261 = MUL_C(COEF_CONST(1.4074037375263826), f218);
- f262 = MUL_F(FRAC_CONST(-0.7730104533627369), f260);
- f263 = MUL_F(FRAC_CONST(-0.1386171691990913), f216);
- f264 = f261 + f262;
- f265 = f263 - f262;
- f266 = f222 + f220;
- f267 = MUL_C(COEF_CONST(1.2472250129866711), f222);
- f268 = MUL_F(FRAC_CONST(-0.9569403357322089), f266);
- f269 = MUL_F(FRAC_CONST(-0.6666556584777469), f220);
- f270 = f267 + f268;
- f271 = f269 - f268;
- f272 = f193 - f228;
- f273 = f193 + f228;
- f274 = f195 - f229;
- f275 = f195 + f229;
- f276 = f197 - f234;
- f277 = f197 + f234;
- f278 = f199 - f235;
- f279 = f199 + f235;
- f280 = f201 - f240;
- f281 = f201 + f240;
- f282 = f203 - f241;
- f283 = f203 + f241;
- f284 = f205 - f246;
- f285 = f205 + f246;
- f286 = f207 - f247;
- f287 = f207 + f247;
- f288 = f192 - f252;
- f289 = f192 + f252;
- f290 = f194 - f253;
- f291 = f194 + f253;
- f292 = f196 - f258;
- f293 = f196 + f258;
- f294 = f198 - f259;
- f295 = f198 + f259;
- f296 = f200 - f264;
- f297 = f200 + f264;
- f298 = f202 - f265;
- f299 = f202 + f265;
- f300 = f204 - f270;
- f301 = f204 + f270;
- f302 = f206 - f271;
- f303 = f206 + f271;
- f304 = f275 + f273;
- f305 = MUL_F(FRAC_CONST(-0.9751575901732920), f275);
- f306 = MUL_F(FRAC_CONST(0.9996988186962043), f304);
- f307 = MUL_C(COEF_CONST(1.0242400472191164), f273);
- y[0] = f305 + f306;
- y[31] = f307 - f306;
- f310 = f279 + f277;
- f311 = MUL_F(FRAC_CONST(-0.8700688593994936), f279);
- f312 = MUL_F(FRAC_CONST(0.9924795345987100), f310);
- f313 = MUL_C(COEF_CONST(1.1148902097979263), f277);
- y[2] = f311 + f312;
- y[29] = f313 - f312;
- f316 = f283 + f281;
- f317 = MUL_F(FRAC_CONST(-0.7566008898816587), f283);
- f318 = MUL_F(FRAC_CONST(0.9757021300385286), f316);
- f319 = MUL_C(COEF_CONST(1.1948033701953984), f281);
- y[4] = f317 + f318;
- y[27] = f319 - f318;
- f322 = f287 + f285;
- f323 = MUL_F(FRAC_CONST(-0.6358464401941451), f287);
- f324 = MUL_F(FRAC_CONST(0.9495281805930367), f322);
- f325 = MUL_C(COEF_CONST(1.2632099209919283), f285);
- y[6] = f323 + f324;
- y[25] = f325 - f324;
- f328 = f291 + f289;
- f329 = MUL_F(FRAC_CONST(-0.5089684416985408), f291);
- f330 = MUL_F(FRAC_CONST(0.9142097557035307), f328);
- f331 = MUL_C(COEF_CONST(1.3194510697085207), f289);
- y[8] = f329 + f330;
- y[23] = f331 - f330;
- f334 = f295 + f293;
- f335 = MUL_F(FRAC_CONST(-0.3771887988789273), f295);
- f336 = MUL_F(FRAC_CONST(0.8700869911087114), f334);
- f337 = MUL_C(COEF_CONST(1.3629851833384954), f293);
- y[10] = f335 + f336;
- y[21] = f337 - f336;
- f340 = f299 + f297;
- f341 = MUL_F(FRAC_CONST(-0.2417766217337384), f299);
- f342 = MUL_F(FRAC_CONST(0.8175848131515837), f340);
- f343 = MUL_C(COEF_CONST(1.3933930045694289), f297);
- y[12] = f341 + f342;
- y[19] = f343 - f342;
- f346 = f303 + f301;
- f347 = MUL_F(FRAC_CONST(-0.1040360035527077), f303);
- f348 = MUL_F(FRAC_CONST(0.7572088465064845), f346);
- f349 = MUL_C(COEF_CONST(1.4103816894602612), f301);
- y[14] = f347 + f348;
- y[17] = f349 - f348;
- f352 = f274 + f272;
- f353 = MUL_F(FRAC_CONST(0.0347065382144002), f274);
- f354 = MUL_F(FRAC_CONST(0.6895405447370668), f352);
- f355 = MUL_C(COEF_CONST(1.4137876276885337), f272);
- y[16] = f353 + f354;
- y[15] = f355 - f354;
- f358 = f278 + f276;
- f359 = MUL_F(FRAC_CONST(0.1731148370459795), f278);
- f360 = MUL_F(FRAC_CONST(0.6152315905806268), f358);
- f361 = MUL_C(COEF_CONST(1.4035780182072330), f276);
- y[18] = f359 + f360;
- y[13] = f361 - f360;
- f364 = f282 + f280;
- f365 = MUL_F(FRAC_CONST(0.3098559453626100), f282);
- f366 = MUL_F(FRAC_CONST(0.5349976198870972), f364);
- f367 = MUL_C(COEF_CONST(1.3798511851368043), f280);
- y[20] = f365 + f366;
- y[11] = f367 - f366;
- f370 = f286 + f284;
- f371 = MUL_F(FRAC_CONST(0.4436129715409088), f286);
- f372 = MUL_F(FRAC_CONST(0.4496113296546065), f370);
- f373 = MUL_C(COEF_CONST(1.3428356308501219), f284);
- y[22] = f371 + f372;
- y[9] = f373 - f372;
- f376 = f290 + f288;
- f377 = MUL_F(FRAC_CONST(0.5730977622997509), f290);
- f378 = MUL_F(FRAC_CONST(0.3598950365349881), f376);
- f379 = MUL_C(COEF_CONST(1.2928878353697271), f288);
- y[24] = f377 + f378;
- y[7] = f379 - f378;
- f382 = f294 + f292;
- f383 = MUL_F(FRAC_CONST(0.6970633083205415), f294);
- f384 = MUL_F(FRAC_CONST(0.2667127574748984), f382);
- f385 = MUL_C(COEF_CONST(1.2304888232703382), f292);
- y[26] = f383 + f384;
- y[5] = f385 - f384;
- f388 = f298 + f296;
- f389 = MUL_F(FRAC_CONST(0.8143157536286401), f298);
- f390 = MUL_F(FRAC_CONST(0.1709618887603012), f388);
- f391 = MUL_C(COEF_CONST(1.1562395311492424), f296);
- y[28] = f389 + f390;
- y[3] = f391 - f390;
- f394 = f302 + f300;
- f395 = MUL_F(FRAC_CONST(0.9237258930790228), f302);
- f396 = MUL_F(FRAC_CONST(0.0735645635996674), f394);
- f397 = MUL_C(COEF_CONST(1.0708550202783576), f300);
- y[30] = f395 + f396;
- y[1] = f397 - f396;
-}
-
-#ifdef SBR_LOW_POWER
-
-void DCT2_16_unscaled(real_t *y, real_t *x)
-{
- real_t f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10;
- real_t f11, f12, f13, f14, f15, f16, f17, f18, f19, f20;
- real_t f21, f22, f23, f24, f25, f26, f27, f28, f31, f32;
- real_t f33, f34, f37, f38, f39, f40, f41, f42, f43, f44;
- real_t f45, f46, f47, f48, f49, f51, f53, f54, f57, f58;
- real_t f59, f60, f61, f62, f63, f64, f65, f66, f67, f68;
- real_t f69, f70, f71, f72, f73, f74, f75, f76, f77, f78;
- real_t f79, f80, f81, f82, f83, f84, f85, f86, f87, f88;
- real_t f89, f90, f91, f92, f95, f96, f97, f98, f101, f102;
- real_t f103, f104, f107, f108, f109, f110;
-
- f0 = x[0] - x[15];
- f1 = x[0] + x[15];
- f2 = x[1] - x[14];
- f3 = x[1] + x[14];
- f4 = x[2] - x[13];
- f5 = x[2] + x[13];
- f6 = x[3] - x[12];
- f7 = x[3] + x[12];
- f8 = x[4] - x[11];
- f9 = x[4] + x[11];
- f10 = x[5] - x[10];
- f11 = x[5] + x[10];
- f12 = x[6] - x[9];
- f13 = x[6] + x[9];
- f14 = x[7] - x[8];
- f15 = x[7] + x[8];
- f16 = f1 - f15;
- f17 = f1 + f15;
- f18 = f3 - f13;
- f19 = f3 + f13;
- f20 = f5 - f11;
- f21 = f5 + f11;
- f22 = f7 - f9;
- f23 = f7 + f9;
- f24 = f17 - f23;
- f25 = f17 + f23;
- f26 = f19 - f21;
- f27 = f19 + f21;
- f28 = f25 - f27;
- y[0] = f25 + f27;
- y[8] = MUL_F(f28, FRAC_CONST(0.7071067811865476));
- f31 = f24 + f26;
- f32 = MUL_C(f24, COEF_CONST(1.3065629648763766));
- f33 = MUL_F(f31, FRAC_CONST(-0.9238795325112866));
- f34 = MUL_F(f26, FRAC_CONST(-0.5411961001461967));
- y[12] = f32 + f33;
- y[4] = f34 - f33;
- f37 = f16 + f22;
- f38 = MUL_C(f16, COEF_CONST(1.1758756024193588));
- f39 = MUL_F(f37, FRAC_CONST(-0.9807852804032304));
- f40 = MUL_F(f22, FRAC_CONST(-0.7856949583871021));
- f41 = f38 + f39;
- f42 = f40 - f39;
- f43 = f18 + f20;
- f44 = MUL_C(f18, COEF_CONST(1.3870398453221473));
- f45 = MUL_F(f43, FRAC_CONST(-0.8314696123025455));
- f46 = MUL_F(f20, FRAC_CONST(-0.2758993792829436));
- f47 = f44 + f45;
- f48 = f46 - f45;
- f49 = f42 - f48;
- y[2] = f42 + f48;
- f51 = MUL_F(f49, FRAC_CONST(0.7071067811865476));
- y[14] = f41 - f47;
- f53 = f41 + f47;
- f54 = MUL_F(f53, FRAC_CONST(0.7071067811865476));
- y[10] = f51 - f54;
- y[6] = f51 + f54;
- f57 = f2 - f4;
- f58 = f2 + f4;
- f59 = f6 - f8;
- f60 = f6 + f8;
- f61 = f10 - f12;
- f62 = f10 + f12;
- f63 = MUL_F(f60, FRAC_CONST(0.7071067811865476));
- f64 = f0 - f63;
- f65 = f0 + f63;
- f66 = f58 + f62;
- f67 = MUL_C(f58, COEF_CONST(1.3065629648763766));
- f68 = MUL_F(f66, FRAC_CONST(-0.9238795325112866));
- f69 = MUL_F(f62, FRAC_CONST(-0.5411961001461967));
- f70 = f67 + f68;
- f71 = f69 - f68;
- f72 = f65 - f71;
- f73 = f65 + f71;
- f74 = f64 - f70;
- f75 = f64 + f70;
- f76 = MUL_F(f59, FRAC_CONST(0.7071067811865476));
- f77 = f14 - f76;
- f78 = f14 + f76;
- f79 = f61 + f57;
- f80 = MUL_C(f61, COEF_CONST(1.3065629648763766));
- f81 = MUL_F(f79, FRAC_CONST(-0.9238795325112866));
- f82 = MUL_F(f57, FRAC_CONST(-0.5411961001461967));
- f83 = f80 + f81;
- f84 = f82 - f81;
- f85 = f78 - f84;
- f86 = f78 + f84;
- f87 = f77 - f83;
- f88 = f77 + f83;
- f89 = f86 + f73;
- f90 = MUL_F(f86, FRAC_CONST(-0.8971675863426361));
- f91 = MUL_F(f89, FRAC_CONST(0.9951847266721968));
- f92 = MUL_C(f73, COEF_CONST(1.0932018670017576));
- y[1] = f90 + f91;
- y[15] = f92 - f91;
- f95 = f75 - f88;
- f96 = MUL_F(f88, FRAC_CONST(-0.6666556584777466));
- f97 = MUL_F(f95, FRAC_CONST(0.9569403357322089));
- f98 = MUL_C(f75, COEF_CONST(1.2472250129866713));
- y[3] = f97 - f96;
- y[13] = f98 - f97;
- f101 = f87 + f74;
- f102 = MUL_F(f87, FRAC_CONST(-0.4105245275223571));
- f103 = MUL_F(f101, FRAC_CONST(0.8819212643483549));
- f104 = MUL_C(f74, COEF_CONST(1.3533180011743529));
- y[5] = f102 + f103;
- y[11] = f104 - f103;
- f107 = f72 - f85;
- f108 = MUL_F(f85, FRAC_CONST(-0.1386171691990915));
- f109 = MUL_F(f107, FRAC_CONST(0.7730104533627370));
- f110 = MUL_C(f72, COEF_CONST(1.4074037375263826));
- y[7] = f109 - f108;
- y[9] = f110 - f109;
-}
-
-void DCT4_16(real_t *y, real_t *x)
-{
- real_t f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10;
- real_t f11, f12, f13, f14, f15, f16, f17, f18, f19, f20;
- real_t f21, f22, f23, f24, f25, f26, f27, f28, f29, f30;
- real_t f31, f32, f33, f34, f35, f36, f37, f38, f39, f40;
- real_t f41, f42, f43, f44, f45, f46, f47, f48, f49, f50;
- real_t f51, f52, f53, f54, f55, f56, f57, f58, f59, f60;
- real_t f61, f62, f63, f64, f65, f66, f67, f68, f69, f70;
- real_t f71, f72, f73, f74, f75, f76, f77, f78, f79, f80;
- real_t f81, f82, f83, f84, f85, f86, f87, f88, f89, f90;
- real_t f91, f92, f93, f94, f95, f96, f97, f98, f99, f100;
- real_t f101, f102, f103, f104, f105, f106, f107, f108, f109, f110;
- real_t f111, f112, f113, f114, f115, f116, f117, f118, f119, f120;
- real_t f121, f122, f123, f124, f125, f126, f127, f128, f130, f132;
- real_t f134, f136, f138, f140, f142, f144, f145, f148, f149, f152;
- real_t f153, f156, f157;
-
- f0 = x[0] + x[15];
- f1 = MUL_C(COEF_CONST(1.0478631305325901), x[0]);
- f2 = MUL_F(FRAC_CONST(-0.9987954562051724), f0);
- f3 = MUL_F(FRAC_CONST(-0.9497277818777548), x[15]);
- f4 = f1 + f2;
- f5 = f3 - f2;
- f6 = x[2] + x[13];
- f7 = MUL_C(COEF_CONST(1.2130114330978077), x[2]);
- f8 = MUL_F(FRAC_CONST(-0.9700312531945440), f6);
- f9 = MUL_F(FRAC_CONST(-0.7270510732912803), x[13]);
- f10 = f7 + f8;
- f11 = f9 - f8;
- f12 = x[4] + x[11];
- f13 = MUL_C(COEF_CONST(1.3315443865537255), x[4]);
- f14 = MUL_F(FRAC_CONST(-0.9039892931234433), f12);
- f15 = MUL_F(FRAC_CONST(-0.4764341996931612), x[11]);
- f16 = f13 + f14;
- f17 = f15 - f14;
- f18 = x[6] + x[9];
- f19 = MUL_C(COEF_CONST(1.3989068359730781), x[6]);
- f20 = MUL_F(FRAC_CONST(-0.8032075314806453), f18);
- f21 = MUL_F(FRAC_CONST(-0.2075082269882124), x[9]);
- f22 = f19 + f20;
- f23 = f21 - f20;
- f24 = x[8] + x[7];
- f25 = MUL_C(COEF_CONST(1.4125100802019777), x[8]);
- f26 = MUL_F(FRAC_CONST(-0.6715589548470187), f24);
- f27 = MUL_F(FRAC_CONST(0.0693921705079402), x[7]);
- f28 = f25 + f26;
- f29 = f27 - f26;
- f30 = x[10] + x[5];
- f31 = MUL_C(COEF_CONST(1.3718313541934939), x[10]);
- f32 = MUL_F(FRAC_CONST(-0.5141027441932219), f30);
- f33 = MUL_F(FRAC_CONST(0.3436258658070501), x[5]);
- f34 = f31 + f32;
- f35 = f33 - f32;
- f36 = x[12] + x[3];
- f37 = MUL_C(COEF_CONST(1.2784339185752409), x[12]);
- f38 = MUL_F(FRAC_CONST(-0.3368898533922200), f36);
- f39 = MUL_F(FRAC_CONST(0.6046542117908008), x[3]);
- f40 = f37 + f38;
- f41 = f39 - f38;
- f42 = x[14] + x[1];
- f43 = MUL_C(COEF_CONST(1.1359069844201433), x[14]);
- f44 = MUL_F(FRAC_CONST(-0.1467304744553624), f42);
- f45 = MUL_F(FRAC_CONST(0.8424460355094185), x[1]);
- f46 = f43 + f44;
- f47 = f45 - f44;
- f48 = f5 - f29;
- f49 = f5 + f29;
- f50 = f4 - f28;
- f51 = f4 + f28;
- f52 = f11 - f35;
- f53 = f11 + f35;
- f54 = f10 - f34;
- f55 = f10 + f34;
- f56 = f17 - f41;
- f57 = f17 + f41;
- f58 = f16 - f40;
- f59 = f16 + f40;
- f60 = f23 - f47;
- f61 = f23 + f47;
- f62 = f22 - f46;
- f63 = f22 + f46;
- f64 = f48 + f50;
- f65 = MUL_C(COEF_CONST(1.1758756024193588), f48);
- f66 = MUL_F(FRAC_CONST(-0.9807852804032304), f64);
- f67 = MUL_F(FRAC_CONST(-0.7856949583871021), f50);
- f68 = f65 + f66;
- f69 = f67 - f66;
- f70 = f52 + f54;
- f71 = MUL_C(COEF_CONST(1.3870398453221475), f52);
- f72 = MUL_F(FRAC_CONST(-0.5555702330196022), f70);
- f73 = MUL_F(FRAC_CONST(0.2758993792829431), f54);
- f74 = f71 + f72;
- f75 = f73 - f72;
- f76 = f56 + f58;
- f77 = MUL_F(FRAC_CONST(0.7856949583871022), f56);
- f78 = MUL_F(FRAC_CONST(0.1950903220161283), f76);
- f79 = MUL_C(COEF_CONST(1.1758756024193586), f58);
- f80 = f77 + f78;
- f81 = f79 - f78;
- f82 = f60 + f62;
- f83 = MUL_F(FRAC_CONST(-0.2758993792829430), f60);
- f84 = MUL_F(FRAC_CONST(0.8314696123025452), f82);
- f85 = MUL_C(COEF_CONST(1.3870398453221475), f62);
- f86 = f83 + f84;
- f87 = f85 - f84;
- f88 = f49 - f57;
- f89 = f49 + f57;
- f90 = f51 - f59;
- f91 = f51 + f59;
- f92 = f53 - f61;
- f93 = f53 + f61;
- f94 = f55 - f63;
- f95 = f55 + f63;
- f96 = f69 - f81;
- f97 = f69 + f81;
- f98 = f68 - f80;
- f99 = f68 + f80;
- f100 = f75 - f87;
- f101 = f75 + f87;
- f102 = f74 - f86;
- f103 = f74 + f86;
- f104 = f88 + f90;
- f105 = MUL_C(COEF_CONST(1.3065629648763766), f88);
- f106 = MUL_F(FRAC_CONST(-0.9238795325112866), f104);
- f107 = MUL_F(FRAC_CONST(-0.5411961001461967), f90);
- f108 = f105 + f106;
- f109 = f107 - f106;
- f110 = f92 + f94;
- f111 = MUL_F(FRAC_CONST(0.5411961001461969), f92);
- f112 = MUL_F(FRAC_CONST(0.3826834323650898), f110);
- f113 = MUL_C(COEF_CONST(1.3065629648763766), f94);
- f114 = f111 + f112;
- f115 = f113 - f112;
- f116 = f96 + f98;
- f117 = MUL_C(COEF_CONST(1.3065629648763766), f96);
- f118 = MUL_F(FRAC_CONST(-0.9238795325112866), f116);
- f119 = MUL_F(FRAC_CONST(-0.5411961001461967), f98);
- f120 = f117 + f118;
- f121 = f119 - f118;
- f122 = f100 + f102;
- f123 = MUL_F(FRAC_CONST(0.5411961001461969), f100);
- f124 = MUL_F(FRAC_CONST(0.3826834323650898), f122);
- f125 = MUL_C(COEF_CONST(1.3065629648763766), f102);
- f126 = f123 + f124;
- f127 = f125 - f124;
- f128 = f89 - f93;
- y[0] = f89 + f93;
- f130 = f91 - f95;
- y[15] = f91 + f95;
- f132 = f109 - f115;
- y[3] = f109 + f115;
- f134 = f108 - f114;
- y[12] = f108 + f114;
- f136 = f97 - f101;
- y[1] = f97 + f101;
- f138 = f99 - f103;
- y[14] = f99 + f103;
- f140 = f121 - f127;
- y[2] = f121 + f127;
- f142 = f120 - f126;
- y[13] = f120 + f126;
- f144 = f128 - f130;
- f145 = f128 + f130;
- y[8] = MUL_F(FRAC_CONST(0.7071067811865474), f144);
- y[7] = MUL_F(FRAC_CONST(0.7071067811865474), f145);
- f148 = f132 - f134;
- f149 = f132 + f134;
- y[11] = MUL_F(FRAC_CONST(0.7071067811865474), f148);
- y[4] = MUL_F(FRAC_CONST(0.7071067811865474), f149);
- f152 = f136 - f138;
- f153 = f136 + f138;
- y[9] = MUL_F(FRAC_CONST(0.7071067811865474), f152);
- y[6] = MUL_F(FRAC_CONST(0.7071067811865474), f153);
- f156 = f140 - f142;
- f157 = f140 + f142;
- y[10] = MUL_F(FRAC_CONST(0.7071067811865474), f156);
- y[5] = MUL_F(FRAC_CONST(0.7071067811865474), f157);
-}
-
-void DCT3_32_unscaled(real_t *y, real_t *x)
-{
- real_t f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10;
- real_t f11, f12, f13, f14, f15, f16, f17, f18, f19, f20;
- real_t f21, f22, f23, f24, f25, f26, f27, f28, f29, f30;
- real_t f31, f32, f33, f34, f35, f36, f37, f38, f39, f40;
- real_t f41, f42, f43, f44, f45, f46, f47, f48, f49, f50;
- real_t f51, f52, f53, f54, f55, f56, f57, f58, f59, f60;
- real_t f61, f62, f63, f64, f65, f66, f67, f68, f69, f70;
- real_t f71, f72, f73, f74, f75, f76, f77, f78, f79, f80;
- real_t f81, f82, f83, f84, f85, f86, f87, f88, f89, f90;
- real_t f91, f92, f93, f94, f95, f96, f97, f98, f99, f100;
- real_t f101, f102, f103, f104, f105, f106, f107, f108, f109, f110;
- real_t f111, f112, f113, f114, f115, f116, f117, f118, f119, f120;
- real_t f121, f122, f123, f124, f125, f126, f127, f128, f129, f130;
- real_t f131, f132, f133, f134, f135, f136, f137, f138, f139, f140;
- real_t f141, f142, f143, f144, f145, f146, f147, f148, f149, f150;
- real_t f151, f152, f153, f154, f155, f156, f157, f158, f159, f160;
- real_t f161, f162, f163, f164, f165, f166, f167, f168, f169, f170;
- real_t f171, f172, f173, f174, f175, f176, f177, f178, f179, f180;
- real_t f181, f182, f183, f184, f185, f186, f187, f188, f189, f190;
- real_t f191, f192, f193, f194, f195, f196, f197, f198, f199, f200;
- real_t f201, f202, f203, f204, f205, f206, f207, f208, f209, f210;
- real_t f211, f212, f213, f214, f215, f216, f217, f218, f219, f220;
- real_t f221, f222, f223, f224, f225, f226, f227, f228, f229, f230;
- real_t f231, f232, f233, f234, f235, f236, f237, f238, f239, f240;
- real_t f241, f242, f243, f244, f245, f246, f247, f248, f249, f250;
- real_t f251, f252, f253, f254, f255, f256, f257, f258, f259, f260;
- real_t f261, f262, f263, f264, f265, f266, f267, f268, f269, f270;
- real_t f271, f272;
-
- f0 = MUL_F(x[16], FRAC_CONST(0.7071067811865476));
- f1 = x[0] - f0;
- f2 = x[0] + f0;
- f3 = x[8] + x[24];
- f4 = MUL_C(x[8], COEF_CONST(1.3065629648763766));
- f5 = MUL_F(f3, FRAC_CONST((-0.9238795325112866)));
- f6 = MUL_F(x[24], FRAC_CONST((-0.5411961001461967)));
- f7 = f4 + f5;
- f8 = f6 - f5;
- f9 = f2 - f8;
- f10 = f2 + f8;
- f11 = f1 - f7;
- f12 = f1 + f7;
- f13 = x[4] + x[28];
- f14 = MUL_C(x[4], COEF_CONST(1.1758756024193588));
- f15 = MUL_F(f13, FRAC_CONST((-0.9807852804032304)));
- f16 = MUL_F(x[28], FRAC_CONST((-0.7856949583871021)));
- f17 = f14 + f15;
- f18 = f16 - f15;
- f19 = x[12] + x[20];
- f20 = MUL_C(x[12], COEF_CONST(1.3870398453221473));
- f21 = MUL_F(f19, FRAC_CONST((-0.8314696123025455)));
- f22 = MUL_F(x[20], FRAC_CONST((-0.2758993792829436)));
- f23 = f20 + f21;
- f24 = f22 - f21;
- f25 = f18 - f24;
- f26 = f18 + f24;
- f27 = MUL_F(f25, FRAC_CONST(0.7071067811865476));
- f28 = f17 - f23;
- f29 = f17 + f23;
- f30 = MUL_F(f29, FRAC_CONST(0.7071067811865476));
- f31 = f27 - f30;
- f32 = f27 + f30;
- f33 = f10 - f26;
- f34 = f10 + f26;
- f35 = f12 - f32;
- f36 = f12 + f32;
- f37 = f11 - f31;
- f38 = f11 + f31;
- f39 = f9 - f28;
- f40 = f9 + f28;
- f41 = x[2] + x[30];
- f42 = MUL_C(x[2], COEF_CONST(1.0932018670017569));
- f43 = MUL_F(f41, FRAC_CONST((-0.9951847266721969)));
- f44 = MUL_F(x[30], FRAC_CONST((-0.8971675863426368)));
- f45 = f42 + f43;
- f46 = f44 - f43;
- f47 = x[6] + x[26];
- f48 = MUL_C(x[6], COEF_CONST(1.2472250129866711));
- f49 = MUL_F(f47, FRAC_CONST((-0.9569403357322089)));
- f50 = MUL_F(x[26], FRAC_CONST((-0.6666556584777469)));
- f51 = f48 + f49;
- f52 = f50 - f49;
- f53 = x[10] + x[22];
- f54 = MUL_C(x[10], COEF_CONST(1.3533180011743526));
- f55 = MUL_F(f53, FRAC_CONST((-0.8819212643483551)));
- f56 = MUL_F(x[22], FRAC_CONST((-0.4105245275223575)));
- f57 = f54 + f55;
- f58 = f56 - f55;
- f59 = x[14] + x[18];
- f60 = MUL_C(x[14], COEF_CONST(1.4074037375263826));
- f61 = MUL_F(f59, FRAC_CONST((-0.7730104533627369)));
- f62 = MUL_F(x[18], FRAC_CONST((-0.1386171691990913)));
- f63 = f60 + f61;
- f64 = f62 - f61;
- f65 = f46 - f64;
- f66 = f46 + f64;
- f67 = f52 - f58;
- f68 = f52 + f58;
- f69 = f66 - f68;
- f70 = f66 + f68;
- f71 = MUL_F(f69, FRAC_CONST(0.7071067811865476));
- f72 = f65 + f67;
- f73 = MUL_C(f65, COEF_CONST(1.3065629648763766));
- f74 = MUL_F(f72, FRAC_CONST((-0.9238795325112866)));
- f75 = MUL_F(f67, FRAC_CONST((-0.5411961001461967)));
- f76 = f73 + f74;
- f77 = f75 - f74;
- f78 = f45 - f63;
- f79 = f45 + f63;
- f80 = f51 - f57;
- f81 = f51 + f57;
- f82 = f79 + f81;
- f83 = MUL_C(f79, COEF_CONST(1.3065629648763770));
- f84 = MUL_F(f82, FRAC_CONST((-0.3826834323650904)));
- f85 = MUL_F(f81, FRAC_CONST(0.5411961001461961));
- f86 = f83 + f84;
- f87 = f85 - f84;
- f88 = f78 - f80;
- f89 = f78 + f80;
- f90 = MUL_F(f89, FRAC_CONST(0.7071067811865476));
- f91 = f77 - f87;
- f92 = f77 + f87;
- f93 = f71 - f90;
- f94 = f71 + f90;
- f95 = f76 - f86;
- f96 = f76 + f86;
- f97 = f34 - f70;
- f98 = f34 + f70;
- f99 = f36 - f92;
- f100 = f36 + f92;
- f101 = f38 - f91;
- f102 = f38 + f91;
- f103 = f40 - f94;
- f104 = f40 + f94;
- f105 = f39 - f93;
- f106 = f39 + f93;
- f107 = f37 - f96;
- f108 = f37 + f96;
- f109 = f35 - f95;
- f110 = f35 + f95;
- f111 = f33 - f88;
- f112 = f33 + f88;
- f113 = x[1] + x[31];
- f114 = MUL_C(x[1], COEF_CONST(1.0478631305325901));
- f115 = MUL_F(f113, FRAC_CONST((-0.9987954562051724)));
- f116 = MUL_F(x[31], FRAC_CONST((-0.9497277818777548)));
- f117 = f114 + f115;
- f118 = f116 - f115;
- f119 = x[5] + x[27];
- f120 = MUL_C(x[5], COEF_CONST(1.2130114330978077));
- f121 = MUL_F(f119, FRAC_CONST((-0.9700312531945440)));
- f122 = MUL_F(x[27], FRAC_CONST((-0.7270510732912803)));
- f123 = f120 + f121;
- f124 = f122 - f121;
- f125 = x[9] + x[23];
- f126 = MUL_C(x[9], COEF_CONST(1.3315443865537255));
- f127 = MUL_F(f125, FRAC_CONST((-0.9039892931234433)));
- f128 = MUL_F(x[23], FRAC_CONST((-0.4764341996931612)));
- f129 = f126 + f127;
- f130 = f128 - f127;
- f131 = x[13] + x[19];
- f132 = MUL_C(x[13], COEF_CONST(1.3989068359730781));
- f133 = MUL_F(f131, FRAC_CONST((-0.8032075314806453)));
- f134 = MUL_F(x[19], FRAC_CONST((-0.2075082269882124)));
- f135 = f132 + f133;
- f136 = f134 - f133;
- f137 = x[17] + x[15];
- f138 = MUL_C(x[17], COEF_CONST(1.4125100802019777));
- f139 = MUL_F(f137, FRAC_CONST((-0.6715589548470187)));
- f140 = MUL_F(x[15], FRAC_CONST(0.0693921705079402));
- f141 = f138 + f139;
- f142 = f140 - f139;
- f143 = x[21] + x[11];
- f144 = MUL_C(x[21], COEF_CONST(1.3718313541934939));
- f145 = MUL_F(f143, FRAC_CONST((-0.5141027441932219)));
- f146 = MUL_F(x[11], FRAC_CONST(0.3436258658070501));
- f147 = f144 + f145;
- f148 = f146 - f145;
- f149 = x[25] + x[7];
- f150 = MUL_C(x[25], COEF_CONST(1.2784339185752409));
- f151 = MUL_F(f149, FRAC_CONST((-0.3368898533922200)));
- f152 = MUL_F(x[7], FRAC_CONST(0.6046542117908008));
- f153 = f150 + f151;
- f154 = f152 - f151;
- f155 = x[29] + x[3];
- f156 = MUL_C(x[29], COEF_CONST(1.1359069844201433));
- f157 = MUL_F(f155, FRAC_CONST((-0.1467304744553624)));
- f158 = MUL_F(x[3], FRAC_CONST(0.8424460355094185));
- f159 = f156 + f157;
- f160 = f158 - f157;
- f161 = f118 - f142;
- f162 = f118 + f142;
- f163 = f117 - f141;
- f164 = f117 + f141;
- f165 = f124 - f148;
- f166 = f124 + f148;
- f167 = f123 - f147;
- f168 = f123 + f147;
- f169 = f130 - f154;
- f170 = f130 + f154;
- f171 = f129 - f153;
- f172 = f129 + f153;
- f173 = f136 - f160;
- f174 = f136 + f160;
- f175 = f135 - f159;
- f176 = f135 + f159;
- f177 = f161 + f163;
- f178 = MUL_C(f161, COEF_CONST(1.1758756024193588));
- f179 = MUL_F(f177, FRAC_CONST((-0.9807852804032304)));
- f180 = MUL_F(f163, FRAC_CONST((-0.7856949583871021)));
- f181 = f178 + f179;
- f182 = f180 - f179;
- f183 = f165 + f167;
- f184 = MUL_C(f165, COEF_CONST(1.3870398453221475));
- f185 = MUL_F(f183, FRAC_CONST((-0.5555702330196022)));
- f186 = MUL_F(f167, FRAC_CONST(0.2758993792829431));
- f187 = f184 + f185;
- f188 = f186 - f185;
- f189 = f169 + f171;
- f190 = MUL_F(f169, FRAC_CONST(0.7856949583871022));
- f191 = MUL_F(f189, FRAC_CONST(0.1950903220161283));
- f192 = MUL_C(f171, COEF_CONST(1.1758756024193586));
- f193 = f190 + f191;
- f194 = f192 - f191;
- f195 = f173 + f175;
- f196 = MUL_F(f173, FRAC_CONST((-0.2758993792829430)));
- f197 = MUL_F(f195, FRAC_CONST(0.8314696123025452));
- f198 = MUL_C(f175, COEF_CONST(1.3870398453221475));
- f199 = f196 + f197;
- f200 = f198 - f197;
- f201 = f162 - f170;
- f202 = f162 + f170;
- f203 = f164 - f172;
- f204 = f164 + f172;
- f205 = f166 - f174;
- f206 = f166 + f174;
- f207 = f168 - f176;
- f208 = f168 + f176;
- f209 = f182 - f194;
- f210 = f182 + f194;
- f211 = f181 - f193;
- f212 = f181 + f193;
- f213 = f188 - f200;
- f214 = f188 + f200;
- f215 = f187 - f199;
- f216 = f187 + f199;
- f217 = f201 + f203;
- f218 = MUL_C(f201, COEF_CONST(1.3065629648763766));
- f219 = MUL_F(f217, FRAC_CONST((-0.9238795325112866)));
- f220 = MUL_F(f203, FRAC_CONST((-0.5411961001461967)));
- f221 = f218 + f219;
- f222 = f220 - f219;
- f223 = f205 + f207;
- f224 = MUL_F(f205, FRAC_CONST(0.5411961001461969));
- f225 = MUL_F(f223, FRAC_CONST(0.3826834323650898));
- f226 = MUL_C(f207, COEF_CONST(1.3065629648763766));
- f227 = f224 + f225;
- f228 = f226 - f225;
- f229 = f209 + f211;
- f230 = MUL_C(f209, COEF_CONST(1.3065629648763766));
- f231 = MUL_F(f229, FRAC_CONST((-0.9238795325112866)));
- f232 = MUL_F(f211, FRAC_CONST((-0.5411961001461967)));
- f233 = f230 + f231;
- f234 = f232 - f231;
- f235 = f213 + f215;
- f236 = MUL_F(f213, FRAC_CONST(0.5411961001461969));
- f237 = MUL_F(f235, FRAC_CONST(0.3826834323650898));
- f238 = MUL_C(f215, COEF_CONST(1.3065629648763766));
- f239 = f236 + f237;
- f240 = f238 - f237;
- f241 = f202 - f206;
- f242 = f202 + f206;
- f243 = f204 - f208;
- f244 = f204 + f208;
- f245 = f222 - f228;
- f246 = f222 + f228;
- f247 = f221 - f227;
- f248 = f221 + f227;
- f249 = f210 - f214;
- f250 = f210 + f214;
- f251 = f212 - f216;
- f252 = f212 + f216;
- f253 = f234 - f240;
- f254 = f234 + f240;
- f255 = f233 - f239;
- f256 = f233 + f239;
- f257 = f241 - f243;
- f258 = f241 + f243;
- f259 = MUL_F(f257, FRAC_CONST(0.7071067811865474));
- f260 = MUL_F(f258, FRAC_CONST(0.7071067811865474));
- f261 = f245 - f247;
- f262 = f245 + f247;
- f263 = MUL_F(f261, FRAC_CONST(0.7071067811865474));
- f264 = MUL_F(f262, FRAC_CONST(0.7071067811865474));
- f265 = f249 - f251;
- f266 = f249 + f251;
- f267 = MUL_F(f265, FRAC_CONST(0.7071067811865474));
- f268 = MUL_F(f266, FRAC_CONST(0.7071067811865474));
- f269 = f253 - f255;
- f270 = f253 + f255;
- f271 = MUL_F(f269, FRAC_CONST(0.7071067811865474));
- f272 = MUL_F(f270, FRAC_CONST(0.7071067811865474));
- y[31] = f98 - f242;
- y[0] = f98 + f242;
- y[30] = f100 - f250;
- y[1] = f100 + f250;
- y[29] = f102 - f254;
- y[2] = f102 + f254;
- y[28] = f104 - f246;
- y[3] = f104 + f246;
- y[27] = f106 - f264;
- y[4] = f106 + f264;
- y[26] = f108 - f272;
- y[5] = f108 + f272;
- y[25] = f110 - f268;
- y[6] = f110 + f268;
- y[24] = f112 - f260;
- y[7] = f112 + f260;
- y[23] = f111 - f259;
- y[8] = f111 + f259;
- y[22] = f109 - f267;
- y[9] = f109 + f267;
- y[21] = f107 - f271;
- y[10] = f107 + f271;
- y[20] = f105 - f263;
- y[11] = f105 + f263;
- y[19] = f103 - f248;
- y[12] = f103 + f248;
- y[18] = f101 - f256;
- y[13] = f101 + f256;
- y[17] = f99 - f252;
- y[14] = f99 + f252;
- y[16] = f97 - f244;
- y[15] = f97 + f244;
-}
-
-void DCT2_32_unscaled(real_t *y, real_t *x)
-{
- real_t f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10;
- real_t f11, f12, f13, f14, f15, f16, f17, f18, f19, f20;
- real_t f21, f22, f23, f24, f25, f26, f27, f28, f29, f30;
- real_t f31, f32, f33, f34, f35, f36, f37, f38, f39, f40;
- real_t f41, f42, f43, f44, f45, f46, f47, f48, f49, f50;
- real_t f51, f52, f53, f54, f55, f56, f57, f58, f59, f60;
- real_t f63, f64, f65, f66, f69, f70, f71, f72, f73, f74;
- real_t f75, f76, f77, f78, f79, f80, f81, f83, f85, f86;
- real_t f89, f90, f91, f92, f93, f94, f95, f96, f97, f98;
- real_t f99, f100, f101, f102, f103, f104, f105, f106, f107, f108;
- real_t f109, f110, f111, f112, f113, f114, f115, f116, f117, f118;
- real_t f119, f120, f121, f122, f123, f124, f127, f128, f129, f130;
- real_t f133, f134, f135, f136, f139, f140, f141, f142, f145, f146;
- real_t f147, f148, f149, f150, f151, f152, f153, f154, f155, f156;
- real_t f157, f158, f159, f160, f161, f162, f163, f164, f165, f166;
- real_t f167, f168, f169, f170, f171, f172, f173, f174, f175, f176;
- real_t f177, f178, f179, f180, f181, f182, f183, f184, f185, f186;
- real_t f187, f188, f189, f190, f191, f192, f193, f194, f195, f196;
- real_t f197, f198, f199, f200, f201, f202, f203, f204, f205, f206;
- real_t f207, f208, f209, f210, f211, f212, f213, f214, f215, f216;
- real_t f217, f218, f219, f220, f221, f222, f223, f224, f225, f226;
- real_t f227, f228, f229, f230, f231, f232, f233, f234, f235, f236;
- real_t f237, f238, f239, f240, f241, f242, f243, f244, f247, f248;
- real_t f249, f250, f253, f254, f255, f256, f259, f260, f261, f262;
- real_t f265, f266, f267, f268, f271, f272, f273, f274, f277, f278;
- real_t f279, f280, f283, f284, f285, f286;
-
- f0 = x[0] - x[31];
- f1 = x[0] + x[31];
- f2 = x[1] - x[30];
- f3 = x[1] + x[30];
- f4 = x[2] - x[29];
- f5 = x[2] + x[29];
- f6 = x[3] - x[28];
- f7 = x[3] + x[28];
- f8 = x[4] - x[27];
- f9 = x[4] + x[27];
- f10 = x[5] - x[26];
- f11 = x[5] + x[26];
- f12 = x[6] - x[25];
- f13 = x[6] + x[25];
- f14 = x[7] - x[24];
- f15 = x[7] + x[24];
- f16 = x[8] - x[23];
- f17 = x[8] + x[23];
- f18 = x[9] - x[22];
- f19 = x[9] + x[22];
- f20 = x[10] - x[21];
- f21 = x[10] + x[21];
- f22 = x[11] - x[20];
- f23 = x[11] + x[20];
- f24 = x[12] - x[19];
- f25 = x[12] + x[19];
- f26 = x[13] - x[18];
- f27 = x[13] + x[18];
- f28 = x[14] - x[17];
- f29 = x[14] + x[17];
- f30 = x[15] - x[16];
- f31 = x[15] + x[16];
- f32 = f1 - f31;
- f33 = f1 + f31;
- f34 = f3 - f29;
- f35 = f3 + f29;
- f36 = f5 - f27;
- f37 = f5 + f27;
- f38 = f7 - f25;
- f39 = f7 + f25;
- f40 = f9 - f23;
- f41 = f9 + f23;
- f42 = f11 - f21;
- f43 = f11 + f21;
- f44 = f13 - f19;
- f45 = f13 + f19;
- f46 = f15 - f17;
- f47 = f15 + f17;
- f48 = f33 - f47;
- f49 = f33 + f47;
- f50 = f35 - f45;
- f51 = f35 + f45;
- f52 = f37 - f43;
- f53 = f37 + f43;
- f54 = f39 - f41;
- f55 = f39 + f41;
- f56 = f49 - f55;
- f57 = f49 + f55;
- f58 = f51 - f53;
- f59 = f51 + f53;
- f60 = f57 - f59;
- y[0] = f57 + f59;
- y[16] = MUL_F(FRAC_CONST(0.7071067811865476), f60);
- f63 = f56 + f58;
- f64 = MUL_C(COEF_CONST(1.3065629648763766), f56);
- f65 = MUL_F(FRAC_CONST(-0.9238795325112866), f63);
- f66 = MUL_F(FRAC_CONST(-0.5411961001461967), f58);
- y[24] = f64 + f65;
- y[8] = f66 - f65;
- f69 = f48 + f54;
- f70 = MUL_C(COEF_CONST(1.1758756024193588), f48);
- f71 = MUL_F(FRAC_CONST(-0.9807852804032304), f69);
- f72 = MUL_F(FRAC_CONST(-0.7856949583871021), f54);
- f73 = f70 + f71;
- f74 = f72 - f71;
- f75 = f50 + f52;
- f76 = MUL_C(COEF_CONST(1.3870398453221473), f50);
- f77 = MUL_F(FRAC_CONST(-0.8314696123025455), f75);
- f78 = MUL_F(FRAC_CONST(-0.2758993792829436), f52);
- f79 = f76 + f77;
- f80 = f78 - f77;
- f81 = f74 - f80;
- y[4] = f74 + f80;
- f83 = MUL_F(FRAC_CONST(0.7071067811865476), f81);
- y[28] = f73 - f79;
- f85 = f73 + f79;
- f86 = MUL_F(FRAC_CONST(0.7071067811865476), f85);
- y[20] = f83 - f86;
- y[12] = f83 + f86;
- f89 = f34 - f36;
- f90 = f34 + f36;
- f91 = f38 - f40;
- f92 = f38 + f40;
- f93 = f42 - f44;
- f94 = f42 + f44;
- f95 = MUL_F(FRAC_CONST(0.7071067811865476), f92);
- f96 = f32 - f95;
- f97 = f32 + f95;
- f98 = f90 + f94;
- f99 = MUL_C(COEF_CONST(1.3065629648763766), f90);
- f100 = MUL_F(FRAC_CONST(-0.9238795325112866), f98);
- f101 = MUL_F(FRAC_CONST(-0.5411961001461967), f94);
- f102 = f99 + f100;
- f103 = f101 - f100;
- f104 = f97 - f103;
- f105 = f97 + f103;
- f106 = f96 - f102;
- f107 = f96 + f102;
- f108 = MUL_F(FRAC_CONST(0.7071067811865476), f91);
- f109 = f46 - f108;
- f110 = f46 + f108;
- f111 = f93 + f89;
- f112 = MUL_C(COEF_CONST(1.3065629648763766), f93);
- f113 = MUL_F(FRAC_CONST(-0.9238795325112866), f111);
- f114 = MUL_F(FRAC_CONST(-0.5411961001461967), f89);
- f115 = f112 + f113;
- f116 = f114 - f113;
- f117 = f110 - f116;
- f118 = f110 + f116;
- f119 = f109 - f115;
- f120 = f109 + f115;
- f121 = f118 + f105;
- f122 = MUL_F(FRAC_CONST(-0.8971675863426361), f118);
- f123 = MUL_F(FRAC_CONST(0.9951847266721968), f121);
- f124 = MUL_C(COEF_CONST(1.0932018670017576), f105);
- y[2] = f122 + f123;
- y[30] = f124 - f123;
- f127 = f107 - f120;
- f128 = MUL_F(FRAC_CONST(-0.6666556584777466), f120);
- f129 = MUL_F(FRAC_CONST(0.9569403357322089), f127);
- f130 = MUL_C(COEF_CONST(1.2472250129866713), f107);
- y[6] = f129 - f128;
- y[26] = f130 - f129;
- f133 = f119 + f106;
- f134 = MUL_F(FRAC_CONST(-0.4105245275223571), f119);
- f135 = MUL_F(FRAC_CONST(0.8819212643483549), f133);
- f136 = MUL_C(COEF_CONST(1.3533180011743529), f106);
- y[10] = f134 + f135;
- y[22] = f136 - f135;
- f139 = f104 - f117;
- f140 = MUL_F(FRAC_CONST(-0.1386171691990915), f117);
- f141 = MUL_F(FRAC_CONST(0.7730104533627370), f139);
- f142 = MUL_C(COEF_CONST(1.4074037375263826), f104);
- y[14] = f141 - f140;
- y[18] = f142 - f141;
- f145 = f2 - f4;
- f146 = f2 + f4;
- f147 = f6 - f8;
- f148 = f6 + f8;
- f149 = f10 - f12;
- f150 = f10 + f12;
- f151 = f14 - f16;
- f152 = f14 + f16;
- f153 = f18 - f20;
- f154 = f18 + f20;
- f155 = f22 - f24;
- f156 = f22 + f24;
- f157 = f26 - f28;
- f158 = f26 + f28;
- f159 = MUL_F(FRAC_CONST(0.7071067811865476), f152);
- f160 = f0 - f159;
- f161 = f0 + f159;
- f162 = f148 + f156;
- f163 = MUL_C(COEF_CONST(1.3065629648763766), f148);
- f164 = MUL_F(FRAC_CONST(-0.9238795325112866), f162);
- f165 = MUL_F(FRAC_CONST(-0.5411961001461967), f156);
- f166 = f163 + f164;
- f167 = f165 - f164;
- f168 = f161 - f167;
- f169 = f161 + f167;
- f170 = f160 - f166;
- f171 = f160 + f166;
- f172 = f146 + f158;
- f173 = MUL_C(COEF_CONST(1.1758756024193588), f146);
- f174 = MUL_F(FRAC_CONST(-0.9807852804032304), f172);
- f175 = MUL_F(FRAC_CONST(-0.7856949583871021), f158);
- f176 = f173 + f174;
- f177 = f175 - f174;
- f178 = f150 + f154;
- f179 = MUL_C(COEF_CONST(1.3870398453221473), f150);
- f180 = MUL_F(FRAC_CONST(-0.8314696123025455), f178);
- f181 = MUL_F(FRAC_CONST(-0.2758993792829436), f154);
- f182 = f179 + f180;
- f183 = f181 - f180;
- f184 = f177 - f183;
- f185 = f177 + f183;
- f186 = MUL_F(FRAC_CONST(0.7071067811865476), f184);
- f187 = f176 - f182;
- f188 = f176 + f182;
- f189 = MUL_F(FRAC_CONST(0.7071067811865476), f188);
- f190 = f186 - f189;
- f191 = f186 + f189;
- f192 = f169 - f185;
- f193 = f169 + f185;
- f194 = f171 - f191;
- f195 = f171 + f191;
- f196 = f170 - f190;
- f197 = f170 + f190;
- f198 = f168 - f187;
- f199 = f168 + f187;
- f200 = MUL_F(FRAC_CONST(0.7071067811865476), f151);
- f201 = f30 - f200;
- f202 = f30 + f200;
- f203 = f155 + f147;
- f204 = MUL_C(COEF_CONST(1.3065629648763766), f155);
- f205 = MUL_F(FRAC_CONST(-0.9238795325112866), f203);
- f206 = MUL_F(FRAC_CONST(-0.5411961001461967), f147);
- f207 = f204 + f205;
- f208 = f206 - f205;
- f209 = f202 - f208;
- f210 = f202 + f208;
- f211 = f201 - f207;
- f212 = f201 + f207;
- f213 = f157 + f145;
- f214 = MUL_C(COEF_CONST(1.1758756024193588), f157);
- f215 = MUL_F(FRAC_CONST(-0.9807852804032304), f213);
- f216 = MUL_F(FRAC_CONST(-0.7856949583871021), f145);
- f217 = f214 + f215;
- f218 = f216 - f215;
- f219 = f153 + f149;
- f220 = MUL_C(COEF_CONST(1.3870398453221473), f153);
- f221 = MUL_F(FRAC_CONST(-0.8314696123025455), f219);
- f222 = MUL_F(FRAC_CONST(-0.2758993792829436), f149);
- f223 = f220 + f221;
- f224 = f222 - f221;
- f225 = f218 - f224;
- f226 = f218 + f224;
- f227 = MUL_F(FRAC_CONST(0.7071067811865476), f225);
- f228 = f217 - f223;
- f229 = f217 + f223;
- f230 = MUL_F(FRAC_CONST(0.7071067811865476), f229);
- f231 = f227 - f230;
- f232 = f227 + f230;
- f233 = f210 - f226;
- f234 = f210 + f226;
- f235 = f212 - f232;
- f236 = f212 + f232;
- f237 = f211 - f231;
- f238 = f211 + f231;
- f239 = f209 - f228;
- f240 = f209 + f228;
- f241 = f234 + f193;
- f242 = MUL_F(FRAC_CONST(-0.9497277818777543), f234);
- f243 = MUL_F(FRAC_CONST(0.9987954562051724), f241);
- f244 = MUL_C(COEF_CONST(1.0478631305325905), f193);
- y[1] = f242 + f243;
- y[31] = f244 - f243;
- f247 = f195 - f236;
- f248 = MUL_F(FRAC_CONST(-0.8424460355094192), f236);
- f249 = MUL_F(FRAC_CONST(0.9891765099647810), f247);
- f250 = MUL_C(COEF_CONST(1.1359069844201428), f195);
- y[3] = f249 - f248;
- y[29] = f250 - f249;
- f253 = f238 + f197;
- f254 = MUL_F(FRAC_CONST(-0.7270510732912801), f238);
- f255 = MUL_F(FRAC_CONST(0.9700312531945440), f253);
- f256 = MUL_C(COEF_CONST(1.2130114330978079), f197);
- y[5] = f254 + f255;
- y[27] = f256 - f255;
- f259 = f199 - f240;
- f260 = MUL_F(FRAC_CONST(-0.6046542117908007), f240);
- f261 = MUL_F(FRAC_CONST(0.9415440651830208), f259);
- f262 = MUL_C(COEF_CONST(1.2784339185752409), f199);
- y[7] = f261 - f260;
- y[25] = f262 - f261;
- f265 = f239 + f198;
- f266 = MUL_F(FRAC_CONST(-0.4764341996931611), f239);
- f267 = MUL_F(FRAC_CONST(0.9039892931234433), f265);
- f268 = MUL_C(COEF_CONST(1.3315443865537255), f198);
- y[9] = f266 + f267;
- y[23] = f268 - f267;
- f271 = f196 - f237;
- f272 = MUL_F(FRAC_CONST(-0.3436258658070505), f237);
- f273 = MUL_F(FRAC_CONST(0.8577286100002721), f271);
- f274 = MUL_C(COEF_CONST(1.3718313541934939), f196);
- y[11] = f273 - f272;
- y[21] = f274 - f273;
- f277 = f235 + f194;
- f278 = MUL_F(FRAC_CONST(-0.2075082269882114), f235);
- f279 = MUL_F(FRAC_CONST(0.8032075314806448), f277);
- f280 = MUL_C(COEF_CONST(1.3989068359730783), f194);
- y[13] = f278 + f279;
- y[19] = f280 - f279;
- f283 = f192 - f233;
- f284 = MUL_F(FRAC_CONST(-0.0693921705079408), f233);
- f285 = MUL_F(FRAC_CONST(0.7409511253549591), f283);
- f286 = MUL_C(COEF_CONST(1.4125100802019774), f192);
- y[15] = f285 - f284;
- y[17] = f286 - f285;
-}
-
-#else
-
-
-#define n 32
-#define log2n 5
-
-// w_array_real[i] = cos(2*M_PI*i/32)
-static const real_t w_array_real[] = {
- FRAC_CONST(1.000000000000000), FRAC_CONST(0.980785279337272),
- FRAC_CONST(0.923879528329380), FRAC_CONST(0.831469603195765),
- FRAC_CONST(0.707106765732237), FRAC_CONST(0.555570210304169),
- FRAC_CONST(0.382683402077046), FRAC_CONST(0.195090284503576),
- FRAC_CONST(0.000000000000000), FRAC_CONST(-0.195090370246552),
- FRAC_CONST(-0.382683482845162), FRAC_CONST(-0.555570282993553),
- FRAC_CONST(-0.707106827549476), FRAC_CONST(-0.831469651765257),
- FRAC_CONST(-0.923879561784627), FRAC_CONST(-0.980785296392607)
-};
-
-// w_array_imag[i] = sin(-2*M_PI*i/32)
-static const real_t w_array_imag[] = {
- FRAC_CONST(0.000000000000000), FRAC_CONST(-0.195090327375064),
- FRAC_CONST(-0.382683442461104), FRAC_CONST(-0.555570246648862),
- FRAC_CONST(-0.707106796640858), FRAC_CONST(-0.831469627480512),
- FRAC_CONST(-0.923879545057005), FRAC_CONST(-0.980785287864940),
- FRAC_CONST(-1.000000000000000), FRAC_CONST(-0.980785270809601),
- FRAC_CONST(-0.923879511601754), FRAC_CONST(-0.831469578911016),
- FRAC_CONST(-0.707106734823616), FRAC_CONST(-0.555570173959476),
- FRAC_CONST(-0.382683361692986), FRAC_CONST(-0.195090241632088)
-};
-
-// FFT decimation in frequency
-// 4*16*2+16=128+16=144 multiplications
-// 6*16*2+10*8+4*16*2=192+80+128=400 additions
-static void fft_dif(real_t * Real, real_t * Imag)
-{
- real_t w_real, w_imag; // For faster access
- real_t point1_real, point1_imag, point2_real, point2_imag; // For faster access
- uint32_t j, i, i2, w_index; // Counters
-
- // First 2 stages of 32 point FFT decimation in frequency
- // 4*16*2=64*2=128 multiplications
- // 6*16*2=96*2=192 additions
- // Stage 1 of 32 point FFT decimation in frequency
- for (i = 0; i < 16; i++)
- {
- point1_real = Real[i];
- point1_imag = Imag[i];
- i2 = i+16;
- point2_real = Real[i2];
- point2_imag = Imag[i2];
-
- w_real = w_array_real[i];
- w_imag = w_array_imag[i];
-
- // temp1 = x[i] - x[i2]
- point1_real -= point2_real;
- point1_imag -= point2_imag;
-
- // x[i1] = x[i] + x[i2]
- Real[i] += point2_real;
- Imag[i] += point2_imag;
-
- // x[i2] = (x[i] - x[i2]) * w
- Real[i2] = (MUL_F(point1_real,w_real) - MUL_F(point1_imag,w_imag));
- Imag[i2] = (MUL_F(point1_real,w_imag) + MUL_F(point1_imag,w_real));
- }
- // Stage 2 of 32 point FFT decimation in frequency
- for (j = 0, w_index = 0; j < 8; j++, w_index += 2)
- {
- w_real = w_array_real[w_index];
- w_imag = w_array_imag[w_index];
-
- i = j;
- point1_real = Real[i];
- point1_imag = Imag[i];
- i2 = i+8;
- point2_real = Real[i2];
- point2_imag = Imag[i2];
-
- // temp1 = x[i] - x[i2]
- point1_real -= point2_real;
- point1_imag -= point2_imag;
-
- // x[i1] = x[i] + x[i2]
- Real[i] += point2_real;
- Imag[i] += point2_imag;
-
- // x[i2] = (x[i] - x[i2]) * w
- Real[i2] = (MUL_F(point1_real,w_real) - MUL_F(point1_imag,w_imag));
- Imag[i2] = (MUL_F(point1_real,w_imag) + MUL_F(point1_imag,w_real));
-
- i = j+16;
- point1_real = Real[i];
- point1_imag = Imag[i];
- i2 = i+8;
- point2_real = Real[i2];
- point2_imag = Imag[i2];
-
- // temp1 = x[i] - x[i2]
- point1_real -= point2_real;
- point1_imag -= point2_imag;
-
- // x[i1] = x[i] + x[i2]
- Real[i] += point2_real;
- Imag[i] += point2_imag;
-
- // x[i2] = (x[i] - x[i2]) * w
- Real[i2] = (MUL_F(point1_real,w_real) - MUL_F(point1_imag,w_imag));
- Imag[i2] = (MUL_F(point1_real,w_imag) + MUL_F(point1_imag,w_real));
- }
-
- // Stage 3 of 32 point FFT decimation in frequency
- // 2*4*2=16 multiplications
- // 4*4*2+6*4*2=10*8=80 additions
- for (i = 0; i < n; i += 8)
- {
- i2 = i+4;
- point1_real = Real[i];
- point1_imag = Imag[i];
-
- point2_real = Real[i2];
- point2_imag = Imag[i2];
-
- // out[i1] = point1 + point2
- Real[i] += point2_real;
- Imag[i] += point2_imag;
-
- // out[i2] = point1 - point2
- Real[i2] = point1_real - point2_real;
- Imag[i2] = point1_imag - point2_imag;
- }
- w_real = w_array_real[4]; // = sqrt(2)/2
- // w_imag = -w_real; // = w_array_imag[4]; // = -sqrt(2)/2
- for (i = 1; i < n; i += 8)
- {
- i2 = i+4;
- point1_real = Real[i];
- point1_imag = Imag[i];
-
- point2_real = Real[i2];
- point2_imag = Imag[i2];
-
- // temp1 = x[i] - x[i2]
- point1_real -= point2_real;
- point1_imag -= point2_imag;
-
- // x[i1] = x[i] + x[i2]
- Real[i] += point2_real;
- Imag[i] += point2_imag;
-
- // x[i2] = (x[i] - x[i2]) * w
- Real[i2] = MUL_F(point1_real+point1_imag, w_real);
- Imag[i2] = MUL_F(point1_imag-point1_real, w_real);
- }
- for (i = 2; i < n; i += 8)
- {
- i2 = i+4;
- point1_real = Real[i];
- point1_imag = Imag[i];
-
- point2_real = Real[i2];
- point2_imag = Imag[i2];
-
- // x[i] = x[i] + x[i2]
- Real[i] += point2_real;
- Imag[i] += point2_imag;
-
- // x[i2] = (x[i] - x[i2]) * (-i)
- Real[i2] = point1_imag - point2_imag;
- Imag[i2] = point2_real - point1_real;
- }
- w_real = w_array_real[12]; // = -sqrt(2)/2
- // w_imag = w_real; // = w_array_imag[12]; // = -sqrt(2)/2
- for (i = 3; i < n; i += 8)
- {
- i2 = i+4;
- point1_real = Real[i];
- point1_imag = Imag[i];
-
- point2_real = Real[i2];
- point2_imag = Imag[i2];
-
- // temp1 = x[i] - x[i2]
- point1_real -= point2_real;
- point1_imag -= point2_imag;
-
- // x[i1] = x[i] + x[i2]
- Real[i] += point2_real;
- Imag[i] += point2_imag;
-
- // x[i2] = (x[i] - x[i2]) * w
- Real[i2] = MUL_F(point1_real-point1_imag, w_real);
- Imag[i2] = MUL_F(point1_real+point1_imag, w_real);
- }
-
-
- // Stage 4 of 32 point FFT decimation in frequency (no multiplications)
- // 16*4=64 additions
- for (i = 0; i < n; i += 4)
- {
- i2 = i+2;
- point1_real = Real[i];
- point1_imag = Imag[i];
-
- point2_real = Real[i2];
- point2_imag = Imag[i2];
-
- // x[i1] = x[i] + x[i2]
- Real[i] += point2_real;
- Imag[i] += point2_imag;
-
- // x[i2] = x[i] - x[i2]
- Real[i2] = point1_real - point2_real;
- Imag[i2] = point1_imag - point2_imag;
- }
- for (i = 1; i < n; i += 4)
- {
- i2 = i+2;
- point1_real = Real[i];
- point1_imag = Imag[i];
-
- point2_real = Real[i2];
- point2_imag = Imag[i2];
-
- // x[i] = x[i] + x[i2]
- Real[i] += point2_real;
- Imag[i] += point2_imag;
-
- // x[i2] = (x[i] - x[i2]) * (-i)
- Real[i2] = point1_imag - point2_imag;
- Imag[i2] = point2_real - point1_real;
- }
-
- // Stage 5 of 32 point FFT decimation in frequency (no multiplications)
- // 16*4=64 additions
- for (i = 0; i < n; i += 2)
- {
- i2 = i+1;
- point1_real = Real[i];
- point1_imag = Imag[i];
-
- point2_real = Real[i2];
- point2_imag = Imag[i2];
-
- // out[i1] = point1 + point2
- Real[i] += point2_real;
- Imag[i] += point2_imag;
-
- // out[i2] = point1 - point2
- Real[i2] = point1_real - point2_real;
- Imag[i2] = point1_imag - point2_imag;
- }
-
-#ifdef REORDER_IN_FFT
- FFTReorder(Real, Imag);
-#endif // #ifdef REORDER_IN_FFT
-}
-#undef n
-#undef log2n
-
-static const real_t dct4_64_tab[] = {
- COEF_CONST(0.999924719333649), COEF_CONST(0.998118102550507),
- COEF_CONST(0.993906974792480), COEF_CONST(0.987301409244537),
- COEF_CONST(0.978317379951477), COEF_CONST(0.966976463794708),
- COEF_CONST(0.953306019306183), COEF_CONST(0.937339007854462),
- COEF_CONST(0.919113874435425), COEF_CONST(0.898674488067627),
- COEF_CONST(0.876070082187653), COEF_CONST(0.851355195045471),
- COEF_CONST(0.824589252471924), COEF_CONST(0.795836925506592),
- COEF_CONST(0.765167236328125), COEF_CONST(0.732654273509979),
- COEF_CONST(0.698376238346100), COEF_CONST(0.662415742874146),
- COEF_CONST(0.624859452247620), COEF_CONST(0.585797846317291),
- COEF_CONST(0.545324981212616), COEF_CONST(0.503538429737091),
- COEF_CONST(0.460538715124130), COEF_CONST(0.416429549455643),
- COEF_CONST(0.371317148208618), COEF_CONST(0.325310230255127),
- COEF_CONST(0.278519600629807), COEF_CONST(0.231058135628700),
- COEF_CONST(0.183039888739586), COEF_CONST(0.134580686688423),
- COEF_CONST(0.085797272622585), COEF_CONST(0.036807164549828),
- COEF_CONST(-1.012196302413940), COEF_CONST(-1.059438824653626),
- COEF_CONST(-1.104129195213318), COEF_CONST(-1.146159529685974),
- COEF_CONST(-1.185428738594055), COEF_CONST(-1.221842169761658),
- COEF_CONST(-1.255311965942383), COEF_CONST(-1.285757660865784),
- COEF_CONST(-1.313105940818787), COEF_CONST(-1.337290763854981),
- COEF_CONST(-1.358253836631775), COEF_CONST(-1.375944852828980),
- COEF_CONST(-1.390321016311646), COEF_CONST(-1.401347875595093),
- COEF_CONST(-1.408998727798462), COEF_CONST(-1.413255214691162),
- COEF_CONST(-1.414107084274292), COEF_CONST(-1.411552190780640),
- COEF_CONST(-1.405596733093262), COEF_CONST(-1.396255016326904),
- COEF_CONST(-1.383549690246582), COEF_CONST(-1.367511272430420),
- COEF_CONST(-1.348178386688232), COEF_CONST(-1.325597524642944),
- COEF_CONST(-1.299823284149170), COEF_CONST(-1.270917654037476),
- COEF_CONST(-1.238950133323669), COEF_CONST(-1.203998088836670),
- COEF_CONST(-1.166145324707031), COEF_CONST(-1.125483393669128),
- COEF_CONST(-1.082109928131104), COEF_CONST(-1.036129593849182),
- COEF_CONST(-0.987653195858002), COEF_CONST(-0.936797380447388),
- COEF_CONST(-0.883684754371643), COEF_CONST(-0.828443288803101),
- COEF_CONST(-0.771206021308899), COEF_CONST(-0.712110757827759),
- COEF_CONST(-0.651300072669983), COEF_CONST(-0.588920354843140),
- COEF_CONST(-0.525121808052063), COEF_CONST(-0.460058242082596),
- COEF_CONST(-0.393886327743530), COEF_CONST(-0.326765477657318),
- COEF_CONST(-0.258857429027557), COEF_CONST(-0.190325915813446),
- COEF_CONST(-0.121335685253143), COEF_CONST(-0.052053272724152),
- COEF_CONST(0.017354607582092), COEF_CONST(0.086720645427704),
- COEF_CONST(0.155877828598022), COEF_CONST(0.224659323692322),
- COEF_CONST(0.292899727821350), COEF_CONST(0.360434412956238),
- COEF_CONST(0.427100926637650), COEF_CONST(0.492738455533981),
- COEF_CONST(0.557188928127289), COEF_CONST(0.620297133922577),
- COEF_CONST(0.681910991668701), COEF_CONST(0.741881847381592),
- COEF_CONST(0.800065577030182), COEF_CONST(0.856321990489960),
- COEF_CONST(0.910515367984772), COEF_CONST(0.962515234947205),
- COEF_CONST(1.000000000000000), COEF_CONST(0.998795449733734),
- COEF_CONST(0.995184719562531), COEF_CONST(0.989176511764526),
- COEF_CONST(0.980785250663757), COEF_CONST(0.970031261444092),
- COEF_CONST(0.956940352916718), COEF_CONST(0.941544055938721),
- COEF_CONST(0.923879504203796), COEF_CONST(0.903989315032959),
- COEF_CONST(0.881921231746674), COEF_CONST(0.857728600502014),
- COEF_CONST(0.831469595432281), COEF_CONST(0.803207516670227),
- COEF_CONST(0.773010432720184), COEF_CONST(0.740951120853424),
- COEF_CONST(0.707106769084930), COEF_CONST(0.671558916568756),
- COEF_CONST(0.634393274784088), COEF_CONST(0.595699310302734),
- COEF_CONST(0.555570185184479), COEF_CONST(0.514102697372437),
- COEF_CONST(0.471396654844284), COEF_CONST(0.427555114030838),
- COEF_CONST(0.382683426141739), COEF_CONST(0.336889833211899),
- COEF_CONST(0.290284633636475), COEF_CONST(0.242980122566223),
- COEF_CONST(0.195090234279633), COEF_CONST(0.146730497479439),
- COEF_CONST(0.098017133772373), COEF_CONST(0.049067649990320),
- COEF_CONST(-1.000000000000000), COEF_CONST(-1.047863125801086),
- COEF_CONST(-1.093201875686646), COEF_CONST(-1.135906934738159),
- COEF_CONST(-1.175875544548035), COEF_CONST(-1.213011503219605),
- COEF_CONST(-1.247225046157837), COEF_CONST(-1.278433918952942),
- COEF_CONST(-1.306562900543213), COEF_CONST(-1.331544399261475),
- COEF_CONST(-1.353317975997925), COEF_CONST(-1.371831417083740),
- COEF_CONST(-1.387039899826050), COEF_CONST(-1.398906826972961),
- COEF_CONST(-1.407403707504273), COEF_CONST(-1.412510156631470),
- COEF_CONST(0), COEF_CONST(-1.412510156631470),
- COEF_CONST(-1.407403707504273), COEF_CONST(-1.398906826972961),
- COEF_CONST(-1.387039899826050), COEF_CONST(-1.371831417083740),
- COEF_CONST(-1.353317975997925), COEF_CONST(-1.331544399261475),
- COEF_CONST(-1.306562900543213), COEF_CONST(-1.278433918952942),
- COEF_CONST(-1.247225046157837), COEF_CONST(-1.213011384010315),
- COEF_CONST(-1.175875544548035), COEF_CONST(-1.135907053947449),
- COEF_CONST(-1.093201875686646), COEF_CONST(-1.047863125801086),
- COEF_CONST(-1.000000000000000), COEF_CONST(-0.949727773666382),
- COEF_CONST(-0.897167563438416), COEF_CONST(-0.842446029186249),
- COEF_CONST(-0.785694956779480), COEF_CONST(-0.727051079273224),
- COEF_CONST(-0.666655659675598), COEF_CONST(-0.604654192924500),
- COEF_CONST(-0.541196048259735), COEF_CONST(-0.476434230804443),
- COEF_CONST(-0.410524487495422), COEF_CONST(-0.343625843524933),
- COEF_CONST(-0.275899350643158), COEF_CONST(-0.207508206367493),
- COEF_CONST(-0.138617098331451), COEF_CONST(-0.069392144680023),
- COEF_CONST(0), COEF_CONST(0.069392263889313),
- COEF_CONST(0.138617157936096), COEF_CONST(0.207508206367493),
- COEF_CONST(0.275899469852448), COEF_CONST(0.343625962734222),
- COEF_CONST(0.410524636507034), COEF_CONST(0.476434201002121),
- COEF_CONST(0.541196107864380), COEF_CONST(0.604654192924500),
- COEF_CONST(0.666655719280243), COEF_CONST(0.727051138877869),
- COEF_CONST(0.785695075988770), COEF_CONST(0.842446029186249),
- COEF_CONST(0.897167563438416), COEF_CONST(0.949727773666382)
-};
-
-/* size 64 only! */
-void dct4_kernel(real_t * in_real, real_t * in_imag, real_t * out_real, real_t * out_imag)
-{
- // Tables with bit reverse values for 5 bits, bit reverse of i at i-th position
- const uint8_t bit_rev_tab[32] = { 0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23,15,31 };
- uint16_t i, i_rev;
-
- /* Step 2: modulate */
- // 3*32=96 multiplications
- // 3*32=96 additions
- for (i = 0; i < 32; i++)
- {
- real_t x_re, x_im, tmp;
- x_re = in_real[i];
- x_im = in_imag[i];
- tmp = MUL_C(x_re + x_im, dct4_64_tab[i]);
- in_real[i] = MUL_C(x_im, dct4_64_tab[i + 64]) + tmp;
- in_imag[i] = MUL_C(x_re, dct4_64_tab[i + 32]) + tmp;
- }
-
- /* Step 3: FFT, but with output in bit reverse order */
- fft_dif(in_real, in_imag);
-
- /* Step 4: modulate + bitreverse reordering */
- // 3*31+2=95 multiplications
- // 3*31+2=95 additions
- for (i = 0; i < 16; i++)
- {
- real_t x_re, x_im, tmp;
- i_rev = bit_rev_tab[i];
- x_re = in_real[i_rev];
- x_im = in_imag[i_rev];
-
- tmp = MUL_C(x_re + x_im, dct4_64_tab[i + 3*32]);
- out_real[i] = MUL_C(x_im, dct4_64_tab[i + 5*32]) + tmp;
- out_imag[i] = MUL_C(x_re, dct4_64_tab[i + 4*32]) + tmp;
- }
- // i = 16, i_rev = 1 = rev(16);
- out_imag[16] = MUL_C(in_imag[1] - in_real[1], dct4_64_tab[16 + 3*32]);
- out_real[16] = MUL_C(in_real[1] + in_imag[1], dct4_64_tab[16 + 3*32]);
- for (i = 17; i < 32; i++)
- {
- real_t x_re, x_im, tmp;
- i_rev = bit_rev_tab[i];
- x_re = in_real[i_rev];
- x_im = in_imag[i_rev];
- tmp = MUL_C(x_re + x_im, dct4_64_tab[i + 3*32]);
- out_real[i] = MUL_C(x_im, dct4_64_tab[i + 5*32]) + tmp;
- out_imag[i] = MUL_C(x_re, dct4_64_tab[i + 4*32]) + tmp;
- }
-
-}
-
-void DST4_32(real_t *y, real_t *x)
-{
- real_t f0, f1, f2, f3, f4, f5, f6, f7, f8, f9;
- real_t f10, f11, f12, f13, f14, f15, f16, f17, f18, f19;
- real_t f20, f21, f22, f23, f24, f25, f26, f27, f28, f29;
- real_t f30, f31, f32, f33, f34, f35, f36, f37, f38, f39;
- real_t f40, f41, f42, f43, f44, f45, f46, f47, f48, f49;
- real_t f50, f51, f52, f53, f54, f55, f56, f57, f58, f59;
- real_t f60, f61, f62, f63, f64, f65, f66, f67, f68, f69;
- real_t f70, f71, f72, f73, f74, f75, f76, f77, f78, f79;
- real_t f80, f81, f82, f83, f84, f85, f86, f87, f88, f89;
- real_t f90, f91, f92, f93, f94, f95, f96, f97, f98, f99;
- real_t f100, f101, f102, f103, f104, f105, f106, f107, f108, f109;
- real_t f110, f111, f112, f113, f114, f115, f116, f117, f118, f119;
- real_t f120, f121, f122, f123, f124, f125, f126, f127, f128, f129;
- real_t f130, f131, f132, f133, f134, f135, f136, f137, f138, f139;
- real_t f140, f141, f142, f143, f144, f145, f146, f147, f148, f149;
- real_t f150, f151, f152, f153, f154, f155, f156, f157, f158, f159;
- real_t f160, f161, f162, f163, f164, f165, f166, f167, f168, f169;
- real_t f170, f171, f172, f173, f174, f175, f176, f177, f178, f179;
- real_t f180, f181, f182, f183, f184, f185, f186, f187, f188, f189;
- real_t f190, f191, f192, f193, f194, f195, f196, f197, f198, f199;
- real_t f200, f201, f202, f203, f204, f205, f206, f207, f208, f209;
- real_t f210, f211, f212, f213, f214, f215, f216, f217, f218, f219;
- real_t f220, f221, f222, f223, f224, f225, f226, f227, f228, f229;
- real_t f230, f231, f232, f233, f234, f235, f236, f237, f238, f239;
- real_t f240, f241, f242, f243, f244, f245, f246, f247, f248, f249;
- real_t f250, f251, f252, f253, f254, f255, f256, f257, f258, f259;
- real_t f260, f261, f262, f263, f264, f265, f266, f267, f268, f269;
- real_t f270, f271, f272, f273, f274, f275, f276, f277, f278, f279;
- real_t f280, f281, f282, f283, f284, f285, f286, f287, f288, f289;
- real_t f290, f291, f292, f293, f294, f295, f296, f297, f298, f299;
- real_t f300, f301, f302, f303, f304, f305, f306, f307, f308, f309;
- real_t f310, f311, f312, f313, f314, f315, f316, f317, f318, f319;
- real_t f320, f321, f322, f323, f324, f325, f326, f327, f328, f329;
- real_t f330, f331, f332, f333, f334, f335;
-
- f0 = x[0] - x[1];
- f1 = x[2] - x[1];
- f2 = x[2] - x[3];
- f3 = x[4] - x[3];
- f4 = x[4] - x[5];
- f5 = x[6] - x[5];
- f6 = x[6] - x[7];
- f7 = x[8] - x[7];
- f8 = x[8] - x[9];
- f9 = x[10] - x[9];
- f10 = x[10] - x[11];
- f11 = x[12] - x[11];
- f12 = x[12] - x[13];
- f13 = x[14] - x[13];
- f14 = x[14] - x[15];
- f15 = x[16] - x[15];
- f16 = x[16] - x[17];
- f17 = x[18] - x[17];
- f18 = x[18] - x[19];
- f19 = x[20] - x[19];
- f20 = x[20] - x[21];
- f21 = x[22] - x[21];
- f22 = x[22] - x[23];
- f23 = x[24] - x[23];
- f24 = x[24] - x[25];
- f25 = x[26] - x[25];
- f26 = x[26] - x[27];
- f27 = x[28] - x[27];
- f28 = x[28] - x[29];
- f29 = x[30] - x[29];
- f30 = x[30] - x[31];
- f31 = MUL_F(FRAC_CONST(0.7071067811865476), f15);
- f32 = x[0] - f31;
- f33 = x[0] + f31;
- f34 = f7 + f23;
- f35 = MUL_C(COEF_CONST(1.3065629648763766), f7);
- f36 = MUL_F(FRAC_CONST(-0.9238795325112866), f34);
- f37 = MUL_F(FRAC_CONST(-0.5411961001461967), f23);
- f38 = f35 + f36;
- f39 = f37 - f36;
- f40 = f33 - f39;
- f41 = f33 + f39;
- f42 = f32 - f38;
- f43 = f32 + f38;
- f44 = f11 - f19;
- f45 = f11 + f19;
- f46 = MUL_F(FRAC_CONST(0.7071067811865476), f45);
- f47 = f3 - f46;
- f48 = f3 + f46;
- f49 = MUL_F(FRAC_CONST(0.7071067811865476), f44);
- f50 = f49 - f27;
- f51 = f49 + f27;
- f52 = f51 + f48;
- f53 = MUL_F(FRAC_CONST(-0.7856949583871021), f51);
- f54 = MUL_F(FRAC_CONST(0.9807852804032304), f52);
- f55 = MUL_C(COEF_CONST(1.1758756024193588), f48);
- f56 = f53 + f54;
- f57 = f55 - f54;
- f58 = f50 + f47;
- f59 = MUL_F(FRAC_CONST(-0.2758993792829430), f50);
- f60 = MUL_F(FRAC_CONST(0.8314696123025452), f58);
- f61 = MUL_C(COEF_CONST(1.3870398453221475), f47);
- f62 = f59 + f60;
- f63 = f61 - f60;
- f64 = f41 - f56;
- f65 = f41 + f56;
- f66 = f43 - f62;
- f67 = f43 + f62;
- f68 = f42 - f63;
- f69 = f42 + f63;
- f70 = f40 - f57;
- f71 = f40 + f57;
- f72 = f5 - f9;
- f73 = f5 + f9;
- f74 = f13 - f17;
- f75 = f13 + f17;
- f76 = f21 - f25;
- f77 = f21 + f25;
- f78 = MUL_F(FRAC_CONST(0.7071067811865476), f75);
- f79 = f1 - f78;
- f80 = f1 + f78;
- f81 = f73 + f77;
- f82 = MUL_C(COEF_CONST(1.3065629648763766), f73);
- f83 = MUL_F(FRAC_CONST(-0.9238795325112866), f81);
- f84 = MUL_F(FRAC_CONST(-0.5411961001461967), f77);
- f85 = f82 + f83;
- f86 = f84 - f83;
- f87 = f80 - f86;
- f88 = f80 + f86;
- f89 = f79 - f85;
- f90 = f79 + f85;
- f91 = MUL_F(FRAC_CONST(0.7071067811865476), f74);
- f92 = f29 - f91;
- f93 = f29 + f91;
- f94 = f76 + f72;
- f95 = MUL_C(COEF_CONST(1.3065629648763766), f76);
- f96 = MUL_F(FRAC_CONST(-0.9238795325112866), f94);
- f97 = MUL_F(FRAC_CONST(-0.5411961001461967), f72);
- f98 = f95 + f96;
- f99 = f97 - f96;
- f100 = f93 - f99;
- f101 = f93 + f99;
- f102 = f92 - f98;
- f103 = f92 + f98;
- f104 = f101 + f88;
- f105 = MUL_F(FRAC_CONST(-0.8971675863426361), f101);
- f106 = MUL_F(FRAC_CONST(0.9951847266721968), f104);
- f107 = MUL_C(COEF_CONST(1.0932018670017576), f88);
- f108 = f105 + f106;
- f109 = f107 - f106;
- f110 = f90 - f103;
- f111 = MUL_F(FRAC_CONST(-0.6666556584777466), f103);
- f112 = MUL_F(FRAC_CONST(0.9569403357322089), f110);
- f113 = MUL_C(COEF_CONST(1.2472250129866713), f90);
- f114 = f112 - f111;
- f115 = f113 - f112;
- f116 = f102 + f89;
- f117 = MUL_F(FRAC_CONST(-0.4105245275223571), f102);
- f118 = MUL_F(FRAC_CONST(0.8819212643483549), f116);
- f119 = MUL_C(COEF_CONST(1.3533180011743529), f89);
- f120 = f117 + f118;
- f121 = f119 - f118;
- f122 = f87 - f100;
- f123 = MUL_F(FRAC_CONST(-0.1386171691990915), f100);
- f124 = MUL_F(FRAC_CONST(0.7730104533627370), f122);
- f125 = MUL_C(COEF_CONST(1.4074037375263826), f87);
- f126 = f124 - f123;
- f127 = f125 - f124;
- f128 = f65 - f108;
- f129 = f65 + f108;
- f130 = f67 - f114;
- f131 = f67 + f114;
- f132 = f69 - f120;
- f133 = f69 + f120;
- f134 = f71 - f126;
- f135 = f71 + f126;
- f136 = f70 - f127;
- f137 = f70 + f127;
- f138 = f68 - f121;
- f139 = f68 + f121;
- f140 = f66 - f115;
- f141 = f66 + f115;
- f142 = f64 - f109;
- f143 = f64 + f109;
- f144 = f0 + f30;
- f145 = MUL_C(COEF_CONST(1.0478631305325901), f0);
- f146 = MUL_F(FRAC_CONST(-0.9987954562051724), f144);
- f147 = MUL_F(FRAC_CONST(-0.9497277818777548), f30);
- f148 = f145 + f146;
- f149 = f147 - f146;
- f150 = f4 + f26;
- f151 = MUL_F(FRAC_CONST(1.2130114330978077), f4);
- f152 = MUL_F(FRAC_CONST(-0.9700312531945440), f150);
- f153 = MUL_F(FRAC_CONST(-0.7270510732912803), f26);
- f154 = f151 + f152;
- f155 = f153 - f152;
- f156 = f8 + f22;
- f157 = MUL_C(COEF_CONST(1.3315443865537255), f8);
- f158 = MUL_F(FRAC_CONST(-0.9039892931234433), f156);
- f159 = MUL_F(FRAC_CONST(-0.4764341996931612), f22);
- f160 = f157 + f158;
- f161 = f159 - f158;
- f162 = f12 + f18;
- f163 = MUL_C(COEF_CONST(1.3989068359730781), f12);
- f164 = MUL_F(FRAC_CONST(-0.8032075314806453), f162);
- f165 = MUL_F(FRAC_CONST(-0.2075082269882124), f18);
- f166 = f163 + f164;
- f167 = f165 - f164;
- f168 = f16 + f14;
- f169 = MUL_C(COEF_CONST(1.4125100802019777), f16);
- f170 = MUL_F(FRAC_CONST(-0.6715589548470187), f168);
- f171 = MUL_F(FRAC_CONST(0.0693921705079402), f14);
- f172 = f169 + f170;
- f173 = f171 - f170;
- f174 = f20 + f10;
- f175 = MUL_C(COEF_CONST(1.3718313541934939), f20);
- f176 = MUL_F(FRAC_CONST(-0.5141027441932219), f174);
- f177 = MUL_F(FRAC_CONST(0.3436258658070501), f10);
- f178 = f175 + f176;
- f179 = f177 - f176;
- f180 = f24 + f6;
- f181 = MUL_C(COEF_CONST(1.2784339185752409), f24);
- f182 = MUL_F(FRAC_CONST(-0.3368898533922200), f180);
- f183 = MUL_F(FRAC_CONST(0.6046542117908008), f6);
- f184 = f181 + f182;
- f185 = f183 - f182;
- f186 = f28 + f2;
- f187 = MUL_C(COEF_CONST(1.1359069844201433), f28);
- f188 = MUL_F(FRAC_CONST(-0.1467304744553624), f186);
- f189 = MUL_F(FRAC_CONST(0.8424460355094185), f2);
- f190 = f187 + f188;
- f191 = f189 - f188;
- f192 = f149 - f173;
- f193 = f149 + f173;
- f194 = f148 - f172;
- f195 = f148 + f172;
- f196 = f155 - f179;
- f197 = f155 + f179;
- f198 = f154 - f178;
- f199 = f154 + f178;
- f200 = f161 - f185;
- f201 = f161 + f185;
- f202 = f160 - f184;
- f203 = f160 + f184;
- f204 = f167 - f191;
- f205 = f167 + f191;
- f206 = f166 - f190;
- f207 = f166 + f190;
- f208 = f192 + f194;
- f209 = MUL_C(COEF_CONST(1.1758756024193588), f192);
- f210 = MUL_F(FRAC_CONST(-0.9807852804032304), f208);
- f211 = MUL_F(FRAC_CONST(-0.7856949583871021), f194);
- f212 = f209 + f210;
- f213 = f211 - f210;
- f214 = f196 + f198;
- f215 = MUL_C(COEF_CONST(1.3870398453221475), f196);
- f216 = MUL_F(FRAC_CONST(-0.5555702330196022), f214);
- f217 = MUL_F(FRAC_CONST(0.2758993792829431), f198);
- f218 = f215 + f216;
- f219 = f217 - f216;
- f220 = f200 + f202;
- f221 = MUL_F(FRAC_CONST(0.7856949583871022), f200);
- f222 = MUL_F(FRAC_CONST(0.1950903220161283), f220);
- f223 = MUL_C(COEF_CONST(1.1758756024193586), f202);
- f224 = f221 + f222;
- f225 = f223 - f222;
- f226 = f204 + f206;
- f227 = MUL_F(FRAC_CONST(-0.2758993792829430), f204);
- f228 = MUL_F(FRAC_CONST(0.8314696123025452), f226);
- f229 = MUL_C(COEF_CONST(1.3870398453221475), f206);
- f230 = f227 + f228;
- f231 = f229 - f228;
- f232 = f193 - f201;
- f233 = f193 + f201;
- f234 = f195 - f203;
- f235 = f195 + f203;
- f236 = f197 - f205;
- f237 = f197 + f205;
- f238 = f199 - f207;
- f239 = f199 + f207;
- f240 = f213 - f225;
- f241 = f213 + f225;
- f242 = f212 - f224;
- f243 = f212 + f224;
- f244 = f219 - f231;
- f245 = f219 + f231;
- f246 = f218 - f230;
- f247 = f218 + f230;
- f248 = f232 + f234;
- f249 = MUL_C(COEF_CONST(1.3065629648763766), f232);
- f250 = MUL_F(FRAC_CONST(-0.9238795325112866), f248);
- f251 = MUL_F(FRAC_CONST(-0.5411961001461967), f234);
- f252 = f249 + f250;
- f253 = f251 - f250;
- f254 = f236 + f238;
- f255 = MUL_F(FRAC_CONST(0.5411961001461969), f236);
- f256 = MUL_F(FRAC_CONST(0.3826834323650898), f254);
- f257 = MUL_C(COEF_CONST(1.3065629648763766), f238);
- f258 = f255 + f256;
- f259 = f257 - f256;
- f260 = f240 + f242;
- f261 = MUL_C(COEF_CONST(1.3065629648763766), f240);
- f262 = MUL_F(FRAC_CONST(-0.9238795325112866), f260);
- f263 = MUL_F(FRAC_CONST(-0.5411961001461967), f242);
- f264 = f261 + f262;
- f265 = f263 - f262;
- f266 = f244 + f246;
- f267 = MUL_F(FRAC_CONST(0.5411961001461969), f244);
- f268 = MUL_F(FRAC_CONST(0.3826834323650898), f266);
- f269 = MUL_C(COEF_CONST(1.3065629648763766), f246);
- f270 = f267 + f268;
- f271 = f269 - f268;
- f272 = f233 - f237;
- f273 = f233 + f237;
- f274 = f235 - f239;
- f275 = f235 + f239;
- f276 = f253 - f259;
- f277 = f253 + f259;
- f278 = f252 - f258;
- f279 = f252 + f258;
- f280 = f241 - f245;
- f281 = f241 + f245;
- f282 = f243 - f247;
- f283 = f243 + f247;
- f284 = f265 - f271;
- f285 = f265 + f271;
- f286 = f264 - f270;
- f287 = f264 + f270;
- f288 = f272 - f274;
- f289 = f272 + f274;
- f290 = MUL_F(FRAC_CONST(0.7071067811865474), f288);
- f291 = MUL_F(FRAC_CONST(0.7071067811865474), f289);
- f292 = f276 - f278;
- f293 = f276 + f278;
- f294 = MUL_F(FRAC_CONST(0.7071067811865474), f292);
- f295 = MUL_F(FRAC_CONST(0.7071067811865474), f293);
- f296 = f280 - f282;
- f297 = f280 + f282;
- f298 = MUL_F(FRAC_CONST(0.7071067811865474), f296);
- f299 = MUL_F(FRAC_CONST(0.7071067811865474), f297);
- f300 = f284 - f286;
- f301 = f284 + f286;
- f302 = MUL_F(FRAC_CONST(0.7071067811865474), f300);
- f303 = MUL_F(FRAC_CONST(0.7071067811865474), f301);
- f304 = f129 - f273;
- f305 = f129 + f273;
- f306 = f131 - f281;
- f307 = f131 + f281;
- f308 = f133 - f285;
- f309 = f133 + f285;
- f310 = f135 - f277;
- f311 = f135 + f277;
- f312 = f137 - f295;
- f313 = f137 + f295;
- f314 = f139 - f303;
- f315 = f139 + f303;
- f316 = f141 - f299;
- f317 = f141 + f299;
- f318 = f143 - f291;
- f319 = f143 + f291;
- f320 = f142 - f290;
- f321 = f142 + f290;
- f322 = f140 - f298;
- f323 = f140 + f298;
- f324 = f138 - f302;
- f325 = f138 + f302;
- f326 = f136 - f294;
- f327 = f136 + f294;
- f328 = f134 - f279;
- f329 = f134 + f279;
- f330 = f132 - f287;
- f331 = f132 + f287;
- f332 = f130 - f283;
- f333 = f130 + f283;
- f334 = f128 - f275;
- f335 = f128 + f275;
- y[31] = MUL_F(FRAC_CONST(0.5001506360206510), f305);
- y[30] = MUL_F(FRAC_CONST(0.5013584524464084), f307);
- y[29] = MUL_F(FRAC_CONST(0.5037887256810443), f309);
- y[28] = MUL_F(FRAC_CONST(0.5074711720725553), f311);
- y[27] = MUL_F(FRAC_CONST(0.5124514794082247), f313);
- y[26] = MUL_F(FRAC_CONST(0.5187927131053328), f315);
- y[25] = MUL_F(FRAC_CONST(0.5265773151542700), f317);
- y[24] = MUL_F(FRAC_CONST(0.5359098169079920), f319);
- y[23] = MUL_F(FRAC_CONST(0.5469204379855088), f321);
- y[22] = MUL_F(FRAC_CONST(0.5597698129470802), f323);
- y[21] = MUL_F(FRAC_CONST(0.5746551840326600), f325);
- y[20] = MUL_F(FRAC_CONST(0.5918185358574165), f327);
- y[19] = MUL_F(FRAC_CONST(0.6115573478825099), f329);
- y[18] = MUL_F(FRAC_CONST(0.6342389366884031), f331);
- y[17] = MUL_F(FRAC_CONST(0.6603198078137061), f333);
- y[16] = MUL_F(FRAC_CONST(0.6903721282002123), f335);
- y[15] = MUL_F(FRAC_CONST(0.7251205223771985), f334);
- y[14] = MUL_F(FRAC_CONST(0.7654941649730891), f332);
- y[13] = MUL_F(FRAC_CONST(0.8127020908144905), f330);
- y[12] = MUL_F(FRAC_CONST(0.8683447152233481), f328);
- y[11] = MUL_F(FRAC_CONST(0.9345835970364075), f326);
- y[10] = MUL_C(COEF_CONST(1.0144082649970547), f324);
- y[9] = MUL_C(COEF_CONST(1.1120716205797176), f322);
- y[8] = MUL_C(COEF_CONST(1.2338327379765710), f320);
- y[7] = MUL_C(COEF_CONST(1.3892939586328277), f318);
- y[6] = MUL_C(COEF_CONST(1.5939722833856311), f316);
- y[5] = MUL_C(COEF_CONST(1.8746759800084078), f314);
- y[4] = MUL_C(COEF_CONST(2.2820500680051619), f312);
- y[3] = MUL_C(COEF_CONST(2.9246284281582162), f310);
- y[2] = MUL_C(COEF_CONST(4.0846110781292477), f308);
- y[1] = MUL_C(COEF_CONST(6.7967507116736332), f306);
- y[0] = MUL_R(REAL_CONST(20.3738781672314530), f304);
-}
-
-#endif
-
-#endif
diff --git a/src/libfaad/sbr_dct.h b/src/libfaad/sbr_dct.h
deleted file mode 100644
index 6293486c7..000000000
--- a/src/libfaad/sbr_dct.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_dct.h,v 1.5 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __SBR_DCT_H__
-#define __SBR_DCT_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void dct4_kernel(real_t * in_real, real_t * in_imag, real_t * out_real, real_t * out_imag);
-
-void DCT3_32_unscaled(real_t *y, real_t *x);
-void DCT4_32(real_t *y, real_t *x);
-void DST4_32(real_t *y, real_t *x);
-void DCT2_32_unscaled(real_t *y, real_t *x);
-void DCT4_16(real_t *y, real_t *x);
-void DCT2_16_unscaled(real_t *y, real_t *x);
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
diff --git a/src/libfaad/sbr_dec.c b/src/libfaad/sbr_dec.c
deleted file mode 100644
index 24c1f5031..000000000
--- a/src/libfaad/sbr_dec.c
+++ /dev/null
@@ -1,614 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_dec.c,v 1.9 2006/06/17 20:43:57 dgp85 Exp $
-**/
-
-
-#include "common.h"
-#include "structs.h"
-
-#ifdef SBR_DEC
-
-#include <string.h>
-#include <stdlib.h>
-
-#include "syntax.h"
-#include "bits.h"
-#include "sbr_syntax.h"
-#include "sbr_qmf.h"
-#include "sbr_hfgen.h"
-#include "sbr_hfadj.h"
-
-
-/* static function declarations */
-static uint8_t sbr_save_prev_data(sbr_info *sbr, uint8_t ch);
-static void sbr_save_matrix(sbr_info *sbr, uint8_t ch);
-
-
-sbr_info *sbrDecodeInit(uint16_t framelength, uint8_t id_aac,
- uint32_t sample_rate, uint8_t downSampledSBR
-#ifdef DRM
- , uint8_t IsDRM
-#endif
- )
-{
- sbr_info *sbr = faad_malloc(sizeof(sbr_info));
- memset(sbr, 0, sizeof(sbr_info));
-
- /* save id of the parent element */
- sbr->id_aac = id_aac;
- sbr->sample_rate = sample_rate;
-
- sbr->bs_freq_scale = 2;
- sbr->bs_alter_scale = 1;
- sbr->bs_noise_bands = 2;
- sbr->bs_limiter_bands = 2;
- sbr->bs_limiter_gains = 2;
- sbr->bs_interpol_freq = 1;
- sbr->bs_smoothing_mode = 1;
- sbr->bs_start_freq = 5;
- sbr->bs_amp_res = 1;
- sbr->bs_samplerate_mode = 1;
- sbr->prevEnvIsShort[0] = -1;
- sbr->prevEnvIsShort[1] = -1;
- sbr->header_count = 0;
- sbr->Reset = 1;
-
-#ifdef DRM
- sbr->Is_DRM_SBR = IsDRM;
-#endif
- sbr->tHFGen = T_HFGEN;
- sbr->tHFAdj = T_HFADJ;
-
- sbr->bsco = 0;
- sbr->bsco_prev = 0;
- sbr->M_prev = 0;
- sbr->frame_len = framelength;
-
- /* force sbr reset */
- sbr->bs_start_freq_prev = -1;
-
- if (framelength == 960)
- {
- sbr->numTimeSlotsRate = RATE * NO_TIME_SLOTS_960;
- sbr->numTimeSlots = NO_TIME_SLOTS_960;
- } else {
- sbr->numTimeSlotsRate = RATE * NO_TIME_SLOTS;
- sbr->numTimeSlots = NO_TIME_SLOTS;
- }
-
- sbr->GQ_ringbuf_index[0] = 0;
- sbr->GQ_ringbuf_index[1] = 0;
-
- if (id_aac == ID_CPE)
- {
- /* stereo */
- uint8_t j;
- sbr->qmfa[0] = qmfa_init(32);
- sbr->qmfa[1] = qmfa_init(32);
- sbr->qmfs[0] = qmfs_init((downSampledSBR)?32:64);
- sbr->qmfs[1] = qmfs_init((downSampledSBR)?32:64);
-
- for (j = 0; j < 5; j++)
- {
- sbr->G_temp_prev[0][j] = faad_malloc(64*sizeof(real_t));
- sbr->G_temp_prev[1][j] = faad_malloc(64*sizeof(real_t));
- sbr->Q_temp_prev[0][j] = faad_malloc(64*sizeof(real_t));
- sbr->Q_temp_prev[1][j] = faad_malloc(64*sizeof(real_t));
- }
-
- memset(sbr->Xsbr[0], 0, (sbr->numTimeSlotsRate+sbr->tHFGen)*64 * sizeof(qmf_t));
- memset(sbr->Xsbr[1], 0, (sbr->numTimeSlotsRate+sbr->tHFGen)*64 * sizeof(qmf_t));
- } else {
- /* mono */
- uint8_t j;
- sbr->qmfa[0] = qmfa_init(32);
- sbr->qmfs[0] = qmfs_init((downSampledSBR)?32:64);
- sbr->qmfs[1] = NULL;
-
- for (j = 0; j < 5; j++)
- {
- sbr->G_temp_prev[0][j] = faad_malloc(64*sizeof(real_t));
- sbr->Q_temp_prev[0][j] = faad_malloc(64*sizeof(real_t));
- }
-
- memset(sbr->Xsbr[0], 0, (sbr->numTimeSlotsRate+sbr->tHFGen)*64 * sizeof(qmf_t));
- }
-
- return sbr;
-}
-
-void sbrDecodeEnd(sbr_info *sbr)
-{
- uint8_t j;
-
- if (sbr)
- {
- qmfa_end(sbr->qmfa[0]);
- qmfs_end(sbr->qmfs[0]);
- if (sbr->qmfs[1] != NULL)
- {
- qmfa_end(sbr->qmfa[1]);
- qmfs_end(sbr->qmfs[1]);
- }
-
- for (j = 0; j < 5; j++)
- {
- if (sbr->G_temp_prev[0][j]) faad_free(sbr->G_temp_prev[0][j]);
- if (sbr->Q_temp_prev[0][j]) faad_free(sbr->Q_temp_prev[0][j]);
- if (sbr->G_temp_prev[1][j]) faad_free(sbr->G_temp_prev[1][j]);
- if (sbr->Q_temp_prev[1][j]) faad_free(sbr->Q_temp_prev[1][j]);
- }
-
-#ifdef PS_DEC
- if (sbr->ps != NULL)
- ps_free(sbr->ps);
-#endif
-
-#ifdef DRM_PS
- if (sbr->drm_ps != NULL)
- drm_ps_free(sbr->drm_ps);
-#endif
-
- faad_free(sbr);
- }
-}
-
-static uint8_t sbr_save_prev_data(sbr_info *sbr, uint8_t ch)
-{
- uint8_t i;
-
- /* save data for next frame */
- sbr->kx_prev = sbr->kx;
- sbr->M_prev = sbr->M;
- sbr->bsco_prev = sbr->bsco;
-
- sbr->L_E_prev[ch] = sbr->L_E[ch];
-
- /* sbr->L_E[ch] can become 0 on files with bit errors */
- if (sbr->L_E[ch] <= 0)
- return 19;
-
- sbr->f_prev[ch] = sbr->f[ch][sbr->L_E[ch] - 1];
- for (i = 0; i < MAX_M; i++)
- {
- sbr->E_prev[ch][i] = sbr->E[ch][i][sbr->L_E[ch] - 1];
- sbr->Q_prev[ch][i] = sbr->Q[ch][i][sbr->L_Q[ch] - 1];
- }
-
- for (i = 0; i < MAX_M; i++)
- {
- sbr->bs_add_harmonic_prev[ch][i] = sbr->bs_add_harmonic[ch][i];
- }
- sbr->bs_add_harmonic_flag_prev[ch] = sbr->bs_add_harmonic_flag[ch];
-
- if (sbr->l_A[ch] == sbr->L_E[ch])
- sbr->prevEnvIsShort[ch] = 0;
- else
- sbr->prevEnvIsShort[ch] = -1;
-
- return 0;
-}
-
-static void sbr_save_matrix(sbr_info *sbr, uint8_t ch)
-{
- uint8_t i;
-
- for (i = 0; i < sbr->tHFGen; i++)
- {
- memmove(sbr->Xsbr[ch][i], sbr->Xsbr[ch][i+sbr->numTimeSlotsRate], 64 * sizeof(qmf_t));
- }
- for (i = sbr->tHFGen; i < MAX_NTSRHFG; i++)
- {
- memset(sbr->Xsbr[ch][i], 0, 64 * sizeof(qmf_t));
- }
-}
-
-static void sbr_process_channel(sbr_info *sbr, real_t *channel_buf, qmf_t X[MAX_NTSR][64],
- uint8_t ch, uint8_t dont_process,
- const uint8_t downSampledSBR)
-{
- int16_t k, l;
-
-#ifdef SBR_LOW_POWER
- ALIGN real_t deg[64];
-#endif
-
-#ifdef DRM
- if (sbr->Is_DRM_SBR)
- {
- sbr->bsco = max((int32_t)sbr->maxAACLine*32/(int32_t)sbr->frame_len - (int32_t)sbr->kx, 0);
- } else {
-#endif
- sbr->bsco = 0;
-#ifdef DRM
- }
-#endif
-
-
-//#define PRE_QMF_PRINT
-#ifdef PRE_QMF_PRINT
- {
- int i;
- for (i = 0; i < 1024; i++)
- {
- printf("%d\n", channel_buf[i]);
- }
- }
-#endif
-
-
- /* subband analysis */
- if (dont_process)
- sbr_qmf_analysis_32(sbr, sbr->qmfa[ch], channel_buf, sbr->Xsbr[ch], sbr->tHFGen, 32);
- else
- sbr_qmf_analysis_32(sbr, sbr->qmfa[ch], channel_buf, sbr->Xsbr[ch], sbr->tHFGen, sbr->kx);
-
- if (!dont_process)
- {
-#if 1
- /* insert high frequencies here */
- /* hf generation using patching */
- hf_generation(sbr, sbr->Xsbr[ch], sbr->Xsbr[ch]
-#ifdef SBR_LOW_POWER
- ,deg
-#endif
- ,ch);
-#endif
-
-#ifdef SBR_LOW_POWER
- for (l = sbr->t_E[ch][0]; l < sbr->t_E[ch][sbr->L_E[ch]]; l++)
- {
- for (k = 0; k < sbr->kx; k++)
- {
- QMF_RE(sbr->Xsbr[ch][sbr->tHFAdj + l][k]) = 0;
- }
- }
-#endif
-
-#if 1
- /* hf adjustment */
- hf_adjustment(sbr, sbr->Xsbr[ch]
-#ifdef SBR_LOW_POWER
- ,deg
-#endif
- ,ch);
-#endif
- }
-
- if ((sbr->just_seeked != 0) || dont_process)
- {
- for (l = 0; l < sbr->numTimeSlotsRate; l++)
- {
- for (k = 0; k < 32; k++)
- {
- QMF_RE(X[l][k]) = QMF_RE(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
-#ifndef SBR_LOW_POWER
- QMF_IM(X[l][k]) = QMF_IM(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
-#endif
- }
- for (k = 32; k < 64; k++)
- {
- QMF_RE(X[l][k]) = 0;
-#ifndef SBR_LOW_POWER
- QMF_IM(X[l][k]) = 0;
-#endif
- }
- }
- } else {
- for (l = 0; l < sbr->numTimeSlotsRate; l++)
- {
- uint8_t kx_band, M_band, bsco_band;
-
- if (l < sbr->t_E[ch][0])
- {
- kx_band = sbr->kx_prev;
- M_band = sbr->M_prev;
- bsco_band = sbr->bsco_prev;
- } else {
- kx_band = sbr->kx;
- M_band = sbr->M;
- bsco_band = sbr->bsco;
- }
-
-#ifndef SBR_LOW_POWER
- for (k = 0; k < kx_band + bsco_band; k++)
- {
- QMF_RE(X[l][k]) = QMF_RE(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
- QMF_IM(X[l][k]) = QMF_IM(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
- }
- for (k = kx_band + bsco_band; k < kx_band + M_band; k++)
- {
- QMF_RE(X[l][k]) = QMF_RE(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
- QMF_IM(X[l][k]) = QMF_IM(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
- }
- for (k = max(kx_band + bsco_band, kx_band + M_band); k < 64; k++)
- {
- QMF_RE(X[l][k]) = 0;
- QMF_IM(X[l][k]) = 0;
- }
-#else
- for (k = 0; k < kx_band + bsco_band; k++)
- {
- QMF_RE(X[l][k]) = QMF_RE(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
- }
- for (k = kx_band + bsco_band; k < min(kx_band + M_band, 63); k++)
- {
- QMF_RE(X[l][k]) = QMF_RE(sbr->Xsbr[ch][l + sbr->tHFAdj][k]);
- }
- for (k = max(kx_band + bsco_band, kx_band + M_band); k < 64; k++)
- {
- QMF_RE(X[l][k]) = 0;
- }
- QMF_RE(X[l][kx_band - 1 + bsco_band]) +=
- QMF_RE(sbr->Xsbr[ch][l + sbr->tHFAdj][kx_band - 1 + bsco_band]);
-#endif
- }
- }
-}
-
-uint8_t sbrDecodeCoupleFrame(sbr_info *sbr, real_t *left_chan, real_t *right_chan,
- const uint8_t just_seeked, const uint8_t downSampledSBR)
-{
- uint8_t dont_process = 0;
- uint8_t ret = 0;
- ALIGN qmf_t X[MAX_NTSR][64];
-
- if (sbr == NULL)
- return 20;
-
- /* case can occur due to bit errors */
- if (sbr->id_aac != ID_CPE)
- return 21;
-
- if (sbr->ret || (sbr->header_count == 0))
- {
- /* don't process just upsample */
- dont_process = 1;
-
- /* Re-activate reset for next frame */
- if (sbr->ret && sbr->Reset)
- sbr->bs_start_freq_prev = -1;
- }
-
- if (just_seeked)
- {
- sbr->just_seeked = 1;
- } else {
- sbr->just_seeked = 0;
- }
-
- sbr_process_channel(sbr, left_chan, X, 0, dont_process, downSampledSBR);
- /* subband synthesis */
- if (downSampledSBR)
- {
- sbr_qmf_synthesis_32(sbr, sbr->qmfs[0], X, left_chan);
- } else {
- sbr_qmf_synthesis_64(sbr, sbr->qmfs[0], X, left_chan);
- }
-
- sbr_process_channel(sbr, right_chan, X, 1, dont_process, downSampledSBR);
- /* subband synthesis */
- if (downSampledSBR)
- {
- sbr_qmf_synthesis_32(sbr, sbr->qmfs[1], X, right_chan);
- } else {
- sbr_qmf_synthesis_64(sbr, sbr->qmfs[1], X, right_chan);
- }
-
- if (sbr->bs_header_flag)
- sbr->just_seeked = 0;
-
- if (sbr->header_count != 0 && sbr->ret == 0)
- {
- ret = sbr_save_prev_data(sbr, 0);
- if (ret) return ret;
- ret = sbr_save_prev_data(sbr, 1);
- if (ret) return ret;
- }
-
- sbr_save_matrix(sbr, 0);
- sbr_save_matrix(sbr, 1);
-
- sbr->frame++;
-
-//#define POST_QMF_PRINT
-#ifdef POST_QMF_PRINT
- {
- int i;
- for (i = 0; i < 2048; i++)
- {
- printf("%d\n", left_chan[i]);
- }
- for (i = 0; i < 2048; i++)
- {
- printf("%d\n", right_chan[i]);
- }
- }
-#endif
-
- return 0;
-}
-
-uint8_t sbrDecodeSingleFrame(sbr_info *sbr, real_t *channel,
- const uint8_t just_seeked, const uint8_t downSampledSBR)
-{
- uint8_t dont_process = 0;
- uint8_t ret = 0;
- ALIGN qmf_t X[MAX_NTSR][64];
-
- if (sbr == NULL)
- return 20;
-
- /* case can occur due to bit errors */
- if (sbr->id_aac != ID_SCE && sbr->id_aac != ID_LFE)
- return 21;
-
- if (sbr->ret || (sbr->header_count == 0))
- {
- /* don't process just upsample */
- dont_process = 1;
-
- /* Re-activate reset for next frame */
- if (sbr->ret && sbr->Reset)
- sbr->bs_start_freq_prev = -1;
- }
-
- if (just_seeked)
- {
- sbr->just_seeked = 1;
- } else {
- sbr->just_seeked = 0;
- }
-
- sbr_process_channel(sbr, channel, X, 0, dont_process, downSampledSBR);
- /* subband synthesis */
- if (downSampledSBR)
- {
- sbr_qmf_synthesis_32(sbr, sbr->qmfs[0], X, channel);
- } else {
- sbr_qmf_synthesis_64(sbr, sbr->qmfs[0], X, channel);
- }
-
- if (sbr->bs_header_flag)
- sbr->just_seeked = 0;
-
- if (sbr->header_count != 0 && sbr->ret == 0)
- {
- ret = sbr_save_prev_data(sbr, 0);
- if (ret) return ret;
- }
-
- sbr_save_matrix(sbr, 0);
-
- sbr->frame++;
-
-//#define POST_QMF_PRINT
-#ifdef POST_QMF_PRINT
- {
- int i;
- for (i = 0; i < 2048; i++)
- {
- printf("%d\n", channel[i]);
- }
- }
-#endif
-
- return 0;
-}
-
-#if (defined(PS_DEC) || defined(DRM_PS))
-uint8_t sbrDecodeSingleFramePS(sbr_info *sbr, real_t *left_channel, real_t *right_channel,
- const uint8_t just_seeked, const uint8_t downSampledSBR)
-{
- uint8_t l, k;
- uint8_t dont_process = 0;
- uint8_t ret = 0;
- ALIGN qmf_t X_left[38][64] = {{{0}}};
- ALIGN qmf_t X_right[38][64] = {{{0}}}; /* must set this to 0 */
-
- if (sbr == NULL)
- return 20;
-
- /* case can occur due to bit errors */
- if (sbr->id_aac != ID_SCE && sbr->id_aac != ID_LFE)
- return 21;
-
- if (sbr->ret || (sbr->header_count == 0))
- {
- /* don't process just upsample */
- dont_process = 1;
-
- /* Re-activate reset for next frame */
- if (sbr->ret && sbr->Reset)
- sbr->bs_start_freq_prev = -1;
- }
-
- if (just_seeked)
- {
- sbr->just_seeked = 1;
- } else {
- sbr->just_seeked = 0;
- }
-
- if (sbr->qmfs[1] == NULL)
- {
- sbr->qmfs[1] = qmfs_init((downSampledSBR)?32:64);
- }
-
- sbr_process_channel(sbr, left_channel, X_left, 0, dont_process, downSampledSBR);
-
- /* copy some extra data for PS */
- for (l = 32; l < 38; l++)
- {
- for (k = 0; k < 5; k++)
- {
- QMF_RE(X_left[l][k]) = QMF_RE(sbr->Xsbr[0][sbr->tHFAdj+l][k]);
- QMF_IM(X_left[l][k]) = QMF_IM(sbr->Xsbr[0][sbr->tHFAdj+l][k]);
- }
- }
-
- /* perform parametric stereo */
-#ifdef DRM_PS
- if (sbr->Is_DRM_SBR)
- {
- drm_ps_decode(sbr->drm_ps, (sbr->ret > 0), sbr->sample_rate, X_left, X_right);
- } else {
-#endif
-#ifdef PS_DEC
- ps_decode(sbr->ps, X_left, X_right);
-#endif
-#ifdef DRM_PS
- }
-#endif
-
- /* subband synthesis */
- if (downSampledSBR)
- {
- sbr_qmf_synthesis_32(sbr, sbr->qmfs[0], X_left, left_channel);
- sbr_qmf_synthesis_32(sbr, sbr->qmfs[1], X_right, right_channel);
- } else {
- sbr_qmf_synthesis_64(sbr, sbr->qmfs[0], X_left, left_channel);
- sbr_qmf_synthesis_64(sbr, sbr->qmfs[1], X_right, right_channel);
- }
-
- if (sbr->bs_header_flag)
- sbr->just_seeked = 0;
-
- if (sbr->header_count != 0 && sbr->ret == 0)
- {
- ret = sbr_save_prev_data(sbr, 0);
- if (ret) return ret;
- }
-
- sbr_save_matrix(sbr, 0);
-
- sbr->frame++;
-
- return 0;
-}
-#endif
-
-#endif
diff --git a/src/libfaad/sbr_dec.h b/src/libfaad/sbr_dec.h
deleted file mode 100644
index 5efd5c5e0..000000000
--- a/src/libfaad/sbr_dec.h
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_dec.h,v 1.7 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __SBR_DEC_H__
-#define __SBR_DEC_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef PS_DEC
-#include "ps_dec.h"
-#endif
-#ifdef DRM_PS
-#include "drm_dec.h"
-#endif
-
-/* MAX_NTSRHFG: maximum of number_time_slots * rate + HFGen. 16*2+8 */
-#define MAX_NTSRHFG 40
-#define MAX_NTSR 32 /* max number_time_slots * rate, ok for DRM and not DRM mode */
-
-/* MAX_M: maximum value for M */
-#define MAX_M 49
-/* MAX_L_E: maximum value for L_E */
-#define MAX_L_E 5
-
-typedef struct {
- real_t *x;
- int16_t x_index;
- uint8_t channels;
-} qmfa_info;
-
-typedef struct {
- real_t *v;
- int16_t v_index;
- uint8_t channels;
-} qmfs_info;
-
-typedef struct
-{
- uint32_t sample_rate;
- uint32_t maxAACLine;
-
- uint8_t rate;
- uint8_t just_seeked;
- uint8_t ret;
-
- uint8_t amp_res[2];
-
- uint8_t k0;
- uint8_t kx;
- uint8_t M;
- uint8_t N_master;
- uint8_t N_high;
- uint8_t N_low;
- uint8_t N_Q;
- uint8_t N_L[4];
- uint8_t n[2];
-
- uint8_t f_master[64];
- uint8_t f_table_res[2][64];
- uint8_t f_table_noise[64];
- uint8_t f_table_lim[4][64];
-#ifdef SBR_LOW_POWER
- uint8_t f_group[5][64];
- uint8_t N_G[5];
-#endif
-
- uint8_t table_map_k_to_g[64];
-
- uint8_t abs_bord_lead[2];
- uint8_t abs_bord_trail[2];
- uint8_t n_rel_lead[2];
- uint8_t n_rel_trail[2];
-
- uint8_t L_E[2];
- uint8_t L_E_prev[2];
- uint8_t L_Q[2];
-
- uint8_t t_E[2][MAX_L_E+1];
- uint8_t t_Q[2][3];
- uint8_t f[2][MAX_L_E+1];
- uint8_t f_prev[2];
-
- real_t *G_temp_prev[2][5];
- real_t *Q_temp_prev[2][5];
- int8_t GQ_ringbuf_index[2];
-
- int16_t E[2][64][MAX_L_E];
- int16_t E_prev[2][64];
-#ifndef FIXED_POINT
- real_t E_orig[2][64][MAX_L_E];
-#endif
- real_t E_curr[2][64][MAX_L_E];
- int32_t Q[2][64][2];
-#ifndef FIXED_POINT
- real_t Q_div[2][64][2];
- real_t Q_div2[2][64][2];
-#endif
- int32_t Q_prev[2][64];
-
- int8_t l_A[2];
- int8_t l_A_prev[2];
-
- uint8_t bs_invf_mode[2][MAX_L_E];
- uint8_t bs_invf_mode_prev[2][MAX_L_E];
- real_t bwArray[2][64];
- real_t bwArray_prev[2][64];
-
- uint8_t noPatches;
- uint8_t patchNoSubbands[64];
- uint8_t patchStartSubband[64];
-
- uint8_t bs_add_harmonic[2][64];
- uint8_t bs_add_harmonic_prev[2][64];
-
- uint16_t index_noise_prev[2];
- uint8_t psi_is_prev[2];
-
- uint8_t bs_start_freq_prev;
- uint8_t bs_stop_freq_prev;
- uint8_t bs_xover_band_prev;
- uint8_t bs_freq_scale_prev;
- uint8_t bs_alter_scale_prev;
- uint8_t bs_noise_bands_prev;
-
- int8_t prevEnvIsShort[2];
-
- int8_t kx_prev;
- uint8_t bsco;
- uint8_t bsco_prev;
- uint8_t M_prev;
- uint16_t frame_len;
-
- uint8_t Reset;
- uint32_t frame;
- uint32_t header_count;
-
- uint8_t id_aac;
- qmfa_info *qmfa[2];
- qmfs_info *qmfs[2];
-
- qmf_t Xsbr[2][MAX_NTSRHFG][64];
-
-#ifdef DRM
- uint8_t Is_DRM_SBR;
-#ifdef DRM_PS
- drm_ps_info *drm_ps;
-#endif
-#endif
-
- uint8_t numTimeSlotsRate;
- uint8_t numTimeSlots;
- uint8_t tHFGen;
- uint8_t tHFAdj;
-
-#ifdef PS_DEC
- ps_info *ps;
-#endif
-#if (defined(PS_DEC) || defined(DRM_PS))
- uint8_t ps_used;
-#endif
-
- /* to get it compiling */
- /* we'll see during the coding of all the tools, whether
- these are all used or not.
- */
- uint8_t bs_header_flag;
- uint8_t bs_crc_flag;
- uint16_t bs_sbr_crc_bits;
- uint8_t bs_protocol_version;
- uint8_t bs_amp_res;
- uint8_t bs_start_freq;
- uint8_t bs_stop_freq;
- uint8_t bs_xover_band;
- uint8_t bs_freq_scale;
- uint8_t bs_alter_scale;
- uint8_t bs_noise_bands;
- uint8_t bs_limiter_bands;
- uint8_t bs_limiter_gains;
- uint8_t bs_interpol_freq;
- uint8_t bs_smoothing_mode;
- uint8_t bs_samplerate_mode;
- uint8_t bs_add_harmonic_flag[2];
- uint8_t bs_add_harmonic_flag_prev[2];
- uint8_t bs_extended_data;
- uint8_t bs_extension_id;
- uint8_t bs_extension_data;
- uint8_t bs_coupling;
- uint8_t bs_frame_class[2];
- uint8_t bs_rel_bord[2][9];
- uint8_t bs_rel_bord_0[2][9];
- uint8_t bs_rel_bord_1[2][9];
- uint8_t bs_pointer[2];
- uint8_t bs_abs_bord_0[2];
- uint8_t bs_abs_bord_1[2];
- uint8_t bs_num_rel_0[2];
- uint8_t bs_num_rel_1[2];
- uint8_t bs_df_env[2][9];
- uint8_t bs_df_noise[2][3];
-} sbr_info;
-
-sbr_info *sbrDecodeInit(uint16_t framelength, uint8_t id_aac,
- uint32_t sample_rate, uint8_t downSampledSBR
-#ifdef DRM
- , uint8_t IsDRM
-#endif
- );
-void sbrDecodeEnd(sbr_info *sbr);
-
-uint8_t sbrDecodeCoupleFrame(sbr_info *sbr, real_t *left_chan, real_t *right_chan,
- const uint8_t just_seeked, const uint8_t downSampledSBR);
-uint8_t sbrDecodeSingleFrame(sbr_info *sbr, real_t *channel,
- const uint8_t just_seeked, const uint8_t downSampledSBR);
-#if (defined(PS_DEC) || defined(DRM_PS))
-uint8_t sbrDecodeSingleFramePS(sbr_info *sbr, real_t *left_channel, real_t *right_channel,
- const uint8_t just_seeked, const uint8_t downSampledSBR);
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
diff --git a/src/libfaad/sbr_e_nf.c b/src/libfaad/sbr_e_nf.c
deleted file mode 100644
index 2d2bf4f85..000000000
--- a/src/libfaad/sbr_e_nf.c
+++ /dev/null
@@ -1,507 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_e_nf.c,v 1.5 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#include "common.h"
-#include "structs.h"
-
-#ifdef SBR_DEC
-
-#include <stdlib.h>
-
-#include "sbr_syntax.h"
-#include "sbr_e_nf.h"
-
-void extract_envelope_data(sbr_info *sbr, uint8_t ch)
-{
- uint8_t l, k;
-
- for (l = 0; l < sbr->L_E[ch]; l++)
- {
- if (sbr->bs_df_env[ch][l] == 0)
- {
- for (k = 1; k < sbr->n[sbr->f[ch][l]]; k++)
- {
- sbr->E[ch][k][l] = sbr->E[ch][k - 1][l] + sbr->E[ch][k][l];
- if (sbr->E[ch][k][l] < 0)
- sbr->E[ch][k][l] = 0;
- }
-
- } else { /* bs_df_env == 1 */
-
- uint8_t g = (l == 0) ? sbr->f_prev[ch] : sbr->f[ch][l-1];
- int16_t E_prev;
-
- if (sbr->f[ch][l] == g)
- {
- for (k = 0; k < sbr->n[sbr->f[ch][l]]; k++)
- {
- if (l == 0)
- E_prev = sbr->E_prev[ch][k];
- else
- E_prev = sbr->E[ch][k][l - 1];
-
- sbr->E[ch][k][l] = E_prev + sbr->E[ch][k][l];
- }
-
- } else if ((g == 1) && (sbr->f[ch][l] == 0)) {
- uint8_t i;
-
- for (k = 0; k < sbr->n[sbr->f[ch][l]]; k++)
- {
- for (i = 0; i < sbr->N_high; i++)
- {
- if (sbr->f_table_res[HI_RES][i] == sbr->f_table_res[LO_RES][k])
- {
- if (l == 0)
- E_prev = sbr->E_prev[ch][i];
- else
- E_prev = sbr->E[ch][i][l - 1];
-
- sbr->E[ch][k][l] = E_prev + sbr->E[ch][k][l];
- }
- }
- }
-
- } else if ((g == 0) && (sbr->f[ch][l] == 1)) {
- uint8_t i;
-
- for (k = 0; k < sbr->n[sbr->f[ch][l]]; k++)
- {
- for (i = 0; i < sbr->N_low; i++)
- {
- if ((sbr->f_table_res[LO_RES][i] <= sbr->f_table_res[HI_RES][k]) &&
- (sbr->f_table_res[HI_RES][k] < sbr->f_table_res[LO_RES][i + 1]))
- {
- if (l == 0)
- E_prev = sbr->E_prev[ch][i];
- else
- E_prev = sbr->E[ch][i][l - 1];
-
- sbr->E[ch][k][l] = E_prev + sbr->E[ch][k][l];
- }
- }
- }
- }
- }
- }
-}
-
-void extract_noise_floor_data(sbr_info *sbr, uint8_t ch)
-{
- uint8_t l, k;
-
- for (l = 0; l < sbr->L_Q[ch]; l++)
- {
- if (sbr->bs_df_noise[ch][l] == 0)
- {
- for (k = 1; k < sbr->N_Q; k++)
- {
- sbr->Q[ch][k][l] = sbr->Q[ch][k][l] + sbr->Q[ch][k-1][l];
- }
- } else {
- if (l == 0)
- {
- for (k = 0; k < sbr->N_Q; k++)
- {
- sbr->Q[ch][k][l] = sbr->Q_prev[ch][k] + sbr->Q[ch][k][0];
- }
- } else {
- for (k = 0; k < sbr->N_Q; k++)
- {
- sbr->Q[ch][k][l] = sbr->Q[ch][k][l - 1] + sbr->Q[ch][k][l];
- }
- }
- }
- }
-}
-
-#ifndef FIXED_POINT
-
-/* table for Q_div values when no coupling */
-static const real_t Q_div_tab[31] = {
- FRAC_CONST(0.0153846), FRAC_CONST(0.030303),
- FRAC_CONST(0.0588235), FRAC_CONST(0.111111),
- FRAC_CONST(0.2), FRAC_CONST(0.333333),
- FRAC_CONST(0.5), FRAC_CONST(0.666667),
- FRAC_CONST(0.8), FRAC_CONST(0.888889),
- FRAC_CONST(0.941176), FRAC_CONST(0.969697),
- FRAC_CONST(0.984615), FRAC_CONST(0.992248),
- FRAC_CONST(0.996109), FRAC_CONST(0.998051),
- FRAC_CONST(0.999024), FRAC_CONST(0.999512),
- FRAC_CONST(0.999756), FRAC_CONST(0.999878),
- FRAC_CONST(0.999939), FRAC_CONST(0.999969),
- FRAC_CONST(0.999985), FRAC_CONST(0.999992),
- FRAC_CONST(0.999996), FRAC_CONST(0.999998),
- FRAC_CONST(0.999999), FRAC_CONST(1),
- FRAC_CONST(1), FRAC_CONST(1),
- FRAC_CONST(1)
-};
-
-static const real_t Q_div_tab_left[31][13] = {
- { FRAC_CONST(0.969704), FRAC_CONST(0.888985), FRAC_CONST(0.667532), FRAC_CONST(0.336788), FRAC_CONST(0.117241), FRAC_CONST(0.037594), FRAC_CONST(0.0153846), FRAC_CONST(0.00967118), FRAC_CONST(0.00823245), FRAC_CONST(0.00787211), FRAC_CONST(0.00778198), FRAC_CONST(0.00775945), FRAC_CONST(0.00775382) },
- { FRAC_CONST(0.984619), FRAC_CONST(0.94123), FRAC_CONST(0.800623), FRAC_CONST(0.503876), FRAC_CONST(0.209877), FRAC_CONST(0.0724638), FRAC_CONST(0.030303), FRAC_CONST(0.0191571), FRAC_CONST(0.0163305), FRAC_CONST(0.0156212), FRAC_CONST(0.0154438), FRAC_CONST(0.0153994), FRAC_CONST(0.0153883) },
- { FRAC_CONST(0.99225), FRAC_CONST(0.969726), FRAC_CONST(0.889273), FRAC_CONST(0.670103), FRAC_CONST(0.346939), FRAC_CONST(0.135135), FRAC_CONST(0.0588235), FRAC_CONST(0.037594), FRAC_CONST(0.0321361), FRAC_CONST(0.0307619), FRAC_CONST(0.0304178), FRAC_CONST(0.0303317), FRAC_CONST(0.0303102) },
- { FRAC_CONST(0.99611), FRAC_CONST(0.98463), FRAC_CONST(0.941392), FRAC_CONST(0.802469), FRAC_CONST(0.515152), FRAC_CONST(0.238095), FRAC_CONST(0.111111), FRAC_CONST(0.0724638), FRAC_CONST(0.0622711), FRAC_CONST(0.0596878), FRAC_CONST(0.0590397), FRAC_CONST(0.0588776), FRAC_CONST(0.058837) },
- { FRAC_CONST(0.998051), FRAC_CONST(0.992256), FRAC_CONST(0.969811), FRAC_CONST(0.890411), FRAC_CONST(0.68), FRAC_CONST(0.384615), FRAC_CONST(0.2), FRAC_CONST(0.135135), FRAC_CONST(0.117241), FRAC_CONST(0.112652), FRAC_CONST(0.111497), FRAC_CONST(0.111208), FRAC_CONST(0.111135) },
- { FRAC_CONST(0.999025), FRAC_CONST(0.996113), FRAC_CONST(0.984674), FRAC_CONST(0.942029), FRAC_CONST(0.809524), FRAC_CONST(0.555556), FRAC_CONST(0.333333), FRAC_CONST(0.238095), FRAC_CONST(0.209877), FRAC_CONST(0.202492), FRAC_CONST(0.200625), FRAC_CONST(0.200156), FRAC_CONST(0.200039) },
- { FRAC_CONST(0.999512), FRAC_CONST(0.998053), FRAC_CONST(0.992278), FRAC_CONST(0.970149), FRAC_CONST(0.894737), FRAC_CONST(0.714286), FRAC_CONST(0.5), FRAC_CONST(0.384615), FRAC_CONST(0.346939), FRAC_CONST(0.336788), FRAC_CONST(0.3342), FRAC_CONST(0.33355), FRAC_CONST(0.333388) },
- { FRAC_CONST(0.999756), FRAC_CONST(0.999025), FRAC_CONST(0.996124), FRAC_CONST(0.984848), FRAC_CONST(0.944444), FRAC_CONST(0.833333), FRAC_CONST(0.666667), FRAC_CONST(0.555556), FRAC_CONST(0.515152), FRAC_CONST(0.503876), FRAC_CONST(0.500975), FRAC_CONST(0.500244), FRAC_CONST(0.500061) },
- { FRAC_CONST(0.999878), FRAC_CONST(0.999512), FRAC_CONST(0.998058), FRAC_CONST(0.992366), FRAC_CONST(0.971429), FRAC_CONST(0.909091), FRAC_CONST(0.8), FRAC_CONST(0.714286), FRAC_CONST(0.68), FRAC_CONST(0.670103), FRAC_CONST(0.667532), FRAC_CONST(0.666884), FRAC_CONST(0.666721) },
- { FRAC_CONST(0.999939), FRAC_CONST(0.999756), FRAC_CONST(0.999028), FRAC_CONST(0.996169), FRAC_CONST(0.985507), FRAC_CONST(0.952381), FRAC_CONST(0.888889), FRAC_CONST(0.833333), FRAC_CONST(0.809524), FRAC_CONST(0.802469), FRAC_CONST(0.800623), FRAC_CONST(0.800156), FRAC_CONST(0.800039) },
- { FRAC_CONST(0.999969), FRAC_CONST(0.999878), FRAC_CONST(0.999514), FRAC_CONST(0.998081), FRAC_CONST(0.992701), FRAC_CONST(0.97561), FRAC_CONST(0.941176), FRAC_CONST(0.909091), FRAC_CONST(0.894737), FRAC_CONST(0.890411), FRAC_CONST(0.889273), FRAC_CONST(0.888985), FRAC_CONST(0.888913) },
- { FRAC_CONST(0.999985), FRAC_CONST(0.999939), FRAC_CONST(0.999757), FRAC_CONST(0.999039), FRAC_CONST(0.996337), FRAC_CONST(0.987654), FRAC_CONST(0.969697), FRAC_CONST(0.952381), FRAC_CONST(0.944444), FRAC_CONST(0.942029), FRAC_CONST(0.941392), FRAC_CONST(0.94123), FRAC_CONST(0.94119) },
- { FRAC_CONST(0.999992), FRAC_CONST(0.99997), FRAC_CONST(0.999878), FRAC_CONST(0.999519), FRAC_CONST(0.998165), FRAC_CONST(0.993789), FRAC_CONST(0.984615), FRAC_CONST(0.97561), FRAC_CONST(0.971429), FRAC_CONST(0.970149), FRAC_CONST(0.969811), FRAC_CONST(0.969726), FRAC_CONST(0.969704) },
- { FRAC_CONST(0.999996), FRAC_CONST(0.999985), FRAC_CONST(0.999939), FRAC_CONST(0.99976), FRAC_CONST(0.999082), FRAC_CONST(0.996885), FRAC_CONST(0.992248), FRAC_CONST(0.987654), FRAC_CONST(0.985507), FRAC_CONST(0.984848), FRAC_CONST(0.984674), FRAC_CONST(0.98463), FRAC_CONST(0.984619) },
- { FRAC_CONST(0.999998), FRAC_CONST(0.999992), FRAC_CONST(0.99997), FRAC_CONST(0.99988), FRAC_CONST(0.999541), FRAC_CONST(0.99844), FRAC_CONST(0.996109), FRAC_CONST(0.993789), FRAC_CONST(0.992701), FRAC_CONST(0.992366), FRAC_CONST(0.992278), FRAC_CONST(0.992256), FRAC_CONST(0.99225) },
- { FRAC_CONST(0.999999), FRAC_CONST(0.999996), FRAC_CONST(0.999985), FRAC_CONST(0.99994), FRAC_CONST(0.99977), FRAC_CONST(0.999219), FRAC_CONST(0.998051), FRAC_CONST(0.996885), FRAC_CONST(0.996337), FRAC_CONST(0.996169), FRAC_CONST(0.996124), FRAC_CONST(0.996113), FRAC_CONST(0.99611) },
- { FRAC_CONST(1), FRAC_CONST(0.999998), FRAC_CONST(0.999992), FRAC_CONST(0.99997), FRAC_CONST(0.999885), FRAC_CONST(0.99961), FRAC_CONST(0.999024), FRAC_CONST(0.99844), FRAC_CONST(0.998165), FRAC_CONST(0.998081), FRAC_CONST(0.998058), FRAC_CONST(0.998053), FRAC_CONST(0.998051) },
- { FRAC_CONST(1), FRAC_CONST(0.999999), FRAC_CONST(0.999996), FRAC_CONST(0.999985), FRAC_CONST(0.999943), FRAC_CONST(0.999805), FRAC_CONST(0.999512), FRAC_CONST(0.999219), FRAC_CONST(0.999082), FRAC_CONST(0.999039), FRAC_CONST(0.999028), FRAC_CONST(0.999025), FRAC_CONST(0.999025) },
- { FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(0.999998), FRAC_CONST(0.999992), FRAC_CONST(0.999971), FRAC_CONST(0.999902), FRAC_CONST(0.999756), FRAC_CONST(0.99961), FRAC_CONST(0.999541), FRAC_CONST(0.999519), FRAC_CONST(0.999514), FRAC_CONST(0.999512), FRAC_CONST(0.999512) },
- { FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(0.999999), FRAC_CONST(0.999996), FRAC_CONST(0.999986), FRAC_CONST(0.999951), FRAC_CONST(0.999878), FRAC_CONST(0.999805), FRAC_CONST(0.99977), FRAC_CONST(0.99976), FRAC_CONST(0.999757), FRAC_CONST(0.999756), FRAC_CONST(0.999756) },
- { FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(0.999998), FRAC_CONST(0.999993), FRAC_CONST(0.999976), FRAC_CONST(0.999939), FRAC_CONST(0.999902), FRAC_CONST(0.999885), FRAC_CONST(0.99988), FRAC_CONST(0.999878), FRAC_CONST(0.999878), FRAC_CONST(0.999878) },
- { FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(0.999999), FRAC_CONST(0.999996), FRAC_CONST(0.999988), FRAC_CONST(0.999969), FRAC_CONST(0.999951), FRAC_CONST(0.999943), FRAC_CONST(0.99994), FRAC_CONST(0.999939), FRAC_CONST(0.999939), FRAC_CONST(0.999939) },
- { FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(0.999998), FRAC_CONST(0.999994), FRAC_CONST(0.999985), FRAC_CONST(0.999976), FRAC_CONST(0.999971), FRAC_CONST(0.99997), FRAC_CONST(0.99997), FRAC_CONST(0.99997), FRAC_CONST(0.999969) },
- { FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(0.999999), FRAC_CONST(0.999997), FRAC_CONST(0.999992), FRAC_CONST(0.999988), FRAC_CONST(0.999986), FRAC_CONST(0.999985), FRAC_CONST(0.999985), FRAC_CONST(0.999985), FRAC_CONST(0.999985) },
- { FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(0.999998), FRAC_CONST(0.999996), FRAC_CONST(0.999994), FRAC_CONST(0.999993), FRAC_CONST(0.999992), FRAC_CONST(0.999992), FRAC_CONST(0.999992), FRAC_CONST(0.999992) },
- { FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(0.999999), FRAC_CONST(0.999998), FRAC_CONST(0.999997), FRAC_CONST(0.999996), FRAC_CONST(0.999996), FRAC_CONST(0.999996), FRAC_CONST(0.999996), FRAC_CONST(0.999996) },
- { FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(0.999999), FRAC_CONST(0.999998), FRAC_CONST(0.999998), FRAC_CONST(0.999998), FRAC_CONST(0.999998), FRAC_CONST(0.999998), FRAC_CONST(0.999998) },
- { FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(0.999999), FRAC_CONST(0.999999), FRAC_CONST(0.999999), FRAC_CONST(0.999999), FRAC_CONST(0.999999), FRAC_CONST(0.999999) },
- { FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1) },
- { FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1) },
- { FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1) }
-};
-
-static const real_t Q_div_tab_right[31][13] = {
- { FRAC_CONST(0.00775382), FRAC_CONST(0.00775945), FRAC_CONST(0.00778198), FRAC_CONST(0.00787211), FRAC_CONST(0.00823245), FRAC_CONST(0.00967118), FRAC_CONST(0.0153846), FRAC_CONST(0.037594), FRAC_CONST(0.117241), FRAC_CONST(0.336788), FRAC_CONST(0.667532), FRAC_CONST(0.888985), FRAC_CONST(0.969704) },
- { FRAC_CONST(0.0153883), FRAC_CONST(0.0153994), FRAC_CONST(0.0154438), FRAC_CONST(0.0156212), FRAC_CONST(0.0163305), FRAC_CONST(0.0191571), FRAC_CONST(0.030303), FRAC_CONST(0.0724638), FRAC_CONST(0.209877), FRAC_CONST(0.503876), FRAC_CONST(0.800623), FRAC_CONST(0.94123), FRAC_CONST(0.984619) },
- { FRAC_CONST(0.0303102), FRAC_CONST(0.0303317), FRAC_CONST(0.0304178), FRAC_CONST(0.0307619), FRAC_CONST(0.0321361), FRAC_CONST(0.037594), FRAC_CONST(0.0588235), FRAC_CONST(0.135135), FRAC_CONST(0.346939), FRAC_CONST(0.670103), FRAC_CONST(0.889273), FRAC_CONST(0.969726), FRAC_CONST(0.99225) },
- { FRAC_CONST(0.058837), FRAC_CONST(0.0588776), FRAC_CONST(0.0590397), FRAC_CONST(0.0596878), FRAC_CONST(0.0622711), FRAC_CONST(0.0724638), FRAC_CONST(0.111111), FRAC_CONST(0.238095), FRAC_CONST(0.515152), FRAC_CONST(0.802469), FRAC_CONST(0.941392), FRAC_CONST(0.98463), FRAC_CONST(0.99611) },
- { FRAC_CONST(0.111135), FRAC_CONST(0.111208), FRAC_CONST(0.111497), FRAC_CONST(0.112652), FRAC_CONST(0.117241), FRAC_CONST(0.135135), FRAC_CONST(0.2), FRAC_CONST(0.384615), FRAC_CONST(0.68), FRAC_CONST(0.890411), FRAC_CONST(0.969811), FRAC_CONST(0.992256), FRAC_CONST(0.998051) },
- { FRAC_CONST(0.200039), FRAC_CONST(0.200156), FRAC_CONST(0.200625), FRAC_CONST(0.202492), FRAC_CONST(0.209877), FRAC_CONST(0.238095), FRAC_CONST(0.333333), FRAC_CONST(0.555556), FRAC_CONST(0.809524), FRAC_CONST(0.942029), FRAC_CONST(0.984674), FRAC_CONST(0.996113), FRAC_CONST(0.999025) },
- { FRAC_CONST(0.333388), FRAC_CONST(0.33355), FRAC_CONST(0.3342), FRAC_CONST(0.336788), FRAC_CONST(0.346939), FRAC_CONST(0.384615), FRAC_CONST(0.5), FRAC_CONST(0.714286), FRAC_CONST(0.894737), FRAC_CONST(0.970149), FRAC_CONST(0.992278), FRAC_CONST(0.998053), FRAC_CONST(0.999512) },
- { FRAC_CONST(0.500061), FRAC_CONST(0.500244), FRAC_CONST(0.500975), FRAC_CONST(0.503876), FRAC_CONST(0.515152), FRAC_CONST(0.555556), FRAC_CONST(0.666667), FRAC_CONST(0.833333), FRAC_CONST(0.944444), FRAC_CONST(0.984848), FRAC_CONST(0.996124), FRAC_CONST(0.999025), FRAC_CONST(0.999756) },
- { FRAC_CONST(0.666721), FRAC_CONST(0.666884), FRAC_CONST(0.667532), FRAC_CONST(0.670103), FRAC_CONST(0.68), FRAC_CONST(0.714286), FRAC_CONST(0.8), FRAC_CONST(0.909091), FRAC_CONST(0.971429), FRAC_CONST(0.992366), FRAC_CONST(0.998058), FRAC_CONST(0.999512), FRAC_CONST(0.999878) },
- { FRAC_CONST(0.800039), FRAC_CONST(0.800156), FRAC_CONST(0.800623), FRAC_CONST(0.802469), FRAC_CONST(0.809524), FRAC_CONST(0.833333), FRAC_CONST(0.888889), FRAC_CONST(0.952381), FRAC_CONST(0.985507), FRAC_CONST(0.996169), FRAC_CONST(0.999028), FRAC_CONST(0.999756), FRAC_CONST(0.999939) },
- { FRAC_CONST(0.888913), FRAC_CONST(0.888985), FRAC_CONST(0.889273), FRAC_CONST(0.890411), FRAC_CONST(0.894737), FRAC_CONST(0.909091), FRAC_CONST(0.941176), FRAC_CONST(0.97561), FRAC_CONST(0.992701), FRAC_CONST(0.998081), FRAC_CONST(0.999514), FRAC_CONST(0.999878), FRAC_CONST(0.999969) },
- { FRAC_CONST(0.94119), FRAC_CONST(0.94123), FRAC_CONST(0.941392), FRAC_CONST(0.942029), FRAC_CONST(0.944444), FRAC_CONST(0.952381), FRAC_CONST(0.969697), FRAC_CONST(0.987654), FRAC_CONST(0.996337), FRAC_CONST(0.999039), FRAC_CONST(0.999757), FRAC_CONST(0.999939), FRAC_CONST(0.999985) },
- { FRAC_CONST(0.969704), FRAC_CONST(0.969726), FRAC_CONST(0.969811), FRAC_CONST(0.970149), FRAC_CONST(0.971429), FRAC_CONST(0.97561), FRAC_CONST(0.984615), FRAC_CONST(0.993789), FRAC_CONST(0.998165), FRAC_CONST(0.999519), FRAC_CONST(0.999878), FRAC_CONST(0.99997), FRAC_CONST(0.999992) },
- { FRAC_CONST(0.984619), FRAC_CONST(0.98463), FRAC_CONST(0.984674), FRAC_CONST(0.984848), FRAC_CONST(0.985507), FRAC_CONST(0.987654), FRAC_CONST(0.992248), FRAC_CONST(0.996885), FRAC_CONST(0.999082), FRAC_CONST(0.99976), FRAC_CONST(0.999939), FRAC_CONST(0.999985), FRAC_CONST(0.999996) },
- { FRAC_CONST(0.99225), FRAC_CONST(0.992256), FRAC_CONST(0.992278), FRAC_CONST(0.992366), FRAC_CONST(0.992701), FRAC_CONST(0.993789), FRAC_CONST(0.996109), FRAC_CONST(0.99844), FRAC_CONST(0.999541), FRAC_CONST(0.99988), FRAC_CONST(0.99997), FRAC_CONST(0.999992), FRAC_CONST(0.999998) },
- { FRAC_CONST(0.99611), FRAC_CONST(0.996113), FRAC_CONST(0.996124), FRAC_CONST(0.996169), FRAC_CONST(0.996337), FRAC_CONST(0.996885), FRAC_CONST(0.998051), FRAC_CONST(0.999219), FRAC_CONST(0.99977), FRAC_CONST(0.99994), FRAC_CONST(0.999985), FRAC_CONST(0.999996), FRAC_CONST(0.999999) },
- { FRAC_CONST(0.998051), FRAC_CONST(0.998053), FRAC_CONST(0.998058), FRAC_CONST(0.998081), FRAC_CONST(0.998165), FRAC_CONST(0.99844), FRAC_CONST(0.999024), FRAC_CONST(0.99961), FRAC_CONST(0.999885), FRAC_CONST(0.99997), FRAC_CONST(0.999992), FRAC_CONST(0.999998), FRAC_CONST(1) },
- { FRAC_CONST(0.999025), FRAC_CONST(0.999025), FRAC_CONST(0.999028), FRAC_CONST(0.999039), FRAC_CONST(0.999082), FRAC_CONST(0.999219), FRAC_CONST(0.999512), FRAC_CONST(0.999805), FRAC_CONST(0.999943), FRAC_CONST(0.999985), FRAC_CONST(0.999996), FRAC_CONST(0.999999), FRAC_CONST(1) },
- { FRAC_CONST(0.999512), FRAC_CONST(0.999512), FRAC_CONST(0.999514), FRAC_CONST(0.999519), FRAC_CONST(0.999541), FRAC_CONST(0.99961), FRAC_CONST(0.999756), FRAC_CONST(0.999902), FRAC_CONST(0.999971), FRAC_CONST(0.999992), FRAC_CONST(0.999998), FRAC_CONST(1), FRAC_CONST(1) },
- { FRAC_CONST(0.999756), FRAC_CONST(0.999756), FRAC_CONST(0.999757), FRAC_CONST(0.99976), FRAC_CONST(0.99977), FRAC_CONST(0.999805), FRAC_CONST(0.999878), FRAC_CONST(0.999951), FRAC_CONST(0.999986), FRAC_CONST(0.999996), FRAC_CONST(0.999999), FRAC_CONST(1), FRAC_CONST(1) },
- { FRAC_CONST(0.999878), FRAC_CONST(0.999878), FRAC_CONST(0.999878), FRAC_CONST(0.99988), FRAC_CONST(0.999885), FRAC_CONST(0.999902), FRAC_CONST(0.999939), FRAC_CONST(0.999976), FRAC_CONST(0.999993), FRAC_CONST(0.999998), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1) },
- { FRAC_CONST(0.999939), FRAC_CONST(0.999939), FRAC_CONST(0.999939), FRAC_CONST(0.99994), FRAC_CONST(0.999943), FRAC_CONST(0.999951), FRAC_CONST(0.999969), FRAC_CONST(0.999988), FRAC_CONST(0.999996), FRAC_CONST(0.999999), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1) },
- { FRAC_CONST(0.999969), FRAC_CONST(0.99997), FRAC_CONST(0.99997), FRAC_CONST(0.99997), FRAC_CONST(0.999971), FRAC_CONST(0.999976), FRAC_CONST(0.999985), FRAC_CONST(0.999994), FRAC_CONST(0.999998), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1) },
- { FRAC_CONST(0.999985), FRAC_CONST(0.999985), FRAC_CONST(0.999985), FRAC_CONST(0.999985), FRAC_CONST(0.999986), FRAC_CONST(0.999988), FRAC_CONST(0.999992), FRAC_CONST(0.999997), FRAC_CONST(0.999999), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1) },
- { FRAC_CONST(0.999992), FRAC_CONST(0.999992), FRAC_CONST(0.999992), FRAC_CONST(0.999992), FRAC_CONST(0.999993), FRAC_CONST(0.999994), FRAC_CONST(0.999996), FRAC_CONST(0.999998), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1) },
- { FRAC_CONST(0.999996), FRAC_CONST(0.999996), FRAC_CONST(0.999996), FRAC_CONST(0.999996), FRAC_CONST(0.999996), FRAC_CONST(0.999997), FRAC_CONST(0.999998), FRAC_CONST(0.999999), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1) },
- { FRAC_CONST(0.999998), FRAC_CONST(0.999998), FRAC_CONST(0.999998), FRAC_CONST(0.999998), FRAC_CONST(0.999998), FRAC_CONST(0.999998), FRAC_CONST(0.999999), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1) },
- { FRAC_CONST(0.999999), FRAC_CONST(0.999999), FRAC_CONST(0.999999), FRAC_CONST(0.999999), FRAC_CONST(0.999999), FRAC_CONST(0.999999), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1) },
- { FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1) },
- { FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1) },
- { FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1) }
-};
-
-/* calculates 1/(1+Q) */
-/* [0..1] */
-real_t calc_Q_div(sbr_info *sbr, uint8_t ch, uint8_t m, uint8_t l)
-{
- if (sbr->bs_coupling)
- {
- /* left channel */
- if ((sbr->Q[0][m][l] < 0 || sbr->Q[0][m][l] > 30) ||
- (sbr->Q[1][m][l] < 0 || sbr->Q[1][m][l] > 24 /* 2*panOffset(1) */))
- {
- return 0;
- } else {
- /* the pan parameter is always even */
- if (ch == 0)
- {
- return Q_div_tab_left[sbr->Q[0][m][l]][sbr->Q[1][m][l] >> 1];
- } else {
- return Q_div_tab_right[sbr->Q[0][m][l]][sbr->Q[1][m][l] >> 1];
- }
- }
- } else {
- /* no coupling */
- if (sbr->Q[ch][m][l] < 0 || sbr->Q[ch][m][l] > 30)
- {
- return 0;
- } else {
- return Q_div_tab[sbr->Q[ch][m][l]];
- }
- }
-}
-
-/* table for Q_div2 values when no coupling */
-static const real_t Q_div2_tab[31] = {
- FRAC_CONST(0.984615), FRAC_CONST(0.969697),
- FRAC_CONST(0.941176), FRAC_CONST(0.888889),
- FRAC_CONST(0.8), FRAC_CONST(0.666667),
- FRAC_CONST(0.5), FRAC_CONST(0.333333),
- FRAC_CONST(0.2), FRAC_CONST(0.111111),
- FRAC_CONST(0.0588235), FRAC_CONST(0.030303),
- FRAC_CONST(0.0153846), FRAC_CONST(0.00775194),
- FRAC_CONST(0.00389105), FRAC_CONST(0.00194932),
- FRAC_CONST(0.00097561), FRAC_CONST(0.000488043),
- FRAC_CONST(0.000244081), FRAC_CONST(0.000122055),
- FRAC_CONST(6.10314E-005), FRAC_CONST(3.05166E-005),
- FRAC_CONST(1.52586E-005), FRAC_CONST(7.62934E-006),
- FRAC_CONST(3.81468E-006), FRAC_CONST(1.90734E-006),
- FRAC_CONST(9.53673E-007), FRAC_CONST(4.76837E-007),
- FRAC_CONST(2.38419E-007), FRAC_CONST(1.19209E-007),
- FRAC_CONST(5.96046E-008)
-};
-
-static const real_t Q_div2_tab_left[31][13] = {
- { FRAC_CONST(0.0302959), FRAC_CONST(0.111015), FRAC_CONST(0.332468), FRAC_CONST(0.663212), FRAC_CONST(0.882759), FRAC_CONST(0.962406), FRAC_CONST(0.984615), FRAC_CONST(0.990329), FRAC_CONST(0.991768), FRAC_CONST(0.992128), FRAC_CONST(0.992218), FRAC_CONST(0.992241), FRAC_CONST(0.992246) },
- { FRAC_CONST(0.0153809), FRAC_CONST(0.0587695), FRAC_CONST(0.199377), FRAC_CONST(0.496124), FRAC_CONST(0.790123), FRAC_CONST(0.927536), FRAC_CONST(0.969697), FRAC_CONST(0.980843), FRAC_CONST(0.98367), FRAC_CONST(0.984379), FRAC_CONST(0.984556), FRAC_CONST(0.984601), FRAC_CONST(0.984612) },
- { FRAC_CONST(0.00775006), FRAC_CONST(0.0302744), FRAC_CONST(0.110727), FRAC_CONST(0.329897), FRAC_CONST(0.653061), FRAC_CONST(0.864865), FRAC_CONST(0.941176), FRAC_CONST(0.962406), FRAC_CONST(0.967864), FRAC_CONST(0.969238), FRAC_CONST(0.969582), FRAC_CONST(0.969668), FRAC_CONST(0.96969) },
- { FRAC_CONST(0.0038901), FRAC_CONST(0.0153698), FRAC_CONST(0.0586081), FRAC_CONST(0.197531), FRAC_CONST(0.484848), FRAC_CONST(0.761905), FRAC_CONST(0.888889), FRAC_CONST(0.927536), FRAC_CONST(0.937729), FRAC_CONST(0.940312), FRAC_CONST(0.94096), FRAC_CONST(0.941122), FRAC_CONST(0.941163) },
- { FRAC_CONST(0.00194884), FRAC_CONST(0.00774443), FRAC_CONST(0.0301887), FRAC_CONST(0.109589), FRAC_CONST(0.32), FRAC_CONST(0.615385), FRAC_CONST(0.8), FRAC_CONST(0.864865), FRAC_CONST(0.882759), FRAC_CONST(0.887348), FRAC_CONST(0.888503), FRAC_CONST(0.888792), FRAC_CONST(0.888865) },
- { FRAC_CONST(0.000975372), FRAC_CONST(0.00388727), FRAC_CONST(0.0153257), FRAC_CONST(0.057971), FRAC_CONST(0.190476), FRAC_CONST(0.444444), FRAC_CONST(0.666667), FRAC_CONST(0.761905), FRAC_CONST(0.790123), FRAC_CONST(0.797508), FRAC_CONST(0.799375), FRAC_CONST(0.799844), FRAC_CONST(0.799961) },
- { FRAC_CONST(0.000487924), FRAC_CONST(0.00194742), FRAC_CONST(0.00772201), FRAC_CONST(0.0298507), FRAC_CONST(0.105263), FRAC_CONST(0.285714), FRAC_CONST(0.5), FRAC_CONST(0.615385), FRAC_CONST(0.653061), FRAC_CONST(0.663212), FRAC_CONST(0.6658), FRAC_CONST(0.66645), FRAC_CONST(0.666612) },
- { FRAC_CONST(0.000244021), FRAC_CONST(0.000974659), FRAC_CONST(0.00387597), FRAC_CONST(0.0151515), FRAC_CONST(0.0555556), FRAC_CONST(0.166667), FRAC_CONST(0.333333), FRAC_CONST(0.444444), FRAC_CONST(0.484848), FRAC_CONST(0.496124), FRAC_CONST(0.499025), FRAC_CONST(0.499756), FRAC_CONST(0.499939) },
- { FRAC_CONST(0.000122026), FRAC_CONST(0.000487567), FRAC_CONST(0.00194175), FRAC_CONST(0.00763359), FRAC_CONST(0.0285714), FRAC_CONST(0.0909091), FRAC_CONST(0.2), FRAC_CONST(0.285714), FRAC_CONST(0.32), FRAC_CONST(0.329897), FRAC_CONST(0.332468), FRAC_CONST(0.333116), FRAC_CONST(0.333279) },
- { FRAC_CONST(6.10165E-005), FRAC_CONST(0.000243843), FRAC_CONST(0.000971817), FRAC_CONST(0.00383142), FRAC_CONST(0.0144928), FRAC_CONST(0.047619), FRAC_CONST(0.111111), FRAC_CONST(0.166667), FRAC_CONST(0.190476), FRAC_CONST(0.197531), FRAC_CONST(0.199377), FRAC_CONST(0.199844), FRAC_CONST(0.199961) },
- { FRAC_CONST(3.05092E-005), FRAC_CONST(0.000121936), FRAC_CONST(0.000486145), FRAC_CONST(0.00191939), FRAC_CONST(0.00729927), FRAC_CONST(0.0243902), FRAC_CONST(0.0588235), FRAC_CONST(0.0909091), FRAC_CONST(0.105263), FRAC_CONST(0.109589), FRAC_CONST(0.110727), FRAC_CONST(0.111015), FRAC_CONST(0.111087) },
- { FRAC_CONST(1.52548E-005), FRAC_CONST(6.09719E-005), FRAC_CONST(0.000243132), FRAC_CONST(0.000960615), FRAC_CONST(0.003663), FRAC_CONST(0.0123457), FRAC_CONST(0.030303), FRAC_CONST(0.047619), FRAC_CONST(0.0555556), FRAC_CONST(0.057971), FRAC_CONST(0.0586081), FRAC_CONST(0.0587695), FRAC_CONST(0.05881) },
- { FRAC_CONST(7.62747E-006), FRAC_CONST(3.04869E-005), FRAC_CONST(0.000121581), FRAC_CONST(0.000480538), FRAC_CONST(0.00183486), FRAC_CONST(0.00621118), FRAC_CONST(0.0153846), FRAC_CONST(0.0243902), FRAC_CONST(0.0285714), FRAC_CONST(0.0298507), FRAC_CONST(0.0301887), FRAC_CONST(0.0302744), FRAC_CONST(0.0302959) },
- { FRAC_CONST(3.81375E-006), FRAC_CONST(1.52437E-005), FRAC_CONST(6.0794E-005), FRAC_CONST(0.000240327), FRAC_CONST(0.000918274), FRAC_CONST(0.00311526), FRAC_CONST(0.00775194), FRAC_CONST(0.0123457), FRAC_CONST(0.0144928), FRAC_CONST(0.0151515), FRAC_CONST(0.0153257), FRAC_CONST(0.0153698), FRAC_CONST(0.0153809) },
- { FRAC_CONST(1.90688E-006), FRAC_CONST(7.62189E-006), FRAC_CONST(3.03979E-005), FRAC_CONST(0.000120178), FRAC_CONST(0.000459348), FRAC_CONST(0.00156006), FRAC_CONST(0.00389105), FRAC_CONST(0.00621118), FRAC_CONST(0.00729927), FRAC_CONST(0.00763359), FRAC_CONST(0.00772201), FRAC_CONST(0.00774443), FRAC_CONST(0.00775006) },
- { FRAC_CONST(9.53441E-007), FRAC_CONST(3.81096E-006), FRAC_CONST(1.51992E-005), FRAC_CONST(6.00925E-005), FRAC_CONST(0.000229727), FRAC_CONST(0.00078064), FRAC_CONST(0.00194932), FRAC_CONST(0.00311526), FRAC_CONST(0.003663), FRAC_CONST(0.00383142), FRAC_CONST(0.00387597), FRAC_CONST(0.00388727), FRAC_CONST(0.0038901) },
- { FRAC_CONST(4.76721E-007), FRAC_CONST(1.90548E-006), FRAC_CONST(7.59965E-006), FRAC_CONST(3.00472E-005), FRAC_CONST(0.000114877), FRAC_CONST(0.000390472), FRAC_CONST(0.00097561), FRAC_CONST(0.00156006), FRAC_CONST(0.00183486), FRAC_CONST(0.00191939), FRAC_CONST(0.00194175), FRAC_CONST(0.00194742), FRAC_CONST(0.00194884) },
- { FRAC_CONST(2.3836E-007), FRAC_CONST(9.52743E-007), FRAC_CONST(3.79984E-006), FRAC_CONST(1.50238E-005), FRAC_CONST(5.74416E-005), FRAC_CONST(0.000195274), FRAC_CONST(0.000488043), FRAC_CONST(0.00078064), FRAC_CONST(0.000918274), FRAC_CONST(0.000960615), FRAC_CONST(0.000971817), FRAC_CONST(0.000974659), FRAC_CONST(0.000975372) },
- { FRAC_CONST(1.1918E-007), FRAC_CONST(4.76372E-007), FRAC_CONST(1.89992E-006), FRAC_CONST(7.51196E-006), FRAC_CONST(2.87216E-005), FRAC_CONST(9.76467E-005), FRAC_CONST(0.000244081), FRAC_CONST(0.000390472), FRAC_CONST(0.000459348), FRAC_CONST(0.000480538), FRAC_CONST(0.000486145), FRAC_CONST(0.000487567), FRAC_CONST(0.000487924) },
- { FRAC_CONST(5.95901E-008), FRAC_CONST(2.38186E-007), FRAC_CONST(9.49963E-007), FRAC_CONST(3.756E-006), FRAC_CONST(1.4361E-005), FRAC_CONST(4.88257E-005), FRAC_CONST(0.000122055), FRAC_CONST(0.000195274), FRAC_CONST(0.000229727), FRAC_CONST(0.000240327), FRAC_CONST(0.000243132), FRAC_CONST(0.000243843), FRAC_CONST(0.000244021) },
- { FRAC_CONST(2.9795E-008), FRAC_CONST(1.19093E-007), FRAC_CONST(4.74982E-007), FRAC_CONST(1.878E-006), FRAC_CONST(7.18056E-006), FRAC_CONST(2.44135E-005), FRAC_CONST(6.10314E-005), FRAC_CONST(9.76467E-005), FRAC_CONST(0.000114877), FRAC_CONST(0.000120178), FRAC_CONST(0.000121581), FRAC_CONST(0.000121936), FRAC_CONST(0.000122026) },
- { FRAC_CONST(1.48975E-008), FRAC_CONST(5.95465E-008), FRAC_CONST(2.37491E-007), FRAC_CONST(9.39002E-007), FRAC_CONST(3.59029E-006), FRAC_CONST(1.22069E-005), FRAC_CONST(3.05166E-005), FRAC_CONST(4.88257E-005), FRAC_CONST(5.74416E-005), FRAC_CONST(6.00925E-005), FRAC_CONST(6.0794E-005), FRAC_CONST(6.09719E-005), FRAC_CONST(6.10165E-005) },
- { FRAC_CONST(7.44876E-009), FRAC_CONST(2.97732E-008), FRAC_CONST(1.18745E-007), FRAC_CONST(4.69501E-007), FRAC_CONST(1.79515E-006), FRAC_CONST(6.10348E-006), FRAC_CONST(1.52586E-005), FRAC_CONST(2.44135E-005), FRAC_CONST(2.87216E-005), FRAC_CONST(3.00472E-005), FRAC_CONST(3.03979E-005), FRAC_CONST(3.04869E-005), FRAC_CONST(3.05092E-005) },
- { FRAC_CONST(3.72438E-009), FRAC_CONST(1.48866E-008), FRAC_CONST(5.93727E-008), FRAC_CONST(2.34751E-007), FRAC_CONST(8.97575E-007), FRAC_CONST(3.05175E-006), FRAC_CONST(7.62934E-006), FRAC_CONST(1.22069E-005), FRAC_CONST(1.4361E-005), FRAC_CONST(1.50238E-005), FRAC_CONST(1.51992E-005), FRAC_CONST(1.52437E-005), FRAC_CONST(1.52548E-005) },
- { FRAC_CONST(1.86219E-009), FRAC_CONST(7.44331E-009), FRAC_CONST(2.96864E-008), FRAC_CONST(1.17375E-007), FRAC_CONST(4.48788E-007), FRAC_CONST(1.52588E-006), FRAC_CONST(3.81468E-006), FRAC_CONST(6.10348E-006), FRAC_CONST(7.18056E-006), FRAC_CONST(7.51196E-006), FRAC_CONST(7.59965E-006), FRAC_CONST(7.62189E-006), FRAC_CONST(7.62747E-006) },
- { FRAC_CONST(9.31095E-010), FRAC_CONST(3.72166E-009), FRAC_CONST(1.48432E-008), FRAC_CONST(5.86876E-008), FRAC_CONST(2.24394E-007), FRAC_CONST(7.62939E-007), FRAC_CONST(1.90734E-006), FRAC_CONST(3.05175E-006), FRAC_CONST(3.59029E-006), FRAC_CONST(3.756E-006), FRAC_CONST(3.79984E-006), FRAC_CONST(3.81096E-006), FRAC_CONST(3.81375E-006) },
- { FRAC_CONST(4.65548E-010), FRAC_CONST(1.86083E-009), FRAC_CONST(7.42159E-009), FRAC_CONST(2.93438E-008), FRAC_CONST(1.12197E-007), FRAC_CONST(3.8147E-007), FRAC_CONST(9.53673E-007), FRAC_CONST(1.52588E-006), FRAC_CONST(1.79515E-006), FRAC_CONST(1.878E-006), FRAC_CONST(1.89992E-006), FRAC_CONST(1.90548E-006), FRAC_CONST(1.90688E-006) },
- { FRAC_CONST(2.32774E-010), FRAC_CONST(9.30414E-010), FRAC_CONST(3.71079E-009), FRAC_CONST(1.46719E-008), FRAC_CONST(5.60985E-008), FRAC_CONST(1.90735E-007), FRAC_CONST(4.76837E-007), FRAC_CONST(7.62939E-007), FRAC_CONST(8.97575E-007), FRAC_CONST(9.39002E-007), FRAC_CONST(9.49963E-007), FRAC_CONST(9.52743E-007), FRAC_CONST(9.53441E-007) },
- { FRAC_CONST(1.16387E-010), FRAC_CONST(4.65207E-010), FRAC_CONST(1.8554E-009), FRAC_CONST(7.33596E-009), FRAC_CONST(2.80492E-008), FRAC_CONST(9.53674E-008), FRAC_CONST(2.38419E-007), FRAC_CONST(3.8147E-007), FRAC_CONST(4.48788E-007), FRAC_CONST(4.69501E-007), FRAC_CONST(4.74982E-007), FRAC_CONST(4.76372E-007), FRAC_CONST(4.76721E-007) },
- { FRAC_CONST(5.81935E-011), FRAC_CONST(2.32603E-010), FRAC_CONST(9.27699E-010), FRAC_CONST(3.66798E-009), FRAC_CONST(1.40246E-008), FRAC_CONST(4.76837E-008), FRAC_CONST(1.19209E-007), FRAC_CONST(1.90735E-007), FRAC_CONST(2.24394E-007), FRAC_CONST(2.34751E-007), FRAC_CONST(2.37491E-007), FRAC_CONST(2.38186E-007), FRAC_CONST(2.3836E-007) },
- { FRAC_CONST(2.90967E-011), FRAC_CONST(1.16302E-010), FRAC_CONST(4.63849E-010), FRAC_CONST(1.83399E-009), FRAC_CONST(7.01231E-009), FRAC_CONST(2.38419E-008), FRAC_CONST(5.96046E-008), FRAC_CONST(9.53674E-008), FRAC_CONST(1.12197E-007), FRAC_CONST(1.17375E-007), FRAC_CONST(1.18745E-007), FRAC_CONST(1.19093E-007), FRAC_CONST(1.1918E-007) }
-};
-
-static const real_t Q_div2_tab_right[31][13] = {
- { FRAC_CONST(0.992246), FRAC_CONST(0.992241), FRAC_CONST(0.992218), FRAC_CONST(0.992128), FRAC_CONST(0.991768), FRAC_CONST(0.990329), FRAC_CONST(0.984615), FRAC_CONST(0.962406), FRAC_CONST(0.882759), FRAC_CONST(0.663212), FRAC_CONST(0.332468), FRAC_CONST(0.111015), FRAC_CONST(0.0302959) },
- { FRAC_CONST(0.984612), FRAC_CONST(0.984601), FRAC_CONST(0.984556), FRAC_CONST(0.984379), FRAC_CONST(0.98367), FRAC_CONST(0.980843), FRAC_CONST(0.969697), FRAC_CONST(0.927536), FRAC_CONST(0.790123), FRAC_CONST(0.496124), FRAC_CONST(0.199377), FRAC_CONST(0.0587695), FRAC_CONST(0.0153809) },
- { FRAC_CONST(0.96969), FRAC_CONST(0.969668), FRAC_CONST(0.969582), FRAC_CONST(0.969238), FRAC_CONST(0.967864), FRAC_CONST(0.962406), FRAC_CONST(0.941176), FRAC_CONST(0.864865), FRAC_CONST(0.653061), FRAC_CONST(0.329897), FRAC_CONST(0.110727), FRAC_CONST(0.0302744), FRAC_CONST(0.00775006) },
- { FRAC_CONST(0.941163), FRAC_CONST(0.941122), FRAC_CONST(0.94096), FRAC_CONST(0.940312), FRAC_CONST(0.937729), FRAC_CONST(0.927536), FRAC_CONST(0.888889), FRAC_CONST(0.761905), FRAC_CONST(0.484848), FRAC_CONST(0.197531), FRAC_CONST(0.0586081), FRAC_CONST(0.0153698), FRAC_CONST(0.0038901) },
- { FRAC_CONST(0.888865), FRAC_CONST(0.888792), FRAC_CONST(0.888503), FRAC_CONST(0.887348), FRAC_CONST(0.882759), FRAC_CONST(0.864865), FRAC_CONST(0.8), FRAC_CONST(0.615385), FRAC_CONST(0.32), FRAC_CONST(0.109589), FRAC_CONST(0.0301887), FRAC_CONST(0.00774443), FRAC_CONST(0.00194884) },
- { FRAC_CONST(0.799961), FRAC_CONST(0.799844), FRAC_CONST(0.799375), FRAC_CONST(0.797508), FRAC_CONST(0.790123), FRAC_CONST(0.761905), FRAC_CONST(0.666667), FRAC_CONST(0.444444), FRAC_CONST(0.190476), FRAC_CONST(0.057971), FRAC_CONST(0.0153257), FRAC_CONST(0.00388727), FRAC_CONST(0.000975372) },
- { FRAC_CONST(0.666612), FRAC_CONST(0.66645), FRAC_CONST(0.6658), FRAC_CONST(0.663212), FRAC_CONST(0.653061), FRAC_CONST(0.615385), FRAC_CONST(0.5), FRAC_CONST(0.285714), FRAC_CONST(0.105263), FRAC_CONST(0.0298507), FRAC_CONST(0.00772201), FRAC_CONST(0.00194742), FRAC_CONST(0.000487924) },
- { FRAC_CONST(0.499939), FRAC_CONST(0.499756), FRAC_CONST(0.499025), FRAC_CONST(0.496124), FRAC_CONST(0.484848), FRAC_CONST(0.444444), FRAC_CONST(0.333333), FRAC_CONST(0.166667), FRAC_CONST(0.0555556), FRAC_CONST(0.0151515), FRAC_CONST(0.00387597), FRAC_CONST(0.000974659), FRAC_CONST(0.000244021) },
- { FRAC_CONST(0.333279), FRAC_CONST(0.333116), FRAC_CONST(0.332468), FRAC_CONST(0.329897), FRAC_CONST(0.32), FRAC_CONST(0.285714), FRAC_CONST(0.2), FRAC_CONST(0.0909091), FRAC_CONST(0.0285714), FRAC_CONST(0.00763359), FRAC_CONST(0.00194175), FRAC_CONST(0.000487567), FRAC_CONST(0.000122026) },
- { FRAC_CONST(0.199961), FRAC_CONST(0.199844), FRAC_CONST(0.199377), FRAC_CONST(0.197531), FRAC_CONST(0.190476), FRAC_CONST(0.166667), FRAC_CONST(0.111111), FRAC_CONST(0.047619), FRAC_CONST(0.0144928), FRAC_CONST(0.00383142), FRAC_CONST(0.000971817), FRAC_CONST(0.000243843), FRAC_CONST(6.10165E-005) },
- { FRAC_CONST(0.111087), FRAC_CONST(0.111015), FRAC_CONST(0.110727), FRAC_CONST(0.109589), FRAC_CONST(0.105263), FRAC_CONST(0.0909091), FRAC_CONST(0.0588235), FRAC_CONST(0.0243902), FRAC_CONST(0.00729927), FRAC_CONST(0.00191939), FRAC_CONST(0.000486145), FRAC_CONST(0.000121936), FRAC_CONST(3.05092E-005) },
- { FRAC_CONST(0.05881), FRAC_CONST(0.0587695), FRAC_CONST(0.0586081), FRAC_CONST(0.057971), FRAC_CONST(0.0555556), FRAC_CONST(0.047619), FRAC_CONST(0.030303), FRAC_CONST(0.0123457), FRAC_CONST(0.003663), FRAC_CONST(0.000960615), FRAC_CONST(0.000243132), FRAC_CONST(6.09719E-005), FRAC_CONST(1.52548E-005) },
- { FRAC_CONST(0.0302959), FRAC_CONST(0.0302744), FRAC_CONST(0.0301887), FRAC_CONST(0.0298507), FRAC_CONST(0.0285714), FRAC_CONST(0.0243902), FRAC_CONST(0.0153846), FRAC_CONST(0.00621118), FRAC_CONST(0.00183486), FRAC_CONST(0.000480538), FRAC_CONST(0.000121581), FRAC_CONST(3.04869E-005), FRAC_CONST(7.62747E-006) },
- { FRAC_CONST(0.0153809), FRAC_CONST(0.0153698), FRAC_CONST(0.0153257), FRAC_CONST(0.0151515), FRAC_CONST(0.0144928), FRAC_CONST(0.0123457), FRAC_CONST(0.00775194), FRAC_CONST(0.00311526), FRAC_CONST(0.000918274), FRAC_CONST(0.000240327), FRAC_CONST(6.0794E-005), FRAC_CONST(1.52437E-005), FRAC_CONST(3.81375E-006) },
- { FRAC_CONST(0.00775006), FRAC_CONST(0.00774443), FRAC_CONST(0.00772201), FRAC_CONST(0.00763359), FRAC_CONST(0.00729927), FRAC_CONST(0.00621118), FRAC_CONST(0.00389105), FRAC_CONST(0.00156006), FRAC_CONST(0.000459348), FRAC_CONST(0.000120178), FRAC_CONST(3.03979E-005), FRAC_CONST(7.62189E-006), FRAC_CONST(1.90688E-006) },
- { FRAC_CONST(0.0038901), FRAC_CONST(0.00388727), FRAC_CONST(0.00387597), FRAC_CONST(0.00383142), FRAC_CONST(0.003663), FRAC_CONST(0.00311526), FRAC_CONST(0.00194932), FRAC_CONST(0.00078064), FRAC_CONST(0.000229727), FRAC_CONST(6.00925E-005), FRAC_CONST(1.51992E-005), FRAC_CONST(3.81096E-006), FRAC_CONST(9.53441E-007) },
- { FRAC_CONST(0.00194884), FRAC_CONST(0.00194742), FRAC_CONST(0.00194175), FRAC_CONST(0.00191939), FRAC_CONST(0.00183486), FRAC_CONST(0.00156006), FRAC_CONST(0.00097561), FRAC_CONST(0.000390472), FRAC_CONST(0.000114877), FRAC_CONST(3.00472E-005), FRAC_CONST(7.59965E-006), FRAC_CONST(1.90548E-006), FRAC_CONST(4.76721E-007) },
- { FRAC_CONST(0.000975372), FRAC_CONST(0.000974659), FRAC_CONST(0.000971817), FRAC_CONST(0.000960615), FRAC_CONST(0.000918274), FRAC_CONST(0.00078064), FRAC_CONST(0.000488043), FRAC_CONST(0.000195274), FRAC_CONST(5.74416E-005), FRAC_CONST(1.50238E-005), FRAC_CONST(3.79984E-006), FRAC_CONST(9.52743E-007), FRAC_CONST(2.3836E-007) },
- { FRAC_CONST(0.000487924), FRAC_CONST(0.000487567), FRAC_CONST(0.000486145), FRAC_CONST(0.000480538), FRAC_CONST(0.000459348), FRAC_CONST(0.000390472), FRAC_CONST(0.000244081), FRAC_CONST(9.76467E-005), FRAC_CONST(2.87216E-005), FRAC_CONST(7.51196E-006), FRAC_CONST(1.89992E-006), FRAC_CONST(4.76372E-007), FRAC_CONST(1.1918E-007) },
- { FRAC_CONST(0.000244021), FRAC_CONST(0.000243843), FRAC_CONST(0.000243132), FRAC_CONST(0.000240327), FRAC_CONST(0.000229727), FRAC_CONST(0.000195274), FRAC_CONST(0.000122055), FRAC_CONST(4.88257E-005), FRAC_CONST(1.4361E-005), FRAC_CONST(3.756E-006), FRAC_CONST(9.49963E-007), FRAC_CONST(2.38186E-007), FRAC_CONST(5.95901E-008) },
- { FRAC_CONST(0.000122026), FRAC_CONST(0.000121936), FRAC_CONST(0.000121581), FRAC_CONST(0.000120178), FRAC_CONST(0.000114877), FRAC_CONST(9.76467E-005), FRAC_CONST(6.10314E-005), FRAC_CONST(2.44135E-005), FRAC_CONST(7.18056E-006), FRAC_CONST(1.878E-006), FRAC_CONST(4.74982E-007), FRAC_CONST(1.19093E-007), FRAC_CONST(2.9795E-008) },
- { FRAC_CONST(6.10165E-005), FRAC_CONST(6.09719E-005), FRAC_CONST(6.0794E-005), FRAC_CONST(6.00925E-005), FRAC_CONST(5.74416E-005), FRAC_CONST(4.88257E-005), FRAC_CONST(3.05166E-005), FRAC_CONST(1.22069E-005), FRAC_CONST(3.59029E-006), FRAC_CONST(9.39002E-007), FRAC_CONST(2.37491E-007), FRAC_CONST(5.95465E-008), FRAC_CONST(1.48975E-008) },
- { FRAC_CONST(3.05092E-005), FRAC_CONST(3.04869E-005), FRAC_CONST(3.03979E-005), FRAC_CONST(3.00472E-005), FRAC_CONST(2.87216E-005), FRAC_CONST(2.44135E-005), FRAC_CONST(1.52586E-005), FRAC_CONST(6.10348E-006), FRAC_CONST(1.79515E-006), FRAC_CONST(4.69501E-007), FRAC_CONST(1.18745E-007), FRAC_CONST(2.97732E-008), FRAC_CONST(7.44876E-009) },
- { FRAC_CONST(1.52548E-005), FRAC_CONST(1.52437E-005), FRAC_CONST(1.51992E-005), FRAC_CONST(1.50238E-005), FRAC_CONST(1.4361E-005), FRAC_CONST(1.22069E-005), FRAC_CONST(7.62934E-006), FRAC_CONST(3.05175E-006), FRAC_CONST(8.97575E-007), FRAC_CONST(2.34751E-007), FRAC_CONST(5.93727E-008), FRAC_CONST(1.48866E-008), FRAC_CONST(3.72438E-009) },
- { FRAC_CONST(7.62747E-006), FRAC_CONST(7.62189E-006), FRAC_CONST(7.59965E-006), FRAC_CONST(7.51196E-006), FRAC_CONST(7.18056E-006), FRAC_CONST(6.10348E-006), FRAC_CONST(3.81468E-006), FRAC_CONST(1.52588E-006), FRAC_CONST(4.48788E-007), FRAC_CONST(1.17375E-007), FRAC_CONST(2.96864E-008), FRAC_CONST(7.44331E-009), FRAC_CONST(1.86219E-009) },
- { FRAC_CONST(3.81375E-006), FRAC_CONST(3.81096E-006), FRAC_CONST(3.79984E-006), FRAC_CONST(3.756E-006), FRAC_CONST(3.59029E-006), FRAC_CONST(3.05175E-006), FRAC_CONST(1.90734E-006), FRAC_CONST(7.62939E-007), FRAC_CONST(2.24394E-007), FRAC_CONST(5.86876E-008), FRAC_CONST(1.48432E-008), FRAC_CONST(3.72166E-009), FRAC_CONST(9.31095E-010) },
- { FRAC_CONST(1.90688E-006), FRAC_CONST(1.90548E-006), FRAC_CONST(1.89992E-006), FRAC_CONST(1.878E-006), FRAC_CONST(1.79515E-006), FRAC_CONST(1.52588E-006), FRAC_CONST(9.53673E-007), FRAC_CONST(3.8147E-007), FRAC_CONST(1.12197E-007), FRAC_CONST(2.93438E-008), FRAC_CONST(7.42159E-009), FRAC_CONST(1.86083E-009), FRAC_CONST(4.65548E-010) },
- { FRAC_CONST(9.53441E-007), FRAC_CONST(9.52743E-007), FRAC_CONST(9.49963E-007), FRAC_CONST(9.39002E-007), FRAC_CONST(8.97575E-007), FRAC_CONST(7.62939E-007), FRAC_CONST(4.76837E-007), FRAC_CONST(1.90735E-007), FRAC_CONST(5.60985E-008), FRAC_CONST(1.46719E-008), FRAC_CONST(3.71079E-009), FRAC_CONST(9.30414E-010), FRAC_CONST(2.32774E-010) },
- { FRAC_CONST(4.76721E-007), FRAC_CONST(4.76372E-007), FRAC_CONST(4.74982E-007), FRAC_CONST(4.69501E-007), FRAC_CONST(4.48788E-007), FRAC_CONST(3.8147E-007), FRAC_CONST(2.38419E-007), FRAC_CONST(9.53674E-008), FRAC_CONST(2.80492E-008), FRAC_CONST(7.33596E-009), FRAC_CONST(1.8554E-009), FRAC_CONST(4.65207E-010), FRAC_CONST(1.16387E-010) },
- { FRAC_CONST(2.3836E-007), FRAC_CONST(2.38186E-007), FRAC_CONST(2.37491E-007), FRAC_CONST(2.34751E-007), FRAC_CONST(2.24394E-007), FRAC_CONST(1.90735E-007), FRAC_CONST(1.19209E-007), FRAC_CONST(4.76837E-008), FRAC_CONST(1.40246E-008), FRAC_CONST(3.66798E-009), FRAC_CONST(9.27699E-010), FRAC_CONST(2.32603E-010), FRAC_CONST(5.81935E-011) },
- { FRAC_CONST(1.1918E-007), FRAC_CONST(1.19093E-007), FRAC_CONST(1.18745E-007), FRAC_CONST(1.17375E-007), FRAC_CONST(1.12197E-007), FRAC_CONST(9.53674E-008), FRAC_CONST(5.96046E-008), FRAC_CONST(2.38419E-008), FRAC_CONST(7.01231E-009), FRAC_CONST(1.83399E-009), FRAC_CONST(4.63849E-010), FRAC_CONST(1.16302E-010), FRAC_CONST(2.90967E-011) }
-};
-
-/* calculates Q/(1+Q) */
-/* [0..1] */
-real_t calc_Q_div2(sbr_info *sbr, uint8_t ch, uint8_t m, uint8_t l)
-{
- if (sbr->bs_coupling)
- {
- if ((sbr->Q[0][m][l] < 0 || sbr->Q[0][m][l] > 30) ||
- (sbr->Q[1][m][l] < 0 || sbr->Q[1][m][l] > 24 /* 2*panOffset(1) */))
- {
- return 0;
- } else {
- /* the pan parameter is always even */
- if (ch == 0)
- {
- return Q_div2_tab_left[sbr->Q[0][m][l]][sbr->Q[1][m][l] >> 1];
- } else {
- return Q_div2_tab_right[sbr->Q[0][m][l]][sbr->Q[1][m][l] >> 1];
- }
- }
- } else {
- /* no coupling */
- if (sbr->Q[ch][m][l] < 0 || sbr->Q[ch][m][l] > 30)
- {
- return 0;
- } else {
- return Q_div2_tab[sbr->Q[ch][m][l]];
- }
- }
-}
-
-static const real_t E_deq_tab[64] = {
- 64.0f, 128.0f, 256.0f, 512.0f, 1024.0f, 2048.0f, 4096.0f, 8192.0f,
- 16384.0f, 32768.0f, 65536.0f, 131072.0f, 262144.0f, 524288.0f, 1.04858E+006f, 2.09715E+006f,
- 4.1943E+006f, 8.38861E+006f, 1.67772E+007f, 3.35544E+007f, 6.71089E+007f, 1.34218E+008f, 2.68435E+008f, 5.36871E+008f,
- 1.07374E+009f, 2.14748E+009f, 4.29497E+009f, 8.58993E+009f, 1.71799E+010f, 3.43597E+010f, 6.87195E+010f, 1.37439E+011f,
- 2.74878E+011f, 5.49756E+011f, 1.09951E+012f, 2.19902E+012f, 4.39805E+012f, 8.79609E+012f, 1.75922E+013f, 3.51844E+013f,
- 7.03687E+013f, 1.40737E+014f, 2.81475E+014f, 5.6295E+014f, 1.1259E+015f, 2.2518E+015f, 4.5036E+015f, 9.0072E+015f,
- 1.80144E+016f, 3.60288E+016f, 7.20576E+016f, 1.44115E+017f, 2.8823E+017f, 5.76461E+017f, 1.15292E+018f, 2.30584E+018f,
- 4.61169E+018f, 9.22337E+018f, 1.84467E+019f, 3.68935E+019f, 7.3787E+019f, 1.47574E+020f, 2.95148E+020f, 5.90296E+020f
-};
-
-void envelope_noise_dequantisation(sbr_info *sbr, uint8_t ch)
-{
- if (sbr->bs_coupling == 0)
- {
- int16_t exp;
- uint8_t l, k;
- uint8_t amp = (sbr->amp_res[ch]) ? 0 : 1;
-
- for (l = 0; l < sbr->L_E[ch]; l++)
- {
- for (k = 0; k < sbr->n[sbr->f[ch][l]]; k++)
- {
- /* +6 for the *64 and -10 for the /32 in the synthesis QMF (fixed)
- * since this is a energy value: (x/32)^2 = (x^2)/1024
- */
- /* exp = (sbr->E[ch][k][l] >> amp) + 6; */
- exp = (sbr->E[ch][k][l] >> amp);
-
- if ((exp < 0) || (exp >= 64))
- {
- sbr->E_orig[ch][k][l] = 0;
- } else {
- sbr->E_orig[ch][k][l] = E_deq_tab[exp];
-
- /* save half the table size at the cost of 1 multiply */
- if (amp && (sbr->E[ch][k][l] & 1))
- {
- sbr->E_orig[ch][k][l] = MUL_C(sbr->E_orig[ch][k][l], COEF_CONST(1.414213562));
- }
- }
- }
- }
-
- for (l = 0; l < sbr->L_Q[ch]; l++)
- {
- for (k = 0; k < sbr->N_Q; k++)
- {
- sbr->Q_div[ch][k][l] = calc_Q_div(sbr, ch, k, l);
- sbr->Q_div2[ch][k][l] = calc_Q_div2(sbr, ch, k, l);
- }
- }
- }
-}
-
-static const real_t E_pan_tab[25] = {
- FRAC_CONST(0.000244081), FRAC_CONST(0.000488043),
- FRAC_CONST(0.00097561), FRAC_CONST(0.00194932),
- FRAC_CONST(0.00389105), FRAC_CONST(0.00775194),
- FRAC_CONST(0.0153846), FRAC_CONST(0.030303),
- FRAC_CONST(0.0588235), FRAC_CONST(0.111111),
- FRAC_CONST(0.2), FRAC_CONST(0.333333),
- FRAC_CONST(0.5), FRAC_CONST(0.666667),
- FRAC_CONST(0.8), FRAC_CONST(0.888889),
- FRAC_CONST(0.941176), FRAC_CONST(0.969697),
- FRAC_CONST(0.984615), FRAC_CONST(0.992248),
- FRAC_CONST(0.996109), FRAC_CONST(0.998051),
- FRAC_CONST(0.999024), FRAC_CONST(0.999512),
- FRAC_CONST(0.999756)
-};
-
-void unmap_envelope_noise(sbr_info *sbr)
-{
- real_t tmp;
- int16_t exp0, exp1;
- uint8_t l, k;
- uint8_t amp0 = (sbr->amp_res[0]) ? 0 : 1;
- uint8_t amp1 = (sbr->amp_res[1]) ? 0 : 1;
-
- for (l = 0; l < sbr->L_E[0]; l++)
- {
- for (k = 0; k < sbr->n[sbr->f[0][l]]; k++)
- {
- /* +6: * 64 ; +1: * 2 ; */
- exp0 = (sbr->E[0][k][l] >> amp0) + 1;
-
- /* UN_MAP removed: (x / 4096) same as (x >> 12) */
- /* E[1] is always even so no need for compensating the divide by 2 with
- * an extra multiplication
- */
- /* exp1 = (sbr->E[1][k][l] >> amp1) - 12; */
- exp1 = (sbr->E[1][k][l] >> amp1);
-
- if ((exp0 < 0) || (exp0 >= 64) ||
- (exp1 < 0) || (exp1 > 24))
- {
- sbr->E_orig[1][k][l] = 0;
- sbr->E_orig[0][k][l] = 0;
- } else {
- tmp = E_deq_tab[exp0];
- if (amp0 && (sbr->E[0][k][l] & 1))
- {
- tmp = MUL_C(tmp, COEF_CONST(1.414213562));
- }
-
- /* panning */
- sbr->E_orig[0][k][l] = MUL_F(tmp, E_pan_tab[exp1]);
- sbr->E_orig[1][k][l] = MUL_F(tmp, E_pan_tab[24 - exp1]);
- }
- }
- }
-
- for (l = 0; l < sbr->L_Q[0]; l++)
- {
- for (k = 0; k < sbr->N_Q; k++)
- {
- sbr->Q_div[0][k][l] = calc_Q_div(sbr, 0, k, l);
- sbr->Q_div[1][k][l] = calc_Q_div(sbr, 1, k, l);
- sbr->Q_div2[0][k][l] = calc_Q_div2(sbr, 0, k, l);
- sbr->Q_div2[1][k][l] = calc_Q_div2(sbr, 1, k, l);
- }
- }
-}
-
-#endif
-
-#endif
diff --git a/src/libfaad/sbr_e_nf.h b/src/libfaad/sbr_e_nf.h
deleted file mode 100644
index 48874c125..000000000
--- a/src/libfaad/sbr_e_nf.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_e_nf.h,v 1.5 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __SBR_E_NF_H__
-#define __SBR_E_NF_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-void extract_envelope_data(sbr_info *sbr, uint8_t ch);
-void extract_noise_floor_data(sbr_info *sbr, uint8_t ch);
-#ifndef FIXED_POINT
-void envelope_noise_dequantisation(sbr_info *sbr, uint8_t ch);
-void unmap_envelope_noise(sbr_info *sbr);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
diff --git a/src/libfaad/sbr_fbt.c b/src/libfaad/sbr_fbt.c
deleted file mode 100644
index 511235863..000000000
--- a/src/libfaad/sbr_fbt.c
+++ /dev/null
@@ -1,761 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_fbt.c,v 1.5 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-/* Calculate frequency band tables */
-
-#include "common.h"
-#include "structs.h"
-
-#ifdef SBR_DEC
-
-#include <stdlib.h>
-
-#include "sbr_syntax.h"
-#include "sbr_fbt.h"
-
-/* static function declarations */
-static int32_t find_bands(uint8_t warp, uint8_t bands, uint8_t a0, uint8_t a1);
-
-
-/* calculate the start QMF channel for the master frequency band table */
-/* parameter is also called k0 */
-uint8_t qmf_start_channel(uint8_t bs_start_freq, uint8_t bs_samplerate_mode,
- uint32_t sample_rate)
-{
- static const uint8_t startMinTable[12] = { 7, 7, 10, 11, 12, 16, 16,
- 17, 24, 32, 35, 48 };
- static const uint8_t offsetIndexTable[12] = { 5, 5, 4, 4, 4, 3, 2, 1, 0,
- 6, 6, 6 };
- static const int8_t offset[7][16] = {
- { -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7 },
- { -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13 },
- { -5, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16 },
- { -6, -4, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16 },
- { -4, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20 },
- { -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20, 24 },
- { 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20, 24, 28, 33 }
- };
- uint8_t startMin = startMinTable[get_sr_index(sample_rate)];
- uint8_t offsetIndex = offsetIndexTable[get_sr_index(sample_rate)];
-
-#if 0 /* replaced with table (startMinTable) */
- if (sample_rate >= 64000)
- {
- startMin = (uint8_t)((5000.*128.)/(float)sample_rate + 0.5);
- } else if (sample_rate < 32000) {
- startMin = (uint8_t)((3000.*128.)/(float)sample_rate + 0.5);
- } else {
- startMin = (uint8_t)((4000.*128.)/(float)sample_rate + 0.5);
- }
-#endif
-
- if (bs_samplerate_mode)
- {
- return startMin + offset[offsetIndex][bs_start_freq];
-
-#if 0 /* replaced by offsetIndexTable */
- switch (sample_rate)
- {
- case 16000:
- return startMin + offset[0][bs_start_freq];
- case 22050:
- return startMin + offset[1][bs_start_freq];
- case 24000:
- return startMin + offset[2][bs_start_freq];
- case 32000:
- return startMin + offset[3][bs_start_freq];
- default:
- if (sample_rate > 64000)
- {
- return startMin + offset[5][bs_start_freq];
- } else { /* 44100 <= sample_rate <= 64000 */
- return startMin + offset[4][bs_start_freq];
- }
- }
-#endif
- } else {
- return startMin + offset[6][bs_start_freq];
- }
-}
-
-static int longcmp(const void *a, const void *b)
-{
- return ((int)(*(int32_t*)a - *(int32_t*)b));
-}
-
-/* calculate the stop QMF channel for the master frequency band table */
-/* parameter is also called k2 */
-uint8_t qmf_stop_channel(uint8_t bs_stop_freq, uint32_t sample_rate,
- uint8_t k0)
-{
- if (bs_stop_freq == 15)
- {
- return min(64, k0 * 3);
- } else if (bs_stop_freq == 14) {
- return min(64, k0 * 2);
- } else {
- static const uint8_t stopMinTable[12] = { 13, 15, 20, 21, 23,
- 32, 32, 35, 48, 64, 70, 96 };
- static const int8_t offset[12][14] = {
- { 0, 2, 4, 6, 8, 11, 14, 18, 22, 26, 31, 37, 44, 51 },
- { 0, 2, 4, 6, 8, 11, 14, 18, 22, 26, 31, 36, 42, 49 },
- { 0, 2, 4, 6, 8, 11, 14, 17, 21, 25, 29, 34, 39, 44 },
- { 0, 2, 4, 6, 8, 11, 14, 17, 20, 24, 28, 33, 38, 43 },
- { 0, 2, 4, 6, 8, 11, 14, 17, 20, 24, 28, 32, 36, 41 },
- { 0, 2, 4, 6, 8, 10, 12, 14, 17, 20, 23, 26, 29, 32 },
- { 0, 2, 4, 6, 8, 10, 12, 14, 17, 20, 23, 26, 29, 32 },
- { 0, 1, 3, 5, 7, 9, 11, 13, 15, 17, 20, 23, 26, 29 },
- { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 0, -1, -2, -3, -4, -5, -6, -6, -6, -6, -6, -6, -6, -6 },
- { 0, -3, -6, -9, -12, -15, -18, -20, -22, -24, -26, -28, -30, -32 }
- };
-#if 0
- uint8_t i;
- int32_t stopDk[13], stopDk_t[14], k2;
-#endif
- uint8_t stopMin = stopMinTable[get_sr_index(sample_rate)];
-
-#if 0 /* replaced by table lookup */
- if (sample_rate >= 64000)
- {
- stopMin = (uint8_t)((10000.*128.)/(float)sample_rate + 0.5);
- } else if (sample_rate < 32000) {
- stopMin = (uint8_t)((6000.*128.)/(float)sample_rate + 0.5);
- } else {
- stopMin = (uint8_t)((8000.*128.)/(float)sample_rate + 0.5);
- }
-#endif
-
-#if 0 /* replaced by table lookup */
- /* diverging power series */
- for (i = 0; i <= 13; i++)
- {
- stopDk_t[i] = (int32_t)(stopMin*pow(64.0/stopMin, i/13.0) + 0.5);
- }
- for (i = 0; i < 13; i++)
- {
- stopDk[i] = stopDk_t[i+1] - stopDk_t[i];
- }
-
- /* needed? */
- qsort(stopDk, 13, sizeof(stopDk[0]), longcmp);
-
- k2 = stopMin;
- for (i = 0; i < bs_stop_freq; i++)
- {
- k2 += stopDk[i];
- }
- return min(64, k2);
-#endif
- /* bs_stop_freq <= 13 */
- return min(64, stopMin + offset[get_sr_index(sample_rate)][min(bs_stop_freq, 13)]);
- }
-
- return 0;
-}
-
-/* calculate the master frequency table from k0, k2, bs_freq_scale
- and bs_alter_scale
-
- version for bs_freq_scale = 0
-*/
-uint8_t master_frequency_table_fs0(sbr_info *sbr, uint8_t k0, uint8_t k2,
- uint8_t bs_alter_scale)
-{
- int8_t incr;
- uint8_t k;
- uint8_t dk;
- uint32_t nrBands, k2Achieved;
- int32_t k2Diff, vDk[64] = {0};
-
- /* mft only defined for k2 > k0 */
- if (k2 <= k0)
- {
- sbr->N_master = 0;
- return 1;
- }
-
- dk = bs_alter_scale ? 2 : 1;
-
-#if 0 /* replaced by float-less design */
- nrBands = 2 * (int32_t)((float)(k2-k0)/(dk*2) + (-1+dk)/2.0f);
-#else
- if (bs_alter_scale)
- {
- nrBands = (((k2-k0+2)>>2)<<1);
- } else {
- nrBands = (((k2-k0)>>1)<<1);
- }
-#endif
- nrBands = min(nrBands, 63);
- if (nrBands <= 0)
- return 1;
-
- k2Achieved = k0 + nrBands * dk;
- k2Diff = k2 - k2Achieved;
- for (k = 0; k < nrBands; k++)
- vDk[k] = dk;
-
- if (k2Diff)
- {
- incr = (k2Diff > 0) ? -1 : 1;
- k = (uint8_t) ((k2Diff > 0) ? (nrBands-1) : 0);
-
- while (k2Diff != 0)
- {
- vDk[k] -= incr;
- k += incr;
- k2Diff += incr;
- }
- }
-
- sbr->f_master[0] = k0;
- for (k = 1; k <= nrBands; k++)
- sbr->f_master[k] = (uint8_t)(sbr->f_master[k-1] + vDk[k-1]);
-
- sbr->N_master = (uint8_t)nrBands;
- sbr->N_master = (min(sbr->N_master, 64));
-
-#if 0
- printf("f_master[%d]: ", nrBands);
- for (k = 0; k <= nrBands; k++)
- {
- printf("%d ", sbr->f_master[k]);
- }
- printf("\n");
-#endif
-
- return 0;
-}
-
-/*
- This function finds the number of bands using this formula:
- bands * log(a1/a0)/log(2.0) + 0.5
-*/
-static int32_t find_bands(uint8_t warp, uint8_t bands, uint8_t a0, uint8_t a1)
-{
-#ifdef FIXED_POINT
- /* table with log2() values */
- static const real_t log2Table[65] = {
- COEF_CONST(0.0), COEF_CONST(0.0), COEF_CONST(1.0000000000), COEF_CONST(1.5849625007),
- COEF_CONST(2.0000000000), COEF_CONST(2.3219280949), COEF_CONST(2.5849625007), COEF_CONST(2.8073549221),
- COEF_CONST(3.0000000000), COEF_CONST(3.1699250014), COEF_CONST(3.3219280949), COEF_CONST(3.4594316186),
- COEF_CONST(3.5849625007), COEF_CONST(3.7004397181), COEF_CONST(3.8073549221), COEF_CONST(3.9068905956),
- COEF_CONST(4.0000000000), COEF_CONST(4.0874628413), COEF_CONST(4.1699250014), COEF_CONST(4.2479275134),
- COEF_CONST(4.3219280949), COEF_CONST(4.3923174228), COEF_CONST(4.4594316186), COEF_CONST(4.5235619561),
- COEF_CONST(4.5849625007), COEF_CONST(4.6438561898), COEF_CONST(4.7004397181), COEF_CONST(4.7548875022),
- COEF_CONST(4.8073549221), COEF_CONST(4.8579809951), COEF_CONST(4.9068905956), COEF_CONST(4.9541963104),
- COEF_CONST(5.0000000000), COEF_CONST(5.0443941194), COEF_CONST(5.0874628413), COEF_CONST(5.1292830169),
- COEF_CONST(5.1699250014), COEF_CONST(5.2094533656), COEF_CONST(5.2479275134), COEF_CONST(5.2854022189),
- COEF_CONST(5.3219280949), COEF_CONST(5.3575520046), COEF_CONST(5.3923174228), COEF_CONST(5.4262647547),
- COEF_CONST(5.4594316186), COEF_CONST(5.4918530963), COEF_CONST(5.5235619561), COEF_CONST(5.5545888517),
- COEF_CONST(5.5849625007), COEF_CONST(5.6147098441), COEF_CONST(5.6438561898), COEF_CONST(5.6724253420),
- COEF_CONST(5.7004397181), COEF_CONST(5.7279204546), COEF_CONST(5.7548875022), COEF_CONST(5.7813597135),
- COEF_CONST(5.8073549221), COEF_CONST(5.8328900142), COEF_CONST(5.8579809951), COEF_CONST(5.8826430494),
- COEF_CONST(5.9068905956), COEF_CONST(5.9307373376), COEF_CONST(5.9541963104), COEF_CONST(5.9772799235),
- COEF_CONST(6.0)
- };
- real_t r0 = log2Table[a0]; /* coef */
- real_t r1 = log2Table[a1]; /* coef */
- real_t r2 = (r1 - r0); /* coef */
-
- if (warp)
- r2 = MUL_C(r2, COEF_CONST(1.0/1.3));
-
- /* convert r2 to real and then multiply and round */
- r2 = (r2 >> (COEF_BITS-REAL_BITS)) * bands + (1<<(REAL_BITS-1));
-
- return (r2 >> REAL_BITS);
-#else
- real_t div = (real_t)log(2.0);
- if (warp) div *= (real_t)1.3;
-
- return (int32_t)(bands * log((float)a1/(float)a0)/div + 0.5);
-#endif
-}
-
-static real_t find_initial_power(uint8_t bands, uint8_t a0, uint8_t a1)
-{
-#ifdef FIXED_POINT
- /* table with log() values */
- static const real_t logTable[65] = {
- COEF_CONST(0.0), COEF_CONST(0.0), COEF_CONST(0.6931471806), COEF_CONST(1.0986122887),
- COEF_CONST(1.3862943611), COEF_CONST(1.6094379124), COEF_CONST(1.7917594692), COEF_CONST(1.9459101491),
- COEF_CONST(2.0794415417), COEF_CONST(2.1972245773), COEF_CONST(2.3025850930), COEF_CONST(2.3978952728),
- COEF_CONST(2.4849066498), COEF_CONST(2.5649493575), COEF_CONST(2.6390573296), COEF_CONST(2.7080502011),
- COEF_CONST(2.7725887222), COEF_CONST(2.8332133441), COEF_CONST(2.8903717579), COEF_CONST(2.9444389792),
- COEF_CONST(2.9957322736), COEF_CONST(3.0445224377), COEF_CONST(3.0910424534), COEF_CONST(3.1354942159),
- COEF_CONST(3.1780538303), COEF_CONST(3.2188758249), COEF_CONST(3.2580965380), COEF_CONST(3.2958368660),
- COEF_CONST(3.3322045102), COEF_CONST(3.3672958300), COEF_CONST(3.4011973817), COEF_CONST(3.4339872045),
- COEF_CONST(3.4657359028), COEF_CONST(3.4965075615), COEF_CONST(3.5263605246), COEF_CONST(3.5553480615),
- COEF_CONST(3.5835189385), COEF_CONST(3.6109179126), COEF_CONST(3.6375861597), COEF_CONST(3.6635616461),
- COEF_CONST(3.6888794541), COEF_CONST(3.7135720667), COEF_CONST(3.7376696183), COEF_CONST(3.7612001157),
- COEF_CONST(3.7841896339), COEF_CONST(3.8066624898), COEF_CONST(3.8286413965), COEF_CONST(3.8501476017),
- COEF_CONST(3.8712010109), COEF_CONST(3.8918202981), COEF_CONST(3.9120230054), COEF_CONST(3.9318256327),
- COEF_CONST(3.9512437186), COEF_CONST(3.9702919136), COEF_CONST(3.9889840466), COEF_CONST(4.0073331852),
- COEF_CONST(4.0253516907), COEF_CONST(4.0430512678), COEF_CONST(4.0604430105), COEF_CONST(4.0775374439),
- COEF_CONST(4.0943445622), COEF_CONST(4.1108738642), COEF_CONST(4.1271343850), COEF_CONST(4.1431347264),
- COEF_CONST(4.158883083)
- };
- /* standard Taylor polynomial coefficients for exp(x) around 0 */
- /* a polynomial around x=1 is more precise, as most values are around 1.07,
- but this is just fine already */
- static const real_t c1 = COEF_CONST(1.0);
- static const real_t c2 = COEF_CONST(1.0/2.0);
- static const real_t c3 = COEF_CONST(1.0/6.0);
- static const real_t c4 = COEF_CONST(1.0/24.0);
-
- real_t r0 = logTable[a0]; /* coef */
- real_t r1 = logTable[a1]; /* coef */
- real_t r2 = (r1 - r0) / bands; /* coef */
- real_t rexp = c1 + MUL_C((c1 + MUL_C((c2 + MUL_C((c3 + MUL_C(c4,r2)), r2)), r2)), r2);
-
- return (rexp >> (COEF_BITS-REAL_BITS)); /* real */
-#else
- return (real_t)pow((real_t)a1/(real_t)a0, 1.0/(real_t)bands);
-#endif
-}
-
-/*
- version for bs_freq_scale > 0
-*/
-uint8_t master_frequency_table(sbr_info *sbr, uint8_t k0, uint8_t k2,
- uint8_t bs_freq_scale, uint8_t bs_alter_scale)
-{
- uint8_t k, bands, twoRegions;
- uint8_t k1;
- uint8_t nrBand0, nrBand1;
- int32_t vDk0[64] = {0}, vDk1[64] = {0};
- int32_t vk0[64] = {0}, vk1[64] = {0};
- uint8_t temp1[] = { 6, 5, 4 };
- real_t q, qk;
- int32_t A_1;
-#ifdef FIXED_POINT
- real_t rk2, rk0;
-#endif
-
- /* mft only defined for k2 > k0 */
- if (k2 <= k0)
- {
- sbr->N_master = 0;
- return 1;
- }
-
- bands = temp1[bs_freq_scale-1];
-
-#ifdef FIXED_POINT
- rk0 = (real_t)k0 << REAL_BITS;
- rk2 = (real_t)k2 << REAL_BITS;
- if (rk2 > MUL_C(rk0, COEF_CONST(2.2449)))
-#else
- if ((float)k2/(float)k0 > 2.2449)
-#endif
- {
- twoRegions = 1;
- k1 = k0 << 1;
- } else {
- twoRegions = 0;
- k1 = k2;
- }
-
- nrBand0 = (uint8_t)(2 * find_bands(0, bands, k0, k1));
- nrBand0 = min(nrBand0, 63);
- if (nrBand0 <= 0)
- return 1;
-
- q = find_initial_power(nrBand0, k0, k1);
-#ifdef FIXED_POINT
- qk = (real_t)k0 << REAL_BITS;
- //A_1 = (int32_t)((qk + REAL_CONST(0.5)) >> REAL_BITS);
- A_1 = k0;
-#else
- qk = REAL_CONST(k0);
- A_1 = (int32_t)(qk + .5);
-#endif
- for (k = 0; k <= nrBand0; k++)
- {
- int32_t A_0 = A_1;
-#ifdef FIXED_POINT
- qk = MUL_R(qk,q);
- A_1 = (int32_t)((qk + REAL_CONST(0.5)) >> REAL_BITS);
-#else
- qk *= q;
- A_1 = (int32_t)(qk + 0.5);
-#endif
- vDk0[k] = A_1 - A_0;
- }
-
- /* needed? */
- qsort(vDk0, nrBand0, sizeof(vDk0[0]), longcmp);
-
- vk0[0] = k0;
- for (k = 1; k <= nrBand0; k++)
- {
- vk0[k] = vk0[k-1] + vDk0[k-1];
- if (vDk0[k-1] == 0)
- return 1;
- }
-
- if (!twoRegions)
- {
- for (k = 0; k <= nrBand0; k++)
- sbr->f_master[k] = (uint8_t) vk0[k];
-
- sbr->N_master = nrBand0;
- sbr->N_master = min(sbr->N_master, 64);
- return 0;
- }
-
- nrBand1 = (uint8_t)(2 * find_bands(1 /* warped */, bands, k1, k2));
- nrBand1 = min(nrBand1, 63);
-
- q = find_initial_power(nrBand1, k1, k2);
-#ifdef FIXED_POINT
- qk = (real_t)k1 << REAL_BITS;
- //A_1 = (int32_t)((qk + REAL_CONST(0.5)) >> REAL_BITS);
- A_1 = k1;
-#else
- qk = REAL_CONST(k1);
- A_1 = (int32_t)(qk + .5);
-#endif
- for (k = 0; k <= nrBand1 - 1; k++)
- {
- int32_t A_0 = A_1;
-#ifdef FIXED_POINT
- qk = MUL_R(qk,q);
- A_1 = (int32_t)((qk + REAL_CONST(0.5)) >> REAL_BITS);
-#else
- qk *= q;
- A_1 = (int32_t)(qk + 0.5);
-#endif
- vDk1[k] = A_1 - A_0;
- }
-
- if (vDk1[0] < vDk0[nrBand0 - 1])
- {
- int32_t change;
-
- /* needed? */
- qsort(vDk1, nrBand1 + 1, sizeof(vDk1[0]), longcmp);
- change = vDk0[nrBand0 - 1] - vDk1[0];
- vDk1[0] = vDk0[nrBand0 - 1];
- vDk1[nrBand1 - 1] = vDk1[nrBand1 - 1] - change;
- }
-
- /* needed? */
- qsort(vDk1, nrBand1, sizeof(vDk1[0]), longcmp);
- vk1[0] = k1;
- for (k = 1; k <= nrBand1; k++)
- {
- vk1[k] = vk1[k-1] + vDk1[k-1];
- if (vDk1[k-1] == 0)
- return 1;
- }
-
- sbr->N_master = nrBand0 + nrBand1;
- sbr->N_master = min(sbr->N_master, 64);
- for (k = 0; k <= nrBand0; k++)
- {
- sbr->f_master[k] = (uint8_t) vk0[k];
- }
- for (k = nrBand0 + 1; k <= sbr->N_master; k++)
- {
- sbr->f_master[k] = (uint8_t) vk1[k - nrBand0];
- }
-
-#if 0
- printf("f_master[%d]: ", sbr->N_master);
- for (k = 0; k <= sbr->N_master; k++)
- {
- printf("%d ", sbr->f_master[k]);
- }
- printf("\n");
-#endif
-
- return 0;
-}
-
-/* calculate the derived frequency border tables from f_master */
-uint8_t derived_frequency_table(sbr_info *sbr, uint8_t bs_xover_band,
- uint8_t k2)
-{
- uint8_t k, i;
- uint32_t minus;
-
- /* The following relation shall be satisfied: bs_xover_band < N_Master */
- if (sbr->N_master <= bs_xover_band)
- return 1;
-
- sbr->N_high = sbr->N_master - bs_xover_band;
- sbr->N_low = (sbr->N_high>>1) + (sbr->N_high - ((sbr->N_high>>1)<<1));
-
- sbr->n[0] = sbr->N_low;
- sbr->n[1] = sbr->N_high;
-
- for (k = 0; k <= sbr->N_high; k++)
- {
- sbr->f_table_res[HI_RES][k] = sbr->f_master[k + bs_xover_band];
- }
-
- sbr->M = sbr->f_table_res[HI_RES][sbr->N_high] - sbr->f_table_res[HI_RES][0];
- sbr->kx = sbr->f_table_res[HI_RES][0];
- if (sbr->kx > 32)
- return 1;
- if (sbr->kx + sbr->M > 64)
- return 1;
-
- minus = (sbr->N_high & 1) ? 1 : 0;
-
- for (k = 0; k <= sbr->N_low; k++)
- {
- if (k == 0)
- i = 0;
- else
- i = (uint8_t)(2*k - minus);
- sbr->f_table_res[LO_RES][k] = sbr->f_table_res[HI_RES][i];
- }
-
-#if 0
- printf("bs_freq_scale: %d\n", sbr->bs_freq_scale);
- printf("bs_limiter_bands: %d\n", sbr->bs_limiter_bands);
- printf("f_table_res[HI_RES][%d]: ", sbr->N_high);
- for (k = 0; k <= sbr->N_high; k++)
- {
- printf("%d ", sbr->f_table_res[HI_RES][k]);
- }
- printf("\n");
-#endif
-#if 0
- printf("f_table_res[LO_RES][%d]: ", sbr->N_low);
- for (k = 0; k <= sbr->N_low; k++)
- {
- printf("%d ", sbr->f_table_res[LO_RES][k]);
- }
- printf("\n");
-#endif
-
- sbr->N_Q = 0;
- if (sbr->bs_noise_bands == 0)
- {
- sbr->N_Q = 1;
- } else {
-#if 0
- sbr->N_Q = max(1, (int32_t)(sbr->bs_noise_bands*(log(k2/(float)sbr->kx)/log(2.0)) + 0.5));
-#else
- sbr->N_Q = (uint8_t)(max(1, find_bands(0, sbr->bs_noise_bands, sbr->kx, k2)));
-#endif
- sbr->N_Q = min(5, sbr->N_Q);
- }
-
- for (k = 0; k <= sbr->N_Q; k++)
- {
- if (k == 0)
- {
- i = 0;
- } else {
- /* i = i + (int32_t)((sbr->N_low - i)/(sbr->N_Q + 1 - k)); */
- i = i + (sbr->N_low - i)/(sbr->N_Q + 1 - k);
- }
- sbr->f_table_noise[k] = sbr->f_table_res[LO_RES][i];
- }
-
- /* build table for mapping k to g in hf patching */
- for (k = 0; k < 64; k++)
- {
- uint8_t g;
- for (g = 0; g < sbr->N_Q; g++)
- {
- if ((sbr->f_table_noise[g] <= k) &&
- (k < sbr->f_table_noise[g+1]))
- {
- sbr->table_map_k_to_g[k] = g;
- break;
- }
- }
- }
-
-#if 0
- printf("f_table_noise[%d]: ", sbr->N_Q);
- for (k = 0; k <= sbr->N_Q; k++)
- {
- printf("%d ", sbr->f_table_noise[k] - sbr->kx);
- }
- printf("\n");
-#endif
-
- return 0;
-}
-
-/* TODO: blegh, ugly */
-/* Modified to calculate for all possible bs_limiter_bands always
- * This reduces the number calls to this functions needed (now only on
- * header reset)
- */
-void limiter_frequency_table(sbr_info *sbr)
-{
-#if 0
- static const real_t limiterBandsPerOctave[] = { REAL_CONST(1.2),
- REAL_CONST(2), REAL_CONST(3) };
-#else
- static const real_t limiterBandsCompare[] = { REAL_CONST(1.327152),
- REAL_CONST(1.185093), REAL_CONST(1.119872) };
-#endif
- uint8_t k, s;
- int8_t nrLim;
-#if 0
- real_t limBands;
-#endif
-
- sbr->f_table_lim[0][0] = sbr->f_table_res[LO_RES][0] - sbr->kx;
- sbr->f_table_lim[0][1] = sbr->f_table_res[LO_RES][sbr->N_low] - sbr->kx;
- sbr->N_L[0] = 1;
-
-#if 0
- printf("f_table_lim[%d][%d]: ", 0, sbr->N_L[0]);
- for (k = 0; k <= sbr->N_L[0]; k++)
- {
- printf("%d ", sbr->f_table_lim[0][k]);
- }
- printf("\n");
-#endif
-
- for (s = 1; s < 4; s++)
- {
- int32_t limTable[100 /*TODO*/] = {0};
- uint8_t patchBorders[64/*??*/] = {0};
-
-#if 0
- limBands = limiterBandsPerOctave[s - 1];
-#endif
-
- patchBorders[0] = sbr->kx;
- for (k = 1; k <= sbr->noPatches; k++)
- {
- patchBorders[k] = patchBorders[k-1] + sbr->patchNoSubbands[k-1];
- }
-
- for (k = 0; k <= sbr->N_low; k++)
- {
- limTable[k] = sbr->f_table_res[LO_RES][k];
- }
- for (k = 1; k < sbr->noPatches; k++)
- {
- limTable[k+sbr->N_low] = patchBorders[k];
- }
-
- /* needed */
- qsort(limTable, sbr->noPatches + sbr->N_low, sizeof(limTable[0]), longcmp);
- k = 1;
- nrLim = sbr->noPatches + sbr->N_low - 1;
-
- if (nrLim < 0) // TODO: BIG FAT PROBLEM
- return;
-
-restart:
- if (k <= nrLim)
- {
- real_t nOctaves;
-
- if (limTable[k-1] != 0)
-#if 0
- nOctaves = REAL_CONST(log((float)limTable[k]/(float)limTable[k-1])/log(2.0));
-#else
-#ifdef FIXED_POINT
- nOctaves = DIV_R((limTable[k]<<REAL_BITS),REAL_CONST(limTable[k-1]));
-#else
- nOctaves = (real_t)limTable[k]/(real_t)limTable[k-1];
-#endif
-#endif
- else
- nOctaves = 0;
-
-#if 0
- if ((MUL_R(nOctaves,limBands)) < REAL_CONST(0.49))
-#else
- if (nOctaves < limiterBandsCompare[s - 1])
-#endif
- {
- uint8_t i;
- if (limTable[k] != limTable[k-1])
- {
- uint8_t found = 0, found2 = 0;
- for (i = 0; i <= sbr->noPatches; i++)
- {
- if (limTable[k] == patchBorders[i])
- found = 1;
- }
- if (found)
- {
- found2 = 0;
- for (i = 0; i <= sbr->noPatches; i++)
- {
- if (limTable[k-1] == patchBorders[i])
- found2 = 1;
- }
- if (found2)
- {
- k++;
- goto restart;
- } else {
- /* remove (k-1)th element */
- limTable[k-1] = sbr->f_table_res[LO_RES][sbr->N_low];
- qsort(limTable, sbr->noPatches + sbr->N_low, sizeof(limTable[0]), longcmp);
- nrLim--;
- goto restart;
- }
- }
- }
- /* remove kth element */
- limTable[k] = sbr->f_table_res[LO_RES][sbr->N_low];
- qsort(limTable, nrLim, sizeof(limTable[0]), longcmp);
- nrLim--;
- goto restart;
- } else {
- k++;
- goto restart;
- }
- }
-
- sbr->N_L[s] = nrLim;
- for (k = 0; k <= nrLim; k++)
- {
- sbr->f_table_lim[s][k] = limTable[k] - sbr->kx;
- }
-
-#if 0
- printf("f_table_lim[%d][%d]: ", s, sbr->N_L[s]);
- for (k = 0; k <= sbr->N_L[s]; k++)
- {
- printf("%d ", sbr->f_table_lim[s][k]);
- }
- printf("\n");
-#endif
- }
-}
-
-#endif
diff --git a/src/libfaad/sbr_fbt.h b/src/libfaad/sbr_fbt.h
deleted file mode 100644
index 26c580efe..000000000
--- a/src/libfaad/sbr_fbt.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_fbt.h,v 1.5 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __SBR_FBT_H__
-#define __SBR_FBT_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-uint8_t qmf_start_channel(uint8_t bs_start_freq, uint8_t bs_samplerate_mode,
- uint32_t sample_rate);
-uint8_t qmf_stop_channel(uint8_t bs_stop_freq, uint32_t sample_rate,
- uint8_t k0);
-uint8_t master_frequency_table_fs0(sbr_info *sbr, uint8_t k0, uint8_t k2,
- uint8_t bs_alter_scale);
-uint8_t master_frequency_table(sbr_info *sbr, uint8_t k0, uint8_t k2,
- uint8_t bs_freq_scale, uint8_t bs_alter_scale);
-uint8_t derived_frequency_table(sbr_info *sbr, uint8_t bs_xover_band,
- uint8_t k2);
-void limiter_frequency_table(sbr_info *sbr);
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
diff --git a/src/libfaad/sbr_hfadj.c b/src/libfaad/sbr_hfadj.c
deleted file mode 100644
index 081f731e9..000000000
--- a/src/libfaad/sbr_hfadj.c
+++ /dev/null
@@ -1,1720 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_hfadj.c,v 1.5 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-/* High Frequency adjustment */
-
-#include "common.h"
-#include "structs.h"
-
-#ifdef SBR_DEC
-
-#include "sbr_syntax.h"
-#include "sbr_hfadj.h"
-
-#include "sbr_noise.h"
-
-
-/* static function declarations */
-static void estimate_current_envelope(sbr_info *sbr, sbr_hfadj_info *adj,
- qmf_t Xsbr[MAX_NTSRHFG][64], uint8_t ch);
-static void calculate_gain(sbr_info *sbr, sbr_hfadj_info *adj, uint8_t ch);
-#ifdef SBR_LOW_POWER
-static void calc_gain_groups(sbr_info *sbr, sbr_hfadj_info *adj, real_t *deg, uint8_t ch);
-static void aliasing_reduction(sbr_info *sbr, sbr_hfadj_info *adj, real_t *deg, uint8_t ch);
-#endif
-static void hf_assembly(sbr_info *sbr, sbr_hfadj_info *adj, qmf_t Xsbr[MAX_NTSRHFG][64], uint8_t ch);
-
-
-void hf_adjustment(sbr_info *sbr, qmf_t Xsbr[MAX_NTSRHFG][64]
-#ifdef SBR_LOW_POWER
- ,real_t *deg /* aliasing degree */
-#endif
- ,uint8_t ch)
-{
- ALIGN sbr_hfadj_info adj = {{{0}}};
-
- if (sbr->bs_frame_class[ch] == FIXFIX)
- {
- sbr->l_A[ch] = -1;
- } else if (sbr->bs_frame_class[ch] == VARFIX) {
- if (sbr->bs_pointer[ch] > 1)
- sbr->l_A[ch] = -1;
- else
- sbr->l_A[ch] = sbr->bs_pointer[ch] - 1;
- } else {
- if (sbr->bs_pointer[ch] == 0)
- sbr->l_A[ch] = -1;
- else
- sbr->l_A[ch] = sbr->L_E[ch] + 1 - sbr->bs_pointer[ch];
- }
-
- estimate_current_envelope(sbr, &adj, Xsbr, ch);
-
- calculate_gain(sbr, &adj, ch);
-
-#ifdef SBR_LOW_POWER
- calc_gain_groups(sbr, &adj, deg, ch);
- aliasing_reduction(sbr, &adj, deg, ch);
-#endif
-
- hf_assembly(sbr, &adj, Xsbr, ch);
-}
-
-static uint8_t get_S_mapped(sbr_info *sbr, uint8_t ch, uint8_t l, uint8_t current_band)
-{
- if (sbr->f[ch][l] == HI_RES)
- {
- /* in case of using f_table_high we just have 1 to 1 mapping
- * from bs_add_harmonic[l][k]
- */
- if ((l >= sbr->l_A[ch]) ||
- (sbr->bs_add_harmonic_prev[ch][current_band] && sbr->bs_add_harmonic_flag_prev[ch]))
- {
- return sbr->bs_add_harmonic[ch][current_band];
- }
- } else {
- uint8_t b, lb, ub;
-
- /* in case of f_table_low we check if any of the HI_RES bands
- * within this LO_RES band has bs_add_harmonic[l][k] turned on
- * (note that borders in the LO_RES table are also present in
- * the HI_RES table)
- */
-
- /* find first HI_RES band in current LO_RES band */
- lb = 2*current_band - ((sbr->N_high & 1) ? 1 : 0);
- /* find first HI_RES band in next LO_RES band */
- ub = 2*(current_band+1) - ((sbr->N_high & 1) ? 1 : 0);
-
- /* check all HI_RES bands in current LO_RES band for sinusoid */
- for (b = lb; b < ub; b++)
- {
- if ((l >= sbr->l_A[ch]) ||
- (sbr->bs_add_harmonic_prev[ch][b] && sbr->bs_add_harmonic_flag_prev[ch]))
- {
- if (sbr->bs_add_harmonic[ch][b] == 1)
- return 1;
- }
- }
- }
-
- return 0;
-}
-
-static void estimate_current_envelope(sbr_info *sbr, sbr_hfadj_info *adj,
- qmf_t Xsbr[MAX_NTSRHFG][64], uint8_t ch)
-{
- uint8_t m, l, j, k, k_l, k_h, p;
- real_t nrg, div;
-
- if (sbr->bs_interpol_freq == 1)
- {
- for (l = 0; l < sbr->L_E[ch]; l++)
- {
- uint8_t i, l_i, u_i;
-
- l_i = sbr->t_E[ch][l];
- u_i = sbr->t_E[ch][l+1];
-
- div = (real_t)(u_i - l_i);
-
- for (m = 0; m < sbr->M; m++)
- {
- nrg = 0;
-
- for (i = l_i + sbr->tHFAdj; i < u_i + sbr->tHFAdj; i++)
- {
-#ifdef FIXED_POINT
-#ifdef SBR_LOW_POWER
- nrg += ((QMF_RE(Xsbr[i][m + sbr->kx])+(1<<(REAL_BITS-1)))>>REAL_BITS)*((QMF_RE(Xsbr[i][m + sbr->kx])+(1<<(REAL_BITS-1)))>>REAL_BITS);
-#else
- nrg += ((QMF_RE(Xsbr[i][m + sbr->kx])+(1<<(REAL_BITS-1)))>>REAL_BITS)*((QMF_RE(Xsbr[i][m + sbr->kx])+(1<<(REAL_BITS-1)))>>REAL_BITS) +
- ((QMF_IM(Xsbr[i][m + sbr->kx])+(1<<(REAL_BITS-1)))>>REAL_BITS)*((QMF_IM(Xsbr[i][m + sbr->kx])+(1<<(REAL_BITS-1)))>>REAL_BITS);
-#endif
-#else
- nrg += MUL_R(QMF_RE(Xsbr[i][m + sbr->kx]), QMF_RE(Xsbr[i][m + sbr->kx]))
-#ifndef SBR_LOW_POWER
- + MUL_R(QMF_IM(Xsbr[i][m + sbr->kx]), QMF_IM(Xsbr[i][m + sbr->kx]))
-#endif
- ;
-#endif
- }
-
- sbr->E_curr[ch][m][l] = nrg / div;
-#ifdef SBR_LOW_POWER
-#ifdef FIXED_POINT
- sbr->E_curr[ch][m][l] <<= 1;
-#else
- sbr->E_curr[ch][m][l] *= 2;
-#endif
-#endif
- }
- }
- } else {
- for (l = 0; l < sbr->L_E[ch]; l++)
- {
- for (p = 0; p < sbr->n[sbr->f[ch][l]]; p++)
- {
- k_l = sbr->f_table_res[sbr->f[ch][l]][p];
- k_h = sbr->f_table_res[sbr->f[ch][l]][p+1];
-
- for (k = k_l; k < k_h; k++)
- {
- uint8_t i, l_i, u_i;
- nrg = 0;
-
- l_i = sbr->t_E[ch][l];
- u_i = sbr->t_E[ch][l+1];
-
- div = (real_t)((u_i - l_i)*(k_h - k_l));
-
- for (i = l_i + sbr->tHFAdj; i < u_i + sbr->tHFAdj; i++)
- {
- for (j = k_l; j < k_h; j++)
- {
-#ifdef FIXED_POINT
-#ifdef SBR_LOW_POWER
- nrg += ((QMF_RE(Xsbr[i][j])+(1<<(REAL_BITS-1)))>>REAL_BITS)*((QMF_RE(Xsbr[i][j])+(1<<(REAL_BITS-1)))>>REAL_BITS);
-#else
- nrg += ((QMF_RE(Xsbr[i][j])+(1<<(REAL_BITS-1)))>>REAL_BITS)*((QMF_RE(Xsbr[i][j])+(1<<(REAL_BITS-1)))>>REAL_BITS) +
- ((QMF_IM(Xsbr[i][j])+(1<<(REAL_BITS-1)))>>REAL_BITS)*((QMF_IM(Xsbr[i][j])+(1<<(REAL_BITS-1)))>>REAL_BITS);
-#endif
-#else
- nrg += MUL_R(QMF_RE(Xsbr[i][j]), QMF_RE(Xsbr[i][j]))
-#ifndef SBR_LOW_POWER
- + MUL_R(QMF_IM(Xsbr[i][j]), QMF_IM(Xsbr[i][j]))
-#endif
- ;
-#endif
- }
- }
-
- sbr->E_curr[ch][k - sbr->kx][l] = nrg / div;
-#ifdef SBR_LOW_POWER
-#ifdef FIXED_POINT
- sbr->E_curr[ch][k - sbr->kx][l] <<= 1;
-#else
- sbr->E_curr[ch][k - sbr->kx][l] *= 2;
-#endif
-#endif
- }
- }
- }
- }
-}
-
-#ifdef FIXED_POINT
-#define EPS (1) /* smallest number available in fixed point */
-#else
-#define EPS (1e-12)
-#endif
-
-
-
-#ifdef FIXED_POINT
-
-/* log2 values of [0..63] */
-static const real_t log2_int_tab[] = {
- LOG2_MIN_INF, REAL_CONST(0.000000000000000), REAL_CONST(1.000000000000000), REAL_CONST(1.584962500721156),
- REAL_CONST(2.000000000000000), REAL_CONST(2.321928094887362), REAL_CONST(2.584962500721156), REAL_CONST(2.807354922057604),
- REAL_CONST(3.000000000000000), REAL_CONST(3.169925001442313), REAL_CONST(3.321928094887363), REAL_CONST(3.459431618637297),
- REAL_CONST(3.584962500721156), REAL_CONST(3.700439718141092), REAL_CONST(3.807354922057604), REAL_CONST(3.906890595608519),
- REAL_CONST(4.000000000000000), REAL_CONST(4.087462841250339), REAL_CONST(4.169925001442312), REAL_CONST(4.247927513443585),
- REAL_CONST(4.321928094887362), REAL_CONST(4.392317422778761), REAL_CONST(4.459431618637297), REAL_CONST(4.523561956057013),
- REAL_CONST(4.584962500721156), REAL_CONST(4.643856189774724), REAL_CONST(4.700439718141093), REAL_CONST(4.754887502163468),
- REAL_CONST(4.807354922057604), REAL_CONST(4.857980995127572), REAL_CONST(4.906890595608519), REAL_CONST(4.954196310386875),
- REAL_CONST(5.000000000000000), REAL_CONST(5.044394119358453), REAL_CONST(5.087462841250340), REAL_CONST(5.129283016944966),
- REAL_CONST(5.169925001442312), REAL_CONST(5.209453365628949), REAL_CONST(5.247927513443585), REAL_CONST(5.285402218862248),
- REAL_CONST(5.321928094887363), REAL_CONST(5.357552004618084), REAL_CONST(5.392317422778761), REAL_CONST(5.426264754702098),
- REAL_CONST(5.459431618637297), REAL_CONST(5.491853096329675), REAL_CONST(5.523561956057013), REAL_CONST(5.554588851677637),
- REAL_CONST(5.584962500721156), REAL_CONST(5.614709844115208), REAL_CONST(5.643856189774724), REAL_CONST(5.672425341971495),
- REAL_CONST(5.700439718141093), REAL_CONST(5.727920454563200), REAL_CONST(5.754887502163469), REAL_CONST(5.781359713524660),
- REAL_CONST(5.807354922057605), REAL_CONST(5.832890014164742), REAL_CONST(5.857980995127572), REAL_CONST(5.882643049361842),
- REAL_CONST(5.906890595608518), REAL_CONST(5.930737337562887), REAL_CONST(5.954196310386876), REAL_CONST(5.977279923499916)
-};
-
-static const real_t pan_log2_tab[] = {
- REAL_CONST(1.000000000000000), REAL_CONST(0.584962500721156), REAL_CONST(0.321928094887362), REAL_CONST(0.169925001442312), REAL_CONST(0.087462841250339),
- REAL_CONST(0.044394119358453), REAL_CONST(0.022367813028455), REAL_CONST(0.011227255423254), REAL_CONST(0.005624549193878), REAL_CONST(0.002815015607054),
- REAL_CONST(0.001408194392808), REAL_CONST(0.000704269011247), REAL_CONST(0.000352177480301), REAL_CONST(0.000176099486443), REAL_CONST(0.000088052430122),
- REAL_CONST(0.000044026886827), REAL_CONST(0.000022013611360), REAL_CONST(0.000011006847667)
-};
-
-static real_t find_log2_E(sbr_info *sbr, uint8_t k, uint8_t l, uint8_t ch)
-{
- /* check for coupled energy/noise data */
- if (sbr->bs_coupling == 1)
- {
- uint8_t amp0 = (sbr->amp_res[0]) ? 0 : 1;
- uint8_t amp1 = (sbr->amp_res[1]) ? 0 : 1;
- real_t tmp = (7 << REAL_BITS) + (sbr->E[0][k][l] << (REAL_BITS-amp0));
- real_t pan;
-
- /* E[1] should always be even so shifting is OK */
- uint8_t E = sbr->E[1][k][l] >> amp1;
-
- if (ch == 0)
- {
- if (E > 12)
- {
- /* negative */
- pan = pan_log2_tab[-12 + E];
- } else {
- /* positive */
- pan = pan_log2_tab[12 - E] + ((12 - E)<<REAL_BITS);
- }
- } else {
- if (E < 12)
- {
- /* negative */
- pan = pan_log2_tab[-E + 12];
- } else {
- /* positive */
- pan = pan_log2_tab[E - 12] + ((E - 12)<<REAL_BITS);
- }
- }
-
- /* tmp / pan in log2 */
- return tmp - pan;
- } else {
- uint8_t amp = (sbr->amp_res[ch]) ? 0 : 1;
-
- return (6 << REAL_BITS) + (sbr->E[ch][k][l] << (REAL_BITS-amp));
- }
-}
-
-static real_t find_log2_Q(sbr_info *sbr, uint8_t k, uint8_t l, uint8_t ch)
-{
- /* check for coupled energy/noise data */
- if (sbr->bs_coupling == 1)
- {
- real_t tmp = (7 << REAL_BITS) - (sbr->Q[0][k][l] << REAL_BITS);
- real_t pan;
-
- uint8_t Q = sbr->Q[1][k][l];
-
- if (ch == 0)
- {
- if (Q > 12)
- {
- /* negative */
- pan = pan_log2_tab[-12 + Q];
- } else {
- /* positive */
- pan = pan_log2_tab[12 - Q] + ((12 - Q)<<REAL_BITS);
- }
- } else {
- if (Q < 12)
- {
- /* negative */
- pan = pan_log2_tab[-Q + 12];
- } else {
- /* positive */
- pan = pan_log2_tab[Q - 12] + ((Q - 12)<<REAL_BITS);
- }
- }
-
- /* tmp / pan in log2 */
- return tmp - pan;
- } else {
- return (6 << REAL_BITS) - (sbr->Q[ch][k][l] << REAL_BITS);
- }
-}
-
-static const real_t log_Qplus1_pan[31][13] = {
- { REAL_CONST(0.044383447617292), REAL_CONST(0.169768601655960), REAL_CONST(0.583090126514435), REAL_CONST(1.570089221000671), REAL_CONST(3.092446088790894), REAL_CONST(4.733354568481445), REAL_CONST(6.022367954254150), REAL_CONST(6.692092418670654), REAL_CONST(6.924463272094727), REAL_CONST(6.989034175872803), REAL_CONST(7.005646705627441), REAL_CONST(7.009829998016357), REAL_CONST(7.010877609252930) },
- { REAL_CONST(0.022362394258380), REAL_CONST(0.087379962205887), REAL_CONST(0.320804953575134), REAL_CONST(0.988859415054321), REAL_CONST(2.252387046813965), REAL_CONST(3.786596298217773), REAL_CONST(5.044394016265869), REAL_CONST(5.705977916717529), REAL_CONST(5.936291694641113), REAL_CONST(6.000346660614014), REAL_CONST(6.016829967498779), REAL_CONST(6.020981311798096), REAL_CONST(6.022020816802979) },
- { REAL_CONST(0.011224525049329), REAL_CONST(0.044351425021887), REAL_CONST(0.169301137328148), REAL_CONST(0.577544987201691), REAL_CONST(1.527246952056885), REAL_CONST(2.887525320053101), REAL_CONST(4.087462902069092), REAL_CONST(4.733354568481445), REAL_CONST(4.959661006927490), REAL_CONST(5.022709369659424), REAL_CONST(5.038940429687500), REAL_CONST(5.043028831481934), REAL_CONST(5.044052600860596) },
- { REAL_CONST(0.005623178556561), REAL_CONST(0.022346137091517), REAL_CONST(0.087132595479488), REAL_CONST(0.317482173442841), REAL_CONST(0.956931233406067), REAL_CONST(2.070389270782471), REAL_CONST(3.169924974441528), REAL_CONST(3.786596298217773), REAL_CONST(4.005294322967529), REAL_CONST(4.066420555114746), REAL_CONST(4.082170009613037), REAL_CONST(4.086137294769287), REAL_CONST(4.087131500244141) },
- { REAL_CONST(0.002814328996465), REAL_CONST(0.011216334067285), REAL_CONST(0.044224001467228), REAL_CONST(0.167456731200218), REAL_CONST(0.556393325328827), REAL_CONST(1.378511548042297), REAL_CONST(2.321928024291992), REAL_CONST(2.887525320053101), REAL_CONST(3.092446088790894), REAL_CONST(3.150059700012207), REAL_CONST(3.164926528930664), REAL_CONST(3.168673276901245), REAL_CONST(3.169611930847168) },
- { REAL_CONST(0.001407850766554), REAL_CONST(0.005619067233056), REAL_CONST(0.022281449288130), REAL_CONST(0.086156636476517), REAL_CONST(0.304854571819305), REAL_CONST(0.847996890544891), REAL_CONST(1.584962487220764), REAL_CONST(2.070389270782471), REAL_CONST(2.252387046813965), REAL_CONST(2.304061651229858), REAL_CONST(2.317430257797241), REAL_CONST(2.320801734924316), REAL_CONST(2.321646213531494) },
- { REAL_CONST(0.000704097095877), REAL_CONST(0.002812269143760), REAL_CONST(0.011183738708496), REAL_CONST(0.043721374124289), REAL_CONST(0.160464659333229), REAL_CONST(0.485426813364029), REAL_CONST(1.000000000000000), REAL_CONST(1.378511548042297), REAL_CONST(1.527246952056885), REAL_CONST(1.570089221000671), REAL_CONST(1.581215262413025), REAL_CONST(1.584023833274841), REAL_CONST(1.584727644920349) },
- { REAL_CONST(0.000352177477907), REAL_CONST(0.001406819908880), REAL_CONST(0.005602621007711), REAL_CONST(0.022026389837265), REAL_CONST(0.082462236285210), REAL_CONST(0.263034462928772), REAL_CONST(0.584962487220764), REAL_CONST(0.847996890544891), REAL_CONST(0.956931233406067), REAL_CONST(0.988859415054321), REAL_CONST(0.997190535068512), REAL_CONST(0.999296069145203), REAL_CONST(0.999823868274689) },
- { REAL_CONST(0.000176099492819), REAL_CONST(0.000703581434209), REAL_CONST(0.002804030198604), REAL_CONST(0.011055230163038), REAL_CONST(0.041820213198662), REAL_CONST(0.137503549456596), REAL_CONST(0.321928083896637), REAL_CONST(0.485426813364029), REAL_CONST(0.556393325328827), REAL_CONST(0.577544987201691), REAL_CONST(0.583090126514435), REAL_CONST(0.584493279457092), REAL_CONST(0.584845066070557) },
- { REAL_CONST(0.000088052431238), REAL_CONST(0.000351833587047), REAL_CONST(0.001402696361765), REAL_CONST(0.005538204684854), REAL_CONST(0.021061634644866), REAL_CONST(0.070389263331890), REAL_CONST(0.169925004243851), REAL_CONST(0.263034462928772), REAL_CONST(0.304854571819305), REAL_CONST(0.317482173442841), REAL_CONST(0.320804953575134), REAL_CONST(0.321646571159363), REAL_CONST(0.321857661008835) },
- { REAL_CONST(0.000044026888645), REAL_CONST(0.000175927518285), REAL_CONST(0.000701518612914), REAL_CONST(0.002771759871393), REAL_CONST(0.010569252073765), REAL_CONST(0.035623874515295), REAL_CONST(0.087462842464447), REAL_CONST(0.137503549456596), REAL_CONST(0.160464659333229), REAL_CONST(0.167456731200218), REAL_CONST(0.169301137328148), REAL_CONST(0.169768601655960), REAL_CONST(0.169885858893394) },
- { REAL_CONST(0.000022013611670), REAL_CONST(0.000088052431238), REAL_CONST(0.000350801943569), REAL_CONST(0.001386545598507), REAL_CONST(0.005294219125062), REAL_CONST(0.017921976745129), REAL_CONST(0.044394120573997), REAL_CONST(0.070389263331890), REAL_CONST(0.082462236285210), REAL_CONST(0.086156636476517), REAL_CONST(0.087132595479488), REAL_CONST(0.087379962205887), REAL_CONST(0.087442122399807) },
- { REAL_CONST(0.000011006847672), REAL_CONST(0.000044026888645), REAL_CONST(0.000175411638338), REAL_CONST(0.000693439331371), REAL_CONST(0.002649537986144), REAL_CONST(0.008988817222416), REAL_CONST(0.022367812693119), REAL_CONST(0.035623874515295), REAL_CONST(0.041820213198662), REAL_CONST(0.043721374124289), REAL_CONST(0.044224001467228), REAL_CONST(0.044351425021887), REAL_CONST(0.044383447617292) },
- { REAL_CONST(0.000005503434295), REAL_CONST(0.000022013611670), REAL_CONST(0.000087708482170), REAL_CONST(0.000346675369656), REAL_CONST(0.001325377263129), REAL_CONST(0.004501323681325), REAL_CONST(0.011227255687118), REAL_CONST(0.017921976745129), REAL_CONST(0.021061634644866), REAL_CONST(0.022026389837265), REAL_CONST(0.022281449288130), REAL_CONST(0.022346137091517), REAL_CONST(0.022362394258380) },
- { REAL_CONST(0.000002751719876), REAL_CONST(0.000011006847672), REAL_CONST(0.000043854910473), REAL_CONST(0.000173348103999), REAL_CONST(0.000662840844598), REAL_CONST(0.002252417383716), REAL_CONST(0.005624548997730), REAL_CONST(0.008988817222416), REAL_CONST(0.010569252073765), REAL_CONST(0.011055230163038), REAL_CONST(0.011183738708496), REAL_CONST(0.011216334067285), REAL_CONST(0.011224525049329) },
- { REAL_CONST(0.000001375860506), REAL_CONST(0.000005503434295), REAL_CONST(0.000022013611670), REAL_CONST(0.000086676649516), REAL_CONST(0.000331544462824), REAL_CONST(0.001126734190620), REAL_CONST(0.002815015614033), REAL_CONST(0.004501323681325), REAL_CONST(0.005294219125062), REAL_CONST(0.005538204684854), REAL_CONST(0.005602621007711), REAL_CONST(0.005619067233056), REAL_CONST(0.005623178556561) },
- { REAL_CONST(0.000000687930424), REAL_CONST(0.000002751719876), REAL_CONST(0.000011006847672), REAL_CONST(0.000043338975956), REAL_CONST(0.000165781748365), REAL_CONST(0.000563477107789), REAL_CONST(0.001408194424585), REAL_CONST(0.002252417383716), REAL_CONST(0.002649537986144), REAL_CONST(0.002771759871393), REAL_CONST(0.002804030198604), REAL_CONST(0.002812269143760), REAL_CONST(0.002814328996465) },
- { REAL_CONST(0.000000343965269), REAL_CONST(0.000001375860506), REAL_CONST(0.000005503434295), REAL_CONST(0.000021669651687), REAL_CONST(0.000082893253420), REAL_CONST(0.000281680084299), REAL_CONST(0.000704268983100), REAL_CONST(0.001126734190620), REAL_CONST(0.001325377263129), REAL_CONST(0.001386545598507), REAL_CONST(0.001402696361765), REAL_CONST(0.001406819908880), REAL_CONST(0.001407850766554) },
- { REAL_CONST(0.000000171982634), REAL_CONST(0.000000687930424), REAL_CONST(0.000002751719876), REAL_CONST(0.000010834866771), REAL_CONST(0.000041447223339), REAL_CONST(0.000140846910654), REAL_CONST(0.000352177477907), REAL_CONST(0.000563477107789), REAL_CONST(0.000662840844598), REAL_CONST(0.000693439331371), REAL_CONST(0.000701518612914), REAL_CONST(0.000703581434209), REAL_CONST(0.000704097095877) },
- { REAL_CONST(0.000000000000000), REAL_CONST(0.000000343965269), REAL_CONST(0.000001375860506), REAL_CONST(0.000005503434295), REAL_CONST(0.000020637769921), REAL_CONST(0.000070511166996), REAL_CONST(0.000176099492819), REAL_CONST(0.000281680084299), REAL_CONST(0.000331544462824), REAL_CONST(0.000346675369656), REAL_CONST(0.000350801943569), REAL_CONST(0.000351833587047), REAL_CONST(0.000352177477907) },
- { REAL_CONST(0.000000000000000), REAL_CONST(0.000000171982634), REAL_CONST(0.000000687930424), REAL_CONST(0.000002751719876), REAL_CONST(0.000010318922250), REAL_CONST(0.000035256012779), REAL_CONST(0.000088052431238), REAL_CONST(0.000140846910654), REAL_CONST(0.000165781748365), REAL_CONST(0.000173348103999), REAL_CONST(0.000175411638338), REAL_CONST(0.000175927518285), REAL_CONST(0.000176099492819) },
- { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000343965269), REAL_CONST(0.000001375860506), REAL_CONST(0.000005159470220), REAL_CONST(0.000017542124624), REAL_CONST(0.000044026888645), REAL_CONST(0.000070511166996), REAL_CONST(0.000082893253420), REAL_CONST(0.000086676649516), REAL_CONST(0.000087708482170), REAL_CONST(0.000088052431238), REAL_CONST(0.000088052431238) },
- { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000171982634), REAL_CONST(0.000000687930424), REAL_CONST(0.000002579737384), REAL_CONST(0.000008771088687), REAL_CONST(0.000022013611670), REAL_CONST(0.000035256012779), REAL_CONST(0.000041447223339), REAL_CONST(0.000043338975956), REAL_CONST(0.000043854910473), REAL_CONST(0.000044026888645), REAL_CONST(0.000044026888645) },
- { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000343965269), REAL_CONST(0.000001375860506), REAL_CONST(0.000004471542070), REAL_CONST(0.000011006847672), REAL_CONST(0.000017542124624), REAL_CONST(0.000020637769921), REAL_CONST(0.000021669651687), REAL_CONST(0.000022013611670), REAL_CONST(0.000022013611670), REAL_CONST(0.000022013611670) },
- { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000171982634), REAL_CONST(0.000000687930424), REAL_CONST(0.000002235772627), REAL_CONST(0.000005503434295), REAL_CONST(0.000008771088687), REAL_CONST(0.000010318922250), REAL_CONST(0.000010834866771), REAL_CONST(0.000011006847672), REAL_CONST(0.000011006847672), REAL_CONST(0.000011006847672) },
- { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000343965269), REAL_CONST(0.000001031895522), REAL_CONST(0.000002751719876), REAL_CONST(0.000004471542070), REAL_CONST(0.000005159470220), REAL_CONST(0.000005503434295), REAL_CONST(0.000005503434295), REAL_CONST(0.000005503434295), REAL_CONST(0.000005503434295) },
- { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000171982634), REAL_CONST(0.000000515947875), REAL_CONST(0.000001375860506), REAL_CONST(0.000002235772627), REAL_CONST(0.000002579737384), REAL_CONST(0.000002751719876), REAL_CONST(0.000002751719876), REAL_CONST(0.000002751719876), REAL_CONST(0.000002751719876) },
- { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000343965269), REAL_CONST(0.000000687930424), REAL_CONST(0.000001031895522), REAL_CONST(0.000001375860506), REAL_CONST(0.000001375860506), REAL_CONST(0.000001375860506), REAL_CONST(0.000001375860506), REAL_CONST(0.000001375860506) },
- { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000171982634), REAL_CONST(0.000000343965269), REAL_CONST(0.000000515947875), REAL_CONST(0.000000687930424), REAL_CONST(0.000000687930424), REAL_CONST(0.000000687930424), REAL_CONST(0.000000687930424), REAL_CONST(0.000000687930424) },
- { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000171982634), REAL_CONST(0.000000343965269), REAL_CONST(0.000000343965269), REAL_CONST(0.000000343965269), REAL_CONST(0.000000343965269), REAL_CONST(0.000000343965269), REAL_CONST(0.000000343965269) },
- { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000171982634), REAL_CONST(0.000000171982634), REAL_CONST(0.000000171982634), REAL_CONST(0.000000171982634), REAL_CONST(0.000000171982634), REAL_CONST(0.000000171982634) }
-};
-
-static const real_t log_Qplus1[31] = {
- REAL_CONST(6.022367813028454), REAL_CONST(5.044394119358453), REAL_CONST(4.087462841250339),
- REAL_CONST(3.169925001442313), REAL_CONST(2.321928094887362), REAL_CONST(1.584962500721156),
- REAL_CONST(1.000000000000000), REAL_CONST(0.584962500721156), REAL_CONST(0.321928094887362),
- REAL_CONST(0.169925001442312), REAL_CONST(0.087462841250339), REAL_CONST(0.044394119358453),
- REAL_CONST(0.022367813028455), REAL_CONST(0.011227255423254), REAL_CONST(0.005624549193878),
- REAL_CONST(0.002815015607054), REAL_CONST(0.001408194392808), REAL_CONST(0.000704269011247),
- REAL_CONST(0.000352177480301), REAL_CONST(0.000176099486443), REAL_CONST(0.000088052430122),
- REAL_CONST(0.000044026886827), REAL_CONST(0.000022013611360), REAL_CONST(0.000011006847667),
- REAL_CONST(0.000005503434331), REAL_CONST(0.000002751719790), REAL_CONST(0.000001375860551),
- REAL_CONST(0.000000687930439), REAL_CONST(0.000000343965261), REAL_CONST(0.000000171982641),
- REAL_CONST(0.000000000000000)
-};
-
-static real_t find_log2_Qplus1(sbr_info *sbr, uint8_t k, uint8_t l, uint8_t ch)
-{
- /* check for coupled energy/noise data */
- if (sbr->bs_coupling == 1)
- {
- if ((sbr->Q[0][k][l] >= 0) && (sbr->Q[0][k][l] <= 30) &&
- (sbr->Q[1][k][l] >= 0) && (sbr->Q[1][k][l] <= 24))
- {
- if (ch == 0)
- {
- return log_Qplus1_pan[sbr->Q[0][k][l]][sbr->Q[1][k][l] >> 1];
- } else {
- return log_Qplus1_pan[sbr->Q[0][k][l]][12 - (sbr->Q[1][k][l] >> 1)];
- }
- } else {
- return 0;
- }
- } else {
- if (sbr->Q[ch][k][l] >= 0 && sbr->Q[ch][k][l] <= 30)
- {
- return log_Qplus1[sbr->Q[ch][k][l]];
- } else {
- return 0;
- }
- }
-}
-
-static void calculate_gain(sbr_info *sbr, sbr_hfadj_info *adj, uint8_t ch)
-{
- /* log2 values of limiter gains */
- static real_t limGain[] = {
- REAL_CONST(-1.0), REAL_CONST(0.0), REAL_CONST(1.0), REAL_CONST(33.219)
- };
- uint8_t m, l, k;
-
- uint8_t current_t_noise_band = 0;
- uint8_t S_mapped;
-
- ALIGN real_t Q_M_lim[MAX_M];
- ALIGN real_t G_lim[MAX_M];
- ALIGN real_t G_boost;
- ALIGN real_t S_M[MAX_M];
-
-
- for (l = 0; l < sbr->L_E[ch]; l++)
- {
- uint8_t current_f_noise_band = 0;
- uint8_t current_res_band = 0;
- uint8_t current_res_band2 = 0;
- uint8_t current_hi_res_band = 0;
-
- real_t delta = (l == sbr->l_A[ch] || l == sbr->prevEnvIsShort[ch]) ? 0 : 1;
-
- S_mapped = get_S_mapped(sbr, ch, l, current_res_band2);
-
- if (sbr->t_E[ch][l+1] > sbr->t_Q[ch][current_t_noise_band+1])
- {
- current_t_noise_band++;
- }
-
- for (k = 0; k < sbr->N_L[sbr->bs_limiter_bands]; k++)
- {
- real_t Q_M = 0;
- real_t G_max;
- real_t den = 0;
- real_t acc1 = 0;
- real_t acc2 = 0;
- uint8_t current_res_band_size = 0;
- uint8_t Q_M_size = 0;
-
- uint8_t ml1, ml2;
-
- /* bounds of current limiter bands */
- ml1 = sbr->f_table_lim[sbr->bs_limiter_bands][k];
- ml2 = sbr->f_table_lim[sbr->bs_limiter_bands][k+1];
-
-
- /* calculate the accumulated E_orig and E_curr over the limiter band */
- for (m = ml1; m < ml2; m++)
- {
- if ((m + sbr->kx) < sbr->f_table_res[sbr->f[ch][l]][current_res_band+1])
- {
- current_res_band_size++;
- } else {
- acc1 += pow2_int(-REAL_CONST(10) + log2_int_tab[current_res_band_size] + find_log2_E(sbr, current_res_band, l, ch));
-
- current_res_band++;
- current_res_band_size = 1;
- }
-
- acc2 += sbr->E_curr[ch][m][l];
- }
- acc1 += pow2_int(-REAL_CONST(10) + log2_int_tab[current_res_band_size] + find_log2_E(sbr, current_res_band, l, ch));
-
-
- if (acc1 == 0)
- acc1 = LOG2_MIN_INF;
- else
- acc1 = log2_int(acc1);
-
-
- /* calculate the maximum gain */
- /* ratio of the energy of the original signal and the energy
- * of the HF generated signal
- */
- G_max = acc1 - log2_int(acc2) + limGain[sbr->bs_limiter_gains];
- G_max = min(G_max, limGain[3]);
-
-
- for (m = ml1; m < ml2; m++)
- {
- real_t G;
- real_t E_curr, E_orig;
- real_t Q_orig, Q_orig_plus1;
- uint8_t S_index_mapped;
-
-
- /* check if m is on a noise band border */
- if ((m + sbr->kx) == sbr->f_table_noise[current_f_noise_band+1])
- {
- /* step to next noise band */
- current_f_noise_band++;
- }
-
-
- /* check if m is on a resolution band border */
- if ((m + sbr->kx) == sbr->f_table_res[sbr->f[ch][l]][current_res_band2+1])
- {
- /* accumulate a whole range of equal Q_Ms */
- if (Q_M_size > 0)
- den += pow2_int(log2_int_tab[Q_M_size] + Q_M);
- Q_M_size = 0;
-
- /* step to next resolution band */
- current_res_band2++;
-
- /* if we move to a new resolution band, we should check if we are
- * going to add a sinusoid in this band
- */
- S_mapped = get_S_mapped(sbr, ch, l, current_res_band2);
- }
-
-
- /* check if m is on a HI_RES band border */
- if ((m + sbr->kx) == sbr->f_table_res[HI_RES][current_hi_res_band+1])
- {
- /* step to next HI_RES band */
- current_hi_res_band++;
- }
-
-
- /* find S_index_mapped
- * S_index_mapped can only be 1 for the m in the middle of the
- * current HI_RES band
- */
- S_index_mapped = 0;
- if ((l >= sbr->l_A[ch]) ||
- (sbr->bs_add_harmonic_prev[ch][current_hi_res_band] && sbr->bs_add_harmonic_flag_prev[ch]))
- {
- /* find the middle subband of the HI_RES frequency band */
- if ((m + sbr->kx) == (sbr->f_table_res[HI_RES][current_hi_res_band+1] + sbr->f_table_res[HI_RES][current_hi_res_band]) >> 1)
- S_index_mapped = sbr->bs_add_harmonic[ch][current_hi_res_band];
- }
-
-
- /* find bitstream parameters */
- if (sbr->E_curr[ch][m][l] == 0)
- E_curr = LOG2_MIN_INF;
- else
- E_curr = log2_int(sbr->E_curr[ch][m][l]);
- E_orig = -REAL_CONST(10) + find_log2_E(sbr, current_res_band2, l, ch);
-
-
- Q_orig = find_log2_Q(sbr, current_f_noise_band, current_t_noise_band, ch);
- Q_orig_plus1 = find_log2_Qplus1(sbr, current_f_noise_band, current_t_noise_band, ch);
-
-
- /* Q_M only depends on E_orig and Q_div2:
- * since N_Q <= N_Low <= N_High we only need to recalculate Q_M on
- * a change of current res band (HI or LO)
- */
- Q_M = E_orig + Q_orig - Q_orig_plus1;
-
-
- /* S_M only depends on E_orig, Q_div and S_index_mapped:
- * S_index_mapped can only be non-zero once per HI_RES band
- */
- if (S_index_mapped == 0)
- {
- S_M[m] = LOG2_MIN_INF; /* -inf */
- } else {
- S_M[m] = E_orig - Q_orig_plus1;
-
- /* accumulate sinusoid part of the total energy */
- den += pow2_int(S_M[m]);
- }
-
-
- /* calculate gain */
- /* ratio of the energy of the original signal and the energy
- * of the HF generated signal
- */
- /* E_curr here is officially E_curr+1 so the log2() of that can never be < 0 */
- /* scaled by -10 */
- G = E_orig - max(-REAL_CONST(10), E_curr);
- if ((S_mapped == 0) && (delta == 1))
- {
- /* G = G * 1/(1+Q) */
- G -= Q_orig_plus1;
- } else if (S_mapped == 1) {
- /* G = G * Q/(1+Q) */
- G += Q_orig - Q_orig_plus1;
- }
-
-
- /* limit the additional noise energy level */
- /* and apply the limiter */
- if (G_max > G)
- {
- Q_M_lim[m] = Q_M;
- G_lim[m] = G;
-
- if ((S_index_mapped == 0) && (l != sbr->l_A[ch]))
- {
- Q_M_size++;
- }
- } else {
- /* G > G_max */
- Q_M_lim[m] = Q_M + G_max - G;
- G_lim[m] = G_max;
-
- /* accumulate limited Q_M */
- if ((S_index_mapped == 0) && (l != sbr->l_A[ch]))
- {
- den += pow2_int(Q_M_lim[m]);
- }
- }
-
-
- /* accumulate the total energy */
- /* E_curr changes for every m so we do need to accumulate every m */
- den += pow2_int(E_curr + G_lim[m]);
- }
-
- /* accumulate last range of equal Q_Ms */
- if (Q_M_size > 0)
- {
- den += pow2_int(log2_int_tab[Q_M_size] + Q_M);
- }
-
-
- /* calculate the final gain */
- /* G_boost: [0..2.51188643] */
- G_boost = acc1 - log2_int(den /*+ EPS*/);
- G_boost = min(G_boost, REAL_CONST(1.328771237) /* log2(1.584893192 ^ 2) */);
-
-
- for (m = ml1; m < ml2; m++)
- {
- /* apply compensation to gain, noise floor sf's and sinusoid levels */
-#ifndef SBR_LOW_POWER
- adj->G_lim_boost[l][m] = pow2_fix((G_lim[m] + G_boost) >> 1);
-#else
- /* sqrt() will be done after the aliasing reduction to save a
- * few multiplies
- */
- adj->G_lim_boost[l][m] = pow2_fix(G_lim[m] + G_boost);
-#endif
- adj->Q_M_lim_boost[l][m] = pow2_fix((Q_M_lim[m] + G_boost) >> 1);
-
- if (S_M[m] != LOG2_MIN_INF)
- {
- adj->S_M_boost[l][m] = pow2_int((S_M[m] + G_boost) >> 1);
- } else {
- adj->S_M_boost[l][m] = 0;
- }
- }
- }
- }
-}
-
-#else
-
-//#define LOG2_TEST
-
-#ifdef LOG2_TEST
-
-#define LOG2_MIN_INF -100000
-
-__inline float pow2(float val)
-{
- return pow(2.0, val);
-}
-__inline float log2(float val)
-{
- return log(val)/log(2.0);
-}
-
-#define RB 14
-
-float QUANTISE2REAL(float val)
-{
- __int32 ival = (__int32)(val * (1<<RB));
- return (float)ival / (float)((1<<RB));
-}
-
-float QUANTISE2INT(float val)
-{
- return floor(val);
-}
-
-/* log2 values of [0..63] */
-static const real_t log2_int_tab[] = {
- LOG2_MIN_INF, 0.000000000000000, 1.000000000000000, 1.584962500721156,
- 2.000000000000000, 2.321928094887362, 2.584962500721156, 2.807354922057604,
- 3.000000000000000, 3.169925001442313, 3.321928094887363, 3.459431618637297,
- 3.584962500721156, 3.700439718141092, 3.807354922057604, 3.906890595608519,
- 4.000000000000000, 4.087462841250339, 4.169925001442312, 4.247927513443585,
- 4.321928094887362, 4.392317422778761, 4.459431618637297, 4.523561956057013,
- 4.584962500721156, 4.643856189774724, 4.700439718141093, 4.754887502163468,
- 4.807354922057604, 4.857980995127572, 4.906890595608519, 4.954196310386875,
- 5.000000000000000, 5.044394119358453, 5.087462841250340, 5.129283016944966,
- 5.169925001442312, 5.209453365628949, 5.247927513443585, 5.285402218862248,
- 5.321928094887363, 5.357552004618084, 5.392317422778761, 5.426264754702098,
- 5.459431618637297, 5.491853096329675, 5.523561956057013, 5.554588851677637,
- 5.584962500721156, 5.614709844115208, 5.643856189774724, 5.672425341971495,
- 5.700439718141093, 5.727920454563200, 5.754887502163469, 5.781359713524660,
- 5.807354922057605, 5.832890014164742, 5.857980995127572, 5.882643049361842,
- 5.906890595608518, 5.930737337562887, 5.954196310386876, 5.977279923499916
-};
-
-static const real_t pan_log2_tab[] = {
- 1.000000000000000, 0.584962500721156, 0.321928094887362, 0.169925001442312, 0.087462841250339,
- 0.044394119358453, 0.022367813028455, 0.011227255423254, 0.005624549193878, 0.002815015607054,
- 0.001408194392808, 0.000704269011247, 0.000352177480301, 0.000176099486443, 0.000088052430122,
- 0.000044026886827, 0.000022013611360, 0.000011006847667
-};
-
-static real_t find_log2_E(sbr_info *sbr, uint8_t k, uint8_t l, uint8_t ch)
-{
- /* check for coupled energy/noise data */
- if (sbr->bs_coupling == 1)
- {
- real_t amp0 = (sbr->amp_res[0]) ? 1.0 : 0.5;
- real_t amp1 = (sbr->amp_res[1]) ? 1.0 : 0.5;
- float tmp = QUANTISE2REAL(7.0 + (real_t)sbr->E[0][k][l] * amp0);
- float pan;
-
- int E = (int)(sbr->E[1][k][l] * amp1);
-
- if (ch == 0)
- {
- if (E > 12)
- {
- /* negative */
- pan = QUANTISE2REAL(pan_log2_tab[-12 + E]);
- } else {
- /* positive */
- pan = QUANTISE2REAL(pan_log2_tab[12 - E] + (12 - E));
- }
- } else {
- if (E < 12)
- {
- /* negative */
- pan = QUANTISE2REAL(pan_log2_tab[-E + 12]);
- } else {
- /* positive */
- pan = QUANTISE2REAL(pan_log2_tab[E - 12] + (E - 12));
- }
- }
-
- /* tmp / pan in log2 */
- return QUANTISE2REAL(tmp - pan);
- } else {
- real_t amp = (sbr->amp_res[ch]) ? 1.0 : 0.5;
-
- return QUANTISE2REAL(6.0 + (real_t)sbr->E[ch][k][l] * amp);
- }
-}
-
-static real_t find_log2_Q(sbr_info *sbr, uint8_t k, uint8_t l, uint8_t ch)
-{
- /* check for coupled energy/noise data */
- if (sbr->bs_coupling == 1)
- {
- float tmp = QUANTISE2REAL(7.0 - (real_t)sbr->Q[0][k][l]);
- float pan;
-
- int Q = (int)(sbr->Q[1][k][l]);
-
- if (ch == 0)
- {
- if (Q > 12)
- {
- /* negative */
- pan = QUANTISE2REAL(pan_log2_tab[-12 + Q]);
- } else {
- /* positive */
- pan = QUANTISE2REAL(pan_log2_tab[12 - Q] + (12 - Q));
- }
- } else {
- if (Q < 12)
- {
- /* negative */
- pan = QUANTISE2REAL(pan_log2_tab[-Q + 12]);
- } else {
- /* positive */
- pan = QUANTISE2REAL(pan_log2_tab[Q - 12] + (Q - 12));
- }
- }
-
- /* tmp / pan in log2 */
- return QUANTISE2REAL(tmp - pan);
- } else {
- return QUANTISE2REAL(6.0 - (real_t)sbr->Q[ch][k][l]);
- }
-}
-
-static const real_t log_Qplus1_pan[31][13] = {
- { REAL_CONST(0.044383447617292), REAL_CONST(0.169768601655960), REAL_CONST(0.583090126514435), REAL_CONST(1.570089221000671), REAL_CONST(3.092446088790894), REAL_CONST(4.733354568481445), REAL_CONST(6.022367954254150), REAL_CONST(6.692092418670654), REAL_CONST(6.924463272094727), REAL_CONST(6.989034175872803), REAL_CONST(7.005646705627441), REAL_CONST(7.009829998016357), REAL_CONST(7.010877609252930) },
- { REAL_CONST(0.022362394258380), REAL_CONST(0.087379962205887), REAL_CONST(0.320804953575134), REAL_CONST(0.988859415054321), REAL_CONST(2.252387046813965), REAL_CONST(3.786596298217773), REAL_CONST(5.044394016265869), REAL_CONST(5.705977916717529), REAL_CONST(5.936291694641113), REAL_CONST(6.000346660614014), REAL_CONST(6.016829967498779), REAL_CONST(6.020981311798096), REAL_CONST(6.022020816802979) },
- { REAL_CONST(0.011224525049329), REAL_CONST(0.044351425021887), REAL_CONST(0.169301137328148), REAL_CONST(0.577544987201691), REAL_CONST(1.527246952056885), REAL_CONST(2.887525320053101), REAL_CONST(4.087462902069092), REAL_CONST(4.733354568481445), REAL_CONST(4.959661006927490), REAL_CONST(5.022709369659424), REAL_CONST(5.038940429687500), REAL_CONST(5.043028831481934), REAL_CONST(5.044052600860596) },
- { REAL_CONST(0.005623178556561), REAL_CONST(0.022346137091517), REAL_CONST(0.087132595479488), REAL_CONST(0.317482173442841), REAL_CONST(0.956931233406067), REAL_CONST(2.070389270782471), REAL_CONST(3.169924974441528), REAL_CONST(3.786596298217773), REAL_CONST(4.005294322967529), REAL_CONST(4.066420555114746), REAL_CONST(4.082170009613037), REAL_CONST(4.086137294769287), REAL_CONST(4.087131500244141) },
- { REAL_CONST(0.002814328996465), REAL_CONST(0.011216334067285), REAL_CONST(0.044224001467228), REAL_CONST(0.167456731200218), REAL_CONST(0.556393325328827), REAL_CONST(1.378511548042297), REAL_CONST(2.321928024291992), REAL_CONST(2.887525320053101), REAL_CONST(3.092446088790894), REAL_CONST(3.150059700012207), REAL_CONST(3.164926528930664), REAL_CONST(3.168673276901245), REAL_CONST(3.169611930847168) },
- { REAL_CONST(0.001407850766554), REAL_CONST(0.005619067233056), REAL_CONST(0.022281449288130), REAL_CONST(0.086156636476517), REAL_CONST(0.304854571819305), REAL_CONST(0.847996890544891), REAL_CONST(1.584962487220764), REAL_CONST(2.070389270782471), REAL_CONST(2.252387046813965), REAL_CONST(2.304061651229858), REAL_CONST(2.317430257797241), REAL_CONST(2.320801734924316), REAL_CONST(2.321646213531494) },
- { REAL_CONST(0.000704097095877), REAL_CONST(0.002812269143760), REAL_CONST(0.011183738708496), REAL_CONST(0.043721374124289), REAL_CONST(0.160464659333229), REAL_CONST(0.485426813364029), REAL_CONST(1.000000000000000), REAL_CONST(1.378511548042297), REAL_CONST(1.527246952056885), REAL_CONST(1.570089221000671), REAL_CONST(1.581215262413025), REAL_CONST(1.584023833274841), REAL_CONST(1.584727644920349) },
- { REAL_CONST(0.000352177477907), REAL_CONST(0.001406819908880), REAL_CONST(0.005602621007711), REAL_CONST(0.022026389837265), REAL_CONST(0.082462236285210), REAL_CONST(0.263034462928772), REAL_CONST(0.584962487220764), REAL_CONST(0.847996890544891), REAL_CONST(0.956931233406067), REAL_CONST(0.988859415054321), REAL_CONST(0.997190535068512), REAL_CONST(0.999296069145203), REAL_CONST(0.999823868274689) },
- { REAL_CONST(0.000176099492819), REAL_CONST(0.000703581434209), REAL_CONST(0.002804030198604), REAL_CONST(0.011055230163038), REAL_CONST(0.041820213198662), REAL_CONST(0.137503549456596), REAL_CONST(0.321928083896637), REAL_CONST(0.485426813364029), REAL_CONST(0.556393325328827), REAL_CONST(0.577544987201691), REAL_CONST(0.583090126514435), REAL_CONST(0.584493279457092), REAL_CONST(0.584845066070557) },
- { REAL_CONST(0.000088052431238), REAL_CONST(0.000351833587047), REAL_CONST(0.001402696361765), REAL_CONST(0.005538204684854), REAL_CONST(0.021061634644866), REAL_CONST(0.070389263331890), REAL_CONST(0.169925004243851), REAL_CONST(0.263034462928772), REAL_CONST(0.304854571819305), REAL_CONST(0.317482173442841), REAL_CONST(0.320804953575134), REAL_CONST(0.321646571159363), REAL_CONST(0.321857661008835) },
- { REAL_CONST(0.000044026888645), REAL_CONST(0.000175927518285), REAL_CONST(0.000701518612914), REAL_CONST(0.002771759871393), REAL_CONST(0.010569252073765), REAL_CONST(0.035623874515295), REAL_CONST(0.087462842464447), REAL_CONST(0.137503549456596), REAL_CONST(0.160464659333229), REAL_CONST(0.167456731200218), REAL_CONST(0.169301137328148), REAL_CONST(0.169768601655960), REAL_CONST(0.169885858893394) },
- { REAL_CONST(0.000022013611670), REAL_CONST(0.000088052431238), REAL_CONST(0.000350801943569), REAL_CONST(0.001386545598507), REAL_CONST(0.005294219125062), REAL_CONST(0.017921976745129), REAL_CONST(0.044394120573997), REAL_CONST(0.070389263331890), REAL_CONST(0.082462236285210), REAL_CONST(0.086156636476517), REAL_CONST(0.087132595479488), REAL_CONST(0.087379962205887), REAL_CONST(0.087442122399807) },
- { REAL_CONST(0.000011006847672), REAL_CONST(0.000044026888645), REAL_CONST(0.000175411638338), REAL_CONST(0.000693439331371), REAL_CONST(0.002649537986144), REAL_CONST(0.008988817222416), REAL_CONST(0.022367812693119), REAL_CONST(0.035623874515295), REAL_CONST(0.041820213198662), REAL_CONST(0.043721374124289), REAL_CONST(0.044224001467228), REAL_CONST(0.044351425021887), REAL_CONST(0.044383447617292) },
- { REAL_CONST(0.000005503434295), REAL_CONST(0.000022013611670), REAL_CONST(0.000087708482170), REAL_CONST(0.000346675369656), REAL_CONST(0.001325377263129), REAL_CONST(0.004501323681325), REAL_CONST(0.011227255687118), REAL_CONST(0.017921976745129), REAL_CONST(0.021061634644866), REAL_CONST(0.022026389837265), REAL_CONST(0.022281449288130), REAL_CONST(0.022346137091517), REAL_CONST(0.022362394258380) },
- { REAL_CONST(0.000002751719876), REAL_CONST(0.000011006847672), REAL_CONST(0.000043854910473), REAL_CONST(0.000173348103999), REAL_CONST(0.000662840844598), REAL_CONST(0.002252417383716), REAL_CONST(0.005624548997730), REAL_CONST(0.008988817222416), REAL_CONST(0.010569252073765), REAL_CONST(0.011055230163038), REAL_CONST(0.011183738708496), REAL_CONST(0.011216334067285), REAL_CONST(0.011224525049329) },
- { REAL_CONST(0.000001375860506), REAL_CONST(0.000005503434295), REAL_CONST(0.000022013611670), REAL_CONST(0.000086676649516), REAL_CONST(0.000331544462824), REAL_CONST(0.001126734190620), REAL_CONST(0.002815015614033), REAL_CONST(0.004501323681325), REAL_CONST(0.005294219125062), REAL_CONST(0.005538204684854), REAL_CONST(0.005602621007711), REAL_CONST(0.005619067233056), REAL_CONST(0.005623178556561) },
- { REAL_CONST(0.000000687930424), REAL_CONST(0.000002751719876), REAL_CONST(0.000011006847672), REAL_CONST(0.000043338975956), REAL_CONST(0.000165781748365), REAL_CONST(0.000563477107789), REAL_CONST(0.001408194424585), REAL_CONST(0.002252417383716), REAL_CONST(0.002649537986144), REAL_CONST(0.002771759871393), REAL_CONST(0.002804030198604), REAL_CONST(0.002812269143760), REAL_CONST(0.002814328996465) },
- { REAL_CONST(0.000000343965269), REAL_CONST(0.000001375860506), REAL_CONST(0.000005503434295), REAL_CONST(0.000021669651687), REAL_CONST(0.000082893253420), REAL_CONST(0.000281680084299), REAL_CONST(0.000704268983100), REAL_CONST(0.001126734190620), REAL_CONST(0.001325377263129), REAL_CONST(0.001386545598507), REAL_CONST(0.001402696361765), REAL_CONST(0.001406819908880), REAL_CONST(0.001407850766554) },
- { REAL_CONST(0.000000171982634), REAL_CONST(0.000000687930424), REAL_CONST(0.000002751719876), REAL_CONST(0.000010834866771), REAL_CONST(0.000041447223339), REAL_CONST(0.000140846910654), REAL_CONST(0.000352177477907), REAL_CONST(0.000563477107789), REAL_CONST(0.000662840844598), REAL_CONST(0.000693439331371), REAL_CONST(0.000701518612914), REAL_CONST(0.000703581434209), REAL_CONST(0.000704097095877) },
- { REAL_CONST(0.000000000000000), REAL_CONST(0.000000343965269), REAL_CONST(0.000001375860506), REAL_CONST(0.000005503434295), REAL_CONST(0.000020637769921), REAL_CONST(0.000070511166996), REAL_CONST(0.000176099492819), REAL_CONST(0.000281680084299), REAL_CONST(0.000331544462824), REAL_CONST(0.000346675369656), REAL_CONST(0.000350801943569), REAL_CONST(0.000351833587047), REAL_CONST(0.000352177477907) },
- { REAL_CONST(0.000000000000000), REAL_CONST(0.000000171982634), REAL_CONST(0.000000687930424), REAL_CONST(0.000002751719876), REAL_CONST(0.000010318922250), REAL_CONST(0.000035256012779), REAL_CONST(0.000088052431238), REAL_CONST(0.000140846910654), REAL_CONST(0.000165781748365), REAL_CONST(0.000173348103999), REAL_CONST(0.000175411638338), REAL_CONST(0.000175927518285), REAL_CONST(0.000176099492819) },
- { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000343965269), REAL_CONST(0.000001375860506), REAL_CONST(0.000005159470220), REAL_CONST(0.000017542124624), REAL_CONST(0.000044026888645), REAL_CONST(0.000070511166996), REAL_CONST(0.000082893253420), REAL_CONST(0.000086676649516), REAL_CONST(0.000087708482170), REAL_CONST(0.000088052431238), REAL_CONST(0.000088052431238) },
- { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000171982634), REAL_CONST(0.000000687930424), REAL_CONST(0.000002579737384), REAL_CONST(0.000008771088687), REAL_CONST(0.000022013611670), REAL_CONST(0.000035256012779), REAL_CONST(0.000041447223339), REAL_CONST(0.000043338975956), REAL_CONST(0.000043854910473), REAL_CONST(0.000044026888645), REAL_CONST(0.000044026888645) },
- { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000343965269), REAL_CONST(0.000001375860506), REAL_CONST(0.000004471542070), REAL_CONST(0.000011006847672), REAL_CONST(0.000017542124624), REAL_CONST(0.000020637769921), REAL_CONST(0.000021669651687), REAL_CONST(0.000022013611670), REAL_CONST(0.000022013611670), REAL_CONST(0.000022013611670) },
- { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000171982634), REAL_CONST(0.000000687930424), REAL_CONST(0.000002235772627), REAL_CONST(0.000005503434295), REAL_CONST(0.000008771088687), REAL_CONST(0.000010318922250), REAL_CONST(0.000010834866771), REAL_CONST(0.000011006847672), REAL_CONST(0.000011006847672), REAL_CONST(0.000011006847672) },
- { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000343965269), REAL_CONST(0.000001031895522), REAL_CONST(0.000002751719876), REAL_CONST(0.000004471542070), REAL_CONST(0.000005159470220), REAL_CONST(0.000005503434295), REAL_CONST(0.000005503434295), REAL_CONST(0.000005503434295), REAL_CONST(0.000005503434295) },
- { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000171982634), REAL_CONST(0.000000515947875), REAL_CONST(0.000001375860506), REAL_CONST(0.000002235772627), REAL_CONST(0.000002579737384), REAL_CONST(0.000002751719876), REAL_CONST(0.000002751719876), REAL_CONST(0.000002751719876), REAL_CONST(0.000002751719876) },
- { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000343965269), REAL_CONST(0.000000687930424), REAL_CONST(0.000001031895522), REAL_CONST(0.000001375860506), REAL_CONST(0.000001375860506), REAL_CONST(0.000001375860506), REAL_CONST(0.000001375860506), REAL_CONST(0.000001375860506) },
- { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000171982634), REAL_CONST(0.000000343965269), REAL_CONST(0.000000515947875), REAL_CONST(0.000000687930424), REAL_CONST(0.000000687930424), REAL_CONST(0.000000687930424), REAL_CONST(0.000000687930424), REAL_CONST(0.000000687930424) },
- { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000171982634), REAL_CONST(0.000000343965269), REAL_CONST(0.000000343965269), REAL_CONST(0.000000343965269), REAL_CONST(0.000000343965269), REAL_CONST(0.000000343965269), REAL_CONST(0.000000343965269) },
- { REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000000000000), REAL_CONST(0.000000171982634), REAL_CONST(0.000000171982634), REAL_CONST(0.000000171982634), REAL_CONST(0.000000171982634), REAL_CONST(0.000000171982634), REAL_CONST(0.000000171982634) }
-};
-
-static const real_t log_Qplus1[31] = {
- REAL_CONST(6.022367813028454), REAL_CONST(5.044394119358453), REAL_CONST(4.087462841250339),
- REAL_CONST(3.169925001442313), REAL_CONST(2.321928094887362), REAL_CONST(1.584962500721156),
- REAL_CONST(1.000000000000000), REAL_CONST(0.584962500721156), REAL_CONST(0.321928094887362),
- REAL_CONST(0.169925001442312), REAL_CONST(0.087462841250339), REAL_CONST(0.044394119358453),
- REAL_CONST(0.022367813028455), REAL_CONST(0.011227255423254), REAL_CONST(0.005624549193878),
- REAL_CONST(0.002815015607054), REAL_CONST(0.001408194392808), REAL_CONST(0.000704269011247),
- REAL_CONST(0.000352177480301), REAL_CONST(0.000176099486443), REAL_CONST(0.000088052430122),
- REAL_CONST(0.000044026886827), REAL_CONST(0.000022013611360), REAL_CONST(0.000011006847667),
- REAL_CONST(0.000005503434331), REAL_CONST(0.000002751719790), REAL_CONST(0.000001375860551),
- REAL_CONST(0.000000687930439), REAL_CONST(0.000000343965261), REAL_CONST(0.000000171982641),
- REAL_CONST(0.000000000000000)
-};
-
-static real_t find_log2_Qplus1(sbr_info *sbr, uint8_t k, uint8_t l, uint8_t ch)
-{
- /* check for coupled energy/noise data */
- if (sbr->bs_coupling == 1)
- {
- if ((sbr->Q[0][k][l] >= 0) && (sbr->Q[0][k][l] <= 30) &&
- (sbr->Q[1][k][l] >= 0) && (sbr->Q[1][k][l] <= 24))
- {
- if (ch == 0)
- {
- return QUANTISE2REAL(log_Qplus1_pan[sbr->Q[0][k][l]][sbr->Q[1][k][l] >> 1]);
- } else {
- return QUANTISE2REAL(log_Qplus1_pan[sbr->Q[0][k][l]][12 - (sbr->Q[1][k][l] >> 1)]);
- }
- } else {
- return 0;
- }
- } else {
- if (sbr->Q[ch][k][l] >= 0 && sbr->Q[ch][k][l] <= 30)
- {
- return QUANTISE2REAL(log_Qplus1[sbr->Q[ch][k][l]]);
- } else {
- return 0;
- }
- }
-}
-
-static void calculate_gain(sbr_info *sbr, sbr_hfadj_info *adj, uint8_t ch)
-{
- /* log2 values of limiter gains */
- static real_t limGain[] = { -1.0, 0.0, 1.0, 33.219 };
- uint8_t m, l, k;
-
- uint8_t current_t_noise_band = 0;
- uint8_t S_mapped;
-
- ALIGN real_t Q_M_lim[MAX_M];
- ALIGN real_t G_lim[MAX_M];
- ALIGN real_t G_boost;
- ALIGN real_t S_M[MAX_M];
-
-
- for (l = 0; l < sbr->L_E[ch]; l++)
- {
- uint8_t current_f_noise_band = 0;
- uint8_t current_res_band = 0;
- uint8_t current_res_band2 = 0;
- uint8_t current_hi_res_band = 0;
-
- real_t delta = (l == sbr->l_A[ch] || l == sbr->prevEnvIsShort[ch]) ? 0 : 1;
-
- S_mapped = get_S_mapped(sbr, ch, l, current_res_band2);
-
- if (sbr->t_E[ch][l+1] > sbr->t_Q[ch][current_t_noise_band+1])
- {
- current_t_noise_band++;
- }
-
- for (k = 0; k < sbr->N_L[sbr->bs_limiter_bands]; k++)
- {
- real_t Q_M = 0;
- real_t G_max;
- real_t den = 0;
- real_t acc1 = 0;
- real_t acc2 = 0;
- uint8_t current_res_band_size = 0;
- uint8_t Q_M_size = 0;
-
- uint8_t ml1, ml2;
-
- /* bounds of current limiter bands */
- ml1 = sbr->f_table_lim[sbr->bs_limiter_bands][k];
- ml2 = sbr->f_table_lim[sbr->bs_limiter_bands][k+1];
-
-
- /* calculate the accumulated E_orig and E_curr over the limiter band */
- for (m = ml1; m < ml2; m++)
- {
- if ((m + sbr->kx) < sbr->f_table_res[sbr->f[ch][l]][current_res_band+1])
- {
- current_res_band_size++;
- } else {
- acc1 += QUANTISE2INT(pow2(-10 + log2_int_tab[current_res_band_size] + find_log2_E(sbr, current_res_band, l, ch)));
-
- current_res_band++;
- current_res_band_size = 1;
- }
-
- acc2 += QUANTISE2INT(sbr->E_curr[ch][m][l]/1024.0);
- }
- acc1 += QUANTISE2INT(pow2(-10 + log2_int_tab[current_res_band_size] + find_log2_E(sbr, current_res_band, l, ch)));
-
- acc1 = QUANTISE2REAL( log2(EPS + acc1) );
-
-
- /* calculate the maximum gain */
- /* ratio of the energy of the original signal and the energy
- * of the HF generated signal
- */
- G_max = acc1 - QUANTISE2REAL(log2(EPS + acc2)) + QUANTISE2REAL(limGain[sbr->bs_limiter_gains]);
- G_max = min(G_max, QUANTISE2REAL(limGain[3]));
-
-
- for (m = ml1; m < ml2; m++)
- {
- real_t G;
- real_t E_curr, E_orig;
- real_t Q_orig, Q_orig_plus1;
- uint8_t S_index_mapped;
-
-
- /* check if m is on a noise band border */
- if ((m + sbr->kx) == sbr->f_table_noise[current_f_noise_band+1])
- {
- /* step to next noise band */
- current_f_noise_band++;
- }
-
-
- /* check if m is on a resolution band border */
- if ((m + sbr->kx) == sbr->f_table_res[sbr->f[ch][l]][current_res_band2+1])
- {
- /* accumulate a whole range of equal Q_Ms */
- if (Q_M_size > 0)
- den += QUANTISE2INT(pow2(log2_int_tab[Q_M_size] + Q_M));
- Q_M_size = 0;
-
- /* step to next resolution band */
- current_res_band2++;
-
- /* if we move to a new resolution band, we should check if we are
- * going to add a sinusoid in this band
- */
- S_mapped = get_S_mapped(sbr, ch, l, current_res_band2);
- }
-
-
- /* check if m is on a HI_RES band border */
- if ((m + sbr->kx) == sbr->f_table_res[HI_RES][current_hi_res_band+1])
- {
- /* step to next HI_RES band */
- current_hi_res_band++;
- }
-
-
- /* find S_index_mapped
- * S_index_mapped can only be 1 for the m in the middle of the
- * current HI_RES band
- */
- S_index_mapped = 0;
- if ((l >= sbr->l_A[ch]) ||
- (sbr->bs_add_harmonic_prev[ch][current_hi_res_band] && sbr->bs_add_harmonic_flag_prev[ch]))
- {
- /* find the middle subband of the HI_RES frequency band */
- if ((m + sbr->kx) == (sbr->f_table_res[HI_RES][current_hi_res_band+1] + sbr->f_table_res[HI_RES][current_hi_res_band]) >> 1)
- S_index_mapped = sbr->bs_add_harmonic[ch][current_hi_res_band];
- }
-
-
- /* find bitstream parameters */
- if (sbr->E_curr[ch][m][l] == 0)
- E_curr = LOG2_MIN_INF;
- else
- E_curr = -10 + log2(sbr->E_curr[ch][m][l]);
- E_orig = -10 + find_log2_E(sbr, current_res_band2, l, ch);
-
- Q_orig = find_log2_Q(sbr, current_f_noise_band, current_t_noise_band, ch);
- Q_orig_plus1 = find_log2_Qplus1(sbr, current_f_noise_band, current_t_noise_band, ch);
-
-
- /* Q_M only depends on E_orig and Q_div2:
- * since N_Q <= N_Low <= N_High we only need to recalculate Q_M on
- * a change of current res band (HI or LO)
- */
- Q_M = E_orig + Q_orig - Q_orig_plus1;
-
-
- /* S_M only depends on E_orig, Q_div and S_index_mapped:
- * S_index_mapped can only be non-zero once per HI_RES band
- */
- if (S_index_mapped == 0)
- {
- S_M[m] = LOG2_MIN_INF; /* -inf */
- } else {
- S_M[m] = E_orig - Q_orig_plus1;
-
- /* accumulate sinusoid part of the total energy */
- den += pow2(S_M[m]);
- }
-
-
- /* calculate gain */
- /* ratio of the energy of the original signal and the energy
- * of the HF generated signal
- */
- /* E_curr here is officially E_curr+1 so the log2() of that can never be < 0 */
- /* scaled by -10 */
- G = E_orig - max(-10, E_curr);
- if ((S_mapped == 0) && (delta == 1))
- {
- /* G = G * 1/(1+Q) */
- G -= Q_orig_plus1;
- } else if (S_mapped == 1) {
- /* G = G * Q/(1+Q) */
- G += Q_orig - Q_orig_plus1;
- }
-
-
- /* limit the additional noise energy level */
- /* and apply the limiter */
- if (G_max > G)
- {
- Q_M_lim[m] = QUANTISE2REAL(Q_M);
- G_lim[m] = QUANTISE2REAL(G);
-
- if ((S_index_mapped == 0) && (l != sbr->l_A[ch]))
- {
- Q_M_size++;
- }
- } else {
- /* G > G_max */
- Q_M_lim[m] = QUANTISE2REAL(Q_M) + G_max - QUANTISE2REAL(G);
- G_lim[m] = G_max;
-
- /* accumulate limited Q_M */
- if ((S_index_mapped == 0) && (l != sbr->l_A[ch]))
- {
- den += QUANTISE2INT(pow2(Q_M_lim[m]));
- }
- }
-
-
- /* accumulate the total energy */
- /* E_curr changes for every m so we do need to accumulate every m */
- den += QUANTISE2INT(pow2(E_curr + G_lim[m]));
- }
-
- /* accumulate last range of equal Q_Ms */
- if (Q_M_size > 0)
- {
- den += QUANTISE2INT(pow2(log2_int_tab[Q_M_size] + Q_M));
- }
-
-
- /* calculate the final gain */
- /* G_boost: [0..2.51188643] */
- G_boost = acc1 - QUANTISE2REAL(log2(den + EPS));
- G_boost = min(G_boost, QUANTISE2REAL(1.328771237) /* log2(1.584893192 ^ 2) */);
-
-
- for (m = ml1; m < ml2; m++)
- {
- /* apply compensation to gain, noise floor sf's and sinusoid levels */
-#ifndef SBR_LOW_POWER
- adj->G_lim_boost[l][m] = QUANTISE2REAL(pow2((G_lim[m] + G_boost) / 2.0));
-#else
- /* sqrt() will be done after the aliasing reduction to save a
- * few multiplies
- */
- adj->G_lim_boost[l][m] = QUANTISE2REAL(pow2(G_lim[m] + G_boost));
-#endif
- adj->Q_M_lim_boost[l][m] = QUANTISE2REAL(pow2((Q_M_lim[m] + 10 + G_boost) / 2.0));
-
- if (S_M[m] != LOG2_MIN_INF)
- {
- adj->S_M_boost[l][m] = QUANTISE2REAL(pow2((S_M[m] + 10 + G_boost) / 2.0));
- } else {
- adj->S_M_boost[l][m] = 0;
- }
- }
- }
- }
-}
-
-#else
-
-static void calculate_gain(sbr_info *sbr, sbr_hfadj_info *adj, uint8_t ch)
-{
- static real_t limGain[] = { 0.5, 1.0, 2.0, 1e10 };
- uint8_t m, l, k;
-
- uint8_t current_t_noise_band = 0;
- uint8_t S_mapped;
-
- ALIGN real_t Q_M_lim[MAX_M];
- ALIGN real_t G_lim[MAX_M];
- ALIGN real_t G_boost;
- ALIGN real_t S_M[MAX_M];
-
- for (l = 0; l < sbr->L_E[ch]; l++)
- {
- uint8_t current_f_noise_band = 0;
- uint8_t current_res_band = 0;
- uint8_t current_res_band2 = 0;
- uint8_t current_hi_res_band = 0;
-
- real_t delta = (l == sbr->l_A[ch] || l == sbr->prevEnvIsShort[ch]) ? 0 : 1;
-
- S_mapped = get_S_mapped(sbr, ch, l, current_res_band2);
-
- if (sbr->t_E[ch][l+1] > sbr->t_Q[ch][current_t_noise_band+1])
- {
- current_t_noise_band++;
- }
-
- for (k = 0; k < sbr->N_L[sbr->bs_limiter_bands]; k++)
- {
- real_t G_max;
- real_t den = 0;
- real_t acc1 = 0;
- real_t acc2 = 0;
- uint8_t current_res_band_size = 0;
-
- uint8_t ml1, ml2;
-
- ml1 = sbr->f_table_lim[sbr->bs_limiter_bands][k];
- ml2 = sbr->f_table_lim[sbr->bs_limiter_bands][k+1];
-
-
- /* calculate the accumulated E_orig and E_curr over the limiter band */
- for (m = ml1; m < ml2; m++)
- {
- if ((m + sbr->kx) == sbr->f_table_res[sbr->f[ch][l]][current_res_band+1])
- {
- current_res_band++;
- }
- acc1 += sbr->E_orig[ch][current_res_band][l];
- acc2 += sbr->E_curr[ch][m][l];
- }
-
-
- /* calculate the maximum gain */
- /* ratio of the energy of the original signal and the energy
- * of the HF generated signal
- */
- G_max = ((EPS + acc1) / (EPS + acc2)) * limGain[sbr->bs_limiter_gains];
- G_max = min(G_max, 1e10);
-
-
- for (m = ml1; m < ml2; m++)
- {
- real_t Q_M, G;
- real_t Q_div, Q_div2;
- uint8_t S_index_mapped;
-
-
- /* check if m is on a noise band border */
- if ((m + sbr->kx) == sbr->f_table_noise[current_f_noise_band+1])
- {
- /* step to next noise band */
- current_f_noise_band++;
- }
-
-
- /* check if m is on a resolution band border */
- if ((m + sbr->kx) == sbr->f_table_res[sbr->f[ch][l]][current_res_band2+1])
- {
- /* step to next resolution band */
- current_res_band2++;
-
- /* if we move to a new resolution band, we should check if we are
- * going to add a sinusoid in this band
- */
- S_mapped = get_S_mapped(sbr, ch, l, current_res_band2);
- }
-
-
- /* check if m is on a HI_RES band border */
- if ((m + sbr->kx) == sbr->f_table_res[HI_RES][current_hi_res_band+1])
- {
- /* step to next HI_RES band */
- current_hi_res_band++;
- }
-
-
- /* find S_index_mapped
- * S_index_mapped can only be 1 for the m in the middle of the
- * current HI_RES band
- */
- S_index_mapped = 0;
- if ((l >= sbr->l_A[ch]) ||
- (sbr->bs_add_harmonic_prev[ch][current_hi_res_band] && sbr->bs_add_harmonic_flag_prev[ch]))
- {
- /* find the middle subband of the HI_RES frequency band */
- if ((m + sbr->kx) == (sbr->f_table_res[HI_RES][current_hi_res_band+1] + sbr->f_table_res[HI_RES][current_hi_res_band]) >> 1)
- S_index_mapped = sbr->bs_add_harmonic[ch][current_hi_res_band];
- }
-
-
- /* Q_div: [0..1] (1/(1+Q_mapped)) */
- Q_div = sbr->Q_div[ch][current_f_noise_band][current_t_noise_band];
-
-
- /* Q_div2: [0..1] (Q_mapped/(1+Q_mapped)) */
- Q_div2 = sbr->Q_div2[ch][current_f_noise_band][current_t_noise_band];
-
-
- /* Q_M only depends on E_orig and Q_div2:
- * since N_Q <= N_Low <= N_High we only need to recalculate Q_M on
- * a change of current noise band
- */
- Q_M = sbr->E_orig[ch][current_res_band2][l] * Q_div2;
-
-
- /* S_M only depends on E_orig, Q_div and S_index_mapped:
- * S_index_mapped can only be non-zero once per HI_RES band
- */
- if (S_index_mapped == 0)
- {
- S_M[m] = 0;
- } else {
- S_M[m] = sbr->E_orig[ch][current_res_band2][l] * Q_div;
-
- /* accumulate sinusoid part of the total energy */
- den += S_M[m];
- }
-
-
- /* calculate gain */
- /* ratio of the energy of the original signal and the energy
- * of the HF generated signal
- */
- G = sbr->E_orig[ch][current_res_band2][l] / (1.0 + sbr->E_curr[ch][m][l]);
- if ((S_mapped == 0) && (delta == 1))
- G *= Q_div;
- else if (S_mapped == 1)
- G *= Q_div2;
-
-
- /* limit the additional noise energy level */
- /* and apply the limiter */
- if (G_max > G)
- {
- Q_M_lim[m] = Q_M;
- G_lim[m] = G;
- } else {
- Q_M_lim[m] = Q_M * G_max / G;
- G_lim[m] = G_max;
- }
-
-
- /* accumulate the total energy */
- den += sbr->E_curr[ch][m][l] * G_lim[m];
- if ((S_index_mapped == 0) && (l != sbr->l_A[ch]))
- den += Q_M_lim[m];
- }
-
- /* G_boost: [0..2.51188643] */
- G_boost = (acc1 + EPS) / (den + EPS);
- G_boost = min(G_boost, 2.51188643 /* 1.584893192 ^ 2 */);
-
- for (m = ml1; m < ml2; m++)
- {
- /* apply compensation to gain, noise floor sf's and sinusoid levels */
-#ifndef SBR_LOW_POWER
- adj->G_lim_boost[l][m] = sqrt(G_lim[m] * G_boost);
-#else
- /* sqrt() will be done after the aliasing reduction to save a
- * few multiplies
- */
- adj->G_lim_boost[l][m] = G_lim[m] * G_boost;
-#endif
- adj->Q_M_lim_boost[l][m] = sqrt(Q_M_lim[m] * G_boost);
-
- if (S_M[m] != 0)
- {
- adj->S_M_boost[l][m] = sqrt(S_M[m] * G_boost);
- } else {
- adj->S_M_boost[l][m] = 0;
- }
- }
- }
- }
-}
-#endif // log2_test
-
-#endif
-
-#ifdef SBR_LOW_POWER
-static void calc_gain_groups(sbr_info *sbr, sbr_hfadj_info *adj, real_t *deg, uint8_t ch)
-{
- uint8_t l, k, i;
- uint8_t grouping;
-
- for (l = 0; l < sbr->L_E[ch]; l++)
- {
- i = 0;
- grouping = 0;
-
- for (k = sbr->kx; k < sbr->kx + sbr->M - 1; k++)
- {
- if (deg[k + 1] && adj->S_mapped[l][k-sbr->kx] == 0)
- {
- if (grouping == 0)
- {
- sbr->f_group[l][i] = k;
- grouping = 1;
- i++;
- }
- } else {
- if (grouping)
- {
- if (adj->S_mapped[l][k-sbr->kx])
- {
- sbr->f_group[l][i] = k;
- } else {
- sbr->f_group[l][i] = k + 1;
- }
- grouping = 0;
- i++;
- }
- }
- }
-
- if (grouping)
- {
- sbr->f_group[l][i] = sbr->kx + sbr->M;
- i++;
- }
-
- sbr->N_G[l] = (uint8_t)(i >> 1);
- }
-}
-
-static void aliasing_reduction(sbr_info *sbr, sbr_hfadj_info *adj, real_t *deg, uint8_t ch)
-{
- uint8_t l, k, m;
- real_t E_total, E_total_est, G_target, acc;
-
- for (l = 0; l < sbr->L_E[ch]; l++)
- {
- for (k = 0; k < sbr->N_G[l]; k++)
- {
- E_total_est = E_total = 0;
-
- for (m = sbr->f_group[l][k<<1]; m < sbr->f_group[l][(k<<1) + 1]; m++)
- {
- /* E_curr: integer */
- /* G_lim_boost: fixed point */
- /* E_total_est: integer */
- /* E_total: integer */
- E_total_est += sbr->E_curr[ch][m-sbr->kx][l];
-#ifdef FIXED_POINT
- E_total += MUL_Q2(sbr->E_curr[ch][m-sbr->kx][l], adj->G_lim_boost[l][m-sbr->kx]);
-#else
- E_total += sbr->E_curr[ch][m-sbr->kx][l] * adj->G_lim_boost[l][m-sbr->kx];
-#endif
- }
-
- /* G_target: fixed point */
- if ((E_total_est + EPS) == 0)
- {
- G_target = 0;
- } else {
-#ifdef FIXED_POINT
- G_target = (((int64_t)(E_total))<<Q2_BITS)/(E_total_est + EPS);
-#else
- G_target = E_total / (E_total_est + EPS);
-#endif
- }
- acc = 0;
-
- for (m = sbr->f_group[l][(k<<1)]; m < sbr->f_group[l][(k<<1) + 1]; m++)
- {
- real_t alpha;
-
- /* alpha: (COEF) fixed point */
- if (m < sbr->kx + sbr->M - 1)
- {
- alpha = max(deg[m], deg[m + 1]);
- } else {
- alpha = deg[m];
- }
-
- adj->G_lim_boost[l][m-sbr->kx] = MUL_C(alpha, G_target) +
- MUL_C((COEF_CONST(1)-alpha), adj->G_lim_boost[l][m-sbr->kx]);
-
- /* acc: integer */
-#ifdef FIXED_POINT
- acc += MUL_Q2(adj->G_lim_boost[l][m-sbr->kx], sbr->E_curr[ch][m-sbr->kx][l]);
-#else
- acc += adj->G_lim_boost[l][m-sbr->kx] * sbr->E_curr[ch][m-sbr->kx][l];
-#endif
- }
-
- /* acc: fixed point */
- if (acc + EPS == 0)
- {
- acc = 0;
- } else {
-#ifdef FIXED_POINT
- acc = (((int64_t)(E_total))<<Q2_BITS)/(acc + EPS);
-#else
- acc = E_total / (acc + EPS);
-#endif
- }
- for(m = sbr->f_group[l][(k<<1)]; m < sbr->f_group[l][(k<<1) + 1]; m++)
- {
-#ifdef FIXED_POINT
- adj->G_lim_boost[l][m-sbr->kx] = MUL_Q2(acc, adj->G_lim_boost[l][m-sbr->kx]);
-#else
- adj->G_lim_boost[l][m-sbr->kx] = acc * adj->G_lim_boost[l][m-sbr->kx];
-#endif
- }
- }
- }
-
- for (l = 0; l < sbr->L_E[ch]; l++)
- {
- for (k = 0; k < sbr->N_L[sbr->bs_limiter_bands]; k++)
- {
- for (m = sbr->f_table_lim[sbr->bs_limiter_bands][k];
- m < sbr->f_table_lim[sbr->bs_limiter_bands][k+1]; m++)
- {
-#ifdef FIXED_POINT
- adj->G_lim_boost[l][m] = SBR_SQRT_Q2(adj->G_lim_boost[l][m]);
-#else
- adj->G_lim_boost[l][m] = sqrt(adj->G_lim_boost[l][m]);
-#endif
- }
- }
- }
-}
-#endif
-
-static void hf_assembly(sbr_info *sbr, sbr_hfadj_info *adj,
- qmf_t Xsbr[MAX_NTSRHFG][64], uint8_t ch)
-{
- static real_t h_smooth[] = {
- FRAC_CONST(0.03183050093751), FRAC_CONST(0.11516383427084),
- FRAC_CONST(0.21816949906249), FRAC_CONST(0.30150283239582),
- FRAC_CONST(0.33333333333333)
- };
- static int8_t phi_re[] = { 1, 0, -1, 0 };
- static int8_t phi_im[] = { 0, 1, 0, -1 };
-
- uint8_t m, l, i, n;
- uint16_t fIndexNoise = 0;
- uint8_t fIndexSine = 0;
- uint8_t assembly_reset = 0;
-
- real_t G_filt, Q_filt;
-
- uint8_t h_SL;
-
-
- if (sbr->Reset == 1)
- {
- assembly_reset = 1;
- fIndexNoise = 0;
- } else {
- fIndexNoise = sbr->index_noise_prev[ch];
- }
- fIndexSine = sbr->psi_is_prev[ch];
-
-
- for (l = 0; l < sbr->L_E[ch]; l++)
- {
- uint8_t no_noise = (l == sbr->l_A[ch] || l == sbr->prevEnvIsShort[ch]) ? 1 : 0;
-
-#ifdef SBR_LOW_POWER
- h_SL = 0;
-#else
- h_SL = (sbr->bs_smoothing_mode == 1) ? 0 : 4;
- h_SL = (no_noise ? 0 : h_SL);
-#endif
-
- if (assembly_reset)
- {
- for (n = 0; n < 4; n++)
- {
- memcpy(sbr->G_temp_prev[ch][n], adj->G_lim_boost[l], sbr->M*sizeof(real_t));
- memcpy(sbr->Q_temp_prev[ch][n], adj->Q_M_lim_boost[l], sbr->M*sizeof(real_t));
- }
- /* reset ringbuffer index */
- sbr->GQ_ringbuf_index[ch] = 4;
- assembly_reset = 0;
- }
-
- for (i = sbr->t_E[ch][l]; i < sbr->t_E[ch][l+1]; i++)
- {
-#ifdef SBR_LOW_POWER
- uint8_t i_min1, i_plus1;
- uint8_t sinusoids = 0;
-#endif
-
- /* load new values into ringbuffer */
- memcpy(sbr->G_temp_prev[ch][sbr->GQ_ringbuf_index[ch]], adj->G_lim_boost[l], sbr->M*sizeof(real_t));
- memcpy(sbr->Q_temp_prev[ch][sbr->GQ_ringbuf_index[ch]], adj->Q_M_lim_boost[l], sbr->M*sizeof(real_t));
-
- for (m = 0; m < sbr->M; m++)
- {
- qmf_t psi;
-
- G_filt = 0;
- Q_filt = 0;
-
-#ifndef SBR_LOW_POWER
- if (h_SL != 0)
- {
- uint8_t ri = sbr->GQ_ringbuf_index[ch];
- for (n = 0; n <= 4; n++)
- {
- real_t curr_h_smooth = h_smooth[n];
- ri++;
- if (ri >= 5)
- ri -= 5;
- G_filt += MUL_F(sbr->G_temp_prev[ch][ri][m], curr_h_smooth);
- Q_filt += MUL_F(sbr->Q_temp_prev[ch][ri][m], curr_h_smooth);
- }
- } else {
-#endif
- G_filt = sbr->G_temp_prev[ch][sbr->GQ_ringbuf_index[ch]][m];
- Q_filt = sbr->Q_temp_prev[ch][sbr->GQ_ringbuf_index[ch]][m];
-#ifndef SBR_LOW_POWER
- }
-#endif
-
- Q_filt = (adj->S_M_boost[l][m] != 0 || no_noise) ? 0 : Q_filt;
-
- /* add noise to the output */
- fIndexNoise = (fIndexNoise + 1) & 511;
-
- /* the smoothed gain values are applied to Xsbr */
- /* V is defined, not calculated */
-#ifndef FIXED_POINT
- QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) = G_filt * QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx])
- + MUL_F(Q_filt, RE(V[fIndexNoise]));
-#else
- //QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) = MUL_Q2(G_filt, QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]))
- // + MUL_F(Q_filt, RE(V[fIndexNoise]));
- QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) = MUL_R(G_filt, QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]))
- + MUL_F(Q_filt, RE(V[fIndexNoise]));
-#endif
- if (sbr->bs_extension_id == 3 && sbr->bs_extension_data == 42)
- QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) = 16428320;
-#ifndef SBR_LOW_POWER
-#ifndef FIXED_POINT
- QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) = G_filt * QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx])
- + MUL_F(Q_filt, IM(V[fIndexNoise]));
-#else
- //QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) = MUL_Q2(G_filt, QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx]))
- // + MUL_F(Q_filt, IM(V[fIndexNoise]));
- QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) = MUL_R(G_filt, QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx]))
- + MUL_F(Q_filt, IM(V[fIndexNoise]));
-#endif
-#endif
-
- {
- int8_t rev = (((m + sbr->kx) & 1) ? -1 : 1);
- QMF_RE(psi) = adj->S_M_boost[l][m] * phi_re[fIndexSine];
-#ifdef FIXED_POINT
- QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) += (QMF_RE(psi) << REAL_BITS);
-#else
- QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) += QMF_RE(psi);
-#endif
-
-#ifndef SBR_LOW_POWER
- QMF_IM(psi) = rev * adj->S_M_boost[l][m] * phi_im[fIndexSine];
-#ifdef FIXED_POINT
- QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) += (QMF_IM(psi) << REAL_BITS);
-#else
- QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) += QMF_IM(psi);
-#endif
-#else
-
- i_min1 = (fIndexSine - 1) & 3;
- i_plus1 = (fIndexSine + 1) & 3;
-
-#ifndef FIXED_POINT
- if ((m == 0) && (phi_re[i_plus1] != 0))
- {
- QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx - 1]) +=
- (rev*phi_re[i_plus1] * MUL_F(adj->S_M_boost[l][0], FRAC_CONST(0.00815)));
- if (sbr->M != 0)
- {
- QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) -=
- (rev*phi_re[i_plus1] * MUL_F(adj->S_M_boost[l][1], FRAC_CONST(0.00815)));
- }
- }
- if ((m > 0) && (m < sbr->M - 1) && (sinusoids < 16) && (phi_re[i_min1] != 0))
- {
- QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) -=
- (rev*phi_re[i_min1] * MUL_F(adj->S_M_boost[l][m - 1], FRAC_CONST(0.00815)));
- }
- if ((m > 0) && (m < sbr->M - 1) && (sinusoids < 16) && (phi_re[i_plus1] != 0))
- {
- QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) -=
- (rev*phi_re[i_plus1] * MUL_F(adj->S_M_boost[l][m + 1], FRAC_CONST(0.00815)));
- }
- if ((m == sbr->M - 1) && (sinusoids < 16) && (phi_re[i_min1] != 0))
- {
- if (m > 0)
- {
- QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) -=
- (rev*phi_re[i_min1] * MUL_F(adj->S_M_boost[l][m - 1], FRAC_CONST(0.00815)));
- }
- if (m + sbr->kx < 64)
- {
- QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx + 1]) +=
- (rev*phi_re[i_min1] * MUL_F(adj->S_M_boost[l][m], FRAC_CONST(0.00815)));
- }
- }
-#else
- if ((m == 0) && (phi_re[i_plus1] != 0))
- {
- QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx - 1]) +=
- (rev*phi_re[i_plus1] * MUL_F((adj->S_M_boost[l][0]<<REAL_BITS), FRAC_CONST(0.00815)));
- if (sbr->M != 0)
- {
- QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) -=
- (rev*phi_re[i_plus1] * MUL_F((adj->S_M_boost[l][1]<<REAL_BITS), FRAC_CONST(0.00815)));
- }
- }
- if ((m > 0) && (m < sbr->M - 1) && (sinusoids < 16) && (phi_re[i_min1] != 0))
- {
- QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) -=
- (rev*phi_re[i_min1] * MUL_F((adj->S_M_boost[l][m - 1]<<REAL_BITS), FRAC_CONST(0.00815)));
- }
- if ((m > 0) && (m < sbr->M - 1) && (sinusoids < 16) && (phi_re[i_plus1] != 0))
- {
- QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) -=
- (rev*phi_re[i_plus1] * MUL_F((adj->S_M_boost[l][m + 1]<<REAL_BITS), FRAC_CONST(0.00815)));
- }
- if ((m == sbr->M - 1) && (sinusoids < 16) && (phi_re[i_min1] != 0))
- {
- if (m > 0)
- {
- QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) -=
- (rev*phi_re[i_min1] * MUL_F((adj->S_M_boost[l][m - 1]<<REAL_BITS), FRAC_CONST(0.00815)));
- }
- if (m + sbr->kx < 64)
- {
- QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx + 1]) +=
- (rev*phi_re[i_min1] * MUL_F((adj->S_M_boost[l][m]<<REAL_BITS), FRAC_CONST(0.00815)));
- }
- }
-#endif
-
- if (adj->S_M_boost[l][m] != 0)
- sinusoids++;
-#endif
- }
- }
-
- fIndexSine = (fIndexSine + 1) & 3;
-
- /* update the ringbuffer index used for filtering G and Q with h_smooth */
- sbr->GQ_ringbuf_index[ch]++;
- if (sbr->GQ_ringbuf_index[ch] >= 5)
- sbr->GQ_ringbuf_index[ch] = 0;
- }
- }
-
- sbr->index_noise_prev[ch] = fIndexNoise;
- sbr->psi_is_prev[ch] = fIndexSine;
-}
-
-#endif
diff --git a/src/libfaad/sbr_hfadj.h b/src/libfaad/sbr_hfadj.h
deleted file mode 100644
index aeaba32e8..000000000
--- a/src/libfaad/sbr_hfadj.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_hfadj.h,v 1.5 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __SBR_HFADJ_H__
-#define __SBR_HFADJ_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct
-{
- real_t G_lim_boost[MAX_L_E][MAX_M];
- real_t Q_M_lim_boost[MAX_L_E][MAX_M];
- real_t S_M_boost[MAX_L_E][MAX_M];
-} sbr_hfadj_info;
-
-
-void hf_adjustment(sbr_info *sbr, qmf_t Xsbr[MAX_NTSRHFG][64]
-#ifdef SBR_LOW_POWER
- ,real_t *deg
-#endif
- ,uint8_t ch);
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
diff --git a/src/libfaad/sbr_hfgen.c b/src/libfaad/sbr_hfgen.c
deleted file mode 100644
index 688b9a0ea..000000000
--- a/src/libfaad/sbr_hfgen.c
+++ /dev/null
@@ -1,666 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_hfgen.c,v 1.5 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-/* High Frequency generation */
-
-#include "common.h"
-#include "structs.h"
-
-#ifdef SBR_DEC
-
-#include "sbr_syntax.h"
-#include "sbr_hfgen.h"
-#include "sbr_fbt.h"
-
-
-/* static function declarations */
-#ifdef SBR_LOW_POWER
-static void calc_prediction_coef_lp(sbr_info *sbr, qmf_t Xlow[MAX_NTSRHFG][64],
- complex_t *alpha_0, complex_t *alpha_1, real_t *rxx);
-static void calc_aliasing_degree(sbr_info *sbr, real_t *rxx, real_t *deg);
-#else
-static void calc_prediction_coef(sbr_info *sbr, qmf_t Xlow[MAX_NTSRHFG][64],
- complex_t *alpha_0, complex_t *alpha_1, uint8_t k);
-#endif
-static void calc_chirp_factors(sbr_info *sbr, uint8_t ch);
-static void patch_construction(sbr_info *sbr);
-
-
-void hf_generation(sbr_info *sbr, qmf_t Xlow[MAX_NTSRHFG][64],
- qmf_t Xhigh[MAX_NTSRHFG][64]
-#ifdef SBR_LOW_POWER
- ,real_t *deg
-#endif
- ,uint8_t ch)
-{
- uint8_t l, i, x;
- ALIGN complex_t alpha_0[64], alpha_1[64];
-#ifdef SBR_LOW_POWER
- ALIGN real_t rxx[64];
-#endif
-
- uint8_t offset = sbr->tHFAdj;
- uint8_t first = sbr->t_E[ch][0];
- uint8_t last = sbr->t_E[ch][sbr->L_E[ch]];
-
- calc_chirp_factors(sbr, ch);
-
-#ifdef SBR_LOW_POWER
- memset(deg, 0, 64*sizeof(real_t));
-#endif
-
- if ((ch == 0) && (sbr->Reset))
- patch_construction(sbr);
-
- /* calculate the prediction coefficients */
-#ifdef SBR_LOW_POWER
- calc_prediction_coef_lp(sbr, Xlow, alpha_0, alpha_1, rxx);
- calc_aliasing_degree(sbr, rxx, deg);
-#endif
-
- /* actual HF generation */
- for (i = 0; i < sbr->noPatches; i++)
- {
- for (x = 0; x < sbr->patchNoSubbands[i]; x++)
- {
- real_t a0_r, a0_i, a1_r, a1_i;
- real_t bw, bw2;
- uint8_t q, p, k, g;
-
- /* find the low and high band for patching */
- k = sbr->kx + x;
- for (q = 0; q < i; q++)
- {
- k += sbr->patchNoSubbands[q];
- }
- p = sbr->patchStartSubband[i] + x;
-
-#ifdef SBR_LOW_POWER
- if (x != 0 /*x < sbr->patchNoSubbands[i]-1*/)
- deg[k] = deg[p];
- else
- deg[k] = 0;
-#endif
-
- g = sbr->table_map_k_to_g[k];
-
- bw = sbr->bwArray[ch][g];
- bw2 = MUL_C(bw, bw);
-
- /* do the patching */
- /* with or without filtering */
- if (bw2 > 0)
- {
- real_t temp1_r, temp2_r, temp3_r;
-#ifndef SBR_LOW_POWER
- real_t temp1_i, temp2_i, temp3_i;
- calc_prediction_coef(sbr, Xlow, alpha_0, alpha_1, p);
-#endif
-
- a0_r = MUL_C(RE(alpha_0[p]), bw);
- a1_r = MUL_C(RE(alpha_1[p]), bw2);
-#ifndef SBR_LOW_POWER
- a0_i = MUL_C(IM(alpha_0[p]), bw);
- a1_i = MUL_C(IM(alpha_1[p]), bw2);
-#endif
-
- temp2_r = QMF_RE(Xlow[first - 2 + offset][p]);
- temp3_r = QMF_RE(Xlow[first - 1 + offset][p]);
-#ifndef SBR_LOW_POWER
- temp2_i = QMF_IM(Xlow[first - 2 + offset][p]);
- temp3_i = QMF_IM(Xlow[first - 1 + offset][p]);
-#endif
- for (l = first; l < last; l++)
- {
- temp1_r = temp2_r;
- temp2_r = temp3_r;
- temp3_r = QMF_RE(Xlow[l + offset][p]);
-#ifndef SBR_LOW_POWER
- temp1_i = temp2_i;
- temp2_i = temp3_i;
- temp3_i = QMF_IM(Xlow[l + offset][p]);
-#endif
-
-#ifdef SBR_LOW_POWER
- QMF_RE(Xhigh[l + offset][k]) =
- temp3_r
- +(MUL_R(a0_r, temp2_r) +
- MUL_R(a1_r, temp1_r));
-#else
- QMF_RE(Xhigh[l + offset][k]) =
- temp3_r
- +(MUL_R(a0_r, temp2_r) -
- MUL_R(a0_i, temp2_i) +
- MUL_R(a1_r, temp1_r) -
- MUL_R(a1_i, temp1_i));
- QMF_IM(Xhigh[l + offset][k]) =
- temp3_i
- +(MUL_R(a0_i, temp2_r) +
- MUL_R(a0_r, temp2_i) +
- MUL_R(a1_i, temp1_r) +
- MUL_R(a1_r, temp1_i));
-#endif
- }
- } else {
- for (l = first; l < last; l++)
- {
- QMF_RE(Xhigh[l + offset][k]) = QMF_RE(Xlow[l + offset][p]);
-#ifndef SBR_LOW_POWER
- QMF_IM(Xhigh[l + offset][k]) = QMF_IM(Xlow[l + offset][p]);
-#endif
- }
- }
- }
- }
-
- if (sbr->Reset)
- {
- limiter_frequency_table(sbr);
- }
-}
-
-typedef struct
-{
- complex_t r01;
- complex_t r02;
- complex_t r11;
- complex_t r12;
- complex_t r22;
- real_t det;
-} acorr_coef;
-
-#ifdef SBR_LOW_POWER
-static void auto_correlation(sbr_info *sbr, acorr_coef *ac,
- qmf_t buffer[MAX_NTSRHFG][64],
- uint8_t bd, uint8_t len)
-{
- real_t r01 = 0, r02 = 0, r11 = 0;
- int8_t j;
- uint8_t offset = sbr->tHFAdj;
-#ifdef FIXED_POINT
- const real_t rel = FRAC_CONST(0.999999); // 1 / (1 + 1e-6f);
- uint32_t maxi = 0;
- uint32_t pow2, exp;
-#else
- const real_t rel = 1 / (1 + 1e-6f);
-#endif
-
-
-#ifdef FIXED_POINT
- mask = 0;
-
- for (j = (offset-2); j < (len + offset); j++)
- {
- real_t x;
- x = QMF_RE(buffer[j][bd])>>REAL_BITS;
- mask |= x ^ (x >> 31);
- }
-
- exp = wl_min_lzc(mask);
-
- /* improves accuracy */
- if (exp > 0)
- exp -= 1;
-
- for (j = offset; j < len + offset; j++)
- {
- real_t buf_j = ((QMF_RE(buffer[j][bd])+(1<<(exp-1)))>>exp);
- real_t buf_j_1 = ((QMF_RE(buffer[j-1][bd])+(1<<(exp-1)))>>exp);
- real_t buf_j_2 = ((QMF_RE(buffer[j-2][bd])+(1<<(exp-1)))>>exp);
-
- /* normalisation with rounding */
- r01 += MUL_R(buf_j, buf_j_1);
- r02 += MUL_R(buf_j, buf_j_2);
- r11 += MUL_R(buf_j_1, buf_j_1);
- }
- RE(ac->r12) = r01 -
- MUL_R(((QMF_RE(buffer[len+offset-1][bd])+(1<<(exp-1)))>>exp), ((QMF_RE(buffer[len+offset-2][bd])+(1<<(exp-1)))>>exp)) +
- MUL_R(((QMF_RE(buffer[offset-1][bd])+(1<<(exp-1)))>>exp), ((QMF_RE(buffer[offset-2][bd])+(1<<(exp-1)))>>exp));
- RE(ac->r22) = r11 -
- MUL_R(((QMF_RE(buffer[len+offset-2][bd])+(1<<(exp-1)))>>exp), ((QMF_RE(buffer[len+offset-2][bd])+(1<<(exp-1)))>>exp)) +
- MUL_R(((QMF_RE(buffer[offset-2][bd])+(1<<(exp-1)))>>exp), ((QMF_RE(buffer[offset-2][bd])+(1<<(exp-1)))>>exp));
-#else
- for (j = offset; j < len + offset; j++)
- {
- r01 += QMF_RE(buffer[j][bd]) * QMF_RE(buffer[j-1][bd]);
- r02 += QMF_RE(buffer[j][bd]) * QMF_RE(buffer[j-2][bd]);
- r11 += QMF_RE(buffer[j-1][bd]) * QMF_RE(buffer[j-1][bd]);
- }
- RE(ac->r12) = r01 -
- QMF_RE(buffer[len+offset-1][bd]) * QMF_RE(buffer[len+offset-2][bd]) +
- QMF_RE(buffer[offset-1][bd]) * QMF_RE(buffer[offset-2][bd]);
- RE(ac->r22) = r11 -
- QMF_RE(buffer[len+offset-2][bd]) * QMF_RE(buffer[len+offset-2][bd]) +
- QMF_RE(buffer[offset-2][bd]) * QMF_RE(buffer[offset-2][bd]);
-#endif
- RE(ac->r01) = r01;
- RE(ac->r02) = r02;
- RE(ac->r11) = r11;
-
- ac->det = MUL_R(RE(ac->r11), RE(ac->r22)) - MUL_F(MUL_R(RE(ac->r12), RE(ac->r12)), rel);
-}
-#else
-static void auto_correlation(sbr_info *sbr, acorr_coef *ac, qmf_t buffer[MAX_NTSRHFG][64],
- uint8_t bd, uint8_t len)
-{
- real_t r01r = 0, r01i = 0, r02r = 0, r02i = 0, r11r = 0;
- real_t temp1_r, temp1_i, temp2_r, temp2_i, temp3_r, temp3_i, temp4_r, temp4_i, temp5_r, temp5_i;
-#ifdef FIXED_POINT
- const real_t rel = FRAC_CONST(0.999999); // 1 / (1 + 1e-6f);
- uint32_t mask, exp;
- real_t pow2_to_exp;
-#else
- const real_t rel = 1 / (1 + 1e-6f);
-#endif
- int8_t j;
- uint8_t offset = sbr->tHFAdj;
-
-#ifdef FIXED_POINT
- mask = 0;
-
- for (j = (offset-2); j < (len + offset); j++)
- {
- real_t x;
- x = QMF_RE(buffer[j][bd])>>REAL_BITS;
- mask |= x ^ (x >> 31);
- x = QMF_IM(buffer[j][bd])>>REAL_BITS;
- mask |= x ^ (x >> 31);
- }
-
- exp = wl_min_lzc(mask);
-
- /* improves accuracy */
- if (exp > 0)
- exp -= 1;
-
- pow2_to_exp = 1<<(exp-1);
-
- temp2_r = (QMF_RE(buffer[offset-2][bd]) + pow2_to_exp) >> exp;
- temp2_i = (QMF_IM(buffer[offset-2][bd]) + pow2_to_exp) >> exp;
- temp3_r = (QMF_RE(buffer[offset-1][bd]) + pow2_to_exp) >> exp;
- temp3_i = (QMF_IM(buffer[offset-1][bd]) + pow2_to_exp) >> exp;
- // Save these because they are needed after loop
- temp4_r = temp2_r;
- temp4_i = temp2_i;
- temp5_r = temp3_r;
- temp5_i = temp3_i;
-
- for (j = offset; j < len + offset; j++)
- {
- temp1_r = temp2_r; // temp1_r = (QMF_RE(buffer[offset-2][bd] + (1<<(exp-1))) >> exp;
- temp1_i = temp2_i; // temp1_i = (QMF_IM(buffer[offset-2][bd] + (1<<(exp-1))) >> exp;
- temp2_r = temp3_r; // temp2_r = (QMF_RE(buffer[offset-1][bd] + (1<<(exp-1))) >> exp;
- temp2_i = temp3_i; // temp2_i = (QMF_IM(buffer[offset-1][bd] + (1<<(exp-1))) >> exp;
- temp3_r = (QMF_RE(buffer[j][bd]) + pow2_to_exp) >> exp;
- temp3_i = (QMF_IM(buffer[j][bd]) + pow2_to_exp) >> exp;
- r01r += MUL_R(temp3_r, temp2_r) + MUL_R(temp3_i, temp2_i);
- r01i += MUL_R(temp3_i, temp2_r) - MUL_R(temp3_r, temp2_i);
- r02r += MUL_R(temp3_r, temp1_r) + MUL_R(temp3_i, temp1_i);
- r02i += MUL_R(temp3_i, temp1_r) - MUL_R(temp3_r, temp1_i);
- r11r += MUL_R(temp2_r, temp2_r) + MUL_R(temp2_i, temp2_i);
- }
-
- // These are actual values in temporary variable at this point
- // temp1_r = (QMF_RE(buffer[len+offset-1-2][bd] + (1<<(exp-1))) >> exp;
- // temp1_i = (QMF_IM(buffer[len+offset-1-2][bd] + (1<<(exp-1))) >> exp;
- // temp2_r = (QMF_RE(buffer[len+offset-1-1][bd] + (1<<(exp-1))) >> exp;
- // temp2_i = (QMF_IM(buffer[len+offset-1-1][bd] + (1<<(exp-1))) >> exp;
- // temp3_r = (QMF_RE(buffer[len+offset-1][bd]) + (1<<(exp-1))) >> exp;
- // temp3_i = (QMF_IM(buffer[len+offset-1][bd]) + (1<<(exp-1))) >> exp;
- // temp4_r = (QMF_RE(buffer[offset-2][bd]) + (1<<(exp-1))) >> exp;
- // temp4_i = (QMF_IM(buffer[offset-2][bd]) + (1<<(exp-1))) >> exp;
- // temp5_r = (QMF_RE(buffer[offset-1][bd]) + (1<<(exp-1))) >> exp;
- // temp5_i = (QMF_IM(buffer[offset-1][bd]) + (1<<(exp-1))) >> exp;
-
- RE(ac->r12) = r01r -
- (MUL_R(temp3_r, temp2_r) + MUL_R(temp3_i, temp2_i)) +
- (MUL_R(temp5_r, temp4_r) + MUL_R(temp5_i, temp4_i));
- IM(ac->r12) = r01i -
- (MUL_R(temp3_i, temp2_r) - MUL_R(temp3_r, temp2_i)) +
- (MUL_R(temp5_i, temp4_r) - MUL_R(temp5_r, temp4_i));
- RE(ac->r22) = r11r -
- (MUL_R(temp2_r, temp2_r) + MUL_R(temp2_i, temp2_i)) +
- (MUL_R(temp4_r, temp4_r) + MUL_R(temp4_i, temp4_i));
-
-#else
-
- temp2_r = QMF_RE(buffer[offset-2][bd]);
- temp2_i = QMF_IM(buffer[offset-2][bd]);
- temp3_r = QMF_RE(buffer[offset-1][bd]);
- temp3_i = QMF_IM(buffer[offset-1][bd]);
- // Save these because they are needed after loop
- temp4_r = temp2_r;
- temp4_i = temp2_i;
- temp5_r = temp3_r;
- temp5_i = temp3_i;
-
- for (j = offset; j < len + offset; j++)
- {
- temp1_r = temp2_r; // temp1_r = QMF_RE(buffer[j-2][bd];
- temp1_i = temp2_i; // temp1_i = QMF_IM(buffer[j-2][bd];
- temp2_r = temp3_r; // temp2_r = QMF_RE(buffer[j-1][bd];
- temp2_i = temp3_i; // temp2_i = QMF_IM(buffer[j-1][bd];
- temp3_r = QMF_RE(buffer[j][bd]);
- temp3_i = QMF_IM(buffer[j][bd]);
- r01r += temp3_r * temp2_r + temp3_i * temp2_i;
- r01i += temp3_i * temp2_r - temp3_r * temp2_i;
- r02r += temp3_r * temp1_r + temp3_i * temp1_i;
- r02i += temp3_i * temp1_r - temp3_r * temp1_i;
- r11r += temp2_r * temp2_r + temp2_i * temp2_i;
- }
-
- // These are actual values in temporary variable at this point
- // temp1_r = QMF_RE(buffer[len+offset-1-2][bd];
- // temp1_i = QMF_IM(buffer[len+offset-1-2][bd];
- // temp2_r = QMF_RE(buffer[len+offset-1-1][bd];
- // temp2_i = QMF_IM(buffer[len+offset-1-1][bd];
- // temp3_r = QMF_RE(buffer[len+offset-1][bd]);
- // temp3_i = QMF_IM(buffer[len+offset-1][bd]);
- // temp4_r = QMF_RE(buffer[offset-2][bd]);
- // temp4_i = QMF_IM(buffer[offset-2][bd]);
- // temp5_r = QMF_RE(buffer[offset-1][bd]);
- // temp5_i = QMF_IM(buffer[offset-1][bd]);
-
- RE(ac->r12) = r01r -
- (temp3_r * temp2_r + temp3_i * temp2_i) +
- (temp5_r * temp4_r + temp5_i * temp4_i);
- IM(ac->r12) = r01i -
- (temp3_i * temp2_r - temp3_r * temp2_i) +
- (temp5_i * temp4_r - temp5_r * temp4_i);
- RE(ac->r22) = r11r -
- (temp2_r * temp2_r + temp2_i * temp2_i) +
- (temp4_r * temp4_r + temp4_i * temp4_i);
-
-#endif
-
- RE(ac->r01) = r01r;
- IM(ac->r01) = r01i;
- RE(ac->r02) = r02r;
- IM(ac->r02) = r02i;
- RE(ac->r11) = r11r;
-
- ac->det = MUL_R(RE(ac->r11), RE(ac->r22)) - MUL_F(rel, (MUL_R(RE(ac->r12), RE(ac->r12)) + MUL_R(IM(ac->r12), IM(ac->r12))));
-}
-#endif
-
-/* calculate linear prediction coefficients using the covariance method */
-#ifndef SBR_LOW_POWER
-static void calc_prediction_coef(sbr_info *sbr, qmf_t Xlow[MAX_NTSRHFG][64],
- complex_t *alpha_0, complex_t *alpha_1, uint8_t k)
-{
- real_t tmp;
- acorr_coef ac;
-
- auto_correlation(sbr, &ac, Xlow, k, sbr->numTimeSlotsRate + 6);
-
- if (ac.det == 0)
- {
- RE(alpha_1[k]) = 0;
- IM(alpha_1[k]) = 0;
- } else {
-#ifdef FIXED_POINT
- tmp = (MUL_R(RE(ac.r01), RE(ac.r12)) - MUL_R(IM(ac.r01), IM(ac.r12)) - MUL_R(RE(ac.r02), RE(ac.r11)));
- RE(alpha_1[k]) = DIV_R(tmp, ac.det);
- tmp = (MUL_R(IM(ac.r01), RE(ac.r12)) + MUL_R(RE(ac.r01), IM(ac.r12)) - MUL_R(IM(ac.r02), RE(ac.r11)));
- IM(alpha_1[k]) = DIV_R(tmp, ac.det);
-#else
- tmp = REAL_CONST(1.0) / ac.det;
- RE(alpha_1[k]) = (MUL_R(RE(ac.r01), RE(ac.r12)) - MUL_R(IM(ac.r01), IM(ac.r12)) - MUL_R(RE(ac.r02), RE(ac.r11))) * tmp;
- IM(alpha_1[k]) = (MUL_R(IM(ac.r01), RE(ac.r12)) + MUL_R(RE(ac.r01), IM(ac.r12)) - MUL_R(IM(ac.r02), RE(ac.r11))) * tmp;
-#endif
- }
-
- if (RE(ac.r11) == 0)
- {
- RE(alpha_0[k]) = 0;
- IM(alpha_0[k]) = 0;
- } else {
-#ifdef FIXED_POINT
- tmp = -(RE(ac.r01) + MUL_R(RE(alpha_1[k]), RE(ac.r12)) + MUL_R(IM(alpha_1[k]), IM(ac.r12)));
- RE(alpha_0[k]) = DIV_R(tmp, RE(ac.r11));
- tmp = -(IM(ac.r01) + MUL_R(IM(alpha_1[k]), RE(ac.r12)) - MUL_R(RE(alpha_1[k]), IM(ac.r12)));
- IM(alpha_0[k]) = DIV_R(tmp, RE(ac.r11));
-#else
- tmp = 1.0f / RE(ac.r11);
- RE(alpha_0[k]) = -(RE(ac.r01) + MUL_R(RE(alpha_1[k]), RE(ac.r12)) + MUL_R(IM(alpha_1[k]), IM(ac.r12))) * tmp;
- IM(alpha_0[k]) = -(IM(ac.r01) + MUL_R(IM(alpha_1[k]), RE(ac.r12)) - MUL_R(RE(alpha_1[k]), IM(ac.r12))) * tmp;
-#endif
- }
-
- if ((MUL_R(RE(alpha_0[k]),RE(alpha_0[k])) + MUL_R(IM(alpha_0[k]),IM(alpha_0[k])) >= REAL_CONST(16)) ||
- (MUL_R(RE(alpha_1[k]),RE(alpha_1[k])) + MUL_R(IM(alpha_1[k]),IM(alpha_1[k])) >= REAL_CONST(16)))
- {
- RE(alpha_0[k]) = 0;
- IM(alpha_0[k]) = 0;
- RE(alpha_1[k]) = 0;
- IM(alpha_1[k]) = 0;
- }
-}
-#else
-static void calc_prediction_coef_lp(sbr_info *sbr, qmf_t Xlow[MAX_NTSRHFG][64],
- complex_t *alpha_0, complex_t *alpha_1, real_t *rxx)
-{
- uint8_t k;
- real_t tmp;
- acorr_coef ac;
-
- for (k = 1; k < sbr->f_master[0]; k++)
- {
- auto_correlation(sbr, &ac, Xlow, k, sbr->numTimeSlotsRate + 6);
-
- if (ac.det == 0)
- {
- RE(alpha_0[k]) = 0;
- RE(alpha_1[k]) = 0;
- } else {
- tmp = MUL_R(RE(ac.r01), RE(ac.r22)) - MUL_R(RE(ac.r12), RE(ac.r02));
- RE(alpha_0[k]) = DIV_R(tmp, (-ac.det));
-
- tmp = MUL_R(RE(ac.r01), RE(ac.r12)) - MUL_R(RE(ac.r02), RE(ac.r11));
- RE(alpha_1[k]) = DIV_R(tmp, ac.det);
- }
-
- if ((RE(alpha_0[k]) >= REAL_CONST(4)) || (RE(alpha_1[k]) >= REAL_CONST(4)))
- {
- RE(alpha_0[k]) = REAL_CONST(0);
- RE(alpha_1[k]) = REAL_CONST(0);
- }
-
- /* reflection coefficient */
- if (RE(ac.r11) == 0)
- {
- rxx[k] = COEF_CONST(0.0);
- } else {
- rxx[k] = DIV_C(RE(ac.r01), RE(ac.r11));
- rxx[k] = -rxx[k];
- if (rxx[k] > COEF_CONST(1.0)) rxx[k] = COEF_CONST(1.0);
- if (rxx[k] < COEF_CONST(-1.0)) rxx[k] = COEF_CONST(-1.0);
- }
- }
-}
-
-static void calc_aliasing_degree(sbr_info *sbr, real_t *rxx, real_t *deg)
-{
- uint8_t k;
-
- rxx[0] = COEF_CONST(0.0);
- deg[1] = COEF_CONST(0.0);
-
- for (k = 2; k < sbr->k0; k++)
- {
- deg[k] = 0.0;
-
- if ((k % 2 == 0) && (rxx[k] < COEF_CONST(0.0)))
- {
- if (rxx[k-1] < 0.0)
- {
- deg[k] = COEF_CONST(1.0);
-
- if (rxx[k-2] > COEF_CONST(0.0))
- {
- deg[k-1] = COEF_CONST(1.0) - MUL_C(rxx[k-1], rxx[k-1]);
- }
- } else if (rxx[k-2] > COEF_CONST(0.0)) {
- deg[k] = COEF_CONST(1.0) - MUL_C(rxx[k-1], rxx[k-1]);
- }
- }
-
- if ((k % 2 == 1) && (rxx[k] > COEF_CONST(0.0)))
- {
- if (rxx[k-1] > COEF_CONST(0.0))
- {
- deg[k] = COEF_CONST(1.0);
-
- if (rxx[k-2] < COEF_CONST(0.0))
- {
- deg[k-1] = COEF_CONST(1.0) - MUL_C(rxx[k-1], rxx[k-1]);
- }
- } else if (rxx[k-2] < COEF_CONST(0.0)) {
- deg[k] = COEF_CONST(1.0) - MUL_C(rxx[k-1], rxx[k-1]);
- }
- }
- }
-}
-#endif
-
-/* FIXED POINT: bwArray = COEF */
-static real_t mapNewBw(uint8_t invf_mode, uint8_t invf_mode_prev)
-{
- switch (invf_mode)
- {
- case 1: /* LOW */
- if (invf_mode_prev == 0) /* NONE */
- return COEF_CONST(0.6);
- else
- return COEF_CONST(0.75);
-
- case 2: /* MID */
- return COEF_CONST(0.9);
-
- case 3: /* HIGH */
- return COEF_CONST(0.98);
-
- default: /* NONE */
- if (invf_mode_prev == 1) /* LOW */
- return COEF_CONST(0.6);
- else
- return COEF_CONST(0.0);
- }
-}
-
-/* FIXED POINT: bwArray = COEF */
-static void calc_chirp_factors(sbr_info *sbr, uint8_t ch)
-{
- uint8_t i;
-
- for (i = 0; i < sbr->N_Q; i++)
- {
- sbr->bwArray[ch][i] = mapNewBw(sbr->bs_invf_mode[ch][i], sbr->bs_invf_mode_prev[ch][i]);
-
- if (sbr->bwArray[ch][i] < sbr->bwArray_prev[ch][i])
- sbr->bwArray[ch][i] = MUL_F(sbr->bwArray[ch][i], FRAC_CONST(0.75)) + MUL_F(sbr->bwArray_prev[ch][i], FRAC_CONST(0.25));
- else
- sbr->bwArray[ch][i] = MUL_F(sbr->bwArray[ch][i], FRAC_CONST(0.90625)) + MUL_F(sbr->bwArray_prev[ch][i], FRAC_CONST(0.09375));
-
- if (sbr->bwArray[ch][i] < COEF_CONST(0.015625))
- sbr->bwArray[ch][i] = COEF_CONST(0.0);
-
- if (sbr->bwArray[ch][i] >= COEF_CONST(0.99609375))
- sbr->bwArray[ch][i] = COEF_CONST(0.99609375);
-
- sbr->bwArray_prev[ch][i] = sbr->bwArray[ch][i];
- sbr->bs_invf_mode_prev[ch][i] = sbr->bs_invf_mode[ch][i];
- }
-}
-
-static void patch_construction(sbr_info *sbr)
-{
- uint8_t i, k;
- uint8_t odd, sb;
- uint8_t msb = sbr->k0;
- uint8_t usb = sbr->kx;
- uint8_t goalSbTab[] = { 21, 23, 32, 43, 46, 64, 85, 93, 128, 0, 0, 0 };
- /* (uint8_t)(2.048e6/sbr->sample_rate + 0.5); */
- uint8_t goalSb = goalSbTab[get_sr_index(sbr->sample_rate)];
-
- sbr->noPatches = 0;
-
- if (goalSb < (sbr->kx + sbr->M))
- {
- for (i = 0, k = 0; sbr->f_master[i] < goalSb; i++)
- k = i+1;
- } else {
- k = sbr->N_master;
- }
-
- if (sbr->N_master == 0)
- {
- sbr->noPatches = 0;
- sbr->patchNoSubbands[0] = 0;
- sbr->patchStartSubband[0] = 0;
-
- return;
- }
-
- do
- {
- uint8_t j = k + 1;
-
- do
- {
- j--;
-
- sb = sbr->f_master[j];
- odd = (sb - 2 + sbr->k0) % 2;
- } while (sb > (sbr->k0 - 1 + msb - odd));
-
- sbr->patchNoSubbands[sbr->noPatches] = max(sb - usb, 0);
- sbr->patchStartSubband[sbr->noPatches] = sbr->k0 - odd -
- sbr->patchNoSubbands[sbr->noPatches];
-
- if (sbr->patchNoSubbands[sbr->noPatches] > 0)
- {
- usb = sb;
- msb = sb;
- sbr->noPatches++;
- } else {
- msb = sbr->kx;
- }
-
- if (sbr->f_master[k] - sb < 3)
- k = sbr->N_master;
- } while (sb != (sbr->kx + sbr->M));
-
- if ((sbr->patchNoSubbands[sbr->noPatches-1] < 3) && (sbr->noPatches > 1))
- {
- sbr->noPatches--;
- }
-
- sbr->noPatches = min(sbr->noPatches, 5);
-}
-
-#endif
diff --git a/src/libfaad/sbr_hfgen.h b/src/libfaad/sbr_hfgen.h
deleted file mode 100644
index 27a58be61..000000000
--- a/src/libfaad/sbr_hfgen.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_hfgen.h,v 1.5 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __SBR_HFGEN_H__
-#define __SBR_HFGEN_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void hf_generation(sbr_info *sbr, qmf_t Xlow[MAX_NTSRHFG][64],
- qmf_t Xhigh[MAX_NTSRHFG][64]
-#ifdef SBR_LOW_POWER
- ,real_t *deg
-#endif
- ,uint8_t ch);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
diff --git a/src/libfaad/sbr_huff.c b/src/libfaad/sbr_huff.c
deleted file mode 100644
index 39ae32b9b..000000000
--- a/src/libfaad/sbr_huff.c
+++ /dev/null
@@ -1,357 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_huff.c,v 1.7 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#include "common.h"
-#include "structs.h"
-
-#ifdef SBR_DEC
-
-#include "sbr_syntax.h"
-#include "bits.h"
-#include "sbr_huff.h"
-#include "sbr_e_nf.h"
-
-
-typedef const int8_t (*sbr_huff_tab)[2];
-
-static const int8_t t_huffman_env_1_5dB[120][2] = {
- { 1, 2 }, { -64, -65 }, { 3, 4 }, { -63, -66 },
- { 5, 6 }, { -62, -67 }, { 7, 8 }, { -61, -68 },
- { 9, 10 }, { -60, -69 }, { 11, 12 }, { -59, -70 },
- { 13, 14 }, { -58, -71 }, { 15, 16 }, { -57, -72 },
- { 17, 18 }, { -73, -56 }, { 19, 21 }, { -74, 20 },
- { -55, -75 }, { 22, 26 }, { 23, 24 }, { -54, -76 },
- { -77, 25 }, { -53, -78 }, { 27, 34 }, { 28, 29 },
- { -52, -79 }, { 30, 31 }, { -80, -51 }, { 32, 33 },
- { -83, -82 }, { -81, -50 }, { 35, 57 }, { 36, 40 },
- { 37, 38 }, { -88, -84 }, { -48, 39 }, { -90, -85 },
- { 41, 46 }, { 42, 43 }, { -49, -87 }, { 44, 45 },
- { -89, -86 }, {-124,-123 }, { 47, 50 }, { 48, 49 },
- {-122,-121 }, {-120,-119 }, { 51, 54 }, { 52, 53 },
- {-118,-117 }, {-116,-115 }, { 55, 56 }, {-114,-113 },
- {-112,-111 }, { 58, 89 }, { 59, 74 }, { 60, 67 },
- { 61, 64 }, { 62, 63 }, {-110,-109 }, {-108,-107 },
- { 65, 66 }, {-106,-105 }, {-104,-103 }, { 68, 71 },
- { 69, 70 }, {-102,-101 }, {-100, -99 }, { 72, 73 },
- { -98, -97 }, { -96, -95 }, { 75, 82 }, { 76, 79 },
- { 77, 78 }, { -94, -93 }, { -92, -91 }, { 80, 81 },
- { -47, -46 }, { -45, -44 }, { 83, 86 }, { 84, 85 },
- { -43, -42 }, { -41, -40 }, { 87, 88 }, { -39, -38 },
- { -37, -36 }, { 90, 105 }, { 91, 98 }, { 92, 95 },
- { 93, 94 }, { -35, -34 }, { -33, -32 }, { 96, 97 },
- { -31, -30 }, { -29, -28 }, { 99, 102 }, { 100, 101 },
- { -27, -26 }, { -25, -24 }, { 103, 104 }, { -23, -22 },
- { -21, -20 }, { 106, 113 }, { 107, 110 }, { 108, 109 },
- { -19, -18 }, { -17, -16 }, { 111, 112 }, { -15, -14 },
- { -13, -12 }, { 114, 117 }, { 115, 116 }, { -11, -10 },
- { -9, -8 }, { 118, 119 }, { -7, -6 }, { -5, -4 }
-};
-
-static const int8_t f_huffman_env_1_5dB[120][2] = {
- { 1, 2 }, { -64, -65 }, { 3, 4 }, { -63, -66 },
- { 5, 6 }, { -67, -62 }, { 7, 8 }, { -68, -61 },
- { 9, 10 }, { -69, -60 }, { 11, 13 }, { -70, 12 },
- { -59, -71 }, { 14, 16 }, { -58, 15 }, { -72, -57 },
- { 17, 19 }, { -73, 18 }, { -56, -74 }, { 20, 23 },
- { 21, 22 }, { -55, -75 }, { -54, -53 }, { 24, 27 },
- { 25, 26 }, { -76, -52 }, { -77, -51 }, { 28, 31 },
- { 29, 30 }, { -50, -78 }, { -79, -49 }, { 32, 36 },
- { 33, 34 }, { -48, -47 }, { -80, 35 }, { -81, -82 },
- { 37, 47 }, { 38, 41 }, { 39, 40 }, { -83, -46 },
- { -45, -84 }, { 42, 44 }, { -85, 43 }, { -44, -43 },
- { 45, 46 }, { -88, -87 }, { -86, -90 }, { 48, 66 },
- { 49, 56 }, { 50, 53 }, { 51, 52 }, { -92, -42 },
- { -41, -39 }, { 54, 55 }, {-105, -89 }, { -38, -37 },
- { 57, 60 }, { 58, 59 }, { -94, -91 }, { -40, -36 },
- { 61, 63 }, { -20, 62 }, {-115,-110 }, { 64, 65 },
- {-108,-107 }, {-101, -97 }, { 67, 89 }, { 68, 75 },
- { 69, 72 }, { 70, 71 }, { -95, -93 }, { -34, -27 },
- { 73, 74 }, { -22, -17 }, { -16,-124 }, { 76, 82 },
- { 77, 79 }, {-123, 78 }, {-122,-121 }, { 80, 81 },
- {-120,-119 }, {-118,-117 }, { 83, 86 }, { 84, 85 },
- {-116,-114 }, {-113,-112 }, { 87, 88 }, {-111,-109 },
- {-106,-104 }, { 90, 105 }, { 91, 98 }, { 92, 95 },
- { 93, 94 }, {-103,-102 }, {-100, -99 }, { 96, 97 },
- { -98, -96 }, { -35, -33 }, { 99, 102 }, { 100, 101 },
- { -32, -31 }, { -30, -29 }, { 103, 104 }, { -28, -26 },
- { -25, -24 }, { 106, 113 }, { 107, 110 }, { 108, 109 },
- { -23, -21 }, { -19, -18 }, { 111, 112 }, { -15, -14 },
- { -13, -12 }, { 114, 117 }, { 115, 116 }, { -11, -10 },
- { -9, -8 }, { 118, 119 }, { -7, -6 }, { -5, -4 }
-};
-
-static const int8_t t_huffman_env_bal_1_5dB[48][2] = {
- { -64, 1 }, { -63, 2 }, { -65, 3 }, { -62, 4 },
- { -66, 5 }, { -61, 6 }, { -67, 7 }, { -60, 8 },
- { -68, 9 }, { 10, 11 }, { -69, -59 }, { 12, 13 },
- { -70, -58 }, { 14, 28 }, { 15, 21 }, { 16, 18 },
- { -57, 17 }, { -71, -56 }, { 19, 20 }, { -88, -87 },
- { -86, -85 }, { 22, 25 }, { 23, 24 }, { -84, -83 },
- { -82, -81 }, { 26, 27 }, { -80, -79 }, { -78, -77 },
- { 29, 36 }, { 30, 33 }, { 31, 32 }, { -76, -75 },
- { -74, -73 }, { 34, 35 }, { -72, -55 }, { -54, -53 },
- { 37, 41 }, { 38, 39 }, { -52, -51 }, { -50, 40 },
- { -49, -48 }, { 42, 45 }, { 43, 44 }, { -47, -46 },
- { -45, -44 }, { 46, 47 }, { -43, -42 }, { -41, -40 }
-};
-
-static const int8_t f_huffman_env_bal_1_5dB[48][2] = {
- { -64, 1 }, { -65, 2 }, { -63, 3 }, { -66, 4 },
- { -62, 5 }, { -61, 6 }, { -67, 7 }, { -68, 8 },
- { -60, 9 }, { 10, 11 }, { -69, -59 }, { -70, 12 },
- { -58, 13 }, { 14, 17 }, { -71, 15 }, { -57, 16 },
- { -56, -73 }, { 18, 32 }, { 19, 25 }, { 20, 22 },
- { -72, 21 }, { -88, -87 }, { 23, 24 }, { -86, -85 },
- { -84, -83 }, { 26, 29 }, { 27, 28 }, { -82, -81 },
- { -80, -79 }, { 30, 31 }, { -78, -77 }, { -76, -75 },
- { 33, 40 }, { 34, 37 }, { 35, 36 }, { -74, -55 },
- { -54, -53 }, { 38, 39 }, { -52, -51 }, { -50, -49 },
- { 41, 44 }, { 42, 43 }, { -48, -47 }, { -46, -45 },
- { 45, 46 }, { -44, -43 }, { -42, 47 }, { -41, -40 }
-};
-
-static const int8_t t_huffman_env_3_0dB[62][2] = {
- { -64, 1 }, { -65, 2 }, { -63, 3 }, { -66, 4 },
- { -62, 5 }, { -67, 6 }, { -61, 7 }, { -68, 8 },
- { -60, 9 }, { 10, 11 }, { -69, -59 }, { 12, 14 },
- { -70, 13 }, { -71, -58 }, { 15, 18 }, { 16, 17 },
- { -72, -57 }, { -73, -74 }, { 19, 22 }, { -56, 20 },
- { -55, 21 }, { -54, -77 }, { 23, 31 }, { 24, 25 },
- { -75, -76 }, { 26, 27 }, { -78, -53 }, { 28, 29 },
- { -52, -95 }, { -94, 30 }, { -93, -92 }, { 32, 47 },
- { 33, 40 }, { 34, 37 }, { 35, 36 }, { -91, -90 },
- { -89, -88 }, { 38, 39 }, { -87, -86 }, { -85, -84 },
- { 41, 44 }, { 42, 43 }, { -83, -82 }, { -81, -80 },
- { 45, 46 }, { -79, -51 }, { -50, -49 }, { 48, 55 },
- { 49, 52 }, { 50, 51 }, { -48, -47 }, { -46, -45 },
- { 53, 54 }, { -44, -43 }, { -42, -41 }, { 56, 59 },
- { 57, 58 }, { -40, -39 }, { -38, -37 }, { 60, 61 },
- { -36, -35 }, { -34, -33 }
-};
-
-static const int8_t f_huffman_env_3_0dB[62][2] = {
- { -64, 1 }, { -65, 2 }, { -63, 3 }, { -66, 4 },
- { -62, 5 }, { -67, 6 }, { 7, 8 }, { -61, -68 },
- { 9, 10 }, { -60, -69 }, { 11, 12 }, { -59, -70 },
- { 13, 14 }, { -58, -71 }, { 15, 16 }, { -57, -72 },
- { 17, 19 }, { -56, 18 }, { -55, -73 }, { 20, 24 },
- { 21, 22 }, { -74, -54 }, { -53, 23 }, { -75, -76 },
- { 25, 30 }, { 26, 27 }, { -52, -51 }, { 28, 29 },
- { -77, -79 }, { -50, -49 }, { 31, 39 }, { 32, 35 },
- { 33, 34 }, { -78, -46 }, { -82, -88 }, { 36, 37 },
- { -83, -48 }, { -47, 38 }, { -86, -85 }, { 40, 47 },
- { 41, 44 }, { 42, 43 }, { -80, -44 }, { -43, -42 },
- { 45, 46 }, { -39, -87 }, { -84, -40 }, { 48, 55 },
- { 49, 52 }, { 50, 51 }, { -95, -94 }, { -93, -92 },
- { 53, 54 }, { -91, -90 }, { -89, -81 }, { 56, 59 },
- { 57, 58 }, { -45, -41 }, { -38, -37 }, { 60, 61 },
- { -36, -35 }, { -34, -33 }
-};
-
-static const int8_t t_huffman_env_bal_3_0dB[24][2] = {
- { -64, 1 }, { -63, 2 }, { -65, 3 }, { -66, 4 },
- { -62, 5 }, { -61, 6 }, { -67, 7 }, { -68, 8 },
- { -60, 9 }, { 10, 16 }, { 11, 13 }, { -69, 12 },
- { -76, -75 }, { 14, 15 }, { -74, -73 }, { -72, -71 },
- { 17, 20 }, { 18, 19 }, { -70, -59 }, { -58, -57 },
- { 21, 22 }, { -56, -55 }, { -54, 23 }, { -53, -52 }
-};
-
-static const int8_t f_huffman_env_bal_3_0dB[24][2] = {
- { -64, 1 }, { -65, 2 }, { -63, 3 }, { -66, 4 },
- { -62, 5 }, { -61, 6 }, { -67, 7 }, { -68, 8 },
- { -60, 9 }, { 10, 13 }, { -69, 11 }, { -59, 12 },
- { -58, -76 }, { 14, 17 }, { 15, 16 }, { -75, -74 },
- { -73, -72 }, { 18, 21 }, { 19, 20 }, { -71, -70 },
- { -57, -56 }, { 22, 23 }, { -55, -54 }, { -53, -52 }
-};
-
-static const int8_t t_huffman_noise_3_0dB[62][2] = {
- { -64, 1 }, { -63, 2 }, { -65, 3 }, { -66, 4 },
- { -62, 5 }, { -67, 6 }, { 7, 8 }, { -61, -68 },
- { 9, 30 }, { 10, 15 }, { -60, 11 }, { -69, 12 },
- { 13, 14 }, { -59, -53 }, { -95, -94 }, { 16, 23 },
- { 17, 20 }, { 18, 19 }, { -93, -92 }, { -91, -90 },
- { 21, 22 }, { -89, -88 }, { -87, -86 }, { 24, 27 },
- { 25, 26 }, { -85, -84 }, { -83, -82 }, { 28, 29 },
- { -81, -80 }, { -79, -78 }, { 31, 46 }, { 32, 39 },
- { 33, 36 }, { 34, 35 }, { -77, -76 }, { -75, -74 },
- { 37, 38 }, { -73, -72 }, { -71, -70 }, { 40, 43 },
- { 41, 42 }, { -58, -57 }, { -56, -55 }, { 44, 45 },
- { -54, -52 }, { -51, -50 }, { 47, 54 }, { 48, 51 },
- { 49, 50 }, { -49, -48 }, { -47, -46 }, { 52, 53 },
- { -45, -44 }, { -43, -42 }, { 55, 58 }, { 56, 57 },
- { -41, -40 }, { -39, -38 }, { 59, 60 }, { -37, -36 },
- { -35, 61 }, { -34, -33 }
-};
-
-static const int8_t t_huffman_noise_bal_3_0dB[24][2] = {
- { -64, 1 }, { -65, 2 }, { -63, 3 }, { 4, 9 },
- { -66, 5 }, { -62, 6 }, { 7, 8 }, { -76, -75 },
- { -74, -73 }, { 10, 17 }, { 11, 14 }, { 12, 13 },
- { -72, -71 }, { -70, -69 }, { 15, 16 }, { -68, -67 },
- { -61, -60 }, { 18, 21 }, { 19, 20 }, { -59, -58 },
- { -57, -56 }, { 22, 23 }, { -55, -54 }, { -53, -52 }
-};
-
-
-static INLINE int16_t sbr_huff_dec(bitfile *ld, sbr_huff_tab t_huff)
-{
- uint8_t bit;
- int16_t index = 0;
-
- while (index >= 0)
- {
- bit = (uint8_t)faad_get1bit(ld);
- index = t_huff[index][bit];
- }
-
- return index + 64;
-}
-
-/* table 10 */
-void sbr_envelope(bitfile *ld, sbr_info *sbr, uint8_t ch)
-{
- uint8_t env, band;
- int8_t delta = 0;
- sbr_huff_tab t_huff, f_huff;
-
- if ((sbr->L_E[ch] == 1) && (sbr->bs_frame_class[ch] == FIXFIX))
- sbr->amp_res[ch] = 0;
- else
- sbr->amp_res[ch] = sbr->bs_amp_res;
-
- if ((sbr->bs_coupling) && (ch == 1))
- {
- delta = 1;
- if (sbr->amp_res[ch])
- {
- t_huff = t_huffman_env_bal_3_0dB;
- f_huff = f_huffman_env_bal_3_0dB;
- } else {
- t_huff = t_huffman_env_bal_1_5dB;
- f_huff = f_huffman_env_bal_1_5dB;
- }
- } else {
- delta = 0;
- if (sbr->amp_res[ch])
- {
- t_huff = t_huffman_env_3_0dB;
- f_huff = f_huffman_env_3_0dB;
- } else {
- t_huff = t_huffman_env_1_5dB;
- f_huff = f_huffman_env_1_5dB;
- }
- }
-
- for (env = 0; env < sbr->L_E[ch]; env++)
- {
- if (sbr->bs_df_env[ch][env] == 0)
- {
- if ((sbr->bs_coupling == 1) && (ch == 1))
- {
- if (sbr->amp_res[ch])
- {
- sbr->E[ch][0][env] = (uint16_t)(faad_getbits(ld, 5
- DEBUGVAR(1,272,"sbr_envelope(): bs_data_env")) << delta);
- } else {
- sbr->E[ch][0][env] = (uint16_t)(faad_getbits(ld, 6
- DEBUGVAR(1,273,"sbr_envelope(): bs_data_env")) << delta);
- }
- } else {
- if (sbr->amp_res[ch])
- {
- sbr->E[ch][0][env] = (uint16_t)(faad_getbits(ld, 6
- DEBUGVAR(1,274,"sbr_envelope(): bs_data_env")) << delta);
- } else {
- sbr->E[ch][0][env] = (uint16_t)(faad_getbits(ld, 7
- DEBUGVAR(1,275,"sbr_envelope(): bs_data_env")) << delta);
- }
- }
-
- for (band = 1; band < sbr->n[sbr->f[ch][env]]; band++)
- {
- sbr->E[ch][band][env] = (sbr_huff_dec(ld, f_huff) << delta);
- }
-
- } else {
- for (band = 0; band < sbr->n[sbr->f[ch][env]]; band++)
- {
- sbr->E[ch][band][env] = (sbr_huff_dec(ld, t_huff) << delta);
- }
- }
- }
-
- extract_envelope_data(sbr, ch);
-}
-
-/* table 11 */
-void sbr_noise(bitfile *ld, sbr_info *sbr, uint8_t ch)
-{
- uint8_t noise, band;
- int8_t delta = 0;
- sbr_huff_tab t_huff, f_huff;
-
- if ((sbr->bs_coupling == 1) && (ch == 1))
- {
- delta = 1;
- t_huff = t_huffman_noise_bal_3_0dB;
- f_huff = f_huffman_env_bal_3_0dB;
- } else {
- delta = 0;
- t_huff = t_huffman_noise_3_0dB;
- f_huff = f_huffman_env_3_0dB;
- }
-
- for (noise = 0; noise < sbr->L_Q[ch]; noise++)
- {
- if(sbr->bs_df_noise[ch][noise] == 0)
- {
- if ((sbr->bs_coupling == 1) && (ch == 1))
- {
- sbr->Q[ch][0][noise] = (faad_getbits(ld, 5
- DEBUGVAR(1,276,"sbr_noise(): bs_data_noise")) << delta);
- } else {
- sbr->Q[ch][0][noise] = (faad_getbits(ld, 5
- DEBUGVAR(1,277,"sbr_noise(): bs_data_noise")) << delta);
- }
- for (band = 1; band < sbr->N_Q; band++)
- {
- sbr->Q[ch][band][noise] = (sbr_huff_dec(ld, f_huff) << delta);
- }
- } else {
- for (band = 0; band < sbr->N_Q; band++)
- {
- sbr->Q[ch][band][noise] = (sbr_huff_dec(ld, t_huff) << delta);
- }
- }
- }
-
- extract_noise_floor_data(sbr, ch);
-}
-
-#endif
diff --git a/src/libfaad/sbr_huff.h b/src/libfaad/sbr_huff.h
deleted file mode 100644
index 631a43a8d..000000000
--- a/src/libfaad/sbr_huff.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_huff.h,v 1.7 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __SBR_HUFF_H__
-#define __SBR_HUFF_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-void sbr_envelope(bitfile *ld, sbr_info *sbr, uint8_t ch);
-void sbr_noise(bitfile *ld, sbr_info *sbr, uint8_t ch);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
diff --git a/src/libfaad/sbr_noise.h b/src/libfaad/sbr_noise.h
deleted file mode 100644
index a25fbf3cd..000000000
--- a/src/libfaad/sbr_noise.h
+++ /dev/null
@@ -1,561 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_noise.h,v 1.5 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __SBR_NOISE_H__
-#define __SBR_NOISE_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef _MSC_VER
-#pragma warning(disable:4305)
-#pragma warning(disable:4244)
-#endif
-
-
-/* Table 1.A.13 Noise table V */
-ALIGN static const complex_t V[] = {
- { FRAC_CONST(-0.99948155879974), FRAC_CONST(-0.59483414888382) },
- { FRAC_CONST(0.97113454341888), FRAC_CONST(-0.67528516054153) },
- { FRAC_CONST(0.14130051434040), FRAC_CONST(-0.95090985298157) },
- { FRAC_CONST(-0.47005495429039), FRAC_CONST(-0.37340548634529) },
- { FRAC_CONST(0.80705064535141), FRAC_CONST(0.29653668403625) },
- { FRAC_CONST(-0.38981479406357), FRAC_CONST(0.89572608470917) },
- { FRAC_CONST(-0.01053049881011), FRAC_CONST(-0.66959059238434) },
- { FRAC_CONST(-0.91266369819641), FRAC_CONST(-0.11522938311100) },
- { FRAC_CONST(0.54840421676636), FRAC_CONST(0.75221365690231) },
- { FRAC_CONST(0.40009254217148), FRAC_CONST(-0.98929399251938) },
- { FRAC_CONST(-0.99867975711823), FRAC_CONST(-0.88147068023682) },
- { FRAC_CONST(-0.95531076192856), FRAC_CONST(0.90908759832382) },
- { FRAC_CONST(-0.45725932717323), FRAC_CONST(-0.56716322898865) },
- { FRAC_CONST(-0.72929674386978), FRAC_CONST(-0.98008275032043) },
- { FRAC_CONST(0.75622802972794), FRAC_CONST(0.20950329303741) },
- { FRAC_CONST(0.07069442421198), FRAC_CONST(-0.78247898817062) },
- { FRAC_CONST(0.74496251344681), FRAC_CONST(-0.91169005632401) },
- { FRAC_CONST(-0.96440184116364), FRAC_CONST(-0.94739919900894) },
- { FRAC_CONST(0.30424630641937), FRAC_CONST(-0.49438267946243) },
- { FRAC_CONST(0.66565030813217), FRAC_CONST(0.64652937650681) },
- { FRAC_CONST(0.91697007417679), FRAC_CONST(0.17514097690582) },
- { FRAC_CONST(-0.70774918794632), FRAC_CONST(0.52548652887344) },
- { FRAC_CONST(-0.70051413774490), FRAC_CONST(-0.45340028405190) },
- { FRAC_CONST(-0.99496513605118), FRAC_CONST(-0.90071910619736) },
- { FRAC_CONST(0.98164492845535), FRAC_CONST(-0.77463155984879) },
- { FRAC_CONST(-0.54671579599380), FRAC_CONST(-0.02570928446949) },
- { FRAC_CONST(-0.01689629070461), FRAC_CONST(0.00287506449968) },
- { FRAC_CONST(-0.86110347509384), FRAC_CONST(0.42548584938049) },
- { FRAC_CONST(-0.98892980813980), FRAC_CONST(-0.87881129980087) },
- { FRAC_CONST(0.51756626367569), FRAC_CONST(0.66926783323288) },
- { FRAC_CONST(-0.99635028839111), FRAC_CONST(-0.58107727766037) },
- { FRAC_CONST(-0.99969369173050), FRAC_CONST(0.98369991779327) },
- { FRAC_CONST(0.55266261100769), FRAC_CONST(0.59449058771133) },
- { FRAC_CONST(0.34581178426743), FRAC_CONST(0.94879418611526) },
- { FRAC_CONST(0.62664210796356), FRAC_CONST(-0.74402970075607) },
- { FRAC_CONST(-0.77149701118469), FRAC_CONST(-0.33883658051491) },
- { FRAC_CONST(-0.91592246294022), FRAC_CONST(0.03687901422381) },
- { FRAC_CONST(-0.76285493373871), FRAC_CONST(-0.91371870040894) },
- { FRAC_CONST(0.79788339138031), FRAC_CONST(-0.93180972337723) },
- { FRAC_CONST(0.54473078250885), FRAC_CONST(-0.11919206380844) },
- { FRAC_CONST(-0.85639280080795), FRAC_CONST(0.42429855465889) },
- { FRAC_CONST(-0.92882400751114), FRAC_CONST(0.27871808409691) },
- { FRAC_CONST(-0.11708371341228), FRAC_CONST(-0.99800843000412) },
- { FRAC_CONST(0.21356749534607), FRAC_CONST(-0.90716296434402) },
- { FRAC_CONST(-0.76191693544388), FRAC_CONST(0.99768120050430) },
- { FRAC_CONST(0.98111045360565), FRAC_CONST(-0.95854461193085) },
- { FRAC_CONST(-0.85913270711899), FRAC_CONST(0.95766568183899) },
- { FRAC_CONST(-0.93307244777679), FRAC_CONST(0.49431759119034) },
- { FRAC_CONST(0.30485755205154), FRAC_CONST(-0.70540034770966) },
- { FRAC_CONST(0.85289651155472), FRAC_CONST(0.46766132116318) },
- { FRAC_CONST(0.91328084468842), FRAC_CONST(-0.99839597940445) },
- { FRAC_CONST(-0.05890199914575), FRAC_CONST(0.70741826295853) },
- { FRAC_CONST(0.28398686647415), FRAC_CONST(0.34633556008339) },
- { FRAC_CONST(0.95258164405823), FRAC_CONST(-0.54893416166306) },
- { FRAC_CONST(-0.78566324710846), FRAC_CONST(-0.75568538904190) },
- { FRAC_CONST(-0.95789498090744), FRAC_CONST(-0.20423194766045) },
- { FRAC_CONST(0.82411158084869), FRAC_CONST(0.96654617786407) },
- { FRAC_CONST(-0.65185445547104), FRAC_CONST(-0.88734990358353) },
- { FRAC_CONST(-0.93643605709076), FRAC_CONST(0.99870789051056) },
- { FRAC_CONST(0.91427159309387), FRAC_CONST(-0.98290503025055) },
- { FRAC_CONST(-0.70395684242249), FRAC_CONST(0.58796799182892) },
- { FRAC_CONST(0.00563771976158), FRAC_CONST(0.61768198013306) },
- { FRAC_CONST(0.89065051078796), FRAC_CONST(0.52783352136612) },
- { FRAC_CONST(-0.68683707714081), FRAC_CONST(0.80806946754456) },
- { FRAC_CONST(0.72165340185165), FRAC_CONST(-0.69259858131409) },
- { FRAC_CONST(-0.62928247451782), FRAC_CONST(0.13627037405968) },
- { FRAC_CONST(0.29938435554504), FRAC_CONST(-0.46051329374313) },
- { FRAC_CONST(-0.91781955957413), FRAC_CONST(-0.74012714624405) },
- { FRAC_CONST(0.99298715591431), FRAC_CONST(0.40816611051559) },
- { FRAC_CONST(0.82368296384811), FRAC_CONST(-0.74036049842834) },
- { FRAC_CONST(-0.98512834310532), FRAC_CONST(-0.99972331523895) },
- { FRAC_CONST(-0.95915371179581), FRAC_CONST(-0.99237799644470) },
- { FRAC_CONST(-0.21411126852036), FRAC_CONST(-0.93424820899963) },
- { FRAC_CONST(-0.68821477890015), FRAC_CONST(-0.26892307400703) },
- { FRAC_CONST(0.91851997375488), FRAC_CONST(0.09358228743076) },
- { FRAC_CONST(-0.96062767505646), FRAC_CONST(0.36099094152451) },
- { FRAC_CONST(0.51646184921265), FRAC_CONST(-0.71373331546783) },
- { FRAC_CONST(0.61130720376968), FRAC_CONST(0.46950140595436) },
- { FRAC_CONST(0.47336128354073), FRAC_CONST(-0.27333179116249) },
- { FRAC_CONST(0.90998309850693), FRAC_CONST(0.96715664863586) },
- { FRAC_CONST(0.44844800233841), FRAC_CONST(0.99211573600769) },
- { FRAC_CONST(0.66614890098572), FRAC_CONST(0.96590173244476) },
- { FRAC_CONST(0.74922239780426), FRAC_CONST(-0.89879858493805) },
- { FRAC_CONST(-0.99571585655212), FRAC_CONST(0.52785521745682) },
- { FRAC_CONST(0.97401082515717), FRAC_CONST(-0.16855870187283) },
- { FRAC_CONST(0.72683745622635), FRAC_CONST(-0.48060774803162) },
- { FRAC_CONST(0.95432192087173), FRAC_CONST(0.68849605321884) },
- { FRAC_CONST(-0.72962206602097), FRAC_CONST(-0.76608443260193) },
- { FRAC_CONST(-0.85359477996826), FRAC_CONST(0.88738125562668) },
- { FRAC_CONST(-0.81412428617477), FRAC_CONST(-0.97480767965317) },
- { FRAC_CONST(-0.87930774688721), FRAC_CONST(0.74748307466507) },
- { FRAC_CONST(-0.71573328971863), FRAC_CONST(-0.98570609092712) },
- { FRAC_CONST(0.83524298667908), FRAC_CONST(0.83702534437180) },
- { FRAC_CONST(-0.48086065053940), FRAC_CONST(-0.98848503828049) },
- { FRAC_CONST(0.97139126062393), FRAC_CONST(0.80093622207642) },
- { FRAC_CONST(0.51992827653885), FRAC_CONST(0.80247628688812) },
- { FRAC_CONST(-0.00848591234535), FRAC_CONST(-0.76670128107071) },
- { FRAC_CONST(-0.70294374227524), FRAC_CONST(0.55359911918640) },
- { FRAC_CONST(-0.95894426107407), FRAC_CONST(-0.43265503644943) },
- { FRAC_CONST(0.97079253196716), FRAC_CONST(0.09325857460499) },
- { FRAC_CONST(-0.92404294013977), FRAC_CONST(0.85507702827454) },
- { FRAC_CONST(-0.69506472349167), FRAC_CONST(0.98633414506912) },
- { FRAC_CONST(0.26559203863144), FRAC_CONST(0.73314309120178) },
- { FRAC_CONST(0.28038442134857), FRAC_CONST(0.14537914097309) },
- { FRAC_CONST(-0.74138122797012), FRAC_CONST(0.99310338497162) },
- { FRAC_CONST(-0.01752796024084), FRAC_CONST(-0.82616633176804) },
- { FRAC_CONST(-0.55126774311066), FRAC_CONST(-0.98898541927338) },
- { FRAC_CONST(0.97960901260376), FRAC_CONST(-0.94021445512772) },
- { FRAC_CONST(-0.99196308851242), FRAC_CONST(0.67019015550613) },
- { FRAC_CONST(-0.67684930562973), FRAC_CONST(0.12631492316723) },
- { FRAC_CONST(0.09140039235353), FRAC_CONST(-0.20537731051445) },
- { FRAC_CONST(-0.71658962965012), FRAC_CONST(-0.97788202762604) },
- { FRAC_CONST(0.81014639139175), FRAC_CONST(0.53722649812698) },
- { FRAC_CONST(0.40616992115974), FRAC_CONST(-0.26469007134438) },
- { FRAC_CONST(-0.67680186033249), FRAC_CONST(0.94502049684525) },
- { FRAC_CONST(0.86849772930145), FRAC_CONST(-0.18333598971367) },
- { FRAC_CONST(-0.99500381946564), FRAC_CONST(-0.02634122036397) },
- { FRAC_CONST(0.84329187870026), FRAC_CONST(0.10406957566738) },
- { FRAC_CONST(-0.09215968847275), FRAC_CONST(0.69540011882782) },
- { FRAC_CONST(0.99956172704697), FRAC_CONST(-0.12358541786671) },
- { FRAC_CONST(-0.79732781648636), FRAC_CONST(-0.91582524776459) },
- { FRAC_CONST(0.96349972486496), FRAC_CONST(0.96640455722809) },
- { FRAC_CONST(-0.79942780733109), FRAC_CONST(0.64323902130127) },
- { FRAC_CONST(-0.11566039919853), FRAC_CONST(0.28587844967842) },
- { FRAC_CONST(-0.39922955632210), FRAC_CONST(0.94129604101181) },
- { FRAC_CONST(0.99089199304581), FRAC_CONST(-0.92062628269196) },
- { FRAC_CONST(0.28631284832954), FRAC_CONST(-0.91035044193268) },
- { FRAC_CONST(-0.83302724361420), FRAC_CONST(-0.67330408096313) },
- { FRAC_CONST(0.95404446125031), FRAC_CONST(0.49162766337395) },
- { FRAC_CONST(-0.06449863314629), FRAC_CONST(0.03250560909510) },
- { FRAC_CONST(-0.99575054645538), FRAC_CONST(0.42389783263206) },
- { FRAC_CONST(-0.65501141548157), FRAC_CONST(0.82546114921570) },
- { FRAC_CONST(-0.81254440546036), FRAC_CONST(-0.51627236604691) },
- { FRAC_CONST(-0.99646371603012), FRAC_CONST(0.84490531682968) },
- { FRAC_CONST(0.00287840608507), FRAC_CONST(0.64768260717392) },
- { FRAC_CONST(0.70176988840103), FRAC_CONST(-0.20453028380871) },
- { FRAC_CONST(0.96361881494522), FRAC_CONST(0.40706968307495) },
- { FRAC_CONST(-0.68883758783340), FRAC_CONST(0.91338956356049) },
- { FRAC_CONST(-0.34875586628914), FRAC_CONST(0.71472293138504) },
- { FRAC_CONST(0.91980081796646), FRAC_CONST(0.66507452726364) },
- { FRAC_CONST(-0.99009048938751), FRAC_CONST(0.85868018865585) },
- { FRAC_CONST(0.68865793943405), FRAC_CONST(0.55660319328308) },
- { FRAC_CONST(-0.99484401941299), FRAC_CONST(-0.20052559673786) },
- { FRAC_CONST(0.94214510917664), FRAC_CONST(-0.99696427583694) },
- { FRAC_CONST(-0.67414629459381), FRAC_CONST(0.49548220634460) },
- { FRAC_CONST(-0.47339352965355), FRAC_CONST(-0.85904330015182) },
- { FRAC_CONST(0.14323651790619), FRAC_CONST(-0.94145596027374) },
- { FRAC_CONST(-0.29268294572830), FRAC_CONST(0.05759225040674) },
- { FRAC_CONST(0.43793860077858), FRAC_CONST(-0.78904968500137) },
- { FRAC_CONST(-0.36345127224922), FRAC_CONST(0.64874434471130) },
- { FRAC_CONST(-0.08750604838133), FRAC_CONST(0.97686946392059) },
- { FRAC_CONST(-0.96495270729065), FRAC_CONST(-0.53960305452347) },
- { FRAC_CONST(0.55526942014694), FRAC_CONST(0.78891521692276) },
- { FRAC_CONST(0.73538213968277), FRAC_CONST(0.96452075242996) },
- { FRAC_CONST(-0.30889773368835), FRAC_CONST(-0.80664390325546) },
- { FRAC_CONST(0.03574995696545), FRAC_CONST(-0.97325617074966) },
- { FRAC_CONST(0.98720687627792), FRAC_CONST(0.48409134149551) },
- { FRAC_CONST(-0.81689298152924), FRAC_CONST(-0.90827703475952) },
- { FRAC_CONST(0.67866861820221), FRAC_CONST(0.81284505128860) },
- { FRAC_CONST(-0.15808570384979), FRAC_CONST(0.85279554128647) },
- { FRAC_CONST(0.80723392963409), FRAC_CONST(-0.24717418849468) },
- { FRAC_CONST(0.47788757085800), FRAC_CONST(-0.46333149075508) },
- { FRAC_CONST(0.96367555856705), FRAC_CONST(0.38486748933792) },
- { FRAC_CONST(-0.99143874645233), FRAC_CONST(-0.24945276975632) },
- { FRAC_CONST(0.83081877231598), FRAC_CONST(-0.94780850410461) },
- { FRAC_CONST(-0.58753192424774), FRAC_CONST(0.01290772389621) },
- { FRAC_CONST(0.95538109540939), FRAC_CONST(-0.85557049512863) },
- { FRAC_CONST(-0.96490919589996), FRAC_CONST(-0.64020973443985) },
- { FRAC_CONST(-0.97327101230621), FRAC_CONST(0.12378127872944) },
- { FRAC_CONST(0.91400367021561), FRAC_CONST(0.57972472906113) },
- { FRAC_CONST(-0.99925839900970), FRAC_CONST(0.71084845066071) },
- { FRAC_CONST(-0.86875903606415), FRAC_CONST(-0.20291699469090) },
- { FRAC_CONST(-0.26240035891533), FRAC_CONST(-0.68264555931091) },
- { FRAC_CONST(-0.24664412438869), FRAC_CONST(-0.87642270326614) },
- { FRAC_CONST(0.02416275814176), FRAC_CONST(0.27192914485931) },
- { FRAC_CONST(0.82068622112274), FRAC_CONST(-0.85087788105011) },
- { FRAC_CONST(0.88547372817993), FRAC_CONST(-0.89636802673340) },
- { FRAC_CONST(-0.18173077702522), FRAC_CONST(-0.26152145862579) },
- { FRAC_CONST(0.09355476498604), FRAC_CONST(0.54845124483109) },
- { FRAC_CONST(-0.54668414592743), FRAC_CONST(0.95980775356293) },
- { FRAC_CONST(0.37050989270210), FRAC_CONST(-0.59910142421722) },
- { FRAC_CONST(-0.70373594760895), FRAC_CONST(0.91227668523788) },
- { FRAC_CONST(-0.34600785374641), FRAC_CONST(-0.99441426992416) },
- { FRAC_CONST(-0.68774479627609), FRAC_CONST(-0.30238837003708) },
- { FRAC_CONST(-0.26843291521072), FRAC_CONST(0.83115667104721) },
- { FRAC_CONST(0.49072334170341), FRAC_CONST(-0.45359709858894) },
- { FRAC_CONST(0.38975992798805), FRAC_CONST(0.95515358448029) },
- { FRAC_CONST(-0.97757124900818), FRAC_CONST(0.05305894464254) },
- { FRAC_CONST(-0.17325553297997), FRAC_CONST(-0.92770671844482) },
- { FRAC_CONST(0.99948036670685), FRAC_CONST(0.58285546302795) },
- { FRAC_CONST(-0.64946246147156), FRAC_CONST(0.68645507097244) },
- { FRAC_CONST(-0.12016920745373), FRAC_CONST(-0.57147324085236) },
- { FRAC_CONST(-0.58947455883026), FRAC_CONST(-0.34847131371498) },
- { FRAC_CONST(-0.41815140843391), FRAC_CONST(0.16276422142982) },
- { FRAC_CONST(0.99885648488998), FRAC_CONST(0.11136095225811) },
- { FRAC_CONST(-0.56649613380432), FRAC_CONST(-0.90494865179062) },
- { FRAC_CONST(0.94138020277023), FRAC_CONST(0.35281917452812) },
- { FRAC_CONST(-0.75725078582764), FRAC_CONST(0.53650552034378) },
- { FRAC_CONST(0.20541973412037), FRAC_CONST(-0.94435143470764) },
- { FRAC_CONST(0.99980372190475), FRAC_CONST(0.79835915565491) },
- { FRAC_CONST(0.29078277945518), FRAC_CONST(0.35393777489662) },
- { FRAC_CONST(-0.62858772277832), FRAC_CONST(0.38765692710876) },
- { FRAC_CONST(0.43440905213356), FRAC_CONST(-0.98546332120895) },
- { FRAC_CONST(-0.98298585414886), FRAC_CONST(0.21021524071693) },
- { FRAC_CONST(0.19513028860092), FRAC_CONST(-0.94239830970764) },
- { FRAC_CONST(-0.95476663112640), FRAC_CONST(0.98364555835724) },
- { FRAC_CONST(0.93379634618759), FRAC_CONST(-0.70881992578506) },
- { FRAC_CONST(-0.85235410928726), FRAC_CONST(-0.08342348039150) },
- { FRAC_CONST(-0.86425095796585), FRAC_CONST(-0.45795026421547) },
- { FRAC_CONST(0.38879778981209), FRAC_CONST(0.97274428606033) },
- { FRAC_CONST(0.92045122385025), FRAC_CONST(-0.62433654069901) },
- { FRAC_CONST(0.89162534475327), FRAC_CONST(0.54950958490372) },
- { FRAC_CONST(-0.36834338307381), FRAC_CONST(0.96458297967911) },
- { FRAC_CONST(0.93891763687134), FRAC_CONST(-0.89968353509903) },
- { FRAC_CONST(0.99267655611038), FRAC_CONST(-0.03757034242153) },
- { FRAC_CONST(-0.94063472747803), FRAC_CONST(0.41332337260246) },
- { FRAC_CONST(0.99740225076675), FRAC_CONST(-0.16830494999886) },
- { FRAC_CONST(-0.35899412631989), FRAC_CONST(-0.46633225679398) },
- { FRAC_CONST(0.05237237364054), FRAC_CONST(-0.25640362501144) },
- { FRAC_CONST(0.36703583598137), FRAC_CONST(-0.38653266429901) },
- { FRAC_CONST(0.91653180122375), FRAC_CONST(-0.30587628483772) },
- { FRAC_CONST(0.69000804424286), FRAC_CONST(0.90952169895172) },
- { FRAC_CONST(-0.38658750057220), FRAC_CONST(0.99501574039459) },
- { FRAC_CONST(-0.29250815510750), FRAC_CONST(0.37444993853569) },
- { FRAC_CONST(-0.60182201862335), FRAC_CONST(0.86779648065567) },
- { FRAC_CONST(-0.97418588399887), FRAC_CONST(0.96468526124954) },
- { FRAC_CONST(0.88461571931839), FRAC_CONST(0.57508403062820) },
- { FRAC_CONST(0.05198933184147), FRAC_CONST(0.21269661188126) },
- { FRAC_CONST(-0.53499621152878), FRAC_CONST(0.97241556644440) },
- { FRAC_CONST(-0.49429559707642), FRAC_CONST(0.98183864355087) },
- { FRAC_CONST(-0.98935145139694), FRAC_CONST(-0.40249159932137) },
- { FRAC_CONST(-0.98081380128860), FRAC_CONST(-0.72856897115707) },
- { FRAC_CONST(-0.27338150143623), FRAC_CONST(0.99950921535492) },
- { FRAC_CONST(0.06310802698135), FRAC_CONST(-0.54539585113525) },
- { FRAC_CONST(-0.20461677014828), FRAC_CONST(-0.14209978282452) },
- { FRAC_CONST(0.66223841905594), FRAC_CONST(0.72528582811356) },
- { FRAC_CONST(-0.84764343500137), FRAC_CONST(0.02372316829860) },
- { FRAC_CONST(-0.89039862155914), FRAC_CONST(0.88866579532623) },
- { FRAC_CONST(0.95903307199478), FRAC_CONST(0.76744925975800) },
- { FRAC_CONST(0.73504126071930), FRAC_CONST(-0.03747203201056) },
- { FRAC_CONST(-0.31744435429573), FRAC_CONST(-0.36834111809731) },
- { FRAC_CONST(-0.34110826253891), FRAC_CONST(0.40211221575737) },
- { FRAC_CONST(0.47803884744644), FRAC_CONST(-0.39423218369484) },
- { FRAC_CONST(0.98299193382263), FRAC_CONST(0.01989791356027) },
- { FRAC_CONST(-0.30963072180748), FRAC_CONST(-0.18076720833778) },
- { FRAC_CONST(0.99992591142654), FRAC_CONST(-0.26281872391701) },
- { FRAC_CONST(-0.93149733543396), FRAC_CONST(-0.98313164710999) },
- { FRAC_CONST(0.99923473596573), FRAC_CONST(-0.80142992734909) },
- { FRAC_CONST(-0.26024168729782), FRAC_CONST(-0.75999760627747) },
- { FRAC_CONST(-0.35712513327599), FRAC_CONST(0.19298963248730) },
- { FRAC_CONST(-0.99899083375931), FRAC_CONST(0.74645155668259) },
- { FRAC_CONST(0.86557173728943), FRAC_CONST(0.55593866109848) },
- { FRAC_CONST(0.33408042788506), FRAC_CONST(0.86185956001282) },
- { FRAC_CONST(0.99010735750198), FRAC_CONST(0.04602397605777) },
- { FRAC_CONST(-0.66694271564484), FRAC_CONST(-0.91643613576889) },
- { FRAC_CONST(0.64016789197922), FRAC_CONST(0.15649530291557) },
- { FRAC_CONST(0.99570536613464), FRAC_CONST(0.45844584703445) },
- { FRAC_CONST(-0.63431465625763), FRAC_CONST(0.21079117059708) },
- { FRAC_CONST(-0.07706847041845), FRAC_CONST(-0.89581435918808) },
- { FRAC_CONST(0.98590087890625), FRAC_CONST(0.88241720199585) },
- { FRAC_CONST(0.80099332332611), FRAC_CONST(-0.36851897835732) },
- { FRAC_CONST(0.78368133306503), FRAC_CONST(0.45506998896599) },
- { FRAC_CONST(0.08707806468010), FRAC_CONST(0.80938994884491) },
- { FRAC_CONST(-0.86811882257462), FRAC_CONST(0.39347308874130) },
- { FRAC_CONST(-0.39466530084610), FRAC_CONST(-0.66809433698654) },
- { FRAC_CONST(0.97875326871872), FRAC_CONST(-0.72467839717865) },
- { FRAC_CONST(-0.95038563013077), FRAC_CONST(0.89563220739365) },
- { FRAC_CONST(0.17005239427090), FRAC_CONST(0.54683053493500) },
- { FRAC_CONST(-0.76910793781281), FRAC_CONST(-0.96226614713669) },
- { FRAC_CONST(0.99743282794952), FRAC_CONST(0.42697158455849) },
- { FRAC_CONST(0.95437383651733), FRAC_CONST(0.97002321481705) },
- { FRAC_CONST(0.99578905105591), FRAC_CONST(-0.54106825590134) },
- { FRAC_CONST(0.28058260679245), FRAC_CONST(-0.85361421108246) },
- { FRAC_CONST(0.85256522893906), FRAC_CONST(-0.64567607641220) },
- { FRAC_CONST(-0.50608539581299), FRAC_CONST(-0.65846014022827) },
- { FRAC_CONST(-0.97210735082626), FRAC_CONST(-0.23095212876797) },
- { FRAC_CONST(0.95424050092697), FRAC_CONST(-0.99240148067474) },
- { FRAC_CONST(-0.96926569938660), FRAC_CONST(0.73775655031204) },
- { FRAC_CONST(0.30872163176537), FRAC_CONST(0.41514959931374) },
- { FRAC_CONST(-0.24523839354515), FRAC_CONST(0.63206630945206) },
- { FRAC_CONST(-0.33813264966011), FRAC_CONST(-0.38661777973175) },
- { FRAC_CONST(-0.05826828256249), FRAC_CONST(-0.06940773874521) },
- { FRAC_CONST(-0.22898460924625), FRAC_CONST(0.97054851055145) },
- { FRAC_CONST(-0.18509915471077), FRAC_CONST(0.47565764188766) },
- { FRAC_CONST(-0.10488238185644), FRAC_CONST(-0.87769949436188) },
- { FRAC_CONST(-0.71886587142944), FRAC_CONST(0.78030979633331) },
- { FRAC_CONST(0.99793875217438), FRAC_CONST(0.90041309595108) },
- { FRAC_CONST(0.57563304901123), FRAC_CONST(-0.91034334897995) },
- { FRAC_CONST(0.28909647464752), FRAC_CONST(0.96307784318924) },
- { FRAC_CONST(0.42188999056816), FRAC_CONST(0.48148649930954) },
- { FRAC_CONST(0.93335050344467), FRAC_CONST(-0.43537023663521) },
- { FRAC_CONST(-0.97087377309799), FRAC_CONST(0.86636447906494) },
- { FRAC_CONST(0.36722871661186), FRAC_CONST(0.65291655063629) },
- { FRAC_CONST(-0.81093025207520), FRAC_CONST(0.08778370171785) },
- { FRAC_CONST(-0.26240602135658), FRAC_CONST(-0.92774093151093) },
- { FRAC_CONST(0.83996498584747), FRAC_CONST(0.55839848518372) },
- { FRAC_CONST(-0.99909615516663), FRAC_CONST(-0.96024608612061) },
- { FRAC_CONST(0.74649465084076), FRAC_CONST(0.12144893407822) },
- { FRAC_CONST(-0.74774593114853), FRAC_CONST(-0.26898062229156) },
- { FRAC_CONST(0.95781666040421), FRAC_CONST(-0.79047924280167) },
- { FRAC_CONST(0.95472306013107), FRAC_CONST(-0.08588775992393) },
- { FRAC_CONST(0.48708331584930), FRAC_CONST(0.99999040365219) },
- { FRAC_CONST(0.46332037448883), FRAC_CONST(0.10964126139879) },
- { FRAC_CONST(-0.76497006416321), FRAC_CONST(0.89210927486420) },
- { FRAC_CONST(0.57397389411926), FRAC_CONST(0.35289704799652) },
- { FRAC_CONST(0.75374317169189), FRAC_CONST(0.96705216169357) },
- { FRAC_CONST(-0.59174400568008), FRAC_CONST(-0.89405369758606) },
- { FRAC_CONST(0.75087904930115), FRAC_CONST(-0.29612672328949) },
- { FRAC_CONST(-0.98607856035233), FRAC_CONST(0.25034910440445) },
- { FRAC_CONST(-0.40761056542397), FRAC_CONST(-0.90045571327209) },
- { FRAC_CONST(0.66929268836975), FRAC_CONST(0.98629492521286) },
- { FRAC_CONST(-0.97463697195053), FRAC_CONST(-0.00190223299433) },
- { FRAC_CONST(0.90145510435104), FRAC_CONST(0.99781388044357) },
- { FRAC_CONST(-0.87259286642075), FRAC_CONST(0.99233585596085) },
- { FRAC_CONST(-0.91529458761215), FRAC_CONST(-0.15698707103729) },
- { FRAC_CONST(-0.03305738791823), FRAC_CONST(-0.37205263972282) },
- { FRAC_CONST(0.07223051041365), FRAC_CONST(-0.88805001974106) },
- { FRAC_CONST(0.99498009681702), FRAC_CONST(0.97094357013702) },
- { FRAC_CONST(-0.74904936552048), FRAC_CONST(0.99985486268997) },
- { FRAC_CONST(0.04585228487849), FRAC_CONST(0.99812334775925) },
- { FRAC_CONST(-0.89054954051971), FRAC_CONST(-0.31791913509369) },
- { FRAC_CONST(-0.83782142400742), FRAC_CONST(0.97637635469437) },
- { FRAC_CONST(0.33454805612564), FRAC_CONST(-0.86231517791748) },
- { FRAC_CONST(-0.99707579612732), FRAC_CONST(0.93237990140915) },
- { FRAC_CONST(-0.22827528417110), FRAC_CONST(0.18874759972095) },
- { FRAC_CONST(0.67248046398163), FRAC_CONST(-0.03646211326122) },
- { FRAC_CONST(-0.05146538093686), FRAC_CONST(-0.92599701881409) },
- { FRAC_CONST(0.99947297573090), FRAC_CONST(0.93625229597092) },
- { FRAC_CONST(0.66951125860214), FRAC_CONST(0.98905825614929) },
- { FRAC_CONST(-0.99602955579758), FRAC_CONST(-0.44654715061188) },
- { FRAC_CONST(0.82104903459549), FRAC_CONST(0.99540740251541) },
- { FRAC_CONST(0.99186509847641), FRAC_CONST(0.72022998332977) },
- { FRAC_CONST(-0.65284591913223), FRAC_CONST(0.52186721563339) },
- { FRAC_CONST(0.93885445594788), FRAC_CONST(-0.74895310401917) },
- { FRAC_CONST(0.96735250949860), FRAC_CONST(0.90891814231873) },
- { FRAC_CONST(-0.22225968539715), FRAC_CONST(0.57124030590057) },
- { FRAC_CONST(-0.44132784008980), FRAC_CONST(-0.92688840627670) },
- { FRAC_CONST(-0.85694974660873), FRAC_CONST(0.88844531774521) },
- { FRAC_CONST(0.91783040761948), FRAC_CONST(-0.46356892585754) },
- { FRAC_CONST(0.72556972503662), FRAC_CONST(-0.99899554252625) },
- { FRAC_CONST(-0.99711579084396), FRAC_CONST(0.58211559057236) },
- { FRAC_CONST(0.77638977766037), FRAC_CONST(0.94321835041046) },
- { FRAC_CONST(0.07717324048281), FRAC_CONST(0.58638399839401) },
- { FRAC_CONST(-0.56049829721451), FRAC_CONST(0.82522302865982) },
- { FRAC_CONST(0.98398894071579), FRAC_CONST(0.39467439055443) },
- { FRAC_CONST(0.47546947002411), FRAC_CONST(0.68613046407700) },
- { FRAC_CONST(0.65675091743469), FRAC_CONST(0.18331636488438) },
- { FRAC_CONST(0.03273375332355), FRAC_CONST(-0.74933111667633) },
- { FRAC_CONST(-0.38684144616127), FRAC_CONST(0.51337349414825) },
- { FRAC_CONST(-0.97346270084381), FRAC_CONST(-0.96549361944199) },
- { FRAC_CONST(-0.53282153606415), FRAC_CONST(-0.91423267126083) },
- { FRAC_CONST(0.99817311763763), FRAC_CONST(0.61133575439453) },
- { FRAC_CONST(-0.50254499912262), FRAC_CONST(-0.88829338550568) },
- { FRAC_CONST(0.01995873264968), FRAC_CONST(0.85223513841629) },
- { FRAC_CONST(0.99930381774902), FRAC_CONST(0.94578897953033) },
- { FRAC_CONST(0.82907766103745), FRAC_CONST(-0.06323442608118) },
- { FRAC_CONST(-0.58660709857941), FRAC_CONST(0.96840775012970) },
- { FRAC_CONST(-0.17573736608028), FRAC_CONST(-0.48166921734810) },
- { FRAC_CONST(0.83434289693832), FRAC_CONST(-0.13023450970650) },
- { FRAC_CONST(0.05946491286159), FRAC_CONST(0.20511047542095) },
- { FRAC_CONST(0.81505483388901), FRAC_CONST(-0.94685947895050) },
- { FRAC_CONST(-0.44976380467415), FRAC_CONST(0.40894573926926) },
- { FRAC_CONST(-0.89746475219727), FRAC_CONST(0.99846577644348) },
- { FRAC_CONST(0.39677256345749), FRAC_CONST(-0.74854665994644) },
- { FRAC_CONST(-0.07588948309422), FRAC_CONST(0.74096214771271) },
- { FRAC_CONST(0.76343196630478), FRAC_CONST(0.41746628284454) },
- { FRAC_CONST(-0.74490106105804), FRAC_CONST(0.94725912809372) },
- { FRAC_CONST(0.64880120754242), FRAC_CONST(0.41336661577225) },
- { FRAC_CONST(0.62319535017014), FRAC_CONST(-0.93098312616348) },
- { FRAC_CONST(0.42215818166733), FRAC_CONST(-0.07712787389755) },
- { FRAC_CONST(0.02704554051161), FRAC_CONST(-0.05417517945170) },
- { FRAC_CONST(0.80001771450043), FRAC_CONST(0.91542196273804) },
- { FRAC_CONST(-0.79351830482483), FRAC_CONST(-0.36208897829056) },
- { FRAC_CONST(0.63872361183167), FRAC_CONST(0.08128252625465) },
- { FRAC_CONST(0.52890521287918), FRAC_CONST(0.60048872232437) },
- { FRAC_CONST(0.74238550662994), FRAC_CONST(0.04491915181279) },
- { FRAC_CONST(0.99096131324768), FRAC_CONST(-0.19451183080673) },
- { FRAC_CONST(-0.80412328243256), FRAC_CONST(-0.88513815402985) },
- { FRAC_CONST(-0.64612615108490), FRAC_CONST(0.72198677062988) },
- { FRAC_CONST(0.11657770723104), FRAC_CONST(-0.83662831783295) },
- { FRAC_CONST(-0.95053184032440), FRAC_CONST(-0.96939903497696) },
- { FRAC_CONST(-0.62228870391846), FRAC_CONST(0.82767260074615) },
- { FRAC_CONST(0.03004475869238), FRAC_CONST(-0.99738895893097) },
- { FRAC_CONST(-0.97987216711044), FRAC_CONST(0.36526128649712) },
- { FRAC_CONST(-0.99986982345581), FRAC_CONST(-0.36021611094475) },
- { FRAC_CONST(0.89110648632050), FRAC_CONST(-0.97894251346588) },
- { FRAC_CONST(0.10407960414886), FRAC_CONST(0.77357792854309) },
- { FRAC_CONST(0.95964735746384), FRAC_CONST(-0.35435819625854) },
- { FRAC_CONST(0.50843232870102), FRAC_CONST(0.96107691526413) },
- { FRAC_CONST(0.17006334662437), FRAC_CONST(-0.76854026317596) },
- { FRAC_CONST(0.25872674584389), FRAC_CONST(0.99893301725388) },
- { FRAC_CONST(-0.01115998718888), FRAC_CONST(0.98496019840240) },
- { FRAC_CONST(-0.79598701000214), FRAC_CONST(0.97138410806656) },
- { FRAC_CONST(-0.99264711141586), FRAC_CONST(-0.99542820453644) },
- { FRAC_CONST(-0.99829661846161), FRAC_CONST(0.01877138763666) },
- { FRAC_CONST(-0.70801013708115), FRAC_CONST(0.33680686354637) },
- { FRAC_CONST(-0.70467054843903), FRAC_CONST(0.93272775411606) },
- { FRAC_CONST(0.99846023321152), FRAC_CONST(-0.98725748062134) },
- { FRAC_CONST(-0.63364970684052), FRAC_CONST(-0.16473594307899) },
- { FRAC_CONST(-0.16258217394352), FRAC_CONST(-0.95939123630524) },
- { FRAC_CONST(-0.43645593523979), FRAC_CONST(-0.94805032014847) },
- { FRAC_CONST(-0.99848473072052), FRAC_CONST(0.96245169639587) },
- { FRAC_CONST(-0.16796459257603), FRAC_CONST(-0.98987513780594) },
- { FRAC_CONST(-0.87979227304459), FRAC_CONST(-0.71725726127625) },
- { FRAC_CONST(0.44183099269867), FRAC_CONST(-0.93568974733353) },
- { FRAC_CONST(0.93310177326202), FRAC_CONST(-0.99913311004639) },
- { FRAC_CONST(-0.93941932916641), FRAC_CONST(-0.56409376859665) },
- { FRAC_CONST(-0.88590002059937), FRAC_CONST(0.47624599933624) },
- { FRAC_CONST(0.99971461296082), FRAC_CONST(-0.83889955282211) },
- { FRAC_CONST(-0.75376385450363), FRAC_CONST(0.00814643409103) },
- { FRAC_CONST(0.93887686729431), FRAC_CONST(-0.11284527927637) },
- { FRAC_CONST(0.85126435756683), FRAC_CONST(0.52349251508713) },
- { FRAC_CONST(0.39701420068741), FRAC_CONST(0.81779634952545) },
- { FRAC_CONST(-0.37024465203285), FRAC_CONST(-0.87071657180786) },
- { FRAC_CONST(-0.36024826765060), FRAC_CONST(0.34655734896660) },
- { FRAC_CONST(-0.93388813734055), FRAC_CONST(-0.84476542472839) },
- { FRAC_CONST(-0.65298801660538), FRAC_CONST(-0.18439576029778) },
- { FRAC_CONST(0.11960318684578), FRAC_CONST(0.99899345636368) },
- { FRAC_CONST(0.94292563199997), FRAC_CONST(0.83163905143738) },
- { FRAC_CONST(0.75081145763397), FRAC_CONST(-0.35533222556114) },
- { FRAC_CONST(0.56721979379654), FRAC_CONST(-0.24076835811138) },
- { FRAC_CONST(0.46857765316963), FRAC_CONST(-0.30140233039856) },
- { FRAC_CONST(0.97312313318253), FRAC_CONST(-0.99548190832138) },
- { FRAC_CONST(-0.38299977779388), FRAC_CONST(0.98516911268234) },
- { FRAC_CONST(0.41025799512863), FRAC_CONST(0.02116736955941) },
- { FRAC_CONST(0.09638062119484), FRAC_CONST(0.04411984235048) },
- { FRAC_CONST(-0.85283249616623), FRAC_CONST(0.91475564241409) },
- { FRAC_CONST(0.88866806030273), FRAC_CONST(-0.99735265970230) },
- { FRAC_CONST(-0.48202428221703), FRAC_CONST(-0.96805608272552) },
- { FRAC_CONST(0.27572581171989), FRAC_CONST(0.58634752035141) },
- { FRAC_CONST(-0.65889132022858), FRAC_CONST(0.58835631608963) },
- { FRAC_CONST(0.98838084936142), FRAC_CONST(0.99994349479675) },
- { FRAC_CONST(-0.20651349425316), FRAC_CONST(0.54593044519424) },
- { FRAC_CONST(-0.62126415967941), FRAC_CONST(-0.59893679618835) },
- { FRAC_CONST(0.20320105552673), FRAC_CONST(-0.86879181861877) },
- { FRAC_CONST(-0.97790551185608), FRAC_CONST(0.96290808916092) },
- { FRAC_CONST(0.11112534999847), FRAC_CONST(0.21484763920307) },
- { FRAC_CONST(-0.41368338465691), FRAC_CONST(0.28216838836670) },
- { FRAC_CONST(0.24133038520813), FRAC_CONST(0.51294362545013) },
- { FRAC_CONST(-0.66393411159515), FRAC_CONST(-0.08249679952860) },
- { FRAC_CONST(-0.53697830438614), FRAC_CONST(-0.97649902105331) },
- { FRAC_CONST(-0.97224736213684), FRAC_CONST(0.22081333398819) },
- { FRAC_CONST(0.87392479181290), FRAC_CONST(-0.12796173989773) },
- { FRAC_CONST(0.19050361216068), FRAC_CONST(0.01602615416050) },
- { FRAC_CONST(-0.46353441476822), FRAC_CONST(-0.95249038934708) },
- { FRAC_CONST(-0.07064096629620), FRAC_CONST(-0.94479805231094) },
- { FRAC_CONST(-0.92444086074829), FRAC_CONST(-0.10457590222359) },
- { FRAC_CONST(-0.83822596073151), FRAC_CONST(-0.01695043221116) },
- { FRAC_CONST(0.75214684009552), FRAC_CONST(-0.99955683946609) },
- { FRAC_CONST(-0.42102998495102), FRAC_CONST(0.99720942974091) },
- { FRAC_CONST(-0.72094786167145), FRAC_CONST(-0.35008960962296) },
- { FRAC_CONST(0.78843313455582), FRAC_CONST(0.52851396799088) },
- { FRAC_CONST(0.97394025325775), FRAC_CONST(-0.26695942878723) },
- { FRAC_CONST(0.99206465482712), FRAC_CONST(-0.57010120153427) },
- { FRAC_CONST(0.76789611577988), FRAC_CONST(-0.76519358158112) },
- { FRAC_CONST(-0.82002419233322), FRAC_CONST(-0.73530179262161) },
- { FRAC_CONST(0.81924992799759), FRAC_CONST(0.99698424339294) },
- { FRAC_CONST(-0.26719850301743), FRAC_CONST(0.68903368711472) },
- { FRAC_CONST(-0.43311259150505), FRAC_CONST(0.85321813821793) },
- { FRAC_CONST(0.99194979667664), FRAC_CONST(0.91876250505447) },
- { FRAC_CONST(-0.80691999197006), FRAC_CONST(-0.32627540826797) },
- { FRAC_CONST(0.43080005049706), FRAC_CONST(-0.21919095516205) },
- { FRAC_CONST(0.67709493637085), FRAC_CONST(-0.95478075742722) },
- { FRAC_CONST(0.56151771545410), FRAC_CONST(-0.70693808794022) },
- { FRAC_CONST(0.10831862688065), FRAC_CONST(-0.08628837019205) },
- { FRAC_CONST(0.91229414939880), FRAC_CONST(-0.65987348556519) },
- { FRAC_CONST(-0.48972892761230), FRAC_CONST(0.56289243698120) },
- { FRAC_CONST(-0.89033657312393), FRAC_CONST(-0.71656566858292) },
- { FRAC_CONST(0.65269446372986), FRAC_CONST(0.65916007757187) },
- { FRAC_CONST(0.67439478635788), FRAC_CONST(-0.81684380769730) },
- { FRAC_CONST(-0.47770830988884), FRAC_CONST(-0.16789555549622) },
- { FRAC_CONST(-0.99715977907181), FRAC_CONST(-0.93565785884857) },
- { FRAC_CONST(-0.90889590978622), FRAC_CONST(0.62034398317337) },
- { FRAC_CONST(-0.06618622690439), FRAC_CONST(-0.23812216520309) },
- { FRAC_CONST(0.99430269002914), FRAC_CONST(0.18812555074692) },
- { FRAC_CONST(0.97686403989792), FRAC_CONST(-0.28664535284042) },
- { FRAC_CONST(0.94813650846481), FRAC_CONST(-0.97506642341614) },
- { FRAC_CONST(-0.95434498786926), FRAC_CONST(-0.79607981443405) },
- { FRAC_CONST(-0.49104782938957), FRAC_CONST(0.32895213365555) },
- { FRAC_CONST(0.99881172180176), FRAC_CONST(0.88993984460831) },
- { FRAC_CONST(0.50449168682098), FRAC_CONST(-0.85995072126389) },
- { FRAC_CONST(0.47162890434265), FRAC_CONST(-0.18680204451084) },
- { FRAC_CONST(-0.62081581354141), FRAC_CONST(0.75000673532486) },
- { FRAC_CONST(-0.43867015838623), FRAC_CONST(0.99998068809509) },
- { FRAC_CONST(0.98630565404892), FRAC_CONST(-0.53578901290894) },
- { FRAC_CONST(-0.61510360240936), FRAC_CONST(-0.89515018463135) },
- { FRAC_CONST(-0.03841517493129), FRAC_CONST(-0.69888818264008) },
- { FRAC_CONST(-0.30102157592773), FRAC_CONST(-0.07667808979750) },
- { FRAC_CONST(0.41881284117699), FRAC_CONST(0.02188098989427) },
- { FRAC_CONST(-0.86135452985764), FRAC_CONST(0.98947483301163) },
- { FRAC_CONST(0.67226862907410), FRAC_CONST(-0.13494388759136) },
- { FRAC_CONST(-0.70737397670746), FRAC_CONST(-0.76547348499298) },
- { FRAC_CONST(0.94044947624207), FRAC_CONST(0.09026201069355) },
- { FRAC_CONST(-0.82386350631714), FRAC_CONST(0.08924768865108) },
- { FRAC_CONST(-0.32070666551590), FRAC_CONST(0.50143420696259) },
- { FRAC_CONST(0.57593160867691), FRAC_CONST(-0.98966425657272) },
- { FRAC_CONST(-0.36326017975807), FRAC_CONST(0.07440242916346) },
- { FRAC_CONST(0.99979043006897), FRAC_CONST(-0.14130286872387) },
- { FRAC_CONST(-0.92366021871567), FRAC_CONST(-0.97979295253754) },
- { FRAC_CONST(-0.44607177376747), FRAC_CONST(-0.54233253002167) },
- { FRAC_CONST(0.44226801395416), FRAC_CONST(0.71326756477356) },
- { FRAC_CONST(0.03671907261014), FRAC_CONST(0.63606387376785) },
- { FRAC_CONST(0.52175426483154), FRAC_CONST(-0.85396826267242) },
- { FRAC_CONST(-0.94701141119003), FRAC_CONST(-0.01826348155737) },
- { FRAC_CONST(-0.98759609460831), FRAC_CONST(0.82288712263107) },
- { FRAC_CONST(0.87434792518616), FRAC_CONST(0.89399492740631) },
- { FRAC_CONST(-0.93412041664124), FRAC_CONST(0.41374051570892) },
- { FRAC_CONST(0.96063941717148), FRAC_CONST(0.93116706609726) },
- { FRAC_CONST(0.97534251213074), FRAC_CONST(0.86150932312012) },
- { FRAC_CONST(0.99642467498779), FRAC_CONST(0.70190042257309) },
- { FRAC_CONST(-0.94705086946487), FRAC_CONST(-0.29580041766167) },
- { FRAC_CONST(0.91599804162979), FRAC_CONST(-0.98147833347321) }
-};
-
-#ifdef __cplusplus
-
-#endif
-#endif
-
diff --git a/src/libfaad/sbr_qmf.c b/src/libfaad/sbr_qmf.c
deleted file mode 100644
index d534a0442..000000000
--- a/src/libfaad/sbr_qmf.c
+++ /dev/null
@@ -1,633 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_qmf.c,v 1.7 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#include "common.h"
-#include "structs.h"
-
-#ifdef SBR_DEC
-
-
-#include <stdlib.h>
-#include <string.h>
-#include "sbr_dct.h"
-#include "sbr_qmf.h"
-#include "sbr_qmf_c.h"
-#include "sbr_syntax.h"
-
-qmfa_info *qmfa_init(uint8_t channels)
-{
- qmfa_info *qmfa = (qmfa_info*)faad_malloc(sizeof(qmfa_info));
-
- /* x is implemented as double ringbuffer */
- qmfa->x = (real_t*)faad_malloc(2 * channels * 10 * sizeof(real_t));
- memset(qmfa->x, 0, 2 * channels * 10 * sizeof(real_t));
-
- /* ringbuffer index */
- qmfa->x_index = 0;
-
- qmfa->channels = channels;
-
- return qmfa;
-}
-
-void qmfa_end(qmfa_info *qmfa)
-{
- if (qmfa)
- {
- if (qmfa->x) faad_free(qmfa->x);
- faad_free(qmfa);
- }
-}
-
-void sbr_qmf_analysis_32(sbr_info *sbr, qmfa_info *qmfa, const real_t *input,
- qmf_t X[MAX_NTSRHFG][64], uint8_t offset, uint8_t kx)
-{
- ALIGN real_t u[64];
-#ifndef SBR_LOW_POWER
- ALIGN real_t in_real[32], in_imag[32], out_real[32], out_imag[32];
-#else
- ALIGN real_t y[32];
-#endif
- uint16_t in = 0;
- uint8_t l;
-
- /* qmf subsample l */
- for (l = 0; l < sbr->numTimeSlotsRate; l++)
- {
- int16_t n;
-
- /* shift input buffer x */
- /* input buffer is not shifted anymore, x is implemented as double ringbuffer */
- //memmove(qmfa->x + 32, qmfa->x, (320-32)*sizeof(real_t));
-
- /* add new samples to input buffer x */
- for (n = 32 - 1; n >= 0; n--)
- {
-#ifdef FIXED_POINT
- qmfa->x[qmfa->x_index + n] = qmfa->x[qmfa->x_index + n + 320] = (input[in++]) >> 4;
-#else
- qmfa->x[qmfa->x_index + n] = qmfa->x[qmfa->x_index + n + 320] = input[in++];
-#endif
- }
-
- /* window and summation to create array u */
- for (n = 0; n < 64; n++)
- {
- u[n] = MUL_F(qmfa->x[qmfa->x_index + n], qmf_c[2*n]) +
- MUL_F(qmfa->x[qmfa->x_index + n + 64], qmf_c[2*(n + 64)]) +
- MUL_F(qmfa->x[qmfa->x_index + n + 128], qmf_c[2*(n + 128)]) +
- MUL_F(qmfa->x[qmfa->x_index + n + 192], qmf_c[2*(n + 192)]) +
- MUL_F(qmfa->x[qmfa->x_index + n + 256], qmf_c[2*(n + 256)]);
- }
-
- /* update ringbuffer index */
- qmfa->x_index -= 32;
- if (qmfa->x_index < 0)
- qmfa->x_index = (320-32);
-
- /* calculate 32 subband samples by introducing X */
-#ifdef SBR_LOW_POWER
- y[0] = u[48];
- for (n = 1; n < 16; n++)
- y[n] = u[n+48] + u[48-n];
- for (n = 16; n < 32; n++)
- y[n] = -u[n-16] + u[48-n];
-
- DCT3_32_unscaled(u, y);
-
- for (n = 0; n < 32; n++)
- {
- if (n < kx)
- {
-#ifdef FIXED_POINT
- QMF_RE(X[l + offset][n]) = u[n] /*<< 1*/;
-#else
- QMF_RE(X[l + offset][n]) = 2. * u[n];
-#endif
- } else {
- QMF_RE(X[l + offset][n]) = 0;
- }
- }
-#else
-
- // Reordering of data moved from DCT_IV to here
- in_imag[31] = u[1];
- in_real[0] = u[0];
- for (n = 1; n < 31; n++)
- {
- in_imag[31 - n] = u[n+1];
- in_real[n] = -u[64-n];
- }
- in_imag[0] = u[32];
- in_real[31] = -u[33];
-
- // dct4_kernel is DCT_IV without reordering which is done before and after FFT
- dct4_kernel(in_real, in_imag, out_real, out_imag);
-
- // Reordering of data moved from DCT_IV to here
- for (n = 0; n < 16; n++) {
- if (2*n+1 < kx) {
-#ifdef FIXED_POINT
- QMF_RE(X[l + offset][2*n]) = out_real[n];
- QMF_IM(X[l + offset][2*n]) = out_imag[n];
- QMF_RE(X[l + offset][2*n+1]) = -out_imag[31-n];
- QMF_IM(X[l + offset][2*n+1]) = -out_real[31-n];
-#else
- QMF_RE(X[l + offset][2*n]) = 2. * out_real[n];
- QMF_IM(X[l + offset][2*n]) = 2. * out_imag[n];
- QMF_RE(X[l + offset][2*n+1]) = -2. * out_imag[31-n];
- QMF_IM(X[l + offset][2*n+1]) = -2. * out_real[31-n];
-#endif
- } else {
- if (2*n < kx) {
-#ifdef FIXED_POINT
- QMF_RE(X[l + offset][2*n]) = out_real[n];
- QMF_IM(X[l + offset][2*n]) = out_imag[n];
-#else
- QMF_RE(X[l + offset][2*n]) = 2. * out_real[n];
- QMF_IM(X[l + offset][2*n]) = 2. * out_imag[n];
-#endif
- }
- else {
- QMF_RE(X[l + offset][2*n]) = 0;
- QMF_IM(X[l + offset][2*n]) = 0;
- }
- QMF_RE(X[l + offset][2*n+1]) = 0;
- QMF_IM(X[l + offset][2*n+1]) = 0;
- }
- }
-#endif
- }
-}
-
-static const complex_t qmf32_pre_twiddle[] =
-{
- { FRAC_CONST(0.999924701839145), FRAC_CONST(-0.012271538285720) },
- { FRAC_CONST(0.999322384588350), FRAC_CONST(-0.036807222941359) },
- { FRAC_CONST(0.998118112900149), FRAC_CONST(-0.061320736302209) },
- { FRAC_CONST(0.996312612182778), FRAC_CONST(-0.085797312344440) },
- { FRAC_CONST(0.993906970002356), FRAC_CONST(-0.110222207293883) },
- { FRAC_CONST(0.990902635427780), FRAC_CONST(-0.134580708507126) },
- { FRAC_CONST(0.987301418157858), FRAC_CONST(-0.158858143333861) },
- { FRAC_CONST(0.983105487431216), FRAC_CONST(-0.183039887955141) },
- { FRAC_CONST(0.978317370719628), FRAC_CONST(-0.207111376192219) },
- { FRAC_CONST(0.972939952205560), FRAC_CONST(-0.231058108280671) },
- { FRAC_CONST(0.966976471044852), FRAC_CONST(-0.254865659604515) },
- { FRAC_CONST(0.960430519415566), FRAC_CONST(-0.278519689385053) },
- { FRAC_CONST(0.953306040354194), FRAC_CONST(-0.302005949319228) },
- { FRAC_CONST(0.945607325380521), FRAC_CONST(-0.325310292162263) },
- { FRAC_CONST(0.937339011912575), FRAC_CONST(-0.348418680249435) },
- { FRAC_CONST(0.928506080473216), FRAC_CONST(-0.371317193951838) },
- { FRAC_CONST(0.919113851690058), FRAC_CONST(-0.393992040061048) },
- { FRAC_CONST(0.909167983090522), FRAC_CONST(-0.416429560097637) },
- { FRAC_CONST(0.898674465693954), FRAC_CONST(-0.438616238538528) },
- { FRAC_CONST(0.887639620402854), FRAC_CONST(-0.460538710958240) },
- { FRAC_CONST(0.876070094195407), FRAC_CONST(-0.482183772079123) },
- { FRAC_CONST(0.863972856121587), FRAC_CONST(-0.503538383725718) },
- { FRAC_CONST(0.851355193105265), FRAC_CONST(-0.524589682678469) },
- { FRAC_CONST(0.838224705554838), FRAC_CONST(-0.545324988422046) },
- { FRAC_CONST(0.824589302785025), FRAC_CONST(-0.565731810783613) },
- { FRAC_CONST(0.810457198252595), FRAC_CONST(-0.585797857456439) },
- { FRAC_CONST(0.795836904608884), FRAC_CONST(-0.605511041404326) },
- { FRAC_CONST(0.780737228572094), FRAC_CONST(-0.624859488142386) },
- { FRAC_CONST(0.765167265622459), FRAC_CONST(-0.643831542889791) },
- { FRAC_CONST(0.749136394523459), FRAC_CONST(-0.662415777590172) },
- { FRAC_CONST(0.732654271672413), FRAC_CONST(-0.680600997795453) },
- { FRAC_CONST(0.715730825283819), FRAC_CONST(-0.698376249408973) }
-};
-
-qmfs_info *qmfs_init(uint8_t channels)
-{
- qmfs_info *qmfs = (qmfs_info*)faad_malloc(sizeof(qmfs_info));
-
- /* v is a double ringbuffer */
- qmfs->v = (real_t*)faad_malloc(2 * channels * 20 * sizeof(real_t));
- memset(qmfs->v, 0, 2 * channels * 20 * sizeof(real_t));
-
- qmfs->v_index = 0;
-
- qmfs->channels = channels;
-
- return qmfs;
-}
-
-void qmfs_end(qmfs_info *qmfs)
-{
- if (qmfs)
- {
- if (qmfs->v) faad_free(qmfs->v);
- faad_free(qmfs);
- }
-}
-
-#ifdef SBR_LOW_POWER
-
-void sbr_qmf_synthesis_32(sbr_info *sbr, qmfs_info *qmfs, qmf_t X[MAX_NTSRHFG][64],
- real_t *output)
-{
- ALIGN real_t x[16];
- ALIGN real_t y[16];
- int16_t n, k, out = 0;
- uint8_t l;
-
- /* qmf subsample l */
- for (l = 0; l < sbr->numTimeSlotsRate; l++)
- {
- /* shift buffers */
- /* we are not shifting v, it is a double ringbuffer */
- //memmove(qmfs->v + 64, qmfs->v, (640-64)*sizeof(real_t));
-
- /* calculate 64 samples */
- for (k = 0; k < 16; k++)
- {
-#ifdef FIXED_POINT
- y[k] = (QMF_RE(X[l][k]) - QMF_RE(X[l][31 - k]));
- x[k] = (QMF_RE(X[l][k]) + QMF_RE(X[l][31 - k]));
-#else
- y[k] = (QMF_RE(X[l][k]) - QMF_RE(X[l][31 - k])) / 32.0;
- x[k] = (QMF_RE(X[l][k]) + QMF_RE(X[l][31 - k])) / 32.0;
-#endif
- }
-
- /* even n samples */
- DCT2_16_unscaled(x, x);
- /* odd n samples */
- DCT4_16(y, y);
-
- for (n = 8; n < 24; n++)
- {
- qmfs->v[qmfs->v_index + n*2] = qmfs->v[qmfs->v_index + 640 + n*2] = x[n-8];
- qmfs->v[qmfs->v_index + n*2+1] = qmfs->v[qmfs->v_index + 640 + n*2+1] = y[n-8];
- }
- for (n = 0; n < 16; n++)
- {
- qmfs->v[qmfs->v_index + n] = qmfs->v[qmfs->v_index + 640 + n] = qmfs->v[qmfs->v_index + 32-n];
- }
- qmfs->v[qmfs->v_index + 48] = qmfs->v[qmfs->v_index + 640 + 48] = 0;
- for (n = 1; n < 16; n++)
- {
- qmfs->v[qmfs->v_index + 48+n] = qmfs->v[qmfs->v_index + 640 + 48+n] = -qmfs->v[qmfs->v_index + 48-n];
- }
-
- /* calculate 32 output samples and window */
- for (k = 0; k < 32; k++)
- {
- output[out++] = MUL_F(qmfs->v[qmfs->v_index + k], qmf_c[2*k]) +
- MUL_F(qmfs->v[qmfs->v_index + 96 + k], qmf_c[64 + 2*k]) +
- MUL_F(qmfs->v[qmfs->v_index + 128 + k], qmf_c[128 + 2*k]) +
- MUL_F(qmfs->v[qmfs->v_index + 224 + k], qmf_c[192 + 2*k]) +
- MUL_F(qmfs->v[qmfs->v_index + 256 + k], qmf_c[256 + 2*k]) +
- MUL_F(qmfs->v[qmfs->v_index + 352 + k], qmf_c[320 + 2*k]) +
- MUL_F(qmfs->v[qmfs->v_index + 384 + k], qmf_c[384 + 2*k]) +
- MUL_F(qmfs->v[qmfs->v_index + 480 + k], qmf_c[448 + 2*k]) +
- MUL_F(qmfs->v[qmfs->v_index + 512 + k], qmf_c[512 + 2*k]) +
- MUL_F(qmfs->v[qmfs->v_index + 608 + k], qmf_c[576 + 2*k]);
- }
-
- /* update the ringbuffer index */
- qmfs->v_index -= 64;
- if (qmfs->v_index < 0)
- qmfs->v_index = (640-64);
- }
-}
-
-void sbr_qmf_synthesis_64(sbr_info *sbr, qmfs_info *qmfs, qmf_t X[MAX_NTSRHFG][64],
- real_t *output)
-{
- ALIGN real_t x[64];
- ALIGN real_t y[64];
- int16_t n, k, out = 0;
- uint8_t l;
-
-
- /* qmf subsample l */
- for (l = 0; l < sbr->numTimeSlotsRate; l++)
- {
- /* shift buffers */
- /* we are not shifting v, it is a double ringbuffer */
- //memmove(qmfs->v + 128, qmfs->v, (1280-128)*sizeof(real_t));
-
- /* calculate 128 samples */
- for (k = 0; k < 32; k++)
- {
-#ifdef FIXED_POINT
- y[k] = (QMF_RE(X[l][k]) - QMF_RE(X[l][63 - k]));
- x[k] = (QMF_RE(X[l][k]) + QMF_RE(X[l][63 - k]));
-#else
- y[k] = (QMF_RE(X[l][k]) - QMF_RE(X[l][63 - k])) / 32.0;
- x[k] = (QMF_RE(X[l][k]) + QMF_RE(X[l][63 - k])) / 32.0;
-#endif
- }
-
- /* even n samples */
- DCT2_32_unscaled(x, x);
- /* odd n samples */
- DCT4_32(y, y);
-
- for (n = 16; n < 48; n++)
- {
- qmfs->v[qmfs->v_index + n*2] = qmfs->v[qmfs->v_index + 1280 + n*2] = x[n-16];
- qmfs->v[qmfs->v_index + n*2+1] = qmfs->v[qmfs->v_index + 1280 + n*2+1] = y[n-16];
- }
- for (n = 0; n < 32; n++)
- {
- qmfs->v[qmfs->v_index + n] = qmfs->v[qmfs->v_index + 1280 + n] = qmfs->v[qmfs->v_index + 64-n];
- }
- qmfs->v[qmfs->v_index + 96] = qmfs->v[qmfs->v_index + 1280 + 96] = 0;
- for (n = 1; n < 32; n++)
- {
- qmfs->v[qmfs->v_index + 96+n] = qmfs->v[qmfs->v_index + 1280 + 96+n] = -qmfs->v[qmfs->v_index + 96-n];
- }
-
- /* calculate 64 output samples and window */
- for (k = 0; k < 64; k++)
- {
- output[out++] = MUL_F(qmfs->v[qmfs->v_index + k], qmf_c[k]) +
- MUL_F(qmfs->v[qmfs->v_index + 192 + k], qmf_c[64 + k]) +
- MUL_F(qmfs->v[qmfs->v_index + 256 + k], qmf_c[128 + k]) +
- MUL_F(qmfs->v[qmfs->v_index + 256 + 192 + k], qmf_c[128 + 64 + k]) +
- MUL_F(qmfs->v[qmfs->v_index + 512 + k], qmf_c[256 + k]) +
- MUL_F(qmfs->v[qmfs->v_index + 512 + 192 + k], qmf_c[256 + 64 + k]) +
- MUL_F(qmfs->v[qmfs->v_index + 768 + k], qmf_c[384 + k]) +
- MUL_F(qmfs->v[qmfs->v_index + 768 + 192 + k], qmf_c[384 + 64 + k]) +
- MUL_F(qmfs->v[qmfs->v_index + 1024 + k], qmf_c[512 + k]) +
- MUL_F(qmfs->v[qmfs->v_index + 1024 + 192 + k], qmf_c[512 + 64 + k]);
- }
-
- /* update the ringbuffer index */
- qmfs->v_index -= 128;
- if (qmfs->v_index < 0)
- qmfs->v_index = (1280-128);
- }
-}
-#else
-void sbr_qmf_synthesis_32(sbr_info *sbr, qmfs_info *qmfs, qmf_t X[MAX_NTSRHFG][64],
- real_t *output)
-{
- ALIGN real_t x1[32], x2[32];
-#ifndef FIXED_POINT
- real_t scale = 1.f/64.f;
-#endif
- int16_t n, k, out = 0;
- uint8_t l;
-
-
- /* qmf subsample l */
- for (l = 0; l < sbr->numTimeSlotsRate; l++)
- {
- /* shift buffer v */
- /* buffer is not shifted, we are using a ringbuffer */
- //memmove(qmfs->v + 64, qmfs->v, (640-64)*sizeof(real_t));
-
- /* calculate 64 samples */
- /* complex pre-twiddle */
- for (k = 0; k < 32; k++)
- {
- x1[k] = MUL_F(QMF_RE(X[l][k]), RE(qmf32_pre_twiddle[k])) - MUL_F(QMF_IM(X[l][k]), IM(qmf32_pre_twiddle[k]));
- x2[k] = MUL_F(QMF_IM(X[l][k]), RE(qmf32_pre_twiddle[k])) + MUL_F(QMF_RE(X[l][k]), IM(qmf32_pre_twiddle[k]));
-
-#ifndef FIXED_POINT
- x1[k] *= scale;
- x2[k] *= scale;
-#else
- x1[k] >>= 1;
- x2[k] >>= 1;
-#endif
- }
-
- /* transform */
- DCT4_32(x1, x1);
- DST4_32(x2, x2);
-
- for (n = 0; n < 32; n++)
- {
- qmfs->v[qmfs->v_index + n] = qmfs->v[qmfs->v_index + 640 + n] = -x1[n] + x2[n];
- qmfs->v[qmfs->v_index + 63 - n] = qmfs->v[qmfs->v_index + 640 + 63 - n] = x1[n] + x2[n];
- }
-
- /* calculate 32 output samples and window */
- for (k = 0; k < 32; k++)
- {
- output[out++] = MUL_F(qmfs->v[qmfs->v_index + k], qmf_c[2*k]) +
- MUL_F(qmfs->v[qmfs->v_index + 96 + k], qmf_c[64 + 2*k]) +
- MUL_F(qmfs->v[qmfs->v_index + 128 + k], qmf_c[128 + 2*k]) +
- MUL_F(qmfs->v[qmfs->v_index + 224 + k], qmf_c[192 + 2*k]) +
- MUL_F(qmfs->v[qmfs->v_index + 256 + k], qmf_c[256 + 2*k]) +
- MUL_F(qmfs->v[qmfs->v_index + 352 + k], qmf_c[320 + 2*k]) +
- MUL_F(qmfs->v[qmfs->v_index + 384 + k], qmf_c[384 + 2*k]) +
- MUL_F(qmfs->v[qmfs->v_index + 480 + k], qmf_c[448 + 2*k]) +
- MUL_F(qmfs->v[qmfs->v_index + 512 + k], qmf_c[512 + 2*k]) +
- MUL_F(qmfs->v[qmfs->v_index + 608 + k], qmf_c[576 + 2*k]);
- }
-
- /* update ringbuffer index */
- qmfs->v_index -= 64;
- if (qmfs->v_index < 0)
- qmfs->v_index = (640 - 64);
- }
-}
-
-void sbr_qmf_synthesis_64(sbr_info *sbr, qmfs_info *qmfs, qmf_t X[MAX_NTSRHFG][64],
- real_t *output)
-{
-// ALIGN real_t x1[64], x2[64];
-#ifndef SBR_LOW_POWER
- ALIGN real_t in_real1[32], in_imag1[32], out_real1[32], out_imag1[32];
- ALIGN real_t in_real2[32], in_imag2[32], out_real2[32], out_imag2[32];
-#endif
- qmf_t * pX;
- real_t * pring_buffer_1, * pring_buffer_3;
-// real_t * ptemp_1, * ptemp_2;
-#ifdef PREFER_POINTERS
- // These pointers are used if target platform has autoinc address generators
- real_t * pring_buffer_2, * pring_buffer_4;
- real_t * pring_buffer_5, * pring_buffer_6;
- real_t * pring_buffer_7, * pring_buffer_8;
- real_t * pring_buffer_9, * pring_buffer_10;
- const real_t * pqmf_c_1, * pqmf_c_2, * pqmf_c_3, * pqmf_c_4;
- const real_t * pqmf_c_5, * pqmf_c_6, * pqmf_c_7, * pqmf_c_8;
- const real_t * pqmf_c_9, * pqmf_c_10;
-#endif // #ifdef PREFER_POINTERS
-#ifndef FIXED_POINT
- real_t scale = 1.f/64.f;
-#endif
- int16_t n, k, out = 0;
- uint8_t l;
-
-
- /* qmf subsample l */
- for (l = 0; l < sbr->numTimeSlotsRate; l++)
- {
- /* shift buffer v */
- /* buffer is not shifted, we use double ringbuffer */
- //memmove(qmfs->v + 128, qmfs->v, (1280-128)*sizeof(real_t));
-
- /* calculate 128 samples */
-#ifndef FIXED_POINT
-
- pX = X[l];
-
- in_imag1[31] = scale*QMF_RE(pX[1]);
- in_real1[0] = scale*QMF_RE(pX[0]);
- in_imag2[31] = scale*QMF_IM(pX[63-1]);
- in_real2[0] = scale*QMF_IM(pX[63-0]);
- for (k = 1; k < 31; k++)
- {
- in_imag1[31 - k] = scale*QMF_RE(pX[2*k + 1]);
- in_real1[ k] = scale*QMF_RE(pX[2*k ]);
- in_imag2[31 - k] = scale*QMF_IM(pX[63 - (2*k + 1)]);
- in_real2[ k] = scale*QMF_IM(pX[63 - (2*k )]);
- }
- in_imag1[0] = scale*QMF_RE(pX[63]);
- in_real1[31] = scale*QMF_RE(pX[62]);
- in_imag2[0] = scale*QMF_IM(pX[63-63]);
- in_real2[31] = scale*QMF_IM(pX[63-62]);
-
-#else
-
- pX = X[l];
-
- in_imag1[31] = QMF_RE(pX[1]) >> 1;
- in_real1[0] = QMF_RE(pX[0]) >> 1;
- in_imag2[31] = QMF_IM(pX[62]) >> 1;
- in_real2[0] = QMF_IM(pX[63]) >> 1;
- for (k = 1; k < 31; k++)
- {
- in_imag1[31 - k] = QMF_RE(pX[2*k + 1]) >> 1;
- in_real1[ k] = QMF_RE(pX[2*k ]) >> 1;
- in_imag2[31 - k] = QMF_IM(pX[63 - (2*k + 1)]) >> 1;
- in_real2[ k] = QMF_IM(pX[63 - (2*k )]) >> 1;
- }
- in_imag1[0] = QMF_RE(pX[63]) >> 1;
- in_real1[31] = QMF_RE(pX[62]) >> 1;
- in_imag2[0] = QMF_IM(pX[0]) >> 1;
- in_real2[31] = QMF_IM(pX[1]) >> 1;
-
-#endif
-
-
- // dct4_kernel is DCT_IV without reordering which is done before and after FFT
- dct4_kernel(in_real1, in_imag1, out_real1, out_imag1);
- dct4_kernel(in_real2, in_imag2, out_real2, out_imag2);
-
-
- pring_buffer_1 = qmfs->v + qmfs->v_index;
- pring_buffer_3 = pring_buffer_1 + 1280;
-#ifdef PREFER_POINTERS
- pring_buffer_2 = pring_buffer_1 + 127;
- pring_buffer_4 = pring_buffer_1 + (1280 + 127);
-#endif // #ifdef PREFER_POINTERS
-// ptemp_1 = x1;
-// ptemp_2 = x2;
-#ifdef PREFER_POINTERS
- for (n = 0; n < 32; n ++)
- {
- //real_t x1 = *ptemp_1++;
- //real_t x2 = *ptemp_2++;
- // pring_buffer_3 and pring_buffer_4 are needed only for double ring buffer
- *pring_buffer_1++ = *pring_buffer_3++ = out_real2[n] - out_real1[n];
- *pring_buffer_2-- = *pring_buffer_4-- = out_real2[n] + out_real1[n];
- //x1 = *ptemp_1++;
- //x2 = *ptemp_2++;
- *pring_buffer_1++ = *pring_buffer_3++ = out_imag2[31-n] + out_imag1[31-n];
- *pring_buffer_2-- = *pring_buffer_4-- = out_imag2[31-n] - out_imag1[31-n];
- }
-#else // #ifdef PREFER_POINTERS
-
- for (n = 0; n < 32; n++)
- {
- // pring_buffer_3 and pring_buffer_4 are needed only for double ring buffer
- pring_buffer_1[2*n] = pring_buffer_3[2*n] = out_real2[n] - out_real1[n];
- pring_buffer_1[127-2*n] = pring_buffer_3[127-2*n] = out_real2[n] + out_real1[n];
- pring_buffer_1[2*n+1] = pring_buffer_3[2*n+1] = out_imag2[31-n] + out_imag1[31-n];
- pring_buffer_1[127-(2*n+1)] = pring_buffer_3[127-(2*n+1)] = out_imag2[31-n] - out_imag1[31-n];
- }
-
-#endif // #ifdef PREFER_POINTERS
-
- pring_buffer_1 = qmfs->v + qmfs->v_index;
-#ifdef PREFER_POINTERS
- pring_buffer_2 = pring_buffer_1 + 192;
- pring_buffer_3 = pring_buffer_1 + 256;
- pring_buffer_4 = pring_buffer_1 + (256 + 192);
- pring_buffer_5 = pring_buffer_1 + 512;
- pring_buffer_6 = pring_buffer_1 + (512 + 192);
- pring_buffer_7 = pring_buffer_1 + 768;
- pring_buffer_8 = pring_buffer_1 + (768 + 192);
- pring_buffer_9 = pring_buffer_1 + 1024;
- pring_buffer_10 = pring_buffer_1 + (1024 + 192);
- pqmf_c_1 = qmf_c;
- pqmf_c_2 = qmf_c + 64;
- pqmf_c_3 = qmf_c + 128;
- pqmf_c_4 = qmf_c + 192;
- pqmf_c_5 = qmf_c + 256;
- pqmf_c_6 = qmf_c + 320;
- pqmf_c_7 = qmf_c + 384;
- pqmf_c_8 = qmf_c + 448;
- pqmf_c_9 = qmf_c + 512;
- pqmf_c_10 = qmf_c + 576;
-#endif // #ifdef PREFER_POINTERS
-
- /* calculate 64 output samples and window */
- for (k = 0; k < 64; k++)
- {
-#ifdef PREFER_POINTERS
- output[out++] =
- MUL_F(*pring_buffer_1++, *pqmf_c_1++) +
- MUL_F(*pring_buffer_2++, *pqmf_c_2++) +
- MUL_F(*pring_buffer_3++, *pqmf_c_3++) +
- MUL_F(*pring_buffer_4++, *pqmf_c_4++) +
- MUL_F(*pring_buffer_5++, *pqmf_c_5++) +
- MUL_F(*pring_buffer_6++, *pqmf_c_6++) +
- MUL_F(*pring_buffer_7++, *pqmf_c_7++) +
- MUL_F(*pring_buffer_8++, *pqmf_c_8++) +
- MUL_F(*pring_buffer_9++, *pqmf_c_9++) +
- MUL_F(*pring_buffer_10++, *pqmf_c_10++);
-#else // #ifdef PREFER_POINTERS
- output[out++] =
- MUL_F(pring_buffer_1[k+0], qmf_c[k+0]) +
- MUL_F(pring_buffer_1[k+192], qmf_c[k+64]) +
- MUL_F(pring_buffer_1[k+256], qmf_c[k+128]) +
- MUL_F(pring_buffer_1[k+(256+192)], qmf_c[k+192]) +
- MUL_F(pring_buffer_1[k+512], qmf_c[k+256]) +
- MUL_F(pring_buffer_1[k+(512+192)], qmf_c[k+320]) +
- MUL_F(pring_buffer_1[k+768], qmf_c[k+384]) +
- MUL_F(pring_buffer_1[k+(768+192)], qmf_c[k+448]) +
- MUL_F(pring_buffer_1[k+1024], qmf_c[k+512]) +
- MUL_F(pring_buffer_1[k+(1024+192)], qmf_c[k+576]);
-#endif // #ifdef PREFER_POINTERS
- }
-
- /* update ringbuffer index */
- qmfs->v_index -= 128;
- if (qmfs->v_index < 0)
- qmfs->v_index = (1280 - 128);
- }
-}
-#endif
-
-#endif
diff --git a/src/libfaad/sbr_qmf.h b/src/libfaad/sbr_qmf.h
deleted file mode 100644
index b1d673d9c..000000000
--- a/src/libfaad/sbr_qmf.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_qmf.h,v 1.7 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __SBR_QMF_H__
-#define __SBR_QMF_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-qmfa_info *qmfa_init(uint8_t channels);
-void qmfa_end(qmfa_info *qmfa);
-qmfs_info *qmfs_init(uint8_t channels);
-void qmfs_end(qmfs_info *qmfs);
-
-void sbr_qmf_analysis_32(sbr_info *sbr, qmfa_info *qmfa, const real_t *input,
- qmf_t X[MAX_NTSRHFG][64], uint8_t offset, uint8_t kx);
-void sbr_qmf_synthesis_32(sbr_info *sbr, qmfs_info *qmfs, qmf_t X[MAX_NTSRHFG][64],
- real_t *output);
-void sbr_qmf_synthesis_64(sbr_info *sbr, qmfs_info *qmfs, qmf_t X[MAX_NTSRHFG][64],
- real_t *output);
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
diff --git a/src/libfaad/sbr_qmf_c.h b/src/libfaad/sbr_qmf_c.h
deleted file mode 100644
index d9c079520..000000000
--- a/src/libfaad/sbr_qmf_c.h
+++ /dev/null
@@ -1,365 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_qmf_c.h,v 1.5 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __SBR_QMF_C_H__
-#define __SBR_QMF_C_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#ifdef _MSC_VER
-#pragma warning(disable:4305)
-#pragma warning(disable:4244)
-#endif
-
-ALIGN static const real_t qmf_c[640] = {
- FRAC_CONST(0), FRAC_CONST(-0.00055252865047),
- FRAC_CONST(-0.00056176925738), FRAC_CONST(-0.00049475180896),
- FRAC_CONST(-0.00048752279712), FRAC_CONST(-0.00048937912498),
- FRAC_CONST(-0.00050407143497), FRAC_CONST(-0.00052265642972),
- FRAC_CONST(-0.00054665656337), FRAC_CONST(-0.00056778025613),
- FRAC_CONST(-0.00058709304852), FRAC_CONST(-0.00061327473938),
- FRAC_CONST(-0.00063124935319), FRAC_CONST(-0.00065403333621),
- FRAC_CONST(-0.00067776907764), FRAC_CONST(-0.00069416146273),
- FRAC_CONST(-0.00071577364744), FRAC_CONST(-0.00072550431222),
- FRAC_CONST(-0.00074409418541), FRAC_CONST(-0.00074905980532),
- FRAC_CONST(-0.0007681371927), FRAC_CONST(-0.00077248485949),
- FRAC_CONST(-0.00078343322877), FRAC_CONST(-0.00077798694927),
- FRAC_CONST(-0.000780366471), FRAC_CONST(-0.00078014496257),
- FRAC_CONST(-0.0007757977331), FRAC_CONST(-0.00076307935757),
- FRAC_CONST(-0.00075300014201), FRAC_CONST(-0.00073193571525),
- FRAC_CONST(-0.00072153919876), FRAC_CONST(-0.00069179375372),
- FRAC_CONST(-0.00066504150893), FRAC_CONST(-0.00063415949025),
- FRAC_CONST(-0.0005946118933), FRAC_CONST(-0.00055645763906),
- FRAC_CONST(-0.00051455722108), FRAC_CONST(-0.00046063254803),
- FRAC_CONST(-0.00040951214522), FRAC_CONST(-0.00035011758756),
- FRAC_CONST(-0.00028969811748), FRAC_CONST(-0.0002098337344),
- FRAC_CONST(-0.00014463809349), FRAC_CONST(-6.173344072E-005),
- FRAC_CONST(1.349497418E-005), FRAC_CONST(0.00010943831274),
- FRAC_CONST(0.00020430170688), FRAC_CONST(0.00029495311041),
- FRAC_CONST(0.0004026540216), FRAC_CONST(0.00051073884952),
- FRAC_CONST(0.00062393761391), FRAC_CONST(0.00074580258865),
- FRAC_CONST(0.00086084433262), FRAC_CONST(0.00098859883015),
- FRAC_CONST(0.00112501551307), FRAC_CONST(0.00125778846475),
- FRAC_CONST(0.00139024948272), FRAC_CONST(0.00154432198471),
- FRAC_CONST(0.00168680832531), FRAC_CONST(0.00183482654224),
- FRAC_CONST(0.00198411407369), FRAC_CONST(0.00214615835557),
- FRAC_CONST(0.00230172547746), FRAC_CONST(0.00246256169126),
- FRAC_CONST(0.00262017586902), FRAC_CONST(0.00278704643465),
- FRAC_CONST(0.00294694477165), FRAC_CONST(0.00311254206525),
- FRAC_CONST(0.00327396134847), FRAC_CONST(0.00344188741828),
- FRAC_CONST(0.00360082681231), FRAC_CONST(0.00376039229104),
- FRAC_CONST(0.00392074323703), FRAC_CONST(0.00408197531935),
- FRAC_CONST(0.0042264269227), FRAC_CONST(0.00437307196781),
- FRAC_CONST(0.00452098527825), FRAC_CONST(0.00466064606118),
- FRAC_CONST(0.00479325608498), FRAC_CONST(0.00491376035745),
- FRAC_CONST(0.00503930226013), FRAC_CONST(0.00514073539032),
- FRAC_CONST(0.00524611661324), FRAC_CONST(0.00534716811982),
- FRAC_CONST(0.00541967759307), FRAC_CONST(0.00548760401507),
- FRAC_CONST(0.00554757145088), FRAC_CONST(0.00559380230045),
- FRAC_CONST(0.00562206432097), FRAC_CONST(0.00564551969164),
- FRAC_CONST(0.00563891995151), FRAC_CONST(0.00562661141932),
- FRAC_CONST(0.0055917128663), FRAC_CONST(0.005540436394),
- FRAC_CONST(0.0054753783077), FRAC_CONST(0.0053838975897),
- FRAC_CONST(0.00527157587272), FRAC_CONST(0.00513822754514),
- FRAC_CONST(0.00498396877629), FRAC_CONST(0.004810946906),
- FRAC_CONST(0.00460395301471), FRAC_CONST(0.00438018617447),
- FRAC_CONST(0.0041251642327), FRAC_CONST(0.00384564081246),
- FRAC_CONST(0.00354012465507), FRAC_CONST(0.00320918858098),
- FRAC_CONST(0.00284467578623), FRAC_CONST(0.00245085400321),
- FRAC_CONST(0.0020274176185), FRAC_CONST(0.00157846825768),
- FRAC_CONST(0.00109023290512), FRAC_CONST(0.0005832264248),
- FRAC_CONST(2.760451905E-005), FRAC_CONST(-0.00054642808664),
- FRAC_CONST(-0.00115681355227), FRAC_CONST(-0.00180394725893),
- FRAC_CONST(-0.00248267236449), FRAC_CONST(-0.003193377839),
- FRAC_CONST(-0.00394011240522), FRAC_CONST(-0.004722259624),
- FRAC_CONST(-0.00553372111088), FRAC_CONST(-0.00637922932685),
- FRAC_CONST(-0.00726158168517), FRAC_CONST(-0.00817982333726),
- FRAC_CONST(-0.00913253296085), FRAC_CONST(-0.01011502154986),
- FRAC_CONST(-0.01113155480321), FRAC_CONST(-0.01218499959508),
- FRAC_CONST(0.01327182200351), FRAC_CONST(0.01439046660792),
- FRAC_CONST(0.01554055533423), FRAC_CONST(0.01673247129989),
- FRAC_CONST(0.01794333813443), FRAC_CONST(0.01918724313698),
- FRAC_CONST(0.02045317933555), FRAC_CONST(0.02174675502535),
- FRAC_CONST(0.02306801692862), FRAC_CONST(0.02441609920285),
- FRAC_CONST(0.02578758475467), FRAC_CONST(0.02718594296329),
- FRAC_CONST(0.02860721736385), FRAC_CONST(0.03005026574279),
- FRAC_CONST(0.03150176087389), FRAC_CONST(0.03297540810337),
- FRAC_CONST(0.03446209487686), FRAC_CONST(0.03596975605542),
- FRAC_CONST(0.03748128504252), FRAC_CONST(0.03900536794745),
- FRAC_CONST(0.04053491705584), FRAC_CONST(0.04206490946367),
- FRAC_CONST(0.04360975421304), FRAC_CONST(0.04514884056413),
- FRAC_CONST(0.04668430272642), FRAC_CONST(0.04821657200672),
- FRAC_CONST(0.04973857556014), FRAC_CONST(0.05125561555216),
- FRAC_CONST(0.05276307465207), FRAC_CONST(0.05424527683589),
- FRAC_CONST(0.05571736482138), FRAC_CONST(0.05716164501299),
- FRAC_CONST(0.0585915683626), FRAC_CONST(0.05998374801761),
- FRAC_CONST(0.06134551717207), FRAC_CONST(0.06268578081172),
- FRAC_CONST(0.06397158980681), FRAC_CONST(0.0652247106438),
- FRAC_CONST(0.06643675122104), FRAC_CONST(0.06760759851228),
- FRAC_CONST(0.06870438283512), FRAC_CONST(0.06976302447127),
- FRAC_CONST(0.07076287107266), FRAC_CONST(0.07170026731102),
- FRAC_CONST(0.07256825833083), FRAC_CONST(0.07336202550803),
- FRAC_CONST(0.07410036424342), FRAC_CONST(0.07474525581194),
- FRAC_CONST(0.07531373362019), FRAC_CONST(0.07580083586584),
- FRAC_CONST(0.07619924793396), FRAC_CONST(0.07649921704119),
- FRAC_CONST(0.07670934904245), FRAC_CONST(0.07681739756964),
- FRAC_CONST(0.07682300113923), FRAC_CONST(0.07672049241746),
- FRAC_CONST(0.07650507183194), FRAC_CONST(0.07617483218536),
- FRAC_CONST(0.07573057565061), FRAC_CONST(0.0751576255287),
- FRAC_CONST(0.07446643947564), FRAC_CONST(0.0736406005762),
- FRAC_CONST(0.07267746427299), FRAC_CONST(0.07158263647903),
- FRAC_CONST(0.07035330735093), FRAC_CONST(0.06896640131951),
- FRAC_CONST(0.06745250215166), FRAC_CONST(0.06576906686508),
- FRAC_CONST(0.06394448059633), FRAC_CONST(0.06196027790387),
- FRAC_CONST(0.0598166570809), FRAC_CONST(0.05751526919867),
- FRAC_CONST(0.05504600343009), FRAC_CONST(0.05240938217366),
- FRAC_CONST(0.04959786763445), FRAC_CONST(0.04663033051701),
- FRAC_CONST(0.04347687821958), FRAC_CONST(0.04014582784127),
- FRAC_CONST(0.03664181168133), FRAC_CONST(0.03295839306691),
- FRAC_CONST(0.02908240060125), FRAC_CONST(0.02503075618909),
- FRAC_CONST(0.02079970728622), FRAC_CONST(0.01637012582228),
- FRAC_CONST(0.01176238327857), FRAC_CONST(0.00696368621617),
- FRAC_CONST(0.00197656014503), FRAC_CONST(-0.00320868968304),
- FRAC_CONST(-0.00857117491366), FRAC_CONST(-0.01412888273558),
- FRAC_CONST(-0.01988341292573), FRAC_CONST(-0.02582272888064),
- FRAC_CONST(-0.03195312745332), FRAC_CONST(-0.03827765720822),
- FRAC_CONST(-0.04478068215856), FRAC_CONST(-0.05148041767934),
- FRAC_CONST(-0.05837053268336), FRAC_CONST(-0.06544098531359),
- FRAC_CONST(-0.07269433008129), FRAC_CONST(-0.08013729344279),
- FRAC_CONST(-0.08775475365593), FRAC_CONST(-0.09555333528914),
- FRAC_CONST(-0.10353295311463), FRAC_CONST(-0.1116826931773),
- FRAC_CONST(-0.120007798468), FRAC_CONST(-0.12850028503878),
- FRAC_CONST(-0.13715517611934), FRAC_CONST(-0.1459766491187),
- FRAC_CONST(-0.15496070710605), FRAC_CONST(-0.16409588556669),
- FRAC_CONST(-0.17338081721706), FRAC_CONST(-0.18281725485142),
- FRAC_CONST(-0.19239667457267), FRAC_CONST(-0.20212501768103),
- FRAC_CONST(-0.21197358538056), FRAC_CONST(-0.22196526964149),
- FRAC_CONST(-0.23206908706791), FRAC_CONST(-0.24230168845974),
- FRAC_CONST(-0.25264803095722), FRAC_CONST(-0.26310532994603),
- FRAC_CONST(-0.27366340405625), FRAC_CONST(-0.28432141891085),
- FRAC_CONST(-0.29507167170646), FRAC_CONST(-0.30590985751916),
- FRAC_CONST(-0.31682789136456), FRAC_CONST(-0.32781137272105),
- FRAC_CONST(-0.33887226938665), FRAC_CONST(-0.3499914122931),
- FRAC_CONST(0.36115899031355), FRAC_CONST(0.37237955463061),
- FRAC_CONST(0.38363500139043), FRAC_CONST(0.39492117615675),
- FRAC_CONST(0.40623176767625), FRAC_CONST(0.41756968968409),
- FRAC_CONST(0.42891199207373), FRAC_CONST(0.44025537543665),
- FRAC_CONST(0.45159965356824), FRAC_CONST(0.46293080852757),
- FRAC_CONST(0.47424532146115), FRAC_CONST(0.48552530911099),
- FRAC_CONST(0.49677082545707), FRAC_CONST(0.50798175000434),
- FRAC_CONST(0.51912349702391), FRAC_CONST(0.53022408956855),
- FRAC_CONST(0.54125534487322), FRAC_CONST(0.55220512585061),
- FRAC_CONST(0.5630789140137), FRAC_CONST(0.57385241316923),
- FRAC_CONST(0.58454032354679), FRAC_CONST(0.59511230862496),
- FRAC_CONST(0.6055783538918), FRAC_CONST(0.61591099320291),
- FRAC_CONST(0.62612426956055), FRAC_CONST(0.63619801077286),
- FRAC_CONST(0.64612696959461), FRAC_CONST(0.65590163024671),
- FRAC_CONST(0.66551398801627), FRAC_CONST(0.67496631901712),
- FRAC_CONST(0.68423532934598), FRAC_CONST(0.69332823767032),
- FRAC_CONST(0.70223887193539), FRAC_CONST(0.71094104263095),
- FRAC_CONST(0.71944626349561), FRAC_CONST(0.72774489002994),
- FRAC_CONST(0.73582117582769), FRAC_CONST(0.74368278636488),
- FRAC_CONST(0.75131374561237), FRAC_CONST(0.75870807608242),
- FRAC_CONST(0.76586748650939), FRAC_CONST(0.77277808813327),
- FRAC_CONST(0.77942875190216), FRAC_CONST(0.7858353120392),
- FRAC_CONST(0.79197358416424), FRAC_CONST(0.797846641377),
- FRAC_CONST(0.80344857518505), FRAC_CONST(0.80876950044491),
- FRAC_CONST(0.81381912706217), FRAC_CONST(0.81857760046468),
- FRAC_CONST(0.82304198905409), FRAC_CONST(0.8272275347336),
- FRAC_CONST(0.8311038457152), FRAC_CONST(0.83469373618402),
- FRAC_CONST(0.83797173378865), FRAC_CONST(0.84095413924722),
- FRAC_CONST(0.84362382812005), FRAC_CONST(0.84598184698206),
- FRAC_CONST(0.84803157770763), FRAC_CONST(0.84978051984268),
- FRAC_CONST(0.85119715249343), FRAC_CONST(0.85230470352147),
- FRAC_CONST(0.85310209497017), FRAC_CONST(0.85357205739107),
- FRAC_CONST(0.85373856005937 /*max*/), FRAC_CONST(0.85357205739107),
- FRAC_CONST(0.85310209497017), FRAC_CONST(0.85230470352147),
- FRAC_CONST(0.85119715249343), FRAC_CONST(0.84978051984268),
- FRAC_CONST(0.84803157770763), FRAC_CONST(0.84598184698206),
- FRAC_CONST(0.84362382812005), FRAC_CONST(0.84095413924722),
- FRAC_CONST(0.83797173378865), FRAC_CONST(0.83469373618402),
- FRAC_CONST(0.8311038457152), FRAC_CONST(0.8272275347336),
- FRAC_CONST(0.82304198905409), FRAC_CONST(0.81857760046468),
- FRAC_CONST(0.81381912706217), FRAC_CONST(0.80876950044491),
- FRAC_CONST(0.80344857518505), FRAC_CONST(0.797846641377),
- FRAC_CONST(0.79197358416424), FRAC_CONST(0.7858353120392),
- FRAC_CONST(0.77942875190216), FRAC_CONST(0.77277808813327),
- FRAC_CONST(0.76586748650939), FRAC_CONST(0.75870807608242),
- FRAC_CONST(0.75131374561237), FRAC_CONST(0.74368278636488),
- FRAC_CONST(0.73582117582769), FRAC_CONST(0.72774489002994),
- FRAC_CONST(0.71944626349561), FRAC_CONST(0.71094104263095),
- FRAC_CONST(0.70223887193539), FRAC_CONST(0.69332823767032),
- FRAC_CONST(0.68423532934598), FRAC_CONST(0.67496631901712),
- FRAC_CONST(0.66551398801627), FRAC_CONST(0.65590163024671),
- FRAC_CONST(0.64612696959461), FRAC_CONST(0.63619801077286),
- FRAC_CONST(0.62612426956055), FRAC_CONST(0.61591099320291),
- FRAC_CONST(0.6055783538918), FRAC_CONST(0.59511230862496),
- FRAC_CONST(0.58454032354679), FRAC_CONST(0.57385241316923),
- FRAC_CONST(0.5630789140137), FRAC_CONST(0.55220512585061),
- FRAC_CONST(0.54125534487322), FRAC_CONST(0.53022408956855),
- FRAC_CONST(0.51912349702391), FRAC_CONST(0.50798175000434),
- FRAC_CONST(0.49677082545707), FRAC_CONST(0.48552530911099),
- FRAC_CONST(0.47424532146115), FRAC_CONST(0.46293080852757),
- FRAC_CONST(0.45159965356824), FRAC_CONST(0.44025537543665),
- FRAC_CONST(0.42891199207373), FRAC_CONST(0.41756968968409),
- FRAC_CONST(0.40623176767625), FRAC_CONST(0.39492117615675),
- FRAC_CONST(0.38363500139043), FRAC_CONST(0.37237955463061),
- FRAC_CONST(-0.36115899031355), FRAC_CONST(-0.3499914122931),
- FRAC_CONST(-0.33887226938665), FRAC_CONST(-0.32781137272105),
- FRAC_CONST(-0.31682789136456), FRAC_CONST(-0.30590985751916),
- FRAC_CONST(-0.29507167170646), FRAC_CONST(-0.28432141891085),
- FRAC_CONST(-0.27366340405625), FRAC_CONST(-0.26310532994603),
- FRAC_CONST(-0.25264803095722), FRAC_CONST(-0.24230168845974),
- FRAC_CONST(-0.23206908706791), FRAC_CONST(-0.22196526964149),
- FRAC_CONST(-0.21197358538056), FRAC_CONST(-0.20212501768103),
- FRAC_CONST(-0.19239667457267), FRAC_CONST(-0.18281725485142),
- FRAC_CONST(-0.17338081721706), FRAC_CONST(-0.16409588556669),
- FRAC_CONST(-0.15496070710605), FRAC_CONST(-0.1459766491187),
- FRAC_CONST(-0.13715517611934), FRAC_CONST(-0.12850028503878),
- FRAC_CONST(-0.120007798468), FRAC_CONST(-0.1116826931773),
- FRAC_CONST(-0.10353295311463), FRAC_CONST(-0.09555333528914),
- FRAC_CONST(-0.08775475365593), FRAC_CONST(-0.08013729344279),
- FRAC_CONST(-0.07269433008129), FRAC_CONST(-0.06544098531359),
- FRAC_CONST(-0.05837053268336), FRAC_CONST(-0.05148041767934),
- FRAC_CONST(-0.04478068215856), FRAC_CONST(-0.03827765720822),
- FRAC_CONST(-0.03195312745332), FRAC_CONST(-0.02582272888064),
- FRAC_CONST(-0.01988341292573), FRAC_CONST(-0.01412888273558),
- FRAC_CONST(-0.00857117491366), FRAC_CONST(-0.00320868968304),
- FRAC_CONST(0.00197656014503), FRAC_CONST(0.00696368621617),
- FRAC_CONST(0.01176238327857), FRAC_CONST(0.01637012582228),
- FRAC_CONST(0.02079970728622), FRAC_CONST(0.02503075618909),
- FRAC_CONST(0.02908240060125), FRAC_CONST(0.03295839306691),
- FRAC_CONST(0.03664181168133), FRAC_CONST(0.04014582784127),
- FRAC_CONST(0.04347687821958), FRAC_CONST(0.04663033051701),
- FRAC_CONST(0.04959786763445), FRAC_CONST(0.05240938217366),
- FRAC_CONST(0.05504600343009), FRAC_CONST(0.05751526919867),
- FRAC_CONST(0.0598166570809), FRAC_CONST(0.06196027790387),
- FRAC_CONST(0.06394448059633), FRAC_CONST(0.06576906686508),
- FRAC_CONST(0.06745250215166), FRAC_CONST(0.06896640131951),
- FRAC_CONST(0.07035330735093), FRAC_CONST(0.07158263647903),
- FRAC_CONST(0.07267746427299), FRAC_CONST(0.0736406005762),
- FRAC_CONST(0.07446643947564), FRAC_CONST(0.0751576255287),
- FRAC_CONST(0.07573057565061), FRAC_CONST(0.07617483218536),
- FRAC_CONST(0.07650507183194), FRAC_CONST(0.07672049241746),
- FRAC_CONST(0.07682300113923), FRAC_CONST(0.07681739756964),
- FRAC_CONST(0.07670934904245), FRAC_CONST(0.07649921704119),
- FRAC_CONST(0.07619924793396), FRAC_CONST(0.07580083586584),
- FRAC_CONST(0.07531373362019), FRAC_CONST(0.07474525581194),
- FRAC_CONST(0.07410036424342), FRAC_CONST(0.07336202550803),
- FRAC_CONST(0.07256825833083), FRAC_CONST(0.07170026731102),
- FRAC_CONST(0.07076287107266), FRAC_CONST(0.06976302447127),
- FRAC_CONST(0.06870438283512), FRAC_CONST(0.06760759851228),
- FRAC_CONST(0.06643675122104), FRAC_CONST(0.0652247106438),
- FRAC_CONST(0.06397158980681), FRAC_CONST(0.06268578081172),
- FRAC_CONST(0.06134551717207), FRAC_CONST(0.05998374801761),
- FRAC_CONST(0.0585915683626), FRAC_CONST(0.05716164501299),
- FRAC_CONST(0.05571736482138), FRAC_CONST(0.05424527683589),
- FRAC_CONST(0.05276307465207), FRAC_CONST(0.05125561555216),
- FRAC_CONST(0.04973857556014), FRAC_CONST(0.04821657200672),
- FRAC_CONST(0.04668430272642), FRAC_CONST(0.04514884056413),
- FRAC_CONST(0.04360975421304), FRAC_CONST(0.04206490946367),
- FRAC_CONST(0.04053491705584), FRAC_CONST(0.03900536794745),
- FRAC_CONST(0.03748128504252), FRAC_CONST(0.03596975605542),
- FRAC_CONST(0.03446209487686), FRAC_CONST(0.03297540810337),
- FRAC_CONST(0.03150176087389), FRAC_CONST(0.03005026574279),
- FRAC_CONST(0.02860721736385), FRAC_CONST(0.02718594296329),
- FRAC_CONST(0.02578758475467), FRAC_CONST(0.02441609920285),
- FRAC_CONST(0.02306801692862), FRAC_CONST(0.02174675502535),
- FRAC_CONST(0.02045317933555), FRAC_CONST(0.01918724313698),
- FRAC_CONST(0.01794333813443), FRAC_CONST(0.01673247129989),
- FRAC_CONST(0.01554055533423), FRAC_CONST(0.01439046660792),
- FRAC_CONST(-0.01327182200351), FRAC_CONST(-0.01218499959508),
- FRAC_CONST(-0.01113155480321), FRAC_CONST(-0.01011502154986),
- FRAC_CONST(-0.00913253296085), FRAC_CONST(-0.00817982333726),
- FRAC_CONST(-0.00726158168517), FRAC_CONST(-0.00637922932685),
- FRAC_CONST(-0.00553372111088), FRAC_CONST(-0.004722259624),
- FRAC_CONST(-0.00394011240522), FRAC_CONST(-0.003193377839),
- FRAC_CONST(-0.00248267236449), FRAC_CONST(-0.00180394725893),
- FRAC_CONST(-0.00115681355227), FRAC_CONST(-0.00054642808664),
- FRAC_CONST(2.760451905E-005), FRAC_CONST(0.0005832264248),
- FRAC_CONST(0.00109023290512), FRAC_CONST(0.00157846825768),
- FRAC_CONST(0.0020274176185), FRAC_CONST(0.00245085400321),
- FRAC_CONST(0.00284467578623), FRAC_CONST(0.00320918858098),
- FRAC_CONST(0.00354012465507), FRAC_CONST(0.00384564081246),
- FRAC_CONST(0.0041251642327), FRAC_CONST(0.00438018617447),
- FRAC_CONST(0.00460395301471), FRAC_CONST(0.004810946906),
- FRAC_CONST(0.00498396877629), FRAC_CONST(0.00513822754514),
- FRAC_CONST(0.00527157587272), FRAC_CONST(0.0053838975897),
- FRAC_CONST(0.0054753783077), FRAC_CONST(0.005540436394),
- FRAC_CONST(0.0055917128663), FRAC_CONST(0.00562661141932),
- FRAC_CONST(0.00563891995151), FRAC_CONST(0.00564551969164),
- FRAC_CONST(0.00562206432097), FRAC_CONST(0.00559380230045),
- FRAC_CONST(0.00554757145088), FRAC_CONST(0.00548760401507),
- FRAC_CONST(0.00541967759307), FRAC_CONST(0.00534716811982),
- FRAC_CONST(0.00524611661324), FRAC_CONST(0.00514073539032),
- FRAC_CONST(0.00503930226013), FRAC_CONST(0.00491376035745),
- FRAC_CONST(0.00479325608498), FRAC_CONST(0.00466064606118),
- FRAC_CONST(0.00452098527825), FRAC_CONST(0.00437307196781),
- FRAC_CONST(0.0042264269227), FRAC_CONST(0.00408197531935),
- FRAC_CONST(0.00392074323703), FRAC_CONST(0.00376039229104),
- FRAC_CONST(0.00360082681231), FRAC_CONST(0.00344188741828),
- FRAC_CONST(0.00327396134847), FRAC_CONST(0.00311254206525),
- FRAC_CONST(0.00294694477165), FRAC_CONST(0.00278704643465),
- FRAC_CONST(0.00262017586902), FRAC_CONST(0.00246256169126),
- FRAC_CONST(0.00230172547746), FRAC_CONST(0.00214615835557),
- FRAC_CONST(0.00198411407369), FRAC_CONST(0.00183482654224),
- FRAC_CONST(0.00168680832531), FRAC_CONST(0.00154432198471),
- FRAC_CONST(0.00139024948272), FRAC_CONST(0.00125778846475),
- FRAC_CONST(0.00112501551307), FRAC_CONST(0.00098859883015),
- FRAC_CONST(0.00086084433262), FRAC_CONST(0.00074580258865),
- FRAC_CONST(0.00062393761391), FRAC_CONST(0.00051073884952),
- FRAC_CONST(0.0004026540216), FRAC_CONST(0.00029495311041),
- FRAC_CONST(0.00020430170688), FRAC_CONST(0.00010943831274),
- FRAC_CONST(1.349497418E-005), FRAC_CONST(-6.173344072E-005),
- FRAC_CONST(-0.00014463809349), FRAC_CONST(-0.0002098337344),
- FRAC_CONST(-0.00028969811748), FRAC_CONST(-0.00035011758756),
- FRAC_CONST(-0.00040951214522), FRAC_CONST(-0.00046063254803),
- FRAC_CONST(-0.00051455722108), FRAC_CONST(-0.00055645763906),
- FRAC_CONST(-0.0005946118933), FRAC_CONST(-0.00063415949025),
- FRAC_CONST(-0.00066504150893), FRAC_CONST(-0.00069179375372),
- FRAC_CONST(-0.00072153919876), FRAC_CONST(-0.00073193571525),
- FRAC_CONST(-0.00075300014201), FRAC_CONST(-0.00076307935757),
- FRAC_CONST(-0.0007757977331), FRAC_CONST(-0.00078014496257),
- FRAC_CONST(-0.000780366471), FRAC_CONST(-0.00077798694927),
- FRAC_CONST(-0.00078343322877), FRAC_CONST(-0.00077248485949),
- FRAC_CONST(-0.0007681371927), FRAC_CONST(-0.00074905980532),
- FRAC_CONST(-0.00074409418541), FRAC_CONST(-0.00072550431222),
- FRAC_CONST(-0.00071577364744), FRAC_CONST(-0.00069416146273),
- FRAC_CONST(-0.00067776907764), FRAC_CONST(-0.00065403333621),
- FRAC_CONST(-0.00063124935319), FRAC_CONST(-0.00061327473938),
- FRAC_CONST(-0.00058709304852), FRAC_CONST(-0.00056778025613),
- FRAC_CONST(-0.00054665656337), FRAC_CONST(-0.00052265642972),
- FRAC_CONST(-0.00050407143497), FRAC_CONST(-0.00048937912498),
- FRAC_CONST(-0.00048752279712), FRAC_CONST(-0.00049475180896),
- FRAC_CONST(-0.00056176925738), FRAC_CONST(-0.00055252865047)
-};
-
-#endif
-
diff --git a/src/libfaad/sbr_syntax.c b/src/libfaad/sbr_syntax.c
deleted file mode 100644
index 19cb1b5c2..000000000
--- a/src/libfaad/sbr_syntax.c
+++ /dev/null
@@ -1,871 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_syntax.c,v 1.7 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#include "common.h"
-#include "structs.h"
-
-#ifdef SBR_DEC
-
-#include "sbr_syntax.h"
-#include "syntax.h"
-#include "sbr_huff.h"
-#include "sbr_fbt.h"
-#include "sbr_tf_grid.h"
-#include "sbr_e_nf.h"
-#include "bits.h"
-#ifdef PS_DEC
-#include "ps_dec.h"
-#endif
-#ifdef DRM_PS
-#include "drm_dec.h"
-#endif
-#include "analysis.h"
-
-/* static function declarations */
-static void sbr_header(bitfile *ld, sbr_info *sbr);
-static uint8_t calc_sbr_tables(sbr_info *sbr, uint8_t start_freq, uint8_t stop_freq,
- uint8_t samplerate_mode, uint8_t freq_scale,
- uint8_t alter_scale, uint8_t xover_band);
-static uint8_t sbr_data(bitfile *ld, sbr_info *sbr);
-static uint16_t sbr_extension(bitfile *ld, sbr_info *sbr,
- uint8_t bs_extension_id, uint16_t num_bits_left);
-static uint8_t sbr_single_channel_element(bitfile *ld, sbr_info *sbr);
-static uint8_t sbr_channel_pair_element(bitfile *ld, sbr_info *sbr);
-static uint8_t sbr_grid(bitfile *ld, sbr_info *sbr, uint8_t ch);
-static void sbr_dtdf(bitfile *ld, sbr_info *sbr, uint8_t ch);
-static void invf_mode(bitfile *ld, sbr_info *sbr, uint8_t ch);
-static void sinusoidal_coding(bitfile *ld, sbr_info *sbr, uint8_t ch);
-
-
-static void sbr_reset(sbr_info *sbr)
-{
-#if 0
- printf("%d\n", sbr->bs_start_freq_prev);
- printf("%d\n", sbr->bs_stop_freq_prev);
- printf("%d\n", sbr->bs_freq_scale_prev);
- printf("%d\n", sbr->bs_alter_scale_prev);
- printf("%d\n", sbr->bs_xover_band_prev);
- printf("%d\n\n", sbr->bs_noise_bands_prev);
-#endif
-
- /* if these are different from the previous frame: Reset = 1 */
- if ((sbr->bs_start_freq != sbr->bs_start_freq_prev) ||
- (sbr->bs_stop_freq != sbr->bs_stop_freq_prev) ||
- (sbr->bs_freq_scale != sbr->bs_freq_scale_prev) ||
- (sbr->bs_alter_scale != sbr->bs_alter_scale_prev) ||
- (sbr->bs_xover_band != sbr->bs_xover_band_prev) ||
- (sbr->bs_noise_bands != sbr->bs_noise_bands_prev))
- {
- sbr->Reset = 1;
- } else {
- sbr->Reset = 0;
- }
-
- sbr->bs_start_freq_prev = sbr->bs_start_freq;
- sbr->bs_stop_freq_prev = sbr->bs_stop_freq;
- sbr->bs_freq_scale_prev = sbr->bs_freq_scale;
- sbr->bs_alter_scale_prev = sbr->bs_alter_scale;
- sbr->bs_xover_band_prev = sbr->bs_xover_band;
- sbr->bs_noise_bands_prev = sbr->bs_noise_bands;
-}
-
-static uint8_t calc_sbr_tables(sbr_info *sbr, uint8_t start_freq, uint8_t stop_freq,
- uint8_t samplerate_mode, uint8_t freq_scale,
- uint8_t alter_scale, uint8_t xover_band)
-{
- uint8_t result = 0;
- uint8_t k2;
-
- /* calculate the Master Frequency Table */
- sbr->k0 = qmf_start_channel(start_freq, samplerate_mode, sbr->sample_rate);
- k2 = qmf_stop_channel(stop_freq, sbr->sample_rate, sbr->k0);
-
- /* check k0 and k2 */
- if (sbr->sample_rate >= 48000)
- {
- if ((k2 - sbr->k0) > 32)
- result += 1;
- } else if (sbr->sample_rate <= 32000) {
- if ((k2 - sbr->k0) > 48)
- result += 1;
- } else { /* (sbr->sample_rate == 44100) */
- if ((k2 - sbr->k0) > 45)
- result += 1;
- }
-
- if (freq_scale == 0)
- {
- result += master_frequency_table_fs0(sbr, sbr->k0, k2, alter_scale);
- } else {
- result += master_frequency_table(sbr, sbr->k0, k2, freq_scale, alter_scale);
- }
- result += derived_frequency_table(sbr, xover_band, k2);
-
- result = (result > 0) ? 1 : 0;
-
- return result;
-}
-
-/* table 2 */
-uint8_t sbr_extension_data(bitfile *ld, sbr_info *sbr, uint16_t cnt)
-{
- uint8_t result = 0;
- uint16_t num_align_bits = 0;
- uint16_t num_sbr_bits = (uint16_t)faad_get_processed_bits(ld);
-
- uint8_t saved_start_freq, saved_samplerate_mode;
- uint8_t saved_stop_freq, saved_freq_scale;
- uint8_t saved_alter_scale, saved_xover_band;
-
-#ifdef DRM
- if (!sbr->Is_DRM_SBR)
-#endif
- {
- uint8_t bs_extension_type = (uint8_t)faad_getbits(ld, 4
- DEBUGVAR(1,198,"sbr_bitstream(): bs_extension_type"));
-
- if (bs_extension_type == EXT_SBR_DATA_CRC)
- {
- sbr->bs_sbr_crc_bits = (uint16_t)faad_getbits(ld, 10
- DEBUGVAR(1,199,"sbr_bitstream(): bs_sbr_crc_bits"));
- }
- }
-
- /* save old header values, in case the new ones are corrupted */
- saved_start_freq = sbr->bs_start_freq;
- saved_samplerate_mode = sbr->bs_samplerate_mode;
- saved_stop_freq = sbr->bs_stop_freq;
- saved_freq_scale = sbr->bs_freq_scale;
- saved_alter_scale = sbr->bs_alter_scale;
- saved_xover_band = sbr->bs_xover_band;
-
- sbr->bs_header_flag = faad_get1bit(ld
- DEBUGVAR(1,200,"sbr_bitstream(): bs_header_flag"));
-
- if (sbr->bs_header_flag)
- sbr_header(ld, sbr);
-
- /* Reset? */
- sbr_reset(sbr);
-
- /* first frame should have a header */
- //if (!(sbr->frame == 0 && sbr->bs_header_flag == 0))
- if (sbr->header_count != 0)
- {
- if (sbr->Reset || (sbr->bs_header_flag && sbr->just_seeked))
- {
- uint8_t rt = calc_sbr_tables(sbr, sbr->bs_start_freq, sbr->bs_stop_freq,
- sbr->bs_samplerate_mode, sbr->bs_freq_scale,
- sbr->bs_alter_scale, sbr->bs_xover_band);
-
- /* if an error occured with the new header values revert to the old ones */
- if (rt > 0)
- {
- calc_sbr_tables(sbr, saved_start_freq, saved_stop_freq,
- saved_samplerate_mode, saved_freq_scale,
- saved_alter_scale, saved_xover_band);
- }
- }
-
- if (result == 0)
- {
- result = sbr_data(ld, sbr);
-
- /* sbr_data() returning an error means that there was an error in
- envelope_time_border_vector().
- In this case the old time border vector is saved and all the previous
- data normally read after sbr_grid() is saved.
- */
- /* to be on the safe side, calculate old sbr tables in case of error */
- if ((result > 0) &&
- (sbr->Reset || (sbr->bs_header_flag && sbr->just_seeked)))
- {
- calc_sbr_tables(sbr, saved_start_freq, saved_stop_freq,
- saved_samplerate_mode, saved_freq_scale,
- saved_alter_scale, saved_xover_band);
- }
-
- /* we should be able to safely set result to 0 now */
- result = 0;
- }
- } else {
- result = 1;
- }
-
-#ifdef DRM
- if (!sbr->Is_DRM_SBR)
-#endif
- {
- num_sbr_bits = (uint16_t)faad_get_processed_bits(ld) - num_sbr_bits;
-
- /* check if we read more bits then were available for sbr */
- if (8*cnt < num_sbr_bits)
- return 1;
-
- /* -4 does not apply, bs_extension_type is re-read in this function */
- num_align_bits = 8*cnt /*- 4*/ - num_sbr_bits;
-
- while (num_align_bits > 7)
- {
- faad_getbits(ld, 8
- DEBUGVAR(1,999,"sbr_bitstream(): num_align_bits"));
- num_align_bits -= 8;
- }
- faad_getbits(ld, num_align_bits
- DEBUGVAR(1,999,"sbr_bitstream(): num_align_bits"));
- }
-
- return result;
-}
-
-/* table 3 */
-static void sbr_header(bitfile *ld, sbr_info *sbr)
-{
- uint8_t bs_header_extra_1, bs_header_extra_2;
-
- sbr->header_count++;
-
- sbr->bs_amp_res = faad_get1bit(ld
- DEBUGVAR(1,203,"sbr_header(): bs_amp_res"));
-
- /* bs_start_freq and bs_stop_freq must define a fequency band that does
- not exceed 48 channels */
- sbr->bs_start_freq = (uint8_t)faad_getbits(ld, 4
- DEBUGVAR(1,204,"sbr_header(): bs_start_freq"));
- sbr->bs_stop_freq = (uint8_t)faad_getbits(ld, 4
- DEBUGVAR(1,205,"sbr_header(): bs_stop_freq"));
- sbr->bs_xover_band = (uint8_t)faad_getbits(ld, 3
- DEBUGVAR(1,206,"sbr_header(): bs_xover_band"));
- faad_getbits(ld, 2
- DEBUGVAR(1,207,"sbr_header(): bs_reserved_bits_hdr"));
- bs_header_extra_1 = (uint8_t)faad_get1bit(ld
- DEBUGVAR(1,208,"sbr_header(): bs_header_extra_1"));
- bs_header_extra_2 = (uint8_t)faad_get1bit(ld
- DEBUGVAR(1,209,"sbr_header(): bs_header_extra_2"));
-
- if (bs_header_extra_1)
- {
- sbr->bs_freq_scale = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,211,"sbr_header(): bs_freq_scale"));
- sbr->bs_alter_scale = (uint8_t)faad_get1bit(ld
- DEBUGVAR(1,212,"sbr_header(): bs_alter_scale"));
- sbr->bs_noise_bands = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,213,"sbr_header(): bs_noise_bands"));
- } else {
- /* Default values */
- sbr->bs_freq_scale = 2;
- sbr->bs_alter_scale = 1;
- sbr->bs_noise_bands = 2;
- }
-
- if (bs_header_extra_2)
- {
- sbr->bs_limiter_bands = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,214,"sbr_header(): bs_limiter_bands"));
- sbr->bs_limiter_gains = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,215,"sbr_header(): bs_limiter_gains"));
- sbr->bs_interpol_freq = (uint8_t)faad_get1bit(ld
- DEBUGVAR(1,216,"sbr_header(): bs_interpol_freq"));
- sbr->bs_smoothing_mode = (uint8_t)faad_get1bit(ld
- DEBUGVAR(1,217,"sbr_header(): bs_smoothing_mode"));
- } else {
- /* Default values */
- sbr->bs_limiter_bands = 2;
- sbr->bs_limiter_gains = 2;
- sbr->bs_interpol_freq = 1;
- sbr->bs_smoothing_mode = 1;
- }
-
-#if 0
- /* print the header to screen */
- printf("bs_amp_res: %d\n", sbr->bs_amp_res);
- printf("bs_start_freq: %d\n", sbr->bs_start_freq);
- printf("bs_stop_freq: %d\n", sbr->bs_stop_freq);
- printf("bs_xover_band: %d\n", sbr->bs_xover_band);
- if (bs_header_extra_1)
- {
- printf("bs_freq_scale: %d\n", sbr->bs_freq_scale);
- printf("bs_alter_scale: %d\n", sbr->bs_alter_scale);
- printf("bs_noise_bands: %d\n", sbr->bs_noise_bands);
- }
- if (bs_header_extra_2)
- {
- printf("bs_limiter_bands: %d\n", sbr->bs_limiter_bands);
- printf("bs_limiter_gains: %d\n", sbr->bs_limiter_gains);
- printf("bs_interpol_freq: %d\n", sbr->bs_interpol_freq);
- printf("bs_smoothing_mode: %d\n", sbr->bs_smoothing_mode);
- }
- printf("\n");
-#endif
-}
-
-/* table 4 */
-static uint8_t sbr_data(bitfile *ld, sbr_info *sbr)
-{
- uint8_t result;
-#if 0
- sbr->bs_samplerate_mode = faad_get1bit(ld
- DEBUGVAR(1,219,"sbr_data(): bs_samplerate_mode"));
-#endif
-
- sbr->rate = (sbr->bs_samplerate_mode) ? 2 : 1;
-
- switch (sbr->id_aac)
- {
- case ID_SCE:
- if ((result = sbr_single_channel_element(ld, sbr)) > 0)
- return result;
- break;
- case ID_CPE:
- if ((result = sbr_channel_pair_element(ld, sbr)) > 0)
- return result;
- break;
- }
-
- return 0;
-}
-
-/* table 5 */
-static uint8_t sbr_single_channel_element(bitfile *ld, sbr_info *sbr)
-{
- uint8_t result;
-
- if (faad_get1bit(ld
- DEBUGVAR(1,220,"sbr_single_channel_element(): bs_data_extra")))
- {
- faad_getbits(ld, 4
- DEBUGVAR(1,221,"sbr_single_channel_element(): bs_reserved_bits_data"));
- }
-
-#ifdef DRM
- /* bs_coupling, from sbr_channel_pair_base_element(bs_amp_res) */
- if (sbr->Is_DRM_SBR)
- faad_get1bit(ld);
-#endif
-
- if ((result = sbr_grid(ld, sbr, 0)) > 0)
- return result;
- sbr_dtdf(ld, sbr, 0);
- invf_mode(ld, sbr, 0);
- sbr_envelope(ld, sbr, 0);
- sbr_noise(ld, sbr, 0);
-
-#ifndef FIXED_POINT
- envelope_noise_dequantisation(sbr, 0);
-#endif
-
- memset(sbr->bs_add_harmonic[0], 0, 64*sizeof(uint8_t));
-
- sbr->bs_add_harmonic_flag[0] = faad_get1bit(ld
- DEBUGVAR(1,223,"sbr_single_channel_element(): bs_add_harmonic_flag[0]"));
- if (sbr->bs_add_harmonic_flag[0])
- sinusoidal_coding(ld, sbr, 0);
-
- sbr->bs_extended_data = faad_get1bit(ld
- DEBUGVAR(1,224,"sbr_single_channel_element(): bs_extended_data[0]"));
-
- if (sbr->bs_extended_data)
- {
- uint16_t nr_bits_left;
-#if (defined(PS_DEC) || defined(DRM_PS))
- uint8_t ps_ext_read = 0;
-#endif
- uint16_t cnt = (uint16_t)faad_getbits(ld, 4
- DEBUGVAR(1,225,"sbr_single_channel_element(): bs_extension_size"));
- if (cnt == 15)
- {
- cnt += (uint16_t)faad_getbits(ld, 8
- DEBUGVAR(1,226,"sbr_single_channel_element(): bs_esc_count"));
- }
-
- nr_bits_left = 8 * cnt;
- while (nr_bits_left > 7)
- {
- uint16_t tmp_nr_bits = 0;
-
- sbr->bs_extension_id = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,227,"sbr_single_channel_element(): bs_extension_id"));
- tmp_nr_bits += 2;
-
- /* allow only 1 PS extension element per extension data */
-#if (defined(PS_DEC) || defined(DRM_PS))
-#if (defined(PS_DEC) && defined(DRM_PS))
- if (sbr->bs_extension_id == EXTENSION_ID_PS || sbr->bs_extension_id == DRM_PARAMETRIC_STEREO)
-#else
-#ifdef PS_DEC
- if (sbr->bs_extension_id == EXTENSION_ID_PS)
-#else
-#ifdef DRM_PS
- if (sbr->bs_extension_id == DRM_PARAMETRIC_STEREO)
-#endif
-#endif
-#endif
- {
- if (ps_ext_read == 0)
- {
- ps_ext_read = 1;
- } else {
- /* to be safe make it 3, will switch to "default"
- * in sbr_extension() */
- sbr->bs_extension_id = 3;
- }
- }
-#endif
-
- tmp_nr_bits += sbr_extension(ld, sbr, sbr->bs_extension_id, nr_bits_left);
-
- /* check if the data read is bigger than the number of available bits */
- if (tmp_nr_bits > nr_bits_left)
- return 1;
-
- nr_bits_left -= tmp_nr_bits;
- }
-
- /* Corrigendum */
- if (nr_bits_left > 0)
- {
- faad_getbits(ld, nr_bits_left
- DEBUGVAR(1,280,"sbr_single_channel_element(): nr_bits_left"));
- }
- }
-
- return 0;
-}
-
-/* table 6 */
-static uint8_t sbr_channel_pair_element(bitfile *ld, sbr_info *sbr)
-{
- uint8_t n, result;
-
- if (faad_get1bit(ld
- DEBUGVAR(1,228,"sbr_single_channel_element(): bs_data_extra")))
- {
- faad_getbits(ld, 4
- DEBUGVAR(1,228,"sbr_channel_pair_element(): bs_reserved_bits_data"));
- faad_getbits(ld, 4
- DEBUGVAR(1,228,"sbr_channel_pair_element(): bs_reserved_bits_data"));
- }
-
- sbr->bs_coupling = faad_get1bit(ld
- DEBUGVAR(1,228,"sbr_channel_pair_element(): bs_coupling"));
-
- if (sbr->bs_coupling)
- {
- if ((result = sbr_grid(ld, sbr, 0)) > 0)
- return result;
-
- /* need to copy some data from left to right */
- sbr->bs_frame_class[1] = sbr->bs_frame_class[0];
- sbr->L_E[1] = sbr->L_E[0];
- sbr->L_Q[1] = sbr->L_Q[0];
- sbr->bs_pointer[1] = sbr->bs_pointer[0];
-
- for (n = 0; n <= sbr->L_E[0]; n++)
- {
- sbr->t_E[1][n] = sbr->t_E[0][n];
- sbr->f[1][n] = sbr->f[0][n];
- }
- for (n = 0; n <= sbr->L_Q[0]; n++)
- sbr->t_Q[1][n] = sbr->t_Q[0][n];
-
- sbr_dtdf(ld, sbr, 0);
- sbr_dtdf(ld, sbr, 1);
- invf_mode(ld, sbr, 0);
-
- /* more copying */
- for (n = 0; n < sbr->N_Q; n++)
- sbr->bs_invf_mode[1][n] = sbr->bs_invf_mode[0][n];
-
- sbr_envelope(ld, sbr, 0);
- sbr_noise(ld, sbr, 0);
- sbr_envelope(ld, sbr, 1);
- sbr_noise(ld, sbr, 1);
-
- memset(sbr->bs_add_harmonic[0], 0, 64*sizeof(uint8_t));
- memset(sbr->bs_add_harmonic[1], 0, 64*sizeof(uint8_t));
-
- sbr->bs_add_harmonic_flag[0] = faad_get1bit(ld
- DEBUGVAR(1,231,"sbr_channel_pair_element(): bs_add_harmonic_flag[0]"));
- if (sbr->bs_add_harmonic_flag[0])
- sinusoidal_coding(ld, sbr, 0);
-
- sbr->bs_add_harmonic_flag[1] = faad_get1bit(ld
- DEBUGVAR(1,232,"sbr_channel_pair_element(): bs_add_harmonic_flag[1]"));
- if (sbr->bs_add_harmonic_flag[1])
- sinusoidal_coding(ld, sbr, 1);
- } else {
- uint8_t saved_t_E[6] = {0}, saved_t_Q[3] = {0};
- uint8_t saved_L_E = sbr->L_E[0];
- uint8_t saved_L_Q = sbr->L_Q[0];
- uint8_t saved_frame_class = sbr->bs_frame_class[0];
-
- for (n = 0; n < saved_L_E; n++)
- saved_t_E[n] = sbr->t_E[0][n];
- for (n = 0; n < saved_L_Q; n++)
- saved_t_Q[n] = sbr->t_Q[0][n];
-
- if ((result = sbr_grid(ld, sbr, 0)) > 0)
- return result;
- if ((result = sbr_grid(ld, sbr, 1)) > 0)
- {
- /* restore first channel data as well */
- sbr->bs_frame_class[0] = saved_frame_class;
- sbr->L_E[0] = saved_L_E;
- sbr->L_Q[0] = saved_L_Q;
- for (n = 0; n < 6; n++)
- sbr->t_E[0][n] = saved_t_E[n];
- for (n = 0; n < 3; n++)
- sbr->t_Q[0][n] = saved_t_Q[n];
-
- return result;
- }
- sbr_dtdf(ld, sbr, 0);
- sbr_dtdf(ld, sbr, 1);
- invf_mode(ld, sbr, 0);
- invf_mode(ld, sbr, 1);
- sbr_envelope(ld, sbr, 0);
- sbr_envelope(ld, sbr, 1);
- sbr_noise(ld, sbr, 0);
- sbr_noise(ld, sbr, 1);
-
- memset(sbr->bs_add_harmonic[0], 0, 64*sizeof(uint8_t));
- memset(sbr->bs_add_harmonic[1], 0, 64*sizeof(uint8_t));
-
- sbr->bs_add_harmonic_flag[0] = faad_get1bit(ld
- DEBUGVAR(1,239,"sbr_channel_pair_element(): bs_add_harmonic_flag[0]"));
- if (sbr->bs_add_harmonic_flag[0])
- sinusoidal_coding(ld, sbr, 0);
-
- sbr->bs_add_harmonic_flag[1] = faad_get1bit(ld
- DEBUGVAR(1,240,"sbr_channel_pair_element(): bs_add_harmonic_flag[1]"));
- if (sbr->bs_add_harmonic_flag[1])
- sinusoidal_coding(ld, sbr, 1);
- }
-#ifndef FIXED_POINT
- envelope_noise_dequantisation(sbr, 0);
- envelope_noise_dequantisation(sbr, 1);
-
- if (sbr->bs_coupling)
- unmap_envelope_noise(sbr);
-#endif
-
- sbr->bs_extended_data = faad_get1bit(ld
- DEBUGVAR(1,233,"sbr_channel_pair_element(): bs_extended_data[0]"));
- if (sbr->bs_extended_data)
- {
- uint16_t nr_bits_left;
- uint16_t cnt = (uint16_t)faad_getbits(ld, 4
- DEBUGVAR(1,234,"sbr_channel_pair_element(): bs_extension_size"));
- if (cnt == 15)
- {
- cnt += (uint16_t)faad_getbits(ld, 8
- DEBUGVAR(1,235,"sbr_channel_pair_element(): bs_esc_count"));
- }
-
- nr_bits_left = 8 * cnt;
- while (nr_bits_left > 7)
- {
- uint16_t tmp_nr_bits = 0;
-
- sbr->bs_extension_id = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,236,"sbr_channel_pair_element(): bs_extension_id"));
- tmp_nr_bits += 2;
- tmp_nr_bits += sbr_extension(ld, sbr, sbr->bs_extension_id, nr_bits_left);
-
- /* check if the data read is bigger than the number of available bits */
- if (tmp_nr_bits > nr_bits_left)
- return 1;
-
- nr_bits_left -= tmp_nr_bits;
- }
-
- /* Corrigendum */
- if (nr_bits_left > 0)
- {
- faad_getbits(ld, nr_bits_left
- DEBUGVAR(1,280,"sbr_channel_pair_element(): nr_bits_left"));
- }
- }
-
- return 0;
-}
-
-/* integer log[2](x): input range [0,10) */
-static int8_t sbr_log2(const int8_t val)
-{
- int8_t log2tab[] = { 0, 0, 1, 2, 2, 3, 3, 3, 3, 4 };
- if (val < 10 && val >= 0)
- return log2tab[val];
- else
- return 0;
-}
-
-
-/* table 7 */
-static uint8_t sbr_grid(bitfile *ld, sbr_info *sbr, uint8_t ch)
-{
- uint8_t i, env, rel, result;
- uint8_t bs_abs_bord, bs_abs_bord_1;
- uint8_t bs_num_env = 0;
- uint8_t saved_L_E = sbr->L_E[ch];
- uint8_t saved_L_Q = sbr->L_Q[ch];
- uint8_t saved_frame_class = sbr->bs_frame_class[ch];
-
- sbr->bs_frame_class[ch] = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,248,"sbr_grid(): bs_frame_class"));
-
- switch (sbr->bs_frame_class[ch])
- {
- case FIXFIX:
- i = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,249,"sbr_grid(): bs_num_env_raw"));
-
- bs_num_env = min(1 << i, 5);
-
- i = (uint8_t)faad_get1bit(ld
- DEBUGVAR(1,250,"sbr_grid(): bs_freq_res_flag"));
- for (env = 0; env < bs_num_env; env++)
- sbr->f[ch][env] = i;
-
- sbr->abs_bord_lead[ch] = 0;
- sbr->abs_bord_trail[ch] = sbr->numTimeSlots;
- sbr->n_rel_lead[ch] = bs_num_env - 1;
- sbr->n_rel_trail[ch] = 0;
- break;
-
- case FIXVAR:
- bs_abs_bord = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,251,"sbr_grid(): bs_abs_bord")) + sbr->numTimeSlots;
- bs_num_env = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,252,"sbr_grid(): bs_num_env")) + 1;
-
- for (rel = 0; rel < bs_num_env-1; rel++)
- {
- sbr->bs_rel_bord[ch][rel] = 2 * (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,253,"sbr_grid(): bs_rel_bord")) + 2;
- }
- i = sbr_log2(bs_num_env + 1);
- sbr->bs_pointer[ch] = (uint8_t)faad_getbits(ld, i
- DEBUGVAR(1,254,"sbr_grid(): bs_pointer"));
-
- for (env = 0; env < bs_num_env; env++)
- {
- sbr->f[ch][bs_num_env - env - 1] = (uint8_t)faad_get1bit(ld
- DEBUGVAR(1,255,"sbr_grid(): bs_freq_res"));
- }
-
- sbr->abs_bord_lead[ch] = 0;
- sbr->abs_bord_trail[ch] = bs_abs_bord;
- sbr->n_rel_lead[ch] = 0;
- sbr->n_rel_trail[ch] = bs_num_env - 1;
- break;
-
- case VARFIX:
- bs_abs_bord = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,256,"sbr_grid(): bs_abs_bord"));
- bs_num_env = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,257,"sbr_grid(): bs_num_env")) + 1;
-
- for (rel = 0; rel < bs_num_env-1; rel++)
- {
- sbr->bs_rel_bord[ch][rel] = 2 * (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,258,"sbr_grid(): bs_rel_bord")) + 2;
- }
- i = sbr_log2(bs_num_env + 1);
- sbr->bs_pointer[ch] = (uint8_t)faad_getbits(ld, i
- DEBUGVAR(1,259,"sbr_grid(): bs_pointer"));
-
- for (env = 0; env < bs_num_env; env++)
- {
- sbr->f[ch][env] = (uint8_t)faad_get1bit(ld
- DEBUGVAR(1,260,"sbr_grid(): bs_freq_res"));
- }
-
- sbr->abs_bord_lead[ch] = bs_abs_bord;
- sbr->abs_bord_trail[ch] = sbr->numTimeSlots;
- sbr->n_rel_lead[ch] = bs_num_env - 1;
- sbr->n_rel_trail[ch] = 0;
- break;
-
- case VARVAR:
- bs_abs_bord = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,261,"sbr_grid(): bs_abs_bord_0"));
- bs_abs_bord_1 = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,262,"sbr_grid(): bs_abs_bord_1")) + sbr->numTimeSlots;
- sbr->bs_num_rel_0[ch] = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,263,"sbr_grid(): bs_num_rel_0"));
- sbr->bs_num_rel_1[ch] = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,264,"sbr_grid(): bs_num_rel_1"));
-
- bs_num_env = min(5, sbr->bs_num_rel_0[ch] + sbr->bs_num_rel_1[ch] + 1);
-
- for (rel = 0; rel < sbr->bs_num_rel_0[ch]; rel++)
- {
- sbr->bs_rel_bord_0[ch][rel] = 2 * (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,265,"sbr_grid(): bs_rel_bord")) + 2;
- }
- for(rel = 0; rel < sbr->bs_num_rel_1[ch]; rel++)
- {
- sbr->bs_rel_bord_1[ch][rel] = 2 * (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,266,"sbr_grid(): bs_rel_bord")) + 2;
- }
- i = sbr_log2(sbr->bs_num_rel_0[ch] + sbr->bs_num_rel_1[ch] + 2);
- sbr->bs_pointer[ch] = (uint8_t)faad_getbits(ld, i
- DEBUGVAR(1,267,"sbr_grid(): bs_pointer"));
-
- for (env = 0; env < bs_num_env; env++)
- {
- sbr->f[ch][env] = (uint8_t)faad_get1bit(ld
- DEBUGVAR(1,268,"sbr_grid(): bs_freq_res"));
- }
-
- sbr->abs_bord_lead[ch] = bs_abs_bord;
- sbr->abs_bord_trail[ch] = bs_abs_bord_1;
- sbr->n_rel_lead[ch] = sbr->bs_num_rel_0[ch];
- sbr->n_rel_trail[ch] = sbr->bs_num_rel_1[ch];
- break;
- }
-
- if (sbr->bs_frame_class[ch] == VARVAR)
- sbr->L_E[ch] = min(bs_num_env, 5);
- else
- sbr->L_E[ch] = min(bs_num_env, 4);
-
- if (sbr->L_E[ch] <= 0)
- return 1;
-
- if (sbr->L_E[ch] > 1)
- sbr->L_Q[ch] = 2;
- else
- sbr->L_Q[ch] = 1;
-
- /* TODO: this code can probably be integrated into the code above! */
- if ((result = envelope_time_border_vector(sbr, ch)) > 0)
- {
- sbr->bs_frame_class[ch] = saved_frame_class;
- sbr->L_E[ch] = saved_L_E;
- sbr->L_Q[ch] = saved_L_Q;
- return result;
- }
- noise_floor_time_border_vector(sbr, ch);
-
-#if 0
- for (env = 0; env < bs_num_env; env++)
- {
- printf("freq_res[ch:%d][env:%d]: %d\n", ch, env, sbr->f[ch][env]);
- }
-#endif
-
- return 0;
-}
-
-/* table 8 */
-static void sbr_dtdf(bitfile *ld, sbr_info *sbr, uint8_t ch)
-{
- uint8_t i;
-
- for (i = 0; i < sbr->L_E[ch]; i++)
- {
- sbr->bs_df_env[ch][i] = faad_get1bit(ld
- DEBUGVAR(1,269,"sbr_dtdf(): bs_df_env"));
- }
-
- for (i = 0; i < sbr->L_Q[ch]; i++)
- {
- sbr->bs_df_noise[ch][i] = faad_get1bit(ld
- DEBUGVAR(1,270,"sbr_dtdf(): bs_df_noise"));
- }
-}
-
-/* table 9 */
-static void invf_mode(bitfile *ld, sbr_info *sbr, uint8_t ch)
-{
- uint8_t n;
-
- for (n = 0; n < sbr->N_Q; n++)
- {
- sbr->bs_invf_mode[ch][n] = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,271,"invf_mode(): bs_invf_mode"));
- }
-}
-
-static uint16_t sbr_extension(bitfile *ld, sbr_info *sbr,
- uint8_t bs_extension_id, uint16_t num_bits_left)
-{
-#ifdef PS_DEC
- uint8_t header;
- uint16_t ret;
-#endif
-
- switch (bs_extension_id)
- {
-#ifdef PS_DEC
- case EXTENSION_ID_PS:
- if (!sbr->ps)
- {
- sbr->ps = ps_init(get_sr_index(sbr->sample_rate));
- }
- ret = ps_data(sbr->ps, ld, &header);
-
- /* enable PS if and only if: a header has been decoded */
- if (sbr->ps_used == 0 && header == 1)
- {
- sbr->ps_used = 1;
- }
-
- return ret;
-#endif
-#ifdef DRM_PS
- case DRM_PARAMETRIC_STEREO:
- sbr->ps_used = 1;
- if (!sbr->drm_ps)
- {
- sbr->drm_ps = drm_ps_init();
- }
- return drm_ps_data(sbr->drm_ps, ld);
-#endif
- default:
- sbr->bs_extension_data = (uint8_t)faad_getbits(ld, 6
- DEBUGVAR(1,279,"sbr_single_channel_element(): bs_extension_data"));
- return 6;
- }
-}
-
-/* table 12 */
-static void sinusoidal_coding(bitfile *ld, sbr_info *sbr, uint8_t ch)
-{
- uint8_t n;
-
- for (n = 0; n < sbr->N_high; n++)
- {
- sbr->bs_add_harmonic[ch][n] = faad_get1bit(ld
- DEBUGVAR(1,278,"sinusoidal_coding(): bs_add_harmonic"));
- }
-}
-
-
-#endif /* SBR_DEC */
diff --git a/src/libfaad/sbr_syntax.h b/src/libfaad/sbr_syntax.h
deleted file mode 100644
index 1baa5fec3..000000000
--- a/src/libfaad/sbr_syntax.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_syntax.h,v 1.7 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __SBR_SYNTAX_H__
-#define __SBR_SYNTAX_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "bits.h"
-
-#define T_HFGEN 8
-#define T_HFADJ 2
-
-#define EXT_SBR_DATA 13
-#define EXT_SBR_DATA_CRC 14
-
-#define FIXFIX 0
-#define FIXVAR 1
-#define VARFIX 2
-#define VARVAR 3
-
-#define LO_RES 0
-#define HI_RES 1
-
-#define NO_TIME_SLOTS_960 15
-#define NO_TIME_SLOTS 16
-#define RATE 2
-
-#define NOISE_FLOOR_OFFSET 6
-
-
-uint8_t sbr_extension_data(bitfile *ld, sbr_info *sbr, uint16_t cnt);
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __SBR_SYNTAX_H__ */
-
diff --git a/src/libfaad/sbr_tf_grid.c b/src/libfaad/sbr_tf_grid.c
deleted file mode 100644
index ae741c256..000000000
--- a/src/libfaad/sbr_tf_grid.c
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_tf_grid.c,v 1.5 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-/* Time/Frequency grid */
-
-#include "common.h"
-#include "structs.h"
-
-#ifdef SBR_DEC
-
-#include <stdlib.h>
-
-#include "sbr_syntax.h"
-#include "sbr_tf_grid.h"
-
-
-/* static function declarations */
-#if 0
-static int16_t rel_bord_lead(sbr_info *sbr, uint8_t ch, uint8_t l);
-static int16_t rel_bord_trail(sbr_info *sbr, uint8_t ch, uint8_t l);
-#endif
-static uint8_t middleBorder(sbr_info *sbr, uint8_t ch);
-
-
-/* function constructs new time border vector */
-/* first build into temp vector to be able to use previous vector on error */
-uint8_t envelope_time_border_vector(sbr_info *sbr, uint8_t ch)
-{
- uint8_t l, border, temp;
- uint8_t t_E_temp[6] = {0};
-
- t_E_temp[0] = sbr->rate * sbr->abs_bord_lead[ch];
- t_E_temp[sbr->L_E[ch]] = sbr->rate * sbr->abs_bord_trail[ch];
-
- switch (sbr->bs_frame_class[ch])
- {
- case FIXFIX:
- switch (sbr->L_E[ch])
- {
- case 4:
- temp = (int) (sbr->numTimeSlots / 4);
- t_E_temp[3] = sbr->rate * 3 * temp;
- t_E_temp[2] = sbr->rate * 2 * temp;
- t_E_temp[1] = sbr->rate * temp;
- break;
- case 2:
- t_E_temp[1] = sbr->rate * (int) (sbr->numTimeSlots / 2);
- break;
- default:
- break;
- }
- break;
-
- case FIXVAR:
- if (sbr->L_E[ch] > 1)
- {
- int8_t i = sbr->L_E[ch];
- border = sbr->abs_bord_trail[ch];
-
- for (l = 0; l < (sbr->L_E[ch] - 1); l++)
- {
- if (border < sbr->bs_rel_bord[ch][l])
- return 1;
-
- border -= sbr->bs_rel_bord[ch][l];
- t_E_temp[--i] = sbr->rate * border;
- }
- }
- break;
-
- case VARFIX:
- if (sbr->L_E[ch] > 1)
- {
- int8_t i = 1;
- border = sbr->abs_bord_lead[ch];
-
- for (l = 0; l < (sbr->L_E[ch] - 1); l++)
- {
- border += sbr->bs_rel_bord[ch][l];
-
- if (sbr->rate * border + sbr->tHFAdj > sbr->numTimeSlotsRate+sbr->tHFGen)
- return 1;
-
- t_E_temp[i++] = sbr->rate * border;
- }
- }
- break;
-
- case VARVAR:
- if (sbr->bs_num_rel_0[ch])
- {
- int8_t i = 1;
- border = sbr->abs_bord_lead[ch];
-
- for (l = 0; l < sbr->bs_num_rel_0[ch]; l++)
- {
- border += sbr->bs_rel_bord_0[ch][l];
-
- if (sbr->rate * border + sbr->tHFAdj > sbr->numTimeSlotsRate+sbr->tHFGen)
- return 1;
-
- t_E_temp[i++] = sbr->rate * border;
- }
- }
-
- if (sbr->bs_num_rel_1[ch])
- {
- int8_t i = sbr->L_E[ch];
- border = sbr->abs_bord_trail[ch];
-
- for (l = 0; l < sbr->bs_num_rel_1[ch]; l++)
- {
- if (border < sbr->bs_rel_bord_1[ch][l])
- return 1;
-
- border -= sbr->bs_rel_bord_1[ch][l];
- t_E_temp[--i] = sbr->rate * border;
- }
- }
- break;
- }
-
- /* no error occured, we can safely use this t_E vector */
- for (l = 0; l < 6; l++)
- {
- sbr->t_E[ch][l] = t_E_temp[l];
- }
-
- return 0;
-}
-
-void noise_floor_time_border_vector(sbr_info *sbr, uint8_t ch)
-{
- sbr->t_Q[ch][0] = sbr->t_E[ch][0];
-
- if (sbr->L_E[ch] == 1)
- {
- sbr->t_Q[ch][1] = sbr->t_E[ch][1];
- sbr->t_Q[ch][2] = 0;
- } else {
- uint8_t index = middleBorder(sbr, ch);
- sbr->t_Q[ch][1] = sbr->t_E[ch][index];
- sbr->t_Q[ch][2] = sbr->t_E[ch][sbr->L_E[ch]];
- }
-}
-
-#if 0
-static int16_t rel_bord_lead(sbr_info *sbr, uint8_t ch, uint8_t l)
-{
- uint8_t i;
- int16_t acc = 0;
-
- switch (sbr->bs_frame_class[ch])
- {
- case FIXFIX:
- return sbr->numTimeSlots/sbr->L_E[ch];
- case FIXVAR:
- return 0;
- case VARFIX:
- for (i = 0; i < l; i++)
- {
- acc += sbr->bs_rel_bord[ch][i];
- }
- return acc;
- case VARVAR:
- for (i = 0; i < l; i++)
- {
- acc += sbr->bs_rel_bord_0[ch][i];
- }
- return acc;
- }
-
- return 0;
-}
-
-static int16_t rel_bord_trail(sbr_info *sbr, uint8_t ch, uint8_t l)
-{
- uint8_t i;
- int16_t acc = 0;
-
- switch (sbr->bs_frame_class[ch])
- {
- case FIXFIX:
- case VARFIX:
- return 0;
- case FIXVAR:
- for (i = 0; i < l; i++)
- {
- acc += sbr->bs_rel_bord[ch][i];
- }
- return acc;
- case VARVAR:
- for (i = 0; i < l; i++)
- {
- acc += sbr->bs_rel_bord_1[ch][i];
- }
- return acc;
- }
-
- return 0;
-}
-#endif
-
-static uint8_t middleBorder(sbr_info *sbr, uint8_t ch)
-{
- int8_t retval = 0;
-
- switch (sbr->bs_frame_class[ch])
- {
- case FIXFIX:
- retval = sbr->L_E[ch]/2;
- break;
- case VARFIX:
- if (sbr->bs_pointer[ch] == 0)
- retval = 1;
- else if (sbr->bs_pointer[ch] == 1)
- retval = sbr->L_E[ch] - 1;
- else
- retval = sbr->bs_pointer[ch] - 1;
- break;
- case FIXVAR:
- case VARVAR:
- if (sbr->bs_pointer[ch] > 1)
- retval = sbr->L_E[ch] + 1 - sbr->bs_pointer[ch];
- else
- retval = sbr->L_E[ch] - 1;
- break;
- }
-
- return (retval > 0) ? retval : 0;
-}
-
-
-#endif
diff --git a/src/libfaad/sbr_tf_grid.h b/src/libfaad/sbr_tf_grid.h
deleted file mode 100644
index 8772a384a..000000000
--- a/src/libfaad/sbr_tf_grid.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_tf_grid.h,v 1.5 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __SBR_TF_GRID_H__
-#define __SBR_TF_GRID_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-uint8_t envelope_time_border_vector(sbr_info *sbr, uint8_t ch);
-void noise_floor_time_border_vector(sbr_info *sbr, uint8_t ch);
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
diff --git a/src/libfaad/sine_win.h b/src/libfaad/sine_win.h
deleted file mode 100644
index c7e6ecd6e..000000000
--- a/src/libfaad/sine_win.h
+++ /dev/null
@@ -1,4301 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sine_win.h,v 1.6 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __SINE_WIN_H__
-#define __SINE_WIN_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef _MSC_VER
-#pragma warning(disable:4305)
-#pragma warning(disable:4244)
-#endif
-
-ALIGN static const real_t sine_long_1024[] =
-{
- FRAC_CONST(0.00076699031874270449),
- FRAC_CONST(0.002300969151425805),
- FRAC_CONST(0.0038349425697062275),
- FRAC_CONST(0.0053689069639963425),
- FRAC_CONST(0.0069028587247297558),
- FRAC_CONST(0.0084367942423697988),
- FRAC_CONST(0.0099707099074180308),
- FRAC_CONST(0.011504602110422714),
- FRAC_CONST(0.013038467241987334),
- FRAC_CONST(0.014572301692779064),
- FRAC_CONST(0.016106101853537287),
- FRAC_CONST(0.017639864115082053),
- FRAC_CONST(0.019173584868322623),
- FRAC_CONST(0.020707260504265895),
- FRAC_CONST(0.022240887414024961),
- FRAC_CONST(0.023774461988827555),
- FRAC_CONST(0.025307980620024571),
- FRAC_CONST(0.026841439699098531),
- FRAC_CONST(0.028374835617672099),
- FRAC_CONST(0.029908164767516555),
- FRAC_CONST(0.031441423540560301),
- FRAC_CONST(0.032974608328897335),
- FRAC_CONST(0.03450771552479575),
- FRAC_CONST(0.036040741520706229),
- FRAC_CONST(0.037573682709270494),
- FRAC_CONST(0.039106535483329888),
- FRAC_CONST(0.040639296235933736),
- FRAC_CONST(0.042171961360347947),
- FRAC_CONST(0.043704527250063421),
- FRAC_CONST(0.04523699029880459),
- FRAC_CONST(0.046769346900537863),
- FRAC_CONST(0.048301593449480144),
- FRAC_CONST(0.049833726340107277),
- FRAC_CONST(0.051365741967162593),
- FRAC_CONST(0.052897636725665324),
- FRAC_CONST(0.054429407010919133),
- FRAC_CONST(0.055961049218520569),
- FRAC_CONST(0.057492559744367566),
- FRAC_CONST(0.059023934984667931),
- FRAC_CONST(0.060555171335947788),
- FRAC_CONST(0.062086265195060088),
- FRAC_CONST(0.063617212959193106),
- FRAC_CONST(0.065148011025878833),
- FRAC_CONST(0.066678655793001557),
- FRAC_CONST(0.068209143658806329),
- FRAC_CONST(0.069739471021907307),
- FRAC_CONST(0.071269634281296401),
- FRAC_CONST(0.072799629836351673),
- FRAC_CONST(0.074329454086845756),
- FRAC_CONST(0.075859103432954447),
- FRAC_CONST(0.077388574275265049),
- FRAC_CONST(0.078917863014784942),
- FRAC_CONST(0.080446966052950014),
- FRAC_CONST(0.081975879791633066),
- FRAC_CONST(0.083504600633152432),
- FRAC_CONST(0.085033124980280275),
- FRAC_CONST(0.08656144923625117),
- FRAC_CONST(0.088089569804770507),
- FRAC_CONST(0.089617483090022959),
- FRAC_CONST(0.091145185496681005),
- FRAC_CONST(0.09267267342991331),
- FRAC_CONST(0.094199943295393204),
- FRAC_CONST(0.095726991499307162),
- FRAC_CONST(0.097253814448363271),
- FRAC_CONST(0.098780408549799623),
- FRAC_CONST(0.10030677021139286),
- FRAC_CONST(0.10183289584146653),
- FRAC_CONST(0.10335878184889961),
- FRAC_CONST(0.10488442464313497),
- FRAC_CONST(0.10640982063418768),
- FRAC_CONST(0.10793496623265365),
- FRAC_CONST(0.10945985784971798),
- FRAC_CONST(0.11098449189716339),
- FRAC_CONST(0.11250886478737869),
- FRAC_CONST(0.1140329729333672),
- FRAC_CONST(0.11555681274875526),
- FRAC_CONST(0.11708038064780059),
- FRAC_CONST(0.11860367304540072),
- FRAC_CONST(0.1201266863571015),
- FRAC_CONST(0.12164941699910553),
- FRAC_CONST(0.12317186138828048),
- FRAC_CONST(0.12469401594216764),
- FRAC_CONST(0.12621587707899035),
- FRAC_CONST(0.12773744121766231),
- FRAC_CONST(0.12925870477779614),
- FRAC_CONST(0.13077966417971171),
- FRAC_CONST(0.13230031584444465),
- FRAC_CONST(0.13382065619375472),
- FRAC_CONST(0.13534068165013421),
- FRAC_CONST(0.13686038863681638),
- FRAC_CONST(0.13837977357778389),
- FRAC_CONST(0.13989883289777721),
- FRAC_CONST(0.14141756302230302),
- FRAC_CONST(0.14293596037764267),
- FRAC_CONST(0.14445402139086047),
- FRAC_CONST(0.14597174248981221),
- FRAC_CONST(0.14748912010315357),
- FRAC_CONST(0.14900615066034845),
- FRAC_CONST(0.1505228305916774),
- FRAC_CONST(0.15203915632824605),
- FRAC_CONST(0.15355512430199345),
- FRAC_CONST(0.15507073094570051),
- FRAC_CONST(0.15658597269299843),
- FRAC_CONST(0.15810084597837698),
- FRAC_CONST(0.15961534723719306),
- FRAC_CONST(0.16112947290567881),
- FRAC_CONST(0.16264321942095031),
- FRAC_CONST(0.16415658322101581),
- FRAC_CONST(0.16566956074478412),
- FRAC_CONST(0.16718214843207294),
- FRAC_CONST(0.16869434272361733),
- FRAC_CONST(0.17020614006107807),
- FRAC_CONST(0.17171753688704997),
- FRAC_CONST(0.17322852964507032),
- FRAC_CONST(0.1747391147796272),
- FRAC_CONST(0.17624928873616788),
- FRAC_CONST(0.17775904796110717),
- FRAC_CONST(0.17926838890183575),
- FRAC_CONST(0.18077730800672859),
- FRAC_CONST(0.1822858017251533),
- FRAC_CONST(0.18379386650747845),
- FRAC_CONST(0.1853014988050819),
- FRAC_CONST(0.18680869507035927),
- FRAC_CONST(0.18831545175673212),
- FRAC_CONST(0.18982176531865641),
- FRAC_CONST(0.1913276322116309),
- FRAC_CONST(0.19283304889220523),
- FRAC_CONST(0.1943380118179886),
- FRAC_CONST(0.19584251744765785),
- FRAC_CONST(0.19734656224096592),
- FRAC_CONST(0.19885014265875009),
- FRAC_CONST(0.20035325516294045),
- FRAC_CONST(0.20185589621656805),
- FRAC_CONST(0.20335806228377332),
- FRAC_CONST(0.20485974982981442),
- FRAC_CONST(0.20636095532107551),
- FRAC_CONST(0.20786167522507507),
- FRAC_CONST(0.20936190601047416),
- FRAC_CONST(0.21086164414708486),
- FRAC_CONST(0.21236088610587842),
- FRAC_CONST(0.21385962835899375),
- FRAC_CONST(0.21535786737974555),
- FRAC_CONST(0.21685559964263262),
- FRAC_CONST(0.21835282162334632),
- FRAC_CONST(0.2198495297987787),
- FRAC_CONST(0.22134572064703081),
- FRAC_CONST(0.22284139064742112),
- FRAC_CONST(0.2243365362804936),
- FRAC_CONST(0.22583115402802617),
- FRAC_CONST(0.22732524037303886),
- FRAC_CONST(0.22881879179980222),
- FRAC_CONST(0.23031180479384544),
- FRAC_CONST(0.23180427584196478),
- FRAC_CONST(0.23329620143223159),
- FRAC_CONST(0.23478757805400097),
- FRAC_CONST(0.23627840219791957),
- FRAC_CONST(0.23776867035593419),
- FRAC_CONST(0.23925837902129998),
- FRAC_CONST(0.24074752468858843),
- FRAC_CONST(0.24223610385369601),
- FRAC_CONST(0.24372411301385216),
- FRAC_CONST(0.24521154866762754),
- FRAC_CONST(0.24669840731494241),
- FRAC_CONST(0.24818468545707478),
- FRAC_CONST(0.24967037959666857),
- FRAC_CONST(0.25115548623774192),
- FRAC_CONST(0.25264000188569552),
- FRAC_CONST(0.25412392304732062),
- FRAC_CONST(0.25560724623080738),
- FRAC_CONST(0.25708996794575312),
- FRAC_CONST(0.25857208470317034),
- FRAC_CONST(0.26005359301549519),
- FRAC_CONST(0.26153448939659552),
- FRAC_CONST(0.263014770361779),
- FRAC_CONST(0.26449443242780163),
- FRAC_CONST(0.26597347211287559),
- FRAC_CONST(0.26745188593667762),
- FRAC_CONST(0.26892967042035726),
- FRAC_CONST(0.27040682208654482),
- FRAC_CONST(0.27188333745935972),
- FRAC_CONST(0.27335921306441868),
- FRAC_CONST(0.27483444542884394),
- FRAC_CONST(0.27630903108127108),
- FRAC_CONST(0.27778296655185769),
- FRAC_CONST(0.27925624837229118),
- FRAC_CONST(0.28072887307579719),
- FRAC_CONST(0.28220083719714756),
- FRAC_CONST(0.28367213727266843),
- FRAC_CONST(0.28514276984024867),
- FRAC_CONST(0.28661273143934779),
- FRAC_CONST(0.28808201861100413),
- FRAC_CONST(0.28955062789784303),
- FRAC_CONST(0.29101855584408509),
- FRAC_CONST(0.29248579899555388),
- FRAC_CONST(0.29395235389968466),
- FRAC_CONST(0.29541821710553201),
- FRAC_CONST(0.29688338516377827),
- FRAC_CONST(0.2983478546267414),
- FRAC_CONST(0.29981162204838335),
- FRAC_CONST(0.30127468398431795),
- FRAC_CONST(0.30273703699181914),
- FRAC_CONST(0.30419867762982911),
- FRAC_CONST(0.30565960245896612),
- FRAC_CONST(0.3071198080415331),
- FRAC_CONST(0.30857929094152509),
- FRAC_CONST(0.31003804772463789),
- FRAC_CONST(0.31149607495827591),
- FRAC_CONST(0.3129533692115602),
- FRAC_CONST(0.31440992705533666),
- FRAC_CONST(0.31586574506218396),
- FRAC_CONST(0.31732081980642174),
- FRAC_CONST(0.31877514786411848),
- FRAC_CONST(0.32022872581309986),
- FRAC_CONST(0.32168155023295658),
- FRAC_CONST(0.32313361770505233),
- FRAC_CONST(0.32458492481253215),
- FRAC_CONST(0.32603546814033024),
- FRAC_CONST(0.327485244275178),
- FRAC_CONST(0.3289342498056122),
- FRAC_CONST(0.33038248132198278),
- FRAC_CONST(0.33182993541646111),
- FRAC_CONST(0.33327660868304793),
- FRAC_CONST(0.33472249771758122),
- FRAC_CONST(0.33616759911774452),
- FRAC_CONST(0.33761190948307462),
- FRAC_CONST(0.33905542541496964),
- FRAC_CONST(0.34049814351669716),
- FRAC_CONST(0.34194006039340219),
- FRAC_CONST(0.34338117265211504),
- FRAC_CONST(0.34482147690175929),
- FRAC_CONST(0.34626096975316001),
- FRAC_CONST(0.34769964781905138),
- FRAC_CONST(0.34913750771408497),
- FRAC_CONST(0.35057454605483751),
- FRAC_CONST(0.35201075945981908),
- FRAC_CONST(0.35344614454948081),
- FRAC_CONST(0.35488069794622279),
- FRAC_CONST(0.35631441627440241),
- FRAC_CONST(0.3577472961603419),
- FRAC_CONST(0.3591793342323365),
- FRAC_CONST(0.36061052712066227),
- FRAC_CONST(0.36204087145758418),
- FRAC_CONST(0.36347036387736376),
- FRAC_CONST(0.36489900101626732),
- FRAC_CONST(0.36632677951257359),
- FRAC_CONST(0.36775369600658198),
- FRAC_CONST(0.36917974714062002),
- FRAC_CONST(0.37060492955905167),
- FRAC_CONST(0.37202923990828501),
- FRAC_CONST(0.3734526748367803),
- FRAC_CONST(0.37487523099505754),
- FRAC_CONST(0.37629690503570479),
- FRAC_CONST(0.37771769361338564),
- FRAC_CONST(0.37913759338484732),
- FRAC_CONST(0.38055660100892852),
- FRAC_CONST(0.38197471314656722),
- FRAC_CONST(0.38339192646080866),
- FRAC_CONST(0.38480823761681288),
- FRAC_CONST(0.38622364328186298),
- FRAC_CONST(0.38763814012537273),
- FRAC_CONST(0.38905172481889438),
- FRAC_CONST(0.39046439403612659),
- FRAC_CONST(0.39187614445292235),
- FRAC_CONST(0.3932869727472964),
- FRAC_CONST(0.39469687559943356),
- FRAC_CONST(0.39610584969169627),
- FRAC_CONST(0.39751389170863233),
- FRAC_CONST(0.39892099833698291),
- FRAC_CONST(0.40032716626569009),
- FRAC_CONST(0.40173239218590501),
- FRAC_CONST(0.4031366727909953),
- FRAC_CONST(0.404540004776553),
- FRAC_CONST(0.40594238484040251),
- FRAC_CONST(0.40734380968260797),
- FRAC_CONST(0.40874427600548136),
- FRAC_CONST(0.41014378051359024),
- FRAC_CONST(0.41154231991376522),
- FRAC_CONST(0.41293989091510808),
- FRAC_CONST(0.4143364902289991),
- FRAC_CONST(0.41573211456910536),
- FRAC_CONST(0.41712676065138787),
- FRAC_CONST(0.4185204251941097),
- FRAC_CONST(0.41991310491784362),
- FRAC_CONST(0.42130479654547964),
- FRAC_CONST(0.42269549680223295),
- FRAC_CONST(0.42408520241565156),
- FRAC_CONST(0.4254739101156238),
- FRAC_CONST(0.42686161663438643),
- FRAC_CONST(0.42824831870653196),
- FRAC_CONST(0.42963401306901638),
- FRAC_CONST(0.43101869646116703),
- FRAC_CONST(0.43240236562469014),
- FRAC_CONST(0.43378501730367852),
- FRAC_CONST(0.43516664824461926),
- FRAC_CONST(0.4365472551964012),
- FRAC_CONST(0.43792683491032286),
- FRAC_CONST(0.43930538414009995),
- FRAC_CONST(0.4406828996418729),
- FRAC_CONST(0.4420593781742147),
- FRAC_CONST(0.44343481649813848),
- FRAC_CONST(0.44480921137710488),
- FRAC_CONST(0.44618255957703007),
- FRAC_CONST(0.44755485786629301),
- FRAC_CONST(0.44892610301574326),
- FRAC_CONST(0.45029629179870861),
- FRAC_CONST(0.45166542099100249),
- FRAC_CONST(0.45303348737093158),
- FRAC_CONST(0.45440048771930358),
- FRAC_CONST(0.45576641881943464),
- FRAC_CONST(0.45713127745715698),
- FRAC_CONST(0.45849506042082627),
- FRAC_CONST(0.45985776450132954),
- FRAC_CONST(0.46121938649209238),
- FRAC_CONST(0.46257992318908681),
- FRAC_CONST(0.46393937139083852),
- FRAC_CONST(0.4652977278984346),
- FRAC_CONST(0.46665498951553092),
- FRAC_CONST(0.46801115304835983),
- FRAC_CONST(0.46936621530573752),
- FRAC_CONST(0.4707201730990716),
- FRAC_CONST(0.47207302324236866),
- FRAC_CONST(0.47342476255224153),
- FRAC_CONST(0.47477538784791712),
- FRAC_CONST(0.47612489595124358),
- FRAC_CONST(0.47747328368669806),
- FRAC_CONST(0.47882054788139389),
- FRAC_CONST(0.48016668536508839),
- FRAC_CONST(0.48151169297018986),
- FRAC_CONST(0.48285556753176567),
- FRAC_CONST(0.48419830588754903),
- FRAC_CONST(0.48553990487794696),
- FRAC_CONST(0.48688036134604734),
- FRAC_CONST(0.48821967213762679),
- FRAC_CONST(0.48955783410115744),
- FRAC_CONST(0.49089484408781509),
- FRAC_CONST(0.49223069895148602),
- FRAC_CONST(0.49356539554877477),
- FRAC_CONST(0.49489893073901126),
- FRAC_CONST(0.49623130138425825),
- FRAC_CONST(0.49756250434931915),
- FRAC_CONST(0.49889253650174459),
- FRAC_CONST(0.50022139471184068),
- FRAC_CONST(0.50154907585267539),
- FRAC_CONST(0.50287557680008699),
- FRAC_CONST(0.50420089443269034),
- FRAC_CONST(0.50552502563188539),
- FRAC_CONST(0.50684796728186321),
- FRAC_CONST(0.5081697162696146),
- FRAC_CONST(0.50949026948493636),
- FRAC_CONST(0.51080962382043904),
- FRAC_CONST(0.51212777617155469),
- FRAC_CONST(0.51344472343654346),
- FRAC_CONST(0.5147604625165012),
- FRAC_CONST(0.51607499031536663),
- FRAC_CONST(0.51738830373992906),
- FRAC_CONST(0.51870039969983495),
- FRAC_CONST(0.52001127510759604),
- FRAC_CONST(0.52132092687859566),
- FRAC_CONST(0.52262935193109661),
- FRAC_CONST(0.5239365471862486),
- FRAC_CONST(0.52524250956809471),
- FRAC_CONST(0.52654723600357944),
- FRAC_CONST(0.52785072342255523),
- FRAC_CONST(0.52915296875779061),
- FRAC_CONST(0.53045396894497632),
- FRAC_CONST(0.53175372092273332),
- FRAC_CONST(0.53305222163261945),
- FRAC_CONST(0.53434946801913752),
- FRAC_CONST(0.53564545702974109),
- FRAC_CONST(0.53694018561484291),
- FRAC_CONST(0.5382336507278217),
- FRAC_CONST(0.53952584932502889),
- FRAC_CONST(0.54081677836579667),
- FRAC_CONST(0.54210643481244392),
- FRAC_CONST(0.5433948156302848),
- FRAC_CONST(0.54468191778763453),
- FRAC_CONST(0.54596773825581757),
- FRAC_CONST(0.54725227400917409),
- FRAC_CONST(0.54853552202506739),
- FRAC_CONST(0.54981747928389091),
- FRAC_CONST(0.55109814276907543),
- FRAC_CONST(0.55237750946709607),
- FRAC_CONST(0.55365557636747931),
- FRAC_CONST(0.55493234046281037),
- FRAC_CONST(0.55620779874873993),
- FRAC_CONST(0.55748194822399155),
- FRAC_CONST(0.55875478589036831),
- FRAC_CONST(0.56002630875276038),
- FRAC_CONST(0.56129651381915147),
- FRAC_CONST(0.56256539810062656),
- FRAC_CONST(0.56383295861137817),
- FRAC_CONST(0.56509919236871398),
- FRAC_CONST(0.56636409639306384),
- FRAC_CONST(0.56762766770798623),
- FRAC_CONST(0.56888990334017586),
- FRAC_CONST(0.5701508003194703),
- FRAC_CONST(0.57141035567885723),
- FRAC_CONST(0.57266856645448116),
- FRAC_CONST(0.57392542968565075),
- FRAC_CONST(0.57518094241484508),
- FRAC_CONST(0.57643510168772183),
- FRAC_CONST(0.5776879045531228),
- FRAC_CONST(0.57893934806308178),
- FRAC_CONST(0.58018942927283168),
- FRAC_CONST(0.58143814524081017),
- FRAC_CONST(0.58268549302866846),
- FRAC_CONST(0.58393146970127618),
- FRAC_CONST(0.58517607232673041),
- FRAC_CONST(0.5864192979763605),
- FRAC_CONST(0.58766114372473666),
- FRAC_CONST(0.58890160664967572),
- FRAC_CONST(0.59014068383224882),
- FRAC_CONST(0.59137837235678758),
- FRAC_CONST(0.59261466931089113),
- FRAC_CONST(0.59384957178543363),
- FRAC_CONST(0.59508307687456996),
- FRAC_CONST(0.59631518167574371),
- FRAC_CONST(0.59754588328969316),
- FRAC_CONST(0.59877517882045872),
- FRAC_CONST(0.60000306537538894),
- FRAC_CONST(0.6012295400651485),
- FRAC_CONST(0.60245460000372375),
- FRAC_CONST(0.60367824230843037),
- FRAC_CONST(0.60490046409991982),
- FRAC_CONST(0.60612126250218612),
- FRAC_CONST(0.60734063464257293),
- FRAC_CONST(0.60855857765177945),
- FRAC_CONST(0.60977508866386843),
- FRAC_CONST(0.61099016481627166),
- FRAC_CONST(0.61220380324979795),
- FRAC_CONST(0.61341600110863859),
- FRAC_CONST(0.61462675554037505),
- FRAC_CONST(0.61583606369598509),
- FRAC_CONST(0.61704392272984976),
- FRAC_CONST(0.61825032979976025),
- FRAC_CONST(0.61945528206692402),
- FRAC_CONST(0.62065877669597214),
- FRAC_CONST(0.62186081085496536),
- FRAC_CONST(0.62306138171540126),
- FRAC_CONST(0.62426048645222065),
- FRAC_CONST(0.62545812224381436),
- FRAC_CONST(0.62665428627202935),
- FRAC_CONST(0.62784897572217646),
- FRAC_CONST(0.629042187783036),
- FRAC_CONST(0.63023391964686437),
- FRAC_CONST(0.63142416850940186),
- FRAC_CONST(0.63261293156987741),
- FRAC_CONST(0.63380020603101728),
- FRAC_CONST(0.63498598909904946),
- FRAC_CONST(0.63617027798371217),
- FRAC_CONST(0.63735306989825913),
- FRAC_CONST(0.63853436205946679),
- FRAC_CONST(0.63971415168764045),
- FRAC_CONST(0.64089243600662138),
- FRAC_CONST(0.64206921224379254),
- FRAC_CONST(0.64324447763008585),
- FRAC_CONST(0.64441822939998838),
- FRAC_CONST(0.64559046479154869),
- FRAC_CONST(0.64676118104638392),
- FRAC_CONST(0.64793037540968534),
- FRAC_CONST(0.64909804513022595),
- FRAC_CONST(0.65026418746036585),
- FRAC_CONST(0.65142879965605982),
- FRAC_CONST(0.65259187897686244),
- FRAC_CONST(0.65375342268593606),
- FRAC_CONST(0.65491342805005603),
- FRAC_CONST(0.6560718923396176),
- FRAC_CONST(0.65722881282864254),
- FRAC_CONST(0.65838418679478505),
- FRAC_CONST(0.65953801151933866),
- FRAC_CONST(0.6606902842872423),
- FRAC_CONST(0.66184100238708687),
- FRAC_CONST(0.66299016311112147),
- FRAC_CONST(0.66413776375526001),
- FRAC_CONST(0.66528380161908718),
- FRAC_CONST(0.66642827400586524),
- FRAC_CONST(0.66757117822254031),
- FRAC_CONST(0.66871251157974798),
- FRAC_CONST(0.66985227139182102),
- FRAC_CONST(0.67099045497679422),
- FRAC_CONST(0.67212705965641173),
- FRAC_CONST(0.67326208275613297),
- FRAC_CONST(0.67439552160513905),
- FRAC_CONST(0.67552737353633852),
- FRAC_CONST(0.67665763588637495),
- FRAC_CONST(0.6777863059956315),
- FRAC_CONST(0.67891338120823841),
- FRAC_CONST(0.68003885887207893),
- FRAC_CONST(0.68116273633879543),
- FRAC_CONST(0.68228501096379557),
- FRAC_CONST(0.68340568010625868),
- FRAC_CONST(0.6845247411291423),
- FRAC_CONST(0.68564219139918747),
- FRAC_CONST(0.68675802828692589),
- FRAC_CONST(0.68787224916668555),
- FRAC_CONST(0.68898485141659704),
- FRAC_CONST(0.69009583241859995),
- FRAC_CONST(0.69120518955844845),
- FRAC_CONST(0.69231292022571822),
- FRAC_CONST(0.69341902181381176),
- FRAC_CONST(0.69452349171996552),
- FRAC_CONST(0.69562632734525487),
- FRAC_CONST(0.6967275260946012),
- FRAC_CONST(0.69782708537677729),
- FRAC_CONST(0.69892500260441415),
- FRAC_CONST(0.70002127519400625),
- FRAC_CONST(0.70111590056591866),
- FRAC_CONST(0.70220887614439187),
- FRAC_CONST(0.70330019935754873),
- FRAC_CONST(0.70438986763740041),
- FRAC_CONST(0.7054778784198521),
- FRAC_CONST(0.70656422914470951),
- FRAC_CONST(0.70764891725568435),
- FRAC_CONST(0.70873194020040065),
- FRAC_CONST(0.70981329543040084),
- FRAC_CONST(0.71089298040115168),
- FRAC_CONST(0.71197099257204999),
- FRAC_CONST(0.71304732940642923),
- FRAC_CONST(0.71412198837156471),
- FRAC_CONST(0.71519496693868001),
- FRAC_CONST(0.71626626258295312),
- FRAC_CONST(0.71733587278352173),
- FRAC_CONST(0.71840379502348972),
- FRAC_CONST(0.71947002678993299),
- FRAC_CONST(0.72053456557390527),
- FRAC_CONST(0.72159740887044366),
- FRAC_CONST(0.72265855417857561),
- FRAC_CONST(0.72371799900132339),
- FRAC_CONST(0.72477574084571128),
- FRAC_CONST(0.72583177722277037),
- FRAC_CONST(0.72688610564754497),
- FRAC_CONST(0.72793872363909862),
- FRAC_CONST(0.72898962872051931),
- FRAC_CONST(0.73003881841892615),
- FRAC_CONST(0.73108629026547423),
- FRAC_CONST(0.73213204179536129),
- FRAC_CONST(0.73317607054783274),
- FRAC_CONST(0.73421837406618817),
- FRAC_CONST(0.73525894989778673),
- FRAC_CONST(0.73629779559405306),
- FRAC_CONST(0.73733490871048279),
- FRAC_CONST(0.73837028680664851),
- FRAC_CONST(0.73940392744620576),
- FRAC_CONST(0.74043582819689802),
- FRAC_CONST(0.74146598663056329),
- FRAC_CONST(0.74249440032313918),
- FRAC_CONST(0.74352106685466912),
- FRAC_CONST(0.74454598380930725),
- FRAC_CONST(0.74556914877532543),
- FRAC_CONST(0.74659055934511731),
- FRAC_CONST(0.74761021311520515),
- FRAC_CONST(0.74862810768624533),
- FRAC_CONST(0.74964424066303348),
- FRAC_CONST(0.75065860965451059),
- FRAC_CONST(0.75167121227376843),
- FRAC_CONST(0.75268204613805523),
- FRAC_CONST(0.75369110886878121),
- FRAC_CONST(0.75469839809152439),
- FRAC_CONST(0.75570391143603588),
- FRAC_CONST(0.75670764653624567),
- FRAC_CONST(0.75770960103026808),
- FRAC_CONST(0.75870977256040739),
- FRAC_CONST(0.75970815877316344),
- FRAC_CONST(0.76070475731923692),
- FRAC_CONST(0.76169956585353527),
- FRAC_CONST(0.76269258203517787),
- FRAC_CONST(0.76368380352750187),
- FRAC_CONST(0.76467322799806714),
- FRAC_CONST(0.76566085311866239),
- FRAC_CONST(0.76664667656531038),
- FRAC_CONST(0.76763069601827327),
- FRAC_CONST(0.76861290916205827),
- FRAC_CONST(0.76959331368542294),
- FRAC_CONST(0.7705719072813807),
- FRAC_CONST(0.7715486876472063),
- FRAC_CONST(0.77252365248444133),
- FRAC_CONST(0.77349679949889905),
- FRAC_CONST(0.77446812640067086),
- FRAC_CONST(0.77543763090413043),
- FRAC_CONST(0.77640531072794039),
- FRAC_CONST(0.7773711635950562),
- FRAC_CONST(0.77833518723273309),
- FRAC_CONST(0.7792973793725303),
- FRAC_CONST(0.78025773775031659),
- FRAC_CONST(0.78121626010627609),
- FRAC_CONST(0.7821729441849129),
- FRAC_CONST(0.78312778773505731),
- FRAC_CONST(0.78408078850986995),
- FRAC_CONST(0.78503194426684808),
- FRAC_CONST(0.78598125276783015),
- FRAC_CONST(0.7869287117790017),
- FRAC_CONST(0.78787431907090011),
- FRAC_CONST(0.78881807241842017),
- FRAC_CONST(0.78975996960081907),
- FRAC_CONST(0.79070000840172161),
- FRAC_CONST(0.79163818660912577),
- FRAC_CONST(0.79257450201540758),
- FRAC_CONST(0.79350895241732666),
- FRAC_CONST(0.79444153561603059),
- FRAC_CONST(0.79537224941706119),
- FRAC_CONST(0.79630109163035911),
- FRAC_CONST(0.7972280600702687),
- FRAC_CONST(0.79815315255554375),
- FRAC_CONST(0.79907636690935235),
- FRAC_CONST(0.79999770095928191),
- FRAC_CONST(0.8009171525373443),
- FRAC_CONST(0.80183471947998131),
- FRAC_CONST(0.80275039962806916),
- FRAC_CONST(0.80366419082692409),
- FRAC_CONST(0.804576090926307),
- FRAC_CONST(0.80548609778042912),
- FRAC_CONST(0.80639420924795624),
- FRAC_CONST(0.80730042319201445),
- FRAC_CONST(0.80820473748019472),
- FRAC_CONST(0.80910714998455813),
- FRAC_CONST(0.81000765858164114),
- FRAC_CONST(0.81090626115245967),
- FRAC_CONST(0.81180295558251536),
- FRAC_CONST(0.81269773976179949),
- FRAC_CONST(0.81359061158479851),
- FRAC_CONST(0.81448156895049861),
- FRAC_CONST(0.81537060976239129),
- FRAC_CONST(0.81625773192847739),
- FRAC_CONST(0.81714293336127297),
- FRAC_CONST(0.81802621197781344),
- FRAC_CONST(0.81890756569965895),
- FRAC_CONST(0.81978699245289899),
- FRAC_CONST(0.82066449016815746),
- FRAC_CONST(0.82154005678059761),
- FRAC_CONST(0.82241369022992639),
- FRAC_CONST(0.82328538846040011),
- FRAC_CONST(0.82415514942082857),
- FRAC_CONST(0.82502297106458022),
- FRAC_CONST(0.82588885134958678),
- FRAC_CONST(0.82675278823834852),
- FRAC_CONST(0.8276147796979384),
- FRAC_CONST(0.82847482370000713),
- FRAC_CONST(0.82933291822078825),
- FRAC_CONST(0.83018906124110237),
- FRAC_CONST(0.83104325074636232),
- FRAC_CONST(0.83189548472657759),
- FRAC_CONST(0.83274576117635946),
- FRAC_CONST(0.83359407809492514),
- FRAC_CONST(0.83444043348610319),
- FRAC_CONST(0.83528482535833737),
- FRAC_CONST(0.83612725172469216),
- FRAC_CONST(0.83696771060285702),
- FRAC_CONST(0.83780620001515094),
- FRAC_CONST(0.8386427179885273),
- FRAC_CONST(0.83947726255457855),
- FRAC_CONST(0.84030983174954077),
- FRAC_CONST(0.84114042361429808),
- FRAC_CONST(0.84196903619438768),
- FRAC_CONST(0.84279566754000412),
- FRAC_CONST(0.84362031570600404),
- FRAC_CONST(0.84444297875191066),
- FRAC_CONST(0.84526365474191822),
- FRAC_CONST(0.84608234174489694),
- FRAC_CONST(0.84689903783439735),
- FRAC_CONST(0.84771374108865427),
- FRAC_CONST(0.84852644959059265),
- FRAC_CONST(0.84933716142783067),
- FRAC_CONST(0.85014587469268521),
- FRAC_CONST(0.85095258748217573),
- FRAC_CONST(0.85175729789802912),
- FRAC_CONST(0.85256000404668397),
- FRAC_CONST(0.85336070403929543),
- FRAC_CONST(0.85415939599173873),
- FRAC_CONST(0.85495607802461482),
- FRAC_CONST(0.85575074826325392),
- FRAC_CONST(0.85654340483771996),
- FRAC_CONST(0.85733404588281559),
- FRAC_CONST(0.85812266953808602),
- FRAC_CONST(0.8589092739478239),
- FRAC_CONST(0.85969385726107261),
- FRAC_CONST(0.86047641763163207),
- FRAC_CONST(0.86125695321806206),
- FRAC_CONST(0.86203546218368721),
- FRAC_CONST(0.86281194269660033),
- FRAC_CONST(0.86358639292966799),
- FRAC_CONST(0.86435881106053403),
- FRAC_CONST(0.86512919527162369),
- FRAC_CONST(0.86589754375014882),
- FRAC_CONST(0.86666385468811102),
- FRAC_CONST(0.86742812628230692),
- FRAC_CONST(0.86819035673433131),
- FRAC_CONST(0.86895054425058238),
- FRAC_CONST(0.86970868704226556),
- FRAC_CONST(0.87046478332539767),
- FRAC_CONST(0.8712188313208109),
- FRAC_CONST(0.8719708292541577),
- FRAC_CONST(0.8727207753559143),
- FRAC_CONST(0.87346866786138488),
- FRAC_CONST(0.8742145050107063),
- FRAC_CONST(0.87495828504885154),
- FRAC_CONST(0.8757000062256346),
- FRAC_CONST(0.87643966679571361),
- FRAC_CONST(0.87717726501859594),
- FRAC_CONST(0.87791279915864173),
- FRAC_CONST(0.87864626748506813),
- FRAC_CONST(0.87937766827195318),
- FRAC_CONST(0.88010699979824036),
- FRAC_CONST(0.88083426034774204),
- FRAC_CONST(0.88155944820914378),
- FRAC_CONST(0.8822825616760086),
- FRAC_CONST(0.88300359904678072),
- FRAC_CONST(0.88372255862478966),
- FRAC_CONST(0.8844394387182537),
- FRAC_CONST(0.88515423764028511),
- FRAC_CONST(0.88586695370889279),
- FRAC_CONST(0.88657758524698704),
- FRAC_CONST(0.88728613058238315),
- FRAC_CONST(0.88799258804780556),
- FRAC_CONST(0.88869695598089171),
- FRAC_CONST(0.88939923272419552),
- FRAC_CONST(0.89009941662519221),
- FRAC_CONST(0.89079750603628149),
- FRAC_CONST(0.89149349931479138),
- FRAC_CONST(0.89218739482298248),
- FRAC_CONST(0.89287919092805168),
- FRAC_CONST(0.89356888600213602),
- FRAC_CONST(0.89425647842231604),
- FRAC_CONST(0.89494196657062075),
- FRAC_CONST(0.89562534883403),
- FRAC_CONST(0.89630662360447966),
- FRAC_CONST(0.89698578927886397),
- FRAC_CONST(0.89766284425904075),
- FRAC_CONST(0.89833778695183419),
- FRAC_CONST(0.89901061576903907),
- FRAC_CONST(0.89968132912742393),
- FRAC_CONST(0.9003499254487356),
- FRAC_CONST(0.90101640315970233),
- FRAC_CONST(0.90168076069203773),
- FRAC_CONST(0.9023429964824442),
- FRAC_CONST(0.90300310897261704),
- FRAC_CONST(0.90366109660924798),
- FRAC_CONST(0.90431695784402832),
- FRAC_CONST(0.90497069113365325),
- FRAC_CONST(0.90562229493982516),
- FRAC_CONST(0.90627176772925766),
- FRAC_CONST(0.90691910797367803),
- FRAC_CONST(0.90756431414983252),
- FRAC_CONST(0.9082073847394887),
- FRAC_CONST(0.90884831822943912),
- FRAC_CONST(0.90948711311150543),
- FRAC_CONST(0.91012376788254157),
- FRAC_CONST(0.91075828104443757),
- FRAC_CONST(0.91139065110412232),
- FRAC_CONST(0.91202087657356823),
- FRAC_CONST(0.9126489559697939),
- FRAC_CONST(0.91327488781486776),
- FRAC_CONST(0.91389867063591168),
- FRAC_CONST(0.91452030296510445),
- FRAC_CONST(0.91513978333968526),
- FRAC_CONST(0.91575711030195672),
- FRAC_CONST(0.91637228239928914),
- FRAC_CONST(0.91698529818412289),
- FRAC_CONST(0.91759615621397295),
- FRAC_CONST(0.9182048550514309),
- FRAC_CONST(0.91881139326416994),
- FRAC_CONST(0.91941576942494696),
- FRAC_CONST(0.92001798211160657),
- FRAC_CONST(0.92061802990708386),
- FRAC_CONST(0.92121591139940873),
- FRAC_CONST(0.92181162518170812),
- FRAC_CONST(0.92240516985220988),
- FRAC_CONST(0.92299654401424625),
- FRAC_CONST(0.92358574627625656),
- FRAC_CONST(0.9241727752517912),
- FRAC_CONST(0.92475762955951391),
- FRAC_CONST(0.9253403078232062),
- FRAC_CONST(0.92592080867176996),
- FRAC_CONST(0.92649913073923051),
- FRAC_CONST(0.9270752726647401),
- FRAC_CONST(0.92764923309258118),
- FRAC_CONST(0.92822101067216944),
- FRAC_CONST(0.92879060405805702),
- FRAC_CONST(0.9293580119099355),
- FRAC_CONST(0.92992323289263956),
- FRAC_CONST(0.93048626567614978),
- FRAC_CONST(0.93104710893559517),
- FRAC_CONST(0.93160576135125783),
- FRAC_CONST(0.93216222160857432),
- FRAC_CONST(0.93271648839814025),
- FRAC_CONST(0.93326856041571205),
- FRAC_CONST(0.93381843636221096),
- FRAC_CONST(0.9343661149437259),
- FRAC_CONST(0.93491159487151609),
- FRAC_CONST(0.93545487486201462),
- FRAC_CONST(0.9359959536368313),
- FRAC_CONST(0.9365348299227555),
- FRAC_CONST(0.93707150245175919),
- FRAC_CONST(0.93760596996099999),
- FRAC_CONST(0.93813823119282436),
- FRAC_CONST(0.93866828489477017),
- FRAC_CONST(0.9391961298195699),
- FRAC_CONST(0.93972176472515334),
- FRAC_CONST(0.94024518837465088),
- FRAC_CONST(0.94076639953639607),
- FRAC_CONST(0.94128539698392866),
- FRAC_CONST(0.94180217949599765),
- FRAC_CONST(0.94231674585656378),
- FRAC_CONST(0.94282909485480271),
- FRAC_CONST(0.94333922528510772),
- FRAC_CONST(0.94384713594709269),
- FRAC_CONST(0.94435282564559475),
- FRAC_CONST(0.94485629319067721),
- FRAC_CONST(0.94535753739763229),
- FRAC_CONST(0.94585655708698391),
- FRAC_CONST(0.94635335108449059),
- FRAC_CONST(0.946847918221148),
- FRAC_CONST(0.94734025733319194),
- FRAC_CONST(0.94783036726210101),
- FRAC_CONST(0.94831824685459909),
- FRAC_CONST(0.94880389496265838),
- FRAC_CONST(0.94928731044350201),
- FRAC_CONST(0.94976849215960668),
- FRAC_CONST(0.95024743897870523),
- FRAC_CONST(0.95072414977378961),
- FRAC_CONST(0.95119862342311323),
- FRAC_CONST(0.95167085881019386),
- FRAC_CONST(0.95214085482381583),
- FRAC_CONST(0.95260861035803324),
- FRAC_CONST(0.9530741243121722),
- FRAC_CONST(0.95353739559083328),
- FRAC_CONST(0.95399842310389449),
- FRAC_CONST(0.95445720576651349),
- FRAC_CONST(0.95491374249913052),
- FRAC_CONST(0.95536803222747024),
- FRAC_CONST(0.95582007388254542),
- FRAC_CONST(0.95626986640065814),
- FRAC_CONST(0.95671740872340305),
- FRAC_CONST(0.9571626997976701),
- FRAC_CONST(0.95760573857564624),
- FRAC_CONST(0.9580465240148186),
- FRAC_CONST(0.9584850550779761),
- FRAC_CONST(0.95892133073321306),
- FRAC_CONST(0.95935534995393079),
- FRAC_CONST(0.9597871117188399),
- FRAC_CONST(0.96021661501196343),
- FRAC_CONST(0.96064385882263847),
- FRAC_CONST(0.96106884214551935),
- FRAC_CONST(0.961491563980579),
- FRAC_CONST(0.9619120233331121),
- FRAC_CONST(0.9623302192137374),
- FRAC_CONST(0.96274615063839941),
- FRAC_CONST(0.96315981662837136),
- FRAC_CONST(0.96357121621025721),
- FRAC_CONST(0.96398034841599411),
- FRAC_CONST(0.96438721228285429),
- FRAC_CONST(0.9647918068534479),
- FRAC_CONST(0.96519413117572472),
- FRAC_CONST(0.96559418430297683),
- FRAC_CONST(0.96599196529384057),
- FRAC_CONST(0.96638747321229879),
- FRAC_CONST(0.96678070712768327),
- FRAC_CONST(0.96717166611467664),
- FRAC_CONST(0.96756034925331436),
- FRAC_CONST(0.9679467556289878),
- FRAC_CONST(0.9683308843324453),
- FRAC_CONST(0.96871273445979478),
- FRAC_CONST(0.9690923051125061),
- FRAC_CONST(0.96946959539741295),
- FRAC_CONST(0.96984460442671483),
- FRAC_CONST(0.97021733131797916),
- FRAC_CONST(0.97058777519414363),
- FRAC_CONST(0.97095593518351797),
- FRAC_CONST(0.97132181041978616),
- FRAC_CONST(0.97168540004200854),
- FRAC_CONST(0.9720467031946235),
- FRAC_CONST(0.97240571902744977),
- FRAC_CONST(0.97276244669568857),
- FRAC_CONST(0.97311688535992513),
- FRAC_CONST(0.97346903418613095),
- FRAC_CONST(0.9738188923456661),
- FRAC_CONST(0.97416645901528032),
- FRAC_CONST(0.97451173337711572),
- FRAC_CONST(0.97485471461870843),
- FRAC_CONST(0.97519540193299037),
- FRAC_CONST(0.97553379451829136),
- FRAC_CONST(0.97586989157834103),
- FRAC_CONST(0.97620369232227056),
- FRAC_CONST(0.97653519596461447),
- FRAC_CONST(0.97686440172531264),
- FRAC_CONST(0.97719130882971228),
- FRAC_CONST(0.97751591650856928),
- FRAC_CONST(0.97783822399805043),
- FRAC_CONST(0.97815823053973505),
- FRAC_CONST(0.97847593538061683),
- FRAC_CONST(0.97879133777310567),
- FRAC_CONST(0.97910443697502925),
- FRAC_CONST(0.97941523224963478),
- FRAC_CONST(0.97972372286559117),
- FRAC_CONST(0.98002990809698998),
- FRAC_CONST(0.98033378722334796),
- FRAC_CONST(0.98063535952960812),
- FRAC_CONST(0.98093462430614164),
- FRAC_CONST(0.98123158084874973),
- FRAC_CONST(0.98152622845866466),
- FRAC_CONST(0.9818185664425525),
- FRAC_CONST(0.98210859411251361),
- FRAC_CONST(0.98239631078608469),
- FRAC_CONST(0.98268171578624086),
- FRAC_CONST(0.98296480844139644),
- FRAC_CONST(0.98324558808540707),
- FRAC_CONST(0.98352405405757126),
- FRAC_CONST(0.98380020570263149),
- FRAC_CONST(0.98407404237077645),
- FRAC_CONST(0.9843455634176419),
- FRAC_CONST(0.9846147682043126),
- FRAC_CONST(0.9848816560973237),
- FRAC_CONST(0.98514622646866223),
- FRAC_CONST(0.98540847869576842),
- FRAC_CONST(0.98566841216153755),
- FRAC_CONST(0.98592602625432113),
- FRAC_CONST(0.98618132036792827),
- FRAC_CONST(0.98643429390162707),
- FRAC_CONST(0.98668494626014669),
- FRAC_CONST(0.98693327685367771),
- FRAC_CONST(0.98717928509787434),
- FRAC_CONST(0.98742297041385541),
- FRAC_CONST(0.98766433222820571),
- FRAC_CONST(0.98790336997297779),
- FRAC_CONST(0.98814008308569257),
- FRAC_CONST(0.98837447100934128),
- FRAC_CONST(0.98860653319238645),
- FRAC_CONST(0.98883626908876354),
- FRAC_CONST(0.98906367815788154),
- FRAC_CONST(0.98928875986462517),
- FRAC_CONST(0.98951151367935519),
- FRAC_CONST(0.98973193907791057),
- FRAC_CONST(0.98995003554160899),
- FRAC_CONST(0.9901658025572484),
- FRAC_CONST(0.99037923961710816),
- FRAC_CONST(0.99059034621895015),
- FRAC_CONST(0.99079912186602037),
- FRAC_CONST(0.99100556606704937),
- FRAC_CONST(0.99120967833625406),
- FRAC_CONST(0.99141145819333854),
- FRAC_CONST(0.99161090516349537),
- FRAC_CONST(0.99180801877740643),
- FRAC_CONST(0.99200279857124452),
- FRAC_CONST(0.99219524408667392),
- FRAC_CONST(0.99238535487085167),
- FRAC_CONST(0.99257313047642881),
- FRAC_CONST(0.99275857046155114),
- FRAC_CONST(0.99294167438986047),
- FRAC_CONST(0.99312244183049558),
- FRAC_CONST(0.99330087235809328),
- FRAC_CONST(0.99347696555278919),
- FRAC_CONST(0.99365072100021912),
- FRAC_CONST(0.99382213829151966),
- FRAC_CONST(0.99399121702332938),
- FRAC_CONST(0.99415795679778973),
- FRAC_CONST(0.99432235722254581),
- FRAC_CONST(0.9944844179107476),
- FRAC_CONST(0.99464413848105071),
- FRAC_CONST(0.99480151855761711),
- FRAC_CONST(0.99495655777011638),
- FRAC_CONST(0.99510925575372611),
- FRAC_CONST(0.99525961214913339),
- FRAC_CONST(0.9954076266025349),
- FRAC_CONST(0.99555329876563847),
- FRAC_CONST(0.99569662829566352),
- FRAC_CONST(0.99583761485534161),
- FRAC_CONST(0.99597625811291779),
- FRAC_CONST(0.99611255774215113),
- FRAC_CONST(0.99624651342231552),
- FRAC_CONST(0.99637812483820021),
- FRAC_CONST(0.99650739168011082),
- FRAC_CONST(0.9966343136438699),
- FRAC_CONST(0.996758890430818),
- FRAC_CONST(0.99688112174781385),
- FRAC_CONST(0.99700100730723529),
- FRAC_CONST(0.99711854682697998),
- FRAC_CONST(0.99723374003046616),
- FRAC_CONST(0.99734658664663323),
- FRAC_CONST(0.99745708640994191),
- FRAC_CONST(0.99756523906037575),
- FRAC_CONST(0.997671044343441),
- FRAC_CONST(0.99777450201016782),
- FRAC_CONST(0.99787561181711015),
- FRAC_CONST(0.99797437352634699),
- FRAC_CONST(0.99807078690548234),
- FRAC_CONST(0.99816485172764624),
- FRAC_CONST(0.99825656777149518),
- FRAC_CONST(0.99834593482121237),
- FRAC_CONST(0.99843295266650844),
- FRAC_CONST(0.99851762110262221),
- FRAC_CONST(0.99859993993032037),
- FRAC_CONST(0.99867990895589909),
- FRAC_CONST(0.99875752799118334),
- FRAC_CONST(0.99883279685352799),
- FRAC_CONST(0.99890571536581829),
- FRAC_CONST(0.99897628335646982),
- FRAC_CONST(0.99904450065942929),
- FRAC_CONST(0.99911036711417489),
- FRAC_CONST(0.99917388256571638),
- FRAC_CONST(0.99923504686459585),
- FRAC_CONST(0.99929385986688779),
- FRAC_CONST(0.99935032143419944),
- FRAC_CONST(0.9994044314336713),
- FRAC_CONST(0.99945618973797734),
- FRAC_CONST(0.99950559622532531),
- FRAC_CONST(0.99955265077945699),
- FRAC_CONST(0.99959735328964838),
- FRAC_CONST(0.9996397036507102),
- FRAC_CONST(0.99967970176298793),
- FRAC_CONST(0.99971734753236219),
- FRAC_CONST(0.99975264087024884),
- FRAC_CONST(0.99978558169359921),
- FRAC_CONST(0.99981616992490041),
- FRAC_CONST(0.99984440549217524),
- FRAC_CONST(0.99987028832898295),
- FRAC_CONST(0.99989381837441849),
- FRAC_CONST(0.99991499557311347),
- FRAC_CONST(0.999933819875236),
- FRAC_CONST(0.99995029123649048),
- FRAC_CONST(0.99996440961811828),
- FRAC_CONST(0.99997617498689761),
- FRAC_CONST(0.9999855873151432),
- FRAC_CONST(0.99999264658070719),
- FRAC_CONST(0.99999735276697821),
- FRAC_CONST(0.99999970586288223)
-};
-
-#ifdef ALLOW_SMALL_FRAMELENGTH
-ALIGN static const real_t sine_long_960[] =
-{
- FRAC_CONST(0.00081812299560725323),
- FRAC_CONST(0.0024543667964602917),
- FRAC_CONST(0.0040906040262347889),
- FRAC_CONST(0.0057268303042312674),
- FRAC_CONST(0.0073630412497795667),
- FRAC_CONST(0.0089992324822505774),
- FRAC_CONST(0.010635399621067975),
- FRAC_CONST(0.012271538285719924),
- FRAC_CONST(0.013907644095770845),
- FRAC_CONST(0.015543712670873098),
- FRAC_CONST(0.017179739630778748),
- FRAC_CONST(0.018815720595351273),
- FRAC_CONST(0.020451651184577292),
- FRAC_CONST(0.022087527018578291),
- FRAC_CONST(0.023723343717622358),
- FRAC_CONST(0.025359096902135895),
- FRAC_CONST(0.02699478219271537),
- FRAC_CONST(0.028630395210139003),
- FRAC_CONST(0.030265931575378519),
- FRAC_CONST(0.031901386909610863),
- FRAC_CONST(0.033536756834229922),
- FRAC_CONST(0.035172036970858266),
- FRAC_CONST(0.036807222941358832),
- FRAC_CONST(0.038442310367846677),
- FRAC_CONST(0.040077294872700696),
- FRAC_CONST(0.041712172078575326),
- FRAC_CONST(0.043346937608412288),
- FRAC_CONST(0.044981587085452281),
- FRAC_CONST(0.046616116133246711),
- FRAC_CONST(0.048250520375669431),
- FRAC_CONST(0.049884795436928406),
- FRAC_CONST(0.051518936941577477),
- FRAC_CONST(0.053152940514528055),
- FRAC_CONST(0.05478680178106083),
- FRAC_CONST(0.056420516366837495),
- FRAC_CONST(0.05805407989791244),
- FRAC_CONST(0.059687488000744485),
- FRAC_CONST(0.061320736302208578),
- FRAC_CONST(0.062953820429607482),
- FRAC_CONST(0.064586736010683557),
- FRAC_CONST(0.066219478673630344),
- FRAC_CONST(0.06785204404710439),
- FRAC_CONST(0.069484427760236861),
- FRAC_CONST(0.071116625442645326),
- FRAC_CONST(0.072748632724445372),
- FRAC_CONST(0.07438044523626236),
- FRAC_CONST(0.076012058609243122),
- FRAC_CONST(0.077643468475067631),
- FRAC_CONST(0.079274670465960706),
- FRAC_CONST(0.080905660214703745),
- FRAC_CONST(0.082536433354646319),
- FRAC_CONST(0.084166985519717977),
- FRAC_CONST(0.085797312344439894),
- FRAC_CONST(0.08742740946393647),
- FRAC_CONST(0.089057272513947183),
- FRAC_CONST(0.090686897130838162),
- FRAC_CONST(0.092316278951613845),
- FRAC_CONST(0.093945413613928788),
- FRAC_CONST(0.095574296756099186),
- FRAC_CONST(0.097202924017114667),
- FRAC_CONST(0.098831291036649963),
- FRAC_CONST(0.10045939345507648),
- FRAC_CONST(0.10208722691347409),
- FRAC_CONST(0.10371478705364276),
- FRAC_CONST(0.10534206951811415),
- FRAC_CONST(0.10696906995016341),
- FRAC_CONST(0.10859578399382072),
- FRAC_CONST(0.11022220729388306),
- FRAC_CONST(0.11184833549592579),
- FRAC_CONST(0.11347416424631435),
- FRAC_CONST(0.11509968919221586),
- FRAC_CONST(0.11672490598161089),
- FRAC_CONST(0.11834981026330495),
- FRAC_CONST(0.11997439768694031),
- FRAC_CONST(0.12159866390300751),
- FRAC_CONST(0.12322260456285709),
- FRAC_CONST(0.12484621531871121),
- FRAC_CONST(0.12646949182367517),
- FRAC_CONST(0.12809242973174936),
- FRAC_CONST(0.12971502469784052),
- FRAC_CONST(0.13133727237777362),
- FRAC_CONST(0.13295916842830346),
- FRAC_CONST(0.13458070850712617),
- FRAC_CONST(0.13620188827289101),
- FRAC_CONST(0.1378227033852118),
- FRAC_CONST(0.13944314950467873),
- FRAC_CONST(0.14106322229286994),
- FRAC_CONST(0.14268291741236291),
- FRAC_CONST(0.14430223052674654),
- FRAC_CONST(0.1459211573006321),
- FRAC_CONST(0.14753969339966552),
- FRAC_CONST(0.14915783449053857),
- FRAC_CONST(0.15077557624100058),
- FRAC_CONST(0.15239291431987001),
- FRAC_CONST(0.1540098443970461),
- FRAC_CONST(0.15562636214352044),
- FRAC_CONST(0.15724246323138855),
- FRAC_CONST(0.15885814333386142),
- FRAC_CONST(0.16047339812527725),
- FRAC_CONST(0.16208822328111283),
- FRAC_CONST(0.16370261447799525),
- FRAC_CONST(0.16531656739371339),
- FRAC_CONST(0.16693007770722967),
- FRAC_CONST(0.16854314109869134),
- FRAC_CONST(0.17015575324944232),
- FRAC_CONST(0.17176790984203447),
- FRAC_CONST(0.17337960656023954),
- FRAC_CONST(0.1749908390890603),
- FRAC_CONST(0.17660160311474243),
- FRAC_CONST(0.17821189432478593),
- FRAC_CONST(0.17982170840795647),
- FRAC_CONST(0.18143104105429744),
- FRAC_CONST(0.18303988795514095),
- FRAC_CONST(0.1846482448031197),
- FRAC_CONST(0.18625610729217834),
- FRAC_CONST(0.1878634711175852),
- FRAC_CONST(0.18947033197594348),
- FRAC_CONST(0.19107668556520319),
- FRAC_CONST(0.19268252758467228),
- FRAC_CONST(0.19428785373502844),
- FRAC_CONST(0.19589265971833042),
- FRAC_CONST(0.19749694123802966),
- FRAC_CONST(0.19910069399898173),
- FRAC_CONST(0.20070391370745785),
- FRAC_CONST(0.20230659607115639),
- FRAC_CONST(0.20390873679921437),
- FRAC_CONST(0.20551033160221882),
- FRAC_CONST(0.20711137619221856),
- FRAC_CONST(0.2087118662827353),
- FRAC_CONST(0.21031179758877552),
- FRAC_CONST(0.21191116582684155),
- FRAC_CONST(0.21350996671494335),
- FRAC_CONST(0.21510819597260972),
- FRAC_CONST(0.21670584932089998),
- FRAC_CONST(0.2183029224824154),
- FRAC_CONST(0.21989941118131037),
- FRAC_CONST(0.22149531114330431),
- FRAC_CONST(0.22309061809569264),
- FRAC_CONST(0.22468532776735861),
- FRAC_CONST(0.22627943588878449),
- FRAC_CONST(0.22787293819206314),
- FRAC_CONST(0.22946583041090929),
- FRAC_CONST(0.23105810828067114),
- FRAC_CONST(0.23264976753834157),
- FRAC_CONST(0.23424080392256985),
- FRAC_CONST(0.2358312131736727),
- FRAC_CONST(0.23742099103364595),
- FRAC_CONST(0.23901013324617584),
- FRAC_CONST(0.24059863555665045),
- FRAC_CONST(0.24218649371217096),
- FRAC_CONST(0.24377370346156332),
- FRAC_CONST(0.24536026055538934),
- FRAC_CONST(0.24694616074595824),
- FRAC_CONST(0.24853139978733788),
- FRAC_CONST(0.25011597343536629),
- FRAC_CONST(0.25169987744766298),
- FRAC_CONST(0.25328310758364025),
- FRAC_CONST(0.25486565960451457),
- FRAC_CONST(0.25644752927331788),
- FRAC_CONST(0.25802871235490898),
- FRAC_CONST(0.25960920461598508),
- FRAC_CONST(0.26118900182509258),
- FRAC_CONST(0.26276809975263904),
- FRAC_CONST(0.264346494170904),
- FRAC_CONST(0.26592418085405067),
- FRAC_CONST(0.26750115557813692),
- FRAC_CONST(0.2690774141211269),
- FRAC_CONST(0.27065295226290209),
- FRAC_CONST(0.2722277657852728),
- FRAC_CONST(0.27380185047198918),
- FRAC_CONST(0.27537520210875299),
- FRAC_CONST(0.2769478164832283),
- FRAC_CONST(0.27851968938505312),
- FRAC_CONST(0.28009081660585067),
- FRAC_CONST(0.28166119393924061),
- FRAC_CONST(0.28323081718085019),
- FRAC_CONST(0.28479968212832563),
- FRAC_CONST(0.28636778458134327),
- FRAC_CONST(0.28793512034162105),
- FRAC_CONST(0.2895016852129294),
- FRAC_CONST(0.29106747500110264),
- FRAC_CONST(0.29263248551405047),
- FRAC_CONST(0.2941967125617686),
- FRAC_CONST(0.29576015195635058),
- FRAC_CONST(0.29732279951199847),
- FRAC_CONST(0.29888465104503475),
- FRAC_CONST(0.30044570237391266),
- FRAC_CONST(0.30200594931922808),
- FRAC_CONST(0.30356538770373032),
- FRAC_CONST(0.30512401335233358),
- FRAC_CONST(0.30668182209212791),
- FRAC_CONST(0.3082388097523906),
- FRAC_CONST(0.30979497216459695),
- FRAC_CONST(0.31135030516243201),
- FRAC_CONST(0.3129048045818012),
- FRAC_CONST(0.31445846626084178),
- FRAC_CONST(0.31601128603993378),
- FRAC_CONST(0.31756325976171151),
- FRAC_CONST(0.31911438327107416),
- FRAC_CONST(0.32066465241519732),
- FRAC_CONST(0.32221406304354389),
- FRAC_CONST(0.3237626110078754),
- FRAC_CONST(0.32531029216226293),
- FRAC_CONST(0.32685710236309828),
- FRAC_CONST(0.32840303746910487),
- FRAC_CONST(0.32994809334134939),
- FRAC_CONST(0.3314922658432522),
- FRAC_CONST(0.33303555084059877),
- FRAC_CONST(0.33457794420155085),
- FRAC_CONST(0.33611944179665709),
- FRAC_CONST(0.33766003949886464),
- FRAC_CONST(0.33919973318352969),
- FRAC_CONST(0.34073851872842903),
- FRAC_CONST(0.34227639201377064),
- FRAC_CONST(0.34381334892220483),
- FRAC_CONST(0.34534938533883547),
- FRAC_CONST(0.34688449715123082),
- FRAC_CONST(0.34841868024943456),
- FRAC_CONST(0.34995193052597684),
- FRAC_CONST(0.35148424387588523),
- FRAC_CONST(0.3530156161966958),
- FRAC_CONST(0.35454604338846402),
- FRAC_CONST(0.35607552135377557),
- FRAC_CONST(0.35760404599775775),
- FRAC_CONST(0.35913161322809023),
- FRAC_CONST(0.36065821895501554),
- FRAC_CONST(0.36218385909135092),
- FRAC_CONST(0.36370852955249849),
- FRAC_CONST(0.36523222625645668),
- FRAC_CONST(0.36675494512383078),
- FRAC_CONST(0.36827668207784414),
- FRAC_CONST(0.36979743304434909),
- FRAC_CONST(0.37131719395183754),
- FRAC_CONST(0.37283596073145214),
- FRAC_CONST(0.37435372931699717),
- FRAC_CONST(0.37587049564494951),
- FRAC_CONST(0.37738625565446909),
- FRAC_CONST(0.37890100528741022),
- FRAC_CONST(0.38041474048833229),
- FRAC_CONST(0.38192745720451066),
- FRAC_CONST(0.38343915138594736),
- FRAC_CONST(0.38494981898538222),
- FRAC_CONST(0.38645945595830333),
- FRAC_CONST(0.38796805826295838),
- FRAC_CONST(0.38947562186036483),
- FRAC_CONST(0.39098214271432141),
- FRAC_CONST(0.39248761679141814),
- FRAC_CONST(0.3939920400610481),
- FRAC_CONST(0.39549540849541737),
- FRAC_CONST(0.39699771806955625),
- FRAC_CONST(0.39849896476132979),
- FRAC_CONST(0.39999914455144892),
- FRAC_CONST(0.40149825342348083),
- FRAC_CONST(0.4029962873638599),
- FRAC_CONST(0.40449324236189854),
- FRAC_CONST(0.40598911440979762),
- FRAC_CONST(0.40748389950265762),
- FRAC_CONST(0.40897759363848879),
- FRAC_CONST(0.41047019281822261),
- FRAC_CONST(0.41196169304572178),
- FRAC_CONST(0.4134520903277914),
- FRAC_CONST(0.41494138067418929),
- FRAC_CONST(0.41642956009763715),
- FRAC_CONST(0.41791662461383078),
- FRAC_CONST(0.41940257024145089),
- FRAC_CONST(0.42088739300217382),
- FRAC_CONST(0.42237108892068231),
- FRAC_CONST(0.42385365402467584),
- FRAC_CONST(0.42533508434488143),
- FRAC_CONST(0.42681537591506419),
- FRAC_CONST(0.42829452477203828),
- FRAC_CONST(0.42977252695567697),
- FRAC_CONST(0.43124937850892364),
- FRAC_CONST(0.4327250754778022),
- FRAC_CONST(0.43419961391142781),
- FRAC_CONST(0.43567298986201736),
- FRAC_CONST(0.43714519938489987),
- FRAC_CONST(0.43861623853852766),
- FRAC_CONST(0.44008610338448595),
- FRAC_CONST(0.44155478998750436),
- FRAC_CONST(0.44302229441546676),
- FRAC_CONST(0.4444886127394222),
- FRAC_CONST(0.44595374103359531),
- FRAC_CONST(0.44741767537539667),
- FRAC_CONST(0.44888041184543348),
- FRAC_CONST(0.45034194652752002),
- FRAC_CONST(0.45180227550868812),
- FRAC_CONST(0.45326139487919759),
- FRAC_CONST(0.45471930073254679),
- FRAC_CONST(0.45617598916548296),
- FRAC_CONST(0.45763145627801283),
- FRAC_CONST(0.45908569817341294),
- FRAC_CONST(0.46053871095824001),
- FRAC_CONST(0.46199049074234161),
- FRAC_CONST(0.46344103363886635),
- FRAC_CONST(0.46489033576427435),
- FRAC_CONST(0.46633839323834758),
- FRAC_CONST(0.46778520218420055),
- FRAC_CONST(0.46923075872829029),
- FRAC_CONST(0.47067505900042683),
- FRAC_CONST(0.47211809913378361),
- FRAC_CONST(0.47355987526490806),
- FRAC_CONST(0.47500038353373153),
- FRAC_CONST(0.47643962008357982),
- FRAC_CONST(0.47787758106118372),
- FRAC_CONST(0.47931426261668875),
- FRAC_CONST(0.48074966090366611),
- FRAC_CONST(0.48218377207912272),
- FRAC_CONST(0.48361659230351117),
- FRAC_CONST(0.48504811774074069),
- FRAC_CONST(0.48647834455818684),
- FRAC_CONST(0.48790726892670194),
- FRAC_CONST(0.48933488702062544),
- FRAC_CONST(0.49076119501779414),
- FRAC_CONST(0.49218618909955225),
- FRAC_CONST(0.4936098654507618),
- FRAC_CONST(0.49503222025981269),
- FRAC_CONST(0.49645324971863303),
- FRAC_CONST(0.49787295002269943),
- FRAC_CONST(0.49929131737104687),
- FRAC_CONST(0.50070834796627917),
- FRAC_CONST(0.50212403801457872),
- FRAC_CONST(0.50353838372571758),
- FRAC_CONST(0.50495138131306638),
- FRAC_CONST(0.50636302699360547),
- FRAC_CONST(0.50777331698793449),
- FRAC_CONST(0.50918224752028263),
- FRAC_CONST(0.51058981481851906),
- FRAC_CONST(0.51199601511416237),
- FRAC_CONST(0.51340084464239111),
- FRAC_CONST(0.51480429964205421),
- FRAC_CONST(0.51620637635567967),
- FRAC_CONST(0.51760707102948678),
- FRAC_CONST(0.51900637991339404),
- FRAC_CONST(0.5204042992610306),
- FRAC_CONST(0.52180082532974559),
- FRAC_CONST(0.5231959543806185),
- FRAC_CONST(0.52458968267846895),
- FRAC_CONST(0.52598200649186677),
- FRAC_CONST(0.52737292209314235),
- FRAC_CONST(0.52876242575839572),
- FRAC_CONST(0.53015051376750777),
- FRAC_CONST(0.53153718240414882),
- FRAC_CONST(0.53292242795578992),
- FRAC_CONST(0.53430624671371152),
- FRAC_CONST(0.53568863497301467),
- FRAC_CONST(0.5370695890326298),
- FRAC_CONST(0.5384491051953274),
- FRAC_CONST(0.53982717976772743),
- FRAC_CONST(0.54120380906030963),
- FRAC_CONST(0.54257898938742311),
- FRAC_CONST(0.54395271706729609),
- FRAC_CONST(0.54532498842204646),
- FRAC_CONST(0.54669579977769045),
- FRAC_CONST(0.54806514746415402),
- FRAC_CONST(0.54943302781528081),
- FRAC_CONST(0.55079943716884383),
- FRAC_CONST(0.55216437186655387),
- FRAC_CONST(0.55352782825406999),
- FRAC_CONST(0.55488980268100907),
- FRAC_CONST(0.55625029150095584),
- FRAC_CONST(0.55760929107147217),
- FRAC_CONST(0.55896679775410718),
- FRAC_CONST(0.56032280791440714),
- FRAC_CONST(0.56167731792192455),
- FRAC_CONST(0.56303032415022869),
- FRAC_CONST(0.56438182297691453),
- FRAC_CONST(0.56573181078361312),
- FRAC_CONST(0.56708028395600085),
- FRAC_CONST(0.56842723888380908),
- FRAC_CONST(0.56977267196083425),
- FRAC_CONST(0.57111657958494688),
- FRAC_CONST(0.5724589581581021),
- FRAC_CONST(0.57379980408634845),
- FRAC_CONST(0.57513911377983773),
- FRAC_CONST(0.57647688365283478),
- FRAC_CONST(0.57781311012372738),
- FRAC_CONST(0.57914778961503466),
- FRAC_CONST(0.58048091855341843),
- FRAC_CONST(0.5818124933696911),
- FRAC_CONST(0.58314251049882604),
- FRAC_CONST(0.58447096637996743),
- FRAC_CONST(0.58579785745643886),
- FRAC_CONST(0.5871231801757536),
- FRAC_CONST(0.58844693098962408),
- FRAC_CONST(0.58976910635397084),
- FRAC_CONST(0.59108970272893235),
- FRAC_CONST(0.59240871657887517),
- FRAC_CONST(0.59372614437240179),
- FRAC_CONST(0.59504198258236196),
- FRAC_CONST(0.5963562276858605),
- FRAC_CONST(0.59766887616426767),
- FRAC_CONST(0.5989799245032289),
- FRAC_CONST(0.60028936919267273),
- FRAC_CONST(0.60159720672682204),
- FRAC_CONST(0.60290343360420195),
- FRAC_CONST(0.60420804632765002),
- FRAC_CONST(0.60551104140432543),
- FRAC_CONST(0.60681241534571839),
- FRAC_CONST(0.60811216466765883),
- FRAC_CONST(0.60941028589032709),
- FRAC_CONST(0.61070677553826169),
- FRAC_CONST(0.61200163014036979),
- FRAC_CONST(0.61329484622993602),
- FRAC_CONST(0.6145864203446314),
- FRAC_CONST(0.61587634902652377),
- FRAC_CONST(0.61716462882208556),
- FRAC_CONST(0.61845125628220421),
- FRAC_CONST(0.61973622796219074),
- FRAC_CONST(0.6210195404217892),
- FRAC_CONST(0.62230119022518593),
- FRAC_CONST(0.62358117394101897),
- FRAC_CONST(0.62485948814238634),
- FRAC_CONST(0.62613612940685637),
- FRAC_CONST(0.62741109431647646),
- FRAC_CONST(0.62868437945778133),
- FRAC_CONST(0.62995598142180387),
- FRAC_CONST(0.6312258968040827),
- FRAC_CONST(0.63249412220467238),
- FRAC_CONST(0.63376065422815175),
- FRAC_CONST(0.63502548948363347),
- FRAC_CONST(0.63628862458477287),
- FRAC_CONST(0.63755005614977711),
- FRAC_CONST(0.63880978080141437),
- FRAC_CONST(0.6400677951670225),
- FRAC_CONST(0.6413240958785188),
- FRAC_CONST(0.64257867957240766),
- FRAC_CONST(0.6438315428897915),
- FRAC_CONST(0.64508268247637779),
- FRAC_CONST(0.64633209498248945),
- FRAC_CONST(0.64757977706307335),
- FRAC_CONST(0.64882572537770888),
- FRAC_CONST(0.65006993659061751),
- FRAC_CONST(0.65131240737067142),
- FRAC_CONST(0.65255313439140239),
- FRAC_CONST(0.65379211433101081),
- FRAC_CONST(0.65502934387237444),
- FRAC_CONST(0.6562648197030575),
- FRAC_CONST(0.65749853851531959),
- FRAC_CONST(0.65873049700612374),
- FRAC_CONST(0.65996069187714679),
- FRAC_CONST(0.66118911983478657),
- FRAC_CONST(0.66241577759017178),
- FRAC_CONST(0.66364066185917048),
- FRAC_CONST(0.66486376936239888),
- FRAC_CONST(0.66608509682523009),
- FRAC_CONST(0.66730464097780284),
- FRAC_CONST(0.66852239855503071),
- FRAC_CONST(0.66973836629660977),
- FRAC_CONST(0.67095254094702894),
- FRAC_CONST(0.67216491925557675),
- FRAC_CONST(0.67337549797635199),
- FRAC_CONST(0.67458427386827102),
- FRAC_CONST(0.67579124369507693),
- FRAC_CONST(0.67699640422534846),
- FRAC_CONST(0.67819975223250772),
- FRAC_CONST(0.6794012844948305),
- FRAC_CONST(0.68060099779545302),
- FRAC_CONST(0.68179888892238183),
- FRAC_CONST(0.6829949546685018),
- FRAC_CONST(0.68418919183158522),
- FRAC_CONST(0.68538159721429948),
- FRAC_CONST(0.6865721676242168),
- FRAC_CONST(0.68776089987382172),
- FRAC_CONST(0.68894779078052026),
- FRAC_CONST(0.69013283716664853),
- FRAC_CONST(0.69131603585948032),
- FRAC_CONST(0.69249738369123692),
- FRAC_CONST(0.69367687749909468),
- FRAC_CONST(0.69485451412519361),
- FRAC_CONST(0.69603029041664599),
- FRAC_CONST(0.6972042032255451),
- FRAC_CONST(0.6983762494089728),
- FRAC_CONST(0.69954642582900894),
- FRAC_CONST(0.70071472935273893),
- FRAC_CONST(0.70188115685226271),
- FRAC_CONST(0.703045705204703),
- FRAC_CONST(0.70420837129221303),
- FRAC_CONST(0.70536915200198613),
- FRAC_CONST(0.70652804422626281),
- FRAC_CONST(0.70768504486233985),
- FRAC_CONST(0.70884015081257845),
- FRAC_CONST(0.70999335898441229),
- FRAC_CONST(0.711144666290356),
- FRAC_CONST(0.71229406964801356),
- FRAC_CONST(0.71344156598008623),
- FRAC_CONST(0.71458715221438096),
- FRAC_CONST(0.71573082528381871),
- FRAC_CONST(0.71687258212644234),
- FRAC_CONST(0.7180124196854254),
- FRAC_CONST(0.71915033490907943),
- FRAC_CONST(0.72028632475086318),
- FRAC_CONST(0.72142038616938997),
- FRAC_CONST(0.72255251612843596),
- FRAC_CONST(0.72368271159694852),
- FRAC_CONST(0.72481096954905444),
- FRAC_CONST(0.72593728696406756),
- FRAC_CONST(0.72706166082649704),
- FRAC_CONST(0.72818408812605595),
- FRAC_CONST(0.72930456585766834),
- FRAC_CONST(0.73042309102147851),
- FRAC_CONST(0.73153966062285747),
- FRAC_CONST(0.73265427167241282),
- FRAC_CONST(0.73376692118599507),
- FRAC_CONST(0.73487760618470677),
- FRAC_CONST(0.73598632369490979),
- FRAC_CONST(0.73709307074823405),
- FRAC_CONST(0.73819784438158409),
- FRAC_CONST(0.73930064163714881),
- FRAC_CONST(0.74040145956240788),
- FRAC_CONST(0.74150029521014049),
- FRAC_CONST(0.74259714563843304),
- FRAC_CONST(0.74369200791068657),
- FRAC_CONST(0.74478487909562552),
- FRAC_CONST(0.74587575626730485),
- FRAC_CONST(0.74696463650511791),
- FRAC_CONST(0.74805151689380456),
- FRAC_CONST(0.74913639452345926),
- FRAC_CONST(0.75021926648953785),
- FRAC_CONST(0.75130012989286621),
- FRAC_CONST(0.7523789818396478),
- FRAC_CONST(0.75345581944147111),
- FRAC_CONST(0.75453063981531809),
- FRAC_CONST(0.75560344008357094),
- FRAC_CONST(0.75667421737402052),
- FRAC_CONST(0.7577429688198738),
- FRAC_CONST(0.75880969155976163),
- FRAC_CONST(0.75987438273774599),
- FRAC_CONST(0.76093703950332836),
- FRAC_CONST(0.76199765901145666),
- FRAC_CONST(0.76305623842253345),
- FRAC_CONST(0.76411277490242291),
- FRAC_CONST(0.76516726562245885),
- FRAC_CONST(0.76621970775945258),
- FRAC_CONST(0.76727009849569949),
- FRAC_CONST(0.76831843501898767),
- FRAC_CONST(0.76936471452260458),
- FRAC_CONST(0.77040893420534517),
- FRAC_CONST(0.77145109127151923),
- FRAC_CONST(0.77249118293095853),
- FRAC_CONST(0.77352920639902467),
- FRAC_CONST(0.77456515889661659),
- FRAC_CONST(0.77559903765017746),
- FRAC_CONST(0.7766308398917029),
- FRAC_CONST(0.77766056285874774),
- FRAC_CONST(0.77868820379443371),
- FRAC_CONST(0.77971375994745684),
- FRAC_CONST(0.78073722857209438),
- FRAC_CONST(0.7817586069282132),
- FRAC_CONST(0.78277789228127592),
- FRAC_CONST(0.78379508190234881),
- FRAC_CONST(0.78481017306810918),
- FRAC_CONST(0.78582316306085265),
- FRAC_CONST(0.78683404916849986),
- FRAC_CONST(0.78784282868460476),
- FRAC_CONST(0.78884949890836087),
- FRAC_CONST(0.78985405714460888),
- FRAC_CONST(0.7908565007038445),
- FRAC_CONST(0.79185682690222425),
- FRAC_CONST(0.79285503306157412),
- FRAC_CONST(0.79385111650939566),
- FRAC_CONST(0.79484507457887377),
- FRAC_CONST(0.79583690460888357),
- FRAC_CONST(0.79682660394399751),
- FRAC_CONST(0.79781416993449272),
- FRAC_CONST(0.79879959993635785),
- FRAC_CONST(0.7997828913113002),
- FRAC_CONST(0.80076404142675273),
- FRAC_CONST(0.80174304765588156),
- FRAC_CONST(0.80271990737759213),
- FRAC_CONST(0.80369461797653707),
- FRAC_CONST(0.80466717684312306),
- FRAC_CONST(0.80563758137351682),
- FRAC_CONST(0.80660582896965372),
- FRAC_CONST(0.80757191703924336),
- FRAC_CONST(0.80853584299577752),
- FRAC_CONST(0.80949760425853612),
- FRAC_CONST(0.81045719825259477),
- FRAC_CONST(0.81141462240883167),
- FRAC_CONST(0.81236987416393436),
- FRAC_CONST(0.81332295096040608),
- FRAC_CONST(0.81427385024657373),
- FRAC_CONST(0.81522256947659355),
- FRAC_CONST(0.81616910611045879),
- FRAC_CONST(0.817113457614006),
- FRAC_CONST(0.81805562145892186),
- FRAC_CONST(0.81899559512275044),
- FRAC_CONST(0.81993337608889916),
- FRAC_CONST(0.82086896184664637),
- FRAC_CONST(0.8218023498911472),
- FRAC_CONST(0.82273353772344116),
- FRAC_CONST(0.82366252285045805),
- FRAC_CONST(0.82458930278502529),
- FRAC_CONST(0.82551387504587381),
- FRAC_CONST(0.82643623715764558),
- FRAC_CONST(0.82735638665089983),
- FRAC_CONST(0.82827432106211907),
- FRAC_CONST(0.82919003793371693),
- FRAC_CONST(0.83010353481404364),
- FRAC_CONST(0.83101480925739324),
- FRAC_CONST(0.83192385882400965),
- FRAC_CONST(0.83283068108009373),
- FRAC_CONST(0.8337352735978093),
- FRAC_CONST(0.83463763395529011),
- FRAC_CONST(0.83553775973664579),
- FRAC_CONST(0.83643564853196872),
- FRAC_CONST(0.83733129793734051),
- FRAC_CONST(0.83822470555483797),
- FRAC_CONST(0.83911586899254031),
- FRAC_CONST(0.84000478586453453),
- FRAC_CONST(0.84089145379092289),
- FRAC_CONST(0.84177587039782842),
- FRAC_CONST(0.84265803331740163),
- FRAC_CONST(0.84353794018782702),
- FRAC_CONST(0.844415588653329),
- FRAC_CONST(0.8452909763641786),
- FRAC_CONST(0.84616410097669936),
- FRAC_CONST(0.84703496015327406),
- FRAC_CONST(0.84790355156235053),
- FRAC_CONST(0.84876987287844818),
- FRAC_CONST(0.8496339217821639),
- FRAC_CONST(0.85049569596017938),
- FRAC_CONST(0.85135519310526508),
- FRAC_CONST(0.85221241091628896),
- FRAC_CONST(0.85306734709822085),
- FRAC_CONST(0.85391999936213903),
- FRAC_CONST(0.85477036542523732),
- FRAC_CONST(0.85561844301082923),
- FRAC_CONST(0.85646422984835635),
- FRAC_CONST(0.85730772367339259),
- FRAC_CONST(0.85814892222765116),
- FRAC_CONST(0.85898782325899026),
- FRAC_CONST(0.85982442452141961),
- FRAC_CONST(0.86065872377510555),
- FRAC_CONST(0.86149071878637817),
- FRAC_CONST(0.8623204073277364),
- FRAC_CONST(0.86314778717785412),
- FRAC_CONST(0.8639728561215867),
- FRAC_CONST(0.86479561194997623),
- FRAC_CONST(0.86561605246025763),
- FRAC_CONST(0.86643417545586487),
- FRAC_CONST(0.8672499787464365),
- FRAC_CONST(0.86806346014782154),
- FRAC_CONST(0.8688746174820855),
- FRAC_CONST(0.86968344857751589),
- FRAC_CONST(0.87048995126862883),
- FRAC_CONST(0.87129412339617363),
- FRAC_CONST(0.87209596280713941),
- FRAC_CONST(0.8728954673547612),
- FRAC_CONST(0.87369263489852422),
- FRAC_CONST(0.87448746330417149),
- FRAC_CONST(0.87527995044370765),
- FRAC_CONST(0.8760700941954066),
- FRAC_CONST(0.87685789244381551),
- FRAC_CONST(0.87764334307976144),
- FRAC_CONST(0.87842644400035663),
- FRAC_CONST(0.8792071931090043),
- FRAC_CONST(0.87998558831540408),
- FRAC_CONST(0.88076162753555787),
- FRAC_CONST(0.88153530869177488),
- FRAC_CONST(0.88230662971267804),
- FRAC_CONST(0.88307558853320878),
- FRAC_CONST(0.88384218309463292),
- FRAC_CONST(0.8846064113445461),
- FRAC_CONST(0.88536827123687933),
- FRAC_CONST(0.88612776073190425),
- FRAC_CONST(0.88688487779623937),
- FRAC_CONST(0.88763962040285393),
- FRAC_CONST(0.8883919865310751),
- FRAC_CONST(0.88914197416659235),
- FRAC_CONST(0.88988958130146301),
- FRAC_CONST(0.8906348059341177),
- FRAC_CONST(0.89137764606936609),
- FRAC_CONST(0.89211809971840139),
- FRAC_CONST(0.89285616489880615),
- FRAC_CONST(0.89359183963455813),
- FRAC_CONST(0.89432512195603453),
- FRAC_CONST(0.89505600990001799),
- FRAC_CONST(0.89578450150970124),
- FRAC_CONST(0.8965105948346932),
- FRAC_CONST(0.89723428793102367),
- FRAC_CONST(0.89795557886114807),
- FRAC_CONST(0.89867446569395382),
- FRAC_CONST(0.89939094650476448),
- FRAC_CONST(0.90010501937534515),
- FRAC_CONST(0.900816682393908),
- FRAC_CONST(0.90152593365511691),
- FRAC_CONST(0.90223277126009283),
- FRAC_CONST(0.90293719331641886),
- FRAC_CONST(0.90363919793814496),
- FRAC_CONST(0.90433878324579353),
- FRAC_CONST(0.90503594736636439),
- FRAC_CONST(0.90573068843333915),
- FRAC_CONST(0.90642300458668679),
- FRAC_CONST(0.90711289397286898),
- FRAC_CONST(0.90780035474484411),
- FRAC_CONST(0.90848538506207266),
- FRAC_CONST(0.90916798309052227),
- FRAC_CONST(0.90984814700267291),
- FRAC_CONST(0.9105258749775208),
- FRAC_CONST(0.91120116520058425),
- FRAC_CONST(0.91187401586390815),
- FRAC_CONST(0.91254442516606893),
- FRAC_CONST(0.9132123913121788),
- FRAC_CONST(0.91387791251389161),
- FRAC_CONST(0.91454098698940678),
- FRAC_CONST(0.91520161296347435),
- FRAC_CONST(0.91585978866739981),
- FRAC_CONST(0.91651551233904871),
- FRAC_CONST(0.91716878222285148),
- FRAC_CONST(0.91781959656980805),
- FRAC_CONST(0.91846795363749245),
- FRAC_CONST(0.91911385169005766),
- FRAC_CONST(0.9197572889982405),
- FRAC_CONST(0.9203982638393654),
- FRAC_CONST(0.92103677449734989),
- FRAC_CONST(0.92167281926270861),
- FRAC_CONST(0.92230639643255874),
- FRAC_CONST(0.92293750431062316),
- FRAC_CONST(0.92356614120723612),
- FRAC_CONST(0.92419230543934783),
- FRAC_CONST(0.92481599533052783),
- FRAC_CONST(0.92543720921097061),
- FRAC_CONST(0.92605594541749991),
- FRAC_CONST(0.92667220229357261),
- FRAC_CONST(0.92728597818928349),
- FRAC_CONST(0.9278972714613698),
- FRAC_CONST(0.92850608047321548),
- FRAC_CONST(0.9291124035948557),
- FRAC_CONST(0.92971623920298097),
- FRAC_CONST(0.93031758568094147),
- FRAC_CONST(0.93091644141875196),
- FRAC_CONST(0.93151280481309506),
- FRAC_CONST(0.93210667426732674),
- FRAC_CONST(0.93269804819147983),
- FRAC_CONST(0.93328692500226818),
- FRAC_CONST(0.93387330312309147),
- FRAC_CONST(0.93445718098403896),
- FRAC_CONST(0.93503855702189376),
- FRAC_CONST(0.9356174296801375),
- FRAC_CONST(0.93619379740895381),
- FRAC_CONST(0.93676765866523259),
- FRAC_CONST(0.93733901191257496),
- FRAC_CONST(0.93790785562129597),
- FRAC_CONST(0.93847418826842988),
- FRAC_CONST(0.93903800833773399),
- FRAC_CONST(0.93959931431969212),
- FRAC_CONST(0.94015810471151917),
- FRAC_CONST(0.94071437801716529),
- FRAC_CONST(0.94126813274731924),
- FRAC_CONST(0.94181936741941319),
- FRAC_CONST(0.94236808055762578),
- FRAC_CONST(0.94291427069288691),
- FRAC_CONST(0.94345793636288133),
- FRAC_CONST(0.94399907611205225),
- FRAC_CONST(0.9445376884916058),
- FRAC_CONST(0.94507377205951448),
- FRAC_CONST(0.94560732538052128),
- FRAC_CONST(0.94613834702614352),
- FRAC_CONST(0.94666683557467624),
- FRAC_CONST(0.94719278961119657),
- FRAC_CONST(0.94771620772756759),
- FRAC_CONST(0.94823708852244104),
- FRAC_CONST(0.94875543060126255),
- FRAC_CONST(0.94927123257627433),
- FRAC_CONST(0.94978449306651924),
- FRAC_CONST(0.95029521069784428),
- FRAC_CONST(0.9508033841029051),
- FRAC_CONST(0.95130901192116835),
- FRAC_CONST(0.9518120927989161),
- FRAC_CONST(0.95231262538924943),
- FRAC_CONST(0.95281060835209208),
- FRAC_CONST(0.95330604035419386),
- FRAC_CONST(0.95379892006913403),
- FRAC_CONST(0.95428924617732525),
- FRAC_CONST(0.95477701736601728),
- FRAC_CONST(0.95526223232929941),
- FRAC_CONST(0.95574488976810545),
- FRAC_CONST(0.95622498839021619),
- FRAC_CONST(0.95670252691026292),
- FRAC_CONST(0.95717750404973156),
- FRAC_CONST(0.95764991853696524),
- FRAC_CONST(0.95811976910716812),
- FRAC_CONST(0.95858705450240911),
- FRAC_CONST(0.95905177347162429),
- FRAC_CONST(0.95951392477062125),
- FRAC_CONST(0.95997350716208196),
- FRAC_CONST(0.96043051941556579),
- FRAC_CONST(0.96088496030751369),
- FRAC_CONST(0.96133682862125036),
- FRAC_CONST(0.96178612314698864),
- FRAC_CONST(0.96223284268183173),
- FRAC_CONST(0.9626769860297768),
- FRAC_CONST(0.96311855200171881),
- FRAC_CONST(0.96355753941545252),
- FRAC_CONST(0.96399394709567654),
- FRAC_CONST(0.96442777387399625),
- FRAC_CONST(0.96485901858892686),
- FRAC_CONST(0.96528768008589627),
- FRAC_CONST(0.96571375721724895),
- FRAC_CONST(0.96613724884224783),
- FRAC_CONST(0.96655815382707866),
- FRAC_CONST(0.96697647104485207),
- FRAC_CONST(0.96739219937560694),
- FRAC_CONST(0.96780533770631338),
- FRAC_CONST(0.96821588493087585),
- FRAC_CONST(0.9686238399501359),
- FRAC_CONST(0.96902920167187501),
- FRAC_CONST(0.96943196901081796),
- FRAC_CONST(0.96983214088863534),
- FRAC_CONST(0.9702297162339466),
- FRAC_CONST(0.97062469398232287),
- FRAC_CONST(0.97101707307629004),
- FRAC_CONST(0.97140685246533098),
- FRAC_CONST(0.97179403110588902),
- FRAC_CONST(0.97217860796137046),
- FRAC_CONST(0.97256058200214734),
- FRAC_CONST(0.97293995220556007),
- FRAC_CONST(0.97331671755592064),
- FRAC_CONST(0.97369087704451474),
- FRAC_CONST(0.97406242966960455),
- FRAC_CONST(0.97443137443643235),
- FRAC_CONST(0.97479771035722163),
- FRAC_CONST(0.97516143645118103),
- FRAC_CONST(0.97552255174450631),
- FRAC_CONST(0.97588105527038305),
- FRAC_CONST(0.97623694606898959),
- FRAC_CONST(0.97659022318749911),
- FRAC_CONST(0.97694088568008242),
- FRAC_CONST(0.97728893260791039),
- FRAC_CONST(0.97763436303915685),
- FRAC_CONST(0.97797717604900047),
- FRAC_CONST(0.97831737071962765),
- FRAC_CONST(0.97865494614023485),
- FRAC_CONST(0.97898990140703124),
- FRAC_CONST(0.97932223562324061),
- FRAC_CONST(0.97965194789910426),
- FRAC_CONST(0.9799790373518833),
- FRAC_CONST(0.98030350310586067),
- FRAC_CONST(0.98062534429234405),
- FRAC_CONST(0.98094456004966768),
- FRAC_CONST(0.98126114952319499),
- FRAC_CONST(0.98157511186532054),
- FRAC_CONST(0.98188644623547261),
- FRAC_CONST(0.98219515180011563),
- FRAC_CONST(0.98250122773275184),
- FRAC_CONST(0.98280467321392362),
- FRAC_CONST(0.98310548743121629),
- FRAC_CONST(0.98340366957925973),
- FRAC_CONST(0.98369921885973044),
- FRAC_CONST(0.98399213448135414),
- FRAC_CONST(0.98428241565990748),
- FRAC_CONST(0.98457006161822058),
- FRAC_CONST(0.98485507158617835),
- FRAC_CONST(0.98513744480072363),
- FRAC_CONST(0.98541718050585803),
- FRAC_CONST(0.98569427795264519),
- FRAC_CONST(0.98596873639921168),
- FRAC_CONST(0.98624055511074971),
- FRAC_CONST(0.98650973335951875),
- FRAC_CONST(0.98677627042484772),
- FRAC_CONST(0.98704016559313645),
- FRAC_CONST(0.98730141815785832),
- FRAC_CONST(0.98756002741956173),
- FRAC_CONST(0.9878159926858715),
- FRAC_CONST(0.98806931327149194),
- FRAC_CONST(0.98831998849820735),
- FRAC_CONST(0.98856801769488489),
- FRAC_CONST(0.98881340019747566),
- FRAC_CONST(0.98905613534901682),
- FRAC_CONST(0.98929622249963345),
- FRAC_CONST(0.98953366100653983),
- FRAC_CONST(0.98976845023404181),
- FRAC_CONST(0.99000058955353776),
- FRAC_CONST(0.99023007834352106),
- FRAC_CONST(0.99045691598958097),
- FRAC_CONST(0.99068110188440506),
- FRAC_CONST(0.99090263542778001),
- FRAC_CONST(0.99112151602659404),
- FRAC_CONST(0.99133774309483769),
- FRAC_CONST(0.99155131605360625),
- FRAC_CONST(0.99176223433110056),
- FRAC_CONST(0.99197049736262888),
- FRAC_CONST(0.99217610459060845),
- FRAC_CONST(0.99237905546456673),
- FRAC_CONST(0.99257934944114334),
- FRAC_CONST(0.99277698598409092),
- FRAC_CONST(0.99297196456427694),
- FRAC_CONST(0.99316428465968509),
- FRAC_CONST(0.99335394575541669),
- FRAC_CONST(0.99354094734369169),
- FRAC_CONST(0.99372528892385081),
- FRAC_CONST(0.99390697000235606),
- FRAC_CONST(0.99408599009279242),
- FRAC_CONST(0.99426234871586938),
- FRAC_CONST(0.99443604539942176),
- FRAC_CONST(0.99460707967841133),
- FRAC_CONST(0.99477545109492771),
- FRAC_CONST(0.99494115919819004),
- FRAC_CONST(0.99510420354454787),
- FRAC_CONST(0.99526458369748239),
- FRAC_CONST(0.99542229922760772),
- FRAC_CONST(0.99557734971267187),
- FRAC_CONST(0.9957297347375581),
- FRAC_CONST(0.99587945389428578),
- FRAC_CONST(0.99602650678201154),
- FRAC_CONST(0.99617089300703077),
- FRAC_CONST(0.996312612182778),
- FRAC_CONST(0.99645166392982831),
- FRAC_CONST(0.99658804787589839),
- FRAC_CONST(0.99672176365584741),
- FRAC_CONST(0.99685281091167788),
- FRAC_CONST(0.99698118929253687),
- FRAC_CONST(0.99710689845471678),
- FRAC_CONST(0.99722993806165661),
- FRAC_CONST(0.99735030778394196),
- FRAC_CONST(0.99746800729930707),
- FRAC_CONST(0.99758303629263489),
- FRAC_CONST(0.99769539445595812),
- FRAC_CONST(0.99780508148846014),
- FRAC_CONST(0.99791209709647588),
- FRAC_CONST(0.99801644099349218),
- FRAC_CONST(0.99811811290014918),
- FRAC_CONST(0.9982171125442405),
- FRAC_CONST(0.9983134396607144),
- FRAC_CONST(0.99840709399167404),
- FRAC_CONST(0.99849807528637868),
- FRAC_CONST(0.99858638330124405),
- FRAC_CONST(0.99867201779984294),
- FRAC_CONST(0.99875497855290607),
- FRAC_CONST(0.99883526533832245),
- FRAC_CONST(0.99891287794114036),
- FRAC_CONST(0.99898781615356746),
- FRAC_CONST(0.99906007977497147),
- FRAC_CONST(0.99912966861188113),
- FRAC_CONST(0.99919658247798593),
- FRAC_CONST(0.99926082119413751),
- FRAC_CONST(0.99932238458834954),
- FRAC_CONST(0.999381272495798),
- FRAC_CONST(0.99943748475882255),
- FRAC_CONST(0.9994910212269259),
- FRAC_CONST(0.99954188175677483),
- FRAC_CONST(0.99959006621220048),
- FRAC_CONST(0.99963557446419837),
- FRAC_CONST(0.99967840639092931),
- FRAC_CONST(0.99971856187771946),
- FRAC_CONST(0.99975604081706027),
- FRAC_CONST(0.99979084310860955),
- FRAC_CONST(0.99982296865919107),
- FRAC_CONST(0.99985241738279484),
- FRAC_CONST(0.99987918920057806),
- FRAC_CONST(0.99990328404086426),
- FRAC_CONST(0.9999247018391445),
- FRAC_CONST(0.99994344253807688),
- FRAC_CONST(0.99995950608748674),
- FRAC_CONST(0.99997289244436727),
- FRAC_CONST(0.99998360157287902),
- FRAC_CONST(0.9999916334443506),
- FRAC_CONST(0.99999698803727821),
- FRAC_CONST(0.99999966533732598)
-};
-#endif
-
-ALIGN static const real_t sine_short_128[] =
-{
- FRAC_CONST(0.0061358846491544753),
- FRAC_CONST(0.01840672990580482),
- FRAC_CONST(0.030674803176636626),
- FRAC_CONST(0.04293825693494082),
- FRAC_CONST(0.055195244349689934),
- FRAC_CONST(0.067443919563664051),
- FRAC_CONST(0.079682437971430126),
- FRAC_CONST(0.091908956497132724),
- FRAC_CONST(0.10412163387205459),
- FRAC_CONST(0.11631863091190475),
- FRAC_CONST(0.12849811079379317),
- FRAC_CONST(0.14065823933284921),
- FRAC_CONST(0.15279718525844344),
- FRAC_CONST(0.16491312048996989),
- FRAC_CONST(0.17700422041214875),
- FRAC_CONST(0.18906866414980619),
- FRAC_CONST(0.2011046348420919),
- FRAC_CONST(0.21311031991609136),
- FRAC_CONST(0.22508391135979283),
- FRAC_CONST(0.2370236059943672),
- FRAC_CONST(0.24892760574572015),
- FRAC_CONST(0.26079411791527551),
- FRAC_CONST(0.27262135544994898),
- FRAC_CONST(0.28440753721127188),
- FRAC_CONST(0.29615088824362379),
- FRAC_CONST(0.30784964004153487),
- FRAC_CONST(0.31950203081601569),
- FRAC_CONST(0.33110630575987643),
- FRAC_CONST(0.34266071731199438),
- FRAC_CONST(0.35416352542049034),
- FRAC_CONST(0.36561299780477385),
- FRAC_CONST(0.37700741021641826),
- FRAC_CONST(0.38834504669882625),
- FRAC_CONST(0.39962419984564679),
- FRAC_CONST(0.41084317105790391),
- FRAC_CONST(0.42200027079979968),
- FRAC_CONST(0.43309381885315196),
- FRAC_CONST(0.4441221445704292),
- FRAC_CONST(0.45508358712634384),
- FRAC_CONST(0.46597649576796618),
- FRAC_CONST(0.47679923006332209),
- FRAC_CONST(0.487550160148436),
- FRAC_CONST(0.49822766697278187),
- FRAC_CONST(0.50883014254310699),
- FRAC_CONST(0.51935599016558964),
- FRAC_CONST(0.52980362468629461),
- FRAC_CONST(0.54017147272989285),
- FRAC_CONST(0.55045797293660481),
- FRAC_CONST(0.56066157619733603),
- FRAC_CONST(0.57078074588696726),
- FRAC_CONST(0.58081395809576453),
- FRAC_CONST(0.59075970185887416),
- FRAC_CONST(0.60061647938386897),
- FRAC_CONST(0.61038280627630948),
- FRAC_CONST(0.6200572117632891),
- FRAC_CONST(0.62963823891492698),
- FRAC_CONST(0.63912444486377573),
- FRAC_CONST(0.64851440102211244),
- FRAC_CONST(0.65780669329707864),
- FRAC_CONST(0.66699992230363747),
- FRAC_CONST(0.67609270357531592),
- FRAC_CONST(0.68508366777270036),
- FRAC_CONST(0.693971460889654),
- FRAC_CONST(0.7027547444572253),
- FRAC_CONST(0.71143219574521643),
- FRAC_CONST(0.72000250796138165),
- FRAC_CONST(0.7284643904482252),
- FRAC_CONST(0.73681656887736979),
- FRAC_CONST(0.74505778544146595),
- FRAC_CONST(0.75318679904361241),
- FRAC_CONST(0.76120238548426178),
- FRAC_CONST(0.76910333764557959),
- FRAC_CONST(0.77688846567323244),
- FRAC_CONST(0.78455659715557524),
- FRAC_CONST(0.79210657730021239),
- FRAC_CONST(0.79953726910790501),
- FRAC_CONST(0.80684755354379922),
- FRAC_CONST(0.8140363297059483),
- FRAC_CONST(0.82110251499110465),
- FRAC_CONST(0.8280450452577558),
- FRAC_CONST(0.83486287498638001),
- FRAC_CONST(0.84155497743689833),
- FRAC_CONST(0.84812034480329712),
- FRAC_CONST(0.85455798836540053),
- FRAC_CONST(0.86086693863776731),
- FRAC_CONST(0.86704624551569265),
- FRAC_CONST(0.87309497841829009),
- FRAC_CONST(0.87901222642863341),
- FRAC_CONST(0.88479709843093779),
- FRAC_CONST(0.89044872324475788),
- FRAC_CONST(0.89596624975618511),
- FRAC_CONST(0.90134884704602203),
- FRAC_CONST(0.90659570451491533),
- FRAC_CONST(0.91170603200542988),
- FRAC_CONST(0.9166790599210427),
- FRAC_CONST(0.9215140393420419),
- FRAC_CONST(0.92621024213831127),
- FRAC_CONST(0.93076696107898371),
- FRAC_CONST(0.9351835099389475),
- FRAC_CONST(0.93945922360218992),
- FRAC_CONST(0.94359345816196039),
- FRAC_CONST(0.94758559101774109),
- FRAC_CONST(0.95143502096900834),
- FRAC_CONST(0.95514116830577067),
- FRAC_CONST(0.9587034748958716),
- FRAC_CONST(0.96212140426904158),
- FRAC_CONST(0.9653944416976894),
- FRAC_CONST(0.96852209427441727),
- FRAC_CONST(0.97150389098625178),
- FRAC_CONST(0.97433938278557586),
- FRAC_CONST(0.97702814265775439),
- FRAC_CONST(0.97956976568544052),
- FRAC_CONST(0.98196386910955524),
- FRAC_CONST(0.98421009238692903),
- FRAC_CONST(0.98630809724459867),
- FRAC_CONST(0.98825756773074946),
- FRAC_CONST(0.99005821026229712),
- FRAC_CONST(0.99170975366909953),
- FRAC_CONST(0.9932119492347945),
- FRAC_CONST(0.99456457073425542),
- FRAC_CONST(0.99576741446765982),
- FRAC_CONST(0.99682029929116567),
- FRAC_CONST(0.99772306664419164),
- FRAC_CONST(0.99847558057329477),
- FRAC_CONST(0.99907772775264536),
- FRAC_CONST(0.99952941750109314),
- FRAC_CONST(0.9998305817958234),
- FRAC_CONST(0.99998117528260111)
-};
-
-#ifdef ALLOW_SMALL_FRAMELENGTH
-ALIGN static const real_t sine_short_120[] =
-{
- FRAC_CONST(0.0065449379673518581),
- FRAC_CONST(0.019633692460628301),
- FRAC_CONST(0.032719082821776137),
- FRAC_CONST(0.045798866936520771),
- FRAC_CONST(0.058870803651189033),
- FRAC_CONST(0.071932653156719387),
- FRAC_CONST(0.084982177372441667),
- FRAC_CONST(0.09801714032956059),
- FRAC_CONST(0.11103530855427769),
- FRAC_CONST(0.12403445145048532),
- FRAC_CONST(0.13701234168196802),
- FRAC_CONST(0.14996675555404498),
- FRAC_CONST(0.16289547339458874),
- FRAC_CONST(0.17579627993435451),
- FRAC_CONST(0.18866696468655525),
- FRAC_CONST(0.2015053223256171),
- FRAC_CONST(0.21430915306505074),
- FRAC_CONST(0.2270762630343732),
- FRAC_CONST(0.23980446465501654),
- FRAC_CONST(0.25249157701515795),
- FRAC_CONST(0.26513542624340797),
- FRAC_CONST(0.27773384588129219),
- FRAC_CONST(0.29028467725446233),
- FRAC_CONST(0.3027857698425746),
- FRAC_CONST(0.31523498164776964),
- FRAC_CONST(0.32763017956169349),
- FRAC_CONST(0.33996923973099424),
- FRAC_CONST(0.35225004792123354),
- FRAC_CONST(0.36447049987914965),
- FRAC_CONST(0.37662850169321077),
- FRAC_CONST(0.38872197015239557),
- FRAC_CONST(0.40074883310314097),
- FRAC_CONST(0.41270702980439467),
- FRAC_CONST(0.42459451128071307),
- FRAC_CONST(0.43640924067334208),
- FRAC_CONST(0.44814919358922256),
- FRAC_CONST(0.45981235844785984),
- FRAC_CONST(0.47139673682599764),
- FRAC_CONST(0.48290034380003727),
- FRAC_CONST(0.49432120828614462),
- FRAC_CONST(0.50565737337798455),
- FRAC_CONST(0.51690689668202761),
- FRAC_CONST(0.52806785065036799),
- FRAC_CONST(0.53913832291100017),
- FRAC_CONST(0.55011641659549337),
- FRAC_CONST(0.56100025066400983),
- FRAC_CONST(0.57178796022761225),
- FRAC_CONST(0.58247769686780215),
- FRAC_CONST(0.59306762895323706),
- FRAC_CONST(0.60355594195357143),
- FRAC_CONST(0.61394083875036642),
- FRAC_CONST(0.62422053994501758),
- FRAC_CONST(0.63439328416364549),
- FRAC_CONST(0.64445732835889735),
- FRAC_CONST(0.65441094810861034),
- FRAC_CONST(0.66425243791128175),
- FRAC_CONST(0.67398011147829784),
- FRAC_CONST(0.68359230202287125),
- FRAC_CONST(0.69308736254563585),
- FRAC_CONST(0.70246366611685174),
- FRAC_CONST(0.71171960615517138),
- FRAC_CONST(0.72085359670291882),
- FRAC_CONST(0.7298640726978356),
- FRAC_CONST(0.73874949024124625),
- FRAC_CONST(0.74750832686259672),
- FRAC_CONST(0.75613908178032285),
- FRAC_CONST(0.76464027615900032),
- FRAC_CONST(0.77301045336273699),
- FRAC_CONST(0.78124817920475853),
- FRAC_CONST(0.78935204219315003),
- FRAC_CONST(0.79732065377270711),
- FRAC_CONST(0.80515264856285829),
- FRAC_CONST(0.81284668459161513),
- FRAC_CONST(0.82040144352551359),
- FRAC_CONST(0.82781563089550203),
- FRAC_CONST(0.83508797631874299),
- FRAC_CONST(0.84221723371628654),
- FRAC_CONST(0.84920218152657889),
- FRAC_CONST(0.85604162291477137),
- FRAC_CONST(0.86273438597779184),
- FRAC_CONST(0.86927932394514362),
- FRAC_CONST(0.87567531537539967),
- FRAC_CONST(0.88192126434835494),
- FRAC_CONST(0.88801610065280734),
- FRAC_CONST(0.89395877996993212),
- FRAC_CONST(0.8997482840522214),
- FRAC_CONST(0.90538362089795521),
- FRAC_CONST(0.91086382492117568),
- FRAC_CONST(0.91618795711713596),
- FRAC_CONST(0.92135510522319242),
- FRAC_CONST(0.9263643838751181),
- FRAC_CONST(0.93121493475880346),
- FRAC_CONST(0.93590592675732565),
- FRAC_CONST(0.94043655609335486),
- FRAC_CONST(0.94480604646687805),
- FRAC_CONST(0.94901364918821385),
- FRAC_CONST(0.95305864330629697),
- FRAC_CONST(0.95694033573220882),
- FRAC_CONST(0.9606580613579353),
- FRAC_CONST(0.96421118317032928),
- FRAC_CONST(0.96759909236025976),
- FRAC_CONST(0.9708212084269281),
- FRAC_CONST(0.97387697927733363),
- FRAC_CONST(0.97676588132087239),
- FRAC_CONST(0.97948741955905139),
- FRAC_CONST(0.98204112767030394),
- FRAC_CONST(0.98442656808989171),
- FRAC_CONST(0.98664333208487898),
- FRAC_CONST(0.98869103982416728),
- FRAC_CONST(0.99056934044357725),
- FRAC_CONST(0.99227791210596705),
- FRAC_CONST(0.99381646205637808),
- FRAC_CONST(0.99518472667219682),
- FRAC_CONST(0.99638247150832537),
- FRAC_CONST(0.99740949133735191),
- FRAC_CONST(0.99826561018471593),
- FRAC_CONST(0.99895068135886012),
- FRAC_CONST(0.99946458747636568),
- FRAC_CONST(0.99980724048206482),
- FRAC_CONST(0.99997858166412923)
-};
-#endif
-
-#ifdef LD_DEC
-ALIGN static const real_t sine_mid_512[] =
-{
- FRAC_CONST(0.0015339801862847655),
- FRAC_CONST(0.0046019261204485705),
- FRAC_CONST(0.007669828739531097),
- FRAC_CONST(0.010737659167264491),
- FRAC_CONST(0.013805388528060391),
- FRAC_CONST(0.01687298794728171),
- FRAC_CONST(0.019940428551514441),
- FRAC_CONST(0.023007681468839369),
- FRAC_CONST(0.026074717829103901),
- FRAC_CONST(0.029141508764193722),
- FRAC_CONST(0.032208025408304586),
- FRAC_CONST(0.035274238898213947),
- FRAC_CONST(0.038340120373552694),
- FRAC_CONST(0.041405640977076739),
- FRAC_CONST(0.044470771854938668),
- FRAC_CONST(0.047535484156959303),
- FRAC_CONST(0.050599749036899282),
- FRAC_CONST(0.05366353765273052),
- FRAC_CONST(0.056726821166907748),
- FRAC_CONST(0.059789570746639868),
- FRAC_CONST(0.062851757564161406),
- FRAC_CONST(0.065913352797003805),
- FRAC_CONST(0.068974327628266746),
- FRAC_CONST(0.072034653246889332),
- FRAC_CONST(0.075094300847921305),
- FRAC_CONST(0.078153241632794232),
- FRAC_CONST(0.081211446809592441),
- FRAC_CONST(0.084268887593324071),
- FRAC_CONST(0.087325535206192059),
- FRAC_CONST(0.090381360877864983),
- FRAC_CONST(0.093436335845747787),
- FRAC_CONST(0.096490431355252593),
- FRAC_CONST(0.099543618660069319),
- FRAC_CONST(0.10259586902243628),
- FRAC_CONST(0.10564715371341062),
- FRAC_CONST(0.10869744401313872),
- FRAC_CONST(0.11174671121112659),
- FRAC_CONST(0.11479492660651008),
- FRAC_CONST(0.11784206150832498),
- FRAC_CONST(0.12088808723577708),
- FRAC_CONST(0.12393297511851216),
- FRAC_CONST(0.12697669649688587),
- FRAC_CONST(0.13001922272223335),
- FRAC_CONST(0.13306052515713906),
- FRAC_CONST(0.1361005751757062),
- FRAC_CONST(0.1391393441638262),
- FRAC_CONST(0.14217680351944803),
- FRAC_CONST(0.14521292465284746),
- FRAC_CONST(0.14824767898689603),
- FRAC_CONST(0.15128103795733022),
- FRAC_CONST(0.1543129730130201),
- FRAC_CONST(0.15734345561623825),
- FRAC_CONST(0.16037245724292828),
- FRAC_CONST(0.16339994938297323),
- FRAC_CONST(0.1664259035404641),
- FRAC_CONST(0.16945029123396796),
- FRAC_CONST(0.17247308399679595),
- FRAC_CONST(0.17549425337727143),
- FRAC_CONST(0.17851377093899751),
- FRAC_CONST(0.18153160826112497),
- FRAC_CONST(0.18454773693861962),
- FRAC_CONST(0.1875621285825296),
- FRAC_CONST(0.19057475482025274),
- FRAC_CONST(0.19358558729580361),
- FRAC_CONST(0.19659459767008022),
- FRAC_CONST(0.19960175762113097),
- FRAC_CONST(0.20260703884442113),
- FRAC_CONST(0.20561041305309924),
- FRAC_CONST(0.20861185197826349),
- FRAC_CONST(0.21161132736922755),
- FRAC_CONST(0.21460881099378676),
- FRAC_CONST(0.21760427463848364),
- FRAC_CONST(0.22059769010887351),
- FRAC_CONST(0.22358902922978999),
- FRAC_CONST(0.22657826384561),
- FRAC_CONST(0.22956536582051887),
- FRAC_CONST(0.23255030703877524),
- FRAC_CONST(0.23553305940497549),
- FRAC_CONST(0.23851359484431842),
- FRAC_CONST(0.24149188530286933),
- FRAC_CONST(0.24446790274782415),
- FRAC_CONST(0.24744161916777327),
- FRAC_CONST(0.25041300657296522),
- FRAC_CONST(0.25338203699557016),
- FRAC_CONST(0.25634868248994291),
- FRAC_CONST(0.25931291513288623),
- FRAC_CONST(0.26227470702391359),
- FRAC_CONST(0.26523403028551179),
- FRAC_CONST(0.26819085706340318),
- FRAC_CONST(0.27114515952680801),
- FRAC_CONST(0.27409690986870638),
- FRAC_CONST(0.2770460803060999),
- FRAC_CONST(0.27999264308027322),
- FRAC_CONST(0.28293657045705539),
- FRAC_CONST(0.28587783472708062),
- FRAC_CONST(0.28881640820604948),
- FRAC_CONST(0.29175226323498926),
- FRAC_CONST(0.29468537218051433),
- FRAC_CONST(0.2976157074350862),
- FRAC_CONST(0.30054324141727345),
- FRAC_CONST(0.30346794657201132),
- FRAC_CONST(0.30638979537086092),
- FRAC_CONST(0.30930876031226873),
- FRAC_CONST(0.31222481392182488),
- FRAC_CONST(0.31513792875252244),
- FRAC_CONST(0.31804807738501495),
- FRAC_CONST(0.32095523242787521),
- FRAC_CONST(0.32385936651785285),
- FRAC_CONST(0.32676045232013173),
- FRAC_CONST(0.32965846252858749),
- FRAC_CONST(0.33255336986604422),
- FRAC_CONST(0.3354451470845316),
- FRAC_CONST(0.33833376696554113),
- FRAC_CONST(0.34121920232028236),
- FRAC_CONST(0.34410142598993881),
- FRAC_CONST(0.34698041084592368),
- FRAC_CONST(0.34985612979013492),
- FRAC_CONST(0.35272855575521073),
- FRAC_CONST(0.35559766170478385),
- FRAC_CONST(0.35846342063373654),
- FRAC_CONST(0.36132580556845428),
- FRAC_CONST(0.36418478956707989),
- FRAC_CONST(0.36704034571976718),
- FRAC_CONST(0.3698924471489341),
- FRAC_CONST(0.37274106700951576),
- FRAC_CONST(0.37558617848921722),
- FRAC_CONST(0.37842775480876556),
- FRAC_CONST(0.38126576922216238),
- FRAC_CONST(0.38410019501693504),
- FRAC_CONST(0.38693100551438858),
- FRAC_CONST(0.38975817406985641),
- FRAC_CONST(0.39258167407295147),
- FRAC_CONST(0.39540147894781635),
- FRAC_CONST(0.39821756215337356),
- FRAC_CONST(0.40102989718357562),
- FRAC_CONST(0.40383845756765407),
- FRAC_CONST(0.40664321687036903),
- FRAC_CONST(0.40944414869225759),
- FRAC_CONST(0.41224122666988289),
- FRAC_CONST(0.41503442447608163),
- FRAC_CONST(0.41782371582021227),
- FRAC_CONST(0.42060907444840251),
- FRAC_CONST(0.42339047414379605),
- FRAC_CONST(0.42616788872679962),
- FRAC_CONST(0.42894129205532949),
- FRAC_CONST(0.43171065802505726),
- FRAC_CONST(0.43447596056965565),
- FRAC_CONST(0.43723717366104409),
- FRAC_CONST(0.43999427130963326),
- FRAC_CONST(0.44274722756457002),
- FRAC_CONST(0.44549601651398174),
- FRAC_CONST(0.44824061228521989),
- FRAC_CONST(0.45098098904510386),
- FRAC_CONST(0.45371712100016387),
- FRAC_CONST(0.45644898239688392),
- FRAC_CONST(0.45917654752194409),
- FRAC_CONST(0.46189979070246273),
- FRAC_CONST(0.46461868630623782),
- FRAC_CONST(0.46733320874198842),
- FRAC_CONST(0.47004333245959562),
- FRAC_CONST(0.47274903195034279),
- FRAC_CONST(0.47545028174715587),
- FRAC_CONST(0.47814705642484301),
- FRAC_CONST(0.48083933060033396),
- FRAC_CONST(0.48352707893291874),
- FRAC_CONST(0.48621027612448642),
- FRAC_CONST(0.48888889691976317),
- FRAC_CONST(0.4915629161065499),
- FRAC_CONST(0.49423230851595967),
- FRAC_CONST(0.49689704902265447),
- FRAC_CONST(0.49955711254508184),
- FRAC_CONST(0.50221247404571079),
- FRAC_CONST(0.50486310853126759),
- FRAC_CONST(0.50750899105297087),
- FRAC_CONST(0.51015009670676681),
- FRAC_CONST(0.51278640063356296),
- FRAC_CONST(0.51541787801946293),
- FRAC_CONST(0.51804450409599934),
- FRAC_CONST(0.52066625414036716),
- FRAC_CONST(0.52328310347565643),
- FRAC_CONST(0.52589502747108463),
- FRAC_CONST(0.52850200154222848),
- FRAC_CONST(0.531104001151255),
- FRAC_CONST(0.53370100180715296),
- FRAC_CONST(0.53629297906596318),
- FRAC_CONST(0.53887990853100842),
- FRAC_CONST(0.54146176585312344),
- FRAC_CONST(0.54403852673088382),
- FRAC_CONST(0.54661016691083486),
- FRAC_CONST(0.54917666218771966),
- FRAC_CONST(0.55173798840470734),
- FRAC_CONST(0.55429412145362),
- FRAC_CONST(0.5568450372751601),
- FRAC_CONST(0.55939071185913614),
- FRAC_CONST(0.56193112124468947),
- FRAC_CONST(0.5644662415205195),
- FRAC_CONST(0.56699604882510868),
- FRAC_CONST(0.56952051934694714),
- FRAC_CONST(0.57203962932475705),
- FRAC_CONST(0.57455335504771576),
- FRAC_CONST(0.57706167285567944),
- FRAC_CONST(0.57956455913940563),
- FRAC_CONST(0.58206199034077544),
- FRAC_CONST(0.58455394295301533),
- FRAC_CONST(0.58704039352091797),
- FRAC_CONST(0.58952131864106394),
- FRAC_CONST(0.59199669496204099),
- FRAC_CONST(0.59446649918466443),
- FRAC_CONST(0.5969307080621965),
- FRAC_CONST(0.59938929840056454),
- FRAC_CONST(0.60184224705858003),
- FRAC_CONST(0.60428953094815596),
- FRAC_CONST(0.60673112703452448),
- FRAC_CONST(0.60916701233645321),
- FRAC_CONST(0.61159716392646191),
- FRAC_CONST(0.61402155893103838),
- FRAC_CONST(0.61644017453085365),
- FRAC_CONST(0.61885298796097632),
- FRAC_CONST(0.62125997651108755),
- FRAC_CONST(0.62366111752569453),
- FRAC_CONST(0.62605638840434352),
- FRAC_CONST(0.62844576660183271),
- FRAC_CONST(0.63082922962842447),
- FRAC_CONST(0.63320675505005719),
- FRAC_CONST(0.63557832048855611),
- FRAC_CONST(0.63794390362184406),
- FRAC_CONST(0.64030348218415167),
- FRAC_CONST(0.64265703396622686),
- FRAC_CONST(0.64500453681554393),
- FRAC_CONST(0.64734596863651206),
- FRAC_CONST(0.64968130739068319),
- FRAC_CONST(0.6520105310969595),
- FRAC_CONST(0.65433361783180044),
- FRAC_CONST(0.65665054572942894),
- FRAC_CONST(0.65896129298203732),
- FRAC_CONST(0.66126583783999227),
- FRAC_CONST(0.66356415861203977),
- FRAC_CONST(0.66585623366550972),
- FRAC_CONST(0.66814204142651845),
- FRAC_CONST(0.67042156038017309),
- FRAC_CONST(0.67269476907077286),
- FRAC_CONST(0.67496164610201193),
- FRAC_CONST(0.67722217013718033),
- FRAC_CONST(0.67947631989936497),
- FRAC_CONST(0.68172407417164971),
- FRAC_CONST(0.6839654117973154),
- FRAC_CONST(0.68620031168003859),
- FRAC_CONST(0.68842875278409044),
- FRAC_CONST(0.6906507141345346),
- FRAC_CONST(0.69286617481742463),
- FRAC_CONST(0.69507511398000088),
- FRAC_CONST(0.69727751083088652),
- FRAC_CONST(0.69947334464028377),
- FRAC_CONST(0.70166259474016845),
- FRAC_CONST(0.70384524052448494),
- FRAC_CONST(0.70602126144933974),
- FRAC_CONST(0.70819063703319529),
- FRAC_CONST(0.71035334685706231),
- FRAC_CONST(0.71250937056469232),
- FRAC_CONST(0.71465868786276898),
- FRAC_CONST(0.71680127852109954),
- FRAC_CONST(0.71893712237280438),
- FRAC_CONST(0.72106619931450811),
- FRAC_CONST(0.72318848930652735),
- FRAC_CONST(0.72530397237306066),
- FRAC_CONST(0.72741262860237577),
- FRAC_CONST(0.7295144381469969),
- FRAC_CONST(0.73160938122389252),
- FRAC_CONST(0.73369743811466026),
- FRAC_CONST(0.73577858916571348),
- FRAC_CONST(0.73785281478846598),
- FRAC_CONST(0.73992009545951609),
- FRAC_CONST(0.74198041172083096),
- FRAC_CONST(0.74403374417992918),
- FRAC_CONST(0.74608007351006378),
- FRAC_CONST(0.74811938045040349),
- FRAC_CONST(0.75015164580621496),
- FRAC_CONST(0.7521768504490427),
- FRAC_CONST(0.75419497531688917),
- FRAC_CONST(0.75620600141439454),
- FRAC_CONST(0.75820990981301528),
- FRAC_CONST(0.76020668165120242),
- FRAC_CONST(0.7621962981345789),
- FRAC_CONST(0.76417874053611667),
- FRAC_CONST(0.76615399019631281),
- FRAC_CONST(0.76812202852336531),
- FRAC_CONST(0.7700828369933479),
- FRAC_CONST(0.77203639715038441),
- FRAC_CONST(0.77398269060682279),
- FRAC_CONST(0.77592169904340758),
- FRAC_CONST(0.77785340420945304),
- FRAC_CONST(0.77977778792301444),
- FRAC_CONST(0.78169483207105939),
- FRAC_CONST(0.7836045186096382),
- FRAC_CONST(0.78550682956405393),
- FRAC_CONST(0.78740174702903132),
- FRAC_CONST(0.78928925316888565),
- FRAC_CONST(0.79116933021769009),
- FRAC_CONST(0.79304196047944364),
- FRAC_CONST(0.79490712632823701),
- FRAC_CONST(0.79676481020841872),
- FRAC_CONST(0.79861499463476082),
- FRAC_CONST(0.80045766219262271),
- FRAC_CONST(0.80229279553811572),
- FRAC_CONST(0.8041203773982657),
- FRAC_CONST(0.80594039057117628),
- FRAC_CONST(0.80775281792619036),
- FRAC_CONST(0.80955764240405126),
- FRAC_CONST(0.81135484701706373),
- FRAC_CONST(0.81314441484925359),
- FRAC_CONST(0.81492632905652662),
- FRAC_CONST(0.81670057286682785),
- FRAC_CONST(0.81846712958029866),
- FRAC_CONST(0.82022598256943469),
- FRAC_CONST(0.82197711527924155),
- FRAC_CONST(0.82372051122739132),
- FRAC_CONST(0.82545615400437744),
- FRAC_CONST(0.82718402727366902),
- FRAC_CONST(0.82890411477186487),
- FRAC_CONST(0.8306164003088462),
- FRAC_CONST(0.83232086776792968),
- FRAC_CONST(0.83401750110601813),
- FRAC_CONST(0.8357062843537526),
- FRAC_CONST(0.83738720161566194),
- FRAC_CONST(0.83906023707031263),
- FRAC_CONST(0.84072537497045807),
- FRAC_CONST(0.84238259964318596),
- FRAC_CONST(0.84403189549006641),
- FRAC_CONST(0.84567324698729907),
- FRAC_CONST(0.84730663868585832),
- FRAC_CONST(0.84893205521163961),
- FRAC_CONST(0.85054948126560337),
- FRAC_CONST(0.85215890162391983),
- FRAC_CONST(0.8537603011381113),
- FRAC_CONST(0.85535366473519603),
- FRAC_CONST(0.85693897741782865),
- FRAC_CONST(0.85851622426444274),
- FRAC_CONST(0.86008539042939014),
- FRAC_CONST(0.8616464611430813),
- FRAC_CONST(0.86319942171212416),
- FRAC_CONST(0.86474425751946238),
- FRAC_CONST(0.86628095402451299),
- FRAC_CONST(0.86780949676330321),
- FRAC_CONST(0.86932987134860673),
- FRAC_CONST(0.87084206347007886),
- FRAC_CONST(0.87234605889439154),
- FRAC_CONST(0.87384184346536675),
- FRAC_CONST(0.87532940310411078),
- FRAC_CONST(0.87680872380914576),
- FRAC_CONST(0.87827979165654146),
- FRAC_CONST(0.87974259280004741),
- FRAC_CONST(0.88119711347122198),
- FRAC_CONST(0.88264333997956279),
- FRAC_CONST(0.88408125871263499),
- FRAC_CONST(0.88551085613619995),
- FRAC_CONST(0.88693211879434208),
- FRAC_CONST(0.88834503330959624),
- FRAC_CONST(0.88974958638307289),
- FRAC_CONST(0.89114576479458318),
- FRAC_CONST(0.89253355540276469),
- FRAC_CONST(0.89391294514520325),
- FRAC_CONST(0.89528392103855758),
- FRAC_CONST(0.89664647017868015),
- FRAC_CONST(0.89800057974073988),
- FRAC_CONST(0.89934623697934146),
- FRAC_CONST(0.90068342922864686),
- FRAC_CONST(0.90201214390249307),
- FRAC_CONST(0.90333236849451182),
- FRAC_CONST(0.90464409057824624),
- FRAC_CONST(0.90594729780726846),
- FRAC_CONST(0.90724197791529593),
- FRAC_CONST(0.90852811871630612),
- FRAC_CONST(0.90980570810465222),
- FRAC_CONST(0.91107473405517625),
- FRAC_CONST(0.91233518462332275),
- FRAC_CONST(0.91358704794525081),
- FRAC_CONST(0.91483031223794609),
- FRAC_CONST(0.91606496579933161),
- FRAC_CONST(0.91729099700837791),
- FRAC_CONST(0.91850839432521225),
- FRAC_CONST(0.91971714629122736),
- FRAC_CONST(0.92091724152918952),
- FRAC_CONST(0.92210866874334507),
- FRAC_CONST(0.92329141671952764),
- FRAC_CONST(0.9244654743252626),
- FRAC_CONST(0.92563083050987272),
- FRAC_CONST(0.92678747430458175),
- FRAC_CONST(0.92793539482261789),
- FRAC_CONST(0.92907458125931575),
- FRAC_CONST(0.93020502289221907),
- FRAC_CONST(0.93132670908118043),
- FRAC_CONST(0.93243962926846236),
- FRAC_CONST(0.93354377297883617),
- FRAC_CONST(0.93463912981968078),
- FRAC_CONST(0.93572568948108037),
- FRAC_CONST(0.93680344173592156),
- FRAC_CONST(0.93787237643998989),
- FRAC_CONST(0.93893248353206449),
- FRAC_CONST(0.93998375303401394),
- FRAC_CONST(0.94102617505088926),
- FRAC_CONST(0.94205973977101731),
- FRAC_CONST(0.94308443746609349),
- FRAC_CONST(0.94410025849127266),
- FRAC_CONST(0.94510719328526061),
- FRAC_CONST(0.94610523237040334),
- FRAC_CONST(0.94709436635277722),
- FRAC_CONST(0.94807458592227623),
- FRAC_CONST(0.94904588185270056),
- FRAC_CONST(0.950008245001843),
- FRAC_CONST(0.95096166631157508),
- FRAC_CONST(0.95190613680793223),
- FRAC_CONST(0.95284164760119872),
- FRAC_CONST(0.95376818988599033),
- FRAC_CONST(0.95468575494133834),
- FRAC_CONST(0.95559433413077111),
- FRAC_CONST(0.95649391890239499),
- FRAC_CONST(0.95738450078897586),
- FRAC_CONST(0.95826607140801767),
- FRAC_CONST(0.95913862246184189),
- FRAC_CONST(0.96000214573766585),
- FRAC_CONST(0.96085663310767966),
- FRAC_CONST(0.96170207652912254),
- FRAC_CONST(0.96253846804435916),
- FRAC_CONST(0.96336579978095405),
- FRAC_CONST(0.96418406395174572),
- FRAC_CONST(0.96499325285492032),
- FRAC_CONST(0.96579335887408357),
- FRAC_CONST(0.96658437447833312),
- FRAC_CONST(0.96736629222232851),
- FRAC_CONST(0.96813910474636233),
- FRAC_CONST(0.96890280477642887),
- FRAC_CONST(0.96965738512429245),
- FRAC_CONST(0.9704028386875555),
- FRAC_CONST(0.97113915844972509),
- FRAC_CONST(0.9718663374802794),
- FRAC_CONST(0.97258436893473221),
- FRAC_CONST(0.97329324605469825),
- FRAC_CONST(0.97399296216795583),
- FRAC_CONST(0.97468351068851067),
- FRAC_CONST(0.97536488511665687),
- FRAC_CONST(0.97603707903903902),
- FRAC_CONST(0.97670008612871184),
- FRAC_CONST(0.97735390014519996),
- FRAC_CONST(0.97799851493455714),
- FRAC_CONST(0.9786339244294231),
- FRAC_CONST(0.97926012264908202),
- FRAC_CONST(0.97987710369951764),
- FRAC_CONST(0.98048486177346938),
- FRAC_CONST(0.98108339115048659),
- FRAC_CONST(0.98167268619698311),
- FRAC_CONST(0.98225274136628937),
- FRAC_CONST(0.98282355119870524),
- FRAC_CONST(0.98338511032155118),
- FRAC_CONST(0.98393741344921892),
- FRAC_CONST(0.98448045538322093),
- FRAC_CONST(0.98501423101223984),
- FRAC_CONST(0.98553873531217606),
- FRAC_CONST(0.98605396334619544),
- FRAC_CONST(0.98655991026477541),
- FRAC_CONST(0.98705657130575097),
- FRAC_CONST(0.98754394179435923),
- FRAC_CONST(0.98802201714328353),
- FRAC_CONST(0.98849079285269659),
- FRAC_CONST(0.98895026451030299),
- FRAC_CONST(0.98940042779138038),
- FRAC_CONST(0.98984127845882053),
- FRAC_CONST(0.99027281236316911),
- FRAC_CONST(0.99069502544266463),
- FRAC_CONST(0.99110791372327678),
- FRAC_CONST(0.9915114733187439),
- FRAC_CONST(0.99190570043060933),
- FRAC_CONST(0.99229059134825737),
- FRAC_CONST(0.99266614244894802),
- FRAC_CONST(0.99303235019785141),
- FRAC_CONST(0.99338921114808065),
- FRAC_CONST(0.9937367219407246),
- FRAC_CONST(0.99407487930487937),
- FRAC_CONST(0.9944036800576791),
- FRAC_CONST(0.9947231211043257),
- FRAC_CONST(0.99503319943811863),
- FRAC_CONST(0.99533391214048228),
- FRAC_CONST(0.99562525638099431),
- FRAC_CONST(0.99590722941741172),
- FRAC_CONST(0.99617982859569687),
- FRAC_CONST(0.99644305135004263),
- FRAC_CONST(0.99669689520289606),
- FRAC_CONST(0.99694135776498216),
- FRAC_CONST(0.99717643673532619),
- FRAC_CONST(0.9974021299012753),
- FRAC_CONST(0.99761843513851955),
- FRAC_CONST(0.99782535041111164),
- FRAC_CONST(0.99802287377148624),
- FRAC_CONST(0.99821100336047819),
- FRAC_CONST(0.99838973740734016),
- FRAC_CONST(0.99855907422975931),
- FRAC_CONST(0.99871901223387294),
- FRAC_CONST(0.99886954991428356),
- FRAC_CONST(0.99901068585407338),
- FRAC_CONST(0.99914241872481691),
- FRAC_CONST(0.99926474728659442),
- FRAC_CONST(0.99937767038800285),
- FRAC_CONST(0.99948118696616695),
- FRAC_CONST(0.99957529604674922),
- FRAC_CONST(0.99965999674395922),
- FRAC_CONST(0.99973528826056168),
- FRAC_CONST(0.99980116988788426),
- FRAC_CONST(0.99985764100582386),
- FRAC_CONST(0.9999047010828529),
- FRAC_CONST(0.99994234967602391),
- FRAC_CONST(0.99997058643097414),
- FRAC_CONST(0.9999894110819284),
- FRAC_CONST(0.99999882345170188)
-};
-
-#ifdef ALLOW_SMALL_FRAMELENGTH
-ALIGN static const real_t sine_mid_480[] =
-{
- FRAC_CONST(0.0016362454436240478),
- FRAC_CONST(0.00490871880799799),
- FRAC_CONST(0.0081811396039371282),
- FRAC_CONST(0.011453472786443779),
- FRAC_CONST(0.014725683311458524),
- FRAC_CONST(0.017997736136235509),
- FRAC_CONST(0.021269596219717739),
- FRAC_CONST(0.024541228522912285),
- FRAC_CONST(0.027812598009265607),
- FRAC_CONST(0.03108366964503869),
- FRAC_CONST(0.034354408399682276),
- FRAC_CONST(0.037624779246211978),
- FRAC_CONST(0.04089474716158345),
- FRAC_CONST(0.044164277127067358),
- FRAC_CONST(0.047433334128624507),
- FRAC_CONST(0.050701883157280733),
- FRAC_CONST(0.053969889209501881),
- FRAC_CONST(0.057237317287568618),
- FRAC_CONST(0.060504132399951269),
- FRAC_CONST(0.063770299561684493),
- FRAC_CONST(0.06703578379474201),
- FRAC_CONST(0.070300550128411174),
- FRAC_CONST(0.073564563599667426),
- FRAC_CONST(0.076827789253548759),
- FRAC_CONST(0.080090192143530081),
- FRAC_CONST(0.083351737331897449),
- FRAC_CONST(0.086612389890122182),
- FRAC_CONST(0.089872114899234967),
- FRAC_CONST(0.093130877450199795),
- FRAC_CONST(0.096388642644287828),
- FRAC_CONST(0.09964537559345106),
- FRAC_CONST(0.1029010414206961),
- FRAC_CONST(0.10615560526045748),
- FRAC_CONST(0.10940903225897117),
- FRAC_CONST(0.11266128757464781),
- FRAC_CONST(0.11591233637844581),
- FRAC_CONST(0.11916214385424433),
- FRAC_CONST(0.1224106751992162),
- FRAC_CONST(0.12565789562420052),
- FRAC_CONST(0.12890377035407541),
- FRAC_CONST(0.13214826462813015),
- FRAC_CONST(0.13539134370043773),
- FRAC_CONST(0.13863297284022669),
- FRAC_CONST(0.14187311733225325),
- FRAC_CONST(0.14511174247717309),
- FRAC_CONST(0.14834881359191271),
- FRAC_CONST(0.15158429601004111),
- FRAC_CONST(0.15481815508214106),
- FRAC_CONST(0.1580503561761798),
- FRAC_CONST(0.16128086467788047),
- FRAC_CONST(0.16450964599109233),
- FRAC_CONST(0.16773666553816149),
- FRAC_CONST(0.17096188876030122),
- FRAC_CONST(0.17418528111796186),
- FRAC_CONST(0.17740680809120093),
- FRAC_CONST(0.18062643518005275),
- FRAC_CONST(0.18384412790489776),
- FRAC_CONST(0.18705985180683199),
- FRAC_CONST(0.19027357244803589),
- FRAC_CONST(0.19348525541214331),
- FRAC_CONST(0.19669486630460997),
- FRAC_CONST(0.19990237075308173),
- FRAC_CONST(0.20310773440776286),
- FRAC_CONST(0.20631092294178383),
- FRAC_CONST(0.20951190205156878),
- FRAC_CONST(0.21271063745720317),
- FRAC_CONST(0.21590709490280058),
- FRAC_CONST(0.2191012401568698),
- FRAC_CONST(0.22229303901268133),
- FRAC_CONST(0.22548245728863364),
- FRAC_CONST(0.22866946082861941),
- FRAC_CONST(0.23185401550239115),
- FRAC_CONST(0.23503608720592667),
- FRAC_CONST(0.23821564186179459),
- FRAC_CONST(0.24139264541951888),
- FRAC_CONST(0.24456706385594387),
- FRAC_CONST(0.24773886317559846),
- FRAC_CONST(0.25090800941106001),
- FRAC_CONST(0.25407446862331851),
- FRAC_CONST(0.25723820690213967),
- FRAC_CONST(0.26039919036642817),
- FRAC_CONST(0.26355738516459076),
- FRAC_CONST(0.26671275747489837),
- FRAC_CONST(0.2698652735058486),
- FRAC_CONST(0.27301489949652735),
- FRAC_CONST(0.27616160171697068),
- FRAC_CONST(0.27930534646852595),
- FRAC_CONST(0.28244610008421245),
- FRAC_CONST(0.2855838289290823),
- FRAC_CONST(0.28871849940058025),
- FRAC_CONST(0.29185007792890405),
- FRAC_CONST(0.29497853097736348),
- FRAC_CONST(0.2981038250427398),
- FRAC_CONST(0.30122592665564446),
- FRAC_CONST(0.30434480238087736),
- FRAC_CONST(0.30746041881778519),
- FRAC_CONST(0.31057274260061901),
- FRAC_CONST(0.31368174039889146),
- FRAC_CONST(0.31678737891773395),
- FRAC_CONST(0.31988962489825296),
- FRAC_CONST(0.32298844511788638),
- FRAC_CONST(0.32608380639075912),
- FRAC_CONST(0.32917567556803889),
- FRAC_CONST(0.33226401953829071),
- FRAC_CONST(0.33534880522783189),
- FRAC_CONST(0.33842999960108583),
- FRAC_CONST(0.34150756966093632),
- FRAC_CONST(0.34458148244908043),
- FRAC_CONST(0.34765170504638188),
- FRAC_CONST(0.35071820457322322),
- FRAC_CONST(0.35378094818985806),
- FRAC_CONST(0.35683990309676283),
- FRAC_CONST(0.35989503653498811),
- FRAC_CONST(0.36294631578650921),
- FRAC_CONST(0.36599370817457672),
- FRAC_CONST(0.36903718106406647),
- FRAC_CONST(0.37207670186182878),
- FRAC_CONST(0.37511223801703802),
- FRAC_CONST(0.37814375702154046),
- FRAC_CONST(0.38117122641020335),
- FRAC_CONST(0.38419461376126157),
- FRAC_CONST(0.38721388669666562),
- FRAC_CONST(0.39022901288242801),
- FRAC_CONST(0.39323996002896966),
- FRAC_CONST(0.39624669589146555),
- FRAC_CONST(0.39924918827019029),
- FRAC_CONST(0.40224740501086254),
- FRAC_CONST(0.40524131400498986),
- FRAC_CONST(0.40823088319021217),
- FRAC_CONST(0.41121608055064529),
- FRAC_CONST(0.41419687411722372),
- FRAC_CONST(0.41717323196804335),
- FRAC_CONST(0.42014512222870243),
- FRAC_CONST(0.42311251307264408),
- FRAC_CONST(0.42607537272149631),
- FRAC_CONST(0.4290336694454126),
- FRAC_CONST(0.43198737156341183),
- FRAC_CONST(0.43493644744371707),
- FRAC_CONST(0.43788086550409511),
- FRAC_CONST(0.44082059421219388),
- FRAC_CONST(0.44375560208588088),
- FRAC_CONST(0.44668585769357955),
- FRAC_CONST(0.4496113296546066),
- FRAC_CONST(0.45253198663950756),
- FRAC_CONST(0.45544779737039259),
- FRAC_CONST(0.45835873062127125),
- FRAC_CONST(0.46126475521838717),
- FRAC_CONST(0.46416584004055156),
- FRAC_CONST(0.46706195401947659),
- FRAC_CONST(0.46995306614010829),
- FRAC_CONST(0.47283914544095862),
- FRAC_CONST(0.47572016101443682),
- FRAC_CONST(0.47859608200718085),
- FRAC_CONST(0.4814668776203872),
- FRAC_CONST(0.48433251711014125),
- FRAC_CONST(0.4871929697877464),
- FRAC_CONST(0.49004820502005247),
- FRAC_CONST(0.49289819222978404),
- FRAC_CONST(0.49574290089586776),
- FRAC_CONST(0.49858230055375902),
- FRAC_CONST(0.50141636079576901),
- FRAC_CONST(0.50424505127138919),
- FRAC_CONST(0.50706834168761705),
- FRAC_CONST(0.50988620180928057),
- FRAC_CONST(0.51269860145936175),
- FRAC_CONST(0.51550551051931948),
- FRAC_CONST(0.51830689892941317),
- FRAC_CONST(0.5211027366890234),
- FRAC_CONST(0.52389299385697385),
- FRAC_CONST(0.52667764055185196),
- FRAC_CONST(0.52945664695232897),
- FRAC_CONST(0.53222998329747884),
- FRAC_CONST(0.53499761988709726),
- FRAC_CONST(0.53775952708201991),
- FRAC_CONST(0.54051567530443978),
- FRAC_CONST(0.54326603503822357),
- FRAC_CONST(0.54601057682922816),
- FRAC_CONST(0.54874927128561579),
- FRAC_CONST(0.55148208907816942),
- FRAC_CONST(0.55420900094060566),
- FRAC_CONST(0.55692997766988939),
- FRAC_CONST(0.559644990126546),
- FRAC_CONST(0.56235400923497314),
- FRAC_CONST(0.56505700598375252),
- FRAC_CONST(0.56775395142596052),
- FRAC_CONST(0.57044481667947822),
- FRAC_CONST(0.57312957292730071),
- FRAC_CONST(0.57580819141784534),
- FRAC_CONST(0.57848064346525996),
- FRAC_CONST(0.58114690044973039),
- FRAC_CONST(0.58380693381778626),
- FRAC_CONST(0.58646071508260733),
- FRAC_CONST(0.58910821582432815),
- FRAC_CONST(0.5917494076903429),
- FRAC_CONST(0.5943842623956086),
- FRAC_CONST(0.59701275172294799),
- FRAC_CONST(0.59963484752335228),
- FRAC_CONST(0.60225052171628191),
- FRAC_CONST(0.60485974628996786),
- FRAC_CONST(0.60746249330171098),
- FRAC_CONST(0.61005873487818185),
- FRAC_CONST(0.61264844321571899),
- FRAC_CONST(0.61523159058062682),
- FRAC_CONST(0.61780814930947225),
- FRAC_CONST(0.62037809180938108),
- FRAC_CONST(0.62294139055833397),
- FRAC_CONST(0.6254980181054608),
- FRAC_CONST(0.62804794707133416),
- FRAC_CONST(0.63059115014826372),
- FRAC_CONST(0.63312760010058777),
- FRAC_CONST(0.63565726976496484),
- FRAC_CONST(0.63818013205066515),
- FRAC_CONST(0.64069615993986073),
- FRAC_CONST(0.64320532648791406),
- FRAC_CONST(0.64570760482366729),
- FRAC_CONST(0.64820296814972966),
- FRAC_CONST(0.65069138974276486),
- FRAC_CONST(0.65317284295377676),
- FRAC_CONST(0.65564730120839498),
- FRAC_CONST(0.65811473800715958),
- FRAC_CONST(0.660575126925805),
- FRAC_CONST(0.66302844161554231),
- FRAC_CONST(0.6654746558033422),
- FRAC_CONST(0.66791374329221598),
- FRAC_CONST(0.67034567796149647),
- FRAC_CONST(0.67277043376711676),
- FRAC_CONST(0.67518798474189046),
- FRAC_CONST(0.67759830499578866),
- FRAC_CONST(0.68000136871621808),
- FRAC_CONST(0.68239715016829683),
- FRAC_CONST(0.6847856236951303),
- FRAC_CONST(0.68716676371808583),
- FRAC_CONST(0.68954054473706683),
- FRAC_CONST(0.69190694133078579),
- FRAC_CONST(0.69426592815703603),
- FRAC_CONST(0.69661747995296419),
- FRAC_CONST(0.69896157153533944),
- FRAC_CONST(0.70129817780082437),
- FRAC_CONST(0.7036272737262429),
- FRAC_CONST(0.70594883436884903),
- FRAC_CONST(0.70826283486659336),
- FRAC_CONST(0.71056925043838959),
- FRAC_CONST(0.71286805638437978),
- FRAC_CONST(0.71515922808619936),
- FRAC_CONST(0.71744274100723993),
- FRAC_CONST(0.71971857069291278),
- FRAC_CONST(0.7219866927709101),
- FRAC_CONST(0.72424708295146689),
- FRAC_CONST(0.72649971702762028),
- FRAC_CONST(0.72874457087546896),
- FRAC_CONST(0.73098162045443171),
- FRAC_CONST(0.73321084180750484),
- FRAC_CONST(0.73543221106151868),
- FRAC_CONST(0.73764570442739286),
- FRAC_CONST(0.73985129820039208),
- FRAC_CONST(0.74204896876037885),
- FRAC_CONST(0.7442386925720671),
- FRAC_CONST(0.74642044618527381),
- FRAC_CONST(0.74859420623517081),
- FRAC_CONST(0.75075994944253421),
- FRAC_CONST(0.75291765261399446),
- FRAC_CONST(0.75506729264228367),
- FRAC_CONST(0.75720884650648446),
- FRAC_CONST(0.75934229127227548),
- FRAC_CONST(0.76146760409217706),
- FRAC_CONST(0.76358476220579641),
- FRAC_CONST(0.7656937429400712),
- FRAC_CONST(0.76779452370951196),
- FRAC_CONST(0.76988708201644451),
- FRAC_CONST(0.77197139545125026),
- FRAC_CONST(0.7740474416926072),
- FRAC_CONST(0.77611519850772781),
- FRAC_CONST(0.77817464375259782),
- FRAC_CONST(0.78022575537221317),
- FRAC_CONST(0.78226851140081632),
- FRAC_CONST(0.78430288996213138),
- FRAC_CONST(0.78632886926959822),
- FRAC_CONST(0.78834642762660623),
- FRAC_CONST(0.79035554342672631),
- FRAC_CONST(0.79235619515394229),
- FRAC_CONST(0.79434836138288134),
- FRAC_CONST(0.79633202077904397),
- FRAC_CONST(0.79830715209903147),
- FRAC_CONST(0.8002737341907743),
- FRAC_CONST(0.80223174599375802),
- FRAC_CONST(0.80418116653924954),
- FRAC_CONST(0.80612197495052085),
- FRAC_CONST(0.80805415044307316),
- FRAC_CONST(0.80997767232485907),
- FRAC_CONST(0.81189251999650469),
- FRAC_CONST(0.81379867295152986),
- FRAC_CONST(0.81569611077656778),
- FRAC_CONST(0.81758481315158371),
- FRAC_CONST(0.81946475985009259),
- FRAC_CONST(0.82133593073937561),
- FRAC_CONST(0.82319830578069586),
- FRAC_CONST(0.82505186502951278),
- FRAC_CONST(0.82689658863569615),
- FRAC_CONST(0.82873245684373809),
- FRAC_CONST(0.83055944999296494),
- FRAC_CONST(0.83237754851774781),
- FRAC_CONST(0.83418673294771239),
- FRAC_CONST(0.83598698390794668),
- FRAC_CONST(0.83777828211920935),
- FRAC_CONST(0.83956060839813562),
- FRAC_CONST(0.84133394365744296),
- FRAC_CONST(0.84309826890613537),
- FRAC_CONST(0.84485356524970701),
- FRAC_CONST(0.84659981389034411),
- FRAC_CONST(0.84833699612712676),
- FRAC_CONST(0.85006509335622882),
- FRAC_CONST(0.8517840870711173),
- FRAC_CONST(0.85349395886275037),
- FRAC_CONST(0.85519469041977514),
- FRAC_CONST(0.85688626352872277),
- FRAC_CONST(0.85856866007420429),
- FRAC_CONST(0.86024186203910447),
- FRAC_CONST(0.86190585150477417),
- FRAC_CONST(0.86356061065122347),
- FRAC_CONST(0.86520612175731115),
- FRAC_CONST(0.86684236720093533),
- FRAC_CONST(0.86846932945922151),
- FRAC_CONST(0.87008699110871135),
- FRAC_CONST(0.87169533482554817),
- FRAC_CONST(0.87329434338566281),
- FRAC_CONST(0.87488399966495822),
- FRAC_CONST(0.87646428663949283),
- FRAC_CONST(0.87803518738566277),
- FRAC_CONST(0.87959668508038291),
- FRAC_CONST(0.88114876300126743),
- FRAC_CONST(0.88269140452680916),
- FRAC_CONST(0.8842245931365561),
- FRAC_CONST(0.88574831241129048),
- FRAC_CONST(0.88726254603320276),
- FRAC_CONST(0.88876727778606746),
- FRAC_CONST(0.89026249155541637),
- FRAC_CONST(0.8917481713287112),
- FRAC_CONST(0.89322430119551532),
- FRAC_CONST(0.89469086534766362),
- FRAC_CONST(0.89614784807943237),
- FRAC_CONST(0.89759523378770689),
- FRAC_CONST(0.89903300697214927),
- FRAC_CONST(0.9004611522353636),
- FRAC_CONST(0.90187965428306172),
- FRAC_CONST(0.90328849792422594),
- FRAC_CONST(0.90468766807127299),
- FRAC_CONST(0.90607714974021469),
- FRAC_CONST(0.90745692805081868),
- FRAC_CONST(0.90882698822676755),
- FRAC_CONST(0.91018731559581767),
- FRAC_CONST(0.91153789558995579),
- FRAC_CONST(0.91287871374555518),
- FRAC_CONST(0.91420975570353069),
- FRAC_CONST(0.9155310072094921),
- FRAC_CONST(0.91684245411389753),
- FRAC_CONST(0.91814408237220391),
- FRAC_CONST(0.91943587804501858),
- FRAC_CONST(0.92071782729824769),
- FRAC_CONST(0.92198991640324446),
- FRAC_CONST(0.92325213173695675),
- FRAC_CONST(0.92450445978207241),
- FRAC_CONST(0.92574688712716402),
- FRAC_CONST(0.92697940046683291),
- FRAC_CONST(0.92820198660185149),
- FRAC_CONST(0.92941463243930444),
- FRAC_CONST(0.93061732499272909),
- FRAC_CONST(0.93181005138225426),
- FRAC_CONST(0.93299279883473885),
- FRAC_CONST(0.93416555468390772),
- FRAC_CONST(0.93532830637048769),
- FRAC_CONST(0.93648104144234268),
- FRAC_CONST(0.93762374755460598),
- FRAC_CONST(0.93875641246981323),
- FRAC_CONST(0.93987902405803303),
- FRAC_CONST(0.94099157029699743),
- FRAC_CONST(0.94209403927222979),
- FRAC_CONST(0.94318641917717327),
- FRAC_CONST(0.9442686983133165),
- FRAC_CONST(0.94534086509031956),
- FRAC_CONST(0.9464029080261378),
- FRAC_CONST(0.94745481574714419),
- FRAC_CONST(0.94849657698825252),
- FRAC_CONST(0.94952818059303667),
- FRAC_CONST(0.95054961551385087),
- FRAC_CONST(0.95156087081194762),
- FRAC_CONST(0.95256193565759528),
- FRAC_CONST(0.95355279933019343),
- FRAC_CONST(0.9545334512183884),
- FRAC_CONST(0.95550388082018611),
- FRAC_CONST(0.95646407774306541),
- FRAC_CONST(0.95741403170408834),
- FRAC_CONST(0.95835373253001133),
- FRAC_CONST(0.95928317015739362),
- FRAC_CONST(0.96020233463270466),
- FRAC_CONST(0.96111121611243155),
- FRAC_CONST(0.96200980486318388),
- FRAC_CONST(0.96289809126179782),
- FRAC_CONST(0.96377606579543984),
- FRAC_CONST(0.96464371906170809),
- FRAC_CONST(0.96550104176873297),
- FRAC_CONST(0.96634802473527726),
- FRAC_CONST(0.96718465889083372),
- FRAC_CONST(0.96801093527572268),
- FRAC_CONST(0.96882684504118799),
- FRAC_CONST(0.96963237944949143),
- FRAC_CONST(0.97042752987400682),
- FRAC_CONST(0.97121228779931179),
- FRAC_CONST(0.97198664482127939),
- FRAC_CONST(0.97275059264716823),
- FRAC_CONST(0.97350412309571066),
- FRAC_CONST(0.97424722809720088),
- FRAC_CONST(0.97497989969358168),
- FRAC_CONST(0.97570213003852857),
- FRAC_CONST(0.97641391139753486),
- FRAC_CONST(0.97711523614799412),
- FRAC_CONST(0.97780609677928154),
- FRAC_CONST(0.97848648589283505),
- FRAC_CONST(0.97915639620223371),
- FRAC_CONST(0.9798158205332762),
- FRAC_CONST(0.98046475182405801),
- FRAC_CONST(0.98110318312504607),
- FRAC_CONST(0.98173110759915416),
- FRAC_CONST(0.98234851852181571),
- FRAC_CONST(0.98295540928105563),
- FRAC_CONST(0.9835517733775615),
- FRAC_CONST(0.98413760442475307),
- FRAC_CONST(0.98471289614885038),
- FRAC_CONST(0.98527764238894122),
- FRAC_CONST(0.98583183709704714),
- FRAC_CONST(0.98637547433818806),
- FRAC_CONST(0.98690854829044583),
- FRAC_CONST(0.98743105324502667),
- FRAC_CONST(0.98794298360632238),
- FRAC_CONST(0.98844433389196995),
- FRAC_CONST(0.98893509873291074),
- FRAC_CONST(0.98941527287344755),
- FRAC_CONST(0.98988485117130098),
- FRAC_CONST(0.99034382859766479),
- FRAC_CONST(0.99079220023725967),
- FRAC_CONST(0.99122996128838525),
- FRAC_CONST(0.9916571070629725),
- FRAC_CONST(0.99207363298663342),
- FRAC_CONST(0.99247953459870997),
- FRAC_CONST(0.99287480755232194),
- FRAC_CONST(0.99325944761441354),
- FRAC_CONST(0.99363345066579889),
- FRAC_CONST(0.99399681270120555),
- FRAC_CONST(0.99434952982931812),
- FRAC_CONST(0.9946915982728195),
- FRAC_CONST(0.99502301436843166),
- FRAC_CONST(0.99534377456695422),
- FRAC_CONST(0.9956538754333033),
- FRAC_CONST(0.99595331364654771),
- FRAC_CONST(0.99624208599994479),
- FRAC_CONST(0.99652018940097464),
- FRAC_CONST(0.99678762087137318),
- FRAC_CONST(0.99704437754716424),
- FRAC_CONST(0.99729045667869021),
- FRAC_CONST(0.99752585563064111),
- FRAC_CONST(0.99775057188208349),
- FRAC_CONST(0.9979646030264866),
- FRAC_CONST(0.99816794677174903),
- FRAC_CONST(0.9983606009402225),
- FRAC_CONST(0.99854256346873571),
- FRAC_CONST(0.99871383240861611),
- FRAC_CONST(0.99887440592571108),
- FRAC_CONST(0.99902428230040718),
- FRAC_CONST(0.99916345992764877),
- FRAC_CONST(0.99929193731695531),
- FRAC_CONST(0.99940971309243731),
- FRAC_CONST(0.99951678599281069),
- FRAC_CONST(0.99961315487141078),
- FRAC_CONST(0.99969881869620425),
- FRAC_CONST(0.99977377654980037),
- FRAC_CONST(0.99983802762946083),
- FRAC_CONST(0.99989157124710804),
- FRAC_CONST(0.9999344068293331),
- FRAC_CONST(0.99996653391740109),
- FRAC_CONST(0.99998795216725689),
- FRAC_CONST(0.99999866134952808)
-};
-#endif
-
-ALIGN static const real_t ld_mid_512[] =
-{
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0.0061358846491544753),
- FRAC_CONST(0.01840672990580482),
- FRAC_CONST(0.030674803176636626),
- FRAC_CONST(0.04293825693494082),
- FRAC_CONST(0.055195244349689934),
- FRAC_CONST(0.067443919563664051),
- FRAC_CONST(0.079682437971430126),
- FRAC_CONST(0.091908956497132724),
- FRAC_CONST(0.10412163387205459),
- FRAC_CONST(0.11631863091190475),
- FRAC_CONST(0.12849811079379317),
- FRAC_CONST(0.14065823933284921),
- FRAC_CONST(0.15279718525844344),
- FRAC_CONST(0.16491312048996989),
- FRAC_CONST(0.17700422041214875),
- FRAC_CONST(0.18906866414980619),
- FRAC_CONST(0.2011046348420919),
- FRAC_CONST(0.21311031991609136),
- FRAC_CONST(0.22508391135979283),
- FRAC_CONST(0.2370236059943672),
- FRAC_CONST(0.24892760574572015),
- FRAC_CONST(0.26079411791527551),
- FRAC_CONST(0.27262135544994898),
- FRAC_CONST(0.28440753721127188),
- FRAC_CONST(0.29615088824362379),
- FRAC_CONST(0.30784964004153487),
- FRAC_CONST(0.31950203081601569),
- FRAC_CONST(0.33110630575987643),
- FRAC_CONST(0.34266071731199438),
- FRAC_CONST(0.35416352542049034),
- FRAC_CONST(0.36561299780477385),
- FRAC_CONST(0.37700741021641826),
- FRAC_CONST(0.38834504669882625),
- FRAC_CONST(0.39962419984564679),
- FRAC_CONST(0.41084317105790391),
- FRAC_CONST(0.42200027079979968),
- FRAC_CONST(0.43309381885315196),
- FRAC_CONST(0.4441221445704292),
- FRAC_CONST(0.45508358712634384),
- FRAC_CONST(0.46597649576796618),
- FRAC_CONST(0.47679923006332209),
- FRAC_CONST(0.487550160148436),
- FRAC_CONST(0.49822766697278187),
- FRAC_CONST(0.50883014254310699),
- FRAC_CONST(0.51935599016558964),
- FRAC_CONST(0.52980362468629461),
- FRAC_CONST(0.54017147272989285),
- FRAC_CONST(0.55045797293660481),
- FRAC_CONST(0.56066157619733603),
- FRAC_CONST(0.57078074588696726),
- FRAC_CONST(0.58081395809576453),
- FRAC_CONST(0.59075970185887416),
- FRAC_CONST(0.60061647938386897),
- FRAC_CONST(0.61038280627630948),
- FRAC_CONST(0.6200572117632891),
- FRAC_CONST(0.62963823891492698),
- FRAC_CONST(0.63912444486377573),
- FRAC_CONST(0.64851440102211244),
- FRAC_CONST(0.65780669329707864),
- FRAC_CONST(0.66699992230363747),
- FRAC_CONST(0.67609270357531592),
- FRAC_CONST(0.68508366777270036),
- FRAC_CONST(0.693971460889654),
- FRAC_CONST(0.7027547444572253),
- FRAC_CONST(0.71143219574521643),
- FRAC_CONST(0.72000250796138165),
- FRAC_CONST(0.7284643904482252),
- FRAC_CONST(0.73681656887736979),
- FRAC_CONST(0.74505778544146595),
- FRAC_CONST(0.75318679904361241),
- FRAC_CONST(0.76120238548426178),
- FRAC_CONST(0.76910333764557959),
- FRAC_CONST(0.77688846567323244),
- FRAC_CONST(0.78455659715557524),
- FRAC_CONST(0.79210657730021239),
- FRAC_CONST(0.79953726910790501),
- FRAC_CONST(0.80684755354379922),
- FRAC_CONST(0.8140363297059483),
- FRAC_CONST(0.82110251499110465),
- FRAC_CONST(0.8280450452577558),
- FRAC_CONST(0.83486287498638001),
- FRAC_CONST(0.84155497743689833),
- FRAC_CONST(0.84812034480329712),
- FRAC_CONST(0.85455798836540053),
- FRAC_CONST(0.86086693863776731),
- FRAC_CONST(0.86704624551569265),
- FRAC_CONST(0.87309497841829009),
- FRAC_CONST(0.87901222642863341),
- FRAC_CONST(0.88479709843093779),
- FRAC_CONST(0.89044872324475788),
- FRAC_CONST(0.89596624975618511),
- FRAC_CONST(0.90134884704602203),
- FRAC_CONST(0.90659570451491533),
- FRAC_CONST(0.91170603200542988),
- FRAC_CONST(0.9166790599210427),
- FRAC_CONST(0.9215140393420419),
- FRAC_CONST(0.92621024213831127),
- FRAC_CONST(0.93076696107898371),
- FRAC_CONST(0.9351835099389475),
- FRAC_CONST(0.93945922360218992),
- FRAC_CONST(0.94359345816196039),
- FRAC_CONST(0.94758559101774109),
- FRAC_CONST(0.95143502096900834),
- FRAC_CONST(0.95514116830577067),
- FRAC_CONST(0.9587034748958716),
- FRAC_CONST(0.96212140426904158),
- FRAC_CONST(0.9653944416976894),
- FRAC_CONST(0.96852209427441727),
- FRAC_CONST(0.97150389098625178),
- FRAC_CONST(0.97433938278557586),
- FRAC_CONST(0.97702814265775439),
- FRAC_CONST(0.97956976568544052),
- FRAC_CONST(0.98196386910955524),
- FRAC_CONST(0.98421009238692903),
- FRAC_CONST(0.98630809724459867),
- FRAC_CONST(0.98825756773074946),
- FRAC_CONST(0.99005821026229712),
- FRAC_CONST(0.99170975366909953),
- FRAC_CONST(0.9932119492347945),
- FRAC_CONST(0.99456457073425542),
- FRAC_CONST(0.99576741446765982),
- FRAC_CONST(0.99682029929116567),
- FRAC_CONST(0.99772306664419164),
- FRAC_CONST(0.99847558057329477),
- FRAC_CONST(0.99907772775264536),
- FRAC_CONST(0.99952941750109314),
- FRAC_CONST(0.9998305817958234),
- FRAC_CONST(0.99998117528260111),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1)
-};
-
-#ifdef ALLOW_SMALL_FRAMELENGTH
-ALIGN static const real_t ld_mid_480[] =
-{
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0),
- FRAC_CONST(0.0065449379673518581),
- FRAC_CONST(0.019633692460628301),
- FRAC_CONST(0.032719082821776137),
- FRAC_CONST(0.045798866936520771),
- FRAC_CONST(0.058870803651189033),
- FRAC_CONST(0.071932653156719387),
- FRAC_CONST(0.084982177372441667),
- FRAC_CONST(0.09801714032956059),
- FRAC_CONST(0.11103530855427769),
- FRAC_CONST(0.12403445145048532),
- FRAC_CONST(0.13701234168196802),
- FRAC_CONST(0.14996675555404498),
- FRAC_CONST(0.16289547339458874),
- FRAC_CONST(0.17579627993435451),
- FRAC_CONST(0.18866696468655525),
- FRAC_CONST(0.2015053223256171),
- FRAC_CONST(0.21430915306505074),
- FRAC_CONST(0.2270762630343732),
- FRAC_CONST(0.23980446465501654),
- FRAC_CONST(0.25249157701515795),
- FRAC_CONST(0.26513542624340797),
- FRAC_CONST(0.27773384588129219),
- FRAC_CONST(0.29028467725446233),
- FRAC_CONST(0.3027857698425746),
- FRAC_CONST(0.31523498164776964),
- FRAC_CONST(0.32763017956169349),
- FRAC_CONST(0.33996923973099424),
- FRAC_CONST(0.35225004792123354),
- FRAC_CONST(0.36447049987914965),
- FRAC_CONST(0.37662850169321077),
- FRAC_CONST(0.38872197015239557),
- FRAC_CONST(0.40074883310314097),
- FRAC_CONST(0.41270702980439467),
- FRAC_CONST(0.42459451128071307),
- FRAC_CONST(0.43640924067334208),
- FRAC_CONST(0.44814919358922256),
- FRAC_CONST(0.45981235844785984),
- FRAC_CONST(0.47139673682599764),
- FRAC_CONST(0.48290034380003727),
- FRAC_CONST(0.49432120828614462),
- FRAC_CONST(0.50565737337798455),
- FRAC_CONST(0.51690689668202761),
- FRAC_CONST(0.52806785065036799),
- FRAC_CONST(0.53913832291100017),
- FRAC_CONST(0.55011641659549337),
- FRAC_CONST(0.56100025066400983),
- FRAC_CONST(0.57178796022761225),
- FRAC_CONST(0.58247769686780215),
- FRAC_CONST(0.59306762895323706),
- FRAC_CONST(0.60355594195357143),
- FRAC_CONST(0.61394083875036642),
- FRAC_CONST(0.62422053994501758),
- FRAC_CONST(0.63439328416364549),
- FRAC_CONST(0.64445732835889735),
- FRAC_CONST(0.65441094810861034),
- FRAC_CONST(0.66425243791128175),
- FRAC_CONST(0.67398011147829784),
- FRAC_CONST(0.68359230202287125),
- FRAC_CONST(0.69308736254563585),
- FRAC_CONST(0.70246366611685174),
- FRAC_CONST(0.71171960615517138),
- FRAC_CONST(0.72085359670291882),
- FRAC_CONST(0.7298640726978356),
- FRAC_CONST(0.73874949024124625),
- FRAC_CONST(0.74750832686259672),
- FRAC_CONST(0.75613908178032285),
- FRAC_CONST(0.76464027615900032),
- FRAC_CONST(0.77301045336273699),
- FRAC_CONST(0.78124817920475853),
- FRAC_CONST(0.78935204219315003),
- FRAC_CONST(0.79732065377270711),
- FRAC_CONST(0.80515264856285829),
- FRAC_CONST(0.81284668459161513),
- FRAC_CONST(0.82040144352551359),
- FRAC_CONST(0.82781563089550203),
- FRAC_CONST(0.83508797631874299),
- FRAC_CONST(0.84221723371628654),
- FRAC_CONST(0.84920218152657889),
- FRAC_CONST(0.85604162291477137),
- FRAC_CONST(0.86273438597779184),
- FRAC_CONST(0.86927932394514362),
- FRAC_CONST(0.87567531537539967),
- FRAC_CONST(0.88192126434835494),
- FRAC_CONST(0.88801610065280734),
- FRAC_CONST(0.89395877996993212),
- FRAC_CONST(0.8997482840522214),
- FRAC_CONST(0.90538362089795521),
- FRAC_CONST(0.91086382492117568),
- FRAC_CONST(0.91618795711713596),
- FRAC_CONST(0.92135510522319242),
- FRAC_CONST(0.9263643838751181),
- FRAC_CONST(0.93121493475880346),
- FRAC_CONST(0.93590592675732565),
- FRAC_CONST(0.94043655609335486),
- FRAC_CONST(0.94480604646687805),
- FRAC_CONST(0.94901364918821385),
- FRAC_CONST(0.95305864330629697),
- FRAC_CONST(0.95694033573220882),
- FRAC_CONST(0.9606580613579353),
- FRAC_CONST(0.96421118317032928),
- FRAC_CONST(0.96759909236025976),
- FRAC_CONST(0.9708212084269281),
- FRAC_CONST(0.97387697927733363),
- FRAC_CONST(0.97676588132087239),
- FRAC_CONST(0.97948741955905139),
- FRAC_CONST(0.98204112767030394),
- FRAC_CONST(0.98442656808989171),
- FRAC_CONST(0.98664333208487898),
- FRAC_CONST(0.98869103982416728),
- FRAC_CONST(0.99056934044357725),
- FRAC_CONST(0.99227791210596705),
- FRAC_CONST(0.99381646205637808),
- FRAC_CONST(0.99518472667219682),
- FRAC_CONST(0.99638247150832537),
- FRAC_CONST(0.99740949133735191),
- FRAC_CONST(0.99826561018471593),
- FRAC_CONST(0.99895068135886012),
- FRAC_CONST(0.99946458747636568),
- FRAC_CONST(0.99980724048206482),
- FRAC_CONST(0.99997858166412923),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1)
-};
-#endif
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/libfaad/specrec.c b/src/libfaad/specrec.c
deleted file mode 100644
index fd4b0653c..000000000
--- a/src/libfaad/specrec.c
+++ /dev/null
@@ -1,1241 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: specrec.c,v 1.10 2006/06/17 20:43:57 dgp85 Exp $
-**/
-
-/*
- Spectral reconstruction:
- - grouping/sectioning
- - inverse quantization
- - applying scalefactors
-*/
-
-#include "common.h"
-#include "structs.h"
-
-#include <string.h>
-#include <stdlib.h>
-#include "specrec.h"
-#include "filtbank.h"
-#include "syntax.h"
-#include "iq_table.h"
-#include "ms.h"
-#include "is.h"
-#include "pns.h"
-#include "tns.h"
-#include "drc.h"
-#include "lt_predict.h"
-#include "ic_predict.h"
-#ifdef SSR_DEC
-#include "ssr.h"
-#include "ssr_fb.h"
-#endif
-
-
-/* static function declarations */
-static uint8_t quant_to_spec(NeAACDecHandle hDecoder,
- ic_stream *ics, int16_t *quant_data,
- real_t *spec_data, uint16_t frame_len);
-
-
-#ifdef LD_DEC
-ALIGN static const uint8_t num_swb_512_window[] =
-{
- 0, 0, 0, 36, 36, 37, 31, 31, 0, 0, 0, 0
-};
-ALIGN static const uint8_t num_swb_480_window[] =
-{
- 0, 0, 0, 35, 35, 37, 30, 30, 0, 0, 0, 0
-};
-#endif
-
-ALIGN static const uint8_t num_swb_960_window[] =
-{
- 40, 40, 45, 49, 49, 49, 46, 46, 42, 42, 42, 40
-};
-
-ALIGN static const uint8_t num_swb_1024_window[] =
-{
- 41, 41, 47, 49, 49, 51, 47, 47, 43, 43, 43, 40
-};
-
-ALIGN static const uint8_t num_swb_128_window[] =
-{
- 12, 12, 12, 14, 14, 14, 15, 15, 15, 15, 15, 15
-};
-
-ALIGN static const uint16_t swb_offset_1024_96[] =
-{
- 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56,
- 64, 72, 80, 88, 96, 108, 120, 132, 144, 156, 172, 188, 212, 240,
- 276, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960, 1024
-};
-
-ALIGN static const uint16_t swb_offset_128_96[] =
-{
- 0, 4, 8, 12, 16, 20, 24, 32, 40, 48, 64, 92, 128
-};
-
-ALIGN static const uint16_t swb_offset_1024_64[] =
-{
- 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56,
- 64, 72, 80, 88, 100, 112, 124, 140, 156, 172, 192, 216, 240, 268,
- 304, 344, 384, 424, 464, 504, 544, 584, 624, 664, 704, 744, 784, 824,
- 864, 904, 944, 984, 1024
-};
-
-ALIGN static const uint16_t swb_offset_128_64[] =
-{
- 0, 4, 8, 12, 16, 20, 24, 32, 40, 48, 64, 92, 128
-};
-
-ALIGN static const uint16_t swb_offset_1024_48[] =
-{
- 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 48, 56, 64, 72,
- 80, 88, 96, 108, 120, 132, 144, 160, 176, 196, 216, 240, 264, 292,
- 320, 352, 384, 416, 448, 480, 512, 544, 576, 608, 640, 672, 704, 736,
- 768, 800, 832, 864, 896, 928, 1024
-};
-
-#ifdef LD_DEC
-ALIGN static const uint16_t swb_offset_512_48[] =
-{
- 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 68, 76, 84,
- 92, 100, 112, 124, 136, 148, 164, 184, 208, 236, 268, 300, 332, 364, 396,
- 428, 460, 512
-};
-
-ALIGN static const uint16_t swb_offset_480_48[] =
-{
- 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 64, 72 ,80 ,88,
- 96, 108, 120, 132, 144, 156, 172, 188, 212, 240, 272, 304, 336, 368, 400,
- 432, 480
-};
-#endif
-
-ALIGN static const uint16_t swb_offset_128_48[] =
-{
- 0, 4, 8, 12, 16, 20, 28, 36, 44, 56, 68, 80, 96, 112, 128
-};
-
-ALIGN static const uint16_t swb_offset_1024_32[] =
-{
- 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 48, 56, 64, 72,
- 80, 88, 96, 108, 120, 132, 144, 160, 176, 196, 216, 240, 264, 292,
- 320, 352, 384, 416, 448, 480, 512, 544, 576, 608, 640, 672, 704, 736,
- 768, 800, 832, 864, 896, 928, 960, 992, 1024
-};
-
-#ifdef LD_DEC
-ALIGN static const uint16_t swb_offset_512_32[] =
-{
- 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 64, 72, 80,
- 88, 96, 108, 120, 132, 144, 160, 176, 192, 212, 236, 260, 288, 320, 352,
- 384, 416, 448, 480, 512
-};
-
-ALIGN static const uint16_t swb_offset_480_32[] =
-{
- 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 72, 80,
- 88, 96, 104, 112, 124, 136, 148, 164, 180, 200, 224, 256, 288, 320, 352,
- 384, 416, 448, 480
-};
-#endif
-
-ALIGN static const uint16_t swb_offset_1024_24[] =
-{
- 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 52, 60, 68,
- 76, 84, 92, 100, 108, 116, 124, 136, 148, 160, 172, 188, 204, 220,
- 240, 260, 284, 308, 336, 364, 396, 432, 468, 508, 552, 600, 652, 704,
- 768, 832, 896, 960, 1024
-};
-
-#ifdef LD_DEC
-ALIGN static const uint16_t swb_offset_512_24[] =
-{
- 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 52, 60, 68,
- 80, 92, 104, 120, 140, 164, 192, 224, 256, 288, 320, 352, 384, 416,
- 448, 480, 512
-};
-
-ALIGN static const uint16_t swb_offset_480_24[] =
-{
- 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 52, 60, 68, 80, 92, 104, 120,
- 140, 164, 192, 224, 256, 288, 320, 352, 384, 416, 448, 480
-};
-#endif
-
-ALIGN static const uint16_t swb_offset_128_24[] =
-{
- 0, 4, 8, 12, 16, 20, 24, 28, 36, 44, 52, 64, 76, 92, 108, 128
-};
-
-ALIGN static const uint16_t swb_offset_1024_16[] =
-{
- 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 100, 112, 124,
- 136, 148, 160, 172, 184, 196, 212, 228, 244, 260, 280, 300, 320, 344,
- 368, 396, 424, 456, 492, 532, 572, 616, 664, 716, 772, 832, 896, 960, 1024
-};
-
-ALIGN static const uint16_t swb_offset_128_16[] =
-{
- 0, 4, 8, 12, 16, 20, 24, 28, 32, 40, 48, 60, 72, 88, 108, 128
-};
-
-ALIGN static const uint16_t swb_offset_1024_8[] =
-{
- 0, 12, 24, 36, 48, 60, 72, 84, 96, 108, 120, 132, 144, 156, 172,
- 188, 204, 220, 236, 252, 268, 288, 308, 328, 348, 372, 396, 420, 448,
- 476, 508, 544, 580, 620, 664, 712, 764, 820, 880, 944, 1024
-};
-
-ALIGN static const uint16_t swb_offset_128_8[] =
-{
- 0, 4, 8, 12, 16, 20, 24, 28, 36, 44, 52, 60, 72, 88, 108, 128
-};
-
-ALIGN static const uint16_t *swb_offset_1024_window[] =
-{
- swb_offset_1024_96, /* 96000 */
- swb_offset_1024_96, /* 88200 */
- swb_offset_1024_64, /* 64000 */
- swb_offset_1024_48, /* 48000 */
- swb_offset_1024_48, /* 44100 */
- swb_offset_1024_32, /* 32000 */
- swb_offset_1024_24, /* 24000 */
- swb_offset_1024_24, /* 22050 */
- swb_offset_1024_16, /* 16000 */
- swb_offset_1024_16, /* 12000 */
- swb_offset_1024_16, /* 11025 */
- swb_offset_1024_8 /* 8000 */
-};
-
-#ifdef LD_DEC
-ALIGN static const uint16_t *swb_offset_512_window[] =
-{
- 0, /* 96000 */
- 0, /* 88200 */
- 0, /* 64000 */
- swb_offset_512_48, /* 48000 */
- swb_offset_512_48, /* 44100 */
- swb_offset_512_32, /* 32000 */
- swb_offset_512_24, /* 24000 */
- swb_offset_512_24, /* 22050 */
- 0, /* 16000 */
- 0, /* 12000 */
- 0, /* 11025 */
- 0 /* 8000 */
-};
-
-ALIGN static const uint16_t *swb_offset_480_window[] =
-{
- 0, /* 96000 */
- 0, /* 88200 */
- 0, /* 64000 */
- swb_offset_480_48, /* 48000 */
- swb_offset_480_48, /* 44100 */
- swb_offset_480_32, /* 32000 */
- swb_offset_480_24, /* 24000 */
- swb_offset_480_24, /* 22050 */
- 0, /* 16000 */
- 0, /* 12000 */
- 0, /* 11025 */
- 0 /* 8000 */
-};
-#endif
-
-ALIGN static const uint16_t *swb_offset_128_window[] =
-{
- swb_offset_128_96, /* 96000 */
- swb_offset_128_96, /* 88200 */
- swb_offset_128_64, /* 64000 */
- swb_offset_128_48, /* 48000 */
- swb_offset_128_48, /* 44100 */
- swb_offset_128_48, /* 32000 */
- swb_offset_128_24, /* 24000 */
- swb_offset_128_24, /* 22050 */
- swb_offset_128_16, /* 16000 */
- swb_offset_128_16, /* 12000 */
- swb_offset_128_16, /* 11025 */
- swb_offset_128_8 /* 8000 */
-};
-
-#define bit_set(A, B) ((A) & (1<<(B)))
-
-/* 4.5.2.3.4 */
-/*
- - determine the number of windows in a window_sequence named num_windows
- - determine the number of window_groups named num_window_groups
- - determine the number of windows in each group named window_group_length[g]
- - determine the total number of scalefactor window bands named num_swb for
- the actual window type
- - determine swb_offset[swb], the offset of the first coefficient in
- scalefactor window band named swb of the window actually used
- - determine sect_sfb_offset[g][section],the offset of the first coefficient
- in section named section. This offset depends on window_sequence and
- scale_factor_grouping and is needed to decode the spectral_data().
-*/
-uint8_t window_grouping_info(NeAACDecHandle hDecoder, ic_stream *ics)
-{
- uint8_t i, g;
-
- uint8_t sf_index = hDecoder->sf_index;
-
- switch (ics->window_sequence) {
- case ONLY_LONG_SEQUENCE:
- case LONG_START_SEQUENCE:
- case LONG_STOP_SEQUENCE:
- ics->num_windows = 1;
- ics->num_window_groups = 1;
- ics->window_group_length[ics->num_window_groups-1] = 1;
-#ifdef LD_DEC
- if (hDecoder->object_type == LD)
- {
- if (hDecoder->frameLength == 512)
- ics->num_swb = num_swb_512_window[sf_index];
- else /* if (hDecoder->frameLength == 480) */
- ics->num_swb = num_swb_480_window[sf_index];
- } else {
-#endif
- if (hDecoder->frameLength == 1024)
- ics->num_swb = num_swb_1024_window[sf_index];
- else /* if (hDecoder->frameLength == 960) */
- ics->num_swb = num_swb_960_window[sf_index];
-#ifdef LD_DEC
- }
-#endif
-
- /* preparation of sect_sfb_offset for long blocks */
- /* also copy the last value! */
-#ifdef LD_DEC
- if (hDecoder->object_type == LD)
- {
- if (hDecoder->frameLength == 512)
- {
- for (i = 0; i < ics->num_swb; i++)
- {
- ics->sect_sfb_offset[0][i] = swb_offset_512_window[sf_index][i];
- ics->swb_offset[i] = swb_offset_512_window[sf_index][i];
- }
- } else /* if (hDecoder->frameLength == 480) */ {
- for (i = 0; i < ics->num_swb; i++)
- {
- ics->sect_sfb_offset[0][i] = swb_offset_480_window[sf_index][i];
- ics->swb_offset[i] = swb_offset_480_window[sf_index][i];
- }
- }
- ics->sect_sfb_offset[0][ics->num_swb] = hDecoder->frameLength;
- ics->swb_offset[ics->num_swb] = hDecoder->frameLength;
- } else {
-#endif
- for (i = 0; i < ics->num_swb; i++)
- {
- ics->sect_sfb_offset[0][i] = swb_offset_1024_window[sf_index][i];
- ics->swb_offset[i] = swb_offset_1024_window[sf_index][i];
- }
- ics->sect_sfb_offset[0][ics->num_swb] = hDecoder->frameLength;
- ics->swb_offset[ics->num_swb] = hDecoder->frameLength;
-#ifdef LD_DEC
- }
-#endif
- return 0;
- case EIGHT_SHORT_SEQUENCE:
- ics->num_windows = 8;
- ics->num_window_groups = 1;
- ics->window_group_length[ics->num_window_groups-1] = 1;
- ics->num_swb = num_swb_128_window[sf_index];
-
- for (i = 0; i < ics->num_swb; i++)
- ics->swb_offset[i] = swb_offset_128_window[sf_index][i];
- ics->swb_offset[ics->num_swb] = hDecoder->frameLength/8;
-
- for (i = 0; i < ics->num_windows-1; i++) {
- if (bit_set(ics->scale_factor_grouping, 6-i) == 0)
- {
- ics->num_window_groups += 1;
- ics->window_group_length[ics->num_window_groups-1] = 1;
- } else {
- ics->window_group_length[ics->num_window_groups-1] += 1;
- }
- }
-
- /* preparation of sect_sfb_offset for short blocks */
- for (g = 0; g < ics->num_window_groups; g++)
- {
- uint16_t width;
- uint8_t sect_sfb = 0;
- uint16_t offset = 0;
-
- for (i = 0; i < ics->num_swb; i++)
- {
- if (i+1 == ics->num_swb)
- {
- width = (hDecoder->frameLength/8) - swb_offset_128_window[sf_index][i];
- } else {
- width = swb_offset_128_window[sf_index][i+1] -
- swb_offset_128_window[sf_index][i];
- }
- width *= ics->window_group_length[g];
- ics->sect_sfb_offset[g][sect_sfb++] = offset;
- offset += width;
- }
- ics->sect_sfb_offset[g][sect_sfb] = offset;
- }
- return 0;
- default:
- return 1;
- }
-}
-
-/* iquant() *
-/* output = sign(input)*abs(input)^(4/3) */
-/**/
-static INLINE real_t iquant(int16_t q, const real_t *tab, uint8_t *error)
-{
-#ifdef FIXED_POINT
-/* For FIXED_POINT the iq_table is prescaled by 3 bits (iq_table[]/8) */
-/* BIG_IQ_TABLE allows you to use the full 8192 value table, if this is not
- * defined a 1026 value table and interpolation will be used
- */
-#ifndef BIG_IQ_TABLE
- static const real_t errcorr[] = {
- REAL_CONST(0), REAL_CONST(1.0/8.0), REAL_CONST(2.0/8.0), REAL_CONST(3.0/8.0),
- REAL_CONST(4.0/8.0), REAL_CONST(5.0/8.0), REAL_CONST(6.0/8.0), REAL_CONST(7.0/8.0),
- REAL_CONST(0)
- };
- real_t x1, x2;
-#endif
- int16_t sgn = 1;
-
- if (q < 0)
- {
- q = -q;
- sgn = -1;
- }
-
- if (q < IQ_TABLE_SIZE)
- {
-//#define IQUANT_PRINT
-#ifdef IQUANT_PRINT
- //printf("0x%.8X\n", sgn * tab[q]);
- printf("%d\n", sgn * tab[q]);
-#endif
- return sgn * tab[q];
- }
-
-#ifndef BIG_IQ_TABLE
- if (q >= 8192)
- {
- *error = 17;
- return 0;
- }
-
- /* linear interpolation */
- x1 = tab[q>>3];
- x2 = tab[(q>>3) + 1];
- return sgn * 16 * (MUL_R(errcorr[q&7],(x2-x1)) + x1);
-#else
- *error = 17;
- return 0;
-#endif
-
-#else
- if (q < 0)
- {
- /* tab contains a value for all possible q [0,8192] */
- if (-q < IQ_TABLE_SIZE)
- return -tab[-q];
-
- *error = 17;
- return 0;
- } else {
- /* tab contains a value for all possible q [0,8192] */
- if (q < IQ_TABLE_SIZE)
- return tab[q];
-
- *error = 17;
- return 0;
- }
-#endif
-}
-
-#ifndef FIXED_POINT
-ALIGN static const real_t pow2sf_tab[] = {
- 2.9802322387695313E-008, 5.9604644775390625E-008, 1.1920928955078125E-007,
- 2.384185791015625E-007, 4.76837158203125E-007, 9.5367431640625E-007,
- 1.9073486328125E-006, 3.814697265625E-006, 7.62939453125E-006,
- 1.52587890625E-005, 3.0517578125E-005, 6.103515625E-005,
- 0.0001220703125, 0.000244140625, 0.00048828125,
- 0.0009765625, 0.001953125, 0.00390625,
- 0.0078125, 0.015625, 0.03125,
- 0.0625, 0.125, 0.25,
- 0.5, 1.0, 2.0,
- 4.0, 8.0, 16.0, 32.0,
- 64.0, 128.0, 256.0,
- 512.0, 1024.0, 2048.0,
- 4096.0, 8192.0, 16384.0,
- 32768.0, 65536.0, 131072.0,
- 262144.0, 524288.0, 1048576.0,
- 2097152.0, 4194304.0, 8388608.0,
- 16777216.0, 33554432.0, 67108864.0,
- 134217728.0, 268435456.0, 536870912.0,
- 1073741824.0, 2147483648.0, 4294967296.0,
- 8589934592.0, 17179869184.0, 34359738368.0,
- 68719476736.0, 137438953472.0, 274877906944.0
-};
-#endif
-
-/* quant_to_spec: perform dequantisation and scaling
- * and in case of short block it also does the deinterleaving
- */
-/*
- For ONLY_LONG_SEQUENCE windows (num_window_groups = 1,
- window_group_length[0] = 1) the spectral data is in ascending spectral
- order.
- For the EIGHT_SHORT_SEQUENCE window, the spectral order depends on the
- grouping in the following manner:
- - Groups are ordered sequentially
- - Within a group, a scalefactor band consists of the spectral data of all
- grouped SHORT_WINDOWs for the associated scalefactor window band. To
- clarify via example, the length of a group is in the range of one to eight
- SHORT_WINDOWs.
- - If there are eight groups each with length one (num_window_groups = 8,
- window_group_length[0..7] = 1), the result is a sequence of eight spectra,
- each in ascending spectral order.
- - If there is only one group with length eight (num_window_groups = 1,
- window_group_length[0] = 8), the result is that spectral data of all eight
- SHORT_WINDOWs is interleaved by scalefactor window bands.
- - Within a scalefactor window band, the coefficients are in ascending
- spectral order.
-*/
-static uint8_t quant_to_spec(NeAACDecHandle hDecoder,
- ic_stream *ics, int16_t *quant_data,
- real_t *spec_data, uint16_t frame_len)
-{
- ALIGN static const real_t pow2_table[] =
- {
- COEF_CONST(1.0),
- COEF_CONST(1.1892071150027210667174999705605), /* 2^0.25 */
- COEF_CONST(1.4142135623730950488016887242097), /* 2^0.5 */
- COEF_CONST(1.6817928305074290860622509524664) /* 2^0.75 */
- };
- const real_t *tab = iq_table;
-
- uint8_t g, sfb, win;
- uint16_t width, bin, k, gindex, wa, wb;
- uint8_t error = 0; /* Init error flag */
-#ifndef FIXED_POINT
- real_t scf;
-#endif
-
- k = 0;
- gindex = 0;
-
- for (g = 0; g < ics->num_window_groups; g++)
- {
- uint16_t j = 0;
- uint16_t gincrease = 0;
- uint16_t win_inc = ics->swb_offset[ics->num_swb];
-
- for (sfb = 0; sfb < ics->num_swb; sfb++)
- {
- int32_t exp, frac;
-
- width = ics->swb_offset[sfb+1] - ics->swb_offset[sfb];
-
- /* this could be scalefactor for IS or PNS, those can be negative or bigger then 255 */
- /* just ignore them */
- if (ics->scale_factors[g][sfb] < 0 || ics->scale_factors[g][sfb] > 255)
- {
- exp = 0;
- frac = 0;
- } else {
- /* ics->scale_factors[g][sfb] must be between 0 and 255 */
- exp = (ics->scale_factors[g][sfb] /* - 100 */) >> 2;
- /* frac must always be > 0 */
- frac = (ics->scale_factors[g][sfb] /* - 100 */) & 3;
- }
-
-#ifdef FIXED_POINT
- exp -= 25;
- /* IMDCT pre-scaling */
- if (hDecoder->object_type == LD)
- {
- exp -= 6 /*9*/;
- } else {
- if (ics->window_sequence == EIGHT_SHORT_SEQUENCE)
- exp -= 4 /*7*/;
- else
- exp -= 7 /*10*/;
- }
-#endif
-
- wa = gindex + j;
-
-#ifndef FIXED_POINT
- scf = pow2sf_tab[exp/*+25*/] * pow2_table[frac];
-#endif
-
- for (win = 0; win < ics->window_group_length[g]; win++)
- {
- for (bin = 0; bin < width; bin += 4)
- {
-#ifndef FIXED_POINT
- wb = wa + bin;
-
- spec_data[wb+0] = iquant(quant_data[k+0], tab, &error) * scf;
- spec_data[wb+1] = iquant(quant_data[k+1], tab, &error) * scf;
- spec_data[wb+2] = iquant(quant_data[k+2], tab, &error) * scf;
- spec_data[wb+3] = iquant(quant_data[k+3], tab, &error) * scf;
-
-#else
- real_t iq0 = iquant(quant_data[k+0], tab, &error);
- real_t iq1 = iquant(quant_data[k+1], tab, &error);
- real_t iq2 = iquant(quant_data[k+2], tab, &error);
- real_t iq3 = iquant(quant_data[k+3], tab, &error);
-
- wb = wa + bin;
-
- if (exp < 0)
- {
- spec_data[wb+0] = iq0 >>= -exp;
- spec_data[wb+1] = iq1 >>= -exp;
- spec_data[wb+2] = iq2 >>= -exp;
- spec_data[wb+3] = iq3 >>= -exp;
- } else {
- spec_data[wb+0] = iq0 <<= exp;
- spec_data[wb+1] = iq1 <<= exp;
- spec_data[wb+2] = iq2 <<= exp;
- spec_data[wb+3] = iq3 <<= exp;
- }
- if (frac != 0)
- {
- spec_data[wb+0] = MUL_C(spec_data[wb+0],pow2_table[frac]);
- spec_data[wb+1] = MUL_C(spec_data[wb+1],pow2_table[frac]);
- spec_data[wb+2] = MUL_C(spec_data[wb+2],pow2_table[frac]);
- spec_data[wb+3] = MUL_C(spec_data[wb+3],pow2_table[frac]);
- }
-
-//#define SCFS_PRINT
-#ifdef SCFS_PRINT
- printf("%d\n", spec_data[gindex+(win*win_inc)+j+bin+0]);
- printf("%d\n", spec_data[gindex+(win*win_inc)+j+bin+1]);
- printf("%d\n", spec_data[gindex+(win*win_inc)+j+bin+2]);
- printf("%d\n", spec_data[gindex+(win*win_inc)+j+bin+3]);
- //printf("0x%.8X\n", spec_data[gindex+(win*win_inc)+j+bin+0]);
- //printf("0x%.8X\n", spec_data[gindex+(win*win_inc)+j+bin+1]);
- //printf("0x%.8X\n", spec_data[gindex+(win*win_inc)+j+bin+2]);
- //printf("0x%.8X\n", spec_data[gindex+(win*win_inc)+j+bin+3]);
-#endif
-#endif
-
- gincrease += 4;
- k += 4;
- }
- wa += win_inc;
- }
- j += width;
- }
- gindex += gincrease;
- }
-
- return error;
-}
-
-static uint8_t allocate_single_channel(NeAACDecHandle hDecoder, uint8_t channel,
- uint8_t output_channels)
-{
- uint8_t mul = 1;
-
-#ifdef MAIN_DEC
- /* MAIN object type prediction */
- if (hDecoder->object_type == MAIN)
- {
- hDecoder->pred_stat[channel] = (pred_state*)realloc(hDecoder->pred_stat[channel], hDecoder->frameLength * sizeof(pred_state));
- reset_all_predictors(hDecoder->pred_stat[channel], hDecoder->frameLength);
- }
-#endif
-
-#ifdef LTP_DEC
- if (is_ltp_ot(hDecoder->object_type))
- {
- hDecoder->lt_pred_stat[channel] = (int16_t*)realloc(hDecoder->lt_pred_stat[channel], hDecoder->frameLength*4 * sizeof(int16_t));
- memset(hDecoder->lt_pred_stat[channel], 0, hDecoder->frameLength*4 * sizeof(int16_t));
- }
-#endif
-
- mul = 1;
-#ifdef SBR_DEC
- hDecoder->sbr_alloced[hDecoder->fr_ch_ele] = 0;
- if ((hDecoder->sbr_present_flag == 1) || (hDecoder->forceUpSampling == 1))
- {
- /* SBR requires 2 times as much output data */
- mul = 2;
- hDecoder->sbr_alloced[hDecoder->fr_ch_ele] = 1;
- }
-#endif
- hDecoder->time_out[channel] = (real_t*)realloc(hDecoder->time_out[channel], mul*hDecoder->frameLength*sizeof(real_t));
- memset(hDecoder->time_out[channel], 0, mul*hDecoder->frameLength*sizeof(real_t));
-#if (defined(PS_DEC) || defined(DRM_PS))
- if (output_channels == 2)
- {
- hDecoder->time_out[channel+1] = (real_t*)realloc(hDecoder->time_out[channel+1], mul*hDecoder->frameLength*sizeof(real_t));
- memset(hDecoder->time_out[channel+1], 0, mul*hDecoder->frameLength*sizeof(real_t));
- }
-#endif
-
- hDecoder->fb_intermed[channel] = (real_t*)realloc(hDecoder->fb_intermed[channel], hDecoder->frameLength*sizeof(real_t));
- memset(hDecoder->fb_intermed[channel], 0, hDecoder->frameLength*sizeof(real_t));
-
-#ifdef SSR_DEC
- if (hDecoder->object_type == SSR)
- {
- uint16_t k;
- hDecoder->ssr_overlap[channel] = (real_t*)realloc(hDecoder->ssr_overlap[channel], 2*hDecoder->frameLength*sizeof(real_t));
- memset(hDecoder->ssr_overlap[channel], 0, 2*hDecoder->frameLength*sizeof(real_t));
- hDecoder->prev_fmd[channel] = (real_t*)realloc(hDecoder->prev_fmd[channel], 2*hDecoder->frameLength*sizeof(real_t));
- for (k = 0; k < 2*hDecoder->frameLength; k++)
- hDecoder->prev_fmd[channel][k] = REAL_CONST(-1);
- }
-#endif
-
- return 0;
-}
-
-static uint8_t allocate_channel_pair(NeAACDecHandle hDecoder,
- uint8_t channel, uint8_t paired_channel)
-{
- uint8_t mul = 1;
-
-#ifdef MAIN_DEC
- /* MAIN object type prediction */
- if (hDecoder->object_type == MAIN)
- {
- /* allocate the state only when needed */
- if (hDecoder->pred_stat[channel] == NULL)
- {
- hDecoder->pred_stat[channel] = (pred_state*)faad_malloc(hDecoder->frameLength * sizeof(pred_state));
- reset_all_predictors(hDecoder->pred_stat[channel], hDecoder->frameLength);
- }
- if (hDecoder->pred_stat[paired_channel] == NULL)
- {
- hDecoder->pred_stat[paired_channel] = (pred_state*)faad_malloc(hDecoder->frameLength * sizeof(pred_state));
- reset_all_predictors(hDecoder->pred_stat[paired_channel], hDecoder->frameLength);
- }
- }
-#endif
-
-#ifdef LTP_DEC
- if (is_ltp_ot(hDecoder->object_type))
- {
- /* allocate the state only when needed */
- if (hDecoder->lt_pred_stat[channel] == NULL)
- {
- hDecoder->lt_pred_stat[channel] = (int16_t*)faad_malloc(hDecoder->frameLength*4 * sizeof(int16_t));
- memset(hDecoder->lt_pred_stat[channel], 0, hDecoder->frameLength*4 * sizeof(int16_t));
- }
- if (hDecoder->lt_pred_stat[paired_channel] == NULL)
- {
- hDecoder->lt_pred_stat[paired_channel] = (int16_t*)faad_malloc(hDecoder->frameLength*4 * sizeof(int16_t));
- memset(hDecoder->lt_pred_stat[paired_channel], 0, hDecoder->frameLength*4 * sizeof(int16_t));
- }
- }
-#endif
-
- if (hDecoder->time_out[channel] == NULL)
- {
- mul = 1;
-#ifdef SBR_DEC
- hDecoder->sbr_alloced[hDecoder->fr_ch_ele] = 0;
- if ((hDecoder->sbr_present_flag == 1) || (hDecoder->forceUpSampling == 1))
- {
- /* SBR requires 2 times as much output data */
- mul = 2;
- hDecoder->sbr_alloced[hDecoder->fr_ch_ele] = 1;
- }
-#endif
- hDecoder->time_out[channel] = (real_t*)faad_malloc(mul*hDecoder->frameLength*sizeof(real_t));
- memset(hDecoder->time_out[channel], 0, mul*hDecoder->frameLength*sizeof(real_t));
- }
- if (hDecoder->time_out[paired_channel] == NULL)
- {
- hDecoder->time_out[paired_channel] = (real_t*)faad_malloc(mul*hDecoder->frameLength*sizeof(real_t));
- memset(hDecoder->time_out[paired_channel], 0, mul*hDecoder->frameLength*sizeof(real_t));
- }
-
- if (hDecoder->fb_intermed[channel] == NULL)
- {
- hDecoder->fb_intermed[channel] = (real_t*)faad_malloc(hDecoder->frameLength*sizeof(real_t));
- memset(hDecoder->fb_intermed[channel], 0, hDecoder->frameLength*sizeof(real_t));
- }
- if (hDecoder->fb_intermed[paired_channel] == NULL)
- {
- hDecoder->fb_intermed[paired_channel] = (real_t*)faad_malloc(hDecoder->frameLength*sizeof(real_t));
- memset(hDecoder->fb_intermed[paired_channel], 0, hDecoder->frameLength*sizeof(real_t));
- }
-
-#ifdef SSR_DEC
- if (hDecoder->object_type == SSR)
- {
- if (hDecoder->ssr_overlap[cpe->channel] == NULL)
- {
- hDecoder->ssr_overlap[cpe->channel] = (real_t*)faad_malloc(2*hDecoder->frameLength*sizeof(real_t));
- memset(hDecoder->ssr_overlap[cpe->channel], 0, 2*hDecoder->frameLength*sizeof(real_t));
- }
- if (hDecoder->ssr_overlap[cpe->paired_channel] == NULL)
- {
- hDecoder->ssr_overlap[cpe->paired_channel] = (real_t*)faad_malloc(2*hDecoder->frameLength*sizeof(real_t));
- memset(hDecoder->ssr_overlap[cpe->paired_channel], 0, 2*hDecoder->frameLength*sizeof(real_t));
- }
- if (hDecoder->prev_fmd[cpe->channel] == NULL)
- {
- uint16_t k;
- hDecoder->prev_fmd[cpe->channel] = (real_t*)faad_malloc(2*hDecoder->frameLength*sizeof(real_t));
- for (k = 0; k < 2*hDecoder->frameLength; k++)
- hDecoder->prev_fmd[cpe->channel][k] = REAL_CONST(-1);
- }
- if (hDecoder->prev_fmd[cpe->paired_channel] == NULL)
- {
- uint16_t k;
- hDecoder->prev_fmd[cpe->paired_channel] = (real_t*)faad_malloc(2*hDecoder->frameLength*sizeof(real_t));
- for (k = 0; k < 2*hDecoder->frameLength; k++)
- hDecoder->prev_fmd[cpe->paired_channel][k] = REAL_CONST(-1);
- }
- }
-#endif
-
- return 0;
-}
-
-uint8_t reconstruct_single_channel(NeAACDecHandle hDecoder, ic_stream *ics,
- element *sce, int16_t *spec_data)
-{
- uint8_t retval, output_channels;
- ALIGN real_t spec_coef[1024];
-
-#ifdef PROFILE
- int64_t count = faad_get_ts();
-#endif
-
-
- /* always allocate 2 channels, PS can always "suddenly" turn up */
-#if (defined(PS_DEC) || defined(DRM_PS))
- output_channels = hDecoder->ps_used[hDecoder->fr_ch_ele] ? 2 : 1;
-#else
- output_channels = 1;
-#endif
-
- if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] < output_channels)
- {
- hDecoder->element_output_channels[hDecoder->fr_ch_ele] = output_channels;
- retval = allocate_single_channel(hDecoder, sce->channel, output_channels);
- if (retval > 0)
- return retval;
-
- hDecoder->element_alloced[hDecoder->fr_ch_ele] = 1;
- }
-
-
- /* dequantisation and scaling */
- retval = quant_to_spec(hDecoder, ics, spec_data, spec_coef, hDecoder->frameLength);
- if (retval > 0)
- return retval;
-
-#ifdef PROFILE
- count = faad_get_ts() - count;
- hDecoder->requant_cycles += count;
-#endif
-
-
- /* pns decoding */
- pns_decode(ics, NULL, spec_coef, NULL, hDecoder->frameLength, 0, hDecoder->object_type);
-
-#ifdef MAIN_DEC
- /* MAIN object type prediction */
- if (hDecoder->object_type == MAIN)
- {
- /* intra channel prediction */
- ic_prediction(ics, spec_coef, hDecoder->pred_stat[sce->channel], hDecoder->frameLength,
- hDecoder->sf_index);
-
- /* In addition, for scalefactor bands coded by perceptual
- noise substitution the predictors belonging to the
- corresponding spectral coefficients are reset.
- */
- pns_reset_pred_state(ics, hDecoder->pred_stat[sce->channel]);
- }
-#endif
-
-#ifdef LTP_DEC
- if (is_ltp_ot(hDecoder->object_type))
- {
-#ifdef LD_DEC
- if (hDecoder->object_type == LD)
- {
- if (ics->ltp.data_present)
- {
- if (ics->ltp.lag_update)
- hDecoder->ltp_lag[sce->channel] = ics->ltp.lag;
- }
- ics->ltp.lag = hDecoder->ltp_lag[sce->channel];
- }
-#endif
-
- /* long term prediction */
- lt_prediction(ics, &(ics->ltp), spec_coef, hDecoder->lt_pred_stat[sce->channel], hDecoder->fb,
- ics->window_shape, hDecoder->window_shape_prev[sce->channel],
- hDecoder->sf_index, hDecoder->object_type, hDecoder->frameLength);
- }
-#endif
-
- /* tns decoding */
- tns_decode_frame(ics, &(ics->tns), hDecoder->sf_index, hDecoder->object_type,
- spec_coef, hDecoder->frameLength);
-
- /* drc decoding */
- if (hDecoder->drc->present)
- {
- if (!hDecoder->drc->exclude_mask[sce->channel] || !hDecoder->drc->excluded_chns_present)
- drc_decode(hDecoder->drc, spec_coef);
- }
-
- /* filter bank */
-#ifdef SSR_DEC
- if (hDecoder->object_type != SSR)
- {
-#endif
- ifilter_bank(hDecoder->fb, ics->window_sequence, ics->window_shape,
- hDecoder->window_shape_prev[sce->channel], spec_coef,
- hDecoder->time_out[sce->channel], hDecoder->fb_intermed[sce->channel],
- hDecoder->object_type, hDecoder->frameLength);
-#ifdef SSR_DEC
- } else {
- ssr_decode(&(ics->ssr), hDecoder->fb, ics->window_sequence, ics->window_shape,
- hDecoder->window_shape_prev[sce->channel], spec_coef, hDecoder->time_out[sce->channel],
- hDecoder->ssr_overlap[sce->channel], hDecoder->ipqf_buffer[sce->channel], hDecoder->prev_fmd[sce->channel],
- hDecoder->frameLength);
- }
-#endif
-
- /* save window shape for next frame */
- hDecoder->window_shape_prev[sce->channel] = ics->window_shape;
-
-#ifdef LTP_DEC
- if (is_ltp_ot(hDecoder->object_type))
- {
- lt_update_state(hDecoder->lt_pred_stat[sce->channel], hDecoder->time_out[sce->channel],
- hDecoder->fb_intermed[sce->channel], hDecoder->frameLength, hDecoder->object_type);
- }
-#endif
-
-#ifdef SBR_DEC
- if (((hDecoder->sbr_present_flag == 1) || (hDecoder->forceUpSampling == 1))
- && hDecoder->sbr_alloced[hDecoder->fr_ch_ele])
- {
- uint8_t ele = hDecoder->fr_ch_ele;
- uint8_t ch = sce->channel;
-
- /* following case can happen when forceUpSampling == 1 */
- if (hDecoder->sbr[ele] == NULL)
- {
- hDecoder->sbr[ele] = sbrDecodeInit(hDecoder->frameLength,
- hDecoder->element_id[ele], 2*get_sample_rate(hDecoder->sf_index),
- hDecoder->downSampledSBR
-#ifdef DRM
- , 0
-#endif
- );
- }
-
- if (sce->ics1.window_sequence == EIGHT_SHORT_SEQUENCE)
- hDecoder->sbr[ele]->maxAACLine = 8*sce->ics1.swb_offset[max(sce->ics1.max_sfb-1, 0)];
- else
- hDecoder->sbr[ele]->maxAACLine = sce->ics1.swb_offset[max(sce->ics1.max_sfb-1, 0)];
-
- /* check if any of the PS tools is used */
-#if (defined(PS_DEC) || defined(DRM_PS))
- if (hDecoder->ps_used[ele] == 0)
- {
-#endif
- retval = sbrDecodeSingleFrame(hDecoder->sbr[ele], hDecoder->time_out[ch],
- hDecoder->postSeekResetFlag, hDecoder->downSampledSBR);
-#if (defined(PS_DEC) || defined(DRM_PS))
- } else {
- retval = sbrDecodeSingleFramePS(hDecoder->sbr[ele], hDecoder->time_out[ch],
- hDecoder->time_out[ch+1], hDecoder->postSeekResetFlag,
- hDecoder->downSampledSBR);
- }
-#endif
- if (retval > 0)
- return retval;
- } else if (((hDecoder->sbr_present_flag == 1) || (hDecoder->forceUpSampling == 1))
- && !hDecoder->sbr_alloced[hDecoder->fr_ch_ele])
- {
- return 23;
- }
-
- /* copy L to R when no PS is used */
-#if (defined(PS_DEC) || defined(DRM_PS))
- if ((hDecoder->ps_used[hDecoder->fr_ch_ele] == 0) && (output_channels == 2))
- {
- uint8_t ele = hDecoder->fr_ch_ele;
- uint8_t ch = sce->channel;
- uint16_t frame_size = (hDecoder->sbr_alloced[ele]) ? 2 : 1;
- frame_size *= hDecoder->frameLength*sizeof(real_t);
-
- memcpy(hDecoder->time_out[ch+1], hDecoder->time_out[ch], frame_size);
- }
-#endif
-#endif
-
- return 0;
-}
-
-uint8_t reconstruct_channel_pair(NeAACDecHandle hDecoder, ic_stream *ics1, ic_stream *ics2,
- element *cpe, int16_t *spec_data1, int16_t *spec_data2)
-{
- uint8_t retval;
- ALIGN real_t spec_coef1[1024];
- ALIGN real_t spec_coef2[1024];
-
-#ifdef PROFILE
- int64_t count = faad_get_ts();
-#endif
- if (hDecoder->element_alloced[hDecoder->fr_ch_ele] == 0)
- {
- retval = allocate_channel_pair(hDecoder, cpe->channel, (uint8_t)cpe->paired_channel);
- if (retval > 0)
- return retval;
-
- hDecoder->element_alloced[hDecoder->fr_ch_ele] = 1;
- }
-
- /* dequantisation and scaling */
- retval = quant_to_spec(hDecoder, ics1, spec_data1, spec_coef1, hDecoder->frameLength);
- if (retval > 0)
- return retval;
- retval = quant_to_spec(hDecoder, ics2, spec_data2, spec_coef2, hDecoder->frameLength);
- if (retval > 0)
- return retval;
-
-#ifdef PROFILE
- count = faad_get_ts() - count;
- hDecoder->requant_cycles += count;
-#endif
-
-
- /* pns decoding */
- if (ics1->ms_mask_present)
- {
- pns_decode(ics1, ics2, spec_coef1, spec_coef2, hDecoder->frameLength, 1, hDecoder->object_type);
- } else {
- pns_decode(ics1, NULL, spec_coef1, NULL, hDecoder->frameLength, 0, hDecoder->object_type);
- pns_decode(ics2, NULL, spec_coef2, NULL, hDecoder->frameLength, 0, hDecoder->object_type);
- }
-
- /* mid/side decoding */
- ms_decode(ics1, ics2, spec_coef1, spec_coef2, hDecoder->frameLength);
-
-#if 0
- {
- int i;
- for (i = 0; i < 1024; i++)
- {
- //printf("%d\n", spec_coef1[i]);
- printf("0x%.8X\n", spec_coef1[i]);
- }
- for (i = 0; i < 1024; i++)
- {
- //printf("%d\n", spec_coef2[i]);
- printf("0x%.8X\n", spec_coef2[i]);
- }
- }
-#endif
-
- /* intensity stereo decoding */
- is_decode(ics1, ics2, spec_coef1, spec_coef2, hDecoder->frameLength);
-
-#if 0
- {
- int i;
- for (i = 0; i < 1024; i++)
- {
- printf("%d\n", spec_coef1[i]);
- //printf("0x%.8X\n", spec_coef1[i]);
- }
- for (i = 0; i < 1024; i++)
- {
- printf("%d\n", spec_coef2[i]);
- //printf("0x%.8X\n", spec_coef2[i]);
- }
- }
-#endif
-
-#ifdef MAIN_DEC
- /* MAIN object type prediction */
- if (hDecoder->object_type == MAIN)
- {
- /* intra channel prediction */
- ic_prediction(ics1, spec_coef1, hDecoder->pred_stat[cpe->channel], hDecoder->frameLength,
- hDecoder->sf_index);
- ic_prediction(ics2, spec_coef2, hDecoder->pred_stat[cpe->paired_channel], hDecoder->frameLength,
- hDecoder->sf_index);
-
- /* In addition, for scalefactor bands coded by perceptual
- noise substitution the predictors belonging to the
- corresponding spectral coefficients are reset.
- */
- pns_reset_pred_state(ics1, hDecoder->pred_stat[cpe->channel]);
- pns_reset_pred_state(ics2, hDecoder->pred_stat[cpe->paired_channel]);
- }
-#endif
-
-#ifdef LTP_DEC
- if (is_ltp_ot(hDecoder->object_type))
- {
- ltp_info *ltp1 = &(ics1->ltp);
- ltp_info *ltp2 = (cpe->common_window) ? &(ics2->ltp2) : &(ics2->ltp);
-#ifdef LD_DEC
- if (hDecoder->object_type == LD)
- {
- if (ltp1->data_present)
- {
- if (ltp1->lag_update)
- hDecoder->ltp_lag[cpe->channel] = ltp1->lag;
- }
- ltp1->lag = hDecoder->ltp_lag[cpe->channel];
- if (ltp2->data_present)
- {
- if (ltp2->lag_update)
- hDecoder->ltp_lag[cpe->paired_channel] = ltp2->lag;
- }
- ltp2->lag = hDecoder->ltp_lag[cpe->paired_channel];
- }
-#endif
-
- /* long term prediction */
- lt_prediction(ics1, ltp1, spec_coef1, hDecoder->lt_pred_stat[cpe->channel], hDecoder->fb,
- ics1->window_shape, hDecoder->window_shape_prev[cpe->channel],
- hDecoder->sf_index, hDecoder->object_type, hDecoder->frameLength);
- lt_prediction(ics2, ltp2, spec_coef2, hDecoder->lt_pred_stat[cpe->paired_channel], hDecoder->fb,
- ics2->window_shape, hDecoder->window_shape_prev[cpe->paired_channel],
- hDecoder->sf_index, hDecoder->object_type, hDecoder->frameLength);
- }
-#endif
-
- /* tns decoding */
- tns_decode_frame(ics1, &(ics1->tns), hDecoder->sf_index, hDecoder->object_type,
- spec_coef1, hDecoder->frameLength);
- tns_decode_frame(ics2, &(ics2->tns), hDecoder->sf_index, hDecoder->object_type,
- spec_coef2, hDecoder->frameLength);
-
- /* drc decoding */
- if (hDecoder->drc->present)
- {
- if (!hDecoder->drc->exclude_mask[cpe->channel] || !hDecoder->drc->excluded_chns_present)
- drc_decode(hDecoder->drc, spec_coef1);
- if (!hDecoder->drc->exclude_mask[cpe->paired_channel] || !hDecoder->drc->excluded_chns_present)
- drc_decode(hDecoder->drc, spec_coef2);
- }
-
- /* filter bank */
-#ifdef SSR_DEC
- if (hDecoder->object_type != SSR)
- {
-#endif
- ifilter_bank(hDecoder->fb, ics1->window_sequence, ics1->window_shape,
- hDecoder->window_shape_prev[cpe->channel], spec_coef1,
- hDecoder->time_out[cpe->channel], hDecoder->fb_intermed[cpe->channel],
- hDecoder->object_type, hDecoder->frameLength);
- ifilter_bank(hDecoder->fb, ics2->window_sequence, ics2->window_shape,
- hDecoder->window_shape_prev[cpe->paired_channel], spec_coef2,
- hDecoder->time_out[cpe->paired_channel], hDecoder->fb_intermed[cpe->paired_channel],
- hDecoder->object_type, hDecoder->frameLength);
-#ifdef SSR_DEC
- } else {
- ssr_decode(&(ics1->ssr), hDecoder->fb, ics1->window_sequence, ics1->window_shape,
- hDecoder->window_shape_prev[cpe->channel], spec_coef1, hDecoder->time_out[cpe->channel],
- hDecoder->ssr_overlap[cpe->channel], hDecoder->ipqf_buffer[cpe->channel],
- hDecoder->prev_fmd[cpe->channel], hDecoder->frameLength);
- ssr_decode(&(ics2->ssr), hDecoder->fb, ics2->window_sequence, ics2->window_shape,
- hDecoder->window_shape_prev[cpe->paired_channel], spec_coef2, hDecoder->time_out[cpe->paired_channel],
- hDecoder->ssr_overlap[cpe->paired_channel], hDecoder->ipqf_buffer[cpe->paired_channel],
- hDecoder->prev_fmd[cpe->paired_channel], hDecoder->frameLength);
- }
-#endif
-
- /* save window shape for next frame */
- hDecoder->window_shape_prev[cpe->channel] = ics1->window_shape;
- hDecoder->window_shape_prev[cpe->paired_channel] = ics2->window_shape;
-
-#ifdef LTP_DEC
- if (is_ltp_ot(hDecoder->object_type))
- {
- lt_update_state(hDecoder->lt_pred_stat[cpe->channel], hDecoder->time_out[cpe->channel],
- hDecoder->fb_intermed[cpe->channel], hDecoder->frameLength, hDecoder->object_type);
- lt_update_state(hDecoder->lt_pred_stat[cpe->paired_channel], hDecoder->time_out[cpe->paired_channel],
- hDecoder->fb_intermed[cpe->paired_channel], hDecoder->frameLength, hDecoder->object_type);
- }
-#endif
-
-#ifdef SBR_DEC
- if (((hDecoder->sbr_present_flag == 1) || (hDecoder->forceUpSampling == 1))
- && hDecoder->sbr_alloced[hDecoder->fr_ch_ele])
- {
- uint8_t ele = hDecoder->fr_ch_ele;
- uint8_t ch0 = cpe->channel;
- uint8_t ch1 = cpe->paired_channel;
-
- /* following case can happen when forceUpSampling == 1 */
- if (hDecoder->sbr[ele] == NULL)
- {
- hDecoder->sbr[ele] = sbrDecodeInit(hDecoder->frameLength,
- hDecoder->element_id[ele], 2*get_sample_rate(hDecoder->sf_index),
- hDecoder->downSampledSBR
-#ifdef DRM
- , 0
-#endif
- );
- }
-
- if (cpe->ics1.window_sequence == EIGHT_SHORT_SEQUENCE)
- hDecoder->sbr[ele]->maxAACLine = 8*cpe->ics1.swb_offset[max(cpe->ics1.max_sfb-1, 0)];
- else
- hDecoder->sbr[ele]->maxAACLine = cpe->ics1.swb_offset[max(cpe->ics1.max_sfb-1, 0)];
-
- retval = sbrDecodeCoupleFrame(hDecoder->sbr[ele],
- hDecoder->time_out[ch0], hDecoder->time_out[ch1],
- hDecoder->postSeekResetFlag, hDecoder->downSampledSBR);
- if (retval > 0)
- return retval;
- } else if (((hDecoder->sbr_present_flag == 1) || (hDecoder->forceUpSampling == 1))
- && !hDecoder->sbr_alloced[hDecoder->fr_ch_ele])
- {
- return 23;
- }
-#endif
-
- return 0;
-}
diff --git a/src/libfaad/specrec.h b/src/libfaad/specrec.h
deleted file mode 100644
index da174abe8..000000000
--- a/src/libfaad/specrec.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: specrec.h,v 1.7 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __SPECREC_H__
-#define __SPECREC_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "syntax.h"
-
-uint8_t window_grouping_info(NeAACDecHandle hDecoder, ic_stream *ics);
-uint8_t reconstruct_channel_pair(NeAACDecHandle hDecoder, ic_stream *ics1, ic_stream *ics2,
- element *cpe, int16_t *spec_data1, int16_t *spec_data2);
-uint8_t reconstruct_single_channel(NeAACDecHandle hDecoder, ic_stream *ics, element *sce,
- int16_t *spec_data);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/libfaad/ssr.c b/src/libfaad/ssr.c
deleted file mode 100644
index 46517d0c8..000000000
--- a/src/libfaad/ssr.c
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: ssr.c,v 1.6 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#include "common.h"
-#include "structs.h"
-
-#ifdef SSR_DEC
-
-#include "syntax.h"
-#include "filtbank.h"
-#include "ssr.h"
-#include "ssr_fb.h"
-
-void ssr_decode(ssr_info *ssr, fb_info *fb, uint8_t window_sequence,
- uint8_t window_shape, uint8_t window_shape_prev,
- real_t *freq_in, real_t *time_out, real_t *overlap,
- real_t ipqf_buffer[SSR_BANDS][96/4],
- real_t *prev_fmd, uint16_t frame_len)
-{
- uint8_t band;
- uint16_t ssr_frame_len = frame_len/SSR_BANDS;
- real_t time_tmp[2048] = {0};
- real_t output[1024] = {0};
-
- for (band = 0; band < SSR_BANDS; band++)
- {
- int16_t j;
-
- /* uneven bands have inverted frequency scale */
- if (band == 1 || band == 3)
- {
- for (j = 0; j < ssr_frame_len/2; j++)
- {
- real_t tmp;
- tmp = freq_in[j + ssr_frame_len*band];
- freq_in[j + ssr_frame_len*band] =
- freq_in[ssr_frame_len - j - 1 + ssr_frame_len*band];
- freq_in[ssr_frame_len - j - 1 + ssr_frame_len*band] = tmp;
- }
- }
-
- /* non-overlapping inverse filterbank for SSR */
- ssr_ifilter_bank(fb, window_sequence, window_shape, window_shape_prev,
- freq_in + band*ssr_frame_len, time_tmp + band*ssr_frame_len,
- ssr_frame_len);
-
- /* gain control */
- ssr_gain_control(ssr, time_tmp, output, overlap, prev_fmd,
- band, window_sequence, ssr_frame_len);
- }
-
- /* inverse pqf to bring subbands together again */
- ssr_ipqf(ssr, output, time_out, ipqf_buffer, frame_len, SSR_BANDS);
-}
-
-static void ssr_gain_control(ssr_info *ssr, real_t *data, real_t *output,
- real_t *overlap, real_t *prev_fmd, uint8_t band,
- uint8_t window_sequence, uint16_t frame_len)
-{
- uint16_t i;
- real_t gc_function[2*1024/SSR_BANDS];
-
- if (window_sequence != EIGHT_SHORT_SEQUENCE)
- {
- ssr_gc_function(ssr, &prev_fmd[band * frame_len*2],
- gc_function, window_sequence, band, frame_len);
-
- for (i = 0; i < frame_len*2; i++)
- data[band * frame_len*2 + i] *= gc_function[i];
- for (i = 0; i < frame_len; i++)
- {
- output[band*frame_len + i] = overlap[band*frame_len + i] +
- data[band*frame_len*2 + i];
- }
- for (i = 0; i < frame_len; i++)
- {
- overlap[band*frame_len + i] =
- data[band*frame_len*2 + frame_len + i];
- }
- } else {
- uint8_t w;
- for (w = 0; w < 8; w++)
- {
- uint16_t frame_len8 = frame_len/8;
- uint16_t frame_len16 = frame_len/16;
-
- ssr_gc_function(ssr, &prev_fmd[band*frame_len*2 + w*frame_len*2/8],
- gc_function, window_sequence, frame_len);
-
- for (i = 0; i < frame_len8*2; i++)
- data[band*frame_len*2 + w*frame_len8*2+i] *= gc_function[i];
- for (i = 0; i < frame_len8; i++)
- {
- overlap[band*frame_len + i + 7*frame_len16 + w*frame_len8] +=
- data[band*frame_len*2 + 2*w*frame_len8 + i];
- }
- for (i = 0; i < frame_len8; i++)
- {
- overlap[band*frame_len + i + 7*frame_len16 + (w+1)*frame_len8] =
- data[band*frame_len*2 + 2*w*frame_len8 + frame_len8 + i];
- }
- }
- for (i = 0; i < frame_len; i++)
- output[band*frame_len + i] = overlap[band*frame_len + i];
- for (i = 0; i < frame_len; i++)
- overlap[band*frame_len + i] = overlap[band*frame_len + i + frame_len];
- }
-}
-
-static void ssr_gc_function(ssr_info *ssr, real_t *prev_fmd,
- real_t *gc_function, uint8_t window_sequence,
- uint8_t band, uint16_t frame_len)
-{
- uint16_t i;
- uint16_t len_area1, len_area2;
- int32_t aloc[10];
- real_t alev[10];
-
- switch (window_sequence)
- {
- case ONLY_LONG_SEQUENCE:
- len_area1 = frame_len/SSR_BANDS;
- len_area2 = 0;
- break;
- case LONG_START_SEQUENCE:
- len_area1 = (frame_len/SSR_BANDS)*7/32;
- len_area2 = (frame_len/SSR_BANDS)/16;
- break;
- case EIGHT_SHORT_SEQUENCE:
- len_area1 = (frame_len/8)/SSR_BANDS;
- len_area2 = 0;
- break;
- case LONG_STOP_SEQUENCE:
- len_area1 = (frame_len/SSR_BANDS);
- len_area2 = 0;
- break;
- }
-
- /* decode bitstream information */
-
- /* build array M */
-
-
- for (i = 0; i < frame_len*2; i++)
- gc_function[i] = 1;
-}
-
-#endif
diff --git a/src/libfaad/ssr.h b/src/libfaad/ssr.h
deleted file mode 100644
index d1defdc45..000000000
--- a/src/libfaad/ssr.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: ssr.h,v 1.6 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __SSR_H__
-#define __SSR_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define SSR_BANDS 4
-#define PQFTAPS 96
-
-void ssr_decode(ssr_info *ssr, fb_info *fb, uint8_t window_sequence,
- uint8_t window_shape, uint8_t window_shape_prev,
- real_t *freq_in, real_t *time_out, real_t *overlap,
- real_t ipqf_buffer[SSR_BANDS][96/4],
- real_t *prev_fmd, uint16_t frame_len);
-
-
-static void ssr_gain_control(ssr_info *ssr, real_t *data, real_t *output,
- real_t *overlap, real_t *prev_fmd, uint8_t band,
- uint8_t window_sequence, uint16_t frame_len);
-static void ssr_gc_function(ssr_info *ssr, real_t *prev_fmd,
- real_t *gc_function, uint8_t window_sequence,
- uint16_t frame_len);
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/libfaad/ssr_fb.c b/src/libfaad/ssr_fb.c
deleted file mode 100644
index fb62c90c6..000000000
--- a/src/libfaad/ssr_fb.c
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: ssr_fb.c,v 1.6 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#include "common.h"
-#include "structs.h"
-
-#ifdef SSR_DEC
-
-#include <string.h>
-#include <stdlib.h>
-#include "syntax.h"
-#include "filtbank.h"
-#include "mdct.h"
-#include "ssr_fb.h"
-#include "ssr_win.h"
-
-fb_info *ssr_filter_bank_init(uint16_t frame_len)
-{
- uint16_t nshort = frame_len/8;
-
- fb_info *fb = (fb_info*)faad_malloc(sizeof(fb_info));
- memset(fb, 0, sizeof(fb_info));
-
- /* normal */
- fb->mdct256 = faad_mdct_init(2*nshort);
- fb->mdct2048 = faad_mdct_init(2*frame_len);
-
- fb->long_window[0] = sine_long_256;
- fb->short_window[0] = sine_short_32;
- fb->long_window[1] = kbd_long_256;
- fb->short_window[1] = kbd_short_32;
-
- return fb;
-}
-
-void ssr_filter_bank_end(fb_info *fb)
-{
- faad_mdct_end(fb->mdct256);
- faad_mdct_end(fb->mdct2048);
-
- if (fb) faad_free(fb);
-}
-
-static INLINE void imdct_ssr(fb_info *fb, real_t *in_data,
- real_t *out_data, uint16_t len)
-{
- mdct_info *mdct;
-
- switch (len)
- {
- case 512:
- mdct = fb->mdct2048;
- break;
- case 64:
- mdct = fb->mdct256;
- break;
- }
-
- faad_imdct(mdct, in_data, out_data);
-}
-
-/* NON-overlapping inverse filterbank for use with SSR */
-void ssr_ifilter_bank(fb_info *fb, uint8_t window_sequence, uint8_t window_shape,
- uint8_t window_shape_prev, real_t *freq_in,
- real_t *time_out, uint16_t frame_len)
-{
- int16_t i;
- real_t *transf_buf;
-
- real_t *window_long;
- real_t *window_long_prev;
- real_t *window_short;
- real_t *window_short_prev;
-
- uint16_t nlong = frame_len;
- uint16_t nshort = frame_len/8;
- uint16_t trans = nshort/2;
-
- uint16_t nflat_ls = (nlong-nshort)/2;
-
- transf_buf = (real_t*)faad_malloc(2*nlong*sizeof(real_t));
-
- window_long = fb->long_window[window_shape];
- window_long_prev = fb->long_window[window_shape_prev];
- window_short = fb->short_window[window_shape];
- window_short_prev = fb->short_window[window_shape_prev];
-
- switch (window_sequence)
- {
- case ONLY_LONG_SEQUENCE:
- imdct_ssr(fb, freq_in, transf_buf, 2*nlong);
- for (i = nlong-1; i >= 0; i--)
- {
- time_out[i] = MUL_R_C(transf_buf[i],window_long_prev[i]);
- time_out[nlong+i] = MUL_R_C(transf_buf[nlong+i],window_long[nlong-1-i]);
- }
- break;
-
- case LONG_START_SEQUENCE:
- imdct_ssr(fb, freq_in, transf_buf, 2*nlong);
- for (i = 0; i < nlong; i++)
- time_out[i] = MUL_R_C(transf_buf[i],window_long_prev[i]);
- for (i = 0; i < nflat_ls; i++)
- time_out[nlong+i] = transf_buf[nlong+i];
- for (i = 0; i < nshort; i++)
- time_out[nlong+nflat_ls+i] = MUL_R_C(transf_buf[nlong+nflat_ls+i],window_short[nshort-i-1]);
- for (i = 0; i < nflat_ls; i++)
- time_out[nlong+nflat_ls+nshort+i] = 0;
- break;
-
- case EIGHT_SHORT_SEQUENCE:
- imdct_ssr(fb, freq_in+0*nshort, transf_buf+2*nshort*0, 2*nshort);
- imdct_ssr(fb, freq_in+1*nshort, transf_buf+2*nshort*1, 2*nshort);
- imdct_ssr(fb, freq_in+2*nshort, transf_buf+2*nshort*2, 2*nshort);
- imdct_ssr(fb, freq_in+3*nshort, transf_buf+2*nshort*3, 2*nshort);
- imdct_ssr(fb, freq_in+4*nshort, transf_buf+2*nshort*4, 2*nshort);
- imdct_ssr(fb, freq_in+5*nshort, transf_buf+2*nshort*5, 2*nshort);
- imdct_ssr(fb, freq_in+6*nshort, transf_buf+2*nshort*6, 2*nshort);
- imdct_ssr(fb, freq_in+7*nshort, transf_buf+2*nshort*7, 2*nshort);
- for(i = nshort-1; i >= 0; i--)
- {
- time_out[i+0*nshort] = MUL_R_C(transf_buf[nshort*0+i],window_short_prev[i]);
- time_out[i+1*nshort] = MUL_R_C(transf_buf[nshort*1+i],window_short[i]);
- time_out[i+2*nshort] = MUL_R_C(transf_buf[nshort*2+i],window_short_prev[i]);
- time_out[i+3*nshort] = MUL_R_C(transf_buf[nshort*3+i],window_short[i]);
- time_out[i+4*nshort] = MUL_R_C(transf_buf[nshort*4+i],window_short_prev[i]);
- time_out[i+5*nshort] = MUL_R_C(transf_buf[nshort*5+i],window_short[i]);
- time_out[i+6*nshort] = MUL_R_C(transf_buf[nshort*6+i],window_short_prev[i]);
- time_out[i+7*nshort] = MUL_R_C(transf_buf[nshort*7+i],window_short[i]);
- time_out[i+8*nshort] = MUL_R_C(transf_buf[nshort*8+i],window_short_prev[i]);
- time_out[i+9*nshort] = MUL_R_C(transf_buf[nshort*9+i],window_short[i]);
- time_out[i+10*nshort] = MUL_R_C(transf_buf[nshort*10+i],window_short_prev[i]);
- time_out[i+11*nshort] = MUL_R_C(transf_buf[nshort*11+i],window_short[i]);
- time_out[i+12*nshort] = MUL_R_C(transf_buf[nshort*12+i],window_short_prev[i]);
- time_out[i+13*nshort] = MUL_R_C(transf_buf[nshort*13+i],window_short[i]);
- time_out[i+14*nshort] = MUL_R_C(transf_buf[nshort*14+i],window_short_prev[i]);
- time_out[i+15*nshort] = MUL_R_C(transf_buf[nshort*15+i],window_short[i]);
- }
- break;
-
- case LONG_STOP_SEQUENCE:
- imdct_ssr(fb, freq_in, transf_buf, 2*nlong);
- for (i = 0; i < nflat_ls; i++)
- time_out[i] = 0;
- for (i = 0; i < nshort; i++)
- time_out[nflat_ls+i] = MUL_R_C(transf_buf[nflat_ls+i],window_short_prev[i]);
- for (i = 0; i < nflat_ls; i++)
- time_out[nflat_ls+nshort+i] = transf_buf[nflat_ls+nshort+i];
- for (i = 0; i < nlong; i++)
- time_out[nlong+i] = MUL_R_C(transf_buf[nlong+i],window_long[nlong-1-i]);
- break;
- }
-
- faad_free(transf_buf);
-}
-
-
-#endif
diff --git a/src/libfaad/ssr_fb.h b/src/libfaad/ssr_fb.h
deleted file mode 100644
index 739a4dfbb..000000000
--- a/src/libfaad/ssr_fb.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** $Id: ssr_fb.h,v 1.5 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __SSR_FB_H__
-#define __SSR_FB_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-fb_info *ssr_filter_bank_init(uint16_t frame_len);
-void ssr_filter_bank_end(fb_info *fb);
-
-/*non overlapping inverse filterbank */
-void ssr_ifilter_bank(fb_info *fb,
- uint8_t window_sequence,
- uint8_t window_shape,
- uint8_t window_shape_prev,
- real_t *freq_in,
- real_t *time_out,
- uint16_t frame_len);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/libfaad/ssr_ipqf.c b/src/libfaad/ssr_ipqf.c
deleted file mode 100644
index 3064285de..000000000
--- a/src/libfaad/ssr_ipqf.c
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: ssr_ipqf.c,v 1.6 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#include "common.h"
-#include "structs.h"
-
-#ifdef SSR_DEC
-
-#include "ssr.h"
-#include "ssr_ipqf.h"
-
-static real_t **app_pqfbuf;
-static real_t **pp_q0, **pp_t0, **pp_t1;
-
-void gc_set_protopqf(real_t *p_proto)
-{
- int j;
- static real_t a_half[48] =
- {
- 1.2206911375946939E-05, 1.7261986723798209E-05, 1.2300093657077942E-05,
- -1.0833943097791965E-05, -5.7772498639901686E-05, -1.2764767618947719E-04,
- -2.0965186675013334E-04, -2.8166673689263850E-04, -3.1234860429017460E-04,
- -2.6738519958452353E-04, -1.1949424681824722E-04, 1.3965139412648678E-04,
- 4.8864136409185725E-04, 8.7044629275148344E-04, 1.1949430269934793E-03,
- 1.3519708175026700E-03, 1.2346314373964412E-03, 7.6953209114159191E-04,
- -5.2242432579537141E-05, -1.1516092887213454E-03, -2.3538469841711277E-03,
- -3.4033123072127277E-03, -4.0028551071986133E-03, -3.8745415659693259E-03,
- -2.8321073426874310E-03, -8.5038892323704195E-04, 1.8856751185350931E-03,
- 4.9688741735340923E-03, 7.8056704536795926E-03, 9.7027909685901654E-03,
- 9.9960423120166159E-03, 8.2019366335594487E-03, 4.1642072876103365E-03,
- -1.8364453822737758E-03, -9.0384863094167686E-03, -1.6241528177129844E-02,
- -2.1939551286300665E-02, -2.4533179947088161E-02, -2.2591663337768787E-02,
- -1.5122066420044672E-02, -1.7971713448186293E-03, 1.6903413428575379E-02,
- 3.9672315874127042E-02, 6.4487527248102796E-02, 8.8850025474701726E-02,
- 0.1101132906105560 , 0.1258540205143761 , 0.1342239368467012
- };
-
- for (j = 0; j < 48; ++j)
- {
- p_proto[j] = p_proto[95-j] = a_half[j];
- }
-}
-
-void gc_setcoef_eff_pqfsyn(int mm,
- int kk,
- real_t *p_proto,
- real_t ***ppp_q0,
- real_t ***ppp_t0,
- real_t ***ppp_t1)
-{
- int i, k, n;
- real_t w;
-
- /* Set 1st Mul&Acc Coef's */
- *ppp_q0 = (real_t **) calloc(mm, sizeof(real_t *));
- for (n = 0; n < mm; ++n)
- {
- (*ppp_q0)[n] = (real_t *) calloc(mm, sizeof(real_t));
- }
- for (n = 0; n < mm/2; ++n)
- {
- for (i = 0; i < mm; ++i)
- {
- w = (2*i+1)*(2*n+1-mm)*M_PI/(4*mm);
- (*ppp_q0)[n][i] = 2.0 * cos((real_t) w);
-
- w = (2*i+1)*(2*(mm+n)+1-mm)*M_PI/(4*mm);
- (*ppp_q0)[n + mm/2][i] = 2.0 * cos((real_t) w);
- }
- }
-
- /* Set 2nd Mul&Acc Coef's */
- *ppp_t0 = (real_t **) calloc(mm, sizeof(real_t *));
- *ppp_t1 = (real_t **) calloc(mm, sizeof(real_t *));
- for (n = 0; n < mm; ++n)
- {
- (*ppp_t0)[n] = (real_t *) calloc(kk, sizeof(real_t));
- (*ppp_t1)[n] = (real_t *) calloc(kk, sizeof(real_t));
- }
- for (n = 0; n < mm; ++n)
- {
- for (k = 0; k < kk; ++k)
- {
- (*ppp_t0)[n][k] = mm * p_proto[2*k *mm + n];
- (*ppp_t1)[n][k] = mm * p_proto[(2*k+1)*mm + n];
-
- if (k%2 != 0)
- {
- (*ppp_t0)[n][k] = -(*ppp_t0)[n][k];
- (*ppp_t1)[n][k] = -(*ppp_t1)[n][k];
- }
- }
- }
-}
-
-void ssr_ipqf(ssr_info *ssr, real_t *in_data, real_t *out_data,
- real_t buffer[SSR_BANDS][96/4],
- uint16_t frame_len, uint8_t bands)
-{
- static int initFlag = 0;
- real_t a_pqfproto[PQFTAPS];
-
- int i;
-
- if (initFlag == 0)
- {
- gc_set_protopqf(a_pqfproto);
- gc_setcoef_eff_pqfsyn(SSR_BANDS, PQFTAPS/(2*SSR_BANDS), a_pqfproto,
- &pp_q0, &pp_t0, &pp_t1);
- initFlag = 1;
- }
-
- for (i = 0; i < frame_len / SSR_BANDS; i++)
- {
- int l, n, k;
- int mm = SSR_BANDS;
- int kk = PQFTAPS/(2*SSR_BANDS);
-
- for (n = 0; n < mm; n++)
- {
- for (k = 0; k < 2*kk-1; k++)
- {
- buffer[n][k] = buffer[n][k+1];
- }
- }
-
- for (n = 0; n < mm; n++)
- {
- real_t acc = 0.0;
- for (l = 0; l < mm; l++)
- {
- acc += pp_q0[n][l] * in_data[l*frame_len/SSR_BANDS + i];
- }
- buffer[n][2*kk-1] = acc;
- }
-
- for (n = 0; n < mm/2; n++)
- {
- real_t acc = 0.0;
- for (k = 0; k < kk; k++)
- {
- acc += pp_t0[n][k] * buffer[n][2*kk-1-2*k];
- }
- for (k = 0; k < kk; ++k)
- {
- acc += pp_t1[n][k] * buffer[n + mm/2][2*kk-2-2*k];
- }
- out_data[i*SSR_BANDS + n] = acc;
-
- acc = 0.0;
- for (k = 0; k < kk; k++)
- {
- acc += pp_t0[mm-1-n][k] * buffer[n][2*kk-1-2*k];
- }
- for (k = 0; k < kk; k++)
- {
- acc -= pp_t1[mm-1-n][k] * buffer[n + mm/2][2*kk-2-2*k];
- }
- out_data[i*SSR_BANDS + mm-1-n] = acc;
- }
- }
-}
-
-#endif
diff --git a/src/libfaad/ssr_ipqf.h b/src/libfaad/ssr_ipqf.h
deleted file mode 100644
index 360db978b..000000000
--- a/src/libfaad/ssr_ipqf.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** $Id: ssr_ipqf.h,v 1.5 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __SSR_IPQF_H__
-#define __SSR_IPQF_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void ssr_ipqf(ssr_info *ssr, real_t *in_data, real_t *out_data,
- real_t buffer[SSR_BANDS][96/4],
- uint16_t frame_len, uint8_t bands);
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/libfaad/ssr_win.h b/src/libfaad/ssr_win.h
deleted file mode 100644
index ddbb3086e..000000000
--- a/src/libfaad/ssr_win.h
+++ /dev/null
@@ -1,626 +0,0 @@
-/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** $Id: ssr_win.h,v 1.5 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __SSR_WIN_H__
-#define __SSR_WIN_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef _MSC_VER
-#pragma warning(disable:4305)
-#pragma warning(disable:4244)
-#endif
-
-static real_t sine_short_32[] = {
- 0.0245412290,
- 0.0735645667,
- 0.1224106774,
- 0.1709618866,
- 0.2191012502,
- 0.2667127550,
- 0.3136817515,
- 0.3598950505,
- 0.4052413106,
- 0.4496113360,
- 0.4928981960,
- 0.5349976420,
- 0.5758082271,
- 0.6152316332,
- 0.6531728506,
- 0.6895405650,
- 0.7242470980,
- 0.7572088838,
- 0.7883464694,
- 0.8175848126,
- 0.8448535800,
- 0.8700870275,
- 0.8932242990,
- 0.9142097831,
- 0.9329928160,
- 0.9495282173,
- 0.9637760520,
- 0.9757021666,
- 0.9852776527,
- 0.9924795628,
- 0.9972904325,
- 0.9996988177
-};
-
-static real_t sine_long_256[] = {
- 0.0030679568,
- 0.0092037553,
- 0.0153392069,
- 0.0214740802,
- 0.0276081469,
- 0.0337411724,
- 0.0398729295,
- 0.0460031852,
- 0.0521317050,
- 0.0582582653,
- 0.0643826351,
- 0.0705045760,
- 0.0766238645,
- 0.0827402696,
- 0.0888535529,
- 0.0949634984,
- 0.1010698676,
- 0.1071724296,
- 0.1132709533,
- 0.1193652153,
- 0.1254549921,
- 0.1315400302,
- 0.1376201212,
- 0.1436950415,
- 0.1497645378,
- 0.1558284014,
- 0.1618863940,
- 0.1679383069,
- 0.1739838719,
- 0.1800229102,
- 0.1860551536,
- 0.1920804083,
- 0.1980984211,
- 0.2041089684,
- 0.2101118416,
- 0.2161068022,
- 0.2220936269,
- 0.2280720919,
- 0.2340419590,
- 0.2400030345,
- 0.2459550500,
- 0.2518978119,
- 0.2578310966,
- 0.2637546957,
- 0.2696683407,
- 0.2755718231,
- 0.2814649343,
- 0.2873474658,
- 0.2932191789,
- 0.2990798354,
- 0.3049292266,
- 0.3107671738,
- 0.3165933788,
- 0.3224076927,
- 0.3282098472,
- 0.3339996636,
- 0.3397769034,
- 0.3455413282,
- 0.3512927592,
- 0.3570309579,
- 0.3627557456,
- 0.3684668541,
- 0.3741640747,
- 0.3798472285,
- 0.3855160773,
- 0.3911703825,
- 0.3968099952,
- 0.4024346471,
- 0.4080441594,
- 0.4136383235,
- 0.4192169011,
- 0.4247796834,
- 0.4303264916,
- 0.4358570874,
- 0.4413712919,
- 0.4468688369,
- 0.4523496032,
- 0.4578133225,
- 0.4632597864,
- 0.4686888456,
- 0.4741002321,
- 0.4794937670,
- 0.4848692715,
- 0.4902265072,
- 0.4955652654,
- 0.5008853674,
- 0.5061866641,
- 0.5114688873,
- 0.5167317986,
- 0.5219752789,
- 0.5271991491,
- 0.5324031115,
- 0.5375871062,
- 0.5427507758,
- 0.5478940606,
- 0.5530167222,
- 0.5581185222,
- 0.5631993413,
- 0.5682589412,
- 0.5732972026,
- 0.5783138275,
- 0.5833086967,
- 0.5882815719,
- 0.5932323337,
- 0.5981607437,
- 0.6030666232,
- 0.6079497933,
- 0.6128100753,
- 0.6176473498,
- 0.6224613190,
- 0.6272518039,
- 0.6320187449,
- 0.6367619038,
- 0.6414810419,
- 0.6461760402,
- 0.6508467197,
- 0.6554928422,
- 0.6601143479,
- 0.6647109985,
- 0.6692826152,
- 0.6738290191,
- 0.6783500314,
- 0.6828455329,
- 0.6873153448,
- 0.6917592883,
- 0.6961771250,
- 0.7005687952,
- 0.7049341202,
- 0.7092728615,
- 0.7135848999,
- 0.7178700566,
- 0.7221282125,
- 0.7263591886,
- 0.7305628061,
- 0.7347388864,
- 0.7388873696,
- 0.7430079579,
- 0.7471006513,
- 0.7511651516,
- 0.7552013993,
- 0.7592092156,
- 0.7631884217,
- 0.7671388984,
- 0.7710605264,
- 0.7749531269,
- 0.7788165212,
- 0.7826505899,
- 0.7864552140,
- 0.7902302146,
- 0.7939754725,
- 0.7976908684,
- 0.8013761640,
- 0.8050313592,
- 0.8086562157,
- 0.8122506142,
- 0.8158144355,
- 0.8193475604,
- 0.8228498101,
- 0.8263210654,
- 0.8297612667,
- 0.8331701756,
- 0.8365477324,
- 0.8398938179,
- 0.8432082534,
- 0.8464909792,
- 0.8497417569,
- 0.8529606462,
- 0.8561473489,
- 0.8593018055,
- 0.8624239564,
- 0.8655136228,
- 0.8685707450,
- 0.8715950847,
- 0.8745866418,
- 0.8775452971,
- 0.8804709315,
- 0.8833633661,
- 0.8862225413,
- 0.8890483975,
- 0.8918406963,
- 0.8945994973,
- 0.8973246217,
- 0.9000158906,
- 0.9026733041,
- 0.9052967429,
- 0.9078861475,
- 0.9104412794,
- 0.9129621983,
- 0.9154487252,
- 0.9179008007,
- 0.9203183055,
- 0.9227011204,
- 0.9250492454,
- 0.9273625612,
- 0.9296408892,
- 0.9318842888,
- 0.9340925813,
- 0.9362657070,
- 0.9384035468,
- 0.9405061007,
- 0.9425731897,
- 0.9446048737,
- 0.9466009140,
- 0.9485613704,
- 0.9504860640,
- 0.9523749948,
- 0.9542281032,
- 0.9560452700,
- 0.9578264356,
- 0.9595715404,
- 0.9612805247,
- 0.9629532695,
- 0.9645897746,
- 0.9661900401,
- 0.9677538276,
- 0.9692812562,
- 0.9707721472,
- 0.9722265005,
- 0.9736442566,
- 0.9750253558,
- 0.9763697386,
- 0.9776773453,
- 0.9789481759,
- 0.9801821709,
- 0.9813792109,
- 0.9825392962,
- 0.9836624265,
- 0.9847484827,
- 0.9857975245,
- 0.9868094325,
- 0.9877841473,
- 0.9887216687,
- 0.9896219969,
- 0.9904850721,
- 0.9913108945,
- 0.9920993447,
- 0.9928504229,
- 0.9935641289,
- 0.9942404628,
- 0.9948793054,
- 0.9954807758,
- 0.9960446954,
- 0.9965711236,
- 0.9970600605,
- 0.9975114465,
- 0.9979252815,
- 0.9983015656,
- 0.9986402392,
- 0.9989413023,
- 0.9992047548,
- 0.9994305968,
- 0.9996188283,
- 0.9997693896,
- 0.9998823404,
- 0.9999576211,
- 0.9999952912
-};
-
-static real_t kbd_short_32[] = {
- 0.0000875914060105,
- 0.0009321760265333,
- 0.0032114611466596,
- 0.0081009893216786,
- 0.0171240286619181,
- 0.0320720743527833,
- 0.0548307856028528,
- 0.0871361822564870,
- 0.1302923415174603,
- 0.1848955425508276,
- 0.2506163195331889,
- 0.3260874142923209,
- 0.4089316830907141,
- 0.4959414909423747,
- 0.5833939894958904,
- 0.6674601983218376,
- 0.7446454751465113,
- 0.8121892962974020,
- 0.8683559394406505,
- 0.9125649996381605,
- 0.9453396205809574,
- 0.9680864942677585,
- 0.9827581789763112,
- 0.9914756203467121,
- 0.9961964092194694,
- 0.9984956609571091,
- 0.9994855586984285,
- 0.9998533730714648,
- 0.9999671864476404,
- 0.9999948432453556,
- 0.9999995655238333,
- 0.9999999961638728
-};
-
-
-static real_t kbd_long_256[] = {
- 0.0005851230124487,
- 0.0009642149851497,
- 0.0013558207534965,
- 0.0017771849644394,
- 0.0022352533849672,
- 0.0027342299070304,
- 0.0032773001022195,
- 0.0038671998069216,
- 0.0045064443384152,
- 0.0051974336885144,
- 0.0059425050016407,
- 0.0067439602523141,
- 0.0076040812644888,
- 0.0085251378135895,
- 0.0095093917383048,
- 0.0105590986429280,
- 0.0116765080854300,
- 0.0128638627792770,
- 0.0141233971318631,
- 0.0154573353235409,
- 0.0168678890600951,
- 0.0183572550877256,
- 0.0199276125319803,
- 0.0215811201042484,
- 0.0233199132076965,
- 0.0251461009666641,
- 0.0270617631981826,
- 0.0290689473405856,
- 0.0311696653515848,
- 0.0333658905863535,
- 0.0356595546648444,
- 0.0380525443366107,
- 0.0405466983507029,
- 0.0431438043376910,
- 0.0458455957104702,
- 0.0486537485902075,
- 0.0515698787635492,
- 0.0545955386770205,
- 0.0577322144743916,
- 0.0609813230826460,
- 0.0643442093520723,
- 0.0678221432558827,
- 0.0714163171546603,
- 0.0751278431308314,
- 0.0789577503982528,
- 0.0829069827918993,
- 0.0869763963425241,
- 0.0911667569410503,
- 0.0954787380973307,
- 0.0999129187977865,
- 0.1044697814663005,
- 0.1091497100326053,
- 0.1139529881122542,
- 0.1188797973021148,
- 0.1239302155951605,
- 0.1291042159181728,
- 0.1344016647957880,
- 0.1398223211441467,
- 0.1453658351972151,
- 0.1510317475686540,
- 0.1568194884519144,
- 0.1627283769610327,
- 0.1687576206143887,
- 0.1749063149634756,
- 0.1811734433685097,
- 0.1875578769224857,
- 0.1940583745250518,
- 0.2006735831073503,
- 0.2074020380087318,
- 0.2142421635060113,
- 0.2211922734956977,
- 0.2282505723293797,
- 0.2354151558022098,
- 0.2426840122941792,
- 0.2500550240636293,
- 0.2575259686921987,
- 0.2650945206801527,
- 0.2727582531907993,
- 0.2805146399424422,
- 0.2883610572460804,
- 0.2962947861868143,
- 0.3043130149466800,
- 0.3124128412663888,
- 0.3205912750432127,
- 0.3288452410620226,
- 0.3371715818562547,
- 0.3455670606953511,
- 0.3540283646950029,
- 0.3625521080463003,
- 0.3711348353596863,
- 0.3797730251194006,
- 0.3884630932439016,
- 0.3972013967475546,
- 0.4059842374986933,
- 0.4148078660689724,
- 0.4236684856687616,
- 0.4325622561631607,
- 0.4414852981630577,
- 0.4504336971855032,
- 0.4594035078775303,
- 0.4683907582974173,
- 0.4773914542472655,
- 0.4864015836506502,
- 0.4954171209689973,
- 0.5044340316502417,
- 0.5134482766032377,
- 0.5224558166913167,
- 0.5314526172383208,
- 0.5404346525403849,
- 0.5493979103766972,
- 0.5583383965124314,
- 0.5672521391870222,
- 0.5761351935809411,
- 0.5849836462541291,
- 0.5937936195492526,
- 0.6025612759529649,
- 0.6112828224083939,
- 0.6199545145721097,
- 0.6285726610088878,
- 0.6371336273176413,
- 0.6456338401819751,
- 0.6540697913388968,
- 0.6624380414593221,
- 0.6707352239341151,
- 0.6789580485595255,
- 0.6871033051160131,
- 0.6951678668345944,
- 0.7031486937449871,
- 0.7110428359000029,
- 0.7188474364707993,
- 0.7265597347077880,
- 0.7341770687621900,
- 0.7416968783634273,
- 0.7491167073477523,
- 0.7564342060337386,
- 0.7636471334404891,
- 0.7707533593446514,
- 0.7777508661725849,
- 0.7846377507242818,
- 0.7914122257259034,
- 0.7980726212080798,
- 0.8046173857073919,
- 0.8110450872887550,
- 0.8173544143867162,
- 0.8235441764639875,
- 0.8296133044858474,
- 0.8355608512093652,
- 0.8413859912867303,
- 0.8470880211822968,
- 0.8526663589032990,
- 0.8581205435445334,
- 0.8634502346476508,
- 0.8686552113760616,
- 0.8737353715068081,
- 0.8786907302411250,
- 0.8835214188357692,
- 0.8882276830575707,
- 0.8928098814640207,
- 0.8972684835130879,
- 0.9016040675058185,
- 0.9058173183656508,
- 0.9099090252587376,
- 0.9138800790599416,
- 0.9177314696695282,
- 0.9214642831859411,
- 0.9250796989403991,
- 0.9285789863994010,
- 0.9319635019415643,
- 0.9352346855155568,
- 0.9383940571861993,
- 0.9414432135761304,
- 0.9443838242107182,
- 0.9472176277741918,
- 0.9499464282852282,
- 0.9525720912004834,
- 0.9550965394547873,
- 0.9575217494469370,
- 0.9598497469802043,
- 0.9620826031668507,
- 0.9642224303060783,
- 0.9662713777449607,
- 0.9682316277319895,
- 0.9701053912729269,
- 0.9718949039986892,
- 0.9736024220549734,
- 0.9752302180233160,
- 0.9767805768831932,
- 0.9782557920246753,
- 0.9796581613210076,
- 0.9809899832703159,
- 0.9822535532154261,
- 0.9834511596505429,
- 0.9845850806232530,
- 0.9856575802399989,
- 0.9866709052828243,
- 0.9876272819448033,
- 0.9885289126911557,
- 0.9893779732525968,
- 0.9901766097569984,
- 0.9909269360049311,
- 0.9916310308941294,
- 0.9922909359973702,
- 0.9929086532976777,
- 0.9934861430841844,
- 0.9940253220113651,
- 0.9945280613237534,
- 0.9949961852476154,
- 0.9954314695504363,
- 0.9958356402684387,
- 0.9962103726017252,
- 0.9965572899760172,
- 0.9968779632693499,
- 0.9971739102014799,
- 0.9974465948831872,
- 0.9976974275220812,
- 0.9979277642809907,
- 0.9981389072844972,
- 0.9983321047686901,
- 0.9985085513687731,
- 0.9986693885387259,
- 0.9988157050968516,
- 0.9989485378906924,
- 0.9990688725744943,
- 0.9991776444921379,
- 0.9992757396582338,
- 0.9993639958299003,
- 0.9994432036616085,
- 0.9995141079353859,
- 0.9995774088586188,
- 0.9996337634216871,
- 0.9996837868076957,
- 0.9997280538466377,
- 0.9997671005064359,
- 0.9998014254134544,
- 0.9998314913952471,
- 0.9998577270385304,
- 0.9998805282555989,
- 0.9999002598526793,
- 0.9999172570940037,
- 0.9999318272557038,
- 0.9999442511639580,
- 0.9999547847121726,
- 0.9999636603523446,
- 0.9999710885561258,
- 0.9999772592414866,
- 0.9999823431612708,
- 0.9999864932503106,
- 0.9999898459281599,
- 0.9999925223548691,
- 0.9999946296375997,
- 0.9999962619864214,
- 0.9999975018180320,
- 0.9999984208055542,
- 0.9999990808746198,
- 0.9999995351446231,
- 0.9999998288155155
-};
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/libfaad/structs.h b/src/libfaad/structs.h
deleted file mode 100644
index db6361a5c..000000000
--- a/src/libfaad/structs.h
+++ /dev/null
@@ -1,473 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: structs.h,v 1.7 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __STRUCTS_H__
-#define __STRUCTS_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "cfft.h"
-#ifdef SBR_DEC
-#include "sbr_dec.h"
-#endif
-
-#define MAX_CHANNELS 64
-#define MAX_SYNTAX_ELEMENTS 48
-#define MAX_WINDOW_GROUPS 8
-#define MAX_SFB 51
-#define MAX_LTP_SFB 40
-#define MAX_LTP_SFB_S 8
-
-/* used to save the prediction state */
-typedef struct {
- int16_t r[2];
- int16_t COR[2];
- int16_t VAR[2];
-} pred_state;
-
-typedef struct {
- uint16_t N;
- cfft_info *cfft;
- complex_t *sincos;
-#ifdef PROFILE
- int64_t cycles;
- int64_t fft_cycles;
-#endif
-} mdct_info;
-
-typedef struct
-{
- const real_t *long_window[2];
- const real_t *short_window[2];
-#ifdef LD_DEC
- const real_t *ld_window[2];
-#endif
-
- mdct_info *mdct256;
-#ifdef LD_DEC
- mdct_info *mdct1024;
-#endif
- mdct_info *mdct2048;
-#ifdef PROFILE
- int64_t cycles;
-#endif
-} fb_info;
-
-typedef struct
-{
- uint8_t present;
-
- uint8_t num_bands;
- uint8_t pce_instance_tag;
- uint8_t excluded_chns_present;
- uint8_t band_top[17];
- uint8_t prog_ref_level;
- uint8_t dyn_rng_sgn[17];
- uint8_t dyn_rng_ctl[17];
- uint8_t exclude_mask[MAX_CHANNELS];
- uint8_t additional_excluded_chns[MAX_CHANNELS];
-
- real_t ctrl1;
- real_t ctrl2;
-} drc_info;
-
-typedef struct
-{
- uint8_t element_instance_tag;
- uint8_t object_type;
- uint8_t sf_index;
- uint8_t num_front_channel_elements;
- uint8_t num_side_channel_elements;
- uint8_t num_back_channel_elements;
- uint8_t num_lfe_channel_elements;
- uint8_t num_assoc_data_elements;
- uint8_t num_valid_cc_elements;
- uint8_t mono_mixdown_present;
- uint8_t mono_mixdown_element_number;
- uint8_t stereo_mixdown_present;
- uint8_t stereo_mixdown_element_number;
- uint8_t matrix_mixdown_idx_present;
- uint8_t pseudo_surround_enable;
- uint8_t matrix_mixdown_idx;
- uint8_t front_element_is_cpe[16];
- uint8_t front_element_tag_select[16];
- uint8_t side_element_is_cpe[16];
- uint8_t side_element_tag_select[16];
- uint8_t back_element_is_cpe[16];
- uint8_t back_element_tag_select[16];
- uint8_t lfe_element_tag_select[16];
- uint8_t assoc_data_element_tag_select[16];
- uint8_t cc_element_is_ind_sw[16];
- uint8_t valid_cc_element_tag_select[16];
-
- uint8_t channels;
-
- uint8_t comment_field_bytes;
- uint8_t comment_field_data[257];
-
- /* extra added values */
- uint8_t num_front_channels;
- uint8_t num_side_channels;
- uint8_t num_back_channels;
- uint8_t num_lfe_channels;
- uint8_t sce_channel[16];
- uint8_t cpe_channel[16];
-} program_config;
-
-typedef struct
-{
- uint16_t syncword;
- uint8_t id;
- uint8_t layer;
- uint8_t protection_absent;
- uint8_t profile;
- uint8_t sf_index;
- uint8_t private_bit;
- uint8_t channel_configuration;
- uint8_t original;
- uint8_t home;
- uint8_t emphasis;
- uint8_t copyright_identification_bit;
- uint8_t copyright_identification_start;
- uint16_t aac_frame_length;
- uint16_t adts_buffer_fullness;
- uint8_t no_raw_data_blocks_in_frame;
- uint16_t crc_check;
-
- /* control param */
- uint8_t old_format;
-} adts_header;
-
-typedef struct
-{
- uint8_t copyright_id_present;
- int8_t copyright_id[10];
- uint8_t original_copy;
- uint8_t home;
- uint8_t bitstream_type;
- uint32_t bitrate;
- uint8_t num_program_config_elements;
- uint32_t adif_buffer_fullness;
-
- /* maximum of 16 PCEs */
- program_config pce[16];
-} adif_header;
-
-#ifdef LTP_DEC
-typedef struct
-{
- uint8_t last_band;
- uint8_t data_present;
- uint16_t lag;
- uint8_t lag_update;
- uint8_t coef;
- uint8_t long_used[MAX_SFB];
- uint8_t short_used[8];
- uint8_t short_lag_present[8];
- uint8_t short_lag[8];
-} ltp_info;
-#endif
-
-#ifdef MAIN_DEC
-typedef struct
-{
- uint8_t limit;
- uint8_t predictor_reset;
- uint8_t predictor_reset_group_number;
- uint8_t prediction_used[MAX_SFB];
-} pred_info;
-#endif
-
-typedef struct
-{
- uint8_t number_pulse;
- uint8_t pulse_start_sfb;
- uint8_t pulse_offset[4];
- uint8_t pulse_amp[4];
-} pulse_info;
-
-typedef struct
-{
- uint8_t n_filt[8];
- uint8_t coef_res[8];
- uint8_t length[8][4];
- uint8_t order[8][4];
- uint8_t direction[8][4];
- uint8_t coef_compress[8][4];
- uint8_t coef[8][4][32];
-} tns_info;
-
-#ifdef SSR_DEC
-typedef struct
-{
- uint8_t max_band;
-
- uint8_t adjust_num[4][8];
- uint8_t alevcode[4][8][8];
- uint8_t aloccode[4][8][8];
-} ssr_info;
-#endif
-
-typedef struct
-{
- uint8_t max_sfb;
-
- uint8_t num_swb;
- uint8_t num_window_groups;
- uint8_t num_windows;
- uint8_t window_sequence;
- uint8_t window_group_length[8];
- uint8_t window_shape;
- uint8_t scale_factor_grouping;
- uint16_t sect_sfb_offset[8][15*8];
- uint16_t swb_offset[52];
-
- uint8_t sect_cb[8][15*8];
- uint16_t sect_start[8][15*8];
- uint16_t sect_end[8][15*8];
- uint8_t sfb_cb[8][8*15];
- uint8_t num_sec[8]; /* number of sections in a group */
-
- uint8_t global_gain;
- int16_t scale_factors[8][51]; /* [0..255] */
-
- uint8_t ms_mask_present;
- uint8_t ms_used[MAX_WINDOW_GROUPS][MAX_SFB];
-
- uint8_t noise_used;
-
- uint8_t pulse_data_present;
- uint8_t tns_data_present;
- uint8_t gain_control_data_present;
- uint8_t predictor_data_present;
-
- pulse_info pul;
- tns_info tns;
-#ifdef MAIN_DEC
- pred_info pred;
-#endif
-#ifdef LTP_DEC
- ltp_info ltp;
- ltp_info ltp2;
-#endif
-#ifdef SSR_DEC
- ssr_info ssr;
-#endif
-
-#ifdef ERROR_RESILIENCE
- /* ER HCR data */
- uint16_t length_of_reordered_spectral_data;
- uint8_t length_of_longest_codeword;
- /* ER RLVC data */
- uint8_t sf_concealment;
- uint8_t rev_global_gain;
- uint16_t length_of_rvlc_sf;
- uint16_t dpcm_noise_nrg;
- uint8_t sf_escapes_present;
- uint8_t length_of_rvlc_escapes;
- uint16_t dpcm_noise_last_position;
-#endif
-} ic_stream; /* individual channel stream */
-
-typedef struct
-{
- uint8_t channel;
- int16_t paired_channel;
-
- uint8_t element_instance_tag;
- uint8_t common_window;
-
- ic_stream ics1;
- ic_stream ics2;
-} element; /* syntax element (SCE, CPE, LFE) */
-
-typedef struct mp4AudioSpecificConfig
-{
- /* Audio Specific Info */
- /*uint8_t*/ unsigned char objectTypeIndex;
- /*uint8_t*/ unsigned char samplingFrequencyIndex;
- /*uint32_t*/ unsigned long samplingFrequency;
- /*uint8_t*/ unsigned char channelsConfiguration;
-
- /* GA Specific Info */
- /*uint8_t*/ unsigned char frameLengthFlag;
- /*uint8_t*/ unsigned char dependsOnCoreCoder;
- /*uint16_t*/ unsigned short coreCoderDelay;
- /*uint8_t*/ unsigned char extensionFlag;
- /*uint8_t*/ unsigned char aacSectionDataResilienceFlag;
- /*uint8_t*/ unsigned char aacScalefactorDataResilienceFlag;
- /*uint8_t*/ unsigned char aacSpectralDataResilienceFlag;
- /*uint8_t*/ unsigned char epConfig;
-
- /*uint8_t*/ char sbr_present_flag;
- /*uint8_t*/ char forceUpSampling;
- /*uint8_t*/ char downSampledSBR;
-} mp4AudioSpecificConfig;
-
-typedef struct NeAACDecConfiguration
-{
- /*uint8_t*/ unsigned char defObjectType;
- /*uint32_t*/ unsigned long defSampleRate;
- /*uint8_t*/ unsigned char outputFormat;
- /*uint8_t*/ unsigned char downMatrix;
- /*uint8_t*/ unsigned char useOldADTSFormat;
- /*uint8_t*/ unsigned char dontUpSampleImplicitSBR;
-} NeAACDecConfiguration, *NeAACDecConfigurationPtr;
-
-typedef struct NeAACDecFrameInfo
-{
- /*uint32_t*/ unsigned long bytesconsumed;
- /*uint32_t*/ unsigned long samples;
- /*uint8_t*/ unsigned char channels;
- /*uint8_t*/ unsigned char error;
- /*uint32_t*/ unsigned long samplerate;
-
- /* SBR: 0: off, 1: on; normal, 2: on; downsampled */
- /*uint8_t*/ unsigned char sbr;
-
- /* MPEG-4 ObjectType */
- /*uint8_t*/ unsigned char object_type;
-
- /* AAC header type; MP4 will be signalled as RAW also */
- /*uint8_t*/ unsigned char header_type;
-
- /* multichannel configuration */
- /*uint8_t*/ unsigned char num_front_channels;
- /*uint8_t*/ unsigned char num_side_channels;
- /*uint8_t*/ unsigned char num_back_channels;
- /*uint8_t*/ unsigned char num_lfe_channels;
- /*uint8_t*/ unsigned char channel_position[MAX_CHANNELS];
-
- /* PS: 0: off, 1: on */
- /*uint8_t*/ unsigned char ps;
-} NeAACDecFrameInfo;
-
-typedef struct
-{
- uint8_t adts_header_present;
- uint8_t adif_header_present;
- uint8_t sf_index;
- uint8_t object_type;
- uint8_t channelConfiguration;
-#ifdef ERROR_RESILIENCE
- uint8_t aacSectionDataResilienceFlag;
- uint8_t aacScalefactorDataResilienceFlag;
- uint8_t aacSpectralDataResilienceFlag;
-#endif
- uint16_t frameLength;
- uint8_t postSeekResetFlag;
-
- uint32_t frame;
-
- uint8_t downMatrix;
- uint8_t upMatrix;
- uint8_t first_syn_ele;
- uint8_t has_lfe;
- /* number of channels in current frame */
- uint8_t fr_channels;
- /* number of elements in current frame */
- uint8_t fr_ch_ele;
-
- /* element_output_channels:
- determines the number of channels the element will output
- */
- uint8_t element_output_channels[MAX_SYNTAX_ELEMENTS];
- /* element_alloced:
- determines whether the data needed for the element is allocated or not
- */
- uint8_t element_alloced[MAX_SYNTAX_ELEMENTS];
- /* alloced_channels:
- determines the number of channels where output data is allocated for
- */
- uint8_t alloced_channels;
-
- /* output data buffer */
- void *sample_buffer;
-
- uint8_t window_shape_prev[MAX_CHANNELS];
-#ifdef LTP_DEC
- uint16_t ltp_lag[MAX_CHANNELS];
-#endif
- fb_info *fb;
- drc_info *drc;
-
- real_t *time_out[MAX_CHANNELS];
- real_t *fb_intermed[MAX_CHANNELS];
-
-#ifdef SBR_DEC
- int8_t sbr_present_flag;
- int8_t forceUpSampling;
- int8_t downSampledSBR;
- /* determines whether SBR data is allocated for the gives element */
- uint8_t sbr_alloced[MAX_SYNTAX_ELEMENTS];
-
- sbr_info *sbr[MAX_SYNTAX_ELEMENTS];
-#endif
-#if (defined(PS_DEC) || defined(DRM_PS))
- uint8_t ps_used[MAX_SYNTAX_ELEMENTS];
- uint8_t ps_used_global;
-#endif
-
-#ifdef SSR_DEC
- real_t *ssr_overlap[MAX_CHANNELS];
- real_t *prev_fmd[MAX_CHANNELS];
- real_t ipqf_buffer[MAX_CHANNELS][4][96/4];
-#endif
-
-#ifdef MAIN_DEC
- pred_state *pred_stat[MAX_CHANNELS];
-#endif
-#ifdef LTP_DEC
- int16_t *lt_pred_stat[MAX_CHANNELS];
-#endif
-
- /* Program Config Element */
- uint8_t pce_set;
- program_config pce;
- uint8_t element_id[MAX_CHANNELS];
- uint8_t internal_channel[MAX_CHANNELS];
-
- /* Configuration data */
- NeAACDecConfiguration config;
-
-#ifdef PROFILE
- int64_t cycles;
- int64_t spectral_cycles;
- int64_t output_cycles;
- int64_t scalefac_cycles;
- int64_t requant_cycles;
-#endif
-} NeAACDecStruct, *NeAACDecHandle;
-
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/libfaad/syntax.c b/src/libfaad/syntax.c
deleted file mode 100644
index 6dc9fc57d..000000000
--- a/src/libfaad/syntax.c
+++ /dev/null
@@ -1,2330 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: syntax.c,v 1.10 2006/09/26 17:48:24 dgp85 Exp $
-**/
-
-/*
- Reads the AAC bitstream as defined in 14496-3 (MPEG-4 Audio)
-*/
-
-#include "common.h"
-#include "structs.h"
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "decoder.h"
-#include "syntax.h"
-#include "specrec.h"
-#include "huffman.h"
-#include "bits.h"
-#include "pulse.h"
-#include "analysis.h"
-#include "drc.h"
-#ifdef ERROR_RESILIENCE
-#include "rvlc.h"
-#endif
-#ifdef SBR_DEC
-#include "sbr_syntax.h"
-#endif
-
-
-/* static function declarations */
-static void decode_sce_lfe(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo, bitfile *ld,
- uint8_t id_syn_ele);
-static void decode_cpe(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo, bitfile *ld,
- uint8_t id_syn_ele);
-static uint8_t single_lfe_channel_element(NeAACDecHandle hDecoder, bitfile *ld,
- uint8_t channel, uint8_t *tag);
-static uint8_t channel_pair_element(NeAACDecHandle hDecoder, bitfile *ld,
- uint8_t channel, uint8_t *tag);
-#ifdef COUPLING_DEC
-static uint8_t coupling_channel_element(NeAACDecHandle hDecoder, bitfile *ld);
-#endif
-static uint16_t data_stream_element(NeAACDecHandle hDecoder, bitfile *ld);
-static uint8_t program_config_element(program_config *pce, bitfile *ld);
-static uint8_t fill_element(NeAACDecHandle hDecoder, bitfile *ld, drc_info *drc
-#ifdef SBR_DEC
- ,uint8_t sbr_ele
-#endif
- );
-static uint8_t individual_channel_stream(NeAACDecHandle hDecoder, element *ele,
- bitfile *ld, ic_stream *ics, uint8_t scal_flag,
- int16_t *spec_data);
-static uint8_t ics_info(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld,
- uint8_t common_window);
-static uint8_t section_data(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld);
-static uint8_t scale_factor_data(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld);
-#ifdef SSR_DEC
-static void gain_control_data(bitfile *ld, ic_stream *ics);
-#endif
-static uint8_t spectral_data(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld,
- int16_t *spectral_data);
-static uint16_t extension_payload(bitfile *ld, drc_info *drc, uint16_t count);
-static uint8_t pulse_data(ic_stream *ics, pulse_info *pul, bitfile *ld);
-static void tns_data(ic_stream *ics, tns_info *tns, bitfile *ld);
-#ifdef LTP_DEC
-static uint8_t ltp_data(NeAACDecHandle hDecoder, ic_stream *ics, ltp_info *ltp, bitfile *ld);
-#endif
-static uint8_t adts_fixed_header(adts_header *adts, bitfile *ld);
-static void adts_variable_header(adts_header *adts, bitfile *ld);
-static void adts_error_check(adts_header *adts, bitfile *ld);
-static uint8_t dynamic_range_info(bitfile *ld, drc_info *drc);
-static uint8_t excluded_channels(bitfile *ld, drc_info *drc);
-#ifdef SCALABLE_DEC
-static int8_t aac_scalable_main_header(NeAACDecHandle hDecoder, ic_stream *ics1, ic_stream *ics2,
- bitfile *ld, uint8_t this_layer_stereo);
-#endif
-
-
-/* Table 4.4.1 */
-int8_t GASpecificConfig(bitfile *ld, mp4AudioSpecificConfig *mp4ASC,
- program_config *pce_out)
-{
- program_config pce;
-
- /* 1024 or 960 */
- mp4ASC->frameLengthFlag = faad_get1bit(ld
- DEBUGVAR(1,138,"GASpecificConfig(): FrameLengthFlag"));
-#ifndef ALLOW_SMALL_FRAMELENGTH
- if (mp4ASC->frameLengthFlag == 1)
- return -3;
-#endif
-
- mp4ASC->dependsOnCoreCoder = faad_get1bit(ld
- DEBUGVAR(1,139,"GASpecificConfig(): DependsOnCoreCoder"));
- if (mp4ASC->dependsOnCoreCoder == 1)
- {
- mp4ASC->coreCoderDelay = (uint16_t)faad_getbits(ld, 14
- DEBUGVAR(1,140,"GASpecificConfig(): CoreCoderDelay"));
- }
-
- mp4ASC->extensionFlag = faad_get1bit(ld DEBUGVAR(1,141,"GASpecificConfig(): ExtensionFlag"));
- if (mp4ASC->channelsConfiguration == 0)
- {
- if (program_config_element(&pce, ld))
- return -3;
- //mp4ASC->channelsConfiguration = pce.channels;
-
- if (pce_out != NULL)
- memcpy(pce_out, &pce, sizeof(program_config));
-
- /*
- if (pce.num_valid_cc_elements)
- return -3;
- */
- }
-
-#ifdef ERROR_RESILIENCE
- if (mp4ASC->extensionFlag == 1)
- {
- /* Error resilience not supported yet */
- if (mp4ASC->objectTypeIndex >= ER_OBJECT_START)
- {
- mp4ASC->aacSectionDataResilienceFlag = faad_get1bit(ld
- DEBUGVAR(1,144,"GASpecificConfig(): aacSectionDataResilienceFlag"));
- mp4ASC->aacScalefactorDataResilienceFlag = faad_get1bit(ld
- DEBUGVAR(1,145,"GASpecificConfig(): aacScalefactorDataResilienceFlag"));
- mp4ASC->aacSpectralDataResilienceFlag = faad_get1bit(ld
- DEBUGVAR(1,146,"GASpecificConfig(): aacSpectralDataResilienceFlag"));
-
- /* 1 bit: extensionFlag3 */
- }
- }
-#endif
-
- return 0;
-}
-
-/* Table 4.4.2 */
-/* An MPEG-4 Audio decoder is only required to follow the Program
- Configuration Element in GASpecificConfig(). The decoder shall ignore
- any Program Configuration Elements that may occur in raw data blocks.
- PCEs transmitted in raw data blocks cannot be used to convey decoder
- configuration information.
-*/
-static uint8_t program_config_element(program_config *pce, bitfile *ld)
-{
- uint8_t i;
-
- memset(pce, 0, sizeof(program_config));
-
- pce->channels = 0;
-
- pce->element_instance_tag = (uint8_t)faad_getbits(ld, 4
- DEBUGVAR(1,10,"program_config_element(): element_instance_tag"));
-
- pce->object_type = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,11,"program_config_element(): object_type"));
- pce->sf_index = (uint8_t)faad_getbits(ld, 4
- DEBUGVAR(1,12,"program_config_element(): sf_index"));
- pce->num_front_channel_elements = (uint8_t)faad_getbits(ld, 4
- DEBUGVAR(1,13,"program_config_element(): num_front_channel_elements"));
- pce->num_side_channel_elements = (uint8_t)faad_getbits(ld, 4
- DEBUGVAR(1,14,"program_config_element(): num_side_channel_elements"));
- pce->num_back_channel_elements = (uint8_t)faad_getbits(ld, 4
- DEBUGVAR(1,15,"program_config_element(): num_back_channel_elements"));
- pce->num_lfe_channel_elements = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,16,"program_config_element(): num_lfe_channel_elements"));
- pce->num_assoc_data_elements = (uint8_t)faad_getbits(ld, 3
- DEBUGVAR(1,17,"program_config_element(): num_assoc_data_elements"));
- pce->num_valid_cc_elements = (uint8_t)faad_getbits(ld, 4
- DEBUGVAR(1,18,"program_config_element(): num_valid_cc_elements"));
-
- pce->mono_mixdown_present = faad_get1bit(ld
- DEBUGVAR(1,19,"program_config_element(): mono_mixdown_present"));
- if (pce->mono_mixdown_present == 1)
- {
- pce->mono_mixdown_element_number = (uint8_t)faad_getbits(ld, 4
- DEBUGVAR(1,20,"program_config_element(): mono_mixdown_element_number"));
- }
-
- pce->stereo_mixdown_present = faad_get1bit(ld
- DEBUGVAR(1,21,"program_config_element(): stereo_mixdown_present"));
- if (pce->stereo_mixdown_present == 1)
- {
- pce->stereo_mixdown_element_number = (uint8_t)faad_getbits(ld, 4
- DEBUGVAR(1,22,"program_config_element(): stereo_mixdown_element_number"));
- }
-
- pce->matrix_mixdown_idx_present = faad_get1bit(ld
- DEBUGVAR(1,23,"program_config_element(): matrix_mixdown_idx_present"));
- if (pce->matrix_mixdown_idx_present == 1)
- {
- pce->matrix_mixdown_idx = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,24,"program_config_element(): matrix_mixdown_idx"));
- pce->pseudo_surround_enable = faad_get1bit(ld
- DEBUGVAR(1,25,"program_config_element(): pseudo_surround_enable"));
- }
-
- for (i = 0; i < pce->num_front_channel_elements; i++)
- {
- pce->front_element_is_cpe[i] = faad_get1bit(ld
- DEBUGVAR(1,26,"program_config_element(): front_element_is_cpe"));
- pce->front_element_tag_select[i] = (uint8_t)faad_getbits(ld, 4
- DEBUGVAR(1,27,"program_config_element(): front_element_tag_select"));
-
- if (pce->front_element_is_cpe[i] & 1)
- {
- pce->cpe_channel[pce->front_element_tag_select[i]] = pce->channels;
- pce->num_front_channels += 2;
- pce->channels += 2;
- } else {
- pce->sce_channel[pce->front_element_tag_select[i]] = pce->channels;
- pce->num_front_channels++;
- pce->channels++;
- }
- }
-
- for (i = 0; i < pce->num_side_channel_elements; i++)
- {
- pce->side_element_is_cpe[i] = faad_get1bit(ld
- DEBUGVAR(1,28,"program_config_element(): side_element_is_cpe"));
- pce->side_element_tag_select[i] = (uint8_t)faad_getbits(ld, 4
- DEBUGVAR(1,29,"program_config_element(): side_element_tag_select"));
-
- if (pce->side_element_is_cpe[i] & 1)
- {
- pce->cpe_channel[pce->side_element_tag_select[i]] = pce->channels;
- pce->num_side_channels += 2;
- pce->channels += 2;
- } else {
- pce->sce_channel[pce->side_element_tag_select[i]] = pce->channels;
- pce->num_side_channels++;
- pce->channels++;
- }
- }
-
- for (i = 0; i < pce->num_back_channel_elements; i++)
- {
- pce->back_element_is_cpe[i] = faad_get1bit(ld
- DEBUGVAR(1,30,"program_config_element(): back_element_is_cpe"));
- pce->back_element_tag_select[i] = (uint8_t)faad_getbits(ld, 4
- DEBUGVAR(1,31,"program_config_element(): back_element_tag_select"));
-
- if (pce->back_element_is_cpe[i] & 1)
- {
- pce->cpe_channel[pce->back_element_tag_select[i]] = pce->channels;
- pce->channels += 2;
- pce->num_back_channels += 2;
- } else {
- pce->sce_channel[pce->back_element_tag_select[i]] = pce->channels;
- pce->num_back_channels++;
- pce->channels++;
- }
- }
-
- for (i = 0; i < pce->num_lfe_channel_elements; i++)
- {
- pce->lfe_element_tag_select[i] = (uint8_t)faad_getbits(ld, 4
- DEBUGVAR(1,32,"program_config_element(): lfe_element_tag_select"));
-
- pce->sce_channel[pce->lfe_element_tag_select[i]] = pce->channels;
- pce->num_lfe_channels++;
- pce->channels++;
- }
-
- for (i = 0; i < pce->num_assoc_data_elements; i++)
- pce->assoc_data_element_tag_select[i] = (uint8_t)faad_getbits(ld, 4
- DEBUGVAR(1,33,"program_config_element(): assoc_data_element_tag_select"));
-
- for (i = 0; i < pce->num_valid_cc_elements; i++)
- {
- pce->cc_element_is_ind_sw[i] = faad_get1bit(ld
- DEBUGVAR(1,34,"program_config_element(): cc_element_is_ind_sw"));
- pce->valid_cc_element_tag_select[i] = (uint8_t)faad_getbits(ld, 4
- DEBUGVAR(1,35,"program_config_element(): valid_cc_element_tag_select"));
- }
-
- faad_byte_align(ld);
-
- pce->comment_field_bytes = (uint8_t)faad_getbits(ld, 8
- DEBUGVAR(1,36,"program_config_element(): comment_field_bytes"));
-
- for (i = 0; i < pce->comment_field_bytes; i++)
- {
- pce->comment_field_data[i] = (uint8_t)faad_getbits(ld, 8
- DEBUGVAR(1,37,"program_config_element(): comment_field_data"));
- }
- pce->comment_field_data[i] = 0;
-
- if (pce->channels > MAX_CHANNELS)
- return 22;
-
- return 0;
-}
-
-static void decode_sce_lfe(NeAACDecHandle hDecoder,
- NeAACDecFrameInfo *hInfo, bitfile *ld,
- uint8_t id_syn_ele)
-{
- uint8_t channels = hDecoder->fr_channels;
- uint8_t tag = 0;
-
- if (channels+1 >= MAX_CHANNELS)
- {
- hInfo->error = 12;
- return;
- }
- if (hDecoder->fr_ch_ele+1 > MAX_SYNTAX_ELEMENTS)
- {
- hInfo->error = 13;
- return;
- }
-
- /* for SCE hDecoder->element_output_channels[] is not set here because this
- can become 2 when some form of Parametric Stereo coding is used
- */
-
- /* save the syntax element id */
- hDecoder->element_id[hDecoder->fr_ch_ele] = id_syn_ele;
-
- /* decode the element */
- hInfo->error = single_lfe_channel_element(hDecoder, ld, channels, &tag);
-
- /* map output channels position to internal data channels */
- if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] == 2)
- {
- /* this might be faulty when pce_set is true */
- hDecoder->internal_channel[channels] = channels;
- hDecoder->internal_channel[channels+1] = channels+1;
- } else {
- if (hDecoder->pce_set)
- hDecoder->internal_channel[hDecoder->pce.sce_channel[tag]] = channels;
- else
- hDecoder->internal_channel[channels] = channels;
- }
-
- hDecoder->fr_channels += hDecoder->element_output_channels[hDecoder->fr_ch_ele];
- hDecoder->fr_ch_ele++;
-}
-
-static void decode_cpe(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo, bitfile *ld,
- uint8_t id_syn_ele)
-{
- uint8_t channels = hDecoder->fr_channels;
- uint8_t tag = 0;
-
- if (channels+2 > MAX_CHANNELS)
- {
- hInfo->error = 12;
- return;
- }
- if (hDecoder->fr_ch_ele+1 > MAX_SYNTAX_ELEMENTS)
- {
- hInfo->error = 13;
- return;
- }
-
- /* for CPE the number of output channels is always 2 */
- if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] == 0)
- {
- /* element_output_channels not set yet */
- hDecoder->element_output_channels[hDecoder->fr_ch_ele] = 2;
- } else if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] != 2) {
- /* element inconsistency */
- hInfo->error = 21;
- return;
- }
-
- /* save the syntax element id */
- hDecoder->element_id[hDecoder->fr_ch_ele] = id_syn_ele;
-
- /* decode the element */
- hInfo->error = channel_pair_element(hDecoder, ld, channels, &tag);
-
- /* map output channel position to internal data channels */
- if (hDecoder->pce_set)
- {
- hDecoder->internal_channel[hDecoder->pce.cpe_channel[tag]] = channels;
- hDecoder->internal_channel[hDecoder->pce.cpe_channel[tag]+1] = channels+1;
- } else {
- hDecoder->internal_channel[channels] = channels;
- hDecoder->internal_channel[channels+1] = channels+1;
- }
-
- hDecoder->fr_channels += 2;
- hDecoder->fr_ch_ele++;
-}
-
-void raw_data_block(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo,
- bitfile *ld, program_config *pce, drc_info *drc)
-{
- uint8_t id_syn_ele;
-
- hDecoder->fr_channels = 0;
- hDecoder->fr_ch_ele = 0;
- hDecoder->first_syn_ele = 25;
- hDecoder->has_lfe = 0;
-
-#ifdef ERROR_RESILIENCE
- if (hDecoder->object_type < ER_OBJECT_START)
- {
-#endif
- /* Table 4.4.3: raw_data_block() */
- while ((id_syn_ele = (uint8_t)faad_getbits(ld, LEN_SE_ID
- DEBUGVAR(1,4,"NeAACDecDecode(): id_syn_ele"))) != ID_END)
- {
- switch (id_syn_ele) {
- case ID_SCE:
- if (hDecoder->first_syn_ele == 25) hDecoder->first_syn_ele = id_syn_ele;
- decode_sce_lfe(hDecoder, hInfo, ld, id_syn_ele);
- if (hInfo->error > 0)
- return;
- break;
- case ID_CPE:
- if (hDecoder->first_syn_ele == 25) hDecoder->first_syn_ele = id_syn_ele;
- decode_cpe(hDecoder, hInfo, ld, id_syn_ele);
- if (hInfo->error > 0)
- return;
- break;
- case ID_LFE:
- hDecoder->has_lfe++;
- decode_sce_lfe(hDecoder, hInfo, ld, id_syn_ele);
- if (hInfo->error > 0)
- return;
- break;
- case ID_CCE: /* not implemented yet, but skip the bits */
-#ifdef COUPLING_DEC
- hInfo->error = coupling_channel_element(hDecoder, ld);
-#else
- hInfo->error = 6;
-#endif
- if (hInfo->error > 0)
- return;
- break;
- case ID_DSE:
- data_stream_element(hDecoder, ld);
- break;
- case ID_PCE:
- /* 14496-4: 5.6.4.1.2.1.3: */
- /* program_configuration_element()'s in access units shall be ignored */
- program_config_element(pce, ld);
- //if ((hInfo->error = program_config_element(pce, ld)) > 0)
- // return;
- //hDecoder->pce_set = 1;
- break;
- case ID_FIL:
- /* one sbr_info describes a channel_element not a channel! */
- /* if we encounter SBR data here: error */
- /* SBR data will be read directly in the SCE/LFE/CPE element */
- if ((hInfo->error = fill_element(hDecoder, ld, drc
-#ifdef SBR_DEC
- , INVALID_SBR_ELEMENT
-#endif
- )) > 0)
- return;
- break;
- }
- }
-#ifdef ERROR_RESILIENCE
- } else {
- /* Table 262: er_raw_data_block() */
- switch (hDecoder->channelConfiguration)
- {
- case 1:
- decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
- if (hInfo->error > 0)
- return;
- break;
- case 2:
- decode_cpe(hDecoder, hInfo, ld, ID_CPE);
- if (hInfo->error > 0)
- return;
- break;
- case 3:
- decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
- decode_cpe(hDecoder, hInfo, ld, ID_CPE);
- if (hInfo->error > 0)
- return;
- break;
- case 4:
- decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
- decode_cpe(hDecoder, hInfo, ld, ID_CPE);
- decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
- if (hInfo->error > 0)
- return;
- break;
- case 5:
- decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
- decode_cpe(hDecoder, hInfo, ld, ID_CPE);
- decode_cpe(hDecoder, hInfo, ld, ID_CPE);
- if (hInfo->error > 0)
- return;
- break;
- case 6:
- decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
- decode_cpe(hDecoder, hInfo, ld, ID_CPE);
- decode_cpe(hDecoder, hInfo, ld, ID_CPE);
- decode_sce_lfe(hDecoder, hInfo, ld, ID_LFE);
- if (hInfo->error > 0)
- return;
- break;
- case 7: /* 8 channels */
- decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
- decode_cpe(hDecoder, hInfo, ld, ID_CPE);
- decode_cpe(hDecoder, hInfo, ld, ID_CPE);
- decode_cpe(hDecoder, hInfo, ld, ID_CPE);
- decode_sce_lfe(hDecoder, hInfo, ld, ID_LFE);
- if (hInfo->error > 0)
- return;
- break;
- default:
- hInfo->error = 7;
- return;
- }
-#if 0
- cnt = bits_to_decode() / 8;
- while (cnt >= 1)
- {
- cnt -= extension_payload(cnt);
- }
-#endif
- }
-#endif
-
- /* new in corrigendum 14496-3:2002 */
-#ifdef DRM
- if (hDecoder->object_type != DRM_ER_LC)
-#endif
- {
- faad_byte_align(ld);
- }
-
- return;
-}
-
-/* Table 4.4.4 and */
-/* Table 4.4.9 */
-static uint8_t single_lfe_channel_element(NeAACDecHandle hDecoder, bitfile *ld,
- uint8_t channel, uint8_t *tag)
-{
- uint8_t retval = 0;
- element sce = {0};
- ic_stream *ics = &(sce.ics1);
- ALIGN int16_t spec_data[1024] = {0};
-
- sce.element_instance_tag = (uint8_t)faad_getbits(ld, LEN_TAG
- DEBUGVAR(1,38,"single_lfe_channel_element(): element_instance_tag"));
-
- *tag = sce.element_instance_tag;
- sce.channel = channel;
- sce.paired_channel = -1;
-
- retval = individual_channel_stream(hDecoder, &sce, ld, ics, 0, spec_data);
- if (retval > 0)
- return retval;
-
-#ifdef SBR_DEC
- /* check if next bitstream element is a fill element */
- /* if so, read it now so SBR decoding can be done in case of a file with SBR */
- if (faad_showbits(ld, LEN_SE_ID) == ID_FIL)
- {
- faad_flushbits(ld, LEN_SE_ID);
-
- /* one sbr_info describes a channel_element not a channel! */
- if ((retval = fill_element(hDecoder, ld, hDecoder->drc, hDecoder->fr_ch_ele)) > 0)
- {
- return retval;
- }
- }
-#endif
-
- /* noiseless coding is done, spectral reconstruction is done now */
- retval = reconstruct_single_channel(hDecoder, ics, &sce, spec_data);
- if (retval > 0)
- return retval;
-
- return 0;
-}
-
-/* Table 4.4.5 */
-static uint8_t channel_pair_element(NeAACDecHandle hDecoder, bitfile *ld,
- uint8_t channels, uint8_t *tag)
-{
- ALIGN int16_t spec_data1[1024] = {0};
- ALIGN int16_t spec_data2[1024] = {0};
- element cpe = {0};
- ic_stream *ics1 = &(cpe.ics1);
- ic_stream *ics2 = &(cpe.ics2);
- uint8_t result;
-
- cpe.channel = channels;
- cpe.paired_channel = channels+1;
-
- cpe.element_instance_tag = (uint8_t)faad_getbits(ld, LEN_TAG
- DEBUGVAR(1,39,"channel_pair_element(): element_instance_tag"));
- *tag = cpe.element_instance_tag;
-
- if ((cpe.common_window = faad_get1bit(ld
- DEBUGVAR(1,40,"channel_pair_element(): common_window"))) & 1)
- {
- /* both channels have common ics information */
- if ((result = ics_info(hDecoder, ics1, ld, cpe.common_window)) > 0)
- return result;
-
- ics1->ms_mask_present = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,41,"channel_pair_element(): ms_mask_present"));
- if (ics1->ms_mask_present == 1)
- {
- uint8_t g, sfb;
- for (g = 0; g < ics1->num_window_groups; g++)
- {
- for (sfb = 0; sfb < ics1->max_sfb; sfb++)
- {
- ics1->ms_used[g][sfb] = faad_get1bit(ld
- DEBUGVAR(1,42,"channel_pair_element(): faad_get1bit"));
- }
- }
- }
-
-#ifdef ERROR_RESILIENCE
- if ((hDecoder->object_type >= ER_OBJECT_START) && (ics1->predictor_data_present))
- {
- if ((
-#ifdef LTP_DEC
- ics1->ltp.data_present =
-#endif
- faad_get1bit(ld DEBUGVAR(1,50,"channel_pair_element(): ltp.data_present"))) & 1)
- {
-#ifdef LTP_DEC
- if ((result = ltp_data(hDecoder, ics1, &(ics1->ltp), ld)) > 0)
- {
- return result;
- }
-#else
- return 26;
-#endif
- }
- }
-#endif
-
- memcpy(ics2, ics1, sizeof(ic_stream));
- } else {
- ics1->ms_mask_present = 0;
- }
-
- if ((result = individual_channel_stream(hDecoder, &cpe, ld, ics1,
- 0, spec_data1)) > 0)
- {
- return result;
- }
-
-#ifdef ERROR_RESILIENCE
- if (cpe.common_window && (hDecoder->object_type >= ER_OBJECT_START) &&
- (ics1->predictor_data_present))
- {
- if ((
-#ifdef LTP_DEC
- ics1->ltp2.data_present =
-#endif
- faad_get1bit(ld DEBUGVAR(1,50,"channel_pair_element(): ltp.data_present"))) & 1)
- {
-#ifdef LTP_DEC
- if ((result = ltp_data(hDecoder, ics1, &(ics1->ltp2), ld)) > 0)
- {
- return result;
- }
-#else
- return 26;
-#endif
- }
- }
-#endif
-
- if ((result = individual_channel_stream(hDecoder, &cpe, ld, ics2,
- 0, spec_data2)) > 0)
- {
- return result;
- }
-
-#ifdef SBR_DEC
- /* check if next bitstream element is a fill element */
- /* if so, read it now so SBR decoding can be done in case of a file with SBR */
- if (faad_showbits(ld, LEN_SE_ID) == ID_FIL)
- {
- faad_flushbits(ld, LEN_SE_ID);
-
- /* one sbr_info describes a channel_element not a channel! */
- if ((result = fill_element(hDecoder, ld, hDecoder->drc, hDecoder->fr_ch_ele)) > 0)
- {
- return result;
- }
- }
-#endif
-
- /* noiseless coding is done, spectral reconstruction is done now */
- if ((result = reconstruct_channel_pair(hDecoder, ics1, ics2, &cpe,
- spec_data1, spec_data2)) > 0)
- {
- return result;
- }
-
- return 0;
-}
-
-/* Table 4.4.6 */
-static uint8_t ics_info(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld,
- uint8_t common_window)
-{
- uint8_t retval = 0;
-
- /* ics->ics_reserved_bit = */ faad_get1bit(ld
- DEBUGVAR(1,43,"ics_info(): ics_reserved_bit"));
- ics->window_sequence = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,44,"ics_info(): window_sequence"));
- ics->window_shape = faad_get1bit(ld
- DEBUGVAR(1,45,"ics_info(): window_shape"));
-
- if (ics->window_sequence == EIGHT_SHORT_SEQUENCE)
- {
- ics->max_sfb = (uint8_t)faad_getbits(ld, 4
- DEBUGVAR(1,46,"ics_info(): max_sfb (short)"));
- ics->scale_factor_grouping = (uint8_t)faad_getbits(ld, 7
- DEBUGVAR(1,47,"ics_info(): scale_factor_grouping"));
- } else {
- ics->max_sfb = (uint8_t)faad_getbits(ld, 6
- DEBUGVAR(1,48,"ics_info(): max_sfb (long)"));
- }
-
- /* get the grouping information */
- if ((retval = window_grouping_info(hDecoder, ics)) > 0)
- return retval;
-
- /* should be an error */
- /* check the range of max_sfb */
- if (ics->max_sfb > ics->num_swb)
- return 16;
-
- if (ics->window_sequence != EIGHT_SHORT_SEQUENCE)
- {
- if ((ics->predictor_data_present = faad_get1bit(ld
- DEBUGVAR(1,49,"ics_info(): predictor_data_present"))) & 1)
- {
- if (hDecoder->object_type == MAIN) /* MPEG2 style AAC predictor */
- {
- uint8_t sfb;
-
- uint8_t limit = min(ics->max_sfb, max_pred_sfb(hDecoder->sf_index));
-#ifdef MAIN_DEC
- ics->pred.limit = limit;
-#endif
-
- if ((
-#ifdef MAIN_DEC
- ics->pred.predictor_reset =
-#endif
- faad_get1bit(ld DEBUGVAR(1,53,"ics_info(): pred.predictor_reset"))) & 1)
- {
-#ifdef MAIN_DEC
- ics->pred.predictor_reset_group_number =
-#endif
- (uint8_t)faad_getbits(ld, 5 DEBUGVAR(1,54,"ics_info(): pred.predictor_reset_group_number"));
- }
-
- for (sfb = 0; sfb < limit; sfb++)
- {
-#ifdef MAIN_DEC
- ics->pred.prediction_used[sfb] =
-#endif
- faad_get1bit(ld DEBUGVAR(1,55,"ics_info(): pred.prediction_used"));
- }
- }
-#ifdef LTP_DEC
- else { /* Long Term Prediction */
- if (hDecoder->object_type < ER_OBJECT_START)
- {
- if ((ics->ltp.data_present = faad_get1bit(ld
- DEBUGVAR(1,50,"ics_info(): ltp.data_present"))) & 1)
- {
- if ((retval = ltp_data(hDecoder, ics, &(ics->ltp), ld)) > 0)
- {
- return retval;
- }
- }
- if (common_window)
- {
- if ((ics->ltp2.data_present = faad_get1bit(ld
- DEBUGVAR(1,51,"ics_info(): ltp2.data_present"))) & 1)
- {
- if ((retval = ltp_data(hDecoder, ics, &(ics->ltp2), ld)) > 0)
- {
- return retval;
- }
- }
- }
- }
-#ifdef ERROR_RESILIENCE
- if (!common_window && (hDecoder->object_type >= ER_OBJECT_START))
- {
- if ((ics->ltp.data_present = faad_get1bit(ld
- DEBUGVAR(1,50,"ics_info(): ltp.data_present"))) & 1)
- {
- ltp_data(hDecoder, ics, &(ics->ltp), ld);
- }
- }
-#endif
- }
-#endif
- }
- }
-
- return retval;
-}
-
-/* Table 4.4.7 */
-static uint8_t pulse_data(ic_stream *ics, pulse_info *pul, bitfile *ld)
-{
- uint8_t i;
-
- pul->number_pulse = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,56,"pulse_data(): number_pulse"));
- pul->pulse_start_sfb = (uint8_t)faad_getbits(ld, 6
- DEBUGVAR(1,57,"pulse_data(): pulse_start_sfb"));
-
- /* check the range of pulse_start_sfb */
- if (pul->pulse_start_sfb > ics->num_swb)
- return 16;
-
- for (i = 0; i < pul->number_pulse+1; i++)
- {
- pul->pulse_offset[i] = (uint8_t)faad_getbits(ld, 5
- DEBUGVAR(1,58,"pulse_data(): pulse_offset"));
-#if 0
- printf("%d\n", pul->pulse_offset[i]);
-#endif
- pul->pulse_amp[i] = (uint8_t)faad_getbits(ld, 4
- DEBUGVAR(1,59,"pulse_data(): pulse_amp"));
-#if 0
- printf("%d\n", pul->pulse_amp[i]);
-#endif
- }
-
- return 0;
-}
-
-#ifdef COUPLING_DEC
-/* Table 4.4.8: Currently just for skipping the bits... */
-static uint8_t coupling_channel_element(NeAACDecHandle hDecoder, bitfile *ld)
-{
- uint8_t c, result = 0;
- uint8_t ind_sw_cce_flag = 0;
- uint8_t num_gain_element_lists = 0;
- uint8_t num_coupled_elements = 0;
-
- element el_empty = {0};
- ic_stream ics_empty = {0};
- int16_t sh_data[1024];
-
- c = faad_getbits(ld, LEN_TAG
- DEBUGVAR(1,900,"coupling_channel_element(): element_instance_tag"));
-
- ind_sw_cce_flag = faad_get1bit(ld
- DEBUGVAR(1,901,"coupling_channel_element(): ind_sw_cce_flag"));
- num_coupled_elements = faad_getbits(ld, 3
- DEBUGVAR(1,902,"coupling_channel_element(): num_coupled_elements"));
-
- for (c = 0; c < num_coupled_elements + 1; c++)
- {
- uint8_t cc_target_is_cpe, cc_target_tag_select;
-
- num_gain_element_lists++;
-
- cc_target_is_cpe = faad_get1bit(ld
- DEBUGVAR(1,903,"coupling_channel_element(): cc_target_is_cpe"));
- cc_target_tag_select = faad_getbits(ld, 4
- DEBUGVAR(1,904,"coupling_channel_element(): cc_target_tag_select"));
-
- if (cc_target_is_cpe)
- {
- uint8_t cc_l = faad_get1bit(ld
- DEBUGVAR(1,905,"coupling_channel_element(): cc_l"));
- uint8_t cc_r = faad_get1bit(ld
- DEBUGVAR(1,906,"coupling_channel_element(): cc_r"));
-
- if (cc_l && cc_r)
- num_gain_element_lists++;
- }
- }
-
- faad_get1bit(ld
- DEBUGVAR(1,907,"coupling_channel_element(): cc_domain"));
- faad_get1bit(ld
- DEBUGVAR(1,908,"coupling_channel_element(): gain_element_sign"));
- faad_getbits(ld, 2
- DEBUGVAR(1,909,"coupling_channel_element(): gain_element_scale"));
-
- if ((result = individual_channel_stream(hDecoder, &el_empty, ld, &ics_empty,
- 0, sh_data)) > 0)
- {
- return result;
- }
-
- for (c = 1; c < num_gain_element_lists; c++)
- {
- uint8_t cge;
-
- if (ind_sw_cce_flag)
- {
- cge = 1;
- } else {
- cge = faad_get1bit(ld
- DEBUGVAR(1,910,"coupling_channel_element(): common_gain_element_present"));
- }
-
- if (cge)
- {
- huffman_scale_factor(ld);
- } else {
- uint8_t g, sfb;
-
- for (g = 0; g < ics_empty.num_window_groups; g++)
- {
- for (sfb = 0; sfb < ics_empty.max_sfb; sfb++)
- {
- if (ics_empty.sfb_cb[g][sfb] != ZERO_HCB)
- huffman_scale_factor(ld);
- }
- }
- }
- }
-
- return 0;
-}
-#endif
-
-/* Table 4.4.10 */
-static uint16_t data_stream_element(NeAACDecHandle hDecoder, bitfile *ld)
-{
- uint8_t byte_aligned;
- uint16_t i, count;
-
- /* element_instance_tag = */ faad_getbits(ld, LEN_TAG
- DEBUGVAR(1,60,"data_stream_element(): element_instance_tag"));
- byte_aligned = faad_get1bit(ld
- DEBUGVAR(1,61,"data_stream_element(): byte_aligned"));
- count = (uint16_t)faad_getbits(ld, 8
- DEBUGVAR(1,62,"data_stream_element(): count"));
- if (count == 255)
- {
- count += (uint16_t)faad_getbits(ld, 8
- DEBUGVAR(1,63,"data_stream_element(): extra count"));
- }
- if (byte_aligned)
- faad_byte_align(ld);
-
- for (i = 0; i < count; i++)
- {
- faad_getbits(ld, LEN_BYTE
- DEBUGVAR(1,64,"data_stream_element(): data_stream_byte"));
- }
-
- return count;
-}
-
-/* Table 4.4.11 */
-static uint8_t fill_element(NeAACDecHandle hDecoder, bitfile *ld, drc_info *drc
-#ifdef SBR_DEC
- ,uint8_t sbr_ele
-#endif
- )
-{
- uint16_t count;
-#ifdef SBR_DEC
- uint8_t bs_extension_type;
-#endif
-
- count = (uint16_t)faad_getbits(ld, 4
- DEBUGVAR(1,65,"fill_element(): count"));
- if (count == 15)
- {
- count += (uint16_t)faad_getbits(ld, 8
- DEBUGVAR(1,66,"fill_element(): extra count")) - 1;
- }
-
- if (count > 0)
- {
-#ifdef SBR_DEC
- bs_extension_type = (uint8_t)faad_showbits(ld, 4);
-
- if ((bs_extension_type == EXT_SBR_DATA) ||
- (bs_extension_type == EXT_SBR_DATA_CRC))
- {
- if (sbr_ele == INVALID_SBR_ELEMENT)
- return 24;
-
- if (!hDecoder->sbr[sbr_ele])
- {
- hDecoder->sbr[sbr_ele] = sbrDecodeInit(hDecoder->frameLength,
- hDecoder->element_id[sbr_ele], 2*get_sample_rate(hDecoder->sf_index),
- hDecoder->downSampledSBR
-#ifdef DRM
- , 0
-#endif
- );
- }
-
- hDecoder->sbr_present_flag = 1;
-
- /* parse the SBR data */
- hDecoder->sbr[sbr_ele]->ret = sbr_extension_data(ld, hDecoder->sbr[sbr_ele], count);
-
-#if 0
- if (hDecoder->sbr[sbr_ele]->ret > 0)
- {
- printf("%s\n", NeAACDecGetErrorMessage(hDecoder->sbr[sbr_ele]->ret));
- }
-#endif
-
-#if (defined(PS_DEC) || defined(DRM_PS))
- if (hDecoder->sbr[sbr_ele]->ps_used)
- {
- hDecoder->ps_used[sbr_ele] = 1;
-
- /* set element independent flag to 1 as well */
- hDecoder->ps_used_global = 1;
- }
-#endif
- } else {
-#endif
- while (count > 0)
- {
- count -= extension_payload(ld, drc, count);
- }
-#ifdef SBR_DEC
- }
-#endif
- }
-
- return 0;
-}
-
-/* Table 4.4.12 */
-#ifdef SSR_DEC
-static void gain_control_data(bitfile *ld, ic_stream *ics)
-{
- uint8_t bd, wd, ad;
- ssr_info *ssr = &(ics->ssr);
-
- ssr->max_band = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,1000,"gain_control_data(): max_band"));
-
- if (ics->window_sequence == ONLY_LONG_SEQUENCE)
- {
- for (bd = 1; bd <= ssr->max_band; bd++)
- {
- for (wd = 0; wd < 1; wd++)
- {
- ssr->adjust_num[bd][wd] = (uint8_t)faad_getbits(ld, 3
- DEBUGVAR(1,1001,"gain_control_data(): adjust_num"));
-
- for (ad = 0; ad < ssr->adjust_num[bd][wd]; ad++)
- {
- ssr->alevcode[bd][wd][ad] = (uint8_t)faad_getbits(ld, 4
- DEBUGVAR(1,1002,"gain_control_data(): alevcode"));
- ssr->aloccode[bd][wd][ad] = (uint8_t)faad_getbits(ld, 5
- DEBUGVAR(1,1003,"gain_control_data(): aloccode"));
- }
- }
- }
- } else if (ics->window_sequence == LONG_START_SEQUENCE) {
- for (bd = 1; bd <= ssr->max_band; bd++)
- {
- for (wd = 0; wd < 2; wd++)
- {
- ssr->adjust_num[bd][wd] = (uint8_t)faad_getbits(ld, 3
- DEBUGVAR(1,1001,"gain_control_data(): adjust_num"));
-
- for (ad = 0; ad < ssr->adjust_num[bd][wd]; ad++)
- {
- ssr->alevcode[bd][wd][ad] = (uint8_t)faad_getbits(ld, 4
- DEBUGVAR(1,1002,"gain_control_data(): alevcode"));
- if (wd == 0)
- {
- ssr->aloccode[bd][wd][ad] = (uint8_t)faad_getbits(ld, 4
- DEBUGVAR(1,1003,"gain_control_data(): aloccode"));
- } else {
- ssr->aloccode[bd][wd][ad] = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,1003,"gain_control_data(): aloccode"));
- }
- }
- }
- }
- } else if (ics->window_sequence == EIGHT_SHORT_SEQUENCE) {
- for (bd = 1; bd <= ssr->max_band; bd++)
- {
- for (wd = 0; wd < 8; wd++)
- {
- ssr->adjust_num[bd][wd] = (uint8_t)faad_getbits(ld, 3
- DEBUGVAR(1,1001,"gain_control_data(): adjust_num"));
-
- for (ad = 0; ad < ssr->adjust_num[bd][wd]; ad++)
- {
- ssr->alevcode[bd][wd][ad] = (uint8_t)faad_getbits(ld, 4
- DEBUGVAR(1,1002,"gain_control_data(): alevcode"));
- ssr->aloccode[bd][wd][ad] = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,1003,"gain_control_data(): aloccode"));
- }
- }
- }
- } else if (ics->window_sequence == LONG_STOP_SEQUENCE) {
- for (bd = 1; bd <= ssr->max_band; bd++)
- {
- for (wd = 0; wd < 2; wd++)
- {
- ssr->adjust_num[bd][wd] = (uint8_t)faad_getbits(ld, 3
- DEBUGVAR(1,1001,"gain_control_data(): adjust_num"));
-
- for (ad = 0; ad < ssr->adjust_num[bd][wd]; ad++)
- {
- ssr->alevcode[bd][wd][ad] = (uint8_t)faad_getbits(ld, 4
- DEBUGVAR(1,1002,"gain_control_data(): alevcode"));
-
- if (wd == 0)
- {
- ssr->aloccode[bd][wd][ad] = (uint8_t)faad_getbits(ld, 4
- DEBUGVAR(1,1003,"gain_control_data(): aloccode"));
- } else {
- ssr->aloccode[bd][wd][ad] = (uint8_t)faad_getbits(ld, 5
- DEBUGVAR(1,1003,"gain_control_data(): aloccode"));
- }
- }
- }
- }
- }
-}
-#endif
-
-#ifdef SCALABLE_DEC
-/* Table 4.4.13 ASME */
-void aac_scalable_main_element(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo,
- bitfile *ld, program_config *pce, drc_info *drc)
-{
- uint8_t retval = 0;
- uint8_t channels = hDecoder->fr_channels = 0;
- uint8_t ch;
- uint8_t this_layer_stereo = (hDecoder->channelConfiguration > 1) ? 1 : 0;
- element cpe = {0};
- ic_stream *ics1 = &(cpe.ics1);
- ic_stream *ics2 = &(cpe.ics2);
- int16_t *spec_data;
- ALIGN int16_t spec_data1[1024] = {0};
- ALIGN int16_t spec_data2[1024] = {0};
-
- hDecoder->fr_ch_ele = 0;
-
- hInfo->error = aac_scalable_main_header(hDecoder, ics1, ics2, ld, this_layer_stereo);
- if (hInfo->error > 0)
- return;
-
- cpe.common_window = 1;
- if (this_layer_stereo)
- {
- hDecoder->element_id[0] = ID_CPE;
- if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] == 0)
- hDecoder->element_output_channels[hDecoder->fr_ch_ele] = 2;
- } else {
- hDecoder->element_id[0] = ID_SCE;
- }
-
- for (ch = 0; ch < (this_layer_stereo ? 2 : 1); ch++)
- {
- ic_stream *ics;
- if (ch == 0)
- {
- ics = ics1;
- spec_data = spec_data1;
- } else {
- ics = ics2;
- spec_data = spec_data2;
- }
-
- hInfo->error = individual_channel_stream(hDecoder, &cpe, ld, ics, 1, spec_data);
- if (hInfo->error > 0)
- return;
- }
-
-#ifdef DRM
-#ifdef SBR_DEC
- /* In case of DRM we need to read the SBR info before channel reconstruction */
- if ((hDecoder->sbr_present_flag == 1) && (hDecoder->object_type == DRM_ER_LC))
- {
- bitfile ld_sbr = {0};
- uint32_t i;
- uint16_t count = 0;
- uint8_t *revbuffer;
- uint8_t *prevbufstart;
- uint8_t *pbufend;
-
- /* all forward bitreading should be finished at this point */
- uint32_t bitsconsumed = faad_get_processed_bits(ld);
- uint32_t buffer_size = faad_origbitbuffer_size(ld);
- uint8_t *buffer = (uint8_t*)faad_origbitbuffer(ld);
-
- if (bitsconsumed + 8 > buffer_size*8)
- {
- hInfo->error = 14;
- return;
- }
-
- if (!hDecoder->sbr[0])
- {
- hDecoder->sbr[0] = sbrDecodeInit(hDecoder->frameLength, hDecoder->element_id[0],
- 2*get_sample_rate(hDecoder->sf_index), 0 /* ds SBR */, 1);
- }
-
- /* Reverse bit reading of SBR data in DRM audio frame */
- revbuffer = (uint8_t*)faad_malloc(buffer_size*sizeof(uint8_t));
- prevbufstart = revbuffer;
- pbufend = &buffer[buffer_size - 1];
- for (i = 0; i < buffer_size; i++)
- *prevbufstart++ = tabFlipbits[*pbufend--];
-
- /* Set SBR data */
- /* consider 8 bits from AAC-CRC */
- count = (uint16_t)bit2byte(buffer_size*8 - bitsconsumed);
- faad_initbits(&ld_sbr, revbuffer, count);
-
- hDecoder->sbr[0]->sample_rate = get_sample_rate(hDecoder->sf_index);
- hDecoder->sbr[0]->sample_rate *= 2;
-
- faad_getbits(&ld_sbr, 8); /* Skip 8-bit CRC */
-
- hDecoder->sbr[0]->ret = sbr_extension_data(&ld_sbr, hDecoder->sbr[0], count);
-#if (defined(PS_DEC) || defined(DRM_PS))
- if (hDecoder->sbr[0]->ps_used)
- {
- hDecoder->ps_used[0] = 1;
- hDecoder->ps_used_global = 1;
- }
-#endif
-
- /* check CRC */
- /* no need to check it if there was already an error */
- if (hDecoder->sbr[0]->ret == 0)
- hDecoder->sbr[0]->ret = (uint8_t)faad_check_CRC(&ld_sbr, (uint16_t)faad_get_processed_bits(&ld_sbr) - 8);
-
- /* SBR data was corrupted, disable it until the next header */
- if (hDecoder->sbr[0]->ret != 0)
- {
- hDecoder->sbr[0]->header_count = 0;
- }
-
- faad_endbits(&ld_sbr);
-
- if (revbuffer)
- faad_free(revbuffer);
- }
-#endif
-#endif
-
- if (this_layer_stereo)
- {
- hInfo->error = reconstruct_channel_pair(hDecoder, ics1, ics2, &cpe, spec_data1, spec_data2);
- if (hInfo->error > 0)
- return;
- } else {
- hInfo->error = reconstruct_single_channel(hDecoder, ics1, &cpe, spec_data1);
- if (hInfo->error > 0)
- return;
- }
-
- /* map output channels position to internal data channels */
- if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] == 2)
- {
- /* this might be faulty when pce_set is true */
- hDecoder->internal_channel[channels] = channels;
- hDecoder->internal_channel[channels+1] = channels+1;
- } else {
- hDecoder->internal_channel[channels] = channels;
- }
-
- hDecoder->fr_channels += hDecoder->element_output_channels[hDecoder->fr_ch_ele];
- hDecoder->fr_ch_ele++;
-
- return;
-}
-
-/* Table 4.4.15 */
-static int8_t aac_scalable_main_header(NeAACDecHandle hDecoder, ic_stream *ics1, ic_stream *ics2,
- bitfile *ld, uint8_t this_layer_stereo)
-{
- uint8_t retval = 0;
- uint8_t ch;
- ic_stream *ics;
-
- /* ics1->ics_reserved_bit = */ faad_get1bit(ld
- DEBUGVAR(1,300,"aac_scalable_main_header(): ics_reserved_bits"));
- ics1->window_sequence = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,301,"aac_scalable_main_header(): window_sequence"));
- ics1->window_shape = faad_get1bit(ld
- DEBUGVAR(1,302,"aac_scalable_main_header(): window_shape"));
-
- if (ics1->window_sequence == EIGHT_SHORT_SEQUENCE)
- {
- ics1->max_sfb = (uint8_t)faad_getbits(ld, 4
- DEBUGVAR(1,303,"aac_scalable_main_header(): max_sfb (short)"));
- ics1->scale_factor_grouping = (uint8_t)faad_getbits(ld, 7
- DEBUGVAR(1,304,"aac_scalable_main_header(): scale_factor_grouping"));
- } else {
- ics1->max_sfb = (uint8_t)faad_getbits(ld, 6
- DEBUGVAR(1,305,"aac_scalable_main_header(): max_sfb (long)"));
- }
-
- /* get the grouping information */
- if ((retval = window_grouping_info(hDecoder, ics1)) > 0)
- return retval;
-
- /* should be an error */
- /* check the range of max_sfb */
- if (ics1->max_sfb > ics1->num_swb)
- return 16;
-
- if (this_layer_stereo)
- {
- ics1->ms_mask_present = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,306,"aac_scalable_main_header(): ms_mask_present"));
- if (ics1->ms_mask_present == 1)
- {
- uint8_t g, sfb;
- for (g = 0; g < ics1->num_window_groups; g++)
- {
- for (sfb = 0; sfb < ics1->max_sfb; sfb++)
- {
- ics1->ms_used[g][sfb] = faad_get1bit(ld
- DEBUGVAR(1,307,"aac_scalable_main_header(): faad_get1bit"));
- }
- }
- }
-
- memcpy(ics2, ics1, sizeof(ic_stream));
- } else {
- ics1->ms_mask_present = 0;
- }
-
- if (0)
- {
- faad_get1bit(ld
- DEBUGVAR(1,308,"aac_scalable_main_header(): tns_channel_mono_layer"));
- }
-
- for (ch = 0; ch < (this_layer_stereo ? 2 : 1); ch++)
- {
- if (ch == 0)
- ics = ics1;
- else
- ics = ics2;
-
- if ( 1 /*!tvq_layer_pesent || (tns_aac_tvq_en[ch] == 1)*/)
- {
- if ((ics->tns_data_present = faad_get1bit(ld
- DEBUGVAR(1,309,"aac_scalable_main_header(): tns_data_present"))) & 1)
- {
-#ifdef DRM
- /* different order of data units in DRM */
- if (hDecoder->object_type != DRM_ER_LC)
-#endif
- {
- tns_data(ics, &(ics->tns), ld);
- }
- }
- }
-#if 0
- if (0 /*core_flag || tvq_layer_pesent*/)
- {
- if ((ch==0) || ((ch==1) && (core_stereo || tvq_stereo))
- diff_control_data();
- if (mono_stereo_flag)
- diff_control_data_lr();
- } else {
-#endif
- if ((
-#ifdef LTP_DEC
- ics->ltp.data_present =
-#endif
- faad_get1bit(ld DEBUGVAR(1,310,"aac_scalable_main_header(): ltp.data_present"))) & 1)
- {
-#ifdef LTP_DEC
- if ((retval = ltp_data(hDecoder, ics, &(ics->ltp), ld)) > 0)
- {
- return retval;
- }
-#else
- return 26;
-#endif
- }
-#if 0
- }
-#endif
- }
-
- return 0;
-}
-#endif
-
-/* Table 4.4.24 */
-static uint8_t individual_channel_stream(NeAACDecHandle hDecoder, element *ele,
- bitfile *ld, ic_stream *ics, uint8_t scal_flag,
- int16_t *spec_data)
-{
- uint8_t result;
-
- ics->global_gain = (uint8_t)faad_getbits(ld, 8
- DEBUGVAR(1,67,"individual_channel_stream(): global_gain"));
-
- if (!ele->common_window && !scal_flag)
- {
- if ((result = ics_info(hDecoder, ics, ld, ele->common_window)) > 0)
- return result;
- }
-
- if ((result = section_data(hDecoder, ics, ld)) > 0)
- return result;
-
- if ((result = scale_factor_data(hDecoder, ics, ld)) > 0)
- return result;
-
- if (!scal_flag)
- {
- /**
- ** NOTE: It could be that pulse data is available in scalable AAC too,
- ** as said in Amendment 1, this could be only the case for ER AAC,
- ** though. (have to check this out later)
- **/
- /* get pulse data */
- if ((ics->pulse_data_present = faad_get1bit(ld
- DEBUGVAR(1,68,"individual_channel_stream(): pulse_data_present"))) & 1)
- {
- if ((result = pulse_data(ics, &(ics->pul), ld)) > 0)
- return result;
- }
-
- /* get tns data */
- if ((ics->tns_data_present = faad_get1bit(ld
- DEBUGVAR(1,69,"individual_channel_stream(): tns_data_present"))) & 1)
- {
-#ifdef ERROR_RESILIENCE
- if (hDecoder->object_type < ER_OBJECT_START)
-#endif
- tns_data(ics, &(ics->tns), ld);
- }
-
- /* get gain control data */
- if ((ics->gain_control_data_present = faad_get1bit(ld
- DEBUGVAR(1,70,"individual_channel_stream(): gain_control_data_present"))) & 1)
- {
-#ifdef SSR_DEC
- if (hDecoder->object_type != SSR)
- return 1;
- else
- gain_control_data(ld, ics);
-#else
- return 1;
-#endif
- }
- }
-
-#ifdef ERROR_RESILIENCE
- if (hDecoder->aacSpectralDataResilienceFlag)
- {
- ics->length_of_reordered_spectral_data = (uint16_t)faad_getbits(ld, 14
- DEBUGVAR(1,147,"individual_channel_stream(): length_of_reordered_spectral_data"));
-
- if (hDecoder->channelConfiguration == 2)
- {
- if (ics->length_of_reordered_spectral_data > 6144)
- ics->length_of_reordered_spectral_data = 6144;
- } else {
- if (ics->length_of_reordered_spectral_data > 12288)
- ics->length_of_reordered_spectral_data = 12288;
- }
-
- ics->length_of_longest_codeword = (uint8_t)faad_getbits(ld, 6
- DEBUGVAR(1,148,"individual_channel_stream(): length_of_longest_codeword"));
- if (ics->length_of_longest_codeword >= 49)
- ics->length_of_longest_codeword = 49;
- }
-
- /* RVLC spectral data is put here */
- if (hDecoder->aacScalefactorDataResilienceFlag)
- {
- if ((result = rvlc_decode_scale_factors(ics, ld)) > 0)
- return result;
- }
-
- if (hDecoder->object_type >= ER_OBJECT_START)
- {
- if (ics->tns_data_present)
- tns_data(ics, &(ics->tns), ld);
- }
-
-#ifdef DRM
- /* CRC check */
- if (hDecoder->object_type == DRM_ER_LC)
- if ((result = (uint8_t)faad_check_CRC(ld, (uint16_t)faad_get_processed_bits(ld) - 8)) > 0)
- return result;
-#endif
-
- if (hDecoder->aacSpectralDataResilienceFlag)
- {
- /* error resilient spectral data decoding */
- if ((result = reordered_spectral_data(hDecoder, ics, ld, spec_data)) > 0)
- {
- return result;
- }
- } else {
-#endif
- /* decode the spectral data */
- if ((result = spectral_data(hDecoder, ics, ld, spec_data)) > 0)
- {
- return result;
- }
-#ifdef ERROR_RESILIENCE
- }
-#endif
-
- /* pulse coding reconstruction */
- if (ics->pulse_data_present)
- {
- if (ics->window_sequence != EIGHT_SHORT_SEQUENCE)
- {
- if ((result = pulse_decode(ics, spec_data, hDecoder->frameLength)) > 0)
- return result;
- } else {
- return 2; /* pulse coding not allowed for short blocks */
- }
- }
-
- return 0;
-}
-
-/* Table 4.4.25 */
-static uint8_t section_data(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld)
-{
- uint8_t g;
- uint8_t sect_esc_val, sect_bits;
-
- if (ics->window_sequence == EIGHT_SHORT_SEQUENCE)
- sect_bits = 3;
- else
- sect_bits = 5;
- sect_esc_val = (1<<sect_bits) - 1;
-
-#if 0
- printf("\ntotal sfb %d\n", ics->max_sfb);
- printf(" sect top cb\n");
-#endif
-
- for (g = 0; g < ics->num_window_groups; g++)
- {
- uint8_t k = 0;
- uint8_t i = 0;
-
- while (k < ics->max_sfb)
- {
-#ifdef ERROR_RESILIENCE
- uint8_t vcb11 = 0;
-#endif
- uint8_t sfb;
- uint8_t sect_len_incr;
- uint16_t sect_len = 0;
- uint8_t sect_cb_bits = 4;
-
- /* if "faad_getbits" detects error and returns "0", "k" is never
- incremented and we cannot leave the while loop */
- if ((ld->error != 0) || (ld->no_more_reading))
- return 14;
-
-#ifdef ERROR_RESILIENCE
- if (hDecoder->aacSectionDataResilienceFlag)
- sect_cb_bits = 5;
-#endif
-
- ics->sect_cb[g][i] = (uint8_t)faad_getbits(ld, sect_cb_bits
- DEBUGVAR(1,71,"section_data(): sect_cb"));
-
-#if 0
- printf("%d\n", ics->sect_cb[g][i]);
-#endif
-
- if (ics->sect_cb[g][i] == NOISE_HCB)
- ics->noise_used = 1;
-
-#ifdef ERROR_RESILIENCE
- if (hDecoder->aacSectionDataResilienceFlag)
- {
- if ((ics->sect_cb[g][i] == 11) ||
- ((ics->sect_cb[g][i] >= 16) && (ics->sect_cb[g][i] <= 32)))
- {
- vcb11 = 1;
- }
- }
- if (vcb11)
- {
- sect_len_incr = 1;
- } else {
-#endif
- sect_len_incr = (uint8_t)faad_getbits(ld, sect_bits
- DEBUGVAR(1,72,"section_data(): sect_len_incr"));
-#ifdef ERROR_RESILIENCE
- }
-#endif
- while ((sect_len_incr == sect_esc_val) /* &&
- (k+sect_len < ics->max_sfb)*/)
- {
- sect_len += sect_len_incr;
- sect_len_incr = (uint8_t)faad_getbits(ld, sect_bits
- DEBUGVAR(1,72,"section_data(): sect_len_incr"));
- }
-
- sect_len += sect_len_incr;
-
- ics->sect_start[g][i] = k;
- ics->sect_end[g][i] = k + sect_len;
-
-#if 0
- printf("%d\n", ics->sect_start[g][i]);
-#endif
-#if 0
- printf("%d\n", ics->sect_end[g][i]);
-#endif
-
- if (k + sect_len >= 8*15)
- return 15;
- if (i >= 8*15)
- return 15;
-
- for (sfb = k; sfb < k + sect_len; sfb++)
- {
- ics->sfb_cb[g][sfb] = ics->sect_cb[g][i];
-#if 0
- printf("%d\n", ics->sfb_cb[g][sfb]);
-#endif
- }
-
-#if 0
- printf(" %6d %6d %6d\n",
- i,
- ics->sect_end[g][i],
- ics->sect_cb[g][i]);
-#endif
-
- k += sect_len;
- i++;
- }
- ics->num_sec[g] = i;
-#if 0
- printf("%d\n", ics->num_sec[g]);
-#endif
- }
-
-#if 0
- printf("\n");
-#endif
-
- return 0;
-}
-
-/*
- * decode_scale_factors()
- * decodes the scalefactors from the bitstream
- */
-/*
- * All scalefactors (and also the stereo positions and pns energies) are
- * transmitted using Huffman coded DPCM relative to the previous active
- * scalefactor (respectively previous stereo position or previous pns energy,
- * see subclause 4.6.2 and 4.6.3). The first active scalefactor is
- * differentially coded relative to the global gain.
- */
-static uint8_t decode_scale_factors(ic_stream *ics, bitfile *ld)
-{
- uint8_t g, sfb;
- int16_t t;
- int8_t noise_pcm_flag = 1;
-
- int16_t scale_factor = ics->global_gain;
- int16_t is_position = 0;
- int16_t noise_energy = ics->global_gain - 90;
-
- for (g = 0; g < ics->num_window_groups; g++)
- {
- for (sfb = 0; sfb < ics->max_sfb; sfb++)
- {
- switch (ics->sfb_cb[g][sfb])
- {
- case ZERO_HCB: /* zero book */
- ics->scale_factors[g][sfb] = 0;
-//#define SF_PRINT
-#ifdef SF_PRINT
- printf("%d\n", ics->scale_factors[g][sfb]);
-#endif
- break;
- case INTENSITY_HCB: /* intensity books */
- case INTENSITY_HCB2:
-
- /* decode intensity position */
- t = huffman_scale_factor(ld);
- is_position += (t - 60);
- ics->scale_factors[g][sfb] = is_position;
-#ifdef SF_PRINT
- printf("%d\n", ics->scale_factors[g][sfb]);
-#endif
-
- break;
- case NOISE_HCB: /* noise books */
-
- /* decode noise energy */
- if (noise_pcm_flag)
- {
- noise_pcm_flag = 0;
- t = (int16_t)faad_getbits(ld, 9
- DEBUGVAR(1,73,"scale_factor_data(): first noise")) - 256;
- } else {
- t = huffman_scale_factor(ld);
- t -= 60;
- }
- noise_energy += t;
- ics->scale_factors[g][sfb] = noise_energy;
-#ifdef SF_PRINT
- printf("%d\n", ics->scale_factors[g][sfb]);
-#endif
-
- break;
- default: /* spectral books */
-
- /* ics->scale_factors[g][sfb] must be between 0 and 255 */
-
- ics->scale_factors[g][sfb] = 0;
-
- /* decode scale factor */
- t = huffman_scale_factor(ld);
- scale_factor += (t - 60);
- if (scale_factor < 0 || scale_factor > 255)
- return 4;
- ics->scale_factors[g][sfb] = scale_factor;
-#ifdef SF_PRINT
- printf("%d\n", ics->scale_factors[g][sfb]);
-#endif
-
- break;
- }
- }
- }
-
- return 0;
-}
-
-/* Table 4.4.26 */
-static uint8_t scale_factor_data(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld)
-{
- uint8_t ret = 0;
-#ifdef PROFILE
- int64_t count = faad_get_ts();
-#endif
-
-#ifdef ERROR_RESILIENCE
- if (!hDecoder->aacScalefactorDataResilienceFlag)
- {
-#endif
- ret = decode_scale_factors(ics, ld);
-#ifdef ERROR_RESILIENCE
- } else {
- /* In ER AAC the parameters for RVLC are seperated from the actual
- data that holds the scale_factors.
- Strangely enough, 2 parameters for HCR are put inbetween them.
- */
- ret = rvlc_scale_factor_data(ics, ld);
- }
-#endif
-
-#ifdef PROFILE
- count = faad_get_ts() - count;
- hDecoder->scalefac_cycles += count;
-#endif
-
- return ret;
-}
-
-/* Table 4.4.27 */
-static void tns_data(ic_stream *ics, tns_info *tns, bitfile *ld)
-{
- uint8_t w, filt, i, start_coef_bits, coef_bits;
- uint8_t n_filt_bits = 2;
- uint8_t length_bits = 6;
- uint8_t order_bits = 5;
-
- if (ics->window_sequence == EIGHT_SHORT_SEQUENCE)
- {
- n_filt_bits = 1;
- length_bits = 4;
- order_bits = 3;
- }
-
- for (w = 0; w < ics->num_windows; w++)
- {
- tns->n_filt[w] = (uint8_t)faad_getbits(ld, n_filt_bits
- DEBUGVAR(1,74,"tns_data(): n_filt"));
-#if 0
- printf("%d\n", tns->n_filt[w]);
-#endif
-
- if (tns->n_filt[w])
- {
- if ((tns->coef_res[w] = faad_get1bit(ld
- DEBUGVAR(1,75,"tns_data(): coef_res"))) & 1)
- {
- start_coef_bits = 4;
- } else {
- start_coef_bits = 3;
- }
-#if 0
- printf("%d\n", tns->coef_res[w]);
-#endif
- }
-
- for (filt = 0; filt < tns->n_filt[w]; filt++)
- {
- tns->length[w][filt] = (uint8_t)faad_getbits(ld, length_bits
- DEBUGVAR(1,76,"tns_data(): length"));
-#if 0
- printf("%d\n", tns->length[w][filt]);
-#endif
- tns->order[w][filt] = (uint8_t)faad_getbits(ld, order_bits
- DEBUGVAR(1,77,"tns_data(): order"));
-#if 0
- printf("%d\n", tns->order[w][filt]);
-#endif
- if (tns->order[w][filt])
- {
- tns->direction[w][filt] = faad_get1bit(ld
- DEBUGVAR(1,78,"tns_data(): direction"));
-#if 0
- printf("%d\n", tns->direction[w][filt]);
-#endif
- tns->coef_compress[w][filt] = faad_get1bit(ld
- DEBUGVAR(1,79,"tns_data(): coef_compress"));
-#if 0
- printf("%d\n", tns->coef_compress[w][filt]);
-#endif
-
- coef_bits = start_coef_bits - tns->coef_compress[w][filt];
- for (i = 0; i < tns->order[w][filt]; i++)
- {
- tns->coef[w][filt][i] = (uint8_t)faad_getbits(ld, coef_bits
- DEBUGVAR(1,80,"tns_data(): coef"));
-#if 0
- printf("%d\n", tns->coef[w][filt][i]);
-#endif
- }
- }
- }
- }
-}
-
-#ifdef LTP_DEC
-/* Table 4.4.28 */
-static uint8_t ltp_data(NeAACDecHandle hDecoder, ic_stream *ics, ltp_info *ltp, bitfile *ld)
-{
- uint8_t sfb, w;
-
- ltp->lag = 0;
-
-#ifdef LD_DEC
- if (hDecoder->object_type == LD)
- {
- ltp->lag_update = (uint8_t)faad_getbits(ld, 1
- DEBUGVAR(1,142,"ltp_data(): lag_update"));
-
- if (ltp->lag_update)
- {
- ltp->lag = (uint16_t)faad_getbits(ld, 10
- DEBUGVAR(1,81,"ltp_data(): lag"));
- }
- } else {
-#endif
- ltp->lag = (uint16_t)faad_getbits(ld, 11
- DEBUGVAR(1,81,"ltp_data(): lag"));
-#ifdef LD_DEC
- }
-#endif
-
- /* Check length of lag */
- if (ltp->lag > (hDecoder->frameLength << 1))
- return 18;
-
- ltp->coef = (uint8_t)faad_getbits(ld, 3
- DEBUGVAR(1,82,"ltp_data(): coef"));
-
- if (ics->window_sequence == EIGHT_SHORT_SEQUENCE)
- {
- for (w = 0; w < ics->num_windows; w++)
- {
- if ((ltp->short_used[w] = faad_get1bit(ld
- DEBUGVAR(1,83,"ltp_data(): short_used"))) & 1)
- {
- ltp->short_lag_present[w] = faad_get1bit(ld
- DEBUGVAR(1,84,"ltp_data(): short_lag_present"));
- if (ltp->short_lag_present[w])
- {
- ltp->short_lag[w] = (uint8_t)faad_getbits(ld, 4
- DEBUGVAR(1,85,"ltp_data(): short_lag"));
- }
- }
- }
- } else {
- ltp->last_band = (ics->max_sfb < MAX_LTP_SFB ? ics->max_sfb : MAX_LTP_SFB);
-
- for (sfb = 0; sfb < ltp->last_band; sfb++)
- {
- ltp->long_used[sfb] = faad_get1bit(ld
- DEBUGVAR(1,86,"ltp_data(): long_used"));
- }
- }
-
- return 0;
-}
-#endif
-
-/* Table 4.4.29 */
-static uint8_t spectral_data(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld,
- int16_t *spectral_data)
-{
- int8_t i;
- uint8_t g;
- uint16_t inc, k, p = 0;
- uint8_t groups = 0;
- uint8_t sect_cb;
- uint8_t result;
- uint16_t nshort = hDecoder->frameLength/8;
-
-#ifdef PROFILE
- int64_t count = faad_get_ts();
-#endif
-
- for(g = 0; g < ics->num_window_groups; g++)
- {
- p = groups*nshort;
-
- for (i = 0; i < ics->num_sec[g]; i++)
- {
- sect_cb = ics->sect_cb[g][i];
-
- inc = (sect_cb >= FIRST_PAIR_HCB) ? 2 : 4;
-
- switch (sect_cb)
- {
- case ZERO_HCB:
- case NOISE_HCB:
- case INTENSITY_HCB:
- case INTENSITY_HCB2:
-//#define SD_PRINT
-#ifdef SD_PRINT
- {
- int j;
- for (j = ics->sect_sfb_offset[g][ics->sect_start[g][i]]; j < ics->sect_sfb_offset[g][ics->sect_end[g][i]]; j++)
- {
- printf("%d\n", 0);
- }
- }
-#endif
-//#define SFBO_PRINT
-#ifdef SFBO_PRINT
- printf("%d\n", ics->sect_sfb_offset[g][ics->sect_start[g][i]]);
-#endif
- p += (ics->sect_sfb_offset[g][ics->sect_end[g][i]] -
- ics->sect_sfb_offset[g][ics->sect_start[g][i]]);
- break;
- default:
-#ifdef SFBO_PRINT
- printf("%d\n", ics->sect_sfb_offset[g][ics->sect_start[g][i]]);
-#endif
- for (k = ics->sect_sfb_offset[g][ics->sect_start[g][i]];
- k < ics->sect_sfb_offset[g][ics->sect_end[g][i]]; k += inc)
- {
- if ((result = huffman_spectral_data(sect_cb, ld, &spectral_data[p])) > 0)
- return result;
-#ifdef SD_PRINT
- {
- int j;
- for (j = p; j < p+inc; j++)
- {
- printf("%d\n", spectral_data[j]);
- }
- }
-#endif
- p += inc;
- }
- break;
- }
- }
- groups += ics->window_group_length[g];
- }
-
-#ifdef PROFILE
- count = faad_get_ts() - count;
- hDecoder->spectral_cycles += count;
-#endif
-
- return 0;
-}
-
-/* Table 4.4.30 */
-static uint16_t extension_payload(bitfile *ld, drc_info *drc, uint16_t count)
-{
- uint16_t i, n, dataElementLength;
- uint8_t dataElementLengthPart;
- uint8_t align = 4, data_element_version, loopCounter;
-
- uint8_t extension_type = (uint8_t)faad_getbits(ld, 4
- DEBUGVAR(1,87,"extension_payload(): extension_type"));
-
- switch (extension_type)
- {
- case EXT_DYNAMIC_RANGE:
- drc->present = 1;
- n = dynamic_range_info(ld, drc);
- return n;
- case EXT_FILL_DATA:
- /* fill_nibble = */ faad_getbits(ld, 4
- DEBUGVAR(1,136,"extension_payload(): fill_nibble")); /* must be '0000' */
- for (i = 0; i < count-1; i++)
- {
- /* fill_byte[i] = */ faad_getbits(ld, 8
- DEBUGVAR(1,88,"extension_payload(): fill_byte")); /* must be '10100101' */
- }
- return count;
- case EXT_DATA_ELEMENT:
- data_element_version = (uint8_t)faad_getbits(ld, 4
- DEBUGVAR(1,400,"extension_payload(): data_element_version"));
- switch (data_element_version)
- {
- case ANC_DATA:
- loopCounter = 0;
- dataElementLength = 0;
- do {
- dataElementLengthPart = (uint8_t)faad_getbits(ld, 8
- DEBUGVAR(1,401,"extension_payload(): dataElementLengthPart"));
- dataElementLength += dataElementLengthPart;
- loopCounter++;
- } while (dataElementLengthPart == 255);
-
- for (i = 0; i < dataElementLength; i++)
- {
- /* data_element_byte[i] = */ faad_getbits(ld, 8
- DEBUGVAR(1,402,"extension_payload(): data_element_byte"));
- return (dataElementLength+loopCounter+1);
- }
- default:
- align = 0;
- }
- case EXT_FIL:
- default:
- faad_getbits(ld, align
- DEBUGVAR(1,88,"extension_payload(): fill_nibble"));
- for (i = 0; i < count-1; i++)
- {
- /* other_bits[i] = */ faad_getbits(ld, 8
- DEBUGVAR(1,89,"extension_payload(): fill_bit"));
- }
- return count;
- }
-}
-
-/* Table 4.4.31 */
-static uint8_t dynamic_range_info(bitfile *ld, drc_info *drc)
-{
- uint8_t i, n = 1;
- uint8_t band_incr;
-
- drc->num_bands = 1;
-
- if (faad_get1bit(ld
- DEBUGVAR(1,90,"dynamic_range_info(): has instance_tag")) & 1)
- {
- drc->pce_instance_tag = (uint8_t)faad_getbits(ld, 4
- DEBUGVAR(1,91,"dynamic_range_info(): pce_instance_tag"));
- /* drc->drc_tag_reserved_bits = */ faad_getbits(ld, 4
- DEBUGVAR(1,92,"dynamic_range_info(): drc_tag_reserved_bits"));
- n++;
- }
-
- drc->excluded_chns_present = faad_get1bit(ld
- DEBUGVAR(1,93,"dynamic_range_info(): excluded_chns_present"));
- if (drc->excluded_chns_present == 1)
- {
- n += excluded_channels(ld, drc);
- }
-
- if (faad_get1bit(ld
- DEBUGVAR(1,94,"dynamic_range_info(): has bands data")) & 1)
- {
- band_incr = (uint8_t)faad_getbits(ld, 4
- DEBUGVAR(1,95,"dynamic_range_info(): band_incr"));
- /* drc->drc_bands_reserved_bits = */ faad_getbits(ld, 4
- DEBUGVAR(1,96,"dynamic_range_info(): drc_bands_reserved_bits"));
- n++;
- drc->num_bands += band_incr;
-
- for (i = 0; i < drc->num_bands; i++);
- {
- drc->band_top[i] = (uint8_t)faad_getbits(ld, 8
- DEBUGVAR(1,97,"dynamic_range_info(): band_top"));
- n++;
- }
- }
-
- if (faad_get1bit(ld
- DEBUGVAR(1,98,"dynamic_range_info(): has prog_ref_level")) & 1)
- {
- drc->prog_ref_level = (uint8_t)faad_getbits(ld, 7
- DEBUGVAR(1,99,"dynamic_range_info(): prog_ref_level"));
- /* drc->prog_ref_level_reserved_bits = */ faad_get1bit(ld
- DEBUGVAR(1,100,"dynamic_range_info(): prog_ref_level_reserved_bits"));
- n++;
- }
-
- for (i = 0; i < drc->num_bands; i++)
- {
- drc->dyn_rng_sgn[i] = faad_get1bit(ld
- DEBUGVAR(1,101,"dynamic_range_info(): dyn_rng_sgn"));
- drc->dyn_rng_ctl[i] = (uint8_t)faad_getbits(ld, 7
- DEBUGVAR(1,102,"dynamic_range_info(): dyn_rng_ctl"));
- n++;
- }
-
- return n;
-}
-
-/* Table 4.4.32 */
-static uint8_t excluded_channels(bitfile *ld, drc_info *drc)
-{
- uint8_t i, n = 0;
- uint8_t num_excl_chan = 7;
-
- for (i = 0; i < 7; i++)
- {
- drc->exclude_mask[i] = faad_get1bit(ld
- DEBUGVAR(1,103,"excluded_channels(): exclude_mask"));
- }
- n++;
-
- while ((drc->additional_excluded_chns[n-1] = faad_get1bit(ld
- DEBUGVAR(1,104,"excluded_channels(): additional_excluded_chns"))) == 1)
- {
- for (i = num_excl_chan; i < num_excl_chan+7; i++)
- {
- drc->exclude_mask[i] = faad_get1bit(ld
- DEBUGVAR(1,105,"excluded_channels(): exclude_mask"));
- }
- n++;
- num_excl_chan += 7;
- }
-
- return n;
-}
-
-/* Annex A: Audio Interchange Formats */
-
-/* Table 1.A.2 */
-void get_adif_header(adif_header *adif, bitfile *ld)
-{
- uint8_t i;
-
- /* adif_id[0] = */ faad_getbits(ld, 8
- DEBUGVAR(1,106,"get_adif_header(): adif_id[0]"));
- /* adif_id[1] = */ faad_getbits(ld, 8
- DEBUGVAR(1,107,"get_adif_header(): adif_id[1]"));
- /* adif_id[2] = */ faad_getbits(ld, 8
- DEBUGVAR(1,108,"get_adif_header(): adif_id[2]"));
- /* adif_id[3] = */ faad_getbits(ld, 8
- DEBUGVAR(1,109,"get_adif_header(): adif_id[3]"));
- adif->copyright_id_present = faad_get1bit(ld
- DEBUGVAR(1,110,"get_adif_header(): copyright_id_present"));
- if(adif->copyright_id_present)
- {
- for (i = 0; i < 72/8; i++)
- {
- adif->copyright_id[i] = (int8_t)faad_getbits(ld, 8
- DEBUGVAR(1,111,"get_adif_header(): copyright_id"));
- }
- adif->copyright_id[i] = 0;
- }
- adif->original_copy = faad_get1bit(ld
- DEBUGVAR(1,112,"get_adif_header(): original_copy"));
- adif->home = faad_get1bit(ld
- DEBUGVAR(1,113,"get_adif_header(): home"));
- adif->bitstream_type = faad_get1bit(ld
- DEBUGVAR(1,114,"get_adif_header(): bitstream_type"));
- adif->bitrate = faad_getbits(ld, 23
- DEBUGVAR(1,115,"get_adif_header(): bitrate"));
- adif->num_program_config_elements = (uint8_t)faad_getbits(ld, 4
- DEBUGVAR(1,116,"get_adif_header(): num_program_config_elements"));
-
- for (i = 0; i < adif->num_program_config_elements + 1; i++)
- {
- if(adif->bitstream_type == 0)
- {
- adif->adif_buffer_fullness = faad_getbits(ld, 20
- DEBUGVAR(1,117,"get_adif_header(): adif_buffer_fullness"));
- } else {
- adif->adif_buffer_fullness = 0;
- }
-
- program_config_element(&adif->pce[i], ld);
- }
-}
-
-/* Table 1.A.5 */
-uint8_t adts_frame(adts_header *adts, bitfile *ld)
-{
- /* faad_byte_align(ld); */
- if (adts_fixed_header(adts, ld))
- return 5;
- adts_variable_header(adts, ld);
- adts_error_check(adts, ld);
-
- return 0;
-}
-
-/* Table 1.A.6 */
-static uint8_t adts_fixed_header(adts_header *adts, bitfile *ld)
-{
- uint16_t i;
- uint8_t sync_err = 1;
-
- /* try to recover from sync errors */
- for (i = 0; i < 768; i++)
- {
- adts->syncword = (uint16_t)faad_showbits(ld, 12);
- if (adts->syncword != 0xFFF)
- {
- faad_getbits(ld, 8
- DEBUGVAR(0,0,""));
- } else {
- sync_err = 0;
- faad_getbits(ld, 12
- DEBUGVAR(1,118,"adts_fixed_header(): syncword"));
- break;
- }
- }
- if (sync_err)
- return 5;
-
- adts->id = faad_get1bit(ld
- DEBUGVAR(1,119,"adts_fixed_header(): id"));
- adts->layer = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,120,"adts_fixed_header(): layer"));
- adts->protection_absent = faad_get1bit(ld
- DEBUGVAR(1,121,"adts_fixed_header(): protection_absent"));
- adts->profile = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,122,"adts_fixed_header(): profile"));
- adts->sf_index = (uint8_t)faad_getbits(ld, 4
- DEBUGVAR(1,123,"adts_fixed_header(): sf_index"));
- adts->private_bit = faad_get1bit(ld
- DEBUGVAR(1,124,"adts_fixed_header(): private_bit"));
- adts->channel_configuration = (uint8_t)faad_getbits(ld, 3
- DEBUGVAR(1,125,"adts_fixed_header(): channel_configuration"));
- adts->original = faad_get1bit(ld
- DEBUGVAR(1,126,"adts_fixed_header(): original"));
- adts->home = faad_get1bit(ld
- DEBUGVAR(1,127,"adts_fixed_header(): home"));
-
- if (adts->old_format == 1)
- {
- /* Removed in corrigendum 14496-3:2002 */
- if (adts->id == 0)
- {
- adts->emphasis = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,128,"adts_fixed_header(): emphasis"));
- }
- }
-
- return 0;
-}
-
-/* Table 1.A.7 */
-static void adts_variable_header(adts_header *adts, bitfile *ld)
-{
- adts->copyright_identification_bit = faad_get1bit(ld
- DEBUGVAR(1,129,"adts_variable_header(): copyright_identification_bit"));
- adts->copyright_identification_start = faad_get1bit(ld
- DEBUGVAR(1,130,"adts_variable_header(): copyright_identification_start"));
- adts->aac_frame_length = (uint16_t)faad_getbits(ld, 13
- DEBUGVAR(1,131,"adts_variable_header(): aac_frame_length"));
- adts->adts_buffer_fullness = (uint16_t)faad_getbits(ld, 11
- DEBUGVAR(1,132,"adts_variable_header(): adts_buffer_fullness"));
- adts->no_raw_data_blocks_in_frame = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,133,"adts_variable_header(): no_raw_data_blocks_in_frame"));
-}
-
-/* Table 1.A.8 */
-static void adts_error_check(adts_header *adts, bitfile *ld)
-{
- if (adts->protection_absent == 0)
- {
- adts->crc_check = (uint16_t)faad_getbits(ld, 16
- DEBUGVAR(1,134,"adts_error_check(): crc_check"));
- }
-}
diff --git a/src/libfaad/syntax.h b/src/libfaad/syntax.h
deleted file mode 100644
index a047dd644..000000000
--- a/src/libfaad/syntax.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: syntax.h,v 1.10 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __SYNTAX_H__
-#define __SYNTAX_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "decoder.h"
-#include "bits.h"
-
-#define MAIN 1
-#define LC 2
-#define SSR 3
-#define LTP 4
-#define HE_AAC 5
-#define LD 23
-#define ER_LC 17
-#define ER_LTP 19
-#define DRM_ER_LC 27 /* special object type for DRM */
-
-/* header types */
-#define RAW 0
-#define ADIF 1
-#define ADTS 2
-
-/* SBR signalling */
-#define NO_SBR 0
-#define SBR_UPSAMPLED 1
-#define SBR_DOWNSAMPLED 2
-#define NO_SBR_UPSAMPLED 3
-
-/* DRM channel definitions */
-#define DRMCH_MONO 1
-#define DRMCH_STEREO 2
-#define DRMCH_SBR_MONO 3
-#define DRMCH_SBR_STEREO 4
-#define DRMCH_SBR_PS_STEREO 5
-
-
-/* First object type that has ER */
-#define ER_OBJECT_START 17
-
-
-/* Bitstream */
-#define LEN_SE_ID 3
-#define LEN_TAG 4
-#define LEN_BYTE 8
-
-#define EXT_FIL 0
-#define EXT_FILL_DATA 1
-#define EXT_DATA_ELEMENT 2
-#define EXT_DYNAMIC_RANGE 11
-#define ANC_DATA 0
-
-/* Syntax elements */
-#define ID_SCE 0x0
-#define ID_CPE 0x1
-#define ID_CCE 0x2
-#define ID_LFE 0x3
-#define ID_DSE 0x4
-#define ID_PCE 0x5
-#define ID_FIL 0x6
-#define ID_END 0x7
-
-#define ONLY_LONG_SEQUENCE 0x0
-#define LONG_START_SEQUENCE 0x1
-#define EIGHT_SHORT_SEQUENCE 0x2
-#define LONG_STOP_SEQUENCE 0x3
-
-#define ZERO_HCB 0
-#define FIRST_PAIR_HCB 5
-#define ESC_HCB 11
-#define QUAD_LEN 4
-#define PAIR_LEN 2
-#define NOISE_HCB 13
-#define INTENSITY_HCB2 14
-#define INTENSITY_HCB 15
-
-#define INVALID_SBR_ELEMENT 255
-
-int8_t GASpecificConfig(bitfile *ld, mp4AudioSpecificConfig *mp4ASC,
- program_config *pce);
-
-uint8_t adts_frame(adts_header *adts, bitfile *ld);
-void get_adif_header(adif_header *adif, bitfile *ld);
-void raw_data_block(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo,
- bitfile *ld, program_config *pce, drc_info *drc);
-uint8_t reordered_spectral_data(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld,
- int16_t *spectral_data);
-void aac_scalable_main_element(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo,
- bitfile *ld, program_config *pce, drc_info *drc);
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/libfaad/tns.c b/src/libfaad/tns.c
deleted file mode 100644
index bb4db731a..000000000
--- a/src/libfaad/tns.c
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: tns.c,v 1.8 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#include "common.h"
-#include "structs.h"
-
-#include "syntax.h"
-#include "tns.h"
-
-
-/* static function declarations */
-static void tns_decode_coef(uint8_t order, uint8_t coef_res_bits, uint8_t coef_compress,
- uint8_t *coef, real_t *a);
-static void tns_ar_filter(real_t *spectrum, uint16_t size, int8_t inc, real_t *lpc,
- uint8_t order);
-static void tns_ma_filter(real_t *spectrum, uint16_t size, int8_t inc, real_t *lpc,
- uint8_t order);
-
-
-#ifdef _MSC_VER
-#pragma warning(disable:4305)
-#pragma warning(disable:4244)
-#endif
-static real_t tns_coef_0_3[] =
-{
- COEF_CONST(0.0), COEF_CONST(0.4338837391), COEF_CONST(0.7818314825), COEF_CONST(0.9749279122),
- COEF_CONST(-0.9848077530), COEF_CONST(-0.8660254038), COEF_CONST(-0.6427876097), COEF_CONST(-0.3420201433),
- COEF_CONST(-0.4338837391), COEF_CONST(-0.7818314825), COEF_CONST(-0.9749279122), COEF_CONST(-0.9749279122),
- COEF_CONST(-0.9848077530), COEF_CONST(-0.8660254038), COEF_CONST(-0.6427876097), COEF_CONST(-0.3420201433)
-};
-static real_t tns_coef_0_4[] =
-{
- COEF_CONST(0.0), COEF_CONST(0.2079116908), COEF_CONST(0.4067366431), COEF_CONST(0.5877852523),
- COEF_CONST(0.7431448255), COEF_CONST(0.8660254038), COEF_CONST(0.9510565163), COEF_CONST(0.9945218954),
- COEF_CONST(-0.9957341763), COEF_CONST(-0.9618256432), COEF_CONST(-0.8951632914), COEF_CONST(-0.7980172273),
- COEF_CONST(-0.6736956436), COEF_CONST(-0.5264321629), COEF_CONST(-0.3612416662), COEF_CONST(-0.1837495178)
-};
-static real_t tns_coef_1_3[] =
-{
- COEF_CONST(0.0), COEF_CONST(0.4338837391), COEF_CONST(-0.6427876097), COEF_CONST(-0.3420201433),
- COEF_CONST(0.9749279122), COEF_CONST(0.7818314825), COEF_CONST(-0.6427876097), COEF_CONST(-0.3420201433),
- COEF_CONST(-0.4338837391), COEF_CONST(-0.7818314825), COEF_CONST(-0.6427876097), COEF_CONST(-0.3420201433),
- COEF_CONST(-0.7818314825), COEF_CONST(-0.4338837391), COEF_CONST(-0.6427876097), COEF_CONST(-0.3420201433)
-};
-static real_t tns_coef_1_4[] =
-{
- COEF_CONST(0.0), COEF_CONST(0.2079116908), COEF_CONST(0.4067366431), COEF_CONST(0.5877852523),
- COEF_CONST(-0.6736956436), COEF_CONST(-0.5264321629), COEF_CONST(-0.3612416662), COEF_CONST(-0.1837495178),
- COEF_CONST(0.9945218954), COEF_CONST(0.9510565163), COEF_CONST(0.8660254038), COEF_CONST(0.7431448255),
- COEF_CONST(-0.6736956436), COEF_CONST(-0.5264321629), COEF_CONST(-0.3612416662), COEF_CONST(-0.1837495178)
-};
-
-
-/* TNS decoding for one channel and frame */
-void tns_decode_frame(ic_stream *ics, tns_info *tns, uint8_t sr_index,
- uint8_t object_type, real_t *spec, uint16_t frame_len)
-{
- uint8_t w, f, tns_order;
- int8_t inc;
- int16_t size;
- uint16_t bottom, top, start, end;
- uint16_t nshort = frame_len/8;
- real_t lpc[TNS_MAX_ORDER+1];
-
- if (!ics->tns_data_present)
- return;
-
- for (w = 0; w < ics->num_windows; w++)
- {
- bottom = ics->num_swb;
-
- for (f = 0; f < tns->n_filt[w]; f++)
- {
- top = bottom;
- bottom = max(top - tns->length[w][f], 0);
- tns_order = min(tns->order[w][f], TNS_MAX_ORDER);
- if (!tns_order)
- continue;
-
- tns_decode_coef(tns_order, tns->coef_res[w]+3,
- tns->coef_compress[w][f], tns->coef[w][f], lpc);
-
- start = min(bottom, max_tns_sfb(sr_index, object_type, (ics->window_sequence == EIGHT_SHORT_SEQUENCE)));
- start = min(start, ics->max_sfb);
- start = ics->swb_offset[start];
-
- end = min(top, max_tns_sfb(sr_index, object_type, (ics->window_sequence == EIGHT_SHORT_SEQUENCE)));
- end = min(end, ics->max_sfb);
- end = ics->swb_offset[end];
-
- size = end - start;
- if (size <= 0)
- continue;
-
- if (tns->direction[w][f])
- {
- inc = -1;
- start = end - 1;
- } else {
- inc = 1;
- }
-
- tns_ar_filter(&spec[(w*nshort)+start], size, inc, lpc, tns_order);
- }
- }
-}
-
-/* TNS encoding for one channel and frame */
-void tns_encode_frame(ic_stream *ics, tns_info *tns, uint8_t sr_index,
- uint8_t object_type, real_t *spec, uint16_t frame_len)
-{
- uint8_t w, f, tns_order;
- int8_t inc;
- int16_t size;
- uint16_t bottom, top, start, end;
- uint16_t nshort = frame_len/8;
- real_t lpc[TNS_MAX_ORDER+1];
-
- if (!ics->tns_data_present)
- return;
-
- for (w = 0; w < ics->num_windows; w++)
- {
- bottom = ics->num_swb;
-
- for (f = 0; f < tns->n_filt[w]; f++)
- {
- top = bottom;
- bottom = max(top - tns->length[w][f], 0);
- tns_order = min(tns->order[w][f], TNS_MAX_ORDER);
- if (!tns_order)
- continue;
-
- tns_decode_coef(tns_order, tns->coef_res[w]+3,
- tns->coef_compress[w][f], tns->coef[w][f], lpc);
-
- start = min(bottom, max_tns_sfb(sr_index, object_type, (ics->window_sequence == EIGHT_SHORT_SEQUENCE)));
- start = min(start, ics->max_sfb);
- start = ics->swb_offset[start];
-
- end = min(top, max_tns_sfb(sr_index, object_type, (ics->window_sequence == EIGHT_SHORT_SEQUENCE)));
- end = min(end, ics->max_sfb);
- end = ics->swb_offset[end];
-
- size = end - start;
- if (size <= 0)
- continue;
-
- if (tns->direction[w][f])
- {
- inc = -1;
- start = end - 1;
- } else {
- inc = 1;
- }
-
- tns_ma_filter(&spec[(w*nshort)+start], size, inc, lpc, tns_order);
- }
- }
-}
-
-/* Decoder transmitted coefficients for one TNS filter */
-static void tns_decode_coef(uint8_t order, uint8_t coef_res_bits, uint8_t coef_compress,
- uint8_t *coef, real_t *a)
-{
- uint8_t i, m;
- real_t tmp2[TNS_MAX_ORDER+1], b[TNS_MAX_ORDER+1];
-
- /* Conversion to signed integer */
- for (i = 0; i < order; i++)
- {
- if (coef_compress == 0)
- {
- if (coef_res_bits == 3)
- {
- tmp2[i] = tns_coef_0_3[coef[i]];
- } else {
- tmp2[i] = tns_coef_0_4[coef[i]];
- }
- } else {
- if (coef_res_bits == 3)
- {
- tmp2[i] = tns_coef_1_3[coef[i]];
- } else {
- tmp2[i] = tns_coef_1_4[coef[i]];
- }
- }
- }
-
- /* Conversion to LPC coefficients */
- a[0] = COEF_CONST(1.0);
- for (m = 1; m <= order; m++)
- {
- for (i = 1; i < m; i++) /* loop only while i<m */
- b[i] = a[i] + MUL_C(tmp2[m-1], a[m-i]);
-
- for (i = 1; i < m; i++) /* loop only while i<m */
- a[i] = b[i];
-
- a[m] = tmp2[m-1]; /* changed */
- }
-}
-
-static void tns_ar_filter(real_t *spectrum, uint16_t size, int8_t inc, real_t *lpc,
- uint8_t order)
-{
- /*
- - Simple all-pole filter of order "order" defined by
- y(n) = x(n) - lpc[1]*y(n-1) - ... - lpc[order]*y(n-order)
- - The state variables of the filter are initialized to zero every time
- - The output data is written over the input data ("in-place operation")
- - An input vector of "size" samples is processed and the index increment
- to the next data sample is given by "inc"
- */
-
- uint8_t j;
- uint16_t i;
- real_t y;
- /* state is stored as a double ringbuffer */
- real_t state[2*TNS_MAX_ORDER] = {0};
- int8_t state_index = 0;
-
- for (i = 0; i < size; i++)
- {
- y = *spectrum;
-
- for (j = 0; j < order; j++)
- y -= MUL_C(state[state_index+j], lpc[j+1]);
-
- /* double ringbuffer state */
- state_index--;
- if (state_index < 0)
- state_index = order-1;
- state[state_index] = state[state_index + order] = y;
-
- *spectrum = y;
- spectrum += inc;
-
-//#define TNS_PRINT
-#ifdef TNS_PRINT
- //printf("%d\n", y);
- printf("0x%.8X\n", y);
-#endif
- }
-}
-
-static void tns_ma_filter(real_t *spectrum, uint16_t size, int8_t inc, real_t *lpc,
- uint8_t order)
-{
- /*
- - Simple all-zero filter of order "order" defined by
- y(n) = x(n) + a(2)*x(n-1) + ... + a(order+1)*x(n-order)
- - The state variables of the filter are initialized to zero every time
- - The output data is written over the input data ("in-place operation")
- - An input vector of "size" samples is processed and the index increment
- to the next data sample is given by "inc"
- */
-
- uint8_t j;
- uint16_t i;
- real_t y;
- /* state is stored as a double ringbuffer */
- real_t state[2*TNS_MAX_ORDER] = {0};
- int8_t state_index = 0;
-
- for (i = 0; i < size; i++)
- {
- y = *spectrum;
-
- for (j = 0; j < order; j++)
- y += MUL_C(state[j], lpc[j+1]);
-
- /* double ringbuffer state */
- state_index--;
- if (state_index < 0)
- state_index = order-1;
- state[state_index] = state[state_index + order] = *spectrum;
-
- *spectrum = y;
- spectrum += inc;
- }
-}
diff --git a/src/libfaad/tns.h b/src/libfaad/tns.h
deleted file mode 100644
index fc77894d8..000000000
--- a/src/libfaad/tns.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: tns.h,v 1.8 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __TNS_H__
-#define __TNS_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#define TNS_MAX_ORDER 20
-
-
-void tns_decode_frame(ic_stream *ics, tns_info *tns, uint8_t sr_index,
- uint8_t object_type, real_t *spec, uint16_t frame_len);
-void tns_encode_frame(ic_stream *ics, tns_info *tns, uint8_t sr_index,
- uint8_t object_type, real_t *spec, uint16_t frame_len);
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/src/libffmpeg/Makefile.am b/src/libffmpeg/Makefile.am
index 5c370e5ba..42fe20f95 100644
--- a/src/libffmpeg/Makefile.am
+++ b/src/libffmpeg/Makefile.am
@@ -1,45 +1,62 @@
include $(top_srcdir)/misc/Makefile.common
-if HAVE_FFMPEG
-AM_CFLAGS = $(FFMPEG_CFLAGS) $(FFMPEG_POSTPROC_CFLAGS)
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_CPPFLAGS = $(ZLIB_CPPFLAGS)
+AM_LDFLAGS = $(xineplug_ldflags)
+
+if WITH_EXTERNAL_FFMPEG
+AM_CFLAGS += $(FFMPEG_CFLAGS) $(FFMPEG_POSTPROC_CFLAGS)
link_ffmpeg = $(FFMPEG_LIBS) $(FFMPEG_POSTPROC_LIBS)
else
-ff_cppflags = -I$(top_srcdir)/src/libffmpeg/libavutil
-link_ffmpeg = \
- $(top_builddir)/src/libffmpeg/libavcodec/libavcodec.la \
- $(top_builddir)/src/libffmpeg/libavutil/libavutil.la \
- $(top_builddir)/src/libffmpeg/libavcodec/libpostproc/libpostprocess.la
-SUBDIRS = libavcodec libavutil
-endif
+AM_CPPFLAGS += -I$(top_srcdir)/contrib/ffmpeg/libavutil \
+ -I$(top_srcdir)/contrib/ffmpeg/libavcodec \
+ -I$(top_srcdir)/contrib/ffmpeg/libpostproc
+link_ffmpeg = $(top_builddir)/contrib/ffmpeg/libavcodec/libavcodec.a \
+ $(top_builddir)/contrib/ffmpeg/libavutil/libavutil.a \
+ $(top_builddir)/contrib/ffmpeg/libpostproc/libpostproc.a
-# ffmpeg_config.h is generated by configure
-DISTCLEANFILES = ffmpeg_config.h
+$(top_builddir)/contrib/ffmpeg/libavcodec/libavcodec.a:
+ $(MAKE) -C $(top_builddir)/contrib/ ffmpeg/libavcodec/libavcodec.a
-# this must always be included, even if the current machine has no DXR3...
-EXTRA_DIST = ffmpeg_encoder.c diff_to_ffmpeg_cvs.txt
+$(top_builddir)/contrib/ffmpeg/libavutil/libavutil.a:
+ $(MAKE) -C $(top_builddir)/contrib/ ffmpeg/libavutil/libavutil.a
+
+$(top_builddir)/contrib/ffmpeg/libpostproc/libpostproc.a:
+ $(MAKE) -C $(top_builddir)/contrib/ ffmpeg/libpostproc/libpostproc.a
+
+$(top_builddir)/contrib/ffmpeg/config.h:
+ $(MAKE) -C $(top_builddir)/contrib/ ffmpeg/config.mak
+
+ffmpeg_config.h: $(top_builddir)/contrib/ffmpeg/config.h
+ cp $(top_builddir)/contrib/ffmpeg/config.h ffmpeg_config.h
-INTERNAL_DOCS = diff_to_ffmpeg_cvs.txt
+BUILT_SOURCES = ffmpeg_config.h
+CLEANFILES = $(BUILT_SOURCES)
+
+endif
+
+# this must always be included, even if the current machine has no DXR3...
+EXTRA_DIST = ffmpeg_encoder.c
xineplug_LTLIBRARIES = xineplug_decode_ff.la xineplug_decode_dvaudio.la
-if HAVE_DXR3
-AM_CPPFLAGS = -I$(top_srcdir)/src/dxr3 $(X_CFLAGS) $(ff_cppflags) \
- $(ZLIB_CPPFLAGS)
+if ENABLE_DXR3
+AM_CFLAGS += $(X_CFLAGS)
+AM_CPPFLAGS += -I$(top_srcdir)/src/dxr3
xineplug_decode_ff_la_SOURCES = ffmpeg_decoder.c ff_audio_decoder.c ff_video_decoder.c \
ffmpeg_encoder.c ff_mpeg_parser.c ffmpeg_decoder.h \
ff_mpeg_parser.h
else
-AM_CPPFLAGS = $(ff_cppflags) $(ZLIB_CPPFLAGS)
xineplug_decode_ff_la_SOURCES = ffmpeg_decoder.c ff_audio_decoder.c ff_video_decoder.c \
ff_mpeg_parser.c ffmpeg_decoder.h ff_mpeg_parser.h
endif
-xineplug_decode_ff_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_decode_ff_la_LDFLAGS = $(xineplug_ldflags) $(IMPURE_TEXT_LDFLAGS)
+nodist_xineplug_decode_ff_la_SOURCES = ffmpeg_config.h
+
xineplug_decode_ff_la_LIBADD = $(MLIB_LIBS) $(XINE_LIB) -lm $(ZLIB_LIBS) \
$(link_ffmpeg) $(PTHREAD_LIBS) $(LTLIBINTL)
+xineplug_decode_ff_la_LDFLAGS = $(AM_LDFLAGS) $(IMPURE_TEXT_LDFLAGS)
-xineplug_decode_dvaudio_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_decode_dvaudio_la_LDFLAGS = $(xineplug_ldflags)
-xineplug_decode_dvaudio_la_SOURCES = ff_dvaudio_decoder.c
-xineplug_decode_dvaudio_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
+xineplug_decode_dvaudio_la_SOURCES = ff_dvaudio_decoder.c
+xineplug_decode_dvaudio_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
+xineplug_decode_dvaudio_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/contrib/ffmpeg/libavcodec
diff --git a/src/libffmpeg/diff_to_ffmpeg_cvs.txt b/src/libffmpeg/diff_to_ffmpeg_cvs.txt
deleted file mode 100644
index 2e374cfd0..000000000
--- a/src/libffmpeg/diff_to_ffmpeg_cvs.txt
+++ /dev/null
@@ -1,619 +0,0 @@
-Index: libavutil/internal.h
-===================================================================
---- libavutil/internal.h (revision 7433)
-+++ libavutil/internal.h (working copy)
-@@ -181,11 +181,15 @@
- #include <assert.h>
-
- /* dprintf macros */
--#ifdef DEBUG
--# define dprintf(fmt,...) av_log(NULL, AV_LOG_DEBUG, fmt, __VA_ARGS__)
--#else
--# define dprintf(fmt,...)
--#endif
-+# ifdef DEBUG
-+# ifdef __GNUC__
-+# define dprintf(fmt,args...) av_log(NULL, AV_LOG_DEBUG, fmt, ##args)
-+# else
-+# define dprintf(fmt,...) av_log(NULL, AV_LOG_DEBUG, fmt, __VA_ARGS__)
-+# endif
-+# else
-+# define dprintf(fmt,...)
-+# endif
-
- #define av_abort() do { av_log(NULL, AV_LOG_ERROR, "Abort at %s:%d\n", __FILE__, __LINE__); abort(); } while (0)
-
-Index: libavutil/integer.c
-===================================================================
---- libavutil/integer.c (revision 7433)
-+++ libavutil/integer.c (working copy)
-@@ -126,8 +126,8 @@
- AVInteger quot_temp;
- if(!quot) quot = &quot_temp;
-
-- assert((int16_t)a[AV_INTEGER_SIZE-1] >= 0 && (int16_t)b[AV_INTEGER_SIZE-1] >= 0);
-- assert(av_log2(b)>=0);
-+ assert((int16_t)a.v[AV_INTEGER_SIZE-1] >= 0 && (int16_t)b.v[AV_INTEGER_SIZE-1] >= 0);
-+ assert(av_log2_i(b)>=0);
-
- if(i > 0)
- b= av_shr_i(b, -i);
-Index: libavutil/common.h
-===================================================================
---- libavutil/common.h (revision 7433)
-+++ libavutil/common.h (working copy)
-@@ -345,4 +345,20 @@
- char *av_strdup(const char *s);
- void av_freep(void *ptr);
-
-+/* xine: inline causes trouble for debug compiling */
-+#ifdef DISABLE_INLINE
-+# ifdef inline
-+# undef inline
-+# endif
-+# ifdef always_inline
-+# undef always_inline
-+# endif
-+# define inline
-+# define always_inline
-+#endif
-+
-+/* xine: another config.h with codecs to use */
-+#include "ffmpeg_config.h"
-+
- #endif /* COMMON_H */
-+
-Index: libavcodec/mjpeg.c
-===================================================================
---- libavcodec/mjpeg.c (revision 7433)
-+++ libavcodec/mjpeg.c (working copy)
-@@ -38,6 +38,13 @@
- #include "mpegvideo.h"
- #include "bytestream.h"
-
-+/* if xine's MPEG encoder is enabled, enable the encoding features in
-+ * this particular module */
-+#if defined(XINE_MPEG_ENCODER) && !defined(CONFIG_ENCODERS)
-+#define CONFIG_ENCODERS
-+#endif
-+
-+
- /* use two quantizer tables (one for luminance and one for chrominance) */
- /* not yet working */
- #undef TWOMATRIXES
-Index: libavcodec/i386/dsputil_mmx.c
-===================================================================
---- libavcodec/i386/dsputil_mmx.c (revision 7433)
-+++ libavcodec/i386/dsputil_mmx.c (working copy)
-@@ -2545,33 +2545,39 @@
- "pmullw %%mm5, %%mm2 \n\t" // (s-dx)*dy
- "pmullw %%mm4, %%mm1 \n\t" // dx*(s-dy)
-
-- "movd %4, %%mm5 \n\t"
-- "movd %3, %%mm4 \n\t"
-+ "movd %3, %%mm5 \n\t"
-+ "movd %2, %%mm4 \n\t"
- "punpcklbw %%mm7, %%mm5 \n\t"
- "punpcklbw %%mm7, %%mm4 \n\t"
- "pmullw %%mm5, %%mm3 \n\t" // src[1,1] * dx*dy
- "pmullw %%mm4, %%mm2 \n\t" // src[0,1] * (s-dx)*dy
-
-- "movd %2, %%mm5 \n\t"
-- "movd %1, %%mm4 \n\t"
-+ "movd %1, %%mm5 \n\t"
-+ "movd %0, %%mm4 \n\t"
- "punpcklbw %%mm7, %%mm5 \n\t"
- "punpcklbw %%mm7, %%mm4 \n\t"
- "pmullw %%mm5, %%mm1 \n\t" // src[1,0] * dx*(s-dy)
- "pmullw %%mm4, %%mm0 \n\t" // src[0,0] * (s-dx)*(s-dy)
-- "paddw %5, %%mm1 \n\t"
-+ "paddw %4, %%mm1 \n\t"
- "paddw %%mm3, %%mm2 \n\t"
- "paddw %%mm1, %%mm0 \n\t"
- "paddw %%mm2, %%mm0 \n\t"
-
-- "psrlw %6, %%mm0 \n\t"
-+ "psrlw %5, %%mm0 \n\t"
- "packuswb %%mm0, %%mm0 \n\t"
-- "movd %%mm0, %0 \n\t"
-
-- : "=m"(dst[x+y*stride])
-+ :
- : "m"(src[0]), "m"(src[1]),
- "m"(src[stride]), "m"(src[stride+1]),
- "m"(*r4), "m"(shift2)
- );
-+
-+ asm volatile(
-+ "movd %%mm0, %0 \n\t"
-+
-+ : "=m"(dst[x+y*stride])
-+ :
-+ );
- src += stride;
- }
- src += 4-h*stride;
-Index: libavcodec/mpegvideo.c
-===================================================================
---- libavcodec/mpegvideo.c (revision 7433)
-+++ libavcodec/mpegvideo.c (working copy)
-@@ -40,6 +40,14 @@
- //#undef NDEBUG
- //#include <assert.h>
-
-+
-+/* if xine's MPEG encoder is enabled, enable the encoding features in
-+ * this particular module */
-+#if defined(XINE_MPEG_ENCODER) && !defined(CONFIG_ENCODERS)
-+#define CONFIG_ENCODERS
-+#endif
-+
-+
- #ifdef CONFIG_ENCODERS
- static int encode_picture(MpegEncContext *s, int picture_number);
- #endif //CONFIG_ENCODERS
-@@ -1345,6 +1353,8 @@
- ff_set_cmp(&s->dsp, s->dsp.ildct_cmp, s->avctx->ildct_cmp);
- ff_set_cmp(&s->dsp, s->dsp.frame_skip_cmp, s->avctx->frame_skip_cmp);
-
-+/* xine: do not need this for decode or MPEG-1 encoding modes */
-+#if 0
- #ifdef CONFIG_H261_ENCODER
- if (s->out_format == FMT_H261)
- ff_h261_encode_init(s);
-@@ -1353,6 +1363,8 @@
- h263_encode_init(s);
- if(s->msmpeg4_version)
- ff_msmpeg4_encode_init(s);
-+#endif /* #if 0 */
-+/* xine: we DO want this for MPEG-1 encoding */
- if (s->out_format == FMT_MPEG1)
- ff_mpeg1_encode_init(s);
-
-@@ -1397,9 +1409,12 @@
-
- ff_rate_control_uninit(s);
-
-+/* xine: do not need this for decode or MPEG-1 encoding modes */
-+#if 0
- MPV_common_end(s);
- if (s->out_format == FMT_MJPEG)
- mjpeg_close(s);
-+#endif /* #if 0 */
-
- av_freep(&avctx->extradata);
-
-@@ -2545,8 +2560,11 @@
-
- MPV_frame_end(s);
-
-+/* xine: do not need this for decode or MPEG-1 encoding modes */
-+#if 0
- if (s->out_format == FMT_MJPEG)
- mjpeg_picture_trailer(s);
-+#endif /* #if 0 */
-
- if(avctx->rc_buffer_size){
- RateControlContext *rcc= &s->rc_context;
-@@ -4574,6 +4592,8 @@
- case CODEC_ID_MPEG1VIDEO:
- case CODEC_ID_MPEG2VIDEO:
- mpeg1_encode_mb(s, s->block, motion_x, motion_y); break;
-+/* xine: do not need this for decode or MPEG-1 encoding modes */
-+#if 0
- case CODEC_ID_MPEG4:
- mpeg4_encode_mb(s, s->block, motion_x, motion_y); break;
- case CODEC_ID_MSMPEG4V2:
-@@ -4594,6 +4614,7 @@
- h263_encode_mb(s, s->block, motion_x, motion_y); break;
- case CODEC_ID_MJPEG:
- mjpeg_encode_mb(s, s->block); break;
-+#endif /* #if 0 */
- default:
- assert(0);
- }
-@@ -4815,6 +4836,8 @@
- +sse(s, s->new_picture.data[2] + s->mb_x*8 + s->mb_y*s->uvlinesize*8,s->dest[2], w>>1, h>>1, s->uvlinesize);
- }
-
-+/* xine: do not need this for decode or MPEG-1 encoding modes */
-+#if 0
- static int pre_estimate_motion_thread(AVCodecContext *c, void *arg){
- MpegEncContext *s= arg;
-
-@@ -4860,6 +4883,7 @@
- }
- return 0;
- }
-+#endif /* #if 0 */
-
- static int mb_var_thread(AVCodecContext *c, void *arg){
- MpegEncContext *s= arg;
-@@ -4886,6 +4910,8 @@
- }
-
- static void write_slice_end(MpegEncContext *s){
-+/* xine: do not need this for decode or MPEG-1 encoding modes */
-+#if 0
- if(s->codec_id==CODEC_ID_MPEG4){
- if(s->partitioned_frame){
- ff_mpeg4_merge_partitions(s);
-@@ -4895,6 +4921,7 @@
- }else if(s->out_format == FMT_MJPEG){
- ff_mjpeg_stuffing(&s->pb);
- }
-+#endif /* #if 0 */
-
- align_put_bits(&s->pb);
- flush_put_bits(&s->pb);
-@@ -4950,10 +4977,13 @@
- case CODEC_ID_FLV1:
- s->gob_index = ff_h263_get_gob_height(s);
- break;
-+/* xine: do not need this for decode or MPEG-1 encoding modes */
-+#if 0
- case CODEC_ID_MPEG4:
- if(s->partitioned_frame)
- ff_mpeg4_init_partitions(s);
- break;
-+#endif /* #if 0 */
- }
-
- s->resync_mb_x=0;
-@@ -5026,9 +5056,12 @@
- if(s->start_mb_y != mb_y || mb_x!=0){
- write_slice_end(s);
-
-+/* xine: do not need this for decode or MPEG-1 encoding modes */
-+#if 0
- if(s->codec_id==CODEC_ID_MPEG4 && s->partitioned_frame){
- ff_mpeg4_init_partitions(s);
- }
-+#endif /* #if 0 */
- }
-
- assert((put_bits_count(&s->pb)&7) == 0);
-@@ -5052,19 +5085,25 @@
- }
-
- switch(s->codec_id){
-+/* xine: do not need this for decode or MPEG-1 encoding modes */
-+#if 0
- case CODEC_ID_MPEG4:
- ff_mpeg4_encode_video_packet_header(s);
- ff_mpeg4_clean_buffers(s);
- break;
-+#endif /* #if 0 */
- case CODEC_ID_MPEG1VIDEO:
- case CODEC_ID_MPEG2VIDEO:
- ff_mpeg1_encode_slice_header(s);
- ff_mpeg1_clean_buffers(s);
- break;
-+/* xine: do not need this for decode or MPEG-1 encoding modes */
-+#if 0
- case CODEC_ID_H263:
- case CODEC_ID_H263P:
- h263_encode_gob_header(s, mb_y);
- break;
-+#endif /* #if 0 */
- }
-
- if(s->flags&CODEC_FLAG_PASS1){
-@@ -5286,7 +5325,10 @@
- backup_s.dquant = 0;
- s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD | MV_DIRECT;
- s->mb_intra= 0;
-+/* xine: do not need this for decode or MPEG-1 encoding modes */
-+#if 0
- ff_mpeg4_set_direct_mv(s, 0, 0);
-+#endif /* #if 0 */
- encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_DIRECT, pb, pb2, tex_pb,
- &dmin, &next_block, 0, 0);
- }
-@@ -5400,7 +5442,10 @@
- s->mb_intra= 0;
- motion_x=s->b_direct_mv_table[xy][0];
- motion_y=s->b_direct_mv_table[xy][1];
-+/* xine: do not need this for decode or MPEG-1 encoding modes */
-+#if 0
- ff_mpeg4_set_direct_mv(s, motion_x, motion_y);
-+#endif /* #if 0 */
- break;
- case CANDIDATE_MB_TYPE_DIRECT0:
- s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD | MV_DIRECT;
-@@ -5513,8 +5558,11 @@
- }
-
- //not beautiful here but we must write it before flushing so it has to be here
-+/* xine: do not need this for decode or MPEG-1 encoding modes */
-+#if 0
- if (s->msmpeg4_version && s->msmpeg4_version<4 && s->pict_type == I_TYPE)
- msmpeg4_encode_ext_header(s);
-+#endif /* #if 0 */
-
- write_slice_end(s);
-
-@@ -5582,6 +5630,8 @@
- }
-
- if(s->adaptive_quant){
-+/* xine: do not need this for decode or MPEG-1 encoding modes */
-+#if 0
- switch(s->codec_id){
- case CODEC_ID_MPEG4:
- ff_clean_mpeg4_qscales(s);
-@@ -5592,6 +5642,7 @@
- ff_clean_h263_qscales(s);
- break;
- }
-+#endif /* #if 0 */
-
- s->lambda= s->lambda_table[0];
- //FIXME broken
-@@ -5613,10 +5664,13 @@
- s->me.mb_var_sum_temp =
- s->me.mc_mb_var_sum_temp = 0;
-
-+/* xine: do not need this for decode or MPEG-1 encoding modes */
-+#if 0
- /* we need to initialize some time vars before we can encode b-frames */
- // RAL: Condition added for MPEG1VIDEO
- if (s->codec_id == CODEC_ID_MPEG1VIDEO || s->codec_id == CODEC_ID_MPEG2VIDEO || (s->h263_pred && !s->h263_msmpeg4))
- ff_set_mpeg4_time(s, s->picture_number); //FIXME rename and use has_b_frames or similar
-+#endif /* #if 0 */
-
- s->me.scene_change_score=0;
-
-@@ -5647,6 +5701,8 @@
- ff_update_duplicate_context(s->thread_context[i], s);
- }
-
-+/* xine: do not need this for decode or MPEG-1 encoding modes */
-+#if 0
- ff_init_me(s);
-
- /* Estimate motion for every MB */
-@@ -5661,6 +5717,8 @@
-
- s->avctx->execute(s->avctx, estimate_motion_thread, (void**)&(s->thread_context[0]), NULL, s->avctx->thread_count);
- }else /* if(s->pict_type == I_TYPE) */{
-+#endif /* #if 0 */
-+ {
- /* I-Frame */
- for(i=0; i<s->mb_stride*s->mb_height; i++)
- s->mb_type[i]= CANDIDATE_MB_TYPE_INTRA;
-@@ -5684,6 +5742,8 @@
- //printf("Scene change detected, encoding as I Frame %d %d\n", s->current_picture.mb_var_sum, s->current_picture.mc_mb_var_sum);
- }
-
-+/* xine: do not need this for decode or MPEG-1 encoding modes */
-+#if 0
- if(!s->umvplus){
- if(s->pict_type==P_TYPE || s->pict_type==S_TYPE) {
- s->f_code= ff_get_best_fcode(s, s->p_mv_table, CANDIDATE_MB_TYPE_INTER);
-@@ -5737,6 +5797,7 @@
- }
- }
- }
-+#endif /* #if 0 */
-
- if (estimate_qp(s, 0) < 0)
- return -1;
-@@ -5768,6 +5829,8 @@
-
- s->last_bits= put_bits_count(&s->pb);
- switch(s->out_format) {
-+/* xine: do not need this for decode or MPEG-1 encoding modes */
-+#if 0
- case FMT_MJPEG:
- mjpeg_picture_header(s);
- break;
-@@ -5796,11 +5859,15 @@
- else
- h263_encode_picture_header(s, picture_number);
- break;
-+#endif /* #if 0 */
- case FMT_MPEG1:
- mpeg1_encode_picture_header(s, picture_number);
- break;
-+/* xine: do not need this for decode or MPEG-1 encoding modes */
-+#if 0
- case FMT_H264:
- break;
-+#endif /* #if 0 */
- default:
- assert(0);
- }
-Index: libavcodec/mpeg12.c
-===================================================================
---- libavcodec/mpeg12.c (revision 7433)
-+++ libavcodec/mpeg12.c (working copy)
-@@ -36,6 +36,13 @@
- //#include <assert.h>
-
-
-+/* if xine's MPEG encoder is enabled, enable the encoding features in
-+ * this particular module */
-+#if defined(XINE_MPEG_ENCODER) && !defined(CONFIG_ENCODERS)
-+#define CONFIG_ENCODERS
-+#endif
-+
-+
- /* Start codes. */
- #define SEQ_END_CODE 0x000001b7
- #define SEQ_START_CODE 0x000001b3
-Index: libavcodec/motion_est.c
-===================================================================
---- libavcodec/motion_est.c (revision 7433)
-+++ libavcodec/motion_est.c (working copy)
-@@ -23,6 +23,9 @@
- * new Motion Estimation (X1/EPZS) by Michael Niedermayer <michaelni@gmx.at>
- */
-
-+/* motion estimation only needed for encoders */
-+#ifdef CONFIG_ENCODERS
-+
- /**
- * @file motion_est.c
- * Motion estimation.
-@@ -2142,3 +2145,5 @@
- }
- }
- }
-+
-+#endif /* CONFIG_ENCODERS */
-Index: libavcodec/snow.c
-===================================================================
---- libavcodec/snow.c (revision 7433)
-+++ libavcodec/snow.c (working copy)
-@@ -487,7 +487,9 @@
- #define slice_buffer_get_line(slice_buf, line_num) ((slice_buf)->line[line_num] ? (slice_buf)->line[line_num] : slice_buffer_load_line((slice_buf), (line_num)))
- //#define slice_buffer_get_line(slice_buf, line_num) (slice_buffer_load_line((slice_buf), (line_num)))
-
-+#ifdef CONFIG_ENCODERS
- static void iterative_me(SnowContext *s);
-+#endif
-
- static void slice_buffer_init(slice_buffer * buf, int line_count, int max_allocated_lines, int line_width, DWTELEM * base_buffer)
- {
-@@ -1982,6 +1982,7 @@
- #define P_MV1 P[9]
- #define FLAG_QPEL 1 //must be 1
-
-+#ifdef CONFIG_ENCODERS
- static int encode_q_branch(SnowContext *s, int level, int x, int y){
- uint8_t p_buffer[1024];
- uint8_t i_buffer[1024];
-@@ -2210,6 +2211,7 @@
- return score;
- }
- }
-+#endif
-
- static av_always_inline int same_block(BlockNode *a, BlockNode *b){
- if((a->type&BLOCK_INTRA) && (b->type&BLOCK_INTRA)){
-@@ -2322,6 +2324,7 @@
- }
- }
-
-+#ifdef CONFIG_ENCODERS
- static void encode_blocks(SnowContext *s, int search){
- int x, y;
- int w= s->b_width;
-@@ -2343,6 +2346,7 @@
- }
- }
- }
-+#endif
-
- static void decode_blocks(SnowContext *s){
- int x, y;
-@@ -3182,6 +3184,7 @@
- }
- }
-
-+#ifdef CONFIG_ENCODERS
- static void iterative_me(SnowContext *s){
- int pass, mb_x, mb_y;
- const int b_width = s->b_width << s->block_max_depth;
-@@ -3406,6 +3409,7 @@
- av_log(NULL, AV_LOG_ERROR, "pass:4mv changed:%d\n", change*4);
- }
- }
-+#endif
-
- static void quantize(SnowContext *s, SubBand *b, DWTELEM *src, int stride, int bias){
- const int level= b->level;
-@@ -3931,6 +3935,7 @@
- }
- }
-
-+#ifdef CONFIG_ENCODERS
- static int encode_init(AVCodecContext *avctx)
- {
- SnowContext *s = avctx->priv_data;
-@@ -4018,6 +4023,7 @@
-
- return 0;
- }
-+#endif
-
- static int frame_start(SnowContext *s){
- AVFrame tmp;
-@@ -4056,6 +4062,7 @@
- return 0;
- }
-
-+#ifdef CONFIG_ENCODERS
- static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){
- SnowContext *s = avctx->priv_data;
- RangeCoder * const c= &s->c;
-@@ -4308,6 +4315,7 @@
-
- return ff_rac_terminate(c);
- }
-+#endif
-
- static void common_end(SnowContext *s){
- int plane_index, level, orientation, i;
-@@ -4339,6 +4347,7 @@
- }
- }
-
-+#ifdef CONFIG_ENCODERS
- static int encode_end(AVCodecContext *avctx)
- {
- SnowContext *s = avctx->priv_data;
-@@ -4348,6 +4357,7 @@
-
- return 0;
- }
-+#endif
-
- static int decode_init(AVCodecContext *avctx)
- {
-Index: libavcodec/mlib/dsputil_mlib.c
-===================================================================
---- libavcodec/mlib/dsputil_mlib.c (revision 7433)
-+++ libavcodec/mlib/dsputil_mlib.c (working copy)
-@@ -22,6 +22,8 @@
- #include "../dsputil.h"
- #include "../mpegvideo.h"
-
-+#include "../../../xine-utils/xineutils.h"
-+
- #include <mlib_types.h>
- #include <mlib_status.h>
- #include <mlib_sys.h>
-Index: libavcodec/avcodec.h
-===================================================================
---- libavcodec/avcodec.h (revision 7433)
-+++ libavcodec/avcodec.h (working copy)
-@@ -47,6 +47,13 @@
- #define AV_TIME_BASE 1000000
- #define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE}
-
-+/* FIXME: We cannot use ffmpeg's XvMC capabilities, since that would require
-+ * linking the ffmpeg plugin against XvMC libraries, which is a bad thing,
-+ * since they are output dependend.
-+ * The correct fix would be to reimplement the XvMC functions libavcodec uses
-+ * and do the necessary talking with our XvMC output plugin there. */
-+#undef HAVE_XVMC
-+
- enum CodecID {
- CODEC_ID_NONE,
- CODEC_ID_MPEG1VIDEO,
-@@ -2688,6 +2695,13 @@
-
- extern unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
-
-+/* unused static macro */
-+#if defined(__GNUC__) && !defined(DEBUG)
-+/* since we do not compile the encoder part of ffmpeg, some static
-+ * functions will be unused; this is ok, the compiler will take care */
-+# define static static __attribute__((__unused__))
-+#endif
-+
- #ifdef __cplusplus
- }
- #endif
diff --git a/src/libffmpeg/ff_audio_decoder.c b/src/libffmpeg/ff_audio_decoder.c
index 82e19d2d7..4a4141b2f 100644
--- a/src/libffmpeg/ff_audio_decoder.c
+++ b/src/libffmpeg/ff_audio_decoder.c
@@ -25,7 +25,9 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
-#include "ffmpeg_config.h"
+# ifndef HAVE_FFMPEG
+# include "ffmpeg_config.h"
+# endif
#endif
#include <stdlib.h>
@@ -445,105 +447,105 @@ void *init_audio_plugin (xine_t *xine, void *data) {
}
static uint32_t supported_audio_types[] = {
- #ifdef CONFIG_WMAV1_DECODER
+#if defined(HAVE_FFMPEG) || CONFIG_WMAV1_DECODER
BUF_AUDIO_WMAV1,
- #endif
- #ifdef CONFIG_WMAV2_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_WMAV2_DECODER
BUF_AUDIO_WMAV2,
- #endif
- #ifdef CONFIG_RA_144_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_RA_144_DECODER
BUF_AUDIO_14_4,
- #endif
- #ifdef CONFIG_RA_288_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_RA_288_DECODER
BUF_AUDIO_28_8,
- #endif
- #ifdef CONFIG_MP3_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_MP3_DECODER
BUF_AUDIO_MPEG,
- #endif
- #ifdef CONFIG_ADPCM_MS_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_ADPCM_MS_DECODER
BUF_AUDIO_MSADPCM,
- #endif
- #ifdef CONFIG_ADPCM_IMA_QT_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_ADPCM_IMA_QT_DECODER
BUF_AUDIO_QTIMAADPCM,
- #endif
- #ifdef CONFIG_ADPCM_IMA_WAV_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_ADPCM_IMA_WAV_DECODER
BUF_AUDIO_MSIMAADPCM,
- #endif
- #ifdef CONFIG_ADPCM_IMA_DK3_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_ADPCM_IMA_DK3_DECODER
BUF_AUDIO_DK3ADPCM,
- #endif
- #ifdef CONFIG_ADPCM_IMA_DK4_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_ADPCM_IMA_DK4_DECODER
BUF_AUDIO_DK4ADPCM,
- #endif
- #ifdef CONFIG_ADPCM_IMA_WS_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_ADPCM_IMA_WS_DECODER
BUF_AUDIO_VQA_IMA,
- #endif
- #ifdef CONFIG_ADPCM_IMA_SMJPEG_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_ADPCM_IMA_SMJPEG_DECODER
BUF_AUDIO_SMJPEG_IMA,
- #endif
- #ifdef CONFIG_ADPCM_XA_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_ADPCM_XA_DECODER
BUF_AUDIO_XA_ADPCM,
- #endif
- #ifdef CONFIG_ADPCM_4XM_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_ADPCM_4XM_DECODER
BUF_AUDIO_4X_ADPCM,
- #endif
- #ifdef CONFIG_ADPCM_EA_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_ADPCM_EA_DECODER
BUF_AUDIO_EA_ADPCM,
- #endif
- #ifdef CONFIG_PCM_MULAW_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_PCM_MULAW_DECODER
BUF_AUDIO_MULAW,
- #endif
- #ifdef CONFIG_PCM_ALAW_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_PCM_ALAW_DECODER
BUF_AUDIO_ALAW,
- #endif
- #ifdef CONFIG_ROQ_DPCM_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_ROQ_DPCM_DECODER
BUF_AUDIO_ROQ,
- #endif
- #ifdef CONFIG_INTERPLAY_DPCM_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_INTERPLAY_DPCM_DECODER
BUF_AUDIO_INTERPLAY,
- #endif
- #ifdef CONFIG_MACE3_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_MACE3_DECODER
BUF_AUDIO_MAC3,
- #endif
- #ifdef CONFIG_MACE6_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_MACE6_DECODER
BUF_AUDIO_MAC6,
- #endif
- #ifdef CONFIG_XAN_DPCM_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_XAN_DPCM_DECODER
BUF_AUDIO_XAN_DPCM,
- #endif
- #ifdef CONFIG_VMDAUDIO_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_VMDAUDIO_DECODER
BUF_AUDIO_VMD,
- #endif
- #ifdef CONFIG_FLAC_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_FLAC_DECODER
BUF_AUDIO_FLAC,
- #endif
- #ifdef CONFIG_SHORTEN_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_SHORTEN_DECODER
BUF_AUDIO_SHORTEN,
- #endif
- #ifdef CONFIG_ALAC_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_ALAC_DECODER
BUF_AUDIO_ALAC,
- #endif
- #ifdef CONFIG_QDM2_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_QDM2_DECODER
BUF_AUDIO_QDESIGN2,
- #endif
- #ifdef CONFIG_COOK_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_COOK_DECODER
BUF_AUDIO_COOK,
- #endif
- #ifdef CONFIG_TRUESPEECH_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_TRUESPEECH_DECODER
BUF_AUDIO_TRUESPEECH,
- #endif
- #ifdef CONFIG_TTA_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_TTA_DECODER
BUF_AUDIO_TTA,
- #endif
- #ifdef CONFIG_SMACKAUDIO_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_SMACKAUDIO_DECODER
BUF_AUDIO_SMACKER,
- #endif
- #ifdef CONFIG_ADPCM_SWF_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_ADPCM_SWF_DECODER
BUF_AUDIO_FLVADPCM,
- #endif
- #ifdef CONFIG_WAVPACK_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_WAVPACK_DECODER
BUF_AUDIO_WAVPACK,
- #endif
+#endif
0
};
diff --git a/src/libffmpeg/ff_dvaudio_decoder.c b/src/libffmpeg/ff_dvaudio_decoder.c
index 91a7abf2b..7a20953e7 100644
--- a/src/libffmpeg/ff_dvaudio_decoder.c
+++ b/src/libffmpeg/ff_dvaudio_decoder.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: dvaudio_decoder.c,v 1.12 2006/12/04 22:25:13 miguelfreitas Exp $
+ * $Id: dvaudio_decoder.c,v 1.11 2006/07/10 22:08:29 dgp85 Exp $
*
* dv audio decoder based on patch by Dan Dennedy <dan@dennedy.org>
*
@@ -55,13 +55,8 @@
# undef uint64_t
#endif
-#ifdef HAVE_FFMPEG
-# include <avcodec.h>
-# include "libavcodec/dvdata.h"
-#else
-# include "libavcodec/avcodec.h"
-# include "libavcodec/dvdata.h"
-#endif
+#include <avcodec.h>
+#include <dvdata.h> /* This is not installed by FFmpeg, its usage has to be cleared up */
#ifdef _MSC_VER
# undef malloc
@@ -96,7 +91,6 @@ typedef struct dvaudio_decoder_s {
} dvaudio_decoder_t;
-
/*
* This is the dumbest implementation of all -- it simply looks at
* a fixed offset and if pack isn't there -- fails. We might want
diff --git a/src/libffmpeg/ff_video_decoder.c b/src/libffmpeg/ff_video_decoder.c
index e81e963ab..69a0feec1 100644
--- a/src/libffmpeg/ff_video_decoder.c
+++ b/src/libffmpeg/ff_video_decoder.c
@@ -25,7 +25,9 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
-#include "ffmpeg_config.h"
+# ifndef HAVE_FFMPEG
+# include "ffmpeg_config.h"
+# endif
#endif
#include <stdlib.h>
@@ -48,11 +50,7 @@
#include "ffmpeg_decoder.h"
#include "ff_mpeg_parser.h"
-#ifdef HAVE_FFMPEG
-# include <postprocess.h>
-#else
-# include "libavcodec/libpostproc/postprocess.h"
-#endif
+#include <postprocess.h>
#define VIDEOBUFSIZE (128*1024)
#define SLICE_BUFFER_SIZE (1194*1024)
@@ -1581,223 +1579,223 @@ void *init_video_plugin (xine_t *xine, void *data) {
}
static uint32_t supported_video_types[] = {
- #ifdef CONFIG_MSMPEG4V1_DECODER
+#if defined(HAVE_FFMPEG) || CONFIG_MSMPEG4V1_DECODER
BUF_VIDEO_MSMPEG4_V1,
- #endif
- #ifdef CONFIG_MSMPEG4V2_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_MSMPEG4V2_DECODER
BUF_VIDEO_MSMPEG4_V2,
- #endif
- #ifdef CONFIG_MSMPEG4V3_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_MSMPEG4V3_DECODER
BUF_VIDEO_MSMPEG4_V3,
- #endif
- #ifdef CONFIG_WMV1_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_WMV1_DECODER
BUF_VIDEO_WMV7,
- #endif
- #ifdef CONFIG_WMV2_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_WMV2_DECODER
BUF_VIDEO_WMV8,
- #endif
- #ifdef CONFIG_WMV3_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_WMV3_DECODER
BUF_VIDEO_WMV9,
- #endif
- #ifdef CONFIG_MPEG4_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_MPEG4_DECODER
BUF_VIDEO_MPEG4,
- #endif
- #ifdef CONFIG_MPEG4_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_MPEG4_DECODER
BUF_VIDEO_XVID,
- #endif
- #ifdef CONFIG_MPEG4_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_MPEG4_DECODER
BUF_VIDEO_DIVX5,
- #endif
- #ifdef CONFIG_MPEG4_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_MPEG4_DECODER
BUF_VIDEO_3IVX,
- #endif
- #ifdef CONFIG_MJPEG_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_MJPEG_DECODER
BUF_VIDEO_JPEG,
- #endif
- #ifdef CONFIG_MJPEG_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_MJPEG_DECODER
BUF_VIDEO_MJPEG,
- #endif
- #ifdef CONFIG_MJPEGB_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_MJPEGB_DECODER
BUF_VIDEO_MJPEG_B,
- #endif
- #ifdef CONFIG_H263I_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_H263I_DECODER
BUF_VIDEO_I263,
- #endif
- #ifdef CONFIG_H263_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_H263_DECODER
BUF_VIDEO_H263,
- #endif
- #ifdef CONFIG_RV10_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_RV10_DECODER
BUF_VIDEO_RV10,
- #endif
- #ifdef CONFIG_RV20_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_RV20_DECODER
BUF_VIDEO_RV20,
- #endif
- #ifdef CONFIG_INDEO3_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_INDEO3_DECODER
BUF_VIDEO_IV31,
- #endif
- #ifdef CONFIG_INDEO3_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_INDEO3_DECODER
BUF_VIDEO_IV32,
- #endif
- #ifdef CONFIG_SVQ1_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_SVQ1_DECODER
BUF_VIDEO_SORENSON_V1,
- #endif
- #ifdef CONFIG_SVQ3_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_SVQ3_DECODER
BUF_VIDEO_SORENSON_V3,
- #endif
- #ifdef CONFIG_DVVIDEO_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_DVVIDEO_DECODER
BUF_VIDEO_DV,
- #endif
- #ifdef CONFIG_HUFFYUV_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_HUFFYUV_DECODER
BUF_VIDEO_HUFFYUV,
- #endif
- #ifdef CONFIG_VP3_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_VP3_DECODER
BUF_VIDEO_VP31,
- #endif
- #ifdef CONFIG_VP5_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_VP5_DECODER
BUF_VIDEO_VP5,
- #endif
- #ifdef CONFIG_VP6_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_VP6_DECODER
BUF_VIDEO_VP6,
BUF_VIDEO_VP6F,
- #endif
- #ifdef CONFIG_4XM_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_4XM_DECODER
BUF_VIDEO_4XM,
- #endif
- #ifdef CONFIG_CINEPAK_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_CINEPAK_DECODER
BUF_VIDEO_CINEPAK,
- #endif
- #ifdef CONFIG_MSVIDEO1_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_MSVIDEO1_DECODER
BUF_VIDEO_MSVC,
- #endif
- #ifdef CONFIG_MSRLE_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_MSRLE_DECODER
BUF_VIDEO_MSRLE,
- #endif
- #ifdef CONFIG_RPZA_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_RPZA_DECODER
BUF_VIDEO_RPZA,
- #endif
- #ifdef CONFIG_CYUV_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_CYUV_DECODER
BUF_VIDEO_CYUV,
- #endif
- #ifdef CONFIG_ROQ_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_ROQ_DECODER
BUF_VIDEO_ROQ,
- #endif
- #ifdef CONFIG_IDCIN_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_IDCIN_DECODER
BUF_VIDEO_IDCIN,
- #endif
- #ifdef CONFIG_XAN_WC3_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_XAN_WC3_DECODER
BUF_VIDEO_WC3,
- #endif
- #ifdef CONFIG_WS_VQA_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_WS_VQA_DECODER
BUF_VIDEO_VQA,
- #endif
- #ifdef CONFIG_INTERPLAY_VIDEO_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_INTERPLAY_VIDEO_DECODER
BUF_VIDEO_INTERPLAY,
- #endif
- #ifdef CONFIG_FLIC_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_FLIC_DECODER
BUF_VIDEO_FLI,
- #endif
- #ifdef CONFIG_8BPS_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_8BPS_DECODER
BUF_VIDEO_8BPS,
- #endif
- #ifdef CONFIG_SMC_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_SMC_DECODER
BUF_VIDEO_SMC,
- #endif
- #ifdef CONFIG_TRUEMOTION1_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_TRUEMOTION1_DECODER
BUF_VIDEO_DUCKTM1,
- #endif
- #ifdef CONFIG_TRUEMOTION2_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_TRUEMOTION2_DECODER
BUF_VIDEO_DUCKTM2,
- #endif
- #ifdef CONFIG_VMDVIDEO_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_VMDVIDEO_DECODER
BUF_VIDEO_VMD,
- #endif
- #ifdef CONFIG_ZLIB_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_ZLIB_DECODER
BUF_VIDEO_ZLIB,
- #endif
- #ifdef CONFIG_MSZH_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_MSZH_DECODER
BUF_VIDEO_MSZH,
- #endif
- #ifdef CONFIG_ASV1_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_ASV1_DECODER
BUF_VIDEO_ASV1,
- #endif
- #ifdef CONFIG_ASV2_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_ASV2_DECODER
BUF_VIDEO_ASV2,
- #endif
- #ifdef CONFIG_VCR1_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_VCR1_DECODER
BUF_VIDEO_ATIVCR1,
- #endif
- #ifdef CONFIG_FLV_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_FLV_DECODER
BUF_VIDEO_FLV1,
- #endif
- #ifdef CONFIG_QTRLE_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_QTRLE_DECODER
BUF_VIDEO_QTRLE,
- #endif
- #ifdef CONFIG_H264_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_H264_DECODER
BUF_VIDEO_H264,
- #endif
- #ifdef CONFIG_H261_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_H261_DECODER
BUF_VIDEO_H261,
- #endif
- #ifdef CONFIG_AASC_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_AASC_DECODER
BUF_VIDEO_AASC,
- #endif
- #ifdef CONFIG_LOCO_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_LOCO_DECODER
BUF_VIDEO_LOCO,
- #endif
- #ifdef CONFIG_QDRAW_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_QDRAW_DECODER
BUF_VIDEO_QDRW,
- #endif
- #ifdef CONFIG_QPEG_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_QPEG_DECODER
BUF_VIDEO_QPEG,
- #endif
- #ifdef CONFIG_TSCC_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_TSCC_DECODER
BUF_VIDEO_TSCC,
- #endif
- #ifdef CONFIG_ULTI_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_ULTI_DECODER
BUF_VIDEO_ULTI,
- #endif
- #ifdef CONFIG_WNV1_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_WNV1_DECODER
BUF_VIDEO_WNV1,
- #endif
- #ifdef CONFIG_VIXL_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_VIXL_DECODER
BUF_VIDEO_XL,
- #endif
- #ifdef CONFIG_INDEO2_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_INDEO2_DECODER
BUF_VIDEO_RT21,
- #endif
- #ifdef CONFIG_FRAPS_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_FRAPS_DECODER
BUF_VIDEO_FPS1,
- #endif
- #ifdef CONFIG_MPEG1VIDEO_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_MPEG1VIDEO_DECODER
BUF_VIDEO_MPEG,
- #endif
- #ifdef CONFIG_CSCD_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_CSCD_DECODER
BUF_VIDEO_CSCD,
- #endif
- #ifdef CONFIG_AVS_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_AVS_DECODER
BUF_VIDEO_AVS,
- #endif
- #ifdef CONFIG_MMVIDEO_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_MMVIDEO_DECODER
BUF_VIDEO_ALGMM,
- #endif
- #ifdef CONFIG_ZMBV_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_ZMBV_DECODER
BUF_VIDEO_ZMBV,
- #endif
- #ifdef CONFIG_SMACKVIDEO_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_SMACKVIDEO_DECODER
BUF_VIDEO_SMACKER,
- #endif
- #ifdef CONFIG_NUV_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_NUV_DECODER
BUF_VIDEO_NUV,
- #endif
- #ifdef CONFIG_KMVC_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_KMVC_DECODER
BUF_VIDEO_KMVC,
- #endif
- #ifdef CONFIG_FLASHSV_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_FLASHSV_DECODER
BUF_VIDEO_FLASHSV,
- #endif
- #ifdef CONFIG_CAVS_DECODER
+#endif
+#if defined(HAVE_FFMPEG) || CONFIG_CAVS_DECODER
BUF_VIDEO_CAVS,
- #endif
+#endif
BUF_VIDEO_THEORA_RAW,
0
};
diff --git a/src/libffmpeg/ffmpeg_decoder.c b/src/libffmpeg/ffmpeg_decoder.c
index 6f85cc1fa..9f1db0c6d 100644
--- a/src/libffmpeg/ffmpeg_decoder.c
+++ b/src/libffmpeg/ffmpeg_decoder.c
@@ -25,7 +25,6 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
-#include "ffmpeg_config.h"
#endif
#include "xine_internal.h"
@@ -39,276 +38,6 @@
pthread_once_t once_control = PTHREAD_ONCE_INIT;
pthread_mutex_t ffmpeg_lock;
-#ifndef HAVE_FFMPEG
-
-#define REGISTER_ENCODER(X,x) \
- if(ENABLE_##X##_ENCODER) register_avcodec(&x##_encoder)
-#define REGISTER_DECODER(X,x) \
- if(ENABLE_##X##_DECODER) register_avcodec(&x##_decoder)
-#define REGISTER_ENCDEC(X,x) REGISTER_ENCODER(X,x); REGISTER_DECODER(X,x)
-
-#define REGISTER_PARSER(X,x) \
- if(ENABLE_##X##_PARSER) av_register_codec_parser(&x##_parser)
-
-/* If you do not call this function, then you can select exactly which
- formats you want to support */
-
-/**
- * simple call to register all the codecs.
- */
-void avcodec_register_all(void)
-{
- static int inited = 0;
-
- if (inited != 0)
- return;
- inited = 1;
-
- /* video codecs */
- REGISTER_DECODER(AASC, aasc);
- REGISTER_ENCDEC (ASV1, asv1);
- REGISTER_ENCDEC (ASV2, asv2);
- REGISTER_DECODER(AVS, avs);
- REGISTER_DECODER(BMP, bmp);
- REGISTER_DECODER(CAVS, cavs);
- REGISTER_DECODER(CINEPAK, cinepak);
- REGISTER_DECODER(CLJR, cljr);
- REGISTER_DECODER(CSCD, cscd);
- REGISTER_DECODER(CYUV, cyuv);
- REGISTER_DECODER(DSICINVIDEO, dsicinvideo);
- REGISTER_ENCDEC (DVVIDEO, dvvideo);
- REGISTER_DECODER(EIGHTBPS, eightbps);
- REGISTER_ENCDEC (FFV1, ffv1);
- REGISTER_ENCDEC (FFVHUFF, ffvhuff);
- REGISTER_DECODER(FLASHSV, flashsv);
- REGISTER_DECODER(FLIC, flic);
- REGISTER_ENCDEC (FLV, flv);
- REGISTER_DECODER(FOURXM, fourxm);
- REGISTER_DECODER(FRAPS, fraps);
- REGISTER_ENCDEC (GIF, gif);
- REGISTER_ENCDEC (H261, h261);
- REGISTER_ENCDEC (H263, h263);
- REGISTER_DECODER(H263I, h263i);
- REGISTER_ENCODER(H263P, h263p);
- REGISTER_DECODER(H264, h264);
- REGISTER_ENCDEC (HUFFYUV, huffyuv);
- REGISTER_DECODER(IDCIN, idcin);
- REGISTER_DECODER(INDEO2, indeo2);
- REGISTER_DECODER(INDEO3, indeo3);
- REGISTER_DECODER(INTERPLAY_VIDEO, interplay_video);
- REGISTER_ENCODER(JPEGLS, jpegls);
- REGISTER_DECODER(KMVC, kmvc);
- REGISTER_ENCODER(LJPEG, ljpeg);
- REGISTER_DECODER(LOCO, loco);
- REGISTER_DECODER(MDEC, mdec);
- REGISTER_ENCDEC (MJPEG, mjpeg);
- REGISTER_DECODER(MJPEGB, mjpegb);
- REGISTER_DECODER(MMVIDEO, mmvideo);
-#ifdef HAVE_XVMC
- REGISTER_DECODER(MPEG_XVMC, mpeg_xvmc);
-#endif
- REGISTER_ENCDEC (MPEG1VIDEO, mpeg1video);
- REGISTER_ENCDEC (MPEG2VIDEO, mpeg2video);
- REGISTER_ENCDEC (MPEG4, mpeg4);
- REGISTER_DECODER(MPEGVIDEO, mpegvideo);
- REGISTER_ENCDEC (MSMPEG4V1, msmpeg4v1);
- REGISTER_ENCDEC (MSMPEG4V2, msmpeg4v2);
- REGISTER_ENCDEC (MSMPEG4V3, msmpeg4v3);
- REGISTER_DECODER(MSRLE, msrle);
- REGISTER_DECODER(MSVIDEO1, msvideo1);
- REGISTER_DECODER(MSZH, mszh);
- REGISTER_DECODER(NUV, nuv);
- REGISTER_ENCODER(PAM, pam);
- REGISTER_ENCODER(PBM, pbm);
- REGISTER_ENCODER(PGM, pgm);
- REGISTER_ENCODER(PGMYUV, pgmyuv);
-#ifdef CONFIG_ZLIB
- REGISTER_ENCDEC (PNG, png);
-#endif
- REGISTER_ENCODER(PPM, ppm);
- REGISTER_DECODER(QDRAW, qdraw);
- REGISTER_DECODER(QPEG, qpeg);
- REGISTER_DECODER(QTRLE, qtrle);
- REGISTER_ENCDEC (RAWVIDEO, rawvideo);
- REGISTER_DECODER(ROQ, roq);
- REGISTER_DECODER(RPZA, rpza);
- REGISTER_ENCDEC (RV10, rv10);
- REGISTER_ENCDEC (RV20, rv20);
- REGISTER_DECODER(SMACKER, smacker);
- REGISTER_DECODER(SMC, smc);
- REGISTER_ENCDEC (SNOW, snow);
- REGISTER_DECODER(SP5X, sp5x);
- REGISTER_ENCDEC (SVQ1, svq1);
- REGISTER_DECODER(SVQ3, svq3);
- REGISTER_DECODER(TARGA, targa);
- REGISTER_DECODER(THEORA, theora);
- REGISTER_DECODER(TIERTEXSEQVIDEO, tiertexseqvideo);
- REGISTER_DECODER(TIFF, tiff);
- REGISTER_DECODER(TRUEMOTION1, truemotion1);
- REGISTER_DECODER(TRUEMOTION2, truemotion2);
- REGISTER_DECODER(TSCC, tscc);
- REGISTER_DECODER(ULTI, ulti);
- REGISTER_DECODER(VC1, vc1);
- REGISTER_DECODER(VCR1, vcr1);
- REGISTER_DECODER(VMDVIDEO, vmdvideo);
- REGISTER_DECODER(VMNC, vmnc);
- REGISTER_DECODER(VP3, vp3);
- REGISTER_DECODER(VP5, vp5);
- REGISTER_DECODER(VP6, vp6);
- REGISTER_DECODER(VP6F, vp6f);
- REGISTER_DECODER(VQA, vqa);
- REGISTER_ENCDEC (WMV1, wmv1);
- REGISTER_ENCDEC (WMV2, wmv2);
- REGISTER_DECODER(WMV3, wmv3);
- REGISTER_DECODER(WNV1, wnv1);
-#ifdef CONFIG_X264
- REGISTER_ENCODER(X264, x264);
-#endif
- REGISTER_DECODER(XAN_WC3, xan_wc3);
- REGISTER_DECODER(XL, xl);
-#ifdef CONFIG_XVID
- REGISTER_ENCODER(XVID, xvid);
-#endif
- REGISTER_ENCDEC (ZLIB, zlib);
-#ifdef CONFIG_ZLIB
- REGISTER_ENCDEC (ZMBV, zmbv);
-#endif
-
- /* audio codecs */
-#ifdef CONFIG_LIBFAAD
- REGISTER_DECODER(AAC, aac);
- REGISTER_DECODER(MPEG4AAC, mpeg4aac);
-#endif
-#ifdef CONFIG_LIBA52
- REGISTER_DECODER(AC3, ac3);
-#endif
- REGISTER_ENCODER(AC3, ac3);
- REGISTER_DECODER(ALAC, alac);
-#if defined(CONFIG_AMR_NB) || defined(CONFIG_AMR_NB_FIXED)
- REGISTER_ENCDEC (AMR_NB, amr_nb);
-#endif
-#ifdef CONFIG_AMR_WB
- REGISTER_ENCDEC (AMR_WB, amr_wb);
-#endif
- REGISTER_DECODER(COOK, cook);
- REGISTER_DECODER(DSICINAUDIO, dsicinaudio);
-#ifdef CONFIG_LIBDTS
- REGISTER_DECODER(DTS, dts);
-#endif
-#ifdef CONFIG_LIBFAAC
- REGISTER_ENCODER(FAAC, faac);
-#endif
- REGISTER_ENCDEC (FLAC, flac);
- REGISTER_DECODER(IMC, imc);
-#ifdef CONFIG_LIBGSM
- REGISTER_ENCDEC (LIBGSM, libgsm);
-#endif
- REGISTER_DECODER(MACE3, mace3);
- REGISTER_DECODER(MACE6, mace6);
- REGISTER_ENCDEC (MP2, mp2);
- REGISTER_DECODER(MP3, mp3);
- REGISTER_DECODER(MP3ADU, mp3adu);
-#ifdef CONFIG_LIBMP3LAME
- REGISTER_ENCODER(MP3LAME, mp3lame);
-#endif
- REGISTER_DECODER(MP3ON4, mp3on4);
- REGISTER_DECODER(MPC7, mpc7);
-#ifdef CONFIG_LIBVORBIS
- if (!ENABLE_VORBIS_ENCODER) REGISTER_ENCODER(OGGVORBIS, oggvorbis);
- if (!ENABLE_VORBIS_DECODER) REGISTER_DECODER(OGGVORBIS, oggvorbis);
-#endif
- REGISTER_DECODER(QDM2, qdm2);
- REGISTER_DECODER(RA_144, ra_144);
- REGISTER_DECODER(RA_288, ra_288);
- REGISTER_DECODER(SHORTEN, shorten);
- REGISTER_DECODER(SMACKAUD, smackaud);
- REGISTER_ENCDEC (SONIC, sonic);
- REGISTER_ENCODER(SONIC_LS, sonic_ls);
- REGISTER_DECODER(TRUESPEECH, truespeech);
- REGISTER_DECODER(TTA, tta);
- REGISTER_DECODER(VMDAUDIO, vmdaudio);
- REGISTER_ENCDEC (VORBIS, vorbis);
- REGISTER_DECODER(WAVPACK, wavpack);
- REGISTER_DECODER(WMAV1, wmav1);
- REGISTER_DECODER(WMAV2, wmav2);
- REGISTER_DECODER(WS_SND1, ws_snd1);
-
- /* pcm codecs */
- REGISTER_ENCDEC (PCM_ALAW, pcm_alaw);
- REGISTER_ENCDEC (PCM_MULAW, pcm_mulaw);
- REGISTER_ENCDEC (PCM_S8, pcm_s8);
- REGISTER_ENCDEC (PCM_S16BE, pcm_s16be);
- REGISTER_ENCDEC (PCM_S16LE, pcm_s16le);
- REGISTER_ENCDEC (PCM_S24BE, pcm_s24be);
- REGISTER_ENCDEC (PCM_S24DAUD, pcm_s24daud);
- REGISTER_ENCDEC (PCM_S24LE, pcm_s24le);
- REGISTER_ENCDEC (PCM_S32BE, pcm_s32be);
- REGISTER_ENCDEC (PCM_S32LE, pcm_s32le);
- REGISTER_ENCDEC (PCM_U8, pcm_u8);
- REGISTER_ENCDEC (PCM_U16BE, pcm_u16be);
- REGISTER_ENCDEC (PCM_U16LE, pcm_u16le);
- REGISTER_ENCDEC (PCM_U24BE, pcm_u24be);
- REGISTER_ENCDEC (PCM_U24LE, pcm_u24le);
- REGISTER_ENCDEC (PCM_U32BE, pcm_u32be);
- REGISTER_ENCDEC (PCM_U32LE, pcm_u32le);
-
- /* dpcm codecs */
- REGISTER_DECODER(INTERPLAY_DPCM, interplay_dpcm);
- REGISTER_DECODER(ROQ_DPCM, roq_dpcm);
- REGISTER_DECODER(SOL_DPCM, sol_dpcm);
- REGISTER_DECODER(XAN_DPCM, xan_dpcm);
-
- /* adpcm codecs */
- REGISTER_ENCDEC (ADPCM_4XM, adpcm_4xm);
- REGISTER_ENCDEC (ADPCM_ADX, adpcm_adx);
- REGISTER_ENCDEC (ADPCM_CT, adpcm_ct);
- REGISTER_ENCDEC (ADPCM_EA, adpcm_ea);
- REGISTER_ENCDEC (ADPCM_G726, adpcm_g726);
- REGISTER_ENCDEC (ADPCM_IMA_DK3, adpcm_ima_dk3);
- REGISTER_ENCDEC (ADPCM_IMA_DK4, adpcm_ima_dk4);
- REGISTER_ENCDEC (ADPCM_IMA_QT, adpcm_ima_qt);
- REGISTER_ENCDEC (ADPCM_IMA_SMJPEG, adpcm_ima_smjpeg);
- REGISTER_ENCDEC (ADPCM_IMA_WAV, adpcm_ima_wav);
- REGISTER_ENCDEC (ADPCM_IMA_WS, adpcm_ima_ws);
- REGISTER_ENCDEC (ADPCM_MS, adpcm_ms);
- REGISTER_ENCDEC (ADPCM_SBPRO_2, adpcm_sbpro_2);
- REGISTER_ENCDEC (ADPCM_SBPRO_3, adpcm_sbpro_3);
- REGISTER_ENCDEC (ADPCM_SBPRO_4, adpcm_sbpro_4);
- REGISTER_ENCDEC (ADPCM_SWF, adpcm_swf);
- REGISTER_ENCDEC (ADPCM_XA, adpcm_xa);
- REGISTER_ENCDEC (ADPCM_YAMAHA, adpcm_yamaha);
-
- /* subtitles */
- REGISTER_ENCDEC (DVBSUB, dvbsub);
- REGISTER_ENCDEC (DVDSUB, dvdsub);
-
- /* parsers */
- REGISTER_PARSER (AAC, aac);
- REGISTER_PARSER (AC3, ac3);
- REGISTER_PARSER (CAVSVIDEO, cavsvideo);
- REGISTER_PARSER (DVBSUB, dvbsub);
- REGISTER_PARSER (DVDSUB, dvdsub);
- REGISTER_PARSER (H261, h261);
- REGISTER_PARSER (H263, h263);
- REGISTER_PARSER (H264, h264);
- REGISTER_PARSER (MJPEG, mjpeg);
- REGISTER_PARSER (MPEG4VIDEO, mpeg4video);
- REGISTER_PARSER (MPEGAUDIO, mpegaudio);
- REGISTER_PARSER (MPEGVIDEO, mpegvideo);
- REGISTER_PARSER (PNM, pnm);
-
- /*
- av_register_bitstream_filter(&dump_extradata_bsf);
- av_register_bitstream_filter(&remove_extradata_bsf);
- av_register_bitstream_filter(&noise_bsf);
- av_register_bitstream_filter(&mp3_header_compress_bsf);
- av_register_bitstream_filter(&mp3_header_decompress_bsf);
- av_register_bitstream_filter(&mjpega_dump_header_bsf);
- */
-}
-
-#endif
-
void init_once_routine(void) {
pthread_mutex_init(&ffmpeg_lock, NULL);
avcodec_init();
diff --git a/src/libffmpeg/ffmpeg_decoder.h b/src/libffmpeg/ffmpeg_decoder.h
index 879ee3175..f005f09e5 100644
--- a/src/libffmpeg/ffmpeg_decoder.h
+++ b/src/libffmpeg/ffmpeg_decoder.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine_decoder.h,v 1.7 2006/08/02 07:15:27 tmmm Exp $
+ * $Id: xine_decoder.h,v 1.7.2.1 2006/12/02 01:20:07 dgp85 Exp $
*
*/
@@ -28,11 +28,7 @@
#include "config.h"
#endif
-#ifdef HAVE_FFMPEG
-# include <avcodec.h>
-#else
-# include "libavcodec/avcodec.h"
-#endif
+#include <avcodec.h>
typedef struct ff_codec_s {
uint32_t type;
diff --git a/src/libffmpeg/ffmpeg_encoder.c b/src/libffmpeg/ffmpeg_encoder.c
index e234b4ddc..8db721002 100644
--- a/src/libffmpeg/ffmpeg_encoder.c
+++ b/src/libffmpeg/ffmpeg_encoder.c
@@ -40,11 +40,7 @@
#include "video_out_dxr3.h"
-#ifdef HAVE_FFMPEG
-# include <avcodec.h>
-#else
-# include "libavcodec/avcodec.h"
-#endif
+#include <avcodec.h>
/* buffer size for encoded mpeg1 stream; will hold one intra frame
* at 640x480 typical sizes are <50 kB. 512 kB should be plenty */
diff --git a/src/libffmpeg/libavcodec/4xm.c b/src/libffmpeg/libavcodec/4xm.c
deleted file mode 100644
index ea60e9bf2..000000000
--- a/src/libffmpeg/libavcodec/4xm.c
+++ /dev/null
@@ -1,759 +0,0 @@
-/*
- * 4XM codec
- * Copyright (c) 2003 Michael Niedermayer
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file 4xm.c
- * 4XM codec.
- */
-
-#include "avcodec.h"
-#include "dsputil.h"
-#include "mpegvideo.h"
-
-//#undef NDEBUG
-//#include <assert.h>
-
-#define BLOCK_TYPE_VLC_BITS 5
-#define ACDC_VLC_BITS 9
-
-#define CFRAME_BUFFER_COUNT 100
-
-static const uint8_t block_type_tab[4][8][2]={
- { //{8,4,2}x{8,4,2}
- { 0,1}, { 2,2}, { 6,3}, {14,4}, {30,5}, {31,5}, { 0,0}
- },{ //{8,4}x1
- { 0,1}, { 0,0}, { 2,2}, { 6,3}, {14,4}, {15,4}, { 0,0}
- },{ //1x{8,4}
- { 0,1}, { 2,2}, { 0,0}, { 6,3}, {14,4}, {15,4}, { 0,0}
- },{ //1x2, 2x1
- { 0,1}, { 0,0}, { 0,0}, { 2,2}, { 6,3}, {14,4}, {15,4}
- }
-};
-
-static const uint8_t size2index[4][4]={
- {-1, 3, 1, 1},
- { 3, 0, 0, 0},
- { 2, 0, 0, 0},
- { 2, 0, 0, 0},
-};
-
-static const int8_t mv[256][2]={
-{ 0, 0},{ 0, -1},{ -1, 0},{ 1, 0},{ 0, 1},{ -1, -1},{ 1, -1},{ -1, 1},
-{ 1, 1},{ 0, -2},{ -2, 0},{ 2, 0},{ 0, 2},{ -1, -2},{ 1, -2},{ -2, -1},
-{ 2, -1},{ -2, 1},{ 2, 1},{ -1, 2},{ 1, 2},{ -2, -2},{ 2, -2},{ -2, 2},
-{ 2, 2},{ 0, -3},{ -3, 0},{ 3, 0},{ 0, 3},{ -1, -3},{ 1, -3},{ -3, -1},
-{ 3, -1},{ -3, 1},{ 3, 1},{ -1, 3},{ 1, 3},{ -2, -3},{ 2, -3},{ -3, -2},
-{ 3, -2},{ -3, 2},{ 3, 2},{ -2, 3},{ 2, 3},{ 0, -4},{ -4, 0},{ 4, 0},
-{ 0, 4},{ -1, -4},{ 1, -4},{ -4, -1},{ 4, -1},{ 4, 1},{ -1, 4},{ 1, 4},
-{ -3, -3},{ -3, 3},{ 3, 3},{ -2, -4},{ -4, -2},{ 4, -2},{ -4, 2},{ -2, 4},
-{ 2, 4},{ -3, -4},{ 3, -4},{ 4, -3},{ -5, 0},{ -4, 3},{ -3, 4},{ 3, 4},
-{ -1, -5},{ -5, -1},{ -5, 1},{ -1, 5},{ -2, -5},{ 2, -5},{ 5, -2},{ 5, 2},
-{ -4, -4},{ -4, 4},{ -3, -5},{ -5, -3},{ -5, 3},{ 3, 5},{ -6, 0},{ 0, 6},
-{ -6, -1},{ -6, 1},{ 1, 6},{ 2, -6},{ -6, 2},{ 2, 6},{ -5, -4},{ 5, 4},
-{ 4, 5},{ -6, -3},{ 6, 3},{ -7, 0},{ -1, -7},{ 5, -5},{ -7, 1},{ -1, 7},
-{ 4, -6},{ 6, 4},{ -2, -7},{ -7, 2},{ -3, -7},{ 7, -3},{ 3, 7},{ 6, -5},
-{ 0, -8},{ -1, -8},{ -7, -4},{ -8, 1},{ 4, 7},{ 2, -8},{ -2, 8},{ 6, 6},
-{ -8, 3},{ 5, -7},{ -5, 7},{ 8, -4},{ 0, -9},{ -9, -1},{ 1, 9},{ 7, -6},
-{ -7, 6},{ -5, -8},{ -5, 8},{ -9, 3},{ 9, -4},{ 7, -7},{ 8, -6},{ 6, 8},
-{ 10, 1},{-10, 2},{ 9, -5},{ 10, -3},{ -8, -7},{-10, -4},{ 6, -9},{-11, 0},
-{ 11, 1},{-11, -2},{ -2, 11},{ 7, -9},{ -7, 9},{ 10, 6},{ -4, 11},{ 8, -9},
-{ 8, 9},{ 5, 11},{ 7,-10},{ 12, -3},{ 11, 6},{ -9, -9},{ 8, 10},{ 5, 12},
-{-11, 7},{ 13, 2},{ 6,-12},{ 10, 9},{-11, 8},{ -7, 12},{ 0, 14},{ 14, -2},
-{ -9, 11},{ -6, 13},{-14, -4},{ -5,-14},{ 5, 14},{-15, -1},{-14, -6},{ 3,-15},
-{ 11,-11},{ -7, 14},{ -5, 15},{ 8,-14},{ 15, 6},{ 3, 16},{ 7,-15},{-16, 5},
-{ 0, 17},{-16, -6},{-10, 14},{-16, 7},{ 12, 13},{-16, 8},{-17, 6},{-18, 3},
-{ -7, 17},{ 15, 11},{ 16, 10},{ 2,-19},{ 3,-19},{-11,-16},{-18, 8},{-19, -6},
-{ 2,-20},{-17,-11},{-10,-18},{ 8, 19},{-21, -1},{-20, 7},{ -4, 21},{ 21, 5},
-{ 15, 16},{ 2,-22},{-10,-20},{-22, 5},{ 20,-11},{ -7,-22},{-12, 20},{ 23, -5},
-{ 13,-20},{ 24, -2},{-15, 19},{-11, 22},{ 16, 19},{ 23,-10},{-18,-18},{ -9,-24},
-{ 24,-10},{ -3, 26},{-23, 13},{-18,-20},{ 17, 21},{ -4, 27},{ 27, 6},{ 1,-28},
-{-11, 26},{-17,-23},{ 7, 28},{ 11,-27},{ 29, 5},{-23,-19},{-28,-11},{-21, 22},
-{-30, 7},{-17, 26},{-27, 16},{ 13, 29},{ 19,-26},{ 10,-31},{-14,-30},{ 20,-27},
-{-29, 18},{-16,-31},{-28,-22},{ 21,-30},{-25, 28},{ 26,-29},{ 25,-32},{-32,-32}
-};
-
-// this is simply the scaled down elementwise product of the standard jpeg quantizer table and the AAN premul table
-static const uint8_t dequant_table[64]={
- 16, 15, 13, 19, 24, 31, 28, 17,
- 17, 23, 25, 31, 36, 63, 45, 21,
- 18, 24, 27, 37, 52, 59, 49, 20,
- 16, 28, 34, 40, 60, 80, 51, 20,
- 18, 31, 48, 66, 68, 86, 56, 21,
- 19, 38, 56, 59, 64, 64, 48, 20,
- 27, 48, 55, 55, 56, 51, 35, 15,
- 20, 35, 34, 32, 31, 22, 15, 8,
-};
-
-static VLC block_type_vlc[4];
-
-
-typedef struct CFrameBuffer{
- unsigned int allocated_size;
- unsigned int size;
- int id;
- uint8_t *data;
-}CFrameBuffer;
-
-typedef struct FourXContext{
- AVCodecContext *avctx;
- DSPContext dsp;
- AVFrame current_picture, last_picture;
- GetBitContext pre_gb; ///< ac/dc prefix
- GetBitContext gb;
- uint8_t *bytestream;
- uint16_t *wordstream;
- int mv[256];
- VLC pre_vlc;
- int last_dc;
- DECLARE_ALIGNED_8(DCTELEM, block[6][64]);
- uint8_t *bitstream_buffer;
- unsigned int bitstream_buffer_size;
- CFrameBuffer cfrm[CFRAME_BUFFER_COUNT];
-} FourXContext;
-
-
-#define FIX_1_082392200 70936
-#define FIX_1_414213562 92682
-#define FIX_1_847759065 121095
-#define FIX_2_613125930 171254
-
-#define MULTIPLY(var,const) (((var)*(const)) >> 16)
-
-static void idct(DCTELEM block[64]){
- int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
- int tmp10, tmp11, tmp12, tmp13;
- int z5, z10, z11, z12, z13;
- int i;
- int temp[64];
-
- for(i=0; i<8; i++){
- tmp10 = block[8*0 + i] + block[8*4 + i];
- tmp11 = block[8*0 + i] - block[8*4 + i];
-
- tmp13 = block[8*2 + i] + block[8*6 + i];
- tmp12 = MULTIPLY(block[8*2 + i] - block[8*6 + i], FIX_1_414213562) - tmp13;
-
- tmp0 = tmp10 + tmp13;
- tmp3 = tmp10 - tmp13;
- tmp1 = tmp11 + tmp12;
- tmp2 = tmp11 - tmp12;
-
- z13 = block[8*5 + i] + block[8*3 + i];
- z10 = block[8*5 + i] - block[8*3 + i];
- z11 = block[8*1 + i] + block[8*7 + i];
- z12 = block[8*1 + i] - block[8*7 + i];
-
- tmp7 = z11 + z13;
- tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562);
-
- z5 = MULTIPLY(z10 + z12, FIX_1_847759065);
- tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5;
- tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5;
-
- tmp6 = tmp12 - tmp7;
- tmp5 = tmp11 - tmp6;
- tmp4 = tmp10 + tmp5;
-
- temp[8*0 + i] = tmp0 + tmp7;
- temp[8*7 + i] = tmp0 - tmp7;
- temp[8*1 + i] = tmp1 + tmp6;
- temp[8*6 + i] = tmp1 - tmp6;
- temp[8*2 + i] = tmp2 + tmp5;
- temp[8*5 + i] = tmp2 - tmp5;
- temp[8*4 + i] = tmp3 + tmp4;
- temp[8*3 + i] = tmp3 - tmp4;
- }
-
- for(i=0; i<8*8; i+=8){
- tmp10 = temp[0 + i] + temp[4 + i];
- tmp11 = temp[0 + i] - temp[4 + i];
-
- tmp13 = temp[2 + i] + temp[6 + i];
- tmp12 = MULTIPLY(temp[2 + i] - temp[6 + i], FIX_1_414213562) - tmp13;
-
- tmp0 = tmp10 + tmp13;
- tmp3 = tmp10 - tmp13;
- tmp1 = tmp11 + tmp12;
- tmp2 = tmp11 - tmp12;
-
- z13 = temp[5 + i] + temp[3 + i];
- z10 = temp[5 + i] - temp[3 + i];
- z11 = temp[1 + i] + temp[7 + i];
- z12 = temp[1 + i] - temp[7 + i];
-
- tmp7 = z11 + z13;
- tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562);
-
- z5 = MULTIPLY(z10 + z12, FIX_1_847759065);
- tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5;
- tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5;
-
- tmp6 = tmp12 - tmp7;
- tmp5 = tmp11 - tmp6;
- tmp4 = tmp10 + tmp5;
-
- block[0 + i] = (tmp0 + tmp7)>>6;
- block[7 + i] = (tmp0 - tmp7)>>6;
- block[1 + i] = (tmp1 + tmp6)>>6;
- block[6 + i] = (tmp1 - tmp6)>>6;
- block[2 + i] = (tmp2 + tmp5)>>6;
- block[5 + i] = (tmp2 - tmp5)>>6;
- block[4 + i] = (tmp3 + tmp4)>>6;
- block[3 + i] = (tmp3 - tmp4)>>6;
- }
-}
-
-static void init_vlcs(FourXContext *f){
- int i;
-
- for(i=0; i<4; i++){
- init_vlc(&block_type_vlc[i], BLOCK_TYPE_VLC_BITS, 7,
- &block_type_tab[i][0][1], 2, 1,
- &block_type_tab[i][0][0], 2, 1, 1);
- }
-}
-
-static void init_mv(FourXContext *f){
- int i;
-
- for(i=0; i<256; i++){
- f->mv[i] = mv[i][0] + mv[i][1]*f->current_picture.linesize[0]/2;
- }
-}
-
-static inline void mcdc(uint16_t *dst, uint16_t *src, int log2w, int h, int stride, int scale, int dc){
- int i;
- dc*= 0x10001;
-
- switch(log2w){
- case 0:
- for(i=0; i<h; i++){
- dst[0] = scale*src[0] + dc;
- if(scale) src += stride;
- dst += stride;
- }
- break;
- case 1:
- for(i=0; i<h; i++){
- ((uint32_t*)dst)[0] = scale*((uint32_t*)src)[0] + dc;
- if(scale) src += stride;
- dst += stride;
- }
- break;
- case 2:
- for(i=0; i<h; i++){
- ((uint32_t*)dst)[0] = scale*((uint32_t*)src)[0] + dc;
- ((uint32_t*)dst)[1] = scale*((uint32_t*)src)[1] + dc;
- if(scale) src += stride;
- dst += stride;
- }
- break;
- case 3:
- for(i=0; i<h; i++){
- ((uint32_t*)dst)[0] = scale*((uint32_t*)src)[0] + dc;
- ((uint32_t*)dst)[1] = scale*((uint32_t*)src)[1] + dc;
- ((uint32_t*)dst)[2] = scale*((uint32_t*)src)[2] + dc;
- ((uint32_t*)dst)[3] = scale*((uint32_t*)src)[3] + dc;
- if(scale) src += stride;
- dst += stride;
- }
- break;
- default: assert(0);
- }
-}
-
-static void decode_p_block(FourXContext *f, uint16_t *dst, uint16_t *src, int log2w, int log2h, int stride){
- const int index= size2index[log2h][log2w];
- const int h= 1<<log2h;
- int code= get_vlc2(&f->gb, block_type_vlc[index].table, BLOCK_TYPE_VLC_BITS, 1);
-
- assert(code>=0 && code<=6);
-
- if(code == 0){
- src += f->mv[ *f->bytestream++ ];
- mcdc(dst, src, log2w, h, stride, 1, 0);
- }else if(code == 1){
- log2h--;
- decode_p_block(f, dst , src , log2w, log2h, stride);
- decode_p_block(f, dst + (stride<<log2h), src + (stride<<log2h), log2w, log2h, stride);
- }else if(code == 2){
- log2w--;
- decode_p_block(f, dst , src , log2w, log2h, stride);
- decode_p_block(f, dst + (1<<log2w), src + (1<<log2w), log2w, log2h, stride);
- }else if(code == 4){
- src += f->mv[ *f->bytestream++ ];
- mcdc(dst, src, log2w, h, stride, 1, le2me_16(*f->wordstream++));
- }else if(code == 5){
- mcdc(dst, src, log2w, h, stride, 0, le2me_16(*f->wordstream++));
- }else if(code == 6){
- if(log2w){
- dst[0] = le2me_16(*f->wordstream++);
- dst[1] = le2me_16(*f->wordstream++);
- }else{
- dst[0 ] = le2me_16(*f->wordstream++);
- dst[stride] = le2me_16(*f->wordstream++);
- }
- }
-}
-
-static int get32(void *p){
- return le2me_32(*(uint32_t*)p);
-}
-
-static int decode_p_frame(FourXContext *f, uint8_t *buf, int length){
- int x, y;
- const int width= f->avctx->width;
- const int height= f->avctx->height;
- uint16_t *src= (uint16_t*)f->last_picture.data[0];
- uint16_t *dst= (uint16_t*)f->current_picture.data[0];
- const int stride= f->current_picture.linesize[0]>>1;
- const unsigned int bitstream_size= get32(buf+8);
- const unsigned int bytestream_size= get32(buf+16);
- const unsigned int wordstream_size= get32(buf+12);
-
- if(bitstream_size+ bytestream_size+ wordstream_size + 20 != length
- || bitstream_size > (1<<26)
- || bytestream_size > (1<<26)
- || wordstream_size > (1<<26)
- ){
- av_log(f->avctx, AV_LOG_ERROR, "lengths %d %d %d %d\n", bitstream_size, bytestream_size, wordstream_size,
- bitstream_size+ bytestream_size+ wordstream_size - length);
- return -1;
- }
-
- f->bitstream_buffer= av_fast_realloc(f->bitstream_buffer, &f->bitstream_buffer_size, bitstream_size + FF_INPUT_BUFFER_PADDING_SIZE);
- f->dsp.bswap_buf((uint32_t*)f->bitstream_buffer, (uint32_t*)(buf + 20), bitstream_size/4);
- init_get_bits(&f->gb, f->bitstream_buffer, 8*bitstream_size);
-
- f->wordstream= (uint16_t*)(buf + 20 + bitstream_size);
- f->bytestream= buf + 20 + bitstream_size + wordstream_size;
-
- init_mv(f);
-
- for(y=0; y<height; y+=8){
- for(x=0; x<width; x+=8){
- decode_p_block(f, dst + x, src + x, 3, 3, stride);
- }
- src += 8*stride;
- dst += 8*stride;
- }
-
- if(bitstream_size != (get_bits_count(&f->gb)+31)/32*4)
- av_log(f->avctx, AV_LOG_ERROR, " %d %td %td bytes left\n",
- bitstream_size - (get_bits_count(&f->gb)+31)/32*4,
- bytestream_size - (f->bytestream - (buf + 20 + bitstream_size + wordstream_size)),
- wordstream_size - (((uint8_t*)f->wordstream) - (buf + 20 + bitstream_size))
- );
-
- return 0;
-}
-
-/**
- * decode block and dequantize.
- * Note this is allmost identical to mjpeg
- */
-static int decode_i_block(FourXContext *f, DCTELEM *block){
- int code, i, j, level, val;
-
- /* DC coef */
- val = get_vlc2(&f->pre_gb, f->pre_vlc.table, ACDC_VLC_BITS, 3);
- if (val>>4){
- av_log(f->avctx, AV_LOG_ERROR, "error dc run != 0\n");
- }
-
- if(val)
- val = get_xbits(&f->gb, val);
-
- val = val * dequant_table[0] + f->last_dc;
- f->last_dc =
- block[0] = val;
- /* AC coefs */
- i = 1;
- for(;;) {
- code = get_vlc2(&f->pre_gb, f->pre_vlc.table, ACDC_VLC_BITS, 3);
-
- /* EOB */
- if (code == 0)
- break;
- if (code == 0xf0) {
- i += 16;
- } else {
- level = get_xbits(&f->gb, code & 0xf);
- i += code >> 4;
- if (i >= 64) {
- av_log(f->avctx, AV_LOG_ERROR, "run %d oveflow\n", i);
- return 0;
- }
-
- j= ff_zigzag_direct[i];
- block[j] = level * dequant_table[j];
- i++;
- if (i >= 64)
- break;
- }
- }
-
- return 0;
-}
-
-static inline void idct_put(FourXContext *f, int x, int y){
- DCTELEM (*block)[64]= f->block;
- int stride= f->current_picture.linesize[0]>>1;
- int i;
- uint16_t *dst = ((uint16_t*)f->current_picture.data[0]) + y * stride + x;
-
- for(i=0; i<4; i++){
- block[i][0] += 0x80*8*8;
- idct(block[i]);
- }
-
- if(!(f->avctx->flags&CODEC_FLAG_GRAY)){
- for(i=4; i<6; i++) idct(block[i]);
- }
-
-/* Note transform is:
-y= ( 1b + 4g + 2r)/14
-cb=( 3b - 2g - 1r)/14
-cr=(-1b - 4g + 5r)/14
-*/
- for(y=0; y<8; y++){
- for(x=0; x<8; x++){
- DCTELEM *temp= block[(x>>2) + 2*(y>>2)] + 2*(x&3) + 2*8*(y&3); //FIXME optimize
- int cb= block[4][x + 8*y];
- int cr= block[5][x + 8*y];
- int cg= (cb + cr)>>1;
- int y;
-
- cb+=cb;
-
- y = temp[0];
- dst[0 ]= ((y+cb)>>3) + (((y-cg)&0xFC)<<3) + (((y+cr)&0xF8)<<8);
- y = temp[1];
- dst[1 ]= ((y+cb)>>3) + (((y-cg)&0xFC)<<3) + (((y+cr)&0xF8)<<8);
- y = temp[8];
- dst[ stride]= ((y+cb)>>3) + (((y-cg)&0xFC)<<3) + (((y+cr)&0xF8)<<8);
- y = temp[9];
- dst[1+stride]= ((y+cb)>>3) + (((y-cg)&0xFC)<<3) + (((y+cr)&0xF8)<<8);
- dst += 2;
- }
- dst += 2*stride - 2*8;
- }
-}
-
-static int decode_i_mb(FourXContext *f){
- int i;
-
- f->dsp.clear_blocks(f->block[0]);
-
- for(i=0; i<6; i++){
- if(decode_i_block(f, f->block[i]) < 0)
- return -1;
- }
-
- return 0;
-}
-
-static uint8_t *read_huffman_tables(FourXContext *f, uint8_t * const buf){
- int frequency[512];
- uint8_t flag[512];
- int up[512];
- uint8_t len_tab[257];
- int bits_tab[257];
- int start, end;
- uint8_t *ptr= buf;
- int j;
-
- memset(frequency, 0, sizeof(frequency));
- memset(up, -1, sizeof(up));
-
- start= *ptr++;
- end= *ptr++;
- for(;;){
- int i;
-
- for(i=start; i<=end; i++){
- frequency[i]= *ptr++;
-// printf("%d %d %d\n", start, end, frequency[i]);
- }
- start= *ptr++;
- if(start==0) break;
-
- end= *ptr++;
- }
- frequency[256]=1;
-
- while((ptr - buf)&3) ptr++; // 4byte align
-
-// for(j=0; j<16; j++)
-// printf("%2X", ptr[j]);
-
- for(j=257; j<512; j++){
- int min_freq[2]= {256*256, 256*256};
- int smallest[2]= {0, 0};
- int i;
- for(i=0; i<j; i++){
- if(frequency[i] == 0) continue;
- if(frequency[i] < min_freq[1]){
- if(frequency[i] < min_freq[0]){
- min_freq[1]= min_freq[0]; smallest[1]= smallest[0];
- min_freq[0]= frequency[i];smallest[0]= i;
- }else{
- min_freq[1]= frequency[i];smallest[1]= i;
- }
- }
- }
- if(min_freq[1] == 256*256) break;
-
- frequency[j]= min_freq[0] + min_freq[1];
- flag[ smallest[0] ]= 0;
- flag[ smallest[1] ]= 1;
- up[ smallest[0] ]=
- up[ smallest[1] ]= j;
- frequency[ smallest[0] ]= frequency[ smallest[1] ]= 0;
- }
-
- for(j=0; j<257; j++){
- int node;
- int len=0;
- int bits=0;
-
- for(node= j; up[node] != -1; node= up[node]){
- bits += flag[node]<<len;
- len++;
- if(len > 31) av_log(f->avctx, AV_LOG_ERROR, "vlc length overflow\n"); //can this happen at all ?
- }
-
- bits_tab[j]= bits;
- len_tab[j]= len;
- }
-
- init_vlc(&f->pre_vlc, ACDC_VLC_BITS, 257,
- len_tab , 1, 1,
- bits_tab, 4, 4, 0);
-
- return ptr;
-}
-
-static int decode_i_frame(FourXContext *f, uint8_t *buf, int length){
- int x, y;
- const int width= f->avctx->width;
- const int height= f->avctx->height;
- uint16_t *dst= (uint16_t*)f->current_picture.data[0];
- const int stride= f->current_picture.linesize[0]>>1;
- const unsigned int bitstream_size= get32(buf);
- const int token_count __attribute__((unused)) = get32(buf + bitstream_size + 8);
- unsigned int prestream_size= 4*get32(buf + bitstream_size + 4);
- uint8_t *prestream= buf + bitstream_size + 12;
-
- if(prestream_size + bitstream_size + 12 != length
- || bitstream_size > (1<<26)
- || prestream_size > (1<<26)){
- av_log(f->avctx, AV_LOG_ERROR, "size mismatch %d %d %d\n", prestream_size, bitstream_size, length);
- return -1;
- }
-
- prestream= read_huffman_tables(f, prestream);
-
- init_get_bits(&f->gb, buf + 4, 8*bitstream_size);
-
- prestream_size= length + buf - prestream;
-
- f->bitstream_buffer= av_fast_realloc(f->bitstream_buffer, &f->bitstream_buffer_size, prestream_size + FF_INPUT_BUFFER_PADDING_SIZE);
- f->dsp.bswap_buf((uint32_t*)f->bitstream_buffer, (uint32_t*)prestream, prestream_size/4);
- init_get_bits(&f->pre_gb, f->bitstream_buffer, 8*prestream_size);
-
- f->last_dc= 0*128*8*8;
-
- for(y=0; y<height; y+=16){
- for(x=0; x<width; x+=16){
- if(decode_i_mb(f) < 0)
- return -1;
-
- idct_put(f, x, y);
- }
- dst += 16*stride;
- }
-
- if(get_vlc2(&f->pre_gb, f->pre_vlc.table, ACDC_VLC_BITS, 3) != 256)
- av_log(f->avctx, AV_LOG_ERROR, "end mismatch\n");
-
- return 0;
-}
-
-static int decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- FourXContext * const f = avctx->priv_data;
- AVFrame *picture = data;
- AVFrame *p, temp;
- int i, frame_4cc, frame_size;
-
- frame_4cc= get32(buf);
- if(buf_size != get32(buf+4)+8 || buf_size < 20){
- av_log(f->avctx, AV_LOG_ERROR, "size mismatch %d %d\n", buf_size, get32(buf+4));
- }
-
- if(frame_4cc == ff_get_fourcc("cfrm")){
- int free_index=-1;
- const int data_size= buf_size - 20;
- const int id= get32(buf+12);
- const int whole_size= get32(buf+16);
- CFrameBuffer *cfrm;
-
- for(i=0; i<CFRAME_BUFFER_COUNT; i++){
- if(f->cfrm[i].id && f->cfrm[i].id < avctx->frame_number)
- av_log(f->avctx, AV_LOG_ERROR, "lost c frame %d\n", f->cfrm[i].id);
- }
-
- for(i=0; i<CFRAME_BUFFER_COUNT; i++){
- if(f->cfrm[i].id == id) break;
- if(f->cfrm[i].size == 0 ) free_index= i;
- }
-
- if(i>=CFRAME_BUFFER_COUNT){
- i= free_index;
- f->cfrm[i].id= id;
- }
- cfrm= &f->cfrm[i];
-
- cfrm->data= av_fast_realloc(cfrm->data, &cfrm->allocated_size, cfrm->size + data_size + FF_INPUT_BUFFER_PADDING_SIZE);
- if(!cfrm->data){ //explicit check needed as memcpy below might not catch a NULL
- av_log(f->avctx, AV_LOG_ERROR, "realloc falure");
- return -1;
- }
-
- memcpy(cfrm->data + cfrm->size, buf+20, data_size);
- cfrm->size += data_size;
-
- if(cfrm->size >= whole_size){
- buf= cfrm->data;
- frame_size= cfrm->size;
-
- if(id != avctx->frame_number){
- av_log(f->avctx, AV_LOG_ERROR, "cframe id mismatch %d %d\n", id, avctx->frame_number);
- }
-
- cfrm->size= cfrm->id= 0;
- frame_4cc= ff_get_fourcc("pfrm");
- }else
- return buf_size;
- }else{
- buf= buf + 12;
- frame_size= buf_size - 12;
- }
-
- temp= f->current_picture;
- f->current_picture= f->last_picture;
- f->last_picture= temp;
-
- p= &f->current_picture;
- avctx->coded_frame= p;
-
- avctx->flags |= CODEC_FLAG_EMU_EDGE; // alternatively we would have to use our own buffer management
-
- if(p->data[0])
- avctx->release_buffer(avctx, p);
-
- p->reference= 1;
- if(avctx->get_buffer(avctx, p) < 0){
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
-
- if(frame_4cc == ff_get_fourcc("ifrm")){
- p->pict_type= I_TYPE;
- if(decode_i_frame(f, buf, frame_size) < 0)
- return -1;
- }else if(frame_4cc == ff_get_fourcc("pfrm")){
- p->pict_type= P_TYPE;
- if(decode_p_frame(f, buf, frame_size) < 0)
- return -1;
- }else if(frame_4cc == ff_get_fourcc("snd_")){
- av_log(avctx, AV_LOG_ERROR, "ignoring snd_ chunk length:%d\n", buf_size);
- }else{
- av_log(avctx, AV_LOG_ERROR, "ignoring unknown chunk length:%d\n", buf_size);
- }
-
-#if 0
-for(i=0; i<20; i++){
- printf("%2X %c ", buf[i], clip(buf[i],16,126));
-}
-#endif
-
- p->key_frame= p->pict_type == I_TYPE;
-
- *picture= *p;
- *data_size = sizeof(AVPicture);
-
- emms_c();
-
- return buf_size;
-}
-
-
-static void common_init(AVCodecContext *avctx){
- FourXContext * const f = avctx->priv_data;
-
- dsputil_init(&f->dsp, avctx);
-
- f->avctx= avctx;
-}
-
-static int decode_init(AVCodecContext *avctx){
- FourXContext * const f = avctx->priv_data;
-
- common_init(avctx);
- init_vlcs(f);
-
- avctx->pix_fmt= PIX_FMT_RGB565;
-
- return 0;
-}
-
-
-static int decode_end(AVCodecContext *avctx){
- FourXContext * const f = avctx->priv_data;
- int i;
-
- av_freep(&f->bitstream_buffer);
- f->bitstream_buffer_size=0;
- for(i=0; i<CFRAME_BUFFER_COUNT; i++){
- av_freep(&f->cfrm[i].data);
- f->cfrm[i].allocated_size= 0;
- }
- free_vlc(&f->pre_vlc);
-
- return 0;
-}
-
-AVCodec fourxm_decoder = {
- "4xm",
- CODEC_TYPE_VIDEO,
- CODEC_ID_4XM,
- sizeof(FourXContext),
- decode_init,
- NULL,
- decode_end,
- decode_frame,
- /*CODEC_CAP_DR1,*/
-};
-
diff --git a/src/libffmpeg/libavcodec/8bps.c b/src/libffmpeg/libavcodec/8bps.c
deleted file mode 100644
index 297465043..000000000
--- a/src/libffmpeg/libavcodec/8bps.c
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Quicktime Planar RGB (8BPS) Video Decoder
- * Copyright (C) 2003 Roberto Togni
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file 8bps.c
- * QT 8BPS Video Decoder by Roberto Togni <rtogni at bresciaonline dot it>
- * For more information about the 8BPS format, visit:
- * http://www.pcisys.net/~melanson/codecs/
- *
- * Supports: PAL8 (RGB 8bpp, paletted)
- * : BGR24 (RGB 24bpp) (can also output it as RGBA32)
- * : RGBA32 (RGB 32bpp, 4th plane is probably alpha and it's ignored)
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "common.h"
-#include "avcodec.h"
-
-
-static const enum PixelFormat pixfmt_rgb24[] = {PIX_FMT_BGR24, PIX_FMT_RGBA32, -1};
-
-/*
- * Decoder context
- */
-typedef struct EightBpsContext {
-
- AVCodecContext *avctx;
- AVFrame pic;
-
- unsigned char planes;
- unsigned char planemap[4];
-} EightBpsContext;
-
-
-/*
- *
- * Decode a frame
- *
- */
-static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size)
-{
- EightBpsContext * const c = (EightBpsContext *)avctx->priv_data;
- unsigned char *encoded = (unsigned char *)buf;
- unsigned char *pixptr, *pixptr_end;
- unsigned int height = avctx->height; // Real image height
- unsigned int dlen, p, row;
- unsigned char *lp, *dp;
- unsigned char count;
- unsigned int px_inc;
- unsigned int planes = c->planes;
- unsigned char *planemap = c->planemap;
-
- if(c->pic.data[0])
- avctx->release_buffer(avctx, &c->pic);
-
- c->pic.reference = 0;
- c->pic.buffer_hints = FF_BUFFER_HINTS_VALID;
- if(avctx->get_buffer(avctx, &c->pic) < 0){
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
-
- /* Set data pointer after line lengths */
- dp = encoded + planes * (height << 1);
-
- /* Ignore alpha plane, don't know what to do with it */
- if (planes == 4)
- planes--;
-
- px_inc = planes + (avctx->pix_fmt == PIX_FMT_RGBA32);
-
- for (p = 0; p < planes; p++) {
- /* Lines length pointer for this plane */
- lp = encoded + p * (height << 1);
-
- /* Decode a plane */
- for(row = 0; row < height; row++) {
- pixptr = c->pic.data[0] + row * c->pic.linesize[0] + planemap[p];
- pixptr_end = pixptr + c->pic.linesize[0];
- dlen = be2me_16(*(unsigned short *)(lp+row*2));
- /* Decode a row of this plane */
- while(dlen > 0) {
- if(dp + 1 >= buf+buf_size) return -1;
- if ((count = *dp++) <= 127) {
- count++;
- dlen -= count + 1;
- if (pixptr + count * px_inc > pixptr_end)
- break;
- if(dp + count > buf+buf_size) return -1;
- while(count--) {
- *pixptr = *dp++;
- pixptr += px_inc;
- }
- } else {
- count = 257 - count;
- if (pixptr + count * px_inc > pixptr_end)
- break;
- while(count--) {
- *pixptr = *dp;
- pixptr += px_inc;
- }
- dp++;
- dlen -= 2;
- }
- }
- }
- }
-
- if (avctx->palctrl) {
- memcpy (c->pic.data[1], avctx->palctrl->palette, AVPALETTE_SIZE);
- if (avctx->palctrl->palette_changed) {
- c->pic.palette_has_changed = 1;
- avctx->palctrl->palette_changed = 0;
- } else
- c->pic.palette_has_changed = 0;
- }
-
- *data_size = sizeof(AVFrame);
- *(AVFrame*)data = c->pic;
-
- /* always report that the buffer was completely consumed */
- return buf_size;
-}
-
-
-/*
- *
- * Init 8BPS decoder
- *
- */
-static int decode_init(AVCodecContext *avctx)
-{
- EightBpsContext * const c = (EightBpsContext *)avctx->priv_data;
-
- c->avctx = avctx;
- avctx->has_b_frames = 0;
-
- c->pic.data[0] = NULL;
-
- if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
- return 1;
- }
-
- switch (avctx->bits_per_sample) {
- case 8:
- avctx->pix_fmt = PIX_FMT_PAL8;
- c->planes = 1;
- c->planemap[0] = 0; // 1st plane is palette indexes
- if (avctx->palctrl == NULL) {
- av_log(avctx, AV_LOG_ERROR, "Error: PAL8 format but no palette from demuxer.\n");
- return -1;
- }
- break;
- case 24:
- avctx->pix_fmt = avctx->get_format(avctx, pixfmt_rgb24);
- c->planes = 3;
- c->planemap[0] = 2; // 1st plane is red
- c->planemap[1] = 1; // 2nd plane is green
- c->planemap[2] = 0; // 3rd plane is blue
- break;
- case 32:
- avctx->pix_fmt = PIX_FMT_RGBA32;
- c->planes = 4;
-#ifdef WORDS_BIGENDIAN
- c->planemap[0] = 1; // 1st plane is red
- c->planemap[1] = 2; // 2nd plane is green
- c->planemap[2] = 3; // 3rd plane is blue
- c->planemap[3] = 0; // 4th plane is alpha???
-#else
- c->planemap[0] = 2; // 1st plane is red
- c->planemap[1] = 1; // 2nd plane is green
- c->planemap[2] = 0; // 3rd plane is blue
- c->planemap[3] = 3; // 4th plane is alpha???
-#endif
- break;
- default:
- av_log(avctx, AV_LOG_ERROR, "Error: Unsupported color depth: %u.\n", avctx->bits_per_sample);
- return -1;
- }
-
- return 0;
-}
-
-
-
-
-/*
- *
- * Uninit 8BPS decoder
- *
- */
-static int decode_end(AVCodecContext *avctx)
-{
- EightBpsContext * const c = (EightBpsContext *)avctx->priv_data;
-
- if (c->pic.data[0])
- avctx->release_buffer(avctx, &c->pic);
-
- return 0;
-}
-
-
-
-AVCodec eightbps_decoder = {
- "8bps",
- CODEC_TYPE_VIDEO,
- CODEC_ID_8BPS,
- sizeof(EightBpsContext),
- decode_init,
- NULL,
- decode_end,
- decode_frame,
- CODEC_CAP_DR1,
-};
diff --git a/src/libffmpeg/libavcodec/Makefile.am b/src/libffmpeg/libavcodec/Makefile.am
deleted file mode 100644
index a5e6cd650..000000000
--- a/src/libffmpeg/libavcodec/Makefile.am
+++ /dev/null
@@ -1,190 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-SUBDIRS = armv4l i386 mlib alpha ppc sparc libpostproc
-
-# some of ffmpeg's decoders are not used by xine yet
-EXTRA_DIST = motion_est_template.c \
- adx.c cljr.c fdctref.c ffv1.c g726.c jpeg_ls.c mdec.c raw.c svq3.c wmv2.c
-
-# we need to compile everything in debug mode, including the encoders,
-# otherwise we get unresolved symbols, because some unsatisfied function calls
-# are not optimized away with debug optimization
-#AM_CFLAGS = `test "$(CFLAGS)" = "$(DEBUG_CFLAGS)" && echo -DCONFIG_ENCODERS` -fno-strict-aliasing
-AM_CFLAGS = `test "$(CFLAGS)" = "$(DEBUG_CFLAGS)"` -fno-strict-aliasing
-AM_CPPFLAGS = $(ZLIB_CPPFLAGS) $(LIBFFMPEG_CPPFLAGS) \
- -I$(top_srcdir)/src/libffmpeg/libavutil -I$(top_srcdir)/src/libffmpeg \
- -I$(top_builddir)/src/libffmpeg
-ASFLAGS =
-
-noinst_LTLIBRARIES = libavcodec.la
-
-libavcodec_la_SOURCES = \
- 4xm.c \
- 8bps.c \
- aasc.c \
- adpcm.c \
- alac.c \
- asv1.c \
- avs.c \
- bitstream.c \
- cabac.c \
- cavs.c \
- cinepak.c \
- cook.c \
- cscd.c \
- cyuv.c \
- dpcm.c \
- dsputil.c \
- dv.c \
- error_resilience.c \
- eval.c \
- faandct.c \
- flac.c \
- flashsv.c \
- flicvideo.c \
- fraps.c \
- fft.c \
- golomb.c \
- h261.c \
- h263.c \
- h263dec.c \
- h264.c \
- h264idct.c \
- huffyuv.c \
- idcinvideo.c \
- imgconvert.c \
- imgresample.c \
- indeo2.c \
- indeo3.c \
- interplayvideo.c \
- jfdctfst.c \
- jfdctint.c \
- jrevdct.c \
- kmvc.c \
- lcl.c \
- loco.c \
- lzo.c \
- mdct.c \
- mace.c \
- mjpeg.c \
- mmvideo.c \
- motion_est.c \
- mpeg12.c \
- mpegaudiodec.c \
- mpegvideo.c \
- msmpeg4.c \
- msrle.c \
- msvideo1.c \
- nuv.c \
- opt.c \
- parser.c \
- pcm.c \
- qdm2.c \
- qdrw.c \
- qpeg.c \
- qtrle.c \
- ra144.c \
- ra288.c \
- rangecoder.c \
- ratecontrol.c \
- resample2.c \
- roqvideo.c \
- rpza.c \
- rtjpeg.c \
- rv10.c \
- shorten.c \
- simple_idct.c \
- smacker.c \
- smc.c \
- snow.c \
- svq1.c \
- tscc.c \
- truemotion1.c \
- truemotion2.c \
- truespeech.c \
- tta.c \
- ulti.c \
- utils.c \
- vc1.c \
- vc1dsp.c \
- vcr1.c \
- vmdav.c \
- vorbis.c \
- vorbis_data.c \
- vp3.c \
- vp3dsp.c \
- vp5.c \
- vp56.c \
- vp56data.c \
- vp6.c \
- vqavideo.c \
- wavpack.c \
- wmadec.c \
- wnv1.c \
- xan.c \
- xl.c \
- zmbv.c
-
-libavcodec_la_LDFLAGS = \
- $(top_builddir)/src/libffmpeg/libavcodec/armv4l/libavcodec_armv4l.la \
- $(top_builddir)/src/libffmpeg/libavcodec/i386/libavcodec_mmx.la \
- $(top_builddir)/src/libffmpeg/libavcodec/mlib/libavcodec_mlib.la \
- $(top_builddir)/src/libffmpeg/libavcodec/ppc/libavcodec_ppc.la \
- $(top_builddir)/src/libffmpeg/libavcodec/sparc/libavcodec_sparc.la \
- -avoid-version -module
-
-
-noinst_HEADERS = \
- avcodec.h \
- bitstream.h \
- bytestream.h \
- cabac.h \
- cavsdata.h \
- cookdata.h \
- dsputil.h \
- dvdata.h \
- eval.h \
- faandct.h \
- fastmemcpy.h \
- golomb.h \
- imgconvert_template.h \
- indeo2data.h \
- indeo3data.h \
- h261data.h \
- h263data.h \
- h264data.h \
- lzo.h \
- mathops.h \
- mpeg4data.h \
- mpeg12data.h \
- mpegaudio.h \
- mpegaudiodectab.h \
- mpegaudiotab.h \
- mpegvideo.h \
- msmpeg4data.h \
- opt.h \
- parser.h \
- qdm2data.h \
- ra144.h \
- ra288.h \
- rangecoder.h \
- ratecontrol.h \
- rtjpeg.h \
- simple_idct.h \
- snow.h \
- sp5x.h \
- svq1_cb.h \
- svq1_vlc.h \
- swscale.h \
- truemotion1data.h \
- truespeech_data.h \
- ulti_cb.h \
- vorbis.h \
- vc1acdata.h \
- vc1data.h \
- vp3data.h \
- vp56.h \
- vp56data.h \
- vp5data.h \
- vp6data.h \
- wmadata.h
diff --git a/src/libffmpeg/libavcodec/aasc.c b/src/libffmpeg/libavcodec/aasc.c
deleted file mode 100644
index 6c8e3166e..000000000
--- a/src/libffmpeg/libavcodec/aasc.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Autodesc RLE Decoder
- * Copyright (C) 2005 the ffmpeg project
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file aasc.c
- * Autodesc RLE Video Decoder by Konstantin Shishkov
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "common.h"
-#include "avcodec.h"
-#include "dsputil.h"
-
-typedef struct AascContext {
- AVCodecContext *avctx;
- AVFrame frame;
-} AascContext;
-
-#define FETCH_NEXT_STREAM_BYTE() \
- if (stream_ptr >= buf_size) \
- { \
- av_log(s->avctx, AV_LOG_ERROR, " AASC: stream ptr just went out of bounds (fetch)\n"); \
- break; \
- } \
- stream_byte = buf[stream_ptr++];
-
-static int aasc_decode_init(AVCodecContext *avctx)
-{
- AascContext *s = (AascContext *)avctx->priv_data;
-
- s->avctx = avctx;
-
- avctx->pix_fmt = PIX_FMT_BGR24;
- avctx->has_b_frames = 0;
- s->frame.data[0] = NULL;
-
- return 0;
-}
-
-static int aasc_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- AascContext *s = (AascContext *)avctx->priv_data;
- int stream_ptr = 4;
- unsigned char rle_code;
- unsigned char stream_byte;
- int pixel_ptr = 0;
- int row_dec, row_ptr;
- int frame_size;
- int i;
-
- s->frame.reference = 1;
- s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
- if (avctx->reget_buffer(avctx, &s->frame)) {
- av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
- return -1;
- }
-
- row_dec = s->frame.linesize[0];
- row_ptr = (s->avctx->height - 1) * row_dec;
- frame_size = row_dec * s->avctx->height;
-
- while (row_ptr >= 0) {
- FETCH_NEXT_STREAM_BYTE();
- rle_code = stream_byte;
- if (rle_code == 0) {
- /* fetch the next byte to see how to handle escape code */
- FETCH_NEXT_STREAM_BYTE();
- if (stream_byte == 0) {
- /* line is done, goto the next one */
- row_ptr -= row_dec;
- pixel_ptr = 0;
- } else if (stream_byte == 1) {
- /* decode is done */
- break;
- } else if (stream_byte == 2) {
- /* reposition frame decode coordinates */
- FETCH_NEXT_STREAM_BYTE();
- pixel_ptr += stream_byte;
- FETCH_NEXT_STREAM_BYTE();
- row_ptr -= stream_byte * row_dec;
- } else {
- /* copy pixels from encoded stream */
- if ((pixel_ptr + stream_byte > avctx->width * 3) ||
- (row_ptr < 0)) {
- av_log(s->avctx, AV_LOG_ERROR, " AASC: frame ptr just went out of bounds (copy1)\n");
- break;
- }
-
- rle_code = stream_byte;
- if (stream_ptr + rle_code > buf_size) {
- av_log(s->avctx, AV_LOG_ERROR, " AASC: stream ptr just went out of bounds (copy2)\n");
- break;
- }
-
- for (i = 0; i < rle_code; i++) {
- FETCH_NEXT_STREAM_BYTE();
- s->frame.data[0][row_ptr + pixel_ptr] = stream_byte;
- pixel_ptr++;
- }
- if (rle_code & 1)
- stream_ptr++;
- }
- } else {
- /* decode a run of data */
- if ((pixel_ptr + rle_code > avctx->width * 3) ||
- (row_ptr < 0)) {
- av_log(s->avctx, AV_LOG_ERROR, " AASC: frame ptr just went out of bounds (run1)\n");
- break;
- }
-
- FETCH_NEXT_STREAM_BYTE();
-
- while(rle_code--) {
- s->frame.data[0][row_ptr + pixel_ptr] = stream_byte;
- pixel_ptr++;
- }
- }
- }
-
- /* one last sanity check on the way out */
- if (stream_ptr < buf_size)
- av_log(s->avctx, AV_LOG_ERROR, " AASC: ended frame decode with bytes left over (%d < %d)\n",
- stream_ptr, buf_size);
-
- *data_size = sizeof(AVFrame);
- *(AVFrame*)data = s->frame;
-
- /* report that the buffer was completely consumed */
- return buf_size;
-}
-
-static int aasc_decode_end(AVCodecContext *avctx)
-{
- AascContext *s = (AascContext *)avctx->priv_data;
-
- /* release the last frame */
- if (s->frame.data[0])
- avctx->release_buffer(avctx, &s->frame);
-
- return 0;
-}
-
-AVCodec aasc_decoder = {
- "aasc",
- CODEC_TYPE_VIDEO,
- CODEC_ID_AASC,
- sizeof(AascContext),
- aasc_decode_init,
- NULL,
- aasc_decode_end,
- aasc_decode_frame,
- CODEC_CAP_DR1,
-};
diff --git a/src/libffmpeg/libavcodec/adpcm.c b/src/libffmpeg/libavcodec/adpcm.c
deleted file mode 100644
index 9be4c2274..000000000
--- a/src/libffmpeg/libavcodec/adpcm.c
+++ /dev/null
@@ -1,1370 +0,0 @@
-/*
- * ADPCM codecs
- * Copyright (c) 2001-2003 The ffmpeg Project
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "avcodec.h"
-#include "bitstream.h"
-
-/**
- * @file adpcm.c
- * ADPCM codecs.
- * First version by Francois Revol (revol@free.fr)
- * Fringe ADPCM codecs (e.g., DK3, DK4, Westwood)
- * by Mike Melanson (melanson@pcisys.net)
- * CD-ROM XA ADPCM codec by BERO
- * EA ADPCM decoder by Robin Kay (komadori@myrealbox.com)
- *
- * Features and limitations:
- *
- * Reference documents:
- * http://www.pcisys.net/~melanson/codecs/simpleaudio.html
- * http://www.geocities.com/SiliconValley/8682/aud3.txt
- * http://openquicktime.sourceforge.net/plugins.htm
- * XAnim sources (xa_codec.c) http://www.rasnaimaging.com/people/lapus/download.html
- * http://www.cs.ucla.edu/~leec/mediabench/applications.html
- * SoX source code http://home.sprynet.com/~cbagwell/sox.html
- *
- * CD-ROM XA:
- * http://ku-www.ss.titech.ac.jp/~yatsushi/xaadpcm.html
- * vagpack & depack http://homepages.compuserve.de/bITmASTER32/psx-index.html
- * readstr http://www.geocities.co.jp/Playtown/2004/
- */
-
-#define BLKSIZE 1024
-
-#define CLAMP_TO_SHORT(value) \
-if (value > 32767) \
- value = 32767; \
-else if (value < -32768) \
- value = -32768; \
-
-/* step_table[] and index_table[] are from the ADPCM reference source */
-/* This is the index table: */
-static const int index_table[16] = {
- -1, -1, -1, -1, 2, 4, 6, 8,
- -1, -1, -1, -1, 2, 4, 6, 8,
-};
-
-/**
- * This is the step table. Note that many programs use slight deviations from
- * this table, but such deviations are negligible:
- */
-static const int step_table[89] = {
- 7, 8, 9, 10, 11, 12, 13, 14, 16, 17,
- 19, 21, 23, 25, 28, 31, 34, 37, 41, 45,
- 50, 55, 60, 66, 73, 80, 88, 97, 107, 118,
- 130, 143, 157, 173, 190, 209, 230, 253, 279, 307,
- 337, 371, 408, 449, 494, 544, 598, 658, 724, 796,
- 876, 963, 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066,
- 2272, 2499, 2749, 3024, 3327, 3660, 4026, 4428, 4871, 5358,
- 5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899,
- 15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767
-};
-
-/* These are for MS-ADPCM */
-/* AdaptationTable[], AdaptCoeff1[], and AdaptCoeff2[] are from libsndfile */
-static const int AdaptationTable[] = {
- 230, 230, 230, 230, 307, 409, 512, 614,
- 768, 614, 512, 409, 307, 230, 230, 230
-};
-
-static const int AdaptCoeff1[] = {
- 256, 512, 0, 192, 240, 460, 392
-};
-
-static const int AdaptCoeff2[] = {
- 0, -256, 0, 64, 0, -208, -232
-};
-
-/* These are for CD-ROM XA ADPCM */
-static const int xa_adpcm_table[5][2] = {
- { 0, 0 },
- { 60, 0 },
- { 115, -52 },
- { 98, -55 },
- { 122, -60 }
-};
-
-static const int ea_adpcm_table[] = {
- 0, 240, 460, 392, 0, 0, -208, -220, 0, 1,
- 3, 4, 7, 8, 10, 11, 0, -1, -3, -4
-};
-
-static const int ct_adpcm_table[8] = {
- 0x00E6, 0x00E6, 0x00E6, 0x00E6,
- 0x0133, 0x0199, 0x0200, 0x0266
-};
-
-// padded to zero where table size is less then 16
-static const int swf_index_tables[4][16] = {
- /*2*/ { -1, 2 },
- /*3*/ { -1, -1, 2, 4 },
- /*4*/ { -1, -1, -1, -1, 2, 4, 6, 8 },
- /*5*/ { -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 4, 6, 8, 10, 13, 16 }
-};
-
-static const int yamaha_indexscale[] = {
- 230, 230, 230, 230, 307, 409, 512, 614,
- 230, 230, 230, 230, 307, 409, 512, 614
-};
-
-static const int yamaha_difflookup[] = {
- 1, 3, 5, 7, 9, 11, 13, 15,
- -1, -3, -5, -7, -9, -11, -13, -15
-};
-
-/* end of tables */
-
-typedef struct ADPCMChannelStatus {
- int predictor;
- short int step_index;
- int step;
- /* for encoding */
- int prev_sample;
-
- /* MS version */
- short sample1;
- short sample2;
- int coeff1;
- int coeff2;
- int idelta;
-} ADPCMChannelStatus;
-
-typedef struct ADPCMContext {
- int channel; /* for stereo MOVs, decode left, then decode right, then tell it's decoded */
- ADPCMChannelStatus status[2];
- short sample_buffer[32]; /* hold left samples while waiting for right samples */
-
- /* SWF only */
- int nb_bits;
- int nb_samples;
-} ADPCMContext;
-
-/* XXX: implement encoding */
-
-#ifdef CONFIG_ENCODERS
-static int adpcm_encode_init(AVCodecContext *avctx)
-{
- if (avctx->channels > 2)
- return -1; /* only stereo or mono =) */
- switch(avctx->codec->id) {
- case CODEC_ID_ADPCM_IMA_QT:
- av_log(avctx, AV_LOG_ERROR, "ADPCM: codec adpcm_ima_qt unsupported for encoding !\n");
- avctx->frame_size = 64; /* XXX: can multiple of avctx->channels * 64 (left and right blocks are interleaved) */
- return -1;
- break;
- case CODEC_ID_ADPCM_IMA_WAV:
- avctx->frame_size = (BLKSIZE - 4 * avctx->channels) * 8 / (4 * avctx->channels) + 1; /* each 16 bits sample gives one nibble */
- /* and we have 4 bytes per channel overhead */
- avctx->block_align = BLKSIZE;
- /* seems frame_size isn't taken into account... have to buffer the samples :-( */
- break;
- case CODEC_ID_ADPCM_MS:
- avctx->frame_size = (BLKSIZE - 7 * avctx->channels) * 2 / avctx->channels + 2; /* each 16 bits sample gives one nibble */
- /* and we have 7 bytes per channel overhead */
- avctx->block_align = BLKSIZE;
- break;
- case CODEC_ID_ADPCM_YAMAHA:
- avctx->frame_size = BLKSIZE * avctx->channels;
- avctx->block_align = BLKSIZE;
- break;
- default:
- return -1;
- break;
- }
-
- avctx->coded_frame= avcodec_alloc_frame();
- avctx->coded_frame->key_frame= 1;
-
- return 0;
-}
-
-static int adpcm_encode_close(AVCodecContext *avctx)
-{
- av_freep(&avctx->coded_frame);
-
- return 0;
-}
-
-
-static inline unsigned char adpcm_ima_compress_sample(ADPCMChannelStatus *c, short sample)
-{
- int delta = sample - c->prev_sample;
- int nibble = FFMIN(7, abs(delta)*4/step_table[c->step_index]) + (delta<0)*8;
- c->prev_sample = c->prev_sample + ((step_table[c->step_index] * yamaha_difflookup[nibble]) / 8);
- CLAMP_TO_SHORT(c->prev_sample);
- c->step_index = clip(c->step_index + index_table[nibble], 0, 88);
- return nibble;
-}
-
-static inline unsigned char adpcm_ms_compress_sample(ADPCMChannelStatus *c, short sample)
-{
- int predictor, nibble, bias;
-
- predictor = (((c->sample1) * (c->coeff1)) + ((c->sample2) * (c->coeff2))) / 256;
-
- nibble= sample - predictor;
- if(nibble>=0) bias= c->idelta/2;
- else bias=-c->idelta/2;
-
- nibble= (nibble + bias) / c->idelta;
- nibble= clip(nibble, -8, 7)&0x0F;
-
- predictor += (signed)((nibble & 0x08)?(nibble - 0x10):(nibble)) * c->idelta;
- CLAMP_TO_SHORT(predictor);
-
- c->sample2 = c->sample1;
- c->sample1 = predictor;
-
- c->idelta = (AdaptationTable[(int)nibble] * c->idelta) >> 8;
- if (c->idelta < 16) c->idelta = 16;
-
- return nibble;
-}
-
-static inline unsigned char adpcm_yamaha_compress_sample(ADPCMChannelStatus *c, short sample)
-{
- int nibble, delta;
-
- if(!c->step) {
- c->predictor = 0;
- c->step = 127;
- }
-
- delta = sample - c->predictor;
-
- nibble = FFMIN(7, abs(delta)*4/c->step) + (delta<0)*8;
-
- c->predictor = c->predictor + ((c->step * yamaha_difflookup[nibble]) / 8);
- CLAMP_TO_SHORT(c->predictor);
- c->step = (c->step * yamaha_indexscale[nibble]) >> 8;
- c->step = clip(c->step, 127, 24567);
-
- return nibble;
-}
-
-typedef struct TrellisPath {
- int nibble;
- int prev;
-} TrellisPath;
-
-typedef struct TrellisNode {
- uint32_t ssd;
- int path;
- int sample1;
- int sample2;
- int step;
-} TrellisNode;
-
-static void adpcm_compress_trellis(AVCodecContext *avctx, const short *samples,
- uint8_t *dst, ADPCMChannelStatus *c, int n)
-{
-#define FREEZE_INTERVAL 128
- //FIXME 6% faster if frontier is a compile-time constant
- const int frontier = 1 << avctx->trellis;
- const int stride = avctx->channels;
- const int version = avctx->codec->id;
- const int max_paths = frontier*FREEZE_INTERVAL;
- TrellisPath paths[max_paths], *p;
- TrellisNode node_buf[2][frontier];
- TrellisNode *nodep_buf[2][frontier];
- TrellisNode **nodes = nodep_buf[0]; // nodes[] is always sorted by .ssd
- TrellisNode **nodes_next = nodep_buf[1];
- int pathn = 0, froze = -1, i, j, k;
-
- assert(!(max_paths&(max_paths-1)));
-
- memset(nodep_buf, 0, sizeof(nodep_buf));
- nodes[0] = &node_buf[1][0];
- nodes[0]->ssd = 0;
- nodes[0]->path = 0;
- nodes[0]->step = c->step_index;
- nodes[0]->sample1 = c->sample1;
- nodes[0]->sample2 = c->sample2;
- if(version == CODEC_ID_ADPCM_IMA_WAV)
- nodes[0]->sample1 = c->prev_sample;
- if(version == CODEC_ID_ADPCM_MS)
- nodes[0]->step = c->idelta;
- if(version == CODEC_ID_ADPCM_YAMAHA) {
- if(c->step == 0) {
- nodes[0]->step = 127;
- nodes[0]->sample1 = 0;
- } else {
- nodes[0]->step = c->step;
- nodes[0]->sample1 = c->predictor;
- }
- }
-
- for(i=0; i<n; i++) {
- TrellisNode *t = node_buf[i&1];
- TrellisNode **u;
- int sample = samples[i*stride];
- memset(nodes_next, 0, frontier*sizeof(TrellisNode*));
- for(j=0; j<frontier && nodes[j]; j++) {
- // higher j have higher ssd already, so they're unlikely to use a suboptimal next sample too
- const int range = (j < frontier/2) ? 1 : 0;
- const int step = nodes[j]->step;
- int nidx;
- if(version == CODEC_ID_ADPCM_MS) {
- const int predictor = ((nodes[j]->sample1 * c->coeff1) + (nodes[j]->sample2 * c->coeff2)) / 256;
- const int div = (sample - predictor) / step;
- const int nmin = clip(div-range, -8, 6);
- const int nmax = clip(div+range, -7, 7);
- for(nidx=nmin; nidx<=nmax; nidx++) {
- const int nibble = nidx & 0xf;
- int dec_sample = predictor + nidx * step;
-#define STORE_NODE(NAME, STEP_INDEX)\
- int d;\
- uint32_t ssd;\
- CLAMP_TO_SHORT(dec_sample);\
- d = sample - dec_sample;\
- ssd = nodes[j]->ssd + d*d;\
- if(nodes_next[frontier-1] && ssd >= nodes_next[frontier-1]->ssd)\
- continue;\
- /* Collapse any two states with the same previous sample value. \
- * One could also distinguish states by step and by 2nd to last
- * sample, but the effects of that are negligible. */\
- for(k=0; k<frontier && nodes_next[k]; k++) {\
- if(dec_sample == nodes_next[k]->sample1) {\
- assert(ssd >= nodes_next[k]->ssd);\
- goto next_##NAME;\
- }\
- }\
- for(k=0; k<frontier; k++) {\
- if(!nodes_next[k] || ssd < nodes_next[k]->ssd) {\
- TrellisNode *u = nodes_next[frontier-1];\
- if(!u) {\
- assert(pathn < max_paths);\
- u = t++;\
- u->path = pathn++;\
- }\
- u->ssd = ssd;\
- u->step = STEP_INDEX;\
- u->sample2 = nodes[j]->sample1;\
- u->sample1 = dec_sample;\
- paths[u->path].nibble = nibble;\
- paths[u->path].prev = nodes[j]->path;\
- memmove(&nodes_next[k+1], &nodes_next[k], (frontier-k-1)*sizeof(TrellisNode*));\
- nodes_next[k] = u;\
- break;\
- }\
- }\
- next_##NAME:;
- STORE_NODE(ms, FFMAX(16, (AdaptationTable[nibble] * step) >> 8));
- }
- } else if(version == CODEC_ID_ADPCM_IMA_WAV) {
-#define LOOP_NODES(NAME, STEP_TABLE, STEP_INDEX)\
- const int predictor = nodes[j]->sample1;\
- const int div = (sample - predictor) * 4 / STEP_TABLE;\
- int nmin = clip(div-range, -7, 6);\
- int nmax = clip(div+range, -6, 7);\
- if(nmin<=0) nmin--; /* distinguish -0 from +0 */\
- if(nmax<0) nmax--;\
- for(nidx=nmin; nidx<=nmax; nidx++) {\
- const int nibble = nidx<0 ? 7-nidx : nidx;\
- int dec_sample = predictor + (STEP_TABLE * yamaha_difflookup[nibble]) / 8;\
- STORE_NODE(NAME, STEP_INDEX);\
- }
- LOOP_NODES(ima, step_table[step], clip(step + index_table[nibble], 0, 88));
- } else { //CODEC_ID_ADPCM_YAMAHA
- LOOP_NODES(yamaha, step, clip((step * yamaha_indexscale[nibble]) >> 8, 127, 24567));
-#undef LOOP_NODES
-#undef STORE_NODE
- }
- }
-
- u = nodes;
- nodes = nodes_next;
- nodes_next = u;
-
- // prevent overflow
- if(nodes[0]->ssd > (1<<28)) {
- for(j=1; j<frontier && nodes[j]; j++)
- nodes[j]->ssd -= nodes[0]->ssd;
- nodes[0]->ssd = 0;
- }
-
- // merge old paths to save memory
- if(i == froze + FREEZE_INTERVAL) {
- p = &paths[nodes[0]->path];
- for(k=i; k>froze; k--) {
- dst[k] = p->nibble;
- p = &paths[p->prev];
- }
- froze = i;
- pathn = 0;
- // other nodes might use paths that don't coincide with the frozen one.
- // checking which nodes do so is too slow, so just kill them all.
- // this also slightly improves quality, but I don't know why.
- memset(nodes+1, 0, (frontier-1)*sizeof(TrellisNode*));
- }
- }
-
- p = &paths[nodes[0]->path];
- for(i=n-1; i>froze; i--) {
- dst[i] = p->nibble;
- p = &paths[p->prev];
- }
-
- c->predictor = nodes[0]->sample1;
- c->sample1 = nodes[0]->sample1;
- c->sample2 = nodes[0]->sample2;
- c->step_index = nodes[0]->step;
- c->step = nodes[0]->step;
- c->idelta = nodes[0]->step;
-}
-
-static int adpcm_encode_frame(AVCodecContext *avctx,
- unsigned char *frame, int buf_size, void *data)
-{
- int n, i, st;
- short *samples;
- unsigned char *dst;
- ADPCMContext *c = avctx->priv_data;
-
- dst = frame;
- samples = (short *)data;
- st= avctx->channels == 2;
-/* n = (BLKSIZE - 4 * avctx->channels) / (2 * 8 * avctx->channels); */
-
- switch(avctx->codec->id) {
- case CODEC_ID_ADPCM_IMA_QT: /* XXX: can't test until we get .mov writer */
- break;
- case CODEC_ID_ADPCM_IMA_WAV:
- n = avctx->frame_size / 8;
- c->status[0].prev_sample = (signed short)samples[0]; /* XXX */
-/* c->status[0].step_index = 0; *//* XXX: not sure how to init the state machine */
- *dst++ = (c->status[0].prev_sample) & 0xFF; /* little endian */
- *dst++ = (c->status[0].prev_sample >> 8) & 0xFF;
- *dst++ = (unsigned char)c->status[0].step_index;
- *dst++ = 0; /* unknown */
- samples++;
- if (avctx->channels == 2) {
- c->status[1].prev_sample = (signed short)samples[1];
-/* c->status[1].step_index = 0; */
- *dst++ = (c->status[1].prev_sample) & 0xFF;
- *dst++ = (c->status[1].prev_sample >> 8) & 0xFF;
- *dst++ = (unsigned char)c->status[1].step_index;
- *dst++ = 0;
- samples++;
- }
-
- /* stereo: 4 bytes (8 samples) for left, 4 bytes for right, 4 bytes left, ... */
- if(avctx->trellis > 0) {
- uint8_t buf[2][n*8];
- adpcm_compress_trellis(avctx, samples, buf[0], &c->status[0], n*8);
- if(avctx->channels == 2)
- adpcm_compress_trellis(avctx, samples+1, buf[1], &c->status[1], n*8);
- for(i=0; i<n; i++) {
- *dst++ = buf[0][8*i+0] | (buf[0][8*i+1] << 4);
- *dst++ = buf[0][8*i+2] | (buf[0][8*i+3] << 4);
- *dst++ = buf[0][8*i+4] | (buf[0][8*i+5] << 4);
- *dst++ = buf[0][8*i+6] | (buf[0][8*i+7] << 4);
- if (avctx->channels == 2) {
- *dst++ = buf[1][8*i+0] | (buf[1][8*i+1] << 4);
- *dst++ = buf[1][8*i+2] | (buf[1][8*i+3] << 4);
- *dst++ = buf[1][8*i+4] | (buf[1][8*i+5] << 4);
- *dst++ = buf[1][8*i+6] | (buf[1][8*i+7] << 4);
- }
- }
- } else
- for (; n>0; n--) {
- *dst = adpcm_ima_compress_sample(&c->status[0], samples[0]) & 0x0F;
- *dst |= (adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels]) << 4) & 0xF0;
- dst++;
- *dst = adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels * 2]) & 0x0F;
- *dst |= (adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels * 3]) << 4) & 0xF0;
- dst++;
- *dst = adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels * 4]) & 0x0F;
- *dst |= (adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels * 5]) << 4) & 0xF0;
- dst++;
- *dst = adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels * 6]) & 0x0F;
- *dst |= (adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels * 7]) << 4) & 0xF0;
- dst++;
- /* right channel */
- if (avctx->channels == 2) {
- *dst = adpcm_ima_compress_sample(&c->status[1], samples[1]);
- *dst |= adpcm_ima_compress_sample(&c->status[1], samples[3]) << 4;
- dst++;
- *dst = adpcm_ima_compress_sample(&c->status[1], samples[5]);
- *dst |= adpcm_ima_compress_sample(&c->status[1], samples[7]) << 4;
- dst++;
- *dst = adpcm_ima_compress_sample(&c->status[1], samples[9]);
- *dst |= adpcm_ima_compress_sample(&c->status[1], samples[11]) << 4;
- dst++;
- *dst = adpcm_ima_compress_sample(&c->status[1], samples[13]);
- *dst |= adpcm_ima_compress_sample(&c->status[1], samples[15]) << 4;
- dst++;
- }
- samples += 8 * avctx->channels;
- }
- break;
- case CODEC_ID_ADPCM_MS:
- for(i=0; i<avctx->channels; i++){
- int predictor=0;
-
- *dst++ = predictor;
- c->status[i].coeff1 = AdaptCoeff1[predictor];
- c->status[i].coeff2 = AdaptCoeff2[predictor];
- }
- for(i=0; i<avctx->channels; i++){
- if (c->status[i].idelta < 16)
- c->status[i].idelta = 16;
-
- *dst++ = c->status[i].idelta & 0xFF;
- *dst++ = c->status[i].idelta >> 8;
- }
- for(i=0; i<avctx->channels; i++){
- c->status[i].sample1= *samples++;
-
- *dst++ = c->status[i].sample1 & 0xFF;
- *dst++ = c->status[i].sample1 >> 8;
- }
- for(i=0; i<avctx->channels; i++){
- c->status[i].sample2= *samples++;
-
- *dst++ = c->status[i].sample2 & 0xFF;
- *dst++ = c->status[i].sample2 >> 8;
- }
-
- if(avctx->trellis > 0) {
- int n = avctx->block_align - 7*avctx->channels;
- uint8_t buf[2][n];
- if(avctx->channels == 1) {
- n *= 2;
- adpcm_compress_trellis(avctx, samples, buf[0], &c->status[0], n);
- for(i=0; i<n; i+=2)
- *dst++ = (buf[0][i] << 4) | buf[0][i+1];
- } else {
- adpcm_compress_trellis(avctx, samples, buf[0], &c->status[0], n);
- adpcm_compress_trellis(avctx, samples+1, buf[1], &c->status[1], n);
- for(i=0; i<n; i++)
- *dst++ = (buf[0][i] << 4) | buf[1][i];
- }
- } else
- for(i=7*avctx->channels; i<avctx->block_align; i++) {
- int nibble;
- nibble = adpcm_ms_compress_sample(&c->status[ 0], *samples++)<<4;
- nibble|= adpcm_ms_compress_sample(&c->status[st], *samples++);
- *dst++ = nibble;
- }
- break;
- case CODEC_ID_ADPCM_YAMAHA:
- n = avctx->frame_size / 2;
- if(avctx->trellis > 0) {
- uint8_t buf[2][n*2];
- n *= 2;
- if(avctx->channels == 1) {
- adpcm_compress_trellis(avctx, samples, buf[0], &c->status[0], n);
- for(i=0; i<n; i+=2)
- *dst++ = buf[0][i] | (buf[0][i+1] << 4);
- } else {
- adpcm_compress_trellis(avctx, samples, buf[0], &c->status[0], n);
- adpcm_compress_trellis(avctx, samples+1, buf[1], &c->status[1], n);
- for(i=0; i<n; i++)
- *dst++ = buf[0][i] | (buf[1][i] << 4);
- }
- } else
- for (; n>0; n--) {
- for(i = 0; i < avctx->channels; i++) {
- int nibble;
- nibble = adpcm_yamaha_compress_sample(&c->status[i], samples[i]);
- nibble |= adpcm_yamaha_compress_sample(&c->status[i], samples[i+avctx->channels]) << 4;
- *dst++ = nibble;
- }
- samples += 2 * avctx->channels;
- }
- break;
- default:
- return -1;
- }
- return dst - frame;
-}
-#endif //CONFIG_ENCODERS
-
-static int adpcm_decode_init(AVCodecContext * avctx)
-{
- ADPCMContext *c = avctx->priv_data;
-
- c->channel = 0;
- c->status[0].predictor = c->status[1].predictor = 0;
- c->status[0].step_index = c->status[1].step_index = 0;
- c->status[0].step = c->status[1].step = 0;
-
- switch(avctx->codec->id) {
- case CODEC_ID_ADPCM_CT:
- c->status[0].step = c->status[1].step = 511;
- break;
- default:
- break;
- }
- return 0;
-}
-
-static inline short adpcm_ima_expand_nibble(ADPCMChannelStatus *c, char nibble, int shift)
-{
- int step_index;
- int predictor;
- int sign, delta, diff, step;
-
- step = step_table[c->step_index];
- step_index = c->step_index + index_table[(unsigned)nibble];
- if (step_index < 0) step_index = 0;
- else if (step_index > 88) step_index = 88;
-
- sign = nibble & 8;
- delta = nibble & 7;
- /* perform direct multiplication instead of series of jumps proposed by
- * the reference ADPCM implementation since modern CPUs can do the mults
- * quickly enough */
- diff = ((2 * delta + 1) * step) >> shift;
- predictor = c->predictor;
- if (sign) predictor -= diff;
- else predictor += diff;
-
- CLAMP_TO_SHORT(predictor);
- c->predictor = predictor;
- c->step_index = step_index;
-
- return (short)predictor;
-}
-
-static inline short adpcm_ms_expand_nibble(ADPCMChannelStatus *c, char nibble)
-{
- int predictor;
-
- predictor = (((c->sample1) * (c->coeff1)) + ((c->sample2) * (c->coeff2))) / 256;
- predictor += (signed)((nibble & 0x08)?(nibble - 0x10):(nibble)) * c->idelta;
- CLAMP_TO_SHORT(predictor);
-
- c->sample2 = c->sample1;
- c->sample1 = predictor;
- c->idelta = (AdaptationTable[(int)nibble] * c->idelta) >> 8;
- if (c->idelta < 16) c->idelta = 16;
-
- return (short)predictor;
-}
-
-static inline short adpcm_ct_expand_nibble(ADPCMChannelStatus *c, char nibble)
-{
- int predictor;
- int sign, delta, diff;
- int new_step;
-
- sign = nibble & 8;
- delta = nibble & 7;
- /* perform direct multiplication instead of series of jumps proposed by
- * the reference ADPCM implementation since modern CPUs can do the mults
- * quickly enough */
- diff = ((2 * delta + 1) * c->step) >> 3;
- predictor = c->predictor;
- /* predictor update is not so trivial: predictor is multiplied on 254/256 before updating */
- if(sign)
- predictor = ((predictor * 254) >> 8) - diff;
- else
- predictor = ((predictor * 254) >> 8) + diff;
- /* calculate new step and clamp it to range 511..32767 */
- new_step = (ct_adpcm_table[nibble & 7] * c->step) >> 8;
- c->step = new_step;
- if(c->step < 511)
- c->step = 511;
- if(c->step > 32767)
- c->step = 32767;
-
- CLAMP_TO_SHORT(predictor);
- c->predictor = predictor;
- return (short)predictor;
-}
-
-static inline short adpcm_sbpro_expand_nibble(ADPCMChannelStatus *c, char nibble, int size, int shift)
-{
- int sign, delta, diff;
-
- sign = nibble & (1<<(size-1));
- delta = nibble & ((1<<(size-1))-1);
- diff = delta << (7 + c->step + shift);
-
- if (sign)
- c->predictor -= diff;
- else
- c->predictor += diff;
-
- /* clamp result */
- if (c->predictor > 16256)
- c->predictor = 16256;
- else if (c->predictor < -16384)
- c->predictor = -16384;
-
- /* calculate new step */
- if (delta >= (2*size - 3) && c->step < 3)
- c->step++;
- else if (delta == 0 && c->step > 0)
- c->step--;
-
- return (short) c->predictor;
-}
-
-static inline short adpcm_yamaha_expand_nibble(ADPCMChannelStatus *c, unsigned char nibble)
-{
- if(!c->step) {
- c->predictor = 0;
- c->step = 127;
- }
-
- c->predictor += (c->step * yamaha_difflookup[nibble]) / 8;
- CLAMP_TO_SHORT(c->predictor);
- c->step = (c->step * yamaha_indexscale[nibble]) >> 8;
- c->step = clip(c->step, 127, 24567);
- return c->predictor;
-}
-
-static void xa_decode(short *out, const unsigned char *in,
- ADPCMChannelStatus *left, ADPCMChannelStatus *right, int inc)
-{
- int i, j;
- int shift,filter,f0,f1;
- int s_1,s_2;
- int d,s,t;
-
- for(i=0;i<4;i++) {
-
- shift = 12 - (in[4+i*2] & 15);
- filter = in[4+i*2] >> 4;
- f0 = xa_adpcm_table[filter][0];
- f1 = xa_adpcm_table[filter][1];
-
- s_1 = left->sample1;
- s_2 = left->sample2;
-
- for(j=0;j<28;j++) {
- d = in[16+i+j*4];
-
- t = (signed char)(d<<4)>>4;
- s = ( t<<shift ) + ((s_1*f0 + s_2*f1+32)>>6);
- CLAMP_TO_SHORT(s);
- *out = s;
- out += inc;
- s_2 = s_1;
- s_1 = s;
- }
-
- if (inc==2) { /* stereo */
- left->sample1 = s_1;
- left->sample2 = s_2;
- s_1 = right->sample1;
- s_2 = right->sample2;
- out = out + 1 - 28*2;
- }
-
- shift = 12 - (in[5+i*2] & 15);
- filter = in[5+i*2] >> 4;
-
- f0 = xa_adpcm_table[filter][0];
- f1 = xa_adpcm_table[filter][1];
-
- for(j=0;j<28;j++) {
- d = in[16+i+j*4];
-
- t = (signed char)d >> 4;
- s = ( t<<shift ) + ((s_1*f0 + s_2*f1+32)>>6);
- CLAMP_TO_SHORT(s);
- *out = s;
- out += inc;
- s_2 = s_1;
- s_1 = s;
- }
-
- if (inc==2) { /* stereo */
- right->sample1 = s_1;
- right->sample2 = s_2;
- out -= 1;
- } else {
- left->sample1 = s_1;
- left->sample2 = s_2;
- }
- }
-}
-
-
-/* DK3 ADPCM support macro */
-#define DK3_GET_NEXT_NIBBLE() \
- if (decode_top_nibble_next) \
- { \
- nibble = (last_byte >> 4) & 0x0F; \
- decode_top_nibble_next = 0; \
- } \
- else \
- { \
- last_byte = *src++; \
- if (src >= buf + buf_size) break; \
- nibble = last_byte & 0x0F; \
- decode_top_nibble_next = 1; \
- }
-
-static int adpcm_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- ADPCMContext *c = avctx->priv_data;
- ADPCMChannelStatus *cs;
- int n, m, channel, i;
- int block_predictor[2];
- short *samples;
- uint8_t *src;
- int st; /* stereo */
-
- /* DK3 ADPCM accounting variables */
- unsigned char last_byte = 0;
- unsigned char nibble;
- int decode_top_nibble_next = 0;
- int diff_channel;
-
- /* EA ADPCM state variables */
- uint32_t samples_in_chunk;
- int32_t previous_left_sample, previous_right_sample;
- int32_t current_left_sample, current_right_sample;
- int32_t next_left_sample, next_right_sample;
- int32_t coeff1l, coeff2l, coeff1r, coeff2r;
- uint8_t shift_left, shift_right;
- int count1, count2;
-
- if (!buf_size)
- return 0;
-
- samples = data;
- src = buf;
-
- st = avctx->channels == 2 ? 1 : 0;
-
- switch(avctx->codec->id) {
- case CODEC_ID_ADPCM_IMA_QT:
- n = (buf_size - 2);/* >> 2*avctx->channels;*/
- channel = c->channel;
- cs = &(c->status[channel]);
- /* (pppppp) (piiiiiii) */
-
- /* Bits 15-7 are the _top_ 9 bits of the 16-bit initial predictor value */
- cs->predictor = (*src++) << 8;
- cs->predictor |= (*src & 0x80);
- cs->predictor &= 0xFF80;
-
- /* sign extension */
- if(cs->predictor & 0x8000)
- cs->predictor -= 0x10000;
-
- CLAMP_TO_SHORT(cs->predictor);
-
- cs->step_index = (*src++) & 0x7F;
-
- if (cs->step_index > 88){
- av_log(avctx, AV_LOG_ERROR, "ERROR: step_index = %i\n", cs->step_index);
- cs->step_index = 88;
- }
-
- cs->step = step_table[cs->step_index];
-
- if (st && channel)
- samples++;
-
- for(m=32; n>0 && m>0; n--, m--) { /* in QuickTime, IMA is encoded by chuncks of 34 bytes (=64 samples) */
- *samples = adpcm_ima_expand_nibble(cs, src[0] & 0x0F, 3);
- samples += avctx->channels;
- *samples = adpcm_ima_expand_nibble(cs, (src[0] >> 4) & 0x0F, 3);
- samples += avctx->channels;
- src ++;
- }
-
- if(st) { /* handle stereo interlacing */
- c->channel = (channel + 1) % 2; /* we get one packet for left, then one for right data */
- if(channel == 1) { /* wait for the other packet before outputing anything */
- return src - buf;
- }
- }
- break;
- case CODEC_ID_ADPCM_IMA_WAV:
- if (avctx->block_align != 0 && buf_size > avctx->block_align)
- buf_size = avctx->block_align;
-
-// samples_per_block= (block_align-4*chanels)*8 / (bits_per_sample * chanels) + 1;
-
- for(i=0; i<avctx->channels; i++){
- cs = &(c->status[i]);
- cs->predictor = (int16_t)(src[0] + (src[1]<<8));
- src+=2;
-
- // XXX: is this correct ??: *samples++ = cs->predictor;
-
- cs->step_index = *src++;
- if (cs->step_index > 88){
- av_log(avctx, AV_LOG_ERROR, "ERROR: step_index = %i\n", cs->step_index);
- cs->step_index = 88;
- }
- if (*src++) av_log(avctx, AV_LOG_ERROR, "unused byte should be null but is %d!!\n", src[-1]); /* unused */
- }
-
- while(src < buf + buf_size){
- for(m=0; m<4; m++){
- for(i=0; i<=st; i++)
- *samples++ = adpcm_ima_expand_nibble(&c->status[i], src[4*i] & 0x0F, 3);
- for(i=0; i<=st; i++)
- *samples++ = adpcm_ima_expand_nibble(&c->status[i], src[4*i] >> 4 , 3);
- src++;
- }
- src += 4*st;
- }
- break;
- case CODEC_ID_ADPCM_4XM:
- cs = &(c->status[0]);
- c->status[0].predictor= (int16_t)(src[0] + (src[1]<<8)); src+=2;
- if(st){
- c->status[1].predictor= (int16_t)(src[0] + (src[1]<<8)); src+=2;
- }
- c->status[0].step_index= (int16_t)(src[0] + (src[1]<<8)); src+=2;
- if(st){
- c->status[1].step_index= (int16_t)(src[0] + (src[1]<<8)); src+=2;
- }
- if (cs->step_index < 0) cs->step_index = 0;
- if (cs->step_index > 88) cs->step_index = 88;
-
- m= (buf_size - (src - buf))>>st;
- for(i=0; i<m; i++) {
- *samples++ = adpcm_ima_expand_nibble(&c->status[0], src[i] & 0x0F, 4);
- if (st)
- *samples++ = adpcm_ima_expand_nibble(&c->status[1], src[i+m] & 0x0F, 4);
- *samples++ = adpcm_ima_expand_nibble(&c->status[0], src[i] >> 4, 4);
- if (st)
- *samples++ = adpcm_ima_expand_nibble(&c->status[1], src[i+m] >> 4, 4);
- }
-
- src += m<<st;
-
- break;
- case CODEC_ID_ADPCM_MS:
- if (avctx->block_align != 0 && buf_size > avctx->block_align)
- buf_size = avctx->block_align;
- n = buf_size - 7 * avctx->channels;
- if (n < 0)
- return -1;
- block_predictor[0] = clip(*src++, 0, 7);
- block_predictor[1] = 0;
- if (st)
- block_predictor[1] = clip(*src++, 0, 7);
- c->status[0].idelta = (int16_t)((*src & 0xFF) | ((src[1] << 8) & 0xFF00));
- src+=2;
- if (st){
- c->status[1].idelta = (int16_t)((*src & 0xFF) | ((src[1] << 8) & 0xFF00));
- src+=2;
- }
- c->status[0].coeff1 = AdaptCoeff1[block_predictor[0]];
- c->status[0].coeff2 = AdaptCoeff2[block_predictor[0]];
- c->status[1].coeff1 = AdaptCoeff1[block_predictor[1]];
- c->status[1].coeff2 = AdaptCoeff2[block_predictor[1]];
-
- c->status[0].sample1 = ((*src & 0xFF) | ((src[1] << 8) & 0xFF00));
- src+=2;
- if (st) c->status[1].sample1 = ((*src & 0xFF) | ((src[1] << 8) & 0xFF00));
- if (st) src+=2;
- c->status[0].sample2 = ((*src & 0xFF) | ((src[1] << 8) & 0xFF00));
- src+=2;
- if (st) c->status[1].sample2 = ((*src & 0xFF) | ((src[1] << 8) & 0xFF00));
- if (st) src+=2;
-
- *samples++ = c->status[0].sample1;
- if (st) *samples++ = c->status[1].sample1;
- *samples++ = c->status[0].sample2;
- if (st) *samples++ = c->status[1].sample2;
- for(;n>0;n--) {
- *samples++ = adpcm_ms_expand_nibble(&c->status[0], (src[0] >> 4) & 0x0F);
- *samples++ = adpcm_ms_expand_nibble(&c->status[st], src[0] & 0x0F);
- src ++;
- }
- break;
- case CODEC_ID_ADPCM_IMA_DK4:
- if (avctx->block_align != 0 && buf_size > avctx->block_align)
- buf_size = avctx->block_align;
-
- c->status[0].predictor = (int16_t)(src[0] | (src[1] << 8));
- c->status[0].step_index = src[2];
- src += 4;
- *samples++ = c->status[0].predictor;
- if (st) {
- c->status[1].predictor = (int16_t)(src[0] | (src[1] << 8));
- c->status[1].step_index = src[2];
- src += 4;
- *samples++ = c->status[1].predictor;
- }
- while (src < buf + buf_size) {
-
- /* take care of the top nibble (always left or mono channel) */
- *samples++ = adpcm_ima_expand_nibble(&c->status[0],
- (src[0] >> 4) & 0x0F, 3);
-
- /* take care of the bottom nibble, which is right sample for
- * stereo, or another mono sample */
- if (st)
- *samples++ = adpcm_ima_expand_nibble(&c->status[1],
- src[0] & 0x0F, 3);
- else
- *samples++ = adpcm_ima_expand_nibble(&c->status[0],
- src[0] & 0x0F, 3);
-
- src++;
- }
- break;
- case CODEC_ID_ADPCM_IMA_DK3:
- if (avctx->block_align != 0 && buf_size > avctx->block_align)
- buf_size = avctx->block_align;
-
- c->status[0].predictor = (int16_t)(src[10] | (src[11] << 8));
- c->status[1].predictor = (int16_t)(src[12] | (src[13] << 8));
- c->status[0].step_index = src[14];
- c->status[1].step_index = src[15];
- /* sign extend the predictors */
- src += 16;
- diff_channel = c->status[1].predictor;
-
- /* the DK3_GET_NEXT_NIBBLE macro issues the break statement when
- * the buffer is consumed */
- while (1) {
-
- /* for this algorithm, c->status[0] is the sum channel and
- * c->status[1] is the diff channel */
-
- /* process the first predictor of the sum channel */
- DK3_GET_NEXT_NIBBLE();
- adpcm_ima_expand_nibble(&c->status[0], nibble, 3);
-
- /* process the diff channel predictor */
- DK3_GET_NEXT_NIBBLE();
- adpcm_ima_expand_nibble(&c->status[1], nibble, 3);
-
- /* process the first pair of stereo PCM samples */
- diff_channel = (diff_channel + c->status[1].predictor) / 2;
- *samples++ = c->status[0].predictor + c->status[1].predictor;
- *samples++ = c->status[0].predictor - c->status[1].predictor;
-
- /* process the second predictor of the sum channel */
- DK3_GET_NEXT_NIBBLE();
- adpcm_ima_expand_nibble(&c->status[0], nibble, 3);
-
- /* process the second pair of stereo PCM samples */
- diff_channel = (diff_channel + c->status[1].predictor) / 2;
- *samples++ = c->status[0].predictor + c->status[1].predictor;
- *samples++ = c->status[0].predictor - c->status[1].predictor;
- }
- break;
- case CODEC_ID_ADPCM_IMA_WS:
- /* no per-block initialization; just start decoding the data */
- while (src < buf + buf_size) {
-
- if (st) {
- *samples++ = adpcm_ima_expand_nibble(&c->status[0],
- (src[0] >> 4) & 0x0F, 3);
- *samples++ = adpcm_ima_expand_nibble(&c->status[1],
- src[0] & 0x0F, 3);
- } else {
- *samples++ = adpcm_ima_expand_nibble(&c->status[0],
- (src[0] >> 4) & 0x0F, 3);
- *samples++ = adpcm_ima_expand_nibble(&c->status[0],
- src[0] & 0x0F, 3);
- }
-
- src++;
- }
- break;
- case CODEC_ID_ADPCM_XA:
- c->status[0].sample1 = c->status[0].sample2 =
- c->status[1].sample1 = c->status[1].sample2 = 0;
- while (buf_size >= 128) {
- xa_decode(samples, src, &c->status[0], &c->status[1],
- avctx->channels);
- src += 128;
- samples += 28 * 8;
- buf_size -= 128;
- }
- break;
- case CODEC_ID_ADPCM_EA:
- samples_in_chunk = AV_RL32(src);
- if (samples_in_chunk >= ((buf_size - 12) * 2)) {
- src += buf_size;
- break;
- }
- src += 4;
- current_left_sample = (int16_t)AV_RL16(src);
- src += 2;
- previous_left_sample = (int16_t)AV_RL16(src);
- src += 2;
- current_right_sample = (int16_t)AV_RL16(src);
- src += 2;
- previous_right_sample = (int16_t)AV_RL16(src);
- src += 2;
-
- for (count1 = 0; count1 < samples_in_chunk/28;count1++) {
- coeff1l = ea_adpcm_table[(*src >> 4) & 0x0F];
- coeff2l = ea_adpcm_table[((*src >> 4) & 0x0F) + 4];
- coeff1r = ea_adpcm_table[*src & 0x0F];
- coeff2r = ea_adpcm_table[(*src & 0x0F) + 4];
- src++;
-
- shift_left = ((*src >> 4) & 0x0F) + 8;
- shift_right = (*src & 0x0F) + 8;
- src++;
-
- for (count2 = 0; count2 < 28; count2++) {
- next_left_sample = (((*src & 0xF0) << 24) >> shift_left);
- next_right_sample = (((*src & 0x0F) << 28) >> shift_right);
- src++;
-
- next_left_sample = (next_left_sample +
- (current_left_sample * coeff1l) +
- (previous_left_sample * coeff2l) + 0x80) >> 8;
- next_right_sample = (next_right_sample +
- (current_right_sample * coeff1r) +
- (previous_right_sample * coeff2r) + 0x80) >> 8;
- CLAMP_TO_SHORT(next_left_sample);
- CLAMP_TO_SHORT(next_right_sample);
-
- previous_left_sample = current_left_sample;
- current_left_sample = next_left_sample;
- previous_right_sample = current_right_sample;
- current_right_sample = next_right_sample;
- *samples++ = (unsigned short)current_left_sample;
- *samples++ = (unsigned short)current_right_sample;
- }
- }
- break;
- case CODEC_ID_ADPCM_IMA_SMJPEG:
- c->status[0].predictor = *src;
- src += 2;
- c->status[0].step_index = *src++;
- src++; /* skip another byte before getting to the meat */
- while (src < buf + buf_size) {
- *samples++ = adpcm_ima_expand_nibble(&c->status[0],
- *src & 0x0F, 3);
- *samples++ = adpcm_ima_expand_nibble(&c->status[0],
- (*src >> 4) & 0x0F, 3);
- src++;
- }
- break;
- case CODEC_ID_ADPCM_CT:
- while (src < buf + buf_size) {
- if (st) {
- *samples++ = adpcm_ct_expand_nibble(&c->status[0],
- (src[0] >> 4) & 0x0F);
- *samples++ = adpcm_ct_expand_nibble(&c->status[1],
- src[0] & 0x0F);
- } else {
- *samples++ = adpcm_ct_expand_nibble(&c->status[0],
- (src[0] >> 4) & 0x0F);
- *samples++ = adpcm_ct_expand_nibble(&c->status[0],
- src[0] & 0x0F);
- }
- src++;
- }
- break;
- case CODEC_ID_ADPCM_SBPRO_4:
- case CODEC_ID_ADPCM_SBPRO_3:
- case CODEC_ID_ADPCM_SBPRO_2:
- if (!c->status[0].step_index) {
- /* the first byte is a raw sample */
- *samples++ = 128 * (*src++ - 0x80);
- if (st)
- *samples++ = 128 * (*src++ - 0x80);
- c->status[0].step_index = 1;
- }
- if (avctx->codec->id == CODEC_ID_ADPCM_SBPRO_4) {
- while (src < buf + buf_size) {
- *samples++ = adpcm_sbpro_expand_nibble(&c->status[0],
- (src[0] >> 4) & 0x0F, 4, 0);
- *samples++ = adpcm_sbpro_expand_nibble(&c->status[st],
- src[0] & 0x0F, 4, 0);
- src++;
- }
- } else if (avctx->codec->id == CODEC_ID_ADPCM_SBPRO_3) {
- while (src < buf + buf_size) {
- *samples++ = adpcm_sbpro_expand_nibble(&c->status[0],
- (src[0] >> 5) & 0x07, 3, 0);
- *samples++ = adpcm_sbpro_expand_nibble(&c->status[0],
- (src[0] >> 2) & 0x07, 3, 0);
- *samples++ = adpcm_sbpro_expand_nibble(&c->status[0],
- src[0] & 0x03, 2, 0);
- src++;
- }
- } else {
- while (src < buf + buf_size) {
- *samples++ = adpcm_sbpro_expand_nibble(&c->status[0],
- (src[0] >> 6) & 0x03, 2, 2);
- *samples++ = adpcm_sbpro_expand_nibble(&c->status[st],
- (src[0] >> 4) & 0x03, 2, 2);
- *samples++ = adpcm_sbpro_expand_nibble(&c->status[0],
- (src[0] >> 2) & 0x03, 2, 2);
- *samples++ = adpcm_sbpro_expand_nibble(&c->status[st],
- src[0] & 0x03, 2, 2);
- src++;
- }
- }
- break;
- case CODEC_ID_ADPCM_SWF:
- {
- GetBitContext gb;
- const int *table;
- int k0, signmask;
- int size = buf_size*8;
-
- init_get_bits(&gb, buf, size);
-
- // first frame, read bits & inital values
- if (!c->nb_bits)
- {
- c->nb_bits = get_bits(&gb, 2)+2;
-// av_log(NULL,AV_LOG_INFO,"nb_bits: %d\n", c->nb_bits);
- }
-
- table = swf_index_tables[c->nb_bits-2];
- k0 = 1 << (c->nb_bits-2);
- signmask = 1 << (c->nb_bits-1);
-
- while (get_bits_count(&gb) <= size)
- {
- int i;
-
- c->nb_samples++;
- // wrap around at every 4096 samples...
- if ((c->nb_samples & 0xfff) == 1)
- {
- for (i = 0; i <= st; i++)
- {
- *samples++ = c->status[i].predictor = get_sbits(&gb, 16);
- c->status[i].step_index = get_bits(&gb, 6);
- }
- }
-
- // similar to IMA adpcm
- for (i = 0; i <= st; i++)
- {
- int delta = get_bits(&gb, c->nb_bits);
- int step = step_table[c->status[i].step_index];
- long vpdiff = 0; // vpdiff = (delta+0.5)*step/4
- int k = k0;
-
- do {
- if (delta & k)
- vpdiff += step;
- step >>= 1;
- k >>= 1;
- } while(k);
- vpdiff += step;
-
- if (delta & signmask)
- c->status[i].predictor -= vpdiff;
- else
- c->status[i].predictor += vpdiff;
-
- c->status[i].step_index += table[delta & (~signmask)];
-
- c->status[i].step_index = clip(c->status[i].step_index, 0, 88);
- c->status[i].predictor = clip(c->status[i].predictor, -32768, 32767);
-
- *samples++ = c->status[i].predictor;
- }
- }
-
-// src += get_bits_count(&gb)*8;
- src += size;
-
- break;
- }
- case CODEC_ID_ADPCM_YAMAHA:
- while (src < buf + buf_size) {
- if (st) {
- *samples++ = adpcm_yamaha_expand_nibble(&c->status[0],
- src[0] & 0x0F);
- *samples++ = adpcm_yamaha_expand_nibble(&c->status[1],
- (src[0] >> 4) & 0x0F);
- } else {
- *samples++ = adpcm_yamaha_expand_nibble(&c->status[0],
- src[0] & 0x0F);
- *samples++ = adpcm_yamaha_expand_nibble(&c->status[0],
- (src[0] >> 4) & 0x0F);
- }
- src++;
- }
- break;
- default:
- return -1;
- }
- *data_size = (uint8_t *)samples - (uint8_t *)data;
- return src - buf;
-}
-
-
-
-#ifdef CONFIG_ENCODERS
-#define ADPCM_ENCODER(id,name) \
-AVCodec name ## _encoder = { \
- #name, \
- CODEC_TYPE_AUDIO, \
- id, \
- sizeof(ADPCMContext), \
- adpcm_encode_init, \
- adpcm_encode_frame, \
- adpcm_encode_close, \
- NULL, \
-};
-#else
-#define ADPCM_ENCODER(id,name)
-#endif
-
-#ifdef CONFIG_DECODERS
-#define ADPCM_DECODER(id,name) \
-AVCodec name ## _decoder = { \
- #name, \
- CODEC_TYPE_AUDIO, \
- id, \
- sizeof(ADPCMContext), \
- adpcm_decode_init, \
- NULL, \
- NULL, \
- adpcm_decode_frame, \
-};
-#else
-#define ADPCM_DECODER(id,name)
-#endif
-
-#define ADPCM_CODEC(id, name) \
-ADPCM_ENCODER(id,name) ADPCM_DECODER(id,name)
-
-ADPCM_CODEC(CODEC_ID_ADPCM_IMA_QT, adpcm_ima_qt);
-ADPCM_CODEC(CODEC_ID_ADPCM_IMA_WAV, adpcm_ima_wav);
-ADPCM_CODEC(CODEC_ID_ADPCM_IMA_DK3, adpcm_ima_dk3);
-ADPCM_CODEC(CODEC_ID_ADPCM_IMA_DK4, adpcm_ima_dk4);
-ADPCM_CODEC(CODEC_ID_ADPCM_IMA_WS, adpcm_ima_ws);
-ADPCM_CODEC(CODEC_ID_ADPCM_IMA_SMJPEG, adpcm_ima_smjpeg);
-ADPCM_CODEC(CODEC_ID_ADPCM_MS, adpcm_ms);
-ADPCM_CODEC(CODEC_ID_ADPCM_4XM, adpcm_4xm);
-ADPCM_CODEC(CODEC_ID_ADPCM_XA, adpcm_xa);
-ADPCM_CODEC(CODEC_ID_ADPCM_EA, adpcm_ea);
-ADPCM_CODEC(CODEC_ID_ADPCM_CT, adpcm_ct);
-ADPCM_CODEC(CODEC_ID_ADPCM_SWF, adpcm_swf);
-ADPCM_CODEC(CODEC_ID_ADPCM_YAMAHA, adpcm_yamaha);
-ADPCM_CODEC(CODEC_ID_ADPCM_SBPRO_4, adpcm_sbpro_4);
-ADPCM_CODEC(CODEC_ID_ADPCM_SBPRO_3, adpcm_sbpro_3);
-ADPCM_CODEC(CODEC_ID_ADPCM_SBPRO_2, adpcm_sbpro_2);
-
-#undef ADPCM_CODEC
diff --git a/src/libffmpeg/libavcodec/adx.c b/src/libffmpeg/libavcodec/adx.c
deleted file mode 100644
index b449c9124..000000000
--- a/src/libffmpeg/libavcodec/adx.c
+++ /dev/null
@@ -1,412 +0,0 @@
-/*
- * ADX ADPCM codecs
- * Copyright (c) 2001,2003 BERO
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "avcodec.h"
-
-/**
- * @file adx.c
- * SEGA CRI adx codecs.
- *
- * Reference documents:
- * http://ku-www.ss.titech.ac.jp/~yatsushi/adx.html
- * adx2wav & wav2adx http://www.geocities.co.jp/Playtown/2004/
- */
-
-typedef struct {
- int s1,s2;
-} PREV;
-
-typedef struct {
- PREV prev[2];
- int header_parsed;
- unsigned char dec_temp[18*2];
- unsigned short enc_temp[32*2];
- int in_temp;
-} ADXContext;
-
-//#define BASEVOL 0x11e0
-#define BASEVOL 0x4000
-#define SCALE1 0x7298
-#define SCALE2 0x3350
-
-#define CLIP(s) if (s>32767) s=32767; else if (s<-32768) s=-32768
-
-/* 18 bytes <-> 32 samples */
-
-#ifdef CONFIG_ENCODERS
-static void adx_encode(unsigned char *adx,const short *wav,PREV *prev)
-{
- int scale;
- int i;
- int s0,s1,s2,d;
- int max=0;
- int min=0;
- int data[32];
-
- s1 = prev->s1;
- s2 = prev->s2;
- for(i=0;i<32;i++) {
- s0 = wav[i];
- d = ((s0<<14) - SCALE1*s1 + SCALE2*s2)/BASEVOL;
- data[i]=d;
- if (max<d) max=d;
- if (min>d) min=d;
- s2 = s1;
- s1 = s0;
- }
- prev->s1 = s1;
- prev->s2 = s2;
-
- /* -8..+7 */
-
- if (max==0 && min==0) {
- memset(adx,0,18);
- return;
- }
-
- if (max/7>-min/8) scale = max/7;
- else scale = -min/8;
-
- if (scale==0) scale=1;
-
- adx[0] = scale>>8;
- adx[1] = scale;
-
- for(i=0;i<16;i++) {
- adx[i+2] = ((data[i*2]/scale)<<4) | ((data[i*2+1]/scale)&0xf);
- }
-}
-#endif //CONFIG_ENCODERS
-
-static void adx_decode(short *out,const unsigned char *in,PREV *prev)
-{
- int scale = ((in[0]<<8)|(in[1]));
- int i;
- int s0,s1,s2,d;
-
-// printf("%x ",scale);
-
- in+=2;
- s1 = prev->s1;
- s2 = prev->s2;
- for(i=0;i<16;i++) {
- d = in[i];
- // d>>=4; if (d&8) d-=16;
- d = ((signed char)d >> 4);
- s0 = (BASEVOL*d*scale + SCALE1*s1 - SCALE2*s2)>>14;
- CLIP(s0);
- *out++=s0;
- s2 = s1;
- s1 = s0;
-
- d = in[i];
- //d&=15; if (d&8) d-=16;
- d = ((signed char)(d<<4) >> 4);
- s0 = (BASEVOL*d*scale + SCALE1*s1 - SCALE2*s2)>>14;
- CLIP(s0);
- *out++=s0;
- s2 = s1;
- s1 = s0;
- }
- prev->s1 = s1;
- prev->s2 = s2;
-
-}
-
-static void adx_decode_stereo(short *out,const unsigned char *in,PREV *prev)
-{
- short tmp[32*2];
- int i;
-
- adx_decode(tmp ,in ,prev);
- adx_decode(tmp+32,in+18,prev+1);
- for(i=0;i<32;i++) {
- out[i*2] = tmp[i];
- out[i*2+1] = tmp[i+32];
- }
-}
-
-#ifdef CONFIG_ENCODERS
-
-static void write_long(unsigned char *p,uint32_t v)
-{
- p[0] = v>>24;
- p[1] = v>>16;
- p[2] = v>>8;
- p[3] = v;
-}
-
-static int adx_encode_header(AVCodecContext *avctx,unsigned char *buf,size_t bufsize)
-{
-#if 0
- struct {
- uint32_t offset; /* 0x80000000 + sample start - 4 */
- unsigned char unknown1[3]; /* 03 12 04 */
- unsigned char channel; /* 1 or 2 */
- uint32_t freq;
- uint32_t size;
- uint32_t unknown2; /* 01 f4 03 00 */
- uint32_t unknown3; /* 00 00 00 00 */
- uint32_t unknown4; /* 00 00 00 00 */
-
- /* if loop
- unknown3 00 15 00 01
- unknown4 00 00 00 01
- long loop_start_sample;
- long loop_start_byte;
- long loop_end_sample;
- long loop_end_byte;
- long
- */
- } adxhdr; /* big endian */
- /* offset-6 "(c)CRI" */
-#endif
- write_long(buf+0x00,0x80000000|0x20);
- write_long(buf+0x04,0x03120400|avctx->channels);
- write_long(buf+0x08,avctx->sample_rate);
- write_long(buf+0x0c,0); /* FIXME: set after */
- write_long(buf+0x10,0x01040300);
- write_long(buf+0x14,0x00000000);
- write_long(buf+0x18,0x00000000);
- memcpy(buf+0x1c,"\0\0(c)CRI",8);
- return 0x20+4;
-}
-
-static int adx_decode_init(AVCodecContext *avctx);
-static int adx_encode_init(AVCodecContext *avctx)
-{
- if (avctx->channels > 2)
- return -1; /* only stereo or mono =) */
- avctx->frame_size = 32;
-
- avctx->coded_frame= avcodec_alloc_frame();
- avctx->coded_frame->key_frame= 1;
-
-// avctx->bit_rate = avctx->sample_rate*avctx->channels*18*8/32;
-
- av_log(avctx, AV_LOG_DEBUG, "adx encode init\n");
- adx_decode_init(avctx);
-
- return 0;
-}
-
-static int adx_encode_close(AVCodecContext *avctx)
-{
- av_freep(&avctx->coded_frame);
-
- return 0;
-}
-
-static int adx_encode_frame(AVCodecContext *avctx,
- uint8_t *frame, int buf_size, void *data)
-{
- ADXContext *c = avctx->priv_data;
- const short *samples = data;
- unsigned char *dst = frame;
- int rest = avctx->frame_size;
-
-/*
- input data size =
- ffmpeg.c: do_audio_out()
- frame_bytes = enc->frame_size * 2 * enc->channels;
-*/
-
-// printf("sz=%d ",buf_size); fflush(stdout);
- if (!c->header_parsed) {
- int hdrsize = adx_encode_header(avctx,dst,buf_size);
- dst+=hdrsize;
- c->header_parsed = 1;
- }
-
- if (avctx->channels==1) {
- while(rest>=32) {
- adx_encode(dst,samples,c->prev);
- dst+=18;
- samples+=32;
- rest-=32;
- }
- } else {
- while(rest>=32*2) {
- short tmpbuf[32*2];
- int i;
-
- for(i=0;i<32;i++) {
- tmpbuf[i] = samples[i*2];
- tmpbuf[i+32] = samples[i*2+1];
- }
-
- adx_encode(dst,tmpbuf,c->prev);
- adx_encode(dst+18,tmpbuf+32,c->prev+1);
- dst+=18*2;
- samples+=32*2;
- rest-=32*2;
- }
- }
- return dst-frame;
-}
-
-#endif //CONFIG_ENCODERS
-
-static uint32_t read_long(const unsigned char *p)
-{
- return (p[0]<<24)|(p[1]<<16)|(p[2]<<8)|p[3];
-}
-
-static int is_adx(const unsigned char *buf,size_t bufsize)
-{
- int offset;
-
- if (buf[0]!=0x80) return 0;
- offset = (read_long(buf)^0x80000000)+4;
- if (bufsize<offset || memcmp(buf+offset-6,"(c)CRI",6)) return 0;
- return offset;
-}
-
-/* return data offset or 6 */
-static int adx_decode_header(AVCodecContext *avctx,const unsigned char *buf,size_t bufsize)
-{
- int offset;
- int channels,freq,size;
-
- offset = is_adx(buf,bufsize);
- if (offset==0) return 0;
-
- channels = buf[7];
- freq = read_long(buf+8);
- size = read_long(buf+12);
-
-// printf("freq=%d ch=%d\n",freq,channels);
-
- avctx->sample_rate = freq;
- avctx->channels = channels;
- avctx->bit_rate = freq*channels*18*8/32;
-// avctx->frame_size = 18*channels;
-
- return offset;
-}
-
-static int adx_decode_init(AVCodecContext * avctx)
-{
- ADXContext *c = avctx->priv_data;
-
-// printf("adx_decode_init\n"); fflush(stdout);
- c->prev[0].s1 = 0;
- c->prev[0].s2 = 0;
- c->prev[1].s1 = 0;
- c->prev[1].s2 = 0;
- c->header_parsed = 0;
- c->in_temp = 0;
- return 0;
-}
-
-#if 0
-static void dump(unsigned char *buf,size_t len)
-{
- int i;
- for(i=0;i<len;i++) {
- if ((i&15)==0) av_log(NULL, AV_LOG_DEBUG, "%04x ",i);
- av_log(NULL, AV_LOG_DEBUG, "%02x ",buf[i]);
- if ((i&15)==15) av_log(NULL, AV_LOG_DEBUG, "\n");
- }
- av_log(NULL, AV_LOG_ERROR, "\n");
-}
-#endif
-
-static int adx_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf0, int buf_size)
-{
- ADXContext *c = avctx->priv_data;
- short *samples = data;
- const uint8_t *buf = buf0;
- int rest = buf_size;
-
- if (!c->header_parsed) {
- int hdrsize = adx_decode_header(avctx,buf,rest);
- if (hdrsize==0) return -1;
- c->header_parsed = 1;
- buf += hdrsize;
- rest -= hdrsize;
- }
-
- if (c->in_temp) {
- int copysize = 18*avctx->channels - c->in_temp;
- memcpy(c->dec_temp+c->in_temp,buf,copysize);
- rest -= copysize;
- buf += copysize;
- if (avctx->channels==1) {
- adx_decode(samples,c->dec_temp,c->prev);
- samples += 32;
- } else {
- adx_decode_stereo(samples,c->dec_temp,c->prev);
- samples += 32*2;
- }
- }
- //
- if (avctx->channels==1) {
- while(rest>=18) {
- adx_decode(samples,buf,c->prev);
- rest-=18;
- buf+=18;
- samples+=32;
- }
- } else {
- while(rest>=18*2) {
- adx_decode_stereo(samples,buf,c->prev);
- rest-=18*2;
- buf+=18*2;
- samples+=32*2;
- }
- }
- //
- c->in_temp = rest;
- if (rest) {
- memcpy(c->dec_temp,buf,rest);
- buf+=rest;
- }
- *data_size = (uint8_t*)samples - (uint8_t*)data;
-// printf("%d:%d ",buf-buf0,*data_size); fflush(stdout);
- return buf-buf0;
-}
-
-#ifdef CONFIG_ENCODERS
-AVCodec adpcm_adx_encoder = {
- "adpcm_adx",
- CODEC_TYPE_AUDIO,
- CODEC_ID_ADPCM_ADX,
- sizeof(ADXContext),
- adx_encode_init,
- adx_encode_frame,
- adx_encode_close,
- NULL,
-};
-#endif //CONFIG_ENCODERS
-
-AVCodec adpcm_adx_decoder = {
- "adpcm_adx",
- CODEC_TYPE_AUDIO,
- CODEC_ID_ADPCM_ADX,
- sizeof(ADXContext),
- adx_decode_init,
- NULL,
- NULL,
- adx_decode_frame,
-};
-
diff --git a/src/libffmpeg/libavcodec/alac.c b/src/libffmpeg/libavcodec/alac.c
deleted file mode 100644
index cc87c81e5..000000000
--- a/src/libffmpeg/libavcodec/alac.c
+++ /dev/null
@@ -1,859 +0,0 @@
-/*
- * ALAC (Apple Lossless Audio Codec) decoder
- * Copyright (c) 2005 David Hammerton
- * All rights reserved.
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file alac.c
- * ALAC (Apple Lossless Audio Codec) decoder
- * @author 2005 David Hammerton
- *
- * For more information on the ALAC format, visit:
- * http://crazney.net/programs/itunes/alac.html
- *
- * Note: This decoder expects a 36- (0x24-)byte QuickTime atom to be
- * passed through the extradata[_size] fields. This atom is tacked onto
- * the end of an 'alac' stsd atom and has the following format:
- * bytes 0-3 atom size (0x24), big-endian
- * bytes 4-7 atom type ('alac', not the 'alac' tag from start of stsd)
- * bytes 8-35 data bytes needed by decoder
- *
- * Extradata:
- * 32bit size
- * 32bit tag (=alac)
- * 32bit zero?
- * 32bit max sample per frame
- * 8bit ?? (zero?)
- * 8bit sample size
- * 8bit history mult
- * 8bit initial history
- * 8bit kmodifier
- * 8bit channels?
- * 16bit ??
- * 32bit max coded frame size
- * 32bit bitrate?
- * 32bit samplerate
- */
-
-
-#include "avcodec.h"
-#include "bitstream.h"
-
-#define ALAC_EXTRADATA_SIZE 36
-
-typedef struct {
-
- AVCodecContext *avctx;
- GetBitContext gb;
- /* init to 0; first frame decode should initialize from extradata and
- * set this to 1 */
- int context_initialized;
-
- int samplesize;
- int numchannels;
- int bytespersample;
-
- /* buffers */
- int32_t *predicterror_buffer_a;
- int32_t *predicterror_buffer_b;
-
- int32_t *outputsamples_buffer_a;
- int32_t *outputsamples_buffer_b;
-
- /* stuff from setinfo */
- uint32_t setinfo_max_samples_per_frame; /* 0x1000 = 4096 */ /* max samples per frame? */
- uint8_t setinfo_7a; /* 0x00 */
- uint8_t setinfo_sample_size; /* 0x10 */
- uint8_t setinfo_rice_historymult; /* 0x28 */
- uint8_t setinfo_rice_initialhistory; /* 0x0a */
- uint8_t setinfo_rice_kmodifier; /* 0x0e */
- uint8_t setinfo_7f; /* 0x02 */
- uint16_t setinfo_80; /* 0x00ff */
- uint32_t setinfo_82; /* 0x000020e7 */
- uint32_t setinfo_86; /* 0x00069fe4 */
- uint32_t setinfo_8a_rate; /* 0x0000ac44 */
- /* end setinfo stuff */
-
-} ALACContext;
-
-static void allocate_buffers(ALACContext *alac)
-{
- alac->predicterror_buffer_a = av_malloc(alac->setinfo_max_samples_per_frame * 4);
- alac->predicterror_buffer_b = av_malloc(alac->setinfo_max_samples_per_frame * 4);
-
- alac->outputsamples_buffer_a = av_malloc(alac->setinfo_max_samples_per_frame * 4);
- alac->outputsamples_buffer_b = av_malloc(alac->setinfo_max_samples_per_frame * 4);
-}
-
-static int alac_set_info(ALACContext *alac)
-{
- unsigned char *ptr = alac->avctx->extradata;
-
- ptr += 4; /* size */
- ptr += 4; /* alac */
- ptr += 4; /* 0 ? */
-
- if(AV_RB32(ptr) >= UINT_MAX/4){
- av_log(alac->avctx, AV_LOG_ERROR, "setinfo_max_samples_per_frame too large\n");
- return -1;
- }
- alac->setinfo_max_samples_per_frame = AV_RB32(ptr); /* buffer size / 2 ? */
- ptr += 4;
- alac->setinfo_7a = *ptr++;
- alac->setinfo_sample_size = *ptr++;
- alac->setinfo_rice_historymult = *ptr++;
- alac->setinfo_rice_initialhistory = *ptr++;
- alac->setinfo_rice_kmodifier = *ptr++;
- alac->setinfo_7f = *ptr++; // channels?
- alac->setinfo_80 = AV_RB16(ptr);
- ptr += 2;
- alac->setinfo_82 = AV_RB32(ptr); // max coded frame size
- ptr += 4;
- alac->setinfo_86 = AV_RB32(ptr); // bitrate ?
- ptr += 4;
- alac->setinfo_8a_rate = AV_RB32(ptr); // samplerate
- ptr += 4;
-
- allocate_buffers(alac);
-
- return 0;
-}
-
-/* hideously inefficient. could use a bitmask search,
- * alternatively bsr on x86,
- */
-static int count_leading_zeros(int32_t input)
-{
- int i = 0;
- while (!(0x80000000 & input) && i < 32) {
- i++;
- input = input << 1;
- }
- return i;
-}
-
-static void bastardized_rice_decompress(ALACContext *alac,
- int32_t *output_buffer,
- int output_size,
- int readsamplesize, /* arg_10 */
- int rice_initialhistory, /* arg424->b */
- int rice_kmodifier, /* arg424->d */
- int rice_historymult, /* arg424->c */
- int rice_kmodifier_mask /* arg424->e */
- )
-{
- int output_count;
- unsigned int history = rice_initialhistory;
- int sign_modifier = 0;
-
- for (output_count = 0; output_count < output_size; output_count++) {
- int32_t x = 0;
- int32_t x_modified;
- int32_t final_val;
-
- /* read x - number of 1s before 0 represent the rice */
- while (x <= 8 && get_bits1(&alac->gb)) {
- x++;
- }
-
-
- if (x > 8) { /* RICE THRESHOLD */
- /* use alternative encoding */
- int32_t value;
-
- value = get_bits(&alac->gb, readsamplesize);
-
- /* mask value to readsamplesize size */
- if (readsamplesize != 32)
- value &= (0xffffffff >> (32 - readsamplesize));
-
- x = value;
- } else {
- /* standard rice encoding */
- int extrabits;
- int k; /* size of extra bits */
-
- /* read k, that is bits as is */
- k = 31 - rice_kmodifier - count_leading_zeros((history >> 9) + 3);
-
- if (k < 0)
- k += rice_kmodifier;
- else
- k = rice_kmodifier;
-
- if (k != 1) {
- extrabits = show_bits(&alac->gb, k);
-
- /* multiply x by 2^k - 1, as part of their strange algorithm */
- x = (x << k) - x;
-
- if (extrabits > 1) {
- x += extrabits - 1;
- get_bits(&alac->gb, k);
- } else {
- get_bits(&alac->gb, k - 1);
- }
- }
- }
-
- x_modified = sign_modifier + x;
- final_val = (x_modified + 1) / 2;
- if (x_modified & 1) final_val *= -1;
-
- output_buffer[output_count] = final_val;
-
- sign_modifier = 0;
-
- /* now update the history */
- history += (x_modified * rice_historymult)
- - ((history * rice_historymult) >> 9);
-
- if (x_modified > 0xffff)
- history = 0xffff;
-
- /* special case: there may be compressed blocks of 0 */
- if ((history < 128) && (output_count+1 < output_size)) {
- int block_size;
-
- sign_modifier = 1;
-
- x = 0;
- while (x <= 8 && get_bits1(&alac->gb)) {
- x++;
- }
-
- if (x > 8) {
- block_size = get_bits(&alac->gb, 16);
- block_size &= 0xffff;
- } else {
- int k;
- int extrabits;
-
- k = count_leading_zeros(history) + ((history + 16) >> 6 /* / 64 */) - 24;
-
- extrabits = show_bits(&alac->gb, k);
-
- block_size = (((1 << k) - 1) & rice_kmodifier_mask) * x
- + extrabits - 1;
-
- if (extrabits < 2) {
- x = 1 - extrabits;
- block_size += x;
- get_bits(&alac->gb, k - 1);
- } else {
- get_bits(&alac->gb, k);
- }
- }
-
- if (block_size > 0) {
- memset(&output_buffer[output_count+1], 0, block_size * 4);
- output_count += block_size;
-
- }
-
- if (block_size > 0xffff)
- sign_modifier = 0;
-
- history = 0;
- }
- }
-}
-
-#define SIGN_EXTENDED32(val, bits) ((val << (32 - bits)) >> (32 - bits))
-
-#define SIGN_ONLY(v) \
- ((v < 0) ? (-1) : \
- ((v > 0) ? (1) : \
- (0)))
-
-static void predictor_decompress_fir_adapt(int32_t *error_buffer,
- int32_t *buffer_out,
- int output_size,
- int readsamplesize,
- int16_t *predictor_coef_table,
- int predictor_coef_num,
- int predictor_quantitization)
-{
- int i;
-
- /* first sample always copies */
- *buffer_out = *error_buffer;
-
- if (!predictor_coef_num) {
- if (output_size <= 1) return;
- memcpy(buffer_out+1, error_buffer+1, (output_size-1) * 4);
- return;
- }
-
- if (predictor_coef_num == 0x1f) { /* 11111 - max value of predictor_coef_num */
- /* second-best case scenario for fir decompression,
- * error describes a small difference from the previous sample only
- */
- if (output_size <= 1) return;
- for (i = 0; i < output_size - 1; i++) {
- int32_t prev_value;
- int32_t error_value;
-
- prev_value = buffer_out[i];
- error_value = error_buffer[i+1];
- buffer_out[i+1] = SIGN_EXTENDED32((prev_value + error_value), readsamplesize);
- }
- return;
- }
-
- /* read warm-up samples */
- if (predictor_coef_num > 0) {
- int i;
- for (i = 0; i < predictor_coef_num; i++) {
- int32_t val;
-
- val = buffer_out[i] + error_buffer[i+1];
-
- val = SIGN_EXTENDED32(val, readsamplesize);
-
- buffer_out[i+1] = val;
- }
- }
-
-#if 0
- /* 4 and 8 are very common cases (the only ones i've seen). these
- * should be unrolled and optimised
- */
- if (predictor_coef_num == 4) {
- /* FIXME: optimised general case */
- return;
- }
-
- if (predictor_coef_table == 8) {
- /* FIXME: optimised general case */
- return;
- }
-#endif
-
-
- /* general case */
- if (predictor_coef_num > 0) {
- for (i = predictor_coef_num + 1;
- i < output_size;
- i++) {
- int j;
- int sum = 0;
- int outval;
- int error_val = error_buffer[i];
-
- for (j = 0; j < predictor_coef_num; j++) {
- sum += (buffer_out[predictor_coef_num-j] - buffer_out[0]) *
- predictor_coef_table[j];
- }
-
- outval = (1 << (predictor_quantitization-1)) + sum;
- outval = outval >> predictor_quantitization;
- outval = outval + buffer_out[0] + error_val;
- outval = SIGN_EXTENDED32(outval, readsamplesize);
-
- buffer_out[predictor_coef_num+1] = outval;
-
- if (error_val > 0) {
- int predictor_num = predictor_coef_num - 1;
-
- while (predictor_num >= 0 && error_val > 0) {
- int val = buffer_out[0] - buffer_out[predictor_coef_num - predictor_num];
- int sign = SIGN_ONLY(val);
-
- predictor_coef_table[predictor_num] -= sign;
-
- val *= sign; /* absolute value */
-
- error_val -= ((val >> predictor_quantitization) *
- (predictor_coef_num - predictor_num));
-
- predictor_num--;
- }
- } else if (error_val < 0) {
- int predictor_num = predictor_coef_num - 1;
-
- while (predictor_num >= 0 && error_val < 0) {
- int val = buffer_out[0] - buffer_out[predictor_coef_num - predictor_num];
- int sign = - SIGN_ONLY(val);
-
- predictor_coef_table[predictor_num] -= sign;
-
- val *= sign; /* neg value */
-
- error_val -= ((val >> predictor_quantitization) *
- (predictor_coef_num - predictor_num));
-
- predictor_num--;
- }
- }
-
- buffer_out++;
- }
- }
-}
-
-static void deinterlace_16(int32_t *buffer_a, int32_t *buffer_b,
- int16_t *buffer_out,
- int numchannels, int numsamples,
- uint8_t interlacing_shift,
- uint8_t interlacing_leftweight)
-{
- int i;
- if (numsamples <= 0) return;
-
- /* weighted interlacing */
- if (interlacing_leftweight) {
- for (i = 0; i < numsamples; i++) {
- int32_t difference, midright;
- int16_t left;
- int16_t right;
-
- midright = buffer_a[i];
- difference = buffer_b[i];
-
-
- right = midright - ((difference * interlacing_leftweight) >> interlacing_shift);
- left = (midright - ((difference * interlacing_leftweight) >> interlacing_shift))
- + difference;
-
- buffer_out[i*numchannels] = left;
- buffer_out[i*numchannels + 1] = right;
- }
-
- return;
- }
-
- /* otherwise basic interlacing took place */
- for (i = 0; i < numsamples; i++) {
- int16_t left, right;
-
- left = buffer_a[i];
- right = buffer_b[i];
-
- buffer_out[i*numchannels] = left;
- buffer_out[i*numchannels + 1] = right;
- }
-}
-
-static int alac_decode_frame(AVCodecContext *avctx,
- void *outbuffer, int *outputsize,
- uint8_t *inbuffer, int input_buffer_size)
-{
- ALACContext *alac = avctx->priv_data;
-
- int channels;
- int32_t outputsamples;
-
- /* short-circuit null buffers */
- if (!inbuffer || !input_buffer_size)
- return input_buffer_size;
-
- /* initialize from the extradata */
- if (!alac->context_initialized) {
- if (alac->avctx->extradata_size != ALAC_EXTRADATA_SIZE) {
- av_log(avctx, AV_LOG_ERROR, "alac: expected %d extradata bytes\n",
- ALAC_EXTRADATA_SIZE);
- return input_buffer_size;
- }
- if (alac_set_info(alac)) {
- av_log(avctx, AV_LOG_ERROR, "alac: set_info failed\n");
- return input_buffer_size;
- }
- alac->context_initialized = 1;
- }
-
- outputsamples = alac->setinfo_max_samples_per_frame;
-
- init_get_bits(&alac->gb, inbuffer, input_buffer_size * 8);
-
- channels = get_bits(&alac->gb, 3);
-
- *outputsize = outputsamples * alac->bytespersample;
-
- switch(channels) {
- case 0: { /* 1 channel */
- int hassize;
- int isnotcompressed;
- int readsamplesize;
-
- int wasted_bytes;
- int ricemodifier;
-
-
- /* 2^result = something to do with output waiting.
- * perhaps matters if we read > 1 frame in a pass?
- */
- get_bits(&alac->gb, 4);
-
- get_bits(&alac->gb, 12); /* unknown, skip 12 bits */
-
- hassize = get_bits(&alac->gb, 1); /* the output sample size is stored soon */
-
- wasted_bytes = get_bits(&alac->gb, 2); /* unknown ? */
-
- isnotcompressed = get_bits(&alac->gb, 1); /* whether the frame is compressed */
-
- if (hassize) {
- /* now read the number of samples,
- * as a 32bit integer */
- outputsamples = get_bits(&alac->gb, 32);
- *outputsize = outputsamples * alac->bytespersample;
- }
-
- readsamplesize = alac->setinfo_sample_size - (wasted_bytes * 8);
-
- if (!isnotcompressed) {
- /* so it is compressed */
- int16_t predictor_coef_table[32];
- int predictor_coef_num;
- int prediction_type;
- int prediction_quantitization;
- int i;
-
- /* FIXME: skip 16 bits, not sure what they are. seem to be used in
- * two channel case */
- get_bits(&alac->gb, 8);
- get_bits(&alac->gb, 8);
-
- prediction_type = get_bits(&alac->gb, 4);
- prediction_quantitization = get_bits(&alac->gb, 4);
-
- ricemodifier = get_bits(&alac->gb, 3);
- predictor_coef_num = get_bits(&alac->gb, 5);
-
- /* read the predictor table */
- for (i = 0; i < predictor_coef_num; i++) {
- predictor_coef_table[i] = (int16_t)get_bits(&alac->gb, 16);
- }
-
- if (wasted_bytes) {
- /* these bytes seem to have something to do with
- * > 2 channel files.
- */
- av_log(avctx, AV_LOG_ERROR, "FIXME: unimplemented, unhandling of wasted_bytes\n");
- }
-
- bastardized_rice_decompress(alac,
- alac->predicterror_buffer_a,
- outputsamples,
- readsamplesize,
- alac->setinfo_rice_initialhistory,
- alac->setinfo_rice_kmodifier,
- ricemodifier * alac->setinfo_rice_historymult / 4,
- (1 << alac->setinfo_rice_kmodifier) - 1);
-
- if (prediction_type == 0) {
- /* adaptive fir */
- predictor_decompress_fir_adapt(alac->predicterror_buffer_a,
- alac->outputsamples_buffer_a,
- outputsamples,
- readsamplesize,
- predictor_coef_table,
- predictor_coef_num,
- prediction_quantitization);
- } else {
- av_log(avctx, AV_LOG_ERROR, "FIXME: unhandled prediction type: %i\n", prediction_type);
- /* i think the only other prediction type (or perhaps this is just a
- * boolean?) runs adaptive fir twice.. like:
- * predictor_decompress_fir_adapt(predictor_error, tempout, ...)
- * predictor_decompress_fir_adapt(predictor_error, outputsamples ...)
- * little strange..
- */
- }
-
- } else {
- /* not compressed, easy case */
- if (readsamplesize <= 16) {
- int i;
- for (i = 0; i < outputsamples; i++) {
- int32_t audiobits = get_bits(&alac->gb, readsamplesize);
-
- audiobits = SIGN_EXTENDED32(audiobits, readsamplesize);
-
- alac->outputsamples_buffer_a[i] = audiobits;
- }
- } else {
- int i;
- for (i = 0; i < outputsamples; i++) {
- int32_t audiobits;
-
- audiobits = get_bits(&alac->gb, 16);
- /* special case of sign extension..
- * as we'll be ORing the low 16bits into this */
- audiobits = audiobits << 16;
- audiobits = audiobits >> (32 - readsamplesize);
-
- audiobits |= get_bits(&alac->gb, readsamplesize - 16);
-
- alac->outputsamples_buffer_a[i] = audiobits;
- }
- }
- /* wasted_bytes = 0; // unused */
- }
-
- switch(alac->setinfo_sample_size) {
- case 16: {
- int i;
- for (i = 0; i < outputsamples; i++) {
- int16_t sample = alac->outputsamples_buffer_a[i];
- ((int16_t*)outbuffer)[i * alac->numchannels] = sample;
- }
- break;
- }
- case 20:
- case 24:
- case 32:
- av_log(avctx, AV_LOG_ERROR, "FIXME: unimplemented sample size %i\n", alac->setinfo_sample_size);
- break;
- default:
- break;
- }
- break;
- }
- case 1: { /* 2 channels */
- int hassize;
- int isnotcompressed;
- int readsamplesize;
-
- int wasted_bytes;
-
- uint8_t interlacing_shift;
- uint8_t interlacing_leftweight;
-
- /* 2^result = something to do with output waiting.
- * perhaps matters if we read > 1 frame in a pass?
- */
- get_bits(&alac->gb, 4);
-
- get_bits(&alac->gb, 12); /* unknown, skip 12 bits */
-
- hassize = get_bits(&alac->gb, 1); /* the output sample size is stored soon */
-
- wasted_bytes = get_bits(&alac->gb, 2); /* unknown ? */
-
- isnotcompressed = get_bits(&alac->gb, 1); /* whether the frame is compressed */
-
- if (hassize) {
- /* now read the number of samples,
- * as a 32bit integer */
- outputsamples = get_bits(&alac->gb, 32);
- *outputsize = outputsamples * alac->bytespersample;
- }
-
- readsamplesize = alac->setinfo_sample_size - (wasted_bytes * 8) + 1;
-
- if (!isnotcompressed) {
- /* compressed */
- int16_t predictor_coef_table_a[32];
- int predictor_coef_num_a;
- int prediction_type_a;
- int prediction_quantitization_a;
- int ricemodifier_a;
-
- int16_t predictor_coef_table_b[32];
- int predictor_coef_num_b;
- int prediction_type_b;
- int prediction_quantitization_b;
- int ricemodifier_b;
-
- int i;
-
- interlacing_shift = get_bits(&alac->gb, 8);
- interlacing_leftweight = get_bits(&alac->gb, 8);
-
- /******** channel 1 ***********/
- prediction_type_a = get_bits(&alac->gb, 4);
- prediction_quantitization_a = get_bits(&alac->gb, 4);
-
- ricemodifier_a = get_bits(&alac->gb, 3);
- predictor_coef_num_a = get_bits(&alac->gb, 5);
-
- /* read the predictor table */
- for (i = 0; i < predictor_coef_num_a; i++) {
- predictor_coef_table_a[i] = (int16_t)get_bits(&alac->gb, 16);
- }
-
- /******** channel 2 *********/
- prediction_type_b = get_bits(&alac->gb, 4);
- prediction_quantitization_b = get_bits(&alac->gb, 4);
-
- ricemodifier_b = get_bits(&alac->gb, 3);
- predictor_coef_num_b = get_bits(&alac->gb, 5);
-
- /* read the predictor table */
- for (i = 0; i < predictor_coef_num_b; i++) {
- predictor_coef_table_b[i] = (int16_t)get_bits(&alac->gb, 16);
- }
-
- /*********************/
- if (wasted_bytes) {
- /* see mono case */
- av_log(avctx, AV_LOG_ERROR, "FIXME: unimplemented, unhandling of wasted_bytes\n");
- }
-
- /* channel 1 */
- bastardized_rice_decompress(alac,
- alac->predicterror_buffer_a,
- outputsamples,
- readsamplesize,
- alac->setinfo_rice_initialhistory,
- alac->setinfo_rice_kmodifier,
- ricemodifier_a * alac->setinfo_rice_historymult / 4,
- (1 << alac->setinfo_rice_kmodifier) - 1);
-
- if (prediction_type_a == 0) {
- /* adaptive fir */
- predictor_decompress_fir_adapt(alac->predicterror_buffer_a,
- alac->outputsamples_buffer_a,
- outputsamples,
- readsamplesize,
- predictor_coef_table_a,
- predictor_coef_num_a,
- prediction_quantitization_a);
- } else {
- /* see mono case */
- av_log(avctx, AV_LOG_ERROR, "FIXME: unhandled prediction type: %i\n", prediction_type_a);
- }
-
- /* channel 2 */
- bastardized_rice_decompress(alac,
- alac->predicterror_buffer_b,
- outputsamples,
- readsamplesize,
- alac->setinfo_rice_initialhistory,
- alac->setinfo_rice_kmodifier,
- ricemodifier_b * alac->setinfo_rice_historymult / 4,
- (1 << alac->setinfo_rice_kmodifier) - 1);
-
- if (prediction_type_b == 0) {
- /* adaptive fir */
- predictor_decompress_fir_adapt(alac->predicterror_buffer_b,
- alac->outputsamples_buffer_b,
- outputsamples,
- readsamplesize,
- predictor_coef_table_b,
- predictor_coef_num_b,
- prediction_quantitization_b);
- } else {
- av_log(avctx, AV_LOG_ERROR, "FIXME: unhandled prediction type: %i\n", prediction_type_b);
- }
- } else {
- /* not compressed, easy case */
- if (alac->setinfo_sample_size <= 16) {
- int i;
- for (i = 0; i < outputsamples; i++) {
- int32_t audiobits_a, audiobits_b;
-
- audiobits_a = get_bits(&alac->gb, alac->setinfo_sample_size);
- audiobits_b = get_bits(&alac->gb, alac->setinfo_sample_size);
-
- audiobits_a = SIGN_EXTENDED32(audiobits_a, alac->setinfo_sample_size);
- audiobits_b = SIGN_EXTENDED32(audiobits_b, alac->setinfo_sample_size);
-
- alac->outputsamples_buffer_a[i] = audiobits_a;
- alac->outputsamples_buffer_b[i] = audiobits_b;
- }
- } else {
- int i;
- for (i = 0; i < outputsamples; i++) {
- int32_t audiobits_a, audiobits_b;
-
- audiobits_a = get_bits(&alac->gb, 16);
- audiobits_a = audiobits_a << 16;
- audiobits_a = audiobits_a >> (32 - alac->setinfo_sample_size);
- audiobits_a |= get_bits(&alac->gb, alac->setinfo_sample_size - 16);
-
- audiobits_b = get_bits(&alac->gb, 16);
- audiobits_b = audiobits_b << 16;
- audiobits_b = audiobits_b >> (32 - alac->setinfo_sample_size);
- audiobits_b |= get_bits(&alac->gb, alac->setinfo_sample_size - 16);
-
- alac->outputsamples_buffer_a[i] = audiobits_a;
- alac->outputsamples_buffer_b[i] = audiobits_b;
- }
- }
- /* wasted_bytes = 0; */
- interlacing_shift = 0;
- interlacing_leftweight = 0;
- }
-
- switch(alac->setinfo_sample_size) {
- case 16: {
- deinterlace_16(alac->outputsamples_buffer_a,
- alac->outputsamples_buffer_b,
- (int16_t*)outbuffer,
- alac->numchannels,
- outputsamples,
- interlacing_shift,
- interlacing_leftweight);
- break;
- }
- case 20:
- case 24:
- case 32:
- av_log(avctx, AV_LOG_ERROR, "FIXME: unimplemented sample size %i\n", alac->setinfo_sample_size);
- break;
- default:
- break;
- }
-
- break;
- }
- }
-
- return input_buffer_size;
-}
-
-static int alac_decode_init(AVCodecContext * avctx)
-{
- ALACContext *alac = avctx->priv_data;
- alac->avctx = avctx;
- alac->context_initialized = 0;
-
- alac->samplesize = alac->avctx->bits_per_sample;
- alac->numchannels = alac->avctx->channels;
- alac->bytespersample = (alac->samplesize / 8) * alac->numchannels;
-
- return 0;
-}
-
-static int alac_decode_close(AVCodecContext *avctx)
-{
- ALACContext *alac = avctx->priv_data;
-
- av_free(alac->predicterror_buffer_a);
- av_free(alac->predicterror_buffer_b);
-
- av_free(alac->outputsamples_buffer_a);
- av_free(alac->outputsamples_buffer_b);
-
- return 0;
-}
-
-AVCodec alac_decoder = {
- "alac",
- CODEC_TYPE_AUDIO,
- CODEC_ID_ALAC,
- sizeof(ALACContext),
- alac_decode_init,
- NULL,
- alac_decode_close,
- alac_decode_frame,
-};
diff --git a/src/libffmpeg/libavcodec/alpha/Makefile.am b/src/libffmpeg/libavcodec/alpha/Makefile.am
deleted file mode 100644
index c69106ad3..000000000
--- a/src/libffmpeg/libavcodec/alpha/Makefile.am
+++ /dev/null
@@ -1,13 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-AM_CPPFLAGS = $(LIBFFMPEG_CPPFLAGS)
-AM_CFLAGS = -fno-strict-aliasing
-
-EXTRA_DIST = asm.h \
- dsputil_alpha.c \
- mpegvideo_alpha.c \
- motion_est_alpha.c \
- motion_est_mvi_asm.S \
- regdef.h \
- dsputil_alpha_asm.S \
- simple_idct_alpha.c
diff --git a/src/libffmpeg/libavcodec/alpha/asm.h b/src/libffmpeg/libavcodec/alpha/asm.h
deleted file mode 100644
index c0ddde528..000000000
--- a/src/libffmpeg/libavcodec/alpha/asm.h
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Alpha optimized DSP utils
- * Copyright (c) 2002 Falk Hueffner <falk@debian.org>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef LIBAVCODEC_ALPHA_ASM_H
-#define LIBAVCODEC_ALPHA_ASM_H
-
-#include <inttypes.h>
-
-#if defined __GNUC__
-# define GNUC_PREREQ(maj, min) \
- ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
-#else
-# define GNUC_PREREQ(maj, min) 0
-#endif
-
-#if GNUC_PREREQ(2,96)
-# define likely(x) __builtin_expect((x) != 0, 1)
-# define unlikely(x) __builtin_expect((x) != 0, 0)
-#else
-# define likely(x) (x)
-# define unlikely(x) (x)
-#endif
-
-#define AMASK_BWX (1 << 0)
-#define AMASK_FIX (1 << 1)
-#define AMASK_CIX (1 << 2)
-#define AMASK_MVI (1 << 8)
-
-static inline uint64_t BYTE_VEC(uint64_t x)
-{
- x |= x << 8;
- x |= x << 16;
- x |= x << 32;
- return x;
-}
-static inline uint64_t WORD_VEC(uint64_t x)
-{
- x |= x << 16;
- x |= x << 32;
- return x;
-}
-
-#define sextw(x) ((int16_t) (x))
-
-#ifdef __GNUC__
-#define ldq(p) \
- (((union { \
- uint64_t __l; \
- __typeof__(*(p)) __s[sizeof (uint64_t) / sizeof *(p)]; \
- } *) (p))->__l)
-#define ldl(p) \
- (((union { \
- int32_t __l; \
- __typeof__(*(p)) __s[sizeof (int32_t) / sizeof *(p)]; \
- } *) (p))->__l)
-#define stq(l, p) \
- do { \
- (((union { \
- uint64_t __l; \
- __typeof__(*(p)) __s[sizeof (uint64_t) / sizeof *(p)]; \
- } *) (p))->__l) = l; \
- } while (0)
-#define stl(l, p) \
- do { \
- (((union { \
- int32_t __l; \
- __typeof__(*(p)) __s[sizeof (int32_t) / sizeof *(p)]; \
- } *) (p))->__l) = l; \
- } while (0)
-struct unaligned_long { uint64_t l; } __attribute__((packed));
-#define ldq_u(p) (*(const uint64_t *) (((uint64_t) (p)) & ~7ul))
-#define uldq(a) (((const struct unaligned_long *) (a))->l)
-
-#if GNUC_PREREQ(3,3)
-#define prefetch(p) __builtin_prefetch((p), 0, 1)
-#define prefetch_en(p) __builtin_prefetch((p), 0, 0)
-#define prefetch_m(p) __builtin_prefetch((p), 1, 1)
-#define prefetch_men(p) __builtin_prefetch((p), 1, 0)
-#define cmpbge __builtin_alpha_cmpbge
-/* Avoid warnings. */
-#define extql(a, b) __builtin_alpha_extql(a, (uint64_t) (b))
-#define extwl(a, b) __builtin_alpha_extwl(a, (uint64_t) (b))
-#define extqh(a, b) __builtin_alpha_extqh(a, (uint64_t) (b))
-#define zap __builtin_alpha_zap
-#define zapnot __builtin_alpha_zapnot
-#define amask __builtin_alpha_amask
-#define implver __builtin_alpha_implver
-#define rpcc __builtin_alpha_rpcc
-#else
-#define prefetch(p) asm volatile("ldl $31,%0" : : "m"(*(const char *) (p)) : "memory")
-#define prefetch_en(p) asm volatile("ldq $31,%0" : : "m"(*(const char *) (p)) : "memory")
-#define prefetch_m(p) asm volatile("lds $f31,%0" : : "m"(*(const char *) (p)) : "memory")
-#define prefetch_men(p) asm volatile("ldt $f31,%0" : : "m"(*(const char *) (p)) : "memory")
-#define cmpbge(a, b) ({ uint64_t __r; asm ("cmpbge %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
-#define extql(a, b) ({ uint64_t __r; asm ("extql %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
-#define extwl(a, b) ({ uint64_t __r; asm ("extwl %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
-#define extqh(a, b) ({ uint64_t __r; asm ("extqh %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
-#define zap(a, b) ({ uint64_t __r; asm ("zap %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
-#define zapnot(a, b) ({ uint64_t __r; asm ("zapnot %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
-#define amask(a) ({ uint64_t __r; asm ("amask %1,%0" : "=r" (__r) : "rI" (a)); __r; })
-#define implver() ({ uint64_t __r; asm ("implver %0" : "=r" (__r)); __r; })
-#define rpcc() ({ uint64_t __r; asm volatile ("rpcc %0" : "=r" (__r)); __r; })
-#endif
-#define wh64(p) asm volatile("wh64 (%0)" : : "r"(p) : "memory")
-
-#if GNUC_PREREQ(3,3) && defined(__alpha_max__)
-#define minub8 __builtin_alpha_minub8
-#define minsb8 __builtin_alpha_minsb8
-#define minuw4 __builtin_alpha_minuw4
-#define minsw4 __builtin_alpha_minsw4
-#define maxub8 __builtin_alpha_maxub8
-#define maxsb8 __builtin_alpha_maxsb8
-#define maxuw4 __builtin_alpha_maxuw4
-#define maxsw4 __builtin_alpha_maxsw4
-#define perr __builtin_alpha_perr
-#define pklb __builtin_alpha_pklb
-#define pkwb __builtin_alpha_pkwb
-#define unpkbl __builtin_alpha_unpkbl
-#define unpkbw __builtin_alpha_unpkbw
-#else
-#define minub8(a, b) ({ uint64_t __r; asm (".arch ev6; minub8 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
-#define minsb8(a, b) ({ uint64_t __r; asm (".arch ev6; minsb8 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
-#define minuw4(a, b) ({ uint64_t __r; asm (".arch ev6; minuw4 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
-#define minsw4(a, b) ({ uint64_t __r; asm (".arch ev6; minsw4 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
-#define maxub8(a, b) ({ uint64_t __r; asm (".arch ev6; maxub8 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
-#define maxsb8(a, b) ({ uint64_t __r; asm (".arch ev6; maxsb8 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
-#define maxuw4(a, b) ({ uint64_t __r; asm (".arch ev6; maxuw4 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
-#define maxsw4(a, b) ({ uint64_t __r; asm (".arch ev6; maxsw4 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
-#define perr(a, b) ({ uint64_t __r; asm (".arch ev6; perr %r1,%r2,%0" : "=r" (__r) : "%rJ" (a), "rJ" (b)); __r; })
-#define pklb(a) ({ uint64_t __r; asm (".arch ev6; pklb %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
-#define pkwb(a) ({ uint64_t __r; asm (".arch ev6; pkwb %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
-#define unpkbl(a) ({ uint64_t __r; asm (".arch ev6; unpkbl %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
-#define unpkbw(a) ({ uint64_t __r; asm (".arch ev6; unpkbw %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
-#endif
-
-#elif defined(__DECC) /* Digital/Compaq/hp "ccc" compiler */
-
-#include <c_asm.h>
-#define ldq(p) (*(const uint64_t *) (p))
-#define ldl(p) (*(const int32_t *) (p))
-#define stq(l, p) do { *(uint64_t *) (p) = (l); } while (0)
-#define stl(l, p) do { *(int32_t *) (p) = (l); } while (0)
-#define ldq_u(a) asm ("ldq_u %v0,0(%a0)", a)
-#define uldq(a) (*(const __unaligned uint64_t *) (a))
-#define cmpbge(a, b) asm ("cmpbge %a0,%a1,%v0", a, b)
-#define extql(a, b) asm ("extql %a0,%a1,%v0", a, b)
-#define extwl(a, b) asm ("extwl %a0,%a1,%v0", a, b)
-#define extqh(a, b) asm ("extqh %a0,%a1,%v0", a, b)
-#define zap(a, b) asm ("zap %a0,%a1,%v0", a, b)
-#define zapnot(a, b) asm ("zapnot %a0,%a1,%v0", a, b)
-#define amask(a) asm ("amask %a0,%v0", a)
-#define implver() asm ("implver %v0")
-#define rpcc() asm ("rpcc %v0")
-#define minub8(a, b) asm ("minub8 %a0,%a1,%v0", a, b)
-#define minsb8(a, b) asm ("minsb8 %a0,%a1,%v0", a, b)
-#define minuw4(a, b) asm ("minuw4 %a0,%a1,%v0", a, b)
-#define minsw4(a, b) asm ("minsw4 %a0,%a1,%v0", a, b)
-#define maxub8(a, b) asm ("maxub8 %a0,%a1,%v0", a, b)
-#define maxsb8(a, b) asm ("maxsb8 %a0,%a1,%v0", a, b)
-#define maxuw4(a, b) asm ("maxuw4 %a0,%a1,%v0", a, b)
-#define maxsw4(a, b) asm ("maxsw4 %a0,%a1,%v0", a, b)
-#define perr(a, b) asm ("perr %a0,%a1,%v0", a, b)
-#define pklb(a) asm ("pklb %a0,%v0", a)
-#define pkwb(a) asm ("pkwb %a0,%v0", a)
-#define unpkbl(a) asm ("unpkbl %a0,%v0", a)
-#define unpkbw(a) asm ("unpkbw %a0,%v0", a)
-#define wh64(a) asm ("wh64 %a0", a)
-
-#else
-#error "Unknown compiler!"
-#endif
-
-#endif /* LIBAVCODEC_ALPHA_ASM_H */
diff --git a/src/libffmpeg/libavcodec/alpha/dsputil_alpha.c b/src/libffmpeg/libavcodec/alpha/dsputil_alpha.c
deleted file mode 100644
index c98d6f7ff..000000000
--- a/src/libffmpeg/libavcodec/alpha/dsputil_alpha.c
+++ /dev/null
@@ -1,362 +0,0 @@
-/*
- * Alpha optimized DSP utils
- * Copyright (c) 2002 Falk Hueffner <falk@debian.org>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "asm.h"
-#include "../dsputil.h"
-
-extern void simple_idct_axp(DCTELEM *block);
-extern void simple_idct_put_axp(uint8_t *dest, int line_size, DCTELEM *block);
-extern void simple_idct_add_axp(uint8_t *dest, int line_size, DCTELEM *block);
-
-void put_pixels_axp_asm(uint8_t *block, const uint8_t *pixels,
- int line_size, int h);
-void put_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels,
- int line_size);
-void add_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels,
- int line_size);
-void (*put_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels,
- int line_size);
-void (*add_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels,
- int line_size);
-
-void get_pixels_mvi(DCTELEM *restrict block,
- const uint8_t *restrict pixels, int line_size);
-void diff_pixels_mvi(DCTELEM *block, const uint8_t *s1, const uint8_t *s2,
- int stride);
-int pix_abs8x8_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h);
-int pix_abs16x16_mvi_asm(uint8_t *pix1, uint8_t *pix2, int line_size);
-int pix_abs16x16_x2_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h);
-int pix_abs16x16_y2_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h);
-int pix_abs16x16_xy2_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h);
-
-#if 0
-/* These functions were the base for the optimized assembler routines,
- and remain here for documentation purposes. */
-static void put_pixels_clamped_mvi(const DCTELEM *block, uint8_t *pixels,
- int line_size)
-{
- int i = 8;
- uint64_t clampmask = zap(-1, 0xaa); /* 0x00ff00ff00ff00ff */
-
- do {
- uint64_t shorts0, shorts1;
-
- shorts0 = ldq(block);
- shorts0 = maxsw4(shorts0, 0);
- shorts0 = minsw4(shorts0, clampmask);
- stl(pkwb(shorts0), pixels);
-
- shorts1 = ldq(block + 4);
- shorts1 = maxsw4(shorts1, 0);
- shorts1 = minsw4(shorts1, clampmask);
- stl(pkwb(shorts1), pixels + 4);
-
- pixels += line_size;
- block += 8;
- } while (--i);
-}
-
-void add_pixels_clamped_mvi(const DCTELEM *block, uint8_t *pixels,
- int line_size)
-{
- int h = 8;
- /* Keep this function a leaf function by generating the constants
- manually (mainly for the hack value ;-). */
- uint64_t clampmask = zap(-1, 0xaa); /* 0x00ff00ff00ff00ff */
- uint64_t signmask = zap(-1, 0x33);
- signmask ^= signmask >> 1; /* 0x8000800080008000 */
-
- do {
- uint64_t shorts0, pix0, signs0;
- uint64_t shorts1, pix1, signs1;
-
- shorts0 = ldq(block);
- shorts1 = ldq(block + 4);
-
- pix0 = unpkbw(ldl(pixels));
- /* Signed subword add (MMX paddw). */
- signs0 = shorts0 & signmask;
- shorts0 &= ~signmask;
- shorts0 += pix0;
- shorts0 ^= signs0;
- /* Clamp. */
- shorts0 = maxsw4(shorts0, 0);
- shorts0 = minsw4(shorts0, clampmask);
-
- /* Next 4. */
- pix1 = unpkbw(ldl(pixels + 4));
- signs1 = shorts1 & signmask;
- shorts1 &= ~signmask;
- shorts1 += pix1;
- shorts1 ^= signs1;
- shorts1 = maxsw4(shorts1, 0);
- shorts1 = minsw4(shorts1, clampmask);
-
- stl(pkwb(shorts0), pixels);
- stl(pkwb(shorts1), pixels + 4);
-
- pixels += line_size;
- block += 8;
- } while (--h);
-}
-#endif
-
-static void clear_blocks_axp(DCTELEM *blocks) {
- uint64_t *p = (uint64_t *) blocks;
- int n = sizeof(DCTELEM) * 6 * 64;
-
- do {
- p[0] = 0;
- p[1] = 0;
- p[2] = 0;
- p[3] = 0;
- p[4] = 0;
- p[5] = 0;
- p[6] = 0;
- p[7] = 0;
- p += 8;
- n -= 8 * 8;
- } while (n);
-}
-
-static inline uint64_t avg2_no_rnd(uint64_t a, uint64_t b)
-{
- return (a & b) + (((a ^ b) & BYTE_VEC(0xfe)) >> 1);
-}
-
-static inline uint64_t avg2(uint64_t a, uint64_t b)
-{
- return (a | b) - (((a ^ b) & BYTE_VEC(0xfe)) >> 1);
-}
-
-#if 0
-/* The XY2 routines basically utilize this scheme, but reuse parts in
- each iteration. */
-static inline uint64_t avg4(uint64_t l1, uint64_t l2, uint64_t l3, uint64_t l4)
-{
- uint64_t r1 = ((l1 & ~BYTE_VEC(0x03)) >> 2)
- + ((l2 & ~BYTE_VEC(0x03)) >> 2)
- + ((l3 & ~BYTE_VEC(0x03)) >> 2)
- + ((l4 & ~BYTE_VEC(0x03)) >> 2);
- uint64_t r2 = (( (l1 & BYTE_VEC(0x03))
- + (l2 & BYTE_VEC(0x03))
- + (l3 & BYTE_VEC(0x03))
- + (l4 & BYTE_VEC(0x03))
- + BYTE_VEC(0x02)) >> 2) & BYTE_VEC(0x03);
- return r1 + r2;
-}
-#endif
-
-#define OP(LOAD, STORE) \
- do { \
- STORE(LOAD(pixels), block); \
- pixels += line_size; \
- block += line_size; \
- } while (--h)
-
-#define OP_X2(LOAD, STORE) \
- do { \
- uint64_t pix1, pix2; \
- \
- pix1 = LOAD(pixels); \
- pix2 = pix1 >> 8 | ((uint64_t) pixels[8] << 56); \
- STORE(AVG2(pix1, pix2), block); \
- pixels += line_size; \
- block += line_size; \
- } while (--h)
-
-#define OP_Y2(LOAD, STORE) \
- do { \
- uint64_t pix = LOAD(pixels); \
- do { \
- uint64_t next_pix; \
- \
- pixels += line_size; \
- next_pix = LOAD(pixels); \
- STORE(AVG2(pix, next_pix), block); \
- block += line_size; \
- pix = next_pix; \
- } while (--h); \
- } while (0)
-
-#define OP_XY2(LOAD, STORE) \
- do { \
- uint64_t pix1 = LOAD(pixels); \
- uint64_t pix2 = pix1 >> 8 | ((uint64_t) pixels[8] << 56); \
- uint64_t pix_l = (pix1 & BYTE_VEC(0x03)) \
- + (pix2 & BYTE_VEC(0x03)); \
- uint64_t pix_h = ((pix1 & ~BYTE_VEC(0x03)) >> 2) \
- + ((pix2 & ~BYTE_VEC(0x03)) >> 2); \
- \
- do { \
- uint64_t npix1, npix2; \
- uint64_t npix_l, npix_h; \
- uint64_t avg; \
- \
- pixels += line_size; \
- npix1 = LOAD(pixels); \
- npix2 = npix1 >> 8 | ((uint64_t) pixels[8] << 56); \
- npix_l = (npix1 & BYTE_VEC(0x03)) \
- + (npix2 & BYTE_VEC(0x03)); \
- npix_h = ((npix1 & ~BYTE_VEC(0x03)) >> 2) \
- + ((npix2 & ~BYTE_VEC(0x03)) >> 2); \
- avg = (((pix_l + npix_l + AVG4_ROUNDER) >> 2) & BYTE_VEC(0x03)) \
- + pix_h + npix_h; \
- STORE(avg, block); \
- \
- block += line_size; \
- pix_l = npix_l; \
- pix_h = npix_h; \
- } while (--h); \
- } while (0)
-
-#define MAKE_OP(OPNAME, SUFF, OPKIND, STORE) \
-static void OPNAME ## _pixels ## SUFF ## _axp \
- (uint8_t *restrict block, const uint8_t *restrict pixels, \
- int line_size, int h) \
-{ \
- if ((size_t) pixels & 0x7) { \
- OPKIND(uldq, STORE); \
- } else { \
- OPKIND(ldq, STORE); \
- } \
-} \
- \
-static void OPNAME ## _pixels16 ## SUFF ## _axp \
- (uint8_t *restrict block, const uint8_t *restrict pixels, \
- int line_size, int h) \
-{ \
- OPNAME ## _pixels ## SUFF ## _axp(block, pixels, line_size, h); \
- OPNAME ## _pixels ## SUFF ## _axp(block + 8, pixels + 8, line_size, h); \
-}
-
-#define PIXOP(OPNAME, STORE) \
- MAKE_OP(OPNAME, , OP, STORE) \
- MAKE_OP(OPNAME, _x2, OP_X2, STORE) \
- MAKE_OP(OPNAME, _y2, OP_Y2, STORE) \
- MAKE_OP(OPNAME, _xy2, OP_XY2, STORE)
-
-/* Rounding primitives. */
-#define AVG2 avg2
-#define AVG4 avg4
-#define AVG4_ROUNDER BYTE_VEC(0x02)
-#define STORE(l, b) stq(l, b)
-PIXOP(put, STORE);
-
-#undef STORE
-#define STORE(l, b) stq(AVG2(l, ldq(b)), b);
-PIXOP(avg, STORE);
-
-/* Not rounding primitives. */
-#undef AVG2
-#undef AVG4
-#undef AVG4_ROUNDER
-#undef STORE
-#define AVG2 avg2_no_rnd
-#define AVG4 avg4_no_rnd
-#define AVG4_ROUNDER BYTE_VEC(0x01)
-#define STORE(l, b) stq(l, b)
-PIXOP(put_no_rnd, STORE);
-
-#undef STORE
-#define STORE(l, b) stq(AVG2(l, ldq(b)), b);
-PIXOP(avg_no_rnd, STORE);
-
-void put_pixels16_axp_asm(uint8_t *block, const uint8_t *pixels,
- int line_size, int h)
-{
- put_pixels_axp_asm(block, pixels, line_size, h);
- put_pixels_axp_asm(block + 8, pixels + 8, line_size, h);
-}
-
-static int sad16x16_mvi(void *s, uint8_t *a, uint8_t *b, int stride)
-{
- return pix_abs16x16_mvi_asm(a, b, stride);
-}
-
-void dsputil_init_alpha(DSPContext* c, AVCodecContext *avctx)
-{
- c->put_pixels_tab[0][0] = put_pixels16_axp_asm;
- c->put_pixels_tab[0][1] = put_pixels16_x2_axp;
- c->put_pixels_tab[0][2] = put_pixels16_y2_axp;
- c->put_pixels_tab[0][3] = put_pixels16_xy2_axp;
-
- c->put_no_rnd_pixels_tab[0][0] = put_pixels16_axp_asm;
- c->put_no_rnd_pixels_tab[0][1] = put_no_rnd_pixels16_x2_axp;
- c->put_no_rnd_pixels_tab[0][2] = put_no_rnd_pixels16_y2_axp;
- c->put_no_rnd_pixels_tab[0][3] = put_no_rnd_pixels16_xy2_axp;
-
- c->avg_pixels_tab[0][0] = avg_pixels16_axp;
- c->avg_pixels_tab[0][1] = avg_pixels16_x2_axp;
- c->avg_pixels_tab[0][2] = avg_pixels16_y2_axp;
- c->avg_pixels_tab[0][3] = avg_pixels16_xy2_axp;
-
- c->avg_no_rnd_pixels_tab[0][0] = avg_no_rnd_pixels16_axp;
- c->avg_no_rnd_pixels_tab[0][1] = avg_no_rnd_pixels16_x2_axp;
- c->avg_no_rnd_pixels_tab[0][2] = avg_no_rnd_pixels16_y2_axp;
- c->avg_no_rnd_pixels_tab[0][3] = avg_no_rnd_pixels16_xy2_axp;
-
- c->put_pixels_tab[1][0] = put_pixels_axp_asm;
- c->put_pixels_tab[1][1] = put_pixels_x2_axp;
- c->put_pixels_tab[1][2] = put_pixels_y2_axp;
- c->put_pixels_tab[1][3] = put_pixels_xy2_axp;
-
- c->put_no_rnd_pixels_tab[1][0] = put_pixels_axp_asm;
- c->put_no_rnd_pixels_tab[1][1] = put_no_rnd_pixels_x2_axp;
- c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels_y2_axp;
- c->put_no_rnd_pixels_tab[1][3] = put_no_rnd_pixels_xy2_axp;
-
- c->avg_pixels_tab[1][0] = avg_pixels_axp;
- c->avg_pixels_tab[1][1] = avg_pixels_x2_axp;
- c->avg_pixels_tab[1][2] = avg_pixels_y2_axp;
- c->avg_pixels_tab[1][3] = avg_pixels_xy2_axp;
-
- c->avg_no_rnd_pixels_tab[1][0] = avg_no_rnd_pixels_axp;
- c->avg_no_rnd_pixels_tab[1][1] = avg_no_rnd_pixels_x2_axp;
- c->avg_no_rnd_pixels_tab[1][2] = avg_no_rnd_pixels_y2_axp;
- c->avg_no_rnd_pixels_tab[1][3] = avg_no_rnd_pixels_xy2_axp;
-
- c->clear_blocks = clear_blocks_axp;
-
- /* amask clears all bits that correspond to present features. */
- if (amask(AMASK_MVI) == 0) {
- c->put_pixels_clamped = put_pixels_clamped_mvi_asm;
- c->add_pixels_clamped = add_pixels_clamped_mvi_asm;
-
- c->get_pixels = get_pixels_mvi;
- c->diff_pixels = diff_pixels_mvi;
- c->sad[0] = sad16x16_mvi;
- c->sad[1] = pix_abs8x8_mvi;
-// c->pix_abs[0][0] = pix_abs16x16_mvi_asm; //FIXME function arguments for the asm must be fixed
- c->pix_abs[0][0] = sad16x16_mvi;
- c->pix_abs[1][0] = pix_abs8x8_mvi;
- c->pix_abs[0][1] = pix_abs16x16_x2_mvi;
- c->pix_abs[0][2] = pix_abs16x16_y2_mvi;
- c->pix_abs[0][3] = pix_abs16x16_xy2_mvi;
- }
-
- put_pixels_clamped_axp_p = c->put_pixels_clamped;
- add_pixels_clamped_axp_p = c->add_pixels_clamped;
-
- c->idct_put = simple_idct_put_axp;
- c->idct_add = simple_idct_add_axp;
- c->idct = simple_idct_axp;
-}
diff --git a/src/libffmpeg/libavcodec/alpha/dsputil_alpha_asm.S b/src/libffmpeg/libavcodec/alpha/dsputil_alpha_asm.S
deleted file mode 100644
index 367f2d743..000000000
--- a/src/libffmpeg/libavcodec/alpha/dsputil_alpha_asm.S
+++ /dev/null
@@ -1,285 +0,0 @@
-/*
- * Alpha optimized DSP utils
- * Copyright (c) 2002 Falk Hueffner <falk@debian.org>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
- * These functions are scheduled for pca56. They should work
- * reasonably on ev6, though.
- */
-
-#include "regdef.h"
-
-/* Some nicer register names. */
-#define ta t10
-#define tb t11
-#define tc t12
-#define td AT
-/* Danger: these overlap with the argument list and the return value */
-#define te a5
-#define tf a4
-#define tg a3
-#define th v0
-
- .set noat
- .set noreorder
- .arch pca56
- .text
-
-/************************************************************************
- * void put_pixels_axp_asm(uint8_t *block, const uint8_t *pixels,
- * int line_size, int h)
- */
- .align 6
- .globl put_pixels_axp_asm
- .ent put_pixels_axp_asm
-put_pixels_axp_asm:
- .frame sp, 0, ra
- .prologue 0
-
-#ifdef HAVE_GPROF
- lda AT, _mcount
- jsr AT, (AT), _mcount
-#endif
-
- and a1, 7, t0
- beq t0, $aligned
-
- .align 4
-$unaligned:
- ldq_u t0, 0(a1)
- ldq_u t1, 8(a1)
- addq a1, a2, a1
- nop
-
- ldq_u t2, 0(a1)
- ldq_u t3, 8(a1)
- addq a1, a2, a1
- nop
-
- ldq_u t4, 0(a1)
- ldq_u t5, 8(a1)
- addq a1, a2, a1
- nop
-
- ldq_u t6, 0(a1)
- ldq_u t7, 8(a1)
- extql t0, a1, t0
- addq a1, a2, a1
-
- extqh t1, a1, t1
- addq a0, a2, t8
- extql t2, a1, t2
- addq t8, a2, t9
-
- extqh t3, a1, t3
- addq t9, a2, ta
- extql t4, a1, t4
- or t0, t1, t0
-
- extqh t5, a1, t5
- or t2, t3, t2
- extql t6, a1, t6
- or t4, t5, t4
-
- extqh t7, a1, t7
- or t6, t7, t6
- stq t0, 0(a0)
- stq t2, 0(t8)
-
- stq t4, 0(t9)
- subq a3, 4, a3
- stq t6, 0(ta)
- addq ta, a2, a0
-
- bne a3, $unaligned
- ret
-
- .align 4
-$aligned:
- ldq t0, 0(a1)
- addq a1, a2, a1
- ldq t1, 0(a1)
- addq a1, a2, a1
-
- ldq t2, 0(a1)
- addq a1, a2, a1
- ldq t3, 0(a1)
-
- addq a0, a2, t4
- addq a1, a2, a1
- addq t4, a2, t5
- subq a3, 4, a3
-
- stq t0, 0(a0)
- addq t5, a2, t6
- stq t1, 0(t4)
- addq t6, a2, a0
-
- stq t2, 0(t5)
- stq t3, 0(t6)
-
- bne a3, $aligned
- ret
- .end put_pixels_axp_asm
-
-/************************************************************************
- * void put_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels,
- * int line_size)
- */
- .align 6
- .globl put_pixels_clamped_mvi_asm
- .ent put_pixels_clamped_mvi_asm
-put_pixels_clamped_mvi_asm:
- .frame sp, 0, ra
- .prologue 0
-
-#ifdef HAVE_GPROF
- lda AT, _mcount
- jsr AT, (AT), _mcount
-#endif
-
- lda t8, -1
- lda t9, 8 # loop counter
- zap t8, 0xaa, t8 # 00ff00ff00ff00ff
-
- .align 4
-1: ldq t0, 0(a0)
- ldq t1, 8(a0)
- ldq t2, 16(a0)
- ldq t3, 24(a0)
-
- maxsw4 t0, zero, t0
- subq t9, 2, t9
- maxsw4 t1, zero, t1
- lda a0, 32(a0)
-
- maxsw4 t2, zero, t2
- addq a1, a2, ta
- maxsw4 t3, zero, t3
- minsw4 t0, t8, t0
-
- minsw4 t1, t8, t1
- minsw4 t2, t8, t2
- minsw4 t3, t8, t3
- pkwb t0, t0
-
- pkwb t1, t1
- pkwb t2, t2
- pkwb t3, t3
- stl t0, 0(a1)
-
- stl t1, 4(a1)
- addq ta, a2, a1
- stl t2, 0(ta)
- stl t3, 4(ta)
-
- bne t9, 1b
- ret
- .end put_pixels_clamped_mvi_asm
-
-/************************************************************************
- * void add_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels,
- * int line_size)
- */
- .align 6
- .globl add_pixels_clamped_mvi_asm
- .ent add_pixels_clamped_mvi_asm
-add_pixels_clamped_mvi_asm:
- .frame sp, 0, ra
- .prologue 0
-
-#ifdef HAVE_GPROF
- lda AT, _mcount
- jsr AT, (AT), _mcount
-#endif
-
- lda t1, -1
- lda th, 8
- zap t1, 0x33, tg
- nop
-
- srl tg, 1, t0
- xor tg, t0, tg # 0x8000800080008000
- zap t1, 0xaa, tf # 0x00ff00ff00ff00ff
-
- .align 4
-1: ldl t1, 0(a1) # pix0 (try to hit cache line soon)
- ldl t4, 4(a1) # pix1
- addq a1, a2, te # pixels += line_size
- ldq t0, 0(a0) # shorts0
-
- ldl t7, 0(te) # pix2 (try to hit cache line soon)
- ldl ta, 4(te) # pix3
- ldq t3, 8(a0) # shorts1
- ldq t6, 16(a0) # shorts2
-
- ldq t9, 24(a0) # shorts3
- unpkbw t1, t1 # 0 0 (quarter/op no.)
- and t0, tg, t2 # 0 1
- unpkbw t4, t4 # 1 0
-
- bic t0, tg, t0 # 0 2
- unpkbw t7, t7 # 2 0
- and t3, tg, t5 # 1 1
- addq t0, t1, t0 # 0 3
-
- xor t0, t2, t0 # 0 4
- unpkbw ta, ta # 3 0
- and t6, tg, t8 # 2 1
- maxsw4 t0, zero, t0 # 0 5
-
- bic t3, tg, t3 # 1 2
- bic t6, tg, t6 # 2 2
- minsw4 t0, tf, t0 # 0 6
- addq t3, t4, t3 # 1 3
-
- pkwb t0, t0 # 0 7
- xor t3, t5, t3 # 1 4
- maxsw4 t3, zero, t3 # 1 5
- addq t6, t7, t6 # 2 3
-
- xor t6, t8, t6 # 2 4
- and t9, tg, tb # 3 1
- minsw4 t3, tf, t3 # 1 6
- bic t9, tg, t9 # 3 2
-
- maxsw4 t6, zero, t6 # 2 5
- addq t9, ta, t9 # 3 3
- stl t0, 0(a1) # 0 8
- minsw4 t6, tf, t6 # 2 6
-
- xor t9, tb, t9 # 3 4
- maxsw4 t9, zero, t9 # 3 5
- lda a0, 32(a0) # block += 16;
- pkwb t3, t3 # 1 7
-
- minsw4 t9, tf, t9 # 3 6
- subq th, 2, th
- pkwb t6, t6 # 2 7
- pkwb t9, t9 # 3 7
-
- stl t3, 4(a1) # 1 8
- addq te, a2, a1 # pixels += line_size
- stl t6, 0(te) # 2 8
- stl t9, 4(te) # 3 8
-
- bne th, 1b
- ret
- .end add_pixels_clamped_mvi_asm
diff --git a/src/libffmpeg/libavcodec/alpha/motion_est_alpha.c b/src/libffmpeg/libavcodec/alpha/motion_est_alpha.c
deleted file mode 100644
index 337ffb38e..000000000
--- a/src/libffmpeg/libavcodec/alpha/motion_est_alpha.c
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- * Alpha optimized DSP utils
- * Copyright (c) 2002 Falk Hueffner <falk@debian.org>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "asm.h"
-#include "../dsputil.h"
-
-void get_pixels_mvi(DCTELEM *restrict block,
- const uint8_t *restrict pixels, int line_size)
-{
- int h = 8;
-
- do {
- uint64_t p;
-
- p = ldq(pixels);
- stq(unpkbw(p), block);
- stq(unpkbw(p >> 32), block + 4);
-
- pixels += line_size;
- block += 8;
- } while (--h);
-}
-
-void diff_pixels_mvi(DCTELEM *block, const uint8_t *s1, const uint8_t *s2,
- int stride) {
- int h = 8;
- uint64_t mask = 0x4040;
-
- mask |= mask << 16;
- mask |= mask << 32;
- do {
- uint64_t x, y, c, d, a;
- uint64_t signs;
-
- x = ldq(s1);
- y = ldq(s2);
- c = cmpbge(x, y);
- d = x - y;
- a = zap(mask, c); /* We use 0x4040404040404040 here... */
- d += 4 * a; /* ...so we can use s4addq here. */
- signs = zap(-1, c);
-
- stq(unpkbw(d) | (unpkbw(signs) << 8), block);
- stq(unpkbw(d >> 32) | (unpkbw(signs >> 32) << 8), block + 4);
-
- s1 += stride;
- s2 += stride;
- block += 8;
- } while (--h);
-}
-
-static inline uint64_t avg2(uint64_t a, uint64_t b)
-{
- return (a | b) - (((a ^ b) & BYTE_VEC(0xfe)) >> 1);
-}
-
-static inline uint64_t avg4(uint64_t l1, uint64_t l2, uint64_t l3, uint64_t l4)
-{
- uint64_t r1 = ((l1 & ~BYTE_VEC(0x03)) >> 2)
- + ((l2 & ~BYTE_VEC(0x03)) >> 2)
- + ((l3 & ~BYTE_VEC(0x03)) >> 2)
- + ((l4 & ~BYTE_VEC(0x03)) >> 2);
- uint64_t r2 = (( (l1 & BYTE_VEC(0x03))
- + (l2 & BYTE_VEC(0x03))
- + (l3 & BYTE_VEC(0x03))
- + (l4 & BYTE_VEC(0x03))
- + BYTE_VEC(0x02)) >> 2) & BYTE_VEC(0x03);
- return r1 + r2;
-}
-
-int pix_abs8x8_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
- int result = 0;
-
- if ((size_t) pix2 & 0x7) {
- /* works only when pix2 is actually unaligned */
- do { /* do 8 pixel a time */
- uint64_t p1, p2;
-
- p1 = ldq(pix1);
- p2 = uldq(pix2);
- result += perr(p1, p2);
-
- pix1 += line_size;
- pix2 += line_size;
- } while (--h);
- } else {
- do {
- uint64_t p1, p2;
-
- p1 = ldq(pix1);
- p2 = ldq(pix2);
- result += perr(p1, p2);
-
- pix1 += line_size;
- pix2 += line_size;
- } while (--h);
- }
-
- return result;
-}
-
-#if 0 /* now done in assembly */
-int pix_abs16x16_mvi(uint8_t *pix1, uint8_t *pix2, int line_size)
-{
- int result = 0;
- int h = 16;
-
- if ((size_t) pix2 & 0x7) {
- /* works only when pix2 is actually unaligned */
- do { /* do 16 pixel a time */
- uint64_t p1_l, p1_r, p2_l, p2_r;
- uint64_t t;
-
- p1_l = ldq(pix1);
- p1_r = ldq(pix1 + 8);
- t = ldq_u(pix2 + 8);
- p2_l = extql(ldq_u(pix2), pix2) | extqh(t, pix2);
- p2_r = extql(t, pix2) | extqh(ldq_u(pix2 + 16), pix2);
- pix1 += line_size;
- pix2 += line_size;
-
- result += perr(p1_l, p2_l)
- + perr(p1_r, p2_r);
- } while (--h);
- } else {
- do {
- uint64_t p1_l, p1_r, p2_l, p2_r;
-
- p1_l = ldq(pix1);
- p1_r = ldq(pix1 + 8);
- p2_l = ldq(pix2);
- p2_r = ldq(pix2 + 8);
- pix1 += line_size;
- pix2 += line_size;
-
- result += perr(p1_l, p2_l)
- + perr(p1_r, p2_r);
- } while (--h);
- }
-
- return result;
-}
-#endif
-
-int pix_abs16x16_x2_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
- int result = 0;
- uint64_t disalign = (size_t) pix2 & 0x7;
-
- switch (disalign) {
- case 0:
- do {
- uint64_t p1_l, p1_r, p2_l, p2_r;
- uint64_t l, r;
-
- p1_l = ldq(pix1);
- p1_r = ldq(pix1 + 8);
- l = ldq(pix2);
- r = ldq(pix2 + 8);
- p2_l = avg2(l, (l >> 8) | ((uint64_t) r << 56));
- p2_r = avg2(r, (r >> 8) | ((uint64_t) pix2[16] << 56));
- pix1 += line_size;
- pix2 += line_size;
-
- result += perr(p1_l, p2_l)
- + perr(p1_r, p2_r);
- } while (--h);
- break;
- case 7:
- /* |.......l|lllllllr|rrrrrrr*|
- This case is special because disalign1 would be 8, which
- gets treated as 0 by extqh. At least it is a bit faster
- that way :) */
- do {
- uint64_t p1_l, p1_r, p2_l, p2_r;
- uint64_t l, m, r;
-
- p1_l = ldq(pix1);
- p1_r = ldq(pix1 + 8);
- l = ldq_u(pix2);
- m = ldq_u(pix2 + 8);
- r = ldq_u(pix2 + 16);
- p2_l = avg2(extql(l, disalign) | extqh(m, disalign), m);
- p2_r = avg2(extql(m, disalign) | extqh(r, disalign), r);
- pix1 += line_size;
- pix2 += line_size;
-
- result += perr(p1_l, p2_l)
- + perr(p1_r, p2_r);
- } while (--h);
- break;
- default:
- do {
- uint64_t disalign1 = disalign + 1;
- uint64_t p1_l, p1_r, p2_l, p2_r;
- uint64_t l, m, r;
-
- p1_l = ldq(pix1);
- p1_r = ldq(pix1 + 8);
- l = ldq_u(pix2);
- m = ldq_u(pix2 + 8);
- r = ldq_u(pix2 + 16);
- p2_l = avg2(extql(l, disalign) | extqh(m, disalign),
- extql(l, disalign1) | extqh(m, disalign1));
- p2_r = avg2(extql(m, disalign) | extqh(r, disalign),
- extql(m, disalign1) | extqh(r, disalign1));
- pix1 += line_size;
- pix2 += line_size;
-
- result += perr(p1_l, p2_l)
- + perr(p1_r, p2_r);
- } while (--h);
- break;
- }
- return result;
-}
-
-int pix_abs16x16_y2_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
- int result = 0;
-
- if ((size_t) pix2 & 0x7) {
- uint64_t t, p2_l, p2_r;
- t = ldq_u(pix2 + 8);
- p2_l = extql(ldq_u(pix2), pix2) | extqh(t, pix2);
- p2_r = extql(t, pix2) | extqh(ldq_u(pix2 + 16), pix2);
-
- do {
- uint64_t p1_l, p1_r, np2_l, np2_r;
- uint64_t t;
-
- p1_l = ldq(pix1);
- p1_r = ldq(pix1 + 8);
- pix2 += line_size;
- t = ldq_u(pix2 + 8);
- np2_l = extql(ldq_u(pix2), pix2) | extqh(t, pix2);
- np2_r = extql(t, pix2) | extqh(ldq_u(pix2 + 16), pix2);
-
- result += perr(p1_l, avg2(p2_l, np2_l))
- + perr(p1_r, avg2(p2_r, np2_r));
-
- pix1 += line_size;
- p2_l = np2_l;
- p2_r = np2_r;
-
- } while (--h);
- } else {
- uint64_t p2_l, p2_r;
- p2_l = ldq(pix2);
- p2_r = ldq(pix2 + 8);
- do {
- uint64_t p1_l, p1_r, np2_l, np2_r;
-
- p1_l = ldq(pix1);
- p1_r = ldq(pix1 + 8);
- pix2 += line_size;
- np2_l = ldq(pix2);
- np2_r = ldq(pix2 + 8);
-
- result += perr(p1_l, avg2(p2_l, np2_l))
- + perr(p1_r, avg2(p2_r, np2_r));
-
- pix1 += line_size;
- p2_l = np2_l;
- p2_r = np2_r;
- } while (--h);
- }
- return result;
-}
-
-int pix_abs16x16_xy2_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
- int result = 0;
-
- uint64_t p1_l, p1_r;
- uint64_t p2_l, p2_r, p2_x;
-
- p1_l = ldq(pix1);
- p1_r = ldq(pix1 + 8);
-
- if ((size_t) pix2 & 0x7) { /* could be optimized a lot */
- p2_l = uldq(pix2);
- p2_r = uldq(pix2 + 8);
- p2_x = (uint64_t) pix2[16] << 56;
- } else {
- p2_l = ldq(pix2);
- p2_r = ldq(pix2 + 8);
- p2_x = ldq(pix2 + 16) << 56;
- }
-
- do {
- uint64_t np1_l, np1_r;
- uint64_t np2_l, np2_r, np2_x;
-
- pix1 += line_size;
- pix2 += line_size;
-
- np1_l = ldq(pix1);
- np1_r = ldq(pix1 + 8);
-
- if ((size_t) pix2 & 0x7) { /* could be optimized a lot */
- np2_l = uldq(pix2);
- np2_r = uldq(pix2 + 8);
- np2_x = (uint64_t) pix2[16] << 56;
- } else {
- np2_l = ldq(pix2);
- np2_r = ldq(pix2 + 8);
- np2_x = ldq(pix2 + 16) << 56;
- }
-
- result += perr(p1_l,
- avg4( p2_l, ( p2_l >> 8) | ((uint64_t) p2_r << 56),
- np2_l, (np2_l >> 8) | ((uint64_t) np2_r << 56)))
- + perr(p1_r,
- avg4( p2_r, ( p2_r >> 8) | ((uint64_t) p2_x),
- np2_r, (np2_r >> 8) | ((uint64_t) np2_x)));
-
- p1_l = np1_l;
- p1_r = np1_r;
- p2_l = np2_l;
- p2_r = np2_r;
- p2_x = np2_x;
- } while (--h);
-
- return result;
-}
diff --git a/src/libffmpeg/libavcodec/alpha/motion_est_mvi_asm.S b/src/libffmpeg/libavcodec/alpha/motion_est_mvi_asm.S
deleted file mode 100644
index 6015a7824..000000000
--- a/src/libffmpeg/libavcodec/alpha/motion_est_mvi_asm.S
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * Alpha optimized DSP utils
- * Copyright (c) 2002 Falk Hueffner <falk@debian.org>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "regdef.h"
-
-/* Some nicer register names. */
-#define ta t10
-#define tb t11
-#define tc t12
-#define td AT
-/* Danger: these overlap with the argument list and the return value */
-#define te a5
-#define tf a4
-#define tg a3
-#define th v0
-
- .set noat
- .set noreorder
- .arch pca56
- .text
-
-/*****************************************************************************
- * int pix_abs16x16_mvi_asm(uint8_t *pix1, uint8_t *pix2, int line_size)
- *
- * This code is written with a pca56 in mind. For ev6, one should
- * really take the increased latency of 3 cycles for MVI instructions
- * into account.
- *
- * It is important to keep the loading and first use of a register as
- * far apart as possible, because if a register is accessed before it
- * has been fetched from memory, the CPU will stall.
- */
- .align 4
- .globl pix_abs16x16_mvi_asm
- .ent pix_abs16x16_mvi_asm
-pix_abs16x16_mvi_asm:
- .frame sp, 0, ra, 0
- .prologue 0
-
-#ifdef HAVE_GPROF
- lda AT, _mcount
- jsr AT, (AT), _mcount
-#endif
-
- and a1, 7, t0
- clr v0
- lda a3, 16
- beq t0, $aligned
- .align 4
-$unaligned:
- /* Registers:
- line 0:
- t0: left_u -> left lo -> left
- t1: mid
- t2: right_u -> right hi -> right
- t3: ref left
- t4: ref right
- line 1:
- t5: left_u -> left lo -> left
- t6: mid
- t7: right_u -> right hi -> right
- t8: ref left
- t9: ref right
- temp:
- ta: left hi
- tb: right lo
- tc: error left
- td: error right */
-
- /* load line 0 */
- ldq_u t0, 0(a1) # left_u
- ldq_u t1, 8(a1) # mid
- ldq_u t2, 16(a1) # right_u
- ldq t3, 0(a0) # ref left
- ldq t4, 8(a0) # ref right
- addq a0, a2, a0 # pix1
- addq a1, a2, a1 # pix2
- /* load line 1 */
- ldq_u t5, 0(a1) # left_u
- ldq_u t6, 8(a1) # mid
- ldq_u t7, 16(a1) # right_u
- ldq t8, 0(a0) # ref left
- ldq t9, 8(a0) # ref right
- addq a0, a2, a0 # pix1
- addq a1, a2, a1 # pix2
- /* calc line 0 */
- extql t0, a1, t0 # left lo
- extqh t1, a1, ta # left hi
- extql t1, a1, tb # right lo
- or t0, ta, t0 # left
- extqh t2, a1, t2 # right hi
- perr t3, t0, tc # error left
- or t2, tb, t2 # right
- perr t4, t2, td # error right
- addq v0, tc, v0 # add error left
- addq v0, td, v0 # add error left
- /* calc line 1 */
- extql t5, a1, t5 # left lo
- extqh t6, a1, ta # left hi
- extql t6, a1, tb # right lo
- or t5, ta, t5 # left
- extqh t7, a1, t7 # right hi
- perr t8, t5, tc # error left
- or t7, tb, t7 # right
- perr t9, t7, td # error right
- addq v0, tc, v0 # add error left
- addq v0, td, v0 # add error left
- /* loop */
- subq a3, 2, a3 # h -= 2
- bne a3, $unaligned
- ret
-
- .align 4
-$aligned:
- /* load line 0 */
- ldq t0, 0(a1) # left
- ldq t1, 8(a1) # right
- addq a1, a2, a1 # pix2
- ldq t2, 0(a0) # ref left
- ldq t3, 8(a0) # ref right
- addq a0, a2, a0 # pix1
- /* load line 1 */
- ldq t4, 0(a1) # left
- ldq t5, 8(a1) # right
- addq a1, a2, a1 # pix2
- ldq t6, 0(a0) # ref left
- ldq t7, 8(a0) # ref right
- addq a0, a2, a0 # pix1
- /* load line 2 */
- ldq t8, 0(a1) # left
- ldq t9, 8(a1) # right
- addq a1, a2, a1 # pix2
- ldq ta, 0(a0) # ref left
- ldq tb, 8(a0) # ref right
- addq a0, a2, a0 # pix1
- /* load line 3 */
- ldq tc, 0(a1) # left
- ldq td, 8(a1) # right
- addq a1, a2, a1 # pix2
- ldq te, 0(a0) # ref left
- ldq tf, 8(a0) # ref right
- /* calc line 0 */
- perr t0, t2, t0 # error left
- addq a0, a2, a0 # pix1
- perr t1, t3, t1 # error right
- addq v0, t0, v0 # add error left
- /* calc line 1 */
- perr t4, t6, t0 # error left
- addq v0, t1, v0 # add error right
- perr t5, t7, t1 # error right
- addq v0, t0, v0 # add error left
- /* calc line 2 */
- perr t8, ta, t0 # error left
- addq v0, t1, v0 # add error right
- perr t9, tb, t1 # error right
- addq v0, t0, v0 # add error left
- /* calc line 3 */
- perr tc, te, t0 # error left
- addq v0, t1, v0 # add error right
- perr td, tf, t1 # error right
- addq v0, t0, v0 # add error left
- addq v0, t1, v0 # add error right
- /* loop */
- subq a3, 4, a3 # h -= 4
- bne a3, $aligned
- ret
- .end pix_abs16x16_mvi_asm
diff --git a/src/libffmpeg/libavcodec/alpha/mpegvideo_alpha.c b/src/libffmpeg/libavcodec/alpha/mpegvideo_alpha.c
deleted file mode 100644
index 8ad264b06..000000000
--- a/src/libffmpeg/libavcodec/alpha/mpegvideo_alpha.c
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Alpha optimized DSP utils
- * Copyright (c) 2002 Falk Hueffner <falk@debian.org>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "asm.h"
-#include "../dsputil.h"
-#include "../mpegvideo.h"
-
-static void dct_unquantize_h263_intra_axp(MpegEncContext *s, DCTELEM *block,
- int n, int qscale)
-{
- int i, n_coeffs;
- uint64_t qmul, qadd;
- uint64_t correction;
- DCTELEM *orig_block = block;
- DCTELEM block0; /* might not be used uninitialized */
-
- qadd = WORD_VEC((qscale - 1) | 1);
- qmul = qscale << 1;
- /* This mask kills spill from negative subwords to the next subword. */
- correction = WORD_VEC((qmul - 1) + 1); /* multiplication / addition */
-
- if (!s->h263_aic) {
- if (n < 4)
- block0 = block[0] * s->y_dc_scale;
- else
- block0 = block[0] * s->c_dc_scale;
- } else {
- qadd = 0;
- }
- n_coeffs = 63; // does not always use zigzag table
-
- for(i = 0; i <= n_coeffs; block += 4, i += 4) {
- uint64_t levels, negmask, zeros, add;
-
- levels = ldq(block);
- if (levels == 0)
- continue;
-
-#ifdef __alpha_max__
- /* I don't think the speed difference justifies runtime
- detection. */
- negmask = maxsw4(levels, -1); /* negative -> ffff (-1) */
- negmask = minsw4(negmask, 0); /* positive -> 0000 (0) */
-#else
- negmask = cmpbge(WORD_VEC(0x7fff), levels);
- negmask &= (negmask >> 1) | (1 << 7);
- negmask = zap(-1, negmask);
-#endif
-
- zeros = cmpbge(0, levels);
- zeros &= zeros >> 1;
- /* zeros |= zeros << 1 is not needed since qadd <= 255, so
- zapping the lower byte suffices. */
-
- levels *= qmul;
- levels -= correction & (negmask << 16);
-
- /* Negate qadd for negative levels. */
- add = qadd ^ negmask;
- add += WORD_VEC(0x0001) & negmask;
- /* Set qadd to 0 for levels == 0. */
- add = zap(add, zeros);
-
- levels += add;
-
- stq(levels, block);
- }
-
- if (s->mb_intra && !s->h263_aic)
- orig_block[0] = block0;
-}
-
-static void dct_unquantize_h263_inter_axp(MpegEncContext *s, DCTELEM *block,
- int n, int qscale)
-{
- int i, n_coeffs;
- uint64_t qmul, qadd;
- uint64_t correction;
-
- qadd = WORD_VEC((qscale - 1) | 1);
- qmul = qscale << 1;
- /* This mask kills spill from negative subwords to the next subword. */
- correction = WORD_VEC((qmul - 1) + 1); /* multiplication / addition */
-
- n_coeffs = s->intra_scantable.raster_end[s->block_last_index[n]];
-
- for(i = 0; i <= n_coeffs; block += 4, i += 4) {
- uint64_t levels, negmask, zeros, add;
-
- levels = ldq(block);
- if (levels == 0)
- continue;
-
-#ifdef __alpha_max__
- /* I don't think the speed difference justifies runtime
- detection. */
- negmask = maxsw4(levels, -1); /* negative -> ffff (-1) */
- negmask = minsw4(negmask, 0); /* positive -> 0000 (0) */
-#else
- negmask = cmpbge(WORD_VEC(0x7fff), levels);
- negmask &= (negmask >> 1) | (1 << 7);
- negmask = zap(-1, negmask);
-#endif
-
- zeros = cmpbge(0, levels);
- zeros &= zeros >> 1;
- /* zeros |= zeros << 1 is not needed since qadd <= 255, so
- zapping the lower byte suffices. */
-
- levels *= qmul;
- levels -= correction & (negmask << 16);
-
- /* Negate qadd for negative levels. */
- add = qadd ^ negmask;
- add += WORD_VEC(0x0001) & negmask;
- /* Set qadd to 0 for levels == 0. */
- add = zap(add, zeros);
-
- levels += add;
-
- stq(levels, block);
- }
-}
-
-void MPV_common_init_axp(MpegEncContext *s)
-{
- s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_axp;
- s->dct_unquantize_h263_inter = dct_unquantize_h263_inter_axp;
-}
diff --git a/src/libffmpeg/libavcodec/alpha/regdef.h b/src/libffmpeg/libavcodec/alpha/regdef.h
deleted file mode 100644
index 01e263bac..000000000
--- a/src/libffmpeg/libavcodec/alpha/regdef.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Alpha optimized DSP utils
- * copyright (c) 2002 Falk Hueffner <falk@debian.org>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/* Some BSDs don't seem to have regdef.h... sigh */
-#ifndef alpha_regdef_h
-#define alpha_regdef_h
-
-#define v0 $0 /* function return value */
-
-#define t0 $1 /* temporary registers (caller-saved) */
-#define t1 $2
-#define t2 $3
-#define t3 $4
-#define t4 $5
-#define t5 $6
-#define t6 $7
-#define t7 $8
-
-#define s0 $9 /* saved-registers (callee-saved registers) */
-#define s1 $10
-#define s2 $11
-#define s3 $12
-#define s4 $13
-#define s5 $14
-#define s6 $15
-#define fp s6 /* frame-pointer (s6 in frame-less procedures) */
-
-#define a0 $16 /* argument registers (caller-saved) */
-#define a1 $17
-#define a2 $18
-#define a3 $19
-#define a4 $20
-#define a5 $21
-
-#define t8 $22 /* more temps (caller-saved) */
-#define t9 $23
-#define t10 $24
-#define t11 $25
-#define ra $26 /* return address register */
-#define t12 $27
-
-#define pv t12 /* procedure-variable register */
-#define AT $at /* assembler temporary */
-#define gp $29 /* global pointer */
-#define sp $30 /* stack pointer */
-#define zero $31 /* reads as zero, writes are noops */
-
-#endif /* alpha_regdef_h */
diff --git a/src/libffmpeg/libavcodec/alpha/simple_idct_alpha.c b/src/libffmpeg/libavcodec/alpha/simple_idct_alpha.c
deleted file mode 100644
index 111387ef0..000000000
--- a/src/libffmpeg/libavcodec/alpha/simple_idct_alpha.c
+++ /dev/null
@@ -1,308 +0,0 @@
-/*
- * Simple IDCT (Alpha optimized)
- *
- * Copyright (c) 2001 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * based upon some outcommented c code from mpeg2dec (idct_mmx.c
- * written by Aaron Holtzman <aholtzma@ess.engr.uvic.ca>)
- *
- * Alpha optimiziations by Måns Rullgård <mru@users.sourceforge.net>
- * and Falk Hueffner <falk@debian.org>
- */
-
-#include "asm.h"
-#include "../dsputil.h"
-
-extern void (*put_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels,
- int line_size);
-extern void (*add_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels,
- int line_size);
-
-// cos(i * M_PI / 16) * sqrt(2) * (1 << 14)
-// W4 is actually exactly 16384, but using 16383 works around
-// accumulating rounding errors for some encoders
-#define W1 ((int_fast32_t) 22725)
-#define W2 ((int_fast32_t) 21407)
-#define W3 ((int_fast32_t) 19266)
-#define W4 ((int_fast32_t) 16383)
-#define W5 ((int_fast32_t) 12873)
-#define W6 ((int_fast32_t) 8867)
-#define W7 ((int_fast32_t) 4520)
-#define ROW_SHIFT 11
-#define COL_SHIFT 20
-
-/* 0: all entries 0, 1: only first entry nonzero, 2: otherwise */
-static inline int idct_row(DCTELEM *row)
-{
- int_fast32_t a0, a1, a2, a3, b0, b1, b2, b3, t;
- uint64_t l, r, t2;
- l = ldq(row);
- r = ldq(row + 4);
-
- if (l == 0 && r == 0)
- return 0;
-
- a0 = W4 * sextw(l) + (1 << (ROW_SHIFT - 1));
-
- if (((l & ~0xffffUL) | r) == 0) {
- a0 >>= ROW_SHIFT;
- t2 = (uint16_t) a0;
- t2 |= t2 << 16;
- t2 |= t2 << 32;
-
- stq(t2, row);
- stq(t2, row + 4);
- return 1;
- }
-
- a1 = a0;
- a2 = a0;
- a3 = a0;
-
- t = extwl(l, 4); /* row[2] */
- if (t != 0) {
- t = sextw(t);
- a0 += W2 * t;
- a1 += W6 * t;
- a2 -= W6 * t;
- a3 -= W2 * t;
- }
-
- t = extwl(r, 0); /* row[4] */
- if (t != 0) {
- t = sextw(t);
- a0 += W4 * t;
- a1 -= W4 * t;
- a2 -= W4 * t;
- a3 += W4 * t;
- }
-
- t = extwl(r, 4); /* row[6] */
- if (t != 0) {
- t = sextw(t);
- a0 += W6 * t;
- a1 -= W2 * t;
- a2 += W2 * t;
- a3 -= W6 * t;
- }
-
- t = extwl(l, 2); /* row[1] */
- if (t != 0) {
- t = sextw(t);
- b0 = W1 * t;
- b1 = W3 * t;
- b2 = W5 * t;
- b3 = W7 * t;
- } else {
- b0 = 0;
- b1 = 0;
- b2 = 0;
- b3 = 0;
- }
-
- t = extwl(l, 6); /* row[3] */
- if (t) {
- t = sextw(t);
- b0 += W3 * t;
- b1 -= W7 * t;
- b2 -= W1 * t;
- b3 -= W5 * t;
- }
-
-
- t = extwl(r, 2); /* row[5] */
- if (t) {
- t = sextw(t);
- b0 += W5 * t;
- b1 -= W1 * t;
- b2 += W7 * t;
- b3 += W3 * t;
- }
-
- t = extwl(r, 6); /* row[7] */
- if (t) {
- t = sextw(t);
- b0 += W7 * t;
- b1 -= W5 * t;
- b2 += W3 * t;
- b3 -= W1 * t;
- }
-
- row[0] = (a0 + b0) >> ROW_SHIFT;
- row[1] = (a1 + b1) >> ROW_SHIFT;
- row[2] = (a2 + b2) >> ROW_SHIFT;
- row[3] = (a3 + b3) >> ROW_SHIFT;
- row[4] = (a3 - b3) >> ROW_SHIFT;
- row[5] = (a2 - b2) >> ROW_SHIFT;
- row[6] = (a1 - b1) >> ROW_SHIFT;
- row[7] = (a0 - b0) >> ROW_SHIFT;
-
- return 2;
-}
-
-static inline void idct_col(DCTELEM *col)
-{
- int_fast32_t a0, a1, a2, a3, b0, b1, b2, b3;
-
- col[0] += (1 << (COL_SHIFT - 1)) / W4;
-
- a0 = W4 * col[8 * 0];
- a1 = W4 * col[8 * 0];
- a2 = W4 * col[8 * 0];
- a3 = W4 * col[8 * 0];
-
- if (col[8 * 2]) {
- a0 += W2 * col[8 * 2];
- a1 += W6 * col[8 * 2];
- a2 -= W6 * col[8 * 2];
- a3 -= W2 * col[8 * 2];
- }
-
- if (col[8 * 4]) {
- a0 += W4 * col[8 * 4];
- a1 -= W4 * col[8 * 4];
- a2 -= W4 * col[8 * 4];
- a3 += W4 * col[8 * 4];
- }
-
- if (col[8 * 6]) {
- a0 += W6 * col[8 * 6];
- a1 -= W2 * col[8 * 6];
- a2 += W2 * col[8 * 6];
- a3 -= W6 * col[8 * 6];
- }
-
- if (col[8 * 1]) {
- b0 = W1 * col[8 * 1];
- b1 = W3 * col[8 * 1];
- b2 = W5 * col[8 * 1];
- b3 = W7 * col[8 * 1];
- } else {
- b0 = 0;
- b1 = 0;
- b2 = 0;
- b3 = 0;
- }
-
- if (col[8 * 3]) {
- b0 += W3 * col[8 * 3];
- b1 -= W7 * col[8 * 3];
- b2 -= W1 * col[8 * 3];
- b3 -= W5 * col[8 * 3];
- }
-
- if (col[8 * 5]) {
- b0 += W5 * col[8 * 5];
- b1 -= W1 * col[8 * 5];
- b2 += W7 * col[8 * 5];
- b3 += W3 * col[8 * 5];
- }
-
- if (col[8 * 7]) {
- b0 += W7 * col[8 * 7];
- b1 -= W5 * col[8 * 7];
- b2 += W3 * col[8 * 7];
- b3 -= W1 * col[8 * 7];
- }
-
- col[8 * 0] = (a0 + b0) >> COL_SHIFT;
- col[8 * 7] = (a0 - b0) >> COL_SHIFT;
- col[8 * 1] = (a1 + b1) >> COL_SHIFT;
- col[8 * 6] = (a1 - b1) >> COL_SHIFT;
- col[8 * 2] = (a2 + b2) >> COL_SHIFT;
- col[8 * 5] = (a2 - b2) >> COL_SHIFT;
- col[8 * 3] = (a3 + b3) >> COL_SHIFT;
- col[8 * 4] = (a3 - b3) >> COL_SHIFT;
-}
-
-/* If all rows but the first one are zero after row transformation,
- all rows will be identical after column transformation. */
-static inline void idct_col2(DCTELEM *col)
-{
- int i;
- uint64_t l, r;
-
- for (i = 0; i < 8; ++i) {
- int_fast32_t a0 = col[i] + (1 << (COL_SHIFT - 1)) / W4;
-
- a0 *= W4;
- col[i] = a0 >> COL_SHIFT;
- }
-
- l = ldq(col + 0 * 4); r = ldq(col + 1 * 4);
- stq(l, col + 2 * 4); stq(r, col + 3 * 4);
- stq(l, col + 4 * 4); stq(r, col + 5 * 4);
- stq(l, col + 6 * 4); stq(r, col + 7 * 4);
- stq(l, col + 8 * 4); stq(r, col + 9 * 4);
- stq(l, col + 10 * 4); stq(r, col + 11 * 4);
- stq(l, col + 12 * 4); stq(r, col + 13 * 4);
- stq(l, col + 14 * 4); stq(r, col + 15 * 4);
-}
-
-void simple_idct_axp(DCTELEM *block)
-{
-
- int i;
- int rowsZero = 1; /* all rows except row 0 zero */
- int rowsConstant = 1; /* all rows consist of a constant value */
-
- for (i = 0; i < 8; i++) {
- int sparseness = idct_row(block + 8 * i);
-
- if (i > 0 && sparseness > 0)
- rowsZero = 0;
- if (sparseness == 2)
- rowsConstant = 0;
- }
-
- if (rowsZero) {
- idct_col2(block);
- } else if (rowsConstant) {
- idct_col(block);
- for (i = 0; i < 8; i += 2) {
- uint64_t v = (uint16_t) block[0];
- uint64_t w = (uint16_t) block[8];
-
- v |= v << 16;
- w |= w << 16;
- v |= v << 32;
- w |= w << 32;
- stq(v, block + 0 * 4);
- stq(v, block + 1 * 4);
- stq(w, block + 2 * 4);
- stq(w, block + 3 * 4);
- block += 4 * 4;
- }
- } else {
- for (i = 0; i < 8; i++)
- idct_col(block + i);
- }
-}
-
-void simple_idct_put_axp(uint8_t *dest, int line_size, DCTELEM *block)
-{
- simple_idct_axp(block);
- put_pixels_clamped_axp_p(block, dest, line_size);
-}
-
-void simple_idct_add_axp(uint8_t *dest, int line_size, DCTELEM *block)
-{
- simple_idct_axp(block);
- add_pixels_clamped_axp_p(block, dest, line_size);
-}
diff --git a/src/libffmpeg/libavcodec/armv4l/Makefile.am b/src/libffmpeg/libavcodec/armv4l/Makefile.am
deleted file mode 100644
index 33e0882c9..000000000
--- a/src/libffmpeg/libavcodec/armv4l/Makefile.am
+++ /dev/null
@@ -1,23 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-AM_CFLAGS = -O2 -fno-strict-aliasing
-AM_CPPFLAGS = $(LIBFFMPEG_CPPFLAGS)
-ASFLAGS =
-
-noinst_LTLIBRARIES = libavcodec_armv4l.la
-
-libavcodec_armv4l_src = dsputil_arm.c jrevdct_arm.S mpegvideo_arm.c simple_idct_arm.S \
- dsputil_arm_s.S dsputil_iwmmxt.c dsputil_iwmmxt_rnd.h \
- mpegvideo_armv5te.c mpegvideo_iwmmxt.c simple_idct_armv5te.S
-
-noinst_HEADERS = mathops.h
-
-libavcodec_armv4l_dummy = libavcodec_armv4l_dummy.c
-EXTRA_DIST = $(libavcodec_armv4l_src) $(libavcodec_armv4l_dummy)
-
-#if HAVE_ARMV4L
-#armv4l_modules = $(libavcodec_armv4l_src)
-#endif
-armv4l_modules =
-
-libavcodec_armv4l_la_SOURCES = $(armv4l_modules) $(libavcodec_armv4l_dummy)
diff --git a/src/libffmpeg/libavcodec/armv4l/dsputil_arm.c b/src/libffmpeg/libavcodec/armv4l/dsputil_arm.c
deleted file mode 100644
index 9f0bfa2af..000000000
--- a/src/libffmpeg/libavcodec/armv4l/dsputil_arm.c
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * ARMv4L optimized DSP utils
- * Copyright (c) 2001 Lionel Ulmer.
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "../dsputil.h"
-#ifdef HAVE_IPP
-#include "ipp.h"
-#endif
-
-extern void dsputil_init_iwmmxt(DSPContext* c, AVCodecContext *avctx);
-
-extern void j_rev_dct_ARM(DCTELEM *data);
-extern void simple_idct_ARM(DCTELEM *data);
-
-extern void simple_idct_armv5te(DCTELEM *data);
-extern void simple_idct_put_armv5te(uint8_t *dest, int line_size,
- DCTELEM *data);
-extern void simple_idct_add_armv5te(uint8_t *dest, int line_size,
- DCTELEM *data);
-
-/* XXX: local hack */
-static void (*ff_put_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
-static void (*ff_add_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
-
-void put_pixels8_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
-void put_pixels8_x2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
-void put_pixels8_y2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
-void put_pixels8_xy2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
-
-void put_no_rnd_pixels8_x2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
-void put_no_rnd_pixels8_y2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
-void put_no_rnd_pixels8_xy2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
-
-void put_pixels16_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
-
-CALL_2X_PIXELS(put_pixels16_x2_arm , put_pixels8_x2_arm , 8)
-CALL_2X_PIXELS(put_pixels16_y2_arm , put_pixels8_y2_arm , 8)
-CALL_2X_PIXELS(put_pixels16_xy2_arm, put_pixels8_xy2_arm, 8)
-CALL_2X_PIXELS(put_no_rnd_pixels16_x2_arm , put_no_rnd_pixels8_x2_arm , 8)
-CALL_2X_PIXELS(put_no_rnd_pixels16_y2_arm , put_no_rnd_pixels8_y2_arm , 8)
-CALL_2X_PIXELS(put_no_rnd_pixels16_xy2_arm, put_no_rnd_pixels8_xy2_arm, 8)
-
-static void add_pixels_clamped_ARM(short *block, unsigned char *dest, int line_size)
-{
- asm volatile (
- "mov r10, #8 \n\t"
-
- "1: \n\t"
-
- /* load dest */
- "ldr r4, [%1] \n\t"
- /* block[0] and block[1]*/
- "ldrsh r5, [%0] \n\t"
- "ldrsh r7, [%0, #2] \n\t"
- "and r6, r4, #0xFF \n\t"
- "and r8, r4, #0xFF00 \n\t"
- "add r6, r5, r6 \n\t"
- "add r8, r7, r8, lsr #8 \n\t"
- "mvn r5, r5 \n\t"
- "mvn r7, r7 \n\t"
- "tst r6, #0x100 \n\t"
- "movne r6, r5, lsr #24 \n\t"
- "tst r8, #0x100 \n\t"
- "movne r8, r7, lsr #24 \n\t"
- "mov r9, r6 \n\t"
- "ldrsh r5, [%0, #4] \n\t" /* moved form [A] */
- "orr r9, r9, r8, lsl #8 \n\t"
- /* block[2] and block[3] */
- /* [A] */
- "ldrsh r7, [%0, #6] \n\t"
- "and r6, r4, #0xFF0000 \n\t"
- "and r8, r4, #0xFF000000 \n\t"
- "add r6, r5, r6, lsr #16 \n\t"
- "add r8, r7, r8, lsr #24 \n\t"
- "mvn r5, r5 \n\t"
- "mvn r7, r7 \n\t"
- "tst r6, #0x100 \n\t"
- "movne r6, r5, lsr #24 \n\t"
- "tst r8, #0x100 \n\t"
- "movne r8, r7, lsr #24 \n\t"
- "orr r9, r9, r6, lsl #16 \n\t"
- "ldr r4, [%1, #4] \n\t" /* moved form [B] */
- "orr r9, r9, r8, lsl #24 \n\t"
- /* store dest */
- "ldrsh r5, [%0, #8] \n\t" /* moved form [C] */
- "str r9, [%1] \n\t"
-
- /* load dest */
- /* [B] */
- /* block[4] and block[5] */
- /* [C] */
- "ldrsh r7, [%0, #10] \n\t"
- "and r6, r4, #0xFF \n\t"
- "and r8, r4, #0xFF00 \n\t"
- "add r6, r5, r6 \n\t"
- "add r8, r7, r8, lsr #8 \n\t"
- "mvn r5, r5 \n\t"
- "mvn r7, r7 \n\t"
- "tst r6, #0x100 \n\t"
- "movne r6, r5, lsr #24 \n\t"
- "tst r8, #0x100 \n\t"
- "movne r8, r7, lsr #24 \n\t"
- "mov r9, r6 \n\t"
- "ldrsh r5, [%0, #12] \n\t" /* moved from [D] */
- "orr r9, r9, r8, lsl #8 \n\t"
- /* block[6] and block[7] */
- /* [D] */
- "ldrsh r7, [%0, #14] \n\t"
- "and r6, r4, #0xFF0000 \n\t"
- "and r8, r4, #0xFF000000 \n\t"
- "add r6, r5, r6, lsr #16 \n\t"
- "add r8, r7, r8, lsr #24 \n\t"
- "mvn r5, r5 \n\t"
- "mvn r7, r7 \n\t"
- "tst r6, #0x100 \n\t"
- "movne r6, r5, lsr #24 \n\t"
- "tst r8, #0x100 \n\t"
- "movne r8, r7, lsr #24 \n\t"
- "orr r9, r9, r6, lsl #16 \n\t"
- "add %0, %0, #16 \n\t" /* moved from [E] */
- "orr r9, r9, r8, lsl #24 \n\t"
- "subs r10, r10, #1 \n\t" /* moved from [F] */
- /* store dest */
- "str r9, [%1, #4] \n\t"
-
- /* [E] */
- /* [F] */
- "add %1, %1, %2 \n\t"
- "bne 1b \n\t"
- : "+r"(block),
- "+r"(dest)
- : "r"(line_size)
- : "r4", "r5", "r6", "r7", "r8", "r9", "r10", "cc", "memory" );
-}
-
-/* XXX: those functions should be suppressed ASAP when all IDCTs are
- converted */
-static void j_rev_dct_ARM_put(uint8_t *dest, int line_size, DCTELEM *block)
-{
- j_rev_dct_ARM (block);
- ff_put_pixels_clamped(block, dest, line_size);
-}
-static void j_rev_dct_ARM_add(uint8_t *dest, int line_size, DCTELEM *block)
-{
- j_rev_dct_ARM (block);
- ff_add_pixels_clamped(block, dest, line_size);
-}
-static void simple_idct_ARM_put(uint8_t *dest, int line_size, DCTELEM *block)
-{
- simple_idct_ARM (block);
- ff_put_pixels_clamped(block, dest, line_size);
-}
-static void simple_idct_ARM_add(uint8_t *dest, int line_size, DCTELEM *block)
-{
- simple_idct_ARM (block);
- ff_add_pixels_clamped(block, dest, line_size);
-}
-
-#ifdef HAVE_IPP
-static void simple_idct_ipp(DCTELEM *block)
-{
- ippiDCT8x8Inv_Video_16s_C1I(block);
-}
-static void simple_idct_ipp_put(uint8_t *dest, int line_size, DCTELEM *block)
-{
- ippiDCT8x8Inv_Video_16s8u_C1R(block, dest, line_size);
-}
-
-void add_pixels_clamped_iwmmxt(const DCTELEM *block, uint8_t *pixels, int line_size);
-
-static void simple_idct_ipp_add(uint8_t *dest, int line_size, DCTELEM *block)
-{
- ippiDCT8x8Inv_Video_16s_C1I(block);
-#ifdef HAVE_IWMMXT
- add_pixels_clamped_iwmmxt(block, dest, line_size);
-#else
- add_pixels_clamped_ARM(block, dest, line_size);
-#endif
-}
-#endif
-
-void dsputil_init_armv4l(DSPContext* c, AVCodecContext *avctx)
-{
- int idct_algo= avctx->idct_algo;
-
- ff_put_pixels_clamped = c->put_pixels_clamped;
- ff_add_pixels_clamped = c->add_pixels_clamped;
-
- if(idct_algo == FF_IDCT_AUTO){
-#if defined(HAVE_IPP)
- idct_algo = FF_IDCT_IPP;
-#elif defined(HAVE_ARMV5TE)
- idct_algo = FF_IDCT_SIMPLEARMV5TE;
-#else
- idct_algo = FF_IDCT_ARM;
-#endif
- }
-
- if(idct_algo==FF_IDCT_ARM){
- c->idct_put= j_rev_dct_ARM_put;
- c->idct_add= j_rev_dct_ARM_add;
- c->idct = j_rev_dct_ARM;
- c->idct_permutation_type= FF_LIBMPEG2_IDCT_PERM;/* FF_NO_IDCT_PERM */
- } else if (idct_algo==FF_IDCT_SIMPLEARM){
- c->idct_put= simple_idct_ARM_put;
- c->idct_add= simple_idct_ARM_add;
- c->idct = simple_idct_ARM;
- c->idct_permutation_type= FF_NO_IDCT_PERM;
-#ifdef HAVE_ARMV5TE
- } else if (idct_algo==FF_IDCT_SIMPLEARMV5TE){
- c->idct_put= simple_idct_put_armv5te;
- c->idct_add= simple_idct_add_armv5te;
- c->idct = simple_idct_armv5te;
- c->idct_permutation_type = FF_NO_IDCT_PERM;
-#endif
-#ifdef HAVE_IPP
- } else if (idct_algo==FF_IDCT_IPP){
- c->idct_put= simple_idct_ipp_put;
- c->idct_add= simple_idct_ipp_add;
- c->idct = simple_idct_ipp;
- c->idct_permutation_type= FF_NO_IDCT_PERM;
-#endif
- }
-
-/* c->put_pixels_tab[0][0] = put_pixels16_arm; */ // NG!
- c->put_pixels_tab[0][1] = put_pixels16_x2_arm; //OK!
- c->put_pixels_tab[0][2] = put_pixels16_y2_arm; //OK!
-/* c->put_pixels_tab[0][3] = put_pixels16_xy2_arm; /\* NG *\/ */
-/* c->put_no_rnd_pixels_tab[0][0] = put_pixels16_arm; */
- c->put_no_rnd_pixels_tab[0][1] = put_no_rnd_pixels16_x2_arm; // OK
- c->put_no_rnd_pixels_tab[0][2] = put_no_rnd_pixels16_y2_arm; //OK
-/* c->put_no_rnd_pixels_tab[0][3] = put_no_rnd_pixels16_xy2_arm; //NG */
- c->put_pixels_tab[1][0] = put_pixels8_arm; //OK
- c->put_pixels_tab[1][1] = put_pixels8_x2_arm; //OK
-/* c->put_pixels_tab[1][2] = put_pixels8_y2_arm; //NG */
-/* c->put_pixels_tab[1][3] = put_pixels8_xy2_arm; //NG */
- c->put_no_rnd_pixels_tab[1][0] = put_pixels8_arm;//OK
- c->put_no_rnd_pixels_tab[1][1] = put_no_rnd_pixels8_x2_arm; //OK
- c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y2_arm; //OK
-/* c->put_no_rnd_pixels_tab[1][3] = put_no_rnd_pixels8_xy2_arm;//NG */
-
-#ifdef HAVE_IWMMXT
- dsputil_init_iwmmxt(c, avctx);
-#endif
-}
diff --git a/src/libffmpeg/libavcodec/armv4l/dsputil_arm_s.S b/src/libffmpeg/libavcodec/armv4l/dsputil_arm_s.S
deleted file mode 100644
index 2a3ee9c50..000000000
--- a/src/libffmpeg/libavcodec/armv4l/dsputil_arm_s.S
+++ /dev/null
@@ -1,696 +0,0 @@
-@
-@ ARMv4L optimized DSP utils
-@ Copyright (c) 2004 AGAWA Koji <i (AT) atty (DOT) jp>
-@
-@ This file is part of FFmpeg.
-@
-@ FFmpeg is free software; you can redistribute it and/or
-@ modify it under the terms of the GNU Lesser General Public
-@ License as published by the Free Software Foundation; either
-@ version 2.1 of the License, or (at your option) any later version.
-@
-@ FFmpeg is distributed in the hope that it will be useful,
-@ but WITHOUT ANY WARRANTY; without even the implied warranty of
-@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-@ Lesser General Public License for more details.
-@
-@ You should have received a copy of the GNU Lesser General Public
-@ License along with FFmpeg; if not, write to the Free Software
-@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-@
-
-.macro ADJ_ALIGN_QUADWORD_D shift, Rd0, Rd1, Rd2, Rd3, Rn0, Rn1, Rn2, Rn3, Rn4
- mov \Rd0, \Rn0, lsr #(\shift * 8)
- mov \Rd1, \Rn1, lsr #(\shift * 8)
- mov \Rd2, \Rn2, lsr #(\shift * 8)
- mov \Rd3, \Rn3, lsr #(\shift * 8)
- orr \Rd0, \Rd0, \Rn1, lsl #(32 - \shift * 8)
- orr \Rd1, \Rd1, \Rn2, lsl #(32 - \shift * 8)
- orr \Rd2, \Rd2, \Rn3, lsl #(32 - \shift * 8)
- orr \Rd3, \Rd3, \Rn4, lsl #(32 - \shift * 8)
-.endm
-.macro ADJ_ALIGN_DOUBLEWORD shift, R0, R1, R2
- mov \R0, \R0, lsr #(\shift * 8)
- orr \R0, \R0, \R1, lsl #(32 - \shift * 8)
- mov \R1, \R1, lsr #(\shift * 8)
- orr \R1, \R1, \R2, lsl #(32 - \shift * 8)
-.endm
-.macro ADJ_ALIGN_DOUBLEWORD_D shift, Rdst0, Rdst1, Rsrc0, Rsrc1, Rsrc2
- mov \Rdst0, \Rsrc0, lsr #(\shift * 8)
- mov \Rdst1, \Rsrc1, lsr #(\shift * 8)
- orr \Rdst0, \Rdst0, \Rsrc1, lsl #(32 - (\shift * 8))
- orr \Rdst1, \Rdst1, \Rsrc2, lsl #(32 - (\shift * 8))
-.endm
-
-.macro RND_AVG32 Rd0, Rd1, Rn0, Rn1, Rm0, Rm1, Rmask
- @ Rd = (Rn | Rm) - (((Rn ^ Rm) & ~0x01010101) >> 1)
- @ Rmask = 0xFEFEFEFE
- @ Rn = destroy
- eor \Rd0, \Rn0, \Rm0
- eor \Rd1, \Rn1, \Rm1
- orr \Rn0, \Rn0, \Rm0
- orr \Rn1, \Rn1, \Rm1
- and \Rd0, \Rd0, \Rmask
- and \Rd1, \Rd1, \Rmask
- sub \Rd0, \Rn0, \Rd0, lsr #1
- sub \Rd1, \Rn1, \Rd1, lsr #1
-.endm
-
-.macro NO_RND_AVG32 Rd0, Rd1, Rn0, Rn1, Rm0, Rm1, Rmask
- @ Rd = (Rn & Rm) - (((Rn ^ Rm) & ~0x01010101) >> 1)
- @ Rmask = 0xFEFEFEFE
- @ Rn = destroy
- eor \Rd0, \Rn0, \Rm0
- eor \Rd1, \Rn1, \Rm1
- and \Rn0, \Rn0, \Rm0
- and \Rn1, \Rn1, \Rm1
- and \Rd0, \Rd0, \Rmask
- and \Rd1, \Rd1, \Rmask
- add \Rd0, \Rn0, \Rd0, lsr #1
- add \Rd1, \Rn1, \Rd1, lsr #1
-.endm
-
-@ ----------------------------------------------------------------
- .align 8
- .global put_pixels16_arm
-put_pixels16_arm:
- @ void func(uint8_t *block, const uint8_t *pixels, int line_size, int h)
- @ block = word aligned, pixles = unaligned
- pld [r1]
- stmfd sp!, {r4-r11, lr} @ R14 is also called LR
- adr r5, 5f
- ands r4, r1, #3
- bic r1, r1, #3
- add r5, r5, r4, lsl #2
- ldrne pc, [r5]
-1:
- ldmia r1, {r4-r7}
- add r1, r1, r2
- stmia r0, {r4-r7}
- pld [r1]
- subs r3, r3, #1
- add r0, r0, r2
- bne 1b
- ldmfd sp!, {r4-r11, pc}
- .align 8
-2:
- ldmia r1, {r4-r8}
- add r1, r1, r2
- ADJ_ALIGN_QUADWORD_D 1, r9, r10, r11, r12, r4, r5, r6, r7, r8
- pld [r1]
- subs r3, r3, #1
- stmia r0, {r9-r12}
- add r0, r0, r2
- bne 2b
- ldmfd sp!, {r4-r11, pc}
- .align 8
-3:
- ldmia r1, {r4-r8}
- add r1, r1, r2
- ADJ_ALIGN_QUADWORD_D 2, r9, r10, r11, r12, r4, r5, r6, r7, r8
- pld [r1]
- subs r3, r3, #1
- stmia r0, {r9-r12}
- add r0, r0, r2
- bne 3b
- ldmfd sp!, {r4-r11, pc}
- .align 8
-4:
- ldmia r1, {r4-r8}
- add r1, r1, r2
- ADJ_ALIGN_QUADWORD_D 3, r9, r10, r11, r12, r4, r5, r6, r7, r8
- pld [r1]
- subs r3, r3, #1
- stmia r0, {r9-r12}
- add r0, r0, r2
- bne 4b
- ldmfd sp!, {r4-r11,pc}
- .align 8
-5:
- .word 1b
- .word 2b
- .word 3b
- .word 4b
-
-@ ----------------------------------------------------------------
- .align 8
- .global put_pixels8_arm
-put_pixels8_arm:
- @ void func(uint8_t *block, const uint8_t *pixels, int line_size, int h)
- @ block = word aligned, pixles = unaligned
- pld [r1]
- stmfd sp!, {r4-r5,lr} @ R14 is also called LR
- adr r5, 5f
- ands r4, r1, #3
- bic r1, r1, #3
- add r5, r5, r4, lsl #2
- ldrne pc, [r5]
-1:
- ldmia r1, {r4-r5}
- add r1, r1, r2
- subs r3, r3, #1
- pld [r1]
- stmia r0, {r4-r5}
- add r0, r0, r2
- bne 1b
- ldmfd sp!, {r4-r5,pc}
- .align 8
-2:
- ldmia r1, {r4-r5, r12}
- add r1, r1, r2
- ADJ_ALIGN_DOUBLEWORD 1, r4, r5, r12
- pld [r1]
- subs r3, r3, #1
- stmia r0, {r4-r5}
- add r0, r0, r2
- bne 2b
- ldmfd sp!, {r4-r5,pc}
- .align 8
-3:
- ldmia r1, {r4-r5, r12}
- add r1, r1, r2
- ADJ_ALIGN_DOUBLEWORD 2, r4, r5, r12
- pld [r1]
- subs r3, r3, #1
- stmia r0, {r4-r5}
- add r0, r0, r2
- bne 3b
- ldmfd sp!, {r4-r5,pc}
- .align 8
-4:
- ldmia r1, {r4-r5, r12}
- add r1, r1, r2
- ADJ_ALIGN_DOUBLEWORD 3, r4, r5, r12
- pld [r1]
- subs r3, r3, #1
- stmia r0, {r4-r5}
- add r0, r0, r2
- bne 4b
- ldmfd sp!, {r4-r5,pc}
- .align 8
-5:
- .word 1b
- .word 2b
- .word 3b
- .word 4b
-
-@ ----------------------------------------------------------------
- .align 8
- .global put_pixels8_x2_arm
-put_pixels8_x2_arm:
- @ void func(uint8_t *block, const uint8_t *pixels, int line_size, int h)
- @ block = word aligned, pixles = unaligned
- pld [r1]
- stmfd sp!, {r4-r10,lr} @ R14 is also called LR
- adr r5, 5f
- ands r4, r1, #3
- ldr r12, [r5]
- add r5, r5, r4, lsl #2
- bic r1, r1, #3
- ldrne pc, [r5]
-1:
- ldmia r1, {r4-r5, r10}
- add r1, r1, r2
- ADJ_ALIGN_DOUBLEWORD_D 1, r6, r7, r4, r5, r10
- pld [r1]
- RND_AVG32 r8, r9, r4, r5, r6, r7, r12
- subs r3, r3, #1
- stmia r0, {r8-r9}
- add r0, r0, r2
- bne 1b
- ldmfd sp!, {r4-r10,pc}
- .align 8
-2:
- ldmia r1, {r4-r5, r10}
- add r1, r1, r2
- ADJ_ALIGN_DOUBLEWORD_D 1, r6, r7, r4, r5, r10
- ADJ_ALIGN_DOUBLEWORD_D 2, r8, r9, r4, r5, r10
- pld [r1]
- RND_AVG32 r4, r5, r6, r7, r8, r9, r12
- subs r3, r3, #1
- stmia r0, {r4-r5}
- add r0, r0, r2
- bne 2b
- ldmfd sp!, {r4-r10,pc}
- .align 8
-3:
- ldmia r1, {r4-r5, r10}
- add r1, r1, r2
- ADJ_ALIGN_DOUBLEWORD_D 2, r6, r7, r4, r5, r10
- ADJ_ALIGN_DOUBLEWORD_D 3, r8, r9, r4, r5, r10
- pld [r1]
- RND_AVG32 r4, r5, r6, r7, r8, r9, r12
- subs r3, r3, #1
- stmia r0, {r4-r5}
- add r0, r0, r2
- bne 3b
- ldmfd sp!, {r4-r10,pc}
- .align 8
-4:
- ldmia r1, {r4-r5, r10}
- add r1, r1, r2
- ADJ_ALIGN_DOUBLEWORD_D 3, r6, r7, r4, r5, r10
- pld [r1]
- RND_AVG32 r8, r9, r6, r7, r5, r10, r12
- subs r3, r3, #1
- stmia r0, {r8-r9}
- add r0, r0, r2
- bne 4b
- ldmfd sp!, {r4-r10,pc} @@ update PC with LR content.
- .align 8
-5:
- .word 0xFEFEFEFE
- .word 2b
- .word 3b
- .word 4b
-
- .align 8
- .global put_no_rnd_pixels8_x2_arm
-put_no_rnd_pixels8_x2_arm:
- @ void func(uint8_t *block, const uint8_t *pixels, int line_size, int h)
- @ block = word aligned, pixles = unaligned
- pld [r1]
- stmfd sp!, {r4-r10,lr} @ R14 is also called LR
- adr r5, 5f
- ands r4, r1, #3
- ldr r12, [r5]
- add r5, r5, r4, lsl #2
- bic r1, r1, #3
- ldrne pc, [r5]
-1:
- ldmia r1, {r4-r5, r10}
- add r1, r1, r2
- ADJ_ALIGN_DOUBLEWORD_D 1, r6, r7, r4, r5, r10
- pld [r1]
- NO_RND_AVG32 r8, r9, r4, r5, r6, r7, r12
- subs r3, r3, #1
- stmia r0, {r8-r9}
- add r0, r0, r2
- bne 1b
- ldmfd sp!, {r4-r10,pc}
- .align 8
-2:
- ldmia r1, {r4-r5, r10}
- add r1, r1, r2
- ADJ_ALIGN_DOUBLEWORD_D 1, r6, r7, r4, r5, r10
- ADJ_ALIGN_DOUBLEWORD_D 2, r8, r9, r4, r5, r10
- pld [r1]
- NO_RND_AVG32 r4, r5, r6, r7, r8, r9, r12
- subs r3, r3, #1
- stmia r0, {r4-r5}
- add r0, r0, r2
- bne 2b
- ldmfd sp!, {r4-r10,pc}
- .align 8
-3:
- ldmia r1, {r4-r5, r10}
- add r1, r1, r2
- ADJ_ALIGN_DOUBLEWORD_D 2, r6, r7, r4, r5, r10
- ADJ_ALIGN_DOUBLEWORD_D 3, r8, r9, r4, r5, r10
- pld [r1]
- NO_RND_AVG32 r4, r5, r6, r7, r8, r9, r12
- subs r3, r3, #1
- stmia r0, {r4-r5}
- add r0, r0, r2
- bne 3b
- ldmfd sp!, {r4-r10,pc}
- .align 8
-4:
- ldmia r1, {r4-r5, r10}
- add r1, r1, r2
- ADJ_ALIGN_DOUBLEWORD_D 3, r6, r7, r4, r5, r10
- pld [r1]
- NO_RND_AVG32 r8, r9, r6, r7, r5, r10, r12
- subs r3, r3, #1
- stmia r0, {r8-r9}
- add r0, r0, r2
- bne 4b
- ldmfd sp!, {r4-r10,pc} @@ update PC with LR content.
- .align 8
-5:
- .word 0xFEFEFEFE
- .word 2b
- .word 3b
- .word 4b
-
-
-@ ----------------------------------------------------------------
- .align 8
- .global put_pixels8_y2_arm
-put_pixels8_y2_arm:
- @ void func(uint8_t *block, const uint8_t *pixels, int line_size, int h)
- @ block = word aligned, pixles = unaligned
- pld [r1]
- stmfd sp!, {r4-r11,lr} @ R14 is also called LR
- adr r5, 5f
- ands r4, r1, #3
- mov r3, r3, lsr #1
- ldr r12, [r5]
- add r5, r5, r4, lsl #2
- bic r1, r1, #3
- ldrne pc, [r5]
-1:
- ldmia r1, {r4-r5}
- add r1, r1, r2
-6: ldmia r1, {r6-r7}
- add r1, r1, r2
- pld [r1]
- RND_AVG32 r8, r9, r4, r5, r6, r7, r12
- ldmia r1, {r4-r5}
- add r1, r1, r2
- stmia r0, {r8-r9}
- add r0, r0, r2
- pld [r1]
- RND_AVG32 r8, r9, r6, r7, r4, r5, r12
- subs r3, r3, #1
- stmia r0, {r8-r9}
- add r0, r0, r2
- bne 6b
- ldmfd sp!, {r4-r11,pc}
- .align 8
-2:
- ldmia r1, {r4-r6}
- add r1, r1, r2
- pld [r1]
- ADJ_ALIGN_DOUBLEWORD 1, r4, r5, r6
-6: ldmia r1, {r7-r9}
- add r1, r1, r2
- pld [r1]
- ADJ_ALIGN_DOUBLEWORD 1, r7, r8, r9
- RND_AVG32 r10, r11, r4, r5, r7, r8, r12
- stmia r0, {r10-r11}
- add r0, r0, r2
- ldmia r1, {r4-r6}
- add r1, r1, r2
- pld [r1]
- ADJ_ALIGN_DOUBLEWORD 1, r4, r5, r6
- subs r3, r3, #1
- RND_AVG32 r10, r11, r7, r8, r4, r5, r12
- stmia r0, {r10-r11}
- add r0, r0, r2
- bne 6b
- ldmfd sp!, {r4-r11,pc}
- .align 8
-3:
- ldmia r1, {r4-r6}
- add r1, r1, r2
- pld [r1]
- ADJ_ALIGN_DOUBLEWORD 2, r4, r5, r6
-6: ldmia r1, {r7-r9}
- add r1, r1, r2
- pld [r1]
- ADJ_ALIGN_DOUBLEWORD 2, r7, r8, r9
- RND_AVG32 r10, r11, r4, r5, r7, r8, r12
- stmia r0, {r10-r11}
- add r0, r0, r2
- ldmia r1, {r4-r6}
- add r1, r1, r2
- pld [r1]
- ADJ_ALIGN_DOUBLEWORD 2, r4, r5, r6
- subs r3, r3, #1
- RND_AVG32 r10, r11, r7, r8, r4, r5, r12
- stmia r0, {r10-r11}
- add r0, r0, r2
- bne 6b
- ldmfd sp!, {r4-r11,pc}
- .align 8
-4:
- ldmia r1, {r4-r6}
- add r1, r1, r2
- pld [r1]
- ADJ_ALIGN_DOUBLEWORD 3, r4, r5, r6
-6: ldmia r1, {r7-r9}
- add r1, r1, r2
- pld [r1]
- ADJ_ALIGN_DOUBLEWORD 3, r7, r8, r9
- RND_AVG32 r10, r11, r4, r5, r7, r8, r12
- stmia r0, {r10-r11}
- add r0, r0, r2
- ldmia r1, {r4-r6}
- add r1, r1, r2
- pld [r1]
- ADJ_ALIGN_DOUBLEWORD 3, r4, r5, r6
- subs r3, r3, #1
- RND_AVG32 r10, r11, r7, r8, r4, r5, r12
- stmia r0, {r10-r11}
- add r0, r0, r2
- bne 6b
- ldmfd sp!, {r4-r11,pc}
-
- .align 8
-5:
- .word 0xFEFEFEFE
- .word 2b
- .word 3b
- .word 4b
-
- .align 8
- .global put_no_rnd_pixels8_y2_arm
-put_no_rnd_pixels8_y2_arm:
- @ void func(uint8_t *block, const uint8_t *pixels, int line_size, int h)
- @ block = word aligned, pixles = unaligned
- pld [r1]
- stmfd sp!, {r4-r11,lr} @ R14 is also called LR
- adr r5, 5f
- ands r4, r1, #3
- mov r3, r3, lsr #1
- ldr r12, [r5]
- add r5, r5, r4, lsl #2
- bic r1, r1, #3
- ldrne pc, [r5]
-1:
- ldmia r1, {r4-r5}
- add r1, r1, r2
-6: ldmia r1, {r6-r7}
- add r1, r1, r2
- pld [r1]
- NO_RND_AVG32 r8, r9, r4, r5, r6, r7, r12
- ldmia r1, {r4-r5}
- add r1, r1, r2
- stmia r0, {r8-r9}
- add r0, r0, r2
- pld [r1]
- NO_RND_AVG32 r8, r9, r6, r7, r4, r5, r12
- subs r3, r3, #1
- stmia r0, {r8-r9}
- add r0, r0, r2
- bne 6b
- ldmfd sp!, {r4-r11,pc}
- .align 8
-2:
- ldmia r1, {r4-r6}
- add r1, r1, r2
- pld [r1]
- ADJ_ALIGN_DOUBLEWORD 1, r4, r5, r6
-6: ldmia r1, {r7-r9}
- add r1, r1, r2
- pld [r1]
- ADJ_ALIGN_DOUBLEWORD 1, r7, r8, r9
- NO_RND_AVG32 r10, r11, r4, r5, r7, r8, r12
- stmia r0, {r10-r11}
- add r0, r0, r2
- ldmia r1, {r4-r6}
- add r1, r1, r2
- pld [r1]
- ADJ_ALIGN_DOUBLEWORD 1, r4, r5, r6
- subs r3, r3, #1
- NO_RND_AVG32 r10, r11, r7, r8, r4, r5, r12
- stmia r0, {r10-r11}
- add r0, r0, r2
- bne 6b
- ldmfd sp!, {r4-r11,pc}
- .align 8
-3:
- ldmia r1, {r4-r6}
- add r1, r1, r2
- pld [r1]
- ADJ_ALIGN_DOUBLEWORD 2, r4, r5, r6
-6: ldmia r1, {r7-r9}
- add r1, r1, r2
- pld [r1]
- ADJ_ALIGN_DOUBLEWORD 2, r7, r8, r9
- NO_RND_AVG32 r10, r11, r4, r5, r7, r8, r12
- stmia r0, {r10-r11}
- add r0, r0, r2
- ldmia r1, {r4-r6}
- add r1, r1, r2
- pld [r1]
- ADJ_ALIGN_DOUBLEWORD 2, r4, r5, r6
- subs r3, r3, #1
- NO_RND_AVG32 r10, r11, r7, r8, r4, r5, r12
- stmia r0, {r10-r11}
- add r0, r0, r2
- bne 6b
- ldmfd sp!, {r4-r11,pc}
- .align 8
-4:
- ldmia r1, {r4-r6}
- add r1, r1, r2
- pld [r1]
- ADJ_ALIGN_DOUBLEWORD 3, r4, r5, r6
-6: ldmia r1, {r7-r9}
- add r1, r1, r2
- pld [r1]
- ADJ_ALIGN_DOUBLEWORD 3, r7, r8, r9
- NO_RND_AVG32 r10, r11, r4, r5, r7, r8, r12
- stmia r0, {r10-r11}
- add r0, r0, r2
- ldmia r1, {r4-r6}
- add r1, r1, r2
- pld [r1]
- ADJ_ALIGN_DOUBLEWORD 3, r4, r5, r6
- subs r3, r3, #1
- NO_RND_AVG32 r10, r11, r7, r8, r4, r5, r12
- stmia r0, {r10-r11}
- add r0, r0, r2
- bne 6b
- ldmfd sp!, {r4-r11,pc}
- .align 8
-5:
- .word 0xFEFEFEFE
- .word 2b
- .word 3b
- .word 4b
-
-@ ----------------------------------------------------------------
-.macro RND_XY2_IT align, rnd
- @ l1= (a & 0x03030303) + (b & 0x03030303) ?(+ 0x02020202)
- @ h1= ((a & 0xFCFCFCFCUL) >> 2) + ((b & 0xFCFCFCFCUL) >> 2)
-.if \align == 0
- ldmia r1, {r6-r8}
-.elseif \align == 3
- ldmia r1, {r5-r7}
-.else
- ldmia r1, {r8-r10}
-.endif
- add r1, r1, r2
- pld [r1]
-.if \align == 0
- ADJ_ALIGN_DOUBLEWORD_D 1, r4, r5, r6, r7, r8
-.elseif \align == 1
- ADJ_ALIGN_DOUBLEWORD_D 1, r4, r5, r8, r9, r10
- ADJ_ALIGN_DOUBLEWORD_D 2, r6, r7, r8, r9, r10
-.elseif \align == 2
- ADJ_ALIGN_DOUBLEWORD_D 2, r4, r5, r8, r9, r10
- ADJ_ALIGN_DOUBLEWORD_D 3, r6, r7, r8, r9, r10
-.elseif \align == 3
- ADJ_ALIGN_DOUBLEWORD_D 3, r4, r5, r5, r6, r7
-.endif
- ldr r14, [r12, #0] @ 0x03030303
- tst r3, #1
- and r8, r4, r14
- and r9, r5, r14
- and r10, r6, r14
- and r11, r7, r14
-.if \rnd == 1
- ldreq r14, [r12, #16] @ 0x02020202
-.else
- ldreq r14, [r12, #28] @ 0x01010101
-.endif
- add r8, r8, r10
- add r9, r9, r11
- addeq r8, r8, r14
- addeq r9, r9, r14
- ldr r14, [r12, #20] @ 0xFCFCFCFC >> 2
- and r4, r14, r4, lsr #2
- and r5, r14, r5, lsr #2
- and r6, r14, r6, lsr #2
- and r7, r14, r7, lsr #2
- add r10, r4, r6
- add r11, r5, r7
-.endm
-
-.macro RND_XY2_EXPAND align, rnd
- RND_XY2_IT \align, \rnd
-6: stmfd sp!, {r8-r11}
- RND_XY2_IT \align, \rnd
- ldmfd sp!, {r4-r7}
- add r4, r4, r8
- add r5, r5, r9
- add r6, r6, r10
- add r7, r7, r11
- ldr r14, [r12, #24] @ 0x0F0F0F0F
- and r4, r14, r4, lsr #2
- and r5, r14, r5, lsr #2
- add r4, r4, r6
- add r5, r5, r7
- subs r3, r3, #1
- stmia r0, {r4-r5}
- add r0, r0, r2
- bne 6b
- ldmfd sp!, {r4-r11,pc}
-.endm
-
- .align 8
- .global put_pixels8_xy2_arm
-put_pixels8_xy2_arm:
- @ void func(uint8_t *block, const uint8_t *pixels, int line_size, int h)
- @ block = word aligned, pixles = unaligned
- pld [r1]
- stmfd sp!, {r4-r11,lr} @ R14 is also called LR
- adrl r12, 5f
- ands r4, r1, #3
- add r5, r12, r4, lsl #2
- bic r1, r1, #3
- ldrne pc, [r5]
-1:
- RND_XY2_EXPAND 0, 1
-
- .align 8
-2:
- RND_XY2_EXPAND 1, 1
-
- .align 8
-3:
- RND_XY2_EXPAND 2, 1
-
- .align 8
-4:
- RND_XY2_EXPAND 3, 1
-
-5:
- .word 0x03030303
- .word 2b
- .word 3b
- .word 4b
- .word 0x02020202
- .word 0xFCFCFCFC >> 2
- .word 0x0F0F0F0F
- .word 0x01010101
-
- .align 8
- .global put_no_rnd_pixels8_xy2_arm
-put_no_rnd_pixels8_xy2_arm:
- @ void func(uint8_t *block, const uint8_t *pixels, int line_size, int h)
- @ block = word aligned, pixles = unaligned
- pld [r1]
- stmfd sp!, {r4-r11,lr} @ R14 is also called LR
- adrl r12, 5f
- ands r4, r1, #3
- add r5, r12, r4, lsl #2
- bic r1, r1, #3
- ldrne pc, [r5]
-1:
- RND_XY2_EXPAND 0, 0
-
- .align 8
-2:
- RND_XY2_EXPAND 1, 0
-
- .align 8
-3:
- RND_XY2_EXPAND 2, 0
-
- .align 8
-4:
- RND_XY2_EXPAND 3, 0
-
-5:
- .word 0x03030303
- .word 2b
- .word 3b
- .word 4b
- .word 0x02020202
- .word 0xFCFCFCFC >> 2
- .word 0x0F0F0F0F
- .word 0x01010101
diff --git a/src/libffmpeg/libavcodec/armv4l/dsputil_iwmmxt.c b/src/libffmpeg/libavcodec/armv4l/dsputil_iwmmxt.c
deleted file mode 100644
index d7401e760..000000000
--- a/src/libffmpeg/libavcodec/armv4l/dsputil_iwmmxt.c
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * iWMMXt optimized DSP utils
- * Copyright (c) 2004 AGAWA Koji
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "../dsputil.h"
-
-#define DEF(x, y) x ## _no_rnd_ ## y ##_iwmmxt
-#define SET_RND(regd) __asm__ __volatile__ ("mov r12, #1 \n\t tbcsth " #regd ", r12":::"r12");
-#define WAVG2B "wavg2b"
-#include "dsputil_iwmmxt_rnd.h"
-#undef DEF
-#undef SET_RND
-#undef WAVG2B
-
-#define DEF(x, y) x ## _ ## y ##_iwmmxt
-#define SET_RND(regd) __asm__ __volatile__ ("mov r12, #2 \n\t tbcsth " #regd ", r12":::"r12");
-#define WAVG2B "wavg2br"
-#include "dsputil_iwmmxt_rnd.h"
-#undef DEF
-#undef SET_RND
-#undef WAVG2BR
-
-// need scheduling
-#define OP(AVG) \
- asm volatile ( \
- /* alignment */ \
- "and r12, %[pixels], #7 \n\t" \
- "bic %[pixels], %[pixels], #7 \n\t" \
- "tmcr wcgr1, r12 \n\t" \
- \
- "wldrd wr0, [%[pixels]] \n\t" \
- "wldrd wr1, [%[pixels], #8] \n\t" \
- "add %[pixels], %[pixels], %[line_size] \n\t" \
- "walignr1 wr4, wr0, wr1 \n\t" \
- \
- "1: \n\t" \
- \
- "wldrd wr2, [%[pixels]] \n\t" \
- "wldrd wr3, [%[pixels], #8] \n\t" \
- "add %[pixels], %[pixels], %[line_size] \n\t" \
- "pld [%[pixels]] \n\t" \
- "walignr1 wr5, wr2, wr3 \n\t" \
- AVG " wr6, wr4, wr5 \n\t" \
- "wstrd wr6, [%[block]] \n\t" \
- "add %[block], %[block], %[line_size] \n\t" \
- \
- "wldrd wr0, [%[pixels]] \n\t" \
- "wldrd wr1, [%[pixels], #8] \n\t" \
- "add %[pixels], %[pixels], %[line_size] \n\t" \
- "walignr1 wr4, wr0, wr1 \n\t" \
- "pld [%[pixels]] \n\t" \
- AVG " wr6, wr4, wr5 \n\t" \
- "wstrd wr6, [%[block]] \n\t" \
- "add %[block], %[block], %[line_size] \n\t" \
- \
- "subs %[h], %[h], #2 \n\t" \
- "bne 1b \n\t" \
- : [block]"+r"(block), [pixels]"+r"(pixels), [h]"+r"(h) \
- : [line_size]"r"(line_size) \
- : "memory", "r12");
-void put_pixels8_y2_iwmmxt(uint8_t *block, const uint8_t *pixels, const int line_size, int h)
-{
- OP("wavg2br");
-}
-void put_no_rnd_pixels8_y2_iwmmxt(uint8_t *block, const uint8_t *pixels, const int line_size, int h)
-{
- OP("wavg2b");
-}
-#undef OP
-
-void add_pixels_clamped_iwmmxt(const DCTELEM *block, uint8_t *pixels, int line_size)
-{
- uint8_t *pixels2 = pixels + line_size;
-
- __asm__ __volatile__ (
- "mov r12, #4 \n\t"
- "1: \n\t"
- "pld [%[pixels], %[line_size2]] \n\t"
- "pld [%[pixels2], %[line_size2]] \n\t"
- "wldrd wr4, [%[pixels]] \n\t"
- "wldrd wr5, [%[pixels2]] \n\t"
- "pld [%[block], #32] \n\t"
- "wunpckelub wr6, wr4 \n\t"
- "wldrd wr0, [%[block]] \n\t"
- "wunpckehub wr7, wr4 \n\t"
- "wldrd wr1, [%[block], #8] \n\t"
- "wunpckelub wr8, wr5 \n\t"
- "wldrd wr2, [%[block], #16] \n\t"
- "wunpckehub wr9, wr5 \n\t"
- "wldrd wr3, [%[block], #24] \n\t"
- "add %[block], %[block], #32 \n\t"
- "waddhss wr10, wr0, wr6 \n\t"
- "waddhss wr11, wr1, wr7 \n\t"
- "waddhss wr12, wr2, wr8 \n\t"
- "waddhss wr13, wr3, wr9 \n\t"
- "wpackhus wr14, wr10, wr11 \n\t"
- "wpackhus wr15, wr12, wr13 \n\t"
- "wstrd wr14, [%[pixels]] \n\t"
- "add %[pixels], %[pixels], %[line_size2] \n\t"
- "subs r12, r12, #1 \n\t"
- "wstrd wr15, [%[pixels2]] \n\t"
- "add %[pixels2], %[pixels2], %[line_size2] \n\t"
- "bne 1b \n\t"
- : [block]"+r"(block), [pixels]"+r"(pixels), [pixels2]"+r"(pixels2)
- : [line_size2]"r"(line_size << 1)
- : "cc", "memory", "r12");
-}
-
-static void nop(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-{
- return;
-}
-
-int mm_flags; /* multimedia extension flags */
-
-int mm_support(void)
-{
- return 0; /* TODO, implement proper detection */
-}
-
-void dsputil_init_iwmmxt(DSPContext* c, AVCodecContext *avctx)
-{
- mm_flags = mm_support();
-
- if (avctx->dsp_mask) {
- if (avctx->dsp_mask & FF_MM_FORCE)
- mm_flags |= (avctx->dsp_mask & 0xffff);
- else
- mm_flags &= ~(avctx->dsp_mask & 0xffff);
- }
-
- if (!(mm_flags & MM_IWMMXT)) return;
-
- c->add_pixels_clamped = add_pixels_clamped_iwmmxt;
-
- c->put_pixels_tab[0][0] = put_pixels16_iwmmxt;
- c->put_pixels_tab[0][1] = put_pixels16_x2_iwmmxt;
- c->put_pixels_tab[0][2] = put_pixels16_y2_iwmmxt;
- c->put_pixels_tab[0][3] = put_pixels16_xy2_iwmmxt;
- c->put_no_rnd_pixels_tab[0][0] = put_pixels16_iwmmxt;
- c->put_no_rnd_pixels_tab[0][1] = put_no_rnd_pixels16_x2_iwmmxt;
- c->put_no_rnd_pixels_tab[0][2] = put_no_rnd_pixels16_y2_iwmmxt;
- c->put_no_rnd_pixels_tab[0][3] = put_no_rnd_pixels16_xy2_iwmmxt;
-
- c->put_pixels_tab[1][0] = put_pixels8_iwmmxt;
- c->put_pixels_tab[1][1] = put_pixels8_x2_iwmmxt;
- c->put_pixels_tab[1][2] = put_pixels8_y2_iwmmxt;
- c->put_pixels_tab[1][3] = put_pixels8_xy2_iwmmxt;
- c->put_no_rnd_pixels_tab[1][0] = put_pixels8_iwmmxt;
- c->put_no_rnd_pixels_tab[1][1] = put_no_rnd_pixels8_x2_iwmmxt;
- c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y2_iwmmxt;
- c->put_no_rnd_pixels_tab[1][3] = put_no_rnd_pixels8_xy2_iwmmxt;
-
- c->avg_pixels_tab[0][0] = avg_pixels16_iwmmxt;
- c->avg_pixels_tab[0][1] = avg_pixels16_x2_iwmmxt;
- c->avg_pixels_tab[0][2] = avg_pixels16_y2_iwmmxt;
- c->avg_pixels_tab[0][3] = avg_pixels16_xy2_iwmmxt;
- c->avg_no_rnd_pixels_tab[0][0] = avg_pixels16_iwmmxt;
- c->avg_no_rnd_pixels_tab[0][1] = avg_no_rnd_pixels16_x2_iwmmxt;
- c->avg_no_rnd_pixels_tab[0][2] = avg_no_rnd_pixels16_y2_iwmmxt;
- c->avg_no_rnd_pixels_tab[0][3] = avg_no_rnd_pixels16_xy2_iwmmxt;
-
- c->avg_pixels_tab[1][0] = avg_pixels8_iwmmxt;
- c->avg_pixels_tab[1][1] = avg_pixels8_x2_iwmmxt;
- c->avg_pixels_tab[1][2] = avg_pixels8_y2_iwmmxt;
- c->avg_pixels_tab[1][3] = avg_pixels8_xy2_iwmmxt;
- c->avg_no_rnd_pixels_tab[1][0] = avg_no_rnd_pixels8_iwmmxt;
- c->avg_no_rnd_pixels_tab[1][1] = avg_no_rnd_pixels8_x2_iwmmxt;
- c->avg_no_rnd_pixels_tab[1][2] = avg_no_rnd_pixels8_y2_iwmmxt;
- c->avg_no_rnd_pixels_tab[1][3] = avg_no_rnd_pixels8_xy2_iwmmxt;
-}
diff --git a/src/libffmpeg/libavcodec/armv4l/dsputil_iwmmxt_rnd.h b/src/libffmpeg/libavcodec/armv4l/dsputil_iwmmxt_rnd.h
deleted file mode 100644
index 51ba61c47..000000000
--- a/src/libffmpeg/libavcodec/armv4l/dsputil_iwmmxt_rnd.h
+++ /dev/null
@@ -1,1114 +0,0 @@
-/*
- * iWMMXt optimized DSP utils
- * copyright (c) 2004 AGAWA Koji
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-void DEF(put, pixels8)(uint8_t *block, const uint8_t *pixels, const int line_size, int h)
-{
- int stride = line_size;
- __asm__ __volatile__ (
- "and r12, %[pixels], #7 \n\t"
- "bic %[pixels], %[pixels], #7 \n\t"
- "tmcr wcgr1, r12 \n\t"
- "add r4, %[pixels], %[line_size] \n\t"
- "add r5, %[block], %[line_size] \n\t"
- "mov %[line_size], %[line_size], lsl #1 \n\t"
- "1: \n\t"
- "wldrd wr0, [%[pixels]] \n\t"
- "subs %[h], %[h], #2 \n\t"
- "wldrd wr1, [%[pixels], #8] \n\t"
- "add %[pixels], %[pixels], %[line_size] \n\t"
- "wldrd wr3, [r4] \n\t"
- "pld [%[pixels]] \n\t"
- "pld [%[pixels], #32] \n\t"
- "wldrd wr4, [r4, #8] \n\t"
- "add r4, r4, %[line_size] \n\t"
- "walignr1 wr8, wr0, wr1 \n\t"
- "pld [r4] \n\t"
- "pld [r4, #32] \n\t"
- "walignr1 wr10, wr3, wr4 \n\t"
- "wstrd wr8, [%[block]] \n\t"
- "add %[block], %[block], %[line_size] \n\t"
- "wstrd wr10, [r5] \n\t"
- "add r5, r5, %[line_size] \n\t"
- "bne 1b \n\t"
- : [block]"+r"(block), [pixels]"+r"(pixels), [line_size]"+r"(stride), [h]"+r"(h)
- :
- : "memory", "r4", "r5", "r12");
-}
-
-void DEF(avg, pixels8)(uint8_t *block, const uint8_t *pixels, const int line_size, int h)
-{
- int stride = line_size;
- __asm__ __volatile__ (
- "and r12, %[pixels], #7 \n\t"
- "bic %[pixels], %[pixels], #7 \n\t"
- "tmcr wcgr1, r12 \n\t"
- "add r4, %[pixels], %[line_size] \n\t"
- "add r5, %[block], %[line_size] \n\t"
- "mov %[line_size], %[line_size], lsl #1 \n\t"
- "1: \n\t"
- "wldrd wr0, [%[pixels]] \n\t"
- "subs %[h], %[h], #2 \n\t"
- "wldrd wr1, [%[pixels], #8] \n\t"
- "add %[pixels], %[pixels], %[line_size] \n\t"
- "wldrd wr3, [r4] \n\t"
- "pld [%[pixels]] \n\t"
- "pld [%[pixels], #32] \n\t"
- "wldrd wr4, [r4, #8] \n\t"
- "add r4, r4, %[line_size] \n\t"
- "walignr1 wr8, wr0, wr1 \n\t"
- "wldrd wr0, [%[block]] \n\t"
- "wldrd wr2, [r5] \n\t"
- "pld [r4] \n\t"
- "pld [r4, #32] \n\t"
- "walignr1 wr10, wr3, wr4 \n\t"
- WAVG2B" wr8, wr8, wr0 \n\t"
- WAVG2B" wr10, wr10, wr2 \n\t"
- "wstrd wr8, [%[block]] \n\t"
- "add %[block], %[block], %[line_size] \n\t"
- "wstrd wr10, [r5] \n\t"
- "pld [%[block]] \n\t"
- "pld [%[block], #32] \n\t"
- "add r5, r5, %[line_size] \n\t"
- "pld [r5] \n\t"
- "pld [r5, #32] \n\t"
- "bne 1b \n\t"
- : [block]"+r"(block), [pixels]"+r"(pixels), [line_size]"+r"(stride), [h]"+r"(h)
- :
- : "memory", "r4", "r5", "r12");
-}
-
-void DEF(put, pixels16)(uint8_t *block, const uint8_t *pixels, const int line_size, int h)
-{
- int stride = line_size;
- __asm__ __volatile__ (
- "and r12, %[pixels], #7 \n\t"
- "bic %[pixels], %[pixels], #7 \n\t"
- "tmcr wcgr1, r12 \n\t"
- "add r4, %[pixels], %[line_size] \n\t"
- "add r5, %[block], %[line_size] \n\t"
- "mov %[line_size], %[line_size], lsl #1 \n\t"
- "1: \n\t"
- "wldrd wr0, [%[pixels]] \n\t"
- "wldrd wr1, [%[pixels], #8] \n\t"
- "subs %[h], %[h], #2 \n\t"
- "wldrd wr2, [%[pixels], #16] \n\t"
- "add %[pixels], %[pixels], %[line_size] \n\t"
- "wldrd wr3, [r4] \n\t"
- "pld [%[pixels]] \n\t"
- "pld [%[pixels], #32] \n\t"
- "walignr1 wr8, wr0, wr1 \n\t"
- "wldrd wr4, [r4, #8] \n\t"
- "walignr1 wr9, wr1, wr2 \n\t"
- "wldrd wr5, [r4, #16] \n\t"
- "add r4, r4, %[line_size] \n\t"
- "pld [r4] \n\t"
- "pld [r4, #32] \n\t"
- "walignr1 wr10, wr3, wr4 \n\t"
- "wstrd wr8, [%[block]] \n\t"
- "walignr1 wr11, wr4, wr5 \n\t"
- "wstrd wr9, [%[block], #8] \n\t"
- "add %[block], %[block], %[line_size] \n\t"
- "wstrd wr10, [r5] \n\t"
- "wstrd wr11, [r5, #8] \n\t"
- "add r5, r5, %[line_size] \n\t"
- "bne 1b \n\t"
- : [block]"+r"(block), [pixels]"+r"(pixels), [line_size]"+r"(stride), [h]"+r"(h)
- :
- : "memory", "r4", "r5", "r12");
-}
-
-void DEF(avg, pixels16)(uint8_t *block, const uint8_t *pixels, const int line_size, int h)
-{
- int stride = line_size;
- __asm__ __volatile__ (
- "pld [%[pixels]] \n\t"
- "pld [%[pixels], #32] \n\t"
- "pld [%[block]] \n\t"
- "pld [%[block], #32] \n\t"
- "and r12, %[pixels], #7 \n\t"
- "bic %[pixels], %[pixels], #7 \n\t"
- "tmcr wcgr1, r12 \n\t"
- "add r4, %[pixels], %[line_size]\n\t"
- "add r5, %[block], %[line_size] \n\t"
- "mov %[line_size], %[line_size], lsl #1 \n\t"
- "1: \n\t"
- "wldrd wr0, [%[pixels]] \n\t"
- "wldrd wr1, [%[pixels], #8] \n\t"
- "subs %[h], %[h], #2 \n\t"
- "wldrd wr2, [%[pixels], #16] \n\t"
- "add %[pixels], %[pixels], %[line_size] \n\t"
- "wldrd wr3, [r4] \n\t"
- "pld [%[pixels]] \n\t"
- "pld [%[pixels], #32] \n\t"
- "walignr1 wr8, wr0, wr1 \n\t"
- "wldrd wr4, [r4, #8] \n\t"
- "walignr1 wr9, wr1, wr2 \n\t"
- "wldrd wr5, [r4, #16] \n\t"
- "add r4, r4, %[line_size] \n\t"
- "wldrd wr0, [%[block]] \n\t"
- "pld [r4] \n\t"
- "wldrd wr1, [%[block], #8] \n\t"
- "pld [r4, #32] \n\t"
- "wldrd wr2, [r5] \n\t"
- "walignr1 wr10, wr3, wr4 \n\t"
- "wldrd wr3, [r5, #8] \n\t"
- WAVG2B" wr8, wr8, wr0 \n\t"
- WAVG2B" wr9, wr9, wr1 \n\t"
- WAVG2B" wr10, wr10, wr2 \n\t"
- "wstrd wr8, [%[block]] \n\t"
- "walignr1 wr11, wr4, wr5 \n\t"
- WAVG2B" wr11, wr11, wr3 \n\t"
- "wstrd wr9, [%[block], #8] \n\t"
- "add %[block], %[block], %[line_size] \n\t"
- "wstrd wr10, [r5] \n\t"
- "pld [%[block]] \n\t"
- "pld [%[block], #32] \n\t"
- "wstrd wr11, [r5, #8] \n\t"
- "add r5, r5, %[line_size] \n\t"
- "pld [r5] \n\t"
- "pld [r5, #32] \n\t"
- "bne 1b \n\t"
- : [block]"+r"(block), [pixels]"+r"(pixels), [line_size]"+r"(stride), [h]"+r"(h)
- :
- : "memory", "r4", "r5", "r12");
-}
-
-void DEF(put, pixels8_x2)(uint8_t *block, const uint8_t *pixels, const int line_size, int h)
-{
- int stride = line_size;
- // [wr0 wr1 wr2 wr3] for previous line
- // [wr4 wr5 wr6 wr7] for current line
- SET_RND(wr15); // =2 for rnd and =1 for no_rnd version
- __asm__ __volatile__(
- "pld [%[pixels]] \n\t"
- "pld [%[pixels], #32] \n\t"
- "and r12, %[pixels], #7 \n\t"
- "bic %[pixels], %[pixels], #7 \n\t"
- "tmcr wcgr1, r12 \n\t"
- "add r12, r12, #1 \n\t"
- "add r4, %[pixels], %[line_size]\n\t"
- "tmcr wcgr2, r12 \n\t"
- "add r5, %[block], %[line_size] \n\t"
- "mov %[line_size], %[line_size], lsl #1 \n\t"
-
- "1: \n\t"
- "wldrd wr10, [%[pixels]] \n\t"
- "cmp r12, #8 \n\t"
- "wldrd wr11, [%[pixels], #8] \n\t"
- "add %[pixels], %[pixels], %[line_size] \n\t"
- "wldrd wr13, [r4] \n\t"
- "pld [%[pixels]] \n\t"
- "wldrd wr14, [r4, #8] \n\t"
- "pld [%[pixels], #32] \n\t"
- "add r4, r4, %[line_size] \n\t"
- "walignr1 wr0, wr10, wr11 \n\t"
- "pld [r4] \n\t"
- "pld [r4, #32] \n\t"
- "walignr1 wr2, wr13, wr14 \n\t"
- "wmoveq wr4, wr11 \n\t"
- "wmoveq wr6, wr14 \n\t"
- "walignr2ne wr4, wr10, wr11 \n\t"
- "walignr2ne wr6, wr13, wr14 \n\t"
- WAVG2B" wr0, wr0, wr4 \n\t"
- WAVG2B" wr2, wr2, wr6 \n\t"
- "wstrd wr0, [%[block]] \n\t"
- "subs %[h], %[h], #2 \n\t"
- "wstrd wr2, [r5] \n\t"
- "add %[block], %[block], %[line_size] \n\t"
- "add r5, r5, %[line_size] \n\t"
- "bne 1b \n\t"
- : [h]"+r"(h), [pixels]"+r"(pixels), [block]"+r"(block), [line_size]"+r"(stride)
- :
- : "r4", "r5", "r12", "memory");
-}
-
-void DEF(put, pixels16_x2)(uint8_t *block, const uint8_t *pixels, const int line_size, int h)
-{
- int stride = line_size;
- // [wr0 wr1 wr2 wr3] for previous line
- // [wr4 wr5 wr6 wr7] for current line
- SET_RND(wr15); // =2 for rnd and =1 for no_rnd version
- __asm__ __volatile__(
- "pld [%[pixels]] \n\t"
- "pld [%[pixels], #32] \n\t"
- "and r12, %[pixels], #7 \n\t"
- "bic %[pixels], %[pixels], #7 \n\t"
- "tmcr wcgr1, r12 \n\t"
- "add r12, r12, #1 \n\t"
- "add r4, %[pixels], %[line_size]\n\t"
- "tmcr wcgr2, r12 \n\t"
- "add r5, %[block], %[line_size] \n\t"
- "mov %[line_size], %[line_size], lsl #1 \n\t"
-
- "1: \n\t"
- "wldrd wr10, [%[pixels]] \n\t"
- "cmp r12, #8 \n\t"
- "wldrd wr11, [%[pixels], #8] \n\t"
- "wldrd wr12, [%[pixels], #16] \n\t"
- "add %[pixels], %[pixels], %[line_size] \n\t"
- "wldrd wr13, [r4] \n\t"
- "pld [%[pixels]] \n\t"
- "wldrd wr14, [r4, #8] \n\t"
- "pld [%[pixels], #32] \n\t"
- "wldrd wr15, [r4, #16] \n\t"
- "add r4, r4, %[line_size] \n\t"
- "walignr1 wr0, wr10, wr11 \n\t"
- "pld [r4] \n\t"
- "pld [r4, #32] \n\t"
- "walignr1 wr1, wr11, wr12 \n\t"
- "walignr1 wr2, wr13, wr14 \n\t"
- "walignr1 wr3, wr14, wr15 \n\t"
- "wmoveq wr4, wr11 \n\t"
- "wmoveq wr5, wr12 \n\t"
- "wmoveq wr6, wr14 \n\t"
- "wmoveq wr7, wr15 \n\t"
- "walignr2ne wr4, wr10, wr11 \n\t"
- "walignr2ne wr5, wr11, wr12 \n\t"
- "walignr2ne wr6, wr13, wr14 \n\t"
- "walignr2ne wr7, wr14, wr15 \n\t"
- WAVG2B" wr0, wr0, wr4 \n\t"
- WAVG2B" wr1, wr1, wr5 \n\t"
- "wstrd wr0, [%[block]] \n\t"
- WAVG2B" wr2, wr2, wr6 \n\t"
- "wstrd wr1, [%[block], #8] \n\t"
- WAVG2B" wr3, wr3, wr7 \n\t"
- "add %[block], %[block], %[line_size] \n\t"
- "wstrd wr2, [r5] \n\t"
- "subs %[h], %[h], #2 \n\t"
- "wstrd wr3, [r5, #8] \n\t"
- "add r5, r5, %[line_size] \n\t"
- "bne 1b \n\t"
- : [h]"+r"(h), [pixels]"+r"(pixels), [block]"+r"(block), [line_size]"+r"(stride)
- :
- : "r4", "r5", "r12", "memory");
-}
-
-void DEF(avg, pixels8_x2)(uint8_t *block, const uint8_t *pixels, const int line_size, int h)
-{
- int stride = line_size;
- // [wr0 wr1 wr2 wr3] for previous line
- // [wr4 wr5 wr6 wr7] for current line
- SET_RND(wr15); // =2 for rnd and =1 for no_rnd version
- __asm__ __volatile__(
- "pld [%[pixels]] \n\t"
- "pld [%[pixels], #32] \n\t"
- "pld [%[block]] \n\t"
- "pld [%[block], #32] \n\t"
- "and r12, %[pixels], #7 \n\t"
- "bic %[pixels], %[pixels], #7 \n\t"
- "tmcr wcgr1, r12 \n\t"
- "add r12, r12, #1 \n\t"
- "add r4, %[pixels], %[line_size]\n\t"
- "tmcr wcgr2, r12 \n\t"
- "add r5, %[block], %[line_size] \n\t"
- "mov %[line_size], %[line_size], lsl #1 \n\t"
- "pld [r5] \n\t"
- "pld [r5, #32] \n\t"
-
- "1: \n\t"
- "wldrd wr10, [%[pixels]] \n\t"
- "cmp r12, #8 \n\t"
- "wldrd wr11, [%[pixels], #8] \n\t"
- "add %[pixels], %[pixels], %[line_size] \n\t"
- "wldrd wr13, [r4] \n\t"
- "pld [%[pixels]] \n\t"
- "wldrd wr14, [r4, #8] \n\t"
- "pld [%[pixels], #32] \n\t"
- "add r4, r4, %[line_size] \n\t"
- "walignr1 wr0, wr10, wr11 \n\t"
- "pld [r4] \n\t"
- "pld [r4, #32] \n\t"
- "walignr1 wr2, wr13, wr14 \n\t"
- "wmoveq wr4, wr11 \n\t"
- "wmoveq wr6, wr14 \n\t"
- "walignr2ne wr4, wr10, wr11 \n\t"
- "wldrd wr10, [%[block]] \n\t"
- "walignr2ne wr6, wr13, wr14 \n\t"
- "wldrd wr12, [r5] \n\t"
- WAVG2B" wr0, wr0, wr4 \n\t"
- WAVG2B" wr2, wr2, wr6 \n\t"
- WAVG2B" wr0, wr0, wr10 \n\t"
- WAVG2B" wr2, wr2, wr12 \n\t"
- "wstrd wr0, [%[block]] \n\t"
- "subs %[h], %[h], #2 \n\t"
- "wstrd wr2, [r5] \n\t"
- "add %[block], %[block], %[line_size] \n\t"
- "add r5, r5, %[line_size] \n\t"
- "pld [%[block]] \n\t"
- "pld [%[block], #32] \n\t"
- "pld [r5] \n\t"
- "pld [r5, #32] \n\t"
- "bne 1b \n\t"
- : [h]"+r"(h), [pixels]"+r"(pixels), [block]"+r"(block), [line_size]"+r"(stride)
- :
- : "r4", "r5", "r12", "memory");
-}
-
-void DEF(avg, pixels16_x2)(uint8_t *block, const uint8_t *pixels, const int line_size, int h)
-{
- int stride = line_size;
- // [wr0 wr1 wr2 wr3] for previous line
- // [wr4 wr5 wr6 wr7] for current line
- SET_RND(wr15); // =2 for rnd and =1 for no_rnd version
- __asm__ __volatile__(
- "pld [%[pixels]] \n\t"
- "pld [%[pixels], #32] \n\t"
- "pld [%[block]] \n\t"
- "pld [%[block], #32] \n\t"
- "and r12, %[pixels], #7 \n\t"
- "bic %[pixels], %[pixels], #7 \n\t"
- "tmcr wcgr1, r12 \n\t"
- "add r12, r12, #1 \n\t"
- "add r4, %[pixels], %[line_size]\n\t"
- "tmcr wcgr2, r12 \n\t"
- "add r5, %[block], %[line_size] \n\t"
- "mov %[line_size], %[line_size], lsl #1 \n\t"
- "pld [r5] \n\t"
- "pld [r5, #32] \n\t"
-
- "1: \n\t"
- "wldrd wr10, [%[pixels]] \n\t"
- "cmp r12, #8 \n\t"
- "wldrd wr11, [%[pixels], #8] \n\t"
- "wldrd wr12, [%[pixels], #16] \n\t"
- "add %[pixels], %[pixels], %[line_size] \n\t"
- "wldrd wr13, [r4] \n\t"
- "pld [%[pixels]] \n\t"
- "wldrd wr14, [r4, #8] \n\t"
- "pld [%[pixels], #32] \n\t"
- "wldrd wr15, [r4, #16] \n\t"
- "add r4, r4, %[line_size] \n\t"
- "walignr1 wr0, wr10, wr11 \n\t"
- "pld [r4] \n\t"
- "pld [r4, #32] \n\t"
- "walignr1 wr1, wr11, wr12 \n\t"
- "walignr1 wr2, wr13, wr14 \n\t"
- "walignr1 wr3, wr14, wr15 \n\t"
- "wmoveq wr4, wr11 \n\t"
- "wmoveq wr5, wr12 \n\t"
- "wmoveq wr6, wr14 \n\t"
- "wmoveq wr7, wr15 \n\t"
- "walignr2ne wr4, wr10, wr11 \n\t"
- "walignr2ne wr5, wr11, wr12 \n\t"
- "walignr2ne wr6, wr13, wr14 \n\t"
- "walignr2ne wr7, wr14, wr15 \n\t"
- "wldrd wr10, [%[block]] \n\t"
- WAVG2B" wr0, wr0, wr4 \n\t"
- "wldrd wr11, [%[block], #8] \n\t"
- WAVG2B" wr1, wr1, wr5 \n\t"
- "wldrd wr12, [r5] \n\t"
- WAVG2B" wr2, wr2, wr6 \n\t"
- "wldrd wr13, [r5, #8] \n\t"
- WAVG2B" wr3, wr3, wr7 \n\t"
- WAVG2B" wr0, wr0, wr10 \n\t"
- WAVG2B" wr1, wr1, wr11 \n\t"
- WAVG2B" wr2, wr2, wr12 \n\t"
- WAVG2B" wr3, wr3, wr13 \n\t"
- "wstrd wr0, [%[block]] \n\t"
- "subs %[h], %[h], #2 \n\t"
- "wstrd wr1, [%[block], #8] \n\t"
- "add %[block], %[block], %[line_size] \n\t"
- "wstrd wr2, [r5] \n\t"
- "pld [%[block]] \n\t"
- "wstrd wr3, [r5, #8] \n\t"
- "add r5, r5, %[line_size] \n\t"
- "pld [%[block], #32] \n\t"
- "pld [r5] \n\t"
- "pld [r5, #32] \n\t"
- "bne 1b \n\t"
- : [h]"+r"(h), [pixels]"+r"(pixels), [block]"+r"(block), [line_size]"+r"(stride)
- :
- :"r4", "r5", "r12", "memory");
-}
-
-void DEF(avg, pixels8_y2)(uint8_t *block, const uint8_t *pixels, const int line_size, int h)
-{
- int stride = line_size;
- // [wr0 wr1 wr2 wr3] for previous line
- // [wr4 wr5 wr6 wr7] for current line
- __asm__ __volatile__(
- "pld [%[pixels]] \n\t"
- "pld [%[pixels], #32] \n\t"
- "and r12, %[pixels], #7 \n\t"
- "tmcr wcgr1, r12 \n\t"
- "bic %[pixels], %[pixels], #7 \n\t"
-
- "wldrd wr10, [%[pixels]] \n\t"
- "wldrd wr11, [%[pixels], #8] \n\t"
- "pld [%[block]] \n\t"
- "add %[pixels], %[pixels], %[line_size] \n\t"
- "walignr1 wr0, wr10, wr11 \n\t"
- "pld [%[pixels]] \n\t"
- "pld [%[pixels], #32] \n\t"
-
- "1: \n\t"
- "wldrd wr10, [%[pixels]] \n\t"
- "wldrd wr11, [%[pixels], #8] \n\t"
- "add %[pixels], %[pixels], %[line_size] \n\t"
- "pld [%[pixels]] \n\t"
- "pld [%[pixels], #32] \n\t"
- "walignr1 wr4, wr10, wr11 \n\t"
- "wldrd wr10, [%[block]] \n\t"
- WAVG2B" wr8, wr0, wr4 \n\t"
- WAVG2B" wr8, wr8, wr10 \n\t"
- "wstrd wr8, [%[block]] \n\t"
- "add %[block], %[block], %[line_size] \n\t"
-
- "wldrd wr10, [%[pixels]] \n\t"
- "wldrd wr11, [%[pixels], #8] \n\t"
- "pld [%[block]] \n\t"
- "add %[pixels], %[pixels], %[line_size] \n\t"
- "pld [%[pixels]] \n\t"
- "pld [%[pixels], #32] \n\t"
- "walignr1 wr0, wr10, wr11 \n\t"
- "wldrd wr10, [%[block]] \n\t"
- WAVG2B" wr8, wr0, wr4 \n\t"
- WAVG2B" wr8, wr8, wr10 \n\t"
- "wstrd wr8, [%[block]] \n\t"
- "add %[block], %[block], %[line_size] \n\t"
-
- "subs %[h], %[h], #2 \n\t"
- "pld [%[block]] \n\t"
- "bne 1b \n\t"
- : [h]"+r"(h), [pixels]"+r"(pixels), [block]"+r"(block), [line_size]"+r"(stride)
- :
- : "cc", "memory", "r12");
-}
-
-void DEF(put, pixels16_y2)(uint8_t *block, const uint8_t *pixels, const int line_size, int h)
-{
- int stride = line_size;
- // [wr0 wr1 wr2 wr3] for previous line
- // [wr4 wr5 wr6 wr7] for current line
- __asm__ __volatile__(
- "pld [%[pixels]] \n\t"
- "pld [%[pixels], #32] \n\t"
- "and r12, %[pixels], #7 \n\t"
- "tmcr wcgr1, r12 \n\t"
- "bic %[pixels], %[pixels], #7 \n\t"
-
- "wldrd wr10, [%[pixels]] \n\t"
- "wldrd wr11, [%[pixels], #8] \n\t"
- "wldrd wr12, [%[pixels], #16] \n\t"
- "add %[pixels], %[pixels], %[line_size] \n\t"
- "pld [%[pixels]] \n\t"
- "pld [%[pixels], #32] \n\t"
- "walignr1 wr0, wr10, wr11 \n\t"
- "walignr1 wr1, wr11, wr12 \n\t"
-
- "1: \n\t"
- "wldrd wr10, [%[pixels]] \n\t"
- "wldrd wr11, [%[pixels], #8] \n\t"
- "wldrd wr12, [%[pixels], #16] \n\t"
- "add %[pixels], %[pixels], %[line_size] \n\t"
- "pld [%[pixels]] \n\t"
- "pld [%[pixels], #32] \n\t"
- "walignr1 wr4, wr10, wr11 \n\t"
- "walignr1 wr5, wr11, wr12 \n\t"
- WAVG2B" wr8, wr0, wr4 \n\t"
- WAVG2B" wr9, wr1, wr5 \n\t"
- "wstrd wr8, [%[block]] \n\t"
- "wstrd wr9, [%[block], #8] \n\t"
- "add %[block], %[block], %[line_size] \n\t"
-
- "wldrd wr10, [%[pixels]] \n\t"
- "wldrd wr11, [%[pixels], #8] \n\t"
- "wldrd wr12, [%[pixels], #16] \n\t"
- "add %[pixels], %[pixels], %[line_size] \n\t"
- "pld [%[pixels]] \n\t"
- "pld [%[pixels], #32] \n\t"
- "walignr1 wr0, wr10, wr11 \n\t"
- "walignr1 wr1, wr11, wr12 \n\t"
- WAVG2B" wr8, wr0, wr4 \n\t"
- WAVG2B" wr9, wr1, wr5 \n\t"
- "wstrd wr8, [%[block]] \n\t"
- "wstrd wr9, [%[block], #8] \n\t"
- "add %[block], %[block], %[line_size] \n\t"
-
- "subs %[h], %[h], #2 \n\t"
- "bne 1b \n\t"
- : [h]"+r"(h), [pixels]"+r"(pixels), [block]"+r"(block), [line_size]"+r"(stride)
- :
- : "r4", "r5", "r12", "memory");
-}
-
-void DEF(avg, pixels16_y2)(uint8_t *block, const uint8_t *pixels, const int line_size, int h)
-{
- int stride = line_size;
- // [wr0 wr1 wr2 wr3] for previous line
- // [wr4 wr5 wr6 wr7] for current line
- __asm__ __volatile__(
- "pld [%[pixels]] \n\t"
- "pld [%[pixels], #32] \n\t"
- "and r12, %[pixels], #7 \n\t"
- "tmcr wcgr1, r12 \n\t"
- "bic %[pixels], %[pixels], #7 \n\t"
-
- "wldrd wr10, [%[pixels]] \n\t"
- "wldrd wr11, [%[pixels], #8] \n\t"
- "pld [%[block]] \n\t"
- "wldrd wr12, [%[pixels], #16] \n\t"
- "add %[pixels], %[pixels], %[line_size] \n\t"
- "pld [%[pixels]] \n\t"
- "pld [%[pixels], #32] \n\t"
- "walignr1 wr0, wr10, wr11 \n\t"
- "walignr1 wr1, wr11, wr12 \n\t"
-
- "1: \n\t"
- "wldrd wr10, [%[pixels]] \n\t"
- "wldrd wr11, [%[pixels], #8] \n\t"
- "wldrd wr12, [%[pixels], #16] \n\t"
- "add %[pixels], %[pixels], %[line_size] \n\t"
- "pld [%[pixels]] \n\t"
- "pld [%[pixels], #32] \n\t"
- "walignr1 wr4, wr10, wr11 \n\t"
- "walignr1 wr5, wr11, wr12 \n\t"
- "wldrd wr10, [%[block]] \n\t"
- "wldrd wr11, [%[block], #8] \n\t"
- WAVG2B" wr8, wr0, wr4 \n\t"
- WAVG2B" wr9, wr1, wr5 \n\t"
- WAVG2B" wr8, wr8, wr10 \n\t"
- WAVG2B" wr9, wr9, wr11 \n\t"
- "wstrd wr8, [%[block]] \n\t"
- "wstrd wr9, [%[block], #8] \n\t"
- "add %[block], %[block], %[line_size] \n\t"
-
- "wldrd wr10, [%[pixels]] \n\t"
- "wldrd wr11, [%[pixels], #8] \n\t"
- "pld [%[block]] \n\t"
- "wldrd wr12, [%[pixels], #16] \n\t"
- "add %[pixels], %[pixels], %[line_size] \n\t"
- "pld [%[pixels]] \n\t"
- "pld [%[pixels], #32] \n\t"
- "walignr1 wr0, wr10, wr11 \n\t"
- "walignr1 wr1, wr11, wr12 \n\t"
- "wldrd wr10, [%[block]] \n\t"
- "wldrd wr11, [%[block], #8] \n\t"
- WAVG2B" wr8, wr0, wr4 \n\t"
- WAVG2B" wr9, wr1, wr5 \n\t"
- WAVG2B" wr8, wr8, wr10 \n\t"
- WAVG2B" wr9, wr9, wr11 \n\t"
- "wstrd wr8, [%[block]] \n\t"
- "wstrd wr9, [%[block], #8] \n\t"
- "add %[block], %[block], %[line_size] \n\t"
-
- "subs %[h], %[h], #2 \n\t"
- "pld [%[block]] \n\t"
- "bne 1b \n\t"
- : [h]"+r"(h), [pixels]"+r"(pixels), [block]"+r"(block), [line_size]"+r"(stride)
- :
- : "r4", "r5", "r12", "memory");
-}
-
-void DEF(put, pixels8_xy2)(uint8_t *block, const uint8_t *pixels, const int line_size, int h)
-{
- // [wr0 wr1 wr2 wr3] for previous line
- // [wr4 wr5 wr6 wr7] for current line
- SET_RND(wr15); // =2 for rnd and =1 for no_rnd version
- __asm__ __volatile__(
- "pld [%[pixels]] \n\t"
- "mov r12, #2 \n\t"
- "pld [%[pixels], #32] \n\t"
- "tmcr wcgr0, r12 \n\t" /* for shift value */
- "and r12, %[pixels], #7 \n\t"
- "bic %[pixels], %[pixels], #7 \n\t"
- "tmcr wcgr1, r12 \n\t"
-
- // [wr0 wr1 wr2 wr3] <= *
- // [wr4 wr5 wr6 wr7]
- "wldrd wr12, [%[pixels]] \n\t"
- "add r12, r12, #1 \n\t"
- "wldrd wr13, [%[pixels], #8] \n\t"
- "tmcr wcgr2, r12 \n\t"
- "add %[pixels], %[pixels], %[line_size] \n\t"
- "cmp r12, #8 \n\t"
- "pld [%[pixels]] \n\t"
- "pld [%[pixels], #32] \n\t"
- "walignr1 wr2, wr12, wr13 \n\t"
- "wmoveq wr10, wr13 \n\t"
- "walignr2ne wr10, wr12, wr13 \n\t"
- "wunpckelub wr0, wr2 \n\t"
- "wunpckehub wr1, wr2 \n\t"
- "wunpckelub wr8, wr10 \n\t"
- "wunpckehub wr9, wr10 \n\t"
- "waddhus wr0, wr0, wr8 \n\t"
- "waddhus wr1, wr1, wr9 \n\t"
-
- "1: \n\t"
- // [wr0 wr1 wr2 wr3]
- // [wr4 wr5 wr6 wr7] <= *
- "wldrd wr12, [%[pixels]] \n\t"
- "cmp r12, #8 \n\t"
- "wldrd wr13, [%[pixels], #8] \n\t"
- "add %[pixels], %[pixels], %[line_size] \n\t"
- "walignr1 wr6, wr12, wr13 \n\t"
- "pld [%[pixels]] \n\t"
- "pld [%[pixels], #32] \n\t"
- "wmoveq wr10, wr13 \n\t"
- "walignr2ne wr10, wr12, wr13 \n\t"
- "wunpckelub wr4, wr6 \n\t"
- "wunpckehub wr5, wr6 \n\t"
- "wunpckelub wr8, wr10 \n\t"
- "wunpckehub wr9, wr10 \n\t"
- "waddhus wr4, wr4, wr8 \n\t"
- "waddhus wr5, wr5, wr9 \n\t"
- "waddhus wr8, wr0, wr4 \n\t"
- "waddhus wr9, wr1, wr5 \n\t"
- "waddhus wr8, wr8, wr15 \n\t"
- "waddhus wr9, wr9, wr15 \n\t"
- "wsrlhg wr8, wr8, wcgr0 \n\t"
- "wsrlhg wr9, wr9, wcgr0 \n\t"
- "wpackhus wr8, wr8, wr9 \n\t"
- "wstrd wr8, [%[block]] \n\t"
- "add %[block], %[block], %[line_size] \n\t"
-
- // [wr0 wr1 wr2 wr3] <= *
- // [wr4 wr5 wr6 wr7]
- "wldrd wr12, [%[pixels]] \n\t"
- "wldrd wr13, [%[pixels], #8] \n\t"
- "add %[pixels], %[pixels], %[line_size] \n\t"
- "walignr1 wr2, wr12, wr13 \n\t"
- "pld [%[pixels]] \n\t"
- "pld [%[pixels], #32] \n\t"
- "wmoveq wr10, wr13 \n\t"
- "walignr2ne wr10, wr12, wr13 \n\t"
- "wunpckelub wr0, wr2 \n\t"
- "wunpckehub wr1, wr2 \n\t"
- "wunpckelub wr8, wr10 \n\t"
- "wunpckehub wr9, wr10 \n\t"
- "waddhus wr0, wr0, wr8 \n\t"
- "waddhus wr1, wr1, wr9 \n\t"
- "waddhus wr8, wr0, wr4 \n\t"
- "waddhus wr9, wr1, wr5 \n\t"
- "waddhus wr8, wr8, wr15 \n\t"
- "waddhus wr9, wr9, wr15 \n\t"
- "wsrlhg wr8, wr8, wcgr0 \n\t"
- "wsrlhg wr9, wr9, wcgr0 \n\t"
- "wpackhus wr8, wr8, wr9 \n\t"
- "subs %[h], %[h], #2 \n\t"
- "wstrd wr8, [%[block]] \n\t"
- "add %[block], %[block], %[line_size] \n\t"
- "bne 1b \n\t"
- : [h]"+r"(h), [pixels]"+r"(pixels), [block]"+r"(block)
- : [line_size]"r"(line_size)
- : "r12", "memory");
-}
-
-void DEF(put, pixels16_xy2)(uint8_t *block, const uint8_t *pixels, const int line_size, int h)
-{
- // [wr0 wr1 wr2 wr3] for previous line
- // [wr4 wr5 wr6 wr7] for current line
- SET_RND(wr15); // =2 for rnd and =1 for no_rnd version
- __asm__ __volatile__(
- "pld [%[pixels]] \n\t"
- "mov r12, #2 \n\t"
- "pld [%[pixels], #32] \n\t"
- "tmcr wcgr0, r12 \n\t" /* for shift value */
- /* alignment */
- "and r12, %[pixels], #7 \n\t"
- "bic %[pixels], %[pixels], #7 \n\t"
- "tmcr wcgr1, r12 \n\t"
- "add r12, r12, #1 \n\t"
- "tmcr wcgr2, r12 \n\t"
-
- // [wr0 wr1 wr2 wr3] <= *
- // [wr4 wr5 wr6 wr7]
- "wldrd wr12, [%[pixels]] \n\t"
- "cmp r12, #8 \n\t"
- "wldrd wr13, [%[pixels], #8] \n\t"
- "wldrd wr14, [%[pixels], #16] \n\t"
- "add %[pixels], %[pixels], %[line_size] \n\t"
- "pld [%[pixels]] \n\t"
- "walignr1 wr2, wr12, wr13 \n\t"
- "pld [%[pixels], #32] \n\t"
- "walignr1 wr3, wr13, wr14 \n\t"
- "wmoveq wr10, wr13 \n\t"
- "wmoveq wr11, wr14 \n\t"
- "walignr2ne wr10, wr12, wr13 \n\t"
- "walignr2ne wr11, wr13, wr14 \n\t"
- "wunpckelub wr0, wr2 \n\t"
- "wunpckehub wr1, wr2 \n\t"
- "wunpckelub wr2, wr3 \n\t"
- "wunpckehub wr3, wr3 \n\t"
- "wunpckelub wr8, wr10 \n\t"
- "wunpckehub wr9, wr10 \n\t"
- "wunpckelub wr10, wr11 \n\t"
- "wunpckehub wr11, wr11 \n\t"
- "waddhus wr0, wr0, wr8 \n\t"
- "waddhus wr1, wr1, wr9 \n\t"
- "waddhus wr2, wr2, wr10 \n\t"
- "waddhus wr3, wr3, wr11 \n\t"
-
- "1: \n\t"
- // [wr0 wr1 wr2 wr3]
- // [wr4 wr5 wr6 wr7] <= *
- "wldrd wr12, [%[pixels]] \n\t"
- "cmp r12, #8 \n\t"
- "wldrd wr13, [%[pixels], #8] \n\t"
- "wldrd wr14, [%[pixels], #16] \n\t"
- "add %[pixels], %[pixels], %[line_size] \n\t"
- "walignr1 wr6, wr12, wr13 \n\t"
- "pld [%[pixels]] \n\t"
- "pld [%[pixels], #32] \n\t"
- "walignr1 wr7, wr13, wr14 \n\t"
- "wmoveq wr10, wr13 \n\t"
- "wmoveq wr11, wr14 \n\t"
- "walignr2ne wr10, wr12, wr13 \n\t"
- "walignr2ne wr11, wr13, wr14 \n\t"
- "wunpckelub wr4, wr6 \n\t"
- "wunpckehub wr5, wr6 \n\t"
- "wunpckelub wr6, wr7 \n\t"
- "wunpckehub wr7, wr7 \n\t"
- "wunpckelub wr8, wr10 \n\t"
- "wunpckehub wr9, wr10 \n\t"
- "wunpckelub wr10, wr11 \n\t"
- "wunpckehub wr11, wr11 \n\t"
- "waddhus wr4, wr4, wr8 \n\t"
- "waddhus wr5, wr5, wr9 \n\t"
- "waddhus wr6, wr6, wr10 \n\t"
- "waddhus wr7, wr7, wr11 \n\t"
- "waddhus wr8, wr0, wr4 \n\t"
- "waddhus wr9, wr1, wr5 \n\t"
- "waddhus wr10, wr2, wr6 \n\t"
- "waddhus wr11, wr3, wr7 \n\t"
- "waddhus wr8, wr8, wr15 \n\t"
- "waddhus wr9, wr9, wr15 \n\t"
- "waddhus wr10, wr10, wr15 \n\t"
- "waddhus wr11, wr11, wr15 \n\t"
- "wsrlhg wr8, wr8, wcgr0 \n\t"
- "wsrlhg wr9, wr9, wcgr0 \n\t"
- "wsrlhg wr10, wr10, wcgr0 \n\t"
- "wsrlhg wr11, wr11, wcgr0 \n\t"
- "wpackhus wr8, wr8, wr9 \n\t"
- "wpackhus wr9, wr10, wr11 \n\t"
- "wstrd wr8, [%[block]] \n\t"
- "wstrd wr9, [%[block], #8] \n\t"
- "add %[block], %[block], %[line_size] \n\t"
-
- // [wr0 wr1 wr2 wr3] <= *
- // [wr4 wr5 wr6 wr7]
- "wldrd wr12, [%[pixels]] \n\t"
- "wldrd wr13, [%[pixels], #8] \n\t"
- "wldrd wr14, [%[pixels], #16] \n\t"
- "add %[pixels], %[pixels], %[line_size] \n\t"
- "walignr1 wr2, wr12, wr13 \n\t"
- "pld [%[pixels]] \n\t"
- "pld [%[pixels], #32] \n\t"
- "walignr1 wr3, wr13, wr14 \n\t"
- "wmoveq wr10, wr13 \n\t"
- "wmoveq wr11, wr14 \n\t"
- "walignr2ne wr10, wr12, wr13 \n\t"
- "walignr2ne wr11, wr13, wr14 \n\t"
- "wunpckelub wr0, wr2 \n\t"
- "wunpckehub wr1, wr2 \n\t"
- "wunpckelub wr2, wr3 \n\t"
- "wunpckehub wr3, wr3 \n\t"
- "wunpckelub wr8, wr10 \n\t"
- "wunpckehub wr9, wr10 \n\t"
- "wunpckelub wr10, wr11 \n\t"
- "wunpckehub wr11, wr11 \n\t"
- "waddhus wr0, wr0, wr8 \n\t"
- "waddhus wr1, wr1, wr9 \n\t"
- "waddhus wr2, wr2, wr10 \n\t"
- "waddhus wr3, wr3, wr11 \n\t"
- "waddhus wr8, wr0, wr4 \n\t"
- "waddhus wr9, wr1, wr5 \n\t"
- "waddhus wr10, wr2, wr6 \n\t"
- "waddhus wr11, wr3, wr7 \n\t"
- "waddhus wr8, wr8, wr15 \n\t"
- "waddhus wr9, wr9, wr15 \n\t"
- "waddhus wr10, wr10, wr15 \n\t"
- "waddhus wr11, wr11, wr15 \n\t"
- "wsrlhg wr8, wr8, wcgr0 \n\t"
- "wsrlhg wr9, wr9, wcgr0 \n\t"
- "wsrlhg wr10, wr10, wcgr0 \n\t"
- "wsrlhg wr11, wr11, wcgr0 \n\t"
- "wpackhus wr8, wr8, wr9 \n\t"
- "wpackhus wr9, wr10, wr11 \n\t"
- "wstrd wr8, [%[block]] \n\t"
- "wstrd wr9, [%[block], #8] \n\t"
- "add %[block], %[block], %[line_size] \n\t"
-
- "subs %[h], %[h], #2 \n\t"
- "bne 1b \n\t"
- : [h]"+r"(h), [pixels]"+r"(pixels), [block]"+r"(block)
- : [line_size]"r"(line_size)
- : "r12", "memory");
-}
-
-void DEF(avg, pixels8_xy2)(uint8_t *block, const uint8_t *pixels, const int line_size, int h)
-{
- // [wr0 wr1 wr2 wr3] for previous line
- // [wr4 wr5 wr6 wr7] for current line
- SET_RND(wr15); // =2 for rnd and =1 for no_rnd version
- __asm__ __volatile__(
- "pld [%[block]] \n\t"
- "pld [%[block], #32] \n\t"
- "pld [%[pixels]] \n\t"
- "mov r12, #2 \n\t"
- "pld [%[pixels], #32] \n\t"
- "tmcr wcgr0, r12 \n\t" /* for shift value */
- "and r12, %[pixels], #7 \n\t"
- "bic %[pixels], %[pixels], #7 \n\t"
- "tmcr wcgr1, r12 \n\t"
-
- // [wr0 wr1 wr2 wr3] <= *
- // [wr4 wr5 wr6 wr7]
- "wldrd wr12, [%[pixels]] \n\t"
- "add r12, r12, #1 \n\t"
- "wldrd wr13, [%[pixels], #8] \n\t"
- "tmcr wcgr2, r12 \n\t"
- "add %[pixels], %[pixels], %[line_size] \n\t"
- "cmp r12, #8 \n\t"
- "pld [%[pixels]] \n\t"
- "pld [%[pixels], #32] \n\t"
- "walignr1 wr2, wr12, wr13 \n\t"
- "wmoveq wr10, wr13 \n\t"
- "walignr2ne wr10, wr12, wr13 \n\t"
- "wunpckelub wr0, wr2 \n\t"
- "wunpckehub wr1, wr2 \n\t"
- "wunpckelub wr8, wr10 \n\t"
- "wunpckehub wr9, wr10 \n\t"
- "waddhus wr0, wr0, wr8 \n\t"
- "waddhus wr1, wr1, wr9 \n\t"
-
- "1: \n\t"
- // [wr0 wr1 wr2 wr3]
- // [wr4 wr5 wr6 wr7] <= *
- "wldrd wr12, [%[pixels]] \n\t"
- "cmp r12, #8 \n\t"
- "wldrd wr13, [%[pixels], #8] \n\t"
- "add %[pixels], %[pixels], %[line_size] \n\t"
- "walignr1 wr6, wr12, wr13 \n\t"
- "pld [%[pixels]] \n\t"
- "pld [%[pixels], #32] \n\t"
- "wmoveq wr10, wr13 \n\t"
- "walignr2ne wr10, wr12, wr13 \n\t"
- "wunpckelub wr4, wr6 \n\t"
- "wunpckehub wr5, wr6 \n\t"
- "wunpckelub wr8, wr10 \n\t"
- "wunpckehub wr9, wr10 \n\t"
- "waddhus wr4, wr4, wr8 \n\t"
- "waddhus wr5, wr5, wr9 \n\t"
- "waddhus wr8, wr0, wr4 \n\t"
- "waddhus wr9, wr1, wr5 \n\t"
- "waddhus wr8, wr8, wr15 \n\t"
- "waddhus wr9, wr9, wr15 \n\t"
- "wldrd wr12, [%[block]] \n\t"
- "wsrlhg wr8, wr8, wcgr0 \n\t"
- "wsrlhg wr9, wr9, wcgr0 \n\t"
- "wpackhus wr8, wr8, wr9 \n\t"
- WAVG2B" wr8, wr8, wr12 \n\t"
- "wstrd wr8, [%[block]] \n\t"
- "add %[block], %[block], %[line_size] \n\t"
- "wldrd wr12, [%[pixels]] \n\t"
- "pld [%[block]] \n\t"
- "pld [%[block], #32] \n\t"
-
- // [wr0 wr1 wr2 wr3] <= *
- // [wr4 wr5 wr6 wr7]
- "wldrd wr13, [%[pixels], #8] \n\t"
- "add %[pixels], %[pixels], %[line_size] \n\t"
- "walignr1 wr2, wr12, wr13 \n\t"
- "pld [%[pixels]] \n\t"
- "pld [%[pixels], #32] \n\t"
- "wmoveq wr10, wr13 \n\t"
- "walignr2ne wr10, wr12, wr13 \n\t"
- "wunpckelub wr0, wr2 \n\t"
- "wunpckehub wr1, wr2 \n\t"
- "wunpckelub wr8, wr10 \n\t"
- "wunpckehub wr9, wr10 \n\t"
- "waddhus wr0, wr0, wr8 \n\t"
- "waddhus wr1, wr1, wr9 \n\t"
- "waddhus wr8, wr0, wr4 \n\t"
- "waddhus wr9, wr1, wr5 \n\t"
- "waddhus wr8, wr8, wr15 \n\t"
- "waddhus wr9, wr9, wr15 \n\t"
- "wldrd wr12, [%[block]] \n\t"
- "wsrlhg wr8, wr8, wcgr0 \n\t"
- "wsrlhg wr9, wr9, wcgr0 \n\t"
- "wpackhus wr8, wr8, wr9 \n\t"
- "subs %[h], %[h], #2 \n\t"
- WAVG2B" wr8, wr8, wr12 \n\t"
- "wstrd wr8, [%[block]] \n\t"
- "add %[block], %[block], %[line_size] \n\t"
- "pld [%[block]] \n\t"
- "pld [%[block], #32] \n\t"
- "bne 1b \n\t"
- : [h]"+r"(h), [pixels]"+r"(pixels), [block]"+r"(block)
- : [line_size]"r"(line_size)
- : "r12", "memory");
-}
-
-void DEF(avg, pixels16_xy2)(uint8_t *block, const uint8_t *pixels, const int line_size, int h)
-{
- // [wr0 wr1 wr2 wr3] for previous line
- // [wr4 wr5 wr6 wr7] for current line
- SET_RND(wr15); // =2 for rnd and =1 for no_rnd version
- __asm__ __volatile__(
- "pld [%[block]] \n\t"
- "pld [%[block], #32] \n\t"
- "pld [%[pixels]] \n\t"
- "mov r12, #2 \n\t"
- "pld [%[pixels], #32] \n\t"
- "tmcr wcgr0, r12 \n\t" /* for shift value */
- /* alignment */
- "and r12, %[pixels], #7 \n\t"
- "bic %[pixels], %[pixels], #7 \n\t"
- "tmcr wcgr1, r12 \n\t"
- "add r12, r12, #1 \n\t"
- "tmcr wcgr2, r12 \n\t"
-
- // [wr0 wr1 wr2 wr3] <= *
- // [wr4 wr5 wr6 wr7]
- "wldrd wr12, [%[pixels]] \n\t"
- "cmp r12, #8 \n\t"
- "wldrd wr13, [%[pixels], #8] \n\t"
- "wldrd wr14, [%[pixels], #16] \n\t"
- "add %[pixels], %[pixels], %[line_size] \n\t"
- "pld [%[pixels]] \n\t"
- "walignr1 wr2, wr12, wr13 \n\t"
- "pld [%[pixels], #32] \n\t"
- "walignr1 wr3, wr13, wr14 \n\t"
- "wmoveq wr10, wr13 \n\t"
- "wmoveq wr11, wr14 \n\t"
- "walignr2ne wr10, wr12, wr13 \n\t"
- "walignr2ne wr11, wr13, wr14 \n\t"
- "wunpckelub wr0, wr2 \n\t"
- "wunpckehub wr1, wr2 \n\t"
- "wunpckelub wr2, wr3 \n\t"
- "wunpckehub wr3, wr3 \n\t"
- "wunpckelub wr8, wr10 \n\t"
- "wunpckehub wr9, wr10 \n\t"
- "wunpckelub wr10, wr11 \n\t"
- "wunpckehub wr11, wr11 \n\t"
- "waddhus wr0, wr0, wr8 \n\t"
- "waddhus wr1, wr1, wr9 \n\t"
- "waddhus wr2, wr2, wr10 \n\t"
- "waddhus wr3, wr3, wr11 \n\t"
-
- "1: \n\t"
- // [wr0 wr1 wr2 wr3]
- // [wr4 wr5 wr6 wr7] <= *
- "wldrd wr12, [%[pixels]] \n\t"
- "cmp r12, #8 \n\t"
- "wldrd wr13, [%[pixels], #8] \n\t"
- "wldrd wr14, [%[pixels], #16] \n\t"
- "add %[pixels], %[pixels], %[line_size] \n\t"
- "walignr1 wr6, wr12, wr13 \n\t"
- "pld [%[pixels]] \n\t"
- "pld [%[pixels], #32] \n\t"
- "walignr1 wr7, wr13, wr14 \n\t"
- "wmoveq wr10, wr13 \n\t"
- "wmoveq wr11, wr14 \n\t"
- "walignr2ne wr10, wr12, wr13 \n\t"
- "walignr2ne wr11, wr13, wr14 \n\t"
- "wunpckelub wr4, wr6 \n\t"
- "wunpckehub wr5, wr6 \n\t"
- "wunpckelub wr6, wr7 \n\t"
- "wunpckehub wr7, wr7 \n\t"
- "wunpckelub wr8, wr10 \n\t"
- "wunpckehub wr9, wr10 \n\t"
- "wunpckelub wr10, wr11 \n\t"
- "wunpckehub wr11, wr11 \n\t"
- "waddhus wr4, wr4, wr8 \n\t"
- "waddhus wr5, wr5, wr9 \n\t"
- "waddhus wr6, wr6, wr10 \n\t"
- "waddhus wr7, wr7, wr11 \n\t"
- "waddhus wr8, wr0, wr4 \n\t"
- "waddhus wr9, wr1, wr5 \n\t"
- "waddhus wr10, wr2, wr6 \n\t"
- "waddhus wr11, wr3, wr7 \n\t"
- "waddhus wr8, wr8, wr15 \n\t"
- "waddhus wr9, wr9, wr15 \n\t"
- "waddhus wr10, wr10, wr15 \n\t"
- "waddhus wr11, wr11, wr15 \n\t"
- "wsrlhg wr8, wr8, wcgr0 \n\t"
- "wsrlhg wr9, wr9, wcgr0 \n\t"
- "wldrd wr12, [%[block]] \n\t"
- "wldrd wr13, [%[block], #8] \n\t"
- "wsrlhg wr10, wr10, wcgr0 \n\t"
- "wsrlhg wr11, wr11, wcgr0 \n\t"
- "wpackhus wr8, wr8, wr9 \n\t"
- "wpackhus wr9, wr10, wr11 \n\t"
- WAVG2B" wr8, wr8, wr12 \n\t"
- WAVG2B" wr9, wr9, wr13 \n\t"
- "wstrd wr8, [%[block]] \n\t"
- "wstrd wr9, [%[block], #8] \n\t"
- "add %[block], %[block], %[line_size] \n\t"
-
- // [wr0 wr1 wr2 wr3] <= *
- // [wr4 wr5 wr6 wr7]
- "wldrd wr12, [%[pixels]] \n\t"
- "pld [%[block]] \n\t"
- "wldrd wr13, [%[pixels], #8] \n\t"
- "pld [%[block], #32] \n\t"
- "wldrd wr14, [%[pixels], #16] \n\t"
- "add %[pixels], %[pixels], %[line_size] \n\t"
- "walignr1 wr2, wr12, wr13 \n\t"
- "pld [%[pixels]] \n\t"
- "pld [%[pixels], #32] \n\t"
- "walignr1 wr3, wr13, wr14 \n\t"
- "wmoveq wr10, wr13 \n\t"
- "wmoveq wr11, wr14 \n\t"
- "walignr2ne wr10, wr12, wr13 \n\t"
- "walignr2ne wr11, wr13, wr14 \n\t"
- "wunpckelub wr0, wr2 \n\t"
- "wunpckehub wr1, wr2 \n\t"
- "wunpckelub wr2, wr3 \n\t"
- "wunpckehub wr3, wr3 \n\t"
- "wunpckelub wr8, wr10 \n\t"
- "wunpckehub wr9, wr10 \n\t"
- "wunpckelub wr10, wr11 \n\t"
- "wunpckehub wr11, wr11 \n\t"
- "waddhus wr0, wr0, wr8 \n\t"
- "waddhus wr1, wr1, wr9 \n\t"
- "waddhus wr2, wr2, wr10 \n\t"
- "waddhus wr3, wr3, wr11 \n\t"
- "waddhus wr8, wr0, wr4 \n\t"
- "waddhus wr9, wr1, wr5 \n\t"
- "waddhus wr10, wr2, wr6 \n\t"
- "waddhus wr11, wr3, wr7 \n\t"
- "waddhus wr8, wr8, wr15 \n\t"
- "waddhus wr9, wr9, wr15 \n\t"
- "waddhus wr10, wr10, wr15 \n\t"
- "waddhus wr11, wr11, wr15 \n\t"
- "wsrlhg wr8, wr8, wcgr0 \n\t"
- "wsrlhg wr9, wr9, wcgr0 \n\t"
- "wldrd wr12, [%[block]] \n\t"
- "wldrd wr13, [%[block], #8] \n\t"
- "wsrlhg wr10, wr10, wcgr0 \n\t"
- "wsrlhg wr11, wr11, wcgr0 \n\t"
- "wpackhus wr8, wr8, wr9 \n\t"
- "wpackhus wr9, wr10, wr11 \n\t"
- WAVG2B" wr8, wr8, wr12 \n\t"
- WAVG2B" wr9, wr9, wr13 \n\t"
- "wstrd wr8, [%[block]] \n\t"
- "wstrd wr9, [%[block], #8] \n\t"
- "add %[block], %[block], %[line_size] \n\t"
- "subs %[h], %[h], #2 \n\t"
- "pld [%[block]] \n\t"
- "pld [%[block], #32] \n\t"
- "bne 1b \n\t"
- : [h]"+r"(h), [pixels]"+r"(pixels), [block]"+r"(block)
- : [line_size]"r"(line_size)
- : "r12", "memory");
-}
diff --git a/src/libffmpeg/libavcodec/armv4l/jrevdct_arm.S b/src/libffmpeg/libavcodec/armv4l/jrevdct_arm.S
deleted file mode 100644
index 294ea4750..000000000
--- a/src/libffmpeg/libavcodec/armv4l/jrevdct_arm.S
+++ /dev/null
@@ -1,386 +0,0 @@
-/*
- C-like prototype :
- void j_rev_dct_ARM(DCTBLOCK data)
-
- With DCTBLOCK being a pointer to an array of 64 'signed shorts'
-
- Copyright (c) 2001 Lionel Ulmer (lionel.ulmer@free.fr / bbrox@bbrox.org)
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-*/
-#define FIX_0_298631336 2446
-#define FIX_0_541196100 4433
-#define FIX_0_765366865 6270
-#define FIX_1_175875602 9633
-#define FIX_1_501321110 12299
-#define FIX_2_053119869 16819
-#define FIX_3_072711026 25172
-#define FIX_M_0_390180644 -3196
-#define FIX_M_0_899976223 -7373
-#define FIX_M_1_847759065 -15137
-#define FIX_M_1_961570560 -16069
-#define FIX_M_2_562915447 -20995
-#define FIX_0xFFFF 0xFFFF
-
-#define FIX_0_298631336_ID 0
-#define FIX_0_541196100_ID 4
-#define FIX_0_765366865_ID 8
-#define FIX_1_175875602_ID 12
-#define FIX_1_501321110_ID 16
-#define FIX_2_053119869_ID 20
-#define FIX_3_072711026_ID 24
-#define FIX_M_0_390180644_ID 28
-#define FIX_M_0_899976223_ID 32
-#define FIX_M_1_847759065_ID 36
-#define FIX_M_1_961570560_ID 40
-#define FIX_M_2_562915447_ID 44
-#define FIX_0xFFFF_ID 48
- .text
- .align
-
- .global j_rev_dct_ARM
-j_rev_dct_ARM:
- stmdb sp!, { r4 - r12, lr } @ all callee saved regs
-
- sub sp, sp, #4 @ reserve some space on the stack
- str r0, [ sp ] @ save the DCT pointer to the stack
-
- mov lr, r0 @ lr = pointer to the current row
- mov r12, #8 @ r12 = row-counter
- add r11, pc, #(const_array-.-8) @ r11 = base pointer to the constants array
-row_loop:
- ldrsh r0, [lr, # 0] @ r0 = 'd0'
- ldrsh r1, [lr, # 8] @ r1 = 'd1'
-
- @ Optimization for row that have all items except the first set to 0
- @ (this works as the DCTELEMS are always 4-byte aligned)
- ldr r5, [lr, # 0]
- ldr r2, [lr, # 4]
- ldr r3, [lr, # 8]
- ldr r4, [lr, #12]
- orr r3, r3, r4
- orr r3, r3, r2
- orrs r5, r3, r5
- beq end_of_row_loop @ nothing to be done as ALL of them are '0'
- orrs r2, r3, r1
- beq empty_row
-
- ldrsh r2, [lr, # 2] @ r2 = 'd2'
- ldrsh r4, [lr, # 4] @ r4 = 'd4'
- ldrsh r6, [lr, # 6] @ r6 = 'd6'
-
- ldr r3, [r11, #FIX_0_541196100_ID]
- add r7, r2, r6
- ldr r5, [r11, #FIX_M_1_847759065_ID]
- mul r7, r3, r7 @ r7 = z1
- ldr r3, [r11, #FIX_0_765366865_ID]
- mla r6, r5, r6, r7 @ r6 = tmp2
- add r5, r0, r4 @ r5 = tmp0
- mla r2, r3, r2, r7 @ r2 = tmp3
- sub r3, r0, r4 @ r3 = tmp1
-
- add r0, r2, r5, lsl #13 @ r0 = tmp10
- rsb r2, r2, r5, lsl #13 @ r2 = tmp13
- add r4, r6, r3, lsl #13 @ r4 = tmp11
- rsb r3, r6, r3, lsl #13 @ r3 = tmp12
-
- stmdb sp!, { r0, r2, r3, r4 } @ save on the stack tmp10, tmp13, tmp12, tmp11
-
- ldrsh r3, [lr, #10] @ r3 = 'd3'
- ldrsh r5, [lr, #12] @ r5 = 'd5'
- ldrsh r7, [lr, #14] @ r7 = 'd7'
-
- add r0, r3, r5 @ r0 = 'z2'
- add r2, r1, r7 @ r2 = 'z1'
- add r4, r3, r7 @ r4 = 'z3'
- add r6, r1, r5 @ r6 = 'z4'
- ldr r9, [r11, #FIX_1_175875602_ID]
- add r8, r4, r6 @ r8 = z3 + z4
- ldr r10, [r11, #FIX_M_0_899976223_ID]
- mul r8, r9, r8 @ r8 = 'z5'
- ldr r9, [r11, #FIX_M_2_562915447_ID]
- mul r2, r10, r2 @ r2 = 'z1'
- ldr r10, [r11, #FIX_M_1_961570560_ID]
- mul r0, r9, r0 @ r0 = 'z2'
- ldr r9, [r11, #FIX_M_0_390180644_ID]
- mla r4, r10, r4, r8 @ r4 = 'z3'
- ldr r10, [r11, #FIX_0_298631336_ID]
- mla r6, r9, r6, r8 @ r6 = 'z4'
- ldr r9, [r11, #FIX_2_053119869_ID]
- mla r7, r10, r7, r2 @ r7 = tmp0 + z1
- ldr r10, [r11, #FIX_3_072711026_ID]
- mla r5, r9, r5, r0 @ r5 = tmp1 + z2
- ldr r9, [r11, #FIX_1_501321110_ID]
- mla r3, r10, r3, r0 @ r3 = tmp2 + z2
- add r7, r7, r4 @ r7 = tmp0
- mla r1, r9, r1, r2 @ r1 = tmp3 + z1
- add r5, r5, r6 @ r5 = tmp1
- add r3, r3, r4 @ r3 = tmp2
- add r1, r1, r6 @ r1 = tmp3
-
- ldmia sp!, { r0, r2, r4, r6 } @ r0 = tmp10 / r2 = tmp13 / r4 = tmp12 / r6 = tmp11
- @ r1 = tmp3 / r3 = tmp2 / r5 = tmp1 / r7 = tmp0
-
- @ Compute DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS)
- add r8, r0, r1
- add r8, r8, #(1<<10)
- mov r8, r8, asr #11
- strh r8, [lr, # 0]
-
- @ Compute DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS)
- sub r8, r0, r1
- add r8, r8, #(1<<10)
- mov r8, r8, asr #11
- strh r8, [lr, #14]
-
- @ Compute DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS)
- add r8, r6, r3
- add r8, r8, #(1<<10)
- mov r8, r8, asr #11
- strh r8, [lr, # 2]
-
- @ Compute DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS)
- sub r8, r6, r3
- add r8, r8, #(1<<10)
- mov r8, r8, asr #11
- strh r8, [lr, #12]
-
- @ Compute DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS)
- add r8, r4, r5
- add r8, r8, #(1<<10)
- mov r8, r8, asr #11
- strh r8, [lr, # 4]
-
- @ Compute DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS)
- sub r8, r4, r5
- add r8, r8, #(1<<10)
- mov r8, r8, asr #11
- strh r8, [lr, #10]
-
- @ Compute DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS)
- add r8, r2, r7
- add r8, r8, #(1<<10)
- mov r8, r8, asr #11
- strh r8, [lr, # 6]
-
- @ Compute DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS)
- sub r8, r2, r7
- add r8, r8, #(1<<10)
- mov r8, r8, asr #11
- strh r8, [lr, # 8]
-
- @ End of row loop
- add lr, lr, #16
- subs r12, r12, #1
- bne row_loop
- beq start_column_loop
-
-empty_row:
- ldr r1, [r11, #FIX_0xFFFF_ID]
- mov r0, r0, lsl #2
- and r0, r0, r1
- add r0, r0, r0, lsl #16
- str r0, [lr, # 0]
- str r0, [lr, # 4]
- str r0, [lr, # 8]
- str r0, [lr, #12]
-
-end_of_row_loop:
- @ End of loop
- add lr, lr, #16
- subs r12, r12, #1
- bne row_loop
-
-start_column_loop:
- @ Start of column loop
- ldr lr, [ sp ]
- mov r12, #8
-column_loop:
- ldrsh r0, [lr, #( 0*8)] @ r0 = 'd0'
- ldrsh r2, [lr, #( 4*8)] @ r2 = 'd2'
- ldrsh r4, [lr, #( 8*8)] @ r4 = 'd4'
- ldrsh r6, [lr, #(12*8)] @ r6 = 'd6'
-
- ldr r3, [r11, #FIX_0_541196100_ID]
- add r1, r2, r6
- ldr r5, [r11, #FIX_M_1_847759065_ID]
- mul r1, r3, r1 @ r1 = z1
- ldr r3, [r11, #FIX_0_765366865_ID]
- mla r6, r5, r6, r1 @ r6 = tmp2
- add r5, r0, r4 @ r5 = tmp0
- mla r2, r3, r2, r1 @ r2 = tmp3
- sub r3, r0, r4 @ r3 = tmp1
-
- add r0, r2, r5, lsl #13 @ r0 = tmp10
- rsb r2, r2, r5, lsl #13 @ r2 = tmp13
- add r4, r6, r3, lsl #13 @ r4 = tmp11
- rsb r6, r6, r3, lsl #13 @ r6 = tmp12
-
- ldrsh r1, [lr, #( 2*8)] @ r1 = 'd1'
- ldrsh r3, [lr, #( 6*8)] @ r3 = 'd3'
- ldrsh r5, [lr, #(10*8)] @ r5 = 'd5'
- ldrsh r7, [lr, #(14*8)] @ r7 = 'd7'
-
- @ Check for empty odd column (happens about 20 to 25 % of the time according to my stats)
- orr r9, r1, r3
- orr r10, r5, r7
- orrs r10, r9, r10
- beq empty_odd_column
-
- stmdb sp!, { r0, r2, r4, r6 } @ save on the stack tmp10, tmp13, tmp12, tmp11
-
- add r0, r3, r5 @ r0 = 'z2'
- add r2, r1, r7 @ r2 = 'z1'
- add r4, r3, r7 @ r4 = 'z3'
- add r6, r1, r5 @ r6 = 'z4'
- ldr r9, [r11, #FIX_1_175875602_ID]
- add r8, r4, r6
- ldr r10, [r11, #FIX_M_0_899976223_ID]
- mul r8, r9, r8 @ r8 = 'z5'
- ldr r9, [r11, #FIX_M_2_562915447_ID]
- mul r2, r10, r2 @ r2 = 'z1'
- ldr r10, [r11, #FIX_M_1_961570560_ID]
- mul r0, r9, r0 @ r0 = 'z2'
- ldr r9, [r11, #FIX_M_0_390180644_ID]
- mla r4, r10, r4, r8 @ r4 = 'z3'
- ldr r10, [r11, #FIX_0_298631336_ID]
- mla r6, r9, r6, r8 @ r6 = 'z4'
- ldr r9, [r11, #FIX_2_053119869_ID]
- mla r7, r10, r7, r2 @ r7 = tmp0 + z1
- ldr r10, [r11, #FIX_3_072711026_ID]
- mla r5, r9, r5, r0 @ r5 = tmp1 + z2
- ldr r9, [r11, #FIX_1_501321110_ID]
- mla r3, r10, r3, r0 @ r3 = tmp2 + z2
- add r7, r7, r4 @ r7 = tmp0
- mla r1, r9, r1, r2 @ r1 = tmp3 + z1
- add r5, r5, r6 @ r5 = tmp1
- add r3, r3, r4 @ r3 = tmp2
- add r1, r1, r6 @ r1 = tmp3
-
- ldmia sp!, { r0, r2, r4, r6 } @ r0 = tmp10 / r2 = tmp13 / r4 = tmp11 / r6 = tmp12
- @ r1 = tmp3 / r3 = tmp2 / r5 = tmp1 / r7 = tmp0
-
- @ Compute DESCALE(tmp10 + tmp3, CONST_BITS+PASS1_BITS+3)
- add r8, r0, r1
- add r8, r8, #(1<<17)
- mov r8, r8, asr #18
- strh r8, [lr, #( 0*8)]
-
- @ Compute DESCALE(tmp10 - tmp3, CONST_BITS+PASS1_BITS+3)
- sub r8, r0, r1
- add r8, r8, #(1<<17)
- mov r8, r8, asr #18
- strh r8, [lr, #(14*8)]
-
- @ Compute DESCALE(tmp11 + tmp2, CONST_BITS+PASS1_BITS+3)
- add r8, r4, r3
- add r8, r8, #(1<<17)
- mov r8, r8, asr #18
- strh r8, [lr, #( 2*8)]
-
- @ Compute DESCALE(tmp11 - tmp2, CONST_BITS+PASS1_BITS+3)
- sub r8, r4, r3
- add r8, r8, #(1<<17)
- mov r8, r8, asr #18
- strh r8, [lr, #(12*8)]
-
- @ Compute DESCALE(tmp12 + tmp1, CONST_BITS+PASS1_BITS+3)
- add r8, r6, r5
- add r8, r8, #(1<<17)
- mov r8, r8, asr #18
- strh r8, [lr, #( 4*8)]
-
- @ Compute DESCALE(tmp12 - tmp1, CONST_BITS+PASS1_BITS+3)
- sub r8, r6, r5
- add r8, r8, #(1<<17)
- mov r8, r8, asr #18
- strh r8, [lr, #(10*8)]
-
- @ Compute DESCALE(tmp13 + tmp0, CONST_BITS+PASS1_BITS+3)
- add r8, r2, r7
- add r8, r8, #(1<<17)
- mov r8, r8, asr #18
- strh r8, [lr, #( 6*8)]
-
- @ Compute DESCALE(tmp13 - tmp0, CONST_BITS+PASS1_BITS+3)
- sub r8, r2, r7
- add r8, r8, #(1<<17)
- mov r8, r8, asr #18
- strh r8, [lr, #( 8*8)]
-
- @ End of row loop
- add lr, lr, #2
- subs r12, r12, #1
- bne column_loop
- beq the_end
-
-empty_odd_column:
- @ Compute DESCALE(tmp10 + tmp3, CONST_BITS+PASS1_BITS+3)
- @ Compute DESCALE(tmp10 - tmp3, CONST_BITS+PASS1_BITS+3)
- add r0, r0, #(1<<17)
- mov r0, r0, asr #18
- strh r0, [lr, #( 0*8)]
- strh r0, [lr, #(14*8)]
-
- @ Compute DESCALE(tmp11 + tmp2, CONST_BITS+PASS1_BITS+3)
- @ Compute DESCALE(tmp11 - tmp2, CONST_BITS+PASS1_BITS+3)
- add r4, r4, #(1<<17)
- mov r4, r4, asr #18
- strh r4, [lr, #( 2*8)]
- strh r4, [lr, #(12*8)]
-
- @ Compute DESCALE(tmp12 + tmp1, CONST_BITS+PASS1_BITS+3)
- @ Compute DESCALE(tmp12 - tmp1, CONST_BITS+PASS1_BITS+3)
- add r6, r6, #(1<<17)
- mov r6, r6, asr #18
- strh r6, [lr, #( 4*8)]
- strh r6, [lr, #(10*8)]
-
- @ Compute DESCALE(tmp13 + tmp0, CONST_BITS+PASS1_BITS+3)
- @ Compute DESCALE(tmp13 - tmp0, CONST_BITS+PASS1_BITS+3)
- add r2, r2, #(1<<17)
- mov r2, r2, asr #18
- strh r2, [lr, #( 6*8)]
- strh r2, [lr, #( 8*8)]
-
- @ End of row loop
- add lr, lr, #2
- subs r12, r12, #1
- bne column_loop
-
-the_end:
- @ The end....
- add sp, sp, #4
- ldmia sp!, { r4 - r12, pc } @ restore callee saved regs and return
-
-const_array:
- .align
- .word FIX_0_298631336
- .word FIX_0_541196100
- .word FIX_0_765366865
- .word FIX_1_175875602
- .word FIX_1_501321110
- .word FIX_2_053119869
- .word FIX_3_072711026
- .word FIX_M_0_390180644
- .word FIX_M_0_899976223
- .word FIX_M_1_847759065
- .word FIX_M_1_961570560
- .word FIX_M_2_562915447
- .word FIX_0xFFFF
diff --git a/src/libffmpeg/libavcodec/armv4l/libavcodec_armv4l_dummy.c b/src/libffmpeg/libavcodec/armv4l/libavcodec_armv4l_dummy.c
deleted file mode 100644
index ebe4c235c..000000000
--- a/src/libffmpeg/libavcodec/armv4l/libavcodec_armv4l_dummy.c
+++ /dev/null
@@ -1,2 +0,0 @@
-
-char libavcodec_armv4l_dummy;
diff --git a/src/libffmpeg/libavcodec/armv4l/mathops.h b/src/libffmpeg/libavcodec/armv4l/mathops.h
deleted file mode 100644
index 7ddd0ec6e..000000000
--- a/src/libffmpeg/libavcodec/armv4l/mathops.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * simple math operations
- * Copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at> et al
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifdef FRAC_BITS
-# define MULL(a, b) \
- ({ int lo, hi;\
- asm("smull %0, %1, %2, %3 \n\t"\
- "mov %0, %0, lsr %4\n\t"\
- "add %1, %0, %1, lsl %5\n\t"\
- : "=&r"(lo), "=&r"(hi)\
- : "r"(b), "r"(a), "i"(FRAC_BITS), "i"(32-FRAC_BITS));\
- hi; })
-#endif
-
-#define MULH(a, b) \
- ({ int lo, hi;\
- asm ("smull %0, %1, %2, %3" : "=&r"(lo), "=&r"(hi) : "r"(b), "r"(a));\
- hi; })
-
-#if defined(HAVE_ARMV5TE)
-
-/* signed 16x16 -> 32 multiply add accumulate */
-# define MAC16(rt, ra, rb) \
- asm ("smlabb %0, %2, %3, %0" : "=r" (rt) : "0" (rt), "r" (ra), "r" (rb));
-/* signed 16x16 -> 32 multiply */
-# define MUL16(ra, rb) \
- ({ int __rt; \
- asm ("smulbb %0, %1, %2" : "=r" (__rt) : "r" (ra), "r" (rb)); \
- __rt; })
-
-#endif
diff --git a/src/libffmpeg/libavcodec/armv4l/mpegvideo_arm.c b/src/libffmpeg/libavcodec/armv4l/mpegvideo_arm.c
deleted file mode 100644
index ca972e6ed..000000000
--- a/src/libffmpeg/libavcodec/armv4l/mpegvideo_arm.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2002 Michael Niedermayer
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include "../dsputil.h"
-#include "../mpegvideo.h"
-#include "../avcodec.h"
-
-extern void MPV_common_init_iwmmxt(MpegEncContext *s);
-extern void MPV_common_init_armv5te(MpegEncContext *s);
-
-void MPV_common_init_armv4l(MpegEncContext *s)
-{
-#ifdef HAVE_IWMMXT
- MPV_common_init_iwmmxt(s);
-#elif defined(HAVE_ARMV5TE)
- MPV_common_init_armv5te(s);
-#endif
-}
diff --git a/src/libffmpeg/libavcodec/armv4l/mpegvideo_armv5te.c b/src/libffmpeg/libavcodec/armv4l/mpegvideo_armv5te.c
deleted file mode 100644
index a8d09b8ce..000000000
--- a/src/libffmpeg/libavcodec/armv4l/mpegvideo_armv5te.c
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Optimization of some functions from mpegvideo.c for armv5te
- * Copyright (c) 2007 Siarhei Siamashka <ssvb@users.sourceforge.net>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
- * Some useful links for those who may be interested in optimizing code for ARM.
- * ARM Architecture Reference Manual: http://www.arm.com/community/academy/resources.html
- * Instructions timings and optimization guide for ARM9E: http://www.arm.com/pdfs/DDI0222B_9EJS_r1p2.pdf
- */
-
-#include "../dsputil.h"
-#include "../mpegvideo.h"
-#include "../avcodec.h"
-
-
-#ifdef ENABLE_ARM_TESTS
-/**
- * h263 dequantizer supplementary function, it is performance critical and needs to
- * have optimized implementations for each architecture. Is also used as a reference
- * implementation in regression tests
- */
-static inline void dct_unquantize_h263_helper_c(DCTELEM *block, int qmul, int qadd, int count)
-{
- int i, level;
- for (i = 0; i < count; i++) {
- level = block[i];
- if (level) {
- if (level < 0) {
- level = level * qmul - qadd;
- } else {
- level = level * qmul + qadd;
- }
- block[i] = level;
- }
- }
-}
-#endif
-
-/* GCC 3.1 or higher is required to support symbolic names in assembly code */
-#if (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))
-
-/**
- * Special optimized version of dct_unquantize_h263_helper_c, it requires the block
- * to be at least 8 bytes aligned, and may process more elements than requested.
- * But it is guaranteed to never process more than 64 elements provided that
- * xxcount argument is <= 64, so it is safe. This macro is optimized for a common
- * distribution of values for nCoeffs (they are mostly multiple of 8 plus one or
- * two extra elements). So this macro processes data as 8 elements per loop iteration
- * and contains optional 2 elements processing in the end.
- *
- * Inner loop should take 6 cycles per element on arm926ej-s (Nokia 770)
- */
-#define dct_unquantize_h263_special_helper_armv5te(xxblock, xxqmul, xxqadd, xxcount) \
-({ DCTELEM *xblock = xxblock; \
- int xqmul = xxqmul, xqadd = xxqadd, xcount = xxcount, xtmp; \
- int xdata1, xdata2; \
-__asm__ __volatile__( \
- "subs %[count], #2 \n\t" \
- "ble 2f \n\t" \
- "ldrd r4, [%[block], #0] \n\t" \
- "1: \n\t" \
- "ldrd r6, [%[block], #8] \n\t" \
-\
- "rsbs %[data1], %[zero], r4, asr #16 \n\t" \
- "addgt %[data1], %[qadd], #0 \n\t" \
- "rsblt %[data1], %[qadd], #0 \n\t" \
- "smlatbne %[data1], r4, %[qmul], %[data1] \n\t" \
-\
- "rsbs %[data2], %[zero], r5, asr #16 \n\t" \
- "addgt %[data2], %[qadd], #0 \n\t" \
- "rsblt %[data2], %[qadd], #0 \n\t" \
- "smlatbne %[data2], r5, %[qmul], %[data2] \n\t" \
-\
- "rsbs %[tmp], %[zero], r4, asl #16 \n\t" \
- "addgt %[tmp], %[qadd], #0 \n\t" \
- "rsblt %[tmp], %[qadd], #0 \n\t" \
- "smlabbne r4, r4, %[qmul], %[tmp] \n\t" \
-\
- "rsbs %[tmp], %[zero], r5, asl #16 \n\t" \
- "addgt %[tmp], %[qadd], #0 \n\t" \
- "rsblt %[tmp], %[qadd], #0 \n\t" \
- "smlabbne r5, r5, %[qmul], %[tmp] \n\t" \
-\
- "strh r4, [%[block]], #2 \n\t" \
- "strh %[data1], [%[block]], #2 \n\t" \
- "strh r5, [%[block]], #2 \n\t" \
- "strh %[data2], [%[block]], #2 \n\t" \
-\
- "rsbs %[data1], %[zero], r6, asr #16 \n\t" \
- "addgt %[data1], %[qadd], #0 \n\t" \
- "rsblt %[data1], %[qadd], #0 \n\t" \
- "smlatbne %[data1], r6, %[qmul], %[data1] \n\t" \
-\
- "rsbs %[data2], %[zero], r7, asr #16 \n\t" \
- "addgt %[data2], %[qadd], #0 \n\t" \
- "rsblt %[data2], %[qadd], #0 \n\t" \
- "smlatbne %[data2], r7, %[qmul], %[data2] \n\t" \
-\
- "rsbs %[tmp], %[zero], r6, asl #16 \n\t" \
- "addgt %[tmp], %[qadd], #0 \n\t" \
- "rsblt %[tmp], %[qadd], #0 \n\t" \
- "smlabbne r6, r6, %[qmul], %[tmp] \n\t" \
-\
- "rsbs %[tmp], %[zero], r7, asl #16 \n\t" \
- "addgt %[tmp], %[qadd], #0 \n\t" \
- "rsblt %[tmp], %[qadd], #0 \n\t" \
- "smlabbne r7, r7, %[qmul], %[tmp] \n\t" \
-\
- "strh r6, [%[block]], #2 \n\t" \
- "strh %[data1], [%[block]], #2 \n\t" \
- "strh r7, [%[block]], #2 \n\t" \
- "strh %[data2], [%[block]], #2 \n\t" \
-\
- "subs %[count], #8 \n\t" \
- "ldrgtd r4, [%[block], #0] \n\t" /* load data early to avoid load/use pipeline stall */ \
- "bgt 1b \n\t" \
-\
- "adds %[count], #2 \n\t" \
- "ble 3f \n\t" \
- "2: \n\t" \
- "ldrsh %[data1], [%[block], #0] \n\t" \
- "ldrsh %[data2], [%[block], #2] \n\t" \
- "mov %[tmp], %[qadd] \n\t" \
- "cmp %[data1], #0 \n\t" \
- "rsblt %[tmp], %[qadd], #0 \n\t" \
- "smlabbne %[data1], %[data1], %[qmul], %[tmp] \n\t" \
- "mov %[tmp], %[qadd] \n\t" \
- "cmp %[data2], #0 \n\t" \
- "rsblt %[tmp], %[qadd], #0 \n\t" \
- "smlabbne %[data2], %[data2], %[qmul], %[tmp] \n\t" \
- "strh %[data1], [%[block]], #2 \n\t" \
- "strh %[data2], [%[block]], #2 \n\t" \
- "3: \n\t" \
- : [block] "+&r" (xblock), [count] "+&r" (xcount), [tmp] "=&r" (xtmp), \
- [data1] "=&r" (xdata1), [data2] "=&r" (xdata2) \
- : [qmul] "r" (xqmul), [qadd] "r" (xqadd), [zero] "r" (0) \
- : "r4", "r5", "r6", "r7", "cc", "memory" \
-); \
-})
-
-static void dct_unquantize_h263_intra_armv5te(MpegEncContext *s,
- DCTELEM *block, int n, int qscale)
-{
- int i, level, qmul, qadd;
- int nCoeffs;
-
- assert(s->block_last_index[n]>=0);
-
- qmul = qscale << 1;
-
- if (!s->h263_aic) {
- if (n < 4)
- level = block[0] * s->y_dc_scale;
- else
- level = block[0] * s->c_dc_scale;
- qadd = (qscale - 1) | 1;
- }else{
- qadd = 0;
- level = block[0];
- }
- if(s->ac_pred)
- nCoeffs=63;
- else
- nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
-
- dct_unquantize_h263_special_helper_armv5te(block, qmul, qadd, nCoeffs + 1);
- block[0] = level;
-}
-
-static void dct_unquantize_h263_inter_armv5te(MpegEncContext *s,
- DCTELEM *block, int n, int qscale)
-{
- int i, level, qmul, qadd;
- int nCoeffs;
-
- assert(s->block_last_index[n]>=0);
-
- qadd = (qscale - 1) | 1;
- qmul = qscale << 1;
-
- nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
-
- dct_unquantize_h263_special_helper_armv5te(block, qmul, qadd, nCoeffs + 1);
-}
-
-#define HAVE_DCT_UNQUANTIZE_H263_ARMV5TE_OPTIMIZED
-
-#endif
-
-void MPV_common_init_armv5te(MpegEncContext *s)
-{
-#ifdef HAVE_DCT_UNQUANTIZE_H263_ARMV5TE_OPTIMIZED
- s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_armv5te;
- s->dct_unquantize_h263_inter = dct_unquantize_h263_inter_armv5te;
-#endif
-}
diff --git a/src/libffmpeg/libavcodec/armv4l/mpegvideo_iwmmxt.c b/src/libffmpeg/libavcodec/armv4l/mpegvideo_iwmmxt.c
deleted file mode 100644
index 1336ac5f8..000000000
--- a/src/libffmpeg/libavcodec/armv4l/mpegvideo_iwmmxt.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * copyright (c) 2004 AGAWA Koji
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "../dsputil.h"
-#include "../mpegvideo.h"
-#include "../avcodec.h"
-
-static void dct_unquantize_h263_intra_iwmmxt(MpegEncContext *s,
- DCTELEM *block, int n, int qscale)
-{
- int level, qmul, qadd;
- int nCoeffs;
- DCTELEM *block_orig = block;
-
- assert(s->block_last_index[n]>=0);
-
- qmul = qscale << 1;
-
- if (!s->h263_aic) {
- if (n < 4)
- level = block[0] * s->y_dc_scale;
- else
- level = block[0] * s->c_dc_scale;
- qadd = (qscale - 1) | 1;
- }else{
- qadd = 0;
- level = block[0];
- }
- if(s->ac_pred)
- nCoeffs=63;
- else
- nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
-
- __asm__ __volatile__ (
-/* "movd %1, %%mm6 \n\t" //qmul */
-/* "packssdw %%mm6, %%mm6 \n\t" */
-/* "packssdw %%mm6, %%mm6 \n\t" */
- "tbcsth wr6, %[qmul] \n\t"
-/* "movd %2, %%mm5 \n\t" //qadd */
-/* "packssdw %%mm5, %%mm5 \n\t" */
-/* "packssdw %%mm5, %%mm5 \n\t" */
- "tbcsth wr5, %[qadd] \n\t"
- "wzero wr7 \n\t" /* "pxor %%mm7, %%mm7 \n\t" */
- "wzero wr4 \n\t" /* "pxor %%mm4, %%mm4 \n\t" */
- "wsubh wr7, wr5, wr7 \n\t" /* "psubw %%mm5, %%mm7 \n\t" */
- "1: \n\t"
- "wldrd wr2, [%[block]] \n\t" /* "movq (%0, %3), %%mm0 \n\t" */
- "wldrd wr3, [%[block], #8] \n\t" /* "movq 8(%0, %3), %%mm1 \n\t" */
- "wmulsl wr0, wr6, wr2 \n\t" /* "pmullw %%mm6, %%mm0 \n\t" */
- "wmulsl wr1, wr6, wr3 \n\t" /* "pmullw %%mm6, %%mm1 \n\t" */
-/* "movq (%0, %3), %%mm2 \n\t" */
-/* "movq 8(%0, %3), %%mm3 \n\t" */
- "wcmpgtsh wr2, wr4, wr2 \n\t" /* "pcmpgtw %%mm4, %%mm2 \n\t" // block[i] < 0 ? -1 : 0 */
- "wcmpgtsh wr3, wr4, wr2 \n\t" /* "pcmpgtw %%mm4, %%mm3 \n\t" // block[i] < 0 ? -1 : 0 */
- "wxor wr0, wr2, wr0 \n\t" /* "pxor %%mm2, %%mm0 \n\t" */
- "wxor wr1, wr3, wr1 \n\t" /* "pxor %%mm3, %%mm1 \n\t" */
- "waddh wr0, wr7, wr0 \n\t" /* "paddw %%mm7, %%mm0 \n\t" */
- "waddh wr1, wr7, wr1 \n\t" /* "paddw %%mm7, %%mm1 \n\t" */
- "wxor wr2, wr0, wr2 \n\t" /* "pxor %%mm0, %%mm2 \n\t" */
- "wxor wr3, wr1, wr3 \n\t" /* "pxor %%mm1, %%mm3 \n\t" */
- "wcmpeqh wr0, wr7, wr0 \n\t" /* "pcmpeqw %%mm7, %%mm0 \n\t" // block[i] == 0 ? -1 : 0 */
- "wcmpeqh wr1, wr7, wr1 \n\t" /* "pcmpeqw %%mm7, %%mm1 \n\t" // block[i] == 0 ? -1 : 0 */
- "wandn wr0, wr2, wr0 \n\t" /* "pandn %%mm2, %%mm0 \n\t" */
- "wandn wr1, wr3, wr1 \n\t" /* "pandn %%mm3, %%mm1 \n\t" */
- "wstrd wr0, [%[block]] \n\t" /* "movq %%mm0, (%0, %3) \n\t" */
- "wstrd wr1, [%[block], #8] \n\t" /* "movq %%mm1, 8(%0, %3) \n\t" */
- "add %[block], %[block], #16 \n\t" /* "addl $16, %3 \n\t" */
- "subs %[i], %[i], #1 \n\t"
- "bne 1b \n\t" /* "jng 1b \n\t" */
- :[block]"+r"(block)
- :[i]"r"((nCoeffs + 8) / 8), [qmul]"r"(qmul), [qadd]"r"(qadd)
- :"memory");
-
- block_orig[0] = level;
-}
-
-#if 0
-static void dct_unquantize_h263_inter_iwmmxt(MpegEncContext *s,
- DCTELEM *block, int n, int qscale)
-{
- int nCoeffs;
-
- assert(s->block_last_index[n]>=0);
-
- if(s->ac_pred)
- nCoeffs=63;
- else
- nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
-
- ippiQuantInvInter_Compact_H263_16s_I(block, nCoeffs+1, qscale);
-}
-#endif
-
-void MPV_common_init_iwmmxt(MpegEncContext *s)
-{
- if (!(mm_flags & MM_IWMMXT)) return;
-
- s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_iwmmxt;
-#if 0
- s->dct_unquantize_h263_inter = dct_unquantize_h263_inter_iwmmxt;
-#endif
-}
diff --git a/src/libffmpeg/libavcodec/armv4l/simple_idct_arm.S b/src/libffmpeg/libavcodec/armv4l/simple_idct_arm.S
deleted file mode 100644
index b5a20f6da..000000000
--- a/src/libffmpeg/libavcodec/armv4l/simple_idct_arm.S
+++ /dev/null
@@ -1,487 +0,0 @@
-/*
- * simple_idct_arm.S
- * Copyright (C) 2002 Frederic 'dilb' Boulay.
- * All Rights Reserved.
- *
- * Author: Frederic Boulay <dilb@handhelds.org>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * The function defined in this file, is derived from the simple_idct function
- * from the libavcodec library part of the ffmpeg project.
- */
-
-/* useful constants for the algorithm, they are save in __constant_ptr__ at */
-/* the end of the source code.*/
-#define W1 22725
-#define W2 21407
-#define W3 19266
-#define W4 16383
-#define W5 12873
-#define W6 8867
-#define W7 4520
-#define MASK_MSHW 0xFFFF0000
-
-/* offsets of the constants in the vector */
-#define offW1 0
-#define offW2 4
-#define offW3 8
-#define offW4 12
-#define offW5 16
-#define offW6 20
-#define offW7 24
-#define offMASK_MSHW 28
-
-#define ROW_SHIFT 11
-#define ROW_SHIFT2MSHW (16-11)
-#define COL_SHIFT 20
-#define ROW_SHIFTED_1 1024 /* 1<< (ROW_SHIFT-1) */
-#define COL_SHIFTED_1 524288 /* 1<< (COL_SHIFT-1) */
-
-
- .text
- .align
- .global simple_idct_ARM
-
-simple_idct_ARM:
- @@ void simple_idct_ARM(int16_t *block)
- @@ save stack for reg needed (take all of them),
- @@ R0-R3 are scratch regs, so no need to save them, but R0 contains the pointer to block
- @@ so it must not be overwritten, if it is not saved!!
- @@ R12 is another scratch register, so it should not be saved too
- @@ save all registers
- stmfd sp!, {r4-r11, r14} @ R14 is also called LR
- @@ at this point, R0=block, other registers are free.
- add r14, r0, #112 @ R14=&block[8*7], better start from the last row, and decrease the value until row=0, i.e. R12=block.
- add r12, pc, #(__constant_ptr__-.-8) @ R12=__constant_ptr__, the vector containing the constants, probably not necessary to reserve a register for it
- @@ add 2 temporary variables in the stack: R0 and R14
- sub sp, sp, #8 @ allow 2 local variables
- str r0, [sp, #0] @ save block in sp[0]
- @@ stack status
- @@ sp+4 free
- @@ sp+0 R0 (block)
-
-
- @@ at this point, R0=block, R14=&block[56], R12=__const_ptr_, R1-R11 free
-
-
-__row_loop:
- @@ read the row and check if it is null, almost null, or not, according to strongarm specs, it is not necessary to optimise ldr accesses (i.e. split 32bits in 2 16bits words), at least it gives more usable registers :)
- ldr r1, [r14, #0] @ R1=(int32)(R12)[0]=ROWr32[0] (relative row cast to a 32b pointer)
- ldr r2, [r14, #4] @ R2=(int32)(R12)[1]=ROWr32[1]
- ldr r3, [r14, #8] @ R3=ROWr32[2]
- ldr r4, [r14, #12] @ R4=ROWr32[3]
- @@ check if the words are null, if all of them are null, then proceed with next row (branch __end_row_loop),
- @@ if ROWr16[0] is the only one not null, then proceed with this special case (branch __almost_empty_row)
- @@ else follow the complete algorithm.
- @@ at this point, R0=block, R14=&block[n], R12=__const_ptr_, R1=ROWr32[0], R2=ROWr32[1],
- @@ R3=ROWr32[2], R4=ROWr32[3], R5-R11 free
- orr r5, r4, r3 @ R5=R4 | R3
- orr r5, r5, r2 @ R5=R4 | R3 | R2
- orrs r6, r5, r1 @ Test R5 | R1 (the aim is to check if everything is null)
- beq __end_row_loop
- mov r7, r1, asr #16 @ R7=R1>>16=ROWr16[1] (evaluate it now, as it could be useful later)
- ldrsh r6, [r14, #0] @ R6=ROWr16[0]
- orrs r5, r5, r7 @ R5=R4 | R3 | R2 | R7
- beq __almost_empty_row
-
-__b_evaluation:
- @@ at this point, R0=block (temp), R1(free), R2=ROWr32[1], R3=ROWr32[2], R4=ROWr32[3],
- @@ R5=(temp), R6=ROWr16[0], R7=ROWr16[1], R8-R11 free,
- @@ R12=__const_ptr_, R14=&block[n]
- @@ to save some registers/calls, proceed with b0-b3 first, followed by a0-a3
-
- @@ MUL16(b0, W1, row[1]);
- @@ MUL16(b1, W3, row[1]);
- @@ MUL16(b2, W5, row[1]);
- @@ MUL16(b3, W7, row[1]);
- @@ MAC16(b0, W3, row[3]);
- @@ MAC16(b1, -W7, row[3]);
- @@ MAC16(b2, -W1, row[3]);
- @@ MAC16(b3, -W5, row[3]);
- ldr r8, [r12, #offW1] @ R8=W1
- mov r2, r2, asr #16 @ R2=ROWr16[3]
- mul r0, r8, r7 @ R0=W1*ROWr16[1]=b0 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
- ldr r9, [r12, #offW3] @ R9=W3
- ldr r10, [r12, #offW5] @ R10=W5
- mul r1, r9, r7 @ R1=W3*ROWr16[1]=b1 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
- ldr r11, [r12, #offW7] @ R11=W7
- mul r5, r10, r7 @ R5=W5*ROWr16[1]=b2 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
- mul r7, r11, r7 @ R7=W7*ROWr16[1]=b3 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
- teq r2, #0 @ if null avoid muls
- mlane r0, r9, r2, r0 @ R0+=W3*ROWr16[3]=b0 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
- rsbne r2, r2, #0 @ R2=-ROWr16[3]
- mlane r1, r11, r2, r1 @ R1-=W7*ROWr16[3]=b1 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
- mlane r5, r8, r2, r5 @ R5-=W1*ROWr16[3]=b2 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
- mlane r7, r10, r2, r7 @ R7-=W5*ROWr16[3]=b3 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
-
- @@ at this point, R0=b0, R1=b1, R2 (free), R3=ROWr32[2], R4=ROWr32[3],
- @@ R5=b2, R6=ROWr16[0], R7=b3, R8=W1, R9=W3, R10=W5, R11=W7,
- @@ R12=__const_ptr_, R14=&block[n]
- @@ temp = ((uint32_t*)row)[2] | ((uint32_t*)row)[3];
- @@ if (temp != 0) {}
- orrs r2, r3, r4 @ R2=ROWr32[2] | ROWr32[3]
- beq __end_b_evaluation
-
- @@ at this point, R0=b0, R1=b1, R2 (free), R3=ROWr32[2], R4=ROWr32[3],
- @@ R5=b2, R6=ROWr16[0], R7=b3, R8=W1, R9=W3, R10=W5, R11=W7,
- @@ R12=__const_ptr_, R14=&block[n]
- @@ MAC16(b0, W5, row[5]);
- @@ MAC16(b2, W7, row[5]);
- @@ MAC16(b3, W3, row[5]);
- @@ MAC16(b1, -W1, row[5]);
- @@ MAC16(b0, W7, row[7]);
- @@ MAC16(b2, W3, row[7]);
- @@ MAC16(b3, -W1, row[7]);
- @@ MAC16(b1, -W5, row[7]);
- mov r3, r3, asr #16 @ R3=ROWr16[5]
- teq r3, #0 @ if null avoid muls
- mlane r0, r10, r3, r0 @ R0+=W5*ROWr16[5]=b0
- mov r4, r4, asr #16 @ R4=ROWr16[7]
- mlane r5, r11, r3, r5 @ R5+=W7*ROWr16[5]=b2
- mlane r7, r9, r3, r7 @ R7+=W3*ROWr16[5]=b3
- rsbne r3, r3, #0 @ R3=-ROWr16[5]
- mlane r1, r8, r3, r1 @ R7-=W1*ROWr16[5]=b1
- @@ R3 is free now
- teq r4, #0 @ if null avoid muls
- mlane r0, r11, r4, r0 @ R0+=W7*ROWr16[7]=b0
- mlane r5, r9, r4, r5 @ R5+=W3*ROWr16[7]=b2
- rsbne r4, r4, #0 @ R4=-ROWr16[7]
- mlane r7, r8, r4, r7 @ R7-=W1*ROWr16[7]=b3
- mlane r1, r10, r4, r1 @ R1-=W5*ROWr16[7]=b1
- @@ R4 is free now
-__end_b_evaluation:
- @@ at this point, R0=b0, R1=b1, R2=ROWr32[2] | ROWr32[3] (tmp), R3 (free), R4 (free),
- @@ R5=b2, R6=ROWr16[0], R7=b3, R8 (free), R9 (free), R10 (free), R11 (free),
- @@ R12=__const_ptr_, R14=&block[n]
-
-__a_evaluation:
- @@ a0 = (W4 * row[0]) + (1 << (ROW_SHIFT - 1));
- @@ a1 = a0 + W6 * row[2];
- @@ a2 = a0 - W6 * row[2];
- @@ a3 = a0 - W2 * row[2];
- @@ a0 = a0 + W2 * row[2];
- ldr r9, [r12, #offW4] @ R9=W4
- mul r6, r9, r6 @ R6=W4*ROWr16[0]
- ldr r10, [r12, #offW6] @ R10=W6
- ldrsh r4, [r14, #4] @ R4=ROWr16[2] (a3 not defined yet)
- add r6, r6, #ROW_SHIFTED_1 @ R6=W4*ROWr16[0] + 1<<(ROW_SHIFT-1) (a0)
-
- mul r11, r10, r4 @ R11=W6*ROWr16[2]
- ldr r8, [r12, #offW2] @ R8=W2
- sub r3, r6, r11 @ R3=a0-W6*ROWr16[2] (a2)
- @@ temp = ((uint32_t*)row)[2] | ((uint32_t*)row)[3];
- @@ if (temp != 0) {}
- teq r2, #0
- beq __end_bef_a_evaluation
-
- add r2, r6, r11 @ R2=a0+W6*ROWr16[2] (a1)
- mul r11, r8, r4 @ R11=W2*ROWr16[2]
- sub r4, r6, r11 @ R4=a0-W2*ROWr16[2] (a3)
- add r6, r6, r11 @ R6=a0+W2*ROWr16[2] (a0)
-
-
- @@ at this point, R0=b0, R1=b1, R2=a1, R3=a2, R4=a3,
- @@ R5=b2, R6=a0, R7=b3, R8=W2, R9=W4, R10=W6, R11 (free),
- @@ R12=__const_ptr_, R14=&block[n]
-
-
- @@ a0 += W4*row[4]
- @@ a1 -= W4*row[4]
- @@ a2 -= W4*row[4]
- @@ a3 += W4*row[4]
- ldrsh r11, [r14, #8] @ R11=ROWr16[4]
- teq r11, #0 @ if null avoid muls
- mulne r11, r9, r11 @ R11=W4*ROWr16[4]
- @@ R9 is free now
- ldrsh r9, [r14, #12] @ R9=ROWr16[6]
- addne r6, r6, r11 @ R6+=W4*ROWr16[4] (a0)
- subne r2, r2, r11 @ R2-=W4*ROWr16[4] (a1)
- subne r3, r3, r11 @ R3-=W4*ROWr16[4] (a2)
- addne r4, r4, r11 @ R4+=W4*ROWr16[4] (a3)
- @@ W6 alone is no more useful, save W2*ROWr16[6] in it instead
- teq r9, #0 @ if null avoid muls
- mulne r11, r10, r9 @ R11=W6*ROWr16[6]
- addne r6, r6, r11 @ R6+=W6*ROWr16[6] (a0)
- mulne r10, r8, r9 @ R10=W2*ROWr16[6]
- @@ a0 += W6*row[6];
- @@ a3 -= W6*row[6];
- @@ a1 -= W2*row[6];
- @@ a2 += W2*row[6];
- subne r4, r4, r11 @ R4-=W6*ROWr16[6] (a3)
- subne r2, r2, r10 @ R2-=W2*ROWr16[6] (a1)
- addne r3, r3, r10 @ R3+=W2*ROWr16[6] (a2)
-
-__end_a_evaluation:
- @@ at this point, R0=b0, R1=b1, R2=a1, R3=a2, R4=a3,
- @@ R5=b2, R6=a0, R7=b3, R8 (free), R9 (free), R10 (free), R11 (free),
- @@ R12=__const_ptr_, R14=&block[n]
- @@ row[0] = (a0 + b0) >> ROW_SHIFT;
- @@ row[1] = (a1 + b1) >> ROW_SHIFT;
- @@ row[2] = (a2 + b2) >> ROW_SHIFT;
- @@ row[3] = (a3 + b3) >> ROW_SHIFT;
- @@ row[4] = (a3 - b3) >> ROW_SHIFT;
- @@ row[5] = (a2 - b2) >> ROW_SHIFT;
- @@ row[6] = (a1 - b1) >> ROW_SHIFT;
- @@ row[7] = (a0 - b0) >> ROW_SHIFT;
- add r8, r6, r0 @ R8=a0+b0
- add r9, r2, r1 @ R9=a1+b1
- @@ put 2 16 bits half-words in a 32bits word
- @@ ROWr32[0]=ROWr16[0] | (ROWr16[1]<<16) (only Little Endian compliant then!!!)
- ldr r10, [r12, #offMASK_MSHW] @ R10=0xFFFF0000
- and r9, r10, r9, lsl #ROW_SHIFT2MSHW @ R9=0xFFFF0000 & ((a1+b1)<<5)
- mvn r11, r10 @ R11= NOT R10= 0x0000FFFF
- and r8, r11, r8, asr #ROW_SHIFT @ R8=0x0000FFFF & ((a0+b0)>>11)
- orr r8, r8, r9
- str r8, [r14, #0]
-
- add r8, r3, r5 @ R8=a2+b2
- add r9, r4, r7 @ R9=a3+b3
- and r9, r10, r9, lsl #ROW_SHIFT2MSHW @ R9=0xFFFF0000 & ((a3+b3)<<5)
- and r8, r11, r8, asr #ROW_SHIFT @ R8=0x0000FFFF & ((a2+b2)>>11)
- orr r8, r8, r9
- str r8, [r14, #4]
-
- sub r8, r4, r7 @ R8=a3-b3
- sub r9, r3, r5 @ R9=a2-b2
- and r9, r10, r9, lsl #ROW_SHIFT2MSHW @ R9=0xFFFF0000 & ((a2-b2)<<5)
- and r8, r11, r8, asr #ROW_SHIFT @ R8=0x0000FFFF & ((a3-b3)>>11)
- orr r8, r8, r9
- str r8, [r14, #8]
-
- sub r8, r2, r1 @ R8=a1-b1
- sub r9, r6, r0 @ R9=a0-b0
- and r9, r10, r9, lsl #ROW_SHIFT2MSHW @ R9=0xFFFF0000 & ((a0-b0)<<5)
- and r8, r11, r8, asr #ROW_SHIFT @ R8=0x0000FFFF & ((a1-b1)>>11)
- orr r8, r8, r9
- str r8, [r14, #12]
-
- bal __end_row_loop
-
-__almost_empty_row:
- @@ the row was empty, except ROWr16[0], now, management of this special case
- @@ at this point, R0=block, R14=&block[n], R12=__const_ptr_, R1=ROWr32[0], R2=ROWr32[1],
- @@ R3=ROWr32[2], R4=ROWr32[3], R5=(temp), R6=ROWr16[0], R7=ROWr16[1],
- @@ R8=0xFFFF (temp), R9-R11 free
- mov r8, #0x10000 @ R8=0xFFFF (2 steps needed!) it saves a ldr call (because of delay run).
- sub r8, r8, #1 @ R8 is now ready.
- and r5, r8, r6, lsl #3 @ R5=R8 & (R6<<3)= (ROWr16[0]<<3) & 0xFFFF
- orr r5, r5, r5, lsl #16 @ R5=R5 | (R5<<16)
- str r5, [r14, #0] @ R14[0]=ROWr32[0]=R5
- str r5, [r14, #4] @ R14[4]=ROWr32[1]=R5
- str r5, [r14, #8] @ R14[8]=ROWr32[2]=R5
- str r5, [r14, #12] @ R14[12]=ROWr32[3]=R5
-
-__end_row_loop:
- @@ at this point, R0-R11 (free)
- @@ R12=__const_ptr_, R14=&block[n]
- ldr r0, [sp, #0] @ R0=block
- teq r0, r14 @ compare current &block[8*n] to block, when block is reached, the loop is finished.
- sub r14, r14, #16
- bne __row_loop
-
-
-
- @@ at this point, R0=block, R1-R11 (free)
- @@ R12=__const_ptr_, R14=&block[n]
- add r14, r0, #14 @ R14=&block[7], better start from the last col, and decrease the value until col=0, i.e. R14=block.
-__col_loop:
-
-__b_evaluation2:
- @@ at this point, R0=block (temp), R1-R11 (free)
- @@ R12=__const_ptr_, R14=&block[n]
- @@ proceed with b0-b3 first, followed by a0-a3
- @@ MUL16(b0, W1, col[8x1]);
- @@ MUL16(b1, W3, col[8x1]);
- @@ MUL16(b2, W5, col[8x1]);
- @@ MUL16(b3, W7, col[8x1]);
- @@ MAC16(b0, W3, col[8x3]);
- @@ MAC16(b1, -W7, col[8x3]);
- @@ MAC16(b2, -W1, col[8x3]);
- @@ MAC16(b3, -W5, col[8x3]);
- ldr r8, [r12, #offW1] @ R8=W1
- ldrsh r7, [r14, #16]
- mul r0, r8, r7 @ R0=W1*ROWr16[1]=b0 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
- ldr r9, [r12, #offW3] @ R9=W3
- ldr r10, [r12, #offW5] @ R10=W5
- mul r1, r9, r7 @ R1=W3*ROWr16[1]=b1 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
- ldr r11, [r12, #offW7] @ R11=W7
- mul r5, r10, r7 @ R5=W5*ROWr16[1]=b2 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
- ldrsh r2, [r14, #48]
- mul r7, r11, r7 @ R7=W7*ROWr16[1]=b3 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
- teq r2, #0 @ if 0, then avoid muls
- mlane r0, r9, r2, r0 @ R0+=W3*ROWr16[3]=b0 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
- rsbne r2, r2, #0 @ R2=-ROWr16[3]
- mlane r1, r11, r2, r1 @ R1-=W7*ROWr16[3]=b1 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
- mlane r5, r8, r2, r5 @ R5-=W1*ROWr16[3]=b2 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
- mlane r7, r10, r2, r7 @ R7-=W5*ROWr16[3]=b3 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
-
- @@ at this point, R0=b0, R1=b1, R2 (free), R3 (free), R4 (free),
- @@ R5=b2, R6 (free), R7=b3, R8=W1, R9=W3, R10=W5, R11=W7,
- @@ R12=__const_ptr_, R14=&block[n]
- @@ MAC16(b0, W5, col[5x8]);
- @@ MAC16(b2, W7, col[5x8]);
- @@ MAC16(b3, W3, col[5x8]);
- @@ MAC16(b1, -W1, col[5x8]);
- @@ MAC16(b0, W7, col[7x8]);
- @@ MAC16(b2, W3, col[7x8]);
- @@ MAC16(b3, -W1, col[7x8]);
- @@ MAC16(b1, -W5, col[7x8]);
- ldrsh r3, [r14, #80] @ R3=COLr16[5x8]
- teq r3, #0 @ if 0 then avoid muls
- mlane r0, r10, r3, r0 @ R0+=W5*ROWr16[5x8]=b0
- mlane r5, r11, r3, r5 @ R5+=W7*ROWr16[5x8]=b2
- mlane r7, r9, r3, r7 @ R7+=W3*ROWr16[5x8]=b3
- rsbne r3, r3, #0 @ R3=-ROWr16[5x8]
- ldrsh r4, [r14, #112] @ R4=COLr16[7x8]
- mlane r1, r8, r3, r1 @ R7-=W1*ROWr16[5x8]=b1
- @@ R3 is free now
- teq r4, #0 @ if 0 then avoid muls
- mlane r0, r11, r4, r0 @ R0+=W7*ROWr16[7x8]=b0
- mlane r5, r9, r4, r5 @ R5+=W3*ROWr16[7x8]=b2
- rsbne r4, r4, #0 @ R4=-ROWr16[7x8]
- mlane r7, r8, r4, r7 @ R7-=W1*ROWr16[7x8]=b3
- mlane r1, r10, r4, r1 @ R1-=W5*ROWr16[7x8]=b1
- @@ R4 is free now
-__end_b_evaluation2:
- @@ at this point, R0=b0, R1=b1, R2 (free), R3 (free), R4 (free),
- @@ R5=b2, R6 (free), R7=b3, R8 (free), R9 (free), R10 (free), R11 (free),
- @@ R12=__const_ptr_, R14=&block[n]
-
-__a_evaluation2:
- @@ a0 = (W4 * col[8x0]) + (1 << (COL_SHIFT - 1));
- @@ a1 = a0 + W6 * row[2];
- @@ a2 = a0 - W6 * row[2];
- @@ a3 = a0 - W2 * row[2];
- @@ a0 = a0 + W2 * row[2];
- ldrsh r6, [r14, #0]
- ldr r9, [r12, #offW4] @ R9=W4
- mul r6, r9, r6 @ R6=W4*ROWr16[0]
- ldr r10, [r12, #offW6] @ R10=W6
- ldrsh r4, [r14, #32] @ R4=ROWr16[2] (a3 not defined yet)
- add r6, r6, #COL_SHIFTED_1 @ R6=W4*ROWr16[0] + 1<<(COL_SHIFT-1) (a0)
- mul r11, r10, r4 @ R11=W6*ROWr16[2]
- ldr r8, [r12, #offW2] @ R8=W2
- add r2, r6, r11 @ R2=a0+W6*ROWr16[2] (a1)
- sub r3, r6, r11 @ R3=a0-W6*ROWr16[2] (a2)
- mul r11, r8, r4 @ R11=W2*ROWr16[2]
- sub r4, r6, r11 @ R4=a0-W2*ROWr16[2] (a3)
- add r6, r6, r11 @ R6=a0+W2*ROWr16[2] (a0)
-
- @@ at this point, R0=b0, R1=b1, R2=a1, R3=a2, R4=a3,
- @@ R5=b2, R6=a0, R7=b3, R8=W2, R9=W4, R10=W6, R11 (free),
- @@ R12=__const_ptr_, R14=&block[n]
- @@ a0 += W4*row[4]
- @@ a1 -= W4*row[4]
- @@ a2 -= W4*row[4]
- @@ a3 += W4*row[4]
- ldrsh r11, [r14, #64] @ R11=ROWr16[4]
- teq r11, #0 @ if null avoid muls
- mulne r11, r9, r11 @ R11=W4*ROWr16[4]
- @@ R9 is free now
- addne r6, r6, r11 @ R6+=W4*ROWr16[4] (a0)
- subne r2, r2, r11 @ R2-=W4*ROWr16[4] (a1)
- subne r3, r3, r11 @ R3-=W4*ROWr16[4] (a2)
- ldrsh r9, [r14, #96] @ R9=ROWr16[6]
- addne r4, r4, r11 @ R4+=W4*ROWr16[4] (a3)
- @@ W6 alone is no more useful, save W2*ROWr16[6] in it instead
- teq r9, #0 @ if null avoid muls
- mulne r11, r10, r9 @ R11=W6*ROWr16[6]
- addne r6, r6, r11 @ R6+=W6*ROWr16[6] (a0)
- mulne r10, r8, r9 @ R10=W2*ROWr16[6]
- @@ a0 += W6*row[6];
- @@ a3 -= W6*row[6];
- @@ a1 -= W2*row[6];
- @@ a2 += W2*row[6];
- subne r4, r4, r11 @ R4-=W6*ROWr16[6] (a3)
- subne r2, r2, r10 @ R2-=W2*ROWr16[6] (a1)
- addne r3, r3, r10 @ R3+=W2*ROWr16[6] (a2)
-__end_a_evaluation2:
- @@ at this point, R0=b0, R1=b1, R2=a1, R3=a2, R4=a3,
- @@ R5=b2, R6=a0, R7=b3, R8 (free), R9 (free), R10 (free), R11 (free),
- @@ R12=__const_ptr_, R14=&block[n]
- @@ col[0 ] = ((a0 + b0) >> COL_SHIFT);
- @@ col[8 ] = ((a1 + b1) >> COL_SHIFT);
- @@ col[16] = ((a2 + b2) >> COL_SHIFT);
- @@ col[24] = ((a3 + b3) >> COL_SHIFT);
- @@ col[32] = ((a3 - b3) >> COL_SHIFT);
- @@ col[40] = ((a2 - b2) >> COL_SHIFT);
- @@ col[48] = ((a1 - b1) >> COL_SHIFT);
- @@ col[56] = ((a0 - b0) >> COL_SHIFT);
- @@@@@ no optimisation here @@@@@
- add r8, r6, r0 @ R8=a0+b0
- add r9, r2, r1 @ R9=a1+b1
- mov r8, r8, asr #COL_SHIFT
- mov r9, r9, asr #COL_SHIFT
- strh r8, [r14, #0]
- strh r9, [r14, #16]
- add r8, r3, r5 @ R8=a2+b2
- add r9, r4, r7 @ R9=a3+b3
- mov r8, r8, asr #COL_SHIFT
- mov r9, r9, asr #COL_SHIFT
- strh r8, [r14, #32]
- strh r9, [r14, #48]
- sub r8, r4, r7 @ R8=a3-b3
- sub r9, r3, r5 @ R9=a2-b2
- mov r8, r8, asr #COL_SHIFT
- mov r9, r9, asr #COL_SHIFT
- strh r8, [r14, #64]
- strh r9, [r14, #80]
- sub r8, r2, r1 @ R8=a1-b1
- sub r9, r6, r0 @ R9=a0-b0
- mov r8, r8, asr #COL_SHIFT
- mov r9, r9, asr #COL_SHIFT
- strh r8, [r14, #96]
- strh r9, [r14, #112]
-
-__end_col_loop:
- @@ at this point, R0-R11 (free)
- @@ R12=__const_ptr_, R14=&block[n]
- ldr r0, [sp, #0] @ R0=block
- teq r0, r14 @ compare current &block[n] to block, when block is reached, the loop is finished.
- sub r14, r14, #2
- bne __col_loop
-
-
-
-
-__end_simple_idct_ARM:
- @@ restore registers to previous status!
- add sp, sp, #8 @@ the local variables!
- ldmfd sp!, {r4-r11, r15} @@ update PC with LR content.
-
-
-
-@@ kind of sub-function, here not to overload the common case.
-__end_bef_a_evaluation:
- add r2, r6, r11 @ R2=a0+W6*ROWr16[2] (a1)
- mul r11, r8, r4 @ R11=W2*ROWr16[2]
- sub r4, r6, r11 @ R4=a0-W2*ROWr16[2] (a3)
- add r6, r6, r11 @ R6=a0+W2*ROWr16[2] (a0)
- bal __end_a_evaluation
-
-
-__constant_ptr__: @@ see #defines at the beginning of the source code for values.
- .align
- .word W1
- .word W2
- .word W3
- .word W4
- .word W5
- .word W6
- .word W7
- .word MASK_MSHW
diff --git a/src/libffmpeg/libavcodec/armv4l/simple_idct_armv5te.S b/src/libffmpeg/libavcodec/armv4l/simple_idct_armv5te.S
deleted file mode 100644
index 28bee0643..000000000
--- a/src/libffmpeg/libavcodec/armv4l/simple_idct_armv5te.S
+++ /dev/null
@@ -1,718 +0,0 @@
-/*
- * Simple IDCT
- *
- * Copyright (c) 2001 Michael Niedermayer <michaelni@gmx.at>
- * Copyright (c) 2006 Mans Rullgard <mru@inprovide.com>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#define W1 22725 /* cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5 */
-#define W2 21407 /* cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5 */
-#define W3 19266 /* cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5 */
-#define W4 16383 /* cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5 */
-#define W5 12873 /* cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5 */
-#define W6 8867 /* cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5 */
-#define W7 4520 /* cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5 */
-#define ROW_SHIFT 11
-#define COL_SHIFT 20
-
-#define W13 (W1 | (W3 << 16))
-#define W26 (W2 | (W6 << 16))
-#define W57 (W5 | (W7 << 16))
-
- .text
- .align
-w13: .long W13
-w26: .long W26
-w57: .long W57
-
- .align
- .func idct_row_armv5te
-idct_row_armv5te:
- str lr, [sp, #-4]!
-
- ldrd v1, [a1, #8]
- ldrd a3, [a1] /* a3 = row[1:0], a4 = row[3:2] */
- orrs v1, v1, v2
- cmpeq v1, a4
- cmpeq v1, a3, lsr #16
- beq row_dc_only
-
- mov v1, #(1<<(ROW_SHIFT-1))
- mov ip, #16384
- sub ip, ip, #1 /* ip = W4 */
- smlabb v1, ip, a3, v1 /* v1 = W4*row[0]+(1<<(RS-1)) */
- ldr ip, [pc, #(w26-.-8)] /* ip = W2 | (W6 << 16) */
- smultb a2, ip, a4
- smulbb lr, ip, a4
- add v2, v1, a2
- sub v3, v1, a2
- sub v4, v1, lr
- add v1, v1, lr
-
- ldr ip, [pc, #(w13-.-8)] /* ip = W1 | (W3 << 16) */
- ldr lr, [pc, #(w57-.-8)] /* lr = W5 | (W7 << 16) */
- smulbt v5, ip, a3
- smultt v6, lr, a4
- smlatt v5, ip, a4, v5
- smultt a2, ip, a3
- smulbt v7, lr, a3
- sub v6, v6, a2
- smulbt a2, ip, a4
- smultt fp, lr, a3
- sub v7, v7, a2
- smulbt a2, lr, a4
- ldrd a3, [a1, #8] /* a3=row[5:4] a4=row[7:6] */
- sub fp, fp, a2
-
- orrs a2, a3, a4
- beq 1f
-
- smlabt v5, lr, a3, v5
- smlabt v6, ip, a3, v6
- smlatt v5, lr, a4, v5
- smlabt v6, lr, a4, v6
- smlatt v7, lr, a3, v7
- smlatt fp, ip, a3, fp
- smulbt a2, ip, a4
- smlatt v7, ip, a4, v7
- sub fp, fp, a2
-
- ldr ip, [pc, #(w26-.-8)] /* ip = W2 | (W6 << 16) */
- mov a2, #16384
- sub a2, a2, #1 /* a2 = W4 */
- smulbb a2, a2, a3 /* a2 = W4*row[4] */
- smultb lr, ip, a4 /* lr = W6*row[6] */
- add v1, v1, a2 /* v1 += W4*row[4] */
- add v1, v1, lr /* v1 += W6*row[6] */
- add v4, v4, a2 /* v4 += W4*row[4] */
- sub v4, v4, lr /* v4 -= W6*row[6] */
- smulbb lr, ip, a4 /* lr = W2*row[6] */
- sub v2, v2, a2 /* v2 -= W4*row[4] */
- sub v2, v2, lr /* v2 -= W2*row[6] */
- sub v3, v3, a2 /* v3 -= W4*row[4] */
- add v3, v3, lr /* v3 += W2*row[6] */
-
-1: add a2, v1, v5
- mov a3, a2, lsr #11
- bic a3, a3, #0x1f0000
- sub a2, v2, v6
- mov a2, a2, lsr #11
- add a3, a3, a2, lsl #16
- add a2, v3, v7
- mov a4, a2, lsr #11
- bic a4, a4, #0x1f0000
- add a2, v4, fp
- mov a2, a2, lsr #11
- add a4, a4, a2, lsl #16
- strd a3, [a1]
-
- sub a2, v4, fp
- mov a3, a2, lsr #11
- bic a3, a3, #0x1f0000
- sub a2, v3, v7
- mov a2, a2, lsr #11
- add a3, a3, a2, lsl #16
- add a2, v2, v6
- mov a4, a2, lsr #11
- bic a4, a4, #0x1f0000
- sub a2, v1, v5
- mov a2, a2, lsr #11
- add a4, a4, a2, lsl #16
- strd a3, [a1, #8]
-
- ldr pc, [sp], #4
-
-row_dc_only:
- orr a3, a3, a3, lsl #16
- bic a3, a3, #0xe000
- mov a3, a3, lsl #3
- mov a4, a3
- strd a3, [a1]
- strd a3, [a1, #8]
-
- ldr pc, [sp], #4
- .endfunc
-
- .macro idct_col
- ldr a4, [a1] /* a4 = col[1:0] */
- mov ip, #16384
- sub ip, ip, #1 /* ip = W4 */
-#if 0
- mov v1, #(1<<(COL_SHIFT-1))
- smlabt v2, ip, a4, v1 /* v2 = W4*col[1] + (1<<(COL_SHIFT-1)) */
- smlabb v1, ip, a4, v1 /* v1 = W4*col[0] + (1<<(COL_SHIFT-1)) */
- ldr a4, [a1, #(16*4)]
-#else
- mov v1, #((1<<(COL_SHIFT-1))/W4) /* this matches the C version */
- add v2, v1, a4, asr #16
- rsb v2, v2, v2, lsl #14
- mov a4, a4, lsl #16
- add v1, v1, a4, asr #16
- ldr a4, [a1, #(16*4)]
- rsb v1, v1, v1, lsl #14
-#endif
-
- smulbb lr, ip, a4
- smulbt a3, ip, a4
- sub v3, v1, lr
- sub v5, v1, lr
- add v7, v1, lr
- add v1, v1, lr
- sub v4, v2, a3
- sub v6, v2, a3
- add fp, v2, a3
- ldr ip, [pc, #(w26-.-8)]
- ldr a4, [a1, #(16*2)]
- add v2, v2, a3
-
- smulbb lr, ip, a4
- smultb a3, ip, a4
- add v1, v1, lr
- sub v7, v7, lr
- add v3, v3, a3
- sub v5, v5, a3
- smulbt lr, ip, a4
- smultt a3, ip, a4
- add v2, v2, lr
- sub fp, fp, lr
- add v4, v4, a3
- ldr a4, [a1, #(16*6)]
- sub v6, v6, a3
-
- smultb lr, ip, a4
- smulbb a3, ip, a4
- add v1, v1, lr
- sub v7, v7, lr
- sub v3, v3, a3
- add v5, v5, a3
- smultt lr, ip, a4
- smulbt a3, ip, a4
- add v2, v2, lr
- sub fp, fp, lr
- sub v4, v4, a3
- add v6, v6, a3
-
- stmfd sp!, {v1, v2, v3, v4, v5, v6, v7, fp}
-
- ldr ip, [pc, #(w13-.-8)]
- ldr a4, [a1, #(16*1)]
- ldr lr, [pc, #(w57-.-8)]
- smulbb v1, ip, a4
- smultb v3, ip, a4
- smulbb v5, lr, a4
- smultb v7, lr, a4
- smulbt v2, ip, a4
- smultt v4, ip, a4
- smulbt v6, lr, a4
- smultt fp, lr, a4
- rsb v4, v4, #0
- ldr a4, [a1, #(16*3)]
- rsb v3, v3, #0
-
- smlatb v1, ip, a4, v1
- smlatb v3, lr, a4, v3
- smulbb a3, ip, a4
- smulbb a2, lr, a4
- sub v5, v5, a3
- sub v7, v7, a2
- smlatt v2, ip, a4, v2
- smlatt v4, lr, a4, v4
- smulbt a3, ip, a4
- smulbt a2, lr, a4
- sub v6, v6, a3
- ldr a4, [a1, #(16*5)]
- sub fp, fp, a2
-
- smlabb v1, lr, a4, v1
- smlabb v3, ip, a4, v3
- smlatb v5, lr, a4, v5
- smlatb v7, ip, a4, v7
- smlabt v2, lr, a4, v2
- smlabt v4, ip, a4, v4
- smlatt v6, lr, a4, v6
- ldr a3, [a1, #(16*7)]
- smlatt fp, ip, a4, fp
-
- smlatb v1, lr, a3, v1
- smlabb v3, lr, a3, v3
- smlatb v5, ip, a3, v5
- smulbb a4, ip, a3
- smlatt v2, lr, a3, v2
- sub v7, v7, a4
- smlabt v4, lr, a3, v4
- smulbt a4, ip, a3
- smlatt v6, ip, a3, v6
- sub fp, fp, a4
- .endm
-
- .align
- .func idct_col_armv5te
-idct_col_armv5te:
- str lr, [sp, #-4]!
-
- idct_col
-
- ldmfd sp!, {a3, a4}
- adds a2, a3, v1
- mov a2, a2, lsr #20
- orrmi a2, a2, #0xf000
- add ip, a4, v2
- mov ip, ip, asr #20
- orr a2, a2, ip, lsl #16
- str a2, [a1]
- subs a3, a3, v1
- mov a2, a3, lsr #20
- orrmi a2, a2, #0xf000
- sub a4, a4, v2
- mov a4, a4, asr #20
- orr a2, a2, a4, lsl #16
- ldmfd sp!, {a3, a4}
- str a2, [a1, #(16*7)]
-
- subs a2, a3, v3
- mov a2, a2, lsr #20
- orrmi a2, a2, #0xf000
- sub ip, a4, v4
- mov ip, ip, asr #20
- orr a2, a2, ip, lsl #16
- str a2, [a1, #(16*1)]
- adds a3, a3, v3
- mov a2, a3, lsr #20
- orrmi a2, a2, #0xf000
- add a4, a4, v4
- mov a4, a4, asr #20
- orr a2, a2, a4, lsl #16
- ldmfd sp!, {a3, a4}
- str a2, [a1, #(16*6)]
-
- adds a2, a3, v5
- mov a2, a2, lsr #20
- orrmi a2, a2, #0xf000
- add ip, a4, v6
- mov ip, ip, asr #20
- orr a2, a2, ip, lsl #16
- str a2, [a1, #(16*2)]
- subs a3, a3, v5
- mov a2, a3, lsr #20
- orrmi a2, a2, #0xf000
- sub a4, a4, v6
- mov a4, a4, asr #20
- orr a2, a2, a4, lsl #16
- ldmfd sp!, {a3, a4}
- str a2, [a1, #(16*5)]
-
- adds a2, a3, v7
- mov a2, a2, lsr #20
- orrmi a2, a2, #0xf000
- add ip, a4, fp
- mov ip, ip, asr #20
- orr a2, a2, ip, lsl #16
- str a2, [a1, #(16*3)]
- subs a3, a3, v7
- mov a2, a3, lsr #20
- orrmi a2, a2, #0xf000
- sub a4, a4, fp
- mov a4, a4, asr #20
- orr a2, a2, a4, lsl #16
- str a2, [a1, #(16*4)]
-
- ldr pc, [sp], #4
- .endfunc
-
- .align
- .func idct_col_put_armv5te
-idct_col_put_armv5te:
- str lr, [sp, #-4]!
-
- idct_col
-
- ldmfd sp!, {a3, a4}
- ldr lr, [sp, #32]
- add a2, a3, v1
- movs a2, a2, asr #20
- movmi a2, #0
- cmp a2, #255
- movgt a2, #255
- add ip, a4, v2
- movs ip, ip, asr #20
- movmi ip, #0
- cmp ip, #255
- movgt ip, #255
- orr a2, a2, ip, lsl #8
- sub a3, a3, v1
- movs a3, a3, asr #20
- movmi a3, #0
- cmp a3, #255
- movgt a3, #255
- sub a4, a4, v2
- movs a4, a4, asr #20
- movmi a4, #0
- cmp a4, #255
- ldr v1, [sp, #28]
- movgt a4, #255
- strh a2, [v1]
- add a2, v1, #2
- str a2, [sp, #28]
- orr a2, a3, a4, lsl #8
- rsb v2, lr, lr, lsl #3
- ldmfd sp!, {a3, a4}
- strh a2, [v2, v1]!
-
- sub a2, a3, v3
- movs a2, a2, asr #20
- movmi a2, #0
- cmp a2, #255
- movgt a2, #255
- sub ip, a4, v4
- movs ip, ip, asr #20
- movmi ip, #0
- cmp ip, #255
- movgt ip, #255
- orr a2, a2, ip, lsl #8
- strh a2, [v1, lr]!
- add a3, a3, v3
- movs a2, a3, asr #20
- movmi a2, #0
- cmp a2, #255
- movgt a2, #255
- add a4, a4, v4
- movs a4, a4, asr #20
- movmi a4, #0
- cmp a4, #255
- movgt a4, #255
- orr a2, a2, a4, lsl #8
- ldmfd sp!, {a3, a4}
- strh a2, [v2, -lr]!
-
- add a2, a3, v5
- movs a2, a2, asr #20
- movmi a2, #0
- cmp a2, #255
- movgt a2, #255
- add ip, a4, v6
- movs ip, ip, asr #20
- movmi ip, #0
- cmp ip, #255
- movgt ip, #255
- orr a2, a2, ip, lsl #8
- strh a2, [v1, lr]!
- sub a3, a3, v5
- movs a2, a3, asr #20
- movmi a2, #0
- cmp a2, #255
- movgt a2, #255
- sub a4, a4, v6
- movs a4, a4, asr #20
- movmi a4, #0
- cmp a4, #255
- movgt a4, #255
- orr a2, a2, a4, lsl #8
- ldmfd sp!, {a3, a4}
- strh a2, [v2, -lr]!
-
- add a2, a3, v7
- movs a2, a2, asr #20
- movmi a2, #0
- cmp a2, #255
- movgt a2, #255
- add ip, a4, fp
- movs ip, ip, asr #20
- movmi ip, #0
- cmp ip, #255
- movgt ip, #255
- orr a2, a2, ip, lsl #8
- strh a2, [v1, lr]
- sub a3, a3, v7
- movs a2, a3, asr #20
- movmi a2, #0
- cmp a2, #255
- movgt a2, #255
- sub a4, a4, fp
- movs a4, a4, asr #20
- movmi a4, #0
- cmp a4, #255
- movgt a4, #255
- orr a2, a2, a4, lsl #8
- strh a2, [v2, -lr]
-
- ldr pc, [sp], #4
- .endfunc
-
- .align
- .func idct_col_add_armv5te
-idct_col_add_armv5te:
- str lr, [sp, #-4]!
-
- idct_col
-
- ldr lr, [sp, #36]
-
- ldmfd sp!, {a3, a4}
- ldrh ip, [lr]
- add a2, a3, v1
- mov a2, a2, asr #20
- sub a3, a3, v1
- and v1, ip, #255
- adds a2, a2, v1
- movmi a2, #0
- cmp a2, #255
- movgt a2, #255
- add v1, a4, v2
- mov v1, v1, asr #20
- adds v1, v1, ip, lsr #8
- movmi v1, #0
- cmp v1, #255
- movgt v1, #255
- orr a2, a2, v1, lsl #8
- ldr v1, [sp, #32]
- sub a4, a4, v2
- rsb v2, v1, v1, lsl #3
- ldrh ip, [v2, lr]!
- strh a2, [lr]
- mov a3, a3, asr #20
- and a2, ip, #255
- adds a3, a3, a2
- movmi a3, #0
- cmp a3, #255
- movgt a3, #255
- mov a4, a4, asr #20
- adds a4, a4, ip, lsr #8
- movmi a4, #0
- cmp a4, #255
- movgt a4, #255
- add a2, lr, #2
- str a2, [sp, #28]
- orr a2, a3, a4, lsl #8
- strh a2, [v2]
-
- ldmfd sp!, {a3, a4}
- ldrh ip, [lr, v1]!
- sub a2, a3, v3
- mov a2, a2, asr #20
- add a3, a3, v3
- and v3, ip, #255
- adds a2, a2, v3
- movmi a2, #0
- cmp a2, #255
- movgt a2, #255
- sub v3, a4, v4
- mov v3, v3, asr #20
- adds v3, v3, ip, lsr #8
- movmi v3, #0
- cmp v3, #255
- movgt v3, #255
- orr a2, a2, v3, lsl #8
- add a4, a4, v4
- ldrh ip, [v2, -v1]!
- strh a2, [lr]
- mov a3, a3, asr #20
- and a2, ip, #255
- adds a3, a3, a2
- movmi a3, #0
- cmp a3, #255
- movgt a3, #255
- mov a4, a4, asr #20
- adds a4, a4, ip, lsr #8
- movmi a4, #0
- cmp a4, #255
- movgt a4, #255
- orr a2, a3, a4, lsl #8
- strh a2, [v2]
-
- ldmfd sp!, {a3, a4}
- ldrh ip, [lr, v1]!
- add a2, a3, v5
- mov a2, a2, asr #20
- sub a3, a3, v5
- and v3, ip, #255
- adds a2, a2, v3
- movmi a2, #0
- cmp a2, #255
- movgt a2, #255
- add v3, a4, v6
- mov v3, v3, asr #20
- adds v3, v3, ip, lsr #8
- movmi v3, #0
- cmp v3, #255
- movgt v3, #255
- orr a2, a2, v3, lsl #8
- sub a4, a4, v6
- ldrh ip, [v2, -v1]!
- strh a2, [lr]
- mov a3, a3, asr #20
- and a2, ip, #255
- adds a3, a3, a2
- movmi a3, #0
- cmp a3, #255
- movgt a3, #255
- mov a4, a4, asr #20
- adds a4, a4, ip, lsr #8
- movmi a4, #0
- cmp a4, #255
- movgt a4, #255
- orr a2, a3, a4, lsl #8
- strh a2, [v2]
-
- ldmfd sp!, {a3, a4}
- ldrh ip, [lr, v1]!
- add a2, a3, v7
- mov a2, a2, asr #20
- sub a3, a3, v7
- and v3, ip, #255
- adds a2, a2, v3
- movmi a2, #0
- cmp a2, #255
- movgt a2, #255
- add v3, a4, fp
- mov v3, v3, asr #20
- adds v3, v3, ip, lsr #8
- movmi v3, #0
- cmp v3, #255
- movgt v3, #255
- orr a2, a2, v3, lsl #8
- sub a4, a4, fp
- ldrh ip, [v2, -v1]!
- strh a2, [lr]
- mov a3, a3, asr #20
- and a2, ip, #255
- adds a3, a3, a2
- movmi a3, #0
- cmp a3, #255
- movgt a3, #255
- mov a4, a4, asr #20
- adds a4, a4, ip, lsr #8
- movmi a4, #0
- cmp a4, #255
- movgt a4, #255
- orr a2, a3, a4, lsl #8
- strh a2, [v2]
-
- ldr pc, [sp], #4
- .endfunc
-
- .align
- .global simple_idct_armv5te
- .func simple_idct_armv5te
-simple_idct_armv5te:
- stmfd sp!, {v1, v2, v3, v4, v5, v6, v7, fp, lr}
-
- bl idct_row_armv5te
- add a1, a1, #16
- bl idct_row_armv5te
- add a1, a1, #16
- bl idct_row_armv5te
- add a1, a1, #16
- bl idct_row_armv5te
- add a1, a1, #16
- bl idct_row_armv5te
- add a1, a1, #16
- bl idct_row_armv5te
- add a1, a1, #16
- bl idct_row_armv5te
- add a1, a1, #16
- bl idct_row_armv5te
-
- sub a1, a1, #(16*7)
-
- bl idct_col_armv5te
- add a1, a1, #4
- bl idct_col_armv5te
- add a1, a1, #4
- bl idct_col_armv5te
- add a1, a1, #4
- bl idct_col_armv5te
-
- ldmfd sp!, {v1, v2, v3, v4, v5, v6, v7, fp, pc}
- .endfunc
-
- .align
- .global simple_idct_add_armv5te
- .func simple_idct_add_armv5te
-simple_idct_add_armv5te:
- stmfd sp!, {a1, a2, v1, v2, v3, v4, v5, v6, v7, fp, lr}
-
- mov a1, a3
-
- bl idct_row_armv5te
- add a1, a1, #16
- bl idct_row_armv5te
- add a1, a1, #16
- bl idct_row_armv5te
- add a1, a1, #16
- bl idct_row_armv5te
- add a1, a1, #16
- bl idct_row_armv5te
- add a1, a1, #16
- bl idct_row_armv5te
- add a1, a1, #16
- bl idct_row_armv5te
- add a1, a1, #16
- bl idct_row_armv5te
-
- sub a1, a1, #(16*7)
-
- bl idct_col_add_armv5te
- add a1, a1, #4
- bl idct_col_add_armv5te
- add a1, a1, #4
- bl idct_col_add_armv5te
- add a1, a1, #4
- bl idct_col_add_armv5te
-
- add sp, sp, #8
- ldmfd sp!, {v1, v2, v3, v4, v5, v6, v7, fp, pc}
- .endfunc
-
- .align
- .global simple_idct_put_armv5te
- .func simple_idct_put_armv5te
-simple_idct_put_armv5te:
- stmfd sp!, {a1, a2, v1, v2, v3, v4, v5, v6, v7, fp, lr}
-
- mov a1, a3
-
- bl idct_row_armv5te
- add a1, a1, #16
- bl idct_row_armv5te
- add a1, a1, #16
- bl idct_row_armv5te
- add a1, a1, #16
- bl idct_row_armv5te
- add a1, a1, #16
- bl idct_row_armv5te
- add a1, a1, #16
- bl idct_row_armv5te
- add a1, a1, #16
- bl idct_row_armv5te
- add a1, a1, #16
- bl idct_row_armv5te
-
- sub a1, a1, #(16*7)
-
- bl idct_col_put_armv5te
- add a1, a1, #4
- bl idct_col_put_armv5te
- add a1, a1, #4
- bl idct_col_put_armv5te
- add a1, a1, #4
- bl idct_col_put_armv5te
-
- add sp, sp, #8
- ldmfd sp!, {v1, v2, v3, v4, v5, v6, v7, fp, pc}
- .endfunc
diff --git a/src/libffmpeg/libavcodec/asv1.c b/src/libffmpeg/libavcodec/asv1.c
deleted file mode 100644
index ec6bbb9ba..000000000
--- a/src/libffmpeg/libavcodec/asv1.c
+++ /dev/null
@@ -1,655 +0,0 @@
-/*
- * ASUS V1/V2 codec
- * Copyright (c) 2003 Michael Niedermayer
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file asv1.c
- * ASUS V1/V2 codec.
- */
-
-#include "avcodec.h"
-#include "dsputil.h"
-#include "mpegvideo.h"
-
-//#undef NDEBUG
-//#include <assert.h>
-
-#define VLC_BITS 6
-#define ASV2_LEVEL_VLC_BITS 10
-
-typedef struct ASV1Context{
- AVCodecContext *avctx;
- DSPContext dsp;
- AVFrame picture;
- PutBitContext pb;
- GetBitContext gb;
- ScanTable scantable;
- int inv_qscale;
- int mb_width;
- int mb_height;
- int mb_width2;
- int mb_height2;
- DECLARE_ALIGNED_8(DCTELEM, block[6][64]);
- DECLARE_ALIGNED_8(uint16_t, intra_matrix[64]);
- DECLARE_ALIGNED_8(int, q_intra_matrix[64]);
- uint8_t *bitstream_buffer;
- unsigned int bitstream_buffer_size;
-} ASV1Context;
-
-static const uint8_t scantab[64]={
- 0x00,0x08,0x01,0x09,0x10,0x18,0x11,0x19,
- 0x02,0x0A,0x03,0x0B,0x12,0x1A,0x13,0x1B,
- 0x04,0x0C,0x05,0x0D,0x20,0x28,0x21,0x29,
- 0x06,0x0E,0x07,0x0F,0x14,0x1C,0x15,0x1D,
- 0x22,0x2A,0x23,0x2B,0x30,0x38,0x31,0x39,
- 0x16,0x1E,0x17,0x1F,0x24,0x2C,0x25,0x2D,
- 0x32,0x3A,0x33,0x3B,0x26,0x2E,0x27,0x2F,
- 0x34,0x3C,0x35,0x3D,0x36,0x3E,0x37,0x3F,
-};
-
-
-static const uint8_t ccp_tab[17][2]={
- {0x2,2}, {0x7,5}, {0xB,5}, {0x3,5},
- {0xD,5}, {0x5,5}, {0x9,5}, {0x1,5},
- {0xE,5}, {0x6,5}, {0xA,5}, {0x2,5},
- {0xC,5}, {0x4,5}, {0x8,5}, {0x3,2},
- {0xF,5}, //EOB
-};
-
-static const uint8_t level_tab[7][2]={
- {3,4}, {3,3}, {3,2}, {0,3}, {2,2}, {2,3}, {2,4}
-};
-
-static const uint8_t dc_ccp_tab[8][2]={
- {0x1,2}, {0xD,4}, {0xF,4}, {0xC,4},
- {0x5,3}, {0xE,4}, {0x4,3}, {0x0,2},
-};
-
-static const uint8_t ac_ccp_tab[16][2]={
- {0x00,2}, {0x3B,6}, {0x0A,4}, {0x3A,6},
- {0x02,3}, {0x39,6}, {0x3C,6}, {0x38,6},
- {0x03,3}, {0x3D,6}, {0x08,4}, {0x1F,5},
- {0x09,4}, {0x0B,4}, {0x0D,4}, {0x0C,4},
-};
-
-static const uint8_t asv2_level_tab[63][2]={
- {0x3F,10},{0x2F,10},{0x37,10},{0x27,10},{0x3B,10},{0x2B,10},{0x33,10},{0x23,10},
- {0x3D,10},{0x2D,10},{0x35,10},{0x25,10},{0x39,10},{0x29,10},{0x31,10},{0x21,10},
- {0x1F, 8},{0x17, 8},{0x1B, 8},{0x13, 8},{0x1D, 8},{0x15, 8},{0x19, 8},{0x11, 8},
- {0x0F, 6},{0x0B, 6},{0x0D, 6},{0x09, 6},
- {0x07, 4},{0x05, 4},
- {0x03, 2},
- {0x00, 5},
- {0x02, 2},
- {0x04, 4},{0x06, 4},
- {0x08, 6},{0x0C, 6},{0x0A, 6},{0x0E, 6},
- {0x10, 8},{0x18, 8},{0x14, 8},{0x1C, 8},{0x12, 8},{0x1A, 8},{0x16, 8},{0x1E, 8},
- {0x20,10},{0x30,10},{0x28,10},{0x38,10},{0x24,10},{0x34,10},{0x2C,10},{0x3C,10},
- {0x22,10},{0x32,10},{0x2A,10},{0x3A,10},{0x26,10},{0x36,10},{0x2E,10},{0x3E,10},
-};
-
-
-static VLC ccp_vlc;
-static VLC level_vlc;
-static VLC dc_ccp_vlc;
-static VLC ac_ccp_vlc;
-static VLC asv2_level_vlc;
-
-static void init_vlcs(ASV1Context *a){
- static int done = 0;
-
- if (!done) {
- done = 1;
-
- init_vlc(&ccp_vlc, VLC_BITS, 17,
- &ccp_tab[0][1], 2, 1,
- &ccp_tab[0][0], 2, 1, 1);
- init_vlc(&dc_ccp_vlc, VLC_BITS, 8,
- &dc_ccp_tab[0][1], 2, 1,
- &dc_ccp_tab[0][0], 2, 1, 1);
- init_vlc(&ac_ccp_vlc, VLC_BITS, 16,
- &ac_ccp_tab[0][1], 2, 1,
- &ac_ccp_tab[0][0], 2, 1, 1);
- init_vlc(&level_vlc, VLC_BITS, 7,
- &level_tab[0][1], 2, 1,
- &level_tab[0][0], 2, 1, 1);
- init_vlc(&asv2_level_vlc, ASV2_LEVEL_VLC_BITS, 63,
- &asv2_level_tab[0][1], 2, 1,
- &asv2_level_tab[0][0], 2, 1, 1);
- }
-}
-
-//FIXME write a reversed bitstream reader to avoid the double reverse
-static inline int asv2_get_bits(GetBitContext *gb, int n){
- return ff_reverse[ get_bits(gb, n) << (8-n) ];
-}
-
-static inline void asv2_put_bits(PutBitContext *pb, int n, int v){
- put_bits(pb, n, ff_reverse[ v << (8-n) ]);
-}
-
-static inline int asv1_get_level(GetBitContext *gb){
- int code= get_vlc2(gb, level_vlc.table, VLC_BITS, 1);
-
- if(code==3) return get_sbits(gb, 8);
- else return code - 3;
-}
-
-static inline int asv2_get_level(GetBitContext *gb){
- int code= get_vlc2(gb, asv2_level_vlc.table, ASV2_LEVEL_VLC_BITS, 1);
-
- if(code==31) return (int8_t)asv2_get_bits(gb, 8);
- else return code - 31;
-}
-
-static inline void asv1_put_level(PutBitContext *pb, int level){
- unsigned int index= level + 3;
-
- if(index <= 6) put_bits(pb, level_tab[index][1], level_tab[index][0]);
- else{
- put_bits(pb, level_tab[3][1], level_tab[3][0]);
- put_bits(pb, 8, level&0xFF);
- }
-}
-
-static inline void asv2_put_level(PutBitContext *pb, int level){
- unsigned int index= level + 31;
-
- if(index <= 62) put_bits(pb, asv2_level_tab[index][1], asv2_level_tab[index][0]);
- else{
- put_bits(pb, asv2_level_tab[31][1], asv2_level_tab[31][0]);
- asv2_put_bits(pb, 8, level&0xFF);
- }
-}
-
-static inline int asv1_decode_block(ASV1Context *a, DCTELEM block[64]){
- int i;
-
- block[0]= 8*get_bits(&a->gb, 8);
-
- for(i=0; i<11; i++){
- const int ccp= get_vlc2(&a->gb, ccp_vlc.table, VLC_BITS, 1);
-
- if(ccp){
- if(ccp == 16) break;
- if(ccp < 0 || i>=10){
- av_log(a->avctx, AV_LOG_ERROR, "coded coeff pattern damaged\n");
- return -1;
- }
-
- if(ccp&8) block[a->scantable.permutated[4*i+0]]= (asv1_get_level(&a->gb) * a->intra_matrix[4*i+0])>>4;
- if(ccp&4) block[a->scantable.permutated[4*i+1]]= (asv1_get_level(&a->gb) * a->intra_matrix[4*i+1])>>4;
- if(ccp&2) block[a->scantable.permutated[4*i+2]]= (asv1_get_level(&a->gb) * a->intra_matrix[4*i+2])>>4;
- if(ccp&1) block[a->scantable.permutated[4*i+3]]= (asv1_get_level(&a->gb) * a->intra_matrix[4*i+3])>>4;
- }
- }
-
- return 0;
-}
-
-static inline int asv2_decode_block(ASV1Context *a, DCTELEM block[64]){
- int i, count, ccp;
-
- count= asv2_get_bits(&a->gb, 4);
-
- block[0]= 8*asv2_get_bits(&a->gb, 8);
-
- ccp= get_vlc2(&a->gb, dc_ccp_vlc.table, VLC_BITS, 1);
- if(ccp){
- if(ccp&4) block[a->scantable.permutated[1]]= (asv2_get_level(&a->gb) * a->intra_matrix[1])>>4;
- if(ccp&2) block[a->scantable.permutated[2]]= (asv2_get_level(&a->gb) * a->intra_matrix[2])>>4;
- if(ccp&1) block[a->scantable.permutated[3]]= (asv2_get_level(&a->gb) * a->intra_matrix[3])>>4;
- }
-
- for(i=1; i<count+1; i++){
- const int ccp= get_vlc2(&a->gb, ac_ccp_vlc.table, VLC_BITS, 1);
-
- if(ccp){
- if(ccp&8) block[a->scantable.permutated[4*i+0]]= (asv2_get_level(&a->gb) * a->intra_matrix[4*i+0])>>4;
- if(ccp&4) block[a->scantable.permutated[4*i+1]]= (asv2_get_level(&a->gb) * a->intra_matrix[4*i+1])>>4;
- if(ccp&2) block[a->scantable.permutated[4*i+2]]= (asv2_get_level(&a->gb) * a->intra_matrix[4*i+2])>>4;
- if(ccp&1) block[a->scantable.permutated[4*i+3]]= (asv2_get_level(&a->gb) * a->intra_matrix[4*i+3])>>4;
- }
- }
-
- return 0;
-}
-
-static inline void asv1_encode_block(ASV1Context *a, DCTELEM block[64]){
- int i;
- int nc_count=0;
-
- put_bits(&a->pb, 8, (block[0] + 32)>>6);
- block[0]= 0;
-
- for(i=0; i<10; i++){
- const int index= scantab[4*i];
- int ccp=0;
-
- if( (block[index + 0] = (block[index + 0]*a->q_intra_matrix[index + 0] + (1<<15))>>16) ) ccp |= 8;
- if( (block[index + 8] = (block[index + 8]*a->q_intra_matrix[index + 8] + (1<<15))>>16) ) ccp |= 4;
- if( (block[index + 1] = (block[index + 1]*a->q_intra_matrix[index + 1] + (1<<15))>>16) ) ccp |= 2;
- if( (block[index + 9] = (block[index + 9]*a->q_intra_matrix[index + 9] + (1<<15))>>16) ) ccp |= 1;
-
- if(ccp){
- for(;nc_count; nc_count--)
- put_bits(&a->pb, ccp_tab[0][1], ccp_tab[0][0]);
-
- put_bits(&a->pb, ccp_tab[ccp][1], ccp_tab[ccp][0]);
-
- if(ccp&8) asv1_put_level(&a->pb, block[index + 0]);
- if(ccp&4) asv1_put_level(&a->pb, block[index + 8]);
- if(ccp&2) asv1_put_level(&a->pb, block[index + 1]);
- if(ccp&1) asv1_put_level(&a->pb, block[index + 9]);
- }else{
- nc_count++;
- }
- }
- put_bits(&a->pb, ccp_tab[16][1], ccp_tab[16][0]);
-}
-
-static inline void asv2_encode_block(ASV1Context *a, DCTELEM block[64]){
- int i;
- int count=0;
-
- for(count=63; count>3; count--){
- const int index= scantab[count];
-
- if( (block[index]*a->q_intra_matrix[index] + (1<<15))>>16 )
- break;
- }
-
- count >>= 2;
-
- asv2_put_bits(&a->pb, 4, count);
- asv2_put_bits(&a->pb, 8, (block[0] + 32)>>6);
- block[0]= 0;
-
- for(i=0; i<=count; i++){
- const int index= scantab[4*i];
- int ccp=0;
-
- if( (block[index + 0] = (block[index + 0]*a->q_intra_matrix[index + 0] + (1<<15))>>16) ) ccp |= 8;
- if( (block[index + 8] = (block[index + 8]*a->q_intra_matrix[index + 8] + (1<<15))>>16) ) ccp |= 4;
- if( (block[index + 1] = (block[index + 1]*a->q_intra_matrix[index + 1] + (1<<15))>>16) ) ccp |= 2;
- if( (block[index + 9] = (block[index + 9]*a->q_intra_matrix[index + 9] + (1<<15))>>16) ) ccp |= 1;
-
- assert(i || ccp<8);
- if(i) put_bits(&a->pb, ac_ccp_tab[ccp][1], ac_ccp_tab[ccp][0]);
- else put_bits(&a->pb, dc_ccp_tab[ccp][1], dc_ccp_tab[ccp][0]);
-
- if(ccp){
- if(ccp&8) asv2_put_level(&a->pb, block[index + 0]);
- if(ccp&4) asv2_put_level(&a->pb, block[index + 8]);
- if(ccp&2) asv2_put_level(&a->pb, block[index + 1]);
- if(ccp&1) asv2_put_level(&a->pb, block[index + 9]);
- }
- }
-}
-
-static inline int decode_mb(ASV1Context *a, DCTELEM block[6][64]){
- int i;
-
- a->dsp.clear_blocks(block[0]);
-
- if(a->avctx->codec_id == CODEC_ID_ASV1){
- for(i=0; i<6; i++){
- if( asv1_decode_block(a, block[i]) < 0)
- return -1;
- }
- }else{
- for(i=0; i<6; i++){
- if( asv2_decode_block(a, block[i]) < 0)
- return -1;
- }
- }
- return 0;
-}
-
-static inline int encode_mb(ASV1Context *a, DCTELEM block[6][64]){
- int i;
-
- if(a->pb.buf_end - a->pb.buf - (put_bits_count(&a->pb)>>3) < 30*16*16*3/2/8){
- av_log(a->avctx, AV_LOG_ERROR, "encoded frame too large\n");
- return -1;
- }
-
- if(a->avctx->codec_id == CODEC_ID_ASV1){
- for(i=0; i<6; i++)
- asv1_encode_block(a, block[i]);
- }else{
- for(i=0; i<6; i++)
- asv2_encode_block(a, block[i]);
- }
- return 0;
-}
-
-static inline void idct_put(ASV1Context *a, int mb_x, int mb_y){
- DCTELEM (*block)[64]= a->block;
- int linesize= a->picture.linesize[0];
-
- uint8_t *dest_y = a->picture.data[0] + (mb_y * 16* linesize ) + mb_x * 16;
- uint8_t *dest_cb = a->picture.data[1] + (mb_y * 8 * a->picture.linesize[1]) + mb_x * 8;
- uint8_t *dest_cr = a->picture.data[2] + (mb_y * 8 * a->picture.linesize[2]) + mb_x * 8;
-
- a->dsp.idct_put(dest_y , linesize, block[0]);
- a->dsp.idct_put(dest_y + 8, linesize, block[1]);
- a->dsp.idct_put(dest_y + 8*linesize , linesize, block[2]);
- a->dsp.idct_put(dest_y + 8*linesize + 8, linesize, block[3]);
-
- if(!(a->avctx->flags&CODEC_FLAG_GRAY)){
- a->dsp.idct_put(dest_cb, a->picture.linesize[1], block[4]);
- a->dsp.idct_put(dest_cr, a->picture.linesize[2], block[5]);
- }
-}
-
-static inline void dct_get(ASV1Context *a, int mb_x, int mb_y){
- DCTELEM (*block)[64]= a->block;
- int linesize= a->picture.linesize[0];
- int i;
-
- uint8_t *ptr_y = a->picture.data[0] + (mb_y * 16* linesize ) + mb_x * 16;
- uint8_t *ptr_cb = a->picture.data[1] + (mb_y * 8 * a->picture.linesize[1]) + mb_x * 8;
- uint8_t *ptr_cr = a->picture.data[2] + (mb_y * 8 * a->picture.linesize[2]) + mb_x * 8;
-
- a->dsp.get_pixels(block[0], ptr_y , linesize);
- a->dsp.get_pixels(block[1], ptr_y + 8, linesize);
- a->dsp.get_pixels(block[2], ptr_y + 8*linesize , linesize);
- a->dsp.get_pixels(block[3], ptr_y + 8*linesize + 8, linesize);
- for(i=0; i<4; i++)
- a->dsp.fdct(block[i]);
-
- if(!(a->avctx->flags&CODEC_FLAG_GRAY)){
- a->dsp.get_pixels(block[4], ptr_cb, a->picture.linesize[1]);
- a->dsp.get_pixels(block[5], ptr_cr, a->picture.linesize[2]);
- for(i=4; i<6; i++)
- a->dsp.fdct(block[i]);
- }
-}
-
-static int decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- ASV1Context * const a = avctx->priv_data;
- AVFrame *picture = data;
- AVFrame * const p= (AVFrame*)&a->picture;
- int mb_x, mb_y;
-
- if(p->data[0])
- avctx->release_buffer(avctx, p);
-
- p->reference= 0;
- if(avctx->get_buffer(avctx, p) < 0){
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
- p->pict_type= I_TYPE;
- p->key_frame= 1;
-
- a->bitstream_buffer= av_fast_realloc(a->bitstream_buffer, &a->bitstream_buffer_size, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
-
- if(avctx->codec_id == CODEC_ID_ASV1)
- a->dsp.bswap_buf((uint32_t*)a->bitstream_buffer, (uint32_t*)buf, buf_size/4);
- else{
- int i;
- for(i=0; i<buf_size; i++)
- a->bitstream_buffer[i]= ff_reverse[ buf[i] ];
- }
-
- init_get_bits(&a->gb, a->bitstream_buffer, buf_size*8);
-
- for(mb_y=0; mb_y<a->mb_height2; mb_y++){
- for(mb_x=0; mb_x<a->mb_width2; mb_x++){
- if( decode_mb(a, a->block) <0)
- return -1;
-
- idct_put(a, mb_x, mb_y);
- }
- }
-
- if(a->mb_width2 != a->mb_width){
- mb_x= a->mb_width2;
- for(mb_y=0; mb_y<a->mb_height2; mb_y++){
- if( decode_mb(a, a->block) <0)
- return -1;
-
- idct_put(a, mb_x, mb_y);
- }
- }
-
- if(a->mb_height2 != a->mb_height){
- mb_y= a->mb_height2;
- for(mb_x=0; mb_x<a->mb_width; mb_x++){
- if( decode_mb(a, a->block) <0)
- return -1;
-
- idct_put(a, mb_x, mb_y);
- }
- }
-#if 0
-int i;
-printf("%d %d\n", 8*buf_size, get_bits_count(&a->gb));
-for(i=get_bits_count(&a->gb); i<8*buf_size; i++){
- printf("%d", get_bits1(&a->gb));
-}
-
-for(i=0; i<s->avctx->extradata_size; i++){
- printf("%c\n", ((uint8_t*)s->avctx->extradata)[i]);
-}
-#endif
-
- *picture= *(AVFrame*)&a->picture;
- *data_size = sizeof(AVPicture);
-
- emms_c();
-
- return (get_bits_count(&a->gb)+31)/32*4;
-}
-
-#ifdef CONFIG_ENCODERS
-static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){
- ASV1Context * const a = avctx->priv_data;
- AVFrame *pict = data;
- AVFrame * const p= (AVFrame*)&a->picture;
- int size;
- int mb_x, mb_y;
-
- init_put_bits(&a->pb, buf, buf_size);
-
- *p = *pict;
- p->pict_type= I_TYPE;
- p->key_frame= 1;
-
- for(mb_y=0; mb_y<a->mb_height2; mb_y++){
- for(mb_x=0; mb_x<a->mb_width2; mb_x++){
- dct_get(a, mb_x, mb_y);
- encode_mb(a, a->block);
- }
- }
-
- if(a->mb_width2 != a->mb_width){
- mb_x= a->mb_width2;
- for(mb_y=0; mb_y<a->mb_height2; mb_y++){
- dct_get(a, mb_x, mb_y);
- encode_mb(a, a->block);
- }
- }
-
- if(a->mb_height2 != a->mb_height){
- mb_y= a->mb_height2;
- for(mb_x=0; mb_x<a->mb_width; mb_x++){
- dct_get(a, mb_x, mb_y);
- encode_mb(a, a->block);
- }
- }
- emms_c();
-
- align_put_bits(&a->pb);
- while(put_bits_count(&a->pb)&31)
- put_bits(&a->pb, 8, 0);
-
- size= put_bits_count(&a->pb)/32;
-
- if(avctx->codec_id == CODEC_ID_ASV1)
- a->dsp.bswap_buf((uint32_t*)buf, (uint32_t*)buf, size);
- else{
- int i;
- for(i=0; i<4*size; i++)
- buf[i]= ff_reverse[ buf[i] ];
- }
-
- return size*4;
-}
-#endif /* CONFIG_ENCODERS */
-
-static void common_init(AVCodecContext *avctx){
- ASV1Context * const a = avctx->priv_data;
-
- dsputil_init(&a->dsp, avctx);
-
- a->mb_width = (avctx->width + 15) / 16;
- a->mb_height = (avctx->height + 15) / 16;
- a->mb_width2 = (avctx->width + 0) / 16;
- a->mb_height2 = (avctx->height + 0) / 16;
-
- avctx->coded_frame= (AVFrame*)&a->picture;
- a->avctx= avctx;
-}
-
-static int decode_init(AVCodecContext *avctx){
- ASV1Context * const a = avctx->priv_data;
- AVFrame *p= (AVFrame*)&a->picture;
- int i;
- const int scale= avctx->codec_id == CODEC_ID_ASV1 ? 1 : 2;
-
- common_init(avctx);
- init_vlcs(a);
- ff_init_scantable(a->dsp.idct_permutation, &a->scantable, scantab);
- avctx->pix_fmt= PIX_FMT_YUV420P;
-
- a->inv_qscale= ((uint8_t*)avctx->extradata)[0];
- if(a->inv_qscale == 0){
- av_log(avctx, AV_LOG_ERROR, "illegal qscale 0\n");
- if(avctx->codec_id == CODEC_ID_ASV1)
- a->inv_qscale= 6;
- else
- a->inv_qscale= 10;
- }
-
- for(i=0; i<64; i++){
- int index= scantab[i];
-
- a->intra_matrix[i]= 64*scale*ff_mpeg1_default_intra_matrix[index] / a->inv_qscale;
- }
-
- p->qstride= a->mb_width;
- p->qscale_table= av_malloc( p->qstride * a->mb_height);
- p->quality= (32*scale + a->inv_qscale/2)/a->inv_qscale;
- memset(p->qscale_table, p->quality, p->qstride*a->mb_height);
-
- return 0;
-}
-
-#ifdef CONFIG_ENCODERS
-static int encode_init(AVCodecContext *avctx){
- ASV1Context * const a = avctx->priv_data;
- int i;
- const int scale= avctx->codec_id == CODEC_ID_ASV1 ? 1 : 2;
-
- common_init(avctx);
-
- if(avctx->global_quality == 0) avctx->global_quality= 4*FF_QUALITY_SCALE;
-
- a->inv_qscale= (32*scale*FF_QUALITY_SCALE + avctx->global_quality/2) / avctx->global_quality;
-
- avctx->extradata= av_mallocz(8);
- avctx->extradata_size=8;
- ((uint32_t*)avctx->extradata)[0]= le2me_32(a->inv_qscale);
- ((uint32_t*)avctx->extradata)[1]= le2me_32(ff_get_fourcc("ASUS"));
-
- for(i=0; i<64; i++){
- int q= 32*scale*ff_mpeg1_default_intra_matrix[i];
- a->q_intra_matrix[i]= ((a->inv_qscale<<16) + q/2) / q;
- }
-
- return 0;
-}
-#endif
-
-static int decode_end(AVCodecContext *avctx){
- ASV1Context * const a = avctx->priv_data;
-
- av_freep(&a->bitstream_buffer);
- av_freep(&a->picture.qscale_table);
- a->bitstream_buffer_size=0;
-
- return 0;
-}
-
-AVCodec asv1_decoder = {
- "asv1",
- CODEC_TYPE_VIDEO,
- CODEC_ID_ASV1,
- sizeof(ASV1Context),
- decode_init,
- NULL,
- decode_end,
- decode_frame,
- CODEC_CAP_DR1,
-};
-
-AVCodec asv2_decoder = {
- "asv2",
- CODEC_TYPE_VIDEO,
- CODEC_ID_ASV2,
- sizeof(ASV1Context),
- decode_init,
- NULL,
- decode_end,
- decode_frame,
- CODEC_CAP_DR1,
-};
-
-#ifdef CONFIG_ENCODERS
-
-AVCodec asv1_encoder = {
- "asv1",
- CODEC_TYPE_VIDEO,
- CODEC_ID_ASV1,
- sizeof(ASV1Context),
- encode_init,
- encode_frame,
- //encode_end,
- .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV420P, -1},
-};
-
-AVCodec asv2_encoder = {
- "asv2",
- CODEC_TYPE_VIDEO,
- CODEC_ID_ASV2,
- sizeof(ASV1Context),
- encode_init,
- encode_frame,
- //encode_end,
- .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV420P, -1},
-};
-
-#endif //CONFIG_ENCODERS
diff --git a/src/libffmpeg/libavcodec/avcodec.h b/src/libffmpeg/libavcodec/avcodec.h
deleted file mode 100644
index ee4eb0122..000000000
--- a/src/libffmpeg/libavcodec/avcodec.h
+++ /dev/null
@@ -1,2714 +0,0 @@
-/*
- * copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_H
-#define AVCODEC_H
-
-/**
- * @file avcodec.h
- * external api header.
- */
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "avutil.h"
-#include <sys/types.h> /* size_t */
-
-#define AV_STRINGIFY(s) AV_TOSTRING(s)
-#define AV_TOSTRING(s) #s
-
-#define LIBAVCODEC_VERSION_INT ((51<<16)+(29<<8)+0)
-#define LIBAVCODEC_VERSION 51.29.0
-#define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT
-
-#define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION)
-
-#define AV_NOPTS_VALUE INT64_C(0x8000000000000000)
-#define AV_TIME_BASE 1000000
-#define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE}
-
-/* FIXME: We cannot use ffmpeg's XvMC capabilities, since that would require
- * linking the ffmpeg plugin against XvMC libraries, which is a bad thing,
- * since they are output dependend.
- * The correct fix would be to reimplement the XvMC functions libavcodec uses
- * and do the necessary talking with our XvMC output plugin there. */
-#undef HAVE_XVMC
-
-enum CodecID {
- CODEC_ID_NONE,
- CODEC_ID_MPEG1VIDEO,
- CODEC_ID_MPEG2VIDEO, /* prefered ID for MPEG Video 1 or 2 decoding */
- CODEC_ID_MPEG2VIDEO_XVMC,
- CODEC_ID_H261,
- CODEC_ID_H263,
- CODEC_ID_RV10,
- CODEC_ID_RV20,
- CODEC_ID_MJPEG,
- CODEC_ID_MJPEGB,
- CODEC_ID_LJPEG,
- CODEC_ID_SP5X,
- CODEC_ID_JPEGLS,
- CODEC_ID_MPEG4,
- CODEC_ID_RAWVIDEO,
- CODEC_ID_MSMPEG4V1,
- CODEC_ID_MSMPEG4V2,
- CODEC_ID_MSMPEG4V3,
- CODEC_ID_WMV1,
- CODEC_ID_WMV2,
- CODEC_ID_H263P,
- CODEC_ID_H263I,
- CODEC_ID_FLV1,
- CODEC_ID_SVQ1,
- CODEC_ID_SVQ3,
- CODEC_ID_DVVIDEO,
- CODEC_ID_HUFFYUV,
- CODEC_ID_CYUV,
- CODEC_ID_H264,
- CODEC_ID_INDEO3,
- CODEC_ID_VP3,
- CODEC_ID_THEORA,
- CODEC_ID_ASV1,
- CODEC_ID_ASV2,
- CODEC_ID_FFV1,
- CODEC_ID_4XM,
- CODEC_ID_VCR1,
- CODEC_ID_CLJR,
- CODEC_ID_MDEC,
- CODEC_ID_ROQ,
- CODEC_ID_INTERPLAY_VIDEO,
- CODEC_ID_XAN_WC3,
- CODEC_ID_XAN_WC4,
- CODEC_ID_RPZA,
- CODEC_ID_CINEPAK,
- CODEC_ID_WS_VQA,
- CODEC_ID_MSRLE,
- CODEC_ID_MSVIDEO1,
- CODEC_ID_IDCIN,
- CODEC_ID_8BPS,
- CODEC_ID_SMC,
- CODEC_ID_FLIC,
- CODEC_ID_TRUEMOTION1,
- CODEC_ID_VMDVIDEO,
- CODEC_ID_MSZH,
- CODEC_ID_ZLIB,
- CODEC_ID_QTRLE,
- CODEC_ID_SNOW,
- CODEC_ID_TSCC,
- CODEC_ID_ULTI,
- CODEC_ID_QDRAW,
- CODEC_ID_VIXL,
- CODEC_ID_QPEG,
- CODEC_ID_XVID,
- CODEC_ID_PNG,
- CODEC_ID_PPM,
- CODEC_ID_PBM,
- CODEC_ID_PGM,
- CODEC_ID_PGMYUV,
- CODEC_ID_PAM,
- CODEC_ID_FFVHUFF,
- CODEC_ID_RV30,
- CODEC_ID_RV40,
- CODEC_ID_VC1,
- CODEC_ID_WMV3,
- CODEC_ID_LOCO,
- CODEC_ID_WNV1,
- CODEC_ID_AASC,
- CODEC_ID_INDEO2,
- CODEC_ID_FRAPS,
- CODEC_ID_TRUEMOTION2,
- CODEC_ID_BMP,
- CODEC_ID_CSCD,
- CODEC_ID_MMVIDEO,
- CODEC_ID_ZMBV,
- CODEC_ID_AVS,
- CODEC_ID_SMACKVIDEO,
- CODEC_ID_NUV,
- CODEC_ID_KMVC,
- CODEC_ID_FLASHSV,
- CODEC_ID_CAVS,
- CODEC_ID_JPEG2000,
- CODEC_ID_VMNC,
- CODEC_ID_VP5,
- CODEC_ID_VP6,
- CODEC_ID_VP6F,
- CODEC_ID_TARGA,
- CODEC_ID_DSICINVIDEO,
- CODEC_ID_TIERTEXSEQVIDEO,
- CODEC_ID_TIFF,
- CODEC_ID_GIF,
- CODEC_ID_FFH264,
-
- /* various pcm "codecs" */
- CODEC_ID_PCM_S16LE= 0x10000,
- CODEC_ID_PCM_S16BE,
- CODEC_ID_PCM_U16LE,
- CODEC_ID_PCM_U16BE,
- CODEC_ID_PCM_S8,
- CODEC_ID_PCM_U8,
- CODEC_ID_PCM_MULAW,
- CODEC_ID_PCM_ALAW,
- CODEC_ID_PCM_S32LE,
- CODEC_ID_PCM_S32BE,
- CODEC_ID_PCM_U32LE,
- CODEC_ID_PCM_U32BE,
- CODEC_ID_PCM_S24LE,
- CODEC_ID_PCM_S24BE,
- CODEC_ID_PCM_U24LE,
- CODEC_ID_PCM_U24BE,
- CODEC_ID_PCM_S24DAUD,
-
- /* various adpcm codecs */
- CODEC_ID_ADPCM_IMA_QT= 0x11000,
- CODEC_ID_ADPCM_IMA_WAV,
- CODEC_ID_ADPCM_IMA_DK3,
- CODEC_ID_ADPCM_IMA_DK4,
- CODEC_ID_ADPCM_IMA_WS,
- CODEC_ID_ADPCM_IMA_SMJPEG,
- CODEC_ID_ADPCM_MS,
- CODEC_ID_ADPCM_4XM,
- CODEC_ID_ADPCM_XA,
- CODEC_ID_ADPCM_ADX,
- CODEC_ID_ADPCM_EA,
- CODEC_ID_ADPCM_G726,
- CODEC_ID_ADPCM_CT,
- CODEC_ID_ADPCM_SWF,
- CODEC_ID_ADPCM_YAMAHA,
- CODEC_ID_ADPCM_SBPRO_4,
- CODEC_ID_ADPCM_SBPRO_3,
- CODEC_ID_ADPCM_SBPRO_2,
-
- /* AMR */
- CODEC_ID_AMR_NB= 0x12000,
- CODEC_ID_AMR_WB,
-
- /* RealAudio codecs*/
- CODEC_ID_RA_144= 0x13000,
- CODEC_ID_RA_288,
-
- /* various DPCM codecs */
- CODEC_ID_ROQ_DPCM= 0x14000,
- CODEC_ID_INTERPLAY_DPCM,
- CODEC_ID_XAN_DPCM,
- CODEC_ID_SOL_DPCM,
-
- CODEC_ID_MP2= 0x15000,
- CODEC_ID_MP3, /* prefered ID for MPEG Audio layer 1, 2 or3 decoding */
- CODEC_ID_AAC,
-#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
- CODEC_ID_MPEG4AAC,
-#endif
- CODEC_ID_AC3,
- CODEC_ID_DTS,
- CODEC_ID_VORBIS,
- CODEC_ID_DVAUDIO,
- CODEC_ID_WMAV1,
- CODEC_ID_WMAV2,
- CODEC_ID_MACE3,
- CODEC_ID_MACE6,
- CODEC_ID_VMDAUDIO,
- CODEC_ID_SONIC,
- CODEC_ID_SONIC_LS,
- CODEC_ID_FLAC,
- CODEC_ID_MP3ADU,
- CODEC_ID_MP3ON4,
- CODEC_ID_SHORTEN,
- CODEC_ID_ALAC,
- CODEC_ID_WESTWOOD_SND1,
- CODEC_ID_GSM,
- CODEC_ID_QDM2,
- CODEC_ID_COOK,
- CODEC_ID_TRUESPEECH,
- CODEC_ID_TTA,
- CODEC_ID_SMACKAUDIO,
- CODEC_ID_QCELP,
- CODEC_ID_WAVPACK,
- CODEC_ID_DSICINAUDIO,
- CODEC_ID_IMC,
- CODEC_ID_MUSEPACK7,
-
- /* subtitle codecs */
- CODEC_ID_DVD_SUBTITLE= 0x17000,
- CODEC_ID_DVB_SUBTITLE,
-
- CODEC_ID_MPEG2TS= 0x20000, /* _FAKE_ codec to indicate a raw MPEG2 transport
- stream (only used by libavformat) */
-};
-
-/* CODEC_ID_MP3LAME is absolete */
-#define CODEC_ID_MP3LAME CODEC_ID_MP3
-
-enum CodecType {
- CODEC_TYPE_UNKNOWN = -1,
- CODEC_TYPE_VIDEO,
- CODEC_TYPE_AUDIO,
- CODEC_TYPE_DATA,
- CODEC_TYPE_SUBTITLE,
-};
-
-/* currently unused, may be used if 24/32 bits samples ever supported */
-/* all in native endian */
-enum SampleFormat {
- SAMPLE_FMT_NONE = -1,
- SAMPLE_FMT_U8, ///< unsigned 8 bits
- SAMPLE_FMT_S16, ///< signed 16 bits
- SAMPLE_FMT_S24, ///< signed 24 bits
- SAMPLE_FMT_S32, ///< signed 32 bits
- SAMPLE_FMT_FLT, ///< float
-};
-
-/* in bytes */
-#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
-
-/**
- * Required number of additionally allocated bytes at the end of the input bitstream for decoding.
- * this is mainly needed because some optimized bitstream readers read
- * 32 or 64 bit at once and could read over the end<br>
- * Note, if the first 23 bits of the additional bytes are not 0 then damaged
- * MPEG bitstreams could cause overread and segfault
- */
-#define FF_INPUT_BUFFER_PADDING_SIZE 8
-
-/**
- * minimum encoding buffer size.
- * used to avoid some checks during header writing
- */
-#define FF_MIN_BUFFER_SIZE 16384
-
-/* motion estimation type, EPZS by default */
-enum Motion_Est_ID {
- ME_ZERO = 1,
- ME_FULL,
- ME_LOG,
- ME_PHODS,
- ME_EPZS,
- ME_X1,
- ME_HEX,
- ME_UMH,
- ME_ITER,
-};
-
-enum AVDiscard{
-//we leave some space between them for extensions (drop some keyframes for intra only or drop just some bidir frames)
- AVDISCARD_NONE =-16, ///< discard nothing
- AVDISCARD_DEFAULT= 0, ///< discard useless packets like 0 size packets in avi
- AVDISCARD_NONREF = 8, ///< discard all non reference
- AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames
- AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes
- AVDISCARD_ALL = 48, ///< discard all
-};
-
-typedef struct RcOverride{
- int start_frame;
- int end_frame;
- int qscale; // if this is 0 then quality_factor will be used instead
- float quality_factor;
-} RcOverride;
-
-#define FF_MAX_B_FRAMES 16
-
-/* encoding support
- these flags can be passed in AVCodecContext.flags before initing
- Note: not everything is supported yet.
-*/
-
-#define CODEC_FLAG_QSCALE 0x0002 ///< use fixed qscale
-#define CODEC_FLAG_4MV 0x0004 ///< 4 MV per MB allowed / Advanced prediction for H263
-#define CODEC_FLAG_QPEL 0x0010 ///< use qpel MC
-#define CODEC_FLAG_GMC 0x0020 ///< use GMC
-#define CODEC_FLAG_MV0 0x0040 ///< always try a MB with MV=<0,0>
-#define CODEC_FLAG_PART 0x0080 ///< use data partitioning
-/* parent program gurantees that the input for b-frame containing streams is not written to
- for at least s->max_b_frames+1 frames, if this is not set than the input will be copied */
-#define CODEC_FLAG_INPUT_PRESERVED 0x0100
-#define CODEC_FLAG_PASS1 0x0200 ///< use internal 2pass ratecontrol in first pass mode
-#define CODEC_FLAG_PASS2 0x0400 ///< use internal 2pass ratecontrol in second pass mode
-#define CODEC_FLAG_EXTERN_HUFF 0x1000 ///< use external huffman table (for mjpeg)
-#define CODEC_FLAG_GRAY 0x2000 ///< only decode/encode grayscale
-#define CODEC_FLAG_EMU_EDGE 0x4000///< don't draw edges
-#define CODEC_FLAG_PSNR 0x8000 ///< error[?] variables will be set during encoding
-#define CODEC_FLAG_TRUNCATED 0x00010000 /** input bitstream might be truncated at a random location instead
- of only at frame boundaries */
-#define CODEC_FLAG_NORMALIZE_AQP 0x00020000 ///< normalize adaptive quantization
-#define CODEC_FLAG_INTERLACED_DCT 0x00040000 ///< use interlaced dct
-#define CODEC_FLAG_LOW_DELAY 0x00080000 ///< force low delay
-#define CODEC_FLAG_ALT_SCAN 0x00100000 ///< use alternate scan
-#define CODEC_FLAG_TRELLIS_QUANT 0x00200000 ///< use trellis quantization
-#define CODEC_FLAG_GLOBAL_HEADER 0x00400000 ///< place global headers in extradata instead of every keyframe
-#define CODEC_FLAG_BITEXACT 0x00800000 ///< use only bitexact stuff (except (i)dct)
-/* Fx : Flag for h263+ extra options */
-#define CODEC_FLAG_H263P_AIC 0x01000000 ///< H263 Advanced intra coding / MPEG4 AC prediction (remove this)
-#define CODEC_FLAG_AC_PRED 0x01000000 ///< H263 Advanced intra coding / MPEG4 AC prediction
-#define CODEC_FLAG_H263P_UMV 0x02000000 ///< Unlimited motion vector
-#define CODEC_FLAG_CBP_RD 0x04000000 ///< use rate distortion optimization for cbp
-#define CODEC_FLAG_QP_RD 0x08000000 ///< use rate distortion optimization for qp selectioon
-#define CODEC_FLAG_H263P_AIV 0x00000008 ///< H263 Alternative inter vlc
-#define CODEC_FLAG_OBMC 0x00000001 ///< OBMC
-#define CODEC_FLAG_LOOP_FILTER 0x00000800 ///< loop filter
-#define CODEC_FLAG_H263P_SLICE_STRUCT 0x10000000
-#define CODEC_FLAG_INTERLACED_ME 0x20000000 ///< interlaced motion estimation
-#define CODEC_FLAG_SVCD_SCAN_OFFSET 0x40000000 ///< will reserve space for SVCD scan offset user data
-#define CODEC_FLAG_CLOSED_GOP ((int)0x80000000)
-#define CODEC_FLAG2_FAST 0x00000001 ///< allow non spec compliant speedup tricks
-#define CODEC_FLAG2_STRICT_GOP 0x00000002 ///< strictly enforce GOP size
-#define CODEC_FLAG2_NO_OUTPUT 0x00000004 ///< skip bitstream encoding
-#define CODEC_FLAG2_LOCAL_HEADER 0x00000008 ///< place global headers at every keyframe instead of in extradata
-#define CODEC_FLAG2_BPYRAMID 0x00000010 ///< H.264 allow b-frames to be used as references
-#define CODEC_FLAG2_WPRED 0x00000020 ///< H.264 weighted biprediction for b-frames
-#define CODEC_FLAG2_MIXED_REFS 0x00000040 ///< H.264 one reference per partition, as opposed to one reference per macroblock
-#define CODEC_FLAG2_8X8DCT 0x00000080 ///< H.264 high profile 8x8 transform
-#define CODEC_FLAG2_FASTPSKIP 0x00000100 ///< H.264 fast pskip
-#define CODEC_FLAG2_AUD 0x00000200 ///< H.264 access unit delimiters
-#define CODEC_FLAG2_BRDO 0x00000400 ///< b-frame rate-distortion optimization
-#define CODEC_FLAG2_INTRA_VLC 0x00000800 ///< use MPEG-2 intra VLC table
-#define CODEC_FLAG2_MEMC_ONLY 0x00001000 ///< only do ME/MC (I frames -> ref, P frame -> ME+MC)
-#define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000 ///< timecode is in drop frame format
-#define CODEC_FLAG2_SKIP_RD 0x00004000 ///< RD optimal MB level residual skiping
-
-/* Unsupported options :
- * Syntax Arithmetic coding (SAC)
- * Reference Picture Selection
- * Independant Segment Decoding */
-/* /Fx */
-/* codec capabilities */
-
-#define CODEC_CAP_DRAW_HORIZ_BAND 0x0001 ///< decoder can use draw_horiz_band callback
-/**
- * Codec uses get_buffer() for allocating buffers.
- * direct rendering method 1
- */
-#define CODEC_CAP_DR1 0x0002
-/* if 'parse_only' field is true, then avcodec_parse_frame() can be
- used */
-#define CODEC_CAP_PARSE_ONLY 0x0004
-#define CODEC_CAP_TRUNCATED 0x0008
-/* codec can export data for HW decoding (XvMC) */
-#define CODEC_CAP_HWACCEL 0x0010
-/**
- * codec has a non zero delay and needs to be feeded with NULL at the end to get the delayed data.
- * if this is not set, the codec is guranteed to never be feeded with NULL data
- */
-#define CODEC_CAP_DELAY 0x0020
-/**
- * Codec can be fed a final frame with a smaller size.
- * This can be used to prevent truncation of the last audio samples.
- */
-#define CODEC_CAP_SMALL_LAST_FRAME 0x0040
-
-//the following defines may change, don't expect compatibility if you use them
-#define MB_TYPE_INTRA4x4 0x0001
-#define MB_TYPE_INTRA16x16 0x0002 //FIXME h264 specific
-#define MB_TYPE_INTRA_PCM 0x0004 //FIXME h264 specific
-#define MB_TYPE_16x16 0x0008
-#define MB_TYPE_16x8 0x0010
-#define MB_TYPE_8x16 0x0020
-#define MB_TYPE_8x8 0x0040
-#define MB_TYPE_INTERLACED 0x0080
-#define MB_TYPE_DIRECT2 0x0100 //FIXME
-#define MB_TYPE_ACPRED 0x0200
-#define MB_TYPE_GMC 0x0400
-#define MB_TYPE_SKIP 0x0800
-#define MB_TYPE_P0L0 0x1000
-#define MB_TYPE_P1L0 0x2000
-#define MB_TYPE_P0L1 0x4000
-#define MB_TYPE_P1L1 0x8000
-#define MB_TYPE_L0 (MB_TYPE_P0L0 | MB_TYPE_P1L0)
-#define MB_TYPE_L1 (MB_TYPE_P0L1 | MB_TYPE_P1L1)
-#define MB_TYPE_L0L1 (MB_TYPE_L0 | MB_TYPE_L1)
-#define MB_TYPE_QUANT 0x00010000
-#define MB_TYPE_CBP 0x00020000
-//Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...)
-
-/**
- * Pan Scan area.
- * this specifies the area which should be displayed. Note there may be multiple such areas for one frame
- */
-typedef struct AVPanScan{
- /**
- * id.
- * - encoding: set by user.
- * - decoding: set by lavc
- */
- int id;
-
- /**
- * width and height in 1/16 pel
- * - encoding: set by user.
- * - decoding: set by lavc
- */
- int width;
- int height;
-
- /**
- * position of the top left corner in 1/16 pel for up to 3 fields/frames.
- * - encoding: set by user.
- * - decoding: set by lavc
- */
- int16_t position[3][2];
-}AVPanScan;
-
-#define FF_COMMON_FRAME \
- /**\
- * pointer to the picture planes.\
- * this might be different from the first allocated byte\
- * - encoding: \
- * - decoding: \
- */\
- uint8_t *data[4];\
- int linesize[4];\
- /**\
- * pointer to the first allocated byte of the picture. can be used in get_buffer/release_buffer\
- * this isn't used by lavc unless the default get/release_buffer() is used\
- * - encoding: \
- * - decoding: \
- */\
- uint8_t *base[4];\
- /**\
- * 1 -> keyframe, 0-> not\
- * - encoding: set by lavc\
- * - decoding: set by lavc\
- */\
- int key_frame;\
-\
- /**\
- * picture type of the frame, see ?_TYPE below.\
- * - encoding: set by lavc for coded_picture (and set by user for input)\
- * - decoding: set by lavc\
- */\
- int pict_type;\
-\
- /**\
- * presentation timestamp in time_base units (time when frame should be shown to user)\
- * if AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed\
- * - encoding: MUST be set by user\
- * - decoding: set by lavc\
- */\
- int64_t pts;\
-\
- /**\
- * picture number in bitstream order.\
- * - encoding: set by\
- * - decoding: set by lavc\
- */\
- int coded_picture_number;\
- /**\
- * picture number in display order.\
- * - encoding: set by\
- * - decoding: set by lavc\
- */\
- int display_picture_number;\
-\
- /**\
- * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) \
- * - encoding: set by lavc for coded_picture (and set by user for input)\
- * - decoding: set by lavc\
- */\
- int quality; \
-\
- /**\
- * buffer age (1->was last buffer and dint change, 2->..., ...).\
- * set to INT_MAX if the buffer has not been used yet \
- * - encoding: unused\
- * - decoding: MUST be set by get_buffer()\
- */\
- int age;\
-\
- /**\
- * is this picture used as reference\
- * - encoding: unused\
- * - decoding: set by lavc (before get_buffer() call))\
- */\
- int reference;\
-\
- /**\
- * QP table\
- * - encoding: unused\
- * - decoding: set by lavc\
- */\
- int8_t *qscale_table;\
- /**\
- * QP store stride\
- * - encoding: unused\
- * - decoding: set by lavc\
- */\
- int qstride;\
-\
- /**\
- * mbskip_table[mb]>=1 if MB didnt change\
- * stride= mb_width = (width+15)>>4\
- * - encoding: unused\
- * - decoding: set by lavc\
- */\
- uint8_t *mbskip_table;\
-\
- /**\
- * Motion vector table.\
- * @code\
- * example:\
- * int mv_sample_log2= 4 - motion_subsample_log2;\
- * int mb_width= (width+15)>>4;\
- * int mv_stride= (mb_width << mv_sample_log2) + 1;\
- * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y];\
- * @endcode\
- * - encoding: set by user\
- * - decoding: set by lavc\
- */\
- int16_t (*motion_val[2])[2];\
-\
- /**\
- * Macroblock type table\
- * mb_type_base + mb_width + 2\
- * - encoding: set by user\
- * - decoding: set by lavc\
- */\
- uint32_t *mb_type;\
-\
- /**\
- * log2 of the size of the block which a single vector in motion_val represents: \
- * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2)\
- * - encoding: unused\
- * - decoding: set by lavc\
- */\
- uint8_t motion_subsample_log2;\
-\
- /**\
- * for some private data of the user\
- * - encoding: unused\
- * - decoding: set by user\
- */\
- void *opaque;\
-\
- /**\
- * error\
- * - encoding: set by lavc if flags&CODEC_FLAG_PSNR\
- * - decoding: unused\
- */\
- uint64_t error[4];\
-\
- /**\
- * type of the buffer (to keep track of who has to dealloc data[*])\
- * - encoding: set by the one who allocs it\
- * - decoding: set by the one who allocs it\
- * Note: user allocated (direct rendering) & internal buffers can not coexist currently\
- */\
- int type;\
- \
- /**\
- * when decoding, this signal how much the picture must be delayed.\
- * extra_delay = repeat_pict / (2*fps)\
- * - encoding: unused\
- * - decoding: set by lavc\
- */\
- int repeat_pict;\
- \
- /**\
- * \
- */\
- int qscale_type;\
- \
- /**\
- * The content of the picture is interlaced.\
- * - encoding: set by user\
- * - decoding: set by lavc (default 0)\
- */\
- int interlaced_frame;\
- \
- /**\
- * if the content is interlaced, is top field displayed first.\
- * - encoding: set by user\
- * - decoding: set by lavc\
- */\
- int top_field_first;\
- \
- /**\
- * Pan scan.\
- * - encoding: set by user\
- * - decoding: set by lavc\
- */\
- AVPanScan *pan_scan;\
- \
- /**\
- * tell user application that palette has changed from previous frame.\
- * - encoding: ??? (no palette-enabled encoder yet)\
- * - decoding: set by lavc (default 0)\
- */\
- int palette_has_changed;\
- \
- /**\
- * Codec suggestion on buffer type if != 0\
- * - encoding: unused\
- * - decoding: set by lavc (before get_buffer() call))\
- */\
- int buffer_hints;\
-\
- /**\
- * DCT coeffitients\
- * - encoding: unused\
- * - decoding: set by lavc\
- */\
- short *dct_coeff;\
-\
- /**\
- * Motion referece frame index\
- * - encoding: set by user\
- * - decoding: set by lavc\
- */\
- int8_t *ref_index[2];
-
-#define FF_QSCALE_TYPE_MPEG1 0
-#define FF_QSCALE_TYPE_MPEG2 1
-#define FF_QSCALE_TYPE_H264 2
-
-#define FF_BUFFER_TYPE_INTERNAL 1
-#define FF_BUFFER_TYPE_USER 2 ///< Direct rendering buffers (image is (de)allocated by user)
-#define FF_BUFFER_TYPE_SHARED 4 ///< buffer from somewhere else, don't dealloc image (data/base), all other tables are not shared
-#define FF_BUFFER_TYPE_COPY 8 ///< just a (modified) copy of some other buffer, don't dealloc anything
-
-
-#define FF_I_TYPE 1 // Intra
-#define FF_P_TYPE 2 // Predicted
-#define FF_B_TYPE 3 // Bi-dir predicted
-#define FF_S_TYPE 4 // S(GMC)-VOP MPEG4
-#define FF_SI_TYPE 5
-#define FF_SP_TYPE 6
-
-#define FF_BUFFER_HINTS_VALID 0x01 // Buffer hints value is meaningful (if 0 ignore)
-#define FF_BUFFER_HINTS_READABLE 0x02 // Codec will read from buffer
-#define FF_BUFFER_HINTS_PRESERVE 0x04 // User must not alter buffer content
-#define FF_BUFFER_HINTS_REUSABLE 0x08 // Codec will reuse the buffer (update)
-
-/**
- * Audio Video Frame.
- */
-typedef struct AVFrame {
- FF_COMMON_FRAME
-} AVFrame;
-
-#define DEFAULT_FRAME_RATE_BASE 1001000
-
-/**
- * main external api structure.
- */
-typedef struct AVCodecContext {
- /**
- * Info on struct for av_log
- * - set by avcodec_alloc_context
- */
- AVClass *av_class;
- /**
- * the average bitrate.
- * - encoding: set by user. unused for constant quantizer encoding
- * - decoding: set by lavc. 0 or some bitrate if this info is available in the stream
- */
- int bit_rate;
-
- /**
- * number of bits the bitstream is allowed to diverge from the reference.
- * the reference can be CBR (for CBR pass1) or VBR (for pass2)
- * - encoding: set by user. unused for constant quantizer encoding
- * - decoding: unused
- */
- int bit_rate_tolerance;
-
- /**
- * CODEC_FLAG_*.
- * - encoding: set by user.
- * - decoding: set by user.
- */
- int flags;
-
- /**
- * some codecs needs additionnal format info. It is stored here
- * - encoding: set by user.
- * - decoding: set by lavc. (FIXME is this ok?)
- */
- int sub_id;
-
- /**
- * motion estimation algorithm used for video coding.
- * 1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex),
- * 8 (umh), 9 (iter) [7, 8 are x264 specific, 9 is snow specific]
- * - encoding: MUST be set by user.
- * - decoding: unused
- */
- int me_method;
-
- /**
- * some codecs need / can use extra-data like huffman tables.
- * mjpeg: huffman tables
- * rv10: additional flags
- * mpeg4: global headers (they can be in the bitstream or here)
- * the allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger
- * then extradata_size to avoid prolems if its read with the bitstream reader
- * the bytewise contents of extradata must not depend on the architecture or cpu endianness
- * - encoding: set/allocated/freed by lavc.
- * - decoding: set/allocated/freed by user.
- */
- uint8_t *extradata;
- int extradata_size;
-
- /**
- * this is the fundamental unit of time (in seconds) in terms
- * of which frame timestamps are represented. for fixed-fps content,
- * timebase should be 1/framerate and timestamp increments should be
- * identically 1.
- * - encoding: MUST be set by user
- * - decoding: set by lavc.
- */
- AVRational time_base;
-
- /* video only */
- /**
- * picture width / height.
- * - encoding: MUST be set by user.
- * - decoding: set by lavc.
- * Note, for compatibility its possible to set this instead of
- * coded_width/height before decoding
- */
- int width, height;
-
-#define FF_ASPECT_EXTENDED 15
-
- /**
- * the number of pictures in a group of pitures, or 0 for intra_only.
- * - encoding: set by user.
- * - decoding: unused
- */
- int gop_size;
-
- /**
- * pixel format, see PIX_FMT_xxx.
- * - encoding: set by user.
- * - decoding: set by lavc.
- */
- enum PixelFormat pix_fmt;
-
- /**
- * Frame rate emulation. If not zero lower layer (i.e. format handler)
- * has to read frames at native frame rate.
- * - encoding: set by user.
- * - decoding: unused.
- */
- int rate_emu;
-
- /**
- * if non NULL, 'draw_horiz_band' is called by the libavcodec
- * decoder to draw an horizontal band. It improve cache usage. Not
- * all codecs can do that. You must check the codec capabilities
- * before
- * - encoding: unused
- * - decoding: set by user.
- * @param height the height of the slice
- * @param y the y position of the slice
- * @param type 1->top field, 2->bottom field, 3->frame
- * @param offset offset into the AVFrame.data from which the slice should be read
- */
- void (*draw_horiz_band)(struct AVCodecContext *s,
- const AVFrame *src, int offset[4],
- int y, int type, int height);
-
- /* audio only */
- int sample_rate; ///< samples per sec
- int channels;
-
- /**
- * audio sample format.
- * - encoding: set by user.
- * - decoding: set by lavc.
- */
- enum SampleFormat sample_fmt; ///< sample format, currenly unused
-
- /* the following data should not be initialized */
- /**
- * samples per packet. initialized when calling 'init'
- */
- int frame_size;
- int frame_number; ///< audio or video frame number
- int real_pict_num; ///< returns the real picture number of previous encoded frame
-
- /**
- * number of frames the decoded output will be delayed relative to
- * the encoded input.
- * - encoding: set by lavc.
- * - decoding: unused
- */
- int delay;
-
- /* - encoding parameters */
- float qcompress; ///< amount of qscale change between easy & hard scenes (0.0-1.0)
- float qblur; ///< amount of qscale smoothing over time (0.0-1.0)
-
- /**
- * minimum quantizer.
- * - encoding: set by user.
- * - decoding: unused
- */
- int qmin;
-
- /**
- * maximum quantizer.
- * - encoding: set by user.
- * - decoding: unused
- */
- int qmax;
-
- /**
- * maximum quantizer difference between frames.
- * - encoding: set by user.
- * - decoding: unused
- */
- int max_qdiff;
-
- /**
- * maximum number of b frames between non b frames.
- * note: the output will be delayed by max_b_frames+1 relative to the input
- * - encoding: set by user.
- * - decoding: unused
- */
- int max_b_frames;
-
- /**
- * qscale factor between ip and b frames.
- * - encoding: set by user.
- * - decoding: unused
- */
- float b_quant_factor;
-
- /** obsolete FIXME remove */
- int rc_strategy;
-#define FF_RC_STRATEGY_XVID 1
-
- int b_frame_strategy;
-
- /**
- * hurry up amount.
- * deprecated in favor of skip_idct and skip_frame
- * - encoding: unused
- * - decoding: set by user. 1-> skip b frames, 2-> skip idct/dequant too, 5-> skip everything except header
- */
- int hurry_up;
-
- struct AVCodec *codec;
-
- void *priv_data;
-
- /* unused, FIXME remove*/
- int rtp_mode;
-
- int rtp_payload_size; /* The size of the RTP payload: the coder will */
- /* do it's best to deliver a chunk with size */
- /* below rtp_payload_size, the chunk will start */
- /* with a start code on some codecs like H.263 */
- /* This doesn't take account of any particular */
- /* headers inside the transmited RTP payload */
-
-
- /* The RTP callback: This function is called */
- /* every time the encoder has a packet to send */
- /* Depends on the encoder if the data starts */
- /* with a Start Code (it should) H.263 does. */
- /* mb_nb contains the number of macroblocks */
- /* encoded in the RTP payload */
- void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb);
-
- /* statistics, used for 2-pass encoding */
- int mv_bits;
- int header_bits;
- int i_tex_bits;
- int p_tex_bits;
- int i_count;
- int p_count;
- int skip_count;
- int misc_bits;
-
- /**
- * number of bits used for the previously encoded frame.
- * - encoding: set by lavc
- * - decoding: unused
- */
- int frame_bits;
-
- /**
- * private data of the user, can be used to carry app specific stuff.
- * - encoding: set by user
- * - decoding: set by user
- */
- void *opaque;
-
- char codec_name[32];
- enum CodecType codec_type; /* see CODEC_TYPE_xxx */
- enum CodecID codec_id; /* see CODEC_ID_xxx */
-
- /**
- * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
- * this is used to workaround some encoder bugs
- * - encoding: set by user, if not then the default based on codec_id will be used
- * - decoding: set by user, will be converted to upper case by lavc during init
- */
- unsigned int codec_tag;
-
- /**
- * workaround bugs in encoders which sometimes cannot be detected automatically.
- * - encoding: set by user
- * - decoding: set by user
- */
- int workaround_bugs;
-#define FF_BUG_AUTODETECT 1 ///< autodetection
-#define FF_BUG_OLD_MSMPEG4 2
-#define FF_BUG_XVID_ILACE 4
-#define FF_BUG_UMP4 8
-#define FF_BUG_NO_PADDING 16
-#define FF_BUG_AMV 32
-#define FF_BUG_AC_VLC 0 ///< will be removed, libavcodec can now handle these non compliant files by default
-#define FF_BUG_QPEL_CHROMA 64
-#define FF_BUG_STD_QPEL 128
-#define FF_BUG_QPEL_CHROMA2 256
-#define FF_BUG_DIRECT_BLOCKSIZE 512
-#define FF_BUG_EDGE 1024
-#define FF_BUG_HPEL_CHROMA 2048
-#define FF_BUG_DC_CLIP 4096
-#define FF_BUG_MS 8192 ///< workaround various bugs in microsofts broken decoders
-//#define FF_BUG_FAKE_SCALABILITY 16 //autodetection should work 100%
-
- /**
- * luma single coeff elimination threshold.
- * - encoding: set by user
- * - decoding: unused
- */
- int luma_elim_threshold;
-
- /**
- * chroma single coeff elimination threshold.
- * - encoding: set by user
- * - decoding: unused
- */
- int chroma_elim_threshold;
-
- /**
- * strictly follow the std (MPEG4, ...).
- * - encoding: set by user
- * - decoding: unused
- */
- int strict_std_compliance;
-#define FF_COMPLIANCE_VERY_STRICT 2 ///< strictly conform to a older more strict version of the spec or reference software
-#define FF_COMPLIANCE_STRICT 1 ///< strictly conform to all the things in the spec no matter what consequences
-#define FF_COMPLIANCE_NORMAL 0
-#define FF_COMPLIANCE_INOFFICIAL -1 ///< allow inofficial extensions
-#define FF_COMPLIANCE_EXPERIMENTAL -2 ///< allow non standarized experimental things
-
- /**
- * qscale offset between ip and b frames.
- * if > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset)
- * if < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset)
- * - encoding: set by user.
- * - decoding: unused
- */
- float b_quant_offset;
-
- /**
- * error resilience higher values will detect more errors but may missdetect
- * some more or less valid parts as errors.
- * - encoding: unused
- * - decoding: set by user
- */
- int error_resilience;
-#define FF_ER_CAREFUL 1
-#define FF_ER_COMPLIANT 2
-#define FF_ER_AGGRESSIVE 3
-#define FF_ER_VERY_AGGRESSIVE 4
-
- /**
- * called at the beginning of each frame to get a buffer for it.
- * if pic.reference is set then the frame will be read later by lavc
- * avcodec_align_dimensions() should be used to find the required width and
- * height, as they normally need to be rounded up to the next multiple of 16
- * - encoding: unused
- * - decoding: set by lavc, user can override
- */
- int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic);
-
- /**
- * called to release buffers which where allocated with get_buffer.
- * a released buffer can be reused in get_buffer()
- * pic.data[*] must be set to NULL
- * - encoding: unused
- * - decoding: set by lavc, user can override
- */
- void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic);
-
- /**
- * if 1 the stream has a 1 frame delay during decoding.
- * - encoding: set by lavc
- * - decoding: set by lavc
- */
- int has_b_frames;
-
- /**
- * number of bytes per packet if constant and known or 0
- * used by some WAV based audio codecs
- */
- int block_align;
-
- int parse_only; /* - decoding only: if true, only parsing is done
- (function avcodec_parse_frame()). The frame
- data is returned. Only MPEG codecs support this now. */
-
- /**
- * 0-> h263 quant 1-> mpeg quant.
- * - encoding: set by user.
- * - decoding: unused
- */
- int mpeg_quant;
-
- /**
- * pass1 encoding statistics output buffer.
- * - encoding: set by lavc
- * - decoding: unused
- */
- char *stats_out;
-
- /**
- * pass2 encoding statistics input buffer.
- * concatenated stuff from stats_out of pass1 should be placed here
- * - encoding: allocated/set/freed by user
- * - decoding: unused
- */
- char *stats_in;
-
- /**
- * ratecontrol qmin qmax limiting method.
- * 0-> clipping, 1-> use a nice continous function to limit qscale wthin qmin/qmax
- * - encoding: set by user.
- * - decoding: unused
- */
- float rc_qsquish;
-
- float rc_qmod_amp;
- int rc_qmod_freq;
-
- /**
- * ratecontrol override, see RcOverride.
- * - encoding: allocated/set/freed by user.
- * - decoding: unused
- */
- RcOverride *rc_override;
- int rc_override_count;
-
- /**
- * rate control equation.
- * - encoding: set by user
- * - decoding: unused
- */
- char *rc_eq;
-
- /**
- * maximum bitrate.
- * - encoding: set by user.
- * - decoding: unused
- */
- int rc_max_rate;
-
- /**
- * minimum bitrate.
- * - encoding: set by user.
- * - decoding: unused
- */
- int rc_min_rate;
-
- /**
- * decoder bitstream buffer size.
- * - encoding: set by user.
- * - decoding: unused
- */
- int rc_buffer_size;
- float rc_buffer_aggressivity;
-
- /**
- * qscale factor between p and i frames.
- * if > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset)
- * if < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset)
- * - encoding: set by user.
- * - decoding: unused
- */
- float i_quant_factor;
-
- /**
- * qscale offset between p and i frames.
- * - encoding: set by user.
- * - decoding: unused
- */
- float i_quant_offset;
-
- /**
- * initial complexity for pass1 ratecontrol.
- * - encoding: set by user.
- * - decoding: unused
- */
- float rc_initial_cplx;
-
- /**
- * dct algorithm, see FF_DCT_* below.
- * - encoding: set by user
- * - decoding: unused
- */
- int dct_algo;
-#define FF_DCT_AUTO 0
-#define FF_DCT_FASTINT 1
-#define FF_DCT_INT 2
-#define FF_DCT_MMX 3
-#define FF_DCT_MLIB 4
-#define FF_DCT_ALTIVEC 5
-#define FF_DCT_FAAN 6
-
- /**
- * luminance masking (0-> disabled).
- * - encoding: set by user
- * - decoding: unused
- */
- float lumi_masking;
-
- /**
- * temporary complexity masking (0-> disabled).
- * - encoding: set by user
- * - decoding: unused
- */
- float temporal_cplx_masking;
-
- /**
- * spatial complexity masking (0-> disabled).
- * - encoding: set by user
- * - decoding: unused
- */
- float spatial_cplx_masking;
-
- /**
- * p block masking (0-> disabled).
- * - encoding: set by user
- * - decoding: unused
- */
- float p_masking;
-
- /**
- * darkness masking (0-> disabled).
- * - encoding: set by user
- * - decoding: unused
- */
- float dark_masking;
-
-
- /* for binary compatibility */
- int unused;
-
- /**
- * idct algorithm, see FF_IDCT_* below.
- * - encoding: set by user
- * - decoding: set by user
- */
- int idct_algo;
-#define FF_IDCT_AUTO 0
-#define FF_IDCT_INT 1
-#define FF_IDCT_SIMPLE 2
-#define FF_IDCT_SIMPLEMMX 3
-#define FF_IDCT_LIBMPEG2MMX 4
-#define FF_IDCT_PS2 5
-#define FF_IDCT_MLIB 6
-#define FF_IDCT_ARM 7
-#define FF_IDCT_ALTIVEC 8
-#define FF_IDCT_SH4 9
-#define FF_IDCT_SIMPLEARM 10
-#define FF_IDCT_H264 11
-#define FF_IDCT_VP3 12
-#define FF_IDCT_IPP 13
-#define FF_IDCT_XVIDMMX 14
-#define FF_IDCT_CAVS 15
-#define FF_IDCT_SIMPLEARMV5TE 16
-
- /**
- * slice count.
- * - encoding: set by lavc
- * - decoding: set by user (or 0)
- */
- int slice_count;
- /**
- * slice offsets in the frame in bytes.
- * - encoding: set/allocated by lavc
- * - decoding: set/allocated by user (or NULL)
- */
- int *slice_offset;
-
- /**
- * error concealment flags.
- * - encoding: unused
- * - decoding: set by user
- */
- int error_concealment;
-#define FF_EC_GUESS_MVS 1
-#define FF_EC_DEBLOCK 2
-
- /**
- * dsp_mask could be add used to disable unwanted CPU features
- * CPU features (i.e. MMX, SSE. ...)
- *
- * with FORCE flag you may instead enable given CPU features
- * (Dangerous: usable in case of misdetection, improper usage however will
- * result into program crash)
- */
- unsigned dsp_mask;
-#define FF_MM_FORCE 0x80000000 /* force usage of selected flags (OR) */
- /* lower 16 bits - CPU features */
-#ifdef HAVE_MMX
-#define FF_MM_MMX 0x0001 /* standard MMX */
-#define FF_MM_3DNOW 0x0004 /* AMD 3DNOW */
-#define FF_MM_MMXEXT 0x0002 /* SSE integer functions or AMD MMX ext */
-#define FF_MM_SSE 0x0008 /* SSE functions */
-#define FF_MM_SSE2 0x0010 /* PIV SSE2 functions */
-#define FF_MM_3DNOWEXT 0x0020 /* AMD 3DNowExt */
-#endif /* HAVE_MMX */
-#ifdef HAVE_IWMMXT
-#define FF_MM_IWMMXT 0x0100 /* XScale IWMMXT */
-#endif /* HAVE_IWMMXT */
-
- /**
- * bits per sample/pixel from the demuxer (needed for huffyuv).
- * - encoding: set by lavc
- * - decoding: set by user
- */
- int bits_per_sample;
-
- /**
- * prediction method (needed for huffyuv).
- * - encoding: set by user
- * - decoding: unused
- */
- int prediction_method;
-#define FF_PRED_LEFT 0
-#define FF_PRED_PLANE 1
-#define FF_PRED_MEDIAN 2
-
- /**
- * sample aspect ratio (0 if unknown).
- * numerator and denominator must be relative prime and smaller then 256 for some video standards
- * - encoding: set by user.
- * - decoding: set by lavc.
- */
- AVRational sample_aspect_ratio;
-
- /**
- * the picture in the bitstream.
- * - encoding: set by lavc
- * - decoding: set by lavc
- */
- AVFrame *coded_frame;
-
- /**
- * debug.
- * - encoding: set by user.
- * - decoding: set by user.
- */
- int debug;
-#define FF_DEBUG_PICT_INFO 1
-#define FF_DEBUG_RC 2
-#define FF_DEBUG_BITSTREAM 4
-#define FF_DEBUG_MB_TYPE 8
-#define FF_DEBUG_QP 16
-#define FF_DEBUG_MV 32
-#define FF_DEBUG_DCT_COEFF 0x00000040
-#define FF_DEBUG_SKIP 0x00000080
-#define FF_DEBUG_STARTCODE 0x00000100
-#define FF_DEBUG_PTS 0x00000200
-#define FF_DEBUG_ER 0x00000400
-#define FF_DEBUG_MMCO 0x00000800
-#define FF_DEBUG_BUGS 0x00001000
-#define FF_DEBUG_VIS_QP 0x00002000
-#define FF_DEBUG_VIS_MB_TYPE 0x00004000
-
- /**
- * debug.
- * - encoding: set by user.
- * - decoding: set by user.
- */
- int debug_mv;
-#define FF_DEBUG_VIS_MV_P_FOR 0x00000001 //visualize forward predicted MVs of P frames
-#define FF_DEBUG_VIS_MV_B_FOR 0x00000002 //visualize forward predicted MVs of B frames
-#define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
-
- /**
- * error.
- * - encoding: set by lavc if flags&CODEC_FLAG_PSNR
- * - decoding: unused
- */
- uint64_t error[4];
-
- /**
- * minimum MB quantizer.
- * - encoding: unused
- * - decoding: unused
- */
- int mb_qmin;
-
- /**
- * maximum MB quantizer.
- * - encoding: unused
- * - decoding: unused
- */
- int mb_qmax;
-
- /**
- * motion estimation compare function.
- * - encoding: set by user.
- * - decoding: unused
- */
- int me_cmp;
- /**
- * subpixel motion estimation compare function.
- * - encoding: set by user.
- * - decoding: unused
- */
- int me_sub_cmp;
- /**
- * macroblock compare function (not supported yet).
- * - encoding: set by user.
- * - decoding: unused
- */
- int mb_cmp;
- /**
- * interlaced dct compare function
- * - encoding: set by user.
- * - decoding: unused
- */
- int ildct_cmp;
-#define FF_CMP_SAD 0
-#define FF_CMP_SSE 1
-#define FF_CMP_SATD 2
-#define FF_CMP_DCT 3
-#define FF_CMP_PSNR 4
-#define FF_CMP_BIT 5
-#define FF_CMP_RD 6
-#define FF_CMP_ZERO 7
-#define FF_CMP_VSAD 8
-#define FF_CMP_VSSE 9
-#define FF_CMP_NSSE 10
-#define FF_CMP_W53 11
-#define FF_CMP_W97 12
-#define FF_CMP_DCTMAX 13
-#define FF_CMP_DCT264 14
-#define FF_CMP_CHROMA 256
-
- /**
- * ME diamond size & shape.
- * - encoding: set by user.
- * - decoding: unused
- */
- int dia_size;
-
- /**
- * amount of previous MV predictors (2a+1 x 2a+1 square).
- * - encoding: set by user.
- * - decoding: unused
- */
- int last_predictor_count;
-
- /**
- * pre pass for motion estimation.
- * - encoding: set by user.
- * - decoding: unused
- */
- int pre_me;
-
- /**
- * motion estimation pre pass compare function.
- * - encoding: set by user.
- * - decoding: unused
- */
- int me_pre_cmp;
-
- /**
- * ME pre pass diamond size & shape.
- * - encoding: set by user.
- * - decoding: unused
- */
- int pre_dia_size;
-
- /**
- * subpel ME quality.
- * - encoding: set by user.
- * - decoding: unused
- */
- int me_subpel_quality;
-
- /**
- * callback to negotiate the pixelFormat.
- * @param fmt is the list of formats which are supported by the codec,
- * its terminated by -1 as 0 is a valid format, the formats are ordered by quality
- * the first is allways the native one
- * @return the choosen format
- * - encoding: unused
- * - decoding: set by user, if not set then the native format will always be choosen
- */
- enum PixelFormat (*get_format)(struct AVCodecContext *s, const enum PixelFormat * fmt);
-
- /**
- * DTG active format information (additionnal aspect ratio
- * information only used in DVB MPEG2 transport streams). 0 if
- * not set.
- *
- * - encoding: unused.
- * - decoding: set by decoder
- */
- int dtg_active_format;
-#define FF_DTG_AFD_SAME 8
-#define FF_DTG_AFD_4_3 9
-#define FF_DTG_AFD_16_9 10
-#define FF_DTG_AFD_14_9 11
-#define FF_DTG_AFD_4_3_SP_14_9 13
-#define FF_DTG_AFD_16_9_SP_14_9 14
-#define FF_DTG_AFD_SP_4_3 15
-
- /**
- * Maximum motion estimation search range in subpel units.
- * if 0 then no limit
- *
- * - encoding: set by user.
- * - decoding: unused.
- */
- int me_range;
-
- /**
- * intra quantizer bias.
- * - encoding: set by user.
- * - decoding: unused
- */
- int intra_quant_bias;
-#define FF_DEFAULT_QUANT_BIAS 999999
-
- /**
- * inter quantizer bias.
- * - encoding: set by user.
- * - decoding: unused
- */
- int inter_quant_bias;
-
- /**
- * color table ID.
- * - encoding: unused.
- * - decoding: which clrtable should be used for 8bit RGB images
- * table have to be stored somewhere FIXME
- */
- int color_table_id;
-
- /**
- * internal_buffer count.
- * Don't touch, used by lavc default_get_buffer()
- */
- int internal_buffer_count;
-
- /**
- * internal_buffers.
- * Don't touch, used by lavc default_get_buffer()
- */
- void *internal_buffer;
-
-#define FF_LAMBDA_SHIFT 7
-#define FF_LAMBDA_SCALE (1<<FF_LAMBDA_SHIFT)
-#define FF_QP2LAMBDA 118 ///< factor to convert from H.263 QP to lambda
-#define FF_LAMBDA_MAX (256*128-1)
-
-#define FF_QUALITY_SCALE FF_LAMBDA_SCALE //FIXME maybe remove
- /**
- * global quality for codecs which cannot change it per frame.
- * this should be proportional to MPEG1/2/4 qscale.
- * - encoding: set by user.
- * - decoding: unused
- */
- int global_quality;
-
-#define FF_CODER_TYPE_VLC 0
-#define FF_CODER_TYPE_AC 1
- /**
- * coder type
- * - encoding: set by user.
- * - decoding: unused
- */
- int coder_type;
-
- /**
- * context model
- * - encoding: set by user.
- * - decoding: unused
- */
- int context_model;
-#if 0
- /**
- *
- * - encoding: unused
- * - decoding: set by user.
- */
- uint8_t * (*realloc)(struct AVCodecContext *s, uint8_t *buf, int buf_size);
-#endif
-
- /**
- * slice flags
- * - encoding: unused
- * - decoding: set by user.
- */
- int slice_flags;
-#define SLICE_FLAG_CODED_ORDER 0x0001 ///< draw_horiz_band() is called in coded order instead of display
-#define SLICE_FLAG_ALLOW_FIELD 0x0002 ///< allow draw_horiz_band() with field slices (MPEG2 field pics)
-#define SLICE_FLAG_ALLOW_PLANE 0x0004 ///< allow draw_horiz_band() with 1 component at a time (SVQ1)
-
- /**
- * XVideo Motion Acceleration
- * - encoding: forbidden
- * - decoding: set by decoder
- */
- int xvmc_acceleration;
-
- /**
- * macroblock decision mode
- * - encoding: set by user.
- * - decoding: unused
- */
- int mb_decision;
-#define FF_MB_DECISION_SIMPLE 0 ///< uses mb_cmp
-#define FF_MB_DECISION_BITS 1 ///< chooses the one which needs the fewest bits
-#define FF_MB_DECISION_RD 2 ///< rate distoration
-
- /**
- * custom intra quantization matrix
- * - encoding: set by user, can be NULL
- * - decoding: set by lavc
- */
- uint16_t *intra_matrix;
-
- /**
- * custom inter quantization matrix
- * - encoding: set by user, can be NULL
- * - decoding: set by lavc
- */
- uint16_t *inter_matrix;
-
- /**
- * fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
- * this is used to workaround some encoder bugs
- * - encoding: unused
- * - decoding: set by user, will be converted to upper case by lavc during init
- */
- unsigned int stream_codec_tag;
-
- /**
- * scene change detection threshold.
- * 0 is default, larger means fewer detected scene changes
- * - encoding: set by user.
- * - decoding: unused
- */
- int scenechange_threshold;
-
- /**
- * minimum lagrange multipler
- * - encoding: set by user.
- * - decoding: unused
- */
- int lmin;
-
- /**
- * maximum lagrange multipler
- * - encoding: set by user.
- * - decoding: unused
- */
- int lmax;
-
- /**
- * Palette control structure
- * - encoding: ??? (no palette-enabled encoder yet)
- * - decoding: set by user.
- */
- struct AVPaletteControl *palctrl;
-
- /**
- * noise reduction strength
- * - encoding: set by user.
- * - decoding: unused
- */
- int noise_reduction;
-
- /**
- * called at the beginning of a frame to get cr buffer for it.
- * buffer type (size, hints) must be the same. lavc won't check it.
- * lavc will pass previous buffer in pic, function should return
- * same buffer or new buffer with old frame "painted" into it.
- * if pic.data[0] == NULL must behave like get_buffer().
- * - encoding: unused
- * - decoding: set by lavc, user can override
- */
- int (*reget_buffer)(struct AVCodecContext *c, AVFrame *pic);
-
- /**
- * number of bits which should be loaded into the rc buffer before decoding starts
- * - encoding: set by user.
- * - decoding: unused
- */
- int rc_initial_buffer_occupancy;
-
- /**
- *
- * - encoding: set by user.
- * - decoding: unused
- */
- int inter_threshold;
-
- /**
- * CODEC_FLAG2_*.
- * - encoding: set by user.
- * - decoding: set by user.
- */
- int flags2;
-
- /**
- * simulates errors in the bitstream to test error concealment.
- * - encoding: set by user.
- * - decoding: unused.
- */
- int error_rate;
-
- /**
- * MP3 antialias algorithm, see FF_AA_* below.
- * - encoding: unused
- * - decoding: set by user
- */
- int antialias_algo;
-#define FF_AA_AUTO 0
-#define FF_AA_FASTINT 1 //not implemented yet
-#define FF_AA_INT 2
-#define FF_AA_FLOAT 3
- /**
- * Quantizer noise shaping.
- * - encoding: set by user
- * - decoding: unused
- */
- int quantizer_noise_shaping;
-
- /**
- * Thread count.
- * is used to decide how many independant tasks should be passed to execute()
- * - encoding: set by user
- * - decoding: set by user
- */
- int thread_count;
-
- /**
- * the codec may call this to execute several independant things. it will return only after
- * finishing all tasks, the user may replace this with some multithreaded implementation, the
- * default implementation will execute the parts serially
- * @param count the number of things to execute
- * - encoding: set by lavc, user can override
- * - decoding: set by lavc, user can override
- */
- int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void **arg2, int *ret, int count);
-
- /**
- * Thread opaque.
- * can be used by execute() to store some per AVCodecContext stuff.
- * - encoding: set by execute()
- * - decoding: set by execute()
- */
- void *thread_opaque;
-
- /**
- * Motion estimation threshold. under which no motion estimation is
- * performed, but instead the user specified motion vectors are used
- *
- * - encoding: set by user
- * - decoding: unused
- */
- int me_threshold;
-
- /**
- * Macroblock threshold. under which the user specified macroblock types will be used
- * - encoding: set by user
- * - decoding: unused
- */
- int mb_threshold;
-
- /**
- * precision of the intra dc coefficient - 8.
- * - encoding: set by user
- * - decoding: unused
- */
- int intra_dc_precision;
-
- /**
- * noise vs. sse weight for the nsse comparsion function.
- * - encoding: set by user
- * - decoding: unused
- */
- int nsse_weight;
-
- /**
- * number of macroblock rows at the top which are skipped.
- * - encoding: unused
- * - decoding: set by user
- */
- int skip_top;
-
- /**
- * number of macroblock rows at the bottom which are skipped.
- * - encoding: unused
- * - decoding: set by user
- */
- int skip_bottom;
-
- /**
- * profile
- * - encoding: set by user
- * - decoding: set by lavc
- */
- int profile;
-#define FF_PROFILE_UNKNOWN -99
-
- /**
- * level
- * - encoding: set by user
- * - decoding: set by lavc
- */
- int level;
-#define FF_LEVEL_UNKNOWN -99
-
- /**
- * low resolution decoding. 1-> 1/2 size, 2->1/4 size
- * - encoding: unused
- * - decoding: set by user
- */
- int lowres;
-
- /**
- * bitsream width / height. may be different from width/height if lowres
- * or other things are used
- * - encoding: unused
- * - decoding: set by user before init if known, codec should override / dynamically change if needed
- */
- int coded_width, coded_height;
-
- /**
- * frame skip threshold
- * - encoding: set by user
- * - decoding: unused
- */
- int frame_skip_threshold;
-
- /**
- * frame skip factor
- * - encoding: set by user
- * - decoding: unused
- */
- int frame_skip_factor;
-
- /**
- * frame skip exponent
- * - encoding: set by user
- * - decoding: unused
- */
- int frame_skip_exp;
-
- /**
- * frame skip comparission function
- * - encoding: set by user.
- * - decoding: unused
- */
- int frame_skip_cmp;
-
- /**
- * border processing masking. raises the quantizer for mbs on the borders
- * of the picture.
- * - encoding: set by user
- * - decoding: unused
- */
- float border_masking;
-
- /**
- * minimum MB lagrange multipler.
- * - encoding: set by user.
- * - decoding: unused
- */
- int mb_lmin;
-
- /**
- * maximum MB lagrange multipler.
- * - encoding: set by user.
- * - decoding: unused
- */
- int mb_lmax;
-
- /**
- *
- * - encoding: set by user.
- * - decoding: unused
- */
- int me_penalty_compensation;
-
- /**
- *
- * - encoding: unused
- * - decoding: set by user.
- */
- enum AVDiscard skip_loop_filter;
-
- /**
- *
- * - encoding: unused
- * - decoding: set by user.
- */
- enum AVDiscard skip_idct;
-
- /**
- *
- * - encoding: unused
- * - decoding: set by user.
- */
- enum AVDiscard skip_frame;
-
- /**
- *
- * - encoding: set by user.
- * - decoding: unused
- */
- int bidir_refine;
-
- /**
- *
- * - encoding: set by user.
- * - decoding: unused
- */
- int brd_scale;
-
- /**
- * constant rate factor - quality-based VBR - values ~correspond to qps
- * - encoding: set by user.
- * - decoding: unused
- */
- float crf;
-
- /**
- * constant quantization parameter rate control method
- * - encoding: set by user.
- * - decoding: unused
- */
- int cqp;
-
- /**
- * minimum gop size
- * - encoding: set by user.
- * - decoding: unused
- */
- int keyint_min;
-
- /**
- * number of reference frames
- * - encoding: set by user.
- * - decoding: unused
- */
- int refs;
-
- /**
- * chroma qp offset from luma
- * - encoding: set by user.
- * - decoding: unused
- */
- int chromaoffset;
-
- /**
- * influences how often b-frames are used
- * - encoding: set by user.
- * - decoding: unused
- */
- int bframebias;
-
- /**
- * trellis RD quantization
- * - encoding: set by user.
- * - decoding: unused
- */
- int trellis;
-
- /**
- * reduce fluctuations in qp (before curve compression)
- * - encoding: set by user.
- * - decoding: unused
- */
- float complexityblur;
-
- /**
- * in-loop deblocking filter alphac0 parameter
- * alpha is in the range -6...6
- * - encoding: set by user.
- * - decoding: unused
- */
- int deblockalpha;
-
- /**
- * in-loop deblocking filter beta parameter
- * beta is in the range -6...6
- * - encoding: set by user.
- * - decoding: unused
- */
- int deblockbeta;
-
- /**
- * macroblock subpartition sizes to consider - p8x8, p4x4, b8x8, i8x8, i4x4
- * - encoding: set by user.
- * - decoding: unused
- */
- int partitions;
-#define X264_PART_I4X4 0x001 /* Analyse i4x4 */
-#define X264_PART_I8X8 0x002 /* Analyse i8x8 (requires 8x8 transform) */
-#define X264_PART_P8X8 0x010 /* Analyse p16x8, p8x16 and p8x8 */
-#define X264_PART_P4X4 0x020 /* Analyse p8x4, p4x8, p4x4 */
-#define X264_PART_B8X8 0x100 /* Analyse b16x8, b8x16 and b8x8 */
-
- /**
- * direct mv prediction mode - 0 (none), 1 (spatial), 2 (temporal)
- * - encoding: set by user.
- * - decoding: unused
- */
- int directpred;
-
- /**
- * audio cutoff bandwidth (0 means "automatic") . Currently used only by FAAC
- * - encoding: set by user.
- * - decoding: unused
- */
- int cutoff;
-
- /**
- * multiplied by qscale for each frame and added to scene_change_score
- * - encoding: set by user.
- * - decoding: unused
- */
- int scenechange_factor;
-
- /**
- *
- * note: value depends upon the compare functin used for fullpel ME
- * - encoding: set by user.
- * - decoding: unused
- */
- int mv0_threshold;
-
- /**
- * adjusts sensitivity of b_frame_strategy 1
- * - encoding: set by user.
- * - decoding: unused
- */
- int b_sensitivity;
-
- /**
- * - encoding: set by user.
- * - decoding: unused
- */
- int compression_level;
-#define FF_COMPRESSION_DEFAULT -1
-
- /**
- * sets whether to use LPC mode - used by FLAC encoder
- * - encoding: set by user.
- * - decoding: unused.
- */
- int use_lpc;
-
- /**
- * LPC coefficient precision - used by FLAC encoder
- * - encoding: set by user.
- * - decoding: unused.
- */
- int lpc_coeff_precision;
-
- /**
- * - encoding: set by user.
- * - decoding: unused.
- */
- int min_prediction_order;
-
- /**
- * - encoding: set by user.
- * - decoding: unused.
- */
- int max_prediction_order;
-
- /**
- * search method for selecting prediction order
- * - encoding: set by user.
- * - decoding: unused.
- */
- int prediction_order_method;
-
- /**
- * - encoding: set by user.
- * - decoding: unused.
- */
- int min_partition_order;
-
- /**
- * - encoding: set by user.
- * - decoding: unused.
- */
- int max_partition_order;
-
- /**
- * GOP timecode frame start number, in non drop frame format
- * - encoding: set by user.
- * - decoding: unused.
- */
- int64_t timecode_frame_start;
-} AVCodecContext;
-
-/**
- * AVCodec.
- */
-typedef struct AVCodec {
- const char *name;
- enum CodecType type;
- enum CodecID id;
- int priv_data_size;
- int (*init)(AVCodecContext *);
- int (*encode)(AVCodecContext *, uint8_t *buf, int buf_size, void *data);
- int (*close)(AVCodecContext *);
- int (*decode)(AVCodecContext *, void *outdata, int *outdata_size,
- uint8_t *buf, int buf_size);
- int capabilities;
- struct AVCodec *next;
- void (*flush)(AVCodecContext *);
- const AVRational *supported_framerates; ///array of supported framerates, or NULL if any, array is terminated by {0,0}
- const enum PixelFormat *pix_fmts; ///array of supported pixel formats, or NULL if unknown, array is terminanted by -1
-} AVCodec;
-
-/**
- * four components are given, that's all.
- * the last component is alpha
- */
-typedef struct AVPicture {
- uint8_t *data[4];
- int linesize[4]; ///< number of bytes per line
-} AVPicture;
-
-/**
- * AVPaletteControl
- * This structure defines a method for communicating palette changes
- * between and demuxer and a decoder.
- * this is totally broken, palette changes should be sent as AVPackets
- */
-#define AVPALETTE_SIZE 1024
-#define AVPALETTE_COUNT 256
-typedef struct AVPaletteControl {
-
- /* demuxer sets this to 1 to indicate the palette has changed;
- * decoder resets to 0 */
- int palette_changed;
-
- /* 4-byte ARGB palette entries, stored in native byte order; note that
- * the individual palette components should be on a 8-bit scale; if
- * the palette data comes from a IBM VGA native format, the component
- * data is probably 6 bits in size and needs to be scaled */
- unsigned int palette[AVPALETTE_COUNT];
-
-} AVPaletteControl attribute_deprecated;
-
-typedef struct AVSubtitleRect {
- uint16_t x;
- uint16_t y;
- uint16_t w;
- uint16_t h;
- uint16_t nb_colors;
- int linesize;
- uint32_t *rgba_palette;
- uint8_t *bitmap;
-} AVSubtitleRect;
-
-typedef struct AVSubtitle {
- uint16_t format; /* 0 = graphics */
- uint32_t start_display_time; /* relative to packet pts, in ms */
- uint32_t end_display_time; /* relative to packet pts, in ms */
- uint32_t num_rects;
- AVSubtitleRect *rects;
-} AVSubtitle;
-
-extern AVCodec ac3_encoder;
-extern AVCodec amr_nb_encoder;
-extern AVCodec amr_wb_encoder;
-extern AVCodec asv1_encoder;
-extern AVCodec asv2_encoder;
-extern AVCodec dvvideo_encoder;
-extern AVCodec faac_encoder;
-extern AVCodec ffv1_encoder;
-extern AVCodec ffvhuff_encoder;
-extern AVCodec flac_encoder;
-extern AVCodec flashsv_encoder;
-extern AVCodec flv_encoder;
-extern AVCodec gif_encoder;
-extern AVCodec h261_encoder;
-extern AVCodec h263_encoder;
-extern AVCodec h263p_encoder;
-extern AVCodec h264_encoder;
-extern AVCodec huffyuv_encoder;
-extern AVCodec jpegls_encoder;
-extern AVCodec libgsm_encoder;
-extern AVCodec libtheora_encoder;
-extern AVCodec ljpeg_encoder;
-extern AVCodec mdec_encoder;
-extern AVCodec mjpeg_encoder;
-extern AVCodec mp2_encoder;
-extern AVCodec mp3lame_encoder;
-extern AVCodec mpeg1video_encoder;
-extern AVCodec mpeg2video_encoder;
-extern AVCodec mpeg4_encoder;
-extern AVCodec msmpeg4v1_encoder;
-extern AVCodec msmpeg4v2_encoder;
-extern AVCodec msmpeg4v3_encoder;
-extern AVCodec oggvorbis_encoder;
-extern AVCodec pam_encoder;
-extern AVCodec pbm_encoder;
-extern AVCodec pgm_encoder;
-extern AVCodec pgmyuv_encoder;
-extern AVCodec png_encoder;
-extern AVCodec ppm_encoder;
-extern AVCodec rv10_encoder;
-extern AVCodec rv20_encoder;
-extern AVCodec snow_encoder;
-extern AVCodec sonic_encoder;
-extern AVCodec sonic_ls_encoder;
-extern AVCodec svq1_encoder;
-extern AVCodec vcr1_encoder;
-extern AVCodec vorbis_encoder;
-extern AVCodec wmv1_encoder;
-extern AVCodec wmv2_encoder;
-extern AVCodec x264_encoder;
-extern AVCodec xvid_encoder;
-extern AVCodec zlib_encoder;
-extern AVCodec zmbv_encoder;
-
-extern AVCodec aac_decoder;
-extern AVCodec aasc_decoder;
-extern AVCodec alac_decoder;
-extern AVCodec amr_nb_decoder;
-extern AVCodec amr_wb_decoder;
-extern AVCodec asv1_decoder;
-extern AVCodec asv2_decoder;
-extern AVCodec avs_decoder;
-extern AVCodec bmp_decoder;
-extern AVCodec cavs_decoder;
-extern AVCodec cinepak_decoder;
-extern AVCodec cljr_decoder;
-extern AVCodec cook_decoder;
-extern AVCodec cscd_decoder;
-extern AVCodec cyuv_decoder;
-extern AVCodec dsicinaudio_decoder;
-extern AVCodec dsicinvideo_decoder;
-extern AVCodec dvvideo_decoder;
-extern AVCodec eightbps_decoder;
-extern AVCodec ffv1_decoder;
-extern AVCodec ffvhuff_decoder;
-extern AVCodec flac_decoder;
-extern AVCodec flashsv_decoder;
-extern AVCodec flic_decoder;
-extern AVCodec flv_decoder;
-extern AVCodec fourxm_decoder;
-extern AVCodec fraps_decoder;
-extern AVCodec gif_decoder;
-extern AVCodec h261_decoder;
-extern AVCodec h263_decoder;
-extern AVCodec h263i_decoder;
-extern AVCodec h264_decoder;
-extern AVCodec huffyuv_decoder;
-extern AVCodec idcin_decoder;
-extern AVCodec imc_decoder;
-extern AVCodec indeo2_decoder;
-extern AVCodec indeo3_decoder;
-extern AVCodec interplay_dpcm_decoder;
-extern AVCodec interplay_video_decoder;
-extern AVCodec kmvc_decoder;
-extern AVCodec libgsm_decoder;
-extern AVCodec loco_decoder;
-extern AVCodec mace3_decoder;
-extern AVCodec mace6_decoder;
-extern AVCodec mdec_decoder;
-extern AVCodec mjpeg_decoder;
-extern AVCodec mjpegb_decoder;
-extern AVCodec mmvideo_decoder;
-extern AVCodec mp2_decoder;
-extern AVCodec mp3_decoder;
-extern AVCodec mp3adu_decoder;
-extern AVCodec mp3on4_decoder;
-extern AVCodec mpc7_decoder;
-extern AVCodec mpeg1video_decoder;
-extern AVCodec mpeg2video_decoder;
-extern AVCodec mpeg4_decoder;
-extern AVCodec mpeg4aac_decoder;
-extern AVCodec mpeg_xvmc_decoder;
-extern AVCodec mpegvideo_decoder;
-extern AVCodec msmpeg4v1_decoder;
-extern AVCodec msmpeg4v2_decoder;
-extern AVCodec msmpeg4v3_decoder;
-extern AVCodec msrle_decoder;
-extern AVCodec msvideo1_decoder;
-extern AVCodec mszh_decoder;
-extern AVCodec nuv_decoder;
-extern AVCodec oggvorbis_decoder;
-extern AVCodec png_decoder;
-extern AVCodec qdm2_decoder;
-extern AVCodec qdraw_decoder;
-extern AVCodec qpeg_decoder;
-extern AVCodec qtrle_decoder;
-extern AVCodec ra_144_decoder;
-extern AVCodec ra_288_decoder;
-extern AVCodec roq_decoder;
-extern AVCodec roq_dpcm_decoder;
-extern AVCodec rpza_decoder;
-extern AVCodec rv10_decoder;
-extern AVCodec rv20_decoder;
-extern AVCodec rv30_decoder;
-extern AVCodec rv40_decoder;
-extern AVCodec shorten_decoder;
-extern AVCodec smackaud_decoder;
-extern AVCodec smacker_decoder;
-extern AVCodec smc_decoder;
-extern AVCodec snow_decoder;
-extern AVCodec sol_dpcm_decoder;
-extern AVCodec sonic_decoder;
-extern AVCodec sp5x_decoder;
-extern AVCodec svq1_decoder;
-extern AVCodec svq3_decoder;
-extern AVCodec targa_decoder;
-extern AVCodec theora_decoder;
-extern AVCodec tiertexseqvideo_decoder;
-extern AVCodec tiff_decoder;
-extern AVCodec truemotion1_decoder;
-extern AVCodec truemotion2_decoder;
-extern AVCodec truespeech_decoder;
-extern AVCodec tscc_decoder;
-extern AVCodec tta_decoder;
-extern AVCodec ulti_decoder;
-extern AVCodec vc1_decoder;
-extern AVCodec vcr1_decoder;
-extern AVCodec vmdaudio_decoder;
-extern AVCodec vmdvideo_decoder;
-extern AVCodec vmnc_decoder;
-extern AVCodec vorbis_decoder;
-extern AVCodec vp3_decoder;
-extern AVCodec vp5_decoder;
-extern AVCodec vp6_decoder;
-extern AVCodec vp6f_decoder;
-extern AVCodec vqa_decoder;
-extern AVCodec wavpack_decoder;
-extern AVCodec wmav1_decoder;
-extern AVCodec wmav2_decoder;
-extern AVCodec wmv1_decoder;
-extern AVCodec wmv2_decoder;
-extern AVCodec wmv3_decoder;
-extern AVCodec wnv1_decoder;
-extern AVCodec ws_snd1_decoder;
-extern AVCodec xan_dpcm_decoder;
-extern AVCodec xan_wc3_decoder;
-extern AVCodec xl_decoder;
-extern AVCodec zlib_decoder;
-extern AVCodec zmbv_decoder;
-
-/* pcm codecs */
-#define PCM_CODEC(id, name) \
-extern AVCodec name ## _decoder; \
-extern AVCodec name ## _encoder
-
-PCM_CODEC(CODEC_ID_PCM_ALAW, pcm_alaw);
-PCM_CODEC(CODEC_ID_PCM_MULAW, pcm_mulaw);
-PCM_CODEC(CODEC_ID_PCM_S8, pcm_s8);
-PCM_CODEC(CODEC_ID_PCM_S16BE, pcm_s16be);
-PCM_CODEC(CODEC_ID_PCM_S16LE, pcm_s16le);
-PCM_CODEC(CODEC_ID_PCM_S24BE, pcm_s24be);
-PCM_CODEC(CODEC_ID_PCM_S24DAUD, pcm_s24daud);
-PCM_CODEC(CODEC_ID_PCM_S24LE, pcm_s24le);
-PCM_CODEC(CODEC_ID_PCM_S32BE, pcm_s32be);
-PCM_CODEC(CODEC_ID_PCM_S32LE, pcm_s32le);
-PCM_CODEC(CODEC_ID_PCM_U8, pcm_u8);
-PCM_CODEC(CODEC_ID_PCM_U16BE, pcm_u16be);
-PCM_CODEC(CODEC_ID_PCM_U16LE, pcm_u16le);
-PCM_CODEC(CODEC_ID_PCM_U24BE, pcm_u24be);
-PCM_CODEC(CODEC_ID_PCM_U24LE, pcm_u24le);
-PCM_CODEC(CODEC_ID_PCM_U32BE, pcm_u32be);
-PCM_CODEC(CODEC_ID_PCM_U32LE, pcm_u32le);
-
-/* adpcm codecs */
-
-PCM_CODEC(CODEC_ID_ADPCM_4XM, adpcm_4xm);
-PCM_CODEC(CODEC_ID_ADPCM_ADX, adpcm_adx);
-PCM_CODEC(CODEC_ID_ADPCM_CT, adpcm_ct);
-PCM_CODEC(CODEC_ID_ADPCM_EA, adpcm_ea);
-PCM_CODEC(CODEC_ID_ADPCM_G726, adpcm_g726);
-PCM_CODEC(CODEC_ID_ADPCM_IMA_DK3, adpcm_ima_dk3);
-PCM_CODEC(CODEC_ID_ADPCM_IMA_DK4, adpcm_ima_dk4);
-PCM_CODEC(CODEC_ID_ADPCM_IMA_QT, adpcm_ima_qt);
-PCM_CODEC(CODEC_ID_ADPCM_IMA_WAV, adpcm_ima_wav);
-PCM_CODEC(CODEC_ID_ADPCM_IMA_WS, adpcm_ima_ws);
-PCM_CODEC(CODEC_ID_ADPCM_MS, adpcm_ms);
-PCM_CODEC(CODEC_ID_ADPCM_SBPRO_2, adpcm_sbpro_2);
-PCM_CODEC(CODEC_ID_ADPCM_SBPRO_3, adpcm_sbpro_3);
-PCM_CODEC(CODEC_ID_ADPCM_SBPRO_4, adpcm_sbpro_4);
-PCM_CODEC(CODEC_ID_ADPCM_SMJPEG, adpcm_ima_smjpeg);
-PCM_CODEC(CODEC_ID_ADPCM_SWF, adpcm_swf);
-PCM_CODEC(CODEC_ID_ADPCM_XA, adpcm_xa);
-PCM_CODEC(CODEC_ID_ADPCM_YAMAHA, adpcm_yamaha);
-
-#undef PCM_CODEC
-
-/* dummy raw video codec */
-extern AVCodec rawvideo_decoder;
-extern AVCodec rawvideo_encoder;
-
-/* the following codecs use external GPL libs */
-extern AVCodec ac3_decoder;
-extern AVCodec dts_decoder;
-
-/* subtitles */
-extern AVCodec dvbsub_decoder;
-extern AVCodec dvbsub_encoder;
-extern AVCodec dvdsub_decoder;
-extern AVCodec dvdsub_encoder;
-
-/* resample.c */
-
-struct ReSampleContext;
-struct AVResampleContext;
-
-typedef struct ReSampleContext ReSampleContext;
-
-ReSampleContext *audio_resample_init(int output_channels, int input_channels,
- int output_rate, int input_rate);
-int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples);
-void audio_resample_close(ReSampleContext *s);
-
-struct AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_length, int log2_phase_count, int linear, double cutoff);
-int av_resample(struct AVResampleContext *c, short *dst, short *src, int *consumed, int src_size, int dst_size, int update_ctx);
-void av_resample_compensate(struct AVResampleContext *c, int sample_delta, int compensation_distance);
-void av_resample_close(struct AVResampleContext *c);
-
-/* YUV420 format is assumed ! */
-
-struct ImgReSampleContext;
-
-typedef struct ImgReSampleContext ImgReSampleContext;
-
-ImgReSampleContext *img_resample_init(int output_width, int output_height,
- int input_width, int input_height);
-
-ImgReSampleContext *img_resample_full_init(int owidth, int oheight,
- int iwidth, int iheight,
- int topBand, int bottomBand,
- int leftBand, int rightBand,
- int padtop, int padbottom,
- int padleft, int padright);
-
-
-void img_resample(ImgReSampleContext *s,
- AVPicture *output, const AVPicture *input);
-
-void img_resample_close(ImgReSampleContext *s);
-
-/**
- * Allocate memory for a picture. Call avpicture_free to free it.
- *
- * @param picture the picture to be filled in.
- * @param pix_fmt the format of the picture.
- * @param width the width of the picture.
- * @param height the height of the picture.
- * @return 0 if successful, -1 if not.
- */
-int avpicture_alloc(AVPicture *picture, int pix_fmt, int width, int height);
-
-/* Free a picture previously allocated by avpicture_alloc. */
-void avpicture_free(AVPicture *picture);
-
-int avpicture_fill(AVPicture *picture, uint8_t *ptr,
- int pix_fmt, int width, int height);
-int avpicture_layout(const AVPicture* src, int pix_fmt, int width, int height,
- unsigned char *dest, int dest_size);
-int avpicture_get_size(int pix_fmt, int width, int height);
-void avcodec_get_chroma_sub_sample(int pix_fmt, int *h_shift, int *v_shift);
-const char *avcodec_get_pix_fmt_name(int pix_fmt);
-void avcodec_set_dimensions(AVCodecContext *s, int width, int height);
-enum PixelFormat avcodec_get_pix_fmt(const char* name);
-unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat p);
-
-#define FF_LOSS_RESOLUTION 0x0001 /* loss due to resolution change */
-#define FF_LOSS_DEPTH 0x0002 /* loss due to color depth change */
-#define FF_LOSS_COLORSPACE 0x0004 /* loss due to color space conversion */
-#define FF_LOSS_ALPHA 0x0008 /* loss of alpha bits */
-#define FF_LOSS_COLORQUANT 0x0010 /* loss due to color quantization */
-#define FF_LOSS_CHROMA 0x0020 /* loss of chroma (e.g. rgb to gray conversion) */
-
-int avcodec_get_pix_fmt_loss(int dst_pix_fmt, int src_pix_fmt,
- int has_alpha);
-int avcodec_find_best_pix_fmt(int pix_fmt_mask, int src_pix_fmt,
- int has_alpha, int *loss_ptr);
-
-#define FF_ALPHA_TRANSP 0x0001 /* image has some totally transparent pixels */
-#define FF_ALPHA_SEMI_TRANSP 0x0002 /* image has some transparent pixels */
-int img_get_alpha_info(const AVPicture *src,
- int pix_fmt, int width, int height);
-
-/* convert among pixel formats */
-int img_convert(AVPicture *dst, int dst_pix_fmt,
- const AVPicture *src, int pix_fmt,
- int width, int height);
-
-/* deinterlace a picture */
-int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
- int pix_fmt, int width, int height);
-
-/* external high level API */
-
-extern AVCodec *first_avcodec;
-
-/* returns LIBAVCODEC_VERSION_INT constant */
-unsigned avcodec_version(void);
-/* returns LIBAVCODEC_BUILD constant */
-unsigned avcodec_build(void);
-void avcodec_init(void);
-
-void register_avcodec(AVCodec *format);
-AVCodec *avcodec_find_encoder(enum CodecID id);
-AVCodec *avcodec_find_encoder_by_name(const char *name);
-AVCodec *avcodec_find_decoder(enum CodecID id);
-AVCodec *avcodec_find_decoder_by_name(const char *name);
-void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode);
-
-void avcodec_get_context_defaults(AVCodecContext *s);
-AVCodecContext *avcodec_alloc_context(void);
-void avcodec_get_frame_defaults(AVFrame *pic);
-AVFrame *avcodec_alloc_frame(void);
-
-int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic);
-void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic);
-int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic);
-void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
-int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h);
-enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat * fmt);
-
-int avcodec_thread_init(AVCodecContext *s, int thread_count);
-void avcodec_thread_free(AVCodecContext *s);
-int avcodec_thread_execute(AVCodecContext *s, int (*func)(AVCodecContext *c2, void *arg2),void **arg, int *ret, int count);
-int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void **arg, int *ret, int count);
-//FIXME func typedef
-
-/**
- * opens / inits the AVCodecContext.
- * not thread save!
- */
-int avcodec_open(AVCodecContext *avctx, AVCodec *codec);
-
-
-attribute_deprecated int avcodec_decode_audio(AVCodecContext *avctx, int16_t *samples,
- int *frame_size_ptr,
- uint8_t *buf, int buf_size);
-/**
- * Decode an audio frame.
- *
- * @param avctx the codec context.
- * @param samples output buffer, 16 byte aligned
- * @param frame_size_ptr the output buffer size in bytes (you MUST set this to the allocated size before calling avcodec_decode_audio2()), zero if no frame could be compressed
- * @param buf input buffer, 16 byte aligned
- * @param buf_size the input buffer size
- * @return 0 if successful, -1 if not.
- */
-int avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples,
- int *frame_size_ptr,
- uint8_t *buf, int buf_size);
-int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
- int *got_picture_ptr,
- uint8_t *buf, int buf_size);
-int avcodec_decode_subtitle(AVCodecContext *avctx, AVSubtitle *sub,
- int *got_sub_ptr,
- const uint8_t *buf, int buf_size);
-int avcodec_parse_frame(AVCodecContext *avctx, uint8_t **pdata,
- int *data_size_ptr,
- uint8_t *buf, int buf_size);
-int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size,
- const short *samples);
-int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
- const AVFrame *pict);
-int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
- const AVSubtitle *sub);
-
-int avcodec_close(AVCodecContext *avctx);
-
-void avcodec_register_all(void);
-
-void avcodec_flush_buffers(AVCodecContext *avctx);
-
-void avcodec_default_free_buffers(AVCodecContext *s);
-
-/* misc usefull functions */
-
-/**
- * returns a single letter to describe the picture type
- */
-char av_get_pict_type_char(int pict_type);
-
-/**
- * returns codec bits per sample
- */
-int av_get_bits_per_sample(enum CodecID codec_id);
-
-/* frame parsing */
-typedef struct AVCodecParserContext {
- void *priv_data;
- struct AVCodecParser *parser;
- int64_t frame_offset; /* offset of the current frame */
- int64_t cur_offset; /* current offset
- (incremented by each av_parser_parse()) */
- int64_t last_frame_offset; /* offset of the last frame */
- /* video info */
- int pict_type; /* XXX: put it back in AVCodecContext */
- int repeat_pict; /* XXX: put it back in AVCodecContext */
- int64_t pts; /* pts of the current frame */
- int64_t dts; /* dts of the current frame */
-
- /* private data */
- int64_t last_pts;
- int64_t last_dts;
- int fetch_timestamp;
-
-#define AV_PARSER_PTS_NB 4
- int cur_frame_start_index;
- int64_t cur_frame_offset[AV_PARSER_PTS_NB];
- int64_t cur_frame_pts[AV_PARSER_PTS_NB];
- int64_t cur_frame_dts[AV_PARSER_PTS_NB];
-
- int flags;
-#define PARSER_FLAG_COMPLETE_FRAMES 0x0001
-} AVCodecParserContext;
-
-typedef struct AVCodecParser {
- int codec_ids[5]; /* several codec IDs are permitted */
- int priv_data_size;
- int (*parser_init)(AVCodecParserContext *s);
- int (*parser_parse)(AVCodecParserContext *s,
- AVCodecContext *avctx,
- uint8_t **poutbuf, int *poutbuf_size,
- const uint8_t *buf, int buf_size);
- void (*parser_close)(AVCodecParserContext *s);
- int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size);
- struct AVCodecParser *next;
-} AVCodecParser;
-
-extern AVCodecParser *av_first_parser;
-
-void av_register_codec_parser(AVCodecParser *parser);
-AVCodecParserContext *av_parser_init(int codec_id);
-int av_parser_parse(AVCodecParserContext *s,
- AVCodecContext *avctx,
- uint8_t **poutbuf, int *poutbuf_size,
- const uint8_t *buf, int buf_size,
- int64_t pts, int64_t dts);
-int av_parser_change(AVCodecParserContext *s,
- AVCodecContext *avctx,
- uint8_t **poutbuf, int *poutbuf_size,
- const uint8_t *buf, int buf_size, int keyframe);
-void av_parser_close(AVCodecParserContext *s);
-
-extern AVCodecParser aac_parser;
-extern AVCodecParser ac3_parser;
-extern AVCodecParser cavsvideo_parser;
-extern AVCodecParser dvbsub_parser;
-extern AVCodecParser dvdsub_parser;
-extern AVCodecParser h261_parser;
-extern AVCodecParser h263_parser;
-extern AVCodecParser h264_parser;
-extern AVCodecParser mjpeg_parser;
-extern AVCodecParser mpeg4video_parser;
-extern AVCodecParser mpegaudio_parser;
-extern AVCodecParser mpegvideo_parser;
-extern AVCodecParser pnm_parser;
-
-
-typedef struct AVBitStreamFilterContext {
- void *priv_data;
- struct AVBitStreamFilter *filter;
- AVCodecParserContext *parser;
- struct AVBitStreamFilterContext *next;
-} AVBitStreamFilterContext;
-
-
-typedef struct AVBitStreamFilter {
- const char *name;
- int priv_data_size;
- int (*filter)(AVBitStreamFilterContext *bsfc,
- AVCodecContext *avctx, const char *args,
- uint8_t **poutbuf, int *poutbuf_size,
- const uint8_t *buf, int buf_size, int keyframe);
- struct AVBitStreamFilter *next;
-} AVBitStreamFilter;
-
-extern AVBitStreamFilter *av_first_bitstream_filter;
-
-void av_register_bitstream_filter(AVBitStreamFilter *bsf);
-AVBitStreamFilterContext *av_bitstream_filter_init(const char *name);
-int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc,
- AVCodecContext *avctx, const char *args,
- uint8_t **poutbuf, int *poutbuf_size,
- const uint8_t *buf, int buf_size, int keyframe);
-void av_bitstream_filter_close(AVBitStreamFilterContext *bsf);
-
-extern AVBitStreamFilter dump_extradata_bsf;
-extern AVBitStreamFilter remove_extradata_bsf;
-extern AVBitStreamFilter noise_bsf;
-extern AVBitStreamFilter mp3_header_compress_bsf;
-extern AVBitStreamFilter mp3_header_decompress_bsf;
-extern AVBitStreamFilter mjpega_dump_header_bsf;
-
-
-/* memory */
-void *av_fast_realloc(void *ptr, unsigned int *size, unsigned int min_size);
-/* for static data only */
-/* call av_free_static to release all staticaly allocated tables */
-void av_free_static(void);
-void *av_mallocz_static(unsigned int size);
-void *av_realloc_static(void *ptr, unsigned int size);
-
-void img_copy(AVPicture *dst, const AVPicture *src,
- int pix_fmt, int width, int height);
-
-int img_crop(AVPicture *dst, const AVPicture *src,
- int pix_fmt, int top_band, int left_band);
-
-int img_pad(AVPicture *dst, const AVPicture *src, int height, int width, int pix_fmt,
- int padtop, int padbottom, int padleft, int padright, int *color);
-
-extern unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
-
-/* unused static macro */
-#if defined(__GNUC__) && !defined(DEBUG)
-/* since we do not compile the encoder part of ffmpeg, some static
- * functions will be unused; this is ok, the compiler will take care */
-# define static static __attribute__((__unused__))
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* AVCODEC_H */
diff --git a/src/libffmpeg/libavcodec/avs.c b/src/libffmpeg/libavcodec/avs.c
deleted file mode 100644
index ebfa8adb7..000000000
--- a/src/libffmpeg/libavcodec/avs.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * AVS video decoder.
- * Copyright (c) 2006 Aurelien Jacobs <aurel@gnuage.org>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "bitstream.h"
-
-
-typedef struct {
- AVFrame picture;
-} avs_context_t;
-
-typedef enum {
- AVS_VIDEO = 0x01,
- AVS_AUDIO = 0x02,
- AVS_PALETTE = 0x03,
- AVS_GAME_DATA = 0x04,
-} avs_block_type_t;
-
-typedef enum {
- AVS_I_FRAME = 0x00,
- AVS_P_FRAME_3X3 = 0x01,
- AVS_P_FRAME_2X2 = 0x02,
- AVS_P_FRAME_2X3 = 0x03,
-} avs_video_sub_type_t;
-
-
-static int
-avs_decode_frame(AVCodecContext * avctx,
- void *data, int *data_size, uint8_t * buf, int buf_size)
-{
- avs_context_t *const avs = avctx->priv_data;
- AVFrame *picture = data;
- AVFrame *const p = (AVFrame *) & avs->picture;
- uint8_t *table, *vect, *out;
- int i, j, x, y, stride, vect_w = 3, vect_h = 3;
- int sub_type;
- avs_block_type_t type;
- GetBitContext change_map;
-
- if (avctx->reget_buffer(avctx, p)) {
- av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
- return -1;
- }
- p->reference = 1;
- p->pict_type = FF_P_TYPE;
- p->key_frame = 0;
-
- out = avs->picture.data[0];
- stride = avs->picture.linesize[0];
-
- sub_type = buf[0];
- type = buf[1];
- buf += 4;
-
- if (type == AVS_PALETTE) {
- int first, last;
- uint32_t *pal = (uint32_t *) avs->picture.data[1];
-
- first = AV_RL16(buf);
- last = first + AV_RL16(buf + 2);
- buf += 4;
- for (i=first; i<last; i++, buf+=3)
- pal[i] = (buf[0] << 18) | (buf[1] << 10) | (buf[2] << 2);
-
- sub_type = buf[0];
- type = buf[1];
- buf += 4;
- }
-
- if (type != AVS_VIDEO)
- return -1;
-
- switch (sub_type) {
- case AVS_I_FRAME:
- p->pict_type = FF_I_TYPE;
- p->key_frame = 1;
- case AVS_P_FRAME_3X3:
- vect_w = 3;
- vect_h = 3;
- break;
-
- case AVS_P_FRAME_2X2:
- vect_w = 2;
- vect_h = 2;
- break;
-
- case AVS_P_FRAME_2X3:
- vect_w = 2;
- vect_h = 3;
- break;
-
- default:
- return -1;
- }
-
- table = buf + (256 * vect_w * vect_h);
- if (sub_type != AVS_I_FRAME) {
- int map_size = ((318 / vect_w + 7) / 8) * (198 / vect_h);
- init_get_bits(&change_map, table, map_size);
- table += map_size;
- }
-
- for (y=0; y<198; y+=vect_h) {
- for (x=0; x<318; x+=vect_w) {
- if (sub_type == AVS_I_FRAME || get_bits1(&change_map)) {
- vect = &buf[*table++ * (vect_w * vect_h)];
- for (j=0; j<vect_w; j++) {
- out[(y + 0) * stride + x + j] = vect[(0 * vect_w) + j];
- out[(y + 1) * stride + x + j] = vect[(1 * vect_w) + j];
- if (vect_h == 3)
- out[(y + 2) * stride + x + j] =
- vect[(2 * vect_w) + j];
- }
- }
- }
- if (sub_type != AVS_I_FRAME)
- align_get_bits(&change_map);
- }
-
- *picture = *(AVFrame *) & avs->picture;
- *data_size = sizeof(AVPicture);
-
- return buf_size;
-}
-
-static int avs_decode_init(AVCodecContext * avctx)
-{
- avctx->pix_fmt = PIX_FMT_PAL8;
- return 0;
-}
-
-AVCodec avs_decoder = {
- "avs",
- CODEC_TYPE_VIDEO,
- CODEC_ID_AVS,
- sizeof(avs_context_t),
- avs_decode_init,
- NULL,
- NULL,
- avs_decode_frame,
- CODEC_CAP_DR1,
-};
diff --git a/src/libffmpeg/libavcodec/bitstream.c b/src/libffmpeg/libavcodec/bitstream.c
deleted file mode 100644
index 22d256df5..000000000
--- a/src/libffmpeg/libavcodec/bitstream.c
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- * Common bit i/o utils
- * Copyright (c) 2000, 2001 Fabrice Bellard.
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * alternative bitstream reader & writer by Michael Niedermayer <michaelni@gmx.at>
- */
-
-/**
- * @file bitstream.c
- * bitstream api.
- */
-
-#include "avcodec.h"
-#include "bitstream.h"
-
-void align_put_bits(PutBitContext *s)
-{
-#ifdef ALT_BITSTREAM_WRITER
- put_bits(s,( - s->index) & 7,0);
-#else
- put_bits(s,s->bit_left & 7,0);
-#endif
-}
-
-void ff_put_string(PutBitContext * pbc, char *s, int put_zero)
-{
- while(*s){
- put_bits(pbc, 8, *s);
- s++;
- }
- if(put_zero)
- put_bits(pbc, 8, 0);
-}
-
-/* VLC decoding */
-
-//#define DEBUG_VLC
-
-#define GET_DATA(v, table, i, wrap, size) \
-{\
- const uint8_t *ptr = (const uint8_t *)table + i * wrap;\
- switch(size) {\
- case 1:\
- v = *(const uint8_t *)ptr;\
- break;\
- case 2:\
- v = *(const uint16_t *)ptr;\
- break;\
- default:\
- v = *(const uint32_t *)ptr;\
- break;\
- }\
-}
-
-
-static int alloc_table(VLC *vlc, int size, int use_static)
-{
- int index;
- index = vlc->table_size;
- vlc->table_size += size;
- if (vlc->table_size > vlc->table_allocated) {
- vlc->table_allocated += (1 << vlc->bits);
- if(use_static)
- vlc->table = av_realloc_static(vlc->table,
- sizeof(VLC_TYPE) * 2 * vlc->table_allocated);
- else
- vlc->table = av_realloc(vlc->table,
- sizeof(VLC_TYPE) * 2 * vlc->table_allocated);
- if (!vlc->table)
- return -1;
- }
- return index;
-}
-
-static int build_table(VLC *vlc, int table_nb_bits,
- int nb_codes,
- const void *bits, int bits_wrap, int bits_size,
- const void *codes, int codes_wrap, int codes_size,
- uint32_t code_prefix, int n_prefix, int flags)
-{
- int i, j, k, n, table_size, table_index, nb, n1, index, code_prefix2;
- uint32_t code;
- VLC_TYPE (*table)[2];
-
- table_size = 1 << table_nb_bits;
- table_index = alloc_table(vlc, table_size, flags & INIT_VLC_USE_STATIC);
-#ifdef DEBUG_VLC
- printf("new table index=%d size=%d code_prefix=%x n=%d\n",
- table_index, table_size, code_prefix, n_prefix);
-#endif
- if (table_index < 0)
- return -1;
- table = &vlc->table[table_index];
-
- for(i=0;i<table_size;i++) {
- table[i][1] = 0; //bits
- table[i][0] = -1; //codes
- }
-
- /* first pass: map codes and compute auxillary table sizes */
- for(i=0;i<nb_codes;i++) {
- GET_DATA(n, bits, i, bits_wrap, bits_size);
- GET_DATA(code, codes, i, codes_wrap, codes_size);
- /* we accept tables with holes */
- if (n <= 0)
- continue;
-#if defined(DEBUG_VLC) && 0
- printf("i=%d n=%d code=0x%x\n", i, n, code);
-#endif
- /* if code matches the prefix, it is in the table */
- n -= n_prefix;
- if(flags & INIT_VLC_LE)
- code_prefix2= code & (n_prefix>=32 ? 0xffffffff : (1 << n_prefix)-1);
- else
- code_prefix2= code >> n;
- if (n > 0 && code_prefix2 == code_prefix) {
- if (n <= table_nb_bits) {
- /* no need to add another table */
- j = (code << (table_nb_bits - n)) & (table_size - 1);
- nb = 1 << (table_nb_bits - n);
- for(k=0;k<nb;k++) {
- if(flags & INIT_VLC_LE)
- j = (code >> n_prefix) + (k<<n);
-#ifdef DEBUG_VLC
- av_log(NULL, AV_LOG_DEBUG, "%4x: code=%d n=%d\n",
- j, i, n);
-#endif
- if (table[j][1] /*bits*/ != 0) {
- av_log(NULL, AV_LOG_ERROR, "incorrect codes\n");
- return -1;
- }
- table[j][1] = n; //bits
- table[j][0] = i; //code
- j++;
- }
- } else {
- n -= table_nb_bits;
- j = (code >> ((flags & INIT_VLC_LE) ? n_prefix : n)) & ((1 << table_nb_bits) - 1);
-#ifdef DEBUG_VLC
- printf("%4x: n=%d (subtable)\n",
- j, n);
-#endif
- /* compute table size */
- n1 = -table[j][1]; //bits
- if (n > n1)
- n1 = n;
- table[j][1] = -n1; //bits
- }
- }
- }
-
- /* second pass : fill auxillary tables recursively */
- for(i=0;i<table_size;i++) {
- n = table[i][1]; //bits
- if (n < 0) {
- n = -n;
- if (n > table_nb_bits) {
- n = table_nb_bits;
- table[i][1] = -n; //bits
- }
- index = build_table(vlc, n, nb_codes,
- bits, bits_wrap, bits_size,
- codes, codes_wrap, codes_size,
- (flags & INIT_VLC_LE) ? (code_prefix | (i << n_prefix)) : ((code_prefix << table_nb_bits) | i),
- n_prefix + table_nb_bits, flags);
- if (index < 0)
- return -1;
- /* note: realloc has been done, so reload tables */
- table = &vlc->table[table_index];
- table[i][0] = index; //code
- }
- }
- return table_index;
-}
-
-
-/* Build VLC decoding tables suitable for use with get_vlc().
-
- 'nb_bits' set thee decoding table size (2^nb_bits) entries. The
- bigger it is, the faster is the decoding. But it should not be too
- big to save memory and L1 cache. '9' is a good compromise.
-
- 'nb_codes' : number of vlcs codes
-
- 'bits' : table which gives the size (in bits) of each vlc code.
-
- 'codes' : table which gives the bit pattern of of each vlc code.
-
- 'xxx_wrap' : give the number of bytes between each entry of the
- 'bits' or 'codes' tables.
-
- 'xxx_size' : gives the number of bytes of each entry of the 'bits'
- or 'codes' tables.
-
- 'wrap' and 'size' allows to use any memory configuration and types
- (byte/word/long) to store the 'bits' and 'codes' tables.
-
- 'use_static' should be set to 1 for tables, which should be freed
- with av_free_static(), 0 if free_vlc() will be used.
-*/
-int init_vlc(VLC *vlc, int nb_bits, int nb_codes,
- const void *bits, int bits_wrap, int bits_size,
- const void *codes, int codes_wrap, int codes_size,
- int use_static)
-{
- vlc->bits = nb_bits;
- if(!use_static) {
- vlc->table = NULL;
- vlc->table_allocated = 0;
- vlc->table_size = 0;
- } else {
- /* Static tables are initially always NULL, return
- if vlc->table != NULL to avoid double allocation */
- if(vlc->table)
- return 0;
- }
-
-#ifdef DEBUG_VLC
- printf("build table nb_codes=%d\n", nb_codes);
-#endif
-
- if (build_table(vlc, nb_bits, nb_codes,
- bits, bits_wrap, bits_size,
- codes, codes_wrap, codes_size,
- 0, 0, use_static) < 0) {
- av_free(vlc->table);
- return -1;
- }
- return 0;
-}
-
-
-void free_vlc(VLC *vlc)
-{
- av_free(vlc->table);
-}
-
diff --git a/src/libffmpeg/libavcodec/bitstream.h b/src/libffmpeg/libavcodec/bitstream.h
deleted file mode 100644
index 29e0f441e..000000000
--- a/src/libffmpeg/libavcodec/bitstream.h
+++ /dev/null
@@ -1,956 +0,0 @@
-/*
- * copyright (c) 2004 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file bitstream.h
- * bitstream api header.
- */
-
-#ifndef BITSTREAM_H
-#define BITSTREAM_H
-
-#include "log.h"
-
-#if defined(ALT_BITSTREAM_READER_LE) && !defined(ALT_BITSTREAM_READER)
-#define ALT_BITSTREAM_READER
-#endif
-
-//#define ALT_BITSTREAM_WRITER
-//#define ALIGNED_BITSTREAM_WRITER
-#if !defined(LIBMPEG2_BITSTREAM_READER) && !defined(A32_BITSTREAM_READER) && !defined(ALT_BITSTREAM_READER)
-# ifdef ARCH_ARMV4L
-# define A32_BITSTREAM_READER
-# else
-#define ALT_BITSTREAM_READER
-//#define LIBMPEG2_BITSTREAM_READER
-//#define A32_BITSTREAM_READER
-# endif
-#endif
-#define LIBMPEG2_BITSTREAM_READER_HACK //add BERO
-
-extern const uint8_t ff_reverse[256];
-
-#if defined(ARCH_X86)
-// avoid +32 for shift optimization (gcc should do that ...)
-static inline int32_t NEG_SSR32( int32_t a, int8_t s){
- asm ("sarl %1, %0\n\t"
- : "+r" (a)
- : "ic" ((uint8_t)(-s))
- );
- return a;
-}
-static inline uint32_t NEG_USR32(uint32_t a, int8_t s){
- asm ("shrl %1, %0\n\t"
- : "+r" (a)
- : "ic" ((uint8_t)(-s))
- );
- return a;
-}
-#else
-# define NEG_SSR32(a,s) ((( int32_t)(a))>>(32-(s)))
-# define NEG_USR32(a,s) (((uint32_t)(a))>>(32-(s)))
-#endif
-
-/* bit output */
-
-/* buf and buf_end must be present and used by every alternative writer. */
-typedef struct PutBitContext {
-#ifdef ALT_BITSTREAM_WRITER
- uint8_t *buf, *buf_end;
- int index;
-#else
- uint32_t bit_buf;
- int bit_left;
- uint8_t *buf, *buf_ptr, *buf_end;
-#endif
-} PutBitContext;
-
-static inline void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
-{
- if(buffer_size < 0) {
- buffer_size = 0;
- buffer = NULL;
- }
-
- s->buf = buffer;
- s->buf_end = s->buf + buffer_size;
-#ifdef ALT_BITSTREAM_WRITER
- s->index=0;
- ((uint32_t*)(s->buf))[0]=0;
-// memset(buffer, 0, buffer_size);
-#else
- s->buf_ptr = s->buf;
- s->bit_left=32;
- s->bit_buf=0;
-#endif
-}
-
-/* return the number of bits output */
-static inline int put_bits_count(PutBitContext *s)
-{
-#ifdef ALT_BITSTREAM_WRITER
- return s->index;
-#else
- return (s->buf_ptr - s->buf) * 8 + 32 - s->bit_left;
-#endif
-}
-
-/* pad the end of the output stream with zeros */
-static inline void flush_put_bits(PutBitContext *s)
-{
-#ifdef ALT_BITSTREAM_WRITER
- align_put_bits(s);
-#else
- s->bit_buf<<= s->bit_left;
- while (s->bit_left < 32) {
- /* XXX: should test end of buffer */
- *s->buf_ptr++=s->bit_buf >> 24;
- s->bit_buf<<=8;
- s->bit_left+=8;
- }
- s->bit_left=32;
- s->bit_buf=0;
-#endif
-}
-
-void align_put_bits(PutBitContext *s);
-void ff_put_string(PutBitContext * pbc, char *s, int put_zero);
-
-/* bit input */
-/* buffer, buffer_end and size_in_bits must be present and used by every reader */
-typedef struct GetBitContext {
- const uint8_t *buffer, *buffer_end;
-#ifdef ALT_BITSTREAM_READER
- int index;
-#elif defined LIBMPEG2_BITSTREAM_READER
- uint8_t *buffer_ptr;
- uint32_t cache;
- int bit_count;
-#elif defined A32_BITSTREAM_READER
- uint32_t *buffer_ptr;
- uint32_t cache0;
- uint32_t cache1;
- int bit_count;
-#endif
- int size_in_bits;
-} GetBitContext;
-
-#define VLC_TYPE int16_t
-
-typedef struct VLC {
- int bits;
- VLC_TYPE (*table)[2]; ///< code, bits
- int table_size, table_allocated;
-} VLC;
-
-typedef struct RL_VLC_ELEM {
- int16_t level;
- int8_t len;
- uint8_t run;
-} RL_VLC_ELEM;
-
-#if defined(ARCH_SPARC) || defined(ARCH_ARMV4L) || defined(ARCH_MIPS)
-#define UNALIGNED_STORES_ARE_BAD
-#endif
-
-/* used to avoid missaligned exceptions on some archs (alpha, ...) */
-#if defined(ARCH_X86)
-# define unaligned16(a) (*(const uint16_t*)(a))
-# define unaligned32(a) (*(const uint32_t*)(a))
-# define unaligned64(a) (*(const uint64_t*)(a))
-#else
-# ifdef __GNUC__
-# define unaligned(x) \
-static inline uint##x##_t unaligned##x(const void *v) { \
- struct Unaligned { \
- uint##x##_t i; \
- } __attribute__((packed)); \
- \
- return ((const struct Unaligned *) v)->i; \
-}
-# elif defined(__DECC)
-# define unaligned(x) \
-static inline uint##x##_t unaligned##x(const void *v) { \
- return *(const __unaligned uint##x##_t *) v; \
-}
-# else
-# define unaligned(x) \
-static inline uint##x##_t unaligned##x(const void *v) { \
- return *(const uint##x##_t *) v; \
-}
-# endif
-unaligned(16)
-unaligned(32)
-unaligned(64)
-#undef unaligned
-#endif /* defined(ARCH_X86) */
-
-#ifndef ALT_BITSTREAM_WRITER
-static inline void put_bits(PutBitContext *s, int n, unsigned int value)
-{
- unsigned int bit_buf;
- int bit_left;
-
- // printf("put_bits=%d %x\n", n, value);
- assert(n == 32 || value < (1U << n));
-
- bit_buf = s->bit_buf;
- bit_left = s->bit_left;
-
- // printf("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf);
- /* XXX: optimize */
- if (n < bit_left) {
- bit_buf = (bit_buf<<n) | value;
- bit_left-=n;
- } else {
- bit_buf<<=bit_left;
- bit_buf |= value >> (n - bit_left);
-#ifdef UNALIGNED_STORES_ARE_BAD
- if (3 & (intptr_t) s->buf_ptr) {
- s->buf_ptr[0] = bit_buf >> 24;
- s->buf_ptr[1] = bit_buf >> 16;
- s->buf_ptr[2] = bit_buf >> 8;
- s->buf_ptr[3] = bit_buf ;
- } else
-#endif
- *(uint32_t *)s->buf_ptr = be2me_32(bit_buf);
- //printf("bitbuf = %08x\n", bit_buf);
- s->buf_ptr+=4;
- bit_left+=32 - n;
- bit_buf = value;
- }
-
- s->bit_buf = bit_buf;
- s->bit_left = bit_left;
-}
-#endif
-
-
-#ifdef ALT_BITSTREAM_WRITER
-static inline void put_bits(PutBitContext *s, int n, unsigned int value)
-{
-# ifdef ALIGNED_BITSTREAM_WRITER
-# if defined(ARCH_X86)
- asm volatile(
- "movl %0, %%ecx \n\t"
- "xorl %%eax, %%eax \n\t"
- "shrdl %%cl, %1, %%eax \n\t"
- "shrl %%cl, %1 \n\t"
- "movl %0, %%ecx \n\t"
- "shrl $3, %%ecx \n\t"
- "andl $0xFFFFFFFC, %%ecx \n\t"
- "bswapl %1 \n\t"
- "orl %1, (%2, %%ecx) \n\t"
- "bswapl %%eax \n\t"
- "addl %3, %0 \n\t"
- "movl %%eax, 4(%2, %%ecx) \n\t"
- : "=&r" (s->index), "=&r" (value)
- : "r" (s->buf), "r" (n), "0" (s->index), "1" (value<<(-n))
- : "%eax", "%ecx"
- );
-# else
- int index= s->index;
- uint32_t *ptr= ((uint32_t *)s->buf)+(index>>5);
-
- value<<= 32-n;
-
- ptr[0] |= be2me_32(value>>(index&31));
- ptr[1] = be2me_32(value<<(32-(index&31)));
-//if(n>24) printf("%d %d\n", n, value);
- index+= n;
- s->index= index;
-# endif
-# else //ALIGNED_BITSTREAM_WRITER
-# if defined(ARCH_X86)
- asm volatile(
- "movl $7, %%ecx \n\t"
- "andl %0, %%ecx \n\t"
- "addl %3, %%ecx \n\t"
- "negl %%ecx \n\t"
- "shll %%cl, %1 \n\t"
- "bswapl %1 \n\t"
- "movl %0, %%ecx \n\t"
- "shrl $3, %%ecx \n\t"
- "orl %1, (%%ecx, %2) \n\t"
- "addl %3, %0 \n\t"
- "movl $0, 4(%%ecx, %2) \n\t"
- : "=&r" (s->index), "=&r" (value)
- : "r" (s->buf), "r" (n), "0" (s->index), "1" (value)
- : "%ecx"
- );
-# else
- int index= s->index;
- uint32_t *ptr= (uint32_t*)(((uint8_t *)s->buf)+(index>>3));
-
- ptr[0] |= be2me_32(value<<(32-n-(index&7) ));
- ptr[1] = 0;
-//if(n>24) printf("%d %d\n", n, value);
- index+= n;
- s->index= index;
-# endif
-# endif //!ALIGNED_BITSTREAM_WRITER
-}
-#endif
-
-
-static inline uint8_t* pbBufPtr(PutBitContext *s)
-{
-#ifdef ALT_BITSTREAM_WRITER
- return s->buf + (s->index>>3);
-#else
- return s->buf_ptr;
-#endif
-}
-
-/**
- *
- * PutBitContext must be flushed & aligned to a byte boundary before calling this.
- */
-static inline void skip_put_bytes(PutBitContext *s, int n){
- assert((put_bits_count(s)&7)==0);
-#ifdef ALT_BITSTREAM_WRITER
- FIXME may need some cleaning of the buffer
- s->index += n<<3;
-#else
- assert(s->bit_left==32);
- s->buf_ptr += n;
-#endif
-}
-
-/**
- * skips the given number of bits.
- * must only be used if the actual values in the bitstream dont matter
- */
-static inline void skip_put_bits(PutBitContext *s, int n){
-#ifdef ALT_BITSTREAM_WRITER
- s->index += n;
-#else
- s->bit_left -= n;
- s->buf_ptr-= s->bit_left>>5;
- s->bit_left &= 31;
-#endif
-}
-
-/**
- * Changes the end of the buffer.
- */
-static inline void set_put_bits_buffer_size(PutBitContext *s, int size){
- s->buf_end= s->buf + size;
-}
-
-/* Bitstream reader API docs:
-name
- abritary name which is used as prefix for the internal variables
-
-gb
- getbitcontext
-
-OPEN_READER(name, gb)
- loads gb into local variables
-
-CLOSE_READER(name, gb)
- stores local vars in gb
-
-UPDATE_CACHE(name, gb)
- refills the internal cache from the bitstream
- after this call at least MIN_CACHE_BITS will be available,
-
-GET_CACHE(name, gb)
- will output the contents of the internal cache, next bit is MSB of 32 or 64 bit (FIXME 64bit)
-
-SHOW_UBITS(name, gb, num)
- will return the next num bits
-
-SHOW_SBITS(name, gb, num)
- will return the next num bits and do sign extension
-
-SKIP_BITS(name, gb, num)
- will skip over the next num bits
- note, this is equivalent to SKIP_CACHE; SKIP_COUNTER
-
-SKIP_CACHE(name, gb, num)
- will remove the next num bits from the cache (note SKIP_COUNTER MUST be called before UPDATE_CACHE / CLOSE_READER)
-
-SKIP_COUNTER(name, gb, num)
- will increment the internal bit counter (see SKIP_CACHE & SKIP_BITS)
-
-LAST_SKIP_CACHE(name, gb, num)
- will remove the next num bits from the cache if it is needed for UPDATE_CACHE otherwise it will do nothing
-
-LAST_SKIP_BITS(name, gb, num)
- is equivalent to SKIP_LAST_CACHE; SKIP_COUNTER
-
-for examples see get_bits, show_bits, skip_bits, get_vlc
-*/
-
-static inline int unaligned32_be(const void *v)
-{
-#ifdef CONFIG_ALIGN
- const uint8_t *p=v;
- return (((p[0]<<8) | p[1])<<16) | (p[2]<<8) | (p[3]);
-#else
- return be2me_32( unaligned32(v)); //original
-#endif
-}
-
-static inline int unaligned32_le(const void *v)
-{
-#ifdef CONFIG_ALIGN
- const uint8_t *p=v;
- return (((p[3]<<8) | p[2])<<16) | (p[1]<<8) | (p[0]);
-#else
- return le2me_32( unaligned32(v)); //original
-#endif
-}
-
-#ifdef ALT_BITSTREAM_READER
-# define MIN_CACHE_BITS 25
-
-# define OPEN_READER(name, gb)\
- int name##_index= (gb)->index;\
- int name##_cache= 0;\
-
-# define CLOSE_READER(name, gb)\
- (gb)->index= name##_index;\
-
-# ifdef ALT_BITSTREAM_READER_LE
-# define UPDATE_CACHE(name, gb)\
- name##_cache= unaligned32_le( ((const uint8_t *)(gb)->buffer)+(name##_index>>3) ) >> (name##_index&0x07);\
-
-# define SKIP_CACHE(name, gb, num)\
- name##_cache >>= (num);
-# else
-# define UPDATE_CACHE(name, gb)\
- name##_cache= unaligned32_be( ((const uint8_t *)(gb)->buffer)+(name##_index>>3) ) << (name##_index&0x07);\
-
-# define SKIP_CACHE(name, gb, num)\
- name##_cache <<= (num);
-# endif
-
-// FIXME name?
-# define SKIP_COUNTER(name, gb, num)\
- name##_index += (num);\
-
-# define SKIP_BITS(name, gb, num)\
- {\
- SKIP_CACHE(name, gb, num)\
- SKIP_COUNTER(name, gb, num)\
- }\
-
-# define LAST_SKIP_BITS(name, gb, num) SKIP_COUNTER(name, gb, num)
-# define LAST_SKIP_CACHE(name, gb, num) ;
-
-# ifdef ALT_BITSTREAM_READER_LE
-# define SHOW_UBITS(name, gb, num)\
- ((name##_cache) & (NEG_USR32(0xffffffff,num)))
-
-# define SHOW_SBITS(name, gb, num)\
- NEG_SSR32((name##_cache)<<(32-(num)), num)
-# else
-# define SHOW_UBITS(name, gb, num)\
- NEG_USR32(name##_cache, num)
-
-# define SHOW_SBITS(name, gb, num)\
- NEG_SSR32(name##_cache, num)
-# endif
-
-# define GET_CACHE(name, gb)\
- ((uint32_t)name##_cache)
-
-static inline int get_bits_count(GetBitContext *s){
- return s->index;
-}
-
-static inline void skip_bits_long(GetBitContext *s, int n){
- s->index += n;
-}
-
-#elif defined LIBMPEG2_BITSTREAM_READER
-//libmpeg2 like reader
-
-# define MIN_CACHE_BITS 17
-
-# define OPEN_READER(name, gb)\
- int name##_bit_count=(gb)->bit_count;\
- int name##_cache= (gb)->cache;\
- uint8_t * name##_buffer_ptr=(gb)->buffer_ptr;\
-
-# define CLOSE_READER(name, gb)\
- (gb)->bit_count= name##_bit_count;\
- (gb)->cache= name##_cache;\
- (gb)->buffer_ptr= name##_buffer_ptr;\
-
-#ifdef LIBMPEG2_BITSTREAM_READER_HACK
-
-# define UPDATE_CACHE(name, gb)\
- if(name##_bit_count >= 0){\
- name##_cache+= (int)be2me_16(*(uint16_t*)name##_buffer_ptr) << name##_bit_count;\
- name##_buffer_ptr += 2;\
- name##_bit_count-= 16;\
- }\
-
-#else
-
-# define UPDATE_CACHE(name, gb)\
- if(name##_bit_count >= 0){\
- name##_cache+= ((name##_buffer_ptr[0]<<8) + name##_buffer_ptr[1]) << name##_bit_count;\
- name##_buffer_ptr+=2;\
- name##_bit_count-= 16;\
- }\
-
-#endif
-
-# define SKIP_CACHE(name, gb, num)\
- name##_cache <<= (num);\
-
-# define SKIP_COUNTER(name, gb, num)\
- name##_bit_count += (num);\
-
-# define SKIP_BITS(name, gb, num)\
- {\
- SKIP_CACHE(name, gb, num)\
- SKIP_COUNTER(name, gb, num)\
- }\
-
-# define LAST_SKIP_BITS(name, gb, num) SKIP_BITS(name, gb, num)
-# define LAST_SKIP_CACHE(name, gb, num) SKIP_CACHE(name, gb, num)
-
-# define SHOW_UBITS(name, gb, num)\
- NEG_USR32(name##_cache, num)
-
-# define SHOW_SBITS(name, gb, num)\
- NEG_SSR32(name##_cache, num)
-
-# define GET_CACHE(name, gb)\
- ((uint32_t)name##_cache)
-
-static inline int get_bits_count(GetBitContext *s){
- return (s->buffer_ptr - s->buffer)*8 - 16 + s->bit_count;
-}
-
-static inline void skip_bits_long(GetBitContext *s, int n){
- OPEN_READER(re, s)
- re_bit_count += n;
- re_buffer_ptr += 2*(re_bit_count>>4);
- re_bit_count &= 15;
- re_cache = ((re_buffer_ptr[-2]<<8) + re_buffer_ptr[-1]) << (16+re_bit_count);
- UPDATE_CACHE(re, s)
- CLOSE_READER(re, s)
-}
-
-#elif defined A32_BITSTREAM_READER
-
-# define MIN_CACHE_BITS 32
-
-# define OPEN_READER(name, gb)\
- int name##_bit_count=(gb)->bit_count;\
- uint32_t name##_cache0= (gb)->cache0;\
- uint32_t name##_cache1= (gb)->cache1;\
- uint32_t * name##_buffer_ptr=(gb)->buffer_ptr;\
-
-# define CLOSE_READER(name, gb)\
- (gb)->bit_count= name##_bit_count;\
- (gb)->cache0= name##_cache0;\
- (gb)->cache1= name##_cache1;\
- (gb)->buffer_ptr= name##_buffer_ptr;\
-
-# define UPDATE_CACHE(name, gb)\
- if(name##_bit_count > 0){\
- const uint32_t next= be2me_32( *name##_buffer_ptr );\
- name##_cache0 |= NEG_USR32(next,name##_bit_count);\
- name##_cache1 |= next<<name##_bit_count;\
- name##_buffer_ptr++;\
- name##_bit_count-= 32;\
- }\
-
-#if defined(ARCH_X86)
-# define SKIP_CACHE(name, gb, num)\
- asm(\
- "shldl %2, %1, %0 \n\t"\
- "shll %2, %1 \n\t"\
- : "+r" (name##_cache0), "+r" (name##_cache1)\
- : "Ic" ((uint8_t)(num))\
- );
-#else
-# define SKIP_CACHE(name, gb, num)\
- name##_cache0 <<= (num);\
- name##_cache0 |= NEG_USR32(name##_cache1,num);\
- name##_cache1 <<= (num);
-#endif
-
-# define SKIP_COUNTER(name, gb, num)\
- name##_bit_count += (num);\
-
-# define SKIP_BITS(name, gb, num)\
- {\
- SKIP_CACHE(name, gb, num)\
- SKIP_COUNTER(name, gb, num)\
- }\
-
-# define LAST_SKIP_BITS(name, gb, num) SKIP_BITS(name, gb, num)
-# define LAST_SKIP_CACHE(name, gb, num) SKIP_CACHE(name, gb, num)
-
-# define SHOW_UBITS(name, gb, num)\
- NEG_USR32(name##_cache0, num)
-
-# define SHOW_SBITS(name, gb, num)\
- NEG_SSR32(name##_cache0, num)
-
-# define GET_CACHE(name, gb)\
- (name##_cache0)
-
-static inline int get_bits_count(GetBitContext *s){
- return ((uint8_t*)s->buffer_ptr - s->buffer)*8 - 32 + s->bit_count;
-}
-
-static inline void skip_bits_long(GetBitContext *s, int n){
- OPEN_READER(re, s)
- re_bit_count += n;
- re_buffer_ptr += re_bit_count>>5;
- re_bit_count &= 31;
- re_cache0 = be2me_32( re_buffer_ptr[-1] ) << re_bit_count;
- re_cache1 = 0;
- UPDATE_CACHE(re, s)
- CLOSE_READER(re, s)
-}
-
-#endif
-
-/**
- * read mpeg1 dc style vlc (sign bit + mantisse with no MSB).
- * if MSB not set it is negative
- * @param n length in bits
- * @author BERO
- */
-static inline int get_xbits(GetBitContext *s, int n){
- register int sign;
- register int32_t cache;
- OPEN_READER(re, s)
- UPDATE_CACHE(re, s)
- cache = GET_CACHE(re,s);
- sign=(~cache)>>31;
- LAST_SKIP_BITS(re, s, n)
- CLOSE_READER(re, s)
- return (NEG_USR32(sign ^ cache, n) ^ sign) - sign;
-}
-
-static inline int get_sbits(GetBitContext *s, int n){
- register int tmp;
- OPEN_READER(re, s)
- UPDATE_CACHE(re, s)
- tmp= SHOW_SBITS(re, s, n);
- LAST_SKIP_BITS(re, s, n)
- CLOSE_READER(re, s)
- return tmp;
-}
-
-/**
- * reads 0-17 bits.
- * Note, the alt bitstream reader can read up to 25 bits, but the libmpeg2 reader can't
- */
-static inline unsigned int get_bits(GetBitContext *s, int n){
- register int tmp;
- OPEN_READER(re, s)
- UPDATE_CACHE(re, s)
- tmp= SHOW_UBITS(re, s, n);
- LAST_SKIP_BITS(re, s, n)
- CLOSE_READER(re, s)
- return tmp;
-}
-
-/**
- * shows 0-17 bits.
- * Note, the alt bitstream reader can read up to 25 bits, but the libmpeg2 reader can't
- */
-static inline unsigned int show_bits(GetBitContext *s, int n){
- register int tmp;
- OPEN_READER(re, s)
- UPDATE_CACHE(re, s)
- tmp= SHOW_UBITS(re, s, n);
-// CLOSE_READER(re, s)
- return tmp;
-}
-
-static inline void skip_bits(GetBitContext *s, int n){
- //Note gcc seems to optimize this to s->index+=n for the ALT_READER :))
- OPEN_READER(re, s)
- UPDATE_CACHE(re, s)
- LAST_SKIP_BITS(re, s, n)
- CLOSE_READER(re, s)
-}
-
-static inline unsigned int get_bits1(GetBitContext *s){
-#ifdef ALT_BITSTREAM_READER
- int index= s->index;
- uint8_t result= s->buffer[ index>>3 ];
-#ifdef ALT_BITSTREAM_READER_LE
- result>>= (index&0x07);
- result&= 1;
-#else
- result<<= (index&0x07);
- result>>= 8 - 1;
-#endif
- index++;
- s->index= index;
-
- return result;
-#else
- return get_bits(s, 1);
-#endif
-}
-
-static inline unsigned int show_bits1(GetBitContext *s){
- return show_bits(s, 1);
-}
-
-static inline void skip_bits1(GetBitContext *s){
- skip_bits(s, 1);
-}
-
-/**
- * reads 0-32 bits.
- */
-static inline unsigned int get_bits_long(GetBitContext *s, int n){
- if(n<=17) return get_bits(s, n);
- else{
-#ifdef ALT_BITSTREAM_READER_LE
- int ret= get_bits(s, 16);
- return ret | (get_bits(s, n-16) << 16);
-#else
- int ret= get_bits(s, 16) << (n-16);
- return ret | get_bits(s, n-16);
-#endif
- }
-}
-
-/**
- * shows 0-32 bits.
- */
-static inline unsigned int show_bits_long(GetBitContext *s, int n){
- if(n<=17) return show_bits(s, n);
- else{
- GetBitContext gb= *s;
- int ret= get_bits_long(s, n);
- *s= gb;
- return ret;
- }
-}
-
-static inline int check_marker(GetBitContext *s, const char *msg)
-{
- int bit= get_bits1(s);
- if(!bit)
- av_log(NULL, AV_LOG_INFO, "Marker bit missing %s\n", msg);
-
- return bit;
-}
-
-/**
- * init GetBitContext.
- * @param buffer bitstream buffer, must be FF_INPUT_BUFFER_PADDING_SIZE bytes larger then the actual read bits
- * because some optimized bitstream readers read 32 or 64 bit at once and could read over the end
- * @param bit_size the size of the buffer in bits
- */
-static inline void init_get_bits(GetBitContext *s,
- const uint8_t *buffer, int bit_size)
-{
- int buffer_size= (bit_size+7)>>3;
- if(buffer_size < 0 || bit_size < 0) {
- buffer_size = bit_size = 0;
- buffer = NULL;
- }
-
- s->buffer= buffer;
- s->size_in_bits= bit_size;
- s->buffer_end= buffer + buffer_size;
-#ifdef ALT_BITSTREAM_READER
- s->index=0;
-#elif defined LIBMPEG2_BITSTREAM_READER
- s->buffer_ptr = (uint8_t*)((intptr_t)buffer&(~1));
- s->bit_count = 16 + 8*((intptr_t)buffer&1);
- skip_bits_long(s, 0);
-#elif defined A32_BITSTREAM_READER
- s->buffer_ptr = (uint32_t*)((intptr_t)buffer&(~3));
- s->bit_count = 32 + 8*((intptr_t)buffer&3);
- skip_bits_long(s, 0);
-#endif
-}
-
-static inline void align_get_bits(GetBitContext *s)
-{
- int n= (-get_bits_count(s)) & 7;
- if(n) skip_bits(s, n);
-}
-
-int init_vlc(VLC *vlc, int nb_bits, int nb_codes,
- const void *bits, int bits_wrap, int bits_size,
- const void *codes, int codes_wrap, int codes_size,
- int flags);
-#define INIT_VLC_USE_STATIC 1
-#define INIT_VLC_LE 2
-void free_vlc(VLC *vlc);
-
-/**
- *
- * if the vlc code is invalid and max_depth=1 than no bits will be removed
- * if the vlc code is invalid and max_depth>1 than the number of bits removed
- * is undefined
- */
-#define GET_VLC(code, name, gb, table, bits, max_depth)\
-{\
- int n, index, nb_bits;\
-\
- index= SHOW_UBITS(name, gb, bits);\
- code = table[index][0];\
- n = table[index][1];\
-\
- if(max_depth > 1 && n < 0){\
- LAST_SKIP_BITS(name, gb, bits)\
- UPDATE_CACHE(name, gb)\
-\
- nb_bits = -n;\
-\
- index= SHOW_UBITS(name, gb, nb_bits) + code;\
- code = table[index][0];\
- n = table[index][1];\
- if(max_depth > 2 && n < 0){\
- LAST_SKIP_BITS(name, gb, nb_bits)\
- UPDATE_CACHE(name, gb)\
-\
- nb_bits = -n;\
-\
- index= SHOW_UBITS(name, gb, nb_bits) + code;\
- code = table[index][0];\
- n = table[index][1];\
- }\
- }\
- SKIP_BITS(name, gb, n)\
-}
-
-#define GET_RL_VLC(level, run, name, gb, table, bits, max_depth, need_update)\
-{\
- int n, index, nb_bits;\
-\
- index= SHOW_UBITS(name, gb, bits);\
- level = table[index].level;\
- n = table[index].len;\
-\
- if(max_depth > 1 && n < 0){\
- SKIP_BITS(name, gb, bits)\
- if(need_update){\
- UPDATE_CACHE(name, gb)\
- }\
-\
- nb_bits = -n;\
-\
- index= SHOW_UBITS(name, gb, nb_bits) + level;\
- level = table[index].level;\
- n = table[index].len;\
- }\
- run= table[index].run;\
- SKIP_BITS(name, gb, n)\
-}
-
-
-/**
- * parses a vlc code, faster then get_vlc()
- * @param bits is the number of bits which will be read at once, must be
- * identical to nb_bits in init_vlc()
- * @param max_depth is the number of times bits bits must be readed to completly
- * read the longest vlc code
- * = (max_vlc_length + bits - 1) / bits
- */
-static av_always_inline int get_vlc2(GetBitContext *s, VLC_TYPE (*table)[2],
- int bits, int max_depth)
-{
- int code;
-
- OPEN_READER(re, s)
- UPDATE_CACHE(re, s)
-
- GET_VLC(code, re, s, table, bits, max_depth)
-
- CLOSE_READER(re, s)
- return code;
-}
-
-//#define TRACE
-
-#ifdef TRACE
-static inline void print_bin(int bits, int n){
- int i;
-
- for(i=n-1; i>=0; i--){
- av_log(NULL, AV_LOG_DEBUG, "%d", (bits>>i)&1);
- }
- for(i=n; i<24; i++)
- av_log(NULL, AV_LOG_DEBUG, " ");
-}
-
-static inline int get_bits_trace(GetBitContext *s, int n, char *file, const char *func, int line){
- int r= get_bits(s, n);
-
- print_bin(r, n);
- av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d bit @%5d in %s %s:%d\n", r, n, r, get_bits_count(s)-n, file, func, line);
- return r;
-}
-static inline int get_vlc_trace(GetBitContext *s, VLC_TYPE (*table)[2], int bits, int max_depth, char *file, const char *func, int line){
- int show= show_bits(s, 24);
- int pos= get_bits_count(s);
- int r= get_vlc2(s, table, bits, max_depth);
- int len= get_bits_count(s) - pos;
- int bits2= show>>(24-len);
-
- print_bin(bits2, len);
-
- av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d vlc @%5d in %s %s:%d\n", bits2, len, r, pos, file, func, line);
- return r;
-}
-static inline int get_xbits_trace(GetBitContext *s, int n, char *file, const char *func, int line){
- int show= show_bits(s, n);
- int r= get_xbits(s, n);
-
- print_bin(show, n);
- av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d xbt @%5d in %s %s:%d\n", show, n, r, get_bits_count(s)-n, file, func, line);
- return r;
-}
-
-#define get_bits(s, n) get_bits_trace(s, n, __FILE__, __PRETTY_FUNCTION__, __LINE__)
-#define get_bits1(s) get_bits_trace(s, 1, __FILE__, __PRETTY_FUNCTION__, __LINE__)
-#define get_xbits(s, n) get_xbits_trace(s, n, __FILE__, __PRETTY_FUNCTION__, __LINE__)
-#define get_vlc(s, vlc) get_vlc_trace(s, (vlc)->table, (vlc)->bits, 3, __FILE__, __PRETTY_FUNCTION__, __LINE__)
-#define get_vlc2(s, tab, bits, max) get_vlc_trace(s, tab, bits, max, __FILE__, __PRETTY_FUNCTION__, __LINE__)
-
-#define tprintf(...) av_log(NULL, AV_LOG_DEBUG, __VA_ARGS__)
-
-#else //TRACE
-#define tprintf(...) {}
-#endif
-
-static inline int decode012(GetBitContext *gb){
- int n;
- n = get_bits1(gb);
- if (n == 0)
- return 0;
- else
- return get_bits1(gb) + 1;
-}
-
-#endif /* BITSTREAM_H */
diff --git a/src/libffmpeg/libavcodec/bytestream.h b/src/libffmpeg/libavcodec/bytestream.h
deleted file mode 100644
index ae5438b49..000000000
--- a/src/libffmpeg/libavcodec/bytestream.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Bytestream functions
- * copyright (c) 2006 Baptiste Coudurier <baptiste.coudurier@free.fr>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef FFMPEG_BYTESTREAM_H
-#define FFMPEG_BYTESTREAM_H
-
-static av_always_inline unsigned int bytestream_get_le32(uint8_t **b)
-{
- (*b) += 4;
- return AV_RL32(*b - 4);
-}
-
-static av_always_inline unsigned int bytestream_get_le16(uint8_t **b)
-{
- (*b) += 2;
- return AV_RL16(*b - 2);
-}
-
-static av_always_inline unsigned int bytestream_get_byte(uint8_t **b)
-{
- (*b)++;
- return (*b)[-1];
-}
-
-static av_always_inline unsigned int bytestream_get_buffer(uint8_t **b, uint8_t *dst, unsigned int size)
-{
- memcpy(dst, *b, size);
- (*b) += size;
- return size;
-}
-
-static av_always_inline void bytestream_put_be32(uint8_t **b, const unsigned int value)
-{
- *(*b)++ = value >> 24;
- *(*b)++ = value >> 16;
- *(*b)++ = value >> 8;
- *(*b)++ = value;
-};
-
-static av_always_inline void bytestream_put_be16(uint8_t **b, const unsigned int value)
-{
- *(*b)++ = value >> 8;
- *(*b)++ = value;
-}
-
-static av_always_inline void bytestream_put_le32(uint8_t **b, const unsigned int value)
-{
- *(*b)++ = value;
- *(*b)++ = value >> 8;
- *(*b)++ = value >> 16;
- *(*b)++ = value >> 24;
-}
-
-static av_always_inline void bytestream_put_le16(uint8_t **b, const unsigned int value)
-{
- *(*b)++ = value;
- *(*b)++ = value >> 8;
-}
-
-static av_always_inline void bytestream_put_byte(uint8_t **b, const unsigned int value)
-{
- *(*b)++ = value;
-}
-
-static av_always_inline void bytestream_put_buffer(uint8_t **b, const uint8_t *src, unsigned int size)
-{
- memcpy(*b, src, size);
- (*b) += size;
-}
-
-#endif /* FFMPEG_BYTESTREAM_H */
diff --git a/src/libffmpeg/libavcodec/cabac.c b/src/libffmpeg/libavcodec/cabac.c
deleted file mode 100644
index c6da6292a..000000000
--- a/src/libffmpeg/libavcodec/cabac.c
+++ /dev/null
@@ -1,265 +0,0 @@
-/*
- * H.26L/H.264/AVC/JVT/14496-10/... encoder/decoder
- * Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file cabac.c
- * Context Adaptive Binary Arithmetic Coder.
- */
-
-#include <string.h>
-
-#include "common.h"
-#include "bitstream.h"
-#include "cabac.h"
-
-static const uint8_t lps_range[64][4]= {
-{128,176,208,240}, {128,167,197,227}, {128,158,187,216}, {123,150,178,205},
-{116,142,169,195}, {111,135,160,185}, {105,128,152,175}, {100,122,144,166},
-{ 95,116,137,158}, { 90,110,130,150}, { 85,104,123,142}, { 81, 99,117,135},
-{ 77, 94,111,128}, { 73, 89,105,122}, { 69, 85,100,116}, { 66, 80, 95,110},
-{ 62, 76, 90,104}, { 59, 72, 86, 99}, { 56, 69, 81, 94}, { 53, 65, 77, 89},
-{ 51, 62, 73, 85}, { 48, 59, 69, 80}, { 46, 56, 66, 76}, { 43, 53, 63, 72},
-{ 41, 50, 59, 69}, { 39, 48, 56, 65}, { 37, 45, 54, 62}, { 35, 43, 51, 59},
-{ 33, 41, 48, 56}, { 32, 39, 46, 53}, { 30, 37, 43, 50}, { 29, 35, 41, 48},
-{ 27, 33, 39, 45}, { 26, 31, 37, 43}, { 24, 30, 35, 41}, { 23, 28, 33, 39},
-{ 22, 27, 32, 37}, { 21, 26, 30, 35}, { 20, 24, 29, 33}, { 19, 23, 27, 31},
-{ 18, 22, 26, 30}, { 17, 21, 25, 28}, { 16, 20, 23, 27}, { 15, 19, 22, 25},
-{ 14, 18, 21, 24}, { 14, 17, 20, 23}, { 13, 16, 19, 22}, { 12, 15, 18, 21},
-{ 12, 14, 17, 20}, { 11, 14, 16, 19}, { 11, 13, 15, 18}, { 10, 12, 15, 17},
-{ 10, 12, 14, 16}, { 9, 11, 13, 15}, { 9, 11, 12, 14}, { 8, 10, 12, 14},
-{ 8, 9, 11, 13}, { 7, 9, 11, 12}, { 7, 9, 10, 12}, { 7, 8, 10, 11},
-{ 6, 8, 9, 11}, { 6, 7, 9, 10}, { 6, 7, 8, 9}, { 2, 2, 2, 2},
-};
-
-uint8_t ff_h264_mlps_state[4*64];
-uint8_t ff_h264_lps_range[4*2*64];
-uint8_t ff_h264_lps_state[2*64];
-uint8_t ff_h264_mps_state[2*64];
-
-static const uint8_t mps_state[64]= {
- 1, 2, 3, 4, 5, 6, 7, 8,
- 9,10,11,12,13,14,15,16,
- 17,18,19,20,21,22,23,24,
- 25,26,27,28,29,30,31,32,
- 33,34,35,36,37,38,39,40,
- 41,42,43,44,45,46,47,48,
- 49,50,51,52,53,54,55,56,
- 57,58,59,60,61,62,62,63,
-};
-
-static const uint8_t lps_state[64]= {
- 0, 0, 1, 2, 2, 4, 4, 5,
- 6, 7, 8, 9, 9,11,11,12,
- 13,13,15,15,16,16,18,18,
- 19,19,21,21,22,22,23,24,
- 24,25,26,26,27,27,28,29,
- 29,30,30,30,31,32,32,33,
- 33,33,34,34,35,35,35,36,
- 36,36,37,37,37,38,38,63,
-};
-#if 0
-const uint8_t ff_h264_norm_shift_old[128]= {
- 7,6,5,5,4,4,4,4,3,3,3,3,3,3,3,3,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-};
-#endif
-const uint8_t ff_h264_norm_shift[512]= {
- 9,8,7,7,6,6,6,6,5,5,5,5,5,5,5,5,
- 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
- 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
- 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-};
-
-/**
- *
- * @param buf_size size of buf in bits
- */
-void ff_init_cabac_encoder(CABACContext *c, uint8_t *buf, int buf_size){
- init_put_bits(&c->pb, buf, buf_size);
-
- c->low= 0;
- c->range= 0x1FE;
- c->outstanding_count= 0;
-#ifdef STRICT_LIMITS
- c->sym_count =0;
-#endif
-
- c->pb.bit_left++; //avoids firstBitFlag
-}
-
-/**
- *
- * @param buf_size size of buf in bits
- */
-void ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size){
- c->bytestream_start=
- c->bytestream= buf;
- c->bytestream_end= buf + buf_size;
-
-#if CABAC_BITS == 16
- c->low = (*c->bytestream++)<<18;
- c->low+= (*c->bytestream++)<<10;
-#else
- c->low = (*c->bytestream++)<<10;
-#endif
- c->low+= ((*c->bytestream++)<<2) + 2;
- c->range= 0x1FE;
-}
-
-void ff_init_cabac_states(CABACContext *c){
- int i, j;
-
- for(i=0; i<64; i++){
- for(j=0; j<4; j++){ //FIXME check if this is worth the 1 shift we save
- ff_h264_lps_range[j*2*64+2*i+0]=
- ff_h264_lps_range[j*2*64+2*i+1]= lps_range[i][j];
- }
-
- ff_h264_mlps_state[128+2*i+0]=
- ff_h264_mps_state[2*i+0]= 2*mps_state[i]+0;
- ff_h264_mlps_state[128+2*i+1]=
- ff_h264_mps_state[2*i+1]= 2*mps_state[i]+1;
-
- if( i ){
-#ifdef BRANCHLESS_CABAC_DECODER
- ff_h264_mlps_state[128-2*i-1]= 2*lps_state[i]+0;
- ff_h264_mlps_state[128-2*i-2]= 2*lps_state[i]+1;
- }else{
- ff_h264_mlps_state[128-2*i-1]= 1;
- ff_h264_mlps_state[128-2*i-2]= 0;
-#else
- ff_h264_lps_state[2*i+0]= 2*lps_state[i]+0;
- ff_h264_lps_state[2*i+1]= 2*lps_state[i]+1;
- }else{
- ff_h264_lps_state[2*i+0]= 1;
- ff_h264_lps_state[2*i+1]= 0;
-#endif
- }
- }
-}
-
-#if 0 //selftest
-#define SIZE 10240
-
-#include "avcodec.h"
-
-int main(){
- CABACContext c;
- uint8_t b[9*SIZE];
- uint8_t r[9*SIZE];
- int i;
- uint8_t state[10]= {0};
-
- ff_init_cabac_encoder(&c, b, SIZE);
- ff_init_cabac_states(&c, ff_h264_lps_range, ff_h264_mps_state, ff_h264_lps_state, 64);
-
- for(i=0; i<SIZE; i++){
- r[i]= random()%7;
- }
-
- for(i=0; i<SIZE; i++){
-START_TIMER
- put_cabac_bypass(&c, r[i]&1);
-STOP_TIMER("put_cabac_bypass")
- }
-
- for(i=0; i<SIZE; i++){
-START_TIMER
- put_cabac(&c, state, r[i]&1);
-STOP_TIMER("put_cabac")
- }
-
- for(i=0; i<SIZE; i++){
-START_TIMER
- put_cabac_u(&c, state, r[i], 6, 3, i&1);
-STOP_TIMER("put_cabac_u")
- }
-
- for(i=0; i<SIZE; i++){
-START_TIMER
- put_cabac_ueg(&c, state, r[i], 3, 0, 1, 2);
-STOP_TIMER("put_cabac_ueg")
- }
-
- put_cabac_terminate(&c, 1);
-
- ff_init_cabac_decoder(&c, b, SIZE);
-
- memset(state, 0, sizeof(state));
-
- for(i=0; i<SIZE; i++){
-START_TIMER
- if( (r[i]&1) != get_cabac_bypass(&c) )
- av_log(NULL, AV_LOG_ERROR, "CABAC bypass failure at %d\n", i);
-STOP_TIMER("get_cabac_bypass")
- }
-
- for(i=0; i<SIZE; i++){
-START_TIMER
- if( (r[i]&1) != get_cabac(&c, state) )
- av_log(NULL, AV_LOG_ERROR, "CABAC failure at %d\n", i);
-STOP_TIMER("get_cabac")
- }
-#if 0
- for(i=0; i<SIZE; i++){
-START_TIMER
- if( r[i] != get_cabac_u(&c, state, (i&1) ? 6 : 7, 3, i&1) )
- av_log(NULL, AV_LOG_ERROR, "CABAC unary (truncated) binarization failure at %d\n", i);
-STOP_TIMER("get_cabac_u")
- }
-
- for(i=0; i<SIZE; i++){
-START_TIMER
- if( r[i] != get_cabac_ueg(&c, state, 3, 0, 1, 2))
- av_log(NULL, AV_LOG_ERROR, "CABAC unary (truncated) binarization failure at %d\n", i);
-STOP_TIMER("get_cabac_ueg")
- }
-#endif
- if(!get_cabac_terminate(&c))
- av_log(NULL, AV_LOG_ERROR, "where's the Terminator?\n");
-
- return 0;
-}
-
-#endif
diff --git a/src/libffmpeg/libavcodec/cabac.h b/src/libffmpeg/libavcodec/cabac.h
deleted file mode 100644
index b990014f6..000000000
--- a/src/libffmpeg/libavcodec/cabac.h
+++ /dev/null
@@ -1,859 +0,0 @@
-/*
- * H.26L/H.264/AVC/JVT/14496-10/... encoder/decoder
- * Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file cabac.h
- * Context Adaptive Binary Arithmetic Coder.
- */
-
-
-//#undef NDEBUG
-#include <assert.h>
-#ifdef ARCH_X86
-#include "x86_cpu.h"
-#endif
-
-#define CABAC_BITS 16
-#define CABAC_MASK ((1<<CABAC_BITS)-1)
-#define BRANCHLESS_CABAC_DECODER 1
-//#define ARCH_X86_DISABLED 1
-
-typedef struct CABACContext{
- int low;
- int range;
- int outstanding_count;
-#ifdef STRICT_LIMITS
- int symCount;
-#endif
- const uint8_t *bytestream_start;
- const uint8_t *bytestream;
- const uint8_t *bytestream_end;
- PutBitContext pb;
-}CABACContext;
-
-extern uint8_t ff_h264_mlps_state[4*64];
-extern uint8_t ff_h264_lps_range[4*2*64]; ///< rangeTabLPS
-extern uint8_t ff_h264_mps_state[2*64]; ///< transIdxMPS
-extern uint8_t ff_h264_lps_state[2*64]; ///< transIdxLPS
-extern const uint8_t ff_h264_norm_shift[512];
-
-
-void ff_init_cabac_encoder(CABACContext *c, uint8_t *buf, int buf_size);
-void ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size);
-void ff_init_cabac_states(CABACContext *c);
-
-
-static inline void put_cabac_bit(CABACContext *c, int b){
- put_bits(&c->pb, 1, b);
- for(;c->outstanding_count; c->outstanding_count--){
- put_bits(&c->pb, 1, 1-b);
- }
-}
-
-static inline void renorm_cabac_encoder(CABACContext *c){
- while(c->range < 0x100){
- //FIXME optimize
- if(c->low<0x100){
- put_cabac_bit(c, 0);
- }else if(c->low<0x200){
- c->outstanding_count++;
- c->low -= 0x100;
- }else{
- put_cabac_bit(c, 1);
- c->low -= 0x200;
- }
-
- c->range+= c->range;
- c->low += c->low;
- }
-}
-
-static void put_cabac(CABACContext *c, uint8_t * const state, int bit){
- int RangeLPS= ff_h264_lps_range[2*(c->range&0xC0) + *state];
-
- if(bit == ((*state)&1)){
- c->range -= RangeLPS;
- *state= ff_h264_mps_state[*state];
- }else{
- c->low += c->range - RangeLPS;
- c->range = RangeLPS;
- *state= ff_h264_lps_state[*state];
- }
-
- renorm_cabac_encoder(c);
-
-#ifdef STRICT_LIMITS
- c->symCount++;
-#endif
-}
-
-static void put_cabac_static(CABACContext *c, int RangeLPS, int bit){
- assert(c->range > RangeLPS);
-
- if(!bit){
- c->range -= RangeLPS;
- }else{
- c->low += c->range - RangeLPS;
- c->range = RangeLPS;
- }
-
- renorm_cabac_encoder(c);
-
-#ifdef STRICT_LIMITS
- c->symCount++;
-#endif
-}
-
-/**
- * @param bit 0 -> write zero bit, !=0 write one bit
- */
-static void put_cabac_bypass(CABACContext *c, int bit){
- c->low += c->low;
-
- if(bit){
- c->low += c->range;
- }
-//FIXME optimize
- if(c->low<0x200){
- put_cabac_bit(c, 0);
- }else if(c->low<0x400){
- c->outstanding_count++;
- c->low -= 0x200;
- }else{
- put_cabac_bit(c, 1);
- c->low -= 0x400;
- }
-
-#ifdef STRICT_LIMITS
- c->symCount++;
-#endif
-}
-
-/**
- *
- * @return the number of bytes written
- */
-static int put_cabac_terminate(CABACContext *c, int bit){
- c->range -= 2;
-
- if(!bit){
- renorm_cabac_encoder(c);
- }else{
- c->low += c->range;
- c->range= 2;
-
- renorm_cabac_encoder(c);
-
- assert(c->low <= 0x1FF);
- put_cabac_bit(c, c->low>>9);
- put_bits(&c->pb, 2, ((c->low>>7)&3)|1);
-
- flush_put_bits(&c->pb); //FIXME FIXME FIXME XXX wrong
- }
-
-#ifdef STRICT_LIMITS
- c->symCount++;
-#endif
-
- return (put_bits_count(&c->pb)+7)>>3;
-}
-
-/**
- * put (truncated) unary binarization.
- */
-static void put_cabac_u(CABACContext *c, uint8_t * state, int v, int max, int max_index, int truncated){
- int i;
-
- assert(v <= max);
-
-#if 1
- for(i=0; i<v; i++){
- put_cabac(c, state, 1);
- if(i < max_index) state++;
- }
- if(truncated==0 || v<max)
- put_cabac(c, state, 0);
-#else
- if(v <= max_index){
- for(i=0; i<v; i++){
- put_cabac(c, state+i, 1);
- }
- if(truncated==0 || v<max)
- put_cabac(c, state+i, 0);
- }else{
- for(i=0; i<=max_index; i++){
- put_cabac(c, state+i, 1);
- }
- for(; i<v; i++){
- put_cabac(c, state+max_index, 1);
- }
- if(truncated==0 || v<max)
- put_cabac(c, state+max_index, 0);
- }
-#endif
-}
-
-/**
- * put unary exp golomb k-th order binarization.
- */
-static void put_cabac_ueg(CABACContext *c, uint8_t * state, int v, int max, int is_signed, int k, int max_index){
- int i;
-
- if(v==0)
- put_cabac(c, state, 0);
- else{
- const int sign= v < 0;
-
- if(is_signed) v= FFABS(v);
-
- if(v<max){
- for(i=0; i<v; i++){
- put_cabac(c, state, 1);
- if(i < max_index) state++;
- }
-
- put_cabac(c, state, 0);
- }else{
- int m= 1<<k;
-
- for(i=0; i<max; i++){
- put_cabac(c, state, 1);
- if(i < max_index) state++;
- }
-
- v -= max;
- while(v >= m){ //FIXME optimize
- put_cabac_bypass(c, 1);
- v-= m;
- m+= m;
- }
- put_cabac_bypass(c, 0);
- while(m>>=1){
- put_cabac_bypass(c, v&m);
- }
- }
-
- if(is_signed)
- put_cabac_bypass(c, sign);
- }
-}
-
-static void refill(CABACContext *c){
-#if CABAC_BITS == 16
- c->low+= (c->bytestream[0]<<9) + (c->bytestream[1]<<1);
-#else
- c->low+= c->bytestream[0]<<1;
-#endif
- c->low -= CABAC_MASK;
- c->bytestream+= CABAC_BITS/8;
-}
-
-static void refill2(CABACContext *c){
- int i, x;
-
- x= c->low ^ (c->low-1);
- i= 7 - ff_h264_norm_shift[x>>(CABAC_BITS-1)];
-
- x= -CABAC_MASK;
-
-#if CABAC_BITS == 16
- x+= (c->bytestream[0]<<9) + (c->bytestream[1]<<1);
-#else
- x+= c->bytestream[0]<<1;
-#endif
-
- c->low += x<<i;
- c->bytestream+= CABAC_BITS/8;
-}
-
-static inline void renorm_cabac_decoder(CABACContext *c){
- while(c->range < 0x100){
- c->range+= c->range;
- c->low+= c->low;
- if(!(c->low & CABAC_MASK))
- refill(c);
- }
-}
-
-static inline void renorm_cabac_decoder_once(CABACContext *c){
-#ifdef ARCH_X86_DISABLED
- int temp;
-#if 0
- //P3:683 athlon:475
- asm(
- "lea -0x100(%0), %2 \n\t"
- "shr $31, %2 \n\t" //FIXME 31->63 for x86-64
- "shl %%cl, %0 \n\t"
- "shl %%cl, %1 \n\t"
- : "+r"(c->range), "+r"(c->low), "+c"(temp)
- );
-#elif 0
- //P3:680 athlon:474
- asm(
- "cmp $0x100, %0 \n\t"
- "setb %%cl \n\t" //FIXME 31->63 for x86-64
- "shl %%cl, %0 \n\t"
- "shl %%cl, %1 \n\t"
- : "+r"(c->range), "+r"(c->low), "+c"(temp)
- );
-#elif 1
- int temp2;
- //P3:665 athlon:517
- asm(
- "lea -0x100(%0), %%eax \n\t"
- "cdq \n\t"
- "mov %0, %%eax \n\t"
- "and %%edx, %0 \n\t"
- "and %1, %%edx \n\t"
- "add %%eax, %0 \n\t"
- "add %%edx, %1 \n\t"
- : "+r"(c->range), "+r"(c->low), "+a"(temp), "+d"(temp2)
- );
-#elif 0
- int temp2;
- //P3:673 athlon:509
- asm(
- "cmp $0x100, %0 \n\t"
- "sbb %%edx, %%edx \n\t"
- "mov %0, %%eax \n\t"
- "and %%edx, %0 \n\t"
- "and %1, %%edx \n\t"
- "add %%eax, %0 \n\t"
- "add %%edx, %1 \n\t"
- : "+r"(c->range), "+r"(c->low), "+a"(temp), "+d"(temp2)
- );
-#else
- int temp2;
- //P3:677 athlon:511
- asm(
- "cmp $0x100, %0 \n\t"
- "lea (%0, %0), %%eax \n\t"
- "lea (%1, %1), %%edx \n\t"
- "cmovb %%eax, %0 \n\t"
- "cmovb %%edx, %1 \n\t"
- : "+r"(c->range), "+r"(c->low), "+a"(temp), "+d"(temp2)
- );
-#endif
-#else
- //P3:675 athlon:476
- int shift= (uint32_t)(c->range - 0x100)>>31;
- c->range<<= shift;
- c->low <<= shift;
-#endif
- if(!(c->low & CABAC_MASK))
- refill(c);
-}
-
-static int av_always_inline get_cabac_inline(CABACContext *c, uint8_t * const state){
- //FIXME gcc generates duplicate load/stores for c->low and c->range
-#define LOW "0"
-#define RANGE "4"
-#ifdef ARCH_X86_64
-#define BYTESTART "16"
-#define BYTE "24"
-#define BYTEEND "32"
-#else
-#define BYTESTART "12"
-#define BYTE "16"
-#define BYTEEND "20"
-#endif
-#if defined(ARCH_X86) && !(defined(PIC) && defined(__GNUC__))
- int bit;
-
-#ifndef BRANCHLESS_CABAC_DECODER
- asm volatile(
- "movzbl (%1), %0 \n\t"
- "movl "RANGE "(%2), %%ebx \n\t"
- "movl "RANGE "(%2), %%edx \n\t"
- "andl $0xC0, %%ebx \n\t"
- "movzbl "MANGLE(ff_h264_lps_range)"(%0, %%ebx, 2), %%esi\n\t"
- "movl "LOW "(%2), %%ebx \n\t"
-//eax:state ebx:low, edx:range, esi:RangeLPS
- "subl %%esi, %%edx \n\t"
- "movl %%edx, %%ecx \n\t"
- "shll $17, %%ecx \n\t"
- "cmpl %%ecx, %%ebx \n\t"
- " ja 1f \n\t"
-
-#if 1
- //athlon:4067 P3:4110
- "lea -0x100(%%edx), %%ecx \n\t"
- "shr $31, %%ecx \n\t"
- "shl %%cl, %%edx \n\t"
- "shl %%cl, %%ebx \n\t"
-#else
- //athlon:4057 P3:4130
- "cmp $0x100, %%edx \n\t" //FIXME avoidable
- "setb %%cl \n\t"
- "shl %%cl, %%edx \n\t"
- "shl %%cl, %%ebx \n\t"
-#endif
- "movzbl "MANGLE(ff_h264_mps_state)"(%0), %%ecx \n\t"
- "movb %%cl, (%1) \n\t"
-//eax:state ebx:low, edx:range, esi:RangeLPS
- "test %%bx, %%bx \n\t"
- " jnz 2f \n\t"
- "mov "BYTE "(%2), %%"REG_S" \n\t"
- "subl $0xFFFF, %%ebx \n\t"
- "movzwl (%%"REG_S"), %%ecx \n\t"
- "bswap %%ecx \n\t"
- "shrl $15, %%ecx \n\t"
- "add $2, %%"REG_S" \n\t"
- "addl %%ecx, %%ebx \n\t"
- "mov %%"REG_S", "BYTE "(%2) \n\t"
- "jmp 2f \n\t"
- "1: \n\t"
-//eax:state ebx:low, edx:range, esi:RangeLPS
- "subl %%ecx, %%ebx \n\t"
- "movl %%esi, %%edx \n\t"
- "movzbl " MANGLE(ff_h264_norm_shift) "(%%esi), %%ecx \n\t"
- "shll %%cl, %%ebx \n\t"
- "shll %%cl, %%edx \n\t"
- "movzbl "MANGLE(ff_h264_lps_state)"(%0), %%ecx \n\t"
- "movb %%cl, (%1) \n\t"
- "add $1, %0 \n\t"
- "test %%bx, %%bx \n\t"
- " jnz 2f \n\t"
-
- "mov "BYTE "(%2), %%"REG_c" \n\t"
- "movzwl (%%"REG_c"), %%esi \n\t"
- "bswap %%esi \n\t"
- "shrl $15, %%esi \n\t"
- "subl $0xFFFF, %%esi \n\t"
- "add $2, %%"REG_c" \n\t"
- "mov %%"REG_c", "BYTE "(%2) \n\t"
-
- "leal -1(%%ebx), %%ecx \n\t"
- "xorl %%ebx, %%ecx \n\t"
- "shrl $15, %%ecx \n\t"
- "movzbl " MANGLE(ff_h264_norm_shift) "(%%ecx), %%ecx \n\t"
- "neg %%ecx \n\t"
- "add $7, %%ecx \n\t"
-
- "shll %%cl , %%esi \n\t"
- "addl %%esi, %%ebx \n\t"
- "2: \n\t"
- "movl %%edx, "RANGE "(%2) \n\t"
- "movl %%ebx, "LOW "(%2) \n\t"
- :"=&a"(bit) //FIXME this is fragile gcc either runs out of registers or misscompiles it (for example if "+a"(bit) or "+m"(*state) is used
- :"r"(state), "r"(c)
- : "%"REG_c, "%ebx", "%edx", "%"REG_S, "memory"
- );
- bit&=1;
-#else /* BRANCHLESS_CABAC_DECODER */
-
-
-#if defined HAVE_FAST_CMOV
-#define BRANCHLESS_GET_CABAC_UPDATE(ret, cabac, statep, low, lowword, range, tmp, tmpbyte)\
- "mov "tmp" , %%ecx \n\t"\
- "shl $17 , "tmp" \n\t"\
- "cmp "low" , "tmp" \n\t"\
- "cmova %%ecx , "range" \n\t"\
- "sbb %%ecx , %%ecx \n\t"\
- "and %%ecx , "tmp" \n\t"\
- "sub "tmp" , "low" \n\t"\
- "xor %%ecx , "ret" \n\t"
-#else /* HAVE_FAST_CMOV */
-#define BRANCHLESS_GET_CABAC_UPDATE(ret, cabac, statep, low, lowword, range, tmp, tmpbyte)\
- "mov "tmp" , %%ecx \n\t"\
- "shl $17 , "tmp" \n\t"\
- "sub "low" , "tmp" \n\t"\
- "sar $31 , "tmp" \n\t" /*lps_mask*/\
- "sub %%ecx , "range" \n\t" /*RangeLPS - range*/\
- "and "tmp" , "range" \n\t" /*(RangeLPS - range)&lps_mask*/\
- "add %%ecx , "range" \n\t" /*new range*/\
- "shl $17 , %%ecx \n\t"\
- "and "tmp" , %%ecx \n\t"\
- "sub %%ecx , "low" \n\t"\
- "xor "tmp" , "ret" \n\t"
-#endif /* HAVE_FAST_CMOV */
-
-
-#define BRANCHLESS_GET_CABAC(ret, cabac, statep, low, lowword, range, tmp, tmpbyte)\
- "movzbl "statep" , "ret" \n\t"\
- "mov "range" , "tmp" \n\t"\
- "and $0xC0 , "range" \n\t"\
- "movzbl "MANGLE(ff_h264_lps_range)"("ret", "range", 2), "range" \n\t"\
- "sub "range" , "tmp" \n\t"\
- BRANCHLESS_GET_CABAC_UPDATE(ret, cabac, statep, low, lowword, range, tmp, tmpbyte)\
- "movzbl " MANGLE(ff_h264_norm_shift) "("range"), %%ecx \n\t"\
- "shl %%cl , "range" \n\t"\
- "movzbl "MANGLE(ff_h264_mlps_state)"+128("ret"), "tmp" \n\t"\
- "mov "tmpbyte" , "statep" \n\t"\
- "shl %%cl , "low" \n\t"\
- "test "lowword" , "lowword" \n\t"\
- " jnz 1f \n\t"\
- "mov "BYTE"("cabac"), %%"REG_c" \n\t"\
- "movzwl (%%"REG_c") , "tmp" \n\t"\
- "bswap "tmp" \n\t"\
- "shr $15 , "tmp" \n\t"\
- "sub $0xFFFF , "tmp" \n\t"\
- "add $2 , %%"REG_c" \n\t"\
- "mov %%"REG_c" , "BYTE "("cabac") \n\t"\
- "lea -1("low") , %%ecx \n\t"\
- "xor "low" , %%ecx \n\t"\
- "shr $15 , %%ecx \n\t"\
- "movzbl " MANGLE(ff_h264_norm_shift) "(%%ecx), %%ecx \n\t"\
- "neg %%ecx \n\t"\
- "add $7 , %%ecx \n\t"\
- "shl %%cl , "tmp" \n\t"\
- "add "tmp" , "low" \n\t"\
- "1: \n\t"
-
- asm volatile(
- "movl "RANGE "(%2), %%esi \n\t"
- "movl "LOW "(%2), %%ebx \n\t"
- BRANCHLESS_GET_CABAC("%0", "%2", "(%1)", "%%ebx", "%%bx", "%%esi", "%%edx", "%%dl")
- "movl %%esi, "RANGE "(%2) \n\t"
- "movl %%ebx, "LOW "(%2) \n\t"
-
- :"=&a"(bit)
- :"r"(state), "r"(c)
- : "%"REG_c, "%ebx", "%edx", "%esi", "memory"
- );
- bit&=1;
-#endif /* BRANCHLESS_CABAC_DECODER */
-#else /* defined(ARCH_X86) && !(defined(PIC) && defined(__GNUC__)) */
- int s = *state;
- int RangeLPS= ff_h264_lps_range[2*(c->range&0xC0) + s];
- int bit, lps_mask attribute_unused;
-
- c->range -= RangeLPS;
-#ifndef BRANCHLESS_CABAC_DECODER
- if(c->low < (c->range<<(CABAC_BITS+1))){
- bit= s&1;
- *state= ff_h264_mps_state[s];
- renorm_cabac_decoder_once(c);
- }else{
- bit= ff_h264_norm_shift[RangeLPS];
- c->low -= (c->range<<(CABAC_BITS+1));
- *state= ff_h264_lps_state[s];
- c->range = RangeLPS<<bit;
- c->low <<= bit;
- bit= (s&1)^1;
-
- if(!(c->low & CABAC_MASK)){
- refill2(c);
- }
- }
-#else /* BRANCHLESS_CABAC_DECODER */
- lps_mask= ((c->range<<(CABAC_BITS+1)) - c->low)>>31;
-
- c->low -= (c->range<<(CABAC_BITS+1)) & lps_mask;
- c->range += (RangeLPS - c->range) & lps_mask;
-
- s^=lps_mask;
- *state= (ff_h264_mlps_state+128)[s];
- bit= s&1;
-
- lps_mask= ff_h264_norm_shift[c->range];
- c->range<<= lps_mask;
- c->low <<= lps_mask;
- if(!(c->low & CABAC_MASK))
- refill2(c);
-#endif /* BRANCHLESS_CABAC_DECODER */
-#endif /* defined(ARCH_X86) && !(defined(PIC) && defined(__GNUC__)) */
- return bit;
-}
-
-static int __attribute((noinline)) get_cabac_noinline(CABACContext *c, uint8_t * const state){
- return get_cabac_inline(c,state);
-}
-
-static int get_cabac(CABACContext *c, uint8_t * const state){
- return get_cabac_inline(c,state);
-}
-
-static int get_cabac_bypass(CABACContext *c){
-#if 0 //not faster
- int bit;
- asm volatile(
- "movl "RANGE "(%1), %%ebx \n\t"
- "movl "LOW "(%1), %%eax \n\t"
- "shl $17, %%ebx \n\t"
- "add %%eax, %%eax \n\t"
- "sub %%ebx, %%eax \n\t"
- "cdq \n\t"
- "and %%edx, %%ebx \n\t"
- "add %%ebx, %%eax \n\t"
- "test %%ax, %%ax \n\t"
- " jnz 1f \n\t"
- "movl "BYTE "(%1), %%"REG_b" \n\t"
- "subl $0xFFFF, %%eax \n\t"
- "movzwl (%%"REG_b"), %%ecx \n\t"
- "bswap %%ecx \n\t"
- "shrl $15, %%ecx \n\t"
- "addl $2, %%"REG_b" \n\t"
- "addl %%ecx, %%eax \n\t"
- "movl %%"REG_b", "BYTE "(%1) \n\t"
- "1: \n\t"
- "movl %%eax, "LOW "(%1) \n\t"
-
- :"=&d"(bit)
- :"r"(c)
- : "%eax", "%"REG_b, "%ecx", "memory"
- );
- return bit+1;
-#else
- int range;
- c->low += c->low;
-
- if(!(c->low & CABAC_MASK))
- refill(c);
-
- range= c->range<<(CABAC_BITS+1);
- if(c->low < range){
- return 0;
- }else{
- c->low -= range;
- return 1;
- }
-#endif
-}
-
-
-static av_always_inline int get_cabac_bypass_sign(CABACContext *c, int val){
-#if defined(ARCH_X86) && !(defined(PIC) && defined(__GNUC__))
- asm volatile(
- "movl "RANGE "(%1), %%ebx \n\t"
- "movl "LOW "(%1), %%eax \n\t"
- "shl $17, %%ebx \n\t"
- "add %%eax, %%eax \n\t"
- "sub %%ebx, %%eax \n\t"
- "cdq \n\t"
- "and %%edx, %%ebx \n\t"
- "add %%ebx, %%eax \n\t"
- "xor %%edx, %%ecx \n\t"
- "sub %%edx, %%ecx \n\t"
- "test %%ax, %%ax \n\t"
- " jnz 1f \n\t"
- "mov "BYTE "(%1), %%"REG_b" \n\t"
- "subl $0xFFFF, %%eax \n\t"
- "movzwl (%%"REG_b"), %%edx \n\t"
- "bswap %%edx \n\t"
- "shrl $15, %%edx \n\t"
- "add $2, %%"REG_b" \n\t"
- "addl %%edx, %%eax \n\t"
- "mov %%"REG_b", "BYTE "(%1) \n\t"
- "1: \n\t"
- "movl %%eax, "LOW "(%1) \n\t"
-
- :"+c"(val)
- :"r"(c)
- : "%eax", "%"REG_b, "%edx", "memory"
- );
- return val;
-#else
- int range, mask;
- c->low += c->low;
-
- if(!(c->low & CABAC_MASK))
- refill(c);
-
- range= c->range<<(CABAC_BITS+1);
- c->low -= range;
- mask= c->low >> 31;
- range &= mask;
- c->low += range;
- return (val^mask)-mask;
-#endif
-}
-
-//FIXME the x86 code from this file should be moved into i386/h264 or cabac something.c/h (note ill kill you if you move my code away from under my fingers before iam finished with it!)
-//FIXME use some macros to avoid duplicatin get_cabac (cant be done yet as that would make optimization work hard)
-#if defined(ARCH_X86) && !(defined(PIC) && defined(__GNUC__))
-static int decode_significance_x86(CABACContext *c, int max_coeff, uint8_t *significant_coeff_ctx_base, int *index){
- void *end= significant_coeff_ctx_base + max_coeff - 1;
- int minusstart= -(int)significant_coeff_ctx_base;
- int minusindex= 4-(int)index;
- int coeff_count;
- asm volatile(
- "movl "RANGE "(%3), %%esi \n\t"
- "movl "LOW "(%3), %%ebx \n\t"
-
- "2: \n\t"
-
- BRANCHLESS_GET_CABAC("%%edx", "%3", "(%1)", "%%ebx", "%%bx", "%%esi", "%%eax", "%%al")
-
- "test $1, %%edx \n\t"
- " jz 3f \n\t"
-
- BRANCHLESS_GET_CABAC("%%edx", "%3", "61(%1)", "%%ebx", "%%bx", "%%esi", "%%eax", "%%al")
-
- "mov %2, %%"REG_a" \n\t"
- "movl %4, %%ecx \n\t"
- "add %1, %%"REG_c" \n\t"
- "movl %%ecx, (%%"REG_a") \n\t"
-
- "test $1, %%edx \n\t"
- " jnz 4f \n\t"
-
- "add $4, %%"REG_a" \n\t"
- "mov %%"REG_a", %2 \n\t"
-
- "3: \n\t"
- "add $1, %1 \n\t"
- "cmp %5, %1 \n\t"
- " jb 2b \n\t"
- "mov %2, %%"REG_a" \n\t"
- "movl %4, %%ecx \n\t"
- "add %1, %%"REG_c" \n\t"
- "movl %%ecx, (%%"REG_a") \n\t"
- "4: \n\t"
- "add %6, %%eax \n\t"
- "shr $2, %%eax \n\t"
-
- "movl %%esi, "RANGE "(%3) \n\t"
- "movl %%ebx, "LOW "(%3) \n\t"
- :"=&a"(coeff_count), "+r"(significant_coeff_ctx_base), "+m"(index)\
- :"r"(c), "m"(minusstart), "m"(end), "m"(minusindex)\
- : "%"REG_c, "%ebx", "%edx", "%esi", "memory"\
- );
- return coeff_count;
-}
-
-static int decode_significance_8x8_x86(CABACContext *c, uint8_t *significant_coeff_ctx_base, int *index, uint8_t *sig_off){
- int minusindex= 4-(int)index;
- int coeff_count;
- long last=0;
- asm volatile(
- "movl "RANGE "(%3), %%esi \n\t"
- "movl "LOW "(%3), %%ebx \n\t"
-
- "mov %1, %%"REG_D" \n\t"
- "2: \n\t"
-
- "mov %6, %%"REG_a" \n\t"
- "movzbl (%%"REG_a", %%"REG_D"), %%edi \n\t"
- "add %5, %%"REG_D" \n\t"
-
- BRANCHLESS_GET_CABAC("%%edx", "%3", "(%%"REG_D")", "%%ebx", "%%bx", "%%esi", "%%eax", "%%al")
-
- "mov %1, %%edi \n\t"
- "test $1, %%edx \n\t"
- " jz 3f \n\t"
-
- "movzbl "MANGLE(last_coeff_flag_offset_8x8)"(%%edi), %%edi\n\t"
- "add %5, %%"REG_D" \n\t"
-
- BRANCHLESS_GET_CABAC("%%edx", "%3", "15(%%"REG_D")", "%%ebx", "%%bx", "%%esi", "%%eax", "%%al")
-
- "mov %2, %%"REG_a" \n\t"
- "mov %1, %%edi \n\t"
- "movl %%edi, (%%"REG_a") \n\t"
-
- "test $1, %%edx \n\t"
- " jnz 4f \n\t"
-
- "add $4, %%"REG_a" \n\t"
- "mov %%"REG_a", %2 \n\t"
-
- "3: \n\t"
- "addl $1, %%edi \n\t"
- "mov %%edi, %1 \n\t"
- "cmpl $63, %%edi \n\t"
- " jb 2b \n\t"
- "mov %2, %%"REG_a" \n\t"
- "movl %%edi, (%%"REG_a") \n\t"
- "4: \n\t"
- "addl %4, %%eax \n\t"
- "shr $2, %%eax \n\t"
-
- "movl %%esi, "RANGE "(%3) \n\t"
- "movl %%ebx, "LOW "(%3) \n\t"
- :"=&a"(coeff_count),"+m"(last), "+m"(index)\
- :"r"(c), "m"(minusindex), "m"(significant_coeff_ctx_base), "m"(sig_off)\
- : "%"REG_c, "%ebx", "%edx", "%esi", "%"REG_D, "memory"\
- );
- return coeff_count;
-}
-#endif /* defined(ARCH_X86) && !(defined(PIC) && defined(__GNUC__)) */
-
-/**
- *
- * @return the number of bytes read or 0 if no end
- */
-static int get_cabac_terminate(CABACContext *c){
- c->range -= 2;
- if(c->low < c->range<<(CABAC_BITS+1)){
- renorm_cabac_decoder_once(c);
- return 0;
- }else{
- return c->bytestream - c->bytestream_start;
- }
-}
-
-/**
- * get (truncated) unnary binarization.
- */
-static int get_cabac_u(CABACContext *c, uint8_t * state, int max, int max_index, int truncated){
- int i;
-
- for(i=0; i<max; i++){
- if(get_cabac(c, state)==0)
- return i;
-
- if(i< max_index) state++;
- }
-
- return truncated ? max : -1;
-}
-
-/**
- * get unary exp golomb k-th order binarization.
- */
-static int get_cabac_ueg(CABACContext *c, uint8_t * state, int max, int is_signed, int k, int max_index){
- int i, v;
- int m= 1<<k;
-
- if(get_cabac(c, state)==0)
- return 0;
-
- if(0 < max_index) state++;
-
- for(i=1; i<max; i++){
- if(get_cabac(c, state)==0){
- if(is_signed && get_cabac_bypass(c)){
- return -i;
- }else
- return i;
- }
-
- if(i < max_index) state++;
- }
-
- while(get_cabac_bypass(c)){
- i+= m;
- m+= m;
- }
-
- v=0;
- while(m>>=1){
- v+= v + get_cabac_bypass(c);
- }
- i += v;
-
- if(is_signed && get_cabac_bypass(c)){
- return -i;
- }else
- return i;
-}
diff --git a/src/libffmpeg/libavcodec/cavs.c b/src/libffmpeg/libavcodec/cavs.c
deleted file mode 100644
index ee862bbc7..000000000
--- a/src/libffmpeg/libavcodec/cavs.c
+++ /dev/null
@@ -1,1540 +0,0 @@
-/*
- * Chinese AVS video (AVS1-P2, JiZhun profile) decoder.
- * Copyright (c) 2006 Stefan Gehrer <stefan.gehrer@gmx.de>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file cavs.c
- * Chinese AVS video (AVS1-P2, JiZhun profile) decoder
- * @author Stefan Gehrer <stefan.gehrer@gmx.de>
- */
-
-#include "avcodec.h"
-#include "bitstream.h"
-#include "golomb.h"
-#include "mpegvideo.h"
-#include "cavsdata.h"
-
-#ifdef CONFIG_CAVS_DECODER
-typedef struct {
- MpegEncContext s;
- Picture picture; ///< currently decoded frame
- Picture DPB[2]; ///< reference frames
- int dist[2]; ///< temporal distances from current frame to ref frames
- int profile, level;
- int aspect_ratio;
- int mb_width, mb_height;
- int pic_type;
- int progressive;
- int pic_structure;
- int skip_mode_flag; ///< select between skip_count or one skip_flag per MB
- int loop_filter_disable;
- int alpha_offset, beta_offset;
- int ref_flag;
- int mbx, mby; ///< macroblock coordinates
- int flags; ///< availability flags of neighbouring macroblocks
- int stc; ///< last start code
- uint8_t *cy, *cu, *cv; ///< current MB sample pointers
- int left_qp;
- uint8_t *top_qp;
-
- /** mv motion vector cache
- 0: D3 B2 B3 C2
- 4: A1 X0 X1 -
- 8: A3 X2 X3 -
-
- X are the vectors in the current macroblock (5,6,9,10)
- A is the macroblock to the left (4,8)
- B is the macroblock to the top (1,2)
- C is the macroblock to the top-right (3)
- D is the macroblock to the top-left (0)
-
- the same is repeated for backward motion vectors */
- vector_t mv[2*4*3];
- vector_t *top_mv[2];
- vector_t *col_mv;
-
- /** luma pred mode cache
- 0: -- B2 B3
- 3: A1 X0 X1
- 6: A3 X2 X3 */
- int pred_mode_Y[3*3];
- int *top_pred_Y;
- int l_stride, c_stride;
- int luma_scan[4];
- int qp;
- int qp_fixed;
- int cbp;
- ScanTable scantable;
-
- /** intra prediction is done with un-deblocked samples
- they are saved here before deblocking the MB */
- uint8_t *top_border_y, *top_border_u, *top_border_v;
- uint8_t left_border_y[26], left_border_u[10], left_border_v[10];
- uint8_t intern_border_y[26];
- uint8_t topleft_border_y, topleft_border_u, topleft_border_v;
-
- void (*intra_pred_l[8])(uint8_t *d,uint8_t *top,uint8_t *left,int stride);
- void (*intra_pred_c[7])(uint8_t *d,uint8_t *top,uint8_t *left,int stride);
- uint8_t *col_type_base;
- uint8_t *col_type;
-
- /* scaling factors for MV prediction */
- int sym_factor; ///< for scaling in symmetrical B block
- int direct_den[2]; ///< for scaling in direct B block
- int scale_den[2]; ///< for scaling neighbouring MVs
-
- int got_keyframe;
- DCTELEM *block;
-} AVSContext;
-
-/*****************************************************************************
- *
- * in-loop deblocking filter
- *
- ****************************************************************************/
-
-static inline int get_bs(vector_t *mvP, vector_t *mvQ, int b) {
- if((mvP->ref == REF_INTRA) || (mvQ->ref == REF_INTRA))
- return 2;
- if( (abs(mvP->x - mvQ->x) >= 4) || (abs(mvP->y - mvQ->y) >= 4) )
- return 1;
- if(b){
- mvP += MV_BWD_OFFS;
- mvQ += MV_BWD_OFFS;
- if( (abs(mvP->x - mvQ->x) >= 4) || (abs(mvP->y - mvQ->y) >= 4) )
- return 1;
- }else{
- if(mvP->ref != mvQ->ref)
- return 1;
- }
- return 0;
-}
-
-#define SET_PARAMS \
- alpha = alpha_tab[clip(qp_avg + h->alpha_offset,0,63)]; \
- beta = beta_tab[clip(qp_avg + h->beta_offset, 0,63)]; \
- tc = tc_tab[clip(qp_avg + h->alpha_offset,0,63)];
-
-/**
- * in-loop deblocking filter for a single macroblock
- *
- * boundary strength (bs) mapping:
- *
- * --4---5--
- * 0 2 |
- * | 6 | 7 |
- * 1 3 |
- * ---------
- *
- */
-static void filter_mb(AVSContext *h, enum mb_t mb_type) {
- DECLARE_ALIGNED_8(uint8_t, bs[8]);
- int qp_avg, alpha, beta, tc;
- int i;
-
- /* save un-deblocked lines */
- h->topleft_border_y = h->top_border_y[h->mbx*16+15];
- h->topleft_border_u = h->top_border_u[h->mbx*10+8];
- h->topleft_border_v = h->top_border_v[h->mbx*10+8];
- memcpy(&h->top_border_y[h->mbx*16], h->cy + 15* h->l_stride,16);
- memcpy(&h->top_border_u[h->mbx*10+1], h->cu + 7* h->c_stride,8);
- memcpy(&h->top_border_v[h->mbx*10+1], h->cv + 7* h->c_stride,8);
- for(i=0;i<8;i++) {
- h->left_border_y[i*2+1] = *(h->cy + 15 + (i*2+0)*h->l_stride);
- h->left_border_y[i*2+2] = *(h->cy + 15 + (i*2+1)*h->l_stride);
- h->left_border_u[i+1] = *(h->cu + 7 + i*h->c_stride);
- h->left_border_v[i+1] = *(h->cv + 7 + i*h->c_stride);
- }
- if(!h->loop_filter_disable) {
- /* determine bs */
- if(mb_type == I_8X8)
- *((uint64_t *)bs) = 0x0202020202020202ULL;
- else{
- *((uint64_t *)bs) = 0;
- if(partition_flags[mb_type] & SPLITV){
- bs[2] = get_bs(&h->mv[MV_FWD_X0], &h->mv[MV_FWD_X1], mb_type > P_8X8);
- bs[3] = get_bs(&h->mv[MV_FWD_X2], &h->mv[MV_FWD_X3], mb_type > P_8X8);
- }
- if(partition_flags[mb_type] & SPLITH){
- bs[6] = get_bs(&h->mv[MV_FWD_X0], &h->mv[MV_FWD_X2], mb_type > P_8X8);
- bs[7] = get_bs(&h->mv[MV_FWD_X1], &h->mv[MV_FWD_X3], mb_type > P_8X8);
- }
- bs[0] = get_bs(&h->mv[MV_FWD_A1], &h->mv[MV_FWD_X0], mb_type > P_8X8);
- bs[1] = get_bs(&h->mv[MV_FWD_A3], &h->mv[MV_FWD_X2], mb_type > P_8X8);
- bs[4] = get_bs(&h->mv[MV_FWD_B2], &h->mv[MV_FWD_X0], mb_type > P_8X8);
- bs[5] = get_bs(&h->mv[MV_FWD_B3], &h->mv[MV_FWD_X1], mb_type > P_8X8);
- }
- if( *((uint64_t *)bs) ) {
- if(h->flags & A_AVAIL) {
- qp_avg = (h->qp + h->left_qp + 1) >> 1;
- SET_PARAMS;
- h->s.dsp.cavs_filter_lv(h->cy,h->l_stride,alpha,beta,tc,bs[0],bs[1]);
- h->s.dsp.cavs_filter_cv(h->cu,h->c_stride,alpha,beta,tc,bs[0],bs[1]);
- h->s.dsp.cavs_filter_cv(h->cv,h->c_stride,alpha,beta,tc,bs[0],bs[1]);
- }
- qp_avg = h->qp;
- SET_PARAMS;
- h->s.dsp.cavs_filter_lv(h->cy + 8,h->l_stride,alpha,beta,tc,bs[2],bs[3]);
- h->s.dsp.cavs_filter_lh(h->cy + 8*h->l_stride,h->l_stride,alpha,beta,tc,
- bs[6],bs[7]);
-
- if(h->flags & B_AVAIL) {
- qp_avg = (h->qp + h->top_qp[h->mbx] + 1) >> 1;
- SET_PARAMS;
- h->s.dsp.cavs_filter_lh(h->cy,h->l_stride,alpha,beta,tc,bs[4],bs[5]);
- h->s.dsp.cavs_filter_ch(h->cu,h->c_stride,alpha,beta,tc,bs[4],bs[5]);
- h->s.dsp.cavs_filter_ch(h->cv,h->c_stride,alpha,beta,tc,bs[4],bs[5]);
- }
- }
- }
- h->left_qp = h->qp;
- h->top_qp[h->mbx] = h->qp;
-}
-
-#undef SET_PARAMS
-
-/*****************************************************************************
- *
- * spatial intra prediction
- *
- ****************************************************************************/
-
-static inline void load_intra_pred_luma(AVSContext *h, uint8_t *top,
- uint8_t **left, int block) {
- int i;
-
- switch(block) {
- case 0:
- *left = h->left_border_y;
- h->left_border_y[0] = h->left_border_y[1];
- memset(&h->left_border_y[17],h->left_border_y[16],9);
- memcpy(&top[1],&h->top_border_y[h->mbx*16],16);
- top[17] = top[16];
- top[0] = top[1];
- if((h->flags & A_AVAIL) && (h->flags & B_AVAIL))
- h->left_border_y[0] = top[0] = h->topleft_border_y;
- break;
- case 1:
- *left = h->intern_border_y;
- for(i=0;i<8;i++)
- h->intern_border_y[i+1] = *(h->cy + 7 + i*h->l_stride);
- memset(&h->intern_border_y[9],h->intern_border_y[8],9);
- h->intern_border_y[0] = h->intern_border_y[1];
- memcpy(&top[1],&h->top_border_y[h->mbx*16+8],8);
- if(h->flags & C_AVAIL)
- memcpy(&top[9],&h->top_border_y[(h->mbx + 1)*16],8);
- else
- memset(&top[9],top[8],9);
- top[17] = top[16];
- top[0] = top[1];
- if(h->flags & B_AVAIL)
- h->intern_border_y[0] = top[0] = h->top_border_y[h->mbx*16+7];
- break;
- case 2:
- *left = &h->left_border_y[8];
- memcpy(&top[1],h->cy + 7*h->l_stride,16);
- top[17] = top[16];
- top[0] = top[1];
- if(h->flags & A_AVAIL)
- top[0] = h->left_border_y[8];
- break;
- case 3:
- *left = &h->intern_border_y[8];
- for(i=0;i<8;i++)
- h->intern_border_y[i+9] = *(h->cy + 7 + (i+8)*h->l_stride);
- memset(&h->intern_border_y[17],h->intern_border_y[16],9);
- memcpy(&top[0],h->cy + 7 + 7*h->l_stride,9);
- memset(&top[9],top[8],9);
- break;
- }
-}
-
-static void intra_pred_vert(uint8_t *d,uint8_t *top,uint8_t *left,int stride) {
- int y;
- uint64_t a = unaligned64(&top[1]);
- for(y=0;y<8;y++) {
- *((uint64_t *)(d+y*stride)) = a;
- }
-}
-
-static void intra_pred_horiz(uint8_t *d,uint8_t *top,uint8_t *left,int stride) {
- int y;
- uint64_t a;
- for(y=0;y<8;y++) {
- a = left[y+1] * 0x0101010101010101ULL;
- *((uint64_t *)(d+y*stride)) = a;
- }
-}
-
-static void intra_pred_dc_128(uint8_t *d,uint8_t *top,uint8_t *left,int stride) {
- int y;
- uint64_t a = 0x8080808080808080ULL;
- for(y=0;y<8;y++)
- *((uint64_t *)(d+y*stride)) = a;
-}
-
-static void intra_pred_plane(uint8_t *d,uint8_t *top,uint8_t *left,int stride) {
- int x,y,ia;
- int ih = 0;
- int iv = 0;
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-
- for(x=0; x<4; x++) {
- ih += (x+1)*(top[5+x]-top[3-x]);
- iv += (x+1)*(left[5+x]-left[3-x]);
- }
- ia = (top[8]+left[8])<<4;
- ih = (17*ih+16)>>5;
- iv = (17*iv+16)>>5;
- for(y=0; y<8; y++)
- for(x=0; x<8; x++)
- d[y*stride+x] = cm[(ia+(x-3)*ih+(y-3)*iv+16)>>5];
-}
-
-#define LOWPASS(ARRAY,INDEX) \
- (( ARRAY[(INDEX)-1] + 2*ARRAY[(INDEX)] + ARRAY[(INDEX)+1] + 2) >> 2)
-
-static void intra_pred_lp(uint8_t *d,uint8_t *top,uint8_t *left,int stride) {
- int x,y;
- for(y=0; y<8; y++)
- for(x=0; x<8; x++)
- d[y*stride+x] = (LOWPASS(top,x+1) + LOWPASS(left,y+1)) >> 1;
-}
-
-static void intra_pred_down_left(uint8_t *d,uint8_t *top,uint8_t *left,int stride) {
- int x,y;
- for(y=0; y<8; y++)
- for(x=0; x<8; x++)
- d[y*stride+x] = (LOWPASS(top,x+y+2) + LOWPASS(left,x+y+2)) >> 1;
-}
-
-static void intra_pred_down_right(uint8_t *d,uint8_t *top,uint8_t *left,int stride) {
- int x,y;
- for(y=0; y<8; y++)
- for(x=0; x<8; x++)
- if(x==y)
- d[y*stride+x] = (left[1]+2*top[0]+top[1]+2)>>2;
- else if(x>y)
- d[y*stride+x] = LOWPASS(top,x-y);
- else
- d[y*stride+x] = LOWPASS(left,y-x);
-}
-
-static void intra_pred_lp_left(uint8_t *d,uint8_t *top,uint8_t *left,int stride) {
- int x,y;
- for(y=0; y<8; y++)
- for(x=0; x<8; x++)
- d[y*stride+x] = LOWPASS(left,y+1);
-}
-
-static void intra_pred_lp_top(uint8_t *d,uint8_t *top,uint8_t *left,int stride) {
- int x,y;
- for(y=0; y<8; y++)
- for(x=0; x<8; x++)
- d[y*stride+x] = LOWPASS(top,x+1);
-}
-
-#undef LOWPASS
-
-static inline void modify_pred(const int_fast8_t *mod_table, int *mode) {
- *mode = mod_table[*mode];
- if(*mode < 0) {
- av_log(NULL, AV_LOG_ERROR, "Illegal intra prediction mode\n");
- *mode = 0;
- }
-}
-
-/*****************************************************************************
- *
- * motion compensation
- *
- ****************************************************************************/
-
-static inline void mc_dir_part(AVSContext *h,Picture *pic,int square,
- int chroma_height,int delta,int list,uint8_t *dest_y,
- uint8_t *dest_cb,uint8_t *dest_cr,int src_x_offset,
- int src_y_offset,qpel_mc_func *qpix_op,
- h264_chroma_mc_func chroma_op,vector_t *mv){
- MpegEncContext * const s = &h->s;
- const int mx= mv->x + src_x_offset*8;
- const int my= mv->y + src_y_offset*8;
- const int luma_xy= (mx&3) + ((my&3)<<2);
- uint8_t * src_y = pic->data[0] + (mx>>2) + (my>>2)*h->l_stride;
- uint8_t * src_cb= pic->data[1] + (mx>>3) + (my>>3)*h->c_stride;
- uint8_t * src_cr= pic->data[2] + (mx>>3) + (my>>3)*h->c_stride;
- int extra_width= 0; //(s->flags&CODEC_FLAG_EMU_EDGE) ? 0 : 16;
- int extra_height= extra_width;
- int emu=0;
- const int full_mx= mx>>2;
- const int full_my= my>>2;
- const int pic_width = 16*h->mb_width;
- const int pic_height = 16*h->mb_height;
-
- if(!pic->data[0])
- return;
- if(mx&7) extra_width -= 3;
- if(my&7) extra_height -= 3;
-
- if( full_mx < 0-extra_width
- || full_my < 0-extra_height
- || full_mx + 16/*FIXME*/ > pic_width + extra_width
- || full_my + 16/*FIXME*/ > pic_height + extra_height){
- ff_emulated_edge_mc(s->edge_emu_buffer, src_y - 2 - 2*h->l_stride, h->l_stride,
- 16+5, 16+5/*FIXME*/, full_mx-2, full_my-2, pic_width, pic_height);
- src_y= s->edge_emu_buffer + 2 + 2*h->l_stride;
- emu=1;
- }
-
- qpix_op[luma_xy](dest_y, src_y, h->l_stride); //FIXME try variable height perhaps?
- if(!square){
- qpix_op[luma_xy](dest_y + delta, src_y + delta, h->l_stride);
- }
-
- if(emu){
- ff_emulated_edge_mc(s->edge_emu_buffer, src_cb, h->c_stride,
- 9, 9/*FIXME*/, (mx>>3), (my>>3), pic_width>>1, pic_height>>1);
- src_cb= s->edge_emu_buffer;
- }
- chroma_op(dest_cb, src_cb, h->c_stride, chroma_height, mx&7, my&7);
-
- if(emu){
- ff_emulated_edge_mc(s->edge_emu_buffer, src_cr, h->c_stride,
- 9, 9/*FIXME*/, (mx>>3), (my>>3), pic_width>>1, pic_height>>1);
- src_cr= s->edge_emu_buffer;
- }
- chroma_op(dest_cr, src_cr, h->c_stride, chroma_height, mx&7, my&7);
-}
-
-static inline void mc_part_std(AVSContext *h,int square,int chroma_height,int delta,
- uint8_t *dest_y,uint8_t *dest_cb,uint8_t *dest_cr,
- int x_offset, int y_offset,qpel_mc_func *qpix_put,
- h264_chroma_mc_func chroma_put,qpel_mc_func *qpix_avg,
- h264_chroma_mc_func chroma_avg, vector_t *mv){
- qpel_mc_func *qpix_op= qpix_put;
- h264_chroma_mc_func chroma_op= chroma_put;
-
- dest_y += 2*x_offset + 2*y_offset*h->l_stride;
- dest_cb += x_offset + y_offset*h->c_stride;
- dest_cr += x_offset + y_offset*h->c_stride;
- x_offset += 8*h->mbx;
- y_offset += 8*h->mby;
-
- if(mv->ref >= 0){
- Picture *ref= &h->DPB[mv->ref];
- mc_dir_part(h, ref, square, chroma_height, delta, 0,
- dest_y, dest_cb, dest_cr, x_offset, y_offset,
- qpix_op, chroma_op, mv);
-
- qpix_op= qpix_avg;
- chroma_op= chroma_avg;
- }
-
- if((mv+MV_BWD_OFFS)->ref >= 0){
- Picture *ref= &h->DPB[0];
- mc_dir_part(h, ref, square, chroma_height, delta, 1,
- dest_y, dest_cb, dest_cr, x_offset, y_offset,
- qpix_op, chroma_op, mv+MV_BWD_OFFS);
- }
-}
-
-static void inter_pred(AVSContext *h, enum mb_t mb_type) {
- if(partition_flags[mb_type] == 0){ // 16x16
- mc_part_std(h, 1, 8, 0, h->cy, h->cu, h->cv, 0, 0,
- h->s.dsp.put_cavs_qpel_pixels_tab[0],
- h->s.dsp.put_h264_chroma_pixels_tab[0],
- h->s.dsp.avg_cavs_qpel_pixels_tab[0],
- h->s.dsp.avg_h264_chroma_pixels_tab[0],&h->mv[MV_FWD_X0]);
- }else{
- mc_part_std(h, 1, 4, 0, h->cy, h->cu, h->cv, 0, 0,
- h->s.dsp.put_cavs_qpel_pixels_tab[1],
- h->s.dsp.put_h264_chroma_pixels_tab[1],
- h->s.dsp.avg_cavs_qpel_pixels_tab[1],
- h->s.dsp.avg_h264_chroma_pixels_tab[1],&h->mv[MV_FWD_X0]);
- mc_part_std(h, 1, 4, 0, h->cy, h->cu, h->cv, 4, 0,
- h->s.dsp.put_cavs_qpel_pixels_tab[1],
- h->s.dsp.put_h264_chroma_pixels_tab[1],
- h->s.dsp.avg_cavs_qpel_pixels_tab[1],
- h->s.dsp.avg_h264_chroma_pixels_tab[1],&h->mv[MV_FWD_X1]);
- mc_part_std(h, 1, 4, 0, h->cy, h->cu, h->cv, 0, 4,
- h->s.dsp.put_cavs_qpel_pixels_tab[1],
- h->s.dsp.put_h264_chroma_pixels_tab[1],
- h->s.dsp.avg_cavs_qpel_pixels_tab[1],
- h->s.dsp.avg_h264_chroma_pixels_tab[1],&h->mv[MV_FWD_X2]);
- mc_part_std(h, 1, 4, 0, h->cy, h->cu, h->cv, 4, 4,
- h->s.dsp.put_cavs_qpel_pixels_tab[1],
- h->s.dsp.put_h264_chroma_pixels_tab[1],
- h->s.dsp.avg_cavs_qpel_pixels_tab[1],
- h->s.dsp.avg_h264_chroma_pixels_tab[1],&h->mv[MV_FWD_X3]);
- }
- /* set intra prediction modes to default values */
- h->pred_mode_Y[3] = h->pred_mode_Y[6] = INTRA_L_LP;
- h->top_pred_Y[h->mbx*2+0] = h->top_pred_Y[h->mbx*2+1] = INTRA_L_LP;
-}
-
-/*****************************************************************************
- *
- * motion vector prediction
- *
- ****************************************************************************/
-
-static inline void set_mvs(vector_t *mv, enum block_t size) {
- switch(size) {
- case BLK_16X16:
- mv[MV_STRIDE ] = mv[0];
- mv[MV_STRIDE+1] = mv[0];
- case BLK_16X8:
- mv[1] = mv[0];
- break;
- case BLK_8X16:
- mv[MV_STRIDE] = mv[0];
- break;
- }
-}
-
-static inline void store_mvs(AVSContext *h) {
- h->col_mv[(h->mby*h->mb_width + h->mbx)*4 + 0] = h->mv[MV_FWD_X0];
- h->col_mv[(h->mby*h->mb_width + h->mbx)*4 + 1] = h->mv[MV_FWD_X1];
- h->col_mv[(h->mby*h->mb_width + h->mbx)*4 + 2] = h->mv[MV_FWD_X2];
- h->col_mv[(h->mby*h->mb_width + h->mbx)*4 + 3] = h->mv[MV_FWD_X3];
-}
-
-static inline void scale_mv(AVSContext *h, int *d_x, int *d_y, vector_t *src, int distp) {
- int den = h->scale_den[src->ref];
-
- *d_x = (src->x*distp*den + 256 + (src->x>>31)) >> 9;
- *d_y = (src->y*distp*den + 256 + (src->y>>31)) >> 9;
-}
-
-static inline void mv_pred_median(AVSContext *h, vector_t *mvP, vector_t *mvA, vector_t *mvB, vector_t *mvC) {
- int ax, ay, bx, by, cx, cy;
- int len_ab, len_bc, len_ca, len_mid;
-
- /* scale candidates according to their temporal span */
- scale_mv(h, &ax, &ay, mvA, mvP->dist);
- scale_mv(h, &bx, &by, mvB, mvP->dist);
- scale_mv(h, &cx, &cy, mvC, mvP->dist);
- /* find the geometrical median of the three candidates */
- len_ab = abs(ax - bx) + abs(ay - by);
- len_bc = abs(bx - cx) + abs(by - cy);
- len_ca = abs(cx - ax) + abs(cy - ay);
- len_mid = mid_pred(len_ab, len_bc, len_ca);
- if(len_mid == len_ab) {
- mvP->x = cx;
- mvP->y = cy;
- } else if(len_mid == len_bc) {
- mvP->x = ax;
- mvP->y = ay;
- } else {
- mvP->x = bx;
- mvP->y = by;
- }
-}
-
-static inline void mv_pred_direct(AVSContext *h, vector_t *pmv_fw,
- vector_t *col_mv) {
- vector_t *pmv_bw = pmv_fw + MV_BWD_OFFS;
- int den = h->direct_den[col_mv->ref];
- int m = col_mv->x >> 31;
-
- pmv_fw->dist = h->dist[1];
- pmv_bw->dist = h->dist[0];
- pmv_fw->ref = 1;
- pmv_bw->ref = 0;
- /* scale the co-located motion vector according to its temporal span */
- pmv_fw->x = (((den+(den*col_mv->x*pmv_fw->dist^m)-m-1)>>14)^m)-m;
- pmv_bw->x = m-(((den+(den*col_mv->x*pmv_bw->dist^m)-m-1)>>14)^m);
- m = col_mv->y >> 31;
- pmv_fw->y = (((den+(den*col_mv->y*pmv_fw->dist^m)-m-1)>>14)^m)-m;
- pmv_bw->y = m-(((den+(den*col_mv->y*pmv_bw->dist^m)-m-1)>>14)^m);
-}
-
-static inline void mv_pred_sym(AVSContext *h, vector_t *src, enum block_t size) {
- vector_t *dst = src + MV_BWD_OFFS;
-
- /* backward mv is the scaled and negated forward mv */
- dst->x = -((src->x * h->sym_factor + 256) >> 9);
- dst->y = -((src->y * h->sym_factor + 256) >> 9);
- dst->ref = 0;
- dst->dist = h->dist[0];
- set_mvs(dst, size);
-}
-
-static void mv_pred(AVSContext *h, enum mv_loc_t nP, enum mv_loc_t nC,
- enum mv_pred_t mode, enum block_t size, int ref) {
- vector_t *mvP = &h->mv[nP];
- vector_t *mvA = &h->mv[nP-1];
- vector_t *mvB = &h->mv[nP-4];
- vector_t *mvC = &h->mv[nC];
- const vector_t *mvP2 = NULL;
-
- mvP->ref = ref;
- mvP->dist = h->dist[mvP->ref];
- if(mvC->ref == NOT_AVAIL)
- mvC = &h->mv[nP-5]; // set to top-left (mvD)
- if((mode == MV_PRED_PSKIP) &&
- ((mvA->ref == NOT_AVAIL) || (mvB->ref == NOT_AVAIL) ||
- ((mvA->x | mvA->y | mvA->ref) == 0) ||
- ((mvB->x | mvB->y | mvB->ref) == 0) )) {
- mvP2 = &un_mv;
- /* if there is only one suitable candidate, take it */
- } else if((mvA->ref >= 0) && (mvB->ref < 0) && (mvC->ref < 0)) {
- mvP2= mvA;
- } else if((mvA->ref < 0) && (mvB->ref >= 0) && (mvC->ref < 0)) {
- mvP2= mvB;
- } else if((mvA->ref < 0) && (mvB->ref < 0) && (mvC->ref >= 0)) {
- mvP2= mvC;
- } else if(mode == MV_PRED_LEFT && mvA->ref == ref){
- mvP2= mvA;
- } else if(mode == MV_PRED_TOP && mvB->ref == ref){
- mvP2= mvB;
- } else if(mode == MV_PRED_TOPRIGHT && mvC->ref == ref){
- mvP2= mvC;
- }
- if(mvP2){
- mvP->x = mvP2->x;
- mvP->y = mvP2->y;
- }else
- mv_pred_median(h, mvP, mvA, mvB, mvC);
-
- if(mode < MV_PRED_PSKIP) {
- mvP->x += get_se_golomb(&h->s.gb);
- mvP->y += get_se_golomb(&h->s.gb);
- }
- set_mvs(mvP,size);
-}
-
-/*****************************************************************************
- *
- * residual data decoding
- *
- ****************************************************************************/
-
-/** kth-order exponential golomb code */
-static inline int get_ue_code(GetBitContext *gb, int order) {
- if(order) {
- int ret = get_ue_golomb(gb) << order;
- return ret + get_bits(gb,order);
- }
- return get_ue_golomb(gb);
-}
-
-/**
- * decode coefficients from one 8x8 block, dequantize, inverse transform
- * and add them to sample block
- * @param r pointer to 2D VLC table
- * @param esc_golomb_order escape codes are k-golomb with this order k
- * @param qp quantizer
- * @param dst location of sample block
- * @param stride line stride in frame buffer
- */
-static int decode_residual_block(AVSContext *h, GetBitContext *gb,
- const residual_vlc_t *r, int esc_golomb_order,
- int qp, uint8_t *dst, int stride) {
- int i,pos = -1;
- int level_code, esc_code, level, run, mask;
- int level_buf[64];
- int run_buf[64];
- int dqm = dequant_mul[qp];
- int dqs = dequant_shift[qp];
- int dqa = 1 << (dqs - 1);
- const uint8_t *scantab = h->scantable.permutated;
- DCTELEM *block = h->block;
-
- for(i=0;i<65;i++) {
- level_code = get_ue_code(gb,r->golomb_order);
- if(level_code >= ESCAPE_CODE) {
- run = ((level_code - ESCAPE_CODE) >> 1) + 1;
- esc_code = get_ue_code(gb,esc_golomb_order);
- level = esc_code + (run > r->max_run ? 1 : r->level_add[run]);
- while(level > r->inc_limit)
- r++;
- mask = -(level_code & 1);
- level = (level^mask) - mask;
- } else {
- level = r->rltab[level_code][0];
- if(!level) //end of block signal
- break;
- run = r->rltab[level_code][1];
- r += r->rltab[level_code][2];
- }
- level_buf[i] = level;
- run_buf[i] = run;
- }
- /* inverse scan and dequantization */
- while(--i >= 0){
- pos += run_buf[i];
- if(pos > 63) {
- av_log(h->s.avctx, AV_LOG_ERROR,
- "position out of block bounds at pic %d MB(%d,%d)\n",
- h->picture.poc, h->mbx, h->mby);
- return -1;
- }
- block[scantab[pos]] = (level_buf[i]*dqm + dqa) >> dqs;
- }
- h->s.dsp.cavs_idct8_add(dst,block,stride);
- return 0;
-}
-
-
-static inline void decode_residual_chroma(AVSContext *h) {
- if(h->cbp & (1<<4))
- decode_residual_block(h,&h->s.gb,chroma_2dvlc,0, chroma_qp[h->qp],
- h->cu,h->c_stride);
- if(h->cbp & (1<<5))
- decode_residual_block(h,&h->s.gb,chroma_2dvlc,0, chroma_qp[h->qp],
- h->cv,h->c_stride);
-}
-
-static inline int decode_residual_inter(AVSContext *h) {
- int block;
-
- /* get coded block pattern */
- int cbp= get_ue_golomb(&h->s.gb);
- if(cbp > 63){
- av_log(h->s.avctx, AV_LOG_ERROR, "illegal inter cbp\n");
- return -1;
- }
- h->cbp = cbp_tab[cbp][1];
-
- /* get quantizer */
- if(h->cbp && !h->qp_fixed)
- h->qp = (h->qp + get_se_golomb(&h->s.gb)) & 63;
- for(block=0;block<4;block++)
- if(h->cbp & (1<<block))
- decode_residual_block(h,&h->s.gb,inter_2dvlc,0,h->qp,
- h->cy + h->luma_scan[block], h->l_stride);
- decode_residual_chroma(h);
-
- return 0;
-}
-
-/*****************************************************************************
- *
- * macroblock level
- *
- ****************************************************************************/
-
-/**
- * initialise predictors for motion vectors and intra prediction
- */
-static inline void init_mb(AVSContext *h) {
- int i;
-
- /* copy predictors from top line (MB B and C) into cache */
- for(i=0;i<3;i++) {
- h->mv[MV_FWD_B2+i] = h->top_mv[0][h->mbx*2+i];
- h->mv[MV_BWD_B2+i] = h->top_mv[1][h->mbx*2+i];
- }
- h->pred_mode_Y[1] = h->top_pred_Y[h->mbx*2+0];
- h->pred_mode_Y[2] = h->top_pred_Y[h->mbx*2+1];
- /* clear top predictors if MB B is not available */
- if(!(h->flags & B_AVAIL)) {
- h->mv[MV_FWD_B2] = un_mv;
- h->mv[MV_FWD_B3] = un_mv;
- h->mv[MV_BWD_B2] = un_mv;
- h->mv[MV_BWD_B3] = un_mv;
- h->pred_mode_Y[1] = h->pred_mode_Y[2] = NOT_AVAIL;
- h->flags &= ~(C_AVAIL|D_AVAIL);
- } else if(h->mbx) {
- h->flags |= D_AVAIL;
- }
- if(h->mbx == h->mb_width-1) //MB C not available
- h->flags &= ~C_AVAIL;
- /* clear top-right predictors if MB C is not available */
- if(!(h->flags & C_AVAIL)) {
- h->mv[MV_FWD_C2] = un_mv;
- h->mv[MV_BWD_C2] = un_mv;
- }
- /* clear top-left predictors if MB D is not available */
- if(!(h->flags & D_AVAIL)) {
- h->mv[MV_FWD_D3] = un_mv;
- h->mv[MV_BWD_D3] = un_mv;
- }
- /* set pointer for co-located macroblock type */
- h->col_type = &h->col_type_base[h->mby*h->mb_width + h->mbx];
-}
-
-static inline void check_for_slice(AVSContext *h);
-
-/**
- * save predictors for later macroblocks and increase
- * macroblock address
- * @returns 0 if end of frame is reached, 1 otherwise
- */
-static inline int next_mb(AVSContext *h) {
- int i;
-
- h->flags |= A_AVAIL;
- h->cy += 16;
- h->cu += 8;
- h->cv += 8;
- /* copy mvs as predictors to the left */
- for(i=0;i<=20;i+=4)
- h->mv[i] = h->mv[i+2];
- /* copy bottom mvs from cache to top line */
- h->top_mv[0][h->mbx*2+0] = h->mv[MV_FWD_X2];
- h->top_mv[0][h->mbx*2+1] = h->mv[MV_FWD_X3];
- h->top_mv[1][h->mbx*2+0] = h->mv[MV_BWD_X2];
- h->top_mv[1][h->mbx*2+1] = h->mv[MV_BWD_X3];
- /* next MB address */
- h->mbx++;
- if(h->mbx == h->mb_width) { //new mb line
- h->flags = B_AVAIL|C_AVAIL;
- /* clear left pred_modes */
- h->pred_mode_Y[3] = h->pred_mode_Y[6] = NOT_AVAIL;
- /* clear left mv predictors */
- for(i=0;i<=20;i+=4)
- h->mv[i] = un_mv;
- h->mbx = 0;
- h->mby++;
- /* re-calculate sample pointers */
- h->cy = h->picture.data[0] + h->mby*16*h->l_stride;
- h->cu = h->picture.data[1] + h->mby*8*h->c_stride;
- h->cv = h->picture.data[2] + h->mby*8*h->c_stride;
- if(h->mby == h->mb_height) { //frame end
- return 0;
- } else {
- //check_for_slice(h);
- }
- }
- return 1;
-}
-
-static int decode_mb_i(AVSContext *h, int cbp_code) {
- GetBitContext *gb = &h->s.gb;
- int block, pred_mode_uv;
- uint8_t top[18];
- uint8_t *left = NULL;
- uint8_t *d;
-
- init_mb(h);
-
- /* get intra prediction modes from stream */
- for(block=0;block<4;block++) {
- int nA,nB,predpred;
- int pos = scan3x3[block];
-
- nA = h->pred_mode_Y[pos-1];
- nB = h->pred_mode_Y[pos-3];
- predpred = FFMIN(nA,nB);
- if(predpred == NOT_AVAIL) // if either is not available
- predpred = INTRA_L_LP;
- if(!get_bits1(gb)){
- int rem_mode= get_bits(gb, 2);
- predpred = rem_mode + (rem_mode >= predpred);
- }
- h->pred_mode_Y[pos] = predpred;
- }
- pred_mode_uv = get_ue_golomb(gb);
- if(pred_mode_uv > 6) {
- av_log(h->s.avctx, AV_LOG_ERROR, "illegal intra chroma pred mode\n");
- return -1;
- }
-
- /* save pred modes before they get modified */
- h->pred_mode_Y[3] = h->pred_mode_Y[5];
- h->pred_mode_Y[6] = h->pred_mode_Y[8];
- h->top_pred_Y[h->mbx*2+0] = h->pred_mode_Y[7];
- h->top_pred_Y[h->mbx*2+1] = h->pred_mode_Y[8];
-
- /* modify pred modes according to availability of neighbour samples */
- if(!(h->flags & A_AVAIL)) {
- modify_pred(left_modifier_l, &h->pred_mode_Y[4] );
- modify_pred(left_modifier_l, &h->pred_mode_Y[7] );
- modify_pred(left_modifier_c, &pred_mode_uv );
- }
- if(!(h->flags & B_AVAIL)) {
- modify_pred(top_modifier_l, &h->pred_mode_Y[4] );
- modify_pred(top_modifier_l, &h->pred_mode_Y[5] );
- modify_pred(top_modifier_c, &pred_mode_uv );
- }
-
- /* get coded block pattern */
- if(h->pic_type == FF_I_TYPE)
- cbp_code = get_ue_golomb(gb);
- if(cbp_code > 63){
- av_log(h->s.avctx, AV_LOG_ERROR, "illegal intra cbp\n");
- return -1;
- }
- h->cbp = cbp_tab[cbp_code][0];
- if(h->cbp && !h->qp_fixed)
- h->qp = (h->qp + get_se_golomb(gb)) & 63; //qp_delta
-
- /* luma intra prediction interleaved with residual decode/transform/add */
- for(block=0;block<4;block++) {
- d = h->cy + h->luma_scan[block];
- load_intra_pred_luma(h, top, &left, block);
- h->intra_pred_l[h->pred_mode_Y[scan3x3[block]]]
- (d, top, left, h->l_stride);
- if(h->cbp & (1<<block))
- decode_residual_block(h,gb,intra_2dvlc,1,h->qp,d,h->l_stride);
- }
-
- /* chroma intra prediction */
- /* extend borders by one pixel */
- h->left_border_u[9] = h->left_border_u[8];
- h->left_border_v[9] = h->left_border_v[8];
- h->top_border_u[h->mbx*10+9] = h->top_border_u[h->mbx*10+8];
- h->top_border_v[h->mbx*10+9] = h->top_border_v[h->mbx*10+8];
- if(h->mbx && h->mby) {
- h->top_border_u[h->mbx*10] = h->left_border_u[0] = h->topleft_border_u;
- h->top_border_v[h->mbx*10] = h->left_border_v[0] = h->topleft_border_v;
- } else {
- h->left_border_u[0] = h->left_border_u[1];
- h->left_border_v[0] = h->left_border_v[1];
- h->top_border_u[h->mbx*10] = h->top_border_u[h->mbx*10+1];
- h->top_border_v[h->mbx*10] = h->top_border_v[h->mbx*10+1];
- }
- h->intra_pred_c[pred_mode_uv](h->cu, &h->top_border_u[h->mbx*10],
- h->left_border_u, h->c_stride);
- h->intra_pred_c[pred_mode_uv](h->cv, &h->top_border_v[h->mbx*10],
- h->left_border_v, h->c_stride);
-
- decode_residual_chroma(h);
- filter_mb(h,I_8X8);
-
- /* mark motion vectors as intra */
- h->mv[MV_FWD_X0] = intra_mv;
- set_mvs(&h->mv[MV_FWD_X0], BLK_16X16);
- h->mv[MV_BWD_X0] = intra_mv;
- set_mvs(&h->mv[MV_BWD_X0], BLK_16X16);
- if(h->pic_type != FF_B_TYPE)
- *h->col_type = I_8X8;
-
- return 0;
-}
-
-static void decode_mb_p(AVSContext *h, enum mb_t mb_type) {
- GetBitContext *gb = &h->s.gb;
- int ref[4];
-
- init_mb(h);
- switch(mb_type) {
- case P_SKIP:
- mv_pred(h, MV_FWD_X0, MV_FWD_C2, MV_PRED_PSKIP, BLK_16X16, 0);
- break;
- case P_16X16:
- ref[0] = h->ref_flag ? 0 : get_bits1(gb);
- mv_pred(h, MV_FWD_X0, MV_FWD_C2, MV_PRED_MEDIAN, BLK_16X16,ref[0]);
- break;
- case P_16X8:
- ref[0] = h->ref_flag ? 0 : get_bits1(gb);
- ref[2] = h->ref_flag ? 0 : get_bits1(gb);
- mv_pred(h, MV_FWD_X0, MV_FWD_C2, MV_PRED_TOP, BLK_16X8, ref[0]);
- mv_pred(h, MV_FWD_X2, MV_FWD_A1, MV_PRED_LEFT, BLK_16X8, ref[2]);
- break;
- case P_8X16:
- ref[0] = h->ref_flag ? 0 : get_bits1(gb);
- ref[1] = h->ref_flag ? 0 : get_bits1(gb);
- mv_pred(h, MV_FWD_X0, MV_FWD_B3, MV_PRED_LEFT, BLK_8X16, ref[0]);
- mv_pred(h, MV_FWD_X1, MV_FWD_C2, MV_PRED_TOPRIGHT, BLK_8X16, ref[1]);
- break;
- case P_8X8:
- ref[0] = h->ref_flag ? 0 : get_bits1(gb);
- ref[1] = h->ref_flag ? 0 : get_bits1(gb);
- ref[2] = h->ref_flag ? 0 : get_bits1(gb);
- ref[3] = h->ref_flag ? 0 : get_bits1(gb);
- mv_pred(h, MV_FWD_X0, MV_FWD_B3, MV_PRED_MEDIAN, BLK_8X8, ref[0]);
- mv_pred(h, MV_FWD_X1, MV_FWD_C2, MV_PRED_MEDIAN, BLK_8X8, ref[1]);
- mv_pred(h, MV_FWD_X2, MV_FWD_X1, MV_PRED_MEDIAN, BLK_8X8, ref[2]);
- mv_pred(h, MV_FWD_X3, MV_FWD_X0, MV_PRED_MEDIAN, BLK_8X8, ref[3]);
- }
- inter_pred(h, mb_type);
- store_mvs(h);
- if(mb_type != P_SKIP)
- decode_residual_inter(h);
- filter_mb(h,mb_type);
- *h->col_type = mb_type;
-}
-
-static void decode_mb_b(AVSContext *h, enum mb_t mb_type) {
- int block;
- enum sub_mb_t sub_type[4];
- int flags;
-
- init_mb(h);
-
- /* reset all MVs */
- h->mv[MV_FWD_X0] = dir_mv;
- set_mvs(&h->mv[MV_FWD_X0], BLK_16X16);
- h->mv[MV_BWD_X0] = dir_mv;
- set_mvs(&h->mv[MV_BWD_X0], BLK_16X16);
- switch(mb_type) {
- case B_SKIP:
- case B_DIRECT:
- if(!(*h->col_type)) {
- /* intra MB at co-location, do in-plane prediction */
- mv_pred(h, MV_FWD_X0, MV_FWD_C2, MV_PRED_BSKIP, BLK_16X16, 1);
- mv_pred(h, MV_BWD_X0, MV_BWD_C2, MV_PRED_BSKIP, BLK_16X16, 0);
- } else
- /* direct prediction from co-located P MB, block-wise */
- for(block=0;block<4;block++)
- mv_pred_direct(h,&h->mv[mv_scan[block]],
- &h->col_mv[(h->mby*h->mb_width+h->mbx)*4 + block]);
- break;
- case B_FWD_16X16:
- mv_pred(h, MV_FWD_X0, MV_FWD_C2, MV_PRED_MEDIAN, BLK_16X16, 1);
- break;
- case B_SYM_16X16:
- mv_pred(h, MV_FWD_X0, MV_FWD_C2, MV_PRED_MEDIAN, BLK_16X16, 1);
- mv_pred_sym(h, &h->mv[MV_FWD_X0], BLK_16X16);
- break;
- case B_BWD_16X16:
- mv_pred(h, MV_BWD_X0, MV_BWD_C2, MV_PRED_MEDIAN, BLK_16X16, 0);
- break;
- case B_8X8:
- for(block=0;block<4;block++)
- sub_type[block] = get_bits(&h->s.gb,2);
- for(block=0;block<4;block++) {
- switch(sub_type[block]) {
- case B_SUB_DIRECT:
- if(!(*h->col_type)) {
- /* intra MB at co-location, do in-plane prediction */
- mv_pred(h, mv_scan[block], mv_scan[block]-3,
- MV_PRED_BSKIP, BLK_8X8, 1);
- mv_pred(h, mv_scan[block]+MV_BWD_OFFS,
- mv_scan[block]-3+MV_BWD_OFFS,
- MV_PRED_BSKIP, BLK_8X8, 0);
- } else
- mv_pred_direct(h,&h->mv[mv_scan[block]],
- &h->col_mv[(h->mby*h->mb_width + h->mbx)*4 + block]);
- break;
- case B_SUB_FWD:
- mv_pred(h, mv_scan[block], mv_scan[block]-3,
- MV_PRED_MEDIAN, BLK_8X8, 1);
- break;
- case B_SUB_SYM:
- mv_pred(h, mv_scan[block], mv_scan[block]-3,
- MV_PRED_MEDIAN, BLK_8X8, 1);
- mv_pred_sym(h, &h->mv[mv_scan[block]], BLK_8X8);
- break;
- }
- }
- for(block=0;block<4;block++) {
- if(sub_type[block] == B_SUB_BWD)
- mv_pred(h, mv_scan[block]+MV_BWD_OFFS,
- mv_scan[block]+MV_BWD_OFFS-3,
- MV_PRED_MEDIAN, BLK_8X8, 0);
- }
- break;
- default:
- assert((mb_type > B_SYM_16X16) && (mb_type < B_8X8));
- flags = partition_flags[mb_type];
- if(mb_type & 1) { /* 16x8 macroblock types */
- if(flags & FWD0)
- mv_pred(h, MV_FWD_X0, MV_FWD_C2, MV_PRED_TOP, BLK_16X8, 1);
- if(flags & SYM0)
- mv_pred_sym(h, &h->mv[MV_FWD_X0], BLK_16X8);
- if(flags & FWD1)
- mv_pred(h, MV_FWD_X2, MV_FWD_A1, MV_PRED_LEFT, BLK_16X8, 1);
- if(flags & SYM1)
- mv_pred_sym(h, &h->mv[MV_FWD_X2], BLK_16X8);
- if(flags & BWD0)
- mv_pred(h, MV_BWD_X0, MV_BWD_C2, MV_PRED_TOP, BLK_16X8, 0);
- if(flags & BWD1)
- mv_pred(h, MV_BWD_X2, MV_BWD_A1, MV_PRED_LEFT, BLK_16X8, 0);
- } else { /* 8x16 macroblock types */
- if(flags & FWD0)
- mv_pred(h, MV_FWD_X0, MV_FWD_B3, MV_PRED_LEFT, BLK_8X16, 1);
- if(flags & SYM0)
- mv_pred_sym(h, &h->mv[MV_FWD_X0], BLK_8X16);
- if(flags & FWD1)
- mv_pred(h, MV_FWD_X1, MV_FWD_C2, MV_PRED_TOPRIGHT,BLK_8X16, 1);
- if(flags & SYM1)
- mv_pred_sym(h, &h->mv[MV_FWD_X1], BLK_8X16);
- if(flags & BWD0)
- mv_pred(h, MV_BWD_X0, MV_BWD_B3, MV_PRED_LEFT, BLK_8X16, 0);
- if(flags & BWD1)
- mv_pred(h, MV_BWD_X1, MV_BWD_C2, MV_PRED_TOPRIGHT,BLK_8X16, 0);
- }
- }
- inter_pred(h, mb_type);
- if(mb_type != B_SKIP)
- decode_residual_inter(h);
- filter_mb(h,mb_type);
-}
-
-/*****************************************************************************
- *
- * slice level
- *
- ****************************************************************************/
-
-static inline int decode_slice_header(AVSContext *h, GetBitContext *gb) {
- if(h->stc > 0xAF)
- av_log(h->s.avctx, AV_LOG_ERROR, "unexpected start code 0x%02x\n", h->stc);
- h->mby = h->stc;
- if((h->mby == 0) && (!h->qp_fixed)){
- h->qp_fixed = get_bits1(gb);
- h->qp = get_bits(gb,6);
- }
- /* inter frame or second slice can have weighting params */
- if((h->pic_type != FF_I_TYPE) || (!h->pic_structure && h->mby >= h->mb_width/2))
- if(get_bits1(gb)) { //slice_weighting_flag
- av_log(h->s.avctx, AV_LOG_ERROR,
- "weighted prediction not yet supported\n");
- }
- return 0;
-}
-
-static inline void check_for_slice(AVSContext *h) {
- GetBitContext *gb = &h->s.gb;
- int align;
- align = (-get_bits_count(gb)) & 7;
- if((show_bits_long(gb,24+align) & 0xFFFFFF) == 0x000001) {
- get_bits_long(gb,24+align);
- h->stc = get_bits(gb,8);
- decode_slice_header(h,gb);
- }
-}
-
-/*****************************************************************************
- *
- * frame level
- *
- ****************************************************************************/
-
-static void init_pic(AVSContext *h) {
- int i;
-
- /* clear some predictors */
- for(i=0;i<=20;i+=4)
- h->mv[i] = un_mv;
- h->mv[MV_BWD_X0] = dir_mv;
- set_mvs(&h->mv[MV_BWD_X0], BLK_16X16);
- h->mv[MV_FWD_X0] = dir_mv;
- set_mvs(&h->mv[MV_FWD_X0], BLK_16X16);
- h->pred_mode_Y[3] = h->pred_mode_Y[6] = NOT_AVAIL;
- h->cy = h->picture.data[0];
- h->cu = h->picture.data[1];
- h->cv = h->picture.data[2];
- h->l_stride = h->picture.linesize[0];
- h->c_stride = h->picture.linesize[1];
- h->luma_scan[2] = 8*h->l_stride;
- h->luma_scan[3] = 8*h->l_stride+8;
- h->mbx = h->mby = 0;
- h->flags = 0;
-}
-
-static int decode_pic(AVSContext *h) {
- MpegEncContext *s = &h->s;
- int skip_count;
- enum mb_t mb_type;
-
- if (!s->context_initialized) {
- s->avctx->idct_algo = FF_IDCT_CAVS;
- if (MPV_common_init(s) < 0)
- return -1;
- ff_init_scantable(s->dsp.idct_permutation,&h->scantable,ff_zigzag_direct);
- }
- get_bits(&s->gb,16);//bbv_dwlay
- if(h->stc == PIC_PB_START_CODE) {
- h->pic_type = get_bits(&s->gb,2) + FF_I_TYPE;
- if(h->pic_type > FF_B_TYPE) {
- av_log(s->avctx, AV_LOG_ERROR, "illegal picture type\n");
- return -1;
- }
- /* make sure we have the reference frames we need */
- if(!h->DPB[0].data[0] ||
- (!h->DPB[1].data[0] && h->pic_type == FF_B_TYPE))
- return -1;
- } else {
- h->pic_type = FF_I_TYPE;
- if(get_bits1(&s->gb))
- get_bits(&s->gb,16);//time_code
- }
- /* release last B frame */
- if(h->picture.data[0])
- s->avctx->release_buffer(s->avctx, (AVFrame *)&h->picture);
-
- s->avctx->get_buffer(s->avctx, (AVFrame *)&h->picture);
- init_pic(h);
- h->picture.poc = get_bits(&s->gb,8)*2;
-
- /* get temporal distances and MV scaling factors */
- if(h->pic_type != FF_B_TYPE) {
- h->dist[0] = (h->picture.poc - h->DPB[0].poc + 512) % 512;
- } else {
- h->dist[0] = (h->DPB[0].poc - h->picture.poc + 512) % 512;
- }
- h->dist[1] = (h->picture.poc - h->DPB[1].poc + 512) % 512;
- h->scale_den[0] = h->dist[0] ? 512/h->dist[0] : 0;
- h->scale_den[1] = h->dist[1] ? 512/h->dist[1] : 0;
- if(h->pic_type == FF_B_TYPE) {
- h->sym_factor = h->dist[0]*h->scale_den[1];
- } else {
- h->direct_den[0] = h->dist[0] ? 16384/h->dist[0] : 0;
- h->direct_den[1] = h->dist[1] ? 16384/h->dist[1] : 0;
- }
-
- if(s->low_delay)
- get_ue_golomb(&s->gb); //bbv_check_times
- h->progressive = get_bits1(&s->gb);
- if(h->progressive)
- h->pic_structure = 1;
- else if(!(h->pic_structure = get_bits1(&s->gb) && (h->stc == PIC_PB_START_CODE)) )
- get_bits1(&s->gb); //advanced_pred_mode_disable
- skip_bits1(&s->gb); //top_field_first
- skip_bits1(&s->gb); //repeat_first_field
- h->qp_fixed = get_bits1(&s->gb);
- h->qp = get_bits(&s->gb,6);
- if(h->pic_type == FF_I_TYPE) {
- if(!h->progressive && !h->pic_structure)
- skip_bits1(&s->gb);//what is this?
- skip_bits(&s->gb,4); //reserved bits
- } else {
- if(!(h->pic_type == FF_B_TYPE && h->pic_structure == 1))
- h->ref_flag = get_bits1(&s->gb);
- skip_bits(&s->gb,4); //reserved bits
- h->skip_mode_flag = get_bits1(&s->gb);
- }
- h->loop_filter_disable = get_bits1(&s->gb);
- if(!h->loop_filter_disable && get_bits1(&s->gb)) {
- h->alpha_offset = get_se_golomb(&s->gb);
- h->beta_offset = get_se_golomb(&s->gb);
- } else {
- h->alpha_offset = h->beta_offset = 0;
- }
- check_for_slice(h);
- if(h->pic_type == FF_I_TYPE) {
- do {
- decode_mb_i(h, 0);
- } while(next_mb(h));
- } else if(h->pic_type == FF_P_TYPE) {
- do {
- if(h->skip_mode_flag) {
- skip_count = get_ue_golomb(&s->gb);
- while(skip_count--) {
- decode_mb_p(h,P_SKIP);
- if(!next_mb(h))
- goto done;
- }
- mb_type = get_ue_golomb(&s->gb) + P_16X16;
- } else
- mb_type = get_ue_golomb(&s->gb) + P_SKIP;
- if(mb_type > P_8X8) {
- decode_mb_i(h, mb_type - P_8X8 - 1);
- } else
- decode_mb_p(h,mb_type);
- } while(next_mb(h));
- } else { /* FF_B_TYPE */
- do {
- if(h->skip_mode_flag) {
- skip_count = get_ue_golomb(&s->gb);
- while(skip_count--) {
- decode_mb_b(h,B_SKIP);
- if(!next_mb(h))
- goto done;
- }
- mb_type = get_ue_golomb(&s->gb) + B_DIRECT;
- } else
- mb_type = get_ue_golomb(&s->gb) + B_SKIP;
- if(mb_type > B_8X8) {
- decode_mb_i(h, mb_type - B_8X8 - 1);
- } else
- decode_mb_b(h,mb_type);
- } while(next_mb(h));
- }
- done:
- if(h->pic_type != FF_B_TYPE) {
- if(h->DPB[1].data[0])
- s->avctx->release_buffer(s->avctx, (AVFrame *)&h->DPB[1]);
- memcpy(&h->DPB[1], &h->DPB[0], sizeof(Picture));
- memcpy(&h->DPB[0], &h->picture, sizeof(Picture));
- memset(&h->picture,0,sizeof(Picture));
- }
- return 0;
-}
-
-/*****************************************************************************
- *
- * headers and interface
- *
- ****************************************************************************/
-
-/**
- * some predictions require data from the top-neighbouring macroblock.
- * this data has to be stored for one complete row of macroblocks
- * and this storage space is allocated here
- */
-static void init_top_lines(AVSContext *h) {
- /* alloc top line of predictors */
- h->top_qp = av_malloc( h->mb_width);
- h->top_mv[0] = av_malloc((h->mb_width*2+1)*sizeof(vector_t));
- h->top_mv[1] = av_malloc((h->mb_width*2+1)*sizeof(vector_t));
- h->top_pred_Y = av_malloc( h->mb_width*2*sizeof(*h->top_pred_Y));
- h->top_border_y = av_malloc((h->mb_width+1)*16);
- h->top_border_u = av_malloc((h->mb_width)*10);
- h->top_border_v = av_malloc((h->mb_width)*10);
-
- /* alloc space for co-located MVs and types */
- h->col_mv = av_malloc( h->mb_width*h->mb_height*4*sizeof(vector_t));
- h->col_type_base = av_malloc(h->mb_width*h->mb_height);
- h->block = av_mallocz(64*sizeof(DCTELEM));
-}
-
-static int decode_seq_header(AVSContext *h) {
- MpegEncContext *s = &h->s;
- extern const AVRational ff_frame_rate_tab[];
- int frame_rate_code;
-
- h->profile = get_bits(&s->gb,8);
- h->level = get_bits(&s->gb,8);
- skip_bits1(&s->gb); //progressive sequence
- s->width = get_bits(&s->gb,14);
- s->height = get_bits(&s->gb,14);
- skip_bits(&s->gb,2); //chroma format
- skip_bits(&s->gb,3); //sample_precision
- h->aspect_ratio = get_bits(&s->gb,4);
- frame_rate_code = get_bits(&s->gb,4);
- skip_bits(&s->gb,18);//bit_rate_lower
- skip_bits1(&s->gb); //marker_bit
- skip_bits(&s->gb,12);//bit_rate_upper
- s->low_delay = get_bits1(&s->gb);
- h->mb_width = (s->width + 15) >> 4;
- h->mb_height = (s->height + 15) >> 4;
- h->s.avctx->time_base.den = ff_frame_rate_tab[frame_rate_code].num;
- h->s.avctx->time_base.num = ff_frame_rate_tab[frame_rate_code].den;
- h->s.avctx->width = s->width;
- h->s.avctx->height = s->height;
- if(!h->top_qp)
- init_top_lines(h);
- return 0;
-}
-
-static void cavs_flush(AVCodecContext * avctx) {
- AVSContext *h = avctx->priv_data;
- h->got_keyframe = 0;
-}
-
-static int cavs_decode_frame(AVCodecContext * avctx,void *data, int *data_size,
- uint8_t * buf, int buf_size) {
- AVSContext *h = avctx->priv_data;
- MpegEncContext *s = &h->s;
- int input_size;
- const uint8_t *buf_end;
- const uint8_t *buf_ptr;
- AVFrame *picture = data;
- uint32_t stc;
-
- s->avctx = avctx;
-
- if (buf_size == 0) {
- if(!s->low_delay && h->DPB[0].data[0]) {
- *data_size = sizeof(AVPicture);
- *picture = *(AVFrame *) &h->DPB[0];
- }
- return 0;
- }
-
- buf_ptr = buf;
- buf_end = buf + buf_size;
- for(;;) {
- buf_ptr = ff_find_start_code(buf_ptr,buf_end, &stc);
- if(stc & 0xFFFFFE00)
- return FFMAX(0, buf_ptr - buf - s->parse_context.last_index);
- input_size = (buf_end - buf_ptr)*8;
- switch(stc) {
- case SEQ_START_CODE:
- init_get_bits(&s->gb, buf_ptr, input_size);
- decode_seq_header(h);
- break;
- case PIC_I_START_CODE:
- if(!h->got_keyframe) {
- if(h->DPB[0].data[0])
- avctx->release_buffer(avctx, (AVFrame *)&h->DPB[0]);
- if(h->DPB[1].data[0])
- avctx->release_buffer(avctx, (AVFrame *)&h->DPB[1]);
- h->got_keyframe = 1;
- }
- case PIC_PB_START_CODE:
- *data_size = 0;
- if(!h->got_keyframe)
- break;
- init_get_bits(&s->gb, buf_ptr, input_size);
- h->stc = stc;
- if(decode_pic(h))
- break;
- *data_size = sizeof(AVPicture);
- if(h->pic_type != FF_B_TYPE) {
- if(h->DPB[1].data[0]) {
- *picture = *(AVFrame *) &h->DPB[1];
- } else {
- *data_size = 0;
- }
- } else
- *picture = *(AVFrame *) &h->picture;
- break;
- case EXT_START_CODE:
- //mpeg_decode_extension(avctx,buf_ptr, input_size);
- break;
- case USER_START_CODE:
- //mpeg_decode_user_data(avctx,buf_ptr, input_size);
- break;
- default:
- if (stc >= SLICE_MIN_START_CODE &&
- stc <= SLICE_MAX_START_CODE) {
- init_get_bits(&s->gb, buf_ptr, input_size);
- decode_slice_header(h, &s->gb);
- }
- break;
- }
- }
-}
-
-static int cavs_decode_init(AVCodecContext * avctx) {
- AVSContext *h = avctx->priv_data;
- MpegEncContext * const s = &h->s;
-
- MPV_decode_defaults(s);
- s->avctx = avctx;
-
- avctx->pix_fmt= PIX_FMT_YUV420P;
-
- h->luma_scan[0] = 0;
- h->luma_scan[1] = 8;
- h->intra_pred_l[ INTRA_L_VERT] = intra_pred_vert;
- h->intra_pred_l[ INTRA_L_HORIZ] = intra_pred_horiz;
- h->intra_pred_l[ INTRA_L_LP] = intra_pred_lp;
- h->intra_pred_l[ INTRA_L_DOWN_LEFT] = intra_pred_down_left;
- h->intra_pred_l[INTRA_L_DOWN_RIGHT] = intra_pred_down_right;
- h->intra_pred_l[ INTRA_L_LP_LEFT] = intra_pred_lp_left;
- h->intra_pred_l[ INTRA_L_LP_TOP] = intra_pred_lp_top;
- h->intra_pred_l[ INTRA_L_DC_128] = intra_pred_dc_128;
- h->intra_pred_c[ INTRA_C_LP] = intra_pred_lp;
- h->intra_pred_c[ INTRA_C_HORIZ] = intra_pred_horiz;
- h->intra_pred_c[ INTRA_C_VERT] = intra_pred_vert;
- h->intra_pred_c[ INTRA_C_PLANE] = intra_pred_plane;
- h->intra_pred_c[ INTRA_C_LP_LEFT] = intra_pred_lp_left;
- h->intra_pred_c[ INTRA_C_LP_TOP] = intra_pred_lp_top;
- h->intra_pred_c[ INTRA_C_DC_128] = intra_pred_dc_128;
- h->mv[ 7] = un_mv;
- h->mv[19] = un_mv;
- return 0;
-}
-
-static int cavs_decode_end(AVCodecContext * avctx) {
- AVSContext *h = avctx->priv_data;
-
- av_free(h->top_qp);
- av_free(h->top_mv[0]);
- av_free(h->top_mv[1]);
- av_free(h->top_pred_Y);
- av_free(h->top_border_y);
- av_free(h->top_border_u);
- av_free(h->top_border_v);
- av_free(h->col_mv);
- av_free(h->col_type_base);
- av_free(h->block);
- return 0;
-}
-
-AVCodec cavs_decoder = {
- "cavs",
- CODEC_TYPE_VIDEO,
- CODEC_ID_CAVS,
- sizeof(AVSContext),
- cavs_decode_init,
- NULL,
- cavs_decode_end,
- cavs_decode_frame,
- CODEC_CAP_DR1 | CODEC_CAP_DELAY,
- .flush= cavs_flush,
-};
-#endif /* CONFIG_CAVS_DECODER */
-
-#ifdef CONFIG_CAVSVIDEO_PARSER
-/**
- * finds the end of the current frame in the bitstream.
- * @return the position of the first byte of the next frame, or -1
- */
-static int cavs_find_frame_end(ParseContext *pc, const uint8_t *buf,
- int buf_size) {
- int pic_found, i;
- uint32_t state;
-
- pic_found= pc->frame_start_found;
- state= pc->state;
-
- i=0;
- if(!pic_found){
- for(i=0; i<buf_size; i++){
- state= (state<<8) | buf[i];
- if(state == PIC_I_START_CODE || state == PIC_PB_START_CODE){
- i++;
- pic_found=1;
- break;
- }
- }
- }
-
- if(pic_found){
- /* EOF considered as end of frame */
- if (buf_size == 0)
- return 0;
- for(; i<buf_size; i++){
- state= (state<<8) | buf[i];
- if((state&0xFFFFFF00) == 0x100){
- if(state < SLICE_MIN_START_CODE || state > SLICE_MAX_START_CODE){
- pc->frame_start_found=0;
- pc->state=-1;
- return i-3;
- }
- }
- }
- }
- pc->frame_start_found= pic_found;
- pc->state= state;
- return END_NOT_FOUND;
-}
-
-static int cavsvideo_parse(AVCodecParserContext *s,
- AVCodecContext *avctx,
- uint8_t **poutbuf, int *poutbuf_size,
- const uint8_t *buf, int buf_size)
-{
- ParseContext *pc = s->priv_data;
- int next;
-
- if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){
- next= buf_size;
- }else{
- next= cavs_find_frame_end(pc, buf, buf_size);
-
- if (ff_combine_frame(pc, next, (uint8_t **)&buf, &buf_size) < 0) {
- *poutbuf = NULL;
- *poutbuf_size = 0;
- return buf_size;
- }
- }
- *poutbuf = (uint8_t *)buf;
- *poutbuf_size = buf_size;
- return next;
-}
-
-AVCodecParser cavsvideo_parser = {
- { CODEC_ID_CAVS },
- sizeof(ParseContext1),
- NULL,
- cavsvideo_parse,
- ff_parse1_close,
- ff_mpeg4video_split,
-};
-#endif /* CONFIG_CAVSVIDEO_PARSER */
diff --git a/src/libffmpeg/libavcodec/cavsdata.h b/src/libffmpeg/libavcodec/cavsdata.h
deleted file mode 100644
index d76985136..000000000
--- a/src/libffmpeg/libavcodec/cavsdata.h
+++ /dev/null
@@ -1,643 +0,0 @@
-/*
- * Chinese AVS video (AVS1-P2, JiZhun profile) decoder.
- * Copyright (c) 2006 Stefan Gehrer <stefan.gehrer@gmx.de>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#define SLICE_MIN_START_CODE 0x00000101
-#define SLICE_MAX_START_CODE 0x000001af
-#define EXT_START_CODE 0x000001b5
-#define USER_START_CODE 0x000001b2
-#define SEQ_START_CODE 0x000001b0
-#define PIC_I_START_CODE 0x000001b3
-#define PIC_PB_START_CODE 0x000001b6
-
-#define A_AVAIL 1
-#define B_AVAIL 2
-#define C_AVAIL 4
-#define D_AVAIL 8
-#define NOT_AVAIL -1
-#define REF_INTRA -2
-#define REF_DIR -3
-
-#define ESCAPE_CODE 59
-
-#define FWD0 0x01
-#define FWD1 0x02
-#define BWD0 0x04
-#define BWD1 0x08
-#define SYM0 0x10
-#define SYM1 0x20
-#define SPLITH 0x40
-#define SPLITV 0x80
-
-#define MV_BWD_OFFS 12
-#define MV_STRIDE 4
-
-enum mb_t {
- I_8X8 = 0,
- P_SKIP,
- P_16X16,
- P_16X8,
- P_8X16,
- P_8X8,
- B_SKIP,
- B_DIRECT,
- B_FWD_16X16,
- B_BWD_16X16,
- B_SYM_16X16,
- B_8X8 = 29
-};
-
-enum sub_mb_t {
- B_SUB_DIRECT,
- B_SUB_FWD,
- B_SUB_BWD,
- B_SUB_SYM
-};
-
-enum intra_luma_t {
- INTRA_L_VERT,
- INTRA_L_HORIZ,
- INTRA_L_LP,
- INTRA_L_DOWN_LEFT,
- INTRA_L_DOWN_RIGHT,
- INTRA_L_LP_LEFT,
- INTRA_L_LP_TOP,
- INTRA_L_DC_128
-};
-
-enum intra_chroma_t {
- INTRA_C_LP,
- INTRA_C_HORIZ,
- INTRA_C_VERT,
- INTRA_C_PLANE,
- INTRA_C_LP_LEFT,
- INTRA_C_LP_TOP,
- INTRA_C_DC_128,
-};
-
-enum mv_pred_t {
- MV_PRED_MEDIAN,
- MV_PRED_LEFT,
- MV_PRED_TOP,
- MV_PRED_TOPRIGHT,
- MV_PRED_PSKIP,
- MV_PRED_BSKIP
-};
-
-enum block_t {
- BLK_16X16,
- BLK_16X8,
- BLK_8X16,
- BLK_8X8
-};
-
-enum mv_loc_t {
- MV_FWD_D3 = 0,
- MV_FWD_B2,
- MV_FWD_B3,
- MV_FWD_C2,
- MV_FWD_A1,
- MV_FWD_X0,
- MV_FWD_X1,
- MV_FWD_A3 = 8,
- MV_FWD_X2,
- MV_FWD_X3,
- MV_BWD_D3 = MV_BWD_OFFS,
- MV_BWD_B2,
- MV_BWD_B3,
- MV_BWD_C2,
- MV_BWD_A1,
- MV_BWD_X0,
- MV_BWD_X1,
- MV_BWD_A3 = MV_BWD_OFFS+8,
- MV_BWD_X2,
- MV_BWD_X3
-};
-
-#ifdef CONFIG_CAVS_DECODER
-static const uint8_t partition_flags[30] = {
- 0, //I_8X8
- 0, //P_SKIP
- 0, //P_16X16
- SPLITH, //P_16X8
- SPLITV, //P_8X16
- SPLITH|SPLITV, //P_8X8
- SPLITH|SPLITV, //B_SKIP
- SPLITH|SPLITV, //B_DIRECT
- 0, //B_FWD_16X16
- 0, //B_BWD_16X16
- 0, //B_SYM_16X16
- FWD0|FWD1 |SPLITH,
- FWD0|FWD1 |SPLITV,
- BWD0|BWD1 |SPLITH,
- BWD0|BWD1 |SPLITV,
- FWD0|BWD1 |SPLITH,
- FWD0|BWD1 |SPLITV,
- BWD0|FWD1 |SPLITH,
- BWD0|FWD1 |SPLITV,
- FWD0|FWD1 |SYM1|SPLITH,
- FWD0|FWD1 |SYM1 |SPLITV,
- BWD0|FWD1 |SYM1|SPLITH,
- BWD0|FWD1 |SYM1 |SPLITV,
- FWD0|FWD1|SYM0 |SPLITH,
- FWD0|FWD1|SYM0 |SPLITV,
- FWD0|BWD1|SYM0 |SPLITH,
- FWD0|BWD1|SYM0 |SPLITV,
- FWD0|FWD1|SYM0|SYM1|SPLITH,
- FWD0|FWD1|SYM0|SYM1 |SPLITV,
- SPLITH|SPLITV, //B_8X8 = 29
-};
-
-static const uint8_t scan3x3[4] = {4,5,7,8};
-
-static const uint8_t mv_scan[4] = {
- MV_FWD_X0,MV_FWD_X1,
- MV_FWD_X2,MV_FWD_X3
-};
-
-static const uint8_t cbp_tab[64][2] = {
- {63, 0},{15,15},{31,63},{47,31},{ 0,16},{14,32},{13,47},{11,13},
- { 7,14},{ 5,11},{10,12},{ 8, 5},{12,10},{61, 7},{ 4,48},{55, 3},
- { 1, 2},{ 2, 8},{59, 4},{ 3, 1},{62,61},{ 9,55},{ 6,59},{29,62},
- {45,29},{51,27},{23,23},{39,19},{27,30},{46,28},{53, 9},{30, 6},
- {43,60},{37,21},{60,44},{16,26},{21,51},{28,35},{19,18},{35,20},
- {42,24},{26,53},{44,17},{32,37},{58,39},{24,45},{20,58},{17,43},
- {18,42},{48,46},{22,36},{33,33},{25,34},{49,40},{40,52},{36,49},
- {34,50},{50,56},{52,25},{54,22},{41,54},{56,57},{38,41},{57,38}
-};
-
-static const uint8_t chroma_qp[64] = {
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,
- 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,
- 32,33,34,35,36,37,38,39,40,41,42,42,43,43,44,44,
- 45,45,46,46,47,47,48,48,48,49,49,49,50,50,50,51
-};
-
-static const uint8_t dequant_shift[64] = {
- 14,14,14,14,14,14,14,14,
- 13,13,13,13,13,13,13,13,
- 13,12,12,12,12,12,12,12,
- 11,11,11,11,11,11,11,11,
- 11,10,10,10,10,10,10,10,
- 10, 9, 9, 9, 9, 9, 9, 9,
- 9, 8, 8, 8, 8, 8, 8, 8,
- 7, 7, 7, 7, 7, 7, 7, 7
-};
-
-static const uint16_t dequant_mul[64] = {
- 32768,36061,38968,42495,46341,50535,55437,60424,
- 32932,35734,38968,42495,46177,50535,55109,59933,
- 65535,35734,38968,42577,46341,50617,55027,60097,
- 32809,35734,38968,42454,46382,50576,55109,60056,
- 65535,35734,38968,42495,46320,50515,55109,60076,
- 65535,35744,38968,42495,46341,50535,55099,60087,
- 65535,35734,38973,42500,46341,50535,55109,60097,
- 32771,35734,38965,42497,46341,50535,55109,60099
-};
-
-DECLARE_ALIGNED_8(typedef, struct) {
- int16_t x;
- int16_t y;
- int16_t dist;
- int16_t ref;
-} vector_t;
-
-/** marks block as unavailable, i.e. out of picture
- or not yet decoded */
-static const vector_t un_mv = {0,0,1,NOT_AVAIL};
-
-/** marks block as "no prediction from this direction"
- e.g. forward motion vector in BWD partition */
-static const vector_t dir_mv = {0,0,1,REF_DIR};
-
-/** marks block as using intra prediction */
-static const vector_t intra_mv = {0,0,1,REF_INTRA};
-
-typedef struct residual_vlc_t {
- int8_t rltab[59][3];
- int8_t level_add[27];
- int8_t golomb_order;
- int inc_limit;
- int8_t max_run;
-} residual_vlc_t;
-
-#define EOB 0,0,0
-
-static const residual_vlc_t intra_2dvlc[7] = {
- {
- { //level / run / table_inc
- { 1, 1, 1},{ -1, 1, 1},{ 1, 2, 1},{ -1, 2, 1},{ 1, 3, 1},{ -1, 3, 1},
- { 1, 4, 1},{ -1, 4, 1},{ 1, 5, 1},{ -1, 5, 1},{ 1, 6, 1},{ -1, 6, 1},
- { 1, 7, 1},{ -1, 7, 1},{ 1, 8, 1},{ -1, 8, 1},{ 1, 9, 1},{ -1, 9, 1},
- { 1,10, 1},{ -1,10, 1},{ 1,11, 1},{ -1,11, 1},{ 2, 1, 2},{ -2, 1, 2},
- { 1,12, 1},{ -1,12, 1},{ 1,13, 1},{ -1,13, 1},{ 1,14, 1},{ -1,14, 1},
- { 1,15, 1},{ -1,15, 1},{ 2, 2, 2},{ -2, 2, 2},{ 1,16, 1},{ -1,16, 1},
- { 1,17, 1},{ -1,17, 1},{ 3, 1, 3},{ -3, 1, 3},{ 1,18, 1},{ -1,18, 1},
- { 1,19, 1},{ -1,19, 1},{ 2, 3, 2},{ -2, 3, 2},{ 1,20, 1},{ -1,20, 1},
- { 1,21, 1},{ -1,21, 1},{ 2, 4, 2},{ -2, 4, 2},{ 1,22, 1},{ -1,22, 1},
- { 2, 5, 2},{ -2, 5, 2},{ 1,23, 1},{ -1,23, 1},{ EOB }
- },
- //level_add
- { 0, 4, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2,-1,-1,-1},
- 2, //golomb_order
- 0, //inc_limit
- 23, //max_run
- },{
- { //level / run
- { 1, 1, 0},{ -1, 1, 0},{ 1, 2, 0},{ -1, 2, 0},{ 2, 1, 1},{ -2, 1, 1},
- { 1, 3, 0},{ -1, 3, 0},{ EOB },{ 1, 4, 0},{ -1, 4, 0},{ 1, 5, 0},
- { -1, 5, 0},{ 1, 6, 0},{ -1, 6, 0},{ 3, 1, 2},{ -3, 1, 2},{ 2, 2, 1},
- { -2, 2, 1},{ 1, 7, 0},{ -1, 7, 0},{ 1, 8, 0},{ -1, 8, 0},{ 1, 9, 0},
- { -1, 9, 0},{ 2, 3, 1},{ -2, 3, 1},{ 4, 1, 2},{ -4, 1, 2},{ 1,10, 0},
- { -1,10, 0},{ 1,11, 0},{ -1,11, 0},{ 2, 4, 1},{ -2, 4, 1},{ 3, 2, 2},
- { -3, 2, 2},{ 1,12, 0},{ -1,12, 0},{ 2, 5, 1},{ -2, 5, 1},{ 5, 1, 3},
- { -5, 1, 3},{ 1,13, 0},{ -1,13, 0},{ 2, 6, 1},{ -2, 6, 1},{ 1,14, 0},
- { -1,14, 0},{ 2, 7, 1},{ -2, 7, 1},{ 2, 8, 1},{ -2, 8, 1},{ 3, 3, 2},
- { -3, 3, 2},{ 6, 1, 3},{ -6, 1, 3},{ 1,15, 0},{ -1,15, 0}
- },
- //level_add
- { 0, 7, 4, 4, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2,-1,
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
- 2, //golomb_order
- 1, //inc_limit
- 15, //max_run
- },{
- { //level / run
- { 1, 1, 0},{ -1, 1, 0},{ 2, 1, 0},{ -2, 1, 0},{ 1, 2, 0},{ -1, 2, 0},
- { 3, 1, 1},{ -3, 1, 1},{ EOB },{ 1, 3, 0},{ -1, 3, 0},{ 2, 2, 0},
- { -2, 2, 0},{ 4, 1, 1},{ -4, 1, 1},{ 1, 4, 0},{ -1, 4, 0},{ 5, 1, 2},
- { -5, 1, 2},{ 1, 5, 0},{ -1, 5, 0},{ 3, 2, 1},{ -3, 2, 1},{ 2, 3, 0},
- { -2, 3, 0},{ 1, 6, 0},{ -1, 6, 0},{ 6, 1, 2},{ -6, 1, 2},{ 2, 4, 0},
- { -2, 4, 0},{ 1, 7, 0},{ -1, 7, 0},{ 4, 2, 1},{ -4, 2, 1},{ 7, 1, 2},
- { -7, 1, 2},{ 3, 3, 1},{ -3, 3, 1},{ 2, 5, 0},{ -2, 5, 0},{ 1, 8, 0},
- { -1, 8, 0},{ 2, 6, 0},{ -2, 6, 0},{ 8, 1, 3},{ -8, 1, 3},{ 1, 9, 0},
- { -1, 9, 0},{ 5, 2, 2},{ -5, 2, 2},{ 3, 4, 1},{ -3, 4, 1},{ 2, 7, 0},
- { -2, 7, 0},{ 9, 1, 3},{ -9, 1, 3},{ 1,10, 0},{ -1,10, 0}
- },
- //level_add
- { 0,10, 6, 4, 4, 3, 3, 3, 2, 2, 2,-1,-1,-1,-1,-1,-1,
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
- 2, //golomb_order
- 2, //inc_limit
- 10, //max_run
- },{
- { //level / run
- { 1, 1, 0},{ -1, 1, 0},{ 2, 1, 0},{ -2, 1, 0},{ 3, 1, 0},{ -3, 1, 0},
- { 1, 2, 0},{ -1, 2, 0},{ EOB },{ 4, 1, 0},{ -4, 1, 0},{ 5, 1, 1},
- { -5, 1, 1},{ 2, 2, 0},{ -2, 2, 0},{ 1, 3, 0},{ -1, 3, 0},{ 6, 1, 1},
- { -6, 1, 1},{ 3, 2, 0},{ -3, 2, 0},{ 7, 1, 1},{ -7, 1, 1},{ 1, 4, 0},
- { -1, 4, 0},{ 8, 1, 2},{ -8, 1, 2},{ 2, 3, 0},{ -2, 3, 0},{ 4, 2, 0},
- { -4, 2, 0},{ 1, 5, 0},{ -1, 5, 0},{ 9, 1, 2},{ -9, 1, 2},{ 5, 2, 1},
- { -5, 2, 1},{ 2, 4, 0},{ -2, 4, 0},{ 10, 1, 2},{-10, 1, 2},{ 3, 3, 0},
- { -3, 3, 0},{ 1, 6, 0},{ -1, 6, 0},{ 11, 1, 3},{-11, 1, 3},{ 6, 2, 1},
- { -6, 2, 1},{ 1, 7, 0},{ -1, 7, 0},{ 2, 5, 0},{ -2, 5, 0},{ 3, 4, 0},
- { -3, 4, 0},{ 12, 1, 3},{-12, 1, 3},{ 4, 3, 0},{ -4, 3, 0}
- },
- //level_add
- { 0,13, 7, 5, 4, 3, 2, 2,-1,-1,-1 -1,-1,-1,-1,-1,-1,
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
- 2, //golomb_order
- 4, //inc_limit
- 7, //max_run
- },{
- { //level / run
- { 1, 1, 0},{ -1, 1, 0},{ 2, 1, 0},{ -2, 1, 0},{ 3, 1, 0},{ -3, 1, 0},
- { EOB },{ 4, 1, 0},{ -4, 1, 0},{ 5, 1, 0},{ -5, 1, 0},{ 6, 1, 0},
- { -6, 1, 0},{ 1, 2, 0},{ -1, 2, 0},{ 7, 1, 0},{ -7, 1, 0},{ 8, 1, 1},
- { -8, 1, 1},{ 2, 2, 0},{ -2, 2, 0},{ 9, 1, 1},{ -9, 1, 1},{ 10, 1, 1},
- {-10, 1, 1},{ 1, 3, 0},{ -1, 3, 0},{ 3, 2, 0},{ -3, 2, 0},{ 11, 1, 2},
- {-11, 1, 2},{ 4, 2, 0},{ -4, 2, 0},{ 12, 1, 2},{-12, 1, 2},{ 13, 1, 2},
- {-13, 1, 2},{ 5, 2, 0},{ -5, 2, 0},{ 1, 4, 0},{ -1, 4, 0},{ 2, 3, 0},
- { -2, 3, 0},{ 14, 1, 2},{-14, 1, 2},{ 6, 2, 0},{ -6, 2, 0},{ 15, 1, 2},
- {-15, 1, 2},{ 16, 1, 2},{-16, 1, 2},{ 3, 3, 0},{ -3, 3, 0},{ 1, 5, 0},
- { -1, 5, 0},{ 7, 2, 0},{ -7, 2, 0},{ 17, 1, 2},{-17, 1, 2}
- },
- //level_add
- { 0,18, 8, 4, 2, 2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
- 2, //golomb_order
- 7, //inc_limit
- 5, //max_run
- },{
- { //level / run
- { EOB },{ 1, 1, 0},{ -1, 1, 0},{ 2, 1, 0},{ -2, 1, 0},{ 3, 1, 0},
- { -3, 1, 0},{ 4, 1, 0},{ -4, 1, 0},{ 5, 1, 0},{ -5, 1, 0},{ 6, 1, 0},
- { -6, 1, 0},{ 7, 1, 0},{ -7, 1, 0},{ 8, 1, 0},{ -8, 1, 0},{ 9, 1, 0},
- { -9, 1, 0},{ 10, 1, 0},{-10, 1, 0},{ 1, 2, 0},{ -1, 2, 0},{ 11, 1, 1},
- {-11, 1, 1},{ 12, 1, 1},{-12, 1, 1},{ 13, 1, 1},{-13, 1, 1},{ 2, 2, 0},
- { -2, 2, 0},{ 14, 1, 1},{-14, 1, 1},{ 15, 1, 1},{-15, 1, 1},{ 3, 2, 0},
- { -3, 2, 0},{ 16, 1, 1},{-16, 1, 1},{ 1, 3, 0},{ -1, 3, 0},{ 17, 1, 1},
- {-17, 1, 1},{ 4, 2, 0},{ -4, 2, 0},{ 18, 1, 1},{-18, 1, 1},{ 5, 2, 0},
- { -5, 2, 0},{ 19, 1, 1},{-19, 1, 1},{ 20, 1, 1},{-20, 1, 1},{ 6, 2, 0},
- { -6, 2, 0},{ 21, 1, 1},{-21, 1, 1},{ 2, 3, 0},{ -2, 3, 0}
- },
- //level_add
- { 0,22, 7, 3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
- 2, //golomb_order
- 10, //inc_limit
- 3, //max_run
- },{
- { //level / run
- { EOB },{ 1, 1, 0},{ -1, 1, 0},{ 2, 1, 0},{ -2, 1, 0},{ 3, 1, 0},
- { -3, 1, 0},{ 4, 1, 0},{ -4, 1, 0},{ 5, 1, 0},{ -5, 1, 0},{ 6, 1, 0},
- { -6, 1, 0},{ 7, 1, 0},{ -7, 1, 0},{ 8, 1, 0},{ -8, 1, 0},{ 9, 1, 0},
- { -9, 1, 0},{ 10, 1, 0},{-10, 1, 0},{ 11, 1, 0},{-11, 1, 0},{ 12, 1, 0},
- {-12, 1, 0},{ 13, 1, 0},{-13, 1, 0},{ 14, 1, 0},{-14, 1, 0},{ 15, 1, 0},
- {-15, 1, 0},{ 16, 1, 0},{-16, 1, 0},{ 1, 2, 0},{ -1, 2, 0},{ 17, 1, 0},
- {-17, 1, 0},{ 18, 1, 0},{-18, 1, 0},{ 19, 1, 0},{-19, 1, 0},{ 20, 1, 0},
- {-20, 1, 0},{ 21, 1, 0},{-21, 1, 0},{ 2, 2, 0},{ -2, 2, 0},{ 22, 1, 0},
- {-22, 1, 0},{ 23, 1, 0},{-23, 1, 0},{ 24, 1, 0},{-24, 1, 0},{ 25, 1, 0},
- {-25, 1, 0},{ 3, 2, 0},{ -3, 2, 0},{ 26, 1, 0},{-26, 1, 0}
- },
- //level_add
- { 0,27, 4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
- 2, //golomb_order
- INT_MAX, //inc_limit
- 2, //max_run
- }
-};
-
-static const residual_vlc_t inter_2dvlc[7] = {
- {
- { //level / run
- { 1, 1, 1},{ -1, 1, 1},{ 1, 2, 1},{ -1, 2, 1},{ 1, 3, 1},{ -1, 3, 1},
- { 1, 4, 1},{ -1, 4, 1},{ 1, 5, 1},{ -1, 5, 1},{ 1, 6, 1},{ -1, 6, 1},
- { 1, 7, 1},{ -1, 7, 1},{ 1, 8, 1},{ -1, 8, 1},{ 1, 9, 1},{ -1, 9, 1},
- { 1,10, 1},{ -1,10, 1},{ 1,11, 1},{ -1,11, 1},{ 1,12, 1},{ -1,12, 1},
- { 1,13, 1},{ -1,13, 1},{ 2, 1, 2},{ -2, 1, 2},{ 1,14, 1},{ -1,14, 1},
- { 1,15, 1},{ -1,15, 1},{ 1,16, 1},{ -1,16, 1},{ 1,17, 1},{ -1,17, 1},
- { 1,18, 1},{ -1,18, 1},{ 1,19, 1},{ -1,19, 1},{ 3, 1, 3},{ -3, 1, 3},
- { 1,20, 1},{ -1,20, 1},{ 1,21, 1},{ -1,21, 1},{ 2, 2, 2},{ -2, 2, 2},
- { 1,22, 1},{ -1,22, 1},{ 1,23, 1},{ -1,23, 1},{ 1,24, 1},{ -1,24, 1},
- { 1,25, 1},{ -1,25, 1},{ 1,26, 1},{ -1,26, 1},{ EOB }
- },
- //level_add
- { 0, 4, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2},
- 3, //golomb_order
- 0, //inc_limit
- 26 //max_run
- },{
- { //level / run
- { 1, 1, 0},{ -1, 1, 0},{ EOB },{ 1, 2, 0},{ -1, 2, 0},{ 1, 3, 0},
- { -1, 3, 0},{ 1, 4, 0},{ -1, 4, 0},{ 1, 5, 0},{ -1, 5, 0},{ 1, 6, 0},
- { -1, 6, 0},{ 2, 1, 1},{ -2, 1, 1},{ 1, 7, 0},{ -1, 7, 0},{ 1, 8, 0},
- { -1, 8, 0},{ 1, 9, 0},{ -1, 9, 0},{ 1,10, 0},{ -1,10, 0},{ 2, 2, 1},
- { -2, 2, 1},{ 1,11, 0},{ -1,11, 0},{ 1,12, 0},{ -1,12, 0},{ 3, 1, 2},
- { -3, 1, 2},{ 1,13, 0},{ -1,13, 0},{ 1,14, 0},{ -1,14, 0},{ 2, 3, 1},
- { -2, 3, 1},{ 1,15, 0},{ -1,15, 0},{ 2, 4, 1},{ -2, 4, 1},{ 1,16, 0},
- { -1,16, 0},{ 2, 5, 1},{ -2, 5, 1},{ 1,17, 0},{ -1,17, 0},{ 4, 1, 3},
- { -4, 1, 3},{ 2, 6, 1},{ -2, 6, 1},{ 1,18, 0},{ -1,18, 0},{ 1,19, 0},
- { -1,19, 0},{ 2, 7, 1},{ -2, 7, 1},{ 3, 2, 2},{ -3, 2, 2}
- },
- //level_add
- { 0, 5, 4, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2,-1,-1,-1,-1,-1,-1,-1},
- 2, //golomb_order
- 1, //inc_limit
- 19 //max_run
- },{
- { //level / run
- { 1, 1, 0},{ -1, 1, 0},{ EOB },{ 1, 2, 0},{ -1, 2, 0},{ 2, 1, 0},
- { -2, 1, 0},{ 1, 3, 0},{ -1, 3, 0},{ 1, 4, 0},{ -1, 4, 0},{ 3, 1, 1},
- { -3, 1, 1},{ 2, 2, 0},{ -2, 2, 0},{ 1, 5, 0},{ -1, 5, 0},{ 1, 6, 0},
- { -1, 6, 0},{ 1, 7, 0},{ -1, 7, 0},{ 2, 3, 0},{ -2, 3, 0},{ 4, 1, 2},
- { -4, 1, 2},{ 1, 8, 0},{ -1, 8, 0},{ 3, 2, 1},{ -3, 2, 1},{ 2, 4, 0},
- { -2, 4, 0},{ 1, 9, 0},{ -1, 9, 0},{ 1,10, 0},{ -1,10, 0},{ 5, 1, 2},
- { -5, 1, 2},{ 2, 5, 0},{ -2, 5, 0},{ 1,11, 0},{ -1,11, 0},{ 2, 6, 0},
- { -2, 6, 0},{ 1,12, 0},{ -1,12, 0},{ 3, 3, 1},{ -3, 3, 1},{ 6, 1, 2},
- { -6, 1, 2},{ 4, 2, 2},{ -4, 2, 2},{ 1,13, 0},{ -1,13, 0},{ 2, 7, 0},
- { -2, 7, 0},{ 3, 4, 1},{ -3, 4, 1},{ 1,14, 0},{ -1,14, 0}
- },
- //level_add
- { 0, 7, 5, 4, 4, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2,-1,-1,
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
- 2, //golomb_order
- 2, //inc_limit
- 14 //max_run
- },{
- { //level / run
- { 1, 1, 0},{ -1, 1, 0},{ EOB },{ 2, 1, 0},{ -2, 1, 0},{ 1, 2, 0},
- { -1, 2, 0},{ 3, 1, 0},{ -3, 1, 0},{ 1, 3, 0},{ -1, 3, 0},{ 2, 2, 0},
- { -2, 2, 0},{ 4, 1, 1},{ -4, 1, 1},{ 1, 4, 0},{ -1, 4, 0},{ 5, 1, 1},
- { -5, 1, 1},{ 1, 5, 0},{ -1, 5, 0},{ 3, 2, 0},{ -3, 2, 0},{ 2, 3, 0},
- { -2, 3, 0},{ 1, 6, 0},{ -1, 6, 0},{ 6, 1, 1},{ -6, 1, 1},{ 2, 4, 0},
- { -2, 4, 0},{ 1, 7, 0},{ -1, 7, 0},{ 4, 2, 1},{ -4, 2, 1},{ 7, 1, 2},
- { -7, 1, 2},{ 3, 3, 0},{ -3, 3, 0},{ 1, 8, 0},{ -1, 8, 0},{ 2, 5, 0},
- { -2, 5, 0},{ 8, 1, 2},{ -8, 1, 2},{ 1, 9, 0},{ -1, 9, 0},{ 3, 4, 0},
- { -3, 4, 0},{ 2, 6, 0},{ -2, 6, 0},{ 5, 2, 1},{ -5, 2, 1},{ 1,10, 0},
- { -1,10, 0},{ 9, 1, 2},{ -9, 1, 2},{ 4, 3, 1},{ -4, 3, 1}
- },
- //level_add
- { 0,10, 6, 5, 4, 3, 3, 2, 2, 2, 2,-1,-1,-1,-1,-1,-1,
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
- 2, //golomb_order
- 3, //inc_limit
- 10 //max_run
- },{
- { //level / run
- { 1, 1, 0},{ -1, 1, 0},{ EOB },{ 2, 1, 0},{ -2, 1, 0},{ 3, 1, 0},
- { -3, 1, 0},{ 1, 2, 0},{ -1, 2, 0},{ 4, 1, 0},{ -4, 1, 0},{ 5, 1, 0},
- { -5, 1, 0},{ 2, 2, 0},{ -2, 2, 0},{ 1, 3, 0},{ -1, 3, 0},{ 6, 1, 0},
- { -6, 1, 0},{ 3, 2, 0},{ -3, 2, 0},{ 7, 1, 1},{ -7, 1, 1},{ 1, 4, 0},
- { -1, 4, 0},{ 8, 1, 1},{ -8, 1, 1},{ 2, 3, 0},{ -2, 3, 0},{ 4, 2, 0},
- { -4, 2, 0},{ 1, 5, 0},{ -1, 5, 0},{ 9, 1, 1},{ -9, 1, 1},{ 5, 2, 0},
- { -5, 2, 0},{ 2, 4, 0},{ -2, 4, 0},{ 1, 6, 0},{ -1, 6, 0},{ 10, 1, 2},
- {-10, 1, 2},{ 3, 3, 0},{ -3, 3, 0},{ 11, 1, 2},{-11, 1, 2},{ 1, 7, 0},
- { -1, 7, 0},{ 6, 2, 0},{ -6, 2, 0},{ 3, 4, 0},{ -3, 4, 0},{ 2, 5, 0},
- { -2, 5, 0},{ 12, 1, 2},{-12, 1, 2},{ 4, 3, 0},{ -4, 3, 0}
- },
- //level_add
- { 0,13, 7, 5, 4, 3, 2, 2,-1,-1,-1,-1,-1,-1,-1,-1,-1,
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
- 2, //golomb_order
- 6, //inc_limit
- 7 //max_run
- },{
- { //level / run
- { EOB },{ 1, 1, 0},{ -1, 1, 0},{ 2, 1, 0},{ -2, 1, 0},{ 3, 1, 0},
- { -3, 1, 0},{ 4, 1, 0},{ -4, 1, 0},{ 5, 1, 0},{ -5, 1, 0},{ 1, 2, 0},
- { -1, 2, 0},{ 6, 1, 0},{ -6, 1, 0},{ 7, 1, 0},{ -7, 1, 0},{ 8, 1, 0},
- { -8, 1, 0},{ 2, 2, 0},{ -2, 2, 0},{ 9, 1, 0},{ -9, 1, 0},{ 1, 3, 0},
- { -1, 3, 0},{ 10, 1, 1},{-10, 1, 1},{ 3, 2, 0},{ -3, 2, 0},{ 11, 1, 1},
- {-11, 1, 1},{ 4, 2, 0},{ -4, 2, 0},{ 12, 1, 1},{-12, 1, 1},{ 1, 4, 0},
- { -1, 4, 0},{ 2, 3, 0},{ -2, 3, 0},{ 13, 1, 1},{-13, 1, 1},{ 5, 2, 0},
- { -5, 2, 0},{ 14, 1, 1},{-14, 1, 1},{ 6, 2, 0},{ -6, 2, 0},{ 1, 5, 0},
- { -1, 5, 0},{ 15, 1, 1},{-15, 1, 1},{ 3, 3, 0},{ -3, 3, 0},{ 16, 1, 1},
- {-16, 1, 1},{ 2, 4, 0},{ -2, 4, 0},{ 7, 2, 0},{ -7, 2, 0}
- },
- //level_add
- { 0,17, 8, 4, 3, 2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
- 2, //golomb_order
- 9, //inc_limit
- 5 //max_run
- },{
- { //level / run
- { EOB },{ 1, 1, 0},{ -1, 1, 0},{ 2, 1, 0},{ -2, 1, 0},{ 3, 1, 0},
- { -3, 1, 0},{ 4, 1, 0},{ -4, 1, 0},{ 5, 1, 0},{ -5, 1, 0},{ 6, 1, 0},
- { -6, 1, 0},{ 7, 1, 0},{ -7, 1, 0},{ 1, 2, 0},{ -1, 2, 0},{ 8, 1, 0},
- { -8, 1, 0},{ 9, 1, 0},{ -9, 1, 0},{ 10, 1, 0},{-10, 1, 0},{ 11, 1, 0},
- {-11, 1, 0},{ 12, 1, 0},{-12, 1, 0},{ 2, 2, 0},{ -2, 2, 0},{ 13, 1, 0},
- {-13, 1, 0},{ 1, 3, 0},{ -1, 3, 0},{ 14, 1, 0},{-14, 1, 0},{ 15, 1, 0},
- {-15, 1, 0},{ 3, 2, 0},{ -3, 2, 0},{ 16, 1, 0},{-16, 1, 0},{ 17, 1, 0},
- {-17, 1, 0},{ 18, 1, 0},{-18, 1, 0},{ 4, 2, 0},{ -4, 2, 0},{ 19, 1, 0},
- {-19, 1, 0},{ 20, 1, 0},{-20, 1, 0},{ 2, 3, 0},{ -2, 3, 0},{ 1, 4, 0},
- { -1, 4, 0},{ 5, 2, 0},{ -5, 2, 0},{ 21, 1, 0},{-21, 1, 0}
- },
- //level_add
- { 0,22, 6, 3, 2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
- 2, //golomb_order
- INT_MAX, //inc_limit
- 4 //max_run
- }
-};
-
-static const residual_vlc_t chroma_2dvlc[5] = {
- {
- { //level / run
- { 1, 1, 1},{ -1, 1, 1},{ 1, 2, 1},{ -1, 2, 1},{ 1, 3, 1},{ -1, 3, 1},
- { 1, 4, 1},{ -1, 4, 1},{ 1, 5, 1},{ -1, 5, 1},{ 1, 6, 1},{ -1, 6, 1},
- { 1, 7, 1},{ -1, 7, 1},{ 2, 1, 2},{ -2, 1, 2},{ 1, 8, 1},{ -1, 8, 1},
- { 1, 9, 1},{ -1, 9, 1},{ 1,10, 1},{ -1,10, 1},{ 1,11, 1},{ -1,11, 1},
- { 1,12, 1},{ -1,12, 1},{ 1,13, 1},{ -1,13, 1},{ 1,14, 1},{ -1,14, 1},
- { 1,15, 1},{ -1,15, 1},{ 3, 1, 3},{ -3, 1, 3},{ 1,16, 1},{ -1,16, 1},
- { 1,17, 1},{ -1,17, 1},{ 1,18, 1},{ -1,18, 1},{ 1,19, 1},{ -1,19, 1},
- { 1,20, 1},{ -1,20, 1},{ 1,21, 1},{ -1,21, 1},{ 1,22, 1},{ -1,22, 1},
- { 2, 2, 2},{ -2, 2, 2},{ 1,23, 1},{ -1,23, 1},{ 1,24, 1},{ -1,24, 1},
- { 1,25, 1},{ -1,25, 1},{ 4, 1, 3},{ -4, 1, 3},{ EOB }
- },
- //level_add
- { 0, 5, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2,-1},
- 2, //golomb_order
- 0, //inc_limit
- 25 //max_run
- },{
- { //level / run
- { EOB },{ 1, 1, 0},{ -1, 1, 0},{ 1, 2, 0},{ -1, 2, 0},{ 2, 1, 1},
- { -2, 1, 1},{ 1, 3, 0},{ -1, 3, 0},{ 1, 4, 0},{ -1, 4, 0},{ 1, 5, 0},
- { -1, 5, 0},{ 1, 6, 0},{ -1, 6, 0},{ 3, 1, 2},{ -3, 1, 2},{ 1, 7, 0},
- { -1, 7, 0},{ 1, 8, 0},{ -1, 8, 0},{ 2, 2, 1},{ -2, 2, 1},{ 1, 9, 0},
- { -1, 9, 0},{ 1,10, 0},{ -1,10, 0},{ 1,11, 0},{ -1,11, 0},{ 4, 1, 2},
- { -4, 1, 2},{ 1,12, 0},{ -1,12, 0},{ 1,13, 0},{ -1,13, 0},{ 1,14, 0},
- { -1,14, 0},{ 2, 3, 1},{ -2, 3, 1},{ 1,15, 0},{ -1,15, 0},{ 2, 4, 1},
- { -2, 4, 1},{ 5, 1, 3},{ -5, 1, 3},{ 3, 2, 2},{ -3, 2, 2},{ 1,16, 0},
- { -1,16, 0},{ 1,17, 0},{ -1,17, 0},{ 1,18, 0},{ -1,18, 0},{ 2, 5, 1},
- { -2, 5, 1},{ 1,19, 0},{ -1,19, 0},{ 1,20, 0},{ -1,20, 0}
- },
- //level_add
- { 0, 6, 4, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2,-1,-1,-1,-1,-1,-1},
- 0, //golomb_order
- 1, //inc_limit
- 20 //max_run
- },{
- { //level / run
- { 1, 1, 0},{ -1, 1, 0},{ EOB },{ 2, 1, 0},{ -2, 1, 0},{ 1, 2, 0},
- { -1, 2, 0},{ 3, 1, 1},{ -3, 1, 1},{ 1, 3, 0},{ -1, 3, 0},{ 4, 1, 1},
- { -4, 1, 1},{ 2, 2, 0},{ -2, 2, 0},{ 1, 4, 0},{ -1, 4, 0},{ 5, 1, 2},
- { -5, 1, 2},{ 1, 5, 0},{ -1, 5, 0},{ 3, 2, 1},{ -3, 2, 1},{ 2, 3, 0},
- { -2, 3, 0},{ 1, 6, 0},{ -1, 6, 0},{ 6, 1, 2},{ -6, 1, 2},{ 1, 7, 0},
- { -1, 7, 0},{ 2, 4, 0},{ -2, 4, 0},{ 7, 1, 2},{ -7, 1, 2},{ 1, 8, 0},
- { -1, 8, 0},{ 4, 2, 1},{ -4, 2, 1},{ 1, 9, 0},{ -1, 9, 0},{ 3, 3, 1},
- { -3, 3, 1},{ 2, 5, 0},{ -2, 5, 0},{ 2, 6, 0},{ -2, 6, 0},{ 8, 1, 2},
- { -8, 1, 2},{ 1,10, 0},{ -1,10, 0},{ 1,11, 0},{ -1,11, 0},{ 9, 1, 2},
- { -9, 1, 2},{ 5, 2, 2},{ -5, 2, 2},{ 3, 4, 1},{ -3, 4, 1},
- },
- //level_add
- { 0,10, 6, 4, 4, 3, 3, 2, 2, 2, 2, 2,-1,-1,-1,-1,-1,
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
- 1, //golomb_order
- 2, //inc_limit
- 11 //max_run
- },{
- { //level / run
- { EOB },{ 1, 1, 0},{ -1, 1, 0},{ 2, 1, 0},{ -2, 1, 0},{ 3, 1, 0},
- { -3, 1, 0},{ 4, 1, 0},{ -4, 1, 0},{ 1, 2, 0},{ -1, 2, 0},{ 5, 1, 1},
- { -5, 1, 1},{ 2, 2, 0},{ -2, 2, 0},{ 6, 1, 1},{ -6, 1, 1},{ 1, 3, 0},
- { -1, 3, 0},{ 7, 1, 1},{ -7, 1, 1},{ 3, 2, 0},{ -3, 2, 0},{ 8, 1, 1},
- { -8, 1, 1},{ 1, 4, 0},{ -1, 4, 0},{ 2, 3, 0},{ -2, 3, 0},{ 9, 1, 1},
- { -9, 1, 1},{ 4, 2, 0},{ -4, 2, 0},{ 1, 5, 0},{ -1, 5, 0},{ 10, 1, 1},
- {-10, 1, 1},{ 3, 3, 0},{ -3, 3, 0},{ 5, 2, 1},{ -5, 2, 1},{ 2, 4, 0},
- { -2, 4, 0},{ 11, 1, 1},{-11, 1, 1},{ 1, 6, 0},{ -1, 6, 0},{ 12, 1, 1},
- {-12, 1, 1},{ 1, 7, 0},{ -1, 7, 0},{ 6, 2, 1},{ -6, 2, 1},{ 13, 1, 1},
- {-13, 1, 1},{ 2, 5, 0},{ -2, 5, 0},{ 1, 8, 0},{ -1, 8, 0},
- },
- //level_add
- { 0,14, 7, 4, 3, 3, 2, 2, 2,-1,-1,-1,-1,-1,-1,-1,-1,
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
- 1, //golomb_order
- 4, //inc_limit
- 8 //max_run
- },{
- { //level / run
- { EOB },{ 1, 1, 0},{ -1, 1, 0},{ 2, 1, 0},{ -2, 1, 0},{ 3, 1, 0},
- { -3, 1, 0},{ 4, 1, 0},{ -4, 1, 0},{ 5, 1, 0},{ -5, 1, 0},{ 6, 1, 0},
- { -6, 1, 0},{ 7, 1, 0},{ -7, 1, 0},{ 8, 1, 0},{ -8, 1, 0},{ 1, 2, 0},
- { -1, 2, 0},{ 9, 1, 0},{ -9, 1, 0},{ 10, 1, 0},{-10, 1, 0},{ 11, 1, 0},
- {-11, 1, 0},{ 2, 2, 0},{ -2, 2, 0},{ 12, 1, 0},{-12, 1, 0},{ 13, 1, 0},
- {-13, 1, 0},{ 3, 2, 0},{ -3, 2, 0},{ 14, 1, 0},{-14, 1, 0},{ 1, 3, 0},
- { -1, 3, 0},{ 15, 1, 0},{-15, 1, 0},{ 4, 2, 0},{ -4, 2, 0},{ 16, 1, 0},
- {-16, 1, 0},{ 17, 1, 0},{-17, 1, 0},{ 5, 2, 0},{ -5, 2, 0},{ 1, 4, 0},
- { -1, 4, 0},{ 2, 3, 0},{ -2, 3, 0},{ 18, 1, 0},{-18, 1, 0},{ 6, 2, 0},
- { -6, 2, 0},{ 19, 1, 0},{-19, 1, 0},{ 1, 5, 0},{ -1, 5, 0},
- },
- //level_add
- { 0,20, 7, 3, 2, 2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
- 0, //golomb_order
- INT_MAX, //inc_limit
- 5, //max_run
- }
-};
-
-#undef EOB
-
-static const uint8_t alpha_tab[64] = {
- 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3,
- 4, 4, 5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 18, 20,
- 22, 24, 26, 28, 30, 33, 33, 35, 35, 36, 37, 37, 39, 39, 42, 44,
- 46, 48, 50, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64
-};
-
-static const uint8_t beta_tab[64] = {
- 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2,
- 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6,
- 6, 7, 7, 7, 8, 8, 8, 9, 9, 10, 10, 11, 11, 12, 13, 14,
- 15, 16, 17, 18, 19, 20, 21, 22, 23, 23, 24, 24, 25, 25, 26, 27
-};
-
-static const uint8_t tc_tab[64] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
- 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4,
- 5, 5, 5, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9
-};
-
-static const int_fast8_t left_modifier_l[8] = { 0,-1, 6,-1,-1, 7, 6, 7};
-static const int_fast8_t top_modifier_l[8] = {-1, 1, 5,-1,-1, 5, 7, 7};
-static const int_fast8_t left_modifier_c[7] = { 5,-1, 2,-1, 6, 5, 6};
-static const int_fast8_t top_modifier_c[7] = { 4, 1,-1,-1, 4, 6, 6};
-#endif /* CONFIG_CAVS_DECODER */
diff --git a/src/libffmpeg/libavcodec/cinepak.c b/src/libffmpeg/libavcodec/cinepak.c
deleted file mode 100644
index db0519b5d..000000000
--- a/src/libffmpeg/libavcodec/cinepak.c
+++ /dev/null
@@ -1,473 +0,0 @@
-/*
- * Cinepak Video Decoder
- * Copyright (C) 2003 the ffmpeg project
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file cinepak.c
- * Cinepak video decoder
- * by Ewald Snel <ewald@rambo.its.tudelft.nl>
- * For more information on the Cinepak algorithm, visit:
- * http://www.csse.monash.edu.au/~timf/
- * For more information on the quirky data inside Sega FILM/CPK files, visit:
- * http://wiki.multimedia.cx/index.php?title=Sega_FILM
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "common.h"
-#include "avcodec.h"
-#include "dsputil.h"
-
-
-typedef struct {
- uint8_t y0, y1, y2, y3;
- uint8_t u, v;
-} cvid_codebook_t;
-
-#define MAX_STRIPS 32
-
-typedef struct {
- uint16_t id;
- uint16_t x1, y1;
- uint16_t x2, y2;
- cvid_codebook_t v4_codebook[256];
- cvid_codebook_t v1_codebook[256];
-} cvid_strip_t;
-
-typedef struct CinepakContext {
-
- AVCodecContext *avctx;
- DSPContext dsp;
- AVFrame frame;
-
- unsigned char *data;
- int size;
-
- int width, height;
-
- int palette_video;
- cvid_strip_t strips[MAX_STRIPS];
-
- int sega_film_skip_bytes;
-
-} CinepakContext;
-
-static void cinepak_decode_codebook (cvid_codebook_t *codebook,
- int chunk_id, int size, uint8_t *data)
-{
- uint8_t *eod = (data + size);
- uint32_t flag, mask;
- int i, n;
-
- /* check if this chunk contains 4- or 6-element vectors */
- n = (chunk_id & 0x0400) ? 4 : 6;
- flag = 0;
- mask = 0;
-
- for (i=0; i < 256; i++) {
- if ((chunk_id & 0x0100) && !(mask >>= 1)) {
- if ((data + 4) > eod)
- break;
-
- flag = AV_RB32 (data);
- data += 4;
- mask = 0x80000000;
- }
-
- if (!(chunk_id & 0x0100) || (flag & mask)) {
- if ((data + n) > eod)
- break;
-
- if (n == 6) {
- codebook[i].y0 = *data++;
- codebook[i].y1 = *data++;
- codebook[i].y2 = *data++;
- codebook[i].y3 = *data++;
- codebook[i].u = 128 + *data++;
- codebook[i].v = 128 + *data++;
- } else {
- /* this codebook type indicates either greyscale or
- * palettized video; if palettized, U & V components will
- * not be used so it is safe to set them to 128 for the
- * benefit of greyscale rendering in YUV420P */
- codebook[i].y0 = *data++;
- codebook[i].y1 = *data++;
- codebook[i].y2 = *data++;
- codebook[i].y3 = *data++;
- codebook[i].u = 128;
- codebook[i].v = 128;
- }
- }
- }
-}
-
-static int cinepak_decode_vectors (CinepakContext *s, cvid_strip_t *strip,
- int chunk_id, int size, uint8_t *data)
-{
- uint8_t *eod = (data + size);
- uint32_t flag, mask;
- cvid_codebook_t *codebook;
- unsigned int x, y;
- uint32_t iy[4];
- uint32_t iu[2];
- uint32_t iv[2];
-
- flag = 0;
- mask = 0;
-
- for (y=strip->y1; y < strip->y2; y+=4) {
-
- iy[0] = strip->x1 + (y * s->frame.linesize[0]);
- iy[1] = iy[0] + s->frame.linesize[0];
- iy[2] = iy[1] + s->frame.linesize[0];
- iy[3] = iy[2] + s->frame.linesize[0];
- iu[0] = (strip->x1/2) + ((y/2) * s->frame.linesize[1]);
- iu[1] = iu[0] + s->frame.linesize[1];
- iv[0] = (strip->x1/2) + ((y/2) * s->frame.linesize[2]);
- iv[1] = iv[0] + s->frame.linesize[2];
-
- for (x=strip->x1; x < strip->x2; x+=4) {
- if ((chunk_id & 0x0100) && !(mask >>= 1)) {
- if ((data + 4) > eod)
- return -1;
-
- flag = AV_RB32 (data);
- data += 4;
- mask = 0x80000000;
- }
-
- if (!(chunk_id & 0x0100) || (flag & mask)) {
- if (!(chunk_id & 0x0200) && !(mask >>= 1)) {
- if ((data + 4) > eod)
- return -1;
-
- flag = AV_RB32 (data);
- data += 4;
- mask = 0x80000000;
- }
-
- if ((chunk_id & 0x0200) || (~flag & mask)) {
- if (data >= eod)
- return -1;
-
- codebook = &strip->v1_codebook[*data++];
- s->frame.data[0][iy[0] + 0] = codebook->y0;
- s->frame.data[0][iy[0] + 1] = codebook->y0;
- s->frame.data[0][iy[1] + 0] = codebook->y0;
- s->frame.data[0][iy[1] + 1] = codebook->y0;
- if (!s->palette_video) {
- s->frame.data[1][iu[0]] = codebook->u;
- s->frame.data[2][iv[0]] = codebook->v;
- }
-
- s->frame.data[0][iy[0] + 2] = codebook->y1;
- s->frame.data[0][iy[0] + 3] = codebook->y1;
- s->frame.data[0][iy[1] + 2] = codebook->y1;
- s->frame.data[0][iy[1] + 3] = codebook->y1;
- if (!s->palette_video) {
- s->frame.data[1][iu[0] + 1] = codebook->u;
- s->frame.data[2][iv[0] + 1] = codebook->v;
- }
-
- s->frame.data[0][iy[2] + 0] = codebook->y2;
- s->frame.data[0][iy[2] + 1] = codebook->y2;
- s->frame.data[0][iy[3] + 0] = codebook->y2;
- s->frame.data[0][iy[3] + 1] = codebook->y2;
- if (!s->palette_video) {
- s->frame.data[1][iu[1]] = codebook->u;
- s->frame.data[2][iv[1]] = codebook->v;
- }
-
- s->frame.data[0][iy[2] + 2] = codebook->y3;
- s->frame.data[0][iy[2] + 3] = codebook->y3;
- s->frame.data[0][iy[3] + 2] = codebook->y3;
- s->frame.data[0][iy[3] + 3] = codebook->y3;
- if (!s->palette_video) {
- s->frame.data[1][iu[1] + 1] = codebook->u;
- s->frame.data[2][iv[1] + 1] = codebook->v;
- }
-
- } else if (flag & mask) {
- if ((data + 4) > eod)
- return -1;
-
- codebook = &strip->v4_codebook[*data++];
- s->frame.data[0][iy[0] + 0] = codebook->y0;
- s->frame.data[0][iy[0] + 1] = codebook->y1;
- s->frame.data[0][iy[1] + 0] = codebook->y2;
- s->frame.data[0][iy[1] + 1] = codebook->y3;
- if (!s->palette_video) {
- s->frame.data[1][iu[0]] = codebook->u;
- s->frame.data[2][iv[0]] = codebook->v;
- }
-
- codebook = &strip->v4_codebook[*data++];
- s->frame.data[0][iy[0] + 2] = codebook->y0;
- s->frame.data[0][iy[0] + 3] = codebook->y1;
- s->frame.data[0][iy[1] + 2] = codebook->y2;
- s->frame.data[0][iy[1] + 3] = codebook->y3;
- if (!s->palette_video) {
- s->frame.data[1][iu[0] + 1] = codebook->u;
- s->frame.data[2][iv[0] + 1] = codebook->v;
- }
-
- codebook = &strip->v4_codebook[*data++];
- s->frame.data[0][iy[2] + 0] = codebook->y0;
- s->frame.data[0][iy[2] + 1] = codebook->y1;
- s->frame.data[0][iy[3] + 0] = codebook->y2;
- s->frame.data[0][iy[3] + 1] = codebook->y3;
- if (!s->palette_video) {
- s->frame.data[1][iu[1]] = codebook->u;
- s->frame.data[2][iv[1]] = codebook->v;
- }
-
- codebook = &strip->v4_codebook[*data++];
- s->frame.data[0][iy[2] + 2] = codebook->y0;
- s->frame.data[0][iy[2] + 3] = codebook->y1;
- s->frame.data[0][iy[3] + 2] = codebook->y2;
- s->frame.data[0][iy[3] + 3] = codebook->y3;
- if (!s->palette_video) {
- s->frame.data[1][iu[1] + 1] = codebook->u;
- s->frame.data[2][iv[1] + 1] = codebook->v;
- }
-
- }
- }
-
- iy[0] += 4; iy[1] += 4;
- iy[2] += 4; iy[3] += 4;
- iu[0] += 2; iu[1] += 2;
- iv[0] += 2; iv[1] += 2;
- }
- }
-
- return 0;
-}
-
-static int cinepak_decode_strip (CinepakContext *s,
- cvid_strip_t *strip, uint8_t *data, int size)
-{
- uint8_t *eod = (data + size);
- int chunk_id, chunk_size;
-
- /* coordinate sanity checks */
- if (strip->x1 >= s->width || strip->x2 > s->width ||
- strip->y1 >= s->height || strip->y2 > s->height ||
- strip->x1 >= strip->x2 || strip->y1 >= strip->y2)
- return -1;
-
- while ((data + 4) <= eod) {
- chunk_id = AV_RB16 (&data[0]);
- chunk_size = AV_RB16 (&data[2]) - 4;
- if(chunk_size < 0)
- return -1;
-
- data += 4;
- chunk_size = ((data + chunk_size) > eod) ? (eod - data) : chunk_size;
-
- switch (chunk_id) {
-
- case 0x2000:
- case 0x2100:
- case 0x2400:
- case 0x2500:
- cinepak_decode_codebook (strip->v4_codebook, chunk_id,
- chunk_size, data);
- break;
-
- case 0x2200:
- case 0x2300:
- case 0x2600:
- case 0x2700:
- cinepak_decode_codebook (strip->v1_codebook, chunk_id,
- chunk_size, data);
- break;
-
- case 0x3000:
- case 0x3100:
- case 0x3200:
- return cinepak_decode_vectors (s, strip, chunk_id,
- chunk_size, data);
- }
-
- data += chunk_size;
- }
-
- return -1;
-}
-
-static int cinepak_decode (CinepakContext *s)
-{
- uint8_t *eod = (s->data + s->size);
- int i, result, strip_size, frame_flags, num_strips;
- int y0 = 0;
- int encoded_buf_size;
-
- if (s->size < 10)
- return -1;
-
- frame_flags = s->data[0];
- num_strips = AV_RB16 (&s->data[8]);
- encoded_buf_size = ((s->data[1] << 16) | AV_RB16 (&s->data[2]));
-
- /* if this is the first frame, check for deviant Sega FILM data */
- if (s->sega_film_skip_bytes == -1) {
- if (encoded_buf_size != s->size) {
- /* If the encoded frame size differs from the frame size as indicated
- * by the container file, this data likely comes from a Sega FILM/CPK file.
- * If the frame header is followed by the bytes FE 00 00 06 00 00 then
- * this is probably one of the two known files that have 6 extra bytes
- * after the frame header. Else, assume 2 extra bytes. */
- if ((s->data[10] == 0xFE) &&
- (s->data[11] == 0x00) &&
- (s->data[12] == 0x00) &&
- (s->data[13] == 0x06) &&
- (s->data[14] == 0x00) &&
- (s->data[15] == 0x00))
- s->sega_film_skip_bytes = 6;
- else
- s->sega_film_skip_bytes = 2;
- } else
- s->sega_film_skip_bytes = 0;
- }
-
- s->data += 10 + s->sega_film_skip_bytes;
-
- if (num_strips > MAX_STRIPS)
- num_strips = MAX_STRIPS;
-
- for (i=0; i < num_strips; i++) {
- if ((s->data + 12) > eod)
- return -1;
-
- s->strips[i].id = AV_RB16 (s->data);
- s->strips[i].y1 = y0;
- s->strips[i].x1 = 0;
- s->strips[i].y2 = y0 + AV_RB16 (&s->data[8]);
- s->strips[i].x2 = s->avctx->width;
-
- strip_size = AV_RB16 (&s->data[2]) - 12;
- s->data += 12;
- strip_size = ((s->data + strip_size) > eod) ? (eod - s->data) : strip_size;
-
- if ((i > 0) && !(frame_flags & 0x01)) {
- memcpy (s->strips[i].v4_codebook, s->strips[i-1].v4_codebook,
- sizeof(s->strips[i].v4_codebook));
- memcpy (s->strips[i].v1_codebook, s->strips[i-1].v1_codebook,
- sizeof(s->strips[i].v1_codebook));
- }
-
- result = cinepak_decode_strip (s, &s->strips[i], s->data, strip_size);
-
- if (result != 0)
- return result;
-
- s->data += strip_size;
- y0 = s->strips[i].y2;
- }
- return 0;
-}
-
-static int cinepak_decode_init(AVCodecContext *avctx)
-{
- CinepakContext *s = (CinepakContext *)avctx->priv_data;
-
- s->avctx = avctx;
- s->width = (avctx->width + 3) & ~3;
- s->height = (avctx->height + 3) & ~3;
- s->sega_film_skip_bytes = -1; /* uninitialized state */
-
- // check for paletted data
- if ((avctx->palctrl == NULL) || (avctx->bits_per_sample == 40)) {
- s->palette_video = 0;
- avctx->pix_fmt = PIX_FMT_YUV420P;
- } else {
- s->palette_video = 1;
- avctx->pix_fmt = PIX_FMT_PAL8;
- }
-
- avctx->has_b_frames = 0;
- dsputil_init(&s->dsp, avctx);
-
- s->frame.data[0] = NULL;
-
- return 0;
-}
-
-static int cinepak_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- CinepakContext *s = (CinepakContext *)avctx->priv_data;
-
- s->data = buf;
- s->size = buf_size;
-
- s->frame.reference = 1;
- s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE |
- FF_BUFFER_HINTS_REUSABLE;
- if (avctx->reget_buffer(avctx, &s->frame)) {
- av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
- return -1;
- }
-
- cinepak_decode(s);
-
- if (s->palette_video) {
- memcpy (s->frame.data[1], avctx->palctrl->palette, AVPALETTE_SIZE);
- if (avctx->palctrl->palette_changed) {
- s->frame.palette_has_changed = 1;
- avctx->palctrl->palette_changed = 0;
- } else
- s->frame.palette_has_changed = 0;
- }
-
- *data_size = sizeof(AVFrame);
- *(AVFrame*)data = s->frame;
-
- /* report that the buffer was completely consumed */
- return buf_size;
-}
-
-static int cinepak_decode_end(AVCodecContext *avctx)
-{
- CinepakContext *s = (CinepakContext *)avctx->priv_data;
-
- if (s->frame.data[0])
- avctx->release_buffer(avctx, &s->frame);
-
- return 0;
-}
-
-AVCodec cinepak_decoder = {
- "cinepak",
- CODEC_TYPE_VIDEO,
- CODEC_ID_CINEPAK,
- sizeof(CinepakContext),
- cinepak_decode_init,
- NULL,
- cinepak_decode_end,
- cinepak_decode_frame,
- CODEC_CAP_DR1,
-};
diff --git a/src/libffmpeg/libavcodec/cljr.c b/src/libffmpeg/libavcodec/cljr.c
deleted file mode 100644
index 44810f5cf..000000000
--- a/src/libffmpeg/libavcodec/cljr.c
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Cirrus Logic AccuPak (CLJR) codec
- * Copyright (c) 2003 Alex Beregszaszi
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file cljr.c
- * Cirrus Logic AccuPak codec.
- */
-
-#include "avcodec.h"
-#include "mpegvideo.h"
-
-typedef struct CLJRContext{
- AVCodecContext *avctx;
- AVFrame picture;
- int delta[16];
- int offset[4];
- GetBitContext gb;
-} CLJRContext;
-
-static int decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- CLJRContext * const a = avctx->priv_data;
- AVFrame *picture = data;
- AVFrame * const p= (AVFrame*)&a->picture;
- int x, y;
-
- if(p->data[0])
- avctx->release_buffer(avctx, p);
-
- p->reference= 0;
- if(avctx->get_buffer(avctx, p) < 0){
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
- p->pict_type= I_TYPE;
- p->key_frame= 1;
-
- init_get_bits(&a->gb, buf, buf_size);
-
- for(y=0; y<avctx->height; y++){
- uint8_t *luma= &a->picture.data[0][ y*a->picture.linesize[0] ];
- uint8_t *cb= &a->picture.data[1][ y*a->picture.linesize[1] ];
- uint8_t *cr= &a->picture.data[2][ y*a->picture.linesize[2] ];
- for(x=0; x<avctx->width; x+=4){
- luma[3] = get_bits(&a->gb, 5) << 3;
- luma[2] = get_bits(&a->gb, 5) << 3;
- luma[1] = get_bits(&a->gb, 5) << 3;
- luma[0] = get_bits(&a->gb, 5) << 3;
- luma+= 4;
- *(cb++) = get_bits(&a->gb, 6) << 2;
- *(cr++) = get_bits(&a->gb, 6) << 2;
- }
- }
-
- *picture= *(AVFrame*)&a->picture;
- *data_size = sizeof(AVPicture);
-
- emms_c();
-
- return buf_size;
-}
-
-#if 0
-static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){
- CLJRContext * const a = avctx->priv_data;
- AVFrame *pict = data;
- AVFrame * const p= (AVFrame*)&a->picture;
- int size;
- int mb_x, mb_y;
-
- *p = *pict;
- p->pict_type= I_TYPE;
- p->key_frame= 1;
-
- emms_c();
-
- align_put_bits(&a->pb);
- while(get_bit_count(&a->pb)&31)
- put_bits(&a->pb, 8, 0);
-
- size= get_bit_count(&a->pb)/32;
-
- return size*4;
-}
-#endif
-
-static void common_init(AVCodecContext *avctx){
- CLJRContext * const a = avctx->priv_data;
-
- avctx->coded_frame= (AVFrame*)&a->picture;
- a->avctx= avctx;
-}
-
-static int decode_init(AVCodecContext *avctx){
-
- common_init(avctx);
-
- avctx->pix_fmt= PIX_FMT_YUV411P;
-
- return 0;
-}
-
-#if 0
-static int encode_init(AVCodecContext *avctx){
-
- common_init(avctx);
-
- return 0;
-}
-#endif
-
-AVCodec cljr_decoder = {
- "cljr",
- CODEC_TYPE_VIDEO,
- CODEC_ID_CLJR,
- sizeof(CLJRContext),
- decode_init,
- NULL,
- NULL,
- decode_frame,
- CODEC_CAP_DR1,
-};
-#if 0
-#ifdef CONFIG_ENCODERS
-
-AVCodec cljr_encoder = {
- "cljr",
- CODEC_TYPE_VIDEO,
- CODEC_ID_cljr,
- sizeof(CLJRContext),
- encode_init,
- encode_frame,
- //encode_end,
-};
-
-#endif //CONFIG_ENCODERS
-#endif
diff --git a/src/libffmpeg/libavcodec/cook.c b/src/libffmpeg/libavcodec/cook.c
deleted file mode 100644
index a5bd0a26a..000000000
--- a/src/libffmpeg/libavcodec/cook.c
+++ /dev/null
@@ -1,1362 +0,0 @@
-/*
- * COOK compatible decoder
- * Copyright (c) 2003 Sascha Sommer
- * Copyright (c) 2005 Benjamin Larsson
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file cook.c
- * Cook compatible decoder.
- * This decoder handles RealNetworks, RealAudio G2 data.
- * Cook is identified by the codec name cook in RM files.
- *
- * To use this decoder, a calling application must supply the extradata
- * bytes provided from the RM container; 8+ bytes for mono streams and
- * 16+ for stereo streams (maybe more).
- *
- * Codec technicalities (all this assume a buffer length of 1024):
- * Cook works with several different techniques to achieve its compression.
- * In the timedomain the buffer is divided into 8 pieces and quantized. If
- * two neighboring pieces have different quantization index a smooth
- * quantization curve is used to get a smooth overlap between the different
- * pieces.
- * To get to the transformdomain Cook uses a modulated lapped transform.
- * The transform domain has 50 subbands with 20 elements each. This
- * means only a maximum of 50*20=1000 coefficients are used out of the 1024
- * available.
- */
-
-#include <math.h>
-#include <stddef.h>
-#include <stdio.h>
-
-#include "avcodec.h"
-#include "bitstream.h"
-#include "dsputil.h"
-
-#include "cookdata.h"
-
-/* the different Cook versions */
-#define MONO 0x1000001
-#define STEREO 0x1000002
-#define JOINT_STEREO 0x1000003
-#define MC_COOK 0x2000000 //multichannel Cook, not supported
-
-#define SUBBAND_SIZE 20
-//#define COOKDEBUG
-
-typedef struct {
- int size;
- int qidx_table1[8];
- int qidx_table2[8];
-} COOKgain;
-
-typedef struct __attribute__((__packed__)){
- /* codec data start */
- uint32_t cookversion; //in network order, bigendian
- uint16_t samples_per_frame; //amount of samples per frame per channel, bigendian
- uint16_t subbands; //amount of bands used in the frequency domain, bigendian
- /* Mono extradata ends here. */
- uint32_t unused;
- uint16_t js_subband_start; //bigendian
- uint16_t js_vlc_bits; //bigendian
- /* Stereo extradata ends here. */
-} COOKextradata;
-
-
-typedef struct {
- GetBitContext gb;
- /* stream data */
- int nb_channels;
- int joint_stereo;
- int bit_rate;
- int sample_rate;
- int samples_per_channel;
- int samples_per_frame;
- int subbands;
- int log2_numvector_size;
- int numvector_size; //1 << log2_numvector_size;
- int js_subband_start;
- int total_subbands;
- int num_vectors;
- int bits_per_subpacket;
- /* states */
- int random_state;
-
- /* transform data */
- FFTContext fft_ctx;
- FFTSample mlt_tmp[1024] __attribute__((aligned(16))); /* temporary storage for imlt */
- float* mlt_window;
- float* mlt_precos;
- float* mlt_presin;
- float* mlt_postcos;
- int fft_size;
- int fft_order;
- int mlt_size; //modulated lapped transform size
-
- /* gain buffers */
- COOKgain* gain_now_ptr;
- COOKgain* gain_previous_ptr;
- COOKgain gain_current;
- COOKgain gain_now;
- COOKgain gain_previous;
- COOKgain gain_channel1[2];
- COOKgain gain_channel2[2];
-
- /* VLC data */
- int js_vlc_bits;
- VLC envelope_quant_index[13];
- VLC sqvh[7]; //scalar quantization
- VLC ccpl; //channel coupling
-
- /* generatable tables and related variables */
- int gain_size_factor;
- float gain_table[23];
- float pow2tab[127];
- float rootpow2tab[127];
-
- /* data buffers */
-
- uint8_t* decoded_bytes_buffer;
- float mono_mdct_output[2048] __attribute__((aligned(16)));
- float* previous_buffer_ptr[2];
- float mono_previous_buffer1[1024];
- float mono_previous_buffer2[1024];
- float* decode_buf_ptr[4];
- float* decode_buf_ptr2[2];
- float decode_buffer_1[1024];
- float decode_buffer_2[1024];
- float decode_buffer_3[1024];
- float decode_buffer_4[1024];
-} COOKContext;
-
-/* debug functions */
-
-#ifdef COOKDEBUG
-static void dump_float_table(float* table, int size, int delimiter) {
- int i=0;
- av_log(NULL,AV_LOG_ERROR,"\n[%d]: ",i);
- for (i=0 ; i<size ; i++) {
- av_log(NULL, AV_LOG_ERROR, "%5.1f, ", table[i]);
- if ((i+1)%delimiter == 0) av_log(NULL,AV_LOG_ERROR,"\n[%d]: ",i+1);
- }
-}
-
-static void dump_int_table(int* table, int size, int delimiter) {
- int i=0;
- av_log(NULL,AV_LOG_ERROR,"\n[%d]: ",i);
- for (i=0 ; i<size ; i++) {
- av_log(NULL, AV_LOG_ERROR, "%d, ", table[i]);
- if ((i+1)%delimiter == 0) av_log(NULL,AV_LOG_ERROR,"\n[%d]: ",i+1);
- }
-}
-
-static void dump_short_table(short* table, int size, int delimiter) {
- int i=0;
- av_log(NULL,AV_LOG_ERROR,"\n[%d]: ",i);
- for (i=0 ; i<size ; i++) {
- av_log(NULL, AV_LOG_ERROR, "%d, ", table[i]);
- if ((i+1)%delimiter == 0) av_log(NULL,AV_LOG_ERROR,"\n[%d]: ",i+1);
- }
-}
-
-#endif
-
-/*************** init functions ***************/
-
-/* table generator */
-static void init_pow2table(COOKContext *q){
- int i;
- q->pow2tab[63] = 1.0;
- for (i=1 ; i<64 ; i++){
- q->pow2tab[63+i]=(float)((uint64_t)1<<i);
- q->pow2tab[63-i]=1.0/(float)((uint64_t)1<<i);
- }
-}
-
-/* table generator */
-static void init_rootpow2table(COOKContext *q){
- int i;
- q->rootpow2tab[63] = 1.0;
- for (i=1 ; i<64 ; i++){
- q->rootpow2tab[63+i]=sqrt((float)((uint64_t)1<<i));
- q->rootpow2tab[63-i]=sqrt(1.0/(float)((uint64_t)1<<i));
- }
-}
-
-/* table generator */
-static void init_gain_table(COOKContext *q) {
- int i;
- q->gain_size_factor = q->samples_per_channel/8;
- for (i=0 ; i<23 ; i++) {
- q->gain_table[i] = pow((double)q->pow2tab[i+52] ,
- (1.0/(double)q->gain_size_factor));
- }
-}
-
-
-static int init_cook_vlc_tables(COOKContext *q) {
- int i, result;
-
- result = 0;
- for (i=0 ; i<13 ; i++) {
- result &= init_vlc (&q->envelope_quant_index[i], 9, 24,
- envelope_quant_index_huffbits[i], 1, 1,
- envelope_quant_index_huffcodes[i], 2, 2, 0);
- }
- av_log(NULL,AV_LOG_DEBUG,"sqvh VLC init\n");
- for (i=0 ; i<7 ; i++) {
- result &= init_vlc (&q->sqvh[i], vhvlcsize_tab[i], vhsize_tab[i],
- cvh_huffbits[i], 1, 1,
- cvh_huffcodes[i], 2, 2, 0);
- }
-
- if (q->nb_channels==2 && q->joint_stereo==1){
- result &= init_vlc (&q->ccpl, 6, (1<<q->js_vlc_bits)-1,
- ccpl_huffbits[q->js_vlc_bits-2], 1, 1,
- ccpl_huffcodes[q->js_vlc_bits-2], 2, 2, 0);
- av_log(NULL,AV_LOG_DEBUG,"Joint-stereo VLC used.\n");
- }
-
- av_log(NULL,AV_LOG_DEBUG,"VLC tables initialized.\n");
- return result;
-}
-
-static int init_cook_mlt(COOKContext *q) {
- int j;
- float alpha;
-
- /* Allocate the buffers, could be replaced with a static [512]
- array if needed. */
- q->mlt_size = q->samples_per_channel;
- q->mlt_window = av_malloc(sizeof(float)*q->mlt_size);
- q->mlt_precos = av_malloc(sizeof(float)*q->mlt_size/2);
- q->mlt_presin = av_malloc(sizeof(float)*q->mlt_size/2);
- q->mlt_postcos = av_malloc(sizeof(float)*q->mlt_size/2);
-
- /* Initialize the MLT window: simple sine window. */
- alpha = M_PI / (2.0 * (float)q->mlt_size);
- for(j=0 ; j<q->mlt_size ; j++) {
- q->mlt_window[j] = sin((j + 512.0/(float)q->mlt_size) * alpha);
- }
-
- /* pre/post twiddle factors */
- for (j=0 ; j<q->mlt_size/2 ; j++){
- q->mlt_precos[j] = cos( ((j+0.25)*M_PI)/q->mlt_size);
- q->mlt_presin[j] = sin( ((j+0.25)*M_PI)/q->mlt_size);
- q->mlt_postcos[j] = (float)sqrt(2.0/(float)q->mlt_size)*cos( ((float)j*M_PI) /q->mlt_size); //sqrt(2/MLT_size) = scalefactor
- }
-
- /* Initialize the FFT. */
- ff_fft_init(&q->fft_ctx, av_log2(q->mlt_size)-1, 0);
- av_log(NULL,AV_LOG_DEBUG,"FFT initialized, order = %d.\n",
- av_log2(q->samples_per_channel)-1);
-
- return (int)(q->mlt_window && q->mlt_precos && q->mlt_presin && q->mlt_postcos);
-}
-
-/*************** init functions end ***********/
-
-/**
- * Cook indata decoding, every 32 bits are XORed with 0x37c511f2.
- * Why? No idea, some checksum/error detection method maybe.
- *
- * Out buffer size: extra bytes are needed to cope with
- * padding/missalignment.
- * Subpackets passed to the decoder can contain two, consecutive
- * half-subpackets, of identical but arbitrary size.
- * 1234 1234 1234 1234 extraA extraB
- * Case 1: AAAA BBBB 0 0
- * Case 2: AAAA ABBB BB-- 3 3
- * Case 3: AAAA AABB BBBB 2 2
- * Case 4: AAAA AAAB BBBB BB-- 1 5
- *
- * Nice way to waste CPU cycles.
- *
- * @param inbuffer pointer to byte array of indata
- * @param out pointer to byte array of outdata
- * @param bytes number of bytes
- */
-#define DECODE_BYTES_PAD1(bytes) (3 - ((bytes)+3) % 4)
-#define DECODE_BYTES_PAD2(bytes) ((bytes) % 4 + DECODE_BYTES_PAD1(2 * (bytes)))
-
-static inline int decode_bytes(uint8_t* inbuffer, uint8_t* out, int bytes){
- int i, off;
- uint32_t c;
- uint32_t* buf;
- uint32_t* obuf = (uint32_t*) out;
- /* FIXME: 64 bit platforms would be able to do 64 bits at a time.
- * I'm too lazy though, should be something like
- * for(i=0 ; i<bitamount/64 ; i++)
- * (int64_t)out[i] = 0x37c511f237c511f2^be2me_64(int64_t)in[i]);
- * Buffer alignment needs to be checked. */
-
- off = (uint32_t)inbuffer % 4;
- buf = (uint32_t*) (inbuffer - off);
- c = be2me_32((0x37c511f2 >> (off*8)) | (0x37c511f2 << (32-(off*8))));
- bytes += 3 + off;
- for (i = 0; i < bytes/4; i++)
- obuf[i] = c ^ buf[i];
-
- return off;
-}
-
-/**
- * Cook uninit
- */
-
-static int cook_decode_close(AVCodecContext *avctx)
-{
- int i;
- COOKContext *q = avctx->priv_data;
- av_log(avctx,AV_LOG_DEBUG, "Deallocating memory.\n");
-
- /* Free allocated memory buffers. */
- av_free(q->mlt_window);
- av_free(q->mlt_precos);
- av_free(q->mlt_presin);
- av_free(q->mlt_postcos);
- av_free(q->decoded_bytes_buffer);
-
- /* Free the transform. */
- ff_fft_end(&q->fft_ctx);
-
- /* Free the VLC tables. */
- for (i=0 ; i<13 ; i++) {
- free_vlc(&q->envelope_quant_index[i]);
- }
- for (i=0 ; i<7 ; i++) {
- free_vlc(&q->sqvh[i]);
- }
- if(q->nb_channels==2 && q->joint_stereo==1 ){
- free_vlc(&q->ccpl);
- }
-
- av_log(NULL,AV_LOG_DEBUG,"Memory deallocated.\n");
-
- return 0;
-}
-
-/**
- * Fill the COOKgain structure for the timedomain quantization.
- *
- * @param q pointer to the COOKContext
- * @param gaininfo pointer to the COOKgain
- */
-
-static void decode_gain_info(GetBitContext *gb, COOKgain* gaininfo) {
- int i;
-
- while (get_bits1(gb)) {}
-
- gaininfo->size = get_bits_count(gb) - 1; //amount of elements*2 to update
-
- if (get_bits_count(gb) - 1 <= 0) return;
-
- for (i=0 ; i<gaininfo->size ; i++){
- gaininfo->qidx_table1[i] = get_bits(gb,3);
- if (get_bits1(gb)) {
- gaininfo->qidx_table2[i] = get_bits(gb,4) - 7; //convert to signed
- } else {
- gaininfo->qidx_table2[i] = -1;
- }
- }
-}
-
-/**
- * Create the quant index table needed for the envelope.
- *
- * @param q pointer to the COOKContext
- * @param quant_index_table pointer to the array
- */
-
-static void decode_envelope(COOKContext *q, int* quant_index_table) {
- int i,j, vlc_index;
- int bitbias;
-
- bitbias = get_bits_count(&q->gb);
- quant_index_table[0]= get_bits(&q->gb,6) - 6; //This is used later in categorize
-
- for (i=1 ; i < q->total_subbands ; i++){
- vlc_index=i;
- if (i >= q->js_subband_start * 2) {
- vlc_index-=q->js_subband_start;
- } else {
- vlc_index/=2;
- if(vlc_index < 1) vlc_index = 1;
- }
- if (vlc_index>13) vlc_index = 13; //the VLC tables >13 are identical to No. 13
-
- j = get_vlc2(&q->gb, q->envelope_quant_index[vlc_index-1].table,
- q->envelope_quant_index[vlc_index-1].bits,2);
- quant_index_table[i] = quant_index_table[i-1] + j - 12; //differential encoding
- }
-}
-
-/**
- * Create the quant value table.
- *
- * @param q pointer to the COOKContext
- * @param quant_value_table pointer to the array
- */
-
-static void inline dequant_envelope(COOKContext *q, int* quant_index_table,
- float* quant_value_table){
-
- int i;
- for(i=0 ; i < q->total_subbands ; i++){
- quant_value_table[i] = q->rootpow2tab[quant_index_table[i]+63];
- }
-}
-
-/**
- * Calculate the category and category_index vector.
- *
- * @param q pointer to the COOKContext
- * @param quant_index_table pointer to the array
- * @param category pointer to the category array
- * @param category_index pointer to the category_index array
- */
-
-static void categorize(COOKContext *q, int* quant_index_table,
- int* category, int* category_index){
- int exp_idx, bias, tmpbias, bits_left, num_bits, index, v, i, j;
- int exp_index2[102];
- int exp_index1[102];
-
- int tmp_categorize_array1[128];
- int tmp_categorize_array1_idx=0;
- int tmp_categorize_array2[128];
- int tmp_categorize_array2_idx=0;
- int category_index_size=0;
-
- bits_left = q->bits_per_subpacket - get_bits_count(&q->gb);
-
- if(bits_left > q->samples_per_channel) {
- bits_left = q->samples_per_channel +
- ((bits_left - q->samples_per_channel)*5)/8;
- //av_log(NULL, AV_LOG_ERROR, "bits_left = %d\n",bits_left);
- }
-
- memset(&exp_index1,0,102*sizeof(int));
- memset(&exp_index2,0,102*sizeof(int));
- memset(&tmp_categorize_array1,0,128*sizeof(int));
- memset(&tmp_categorize_array2,0,128*sizeof(int));
-
- bias=-32;
-
- /* Estimate bias. */
- for (i=32 ; i>0 ; i=i/2){
- num_bits = 0;
- index = 0;
- for (j=q->total_subbands ; j>0 ; j--){
- exp_idx = (i - quant_index_table[index] + bias) / 2;
- if (exp_idx<0){
- exp_idx=0;
- } else if(exp_idx >7) {
- exp_idx=7;
- }
- index++;
- num_bits+=expbits_tab[exp_idx];
- }
- if(num_bits >= bits_left - 32){
- bias+=i;
- }
- }
-
- /* Calculate total number of bits. */
- num_bits=0;
- for (i=0 ; i<q->total_subbands ; i++) {
- exp_idx = (bias - quant_index_table[i]) / 2;
- if (exp_idx<0) {
- exp_idx=0;
- } else if(exp_idx >7) {
- exp_idx=7;
- }
- num_bits += expbits_tab[exp_idx];
- exp_index1[i] = exp_idx;
- exp_index2[i] = exp_idx;
- }
- tmpbias = bias = num_bits;
-
- for (j = 1 ; j < q->numvector_size ; j++) {
- if (tmpbias + bias > 2*bits_left) { /* ---> */
- int max = -999999;
- index=-1;
- for (i=0 ; i<q->total_subbands ; i++){
- if (exp_index1[i] < 7) {
- v = (-2*exp_index1[i]) - quant_index_table[i] - 32;
- if ( v >= max) {
- max = v;
- index = i;
- }
- }
- }
- if(index==-1)break;
- tmp_categorize_array1[tmp_categorize_array1_idx++] = index;
- tmpbias -= expbits_tab[exp_index1[index]] -
- expbits_tab[exp_index1[index]+1];
- ++exp_index1[index];
- } else { /* <--- */
- int min = 999999;
- index=-1;
- for (i=0 ; i<q->total_subbands ; i++){
- if(exp_index2[i] > 0){
- v = (-2*exp_index2[i])-quant_index_table[i];
- if ( v < min) {
- min = v;
- index = i;
- }
- }
- }
- if(index == -1)break;
- tmp_categorize_array2[tmp_categorize_array2_idx++] = index;
- tmpbias -= expbits_tab[exp_index2[index]] -
- expbits_tab[exp_index2[index]-1];
- --exp_index2[index];
- }
- }
-
- for(i=0 ; i<q->total_subbands ; i++)
- category[i] = exp_index2[i];
-
- /* Concatenate the two arrays. */
- for(i=tmp_categorize_array2_idx-1 ; i >= 0; i--)
- category_index[category_index_size++] = tmp_categorize_array2[i];
-
- for(i=0;i<tmp_categorize_array1_idx;i++)
- category_index[category_index_size++ ] = tmp_categorize_array1[i];
-
- /* FIXME: mc_sich_ra8_20.rm triggers this, not sure with what we
- should fill the remaining bytes. */
- for(i=category_index_size;i<q->numvector_size;i++)
- category_index[i]=0;
-
-}
-
-
-/**
- * Expand the category vector.
- *
- * @param q pointer to the COOKContext
- * @param category pointer to the category array
- * @param category_index pointer to the category_index array
- */
-
-static void inline expand_category(COOKContext *q, int* category,
- int* category_index){
- int i;
- for(i=0 ; i<q->num_vectors ; i++){
- ++category[category_index[i]];
- }
-}
-
-/**
- * The real requantization of the mltcoefs
- *
- * @param q pointer to the COOKContext
- * @param index index
- * @param band current subband
- * @param quant_value_table pointer to the array
- * @param subband_coef_index array of indexes to quant_centroid_tab
- * @param subband_coef_noise use random noise instead of predetermined value
- * @param mlt_buffer pointer to the mlt buffer
- */
-
-
-static void scalar_dequant(COOKContext *q, int index, int band,
- float* quant_value_table, int* subband_coef_index,
- int* subband_coef_noise, float* mlt_buffer){
- int i;
- float f1;
-
- for(i=0 ; i<SUBBAND_SIZE ; i++) {
- if (subband_coef_index[i]) {
- if (subband_coef_noise[i]) {
- f1 = -quant_centroid_tab[index][subband_coef_index[i]];
- } else {
- f1 = quant_centroid_tab[index][subband_coef_index[i]];
- }
- } else {
- /* noise coding if subband_coef_noise[i] == 0 */
- q->random_state = q->random_state * 214013 + 2531011; //typical RNG numbers
- f1 = randsign[(q->random_state/0x1000000)&1] * dither_tab[index]; //>>31
- }
- mlt_buffer[band*20+ i] = f1 * quant_value_table[band];
- }
-}
-/**
- * Unpack the subband_coef_index and subband_coef_noise vectors.
- *
- * @param q pointer to the COOKContext
- * @param category pointer to the category array
- * @param subband_coef_index array of indexes to quant_centroid_tab
- * @param subband_coef_noise use random noise instead of predetermined value
- */
-
-static int unpack_SQVH(COOKContext *q, int category, int* subband_coef_index,
- int* subband_coef_noise) {
- int i,j;
- int vlc, vd ,tmp, result;
- int ub;
- int cb;
-
- vd = vd_tab[category];
- result = 0;
- for(i=0 ; i<vpr_tab[category] ; i++){
- ub = get_bits_count(&q->gb);
- vlc = get_vlc2(&q->gb, q->sqvh[category].table, q->sqvh[category].bits, 3);
- cb = get_bits_count(&q->gb);
- if (q->bits_per_subpacket < get_bits_count(&q->gb)){
- vlc = 0;
- result = 1;
- }
- for(j=vd-1 ; j>=0 ; j--){
- tmp = (vlc * invradix_tab[category])/0x100000;
- subband_coef_index[vd*i+j] = vlc - tmp * (kmax_tab[category]+1);
- vlc = tmp;
- }
- for(j=0 ; j<vd ; j++){
- if (subband_coef_index[i*vd + j]) {
- if(get_bits_count(&q->gb) < q->bits_per_subpacket){
- subband_coef_noise[i*vd+j] = get_bits1(&q->gb);
- } else {
- result=1;
- subband_coef_noise[i*vd+j]=0;
- }
- } else {
- subband_coef_noise[i*vd+j]=0;
- }
- }
- }
- return result;
-}
-
-
-/**
- * Fill the mlt_buffer with mlt coefficients.
- *
- * @param q pointer to the COOKContext
- * @param category pointer to the category array
- * @param quant_value_table pointer to the array
- * @param mlt_buffer pointer to mlt coefficients
- */
-
-
-static void decode_vectors(COOKContext* q, int* category,
- float* quant_value_table, float* mlt_buffer){
- /* A zero in this table means that the subband coefficient is
- random noise coded. */
- int subband_coef_noise[SUBBAND_SIZE];
- /* A zero in this table means that the subband coefficient is a
- positive multiplicator. */
- int subband_coef_index[SUBBAND_SIZE];
- int band, j;
- int index=0;
-
- for(band=0 ; band<q->total_subbands ; band++){
- index = category[band];
- if(category[band] < 7){
- if(unpack_SQVH(q, category[band], subband_coef_index, subband_coef_noise)){
- index=7;
- for(j=0 ; j<q->total_subbands ; j++) category[band+j]=7;
- }
- }
- if(index==7) {
- memset(subband_coef_index, 0, sizeof(subband_coef_index));
- memset(subband_coef_noise, 0, sizeof(subband_coef_noise));
- }
- scalar_dequant(q, index, band, quant_value_table, subband_coef_index,
- subband_coef_noise, mlt_buffer);
- }
-
- if(q->total_subbands*SUBBAND_SIZE >= q->samples_per_channel){
- return;
- }
-}
-
-
-/**
- * function for decoding mono data
- *
- * @param q pointer to the COOKContext
- * @param mlt_buffer1 pointer to left channel mlt coefficients
- * @param mlt_buffer2 pointer to right channel mlt coefficients
- */
-
-static void mono_decode(COOKContext *q, float* mlt_buffer) {
-
- int category_index[128];
- float quant_value_table[102];
- int quant_index_table[102];
- int category[128];
-
- memset(&category, 0, 128*sizeof(int));
- memset(&quant_value_table, 0, 102*sizeof(int));
- memset(&category_index, 0, 128*sizeof(int));
-
- decode_envelope(q, quant_index_table);
- q->num_vectors = get_bits(&q->gb,q->log2_numvector_size);
- dequant_envelope(q, quant_index_table, quant_value_table);
- categorize(q, quant_index_table, category, category_index);
- expand_category(q, category, category_index);
- decode_vectors(q, category, quant_value_table, mlt_buffer);
-}
-
-
-/**
- * The modulated lapped transform, this takes transform coefficients
- * and transforms them into timedomain samples. This is done through
- * an FFT-based algorithm with pre- and postrotation steps.
- * A window and reorder step is also included.
- *
- * @param q pointer to the COOKContext
- * @param inbuffer pointer to the mltcoefficients
- * @param outbuffer pointer to the timedomain buffer
- * @param mlt_tmp pointer to temporary storage space
- */
-
-static void cook_imlt(COOKContext *q, float* inbuffer, float* outbuffer,
- float* mlt_tmp){
- int i;
-
- /* prerotation */
- for(i=0 ; i<q->mlt_size ; i+=2){
- outbuffer[i] = (q->mlt_presin[i/2] * inbuffer[q->mlt_size-1-i]) +
- (q->mlt_precos[i/2] * inbuffer[i]);
- outbuffer[i+1] = (q->mlt_precos[i/2] * inbuffer[q->mlt_size-1-i]) -
- (q->mlt_presin[i/2] * inbuffer[i]);
- }
-
- /* FFT */
- ff_fft_permute(&q->fft_ctx, (FFTComplex *) outbuffer);
- ff_fft_calc (&q->fft_ctx, (FFTComplex *) outbuffer);
-
- /* postrotation */
- for(i=0 ; i<q->mlt_size ; i+=2){
- mlt_tmp[i] = (q->mlt_postcos[(q->mlt_size-1-i)/2] * outbuffer[i+1]) +
- (q->mlt_postcos[i/2] * outbuffer[i]);
- mlt_tmp[q->mlt_size-1-i] = (q->mlt_postcos[(q->mlt_size-1-i)/2] * outbuffer[i]) -
- (q->mlt_postcos[i/2] * outbuffer[i+1]);
- }
-
- /* window and reorder */
- for(i=0 ; i<q->mlt_size/2 ; i++){
- outbuffer[i] = mlt_tmp[q->mlt_size/2-1-i] * q->mlt_window[i];
- outbuffer[q->mlt_size-1-i]= mlt_tmp[q->mlt_size/2-1-i] *
- q->mlt_window[q->mlt_size-1-i];
- outbuffer[q->mlt_size+i]= mlt_tmp[q->mlt_size/2+i] *
- q->mlt_window[q->mlt_size-1-i];
- outbuffer[2*q->mlt_size-1-i]= -(mlt_tmp[q->mlt_size/2+i] *
- q->mlt_window[i]);
- }
-}
-
-
-/**
- * the actual requantization of the timedomain samples
- *
- * @param q pointer to the COOKContext
- * @param buffer pointer to the timedomain buffer
- * @param gain_index index for the block multiplier
- * @param gain_index_next index for the next block multiplier
- */
-
-static void interpolate(COOKContext *q, float* buffer,
- int gain_index, int gain_index_next){
- int i;
- float fc1, fc2;
- fc1 = q->pow2tab[gain_index+63];
-
- if(gain_index == gain_index_next){ //static gain
- for(i=0 ; i<q->gain_size_factor ; i++){
- buffer[i]*=fc1;
- }
- return;
- } else { //smooth gain
- fc2 = q->gain_table[11 + (gain_index_next-gain_index)];
- for(i=0 ; i<q->gain_size_factor ; i++){
- buffer[i]*=fc1;
- fc1*=fc2;
- }
- return;
- }
-}
-
-/**
- * timedomain requantization of the timedomain samples
- *
- * @param q pointer to the COOKContext
- * @param buffer pointer to the timedomain buffer
- * @param gain_now current gain structure
- * @param gain_previous previous gain structure
- */
-
-static void gain_window(COOKContext *q, float* buffer, COOKgain* gain_now,
- COOKgain* gain_previous){
- int i, index;
- int gain_index[9];
- int tmp_gain_index;
-
- gain_index[8]=0;
- index = gain_previous->size;
- for (i=7 ; i>=0 ; i--) {
- if(index && gain_previous->qidx_table1[index-1]==i) {
- gain_index[i] = gain_previous->qidx_table2[index-1];
- index--;
- } else {
- gain_index[i]=gain_index[i+1];
- }
- }
- /* This is applied to the to be previous data buffer. */
- for(i=0;i<8;i++){
- interpolate(q, &buffer[q->samples_per_channel+q->gain_size_factor*i],
- gain_index[i], gain_index[i+1]);
- }
-
- tmp_gain_index = gain_index[0];
- index = gain_now->size;
- for (i=7 ; i>=0 ; i--) {
- if(index && gain_now->qidx_table1[index-1]==i) {
- gain_index[i]= gain_now->qidx_table2[index-1];
- index--;
- } else {
- gain_index[i]=gain_index[i+1];
- }
- }
-
- /* This is applied to the to be current block. */
- for(i=0;i<8;i++){
- interpolate(q, &buffer[i*q->gain_size_factor],
- tmp_gain_index+gain_index[i],
- tmp_gain_index+gain_index[i+1]);
- }
-}
-
-
-/**
- * mlt overlapping and buffer management
- *
- * @param q pointer to the COOKContext
- * @param buffer pointer to the timedomain buffer
- * @param gain_now current gain structure
- * @param gain_previous previous gain structure
- * @param previous_buffer pointer to the previous buffer to be used for overlapping
- *
- */
-
-static void gain_compensate(COOKContext *q, float* buffer, COOKgain* gain_now,
- COOKgain* gain_previous, float* previous_buffer) {
- int i;
- if((gain_now->size || gain_previous->size)) {
- gain_window(q, buffer, gain_now, gain_previous);
- }
-
- /* Overlap with the previous block. */
- for(i=0 ; i<q->samples_per_channel ; i++) buffer[i]+=previous_buffer[i];
-
- /* Save away the current to be previous block. */
- memcpy(previous_buffer, buffer+q->samples_per_channel,
- sizeof(float)*q->samples_per_channel);
-}
-
-
-/**
- * function for getting the jointstereo coupling information
- *
- * @param q pointer to the COOKContext
- * @param decouple_tab decoupling array
- *
- */
-
-static void decouple_info(COOKContext *q, int* decouple_tab){
- int length, i;
-
- if(get_bits1(&q->gb)) {
- if(cplband[q->js_subband_start] > cplband[q->subbands-1]) return;
-
- length = cplband[q->subbands-1] - cplband[q->js_subband_start] + 1;
- for (i=0 ; i<length ; i++) {
- decouple_tab[cplband[q->js_subband_start] + i] = get_vlc2(&q->gb, q->ccpl.table, q->ccpl.bits, 2);
- }
- return;
- }
-
- if(cplband[q->js_subband_start] > cplband[q->subbands-1]) return;
-
- length = cplband[q->subbands-1] - cplband[q->js_subband_start] + 1;
- for (i=0 ; i<length ; i++) {
- decouple_tab[cplband[q->js_subband_start] + i] = get_bits(&q->gb, q->js_vlc_bits);
- }
- return;
-}
-
-
-/**
- * function for decoding joint stereo data
- *
- * @param q pointer to the COOKContext
- * @param mlt_buffer1 pointer to left channel mlt coefficients
- * @param mlt_buffer2 pointer to right channel mlt coefficients
- */
-
-static void joint_decode(COOKContext *q, float* mlt_buffer1,
- float* mlt_buffer2) {
- int i,j;
- int decouple_tab[SUBBAND_SIZE];
- float decode_buffer[1060];
- int idx, cpl_tmp,tmp_idx;
- float f1,f2;
- float* cplscale;
-
- memset(decouple_tab, 0, sizeof(decouple_tab));
- memset(decode_buffer, 0, sizeof(decode_buffer));
-
- /* Make sure the buffers are zeroed out. */
- memset(mlt_buffer1,0, 1024*sizeof(float));
- memset(mlt_buffer2,0, 1024*sizeof(float));
- decouple_info(q, decouple_tab);
- mono_decode(q, decode_buffer);
-
- /* The two channels are stored interleaved in decode_buffer. */
- for (i=0 ; i<q->js_subband_start ; i++) {
- for (j=0 ; j<SUBBAND_SIZE ; j++) {
- mlt_buffer1[i*20+j] = decode_buffer[i*40+j];
- mlt_buffer2[i*20+j] = decode_buffer[i*40+20+j];
- }
- }
-
- /* When we reach js_subband_start (the higher frequencies)
- the coefficients are stored in a coupling scheme. */
- idx = (1 << q->js_vlc_bits) - 1;
- for (i=q->js_subband_start ; i<q->subbands ; i++) {
- cpl_tmp = cplband[i];
- idx -=decouple_tab[cpl_tmp];
- cplscale = (float*)cplscales[q->js_vlc_bits-2]; //choose decoupler table
- f1 = cplscale[decouple_tab[cpl_tmp]];
- f2 = cplscale[idx-1];
- for (j=0 ; j<SUBBAND_SIZE ; j++) {
- tmp_idx = ((q->js_subband_start + i)*20)+j;
- mlt_buffer1[20*i + j] = f1 * decode_buffer[tmp_idx];
- mlt_buffer2[20*i + j] = f2 * decode_buffer[tmp_idx];
- }
- idx = (1 << q->js_vlc_bits) - 1;
- }
-}
-
-/**
- * First part of subpacket decoding:
- * decode raw stream bytes and read gain info.
- *
- * @param q pointer to the COOKContext
- * @param inbuffer pointer to raw stream data
- * @param gain_ptr array of current/prev gain pointers
- */
-
-static inline void
-decode_bytes_and_gain(COOKContext *q, uint8_t *inbuffer, COOKgain *gain_ptr)
-{
- int offset;
-
- offset = decode_bytes(inbuffer, q->decoded_bytes_buffer,
- q->bits_per_subpacket/8);
- init_get_bits(&q->gb, q->decoded_bytes_buffer + offset,
- q->bits_per_subpacket);
- decode_gain_info(&q->gb, gain_ptr);
-}
-
-
-/**
- * Cook subpacket decoding. This function returns one decoded subpacket,
- * usually 1024 samples per channel.
- *
- * @param q pointer to the COOKContext
- * @param inbuffer pointer to the inbuffer
- * @param sub_packet_size subpacket size
- * @param outbuffer pointer to the outbuffer
- */
-
-
-static int decode_subpacket(COOKContext *q, uint8_t *inbuffer,
- int sub_packet_size, int16_t *outbuffer) {
- int i,j;
- int value;
- float* tmp_ptr;
-
- /* packet dump */
-// for (i=0 ; i<sub_packet_size ; i++) {
-// av_log(NULL, AV_LOG_ERROR, "%02x", inbuffer[i]);
-// }
-// av_log(NULL, AV_LOG_ERROR, "\n");
-
- if(q->nb_channels==2 && q->joint_stereo==1){
- decode_bytes_and_gain(q, inbuffer, &q->gain_current);
-
- joint_decode(q, q->decode_buf_ptr[0], q->decode_buf_ptr[2]);
-
- /* Swap buffer pointers. */
- tmp_ptr = q->decode_buf_ptr[1];
- q->decode_buf_ptr[1] = q->decode_buf_ptr[0];
- q->decode_buf_ptr[0] = tmp_ptr;
- tmp_ptr = q->decode_buf_ptr[3];
- q->decode_buf_ptr[3] = q->decode_buf_ptr[2];
- q->decode_buf_ptr[2] = tmp_ptr;
-
- /* FIXME: Rethink the gainbuffer handling, maybe a rename?
- now/previous swap */
- q->gain_now_ptr = &q->gain_now;
- q->gain_previous_ptr = &q->gain_previous;
- for (i=0 ; i<q->nb_channels ; i++){
-
- cook_imlt(q, q->decode_buf_ptr[i*2], q->mono_mdct_output, q->mlt_tmp);
- gain_compensate(q, q->mono_mdct_output, q->gain_now_ptr,
- q->gain_previous_ptr, q->previous_buffer_ptr[0]);
-
- /* Swap out the previous buffer. */
- tmp_ptr = q->previous_buffer_ptr[0];
- q->previous_buffer_ptr[0] = q->previous_buffer_ptr[1];
- q->previous_buffer_ptr[1] = tmp_ptr;
-
- /* Clip and convert the floats to 16 bits. */
- for (j=0 ; j<q->samples_per_frame ; j++){
- value = lrintf(q->mono_mdct_output[j]);
- if(value < -32768) value = -32768;
- else if(value > 32767) value = 32767;
- outbuffer[2*j+i] = value;
- }
- }
-
- memcpy(&q->gain_now, &q->gain_previous, sizeof(COOKgain));
- memcpy(&q->gain_previous, &q->gain_current, sizeof(COOKgain));
-
- } else if (q->nb_channels==2 && q->joint_stereo==0) {
- /* channel 0 */
- decode_bytes_and_gain(q, inbuffer, &q->gain_current);
-
- mono_decode(q, q->decode_buf_ptr2[0]);
-
- tmp_ptr = q->decode_buf_ptr2[0];
- q->decode_buf_ptr2[0] = q->decode_buf_ptr2[1];
- q->decode_buf_ptr2[1] = tmp_ptr;
-
- memcpy(&q->gain_channel1[0], &q->gain_current ,sizeof(COOKgain));
- q->gain_now_ptr = &q->gain_channel1[0];
- q->gain_previous_ptr = &q->gain_channel1[1];
-
- cook_imlt(q, q->decode_buf_ptr2[0], q->mono_mdct_output,q->mlt_tmp);
- gain_compensate(q, q->mono_mdct_output, q->gain_now_ptr,
- q->gain_previous_ptr, q->mono_previous_buffer1);
-
- memcpy(&q->gain_channel1[1], &q->gain_channel1[0],sizeof(COOKgain));
-
-
- for (j=0 ; j<q->samples_per_frame ; j++){
- value = lrintf(q->mono_mdct_output[j]);
- if(value < -32768) value = -32768;
- else if(value > 32767) value = 32767;
- outbuffer[2*j] = value;
- }
-
- /* channel 1 */
- //av_log(NULL,AV_LOG_ERROR,"bits = %d\n",get_bits_count(&q->gb));
- decode_bytes_and_gain(q, inbuffer + sub_packet_size/2,
- &q->gain_channel2[0]);
-
- q->gain_now_ptr = &q->gain_channel2[0];
- q->gain_previous_ptr = &q->gain_channel2[1];
-
- mono_decode(q, q->decode_buf_ptr[0]);
-
- tmp_ptr = q->decode_buf_ptr[0];
- q->decode_buf_ptr[0] = q->decode_buf_ptr[1];
- q->decode_buf_ptr[1] = tmp_ptr;
-
- cook_imlt(q, q->decode_buf_ptr[0], q->mono_mdct_output,q->mlt_tmp);
- gain_compensate(q, q->mono_mdct_output, q->gain_now_ptr,
- q->gain_previous_ptr, q->mono_previous_buffer2);
-
- /* Swap out the previous buffer. */
- tmp_ptr = q->previous_buffer_ptr[0];
- q->previous_buffer_ptr[0] = q->previous_buffer_ptr[1];
- q->previous_buffer_ptr[1] = tmp_ptr;
-
- memcpy(&q->gain_channel2[1], &q->gain_channel2[0] ,sizeof(COOKgain));
-
- for (j=0 ; j<q->samples_per_frame ; j++){
- value = lrintf(q->mono_mdct_output[j]);
- if(value < -32768) value = -32768;
- else if(value > 32767) value = 32767;
- outbuffer[2*j+1] = value;
- }
-
- } else {
- decode_bytes_and_gain(q, inbuffer, &q->gain_current);
-
- mono_decode(q, q->decode_buf_ptr[0]);
-
- /* Swap buffer pointers. */
- tmp_ptr = q->decode_buf_ptr[1];
- q->decode_buf_ptr[1] = q->decode_buf_ptr[0];
- q->decode_buf_ptr[0] = tmp_ptr;
-
- /* FIXME: Rethink the gainbuffer handling, maybe a rename?
- now/previous swap */
- q->gain_now_ptr = &q->gain_now;
- q->gain_previous_ptr = &q->gain_previous;
-
- cook_imlt(q, q->decode_buf_ptr[0], q->mono_mdct_output,q->mlt_tmp);
- gain_compensate(q, q->mono_mdct_output, q->gain_now_ptr,
- q->gain_previous_ptr, q->mono_previous_buffer1);
-
- /* Clip and convert the floats to 16 bits */
- for (j=0 ; j<q->samples_per_frame ; j++){
- value = lrintf(q->mono_mdct_output[j]);
- if(value < -32768) value = -32768;
- else if(value > 32767) value = 32767;
- outbuffer[j] = value;
- }
- memcpy(&q->gain_now, &q->gain_previous, sizeof(COOKgain));
- memcpy(&q->gain_previous, &q->gain_current, sizeof(COOKgain));
- }
- return q->samples_per_frame * sizeof(int16_t);
-}
-
-
-/**
- * Cook frame decoding
- *
- * @param avctx pointer to the AVCodecContext
- */
-
-static int cook_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size) {
- COOKContext *q = avctx->priv_data;
-
- if (buf_size < avctx->block_align)
- return buf_size;
-
- *data_size = decode_subpacket(q, buf, avctx->block_align, data);
-
- return avctx->block_align;
-}
-
-#ifdef COOKDEBUG
-static void dump_cook_context(COOKContext *q, COOKextradata *e)
-{
- //int i=0;
-#define PRINT(a,b) av_log(NULL,AV_LOG_ERROR," %s = %d\n", a, b);
- av_log(NULL,AV_LOG_ERROR,"COOKextradata\n");
- av_log(NULL,AV_LOG_ERROR,"cookversion=%x\n",e->cookversion);
- if (e->cookversion > STEREO) {
- PRINT("js_subband_start",e->js_subband_start);
- PRINT("js_vlc_bits",e->js_vlc_bits);
- }
- av_log(NULL,AV_LOG_ERROR,"COOKContext\n");
- PRINT("nb_channels",q->nb_channels);
- PRINT("bit_rate",q->bit_rate);
- PRINT("sample_rate",q->sample_rate);
- PRINT("samples_per_channel",q->samples_per_channel);
- PRINT("samples_per_frame",q->samples_per_frame);
- PRINT("subbands",q->subbands);
- PRINT("random_state",q->random_state);
- PRINT("mlt_size",q->mlt_size);
- PRINT("js_subband_start",q->js_subband_start);
- PRINT("log2_numvector_size",q->log2_numvector_size);
- PRINT("numvector_size",q->numvector_size);
- PRINT("total_subbands",q->total_subbands);
-}
-#endif
-
-/**
- * Cook initialization
- *
- * @param avctx pointer to the AVCodecContext
- */
-
-static int cook_decode_init(AVCodecContext *avctx)
-{
- COOKextradata *e = (COOKextradata *)avctx->extradata;
- COOKContext *q = avctx->priv_data;
-
- /* Take care of the codec specific extradata. */
- if (avctx->extradata_size <= 0) {
- av_log(avctx,AV_LOG_ERROR,"Necessary extradata missing!\n");
- return -1;
- } else {
- /* 8 for mono, 16 for stereo, ? for multichannel
- Swap to right endianness so we don't need to care later on. */
- av_log(avctx,AV_LOG_DEBUG,"codecdata_length=%d\n",avctx->extradata_size);
- if (avctx->extradata_size >= 8){
- e->cookversion = be2me_32(e->cookversion);
- e->samples_per_frame = be2me_16(e->samples_per_frame);
- e->subbands = be2me_16(e->subbands);
- }
- if (avctx->extradata_size >= 16){
- e->js_subband_start = be2me_16(e->js_subband_start);
- e->js_vlc_bits = be2me_16(e->js_vlc_bits);
- }
- }
-
- /* Take data from the AVCodecContext (RM container). */
- q->sample_rate = avctx->sample_rate;
- q->nb_channels = avctx->channels;
- q->bit_rate = avctx->bit_rate;
-
- /* Initialize state. */
- q->random_state = 1;
-
- /* Initialize extradata related variables. */
- q->samples_per_channel = e->samples_per_frame / q->nb_channels;
- q->samples_per_frame = e->samples_per_frame;
- q->subbands = e->subbands;
- q->bits_per_subpacket = avctx->block_align * 8;
-
- /* Initialize default data states. */
- q->js_subband_start = 0;
- q->log2_numvector_size = 5;
- q->total_subbands = q->subbands;
-
- /* Initialize version-dependent variables */
- av_log(NULL,AV_LOG_DEBUG,"e->cookversion=%x\n",e->cookversion);
- switch (e->cookversion) {
- case MONO:
- if (q->nb_channels != 1) {
- av_log(avctx,AV_LOG_ERROR,"Container channels != 1, report sample!\n");
- return -1;
- }
- av_log(avctx,AV_LOG_DEBUG,"MONO\n");
- break;
- case STEREO:
- if (q->nb_channels != 1) {
- q->joint_stereo = 0;
- q->bits_per_subpacket = q->bits_per_subpacket/2;
- }
- av_log(avctx,AV_LOG_DEBUG,"STEREO\n");
- break;
- case JOINT_STEREO:
- if (q->nb_channels != 2) {
- av_log(avctx,AV_LOG_ERROR,"Container channels != 2, report sample!\n");
- return -1;
- }
- av_log(avctx,AV_LOG_DEBUG,"JOINT_STEREO\n");
- if (avctx->extradata_size >= 16){
- q->total_subbands = q->subbands + e->js_subband_start;
- q->js_subband_start = e->js_subband_start;
- q->joint_stereo = 1;
- q->js_vlc_bits = e->js_vlc_bits;
- }
- if (q->samples_per_channel > 256) {
- q->log2_numvector_size = 6;
- }
- if (q->samples_per_channel > 512) {
- q->log2_numvector_size = 7;
- }
- break;
- case MC_COOK:
- av_log(avctx,AV_LOG_ERROR,"MC_COOK not supported!\n");
- return -1;
- break;
- default:
- av_log(avctx,AV_LOG_ERROR,"Unknown Cook version, report sample!\n");
- return -1;
- break;
- }
-
- /* Initialize variable relations */
- q->mlt_size = q->samples_per_channel;
- q->numvector_size = (1 << q->log2_numvector_size);
-
- /* Generate tables */
- init_rootpow2table(q);
- init_pow2table(q);
- init_gain_table(q);
-
- if (init_cook_vlc_tables(q) != 0)
- return -1;
-
-
- if(avctx->block_align >= UINT_MAX/2)
- return -1;
-
- /* Pad the databuffer with:
- DECODE_BYTES_PAD1 or DECODE_BYTES_PAD2 for decode_bytes(),
- FF_INPUT_BUFFER_PADDING_SIZE, for the bitstreamreader. */
- if (q->nb_channels==2 && q->joint_stereo==0) {
- q->decoded_bytes_buffer =
- av_mallocz(avctx->block_align/2
- + DECODE_BYTES_PAD2(avctx->block_align/2)
- + FF_INPUT_BUFFER_PADDING_SIZE);
- } else {
- q->decoded_bytes_buffer =
- av_mallocz(avctx->block_align
- + DECODE_BYTES_PAD1(avctx->block_align)
- + FF_INPUT_BUFFER_PADDING_SIZE);
- }
- if (q->decoded_bytes_buffer == NULL)
- return -1;
-
- q->decode_buf_ptr[0] = q->decode_buffer_1;
- q->decode_buf_ptr[1] = q->decode_buffer_2;
- q->decode_buf_ptr[2] = q->decode_buffer_3;
- q->decode_buf_ptr[3] = q->decode_buffer_4;
-
- q->decode_buf_ptr2[0] = q->decode_buffer_3;
- q->decode_buf_ptr2[1] = q->decode_buffer_4;
-
- q->previous_buffer_ptr[0] = q->mono_previous_buffer1;
- q->previous_buffer_ptr[1] = q->mono_previous_buffer2;
-
- /* Initialize transform. */
- if ( init_cook_mlt(q) == 0 )
- return -1;
-
- /* Try to catch some obviously faulty streams, othervise it might be exploitable */
- if (q->total_subbands > 53) {
- av_log(avctx,AV_LOG_ERROR,"total_subbands > 53, report sample!\n");
- return -1;
- }
- if (q->subbands > 50) {
- av_log(avctx,AV_LOG_ERROR,"subbands > 50, report sample!\n");
- return -1;
- }
- if ((q->samples_per_channel == 256) || (q->samples_per_channel == 512) || (q->samples_per_channel == 1024)) {
- } else {
- av_log(avctx,AV_LOG_ERROR,"unknown amount of samples_per_channel = %d, report sample!\n",q->samples_per_channel);
- return -1;
- }
-
-#ifdef COOKDEBUG
- dump_cook_context(q,e);
-#endif
- return 0;
-}
-
-
-AVCodec cook_decoder =
-{
- .name = "cook",
- .type = CODEC_TYPE_AUDIO,
- .id = CODEC_ID_COOK,
- .priv_data_size = sizeof(COOKContext),
- .init = cook_decode_init,
- .close = cook_decode_close,
- .decode = cook_decode_frame,
-};
diff --git a/src/libffmpeg/libavcodec/cookdata.h b/src/libffmpeg/libavcodec/cookdata.h
deleted file mode 100644
index 395c9a7dd..000000000
--- a/src/libffmpeg/libavcodec/cookdata.h
+++ /dev/null
@@ -1,559 +0,0 @@
-/*
- * COOK compatible decoder data
- * Copyright (c) 2003 Sascha Sommer
- * Copyright (c) 2005 Benjamin Larsson
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file cookdata.h
- * Cook AKA RealAudio G2 compatible decoderdata
- */
-
-/* various data tables */
-
-static const int expbits_tab[8] = {
- 52,47,43,37,29,22,16,0,
-};
-
-static const float dither_tab[8] = {
- 0.0, 0.0, 0.0, 0.0, 0.0, 0.176777, 0.25, 0.707107,
-};
-
-static const float randsign[2] = {1.0, -1.0};
-
-static const float quant_centroid_tab[7][14] = {
- { 0.000, 0.392, 0.761, 1.120, 1.477, 1.832, 2.183, 2.541, 2.893, 3.245, 3.598, 3.942, 4.288, 4.724 },
- { 0.000, 0.544, 1.060, 1.563, 2.068, 2.571, 3.072, 3.562, 4.070, 4.620, 0.000, 0.000, 0.000, 0.000 },
- { 0.000, 0.746, 1.464, 2.180, 2.882, 3.584, 4.316, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000 },
- { 0.000, 1.006, 2.000, 2.993, 3.985, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000 },
- { 0.000, 1.321, 2.703, 3.983, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000 },
- { 0.000, 1.657, 3.491, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000 },
- { 0.000, 1.964, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000 }
-};
-
-static const int invradix_tab[7] = {
- 74899, 104858, 149797, 209716, 262144, 349526, 524288,
-};
-
-static const int kmax_tab[7] = {
- 13, 9, 6, 4, 3, 2, 1,
-};
-
-static const int vd_tab[7] = {
- 2, 2, 2, 4, 4, 5, 5,
-};
-
-static const int vpr_tab[7] = {
- 10, 10, 10, 5, 5, 4, 4,
-};
-
-
-
-/* VLC data */
-
-static const int vhsize_tab[7] = {
- 191, 97, 48, 607, 246, 230, 32,
-};
-
-static const int vhvlcsize_tab[7] = {
- 8, 7, 7, 10, 9, 9, 6,
-};
-
-static const uint8_t envelope_quant_index_huffbits[13][24] = {
- { 4, 6, 5, 5, 4, 4, 4, 4, 4, 4, 3, 3, 3, 4, 5, 7, 8, 9, 11, 11, 12, 12, 12, 12 },
- { 10, 8, 6, 5, 5, 4, 3, 3, 3, 3, 3, 3, 4, 5, 7, 9, 11, 12, 13, 15, 15, 15, 16, 16 },
- { 12, 10, 8, 6, 5, 4, 4, 4, 4, 4, 4, 3, 3, 3, 4, 4, 5, 5, 7, 9, 11, 13, 14, 14 },
- { 13, 10, 9, 9, 7, 7, 5, 5, 4, 3, 3, 3, 3, 3, 4, 4, 4, 5, 7, 9, 11, 13, 13, 13 },
- { 12, 13, 10, 8, 6, 6, 5, 5, 4, 4, 3, 3, 3, 3, 3, 4, 5, 5, 6, 7, 9, 11, 14, 14 },
- { 12, 11, 9, 8, 8, 7, 5, 4, 4, 3, 3, 3, 3, 3, 4, 4, 5, 5, 7, 8, 10, 13, 14, 14 },
- { 15, 16, 15, 12, 10, 8, 6, 5, 4, 3, 3, 3, 2, 3, 4, 5, 5, 7, 9, 11, 13, 16, 16, 16 },
- { 14, 14, 11, 10, 9, 7, 7, 5, 5, 4, 3, 3, 2, 3, 3, 4, 5, 7, 9, 9, 12, 14, 15, 15 },
- { 9, 9, 9, 8, 7, 6, 5, 4, 3, 3, 3, 3, 3, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 13 },
- { 14, 12, 10, 8, 6, 6, 5, 4, 3, 3, 3, 3, 3, 3, 4, 5, 6, 8, 8, 9, 11, 14, 14, 14 },
- { 13, 10, 9, 8, 6, 6, 5, 4, 4, 4, 3, 3, 2, 3, 4, 5, 6, 8, 9, 9, 11, 12, 14, 14 },
- { 16, 13, 12, 11, 9, 6, 5, 5, 4, 4, 4, 3, 2, 3, 3, 4, 5, 7, 8, 10, 14, 16, 16, 16 },
- { 13, 14, 14, 14, 10, 8, 7, 7, 5, 4, 3, 3, 2, 3, 3, 4, 5, 5, 7, 9, 11, 14, 14, 14 },
-};
-
-static const uint16_t envelope_quant_index_huffcodes[13][24] = {
- {0x0006, 0x003e, 0x001c, 0x001d, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x0000, 0x0001,
- 0x0002, 0x000d, 0x001e, 0x007e, 0x00fe, 0x01fe, 0x07fc, 0x07fd, 0x0ffc, 0x0ffd, 0x0ffe, 0x0fff},
- {0x03fe, 0x00fe, 0x003e, 0x001c, 0x001d, 0x000c, 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005,
- 0x000d, 0x001e, 0x007e, 0x01fe, 0x07fe, 0x0ffe, 0x1ffe, 0x7ffc, 0x7ffd, 0x7ffe, 0xfffe, 0xffff},
- {0x0ffe, 0x03fe, 0x00fe, 0x003e, 0x001c, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x0000,
- 0x0001, 0x0002, 0x000c, 0x000d, 0x001d, 0x001e, 0x007e, 0x01fe, 0x07fe, 0x1ffe, 0x3ffe, 0x3fff},
- {0x1ffc, 0x03fe, 0x01fc, 0x01fd, 0x007c, 0x007d, 0x001c, 0x001d, 0x000a, 0x0000, 0x0001, 0x0002,
- 0x0003, 0x0004, 0x000b, 0x000c, 0x000d, 0x001e, 0x007e, 0x01fe, 0x07fe, 0x1ffd, 0x1ffe, 0x1fff},
- {0x0ffe, 0x1ffe, 0x03fe, 0x00fe, 0x003c, 0x003d, 0x001a, 0x001b, 0x000a, 0x000b, 0x0000, 0x0001,
- 0x0002, 0x0003, 0x0004, 0x000c, 0x001c, 0x001d, 0x003e, 0x007e, 0x01fe, 0x07fe, 0x3ffe, 0x3fff},
- {0x0ffe, 0x07fe, 0x01fe, 0x00fc, 0x00fd, 0x007c, 0x001c, 0x000a, 0x000b, 0x0000, 0x0001, 0x0002,
- 0x0003, 0x0004, 0x000c, 0x000d, 0x001d, 0x001e, 0x007d, 0x00fe, 0x03fe, 0x1ffe, 0x3ffe, 0x3fff},
- {0x7ffc, 0xfffc, 0x7ffd, 0x0ffe, 0x03fe, 0x00fe, 0x003e, 0x001c, 0x000c, 0x0002, 0x0003, 0x0004,
- 0x0000, 0x0005, 0x000d, 0x001d, 0x001e, 0x007e, 0x01fe, 0x07fe, 0x1ffe, 0xfffd, 0xfffe, 0xffff},
- {0x3ffc, 0x3ffd, 0x07fe, 0x03fe, 0x01fc, 0x007c, 0x007d, 0x001c, 0x001d, 0x000c, 0x0002, 0x0003,
- 0x0000, 0x0004, 0x0005, 0x000d, 0x001e, 0x007e, 0x01fd, 0x01fe, 0x0ffe, 0x3ffe, 0x7ffe, 0x7fff},
- {0x01fc, 0x01fd, 0x01fe, 0x00fc, 0x007c, 0x003c, 0x001c, 0x000c, 0x0000, 0x0001, 0x0002, 0x0003,
- 0x0004, 0x0005, 0x000d, 0x001d, 0x003d, 0x007d, 0x00fd, 0x03fe, 0x07fe, 0x0ffe, 0x1ffe, 0x1fff},
- {0x3ffc, 0x0ffe, 0x03fe, 0x00fc, 0x003c, 0x003d, 0x001c, 0x000c, 0x0000, 0x0001, 0x0002, 0x0003,
- 0x0004, 0x0005, 0x000d, 0x001d, 0x003e, 0x00fd, 0x00fe, 0x01fe, 0x07fe, 0x3ffd, 0x3ffe, 0x3fff},
- {0x1ffe, 0x03fe, 0x01fc, 0x00fc, 0x003c, 0x003d, 0x001c, 0x000a, 0x000b, 0x000c, 0x0002, 0x0003,
- 0x0000, 0x0004, 0x000d, 0x001d, 0x003e, 0x00fd, 0x01fd, 0x01fe, 0x07fe, 0x0ffe, 0x3ffe, 0x3fff},
- {0xfffc, 0x1ffe, 0x0ffe, 0x07fe, 0x01fe, 0x003e, 0x001c, 0x001d, 0x000a, 0x000b, 0x000c, 0x0002,
- 0x0000, 0x0003, 0x0004, 0x000d, 0x001e, 0x007e, 0x00fe, 0x03fe, 0x3ffe, 0xfffd, 0xfffe, 0xffff},
- {0x1ffc, 0x3ffa, 0x3ffb, 0x3ffc, 0x03fe, 0x00fe, 0x007c, 0x007d, 0x001c, 0x000c, 0x0002, 0x0003,
- 0x0000, 0x0004, 0x0005, 0x000d, 0x001d, 0x001e, 0x007e, 0x01fe, 0x07fe, 0x3ffd, 0x3ffe, 0x3fff},
-};
-
-
-static const uint8_t cvh_huffbits0[191] = {
- 1, 4, 6, 6, 7, 7, 8, 8, 8, 9, 9, 10,
- 11, 11, 4, 5, 6, 7, 7, 8, 8, 9, 9, 9,
- 9, 10, 11, 11, 5, 6, 7, 8, 8, 9, 9, 9,
- 9, 10, 10, 10, 11, 12, 6, 7, 8, 9, 9, 9,
- 9, 10, 10, 10, 10, 11, 12, 13, 7, 7, 8, 9,
- 9, 9, 10, 10, 10, 10, 11, 11, 12, 13, 8, 8,
- 9, 9, 9, 10, 10, 10, 10, 11, 11, 12, 13, 14,
- 8, 8, 9, 9, 10, 10, 11, 11, 11, 12, 12, 13,
- 13, 15, 8, 8, 9, 9, 10, 10, 11, 11, 11, 12,
- 12, 13, 14, 15, 9, 9, 9, 10, 10, 10, 11, 11,
- 12, 13, 12, 14, 15, 16, 9, 9, 10, 10, 10, 10,
- 11, 12, 12, 14, 14, 16, 16, 0, 9, 9, 10, 10,
- 11, 11, 12, 13, 13, 14, 14, 15, 0, 0, 10, 10,
- 10, 11, 11, 12, 12, 13, 15, 15, 16, 0, 0, 0,
- 11, 11, 11, 12, 13, 13, 13, 15, 16, 16, 0, 0,
- 0, 0, 11, 11, 12, 13, 13, 14, 15, 16, 16,
-};
-
-static const uint16_t cvh_huffcodes0[191] = {
- 0x0000,0x0008,0x002c,0x002d,0x0062,0x0063,0x00d4,0x00d5,0x00d6,0x01c6,0x01c7,0x03ca,
- 0x07d6,0x07d7,0x0009,0x0014,0x002e,0x0064,0x0065,0x00d7,0x00d8,0x01c8,0x01c9,0x01ca,
- 0x01cb,0x03cb,0x07d8,0x07d9,0x0015,0x002f,0x0066,0x00d9,0x00da,0x01cc,0x01cd,0x01ce,
- 0x01cf,0x03cc,0x03cd,0x03ce,0x07da,0x0fe4,0x0030,0x0067,0x00db,0x01d0,0x01d1,0x01d2,
- 0x01d3,0x03cf,0x03d0,0x03d1,0x03d2,0x07db,0x0fe5,0x1fea,0x0068,0x0069,0x00dc,0x01d4,
- 0x01d5,0x01d6,0x03d3,0x03d4,0x03d5,0x03d6,0x07dc,0x07dd,0x0fe6,0x1feb,0x00dd,0x00de,
- 0x01d7,0x01d8,0x01d9,0x03d7,0x03d8,0x03d9,0x03da,0x07de,0x07df,0x0fe7,0x1fec,0x3ff2,
- 0x00df,0x00e0,0x01da,0x01db,0x03db,0x03dc,0x07e0,0x07e1,0x07e2,0x0fe8,0x0fe9,0x1fed,
- 0x1fee,0x7ff4,0x00e1,0x00e2,0x01dc,0x01dd,0x03dd,0x03de,0x07e3,0x07e4,0x07e5,0x0fea,
- 0x0feb,0x1fef,0x3ff3,0x7ff5,0x01de,0x01df,0x01e0,0x03df,0x03e0,0x03e1,0x07e6,0x07e7,
- 0x0fec,0x1ff0,0x0fed,0x3ff4,0x7ff6,0xfff8,0x01e1,0x01e2,0x03e2,0x03e3,0x03e4,0x03e5,
- 0x07e8,0x0fee,0x0fef,0x3ff5,0x3ff6,0xfff9,0xfffa,0xfffa,0x01e3,0x01e4,0x03e6,0x03e7,
- 0x07e9,0x07ea,0x0ff0,0x1ff1,0x1ff2,0x3ff7,0x3ff8,0x7ff7,0x7ff7,0xfffa,0x03e8,0x03e9,
- 0x03ea,0x07eb,0x07ec,0x0ff1,0x0ff2,0x1ff3,0x7ff8,0x7ff9,0xfffb,0x3ff8,0x7ff7,0x7ff7,
- 0x07ed,0x07ee,0x07ef,0x0ff3,0x1ff4,0x1ff5,0x1ff6,0x7ffa,0xfffc,0xfffd,0xfffb,0xfffb,
- 0x3ff8,0x7ff7,0x07f0,0x07f1,0x0ff4,0x1ff7,0x1ff8,0x3ff9,0x7ffb,0xfffe,0xffff,
-};
-
-
-static const uint8_t cvh_huffbits1[97] = {
- 1, 4, 5, 6, 7, 8, 8, 9, 10, 10, 4, 5,
- 6, 7, 7, 8, 8, 9, 9, 11, 5, 5, 6, 7,
- 8, 8, 9, 9, 10, 11, 6, 6, 7, 8, 8, 9,
- 9, 10, 11, 12, 7, 7, 8, 8, 9, 9, 10, 11,
- 11, 13, 8, 8, 8, 9, 9, 10, 10, 11, 12, 14,
- 8, 8, 8, 9, 10, 11, 11, 12, 13, 15, 9, 9,
- 9, 10, 11, 12, 12, 14, 14, 0, 9, 9, 9, 10,
- 11, 12, 14, 16, 0, 0, 10, 10, 11, 12, 13, 14,
- 16,
-};
-
-
-static const uint16_t cvh_huffcodes1[97] = {
- 0x0000,0x0008,0x0014,0x0030,0x006a,0x00e2,0x00e3,0x01e4,0x03ec,0x03ed,0x0009,0x0015,
- 0x0031,0x006b,0x006c,0x00e4,0x00e5,0x01e5,0x01e6,0x07f0,0x0016,0x0017,0x0032,0x006d,
- 0x00e6,0x00e7,0x01e7,0x01e8,0x03ee,0x07f1,0x0033,0x0034,0x006e,0x00e8,0x00e9,0x01e9,
- 0x01ea,0x03ef,0x07f2,0x0ff6,0x006f,0x0070,0x00ea,0x00eb,0x01eb,0x01ec,0x03f0,0x07f3,
- 0x07f4,0x1ffa,0x00ec,0x00ed,0x00ee,0x01ed,0x01ee,0x03f1,0x03f2,0x07f5,0x0ff7,0x3ffa,
- 0x00ef,0x00f0,0x00f1,0x01ef,0x03f3,0x07f6,0x07f7,0x0ff8,0x1ffb,0x7ffe,0x01f0,0x01f1,
- 0x01f2,0x03f4,0x07f8,0x0ff9,0x0ffa,0x3ffb,0x3ffc,0x0000,0x01f3,0x01f4,0x01f5,0x03f5,
- 0x07f9,0x0ffb,0x3ffd,0xfffe,0x0000,0x0000,0x03f6,0x03f7,0x07fa,0x0ffc,0x1ffc,0x3ffe,
- 0xffff,
-};
-
-static const uint8_t cvh_huffbits2[48] = {
- 1, 4, 5, 7, 8, 9, 10, 3, 4, 5, 7, 8,
- 9, 10, 5, 5, 6, 7, 8, 10, 10, 7, 6, 7,
- 8, 9, 10, 12, 8, 8, 8, 9, 10, 12, 14, 8,
- 9, 9, 10, 11, 15, 16, 9, 10, 11, 12, 13, 16,
-};
-
-static const uint16_t cvh_huffcodes2[48] = {
- 0x0000,0x000a,0x0018,0x0074,0x00f2,0x01f4,0x03f6,0x0004,0x000b,0x0019,0x0075,0x00f3,
- 0x01f5,0x03f7,0x001a,0x001b,0x0038,0x0076,0x00f4,0x03f8,0x03f9,0x0077,0x0039,0x0078,
- 0x00f5,0x01f6,0x03fa,0x0ffc,0x00f6,0x00f7,0x00f8,0x01f7,0x03fb,0x0ffd,0x3ffe,0x00f9,
- 0x01f8,0x01f9,0x03fc,0x07fc,0x7ffe,0xfffe,0x01fa,0x03fd,0x07fd,0x0ffe,0x1ffe,0xffff,
-};
-
-static const uint8_t cvh_huffbits3[607] = {
- 2, 4, 6, 8, 10, 5, 5, 6, 8, 10, 7, 8,
- 8, 10, 12, 9, 9, 10, 12, 15, 10, 11, 13, 16,
- 16, 5, 6, 8, 10, 11, 5, 6, 8, 10, 12, 7,
- 7, 8, 10, 13, 9, 9, 10, 12, 15, 12, 11, 13,
- 16, 16, 7, 9, 10, 12, 15, 7, 8, 10, 12, 13,
- 9, 9, 11, 13, 16, 11, 11, 12, 14, 16, 12, 12,
- 14, 16, 0, 9, 11, 12, 16, 16, 9, 10, 13, 15,
- 16, 10, 11, 12, 16, 16, 13, 13, 16, 16, 16, 16,
- 16, 15, 16, 0, 11, 13, 16, 16, 15, 11, 13, 15,
- 16, 16, 13, 13, 16, 16, 0, 14, 16, 16, 16, 0,
- 16, 16, 0, 0, 0, 4, 6, 8, 10, 13, 6, 6,
- 8, 10, 13, 9, 8, 10, 12, 16, 10, 10, 11, 15,
- 16, 13, 12, 14, 16, 16, 5, 6, 8, 11, 13, 6,
- 6, 8, 10, 13, 8, 8, 9, 11, 14, 10, 10, 12,
- 12, 16, 13, 12, 13, 15, 16, 7, 8, 9, 12, 16,
- 7, 8, 10, 12, 14, 9, 9, 10, 13, 16, 11, 10,
- 12, 15, 16, 13, 13, 16, 16, 0, 9, 11, 13, 16,
- 16, 9, 10, 12, 15, 16, 10, 11, 13, 16, 16, 13,
- 12, 16, 16, 16, 16, 16, 16, 16, 0, 11, 13, 16,
- 16, 16, 11, 13, 16, 16, 16, 12, 13, 15, 16, 0,
- 16, 16, 16, 16, 0, 16, 16, 0, 0, 0, 6, 8,
- 11, 13, 16, 8, 8, 10, 12, 16, 11, 10, 11, 13,
- 16, 12, 13, 13, 15, 16, 16, 16, 14, 16, 0, 6,
- 8, 10, 13, 16, 8, 8, 10, 12, 16, 10, 10, 11,
- 13, 16, 13, 12, 13, 16, 16, 14, 14, 14, 16, 0,
- 8, 9, 11, 13, 16, 8, 9, 11, 16, 14, 10, 10,
- 12, 15, 16, 12, 12, 13, 16, 16, 15, 16, 16, 16,
- 0, 10, 12, 15, 16, 16, 10, 12, 12, 14, 16, 12,
- 12, 13, 16, 16, 14, 15, 16, 16, 0, 16, 16, 16,
- 0, 0, 12, 15, 15, 16, 0, 13, 13, 16, 16, 0,
- 14, 16, 16, 16, 0, 16, 16, 16, 0, 0, 0, 0,
- 0, 0, 0, 8, 10, 13, 15, 16, 10, 11, 13, 16,
- 16, 13, 13, 14, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 0, 8, 10, 11, 15, 16, 9, 10, 12,
- 16, 16, 12, 12, 15, 16, 16, 16, 14, 16, 16, 16,
- 16, 16, 16, 16, 0, 9, 11, 14, 16, 16, 10, 11,
- 13, 16, 16, 14, 13, 14, 16, 16, 16, 15, 15, 16,
- 0, 16, 16, 16, 0, 0, 11, 13, 16, 16, 16, 11,
- 13, 15, 16, 16, 13, 16, 16, 16, 0, 16, 16, 16,
- 16, 0, 16, 16, 0, 0, 0, 15, 16, 16, 16, 0,
- 14, 16, 16, 16, 0, 16, 16, 16, 0, 0, 16, 16,
- 0, 0, 0, 0, 0, 0, 0, 0, 9, 13, 16, 16,
- 16, 11, 13, 16, 16, 16, 14, 15, 16, 16, 0, 15,
- 16, 16, 16, 0, 16, 16, 0, 0, 0, 9, 13, 15,
- 15, 16, 12, 13, 14, 16, 16, 16, 15, 16, 16, 0,
- 16, 16, 16, 16, 0, 16, 16, 0, 0, 0, 11, 13,
- 15, 16, 0, 12, 14, 16, 16, 0, 16, 16, 16, 16,
- 0, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 16,
- 16, 16, 16, 0, 16, 16, 16, 16, 0, 16, 16, 16,
- 0, 0, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0,
- 16, 16, 0, 0, 0, 16, 16,
-};
-
-
-static const uint16_t cvh_huffcodes3[607] = {
- 0x0000,0x0004,0x0022,0x00c6,0x03b0,0x000c,0x000d,0x0023,0x00c7,0x03b1,0x005c,0x00c8,
- 0x00c9,0x03b2,0x0fa4,0x01c2,0x01c3,0x03b3,0x0fa5,0x7f72,0x03b4,0x07b2,0x1f9a,0xff24,
- 0xff25,0x000e,0x0024,0x00ca,0x03b5,0x07b3,0x000f,0x0025,0x00cb,0x03b6,0x0fa6,0x005d,
- 0x005e,0x00cc,0x03b7,0x1f9b,0x01c4,0x01c5,0x03b8,0x0fa7,0x7f73,0x0fa8,0x07b4,0x1f9c,
- 0xff26,0xff27,0x005f,0x01c6,0x03b9,0x0fa9,0x7f74,0x0060,0x00cd,0x03ba,0x0faa,0x1f9d,
- 0x01c7,0x01c8,0x07b5,0x1f9e,0xff28,0x07b6,0x07b7,0x0fab,0x3fa2,0xff29,0x0fac,0x0fad,
- 0x3fa3,0xff2a,0x3fa2,0x01c9,0x07b8,0x0fae,0xff2b,0xff2c,0x01ca,0x03bb,0x1f9f,0x7f75,
- 0xff2d,0x03bc,0x07b9,0x0faf,0xff2e,0xff2f,0x1fa0,0x1fa1,0xff30,0xff31,0xff32,0xff33,
- 0xff34,0x7f76,0xff35,0xff31,0x07ba,0x1fa2,0xff36,0xff37,0x7f77,0x07bb,0x1fa3,0x7f78,
- 0xff38,0xff39,0x1fa4,0x1fa5,0xff3a,0xff3b,0xff2e,0x3fa4,0xff3c,0xff3d,0xff3e,0xff31,
- 0xff3f,0xff40,0xff30,0xff31,0xff31,0x0005,0x0026,0x00ce,0x03bd,0x1fa6,0x0027,0x0028,
- 0x00cf,0x03be,0x1fa7,0x01cb,0x00d0,0x03bf,0x0fb0,0xff41,0x03c0,0x03c1,0x07bc,0x7f79,
- 0xff42,0x1fa8,0x0fb1,0x3fa5,0xff43,0xff44,0x0010,0x0029,0x00d1,0x07bd,0x1fa9,0x002a,
- 0x002b,0x00d2,0x03c2,0x1faa,0x00d3,0x00d4,0x01cc,0x07be,0x3fa6,0x03c3,0x03c4,0x0fb2,
- 0x0fb3,0xff45,0x1fab,0x0fb4,0x1fac,0x7f7a,0xff46,0x0061,0x00d5,0x01cd,0x0fb5,0xff47,
- 0x0062,0x00d6,0x03c5,0x0fb6,0x3fa7,0x01ce,0x01cf,0x03c6,0x1fad,0xff48,0x07bf,0x03c7,
- 0x0fb7,0x7f7b,0xff49,0x1fae,0x1faf,0xff4a,0xff4b,0x7f7b,0x01d0,0x07c0,0x1fb0,0xff4c,
- 0xff4d,0x01d1,0x03c8,0x0fb8,0x7f7c,0xff4e,0x03c9,0x07c1,0x1fb1,0xff4f,0xff50,0x1fb2,
- 0x0fb9,0xff51,0xff52,0xff53,0xff54,0xff55,0xff56,0xff57,0xff52,0x07c2,0x1fb3,0xff58,
- 0xff59,0xff5a,0x07c3,0x1fb4,0xff5b,0xff5c,0xff5d,0x0fba,0x1fb5,0x7f7d,0xff5e,0xff4f,
- 0xff5f,0xff60,0xff61,0xff62,0xff52,0xff63,0xff64,0xff51,0xff52,0xff52,0x002c,0x00d7,
- 0x07c4,0x1fb6,0xff65,0x00d8,0x00d9,0x03ca,0x0fbb,0xff66,0x07c5,0x03cb,0x07c6,0x1fb7,
- 0xff67,0x0fbc,0x1fb8,0x1fb9,0x7f7e,0xff68,0xff69,0xff6a,0x3fa8,0xff6b,0x7f7e,0x002d,
- 0x00da,0x03cc,0x1fba,0xff6c,0x00db,0x00dc,0x03cd,0x0fbd,0xff6d,0x03ce,0x03cf,0x07c7,
- 0x1fbb,0xff6e,0x1fbc,0x0fbe,0x1fbd,0xff6f,0xff70,0x3fa9,0x3faa,0x3fab,0xff71,0xff6f,
- 0x00dd,0x01d2,0x07c8,0x1fbe,0xff72,0x00de,0x01d3,0x07c9,0xff73,0x3fac,0x03d0,0x03d1,
- 0x0fbf,0x7f7f,0xff74,0x0fc0,0x0fc1,0x1fbf,0xff75,0xff76,0x7f80,0xff77,0xff78,0xff79,
- 0xff75,0x03d2,0x0fc2,0x7f81,0xff7a,0xff7b,0x03d3,0x0fc3,0x0fc4,0x3fad,0xff7c,0x0fc5,
- 0x0fc6,0x1fc0,0xff7d,0xff7e,0x3fae,0x7f82,0xff7f,0xff80,0xff80,0xff81,0xff82,0xff83,
- 0xff80,0xff80,0x0fc7,0x7f83,0x7f84,0xff84,0xff7a,0x1fc1,0x1fc2,0xff85,0xff86,0x3fad,
- 0x3faf,0xff87,0xff88,0xff89,0xff7d,0xff8a,0xff8b,0xff8c,0xff80,0xff80,0x3fae,0x7f82,
- 0xff7f,0xff80,0xff80,0x00df,0x03d4,0x1fc3,0x7f85,0xff8d,0x03d5,0x07ca,0x1fc4,0xff8e,
- 0xff8f,0x1fc5,0x1fc6,0x3fb0,0xff90,0xff91,0xff92,0xff93,0xff94,0xff95,0xff96,0xff97,
- 0xff98,0xff99,0xff9a,0xff95,0x00e0,0x03d6,0x07cb,0x7f86,0xff9b,0x01d4,0x03d7,0x0fc8,
- 0xff9c,0xff9d,0x0fc9,0x0fca,0x7f87,0xff9e,0xff9f,0xffa0,0x3fb1,0xffa1,0xffa2,0xffa3,
- 0xffa4,0xffa5,0xffa6,0xffa7,0xffa2,0x01d5,0x07cc,0x3fb2,0xffa8,0xffa9,0x03d8,0x07cd,
- 0x1fc7,0xffaa,0xffab,0x3fb3,0x1fc8,0x3fb4,0xffac,0xffad,0xffae,0x7f88,0x7f89,0xffaf,
- 0xffaf,0xffb0,0xffb1,0xffb2,0xffaf,0xffaf,0x07ce,0x1fc9,0xffb3,0xffb4,0xffb5,0x07cf,
- 0x1fca,0x7f8a,0xffb6,0xffb7,0x1fcb,0xffb8,0xffb9,0xffba,0xffba,0xffbb,0xffbc,0xffbd,
- 0xffbe,0xffbe,0xffbf,0xffc0,0xffbd,0xffbe,0xffbe,0x7f8b,0xffc1,0xffc2,0xffc3,0xffb4,
- 0x3fb5,0xffc4,0xffc5,0xffc6,0xffb6,0xffc7,0xffc8,0xffc9,0xffba,0xffba,0xffca,0xffcb,
- 0xffbd,0xffbe,0xffbe,0xffbb,0xffbc,0xffbd,0xffbe,0xffbe,0x01d6,0x1fcc,0xffcc,0xffcd,
- 0xffce,0x07d0,0x1fcd,0xffcf,0xffd0,0xffd1,0x3fb6,0x7f8c,0xffd2,0xffd3,0xff90,0x7f8d,
- 0xffd4,0xffd5,0xffd6,0xff95,0xffd7,0xffd8,0xff94,0xff95,0xff95,0x01d7,0x1fce,0x7f8e,
- 0x7f8f,0xffd9,0x0fcb,0x1fcf,0x3fb7,0xffda,0xffdb,0xffdc,0x7f90,0xffdd,0xffde,0xff9e,
- 0xffdf,0xffe0,0xffe1,0xffe2,0xffa2,0xffe3,0xffe4,0xffa1,0xffa2,0xffa2,0x07d1,0x1fd0,
- 0x7f91,0xffe5,0xffa8,0x0fcc,0x3fb8,0xffe6,0xffe7,0xffaa,0xffe8,0xffe9,0xffea,0xffeb,
- 0xffac,0xffec,0xffed,0xffee,0xffaf,0xffaf,0xffae,0x7f88,0x7f89,0xffaf,0xffaf,0xffef,
- 0xfff0,0xfff1,0xfff2,0xffb4,0xfff3,0xfff4,0xfff5,0xfff6,0xffb6,0xfff7,0xfff8,0xfff9,
- 0xffba,0xffba,0xfffa,0xfffb,0xffbd,0xffbe,0xffbe,0xffbb,0xffbc,0xffbd,0xffbe,0xffbe,
- 0xfffc,0xfffd,0xffb3,0xffb4,0xffb4,0xfffe,0xffff,
-};
-
-static const uint8_t cvh_huffbits4[246] = {
- 2, 4, 7, 10, 4, 5, 7, 10, 7, 8, 10, 14,
- 11, 11, 15, 15, 4, 5, 9, 12, 5, 5, 8, 12,
- 8, 7, 10, 15, 11, 11, 15, 15, 7, 9, 12, 15,
- 8, 8, 12, 15, 10, 10, 13, 15, 14, 14, 15, 0,
- 11, 13, 15, 15, 11, 13, 15, 15, 14, 15, 15, 0,
- 15, 15, 0, 0, 4, 5, 9, 13, 5, 6, 9, 13,
- 9, 9, 11, 15, 14, 13, 15, 15, 4, 6, 9, 12,
- 5, 6, 9, 13, 9, 8, 11, 15, 13, 12, 15, 15,
- 7, 9, 12, 15, 7, 8, 11, 15, 10, 10, 14, 15,
- 14, 15, 15, 0, 10, 12, 15, 15, 11, 13, 15, 15,
- 15, 15, 15, 0, 15, 15, 0, 0, 6, 9, 13, 14,
- 8, 9, 12, 15, 12, 12, 15, 15, 15, 15, 15, 0,
- 7, 9, 13, 15, 8, 9, 12, 15, 11, 12, 15, 15,
- 15, 15, 15, 0, 9, 11, 15, 15, 9, 11, 15, 15,
- 14, 14, 15, 0, 15, 15, 0, 0, 14, 15, 15, 0,
- 14, 15, 15, 0, 15, 15, 0, 0, 0, 0, 0, 0,
- 9, 12, 15, 15, 12, 13, 15, 15, 15, 15, 15, 0,
- 15, 15, 0, 0, 10, 12, 15, 15, 12, 14, 15, 15,
- 15, 15, 15, 0, 15, 15, 0, 0, 14, 15, 15, 0,
- 15, 15, 15, 0, 15, 15, 0, 0, 0, 0, 0, 0,
- 15, 15, 0, 0, 15, 15,
-};
-
-
-static const uint16_t cvh_huffcodes4[246] = {
- 0x0000,0x0004,0x006c,0x03e6,0x0005,0x0012,0x006d,0x03e7,0x006e,0x00e8,0x03e8,0x3fc4,
- 0x07e0,0x07e1,0x7fa4,0x7fa5,0x0006,0x0013,0x01e2,0x0fda,0x0014,0x0015,0x00e9,0x0fdb,
- 0x00ea,0x006f,0x03e9,0x7fa6,0x07e2,0x07e3,0x7fa7,0x7fa8,0x0070,0x01e3,0x0fdc,0x7fa9,
- 0x00eb,0x00ec,0x0fdd,0x7faa,0x03ea,0x03eb,0x1fd6,0x7fab,0x3fc5,0x3fc6,0x7fac,0x1fd6,
- 0x07e4,0x1fd7,0x7fad,0x7fae,0x07e5,0x1fd8,0x7faf,0x7fb0,0x3fc7,0x7fb1,0x7fb2,0x1fd6,
- 0x7fb3,0x7fb4,0x1fd6,0x1fd6,0x0007,0x0016,0x01e4,0x1fd9,0x0017,0x0032,0x01e5,0x1fda,
- 0x01e6,0x01e7,0x07e6,0x7fb5,0x3fc8,0x1fdb,0x7fb6,0x7fb7,0x0008,0x0033,0x01e8,0x0fde,
- 0x0018,0x0034,0x01e9,0x1fdc,0x01ea,0x00ed,0x07e7,0x7fb8,0x1fdd,0x0fdf,0x7fb9,0x7fba,
- 0x0071,0x01eb,0x0fe0,0x7fbb,0x0072,0x00ee,0x07e8,0x7fbc,0x03ec,0x03ed,0x3fc9,0x7fbd,
- 0x3fca,0x7fbe,0x7fbf,0x3fc9,0x03ee,0x0fe1,0x7fc0,0x7fc1,0x07e9,0x1fde,0x7fc2,0x7fc3,
- 0x7fc4,0x7fc5,0x7fc6,0x3fc9,0x7fc7,0x7fc8,0x3fc9,0x3fc9,0x0035,0x01ec,0x1fdf,0x3fcb,
- 0x00ef,0x01ed,0x0fe2,0x7fc9,0x0fe3,0x0fe4,0x7fca,0x7fcb,0x7fcc,0x7fcd,0x7fce,0x7fca,
- 0x0073,0x01ee,0x1fe0,0x7fcf,0x00f0,0x01ef,0x0fe5,0x7fd0,0x07ea,0x0fe6,0x7fd1,0x7fd2,
- 0x7fd3,0x7fd4,0x7fd5,0x7fd1,0x01f0,0x07eb,0x7fd6,0x7fd7,0x01f1,0x07ec,0x7fd8,0x7fd9,
- 0x3fcc,0x3fcd,0x7fda,0x7fda,0x7fdb,0x7fdc,0x7fda,0x7fda,0x3fce,0x7fdd,0x7fde,0x7fd6,
- 0x3fcf,0x7fdf,0x7fe0,0x7fd8,0x7fe1,0x7fe2,0x7fda,0x7fda,0x3fcc,0x3fcd,0x7fda,0x7fda,
- 0x01f2,0x0fe7,0x7fe3,0x7fe4,0x0fe8,0x1fe1,0x7fe5,0x7fe6,0x7fe7,0x7fe8,0x7fe9,0x7fca,
- 0x7fea,0x7feb,0x7fca,0x7fca,0x03ef,0x0fe9,0x7fec,0x7fed,0x0fea,0x3fd0,0x7fee,0x7fef,
- 0x7ff0,0x7ff1,0x7ff2,0x7fd1,0x7ff3,0x7ff4,0x7fd1,0x7fd1,0x3fd1,0x7ff5,0x7ff6,0x7fd6,
- 0x7ff7,0x7ff8,0x7ff9,0x7fd8,0x7ffa,0x7ffb,0x7fda,0x7fda,0x3fcc,0x3fcd,0x7fda,0x7fda,
- 0x7ffc,0x7ffd,0x7fd6,0x7fd6,0x7ffe,0x7fff,
-};
-
-
-static const uint8_t cvh_huffbits5[230] = {
- 2, 4, 8, 4, 5, 9, 9, 10, 14, 4, 6, 11,
- 5, 6, 12, 10, 11, 15, 9, 11, 15, 10, 13, 15,
- 14, 15, 0, 4, 6, 12, 6, 7, 12, 12, 12, 15,
- 5, 7, 13, 6, 7, 13, 12, 13, 15, 10, 12, 15,
- 11, 13, 15, 15, 15, 0, 8, 13, 15, 11, 12, 15,
- 15, 15, 0, 10, 13, 15, 12, 15, 15, 15, 15, 0,
- 15, 15, 0, 15, 15, 0, 0, 0, 0, 4, 5, 11,
- 5, 7, 12, 11, 12, 15, 6, 7, 13, 7, 8, 14,
- 12, 14, 15, 11, 13, 15, 12, 13, 15, 15, 15, 0,
- 5, 6, 13, 7, 8, 15, 12, 14, 15, 6, 8, 14,
- 7, 8, 15, 14, 15, 15, 12, 12, 15, 12, 13, 15,
- 15, 15, 0, 9, 13, 15, 12, 13, 15, 15, 15, 0,
- 11, 13, 15, 13, 13, 15, 15, 15, 0, 14, 15, 0,
- 15, 15, 0, 0, 0, 0, 8, 10, 15, 11, 12, 15,
- 15, 15, 0, 10, 12, 15, 12, 13, 15, 15, 15, 0,
- 14, 15, 0, 15, 15, 0, 0, 0, 0, 8, 12, 15,
- 12, 13, 15, 15, 15, 0, 11, 13, 15, 13, 15, 15,
- 15, 15, 0, 15, 15, 0, 15, 15, 0, 0, 0, 0,
- 14, 15, 0, 15, 15, 0, 0, 0, 0, 15, 15, 0,
- 15, 15,
-};
-
-
-
-static const uint16_t cvh_huffcodes5[230] = {
- 0x0000,0x0004,0x00f0,0x0005,0x0012,0x01f0,0x01f1,0x03e8,0x3fce,0x0006,0x0030,0x07de,
- 0x0013,0x0031,0x0fd2,0x03e9,0x07df,0x7fb0,0x01f2,0x07e0,0x7fb1,0x03ea,0x1fd2,0x7fb2,
- 0x3fcf,0x7fb3,0x0031,0x0007,0x0032,0x0fd3,0x0033,0x0070,0x0fd4,0x0fd5,0x0fd6,0x7fb4,
- 0x0014,0x0071,0x1fd3,0x0034,0x0072,0x1fd4,0x0fd7,0x1fd5,0x7fb5,0x03eb,0x0fd8,0x7fb6,
- 0x07e1,0x1fd6,0x7fb7,0x7fb8,0x7fb9,0x0072,0x00f1,0x1fd7,0x7fba,0x07e2,0x0fd9,0x7fbb,
- 0x7fbc,0x7fbd,0x0070,0x03ec,0x1fd8,0x7fbe,0x0fda,0x7fbf,0x7fc0,0x7fc1,0x7fc2,0x0072,
- 0x7fc3,0x7fc4,0x0071,0x7fc5,0x7fc6,0x0072,0x0034,0x0072,0x0072,0x0008,0x0015,0x07e3,
- 0x0016,0x0073,0x0fdb,0x07e4,0x0fdc,0x7fc7,0x0035,0x0074,0x1fd9,0x0075,0x00f2,0x3fd0,
- 0x0fdd,0x3fd1,0x7fc8,0x07e5,0x1fda,0x7fc9,0x0fde,0x1fdb,0x7fca,0x7fcb,0x7fcc,0x00f2,
- 0x0017,0x0036,0x1fdc,0x0076,0x00f3,0x7fcd,0x0fdf,0x3fd2,0x7fce,0x0037,0x00f4,0x3fd3,
- 0x0077,0x00f5,0x7fcf,0x3fd4,0x7fd0,0x7fd1,0x0fe0,0x0fe1,0x7fd2,0x0fe2,0x1fdd,0x7fd3,
- 0x7fd4,0x7fd5,0x00f5,0x01f3,0x1fde,0x7fd6,0x0fe3,0x1fdf,0x7fd7,0x7fd8,0x7fd9,0x00f3,
- 0x07e6,0x1fe0,0x7fda,0x1fe1,0x1fe2,0x7fdb,0x7fdc,0x7fdd,0x00f5,0x3fd5,0x7fde,0x00f4,
- 0x7fdf,0x7fe0,0x00f5,0x0077,0x00f5,0x00f5,0x00f6,0x03ed,0x7fe1,0x07e7,0x0fe4,0x7fe2,
- 0x7fe3,0x7fe4,0x0073,0x03ee,0x0fe5,0x7fe5,0x0fe6,0x1fe3,0x7fe6,0x7fe7,0x7fe8,0x00f2,
- 0x3fd6,0x7fe9,0x0074,0x7fea,0x7feb,0x00f2,0x0075,0x00f2,0x00f2,0x00f7,0x0fe7,0x7fec,
- 0x0fe8,0x1fe4,0x7fed,0x7fee,0x7fef,0x00f3,0x07e8,0x1fe5,0x7ff0,0x1fe6,0x7ff1,0x7ff2,
- 0x7ff3,0x7ff4,0x00f5,0x7ff5,0x7ff6,0x00f4,0x7ff7,0x7ff8,0x00f5,0x0077,0x00f5,0x00f5,
- 0x3fd7,0x7ff9,0x0036,0x7ffa,0x7ffb,0x00f3,0x0076,0x00f3,0x00f3,0x7ffc,0x7ffd,0x0000,
- 0x7ffe,0x7fff,
-};
-
-
-static const uint8_t cvh_huffbits6[32] = {
- 1, 4, 4, 6, 4, 6, 6, 8, 4, 6, 6, 8,
- 6, 9, 8, 10, 4, 6, 7, 8, 6, 9, 8, 11,
- 6, 9, 8, 10, 8, 10, 9, 11,
-};
-
-static const uint16_t cvh_huffcodes6[32] = {
- 0x0000,0x0008,0x0009,0x0034,0x000a,0x0035,0x0036,0x00f6,0x000b,0x0037,0x0038,0x00f7,
- 0x0039,0x01fa,0x00f8,0x03fc,0x000c,0x003a,0x007a,0x00f9,0x003b,0x01fb,0x00fa,0x07fe,
- 0x003c,0x01fc,0x00fb,0x03fd,0x00fc,0x03fe,0x01fd,0x07ff,
-};
-
-static const uint16_t* cvh_huffcodes[7] = {
- cvh_huffcodes0, cvh_huffcodes1, cvh_huffcodes2, cvh_huffcodes3,
- cvh_huffcodes4, cvh_huffcodes5, cvh_huffcodes6,
-};
-
-static const uint8_t* cvh_huffbits[7] = {
- cvh_huffbits0, cvh_huffbits1, cvh_huffbits2, cvh_huffbits3,
- cvh_huffbits4, cvh_huffbits5, cvh_huffbits6,
-};
-
-
-static const uint16_t ccpl_huffcodes2[3] = {
- 0x02,0x00,0x03,
-};
-
-static const uint16_t ccpl_huffcodes3[7] = {
- 0x3e,0x1e,0x02,0x00,0x06,0x0e,0x3f,
-};
-
-static const uint16_t ccpl_huffcodes4[15] = {
- 0xfc,0xfd,0x7c,0x3c,0x1c,0x0c,0x04,0x00,0x05,0x0d,0x1d,0x3d,
- 0x7d,0xfe,0xff,
-};
-
-static const uint16_t ccpl_huffcodes5[31] = {
- 0x03f8,0x03f9,0x03fa,0x03fb,0x01f8,0x01f9,0x00f8,0x00f9,0x0078,0x0079,0x0038,0x0039,
- 0x0018,0x0019,0x0004,0x0000,0x0005,0x001a,0x001b,0x003a,0x003b,0x007a,0x007b,0x00fa,
- 0x00fb,0x01fa,0x01fb,0x03fc,0x03fd,0x03fe,0x03ff,
-};
-
-static const uint16_t ccpl_huffcodes6[63] = {
- 0x0004,0x0005,0x0005,0x0006,0x0006,0x0007,0x0007,0x0007,0x0007,0x0008,0x0008,0x0008,
- 0x0008,0x0009,0x0009,0x0009,0x0009,0x000a,0x000a,0x000a,0x000a,0x000a,0x000b,0x000b,
- 0x000b,0x000b,0x000c,0x000d,0x000e,0x000e,0x0010,0x0000,0x000a,0x0018,0x0019,0x0036,
- 0x0037,0x0074,0x0075,0x0076,0x0077,0x00f4,0x00f5,0x00f6,0x00f7,0x01f5,0x01f6,0x01f7,
- 0x01f8,0x03f6,0x03f7,0x03f8,0x03f9,0x03fa,0x07fa,0x07fb,0x07fc,0x07fd,0x0ffd,0x1ffd,
- 0x3ffd,0x3ffe,0xffff,
-};
-
-static const uint8_t ccpl_huffbits2[3] = {
- 2,1,2,
-};
-
-static const uint8_t ccpl_huffbits3[7] = {
- 6,5,2,1,3,4,6,
-};
-
-static const uint8_t ccpl_huffbits4[15] = {
- 8,8,7,6,5,4,3,1,3,4,5,6,7,8,8,
-};
-
-static const uint8_t ccpl_huffbits5[31] = {
- 10,10,10,10,9,9,8,8,7,7,6,6,
- 5,5,3,1,3,5,5,6,6,7,7,8,
- 8,9,9,10,10,10,10,
-};
-
-static const uint8_t ccpl_huffbits6[63] = {
- 16,15,14,13,12,11,11,11,11,10,10,10,
- 10,9,9,9,9,9,8,8,8,8,7,7,
- 7,7,6,6,5,5,3,1,4,5,5,6,
- 6,7,7,7,7,8,8,8,8,9,9,9,
- 9,10,10,10,10,10,11,11,11,11,12,13,
- 14,14,16,
-};
-
-static const uint16_t* ccpl_huffcodes[5] = {
- ccpl_huffcodes2,ccpl_huffcodes3,
- ccpl_huffcodes4,ccpl_huffcodes5,ccpl_huffcodes6
-};
-
-static const uint8_t* ccpl_huffbits[5] = {
- ccpl_huffbits2,ccpl_huffbits3,
- ccpl_huffbits4,ccpl_huffbits5,ccpl_huffbits6
-};
-
-
-//Coupling tables
-
-static const int cplband[51] = {
- 0,1,2,3,4,5,6,7,8,9,
- 10,11,11,12,12,13,13,14,14,14,
- 15,15,15,15,16,16,16,16,16,17,
- 17,17,17,17,17,18,18,18,18,18,
- 18,18,19,19,19,19,19,19,19,19,
- 19,
-};
-
-static const float cplscale2[3] = {
-0.953020632266998,0.70710676908493,0.302905440330505,
-};
-
-static const float cplscale3[7] = {
-0.981279790401459,0.936997592449188,0.875934481620789,0.70710676908493,
-0.482430040836334,0.349335819482803,0.192587479948997,
-};
-
-static const float cplscale4[15] = {
-0.991486728191376,0.973249018192291,0.953020632266998,0.930133521556854,
-0.903453230857849,0.870746195316315,0.826180458068848,0.70710676908493,
-0.563405573368073,0.491732746362686,0.428686618804932,0.367221474647522,
-0.302905440330505,0.229752898216248,0.130207896232605,
-};
-
-static const float cplscale5[31] = {
-0.995926380157471,0.987517595291138,0.978726446628571,0.969505727291107,
-0.95979779958725,0.949531257152557,0.938616216182709,0.926936149597168,
-0.914336204528809,0.900602877140045,0.885426938533783,0.868331849575043,
-0.84851086139679,0.824381768703461,0.791833400726318,0.70710676908493,
-0.610737144947052,0.566034197807312,0.529177963733673,0.495983630418777,
-0.464778542518616,0.434642940759659,0.404955863952637,0.375219136476517,
-0.344963222742081,0.313672333955765,0.280692428350449,0.245068684220314,
-0.205169528722763,0.157508864998817,0.0901700109243393,
-};
-
-static const float cplscale6[63] = {
-0.998005926609039,0.993956744670868,0.989822506904602,0.985598564147949,
-0.981279790401459,0.976860702037811,0.972335040569305,0.967696130275726,
-0.962936460971832,0.958047747612000,0.953020632266998,0.947844684123993,
-0.942508161067963,0.936997592449188,0.931297719478607,0.925390899181366,
-0.919256627559662,0.912870943546295,0.906205296516418,0.899225592613220,
-0.891890347003937,0.884148240089417,0.875934481620789,0.867165684700012,
-0.857730865478516,0.847477376461029,0.836184680461884,0.823513329029083,
-0.808890223503113,0.791194140911102,0.767520070075989,0.707106769084930,
-0.641024887561798,0.611565053462982,0.587959706783295,0.567296981811523,
-0.548448026180267,0.530831515789032,0.514098942279816,0.498019754886627,
-0.482430040836334,0.467206478118896,0.452251672744751,0.437485188245773,
-0.422837972640991,0.408248275518417,0.393658757209778,0.379014074802399,
-0.364258885383606,0.349335819482803,0.334183186292648,0.318732559680939,
-0.302905440330505,0.286608695983887,0.269728302955627,0.252119421958923,
-0.233590632677078,0.213876649737358,0.192587479948997,0.169101938605309,
-0.142307326197624,0.109772264957428,0.0631198287010193,
-};
-
-static const float* cplscales[5] = {
- cplscale2, cplscale3, cplscale4, cplscale5, cplscale6,
-};
diff --git a/src/libffmpeg/libavcodec/cscd.c b/src/libffmpeg/libavcodec/cscd.c
deleted file mode 100644
index d8733d6dd..000000000
--- a/src/libffmpeg/libavcodec/cscd.c
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- * CamStudio decoder
- * Copyright (c) 2006 Reimar Doeffinger
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "common.h"
-#include "avcodec.h"
-
-#ifdef CONFIG_ZLIB
-#include <zlib.h>
-#endif
-#include "lzo.h"
-
-typedef struct {
- AVFrame pic;
- int linelen, height, bpp;
- unsigned int decomp_size;
- unsigned char* decomp_buf;
-} CamStudioContext;
-
-static void copy_frame_default(AVFrame *f, uint8_t *src,
- int linelen, int height) {
- int i;
- uint8_t *dst = f->data[0];
- dst += (height - 1) * f->linesize[0];
- for (i = height; i; i--) {
- memcpy(dst, src, linelen);
- src += linelen;
- dst -= f->linesize[0];
- }
-}
-
-static void add_frame_default(AVFrame *f, uint8_t *src,
- int linelen, int height) {
- int i, j;
- uint8_t *dst = f->data[0];
- dst += (height - 1) * f->linesize[0];
- for (i = height; i; i--) {
- for (j = linelen; j; j--)
- *dst++ += *src++;
- dst -= f->linesize[0] + linelen;
- }
-}
-
-#ifndef WORDS_BIGENDIAN
-#define copy_frame_16 copy_frame_default
-#define copy_frame_32 copy_frame_default
-#define add_frame_16 add_frame_default
-#define add_frame_32 add_frame_default
-#else
-static void copy_frame_16(AVFrame *f, uint8_t *src,
- int linelen, int height) {
- int i, j;
- uint8_t *dst = f->data[0];
- dst += (height - 1) * f->linesize[0];
- for (i = height; i; i--) {
- for (j = linelen / 2; j; j--) {
- dst[0] = src[1];
- dst[1] = src[0];
- src += 2;
- dst += 2;
- }
- dst -= f->linesize[0] + linelen;
- }
-}
-
-static void copy_frame_32(AVFrame *f, uint8_t *src,
- int linelen, int height) {
- int i, j;
- uint8_t *dst = f->data[0];
- dst += (height - 1) * f->linesize[0];
- for (i = height; i; i--) {
- for (j = linelen / 4; j; j--) {
- dst[0] = src[3];
- dst[1] = src[2];
- dst[2] = src[1];
- dst[3] = src[0];
- src += 4;
- dst += 4;
- }
- dst -= f->linesize[0] + linelen;
- }
-}
-
-static void add_frame_16(AVFrame *f, uint8_t *src,
- int linelen, int height) {
- int i, j;
- uint8_t *dst = f->data[0];
- dst += (height - 1) * f->linesize[0];
- for (i = height; i; i--) {
- for (j = linelen / 2; j; j--) {
- dst[0] += src[1];
- dst[1] += src[0];
- src += 2;
- dst += 2;
- }
- dst -= f->linesize[0] + linelen;
- }
-}
-
-static void add_frame_32(AVFrame *f, uint8_t *src,
- int linelen, int height) {
- int i, j;
- uint8_t *dst = f->data[0];
- dst += (height - 1) * f->linesize[0];
- for (i = height; i; i--) {
- for (j = linelen / 4; j; j--) {
- dst[0] += src[3];
- dst[1] += src[2];
- dst[2] += src[1];
- dst[3] += src[0];
- src += 4;
- dst += 4;
- }
- dst -= f->linesize[0] + linelen;
- }
-}
-#endif
-
-static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
- uint8_t *buf, int buf_size) {
- CamStudioContext *c = (CamStudioContext *)avctx->priv_data;
- AVFrame *picture = data;
-
- if (buf_size < 2) {
- av_log(avctx, AV_LOG_ERROR, "coded frame too small\n");
- return -1;
- }
-
- if (c->pic.data[0])
- avctx->release_buffer(avctx, &c->pic);
- c->pic.reference = 1;
- c->pic.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_READABLE |
- FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
- if (avctx->get_buffer(avctx, &c->pic) < 0) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
-
- // decompress data
- switch ((buf[0] >> 1) & 7) {
- case 0: { // lzo compression
- int outlen = c->decomp_size, inlen = buf_size - 2;
- if (lzo1x_decode(c->decomp_buf, &outlen, &buf[2], &inlen))
- av_log(avctx, AV_LOG_ERROR, "error during lzo decompression\n");
- break;
- }
- case 1: { // zlib compression
-#ifdef CONFIG_ZLIB
- unsigned long dlen = c->decomp_size;
- if (uncompress(c->decomp_buf, &dlen, &buf[2], buf_size - 2) != Z_OK)
- av_log(avctx, AV_LOG_ERROR, "error during zlib decompression\n");
- break;
-#else
- av_log(avctx, AV_LOG_ERROR, "compiled without zlib support\n");
- return -1;
-#endif
- }
- default:
- av_log(avctx, AV_LOG_ERROR, "unknown compression\n");
- return -1;
- }
-
- // flip upside down, add difference frame
- if (buf[0] & 1) { // keyframe
- c->pic.pict_type = FF_I_TYPE;
- c->pic.key_frame = 1;
- switch (c->bpp) {
- case 16:
- copy_frame_16(&c->pic, c->decomp_buf, c->linelen, c->height);
- break;
- case 32:
- copy_frame_32(&c->pic, c->decomp_buf, c->linelen, c->height);
- break;
- default:
- copy_frame_default(&c->pic, c->decomp_buf, c->linelen, c->height);
- }
- } else {
- c->pic.pict_type = FF_P_TYPE;
- c->pic.key_frame = 0;
- switch (c->bpp) {
- case 16:
- add_frame_16(&c->pic, c->decomp_buf, c->linelen, c->height);
- break;
- case 32:
- add_frame_32(&c->pic, c->decomp_buf, c->linelen, c->height);
- break;
- default:
- add_frame_default(&c->pic, c->decomp_buf, c->linelen, c->height);
- }
- }
-
- *picture = c->pic;
- *data_size = sizeof(AVFrame);
- return buf_size;
-}
-
-static int decode_init(AVCodecContext *avctx) {
- CamStudioContext *c = (CamStudioContext *)avctx->priv_data;
- if (avcodec_check_dimensions(avctx, avctx->height, avctx->width) < 0) {
- return 1;
- }
- avctx->has_b_frames = 0;
- switch (avctx->bits_per_sample) {
- case 16: avctx->pix_fmt = PIX_FMT_RGB555; break;
- case 24: avctx->pix_fmt = PIX_FMT_BGR24; break;
- case 32: avctx->pix_fmt = PIX_FMT_RGBA32; break;
- default:
- av_log(avctx, AV_LOG_ERROR,
- "CamStudio codec error: invalid depth %i bpp\n",
- avctx->bits_per_sample);
- return 1;
- }
- c->bpp = avctx->bits_per_sample;
- c->pic.data[0] = NULL;
- c->linelen = avctx->width * avctx->bits_per_sample / 8;
- c->height = avctx->height;
- c->decomp_size = c->height * c->linelen;
- c->decomp_buf = av_malloc(c->decomp_size + LZO_OUTPUT_PADDING);
- if (!c->decomp_buf) {
- av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n");
- return 1;
- }
- return 0;
-}
-
-static int decode_end(AVCodecContext *avctx) {
- CamStudioContext *c = (CamStudioContext *)avctx->priv_data;
- av_freep(&c->decomp_buf);
- if (c->pic.data[0])
- avctx->release_buffer(avctx, &c->pic);
- return 0;
-}
-
-AVCodec cscd_decoder = {
- "camstudio",
- CODEC_TYPE_VIDEO,
- CODEC_ID_CSCD,
- sizeof(CamStudioContext),
- decode_init,
- NULL,
- decode_end,
- decode_frame,
- CODEC_CAP_DR1,
-};
-
diff --git a/src/libffmpeg/libavcodec/cyuv.c b/src/libffmpeg/libavcodec/cyuv.c
deleted file mode 100644
index 101f2bd85..000000000
--- a/src/libffmpeg/libavcodec/cyuv.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- *
- * Copyright (C) 2003 the ffmpeg project
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Creative YUV (CYUV) Video Decoder
- * by Mike Melanson (melanson@pcisys.net)
- * based on "Creative YUV (CYUV) stream format for AVI":
- * http://www.csse.monash.edu.au/~timf/videocodec/cyuv.txt
- *
- */
-
-/**
- * @file cyuv.c
- * Creative YUV (CYUV) Video Decoder.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "common.h"
-#include "avcodec.h"
-#include "dsputil.h"
-#include "mpegvideo.h"
-
-
-typedef struct CyuvDecodeContext {
- AVCodecContext *avctx;
- int width, height;
- AVFrame frame;
-} CyuvDecodeContext;
-
-static int cyuv_decode_init(AVCodecContext *avctx)
-{
- CyuvDecodeContext *s = avctx->priv_data;
-
- s->avctx = avctx;
- s->width = avctx->width;
- /* width needs to be divisible by 4 for this codec to work */
- if (s->width & 0x3)
- return -1;
- s->height = avctx->height;
- avctx->pix_fmt = PIX_FMT_YUV411P;
- avctx->has_b_frames = 0;
-
- return 0;
-}
-
-static int cyuv_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- CyuvDecodeContext *s=avctx->priv_data;
-
- unsigned char *y_plane;
- unsigned char *u_plane;
- unsigned char *v_plane;
- int y_ptr;
- int u_ptr;
- int v_ptr;
-
- /* prediction error tables (make it clear that they are signed values) */
- signed char *y_table = (signed char*)buf + 0;
- signed char *u_table = (signed char*)buf + 16;
- signed char *v_table = (signed char*)buf + 32;
-
- unsigned char y_pred, u_pred, v_pred;
- int stream_ptr;
- unsigned char cur_byte;
- int pixel_groups;
-
- /* sanity check the buffer size: A buffer has 3x16-bytes tables
- * followed by (height) lines each with 3 bytes to represent groups
- * of 4 pixels. Thus, the total size of the buffer ought to be:
- * (3 * 16) + height * (width * 3 / 4) */
- if (buf_size != 48 + s->height * (s->width * 3 / 4)) {
- av_log(avctx, AV_LOG_ERROR, "ffmpeg: cyuv: got a buffer with %d bytes when %d were expected\n",
- buf_size,
- 48 + s->height * (s->width * 3 / 4));
- return -1;
- }
-
- /* pixel data starts 48 bytes in, after 3x16-byte tables */
- stream_ptr = 48;
-
- if(s->frame.data[0])
- avctx->release_buffer(avctx, &s->frame);
-
- s->frame.buffer_hints = FF_BUFFER_HINTS_VALID;
- s->frame.reference = 0;
- if(avctx->get_buffer(avctx, &s->frame) < 0) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
-
- y_plane = s->frame.data[0];
- u_plane = s->frame.data[1];
- v_plane = s->frame.data[2];
-
- /* iterate through each line in the height */
- for (y_ptr = 0, u_ptr = 0, v_ptr = 0;
- y_ptr < (s->height * s->frame.linesize[0]);
- y_ptr += s->frame.linesize[0] - s->width,
- u_ptr += s->frame.linesize[1] - s->width / 4,
- v_ptr += s->frame.linesize[2] - s->width / 4) {
-
- /* reset predictors */
- cur_byte = buf[stream_ptr++];
- u_plane[u_ptr++] = u_pred = cur_byte & 0xF0;
- y_plane[y_ptr++] = y_pred = (cur_byte & 0x0F) << 4;
-
- cur_byte = buf[stream_ptr++];
- v_plane[v_ptr++] = v_pred = cur_byte & 0xF0;
- y_pred += y_table[cur_byte & 0x0F];
- y_plane[y_ptr++] = y_pred;
-
- cur_byte = buf[stream_ptr++];
- y_pred += y_table[cur_byte & 0x0F];
- y_plane[y_ptr++] = y_pred;
- y_pred += y_table[(cur_byte & 0xF0) >> 4];
- y_plane[y_ptr++] = y_pred;
-
- /* iterate through the remaining pixel groups (4 pixels/group) */
- pixel_groups = s->width / 4 - 1;
- while (pixel_groups--) {
-
- cur_byte = buf[stream_ptr++];
- u_pred += u_table[(cur_byte & 0xF0) >> 4];
- u_plane[u_ptr++] = u_pred;
- y_pred += y_table[cur_byte & 0x0F];
- y_plane[y_ptr++] = y_pred;
-
- cur_byte = buf[stream_ptr++];
- v_pred += v_table[(cur_byte & 0xF0) >> 4];
- v_plane[v_ptr++] = v_pred;
- y_pred += y_table[cur_byte & 0x0F];
- y_plane[y_ptr++] = y_pred;
-
- cur_byte = buf[stream_ptr++];
- y_pred += y_table[cur_byte & 0x0F];
- y_plane[y_ptr++] = y_pred;
- y_pred += y_table[(cur_byte & 0xF0) >> 4];
- y_plane[y_ptr++] = y_pred;
-
- }
- }
-
- *data_size=sizeof(AVFrame);
- *(AVFrame*)data= s->frame;
-
- return buf_size;
-}
-
-static int cyuv_decode_end(AVCodecContext *avctx)
-{
-/* CyuvDecodeContext *s = avctx->priv_data;*/
-
- return 0;
-}
-
-AVCodec cyuv_decoder = {
- "cyuv",
- CODEC_TYPE_VIDEO,
- CODEC_ID_CYUV,
- sizeof(CyuvDecodeContext),
- cyuv_decode_init,
- NULL,
- cyuv_decode_end,
- cyuv_decode_frame,
- CODEC_CAP_DR1,
- NULL
-};
-
diff --git a/src/libffmpeg/libavcodec/dpcm.c b/src/libffmpeg/libavcodec/dpcm.c
deleted file mode 100644
index 6243881de..000000000
--- a/src/libffmpeg/libavcodec/dpcm.c
+++ /dev/null
@@ -1,335 +0,0 @@
-/*
- * Assorted DPCM codecs
- * Copyright (c) 2003 The ffmpeg Project.
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file: dpcm.c
- * Assorted DPCM (differential pulse code modulation) audio codecs
- * by Mike Melanson (melanson@pcisys.net)
- * Xan DPCM decoder by Mario Brito (mbrito@student.dei.uc.pt)
- * for more information on the specific data formats, visit:
- * http://www.pcisys.net/~melanson/codecs/simpleaudio.html
- * SOL DPCMs implemented by Konstantin Shishkov
- *
- * Note about using the Xan DPCM decoder: Xan DPCM is used in AVI files
- * found in the Wing Commander IV computer game. These AVI files contain
- * WAVEFORMAT headers which report the audio format as 0x01: raw PCM.
- * Clearly incorrect. To detect Xan DPCM, you will probably have to
- * special-case your AVI demuxer to use Xan DPCM if the file uses 'Xxan'
- * (Xan video) for its video codec. Alternately, such AVI files also contain
- * the fourcc 'Axan' in the 'auds' chunk of the AVI header.
- */
-
-#include "avcodec.h"
-
-typedef struct DPCMContext {
- int channels;
- short roq_square_array[256];
- long sample[2];//for SOL_DPCM
- const int *sol_table;//for SOL_DPCM
-} DPCMContext;
-
-#define SATURATE_S16(x) if (x < -32768) x = -32768; \
- else if (x > 32767) x = 32767;
-#define SE_16BIT(x) if (x & 0x8000) x -= 0x10000;
-
-static int interplay_delta_table[] = {
- 0, 1, 2, 3, 4, 5, 6, 7,
- 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23,
- 24, 25, 26, 27, 28, 29, 30, 31,
- 32, 33, 34, 35, 36, 37, 38, 39,
- 40, 41, 42, 43, 47, 51, 56, 61,
- 66, 72, 79, 86, 94, 102, 112, 122,
- 133, 145, 158, 173, 189, 206, 225, 245,
- 267, 292, 318, 348, 379, 414, 452, 493,
- 538, 587, 640, 699, 763, 832, 908, 991,
- 1081, 1180, 1288, 1405, 1534, 1673, 1826, 1993,
- 2175, 2373, 2590, 2826, 3084, 3365, 3672, 4008,
- 4373, 4772, 5208, 5683, 6202, 6767, 7385, 8059,
- 8794, 9597, 10472, 11428, 12471, 13609, 14851, 16206,
- 17685, 19298, 21060, 22981, 25078, 27367, 29864, 32589,
- -29973, -26728, -23186, -19322, -15105, -10503, -5481, -1,
- 1, 1, 5481, 10503, 15105, 19322, 23186, 26728,
- 29973, -32589, -29864, -27367, -25078, -22981, -21060, -19298,
- -17685, -16206, -14851, -13609, -12471, -11428, -10472, -9597,
- -8794, -8059, -7385, -6767, -6202, -5683, -5208, -4772,
- -4373, -4008, -3672, -3365, -3084, -2826, -2590, -2373,
- -2175, -1993, -1826, -1673, -1534, -1405, -1288, -1180,
- -1081, -991, -908, -832, -763, -699, -640, -587,
- -538, -493, -452, -414, -379, -348, -318, -292,
- -267, -245, -225, -206, -189, -173, -158, -145,
- -133, -122, -112, -102, -94, -86, -79, -72,
- -66, -61, -56, -51, -47, -43, -42, -41,
- -40, -39, -38, -37, -36, -35, -34, -33,
- -32, -31, -30, -29, -28, -27, -26, -25,
- -24, -23, -22, -21, -20, -19, -18, -17,
- -16, -15, -14, -13, -12, -11, -10, -9,
- -8, -7, -6, -5, -4, -3, -2, -1
-
-};
-
-static const int sol_table_old[16] =
- { 0x0, 0x1, 0x2 , 0x3, 0x6, 0xA, 0xF, 0x15,
- -0x15, -0xF, -0xA, -0x6, -0x3, -0x2, -0x1, 0x0};
-
-static const int sol_table_new[16] =
- { 0x0, 0x1, 0x2, 0x3, 0x6, 0xA, 0xF, 0x15,
- 0x0, -0x1, -0x2, -0x3, -0x6, -0xA, -0xF, -0x15};
-
-static const int sol_table_16[128] = {
- 0x000, 0x008, 0x010, 0x020, 0x030, 0x040, 0x050, 0x060, 0x070, 0x080,
- 0x090, 0x0A0, 0x0B0, 0x0C0, 0x0D0, 0x0E0, 0x0F0, 0x100, 0x110, 0x120,
- 0x130, 0x140, 0x150, 0x160, 0x170, 0x180, 0x190, 0x1A0, 0x1B0, 0x1C0,
- 0x1D0, 0x1E0, 0x1F0, 0x200, 0x208, 0x210, 0x218, 0x220, 0x228, 0x230,
- 0x238, 0x240, 0x248, 0x250, 0x258, 0x260, 0x268, 0x270, 0x278, 0x280,
- 0x288, 0x290, 0x298, 0x2A0, 0x2A8, 0x2B0, 0x2B8, 0x2C0, 0x2C8, 0x2D0,
- 0x2D8, 0x2E0, 0x2E8, 0x2F0, 0x2F8, 0x300, 0x308, 0x310, 0x318, 0x320,
- 0x328, 0x330, 0x338, 0x340, 0x348, 0x350, 0x358, 0x360, 0x368, 0x370,
- 0x378, 0x380, 0x388, 0x390, 0x398, 0x3A0, 0x3A8, 0x3B0, 0x3B8, 0x3C0,
- 0x3C8, 0x3D0, 0x3D8, 0x3E0, 0x3E8, 0x3F0, 0x3F8, 0x400, 0x440, 0x480,
- 0x4C0, 0x500, 0x540, 0x580, 0x5C0, 0x600, 0x640, 0x680, 0x6C0, 0x700,
- 0x740, 0x780, 0x7C0, 0x800, 0x900, 0xA00, 0xB00, 0xC00, 0xD00, 0xE00,
- 0xF00, 0x1000, 0x1400, 0x1800, 0x1C00, 0x2000, 0x3000, 0x4000
-};
-
-
-
-static int dpcm_decode_init(AVCodecContext *avctx)
-{
- DPCMContext *s = avctx->priv_data;
- int i;
- short square;
-
- s->channels = avctx->channels;
- s->sample[0] = s->sample[1] = 0;
-
- switch(avctx->codec->id) {
-
- case CODEC_ID_ROQ_DPCM:
- /* initialize square table */
- for (i = 0; i < 128; i++) {
- square = i * i;
- s->roq_square_array[i] = square;
- s->roq_square_array[i + 128] = -square;
- }
- break;
-
-
- case CODEC_ID_SOL_DPCM:
- switch(avctx->codec_tag){
- case 1:
- s->sol_table=sol_table_old;
- s->sample[0] = s->sample[1] = 0x80;
- break;
- case 2:
- s->sol_table=sol_table_new;
- s->sample[0] = s->sample[1] = 0x80;
- break;
- case 3:
- s->sol_table=sol_table_16;
- break;
- default:
- av_log(avctx, AV_LOG_ERROR, "Unknown SOL subcodec\n");
- return -1;
- }
- break;
-
- default:
- break;
- }
-
- return 0;
-}
-
-static int dpcm_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- DPCMContext *s = avctx->priv_data;
- int in, out = 0;
- int predictor[2];
- int channel_number = 0;
- short *output_samples = data;
- int shift[2];
- unsigned char byte;
- short diff;
-
- if (!buf_size)
- return 0;
-
- switch(avctx->codec->id) {
-
- case CODEC_ID_ROQ_DPCM:
- if (s->channels == 1)
- predictor[0] = AV_RL16(&buf[6]);
- else {
- predictor[0] = buf[7] << 8;
- predictor[1] = buf[6] << 8;
- }
- SE_16BIT(predictor[0]);
- SE_16BIT(predictor[1]);
-
- /* decode the samples */
- for (in = 8, out = 0; in < buf_size; in++, out++) {
- predictor[channel_number] += s->roq_square_array[buf[in]];
- SATURATE_S16(predictor[channel_number]);
- output_samples[out] = predictor[channel_number];
-
- /* toggle channel */
- channel_number ^= s->channels - 1;
- }
- break;
-
- case CODEC_ID_INTERPLAY_DPCM:
- in = 6; /* skip over the stream mask and stream length */
- predictor[0] = AV_RL16(&buf[in]);
- in += 2;
- SE_16BIT(predictor[0])
- output_samples[out++] = predictor[0];
- if (s->channels == 2) {
- predictor[1] = AV_RL16(&buf[in]);
- in += 2;
- SE_16BIT(predictor[1])
- output_samples[out++] = predictor[1];
- }
-
- while (in < buf_size) {
- predictor[channel_number] += interplay_delta_table[buf[in++]];
- SATURATE_S16(predictor[channel_number]);
- output_samples[out++] = predictor[channel_number];
-
- /* toggle channel */
- channel_number ^= s->channels - 1;
- }
-
- break;
-
- case CODEC_ID_XAN_DPCM:
- in = 0;
- shift[0] = shift[1] = 4;
- predictor[0] = AV_RL16(&buf[in]);
- in += 2;
- SE_16BIT(predictor[0]);
- if (s->channels == 2) {
- predictor[1] = AV_RL16(&buf[in]);
- in += 2;
- SE_16BIT(predictor[1]);
- }
-
- while (in < buf_size) {
- byte = buf[in++];
- diff = (byte & 0xFC) << 8;
- if ((byte & 0x03) == 3)
- shift[channel_number]++;
- else
- shift[channel_number] -= (2 * (byte & 3));
- /* saturate the shifter to a lower limit of 0 */
- if (shift[channel_number] < 0)
- shift[channel_number] = 0;
-
- diff >>= shift[channel_number];
- predictor[channel_number] += diff;
-
- SATURATE_S16(predictor[channel_number]);
- output_samples[out++] = predictor[channel_number];
-
- /* toggle channel */
- channel_number ^= s->channels - 1;
- }
- break;
- case CODEC_ID_SOL_DPCM:
- in = 0;
- if (avctx->codec_tag != 3) {
- while (in < buf_size) {
- int n1, n2;
- n1 = (buf[in] >> 4) & 0xF;
- n2 = buf[in++] & 0xF;
- s->sample[0] += s->sol_table[n1];
- if (s->sample[0] < 0) s->sample[0] = 0;
- if (s->sample[0] > 255) s->sample[0] = 255;
- output_samples[out++] = (s->sample[0] - 128) << 8;
- s->sample[s->channels - 1] += s->sol_table[n2];
- if (s->sample[s->channels - 1] < 0) s->sample[s->channels - 1] = 0;
- if (s->sample[s->channels - 1] > 255) s->sample[s->channels - 1] = 255;
- output_samples[out++] = (s->sample[s->channels - 1] - 128) << 8;
- }
- } else {
- while (in < buf_size) {
- int n;
- n = buf[in++];
- if (n & 0x80) s->sample[channel_number] -= s->sol_table[n & 0x7F];
- else s->sample[channel_number] += s->sol_table[n & 0x7F];
- SATURATE_S16(s->sample[channel_number]);
- output_samples[out++] = s->sample[channel_number];
- /* toggle channel */
- channel_number ^= s->channels - 1;
- }
- }
- break;
- }
-
- *data_size = out * sizeof(short);
- return buf_size;
-}
-
-AVCodec roq_dpcm_decoder = {
- "roq_dpcm",
- CODEC_TYPE_AUDIO,
- CODEC_ID_ROQ_DPCM,
- sizeof(DPCMContext),
- dpcm_decode_init,
- NULL,
- NULL,
- dpcm_decode_frame,
-};
-
-AVCodec interplay_dpcm_decoder = {
- "interplay_dpcm",
- CODEC_TYPE_AUDIO,
- CODEC_ID_INTERPLAY_DPCM,
- sizeof(DPCMContext),
- dpcm_decode_init,
- NULL,
- NULL,
- dpcm_decode_frame,
-};
-
-AVCodec xan_dpcm_decoder = {
- "xan_dpcm",
- CODEC_TYPE_AUDIO,
- CODEC_ID_XAN_DPCM,
- sizeof(DPCMContext),
- dpcm_decode_init,
- NULL,
- NULL,
- dpcm_decode_frame,
-};
-
-AVCodec sol_dpcm_decoder = {
- "sol_dpcm",
- CODEC_TYPE_AUDIO,
- CODEC_ID_SOL_DPCM,
- sizeof(DPCMContext),
- dpcm_decode_init,
- NULL,
- NULL,
- dpcm_decode_frame,
-};
diff --git a/src/libffmpeg/libavcodec/dsputil.c b/src/libffmpeg/libavcodec/dsputil.c
deleted file mode 100644
index b4aa09188..000000000
--- a/src/libffmpeg/libavcodec/dsputil.c
+++ /dev/null
@@ -1,4176 +0,0 @@
-/*
- * DSP utils
- * Copyright (c) 2000, 2001 Fabrice Bellard.
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * gmc & q-pel & 32/64 bit based MC by Michael Niedermayer <michaelni@gmx.at>
- */
-
-/**
- * @file dsputil.c
- * DSP utils
- */
-
-#include "avcodec.h"
-#include "dsputil.h"
-#include "mpegvideo.h"
-#include "simple_idct.h"
-#include "faandct.h"
-#include "snow.h"
-
-/* snow.c */
-void ff_spatial_dwt(int *buffer, int width, int height, int stride, int type, int decomposition_count);
-
-/* vorbis.c */
-void vorbis_inverse_coupling(float *mag, float *ang, int blocksize);
-
-uint8_t ff_cropTbl[256 + 2 * MAX_NEG_CROP] = {0, };
-uint32_t ff_squareTbl[512] = {0, };
-
-const uint8_t ff_zigzag_direct[64] = {
- 0, 1, 8, 16, 9, 2, 3, 10,
- 17, 24, 32, 25, 18, 11, 4, 5,
- 12, 19, 26, 33, 40, 48, 41, 34,
- 27, 20, 13, 6, 7, 14, 21, 28,
- 35, 42, 49, 56, 57, 50, 43, 36,
- 29, 22, 15, 23, 30, 37, 44, 51,
- 58, 59, 52, 45, 38, 31, 39, 46,
- 53, 60, 61, 54, 47, 55, 62, 63
-};
-
-/* Specific zigzag scan for 248 idct. NOTE that unlike the
- specification, we interleave the fields */
-const uint8_t ff_zigzag248_direct[64] = {
- 0, 8, 1, 9, 16, 24, 2, 10,
- 17, 25, 32, 40, 48, 56, 33, 41,
- 18, 26, 3, 11, 4, 12, 19, 27,
- 34, 42, 49, 57, 50, 58, 35, 43,
- 20, 28, 5, 13, 6, 14, 21, 29,
- 36, 44, 51, 59, 52, 60, 37, 45,
- 22, 30, 7, 15, 23, 31, 38, 46,
- 53, 61, 54, 62, 39, 47, 55, 63,
-};
-
-/* not permutated inverse zigzag_direct + 1 for MMX quantizer */
-DECLARE_ALIGNED_8(uint16_t, inv_zigzag_direct16[64]) = {0, };
-
-const uint8_t ff_alternate_horizontal_scan[64] = {
- 0, 1, 2, 3, 8, 9, 16, 17,
- 10, 11, 4, 5, 6, 7, 15, 14,
- 13, 12, 19, 18, 24, 25, 32, 33,
- 26, 27, 20, 21, 22, 23, 28, 29,
- 30, 31, 34, 35, 40, 41, 48, 49,
- 42, 43, 36, 37, 38, 39, 44, 45,
- 46, 47, 50, 51, 56, 57, 58, 59,
- 52, 53, 54, 55, 60, 61, 62, 63,
-};
-
-const uint8_t ff_alternate_vertical_scan[64] = {
- 0, 8, 16, 24, 1, 9, 2, 10,
- 17, 25, 32, 40, 48, 56, 57, 49,
- 41, 33, 26, 18, 3, 11, 4, 12,
- 19, 27, 34, 42, 50, 58, 35, 43,
- 51, 59, 20, 28, 5, 13, 6, 14,
- 21, 29, 36, 44, 52, 60, 37, 45,
- 53, 61, 22, 30, 7, 15, 23, 31,
- 38, 46, 54, 62, 39, 47, 55, 63,
-};
-
-/* a*inverse[b]>>32 == a/b for all 0<=a<=65536 && 2<=b<=255 */
-const uint32_t ff_inverse[256]={
- 0, 4294967295U,2147483648U,1431655766, 1073741824, 858993460, 715827883, 613566757,
- 536870912, 477218589, 429496730, 390451573, 357913942, 330382100, 306783379, 286331154,
- 268435456, 252645136, 238609295, 226050911, 214748365, 204522253, 195225787, 186737709,
- 178956971, 171798692, 165191050, 159072863, 153391690, 148102321, 143165577, 138547333,
- 134217728, 130150525, 126322568, 122713352, 119304648, 116080198, 113025456, 110127367,
- 107374183, 104755300, 102261127, 99882961, 97612894, 95443718, 93368855, 91382283,
- 89478486, 87652394, 85899346, 84215046, 82595525, 81037119, 79536432, 78090315,
- 76695845, 75350304, 74051161, 72796056, 71582789, 70409300, 69273667, 68174085,
- 67108864, 66076420, 65075263, 64103990, 63161284, 62245903, 61356676, 60492498,
- 59652324, 58835169, 58040099, 57266231, 56512728, 55778797, 55063684, 54366675,
- 53687092, 53024288, 52377650, 51746594, 51130564, 50529028, 49941481, 49367441,
- 48806447, 48258060, 47721859, 47197443, 46684428, 46182445, 45691142, 45210183,
- 44739243, 44278014, 43826197, 43383509, 42949673, 42524429, 42107523, 41698712,
- 41297763, 40904451, 40518560, 40139882, 39768216, 39403370, 39045158, 38693400,
- 38347923, 38008561, 37675152, 37347542, 37025581, 36709123, 36398028, 36092163,
- 35791395, 35495598, 35204650, 34918434, 34636834, 34359739, 34087043, 33818641,
- 33554432, 33294321, 33038210, 32786010, 32537632, 32292988, 32051995, 31814573,
- 31580642, 31350127, 31122952, 30899046, 30678338, 30460761, 30246249, 30034737,
- 29826162, 29620465, 29417585, 29217465, 29020050, 28825284, 28633116, 28443493,
- 28256364, 28071682, 27889399, 27709467, 27531842, 27356480, 27183338, 27012373,
- 26843546, 26676816, 26512144, 26349493, 26188825, 26030105, 25873297, 25718368,
- 25565282, 25414008, 25264514, 25116768, 24970741, 24826401, 24683721, 24542671,
- 24403224, 24265352, 24129030, 23994231, 23860930, 23729102, 23598722, 23469767,
- 23342214, 23216040, 23091223, 22967740, 22845571, 22724695, 22605092, 22486740,
- 22369622, 22253717, 22139007, 22025474, 21913099, 21801865, 21691755, 21582751,
- 21474837, 21367997, 21262215, 21157475, 21053762, 20951060, 20849356, 20748635,
- 20648882, 20550083, 20452226, 20355296, 20259280, 20164166, 20069941, 19976593,
- 19884108, 19792477, 19701685, 19611723, 19522579, 19434242, 19346700, 19259944,
- 19173962, 19088744, 19004281, 18920561, 18837576, 18755316, 18673771, 18592933,
- 18512791, 18433337, 18354562, 18276457, 18199014, 18122225, 18046082, 17970575,
- 17895698, 17821442, 17747799, 17674763, 17602325, 17530479, 17459217, 17388532,
- 17318417, 17248865, 17179870, 17111424, 17043522, 16976156, 16909321, 16843010,
-};
-
-/* Input permutation for the simple_idct_mmx */
-static const uint8_t simple_mmx_permutation[64]={
- 0x00, 0x08, 0x04, 0x09, 0x01, 0x0C, 0x05, 0x0D,
- 0x10, 0x18, 0x14, 0x19, 0x11, 0x1C, 0x15, 0x1D,
- 0x20, 0x28, 0x24, 0x29, 0x21, 0x2C, 0x25, 0x2D,
- 0x12, 0x1A, 0x16, 0x1B, 0x13, 0x1E, 0x17, 0x1F,
- 0x02, 0x0A, 0x06, 0x0B, 0x03, 0x0E, 0x07, 0x0F,
- 0x30, 0x38, 0x34, 0x39, 0x31, 0x3C, 0x35, 0x3D,
- 0x22, 0x2A, 0x26, 0x2B, 0x23, 0x2E, 0x27, 0x2F,
- 0x32, 0x3A, 0x36, 0x3B, 0x33, 0x3E, 0x37, 0x3F,
-};
-
-static int pix_sum_c(uint8_t * pix, int line_size)
-{
- int s, i, j;
-
- s = 0;
- for (i = 0; i < 16; i++) {
- for (j = 0; j < 16; j += 8) {
- s += pix[0];
- s += pix[1];
- s += pix[2];
- s += pix[3];
- s += pix[4];
- s += pix[5];
- s += pix[6];
- s += pix[7];
- pix += 8;
- }
- pix += line_size - 16;
- }
- return s;
-}
-
-static int pix_norm1_c(uint8_t * pix, int line_size)
-{
- int s, i, j;
- uint32_t *sq = ff_squareTbl + 256;
-
- s = 0;
- for (i = 0; i < 16; i++) {
- for (j = 0; j < 16; j += 8) {
-#if 0
- s += sq[pix[0]];
- s += sq[pix[1]];
- s += sq[pix[2]];
- s += sq[pix[3]];
- s += sq[pix[4]];
- s += sq[pix[5]];
- s += sq[pix[6]];
- s += sq[pix[7]];
-#else
-#if LONG_MAX > 2147483647
- register uint64_t x=*(uint64_t*)pix;
- s += sq[x&0xff];
- s += sq[(x>>8)&0xff];
- s += sq[(x>>16)&0xff];
- s += sq[(x>>24)&0xff];
- s += sq[(x>>32)&0xff];
- s += sq[(x>>40)&0xff];
- s += sq[(x>>48)&0xff];
- s += sq[(x>>56)&0xff];
-#else
- register uint32_t x=*(uint32_t*)pix;
- s += sq[x&0xff];
- s += sq[(x>>8)&0xff];
- s += sq[(x>>16)&0xff];
- s += sq[(x>>24)&0xff];
- x=*(uint32_t*)(pix+4);
- s += sq[x&0xff];
- s += sq[(x>>8)&0xff];
- s += sq[(x>>16)&0xff];
- s += sq[(x>>24)&0xff];
-#endif
-#endif
- pix += 8;
- }
- pix += line_size - 16;
- }
- return s;
-}
-
-static void bswap_buf(uint32_t *dst, uint32_t *src, int w){
- int i;
-
- for(i=0; i+8<=w; i+=8){
- dst[i+0]= bswap_32(src[i+0]);
- dst[i+1]= bswap_32(src[i+1]);
- dst[i+2]= bswap_32(src[i+2]);
- dst[i+3]= bswap_32(src[i+3]);
- dst[i+4]= bswap_32(src[i+4]);
- dst[i+5]= bswap_32(src[i+5]);
- dst[i+6]= bswap_32(src[i+6]);
- dst[i+7]= bswap_32(src[i+7]);
- }
- for(;i<w; i++){
- dst[i+0]= bswap_32(src[i+0]);
- }
-}
-
-static int sse4_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h)
-{
- int s, i;
- uint32_t *sq = ff_squareTbl + 256;
-
- s = 0;
- for (i = 0; i < h; i++) {
- s += sq[pix1[0] - pix2[0]];
- s += sq[pix1[1] - pix2[1]];
- s += sq[pix1[2] - pix2[2]];
- s += sq[pix1[3] - pix2[3]];
- pix1 += line_size;
- pix2 += line_size;
- }
- return s;
-}
-
-static int sse8_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h)
-{
- int s, i;
- uint32_t *sq = ff_squareTbl + 256;
-
- s = 0;
- for (i = 0; i < h; i++) {
- s += sq[pix1[0] - pix2[0]];
- s += sq[pix1[1] - pix2[1]];
- s += sq[pix1[2] - pix2[2]];
- s += sq[pix1[3] - pix2[3]];
- s += sq[pix1[4] - pix2[4]];
- s += sq[pix1[5] - pix2[5]];
- s += sq[pix1[6] - pix2[6]];
- s += sq[pix1[7] - pix2[7]];
- pix1 += line_size;
- pix2 += line_size;
- }
- return s;
-}
-
-static int sse16_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
- int s, i;
- uint32_t *sq = ff_squareTbl + 256;
-
- s = 0;
- for (i = 0; i < h; i++) {
- s += sq[pix1[ 0] - pix2[ 0]];
- s += sq[pix1[ 1] - pix2[ 1]];
- s += sq[pix1[ 2] - pix2[ 2]];
- s += sq[pix1[ 3] - pix2[ 3]];
- s += sq[pix1[ 4] - pix2[ 4]];
- s += sq[pix1[ 5] - pix2[ 5]];
- s += sq[pix1[ 6] - pix2[ 6]];
- s += sq[pix1[ 7] - pix2[ 7]];
- s += sq[pix1[ 8] - pix2[ 8]];
- s += sq[pix1[ 9] - pix2[ 9]];
- s += sq[pix1[10] - pix2[10]];
- s += sq[pix1[11] - pix2[11]];
- s += sq[pix1[12] - pix2[12]];
- s += sq[pix1[13] - pix2[13]];
- s += sq[pix1[14] - pix2[14]];
- s += sq[pix1[15] - pix2[15]];
-
- pix1 += line_size;
- pix2 += line_size;
- }
- return s;
-}
-
-
-#ifdef CONFIG_SNOW_ENCODER //dwt is in snow.c
-static inline int w_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int w, int h, int type){
- int s, i, j;
- const int dec_count= w==8 ? 3 : 4;
- int tmp[32*32];
- int level, ori;
- static const int scale[2][2][4][4]={
- {
- {
- // 9/7 8x8 dec=3
- {268, 239, 239, 213},
- { 0, 224, 224, 152},
- { 0, 135, 135, 110},
- },{
- // 9/7 16x16 or 32x32 dec=4
- {344, 310, 310, 280},
- { 0, 320, 320, 228},
- { 0, 175, 175, 136},
- { 0, 129, 129, 102},
- }
- },{
- {
- // 5/3 8x8 dec=3
- {275, 245, 245, 218},
- { 0, 230, 230, 156},
- { 0, 138, 138, 113},
- },{
- // 5/3 16x16 or 32x32 dec=4
- {352, 317, 317, 286},
- { 0, 328, 328, 233},
- { 0, 180, 180, 140},
- { 0, 132, 132, 105},
- }
- }
- };
-
- for (i = 0; i < h; i++) {
- for (j = 0; j < w; j+=4) {
- tmp[32*i+j+0] = (pix1[j+0] - pix2[j+0])<<4;
- tmp[32*i+j+1] = (pix1[j+1] - pix2[j+1])<<4;
- tmp[32*i+j+2] = (pix1[j+2] - pix2[j+2])<<4;
- tmp[32*i+j+3] = (pix1[j+3] - pix2[j+3])<<4;
- }
- pix1 += line_size;
- pix2 += line_size;
- }
-
- ff_spatial_dwt(tmp, w, h, 32, type, dec_count);
-
- s=0;
- assert(w==h);
- for(level=0; level<dec_count; level++){
- for(ori= level ? 1 : 0; ori<4; ori++){
- int size= w>>(dec_count-level);
- int sx= (ori&1) ? size : 0;
- int stride= 32<<(dec_count-level);
- int sy= (ori&2) ? stride>>1 : 0;
-
- for(i=0; i<size; i++){
- for(j=0; j<size; j++){
- int v= tmp[sx + sy + i*stride + j] * scale[type][dec_count-3][level][ori];
- s += FFABS(v);
- }
- }
- }
- }
- assert(s>=0);
- return s>>9;
-}
-
-static int w53_8_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h){
- return w_c(v, pix1, pix2, line_size, 8, h, 1);
-}
-
-static int w97_8_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h){
- return w_c(v, pix1, pix2, line_size, 8, h, 0);
-}
-
-static int w53_16_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h){
- return w_c(v, pix1, pix2, line_size, 16, h, 1);
-}
-
-static int w97_16_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h){
- return w_c(v, pix1, pix2, line_size, 16, h, 0);
-}
-
-int w53_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h){
- return w_c(v, pix1, pix2, line_size, 32, h, 1);
-}
-
-int w97_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h){
- return w_c(v, pix1, pix2, line_size, 32, h, 0);
-}
-#endif
-
-static void get_pixels_c(DCTELEM *restrict block, const uint8_t *pixels, int line_size)
-{
- int i;
-
- /* read the pixels */
- for(i=0;i<8;i++) {
- block[0] = pixels[0];
- block[1] = pixels[1];
- block[2] = pixels[2];
- block[3] = pixels[3];
- block[4] = pixels[4];
- block[5] = pixels[5];
- block[6] = pixels[6];
- block[7] = pixels[7];
- pixels += line_size;
- block += 8;
- }
-}
-
-static void diff_pixels_c(DCTELEM *restrict block, const uint8_t *s1,
- const uint8_t *s2, int stride){
- int i;
-
- /* read the pixels */
- for(i=0;i<8;i++) {
- block[0] = s1[0] - s2[0];
- block[1] = s1[1] - s2[1];
- block[2] = s1[2] - s2[2];
- block[3] = s1[3] - s2[3];
- block[4] = s1[4] - s2[4];
- block[5] = s1[5] - s2[5];
- block[6] = s1[6] - s2[6];
- block[7] = s1[7] - s2[7];
- s1 += stride;
- s2 += stride;
- block += 8;
- }
-}
-
-
-static void put_pixels_clamped_c(const DCTELEM *block, uint8_t *restrict pixels,
- int line_size)
-{
- int i;
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-
- /* read the pixels */
- for(i=0;i<8;i++) {
- pixels[0] = cm[block[0]];
- pixels[1] = cm[block[1]];
- pixels[2] = cm[block[2]];
- pixels[3] = cm[block[3]];
- pixels[4] = cm[block[4]];
- pixels[5] = cm[block[5]];
- pixels[6] = cm[block[6]];
- pixels[7] = cm[block[7]];
-
- pixels += line_size;
- block += 8;
- }
-}
-
-static void put_pixels_clamped4_c(const DCTELEM *block, uint8_t *restrict pixels,
- int line_size)
-{
- int i;
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-
- /* read the pixels */
- for(i=0;i<4;i++) {
- pixels[0] = cm[block[0]];
- pixels[1] = cm[block[1]];
- pixels[2] = cm[block[2]];
- pixels[3] = cm[block[3]];
-
- pixels += line_size;
- block += 8;
- }
-}
-
-static void put_pixels_clamped2_c(const DCTELEM *block, uint8_t *restrict pixels,
- int line_size)
-{
- int i;
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-
- /* read the pixels */
- for(i=0;i<2;i++) {
- pixels[0] = cm[block[0]];
- pixels[1] = cm[block[1]];
-
- pixels += line_size;
- block += 8;
- }
-}
-
-static void put_signed_pixels_clamped_c(const DCTELEM *block,
- uint8_t *restrict pixels,
- int line_size)
-{
- int i, j;
-
- for (i = 0; i < 8; i++) {
- for (j = 0; j < 8; j++) {
- if (*block < -128)
- *pixels = 0;
- else if (*block > 127)
- *pixels = 255;
- else
- *pixels = (uint8_t)(*block + 128);
- block++;
- pixels++;
- }
- pixels += (line_size - 8);
- }
-}
-
-static void add_pixels_clamped_c(const DCTELEM *block, uint8_t *restrict pixels,
- int line_size)
-{
- int i;
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-
- /* read the pixels */
- for(i=0;i<8;i++) {
- pixels[0] = cm[pixels[0] + block[0]];
- pixels[1] = cm[pixels[1] + block[1]];
- pixels[2] = cm[pixels[2] + block[2]];
- pixels[3] = cm[pixels[3] + block[3]];
- pixels[4] = cm[pixels[4] + block[4]];
- pixels[5] = cm[pixels[5] + block[5]];
- pixels[6] = cm[pixels[6] + block[6]];
- pixels[7] = cm[pixels[7] + block[7]];
- pixels += line_size;
- block += 8;
- }
-}
-
-static void add_pixels_clamped4_c(const DCTELEM *block, uint8_t *restrict pixels,
- int line_size)
-{
- int i;
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-
- /* read the pixels */
- for(i=0;i<4;i++) {
- pixels[0] = cm[pixels[0] + block[0]];
- pixels[1] = cm[pixels[1] + block[1]];
- pixels[2] = cm[pixels[2] + block[2]];
- pixels[3] = cm[pixels[3] + block[3]];
- pixels += line_size;
- block += 8;
- }
-}
-
-static void add_pixels_clamped2_c(const DCTELEM *block, uint8_t *restrict pixels,
- int line_size)
-{
- int i;
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-
- /* read the pixels */
- for(i=0;i<2;i++) {
- pixels[0] = cm[pixels[0] + block[0]];
- pixels[1] = cm[pixels[1] + block[1]];
- pixels += line_size;
- block += 8;
- }
-}
-
-static void add_pixels8_c(uint8_t *restrict pixels, DCTELEM *block, int line_size)
-{
- int i;
- for(i=0;i<8;i++) {
- pixels[0] += block[0];
- pixels[1] += block[1];
- pixels[2] += block[2];
- pixels[3] += block[3];
- pixels[4] += block[4];
- pixels[5] += block[5];
- pixels[6] += block[6];
- pixels[7] += block[7];
- pixels += line_size;
- block += 8;
- }
-}
-
-static void add_pixels4_c(uint8_t *restrict pixels, DCTELEM *block, int line_size)
-{
- int i;
- for(i=0;i<4;i++) {
- pixels[0] += block[0];
- pixels[1] += block[1];
- pixels[2] += block[2];
- pixels[3] += block[3];
- pixels += line_size;
- block += 4;
- }
-}
-
-#if 0
-
-#define PIXOP2(OPNAME, OP) \
-static void OPNAME ## _pixels(uint8_t *block, const uint8_t *pixels, int line_size, int h)\
-{\
- int i;\
- for(i=0; i<h; i++){\
- OP(*((uint64_t*)block), LD64(pixels));\
- pixels+=line_size;\
- block +=line_size;\
- }\
-}\
-\
-static void OPNAME ## _no_rnd_pixels_x2_c(uint8_t *block, const uint8_t *pixels, int line_size, int h)\
-{\
- int i;\
- for(i=0; i<h; i++){\
- const uint64_t a= LD64(pixels );\
- const uint64_t b= LD64(pixels+1);\
- OP(*((uint64_t*)block), (a&b) + (((a^b)&0xFEFEFEFEFEFEFEFEULL)>>1));\
- pixels+=line_size;\
- block +=line_size;\
- }\
-}\
-\
-static void OPNAME ## _pixels_x2_c(uint8_t *block, const uint8_t *pixels, int line_size, int h)\
-{\
- int i;\
- for(i=0; i<h; i++){\
- const uint64_t a= LD64(pixels );\
- const uint64_t b= LD64(pixels+1);\
- OP(*((uint64_t*)block), (a|b) - (((a^b)&0xFEFEFEFEFEFEFEFEULL)>>1));\
- pixels+=line_size;\
- block +=line_size;\
- }\
-}\
-\
-static void OPNAME ## _no_rnd_pixels_y2_c(uint8_t *block, const uint8_t *pixels, int line_size, int h)\
-{\
- int i;\
- for(i=0; i<h; i++){\
- const uint64_t a= LD64(pixels );\
- const uint64_t b= LD64(pixels+line_size);\
- OP(*((uint64_t*)block), (a&b) + (((a^b)&0xFEFEFEFEFEFEFEFEULL)>>1));\
- pixels+=line_size;\
- block +=line_size;\
- }\
-}\
-\
-static void OPNAME ## _pixels_y2_c(uint8_t *block, const uint8_t *pixels, int line_size, int h)\
-{\
- int i;\
- for(i=0; i<h; i++){\
- const uint64_t a= LD64(pixels );\
- const uint64_t b= LD64(pixels+line_size);\
- OP(*((uint64_t*)block), (a|b) - (((a^b)&0xFEFEFEFEFEFEFEFEULL)>>1));\
- pixels+=line_size;\
- block +=line_size;\
- }\
-}\
-\
-static void OPNAME ## _pixels_xy2_c(uint8_t *block, const uint8_t *pixels, int line_size, int h)\
-{\
- int i;\
- const uint64_t a= LD64(pixels );\
- const uint64_t b= LD64(pixels+1);\
- uint64_t l0= (a&0x0303030303030303ULL)\
- + (b&0x0303030303030303ULL)\
- + 0x0202020202020202ULL;\
- uint64_t h0= ((a&0xFCFCFCFCFCFCFCFCULL)>>2)\
- + ((b&0xFCFCFCFCFCFCFCFCULL)>>2);\
- uint64_t l1,h1;\
-\
- pixels+=line_size;\
- for(i=0; i<h; i+=2){\
- uint64_t a= LD64(pixels );\
- uint64_t b= LD64(pixels+1);\
- l1= (a&0x0303030303030303ULL)\
- + (b&0x0303030303030303ULL);\
- h1= ((a&0xFCFCFCFCFCFCFCFCULL)>>2)\
- + ((b&0xFCFCFCFCFCFCFCFCULL)>>2);\
- OP(*((uint64_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0F0F0F0F0FULL));\
- pixels+=line_size;\
- block +=line_size;\
- a= LD64(pixels );\
- b= LD64(pixels+1);\
- l0= (a&0x0303030303030303ULL)\
- + (b&0x0303030303030303ULL)\
- + 0x0202020202020202ULL;\
- h0= ((a&0xFCFCFCFCFCFCFCFCULL)>>2)\
- + ((b&0xFCFCFCFCFCFCFCFCULL)>>2);\
- OP(*((uint64_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0F0F0F0F0FULL));\
- pixels+=line_size;\
- block +=line_size;\
- }\
-}\
-\
-static void OPNAME ## _no_rnd_pixels_xy2_c(uint8_t *block, const uint8_t *pixels, int line_size, int h)\
-{\
- int i;\
- const uint64_t a= LD64(pixels );\
- const uint64_t b= LD64(pixels+1);\
- uint64_t l0= (a&0x0303030303030303ULL)\
- + (b&0x0303030303030303ULL)\
- + 0x0101010101010101ULL;\
- uint64_t h0= ((a&0xFCFCFCFCFCFCFCFCULL)>>2)\
- + ((b&0xFCFCFCFCFCFCFCFCULL)>>2);\
- uint64_t l1,h1;\
-\
- pixels+=line_size;\
- for(i=0; i<h; i+=2){\
- uint64_t a= LD64(pixels );\
- uint64_t b= LD64(pixels+1);\
- l1= (a&0x0303030303030303ULL)\
- + (b&0x0303030303030303ULL);\
- h1= ((a&0xFCFCFCFCFCFCFCFCULL)>>2)\
- + ((b&0xFCFCFCFCFCFCFCFCULL)>>2);\
- OP(*((uint64_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0F0F0F0F0FULL));\
- pixels+=line_size;\
- block +=line_size;\
- a= LD64(pixels );\
- b= LD64(pixels+1);\
- l0= (a&0x0303030303030303ULL)\
- + (b&0x0303030303030303ULL)\
- + 0x0101010101010101ULL;\
- h0= ((a&0xFCFCFCFCFCFCFCFCULL)>>2)\
- + ((b&0xFCFCFCFCFCFCFCFCULL)>>2);\
- OP(*((uint64_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0F0F0F0F0FULL));\
- pixels+=line_size;\
- block +=line_size;\
- }\
-}\
-\
-CALL_2X_PIXELS(OPNAME ## _pixels16_c , OPNAME ## _pixels_c , 8)\
-CALL_2X_PIXELS(OPNAME ## _pixels16_x2_c , OPNAME ## _pixels_x2_c , 8)\
-CALL_2X_PIXELS(OPNAME ## _pixels16_y2_c , OPNAME ## _pixels_y2_c , 8)\
-CALL_2X_PIXELS(OPNAME ## _pixels16_xy2_c, OPNAME ## _pixels_xy2_c, 8)\
-CALL_2X_PIXELS(OPNAME ## _no_rnd_pixels16_x2_c , OPNAME ## _no_rnd_pixels_x2_c , 8)\
-CALL_2X_PIXELS(OPNAME ## _no_rnd_pixels16_y2_c , OPNAME ## _no_rnd_pixels_y2_c , 8)\
-CALL_2X_PIXELS(OPNAME ## _no_rnd_pixels16_xy2_c, OPNAME ## _no_rnd_pixels_xy2_c, 8)
-
-#define op_avg(a, b) a = ( ((a)|(b)) - ((((a)^(b))&0xFEFEFEFEFEFEFEFEULL)>>1) )
-#else // 64 bit variant
-
-#define PIXOP2(OPNAME, OP) \
-static void OPNAME ## _pixels2_c(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
- int i;\
- for(i=0; i<h; i++){\
- OP(*((uint16_t*)(block )), LD16(pixels ));\
- pixels+=line_size;\
- block +=line_size;\
- }\
-}\
-static void OPNAME ## _pixels4_c(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
- int i;\
- for(i=0; i<h; i++){\
- OP(*((uint32_t*)(block )), LD32(pixels ));\
- pixels+=line_size;\
- block +=line_size;\
- }\
-}\
-static void OPNAME ## _pixels8_c(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
- int i;\
- for(i=0; i<h; i++){\
- OP(*((uint32_t*)(block )), LD32(pixels ));\
- OP(*((uint32_t*)(block+4)), LD32(pixels+4));\
- pixels+=line_size;\
- block +=line_size;\
- }\
-}\
-static inline void OPNAME ## _no_rnd_pixels8_c(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
- OPNAME ## _pixels8_c(block, pixels, line_size, h);\
-}\
-\
-static inline void OPNAME ## _no_rnd_pixels8_l2(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, \
- int src_stride1, int src_stride2, int h){\
- int i;\
- for(i=0; i<h; i++){\
- uint32_t a,b;\
- a= LD32(&src1[i*src_stride1 ]);\
- b= LD32(&src2[i*src_stride2 ]);\
- OP(*((uint32_t*)&dst[i*dst_stride ]), no_rnd_avg32(a, b));\
- a= LD32(&src1[i*src_stride1+4]);\
- b= LD32(&src2[i*src_stride2+4]);\
- OP(*((uint32_t*)&dst[i*dst_stride+4]), no_rnd_avg32(a, b));\
- }\
-}\
-\
-static inline void OPNAME ## _pixels8_l2(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, \
- int src_stride1, int src_stride2, int h){\
- int i;\
- for(i=0; i<h; i++){\
- uint32_t a,b;\
- a= LD32(&src1[i*src_stride1 ]);\
- b= LD32(&src2[i*src_stride2 ]);\
- OP(*((uint32_t*)&dst[i*dst_stride ]), rnd_avg32(a, b));\
- a= LD32(&src1[i*src_stride1+4]);\
- b= LD32(&src2[i*src_stride2+4]);\
- OP(*((uint32_t*)&dst[i*dst_stride+4]), rnd_avg32(a, b));\
- }\
-}\
-\
-static inline void OPNAME ## _pixels4_l2(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, \
- int src_stride1, int src_stride2, int h){\
- int i;\
- for(i=0; i<h; i++){\
- uint32_t a,b;\
- a= LD32(&src1[i*src_stride1 ]);\
- b= LD32(&src2[i*src_stride2 ]);\
- OP(*((uint32_t*)&dst[i*dst_stride ]), rnd_avg32(a, b));\
- }\
-}\
-\
-static inline void OPNAME ## _pixels2_l2(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, \
- int src_stride1, int src_stride2, int h){\
- int i;\
- for(i=0; i<h; i++){\
- uint32_t a,b;\
- a= LD16(&src1[i*src_stride1 ]);\
- b= LD16(&src2[i*src_stride2 ]);\
- OP(*((uint16_t*)&dst[i*dst_stride ]), rnd_avg32(a, b));\
- }\
-}\
-\
-static inline void OPNAME ## _pixels16_l2(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, \
- int src_stride1, int src_stride2, int h){\
- OPNAME ## _pixels8_l2(dst , src1 , src2 , dst_stride, src_stride1, src_stride2, h);\
- OPNAME ## _pixels8_l2(dst+8, src1+8, src2+8, dst_stride, src_stride1, src_stride2, h);\
-}\
-\
-static inline void OPNAME ## _no_rnd_pixels16_l2(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, \
- int src_stride1, int src_stride2, int h){\
- OPNAME ## _no_rnd_pixels8_l2(dst , src1 , src2 , dst_stride, src_stride1, src_stride2, h);\
- OPNAME ## _no_rnd_pixels8_l2(dst+8, src1+8, src2+8, dst_stride, src_stride1, src_stride2, h);\
-}\
-\
-static inline void OPNAME ## _no_rnd_pixels8_x2_c(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
- OPNAME ## _no_rnd_pixels8_l2(block, pixels, pixels+1, line_size, line_size, line_size, h);\
-}\
-\
-static inline void OPNAME ## _pixels8_x2_c(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
- OPNAME ## _pixels8_l2(block, pixels, pixels+1, line_size, line_size, line_size, h);\
-}\
-\
-static inline void OPNAME ## _no_rnd_pixels8_y2_c(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
- OPNAME ## _no_rnd_pixels8_l2(block, pixels, pixels+line_size, line_size, line_size, line_size, h);\
-}\
-\
-static inline void OPNAME ## _pixels8_y2_c(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
- OPNAME ## _pixels8_l2(block, pixels, pixels+line_size, line_size, line_size, line_size, h);\
-}\
-\
-static inline void OPNAME ## _pixels8_l4(uint8_t *dst, const uint8_t *src1, uint8_t *src2, uint8_t *src3, uint8_t *src4,\
- int dst_stride, int src_stride1, int src_stride2,int src_stride3,int src_stride4, int h){\
- int i;\
- for(i=0; i<h; i++){\
- uint32_t a, b, c, d, l0, l1, h0, h1;\
- a= LD32(&src1[i*src_stride1]);\
- b= LD32(&src2[i*src_stride2]);\
- c= LD32(&src3[i*src_stride3]);\
- d= LD32(&src4[i*src_stride4]);\
- l0= (a&0x03030303UL)\
- + (b&0x03030303UL)\
- + 0x02020202UL;\
- h0= ((a&0xFCFCFCFCUL)>>2)\
- + ((b&0xFCFCFCFCUL)>>2);\
- l1= (c&0x03030303UL)\
- + (d&0x03030303UL);\
- h1= ((c&0xFCFCFCFCUL)>>2)\
- + ((d&0xFCFCFCFCUL)>>2);\
- OP(*((uint32_t*)&dst[i*dst_stride]), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
- a= LD32(&src1[i*src_stride1+4]);\
- b= LD32(&src2[i*src_stride2+4]);\
- c= LD32(&src3[i*src_stride3+4]);\
- d= LD32(&src4[i*src_stride4+4]);\
- l0= (a&0x03030303UL)\
- + (b&0x03030303UL)\
- + 0x02020202UL;\
- h0= ((a&0xFCFCFCFCUL)>>2)\
- + ((b&0xFCFCFCFCUL)>>2);\
- l1= (c&0x03030303UL)\
- + (d&0x03030303UL);\
- h1= ((c&0xFCFCFCFCUL)>>2)\
- + ((d&0xFCFCFCFCUL)>>2);\
- OP(*((uint32_t*)&dst[i*dst_stride+4]), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
- }\
-}\
-\
-static inline void OPNAME ## _pixels4_x2_c(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
- OPNAME ## _pixels4_l2(block, pixels, pixels+1, line_size, line_size, line_size, h);\
-}\
-\
-static inline void OPNAME ## _pixels4_y2_c(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
- OPNAME ## _pixels4_l2(block, pixels, pixels+line_size, line_size, line_size, line_size, h);\
-}\
-\
-static inline void OPNAME ## _pixels2_x2_c(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
- OPNAME ## _pixels2_l2(block, pixels, pixels+1, line_size, line_size, line_size, h);\
-}\
-\
-static inline void OPNAME ## _pixels2_y2_c(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
- OPNAME ## _pixels2_l2(block, pixels, pixels+line_size, line_size, line_size, line_size, h);\
-}\
-\
-static inline void OPNAME ## _no_rnd_pixels8_l4(uint8_t *dst, const uint8_t *src1, uint8_t *src2, uint8_t *src3, uint8_t *src4,\
- int dst_stride, int src_stride1, int src_stride2,int src_stride3,int src_stride4, int h){\
- int i;\
- for(i=0; i<h; i++){\
- uint32_t a, b, c, d, l0, l1, h0, h1;\
- a= LD32(&src1[i*src_stride1]);\
- b= LD32(&src2[i*src_stride2]);\
- c= LD32(&src3[i*src_stride3]);\
- d= LD32(&src4[i*src_stride4]);\
- l0= (a&0x03030303UL)\
- + (b&0x03030303UL)\
- + 0x01010101UL;\
- h0= ((a&0xFCFCFCFCUL)>>2)\
- + ((b&0xFCFCFCFCUL)>>2);\
- l1= (c&0x03030303UL)\
- + (d&0x03030303UL);\
- h1= ((c&0xFCFCFCFCUL)>>2)\
- + ((d&0xFCFCFCFCUL)>>2);\
- OP(*((uint32_t*)&dst[i*dst_stride]), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
- a= LD32(&src1[i*src_stride1+4]);\
- b= LD32(&src2[i*src_stride2+4]);\
- c= LD32(&src3[i*src_stride3+4]);\
- d= LD32(&src4[i*src_stride4+4]);\
- l0= (a&0x03030303UL)\
- + (b&0x03030303UL)\
- + 0x01010101UL;\
- h0= ((a&0xFCFCFCFCUL)>>2)\
- + ((b&0xFCFCFCFCUL)>>2);\
- l1= (c&0x03030303UL)\
- + (d&0x03030303UL);\
- h1= ((c&0xFCFCFCFCUL)>>2)\
- + ((d&0xFCFCFCFCUL)>>2);\
- OP(*((uint32_t*)&dst[i*dst_stride+4]), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
- }\
-}\
-static inline void OPNAME ## _pixels16_l4(uint8_t *dst, const uint8_t *src1, uint8_t *src2, uint8_t *src3, uint8_t *src4,\
- int dst_stride, int src_stride1, int src_stride2,int src_stride3,int src_stride4, int h){\
- OPNAME ## _pixels8_l4(dst , src1 , src2 , src3 , src4 , dst_stride, src_stride1, src_stride2, src_stride3, src_stride4, h);\
- OPNAME ## _pixels8_l4(dst+8, src1+8, src2+8, src3+8, src4+8, dst_stride, src_stride1, src_stride2, src_stride3, src_stride4, h);\
-}\
-static inline void OPNAME ## _no_rnd_pixels16_l4(uint8_t *dst, const uint8_t *src1, uint8_t *src2, uint8_t *src3, uint8_t *src4,\
- int dst_stride, int src_stride1, int src_stride2,int src_stride3,int src_stride4, int h){\
- OPNAME ## _no_rnd_pixels8_l4(dst , src1 , src2 , src3 , src4 , dst_stride, src_stride1, src_stride2, src_stride3, src_stride4, h);\
- OPNAME ## _no_rnd_pixels8_l4(dst+8, src1+8, src2+8, src3+8, src4+8, dst_stride, src_stride1, src_stride2, src_stride3, src_stride4, h);\
-}\
-\
-static inline void OPNAME ## _pixels2_xy2_c(uint8_t *block, const uint8_t *pixels, int line_size, int h)\
-{\
- int i, a0, b0, a1, b1;\
- a0= pixels[0];\
- b0= pixels[1] + 2;\
- a0 += b0;\
- b0 += pixels[2];\
-\
- pixels+=line_size;\
- for(i=0; i<h; i+=2){\
- a1= pixels[0];\
- b1= pixels[1];\
- a1 += b1;\
- b1 += pixels[2];\
-\
- block[0]= (a1+a0)>>2; /* FIXME non put */\
- block[1]= (b1+b0)>>2;\
-\
- pixels+=line_size;\
- block +=line_size;\
-\
- a0= pixels[0];\
- b0= pixels[1] + 2;\
- a0 += b0;\
- b0 += pixels[2];\
-\
- block[0]= (a1+a0)>>2;\
- block[1]= (b1+b0)>>2;\
- pixels+=line_size;\
- block +=line_size;\
- }\
-}\
-\
-static inline void OPNAME ## _pixels4_xy2_c(uint8_t *block, const uint8_t *pixels, int line_size, int h)\
-{\
- int i;\
- const uint32_t a= LD32(pixels );\
- const uint32_t b= LD32(pixels+1);\
- uint32_t l0= (a&0x03030303UL)\
- + (b&0x03030303UL)\
- + 0x02020202UL;\
- uint32_t h0= ((a&0xFCFCFCFCUL)>>2)\
- + ((b&0xFCFCFCFCUL)>>2);\
- uint32_t l1,h1;\
-\
- pixels+=line_size;\
- for(i=0; i<h; i+=2){\
- uint32_t a= LD32(pixels );\
- uint32_t b= LD32(pixels+1);\
- l1= (a&0x03030303UL)\
- + (b&0x03030303UL);\
- h1= ((a&0xFCFCFCFCUL)>>2)\
- + ((b&0xFCFCFCFCUL)>>2);\
- OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
- pixels+=line_size;\
- block +=line_size;\
- a= LD32(pixels );\
- b= LD32(pixels+1);\
- l0= (a&0x03030303UL)\
- + (b&0x03030303UL)\
- + 0x02020202UL;\
- h0= ((a&0xFCFCFCFCUL)>>2)\
- + ((b&0xFCFCFCFCUL)>>2);\
- OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
- pixels+=line_size;\
- block +=line_size;\
- }\
-}\
-\
-static inline void OPNAME ## _pixels8_xy2_c(uint8_t *block, const uint8_t *pixels, int line_size, int h)\
-{\
- int j;\
- for(j=0; j<2; j++){\
- int i;\
- const uint32_t a= LD32(pixels );\
- const uint32_t b= LD32(pixels+1);\
- uint32_t l0= (a&0x03030303UL)\
- + (b&0x03030303UL)\
- + 0x02020202UL;\
- uint32_t h0= ((a&0xFCFCFCFCUL)>>2)\
- + ((b&0xFCFCFCFCUL)>>2);\
- uint32_t l1,h1;\
-\
- pixels+=line_size;\
- for(i=0; i<h; i+=2){\
- uint32_t a= LD32(pixels );\
- uint32_t b= LD32(pixels+1);\
- l1= (a&0x03030303UL)\
- + (b&0x03030303UL);\
- h1= ((a&0xFCFCFCFCUL)>>2)\
- + ((b&0xFCFCFCFCUL)>>2);\
- OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
- pixels+=line_size;\
- block +=line_size;\
- a= LD32(pixels );\
- b= LD32(pixels+1);\
- l0= (a&0x03030303UL)\
- + (b&0x03030303UL)\
- + 0x02020202UL;\
- h0= ((a&0xFCFCFCFCUL)>>2)\
- + ((b&0xFCFCFCFCUL)>>2);\
- OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
- pixels+=line_size;\
- block +=line_size;\
- }\
- pixels+=4-line_size*(h+1);\
- block +=4-line_size*h;\
- }\
-}\
-\
-static inline void OPNAME ## _no_rnd_pixels8_xy2_c(uint8_t *block, const uint8_t *pixels, int line_size, int h)\
-{\
- int j;\
- for(j=0; j<2; j++){\
- int i;\
- const uint32_t a= LD32(pixels );\
- const uint32_t b= LD32(pixels+1);\
- uint32_t l0= (a&0x03030303UL)\
- + (b&0x03030303UL)\
- + 0x01010101UL;\
- uint32_t h0= ((a&0xFCFCFCFCUL)>>2)\
- + ((b&0xFCFCFCFCUL)>>2);\
- uint32_t l1,h1;\
-\
- pixels+=line_size;\
- for(i=0; i<h; i+=2){\
- uint32_t a= LD32(pixels );\
- uint32_t b= LD32(pixels+1);\
- l1= (a&0x03030303UL)\
- + (b&0x03030303UL);\
- h1= ((a&0xFCFCFCFCUL)>>2)\
- + ((b&0xFCFCFCFCUL)>>2);\
- OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
- pixels+=line_size;\
- block +=line_size;\
- a= LD32(pixels );\
- b= LD32(pixels+1);\
- l0= (a&0x03030303UL)\
- + (b&0x03030303UL)\
- + 0x01010101UL;\
- h0= ((a&0xFCFCFCFCUL)>>2)\
- + ((b&0xFCFCFCFCUL)>>2);\
- OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
- pixels+=line_size;\
- block +=line_size;\
- }\
- pixels+=4-line_size*(h+1);\
- block +=4-line_size*h;\
- }\
-}\
-\
-CALL_2X_PIXELS(OPNAME ## _pixels16_c , OPNAME ## _pixels8_c , 8)\
-CALL_2X_PIXELS(OPNAME ## _pixels16_x2_c , OPNAME ## _pixels8_x2_c , 8)\
-CALL_2X_PIXELS(OPNAME ## _pixels16_y2_c , OPNAME ## _pixels8_y2_c , 8)\
-CALL_2X_PIXELS(OPNAME ## _pixels16_xy2_c, OPNAME ## _pixels8_xy2_c, 8)\
-CALL_2X_PIXELS(OPNAME ## _no_rnd_pixels16_c , OPNAME ## _pixels8_c , 8)\
-CALL_2X_PIXELS(OPNAME ## _no_rnd_pixels16_x2_c , OPNAME ## _no_rnd_pixels8_x2_c , 8)\
-CALL_2X_PIXELS(OPNAME ## _no_rnd_pixels16_y2_c , OPNAME ## _no_rnd_pixels8_y2_c , 8)\
-CALL_2X_PIXELS(OPNAME ## _no_rnd_pixels16_xy2_c, OPNAME ## _no_rnd_pixels8_xy2_c, 8)\
-
-#define op_avg(a, b) a = rnd_avg32(a, b)
-#endif
-#define op_put(a, b) a = b
-
-PIXOP2(avg, op_avg)
-PIXOP2(put, op_put)
-#undef op_avg
-#undef op_put
-
-#define avg2(a,b) ((a+b+1)>>1)
-#define avg4(a,b,c,d) ((a+b+c+d+2)>>2)
-
-static void put_no_rnd_pixels16_l2_c(uint8_t *dst, const uint8_t *a, const uint8_t *b, int stride, int h){
- put_no_rnd_pixels16_l2(dst, a, b, stride, stride, stride, h);
-}
-
-static void put_no_rnd_pixels8_l2_c(uint8_t *dst, const uint8_t *a, const uint8_t *b, int stride, int h){
- put_no_rnd_pixels8_l2(dst, a, b, stride, stride, stride, h);
-}
-
-static void gmc1_c(uint8_t *dst, uint8_t *src, int stride, int h, int x16, int y16, int rounder)
-{
- const int A=(16-x16)*(16-y16);
- const int B=( x16)*(16-y16);
- const int C=(16-x16)*( y16);
- const int D=( x16)*( y16);
- int i;
-
- for(i=0; i<h; i++)
- {
- dst[0]= (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1] + rounder)>>8;
- dst[1]= (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2] + rounder)>>8;
- dst[2]= (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3] + rounder)>>8;
- dst[3]= (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4] + rounder)>>8;
- dst[4]= (A*src[4] + B*src[5] + C*src[stride+4] + D*src[stride+5] + rounder)>>8;
- dst[5]= (A*src[5] + B*src[6] + C*src[stride+5] + D*src[stride+6] + rounder)>>8;
- dst[6]= (A*src[6] + B*src[7] + C*src[stride+6] + D*src[stride+7] + rounder)>>8;
- dst[7]= (A*src[7] + B*src[8] + C*src[stride+7] + D*src[stride+8] + rounder)>>8;
- dst+= stride;
- src+= stride;
- }
-}
-
-void ff_gmc_c(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy,
- int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height)
-{
- int y, vx, vy;
- const int s= 1<<shift;
-
- width--;
- height--;
-
- for(y=0; y<h; y++){
- int x;
-
- vx= ox;
- vy= oy;
- for(x=0; x<8; x++){ //XXX FIXME optimize
- int src_x, src_y, frac_x, frac_y, index;
-
- src_x= vx>>16;
- src_y= vy>>16;
- frac_x= src_x&(s-1);
- frac_y= src_y&(s-1);
- src_x>>=shift;
- src_y>>=shift;
-
- if((unsigned)src_x < width){
- if((unsigned)src_y < height){
- index= src_x + src_y*stride;
- dst[y*stride + x]= ( ( src[index ]*(s-frac_x)
- + src[index +1]* frac_x )*(s-frac_y)
- + ( src[index+stride ]*(s-frac_x)
- + src[index+stride+1]* frac_x )* frac_y
- + r)>>(shift*2);
- }else{
- index= src_x + clip(src_y, 0, height)*stride;
- dst[y*stride + x]= ( ( src[index ]*(s-frac_x)
- + src[index +1]* frac_x )*s
- + r)>>(shift*2);
- }
- }else{
- if((unsigned)src_y < height){
- index= clip(src_x, 0, width) + src_y*stride;
- dst[y*stride + x]= ( ( src[index ]*(s-frac_y)
- + src[index+stride ]* frac_y )*s
- + r)>>(shift*2);
- }else{
- index= clip(src_x, 0, width) + clip(src_y, 0, height)*stride;
- dst[y*stride + x]= src[index ];
- }
- }
-
- vx+= dxx;
- vy+= dyx;
- }
- ox += dxy;
- oy += dyy;
- }
-}
-
-static inline void put_tpel_pixels_mc00_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- switch(width){
- case 2: put_pixels2_c (dst, src, stride, height); break;
- case 4: put_pixels4_c (dst, src, stride, height); break;
- case 8: put_pixels8_c (dst, src, stride, height); break;
- case 16:put_pixels16_c(dst, src, stride, height); break;
- }
-}
-
-static inline void put_tpel_pixels_mc10_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- int i,j;
- for (i=0; i < height; i++) {
- for (j=0; j < width; j++) {
- dst[j] = (683*(2*src[j] + src[j+1] + 1)) >> 11;
- }
- src += stride;
- dst += stride;
- }
-}
-
-static inline void put_tpel_pixels_mc20_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- int i,j;
- for (i=0; i < height; i++) {
- for (j=0; j < width; j++) {
- dst[j] = (683*(src[j] + 2*src[j+1] + 1)) >> 11;
- }
- src += stride;
- dst += stride;
- }
-}
-
-static inline void put_tpel_pixels_mc01_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- int i,j;
- for (i=0; i < height; i++) {
- for (j=0; j < width; j++) {
- dst[j] = (683*(2*src[j] + src[j+stride] + 1)) >> 11;
- }
- src += stride;
- dst += stride;
- }
-}
-
-static inline void put_tpel_pixels_mc11_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- int i,j;
- for (i=0; i < height; i++) {
- for (j=0; j < width; j++) {
- dst[j] = (2731*(4*src[j] + 3*src[j+1] + 3*src[j+stride] + 2*src[j+stride+1] + 6)) >> 15;
- }
- src += stride;
- dst += stride;
- }
-}
-
-static inline void put_tpel_pixels_mc12_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- int i,j;
- for (i=0; i < height; i++) {
- for (j=0; j < width; j++) {
- dst[j] = (2731*(3*src[j] + 2*src[j+1] + 4*src[j+stride] + 3*src[j+stride+1] + 6)) >> 15;
- }
- src += stride;
- dst += stride;
- }
-}
-
-static inline void put_tpel_pixels_mc02_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- int i,j;
- for (i=0; i < height; i++) {
- for (j=0; j < width; j++) {
- dst[j] = (683*(src[j] + 2*src[j+stride] + 1)) >> 11;
- }
- src += stride;
- dst += stride;
- }
-}
-
-static inline void put_tpel_pixels_mc21_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- int i,j;
- for (i=0; i < height; i++) {
- for (j=0; j < width; j++) {
- dst[j] = (2731*(3*src[j] + 4*src[j+1] + 2*src[j+stride] + 3*src[j+stride+1] + 6)) >> 15;
- }
- src += stride;
- dst += stride;
- }
-}
-
-static inline void put_tpel_pixels_mc22_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- int i,j;
- for (i=0; i < height; i++) {
- for (j=0; j < width; j++) {
- dst[j] = (2731*(2*src[j] + 3*src[j+1] + 3*src[j+stride] + 4*src[j+stride+1] + 6)) >> 15;
- }
- src += stride;
- dst += stride;
- }
-}
-
-static inline void avg_tpel_pixels_mc00_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- switch(width){
- case 2: avg_pixels2_c (dst, src, stride, height); break;
- case 4: avg_pixels4_c (dst, src, stride, height); break;
- case 8: avg_pixels8_c (dst, src, stride, height); break;
- case 16:avg_pixels16_c(dst, src, stride, height); break;
- }
-}
-
-static inline void avg_tpel_pixels_mc10_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- int i,j;
- for (i=0; i < height; i++) {
- for (j=0; j < width; j++) {
- dst[j] = (dst[j] + ((683*(2*src[j] + src[j+1] + 1)) >> 11) + 1) >> 1;
- }
- src += stride;
- dst += stride;
- }
-}
-
-static inline void avg_tpel_pixels_mc20_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- int i,j;
- for (i=0; i < height; i++) {
- for (j=0; j < width; j++) {
- dst[j] = (dst[j] + ((683*(src[j] + 2*src[j+1] + 1)) >> 11) + 1) >> 1;
- }
- src += stride;
- dst += stride;
- }
-}
-
-static inline void avg_tpel_pixels_mc01_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- int i,j;
- for (i=0; i < height; i++) {
- for (j=0; j < width; j++) {
- dst[j] = (dst[j] + ((683*(2*src[j] + src[j+stride] + 1)) >> 11) + 1) >> 1;
- }
- src += stride;
- dst += stride;
- }
-}
-
-static inline void avg_tpel_pixels_mc11_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- int i,j;
- for (i=0; i < height; i++) {
- for (j=0; j < width; j++) {
- dst[j] = (dst[j] + ((2731*(4*src[j] + 3*src[j+1] + 3*src[j+stride] + 2*src[j+stride+1] + 6)) >> 15) + 1) >> 1;
- }
- src += stride;
- dst += stride;
- }
-}
-
-static inline void avg_tpel_pixels_mc12_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- int i,j;
- for (i=0; i < height; i++) {
- for (j=0; j < width; j++) {
- dst[j] = (dst[j] + ((2731*(3*src[j] + 2*src[j+1] + 4*src[j+stride] + 3*src[j+stride+1] + 6)) >> 15) + 1) >> 1;
- }
- src += stride;
- dst += stride;
- }
-}
-
-static inline void avg_tpel_pixels_mc02_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- int i,j;
- for (i=0; i < height; i++) {
- for (j=0; j < width; j++) {
- dst[j] = (dst[j] + ((683*(src[j] + 2*src[j+stride] + 1)) >> 11) + 1) >> 1;
- }
- src += stride;
- dst += stride;
- }
-}
-
-static inline void avg_tpel_pixels_mc21_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- int i,j;
- for (i=0; i < height; i++) {
- for (j=0; j < width; j++) {
- dst[j] = (dst[j] + ((2731*(3*src[j] + 4*src[j+1] + 2*src[j+stride] + 3*src[j+stride+1] + 6)) >> 15) + 1) >> 1;
- }
- src += stride;
- dst += stride;
- }
-}
-
-static inline void avg_tpel_pixels_mc22_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
- int i,j;
- for (i=0; i < height; i++) {
- for (j=0; j < width; j++) {
- dst[j] = (dst[j] + ((2731*(2*src[j] + 3*src[j+1] + 3*src[j+stride] + 4*src[j+stride+1] + 6)) >> 15) + 1) >> 1;
- }
- src += stride;
- dst += stride;
- }
-}
-#if 0
-#define TPEL_WIDTH(width)\
-static void put_tpel_pixels ## width ## _mc00_c(uint8_t *dst, const uint8_t *src, int stride, int height){\
- void put_tpel_pixels_mc00_c(dst, src, stride, width, height);}\
-static void put_tpel_pixels ## width ## _mc10_c(uint8_t *dst, const uint8_t *src, int stride, int height){\
- void put_tpel_pixels_mc10_c(dst, src, stride, width, height);}\
-static void put_tpel_pixels ## width ## _mc20_c(uint8_t *dst, const uint8_t *src, int stride, int height){\
- void put_tpel_pixels_mc20_c(dst, src, stride, width, height);}\
-static void put_tpel_pixels ## width ## _mc01_c(uint8_t *dst, const uint8_t *src, int stride, int height){\
- void put_tpel_pixels_mc01_c(dst, src, stride, width, height);}\
-static void put_tpel_pixels ## width ## _mc11_c(uint8_t *dst, const uint8_t *src, int stride, int height){\
- void put_tpel_pixels_mc11_c(dst, src, stride, width, height);}\
-static void put_tpel_pixels ## width ## _mc21_c(uint8_t *dst, const uint8_t *src, int stride, int height){\
- void put_tpel_pixels_mc21_c(dst, src, stride, width, height);}\
-static void put_tpel_pixels ## width ## _mc02_c(uint8_t *dst, const uint8_t *src, int stride, int height){\
- void put_tpel_pixels_mc02_c(dst, src, stride, width, height);}\
-static void put_tpel_pixels ## width ## _mc12_c(uint8_t *dst, const uint8_t *src, int stride, int height){\
- void put_tpel_pixels_mc12_c(dst, src, stride, width, height);}\
-static void put_tpel_pixels ## width ## _mc22_c(uint8_t *dst, const uint8_t *src, int stride, int height){\
- void put_tpel_pixels_mc22_c(dst, src, stride, width, height);}
-#endif
-
-#define H264_CHROMA_MC(OPNAME, OP)\
-static void OPNAME ## h264_chroma_mc2_c(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y){\
- const int A=(8-x)*(8-y);\
- const int B=( x)*(8-y);\
- const int C=(8-x)*( y);\
- const int D=( x)*( y);\
- int i;\
- \
- assert(x<8 && y<8 && x>=0 && y>=0);\
-\
- for(i=0; i<h; i++)\
- {\
- OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\
- OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2]));\
- dst+= stride;\
- src+= stride;\
- }\
-}\
-\
-static void OPNAME ## h264_chroma_mc4_c(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y){\
- const int A=(8-x)*(8-y);\
- const int B=( x)*(8-y);\
- const int C=(8-x)*( y);\
- const int D=( x)*( y);\
- int i;\
- \
- assert(x<8 && y<8 && x>=0 && y>=0);\
-\
- for(i=0; i<h; i++)\
- {\
- OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\
- OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2]));\
- OP(dst[2], (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3]));\
- OP(dst[3], (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4]));\
- dst+= stride;\
- src+= stride;\
- }\
-}\
-\
-static void OPNAME ## h264_chroma_mc8_c(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y){\
- const int A=(8-x)*(8-y);\
- const int B=( x)*(8-y);\
- const int C=(8-x)*( y);\
- const int D=( x)*( y);\
- int i;\
- \
- assert(x<8 && y<8 && x>=0 && y>=0);\
-\
- for(i=0; i<h; i++)\
- {\
- OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\
- OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2]));\
- OP(dst[2], (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3]));\
- OP(dst[3], (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4]));\
- OP(dst[4], (A*src[4] + B*src[5] + C*src[stride+4] + D*src[stride+5]));\
- OP(dst[5], (A*src[5] + B*src[6] + C*src[stride+5] + D*src[stride+6]));\
- OP(dst[6], (A*src[6] + B*src[7] + C*src[stride+6] + D*src[stride+7]));\
- OP(dst[7], (A*src[7] + B*src[8] + C*src[stride+7] + D*src[stride+8]));\
- dst+= stride;\
- src+= stride;\
- }\
-}
-
-#define op_avg(a, b) a = (((a)+(((b) + 32)>>6)+1)>>1)
-#define op_put(a, b) a = (((b) + 32)>>6)
-
-H264_CHROMA_MC(put_ , op_put)
-H264_CHROMA_MC(avg_ , op_avg)
-#undef op_avg
-#undef op_put
-
-static void put_no_rnd_h264_chroma_mc8_c(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y){
- const int A=(8-x)*(8-y);
- const int B=( x)*(8-y);
- const int C=(8-x)*( y);
- const int D=( x)*( y);
- int i;
-
- assert(x<8 && y<8 && x>=0 && y>=0);
-
- for(i=0; i<h; i++)
- {
- dst[0] = (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1] + 32 - 4) >> 6;
- dst[1] = (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2] + 32 - 4) >> 6;
- dst[2] = (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3] + 32 - 4) >> 6;
- dst[3] = (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4] + 32 - 4) >> 6;
- dst[4] = (A*src[4] + B*src[5] + C*src[stride+4] + D*src[stride+5] + 32 - 4) >> 6;
- dst[5] = (A*src[5] + B*src[6] + C*src[stride+5] + D*src[stride+6] + 32 - 4) >> 6;
- dst[6] = (A*src[6] + B*src[7] + C*src[stride+6] + D*src[stride+7] + 32 - 4) >> 6;
- dst[7] = (A*src[7] + B*src[8] + C*src[stride+7] + D*src[stride+8] + 32 - 4) >> 6;
- dst+= stride;
- src+= stride;
- }
-}
-
-#define QPEL_MC(r, OPNAME, RND, OP) \
-static void OPNAME ## mpeg4_qpel8_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
- int i;\
- for(i=0; i<h; i++)\
- {\
- OP(dst[0], (src[0]+src[1])*20 - (src[0]+src[2])*6 + (src[1]+src[3])*3 - (src[2]+src[4]));\
- OP(dst[1], (src[1]+src[2])*20 - (src[0]+src[3])*6 + (src[0]+src[4])*3 - (src[1]+src[5]));\
- OP(dst[2], (src[2]+src[3])*20 - (src[1]+src[4])*6 + (src[0]+src[5])*3 - (src[0]+src[6]));\
- OP(dst[3], (src[3]+src[4])*20 - (src[2]+src[5])*6 + (src[1]+src[6])*3 - (src[0]+src[7]));\
- OP(dst[4], (src[4]+src[5])*20 - (src[3]+src[6])*6 + (src[2]+src[7])*3 - (src[1]+src[8]));\
- OP(dst[5], (src[5]+src[6])*20 - (src[4]+src[7])*6 + (src[3]+src[8])*3 - (src[2]+src[8]));\
- OP(dst[6], (src[6]+src[7])*20 - (src[5]+src[8])*6 + (src[4]+src[8])*3 - (src[3]+src[7]));\
- OP(dst[7], (src[7]+src[8])*20 - (src[6]+src[8])*6 + (src[5]+src[7])*3 - (src[4]+src[6]));\
- dst+=dstStride;\
- src+=srcStride;\
- }\
-}\
-\
-static void OPNAME ## mpeg4_qpel8_v_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
- const int w=8;\
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
- int i;\
- for(i=0; i<w; i++)\
- {\
- const int src0= src[0*srcStride];\
- const int src1= src[1*srcStride];\
- const int src2= src[2*srcStride];\
- const int src3= src[3*srcStride];\
- const int src4= src[4*srcStride];\
- const int src5= src[5*srcStride];\
- const int src6= src[6*srcStride];\
- const int src7= src[7*srcStride];\
- const int src8= src[8*srcStride];\
- OP(dst[0*dstStride], (src0+src1)*20 - (src0+src2)*6 + (src1+src3)*3 - (src2+src4));\
- OP(dst[1*dstStride], (src1+src2)*20 - (src0+src3)*6 + (src0+src4)*3 - (src1+src5));\
- OP(dst[2*dstStride], (src2+src3)*20 - (src1+src4)*6 + (src0+src5)*3 - (src0+src6));\
- OP(dst[3*dstStride], (src3+src4)*20 - (src2+src5)*6 + (src1+src6)*3 - (src0+src7));\
- OP(dst[4*dstStride], (src4+src5)*20 - (src3+src6)*6 + (src2+src7)*3 - (src1+src8));\
- OP(dst[5*dstStride], (src5+src6)*20 - (src4+src7)*6 + (src3+src8)*3 - (src2+src8));\
- OP(dst[6*dstStride], (src6+src7)*20 - (src5+src8)*6 + (src4+src8)*3 - (src3+src7));\
- OP(dst[7*dstStride], (src7+src8)*20 - (src6+src8)*6 + (src5+src7)*3 - (src4+src6));\
- dst++;\
- src++;\
- }\
-}\
-\
-static void OPNAME ## mpeg4_qpel16_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
- int i;\
- \
- for(i=0; i<h; i++)\
- {\
- OP(dst[ 0], (src[ 0]+src[ 1])*20 - (src[ 0]+src[ 2])*6 + (src[ 1]+src[ 3])*3 - (src[ 2]+src[ 4]));\
- OP(dst[ 1], (src[ 1]+src[ 2])*20 - (src[ 0]+src[ 3])*6 + (src[ 0]+src[ 4])*3 - (src[ 1]+src[ 5]));\
- OP(dst[ 2], (src[ 2]+src[ 3])*20 - (src[ 1]+src[ 4])*6 + (src[ 0]+src[ 5])*3 - (src[ 0]+src[ 6]));\
- OP(dst[ 3], (src[ 3]+src[ 4])*20 - (src[ 2]+src[ 5])*6 + (src[ 1]+src[ 6])*3 - (src[ 0]+src[ 7]));\
- OP(dst[ 4], (src[ 4]+src[ 5])*20 - (src[ 3]+src[ 6])*6 + (src[ 2]+src[ 7])*3 - (src[ 1]+src[ 8]));\
- OP(dst[ 5], (src[ 5]+src[ 6])*20 - (src[ 4]+src[ 7])*6 + (src[ 3]+src[ 8])*3 - (src[ 2]+src[ 9]));\
- OP(dst[ 6], (src[ 6]+src[ 7])*20 - (src[ 5]+src[ 8])*6 + (src[ 4]+src[ 9])*3 - (src[ 3]+src[10]));\
- OP(dst[ 7], (src[ 7]+src[ 8])*20 - (src[ 6]+src[ 9])*6 + (src[ 5]+src[10])*3 - (src[ 4]+src[11]));\
- OP(dst[ 8], (src[ 8]+src[ 9])*20 - (src[ 7]+src[10])*6 + (src[ 6]+src[11])*3 - (src[ 5]+src[12]));\
- OP(dst[ 9], (src[ 9]+src[10])*20 - (src[ 8]+src[11])*6 + (src[ 7]+src[12])*3 - (src[ 6]+src[13]));\
- OP(dst[10], (src[10]+src[11])*20 - (src[ 9]+src[12])*6 + (src[ 8]+src[13])*3 - (src[ 7]+src[14]));\
- OP(dst[11], (src[11]+src[12])*20 - (src[10]+src[13])*6 + (src[ 9]+src[14])*3 - (src[ 8]+src[15]));\
- OP(dst[12], (src[12]+src[13])*20 - (src[11]+src[14])*6 + (src[10]+src[15])*3 - (src[ 9]+src[16]));\
- OP(dst[13], (src[13]+src[14])*20 - (src[12]+src[15])*6 + (src[11]+src[16])*3 - (src[10]+src[16]));\
- OP(dst[14], (src[14]+src[15])*20 - (src[13]+src[16])*6 + (src[12]+src[16])*3 - (src[11]+src[15]));\
- OP(dst[15], (src[15]+src[16])*20 - (src[14]+src[16])*6 + (src[13]+src[15])*3 - (src[12]+src[14]));\
- dst+=dstStride;\
- src+=srcStride;\
- }\
-}\
-\
-static void OPNAME ## mpeg4_qpel16_v_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
- int i;\
- const int w=16;\
- for(i=0; i<w; i++)\
- {\
- const int src0= src[0*srcStride];\
- const int src1= src[1*srcStride];\
- const int src2= src[2*srcStride];\
- const int src3= src[3*srcStride];\
- const int src4= src[4*srcStride];\
- const int src5= src[5*srcStride];\
- const int src6= src[6*srcStride];\
- const int src7= src[7*srcStride];\
- const int src8= src[8*srcStride];\
- const int src9= src[9*srcStride];\
- const int src10= src[10*srcStride];\
- const int src11= src[11*srcStride];\
- const int src12= src[12*srcStride];\
- const int src13= src[13*srcStride];\
- const int src14= src[14*srcStride];\
- const int src15= src[15*srcStride];\
- const int src16= src[16*srcStride];\
- OP(dst[ 0*dstStride], (src0 +src1 )*20 - (src0 +src2 )*6 + (src1 +src3 )*3 - (src2 +src4 ));\
- OP(dst[ 1*dstStride], (src1 +src2 )*20 - (src0 +src3 )*6 + (src0 +src4 )*3 - (src1 +src5 ));\
- OP(dst[ 2*dstStride], (src2 +src3 )*20 - (src1 +src4 )*6 + (src0 +src5 )*3 - (src0 +src6 ));\
- OP(dst[ 3*dstStride], (src3 +src4 )*20 - (src2 +src5 )*6 + (src1 +src6 )*3 - (src0 +src7 ));\
- OP(dst[ 4*dstStride], (src4 +src5 )*20 - (src3 +src6 )*6 + (src2 +src7 )*3 - (src1 +src8 ));\
- OP(dst[ 5*dstStride], (src5 +src6 )*20 - (src4 +src7 )*6 + (src3 +src8 )*3 - (src2 +src9 ));\
- OP(dst[ 6*dstStride], (src6 +src7 )*20 - (src5 +src8 )*6 + (src4 +src9 )*3 - (src3 +src10));\
- OP(dst[ 7*dstStride], (src7 +src8 )*20 - (src6 +src9 )*6 + (src5 +src10)*3 - (src4 +src11));\
- OP(dst[ 8*dstStride], (src8 +src9 )*20 - (src7 +src10)*6 + (src6 +src11)*3 - (src5 +src12));\
- OP(dst[ 9*dstStride], (src9 +src10)*20 - (src8 +src11)*6 + (src7 +src12)*3 - (src6 +src13));\
- OP(dst[10*dstStride], (src10+src11)*20 - (src9 +src12)*6 + (src8 +src13)*3 - (src7 +src14));\
- OP(dst[11*dstStride], (src11+src12)*20 - (src10+src13)*6 + (src9 +src14)*3 - (src8 +src15));\
- OP(dst[12*dstStride], (src12+src13)*20 - (src11+src14)*6 + (src10+src15)*3 - (src9 +src16));\
- OP(dst[13*dstStride], (src13+src14)*20 - (src12+src15)*6 + (src11+src16)*3 - (src10+src16));\
- OP(dst[14*dstStride], (src14+src15)*20 - (src13+src16)*6 + (src12+src16)*3 - (src11+src15));\
- OP(dst[15*dstStride], (src15+src16)*20 - (src14+src16)*6 + (src13+src15)*3 - (src12+src14));\
- dst++;\
- src++;\
- }\
-}\
-\
-static void OPNAME ## qpel8_mc00_c (uint8_t *dst, uint8_t *src, int stride){\
- OPNAME ## pixels8_c(dst, src, stride, 8);\
-}\
-\
-static void OPNAME ## qpel8_mc10_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t half[64];\
- put ## RND ## mpeg4_qpel8_h_lowpass(half, src, 8, stride, 8);\
- OPNAME ## pixels8_l2(dst, src, half, stride, stride, 8, 8);\
-}\
-\
-static void OPNAME ## qpel8_mc20_c(uint8_t *dst, uint8_t *src, int stride){\
- OPNAME ## mpeg4_qpel8_h_lowpass(dst, src, stride, stride, 8);\
-}\
-\
-static void OPNAME ## qpel8_mc30_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t half[64];\
- put ## RND ## mpeg4_qpel8_h_lowpass(half, src, 8, stride, 8);\
- OPNAME ## pixels8_l2(dst, src+1, half, stride, stride, 8, 8);\
-}\
-\
-static void OPNAME ## qpel8_mc01_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[16*9];\
- uint8_t half[64];\
- copy_block9(full, src, 16, stride, 9);\
- put ## RND ## mpeg4_qpel8_v_lowpass(half, full, 8, 16);\
- OPNAME ## pixels8_l2(dst, full, half, stride, 16, 8, 8);\
-}\
-\
-static void OPNAME ## qpel8_mc02_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[16*9];\
- copy_block9(full, src, 16, stride, 9);\
- OPNAME ## mpeg4_qpel8_v_lowpass(dst, full, stride, 16);\
-}\
-\
-static void OPNAME ## qpel8_mc03_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[16*9];\
- uint8_t half[64];\
- copy_block9(full, src, 16, stride, 9);\
- put ## RND ## mpeg4_qpel8_v_lowpass(half, full, 8, 16);\
- OPNAME ## pixels8_l2(dst, full+16, half, stride, 16, 8, 8);\
-}\
-void ff_ ## OPNAME ## qpel8_mc11_old_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[16*9];\
- uint8_t halfH[72];\
- uint8_t halfV[64];\
- uint8_t halfHV[64];\
- copy_block9(full, src, 16, stride, 9);\
- put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full, 8, 16);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
- OPNAME ## pixels8_l4(dst, full, halfH, halfV, halfHV, stride, 16, 8, 8, 8, 8);\
-}\
-static void OPNAME ## qpel8_mc11_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[16*9];\
- uint8_t halfH[72];\
- uint8_t halfHV[64];\
- copy_block9(full, src, 16, stride, 9);\
- put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
- put ## RND ## pixels8_l2(halfH, halfH, full, 8, 8, 16, 9);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
- OPNAME ## pixels8_l2(dst, halfH, halfHV, stride, 8, 8, 8);\
-}\
-void ff_ ## OPNAME ## qpel8_mc31_old_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[16*9];\
- uint8_t halfH[72];\
- uint8_t halfV[64];\
- uint8_t halfHV[64];\
- copy_block9(full, src, 16, stride, 9);\
- put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full+1, 8, 16);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
- OPNAME ## pixels8_l4(dst, full+1, halfH, halfV, halfHV, stride, 16, 8, 8, 8, 8);\
-}\
-static void OPNAME ## qpel8_mc31_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[16*9];\
- uint8_t halfH[72];\
- uint8_t halfHV[64];\
- copy_block9(full, src, 16, stride, 9);\
- put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
- put ## RND ## pixels8_l2(halfH, halfH, full+1, 8, 8, 16, 9);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
- OPNAME ## pixels8_l2(dst, halfH, halfHV, stride, 8, 8, 8);\
-}\
-void ff_ ## OPNAME ## qpel8_mc13_old_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[16*9];\
- uint8_t halfH[72];\
- uint8_t halfV[64];\
- uint8_t halfHV[64];\
- copy_block9(full, src, 16, stride, 9);\
- put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full, 8, 16);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
- OPNAME ## pixels8_l4(dst, full+16, halfH+8, halfV, halfHV, stride, 16, 8, 8, 8, 8);\
-}\
-static void OPNAME ## qpel8_mc13_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[16*9];\
- uint8_t halfH[72];\
- uint8_t halfHV[64];\
- copy_block9(full, src, 16, stride, 9);\
- put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
- put ## RND ## pixels8_l2(halfH, halfH, full, 8, 8, 16, 9);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
- OPNAME ## pixels8_l2(dst, halfH+8, halfHV, stride, 8, 8, 8);\
-}\
-void ff_ ## OPNAME ## qpel8_mc33_old_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[16*9];\
- uint8_t halfH[72];\
- uint8_t halfV[64];\
- uint8_t halfHV[64];\
- copy_block9(full, src, 16, stride, 9);\
- put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full , 8, 16, 9);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full+1, 8, 16);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
- OPNAME ## pixels8_l4(dst, full+17, halfH+8, halfV, halfHV, stride, 16, 8, 8, 8, 8);\
-}\
-static void OPNAME ## qpel8_mc33_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[16*9];\
- uint8_t halfH[72];\
- uint8_t halfHV[64];\
- copy_block9(full, src, 16, stride, 9);\
- put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
- put ## RND ## pixels8_l2(halfH, halfH, full+1, 8, 8, 16, 9);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
- OPNAME ## pixels8_l2(dst, halfH+8, halfHV, stride, 8, 8, 8);\
-}\
-static void OPNAME ## qpel8_mc21_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t halfH[72];\
- uint8_t halfHV[64];\
- put ## RND ## mpeg4_qpel8_h_lowpass(halfH, src, 8, stride, 9);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
- OPNAME ## pixels8_l2(dst, halfH, halfHV, stride, 8, 8, 8);\
-}\
-static void OPNAME ## qpel8_mc23_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t halfH[72];\
- uint8_t halfHV[64];\
- put ## RND ## mpeg4_qpel8_h_lowpass(halfH, src, 8, stride, 9);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
- OPNAME ## pixels8_l2(dst, halfH+8, halfHV, stride, 8, 8, 8);\
-}\
-void ff_ ## OPNAME ## qpel8_mc12_old_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[16*9];\
- uint8_t halfH[72];\
- uint8_t halfV[64];\
- uint8_t halfHV[64];\
- copy_block9(full, src, 16, stride, 9);\
- put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full, 8, 16);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
- OPNAME ## pixels8_l2(dst, halfV, halfHV, stride, 8, 8, 8);\
-}\
-static void OPNAME ## qpel8_mc12_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[16*9];\
- uint8_t halfH[72];\
- copy_block9(full, src, 16, stride, 9);\
- put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
- put ## RND ## pixels8_l2(halfH, halfH, full, 8, 8, 16, 9);\
- OPNAME ## mpeg4_qpel8_v_lowpass(dst, halfH, stride, 8);\
-}\
-void ff_ ## OPNAME ## qpel8_mc32_old_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[16*9];\
- uint8_t halfH[72];\
- uint8_t halfV[64];\
- uint8_t halfHV[64];\
- copy_block9(full, src, 16, stride, 9);\
- put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full+1, 8, 16);\
- put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
- OPNAME ## pixels8_l2(dst, halfV, halfHV, stride, 8, 8, 8);\
-}\
-static void OPNAME ## qpel8_mc32_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[16*9];\
- uint8_t halfH[72];\
- copy_block9(full, src, 16, stride, 9);\
- put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
- put ## RND ## pixels8_l2(halfH, halfH, full+1, 8, 8, 16, 9);\
- OPNAME ## mpeg4_qpel8_v_lowpass(dst, halfH, stride, 8);\
-}\
-static void OPNAME ## qpel8_mc22_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t halfH[72];\
- put ## RND ## mpeg4_qpel8_h_lowpass(halfH, src, 8, stride, 9);\
- OPNAME ## mpeg4_qpel8_v_lowpass(dst, halfH, stride, 8);\
-}\
-static void OPNAME ## qpel16_mc00_c (uint8_t *dst, uint8_t *src, int stride){\
- OPNAME ## pixels16_c(dst, src, stride, 16);\
-}\
-\
-static void OPNAME ## qpel16_mc10_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t half[256];\
- put ## RND ## mpeg4_qpel16_h_lowpass(half, src, 16, stride, 16);\
- OPNAME ## pixels16_l2(dst, src, half, stride, stride, 16, 16);\
-}\
-\
-static void OPNAME ## qpel16_mc20_c(uint8_t *dst, uint8_t *src, int stride){\
- OPNAME ## mpeg4_qpel16_h_lowpass(dst, src, stride, stride, 16);\
-}\
-\
-static void OPNAME ## qpel16_mc30_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t half[256];\
- put ## RND ## mpeg4_qpel16_h_lowpass(half, src, 16, stride, 16);\
- OPNAME ## pixels16_l2(dst, src+1, half, stride, stride, 16, 16);\
-}\
-\
-static void OPNAME ## qpel16_mc01_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[24*17];\
- uint8_t half[256];\
- copy_block17(full, src, 24, stride, 17);\
- put ## RND ## mpeg4_qpel16_v_lowpass(half, full, 16, 24);\
- OPNAME ## pixels16_l2(dst, full, half, stride, 24, 16, 16);\
-}\
-\
-static void OPNAME ## qpel16_mc02_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[24*17];\
- copy_block17(full, src, 24, stride, 17);\
- OPNAME ## mpeg4_qpel16_v_lowpass(dst, full, stride, 24);\
-}\
-\
-static void OPNAME ## qpel16_mc03_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[24*17];\
- uint8_t half[256];\
- copy_block17(full, src, 24, stride, 17);\
- put ## RND ## mpeg4_qpel16_v_lowpass(half, full, 16, 24);\
- OPNAME ## pixels16_l2(dst, full+24, half, stride, 24, 16, 16);\
-}\
-void ff_ ## OPNAME ## qpel16_mc11_old_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[24*17];\
- uint8_t halfH[272];\
- uint8_t halfV[256];\
- uint8_t halfHV[256];\
- copy_block17(full, src, 24, stride, 17);\
- put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full, 16, 24);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
- OPNAME ## pixels16_l4(dst, full, halfH, halfV, halfHV, stride, 24, 16, 16, 16, 16);\
-}\
-static void OPNAME ## qpel16_mc11_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[24*17];\
- uint8_t halfH[272];\
- uint8_t halfHV[256];\
- copy_block17(full, src, 24, stride, 17);\
- put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
- put ## RND ## pixels16_l2(halfH, halfH, full, 16, 16, 24, 17);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
- OPNAME ## pixels16_l2(dst, halfH, halfHV, stride, 16, 16, 16);\
-}\
-void ff_ ## OPNAME ## qpel16_mc31_old_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[24*17];\
- uint8_t halfH[272];\
- uint8_t halfV[256];\
- uint8_t halfHV[256];\
- copy_block17(full, src, 24, stride, 17);\
- put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full+1, 16, 24);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
- OPNAME ## pixels16_l4(dst, full+1, halfH, halfV, halfHV, stride, 24, 16, 16, 16, 16);\
-}\
-static void OPNAME ## qpel16_mc31_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[24*17];\
- uint8_t halfH[272];\
- uint8_t halfHV[256];\
- copy_block17(full, src, 24, stride, 17);\
- put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
- put ## RND ## pixels16_l2(halfH, halfH, full+1, 16, 16, 24, 17);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
- OPNAME ## pixels16_l2(dst, halfH, halfHV, stride, 16, 16, 16);\
-}\
-void ff_ ## OPNAME ## qpel16_mc13_old_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[24*17];\
- uint8_t halfH[272];\
- uint8_t halfV[256];\
- uint8_t halfHV[256];\
- copy_block17(full, src, 24, stride, 17);\
- put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full, 16, 24);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
- OPNAME ## pixels16_l4(dst, full+24, halfH+16, halfV, halfHV, stride, 24, 16, 16, 16, 16);\
-}\
-static void OPNAME ## qpel16_mc13_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[24*17];\
- uint8_t halfH[272];\
- uint8_t halfHV[256];\
- copy_block17(full, src, 24, stride, 17);\
- put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
- put ## RND ## pixels16_l2(halfH, halfH, full, 16, 16, 24, 17);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
- OPNAME ## pixels16_l2(dst, halfH+16, halfHV, stride, 16, 16, 16);\
-}\
-void ff_ ## OPNAME ## qpel16_mc33_old_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[24*17];\
- uint8_t halfH[272];\
- uint8_t halfV[256];\
- uint8_t halfHV[256];\
- copy_block17(full, src, 24, stride, 17);\
- put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full , 16, 24, 17);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full+1, 16, 24);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
- OPNAME ## pixels16_l4(dst, full+25, halfH+16, halfV, halfHV, stride, 24, 16, 16, 16, 16);\
-}\
-static void OPNAME ## qpel16_mc33_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[24*17];\
- uint8_t halfH[272];\
- uint8_t halfHV[256];\
- copy_block17(full, src, 24, stride, 17);\
- put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
- put ## RND ## pixels16_l2(halfH, halfH, full+1, 16, 16, 24, 17);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
- OPNAME ## pixels16_l2(dst, halfH+16, halfHV, stride, 16, 16, 16);\
-}\
-static void OPNAME ## qpel16_mc21_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t halfH[272];\
- uint8_t halfHV[256];\
- put ## RND ## mpeg4_qpel16_h_lowpass(halfH, src, 16, stride, 17);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
- OPNAME ## pixels16_l2(dst, halfH, halfHV, stride, 16, 16, 16);\
-}\
-static void OPNAME ## qpel16_mc23_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t halfH[272];\
- uint8_t halfHV[256];\
- put ## RND ## mpeg4_qpel16_h_lowpass(halfH, src, 16, stride, 17);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
- OPNAME ## pixels16_l2(dst, halfH+16, halfHV, stride, 16, 16, 16);\
-}\
-void ff_ ## OPNAME ## qpel16_mc12_old_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[24*17];\
- uint8_t halfH[272];\
- uint8_t halfV[256];\
- uint8_t halfHV[256];\
- copy_block17(full, src, 24, stride, 17);\
- put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full, 16, 24);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
- OPNAME ## pixels16_l2(dst, halfV, halfHV, stride, 16, 16, 16);\
-}\
-static void OPNAME ## qpel16_mc12_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[24*17];\
- uint8_t halfH[272];\
- copy_block17(full, src, 24, stride, 17);\
- put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
- put ## RND ## pixels16_l2(halfH, halfH, full, 16, 16, 24, 17);\
- OPNAME ## mpeg4_qpel16_v_lowpass(dst, halfH, stride, 16);\
-}\
-void ff_ ## OPNAME ## qpel16_mc32_old_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[24*17];\
- uint8_t halfH[272];\
- uint8_t halfV[256];\
- uint8_t halfHV[256];\
- copy_block17(full, src, 24, stride, 17);\
- put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full+1, 16, 24);\
- put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
- OPNAME ## pixels16_l2(dst, halfV, halfHV, stride, 16, 16, 16);\
-}\
-static void OPNAME ## qpel16_mc32_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[24*17];\
- uint8_t halfH[272];\
- copy_block17(full, src, 24, stride, 17);\
- put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
- put ## RND ## pixels16_l2(halfH, halfH, full+1, 16, 16, 24, 17);\
- OPNAME ## mpeg4_qpel16_v_lowpass(dst, halfH, stride, 16);\
-}\
-static void OPNAME ## qpel16_mc22_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t halfH[272];\
- put ## RND ## mpeg4_qpel16_h_lowpass(halfH, src, 16, stride, 17);\
- OPNAME ## mpeg4_qpel16_v_lowpass(dst, halfH, stride, 16);\
-}
-
-#define op_avg(a, b) a = (((a)+cm[((b) + 16)>>5]+1)>>1)
-#define op_avg_no_rnd(a, b) a = (((a)+cm[((b) + 15)>>5])>>1)
-#define op_put(a, b) a = cm[((b) + 16)>>5]
-#define op_put_no_rnd(a, b) a = cm[((b) + 15)>>5]
-
-QPEL_MC(0, put_ , _ , op_put)
-QPEL_MC(1, put_no_rnd_, _no_rnd_, op_put_no_rnd)
-QPEL_MC(0, avg_ , _ , op_avg)
-//QPEL_MC(1, avg_no_rnd , _ , op_avg)
-#undef op_avg
-#undef op_avg_no_rnd
-#undef op_put
-#undef op_put_no_rnd
-
-#if 1
-#define H264_LOWPASS(OPNAME, OP, OP2) \
-static void OPNAME ## h264_qpel2_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
- const int h=2;\
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
- int i;\
- for(i=0; i<h; i++)\
- {\
- OP(dst[0], (src[0]+src[1])*20 - (src[-1]+src[2])*5 + (src[-2]+src[3]));\
- OP(dst[1], (src[1]+src[2])*20 - (src[0 ]+src[3])*5 + (src[-1]+src[4]));\
- dst+=dstStride;\
- src+=srcStride;\
- }\
-}\
-\
-static void OPNAME ## h264_qpel2_v_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
- const int w=2;\
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
- int i;\
- for(i=0; i<w; i++)\
- {\
- const int srcB= src[-2*srcStride];\
- const int srcA= src[-1*srcStride];\
- const int src0= src[0 *srcStride];\
- const int src1= src[1 *srcStride];\
- const int src2= src[2 *srcStride];\
- const int src3= src[3 *srcStride];\
- const int src4= src[4 *srcStride];\
- OP(dst[0*dstStride], (src0+src1)*20 - (srcA+src2)*5 + (srcB+src3));\
- OP(dst[1*dstStride], (src1+src2)*20 - (src0+src3)*5 + (srcA+src4));\
- dst++;\
- src++;\
- }\
-}\
-\
-static void OPNAME ## h264_qpel2_hv_lowpass(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\
- const int h=2;\
- const int w=2;\
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
- int i;\
- src -= 2*srcStride;\
- for(i=0; i<h+5; i++)\
- {\
- tmp[0]= (src[0]+src[1])*20 - (src[-1]+src[2])*5 + (src[-2]+src[3]);\
- tmp[1]= (src[1]+src[2])*20 - (src[0 ]+src[3])*5 + (src[-1]+src[4]);\
- tmp+=tmpStride;\
- src+=srcStride;\
- }\
- tmp -= tmpStride*(h+5-2);\
- for(i=0; i<w; i++)\
- {\
- const int tmpB= tmp[-2*tmpStride];\
- const int tmpA= tmp[-1*tmpStride];\
- const int tmp0= tmp[0 *tmpStride];\
- const int tmp1= tmp[1 *tmpStride];\
- const int tmp2= tmp[2 *tmpStride];\
- const int tmp3= tmp[3 *tmpStride];\
- const int tmp4= tmp[4 *tmpStride];\
- OP2(dst[0*dstStride], (tmp0+tmp1)*20 - (tmpA+tmp2)*5 + (tmpB+tmp3));\
- OP2(dst[1*dstStride], (tmp1+tmp2)*20 - (tmp0+tmp3)*5 + (tmpA+tmp4));\
- dst++;\
- tmp++;\
- }\
-}\
-static void OPNAME ## h264_qpel4_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
- const int h=4;\
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
- int i;\
- for(i=0; i<h; i++)\
- {\
- OP(dst[0], (src[0]+src[1])*20 - (src[-1]+src[2])*5 + (src[-2]+src[3]));\
- OP(dst[1], (src[1]+src[2])*20 - (src[0 ]+src[3])*5 + (src[-1]+src[4]));\
- OP(dst[2], (src[2]+src[3])*20 - (src[1 ]+src[4])*5 + (src[0 ]+src[5]));\
- OP(dst[3], (src[3]+src[4])*20 - (src[2 ]+src[5])*5 + (src[1 ]+src[6]));\
- dst+=dstStride;\
- src+=srcStride;\
- }\
-}\
-\
-static void OPNAME ## h264_qpel4_v_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
- const int w=4;\
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
- int i;\
- for(i=0; i<w; i++)\
- {\
- const int srcB= src[-2*srcStride];\
- const int srcA= src[-1*srcStride];\
- const int src0= src[0 *srcStride];\
- const int src1= src[1 *srcStride];\
- const int src2= src[2 *srcStride];\
- const int src3= src[3 *srcStride];\
- const int src4= src[4 *srcStride];\
- const int src5= src[5 *srcStride];\
- const int src6= src[6 *srcStride];\
- OP(dst[0*dstStride], (src0+src1)*20 - (srcA+src2)*5 + (srcB+src3));\
- OP(dst[1*dstStride], (src1+src2)*20 - (src0+src3)*5 + (srcA+src4));\
- OP(dst[2*dstStride], (src2+src3)*20 - (src1+src4)*5 + (src0+src5));\
- OP(dst[3*dstStride], (src3+src4)*20 - (src2+src5)*5 + (src1+src6));\
- dst++;\
- src++;\
- }\
-}\
-\
-static void OPNAME ## h264_qpel4_hv_lowpass(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\
- const int h=4;\
- const int w=4;\
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
- int i;\
- src -= 2*srcStride;\
- for(i=0; i<h+5; i++)\
- {\
- tmp[0]= (src[0]+src[1])*20 - (src[-1]+src[2])*5 + (src[-2]+src[3]);\
- tmp[1]= (src[1]+src[2])*20 - (src[0 ]+src[3])*5 + (src[-1]+src[4]);\
- tmp[2]= (src[2]+src[3])*20 - (src[1 ]+src[4])*5 + (src[0 ]+src[5]);\
- tmp[3]= (src[3]+src[4])*20 - (src[2 ]+src[5])*5 + (src[1 ]+src[6]);\
- tmp+=tmpStride;\
- src+=srcStride;\
- }\
- tmp -= tmpStride*(h+5-2);\
- for(i=0; i<w; i++)\
- {\
- const int tmpB= tmp[-2*tmpStride];\
- const int tmpA= tmp[-1*tmpStride];\
- const int tmp0= tmp[0 *tmpStride];\
- const int tmp1= tmp[1 *tmpStride];\
- const int tmp2= tmp[2 *tmpStride];\
- const int tmp3= tmp[3 *tmpStride];\
- const int tmp4= tmp[4 *tmpStride];\
- const int tmp5= tmp[5 *tmpStride];\
- const int tmp6= tmp[6 *tmpStride];\
- OP2(dst[0*dstStride], (tmp0+tmp1)*20 - (tmpA+tmp2)*5 + (tmpB+tmp3));\
- OP2(dst[1*dstStride], (tmp1+tmp2)*20 - (tmp0+tmp3)*5 + (tmpA+tmp4));\
- OP2(dst[2*dstStride], (tmp2+tmp3)*20 - (tmp1+tmp4)*5 + (tmp0+tmp5));\
- OP2(dst[3*dstStride], (tmp3+tmp4)*20 - (tmp2+tmp5)*5 + (tmp1+tmp6));\
- dst++;\
- tmp++;\
- }\
-}\
-\
-static void OPNAME ## h264_qpel8_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
- const int h=8;\
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
- int i;\
- for(i=0; i<h; i++)\
- {\
- OP(dst[0], (src[0]+src[1])*20 - (src[-1]+src[2])*5 + (src[-2]+src[3 ]));\
- OP(dst[1], (src[1]+src[2])*20 - (src[0 ]+src[3])*5 + (src[-1]+src[4 ]));\
- OP(dst[2], (src[2]+src[3])*20 - (src[1 ]+src[4])*5 + (src[0 ]+src[5 ]));\
- OP(dst[3], (src[3]+src[4])*20 - (src[2 ]+src[5])*5 + (src[1 ]+src[6 ]));\
- OP(dst[4], (src[4]+src[5])*20 - (src[3 ]+src[6])*5 + (src[2 ]+src[7 ]));\
- OP(dst[5], (src[5]+src[6])*20 - (src[4 ]+src[7])*5 + (src[3 ]+src[8 ]));\
- OP(dst[6], (src[6]+src[7])*20 - (src[5 ]+src[8])*5 + (src[4 ]+src[9 ]));\
- OP(dst[7], (src[7]+src[8])*20 - (src[6 ]+src[9])*5 + (src[5 ]+src[10]));\
- dst+=dstStride;\
- src+=srcStride;\
- }\
-}\
-\
-static void OPNAME ## h264_qpel8_v_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
- const int w=8;\
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
- int i;\
- for(i=0; i<w; i++)\
- {\
- const int srcB= src[-2*srcStride];\
- const int srcA= src[-1*srcStride];\
- const int src0= src[0 *srcStride];\
- const int src1= src[1 *srcStride];\
- const int src2= src[2 *srcStride];\
- const int src3= src[3 *srcStride];\
- const int src4= src[4 *srcStride];\
- const int src5= src[5 *srcStride];\
- const int src6= src[6 *srcStride];\
- const int src7= src[7 *srcStride];\
- const int src8= src[8 *srcStride];\
- const int src9= src[9 *srcStride];\
- const int src10=src[10*srcStride];\
- OP(dst[0*dstStride], (src0+src1)*20 - (srcA+src2)*5 + (srcB+src3));\
- OP(dst[1*dstStride], (src1+src2)*20 - (src0+src3)*5 + (srcA+src4));\
- OP(dst[2*dstStride], (src2+src3)*20 - (src1+src4)*5 + (src0+src5));\
- OP(dst[3*dstStride], (src3+src4)*20 - (src2+src5)*5 + (src1+src6));\
- OP(dst[4*dstStride], (src4+src5)*20 - (src3+src6)*5 + (src2+src7));\
- OP(dst[5*dstStride], (src5+src6)*20 - (src4+src7)*5 + (src3+src8));\
- OP(dst[6*dstStride], (src6+src7)*20 - (src5+src8)*5 + (src4+src9));\
- OP(dst[7*dstStride], (src7+src8)*20 - (src6+src9)*5 + (src5+src10));\
- dst++;\
- src++;\
- }\
-}\
-\
-static void OPNAME ## h264_qpel8_hv_lowpass(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\
- const int h=8;\
- const int w=8;\
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
- int i;\
- src -= 2*srcStride;\
- for(i=0; i<h+5; i++)\
- {\
- tmp[0]= (src[0]+src[1])*20 - (src[-1]+src[2])*5 + (src[-2]+src[3 ]);\
- tmp[1]= (src[1]+src[2])*20 - (src[0 ]+src[3])*5 + (src[-1]+src[4 ]);\
- tmp[2]= (src[2]+src[3])*20 - (src[1 ]+src[4])*5 + (src[0 ]+src[5 ]);\
- tmp[3]= (src[3]+src[4])*20 - (src[2 ]+src[5])*5 + (src[1 ]+src[6 ]);\
- tmp[4]= (src[4]+src[5])*20 - (src[3 ]+src[6])*5 + (src[2 ]+src[7 ]);\
- tmp[5]= (src[5]+src[6])*20 - (src[4 ]+src[7])*5 + (src[3 ]+src[8 ]);\
- tmp[6]= (src[6]+src[7])*20 - (src[5 ]+src[8])*5 + (src[4 ]+src[9 ]);\
- tmp[7]= (src[7]+src[8])*20 - (src[6 ]+src[9])*5 + (src[5 ]+src[10]);\
- tmp+=tmpStride;\
- src+=srcStride;\
- }\
- tmp -= tmpStride*(h+5-2);\
- for(i=0; i<w; i++)\
- {\
- const int tmpB= tmp[-2*tmpStride];\
- const int tmpA= tmp[-1*tmpStride];\
- const int tmp0= tmp[0 *tmpStride];\
- const int tmp1= tmp[1 *tmpStride];\
- const int tmp2= tmp[2 *tmpStride];\
- const int tmp3= tmp[3 *tmpStride];\
- const int tmp4= tmp[4 *tmpStride];\
- const int tmp5= tmp[5 *tmpStride];\
- const int tmp6= tmp[6 *tmpStride];\
- const int tmp7= tmp[7 *tmpStride];\
- const int tmp8= tmp[8 *tmpStride];\
- const int tmp9= tmp[9 *tmpStride];\
- const int tmp10=tmp[10*tmpStride];\
- OP2(dst[0*dstStride], (tmp0+tmp1)*20 - (tmpA+tmp2)*5 + (tmpB+tmp3));\
- OP2(dst[1*dstStride], (tmp1+tmp2)*20 - (tmp0+tmp3)*5 + (tmpA+tmp4));\
- OP2(dst[2*dstStride], (tmp2+tmp3)*20 - (tmp1+tmp4)*5 + (tmp0+tmp5));\
- OP2(dst[3*dstStride], (tmp3+tmp4)*20 - (tmp2+tmp5)*5 + (tmp1+tmp6));\
- OP2(dst[4*dstStride], (tmp4+tmp5)*20 - (tmp3+tmp6)*5 + (tmp2+tmp7));\
- OP2(dst[5*dstStride], (tmp5+tmp6)*20 - (tmp4+tmp7)*5 + (tmp3+tmp8));\
- OP2(dst[6*dstStride], (tmp6+tmp7)*20 - (tmp5+tmp8)*5 + (tmp4+tmp9));\
- OP2(dst[7*dstStride], (tmp7+tmp8)*20 - (tmp6+tmp9)*5 + (tmp5+tmp10));\
- dst++;\
- tmp++;\
- }\
-}\
-\
-static void OPNAME ## h264_qpel16_v_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
- OPNAME ## h264_qpel8_v_lowpass(dst , src , dstStride, srcStride);\
- OPNAME ## h264_qpel8_v_lowpass(dst+8, src+8, dstStride, srcStride);\
- src += 8*srcStride;\
- dst += 8*dstStride;\
- OPNAME ## h264_qpel8_v_lowpass(dst , src , dstStride, srcStride);\
- OPNAME ## h264_qpel8_v_lowpass(dst+8, src+8, dstStride, srcStride);\
-}\
-\
-static void OPNAME ## h264_qpel16_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
- OPNAME ## h264_qpel8_h_lowpass(dst , src , dstStride, srcStride);\
- OPNAME ## h264_qpel8_h_lowpass(dst+8, src+8, dstStride, srcStride);\
- src += 8*srcStride;\
- dst += 8*dstStride;\
- OPNAME ## h264_qpel8_h_lowpass(dst , src , dstStride, srcStride);\
- OPNAME ## h264_qpel8_h_lowpass(dst+8, src+8, dstStride, srcStride);\
-}\
-\
-static void OPNAME ## h264_qpel16_hv_lowpass(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\
- OPNAME ## h264_qpel8_hv_lowpass(dst , tmp , src , dstStride, tmpStride, srcStride);\
- OPNAME ## h264_qpel8_hv_lowpass(dst+8, tmp+8, src+8, dstStride, tmpStride, srcStride);\
- src += 8*srcStride;\
- dst += 8*dstStride;\
- OPNAME ## h264_qpel8_hv_lowpass(dst , tmp , src , dstStride, tmpStride, srcStride);\
- OPNAME ## h264_qpel8_hv_lowpass(dst+8, tmp+8, src+8, dstStride, tmpStride, srcStride);\
-}\
-
-#define H264_MC(OPNAME, SIZE) \
-static void OPNAME ## h264_qpel ## SIZE ## _mc00_c (uint8_t *dst, uint8_t *src, int stride){\
- OPNAME ## pixels ## SIZE ## _c(dst, src, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc10_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t half[SIZE*SIZE];\
- put_h264_qpel ## SIZE ## _h_lowpass(half, src, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2(dst, src, half, stride, stride, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc20_c(uint8_t *dst, uint8_t *src, int stride){\
- OPNAME ## h264_qpel ## SIZE ## _h_lowpass(dst, src, stride, stride);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc30_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t half[SIZE*SIZE];\
- put_h264_qpel ## SIZE ## _h_lowpass(half, src, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2(dst, src+1, half, stride, stride, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc01_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[SIZE*(SIZE+5)];\
- uint8_t * const full_mid= full + SIZE*2;\
- uint8_t half[SIZE*SIZE];\
- copy_block ## SIZE (full, src - stride*2, SIZE, stride, SIZE + 5);\
- put_h264_qpel ## SIZE ## _v_lowpass(half, full_mid, SIZE, SIZE);\
- OPNAME ## pixels ## SIZE ## _l2(dst, full_mid, half, stride, SIZE, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc02_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[SIZE*(SIZE+5)];\
- uint8_t * const full_mid= full + SIZE*2;\
- copy_block ## SIZE (full, src - stride*2, SIZE, stride, SIZE + 5);\
- OPNAME ## h264_qpel ## SIZE ## _v_lowpass(dst, full_mid, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc03_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[SIZE*(SIZE+5)];\
- uint8_t * const full_mid= full + SIZE*2;\
- uint8_t half[SIZE*SIZE];\
- copy_block ## SIZE (full, src - stride*2, SIZE, stride, SIZE + 5);\
- put_h264_qpel ## SIZE ## _v_lowpass(half, full_mid, SIZE, SIZE);\
- OPNAME ## pixels ## SIZE ## _l2(dst, full_mid+SIZE, half, stride, SIZE, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc11_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[SIZE*(SIZE+5)];\
- uint8_t * const full_mid= full + SIZE*2;\
- uint8_t halfH[SIZE*SIZE];\
- uint8_t halfV[SIZE*SIZE];\
- put_h264_qpel ## SIZE ## _h_lowpass(halfH, src, SIZE, stride);\
- copy_block ## SIZE (full, src - stride*2, SIZE, stride, SIZE + 5);\
- put_h264_qpel ## SIZE ## _v_lowpass(halfV, full_mid, SIZE, SIZE);\
- OPNAME ## pixels ## SIZE ## _l2(dst, halfH, halfV, stride, SIZE, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc31_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[SIZE*(SIZE+5)];\
- uint8_t * const full_mid= full + SIZE*2;\
- uint8_t halfH[SIZE*SIZE];\
- uint8_t halfV[SIZE*SIZE];\
- put_h264_qpel ## SIZE ## _h_lowpass(halfH, src, SIZE, stride);\
- copy_block ## SIZE (full, src - stride*2 + 1, SIZE, stride, SIZE + 5);\
- put_h264_qpel ## SIZE ## _v_lowpass(halfV, full_mid, SIZE, SIZE);\
- OPNAME ## pixels ## SIZE ## _l2(dst, halfH, halfV, stride, SIZE, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc13_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[SIZE*(SIZE+5)];\
- uint8_t * const full_mid= full + SIZE*2;\
- uint8_t halfH[SIZE*SIZE];\
- uint8_t halfV[SIZE*SIZE];\
- put_h264_qpel ## SIZE ## _h_lowpass(halfH, src + stride, SIZE, stride);\
- copy_block ## SIZE (full, src - stride*2, SIZE, stride, SIZE + 5);\
- put_h264_qpel ## SIZE ## _v_lowpass(halfV, full_mid, SIZE, SIZE);\
- OPNAME ## pixels ## SIZE ## _l2(dst, halfH, halfV, stride, SIZE, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc33_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[SIZE*(SIZE+5)];\
- uint8_t * const full_mid= full + SIZE*2;\
- uint8_t halfH[SIZE*SIZE];\
- uint8_t halfV[SIZE*SIZE];\
- put_h264_qpel ## SIZE ## _h_lowpass(halfH, src + stride, SIZE, stride);\
- copy_block ## SIZE (full, src - stride*2 + 1, SIZE, stride, SIZE + 5);\
- put_h264_qpel ## SIZE ## _v_lowpass(halfV, full_mid, SIZE, SIZE);\
- OPNAME ## pixels ## SIZE ## _l2(dst, halfH, halfV, stride, SIZE, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc22_c(uint8_t *dst, uint8_t *src, int stride){\
- int16_t tmp[SIZE*(SIZE+5)];\
- OPNAME ## h264_qpel ## SIZE ## _hv_lowpass(dst, tmp, src, stride, SIZE, stride);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc21_c(uint8_t *dst, uint8_t *src, int stride){\
- int16_t tmp[SIZE*(SIZE+5)];\
- uint8_t halfH[SIZE*SIZE];\
- uint8_t halfHV[SIZE*SIZE];\
- put_h264_qpel ## SIZE ## _h_lowpass(halfH, src, SIZE, stride);\
- put_h264_qpel ## SIZE ## _hv_lowpass(halfHV, tmp, src, SIZE, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2(dst, halfH, halfHV, stride, SIZE, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc23_c(uint8_t *dst, uint8_t *src, int stride){\
- int16_t tmp[SIZE*(SIZE+5)];\
- uint8_t halfH[SIZE*SIZE];\
- uint8_t halfHV[SIZE*SIZE];\
- put_h264_qpel ## SIZE ## _h_lowpass(halfH, src + stride, SIZE, stride);\
- put_h264_qpel ## SIZE ## _hv_lowpass(halfHV, tmp, src, SIZE, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2(dst, halfH, halfHV, stride, SIZE, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc12_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[SIZE*(SIZE+5)];\
- uint8_t * const full_mid= full + SIZE*2;\
- int16_t tmp[SIZE*(SIZE+5)];\
- uint8_t halfV[SIZE*SIZE];\
- uint8_t halfHV[SIZE*SIZE];\
- copy_block ## SIZE (full, src - stride*2, SIZE, stride, SIZE + 5);\
- put_h264_qpel ## SIZE ## _v_lowpass(halfV, full_mid, SIZE, SIZE);\
- put_h264_qpel ## SIZE ## _hv_lowpass(halfHV, tmp, src, SIZE, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2(dst, halfV, halfHV, stride, SIZE, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc32_c(uint8_t *dst, uint8_t *src, int stride){\
- uint8_t full[SIZE*(SIZE+5)];\
- uint8_t * const full_mid= full + SIZE*2;\
- int16_t tmp[SIZE*(SIZE+5)];\
- uint8_t halfV[SIZE*SIZE];\
- uint8_t halfHV[SIZE*SIZE];\
- copy_block ## SIZE (full, src - stride*2 + 1, SIZE, stride, SIZE + 5);\
- put_h264_qpel ## SIZE ## _v_lowpass(halfV, full_mid, SIZE, SIZE);\
- put_h264_qpel ## SIZE ## _hv_lowpass(halfHV, tmp, src, SIZE, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2(dst, halfV, halfHV, stride, SIZE, SIZE, SIZE);\
-}\
-
-#define op_avg(a, b) a = (((a)+cm[((b) + 16)>>5]+1)>>1)
-//#define op_avg2(a, b) a = (((a)*w1+cm[((b) + 16)>>5]*w2 + o + 64)>>7)
-#define op_put(a, b) a = cm[((b) + 16)>>5]
-#define op2_avg(a, b) a = (((a)+cm[((b) + 512)>>10]+1)>>1)
-#define op2_put(a, b) a = cm[((b) + 512)>>10]
-
-H264_LOWPASS(put_ , op_put, op2_put)
-H264_LOWPASS(avg_ , op_avg, op2_avg)
-H264_MC(put_, 2)
-H264_MC(put_, 4)
-H264_MC(put_, 8)
-H264_MC(put_, 16)
-H264_MC(avg_, 4)
-H264_MC(avg_, 8)
-H264_MC(avg_, 16)
-
-#undef op_avg
-#undef op_put
-#undef op2_avg
-#undef op2_put
-#endif
-
-#define op_scale1(x) block[x] = clip_uint8( (block[x]*weight + offset) >> log2_denom )
-#define op_scale2(x) dst[x] = clip_uint8( (src[x]*weights + dst[x]*weightd + offset) >> (log2_denom+1))
-#define H264_WEIGHT(W,H) \
-static void weight_h264_pixels ## W ## x ## H ## _c(uint8_t *block, int stride, int log2_denom, int weight, int offset){ \
- int y; \
- offset <<= log2_denom; \
- if(log2_denom) offset += 1<<(log2_denom-1); \
- for(y=0; y<H; y++, block += stride){ \
- op_scale1(0); \
- op_scale1(1); \
- if(W==2) continue; \
- op_scale1(2); \
- op_scale1(3); \
- if(W==4) continue; \
- op_scale1(4); \
- op_scale1(5); \
- op_scale1(6); \
- op_scale1(7); \
- if(W==8) continue; \
- op_scale1(8); \
- op_scale1(9); \
- op_scale1(10); \
- op_scale1(11); \
- op_scale1(12); \
- op_scale1(13); \
- op_scale1(14); \
- op_scale1(15); \
- } \
-} \
-static void biweight_h264_pixels ## W ## x ## H ## _c(uint8_t *dst, uint8_t *src, int stride, int log2_denom, int weightd, int weights, int offset){ \
- int y; \
- offset = ((offset + 1) | 1) << log2_denom; \
- for(y=0; y<H; y++, dst += stride, src += stride){ \
- op_scale2(0); \
- op_scale2(1); \
- if(W==2) continue; \
- op_scale2(2); \
- op_scale2(3); \
- if(W==4) continue; \
- op_scale2(4); \
- op_scale2(5); \
- op_scale2(6); \
- op_scale2(7); \
- if(W==8) continue; \
- op_scale2(8); \
- op_scale2(9); \
- op_scale2(10); \
- op_scale2(11); \
- op_scale2(12); \
- op_scale2(13); \
- op_scale2(14); \
- op_scale2(15); \
- } \
-}
-
-H264_WEIGHT(16,16)
-H264_WEIGHT(16,8)
-H264_WEIGHT(8,16)
-H264_WEIGHT(8,8)
-H264_WEIGHT(8,4)
-H264_WEIGHT(4,8)
-H264_WEIGHT(4,4)
-H264_WEIGHT(4,2)
-H264_WEIGHT(2,4)
-H264_WEIGHT(2,2)
-
-#undef op_scale1
-#undef op_scale2
-#undef H264_WEIGHT
-
-static void wmv2_mspel8_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
- int i;
-
- for(i=0; i<h; i++){
- dst[0]= cm[(9*(src[0] + src[1]) - (src[-1] + src[2]) + 8)>>4];
- dst[1]= cm[(9*(src[1] + src[2]) - (src[ 0] + src[3]) + 8)>>4];
- dst[2]= cm[(9*(src[2] + src[3]) - (src[ 1] + src[4]) + 8)>>4];
- dst[3]= cm[(9*(src[3] + src[4]) - (src[ 2] + src[5]) + 8)>>4];
- dst[4]= cm[(9*(src[4] + src[5]) - (src[ 3] + src[6]) + 8)>>4];
- dst[5]= cm[(9*(src[5] + src[6]) - (src[ 4] + src[7]) + 8)>>4];
- dst[6]= cm[(9*(src[6] + src[7]) - (src[ 5] + src[8]) + 8)>>4];
- dst[7]= cm[(9*(src[7] + src[8]) - (src[ 6] + src[9]) + 8)>>4];
- dst+=dstStride;
- src+=srcStride;
- }
-}
-
-#ifdef CONFIG_CAVS_DECODER
-/* AVS specific */
-void ff_cavsdsp_init(DSPContext* c, AVCodecContext *avctx);
-
-void ff_put_cavs_qpel8_mc00_c(uint8_t *dst, uint8_t *src, int stride) {
- put_pixels8_c(dst, src, stride, 8);
-}
-void ff_avg_cavs_qpel8_mc00_c(uint8_t *dst, uint8_t *src, int stride) {
- avg_pixels8_c(dst, src, stride, 8);
-}
-void ff_put_cavs_qpel16_mc00_c(uint8_t *dst, uint8_t *src, int stride) {
- put_pixels16_c(dst, src, stride, 16);
-}
-void ff_avg_cavs_qpel16_mc00_c(uint8_t *dst, uint8_t *src, int stride) {
- avg_pixels16_c(dst, src, stride, 16);
-}
-#endif /* CONFIG_CAVS_DECODER */
-
-#if defined(CONFIG_VC1_DECODER) || defined(CONFIG_WMV3_DECODER)
-/* VC-1 specific */
-void ff_vc1dsp_init(DSPContext* c, AVCodecContext *avctx);
-
-void ff_put_vc1_mspel_mc00_c(uint8_t *dst, uint8_t *src, int stride, int rnd) {
- put_pixels8_c(dst, src, stride, 8);
-}
-#endif /* CONFIG_VC1_DECODER||CONFIG_WMV3_DECODER */
-
-#if defined(CONFIG_H264_ENCODER)
-/* H264 specific */
-void ff_h264dsp_init(DSPContext* c, AVCodecContext *avctx);
-#endif /* CONFIG_H264_ENCODER */
-
-static void wmv2_mspel8_v_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int w){
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
- int i;
-
- for(i=0; i<w; i++){
- const int src_1= src[ -srcStride];
- const int src0 = src[0 ];
- const int src1 = src[ srcStride];
- const int src2 = src[2*srcStride];
- const int src3 = src[3*srcStride];
- const int src4 = src[4*srcStride];
- const int src5 = src[5*srcStride];
- const int src6 = src[6*srcStride];
- const int src7 = src[7*srcStride];
- const int src8 = src[8*srcStride];
- const int src9 = src[9*srcStride];
- dst[0*dstStride]= cm[(9*(src0 + src1) - (src_1 + src2) + 8)>>4];
- dst[1*dstStride]= cm[(9*(src1 + src2) - (src0 + src3) + 8)>>4];
- dst[2*dstStride]= cm[(9*(src2 + src3) - (src1 + src4) + 8)>>4];
- dst[3*dstStride]= cm[(9*(src3 + src4) - (src2 + src5) + 8)>>4];
- dst[4*dstStride]= cm[(9*(src4 + src5) - (src3 + src6) + 8)>>4];
- dst[5*dstStride]= cm[(9*(src5 + src6) - (src4 + src7) + 8)>>4];
- dst[6*dstStride]= cm[(9*(src6 + src7) - (src5 + src8) + 8)>>4];
- dst[7*dstStride]= cm[(9*(src7 + src8) - (src6 + src9) + 8)>>4];
- src++;
- dst++;
- }
-}
-
-static void put_mspel8_mc00_c (uint8_t *dst, uint8_t *src, int stride){
- put_pixels8_c(dst, src, stride, 8);
-}
-
-static void put_mspel8_mc10_c(uint8_t *dst, uint8_t *src, int stride){
- uint8_t half[64];
- wmv2_mspel8_h_lowpass(half, src, 8, stride, 8);
- put_pixels8_l2(dst, src, half, stride, stride, 8, 8);
-}
-
-static void put_mspel8_mc20_c(uint8_t *dst, uint8_t *src, int stride){
- wmv2_mspel8_h_lowpass(dst, src, stride, stride, 8);
-}
-
-static void put_mspel8_mc30_c(uint8_t *dst, uint8_t *src, int stride){
- uint8_t half[64];
- wmv2_mspel8_h_lowpass(half, src, 8, stride, 8);
- put_pixels8_l2(dst, src+1, half, stride, stride, 8, 8);
-}
-
-static void put_mspel8_mc02_c(uint8_t *dst, uint8_t *src, int stride){
- wmv2_mspel8_v_lowpass(dst, src, stride, stride, 8);
-}
-
-static void put_mspel8_mc12_c(uint8_t *dst, uint8_t *src, int stride){
- uint8_t halfH[88];
- uint8_t halfV[64];
- uint8_t halfHV[64];
- wmv2_mspel8_h_lowpass(halfH, src-stride, 8, stride, 11);
- wmv2_mspel8_v_lowpass(halfV, src, 8, stride, 8);
- wmv2_mspel8_v_lowpass(halfHV, halfH+8, 8, 8, 8);
- put_pixels8_l2(dst, halfV, halfHV, stride, 8, 8, 8);
-}
-static void put_mspel8_mc32_c(uint8_t *dst, uint8_t *src, int stride){
- uint8_t halfH[88];
- uint8_t halfV[64];
- uint8_t halfHV[64];
- wmv2_mspel8_h_lowpass(halfH, src-stride, 8, stride, 11);
- wmv2_mspel8_v_lowpass(halfV, src+1, 8, stride, 8);
- wmv2_mspel8_v_lowpass(halfHV, halfH+8, 8, 8, 8);
- put_pixels8_l2(dst, halfV, halfHV, stride, 8, 8, 8);
-}
-static void put_mspel8_mc22_c(uint8_t *dst, uint8_t *src, int stride){
- uint8_t halfH[88];
- wmv2_mspel8_h_lowpass(halfH, src-stride, 8, stride, 11);
- wmv2_mspel8_v_lowpass(dst, halfH+8, stride, 8, 8);
-}
-
-static void h263_v_loop_filter_c(uint8_t *src, int stride, int qscale){
- int x;
- const int strength= ff_h263_loop_filter_strength[qscale];
-
- for(x=0; x<8; x++){
- int d1, d2, ad1;
- int p0= src[x-2*stride];
- int p1= src[x-1*stride];
- int p2= src[x+0*stride];
- int p3= src[x+1*stride];
- int d = (p0 - p3 + 4*(p2 - p1)) / 8;
-
- if (d<-2*strength) d1= 0;
- else if(d<- strength) d1=-2*strength - d;
- else if(d< strength) d1= d;
- else if(d< 2*strength) d1= 2*strength - d;
- else d1= 0;
-
- p1 += d1;
- p2 -= d1;
- if(p1&256) p1= ~(p1>>31);
- if(p2&256) p2= ~(p2>>31);
-
- src[x-1*stride] = p1;
- src[x+0*stride] = p2;
-
- ad1= FFABS(d1)>>1;
-
- d2= clip((p0-p3)/4, -ad1, ad1);
-
- src[x-2*stride] = p0 - d2;
- src[x+ stride] = p3 + d2;
- }
-}
-
-static void h263_h_loop_filter_c(uint8_t *src, int stride, int qscale){
- int y;
- const int strength= ff_h263_loop_filter_strength[qscale];
-
- for(y=0; y<8; y++){
- int d1, d2, ad1;
- int p0= src[y*stride-2];
- int p1= src[y*stride-1];
- int p2= src[y*stride+0];
- int p3= src[y*stride+1];
- int d = (p0 - p3 + 4*(p2 - p1)) / 8;
-
- if (d<-2*strength) d1= 0;
- else if(d<- strength) d1=-2*strength - d;
- else if(d< strength) d1= d;
- else if(d< 2*strength) d1= 2*strength - d;
- else d1= 0;
-
- p1 += d1;
- p2 -= d1;
- if(p1&256) p1= ~(p1>>31);
- if(p2&256) p2= ~(p2>>31);
-
- src[y*stride-1] = p1;
- src[y*stride+0] = p2;
-
- ad1= FFABS(d1)>>1;
-
- d2= clip((p0-p3)/4, -ad1, ad1);
-
- src[y*stride-2] = p0 - d2;
- src[y*stride+1] = p3 + d2;
- }
-}
-
-static void h261_loop_filter_c(uint8_t *src, int stride){
- int x,y,xy,yz;
- int temp[64];
-
- for(x=0; x<8; x++){
- temp[x ] = 4*src[x ];
- temp[x + 7*8] = 4*src[x + 7*stride];
- }
- for(y=1; y<7; y++){
- for(x=0; x<8; x++){
- xy = y * stride + x;
- yz = y * 8 + x;
- temp[yz] = src[xy - stride] + 2*src[xy] + src[xy + stride];
- }
- }
-
- for(y=0; y<8; y++){
- src[ y*stride] = (temp[ y*8] + 2)>>2;
- src[7+y*stride] = (temp[7+y*8] + 2)>>2;
- for(x=1; x<7; x++){
- xy = y * stride + x;
- yz = y * 8 + x;
- src[xy] = (temp[yz-1] + 2*temp[yz] + temp[yz+1] + 8)>>4;
- }
- }
-}
-
-static inline void h264_loop_filter_luma_c(uint8_t *pix, int xstride, int ystride, int alpha, int beta, int8_t *tc0)
-{
- int i, d;
- for( i = 0; i < 4; i++ ) {
- if( tc0[i] < 0 ) {
- pix += 4*ystride;
- continue;
- }
- for( d = 0; d < 4; d++ ) {
- const int p0 = pix[-1*xstride];
- const int p1 = pix[-2*xstride];
- const int p2 = pix[-3*xstride];
- const int q0 = pix[0];
- const int q1 = pix[1*xstride];
- const int q2 = pix[2*xstride];
-
- if( FFABS( p0 - q0 ) < alpha &&
- FFABS( p1 - p0 ) < beta &&
- FFABS( q1 - q0 ) < beta ) {
-
- int tc = tc0[i];
- int i_delta;
-
- if( FFABS( p2 - p0 ) < beta ) {
- pix[-2*xstride] = p1 + clip( (( p2 + ( ( p0 + q0 + 1 ) >> 1 ) ) >> 1) - p1, -tc0[i], tc0[i] );
- tc++;
- }
- if( FFABS( q2 - q0 ) < beta ) {
- pix[ xstride] = q1 + clip( (( q2 + ( ( p0 + q0 + 1 ) >> 1 ) ) >> 1) - q1, -tc0[i], tc0[i] );
- tc++;
- }
-
- i_delta = clip( (((q0 - p0 ) << 2) + (p1 - q1) + 4) >> 3, -tc, tc );
- pix[-xstride] = clip_uint8( p0 + i_delta ); /* p0' */
- pix[0] = clip_uint8( q0 - i_delta ); /* q0' */
- }
- pix += ystride;
- }
- }
-}
-static void h264_v_loop_filter_luma_c(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
-{
- h264_loop_filter_luma_c(pix, stride, 1, alpha, beta, tc0);
-}
-static void h264_h_loop_filter_luma_c(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
-{
- h264_loop_filter_luma_c(pix, 1, stride, alpha, beta, tc0);
-}
-
-static inline void h264_loop_filter_chroma_c(uint8_t *pix, int xstride, int ystride, int alpha, int beta, int8_t *tc0)
-{
- int i, d;
- for( i = 0; i < 4; i++ ) {
- const int tc = tc0[i];
- if( tc <= 0 ) {
- pix += 2*ystride;
- continue;
- }
- for( d = 0; d < 2; d++ ) {
- const int p0 = pix[-1*xstride];
- const int p1 = pix[-2*xstride];
- const int q0 = pix[0];
- const int q1 = pix[1*xstride];
-
- if( FFABS( p0 - q0 ) < alpha &&
- FFABS( p1 - p0 ) < beta &&
- FFABS( q1 - q0 ) < beta ) {
-
- int delta = clip( (((q0 - p0 ) << 2) + (p1 - q1) + 4) >> 3, -tc, tc );
-
- pix[-xstride] = clip_uint8( p0 + delta ); /* p0' */
- pix[0] = clip_uint8( q0 - delta ); /* q0' */
- }
- pix += ystride;
- }
- }
-}
-static void h264_v_loop_filter_chroma_c(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
-{
- h264_loop_filter_chroma_c(pix, stride, 1, alpha, beta, tc0);
-}
-static void h264_h_loop_filter_chroma_c(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
-{
- h264_loop_filter_chroma_c(pix, 1, stride, alpha, beta, tc0);
-}
-
-static inline void h264_loop_filter_chroma_intra_c(uint8_t *pix, int xstride, int ystride, int alpha, int beta)
-{
- int d;
- for( d = 0; d < 8; d++ ) {
- const int p0 = pix[-1*xstride];
- const int p1 = pix[-2*xstride];
- const int q0 = pix[0];
- const int q1 = pix[1*xstride];
-
- if( FFABS( p0 - q0 ) < alpha &&
- FFABS( p1 - p0 ) < beta &&
- FFABS( q1 - q0 ) < beta ) {
-
- pix[-xstride] = ( 2*p1 + p0 + q1 + 2 ) >> 2; /* p0' */
- pix[0] = ( 2*q1 + q0 + p1 + 2 ) >> 2; /* q0' */
- }
- pix += ystride;
- }
-}
-static void h264_v_loop_filter_chroma_intra_c(uint8_t *pix, int stride, int alpha, int beta)
-{
- h264_loop_filter_chroma_intra_c(pix, stride, 1, alpha, beta);
-}
-static void h264_h_loop_filter_chroma_intra_c(uint8_t *pix, int stride, int alpha, int beta)
-{
- h264_loop_filter_chroma_intra_c(pix, 1, stride, alpha, beta);
-}
-
-static inline int pix_abs16_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
- int s, i;
-
- s = 0;
- for(i=0;i<h;i++) {
- s += abs(pix1[0] - pix2[0]);
- s += abs(pix1[1] - pix2[1]);
- s += abs(pix1[2] - pix2[2]);
- s += abs(pix1[3] - pix2[3]);
- s += abs(pix1[4] - pix2[4]);
- s += abs(pix1[5] - pix2[5]);
- s += abs(pix1[6] - pix2[6]);
- s += abs(pix1[7] - pix2[7]);
- s += abs(pix1[8] - pix2[8]);
- s += abs(pix1[9] - pix2[9]);
- s += abs(pix1[10] - pix2[10]);
- s += abs(pix1[11] - pix2[11]);
- s += abs(pix1[12] - pix2[12]);
- s += abs(pix1[13] - pix2[13]);
- s += abs(pix1[14] - pix2[14]);
- s += abs(pix1[15] - pix2[15]);
- pix1 += line_size;
- pix2 += line_size;
- }
- return s;
-}
-
-static int pix_abs16_x2_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
- int s, i;
-
- s = 0;
- for(i=0;i<h;i++) {
- s += abs(pix1[0] - avg2(pix2[0], pix2[1]));
- s += abs(pix1[1] - avg2(pix2[1], pix2[2]));
- s += abs(pix1[2] - avg2(pix2[2], pix2[3]));
- s += abs(pix1[3] - avg2(pix2[3], pix2[4]));
- s += abs(pix1[4] - avg2(pix2[4], pix2[5]));
- s += abs(pix1[5] - avg2(pix2[5], pix2[6]));
- s += abs(pix1[6] - avg2(pix2[6], pix2[7]));
- s += abs(pix1[7] - avg2(pix2[7], pix2[8]));
- s += abs(pix1[8] - avg2(pix2[8], pix2[9]));
- s += abs(pix1[9] - avg2(pix2[9], pix2[10]));
- s += abs(pix1[10] - avg2(pix2[10], pix2[11]));
- s += abs(pix1[11] - avg2(pix2[11], pix2[12]));
- s += abs(pix1[12] - avg2(pix2[12], pix2[13]));
- s += abs(pix1[13] - avg2(pix2[13], pix2[14]));
- s += abs(pix1[14] - avg2(pix2[14], pix2[15]));
- s += abs(pix1[15] - avg2(pix2[15], pix2[16]));
- pix1 += line_size;
- pix2 += line_size;
- }
- return s;
-}
-
-static int pix_abs16_y2_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
- int s, i;
- uint8_t *pix3 = pix2 + line_size;
-
- s = 0;
- for(i=0;i<h;i++) {
- s += abs(pix1[0] - avg2(pix2[0], pix3[0]));
- s += abs(pix1[1] - avg2(pix2[1], pix3[1]));
- s += abs(pix1[2] - avg2(pix2[2], pix3[2]));
- s += abs(pix1[3] - avg2(pix2[3], pix3[3]));
- s += abs(pix1[4] - avg2(pix2[4], pix3[4]));
- s += abs(pix1[5] - avg2(pix2[5], pix3[5]));
- s += abs(pix1[6] - avg2(pix2[6], pix3[6]));
- s += abs(pix1[7] - avg2(pix2[7], pix3[7]));
- s += abs(pix1[8] - avg2(pix2[8], pix3[8]));
- s += abs(pix1[9] - avg2(pix2[9], pix3[9]));
- s += abs(pix1[10] - avg2(pix2[10], pix3[10]));
- s += abs(pix1[11] - avg2(pix2[11], pix3[11]));
- s += abs(pix1[12] - avg2(pix2[12], pix3[12]));
- s += abs(pix1[13] - avg2(pix2[13], pix3[13]));
- s += abs(pix1[14] - avg2(pix2[14], pix3[14]));
- s += abs(pix1[15] - avg2(pix2[15], pix3[15]));
- pix1 += line_size;
- pix2 += line_size;
- pix3 += line_size;
- }
- return s;
-}
-
-static int pix_abs16_xy2_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
- int s, i;
- uint8_t *pix3 = pix2 + line_size;
-
- s = 0;
- for(i=0;i<h;i++) {
- s += abs(pix1[0] - avg4(pix2[0], pix2[1], pix3[0], pix3[1]));
- s += abs(pix1[1] - avg4(pix2[1], pix2[2], pix3[1], pix3[2]));
- s += abs(pix1[2] - avg4(pix2[2], pix2[3], pix3[2], pix3[3]));
- s += abs(pix1[3] - avg4(pix2[3], pix2[4], pix3[3], pix3[4]));
- s += abs(pix1[4] - avg4(pix2[4], pix2[5], pix3[4], pix3[5]));
- s += abs(pix1[5] - avg4(pix2[5], pix2[6], pix3[5], pix3[6]));
- s += abs(pix1[6] - avg4(pix2[6], pix2[7], pix3[6], pix3[7]));
- s += abs(pix1[7] - avg4(pix2[7], pix2[8], pix3[7], pix3[8]));
- s += abs(pix1[8] - avg4(pix2[8], pix2[9], pix3[8], pix3[9]));
- s += abs(pix1[9] - avg4(pix2[9], pix2[10], pix3[9], pix3[10]));
- s += abs(pix1[10] - avg4(pix2[10], pix2[11], pix3[10], pix3[11]));
- s += abs(pix1[11] - avg4(pix2[11], pix2[12], pix3[11], pix3[12]));
- s += abs(pix1[12] - avg4(pix2[12], pix2[13], pix3[12], pix3[13]));
- s += abs(pix1[13] - avg4(pix2[13], pix2[14], pix3[13], pix3[14]));
- s += abs(pix1[14] - avg4(pix2[14], pix2[15], pix3[14], pix3[15]));
- s += abs(pix1[15] - avg4(pix2[15], pix2[16], pix3[15], pix3[16]));
- pix1 += line_size;
- pix2 += line_size;
- pix3 += line_size;
- }
- return s;
-}
-
-static inline int pix_abs8_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
- int s, i;
-
- s = 0;
- for(i=0;i<h;i++) {
- s += abs(pix1[0] - pix2[0]);
- s += abs(pix1[1] - pix2[1]);
- s += abs(pix1[2] - pix2[2]);
- s += abs(pix1[3] - pix2[3]);
- s += abs(pix1[4] - pix2[4]);
- s += abs(pix1[5] - pix2[5]);
- s += abs(pix1[6] - pix2[6]);
- s += abs(pix1[7] - pix2[7]);
- pix1 += line_size;
- pix2 += line_size;
- }
- return s;
-}
-
-static int pix_abs8_x2_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
- int s, i;
-
- s = 0;
- for(i=0;i<h;i++) {
- s += abs(pix1[0] - avg2(pix2[0], pix2[1]));
- s += abs(pix1[1] - avg2(pix2[1], pix2[2]));
- s += abs(pix1[2] - avg2(pix2[2], pix2[3]));
- s += abs(pix1[3] - avg2(pix2[3], pix2[4]));
- s += abs(pix1[4] - avg2(pix2[4], pix2[5]));
- s += abs(pix1[5] - avg2(pix2[5], pix2[6]));
- s += abs(pix1[6] - avg2(pix2[6], pix2[7]));
- s += abs(pix1[7] - avg2(pix2[7], pix2[8]));
- pix1 += line_size;
- pix2 += line_size;
- }
- return s;
-}
-
-static int pix_abs8_y2_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
- int s, i;
- uint8_t *pix3 = pix2 + line_size;
-
- s = 0;
- for(i=0;i<h;i++) {
- s += abs(pix1[0] - avg2(pix2[0], pix3[0]));
- s += abs(pix1[1] - avg2(pix2[1], pix3[1]));
- s += abs(pix1[2] - avg2(pix2[2], pix3[2]));
- s += abs(pix1[3] - avg2(pix2[3], pix3[3]));
- s += abs(pix1[4] - avg2(pix2[4], pix3[4]));
- s += abs(pix1[5] - avg2(pix2[5], pix3[5]));
- s += abs(pix1[6] - avg2(pix2[6], pix3[6]));
- s += abs(pix1[7] - avg2(pix2[7], pix3[7]));
- pix1 += line_size;
- pix2 += line_size;
- pix3 += line_size;
- }
- return s;
-}
-
-static int pix_abs8_xy2_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
- int s, i;
- uint8_t *pix3 = pix2 + line_size;
-
- s = 0;
- for(i=0;i<h;i++) {
- s += abs(pix1[0] - avg4(pix2[0], pix2[1], pix3[0], pix3[1]));
- s += abs(pix1[1] - avg4(pix2[1], pix2[2], pix3[1], pix3[2]));
- s += abs(pix1[2] - avg4(pix2[2], pix2[3], pix3[2], pix3[3]));
- s += abs(pix1[3] - avg4(pix2[3], pix2[4], pix3[3], pix3[4]));
- s += abs(pix1[4] - avg4(pix2[4], pix2[5], pix3[4], pix3[5]));
- s += abs(pix1[5] - avg4(pix2[5], pix2[6], pix3[5], pix3[6]));
- s += abs(pix1[6] - avg4(pix2[6], pix2[7], pix3[6], pix3[7]));
- s += abs(pix1[7] - avg4(pix2[7], pix2[8], pix3[7], pix3[8]));
- pix1 += line_size;
- pix2 += line_size;
- pix3 += line_size;
- }
- return s;
-}
-
-static int nsse16_c(void *v, uint8_t *s1, uint8_t *s2, int stride, int h){
- MpegEncContext *c = v;
- int score1=0;
- int score2=0;
- int x,y;
-
- for(y=0; y<h; y++){
- for(x=0; x<16; x++){
- score1+= (s1[x ] - s2[x ])*(s1[x ] - s2[x ]);
- }
- if(y+1<h){
- for(x=0; x<15; x++){
- score2+= FFABS( s1[x ] - s1[x +stride]
- - s1[x+1] + s1[x+1+stride])
- -FFABS( s2[x ] - s2[x +stride]
- - s2[x+1] + s2[x+1+stride]);
- }
- }
- s1+= stride;
- s2+= stride;
- }
-
- if(c) return score1 + FFABS(score2)*c->avctx->nsse_weight;
- else return score1 + FFABS(score2)*8;
-}
-
-static int nsse8_c(void *v, uint8_t *s1, uint8_t *s2, int stride, int h){
- MpegEncContext *c = v;
- int score1=0;
- int score2=0;
- int x,y;
-
- for(y=0; y<h; y++){
- for(x=0; x<8; x++){
- score1+= (s1[x ] - s2[x ])*(s1[x ] - s2[x ]);
- }
- if(y+1<h){
- for(x=0; x<7; x++){
- score2+= FFABS( s1[x ] - s1[x +stride]
- - s1[x+1] + s1[x+1+stride])
- -FFABS( s2[x ] - s2[x +stride]
- - s2[x+1] + s2[x+1+stride]);
- }
- }
- s1+= stride;
- s2+= stride;
- }
-
- if(c) return score1 + FFABS(score2)*c->avctx->nsse_weight;
- else return score1 + FFABS(score2)*8;
-}
-
-static int try_8x8basis_c(int16_t rem[64], int16_t weight[64], int16_t basis[64], int scale){
- int i;
- unsigned int sum=0;
-
- for(i=0; i<8*8; i++){
- int b= rem[i] + ((basis[i]*scale + (1<<(BASIS_SHIFT - RECON_SHIFT-1)))>>(BASIS_SHIFT - RECON_SHIFT));
- int w= weight[i];
- b>>= RECON_SHIFT;
- assert(-512<b && b<512);
-
- sum += (w*b)*(w*b)>>4;
- }
- return sum>>2;
-}
-
-static void add_8x8basis_c(int16_t rem[64], int16_t basis[64], int scale){
- int i;
-
- for(i=0; i<8*8; i++){
- rem[i] += (basis[i]*scale + (1<<(BASIS_SHIFT - RECON_SHIFT-1)))>>(BASIS_SHIFT - RECON_SHIFT);
- }
-}
-
-/**
- * permutes an 8x8 block.
- * @param block the block which will be permuted according to the given permutation vector
- * @param permutation the permutation vector
- * @param last the last non zero coefficient in scantable order, used to speed the permutation up
- * @param scantable the used scantable, this is only used to speed the permutation up, the block is not
- * (inverse) permutated to scantable order!
- */
-void ff_block_permute(DCTELEM *block, uint8_t *permutation, const uint8_t *scantable, int last)
-{
- int i;
- DCTELEM temp[64];
-
- if(last<=0) return;
- //if(permutation[1]==1) return; //FIXME its ok but not clean and might fail for some perms
-
- for(i=0; i<=last; i++){
- const int j= scantable[i];
- temp[j]= block[j];
- block[j]=0;
- }
-
- for(i=0; i<=last; i++){
- const int j= scantable[i];
- const int perm_j= permutation[j];
- block[perm_j]= temp[j];
- }
-}
-
-static int zero_cmp(void *s, uint8_t *a, uint8_t *b, int stride, int h){
- return 0;
-}
-
-void ff_set_cmp(DSPContext* c, me_cmp_func *cmp, int type){
- int i;
-
- memset(cmp, 0, sizeof(void*)*5);
-
- for(i=0; i<5; i++){
- switch(type&0xFF){
- case FF_CMP_SAD:
- cmp[i]= c->sad[i];
- break;
- case FF_CMP_SATD:
- cmp[i]= c->hadamard8_diff[i];
- break;
- case FF_CMP_SSE:
- cmp[i]= c->sse[i];
- break;
- case FF_CMP_DCT:
- cmp[i]= c->dct_sad[i];
- break;
- case FF_CMP_DCT264:
- cmp[i]= c->dct264_sad[i];
- break;
- case FF_CMP_DCTMAX:
- cmp[i]= c->dct_max[i];
- break;
- case FF_CMP_PSNR:
- cmp[i]= c->quant_psnr[i];
- break;
- case FF_CMP_BIT:
- cmp[i]= c->bit[i];
- break;
- case FF_CMP_RD:
- cmp[i]= c->rd[i];
- break;
- case FF_CMP_VSAD:
- cmp[i]= c->vsad[i];
- break;
- case FF_CMP_VSSE:
- cmp[i]= c->vsse[i];
- break;
- case FF_CMP_ZERO:
- cmp[i]= zero_cmp;
- break;
- case FF_CMP_NSSE:
- cmp[i]= c->nsse[i];
- break;
-#ifdef CONFIG_SNOW_ENCODER
- case FF_CMP_W53:
- cmp[i]= c->w53[i];
- break;
- case FF_CMP_W97:
- cmp[i]= c->w97[i];
- break;
-#endif
- default:
- av_log(NULL, AV_LOG_ERROR,"internal error in cmp function selection\n");
- }
- }
-}
-
-/**
- * memset(blocks, 0, sizeof(DCTELEM)*6*64)
- */
-static void clear_blocks_c(DCTELEM *blocks)
-{
- memset(blocks, 0, sizeof(DCTELEM)*6*64);
-}
-
-static void add_bytes_c(uint8_t *dst, uint8_t *src, int w){
- int i;
- for(i=0; i+7<w; i+=8){
- dst[i+0] += src[i+0];
- dst[i+1] += src[i+1];
- dst[i+2] += src[i+2];
- dst[i+3] += src[i+3];
- dst[i+4] += src[i+4];
- dst[i+5] += src[i+5];
- dst[i+6] += src[i+6];
- dst[i+7] += src[i+7];
- }
- for(; i<w; i++)
- dst[i+0] += src[i+0];
-}
-
-static void diff_bytes_c(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w){
- int i;
- for(i=0; i+7<w; i+=8){
- dst[i+0] = src1[i+0]-src2[i+0];
- dst[i+1] = src1[i+1]-src2[i+1];
- dst[i+2] = src1[i+2]-src2[i+2];
- dst[i+3] = src1[i+3]-src2[i+3];
- dst[i+4] = src1[i+4]-src2[i+4];
- dst[i+5] = src1[i+5]-src2[i+5];
- dst[i+6] = src1[i+6]-src2[i+6];
- dst[i+7] = src1[i+7]-src2[i+7];
- }
- for(; i<w; i++)
- dst[i+0] = src1[i+0]-src2[i+0];
-}
-
-static void sub_hfyu_median_prediction_c(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w, int *left, int *left_top){
- int i;
- uint8_t l, lt;
-
- l= *left;
- lt= *left_top;
-
- for(i=0; i<w; i++){
- const int pred= mid_pred(l, src1[i], (l + src1[i] - lt)&0xFF);
- lt= src1[i];
- l= src2[i];
- dst[i]= l - pred;
- }
-
- *left= l;
- *left_top= lt;
-}
-
-#define BUTTERFLY2(o1,o2,i1,i2) \
-o1= (i1)+(i2);\
-o2= (i1)-(i2);
-
-#define BUTTERFLY1(x,y) \
-{\
- int a,b;\
- a= x;\
- b= y;\
- x= a+b;\
- y= a-b;\
-}
-
-#define BUTTERFLYA(x,y) (FFABS((x)+(y)) + FFABS((x)-(y)))
-
-static int hadamard8_diff8x8_c(/*MpegEncContext*/ void *s, uint8_t *dst, uint8_t *src, int stride, int h){
- int i;
- int temp[64];
- int sum=0;
-
- assert(h==8);
-
- for(i=0; i<8; i++){
- //FIXME try pointer walks
- BUTTERFLY2(temp[8*i+0], temp[8*i+1], src[stride*i+0]-dst[stride*i+0],src[stride*i+1]-dst[stride*i+1]);
- BUTTERFLY2(temp[8*i+2], temp[8*i+3], src[stride*i+2]-dst[stride*i+2],src[stride*i+3]-dst[stride*i+3]);
- BUTTERFLY2(temp[8*i+4], temp[8*i+5], src[stride*i+4]-dst[stride*i+4],src[stride*i+5]-dst[stride*i+5]);
- BUTTERFLY2(temp[8*i+6], temp[8*i+7], src[stride*i+6]-dst[stride*i+6],src[stride*i+7]-dst[stride*i+7]);
-
- BUTTERFLY1(temp[8*i+0], temp[8*i+2]);
- BUTTERFLY1(temp[8*i+1], temp[8*i+3]);
- BUTTERFLY1(temp[8*i+4], temp[8*i+6]);
- BUTTERFLY1(temp[8*i+5], temp[8*i+7]);
-
- BUTTERFLY1(temp[8*i+0], temp[8*i+4]);
- BUTTERFLY1(temp[8*i+1], temp[8*i+5]);
- BUTTERFLY1(temp[8*i+2], temp[8*i+6]);
- BUTTERFLY1(temp[8*i+3], temp[8*i+7]);
- }
-
- for(i=0; i<8; i++){
- BUTTERFLY1(temp[8*0+i], temp[8*1+i]);
- BUTTERFLY1(temp[8*2+i], temp[8*3+i]);
- BUTTERFLY1(temp[8*4+i], temp[8*5+i]);
- BUTTERFLY1(temp[8*6+i], temp[8*7+i]);
-
- BUTTERFLY1(temp[8*0+i], temp[8*2+i]);
- BUTTERFLY1(temp[8*1+i], temp[8*3+i]);
- BUTTERFLY1(temp[8*4+i], temp[8*6+i]);
- BUTTERFLY1(temp[8*5+i], temp[8*7+i]);
-
- sum +=
- BUTTERFLYA(temp[8*0+i], temp[8*4+i])
- +BUTTERFLYA(temp[8*1+i], temp[8*5+i])
- +BUTTERFLYA(temp[8*2+i], temp[8*6+i])
- +BUTTERFLYA(temp[8*3+i], temp[8*7+i]);
- }
-#if 0
-static int maxi=0;
-if(sum>maxi){
- maxi=sum;
- printf("MAX:%d\n", maxi);
-}
-#endif
- return sum;
-}
-
-static int hadamard8_intra8x8_c(/*MpegEncContext*/ void *s, uint8_t *src, uint8_t *dummy, int stride, int h){
- int i;
- int temp[64];
- int sum=0;
-
- assert(h==8);
-
- for(i=0; i<8; i++){
- //FIXME try pointer walks
- BUTTERFLY2(temp[8*i+0], temp[8*i+1], src[stride*i+0],src[stride*i+1]);
- BUTTERFLY2(temp[8*i+2], temp[8*i+3], src[stride*i+2],src[stride*i+3]);
- BUTTERFLY2(temp[8*i+4], temp[8*i+5], src[stride*i+4],src[stride*i+5]);
- BUTTERFLY2(temp[8*i+6], temp[8*i+7], src[stride*i+6],src[stride*i+7]);
-
- BUTTERFLY1(temp[8*i+0], temp[8*i+2]);
- BUTTERFLY1(temp[8*i+1], temp[8*i+3]);
- BUTTERFLY1(temp[8*i+4], temp[8*i+6]);
- BUTTERFLY1(temp[8*i+5], temp[8*i+7]);
-
- BUTTERFLY1(temp[8*i+0], temp[8*i+4]);
- BUTTERFLY1(temp[8*i+1], temp[8*i+5]);
- BUTTERFLY1(temp[8*i+2], temp[8*i+6]);
- BUTTERFLY1(temp[8*i+3], temp[8*i+7]);
- }
-
- for(i=0; i<8; i++){
- BUTTERFLY1(temp[8*0+i], temp[8*1+i]);
- BUTTERFLY1(temp[8*2+i], temp[8*3+i]);
- BUTTERFLY1(temp[8*4+i], temp[8*5+i]);
- BUTTERFLY1(temp[8*6+i], temp[8*7+i]);
-
- BUTTERFLY1(temp[8*0+i], temp[8*2+i]);
- BUTTERFLY1(temp[8*1+i], temp[8*3+i]);
- BUTTERFLY1(temp[8*4+i], temp[8*6+i]);
- BUTTERFLY1(temp[8*5+i], temp[8*7+i]);
-
- sum +=
- BUTTERFLYA(temp[8*0+i], temp[8*4+i])
- +BUTTERFLYA(temp[8*1+i], temp[8*5+i])
- +BUTTERFLYA(temp[8*2+i], temp[8*6+i])
- +BUTTERFLYA(temp[8*3+i], temp[8*7+i]);
- }
-
- sum -= FFABS(temp[8*0] + temp[8*4]); // -mean
-
- return sum;
-}
-
-static int dct_sad8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){
- MpegEncContext * const s= (MpegEncContext *)c;
- DECLARE_ALIGNED_8(uint64_t, aligned_temp[sizeof(DCTELEM)*64/8]);
- DCTELEM * const temp= (DCTELEM*)aligned_temp;
- int sum=0, i;
-
- assert(h==8);
-
- s->dsp.diff_pixels(temp, src1, src2, stride);
- s->dsp.fdct(temp);
-
- for(i=0; i<64; i++)
- sum+= FFABS(temp[i]);
-
- return sum;
-}
-
-#ifdef CONFIG_GPL
-#define DCT8_1D {\
- const int s07 = SRC(0) + SRC(7);\
- const int s16 = SRC(1) + SRC(6);\
- const int s25 = SRC(2) + SRC(5);\
- const int s34 = SRC(3) + SRC(4);\
- const int a0 = s07 + s34;\
- const int a1 = s16 + s25;\
- const int a2 = s07 - s34;\
- const int a3 = s16 - s25;\
- const int d07 = SRC(0) - SRC(7);\
- const int d16 = SRC(1) - SRC(6);\
- const int d25 = SRC(2) - SRC(5);\
- const int d34 = SRC(3) - SRC(4);\
- const int a4 = d16 + d25 + (d07 + (d07>>1));\
- const int a5 = d07 - d34 - (d25 + (d25>>1));\
- const int a6 = d07 + d34 - (d16 + (d16>>1));\
- const int a7 = d16 - d25 + (d34 + (d34>>1));\
- DST(0, a0 + a1 ) ;\
- DST(1, a4 + (a7>>2)) ;\
- DST(2, a2 + (a3>>1)) ;\
- DST(3, a5 + (a6>>2)) ;\
- DST(4, a0 - a1 ) ;\
- DST(5, a6 - (a5>>2)) ;\
- DST(6, (a2>>1) - a3 ) ;\
- DST(7, (a4>>2) - a7 ) ;\
-}
-
-static int dct264_sad8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){
- MpegEncContext * const s= (MpegEncContext *)c;
- int16_t dct[8][8];
- int i;
- int sum=0;
-
- s->dsp.diff_pixels(dct, src1, src2, stride);
-
-#define SRC(x) dct[i][x]
-#define DST(x,v) dct[i][x]= v
- for( i = 0; i < 8; i++ )
- DCT8_1D
-#undef SRC
-#undef DST
-
-#define SRC(x) dct[x][i]
-#define DST(x,v) sum += FFABS(v)
- for( i = 0; i < 8; i++ )
- DCT8_1D
-#undef SRC
-#undef DST
- return sum;
-}
-#endif
-
-static int dct_max8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){
- MpegEncContext * const s= (MpegEncContext *)c;
- DECLARE_ALIGNED_8(uint64_t, aligned_temp[sizeof(DCTELEM)*64/8]);
- DCTELEM * const temp= (DCTELEM*)aligned_temp;
- int sum=0, i;
-
- assert(h==8);
-
- s->dsp.diff_pixels(temp, src1, src2, stride);
- s->dsp.fdct(temp);
-
- for(i=0; i<64; i++)
- sum= FFMAX(sum, FFABS(temp[i]));
-
- return sum;
-}
-
-static int quant_psnr8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){
- MpegEncContext * const s= (MpegEncContext *)c;
- DECLARE_ALIGNED_8 (uint64_t, aligned_temp[sizeof(DCTELEM)*64*2/8]);
- DCTELEM * const temp= (DCTELEM*)aligned_temp;
- DCTELEM * const bak = ((DCTELEM*)aligned_temp)+64;
- int sum=0, i;
-
- assert(h==8);
- s->mb_intra=0;
-
- s->dsp.diff_pixels(temp, src1, src2, stride);
-
- memcpy(bak, temp, 64*sizeof(DCTELEM));
-
- s->block_last_index[0/*FIXME*/]= s->fast_dct_quantize(s, temp, 0/*FIXME*/, s->qscale, &i);
- s->dct_unquantize_inter(s, temp, 0, s->qscale);
- simple_idct(temp); //FIXME
-
- for(i=0; i<64; i++)
- sum+= (temp[i]-bak[i])*(temp[i]-bak[i]);
-
- return sum;
-}
-
-static int rd8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){
- MpegEncContext * const s= (MpegEncContext *)c;
- const uint8_t *scantable= s->intra_scantable.permutated;
- DECLARE_ALIGNED_8 (uint64_t, aligned_temp[sizeof(DCTELEM)*64/8]);
- DECLARE_ALIGNED_8 (uint64_t, aligned_bak[stride]);
- DCTELEM * const temp= (DCTELEM*)aligned_temp;
- uint8_t * const bak= (uint8_t*)aligned_bak;
- int i, last, run, bits, level, distoration, start_i;
- const int esc_length= s->ac_esc_length;
- uint8_t * length;
- uint8_t * last_length;
-
- assert(h==8);
-
- for(i=0; i<8; i++){
- ((uint32_t*)(bak + i*stride))[0]= ((uint32_t*)(src2 + i*stride))[0];
- ((uint32_t*)(bak + i*stride))[1]= ((uint32_t*)(src2 + i*stride))[1];
- }
-
- s->dsp.diff_pixels(temp, src1, src2, stride);
-
- s->block_last_index[0/*FIXME*/]= last= s->fast_dct_quantize(s, temp, 0/*FIXME*/, s->qscale, &i);
-
- bits=0;
-
- if (s->mb_intra) {
- start_i = 1;
- length = s->intra_ac_vlc_length;
- last_length= s->intra_ac_vlc_last_length;
- bits+= s->luma_dc_vlc_length[temp[0] + 256]; //FIXME chroma
- } else {
- start_i = 0;
- length = s->inter_ac_vlc_length;
- last_length= s->inter_ac_vlc_last_length;
- }
-
- if(last>=start_i){
- run=0;
- for(i=start_i; i<last; i++){
- int j= scantable[i];
- level= temp[j];
-
- if(level){
- level+=64;
- if((level&(~127)) == 0){
- bits+= length[UNI_AC_ENC_INDEX(run, level)];
- }else
- bits+= esc_length;
- run=0;
- }else
- run++;
- }
- i= scantable[last];
-
- level= temp[i] + 64;
-
- assert(level - 64);
-
- if((level&(~127)) == 0){
- bits+= last_length[UNI_AC_ENC_INDEX(run, level)];
- }else
- bits+= esc_length;
-
- }
-
- if(last>=0){
- if(s->mb_intra)
- s->dct_unquantize_intra(s, temp, 0, s->qscale);
- else
- s->dct_unquantize_inter(s, temp, 0, s->qscale);
- }
-
- s->dsp.idct_add(bak, stride, temp);
-
- distoration= s->dsp.sse[1](NULL, bak, src1, stride, 8);
-
- return distoration + ((bits*s->qscale*s->qscale*109 + 64)>>7);
-}
-
-static int bit8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){
- MpegEncContext * const s= (MpegEncContext *)c;
- const uint8_t *scantable= s->intra_scantable.permutated;
- DECLARE_ALIGNED_8 (uint64_t, aligned_temp[sizeof(DCTELEM)*64/8]);
- DCTELEM * const temp= (DCTELEM*)aligned_temp;
- int i, last, run, bits, level, start_i;
- const int esc_length= s->ac_esc_length;
- uint8_t * length;
- uint8_t * last_length;
-
- assert(h==8);
-
- s->dsp.diff_pixels(temp, src1, src2, stride);
-
- s->block_last_index[0/*FIXME*/]= last= s->fast_dct_quantize(s, temp, 0/*FIXME*/, s->qscale, &i);
-
- bits=0;
-
- if (s->mb_intra) {
- start_i = 1;
- length = s->intra_ac_vlc_length;
- last_length= s->intra_ac_vlc_last_length;
- bits+= s->luma_dc_vlc_length[temp[0] + 256]; //FIXME chroma
- } else {
- start_i = 0;
- length = s->inter_ac_vlc_length;
- last_length= s->inter_ac_vlc_last_length;
- }
-
- if(last>=start_i){
- run=0;
- for(i=start_i; i<last; i++){
- int j= scantable[i];
- level= temp[j];
-
- if(level){
- level+=64;
- if((level&(~127)) == 0){
- bits+= length[UNI_AC_ENC_INDEX(run, level)];
- }else
- bits+= esc_length;
- run=0;
- }else
- run++;
- }
- i= scantable[last];
-
- level= temp[i] + 64;
-
- assert(level - 64);
-
- if((level&(~127)) == 0){
- bits+= last_length[UNI_AC_ENC_INDEX(run, level)];
- }else
- bits+= esc_length;
- }
-
- return bits;
-}
-
-static int vsad_intra16_c(/*MpegEncContext*/ void *c, uint8_t *s, uint8_t *dummy, int stride, int h){
- int score=0;
- int x,y;
-
- for(y=1; y<h; y++){
- for(x=0; x<16; x+=4){
- score+= FFABS(s[x ] - s[x +stride]) + FFABS(s[x+1] - s[x+1+stride])
- +FFABS(s[x+2] - s[x+2+stride]) + FFABS(s[x+3] - s[x+3+stride]);
- }
- s+= stride;
- }
-
- return score;
-}
-
-static int vsad16_c(/*MpegEncContext*/ void *c, uint8_t *s1, uint8_t *s2, int stride, int h){
- int score=0;
- int x,y;
-
- for(y=1; y<h; y++){
- for(x=0; x<16; x++){
- score+= FFABS(s1[x ] - s2[x ] - s1[x +stride] + s2[x +stride]);
- }
- s1+= stride;
- s2+= stride;
- }
-
- return score;
-}
-
-#define SQ(a) ((a)*(a))
-static int vsse_intra16_c(/*MpegEncContext*/ void *c, uint8_t *s, uint8_t *dummy, int stride, int h){
- int score=0;
- int x,y;
-
- for(y=1; y<h; y++){
- for(x=0; x<16; x+=4){
- score+= SQ(s[x ] - s[x +stride]) + SQ(s[x+1] - s[x+1+stride])
- +SQ(s[x+2] - s[x+2+stride]) + SQ(s[x+3] - s[x+3+stride]);
- }
- s+= stride;
- }
-
- return score;
-}
-
-static int vsse16_c(/*MpegEncContext*/ void *c, uint8_t *s1, uint8_t *s2, int stride, int h){
- int score=0;
- int x,y;
-
- for(y=1; y<h; y++){
- for(x=0; x<16; x++){
- score+= SQ(s1[x ] - s2[x ] - s1[x +stride] + s2[x +stride]);
- }
- s1+= stride;
- s2+= stride;
- }
-
- return score;
-}
-
-WARPER8_16_SQ(hadamard8_diff8x8_c, hadamard8_diff16_c)
-WARPER8_16_SQ(hadamard8_intra8x8_c, hadamard8_intra16_c)
-WARPER8_16_SQ(dct_sad8x8_c, dct_sad16_c)
-#ifdef CONFIG_GPL
-WARPER8_16_SQ(dct264_sad8x8_c, dct264_sad16_c)
-#endif
-WARPER8_16_SQ(dct_max8x8_c, dct_max16_c)
-WARPER8_16_SQ(quant_psnr8x8_c, quant_psnr16_c)
-WARPER8_16_SQ(rd8x8_c, rd16_c)
-WARPER8_16_SQ(bit8x8_c, bit16_c)
-
-static void vector_fmul_c(float *dst, const float *src, int len){
- int i;
- for(i=0; i<len; i++)
- dst[i] *= src[i];
-}
-
-static void vector_fmul_reverse_c(float *dst, const float *src0, const float *src1, int len){
- int i;
- src1 += len-1;
- for(i=0; i<len; i++)
- dst[i] = src0[i] * src1[-i];
-}
-
-void ff_vector_fmul_add_add_c(float *dst, const float *src0, const float *src1, const float *src2, int src3, int len, int step){
- int i;
- for(i=0; i<len; i++)
- dst[i*step] = src0[i] * src1[i] + src2[i] + src3;
-}
-
-void ff_float_to_int16_c(int16_t *dst, const float *src, int len){
- int i;
- for(i=0; i<len; i++) {
- int_fast32_t tmp = ((int32_t*)src)[i];
- if(tmp & 0xf0000){
- tmp = (0x43c0ffff - tmp)>>31;
- // is this faster on some gcc/cpu combinations?
-// if(tmp > 0x43c0ffff) tmp = 0xFFFF;
-// else tmp = 0;
- }
- dst[i] = tmp - 0x8000;
- }
-}
-
-/* XXX: those functions should be suppressed ASAP when all IDCTs are
- converted */
-static void ff_jref_idct_put(uint8_t *dest, int line_size, DCTELEM *block)
-{
- j_rev_dct (block);
- put_pixels_clamped_c(block, dest, line_size);
-}
-static void ff_jref_idct_add(uint8_t *dest, int line_size, DCTELEM *block)
-{
- j_rev_dct (block);
- add_pixels_clamped_c(block, dest, line_size);
-}
-
-static void ff_jref_idct4_put(uint8_t *dest, int line_size, DCTELEM *block)
-{
- j_rev_dct4 (block);
- put_pixels_clamped4_c(block, dest, line_size);
-}
-static void ff_jref_idct4_add(uint8_t *dest, int line_size, DCTELEM *block)
-{
- j_rev_dct4 (block);
- add_pixels_clamped4_c(block, dest, line_size);
-}
-
-static void ff_jref_idct2_put(uint8_t *dest, int line_size, DCTELEM *block)
-{
- j_rev_dct2 (block);
- put_pixels_clamped2_c(block, dest, line_size);
-}
-static void ff_jref_idct2_add(uint8_t *dest, int line_size, DCTELEM *block)
-{
- j_rev_dct2 (block);
- add_pixels_clamped2_c(block, dest, line_size);
-}
-
-static void ff_jref_idct1_put(uint8_t *dest, int line_size, DCTELEM *block)
-{
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-
- dest[0] = cm[(block[0] + 4)>>3];
-}
-static void ff_jref_idct1_add(uint8_t *dest, int line_size, DCTELEM *block)
-{
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-
- dest[0] = cm[dest[0] + ((block[0] + 4)>>3)];
-}
-
-static void just_return() { return; }
-
-/* init static data */
-void dsputil_static_init(void)
-{
- int i;
-
- for(i=0;i<256;i++) ff_cropTbl[i + MAX_NEG_CROP] = i;
- for(i=0;i<MAX_NEG_CROP;i++) {
- ff_cropTbl[i] = 0;
- ff_cropTbl[i + MAX_NEG_CROP + 256] = 255;
- }
-
- for(i=0;i<512;i++) {
- ff_squareTbl[i] = (i - 256) * (i - 256);
- }
-
- for(i=0; i<64; i++) inv_zigzag_direct16[ff_zigzag_direct[i]]= i+1;
-}
-
-int ff_check_alignment(void){
- static int did_fail=0;
- DECLARE_ALIGNED_16(int, aligned);
-
- if((int)&aligned & 15){
- if(!did_fail){
-#if defined(HAVE_MMX) || defined(HAVE_ALTIVEC)
- av_log(NULL, AV_LOG_ERROR,
- "Compiler did not align stack variables. Libavcodec has been miscompiled\n"
- "and may be very slow or crash. This is not a bug in libavcodec,\n"
- "but in the compiler. Do not report crashes to FFmpeg developers.\n");
-#endif
- did_fail=1;
- }
- return -1;
- }
- return 0;
-}
-
-void dsputil_init(DSPContext* c, AVCodecContext *avctx)
-{
- int i;
-
- ff_check_alignment();
-
-#ifdef CONFIG_ENCODERS
- if(avctx->dct_algo==FF_DCT_FASTINT) {
- c->fdct = fdct_ifast;
- c->fdct248 = fdct_ifast248;
- }
- else if(avctx->dct_algo==FF_DCT_FAAN) {
- c->fdct = ff_faandct;
- c->fdct248 = ff_faandct248;
- }
- else {
- c->fdct = ff_jpeg_fdct_islow; //slow/accurate/default
- c->fdct248 = ff_fdct248_islow;
- }
-#endif //CONFIG_ENCODERS
-
- if(avctx->lowres==1){
- if(avctx->idct_algo==FF_IDCT_INT || avctx->idct_algo==FF_IDCT_AUTO){
- c->idct_put= ff_jref_idct4_put;
- c->idct_add= ff_jref_idct4_add;
- }else{
- c->idct_put= ff_h264_lowres_idct_put_c;
- c->idct_add= ff_h264_lowres_idct_add_c;
- }
- c->idct = j_rev_dct4;
- c->idct_permutation_type= FF_NO_IDCT_PERM;
- }else if(avctx->lowres==2){
- c->idct_put= ff_jref_idct2_put;
- c->idct_add= ff_jref_idct2_add;
- c->idct = j_rev_dct2;
- c->idct_permutation_type= FF_NO_IDCT_PERM;
- }else if(avctx->lowres==3){
- c->idct_put= ff_jref_idct1_put;
- c->idct_add= ff_jref_idct1_add;
- c->idct = j_rev_dct1;
- c->idct_permutation_type= FF_NO_IDCT_PERM;
- }else{
- if(avctx->idct_algo==FF_IDCT_INT){
- c->idct_put= ff_jref_idct_put;
- c->idct_add= ff_jref_idct_add;
- c->idct = j_rev_dct;
- c->idct_permutation_type= FF_LIBMPEG2_IDCT_PERM;
- }else if(avctx->idct_algo==FF_IDCT_VP3){
- c->idct_put= ff_vp3_idct_put_c;
- c->idct_add= ff_vp3_idct_add_c;
- c->idct = ff_vp3_idct_c;
- c->idct_permutation_type= FF_NO_IDCT_PERM;
- }else{ //accurate/default
- c->idct_put= simple_idct_put;
- c->idct_add= simple_idct_add;
- c->idct = simple_idct;
- c->idct_permutation_type= FF_NO_IDCT_PERM;
- }
- }
-
- c->h264_idct_add= ff_h264_idct_add_c;
- c->h264_idct8_add= ff_h264_idct8_add_c;
- c->h264_idct_dc_add= ff_h264_idct_dc_add_c;
- c->h264_idct8_dc_add= ff_h264_idct8_dc_add_c;
-
- c->get_pixels = get_pixels_c;
- c->diff_pixels = diff_pixels_c;
- c->put_pixels_clamped = put_pixels_clamped_c;
- c->put_signed_pixels_clamped = put_signed_pixels_clamped_c;
- c->add_pixels_clamped = add_pixels_clamped_c;
- c->add_pixels8 = add_pixels8_c;
- c->add_pixels4 = add_pixels4_c;
- c->gmc1 = gmc1_c;
- c->gmc = ff_gmc_c;
- c->clear_blocks = clear_blocks_c;
- c->pix_sum = pix_sum_c;
- c->pix_norm1 = pix_norm1_c;
-
- /* TODO [0] 16 [1] 8 */
- c->pix_abs[0][0] = pix_abs16_c;
- c->pix_abs[0][1] = pix_abs16_x2_c;
- c->pix_abs[0][2] = pix_abs16_y2_c;
- c->pix_abs[0][3] = pix_abs16_xy2_c;
- c->pix_abs[1][0] = pix_abs8_c;
- c->pix_abs[1][1] = pix_abs8_x2_c;
- c->pix_abs[1][2] = pix_abs8_y2_c;
- c->pix_abs[1][3] = pix_abs8_xy2_c;
-
-#define dspfunc(PFX, IDX, NUM) \
- c->PFX ## _pixels_tab[IDX][0] = PFX ## _pixels ## NUM ## _c; \
- c->PFX ## _pixels_tab[IDX][1] = PFX ## _pixels ## NUM ## _x2_c; \
- c->PFX ## _pixels_tab[IDX][2] = PFX ## _pixels ## NUM ## _y2_c; \
- c->PFX ## _pixels_tab[IDX][3] = PFX ## _pixels ## NUM ## _xy2_c
-
- dspfunc(put, 0, 16);
- dspfunc(put_no_rnd, 0, 16);
- dspfunc(put, 1, 8);
- dspfunc(put_no_rnd, 1, 8);
- dspfunc(put, 2, 4);
- dspfunc(put, 3, 2);
-
- dspfunc(avg, 0, 16);
- dspfunc(avg_no_rnd, 0, 16);
- dspfunc(avg, 1, 8);
- dspfunc(avg_no_rnd, 1, 8);
- dspfunc(avg, 2, 4);
- dspfunc(avg, 3, 2);
-#undef dspfunc
-
- c->put_no_rnd_pixels_l2[0]= put_no_rnd_pixels16_l2_c;
- c->put_no_rnd_pixels_l2[1]= put_no_rnd_pixels8_l2_c;
-
- c->put_tpel_pixels_tab[ 0] = put_tpel_pixels_mc00_c;
- c->put_tpel_pixels_tab[ 1] = put_tpel_pixels_mc10_c;
- c->put_tpel_pixels_tab[ 2] = put_tpel_pixels_mc20_c;
- c->put_tpel_pixels_tab[ 4] = put_tpel_pixels_mc01_c;
- c->put_tpel_pixels_tab[ 5] = put_tpel_pixels_mc11_c;
- c->put_tpel_pixels_tab[ 6] = put_tpel_pixels_mc21_c;
- c->put_tpel_pixels_tab[ 8] = put_tpel_pixels_mc02_c;
- c->put_tpel_pixels_tab[ 9] = put_tpel_pixels_mc12_c;
- c->put_tpel_pixels_tab[10] = put_tpel_pixels_mc22_c;
-
- c->avg_tpel_pixels_tab[ 0] = avg_tpel_pixels_mc00_c;
- c->avg_tpel_pixels_tab[ 1] = avg_tpel_pixels_mc10_c;
- c->avg_tpel_pixels_tab[ 2] = avg_tpel_pixels_mc20_c;
- c->avg_tpel_pixels_tab[ 4] = avg_tpel_pixels_mc01_c;
- c->avg_tpel_pixels_tab[ 5] = avg_tpel_pixels_mc11_c;
- c->avg_tpel_pixels_tab[ 6] = avg_tpel_pixels_mc21_c;
- c->avg_tpel_pixels_tab[ 8] = avg_tpel_pixels_mc02_c;
- c->avg_tpel_pixels_tab[ 9] = avg_tpel_pixels_mc12_c;
- c->avg_tpel_pixels_tab[10] = avg_tpel_pixels_mc22_c;
-
-#define dspfunc(PFX, IDX, NUM) \
- c->PFX ## _pixels_tab[IDX][ 0] = PFX ## NUM ## _mc00_c; \
- c->PFX ## _pixels_tab[IDX][ 1] = PFX ## NUM ## _mc10_c; \
- c->PFX ## _pixels_tab[IDX][ 2] = PFX ## NUM ## _mc20_c; \
- c->PFX ## _pixels_tab[IDX][ 3] = PFX ## NUM ## _mc30_c; \
- c->PFX ## _pixels_tab[IDX][ 4] = PFX ## NUM ## _mc01_c; \
- c->PFX ## _pixels_tab[IDX][ 5] = PFX ## NUM ## _mc11_c; \
- c->PFX ## _pixels_tab[IDX][ 6] = PFX ## NUM ## _mc21_c; \
- c->PFX ## _pixels_tab[IDX][ 7] = PFX ## NUM ## _mc31_c; \
- c->PFX ## _pixels_tab[IDX][ 8] = PFX ## NUM ## _mc02_c; \
- c->PFX ## _pixels_tab[IDX][ 9] = PFX ## NUM ## _mc12_c; \
- c->PFX ## _pixels_tab[IDX][10] = PFX ## NUM ## _mc22_c; \
- c->PFX ## _pixels_tab[IDX][11] = PFX ## NUM ## _mc32_c; \
- c->PFX ## _pixels_tab[IDX][12] = PFX ## NUM ## _mc03_c; \
- c->PFX ## _pixels_tab[IDX][13] = PFX ## NUM ## _mc13_c; \
- c->PFX ## _pixels_tab[IDX][14] = PFX ## NUM ## _mc23_c; \
- c->PFX ## _pixels_tab[IDX][15] = PFX ## NUM ## _mc33_c
-
- dspfunc(put_qpel, 0, 16);
- dspfunc(put_no_rnd_qpel, 0, 16);
-
- dspfunc(avg_qpel, 0, 16);
- /* dspfunc(avg_no_rnd_qpel, 0, 16); */
-
- dspfunc(put_qpel, 1, 8);
- dspfunc(put_no_rnd_qpel, 1, 8);
-
- dspfunc(avg_qpel, 1, 8);
- /* dspfunc(avg_no_rnd_qpel, 1, 8); */
-
- dspfunc(put_h264_qpel, 0, 16);
- dspfunc(put_h264_qpel, 1, 8);
- dspfunc(put_h264_qpel, 2, 4);
- dspfunc(put_h264_qpel, 3, 2);
- dspfunc(avg_h264_qpel, 0, 16);
- dspfunc(avg_h264_qpel, 1, 8);
- dspfunc(avg_h264_qpel, 2, 4);
-
-#undef dspfunc
- c->put_h264_chroma_pixels_tab[0]= put_h264_chroma_mc8_c;
- c->put_h264_chroma_pixels_tab[1]= put_h264_chroma_mc4_c;
- c->put_h264_chroma_pixels_tab[2]= put_h264_chroma_mc2_c;
- c->avg_h264_chroma_pixels_tab[0]= avg_h264_chroma_mc8_c;
- c->avg_h264_chroma_pixels_tab[1]= avg_h264_chroma_mc4_c;
- c->avg_h264_chroma_pixels_tab[2]= avg_h264_chroma_mc2_c;
- c->put_no_rnd_h264_chroma_pixels_tab[0]= put_no_rnd_h264_chroma_mc8_c;
-
- c->weight_h264_pixels_tab[0]= weight_h264_pixels16x16_c;
- c->weight_h264_pixels_tab[1]= weight_h264_pixels16x8_c;
- c->weight_h264_pixels_tab[2]= weight_h264_pixels8x16_c;
- c->weight_h264_pixels_tab[3]= weight_h264_pixels8x8_c;
- c->weight_h264_pixels_tab[4]= weight_h264_pixels8x4_c;
- c->weight_h264_pixels_tab[5]= weight_h264_pixels4x8_c;
- c->weight_h264_pixels_tab[6]= weight_h264_pixels4x4_c;
- c->weight_h264_pixels_tab[7]= weight_h264_pixels4x2_c;
- c->weight_h264_pixels_tab[8]= weight_h264_pixels2x4_c;
- c->weight_h264_pixels_tab[9]= weight_h264_pixels2x2_c;
- c->biweight_h264_pixels_tab[0]= biweight_h264_pixels16x16_c;
- c->biweight_h264_pixels_tab[1]= biweight_h264_pixels16x8_c;
- c->biweight_h264_pixels_tab[2]= biweight_h264_pixels8x16_c;
- c->biweight_h264_pixels_tab[3]= biweight_h264_pixels8x8_c;
- c->biweight_h264_pixels_tab[4]= biweight_h264_pixels8x4_c;
- c->biweight_h264_pixels_tab[5]= biweight_h264_pixels4x8_c;
- c->biweight_h264_pixels_tab[6]= biweight_h264_pixels4x4_c;
- c->biweight_h264_pixels_tab[7]= biweight_h264_pixels4x2_c;
- c->biweight_h264_pixels_tab[8]= biweight_h264_pixels2x4_c;
- c->biweight_h264_pixels_tab[9]= biweight_h264_pixels2x2_c;
-
-#ifdef CONFIG_CAVS_DECODER
- ff_cavsdsp_init(c,avctx);
-#endif
-#if defined(CONFIG_VC1_DECODER) || defined(CONFIG_WMV3_DECODER)
- ff_vc1dsp_init(c,avctx);
-#endif
-#if defined(CONFIG_H264_ENCODER)
- ff_h264dsp_init(c,avctx);
-#endif
-
- c->put_mspel_pixels_tab[0]= put_mspel8_mc00_c;
- c->put_mspel_pixels_tab[1]= put_mspel8_mc10_c;
- c->put_mspel_pixels_tab[2]= put_mspel8_mc20_c;
- c->put_mspel_pixels_tab[3]= put_mspel8_mc30_c;
- c->put_mspel_pixels_tab[4]= put_mspel8_mc02_c;
- c->put_mspel_pixels_tab[5]= put_mspel8_mc12_c;
- c->put_mspel_pixels_tab[6]= put_mspel8_mc22_c;
- c->put_mspel_pixels_tab[7]= put_mspel8_mc32_c;
-
-#define SET_CMP_FUNC(name) \
- c->name[0]= name ## 16_c;\
- c->name[1]= name ## 8x8_c;
-
- SET_CMP_FUNC(hadamard8_diff)
- c->hadamard8_diff[4]= hadamard8_intra16_c;
- SET_CMP_FUNC(dct_sad)
- SET_CMP_FUNC(dct_max)
-#ifdef CONFIG_GPL
- SET_CMP_FUNC(dct264_sad)
-#endif
- c->sad[0]= pix_abs16_c;
- c->sad[1]= pix_abs8_c;
- c->sse[0]= sse16_c;
- c->sse[1]= sse8_c;
- c->sse[2]= sse4_c;
- SET_CMP_FUNC(quant_psnr)
- SET_CMP_FUNC(rd)
- SET_CMP_FUNC(bit)
- c->vsad[0]= vsad16_c;
- c->vsad[4]= vsad_intra16_c;
- c->vsse[0]= vsse16_c;
- c->vsse[4]= vsse_intra16_c;
- c->nsse[0]= nsse16_c;
- c->nsse[1]= nsse8_c;
-#ifdef CONFIG_SNOW_ENCODER
- c->w53[0]= w53_16_c;
- c->w53[1]= w53_8_c;
- c->w97[0]= w97_16_c;
- c->w97[1]= w97_8_c;
-#endif
-
- c->add_bytes= add_bytes_c;
- c->diff_bytes= diff_bytes_c;
- c->sub_hfyu_median_prediction= sub_hfyu_median_prediction_c;
- c->bswap_buf= bswap_buf;
-
- c->h264_v_loop_filter_luma= h264_v_loop_filter_luma_c;
- c->h264_h_loop_filter_luma= h264_h_loop_filter_luma_c;
- c->h264_v_loop_filter_chroma= h264_v_loop_filter_chroma_c;
- c->h264_h_loop_filter_chroma= h264_h_loop_filter_chroma_c;
- c->h264_v_loop_filter_chroma_intra= h264_v_loop_filter_chroma_intra_c;
- c->h264_h_loop_filter_chroma_intra= h264_h_loop_filter_chroma_intra_c;
- c->h264_loop_filter_strength= NULL;
-
- c->h263_h_loop_filter= h263_h_loop_filter_c;
- c->h263_v_loop_filter= h263_v_loop_filter_c;
-
- c->h261_loop_filter= h261_loop_filter_c;
-
- c->try_8x8basis= try_8x8basis_c;
- c->add_8x8basis= add_8x8basis_c;
-
-#ifdef CONFIG_SNOW_ENCODER
- c->vertical_compose97i = ff_snow_vertical_compose97i;
- c->horizontal_compose97i = ff_snow_horizontal_compose97i;
- c->inner_add_yblock = ff_snow_inner_add_yblock;
-#endif
-
-#ifdef CONFIG_VORBIS_DECODER
- c->vorbis_inverse_coupling = vorbis_inverse_coupling;
-#endif
- c->vector_fmul = vector_fmul_c;
- c->vector_fmul_reverse = vector_fmul_reverse_c;
- c->vector_fmul_add_add = ff_vector_fmul_add_add_c;
- c->float_to_int16 = ff_float_to_int16_c;
-
- c->shrink[0]= ff_img_copy_plane;
- c->shrink[1]= ff_shrink22;
- c->shrink[2]= ff_shrink44;
- c->shrink[3]= ff_shrink88;
-
- c->prefetch= just_return;
-
- memset(c->put_2tap_qpel_pixels_tab, 0, sizeof(c->put_2tap_qpel_pixels_tab));
- memset(c->avg_2tap_qpel_pixels_tab, 0, sizeof(c->avg_2tap_qpel_pixels_tab));
-
-#if defined(HAVE_MMX)
- dsputil_init_mmx(c, avctx);
-#elif defined(ARCH_ARMV4L)
- dsputil_init_armv4l(c, avctx);
-#elif defined(HAVE_MLIB)
- dsputil_init_mlib(c, avctx);
-#elif defined(ARCH_SPARC)
- dsputil_init_vis(c,avctx);
-#elif defined(ARCH_ALPHA)
- dsputil_init_alpha(c, avctx);
-#elif defined(ARCH_POWERPC)
- dsputil_init_ppc(c, avctx);
-#elif defined(HAVE_MMI)
- dsputil_init_mmi(c, avctx);
-#elif defined(ARCH_SH4)
- dsputil_init_sh4(c,avctx);
-#elif defined(ARCH_BFIN)
- dsputil_init_bfin(c,avctx);
-#endif
-
- for(i=0; i<64; i++){
- if(!c->put_2tap_qpel_pixels_tab[0][i])
- c->put_2tap_qpel_pixels_tab[0][i]= c->put_h264_qpel_pixels_tab[0][i];
- if(!c->avg_2tap_qpel_pixels_tab[0][i])
- c->avg_2tap_qpel_pixels_tab[0][i]= c->avg_h264_qpel_pixels_tab[0][i];
- }
-
- switch(c->idct_permutation_type){
- case FF_NO_IDCT_PERM:
- for(i=0; i<64; i++)
- c->idct_permutation[i]= i;
- break;
- case FF_LIBMPEG2_IDCT_PERM:
- for(i=0; i<64; i++)
- c->idct_permutation[i]= (i & 0x38) | ((i & 6) >> 1) | ((i & 1) << 2);
- break;
- case FF_SIMPLE_IDCT_PERM:
- for(i=0; i<64; i++)
- c->idct_permutation[i]= simple_mmx_permutation[i];
- break;
- case FF_TRANSPOSE_IDCT_PERM:
- for(i=0; i<64; i++)
- c->idct_permutation[i]= ((i&7)<<3) | (i>>3);
- break;
- case FF_PARTTRANS_IDCT_PERM:
- for(i=0; i<64; i++)
- c->idct_permutation[i]= (i&0x24) | ((i&3)<<3) | ((i>>3)&3);
- break;
- default:
- av_log(avctx, AV_LOG_ERROR, "Internal error, IDCT permutation not set\n");
- }
-}
-
diff --git a/src/libffmpeg/libavcodec/dsputil.h b/src/libffmpeg/libavcodec/dsputil.h
deleted file mode 100644
index 78109f7b9..000000000
--- a/src/libffmpeg/libavcodec/dsputil.h
+++ /dev/null
@@ -1,759 +0,0 @@
-/*
- * DSP utils
- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard.
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file dsputil.h
- * DSP utils.
- * note, many functions in here may use MMX which trashes the FPU state, it is
- * absolutely necessary to call emms_c() between dsp & float/double code
- */
-
-#ifndef DSPUTIL_H
-#define DSPUTIL_H
-
-#include "common.h"
-#include "avcodec.h"
-
-
-//#define DEBUG
-/* dct code */
-typedef short DCTELEM;
-typedef int DWTELEM;
-
-void fdct_ifast (DCTELEM *data);
-void fdct_ifast248 (DCTELEM *data);
-void ff_jpeg_fdct_islow (DCTELEM *data);
-void ff_fdct248_islow (DCTELEM *data);
-
-void j_rev_dct (DCTELEM *data);
-void j_rev_dct4 (DCTELEM *data);
-void j_rev_dct2 (DCTELEM *data);
-void j_rev_dct1 (DCTELEM *data);
-
-void ff_fdct_mmx(DCTELEM *block);
-void ff_fdct_mmx2(DCTELEM *block);
-void ff_fdct_sse2(DCTELEM *block);
-
-void ff_h264_idct8_add_c(uint8_t *dst, DCTELEM *block, int stride);
-void ff_h264_idct_add_c(uint8_t *dst, DCTELEM *block, int stride);
-void ff_h264_idct8_dc_add_c(uint8_t *dst, DCTELEM *block, int stride);
-void ff_h264_idct_dc_add_c(uint8_t *dst, DCTELEM *block, int stride);
-void ff_h264_lowres_idct_add_c(uint8_t *dst, int stride, DCTELEM *block);
-void ff_h264_lowres_idct_put_c(uint8_t *dst, int stride, DCTELEM *block);
-
-void ff_vector_fmul_add_add_c(float *dst, const float *src0, const float *src1,
- const float *src2, int src3, int blocksize, int step);
-void ff_float_to_int16_c(int16_t *dst, const float *src, int len);
-
-/* encoding scans */
-extern const uint8_t ff_alternate_horizontal_scan[64];
-extern const uint8_t ff_alternate_vertical_scan[64];
-extern const uint8_t ff_zigzag_direct[64];
-extern const uint8_t ff_zigzag248_direct[64];
-
-/* pixel operations */
-#define MAX_NEG_CROP 1024
-
-/* temporary */
-extern uint32_t ff_squareTbl[512];
-extern uint8_t ff_cropTbl[256 + 2 * MAX_NEG_CROP];
-
-/* VP3 DSP functions */
-void ff_vp3_idct_c(DCTELEM *block/* align 16*/);
-void ff_vp3_idct_put_c(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/);
-void ff_vp3_idct_add_c(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/);
-
-/* 1/2^n downscaling functions from imgconvert.c */
-void ff_img_copy_plane(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
-void ff_shrink22(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
-void ff_shrink44(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
-void ff_shrink88(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
-
-void ff_gmc_c(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy,
- int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height);
-
-/* minimum alignment rules ;)
-if u notice errors in the align stuff, need more alignment for some asm code for some cpu
-or need to use a function with less aligned data then send a mail to the ffmpeg-dev list, ...
-
-!warning these alignments might not match reallity, (missing attribute((align)) stuff somewhere possible)
-i (michael) didnt check them, these are just the alignents which i think could be reached easily ...
-
-!future video codecs might need functions with less strict alignment
-*/
-
-/*
-void get_pixels_c(DCTELEM *block, const uint8_t *pixels, int line_size);
-void diff_pixels_c(DCTELEM *block, const uint8_t *s1, const uint8_t *s2, int stride);
-void put_pixels_clamped_c(const DCTELEM *block, uint8_t *pixels, int line_size);
-void add_pixels_clamped_c(const DCTELEM *block, uint8_t *pixels, int line_size);
-void clear_blocks_c(DCTELEM *blocks);
-*/
-
-/* add and put pixel (decoding) */
-// blocksizes for op_pixels_func are 8x4,8x8 16x8 16x16
-//h for op_pixels_func is limited to {width/2, width} but never larger than 16 and never smaller then 4
-typedef void (*op_pixels_func)(uint8_t *block/*align width (8 or 16)*/, const uint8_t *pixels/*align 1*/, int line_size, int h);
-typedef void (*tpel_mc_func)(uint8_t *block/*align width (8 or 16)*/, const uint8_t *pixels/*align 1*/, int line_size, int w, int h);
-typedef void (*qpel_mc_func)(uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, int stride);
-typedef void (*h264_chroma_mc_func)(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int srcStride, int h, int x, int y);
-typedef void (*h264_weight_func)(uint8_t *block, int stride, int log2_denom, int weight, int offset);
-typedef void (*h264_biweight_func)(uint8_t *dst, uint8_t *src, int stride, int log2_denom, int weightd, int weights, int offset);
-
-#define DEF_OLD_QPEL(name)\
-void ff_put_ ## name (uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, int stride);\
-void ff_put_no_rnd_ ## name (uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, int stride);\
-void ff_avg_ ## name (uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, int stride);
-
-DEF_OLD_QPEL(qpel16_mc11_old_c)
-DEF_OLD_QPEL(qpel16_mc31_old_c)
-DEF_OLD_QPEL(qpel16_mc12_old_c)
-DEF_OLD_QPEL(qpel16_mc32_old_c)
-DEF_OLD_QPEL(qpel16_mc13_old_c)
-DEF_OLD_QPEL(qpel16_mc33_old_c)
-DEF_OLD_QPEL(qpel8_mc11_old_c)
-DEF_OLD_QPEL(qpel8_mc31_old_c)
-DEF_OLD_QPEL(qpel8_mc12_old_c)
-DEF_OLD_QPEL(qpel8_mc32_old_c)
-DEF_OLD_QPEL(qpel8_mc13_old_c)
-DEF_OLD_QPEL(qpel8_mc33_old_c)
-
-#define CALL_2X_PIXELS(a, b, n)\
-static void a(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
- b(block , pixels , line_size, h);\
- b(block+n, pixels+n, line_size, h);\
-}
-
-/* motion estimation */
-// h is limited to {width/2, width, 2*width} but never larger than 16 and never smaller then 2
-// allthough currently h<4 is not used as functions with width <8 are not used and neither implemented
-typedef int (*me_cmp_func)(void /*MpegEncContext*/ *s, uint8_t *blk1/*align width (8 or 16)*/, uint8_t *blk2/*align 1*/, int line_size, int h)/* __attribute__ ((const))*/;
-
-
-// for snow slices
-typedef struct slice_buffer_s slice_buffer;
-
-/**
- * DSPContext.
- */
-typedef struct DSPContext {
- /* pixel ops : interface with DCT */
- void (*get_pixels)(DCTELEM *block/*align 16*/, const uint8_t *pixels/*align 8*/, int line_size);
- void (*diff_pixels)(DCTELEM *block/*align 16*/, const uint8_t *s1/*align 8*/, const uint8_t *s2/*align 8*/, int stride);
- void (*put_pixels_clamped)(const DCTELEM *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size);
- void (*put_signed_pixels_clamped)(const DCTELEM *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size);
- void (*add_pixels_clamped)(const DCTELEM *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size);
- void (*add_pixels8)(uint8_t *pixels, DCTELEM *block, int line_size);
- void (*add_pixels4)(uint8_t *pixels, DCTELEM *block, int line_size);
- /**
- * translational global motion compensation.
- */
- void (*gmc1)(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int srcStride, int h, int x16, int y16, int rounder);
- /**
- * global motion compensation.
- */
- void (*gmc )(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int ox, int oy,
- int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height);
- void (*clear_blocks)(DCTELEM *blocks/*align 16*/);
- int (*pix_sum)(uint8_t * pix, int line_size);
- int (*pix_norm1)(uint8_t * pix, int line_size);
-// 16x16 8x8 4x4 2x2 16x8 8x4 4x2 8x16 4x8 2x4
-
- me_cmp_func sad[5]; /* identical to pix_absAxA except additional void * */
- me_cmp_func sse[5];
- me_cmp_func hadamard8_diff[5];
- me_cmp_func dct_sad[5];
- me_cmp_func quant_psnr[5];
- me_cmp_func bit[5];
- me_cmp_func rd[5];
- me_cmp_func vsad[5];
- me_cmp_func vsse[5];
- me_cmp_func nsse[5];
- me_cmp_func w53[5];
- me_cmp_func w97[5];
- me_cmp_func dct_max[5];
- me_cmp_func dct264_sad[5];
-
- me_cmp_func me_pre_cmp[5];
- me_cmp_func me_cmp[5];
- me_cmp_func me_sub_cmp[5];
- me_cmp_func mb_cmp[5];
- me_cmp_func ildct_cmp[5]; //only width 16 used
- me_cmp_func frame_skip_cmp[5]; //only width 8 used
-
- /**
- * Halfpel motion compensation with rounding (a+b+1)>>1.
- * this is an array[4][4] of motion compensation funcions for 4
- * horizontal blocksizes (8,16) and the 4 halfpel positions<br>
- * *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ]
- * @param block destination where the result is stored
- * @param pixels source
- * @param line_size number of bytes in a horizontal line of block
- * @param h height
- */
- op_pixels_func put_pixels_tab[4][4];
-
- /**
- * Halfpel motion compensation with rounding (a+b+1)>>1.
- * This is an array[4][4] of motion compensation functions for 4
- * horizontal blocksizes (8,16) and the 4 halfpel positions<br>
- * *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ]
- * @param block destination into which the result is averaged (a+b+1)>>1
- * @param pixels source
- * @param line_size number of bytes in a horizontal line of block
- * @param h height
- */
- op_pixels_func avg_pixels_tab[4][4];
-
- /**
- * Halfpel motion compensation with no rounding (a+b)>>1.
- * this is an array[2][4] of motion compensation funcions for 2
- * horizontal blocksizes (8,16) and the 4 halfpel positions<br>
- * *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ]
- * @param block destination where the result is stored
- * @param pixels source
- * @param line_size number of bytes in a horizontal line of block
- * @param h height
- */
- op_pixels_func put_no_rnd_pixels_tab[4][4];
-
- /**
- * Halfpel motion compensation with no rounding (a+b)>>1.
- * this is an array[2][4] of motion compensation funcions for 2
- * horizontal blocksizes (8,16) and the 4 halfpel positions<br>
- * *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ]
- * @param block destination into which the result is averaged (a+b)>>1
- * @param pixels source
- * @param line_size number of bytes in a horizontal line of block
- * @param h height
- */
- op_pixels_func avg_no_rnd_pixels_tab[4][4];
-
- void (*put_no_rnd_pixels_l2[2])(uint8_t *block/*align width (8 or 16)*/, const uint8_t *a/*align 1*/, const uint8_t *b/*align 1*/, int line_size, int h);
-
- /**
- * Thirdpel motion compensation with rounding (a+b+1)>>1.
- * this is an array[12] of motion compensation funcions for the 9 thirdpel positions<br>
- * *pixels_tab[ xthirdpel + 4*ythirdpel ]
- * @param block destination where the result is stored
- * @param pixels source
- * @param line_size number of bytes in a horizontal line of block
- * @param h height
- */
- tpel_mc_func put_tpel_pixels_tab[11]; //FIXME individual func ptr per width?
- tpel_mc_func avg_tpel_pixels_tab[11]; //FIXME individual func ptr per width?
-
- qpel_mc_func put_qpel_pixels_tab[2][16];
- qpel_mc_func avg_qpel_pixels_tab[2][16];
- qpel_mc_func put_no_rnd_qpel_pixels_tab[2][16];
- qpel_mc_func avg_no_rnd_qpel_pixels_tab[2][16];
- qpel_mc_func put_mspel_pixels_tab[8];
-
- /**
- * h264 Chram MC
- */
- h264_chroma_mc_func put_h264_chroma_pixels_tab[3];
- /* This is really one func used in VC-1 decoding */
- h264_chroma_mc_func put_no_rnd_h264_chroma_pixels_tab[3];
- h264_chroma_mc_func avg_h264_chroma_pixels_tab[3];
-
- qpel_mc_func put_h264_qpel_pixels_tab[4][16];
- qpel_mc_func avg_h264_qpel_pixels_tab[4][16];
-
- qpel_mc_func put_2tap_qpel_pixels_tab[4][16];
- qpel_mc_func avg_2tap_qpel_pixels_tab[4][16];
-
- h264_weight_func weight_h264_pixels_tab[10];
- h264_biweight_func biweight_h264_pixels_tab[10];
-
- /* AVS specific */
- qpel_mc_func put_cavs_qpel_pixels_tab[2][16];
- qpel_mc_func avg_cavs_qpel_pixels_tab[2][16];
- void (*cavs_filter_lv)(uint8_t *pix, int stride, int alpha, int beta, int tc, int bs1, int bs2);
- void (*cavs_filter_lh)(uint8_t *pix, int stride, int alpha, int beta, int tc, int bs1, int bs2);
- void (*cavs_filter_cv)(uint8_t *pix, int stride, int alpha, int beta, int tc, int bs1, int bs2);
- void (*cavs_filter_ch)(uint8_t *pix, int stride, int alpha, int beta, int tc, int bs1, int bs2);
- void (*cavs_idct8_add)(uint8_t *dst, DCTELEM *block, int stride);
-
- me_cmp_func pix_abs[2][4];
-
- /* huffyuv specific */
- void (*add_bytes)(uint8_t *dst/*align 16*/, uint8_t *src/*align 16*/, int w);
- void (*diff_bytes)(uint8_t *dst/*align 16*/, uint8_t *src1/*align 16*/, uint8_t *src2/*align 1*/,int w);
- /**
- * subtract huffyuv's variant of median prediction
- * note, this might read from src1[-1], src2[-1]
- */
- void (*sub_hfyu_median_prediction)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w, int *left, int *left_top);
- void (*bswap_buf)(uint32_t *dst, uint32_t *src, int w);
-
- void (*h264_v_loop_filter_luma)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0);
- void (*h264_h_loop_filter_luma)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0);
- void (*h264_v_loop_filter_chroma)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0);
- void (*h264_h_loop_filter_chroma)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0);
- void (*h264_v_loop_filter_chroma_intra)(uint8_t *pix, int stride, int alpha, int beta);
- void (*h264_h_loop_filter_chroma_intra)(uint8_t *pix, int stride, int alpha, int beta);
- // h264_loop_filter_strength: simd only. the C version is inlined in h264.c
- void (*h264_loop_filter_strength)(int16_t bS[2][4][4], uint8_t nnz[40], int8_t ref[2][40], int16_t mv[2][40][2],
- int bidir, int edges, int step, int mask_mv0, int mask_mv1);
-
- void (*h263_v_loop_filter)(uint8_t *src, int stride, int qscale);
- void (*h263_h_loop_filter)(uint8_t *src, int stride, int qscale);
-
- void (*h261_loop_filter)(uint8_t *src, int stride);
-
- /* assume len is a multiple of 4, and arrays are 16-byte aligned */
- void (*vorbis_inverse_coupling)(float *mag, float *ang, int blocksize);
- /* assume len is a multiple of 8, and arrays are 16-byte aligned */
- void (*vector_fmul)(float *dst, const float *src, int len);
- void (*vector_fmul_reverse)(float *dst, const float *src0, const float *src1, int len);
- /* assume len is a multiple of 8, and src arrays are 16-byte aligned */
- void (*vector_fmul_add_add)(float *dst, const float *src0, const float *src1, const float *src2, int src3, int len, int step);
-
- /* C version: convert floats from the range [384.0,386.0] to ints in [-32768,32767]
- * simd versions: convert floats from [-32768.0,32767.0] without rescaling and arrays are 16byte aligned */
- void (*float_to_int16)(int16_t *dst, const float *src, int len);
-
- /* (I)DCT */
- void (*fdct)(DCTELEM *block/* align 16*/);
- void (*fdct248)(DCTELEM *block/* align 16*/);
-
- /* IDCT really*/
- void (*idct)(DCTELEM *block/* align 16*/);
-
- /**
- * block -> idct -> clip to unsigned 8 bit -> dest.
- * (-1392, 0, 0, ...) -> idct -> (-174, -174, ...) -> put -> (0, 0, ...)
- * @param line_size size in bytes of a horizotal line of dest
- */
- void (*idct_put)(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/);
-
- /**
- * block -> idct -> add dest -> clip to unsigned 8 bit -> dest.
- * @param line_size size in bytes of a horizotal line of dest
- */
- void (*idct_add)(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/);
-
- /**
- * idct input permutation.
- * several optimized IDCTs need a permutated input (relative to the normal order of the reference
- * IDCT)
- * this permutation must be performed before the idct_put/add, note, normally this can be merged
- * with the zigzag/alternate scan<br>
- * an example to avoid confusion:
- * - (->decode coeffs -> zigzag reorder -> dequant -> reference idct ->...)
- * - (x -> referece dct -> reference idct -> x)
- * - (x -> referece dct -> simple_mmx_perm = idct_permutation -> simple_idct_mmx -> x)
- * - (->decode coeffs -> zigzag reorder -> simple_mmx_perm -> dequant -> simple_idct_mmx ->...)
- */
- uint8_t idct_permutation[64];
- int idct_permutation_type;
-#define FF_NO_IDCT_PERM 1
-#define FF_LIBMPEG2_IDCT_PERM 2
-#define FF_SIMPLE_IDCT_PERM 3
-#define FF_TRANSPOSE_IDCT_PERM 4
-#define FF_PARTTRANS_IDCT_PERM 5
-
- int (*try_8x8basis)(int16_t rem[64], int16_t weight[64], int16_t basis[64], int scale);
- void (*add_8x8basis)(int16_t rem[64], int16_t basis[64], int scale);
-#define BASIS_SHIFT 16
-#define RECON_SHIFT 6
-
- /* h264 functions */
- void (*h264_idct_add)(uint8_t *dst, DCTELEM *block, int stride);
- void (*h264_idct8_add)(uint8_t *dst, DCTELEM *block, int stride);
- void (*h264_idct_dc_add)(uint8_t *dst, DCTELEM *block, int stride);
- void (*h264_idct8_dc_add)(uint8_t *dst, DCTELEM *block, int stride);
- void (*h264_dct)(DCTELEM block[4][4]);
-
- /* snow wavelet */
- void (*vertical_compose97i)(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, DWTELEM *b3, DWTELEM *b4, DWTELEM *b5, int width);
- void (*horizontal_compose97i)(DWTELEM *b, int width);
- void (*inner_add_yblock)(uint8_t *obmc, const int obmc_stride, uint8_t * * block, int b_w, int b_h, int src_x, int src_y, int src_stride, slice_buffer * sb, int add, uint8_t * dst8);
-
- void (*prefetch)(void *mem, int stride, int h);
-
- void (*shrink[4])(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
-
- /* vc1 functions */
- void (*vc1_inv_trans_8x8)(DCTELEM *b);
- void (*vc1_inv_trans_8x4)(DCTELEM *b, int n);
- void (*vc1_inv_trans_4x8)(DCTELEM *b, int n);
- void (*vc1_inv_trans_4x4)(DCTELEM *b, int n);
- void (*vc1_v_overlap)(uint8_t* src, int stride);
- void (*vc1_h_overlap)(uint8_t* src, int stride);
- /* put 8x8 block with bicubic interpolation and quarterpel precision
- * last argument is actually round value instead of height
- */
- op_pixels_func put_vc1_mspel_pixels_tab[16];
-} DSPContext;
-
-void dsputil_static_init(void);
-void dsputil_init(DSPContext* p, AVCodecContext *avctx);
-
-int ff_check_alignment(void);
-
-/**
- * permute block according to permuatation.
- * @param last last non zero element in scantable order
- */
-void ff_block_permute(DCTELEM *block, uint8_t *permutation, const uint8_t *scantable, int last);
-
-void ff_set_cmp(DSPContext* c, me_cmp_func *cmp, int type);
-
-#define BYTE_VEC32(c) ((c)*0x01010101UL)
-
-static inline uint32_t rnd_avg32(uint32_t a, uint32_t b)
-{
- return (a | b) - (((a ^ b) & ~BYTE_VEC32(0x01)) >> 1);
-}
-
-static inline uint32_t no_rnd_avg32(uint32_t a, uint32_t b)
-{
- return (a & b) + (((a ^ b) & ~BYTE_VEC32(0x01)) >> 1);
-}
-
-static inline int get_penalty_factor(int lambda, int lambda2, int type){
- switch(type&0xFF){
- default:
- case FF_CMP_SAD:
- return lambda>>FF_LAMBDA_SHIFT;
- case FF_CMP_DCT:
- return (3*lambda)>>(FF_LAMBDA_SHIFT+1);
- case FF_CMP_W53:
- return (4*lambda)>>(FF_LAMBDA_SHIFT);
- case FF_CMP_W97:
- return (2*lambda)>>(FF_LAMBDA_SHIFT);
- case FF_CMP_SATD:
- case FF_CMP_DCT264:
- return (2*lambda)>>FF_LAMBDA_SHIFT;
- case FF_CMP_RD:
- case FF_CMP_PSNR:
- case FF_CMP_SSE:
- case FF_CMP_NSSE:
- return lambda2>>FF_LAMBDA_SHIFT;
- case FF_CMP_BIT:
- return 1;
- }
-}
-
-/**
- * Empty mmx state.
- * this must be called between any dsp function and float/double code.
- * for example sin(); dsp->idct_put(); emms_c(); cos()
- */
-#define emms_c()
-
-/* should be defined by architectures supporting
- one or more MultiMedia extension */
-int mm_support(void);
-
-#ifdef __GNUC__
- #define DECLARE_ALIGNED_16(t,v) t v __attribute__ ((aligned (16)))
-#else
- #define DECLARE_ALIGNED_16(t,v) __declspec(align(16)) t v
-#endif
-
-#if defined(HAVE_MMX)
-
-#undef emms_c
-
-#define MM_MMX 0x0001 /* standard MMX */
-#define MM_3DNOW 0x0004 /* AMD 3DNOW */
-#define MM_MMXEXT 0x0002 /* SSE integer functions or AMD MMX ext */
-#define MM_SSE 0x0008 /* SSE functions */
-#define MM_SSE2 0x0010 /* PIV SSE2 functions */
-#define MM_3DNOWEXT 0x0020 /* AMD 3DNowExt */
-#define MM_SSE3 0x0040 /* Prescott SSE3 functions */
-#define MM_SSSE3 0x0080 /* Conroe SSSE3 functions */
-
-extern int mm_flags;
-
-void add_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size);
-void put_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size);
-void put_signed_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size);
-
-static inline void emms(void)
-{
- __asm __volatile ("emms;":::"memory");
-}
-
-
-#define emms_c() \
-{\
- if (mm_flags & MM_MMX)\
- emms();\
-}
-
-#ifdef __GNUC__
- #define DECLARE_ALIGNED_8(t,v) t v __attribute__ ((aligned (8)))
-#else
- #define DECLARE_ALIGNED_8(t,v) __declspec(align(8)) t v
-#endif
-
-#define STRIDE_ALIGN 8
-
-void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx);
-void dsputil_init_pix_mmx(DSPContext* c, AVCodecContext *avctx);
-
-#elif defined(ARCH_ARMV4L)
-
-/* This is to use 4 bytes read to the IDCT pointers for some 'zero'
- line optimizations */
-#define DECLARE_ALIGNED_8(t,v) t v __attribute__ ((aligned (4)))
-#define STRIDE_ALIGN 4
-
-#define MM_IWMMXT 0x0100 /* XScale IWMMXT */
-
-extern int mm_flags;
-
-void dsputil_init_armv4l(DSPContext* c, AVCodecContext *avctx);
-
-#elif defined(HAVE_MLIB)
-
-/* SPARC/VIS IDCT needs 8-byte aligned DCT blocks */
-#define DECLARE_ALIGNED_8(t,v) t v __attribute__ ((aligned (8)))
-#define STRIDE_ALIGN 8
-
-void dsputil_init_mlib(DSPContext* c, AVCodecContext *avctx);
-
-#elif defined(ARCH_SPARC)
-
-/* SPARC/VIS IDCT needs 8-byte aligned DCT blocks */
-#define DECLARE_ALIGNED_8(t,v) t v __attribute__ ((aligned (8)))
-#define STRIDE_ALIGN 8
-void dsputil_init_vis(DSPContext* c, AVCodecContext *avctx);
-
-#elif defined(ARCH_ALPHA)
-
-#define DECLARE_ALIGNED_8(t,v) t v __attribute__ ((aligned (8)))
-#define STRIDE_ALIGN 8
-
-void dsputil_init_alpha(DSPContext* c, AVCodecContext *avctx);
-
-#elif defined(ARCH_POWERPC)
-
-#define MM_ALTIVEC 0x0001 /* standard AltiVec */
-
-extern int mm_flags;
-
-#if defined(HAVE_ALTIVEC) && !defined(CONFIG_DARWIN)
-#define pixel altivec_pixel
-#include <altivec.h>
-#undef pixel
-#endif
-
-#define DECLARE_ALIGNED_8(t,v) t v __attribute__ ((aligned (16)))
-#define STRIDE_ALIGN 16
-
-void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx);
-
-#elif defined(HAVE_MMI)
-
-#define DECLARE_ALIGNED_8(t,v) t v __attribute__ ((aligned (16)))
-#define STRIDE_ALIGN 16
-
-void dsputil_init_mmi(DSPContext* c, AVCodecContext *avctx);
-
-#elif defined(ARCH_SH4)
-
-#define DECLARE_ALIGNED_8(t,v) t v __attribute__ ((aligned (8)))
-#define STRIDE_ALIGN 8
-
-void dsputil_init_sh4(DSPContext* c, AVCodecContext *avctx);
-
-#elif defined(ARCH_BFIN)
-
-#define DECLARE_ALIGNED_8(t,v) t v __attribute__ ((aligned (8)))
-#define STRIDE_ALIGN 8
-
-void dsputil_init_bfin(DSPContext* c, AVCodecContext *avctx);
-
-#else
-
-#define DECLARE_ALIGNED_8(t,v) t v __attribute__ ((aligned (8)))
-#define STRIDE_ALIGN 8
-
-#endif
-
-/* PSNR */
-void get_psnr(uint8_t *orig_image[3], uint8_t *coded_image[3],
- int orig_linesize[3], int coded_linesize,
- AVCodecContext *avctx);
-
-/* FFT computation */
-
-/* NOTE: soon integer code will be added, so you must use the
- FFTSample type */
-typedef float FFTSample;
-
-struct MDCTContext;
-
-typedef struct FFTComplex {
- FFTSample re, im;
-} FFTComplex;
-
-typedef struct FFTContext {
- int nbits;
- int inverse;
- uint16_t *revtab;
- FFTComplex *exptab;
- FFTComplex *exptab1; /* only used by SSE code */
- void (*fft_calc)(struct FFTContext *s, FFTComplex *z);
- void (*imdct_calc)(struct MDCTContext *s, FFTSample *output,
- const FFTSample *input, FFTSample *tmp);
-} FFTContext;
-
-int ff_fft_init(FFTContext *s, int nbits, int inverse);
-void ff_fft_permute(FFTContext *s, FFTComplex *z);
-void ff_fft_calc_c(FFTContext *s, FFTComplex *z);
-void ff_fft_calc_sse(FFTContext *s, FFTComplex *z);
-void ff_fft_calc_3dn(FFTContext *s, FFTComplex *z);
-void ff_fft_calc_3dn2(FFTContext *s, FFTComplex *z);
-void ff_fft_calc_altivec(FFTContext *s, FFTComplex *z);
-
-static inline void ff_fft_calc(FFTContext *s, FFTComplex *z)
-{
- s->fft_calc(s, z);
-}
-void ff_fft_end(FFTContext *s);
-
-/* MDCT computation */
-
-typedef struct MDCTContext {
- int n; /* size of MDCT (i.e. number of input data * 2) */
- int nbits; /* n = 2^nbits */
- /* pre/post rotation tables */
- FFTSample *tcos;
- FFTSample *tsin;
- FFTContext fft;
-} MDCTContext;
-
-int ff_mdct_init(MDCTContext *s, int nbits, int inverse);
-void ff_imdct_calc(MDCTContext *s, FFTSample *output,
- const FFTSample *input, FFTSample *tmp);
-void ff_imdct_calc_3dn2(MDCTContext *s, FFTSample *output,
- const FFTSample *input, FFTSample *tmp);
-void ff_imdct_calc_sse(MDCTContext *s, FFTSample *output,
- const FFTSample *input, FFTSample *tmp);
-void ff_mdct_calc(MDCTContext *s, FFTSample *out,
- const FFTSample *input, FFTSample *tmp);
-void ff_mdct_end(MDCTContext *s);
-
-#define WARPER8_16(name8, name16)\
-static int name16(void /*MpegEncContext*/ *s, uint8_t *dst, uint8_t *src, int stride, int h){\
- return name8(s, dst , src , stride, h)\
- +name8(s, dst+8 , src+8 , stride, h);\
-}
-
-#define WARPER8_16_SQ(name8, name16)\
-static int name16(void /*MpegEncContext*/ *s, uint8_t *dst, uint8_t *src, int stride, int h){\
- int score=0;\
- score +=name8(s, dst , src , stride, 8);\
- score +=name8(s, dst+8 , src+8 , stride, 8);\
- if(h==16){\
- dst += 8*stride;\
- src += 8*stride;\
- score +=name8(s, dst , src , stride, 8);\
- score +=name8(s, dst+8 , src+8 , stride, 8);\
- }\
- return score;\
-}
-
-
-static inline void copy_block2(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h)
-{
- int i;
- for(i=0; i<h; i++)
- {
- ST16(dst , LD16(src ));
- dst+=dstStride;
- src+=srcStride;
- }
-}
-
-static inline void copy_block4(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h)
-{
- int i;
- for(i=0; i<h; i++)
- {
- ST32(dst , LD32(src ));
- dst+=dstStride;
- src+=srcStride;
- }
-}
-
-static inline void copy_block8(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h)
-{
- int i;
- for(i=0; i<h; i++)
- {
- ST32(dst , LD32(src ));
- ST32(dst+4 , LD32(src+4 ));
- dst+=dstStride;
- src+=srcStride;
- }
-}
-
-static inline void copy_block9(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h)
-{
- int i;
- for(i=0; i<h; i++)
- {
- ST32(dst , LD32(src ));
- ST32(dst+4 , LD32(src+4 ));
- dst[8]= src[8];
- dst+=dstStride;
- src+=srcStride;
- }
-}
-
-static inline void copy_block16(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h)
-{
- int i;
- for(i=0; i<h; i++)
- {
- ST32(dst , LD32(src ));
- ST32(dst+4 , LD32(src+4 ));
- ST32(dst+8 , LD32(src+8 ));
- ST32(dst+12, LD32(src+12));
- dst+=dstStride;
- src+=srcStride;
- }
-}
-
-static inline void copy_block17(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h)
-{
- int i;
- for(i=0; i<h; i++)
- {
- ST32(dst , LD32(src ));
- ST32(dst+4 , LD32(src+4 ));
- ST32(dst+8 , LD32(src+8 ));
- ST32(dst+12, LD32(src+12));
- dst[16]= src[16];
- dst+=dstStride;
- src+=srcStride;
- }
-}
-
-#endif
diff --git a/src/libffmpeg/libavcodec/dv.c b/src/libffmpeg/libavcodec/dv.c
deleted file mode 100644
index 505c88d49..000000000
--- a/src/libffmpeg/libavcodec/dv.c
+++ /dev/null
@@ -1,1266 +0,0 @@
-/*
- * DV decoder
- * Copyright (c) 2002 Fabrice Bellard.
- * Copyright (c) 2004 Roman Shaposhnik.
- *
- * DV encoder
- * Copyright (c) 2003 Roman Shaposhnik.
- *
- * 50 Mbps (DVCPRO50) support
- * Copyright (c) 2006 Daniel Maas <dmaas@maasdigital.com>
- *
- * Many thanks to Dan Dennedy <dan@dennedy.org> for providing wealth
- * of DV technical info.
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file dv.c
- * DV codec.
- */
-#define ALT_BITSTREAM_READER
-#include "avcodec.h"
-#include "dsputil.h"
-#include "mpegvideo.h"
-#include "simple_idct.h"
-#include "dvdata.h"
-
-//#undef NDEBUG
-//#include <assert.h>
-
-typedef struct DVVideoContext {
- const DVprofile* sys;
- AVFrame picture;
- AVCodecContext *avctx;
- uint8_t *buf;
-
- uint8_t dv_zigzag[2][64];
- uint8_t dv_idct_shift[2][2][22][64];
-
- void (*get_pixels)(DCTELEM *block, const uint8_t *pixels, int line_size);
- void (*fdct[2])(DCTELEM *block);
- void (*idct_put[2])(uint8_t *dest, int line_size, DCTELEM *block);
-} DVVideoContext;
-
-/* MultiThreading - dv_anchor applies to entire DV codec, not just the avcontext */
-/* one element is needed for each video segment in a DV frame */
-/* at most there are 2 DIF channels * 12 DIF sequences * 27 video segments (PAL 50Mbps) */
-#define DV_ANCHOR_SIZE (2*12*27)
-
-static void* dv_anchor[DV_ANCHOR_SIZE];
-
-#define TEX_VLC_BITS 9
-
-#ifdef DV_CODEC_TINY_TARGET
-#define DV_VLC_MAP_RUN_SIZE 15
-#define DV_VLC_MAP_LEV_SIZE 23
-#else
-#define DV_VLC_MAP_RUN_SIZE 64
-#define DV_VLC_MAP_LEV_SIZE 512 //FIXME sign was removed so this should be /2 but needs check
-#endif
-
-/* XXX: also include quantization */
-static RL_VLC_ELEM *dv_rl_vlc;
-/* VLC encoding lookup table */
-static struct dv_vlc_pair {
- uint32_t vlc;
- uint8_t size;
-} (*dv_vlc_map)[DV_VLC_MAP_LEV_SIZE] = NULL;
-
-static void dv_build_unquantize_tables(DVVideoContext *s, uint8_t* perm)
-{
- int i, q, j;
-
- /* NOTE: max left shift is 6 */
- for(q = 0; q < 22; q++) {
- /* 88DCT */
- for(i = 1; i < 64; i++) {
- /* 88 table */
- j = perm[i];
- s->dv_idct_shift[0][0][q][j] =
- dv_quant_shifts[q][dv_88_areas[i]] + 1;
- s->dv_idct_shift[1][0][q][j] = s->dv_idct_shift[0][0][q][j] + 1;
- }
-
- /* 248DCT */
- for(i = 1; i < 64; i++) {
- /* 248 table */
- s->dv_idct_shift[0][1][q][i] =
- dv_quant_shifts[q][dv_248_areas[i]] + 1;
- s->dv_idct_shift[1][1][q][i] = s->dv_idct_shift[0][1][q][i] + 1;
- }
- }
-}
-
-static int dvvideo_init(AVCodecContext *avctx)
-{
- DVVideoContext *s = avctx->priv_data;
- DSPContext dsp;
- static int done=0;
- int i, j;
-
- if (!done) {
- VLC dv_vlc;
- uint16_t new_dv_vlc_bits[NB_DV_VLC*2];
- uint8_t new_dv_vlc_len[NB_DV_VLC*2];
- uint8_t new_dv_vlc_run[NB_DV_VLC*2];
- int16_t new_dv_vlc_level[NB_DV_VLC*2];
-
- done = 1;
-
- dv_vlc_map = av_mallocz_static(DV_VLC_MAP_LEV_SIZE*DV_VLC_MAP_RUN_SIZE*sizeof(struct dv_vlc_pair));
- if (!dv_vlc_map)
- return -ENOMEM;
-
- /* dv_anchor lets each thread know its Id */
- for (i=0; i<DV_ANCHOR_SIZE; i++)
- dv_anchor[i] = (void*)(size_t)i;
-
- /* it's faster to include sign bit in a generic VLC parsing scheme */
- for (i=0, j=0; i<NB_DV_VLC; i++, j++) {
- new_dv_vlc_bits[j] = dv_vlc_bits[i];
- new_dv_vlc_len[j] = dv_vlc_len[i];
- new_dv_vlc_run[j] = dv_vlc_run[i];
- new_dv_vlc_level[j] = dv_vlc_level[i];
-
- if (dv_vlc_level[i]) {
- new_dv_vlc_bits[j] <<= 1;
- new_dv_vlc_len[j]++;
-
- j++;
- new_dv_vlc_bits[j] = (dv_vlc_bits[i] << 1) | 1;
- new_dv_vlc_len[j] = dv_vlc_len[i] + 1;
- new_dv_vlc_run[j] = dv_vlc_run[i];
- new_dv_vlc_level[j] = -dv_vlc_level[i];
- }
- }
-
- /* NOTE: as a trick, we use the fact the no codes are unused
- to accelerate the parsing of partial codes */
- init_vlc(&dv_vlc, TEX_VLC_BITS, j,
- new_dv_vlc_len, 1, 1, new_dv_vlc_bits, 2, 2, 0);
-
- dv_rl_vlc = av_mallocz_static(dv_vlc.table_size * sizeof(RL_VLC_ELEM));
- if (!dv_rl_vlc)
- return -ENOMEM;
-
- for(i = 0; i < dv_vlc.table_size; i++){
- int code= dv_vlc.table[i][0];
- int len = dv_vlc.table[i][1];
- int level, run;
-
- if(len<0){ //more bits needed
- run= 0;
- level= code;
- } else {
- run= new_dv_vlc_run[code] + 1;
- level= new_dv_vlc_level[code];
- }
- dv_rl_vlc[i].len = len;
- dv_rl_vlc[i].level = level;
- dv_rl_vlc[i].run = run;
- }
- free_vlc(&dv_vlc);
-
- for (i = 0; i < NB_DV_VLC - 1; i++) {
- if (dv_vlc_run[i] >= DV_VLC_MAP_RUN_SIZE)
- continue;
-#ifdef DV_CODEC_TINY_TARGET
- if (dv_vlc_level[i] >= DV_VLC_MAP_LEV_SIZE)
- continue;
-#endif
-
- if (dv_vlc_map[dv_vlc_run[i]][dv_vlc_level[i]].size != 0)
- continue;
-
- dv_vlc_map[dv_vlc_run[i]][dv_vlc_level[i]].vlc = dv_vlc_bits[i] <<
- (!!dv_vlc_level[i]);
- dv_vlc_map[dv_vlc_run[i]][dv_vlc_level[i]].size = dv_vlc_len[i] +
- (!!dv_vlc_level[i]);
- }
- for (i = 0; i < DV_VLC_MAP_RUN_SIZE; i++) {
-#ifdef DV_CODEC_TINY_TARGET
- for (j = 1; j < DV_VLC_MAP_LEV_SIZE; j++) {
- if (dv_vlc_map[i][j].size == 0) {
- dv_vlc_map[i][j].vlc = dv_vlc_map[0][j].vlc |
- (dv_vlc_map[i-1][0].vlc << (dv_vlc_map[0][j].size));
- dv_vlc_map[i][j].size = dv_vlc_map[i-1][0].size +
- dv_vlc_map[0][j].size;
- }
- }
-#else
- for (j = 1; j < DV_VLC_MAP_LEV_SIZE/2; j++) {
- if (dv_vlc_map[i][j].size == 0) {
- dv_vlc_map[i][j].vlc = dv_vlc_map[0][j].vlc |
- (dv_vlc_map[i-1][0].vlc << (dv_vlc_map[0][j].size));
- dv_vlc_map[i][j].size = dv_vlc_map[i-1][0].size +
- dv_vlc_map[0][j].size;
- }
- dv_vlc_map[i][((uint16_t)(-j))&0x1ff].vlc =
- dv_vlc_map[i][j].vlc | 1;
- dv_vlc_map[i][((uint16_t)(-j))&0x1ff].size =
- dv_vlc_map[i][j].size;
- }
-#endif
- }
- }
-
- /* Generic DSP setup */
- dsputil_init(&dsp, avctx);
- s->get_pixels = dsp.get_pixels;
-
- /* 88DCT setup */
- s->fdct[0] = dsp.fdct;
- s->idct_put[0] = dsp.idct_put;
- for (i=0; i<64; i++)
- s->dv_zigzag[0][i] = dsp.idct_permutation[ff_zigzag_direct[i]];
-
- /* 248DCT setup */
- s->fdct[1] = dsp.fdct248;
- s->idct_put[1] = simple_idct248_put; // FIXME: need to add it to DSP
- if(avctx->lowres){
- for (i=0; i<64; i++){
- int j= ff_zigzag248_direct[i];
- s->dv_zigzag[1][i] = dsp.idct_permutation[(j&7) + (j&8)*4 + (j&48)/2];
- }
- }else
- memcpy(s->dv_zigzag[1], ff_zigzag248_direct, 64);
-
- /* XXX: do it only for constant case */
- dv_build_unquantize_tables(s, dsp.idct_permutation);
-
- avctx->coded_frame = &s->picture;
- s->avctx= avctx;
-
- return 0;
-}
-
-// #define VLC_DEBUG
-// #define printf(...) av_log(NULL, AV_LOG_ERROR, __VA_ARGS__)
-
-typedef struct BlockInfo {
- const uint8_t *shift_table;
- const uint8_t *scan_table;
- const int *iweight_table;
- uint8_t pos; /* position in block */
- uint8_t dct_mode;
- uint8_t partial_bit_count;
- uint16_t partial_bit_buffer;
- int shift_offset;
-} BlockInfo;
-
-/* block size in bits */
-static const uint16_t block_sizes[6] = {
- 112, 112, 112, 112, 80, 80
-};
-/* bit budget for AC only in 5 MBs */
-static const int vs_total_ac_bits = (100 * 4 + 68*2) * 5;
-/* see dv_88_areas and dv_248_areas for details */
-static const int mb_area_start[5] = { 1, 6, 21, 43, 64 };
-
-static inline int get_bits_left(GetBitContext *s)
-{
- return s->size_in_bits - get_bits_count(s);
-}
-
-static inline int get_bits_size(GetBitContext *s)
-{
- return s->size_in_bits;
-}
-
-static inline int put_bits_left(PutBitContext* s)
-{
- return (s->buf_end - s->buf) * 8 - put_bits_count(s);
-}
-
-/* decode ac coefs */
-static void dv_decode_ac(GetBitContext *gb, BlockInfo *mb, DCTELEM *block)
-{
- int last_index = get_bits_size(gb);
- const uint8_t *scan_table = mb->scan_table;
- const uint8_t *shift_table = mb->shift_table;
- const int *iweight_table = mb->iweight_table;
- int pos = mb->pos;
- int partial_bit_count = mb->partial_bit_count;
- int level, pos1, run, vlc_len, index;
-
- OPEN_READER(re, gb);
- UPDATE_CACHE(re, gb);
-
- /* if we must parse a partial vlc, we do it here */
- if (partial_bit_count > 0) {
- re_cache = ((unsigned)re_cache >> partial_bit_count) |
- (mb->partial_bit_buffer << (sizeof(re_cache)*8 - partial_bit_count));
- re_index -= partial_bit_count;
- mb->partial_bit_count = 0;
- }
-
- /* get the AC coefficients until last_index is reached */
- for(;;) {
-#ifdef VLC_DEBUG
- printf("%2d: bits=%04x index=%d\n", pos, SHOW_UBITS(re, gb, 16), re_index);
-#endif
- /* our own optimized GET_RL_VLC */
- index = NEG_USR32(re_cache, TEX_VLC_BITS);
- vlc_len = dv_rl_vlc[index].len;
- if (vlc_len < 0) {
- index = NEG_USR32((unsigned)re_cache << TEX_VLC_BITS, -vlc_len) + dv_rl_vlc[index].level;
- vlc_len = TEX_VLC_BITS - vlc_len;
- }
- level = dv_rl_vlc[index].level;
- run = dv_rl_vlc[index].run;
-
- /* gotta check if we're still within gb boundaries */
- if (re_index + vlc_len > last_index) {
- /* should be < 16 bits otherwise a codeword could have been parsed */
- mb->partial_bit_count = last_index - re_index;
- mb->partial_bit_buffer = NEG_USR32(re_cache, mb->partial_bit_count);
- re_index = last_index;
- break;
- }
- re_index += vlc_len;
-
-#ifdef VLC_DEBUG
- printf("run=%d level=%d\n", run, level);
-#endif
- pos += run;
- if (pos >= 64)
- break;
-
- pos1 = scan_table[pos];
- level <<= shift_table[pos1];
-
- /* unweigh, round, and shift down */
- level = (level*iweight_table[pos] + (1 << (dv_iweight_bits-1))) >> dv_iweight_bits;
-
- block[pos1] = level;
-
- UPDATE_CACHE(re, gb);
- }
- CLOSE_READER(re, gb);
- mb->pos = pos;
-}
-
-static inline void bit_copy(PutBitContext *pb, GetBitContext *gb)
-{
- int bits_left = get_bits_left(gb);
- while (bits_left >= MIN_CACHE_BITS) {
- put_bits(pb, MIN_CACHE_BITS, get_bits(gb, MIN_CACHE_BITS));
- bits_left -= MIN_CACHE_BITS;
- }
- if (bits_left > 0) {
- put_bits(pb, bits_left, get_bits(gb, bits_left));
- }
-}
-
-/* mb_x and mb_y are in units of 8 pixels */
-static inline void dv_decode_video_segment(DVVideoContext *s,
- uint8_t *buf_ptr1,
- const uint16_t *mb_pos_ptr)
-{
- int quant, dc, dct_mode, class1, j;
- int mb_index, mb_x, mb_y, v, last_index;
- DCTELEM *block, *block1;
- int c_offset;
- uint8_t *y_ptr;
- void (*idct_put)(uint8_t *dest, int line_size, DCTELEM *block);
- uint8_t *buf_ptr;
- PutBitContext pb, vs_pb;
- GetBitContext gb;
- BlockInfo mb_data[5 * 6], *mb, *mb1;
- DECLARE_ALIGNED_8(DCTELEM, sblock[5*6][64]);
- DECLARE_ALIGNED_8(uint8_t, mb_bit_buffer[80 + 4]); /* allow some slack */
- DECLARE_ALIGNED_8(uint8_t, vs_bit_buffer[5 * 80 + 4]); /* allow some slack */
- const int log2_blocksize= 3-s->avctx->lowres;
-
- assert((((int)mb_bit_buffer)&7)==0);
- assert((((int)vs_bit_buffer)&7)==0);
-
- memset(sblock, 0, sizeof(sblock));
-
- /* pass 1 : read DC and AC coefficients in blocks */
- buf_ptr = buf_ptr1;
- block1 = &sblock[0][0];
- mb1 = mb_data;
- init_put_bits(&vs_pb, vs_bit_buffer, 5 * 80);
- for(mb_index = 0; mb_index < 5; mb_index++, mb1 += 6, block1 += 6 * 64) {
- /* skip header */
- quant = buf_ptr[3] & 0x0f;
- buf_ptr += 4;
- init_put_bits(&pb, mb_bit_buffer, 80);
- mb = mb1;
- block = block1;
- for(j = 0;j < 6; j++) {
- last_index = block_sizes[j];
- init_get_bits(&gb, buf_ptr, last_index);
-
- /* get the dc */
- dc = get_sbits(&gb, 9);
- dct_mode = get_bits1(&gb);
- mb->dct_mode = dct_mode;
- mb->scan_table = s->dv_zigzag[dct_mode];
- mb->iweight_table = dct_mode ? dv_iweight_248 : dv_iweight_88;
- class1 = get_bits(&gb, 2);
- mb->shift_table = s->dv_idct_shift[class1 == 3][dct_mode]
- [quant + dv_quant_offset[class1]];
- dc = dc << 2;
- /* convert to unsigned because 128 is not added in the
- standard IDCT */
- dc += 1024;
- block[0] = dc;
- buf_ptr += last_index >> 3;
- mb->pos = 0;
- mb->partial_bit_count = 0;
-
-#ifdef VLC_DEBUG
- printf("MB block: %d, %d ", mb_index, j);
-#endif
- dv_decode_ac(&gb, mb, block);
-
- /* write the remaining bits in a new buffer only if the
- block is finished */
- if (mb->pos >= 64)
- bit_copy(&pb, &gb);
-
- block += 64;
- mb++;
- }
-
- /* pass 2 : we can do it just after */
-#ifdef VLC_DEBUG
- printf("***pass 2 size=%d MB#=%d\n", put_bits_count(&pb), mb_index);
-#endif
- block = block1;
- mb = mb1;
- init_get_bits(&gb, mb_bit_buffer, put_bits_count(&pb));
- flush_put_bits(&pb);
- for(j = 0;j < 6; j++, block += 64, mb++) {
- if (mb->pos < 64 && get_bits_left(&gb) > 0) {
- dv_decode_ac(&gb, mb, block);
- /* if still not finished, no need to parse other blocks */
- if (mb->pos < 64)
- break;
- }
- }
- /* all blocks are finished, so the extra bytes can be used at
- the video segment level */
- if (j >= 6)
- bit_copy(&vs_pb, &gb);
- }
-
- /* we need a pass other the whole video segment */
-#ifdef VLC_DEBUG
- printf("***pass 3 size=%d\n", put_bits_count(&vs_pb));
-#endif
- block = &sblock[0][0];
- mb = mb_data;
- init_get_bits(&gb, vs_bit_buffer, put_bits_count(&vs_pb));
- flush_put_bits(&vs_pb);
- for(mb_index = 0; mb_index < 5; mb_index++) {
- for(j = 0;j < 6; j++) {
- if (mb->pos < 64) {
-#ifdef VLC_DEBUG
- printf("start %d:%d\n", mb_index, j);
-#endif
- dv_decode_ac(&gb, mb, block);
- }
- if (mb->pos >= 64 && mb->pos < 127)
- av_log(NULL, AV_LOG_ERROR, "AC EOB marker is absent pos=%d\n", mb->pos);
- block += 64;
- mb++;
- }
- }
-
- /* compute idct and place blocks */
- block = &sblock[0][0];
- mb = mb_data;
- for(mb_index = 0; mb_index < 5; mb_index++) {
- v = *mb_pos_ptr++;
- mb_x = v & 0xff;
- mb_y = v >> 8;
- if (s->sys->pix_fmt == PIX_FMT_YUV422P) {
- y_ptr = s->picture.data[0] + ((mb_y * s->picture.linesize[0] + (mb_x>>1))<<log2_blocksize);
- c_offset = ((mb_y * s->picture.linesize[1] + (mb_x >> 2))<<log2_blocksize);
- } else { /* 4:1:1 or 4:2:0 */
- y_ptr = s->picture.data[0] + ((mb_y * s->picture.linesize[0] + mb_x)<<log2_blocksize);
- if (s->sys->pix_fmt == PIX_FMT_YUV411P)
- c_offset = ((mb_y * s->picture.linesize[1] + (mb_x >> 2))<<log2_blocksize);
- else /* 4:2:0 */
- c_offset = (((mb_y >> 1) * s->picture.linesize[1] + (mb_x >> 1))<<log2_blocksize);
- }
- for(j = 0;j < 6; j++) {
- idct_put = s->idct_put[mb->dct_mode && log2_blocksize==3];
- if (s->sys->pix_fmt == PIX_FMT_YUV422P) { /* 4:2:2 */
- if (j == 0 || j == 2) {
- /* Y0 Y1 */
- idct_put(y_ptr + ((j >> 1)<<log2_blocksize),
- s->picture.linesize[0], block);
- } else if(j > 3) {
- /* Cr Cb */
- idct_put(s->picture.data[6 - j] + c_offset,
- s->picture.linesize[6 - j], block);
- }
- /* note: j=1 and j=3 are "dummy" blocks in 4:2:2 */
- } else { /* 4:1:1 or 4:2:0 */
- if (j < 4) {
- if (s->sys->pix_fmt == PIX_FMT_YUV411P && mb_x < (704 / 8)) {
- /* NOTE: at end of line, the macroblock is handled as 420 */
- idct_put(y_ptr + (j<<log2_blocksize), s->picture.linesize[0], block);
- } else {
- idct_put(y_ptr + (((j & 1) + (j >> 1) * s->picture.linesize[0])<<log2_blocksize),
- s->picture.linesize[0], block);
- }
- } else {
- if (s->sys->pix_fmt == PIX_FMT_YUV411P && mb_x >= (704 / 8)) {
- uint64_t aligned_pixels[64/8];
- uint8_t *pixels= (uint8_t*)aligned_pixels;
- uint8_t *c_ptr, *c_ptr1, *ptr, *ptr1;
- int x, y, linesize;
- /* NOTE: at end of line, the macroblock is handled as 420 */
- idct_put(pixels, 8, block);
- linesize = s->picture.linesize[6 - j];
- c_ptr = s->picture.data[6 - j] + c_offset;
- ptr = pixels;
- for(y = 0;y < (1<<log2_blocksize); y++) {
- ptr1= ptr + (1<<(log2_blocksize-1));
- c_ptr1 = c_ptr + (linesize<<log2_blocksize);
- for(x=0; x < (1<<(log2_blocksize-1)); x++){
- c_ptr[x]= ptr[x]; c_ptr1[x]= ptr1[x];
- }
- c_ptr += linesize;
- ptr += 8;
- }
- } else {
- /* don't ask me why they inverted Cb and Cr ! */
- idct_put(s->picture.data[6 - j] + c_offset,
- s->picture.linesize[6 - j], block);
- }
- }
- }
- block += 64;
- mb++;
- }
- }
-}
-
-#ifdef DV_CODEC_TINY_TARGET
-/* Converts run and level (where level != 0) pair into vlc, returning bit size */
-static av_always_inline int dv_rl2vlc(int run, int level, int sign, uint32_t* vlc)
-{
- int size;
- if (run < DV_VLC_MAP_RUN_SIZE && level < DV_VLC_MAP_LEV_SIZE) {
- *vlc = dv_vlc_map[run][level].vlc | sign;
- size = dv_vlc_map[run][level].size;
- }
- else {
- if (level < DV_VLC_MAP_LEV_SIZE) {
- *vlc = dv_vlc_map[0][level].vlc | sign;
- size = dv_vlc_map[0][level].size;
- } else {
- *vlc = 0xfe00 | (level << 1) | sign;
- size = 16;
- }
- if (run) {
- *vlc |= ((run < 16) ? dv_vlc_map[run-1][0].vlc :
- (0x1f80 | (run - 1))) << size;
- size += (run < 16) ? dv_vlc_map[run-1][0].size : 13;
- }
- }
-
- return size;
-}
-
-static av_always_inline int dv_rl2vlc_size(int run, int level)
-{
- int size;
-
- if (run < DV_VLC_MAP_RUN_SIZE && level < DV_VLC_MAP_LEV_SIZE) {
- size = dv_vlc_map[run][level].size;
- }
- else {
- size = (level < DV_VLC_MAP_LEV_SIZE) ? dv_vlc_map[0][level].size : 16;
- if (run) {
- size += (run < 16) ? dv_vlc_map[run-1][0].size : 13;
- }
- }
- return size;
-}
-#else
-static av_always_inline int dv_rl2vlc(int run, int l, int sign, uint32_t* vlc)
-{
- *vlc = dv_vlc_map[run][l].vlc | sign;
- return dv_vlc_map[run][l].size;
-}
-
-static av_always_inline int dv_rl2vlc_size(int run, int l)
-{
- return dv_vlc_map[run][l].size;
-}
-#endif
-
-typedef struct EncBlockInfo {
- int area_q[4];
- int bit_size[4];
- int prev[5];
- int cur_ac;
- int cno;
- int dct_mode;
- DCTELEM mb[64];
- uint8_t next[64];
- uint8_t sign[64];
- uint8_t partial_bit_count;
- uint32_t partial_bit_buffer; /* we can't use uint16_t here */
-} EncBlockInfo;
-
-static av_always_inline PutBitContext* dv_encode_ac(EncBlockInfo* bi, PutBitContext* pb_pool,
- PutBitContext* pb_end)
-{
- int prev;
- int bits_left;
- PutBitContext* pb = pb_pool;
- int size = bi->partial_bit_count;
- uint32_t vlc = bi->partial_bit_buffer;
-
- bi->partial_bit_count = bi->partial_bit_buffer = 0;
- for(;;){
- /* Find suitable storage space */
- for (; size > (bits_left = put_bits_left(pb)); pb++) {
- if (bits_left) {
- size -= bits_left;
- put_bits(pb, bits_left, vlc >> size);
- vlc = vlc & ((1<<size)-1);
- }
- if (pb + 1 >= pb_end) {
- bi->partial_bit_count = size;
- bi->partial_bit_buffer = vlc;
- return pb;
- }
- }
-
- /* Store VLC */
- put_bits(pb, size, vlc);
-
- if(bi->cur_ac>=64)
- break;
-
- /* Construct the next VLC */
- prev= bi->cur_ac;
- bi->cur_ac = bi->next[prev];
- if(bi->cur_ac < 64){
- size = dv_rl2vlc(bi->cur_ac - prev - 1, bi->mb[bi->cur_ac], bi->sign[bi->cur_ac], &vlc);
- } else {
- size = 4; vlc = 6; /* End Of Block stamp */
- }
- }
- return pb;
-}
-
-static av_always_inline void dv_set_class_number(DCTELEM* blk, EncBlockInfo* bi,
- const uint8_t* zigzag_scan, const int *weight, int bias)
-{
- int i, area;
- /* We offer two different methods for class number assignment: the
- method suggested in SMPTE 314M Table 22, and an improved
- method. The SMPTE method is very conservative; it assigns class
- 3 (i.e. severe quantization) to any block where the largest AC
- component is greater than 36. ffmpeg's DV encoder tracks AC bit
- consumption precisely, so there is no need to bias most blocks
- towards strongly lossy compression. Instead, we assign class 2
- to most blocks, and use class 3 only when strictly necessary
- (for blocks whose largest AC component exceeds 255). */
-
-#if 0 /* SMPTE spec method */
- static const int classes[] = {12, 24, 36, 0xffff};
-#else /* improved ffmpeg method */
- static const int classes[] = {-1, -1, 255, 0xffff};
-#endif
- int max=classes[0];
- int prev=0;
-
- bi->mb[0] = blk[0];
-
- for (area = 0; area < 4; area++) {
- bi->prev[area] = prev;
- bi->bit_size[area] = 1; // 4 areas 4 bits for EOB :)
- for (i=mb_area_start[area]; i<mb_area_start[area+1]; i++) {
- int level = blk[zigzag_scan[i]];
-
- if (level+15 > 30U) {
- bi->sign[i] = (level>>31)&1;
- /* weigh it and and shift down into range, adding for rounding */
- /* the extra division by a factor of 2^4 reverses the 8x expansion of the DCT
- AND the 2x doubling of the weights */
- level = (FFABS(level) * weight[i] + (1<<(dv_weight_bits+3))) >> (dv_weight_bits+4);
- bi->mb[i] = level;
- if(level>max) max= level;
- bi->bit_size[area] += dv_rl2vlc_size(i - prev - 1, level);
- bi->next[prev]= i;
- prev= i;
- }
- }
- }
- bi->next[prev]= i;
- for(bi->cno = 0; max > classes[bi->cno]; bi->cno++);
-
- bi->cno += bias;
-
- if (bi->cno >= 3) {
- bi->cno = 3;
- prev=0;
- i= bi->next[prev];
- for (area = 0; area < 4; area++) {
- bi->prev[area] = prev;
- bi->bit_size[area] = 1; // 4 areas 4 bits for EOB :)
- for (; i<mb_area_start[area+1]; i= bi->next[i]) {
- bi->mb[i] >>=1;
-
- if (bi->mb[i]) {
- bi->bit_size[area] += dv_rl2vlc_size(i - prev - 1, bi->mb[i]);
- bi->next[prev]= i;
- prev= i;
- }
- }
- }
- bi->next[prev]= i;
- }
-}
-
-//FIXME replace this by dsputil
-#define SC(x, y) ((s[x] - s[y]) ^ ((s[x] - s[y]) >> 7))
-static av_always_inline int dv_guess_dct_mode(DCTELEM *blk) {
- DCTELEM *s;
- int score88 = 0;
- int score248 = 0;
- int i;
-
- /* Compute 8-8 score (small values give a better chance for 8-8 DCT) */
- s = blk;
- for(i=0; i<7; i++) {
- score88 += SC(0, 8) + SC(1, 9) + SC(2, 10) + SC(3, 11) +
- SC(4, 12) + SC(5,13) + SC(6, 14) + SC(7, 15);
- s += 8;
- }
- /* Compute 2-4-8 score (small values give a better chance for 2-4-8 DCT) */
- s = blk;
- for(i=0; i<6; i++) {
- score248 += SC(0, 16) + SC(1,17) + SC(2, 18) + SC(3, 19) +
- SC(4, 20) + SC(5,21) + SC(6, 22) + SC(7, 23);
- s += 8;
- }
-
- return (score88 - score248 > -10);
-}
-
-static inline void dv_guess_qnos(EncBlockInfo* blks, int* qnos)
-{
- int size[5];
- int i, j, k, a, prev, a2;
- EncBlockInfo* b;
-
- size[0] = size[1] = size[2] = size[3] = size[4] = 1<<24;
- do {
- b = blks;
- for (i=0; i<5; i++) {
- if (!qnos[i])
- continue;
-
- qnos[i]--;
- size[i] = 0;
- for (j=0; j<6; j++, b++) {
- for (a=0; a<4; a++) {
- if (b->area_q[a] != dv_quant_shifts[qnos[i] + dv_quant_offset[b->cno]][a]) {
- b->bit_size[a] = 1; // 4 areas 4 bits for EOB :)
- b->area_q[a]++;
- prev= b->prev[a];
- assert(b->next[prev] >= mb_area_start[a+1] || b->mb[prev]);
- for (k= b->next[prev] ; k<mb_area_start[a+1]; k= b->next[k]) {
- b->mb[k] >>= 1;
- if (b->mb[k]) {
- b->bit_size[a] += dv_rl2vlc_size(k - prev - 1, b->mb[k]);
- prev= k;
- } else {
- if(b->next[k] >= mb_area_start[a+1] && b->next[k]<64){
- for(a2=a+1; b->next[k] >= mb_area_start[a2+1]; a2++)
- b->prev[a2] = prev;
- assert(a2<4);
- assert(b->mb[b->next[k]]);
- b->bit_size[a2] += dv_rl2vlc_size(b->next[k] - prev - 1, b->mb[b->next[k]])
- -dv_rl2vlc_size(b->next[k] - k - 1, b->mb[b->next[k]]);
- assert(b->prev[a2]==k && (a2+1 >= 4 || b->prev[a2+1]!=k));
- b->prev[a2] = prev;
- }
- b->next[prev] = b->next[k];
- }
- }
- b->prev[a+1]= prev;
- }
- size[i] += b->bit_size[a];
- }
- }
- if(vs_total_ac_bits >= size[0] + size[1] + size[2] + size[3] + size[4])
- return;
- }
- } while (qnos[0]|qnos[1]|qnos[2]|qnos[3]|qnos[4]);
-
-
- for(a=2; a==2 || vs_total_ac_bits < size[0]; a+=a){
- b = blks;
- size[0] = 5*6*4; //EOB
- for (j=0; j<6*5; j++, b++) {
- prev= b->prev[0];
- for (k= b->next[prev]; k<64; k= b->next[k]) {
- if(b->mb[k] < a && b->mb[k] > -a){
- b->next[prev] = b->next[k];
- }else{
- size[0] += dv_rl2vlc_size(k - prev - 1, b->mb[k]);
- prev= k;
- }
- }
- }
- }
-}
-
-static inline void dv_encode_video_segment(DVVideoContext *s,
- uint8_t *dif,
- const uint16_t *mb_pos_ptr)
-{
- int mb_index, i, j, v;
- int mb_x, mb_y, c_offset, linesize;
- uint8_t* y_ptr;
- uint8_t* data;
- uint8_t* ptr;
- int do_edge_wrap;
- DECLARE_ALIGNED_8(DCTELEM, block[64]);
- EncBlockInfo enc_blks[5*6];
- PutBitContext pbs[5*6];
- PutBitContext* pb;
- EncBlockInfo* enc_blk;
- int vs_bit_size = 0;
- int qnos[5];
-
- assert((((int)block) & 7) == 0);
-
- enc_blk = &enc_blks[0];
- pb = &pbs[0];
- for(mb_index = 0; mb_index < 5; mb_index++) {
- v = *mb_pos_ptr++;
- mb_x = v & 0xff;
- mb_y = v >> 8;
- if (s->sys->pix_fmt == PIX_FMT_YUV422P) {
- y_ptr = s->picture.data[0] + (mb_y * s->picture.linesize[0] * 8) + (mb_x * 4);
- } else { /* 4:1:1 */
- y_ptr = s->picture.data[0] + (mb_y * s->picture.linesize[0] * 8) + (mb_x * 8);
- }
- if (s->sys->pix_fmt == PIX_FMT_YUV420P) {
- c_offset = (((mb_y >> 1) * s->picture.linesize[1] * 8) + ((mb_x >> 1) * 8));
- } else { /* 4:2:2 or 4:1:1 */
- c_offset = ((mb_y * s->picture.linesize[1] * 8) + ((mb_x >> 2) * 8));
- }
- do_edge_wrap = 0;
- qnos[mb_index] = 15; /* No quantization */
- ptr = dif + mb_index*80 + 4;
- for(j = 0;j < 6; j++) {
- int dummy = 0;
- if (s->sys->pix_fmt == PIX_FMT_YUV422P) { /* 4:2:2 */
- if (j == 0 || j == 2) {
- /* Y0 Y1 */
- data = y_ptr + ((j>>1) * 8);
- linesize = s->picture.linesize[0];
- } else if (j > 3) {
- /* Cr Cb */
- data = s->picture.data[6 - j] + c_offset;
- linesize = s->picture.linesize[6 - j];
- } else {
- /* j=1 and j=3 are "dummy" blocks, used for AC data only */
- data = 0;
- linesize = 0;
- dummy = 1;
- }
- } else { /* 4:1:1 or 4:2:0 */
- if (j < 4) { /* Four Y blocks */
- /* NOTE: at end of line, the macroblock is handled as 420 */
- if (s->sys->pix_fmt == PIX_FMT_YUV411P && mb_x < (704 / 8)) {
- data = y_ptr + (j * 8);
- } else {
- data = y_ptr + ((j & 1) * 8) + ((j >> 1) * 8 * s->picture.linesize[0]);
- }
- linesize = s->picture.linesize[0];
- } else { /* Cr and Cb blocks */
- /* don't ask Fabrice why they inverted Cb and Cr ! */
- data = s->picture.data[6 - j] + c_offset;
- linesize = s->picture.linesize[6 - j];
- if (s->sys->pix_fmt == PIX_FMT_YUV411P && mb_x >= (704 / 8))
- do_edge_wrap = 1;
- }
- }
-
- /* Everything is set up -- now just copy data -> DCT block */
- if (do_edge_wrap) { /* Edge wrap copy: 4x16 -> 8x8 */
- uint8_t* d;
- DCTELEM *b = block;
- for (i=0;i<8;i++) {
- d = data + 8 * linesize;
- b[0] = data[0]; b[1] = data[1]; b[2] = data[2]; b[3] = data[3];
- b[4] = d[0]; b[5] = d[1]; b[6] = d[2]; b[7] = d[3];
- data += linesize;
- b += 8;
- }
- } else { /* Simple copy: 8x8 -> 8x8 */
- if (!dummy)
- s->get_pixels(block, data, linesize);
- }
-
- if(s->avctx->flags & CODEC_FLAG_INTERLACED_DCT)
- enc_blk->dct_mode = dv_guess_dct_mode(block);
- else
- enc_blk->dct_mode = 0;
- enc_blk->area_q[0] = enc_blk->area_q[1] = enc_blk->area_q[2] = enc_blk->area_q[3] = 0;
- enc_blk->partial_bit_count = 0;
- enc_blk->partial_bit_buffer = 0;
- enc_blk->cur_ac = 0;
-
- if (dummy) {
- /* We rely on the fact that encoding all zeros leads to an immediate EOB,
- which is precisely what the spec calls for in the "dummy" blocks. */
- memset(block, 0, sizeof(block));
- } else {
- s->fdct[enc_blk->dct_mode](block);
- }
-
- dv_set_class_number(block, enc_blk,
- enc_blk->dct_mode ? ff_zigzag248_direct : ff_zigzag_direct,
- enc_blk->dct_mode ? dv_weight_248 : dv_weight_88,
- j/4);
-
- init_put_bits(pb, ptr, block_sizes[j]/8);
- put_bits(pb, 9, (uint16_t)(((enc_blk->mb[0] >> 3) - 1024 + 2) >> 2));
- put_bits(pb, 1, enc_blk->dct_mode);
- put_bits(pb, 2, enc_blk->cno);
-
- vs_bit_size += enc_blk->bit_size[0] + enc_blk->bit_size[1] +
- enc_blk->bit_size[2] + enc_blk->bit_size[3];
- ++enc_blk;
- ++pb;
- ptr += block_sizes[j]/8;
- }
- }
-
- if (vs_total_ac_bits < vs_bit_size)
- dv_guess_qnos(&enc_blks[0], &qnos[0]);
-
- for (i=0; i<5; i++) {
- dif[i*80 + 3] = qnos[i];
- }
-
- /* First pass over individual cells only */
- for (j=0; j<5*6; j++)
- dv_encode_ac(&enc_blks[j], &pbs[j], &pbs[j+1]);
-
- /* Second pass over each MB space */
- for (j=0; j<5*6; j+=6) {
- pb= &pbs[j];
- for (i=0; i<6; i++) {
- if (enc_blks[i+j].partial_bit_count)
- pb=dv_encode_ac(&enc_blks[i+j], pb, &pbs[j+6]);
- }
- }
-
- /* Third and final pass over the whole vides segment space */
- pb= &pbs[0];
- for (j=0; j<5*6; j++) {
- if (enc_blks[j].partial_bit_count)
- pb=dv_encode_ac(&enc_blks[j], pb, &pbs[6*5]);
- if (enc_blks[j].partial_bit_count)
- av_log(NULL, AV_LOG_ERROR, "ac bitstream overflow\n");
- }
-
- for (j=0; j<5*6; j++)
- flush_put_bits(&pbs[j]);
-}
-
-static int dv_decode_mt(AVCodecContext *avctx, void* sl)
-{
- DVVideoContext *s = avctx->priv_data;
- int slice = (size_t)sl;
-
- /* which DIF channel is this? */
- int chan = slice / (s->sys->difseg_size * 27);
-
- /* slice within the DIF channel */
- int chan_slice = slice % (s->sys->difseg_size * 27);
-
- /* byte offset of this channel's data */
- int chan_offset = chan * s->sys->difseg_size * 150 * 80;
-
- dv_decode_video_segment(s, &s->buf[((chan_slice/27)*6+(chan_slice/3)+chan_slice*5+7)*80 + chan_offset],
- &s->sys->video_place[slice*5]);
- return 0;
-}
-
-#ifdef CONFIG_ENCODERS
-static int dv_encode_mt(AVCodecContext *avctx, void* sl)
-{
- DVVideoContext *s = avctx->priv_data;
- int slice = (size_t)sl;
-
- /* which DIF channel is this? */
- int chan = slice / (s->sys->difseg_size * 27);
-
- /* slice within the DIF channel */
- int chan_slice = slice % (s->sys->difseg_size * 27);
-
- /* byte offset of this channel's data */
- int chan_offset = chan * s->sys->difseg_size * 150 * 80;
-
- dv_encode_video_segment(s, &s->buf[((chan_slice/27)*6+(chan_slice/3)+chan_slice*5+7)*80 + chan_offset],
- &s->sys->video_place[slice*5]);
- return 0;
-}
-#endif
-
-#ifdef CONFIG_DECODERS
-/* NOTE: exactly one frame must be given (120000 bytes for NTSC,
- 144000 bytes for PAL - or twice those for 50Mbps) */
-static int dvvideo_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- DVVideoContext *s = avctx->priv_data;
-
- s->sys = dv_frame_profile(buf);
- if (!s->sys || buf_size < s->sys->frame_size)
- return -1; /* NOTE: we only accept several full frames */
-
- if(s->picture.data[0])
- avctx->release_buffer(avctx, &s->picture);
-
- s->picture.reference = 0;
- s->picture.key_frame = 1;
- s->picture.pict_type = FF_I_TYPE;
- avctx->pix_fmt = s->sys->pix_fmt;
- avcodec_set_dimensions(avctx, s->sys->width, s->sys->height);
- if(avctx->get_buffer(avctx, &s->picture) < 0) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
- s->picture.interlaced_frame = 1;
- s->picture.top_field_first = 0;
-
- s->buf = buf;
- avctx->execute(avctx, dv_decode_mt, (void**)&dv_anchor[0], NULL,
- s->sys->n_difchan * s->sys->difseg_size * 27);
-
- emms_c();
-
- /* return image */
- *data_size = sizeof(AVFrame);
- *(AVFrame*)data= s->picture;
-
- return s->sys->frame_size;
-}
-#endif
-
-
-static inline int dv_write_pack(enum dv_pack_type pack_id, DVVideoContext *c, uint8_t* buf)
-{
- /*
- * Here's what SMPTE314M says about these two:
- * (page 6) APTn, AP1n, AP2n, AP3n: These data shall be identical
- * as track application IDs (APTn = 001, AP1n =
- * 001, AP2n = 001, AP3n = 001), if the source signal
- * comes from a digital VCR. If the signal source is
- * unknown, all bits for these data shall be set to 1.
- * (page 12) STYPE: STYPE defines a signal type of video signal
- * 00000b = 4:1:1 compression
- * 00100b = 4:2:2 compression
- * XXXXXX = Reserved
- * Now, I've got two problems with these statements:
- * 1. it looks like APT == 111b should be a safe bet, but it isn't.
- * It seems that for PAL as defined in IEC 61834 we have to set
- * APT to 000 and for SMPTE314M to 001.
- * 2. It is not at all clear what STYPE is used for 4:2:0 PAL
- * compression scheme (if any).
- */
- int apt = (c->sys->pix_fmt == PIX_FMT_YUV420P ? 0 : 1);
- int stype = (c->sys->pix_fmt == PIX_FMT_YUV422P ? 4 : 0);
-
- uint8_t aspect = 0;
- if((int)(av_q2d(c->avctx->sample_aspect_ratio) * c->avctx->width / c->avctx->height * 10) == 17) /* 16:9 */
- aspect = 0x02;
-
- buf[0] = (uint8_t)pack_id;
- switch (pack_id) {
- case dv_header525: /* I can't imagine why these two weren't defined as real */
- case dv_header625: /* packs in SMPTE314M -- they definitely look like ones */
- buf[1] = 0xf8 | /* reserved -- always 1 */
- (apt & 0x07); /* APT: Track application ID */
- buf[2] = (0 << 7) | /* TF1: audio data is 0 - valid; 1 - invalid */
- (0x0f << 3) | /* reserved -- always 1 */
- (apt & 0x07); /* AP1: Audio application ID */
- buf[3] = (0 << 7) | /* TF2: video data is 0 - valid; 1 - invalid */
- (0x0f << 3) | /* reserved -- always 1 */
- (apt & 0x07); /* AP2: Video application ID */
- buf[4] = (0 << 7) | /* TF3: subcode(SSYB) is 0 - valid; 1 - invalid */
- (0x0f << 3) | /* reserved -- always 1 */
- (apt & 0x07); /* AP3: Subcode application ID */
- break;
- case dv_video_source:
- buf[1] = 0xff; /* reserved -- always 1 */
- buf[2] = (1 << 7) | /* B/W: 0 - b/w, 1 - color */
- (1 << 6) | /* following CLF is valid - 0, invalid - 1 */
- (3 << 4) | /* CLF: color frames id (see ITU-R BT.470-4) */
- 0xf; /* reserved -- always 1 */
- buf[3] = (3 << 6) | /* reserved -- always 1 */
- (c->sys->dsf << 5) | /* system: 60fields/50fields */
- stype; /* signal type video compression */
- buf[4] = 0xff; /* VISC: 0xff -- no information */
- break;
- case dv_video_control:
- buf[1] = (0 << 6) | /* Copy generation management (CGMS) 0 -- free */
- 0x3f; /* reserved -- always 1 */
- buf[2] = 0xc8 | /* reserved -- always b11001xxx */
- aspect;
- buf[3] = (1 << 7) | /* Frame/field flag 1 -- frame, 0 -- field */
- (1 << 6) | /* First/second field flag 0 -- field 2, 1 -- field 1 */
- (1 << 5) | /* Frame change flag 0 -- same picture as before, 1 -- different */
- (1 << 4) | /* 1 - interlaced, 0 - noninterlaced */
- 0xc; /* reserved -- always b1100 */
- buf[4] = 0xff; /* reserved -- always 1 */
- break;
- default:
- buf[1] = buf[2] = buf[3] = buf[4] = 0xff;
- }
- return 5;
-}
-
-static void dv_format_frame(DVVideoContext* c, uint8_t* buf)
-{
- int chan, i, j, k;
-
- for (chan = 0; chan < c->sys->n_difchan; chan++) {
- for (i = 0; i < c->sys->difseg_size; i++) {
- memset(buf, 0xff, 80 * 6); /* First 6 DIF blocks are for control data */
-
- /* DV header: 1DIF */
- buf += dv_write_dif_id(dv_sect_header, chan, i, 0, buf);
- buf += dv_write_pack((c->sys->dsf ? dv_header625 : dv_header525), c, buf);
- buf += 72; /* unused bytes */
-
- /* DV subcode: 2DIFs */
- for (j = 0; j < 2; j++) {
- buf += dv_write_dif_id(dv_sect_subcode, chan, i, j, buf);
- for (k = 0; k < 6; k++)
- buf += dv_write_ssyb_id(k, (i < c->sys->difseg_size/2), buf) + 5;
- buf += 29; /* unused bytes */
- }
-
- /* DV VAUX: 3DIFS */
- for (j = 0; j < 3; j++) {
- buf += dv_write_dif_id(dv_sect_vaux, chan, i, j, buf);
- buf += dv_write_pack(dv_video_source, c, buf);
- buf += dv_write_pack(dv_video_control, c, buf);
- buf += 7*5;
- buf += dv_write_pack(dv_video_source, c, buf);
- buf += dv_write_pack(dv_video_control, c, buf);
- buf += 4*5 + 2; /* unused bytes */
- }
-
- /* DV Audio/Video: 135 Video DIFs + 9 Audio DIFs */
- for (j = 0; j < 135; j++) {
- if (j%15 == 0) {
- memset(buf, 0xff, 80);
- buf += dv_write_dif_id(dv_sect_audio, chan, i, j/15, buf);
- buf += 77; /* audio control & shuffled PCM audio */
- }
- buf += dv_write_dif_id(dv_sect_video, chan, i, j, buf);
- buf += 77; /* 1 video macro block: 1 bytes control
- 4 * 14 bytes Y 8x8 data
- 10 bytes Cr 8x8 data
- 10 bytes Cb 8x8 data */
- }
- }
- }
-}
-
-
-#ifdef CONFIG_ENCODERS
-static int dvvideo_encode_frame(AVCodecContext *c, uint8_t *buf, int buf_size,
- void *data)
-{
- DVVideoContext *s = c->priv_data;
-
- s->sys = dv_codec_profile(c);
- if (!s->sys)
- return -1;
- if(buf_size < s->sys->frame_size)
- return -1;
-
- c->pix_fmt = s->sys->pix_fmt;
- s->picture = *((AVFrame *)data);
- s->picture.key_frame = 1;
- s->picture.pict_type = FF_I_TYPE;
-
- s->buf = buf;
- c->execute(c, dv_encode_mt, (void**)&dv_anchor[0], NULL,
- s->sys->n_difchan * s->sys->difseg_size * 27);
-
- emms_c();
-
- dv_format_frame(s, buf);
-
- return s->sys->frame_size;
-}
-#endif
-
-static int dvvideo_close(AVCodecContext *c)
-{
- DVVideoContext *s = c->priv_data;
-
- if(s->picture.data[0])
- c->release_buffer(c, &s->picture);
-
- return 0;
-}
-
-
-#ifdef CONFIG_DVVIDEO_ENCODER
-AVCodec dvvideo_encoder = {
- "dvvideo",
- CODEC_TYPE_VIDEO,
- CODEC_ID_DVVIDEO,
- sizeof(DVVideoContext),
- dvvideo_init,
- dvvideo_encode_frame,
- .pix_fmts = (enum PixelFormat[]) {PIX_FMT_YUV411P, PIX_FMT_YUV422P, PIX_FMT_YUV420P, -1},
-};
-#endif // CONFIG_DVVIDEO_ENCODER
-
-#ifdef CONFIG_DVVIDEO_DECODER
-AVCodec dvvideo_decoder = {
- "dvvideo",
- CODEC_TYPE_VIDEO,
- CODEC_ID_DVVIDEO,
- sizeof(DVVideoContext),
- dvvideo_init,
- NULL,
- dvvideo_close,
- dvvideo_decode_frame,
- CODEC_CAP_DR1,
- NULL
-};
-#endif
diff --git a/src/libffmpeg/libavcodec/dvdata.h b/src/libffmpeg/libavcodec/dvdata.h
deleted file mode 100644
index e688ffbb0..000000000
--- a/src/libffmpeg/libavcodec/dvdata.h
+++ /dev/null
@@ -1,2724 +0,0 @@
-/*
- * Constants for DV codec
- * Copyright (c) 2002 Fabrice Bellard.
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file dvdata.h
- * Constants for DV codec.
- */
-
-/*
- * DVprofile is used to express the differences between various
- * DV flavors. For now it's primarily used for differentiating
- * 525/60 and 625/50, but the plans are to use it for various
- * DV specs as well (e.g. SMPTE314M vs. IEC 61834).
- */
-typedef struct DVprofile {
- int dsf; /* value of the dsf in the DV header */
- int frame_size; /* total size of one frame in bytes */
- int difseg_size; /* number of DIF segments per DIF channel */
- int n_difchan; /* number of DIF channels per frame */
- int frame_rate;
- int frame_rate_base;
- int ltc_divisor; /* FPS from the LTS standpoint */
- int height; /* picture height in pixels */
- int width; /* picture width in pixels */
- AVRational sar[2]; /* sample aspect ratios for 4:3 and 16:9 */
- const uint16_t *video_place; /* positions of all DV macro blocks */
- enum PixelFormat pix_fmt; /* picture pixel format */
-
- int audio_stride; /* size of audio_shuffle table */
- int audio_min_samples[3];/* min ammount of audio samples */
- /* for 48Khz, 44.1Khz and 32Khz */
- int audio_samples_dist[5];/* how many samples are supposed to be */
- /* in each frame in a 5 frames window */
- const uint8_t (*audio_shuffle)[9]; /* PCM shuffling table */
-} DVprofile;
-
-#define NB_DV_VLC 409
-
-/*
- * There's a catch about the following three tables: the mapping they establish
- * between (run, level) and vlc is not 1-1. So you have to watch out for that
- * when building misc. tables. E.g. (1, 0) can be either 0x7cf or 0x1f82.
- */
-static const uint16_t dv_vlc_bits[409] = {
- 0x0000, 0x0002, 0x0007, 0x0008, 0x0009, 0x0014, 0x0015, 0x0016,
- 0x0017, 0x0030, 0x0031, 0x0032, 0x0033, 0x0068, 0x0069, 0x006a,
- 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x00e0, 0x00e1, 0x00e2,
- 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea,
- 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 0x01e0, 0x01e1, 0x01e2,
- 0x01e3, 0x01e4, 0x01e5, 0x01e6, 0x01e7, 0x01e8, 0x01e9, 0x01ea,
- 0x01eb, 0x01ec, 0x01ed, 0x01ee, 0x01ef, 0x03e0, 0x03e1, 0x03e2,
- 0x03e3, 0x03e4, 0x03e5, 0x03e6, 0x07ce, 0x07cf, 0x07d0, 0x07d1,
- 0x07d2, 0x07d3, 0x07d4, 0x07d5, 0x0fac, 0x0fad, 0x0fae, 0x0faf,
- 0x0fb0, 0x0fb1, 0x0fb2, 0x0fb3, 0x0fb4, 0x0fb5, 0x0fb6, 0x0fb7,
- 0x0fb8, 0x0fb9, 0x0fba, 0x0fbb, 0x0fbc, 0x0fbd, 0x0fbe, 0x0fbf,
- 0x1f80, 0x1f81, 0x1f82, 0x1f83, 0x1f84, 0x1f85, 0x1f86, 0x1f87,
- 0x1f88, 0x1f89, 0x1f8a, 0x1f8b, 0x1f8c, 0x1f8d, 0x1f8e, 0x1f8f,
- 0x1f90, 0x1f91, 0x1f92, 0x1f93, 0x1f94, 0x1f95, 0x1f96, 0x1f97,
- 0x1f98, 0x1f99, 0x1f9a, 0x1f9b, 0x1f9c, 0x1f9d, 0x1f9e, 0x1f9f,
- 0x1fa0, 0x1fa1, 0x1fa2, 0x1fa3, 0x1fa4, 0x1fa5, 0x1fa6, 0x1fa7,
- 0x1fa8, 0x1fa9, 0x1faa, 0x1fab, 0x1fac, 0x1fad, 0x1fae, 0x1faf,
- 0x1fb0, 0x1fb1, 0x1fb2, 0x1fb3, 0x1fb4, 0x1fb5, 0x1fb6, 0x1fb7,
- 0x1fb8, 0x1fb9, 0x1fba, 0x1fbb, 0x1fbc, 0x1fbd, 0x1fbe, 0x1fbf,
- 0x7f00, 0x7f01, 0x7f02, 0x7f03, 0x7f04, 0x7f05, 0x7f06, 0x7f07,
- 0x7f08, 0x7f09, 0x7f0a, 0x7f0b, 0x7f0c, 0x7f0d, 0x7f0e, 0x7f0f,
- 0x7f10, 0x7f11, 0x7f12, 0x7f13, 0x7f14, 0x7f15, 0x7f16, 0x7f17,
- 0x7f18, 0x7f19, 0x7f1a, 0x7f1b, 0x7f1c, 0x7f1d, 0x7f1e, 0x7f1f,
- 0x7f20, 0x7f21, 0x7f22, 0x7f23, 0x7f24, 0x7f25, 0x7f26, 0x7f27,
- 0x7f28, 0x7f29, 0x7f2a, 0x7f2b, 0x7f2c, 0x7f2d, 0x7f2e, 0x7f2f,
- 0x7f30, 0x7f31, 0x7f32, 0x7f33, 0x7f34, 0x7f35, 0x7f36, 0x7f37,
- 0x7f38, 0x7f39, 0x7f3a, 0x7f3b, 0x7f3c, 0x7f3d, 0x7f3e, 0x7f3f,
- 0x7f40, 0x7f41, 0x7f42, 0x7f43, 0x7f44, 0x7f45, 0x7f46, 0x7f47,
- 0x7f48, 0x7f49, 0x7f4a, 0x7f4b, 0x7f4c, 0x7f4d, 0x7f4e, 0x7f4f,
- 0x7f50, 0x7f51, 0x7f52, 0x7f53, 0x7f54, 0x7f55, 0x7f56, 0x7f57,
- 0x7f58, 0x7f59, 0x7f5a, 0x7f5b, 0x7f5c, 0x7f5d, 0x7f5e, 0x7f5f,
- 0x7f60, 0x7f61, 0x7f62, 0x7f63, 0x7f64, 0x7f65, 0x7f66, 0x7f67,
- 0x7f68, 0x7f69, 0x7f6a, 0x7f6b, 0x7f6c, 0x7f6d, 0x7f6e, 0x7f6f,
- 0x7f70, 0x7f71, 0x7f72, 0x7f73, 0x7f74, 0x7f75, 0x7f76, 0x7f77,
- 0x7f78, 0x7f79, 0x7f7a, 0x7f7b, 0x7f7c, 0x7f7d, 0x7f7e, 0x7f7f,
- 0x7f80, 0x7f81, 0x7f82, 0x7f83, 0x7f84, 0x7f85, 0x7f86, 0x7f87,
- 0x7f88, 0x7f89, 0x7f8a, 0x7f8b, 0x7f8c, 0x7f8d, 0x7f8e, 0x7f8f,
- 0x7f90, 0x7f91, 0x7f92, 0x7f93, 0x7f94, 0x7f95, 0x7f96, 0x7f97,
- 0x7f98, 0x7f99, 0x7f9a, 0x7f9b, 0x7f9c, 0x7f9d, 0x7f9e, 0x7f9f,
- 0x7fa0, 0x7fa1, 0x7fa2, 0x7fa3, 0x7fa4, 0x7fa5, 0x7fa6, 0x7fa7,
- 0x7fa8, 0x7fa9, 0x7faa, 0x7fab, 0x7fac, 0x7fad, 0x7fae, 0x7faf,
- 0x7fb0, 0x7fb1, 0x7fb2, 0x7fb3, 0x7fb4, 0x7fb5, 0x7fb6, 0x7fb7,
- 0x7fb8, 0x7fb9, 0x7fba, 0x7fbb, 0x7fbc, 0x7fbd, 0x7fbe, 0x7fbf,
- 0x7fc0, 0x7fc1, 0x7fc2, 0x7fc3, 0x7fc4, 0x7fc5, 0x7fc6, 0x7fc7,
- 0x7fc8, 0x7fc9, 0x7fca, 0x7fcb, 0x7fcc, 0x7fcd, 0x7fce, 0x7fcf,
- 0x7fd0, 0x7fd1, 0x7fd2, 0x7fd3, 0x7fd4, 0x7fd5, 0x7fd6, 0x7fd7,
- 0x7fd8, 0x7fd9, 0x7fda, 0x7fdb, 0x7fdc, 0x7fdd, 0x7fde, 0x7fdf,
- 0x7fe0, 0x7fe1, 0x7fe2, 0x7fe3, 0x7fe4, 0x7fe5, 0x7fe6, 0x7fe7,
- 0x7fe8, 0x7fe9, 0x7fea, 0x7feb, 0x7fec, 0x7fed, 0x7fee, 0x7fef,
- 0x7ff0, 0x7ff1, 0x7ff2, 0x7ff3, 0x7ff4, 0x7ff5, 0x7ff6, 0x7ff7,
- 0x7ff8, 0x7ff9, 0x7ffa, 0x7ffb, 0x7ffc, 0x7ffd, 0x7ffe, 0x7fff,
- 0x0006,
-};
-
-static const uint8_t dv_vlc_len[409] = {
- 2, 3, 4, 4, 4, 5, 5, 5,
- 5, 6, 6, 6, 6, 7, 7, 7,
- 7, 7, 7, 7, 7, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 10, 10, 10,
- 10, 10, 10, 10, 11, 11, 11, 11,
- 11, 11, 11, 11, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 4,
-};
-
-static const uint8_t dv_vlc_run[409] = {
- 0, 0, 1, 0, 0, 2, 1, 0,
- 0, 3, 4, 0, 0, 5, 6, 2,
- 1, 1, 0, 0, 0, 7, 8, 9,
- 10, 3, 4, 2, 1, 1, 1, 0,
- 0, 0, 0, 0, 0, 11, 12, 13,
- 14, 5, 6, 3, 4, 2, 2, 1,
- 0, 0, 0, 0, 0, 5, 3, 3,
- 2, 1, 1, 1, 0, 1, 6, 4,
- 3, 1, 1, 1, 2, 3, 4, 5,
- 7, 8, 9, 10, 7, 8, 4, 3,
- 2, 2, 2, 2, 2, 1, 1, 1,
- 0, 1, 2, 3, 4, 5, 6, 7,
- 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23,
- 24, 25, 26, 27, 28, 29, 30, 31,
- 32, 33, 34, 35, 36, 37, 38, 39,
- 40, 41, 42, 43, 44, 45, 46, 47,
- 48, 49, 50, 51, 52, 53, 54, 55,
- 56, 57, 58, 59, 60, 61, 62, 63,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-127,
-};
-
-static const uint8_t dv_vlc_level[409] = {
- 1, 2, 1, 3, 4, 1, 2, 5,
- 6, 1, 1, 7, 8, 1, 1, 2,
- 3, 4, 9, 10, 11, 1, 1, 1,
- 1, 2, 2, 3, 5, 6, 7, 12,
- 13, 14, 15, 16, 17, 1, 1, 1,
- 1, 2, 2, 3, 3, 4, 5, 8,
- 18, 19, 20, 21, 22, 3, 4, 5,
- 6, 9, 10, 11, 0, 0, 3, 4,
- 6, 12, 13, 14, 0, 0, 0, 0,
- 2, 2, 2, 2, 3, 3, 5, 7,
- 7, 8, 9, 10, 11, 15, 16, 17,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 2, 3, 4, 5, 6, 7,
- 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23,
- 24, 25, 26, 27, 28, 29, 30, 31,
- 32, 33, 34, 35, 36, 37, 38, 39,
- 40, 41, 42, 43, 44, 45, 46, 47,
- 48, 49, 50, 51, 52, 53, 54, 55,
- 56, 57, 58, 59, 60, 61, 62, 63,
- 64, 65, 66, 67, 68, 69, 70, 71,
- 72, 73, 74, 75, 76, 77, 78, 79,
- 80, 81, 82, 83, 84, 85, 86, 87,
- 88, 89, 90, 91, 92, 93, 94, 95,
- 96, 97, 98, 99, 100, 101, 102, 103,
- 104, 105, 106, 107, 108, 109, 110, 111,
- 112, 113, 114, 115, 116, 117, 118, 119,
- 120, 121, 122, 123, 124, 125, 126, 127,
- 128, 129, 130, 131, 132, 133, 134, 135,
- 136, 137, 138, 139, 140, 141, 142, 143,
- 144, 145, 146, 147, 148, 149, 150, 151,
- 152, 153, 154, 155, 156, 157, 158, 159,
- 160, 161, 162, 163, 164, 165, 166, 167,
- 168, 169, 170, 171, 172, 173, 174, 175,
- 176, 177, 178, 179, 180, 181, 182, 183,
- 184, 185, 186, 187, 188, 189, 190, 191,
- 192, 193, 194, 195, 196, 197, 198, 199,
- 200, 201, 202, 203, 204, 205, 206, 207,
- 208, 209, 210, 211, 212, 213, 214, 215,
- 216, 217, 218, 219, 220, 221, 222, 223,
- 224, 225, 226, 227, 228, 229, 230, 231,
- 232, 233, 234, 235, 236, 237, 238, 239,
- 240, 241, 242, 243, 244, 245, 246, 247,
- 248, 249, 250, 251, 252, 253, 254, 255,
- 0,
-};
-
-/* unquant tables (not used directly) */
-static const uint8_t dv_88_areas[64] = {
- 0,0,0,1,1,1,2,2,
- 0,0,1,1,1,2,2,2,
- 0,1,1,1,2,2,2,3,
- 1,1,1,2,2,2,3,3,
- 1,1,2,2,2,3,3,3,
- 1,2,2,2,3,3,3,3,
- 2,2,2,3,3,3,3,3,
- 2,2,3,3,3,3,3,3,
-};
-
-static const uint8_t dv_248_areas[64] = {
- 0,0,1,1,1,2,2,3,
- 0,0,1,1,2,2,2,3,
- 0,1,1,2,2,2,3,3,
- 0,1,1,2,2,2,3,3,
- 1,1,2,2,2,3,3,3,
- 1,1,2,2,2,3,3,3,
- 1,2,2,2,3,3,3,3,
- 1,2,2,3,3,3,3,3,
-};
-
-static const uint8_t dv_quant_shifts[22][4] = {
- { 3,3,4,4 },
- { 3,3,4,4 },
- { 2,3,3,4 },
- { 2,3,3,4 },
- { 2,2,3,3 },
- { 2,2,3,3 },
- { 1,2,2,3 },
- { 1,2,2,3 },
- { 1,1,2,2 },
- { 1,1,2,2 },
- { 0,1,1,2 },
- { 0,1,1,2 },
- { 0,0,1,1 },
- { 0,0,1,1 },
- { 0,0,0,1 },
- { 0,0,0,0 },
- { 0,0,0,0 },
- { 0,0,0,0 },
- { 0,0,0,0 },
- { 0,0,0,0 },
- { 0,0,0,0 },
- { 0,0,0,0 },
-};
-
-static const uint8_t dv_quant_offset[4] = { 6, 3, 0, 1 };
-
-/* NOTE: I prefer hardcoding the positionning of dv blocks, it is
- simpler :-) */
-
-static const uint16_t dv_place_420[1620] = {
- 0x0c24, 0x2412, 0x3036, 0x0000, 0x1848,
- 0x0e24, 0x2612, 0x3236, 0x0200, 0x1a48,
- 0x1024, 0x2812, 0x3436, 0x0400, 0x1c48,
- 0x1026, 0x2814, 0x3438, 0x0402, 0x1c4a,
- 0x0e26, 0x2614, 0x3238, 0x0202, 0x1a4a,
- 0x0c26, 0x2414, 0x3038, 0x0002, 0x184a,
- 0x0c28, 0x2416, 0x303a, 0x0004, 0x184c,
- 0x0e28, 0x2616, 0x323a, 0x0204, 0x1a4c,
- 0x1028, 0x2816, 0x343a, 0x0404, 0x1c4c,
- 0x102a, 0x2818, 0x343c, 0x0406, 0x1c4e,
- 0x0e2a, 0x2618, 0x323c, 0x0206, 0x1a4e,
- 0x0c2a, 0x2418, 0x303c, 0x0006, 0x184e,
- 0x0c2c, 0x241a, 0x303e, 0x0008, 0x1850,
- 0x0e2c, 0x261a, 0x323e, 0x0208, 0x1a50,
- 0x102c, 0x281a, 0x343e, 0x0408, 0x1c50,
- 0x102e, 0x281c, 0x3440, 0x040a, 0x1c52,
- 0x0e2e, 0x261c, 0x3240, 0x020a, 0x1a52,
- 0x0c2e, 0x241c, 0x3040, 0x000a, 0x1852,
- 0x0c30, 0x241e, 0x3042, 0x000c, 0x1854,
- 0x0e30, 0x261e, 0x3242, 0x020c, 0x1a54,
- 0x1030, 0x281e, 0x3442, 0x040c, 0x1c54,
- 0x1032, 0x2820, 0x3444, 0x040e, 0x1c56,
- 0x0e32, 0x2620, 0x3244, 0x020e, 0x1a56,
- 0x0c32, 0x2420, 0x3044, 0x000e, 0x1856,
- 0x0c34, 0x2422, 0x3046, 0x0010, 0x1858,
- 0x0e34, 0x2622, 0x3246, 0x0210, 0x1a58,
- 0x1034, 0x2822, 0x3446, 0x0410, 0x1c58,
- 0x1224, 0x2a12, 0x3636, 0x0600, 0x1e48,
- 0x1424, 0x2c12, 0x3836, 0x0800, 0x2048,
- 0x1624, 0x2e12, 0x3a36, 0x0a00, 0x2248,
- 0x1626, 0x2e14, 0x3a38, 0x0a02, 0x224a,
- 0x1426, 0x2c14, 0x3838, 0x0802, 0x204a,
- 0x1226, 0x2a14, 0x3638, 0x0602, 0x1e4a,
- 0x1228, 0x2a16, 0x363a, 0x0604, 0x1e4c,
- 0x1428, 0x2c16, 0x383a, 0x0804, 0x204c,
- 0x1628, 0x2e16, 0x3a3a, 0x0a04, 0x224c,
- 0x162a, 0x2e18, 0x3a3c, 0x0a06, 0x224e,
- 0x142a, 0x2c18, 0x383c, 0x0806, 0x204e,
- 0x122a, 0x2a18, 0x363c, 0x0606, 0x1e4e,
- 0x122c, 0x2a1a, 0x363e, 0x0608, 0x1e50,
- 0x142c, 0x2c1a, 0x383e, 0x0808, 0x2050,
- 0x162c, 0x2e1a, 0x3a3e, 0x0a08, 0x2250,
- 0x162e, 0x2e1c, 0x3a40, 0x0a0a, 0x2252,
- 0x142e, 0x2c1c, 0x3840, 0x080a, 0x2052,
- 0x122e, 0x2a1c, 0x3640, 0x060a, 0x1e52,
- 0x1230, 0x2a1e, 0x3642, 0x060c, 0x1e54,
- 0x1430, 0x2c1e, 0x3842, 0x080c, 0x2054,
- 0x1630, 0x2e1e, 0x3a42, 0x0a0c, 0x2254,
- 0x1632, 0x2e20, 0x3a44, 0x0a0e, 0x2256,
- 0x1432, 0x2c20, 0x3844, 0x080e, 0x2056,
- 0x1232, 0x2a20, 0x3644, 0x060e, 0x1e56,
- 0x1234, 0x2a22, 0x3646, 0x0610, 0x1e58,
- 0x1434, 0x2c22, 0x3846, 0x0810, 0x2058,
- 0x1634, 0x2e22, 0x3a46, 0x0a10, 0x2258,
- 0x1824, 0x3012, 0x3c36, 0x0c00, 0x2448,
- 0x1a24, 0x3212, 0x3e36, 0x0e00, 0x2648,
- 0x1c24, 0x3412, 0x4036, 0x1000, 0x2848,
- 0x1c26, 0x3414, 0x4038, 0x1002, 0x284a,
- 0x1a26, 0x3214, 0x3e38, 0x0e02, 0x264a,
- 0x1826, 0x3014, 0x3c38, 0x0c02, 0x244a,
- 0x1828, 0x3016, 0x3c3a, 0x0c04, 0x244c,
- 0x1a28, 0x3216, 0x3e3a, 0x0e04, 0x264c,
- 0x1c28, 0x3416, 0x403a, 0x1004, 0x284c,
- 0x1c2a, 0x3418, 0x403c, 0x1006, 0x284e,
- 0x1a2a, 0x3218, 0x3e3c, 0x0e06, 0x264e,
- 0x182a, 0x3018, 0x3c3c, 0x0c06, 0x244e,
- 0x182c, 0x301a, 0x3c3e, 0x0c08, 0x2450,
- 0x1a2c, 0x321a, 0x3e3e, 0x0e08, 0x2650,
- 0x1c2c, 0x341a, 0x403e, 0x1008, 0x2850,
- 0x1c2e, 0x341c, 0x4040, 0x100a, 0x2852,
- 0x1a2e, 0x321c, 0x3e40, 0x0e0a, 0x2652,
- 0x182e, 0x301c, 0x3c40, 0x0c0a, 0x2452,
- 0x1830, 0x301e, 0x3c42, 0x0c0c, 0x2454,
- 0x1a30, 0x321e, 0x3e42, 0x0e0c, 0x2654,
- 0x1c30, 0x341e, 0x4042, 0x100c, 0x2854,
- 0x1c32, 0x3420, 0x4044, 0x100e, 0x2856,
- 0x1a32, 0x3220, 0x3e44, 0x0e0e, 0x2656,
- 0x1832, 0x3020, 0x3c44, 0x0c0e, 0x2456,
- 0x1834, 0x3022, 0x3c46, 0x0c10, 0x2458,
- 0x1a34, 0x3222, 0x3e46, 0x0e10, 0x2658,
- 0x1c34, 0x3422, 0x4046, 0x1010, 0x2858,
- 0x1e24, 0x3612, 0x4236, 0x1200, 0x2a48,
- 0x2024, 0x3812, 0x4436, 0x1400, 0x2c48,
- 0x2224, 0x3a12, 0x4636, 0x1600, 0x2e48,
- 0x2226, 0x3a14, 0x4638, 0x1602, 0x2e4a,
- 0x2026, 0x3814, 0x4438, 0x1402, 0x2c4a,
- 0x1e26, 0x3614, 0x4238, 0x1202, 0x2a4a,
- 0x1e28, 0x3616, 0x423a, 0x1204, 0x2a4c,
- 0x2028, 0x3816, 0x443a, 0x1404, 0x2c4c,
- 0x2228, 0x3a16, 0x463a, 0x1604, 0x2e4c,
- 0x222a, 0x3a18, 0x463c, 0x1606, 0x2e4e,
- 0x202a, 0x3818, 0x443c, 0x1406, 0x2c4e,
- 0x1e2a, 0x3618, 0x423c, 0x1206, 0x2a4e,
- 0x1e2c, 0x361a, 0x423e, 0x1208, 0x2a50,
- 0x202c, 0x381a, 0x443e, 0x1408, 0x2c50,
- 0x222c, 0x3a1a, 0x463e, 0x1608, 0x2e50,
- 0x222e, 0x3a1c, 0x4640, 0x160a, 0x2e52,
- 0x202e, 0x381c, 0x4440, 0x140a, 0x2c52,
- 0x1e2e, 0x361c, 0x4240, 0x120a, 0x2a52,
- 0x1e30, 0x361e, 0x4242, 0x120c, 0x2a54,
- 0x2030, 0x381e, 0x4442, 0x140c, 0x2c54,
- 0x2230, 0x3a1e, 0x4642, 0x160c, 0x2e54,
- 0x2232, 0x3a20, 0x4644, 0x160e, 0x2e56,
- 0x2032, 0x3820, 0x4444, 0x140e, 0x2c56,
- 0x1e32, 0x3620, 0x4244, 0x120e, 0x2a56,
- 0x1e34, 0x3622, 0x4246, 0x1210, 0x2a58,
- 0x2034, 0x3822, 0x4446, 0x1410, 0x2c58,
- 0x2234, 0x3a22, 0x4646, 0x1610, 0x2e58,
- 0x2424, 0x3c12, 0x0036, 0x1800, 0x3048,
- 0x2624, 0x3e12, 0x0236, 0x1a00, 0x3248,
- 0x2824, 0x4012, 0x0436, 0x1c00, 0x3448,
- 0x2826, 0x4014, 0x0438, 0x1c02, 0x344a,
- 0x2626, 0x3e14, 0x0238, 0x1a02, 0x324a,
- 0x2426, 0x3c14, 0x0038, 0x1802, 0x304a,
- 0x2428, 0x3c16, 0x003a, 0x1804, 0x304c,
- 0x2628, 0x3e16, 0x023a, 0x1a04, 0x324c,
- 0x2828, 0x4016, 0x043a, 0x1c04, 0x344c,
- 0x282a, 0x4018, 0x043c, 0x1c06, 0x344e,
- 0x262a, 0x3e18, 0x023c, 0x1a06, 0x324e,
- 0x242a, 0x3c18, 0x003c, 0x1806, 0x304e,
- 0x242c, 0x3c1a, 0x003e, 0x1808, 0x3050,
- 0x262c, 0x3e1a, 0x023e, 0x1a08, 0x3250,
- 0x282c, 0x401a, 0x043e, 0x1c08, 0x3450,
- 0x282e, 0x401c, 0x0440, 0x1c0a, 0x3452,
- 0x262e, 0x3e1c, 0x0240, 0x1a0a, 0x3252,
- 0x242e, 0x3c1c, 0x0040, 0x180a, 0x3052,
- 0x2430, 0x3c1e, 0x0042, 0x180c, 0x3054,
- 0x2630, 0x3e1e, 0x0242, 0x1a0c, 0x3254,
- 0x2830, 0x401e, 0x0442, 0x1c0c, 0x3454,
- 0x2832, 0x4020, 0x0444, 0x1c0e, 0x3456,
- 0x2632, 0x3e20, 0x0244, 0x1a0e, 0x3256,
- 0x2432, 0x3c20, 0x0044, 0x180e, 0x3056,
- 0x2434, 0x3c22, 0x0046, 0x1810, 0x3058,
- 0x2634, 0x3e22, 0x0246, 0x1a10, 0x3258,
- 0x2834, 0x4022, 0x0446, 0x1c10, 0x3458,
- 0x2a24, 0x4212, 0x0636, 0x1e00, 0x3648,
- 0x2c24, 0x4412, 0x0836, 0x2000, 0x3848,
- 0x2e24, 0x4612, 0x0a36, 0x2200, 0x3a48,
- 0x2e26, 0x4614, 0x0a38, 0x2202, 0x3a4a,
- 0x2c26, 0x4414, 0x0838, 0x2002, 0x384a,
- 0x2a26, 0x4214, 0x0638, 0x1e02, 0x364a,
- 0x2a28, 0x4216, 0x063a, 0x1e04, 0x364c,
- 0x2c28, 0x4416, 0x083a, 0x2004, 0x384c,
- 0x2e28, 0x4616, 0x0a3a, 0x2204, 0x3a4c,
- 0x2e2a, 0x4618, 0x0a3c, 0x2206, 0x3a4e,
- 0x2c2a, 0x4418, 0x083c, 0x2006, 0x384e,
- 0x2a2a, 0x4218, 0x063c, 0x1e06, 0x364e,
- 0x2a2c, 0x421a, 0x063e, 0x1e08, 0x3650,
- 0x2c2c, 0x441a, 0x083e, 0x2008, 0x3850,
- 0x2e2c, 0x461a, 0x0a3e, 0x2208, 0x3a50,
- 0x2e2e, 0x461c, 0x0a40, 0x220a, 0x3a52,
- 0x2c2e, 0x441c, 0x0840, 0x200a, 0x3852,
- 0x2a2e, 0x421c, 0x0640, 0x1e0a, 0x3652,
- 0x2a30, 0x421e, 0x0642, 0x1e0c, 0x3654,
- 0x2c30, 0x441e, 0x0842, 0x200c, 0x3854,
- 0x2e30, 0x461e, 0x0a42, 0x220c, 0x3a54,
- 0x2e32, 0x4620, 0x0a44, 0x220e, 0x3a56,
- 0x2c32, 0x4420, 0x0844, 0x200e, 0x3856,
- 0x2a32, 0x4220, 0x0644, 0x1e0e, 0x3656,
- 0x2a34, 0x4222, 0x0646, 0x1e10, 0x3658,
- 0x2c34, 0x4422, 0x0846, 0x2010, 0x3858,
- 0x2e34, 0x4622, 0x0a46, 0x2210, 0x3a58,
- 0x3024, 0x0012, 0x0c36, 0x2400, 0x3c48,
- 0x3224, 0x0212, 0x0e36, 0x2600, 0x3e48,
- 0x3424, 0x0412, 0x1036, 0x2800, 0x4048,
- 0x3426, 0x0414, 0x1038, 0x2802, 0x404a,
- 0x3226, 0x0214, 0x0e38, 0x2602, 0x3e4a,
- 0x3026, 0x0014, 0x0c38, 0x2402, 0x3c4a,
- 0x3028, 0x0016, 0x0c3a, 0x2404, 0x3c4c,
- 0x3228, 0x0216, 0x0e3a, 0x2604, 0x3e4c,
- 0x3428, 0x0416, 0x103a, 0x2804, 0x404c,
- 0x342a, 0x0418, 0x103c, 0x2806, 0x404e,
- 0x322a, 0x0218, 0x0e3c, 0x2606, 0x3e4e,
- 0x302a, 0x0018, 0x0c3c, 0x2406, 0x3c4e,
- 0x302c, 0x001a, 0x0c3e, 0x2408, 0x3c50,
- 0x322c, 0x021a, 0x0e3e, 0x2608, 0x3e50,
- 0x342c, 0x041a, 0x103e, 0x2808, 0x4050,
- 0x342e, 0x041c, 0x1040, 0x280a, 0x4052,
- 0x322e, 0x021c, 0x0e40, 0x260a, 0x3e52,
- 0x302e, 0x001c, 0x0c40, 0x240a, 0x3c52,
- 0x3030, 0x001e, 0x0c42, 0x240c, 0x3c54,
- 0x3230, 0x021e, 0x0e42, 0x260c, 0x3e54,
- 0x3430, 0x041e, 0x1042, 0x280c, 0x4054,
- 0x3432, 0x0420, 0x1044, 0x280e, 0x4056,
- 0x3232, 0x0220, 0x0e44, 0x260e, 0x3e56,
- 0x3032, 0x0020, 0x0c44, 0x240e, 0x3c56,
- 0x3034, 0x0022, 0x0c46, 0x2410, 0x3c58,
- 0x3234, 0x0222, 0x0e46, 0x2610, 0x3e58,
- 0x3434, 0x0422, 0x1046, 0x2810, 0x4058,
- 0x3624, 0x0612, 0x1236, 0x2a00, 0x4248,
- 0x3824, 0x0812, 0x1436, 0x2c00, 0x4448,
- 0x3a24, 0x0a12, 0x1636, 0x2e00, 0x4648,
- 0x3a26, 0x0a14, 0x1638, 0x2e02, 0x464a,
- 0x3826, 0x0814, 0x1438, 0x2c02, 0x444a,
- 0x3626, 0x0614, 0x1238, 0x2a02, 0x424a,
- 0x3628, 0x0616, 0x123a, 0x2a04, 0x424c,
- 0x3828, 0x0816, 0x143a, 0x2c04, 0x444c,
- 0x3a28, 0x0a16, 0x163a, 0x2e04, 0x464c,
- 0x3a2a, 0x0a18, 0x163c, 0x2e06, 0x464e,
- 0x382a, 0x0818, 0x143c, 0x2c06, 0x444e,
- 0x362a, 0x0618, 0x123c, 0x2a06, 0x424e,
- 0x362c, 0x061a, 0x123e, 0x2a08, 0x4250,
- 0x382c, 0x081a, 0x143e, 0x2c08, 0x4450,
- 0x3a2c, 0x0a1a, 0x163e, 0x2e08, 0x4650,
- 0x3a2e, 0x0a1c, 0x1640, 0x2e0a, 0x4652,
- 0x382e, 0x081c, 0x1440, 0x2c0a, 0x4452,
- 0x362e, 0x061c, 0x1240, 0x2a0a, 0x4252,
- 0x3630, 0x061e, 0x1242, 0x2a0c, 0x4254,
- 0x3830, 0x081e, 0x1442, 0x2c0c, 0x4454,
- 0x3a30, 0x0a1e, 0x1642, 0x2e0c, 0x4654,
- 0x3a32, 0x0a20, 0x1644, 0x2e0e, 0x4656,
- 0x3832, 0x0820, 0x1444, 0x2c0e, 0x4456,
- 0x3632, 0x0620, 0x1244, 0x2a0e, 0x4256,
- 0x3634, 0x0622, 0x1246, 0x2a10, 0x4258,
- 0x3834, 0x0822, 0x1446, 0x2c10, 0x4458,
- 0x3a34, 0x0a22, 0x1646, 0x2e10, 0x4658,
- 0x3c24, 0x0c12, 0x1836, 0x3000, 0x0048,
- 0x3e24, 0x0e12, 0x1a36, 0x3200, 0x0248,
- 0x4024, 0x1012, 0x1c36, 0x3400, 0x0448,
- 0x4026, 0x1014, 0x1c38, 0x3402, 0x044a,
- 0x3e26, 0x0e14, 0x1a38, 0x3202, 0x024a,
- 0x3c26, 0x0c14, 0x1838, 0x3002, 0x004a,
- 0x3c28, 0x0c16, 0x183a, 0x3004, 0x004c,
- 0x3e28, 0x0e16, 0x1a3a, 0x3204, 0x024c,
- 0x4028, 0x1016, 0x1c3a, 0x3404, 0x044c,
- 0x402a, 0x1018, 0x1c3c, 0x3406, 0x044e,
- 0x3e2a, 0x0e18, 0x1a3c, 0x3206, 0x024e,
- 0x3c2a, 0x0c18, 0x183c, 0x3006, 0x004e,
- 0x3c2c, 0x0c1a, 0x183e, 0x3008, 0x0050,
- 0x3e2c, 0x0e1a, 0x1a3e, 0x3208, 0x0250,
- 0x402c, 0x101a, 0x1c3e, 0x3408, 0x0450,
- 0x402e, 0x101c, 0x1c40, 0x340a, 0x0452,
- 0x3e2e, 0x0e1c, 0x1a40, 0x320a, 0x0252,
- 0x3c2e, 0x0c1c, 0x1840, 0x300a, 0x0052,
- 0x3c30, 0x0c1e, 0x1842, 0x300c, 0x0054,
- 0x3e30, 0x0e1e, 0x1a42, 0x320c, 0x0254,
- 0x4030, 0x101e, 0x1c42, 0x340c, 0x0454,
- 0x4032, 0x1020, 0x1c44, 0x340e, 0x0456,
- 0x3e32, 0x0e20, 0x1a44, 0x320e, 0x0256,
- 0x3c32, 0x0c20, 0x1844, 0x300e, 0x0056,
- 0x3c34, 0x0c22, 0x1846, 0x3010, 0x0058,
- 0x3e34, 0x0e22, 0x1a46, 0x3210, 0x0258,
- 0x4034, 0x1022, 0x1c46, 0x3410, 0x0458,
- 0x4224, 0x1212, 0x1e36, 0x3600, 0x0648,
- 0x4424, 0x1412, 0x2036, 0x3800, 0x0848,
- 0x4624, 0x1612, 0x2236, 0x3a00, 0x0a48,
- 0x4626, 0x1614, 0x2238, 0x3a02, 0x0a4a,
- 0x4426, 0x1414, 0x2038, 0x3802, 0x084a,
- 0x4226, 0x1214, 0x1e38, 0x3602, 0x064a,
- 0x4228, 0x1216, 0x1e3a, 0x3604, 0x064c,
- 0x4428, 0x1416, 0x203a, 0x3804, 0x084c,
- 0x4628, 0x1616, 0x223a, 0x3a04, 0x0a4c,
- 0x462a, 0x1618, 0x223c, 0x3a06, 0x0a4e,
- 0x442a, 0x1418, 0x203c, 0x3806, 0x084e,
- 0x422a, 0x1218, 0x1e3c, 0x3606, 0x064e,
- 0x422c, 0x121a, 0x1e3e, 0x3608, 0x0650,
- 0x442c, 0x141a, 0x203e, 0x3808, 0x0850,
- 0x462c, 0x161a, 0x223e, 0x3a08, 0x0a50,
- 0x462e, 0x161c, 0x2240, 0x3a0a, 0x0a52,
- 0x442e, 0x141c, 0x2040, 0x380a, 0x0852,
- 0x422e, 0x121c, 0x1e40, 0x360a, 0x0652,
- 0x4230, 0x121e, 0x1e42, 0x360c, 0x0654,
- 0x4430, 0x141e, 0x2042, 0x380c, 0x0854,
- 0x4630, 0x161e, 0x2242, 0x3a0c, 0x0a54,
- 0x4632, 0x1620, 0x2244, 0x3a0e, 0x0a56,
- 0x4432, 0x1420, 0x2044, 0x380e, 0x0856,
- 0x4232, 0x1220, 0x1e44, 0x360e, 0x0656,
- 0x4234, 0x1222, 0x1e46, 0x3610, 0x0658,
- 0x4434, 0x1422, 0x2046, 0x3810, 0x0858,
- 0x4634, 0x1622, 0x2246, 0x3a10, 0x0a58,
- 0x0024, 0x1812, 0x2436, 0x3c00, 0x0c48,
- 0x0224, 0x1a12, 0x2636, 0x3e00, 0x0e48,
- 0x0424, 0x1c12, 0x2836, 0x4000, 0x1048,
- 0x0426, 0x1c14, 0x2838, 0x4002, 0x104a,
- 0x0226, 0x1a14, 0x2638, 0x3e02, 0x0e4a,
- 0x0026, 0x1814, 0x2438, 0x3c02, 0x0c4a,
- 0x0028, 0x1816, 0x243a, 0x3c04, 0x0c4c,
- 0x0228, 0x1a16, 0x263a, 0x3e04, 0x0e4c,
- 0x0428, 0x1c16, 0x283a, 0x4004, 0x104c,
- 0x042a, 0x1c18, 0x283c, 0x4006, 0x104e,
- 0x022a, 0x1a18, 0x263c, 0x3e06, 0x0e4e,
- 0x002a, 0x1818, 0x243c, 0x3c06, 0x0c4e,
- 0x002c, 0x181a, 0x243e, 0x3c08, 0x0c50,
- 0x022c, 0x1a1a, 0x263e, 0x3e08, 0x0e50,
- 0x042c, 0x1c1a, 0x283e, 0x4008, 0x1050,
- 0x042e, 0x1c1c, 0x2840, 0x400a, 0x1052,
- 0x022e, 0x1a1c, 0x2640, 0x3e0a, 0x0e52,
- 0x002e, 0x181c, 0x2440, 0x3c0a, 0x0c52,
- 0x0030, 0x181e, 0x2442, 0x3c0c, 0x0c54,
- 0x0230, 0x1a1e, 0x2642, 0x3e0c, 0x0e54,
- 0x0430, 0x1c1e, 0x2842, 0x400c, 0x1054,
- 0x0432, 0x1c20, 0x2844, 0x400e, 0x1056,
- 0x0232, 0x1a20, 0x2644, 0x3e0e, 0x0e56,
- 0x0032, 0x1820, 0x2444, 0x3c0e, 0x0c56,
- 0x0034, 0x1822, 0x2446, 0x3c10, 0x0c58,
- 0x0234, 0x1a22, 0x2646, 0x3e10, 0x0e58,
- 0x0434, 0x1c22, 0x2846, 0x4010, 0x1058,
- 0x0624, 0x1e12, 0x2a36, 0x4200, 0x1248,
- 0x0824, 0x2012, 0x2c36, 0x4400, 0x1448,
- 0x0a24, 0x2212, 0x2e36, 0x4600, 0x1648,
- 0x0a26, 0x2214, 0x2e38, 0x4602, 0x164a,
- 0x0826, 0x2014, 0x2c38, 0x4402, 0x144a,
- 0x0626, 0x1e14, 0x2a38, 0x4202, 0x124a,
- 0x0628, 0x1e16, 0x2a3a, 0x4204, 0x124c,
- 0x0828, 0x2016, 0x2c3a, 0x4404, 0x144c,
- 0x0a28, 0x2216, 0x2e3a, 0x4604, 0x164c,
- 0x0a2a, 0x2218, 0x2e3c, 0x4606, 0x164e,
- 0x082a, 0x2018, 0x2c3c, 0x4406, 0x144e,
- 0x062a, 0x1e18, 0x2a3c, 0x4206, 0x124e,
- 0x062c, 0x1e1a, 0x2a3e, 0x4208, 0x1250,
- 0x082c, 0x201a, 0x2c3e, 0x4408, 0x1450,
- 0x0a2c, 0x221a, 0x2e3e, 0x4608, 0x1650,
- 0x0a2e, 0x221c, 0x2e40, 0x460a, 0x1652,
- 0x082e, 0x201c, 0x2c40, 0x440a, 0x1452,
- 0x062e, 0x1e1c, 0x2a40, 0x420a, 0x1252,
- 0x0630, 0x1e1e, 0x2a42, 0x420c, 0x1254,
- 0x0830, 0x201e, 0x2c42, 0x440c, 0x1454,
- 0x0a30, 0x221e, 0x2e42, 0x460c, 0x1654,
- 0x0a32, 0x2220, 0x2e44, 0x460e, 0x1656,
- 0x0832, 0x2020, 0x2c44, 0x440e, 0x1456,
- 0x0632, 0x1e20, 0x2a44, 0x420e, 0x1256,
- 0x0634, 0x1e22, 0x2a46, 0x4210, 0x1258,
- 0x0834, 0x2022, 0x2c46, 0x4410, 0x1458,
- 0x0a34, 0x2222, 0x2e46, 0x4610, 0x1658,
-};
-
-static const uint16_t dv_place_411P[1620] = {
- 0x0c24, 0x2710, 0x3334, 0x0000, 0x1848,
- 0x0d24, 0x2810, 0x3434, 0x0100, 0x1948,
- 0x0e24, 0x2910, 0x3534, 0x0200, 0x1a48,
- 0x0f24, 0x2914, 0x3538, 0x0300, 0x1b48,
- 0x1024, 0x2814, 0x3438, 0x0400, 0x1c48,
- 0x1124, 0x2714, 0x3338, 0x0500, 0x1d48,
- 0x1128, 0x2614, 0x3238, 0x0504, 0x1d4c,
- 0x1028, 0x2514, 0x3138, 0x0404, 0x1c4c,
- 0x0f28, 0x2414, 0x3038, 0x0304, 0x1b4c,
- 0x0e28, 0x2418, 0x303c, 0x0204, 0x1a4c,
- 0x0d28, 0x2518, 0x313c, 0x0104, 0x194c,
- 0x0c28, 0x2618, 0x323c, 0x0004, 0x184c,
- 0x0c2c, 0x2718, 0x333c, 0x0008, 0x1850,
- 0x0d2c, 0x2818, 0x343c, 0x0108, 0x1950,
- 0x0e2c, 0x2918, 0x353c, 0x0208, 0x1a50,
- 0x0f2c, 0x291c, 0x3540, 0x0308, 0x1b50,
- 0x102c, 0x281c, 0x3440, 0x0408, 0x1c50,
- 0x112c, 0x271c, 0x3340, 0x0508, 0x1d50,
- 0x1130, 0x261c, 0x3240, 0x050c, 0x1d54,
- 0x1030, 0x251c, 0x3140, 0x040c, 0x1c54,
- 0x0f30, 0x241c, 0x3040, 0x030c, 0x1b54,
- 0x0e30, 0x2420, 0x3044, 0x020c, 0x1a54,
- 0x0d30, 0x2520, 0x3144, 0x010c, 0x1954,
- 0x0c30, 0x2620, 0x3244, 0x000c, 0x1854,
- 0x0c34, 0x2720, 0x3344, 0x0010, 0x1858,
- 0x0d34, 0x2820, 0x3444, 0x0110, 0x1a58,
- 0x0e34, 0x2920, 0x3544, 0x0210, 0x1c58,
- 0x1224, 0x2d10, 0x3934, 0x0600, 0x1e48,
- 0x1324, 0x2e10, 0x3a34, 0x0700, 0x1f48,
- 0x1424, 0x2f10, 0x3b34, 0x0800, 0x2048,
- 0x1524, 0x2f14, 0x3b38, 0x0900, 0x2148,
- 0x1624, 0x2e14, 0x3a38, 0x0a00, 0x2248,
- 0x1724, 0x2d14, 0x3938, 0x0b00, 0x2348,
- 0x1728, 0x2c14, 0x3838, 0x0b04, 0x234c,
- 0x1628, 0x2b14, 0x3738, 0x0a04, 0x224c,
- 0x1528, 0x2a14, 0x3638, 0x0904, 0x214c,
- 0x1428, 0x2a18, 0x363c, 0x0804, 0x204c,
- 0x1328, 0x2b18, 0x373c, 0x0704, 0x1f4c,
- 0x1228, 0x2c18, 0x383c, 0x0604, 0x1e4c,
- 0x122c, 0x2d18, 0x393c, 0x0608, 0x1e50,
- 0x132c, 0x2e18, 0x3a3c, 0x0708, 0x1f50,
- 0x142c, 0x2f18, 0x3b3c, 0x0808, 0x2050,
- 0x152c, 0x2f1c, 0x3b40, 0x0908, 0x2150,
- 0x162c, 0x2e1c, 0x3a40, 0x0a08, 0x2250,
- 0x172c, 0x2d1c, 0x3940, 0x0b08, 0x2350,
- 0x1730, 0x2c1c, 0x3840, 0x0b0c, 0x2354,
- 0x1630, 0x2b1c, 0x3740, 0x0a0c, 0x2254,
- 0x1530, 0x2a1c, 0x3640, 0x090c, 0x2154,
- 0x1430, 0x2a20, 0x3644, 0x080c, 0x2054,
- 0x1330, 0x2b20, 0x3744, 0x070c, 0x1f54,
- 0x1230, 0x2c20, 0x3844, 0x060c, 0x1e54,
- 0x1234, 0x2d20, 0x3944, 0x0610, 0x1e58,
- 0x1334, 0x2e20, 0x3a44, 0x0710, 0x2058,
- 0x1434, 0x2f20, 0x3b44, 0x0810, 0x2258,
- 0x1824, 0x3310, 0x3f34, 0x0c00, 0x2448,
- 0x1924, 0x3410, 0x4034, 0x0d00, 0x2548,
- 0x1a24, 0x3510, 0x4134, 0x0e00, 0x2648,
- 0x1b24, 0x3514, 0x4138, 0x0f00, 0x2748,
- 0x1c24, 0x3414, 0x4038, 0x1000, 0x2848,
- 0x1d24, 0x3314, 0x3f38, 0x1100, 0x2948,
- 0x1d28, 0x3214, 0x3e38, 0x1104, 0x294c,
- 0x1c28, 0x3114, 0x3d38, 0x1004, 0x284c,
- 0x1b28, 0x3014, 0x3c38, 0x0f04, 0x274c,
- 0x1a28, 0x3018, 0x3c3c, 0x0e04, 0x264c,
- 0x1928, 0x3118, 0x3d3c, 0x0d04, 0x254c,
- 0x1828, 0x3218, 0x3e3c, 0x0c04, 0x244c,
- 0x182c, 0x3318, 0x3f3c, 0x0c08, 0x2450,
- 0x192c, 0x3418, 0x403c, 0x0d08, 0x2550,
- 0x1a2c, 0x3518, 0x413c, 0x0e08, 0x2650,
- 0x1b2c, 0x351c, 0x4140, 0x0f08, 0x2750,
- 0x1c2c, 0x341c, 0x4040, 0x1008, 0x2850,
- 0x1d2c, 0x331c, 0x3f40, 0x1108, 0x2950,
- 0x1d30, 0x321c, 0x3e40, 0x110c, 0x2954,
- 0x1c30, 0x311c, 0x3d40, 0x100c, 0x2854,
- 0x1b30, 0x301c, 0x3c40, 0x0f0c, 0x2754,
- 0x1a30, 0x3020, 0x3c44, 0x0e0c, 0x2654,
- 0x1930, 0x3120, 0x3d44, 0x0d0c, 0x2554,
- 0x1830, 0x3220, 0x3e44, 0x0c0c, 0x2454,
- 0x1834, 0x3320, 0x3f44, 0x0c10, 0x2458,
- 0x1934, 0x3420, 0x4044, 0x0d10, 0x2658,
- 0x1a34, 0x3520, 0x4144, 0x0e10, 0x2858,
- 0x1e24, 0x3910, 0x4534, 0x1200, 0x2a48,
- 0x1f24, 0x3a10, 0x4634, 0x1300, 0x2b48,
- 0x2024, 0x3b10, 0x4734, 0x1400, 0x2c48,
- 0x2124, 0x3b14, 0x4738, 0x1500, 0x2d48,
- 0x2224, 0x3a14, 0x4638, 0x1600, 0x2e48,
- 0x2324, 0x3914, 0x4538, 0x1700, 0x2f48,
- 0x2328, 0x3814, 0x4438, 0x1704, 0x2f4c,
- 0x2228, 0x3714, 0x4338, 0x1604, 0x2e4c,
- 0x2128, 0x3614, 0x4238, 0x1504, 0x2d4c,
- 0x2028, 0x3618, 0x423c, 0x1404, 0x2c4c,
- 0x1f28, 0x3718, 0x433c, 0x1304, 0x2b4c,
- 0x1e28, 0x3818, 0x443c, 0x1204, 0x2a4c,
- 0x1e2c, 0x3918, 0x453c, 0x1208, 0x2a50,
- 0x1f2c, 0x3a18, 0x463c, 0x1308, 0x2b50,
- 0x202c, 0x3b18, 0x473c, 0x1408, 0x2c50,
- 0x212c, 0x3b1c, 0x4740, 0x1508, 0x2d50,
- 0x222c, 0x3a1c, 0x4640, 0x1608, 0x2e50,
- 0x232c, 0x391c, 0x4540, 0x1708, 0x2f50,
- 0x2330, 0x381c, 0x4440, 0x170c, 0x2f54,
- 0x2230, 0x371c, 0x4340, 0x160c, 0x2e54,
- 0x2130, 0x361c, 0x4240, 0x150c, 0x2d54,
- 0x2030, 0x3620, 0x4244, 0x140c, 0x2c54,
- 0x1f30, 0x3720, 0x4344, 0x130c, 0x2b54,
- 0x1e30, 0x3820, 0x4444, 0x120c, 0x2a54,
- 0x1e34, 0x3920, 0x4544, 0x1210, 0x2a58,
- 0x1f34, 0x3a20, 0x4644, 0x1310, 0x2c58,
- 0x2034, 0x3b20, 0x4744, 0x1410, 0x2e58,
- 0x2424, 0x3f10, 0x0334, 0x1800, 0x3048,
- 0x2524, 0x4010, 0x0434, 0x1900, 0x3148,
- 0x2624, 0x4110, 0x0534, 0x1a00, 0x3248,
- 0x2724, 0x4114, 0x0538, 0x1b00, 0x3348,
- 0x2824, 0x4014, 0x0438, 0x1c00, 0x3448,
- 0x2924, 0x3f14, 0x0338, 0x1d00, 0x3548,
- 0x2928, 0x3e14, 0x0238, 0x1d04, 0x354c,
- 0x2828, 0x3d14, 0x0138, 0x1c04, 0x344c,
- 0x2728, 0x3c14, 0x0038, 0x1b04, 0x334c,
- 0x2628, 0x3c18, 0x003c, 0x1a04, 0x324c,
- 0x2528, 0x3d18, 0x013c, 0x1904, 0x314c,
- 0x2428, 0x3e18, 0x023c, 0x1804, 0x304c,
- 0x242c, 0x3f18, 0x033c, 0x1808, 0x3050,
- 0x252c, 0x4018, 0x043c, 0x1908, 0x3150,
- 0x262c, 0x4118, 0x053c, 0x1a08, 0x3250,
- 0x272c, 0x411c, 0x0540, 0x1b08, 0x3350,
- 0x282c, 0x401c, 0x0440, 0x1c08, 0x3450,
- 0x292c, 0x3f1c, 0x0340, 0x1d08, 0x3550,
- 0x2930, 0x3e1c, 0x0240, 0x1d0c, 0x3554,
- 0x2830, 0x3d1c, 0x0140, 0x1c0c, 0x3454,
- 0x2730, 0x3c1c, 0x0040, 0x1b0c, 0x3354,
- 0x2630, 0x3c20, 0x0044, 0x1a0c, 0x3254,
- 0x2530, 0x3d20, 0x0144, 0x190c, 0x3154,
- 0x2430, 0x3e20, 0x0244, 0x180c, 0x3054,
- 0x2434, 0x3f20, 0x0344, 0x1810, 0x3058,
- 0x2534, 0x4020, 0x0444, 0x1910, 0x3258,
- 0x2634, 0x4120, 0x0544, 0x1a10, 0x3458,
- 0x2a24, 0x4510, 0x0934, 0x1e00, 0x3648,
- 0x2b24, 0x4610, 0x0a34, 0x1f00, 0x3748,
- 0x2c24, 0x4710, 0x0b34, 0x2000, 0x3848,
- 0x2d24, 0x4714, 0x0b38, 0x2100, 0x3948,
- 0x2e24, 0x4614, 0x0a38, 0x2200, 0x3a48,
- 0x2f24, 0x4514, 0x0938, 0x2300, 0x3b48,
- 0x2f28, 0x4414, 0x0838, 0x2304, 0x3b4c,
- 0x2e28, 0x4314, 0x0738, 0x2204, 0x3a4c,
- 0x2d28, 0x4214, 0x0638, 0x2104, 0x394c,
- 0x2c28, 0x4218, 0x063c, 0x2004, 0x384c,
- 0x2b28, 0x4318, 0x073c, 0x1f04, 0x374c,
- 0x2a28, 0x4418, 0x083c, 0x1e04, 0x364c,
- 0x2a2c, 0x4518, 0x093c, 0x1e08, 0x3650,
- 0x2b2c, 0x4618, 0x0a3c, 0x1f08, 0x3750,
- 0x2c2c, 0x4718, 0x0b3c, 0x2008, 0x3850,
- 0x2d2c, 0x471c, 0x0b40, 0x2108, 0x3950,
- 0x2e2c, 0x461c, 0x0a40, 0x2208, 0x3a50,
- 0x2f2c, 0x451c, 0x0940, 0x2308, 0x3b50,
- 0x2f30, 0x441c, 0x0840, 0x230c, 0x3b54,
- 0x2e30, 0x431c, 0x0740, 0x220c, 0x3a54,
- 0x2d30, 0x421c, 0x0640, 0x210c, 0x3954,
- 0x2c30, 0x4220, 0x0644, 0x200c, 0x3854,
- 0x2b30, 0x4320, 0x0744, 0x1f0c, 0x3754,
- 0x2a30, 0x4420, 0x0844, 0x1e0c, 0x3654,
- 0x2a34, 0x4520, 0x0944, 0x1e10, 0x3658,
- 0x2b34, 0x4620, 0x0a44, 0x1f10, 0x3858,
- 0x2c34, 0x4720, 0x0b44, 0x2010, 0x3a58,
- 0x3024, 0x0310, 0x0f34, 0x2400, 0x3c48,
- 0x3124, 0x0410, 0x1034, 0x2500, 0x3d48,
- 0x3224, 0x0510, 0x1134, 0x2600, 0x3e48,
- 0x3324, 0x0514, 0x1138, 0x2700, 0x3f48,
- 0x3424, 0x0414, 0x1038, 0x2800, 0x4048,
- 0x3524, 0x0314, 0x0f38, 0x2900, 0x4148,
- 0x3528, 0x0214, 0x0e38, 0x2904, 0x414c,
- 0x3428, 0x0114, 0x0d38, 0x2804, 0x404c,
- 0x3328, 0x0014, 0x0c38, 0x2704, 0x3f4c,
- 0x3228, 0x0018, 0x0c3c, 0x2604, 0x3e4c,
- 0x3128, 0x0118, 0x0d3c, 0x2504, 0x3d4c,
- 0x3028, 0x0218, 0x0e3c, 0x2404, 0x3c4c,
- 0x302c, 0x0318, 0x0f3c, 0x2408, 0x3c50,
- 0x312c, 0x0418, 0x103c, 0x2508, 0x3d50,
- 0x322c, 0x0518, 0x113c, 0x2608, 0x3e50,
- 0x332c, 0x051c, 0x1140, 0x2708, 0x3f50,
- 0x342c, 0x041c, 0x1040, 0x2808, 0x4050,
- 0x352c, 0x031c, 0x0f40, 0x2908, 0x4150,
- 0x3530, 0x021c, 0x0e40, 0x290c, 0x4154,
- 0x3430, 0x011c, 0x0d40, 0x280c, 0x4054,
- 0x3330, 0x001c, 0x0c40, 0x270c, 0x3f54,
- 0x3230, 0x0020, 0x0c44, 0x260c, 0x3e54,
- 0x3130, 0x0120, 0x0d44, 0x250c, 0x3d54,
- 0x3030, 0x0220, 0x0e44, 0x240c, 0x3c54,
- 0x3034, 0x0320, 0x0f44, 0x2410, 0x3c58,
- 0x3134, 0x0420, 0x1044, 0x2510, 0x3e58,
- 0x3234, 0x0520, 0x1144, 0x2610, 0x4058,
- 0x3624, 0x0910, 0x1534, 0x2a00, 0x4248,
- 0x3724, 0x0a10, 0x1634, 0x2b00, 0x4348,
- 0x3824, 0x0b10, 0x1734, 0x2c00, 0x4448,
- 0x3924, 0x0b14, 0x1738, 0x2d00, 0x4548,
- 0x3a24, 0x0a14, 0x1638, 0x2e00, 0x4648,
- 0x3b24, 0x0914, 0x1538, 0x2f00, 0x4748,
- 0x3b28, 0x0814, 0x1438, 0x2f04, 0x474c,
- 0x3a28, 0x0714, 0x1338, 0x2e04, 0x464c,
- 0x3928, 0x0614, 0x1238, 0x2d04, 0x454c,
- 0x3828, 0x0618, 0x123c, 0x2c04, 0x444c,
- 0x3728, 0x0718, 0x133c, 0x2b04, 0x434c,
- 0x3628, 0x0818, 0x143c, 0x2a04, 0x424c,
- 0x362c, 0x0918, 0x153c, 0x2a08, 0x4250,
- 0x372c, 0x0a18, 0x163c, 0x2b08, 0x4350,
- 0x382c, 0x0b18, 0x173c, 0x2c08, 0x4450,
- 0x392c, 0x0b1c, 0x1740, 0x2d08, 0x4550,
- 0x3a2c, 0x0a1c, 0x1640, 0x2e08, 0x4650,
- 0x3b2c, 0x091c, 0x1540, 0x2f08, 0x4750,
- 0x3b30, 0x081c, 0x1440, 0x2f0c, 0x4754,
- 0x3a30, 0x071c, 0x1340, 0x2e0c, 0x4654,
- 0x3930, 0x061c, 0x1240, 0x2d0c, 0x4554,
- 0x3830, 0x0620, 0x1244, 0x2c0c, 0x4454,
- 0x3730, 0x0720, 0x1344, 0x2b0c, 0x4354,
- 0x3630, 0x0820, 0x1444, 0x2a0c, 0x4254,
- 0x3634, 0x0920, 0x1544, 0x2a10, 0x4258,
- 0x3734, 0x0a20, 0x1644, 0x2b10, 0x4458,
- 0x3834, 0x0b20, 0x1744, 0x2c10, 0x4658,
- 0x3c24, 0x0f10, 0x1b34, 0x3000, 0x0048,
- 0x3d24, 0x1010, 0x1c34, 0x3100, 0x0148,
- 0x3e24, 0x1110, 0x1d34, 0x3200, 0x0248,
- 0x3f24, 0x1114, 0x1d38, 0x3300, 0x0348,
- 0x4024, 0x1014, 0x1c38, 0x3400, 0x0448,
- 0x4124, 0x0f14, 0x1b38, 0x3500, 0x0548,
- 0x4128, 0x0e14, 0x1a38, 0x3504, 0x054c,
- 0x4028, 0x0d14, 0x1938, 0x3404, 0x044c,
- 0x3f28, 0x0c14, 0x1838, 0x3304, 0x034c,
- 0x3e28, 0x0c18, 0x183c, 0x3204, 0x024c,
- 0x3d28, 0x0d18, 0x193c, 0x3104, 0x014c,
- 0x3c28, 0x0e18, 0x1a3c, 0x3004, 0x004c,
- 0x3c2c, 0x0f18, 0x1b3c, 0x3008, 0x0050,
- 0x3d2c, 0x1018, 0x1c3c, 0x3108, 0x0150,
- 0x3e2c, 0x1118, 0x1d3c, 0x3208, 0x0250,
- 0x3f2c, 0x111c, 0x1d40, 0x3308, 0x0350,
- 0x402c, 0x101c, 0x1c40, 0x3408, 0x0450,
- 0x412c, 0x0f1c, 0x1b40, 0x3508, 0x0550,
- 0x4130, 0x0e1c, 0x1a40, 0x350c, 0x0554,
- 0x4030, 0x0d1c, 0x1940, 0x340c, 0x0454,
- 0x3f30, 0x0c1c, 0x1840, 0x330c, 0x0354,
- 0x3e30, 0x0c20, 0x1844, 0x320c, 0x0254,
- 0x3d30, 0x0d20, 0x1944, 0x310c, 0x0154,
- 0x3c30, 0x0e20, 0x1a44, 0x300c, 0x0054,
- 0x3c34, 0x0f20, 0x1b44, 0x3010, 0x0058,
- 0x3d34, 0x1020, 0x1c44, 0x3110, 0x0258,
- 0x3e34, 0x1120, 0x1d44, 0x3210, 0x0458,
- 0x4224, 0x1510, 0x2134, 0x3600, 0x0648,
- 0x4324, 0x1610, 0x2234, 0x3700, 0x0748,
- 0x4424, 0x1710, 0x2334, 0x3800, 0x0848,
- 0x4524, 0x1714, 0x2338, 0x3900, 0x0948,
- 0x4624, 0x1614, 0x2238, 0x3a00, 0x0a48,
- 0x4724, 0x1514, 0x2138, 0x3b00, 0x0b48,
- 0x4728, 0x1414, 0x2038, 0x3b04, 0x0b4c,
- 0x4628, 0x1314, 0x1f38, 0x3a04, 0x0a4c,
- 0x4528, 0x1214, 0x1e38, 0x3904, 0x094c,
- 0x4428, 0x1218, 0x1e3c, 0x3804, 0x084c,
- 0x4328, 0x1318, 0x1f3c, 0x3704, 0x074c,
- 0x4228, 0x1418, 0x203c, 0x3604, 0x064c,
- 0x422c, 0x1518, 0x213c, 0x3608, 0x0650,
- 0x432c, 0x1618, 0x223c, 0x3708, 0x0750,
- 0x442c, 0x1718, 0x233c, 0x3808, 0x0850,
- 0x452c, 0x171c, 0x2340, 0x3908, 0x0950,
- 0x462c, 0x161c, 0x2240, 0x3a08, 0x0a50,
- 0x472c, 0x151c, 0x2140, 0x3b08, 0x0b50,
- 0x4730, 0x141c, 0x2040, 0x3b0c, 0x0b54,
- 0x4630, 0x131c, 0x1f40, 0x3a0c, 0x0a54,
- 0x4530, 0x121c, 0x1e40, 0x390c, 0x0954,
- 0x4430, 0x1220, 0x1e44, 0x380c, 0x0854,
- 0x4330, 0x1320, 0x1f44, 0x370c, 0x0754,
- 0x4230, 0x1420, 0x2044, 0x360c, 0x0654,
- 0x4234, 0x1520, 0x2144, 0x3610, 0x0658,
- 0x4334, 0x1620, 0x2244, 0x3710, 0x0858,
- 0x4434, 0x1720, 0x2344, 0x3810, 0x0a58,
- 0x0024, 0x1b10, 0x2734, 0x3c00, 0x0c48,
- 0x0124, 0x1c10, 0x2834, 0x3d00, 0x0d48,
- 0x0224, 0x1d10, 0x2934, 0x3e00, 0x0e48,
- 0x0324, 0x1d14, 0x2938, 0x3f00, 0x0f48,
- 0x0424, 0x1c14, 0x2838, 0x4000, 0x1048,
- 0x0524, 0x1b14, 0x2738, 0x4100, 0x1148,
- 0x0528, 0x1a14, 0x2638, 0x4104, 0x114c,
- 0x0428, 0x1914, 0x2538, 0x4004, 0x104c,
- 0x0328, 0x1814, 0x2438, 0x3f04, 0x0f4c,
- 0x0228, 0x1818, 0x243c, 0x3e04, 0x0e4c,
- 0x0128, 0x1918, 0x253c, 0x3d04, 0x0d4c,
- 0x0028, 0x1a18, 0x263c, 0x3c04, 0x0c4c,
- 0x002c, 0x1b18, 0x273c, 0x3c08, 0x0c50,
- 0x012c, 0x1c18, 0x283c, 0x3d08, 0x0d50,
- 0x022c, 0x1d18, 0x293c, 0x3e08, 0x0e50,
- 0x032c, 0x1d1c, 0x2940, 0x3f08, 0x0f50,
- 0x042c, 0x1c1c, 0x2840, 0x4008, 0x1050,
- 0x052c, 0x1b1c, 0x2740, 0x4108, 0x1150,
- 0x0530, 0x1a1c, 0x2640, 0x410c, 0x1154,
- 0x0430, 0x191c, 0x2540, 0x400c, 0x1054,
- 0x0330, 0x181c, 0x2440, 0x3f0c, 0x0f54,
- 0x0230, 0x1820, 0x2444, 0x3e0c, 0x0e54,
- 0x0130, 0x1920, 0x2544, 0x3d0c, 0x0d54,
- 0x0030, 0x1a20, 0x2644, 0x3c0c, 0x0c54,
- 0x0034, 0x1b20, 0x2744, 0x3c10, 0x0c58,
- 0x0134, 0x1c20, 0x2844, 0x3d10, 0x0e58,
- 0x0234, 0x1d20, 0x2944, 0x3e10, 0x1058,
- 0x0624, 0x2110, 0x2d34, 0x4200, 0x1248,
- 0x0724, 0x2210, 0x2e34, 0x4300, 0x1348,
- 0x0824, 0x2310, 0x2f34, 0x4400, 0x1448,
- 0x0924, 0x2314, 0x2f38, 0x4500, 0x1548,
- 0x0a24, 0x2214, 0x2e38, 0x4600, 0x1648,
- 0x0b24, 0x2114, 0x2d38, 0x4700, 0x1748,
- 0x0b28, 0x2014, 0x2c38, 0x4704, 0x174c,
- 0x0a28, 0x1f14, 0x2b38, 0x4604, 0x164c,
- 0x0928, 0x1e14, 0x2a38, 0x4504, 0x154c,
- 0x0828, 0x1e18, 0x2a3c, 0x4404, 0x144c,
- 0x0728, 0x1f18, 0x2b3c, 0x4304, 0x134c,
- 0x0628, 0x2018, 0x2c3c, 0x4204, 0x124c,
- 0x062c, 0x2118, 0x2d3c, 0x4208, 0x1250,
- 0x072c, 0x2218, 0x2e3c, 0x4308, 0x1350,
- 0x082c, 0x2318, 0x2f3c, 0x4408, 0x1450,
- 0x092c, 0x231c, 0x2f40, 0x4508, 0x1550,
- 0x0a2c, 0x221c, 0x2e40, 0x4608, 0x1650,
- 0x0b2c, 0x211c, 0x2d40, 0x4708, 0x1750,
- 0x0b30, 0x201c, 0x2c40, 0x470c, 0x1754,
- 0x0a30, 0x1f1c, 0x2b40, 0x460c, 0x1654,
- 0x0930, 0x1e1c, 0x2a40, 0x450c, 0x1554,
- 0x0830, 0x1e20, 0x2a44, 0x440c, 0x1454,
- 0x0730, 0x1f20, 0x2b44, 0x430c, 0x1354,
- 0x0630, 0x2020, 0x2c44, 0x420c, 0x1254,
- 0x0634, 0x2120, 0x2d44, 0x4210, 0x1258,
- 0x0734, 0x2220, 0x2e44, 0x4310, 0x1458,
- 0x0834, 0x2320, 0x2f44, 0x4410, 0x1658,
-};
-
-static const uint16_t dv_place_411[1350] = {
- 0x0c24, 0x2710, 0x3334, 0x0000, 0x1848,
- 0x0d24, 0x2810, 0x3434, 0x0100, 0x1948,
- 0x0e24, 0x2910, 0x3534, 0x0200, 0x1a48,
- 0x0f24, 0x2914, 0x3538, 0x0300, 0x1b48,
- 0x1024, 0x2814, 0x3438, 0x0400, 0x1c48,
- 0x1124, 0x2714, 0x3338, 0x0500, 0x1d48,
- 0x1128, 0x2614, 0x3238, 0x0504, 0x1d4c,
- 0x1028, 0x2514, 0x3138, 0x0404, 0x1c4c,
- 0x0f28, 0x2414, 0x3038, 0x0304, 0x1b4c,
- 0x0e28, 0x2418, 0x303c, 0x0204, 0x1a4c,
- 0x0d28, 0x2518, 0x313c, 0x0104, 0x194c,
- 0x0c28, 0x2618, 0x323c, 0x0004, 0x184c,
- 0x0c2c, 0x2718, 0x333c, 0x0008, 0x1850,
- 0x0d2c, 0x2818, 0x343c, 0x0108, 0x1950,
- 0x0e2c, 0x2918, 0x353c, 0x0208, 0x1a50,
- 0x0f2c, 0x291c, 0x3540, 0x0308, 0x1b50,
- 0x102c, 0x281c, 0x3440, 0x0408, 0x1c50,
- 0x112c, 0x271c, 0x3340, 0x0508, 0x1d50,
- 0x1130, 0x261c, 0x3240, 0x050c, 0x1d54,
- 0x1030, 0x251c, 0x3140, 0x040c, 0x1c54,
- 0x0f30, 0x241c, 0x3040, 0x030c, 0x1b54,
- 0x0e30, 0x2420, 0x3044, 0x020c, 0x1a54,
- 0x0d30, 0x2520, 0x3144, 0x010c, 0x1954,
- 0x0c30, 0x2620, 0x3244, 0x000c, 0x1854,
- 0x0c34, 0x2720, 0x3344, 0x0010, 0x1858,
- 0x0d34, 0x2820, 0x3444, 0x0110, 0x1a58,
- 0x0e34, 0x2920, 0x3544, 0x0210, 0x1c58,
- 0x1224, 0x2d10, 0x3934, 0x0600, 0x1e48,
- 0x1324, 0x2e10, 0x3a34, 0x0700, 0x1f48,
- 0x1424, 0x2f10, 0x3b34, 0x0800, 0x2048,
- 0x1524, 0x2f14, 0x3b38, 0x0900, 0x2148,
- 0x1624, 0x2e14, 0x3a38, 0x0a00, 0x2248,
- 0x1724, 0x2d14, 0x3938, 0x0b00, 0x2348,
- 0x1728, 0x2c14, 0x3838, 0x0b04, 0x234c,
- 0x1628, 0x2b14, 0x3738, 0x0a04, 0x224c,
- 0x1528, 0x2a14, 0x3638, 0x0904, 0x214c,
- 0x1428, 0x2a18, 0x363c, 0x0804, 0x204c,
- 0x1328, 0x2b18, 0x373c, 0x0704, 0x1f4c,
- 0x1228, 0x2c18, 0x383c, 0x0604, 0x1e4c,
- 0x122c, 0x2d18, 0x393c, 0x0608, 0x1e50,
- 0x132c, 0x2e18, 0x3a3c, 0x0708, 0x1f50,
- 0x142c, 0x2f18, 0x3b3c, 0x0808, 0x2050,
- 0x152c, 0x2f1c, 0x3b40, 0x0908, 0x2150,
- 0x162c, 0x2e1c, 0x3a40, 0x0a08, 0x2250,
- 0x172c, 0x2d1c, 0x3940, 0x0b08, 0x2350,
- 0x1730, 0x2c1c, 0x3840, 0x0b0c, 0x2354,
- 0x1630, 0x2b1c, 0x3740, 0x0a0c, 0x2254,
- 0x1530, 0x2a1c, 0x3640, 0x090c, 0x2154,
- 0x1430, 0x2a20, 0x3644, 0x080c, 0x2054,
- 0x1330, 0x2b20, 0x3744, 0x070c, 0x1f54,
- 0x1230, 0x2c20, 0x3844, 0x060c, 0x1e54,
- 0x1234, 0x2d20, 0x3944, 0x0610, 0x1e58,
- 0x1334, 0x2e20, 0x3a44, 0x0710, 0x2058,
- 0x1434, 0x2f20, 0x3b44, 0x0810, 0x2258,
- 0x1824, 0x3310, 0x0334, 0x0c00, 0x2448,
- 0x1924, 0x3410, 0x0434, 0x0d00, 0x2548,
- 0x1a24, 0x3510, 0x0534, 0x0e00, 0x2648,
- 0x1b24, 0x3514, 0x0538, 0x0f00, 0x2748,
- 0x1c24, 0x3414, 0x0438, 0x1000, 0x2848,
- 0x1d24, 0x3314, 0x0338, 0x1100, 0x2948,
- 0x1d28, 0x3214, 0x0238, 0x1104, 0x294c,
- 0x1c28, 0x3114, 0x0138, 0x1004, 0x284c,
- 0x1b28, 0x3014, 0x0038, 0x0f04, 0x274c,
- 0x1a28, 0x3018, 0x003c, 0x0e04, 0x264c,
- 0x1928, 0x3118, 0x013c, 0x0d04, 0x254c,
- 0x1828, 0x3218, 0x023c, 0x0c04, 0x244c,
- 0x182c, 0x3318, 0x033c, 0x0c08, 0x2450,
- 0x192c, 0x3418, 0x043c, 0x0d08, 0x2550,
- 0x1a2c, 0x3518, 0x053c, 0x0e08, 0x2650,
- 0x1b2c, 0x351c, 0x0540, 0x0f08, 0x2750,
- 0x1c2c, 0x341c, 0x0440, 0x1008, 0x2850,
- 0x1d2c, 0x331c, 0x0340, 0x1108, 0x2950,
- 0x1d30, 0x321c, 0x0240, 0x110c, 0x2954,
- 0x1c30, 0x311c, 0x0140, 0x100c, 0x2854,
- 0x1b30, 0x301c, 0x0040, 0x0f0c, 0x2754,
- 0x1a30, 0x3020, 0x0044, 0x0e0c, 0x2654,
- 0x1930, 0x3120, 0x0144, 0x0d0c, 0x2554,
- 0x1830, 0x3220, 0x0244, 0x0c0c, 0x2454,
- 0x1834, 0x3320, 0x0344, 0x0c10, 0x2458,
- 0x1934, 0x3420, 0x0444, 0x0d10, 0x2658,
- 0x1a34, 0x3520, 0x0544, 0x0e10, 0x2858,
- 0x1e24, 0x3910, 0x0934, 0x1200, 0x2a48,
- 0x1f24, 0x3a10, 0x0a34, 0x1300, 0x2b48,
- 0x2024, 0x3b10, 0x0b34, 0x1400, 0x2c48,
- 0x2124, 0x3b14, 0x0b38, 0x1500, 0x2d48,
- 0x2224, 0x3a14, 0x0a38, 0x1600, 0x2e48,
- 0x2324, 0x3914, 0x0938, 0x1700, 0x2f48,
- 0x2328, 0x3814, 0x0838, 0x1704, 0x2f4c,
- 0x2228, 0x3714, 0x0738, 0x1604, 0x2e4c,
- 0x2128, 0x3614, 0x0638, 0x1504, 0x2d4c,
- 0x2028, 0x3618, 0x063c, 0x1404, 0x2c4c,
- 0x1f28, 0x3718, 0x073c, 0x1304, 0x2b4c,
- 0x1e28, 0x3818, 0x083c, 0x1204, 0x2a4c,
- 0x1e2c, 0x3918, 0x093c, 0x1208, 0x2a50,
- 0x1f2c, 0x3a18, 0x0a3c, 0x1308, 0x2b50,
- 0x202c, 0x3b18, 0x0b3c, 0x1408, 0x2c50,
- 0x212c, 0x3b1c, 0x0b40, 0x1508, 0x2d50,
- 0x222c, 0x3a1c, 0x0a40, 0x1608, 0x2e50,
- 0x232c, 0x391c, 0x0940, 0x1708, 0x2f50,
- 0x2330, 0x381c, 0x0840, 0x170c, 0x2f54,
- 0x2230, 0x371c, 0x0740, 0x160c, 0x2e54,
- 0x2130, 0x361c, 0x0640, 0x150c, 0x2d54,
- 0x2030, 0x3620, 0x0644, 0x140c, 0x2c54,
- 0x1f30, 0x3720, 0x0744, 0x130c, 0x2b54,
- 0x1e30, 0x3820, 0x0844, 0x120c, 0x2a54,
- 0x1e34, 0x3920, 0x0944, 0x1210, 0x2a58,
- 0x1f34, 0x3a20, 0x0a44, 0x1310, 0x2c58,
- 0x2034, 0x3b20, 0x0b44, 0x1410, 0x2e58,
- 0x2424, 0x0310, 0x0f34, 0x1800, 0x3048,
- 0x2524, 0x0410, 0x1034, 0x1900, 0x3148,
- 0x2624, 0x0510, 0x1134, 0x1a00, 0x3248,
- 0x2724, 0x0514, 0x1138, 0x1b00, 0x3348,
- 0x2824, 0x0414, 0x1038, 0x1c00, 0x3448,
- 0x2924, 0x0314, 0x0f38, 0x1d00, 0x3548,
- 0x2928, 0x0214, 0x0e38, 0x1d04, 0x354c,
- 0x2828, 0x0114, 0x0d38, 0x1c04, 0x344c,
- 0x2728, 0x0014, 0x0c38, 0x1b04, 0x334c,
- 0x2628, 0x0018, 0x0c3c, 0x1a04, 0x324c,
- 0x2528, 0x0118, 0x0d3c, 0x1904, 0x314c,
- 0x2428, 0x0218, 0x0e3c, 0x1804, 0x304c,
- 0x242c, 0x0318, 0x0f3c, 0x1808, 0x3050,
- 0x252c, 0x0418, 0x103c, 0x1908, 0x3150,
- 0x262c, 0x0518, 0x113c, 0x1a08, 0x3250,
- 0x272c, 0x051c, 0x1140, 0x1b08, 0x3350,
- 0x282c, 0x041c, 0x1040, 0x1c08, 0x3450,
- 0x292c, 0x031c, 0x0f40, 0x1d08, 0x3550,
- 0x2930, 0x021c, 0x0e40, 0x1d0c, 0x3554,
- 0x2830, 0x011c, 0x0d40, 0x1c0c, 0x3454,
- 0x2730, 0x001c, 0x0c40, 0x1b0c, 0x3354,
- 0x2630, 0x0020, 0x0c44, 0x1a0c, 0x3254,
- 0x2530, 0x0120, 0x0d44, 0x190c, 0x3154,
- 0x2430, 0x0220, 0x0e44, 0x180c, 0x3054,
- 0x2434, 0x0320, 0x0f44, 0x1810, 0x3058,
- 0x2534, 0x0420, 0x1044, 0x1910, 0x3258,
- 0x2634, 0x0520, 0x1144, 0x1a10, 0x3458,
- 0x2a24, 0x0910, 0x1534, 0x1e00, 0x3648,
- 0x2b24, 0x0a10, 0x1634, 0x1f00, 0x3748,
- 0x2c24, 0x0b10, 0x1734, 0x2000, 0x3848,
- 0x2d24, 0x0b14, 0x1738, 0x2100, 0x3948,
- 0x2e24, 0x0a14, 0x1638, 0x2200, 0x3a48,
- 0x2f24, 0x0914, 0x1538, 0x2300, 0x3b48,
- 0x2f28, 0x0814, 0x1438, 0x2304, 0x3b4c,
- 0x2e28, 0x0714, 0x1338, 0x2204, 0x3a4c,
- 0x2d28, 0x0614, 0x1238, 0x2104, 0x394c,
- 0x2c28, 0x0618, 0x123c, 0x2004, 0x384c,
- 0x2b28, 0x0718, 0x133c, 0x1f04, 0x374c,
- 0x2a28, 0x0818, 0x143c, 0x1e04, 0x364c,
- 0x2a2c, 0x0918, 0x153c, 0x1e08, 0x3650,
- 0x2b2c, 0x0a18, 0x163c, 0x1f08, 0x3750,
- 0x2c2c, 0x0b18, 0x173c, 0x2008, 0x3850,
- 0x2d2c, 0x0b1c, 0x1740, 0x2108, 0x3950,
- 0x2e2c, 0x0a1c, 0x1640, 0x2208, 0x3a50,
- 0x2f2c, 0x091c, 0x1540, 0x2308, 0x3b50,
- 0x2f30, 0x081c, 0x1440, 0x230c, 0x3b54,
- 0x2e30, 0x071c, 0x1340, 0x220c, 0x3a54,
- 0x2d30, 0x061c, 0x1240, 0x210c, 0x3954,
- 0x2c30, 0x0620, 0x1244, 0x200c, 0x3854,
- 0x2b30, 0x0720, 0x1344, 0x1f0c, 0x3754,
- 0x2a30, 0x0820, 0x1444, 0x1e0c, 0x3654,
- 0x2a34, 0x0920, 0x1544, 0x1e10, 0x3658,
- 0x2b34, 0x0a20, 0x1644, 0x1f10, 0x3858,
- 0x2c34, 0x0b20, 0x1744, 0x2010, 0x3a58,
- 0x3024, 0x0f10, 0x1b34, 0x2400, 0x0048,
- 0x3124, 0x1010, 0x1c34, 0x2500, 0x0148,
- 0x3224, 0x1110, 0x1d34, 0x2600, 0x0248,
- 0x3324, 0x1114, 0x1d38, 0x2700, 0x0348,
- 0x3424, 0x1014, 0x1c38, 0x2800, 0x0448,
- 0x3524, 0x0f14, 0x1b38, 0x2900, 0x0548,
- 0x3528, 0x0e14, 0x1a38, 0x2904, 0x054c,
- 0x3428, 0x0d14, 0x1938, 0x2804, 0x044c,
- 0x3328, 0x0c14, 0x1838, 0x2704, 0x034c,
- 0x3228, 0x0c18, 0x183c, 0x2604, 0x024c,
- 0x3128, 0x0d18, 0x193c, 0x2504, 0x014c,
- 0x3028, 0x0e18, 0x1a3c, 0x2404, 0x004c,
- 0x302c, 0x0f18, 0x1b3c, 0x2408, 0x0050,
- 0x312c, 0x1018, 0x1c3c, 0x2508, 0x0150,
- 0x322c, 0x1118, 0x1d3c, 0x2608, 0x0250,
- 0x332c, 0x111c, 0x1d40, 0x2708, 0x0350,
- 0x342c, 0x101c, 0x1c40, 0x2808, 0x0450,
- 0x352c, 0x0f1c, 0x1b40, 0x2908, 0x0550,
- 0x3530, 0x0e1c, 0x1a40, 0x290c, 0x0554,
- 0x3430, 0x0d1c, 0x1940, 0x280c, 0x0454,
- 0x3330, 0x0c1c, 0x1840, 0x270c, 0x0354,
- 0x3230, 0x0c20, 0x1844, 0x260c, 0x0254,
- 0x3130, 0x0d20, 0x1944, 0x250c, 0x0154,
- 0x3030, 0x0e20, 0x1a44, 0x240c, 0x0054,
- 0x3034, 0x0f20, 0x1b44, 0x2410, 0x0058,
- 0x3134, 0x1020, 0x1c44, 0x2510, 0x0258,
- 0x3234, 0x1120, 0x1d44, 0x2610, 0x0458,
- 0x3624, 0x1510, 0x2134, 0x2a00, 0x0648,
- 0x3724, 0x1610, 0x2234, 0x2b00, 0x0748,
- 0x3824, 0x1710, 0x2334, 0x2c00, 0x0848,
- 0x3924, 0x1714, 0x2338, 0x2d00, 0x0948,
- 0x3a24, 0x1614, 0x2238, 0x2e00, 0x0a48,
- 0x3b24, 0x1514, 0x2138, 0x2f00, 0x0b48,
- 0x3b28, 0x1414, 0x2038, 0x2f04, 0x0b4c,
- 0x3a28, 0x1314, 0x1f38, 0x2e04, 0x0a4c,
- 0x3928, 0x1214, 0x1e38, 0x2d04, 0x094c,
- 0x3828, 0x1218, 0x1e3c, 0x2c04, 0x084c,
- 0x3728, 0x1318, 0x1f3c, 0x2b04, 0x074c,
- 0x3628, 0x1418, 0x203c, 0x2a04, 0x064c,
- 0x362c, 0x1518, 0x213c, 0x2a08, 0x0650,
- 0x372c, 0x1618, 0x223c, 0x2b08, 0x0750,
- 0x382c, 0x1718, 0x233c, 0x2c08, 0x0850,
- 0x392c, 0x171c, 0x2340, 0x2d08, 0x0950,
- 0x3a2c, 0x161c, 0x2240, 0x2e08, 0x0a50,
- 0x3b2c, 0x151c, 0x2140, 0x2f08, 0x0b50,
- 0x3b30, 0x141c, 0x2040, 0x2f0c, 0x0b54,
- 0x3a30, 0x131c, 0x1f40, 0x2e0c, 0x0a54,
- 0x3930, 0x121c, 0x1e40, 0x2d0c, 0x0954,
- 0x3830, 0x1220, 0x1e44, 0x2c0c, 0x0854,
- 0x3730, 0x1320, 0x1f44, 0x2b0c, 0x0754,
- 0x3630, 0x1420, 0x2044, 0x2a0c, 0x0654,
- 0x3634, 0x1520, 0x2144, 0x2a10, 0x0658,
- 0x3734, 0x1620, 0x2244, 0x2b10, 0x0858,
- 0x3834, 0x1720, 0x2344, 0x2c10, 0x0a58,
- 0x0024, 0x1b10, 0x2734, 0x3000, 0x0c48,
- 0x0124, 0x1c10, 0x2834, 0x3100, 0x0d48,
- 0x0224, 0x1d10, 0x2934, 0x3200, 0x0e48,
- 0x0324, 0x1d14, 0x2938, 0x3300, 0x0f48,
- 0x0424, 0x1c14, 0x2838, 0x3400, 0x1048,
- 0x0524, 0x1b14, 0x2738, 0x3500, 0x1148,
- 0x0528, 0x1a14, 0x2638, 0x3504, 0x114c,
- 0x0428, 0x1914, 0x2538, 0x3404, 0x104c,
- 0x0328, 0x1814, 0x2438, 0x3304, 0x0f4c,
- 0x0228, 0x1818, 0x243c, 0x3204, 0x0e4c,
- 0x0128, 0x1918, 0x253c, 0x3104, 0x0d4c,
- 0x0028, 0x1a18, 0x263c, 0x3004, 0x0c4c,
- 0x002c, 0x1b18, 0x273c, 0x3008, 0x0c50,
- 0x012c, 0x1c18, 0x283c, 0x3108, 0x0d50,
- 0x022c, 0x1d18, 0x293c, 0x3208, 0x0e50,
- 0x032c, 0x1d1c, 0x2940, 0x3308, 0x0f50,
- 0x042c, 0x1c1c, 0x2840, 0x3408, 0x1050,
- 0x052c, 0x1b1c, 0x2740, 0x3508, 0x1150,
- 0x0530, 0x1a1c, 0x2640, 0x350c, 0x1154,
- 0x0430, 0x191c, 0x2540, 0x340c, 0x1054,
- 0x0330, 0x181c, 0x2440, 0x330c, 0x0f54,
- 0x0230, 0x1820, 0x2444, 0x320c, 0x0e54,
- 0x0130, 0x1920, 0x2544, 0x310c, 0x0d54,
- 0x0030, 0x1a20, 0x2644, 0x300c, 0x0c54,
- 0x0034, 0x1b20, 0x2744, 0x3010, 0x0c58,
- 0x0134, 0x1c20, 0x2844, 0x3110, 0x0e58,
- 0x0234, 0x1d20, 0x2944, 0x3210, 0x1058,
- 0x0624, 0x2110, 0x2d34, 0x3600, 0x1248,
- 0x0724, 0x2210, 0x2e34, 0x3700, 0x1348,
- 0x0824, 0x2310, 0x2f34, 0x3800, 0x1448,
- 0x0924, 0x2314, 0x2f38, 0x3900, 0x1548,
- 0x0a24, 0x2214, 0x2e38, 0x3a00, 0x1648,
- 0x0b24, 0x2114, 0x2d38, 0x3b00, 0x1748,
- 0x0b28, 0x2014, 0x2c38, 0x3b04, 0x174c,
- 0x0a28, 0x1f14, 0x2b38, 0x3a04, 0x164c,
- 0x0928, 0x1e14, 0x2a38, 0x3904, 0x154c,
- 0x0828, 0x1e18, 0x2a3c, 0x3804, 0x144c,
- 0x0728, 0x1f18, 0x2b3c, 0x3704, 0x134c,
- 0x0628, 0x2018, 0x2c3c, 0x3604, 0x124c,
- 0x062c, 0x2118, 0x2d3c, 0x3608, 0x1250,
- 0x072c, 0x2218, 0x2e3c, 0x3708, 0x1350,
- 0x082c, 0x2318, 0x2f3c, 0x3808, 0x1450,
- 0x092c, 0x231c, 0x2f40, 0x3908, 0x1550,
- 0x0a2c, 0x221c, 0x2e40, 0x3a08, 0x1650,
- 0x0b2c, 0x211c, 0x2d40, 0x3b08, 0x1750,
- 0x0b30, 0x201c, 0x2c40, 0x3b0c, 0x1754,
- 0x0a30, 0x1f1c, 0x2b40, 0x3a0c, 0x1654,
- 0x0930, 0x1e1c, 0x2a40, 0x390c, 0x1554,
- 0x0830, 0x1e20, 0x2a44, 0x380c, 0x1454,
- 0x0730, 0x1f20, 0x2b44, 0x370c, 0x1354,
- 0x0630, 0x2020, 0x2c44, 0x360c, 0x1254,
- 0x0634, 0x2120, 0x2d44, 0x3610, 0x1258,
- 0x0734, 0x2220, 0x2e44, 0x3710, 0x1458,
- 0x0834, 0x2320, 0x2f44, 0x3810, 0x1658,
-};
-
-/* 4:2:2 macroblock placement tables created by dvtables.py */
-
-/* 2 channels per frame, 10 DIF sequences per channel,
- 27 video segments per DIF sequence, 5 macroblocks per video segment */
-static const uint16_t dv_place_422_525[2*10*27*5] = {
- 0x0c48, 0x2424, 0x306c, 0x0000, 0x1890,
- 0x0d48, 0x2524, 0x316c, 0x0100, 0x1990,
- 0x0e48, 0x2624, 0x326c, 0x0200, 0x1a90,
- 0x0e4c, 0x2628, 0x3270, 0x0204, 0x1a94,
- 0x0d4c, 0x2528, 0x3170, 0x0104, 0x1994,
- 0x0c4c, 0x2428, 0x3070, 0x0004, 0x1894,
- 0x0c50, 0x242c, 0x3074, 0x0008, 0x1898,
- 0x0d50, 0x252c, 0x3174, 0x0108, 0x1998,
- 0x0e50, 0x262c, 0x3274, 0x0208, 0x1a98,
- 0x0e54, 0x2630, 0x3278, 0x020c, 0x1a9c,
- 0x0d54, 0x2530, 0x3178, 0x010c, 0x199c,
- 0x0c54, 0x2430, 0x3078, 0x000c, 0x189c,
- 0x0c58, 0x2434, 0x307c, 0x0010, 0x18a0,
- 0x0d58, 0x2534, 0x317c, 0x0110, 0x19a0,
- 0x0e58, 0x2634, 0x327c, 0x0210, 0x1aa0,
- 0x0e5c, 0x2638, 0x3280, 0x0214, 0x1aa4,
- 0x0d5c, 0x2538, 0x3180, 0x0114, 0x19a4,
- 0x0c5c, 0x2438, 0x3080, 0x0014, 0x18a4,
- 0x0c60, 0x243c, 0x3084, 0x0018, 0x18a8,
- 0x0d60, 0x253c, 0x3184, 0x0118, 0x19a8,
- 0x0e60, 0x263c, 0x3284, 0x0218, 0x1aa8,
- 0x0e64, 0x2640, 0x3288, 0x021c, 0x1aac,
- 0x0d64, 0x2540, 0x3188, 0x011c, 0x19ac,
- 0x0c64, 0x2440, 0x3088, 0x001c, 0x18ac,
- 0x0c68, 0x2444, 0x308c, 0x0020, 0x18b0,
- 0x0d68, 0x2544, 0x318c, 0x0120, 0x19b0,
- 0x0e68, 0x2644, 0x328c, 0x0220, 0x1ab0,
- 0x1248, 0x2a24, 0x366c, 0x0600, 0x1e90,
- 0x1348, 0x2b24, 0x376c, 0x0700, 0x1f90,
- 0x1448, 0x2c24, 0x386c, 0x0800, 0x2090,
- 0x144c, 0x2c28, 0x3870, 0x0804, 0x2094,
- 0x134c, 0x2b28, 0x3770, 0x0704, 0x1f94,
- 0x124c, 0x2a28, 0x3670, 0x0604, 0x1e94,
- 0x1250, 0x2a2c, 0x3674, 0x0608, 0x1e98,
- 0x1350, 0x2b2c, 0x3774, 0x0708, 0x1f98,
- 0x1450, 0x2c2c, 0x3874, 0x0808, 0x2098,
- 0x1454, 0x2c30, 0x3878, 0x080c, 0x209c,
- 0x1354, 0x2b30, 0x3778, 0x070c, 0x1f9c,
- 0x1254, 0x2a30, 0x3678, 0x060c, 0x1e9c,
- 0x1258, 0x2a34, 0x367c, 0x0610, 0x1ea0,
- 0x1358, 0x2b34, 0x377c, 0x0710, 0x1fa0,
- 0x1458, 0x2c34, 0x387c, 0x0810, 0x20a0,
- 0x145c, 0x2c38, 0x3880, 0x0814, 0x20a4,
- 0x135c, 0x2b38, 0x3780, 0x0714, 0x1fa4,
- 0x125c, 0x2a38, 0x3680, 0x0614, 0x1ea4,
- 0x1260, 0x2a3c, 0x3684, 0x0618, 0x1ea8,
- 0x1360, 0x2b3c, 0x3784, 0x0718, 0x1fa8,
- 0x1460, 0x2c3c, 0x3884, 0x0818, 0x20a8,
- 0x1464, 0x2c40, 0x3888, 0x081c, 0x20ac,
- 0x1364, 0x2b40, 0x3788, 0x071c, 0x1fac,
- 0x1264, 0x2a40, 0x3688, 0x061c, 0x1eac,
- 0x1268, 0x2a44, 0x368c, 0x0620, 0x1eb0,
- 0x1368, 0x2b44, 0x378c, 0x0720, 0x1fb0,
- 0x1468, 0x2c44, 0x388c, 0x0820, 0x20b0,
- 0x1848, 0x3024, 0x006c, 0x0c00, 0x2490,
- 0x1948, 0x3124, 0x016c, 0x0d00, 0x2590,
- 0x1a48, 0x3224, 0x026c, 0x0e00, 0x2690,
- 0x1a4c, 0x3228, 0x0270, 0x0e04, 0x2694,
- 0x194c, 0x3128, 0x0170, 0x0d04, 0x2594,
- 0x184c, 0x3028, 0x0070, 0x0c04, 0x2494,
- 0x1850, 0x302c, 0x0074, 0x0c08, 0x2498,
- 0x1950, 0x312c, 0x0174, 0x0d08, 0x2598,
- 0x1a50, 0x322c, 0x0274, 0x0e08, 0x2698,
- 0x1a54, 0x3230, 0x0278, 0x0e0c, 0x269c,
- 0x1954, 0x3130, 0x0178, 0x0d0c, 0x259c,
- 0x1854, 0x3030, 0x0078, 0x0c0c, 0x249c,
- 0x1858, 0x3034, 0x007c, 0x0c10, 0x24a0,
- 0x1958, 0x3134, 0x017c, 0x0d10, 0x25a0,
- 0x1a58, 0x3234, 0x027c, 0x0e10, 0x26a0,
- 0x1a5c, 0x3238, 0x0280, 0x0e14, 0x26a4,
- 0x195c, 0x3138, 0x0180, 0x0d14, 0x25a4,
- 0x185c, 0x3038, 0x0080, 0x0c14, 0x24a4,
- 0x1860, 0x303c, 0x0084, 0x0c18, 0x24a8,
- 0x1960, 0x313c, 0x0184, 0x0d18, 0x25a8,
- 0x1a60, 0x323c, 0x0284, 0x0e18, 0x26a8,
- 0x1a64, 0x3240, 0x0288, 0x0e1c, 0x26ac,
- 0x1964, 0x3140, 0x0188, 0x0d1c, 0x25ac,
- 0x1864, 0x3040, 0x0088, 0x0c1c, 0x24ac,
- 0x1868, 0x3044, 0x008c, 0x0c20, 0x24b0,
- 0x1968, 0x3144, 0x018c, 0x0d20, 0x25b0,
- 0x1a68, 0x3244, 0x028c, 0x0e20, 0x26b0,
- 0x1e48, 0x3624, 0x066c, 0x1200, 0x2a90,
- 0x1f48, 0x3724, 0x076c, 0x1300, 0x2b90,
- 0x2048, 0x3824, 0x086c, 0x1400, 0x2c90,
- 0x204c, 0x3828, 0x0870, 0x1404, 0x2c94,
- 0x1f4c, 0x3728, 0x0770, 0x1304, 0x2b94,
- 0x1e4c, 0x3628, 0x0670, 0x1204, 0x2a94,
- 0x1e50, 0x362c, 0x0674, 0x1208, 0x2a98,
- 0x1f50, 0x372c, 0x0774, 0x1308, 0x2b98,
- 0x2050, 0x382c, 0x0874, 0x1408, 0x2c98,
- 0x2054, 0x3830, 0x0878, 0x140c, 0x2c9c,
- 0x1f54, 0x3730, 0x0778, 0x130c, 0x2b9c,
- 0x1e54, 0x3630, 0x0678, 0x120c, 0x2a9c,
- 0x1e58, 0x3634, 0x067c, 0x1210, 0x2aa0,
- 0x1f58, 0x3734, 0x077c, 0x1310, 0x2ba0,
- 0x2058, 0x3834, 0x087c, 0x1410, 0x2ca0,
- 0x205c, 0x3838, 0x0880, 0x1414, 0x2ca4,
- 0x1f5c, 0x3738, 0x0780, 0x1314, 0x2ba4,
- 0x1e5c, 0x3638, 0x0680, 0x1214, 0x2aa4,
- 0x1e60, 0x363c, 0x0684, 0x1218, 0x2aa8,
- 0x1f60, 0x373c, 0x0784, 0x1318, 0x2ba8,
- 0x2060, 0x383c, 0x0884, 0x1418, 0x2ca8,
- 0x2064, 0x3840, 0x0888, 0x141c, 0x2cac,
- 0x1f64, 0x3740, 0x0788, 0x131c, 0x2bac,
- 0x1e64, 0x3640, 0x0688, 0x121c, 0x2aac,
- 0x1e68, 0x3644, 0x068c, 0x1220, 0x2ab0,
- 0x1f68, 0x3744, 0x078c, 0x1320, 0x2bb0,
- 0x2068, 0x3844, 0x088c, 0x1420, 0x2cb0,
- 0x2448, 0x0024, 0x0c6c, 0x1800, 0x3090,
- 0x2548, 0x0124, 0x0d6c, 0x1900, 0x3190,
- 0x2648, 0x0224, 0x0e6c, 0x1a00, 0x3290,
- 0x264c, 0x0228, 0x0e70, 0x1a04, 0x3294,
- 0x254c, 0x0128, 0x0d70, 0x1904, 0x3194,
- 0x244c, 0x0028, 0x0c70, 0x1804, 0x3094,
- 0x2450, 0x002c, 0x0c74, 0x1808, 0x3098,
- 0x2550, 0x012c, 0x0d74, 0x1908, 0x3198,
- 0x2650, 0x022c, 0x0e74, 0x1a08, 0x3298,
- 0x2654, 0x0230, 0x0e78, 0x1a0c, 0x329c,
- 0x2554, 0x0130, 0x0d78, 0x190c, 0x319c,
- 0x2454, 0x0030, 0x0c78, 0x180c, 0x309c,
- 0x2458, 0x0034, 0x0c7c, 0x1810, 0x30a0,
- 0x2558, 0x0134, 0x0d7c, 0x1910, 0x31a0,
- 0x2658, 0x0234, 0x0e7c, 0x1a10, 0x32a0,
- 0x265c, 0x0238, 0x0e80, 0x1a14, 0x32a4,
- 0x255c, 0x0138, 0x0d80, 0x1914, 0x31a4,
- 0x245c, 0x0038, 0x0c80, 0x1814, 0x30a4,
- 0x2460, 0x003c, 0x0c84, 0x1818, 0x30a8,
- 0x2560, 0x013c, 0x0d84, 0x1918, 0x31a8,
- 0x2660, 0x023c, 0x0e84, 0x1a18, 0x32a8,
- 0x2664, 0x0240, 0x0e88, 0x1a1c, 0x32ac,
- 0x2564, 0x0140, 0x0d88, 0x191c, 0x31ac,
- 0x2464, 0x0040, 0x0c88, 0x181c, 0x30ac,
- 0x2468, 0x0044, 0x0c8c, 0x1820, 0x30b0,
- 0x2568, 0x0144, 0x0d8c, 0x1920, 0x31b0,
- 0x2668, 0x0244, 0x0e8c, 0x1a20, 0x32b0,
- 0x2a48, 0x0624, 0x126c, 0x1e00, 0x3690,
- 0x2b48, 0x0724, 0x136c, 0x1f00, 0x3790,
- 0x2c48, 0x0824, 0x146c, 0x2000, 0x3890,
- 0x2c4c, 0x0828, 0x1470, 0x2004, 0x3894,
- 0x2b4c, 0x0728, 0x1370, 0x1f04, 0x3794,
- 0x2a4c, 0x0628, 0x1270, 0x1e04, 0x3694,
- 0x2a50, 0x062c, 0x1274, 0x1e08, 0x3698,
- 0x2b50, 0x072c, 0x1374, 0x1f08, 0x3798,
- 0x2c50, 0x082c, 0x1474, 0x2008, 0x3898,
- 0x2c54, 0x0830, 0x1478, 0x200c, 0x389c,
- 0x2b54, 0x0730, 0x1378, 0x1f0c, 0x379c,
- 0x2a54, 0x0630, 0x1278, 0x1e0c, 0x369c,
- 0x2a58, 0x0634, 0x127c, 0x1e10, 0x36a0,
- 0x2b58, 0x0734, 0x137c, 0x1f10, 0x37a0,
- 0x2c58, 0x0834, 0x147c, 0x2010, 0x38a0,
- 0x2c5c, 0x0838, 0x1480, 0x2014, 0x38a4,
- 0x2b5c, 0x0738, 0x1380, 0x1f14, 0x37a4,
- 0x2a5c, 0x0638, 0x1280, 0x1e14, 0x36a4,
- 0x2a60, 0x063c, 0x1284, 0x1e18, 0x36a8,
- 0x2b60, 0x073c, 0x1384, 0x1f18, 0x37a8,
- 0x2c60, 0x083c, 0x1484, 0x2018, 0x38a8,
- 0x2c64, 0x0840, 0x1488, 0x201c, 0x38ac,
- 0x2b64, 0x0740, 0x1388, 0x1f1c, 0x37ac,
- 0x2a64, 0x0640, 0x1288, 0x1e1c, 0x36ac,
- 0x2a68, 0x0644, 0x128c, 0x1e20, 0x36b0,
- 0x2b68, 0x0744, 0x138c, 0x1f20, 0x37b0,
- 0x2c68, 0x0844, 0x148c, 0x2020, 0x38b0,
- 0x3048, 0x0c24, 0x186c, 0x2400, 0x0090,
- 0x3148, 0x0d24, 0x196c, 0x2500, 0x0190,
- 0x3248, 0x0e24, 0x1a6c, 0x2600, 0x0290,
- 0x324c, 0x0e28, 0x1a70, 0x2604, 0x0294,
- 0x314c, 0x0d28, 0x1970, 0x2504, 0x0194,
- 0x304c, 0x0c28, 0x1870, 0x2404, 0x0094,
- 0x3050, 0x0c2c, 0x1874, 0x2408, 0x0098,
- 0x3150, 0x0d2c, 0x1974, 0x2508, 0x0198,
- 0x3250, 0x0e2c, 0x1a74, 0x2608, 0x0298,
- 0x3254, 0x0e30, 0x1a78, 0x260c, 0x029c,
- 0x3154, 0x0d30, 0x1978, 0x250c, 0x019c,
- 0x3054, 0x0c30, 0x1878, 0x240c, 0x009c,
- 0x3058, 0x0c34, 0x187c, 0x2410, 0x00a0,
- 0x3158, 0x0d34, 0x197c, 0x2510, 0x01a0,
- 0x3258, 0x0e34, 0x1a7c, 0x2610, 0x02a0,
- 0x325c, 0x0e38, 0x1a80, 0x2614, 0x02a4,
- 0x315c, 0x0d38, 0x1980, 0x2514, 0x01a4,
- 0x305c, 0x0c38, 0x1880, 0x2414, 0x00a4,
- 0x3060, 0x0c3c, 0x1884, 0x2418, 0x00a8,
- 0x3160, 0x0d3c, 0x1984, 0x2518, 0x01a8,
- 0x3260, 0x0e3c, 0x1a84, 0x2618, 0x02a8,
- 0x3264, 0x0e40, 0x1a88, 0x261c, 0x02ac,
- 0x3164, 0x0d40, 0x1988, 0x251c, 0x01ac,
- 0x3064, 0x0c40, 0x1888, 0x241c, 0x00ac,
- 0x3068, 0x0c44, 0x188c, 0x2420, 0x00b0,
- 0x3168, 0x0d44, 0x198c, 0x2520, 0x01b0,
- 0x3268, 0x0e44, 0x1a8c, 0x2620, 0x02b0,
- 0x3648, 0x1224, 0x1e6c, 0x2a00, 0x0690,
- 0x3748, 0x1324, 0x1f6c, 0x2b00, 0x0790,
- 0x3848, 0x1424, 0x206c, 0x2c00, 0x0890,
- 0x384c, 0x1428, 0x2070, 0x2c04, 0x0894,
- 0x374c, 0x1328, 0x1f70, 0x2b04, 0x0794,
- 0x364c, 0x1228, 0x1e70, 0x2a04, 0x0694,
- 0x3650, 0x122c, 0x1e74, 0x2a08, 0x0698,
- 0x3750, 0x132c, 0x1f74, 0x2b08, 0x0798,
- 0x3850, 0x142c, 0x2074, 0x2c08, 0x0898,
- 0x3854, 0x1430, 0x2078, 0x2c0c, 0x089c,
- 0x3754, 0x1330, 0x1f78, 0x2b0c, 0x079c,
- 0x3654, 0x1230, 0x1e78, 0x2a0c, 0x069c,
- 0x3658, 0x1234, 0x1e7c, 0x2a10, 0x06a0,
- 0x3758, 0x1334, 0x1f7c, 0x2b10, 0x07a0,
- 0x3858, 0x1434, 0x207c, 0x2c10, 0x08a0,
- 0x385c, 0x1438, 0x2080, 0x2c14, 0x08a4,
- 0x375c, 0x1338, 0x1f80, 0x2b14, 0x07a4,
- 0x365c, 0x1238, 0x1e80, 0x2a14, 0x06a4,
- 0x3660, 0x123c, 0x1e84, 0x2a18, 0x06a8,
- 0x3760, 0x133c, 0x1f84, 0x2b18, 0x07a8,
- 0x3860, 0x143c, 0x2084, 0x2c18, 0x08a8,
- 0x3864, 0x1440, 0x2088, 0x2c1c, 0x08ac,
- 0x3764, 0x1340, 0x1f88, 0x2b1c, 0x07ac,
- 0x3664, 0x1240, 0x1e88, 0x2a1c, 0x06ac,
- 0x3668, 0x1244, 0x1e8c, 0x2a20, 0x06b0,
- 0x3768, 0x1344, 0x1f8c, 0x2b20, 0x07b0,
- 0x3868, 0x1444, 0x208c, 0x2c20, 0x08b0,
- 0x0048, 0x1824, 0x246c, 0x3000, 0x0c90,
- 0x0148, 0x1924, 0x256c, 0x3100, 0x0d90,
- 0x0248, 0x1a24, 0x266c, 0x3200, 0x0e90,
- 0x024c, 0x1a28, 0x2670, 0x3204, 0x0e94,
- 0x014c, 0x1928, 0x2570, 0x3104, 0x0d94,
- 0x004c, 0x1828, 0x2470, 0x3004, 0x0c94,
- 0x0050, 0x182c, 0x2474, 0x3008, 0x0c98,
- 0x0150, 0x192c, 0x2574, 0x3108, 0x0d98,
- 0x0250, 0x1a2c, 0x2674, 0x3208, 0x0e98,
- 0x0254, 0x1a30, 0x2678, 0x320c, 0x0e9c,
- 0x0154, 0x1930, 0x2578, 0x310c, 0x0d9c,
- 0x0054, 0x1830, 0x2478, 0x300c, 0x0c9c,
- 0x0058, 0x1834, 0x247c, 0x3010, 0x0ca0,
- 0x0158, 0x1934, 0x257c, 0x3110, 0x0da0,
- 0x0258, 0x1a34, 0x267c, 0x3210, 0x0ea0,
- 0x025c, 0x1a38, 0x2680, 0x3214, 0x0ea4,
- 0x015c, 0x1938, 0x2580, 0x3114, 0x0da4,
- 0x005c, 0x1838, 0x2480, 0x3014, 0x0ca4,
- 0x0060, 0x183c, 0x2484, 0x3018, 0x0ca8,
- 0x0160, 0x193c, 0x2584, 0x3118, 0x0da8,
- 0x0260, 0x1a3c, 0x2684, 0x3218, 0x0ea8,
- 0x0264, 0x1a40, 0x2688, 0x321c, 0x0eac,
- 0x0164, 0x1940, 0x2588, 0x311c, 0x0dac,
- 0x0064, 0x1840, 0x2488, 0x301c, 0x0cac,
- 0x0068, 0x1844, 0x248c, 0x3020, 0x0cb0,
- 0x0168, 0x1944, 0x258c, 0x3120, 0x0db0,
- 0x0268, 0x1a44, 0x268c, 0x3220, 0x0eb0,
- 0x0648, 0x1e24, 0x2a6c, 0x3600, 0x1290,
- 0x0748, 0x1f24, 0x2b6c, 0x3700, 0x1390,
- 0x0848, 0x2024, 0x2c6c, 0x3800, 0x1490,
- 0x084c, 0x2028, 0x2c70, 0x3804, 0x1494,
- 0x074c, 0x1f28, 0x2b70, 0x3704, 0x1394,
- 0x064c, 0x1e28, 0x2a70, 0x3604, 0x1294,
- 0x0650, 0x1e2c, 0x2a74, 0x3608, 0x1298,
- 0x0750, 0x1f2c, 0x2b74, 0x3708, 0x1398,
- 0x0850, 0x202c, 0x2c74, 0x3808, 0x1498,
- 0x0854, 0x2030, 0x2c78, 0x380c, 0x149c,
- 0x0754, 0x1f30, 0x2b78, 0x370c, 0x139c,
- 0x0654, 0x1e30, 0x2a78, 0x360c, 0x129c,
- 0x0658, 0x1e34, 0x2a7c, 0x3610, 0x12a0,
- 0x0758, 0x1f34, 0x2b7c, 0x3710, 0x13a0,
- 0x0858, 0x2034, 0x2c7c, 0x3810, 0x14a0,
- 0x085c, 0x2038, 0x2c80, 0x3814, 0x14a4,
- 0x075c, 0x1f38, 0x2b80, 0x3714, 0x13a4,
- 0x065c, 0x1e38, 0x2a80, 0x3614, 0x12a4,
- 0x0660, 0x1e3c, 0x2a84, 0x3618, 0x12a8,
- 0x0760, 0x1f3c, 0x2b84, 0x3718, 0x13a8,
- 0x0860, 0x203c, 0x2c84, 0x3818, 0x14a8,
- 0x0864, 0x2040, 0x2c88, 0x381c, 0x14ac,
- 0x0764, 0x1f40, 0x2b88, 0x371c, 0x13ac,
- 0x0664, 0x1e40, 0x2a88, 0x361c, 0x12ac,
- 0x0668, 0x1e44, 0x2a8c, 0x3620, 0x12b0,
- 0x0768, 0x1f44, 0x2b8c, 0x3720, 0x13b0,
- 0x0868, 0x2044, 0x2c8c, 0x3820, 0x14b0,
- 0x0f48, 0x2724, 0x336c, 0x0300, 0x1b90,
- 0x1048, 0x2824, 0x346c, 0x0400, 0x1c90,
- 0x1148, 0x2924, 0x356c, 0x0500, 0x1d90,
- 0x114c, 0x2928, 0x3570, 0x0504, 0x1d94,
- 0x104c, 0x2828, 0x3470, 0x0404, 0x1c94,
- 0x0f4c, 0x2728, 0x3370, 0x0304, 0x1b94,
- 0x0f50, 0x272c, 0x3374, 0x0308, 0x1b98,
- 0x1050, 0x282c, 0x3474, 0x0408, 0x1c98,
- 0x1150, 0x292c, 0x3574, 0x0508, 0x1d98,
- 0x1154, 0x2930, 0x3578, 0x050c, 0x1d9c,
- 0x1054, 0x2830, 0x3478, 0x040c, 0x1c9c,
- 0x0f54, 0x2730, 0x3378, 0x030c, 0x1b9c,
- 0x0f58, 0x2734, 0x337c, 0x0310, 0x1ba0,
- 0x1058, 0x2834, 0x347c, 0x0410, 0x1ca0,
- 0x1158, 0x2934, 0x357c, 0x0510, 0x1da0,
- 0x115c, 0x2938, 0x3580, 0x0514, 0x1da4,
- 0x105c, 0x2838, 0x3480, 0x0414, 0x1ca4,
- 0x0f5c, 0x2738, 0x3380, 0x0314, 0x1ba4,
- 0x0f60, 0x273c, 0x3384, 0x0318, 0x1ba8,
- 0x1060, 0x283c, 0x3484, 0x0418, 0x1ca8,
- 0x1160, 0x293c, 0x3584, 0x0518, 0x1da8,
- 0x1164, 0x2940, 0x3588, 0x051c, 0x1dac,
- 0x1064, 0x2840, 0x3488, 0x041c, 0x1cac,
- 0x0f64, 0x2740, 0x3388, 0x031c, 0x1bac,
- 0x0f68, 0x2744, 0x338c, 0x0320, 0x1bb0,
- 0x1068, 0x2844, 0x348c, 0x0420, 0x1cb0,
- 0x1168, 0x2944, 0x358c, 0x0520, 0x1db0,
- 0x1548, 0x2d24, 0x396c, 0x0900, 0x2190,
- 0x1648, 0x2e24, 0x3a6c, 0x0a00, 0x2290,
- 0x1748, 0x2f24, 0x3b6c, 0x0b00, 0x2390,
- 0x174c, 0x2f28, 0x3b70, 0x0b04, 0x2394,
- 0x164c, 0x2e28, 0x3a70, 0x0a04, 0x2294,
- 0x154c, 0x2d28, 0x3970, 0x0904, 0x2194,
- 0x1550, 0x2d2c, 0x3974, 0x0908, 0x2198,
- 0x1650, 0x2e2c, 0x3a74, 0x0a08, 0x2298,
- 0x1750, 0x2f2c, 0x3b74, 0x0b08, 0x2398,
- 0x1754, 0x2f30, 0x3b78, 0x0b0c, 0x239c,
- 0x1654, 0x2e30, 0x3a78, 0x0a0c, 0x229c,
- 0x1554, 0x2d30, 0x3978, 0x090c, 0x219c,
- 0x1558, 0x2d34, 0x397c, 0x0910, 0x21a0,
- 0x1658, 0x2e34, 0x3a7c, 0x0a10, 0x22a0,
- 0x1758, 0x2f34, 0x3b7c, 0x0b10, 0x23a0,
- 0x175c, 0x2f38, 0x3b80, 0x0b14, 0x23a4,
- 0x165c, 0x2e38, 0x3a80, 0x0a14, 0x22a4,
- 0x155c, 0x2d38, 0x3980, 0x0914, 0x21a4,
- 0x1560, 0x2d3c, 0x3984, 0x0918, 0x21a8,
- 0x1660, 0x2e3c, 0x3a84, 0x0a18, 0x22a8,
- 0x1760, 0x2f3c, 0x3b84, 0x0b18, 0x23a8,
- 0x1764, 0x2f40, 0x3b88, 0x0b1c, 0x23ac,
- 0x1664, 0x2e40, 0x3a88, 0x0a1c, 0x22ac,
- 0x1564, 0x2d40, 0x3988, 0x091c, 0x21ac,
- 0x1568, 0x2d44, 0x398c, 0x0920, 0x21b0,
- 0x1668, 0x2e44, 0x3a8c, 0x0a20, 0x22b0,
- 0x1768, 0x2f44, 0x3b8c, 0x0b20, 0x23b0,
- 0x1b48, 0x3324, 0x036c, 0x0f00, 0x2790,
- 0x1c48, 0x3424, 0x046c, 0x1000, 0x2890,
- 0x1d48, 0x3524, 0x056c, 0x1100, 0x2990,
- 0x1d4c, 0x3528, 0x0570, 0x1104, 0x2994,
- 0x1c4c, 0x3428, 0x0470, 0x1004, 0x2894,
- 0x1b4c, 0x3328, 0x0370, 0x0f04, 0x2794,
- 0x1b50, 0x332c, 0x0374, 0x0f08, 0x2798,
- 0x1c50, 0x342c, 0x0474, 0x1008, 0x2898,
- 0x1d50, 0x352c, 0x0574, 0x1108, 0x2998,
- 0x1d54, 0x3530, 0x0578, 0x110c, 0x299c,
- 0x1c54, 0x3430, 0x0478, 0x100c, 0x289c,
- 0x1b54, 0x3330, 0x0378, 0x0f0c, 0x279c,
- 0x1b58, 0x3334, 0x037c, 0x0f10, 0x27a0,
- 0x1c58, 0x3434, 0x047c, 0x1010, 0x28a0,
- 0x1d58, 0x3534, 0x057c, 0x1110, 0x29a0,
- 0x1d5c, 0x3538, 0x0580, 0x1114, 0x29a4,
- 0x1c5c, 0x3438, 0x0480, 0x1014, 0x28a4,
- 0x1b5c, 0x3338, 0x0380, 0x0f14, 0x27a4,
- 0x1b60, 0x333c, 0x0384, 0x0f18, 0x27a8,
- 0x1c60, 0x343c, 0x0484, 0x1018, 0x28a8,
- 0x1d60, 0x353c, 0x0584, 0x1118, 0x29a8,
- 0x1d64, 0x3540, 0x0588, 0x111c, 0x29ac,
- 0x1c64, 0x3440, 0x0488, 0x101c, 0x28ac,
- 0x1b64, 0x3340, 0x0388, 0x0f1c, 0x27ac,
- 0x1b68, 0x3344, 0x038c, 0x0f20, 0x27b0,
- 0x1c68, 0x3444, 0x048c, 0x1020, 0x28b0,
- 0x1d68, 0x3544, 0x058c, 0x1120, 0x29b0,
- 0x2148, 0x3924, 0x096c, 0x1500, 0x2d90,
- 0x2248, 0x3a24, 0x0a6c, 0x1600, 0x2e90,
- 0x2348, 0x3b24, 0x0b6c, 0x1700, 0x2f90,
- 0x234c, 0x3b28, 0x0b70, 0x1704, 0x2f94,
- 0x224c, 0x3a28, 0x0a70, 0x1604, 0x2e94,
- 0x214c, 0x3928, 0x0970, 0x1504, 0x2d94,
- 0x2150, 0x392c, 0x0974, 0x1508, 0x2d98,
- 0x2250, 0x3a2c, 0x0a74, 0x1608, 0x2e98,
- 0x2350, 0x3b2c, 0x0b74, 0x1708, 0x2f98,
- 0x2354, 0x3b30, 0x0b78, 0x170c, 0x2f9c,
- 0x2254, 0x3a30, 0x0a78, 0x160c, 0x2e9c,
- 0x2154, 0x3930, 0x0978, 0x150c, 0x2d9c,
- 0x2158, 0x3934, 0x097c, 0x1510, 0x2da0,
- 0x2258, 0x3a34, 0x0a7c, 0x1610, 0x2ea0,
- 0x2358, 0x3b34, 0x0b7c, 0x1710, 0x2fa0,
- 0x235c, 0x3b38, 0x0b80, 0x1714, 0x2fa4,
- 0x225c, 0x3a38, 0x0a80, 0x1614, 0x2ea4,
- 0x215c, 0x3938, 0x0980, 0x1514, 0x2da4,
- 0x2160, 0x393c, 0x0984, 0x1518, 0x2da8,
- 0x2260, 0x3a3c, 0x0a84, 0x1618, 0x2ea8,
- 0x2360, 0x3b3c, 0x0b84, 0x1718, 0x2fa8,
- 0x2364, 0x3b40, 0x0b88, 0x171c, 0x2fac,
- 0x2264, 0x3a40, 0x0a88, 0x161c, 0x2eac,
- 0x2164, 0x3940, 0x0988, 0x151c, 0x2dac,
- 0x2168, 0x3944, 0x098c, 0x1520, 0x2db0,
- 0x2268, 0x3a44, 0x0a8c, 0x1620, 0x2eb0,
- 0x2368, 0x3b44, 0x0b8c, 0x1720, 0x2fb0,
- 0x2748, 0x0324, 0x0f6c, 0x1b00, 0x3390,
- 0x2848, 0x0424, 0x106c, 0x1c00, 0x3490,
- 0x2948, 0x0524, 0x116c, 0x1d00, 0x3590,
- 0x294c, 0x0528, 0x1170, 0x1d04, 0x3594,
- 0x284c, 0x0428, 0x1070, 0x1c04, 0x3494,
- 0x274c, 0x0328, 0x0f70, 0x1b04, 0x3394,
- 0x2750, 0x032c, 0x0f74, 0x1b08, 0x3398,
- 0x2850, 0x042c, 0x1074, 0x1c08, 0x3498,
- 0x2950, 0x052c, 0x1174, 0x1d08, 0x3598,
- 0x2954, 0x0530, 0x1178, 0x1d0c, 0x359c,
- 0x2854, 0x0430, 0x1078, 0x1c0c, 0x349c,
- 0x2754, 0x0330, 0x0f78, 0x1b0c, 0x339c,
- 0x2758, 0x0334, 0x0f7c, 0x1b10, 0x33a0,
- 0x2858, 0x0434, 0x107c, 0x1c10, 0x34a0,
- 0x2958, 0x0534, 0x117c, 0x1d10, 0x35a0,
- 0x295c, 0x0538, 0x1180, 0x1d14, 0x35a4,
- 0x285c, 0x0438, 0x1080, 0x1c14, 0x34a4,
- 0x275c, 0x0338, 0x0f80, 0x1b14, 0x33a4,
- 0x2760, 0x033c, 0x0f84, 0x1b18, 0x33a8,
- 0x2860, 0x043c, 0x1084, 0x1c18, 0x34a8,
- 0x2960, 0x053c, 0x1184, 0x1d18, 0x35a8,
- 0x2964, 0x0540, 0x1188, 0x1d1c, 0x35ac,
- 0x2864, 0x0440, 0x1088, 0x1c1c, 0x34ac,
- 0x2764, 0x0340, 0x0f88, 0x1b1c, 0x33ac,
- 0x2768, 0x0344, 0x0f8c, 0x1b20, 0x33b0,
- 0x2868, 0x0444, 0x108c, 0x1c20, 0x34b0,
- 0x2968, 0x0544, 0x118c, 0x1d20, 0x35b0,
- 0x2d48, 0x0924, 0x156c, 0x2100, 0x3990,
- 0x2e48, 0x0a24, 0x166c, 0x2200, 0x3a90,
- 0x2f48, 0x0b24, 0x176c, 0x2300, 0x3b90,
- 0x2f4c, 0x0b28, 0x1770, 0x2304, 0x3b94,
- 0x2e4c, 0x0a28, 0x1670, 0x2204, 0x3a94,
- 0x2d4c, 0x0928, 0x1570, 0x2104, 0x3994,
- 0x2d50, 0x092c, 0x1574, 0x2108, 0x3998,
- 0x2e50, 0x0a2c, 0x1674, 0x2208, 0x3a98,
- 0x2f50, 0x0b2c, 0x1774, 0x2308, 0x3b98,
- 0x2f54, 0x0b30, 0x1778, 0x230c, 0x3b9c,
- 0x2e54, 0x0a30, 0x1678, 0x220c, 0x3a9c,
- 0x2d54, 0x0930, 0x1578, 0x210c, 0x399c,
- 0x2d58, 0x0934, 0x157c, 0x2110, 0x39a0,
- 0x2e58, 0x0a34, 0x167c, 0x2210, 0x3aa0,
- 0x2f58, 0x0b34, 0x177c, 0x2310, 0x3ba0,
- 0x2f5c, 0x0b38, 0x1780, 0x2314, 0x3ba4,
- 0x2e5c, 0x0a38, 0x1680, 0x2214, 0x3aa4,
- 0x2d5c, 0x0938, 0x1580, 0x2114, 0x39a4,
- 0x2d60, 0x093c, 0x1584, 0x2118, 0x39a8,
- 0x2e60, 0x0a3c, 0x1684, 0x2218, 0x3aa8,
- 0x2f60, 0x0b3c, 0x1784, 0x2318, 0x3ba8,
- 0x2f64, 0x0b40, 0x1788, 0x231c, 0x3bac,
- 0x2e64, 0x0a40, 0x1688, 0x221c, 0x3aac,
- 0x2d64, 0x0940, 0x1588, 0x211c, 0x39ac,
- 0x2d68, 0x0944, 0x158c, 0x2120, 0x39b0,
- 0x2e68, 0x0a44, 0x168c, 0x2220, 0x3ab0,
- 0x2f68, 0x0b44, 0x178c, 0x2320, 0x3bb0,
- 0x3348, 0x0f24, 0x1b6c, 0x2700, 0x0390,
- 0x3448, 0x1024, 0x1c6c, 0x2800, 0x0490,
- 0x3548, 0x1124, 0x1d6c, 0x2900, 0x0590,
- 0x354c, 0x1128, 0x1d70, 0x2904, 0x0594,
- 0x344c, 0x1028, 0x1c70, 0x2804, 0x0494,
- 0x334c, 0x0f28, 0x1b70, 0x2704, 0x0394,
- 0x3350, 0x0f2c, 0x1b74, 0x2708, 0x0398,
- 0x3450, 0x102c, 0x1c74, 0x2808, 0x0498,
- 0x3550, 0x112c, 0x1d74, 0x2908, 0x0598,
- 0x3554, 0x1130, 0x1d78, 0x290c, 0x059c,
- 0x3454, 0x1030, 0x1c78, 0x280c, 0x049c,
- 0x3354, 0x0f30, 0x1b78, 0x270c, 0x039c,
- 0x3358, 0x0f34, 0x1b7c, 0x2710, 0x03a0,
- 0x3458, 0x1034, 0x1c7c, 0x2810, 0x04a0,
- 0x3558, 0x1134, 0x1d7c, 0x2910, 0x05a0,
- 0x355c, 0x1138, 0x1d80, 0x2914, 0x05a4,
- 0x345c, 0x1038, 0x1c80, 0x2814, 0x04a4,
- 0x335c, 0x0f38, 0x1b80, 0x2714, 0x03a4,
- 0x3360, 0x0f3c, 0x1b84, 0x2718, 0x03a8,
- 0x3460, 0x103c, 0x1c84, 0x2818, 0x04a8,
- 0x3560, 0x113c, 0x1d84, 0x2918, 0x05a8,
- 0x3564, 0x1140, 0x1d88, 0x291c, 0x05ac,
- 0x3464, 0x1040, 0x1c88, 0x281c, 0x04ac,
- 0x3364, 0x0f40, 0x1b88, 0x271c, 0x03ac,
- 0x3368, 0x0f44, 0x1b8c, 0x2720, 0x03b0,
- 0x3468, 0x1044, 0x1c8c, 0x2820, 0x04b0,
- 0x3568, 0x1144, 0x1d8c, 0x2920, 0x05b0,
- 0x3948, 0x1524, 0x216c, 0x2d00, 0x0990,
- 0x3a48, 0x1624, 0x226c, 0x2e00, 0x0a90,
- 0x3b48, 0x1724, 0x236c, 0x2f00, 0x0b90,
- 0x3b4c, 0x1728, 0x2370, 0x2f04, 0x0b94,
- 0x3a4c, 0x1628, 0x2270, 0x2e04, 0x0a94,
- 0x394c, 0x1528, 0x2170, 0x2d04, 0x0994,
- 0x3950, 0x152c, 0x2174, 0x2d08, 0x0998,
- 0x3a50, 0x162c, 0x2274, 0x2e08, 0x0a98,
- 0x3b50, 0x172c, 0x2374, 0x2f08, 0x0b98,
- 0x3b54, 0x1730, 0x2378, 0x2f0c, 0x0b9c,
- 0x3a54, 0x1630, 0x2278, 0x2e0c, 0x0a9c,
- 0x3954, 0x1530, 0x2178, 0x2d0c, 0x099c,
- 0x3958, 0x1534, 0x217c, 0x2d10, 0x09a0,
- 0x3a58, 0x1634, 0x227c, 0x2e10, 0x0aa0,
- 0x3b58, 0x1734, 0x237c, 0x2f10, 0x0ba0,
- 0x3b5c, 0x1738, 0x2380, 0x2f14, 0x0ba4,
- 0x3a5c, 0x1638, 0x2280, 0x2e14, 0x0aa4,
- 0x395c, 0x1538, 0x2180, 0x2d14, 0x09a4,
- 0x3960, 0x153c, 0x2184, 0x2d18, 0x09a8,
- 0x3a60, 0x163c, 0x2284, 0x2e18, 0x0aa8,
- 0x3b60, 0x173c, 0x2384, 0x2f18, 0x0ba8,
- 0x3b64, 0x1740, 0x2388, 0x2f1c, 0x0bac,
- 0x3a64, 0x1640, 0x2288, 0x2e1c, 0x0aac,
- 0x3964, 0x1540, 0x2188, 0x2d1c, 0x09ac,
- 0x3968, 0x1544, 0x218c, 0x2d20, 0x09b0,
- 0x3a68, 0x1644, 0x228c, 0x2e20, 0x0ab0,
- 0x3b68, 0x1744, 0x238c, 0x2f20, 0x0bb0,
- 0x0348, 0x1b24, 0x276c, 0x3300, 0x0f90,
- 0x0448, 0x1c24, 0x286c, 0x3400, 0x1090,
- 0x0548, 0x1d24, 0x296c, 0x3500, 0x1190,
- 0x054c, 0x1d28, 0x2970, 0x3504, 0x1194,
- 0x044c, 0x1c28, 0x2870, 0x3404, 0x1094,
- 0x034c, 0x1b28, 0x2770, 0x3304, 0x0f94,
- 0x0350, 0x1b2c, 0x2774, 0x3308, 0x0f98,
- 0x0450, 0x1c2c, 0x2874, 0x3408, 0x1098,
- 0x0550, 0x1d2c, 0x2974, 0x3508, 0x1198,
- 0x0554, 0x1d30, 0x2978, 0x350c, 0x119c,
- 0x0454, 0x1c30, 0x2878, 0x340c, 0x109c,
- 0x0354, 0x1b30, 0x2778, 0x330c, 0x0f9c,
- 0x0358, 0x1b34, 0x277c, 0x3310, 0x0fa0,
- 0x0458, 0x1c34, 0x287c, 0x3410, 0x10a0,
- 0x0558, 0x1d34, 0x297c, 0x3510, 0x11a0,
- 0x055c, 0x1d38, 0x2980, 0x3514, 0x11a4,
- 0x045c, 0x1c38, 0x2880, 0x3414, 0x10a4,
- 0x035c, 0x1b38, 0x2780, 0x3314, 0x0fa4,
- 0x0360, 0x1b3c, 0x2784, 0x3318, 0x0fa8,
- 0x0460, 0x1c3c, 0x2884, 0x3418, 0x10a8,
- 0x0560, 0x1d3c, 0x2984, 0x3518, 0x11a8,
- 0x0564, 0x1d40, 0x2988, 0x351c, 0x11ac,
- 0x0464, 0x1c40, 0x2888, 0x341c, 0x10ac,
- 0x0364, 0x1b40, 0x2788, 0x331c, 0x0fac,
- 0x0368, 0x1b44, 0x278c, 0x3320, 0x0fb0,
- 0x0468, 0x1c44, 0x288c, 0x3420, 0x10b0,
- 0x0568, 0x1d44, 0x298c, 0x3520, 0x11b0,
- 0x0948, 0x2124, 0x2d6c, 0x3900, 0x1590,
- 0x0a48, 0x2224, 0x2e6c, 0x3a00, 0x1690,
- 0x0b48, 0x2324, 0x2f6c, 0x3b00, 0x1790,
- 0x0b4c, 0x2328, 0x2f70, 0x3b04, 0x1794,
- 0x0a4c, 0x2228, 0x2e70, 0x3a04, 0x1694,
- 0x094c, 0x2128, 0x2d70, 0x3904, 0x1594,
- 0x0950, 0x212c, 0x2d74, 0x3908, 0x1598,
- 0x0a50, 0x222c, 0x2e74, 0x3a08, 0x1698,
- 0x0b50, 0x232c, 0x2f74, 0x3b08, 0x1798,
- 0x0b54, 0x2330, 0x2f78, 0x3b0c, 0x179c,
- 0x0a54, 0x2230, 0x2e78, 0x3a0c, 0x169c,
- 0x0954, 0x2130, 0x2d78, 0x390c, 0x159c,
- 0x0958, 0x2134, 0x2d7c, 0x3910, 0x15a0,
- 0x0a58, 0x2234, 0x2e7c, 0x3a10, 0x16a0,
- 0x0b58, 0x2334, 0x2f7c, 0x3b10, 0x17a0,
- 0x0b5c, 0x2338, 0x2f80, 0x3b14, 0x17a4,
- 0x0a5c, 0x2238, 0x2e80, 0x3a14, 0x16a4,
- 0x095c, 0x2138, 0x2d80, 0x3914, 0x15a4,
- 0x0960, 0x213c, 0x2d84, 0x3918, 0x15a8,
- 0x0a60, 0x223c, 0x2e84, 0x3a18, 0x16a8,
- 0x0b60, 0x233c, 0x2f84, 0x3b18, 0x17a8,
- 0x0b64, 0x2340, 0x2f88, 0x3b1c, 0x17ac,
- 0x0a64, 0x2240, 0x2e88, 0x3a1c, 0x16ac,
- 0x0964, 0x2140, 0x2d88, 0x391c, 0x15ac,
- 0x0968, 0x2144, 0x2d8c, 0x3920, 0x15b0,
- 0x0a68, 0x2244, 0x2e8c, 0x3a20, 0x16b0,
- 0x0b68, 0x2344, 0x2f8c, 0x3b20, 0x17b0,
-};
-
-/* 2 channels per frame, 12 DIF sequences per channel,
- 27 video segments per DIF sequence, 5 macroblocks per video segment */
-static const uint16_t dv_place_422_625[2*12*27*5] = {
- 0x0c48, 0x2424, 0x306c, 0x0000, 0x1890,
- 0x0d48, 0x2524, 0x316c, 0x0100, 0x1990,
- 0x0e48, 0x2624, 0x326c, 0x0200, 0x1a90,
- 0x0e4c, 0x2628, 0x3270, 0x0204, 0x1a94,
- 0x0d4c, 0x2528, 0x3170, 0x0104, 0x1994,
- 0x0c4c, 0x2428, 0x3070, 0x0004, 0x1894,
- 0x0c50, 0x242c, 0x3074, 0x0008, 0x1898,
- 0x0d50, 0x252c, 0x3174, 0x0108, 0x1998,
- 0x0e50, 0x262c, 0x3274, 0x0208, 0x1a98,
- 0x0e54, 0x2630, 0x3278, 0x020c, 0x1a9c,
- 0x0d54, 0x2530, 0x3178, 0x010c, 0x199c,
- 0x0c54, 0x2430, 0x3078, 0x000c, 0x189c,
- 0x0c58, 0x2434, 0x307c, 0x0010, 0x18a0,
- 0x0d58, 0x2534, 0x317c, 0x0110, 0x19a0,
- 0x0e58, 0x2634, 0x327c, 0x0210, 0x1aa0,
- 0x0e5c, 0x2638, 0x3280, 0x0214, 0x1aa4,
- 0x0d5c, 0x2538, 0x3180, 0x0114, 0x19a4,
- 0x0c5c, 0x2438, 0x3080, 0x0014, 0x18a4,
- 0x0c60, 0x243c, 0x3084, 0x0018, 0x18a8,
- 0x0d60, 0x253c, 0x3184, 0x0118, 0x19a8,
- 0x0e60, 0x263c, 0x3284, 0x0218, 0x1aa8,
- 0x0e64, 0x2640, 0x3288, 0x021c, 0x1aac,
- 0x0d64, 0x2540, 0x3188, 0x011c, 0x19ac,
- 0x0c64, 0x2440, 0x3088, 0x001c, 0x18ac,
- 0x0c68, 0x2444, 0x308c, 0x0020, 0x18b0,
- 0x0d68, 0x2544, 0x318c, 0x0120, 0x19b0,
- 0x0e68, 0x2644, 0x328c, 0x0220, 0x1ab0,
- 0x1248, 0x2a24, 0x366c, 0x0600, 0x1e90,
- 0x1348, 0x2b24, 0x376c, 0x0700, 0x1f90,
- 0x1448, 0x2c24, 0x386c, 0x0800, 0x2090,
- 0x144c, 0x2c28, 0x3870, 0x0804, 0x2094,
- 0x134c, 0x2b28, 0x3770, 0x0704, 0x1f94,
- 0x124c, 0x2a28, 0x3670, 0x0604, 0x1e94,
- 0x1250, 0x2a2c, 0x3674, 0x0608, 0x1e98,
- 0x1350, 0x2b2c, 0x3774, 0x0708, 0x1f98,
- 0x1450, 0x2c2c, 0x3874, 0x0808, 0x2098,
- 0x1454, 0x2c30, 0x3878, 0x080c, 0x209c,
- 0x1354, 0x2b30, 0x3778, 0x070c, 0x1f9c,
- 0x1254, 0x2a30, 0x3678, 0x060c, 0x1e9c,
- 0x1258, 0x2a34, 0x367c, 0x0610, 0x1ea0,
- 0x1358, 0x2b34, 0x377c, 0x0710, 0x1fa0,
- 0x1458, 0x2c34, 0x387c, 0x0810, 0x20a0,
- 0x145c, 0x2c38, 0x3880, 0x0814, 0x20a4,
- 0x135c, 0x2b38, 0x3780, 0x0714, 0x1fa4,
- 0x125c, 0x2a38, 0x3680, 0x0614, 0x1ea4,
- 0x1260, 0x2a3c, 0x3684, 0x0618, 0x1ea8,
- 0x1360, 0x2b3c, 0x3784, 0x0718, 0x1fa8,
- 0x1460, 0x2c3c, 0x3884, 0x0818, 0x20a8,
- 0x1464, 0x2c40, 0x3888, 0x081c, 0x20ac,
- 0x1364, 0x2b40, 0x3788, 0x071c, 0x1fac,
- 0x1264, 0x2a40, 0x3688, 0x061c, 0x1eac,
- 0x1268, 0x2a44, 0x368c, 0x0620, 0x1eb0,
- 0x1368, 0x2b44, 0x378c, 0x0720, 0x1fb0,
- 0x1468, 0x2c44, 0x388c, 0x0820, 0x20b0,
- 0x1848, 0x3024, 0x3c6c, 0x0c00, 0x2490,
- 0x1948, 0x3124, 0x3d6c, 0x0d00, 0x2590,
- 0x1a48, 0x3224, 0x3e6c, 0x0e00, 0x2690,
- 0x1a4c, 0x3228, 0x3e70, 0x0e04, 0x2694,
- 0x194c, 0x3128, 0x3d70, 0x0d04, 0x2594,
- 0x184c, 0x3028, 0x3c70, 0x0c04, 0x2494,
- 0x1850, 0x302c, 0x3c74, 0x0c08, 0x2498,
- 0x1950, 0x312c, 0x3d74, 0x0d08, 0x2598,
- 0x1a50, 0x322c, 0x3e74, 0x0e08, 0x2698,
- 0x1a54, 0x3230, 0x3e78, 0x0e0c, 0x269c,
- 0x1954, 0x3130, 0x3d78, 0x0d0c, 0x259c,
- 0x1854, 0x3030, 0x3c78, 0x0c0c, 0x249c,
- 0x1858, 0x3034, 0x3c7c, 0x0c10, 0x24a0,
- 0x1958, 0x3134, 0x3d7c, 0x0d10, 0x25a0,
- 0x1a58, 0x3234, 0x3e7c, 0x0e10, 0x26a0,
- 0x1a5c, 0x3238, 0x3e80, 0x0e14, 0x26a4,
- 0x195c, 0x3138, 0x3d80, 0x0d14, 0x25a4,
- 0x185c, 0x3038, 0x3c80, 0x0c14, 0x24a4,
- 0x1860, 0x303c, 0x3c84, 0x0c18, 0x24a8,
- 0x1960, 0x313c, 0x3d84, 0x0d18, 0x25a8,
- 0x1a60, 0x323c, 0x3e84, 0x0e18, 0x26a8,
- 0x1a64, 0x3240, 0x3e88, 0x0e1c, 0x26ac,
- 0x1964, 0x3140, 0x3d88, 0x0d1c, 0x25ac,
- 0x1864, 0x3040, 0x3c88, 0x0c1c, 0x24ac,
- 0x1868, 0x3044, 0x3c8c, 0x0c20, 0x24b0,
- 0x1968, 0x3144, 0x3d8c, 0x0d20, 0x25b0,
- 0x1a68, 0x3244, 0x3e8c, 0x0e20, 0x26b0,
- 0x1e48, 0x3624, 0x426c, 0x1200, 0x2a90,
- 0x1f48, 0x3724, 0x436c, 0x1300, 0x2b90,
- 0x2048, 0x3824, 0x446c, 0x1400, 0x2c90,
- 0x204c, 0x3828, 0x4470, 0x1404, 0x2c94,
- 0x1f4c, 0x3728, 0x4370, 0x1304, 0x2b94,
- 0x1e4c, 0x3628, 0x4270, 0x1204, 0x2a94,
- 0x1e50, 0x362c, 0x4274, 0x1208, 0x2a98,
- 0x1f50, 0x372c, 0x4374, 0x1308, 0x2b98,
- 0x2050, 0x382c, 0x4474, 0x1408, 0x2c98,
- 0x2054, 0x3830, 0x4478, 0x140c, 0x2c9c,
- 0x1f54, 0x3730, 0x4378, 0x130c, 0x2b9c,
- 0x1e54, 0x3630, 0x4278, 0x120c, 0x2a9c,
- 0x1e58, 0x3634, 0x427c, 0x1210, 0x2aa0,
- 0x1f58, 0x3734, 0x437c, 0x1310, 0x2ba0,
- 0x2058, 0x3834, 0x447c, 0x1410, 0x2ca0,
- 0x205c, 0x3838, 0x4480, 0x1414, 0x2ca4,
- 0x1f5c, 0x3738, 0x4380, 0x1314, 0x2ba4,
- 0x1e5c, 0x3638, 0x4280, 0x1214, 0x2aa4,
- 0x1e60, 0x363c, 0x4284, 0x1218, 0x2aa8,
- 0x1f60, 0x373c, 0x4384, 0x1318, 0x2ba8,
- 0x2060, 0x383c, 0x4484, 0x1418, 0x2ca8,
- 0x2064, 0x3840, 0x4488, 0x141c, 0x2cac,
- 0x1f64, 0x3740, 0x4388, 0x131c, 0x2bac,
- 0x1e64, 0x3640, 0x4288, 0x121c, 0x2aac,
- 0x1e68, 0x3644, 0x428c, 0x1220, 0x2ab0,
- 0x1f68, 0x3744, 0x438c, 0x1320, 0x2bb0,
- 0x2068, 0x3844, 0x448c, 0x1420, 0x2cb0,
- 0x2448, 0x3c24, 0x006c, 0x1800, 0x3090,
- 0x2548, 0x3d24, 0x016c, 0x1900, 0x3190,
- 0x2648, 0x3e24, 0x026c, 0x1a00, 0x3290,
- 0x264c, 0x3e28, 0x0270, 0x1a04, 0x3294,
- 0x254c, 0x3d28, 0x0170, 0x1904, 0x3194,
- 0x244c, 0x3c28, 0x0070, 0x1804, 0x3094,
- 0x2450, 0x3c2c, 0x0074, 0x1808, 0x3098,
- 0x2550, 0x3d2c, 0x0174, 0x1908, 0x3198,
- 0x2650, 0x3e2c, 0x0274, 0x1a08, 0x3298,
- 0x2654, 0x3e30, 0x0278, 0x1a0c, 0x329c,
- 0x2554, 0x3d30, 0x0178, 0x190c, 0x319c,
- 0x2454, 0x3c30, 0x0078, 0x180c, 0x309c,
- 0x2458, 0x3c34, 0x007c, 0x1810, 0x30a0,
- 0x2558, 0x3d34, 0x017c, 0x1910, 0x31a0,
- 0x2658, 0x3e34, 0x027c, 0x1a10, 0x32a0,
- 0x265c, 0x3e38, 0x0280, 0x1a14, 0x32a4,
- 0x255c, 0x3d38, 0x0180, 0x1914, 0x31a4,
- 0x245c, 0x3c38, 0x0080, 0x1814, 0x30a4,
- 0x2460, 0x3c3c, 0x0084, 0x1818, 0x30a8,
- 0x2560, 0x3d3c, 0x0184, 0x1918, 0x31a8,
- 0x2660, 0x3e3c, 0x0284, 0x1a18, 0x32a8,
- 0x2664, 0x3e40, 0x0288, 0x1a1c, 0x32ac,
- 0x2564, 0x3d40, 0x0188, 0x191c, 0x31ac,
- 0x2464, 0x3c40, 0x0088, 0x181c, 0x30ac,
- 0x2468, 0x3c44, 0x008c, 0x1820, 0x30b0,
- 0x2568, 0x3d44, 0x018c, 0x1920, 0x31b0,
- 0x2668, 0x3e44, 0x028c, 0x1a20, 0x32b0,
- 0x2a48, 0x4224, 0x066c, 0x1e00, 0x3690,
- 0x2b48, 0x4324, 0x076c, 0x1f00, 0x3790,
- 0x2c48, 0x4424, 0x086c, 0x2000, 0x3890,
- 0x2c4c, 0x4428, 0x0870, 0x2004, 0x3894,
- 0x2b4c, 0x4328, 0x0770, 0x1f04, 0x3794,
- 0x2a4c, 0x4228, 0x0670, 0x1e04, 0x3694,
- 0x2a50, 0x422c, 0x0674, 0x1e08, 0x3698,
- 0x2b50, 0x432c, 0x0774, 0x1f08, 0x3798,
- 0x2c50, 0x442c, 0x0874, 0x2008, 0x3898,
- 0x2c54, 0x4430, 0x0878, 0x200c, 0x389c,
- 0x2b54, 0x4330, 0x0778, 0x1f0c, 0x379c,
- 0x2a54, 0x4230, 0x0678, 0x1e0c, 0x369c,
- 0x2a58, 0x4234, 0x067c, 0x1e10, 0x36a0,
- 0x2b58, 0x4334, 0x077c, 0x1f10, 0x37a0,
- 0x2c58, 0x4434, 0x087c, 0x2010, 0x38a0,
- 0x2c5c, 0x4438, 0x0880, 0x2014, 0x38a4,
- 0x2b5c, 0x4338, 0x0780, 0x1f14, 0x37a4,
- 0x2a5c, 0x4238, 0x0680, 0x1e14, 0x36a4,
- 0x2a60, 0x423c, 0x0684, 0x1e18, 0x36a8,
- 0x2b60, 0x433c, 0x0784, 0x1f18, 0x37a8,
- 0x2c60, 0x443c, 0x0884, 0x2018, 0x38a8,
- 0x2c64, 0x4440, 0x0888, 0x201c, 0x38ac,
- 0x2b64, 0x4340, 0x0788, 0x1f1c, 0x37ac,
- 0x2a64, 0x4240, 0x0688, 0x1e1c, 0x36ac,
- 0x2a68, 0x4244, 0x068c, 0x1e20, 0x36b0,
- 0x2b68, 0x4344, 0x078c, 0x1f20, 0x37b0,
- 0x2c68, 0x4444, 0x088c, 0x2020, 0x38b0,
- 0x3048, 0x0024, 0x0c6c, 0x2400, 0x3c90,
- 0x3148, 0x0124, 0x0d6c, 0x2500, 0x3d90,
- 0x3248, 0x0224, 0x0e6c, 0x2600, 0x3e90,
- 0x324c, 0x0228, 0x0e70, 0x2604, 0x3e94,
- 0x314c, 0x0128, 0x0d70, 0x2504, 0x3d94,
- 0x304c, 0x0028, 0x0c70, 0x2404, 0x3c94,
- 0x3050, 0x002c, 0x0c74, 0x2408, 0x3c98,
- 0x3150, 0x012c, 0x0d74, 0x2508, 0x3d98,
- 0x3250, 0x022c, 0x0e74, 0x2608, 0x3e98,
- 0x3254, 0x0230, 0x0e78, 0x260c, 0x3e9c,
- 0x3154, 0x0130, 0x0d78, 0x250c, 0x3d9c,
- 0x3054, 0x0030, 0x0c78, 0x240c, 0x3c9c,
- 0x3058, 0x0034, 0x0c7c, 0x2410, 0x3ca0,
- 0x3158, 0x0134, 0x0d7c, 0x2510, 0x3da0,
- 0x3258, 0x0234, 0x0e7c, 0x2610, 0x3ea0,
- 0x325c, 0x0238, 0x0e80, 0x2614, 0x3ea4,
- 0x315c, 0x0138, 0x0d80, 0x2514, 0x3da4,
- 0x305c, 0x0038, 0x0c80, 0x2414, 0x3ca4,
- 0x3060, 0x003c, 0x0c84, 0x2418, 0x3ca8,
- 0x3160, 0x013c, 0x0d84, 0x2518, 0x3da8,
- 0x3260, 0x023c, 0x0e84, 0x2618, 0x3ea8,
- 0x3264, 0x0240, 0x0e88, 0x261c, 0x3eac,
- 0x3164, 0x0140, 0x0d88, 0x251c, 0x3dac,
- 0x3064, 0x0040, 0x0c88, 0x241c, 0x3cac,
- 0x3068, 0x0044, 0x0c8c, 0x2420, 0x3cb0,
- 0x3168, 0x0144, 0x0d8c, 0x2520, 0x3db0,
- 0x3268, 0x0244, 0x0e8c, 0x2620, 0x3eb0,
- 0x3648, 0x0624, 0x126c, 0x2a00, 0x4290,
- 0x3748, 0x0724, 0x136c, 0x2b00, 0x4390,
- 0x3848, 0x0824, 0x146c, 0x2c00, 0x4490,
- 0x384c, 0x0828, 0x1470, 0x2c04, 0x4494,
- 0x374c, 0x0728, 0x1370, 0x2b04, 0x4394,
- 0x364c, 0x0628, 0x1270, 0x2a04, 0x4294,
- 0x3650, 0x062c, 0x1274, 0x2a08, 0x4298,
- 0x3750, 0x072c, 0x1374, 0x2b08, 0x4398,
- 0x3850, 0x082c, 0x1474, 0x2c08, 0x4498,
- 0x3854, 0x0830, 0x1478, 0x2c0c, 0x449c,
- 0x3754, 0x0730, 0x1378, 0x2b0c, 0x439c,
- 0x3654, 0x0630, 0x1278, 0x2a0c, 0x429c,
- 0x3658, 0x0634, 0x127c, 0x2a10, 0x42a0,
- 0x3758, 0x0734, 0x137c, 0x2b10, 0x43a0,
- 0x3858, 0x0834, 0x147c, 0x2c10, 0x44a0,
- 0x385c, 0x0838, 0x1480, 0x2c14, 0x44a4,
- 0x375c, 0x0738, 0x1380, 0x2b14, 0x43a4,
- 0x365c, 0x0638, 0x1280, 0x2a14, 0x42a4,
- 0x3660, 0x063c, 0x1284, 0x2a18, 0x42a8,
- 0x3760, 0x073c, 0x1384, 0x2b18, 0x43a8,
- 0x3860, 0x083c, 0x1484, 0x2c18, 0x44a8,
- 0x3864, 0x0840, 0x1488, 0x2c1c, 0x44ac,
- 0x3764, 0x0740, 0x1388, 0x2b1c, 0x43ac,
- 0x3664, 0x0640, 0x1288, 0x2a1c, 0x42ac,
- 0x3668, 0x0644, 0x128c, 0x2a20, 0x42b0,
- 0x3768, 0x0744, 0x138c, 0x2b20, 0x43b0,
- 0x3868, 0x0844, 0x148c, 0x2c20, 0x44b0,
- 0x3c48, 0x0c24, 0x186c, 0x3000, 0x0090,
- 0x3d48, 0x0d24, 0x196c, 0x3100, 0x0190,
- 0x3e48, 0x0e24, 0x1a6c, 0x3200, 0x0290,
- 0x3e4c, 0x0e28, 0x1a70, 0x3204, 0x0294,
- 0x3d4c, 0x0d28, 0x1970, 0x3104, 0x0194,
- 0x3c4c, 0x0c28, 0x1870, 0x3004, 0x0094,
- 0x3c50, 0x0c2c, 0x1874, 0x3008, 0x0098,
- 0x3d50, 0x0d2c, 0x1974, 0x3108, 0x0198,
- 0x3e50, 0x0e2c, 0x1a74, 0x3208, 0x0298,
- 0x3e54, 0x0e30, 0x1a78, 0x320c, 0x029c,
- 0x3d54, 0x0d30, 0x1978, 0x310c, 0x019c,
- 0x3c54, 0x0c30, 0x1878, 0x300c, 0x009c,
- 0x3c58, 0x0c34, 0x187c, 0x3010, 0x00a0,
- 0x3d58, 0x0d34, 0x197c, 0x3110, 0x01a0,
- 0x3e58, 0x0e34, 0x1a7c, 0x3210, 0x02a0,
- 0x3e5c, 0x0e38, 0x1a80, 0x3214, 0x02a4,
- 0x3d5c, 0x0d38, 0x1980, 0x3114, 0x01a4,
- 0x3c5c, 0x0c38, 0x1880, 0x3014, 0x00a4,
- 0x3c60, 0x0c3c, 0x1884, 0x3018, 0x00a8,
- 0x3d60, 0x0d3c, 0x1984, 0x3118, 0x01a8,
- 0x3e60, 0x0e3c, 0x1a84, 0x3218, 0x02a8,
- 0x3e64, 0x0e40, 0x1a88, 0x321c, 0x02ac,
- 0x3d64, 0x0d40, 0x1988, 0x311c, 0x01ac,
- 0x3c64, 0x0c40, 0x1888, 0x301c, 0x00ac,
- 0x3c68, 0x0c44, 0x188c, 0x3020, 0x00b0,
- 0x3d68, 0x0d44, 0x198c, 0x3120, 0x01b0,
- 0x3e68, 0x0e44, 0x1a8c, 0x3220, 0x02b0,
- 0x4248, 0x1224, 0x1e6c, 0x3600, 0x0690,
- 0x4348, 0x1324, 0x1f6c, 0x3700, 0x0790,
- 0x4448, 0x1424, 0x206c, 0x3800, 0x0890,
- 0x444c, 0x1428, 0x2070, 0x3804, 0x0894,
- 0x434c, 0x1328, 0x1f70, 0x3704, 0x0794,
- 0x424c, 0x1228, 0x1e70, 0x3604, 0x0694,
- 0x4250, 0x122c, 0x1e74, 0x3608, 0x0698,
- 0x4350, 0x132c, 0x1f74, 0x3708, 0x0798,
- 0x4450, 0x142c, 0x2074, 0x3808, 0x0898,
- 0x4454, 0x1430, 0x2078, 0x380c, 0x089c,
- 0x4354, 0x1330, 0x1f78, 0x370c, 0x079c,
- 0x4254, 0x1230, 0x1e78, 0x360c, 0x069c,
- 0x4258, 0x1234, 0x1e7c, 0x3610, 0x06a0,
- 0x4358, 0x1334, 0x1f7c, 0x3710, 0x07a0,
- 0x4458, 0x1434, 0x207c, 0x3810, 0x08a0,
- 0x445c, 0x1438, 0x2080, 0x3814, 0x08a4,
- 0x435c, 0x1338, 0x1f80, 0x3714, 0x07a4,
- 0x425c, 0x1238, 0x1e80, 0x3614, 0x06a4,
- 0x4260, 0x123c, 0x1e84, 0x3618, 0x06a8,
- 0x4360, 0x133c, 0x1f84, 0x3718, 0x07a8,
- 0x4460, 0x143c, 0x2084, 0x3818, 0x08a8,
- 0x4464, 0x1440, 0x2088, 0x381c, 0x08ac,
- 0x4364, 0x1340, 0x1f88, 0x371c, 0x07ac,
- 0x4264, 0x1240, 0x1e88, 0x361c, 0x06ac,
- 0x4268, 0x1244, 0x1e8c, 0x3620, 0x06b0,
- 0x4368, 0x1344, 0x1f8c, 0x3720, 0x07b0,
- 0x4468, 0x1444, 0x208c, 0x3820, 0x08b0,
- 0x0048, 0x1824, 0x246c, 0x3c00, 0x0c90,
- 0x0148, 0x1924, 0x256c, 0x3d00, 0x0d90,
- 0x0248, 0x1a24, 0x266c, 0x3e00, 0x0e90,
- 0x024c, 0x1a28, 0x2670, 0x3e04, 0x0e94,
- 0x014c, 0x1928, 0x2570, 0x3d04, 0x0d94,
- 0x004c, 0x1828, 0x2470, 0x3c04, 0x0c94,
- 0x0050, 0x182c, 0x2474, 0x3c08, 0x0c98,
- 0x0150, 0x192c, 0x2574, 0x3d08, 0x0d98,
- 0x0250, 0x1a2c, 0x2674, 0x3e08, 0x0e98,
- 0x0254, 0x1a30, 0x2678, 0x3e0c, 0x0e9c,
- 0x0154, 0x1930, 0x2578, 0x3d0c, 0x0d9c,
- 0x0054, 0x1830, 0x2478, 0x3c0c, 0x0c9c,
- 0x0058, 0x1834, 0x247c, 0x3c10, 0x0ca0,
- 0x0158, 0x1934, 0x257c, 0x3d10, 0x0da0,
- 0x0258, 0x1a34, 0x267c, 0x3e10, 0x0ea0,
- 0x025c, 0x1a38, 0x2680, 0x3e14, 0x0ea4,
- 0x015c, 0x1938, 0x2580, 0x3d14, 0x0da4,
- 0x005c, 0x1838, 0x2480, 0x3c14, 0x0ca4,
- 0x0060, 0x183c, 0x2484, 0x3c18, 0x0ca8,
- 0x0160, 0x193c, 0x2584, 0x3d18, 0x0da8,
- 0x0260, 0x1a3c, 0x2684, 0x3e18, 0x0ea8,
- 0x0264, 0x1a40, 0x2688, 0x3e1c, 0x0eac,
- 0x0164, 0x1940, 0x2588, 0x3d1c, 0x0dac,
- 0x0064, 0x1840, 0x2488, 0x3c1c, 0x0cac,
- 0x0068, 0x1844, 0x248c, 0x3c20, 0x0cb0,
- 0x0168, 0x1944, 0x258c, 0x3d20, 0x0db0,
- 0x0268, 0x1a44, 0x268c, 0x3e20, 0x0eb0,
- 0x0648, 0x1e24, 0x2a6c, 0x4200, 0x1290,
- 0x0748, 0x1f24, 0x2b6c, 0x4300, 0x1390,
- 0x0848, 0x2024, 0x2c6c, 0x4400, 0x1490,
- 0x084c, 0x2028, 0x2c70, 0x4404, 0x1494,
- 0x074c, 0x1f28, 0x2b70, 0x4304, 0x1394,
- 0x064c, 0x1e28, 0x2a70, 0x4204, 0x1294,
- 0x0650, 0x1e2c, 0x2a74, 0x4208, 0x1298,
- 0x0750, 0x1f2c, 0x2b74, 0x4308, 0x1398,
- 0x0850, 0x202c, 0x2c74, 0x4408, 0x1498,
- 0x0854, 0x2030, 0x2c78, 0x440c, 0x149c,
- 0x0754, 0x1f30, 0x2b78, 0x430c, 0x139c,
- 0x0654, 0x1e30, 0x2a78, 0x420c, 0x129c,
- 0x0658, 0x1e34, 0x2a7c, 0x4210, 0x12a0,
- 0x0758, 0x1f34, 0x2b7c, 0x4310, 0x13a0,
- 0x0858, 0x2034, 0x2c7c, 0x4410, 0x14a0,
- 0x085c, 0x2038, 0x2c80, 0x4414, 0x14a4,
- 0x075c, 0x1f38, 0x2b80, 0x4314, 0x13a4,
- 0x065c, 0x1e38, 0x2a80, 0x4214, 0x12a4,
- 0x0660, 0x1e3c, 0x2a84, 0x4218, 0x12a8,
- 0x0760, 0x1f3c, 0x2b84, 0x4318, 0x13a8,
- 0x0860, 0x203c, 0x2c84, 0x4418, 0x14a8,
- 0x0864, 0x2040, 0x2c88, 0x441c, 0x14ac,
- 0x0764, 0x1f40, 0x2b88, 0x431c, 0x13ac,
- 0x0664, 0x1e40, 0x2a88, 0x421c, 0x12ac,
- 0x0668, 0x1e44, 0x2a8c, 0x4220, 0x12b0,
- 0x0768, 0x1f44, 0x2b8c, 0x4320, 0x13b0,
- 0x0868, 0x2044, 0x2c8c, 0x4420, 0x14b0,
- 0x0f48, 0x2724, 0x336c, 0x0300, 0x1b90,
- 0x1048, 0x2824, 0x346c, 0x0400, 0x1c90,
- 0x1148, 0x2924, 0x356c, 0x0500, 0x1d90,
- 0x114c, 0x2928, 0x3570, 0x0504, 0x1d94,
- 0x104c, 0x2828, 0x3470, 0x0404, 0x1c94,
- 0x0f4c, 0x2728, 0x3370, 0x0304, 0x1b94,
- 0x0f50, 0x272c, 0x3374, 0x0308, 0x1b98,
- 0x1050, 0x282c, 0x3474, 0x0408, 0x1c98,
- 0x1150, 0x292c, 0x3574, 0x0508, 0x1d98,
- 0x1154, 0x2930, 0x3578, 0x050c, 0x1d9c,
- 0x1054, 0x2830, 0x3478, 0x040c, 0x1c9c,
- 0x0f54, 0x2730, 0x3378, 0x030c, 0x1b9c,
- 0x0f58, 0x2734, 0x337c, 0x0310, 0x1ba0,
- 0x1058, 0x2834, 0x347c, 0x0410, 0x1ca0,
- 0x1158, 0x2934, 0x357c, 0x0510, 0x1da0,
- 0x115c, 0x2938, 0x3580, 0x0514, 0x1da4,
- 0x105c, 0x2838, 0x3480, 0x0414, 0x1ca4,
- 0x0f5c, 0x2738, 0x3380, 0x0314, 0x1ba4,
- 0x0f60, 0x273c, 0x3384, 0x0318, 0x1ba8,
- 0x1060, 0x283c, 0x3484, 0x0418, 0x1ca8,
- 0x1160, 0x293c, 0x3584, 0x0518, 0x1da8,
- 0x1164, 0x2940, 0x3588, 0x051c, 0x1dac,
- 0x1064, 0x2840, 0x3488, 0x041c, 0x1cac,
- 0x0f64, 0x2740, 0x3388, 0x031c, 0x1bac,
- 0x0f68, 0x2744, 0x338c, 0x0320, 0x1bb0,
- 0x1068, 0x2844, 0x348c, 0x0420, 0x1cb0,
- 0x1168, 0x2944, 0x358c, 0x0520, 0x1db0,
- 0x1548, 0x2d24, 0x396c, 0x0900, 0x2190,
- 0x1648, 0x2e24, 0x3a6c, 0x0a00, 0x2290,
- 0x1748, 0x2f24, 0x3b6c, 0x0b00, 0x2390,
- 0x174c, 0x2f28, 0x3b70, 0x0b04, 0x2394,
- 0x164c, 0x2e28, 0x3a70, 0x0a04, 0x2294,
- 0x154c, 0x2d28, 0x3970, 0x0904, 0x2194,
- 0x1550, 0x2d2c, 0x3974, 0x0908, 0x2198,
- 0x1650, 0x2e2c, 0x3a74, 0x0a08, 0x2298,
- 0x1750, 0x2f2c, 0x3b74, 0x0b08, 0x2398,
- 0x1754, 0x2f30, 0x3b78, 0x0b0c, 0x239c,
- 0x1654, 0x2e30, 0x3a78, 0x0a0c, 0x229c,
- 0x1554, 0x2d30, 0x3978, 0x090c, 0x219c,
- 0x1558, 0x2d34, 0x397c, 0x0910, 0x21a0,
- 0x1658, 0x2e34, 0x3a7c, 0x0a10, 0x22a0,
- 0x1758, 0x2f34, 0x3b7c, 0x0b10, 0x23a0,
- 0x175c, 0x2f38, 0x3b80, 0x0b14, 0x23a4,
- 0x165c, 0x2e38, 0x3a80, 0x0a14, 0x22a4,
- 0x155c, 0x2d38, 0x3980, 0x0914, 0x21a4,
- 0x1560, 0x2d3c, 0x3984, 0x0918, 0x21a8,
- 0x1660, 0x2e3c, 0x3a84, 0x0a18, 0x22a8,
- 0x1760, 0x2f3c, 0x3b84, 0x0b18, 0x23a8,
- 0x1764, 0x2f40, 0x3b88, 0x0b1c, 0x23ac,
- 0x1664, 0x2e40, 0x3a88, 0x0a1c, 0x22ac,
- 0x1564, 0x2d40, 0x3988, 0x091c, 0x21ac,
- 0x1568, 0x2d44, 0x398c, 0x0920, 0x21b0,
- 0x1668, 0x2e44, 0x3a8c, 0x0a20, 0x22b0,
- 0x1768, 0x2f44, 0x3b8c, 0x0b20, 0x23b0,
- 0x1b48, 0x3324, 0x3f6c, 0x0f00, 0x2790,
- 0x1c48, 0x3424, 0x406c, 0x1000, 0x2890,
- 0x1d48, 0x3524, 0x416c, 0x1100, 0x2990,
- 0x1d4c, 0x3528, 0x4170, 0x1104, 0x2994,
- 0x1c4c, 0x3428, 0x4070, 0x1004, 0x2894,
- 0x1b4c, 0x3328, 0x3f70, 0x0f04, 0x2794,
- 0x1b50, 0x332c, 0x3f74, 0x0f08, 0x2798,
- 0x1c50, 0x342c, 0x4074, 0x1008, 0x2898,
- 0x1d50, 0x352c, 0x4174, 0x1108, 0x2998,
- 0x1d54, 0x3530, 0x4178, 0x110c, 0x299c,
- 0x1c54, 0x3430, 0x4078, 0x100c, 0x289c,
- 0x1b54, 0x3330, 0x3f78, 0x0f0c, 0x279c,
- 0x1b58, 0x3334, 0x3f7c, 0x0f10, 0x27a0,
- 0x1c58, 0x3434, 0x407c, 0x1010, 0x28a0,
- 0x1d58, 0x3534, 0x417c, 0x1110, 0x29a0,
- 0x1d5c, 0x3538, 0x4180, 0x1114, 0x29a4,
- 0x1c5c, 0x3438, 0x4080, 0x1014, 0x28a4,
- 0x1b5c, 0x3338, 0x3f80, 0x0f14, 0x27a4,
- 0x1b60, 0x333c, 0x3f84, 0x0f18, 0x27a8,
- 0x1c60, 0x343c, 0x4084, 0x1018, 0x28a8,
- 0x1d60, 0x353c, 0x4184, 0x1118, 0x29a8,
- 0x1d64, 0x3540, 0x4188, 0x111c, 0x29ac,
- 0x1c64, 0x3440, 0x4088, 0x101c, 0x28ac,
- 0x1b64, 0x3340, 0x3f88, 0x0f1c, 0x27ac,
- 0x1b68, 0x3344, 0x3f8c, 0x0f20, 0x27b0,
- 0x1c68, 0x3444, 0x408c, 0x1020, 0x28b0,
- 0x1d68, 0x3544, 0x418c, 0x1120, 0x29b0,
- 0x2148, 0x3924, 0x456c, 0x1500, 0x2d90,
- 0x2248, 0x3a24, 0x466c, 0x1600, 0x2e90,
- 0x2348, 0x3b24, 0x476c, 0x1700, 0x2f90,
- 0x234c, 0x3b28, 0x4770, 0x1704, 0x2f94,
- 0x224c, 0x3a28, 0x4670, 0x1604, 0x2e94,
- 0x214c, 0x3928, 0x4570, 0x1504, 0x2d94,
- 0x2150, 0x392c, 0x4574, 0x1508, 0x2d98,
- 0x2250, 0x3a2c, 0x4674, 0x1608, 0x2e98,
- 0x2350, 0x3b2c, 0x4774, 0x1708, 0x2f98,
- 0x2354, 0x3b30, 0x4778, 0x170c, 0x2f9c,
- 0x2254, 0x3a30, 0x4678, 0x160c, 0x2e9c,
- 0x2154, 0x3930, 0x4578, 0x150c, 0x2d9c,
- 0x2158, 0x3934, 0x457c, 0x1510, 0x2da0,
- 0x2258, 0x3a34, 0x467c, 0x1610, 0x2ea0,
- 0x2358, 0x3b34, 0x477c, 0x1710, 0x2fa0,
- 0x235c, 0x3b38, 0x4780, 0x1714, 0x2fa4,
- 0x225c, 0x3a38, 0x4680, 0x1614, 0x2ea4,
- 0x215c, 0x3938, 0x4580, 0x1514, 0x2da4,
- 0x2160, 0x393c, 0x4584, 0x1518, 0x2da8,
- 0x2260, 0x3a3c, 0x4684, 0x1618, 0x2ea8,
- 0x2360, 0x3b3c, 0x4784, 0x1718, 0x2fa8,
- 0x2364, 0x3b40, 0x4788, 0x171c, 0x2fac,
- 0x2264, 0x3a40, 0x4688, 0x161c, 0x2eac,
- 0x2164, 0x3940, 0x4588, 0x151c, 0x2dac,
- 0x2168, 0x3944, 0x458c, 0x1520, 0x2db0,
- 0x2268, 0x3a44, 0x468c, 0x1620, 0x2eb0,
- 0x2368, 0x3b44, 0x478c, 0x1720, 0x2fb0,
- 0x2748, 0x3f24, 0x036c, 0x1b00, 0x3390,
- 0x2848, 0x4024, 0x046c, 0x1c00, 0x3490,
- 0x2948, 0x4124, 0x056c, 0x1d00, 0x3590,
- 0x294c, 0x4128, 0x0570, 0x1d04, 0x3594,
- 0x284c, 0x4028, 0x0470, 0x1c04, 0x3494,
- 0x274c, 0x3f28, 0x0370, 0x1b04, 0x3394,
- 0x2750, 0x3f2c, 0x0374, 0x1b08, 0x3398,
- 0x2850, 0x402c, 0x0474, 0x1c08, 0x3498,
- 0x2950, 0x412c, 0x0574, 0x1d08, 0x3598,
- 0x2954, 0x4130, 0x0578, 0x1d0c, 0x359c,
- 0x2854, 0x4030, 0x0478, 0x1c0c, 0x349c,
- 0x2754, 0x3f30, 0x0378, 0x1b0c, 0x339c,
- 0x2758, 0x3f34, 0x037c, 0x1b10, 0x33a0,
- 0x2858, 0x4034, 0x047c, 0x1c10, 0x34a0,
- 0x2958, 0x4134, 0x057c, 0x1d10, 0x35a0,
- 0x295c, 0x4138, 0x0580, 0x1d14, 0x35a4,
- 0x285c, 0x4038, 0x0480, 0x1c14, 0x34a4,
- 0x275c, 0x3f38, 0x0380, 0x1b14, 0x33a4,
- 0x2760, 0x3f3c, 0x0384, 0x1b18, 0x33a8,
- 0x2860, 0x403c, 0x0484, 0x1c18, 0x34a8,
- 0x2960, 0x413c, 0x0584, 0x1d18, 0x35a8,
- 0x2964, 0x4140, 0x0588, 0x1d1c, 0x35ac,
- 0x2864, 0x4040, 0x0488, 0x1c1c, 0x34ac,
- 0x2764, 0x3f40, 0x0388, 0x1b1c, 0x33ac,
- 0x2768, 0x3f44, 0x038c, 0x1b20, 0x33b0,
- 0x2868, 0x4044, 0x048c, 0x1c20, 0x34b0,
- 0x2968, 0x4144, 0x058c, 0x1d20, 0x35b0,
- 0x2d48, 0x4524, 0x096c, 0x2100, 0x3990,
- 0x2e48, 0x4624, 0x0a6c, 0x2200, 0x3a90,
- 0x2f48, 0x4724, 0x0b6c, 0x2300, 0x3b90,
- 0x2f4c, 0x4728, 0x0b70, 0x2304, 0x3b94,
- 0x2e4c, 0x4628, 0x0a70, 0x2204, 0x3a94,
- 0x2d4c, 0x4528, 0x0970, 0x2104, 0x3994,
- 0x2d50, 0x452c, 0x0974, 0x2108, 0x3998,
- 0x2e50, 0x462c, 0x0a74, 0x2208, 0x3a98,
- 0x2f50, 0x472c, 0x0b74, 0x2308, 0x3b98,
- 0x2f54, 0x4730, 0x0b78, 0x230c, 0x3b9c,
- 0x2e54, 0x4630, 0x0a78, 0x220c, 0x3a9c,
- 0x2d54, 0x4530, 0x0978, 0x210c, 0x399c,
- 0x2d58, 0x4534, 0x097c, 0x2110, 0x39a0,
- 0x2e58, 0x4634, 0x0a7c, 0x2210, 0x3aa0,
- 0x2f58, 0x4734, 0x0b7c, 0x2310, 0x3ba0,
- 0x2f5c, 0x4738, 0x0b80, 0x2314, 0x3ba4,
- 0x2e5c, 0x4638, 0x0a80, 0x2214, 0x3aa4,
- 0x2d5c, 0x4538, 0x0980, 0x2114, 0x39a4,
- 0x2d60, 0x453c, 0x0984, 0x2118, 0x39a8,
- 0x2e60, 0x463c, 0x0a84, 0x2218, 0x3aa8,
- 0x2f60, 0x473c, 0x0b84, 0x2318, 0x3ba8,
- 0x2f64, 0x4740, 0x0b88, 0x231c, 0x3bac,
- 0x2e64, 0x4640, 0x0a88, 0x221c, 0x3aac,
- 0x2d64, 0x4540, 0x0988, 0x211c, 0x39ac,
- 0x2d68, 0x4544, 0x098c, 0x2120, 0x39b0,
- 0x2e68, 0x4644, 0x0a8c, 0x2220, 0x3ab0,
- 0x2f68, 0x4744, 0x0b8c, 0x2320, 0x3bb0,
- 0x3348, 0x0324, 0x0f6c, 0x2700, 0x3f90,
- 0x3448, 0x0424, 0x106c, 0x2800, 0x4090,
- 0x3548, 0x0524, 0x116c, 0x2900, 0x4190,
- 0x354c, 0x0528, 0x1170, 0x2904, 0x4194,
- 0x344c, 0x0428, 0x1070, 0x2804, 0x4094,
- 0x334c, 0x0328, 0x0f70, 0x2704, 0x3f94,
- 0x3350, 0x032c, 0x0f74, 0x2708, 0x3f98,
- 0x3450, 0x042c, 0x1074, 0x2808, 0x4098,
- 0x3550, 0x052c, 0x1174, 0x2908, 0x4198,
- 0x3554, 0x0530, 0x1178, 0x290c, 0x419c,
- 0x3454, 0x0430, 0x1078, 0x280c, 0x409c,
- 0x3354, 0x0330, 0x0f78, 0x270c, 0x3f9c,
- 0x3358, 0x0334, 0x0f7c, 0x2710, 0x3fa0,
- 0x3458, 0x0434, 0x107c, 0x2810, 0x40a0,
- 0x3558, 0x0534, 0x117c, 0x2910, 0x41a0,
- 0x355c, 0x0538, 0x1180, 0x2914, 0x41a4,
- 0x345c, 0x0438, 0x1080, 0x2814, 0x40a4,
- 0x335c, 0x0338, 0x0f80, 0x2714, 0x3fa4,
- 0x3360, 0x033c, 0x0f84, 0x2718, 0x3fa8,
- 0x3460, 0x043c, 0x1084, 0x2818, 0x40a8,
- 0x3560, 0x053c, 0x1184, 0x2918, 0x41a8,
- 0x3564, 0x0540, 0x1188, 0x291c, 0x41ac,
- 0x3464, 0x0440, 0x1088, 0x281c, 0x40ac,
- 0x3364, 0x0340, 0x0f88, 0x271c, 0x3fac,
- 0x3368, 0x0344, 0x0f8c, 0x2720, 0x3fb0,
- 0x3468, 0x0444, 0x108c, 0x2820, 0x40b0,
- 0x3568, 0x0544, 0x118c, 0x2920, 0x41b0,
- 0x3948, 0x0924, 0x156c, 0x2d00, 0x4590,
- 0x3a48, 0x0a24, 0x166c, 0x2e00, 0x4690,
- 0x3b48, 0x0b24, 0x176c, 0x2f00, 0x4790,
- 0x3b4c, 0x0b28, 0x1770, 0x2f04, 0x4794,
- 0x3a4c, 0x0a28, 0x1670, 0x2e04, 0x4694,
- 0x394c, 0x0928, 0x1570, 0x2d04, 0x4594,
- 0x3950, 0x092c, 0x1574, 0x2d08, 0x4598,
- 0x3a50, 0x0a2c, 0x1674, 0x2e08, 0x4698,
- 0x3b50, 0x0b2c, 0x1774, 0x2f08, 0x4798,
- 0x3b54, 0x0b30, 0x1778, 0x2f0c, 0x479c,
- 0x3a54, 0x0a30, 0x1678, 0x2e0c, 0x469c,
- 0x3954, 0x0930, 0x1578, 0x2d0c, 0x459c,
- 0x3958, 0x0934, 0x157c, 0x2d10, 0x45a0,
- 0x3a58, 0x0a34, 0x167c, 0x2e10, 0x46a0,
- 0x3b58, 0x0b34, 0x177c, 0x2f10, 0x47a0,
- 0x3b5c, 0x0b38, 0x1780, 0x2f14, 0x47a4,
- 0x3a5c, 0x0a38, 0x1680, 0x2e14, 0x46a4,
- 0x395c, 0x0938, 0x1580, 0x2d14, 0x45a4,
- 0x3960, 0x093c, 0x1584, 0x2d18, 0x45a8,
- 0x3a60, 0x0a3c, 0x1684, 0x2e18, 0x46a8,
- 0x3b60, 0x0b3c, 0x1784, 0x2f18, 0x47a8,
- 0x3b64, 0x0b40, 0x1788, 0x2f1c, 0x47ac,
- 0x3a64, 0x0a40, 0x1688, 0x2e1c, 0x46ac,
- 0x3964, 0x0940, 0x1588, 0x2d1c, 0x45ac,
- 0x3968, 0x0944, 0x158c, 0x2d20, 0x45b0,
- 0x3a68, 0x0a44, 0x168c, 0x2e20, 0x46b0,
- 0x3b68, 0x0b44, 0x178c, 0x2f20, 0x47b0,
- 0x3f48, 0x0f24, 0x1b6c, 0x3300, 0x0390,
- 0x4048, 0x1024, 0x1c6c, 0x3400, 0x0490,
- 0x4148, 0x1124, 0x1d6c, 0x3500, 0x0590,
- 0x414c, 0x1128, 0x1d70, 0x3504, 0x0594,
- 0x404c, 0x1028, 0x1c70, 0x3404, 0x0494,
- 0x3f4c, 0x0f28, 0x1b70, 0x3304, 0x0394,
- 0x3f50, 0x0f2c, 0x1b74, 0x3308, 0x0398,
- 0x4050, 0x102c, 0x1c74, 0x3408, 0x0498,
- 0x4150, 0x112c, 0x1d74, 0x3508, 0x0598,
- 0x4154, 0x1130, 0x1d78, 0x350c, 0x059c,
- 0x4054, 0x1030, 0x1c78, 0x340c, 0x049c,
- 0x3f54, 0x0f30, 0x1b78, 0x330c, 0x039c,
- 0x3f58, 0x0f34, 0x1b7c, 0x3310, 0x03a0,
- 0x4058, 0x1034, 0x1c7c, 0x3410, 0x04a0,
- 0x4158, 0x1134, 0x1d7c, 0x3510, 0x05a0,
- 0x415c, 0x1138, 0x1d80, 0x3514, 0x05a4,
- 0x405c, 0x1038, 0x1c80, 0x3414, 0x04a4,
- 0x3f5c, 0x0f38, 0x1b80, 0x3314, 0x03a4,
- 0x3f60, 0x0f3c, 0x1b84, 0x3318, 0x03a8,
- 0x4060, 0x103c, 0x1c84, 0x3418, 0x04a8,
- 0x4160, 0x113c, 0x1d84, 0x3518, 0x05a8,
- 0x4164, 0x1140, 0x1d88, 0x351c, 0x05ac,
- 0x4064, 0x1040, 0x1c88, 0x341c, 0x04ac,
- 0x3f64, 0x0f40, 0x1b88, 0x331c, 0x03ac,
- 0x3f68, 0x0f44, 0x1b8c, 0x3320, 0x03b0,
- 0x4068, 0x1044, 0x1c8c, 0x3420, 0x04b0,
- 0x4168, 0x1144, 0x1d8c, 0x3520, 0x05b0,
- 0x4548, 0x1524, 0x216c, 0x3900, 0x0990,
- 0x4648, 0x1624, 0x226c, 0x3a00, 0x0a90,
- 0x4748, 0x1724, 0x236c, 0x3b00, 0x0b90,
- 0x474c, 0x1728, 0x2370, 0x3b04, 0x0b94,
- 0x464c, 0x1628, 0x2270, 0x3a04, 0x0a94,
- 0x454c, 0x1528, 0x2170, 0x3904, 0x0994,
- 0x4550, 0x152c, 0x2174, 0x3908, 0x0998,
- 0x4650, 0x162c, 0x2274, 0x3a08, 0x0a98,
- 0x4750, 0x172c, 0x2374, 0x3b08, 0x0b98,
- 0x4754, 0x1730, 0x2378, 0x3b0c, 0x0b9c,
- 0x4654, 0x1630, 0x2278, 0x3a0c, 0x0a9c,
- 0x4554, 0x1530, 0x2178, 0x390c, 0x099c,
- 0x4558, 0x1534, 0x217c, 0x3910, 0x09a0,
- 0x4658, 0x1634, 0x227c, 0x3a10, 0x0aa0,
- 0x4758, 0x1734, 0x237c, 0x3b10, 0x0ba0,
- 0x475c, 0x1738, 0x2380, 0x3b14, 0x0ba4,
- 0x465c, 0x1638, 0x2280, 0x3a14, 0x0aa4,
- 0x455c, 0x1538, 0x2180, 0x3914, 0x09a4,
- 0x4560, 0x153c, 0x2184, 0x3918, 0x09a8,
- 0x4660, 0x163c, 0x2284, 0x3a18, 0x0aa8,
- 0x4760, 0x173c, 0x2384, 0x3b18, 0x0ba8,
- 0x4764, 0x1740, 0x2388, 0x3b1c, 0x0bac,
- 0x4664, 0x1640, 0x2288, 0x3a1c, 0x0aac,
- 0x4564, 0x1540, 0x2188, 0x391c, 0x09ac,
- 0x4568, 0x1544, 0x218c, 0x3920, 0x09b0,
- 0x4668, 0x1644, 0x228c, 0x3a20, 0x0ab0,
- 0x4768, 0x1744, 0x238c, 0x3b20, 0x0bb0,
- 0x0348, 0x1b24, 0x276c, 0x3f00, 0x0f90,
- 0x0448, 0x1c24, 0x286c, 0x4000, 0x1090,
- 0x0548, 0x1d24, 0x296c, 0x4100, 0x1190,
- 0x054c, 0x1d28, 0x2970, 0x4104, 0x1194,
- 0x044c, 0x1c28, 0x2870, 0x4004, 0x1094,
- 0x034c, 0x1b28, 0x2770, 0x3f04, 0x0f94,
- 0x0350, 0x1b2c, 0x2774, 0x3f08, 0x0f98,
- 0x0450, 0x1c2c, 0x2874, 0x4008, 0x1098,
- 0x0550, 0x1d2c, 0x2974, 0x4108, 0x1198,
- 0x0554, 0x1d30, 0x2978, 0x410c, 0x119c,
- 0x0454, 0x1c30, 0x2878, 0x400c, 0x109c,
- 0x0354, 0x1b30, 0x2778, 0x3f0c, 0x0f9c,
- 0x0358, 0x1b34, 0x277c, 0x3f10, 0x0fa0,
- 0x0458, 0x1c34, 0x287c, 0x4010, 0x10a0,
- 0x0558, 0x1d34, 0x297c, 0x4110, 0x11a0,
- 0x055c, 0x1d38, 0x2980, 0x4114, 0x11a4,
- 0x045c, 0x1c38, 0x2880, 0x4014, 0x10a4,
- 0x035c, 0x1b38, 0x2780, 0x3f14, 0x0fa4,
- 0x0360, 0x1b3c, 0x2784, 0x3f18, 0x0fa8,
- 0x0460, 0x1c3c, 0x2884, 0x4018, 0x10a8,
- 0x0560, 0x1d3c, 0x2984, 0x4118, 0x11a8,
- 0x0564, 0x1d40, 0x2988, 0x411c, 0x11ac,
- 0x0464, 0x1c40, 0x2888, 0x401c, 0x10ac,
- 0x0364, 0x1b40, 0x2788, 0x3f1c, 0x0fac,
- 0x0368, 0x1b44, 0x278c, 0x3f20, 0x0fb0,
- 0x0468, 0x1c44, 0x288c, 0x4020, 0x10b0,
- 0x0568, 0x1d44, 0x298c, 0x4120, 0x11b0,
- 0x0948, 0x2124, 0x2d6c, 0x4500, 0x1590,
- 0x0a48, 0x2224, 0x2e6c, 0x4600, 0x1690,
- 0x0b48, 0x2324, 0x2f6c, 0x4700, 0x1790,
- 0x0b4c, 0x2328, 0x2f70, 0x4704, 0x1794,
- 0x0a4c, 0x2228, 0x2e70, 0x4604, 0x1694,
- 0x094c, 0x2128, 0x2d70, 0x4504, 0x1594,
- 0x0950, 0x212c, 0x2d74, 0x4508, 0x1598,
- 0x0a50, 0x222c, 0x2e74, 0x4608, 0x1698,
- 0x0b50, 0x232c, 0x2f74, 0x4708, 0x1798,
- 0x0b54, 0x2330, 0x2f78, 0x470c, 0x179c,
- 0x0a54, 0x2230, 0x2e78, 0x460c, 0x169c,
- 0x0954, 0x2130, 0x2d78, 0x450c, 0x159c,
- 0x0958, 0x2134, 0x2d7c, 0x4510, 0x15a0,
- 0x0a58, 0x2234, 0x2e7c, 0x4610, 0x16a0,
- 0x0b58, 0x2334, 0x2f7c, 0x4710, 0x17a0,
- 0x0b5c, 0x2338, 0x2f80, 0x4714, 0x17a4,
- 0x0a5c, 0x2238, 0x2e80, 0x4614, 0x16a4,
- 0x095c, 0x2138, 0x2d80, 0x4514, 0x15a4,
- 0x0960, 0x213c, 0x2d84, 0x4518, 0x15a8,
- 0x0a60, 0x223c, 0x2e84, 0x4618, 0x16a8,
- 0x0b60, 0x233c, 0x2f84, 0x4718, 0x17a8,
- 0x0b64, 0x2340, 0x2f88, 0x471c, 0x17ac,
- 0x0a64, 0x2240, 0x2e88, 0x461c, 0x16ac,
- 0x0964, 0x2140, 0x2d88, 0x451c, 0x15ac,
- 0x0968, 0x2144, 0x2d8c, 0x4520, 0x15b0,
- 0x0a68, 0x2244, 0x2e8c, 0x4620, 0x16b0,
- 0x0b68, 0x2344, 0x2f8c, 0x4720, 0x17b0,
-};
-
-/* DV25/50 DCT coefficient weights and inverse weights */
-/* created by dvtables.py */
-static const int dv_weight_bits = 18;
-static const int dv_weight_88[64] = {
- 131072, 257107, 257107, 242189, 252167, 242189, 235923, 237536,
- 237536, 235923, 229376, 231390, 223754, 231390, 229376, 222935,
- 224969, 217965, 217965, 224969, 222935, 200636, 218652, 211916,
- 212325, 211916, 218652, 200636, 188995, 196781, 205965, 206433,
- 206433, 205965, 196781, 188995, 185364, 185364, 200636, 200704,
- 200636, 185364, 185364, 174609, 180568, 195068, 195068, 180568,
- 174609, 170091, 175557, 189591, 175557, 170091, 165371, 170627,
- 170627, 165371, 160727, 153560, 160727, 144651, 144651, 136258,
-};
-static const int dv_weight_248[64] = {
- 131072, 242189, 257107, 237536, 229376, 200636, 242189, 223754,
- 224969, 196781, 262144, 242189, 229376, 200636, 257107, 237536,
- 211916, 185364, 235923, 217965, 229376, 211916, 206433, 180568,
- 242189, 223754, 224969, 196781, 211916, 185364, 235923, 217965,
- 200704, 175557, 222935, 205965, 200636, 185364, 195068, 170627,
- 229376, 211916, 206433, 180568, 200704, 175557, 222935, 205965,
- 175557, 153560, 188995, 174609, 165371, 144651, 200636, 185364,
- 195068, 170627, 175557, 153560, 188995, 174609, 165371, 144651,
-};
-static const int dv_iweight_bits = 14;
-static const int dv_iweight_88[64] = {
- 32768, 16710, 16710, 17735, 17015, 17735, 18197, 18079,
- 18079, 18197, 18725, 18559, 19196, 18559, 18725, 19284,
- 19108, 19692, 19692, 19108, 19284, 21400, 19645, 20262,
- 20214, 20262, 19645, 21400, 22733, 21845, 20867, 20815,
- 20815, 20867, 21845, 22733, 23173, 23173, 21400, 21400,
- 21400, 23173, 23173, 24600, 23764, 22017, 22017, 23764,
- 24600, 25267, 24457, 22672, 24457, 25267, 25971, 25191,
- 25191, 25971, 26715, 27962, 26715, 29642, 29642, 31536,
-};
-static const int dv_iweight_248[64] = {
- 32768, 17735, 16710, 18079, 18725, 21400, 17735, 19196,
- 19108, 21845, 16384, 17735, 18725, 21400, 16710, 18079,
- 20262, 23173, 18197, 19692, 18725, 20262, 20815, 23764,
- 17735, 19196, 19108, 21845, 20262, 23173, 18197, 19692,
- 21400, 24457, 19284, 20867, 21400, 23173, 22017, 25191,
- 18725, 20262, 20815, 23764, 21400, 24457, 19284, 20867,
- 24457, 27962, 22733, 24600, 25971, 29642, 21400, 23173,
- 22017, 25191, 24457, 27962, 22733, 24600, 25971, 29642,
-};
-
-static const uint8_t dv_audio_shuffle525[10][9] = {
- { 0, 30, 60, 20, 50, 80, 10, 40, 70 }, /* 1st channel */
- { 6, 36, 66, 26, 56, 86, 16, 46, 76 },
- { 12, 42, 72, 2, 32, 62, 22, 52, 82 },
- { 18, 48, 78, 8, 38, 68, 28, 58, 88 },
- { 24, 54, 84, 14, 44, 74, 4, 34, 64 },
-
- { 1, 31, 61, 21, 51, 81, 11, 41, 71 }, /* 2nd channel */
- { 7, 37, 67, 27, 57, 87, 17, 47, 77 },
- { 13, 43, 73, 3, 33, 63, 23, 53, 83 },
- { 19, 49, 79, 9, 39, 69, 29, 59, 89 },
- { 25, 55, 85, 15, 45, 75, 5, 35, 65 },
-};
-
-static const uint8_t dv_audio_shuffle625[12][9] = {
- { 0, 36, 72, 26, 62, 98, 16, 52, 88}, /* 1st channel */
- { 6, 42, 78, 32, 68, 104, 22, 58, 94},
- { 12, 48, 84, 2, 38, 74, 28, 64, 100},
- { 18, 54, 90, 8, 44, 80, 34, 70, 106},
- { 24, 60, 96, 14, 50, 86, 4, 40, 76},
- { 30, 66, 102, 20, 56, 92, 10, 46, 82},
-
- { 1, 37, 73, 27, 63, 99, 17, 53, 89}, /* 2nd channel */
- { 7, 43, 79, 33, 69, 105, 23, 59, 95},
- { 13, 49, 85, 3, 39, 75, 29, 65, 101},
- { 19, 55, 91, 9, 45, 81, 35, 71, 107},
- { 25, 61, 97, 15, 51, 87, 5, 41, 77},
- { 31, 67, 103, 21, 57, 93, 11, 47, 83},
-};
-
-static const __attribute__((unused)) int dv_audio_frequency[3] = {
- 48000, 44100, 32000,
-};
-
-static const DVprofile dv_profiles[] = {
- { .dsf = 0,
- .frame_size = 120000, /* IEC 61834, SMPTE-314M - 525/60 (NTSC) */
- .difseg_size = 10,
- .n_difchan = 1,
- .frame_rate = 30000,
- .ltc_divisor = 30,
- .frame_rate_base = 1001,
- .height = 480,
- .width = 720,
- .sar = {{10, 11}, {40, 33}},
- .video_place = dv_place_411,
- .pix_fmt = PIX_FMT_YUV411P,
- .audio_stride = 90,
- .audio_min_samples = { 1580, 1452, 1053 }, /* for 48, 44.1 and 32Khz */
- .audio_samples_dist = { 1600, 1602, 1602, 1602, 1602 }, /* per SMPTE-314M */
- .audio_shuffle = dv_audio_shuffle525,
- },
- { .dsf = 1,
- .frame_size = 144000, /* IEC 61834 - 625/50 (PAL) */
- .difseg_size = 12,
- .n_difchan = 1,
- .frame_rate = 25,
- .frame_rate_base = 1,
- .ltc_divisor = 25,
- .height = 576,
- .width = 720,
- .sar = {{59, 54}, {118, 81}},
- .video_place = dv_place_420,
- .pix_fmt = PIX_FMT_YUV420P,
- .audio_stride = 108,
- .audio_min_samples = { 1896, 1742, 1264 }, /* for 48, 44.1 and 32Khz */
- .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 },
- .audio_shuffle = dv_audio_shuffle625,
- },
- { .dsf = 1,
- .frame_size = 144000, /* SMPTE-314M - 625/50 (PAL) */
- .difseg_size = 12,
- .n_difchan = 1,
- .frame_rate = 25,
- .frame_rate_base = 1,
- .ltc_divisor = 25,
- .height = 576,
- .width = 720,
- .sar = {{59, 54}, {118, 81}},
- .video_place = dv_place_411P,
- .pix_fmt = PIX_FMT_YUV411P,
- .audio_stride = 108,
- .audio_min_samples = { 1896, 1742, 1264 }, /* for 48, 44.1 and 32Khz */
- .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 },
- .audio_shuffle = dv_audio_shuffle625,
- },
- { .dsf = 0,
- .frame_size = 240000, /* SMPTE-314M - 525/60 (NTSC) 50 Mbps */
- .difseg_size = 10, /* also known as "DVCPRO50" */
- .n_difchan = 2,
- .frame_rate = 30000,
- .ltc_divisor = 30,
- .frame_rate_base = 1001,
- .height = 480,
- .width = 720,
- .sar = {{10, 11}, {40, 33}},
- .video_place = dv_place_422_525,
- .pix_fmt = PIX_FMT_YUV422P,
- .audio_stride = 90,
- .audio_min_samples = { 1580, 1452, 1053 }, /* for 48, 44.1 and 32Khz */
- .audio_samples_dist = { 1600, 1602, 1602, 1602, 1602 }, /* per SMPTE-314M */
- .audio_shuffle = dv_audio_shuffle525,
- },
- { .dsf = 1,
- .frame_size = 288000, /* SMPTE-314M - 625/50 (PAL) 50 Mbps */
- .difseg_size = 12, /* also known as "DVCPRO50" */
- .n_difchan = 2,
- .frame_rate = 25,
- .frame_rate_base = 1,
- .ltc_divisor = 25,
- .height = 576,
- .width = 720,
- .sar = {{59, 54}, {118, 81}},
- .video_place = dv_place_422_625,
- .pix_fmt = PIX_FMT_YUV422P,
- .audio_stride = 108,
- .audio_min_samples = { 1896, 1742, 1264 }, /* for 48, 44.1 and 32Khz */
- .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 },
- .audio_shuffle = dv_audio_shuffle625,
- }
-};
-
-enum dv_section_type {
- dv_sect_header = 0x1f,
- dv_sect_subcode = 0x3f,
- dv_sect_vaux = 0x56,
- dv_sect_audio = 0x76,
- dv_sect_video = 0x96,
-};
-
-enum dv_pack_type {
- dv_header525 = 0x3f, /* see dv_write_pack for important details on */
- dv_header625 = 0xbf, /* these two packs */
- dv_timecode = 0x13,
- dv_audio_source = 0x50,
- dv_audio_control = 0x51,
- dv_audio_recdate = 0x52,
- dv_audio_rectime = 0x53,
- dv_video_source = 0x60,
- dv_video_control = 0x61,
- dv_video_recdate = 0x62,
- dv_video_rectime = 0x63,
- dv_unknown_pack = 0xff,
-};
-
-/* minimum number of bytes to read from a DV stream in order to determine the profile */
-#define DV_PROFILE_BYTES (6*80) /* 6 DIF blocks */
-
-/* largest possible DV frame, in bytes (PAL 50Mbps) */
-#define DV_MAX_FRAME_SIZE 288000
-
-static inline const DVprofile* dv_frame_profile(uint8_t* frame)
-{
- if ((frame[3] & 0x80) == 0) { /* DSF flag */
- /* it's an NTSC format */
- if ((frame[80*5 + 48 + 3] & 0x4)) { /* 4:2:2 sampling */
- return &dv_profiles[3]; /* NTSC 50Mbps */
- } else { /* 4:1:1 sampling */
- return &dv_profiles[0]; /* NTSC 25Mbps */
- }
- } else {
- /* it's a PAL format */
- if ((frame[80*5 + 48 + 3] & 0x4)) { /* 4:2:2 sampling */
- return &dv_profiles[4]; /* PAL 50Mbps */
- } else if ((frame[5] & 0x07) == 0) { /* APT flag */
- return &dv_profiles[1]; /* PAL 25Mbps 4:2:0 */
- } else
- return &dv_profiles[2]; /* PAL 25Mbps 4:1:1 */
- }
-}
-
-static inline const DVprofile* dv_codec_profile(AVCodecContext* codec)
-{
- int i;
-
- if (codec->width != 720)
- return NULL;
-
- for (i=0; i<sizeof(dv_profiles)/sizeof(DVprofile); i++)
- if (codec->height == dv_profiles[i].height && codec->pix_fmt == dv_profiles[i].pix_fmt)
- return &dv_profiles[i];
-
- return NULL;
-}
-
-static inline int dv_write_dif_id(enum dv_section_type t, uint8_t chan_num, uint8_t seq_num,
- uint8_t dif_num, uint8_t* buf)
-{
- buf[0] = (uint8_t)t; /* Section type */
- buf[1] = (seq_num<<4) | /* DIF seq number 0-9 for 525/60; 0-11 for 625/50 */
- (chan_num << 3) | /* FSC: for 50Mb/s 0 - first channel; 1 - second */
- 7; /* reserved -- always 1 */
- buf[2] = dif_num; /* DIF block number Video: 0-134, Audio: 0-8 */
- return 3;
-}
-
-
-static inline int dv_write_ssyb_id(uint8_t syb_num, uint8_t fr, uint8_t* buf)
-{
- if (syb_num == 0 || syb_num == 6) {
- buf[0] = (fr<<7) | /* FR ID 1 - first half of each channel; 0 - second */
- (0<<4) | /* AP3 (Subcode application ID) */
- 0x0f; /* reserved -- always 1 */
- }
- else if (syb_num == 11) {
- buf[0] = (fr<<7) | /* FR ID 1 - first half of each channel; 0 - second */
- 0x7f; /* reserved -- always 1 */
- }
- else {
- buf[0] = (fr<<7) | /* FR ID 1 - first half of each channel; 0 - second */
- (0<<4) | /* APT (Track application ID) */
- 0x0f; /* reserved -- always 1 */
- }
- buf[1] = 0xf0 | /* reserved -- always 1 */
- (syb_num & 0x0f); /* SSYB number 0 - 11 */
- buf[2] = 0xff; /* reserved -- always 1 */
- return 3;
-}
diff --git a/src/libffmpeg/libavcodec/error_resilience.c b/src/libffmpeg/libavcodec/error_resilience.c
deleted file mode 100644
index 0923721ee..000000000
--- a/src/libffmpeg/libavcodec/error_resilience.c
+++ /dev/null
@@ -1,1030 +0,0 @@
-/*
- * Error resilience / concealment
- *
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file error_resilience.c
- * Error resilience / concealment.
- */
-
-#include <limits.h>
-
-#include "avcodec.h"
-#include "dsputil.h"
-#include "mpegvideo.h"
-#include "common.h"
-
-static void decode_mb(MpegEncContext *s){
- s->dest[0] = s->current_picture.data[0] + (s->mb_y * 16* s->linesize ) + s->mb_x * 16;
- s->dest[1] = s->current_picture.data[1] + (s->mb_y * 8 * s->uvlinesize) + s->mb_x * 8;
- s->dest[2] = s->current_picture.data[2] + (s->mb_y * 8 * s->uvlinesize) + s->mb_x * 8;
-
- MPV_decode_mb(s, s->block);
-}
-
-/**
- * replaces the current MB with a flat dc only version.
- */
-static void put_dc(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int mb_x, int mb_y)
-{
- int dc, dcu, dcv, y, i;
- for(i=0; i<4; i++){
- dc= s->dc_val[0][mb_x*2 + (i&1) + (mb_y*2 + (i>>1))*s->b8_stride];
- if(dc<0) dc=0;
- else if(dc>2040) dc=2040;
- for(y=0; y<8; y++){
- int x;
- for(x=0; x<8; x++){
- dest_y[x + (i&1)*8 + (y + (i>>1)*8)*s->linesize]= dc/8;
- }
- }
- }
- dcu = s->dc_val[1][mb_x + mb_y*s->mb_stride];
- dcv = s->dc_val[2][mb_x + mb_y*s->mb_stride];
- if (dcu<0 ) dcu=0;
- else if(dcu>2040) dcu=2040;
- if (dcv<0 ) dcv=0;
- else if(dcv>2040) dcv=2040;
- for(y=0; y<8; y++){
- int x;
- for(x=0; x<8; x++){
- dest_cb[x + y*(s->uvlinesize)]= dcu/8;
- dest_cr[x + y*(s->uvlinesize)]= dcv/8;
- }
- }
-}
-
-static void filter181(int16_t *data, int width, int height, int stride){
- int x,y;
-
- /* horizontal filter */
- for(y=1; y<height-1; y++){
- int prev_dc= data[0 + y*stride];
-
- for(x=1; x<width-1; x++){
- int dc;
-
- dc= - prev_dc
- + data[x + y*stride]*8
- - data[x + 1 + y*stride];
- dc= (dc*10923 + 32768)>>16;
- prev_dc= data[x + y*stride];
- data[x + y*stride]= dc;
- }
- }
-
- /* vertical filter */
- for(x=1; x<width-1; x++){
- int prev_dc= data[x];
-
- for(y=1; y<height-1; y++){
- int dc;
-
- dc= - prev_dc
- + data[x + y *stride]*8
- - data[x + (y+1)*stride];
- dc= (dc*10923 + 32768)>>16;
- prev_dc= data[x + y*stride];
- data[x + y*stride]= dc;
- }
- }
-}
-
-/**
- * guess the dc of blocks which dont have a undamaged dc
- * @param w width in 8 pixel blocks
- * @param h height in 8 pixel blocks
- */
-static void guess_dc(MpegEncContext *s, int16_t *dc, int w, int h, int stride, int is_luma){
- int b_x, b_y;
-
- for(b_y=0; b_y<h; b_y++){
- for(b_x=0; b_x<w; b_x++){
- int color[4]={1024,1024,1024,1024};
- int distance[4]={9999,9999,9999,9999};
- int mb_index, error, j;
- int64_t guess, weight_sum;
-
- mb_index= (b_x>>is_luma) + (b_y>>is_luma)*s->mb_stride;
-
- error= s->error_status_table[mb_index];
-
- if(IS_INTER(s->current_picture.mb_type[mb_index])) continue; //inter
- if(!(error&DC_ERROR)) continue; //dc-ok
-
- /* right block */
- for(j=b_x+1; j<w; j++){
- int mb_index_j= (j>>is_luma) + (b_y>>is_luma)*s->mb_stride;
- int error_j= s->error_status_table[mb_index_j];
- int intra_j= IS_INTRA(s->current_picture.mb_type[mb_index_j]);
- if(intra_j==0 || !(error_j&DC_ERROR)){
- color[0]= dc[j + b_y*stride];
- distance[0]= j-b_x;
- break;
- }
- }
-
- /* left block */
- for(j=b_x-1; j>=0; j--){
- int mb_index_j= (j>>is_luma) + (b_y>>is_luma)*s->mb_stride;
- int error_j= s->error_status_table[mb_index_j];
- int intra_j= IS_INTRA(s->current_picture.mb_type[mb_index_j]);
- if(intra_j==0 || !(error_j&DC_ERROR)){
- color[1]= dc[j + b_y*stride];
- distance[1]= b_x-j;
- break;
- }
- }
-
- /* bottom block */
- for(j=b_y+1; j<h; j++){
- int mb_index_j= (b_x>>is_luma) + (j>>is_luma)*s->mb_stride;
- int error_j= s->error_status_table[mb_index_j];
- int intra_j= IS_INTRA(s->current_picture.mb_type[mb_index_j]);
- if(intra_j==0 || !(error_j&DC_ERROR)){
- color[2]= dc[b_x + j*stride];
- distance[2]= j-b_y;
- break;
- }
- }
-
- /* top block */
- for(j=b_y-1; j>=0; j--){
- int mb_index_j= (b_x>>is_luma) + (j>>is_luma)*s->mb_stride;
- int error_j= s->error_status_table[mb_index_j];
- int intra_j= IS_INTRA(s->current_picture.mb_type[mb_index_j]);
- if(intra_j==0 || !(error_j&DC_ERROR)){
- color[3]= dc[b_x + j*stride];
- distance[3]= b_y-j;
- break;
- }
- }
-
- weight_sum=0;
- guess=0;
- for(j=0; j<4; j++){
- int64_t weight= 256*256*256*16/distance[j];
- guess+= weight*(int64_t)color[j];
- weight_sum+= weight;
- }
- guess= (guess + weight_sum/2) / weight_sum;
-
- dc[b_x + b_y*stride]= guess;
- }
- }
-}
-
-/**
- * simple horizontal deblocking filter used for error resilience
- * @param w width in 8 pixel blocks
- * @param h height in 8 pixel blocks
- */
-static void h_block_filter(MpegEncContext *s, uint8_t *dst, int w, int h, int stride, int is_luma){
- int b_x, b_y;
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-
- for(b_y=0; b_y<h; b_y++){
- for(b_x=0; b_x<w-1; b_x++){
- int y;
- int left_status = s->error_status_table[( b_x >>is_luma) + (b_y>>is_luma)*s->mb_stride];
- int right_status= s->error_status_table[((b_x+1)>>is_luma) + (b_y>>is_luma)*s->mb_stride];
- int left_intra= IS_INTRA(s->current_picture.mb_type [( b_x >>is_luma) + (b_y>>is_luma)*s->mb_stride]);
- int right_intra= IS_INTRA(s->current_picture.mb_type [((b_x+1)>>is_luma) + (b_y>>is_luma)*s->mb_stride]);
- int left_damage = left_status&(DC_ERROR|AC_ERROR|MV_ERROR);
- int right_damage= right_status&(DC_ERROR|AC_ERROR|MV_ERROR);
- int offset= b_x*8 + b_y*stride*8;
- int16_t *left_mv= s->current_picture.motion_val[0][s->b8_stride*(b_y<<(1-is_luma)) + ( b_x <<(1-is_luma))];
- int16_t *right_mv= s->current_picture.motion_val[0][s->b8_stride*(b_y<<(1-is_luma)) + ((b_x+1)<<(1-is_luma))];
-
- if(!(left_damage||right_damage)) continue; // both undamaged
-
- if( (!left_intra) && (!right_intra)
- && FFABS(left_mv[0]-right_mv[0]) + FFABS(left_mv[1]+right_mv[1]) < 2) continue;
-
- for(y=0; y<8; y++){
- int a,b,c,d;
-
- a= dst[offset + 7 + y*stride] - dst[offset + 6 + y*stride];
- b= dst[offset + 8 + y*stride] - dst[offset + 7 + y*stride];
- c= dst[offset + 9 + y*stride] - dst[offset + 8 + y*stride];
-
- d= FFABS(b) - ((FFABS(a) + FFABS(c) + 1)>>1);
- d= FFMAX(d, 0);
- if(b<0) d= -d;
-
- if(d==0) continue;
-
- if(!(left_damage && right_damage))
- d= d*16/9;
-
- if(left_damage){
- dst[offset + 7 + y*stride] = cm[dst[offset + 7 + y*stride] + ((d*7)>>4)];
- dst[offset + 6 + y*stride] = cm[dst[offset + 6 + y*stride] + ((d*5)>>4)];
- dst[offset + 5 + y*stride] = cm[dst[offset + 5 + y*stride] + ((d*3)>>4)];
- dst[offset + 4 + y*stride] = cm[dst[offset + 4 + y*stride] + ((d*1)>>4)];
- }
- if(right_damage){
- dst[offset + 8 + y*stride] = cm[dst[offset + 8 + y*stride] - ((d*7)>>4)];
- dst[offset + 9 + y*stride] = cm[dst[offset + 9 + y*stride] - ((d*5)>>4)];
- dst[offset + 10+ y*stride] = cm[dst[offset +10 + y*stride] - ((d*3)>>4)];
- dst[offset + 11+ y*stride] = cm[dst[offset +11 + y*stride] - ((d*1)>>4)];
- }
- }
- }
- }
-}
-
-/**
- * simple vertical deblocking filter used for error resilience
- * @param w width in 8 pixel blocks
- * @param h height in 8 pixel blocks
- */
-static void v_block_filter(MpegEncContext *s, uint8_t *dst, int w, int h, int stride, int is_luma){
- int b_x, b_y;
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-
- for(b_y=0; b_y<h-1; b_y++){
- for(b_x=0; b_x<w; b_x++){
- int x;
- int top_status = s->error_status_table[(b_x>>is_luma) + ( b_y >>is_luma)*s->mb_stride];
- int bottom_status= s->error_status_table[(b_x>>is_luma) + ((b_y+1)>>is_luma)*s->mb_stride];
- int top_intra= IS_INTRA(s->current_picture.mb_type [(b_x>>is_luma) + ( b_y >>is_luma)*s->mb_stride]);
- int bottom_intra= IS_INTRA(s->current_picture.mb_type [(b_x>>is_luma) + ((b_y+1)>>is_luma)*s->mb_stride]);
- int top_damage = top_status&(DC_ERROR|AC_ERROR|MV_ERROR);
- int bottom_damage= bottom_status&(DC_ERROR|AC_ERROR|MV_ERROR);
- int offset= b_x*8 + b_y*stride*8;
- int16_t *top_mv= s->current_picture.motion_val[0][s->b8_stride*( b_y <<(1-is_luma)) + (b_x<<(1-is_luma))];
- int16_t *bottom_mv= s->current_picture.motion_val[0][s->b8_stride*((b_y+1)<<(1-is_luma)) + (b_x<<(1-is_luma))];
-
- if(!(top_damage||bottom_damage)) continue; // both undamaged
-
- if( (!top_intra) && (!bottom_intra)
- && FFABS(top_mv[0]-bottom_mv[0]) + FFABS(top_mv[1]+bottom_mv[1]) < 2) continue;
-
- for(x=0; x<8; x++){
- int a,b,c,d;
-
- a= dst[offset + x + 7*stride] - dst[offset + x + 6*stride];
- b= dst[offset + x + 8*stride] - dst[offset + x + 7*stride];
- c= dst[offset + x + 9*stride] - dst[offset + x + 8*stride];
-
- d= FFABS(b) - ((FFABS(a) + FFABS(c)+1)>>1);
- d= FFMAX(d, 0);
- if(b<0) d= -d;
-
- if(d==0) continue;
-
- if(!(top_damage && bottom_damage))
- d= d*16/9;
-
- if(top_damage){
- dst[offset + x + 7*stride] = cm[dst[offset + x + 7*stride] + ((d*7)>>4)];
- dst[offset + x + 6*stride] = cm[dst[offset + x + 6*stride] + ((d*5)>>4)];
- dst[offset + x + 5*stride] = cm[dst[offset + x + 5*stride] + ((d*3)>>4)];
- dst[offset + x + 4*stride] = cm[dst[offset + x + 4*stride] + ((d*1)>>4)];
- }
- if(bottom_damage){
- dst[offset + x + 8*stride] = cm[dst[offset + x + 8*stride] - ((d*7)>>4)];
- dst[offset + x + 9*stride] = cm[dst[offset + x + 9*stride] - ((d*5)>>4)];
- dst[offset + x + 10*stride] = cm[dst[offset + x + 10*stride] - ((d*3)>>4)];
- dst[offset + x + 11*stride] = cm[dst[offset + x + 11*stride] - ((d*1)>>4)];
- }
- }
- }
- }
-}
-
-static void guess_mv(MpegEncContext *s){
- uint8_t fixed[s->mb_stride * s->mb_height];
-#define MV_FROZEN 3
-#define MV_CHANGED 2
-#define MV_UNCHANGED 1
- const int mb_stride = s->mb_stride;
- const int mb_width = s->mb_width;
- const int mb_height= s->mb_height;
- int i, depth, num_avail;
- int mb_x, mb_y;
-
- num_avail=0;
- for(i=0; i<s->mb_num; i++){
- const int mb_xy= s->mb_index2xy[ i ];
- int f=0;
- int error= s->error_status_table[mb_xy];
-
- if(IS_INTRA(s->current_picture.mb_type[mb_xy])) f=MV_FROZEN; //intra //FIXME check
- if(!(error&MV_ERROR)) f=MV_FROZEN; //inter with undamaged MV
-
- fixed[mb_xy]= f;
- if(f==MV_FROZEN)
- num_avail++;
- }
-
- if((!(s->avctx->error_concealment&FF_EC_GUESS_MVS)) || num_avail <= mb_width/2){
- for(mb_y=0; mb_y<s->mb_height; mb_y++){
- for(mb_x=0; mb_x<s->mb_width; mb_x++){
- const int mb_xy= mb_x + mb_y*s->mb_stride;
-
- if(IS_INTRA(s->current_picture.mb_type[mb_xy])) continue;
- if(!(s->error_status_table[mb_xy]&MV_ERROR)) continue;
-
- s->mv_dir = MV_DIR_FORWARD;
- s->mb_intra=0;
- s->mv_type = MV_TYPE_16X16;
- s->mb_skipped=0;
-
- s->dsp.clear_blocks(s->block[0]);
-
- s->mb_x= mb_x;
- s->mb_y= mb_y;
- s->mv[0][0][0]= 0;
- s->mv[0][0][1]= 0;
- decode_mb(s);
- }
- }
- return;
- }
-
- for(depth=0;; depth++){
- int changed, pass, none_left;
-
- none_left=1;
- changed=1;
- for(pass=0; (changed || pass<2) && pass<10; pass++){
- int mb_x, mb_y;
-int score_sum=0;
-
- changed=0;
- for(mb_y=0; mb_y<s->mb_height; mb_y++){
- for(mb_x=0; mb_x<s->mb_width; mb_x++){
- const int mb_xy= mb_x + mb_y*s->mb_stride;
- int mv_predictor[8][2]={{0}};
- int pred_count=0;
- int j;
- int best_score=256*256*256*64;
- int best_pred=0;
- const int mot_stride= s->b8_stride;
- const int mot_index= mb_x*2 + mb_y*2*mot_stride;
- int prev_x= s->current_picture.motion_val[0][mot_index][0];
- int prev_y= s->current_picture.motion_val[0][mot_index][1];
-
- if((mb_x^mb_y^pass)&1) continue;
-
- if(fixed[mb_xy]==MV_FROZEN) continue;
- assert(!IS_INTRA(s->current_picture.mb_type[mb_xy]));
- assert(s->last_picture_ptr && s->last_picture_ptr->data[0]);
-
- j=0;
- if(mb_x>0 && fixed[mb_xy-1 ]==MV_FROZEN) j=1;
- if(mb_x+1<mb_width && fixed[mb_xy+1 ]==MV_FROZEN) j=1;
- if(mb_y>0 && fixed[mb_xy-mb_stride]==MV_FROZEN) j=1;
- if(mb_y+1<mb_height && fixed[mb_xy+mb_stride]==MV_FROZEN) j=1;
- if(j==0) continue;
-
- j=0;
- if(mb_x>0 && fixed[mb_xy-1 ]==MV_CHANGED) j=1;
- if(mb_x+1<mb_width && fixed[mb_xy+1 ]==MV_CHANGED) j=1;
- if(mb_y>0 && fixed[mb_xy-mb_stride]==MV_CHANGED) j=1;
- if(mb_y+1<mb_height && fixed[mb_xy+mb_stride]==MV_CHANGED) j=1;
- if(j==0 && pass>1) continue;
-
- none_left=0;
-
- if(mb_x>0 && fixed[mb_xy-1]){
- mv_predictor[pred_count][0]= s->current_picture.motion_val[0][mot_index - 2][0];
- mv_predictor[pred_count][1]= s->current_picture.motion_val[0][mot_index - 2][1];
- pred_count++;
- }
- if(mb_x+1<mb_width && fixed[mb_xy+1]){
- mv_predictor[pred_count][0]= s->current_picture.motion_val[0][mot_index + 2][0];
- mv_predictor[pred_count][1]= s->current_picture.motion_val[0][mot_index + 2][1];
- pred_count++;
- }
- if(mb_y>0 && fixed[mb_xy-mb_stride]){
- mv_predictor[pred_count][0]= s->current_picture.motion_val[0][mot_index - mot_stride*2][0];
- mv_predictor[pred_count][1]= s->current_picture.motion_val[0][mot_index - mot_stride*2][1];
- pred_count++;
- }
- if(mb_y+1<mb_height && fixed[mb_xy+mb_stride]){
- mv_predictor[pred_count][0]= s->current_picture.motion_val[0][mot_index + mot_stride*2][0];
- mv_predictor[pred_count][1]= s->current_picture.motion_val[0][mot_index + mot_stride*2][1];
- pred_count++;
- }
- if(pred_count==0) continue;
-
- if(pred_count>1){
- int sum_x=0, sum_y=0;
- int max_x, max_y, min_x, min_y;
-
- for(j=0; j<pred_count; j++){
- sum_x+= mv_predictor[j][0];
- sum_y+= mv_predictor[j][1];
- }
-
- /* mean */
- mv_predictor[pred_count][0] = sum_x/j;
- mv_predictor[pred_count][1] = sum_y/j;
-
- /* median */
- if(pred_count>=3){
- min_y= min_x= 99999;
- max_y= max_x=-99999;
- }else{
- min_x=min_y=max_x=max_y=0;
- }
- for(j=0; j<pred_count; j++){
- max_x= FFMAX(max_x, mv_predictor[j][0]);
- max_y= FFMAX(max_y, mv_predictor[j][1]);
- min_x= FFMIN(min_x, mv_predictor[j][0]);
- min_y= FFMIN(min_y, mv_predictor[j][1]);
- }
- mv_predictor[pred_count+1][0] = sum_x - max_x - min_x;
- mv_predictor[pred_count+1][1] = sum_y - max_y - min_y;
-
- if(pred_count==4){
- mv_predictor[pred_count+1][0] /= 2;
- mv_predictor[pred_count+1][1] /= 2;
- }
- pred_count+=2;
- }
-
- /* zero MV */
- pred_count++;
-
- /* last MV */
- mv_predictor[pred_count][0]= s->current_picture.motion_val[0][mot_index][0];
- mv_predictor[pred_count][1]= s->current_picture.motion_val[0][mot_index][1];
- pred_count++;
-
- s->mv_dir = MV_DIR_FORWARD;
- s->mb_intra=0;
- s->mv_type = MV_TYPE_16X16;
- s->mb_skipped=0;
-
- s->dsp.clear_blocks(s->block[0]);
-
- s->mb_x= mb_x;
- s->mb_y= mb_y;
-
- for(j=0; j<pred_count; j++){
- int score=0;
- uint8_t *src= s->current_picture.data[0] + mb_x*16 + mb_y*16*s->linesize;
-
- s->current_picture.motion_val[0][mot_index][0]= s->mv[0][0][0]= mv_predictor[j][0];
- s->current_picture.motion_val[0][mot_index][1]= s->mv[0][0][1]= mv_predictor[j][1];
-
- decode_mb(s);
-
- if(mb_x>0 && fixed[mb_xy-1]){
- int k;
- for(k=0; k<16; k++)
- score += FFABS(src[k*s->linesize-1 ]-src[k*s->linesize ]);
- }
- if(mb_x+1<mb_width && fixed[mb_xy+1]){
- int k;
- for(k=0; k<16; k++)
- score += FFABS(src[k*s->linesize+15]-src[k*s->linesize+16]);
- }
- if(mb_y>0 && fixed[mb_xy-mb_stride]){
- int k;
- for(k=0; k<16; k++)
- score += FFABS(src[k-s->linesize ]-src[k ]);
- }
- if(mb_y+1<mb_height && fixed[mb_xy+mb_stride]){
- int k;
- for(k=0; k<16; k++)
- score += FFABS(src[k+s->linesize*15]-src[k+s->linesize*16]);
- }
-
- if(score <= best_score){ // <= will favor the last MV
- best_score= score;
- best_pred= j;
- }
- }
-score_sum+= best_score;
-//FIXME no need to set s->current_picture.motion_val[0][mot_index][0] explicit
- s->current_picture.motion_val[0][mot_index][0]= s->mv[0][0][0]= mv_predictor[best_pred][0];
- s->current_picture.motion_val[0][mot_index][1]= s->mv[0][0][1]= mv_predictor[best_pred][1];
-
- decode_mb(s);
-
-
- if(s->mv[0][0][0] != prev_x || s->mv[0][0][1] != prev_y){
- fixed[mb_xy]=MV_CHANGED;
- changed++;
- }else
- fixed[mb_xy]=MV_UNCHANGED;
- }
- }
-
-// printf(".%d/%d", changed, score_sum); fflush(stdout);
- }
-
- if(none_left)
- return;
-
- for(i=0; i<s->mb_num; i++){
- int mb_xy= s->mb_index2xy[i];
- if(fixed[mb_xy])
- fixed[mb_xy]=MV_FROZEN;
- }
-// printf(":"); fflush(stdout);
- }
-}
-
-static int is_intra_more_likely(MpegEncContext *s){
- int is_intra_likely, i, j, undamaged_count, skip_amount, mb_x, mb_y;
-
- if(s->last_picture_ptr==NULL) return 1; //no previous frame available -> use spatial prediction
-
- undamaged_count=0;
- for(i=0; i<s->mb_num; i++){
- const int mb_xy= s->mb_index2xy[i];
- const int error= s->error_status_table[mb_xy];
- if(!((error&DC_ERROR) && (error&MV_ERROR)))
- undamaged_count++;
- }
-
- if(undamaged_count < 5) return 0; //allmost all MBs damaged -> use temporal prediction
-
- skip_amount= FFMAX(undamaged_count/50, 1); //check only upto 50 MBs
- is_intra_likely=0;
-
- j=0;
- for(mb_y= 0; mb_y<s->mb_height-1; mb_y++){
- for(mb_x= 0; mb_x<s->mb_width; mb_x++){
- int error;
- const int mb_xy= mb_x + mb_y*s->mb_stride;
-
- error= s->error_status_table[mb_xy];
- if((error&DC_ERROR) && (error&MV_ERROR))
- continue; //skip damaged
-
- j++;
- if((j%skip_amount) != 0) continue; //skip a few to speed things up
-
- if(s->pict_type==I_TYPE){
- uint8_t *mb_ptr = s->current_picture.data[0] + mb_x*16 + mb_y*16*s->linesize;
- uint8_t *last_mb_ptr= s->last_picture.data [0] + mb_x*16 + mb_y*16*s->linesize;
-
- is_intra_likely += s->dsp.sad[0](NULL, last_mb_ptr, mb_ptr , s->linesize, 16);
- is_intra_likely -= s->dsp.sad[0](NULL, last_mb_ptr, last_mb_ptr+s->linesize*16, s->linesize, 16);
- }else{
- if(IS_INTRA(s->current_picture.mb_type[mb_xy]))
- is_intra_likely++;
- else
- is_intra_likely--;
- }
- }
- }
-//printf("is_intra_likely: %d type:%d\n", is_intra_likely, s->pict_type);
- return is_intra_likely > 0;
-}
-
-void ff_er_frame_start(MpegEncContext *s){
- if(!s->error_resilience) return;
-
- memset(s->error_status_table, MV_ERROR|AC_ERROR|DC_ERROR|VP_START|AC_END|DC_END|MV_END, s->mb_stride*s->mb_height*sizeof(uint8_t));
- s->error_count= 3*s->mb_num;
-}
-
-/**
- * adds a slice.
- * @param endx x component of the last macroblock, can be -1 for the last of the previous line
- * @param status the status at the end (MV_END, AC_ERROR, ...), it is assumed that no earlier end or
- * error of the same type occured
- */
-void ff_er_add_slice(MpegEncContext *s, int startx, int starty, int endx, int endy, int status){
- const int start_i= clip(startx + starty * s->mb_width , 0, s->mb_num-1);
- const int end_i = clip(endx + endy * s->mb_width , 0, s->mb_num);
- const int start_xy= s->mb_index2xy[start_i];
- const int end_xy = s->mb_index2xy[end_i];
- int mask= -1;
-
- if(!s->error_resilience) return;
-
- mask &= ~VP_START;
- if(status & (AC_ERROR|AC_END)){
- mask &= ~(AC_ERROR|AC_END);
- s->error_count -= end_i - start_i + 1;
- }
- if(status & (DC_ERROR|DC_END)){
- mask &= ~(DC_ERROR|DC_END);
- s->error_count -= end_i - start_i + 1;
- }
- if(status & (MV_ERROR|MV_END)){
- mask &= ~(MV_ERROR|MV_END);
- s->error_count -= end_i - start_i + 1;
- }
-
- if(status & (AC_ERROR|DC_ERROR|MV_ERROR)) s->error_count= INT_MAX;
-
- if(mask == ~0x7F){
- memset(&s->error_status_table[start_xy], 0, (end_xy - start_xy) * sizeof(uint8_t));
- }else{
- int i;
- for(i=start_xy; i<end_xy; i++){
- s->error_status_table[ i ] &= mask;
- }
- }
-
- if(end_i == s->mb_num)
- s->error_count= INT_MAX;
- else{
- s->error_status_table[end_xy] &= mask;
- s->error_status_table[end_xy] |= status;
- }
-
- s->error_status_table[start_xy] |= VP_START;
-
- if(start_xy > 0 && s->avctx->thread_count <= 1 && s->avctx->skip_top*s->mb_width < start_i){
- int prev_status= s->error_status_table[ s->mb_index2xy[start_i - 1] ];
-
- prev_status &= ~ VP_START;
- if(prev_status != (MV_END|DC_END|AC_END)) s->error_count= INT_MAX;
- }
-}
-
-void ff_er_frame_end(MpegEncContext *s){
- int i, mb_x, mb_y, error, error_type, dc_error, mv_error, ac_error;
- int distance;
- int threshold_part[4]= {100,100,100};
- int threshold= 50;
- int is_intra_likely;
- int size = s->b8_stride * 2 * s->mb_height;
- Picture *pic= s->current_picture_ptr;
-
- if(!s->error_resilience || s->error_count==0 ||
- s->error_count==3*s->mb_width*(s->avctx->skip_top + s->avctx->skip_bottom)) return;
-
- if(s->current_picture.motion_val[0] == NULL){
- av_log(s->avctx, AV_LOG_ERROR, "Warning MVs not available\n");
-
- for(i=0; i<2; i++){
- pic->ref_index[i]= av_mallocz(size * sizeof(uint8_t));
- pic->motion_val_base[i]= av_mallocz((size+4) * 2 * sizeof(uint16_t));
- pic->motion_val[i]= pic->motion_val_base[i]+4;
- }
- pic->motion_subsample_log2= 3;
- s->current_picture= *s->current_picture_ptr;
- }
-
- for(i=0; i<2; i++){
- if(pic->ref_index[i])
- memset(pic->ref_index[i], 0, size * sizeof(uint8_t));
- }
-
- if(s->avctx->debug&FF_DEBUG_ER){
- for(mb_y=0; mb_y<s->mb_height; mb_y++){
- for(mb_x=0; mb_x<s->mb_width; mb_x++){
- int status= s->error_status_table[mb_x + mb_y*s->mb_stride];
-
- av_log(s->avctx, AV_LOG_DEBUG, "%2X ", status);
- }
- av_log(s->avctx, AV_LOG_DEBUG, "\n");
- }
- }
-
-#if 1
- /* handle overlapping slices */
- for(error_type=1; error_type<=3; error_type++){
- int end_ok=0;
-
- for(i=s->mb_num-1; i>=0; i--){
- const int mb_xy= s->mb_index2xy[i];
- int error= s->error_status_table[mb_xy];
-
- if(error&(1<<error_type))
- end_ok=1;
- if(error&(8<<error_type))
- end_ok=1;
-
- if(!end_ok)
- s->error_status_table[mb_xy]|= 1<<error_type;
-
- if(error&VP_START)
- end_ok=0;
- }
- }
-#endif
-#if 1
- /* handle slices with partitions of different length */
- if(s->partitioned_frame){
- int end_ok=0;
-
- for(i=s->mb_num-1; i>=0; i--){
- const int mb_xy= s->mb_index2xy[i];
- int error= s->error_status_table[mb_xy];
-
- if(error&AC_END)
- end_ok=0;
- if((error&MV_END) || (error&DC_END) || (error&AC_ERROR))
- end_ok=1;
-
- if(!end_ok)
- s->error_status_table[mb_xy]|= AC_ERROR;
-
- if(error&VP_START)
- end_ok=0;
- }
- }
-#endif
- /* handle missing slices */
- if(s->error_resilience>=4){
- int end_ok=1;
-
- for(i=s->mb_num-2; i>=s->mb_width+100; i--){ //FIXME +100 hack
- const int mb_xy= s->mb_index2xy[i];
- int error1= s->error_status_table[mb_xy ];
- int error2= s->error_status_table[s->mb_index2xy[i+1]];
-
- if(error1&VP_START)
- end_ok=1;
-
- if( error2==(VP_START|DC_ERROR|AC_ERROR|MV_ERROR|AC_END|DC_END|MV_END)
- && error1!=(VP_START|DC_ERROR|AC_ERROR|MV_ERROR|AC_END|DC_END|MV_END)
- && ((error1&AC_END) || (error1&DC_END) || (error1&MV_END))){ //end & uninited
- end_ok=0;
- }
-
- if(!end_ok)
- s->error_status_table[mb_xy]|= DC_ERROR|AC_ERROR|MV_ERROR;
- }
- }
-
-#if 1
- /* backward mark errors */
- distance=9999999;
- for(error_type=1; error_type<=3; error_type++){
- for(i=s->mb_num-1; i>=0; i--){
- const int mb_xy= s->mb_index2xy[i];
- int error= s->error_status_table[mb_xy];
-
- if(!s->mbskip_table[mb_xy]) //FIXME partition specific
- distance++;
- if(error&(1<<error_type))
- distance= 0;
-
- if(s->partitioned_frame){
- if(distance < threshold_part[error_type-1])
- s->error_status_table[mb_xy]|= 1<<error_type;
- }else{
- if(distance < threshold)
- s->error_status_table[mb_xy]|= 1<<error_type;
- }
-
- if(error&VP_START)
- distance= 9999999;
- }
- }
-#endif
-
- /* forward mark errors */
- error=0;
- for(i=0; i<s->mb_num; i++){
- const int mb_xy= s->mb_index2xy[i];
- int old_error= s->error_status_table[mb_xy];
-
- if(old_error&VP_START)
- error= old_error& (DC_ERROR|AC_ERROR|MV_ERROR);
- else{
- error|= old_error& (DC_ERROR|AC_ERROR|MV_ERROR);
- s->error_status_table[mb_xy]|= error;
- }
- }
-#if 1
- /* handle not partitioned case */
- if(!s->partitioned_frame){
- for(i=0; i<s->mb_num; i++){
- const int mb_xy= s->mb_index2xy[i];
- error= s->error_status_table[mb_xy];
- if(error&(AC_ERROR|DC_ERROR|MV_ERROR))
- error|= AC_ERROR|DC_ERROR|MV_ERROR;
- s->error_status_table[mb_xy]= error;
- }
- }
-#endif
-
- dc_error= ac_error= mv_error=0;
- for(i=0; i<s->mb_num; i++){
- const int mb_xy= s->mb_index2xy[i];
- error= s->error_status_table[mb_xy];
- if(error&DC_ERROR) dc_error ++;
- if(error&AC_ERROR) ac_error ++;
- if(error&MV_ERROR) mv_error ++;
- }
- av_log(s->avctx, AV_LOG_INFO, "concealing %d DC, %d AC, %d MV errors\n", dc_error, ac_error, mv_error);
-
- is_intra_likely= is_intra_more_likely(s);
-
- /* set unknown mb-type to most likely */
- for(i=0; i<s->mb_num; i++){
- const int mb_xy= s->mb_index2xy[i];
- error= s->error_status_table[mb_xy];
- if(!((error&DC_ERROR) && (error&MV_ERROR)))
- continue;
-
- if(is_intra_likely)
- s->current_picture.mb_type[mb_xy]= MB_TYPE_INTRA4x4;
- else
- s->current_picture.mb_type[mb_xy]= MB_TYPE_16x16 | MB_TYPE_L0;
- }
-
- /* handle inter blocks with damaged AC */
- for(mb_y=0; mb_y<s->mb_height; mb_y++){
- for(mb_x=0; mb_x<s->mb_width; mb_x++){
- const int mb_xy= mb_x + mb_y * s->mb_stride;
- const int mb_type= s->current_picture.mb_type[mb_xy];
- error= s->error_status_table[mb_xy];
-
- if(IS_INTRA(mb_type)) continue; //intra
- if(error&MV_ERROR) continue; //inter with damaged MV
- if(!(error&AC_ERROR)) continue; //undamaged inter
-
- s->mv_dir = MV_DIR_FORWARD;
- s->mb_intra=0;
- s->mb_skipped=0;
- if(IS_8X8(mb_type)){
- int mb_index= mb_x*2 + mb_y*2*s->b8_stride;
- int j;
- s->mv_type = MV_TYPE_8X8;
- for(j=0; j<4; j++){
- s->mv[0][j][0] = s->current_picture.motion_val[0][ mb_index + (j&1) + (j>>1)*s->b8_stride ][0];
- s->mv[0][j][1] = s->current_picture.motion_val[0][ mb_index + (j&1) + (j>>1)*s->b8_stride ][1];
- }
- }else{
- s->mv_type = MV_TYPE_16X16;
- s->mv[0][0][0] = s->current_picture.motion_val[0][ mb_x*2 + mb_y*2*s->b8_stride ][0];
- s->mv[0][0][1] = s->current_picture.motion_val[0][ mb_x*2 + mb_y*2*s->b8_stride ][1];
- }
-
- s->dsp.clear_blocks(s->block[0]);
-
- s->mb_x= mb_x;
- s->mb_y= mb_y;
- decode_mb(s);
- }
- }
-
- /* guess MVs */
- if(s->pict_type==B_TYPE){
- for(mb_y=0; mb_y<s->mb_height; mb_y++){
- for(mb_x=0; mb_x<s->mb_width; mb_x++){
- int xy= mb_x*2 + mb_y*2*s->b8_stride;
- const int mb_xy= mb_x + mb_y * s->mb_stride;
- const int mb_type= s->current_picture.mb_type[mb_xy];
- error= s->error_status_table[mb_xy];
-
- if(IS_INTRA(mb_type)) continue;
- if(!(error&MV_ERROR)) continue; //inter with undamaged MV
- if(!(error&AC_ERROR)) continue; //undamaged inter
-
- s->mv_dir = MV_DIR_FORWARD|MV_DIR_BACKWARD;
- s->mb_intra=0;
- s->mv_type = MV_TYPE_16X16;
- s->mb_skipped=0;
-
- if(s->pp_time){
- int time_pp= s->pp_time;
- int time_pb= s->pb_time;
-
- s->mv[0][0][0] = s->next_picture.motion_val[0][xy][0]*time_pb/time_pp;
- s->mv[0][0][1] = s->next_picture.motion_val[0][xy][1]*time_pb/time_pp;
- s->mv[1][0][0] = s->next_picture.motion_val[0][xy][0]*(time_pb - time_pp)/time_pp;
- s->mv[1][0][1] = s->next_picture.motion_val[0][xy][1]*(time_pb - time_pp)/time_pp;
- }else{
- s->mv[0][0][0]= 0;
- s->mv[0][0][1]= 0;
- s->mv[1][0][0]= 0;
- s->mv[1][0][1]= 0;
- }
-
- s->dsp.clear_blocks(s->block[0]);
- s->mb_x= mb_x;
- s->mb_y= mb_y;
- decode_mb(s);
- }
- }
- }else
- guess_mv(s);
-
-#ifdef HAVE_XVMC
- /* the filters below are not XvMC compatible, skip them */
- if(s->avctx->xvmc_acceleration) goto ec_clean;
-#endif
- /* fill DC for inter blocks */
- for(mb_y=0; mb_y<s->mb_height; mb_y++){
- for(mb_x=0; mb_x<s->mb_width; mb_x++){
- int dc, dcu, dcv, y, n;
- int16_t *dc_ptr;
- uint8_t *dest_y, *dest_cb, *dest_cr;
- const int mb_xy= mb_x + mb_y * s->mb_stride;
- const int mb_type= s->current_picture.mb_type[mb_xy];
-
- error= s->error_status_table[mb_xy];
-
- if(IS_INTRA(mb_type) && s->partitioned_frame) continue;
-// if(error&MV_ERROR) continue; //inter data damaged FIXME is this good?
-
- dest_y = s->current_picture.data[0] + mb_x*16 + mb_y*16*s->linesize;
- dest_cb= s->current_picture.data[1] + mb_x*8 + mb_y*8 *s->uvlinesize;
- dest_cr= s->current_picture.data[2] + mb_x*8 + mb_y*8 *s->uvlinesize;
-
- dc_ptr= &s->dc_val[0][mb_x*2 + mb_y*2*s->b8_stride];
- for(n=0; n<4; n++){
- dc=0;
- for(y=0; y<8; y++){
- int x;
- for(x=0; x<8; x++){
- dc+= dest_y[x + (n&1)*8 + (y + (n>>1)*8)*s->linesize];
- }
- }
- dc_ptr[(n&1) + (n>>1)*s->b8_stride]= (dc+4)>>3;
- }
-
- dcu=dcv=0;
- for(y=0; y<8; y++){
- int x;
- for(x=0; x<8; x++){
- dcu+=dest_cb[x + y*(s->uvlinesize)];
- dcv+=dest_cr[x + y*(s->uvlinesize)];
- }
- }
- s->dc_val[1][mb_x + mb_y*s->mb_stride]= (dcu+4)>>3;
- s->dc_val[2][mb_x + mb_y*s->mb_stride]= (dcv+4)>>3;
- }
- }
-#if 1
- /* guess DC for damaged blocks */
- guess_dc(s, s->dc_val[0], s->mb_width*2, s->mb_height*2, s->b8_stride, 1);
- guess_dc(s, s->dc_val[1], s->mb_width , s->mb_height , s->mb_stride, 0);
- guess_dc(s, s->dc_val[2], s->mb_width , s->mb_height , s->mb_stride, 0);
-#endif
- /* filter luma DC */
- filter181(s->dc_val[0], s->mb_width*2, s->mb_height*2, s->b8_stride);
-
-#if 1
- /* render DC only intra */
- for(mb_y=0; mb_y<s->mb_height; mb_y++){
- for(mb_x=0; mb_x<s->mb_width; mb_x++){
- uint8_t *dest_y, *dest_cb, *dest_cr;
- const int mb_xy= mb_x + mb_y * s->mb_stride;
- const int mb_type= s->current_picture.mb_type[mb_xy];
-
- error= s->error_status_table[mb_xy];
-
- if(IS_INTER(mb_type)) continue;
- if(!(error&AC_ERROR)) continue; //undamaged
-
- dest_y = s->current_picture.data[0] + mb_x*16 + mb_y*16*s->linesize;
- dest_cb= s->current_picture.data[1] + mb_x*8 + mb_y*8 *s->uvlinesize;
- dest_cr= s->current_picture.data[2] + mb_x*8 + mb_y*8 *s->uvlinesize;
-
- put_dc(s, dest_y, dest_cb, dest_cr, mb_x, mb_y);
- }
- }
-#endif
-
- if(s->avctx->error_concealment&FF_EC_DEBLOCK){
- /* filter horizontal block boundaries */
- h_block_filter(s, s->current_picture.data[0], s->mb_width*2, s->mb_height*2, s->linesize , 1);
- h_block_filter(s, s->current_picture.data[1], s->mb_width , s->mb_height , s->uvlinesize, 0);
- h_block_filter(s, s->current_picture.data[2], s->mb_width , s->mb_height , s->uvlinesize, 0);
-
- /* filter vertical block boundaries */
- v_block_filter(s, s->current_picture.data[0], s->mb_width*2, s->mb_height*2, s->linesize , 1);
- v_block_filter(s, s->current_picture.data[1], s->mb_width , s->mb_height , s->uvlinesize, 0);
- v_block_filter(s, s->current_picture.data[2], s->mb_width , s->mb_height , s->uvlinesize, 0);
- }
-
-#ifdef HAVE_XVMC
-ec_clean:
-#endif
- /* clean a few tables */
- for(i=0; i<s->mb_num; i++){
- const int mb_xy= s->mb_index2xy[i];
- int error= s->error_status_table[mb_xy];
-
- if(s->pict_type!=B_TYPE && (error&(DC_ERROR|MV_ERROR|AC_ERROR))){
- s->mbskip_table[mb_xy]=0;
- }
- s->mbintra_table[mb_xy]=1;
- }
-}
diff --git a/src/libffmpeg/libavcodec/eval.c b/src/libffmpeg/libavcodec/eval.c
deleted file mode 100644
index 6ec706991..000000000
--- a/src/libffmpeg/libavcodec/eval.c
+++ /dev/null
@@ -1,466 +0,0 @@
-/*
- * simple arithmetic expression evaluator
- *
- * Copyright (c) 2002-2006 Michael Niedermayer <michaelni@gmx.at>
- * Copyright (c) 2006 Oded Shimon <ods15@ods15.dyndns.org>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file eval.c
- * simple arithmetic expression evaluator.
- *
- * see http://joe.hotchkiss.com/programming/eval/eval.html
- */
-
-#include "avcodec.h"
-#include "mpegvideo.h"
-#include "eval.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-#ifndef NAN
- #define NAN 0.0/0.0
-#endif
-
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
-typedef struct Parser{
- int stack_index;
- char *s;
- double *const_value;
- const char **const_name; // NULL terminated
- double (**func1)(void *, double a); // NULL terminated
- const char **func1_name; // NULL terminated
- double (**func2)(void *, double a, double b); // NULL terminated
- char **func2_name; // NULL terminated
- void *opaque;
- char **error;
-#define VARS 10
- double var[VARS];
-} Parser;
-
-static int8_t si_prefixes['z' - 'E' + 1]={
- ['y'-'E']= -24,
- ['z'-'E']= -21,
- ['a'-'E']= -18,
- ['f'-'E']= -15,
- ['p'-'E']= -12,
- ['n'-'E']= - 9,
- ['u'-'E']= - 6,
- ['m'-'E']= - 3,
- ['c'-'E']= - 2,
- ['d'-'E']= - 1,
- ['h'-'E']= 2,
- ['k'-'E']= 3,
- ['K'-'E']= 3,
- ['M'-'E']= 6,
- ['G'-'E']= 9,
- ['T'-'E']= 12,
- ['P'-'E']= 15,
- ['E'-'E']= 18,
- ['Z'-'E']= 21,
- ['Y'-'E']= 24,
-};
-
-/** strtod() function extended with 'k', 'M', 'G', 'ki', 'Mi', 'Gi' and 'B'
- * postfixes. This allows using f.e. kB, MiB, G and B as a postfix. This
- * function assumes that the unit of numbers is bits not bytes.
- */
-static double av_strtod(const char *name, char **tail) {
- double d;
- char *next;
- d = strtod(name, &next);
- /* if parsing succeeded, check for and interpret postfixes */
- if (next!=name) {
-
- if(*next >= 'E' && *next <= 'z'){
- int e= si_prefixes[*next - 'E'];
- if(e){
- if(next[1] == 'i'){
- d*= pow( 2, e/0.3);
- next+=2;
- }else{
- d*= pow(10, e);
- next++;
- }
- }
- }
-
- if(*next=='B') {
- d*=8;
- next++;
- }
- }
- /* if requested, fill in tail with the position after the last parsed
- character */
- if (tail)
- *tail = next;
- return d;
-}
-
-static int strmatch(const char *s, const char *prefix){
- int i;
- for(i=0; prefix[i]; i++){
- if(prefix[i] != s[i]) return 0;
- }
- return 1;
-}
-
-struct ff_expr_s {
- enum {
- e_value, e_const, e_func0, e_func1, e_func2,
- e_squish, e_gauss, e_ld,
- e_mod, e_max, e_min, e_eq, e_gt, e_gte,
- e_pow, e_mul, e_div, e_add,
- e_last, e_st, e_while,
- } type;
- double value; // is sign in other types
- union {
- int const_index;
- double (*func0)(double);
- double (*func1)(void *, double);
- double (*func2)(void *, double, double);
- } a;
- AVEvalExpr * param[2];
-};
-
-static double eval_expr(Parser * p, AVEvalExpr * e) {
- switch (e->type) {
- case e_value: return e->value;
- case e_const: return e->value * p->const_value[e->a.const_index];
- case e_func0: return e->value * e->a.func0(eval_expr(p, e->param[0]));
- case e_func1: return e->value * e->a.func1(p->opaque, eval_expr(p, e->param[0]));
- case e_func2: return e->value * e->a.func2(p->opaque, eval_expr(p, e->param[0]), eval_expr(p, e->param[1]));
- case e_squish: return 1/(1+exp(4*eval_expr(p, e->param[0])));
- case e_gauss: { double d = eval_expr(p, e->param[0]); return exp(-d*d/2)/sqrt(2*M_PI); }
- case e_ld: return e->value * p->var[clip(eval_expr(p, e->param[0]), 0, VARS-1)];
- case e_while: {
- double d = NAN;
- while(eval_expr(p, e->param[0]))
- d=eval_expr(p, e->param[1]);
- return d;
- }
- default: {
- double d = eval_expr(p, e->param[0]);
- double d2 = eval_expr(p, e->param[1]);
- switch (e->type) {
- case e_mod: return e->value * (d - floor(d/d2)*d2);
- case e_max: return e->value * (d > d2 ? d : d2);
- case e_min: return e->value * (d < d2 ? d : d2);
- case e_eq: return e->value * (d == d2 ? 1.0 : 0.0);
- case e_gt: return e->value * (d > d2 ? 1.0 : 0.0);
- case e_gte: return e->value * (d >= d2 ? 1.0 : 0.0);
- case e_pow: return e->value * pow(d, d2);
- case e_mul: return e->value * (d * d2);
- case e_div: return e->value * (d / d2);
- case e_add: return e->value * (d + d2);
- case e_last:return e->value * d2;
- case e_st : return e->value * (p->var[clip(d, 0, VARS-1)]= d2);
- }
- }
- }
- return NAN;
-}
-
-static AVEvalExpr * parse_expr(Parser *p);
-
-void ff_eval_free(AVEvalExpr * e) {
- if (!e) return;
- ff_eval_free(e->param[0]);
- ff_eval_free(e->param[1]);
- av_freep(&e);
-}
-
-static AVEvalExpr * parse_primary(Parser *p) {
- AVEvalExpr * d = av_mallocz(sizeof(AVEvalExpr));
- char *next= p->s;
- int i;
-
- /* number */
- d->value = av_strtod(p->s, &next);
- if(next != p->s){
- d->type = e_value;
- p->s= next;
- return d;
- }
- d->value = 1;
-
- /* named constants */
- for(i=0; p->const_name && p->const_name[i]; i++){
- if(strmatch(p->s, p->const_name[i])){
- p->s+= strlen(p->const_name[i]);
- d->type = e_const;
- d->a.const_index = i;
- return d;
- }
- }
-
- p->s= strchr(p->s, '(');
- if(p->s==NULL){
- *p->error = "missing (";
- p->s= next;
- ff_eval_free(d);
- return NULL;
- }
- p->s++; // "("
- if (*next == '(') { // special case do-nothing
- av_freep(&d);
- d = parse_expr(p);
- if(p->s[0] != ')'){
- *p->error = "missing )";
- ff_eval_free(d);
- return NULL;
- }
- p->s++; // ")"
- return d;
- }
- d->param[0] = parse_expr(p);
- if(p->s[0]== ','){
- p->s++; // ","
- d->param[1] = parse_expr(p);
- }
- if(p->s[0] != ')'){
- *p->error = "missing )";
- ff_eval_free(d);
- return NULL;
- }
- p->s++; // ")"
-
- d->type = e_func0;
- if( strmatch(next, "sinh" ) ) d->a.func0 = sinh;
- else if( strmatch(next, "cosh" ) ) d->a.func0 = cosh;
- else if( strmatch(next, "tanh" ) ) d->a.func0 = tanh;
- else if( strmatch(next, "sin" ) ) d->a.func0 = sin;
- else if( strmatch(next, "cos" ) ) d->a.func0 = cos;
- else if( strmatch(next, "tan" ) ) d->a.func0 = tan;
- else if( strmatch(next, "atan" ) ) d->a.func0 = atan;
- else if( strmatch(next, "asin" ) ) d->a.func0 = asin;
- else if( strmatch(next, "acos" ) ) d->a.func0 = acos;
- else if( strmatch(next, "exp" ) ) d->a.func0 = exp;
- else if( strmatch(next, "log" ) ) d->a.func0 = log;
- else if( strmatch(next, "abs" ) ) d->a.func0 = fabs;
- else if( strmatch(next, "squish") ) d->type = e_squish;
- else if( strmatch(next, "gauss" ) ) d->type = e_gauss;
- else if( strmatch(next, "mod" ) ) d->type = e_mod;
- else if( strmatch(next, "max" ) ) d->type = e_max;
- else if( strmatch(next, "min" ) ) d->type = e_min;
- else if( strmatch(next, "eq" ) ) d->type = e_eq;
- else if( strmatch(next, "gte" ) ) d->type = e_gte;
- else if( strmatch(next, "gt" ) ) d->type = e_gt;
- else if( strmatch(next, "lte" ) ) { AVEvalExpr * tmp = d->param[1]; d->param[1] = d->param[0]; d->param[0] = tmp; d->type = e_gt; }
- else if( strmatch(next, "lt" ) ) { AVEvalExpr * tmp = d->param[1]; d->param[1] = d->param[0]; d->param[0] = tmp; d->type = e_gte; }
- else if( strmatch(next, "ld" ) ) d->type = e_ld;
- else if( strmatch(next, "st" ) ) d->type = e_st;
- else if( strmatch(next, "while" ) ) d->type = e_while;
- else {
- for(i=0; p->func1_name && p->func1_name[i]; i++){
- if(strmatch(next, p->func1_name[i])){
- d->a.func1 = p->func1[i];
- d->type = e_func1;
- return d;
- }
- }
-
- for(i=0; p->func2_name && p->func2_name[i]; i++){
- if(strmatch(next, p->func2_name[i])){
- d->a.func2 = p->func2[i];
- d->type = e_func2;
- return d;
- }
- }
-
- *p->error = "unknown function";
- ff_eval_free(d);
- return NULL;
- }
-
- return d;
-}
-
-static AVEvalExpr * new_eval_expr(int type, int value, AVEvalExpr *p0, AVEvalExpr *p1){
- AVEvalExpr * e = av_mallocz(sizeof(AVEvalExpr));
- e->type =type ;
- e->value =value ;
- e->param[0] =p0 ;
- e->param[1] =p1 ;
- return e;
-}
-
-static AVEvalExpr * parse_pow(Parser *p, int *sign){
- *sign= (*p->s == '+') - (*p->s == '-');
- p->s += *sign&1;
- return parse_primary(p);
-}
-
-static AVEvalExpr * parse_factor(Parser *p){
- int sign, sign2;
- AVEvalExpr * e = parse_pow(p, &sign);
- while(p->s[0]=='^'){
- p->s++;
- e= new_eval_expr(e_pow, 1, e, parse_pow(p, &sign2));
- if (e->param[1]) e->param[1]->value *= (sign2|1);
- }
- if (e) e->value *= (sign|1);
- return e;
-}
-
-static AVEvalExpr * parse_term(Parser *p){
- AVEvalExpr * e = parse_factor(p);
- while(p->s[0]=='*' || p->s[0]=='/'){
- int c= *p->s++;
- e= new_eval_expr(c == '*' ? e_mul : e_div, 1, e, parse_factor(p));
- }
- return e;
-}
-
-static AVEvalExpr * parse_subexpr(Parser *p) {
- AVEvalExpr * e = parse_term(p);
- while(*p->s == '+' || *p->s == '-') {
- e= new_eval_expr(e_add, 1, e, parse_term(p));
- };
-
- return e;
-}
-
-static AVEvalExpr * parse_expr(Parser *p) {
- AVEvalExpr * e;
-
- if(p->stack_index <= 0) //protect against stack overflows
- return NULL;
- p->stack_index--;
-
- e = parse_subexpr(p);
-
- while(*p->s == ';') {
- p->s++;
- e= new_eval_expr(e_last, 1, e, parse_subexpr(p));
- };
-
- p->stack_index++;
-
- return e;
-}
-
-static int verify_expr(AVEvalExpr * e) {
- if (!e) return 0;
- switch (e->type) {
- case e_value:
- case e_const: return 1;
- case e_func0:
- case e_func1:
- case e_squish:
- case e_ld:
- case e_gauss: return verify_expr(e->param[0]);
- default: return verify_expr(e->param[0]) && verify_expr(e->param[1]);
- }
-}
-
-AVEvalExpr * ff_parse(char *s, const char **const_name,
- double (**func1)(void *, double), const char **func1_name,
- double (**func2)(void *, double, double), char **func2_name,
- char **error){
- Parser p;
- AVEvalExpr * e;
- char w[strlen(s) + 1], * wp = w;
-
- while (*s)
- if (!isspace(*s++)) *wp++ = s[-1];
- *wp++ = 0;
-
- p.stack_index=100;
- p.s= w;
- p.const_name = const_name;
- p.func1 = func1;
- p.func1_name = func1_name;
- p.func2 = func2;
- p.func2_name = func2_name;
- p.error= error;
-
- e = parse_expr(&p);
- if (!verify_expr(e)) {
- ff_eval_free(e);
- return NULL;
- }
- return e;
-}
-
-double ff_parse_eval(AVEvalExpr * e, double *const_value, void *opaque) {
- Parser p;
-
- p.const_value= const_value;
- p.opaque = opaque;
- return eval_expr(&p, e);
-}
-
-double ff_eval2(char *s, double *const_value, const char **const_name,
- double (**func1)(void *, double), const char **func1_name,
- double (**func2)(void *, double, double), char **func2_name,
- void *opaque, char **error){
- AVEvalExpr * e = ff_parse(s, const_name, func1, func1_name, func2, func2_name, error);
- double d;
- if (!e) return NAN;
- d = ff_parse_eval(e, const_value, opaque);
- ff_eval_free(e);
- return d;
-}
-
-#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
-attribute_deprecated double ff_eval(char *s, double *const_value, const char **const_name,
- double (**func1)(void *, double), const char **func1_name,
- double (**func2)(void *, double, double), char **func2_name,
- void *opaque){
- char *error=NULL;
- double ret;
- ret = ff_eval2(s, const_value, const_name, func1, func1_name, func2, func2_name, opaque, &error);
- if (error)
- av_log(NULL, AV_LOG_ERROR, "Error evaluating \"%s\": %s\n", s, error);
- return ret;
-}
-#endif
-
-#ifdef TEST
-#undef printf
-static double const_values[]={
- M_PI,
- M_E,
- 0
-};
-static const char *const_names[]={
- "PI",
- "E",
- 0
-};
-main(){
- int i;
- printf("%f == 12.7\n", ff_eval("1+(5-2)^(3-1)+1/2+sin(PI)-max(-2.2,-3.1)", const_values, const_names, NULL, NULL, NULL, NULL, NULL));
- printf("%f == 0.931322575\n", ff_eval("80G/80Gi", const_values, const_names, NULL, NULL, NULL, NULL, NULL));
-
- for(i=0; i<1050; i++){
- START_TIMER
- ff_eval("1+(5-2)^(3-1)+1/2+sin(PI)-max(-2.2,-3.1)", const_values, const_names, NULL, NULL, NULL, NULL, NULL);
- STOP_TIMER("ff_eval")
- }
-}
-#endif
diff --git a/src/libffmpeg/libavcodec/eval.h b/src/libffmpeg/libavcodec/eval.h
deleted file mode 100644
index b52199cf4..000000000
--- a/src/libffmpeg/libavcodec/eval.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * simple arithmetic expression evaluator
- *
- * Copyright (c) 2002 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file eval.h
- * eval header.
- */
-
-#ifndef AVCODEC_EVAL_H
-#define AVCODEC_EVAL_H
-
-#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
-double ff_eval(char *s, double *const_value, const char **const_name,
- double (**func1)(void *, double), const char **func1_name,
- double (**func2)(void *, double, double), char **func2_name,
- void *opaque);
-#endif
-
-/**
- * Parses and evaluates an expression.
- * Note, this is significantly slower than ff_parse_eval()
- * @param s expression as a zero terminated string for example "1+2^3+5*5+sin(2/3)"
- * @param func1 NULL terminated array of function pointers for functions which take 1 argument
- * @param func2 NULL terminated array of function pointers for functions which take 2 arguments
- * @param const_name NULL terminated array of zero terminated strings of constant identifers for example {"PI", "E", 0}
- * @param func1_name NULL terminated array of zero terminated strings of func1 identifers
- * @param func2_name NULL terminated array of zero terminated strings of func2 identifers
- * @param error pointer to a char* which is set to an error message if something goes wrong
- * @param const_value a zero terminated array of values for the identifers from const_name
- * @param opaque a pointer which will be passed to all functions from func1 and func2
- * @return the value of the expression
- */
-double ff_eval2(char *s, double *const_value, const char **const_name,
- double (**func1)(void *, double), const char **func1_name,
- double (**func2)(void *, double, double), char **func2_name,
- void *opaque, char **error);
-
-typedef struct ff_expr_s AVEvalExpr;
-
-/**
- * Parses a expression.
- * @param s expression as a zero terminated string for example "1+2^3+5*5+sin(2/3)"
- * @param func1 NULL terminated array of function pointers for functions which take 1 argument
- * @param func2 NULL terminated array of function pointers for functions which take 2 arguments
- * @param const_name NULL terminated array of zero terminated strings of constant identifers for example {"PI", "E", 0}
- * @param func1_name NULL terminated array of zero terminated strings of func1 identifers
- * @param func2_name NULL terminated array of zero terminated strings of func2 identifers
- * @param error pointer to a char* which is set to an error message if something goes wrong
- * @return AVEvalExpr which must be freed with ff_eval_free by the user when its not needed anymore
- * NULL if anything went wrong
- */
-AVEvalExpr * ff_parse(char *s, const char **const_name,
- double (**func1)(void *, double), const char **func1_name,
- double (**func2)(void *, double, double), char **func2_name,
- char **error);
-/**
- * Evaluates a previously parsed expression.
- * @param const_value a zero terminated array of values for the identifers from ff_parse const_name
- * @param opaque a pointer which will be passed to all functions from func1 and func2
- * @return the value of the expression
- */
-double ff_parse_eval(AVEvalExpr * e, double *const_value, void *opaque);
-void ff_eval_free(AVEvalExpr * e);
-
-#endif /* AVCODEC_EVAL_H */
diff --git a/src/libffmpeg/libavcodec/faandct.c b/src/libffmpeg/libavcodec/faandct.c
deleted file mode 100644
index 6f73ee5e9..000000000
--- a/src/libffmpeg/libavcodec/faandct.c
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * Floating point AAN DCT
- * Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * this implementation is based upon the IJG integer AAN DCT (see jfdctfst.c)
- */
-
-/**
- * @file faandct.c
- * @brief
- * Floating point AAN DCT
- * @author Michael Niedermayer <michaelni@gmx.at>
- */
-
-#include "dsputil.h"
-#include "faandct.h"
-
-#define FLOAT float
-#ifdef FAAN_POSTSCALE
-# define SCALE(x) postscale[x]
-#else
-# define SCALE(x) 1
-#endif
-
-//numbers generated by simple c code (not as accurate as they could be)
-/*
-for(i=0; i<8; i++){
- printf("#define B%d %1.20llf\n", i, (long double)1.0/(cosl(i*acosl(-1.0)/(long double)16.0)*sqrtl(2)));
-}
-*/
-#define B0 1.00000000000000000000
-#define B1 0.72095982200694791383 // (cos(pi*1/16)sqrt(2))^-1
-#define B2 0.76536686473017954350 // (cos(pi*2/16)sqrt(2))^-1
-#define B3 0.85043009476725644878 // (cos(pi*3/16)sqrt(2))^-1
-#define B4 1.00000000000000000000 // (cos(pi*4/16)sqrt(2))^-1
-#define B5 1.27275858057283393842 // (cos(pi*5/16)sqrt(2))^-1
-#define B6 1.84775906502257351242 // (cos(pi*6/16)sqrt(2))^-1
-#define B7 3.62450978541155137218 // (cos(pi*7/16)sqrt(2))^-1
-
-
-#define A1 0.70710678118654752438 // cos(pi*4/16)
-#define A2 0.54119610014619698435 // cos(pi*6/16)sqrt(2)
-#define A5 0.38268343236508977170 // cos(pi*6/16)
-#define A4 1.30656296487637652774 // cos(pi*2/16)sqrt(2)
-
-static FLOAT postscale[64]={
-B0*B0, B0*B1, B0*B2, B0*B3, B0*B4, B0*B5, B0*B6, B0*B7,
-B1*B0, B1*B1, B1*B2, B1*B3, B1*B4, B1*B5, B1*B6, B1*B7,
-B2*B0, B2*B1, B2*B2, B2*B3, B2*B4, B2*B5, B2*B6, B2*B7,
-B3*B0, B3*B1, B3*B2, B3*B3, B3*B4, B3*B5, B3*B6, B3*B7,
-B4*B0, B4*B1, B4*B2, B4*B3, B4*B4, B4*B5, B4*B6, B4*B7,
-B5*B0, B5*B1, B5*B2, B5*B3, B5*B4, B5*B5, B5*B6, B5*B7,
-B6*B0, B6*B1, B6*B2, B6*B3, B6*B4, B6*B5, B6*B6, B6*B7,
-B7*B0, B7*B1, B7*B2, B7*B3, B7*B4, B7*B5, B7*B6, B7*B7,
-};
-
-static av_always_inline void row_fdct(FLOAT temp[64], DCTELEM * data)
-{
- FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
- FLOAT tmp10, tmp11, tmp12, tmp13;
- FLOAT z1, z2, z3, z4, z5, z11, z13;
- int i;
-
- for (i=0; i<8*8; i+=8) {
- tmp0= data[0 + i] + data[7 + i];
- tmp7= data[0 + i] - data[7 + i];
- tmp1= data[1 + i] + data[6 + i];
- tmp6= data[1 + i] - data[6 + i];
- tmp2= data[2 + i] + data[5 + i];
- tmp5= data[2 + i] - data[5 + i];
- tmp3= data[3 + i] + data[4 + i];
- tmp4= data[3 + i] - data[4 + i];
-
- tmp10= tmp0 + tmp3;
- tmp13= tmp0 - tmp3;
- tmp11= tmp1 + tmp2;
- tmp12= tmp1 - tmp2;
-
- temp[0 + i]= tmp10 + tmp11;
- temp[4 + i]= tmp10 - tmp11;
-
- z1= (tmp12 + tmp13)*A1;
- temp[2 + i]= tmp13 + z1;
- temp[6 + i]= tmp13 - z1;
-
- tmp10= tmp4 + tmp5;
- tmp11= tmp5 + tmp6;
- tmp12= tmp6 + tmp7;
-
- z5= (tmp10 - tmp12) * A5;
- z2= tmp10*A2 + z5;
- z4= tmp12*A4 + z5;
- z3= tmp11*A1;
-
- z11= tmp7 + z3;
- z13= tmp7 - z3;
-
- temp[5 + i]= z13 + z2;
- temp[3 + i]= z13 - z2;
- temp[1 + i]= z11 + z4;
- temp[7 + i]= z11 - z4;
- }
-}
-
-void ff_faandct(DCTELEM * data)
-{
- FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
- FLOAT tmp10, tmp11, tmp12, tmp13;
- FLOAT z1, z2, z3, z4, z5, z11, z13;
- FLOAT temp[64];
- int i;
-
- emms_c();
-
- row_fdct(temp, data);
-
- for (i=0; i<8; i++) {
- tmp0= temp[8*0 + i] + temp[8*7 + i];
- tmp7= temp[8*0 + i] - temp[8*7 + i];
- tmp1= temp[8*1 + i] + temp[8*6 + i];
- tmp6= temp[8*1 + i] - temp[8*6 + i];
- tmp2= temp[8*2 + i] + temp[8*5 + i];
- tmp5= temp[8*2 + i] - temp[8*5 + i];
- tmp3= temp[8*3 + i] + temp[8*4 + i];
- tmp4= temp[8*3 + i] - temp[8*4 + i];
-
- tmp10= tmp0 + tmp3;
- tmp13= tmp0 - tmp3;
- tmp11= tmp1 + tmp2;
- tmp12= tmp1 - tmp2;
-
- data[8*0 + i]= lrintf(SCALE(8*0 + i) * (tmp10 + tmp11));
- data[8*4 + i]= lrintf(SCALE(8*4 + i) * (tmp10 - tmp11));
-
- z1= (tmp12 + tmp13)* A1;
- data[8*2 + i]= lrintf(SCALE(8*2 + i) * (tmp13 + z1));
- data[8*6 + i]= lrintf(SCALE(8*6 + i) * (tmp13 - z1));
-
- tmp10= tmp4 + tmp5;
- tmp11= tmp5 + tmp6;
- tmp12= tmp6 + tmp7;
-
- z5= (tmp10 - tmp12) * A5;
- z2= tmp10*A2 + z5;
- z4= tmp12*A4 + z5;
- z3= tmp11*A1;
-
- z11= tmp7 + z3;
- z13= tmp7 - z3;
-
- data[8*5 + i]= lrintf(SCALE(8*5 + i) * (z13 + z2));
- data[8*3 + i]= lrintf(SCALE(8*3 + i) * (z13 - z2));
- data[8*1 + i]= lrintf(SCALE(8*1 + i) * (z11 + z4));
- data[8*7 + i]= lrintf(SCALE(8*7 + i) * (z11 - z4));
- }
-}
-
-void ff_faandct248(DCTELEM * data)
-{
- FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
- FLOAT tmp10, tmp11, tmp12, tmp13;
- FLOAT z1;
- FLOAT temp[64];
- int i;
-
- emms_c();
-
- row_fdct(temp, data);
-
- for (i=0; i<8; i++) {
- tmp0 = temp[8*0 + i] + temp[8*1 + i];
- tmp1 = temp[8*2 + i] + temp[8*3 + i];
- tmp2 = temp[8*4 + i] + temp[8*5 + i];
- tmp3 = temp[8*6 + i] + temp[8*7 + i];
- tmp4 = temp[8*0 + i] - temp[8*1 + i];
- tmp5 = temp[8*2 + i] - temp[8*3 + i];
- tmp6 = temp[8*4 + i] - temp[8*5 + i];
- tmp7 = temp[8*6 + i] - temp[8*7 + i];
-
- tmp10 = tmp0 + tmp3;
- tmp11 = tmp1 + tmp2;
- tmp12 = tmp1 - tmp2;
- tmp13 = tmp0 - tmp3;
-
- data[8*0 + i] = lrintf(SCALE(8*0 + i) * (tmp10 + tmp11));
- data[8*4 + i] = lrintf(SCALE(8*4 + i) * (tmp10 - tmp11));
-
- z1 = (tmp12 + tmp13)* A1;
- data[8*2 + i] = lrintf(SCALE(8*2 + i) * (tmp13 + z1));
- data[8*6 + i] = lrintf(SCALE(8*6 + i) * (tmp13 - z1));
-
- tmp10 = tmp4 + tmp7;
- tmp11 = tmp5 + tmp6;
- tmp12 = tmp5 - tmp6;
- tmp13 = tmp4 - tmp7;
-
- data[8*1 + i] = lrintf(SCALE(8*0 + i) * (tmp10 + tmp11));
- data[8*5 + i] = lrintf(SCALE(8*4 + i) * (tmp10 - tmp11));
-
- z1 = (tmp12 + tmp13)* A1;
- data[8*3 + i] = lrintf(SCALE(8*2 + i) * (tmp13 + z1));
- data[8*7 + i] = lrintf(SCALE(8*6 + i) * (tmp13 - z1));
- }
-}
diff --git a/src/libffmpeg/libavcodec/faandct.h b/src/libffmpeg/libavcodec/faandct.h
deleted file mode 100644
index 77dd41dae..000000000
--- a/src/libffmpeg/libavcodec/faandct.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Floating point AAN DCT
- * Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file faandct.h
- * @brief
- * Floating point AAN DCT
- * @author Michael Niedermayer <michaelni@gmx.at>
- */
-
-#define FAAN_POSTSCALE
-
-void ff_faandct(DCTELEM * data);
-void ff_faandct248(DCTELEM * data);
diff --git a/src/libffmpeg/libavcodec/fastmemcpy.h b/src/libffmpeg/libavcodec/fastmemcpy.h
deleted file mode 100644
index 3459bf1ce..000000000
--- a/src/libffmpeg/libavcodec/fastmemcpy.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#if 0
-extern void *xine_fast_memcpy(void *to, const void *from, size_t len);
-#define memcpy(a,b,c) xine_fast_memcpy(a,b,c)
-#endif
diff --git a/src/libffmpeg/libavcodec/fdctref.c b/src/libffmpeg/libavcodec/fdctref.c
deleted file mode 100644
index 5eff36849..000000000
--- a/src/libffmpeg/libavcodec/fdctref.c
+++ /dev/null
@@ -1,158 +0,0 @@
-/**
- * @file fdctref.c
- * forward discrete cosine transform, double precision.
- */
-
-/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
-
-/*
- * Disclaimer of Warranty
- *
- * These software programs are available to the user without any license fee or
- * royalty on an "as is" basis. The MPEG Software Simulation Group disclaims
- * any and all warranties, whether express, implied, or statuary, including any
- * implied warranties or merchantability or of fitness for a particular
- * purpose. In no event shall the copyright-holder be liable for any
- * incidental, punitive, or consequential damages of any kind whatsoever
- * arising from the use of these programs.
- *
- * This disclaimer of warranty extends to the user of these programs and user's
- * customers, employees, agents, transferees, successors, and assigns.
- *
- * The MPEG Software Simulation Group does not represent or warrant that the
- * programs furnished hereunder are free of infringement of any third-party
- * patents.
- *
- * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
- * are subject to royalty fees to patent holders. Many of these patents are
- * general enough such that they are unavoidable regardless of implementation
- * design.
- *
- */
-
-#include <math.h>
-
-#ifndef PI
-# ifdef M_PI
-# define PI M_PI
-# else
-# define PI 3.14159265358979323846
-# endif
-#endif
-
-/* global declarations */
-void init_fdct (void);
-void fdct (short *block);
-
-/* private data */
-static double c[8][8]; /* transform coefficients */
-
-void init_fdct()
-{
- int i, j;
- double s;
-
- for (i=0; i<8; i++)
- {
- s = (i==0) ? sqrt(0.125) : 0.5;
-
- for (j=0; j<8; j++)
- c[i][j] = s * cos((PI/8.0)*i*(j+0.5));
- }
-}
-
-void fdct(block)
-short *block;
-{
- register int i, j;
- double s;
- double tmp[64];
-
- for(i = 0; i < 8; i++)
- for(j = 0; j < 8; j++)
- {
- s = 0.0;
-
-/*
- * for(k = 0; k < 8; k++)
- * s += c[j][k] * block[8 * i + k];
- */
- s += c[j][0] * block[8 * i + 0];
- s += c[j][1] * block[8 * i + 1];
- s += c[j][2] * block[8 * i + 2];
- s += c[j][3] * block[8 * i + 3];
- s += c[j][4] * block[8 * i + 4];
- s += c[j][5] * block[8 * i + 5];
- s += c[j][6] * block[8 * i + 6];
- s += c[j][7] * block[8 * i + 7];
-
- tmp[8 * i + j] = s;
- }
-
- for(j = 0; j < 8; j++)
- for(i = 0; i < 8; i++)
- {
- s = 0.0;
-
-/*
- * for(k = 0; k < 8; k++)
- * s += c[i][k] * tmp[8 * k + j];
- */
- s += c[i][0] * tmp[8 * 0 + j];
- s += c[i][1] * tmp[8 * 1 + j];
- s += c[i][2] * tmp[8 * 2 + j];
- s += c[i][3] * tmp[8 * 3 + j];
- s += c[i][4] * tmp[8 * 4 + j];
- s += c[i][5] * tmp[8 * 5 + j];
- s += c[i][6] * tmp[8 * 6 + j];
- s += c[i][7] * tmp[8 * 7 + j];
- s*=8.0;
-
- block[8 * i + j] = (short)floor(s + 0.499999);
-/*
- * reason for adding 0.499999 instead of 0.5:
- * s is quite often x.5 (at least for i and/or j = 0 or 4)
- * and setting the rounding threshold exactly to 0.5 leads to an
- * extremely high arithmetic implementation dependency of the result;
- * s being between x.5 and x.500001 (which is now incorrectly rounded
- * downwards instead of upwards) is assumed to occur less often
- * (if at all)
- */
- }
-}
-
-/* perform IDCT matrix multiply for 8x8 coefficient block */
-
-void idct(block)
-short *block;
-{
- int i, j, k, v;
- double partial_product;
- double tmp[64];
-
- for (i=0; i<8; i++)
- for (j=0; j<8; j++)
- {
- partial_product = 0.0;
-
- for (k=0; k<8; k++)
- partial_product+= c[k][j]*block[8*i+k];
-
- tmp[8*i+j] = partial_product;
- }
-
- /* Transpose operation is integrated into address mapping by switching
- loop order of i and j */
-
- for (j=0; j<8; j++)
- for (i=0; i<8; i++)
- {
- partial_product = 0.0;
-
- for (k=0; k<8; k++)
- partial_product+= c[k][i]*tmp[8*k+j];
-
- v = (int) floor(partial_product+0.5);
- block[8*i+j] = v;
- }
-}
diff --git a/src/libffmpeg/libavcodec/fft.c b/src/libffmpeg/libavcodec/fft.c
deleted file mode 100644
index 62a6a5576..000000000
--- a/src/libffmpeg/libavcodec/fft.c
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * FFT/IFFT transforms
- * Copyright (c) 2002 Fabrice Bellard.
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file fft.c
- * FFT/IFFT transforms.
- */
-
-#include "dsputil.h"
-
-/**
- * The size of the FFT is 2^nbits. If inverse is TRUE, inverse FFT is
- * done
- */
-int ff_fft_init(FFTContext *s, int nbits, int inverse)
-{
- int i, j, m, n;
- float alpha, c1, s1, s2;
-
- s->nbits = nbits;
- n = 1 << nbits;
-
- s->exptab = av_malloc((n / 2) * sizeof(FFTComplex));
- if (!s->exptab)
- goto fail;
- s->revtab = av_malloc(n * sizeof(uint16_t));
- if (!s->revtab)
- goto fail;
- s->inverse = inverse;
-
- s2 = inverse ? 1.0 : -1.0;
-
- for(i=0;i<(n/2);i++) {
- alpha = 2 * M_PI * (float)i / (float)n;
- c1 = cos(alpha);
- s1 = sin(alpha) * s2;
- s->exptab[i].re = c1;
- s->exptab[i].im = s1;
- }
- s->fft_calc = ff_fft_calc_c;
- s->imdct_calc = ff_imdct_calc;
- s->exptab1 = NULL;
-
- /* compute constant table for HAVE_SSE version */
-#if defined(HAVE_MMX) \
- || (defined(HAVE_ALTIVEC) && !defined(ALTIVEC_USE_REFERENCE_C_CODE))
- {
- int has_vectors = mm_support();
-
- if (has_vectors) {
-#if defined(HAVE_MMX)
- if (has_vectors & MM_3DNOWEXT) {
- /* 3DNowEx for K7/K8 */
- s->imdct_calc = ff_imdct_calc_3dn2;
- s->fft_calc = ff_fft_calc_3dn2;
- } else if (has_vectors & MM_3DNOW) {
- /* 3DNow! for K6-2/3 */
- s->fft_calc = ff_fft_calc_3dn;
- } else if (has_vectors & MM_SSE) {
- /* SSE for P3/P4 */
- s->imdct_calc = ff_imdct_calc_sse;
- s->fft_calc = ff_fft_calc_sse;
- }
-#else /* HAVE_MMX */
- if (has_vectors & MM_ALTIVEC)
- s->fft_calc = ff_fft_calc_altivec;
-#endif
- }
- if (s->fft_calc != ff_fft_calc_c) {
- int np, nblocks, np2, l;
- FFTComplex *q;
-
- np = 1 << nbits;
- nblocks = np >> 3;
- np2 = np >> 1;
- s->exptab1 = av_malloc(np * 2 * sizeof(FFTComplex));
- if (!s->exptab1)
- goto fail;
- q = s->exptab1;
- do {
- for(l = 0; l < np2; l += 2 * nblocks) {
- *q++ = s->exptab[l];
- *q++ = s->exptab[l + nblocks];
-
- q->re = -s->exptab[l].im;
- q->im = s->exptab[l].re;
- q++;
- q->re = -s->exptab[l + nblocks].im;
- q->im = s->exptab[l + nblocks].re;
- q++;
- }
- nblocks = nblocks >> 1;
- } while (nblocks != 0);
- av_freep(&s->exptab);
- }
- }
-#endif
-
- /* compute bit reverse table */
-
- for(i=0;i<n;i++) {
- m=0;
- for(j=0;j<nbits;j++) {
- m |= ((i >> j) & 1) << (nbits-j-1);
- }
- s->revtab[i]=m;
- }
- return 0;
- fail:
- av_freep(&s->revtab);
- av_freep(&s->exptab);
- av_freep(&s->exptab1);
- return -1;
-}
-
-/* butter fly op */
-#define BF(pre, pim, qre, qim, pre1, pim1, qre1, qim1) \
-{\
- FFTSample ax, ay, bx, by;\
- bx=pre1;\
- by=pim1;\
- ax=qre1;\
- ay=qim1;\
- pre = (bx + ax);\
- pim = (by + ay);\
- qre = (bx - ax);\
- qim = (by - ay);\
-}
-
-#define MUL16(a,b) ((a) * (b))
-
-#define CMUL(pre, pim, are, aim, bre, bim) \
-{\
- pre = (MUL16(are, bre) - MUL16(aim, bim));\
- pim = (MUL16(are, bim) + MUL16(bre, aim));\
-}
-
-/**
- * Do a complex FFT with the parameters defined in ff_fft_init(). The
- * input data must be permuted before with s->revtab table. No
- * 1.0/sqrt(n) normalization is done.
- */
-void ff_fft_calc_c(FFTContext *s, FFTComplex *z)
-{
- int ln = s->nbits;
- int j, np, np2;
- int nblocks, nloops;
- register FFTComplex *p, *q;
- FFTComplex *exptab = s->exptab;
- int l;
- FFTSample tmp_re, tmp_im;
-
- np = 1 << ln;
-
- /* pass 0 */
-
- p=&z[0];
- j=(np >> 1);
- do {
- BF(p[0].re, p[0].im, p[1].re, p[1].im,
- p[0].re, p[0].im, p[1].re, p[1].im);
- p+=2;
- } while (--j != 0);
-
- /* pass 1 */
-
-
- p=&z[0];
- j=np >> 2;
- if (s->inverse) {
- do {
- BF(p[0].re, p[0].im, p[2].re, p[2].im,
- p[0].re, p[0].im, p[2].re, p[2].im);
- BF(p[1].re, p[1].im, p[3].re, p[3].im,
- p[1].re, p[1].im, -p[3].im, p[3].re);
- p+=4;
- } while (--j != 0);
- } else {
- do {
- BF(p[0].re, p[0].im, p[2].re, p[2].im,
- p[0].re, p[0].im, p[2].re, p[2].im);
- BF(p[1].re, p[1].im, p[3].re, p[3].im,
- p[1].re, p[1].im, p[3].im, -p[3].re);
- p+=4;
- } while (--j != 0);
- }
- /* pass 2 .. ln-1 */
-
- nblocks = np >> 3;
- nloops = 1 << 2;
- np2 = np >> 1;
- do {
- p = z;
- q = z + nloops;
- for (j = 0; j < nblocks; ++j) {
- BF(p->re, p->im, q->re, q->im,
- p->re, p->im, q->re, q->im);
-
- p++;
- q++;
- for(l = nblocks; l < np2; l += nblocks) {
- CMUL(tmp_re, tmp_im, exptab[l].re, exptab[l].im, q->re, q->im);
- BF(p->re, p->im, q->re, q->im,
- p->re, p->im, tmp_re, tmp_im);
- p++;
- q++;
- }
-
- p += nloops;
- q += nloops;
- }
- nblocks = nblocks >> 1;
- nloops = nloops << 1;
- } while (nblocks != 0);
-}
-
-/**
- * Do the permutation needed BEFORE calling ff_fft_calc()
- */
-void ff_fft_permute(FFTContext *s, FFTComplex *z)
-{
- int j, k, np;
- FFTComplex tmp;
- const uint16_t *revtab = s->revtab;
-
- /* reverse */
- np = 1 << s->nbits;
- for(j=0;j<np;j++) {
- k = revtab[j];
- if (k < j) {
- tmp = z[k];
- z[k] = z[j];
- z[j] = tmp;
- }
- }
-}
-
-void ff_fft_end(FFTContext *s)
-{
- av_freep(&s->revtab);
- av_freep(&s->exptab);
- av_freep(&s->exptab1);
-}
-
diff --git a/src/libffmpeg/libavcodec/ffv1.c b/src/libffmpeg/libavcodec/ffv1.c
deleted file mode 100644
index 1ca18a4e8..000000000
--- a/src/libffmpeg/libavcodec/ffv1.c
+++ /dev/null
@@ -1,1040 +0,0 @@
-/*
- * FFV1 codec for libavcodec
- *
- * Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file ffv1.c
- * FF Video Codec 1 (an experimental lossless codec)
- */
-
-#include "common.h"
-#include "bitstream.h"
-#include "avcodec.h"
-#include "dsputil.h"
-#include "rangecoder.h"
-#include "golomb.h"
-
-#define MAX_PLANES 4
-#define CONTEXT_SIZE 32
-
-static const int8_t quant3[256]={
- 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
--1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
--1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
--1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
--1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
--1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
--1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
--1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
--1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0,
-};
-static const int8_t quant5[256]={
- 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
--2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,
--2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,
--2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,
--2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,
--2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,
--2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,
--2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,
--2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,
-};
-static const int8_t quant7[256]={
- 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
--3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,
--3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,
--3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,
--3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,
--3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,
--3,-3,-3,-3,-3,-3,-3,-3,-3,-2,-2,-2,-2,-2,-2,-2,
--2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,
--2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,
-};
-static const int8_t quant9[256]={
- 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
--4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,
--4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,
--4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,
--4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,
--4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,
--4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,
--4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-3,-3,-3,-3,
--3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-2,-2,-2,-2,-1,-1,
-};
-static const int8_t quant11[256]={
- 0, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
--5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,
--5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,
--5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,
--5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,
--5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,
--5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-4,-4,
--4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,
--4,-4,-4,-4,-4,-3,-3,-3,-3,-3,-3,-3,-2,-2,-2,-1,
-};
-static const int8_t quant13[256]={
- 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
--6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,
--6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,
--6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,
--6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,
--6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-5,
--5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,
--5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,
--4,-4,-4,-4,-4,-4,-4,-4,-4,-3,-3,-3,-3,-2,-2,-1,
-};
-
-static const uint8_t log2_run[32]={
- 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3,
- 4, 4, 5, 5, 6, 6, 7, 7,
- 8, 9,10,11,12,13,14,15,
-};
-
-typedef struct VlcState{
- int16_t drift;
- uint16_t error_sum;
- int8_t bias;
- uint8_t count;
-} VlcState;
-
-typedef struct PlaneContext{
- int context_count;
- uint8_t (*state)[CONTEXT_SIZE];
- VlcState *vlc_state;
- uint8_t interlace_bit_state[2];
-} PlaneContext;
-
-typedef struct FFV1Context{
- AVCodecContext *avctx;
- RangeCoder c;
- GetBitContext gb;
- PutBitContext pb;
- int version;
- int width, height;
- int chroma_h_shift, chroma_v_shift;
- int flags;
- int picture_number;
- AVFrame picture;
- int plane_count;
- int ac; ///< 1-> CABAC 0-> golomb rice
- PlaneContext plane[MAX_PLANES];
- int16_t quant_table[5][256];
- int run_index;
- int colorspace;
-
- DSPContext dsp;
-}FFV1Context;
-
-static av_always_inline int fold(int diff, int bits){
- if(bits==8)
- diff= (int8_t)diff;
- else{
- diff+= 1<<(bits-1);
- diff&=(1<<bits)-1;
- diff-= 1<<(bits-1);
- }
-
- return diff;
-}
-
-static inline int predict(int_fast16_t *src, int_fast16_t *last){
- const int LT= last[-1];
- const int T= last[ 0];
- const int L = src[-1];
-
- return mid_pred(L, L + T - LT, T);
-}
-
-static inline int get_context(FFV1Context *f, int_fast16_t *src, int_fast16_t *last, int_fast16_t *last2){
- const int LT= last[-1];
- const int T= last[ 0];
- const int RT= last[ 1];
- const int L = src[-1];
-
- if(f->quant_table[3][127]){
- const int TT= last2[0];
- const int LL= src[-2];
- return f->quant_table[0][(L-LT) & 0xFF] + f->quant_table[1][(LT-T) & 0xFF] + f->quant_table[2][(T-RT) & 0xFF]
- +f->quant_table[3][(LL-L) & 0xFF] + f->quant_table[4][(TT-T) & 0xFF];
- }else
- return f->quant_table[0][(L-LT) & 0xFF] + f->quant_table[1][(LT-T) & 0xFF] + f->quant_table[2][(T-RT) & 0xFF];
-}
-
-static inline void put_symbol(RangeCoder *c, uint8_t *state, int v, int is_signed){
- int i;
-
- if(v){
- const int a= FFABS(v);
- const int e= av_log2(a);
- put_rac(c, state+0, 0);
-
- assert(e<=9);
-
- for(i=0; i<e; i++){
- put_rac(c, state+1+i, 1); //1..10
- }
- put_rac(c, state+1+i, 0);
-
- for(i=e-1; i>=0; i--){
- put_rac(c, state+22+i, (a>>i)&1); //22..31
- }
-
- if(is_signed)
- put_rac(c, state+11 + e, v < 0); //11..21
- }else{
- put_rac(c, state+0, 1);
- }
-}
-
-static inline int get_symbol(RangeCoder *c, uint8_t *state, int is_signed){
- if(get_rac(c, state+0))
- return 0;
- else{
- int i, e, a;
- e= 0;
- while(get_rac(c, state+1 + e)){ //1..10
- e++;
- }
- assert(e<=9);
-
- a= 1;
- for(i=e-1; i>=0; i--){
- a += a + get_rac(c, state+22 + i); //22..31
- }
-
- if(is_signed && get_rac(c, state+11 + e)) //11..21
- return -a;
- else
- return a;
- }
-}
-
-static inline void update_vlc_state(VlcState * const state, const int v){
- int drift= state->drift;
- int count= state->count;
- state->error_sum += FFABS(v);
- drift += v;
-
- if(count == 128){ //FIXME variable
- count >>= 1;
- drift >>= 1;
- state->error_sum >>= 1;
- }
- count++;
-
- if(drift <= -count){
- if(state->bias > -128) state->bias--;
-
- drift += count;
- if(drift <= -count)
- drift= -count + 1;
- }else if(drift > 0){
- if(state->bias < 127) state->bias++;
-
- drift -= count;
- if(drift > 0)
- drift= 0;
- }
-
- state->drift= drift;
- state->count= count;
-}
-
-static inline void put_vlc_symbol(PutBitContext *pb, VlcState * const state, int v, int bits){
- int i, k, code;
-//printf("final: %d ", v);
- v = fold(v - state->bias, bits);
-
- i= state->count;
- k=0;
- while(i < state->error_sum){ //FIXME optimize
- k++;
- i += i;
- }
-
- assert(k<=8);
-
-#if 0 // JPEG LS
- if(k==0 && 2*state->drift <= - state->count) code= v ^ (-1);
- else code= v;
-#else
- code= v ^ ((2*state->drift + state->count)>>31);
-#endif
-
-//printf("v:%d/%d bias:%d error:%d drift:%d count:%d k:%d\n", v, code, state->bias, state->error_sum, state->drift, state->count, k);
- set_sr_golomb(pb, code, k, 12, bits);
-
- update_vlc_state(state, v);
-}
-
-static inline int get_vlc_symbol(GetBitContext *gb, VlcState * const state, int bits){
- int k, i, v, ret;
-
- i= state->count;
- k=0;
- while(i < state->error_sum){ //FIXME optimize
- k++;
- i += i;
- }
-
- assert(k<=8);
-
- v= get_sr_golomb(gb, k, 12, bits);
-//printf("v:%d bias:%d error:%d drift:%d count:%d k:%d", v, state->bias, state->error_sum, state->drift, state->count, k);
-
-#if 0 // JPEG LS
- if(k==0 && 2*state->drift <= - state->count) v ^= (-1);
-#else
- v ^= ((2*state->drift + state->count)>>31);
-#endif
-
- ret= fold(v + state->bias, bits);
-
- update_vlc_state(state, v);
-//printf("final: %d\n", ret);
- return ret;
-}
-
-#ifdef CONFIG_ENCODERS
-static inline int encode_line(FFV1Context *s, int w, int_fast16_t *sample[2], int plane_index, int bits){
- PlaneContext * const p= &s->plane[plane_index];
- RangeCoder * const c= &s->c;
- int x;
- int run_index= s->run_index;
- int run_count=0;
- int run_mode=0;
-
- if(s->ac){
- if(c->bytestream_end - c->bytestream < w*20){
- av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n");
- return -1;
- }
- }else{
- if(s->pb.buf_end - s->pb.buf - (put_bits_count(&s->pb)>>3) < w*4){
- av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n");
- return -1;
- }
- }
-
- for(x=0; x<w; x++){
- int diff, context;
-
- context= get_context(s, sample[0]+x, sample[1]+x, sample[2]+x);
- diff= sample[0][x] - predict(sample[0]+x, sample[1]+x);
-
- if(context < 0){
- context = -context;
- diff= -diff;
- }
-
- diff= fold(diff, bits);
-
- if(s->ac){
- put_symbol(c, p->state[context], diff, 1);
- }else{
- if(context == 0) run_mode=1;
-
- if(run_mode){
-
- if(diff){
- while(run_count >= 1<<log2_run[run_index]){
- run_count -= 1<<log2_run[run_index];
- run_index++;
- put_bits(&s->pb, 1, 1);
- }
-
- put_bits(&s->pb, 1 + log2_run[run_index], run_count);
- if(run_index) run_index--;
- run_count=0;
- run_mode=0;
- if(diff>0) diff--;
- }else{
- run_count++;
- }
- }
-
-// printf("count:%d index:%d, mode:%d, x:%d y:%d pos:%d\n", run_count, run_index, run_mode, x, y, (int)put_bits_count(&s->pb));
-
- if(run_mode == 0)
- put_vlc_symbol(&s->pb, &p->vlc_state[context], diff, bits);
- }
- }
- if(run_mode){
- while(run_count >= 1<<log2_run[run_index]){
- run_count -= 1<<log2_run[run_index];
- run_index++;
- put_bits(&s->pb, 1, 1);
- }
-
- if(run_count)
- put_bits(&s->pb, 1, 1);
- }
- s->run_index= run_index;
-
- return 0;
-}
-
-static void encode_plane(FFV1Context *s, uint8_t *src, int w, int h, int stride, int plane_index){
- int x,y,i;
- const int ring_size= s->avctx->context_model ? 3 : 2;
- int_fast16_t sample_buffer[ring_size][w+6], *sample[ring_size];
- s->run_index=0;
-
- memset(sample_buffer, 0, sizeof(sample_buffer));
-
- for(y=0; y<h; y++){
- for(i=0; i<ring_size; i++)
- sample[i]= sample_buffer[(h+i-y)%ring_size]+3;
-
- sample[0][-1]= sample[1][0 ];
- sample[1][ w]= sample[1][w-1];
-//{START_TIMER
- for(x=0; x<w; x++){
- sample[0][x]= src[x + stride*y];
- }
- encode_line(s, w, sample, plane_index, 8);
-//STOP_TIMER("encode line")}
- }
-}
-
-static void encode_rgb_frame(FFV1Context *s, uint32_t *src, int w, int h, int stride){
- int x, y, p, i;
- const int ring_size= s->avctx->context_model ? 3 : 2;
- int_fast16_t sample_buffer[3][ring_size][w+6], *sample[3][ring_size];
- s->run_index=0;
-
- memset(sample_buffer, 0, sizeof(sample_buffer));
-
- for(y=0; y<h; y++){
- for(i=0; i<ring_size; i++)
- for(p=0; p<3; p++)
- sample[p][i]= sample_buffer[p][(h+i-y)%ring_size]+3;
-
- for(x=0; x<w; x++){
- int v= src[x + stride*y];
- int b= v&0xFF;
- int g= (v>>8)&0xFF;
- int r= (v>>16)&0xFF;
-
- b -= g;
- r -= g;
- g += (b + r)>>2;
- b += 0x100;
- r += 0x100;
-
-// assert(g>=0 && b>=0 && r>=0);
-// assert(g<256 && b<512 && r<512);
- sample[0][0][x]= g;
- sample[1][0][x]= b;
- sample[2][0][x]= r;
- }
- for(p=0; p<3; p++){
- sample[p][0][-1]= sample[p][1][0 ];
- sample[p][1][ w]= sample[p][1][w-1];
- encode_line(s, w, sample[p], FFMIN(p, 1), 9);
- }
- }
-}
-
-static void write_quant_table(RangeCoder *c, int16_t *quant_table){
- int last=0;
- int i;
- uint8_t state[CONTEXT_SIZE];
- memset(state, 128, sizeof(state));
-
- for(i=1; i<128 ; i++){
- if(quant_table[i] != quant_table[i-1]){
- put_symbol(c, state, i-last-1, 0);
- last= i;
- }
- }
- put_symbol(c, state, i-last-1, 0);
-}
-
-static void write_header(FFV1Context *f){
- uint8_t state[CONTEXT_SIZE];
- int i;
- RangeCoder * const c= &f->c;
-
- memset(state, 128, sizeof(state));
-
- put_symbol(c, state, f->version, 0);
- put_symbol(c, state, f->avctx->coder_type, 0);
- put_symbol(c, state, f->colorspace, 0); //YUV cs type
- put_rac(c, state, 1); //chroma planes
- put_symbol(c, state, f->chroma_h_shift, 0);
- put_symbol(c, state, f->chroma_v_shift, 0);
- put_rac(c, state, 0); //no transparency plane
-
- for(i=0; i<5; i++)
- write_quant_table(c, f->quant_table[i]);
-}
-#endif /* CONFIG_ENCODERS */
-
-static int common_init(AVCodecContext *avctx){
- FFV1Context *s = avctx->priv_data;
- int width, height;
-
- s->avctx= avctx;
- s->flags= avctx->flags;
-
- dsputil_init(&s->dsp, avctx);
-
- width= s->width= avctx->width;
- height= s->height= avctx->height;
-
- assert(width && height);
-
- return 0;
-}
-
-#ifdef CONFIG_ENCODERS
-static int encode_init(AVCodecContext *avctx)
-{
- FFV1Context *s = avctx->priv_data;
- int i;
-
- common_init(avctx);
-
- s->version=0;
- s->ac= avctx->coder_type;
-
- s->plane_count=2;
- for(i=0; i<256; i++){
- s->quant_table[0][i]= quant11[i];
- s->quant_table[1][i]= 11*quant11[i];
- if(avctx->context_model==0){
- s->quant_table[2][i]= 11*11*quant11[i];
- s->quant_table[3][i]=
- s->quant_table[4][i]=0;
- }else{
- s->quant_table[2][i]= 11*11*quant5 [i];
- s->quant_table[3][i]= 5*11*11*quant5 [i];
- s->quant_table[4][i]= 5*5*11*11*quant5 [i];
- }
- }
-
- for(i=0; i<s->plane_count; i++){
- PlaneContext * const p= &s->plane[i];
-
- if(avctx->context_model==0){
- p->context_count= (11*11*11+1)/2;
- }else{
- p->context_count= (11*11*5*5*5+1)/2;
- }
-
- if(s->ac){
- if(!p->state) p->state= av_malloc(CONTEXT_SIZE*p->context_count*sizeof(uint8_t));
- }else{
- if(!p->vlc_state) p->vlc_state= av_malloc(p->context_count*sizeof(VlcState));
- }
- }
-
- avctx->coded_frame= &s->picture;
- switch(avctx->pix_fmt){
- case PIX_FMT_YUV444P:
- case PIX_FMT_YUV422P:
- case PIX_FMT_YUV420P:
- case PIX_FMT_YUV411P:
- case PIX_FMT_YUV410P:
- s->colorspace= 0;
- break;
- case PIX_FMT_RGBA32:
- s->colorspace= 1;
- break;
- default:
- av_log(avctx, AV_LOG_ERROR, "format not supported\n");
- return -1;
- }
- avcodec_get_chroma_sub_sample(avctx->pix_fmt, &s->chroma_h_shift, &s->chroma_v_shift);
-
- s->picture_number=0;
-
- return 0;
-}
-#endif /* CONFIG_ENCODERS */
-
-
-static void clear_state(FFV1Context *f){
- int i, j;
-
- for(i=0; i<f->plane_count; i++){
- PlaneContext *p= &f->plane[i];
-
- p->interlace_bit_state[0]= 128;
- p->interlace_bit_state[1]= 128;
-
- for(j=0; j<p->context_count; j++){
- if(f->ac){
- memset(p->state[j], 128, sizeof(uint8_t)*CONTEXT_SIZE);
- }else{
- p->vlc_state[j].drift= 0;
- p->vlc_state[j].error_sum= 4; //FFMAX((RANGE + 32)/64, 2);
- p->vlc_state[j].bias= 0;
- p->vlc_state[j].count= 1;
- }
- }
- }
-}
-
-#ifdef CONFIG_ENCODERS
-static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){
- FFV1Context *f = avctx->priv_data;
- RangeCoder * const c= &f->c;
- AVFrame *pict = data;
- const int width= f->width;
- const int height= f->height;
- AVFrame * const p= &f->picture;
- int used_count= 0;
- uint8_t keystate=128;
-
- ff_init_range_encoder(c, buf, buf_size);
-// ff_init_cabac_states(c, ff_h264_lps_range, ff_h264_mps_state, ff_h264_lps_state, 64);
- ff_build_rac_states(c, 0.05*(1LL<<32), 256-8);
-
- *p = *pict;
- p->pict_type= FF_I_TYPE;
-
- if(avctx->gop_size==0 || f->picture_number % avctx->gop_size == 0){
- put_rac(c, &keystate, 1);
- p->key_frame= 1;
- write_header(f);
- clear_state(f);
- }else{
- put_rac(c, &keystate, 0);
- p->key_frame= 0;
- }
-
- if(!f->ac){
- used_count += ff_rac_terminate(c);
-//printf("pos=%d\n", used_count);
- init_put_bits(&f->pb, buf + used_count, buf_size - used_count);
- }
-
- if(f->colorspace==0){
- const int chroma_width = -((-width )>>f->chroma_h_shift);
- const int chroma_height= -((-height)>>f->chroma_v_shift);
-
- encode_plane(f, p->data[0], width, height, p->linesize[0], 0);
-
- encode_plane(f, p->data[1], chroma_width, chroma_height, p->linesize[1], 1);
- encode_plane(f, p->data[2], chroma_width, chroma_height, p->linesize[2], 1);
- }else{
- encode_rgb_frame(f, (uint32_t*)(p->data[0]), width, height, p->linesize[0]/4);
- }
- emms_c();
-
- f->picture_number++;
-
- if(f->ac){
- return ff_rac_terminate(c);
- }else{
- flush_put_bits(&f->pb); //nicer padding FIXME
- return used_count + (put_bits_count(&f->pb)+7)/8;
- }
-}
-#endif /* CONFIG_ENCODERS */
-
-static int common_end(AVCodecContext *avctx){
- FFV1Context *s = avctx->priv_data;
- int i;
-
- for(i=0; i<s->plane_count; i++){
- PlaneContext *p= &s->plane[i];
-
- av_freep(&p->state);
- }
-
- return 0;
-}
-
-static inline void decode_line(FFV1Context *s, int w, int_fast16_t *sample[2], int plane_index, int bits){
- PlaneContext * const p= &s->plane[plane_index];
- RangeCoder * const c= &s->c;
- int x;
- int run_count=0;
- int run_mode=0;
- int run_index= s->run_index;
-
- for(x=0; x<w; x++){
- int diff, context, sign;
-
- context= get_context(s, sample[1] + x, sample[0] + x, sample[1] + x);
- if(context < 0){
- context= -context;
- sign=1;
- }else
- sign=0;
-
-
- if(s->ac){
- diff= get_symbol(c, p->state[context], 1);
- }else{
- if(context == 0 && run_mode==0) run_mode=1;
-
- if(run_mode){
- if(run_count==0 && run_mode==1){
- if(get_bits1(&s->gb)){
- run_count = 1<<log2_run[run_index];
- if(x + run_count <= w) run_index++;
- }else{
- if(log2_run[run_index]) run_count = get_bits(&s->gb, log2_run[run_index]);
- else run_count=0;
- if(run_index) run_index--;
- run_mode=2;
- }
- }
- run_count--;
- if(run_count < 0){
- run_mode=0;
- run_count=0;
- diff= get_vlc_symbol(&s->gb, &p->vlc_state[context], bits);
- if(diff>=0) diff++;
- }else
- diff=0;
- }else
- diff= get_vlc_symbol(&s->gb, &p->vlc_state[context], bits);
-
-// printf("count:%d index:%d, mode:%d, x:%d y:%d pos:%d\n", run_count, run_index, run_mode, x, y, get_bits_count(&s->gb));
- }
-
- if(sign) diff= -diff;
-
- sample[1][x]= (predict(sample[1] + x, sample[0] + x) + diff) & ((1<<bits)-1);
- }
- s->run_index= run_index;
-}
-
-static void decode_plane(FFV1Context *s, uint8_t *src, int w, int h, int stride, int plane_index){
- int x, y;
- int_fast16_t sample_buffer[2][w+6];
- int_fast16_t *sample[2]= {sample_buffer[0]+3, sample_buffer[1]+3};
-
- s->run_index=0;
-
- memset(sample_buffer, 0, sizeof(sample_buffer));
-
- for(y=0; y<h; y++){
- int_fast16_t *temp= sample[0]; //FIXME try a normal buffer
-
- sample[0]= sample[1];
- sample[1]= temp;
-
- sample[1][-1]= sample[0][0 ];
- sample[0][ w]= sample[0][w-1];
-
-//{START_TIMER
- decode_line(s, w, sample, plane_index, 8);
- for(x=0; x<w; x++){
- src[x + stride*y]= sample[1][x];
- }
-//STOP_TIMER("decode-line")}
- }
-}
-
-static void decode_rgb_frame(FFV1Context *s, uint32_t *src, int w, int h, int stride){
- int x, y, p;
- int_fast16_t sample_buffer[3][2][w+6];
- int_fast16_t *sample[3][2]= {
- {sample_buffer[0][0]+3, sample_buffer[0][1]+3},
- {sample_buffer[1][0]+3, sample_buffer[1][1]+3},
- {sample_buffer[2][0]+3, sample_buffer[2][1]+3}};
-
- s->run_index=0;
-
- memset(sample_buffer, 0, sizeof(sample_buffer));
-
- for(y=0; y<h; y++){
- for(p=0; p<3; p++){
- int_fast16_t *temp= sample[p][0]; //FIXME try a normal buffer
-
- sample[p][0]= sample[p][1];
- sample[p][1]= temp;
-
- sample[p][1][-1]= sample[p][0][0 ];
- sample[p][0][ w]= sample[p][0][w-1];
- decode_line(s, w, sample[p], FFMIN(p, 1), 9);
- }
- for(x=0; x<w; x++){
- int g= sample[0][1][x];
- int b= sample[1][1][x];
- int r= sample[2][1][x];
-
-// assert(g>=0 && b>=0 && r>=0);
-// assert(g<256 && b<512 && r<512);
-
- b -= 0x100;
- r -= 0x100;
- g -= (b + r)>>2;
- b += g;
- r += g;
-
- src[x + stride*y]= b + (g<<8) + (r<<16);
- }
- }
-}
-
-static int read_quant_table(RangeCoder *c, int16_t *quant_table, int scale){
- int v;
- int i=0;
- uint8_t state[CONTEXT_SIZE];
-
- memset(state, 128, sizeof(state));
-
- for(v=0; i<128 ; v++){
- int len= get_symbol(c, state, 0) + 1;
-
- if(len + i > 128) return -1;
-
- while(len--){
- quant_table[i] = scale*v;
- i++;
-//printf("%2d ",v);
-//if(i%16==0) printf("\n");
- }
- }
-
- for(i=1; i<128; i++){
- quant_table[256-i]= -quant_table[i];
- }
- quant_table[128]= -quant_table[127];
-
- return 2*v - 1;
-}
-
-static int read_header(FFV1Context *f){
- uint8_t state[CONTEXT_SIZE];
- int i, context_count;
- RangeCoder * const c= &f->c;
-
- memset(state, 128, sizeof(state));
-
- f->version= get_symbol(c, state, 0);
- f->ac= f->avctx->coder_type= get_symbol(c, state, 0);
- f->colorspace= get_symbol(c, state, 0); //YUV cs type
- get_rac(c, state); //no chroma = false
- f->chroma_h_shift= get_symbol(c, state, 0);
- f->chroma_v_shift= get_symbol(c, state, 0);
- get_rac(c, state); //transparency plane
- f->plane_count= 2;
-
- if(f->colorspace==0){
- switch(16*f->chroma_h_shift + f->chroma_v_shift){
- case 0x00: f->avctx->pix_fmt= PIX_FMT_YUV444P; break;
- case 0x10: f->avctx->pix_fmt= PIX_FMT_YUV422P; break;
- case 0x11: f->avctx->pix_fmt= PIX_FMT_YUV420P; break;
- case 0x20: f->avctx->pix_fmt= PIX_FMT_YUV411P; break;
- case 0x22: f->avctx->pix_fmt= PIX_FMT_YUV410P; break;
- default:
- av_log(f->avctx, AV_LOG_ERROR, "format not supported\n");
- return -1;
- }
- }else if(f->colorspace==1){
- if(f->chroma_h_shift || f->chroma_v_shift){
- av_log(f->avctx, AV_LOG_ERROR, "chroma subsampling not supported in this colorspace\n");
- return -1;
- }
- f->avctx->pix_fmt= PIX_FMT_RGBA32;
- }else{
- av_log(f->avctx, AV_LOG_ERROR, "colorspace not supported\n");
- return -1;
- }
-
-//printf("%d %d %d\n", f->chroma_h_shift, f->chroma_v_shift,f->avctx->pix_fmt);
-
- context_count=1;
- for(i=0; i<5; i++){
- context_count*= read_quant_table(c, f->quant_table[i], context_count);
- if(context_count < 0 || context_count > 32768){
- av_log(f->avctx, AV_LOG_ERROR, "read_quant_table error\n");
- return -1;
- }
- }
- context_count= (context_count+1)/2;
-
- for(i=0; i<f->plane_count; i++){
- PlaneContext * const p= &f->plane[i];
-
- p->context_count= context_count;
-
- if(f->ac){
- if(!p->state) p->state= av_malloc(CONTEXT_SIZE*p->context_count*sizeof(uint8_t));
- }else{
- if(!p->vlc_state) p->vlc_state= av_malloc(p->context_count*sizeof(VlcState));
- }
- }
-
- return 0;
-}
-
-static int decode_init(AVCodecContext *avctx)
-{
-// FFV1Context *s = avctx->priv_data;
-
- common_init(avctx);
-
- return 0;
-}
-
-static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size){
- FFV1Context *f = avctx->priv_data;
- RangeCoder * const c= &f->c;
- const int width= f->width;
- const int height= f->height;
- AVFrame * const p= &f->picture;
- int bytes_read;
- uint8_t keystate= 128;
-
- AVFrame *picture = data;
-
- ff_init_range_decoder(c, buf, buf_size);
- ff_build_rac_states(c, 0.05*(1LL<<32), 256-8);
-
-
- p->pict_type= FF_I_TYPE; //FIXME I vs. P
- if(get_rac(c, &keystate)){
- p->key_frame= 1;
- if(read_header(f) < 0)
- return -1;
- clear_state(f);
- }else{
- p->key_frame= 0;
- }
- if(!f->plane[0].state && !f->plane[0].vlc_state)
- return -1;
-
- p->reference= 0;
- if(avctx->get_buffer(avctx, p) < 0){
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
-
- if(avctx->debug&FF_DEBUG_PICT_INFO)
- av_log(avctx, AV_LOG_ERROR, "keyframe:%d coder:%d\n", p->key_frame, f->ac);
-
- if(!f->ac){
- bytes_read = c->bytestream - c->bytestream_start - 1;
- if(bytes_read ==0) av_log(avctx, AV_LOG_ERROR, "error at end of AC stream\n"); //FIXME
-//printf("pos=%d\n", bytes_read);
- init_get_bits(&f->gb, buf + bytes_read, buf_size - bytes_read);
- } else {
- bytes_read = 0; /* avoid warning */
- }
-
- if(f->colorspace==0){
- const int chroma_width = -((-width )>>f->chroma_h_shift);
- const int chroma_height= -((-height)>>f->chroma_v_shift);
- decode_plane(f, p->data[0], width, height, p->linesize[0], 0);
-
- decode_plane(f, p->data[1], chroma_width, chroma_height, p->linesize[1], 1);
- decode_plane(f, p->data[2], chroma_width, chroma_height, p->linesize[2], 1);
- }else{
- decode_rgb_frame(f, (uint32_t*)p->data[0], width, height, p->linesize[0]/4);
- }
-
- emms_c();
-
- f->picture_number++;
-
- *picture= *p;
-
- avctx->release_buffer(avctx, p); //FIXME
-
- *data_size = sizeof(AVFrame);
-
- if(f->ac){
- bytes_read= c->bytestream - c->bytestream_start - 1;
- if(bytes_read ==0) av_log(f->avctx, AV_LOG_ERROR, "error at end of frame\n");
- }else{
- bytes_read+= (get_bits_count(&f->gb)+7)/8;
- }
-
- return bytes_read;
-}
-
-AVCodec ffv1_decoder = {
- "ffv1",
- CODEC_TYPE_VIDEO,
- CODEC_ID_FFV1,
- sizeof(FFV1Context),
- decode_init,
- NULL,
- common_end,
- decode_frame,
- CODEC_CAP_DR1 /*| CODEC_CAP_DRAW_HORIZ_BAND*/,
- NULL
-};
-
-#ifdef CONFIG_ENCODERS
-AVCodec ffv1_encoder = {
- "ffv1",
- CODEC_TYPE_VIDEO,
- CODEC_ID_FFV1,
- sizeof(FFV1Context),
- encode_init,
- encode_frame,
- common_end,
- .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_YUV444P, PIX_FMT_YUV422P, PIX_FMT_YUV411P, PIX_FMT_YUV410P, PIX_FMT_RGBA32, -1},
-};
-#endif
diff --git a/src/libffmpeg/libavcodec/flac.c b/src/libffmpeg/libavcodec/flac.c
deleted file mode 100644
index 1016ed47f..000000000
--- a/src/libffmpeg/libavcodec/flac.c
+++ /dev/null
@@ -1,762 +0,0 @@
-/*
- * FLAC (Free Lossless Audio Codec) decoder
- * Copyright (c) 2003 Alex Beregszaszi
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file flac.c
- * FLAC (Free Lossless Audio Codec) decoder
- * @author Alex Beregszaszi
- *
- * For more information on the FLAC format, visit:
- * http://flac.sourceforge.net/
- *
- * This decoder can be used in 1 of 2 ways: Either raw FLAC data can be fed
- * through, starting from the initial 'fLaC' signature; or by passing the
- * 34-byte streaminfo structure through avctx->extradata[_size] followed
- * by data starting with the 0xFFF8 marker.
- */
-
-#include <limits.h>
-
-#define ALT_BITSTREAM_READER
-#include "avcodec.h"
-#include "bitstream.h"
-#include "golomb.h"
-#include "crc.h"
-
-#undef NDEBUG
-#include <assert.h>
-
-#define MAX_CHANNELS 8
-#define MAX_BLOCKSIZE 65535
-#define FLAC_STREAMINFO_SIZE 34
-
-enum decorrelation_type {
- INDEPENDENT,
- LEFT_SIDE,
- RIGHT_SIDE,
- MID_SIDE,
-};
-
-typedef struct FLACContext {
- AVCodecContext *avctx;
- GetBitContext gb;
-
- int min_blocksize, max_blocksize;
- int min_framesize, max_framesize;
- int samplerate, channels;
- int blocksize/*, last_blocksize*/;
- int bps, curr_bps;
- enum decorrelation_type decorrelation;
-
- int32_t *decoded[MAX_CHANNELS];
- uint8_t *bitstream;
- int bitstream_size;
- int bitstream_index;
- unsigned int allocated_bitstream_size;
-} FLACContext;
-
-#define METADATA_TYPE_STREAMINFO 0
-
-static int sample_rate_table[] =
-{ 0, 0, 0, 0,
- 8000, 16000, 22050, 24000, 32000, 44100, 48000, 96000,
- 0, 0, 0, 0 };
-
-static int sample_size_table[] =
-{ 0, 8, 12, 0, 16, 20, 24, 0 };
-
-static int blocksize_table[] = {
- 0, 192, 576<<0, 576<<1, 576<<2, 576<<3, 0, 0,
-256<<0, 256<<1, 256<<2, 256<<3, 256<<4, 256<<5, 256<<6, 256<<7
-};
-
-static int64_t get_utf8(GetBitContext *gb){
- int64_t val;
- GET_UTF8(val, get_bits(gb, 8), return -1;)
- return val;
-}
-
-static void metadata_streaminfo(FLACContext *s);
-static void allocate_buffers(FLACContext *s);
-static int metadata_parse(FLACContext *s);
-
-static int flac_decode_init(AVCodecContext * avctx)
-{
- FLACContext *s = avctx->priv_data;
- s->avctx = avctx;
-
- if (avctx->extradata_size > 4) {
- /* initialize based on the demuxer-supplied streamdata header */
- init_get_bits(&s->gb, avctx->extradata, avctx->extradata_size*8);
- if (avctx->extradata_size == FLAC_STREAMINFO_SIZE) {
- metadata_streaminfo(s);
- allocate_buffers(s);
- } else {
- metadata_parse(s);
- }
- }
-
- return 0;
-}
-
-static void dump_headers(FLACContext *s)
-{
- av_log(s->avctx, AV_LOG_DEBUG, " Blocksize: %d .. %d (%d)\n", s->min_blocksize, s->max_blocksize, s->blocksize);
- av_log(s->avctx, AV_LOG_DEBUG, " Framesize: %d .. %d\n", s->min_framesize, s->max_framesize);
- av_log(s->avctx, AV_LOG_DEBUG, " Samplerate: %d\n", s->samplerate);
- av_log(s->avctx, AV_LOG_DEBUG, " Channels: %d\n", s->channels);
- av_log(s->avctx, AV_LOG_DEBUG, " Bits: %d\n", s->bps);
-}
-
-static void allocate_buffers(FLACContext *s){
- int i;
-
- assert(s->max_blocksize);
-
- if(s->max_framesize == 0 && s->max_blocksize){
- s->max_framesize= (s->channels * s->bps * s->max_blocksize + 7)/ 8; //FIXME header overhead
- }
-
- for (i = 0; i < s->channels; i++)
- {
- s->decoded[i] = av_realloc(s->decoded[i], sizeof(int32_t)*s->max_blocksize);
- }
-
- s->bitstream= av_fast_realloc(s->bitstream, &s->allocated_bitstream_size, s->max_framesize);
-}
-
-static void metadata_streaminfo(FLACContext *s)
-{
- /* mandatory streaminfo */
- s->min_blocksize = get_bits(&s->gb, 16);
- s->max_blocksize = get_bits(&s->gb, 16);
-
- s->min_framesize = get_bits_long(&s->gb, 24);
- s->max_framesize = get_bits_long(&s->gb, 24);
-
- s->samplerate = get_bits_long(&s->gb, 20);
- s->channels = get_bits(&s->gb, 3) + 1;
- s->bps = get_bits(&s->gb, 5) + 1;
-
- s->avctx->channels = s->channels;
- s->avctx->sample_rate = s->samplerate;
-
- skip_bits(&s->gb, 36); /* total num of samples */
-
- skip_bits(&s->gb, 64); /* md5 sum */
- skip_bits(&s->gb, 64); /* md5 sum */
-
- dump_headers(s);
-}
-
-/**
- * Parse a list of metadata blocks. This list of blocks must begin with
- * the fLaC marker.
- * @param s the flac decoding context containing the gb bit reader used to
- * parse metadata
- * @return 1 if some metadata was read, 0 if no fLaC marker was found
- */
-static int metadata_parse(FLACContext *s)
-{
- int i, metadata_last, metadata_type, metadata_size, streaminfo_updated=0;
-
- if (show_bits_long(&s->gb, 32) == MKBETAG('f','L','a','C')) {
- skip_bits(&s->gb, 32);
-
- av_log(s->avctx, AV_LOG_DEBUG, "STREAM HEADER\n");
- do {
- metadata_last = get_bits(&s->gb, 1);
- metadata_type = get_bits(&s->gb, 7);
- metadata_size = get_bits_long(&s->gb, 24);
-
- av_log(s->avctx, AV_LOG_DEBUG,
- " metadata block: flag = %d, type = %d, size = %d\n",
- metadata_last, metadata_type, metadata_size);
- if (metadata_size) {
- switch (metadata_type) {
- case METADATA_TYPE_STREAMINFO:
- metadata_streaminfo(s);
- streaminfo_updated = 1;
- break;
-
- default:
- for (i=0; i<metadata_size; i++)
- skip_bits(&s->gb, 8);
- }
- }
- } while (!metadata_last);
-
- if (streaminfo_updated)
- allocate_buffers(s);
- return 1;
- }
- return 0;
-}
-
-static int decode_residuals(FLACContext *s, int channel, int pred_order)
-{
- int i, tmp, partition, method_type, rice_order;
- int sample = 0, samples;
-
- method_type = get_bits(&s->gb, 2);
- if (method_type != 0){
- av_log(s->avctx, AV_LOG_DEBUG, "illegal residual coding method %d\n", method_type);
- return -1;
- }
-
- rice_order = get_bits(&s->gb, 4);
-
- samples= s->blocksize >> rice_order;
- if (pred_order > samples) {
- av_log(s->avctx, AV_LOG_ERROR, "invalid predictor order: %i > %i\n", pred_order, samples);
- return -1;
- }
-
- sample=
- i= pred_order;
- for (partition = 0; partition < (1 << rice_order); partition++)
- {
- tmp = get_bits(&s->gb, 4);
- if (tmp == 15)
- {
- av_log(s->avctx, AV_LOG_DEBUG, "fixed len partition\n");
- tmp = get_bits(&s->gb, 5);
- for (; i < samples; i++, sample++)
- s->decoded[channel][sample] = get_sbits(&s->gb, tmp);
- }
- else
- {
-// av_log(s->avctx, AV_LOG_DEBUG, "rice coded partition k=%d\n", tmp);
- for (; i < samples; i++, sample++){
- s->decoded[channel][sample] = get_sr_golomb_flac(&s->gb, tmp, INT_MAX, 0);
- }
- }
- i= 0;
- }
-
-// av_log(s->avctx, AV_LOG_DEBUG, "partitions: %d, samples: %d\n", 1 << rice_order, sample);
-
- return 0;
-}
-
-static int decode_subframe_fixed(FLACContext *s, int channel, int pred_order)
-{
- int i;
-
-// av_log(s->avctx, AV_LOG_DEBUG, " SUBFRAME FIXED\n");
-
- /* warm up samples */
-// av_log(s->avctx, AV_LOG_DEBUG, " warm up samples: %d\n", pred_order);
-
- for (i = 0; i < pred_order; i++)
- {
- s->decoded[channel][i] = get_sbits(&s->gb, s->curr_bps);
-// av_log(s->avctx, AV_LOG_DEBUG, " %d: %d\n", i, s->decoded[channel][i]);
- }
-
- if (decode_residuals(s, channel, pred_order) < 0)
- return -1;
-
- switch(pred_order)
- {
- case 0:
- break;
- case 1:
- for (i = pred_order; i < s->blocksize; i++)
- s->decoded[channel][i] += s->decoded[channel][i-1];
- break;
- case 2:
- for (i = pred_order; i < s->blocksize; i++)
- s->decoded[channel][i] += 2*s->decoded[channel][i-1]
- - s->decoded[channel][i-2];
- break;
- case 3:
- for (i = pred_order; i < s->blocksize; i++)
- s->decoded[channel][i] += 3*s->decoded[channel][i-1]
- - 3*s->decoded[channel][i-2]
- + s->decoded[channel][i-3];
- break;
- case 4:
- for (i = pred_order; i < s->blocksize; i++)
- s->decoded[channel][i] += 4*s->decoded[channel][i-1]
- - 6*s->decoded[channel][i-2]
- + 4*s->decoded[channel][i-3]
- - s->decoded[channel][i-4];
- break;
- default:
- av_log(s->avctx, AV_LOG_ERROR, "illegal pred order %d\n", pred_order);
- return -1;
- }
-
- return 0;
-}
-
-static int decode_subframe_lpc(FLACContext *s, int channel, int pred_order)
-{
- int i, j;
- int coeff_prec, qlevel;
- int coeffs[pred_order];
-
-// av_log(s->avctx, AV_LOG_DEBUG, " SUBFRAME LPC\n");
-
- /* warm up samples */
-// av_log(s->avctx, AV_LOG_DEBUG, " warm up samples: %d\n", pred_order);
-
- for (i = 0; i < pred_order; i++)
- {
- s->decoded[channel][i] = get_sbits(&s->gb, s->curr_bps);
-// av_log(s->avctx, AV_LOG_DEBUG, " %d: %d\n", i, s->decoded[channel][i]);
- }
-
- coeff_prec = get_bits(&s->gb, 4) + 1;
- if (coeff_prec == 16)
- {
- av_log(s->avctx, AV_LOG_DEBUG, "invalid coeff precision\n");
- return -1;
- }
-// av_log(s->avctx, AV_LOG_DEBUG, " qlp coeff prec: %d\n", coeff_prec);
- qlevel = get_sbits(&s->gb, 5);
-// av_log(s->avctx, AV_LOG_DEBUG, " quant level: %d\n", qlevel);
- if(qlevel < 0){
- av_log(s->avctx, AV_LOG_DEBUG, "qlevel %d not supported, maybe buggy stream\n", qlevel);
- return -1;
- }
-
- for (i = 0; i < pred_order; i++)
- {
- coeffs[i] = get_sbits(&s->gb, coeff_prec);
-// av_log(s->avctx, AV_LOG_DEBUG, " %d: %d\n", i, coeffs[i]);
- }
-
- if (decode_residuals(s, channel, pred_order) < 0)
- return -1;
-
- if (s->bps > 16) {
- int64_t sum;
- for (i = pred_order; i < s->blocksize; i++)
- {
- sum = 0;
- for (j = 0; j < pred_order; j++)
- sum += (int64_t)coeffs[j] * s->decoded[channel][i-j-1];
- s->decoded[channel][i] += sum >> qlevel;
- }
- } else {
- int sum;
- for (i = pred_order; i < s->blocksize; i++)
- {
- sum = 0;
- for (j = 0; j < pred_order; j++)
- sum += coeffs[j] * s->decoded[channel][i-j-1];
- s->decoded[channel][i] += sum >> qlevel;
- }
- }
-
- return 0;
-}
-
-static inline int decode_subframe(FLACContext *s, int channel)
-{
- int type, wasted = 0;
- int i, tmp;
-
- s->curr_bps = s->bps;
- if(channel == 0){
- if(s->decorrelation == RIGHT_SIDE)
- s->curr_bps++;
- }else{
- if(s->decorrelation == LEFT_SIDE || s->decorrelation == MID_SIDE)
- s->curr_bps++;
- }
-
- if (get_bits1(&s->gb))
- {
- av_log(s->avctx, AV_LOG_ERROR, "invalid subframe padding\n");
- return -1;
- }
- type = get_bits(&s->gb, 6);
-// wasted = get_bits1(&s->gb);
-
-// if (wasted)
-// {
-// while (!get_bits1(&s->gb))
-// wasted++;
-// if (wasted)
-// wasted++;
-// s->curr_bps -= wasted;
-// }
-#if 0
- wasted= 16 - av_log2(show_bits(&s->gb, 17));
- skip_bits(&s->gb, wasted+1);
- s->curr_bps -= wasted;
-#else
- if (get_bits1(&s->gb))
- {
- wasted = 1;
- while (!get_bits1(&s->gb))
- wasted++;
- s->curr_bps -= wasted;
- av_log(s->avctx, AV_LOG_DEBUG, "%d wasted bits\n", wasted);
- }
-#endif
-//FIXME use av_log2 for types
- if (type == 0)
- {
- av_log(s->avctx, AV_LOG_DEBUG, "coding type: constant\n");
- tmp = get_sbits(&s->gb, s->curr_bps);
- for (i = 0; i < s->blocksize; i++)
- s->decoded[channel][i] = tmp;
- }
- else if (type == 1)
- {
- av_log(s->avctx, AV_LOG_DEBUG, "coding type: verbatim\n");
- for (i = 0; i < s->blocksize; i++)
- s->decoded[channel][i] = get_sbits(&s->gb, s->curr_bps);
- }
- else if ((type >= 8) && (type <= 12))
- {
-// av_log(s->avctx, AV_LOG_DEBUG, "coding type: fixed\n");
- if (decode_subframe_fixed(s, channel, type & ~0x8) < 0)
- return -1;
- }
- else if (type >= 32)
- {
-// av_log(s->avctx, AV_LOG_DEBUG, "coding type: lpc\n");
- if (decode_subframe_lpc(s, channel, (type & ~0x20)+1) < 0)
- return -1;
- }
- else
- {
- av_log(s->avctx, AV_LOG_ERROR, "invalid coding type\n");
- return -1;
- }
-
- if (wasted)
- {
- int i;
- for (i = 0; i < s->blocksize; i++)
- s->decoded[channel][i] <<= wasted;
- }
-
- return 0;
-}
-
-static int decode_frame(FLACContext *s, int alloc_data_size)
-{
- int blocksize_code, sample_rate_code, sample_size_code, assignment, i, crc8;
- int decorrelation, bps, blocksize, samplerate;
-
- blocksize_code = get_bits(&s->gb, 4);
-
- sample_rate_code = get_bits(&s->gb, 4);
-
- assignment = get_bits(&s->gb, 4); /* channel assignment */
- if (assignment < 8 && s->channels == assignment+1)
- decorrelation = INDEPENDENT;
- else if (assignment >=8 && assignment < 11 && s->channels == 2)
- decorrelation = LEFT_SIDE + assignment - 8;
- else
- {
- av_log(s->avctx, AV_LOG_ERROR, "unsupported channel assignment %d (channels=%d)\n", assignment, s->channels);
- return -1;
- }
-
- sample_size_code = get_bits(&s->gb, 3);
- if(sample_size_code == 0)
- bps= s->bps;
- else if((sample_size_code != 3) && (sample_size_code != 7))
- bps = sample_size_table[sample_size_code];
- else
- {
- av_log(s->avctx, AV_LOG_ERROR, "invalid sample size code (%d)\n", sample_size_code);
- return -1;
- }
-
- if (get_bits1(&s->gb))
- {
- av_log(s->avctx, AV_LOG_ERROR, "broken stream, invalid padding\n");
- return -1;
- }
-
- if(get_utf8(&s->gb) < 0){
- av_log(s->avctx, AV_LOG_ERROR, "utf8 fscked\n");
- return -1;
- }
-#if 0
- if (/*((blocksize_code == 6) || (blocksize_code == 7)) &&*/
- (s->min_blocksize != s->max_blocksize)){
- }else{
- }
-#endif
-
- if (blocksize_code == 0)
- blocksize = s->min_blocksize;
- else if (blocksize_code == 6)
- blocksize = get_bits(&s->gb, 8)+1;
- else if (blocksize_code == 7)
- blocksize = get_bits(&s->gb, 16)+1;
- else
- blocksize = blocksize_table[blocksize_code];
-
- if(blocksize > s->max_blocksize){
- av_log(s->avctx, AV_LOG_ERROR, "blocksize %d > %d\n", blocksize, s->max_blocksize);
- return -1;
- }
-
- if(blocksize * s->channels * sizeof(int16_t) > alloc_data_size)
- return -1;
-
- if (sample_rate_code == 0){
- samplerate= s->samplerate;
- }else if ((sample_rate_code > 3) && (sample_rate_code < 12))
- samplerate = sample_rate_table[sample_rate_code];
- else if (sample_rate_code == 12)
- samplerate = get_bits(&s->gb, 8) * 1000;
- else if (sample_rate_code == 13)
- samplerate = get_bits(&s->gb, 16);
- else if (sample_rate_code == 14)
- samplerate = get_bits(&s->gb, 16) * 10;
- else{
- av_log(s->avctx, AV_LOG_ERROR, "illegal sample rate code %d\n", sample_rate_code);
- return -1;
- }
-
- skip_bits(&s->gb, 8);
- crc8= av_crc(av_crc07, 0, s->gb.buffer, get_bits_count(&s->gb)/8);
- if(crc8){
- av_log(s->avctx, AV_LOG_ERROR, "header crc mismatch crc=%2X\n", crc8);
- return -1;
- }
-
- s->blocksize = blocksize;
- s->samplerate = samplerate;
- s->bps = bps;
- s->decorrelation= decorrelation;
-
-// dump_headers(s);
-
- /* subframes */
- for (i = 0; i < s->channels; i++)
- {
-// av_log(s->avctx, AV_LOG_DEBUG, "decoded: %x residual: %x\n", s->decoded[i], s->residual[i]);
- if (decode_subframe(s, i) < 0)
- return -1;
- }
-
- align_get_bits(&s->gb);
-
- /* frame footer */
- skip_bits(&s->gb, 16); /* data crc */
-
- return 0;
-}
-
-static inline int16_t shift_to_16_bits(int32_t data, int bps)
-{
- if (bps == 24) {
- return (data >> 8);
- } else if (bps == 20) {
- return (data >> 4);
- } else {
- return data;
- }
-}
-
-static int flac_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- FLACContext *s = avctx->priv_data;
- int tmp = 0, i, j = 0, input_buf_size = 0;
- int16_t *samples = data;
- int alloc_data_size= *data_size;
-
- *data_size=0;
-
- if(s->max_framesize == 0){
- s->max_framesize= 65536; // should hopefully be enough for the first header
- s->bitstream= av_fast_realloc(s->bitstream, &s->allocated_bitstream_size, s->max_framesize);
- }
-
- if(1 && s->max_framesize){//FIXME truncated
- buf_size= FFMAX(FFMIN(buf_size, s->max_framesize - s->bitstream_size), 0);
- input_buf_size= buf_size;
-
- if(s->bitstream_index + s->bitstream_size + buf_size > s->allocated_bitstream_size){
-// printf("memmove\n");
- memmove(s->bitstream, &s->bitstream[s->bitstream_index], s->bitstream_size);
- s->bitstream_index=0;
- }
- memcpy(&s->bitstream[s->bitstream_index + s->bitstream_size], buf, buf_size);
- buf= &s->bitstream[s->bitstream_index];
- buf_size += s->bitstream_size;
- s->bitstream_size= buf_size;
-
- if(buf_size < s->max_framesize){
-// printf("wanna more data ...\n");
- return input_buf_size;
- }
- }
-
- init_get_bits(&s->gb, buf, buf_size*8);
-
- if (!metadata_parse(s))
- {
- tmp = show_bits(&s->gb, 16);
- if(tmp != 0xFFF8){
- av_log(s->avctx, AV_LOG_ERROR, "FRAME HEADER not here\n");
- while(get_bits_count(&s->gb)/8+2 < buf_size && show_bits(&s->gb, 16) != 0xFFF8)
- skip_bits(&s->gb, 8);
- goto end; // we may not have enough bits left to decode a frame, so try next time
- }
- skip_bits(&s->gb, 16);
- if (decode_frame(s, alloc_data_size) < 0){
- av_log(s->avctx, AV_LOG_ERROR, "decode_frame() failed\n");
- s->bitstream_size=0;
- s->bitstream_index=0;
- return -1;
- }
- }
-
-
-#if 0
- /* fix the channel order here */
- if (s->order == MID_SIDE)
- {
- short *left = samples;
- short *right = samples + s->blocksize;
- for (i = 0; i < s->blocksize; i += 2)
- {
- uint32_t x = s->decoded[0][i];
- uint32_t y = s->decoded[0][i+1];
-
- right[i] = x - (y / 2);
- left[i] = right[i] + y;
- }
- *data_size = 2 * s->blocksize;
- }
- else
- {
- for (i = 0; i < s->channels; i++)
- {
- switch(s->order)
- {
- case INDEPENDENT:
- for (j = 0; j < s->blocksize; j++)
- samples[(s->blocksize*i)+j] = s->decoded[i][j];
- break;
- case LEFT_SIDE:
- case RIGHT_SIDE:
- if (i == 0)
- for (j = 0; j < s->blocksize; j++)
- samples[(s->blocksize*i)+j] = s->decoded[0][j];
- else
- for (j = 0; j < s->blocksize; j++)
- samples[(s->blocksize*i)+j] = s->decoded[0][j] - s->decoded[i][j];
- break;
-// case MID_SIDE:
-// av_log(s->avctx, AV_LOG_DEBUG, "mid-side unsupported\n");
- }
- *data_size += s->blocksize;
- }
- }
-#else
-#define DECORRELATE(left, right)\
- assert(s->channels == 2);\
- for (i = 0; i < s->blocksize; i++)\
- {\
- int a= s->decoded[0][i];\
- int b= s->decoded[1][i];\
- *(samples++) = (left ) >> (16 - s->bps);\
- *(samples++) = (right) >> (16 - s->bps);\
- }\
- break;
-
- switch(s->decorrelation)
- {
- case INDEPENDENT:
- for (j = 0; j < s->blocksize; j++)
- {
- for (i = 0; i < s->channels; i++)
- *(samples++) = shift_to_16_bits(s->decoded[i][j], s->bps);
- }
- break;
- case LEFT_SIDE:
- DECORRELATE(a,a-b)
- case RIGHT_SIDE:
- DECORRELATE(a+b,b)
- case MID_SIDE:
- DECORRELATE( (a-=b>>1) + b, a)
- }
-#endif
-
- *data_size = (int8_t *)samples - (int8_t *)data;
-// av_log(s->avctx, AV_LOG_DEBUG, "data size: %d\n", *data_size);
-
-// s->last_blocksize = s->blocksize;
-end:
- i= (get_bits_count(&s->gb)+7)/8;;
- if(i > buf_size){
- av_log(s->avctx, AV_LOG_ERROR, "overread: %d\n", i - buf_size);
- s->bitstream_size=0;
- s->bitstream_index=0;
- return -1;
- }
-
- if(s->bitstream_size){
- s->bitstream_index += i;
- s->bitstream_size -= i;
- return input_buf_size;
- }else
- return i;
-}
-
-static int flac_decode_close(AVCodecContext *avctx)
-{
- FLACContext *s = avctx->priv_data;
- int i;
-
- for (i = 0; i < s->channels; i++)
- {
- av_freep(&s->decoded[i]);
- }
- av_freep(&s->bitstream);
-
- return 0;
-}
-
-static void flac_flush(AVCodecContext *avctx){
- FLACContext *s = avctx->priv_data;
-
- s->bitstream_size=
- s->bitstream_index= 0;
-}
-
-AVCodec flac_decoder = {
- "flac",
- CODEC_TYPE_AUDIO,
- CODEC_ID_FLAC,
- sizeof(FLACContext),
- flac_decode_init,
- NULL,
- flac_decode_close,
- flac_decode_frame,
- .flush= flac_flush,
-};
diff --git a/src/libffmpeg/libavcodec/flashsv.c b/src/libffmpeg/libavcodec/flashsv.c
deleted file mode 100644
index 9e4aa951a..000000000
--- a/src/libffmpeg/libavcodec/flashsv.c
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
- * Flash Screen Video decoder
- * Copyright (C) 2004 Alex Beregszaszi
- * Copyright (C) 2006 Benjamin Larsson
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file flashsv.c
- * Flash Screen Video decoder
- * @author Alex Beregszaszi
- * @author Benjamin Larsson
- */
-
-/* Bitstream description
- * The picture is divided into blocks that are zlib compressed.
- *
- * The decoder is fed complete frames, the frameheader contains:
- * 4bits of block width
- * 12bits of frame width
- * 4bits of block height
- * 12bits of frame height
- *
- * Directly after the header are the compressed blocks. The blocks
- * have their compressed size represented with 16bits in the beginnig.
- * If the size = 0 then the block is unchanged from the previous frame.
- * All blocks are decompressed until the buffer is consumed.
- *
- * Encoding ideas, a basic encoder would just use a fixed block size.
- * Block sizes can be multipels of 16, from 16 to 256. The blocks don't
- * have to be quadratic. A brute force search with a set of diffrent
- * block sizes should give a better result then to just use a fixed size.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "common.h"
-#include "avcodec.h"
-#include "bitstream.h"
-
-#include <zlib.h>
-
-typedef struct FlashSVContext {
- AVCodecContext *avctx;
- AVFrame frame;
- int image_width, image_height;
- int block_width, block_height;
- uint8_t* tmpblock;
- int block_size;
- z_stream zstream;
-} FlashSVContext;
-
-
-static void copy_region(uint8_t *sptr, uint8_t *dptr,
- int dx, int dy, int h, int w, int stride)
-{
- int i;
-
- for (i = dx+h; i > dx; i--)
- {
- memcpy(dptr+(i*stride)+dy*3, sptr, w*3);
- sptr += w*3;
- }
-}
-
-
-static int flashsv_decode_init(AVCodecContext *avctx)
-{
- FlashSVContext *s = (FlashSVContext *)avctx->priv_data;
- int zret; // Zlib return code
-
- s->avctx = avctx;
- s->zstream.zalloc = Z_NULL;
- s->zstream.zfree = Z_NULL;
- s->zstream.opaque = Z_NULL;
- zret = inflateInit(&(s->zstream));
- if (zret != Z_OK) {
- av_log(avctx, AV_LOG_ERROR, "Inflate init error: %d\n", zret);
- return 1;
- }
- avctx->pix_fmt = PIX_FMT_BGR24;
- avctx->has_b_frames = 0;
- s->frame.data[0] = NULL;
-
- return 0;
-}
-
-
-static int flashsv_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- FlashSVContext *s = (FlashSVContext *)avctx->priv_data;
- int h_blocks, v_blocks, h_part, v_part, i, j;
- GetBitContext gb;
-
- /* no supplementary picture */
- if (buf_size == 0)
- return 0;
-
- if(s->frame.data[0])
- avctx->release_buffer(avctx, &s->frame);
-
- init_get_bits(&gb, buf, buf_size * 8);
-
- /* start to parse the bitstream */
- s->block_width = 16* (get_bits(&gb, 4)+1);
- s->image_width = get_bits(&gb,12);
- s->block_height= 16* (get_bits(&gb, 4)+1);
- s->image_height= get_bits(&gb,12);
-
- /* calculate amount of blocks and the size of the border blocks */
- h_blocks = s->image_width / s->block_width;
- h_part = s->image_width % s->block_width;
- v_blocks = s->image_height / s->block_height;
- v_part = s->image_height % s->block_height;
-
- /* the block size could change between frames, make sure the buffer
- * is large enough, if not, get a larger one */
- if(s->block_size < s->block_width*s->block_height) {
- if (s->tmpblock != NULL)
- av_free(s->tmpblock);
- if ((s->tmpblock = av_malloc(3*s->block_width*s->block_height)) == NULL) {
- av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n");
- return -1;
- }
- }
- s->block_size = s->block_width*s->block_height;
-
- /* init the image size once */
- if((avctx->width==0) && (avctx->height==0)){
- avctx->width = s->image_width;
- avctx->height = s->image_height;
- }
-
- /* check for changes of image width and image height */
- if ((avctx->width != s->image_width) || (avctx->height != s->image_height)) {
- av_log(avctx, AV_LOG_ERROR, "Frame width or height differs from first frames!\n");
- av_log(avctx, AV_LOG_ERROR, "fh = %d, fv %d vs ch = %d, cv = %d\n",avctx->height,
- avctx->width,s->image_height,s->image_width);
- return -1;
- }
-
- av_log(avctx, AV_LOG_DEBUG, "image: %dx%d block: %dx%d num: %dx%d part: %dx%d\n",
- s->image_width, s->image_height, s->block_width, s->block_height,
- h_blocks, v_blocks, h_part, v_part);
-
- s->frame.reference = 1;
- s->frame.buffer_hints = FF_BUFFER_HINTS_VALID;
- if (avctx->get_buffer(avctx, &s->frame) < 0) {
- av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
-
- /* loop over all block columns */
- for (j = 0; j < v_blocks + (v_part?1:0); j++)
- {
-
- int hp = j*s->block_height; // horiz position in frame
- int hs = (j<v_blocks)?s->block_height:v_part; // size of block
-
-
- /* loop over all block rows */
- for (i = 0; i < h_blocks + (h_part?1:0); i++)
- {
- int wp = i*s->block_width; // vert position in frame
- int ws = (i<h_blocks)?s->block_width:h_part; // size of block
-
- /* get the size of the compressed zlib chunk */
- int size = get_bits(&gb, 16);
-
- if (size == 0) {
- /* no change, don't do anything */
- } else {
- /* decompress block */
- int ret = inflateReset(&(s->zstream));
- if (ret != Z_OK)
- {
- av_log(avctx, AV_LOG_ERROR, "error in decompression (reset) of block %dx%d\n", i, j);
- /* return -1; */
- }
- s->zstream.next_in = buf+(get_bits_count(&gb)/8);
- s->zstream.avail_in = size;
- s->zstream.next_out = s->tmpblock;
- s->zstream.avail_out = s->block_size*3;
- ret = inflate(&(s->zstream), Z_FINISH);
- if (ret == Z_DATA_ERROR)
- {
- av_log(avctx, AV_LOG_ERROR, "Zlib resync occured\n");
- inflateSync(&(s->zstream));
- ret = inflate(&(s->zstream), Z_FINISH);
- }
-
- if ((ret != Z_OK) && (ret != Z_STREAM_END))
- {
- av_log(avctx, AV_LOG_ERROR, "error in decompression of block %dx%d: %d\n", i, j, ret);
- /* return -1; */
- }
- copy_region(s->tmpblock, s->frame.data[0], s->image_height-(hp+hs+1), wp, hs, ws, s->frame.linesize[0]);
- skip_bits(&gb, 8*size); /* skip the consumed bits */
- }
- }
- }
-
- *data_size = sizeof(AVFrame);
- *(AVFrame*)data = s->frame;
-
- if ((get_bits_count(&gb)/8) != buf_size)
- av_log(avctx, AV_LOG_ERROR, "buffer not fully consumed (%d != %d)\n",
- buf_size, (get_bits_count(&gb)/8));
-
- /* report that the buffer was completely consumed */
- return buf_size;
-}
-
-
-static int flashsv_decode_end(AVCodecContext *avctx)
-{
- FlashSVContext *s = (FlashSVContext *)avctx->priv_data;
- inflateEnd(&(s->zstream));
- /* release the frame if needed */
- if (s->frame.data[0])
- avctx->release_buffer(avctx, &s->frame);
-
- /* free the tmpblock */
- if (s->tmpblock != NULL)
- av_free(s->tmpblock);
-
- return 0;
-}
-
-
-AVCodec flashsv_decoder = {
- "flashsv",
- CODEC_TYPE_VIDEO,
- CODEC_ID_FLASHSV,
- sizeof(FlashSVContext),
- flashsv_decode_init,
- NULL,
- flashsv_decode_end,
- flashsv_decode_frame,
- CODEC_CAP_DR1,
- .pix_fmts = (enum PixelFormat[]){PIX_FMT_BGR24, -1},
-};
diff --git a/src/libffmpeg/libavcodec/flicvideo.c b/src/libffmpeg/libavcodec/flicvideo.c
deleted file mode 100644
index 78506eee8..000000000
--- a/src/libffmpeg/libavcodec/flicvideo.c
+++ /dev/null
@@ -1,754 +0,0 @@
-/*
- * FLI/FLC Animation Video Decoder
- * Copyright (C) 2003, 2004 the ffmpeg project
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file flic.c
- * Autodesk Animator FLI/FLC Video Decoder
- * by Mike Melanson (melanson@pcisys.net)
- * for more information on the .fli/.flc file format and all of its many
- * variations, visit:
- * http://www.compuphase.com/flic.htm
- *
- * This decoder outputs PAL8/RGB555/RGB565 and maybe one day RGB24
- * colorspace data, depending on the FLC. To use this decoder, be
- * sure that your demuxer sends the FLI file header to the decoder via
- * the extradata chunk in AVCodecContext. The chunk should be 128 bytes
- * large. The only exception is for FLI files from the game "Magic Carpet",
- * in which the header is only 12 bytes.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "common.h"
-#include "avcodec.h"
-#include "bswap.h"
-
-#define FLI_256_COLOR 4
-#define FLI_DELTA 7
-#define FLI_COLOR 11
-#define FLI_LC 12
-#define FLI_BLACK 13
-#define FLI_BRUN 15
-#define FLI_COPY 16
-#define FLI_MINI 18
-#define FLI_DTA_BRUN 25
-#define FLI_DTA_COPY 26
-#define FLI_DTA_LC 27
-
-#define FLI_TYPE_CODE (0xAF11)
-#define FLC_FLX_TYPE_CODE (0xAF12)
-#define FLC_DTA_TYPE_CODE (0xAF44) /* Marks an "Extended FLC" comes from Dave's Targa Animator (DTA) */
-#define FLC_MAGIC_CARPET_SYNTHETIC_TYPE_CODE (0xAF13)
-
-#define CHECK_PIXEL_PTR(n) \
- if (pixel_ptr + n > pixel_limit) { \
- av_log (s->avctx, AV_LOG_INFO, "Problem: pixel_ptr >= pixel_limit (%d >= %d)\n", \
- pixel_ptr + n, pixel_limit); \
- return -1; \
- } \
-
-typedef struct FlicDecodeContext {
- AVCodecContext *avctx;
- AVFrame frame;
-
- unsigned int palette[256];
- int new_palette;
- int fli_type; /* either 0xAF11 or 0xAF12, affects palette resolution */
-} FlicDecodeContext;
-
-static int flic_decode_init(AVCodecContext *avctx)
-{
- FlicDecodeContext *s = (FlicDecodeContext *)avctx->priv_data;
- unsigned char *fli_header = (unsigned char *)avctx->extradata;
- int depth;
-
- s->avctx = avctx;
- avctx->has_b_frames = 0;
-
- s->fli_type = AV_RL16(&fli_header[4]); /* Might be overridden if a Magic Carpet FLC */
- depth = AV_RL16(&fli_header[12]);
-
- if (depth == 0) {
- depth = 8; /* Some FLC generators set depth to zero, when they mean 8Bpp. Fix up here */
- }
-
- if (s->avctx->extradata_size == 12) {
- /* special case for magic carpet FLIs */
- s->fli_type = FLC_MAGIC_CARPET_SYNTHETIC_TYPE_CODE;
- } else if (s->avctx->extradata_size != 128) {
- av_log(avctx, AV_LOG_ERROR, "Expected extradata of 12 or 128 bytes\n");
- return -1;
- }
-
- if ((s->fli_type == FLC_FLX_TYPE_CODE) && (depth == 16)) {
- depth = 15; /* Original Autodesk FLX's say the depth is 16Bpp when it is really 15Bpp */
- }
-
- switch (depth) {
- case 8 : avctx->pix_fmt = PIX_FMT_PAL8; break;
- case 15 : avctx->pix_fmt = PIX_FMT_RGB555; break;
- case 16 : avctx->pix_fmt = PIX_FMT_RGB565; break;
- case 24 : avctx->pix_fmt = PIX_FMT_BGR24; /* Supposedly BGR, but havent any files to test with */
- av_log(avctx, AV_LOG_ERROR, "24Bpp FLC/FLX is unsupported due to no test files.\n");
- return -1;
- break;
- default :
- av_log(avctx, AV_LOG_ERROR, "Unkown FLC/FLX depth of %d Bpp is unsupported.\n",depth);
- return -1;
- }
-
- s->frame.data[0] = NULL;
- s->new_palette = 0;
-
- return 0;
-}
-
-static int flic_decode_frame_8BPP(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- FlicDecodeContext *s = (FlicDecodeContext *)avctx->priv_data;
-
- int stream_ptr = 0;
- int stream_ptr_after_color_chunk;
- int pixel_ptr;
- int palette_ptr;
- unsigned char palette_idx1;
- unsigned char palette_idx2;
-
- unsigned int frame_size;
- int num_chunks;
-
- unsigned int chunk_size;
- int chunk_type;
-
- int i, j;
-
- int color_packets;
- int color_changes;
- int color_shift;
- unsigned char r, g, b;
-
- int lines;
- int compressed_lines;
- int starting_line;
- signed short line_packets;
- int y_ptr;
- int byte_run;
- int pixel_skip;
- int pixel_countdown;
- unsigned char *pixels;
- int pixel_limit;
-
- s->frame.reference = 1;
- s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
- if (avctx->reget_buffer(avctx, &s->frame) < 0) {
- av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
- return -1;
- }
-
- pixels = s->frame.data[0];
- pixel_limit = s->avctx->height * s->frame.linesize[0];
-
- frame_size = AV_RL32(&buf[stream_ptr]);
- stream_ptr += 6; /* skip the magic number */
- num_chunks = AV_RL16(&buf[stream_ptr]);
- stream_ptr += 10; /* skip padding */
-
- frame_size -= 16;
-
- /* iterate through the chunks */
- while ((frame_size > 0) && (num_chunks > 0)) {
- chunk_size = AV_RL32(&buf[stream_ptr]);
- stream_ptr += 4;
- chunk_type = AV_RL16(&buf[stream_ptr]);
- stream_ptr += 2;
-
- switch (chunk_type) {
- case FLI_256_COLOR:
- case FLI_COLOR:
- stream_ptr_after_color_chunk = stream_ptr + chunk_size - 6;
-
- /* check special case: If this file is from the Magic Carpet
- * game and uses 6-bit colors even though it reports 256-color
- * chunks in a 0xAF12-type file (fli_type is set to 0xAF13 during
- * initialization) */
- if ((chunk_type == FLI_256_COLOR) && (s->fli_type != FLC_MAGIC_CARPET_SYNTHETIC_TYPE_CODE))
- color_shift = 0;
- else
- color_shift = 2;
- /* set up the palette */
- color_packets = AV_RL16(&buf[stream_ptr]);
- stream_ptr += 2;
- palette_ptr = 0;
- for (i = 0; i < color_packets; i++) {
- /* first byte is how many colors to skip */
- palette_ptr += buf[stream_ptr++];
-
- /* next byte indicates how many entries to change */
- color_changes = buf[stream_ptr++];
-
- /* if there are 0 color changes, there are actually 256 */
- if (color_changes == 0)
- color_changes = 256;
-
- for (j = 0; j < color_changes; j++) {
- unsigned int entry;
-
- /* wrap around, for good measure */
- if ((unsigned)palette_ptr >= 256)
- palette_ptr = 0;
-
- r = buf[stream_ptr++] << color_shift;
- g = buf[stream_ptr++] << color_shift;
- b = buf[stream_ptr++] << color_shift;
- entry = (r << 16) | (g << 8) | b;
- if (s->palette[palette_ptr] != entry)
- s->new_palette = 1;
- s->palette[palette_ptr++] = entry;
- }
- }
-
- /* color chunks sometimes have weird 16-bit alignment issues;
- * therefore, take the hardline approach and set the stream_ptr
- * to the value calculated w.r.t. the size specified by the color
- * chunk header */
- stream_ptr = stream_ptr_after_color_chunk;
-
- break;
-
- case FLI_DELTA:
- y_ptr = 0;
- compressed_lines = AV_RL16(&buf[stream_ptr]);
- stream_ptr += 2;
- while (compressed_lines > 0) {
- line_packets = AV_RL16(&buf[stream_ptr]);
- stream_ptr += 2;
- if ((line_packets & 0xC000) == 0xC000) {
- // line skip opcode
- line_packets = -line_packets;
- y_ptr += line_packets * s->frame.linesize[0];
- } else if ((line_packets & 0xC000) == 0x4000) {
- av_log(avctx, AV_LOG_ERROR, "Undefined opcode (%x) in DELTA_FLI\n", line_packets);
- } else if ((line_packets & 0xC000) == 0x8000) {
- // "last byte" opcode
- pixels[y_ptr + s->frame.linesize[0] - 1] = line_packets & 0xff;
- } else {
- compressed_lines--;
- pixel_ptr = y_ptr;
- pixel_countdown = s->avctx->width;
- for (i = 0; i < line_packets; i++) {
- /* account for the skip bytes */
- pixel_skip = buf[stream_ptr++];
- pixel_ptr += pixel_skip;
- pixel_countdown -= pixel_skip;
- byte_run = (signed char)(buf[stream_ptr++]);
- if (byte_run < 0) {
- byte_run = -byte_run;
- palette_idx1 = buf[stream_ptr++];
- palette_idx2 = buf[stream_ptr++];
- CHECK_PIXEL_PTR(byte_run);
- for (j = 0; j < byte_run; j++, pixel_countdown -= 2) {
- pixels[pixel_ptr++] = palette_idx1;
- pixels[pixel_ptr++] = palette_idx2;
- }
- } else {
- CHECK_PIXEL_PTR(byte_run * 2);
- for (j = 0; j < byte_run * 2; j++, pixel_countdown--) {
- palette_idx1 = buf[stream_ptr++];
- pixels[pixel_ptr++] = palette_idx1;
- }
- }
- }
-
- y_ptr += s->frame.linesize[0];
- }
- }
- break;
-
- case FLI_LC:
- /* line compressed */
- starting_line = AV_RL16(&buf[stream_ptr]);
- stream_ptr += 2;
- y_ptr = 0;
- y_ptr += starting_line * s->frame.linesize[0];
-
- compressed_lines = AV_RL16(&buf[stream_ptr]);
- stream_ptr += 2;
- while (compressed_lines > 0) {
- pixel_ptr = y_ptr;
- pixel_countdown = s->avctx->width;
- line_packets = buf[stream_ptr++];
- if (line_packets > 0) {
- for (i = 0; i < line_packets; i++) {
- /* account for the skip bytes */
- pixel_skip = buf[stream_ptr++];
- pixel_ptr += pixel_skip;
- pixel_countdown -= pixel_skip;
- byte_run = (signed char)(buf[stream_ptr++]);
- if (byte_run > 0) {
- CHECK_PIXEL_PTR(byte_run);
- for (j = 0; j < byte_run; j++, pixel_countdown--) {
- palette_idx1 = buf[stream_ptr++];
- pixels[pixel_ptr++] = palette_idx1;
- }
- } else if (byte_run < 0) {
- byte_run = -byte_run;
- palette_idx1 = buf[stream_ptr++];
- CHECK_PIXEL_PTR(byte_run);
- for (j = 0; j < byte_run; j++, pixel_countdown--) {
- pixels[pixel_ptr++] = palette_idx1;
- }
- }
- }
- }
-
- y_ptr += s->frame.linesize[0];
- compressed_lines--;
- }
- break;
-
- case FLI_BLACK:
- /* set the whole frame to color 0 (which is usually black) */
- memset(pixels, 0,
- s->frame.linesize[0] * s->avctx->height);
- break;
-
- case FLI_BRUN:
- /* Byte run compression: This chunk type only occurs in the first
- * FLI frame and it will update the entire frame. */
- y_ptr = 0;
- for (lines = 0; lines < s->avctx->height; lines++) {
- pixel_ptr = y_ptr;
- /* disregard the line packets; instead, iterate through all
- * pixels on a row */
- stream_ptr++;
- pixel_countdown = s->avctx->width;
- while (pixel_countdown > 0) {
- byte_run = (signed char)(buf[stream_ptr++]);
- if (byte_run > 0) {
- palette_idx1 = buf[stream_ptr++];
- CHECK_PIXEL_PTR(byte_run);
- for (j = 0; j < byte_run; j++) {
- pixels[pixel_ptr++] = palette_idx1;
- pixel_countdown--;
- if (pixel_countdown < 0)
- av_log(avctx, AV_LOG_ERROR, "pixel_countdown < 0 (%d)\n",
- pixel_countdown);
- }
- } else { /* copy bytes if byte_run < 0 */
- byte_run = -byte_run;
- CHECK_PIXEL_PTR(byte_run);
- for (j = 0; j < byte_run; j++) {
- palette_idx1 = buf[stream_ptr++];
- pixels[pixel_ptr++] = palette_idx1;
- pixel_countdown--;
- if (pixel_countdown < 0)
- av_log(avctx, AV_LOG_ERROR, "pixel_countdown < 0 (%d)\n",
- pixel_countdown);
- }
- }
- }
-
- y_ptr += s->frame.linesize[0];
- }
- break;
-
- case FLI_COPY:
- /* copy the chunk (uncompressed frame) */
- if (chunk_size - 6 > s->avctx->width * s->avctx->height) {
- av_log(avctx, AV_LOG_ERROR, "In chunk FLI_COPY : source data (%d bytes) " \
- "bigger than image, skipping chunk\n", chunk_size - 6);
- stream_ptr += chunk_size - 6;
- } else {
- for (y_ptr = 0; y_ptr < s->frame.linesize[0] * s->avctx->height;
- y_ptr += s->frame.linesize[0]) {
- memcpy(&pixels[y_ptr], &buf[stream_ptr],
- s->avctx->width);
- stream_ptr += s->avctx->width;
- }
- }
- break;
-
- case FLI_MINI:
- /* some sort of a thumbnail? disregard this chunk... */
- stream_ptr += chunk_size - 6;
- break;
-
- default:
- av_log(avctx, AV_LOG_ERROR, "Unrecognized chunk type: %d\n", chunk_type);
- break;
- }
-
- frame_size -= chunk_size;
- num_chunks--;
- }
-
- /* by the end of the chunk, the stream ptr should equal the frame
- * size (minus 1, possibly); if it doesn't, issue a warning */
- if ((stream_ptr != buf_size) && (stream_ptr != buf_size - 1))
- av_log(avctx, AV_LOG_ERROR, "Processed FLI chunk where chunk size = %d " \
- "and final chunk ptr = %d\n", buf_size, stream_ptr);
-
- /* make the palette available on the way out */
- memcpy(s->frame.data[1], s->palette, AVPALETTE_SIZE);
- if (s->new_palette) {
- s->frame.palette_has_changed = 1;
- s->new_palette = 0;
- }
-
- *data_size=sizeof(AVFrame);
- *(AVFrame*)data = s->frame;
-
- return buf_size;
-}
-
-static int flic_decode_frame_15_16BPP(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- /* Note, the only difference between the 15Bpp and 16Bpp */
- /* Format is the pixel format, the packets are processed the same. */
- FlicDecodeContext *s = (FlicDecodeContext *)avctx->priv_data;
-
- int stream_ptr = 0;
- int pixel_ptr;
- unsigned char palette_idx1;
-
- unsigned int frame_size;
- int num_chunks;
-
- unsigned int chunk_size;
- int chunk_type;
-
- int i, j;
-
- int lines;
- int compressed_lines;
- signed short line_packets;
- int y_ptr;
- int byte_run;
- int pixel_skip;
- int pixel_countdown;
- unsigned char *pixels;
- int pixel;
- int pixel_limit;
-
- s->frame.reference = 1;
- s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
- if (avctx->reget_buffer(avctx, &s->frame) < 0) {
- av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
- return -1;
- }
-
- pixels = s->frame.data[0];
- pixel_limit = s->avctx->height * s->frame.linesize[0];
-
- frame_size = AV_RL32(&buf[stream_ptr]);
- stream_ptr += 6; /* skip the magic number */
- num_chunks = AV_RL16(&buf[stream_ptr]);
- stream_ptr += 10; /* skip padding */
-
- frame_size -= 16;
-
- /* iterate through the chunks */
- while ((frame_size > 0) && (num_chunks > 0)) {
- chunk_size = AV_RL32(&buf[stream_ptr]);
- stream_ptr += 4;
- chunk_type = AV_RL16(&buf[stream_ptr]);
- stream_ptr += 2;
-
- switch (chunk_type) {
- case FLI_256_COLOR:
- case FLI_COLOR:
- /* For some reason, it seems that non-paletised flics do include one of these */
- /* chunks in their first frame. Why i do not know, it seems rather extraneous */
-/* av_log(avctx, AV_LOG_ERROR, "Unexpected Palette chunk %d in non-paletised FLC\n",chunk_type);*/
- stream_ptr = stream_ptr + chunk_size - 6;
- break;
-
- case FLI_DELTA:
- case FLI_DTA_LC:
- y_ptr = 0;
- compressed_lines = AV_RL16(&buf[stream_ptr]);
- stream_ptr += 2;
- while (compressed_lines > 0) {
- line_packets = AV_RL16(&buf[stream_ptr]);
- stream_ptr += 2;
- if (line_packets < 0) {
- line_packets = -line_packets;
- y_ptr += line_packets * s->frame.linesize[0];
- } else {
- compressed_lines--;
- pixel_ptr = y_ptr;
- pixel_countdown = s->avctx->width;
- for (i = 0; i < line_packets; i++) {
- /* account for the skip bytes */
- pixel_skip = buf[stream_ptr++];
- pixel_ptr += (pixel_skip*2); /* Pixel is 2 bytes wide */
- pixel_countdown -= pixel_skip;
- byte_run = (signed char)(buf[stream_ptr++]);
- if (byte_run < 0) {
- byte_run = -byte_run;
- pixel = AV_RL16(&buf[stream_ptr]);
- stream_ptr += 2;
- CHECK_PIXEL_PTR(byte_run);
- for (j = 0; j < byte_run; j++, pixel_countdown -= 2) {
- *((signed short*)(&pixels[pixel_ptr])) = pixel;
- pixel_ptr += 2;
- }
- } else {
- CHECK_PIXEL_PTR(byte_run);
- for (j = 0; j < byte_run; j++, pixel_countdown--) {
- *((signed short*)(&pixels[pixel_ptr])) = AV_RL16(&buf[stream_ptr]);
- stream_ptr += 2;
- pixel_ptr += 2;
- }
- }
- }
-
- y_ptr += s->frame.linesize[0];
- }
- }
- break;
-
- case FLI_LC:
- av_log(avctx, AV_LOG_ERROR, "Unexpected FLI_LC chunk in non-paletised FLC\n");
- stream_ptr = stream_ptr + chunk_size - 6;
- break;
-
- case FLI_BLACK:
- /* set the whole frame to 0x0000 which is black in both 15Bpp and 16Bpp modes. */
- memset(pixels, 0x0000,
- s->frame.linesize[0] * s->avctx->height);
- break;
-
- case FLI_BRUN:
- y_ptr = 0;
- for (lines = 0; lines < s->avctx->height; lines++) {
- pixel_ptr = y_ptr;
- /* disregard the line packets; instead, iterate through all
- * pixels on a row */
- stream_ptr++;
- pixel_countdown = (s->avctx->width * 2);
-
- while (pixel_countdown > 0) {
- byte_run = (signed char)(buf[stream_ptr++]);
- if (byte_run > 0) {
- palette_idx1 = buf[stream_ptr++];
- CHECK_PIXEL_PTR(byte_run);
- for (j = 0; j < byte_run; j++) {
- pixels[pixel_ptr++] = palette_idx1;
- pixel_countdown--;
- if (pixel_countdown < 0)
- av_log(avctx, AV_LOG_ERROR, "pixel_countdown < 0 (%d)\n",
- pixel_countdown);
- }
- } else { /* copy bytes if byte_run < 0 */
- byte_run = -byte_run;
- CHECK_PIXEL_PTR(byte_run);
- for (j = 0; j < byte_run; j++) {
- palette_idx1 = buf[stream_ptr++];
- pixels[pixel_ptr++] = palette_idx1;
- pixel_countdown--;
- if (pixel_countdown < 0)
- av_log(avctx, AV_LOG_ERROR, "pixel_countdown < 0 (%d)\n",
- pixel_countdown);
- }
- }
- }
-
- /* Now FLX is strange, in that it is "byte" as opposed to "pixel" run length compressed.
- * This doesnt give us any good oportunity to perform word endian conversion
- * during decompression. So if its requried (ie, this isnt a LE target, we do
- * a second pass over the line here, swapping the bytes.
- */
- pixel = 0xFF00;
- if (0xFF00 != AV_RL16(&pixel)) /* Check if its not an LE Target */
- {
- pixel_ptr = y_ptr;
- pixel_countdown = s->avctx->width;
- while (pixel_countdown > 0) {
- *((signed short*)(&pixels[pixel_ptr])) = AV_RL16(&buf[pixel_ptr]);
- pixel_ptr += 2;
- }
- }
- y_ptr += s->frame.linesize[0];
- }
- break;
-
- case FLI_DTA_BRUN:
- y_ptr = 0;
- for (lines = 0; lines < s->avctx->height; lines++) {
- pixel_ptr = y_ptr;
- /* disregard the line packets; instead, iterate through all
- * pixels on a row */
- stream_ptr++;
- pixel_countdown = s->avctx->width; /* Width is in pixels, not bytes */
-
- while (pixel_countdown > 0) {
- byte_run = (signed char)(buf[stream_ptr++]);
- if (byte_run > 0) {
- pixel = AV_RL16(&buf[stream_ptr]);
- stream_ptr += 2;
- CHECK_PIXEL_PTR(byte_run);
- for (j = 0; j < byte_run; j++) {
- *((signed short*)(&pixels[pixel_ptr])) = pixel;
- pixel_ptr += 2;
- pixel_countdown--;
- if (pixel_countdown < 0)
- av_log(avctx, AV_LOG_ERROR, "pixel_countdown < 0 (%d)\n",
- pixel_countdown);
- }
- } else { /* copy pixels if byte_run < 0 */
- byte_run = -byte_run;
- CHECK_PIXEL_PTR(byte_run);
- for (j = 0; j < byte_run; j++) {
- *((signed short*)(&pixels[pixel_ptr])) = AV_RL16(&buf[stream_ptr]);
- stream_ptr += 2;
- pixel_ptr += 2;
- pixel_countdown--;
- if (pixel_countdown < 0)
- av_log(avctx, AV_LOG_ERROR, "pixel_countdown < 0 (%d)\n",
- pixel_countdown);
- }
- }
- }
-
- y_ptr += s->frame.linesize[0];
- }
- break;
-
- case FLI_COPY:
- case FLI_DTA_COPY:
- /* copy the chunk (uncompressed frame) */
- if (chunk_size - 6 > (unsigned int)(s->avctx->width * s->avctx->height)*2) {
- av_log(avctx, AV_LOG_ERROR, "In chunk FLI_COPY : source data (%d bytes) " \
- "bigger than image, skipping chunk\n", chunk_size - 6);
- stream_ptr += chunk_size - 6;
- } else {
-
- for (y_ptr = 0; y_ptr < s->frame.linesize[0] * s->avctx->height;
- y_ptr += s->frame.linesize[0]) {
-
- pixel_countdown = s->avctx->width;
- pixel_ptr = 0;
- while (pixel_countdown > 0) {
- *((signed short*)(&pixels[y_ptr + pixel_ptr])) = AV_RL16(&buf[stream_ptr+pixel_ptr]);
- pixel_ptr += 2;
- pixel_countdown--;
- }
- stream_ptr += s->avctx->width*2;
- }
- }
- break;
-
- case FLI_MINI:
- /* some sort of a thumbnail? disregard this chunk... */
- stream_ptr += chunk_size - 6;
- break;
-
- default:
- av_log(avctx, AV_LOG_ERROR, "Unrecognized chunk type: %d\n", chunk_type);
- break;
- }
-
- frame_size -= chunk_size;
- num_chunks--;
- }
-
- /* by the end of the chunk, the stream ptr should equal the frame
- * size (minus 1, possibly); if it doesn't, issue a warning */
- if ((stream_ptr != buf_size) && (stream_ptr != buf_size - 1))
- av_log(avctx, AV_LOG_ERROR, "Processed FLI chunk where chunk size = %d " \
- "and final chunk ptr = %d\n", buf_size, stream_ptr);
-
-
- *data_size=sizeof(AVFrame);
- *(AVFrame*)data = s->frame;
-
- return buf_size;
-}
-
-static int flic_decode_frame_24BPP(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- av_log(avctx, AV_LOG_ERROR, "24Bpp FLC Unsupported due to lack of test files.\n");
- return -1;
-}
-
-static int flic_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- if (avctx->pix_fmt == PIX_FMT_PAL8) {
- return flic_decode_frame_8BPP(avctx, data, data_size,
- buf, buf_size);
- }
- else if ((avctx->pix_fmt == PIX_FMT_RGB555) ||
- (avctx->pix_fmt == PIX_FMT_RGB565)) {
- return flic_decode_frame_15_16BPP(avctx, data, data_size,
- buf, buf_size);
- }
- else if (avctx->pix_fmt == PIX_FMT_BGR24) {
- return flic_decode_frame_24BPP(avctx, data, data_size,
- buf, buf_size);
- }
-
- /* Shouldnt get here, ever as the pix_fmt is processed */
- /* in flic_decode_init and the above if should deal with */
- /* the finite set of possibilites allowable by here. */
- /* but in case we do, just error out. */
- av_log(avctx, AV_LOG_ERROR, "Unknown Format of FLC. My Science cant explain how this happened\n");
- return -1;
-}
-
-
-static int flic_decode_end(AVCodecContext *avctx)
-{
- FlicDecodeContext *s = avctx->priv_data;
-
- if (s->frame.data[0])
- avctx->release_buffer(avctx, &s->frame);
-
- return 0;
-}
-
-AVCodec flic_decoder = {
- "flic",
- CODEC_TYPE_VIDEO,
- CODEC_ID_FLIC,
- sizeof(FlicDecodeContext),
- flic_decode_init,
- NULL,
- flic_decode_end,
- flic_decode_frame,
- CODEC_CAP_DR1,
- NULL,
- NULL,
- NULL,
- NULL
-};
diff --git a/src/libffmpeg/libavcodec/fraps.c b/src/libffmpeg/libavcodec/fraps.c
deleted file mode 100644
index 0a4567d05..000000000
--- a/src/libffmpeg/libavcodec/fraps.c
+++ /dev/null
@@ -1,398 +0,0 @@
-/*
- * Fraps FPS1 decoder
- * Copyright (c) 2005 Roine Gustafsson
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file fraps.c
- * Lossless Fraps 'FPS1' decoder
- * @author Roine Gustafsson <roine at users sf net>
- * @author Konstantin Shishkov
- *
- * Codec algorithm for version 0 is taken from Transcode <www.transcoding.org>
- *
- * Version 2 files support by Konstantin Shishkov
- */
-
-#include "avcodec.h"
-#include "bitstream.h"
-#include "dsputil.h"
-
-#define FPS_TAG MKTAG('F', 'P', 'S', 'x')
-
-/* symbol for Huffman tree node */
-#define HNODE -1
-
-/**
- * Huffman node
- * FIXME one day this should belong to one general framework
- */
-typedef struct Node{
- int16_t sym;
- int16_t n0;
- int count;
-}Node;
-
-/**
- * local variable storage
- */
-typedef struct FrapsContext{
- AVCodecContext *avctx;
- AVFrame frame;
- Node nodes[512];
- uint8_t *tmpbuf;
- DSPContext dsp;
-} FrapsContext;
-
-
-/**
- * initializes decoder
- * @param avctx codec context
- * @return 0 on success or negative if fails
- */
-static int decode_init(AVCodecContext *avctx)
-{
- FrapsContext * const s = avctx->priv_data;
-
- avctx->coded_frame = (AVFrame*)&s->frame;
- avctx->has_b_frames = 0;
- avctx->pix_fmt= PIX_FMT_NONE; /* set in decode_frame */
-
- s->avctx = avctx;
- s->frame.data[0] = NULL;
- s->tmpbuf = NULL;
-
- dsputil_init(&s->dsp, avctx);
-
- return 0;
-}
-
-/**
- * Comparator - our nodes should ascend by count
- * but with preserved symbol order
- */
-static int huff_cmp(const Node *a, const Node *b){
- return (a->count - b->count)*256 + a->sym - b->sym;
-}
-
-static void get_tree_codes(uint32_t *bits, int16_t *lens, uint8_t *xlat, Node *nodes, int node, uint32_t pfx, int pl, int *pos)
-{
- int s;
-
- s = nodes[node].sym;
- if(s != HNODE || !nodes[node].count){
- bits[*pos] = pfx;
- lens[*pos] = pl;
- xlat[*pos] = s;
- (*pos)++;
- }else{
- pfx <<= 1;
- pl++;
- get_tree_codes(bits, lens, xlat, nodes, nodes[node].n0, pfx, pl, pos);
- pfx |= 1;
- get_tree_codes(bits, lens, xlat, nodes, nodes[node].n0+1, pfx, pl, pos);
- }
-}
-
-static int build_huff_tree(VLC *vlc, Node *nodes, uint8_t *xlat)
-{
- uint32_t bits[256];
- int16_t lens[256];
- int pos = 0;
-
- get_tree_codes(bits, lens, xlat, nodes, 510, 0, 0, &pos);
- return init_vlc(vlc, 9, pos, lens, 2, 2, bits, 4, 4, 0);
-}
-
-
-/**
- * decode Fraps v2 packed plane
- */
-static int fraps2_decode_plane(FrapsContext *s, uint8_t *dst, int stride, int w,
- int h, uint8_t *src, int size, int Uoff)
-{
- int i, j;
- int cur_node;
- GetBitContext gb;
- VLC vlc;
- int64_t sum = 0;
- uint8_t recode[256];
-
- for(i = 0; i < 256; i++){
- s->nodes[i].sym = i;
- s->nodes[i].count = AV_RL32(src);
- s->nodes[i].n0 = -2;
- if(s->nodes[i].count < 0) {
- av_log(s->avctx, AV_LOG_ERROR, "Symbol count < 0\n");
- return -1;
- }
- src += 4;
- sum += s->nodes[i].count;
- }
- size -= 1024;
-
- if(sum >> 31) {
- av_log(s->avctx, AV_LOG_ERROR, "Too high symbol frequencies. Tree construction is not possible\n");
- return -1;
- }
- qsort(s->nodes, 256, sizeof(Node), huff_cmp);
- cur_node = 256;
- for(i = 0; i < 511; i += 2){
- s->nodes[cur_node].sym = HNODE;
- s->nodes[cur_node].count = s->nodes[i].count + s->nodes[i+1].count;
- s->nodes[cur_node].n0 = i;
- for(j = cur_node; j > 0; j--){
- if(s->nodes[j].count >= s->nodes[j - 1].count) break;
- FFSWAP(Node, s->nodes[j], s->nodes[j - 1]);
- }
- cur_node++;
- }
- if(build_huff_tree(&vlc, s->nodes, recode) < 0){
- av_log(s->avctx, AV_LOG_ERROR, "Error building tree\n");
- return -1;
- }
- /* we have built Huffman table and are ready to decode plane */
-
- /* convert bits so they may be used by standard bitreader */
- s->dsp.bswap_buf(s->tmpbuf, src, size >> 2);
-
- init_get_bits(&gb, s->tmpbuf, size * 8);
- for(j = 0; j < h; j++){
- for(i = 0; i < w; i++){
- dst[i] = recode[get_vlc2(&gb, vlc.table, 9, 3)];
- /* lines are stored as deltas between previous lines
- * and we need to add 0x80 to the first lines of chroma planes
- */
- if(j) dst[i] += dst[i - stride];
- else if(Uoff) dst[i] += 0x80;
- }
- dst += stride;
- }
- free_vlc(&vlc);
- return 0;
-}
-
-/**
- * decode a frame
- * @param avctx codec context
- * @param data output AVFrame
- * @param data_size size of output data or 0 if no picture is returned
- * @param buf input data frame
- * @param buf_size size of input data frame
- * @return number of consumed bytes on success or negative if decode fails
- */
-static int decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- FrapsContext * const s = avctx->priv_data;
- AVFrame *frame = data;
- AVFrame * const f = (AVFrame*)&s->frame;
- uint32_t header;
- unsigned int version,header_size;
- unsigned int x, y;
- uint32_t *buf32;
- uint32_t *luma1,*luma2,*cb,*cr;
- uint32_t offs[4];
- int i, is_chroma, planes;
-
-
- header = AV_RL32(buf);
- version = header & 0xff;
- header_size = (header & (1<<30))? 8 : 4; /* bit 30 means pad to 8 bytes */
-
- if (version > 2 && version != 4) {
- av_log(avctx, AV_LOG_ERROR,
- "This file is encoded with Fraps version %d. " \
- "This codec can only decode version 0, 1, 2 and 4.\n", version);
- return -1;
- }
-
- buf+=4;
- if (header_size == 8)
- buf+=4;
-
- switch(version) {
- case 0:
- default:
- /* Fraps v0 is a reordered YUV420 */
- avctx->pix_fmt = PIX_FMT_YUV420P;
-
- if ( (buf_size != avctx->width*avctx->height*3/2+header_size) &&
- (buf_size != header_size) ) {
- av_log(avctx, AV_LOG_ERROR,
- "Invalid frame length %d (should be %d)\n",
- buf_size, avctx->width*avctx->height*3/2+header_size);
- return -1;
- }
-
- if (( (avctx->width % 8) != 0) || ( (avctx->height % 2) != 0 )) {
- av_log(avctx, AV_LOG_ERROR, "Invalid frame size %dx%d\n",
- avctx->width, avctx->height);
- return -1;
- }
-
- f->reference = 1;
- f->buffer_hints = FF_BUFFER_HINTS_VALID |
- FF_BUFFER_HINTS_PRESERVE |
- FF_BUFFER_HINTS_REUSABLE;
- if (avctx->reget_buffer(avctx, f)) {
- av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
- return -1;
- }
- /* bit 31 means same as previous pic */
- f->pict_type = (header & (1<<31))? FF_P_TYPE : FF_I_TYPE;
- f->key_frame = f->pict_type == FF_I_TYPE;
-
- if (f->pict_type == FF_I_TYPE) {
- buf32=(uint32_t*)buf;
- for(y=0; y<avctx->height/2; y++){
- luma1=(uint32_t*)&f->data[0][ y*2*f->linesize[0] ];
- luma2=(uint32_t*)&f->data[0][ (y*2+1)*f->linesize[0] ];
- cr=(uint32_t*)&f->data[1][ y*f->linesize[1] ];
- cb=(uint32_t*)&f->data[2][ y*f->linesize[2] ];
- for(x=0; x<avctx->width; x+=8){
- *(luma1++) = *(buf32++);
- *(luma1++) = *(buf32++);
- *(luma2++) = *(buf32++);
- *(luma2++) = *(buf32++);
- *(cr++) = *(buf32++);
- *(cb++) = *(buf32++);
- }
- }
- }
- break;
-
- case 1:
- /* Fraps v1 is an upside-down BGR24 */
- avctx->pix_fmt = PIX_FMT_BGR24;
-
- if ( (buf_size != avctx->width*avctx->height*3+header_size) &&
- (buf_size != header_size) ) {
- av_log(avctx, AV_LOG_ERROR,
- "Invalid frame length %d (should be %d)\n",
- buf_size, avctx->width*avctx->height*3+header_size);
- return -1;
- }
-
- f->reference = 1;
- f->buffer_hints = FF_BUFFER_HINTS_VALID |
- FF_BUFFER_HINTS_PRESERVE |
- FF_BUFFER_HINTS_REUSABLE;
- if (avctx->reget_buffer(avctx, f)) {
- av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
- return -1;
- }
- /* bit 31 means same as previous pic */
- f->pict_type = (header & (1<<31))? FF_P_TYPE : FF_I_TYPE;
- f->key_frame = f->pict_type == FF_I_TYPE;
-
- if (f->pict_type == FF_I_TYPE) {
- for(y=0; y<avctx->height; y++)
- memcpy(&f->data[0][ (avctx->height-y)*f->linesize[0] ],
- &buf[y*avctx->width*3],
- f->linesize[0]);
- }
- break;
-
- case 2:
- case 4:
- /**
- * Fraps v2 is Huffman-coded YUV420 planes
- * Fraps v4 is virtually the same
- */
- avctx->pix_fmt = PIX_FMT_YUV420P;
- planes = 3;
- f->reference = 1;
- f->buffer_hints = FF_BUFFER_HINTS_VALID |
- FF_BUFFER_HINTS_PRESERVE |
- FF_BUFFER_HINTS_REUSABLE;
- if (avctx->reget_buffer(avctx, f)) {
- av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
- return -1;
- }
- /* skip frame */
- if(buf_size == 8) {
- f->pict_type = FF_P_TYPE;
- f->key_frame = 0;
- break;
- }
- f->pict_type = FF_I_TYPE;
- f->key_frame = 1;
- if ((AV_RL32(buf) != FPS_TAG)||(buf_size < (planes*1024 + 24))) {
- av_log(avctx, AV_LOG_ERROR, "Fraps: error in data stream\n");
- return -1;
- }
- for(i = 0; i < planes; i++) {
- offs[i] = AV_RL32(buf + 4 + i * 4);
- if(offs[i] >= buf_size || (i && offs[i] <= offs[i - 1] + 1024)) {
- av_log(avctx, AV_LOG_ERROR, "Fraps: plane %i offset is out of bounds\n", i);
- return -1;
- }
- }
- offs[planes] = buf_size;
- for(i = 0; i < planes; i++){
- is_chroma = !!i;
- s->tmpbuf = av_realloc(s->tmpbuf, offs[i + 1] - offs[i] - 1024 + FF_INPUT_BUFFER_PADDING_SIZE);
- if(fraps2_decode_plane(s, f->data[i], f->linesize[i], avctx->width >> is_chroma,
- avctx->height >> is_chroma, buf + offs[i], offs[i + 1] - offs[i], is_chroma) < 0) {
- av_log(avctx, AV_LOG_ERROR, "Error decoding plane %i\n", i);
- return -1;
- }
- }
- break;
- }
-
- *frame = *f;
- *data_size = sizeof(AVFrame);
-
- return buf_size;
-}
-
-
-/**
- * closes decoder
- * @param avctx codec context
- * @return 0 on success or negative if fails
- */
-static int decode_end(AVCodecContext *avctx)
-{
- FrapsContext *s = (FrapsContext*)avctx->priv_data;
-
- if (s->frame.data[0])
- avctx->release_buffer(avctx, &s->frame);
-
- av_freep(&s->tmpbuf);
- return 0;
-}
-
-
-AVCodec fraps_decoder = {
- "fraps",
- CODEC_TYPE_VIDEO,
- CODEC_ID_FRAPS,
- sizeof(FrapsContext),
- decode_init,
- NULL,
- decode_end,
- decode_frame,
- CODEC_CAP_DR1,
-};
diff --git a/src/libffmpeg/libavcodec/g726.c b/src/libffmpeg/libavcodec/g726.c
deleted file mode 100644
index c509292b6..000000000
--- a/src/libffmpeg/libavcodec/g726.c
+++ /dev/null
@@ -1,429 +0,0 @@
-/*
- * G.726 ADPCM audio codec
- * Copyright (c) 2004 Roman Shaposhnik.
- *
- * This is a very straightforward rendition of the G.726
- * Section 4 "Computational Details".
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include <limits.h>
-#include "avcodec.h"
-#include "common.h"
-#include "bitstream.h"
-
-/**
- * G.726 11bit float.
- * G.726 Standard uses rather odd 11bit floating point arithmentic for
- * numerous occasions. It's a mistery to me why they did it this way
- * instead of simply using 32bit integer arithmetic.
- */
-typedef struct Float11 {
- int sign; /**< 1bit sign */
- int exp; /**< 4bit exponent */
- int mant; /**< 6bit mantissa */
-} Float11;
-
-static inline Float11* i2f(int16_t i, Float11* f)
-{
- f->sign = (i < 0);
- if (f->sign)
- i = -i;
- f->exp = av_log2_16bit(i) + !!i;
- f->mant = i? (i<<6) >> f->exp : 1<<5;
- return f;
-}
-
-static inline int16_t mult(Float11* f1, Float11* f2)
-{
- int res, exp;
-
- exp = f1->exp + f2->exp;
- res = (((f1->mant * f2->mant) + 0x30) >> 4) << 7;
- res = exp > 26 ? res << (exp - 26) : res >> (26 - exp);
- return (f1->sign ^ f2->sign) ? -res : res;
-}
-
-static inline int sgn(int value)
-{
- return (value < 0) ? -1 : 1;
-}
-
-typedef struct G726Tables {
- int bits; /**< bits per sample */
- int* quant; /**< quantization table */
- int* iquant; /**< inverse quantization table */
- int* W; /**< special table #1 ;-) */
- int* F; /**< special table #2 */
-} G726Tables;
-
-typedef struct G726Context {
- G726Tables* tbls; /**< static tables needed for computation */
-
- Float11 sr[2]; /**< prev. reconstructed samples */
- Float11 dq[6]; /**< prev. difference */
- int a[2]; /**< second order predictor coeffs */
- int b[6]; /**< sixth order predictor coeffs */
- int pk[2]; /**< signs of prev. 2 sez + dq */
-
- int ap; /**< scale factor control */
- int yu; /**< fast scale factor */
- int yl; /**< slow scale factor */
- int dms; /**< short average magnitude of F[i] */
- int dml; /**< long average magnitude of F[i] */
- int td; /**< tone detect */
-
- int se; /**< estimated signal for the next iteration */
- int sez; /**< estimated second order prediction */
- int y; /**< quantizer scaling factor for the next iteration */
-} G726Context;
-
-static int quant_tbl16[] = /**< 16kbit/s 2bits per sample */
- { 260, INT_MAX };
-static int iquant_tbl16[] =
- { 116, 365, 365, 116 };
-static int W_tbl16[] =
- { -22, 439, 439, -22 };
-static int F_tbl16[] =
- { 0, 7, 7, 0 };
-
-static int quant_tbl24[] = /**< 24kbit/s 3bits per sample */
- { 7, 217, 330, INT_MAX };
-static int iquant_tbl24[] =
- { INT_MIN, 135, 273, 373, 373, 273, 135, INT_MIN };
-static int W_tbl24[] =
- { -4, 30, 137, 582, 582, 137, 30, -4 };
-static int F_tbl24[] =
- { 0, 1, 2, 7, 7, 2, 1, 0 };
-
-static int quant_tbl32[] = /**< 32kbit/s 4bits per sample */
- { -125, 79, 177, 245, 299, 348, 399, INT_MAX };
-static int iquant_tbl32[] =
- { INT_MIN, 4, 135, 213, 273, 323, 373, 425,
- 425, 373, 323, 273, 213, 135, 4, INT_MIN };
-static int W_tbl32[] =
- { -12, 18, 41, 64, 112, 198, 355, 1122,
- 1122, 355, 198, 112, 64, 41, 18, -12};
-static int F_tbl32[] =
- { 0, 0, 0, 1, 1, 1, 3, 7, 7, 3, 1, 1, 1, 0, 0, 0 };
-
-static int quant_tbl40[] = /**< 40kbit/s 5bits per sample */
- { -122, -16, 67, 138, 197, 249, 297, 338,
- 377, 412, 444, 474, 501, 527, 552, INT_MAX };
-static int iquant_tbl40[] =
- { INT_MIN, -66, 28, 104, 169, 224, 274, 318,
- 358, 395, 429, 459, 488, 514, 539, 566,
- 566, 539, 514, 488, 459, 429, 395, 358,
- 318, 274, 224, 169, 104, 28, -66, INT_MIN };
-static int W_tbl40[] =
- { 14, 14, 24, 39, 40, 41, 58, 100,
- 141, 179, 219, 280, 358, 440, 529, 696,
- 696, 529, 440, 358, 280, 219, 179, 141,
- 100, 58, 41, 40, 39, 24, 14, 14 };
-static int F_tbl40[] =
- { 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 6,
- 6, 6, 5, 4, 3, 2, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 };
-
-static G726Tables G726Tables_pool[] =
- {{ 2, quant_tbl16, iquant_tbl16, W_tbl16, F_tbl16 },
- { 3, quant_tbl24, iquant_tbl24, W_tbl24, F_tbl24 },
- { 4, quant_tbl32, iquant_tbl32, W_tbl32, F_tbl32 },
- { 5, quant_tbl40, iquant_tbl40, W_tbl40, F_tbl40 }};
-
-
-/**
- * Para 4.2.2 page 18: Adaptive quantizer.
- */
-static inline uint8_t quant(G726Context* c, int d)
-{
- int sign, exp, i, dln;
-
- sign = i = 0;
- if (d < 0) {
- sign = 1;
- d = -d;
- }
- exp = av_log2_16bit(d);
- dln = ((exp<<7) + (((d<<7)>>exp)&0x7f)) - (c->y>>2);
-
- while (c->tbls->quant[i] < INT_MAX && c->tbls->quant[i] < dln)
- ++i;
-
- if (sign)
- i = ~i;
- if (c->tbls->bits != 2 && i == 0) /* I'm not sure this is a good idea */
- i = 0xff;
-
- return i;
-}
-
-/**
- * Para 4.2.3 page 22: Inverse adaptive quantizer.
- */
-static inline int16_t inverse_quant(G726Context* c, int i)
-{
- int dql, dex, dqt;
-
- dql = c->tbls->iquant[i] + (c->y >> 2);
- dex = (dql>>7) & 0xf; /* 4bit exponent */
- dqt = (1<<7) + (dql & 0x7f); /* log2 -> linear */
- return (dql < 0) ? 0 : ((dqt<<7) >> (14-dex));
-}
-
-static inline int16_t g726_iterate(G726Context* c, int16_t I)
-{
- int dq, re_signal, pk0, fa1, i, tr, ylint, ylfrac, thr2, al, dq0;
- Float11 f;
-
- dq = inverse_quant(c, I);
- if (I >> (c->tbls->bits - 1)) /* get the sign */
- dq = -dq;
- re_signal = c->se + dq;
-
- /* Transition detect */
- ylint = (c->yl >> 15);
- ylfrac = (c->yl >> 10) & 0x1f;
- thr2 = (ylint > 9) ? 0x1f << 10 : (0x20 + ylfrac) << ylint;
- if (c->td == 1 && abs(dq) > ((thr2+(thr2>>1))>>1))
- tr = 1;
- else
- tr = 0;
-
- /* Update second order predictor coefficient A2 and A1 */
- pk0 = (c->sez + dq) ? sgn(c->sez + dq) : 0;
- dq0 = dq ? sgn(dq) : 0;
- if (tr) {
- c->a[0] = 0;
- c->a[1] = 0;
- for (i=0; i<6; i++)
- c->b[i] = 0;
- } else {
- /* This is a bit crazy, but it really is +255 not +256 */
- fa1 = clip((-c->a[0]*c->pk[0]*pk0)>>5, -256, 255);
-
- c->a[1] += 128*pk0*c->pk[1] + fa1 - (c->a[1]>>7);
- c->a[1] = clip(c->a[1], -12288, 12288);
- c->a[0] += 64*3*pk0*c->pk[0] - (c->a[0] >> 8);
- c->a[0] = clip(c->a[0], -(15360 - c->a[1]), 15360 - c->a[1]);
-
- for (i=0; i<6; i++)
- c->b[i] += 128*dq0*sgn(-c->dq[i].sign) - (c->b[i]>>8);
- }
-
- /* Update Dq and Sr and Pk */
- c->pk[1] = c->pk[0];
- c->pk[0] = pk0 ? pk0 : 1;
- c->sr[1] = c->sr[0];
- i2f(re_signal, &c->sr[0]);
- for (i=5; i>0; i--)
- c->dq[i] = c->dq[i-1];
- i2f(dq, &c->dq[0]);
- c->dq[0].sign = I >> (c->tbls->bits - 1); /* Isn't it crazy ?!?! */
-
- /* Update tone detect [I'm not sure 'tr == 0' is really needed] */
- c->td = (tr == 0 && c->a[1] < -11776);
-
- /* Update Ap */
- c->dms += ((c->tbls->F[I]<<9) - c->dms) >> 5;
- c->dml += ((c->tbls->F[I]<<11) - c->dml) >> 7;
- if (tr)
- c->ap = 256;
- else if (c->y > 1535 && !c->td && (abs((c->dms << 2) - c->dml) < (c->dml >> 3)))
- c->ap += (-c->ap) >> 4;
- else
- c->ap += (0x200 - c->ap) >> 4;
-
- /* Update Yu and Yl */
- c->yu = clip(c->y + (((c->tbls->W[I] << 5) - c->y) >> 5), 544, 5120);
- c->yl += c->yu + ((-c->yl)>>6);
-
- /* Next iteration for Y */
- al = (c->ap >= 256) ? 1<<6 : c->ap >> 2;
- c->y = (c->yl + (c->yu - (c->yl>>6))*al) >> 6;
-
- /* Next iteration for SE and SEZ */
- c->se = 0;
- for (i=0; i<6; i++)
- c->se += mult(i2f(c->b[i] >> 2, &f), &c->dq[i]);
- c->sez = c->se >> 1;
- for (i=0; i<2; i++)
- c->se += mult(i2f(c->a[i] >> 2, &f), &c->sr[i]);
- c->se >>= 1;
-
- return clip(re_signal << 2, -0xffff, 0xffff);
-}
-
-static int g726_reset(G726Context* c, int bit_rate)
-{
- int i;
-
- c->tbls = &G726Tables_pool[bit_rate/8000 - 2];
- for (i=0; i<2; i++) {
- i2f(0, &c->sr[i]);
- c->a[i] = 0;
- c->pk[i] = 1;
- }
- for (i=0; i<6; i++) {
- i2f(0, &c->dq[i]);
- c->b[i] = 0;
- }
- c->ap = 0;
- c->dms = 0;
- c->dml = 0;
- c->yu = 544;
- c->yl = 34816;
- c->td = 0;
-
- c->se = 0;
- c->sez = 0;
- c->y = 544;
-
- return 0;
-}
-
-static int16_t g726_decode(G726Context* c, int16_t i)
-{
- return g726_iterate(c, i);
-}
-
-#ifdef CONFIG_ENCODERS
-static int16_t g726_encode(G726Context* c, int16_t sig)
-{
- uint8_t i;
-
- i = quant(c, sig/4 - c->se) & ((1<<c->tbls->bits) - 1);
- g726_iterate(c, i);
- return i;
-}
-#endif
-
-/* Interfacing to the libavcodec */
-
-typedef struct AVG726Context {
- G726Context c;
- int bits_left;
- int bit_buffer;
- int code_size;
-} AVG726Context;
-
-static int g726_init(AVCodecContext * avctx)
-{
- AVG726Context* c = (AVG726Context*)avctx->priv_data;
-
- if (avctx->channels != 1 ||
- (avctx->bit_rate != 16000 && avctx->bit_rate != 24000 &&
- avctx->bit_rate != 32000 && avctx->bit_rate != 40000)) {
- av_log(avctx, AV_LOG_ERROR, "G726: unsupported audio format\n");
- return -1;
- }
- if (avctx->sample_rate != 8000 && avctx->strict_std_compliance>FF_COMPLIANCE_INOFFICIAL) {
- av_log(avctx, AV_LOG_ERROR, "G726: unsupported audio format\n");
- return -1;
- }
- g726_reset(&c->c, avctx->bit_rate);
- c->code_size = c->c.tbls->bits;
- c->bit_buffer = 0;
- c->bits_left = 0;
-
- avctx->coded_frame = avcodec_alloc_frame();
- if (!avctx->coded_frame)
- return -ENOMEM;
- avctx->coded_frame->key_frame = 1;
-
- return 0;
-}
-
-static int g726_close(AVCodecContext *avctx)
-{
- av_freep(&avctx->coded_frame);
- return 0;
-}
-
-#ifdef CONFIG_ENCODERS
-static int g726_encode_frame(AVCodecContext *avctx,
- uint8_t *dst, int buf_size, void *data)
-{
- AVG726Context *c = avctx->priv_data;
- short *samples = data;
- PutBitContext pb;
-
- init_put_bits(&pb, dst, 1024*1024);
-
- for (; buf_size; buf_size--)
- put_bits(&pb, c->code_size, g726_encode(&c->c, *samples++));
-
- flush_put_bits(&pb);
-
- return put_bits_count(&pb)>>3;
-}
-#endif
-
-static int g726_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- AVG726Context *c = avctx->priv_data;
- short *samples = data;
- uint8_t code;
- uint8_t mask;
- GetBitContext gb;
-
- if (!buf_size)
- goto out;
-
- mask = (1<<c->code_size) - 1;
- init_get_bits(&gb, buf, buf_size * 8);
- if (c->bits_left) {
- int s = c->code_size - c->bits_left;;
- code = (c->bit_buffer << s) | get_bits(&gb, s);
- *samples++ = g726_decode(&c->c, code & mask);
- }
-
- while (get_bits_count(&gb) + c->code_size <= buf_size*8)
- *samples++ = g726_decode(&c->c, get_bits(&gb, c->code_size) & mask);
-
- c->bits_left = buf_size*8 - get_bits_count(&gb);
- c->bit_buffer = get_bits(&gb, c->bits_left);
-
-out:
- *data_size = (uint8_t*)samples - (uint8_t*)data;
- return buf_size;
-}
-
-#ifdef CONFIG_ENCODERS
-AVCodec adpcm_g726_encoder = {
- "g726",
- CODEC_TYPE_AUDIO,
- CODEC_ID_ADPCM_G726,
- sizeof(AVG726Context),
- g726_init,
- g726_encode_frame,
- g726_close,
- NULL,
-};
-#endif //CONFIG_ENCODERS
-
-AVCodec adpcm_g726_decoder = {
- "g726",
- CODEC_TYPE_AUDIO,
- CODEC_ID_ADPCM_G726,
- sizeof(AVG726Context),
- g726_init,
- NULL,
- g726_close,
- g726_decode_frame,
-};
diff --git a/src/libffmpeg/libavcodec/golomb.c b/src/libffmpeg/libavcodec/golomb.c
deleted file mode 100644
index 50df4fc40..000000000
--- a/src/libffmpeg/libavcodec/golomb.c
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * exp golomb vlc stuff
- * Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file golomb.c
- * @brief
- * exp golomb vlc stuff
- * @author Michael Niedermayer <michaelni@gmx.at>
- */
-
-#include "common.h"
-
-const uint8_t ff_golomb_vlc_len[512]={
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
-7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
-3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
-3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
-3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
-};
-
-const uint8_t ff_ue_golomb_vlc_code[512]={
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
- 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9,10,10,10,10,11,11,11,11,12,12,12,12,13,13,13,13,14,14,14,14,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-};
-
-const int8_t ff_se_golomb_vlc_code[512]={
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, -8, 9, -9, 10,-10, 11,-11, 12,-12, 13,-13, 14,-14, 15,-15,
- 4, 4, 4, 4, -4, -4, -4, -4, 5, 5, 5, 5, -5, -5, -5, -5, 6, 6, 6, 6, -6, -6, -6, -6, 7, 7, 7, 7, -7, -7, -7, -7,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-
-const uint8_t ff_ue_golomb_len[256]={
- 1, 3, 3, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 7, 7, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,11,
-11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,13,
-13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
-13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,15,
-15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
-15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
-15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
-15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,17,
-};
-
-const uint8_t ff_interleaved_golomb_vlc_len[256]={
-9,9,7,7,9,9,7,7,5,5,5,5,5,5,5,5,
-9,9,7,7,9,9,7,7,5,5,5,5,5,5,5,5,
-3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
-3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
-9,9,7,7,9,9,7,7,5,5,5,5,5,5,5,5,
-9,9,7,7,9,9,7,7,5,5,5,5,5,5,5,5,
-3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
-3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-};
-
-const uint8_t ff_interleaved_ue_golomb_vlc_code[256]={
- 15,16,7, 7, 17,18,8, 8, 3, 3, 3, 3, 3, 3, 3, 3,
- 19,20,9, 9, 21,22,10,10,4, 4, 4, 4, 4, 4, 4, 4,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 23,24,11,11,25,26,12,12,5, 5, 5, 5, 5, 5, 5, 5,
- 27,28,13,13,29,30,14,14,6, 6, 6, 6, 6, 6, 6, 6,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-const int8_t ff_interleaved_se_golomb_vlc_code[256]={
- 8, -8, 4, 4, 9, -9, -4, -4, 2, 2, 2, 2, 2, 2, 2, 2,
- 10,-10, 5, 5, 11,-11, -5, -5, -2, -2, -2, -2, -2, -2, -2, -2,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 12,-12, 6, 6, 13,-13, -6, -6, 3, 3, 3, 3, 3, 3, 3, 3,
- 14,-14, 7, 7, 15,-15, -7, -7, -3, -3, -3, -3, -3, -3, -3, -3,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-};
diff --git a/src/libffmpeg/libavcodec/golomb.h b/src/libffmpeg/libavcodec/golomb.h
deleted file mode 100644
index 9bf7aec46..000000000
--- a/src/libffmpeg/libavcodec/golomb.h
+++ /dev/null
@@ -1,479 +0,0 @@
-/*
- * exp golomb vlc stuff
- * Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
- * Copyright (c) 2004 Alex Beregszaszi
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file golomb.h
- * @brief
- * exp golomb vlc stuff
- * @author Michael Niedermayer <michaelni@gmx.at> and Alex Beregszaszi
- */
-
-#define INVALID_VLC 0x80000000
-
-extern const uint8_t ff_golomb_vlc_len[512];
-extern const uint8_t ff_ue_golomb_vlc_code[512];
-extern const int8_t ff_se_golomb_vlc_code[512];
-extern const uint8_t ff_ue_golomb_len[256];
-
-extern const uint8_t ff_interleaved_golomb_vlc_len[256];
-extern const uint8_t ff_interleaved_ue_golomb_vlc_code[256];
-extern const int8_t ff_interleaved_se_golomb_vlc_code[256];
-
-
- /**
- * read unsigned exp golomb code.
- */
-static inline int get_ue_golomb(GetBitContext *gb){
- unsigned int buf;
- int log;
-
- OPEN_READER(re, gb);
- UPDATE_CACHE(re, gb);
- buf=GET_CACHE(re, gb);
-
- if(buf >= (1<<27)){
- buf >>= 32 - 9;
- LAST_SKIP_BITS(re, gb, ff_golomb_vlc_len[buf]);
- CLOSE_READER(re, gb);
-
- return ff_ue_golomb_vlc_code[buf];
- }else{
- log= 2*av_log2(buf) - 31;
- buf>>= log;
- buf--;
- LAST_SKIP_BITS(re, gb, 32 - log);
- CLOSE_READER(re, gb);
-
- return buf;
- }
-}
-
-static inline int svq3_get_ue_golomb(GetBitContext *gb){
- uint32_t buf;
- int log;
-
- OPEN_READER(re, gb);
- UPDATE_CACHE(re, gb);
- buf=GET_CACHE(re, gb);
-
- if(buf&0xAA800000){
- buf >>= 32 - 8;
- LAST_SKIP_BITS(re, gb, ff_interleaved_golomb_vlc_len[buf]);
- CLOSE_READER(re, gb);
-
- return ff_interleaved_ue_golomb_vlc_code[buf];
- }else{
- LAST_SKIP_BITS(re, gb, 8);
- UPDATE_CACHE(re, gb);
- buf |= 1 | (GET_CACHE(re, gb) >> 8);
-
- if((buf & 0xAAAAAAAA) == 0)
- return INVALID_VLC;
-
- for(log=31; (buf & 0x80000000) == 0; log--){
- buf = (buf << 2) - ((buf << log) >> (log - 1)) + (buf >> 30);
- }
-
- LAST_SKIP_BITS(re, gb, 63 - 2*log - 8);
- CLOSE_READER(re, gb);
-
- return ((buf << log) >> log) - 1;
- }
-}
-
-/**
- * read unsigned truncated exp golomb code.
- */
-static inline int get_te0_golomb(GetBitContext *gb, int range){
- assert(range >= 1);
-
- if(range==1) return 0;
- else if(range==2) return get_bits1(gb)^1;
- else return get_ue_golomb(gb);
-}
-
-/**
- * read unsigned truncated exp golomb code.
- */
-static inline int get_te_golomb(GetBitContext *gb, int range){
- assert(range >= 1);
-
- if(range==2) return get_bits1(gb)^1;
- else return get_ue_golomb(gb);
-}
-
-
-/**
- * read signed exp golomb code.
- */
-static inline int get_se_golomb(GetBitContext *gb){
- unsigned int buf;
- int log;
-
- OPEN_READER(re, gb);
- UPDATE_CACHE(re, gb);
- buf=GET_CACHE(re, gb);
-
- if(buf >= (1<<27)){
- buf >>= 32 - 9;
- LAST_SKIP_BITS(re, gb, ff_golomb_vlc_len[buf]);
- CLOSE_READER(re, gb);
-
- return ff_se_golomb_vlc_code[buf];
- }else{
- log= 2*av_log2(buf) - 31;
- buf>>= log;
-
- LAST_SKIP_BITS(re, gb, 32 - log);
- CLOSE_READER(re, gb);
-
- if(buf&1) buf= -(buf>>1);
- else buf= (buf>>1);
-
- return buf;
- }
-}
-
-static inline int svq3_get_se_golomb(GetBitContext *gb){
- unsigned int buf;
- int log;
-
- OPEN_READER(re, gb);
- UPDATE_CACHE(re, gb);
- buf=GET_CACHE(re, gb);
-
- if(buf&0xAA800000){
- buf >>= 32 - 8;
- LAST_SKIP_BITS(re, gb, ff_interleaved_golomb_vlc_len[buf]);
- CLOSE_READER(re, gb);
-
- return ff_interleaved_se_golomb_vlc_code[buf];
- }else{
- LAST_SKIP_BITS(re, gb, 8);
- UPDATE_CACHE(re, gb);
- buf |= 1 | (GET_CACHE(re, gb) >> 8);
-
- if((buf & 0xAAAAAAAA) == 0)
- return INVALID_VLC;
-
- for(log=31; (buf & 0x80000000) == 0; log--){
- buf = (buf << 2) - ((buf << log) >> (log - 1)) + (buf >> 30);
- }
-
- LAST_SKIP_BITS(re, gb, 63 - 2*log - 8);
- CLOSE_READER(re, gb);
-
- return (signed) (((((buf << log) >> log) - 1) ^ -(buf & 0x1)) + 1) >> 1;
- }
-}
-
-/**
- * read unsigned golomb rice code (ffv1).
- */
-static inline int get_ur_golomb(GetBitContext *gb, int k, int limit, int esc_len){
- unsigned int buf;
- int log;
-
- OPEN_READER(re, gb);
- UPDATE_CACHE(re, gb);
- buf=GET_CACHE(re, gb);
-
- log= av_log2(buf);
-
- if(log > 31-limit){
- buf >>= log - k;
- buf += (30-log)<<k;
- LAST_SKIP_BITS(re, gb, 32 + k - log);
- CLOSE_READER(re, gb);
-
- return buf;
- }else{
- buf >>= 32 - limit - esc_len;
- LAST_SKIP_BITS(re, gb, esc_len + limit);
- CLOSE_READER(re, gb);
-
- return buf + limit - 1;
- }
-}
-
-/**
- * read unsigned golomb rice code (jpegls).
- */
-static inline int get_ur_golomb_jpegls(GetBitContext *gb, int k, int limit, int esc_len){
- unsigned int buf;
- int log;
-
- OPEN_READER(re, gb);
- UPDATE_CACHE(re, gb);
- buf=GET_CACHE(re, gb);
-
- log= av_log2(buf);
-
- if(log > 31-11){
- buf >>= log - k;
- buf += (30-log)<<k;
- LAST_SKIP_BITS(re, gb, 32 + k - log);
- CLOSE_READER(re, gb);
-
- return buf;
- }else{
- int i;
- for(i=0; SHOW_UBITS(re, gb, 1) == 0; i++){
- LAST_SKIP_BITS(re, gb, 1);
- UPDATE_CACHE(re, gb);
- }
- SKIP_BITS(re, gb, 1);
-
- if(i < limit - 1){
- if(k){
- buf = SHOW_UBITS(re, gb, k);
- LAST_SKIP_BITS(re, gb, k);
- }else{
- buf=0;
- }
-
- CLOSE_READER(re, gb);
- return buf + (i<<k);
- }else if(i == limit - 1){
- buf = SHOW_UBITS(re, gb, esc_len);
- LAST_SKIP_BITS(re, gb, esc_len);
- CLOSE_READER(re, gb);
-
- return buf + 1;
- }else
- return -1;
- }
-}
-
-/**
- * read signed golomb rice code (ffv1).
- */
-static inline int get_sr_golomb(GetBitContext *gb, int k, int limit, int esc_len){
- int v= get_ur_golomb(gb, k, limit, esc_len);
-
- v++;
- if (v&1) return v>>1;
- else return -(v>>1);
-
-// return (v>>1) ^ -(v&1);
-}
-
-/**
- * read signed golomb rice code (flac).
- */
-static inline int get_sr_golomb_flac(GetBitContext *gb, int k, int limit, int esc_len){
- int v= get_ur_golomb_jpegls(gb, k, limit, esc_len);
- return (v>>1) ^ -(v&1);
-}
-
-/**
- * read unsigned golomb rice code (shorten).
- */
-static inline unsigned int get_ur_golomb_shorten(GetBitContext *gb, int k){
- return get_ur_golomb_jpegls(gb, k, INT_MAX, 0);
-}
-
-/**
- * read signed golomb rice code (shorten).
- */
-static inline int get_sr_golomb_shorten(GetBitContext* gb, int k)
-{
- int uvar = get_ur_golomb_jpegls(gb, k + 1, INT_MAX, 0);
- if (uvar & 1)
- return ~(uvar >> 1);
- else
- return uvar >> 1;
-}
-
-
-
-#ifdef TRACE
-
-static inline int get_ue(GetBitContext *s, char *file, const char *func, int line){
- int show= show_bits(s, 24);
- int pos= get_bits_count(s);
- int i= get_ue_golomb(s);
- int len= get_bits_count(s) - pos;
- int bits= show>>(24-len);
-
- print_bin(bits, len);
-
- av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d ue @%5d in %s %s:%d\n", bits, len, i, pos, file, func, line);
-
- return i;
-}
-
-static inline int get_se(GetBitContext *s, char *file, const char *func, int line){
- int show= show_bits(s, 24);
- int pos= get_bits_count(s);
- int i= get_se_golomb(s);
- int len= get_bits_count(s) - pos;
- int bits= show>>(24-len);
-
- print_bin(bits, len);
-
- av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d se @%5d in %s %s:%d\n", bits, len, i, pos, file, func, line);
-
- return i;
-}
-
-static inline int get_te(GetBitContext *s, int r, char *file, const char *func, int line){
- int show= show_bits(s, 24);
- int pos= get_bits_count(s);
- int i= get_te0_golomb(s, r);
- int len= get_bits_count(s) - pos;
- int bits= show>>(24-len);
-
- print_bin(bits, len);
-
- av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d te @%5d in %s %s:%d\n", bits, len, i, pos, file, func, line);
-
- return i;
-}
-
-#define get_ue_golomb(a) get_ue(a, __FILE__, __PRETTY_FUNCTION__, __LINE__)
-#define get_se_golomb(a) get_se(a, __FILE__, __PRETTY_FUNCTION__, __LINE__)
-#define get_te_golomb(a, r) get_te(a, r, __FILE__, __PRETTY_FUNCTION__, __LINE__)
-#define get_te0_golomb(a, r) get_te(a, r, __FILE__, __PRETTY_FUNCTION__, __LINE__)
-
-#endif
-
-/**
- * write unsigned exp golomb code.
- */
-static inline void set_ue_golomb(PutBitContext *pb, int i){
- int e;
-
- assert(i>=0);
-
-#if 0
- if(i=0){
- put_bits(pb, 1, 1);
- return;
- }
-#endif
- if(i<256)
- put_bits(pb, ff_ue_golomb_len[i], i+1);
- else{
- e= av_log2(i+1);
-
- put_bits(pb, 2*e+1, i+1);
- }
-}
-
-/**
- * write truncated unsigned exp golomb code.
- */
-static inline void set_te_golomb(PutBitContext *pb, int i, int range){
- assert(range >= 1);
- assert(i<=range);
-
- if(range==2) put_bits(pb, 1, i^1);
- else set_ue_golomb(pb, i);
-}
-
-/**
- * write signed exp golomb code. 16 bits at most.
- */
-static inline void set_se_golomb(PutBitContext *pb, int i){
-// if (i>32767 || i<-32767)
-// av_log(NULL,AV_LOG_ERROR,"value out of range %d\n", i);
-#if 0
- if(i<=0) i= -2*i;
- else i= 2*i-1;
-#elif 1
- i= 2*i-1;
- if(i<0) i^= -1; //FIXME check if gcc does the right thing
-#else
- i= 2*i-1;
- i^= (i>>31);
-#endif
- set_ue_golomb(pb, i);
-}
-
-/**
- * write unsigned golomb rice code (ffv1).
- */
-static inline void set_ur_golomb(PutBitContext *pb, int i, int k, int limit, int esc_len){
- int e;
-
- assert(i>=0);
-
- e= i>>k;
- if(e<limit){
- put_bits(pb, e + k + 1, (1<<k) + (i&((1<<k)-1)));
- }else{
- put_bits(pb, limit + esc_len, i - limit + 1);
- }
-}
-
-/**
- * write unsigned golomb rice code (jpegls).
- */
-static inline void set_ur_golomb_jpegls(PutBitContext *pb, int i, int k, int limit, int esc_len){
- int e;
-
- assert(i>=0);
-
- e= (i>>k) + 1;
- if(e<limit){
- while(e > 31) {
- put_bits(pb, 31, 0);
- e -= 31;
- }
- put_bits(pb, e, 1);
- if(k)
- put_bits(pb, k, i&((1<<k)-1));
- }else{
- while(limit > 31) {
- put_bits(pb, 31, 0);
- limit -= 31;
- }
- put_bits(pb, limit , 1);
- put_bits(pb, esc_len, i - 1);
- }
-}
-
-/**
- * write signed golomb rice code (ffv1).
- */
-static inline void set_sr_golomb(PutBitContext *pb, int i, int k, int limit, int esc_len){
- int v;
-
- v = -2*i-1;
- v ^= (v>>31);
-
- set_ur_golomb(pb, v, k, limit, esc_len);
-}
-
-/**
- * write signed golomb rice code (flac).
- */
-static inline void set_sr_golomb_flac(PutBitContext *pb, int i, int k, int limit, int esc_len){
- int v;
-
- v = -2*i-1;
- v ^= (v>>31);
-
- set_ur_golomb_jpegls(pb, v, k, limit, esc_len);
-}
diff --git a/src/libffmpeg/libavcodec/h261.c b/src/libffmpeg/libavcodec/h261.c
deleted file mode 100644
index 8d4ca08cd..000000000
--- a/src/libffmpeg/libavcodec/h261.c
+++ /dev/null
@@ -1,1055 +0,0 @@
-/*
- * H261 decoder
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
- * Copyright (c) 2004 Maarten Daniels
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file h261.c
- * h261codec.
- */
-
-#include "common.h"
-#include "dsputil.h"
-#include "avcodec.h"
-#include "mpegvideo.h"
-#include "h261data.h"
-
-
-#define H261_MBA_VLC_BITS 9
-#define H261_MTYPE_VLC_BITS 6
-#define H261_MV_VLC_BITS 7
-#define H261_CBP_VLC_BITS 9
-#define TCOEFF_VLC_BITS 9
-
-#define MBA_STUFFING 33
-#define MBA_STARTCODE 34
-#define IS_FIL(a) ((a)&MB_TYPE_H261_FIL)
-
-/**
- * H261Context
- */
-typedef struct H261Context{
- MpegEncContext s;
-
- int current_mba;
- int previous_mba;
- int mba_diff;
- int mtype;
- int current_mv_x;
- int current_mv_y;
- int gob_number;
- int gob_start_code_skipped; // 1 if gob start code is already read before gob header is read
-}H261Context;
-
-void ff_h261_loop_filter(MpegEncContext *s){
- H261Context * h= (H261Context*)s;
- const int linesize = s->linesize;
- const int uvlinesize= s->uvlinesize;
- uint8_t *dest_y = s->dest[0];
- uint8_t *dest_cb= s->dest[1];
- uint8_t *dest_cr= s->dest[2];
-
- if(!(IS_FIL (h->mtype)))
- return;
-
- s->dsp.h261_loop_filter(dest_y , linesize);
- s->dsp.h261_loop_filter(dest_y + 8, linesize);
- s->dsp.h261_loop_filter(dest_y + 8 * linesize , linesize);
- s->dsp.h261_loop_filter(dest_y + 8 * linesize + 8, linesize);
- s->dsp.h261_loop_filter(dest_cb, uvlinesize);
- s->dsp.h261_loop_filter(dest_cr, uvlinesize);
-}
-
-int ff_h261_get_picture_format(int width, int height){
- // QCIF
- if (width == 176 && height == 144)
- return 0;
- // CIF
- else if (width == 352 && height == 288)
- return 1;
- // ERROR
- else
- return -1;
-}
-
-static void h261_encode_block(H261Context * h, DCTELEM * block,
- int n);
-static int h261_decode_block(H261Context *h, DCTELEM *block,
- int n, int coded);
-
-void ff_h261_encode_picture_header(MpegEncContext * s, int picture_number){
- H261Context * h = (H261Context *) s;
- int format, temp_ref;
-
- align_put_bits(&s->pb);
-
- /* Update the pointer to last GOB */
- s->ptr_lastgob = pbBufPtr(&s->pb);
-
- put_bits(&s->pb, 20, 0x10); /* PSC */
-
- temp_ref= s->picture_number * (int64_t)30000 * s->avctx->time_base.num /
- (1001 * (int64_t)s->avctx->time_base.den); //FIXME maybe this should use a timestamp
- put_bits(&s->pb, 5, temp_ref & 0x1f); /* TemporalReference */
-
- put_bits(&s->pb, 1, 0); /* split screen off */
- put_bits(&s->pb, 1, 0); /* camera off */
- put_bits(&s->pb, 1, 0); /* freeze picture release off */
-
- format = ff_h261_get_picture_format(s->width, s->height);
-
- put_bits(&s->pb, 1, format); /* 0 == QCIF, 1 == CIF */
-
- put_bits(&s->pb, 1, 0); /* still image mode */
- put_bits(&s->pb, 1, 0); /* reserved */
-
- put_bits(&s->pb, 1, 0); /* no PEI */
- if(format == 0)
- h->gob_number = -1;
- else
- h->gob_number = 0;
- h->current_mba = 0;
-}
-
-/**
- * Encodes a group of blocks header.
- */
-static void h261_encode_gob_header(MpegEncContext * s, int mb_line){
- H261Context * h = (H261Context *)s;
- if(ff_h261_get_picture_format(s->width, s->height) == 0){
- h->gob_number+=2; // QCIF
- }
- else{
- h->gob_number++; // CIF
- }
- put_bits(&s->pb, 16, 1); /* GBSC */
- put_bits(&s->pb, 4, h->gob_number); /* GN */
- put_bits(&s->pb, 5, s->qscale); /* GQUANT */
- put_bits(&s->pb, 1, 0); /* no GEI */
- h->current_mba = 0;
- h->previous_mba = 0;
- h->current_mv_x=0;
- h->current_mv_y=0;
-}
-
-void ff_h261_reorder_mb_index(MpegEncContext* s){
- int index= s->mb_x + s->mb_y*s->mb_width;
-
- if(index % 33 == 0)
- h261_encode_gob_header(s,0);
-
- /* for CIF the GOB's are fragmented in the middle of a scanline
- that's why we need to adjust the x and y index of the macroblocks */
- if(ff_h261_get_picture_format(s->width,s->height) == 1){ // CIF
- s->mb_x = index % 11 ; index /= 11;
- s->mb_y = index % 3 ; index /= 3;
- s->mb_x+= 11*(index % 2); index /= 2;
- s->mb_y+= 3*index;
-
- ff_init_block_index(s);
- ff_update_block_index(s);
- }
-}
-
-static void h261_encode_motion(H261Context * h, int val){
- MpegEncContext * const s = &h->s;
- int sign, code;
- if(val==0){
- code = 0;
- put_bits(&s->pb,h261_mv_tab[code][1],h261_mv_tab[code][0]);
- }
- else{
- if(val > 15)
- val -=32;
- if(val < -16)
- val+=32;
- sign = val < 0;
- code = sign ? -val : val;
- put_bits(&s->pb,h261_mv_tab[code][1],h261_mv_tab[code][0]);
- put_bits(&s->pb,1,sign);
- }
-}
-
-static inline int get_cbp(MpegEncContext * s,
- DCTELEM block[6][64])
-{
- int i, cbp;
- cbp= 0;
- for (i = 0; i < 6; i++) {
- if (s->block_last_index[i] >= 0)
- cbp |= 1 << (5 - i);
- }
- return cbp;
-}
-void ff_h261_encode_mb(MpegEncContext * s,
- DCTELEM block[6][64],
- int motion_x, int motion_y)
-{
- H261Context * h = (H261Context *)s;
- int mvd, mv_diff_x, mv_diff_y, i, cbp;
- cbp = 63; // avoid warning
- mvd = 0;
-
- h->current_mba++;
- h->mtype = 0;
-
- if (!s->mb_intra){
- /* compute cbp */
- cbp= get_cbp(s, block);
-
- /* mvd indicates if this block is motion compensated */
- mvd = motion_x | motion_y;
-
- if((cbp | mvd | s->dquant ) == 0) {
- /* skip macroblock */
- s->skip_count++;
- h->current_mv_x=0;
- h->current_mv_y=0;
- return;
- }
- }
-
- /* MB is not skipped, encode MBA */
- put_bits(&s->pb, h261_mba_bits[(h->current_mba-h->previous_mba)-1], h261_mba_code[(h->current_mba-h->previous_mba)-1]);
-
- /* calculate MTYPE */
- if(!s->mb_intra){
- h->mtype++;
-
- if(mvd || s->loop_filter)
- h->mtype+=3;
- if(s->loop_filter)
- h->mtype+=3;
- if(cbp || s->dquant)
- h->mtype++;
- assert(h->mtype > 1);
- }
-
- if(s->dquant)
- h->mtype++;
-
- put_bits(&s->pb, h261_mtype_bits[h->mtype], h261_mtype_code[h->mtype]);
-
- h->mtype = h261_mtype_map[h->mtype];
-
- if(IS_QUANT(h->mtype)){
- ff_set_qscale(s,s->qscale+s->dquant);
- put_bits(&s->pb, 5, s->qscale);
- }
-
- if(IS_16X16(h->mtype)){
- mv_diff_x = (motion_x >> 1) - h->current_mv_x;
- mv_diff_y = (motion_y >> 1) - h->current_mv_y;
- h->current_mv_x = (motion_x >> 1);
- h->current_mv_y = (motion_y >> 1);
- h261_encode_motion(h,mv_diff_x);
- h261_encode_motion(h,mv_diff_y);
- }
-
- h->previous_mba = h->current_mba;
-
- if(HAS_CBP(h->mtype)){
- assert(cbp>0);
- put_bits(&s->pb,h261_cbp_tab[cbp-1][1],h261_cbp_tab[cbp-1][0]);
- }
- for(i=0; i<6; i++) {
- /* encode each block */
- h261_encode_block(h, block[i], i);
- }
-
- if ( ( h->current_mba == 11 ) || ( h->current_mba == 22 ) || ( h->current_mba == 33 ) || ( !IS_16X16 ( h->mtype ) )){
- h->current_mv_x=0;
- h->current_mv_y=0;
- }
-}
-
-void ff_h261_encode_init(MpegEncContext *s){
- static int done = 0;
-
- if (!done) {
- done = 1;
- init_rl(&h261_rl_tcoeff, 1);
- }
-
- s->min_qcoeff= -127;
- s->max_qcoeff= 127;
- s->y_dc_scale_table=
- s->c_dc_scale_table= ff_mpeg1_dc_scale_table;
-}
-
-
-/**
- * encodes a 8x8 block.
- * @param block the 8x8 block
- * @param n block index (0-3 are luma, 4-5 are chroma)
- */
-static void h261_encode_block(H261Context * h, DCTELEM * block, int n){
- MpegEncContext * const s = &h->s;
- int level, run, last, i, j, last_index, last_non_zero, sign, slevel, code;
- RLTable *rl;
-
- rl = &h261_rl_tcoeff;
- if (s->mb_intra) {
- /* DC coef */
- level = block[0];
- /* 255 cannot be represented, so we clamp */
- if (level > 254) {
- level = 254;
- block[0] = 254;
- }
- /* 0 cannot be represented also */
- else if (level < 1) {
- level = 1;
- block[0] = 1;
- }
- if (level == 128)
- put_bits(&s->pb, 8, 0xff);
- else
- put_bits(&s->pb, 8, level);
- i = 1;
- } else if((block[0]==1 || block[0] == -1) && (s->block_last_index[n] > -1)){
- //special case
- put_bits(&s->pb,2,block[0]>0 ? 2 : 3 );
- i = 1;
- } else {
- i = 0;
- }
-
- /* AC coefs */
- last_index = s->block_last_index[n];
- last_non_zero = i - 1;
- for (; i <= last_index; i++) {
- j = s->intra_scantable.permutated[i];
- level = block[j];
- if (level) {
- run = i - last_non_zero - 1;
- last = (i == last_index);
- sign = 0;
- slevel = level;
- if (level < 0) {
- sign = 1;
- level = -level;
- }
- code = get_rl_index(rl, 0 /*no last in H.261, EOB is used*/, run, level);
- if(run==0 && level < 16)
- code+=1;
- put_bits(&s->pb, rl->table_vlc[code][1], rl->table_vlc[code][0]);
- if (code == rl->n) {
- put_bits(&s->pb, 6, run);
- assert(slevel != 0);
- assert(level <= 127);
- put_bits(&s->pb, 8, slevel & 0xff);
- } else {
- put_bits(&s->pb, 1, sign);
- }
- last_non_zero = i;
- }
- }
- if(last_index > -1){
- put_bits(&s->pb, rl->table_vlc[0][1], rl->table_vlc[0][0]);// END OF BLOCK
- }
-}
-
-/***********************************************/
-/* decoding */
-
-static VLC h261_mba_vlc;
-static VLC h261_mtype_vlc;
-static VLC h261_mv_vlc;
-static VLC h261_cbp_vlc;
-
-static void h261_decode_init_vlc(H261Context *h){
- static int done = 0;
-
- if(!done){
- done = 1;
- init_vlc(&h261_mba_vlc, H261_MBA_VLC_BITS, 35,
- h261_mba_bits, 1, 1,
- h261_mba_code, 1, 1, 1);
- init_vlc(&h261_mtype_vlc, H261_MTYPE_VLC_BITS, 10,
- h261_mtype_bits, 1, 1,
- h261_mtype_code, 1, 1, 1);
- init_vlc(&h261_mv_vlc, H261_MV_VLC_BITS, 17,
- &h261_mv_tab[0][1], 2, 1,
- &h261_mv_tab[0][0], 2, 1, 1);
- init_vlc(&h261_cbp_vlc, H261_CBP_VLC_BITS, 63,
- &h261_cbp_tab[0][1], 2, 1,
- &h261_cbp_tab[0][0], 2, 1, 1);
- init_rl(&h261_rl_tcoeff, 1);
- init_vlc_rl(&h261_rl_tcoeff, 1);
- }
-}
-
-static int h261_decode_init(AVCodecContext *avctx){
- H261Context *h= avctx->priv_data;
- MpegEncContext * const s = &h->s;
-
- // set defaults
- MPV_decode_defaults(s);
- s->avctx = avctx;
-
- s->width = s->avctx->coded_width;
- s->height = s->avctx->coded_height;
- s->codec_id = s->avctx->codec->id;
-
- s->out_format = FMT_H261;
- s->low_delay= 1;
- avctx->pix_fmt= PIX_FMT_YUV420P;
-
- s->codec_id= avctx->codec->id;
-
- h261_decode_init_vlc(h);
-
- h->gob_start_code_skipped = 0;
-
- return 0;
-}
-
-/**
- * decodes the group of blocks header or slice header.
- * @return <0 if an error occured
- */
-static int h261_decode_gob_header(H261Context *h){
- unsigned int val;
- MpegEncContext * const s = &h->s;
-
- if ( !h->gob_start_code_skipped ){
- /* Check for GOB Start Code */
- val = show_bits(&s->gb, 15);
- if(val)
- return -1;
-
- /* We have a GBSC */
- skip_bits(&s->gb, 16);
- }
-
- h->gob_start_code_skipped = 0;
-
- h->gob_number = get_bits(&s->gb, 4); /* GN */
- s->qscale = get_bits(&s->gb, 5); /* GQUANT */
-
- /* Check if gob_number is valid */
- if (s->mb_height==18){ //cif
- if ((h->gob_number<=0) || (h->gob_number>12))
- return -1;
- }
- else{ //qcif
- if ((h->gob_number!=1) && (h->gob_number!=3) && (h->gob_number!=5))
- return -1;
- }
-
- /* GEI */
- while (get_bits1(&s->gb) != 0) {
- skip_bits(&s->gb, 8);
- }
-
- if(s->qscale==0)
- return -1;
-
- // For the first transmitted macroblock in a GOB, MBA is the absolute address. For
- // subsequent macroblocks, MBA is the difference between the absolute addresses of
- // the macroblock and the last transmitted macroblock.
- h->current_mba = 0;
- h->mba_diff = 0;
-
- return 0;
-}
-
-/**
- * decodes the group of blocks / video packet header.
- * @return <0 if no resync found
- */
-static int ff_h261_resync(H261Context *h){
- MpegEncContext * const s = &h->s;
- int left, ret;
-
- if ( h->gob_start_code_skipped ){
- ret= h261_decode_gob_header(h);
- if(ret>=0)
- return 0;
- }
- else{
- if(show_bits(&s->gb, 15)==0){
- ret= h261_decode_gob_header(h);
- if(ret>=0)
- return 0;
- }
- //ok, its not where its supposed to be ...
- s->gb= s->last_resync_gb;
- align_get_bits(&s->gb);
- left= s->gb.size_in_bits - get_bits_count(&s->gb);
-
- for(;left>15+1+4+5; left-=8){
- if(show_bits(&s->gb, 15)==0){
- GetBitContext bak= s->gb;
-
- ret= h261_decode_gob_header(h);
- if(ret>=0)
- return 0;
-
- s->gb= bak;
- }
- skip_bits(&s->gb, 8);
- }
- }
-
- return -1;
-}
-
-/**
- * decodes skipped macroblocks
- * @return 0
- */
-static int h261_decode_mb_skipped(H261Context *h, int mba1, int mba2 )
-{
- MpegEncContext * const s = &h->s;
- int i;
-
- s->mb_intra = 0;
-
- for(i=mba1; i<mba2; i++){
- int j, xy;
-
- s->mb_x= ((h->gob_number-1) % 2) * 11 + i % 11;
- s->mb_y= ((h->gob_number-1) / 2) * 3 + i / 11;
- xy = s->mb_x + s->mb_y * s->mb_stride;
- ff_init_block_index(s);
- ff_update_block_index(s);
-
- for(j=0;j<6;j++)
- s->block_last_index[j] = -1;
-
- s->mv_dir = MV_DIR_FORWARD;
- s->mv_type = MV_TYPE_16X16;
- s->current_picture.mb_type[xy]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0;
- s->mv[0][0][0] = 0;
- s->mv[0][0][1] = 0;
- s->mb_skipped = 1;
- h->mtype &= ~MB_TYPE_H261_FIL;
-
- MPV_decode_mb(s, s->block);
- }
-
- return 0;
-}
-
-static int decode_mv_component(GetBitContext *gb, int v){
- int mv_diff = get_vlc2(gb, h261_mv_vlc.table, H261_MV_VLC_BITS, 2);
-
- /* check if mv_diff is valid */
- if ( mv_diff < 0 )
- return v;
-
- mv_diff = mvmap[mv_diff];
-
- if(mv_diff && !get_bits1(gb))
- mv_diff= -mv_diff;
-
- v += mv_diff;
- if (v <=-16) v+= 32;
- else if(v >= 16) v-= 32;
-
- return v;
-}
-
-static int h261_decode_mb(H261Context *h){
- MpegEncContext * const s = &h->s;
- int i, cbp, xy;
-
- cbp = 63;
- // Read mba
- do{
- h->mba_diff = get_vlc2(&s->gb, h261_mba_vlc.table, H261_MBA_VLC_BITS, 2);
-
- /* Check for slice end */
- /* NOTE: GOB can be empty (no MB data) or exist only of MBA_stuffing */
- if (h->mba_diff == MBA_STARTCODE){ // start code
- h->gob_start_code_skipped = 1;
- return SLICE_END;
- }
- }
- while( h->mba_diff == MBA_STUFFING ); // stuffing
-
- if ( h->mba_diff < 0 ){
- if ( get_bits_count(&s->gb) + 7 >= s->gb.size_in_bits )
- return SLICE_END;
-
- av_log(s->avctx, AV_LOG_ERROR, "illegal mba at %d %d\n", s->mb_x, s->mb_y);
- return SLICE_ERROR;
- }
-
- h->mba_diff += 1;
- h->current_mba += h->mba_diff;
-
- if ( h->current_mba > MBA_STUFFING )
- return SLICE_ERROR;
-
- s->mb_x= ((h->gob_number-1) % 2) * 11 + ((h->current_mba-1) % 11);
- s->mb_y= ((h->gob_number-1) / 2) * 3 + ((h->current_mba-1) / 11);
- xy = s->mb_x + s->mb_y * s->mb_stride;
- ff_init_block_index(s);
- ff_update_block_index(s);
-
- // Read mtype
- h->mtype = get_vlc2(&s->gb, h261_mtype_vlc.table, H261_MTYPE_VLC_BITS, 2);
- h->mtype = h261_mtype_map[h->mtype];
-
- // Read mquant
- if ( IS_QUANT ( h->mtype ) ){
- ff_set_qscale(s, get_bits(&s->gb, 5));
- }
-
- s->mb_intra = IS_INTRA4x4(h->mtype);
-
- // Read mv
- if ( IS_16X16 ( h->mtype ) ){
- // Motion vector data is included for all MC macroblocks. MVD is obtained from the macroblock vector by subtracting the
- // vector of the preceding macroblock. For this calculation the vector of the preceding macroblock is regarded as zero in the
- // following three situations:
- // 1) evaluating MVD for macroblocks 1, 12 and 23;
- // 2) evaluating MVD for macroblocks in which MBA does not represent a difference of 1;
- // 3) MTYPE of the previous macroblock was not MC.
- if ( ( h->current_mba == 1 ) || ( h->current_mba == 12 ) || ( h->current_mba == 23 ) ||
- ( h->mba_diff != 1))
- {
- h->current_mv_x = 0;
- h->current_mv_y = 0;
- }
-
- h->current_mv_x= decode_mv_component(&s->gb, h->current_mv_x);
- h->current_mv_y= decode_mv_component(&s->gb, h->current_mv_y);
- }else{
- h->current_mv_x = 0;
- h->current_mv_y = 0;
- }
-
- // Read cbp
- if ( HAS_CBP( h->mtype ) ){
- cbp = get_vlc2(&s->gb, h261_cbp_vlc.table, H261_CBP_VLC_BITS, 2) + 1;
- }
-
- if(s->mb_intra){
- s->current_picture.mb_type[xy]= MB_TYPE_INTRA;
- goto intra;
- }
-
- //set motion vectors
- s->mv_dir = MV_DIR_FORWARD;
- s->mv_type = MV_TYPE_16X16;
- s->current_picture.mb_type[xy]= MB_TYPE_16x16 | MB_TYPE_L0;
- s->mv[0][0][0] = h->current_mv_x * 2;//gets divided by 2 in motion compensation
- s->mv[0][0][1] = h->current_mv_y * 2;
-
-intra:
- /* decode each block */
- if(s->mb_intra || HAS_CBP(h->mtype)){
- s->dsp.clear_blocks(s->block[0]);
- for (i = 0; i < 6; i++) {
- if (h261_decode_block(h, s->block[i], i, cbp&32) < 0){
- return SLICE_ERROR;
- }
- cbp+=cbp;
- }
- }else{
- for (i = 0; i < 6; i++)
- s->block_last_index[i]= -1;
- }
-
- MPV_decode_mb(s, s->block);
-
- return SLICE_OK;
-}
-
-/**
- * decodes a macroblock
- * @return <0 if an error occured
- */
-static int h261_decode_block(H261Context * h, DCTELEM * block,
- int n, int coded)
-{
- MpegEncContext * const s = &h->s;
- int code, level, i, j, run;
- RLTable *rl = &h261_rl_tcoeff;
- const uint8_t *scan_table;
-
- // For the variable length encoding there are two code tables, one being used for
- // the first transmitted LEVEL in INTER, INTER+MC and INTER+MC+FIL blocks, the second
- // for all other LEVELs except the first one in INTRA blocks which is fixed length
- // coded with 8 bits.
- // NOTE: the two code tables only differ in one VLC so we handle that manually.
- scan_table = s->intra_scantable.permutated;
- if (s->mb_intra){
- /* DC coef */
- level = get_bits(&s->gb, 8);
- // 0 (00000000b) and -128 (10000000b) are FORBIDDEN
- if((level&0x7F) == 0){
- av_log(s->avctx, AV_LOG_ERROR, "illegal dc %d at %d %d\n", level, s->mb_x, s->mb_y);
- return -1;
- }
- // The code 1000 0000 is not used, the reconstruction level of 1024 being coded as 1111 1111.
- if (level == 255)
- level = 128;
- block[0] = level;
- i = 1;
- }else if(coded){
- // Run Level Code
- // EOB Not possible for first level when cbp is available (that's why the table is different)
- // 0 1 1s
- // * * 0*
- int check = show_bits(&s->gb, 2);
- i = 0;
- if ( check & 0x2 ){
- skip_bits(&s->gb, 2);
- block[0] = ( check & 0x1 ) ? -1 : 1;
- i = 1;
- }
- }else{
- i = 0;
- }
- if(!coded){
- s->block_last_index[n] = i - 1;
- return 0;
- }
- for(;;){
- code = get_vlc2(&s->gb, rl->vlc.table, TCOEFF_VLC_BITS, 2);
- if (code < 0){
- av_log(s->avctx, AV_LOG_ERROR, "illegal ac vlc code at %dx%d\n", s->mb_x, s->mb_y);
- return -1;
- }
- if (code == rl->n) {
- /* escape */
- // The remaining combinations of (run, level) are encoded with a 20-bit word consisting of 6 bits escape, 6 bits run and 8 bits level.
- run = get_bits(&s->gb, 6);
- level = get_sbits(&s->gb, 8);
- }else if(code == 0){
- break;
- }else{
- run = rl->table_run[code];
- level = rl->table_level[code];
- if (get_bits1(&s->gb))
- level = -level;
- }
- i += run;
- if (i >= 64){
- av_log(s->avctx, AV_LOG_ERROR, "run overflow at %dx%d\n", s->mb_x, s->mb_y);
- return -1;
- }
- j = scan_table[i];
- block[j] = level;
- i++;
- }
- s->block_last_index[n] = i-1;
- return 0;
-}
-
-/**
- * decodes the H261 picture header.
- * @return <0 if no startcode found
- */
-static int h261_decode_picture_header(H261Context *h){
- MpegEncContext * const s = &h->s;
- int format, i;
- uint32_t startcode= 0;
-
- for(i= s->gb.size_in_bits - get_bits_count(&s->gb); i>24; i-=1){
- startcode = ((startcode << 1) | get_bits(&s->gb, 1)) & 0x000FFFFF;
-
- if(startcode == 0x10)
- break;
- }
-
- if (startcode != 0x10){
- av_log(s->avctx, AV_LOG_ERROR, "Bad picture start code\n");
- return -1;
- }
-
- /* temporal reference */
- i= get_bits(&s->gb, 5); /* picture timestamp */
- if(i < (s->picture_number&31))
- i += 32;
- s->picture_number = (s->picture_number&~31) + i;
-
- s->avctx->time_base= (AVRational){1001, 30000};
- s->current_picture.pts= s->picture_number;
-
-
- /* PTYPE starts here */
- skip_bits1(&s->gb); /* split screen off */
- skip_bits1(&s->gb); /* camera off */
- skip_bits1(&s->gb); /* freeze picture release off */
-
- format = get_bits1(&s->gb);
-
- //only 2 formats possible
- if (format == 0){//QCIF
- s->width = 176;
- s->height = 144;
- s->mb_width = 11;
- s->mb_height = 9;
- }else{//CIF
- s->width = 352;
- s->height = 288;
- s->mb_width = 22;
- s->mb_height = 18;
- }
-
- s->mb_num = s->mb_width * s->mb_height;
-
- skip_bits1(&s->gb); /* still image mode off */
- skip_bits1(&s->gb); /* Reserved */
-
- /* PEI */
- while (get_bits1(&s->gb) != 0){
- skip_bits(&s->gb, 8);
- }
-
- // h261 has no I-FRAMES, but if we pass I_TYPE for the first frame, the codec crashes if it does
- // not contain all I-blocks (e.g. when a packet is lost)
- s->pict_type = P_TYPE;
-
- h->gob_number = 0;
- return 0;
-}
-
-static int h261_decode_gob(H261Context *h){
- MpegEncContext * const s = &h->s;
-
- ff_set_qscale(s, s->qscale);
-
- /* decode mb's */
- while(h->current_mba <= MBA_STUFFING)
- {
- int ret;
- /* DCT & quantize */
- ret= h261_decode_mb(h);
- if(ret<0){
- if(ret==SLICE_END){
- h261_decode_mb_skipped(h, h->current_mba, 33);
- return 0;
- }
- av_log(s->avctx, AV_LOG_ERROR, "Error at MB: %d\n", s->mb_x + s->mb_y*s->mb_stride);
- return -1;
- }
-
- h261_decode_mb_skipped(h, h->current_mba-h->mba_diff, h->current_mba-1);
- }
-
- return -1;
-}
-
-#ifdef CONFIG_H261_PARSER
-static int h261_find_frame_end(ParseContext *pc, AVCodecContext* avctx, const uint8_t *buf, int buf_size){
- int vop_found, i, j;
- uint32_t state;
-
- vop_found= pc->frame_start_found;
- state= pc->state;
-
- for(i=0; i<buf_size && !vop_found; i++){
- state= (state<<8) | buf[i];
- for(j=0; j<8; j++){
- if(((state>>j)&0xFFFFF) == 0x00010){
- vop_found=1;
- break;
- }
- }
- }
- if(vop_found){
- for(; i<buf_size; i++){
- state= (state<<8) | buf[i];
- for(j=0; j<8; j++){
- if(((state>>j)&0xFFFFF) == 0x00010){
- pc->frame_start_found=0;
- pc->state= state>>(2*8);
- return i-1;
- }
- }
- }
- }
-
- pc->frame_start_found= vop_found;
- pc->state= state;
- return END_NOT_FOUND;
-}
-
-static int h261_parse(AVCodecParserContext *s,
- AVCodecContext *avctx,
- uint8_t **poutbuf, int *poutbuf_size,
- const uint8_t *buf, int buf_size)
-{
- ParseContext *pc = s->priv_data;
- int next;
-
- next= h261_find_frame_end(pc,avctx, buf, buf_size);
- if (ff_combine_frame(pc, next, (uint8_t **)&buf, &buf_size) < 0) {
- *poutbuf = NULL;
- *poutbuf_size = 0;
- return buf_size;
- }
- *poutbuf = (uint8_t *)buf;
- *poutbuf_size = buf_size;
- return next;
-}
-#endif
-
-/**
- * returns the number of bytes consumed for building the current frame
- */
-static int get_consumed_bytes(MpegEncContext *s, int buf_size){
- int pos= get_bits_count(&s->gb)>>3;
- if(pos==0) pos=1; //avoid infinite loops (i doubt thats needed but ...)
- if(pos+10>buf_size) pos=buf_size; // oops ;)
-
- return pos;
-}
-
-static int h261_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- H261Context *h= avctx->priv_data;
- MpegEncContext *s = &h->s;
- int ret;
- AVFrame *pict = data;
-
-#ifdef DEBUG
- av_log(avctx, AV_LOG_DEBUG, "*****frame %d size=%d\n", avctx->frame_number, buf_size);
- av_log(avctx, AV_LOG_DEBUG, "bytes=%x %x %x %x\n", buf[0], buf[1], buf[2], buf[3]);
-#endif
- s->flags= avctx->flags;
- s->flags2= avctx->flags2;
-
- h->gob_start_code_skipped=0;
-
-retry:
-
- init_get_bits(&s->gb, buf, buf_size*8);
-
- if(!s->context_initialized){
- if (MPV_common_init(s) < 0) //we need the idct permutaton for reading a custom matrix
- return -1;
- }
-
- //we need to set current_picture_ptr before reading the header, otherwise we cant store anyting im there
- if(s->current_picture_ptr==NULL || s->current_picture_ptr->data[0]){
- int i= ff_find_unused_picture(s, 0);
- s->current_picture_ptr= &s->picture[i];
- }
-
- ret = h261_decode_picture_header(h);
-
- /* skip if the header was thrashed */
- if (ret < 0){
- av_log(s->avctx, AV_LOG_ERROR, "header damaged\n");
- return -1;
- }
-
- if (s->width != avctx->coded_width || s->height != avctx->coded_height){
- ParseContext pc= s->parse_context; //FIXME move these demuxng hack to avformat
- s->parse_context.buffer=0;
- MPV_common_end(s);
- s->parse_context= pc;
- }
- if (!s->context_initialized) {
- avcodec_set_dimensions(avctx, s->width, s->height);
-
- goto retry;
- }
-
- // for hurry_up==5
- s->current_picture.pict_type= s->pict_type;
- s->current_picture.key_frame= s->pict_type == I_TYPE;
-
- /* skip everything if we are in a hurry>=5 */
- if(avctx->hurry_up>=5) return get_consumed_bytes(s, buf_size);
- if( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==B_TYPE)
- ||(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=I_TYPE)
- || avctx->skip_frame >= AVDISCARD_ALL)
- return get_consumed_bytes(s, buf_size);
-
- if(MPV_frame_start(s, avctx) < 0)
- return -1;
-
- ff_er_frame_start(s);
-
- /* decode each macroblock */
- s->mb_x=0;
- s->mb_y=0;
-
- while(h->gob_number < (s->mb_height==18 ? 12 : 5)){
- if(ff_h261_resync(h)<0)
- break;
- h261_decode_gob(h);
- }
- MPV_frame_end(s);
-
-assert(s->current_picture.pict_type == s->current_picture_ptr->pict_type);
-assert(s->current_picture.pict_type == s->pict_type);
- *pict= *(AVFrame*)s->current_picture_ptr;
- ff_print_debug_info(s, pict);
-
- *data_size = sizeof(AVFrame);
-
- return get_consumed_bytes(s, buf_size);
-}
-
-static int h261_decode_end(AVCodecContext *avctx)
-{
- H261Context *h= avctx->priv_data;
- MpegEncContext *s = &h->s;
-
- MPV_common_end(s);
- return 0;
-}
-
-#ifdef CONFIG_ENCODERS
-AVCodec h261_encoder = {
- "h261",
- CODEC_TYPE_VIDEO,
- CODEC_ID_H261,
- sizeof(H261Context),
- MPV_encode_init,
- MPV_encode_picture,
- MPV_encode_end,
- .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV420P, -1},
-};
-#endif
-
-AVCodec h261_decoder = {
- "h261",
- CODEC_TYPE_VIDEO,
- CODEC_ID_H261,
- sizeof(H261Context),
- h261_decode_init,
- NULL,
- h261_decode_end,
- h261_decode_frame,
- CODEC_CAP_DR1,
-};
-
-#ifdef CONFIG_H261_PARSER
-AVCodecParser h261_parser = {
- { CODEC_ID_H261 },
- sizeof(ParseContext),
- NULL,
- h261_parse,
- ff_parse_close,
-};
-#endif
diff --git a/src/libffmpeg/libavcodec/h261data.h b/src/libffmpeg/libavcodec/h261data.h
deleted file mode 100644
index 2a93b73e3..000000000
--- a/src/libffmpeg/libavcodec/h261data.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
- * copyright (c) 2004 Maarten Daniels
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file h261data.h
- * H.261 tables.
- */
-#define MB_TYPE_H261_FIL 0x800000
-
-// H.261 VLC table for macroblock addressing
-static const uint8_t h261_mba_code[35] = {
- 1, 3, 2, 3,
- 2, 3, 2, 7,
- 6, 11, 10, 9,
- 8, 7, 6, 23,
- 22, 21, 20, 19,
- 18, 35, 34, 33,
- 32, 31, 30, 29,
- 28, 27, 26, 25,
- 24,
- 15, //(MBA stuffing)
- 1 //(start code)
-};
-
-static const uint8_t h261_mba_bits[35] = {
- 1, 3, 3, 4,
- 4, 5, 5, 7,
- 7, 8, 8, 8,
- 8, 8, 8, 10,
- 10, 10, 10, 10,
- 10, 11, 11, 11,
- 11, 11, 11, 11,
- 11, 11, 11, 11,
- 11,
- 11, //(MBA stuffing)
- 16 //(start code)
-};
-
-//H.261 VLC table for macroblock type
-static const uint8_t h261_mtype_code[10] = {
- 1, 1, 1, 1,
- 1, 1, 1, 1,
- 1, 1
-};
-
-static const uint8_t h261_mtype_bits[10] = {
- 4, 7, 1, 5,
- 9, 8, 10, 3,
- 2, 6
-};
-
-static const int h261_mtype_map[10]= {
- MB_TYPE_INTRA4x4,
- MB_TYPE_INTRA4x4 | MB_TYPE_QUANT,
- MB_TYPE_CBP,
- MB_TYPE_QUANT | MB_TYPE_CBP,
- MB_TYPE_16x16,
- MB_TYPE_CBP | MB_TYPE_16x16,
- MB_TYPE_QUANT | MB_TYPE_CBP | MB_TYPE_16x16,
- MB_TYPE_16x16 | MB_TYPE_H261_FIL,
- MB_TYPE_CBP | MB_TYPE_16x16 | MB_TYPE_H261_FIL,
- MB_TYPE_QUANT | MB_TYPE_CBP | MB_TYPE_16x16 | MB_TYPE_H261_FIL
-};
-
-//H.261 VLC table for motion vectors
-static const uint8_t h261_mv_tab[17][2] = {
- {1,1}, {1,2}, {1,3}, {1,4}, {3,6}, {5,7}, {4,7}, {3,7},
- {11,9}, {10,9}, {9,9}, {17,10}, {16,10}, {15,10}, {14,10}, {13,10}, {12,10}
-};
-
-static const int mvmap[17] =
-{
- 0, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16
-};
-
-//H.261 VLC table for coded block pattern
-static const uint8_t h261_cbp_tab[63][2] =
-{
- {11,5}, {9,5}, {13,6}, {13,4}, {23,7}, {19,7}, {31,8}, {12,4},
- {22,7}, {18,7}, {30,8}, {19,5}, {27,8}, {23,8}, {19,8}, {11,4},
- {21,7}, {17,7}, {29,8}, {17,5}, {25,8}, {21,8}, {17,8}, {15,6},
- {15,8}, {13,8}, {3,9}, {15,5}, {11,8}, {7,8}, {7,9}, {10,4},
- {20,7}, {16,7}, {28,8}, {14,6}, {14,8}, {12,8}, {2,9}, {16,5},
- {24,8}, {20,8}, {16,8}, {14,5}, {10,8}, {6,8}, {6,9}, {18,5},
- {26,8}, {22,8}, {18,8}, {13,5}, {9,8}, {5,8}, {5,9}, {12,5},
- {8,8}, {4,8}, {4,9}, {7,3}, {10,5}, {8,5}, {12,6}
-};
-
-//H.261 VLC table for transform coefficients
-static const uint16_t h261_tcoeff_vlc[65][2] = {
-{ 0x2, 2 }, { 0x3, 2 },{ 0x4, 4 },{ 0x5, 5 },
-{ 0x6, 7 },{ 0x26, 8 },{ 0x21, 8 },{ 0xa, 10 },
-{ 0x1d, 12 },{ 0x18, 12 },{ 0x13, 12 },{ 0x10 , 12 },
-{ 0x1a, 13},{ 0x19, 13 }, { 0x18, 13 }, { 0x17, 13 },
-{ 0x3, 3 }, { 0x6, 6 }, { 0x25 , 8 }, { 0xc, 10 },
-{ 0x1b, 12 }, { 0x16, 13 }, { 0x15, 13 }, { 0x5, 4},
-{ 0x4, 7}, { 0xb, 10 }, { 0x14, 12 }, { 0x14, 13 },
-{ 0x7, 5 }, { 0x24, 8 }, { 0x1c, 12 }, { 0x13, 13 },
-{ 0x6, 5 }, { 0xf, 10 }, { 0x12, 12}, { 0x7, 6},
-{ 0x9 , 10 }, { 0x12, 13 }, { 0x5, 6 }, { 0x1e, 12 },
-{ 0x4, 6 }, { 0x15, 12 }, { 0x7, 7 }, { 0x11, 12},
-{ 0x5, 7 }, { 0x11, 13 }, { 0x27, 8 }, { 0x10, 13 },
-{ 0x23, 8 }, { 0x22, 8 }, { 0x20, 8 }, { 0xe , 10 },
-{ 0xd, 10 }, { 0x8, 10 },{ 0x1f, 12 }, { 0x1a, 12 },
-{ 0x19, 12 }, { 0x17, 12 }, { 0x16, 12}, { 0x1f, 13},
-{ 0x1e, 13 }, { 0x1d, 13 }, { 0x1c, 13}, { 0x1b, 13},
-{ 0x1, 6 } //escape
-};
-
-static const int8_t h261_tcoeff_level[64] = {
- 0, 1, 2, 3, 4, 5, 6, 7,
- 8, 9, 10, 11, 12, 13, 14, 15,
- 1, 2, 3, 4, 5, 6, 7, 1,
- 2, 3, 4, 5, 1, 2, 3, 4,
- 1, 2, 3, 1, 2, 3, 1, 2,
- 1, 2, 1, 2, 1, 2, 1, 2,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1
-};
-
-static const int8_t h261_tcoeff_run[64] = {
- 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1,
- 1, 1, 1, 1, 1, 1, 2, 2,
- 2, 2, 2, 3, 3, 3, 3, 4,
- 4, 4, 5, 5, 5, 6, 6, 7,
- 7, 8, 8, 9, 9, 10, 10, 11,
- 12, 13, 14, 15, 16, 17, 18, 19,
- 20, 21, 22, 23, 24, 25, 26
-};
-
-static RLTable h261_rl_tcoeff = {
- 64,
- 64,
- h261_tcoeff_vlc,
- h261_tcoeff_run,
- h261_tcoeff_level,
-};
diff --git a/src/libffmpeg/libavcodec/h263.c b/src/libffmpeg/libavcodec/h263.c
deleted file mode 100644
index 27b66a0c8..000000000
--- a/src/libffmpeg/libavcodec/h263.c
+++ /dev/null
@@ -1,6312 +0,0 @@
-/*
- * H263/MPEG4 backend for ffmpeg encoder and decoder
- * Copyright (c) 2000,2001 Fabrice Bellard.
- * H263+ support.
- * Copyright (c) 2001 Juan J. Sierralta P.
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * ac prediction encoding, b-frame support, error resilience, optimizations,
- * qpel decoding, gmc decoding, interlaced decoding,
- * by Michael Niedermayer <michaelni@gmx.at>
- */
-
-/**
- * @file h263.c
- * h263/mpeg4 codec.
- */
-
-//#define DEBUG
-#include <limits.h>
-
-#include "common.h"
-#include "dsputil.h"
-#include "avcodec.h"
-#include "mpegvideo.h"
-#include "h263data.h"
-#include "mpeg4data.h"
-
-//#undef NDEBUG
-//#include <assert.h>
-
-#define INTRA_MCBPC_VLC_BITS 6
-#define INTER_MCBPC_VLC_BITS 7
-#define CBPY_VLC_BITS 6
-#define MV_VLC_BITS 9
-#define DC_VLC_BITS 9
-#define SPRITE_TRAJ_VLC_BITS 6
-#define MB_TYPE_B_VLC_BITS 4
-#define TEX_VLC_BITS 9
-#define H263_MBTYPE_B_VLC_BITS 6
-#define CBPC_B_VLC_BITS 3
-
-#ifdef CONFIG_ENCODERS
-static void h263_encode_block(MpegEncContext * s, DCTELEM * block,
- int n);
-static void h263p_encode_umotion(MpegEncContext * s, int val);
-static inline void mpeg4_encode_block(MpegEncContext * s, DCTELEM * block,
- int n, int dc, uint8_t *scan_table,
- PutBitContext *dc_pb, PutBitContext *ac_pb);
-static int mpeg4_get_block_length(MpegEncContext * s, DCTELEM * block, int n, int intra_dc,
- uint8_t *scan_table);
-#endif
-
-static int h263_decode_motion(MpegEncContext * s, int pred, int fcode);
-static int h263p_decode_umotion(MpegEncContext * s, int pred);
-static int h263_decode_block(MpegEncContext * s, DCTELEM * block,
- int n, int coded);
-static inline int mpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr);
-static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
- int n, int coded, int intra, int rvlc);
-#ifdef CONFIG_ENCODERS
-static int h263_pred_dc(MpegEncContext * s, int n, int16_t **dc_val_ptr);
-static void mpeg4_encode_visual_object_header(MpegEncContext * s);
-static void mpeg4_encode_vol_header(MpegEncContext * s, int vo_number, int vol_number);
-#endif //CONFIG_ENCODERS
-static void mpeg4_decode_sprite_trajectory(MpegEncContext * s, GetBitContext *gb);
-static inline int ff_mpeg4_pred_dc(MpegEncContext * s, int n, int level, int *dir_ptr, int encoding);
-
-#ifdef CONFIG_ENCODERS
-static uint8_t uni_DCtab_lum_len[512];
-static uint8_t uni_DCtab_chrom_len[512];
-static uint16_t uni_DCtab_lum_bits[512];
-static uint16_t uni_DCtab_chrom_bits[512];
-
-static uint8_t (*mv_penalty)[MAX_MV*2+1]= NULL;
-static uint8_t fcode_tab[MAX_MV*2+1];
-static uint8_t umv_fcode_tab[MAX_MV*2+1];
-
-static uint32_t uni_mpeg4_intra_rl_bits[64*64*2*2];
-static uint8_t uni_mpeg4_intra_rl_len [64*64*2*2];
-static uint32_t uni_mpeg4_inter_rl_bits[64*64*2*2];
-static uint8_t uni_mpeg4_inter_rl_len [64*64*2*2];
-static uint8_t uni_h263_intra_aic_rl_len [64*64*2*2];
-static uint8_t uni_h263_inter_rl_len [64*64*2*2];
-//#define UNI_MPEG4_ENC_INDEX(last,run,level) ((last)*128 + (run)*256 + (level))
-//#define UNI_MPEG4_ENC_INDEX(last,run,level) ((last)*128*64 + (run) + (level)*64)
-#define UNI_MPEG4_ENC_INDEX(last,run,level) ((last)*128*64 + (run)*128 + (level))
-
-/* mpeg4
-inter
-max level: 24/6
-max run: 53/63
-
-intra
-max level: 53/16
-max run: 29/41
-*/
-#endif
-
-#if 0 //3IV1 is quite rare and it slows things down a tiny bit
-#define IS_3IV1 s->codec_tag == ff_get_fourcc("3IV1")
-#else
-#define IS_3IV1 0
-#endif
-
-int h263_get_picture_format(int width, int height)
-{
- int format;
-
- if (width == 128 && height == 96)
- format = 1;
- else if (width == 176 && height == 144)
- format = 2;
- else if (width == 352 && height == 288)
- format = 3;
- else if (width == 704 && height == 576)
- format = 4;
- else if (width == 1408 && height == 1152)
- format = 5;
- else
- format = 7;
- return format;
-}
-
-#ifdef CONFIG_ENCODERS
-
-static void aspect_to_info(MpegEncContext * s, AVRational aspect){
- int i;
-
- if(aspect.num==0) aspect= (AVRational){1,1};
-
- for(i=1; i<6; i++){
- if(av_cmp_q(pixel_aspect[i], aspect) == 0){
- s->aspect_ratio_info=i;
- return;
- }
- }
-
- s->aspect_ratio_info= FF_ASPECT_EXTENDED;
-}
-
-void ff_flv_encode_picture_header(MpegEncContext * s, int picture_number)
-{
- int format;
-
- align_put_bits(&s->pb);
-
- put_bits(&s->pb, 17, 1);
- put_bits(&s->pb, 5, (s->h263_flv-1)); /* 0: h263 escape codes 1: 11-bit escape codes */
- put_bits(&s->pb, 8, (((int64_t)s->picture_number * 30 * s->avctx->time_base.num) / //FIXME use timestamp
- s->avctx->time_base.den) & 0xff); /* TemporalReference */
- if (s->width == 352 && s->height == 288)
- format = 2;
- else if (s->width == 176 && s->height == 144)
- format = 3;
- else if (s->width == 128 && s->height == 96)
- format = 4;
- else if (s->width == 320 && s->height == 240)
- format = 5;
- else if (s->width == 160 && s->height == 120)
- format = 6;
- else if (s->width <= 255 && s->height <= 255)
- format = 0; /* use 1 byte width & height */
- else
- format = 1; /* use 2 bytes width & height */
- put_bits(&s->pb, 3, format); /* PictureSize */
- if (format == 0) {
- put_bits(&s->pb, 8, s->width);
- put_bits(&s->pb, 8, s->height);
- } else if (format == 1) {
- put_bits(&s->pb, 16, s->width);
- put_bits(&s->pb, 16, s->height);
- }
- put_bits(&s->pb, 2, s->pict_type == P_TYPE); /* PictureType */
- put_bits(&s->pb, 1, 1); /* DeblockingFlag: on */
- put_bits(&s->pb, 5, s->qscale); /* Quantizer */
- put_bits(&s->pb, 1, 0); /* ExtraInformation */
-
- if(s->h263_aic){
- s->y_dc_scale_table=
- s->c_dc_scale_table= ff_aic_dc_scale_table;
- }else{
- s->y_dc_scale_table=
- s->c_dc_scale_table= ff_mpeg1_dc_scale_table;
- }
-}
-
-void h263_encode_picture_header(MpegEncContext * s, int picture_number)
-{
- int format, coded_frame_rate, coded_frame_rate_base, i, temp_ref;
- int best_clock_code=1;
- int best_divisor=60;
- int best_error= INT_MAX;
-
- if(s->h263_plus){
- for(i=0; i<2; i++){
- int div, error;
- div= (s->avctx->time_base.num*1800000LL + 500LL*s->avctx->time_base.den) / ((1000LL+i)*s->avctx->time_base.den);
- div= clip(1, div, 127);
- error= FFABS(s->avctx->time_base.num*1800000LL - (1000LL+i)*s->avctx->time_base.den*div);
- if(error < best_error){
- best_error= error;
- best_divisor= div;
- best_clock_code= i;
- }
- }
- }
- s->custom_pcf= best_clock_code!=1 || best_divisor!=60;
- coded_frame_rate= 1800000;
- coded_frame_rate_base= (1000+best_clock_code)*best_divisor;
-
- align_put_bits(&s->pb);
-
- /* Update the pointer to last GOB */
- s->ptr_lastgob = pbBufPtr(&s->pb);
- put_bits(&s->pb, 22, 0x20); /* PSC */
- temp_ref= s->picture_number * (int64_t)coded_frame_rate * s->avctx->time_base.num / //FIXME use timestamp
- (coded_frame_rate_base * (int64_t)s->avctx->time_base.den);
- put_bits(&s->pb, 8, temp_ref & 0xff); /* TemporalReference */
-
- put_bits(&s->pb, 1, 1); /* marker */
- put_bits(&s->pb, 1, 0); /* h263 id */
- put_bits(&s->pb, 1, 0); /* split screen off */
- put_bits(&s->pb, 1, 0); /* camera off */
- put_bits(&s->pb, 1, 0); /* freeze picture release off */
-
- format = h263_get_picture_format(s->width, s->height);
- if (!s->h263_plus) {
- /* H.263v1 */
- put_bits(&s->pb, 3, format);
- put_bits(&s->pb, 1, (s->pict_type == P_TYPE));
- /* By now UMV IS DISABLED ON H.263v1, since the restrictions
- of H.263v1 UMV implies to check the predicted MV after
- calculation of the current MB to see if we're on the limits */
- put_bits(&s->pb, 1, 0); /* Unrestricted Motion Vector: off */
- put_bits(&s->pb, 1, 0); /* SAC: off */
- put_bits(&s->pb, 1, s->obmc); /* Advanced Prediction */
- put_bits(&s->pb, 1, 0); /* only I/P frames, no PB frame */
- put_bits(&s->pb, 5, s->qscale);
- put_bits(&s->pb, 1, 0); /* Continuous Presence Multipoint mode: off */
- } else {
- int ufep=1;
- /* H.263v2 */
- /* H.263 Plus PTYPE */
-
- put_bits(&s->pb, 3, 7);
- put_bits(&s->pb,3,ufep); /* Update Full Extended PTYPE */
- if (format == 7)
- put_bits(&s->pb,3,6); /* Custom Source Format */
- else
- put_bits(&s->pb, 3, format);
-
- put_bits(&s->pb,1, s->custom_pcf);
- put_bits(&s->pb,1, s->umvplus); /* Unrestricted Motion Vector */
- put_bits(&s->pb,1,0); /* SAC: off */
- put_bits(&s->pb,1,s->obmc); /* Advanced Prediction Mode */
- put_bits(&s->pb,1,s->h263_aic); /* Advanced Intra Coding */
- put_bits(&s->pb,1,s->loop_filter); /* Deblocking Filter */
- put_bits(&s->pb,1,s->h263_slice_structured); /* Slice Structured */
- put_bits(&s->pb,1,0); /* Reference Picture Selection: off */
- put_bits(&s->pb,1,0); /* Independent Segment Decoding: off */
- put_bits(&s->pb,1,s->alt_inter_vlc); /* Alternative Inter VLC */
- put_bits(&s->pb,1,s->modified_quant); /* Modified Quantization: */
- put_bits(&s->pb,1,1); /* "1" to prevent start code emulation */
- put_bits(&s->pb,3,0); /* Reserved */
-
- put_bits(&s->pb, 3, s->pict_type == P_TYPE);
-
- put_bits(&s->pb,1,0); /* Reference Picture Resampling: off */
- put_bits(&s->pb,1,0); /* Reduced-Resolution Update: off */
- put_bits(&s->pb,1,s->no_rounding); /* Rounding Type */
- put_bits(&s->pb,2,0); /* Reserved */
- put_bits(&s->pb,1,1); /* "1" to prevent start code emulation */
-
- /* This should be here if PLUSPTYPE */
- put_bits(&s->pb, 1, 0); /* Continuous Presence Multipoint mode: off */
-
- if (format == 7) {
- /* Custom Picture Format (CPFMT) */
- aspect_to_info(s, s->avctx->sample_aspect_ratio);
-
- put_bits(&s->pb,4,s->aspect_ratio_info);
- put_bits(&s->pb,9,(s->width >> 2) - 1);
- put_bits(&s->pb,1,1); /* "1" to prevent start code emulation */
- put_bits(&s->pb,9,(s->height >> 2));
- if (s->aspect_ratio_info == FF_ASPECT_EXTENDED){
- put_bits(&s->pb, 8, s->avctx->sample_aspect_ratio.num);
- put_bits(&s->pb, 8, s->avctx->sample_aspect_ratio.den);
- }
- }
- if(s->custom_pcf){
- if(ufep){
- put_bits(&s->pb, 1, best_clock_code);
- put_bits(&s->pb, 7, best_divisor);
- }
- put_bits(&s->pb, 2, (temp_ref>>8)&3);
- }
-
- /* Unlimited Unrestricted Motion Vectors Indicator (UUI) */
- if (s->umvplus)
-// put_bits(&s->pb,1,1); /* Limited according tables of Annex D */
-//FIXME check actual requested range
- put_bits(&s->pb,2,1); /* unlimited */
- if(s->h263_slice_structured)
- put_bits(&s->pb,2,0); /* no weird submodes */
-
- put_bits(&s->pb, 5, s->qscale);
- }
-
- put_bits(&s->pb, 1, 0); /* no PEI */
-
- if(s->h263_slice_structured){
- put_bits(&s->pb, 1, 1);
-
- assert(s->mb_x == 0 && s->mb_y == 0);
- ff_h263_encode_mba(s);
-
- put_bits(&s->pb, 1, 1);
- }
-
- if(s->h263_aic){
- s->y_dc_scale_table=
- s->c_dc_scale_table= ff_aic_dc_scale_table;
- }else{
- s->y_dc_scale_table=
- s->c_dc_scale_table= ff_mpeg1_dc_scale_table;
- }
-}
-
-/**
- * Encodes a group of blocks header.
- */
-void h263_encode_gob_header(MpegEncContext * s, int mb_line)
-{
- put_bits(&s->pb, 17, 1); /* GBSC */
-
- if(s->h263_slice_structured){
- put_bits(&s->pb, 1, 1);
-
- ff_h263_encode_mba(s);
-
- if(s->mb_num > 1583)
- put_bits(&s->pb, 1, 1);
- put_bits(&s->pb, 5, s->qscale); /* GQUANT */
- put_bits(&s->pb, 1, 1);
- put_bits(&s->pb, 2, s->pict_type == I_TYPE); /* GFID */
- }else{
- int gob_number= mb_line / s->gob_index;
-
- put_bits(&s->pb, 5, gob_number); /* GN */
- put_bits(&s->pb, 2, s->pict_type == I_TYPE); /* GFID */
- put_bits(&s->pb, 5, s->qscale); /* GQUANT */
- }
-}
-
-static inline int get_block_rate(MpegEncContext * s, DCTELEM block[64], int block_last_index, uint8_t scantable[64]){
- int last=0;
- int j;
- int rate=0;
-
- for(j=1; j<=block_last_index; j++){
- const int index= scantable[j];
- int level= block[index];
- if(level){
- level+= 64;
- if((level&(~127)) == 0){
- if(j<block_last_index) rate+= s->intra_ac_vlc_length [UNI_AC_ENC_INDEX(j-last-1, level)];
- else rate+= s->intra_ac_vlc_last_length[UNI_AC_ENC_INDEX(j-last-1, level)];
- }else
- rate += s->ac_esc_length;
- level-= 64;
-
- last= j;
- }
- }
-
- return rate;
-}
-
-static inline int decide_ac_pred(MpegEncContext * s, DCTELEM block[6][64], int dir[6], uint8_t *st[6], int zigzag_last_index[6])
-{
- int score= 0;
- int i, n;
- int8_t * const qscale_table= s->current_picture.qscale_table;
-
- memcpy(zigzag_last_index, s->block_last_index, sizeof(int)*6);
-
- for(n=0; n<6; n++){
- int16_t *ac_val, *ac_val1;
-
- score -= get_block_rate(s, block[n], s->block_last_index[n], s->intra_scantable.permutated);
-
- ac_val = s->ac_val[0][0] + s->block_index[n] * 16;
- ac_val1= ac_val;
- if(dir[n]){
- const int xy= s->mb_x + s->mb_y*s->mb_stride - s->mb_stride;
- /* top prediction */
- ac_val-= s->block_wrap[n]*16;
- if(s->mb_y==0 || s->qscale == qscale_table[xy] || n==2 || n==3){
- /* same qscale */
- for(i=1; i<8; i++){
- const int level= block[n][s->dsp.idct_permutation[i ]];
- block[n][s->dsp.idct_permutation[i ]] = level - ac_val[i+8];
- ac_val1[i ]= block[n][s->dsp.idct_permutation[i<<3]];
- ac_val1[i+8]= level;
- }
- }else{
- /* different qscale, we must rescale */
- for(i=1; i<8; i++){
- const int level= block[n][s->dsp.idct_permutation[i ]];
- block[n][s->dsp.idct_permutation[i ]] = level - ROUNDED_DIV(ac_val[i + 8]*qscale_table[xy], s->qscale);
- ac_val1[i ]= block[n][s->dsp.idct_permutation[i<<3]];
- ac_val1[i+8]= level;
- }
- }
- st[n]= s->intra_h_scantable.permutated;
- }else{
- const int xy= s->mb_x-1 + s->mb_y*s->mb_stride;
- /* left prediction */
- ac_val-= 16;
- if(s->mb_x==0 || s->qscale == qscale_table[xy] || n==1 || n==3){
- /* same qscale */
- for(i=1; i<8; i++){
- const int level= block[n][s->dsp.idct_permutation[i<<3]];
- block[n][s->dsp.idct_permutation[i<<3]]= level - ac_val[i];
- ac_val1[i ]= level;
- ac_val1[i+8]= block[n][s->dsp.idct_permutation[i ]];
- }
- }else{
- /* different qscale, we must rescale */
- for(i=1; i<8; i++){
- const int level= block[n][s->dsp.idct_permutation[i<<3]];
- block[n][s->dsp.idct_permutation[i<<3]]= level - ROUNDED_DIV(ac_val[i]*qscale_table[xy], s->qscale);
- ac_val1[i ]= level;
- ac_val1[i+8]= block[n][s->dsp.idct_permutation[i ]];
- }
- }
- st[n]= s->intra_v_scantable.permutated;
- }
-
- for(i=63; i>0; i--) //FIXME optimize
- if(block[n][ st[n][i] ]) break;
- s->block_last_index[n]= i;
-
- score += get_block_rate(s, block[n], s->block_last_index[n], st[n]);
- }
-
- return score < 0;
-}
-
-static inline void restore_ac_coeffs(MpegEncContext * s, DCTELEM block[6][64], int dir[6], uint8_t *st[6], int zigzag_last_index[6])
-{
- int i, n;
- memcpy(s->block_last_index, zigzag_last_index, sizeof(int)*6);
-
- for(n=0; n<6; n++){
- int16_t *ac_val = s->ac_val[0][0] + s->block_index[n] * 16;
-
- st[n]= s->intra_scantable.permutated;
- if(dir[n]){
- /* top prediction */
- for(i=1; i<8; i++){
- block[n][s->dsp.idct_permutation[i ]] = ac_val[i+8];
- }
- }else{
- /* left prediction */
- for(i=1; i<8; i++){
- block[n][s->dsp.idct_permutation[i<<3]]= ac_val[i ];
- }
- }
- }
-}
-
-/**
- * init s->current_picture.qscale_table from s->lambda_table
- */
-static void ff_init_qscale_tab(MpegEncContext *s){
- int8_t * const qscale_table= s->current_picture.qscale_table;
- int i;
-
- for(i=0; i<s->mb_num; i++){
- unsigned int lam= s->lambda_table[ s->mb_index2xy[i] ];
- int qp= (lam*139 + FF_LAMBDA_SCALE*64) >> (FF_LAMBDA_SHIFT + 7);
- qscale_table[ s->mb_index2xy[i] ]= clip(qp, s->avctx->qmin, s->avctx->qmax);
- }
-}
-
-/**
- * modify qscale so that encoding is acually possible in h263 (limit difference to -2..2)
- */
-void ff_clean_h263_qscales(MpegEncContext *s){
- int i;
- int8_t * const qscale_table= s->current_picture.qscale_table;
-
- ff_init_qscale_tab(s);
-
- for(i=1; i<s->mb_num; i++){
- if(qscale_table[ s->mb_index2xy[i] ] - qscale_table[ s->mb_index2xy[i-1] ] >2)
- qscale_table[ s->mb_index2xy[i] ]= qscale_table[ s->mb_index2xy[i-1] ]+2;
- }
- for(i=s->mb_num-2; i>=0; i--){
- if(qscale_table[ s->mb_index2xy[i] ] - qscale_table[ s->mb_index2xy[i+1] ] >2)
- qscale_table[ s->mb_index2xy[i] ]= qscale_table[ s->mb_index2xy[i+1] ]+2;
- }
-
- if(s->codec_id != CODEC_ID_H263P){
- for(i=1; i<s->mb_num; i++){
- int mb_xy= s->mb_index2xy[i];
-
- if(qscale_table[mb_xy] != qscale_table[s->mb_index2xy[i-1]] && (s->mb_type[mb_xy]&CANDIDATE_MB_TYPE_INTER4V)){
- s->mb_type[mb_xy]|= CANDIDATE_MB_TYPE_INTER;
- }
- }
- }
-}
-
-/**
- * modify mb_type & qscale so that encoding is acually possible in mpeg4
- */
-void ff_clean_mpeg4_qscales(MpegEncContext *s){
- int i;
- int8_t * const qscale_table= s->current_picture.qscale_table;
-
- ff_clean_h263_qscales(s);
-
- if(s->pict_type== B_TYPE){
- int odd=0;
- /* ok, come on, this isn't funny anymore, there's more code for handling this mpeg4 mess than for the actual adaptive quantization */
-
- for(i=0; i<s->mb_num; i++){
- int mb_xy= s->mb_index2xy[i];
- odd += qscale_table[mb_xy]&1;
- }
-
- if(2*odd > s->mb_num) odd=1;
- else odd=0;
-
- for(i=0; i<s->mb_num; i++){
- int mb_xy= s->mb_index2xy[i];
- if((qscale_table[mb_xy]&1) != odd)
- qscale_table[mb_xy]++;
- if(qscale_table[mb_xy] > 31)
- qscale_table[mb_xy]= 31;
- }
-
- for(i=1; i<s->mb_num; i++){
- int mb_xy= s->mb_index2xy[i];
- if(qscale_table[mb_xy] != qscale_table[s->mb_index2xy[i-1]] && (s->mb_type[mb_xy]&CANDIDATE_MB_TYPE_DIRECT)){
- s->mb_type[mb_xy]|= CANDIDATE_MB_TYPE_BIDIR;
- }
- }
- }
-}
-
-#endif //CONFIG_ENCODERS
-
-#define tab_size ((signed)(sizeof(s->direct_scale_mv[0])/sizeof(int16_t)))
-#define tab_bias (tab_size/2)
-
-void ff_mpeg4_init_direct_mv(MpegEncContext *s){
- int i;
- for(i=0; i<tab_size; i++){
- s->direct_scale_mv[0][i] = (i-tab_bias)*s->pb_time/s->pp_time;
- s->direct_scale_mv[1][i] = (i-tab_bias)*(s->pb_time-s->pp_time)/s->pp_time;
- }
-}
-
-static inline void ff_mpeg4_set_one_direct_mv(MpegEncContext *s, int mx, int my, int i){
- int xy= s->block_index[i];
- uint16_t time_pp= s->pp_time;
- uint16_t time_pb= s->pb_time;
- int p_mx, p_my;
-
- p_mx= s->next_picture.motion_val[0][xy][0];
- if((unsigned)(p_mx + tab_bias) < tab_size){
- s->mv[0][i][0] = s->direct_scale_mv[0][p_mx + tab_bias] + mx;
- s->mv[1][i][0] = mx ? s->mv[0][i][0] - p_mx
- : s->direct_scale_mv[1][p_mx + tab_bias];
- }else{
- s->mv[0][i][0] = p_mx*time_pb/time_pp + mx;
- s->mv[1][i][0] = mx ? s->mv[0][i][0] - p_mx
- : p_mx*(time_pb - time_pp)/time_pp;
- }
- p_my= s->next_picture.motion_val[0][xy][1];
- if((unsigned)(p_my + tab_bias) < tab_size){
- s->mv[0][i][1] = s->direct_scale_mv[0][p_my + tab_bias] + my;
- s->mv[1][i][1] = my ? s->mv[0][i][1] - p_my
- : s->direct_scale_mv[1][p_my + tab_bias];
- }else{
- s->mv[0][i][1] = p_my*time_pb/time_pp + my;
- s->mv[1][i][1] = my ? s->mv[0][i][1] - p_my
- : p_my*(time_pb - time_pp)/time_pp;
- }
-}
-
-#undef tab_size
-#undef tab_bias
-
-/**
- *
- * @return the mb_type
- */
-int ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int my){
- const int mb_index= s->mb_x + s->mb_y*s->mb_stride;
- const int colocated_mb_type= s->next_picture.mb_type[mb_index];
- uint16_t time_pp= s->pp_time;
- uint16_t time_pb= s->pb_time;
- int i;
-
- //FIXME avoid divides
- // try special case with shifts for 1 and 3 B-frames?
-
- if(IS_8X8(colocated_mb_type)){
- s->mv_type = MV_TYPE_8X8;
- for(i=0; i<4; i++){
- ff_mpeg4_set_one_direct_mv(s, mx, my, i);
- }
- return MB_TYPE_DIRECT2 | MB_TYPE_8x8 | MB_TYPE_L0L1;
- } else if(IS_INTERLACED(colocated_mb_type)){
- s->mv_type = MV_TYPE_FIELD;
- for(i=0; i<2; i++){
- int field_select= s->next_picture.ref_index[0][s->block_index[2*i]];
- s->field_select[0][i]= field_select;
- s->field_select[1][i]= i;
- if(s->top_field_first){
- time_pp= s->pp_field_time - field_select + i;
- time_pb= s->pb_field_time - field_select + i;
- }else{
- time_pp= s->pp_field_time + field_select - i;
- time_pb= s->pb_field_time + field_select - i;
- }
- s->mv[0][i][0] = s->p_field_mv_table[i][0][mb_index][0]*time_pb/time_pp + mx;
- s->mv[0][i][1] = s->p_field_mv_table[i][0][mb_index][1]*time_pb/time_pp + my;
- s->mv[1][i][0] = mx ? s->mv[0][i][0] - s->p_field_mv_table[i][0][mb_index][0]
- : s->p_field_mv_table[i][0][mb_index][0]*(time_pb - time_pp)/time_pp;
- s->mv[1][i][1] = my ? s->mv[0][i][1] - s->p_field_mv_table[i][0][mb_index][1]
- : s->p_field_mv_table[i][0][mb_index][1]*(time_pb - time_pp)/time_pp;
- }
- return MB_TYPE_DIRECT2 | MB_TYPE_16x8 | MB_TYPE_L0L1 | MB_TYPE_INTERLACED;
- }else{
- ff_mpeg4_set_one_direct_mv(s, mx, my, 0);
- s->mv[0][1][0] = s->mv[0][2][0] = s->mv[0][3][0] = s->mv[0][0][0];
- s->mv[0][1][1] = s->mv[0][2][1] = s->mv[0][3][1] = s->mv[0][0][1];
- s->mv[1][1][0] = s->mv[1][2][0] = s->mv[1][3][0] = s->mv[1][0][0];
- s->mv[1][1][1] = s->mv[1][2][1] = s->mv[1][3][1] = s->mv[1][0][1];
- if((s->avctx->workaround_bugs & FF_BUG_DIRECT_BLOCKSIZE) || !s->quarter_sample)
- s->mv_type= MV_TYPE_16X16;
- else
- s->mv_type= MV_TYPE_8X8;
- return MB_TYPE_DIRECT2 | MB_TYPE_16x16 | MB_TYPE_L0L1; //Note see prev line
- }
-}
-
-void ff_h263_update_motion_val(MpegEncContext * s){
- const int mb_xy = s->mb_y * s->mb_stride + s->mb_x;
- //FIXME a lot of that is only needed for !low_delay
- const int wrap = s->b8_stride;
- const int xy = s->block_index[0];
-
- s->current_picture.mbskip_table[mb_xy]= s->mb_skipped;
-
- if(s->mv_type != MV_TYPE_8X8){
- int motion_x, motion_y;
- if (s->mb_intra) {
- motion_x = 0;
- motion_y = 0;
- } else if (s->mv_type == MV_TYPE_16X16) {
- motion_x = s->mv[0][0][0];
- motion_y = s->mv[0][0][1];
- } else /*if (s->mv_type == MV_TYPE_FIELD)*/ {
- int i;
- motion_x = s->mv[0][0][0] + s->mv[0][1][0];
- motion_y = s->mv[0][0][1] + s->mv[0][1][1];
- motion_x = (motion_x>>1) | (motion_x&1);
- for(i=0; i<2; i++){
- s->p_field_mv_table[i][0][mb_xy][0]= s->mv[0][i][0];
- s->p_field_mv_table[i][0][mb_xy][1]= s->mv[0][i][1];
- }
- s->current_picture.ref_index[0][xy ]=
- s->current_picture.ref_index[0][xy + 1]= s->field_select[0][0];
- s->current_picture.ref_index[0][xy + wrap ]=
- s->current_picture.ref_index[0][xy + wrap + 1]= s->field_select[0][1];
- }
-
- /* no update if 8X8 because it has been done during parsing */
- s->current_picture.motion_val[0][xy][0] = motion_x;
- s->current_picture.motion_val[0][xy][1] = motion_y;
- s->current_picture.motion_val[0][xy + 1][0] = motion_x;
- s->current_picture.motion_val[0][xy + 1][1] = motion_y;
- s->current_picture.motion_val[0][xy + wrap][0] = motion_x;
- s->current_picture.motion_val[0][xy + wrap][1] = motion_y;
- s->current_picture.motion_val[0][xy + 1 + wrap][0] = motion_x;
- s->current_picture.motion_val[0][xy + 1 + wrap][1] = motion_y;
- }
-
- if(s->encoding){ //FIXME encoding MUST be cleaned up
- if (s->mv_type == MV_TYPE_8X8)
- s->current_picture.mb_type[mb_xy]= MB_TYPE_L0 | MB_TYPE_8x8;
- else if(s->mb_intra)
- s->current_picture.mb_type[mb_xy]= MB_TYPE_INTRA;
- else
- s->current_picture.mb_type[mb_xy]= MB_TYPE_L0 | MB_TYPE_16x16;
- }
-}
-
-#ifdef CONFIG_ENCODERS
-
-static inline int h263_get_motion_length(MpegEncContext * s, int val, int f_code){
- int l, bit_size, code;
-
- if (val == 0) {
- return mvtab[0][1];
- } else {
- bit_size = f_code - 1;
- /* modulo encoding */
- l= INT_BIT - 6 - bit_size;
- val = (val<<l)>>l;
- val--;
- code = (val >> bit_size) + 1;
-
- return mvtab[code][1] + 1 + bit_size;
- }
-}
-
-static inline void ff_h263_encode_motion_vector(MpegEncContext * s, int x, int y, int f_code){
- if(s->flags2 & CODEC_FLAG2_NO_OUTPUT){
- skip_put_bits(&s->pb,
- h263_get_motion_length(s, x, f_code)
- +h263_get_motion_length(s, y, f_code));
- }else{
- ff_h263_encode_motion(s, x, f_code);
- ff_h263_encode_motion(s, y, f_code);
- }
-}
-
-static inline int get_p_cbp(MpegEncContext * s,
- DCTELEM block[6][64],
- int motion_x, int motion_y){
- int cbp, i;
-
- if(s->flags & CODEC_FLAG_CBP_RD){
- int best_cbpy_score= INT_MAX;
- int best_cbpc_score= INT_MAX;
- int cbpc = (-1), cbpy= (-1);
- const int offset= (s->mv_type==MV_TYPE_16X16 ? 0 : 16) + (s->dquant ? 8 : 0);
- const int lambda= s->lambda2 >> (FF_LAMBDA_SHIFT - 6);
-
- for(i=0; i<4; i++){
- int score= inter_MCBPC_bits[i + offset] * lambda;
- if(i&1) score += s->coded_score[5];
- if(i&2) score += s->coded_score[4];
-
- if(score < best_cbpc_score){
- best_cbpc_score= score;
- cbpc= i;
- }
- }
-
- for(i=0; i<16; i++){
- int score= cbpy_tab[i ^ 0xF][1] * lambda;
- if(i&1) score += s->coded_score[3];
- if(i&2) score += s->coded_score[2];
- if(i&4) score += s->coded_score[1];
- if(i&8) score += s->coded_score[0];
-
- if(score < best_cbpy_score){
- best_cbpy_score= score;
- cbpy= i;
- }
- }
- cbp= cbpc + 4*cbpy;
- if ((motion_x | motion_y | s->dquant) == 0 && s->mv_type==MV_TYPE_16X16){
- if(best_cbpy_score + best_cbpc_score + 2*lambda >= 0)
- cbp= 0;
- }
-
- for (i = 0; i < 6; i++) {
- if (s->block_last_index[i] >= 0 && ((cbp >> (5 - i))&1)==0 ){
- s->block_last_index[i]= -1;
- memset(s->block[i], 0, sizeof(DCTELEM)*64);
- }
- }
- }else{
- cbp= 0;
- for (i = 0; i < 6; i++) {
- if (s->block_last_index[i] >= 0)
- cbp |= 1 << (5 - i);
- }
- }
- return cbp;
-}
-
-static inline int get_b_cbp(MpegEncContext * s, DCTELEM block[6][64],
- int motion_x, int motion_y, int mb_type){
- int cbp=0, i;
-
- if(s->flags & CODEC_FLAG_CBP_RD){
- int score=0;
- const int lambda= s->lambda2 >> (FF_LAMBDA_SHIFT - 6);
-
- for(i=0; i<6; i++){
- if(s->coded_score[i] < 0){
- score += s->coded_score[i];
- cbp |= 1 << (5 - i);
- }
- }
-
- if(cbp){
- int zero_score= -6;
- if ((motion_x | motion_y | s->dquant | mb_type) == 0){
- zero_score-= 4; //2*MV + mb_type + cbp bit
- }
-
- zero_score*= lambda;
- if(zero_score <= score){
- cbp=0;
- }
- }
-
- for (i = 0; i < 6; i++) {
- if (s->block_last_index[i] >= 0 && ((cbp >> (5 - i))&1)==0 ){
- s->block_last_index[i]= -1;
- memset(s->block[i], 0, sizeof(DCTELEM)*64);
- }
- }
- }else{
- for (i = 0; i < 6; i++) {
- if (s->block_last_index[i] >= 0)
- cbp |= 1 << (5 - i);
- }
- }
- return cbp;
-}
-
-static inline void mpeg4_encode_blocks(MpegEncContext * s, DCTELEM block[6][64], int intra_dc[6],
- uint8_t **scan_table, PutBitContext *dc_pb, PutBitContext *ac_pb){
- int i;
-
- if(scan_table){
- if(s->flags2 & CODEC_FLAG2_NO_OUTPUT){
- for (i = 0; i < 6; i++) {
- skip_put_bits(&s->pb, mpeg4_get_block_length(s, block[i], i, intra_dc[i], scan_table[i]));
- }
- }else{
- /* encode each block */
- for (i = 0; i < 6; i++) {
- mpeg4_encode_block(s, block[i], i, intra_dc[i], scan_table[i], dc_pb, ac_pb);
- }
- }
- }else{
- if(s->flags2 & CODEC_FLAG2_NO_OUTPUT){
- for (i = 0; i < 6; i++) {
- skip_put_bits(&s->pb, mpeg4_get_block_length(s, block[i], i, 0, s->intra_scantable.permutated));
- }
- }else{
- /* encode each block */
- for (i = 0; i < 6; i++) {
- mpeg4_encode_block(s, block[i], i, 0, s->intra_scantable.permutated, dc_pb, ac_pb);
- }
- }
- }
-}
-
-void mpeg4_encode_mb(MpegEncContext * s,
- DCTELEM block[6][64],
- int motion_x, int motion_y)
-{
- int cbpc, cbpy, pred_x, pred_y;
- PutBitContext * const pb2 = s->data_partitioning ? &s->pb2 : &s->pb;
- PutBitContext * const tex_pb = s->data_partitioning && s->pict_type!=B_TYPE ? &s->tex_pb : &s->pb;
- PutBitContext * const dc_pb = s->data_partitioning && s->pict_type!=I_TYPE ? &s->pb2 : &s->pb;
- const int interleaved_stats= (s->flags&CODEC_FLAG_PASS1) && !s->data_partitioning ? 1 : 0;
- const int dquant_code[5]= {1,0,9,2,3};
-
- // printf("**mb x=%d y=%d\n", s->mb_x, s->mb_y);
- if (!s->mb_intra) {
- int i, cbp;
-
- if(s->pict_type==B_TYPE){
- static const int mb_type_table[8]= {-1, 2, 3, 1,-1,-1,-1, 0}; /* convert from mv_dir to type */
- int mb_type= mb_type_table[s->mv_dir];
-
- if(s->mb_x==0){
- for(i=0; i<2; i++){
- s->last_mv[i][0][0]=
- s->last_mv[i][0][1]=
- s->last_mv[i][1][0]=
- s->last_mv[i][1][1]= 0;
- }
- }
-
- assert(s->dquant>=-2 && s->dquant<=2);
- assert((s->dquant&1)==0);
- assert(mb_type>=0);
-
- /* nothing to do if this MB was skipped in the next P Frame */
- if(s->next_picture.mbskip_table[s->mb_y * s->mb_stride + s->mb_x]){ //FIXME avoid DCT & ...
- s->skip_count++;
- s->mv[0][0][0]=
- s->mv[0][0][1]=
- s->mv[1][0][0]=
- s->mv[1][0][1]= 0;
- s->mv_dir= MV_DIR_FORWARD; //doesn't matter
- s->qscale -= s->dquant;
-// s->mb_skipped=1;
-
- return;
- }
-
- cbp= get_b_cbp(s, block, motion_x, motion_y, mb_type);
-
- if ((cbp | motion_x | motion_y | mb_type) ==0) {
- /* direct MB with MV={0,0} */
- assert(s->dquant==0);
-
- put_bits(&s->pb, 1, 1); /* mb not coded modb1=1 */
-
- if(interleaved_stats){
- s->misc_bits++;
- s->last_bits++;
- }
- s->skip_count++;
- return;
- }
-
- put_bits(&s->pb, 1, 0); /* mb coded modb1=0 */
- put_bits(&s->pb, 1, cbp ? 0 : 1); /* modb2 */ //FIXME merge
- put_bits(&s->pb, mb_type+1, 1); // this table is so simple that we don't need it :)
- if(cbp) put_bits(&s->pb, 6, cbp);
-
- if(cbp && mb_type){
- if(s->dquant)
- put_bits(&s->pb, 2, (s->dquant>>2)+3);
- else
- put_bits(&s->pb, 1, 0);
- }else
- s->qscale -= s->dquant;
-
- if(!s->progressive_sequence){
- if(cbp)
- put_bits(&s->pb, 1, s->interlaced_dct);
- if(mb_type) // not direct mode
- put_bits(&s->pb, 1, s->mv_type == MV_TYPE_FIELD);
- }
-
- if(interleaved_stats){
- s->misc_bits+= get_bits_diff(s);
- }
-
- if(mb_type == 0){
- assert(s->mv_dir & MV_DIRECT);
- ff_h263_encode_motion_vector(s, motion_x, motion_y, 1);
- s->b_count++;
- s->f_count++;
- }else{
- assert(mb_type > 0 && mb_type < 4);
- if(s->mv_type != MV_TYPE_FIELD){
- if(s->mv_dir & MV_DIR_FORWARD){
- ff_h263_encode_motion_vector(s, s->mv[0][0][0] - s->last_mv[0][0][0],
- s->mv[0][0][1] - s->last_mv[0][0][1], s->f_code);
- s->last_mv[0][0][0]= s->last_mv[0][1][0]= s->mv[0][0][0];
- s->last_mv[0][0][1]= s->last_mv[0][1][1]= s->mv[0][0][1];
- s->f_count++;
- }
- if(s->mv_dir & MV_DIR_BACKWARD){
- ff_h263_encode_motion_vector(s, s->mv[1][0][0] - s->last_mv[1][0][0],
- s->mv[1][0][1] - s->last_mv[1][0][1], s->b_code);
- s->last_mv[1][0][0]= s->last_mv[1][1][0]= s->mv[1][0][0];
- s->last_mv[1][0][1]= s->last_mv[1][1][1]= s->mv[1][0][1];
- s->b_count++;
- }
- }else{
- if(s->mv_dir & MV_DIR_FORWARD){
- put_bits(&s->pb, 1, s->field_select[0][0]);
- put_bits(&s->pb, 1, s->field_select[0][1]);
- }
- if(s->mv_dir & MV_DIR_BACKWARD){
- put_bits(&s->pb, 1, s->field_select[1][0]);
- put_bits(&s->pb, 1, s->field_select[1][1]);
- }
- if(s->mv_dir & MV_DIR_FORWARD){
- for(i=0; i<2; i++){
- ff_h263_encode_motion_vector(s, s->mv[0][i][0] - s->last_mv[0][i][0] ,
- s->mv[0][i][1] - s->last_mv[0][i][1]/2, s->f_code);
- s->last_mv[0][i][0]= s->mv[0][i][0];
- s->last_mv[0][i][1]= s->mv[0][i][1]*2;
- }
- s->f_count++;
- }
- if(s->mv_dir & MV_DIR_BACKWARD){
- for(i=0; i<2; i++){
- ff_h263_encode_motion_vector(s, s->mv[1][i][0] - s->last_mv[1][i][0] ,
- s->mv[1][i][1] - s->last_mv[1][i][1]/2, s->b_code);
- s->last_mv[1][i][0]= s->mv[1][i][0];
- s->last_mv[1][i][1]= s->mv[1][i][1]*2;
- }
- s->b_count++;
- }
- }
- }
-
- if(interleaved_stats){
- s->mv_bits+= get_bits_diff(s);
- }
-
- mpeg4_encode_blocks(s, block, NULL, NULL, NULL, &s->pb);
-
- if(interleaved_stats){
- s->p_tex_bits+= get_bits_diff(s);
- }
-
- }else{ /* s->pict_type==B_TYPE */
- cbp= get_p_cbp(s, block, motion_x, motion_y);
-
- if ((cbp | motion_x | motion_y | s->dquant) == 0 && s->mv_type==MV_TYPE_16X16) {
- /* check if the B frames can skip it too, as we must skip it if we skip here
- why didn't they just compress the skip-mb bits instead of reusing them ?! */
- if(s->max_b_frames>0){
- int i;
- int x,y, offset;
- uint8_t *p_pic;
-
- x= s->mb_x*16;
- y= s->mb_y*16;
- if(x+16 > s->width) x= s->width-16;
- if(y+16 > s->height) y= s->height-16;
-
- offset= x + y*s->linesize;
- p_pic= s->new_picture.data[0] + offset;
-
- s->mb_skipped=1;
- for(i=0; i<s->max_b_frames; i++){
- uint8_t *b_pic;
- int diff;
- Picture *pic= s->reordered_input_picture[i+1];
-
- if(pic==NULL || pic->pict_type!=B_TYPE) break;
-
- b_pic= pic->data[0] + offset;
- if(pic->type != FF_BUFFER_TYPE_SHARED)
- b_pic+= INPLACE_OFFSET;
- diff= s->dsp.sad[0](NULL, p_pic, b_pic, s->linesize, 16);
- if(diff>s->qscale*70){ //FIXME check that 70 is optimal
- s->mb_skipped=0;
- break;
- }
- }
- }else
- s->mb_skipped=1;
-
- if(s->mb_skipped==1){
- /* skip macroblock */
- put_bits(&s->pb, 1, 1);
-
- if(interleaved_stats){
- s->misc_bits++;
- s->last_bits++;
- }
- s->skip_count++;
-
- return;
- }
- }
-
- put_bits(&s->pb, 1, 0); /* mb coded */
- cbpc = cbp & 3;
- cbpy = cbp >> 2;
- cbpy ^= 0xf;
- if(s->mv_type==MV_TYPE_16X16){
- if(s->dquant) cbpc+= 8;
- put_bits(&s->pb,
- inter_MCBPC_bits[cbpc],
- inter_MCBPC_code[cbpc]);
-
- put_bits(pb2, cbpy_tab[cbpy][1], cbpy_tab[cbpy][0]);
- if(s->dquant)
- put_bits(pb2, 2, dquant_code[s->dquant+2]);
-
- if(!s->progressive_sequence){
- if(cbp)
- put_bits(pb2, 1, s->interlaced_dct);
- put_bits(pb2, 1, 0);
- }
-
- if(interleaved_stats){
- s->misc_bits+= get_bits_diff(s);
- }
-
- /* motion vectors: 16x16 mode */
- h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
-
- ff_h263_encode_motion_vector(s, motion_x - pred_x,
- motion_y - pred_y, s->f_code);
- }else if(s->mv_type==MV_TYPE_FIELD){
- if(s->dquant) cbpc+= 8;
- put_bits(&s->pb,
- inter_MCBPC_bits[cbpc],
- inter_MCBPC_code[cbpc]);
-
- put_bits(pb2, cbpy_tab[cbpy][1], cbpy_tab[cbpy][0]);
- if(s->dquant)
- put_bits(pb2, 2, dquant_code[s->dquant+2]);
-
- assert(!s->progressive_sequence);
- if(cbp)
- put_bits(pb2, 1, s->interlaced_dct);
- put_bits(pb2, 1, 1);
-
- if(interleaved_stats){
- s->misc_bits+= get_bits_diff(s);
- }
-
- /* motion vectors: 16x8 interlaced mode */
- h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
- pred_y /=2;
-
- put_bits(&s->pb, 1, s->field_select[0][0]);
- put_bits(&s->pb, 1, s->field_select[0][1]);
-
- ff_h263_encode_motion_vector(s, s->mv[0][0][0] - pred_x,
- s->mv[0][0][1] - pred_y, s->f_code);
- ff_h263_encode_motion_vector(s, s->mv[0][1][0] - pred_x,
- s->mv[0][1][1] - pred_y, s->f_code);
- }else{
- assert(s->mv_type==MV_TYPE_8X8);
- put_bits(&s->pb,
- inter_MCBPC_bits[cbpc+16],
- inter_MCBPC_code[cbpc+16]);
- put_bits(pb2, cbpy_tab[cbpy][1], cbpy_tab[cbpy][0]);
-
- if(!s->progressive_sequence){
- if(cbp)
- put_bits(pb2, 1, s->interlaced_dct);
- }
-
- if(interleaved_stats){
- s->misc_bits+= get_bits_diff(s);
- }
-
- for(i=0; i<4; i++){
- /* motion vectors: 8x8 mode*/
- h263_pred_motion(s, i, 0, &pred_x, &pred_y);
-
- ff_h263_encode_motion_vector(s, s->current_picture.motion_val[0][ s->block_index[i] ][0] - pred_x,
- s->current_picture.motion_val[0][ s->block_index[i] ][1] - pred_y, s->f_code);
- }
- }
-
- if(interleaved_stats){
- s->mv_bits+= get_bits_diff(s);
- }
-
- mpeg4_encode_blocks(s, block, NULL, NULL, NULL, tex_pb);
-
- if(interleaved_stats){
- s->p_tex_bits+= get_bits_diff(s);
- }
- s->f_count++;
- }
- } else {
- int cbp;
- int dc_diff[6]; //dc values with the dc prediction subtracted
- int dir[6]; //prediction direction
- int zigzag_last_index[6];
- uint8_t *scan_table[6];
- int i;
-
- for(i=0; i<6; i++){
- dc_diff[i]= ff_mpeg4_pred_dc(s, i, block[i][0], &dir[i], 1);
- }
-
- if(s->flags & CODEC_FLAG_AC_PRED){
- s->ac_pred= decide_ac_pred(s, block, dir, scan_table, zigzag_last_index);
- if(!s->ac_pred)
- restore_ac_coeffs(s, block, dir, scan_table, zigzag_last_index);
- }else{
- for(i=0; i<6; i++)
- scan_table[i]= s->intra_scantable.permutated;
- }
-
- /* compute cbp */
- cbp = 0;
- for (i = 0; i < 6; i++) {
- if (s->block_last_index[i] >= 1)
- cbp |= 1 << (5 - i);
- }
-
- cbpc = cbp & 3;
- if (s->pict_type == I_TYPE) {
- if(s->dquant) cbpc+=4;
- put_bits(&s->pb,
- intra_MCBPC_bits[cbpc],
- intra_MCBPC_code[cbpc]);
- } else {
- if(s->dquant) cbpc+=8;
- put_bits(&s->pb, 1, 0); /* mb coded */
- put_bits(&s->pb,
- inter_MCBPC_bits[cbpc + 4],
- inter_MCBPC_code[cbpc + 4]);
- }
- put_bits(pb2, 1, s->ac_pred);
- cbpy = cbp >> 2;
- put_bits(pb2, cbpy_tab[cbpy][1], cbpy_tab[cbpy][0]);
- if(s->dquant)
- put_bits(dc_pb, 2, dquant_code[s->dquant+2]);
-
- if(!s->progressive_sequence){
- put_bits(dc_pb, 1, s->interlaced_dct);
- }
-
- if(interleaved_stats){
- s->misc_bits+= get_bits_diff(s);
- }
-
- mpeg4_encode_blocks(s, block, dc_diff, scan_table, dc_pb, tex_pb);
-
- if(interleaved_stats){
- s->i_tex_bits+= get_bits_diff(s);
- }
- s->i_count++;
-
- /* restore ac coeffs & last_index stuff if we messed them up with the prediction */
- if(s->ac_pred)
- restore_ac_coeffs(s, block, dir, scan_table, zigzag_last_index);
- }
-}
-
-void h263_encode_mb(MpegEncContext * s,
- DCTELEM block[6][64],
- int motion_x, int motion_y)
-{
- int cbpc, cbpy, i, cbp, pred_x, pred_y;
- int16_t pred_dc;
- int16_t rec_intradc[6];
- int16_t *dc_ptr[6];
- const int interleaved_stats= (s->flags&CODEC_FLAG_PASS1);
- const int dquant_code[5]= {1,0,9,2,3};
-
- //printf("**mb x=%d y=%d\n", s->mb_x, s->mb_y);
- if (!s->mb_intra) {
- /* compute cbp */
- cbp= get_p_cbp(s, block, motion_x, motion_y);
-
- if ((cbp | motion_x | motion_y | s->dquant | (s->mv_type - MV_TYPE_16X16)) == 0) {
- /* skip macroblock */
- put_bits(&s->pb, 1, 1);
- if(interleaved_stats){
- s->misc_bits++;
- s->last_bits++;
- }
- s->skip_count++;
-
- return;
- }
- put_bits(&s->pb, 1, 0); /* mb coded */
-
- cbpc = cbp & 3;
- cbpy = cbp >> 2;
- if(s->alt_inter_vlc==0 || cbpc!=3)
- cbpy ^= 0xF;
- if(s->dquant) cbpc+= 8;
- if(s->mv_type==MV_TYPE_16X16){
- put_bits(&s->pb,
- inter_MCBPC_bits[cbpc],
- inter_MCBPC_code[cbpc]);
-
- put_bits(&s->pb, cbpy_tab[cbpy][1], cbpy_tab[cbpy][0]);
- if(s->dquant)
- put_bits(&s->pb, 2, dquant_code[s->dquant+2]);
-
- if(interleaved_stats){
- s->misc_bits+= get_bits_diff(s);
- }
-
- /* motion vectors: 16x16 mode */
- h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
-
- if (!s->umvplus) {
- ff_h263_encode_motion_vector(s, motion_x - pred_x,
- motion_y - pred_y, 1);
- }
- else {
- h263p_encode_umotion(s, motion_x - pred_x);
- h263p_encode_umotion(s, motion_y - pred_y);
- if (((motion_x - pred_x) == 1) && ((motion_y - pred_y) == 1))
- /* To prevent Start Code emulation */
- put_bits(&s->pb,1,1);
- }
- }else{
- put_bits(&s->pb,
- inter_MCBPC_bits[cbpc+16],
- inter_MCBPC_code[cbpc+16]);
- put_bits(&s->pb, cbpy_tab[cbpy][1], cbpy_tab[cbpy][0]);
- if(s->dquant)
- put_bits(&s->pb, 2, dquant_code[s->dquant+2]);
-
- if(interleaved_stats){
- s->misc_bits+= get_bits_diff(s);
- }
-
- for(i=0; i<4; i++){
- /* motion vectors: 8x8 mode*/
- h263_pred_motion(s, i, 0, &pred_x, &pred_y);
-
- motion_x= s->current_picture.motion_val[0][ s->block_index[i] ][0];
- motion_y= s->current_picture.motion_val[0][ s->block_index[i] ][1];
- if (!s->umvplus) {
- ff_h263_encode_motion_vector(s, motion_x - pred_x,
- motion_y - pred_y, 1);
- }
- else {
- h263p_encode_umotion(s, motion_x - pred_x);
- h263p_encode_umotion(s, motion_y - pred_y);
- if (((motion_x - pred_x) == 1) && ((motion_y - pred_y) == 1))
- /* To prevent Start Code emulation */
- put_bits(&s->pb,1,1);
- }
- }
- }
-
- if(interleaved_stats){
- s->mv_bits+= get_bits_diff(s);
- }
- } else {
- assert(s->mb_intra);
-
- cbp = 0;
- if (s->h263_aic) {
- /* Predict DC */
- for(i=0; i<6; i++) {
- int16_t level = block[i][0];
- int scale;
-
- if(i<4) scale= s->y_dc_scale;
- else scale= s->c_dc_scale;
-
- pred_dc = h263_pred_dc(s, i, &dc_ptr[i]);
- level -= pred_dc;
- /* Quant */
- if (level >= 0)
- level = (level + (scale>>1))/scale;
- else
- level = (level - (scale>>1))/scale;
-
- /* AIC can change CBP */
- if (level == 0 && s->block_last_index[i] == 0)
- s->block_last_index[i] = -1;
-
- if(!s->modified_quant){
- if (level < -127)
- level = -127;
- else if (level > 127)
- level = 127;
- }
-
- block[i][0] = level;
- /* Reconstruction */
- rec_intradc[i] = scale*level + pred_dc;
- /* Oddify */
- rec_intradc[i] |= 1;
- //if ((rec_intradc[i] % 2) == 0)
- // rec_intradc[i]++;
- /* Clipping */
- if (rec_intradc[i] < 0)
- rec_intradc[i] = 0;
- else if (rec_intradc[i] > 2047)
- rec_intradc[i] = 2047;
-
- /* Update AC/DC tables */
- *dc_ptr[i] = rec_intradc[i];
- if (s->block_last_index[i] >= 0)
- cbp |= 1 << (5 - i);
- }
- }else{
- for(i=0; i<6; i++) {
- /* compute cbp */
- if (s->block_last_index[i] >= 1)
- cbp |= 1 << (5 - i);
- }
- }
-
- cbpc = cbp & 3;
- if (s->pict_type == I_TYPE) {
- if(s->dquant) cbpc+=4;
- put_bits(&s->pb,
- intra_MCBPC_bits[cbpc],
- intra_MCBPC_code[cbpc]);
- } else {
- if(s->dquant) cbpc+=8;
- put_bits(&s->pb, 1, 0); /* mb coded */
- put_bits(&s->pb,
- inter_MCBPC_bits[cbpc + 4],
- inter_MCBPC_code[cbpc + 4]);
- }
- if (s->h263_aic) {
- /* XXX: currently, we do not try to use ac prediction */
- put_bits(&s->pb, 1, 0); /* no AC prediction */
- }
- cbpy = cbp >> 2;
- put_bits(&s->pb, cbpy_tab[cbpy][1], cbpy_tab[cbpy][0]);
- if(s->dquant)
- put_bits(&s->pb, 2, dquant_code[s->dquant+2]);
-
- if(interleaved_stats){
- s->misc_bits+= get_bits_diff(s);
- }
- }
-
- for(i=0; i<6; i++) {
- /* encode each block */
- h263_encode_block(s, block[i], i);
-
- /* Update INTRADC for decoding */
- if (s->h263_aic && s->mb_intra) {
- block[i][0] = rec_intradc[i];
-
- }
- }
-
- if(interleaved_stats){
- if (!s->mb_intra) {
- s->p_tex_bits+= get_bits_diff(s);
- s->f_count++;
- }else{
- s->i_tex_bits+= get_bits_diff(s);
- s->i_count++;
- }
- }
-}
-#endif
-
-void ff_h263_loop_filter(MpegEncContext * s){
- int qp_c;
- const int linesize = s->linesize;
- const int uvlinesize= s->uvlinesize;
- const int xy = s->mb_y * s->mb_stride + s->mb_x;
- uint8_t *dest_y = s->dest[0];
- uint8_t *dest_cb= s->dest[1];
- uint8_t *dest_cr= s->dest[2];
-
-// if(s->pict_type==B_TYPE && !s->readable) return;
-
- /*
- Diag Top
- Left Center
- */
- if(!IS_SKIP(s->current_picture.mb_type[xy])){
- qp_c= s->qscale;
- s->dsp.h263_v_loop_filter(dest_y+8*linesize , linesize, qp_c);
- s->dsp.h263_v_loop_filter(dest_y+8*linesize+8, linesize, qp_c);
- }else
- qp_c= 0;
-
- if(s->mb_y){
- int qp_dt, qp_t, qp_tc;
-
- if(IS_SKIP(s->current_picture.mb_type[xy-s->mb_stride]))
- qp_t=0;
- else
- qp_t= s->current_picture.qscale_table[xy-s->mb_stride];
-
- if(qp_c)
- qp_tc= qp_c;
- else
- qp_tc= qp_t;
-
- if(qp_tc){
- const int chroma_qp= s->chroma_qscale_table[qp_tc];
- s->dsp.h263_v_loop_filter(dest_y , linesize, qp_tc);
- s->dsp.h263_v_loop_filter(dest_y+8, linesize, qp_tc);
-
- s->dsp.h263_v_loop_filter(dest_cb , uvlinesize, chroma_qp);
- s->dsp.h263_v_loop_filter(dest_cr , uvlinesize, chroma_qp);
- }
-
- if(qp_t)
- s->dsp.h263_h_loop_filter(dest_y-8*linesize+8 , linesize, qp_t);
-
- if(s->mb_x){
- if(qp_t || IS_SKIP(s->current_picture.mb_type[xy-1-s->mb_stride]))
- qp_dt= qp_t;
- else
- qp_dt= s->current_picture.qscale_table[xy-1-s->mb_stride];
-
- if(qp_dt){
- const int chroma_qp= s->chroma_qscale_table[qp_dt];
- s->dsp.h263_h_loop_filter(dest_y -8*linesize , linesize, qp_dt);
- s->dsp.h263_h_loop_filter(dest_cb-8*uvlinesize, uvlinesize, chroma_qp);
- s->dsp.h263_h_loop_filter(dest_cr-8*uvlinesize, uvlinesize, chroma_qp);
- }
- }
- }
-
- if(qp_c){
- s->dsp.h263_h_loop_filter(dest_y +8, linesize, qp_c);
- if(s->mb_y + 1 == s->mb_height)
- s->dsp.h263_h_loop_filter(dest_y+8*linesize+8, linesize, qp_c);
- }
-
- if(s->mb_x){
- int qp_lc;
- if(qp_c || IS_SKIP(s->current_picture.mb_type[xy-1]))
- qp_lc= qp_c;
- else
- qp_lc= s->current_picture.qscale_table[xy-1];
-
- if(qp_lc){
- s->dsp.h263_h_loop_filter(dest_y, linesize, qp_lc);
- if(s->mb_y + 1 == s->mb_height){
- const int chroma_qp= s->chroma_qscale_table[qp_lc];
- s->dsp.h263_h_loop_filter(dest_y +8* linesize, linesize, qp_lc);
- s->dsp.h263_h_loop_filter(dest_cb , uvlinesize, chroma_qp);
- s->dsp.h263_h_loop_filter(dest_cr , uvlinesize, chroma_qp);
- }
- }
- }
-}
-
-#ifdef CONFIG_ENCODERS
-static int h263_pred_dc(MpegEncContext * s, int n, int16_t **dc_val_ptr)
-{
- int x, y, wrap, a, c, pred_dc, scale;
- int16_t *dc_val;
-
- /* find prediction */
- if (n < 4) {
- x = 2 * s->mb_x + (n & 1);
- y = 2 * s->mb_y + ((n & 2) >> 1);
- wrap = s->b8_stride;
- dc_val = s->dc_val[0];
- scale = s->y_dc_scale;
- } else {
- x = s->mb_x;
- y = s->mb_y;
- wrap = s->mb_stride;
- dc_val = s->dc_val[n - 4 + 1];
- scale = s->c_dc_scale;
- }
- /* B C
- * A X
- */
- a = dc_val[(x - 1) + (y) * wrap];
- c = dc_val[(x) + (y - 1) * wrap];
-
- /* No prediction outside GOB boundary */
- if(s->first_slice_line && n!=3){
- if(n!=2) c= 1024;
- if(n!=1 && s->mb_x == s->resync_mb_x) a= 1024;
- }
- pred_dc = 1024;
- /* just DC prediction */
- if (a != 1024 && c != 1024)
- pred_dc = (a + c) >> 1;
- else if (a != 1024)
- pred_dc = a;
- else
- pred_dc = c;
-
- /* we assume pred is positive */
- //pred_dc = (pred_dc + (scale >> 1)) / scale;
- *dc_val_ptr = &dc_val[x + y * wrap];
- return pred_dc;
-}
-#endif /* CONFIG_ENCODERS */
-
-static void h263_pred_acdc(MpegEncContext * s, DCTELEM *block, int n)
-{
- int x, y, wrap, a, c, pred_dc, scale, i;
- int16_t *dc_val, *ac_val, *ac_val1;
-
- /* find prediction */
- if (n < 4) {
- x = 2 * s->mb_x + (n & 1);
- y = 2 * s->mb_y + (n>> 1);
- wrap = s->b8_stride;
- dc_val = s->dc_val[0];
- ac_val = s->ac_val[0][0];
- scale = s->y_dc_scale;
- } else {
- x = s->mb_x;
- y = s->mb_y;
- wrap = s->mb_stride;
- dc_val = s->dc_val[n - 4 + 1];
- ac_val = s->ac_val[n - 4 + 1][0];
- scale = s->c_dc_scale;
- }
-
- ac_val += ((y) * wrap + (x)) * 16;
- ac_val1 = ac_val;
-
- /* B C
- * A X
- */
- a = dc_val[(x - 1) + (y) * wrap];
- c = dc_val[(x) + (y - 1) * wrap];
-
- /* No prediction outside GOB boundary */
- if(s->first_slice_line && n!=3){
- if(n!=2) c= 1024;
- if(n!=1 && s->mb_x == s->resync_mb_x) a= 1024;
- }
-
- if (s->ac_pred) {
- pred_dc = 1024;
- if (s->h263_aic_dir) {
- /* left prediction */
- if (a != 1024) {
- ac_val -= 16;
- for(i=1;i<8;i++) {
- block[s->dsp.idct_permutation[i<<3]] += ac_val[i];
- }
- pred_dc = a;
- }
- } else {
- /* top prediction */
- if (c != 1024) {
- ac_val -= 16 * wrap;
- for(i=1;i<8;i++) {
- block[s->dsp.idct_permutation[i ]] += ac_val[i + 8];
- }
- pred_dc = c;
- }
- }
- } else {
- /* just DC prediction */
- if (a != 1024 && c != 1024)
- pred_dc = (a + c) >> 1;
- else if (a != 1024)
- pred_dc = a;
- else
- pred_dc = c;
- }
-
- /* we assume pred is positive */
- block[0]=block[0]*scale + pred_dc;
-
- if (block[0] < 0)
- block[0] = 0;
- else
- block[0] |= 1;
-
- /* Update AC/DC tables */
- dc_val[(x) + (y) * wrap] = block[0];
-
- /* left copy */
- for(i=1;i<8;i++)
- ac_val1[i ] = block[s->dsp.idct_permutation[i<<3]];
- /* top copy */
- for(i=1;i<8;i++)
- ac_val1[8 + i] = block[s->dsp.idct_permutation[i ]];
-}
-
-int16_t *h263_pred_motion(MpegEncContext * s, int block, int dir,
- int *px, int *py)
-{
- int wrap;
- int16_t *A, *B, *C, (*mot_val)[2];
- static const int off[4]= {2, 1, 1, -1};
-
- wrap = s->b8_stride;
- mot_val = s->current_picture.motion_val[dir] + s->block_index[block];
-
- A = mot_val[ - 1];
- /* special case for first (slice) line */
- if (s->first_slice_line && block<3) {
- // we can't just change some MVs to simulate that as we need them for the B frames (and ME)
- // and if we ever support non rectangular objects than we need to do a few ifs here anyway :(
- if(block==0){ //most common case
- if(s->mb_x == s->resync_mb_x){ //rare
- *px= *py = 0;
- }else if(s->mb_x + 1 == s->resync_mb_x && s->h263_pred){ //rare
- C = mot_val[off[block] - wrap];
- if(s->mb_x==0){
- *px = C[0];
- *py = C[1];
- }else{
- *px = mid_pred(A[0], 0, C[0]);
- *py = mid_pred(A[1], 0, C[1]);
- }
- }else{
- *px = A[0];
- *py = A[1];
- }
- }else if(block==1){
- if(s->mb_x + 1 == s->resync_mb_x && s->h263_pred){ //rare
- C = mot_val[off[block] - wrap];
- *px = mid_pred(A[0], 0, C[0]);
- *py = mid_pred(A[1], 0, C[1]);
- }else{
- *px = A[0];
- *py = A[1];
- }
- }else{ /* block==2*/
- B = mot_val[ - wrap];
- C = mot_val[off[block] - wrap];
- if(s->mb_x == s->resync_mb_x) //rare
- A[0]=A[1]=0;
-
- *px = mid_pred(A[0], B[0], C[0]);
- *py = mid_pred(A[1], B[1], C[1]);
- }
- } else {
- B = mot_val[ - wrap];
- C = mot_val[off[block] - wrap];
- *px = mid_pred(A[0], B[0], C[0]);
- *py = mid_pred(A[1], B[1], C[1]);
- }
- return *mot_val;
-}
-
-#ifdef CONFIG_ENCODERS
-void ff_h263_encode_motion(MpegEncContext * s, int val, int f_code)
-{
- int range, l, bit_size, sign, code, bits;
-
- if (val == 0) {
- /* zero vector */
- code = 0;
- put_bits(&s->pb, mvtab[code][1], mvtab[code][0]);
- } else {
- bit_size = f_code - 1;
- range = 1 << bit_size;
- /* modulo encoding */
- l= INT_BIT - 6 - bit_size;
- val = (val<<l)>>l;
- sign = val>>31;
- val= (val^sign)-sign;
- sign&=1;
-
- val--;
- code = (val >> bit_size) + 1;
- bits = val & (range - 1);
-
- put_bits(&s->pb, mvtab[code][1] + 1, (mvtab[code][0] << 1) | sign);
- if (bit_size > 0) {
- put_bits(&s->pb, bit_size, bits);
- }
- }
-}
-
-/* Encode MV differences on H.263+ with Unrestricted MV mode */
-static void h263p_encode_umotion(MpegEncContext * s, int val)
-{
- short sval = 0;
- short i = 0;
- short n_bits = 0;
- short temp_val;
- int code = 0;
- int tcode;
-
- if ( val == 0)
- put_bits(&s->pb, 1, 1);
- else if (val == 1)
- put_bits(&s->pb, 3, 0);
- else if (val == -1)
- put_bits(&s->pb, 3, 2);
- else {
-
- sval = ((val < 0) ? (short)(-val):(short)val);
- temp_val = sval;
-
- while (temp_val != 0) {
- temp_val = temp_val >> 1;
- n_bits++;
- }
-
- i = n_bits - 1;
- while (i > 0) {
- tcode = (sval & (1 << (i-1))) >> (i-1);
- tcode = (tcode << 1) | 1;
- code = (code << 2) | tcode;
- i--;
- }
- code = ((code << 1) | (val < 0)) << 1;
- put_bits(&s->pb, (2*n_bits)+1, code);
- //printf("\nVal = %d\tCode = %d", sval, code);
- }
-}
-
-static void init_mv_penalty_and_fcode(MpegEncContext *s)
-{
- int f_code;
- int mv;
-
- if(mv_penalty==NULL)
- mv_penalty= av_mallocz( sizeof(uint8_t)*(MAX_FCODE+1)*(2*MAX_MV+1) );
-
- for(f_code=1; f_code<=MAX_FCODE; f_code++){
- for(mv=-MAX_MV; mv<=MAX_MV; mv++){
- int len;
-
- if(mv==0) len= mvtab[0][1];
- else{
- int val, bit_size, range, code;
-
- bit_size = f_code - 1;
- range = 1 << bit_size;
-
- val=mv;
- if (val < 0)
- val = -val;
- val--;
- code = (val >> bit_size) + 1;
- if(code<33){
- len= mvtab[code][1] + 1 + bit_size;
- }else{
- len= mvtab[32][1] + av_log2(code>>5) + 2 + bit_size;
- }
- }
-
- mv_penalty[f_code][mv+MAX_MV]= len;
- }
- }
-
- for(f_code=MAX_FCODE; f_code>0; f_code--){
- for(mv=-(16<<f_code); mv<(16<<f_code); mv++){
- fcode_tab[mv+MAX_MV]= f_code;
- }
- }
-
- for(mv=0; mv<MAX_MV*2+1; mv++){
- umv_fcode_tab[mv]= 1;
- }
-}
-#endif
-
-#ifdef CONFIG_ENCODERS
-
-static void init_uni_dc_tab(void)
-{
- int level, uni_code, uni_len;
-
- for(level=-256; level<256; level++){
- int size, v, l;
- /* find number of bits */
- size = 0;
- v = abs(level);
- while (v) {
- v >>= 1;
- size++;
- }
-
- if (level < 0)
- l= (-level) ^ ((1 << size) - 1);
- else
- l= level;
-
- /* luminance */
- uni_code= DCtab_lum[size][0];
- uni_len = DCtab_lum[size][1];
-
- if (size > 0) {
- uni_code<<=size; uni_code|=l;
- uni_len+=size;
- if (size > 8){
- uni_code<<=1; uni_code|=1;
- uni_len++;
- }
- }
- uni_DCtab_lum_bits[level+256]= uni_code;
- uni_DCtab_lum_len [level+256]= uni_len;
-
- /* chrominance */
- uni_code= DCtab_chrom[size][0];
- uni_len = DCtab_chrom[size][1];
-
- if (size > 0) {
- uni_code<<=size; uni_code|=l;
- uni_len+=size;
- if (size > 8){
- uni_code<<=1; uni_code|=1;
- uni_len++;
- }
- }
- uni_DCtab_chrom_bits[level+256]= uni_code;
- uni_DCtab_chrom_len [level+256]= uni_len;
-
- }
-}
-
-#endif //CONFIG_ENCODERS
-
-#ifdef CONFIG_ENCODERS
-static void init_uni_mpeg4_rl_tab(RLTable *rl, uint32_t *bits_tab, uint8_t *len_tab){
- int slevel, run, last;
-
- assert(MAX_LEVEL >= 64);
- assert(MAX_RUN >= 63);
-
- for(slevel=-64; slevel<64; slevel++){
- if(slevel==0) continue;
- for(run=0; run<64; run++){
- for(last=0; last<=1; last++){
- const int index= UNI_MPEG4_ENC_INDEX(last, run, slevel+64);
- int level= slevel < 0 ? -slevel : slevel;
- int sign= slevel < 0 ? 1 : 0;
- int bits, len, code;
- int level1, run1;
-
- len_tab[index]= 100;
-
- /* ESC0 */
- code= get_rl_index(rl, last, run, level);
- bits= rl->table_vlc[code][0];
- len= rl->table_vlc[code][1];
- bits=bits*2+sign; len++;
-
- if(code!=rl->n && len < len_tab[index]){
- bits_tab[index]= bits;
- len_tab [index]= len;
- }
-#if 1
- /* ESC1 */
- bits= rl->table_vlc[rl->n][0];
- len= rl->table_vlc[rl->n][1];
- bits=bits*2; len++; //esc1
- level1= level - rl->max_level[last][run];
- if(level1>0){
- code= get_rl_index(rl, last, run, level1);
- bits<<= rl->table_vlc[code][1];
- len += rl->table_vlc[code][1];
- bits += rl->table_vlc[code][0];
- bits=bits*2+sign; len++;
-
- if(code!=rl->n && len < len_tab[index]){
- bits_tab[index]= bits;
- len_tab [index]= len;
- }
- }
-#endif
-#if 1
- /* ESC2 */
- bits= rl->table_vlc[rl->n][0];
- len= rl->table_vlc[rl->n][1];
- bits=bits*4+2; len+=2; //esc2
- run1 = run - rl->max_run[last][level] - 1;
- if(run1>=0){
- code= get_rl_index(rl, last, run1, level);
- bits<<= rl->table_vlc[code][1];
- len += rl->table_vlc[code][1];
- bits += rl->table_vlc[code][0];
- bits=bits*2+sign; len++;
-
- if(code!=rl->n && len < len_tab[index]){
- bits_tab[index]= bits;
- len_tab [index]= len;
- }
- }
-#endif
- /* ESC3 */
- bits= rl->table_vlc[rl->n][0];
- len = rl->table_vlc[rl->n][1];
- bits=bits*4+3; len+=2; //esc3
- bits=bits*2+last; len++;
- bits=bits*64+run; len+=6;
- bits=bits*2+1; len++; //marker
- bits=bits*4096+(slevel&0xfff); len+=12;
- bits=bits*2+1; len++; //marker
-
- if(len < len_tab[index]){
- bits_tab[index]= bits;
- len_tab [index]= len;
- }
- }
- }
- }
-}
-
-static void init_uni_h263_rl_tab(RLTable *rl, uint32_t *bits_tab, uint8_t *len_tab){
- int slevel, run, last;
-
- assert(MAX_LEVEL >= 64);
- assert(MAX_RUN >= 63);
-
- for(slevel=-64; slevel<64; slevel++){
- if(slevel==0) continue;
- for(run=0; run<64; run++){
- for(last=0; last<=1; last++){
- const int index= UNI_MPEG4_ENC_INDEX(last, run, slevel+64);
- int level= slevel < 0 ? -slevel : slevel;
- int sign= slevel < 0 ? 1 : 0;
- int bits, len, code;
-
- len_tab[index]= 100;
-
- /* ESC0 */
- code= get_rl_index(rl, last, run, level);
- bits= rl->table_vlc[code][0];
- len= rl->table_vlc[code][1];
- bits=bits*2+sign; len++;
-
- if(code!=rl->n && len < len_tab[index]){
- if(bits_tab) bits_tab[index]= bits;
- len_tab [index]= len;
- }
- /* ESC */
- bits= rl->table_vlc[rl->n][0];
- len = rl->table_vlc[rl->n][1];
- bits=bits*2+last; len++;
- bits=bits*64+run; len+=6;
- bits=bits*256+(level&0xff); len+=8;
-
- if(len < len_tab[index]){
- if(bits_tab) bits_tab[index]= bits;
- len_tab [index]= len;
- }
- }
- }
- }
-}
-
-void h263_encode_init(MpegEncContext *s)
-{
- static int done = 0;
-
- if (!done) {
- done = 1;
-
- init_uni_dc_tab();
-
- init_rl(&rl_inter, 1);
- init_rl(&rl_intra, 1);
- init_rl(&rl_intra_aic, 1);
-
- init_uni_mpeg4_rl_tab(&rl_intra, uni_mpeg4_intra_rl_bits, uni_mpeg4_intra_rl_len);
- init_uni_mpeg4_rl_tab(&rl_inter, uni_mpeg4_inter_rl_bits, uni_mpeg4_inter_rl_len);
-
- init_uni_h263_rl_tab(&rl_intra_aic, NULL, uni_h263_intra_aic_rl_len);
- init_uni_h263_rl_tab(&rl_inter , NULL, uni_h263_inter_rl_len);
-
- init_mv_penalty_and_fcode(s);
- }
- s->me.mv_penalty= mv_penalty; //FIXME exact table for msmpeg4 & h263p
-
- s->intra_ac_vlc_length =s->inter_ac_vlc_length = uni_h263_inter_rl_len;
- s->intra_ac_vlc_last_length=s->inter_ac_vlc_last_length= uni_h263_inter_rl_len + 128*64;
- if(s->h263_aic){
- s->intra_ac_vlc_length = uni_h263_intra_aic_rl_len;
- s->intra_ac_vlc_last_length= uni_h263_intra_aic_rl_len + 128*64;
- }
- s->ac_esc_length= 7+1+6+8;
-
- // use fcodes >1 only for mpeg4 & h263 & h263p FIXME
- switch(s->codec_id){
- case CODEC_ID_MPEG4:
- s->fcode_tab= fcode_tab;
- s->min_qcoeff= -2048;
- s->max_qcoeff= 2047;
- s->intra_ac_vlc_length = uni_mpeg4_intra_rl_len;
- s->intra_ac_vlc_last_length= uni_mpeg4_intra_rl_len + 128*64;
- s->inter_ac_vlc_length = uni_mpeg4_inter_rl_len;
- s->inter_ac_vlc_last_length= uni_mpeg4_inter_rl_len + 128*64;
- s->luma_dc_vlc_length= uni_DCtab_lum_len;
- s->chroma_dc_vlc_length= uni_DCtab_chrom_len;
- s->ac_esc_length= 7+2+1+6+1+12+1;
- s->y_dc_scale_table= ff_mpeg4_y_dc_scale_table;
- s->c_dc_scale_table= ff_mpeg4_c_dc_scale_table;
-
- if(s->flags & CODEC_FLAG_GLOBAL_HEADER){
-
- s->avctx->extradata= av_malloc(1024);
- init_put_bits(&s->pb, s->avctx->extradata, 1024);
-
- if(!(s->workaround_bugs & FF_BUG_MS))
- mpeg4_encode_visual_object_header(s);
- mpeg4_encode_vol_header(s, 0, 0);
-
-// ff_mpeg4_stuffing(&s->pb); ?
- flush_put_bits(&s->pb);
- s->avctx->extradata_size= (put_bits_count(&s->pb)+7)>>3;
- }
-
- break;
- case CODEC_ID_H263P:
- if(s->umvplus)
- s->fcode_tab= umv_fcode_tab;
- if(s->modified_quant){
- s->min_qcoeff= -2047;
- s->max_qcoeff= 2047;
- }else{
- s->min_qcoeff= -127;
- s->max_qcoeff= 127;
- }
- break;
- //Note for mpeg4 & h263 the dc-scale table will be set per frame as needed later
- case CODEC_ID_FLV1:
- if (s->h263_flv > 1) {
- s->min_qcoeff= -1023;
- s->max_qcoeff= 1023;
- } else {
- s->min_qcoeff= -127;
- s->max_qcoeff= 127;
- }
- s->y_dc_scale_table=
- s->c_dc_scale_table= ff_mpeg1_dc_scale_table;
- break;
- default: //nothing needed - default table already set in mpegvideo.c
- s->min_qcoeff= -127;
- s->max_qcoeff= 127;
- s->y_dc_scale_table=
- s->c_dc_scale_table= ff_mpeg1_dc_scale_table;
- }
-}
-
-/**
- * encodes a 8x8 block.
- * @param block the 8x8 block
- * @param n block index (0-3 are luma, 4-5 are chroma)
- */
-static void h263_encode_block(MpegEncContext * s, DCTELEM * block, int n)
-{
- int level, run, last, i, j, last_index, last_non_zero, sign, slevel, code;
- RLTable *rl;
-
- rl = &rl_inter;
- if (s->mb_intra && !s->h263_aic) {
- /* DC coef */
- level = block[0];
- /* 255 cannot be represented, so we clamp */
- if (level > 254) {
- level = 254;
- block[0] = 254;
- }
- /* 0 cannot be represented also */
- else if (level < 1) {
- level = 1;
- block[0] = 1;
- }
- if (level == 128) //FIXME check rv10
- put_bits(&s->pb, 8, 0xff);
- else
- put_bits(&s->pb, 8, level);
- i = 1;
- } else {
- i = 0;
- if (s->h263_aic && s->mb_intra)
- rl = &rl_intra_aic;
-
- if(s->alt_inter_vlc && !s->mb_intra){
- int aic_vlc_bits=0;
- int inter_vlc_bits=0;
- int wrong_pos=-1;
- int aic_code;
-
- last_index = s->block_last_index[n];
- last_non_zero = i - 1;
- for (; i <= last_index; i++) {
- j = s->intra_scantable.permutated[i];
- level = block[j];
- if (level) {
- run = i - last_non_zero - 1;
- last = (i == last_index);
-
- if(level<0) level= -level;
-
- code = get_rl_index(rl, last, run, level);
- aic_code = get_rl_index(&rl_intra_aic, last, run, level);
- inter_vlc_bits += rl->table_vlc[code][1]+1;
- aic_vlc_bits += rl_intra_aic.table_vlc[aic_code][1]+1;
-
- if (code == rl->n) {
- inter_vlc_bits += 1+6+8-1;
- }
- if (aic_code == rl_intra_aic.n) {
- aic_vlc_bits += 1+6+8-1;
- wrong_pos += run + 1;
- }else
- wrong_pos += wrong_run[aic_code];
- last_non_zero = i;
- }
- }
- i = 0;
- if(aic_vlc_bits < inter_vlc_bits && wrong_pos > 63)
- rl = &rl_intra_aic;
- }
- }
-
- /* AC coefs */
- last_index = s->block_last_index[n];
- last_non_zero = i - 1;
- for (; i <= last_index; i++) {
- j = s->intra_scantable.permutated[i];
- level = block[j];
- if (level) {
- run = i - last_non_zero - 1;
- last = (i == last_index);
- sign = 0;
- slevel = level;
- if (level < 0) {
- sign = 1;
- level = -level;
- }
- code = get_rl_index(rl, last, run, level);
- put_bits(&s->pb, rl->table_vlc[code][1], rl->table_vlc[code][0]);
- if (code == rl->n) {
- if(s->h263_flv <= 1){
- put_bits(&s->pb, 1, last);
- put_bits(&s->pb, 6, run);
-
- assert(slevel != 0);
-
- if(level < 128)
- put_bits(&s->pb, 8, slevel & 0xff);
- else{
- put_bits(&s->pb, 8, 128);
- put_bits(&s->pb, 5, slevel & 0x1f);
- put_bits(&s->pb, 6, (slevel>>5)&0x3f);
- }
- }else{
- if(level < 64) { // 7-bit level
- put_bits(&s->pb, 1, 0);
- put_bits(&s->pb, 1, last);
- put_bits(&s->pb, 6, run);
-
- put_bits(&s->pb, 7, slevel & 0x7f);
- } else {
- /* 11-bit level */
- put_bits(&s->pb, 1, 1);
- put_bits(&s->pb, 1, last);
- put_bits(&s->pb, 6, run);
-
- put_bits(&s->pb, 11, slevel & 0x7ff);
- }
- }
- } else {
- put_bits(&s->pb, 1, sign);
- }
- last_non_zero = i;
- }
- }
-}
-#endif
-
-#ifdef CONFIG_ENCODERS
-
-/***************************************************/
-/**
- * add mpeg4 stuffing bits (01...1)
- */
-void ff_mpeg4_stuffing(PutBitContext * pbc)
-{
- int length;
- put_bits(pbc, 1, 0);
- length= (-put_bits_count(pbc))&7;
- if(length) put_bits(pbc, length, (1<<length)-1);
-}
-
-/* must be called before writing the header */
-void ff_set_mpeg4_time(MpegEncContext * s, int picture_number){
- int time_div, time_mod;
-
- assert(s->current_picture_ptr->pts != AV_NOPTS_VALUE);
- s->time= s->current_picture_ptr->pts*s->avctx->time_base.num;
-
- time_div= s->time/s->avctx->time_base.den;
- time_mod= s->time%s->avctx->time_base.den;
-
- if(s->pict_type==B_TYPE){
- s->pb_time= s->pp_time - (s->last_non_b_time - s->time);
- assert(s->pb_time > 0 && s->pb_time < s->pp_time);
- ff_mpeg4_init_direct_mv(s);
- }else{
- s->last_time_base= s->time_base;
- s->time_base= time_div;
- s->pp_time= s->time - s->last_non_b_time;
- s->last_non_b_time= s->time;
- assert(picture_number==0 || s->pp_time > 0);
- }
-}
-
-static void mpeg4_encode_gop_header(MpegEncContext * s){
- int hours, minutes, seconds;
- int64_t time;
-
- put_bits(&s->pb, 16, 0);
- put_bits(&s->pb, 16, GOP_STARTCODE);
-
- time= s->current_picture_ptr->pts;
- if(s->reordered_input_picture[1])
- time= FFMIN(time, s->reordered_input_picture[1]->pts);
- time= time*s->avctx->time_base.num;
-
- seconds= time/s->avctx->time_base.den;
- minutes= seconds/60; seconds %= 60;
- hours= minutes/60; minutes %= 60;
- hours%=24;
-
- put_bits(&s->pb, 5, hours);
- put_bits(&s->pb, 6, minutes);
- put_bits(&s->pb, 1, 1);
- put_bits(&s->pb, 6, seconds);
-
- put_bits(&s->pb, 1, !!(s->flags&CODEC_FLAG_CLOSED_GOP));
- put_bits(&s->pb, 1, 0); //broken link == NO
-
- s->last_time_base= time / s->avctx->time_base.den;
-
- ff_mpeg4_stuffing(&s->pb);
-}
-
-static void mpeg4_encode_visual_object_header(MpegEncContext * s){
- int profile_and_level_indication;
- int vo_ver_id;
-
- if(s->avctx->profile != FF_PROFILE_UNKNOWN){
- profile_and_level_indication = s->avctx->profile << 4;
- }else if(s->max_b_frames || s->quarter_sample){
- profile_and_level_indication= 0xF0; // adv simple
- }else{
- profile_and_level_indication= 0x00; // simple
- }
-
- if(s->avctx->level != FF_LEVEL_UNKNOWN){
- profile_and_level_indication |= s->avctx->level;
- }else{
- profile_and_level_indication |= 1; //level 1
- }
-
- if(profile_and_level_indication>>4 == 0xF){
- vo_ver_id= 5;
- }else{
- vo_ver_id= 1;
- }
-
- //FIXME levels
-
- put_bits(&s->pb, 16, 0);
- put_bits(&s->pb, 16, VOS_STARTCODE);
-
- put_bits(&s->pb, 8, profile_and_level_indication);
-
- put_bits(&s->pb, 16, 0);
- put_bits(&s->pb, 16, VISUAL_OBJ_STARTCODE);
-
- put_bits(&s->pb, 1, 1);
- put_bits(&s->pb, 4, vo_ver_id);
- put_bits(&s->pb, 3, 1); //priority
-
- put_bits(&s->pb, 4, 1); //visual obj type== video obj
-
- put_bits(&s->pb, 1, 0); //video signal type == no clue //FIXME
-
- ff_mpeg4_stuffing(&s->pb);
-}
-
-static void mpeg4_encode_vol_header(MpegEncContext * s, int vo_number, int vol_number)
-{
- int vo_ver_id;
-
- if(s->max_b_frames || s->quarter_sample){
- vo_ver_id= 5;
- s->vo_type= ADV_SIMPLE_VO_TYPE;
- }else{
- vo_ver_id= 1;
- s->vo_type= SIMPLE_VO_TYPE;
- }
-
- put_bits(&s->pb, 16, 0);
- put_bits(&s->pb, 16, 0x100 + vo_number); /* video obj */
- put_bits(&s->pb, 16, 0);
- put_bits(&s->pb, 16, 0x120 + vol_number); /* video obj layer */
-
- put_bits(&s->pb, 1, 0); /* random access vol */
- put_bits(&s->pb, 8, s->vo_type); /* video obj type indication */
- if(s->workaround_bugs & FF_BUG_MS) {
- put_bits(&s->pb, 1, 0); /* is obj layer id= no */
- } else {
- put_bits(&s->pb, 1, 1); /* is obj layer id= yes */
- put_bits(&s->pb, 4, vo_ver_id); /* is obj layer ver id */
- put_bits(&s->pb, 3, 1); /* is obj layer priority */
- }
-
- aspect_to_info(s, s->avctx->sample_aspect_ratio);
-
- put_bits(&s->pb, 4, s->aspect_ratio_info);/* aspect ratio info */
- if (s->aspect_ratio_info == FF_ASPECT_EXTENDED){
- put_bits(&s->pb, 8, s->avctx->sample_aspect_ratio.num);
- put_bits(&s->pb, 8, s->avctx->sample_aspect_ratio.den);
- }
-
- if(s->workaround_bugs & FF_BUG_MS) { //
- put_bits(&s->pb, 1, 0); /* vol control parameters= no @@@ */
- } else {
- put_bits(&s->pb, 1, 1); /* vol control parameters= yes */
- put_bits(&s->pb, 2, 1); /* chroma format YUV 420/YV12 */
- put_bits(&s->pb, 1, s->low_delay);
- put_bits(&s->pb, 1, 0); /* vbv parameters= no */
- }
-
- put_bits(&s->pb, 2, RECT_SHAPE); /* vol shape= rectangle */
- put_bits(&s->pb, 1, 1); /* marker bit */
-
- put_bits(&s->pb, 16, s->avctx->time_base.den);
- if (s->time_increment_bits < 1)
- s->time_increment_bits = 1;
- put_bits(&s->pb, 1, 1); /* marker bit */
- put_bits(&s->pb, 1, 0); /* fixed vop rate=no */
- put_bits(&s->pb, 1, 1); /* marker bit */
- put_bits(&s->pb, 13, s->width); /* vol width */
- put_bits(&s->pb, 1, 1); /* marker bit */
- put_bits(&s->pb, 13, s->height); /* vol height */
- put_bits(&s->pb, 1, 1); /* marker bit */
- put_bits(&s->pb, 1, s->progressive_sequence ? 0 : 1);
- put_bits(&s->pb, 1, 1); /* obmc disable */
- if (vo_ver_id == 1) {
- put_bits(&s->pb, 1, s->vol_sprite_usage); /* sprite enable */
- }else{
- put_bits(&s->pb, 2, s->vol_sprite_usage); /* sprite enable */
- }
-
- put_bits(&s->pb, 1, 0); /* not 8 bit == false */
- put_bits(&s->pb, 1, s->mpeg_quant); /* quant type= (0=h263 style)*/
-
- if(s->mpeg_quant){
- ff_write_quant_matrix(&s->pb, s->avctx->intra_matrix);
- ff_write_quant_matrix(&s->pb, s->avctx->inter_matrix);
- }
-
- if (vo_ver_id != 1)
- put_bits(&s->pb, 1, s->quarter_sample);
- put_bits(&s->pb, 1, 1); /* complexity estimation disable */
- s->resync_marker= s->rtp_mode;
- put_bits(&s->pb, 1, s->resync_marker ? 0 : 1);/* resync marker disable */
- put_bits(&s->pb, 1, s->data_partitioning ? 1 : 0);
- if(s->data_partitioning){
- put_bits(&s->pb, 1, 0); /* no rvlc */
- }
-
- if (vo_ver_id != 1){
- put_bits(&s->pb, 1, 0); /* newpred */
- put_bits(&s->pb, 1, 0); /* reduced res vop */
- }
- put_bits(&s->pb, 1, 0); /* scalability */
-
- ff_mpeg4_stuffing(&s->pb);
-
- /* user data */
- if(!(s->flags & CODEC_FLAG_BITEXACT)){
- put_bits(&s->pb, 16, 0);
- put_bits(&s->pb, 16, 0x1B2); /* user_data */
- ff_put_string(&s->pb, LIBAVCODEC_IDENT, 0);
- }
-}
-
-/* write mpeg4 VOP header */
-void mpeg4_encode_picture_header(MpegEncContext * s, int picture_number)
-{
- int time_incr;
- int time_div, time_mod;
-
- if(s->pict_type==I_TYPE){
- if(!(s->flags&CODEC_FLAG_GLOBAL_HEADER)){
- if(s->strict_std_compliance < FF_COMPLIANCE_VERY_STRICT) //HACK, the reference sw is buggy
- mpeg4_encode_visual_object_header(s);
- if(s->strict_std_compliance < FF_COMPLIANCE_VERY_STRICT || picture_number==0) //HACK, the reference sw is buggy
- mpeg4_encode_vol_header(s, 0, 0);
- }
- if(!(s->workaround_bugs & FF_BUG_MS))
- mpeg4_encode_gop_header(s);
- }
-
- s->partitioned_frame= s->data_partitioning && s->pict_type!=B_TYPE;
-
-//printf("num:%d rate:%d base:%d\n", s->picture_number, s->time_base.den, FRAME_RATE_BASE);
-
- put_bits(&s->pb, 16, 0); /* vop header */
- put_bits(&s->pb, 16, VOP_STARTCODE); /* vop header */
- put_bits(&s->pb, 2, s->pict_type - 1); /* pict type: I = 0 , P = 1 */
-
- assert(s->time>=0);
- time_div= s->time/s->avctx->time_base.den;
- time_mod= s->time%s->avctx->time_base.den;
- time_incr= time_div - s->last_time_base;
- assert(time_incr >= 0);
- while(time_incr--)
- put_bits(&s->pb, 1, 1);
-
- put_bits(&s->pb, 1, 0);
-
- put_bits(&s->pb, 1, 1); /* marker */
- put_bits(&s->pb, s->time_increment_bits, time_mod); /* time increment */
- put_bits(&s->pb, 1, 1); /* marker */
- put_bits(&s->pb, 1, 1); /* vop coded */
- if ( s->pict_type == P_TYPE
- || (s->pict_type == S_TYPE && s->vol_sprite_usage==GMC_SPRITE)) {
- put_bits(&s->pb, 1, s->no_rounding); /* rounding type */
- }
- put_bits(&s->pb, 3, 0); /* intra dc VLC threshold */
- if(!s->progressive_sequence){
- put_bits(&s->pb, 1, s->current_picture_ptr->top_field_first);
- put_bits(&s->pb, 1, s->alternate_scan);
- }
- //FIXME sprite stuff
-
- put_bits(&s->pb, 5, s->qscale);
-
- if (s->pict_type != I_TYPE)
- put_bits(&s->pb, 3, s->f_code); /* fcode_for */
- if (s->pict_type == B_TYPE)
- put_bits(&s->pb, 3, s->b_code); /* fcode_back */
- // printf("****frame %d\n", picture_number);
-}
-
-#endif //CONFIG_ENCODERS
-
-/**
- * set qscale and update qscale dependant variables.
- */
-void ff_set_qscale(MpegEncContext * s, int qscale)
-{
- if (qscale < 1)
- qscale = 1;
- else if (qscale > 31)
- qscale = 31;
-
- s->qscale = qscale;
- s->chroma_qscale= s->chroma_qscale_table[qscale];
-
- s->y_dc_scale= s->y_dc_scale_table[ qscale ];
- s->c_dc_scale= s->c_dc_scale_table[ s->chroma_qscale ];
-}
-
-/**
- * predicts the dc.
- * encoding quantized level -> quantized diff
- * decoding quantized diff -> quantized level
- * @param n block index (0-3 are luma, 4-5 are chroma)
- * @param dir_ptr pointer to an integer where the prediction direction will be stored
- */
-static inline int ff_mpeg4_pred_dc(MpegEncContext * s, int n, int level, int *dir_ptr, int encoding)
-{
- int a, b, c, wrap, pred, scale, ret;
- int16_t *dc_val;
-
- /* find prediction */
- if (n < 4) {
- scale = s->y_dc_scale;
- } else {
- scale = s->c_dc_scale;
- }
- if(IS_3IV1)
- scale= 8;
-
- wrap= s->block_wrap[n];
- dc_val = s->dc_val[0] + s->block_index[n];
-
- /* B C
- * A X
- */
- a = dc_val[ - 1];
- b = dc_val[ - 1 - wrap];
- c = dc_val[ - wrap];
-
- /* outside slice handling (we can't do that by memset as we need the dc for error resilience) */
- if(s->first_slice_line && n!=3){
- if(n!=2) b=c= 1024;
- if(n!=1 && s->mb_x == s->resync_mb_x) b=a= 1024;
- }
- if(s->mb_x == s->resync_mb_x && s->mb_y == s->resync_mb_y+1){
- if(n==0 || n==4 || n==5)
- b=1024;
- }
-
- if (abs(a - b) < abs(b - c)) {
- pred = c;
- *dir_ptr = 1; /* top */
- } else {
- pred = a;
- *dir_ptr = 0; /* left */
- }
- /* we assume pred is positive */
- pred = FASTDIV((pred + (scale >> 1)), scale);
-
- if(encoding){
- ret = level - pred;
- }else{
- level += pred;
- ret= level;
- if(s->error_resilience>=3){
- if(level<0){
- av_log(s->avctx, AV_LOG_ERROR, "dc<0 at %dx%d\n", s->mb_x, s->mb_y);
- return -1;
- }
- if(level*scale > 2048 + scale){
- av_log(s->avctx, AV_LOG_ERROR, "dc overflow at %dx%d\n", s->mb_x, s->mb_y);
- return -1;
- }
- }
- }
- level *=scale;
- if(level&(~2047)){
- if(level<0)
- level=0;
- else if(!(s->workaround_bugs&FF_BUG_DC_CLIP))
- level=2047;
- }
- dc_val[0]= level;
-
- return ret;
-}
-
-/**
- * predicts the ac.
- * @param n block index (0-3 are luma, 4-5 are chroma)
- * @param dir the ac prediction direction
- */
-void mpeg4_pred_ac(MpegEncContext * s, DCTELEM *block, int n,
- int dir)
-{
- int i;
- int16_t *ac_val, *ac_val1;
- int8_t * const qscale_table= s->current_picture.qscale_table;
-
- /* find prediction */
- ac_val = s->ac_val[0][0] + s->block_index[n] * 16;
- ac_val1 = ac_val;
- if (s->ac_pred) {
- if (dir == 0) {
- const int xy= s->mb_x-1 + s->mb_y*s->mb_stride;
- /* left prediction */
- ac_val -= 16;
-
- if(s->mb_x==0 || s->qscale == qscale_table[xy] || n==1 || n==3){
- /* same qscale */
- for(i=1;i<8;i++) {
- block[s->dsp.idct_permutation[i<<3]] += ac_val[i];
- }
- }else{
- /* different qscale, we must rescale */
- for(i=1;i<8;i++) {
- block[s->dsp.idct_permutation[i<<3]] += ROUNDED_DIV(ac_val[i]*qscale_table[xy], s->qscale);
- }
- }
- } else {
- const int xy= s->mb_x + s->mb_y*s->mb_stride - s->mb_stride;
- /* top prediction */
- ac_val -= 16 * s->block_wrap[n];
-
- if(s->mb_y==0 || s->qscale == qscale_table[xy] || n==2 || n==3){
- /* same qscale */
- for(i=1;i<8;i++) {
- block[s->dsp.idct_permutation[i]] += ac_val[i + 8];
- }
- }else{
- /* different qscale, we must rescale */
- for(i=1;i<8;i++) {
- block[s->dsp.idct_permutation[i]] += ROUNDED_DIV(ac_val[i + 8]*qscale_table[xy], s->qscale);
- }
- }
- }
- }
- /* left copy */
- for(i=1;i<8;i++)
- ac_val1[i ] = block[s->dsp.idct_permutation[i<<3]];
-
- /* top copy */
- for(i=1;i<8;i++)
- ac_val1[8 + i] = block[s->dsp.idct_permutation[i ]];
-
-}
-
-#ifdef CONFIG_ENCODERS
-
-/**
- * encodes the dc value.
- * @param n block index (0-3 are luma, 4-5 are chroma)
- */
-static inline void mpeg4_encode_dc(PutBitContext * s, int level, int n)
-{
-#if 1
-// if(level<-255 || level>255) printf("dc overflow\n");
- level+=256;
- if (n < 4) {
- /* luminance */
- put_bits(s, uni_DCtab_lum_len[level], uni_DCtab_lum_bits[level]);
- } else {
- /* chrominance */
- put_bits(s, uni_DCtab_chrom_len[level], uni_DCtab_chrom_bits[level]);
- }
-#else
- int size, v;
- /* find number of bits */
- size = 0;
- v = abs(level);
- while (v) {
- v >>= 1;
- size++;
- }
-
- if (n < 4) {
- /* luminance */
- put_bits(&s->pb, DCtab_lum[size][1], DCtab_lum[size][0]);
- } else {
- /* chrominance */
- put_bits(&s->pb, DCtab_chrom[size][1], DCtab_chrom[size][0]);
- }
-
- /* encode remaining bits */
- if (size > 0) {
- if (level < 0)
- level = (-level) ^ ((1 << size) - 1);
- put_bits(&s->pb, size, level);
- if (size > 8)
- put_bits(&s->pb, 1, 1);
- }
-#endif
-}
-
-static inline int mpeg4_get_dc_length(int level, int n){
- if (n < 4) {
- return uni_DCtab_lum_len[level + 256];
- } else {
- return uni_DCtab_chrom_len[level + 256];
- }
-}
-
-/**
- * encodes a 8x8 block
- * @param n block index (0-3 are luma, 4-5 are chroma)
- */
-static inline void mpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n, int intra_dc,
- uint8_t *scan_table, PutBitContext *dc_pb, PutBitContext *ac_pb)
-{
- int i, last_non_zero;
-#if 0 //variables for the outcommented version
- int code, sign, last;
-#endif
- const RLTable *rl;
- uint32_t *bits_tab;
- uint8_t *len_tab;
- const int last_index = s->block_last_index[n];
-
- if (s->mb_intra) { //Note gcc (3.2.1 at least) will optimize this away
- /* mpeg4 based DC predictor */
- mpeg4_encode_dc(dc_pb, intra_dc, n);
- if(last_index<1) return;
- i = 1;
- rl = &rl_intra;
- bits_tab= uni_mpeg4_intra_rl_bits;
- len_tab = uni_mpeg4_intra_rl_len;
- } else {
- if(last_index<0) return;
- i = 0;
- rl = &rl_inter;
- bits_tab= uni_mpeg4_inter_rl_bits;
- len_tab = uni_mpeg4_inter_rl_len;
- }
-
- /* AC coefs */
- last_non_zero = i - 1;
-#if 1
- for (; i < last_index; i++) {
- int level = block[ scan_table[i] ];
- if (level) {
- int run = i - last_non_zero - 1;
- level+=64;
- if((level&(~127)) == 0){
- const int index= UNI_MPEG4_ENC_INDEX(0, run, level);
- put_bits(ac_pb, len_tab[index], bits_tab[index]);
- }else{ //ESC3
- put_bits(ac_pb, 7+2+1+6+1+12+1, (3<<23)+(3<<21)+(0<<20)+(run<<14)+(1<<13)+(((level-64)&0xfff)<<1)+1);
- }
- last_non_zero = i;
- }
- }
- /*if(i<=last_index)*/{
- int level = block[ scan_table[i] ];
- int run = i - last_non_zero - 1;
- level+=64;
- if((level&(~127)) == 0){
- const int index= UNI_MPEG4_ENC_INDEX(1, run, level);
- put_bits(ac_pb, len_tab[index], bits_tab[index]);
- }else{ //ESC3
- put_bits(ac_pb, 7+2+1+6+1+12+1, (3<<23)+(3<<21)+(1<<20)+(run<<14)+(1<<13)+(((level-64)&0xfff)<<1)+1);
- }
- }
-#else
- for (; i <= last_index; i++) {
- const int slevel = block[ scan_table[i] ];
- if (slevel) {
- int level;
- int run = i - last_non_zero - 1;
- last = (i == last_index);
- sign = 0;
- level = slevel;
- if (level < 0) {
- sign = 1;
- level = -level;
- }
- code = get_rl_index(rl, last, run, level);
- put_bits(ac_pb, rl->table_vlc[code][1], rl->table_vlc[code][0]);
- if (code == rl->n) {
- int level1, run1;
- level1 = level - rl->max_level[last][run];
- if (level1 < 1)
- goto esc2;
- code = get_rl_index(rl, last, run, level1);
- if (code == rl->n) {
- esc2:
- put_bits(ac_pb, 1, 1);
- if (level > MAX_LEVEL)
- goto esc3;
- run1 = run - rl->max_run[last][level] - 1;
- if (run1 < 0)
- goto esc3;
- code = get_rl_index(rl, last, run1, level);
- if (code == rl->n) {
- esc3:
- /* third escape */
- put_bits(ac_pb, 1, 1);
- put_bits(ac_pb, 1, last);
- put_bits(ac_pb, 6, run);
- put_bits(ac_pb, 1, 1);
- put_bits(ac_pb, 12, slevel & 0xfff);
- put_bits(ac_pb, 1, 1);
- } else {
- /* second escape */
- put_bits(ac_pb, 1, 0);
- put_bits(ac_pb, rl->table_vlc[code][1], rl->table_vlc[code][0]);
- put_bits(ac_pb, 1, sign);
- }
- } else {
- /* first escape */
- put_bits(ac_pb, 1, 0);
- put_bits(ac_pb, rl->table_vlc[code][1], rl->table_vlc[code][0]);
- put_bits(ac_pb, 1, sign);
- }
- } else {
- put_bits(ac_pb, 1, sign);
- }
- last_non_zero = i;
- }
- }
-#endif
-}
-
-static int mpeg4_get_block_length(MpegEncContext * s, DCTELEM * block, int n, int intra_dc,
- uint8_t *scan_table)
-{
- int i, last_non_zero;
- const RLTable *rl;
- uint8_t *len_tab;
- const int last_index = s->block_last_index[n];
- int len=0;
-
- if (s->mb_intra) { //Note gcc (3.2.1 at least) will optimize this away
- /* mpeg4 based DC predictor */
- len += mpeg4_get_dc_length(intra_dc, n);
- if(last_index<1) return len;
- i = 1;
- rl = &rl_intra;
- len_tab = uni_mpeg4_intra_rl_len;
- } else {
- if(last_index<0) return 0;
- i = 0;
- rl = &rl_inter;
- len_tab = uni_mpeg4_inter_rl_len;
- }
-
- /* AC coefs */
- last_non_zero = i - 1;
- for (; i < last_index; i++) {
- int level = block[ scan_table[i] ];
- if (level) {
- int run = i - last_non_zero - 1;
- level+=64;
- if((level&(~127)) == 0){
- const int index= UNI_MPEG4_ENC_INDEX(0, run, level);
- len += len_tab[index];
- }else{ //ESC3
- len += 7+2+1+6+1+12+1;
- }
- last_non_zero = i;
- }
- }
- /*if(i<=last_index)*/{
- int level = block[ scan_table[i] ];
- int run = i - last_non_zero - 1;
- level+=64;
- if((level&(~127)) == 0){
- const int index= UNI_MPEG4_ENC_INDEX(1, run, level);
- len += len_tab[index];
- }else{ //ESC3
- len += 7+2+1+6+1+12+1;
- }
- }
-
- return len;
-}
-
-#endif
-
-
-/***********************************************/
-/* decoding */
-
-static VLC intra_MCBPC_vlc;
-static VLC inter_MCBPC_vlc;
-static VLC cbpy_vlc;
-static VLC mv_vlc;
-static VLC dc_lum, dc_chrom;
-static VLC sprite_trajectory;
-static VLC mb_type_b_vlc;
-static VLC h263_mbtype_b_vlc;
-static VLC cbpc_b_vlc;
-
-void init_vlc_rl(RLTable *rl, int use_static)
-{
- int i, q;
-
- /* Return if static table is already initialized */
- if(use_static && rl->rl_vlc[0])
- return;
-
- init_vlc(&rl->vlc, 9, rl->n + 1,
- &rl->table_vlc[0][1], 4, 2,
- &rl->table_vlc[0][0], 4, 2, use_static);
-
-
- for(q=0; q<32; q++){
- int qmul= q*2;
- int qadd= (q-1)|1;
-
- if(q==0){
- qmul=1;
- qadd=0;
- }
- if(use_static)
- rl->rl_vlc[q]= av_mallocz_static(rl->vlc.table_size*sizeof(RL_VLC_ELEM));
- else
- rl->rl_vlc[q]= av_malloc(rl->vlc.table_size*sizeof(RL_VLC_ELEM));
- for(i=0; i<rl->vlc.table_size; i++){
- int code= rl->vlc.table[i][0];
- int len = rl->vlc.table[i][1];
- int level, run;
-
- if(len==0){ // illegal code
- run= 66;
- level= MAX_LEVEL;
- }else if(len<0){ //more bits needed
- run= 0;
- level= code;
- }else{
- if(code==rl->n){ //esc
- run= 66;
- level= 0;
- }else{
- run= rl->table_run [code] + 1;
- level= rl->table_level[code] * qmul + qadd;
- if(code >= rl->last) run+=192;
- }
- }
- rl->rl_vlc[q][i].len= len;
- rl->rl_vlc[q][i].level= level;
- rl->rl_vlc[q][i].run= run;
- }
- }
-}
-
-/* init vlcs */
-
-/* XXX: find a better solution to handle static init */
-void h263_decode_init_vlc(MpegEncContext *s)
-{
- static int done = 0;
-
- if (!done) {
- done = 1;
-
- init_vlc(&intra_MCBPC_vlc, INTRA_MCBPC_VLC_BITS, 9,
- intra_MCBPC_bits, 1, 1,
- intra_MCBPC_code, 1, 1, 1);
- init_vlc(&inter_MCBPC_vlc, INTER_MCBPC_VLC_BITS, 28,
- inter_MCBPC_bits, 1, 1,
- inter_MCBPC_code, 1, 1, 1);
- init_vlc(&cbpy_vlc, CBPY_VLC_BITS, 16,
- &cbpy_tab[0][1], 2, 1,
- &cbpy_tab[0][0], 2, 1, 1);
- init_vlc(&mv_vlc, MV_VLC_BITS, 33,
- &mvtab[0][1], 2, 1,
- &mvtab[0][0], 2, 1, 1);
- init_rl(&rl_inter, 1);
- init_rl(&rl_intra, 1);
- init_rl(&rvlc_rl_inter, 1);
- init_rl(&rvlc_rl_intra, 1);
- init_rl(&rl_intra_aic, 1);
- init_vlc_rl(&rl_inter, 1);
- init_vlc_rl(&rl_intra, 1);
- init_vlc_rl(&rvlc_rl_inter, 1);
- init_vlc_rl(&rvlc_rl_intra, 1);
- init_vlc_rl(&rl_intra_aic, 1);
- init_vlc(&dc_lum, DC_VLC_BITS, 10 /* 13 */,
- &DCtab_lum[0][1], 2, 1,
- &DCtab_lum[0][0], 2, 1, 1);
- init_vlc(&dc_chrom, DC_VLC_BITS, 10 /* 13 */,
- &DCtab_chrom[0][1], 2, 1,
- &DCtab_chrom[0][0], 2, 1, 1);
- init_vlc(&sprite_trajectory, SPRITE_TRAJ_VLC_BITS, 15,
- &sprite_trajectory_tab[0][1], 4, 2,
- &sprite_trajectory_tab[0][0], 4, 2, 1);
- init_vlc(&mb_type_b_vlc, MB_TYPE_B_VLC_BITS, 4,
- &mb_type_b_tab[0][1], 2, 1,
- &mb_type_b_tab[0][0], 2, 1, 1);
- init_vlc(&h263_mbtype_b_vlc, H263_MBTYPE_B_VLC_BITS, 15,
- &h263_mbtype_b_tab[0][1], 2, 1,
- &h263_mbtype_b_tab[0][0], 2, 1, 1);
- init_vlc(&cbpc_b_vlc, CBPC_B_VLC_BITS, 4,
- &cbpc_b_tab[0][1], 2, 1,
- &cbpc_b_tab[0][0], 2, 1, 1);
- }
-}
-
-/**
- * Get the GOB height based on picture height.
- */
-int ff_h263_get_gob_height(MpegEncContext *s){
- if (s->height <= 400)
- return 1;
- else if (s->height <= 800)
- return 2;
- else
- return 4;
-}
-
-int ff_h263_decode_mba(MpegEncContext *s)
-{
- int i, mb_pos;
-
- for(i=0; i<6; i++){
- if(s->mb_num-1 <= ff_mba_max[i]) break;
- }
- mb_pos= get_bits(&s->gb, ff_mba_length[i]);
- s->mb_x= mb_pos % s->mb_width;
- s->mb_y= mb_pos / s->mb_width;
-
- return mb_pos;
-}
-
-void ff_h263_encode_mba(MpegEncContext *s)
-{
- int i, mb_pos;
-
- for(i=0; i<6; i++){
- if(s->mb_num-1 <= ff_mba_max[i]) break;
- }
- mb_pos= s->mb_x + s->mb_width*s->mb_y;
- put_bits(&s->pb, ff_mba_length[i], mb_pos);
-}
-
-/**
- * decodes the group of blocks header or slice header.
- * @return <0 if an error occured
- */
-static int h263_decode_gob_header(MpegEncContext *s)
-{
- unsigned int val, gfid, gob_number;
- int left;
-
- /* Check for GOB Start Code */
- val = show_bits(&s->gb, 16);
- if(val)
- return -1;
-
- /* We have a GBSC probably with GSTUFF */
- skip_bits(&s->gb, 16); /* Drop the zeros */
- left= s->gb.size_in_bits - get_bits_count(&s->gb);
- //MN: we must check the bits left or we might end in a infinite loop (or segfault)
- for(;left>13; left--){
- if(get_bits1(&s->gb)) break; /* Seek the '1' bit */
- }
- if(left<=13)
- return -1;
-
- if(s->h263_slice_structured){
- if(get_bits1(&s->gb)==0)
- return -1;
-
- ff_h263_decode_mba(s);
-
- if(s->mb_num > 1583)
- if(get_bits1(&s->gb)==0)
- return -1;
-
- s->qscale = get_bits(&s->gb, 5); /* SQUANT */
- if(get_bits1(&s->gb)==0)
- return -1;
- gfid = get_bits(&s->gb, 2); /* GFID */
- }else{
- gob_number = get_bits(&s->gb, 5); /* GN */
- s->mb_x= 0;
- s->mb_y= s->gob_index* gob_number;
- gfid = get_bits(&s->gb, 2); /* GFID */
- s->qscale = get_bits(&s->gb, 5); /* GQUANT */
- }
-
- if(s->mb_y >= s->mb_height)
- return -1;
-
- if(s->qscale==0)
- return -1;
-
- return 0;
-}
-
-static inline void memsetw(short *tab, int val, int n)
-{
- int i;
- for(i=0;i<n;i++)
- tab[i] = val;
-}
-
-#ifdef CONFIG_ENCODERS
-
-void ff_mpeg4_init_partitions(MpegEncContext *s)
-{
- uint8_t *start= pbBufPtr(&s->pb);
- uint8_t *end= s->pb.buf_end;
- int size= end - start;
- int pb_size = (((long)start + size/3)&(~3)) - (long)start;
- int tex_size= (size - 2*pb_size)&(~3);
-
- set_put_bits_buffer_size(&s->pb, pb_size);
- init_put_bits(&s->tex_pb, start + pb_size , tex_size);
- init_put_bits(&s->pb2 , start + pb_size + tex_size, pb_size);
-}
-
-void ff_mpeg4_merge_partitions(MpegEncContext *s)
-{
- const int pb2_len = put_bits_count(&s->pb2 );
- const int tex_pb_len= put_bits_count(&s->tex_pb);
- const int bits= put_bits_count(&s->pb);
-
- if(s->pict_type==I_TYPE){
- put_bits(&s->pb, 19, DC_MARKER);
- s->misc_bits+=19 + pb2_len + bits - s->last_bits;
- s->i_tex_bits+= tex_pb_len;
- }else{
- put_bits(&s->pb, 17, MOTION_MARKER);
- s->misc_bits+=17 + pb2_len;
- s->mv_bits+= bits - s->last_bits;
- s->p_tex_bits+= tex_pb_len;
- }
-
- flush_put_bits(&s->pb2);
- flush_put_bits(&s->tex_pb);
-
- set_put_bits_buffer_size(&s->pb, s->pb2.buf_end - s->pb.buf);
- ff_copy_bits(&s->pb, s->pb2.buf , pb2_len);
- ff_copy_bits(&s->pb, s->tex_pb.buf, tex_pb_len);
- s->last_bits= put_bits_count(&s->pb);
-}
-
-#endif //CONFIG_ENCODERS
-
-int ff_mpeg4_get_video_packet_prefix_length(MpegEncContext *s){
- switch(s->pict_type){
- case I_TYPE:
- return 16;
- case P_TYPE:
- case S_TYPE:
- return s->f_code+15;
- case B_TYPE:
- return FFMAX(FFMAX(s->f_code, s->b_code)+15, 17);
- default:
- return -1;
- }
-}
-
-#ifdef CONFIG_ENCODERS
-
-void ff_mpeg4_encode_video_packet_header(MpegEncContext *s)
-{
- int mb_num_bits= av_log2(s->mb_num - 1) + 1;
-
- put_bits(&s->pb, ff_mpeg4_get_video_packet_prefix_length(s), 0);
- put_bits(&s->pb, 1, 1);
-
- put_bits(&s->pb, mb_num_bits, s->mb_x + s->mb_y*s->mb_width);
- put_bits(&s->pb, s->quant_precision, s->qscale);
- put_bits(&s->pb, 1, 0); /* no HEC */
-}
-
-#endif //CONFIG_ENCODERS
-
-/**
- * check if the next stuff is a resync marker or the end.
- * @return 0 if not
- */
-static inline int mpeg4_is_resync(MpegEncContext *s){
- int bits_count= get_bits_count(&s->gb);
- int v= show_bits(&s->gb, 16);
-
- if(s->workaround_bugs&FF_BUG_NO_PADDING){
- return 0;
- }
-
- while(v<=0xFF){
- if(s->pict_type==B_TYPE || (v>>(8-s->pict_type)!=1) || s->partitioned_frame)
- break;
- skip_bits(&s->gb, 8+s->pict_type);
- bits_count+= 8+s->pict_type;
- v= show_bits(&s->gb, 16);
- }
-
- if(bits_count + 8 >= s->gb.size_in_bits){
- v>>=8;
- v|= 0x7F >> (7-(bits_count&7));
-
- if(v==0x7F)
- return 1;
- }else{
- if(v == ff_mpeg4_resync_prefix[bits_count&7]){
- int len;
- GetBitContext gb= s->gb;
-
- skip_bits(&s->gb, 1);
- align_get_bits(&s->gb);
-
- for(len=0; len<32; len++){
- if(get_bits1(&s->gb)) break;
- }
-
- s->gb= gb;
-
- if(len>=ff_mpeg4_get_video_packet_prefix_length(s))
- return 1;
- }
- }
- return 0;
-}
-
-/**
- * decodes the next video packet.
- * @return <0 if something went wrong
- */
-static int mpeg4_decode_video_packet_header(MpegEncContext *s)
-{
- int mb_num_bits= av_log2(s->mb_num - 1) + 1;
- int header_extension=0, mb_num, len;
-
- /* is there enough space left for a video packet + header */
- if( get_bits_count(&s->gb) > s->gb.size_in_bits-20) return -1;
-
- for(len=0; len<32; len++){
- if(get_bits1(&s->gb)) break;
- }
-
- if(len!=ff_mpeg4_get_video_packet_prefix_length(s)){
- av_log(s->avctx, AV_LOG_ERROR, "marker does not match f_code\n");
- return -1;
- }
-
- if(s->shape != RECT_SHAPE){
- header_extension= get_bits1(&s->gb);
- //FIXME more stuff here
- }
-
- mb_num= get_bits(&s->gb, mb_num_bits);
- if(mb_num>=s->mb_num){
- av_log(s->avctx, AV_LOG_ERROR, "illegal mb_num in video packet (%d %d) \n", mb_num, s->mb_num);
- return -1;
- }
- if(s->pict_type == B_TYPE){
- while(s->next_picture.mbskip_table[ s->mb_index2xy[ mb_num ] ]) mb_num++;
- if(mb_num >= s->mb_num) return -1; // slice contains just skipped MBs which where allready decoded
- }
-
- s->mb_x= mb_num % s->mb_width;
- s->mb_y= mb_num / s->mb_width;
-
- if(s->shape != BIN_ONLY_SHAPE){
- int qscale= get_bits(&s->gb, s->quant_precision);
- if(qscale)
- s->chroma_qscale=s->qscale= qscale;
- }
-
- if(s->shape == RECT_SHAPE){
- header_extension= get_bits1(&s->gb);
- }
- if(header_extension){
- int time_increment;
- int time_incr=0;
-
- while (get_bits1(&s->gb) != 0)
- time_incr++;
-
- check_marker(&s->gb, "before time_increment in video packed header");
- time_increment= get_bits(&s->gb, s->time_increment_bits);
- check_marker(&s->gb, "before vop_coding_type in video packed header");
-
- skip_bits(&s->gb, 2); /* vop coding type */
- //FIXME not rect stuff here
-
- if(s->shape != BIN_ONLY_SHAPE){
- skip_bits(&s->gb, 3); /* intra dc vlc threshold */
-//FIXME don't just ignore everything
- if(s->pict_type == S_TYPE && s->vol_sprite_usage==GMC_SPRITE){
- mpeg4_decode_sprite_trajectory(s, &s->gb);
- av_log(s->avctx, AV_LOG_ERROR, "untested\n");
- }
-
- //FIXME reduced res stuff here
-
- if (s->pict_type != I_TYPE) {
- int f_code = get_bits(&s->gb, 3); /* fcode_for */
- if(f_code==0){
- av_log(s->avctx, AV_LOG_ERROR, "Error, video packet header damaged (f_code=0)\n");
- }
- }
- if (s->pict_type == B_TYPE) {
- int b_code = get_bits(&s->gb, 3);
- if(b_code==0){
- av_log(s->avctx, AV_LOG_ERROR, "Error, video packet header damaged (b_code=0)\n");
- }
- }
- }
- }
- //FIXME new-pred stuff
-
-//printf("parse ok %d %d %d %d\n", mb_num, s->mb_x + s->mb_y*s->mb_width, get_bits_count(gb), get_bits_count(&s->gb));
-
- return 0;
-}
-
-void ff_mpeg4_clean_buffers(MpegEncContext *s)
-{
- int c_wrap, c_xy, l_wrap, l_xy;
-
- l_wrap= s->b8_stride;
- l_xy= (2*s->mb_y-1)*l_wrap + s->mb_x*2 - 1;
- c_wrap= s->mb_stride;
- c_xy= (s->mb_y-1)*c_wrap + s->mb_x - 1;
-
-#if 0
- /* clean DC */
- memsetw(s->dc_val[0] + l_xy, 1024, l_wrap*2+1);
- memsetw(s->dc_val[1] + c_xy, 1024, c_wrap+1);
- memsetw(s->dc_val[2] + c_xy, 1024, c_wrap+1);
-#endif
-
- /* clean AC */
- memset(s->ac_val[0] + l_xy, 0, (l_wrap*2+1)*16*sizeof(int16_t));
- memset(s->ac_val[1] + c_xy, 0, (c_wrap +1)*16*sizeof(int16_t));
- memset(s->ac_val[2] + c_xy, 0, (c_wrap +1)*16*sizeof(int16_t));
-
- /* clean MV */
- // we can't clear the MVs as they might be needed by a b frame
-// memset(s->motion_val + l_xy, 0, (l_wrap*2+1)*2*sizeof(int16_t));
-// memset(s->motion_val, 0, 2*sizeof(int16_t)*(2 + s->mb_width*2)*(2 + s->mb_height*2));
- s->last_mv[0][0][0]=
- s->last_mv[0][0][1]=
- s->last_mv[1][0][0]=
- s->last_mv[1][0][1]= 0;
-}
-
-/**
- * decodes the group of blocks / video packet header.
- * @return <0 if no resync found
- */
-int ff_h263_resync(MpegEncContext *s){
- int left, ret;
-
- if(s->codec_id==CODEC_ID_MPEG4){
- skip_bits1(&s->gb);
- align_get_bits(&s->gb);
- }
-
- if(show_bits(&s->gb, 16)==0){
- if(s->codec_id==CODEC_ID_MPEG4)
- ret= mpeg4_decode_video_packet_header(s);
- else
- ret= h263_decode_gob_header(s);
- if(ret>=0)
- return 0;
- }
- //ok, it's not where its supposed to be ...
- s->gb= s->last_resync_gb;
- align_get_bits(&s->gb);
- left= s->gb.size_in_bits - get_bits_count(&s->gb);
-
- for(;left>16+1+5+5; left-=8){
- if(show_bits(&s->gb, 16)==0){
- GetBitContext bak= s->gb;
-
- if(s->codec_id==CODEC_ID_MPEG4)
- ret= mpeg4_decode_video_packet_header(s);
- else
- ret= h263_decode_gob_header(s);
- if(ret>=0)
- return 0;
-
- s->gb= bak;
- }
- skip_bits(&s->gb, 8);
- }
-
- return -1;
-}
-
-/**
- * gets the average motion vector for a GMC MB.
- * @param n either 0 for the x component or 1 for y
- * @returns the average MV for a GMC MB
- */
-static inline int get_amv(MpegEncContext *s, int n){
- int x, y, mb_v, sum, dx, dy, shift;
- int len = 1 << (s->f_code + 4);
- const int a= s->sprite_warping_accuracy;
-
- if(s->workaround_bugs & FF_BUG_AMV)
- len >>= s->quarter_sample;
-
- if(s->real_sprite_warping_points==1){
- if(s->divx_version==500 && s->divx_build==413)
- sum= s->sprite_offset[0][n] / (1<<(a - s->quarter_sample));
- else
- sum= RSHIFT(s->sprite_offset[0][n]<<s->quarter_sample, a);
- }else{
- dx= s->sprite_delta[n][0];
- dy= s->sprite_delta[n][1];
- shift= s->sprite_shift[0];
- if(n) dy -= 1<<(shift + a + 1);
- else dx -= 1<<(shift + a + 1);
- mb_v= s->sprite_offset[0][n] + dx*s->mb_x*16 + dy*s->mb_y*16;
-
- sum=0;
- for(y=0; y<16; y++){
- int v;
-
- v= mb_v + dy*y;
- //XXX FIXME optimize
- for(x=0; x<16; x++){
- sum+= v>>shift;
- v+= dx;
- }
- }
- sum= RSHIFT(sum, a+8-s->quarter_sample);
- }
-
- if (sum < -len) sum= -len;
- else if (sum >= len) sum= len-1;
-
- return sum;
-}
-
-/**
- * decodes first partition.
- * @return number of MBs decoded or <0 if an error occured
- */
-static int mpeg4_decode_partition_a(MpegEncContext *s){
- int mb_num;
- static const int8_t quant_tab[4] = { -1, -2, 1, 2 };
-
- /* decode first partition */
- mb_num=0;
- s->first_slice_line=1;
- for(; s->mb_y<s->mb_height; s->mb_y++){
- ff_init_block_index(s);
- for(; s->mb_x<s->mb_width; s->mb_x++){
- const int xy= s->mb_x + s->mb_y*s->mb_stride;
- int cbpc;
- int dir=0;
-
- mb_num++;
- ff_update_block_index(s);
- if(s->mb_x == s->resync_mb_x && s->mb_y == s->resync_mb_y+1)
- s->first_slice_line=0;
-
- if(s->pict_type==I_TYPE){
- int i;
-
- do{
- if(show_bits_long(&s->gb, 19)==DC_MARKER){
- return mb_num-1;
- }
-
- cbpc = get_vlc2(&s->gb, intra_MCBPC_vlc.table, INTRA_MCBPC_VLC_BITS, 2);
- if (cbpc < 0){
- av_log(s->avctx, AV_LOG_ERROR, "cbpc corrupted at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
- }while(cbpc == 8);
-
- s->cbp_table[xy]= cbpc & 3;
- s->current_picture.mb_type[xy]= MB_TYPE_INTRA;
- s->mb_intra = 1;
-
- if(cbpc & 4) {
- ff_set_qscale(s, s->qscale + quant_tab[get_bits(&s->gb, 2)]);
- }
- s->current_picture.qscale_table[xy]= s->qscale;
-
- s->mbintra_table[xy]= 1;
- for(i=0; i<6; i++){
- int dc_pred_dir;
- int dc= mpeg4_decode_dc(s, i, &dc_pred_dir);
- if(dc < 0){
- av_log(s->avctx, AV_LOG_ERROR, "DC corrupted at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
- dir<<=1;
- if(dc_pred_dir) dir|=1;
- }
- s->pred_dir_table[xy]= dir;
- }else{ /* P/S_TYPE */
- int mx, my, pred_x, pred_y, bits;
- int16_t * const mot_val= s->current_picture.motion_val[0][s->block_index[0]];
- const int stride= s->b8_stride*2;
-
-try_again:
- bits= show_bits(&s->gb, 17);
- if(bits==MOTION_MARKER){
- return mb_num-1;
- }
- skip_bits1(&s->gb);
- if(bits&0x10000){
- /* skip mb */
- if(s->pict_type==S_TYPE && s->vol_sprite_usage==GMC_SPRITE){
- s->current_picture.mb_type[xy]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_GMC | MB_TYPE_L0;
- mx= get_amv(s, 0);
- my= get_amv(s, 1);
- }else{
- s->current_picture.mb_type[xy]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0;
- mx=my=0;
- }
- mot_val[0 ]= mot_val[2 ]=
- mot_val[0+stride]= mot_val[2+stride]= mx;
- mot_val[1 ]= mot_val[3 ]=
- mot_val[1+stride]= mot_val[3+stride]= my;
-
- if(s->mbintra_table[xy])
- ff_clean_intra_table_entries(s);
- continue;
- }
-
- cbpc = get_vlc2(&s->gb, inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2);
- if (cbpc < 0){
- av_log(s->avctx, AV_LOG_ERROR, "cbpc corrupted at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
- if(cbpc == 20)
- goto try_again;
-
- s->cbp_table[xy]= cbpc&(8+3); //8 is dquant
-
- s->mb_intra = ((cbpc & 4) != 0);
-
- if(s->mb_intra){
- s->current_picture.mb_type[xy]= MB_TYPE_INTRA;
- s->mbintra_table[xy]= 1;
- mot_val[0 ]= mot_val[2 ]=
- mot_val[0+stride]= mot_val[2+stride]= 0;
- mot_val[1 ]= mot_val[3 ]=
- mot_val[1+stride]= mot_val[3+stride]= 0;
- }else{
- if(s->mbintra_table[xy])
- ff_clean_intra_table_entries(s);
-
- if(s->pict_type==S_TYPE && s->vol_sprite_usage==GMC_SPRITE && (cbpc & 16) == 0)
- s->mcsel= get_bits1(&s->gb);
- else s->mcsel= 0;
-
- if ((cbpc & 16) == 0) {
- /* 16x16 motion prediction */
-
- h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
- if(!s->mcsel){
- mx = h263_decode_motion(s, pred_x, s->f_code);
- if (mx >= 0xffff)
- return -1;
-
- my = h263_decode_motion(s, pred_y, s->f_code);
- if (my >= 0xffff)
- return -1;
- s->current_picture.mb_type[xy]= MB_TYPE_16x16 | MB_TYPE_L0;
- } else {
- mx = get_amv(s, 0);
- my = get_amv(s, 1);
- s->current_picture.mb_type[xy]= MB_TYPE_16x16 | MB_TYPE_GMC | MB_TYPE_L0;
- }
-
- mot_val[0 ]= mot_val[2 ] =
- mot_val[0+stride]= mot_val[2+stride]= mx;
- mot_val[1 ]= mot_val[3 ]=
- mot_val[1+stride]= mot_val[3+stride]= my;
- } else {
- int i;
- s->current_picture.mb_type[xy]= MB_TYPE_8x8 | MB_TYPE_L0;
- for(i=0;i<4;i++) {
- int16_t *mot_val= h263_pred_motion(s, i, 0, &pred_x, &pred_y);
- mx = h263_decode_motion(s, pred_x, s->f_code);
- if (mx >= 0xffff)
- return -1;
-
- my = h263_decode_motion(s, pred_y, s->f_code);
- if (my >= 0xffff)
- return -1;
- mot_val[0] = mx;
- mot_val[1] = my;
- }
- }
- }
- }
- }
- s->mb_x= 0;
- }
-
- return mb_num;
-}
-
-/**
- * decode second partition.
- * @return <0 if an error occured
- */
-static int mpeg4_decode_partition_b(MpegEncContext *s, int mb_count){
- int mb_num=0;
- static const int8_t quant_tab[4] = { -1, -2, 1, 2 };
-
- s->mb_x= s->resync_mb_x;
- s->first_slice_line=1;
- for(s->mb_y= s->resync_mb_y; mb_num < mb_count; s->mb_y++){
- ff_init_block_index(s);
- for(; mb_num < mb_count && s->mb_x<s->mb_width; s->mb_x++){
- const int xy= s->mb_x + s->mb_y*s->mb_stride;
-
- mb_num++;
- ff_update_block_index(s);
- if(s->mb_x == s->resync_mb_x && s->mb_y == s->resync_mb_y+1)
- s->first_slice_line=0;
-
- if(s->pict_type==I_TYPE){
- int ac_pred= get_bits1(&s->gb);
- int cbpy = get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1);
- if(cbpy<0){
- av_log(s->avctx, AV_LOG_ERROR, "cbpy corrupted at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
-
- s->cbp_table[xy]|= cbpy<<2;
- s->current_picture.mb_type[xy] |= ac_pred*MB_TYPE_ACPRED;
- }else{ /* P || S_TYPE */
- if(IS_INTRA(s->current_picture.mb_type[xy])){
- int dir=0,i;
- int ac_pred = get_bits1(&s->gb);
- int cbpy = get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1);
-
- if(cbpy<0){
- av_log(s->avctx, AV_LOG_ERROR, "I cbpy corrupted at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
-
- if(s->cbp_table[xy] & 8) {
- ff_set_qscale(s, s->qscale + quant_tab[get_bits(&s->gb, 2)]);
- }
- s->current_picture.qscale_table[xy]= s->qscale;
-
- for(i=0; i<6; i++){
- int dc_pred_dir;
- int dc= mpeg4_decode_dc(s, i, &dc_pred_dir);
- if(dc < 0){
- av_log(s->avctx, AV_LOG_ERROR, "DC corrupted at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
- dir<<=1;
- if(dc_pred_dir) dir|=1;
- }
- s->cbp_table[xy]&= 3; //remove dquant
- s->cbp_table[xy]|= cbpy<<2;
- s->current_picture.mb_type[xy] |= ac_pred*MB_TYPE_ACPRED;
- s->pred_dir_table[xy]= dir;
- }else if(IS_SKIP(s->current_picture.mb_type[xy])){
- s->current_picture.qscale_table[xy]= s->qscale;
- s->cbp_table[xy]= 0;
- }else{
- int cbpy = get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1);
-
- if(cbpy<0){
- av_log(s->avctx, AV_LOG_ERROR, "P cbpy corrupted at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
-
- if(s->cbp_table[xy] & 8) {
- ff_set_qscale(s, s->qscale + quant_tab[get_bits(&s->gb, 2)]);
- }
- s->current_picture.qscale_table[xy]= s->qscale;
-
- s->cbp_table[xy]&= 3; //remove dquant
- s->cbp_table[xy]|= (cbpy^0xf)<<2;
- }
- }
- }
- if(mb_num >= mb_count) return 0;
- s->mb_x= 0;
- }
- return 0;
-}
-
-/**
- * decodes the first & second partition
- * @return <0 if error (and sets error type in the error_status_table)
- */
-int ff_mpeg4_decode_partitions(MpegEncContext *s)
-{
- int mb_num;
- const int part_a_error= s->pict_type==I_TYPE ? (DC_ERROR|MV_ERROR) : MV_ERROR;
- const int part_a_end = s->pict_type==I_TYPE ? (DC_END |MV_END) : MV_END;
-
- mb_num= mpeg4_decode_partition_a(s);
- if(mb_num<0){
- ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, part_a_error);
- return -1;
- }
-
- if(s->resync_mb_x + s->resync_mb_y*s->mb_width + mb_num > s->mb_num){
- av_log(s->avctx, AV_LOG_ERROR, "slice below monitor ...\n");
- ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, part_a_error);
- return -1;
- }
-
- s->mb_num_left= mb_num;
-
- if(s->pict_type==I_TYPE){
- while(show_bits(&s->gb, 9) == 1)
- skip_bits(&s->gb, 9);
- if(get_bits_long(&s->gb, 19)!=DC_MARKER){
- av_log(s->avctx, AV_LOG_ERROR, "marker missing after first I partition at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
- }else{
- while(show_bits(&s->gb, 10) == 1)
- skip_bits(&s->gb, 10);
- if(get_bits(&s->gb, 17)!=MOTION_MARKER){
- av_log(s->avctx, AV_LOG_ERROR, "marker missing after first P partition at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
- }
- ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, part_a_end);
-
- if( mpeg4_decode_partition_b(s, mb_num) < 0){
- if(s->pict_type==P_TYPE)
- ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, DC_ERROR);
- return -1;
- }else{
- if(s->pict_type==P_TYPE)
- ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, DC_END);
- }
-
- return 0;
-}
-
-/**
- * decode partition C of one MB.
- * @return <0 if an error occured
- */
-static int mpeg4_decode_partitioned_mb(MpegEncContext *s, DCTELEM block[6][64])
-{
- int cbp, mb_type;
- const int xy= s->mb_x + s->mb_y*s->mb_stride;
-
- mb_type= s->current_picture.mb_type[xy];
- cbp = s->cbp_table[xy];
-
- s->use_intra_dc_vlc= s->qscale < s->intra_dc_threshold;
-
- if(s->current_picture.qscale_table[xy] != s->qscale){
- ff_set_qscale(s, s->current_picture.qscale_table[xy] );
- }
-
- if (s->pict_type == P_TYPE || s->pict_type==S_TYPE) {
- int i;
- for(i=0; i<4; i++){
- s->mv[0][i][0] = s->current_picture.motion_val[0][ s->block_index[i] ][0];
- s->mv[0][i][1] = s->current_picture.motion_val[0][ s->block_index[i] ][1];
- }
- s->mb_intra = IS_INTRA(mb_type);
-
- if (IS_SKIP(mb_type)) {
- /* skip mb */
- for(i=0;i<6;i++)
- s->block_last_index[i] = -1;
- s->mv_dir = MV_DIR_FORWARD;
- s->mv_type = MV_TYPE_16X16;
- if(s->pict_type==S_TYPE && s->vol_sprite_usage==GMC_SPRITE){
- s->mcsel=1;
- s->mb_skipped = 0;
- }else{
- s->mcsel=0;
- s->mb_skipped = 1;
- }
- }else if(s->mb_intra){
- s->ac_pred = IS_ACPRED(s->current_picture.mb_type[xy]);
- }else if(!s->mb_intra){
-// s->mcsel= 0; //FIXME do we need to init that
-
- s->mv_dir = MV_DIR_FORWARD;
- if (IS_8X8(mb_type)) {
- s->mv_type = MV_TYPE_8X8;
- } else {
- s->mv_type = MV_TYPE_16X16;
- }
- }
- } else { /* I-Frame */
- s->mb_intra = 1;
- s->ac_pred = IS_ACPRED(s->current_picture.mb_type[xy]);
- }
-
- if (!IS_SKIP(mb_type)) {
- int i;
- s->dsp.clear_blocks(s->block[0]);
- /* decode each block */
- for (i = 0; i < 6; i++) {
- if(mpeg4_decode_block(s, block[i], i, cbp&32, s->mb_intra, s->rvlc) < 0){
- av_log(s->avctx, AV_LOG_ERROR, "texture corrupted at %d %d %d\n", s->mb_x, s->mb_y, s->mb_intra);
- return -1;
- }
- cbp+=cbp;
- }
- }
-
- /* per-MB end of slice check */
-
- if(--s->mb_num_left <= 0){
-//printf("%06X %d\n", show_bits(&s->gb, 24), s->gb.size_in_bits - get_bits_count(&s->gb));
- if(mpeg4_is_resync(s))
- return SLICE_END;
- else
- return SLICE_NOEND;
- }else{
- if(mpeg4_is_resync(s)){
- const int delta= s->mb_x + 1 == s->mb_width ? 2 : 1;
- if(s->cbp_table[xy+delta])
- return SLICE_END;
- }
- return SLICE_OK;
- }
-}
-
-/**
- * read the next MVs for OBMC. yes this is a ugly hack, feel free to send a patch :)
- */
-static void preview_obmc(MpegEncContext *s){
- GetBitContext gb= s->gb;
-
- int cbpc, i, pred_x, pred_y, mx, my;
- int16_t *mot_val;
- const int xy= s->mb_x + 1 + s->mb_y * s->mb_stride;
- const int stride= s->b8_stride*2;
-
- for(i=0; i<4; i++)
- s->block_index[i]+= 2;
- for(i=4; i<6; i++)
- s->block_index[i]+= 1;
- s->mb_x++;
-
- assert(s->pict_type == P_TYPE);
-
- do{
- if (get_bits1(&s->gb)) {
- /* skip mb */
- mot_val = s->current_picture.motion_val[0][ s->block_index[0] ];
- mot_val[0 ]= mot_val[2 ]=
- mot_val[0+stride]= mot_val[2+stride]= 0;
- mot_val[1 ]= mot_val[3 ]=
- mot_val[1+stride]= mot_val[3+stride]= 0;
-
- s->current_picture.mb_type[xy]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0;
- goto end;
- }
- cbpc = get_vlc2(&s->gb, inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2);
- }while(cbpc == 20);
-
- if(cbpc & 4){
- s->current_picture.mb_type[xy]= MB_TYPE_INTRA;
- }else{
- get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1);
- if (cbpc & 8) {
- if(s->modified_quant){
- if(get_bits1(&s->gb)) skip_bits(&s->gb, 1);
- else skip_bits(&s->gb, 5);
- }else
- skip_bits(&s->gb, 2);
- }
-
- if ((cbpc & 16) == 0) {
- s->current_picture.mb_type[xy]= MB_TYPE_16x16 | MB_TYPE_L0;
- /* 16x16 motion prediction */
- mot_val= h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
- if (s->umvplus)
- mx = h263p_decode_umotion(s, pred_x);
- else
- mx = h263_decode_motion(s, pred_x, 1);
-
- if (s->umvplus)
- my = h263p_decode_umotion(s, pred_y);
- else
- my = h263_decode_motion(s, pred_y, 1);
-
- mot_val[0 ]= mot_val[2 ]=
- mot_val[0+stride]= mot_val[2+stride]= mx;
- mot_val[1 ]= mot_val[3 ]=
- mot_val[1+stride]= mot_val[3+stride]= my;
- } else {
- s->current_picture.mb_type[xy]= MB_TYPE_8x8 | MB_TYPE_L0;
- for(i=0;i<4;i++) {
- mot_val = h263_pred_motion(s, i, 0, &pred_x, &pred_y);
- if (s->umvplus)
- mx = h263p_decode_umotion(s, pred_x);
- else
- mx = h263_decode_motion(s, pred_x, 1);
-
- if (s->umvplus)
- my = h263p_decode_umotion(s, pred_y);
- else
- my = h263_decode_motion(s, pred_y, 1);
- if (s->umvplus && (mx - pred_x) == 1 && (my - pred_y) == 1)
- skip_bits1(&s->gb); /* Bit stuffing to prevent PSC */
- mot_val[0] = mx;
- mot_val[1] = my;
- }
- }
- }
-end:
-
- for(i=0; i<4; i++)
- s->block_index[i]-= 2;
- for(i=4; i<6; i++)
- s->block_index[i]-= 1;
- s->mb_x--;
-
- s->gb= gb;
-}
-
-static void h263_decode_dquant(MpegEncContext *s){
- static const int8_t quant_tab[4] = { -1, -2, 1, 2 };
-
- if(s->modified_quant){
- if(get_bits1(&s->gb))
- s->qscale= modified_quant_tab[get_bits1(&s->gb)][ s->qscale ];
- else
- s->qscale= get_bits(&s->gb, 5);
- }else
- s->qscale += quant_tab[get_bits(&s->gb, 2)];
- ff_set_qscale(s, s->qscale);
-}
-
-int ff_h263_decode_mb(MpegEncContext *s,
- DCTELEM block[6][64])
-{
- int cbpc, cbpy, i, cbp, pred_x, pred_y, mx, my, dquant;
- int16_t *mot_val;
- const int xy= s->mb_x + s->mb_y * s->mb_stride;
-
- assert(!s->h263_pred);
-
- if (s->pict_type == P_TYPE) {
- do{
- if (get_bits1(&s->gb)) {
- /* skip mb */
- s->mb_intra = 0;
- for(i=0;i<6;i++)
- s->block_last_index[i] = -1;
- s->mv_dir = MV_DIR_FORWARD;
- s->mv_type = MV_TYPE_16X16;
- s->current_picture.mb_type[xy]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0;
- s->mv[0][0][0] = 0;
- s->mv[0][0][1] = 0;
- s->mb_skipped = !(s->obmc | s->loop_filter);
- goto end;
- }
- cbpc = get_vlc2(&s->gb, inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2);
- //fprintf(stderr, "\tCBPC: %d", cbpc);
- if (cbpc < 0){
- av_log(s->avctx, AV_LOG_ERROR, "cbpc damaged at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
- }while(cbpc == 20);
-
- s->dsp.clear_blocks(s->block[0]);
-
- dquant = cbpc & 8;
- s->mb_intra = ((cbpc & 4) != 0);
- if (s->mb_intra) goto intra;
-
- cbpy = get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1);
-
- if(s->alt_inter_vlc==0 || (cbpc & 3)!=3)
- cbpy ^= 0xF;
-
- cbp = (cbpc & 3) | (cbpy << 2);
- if (dquant) {
- h263_decode_dquant(s);
- }
-
- s->mv_dir = MV_DIR_FORWARD;
- if ((cbpc & 16) == 0) {
- s->current_picture.mb_type[xy]= MB_TYPE_16x16 | MB_TYPE_L0;
- /* 16x16 motion prediction */
- s->mv_type = MV_TYPE_16X16;
- h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
- if (s->umvplus)
- mx = h263p_decode_umotion(s, pred_x);
- else
- mx = h263_decode_motion(s, pred_x, 1);
-
- if (mx >= 0xffff)
- return -1;
-
- if (s->umvplus)
- my = h263p_decode_umotion(s, pred_y);
- else
- my = h263_decode_motion(s, pred_y, 1);
-
- if (my >= 0xffff)
- return -1;
- s->mv[0][0][0] = mx;
- s->mv[0][0][1] = my;
-
- if (s->umvplus && (mx - pred_x) == 1 && (my - pred_y) == 1)
- skip_bits1(&s->gb); /* Bit stuffing to prevent PSC */
- } else {
- s->current_picture.mb_type[xy]= MB_TYPE_8x8 | MB_TYPE_L0;
- s->mv_type = MV_TYPE_8X8;
- for(i=0;i<4;i++) {
- mot_val = h263_pred_motion(s, i, 0, &pred_x, &pred_y);
- if (s->umvplus)
- mx = h263p_decode_umotion(s, pred_x);
- else
- mx = h263_decode_motion(s, pred_x, 1);
- if (mx >= 0xffff)
- return -1;
-
- if (s->umvplus)
- my = h263p_decode_umotion(s, pred_y);
- else
- my = h263_decode_motion(s, pred_y, 1);
- if (my >= 0xffff)
- return -1;
- s->mv[0][i][0] = mx;
- s->mv[0][i][1] = my;
- if (s->umvplus && (mx - pred_x) == 1 && (my - pred_y) == 1)
- skip_bits1(&s->gb); /* Bit stuffing to prevent PSC */
- mot_val[0] = mx;
- mot_val[1] = my;
- }
- }
-
- /* decode each block */
- for (i = 0; i < 6; i++) {
- if (h263_decode_block(s, block[i], i, cbp&32) < 0)
- return -1;
- cbp+=cbp;
- }
-
- if(s->obmc){
- if(s->pict_type == P_TYPE && s->mb_x+1<s->mb_width && s->mb_num_left != 1)
- preview_obmc(s);
- }
- } else if(s->pict_type==B_TYPE) {
- int mb_type;
- const int stride= s->b8_stride;
- int16_t *mot_val0 = s->current_picture.motion_val[0][ 2*(s->mb_x + s->mb_y*stride) ];
- int16_t *mot_val1 = s->current_picture.motion_val[1][ 2*(s->mb_x + s->mb_y*stride) ];
-// const int mv_xy= s->mb_x + 1 + s->mb_y * s->mb_stride;
-
- //FIXME ugly
- mot_val0[0 ]= mot_val0[2 ]= mot_val0[0+2*stride]= mot_val0[2+2*stride]=
- mot_val0[1 ]= mot_val0[3 ]= mot_val0[1+2*stride]= mot_val0[3+2*stride]=
- mot_val1[0 ]= mot_val1[2 ]= mot_val1[0+2*stride]= mot_val1[2+2*stride]=
- mot_val1[1 ]= mot_val1[3 ]= mot_val1[1+2*stride]= mot_val1[3+2*stride]= 0;
-
- do{
- mb_type= get_vlc2(&s->gb, h263_mbtype_b_vlc.table, H263_MBTYPE_B_VLC_BITS, 2);
- if (mb_type < 0){
- av_log(s->avctx, AV_LOG_ERROR, "b mb_type damaged at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
-
- mb_type= h263_mb_type_b_map[ mb_type ];
- }while(!mb_type);
-
- s->mb_intra = IS_INTRA(mb_type);
- if(HAS_CBP(mb_type)){
- s->dsp.clear_blocks(s->block[0]);
- cbpc = get_vlc2(&s->gb, cbpc_b_vlc.table, CBPC_B_VLC_BITS, 1);
- if(s->mb_intra){
- dquant = IS_QUANT(mb_type);
- goto intra;
- }
-
- cbpy = get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1);
-
- if (cbpy < 0){
- av_log(s->avctx, AV_LOG_ERROR, "b cbpy damaged at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
-
- if(s->alt_inter_vlc==0 || (cbpc & 3)!=3)
- cbpy ^= 0xF;
-
- cbp = (cbpc & 3) | (cbpy << 2);
- }else
- cbp=0;
-
- assert(!s->mb_intra);
-
- if(IS_QUANT(mb_type)){
- h263_decode_dquant(s);
- }
-
- if(IS_DIRECT(mb_type)){
- s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD | MV_DIRECT;
- mb_type |= ff_mpeg4_set_direct_mv(s, 0, 0);
- }else{
- s->mv_dir = 0;
- s->mv_type= MV_TYPE_16X16;
-//FIXME UMV
-
- if(USES_LIST(mb_type, 0)){
- int16_t *mot_val= h263_pred_motion(s, 0, 0, &mx, &my);
- s->mv_dir = MV_DIR_FORWARD;
-
- mx = h263_decode_motion(s, mx, 1);
- my = h263_decode_motion(s, my, 1);
-
- s->mv[0][0][0] = mx;
- s->mv[0][0][1] = my;
- mot_val[0 ]= mot_val[2 ]= mot_val[0+2*stride]= mot_val[2+2*stride]= mx;
- mot_val[1 ]= mot_val[3 ]= mot_val[1+2*stride]= mot_val[3+2*stride]= my;
- }
-
- if(USES_LIST(mb_type, 1)){
- int16_t *mot_val= h263_pred_motion(s, 0, 1, &mx, &my);
- s->mv_dir |= MV_DIR_BACKWARD;
-
- mx = h263_decode_motion(s, mx, 1);
- my = h263_decode_motion(s, my, 1);
-
- s->mv[1][0][0] = mx;
- s->mv[1][0][1] = my;
- mot_val[0 ]= mot_val[2 ]= mot_val[0+2*stride]= mot_val[2+2*stride]= mx;
- mot_val[1 ]= mot_val[3 ]= mot_val[1+2*stride]= mot_val[3+2*stride]= my;
- }
- }
-
- s->current_picture.mb_type[xy]= mb_type;
-
- /* decode each block */
- for (i = 0; i < 6; i++) {
- if (h263_decode_block(s, block[i], i, cbp&32) < 0)
- return -1;
- cbp+=cbp;
- }
- } else { /* I-Frame */
- do{
- cbpc = get_vlc2(&s->gb, intra_MCBPC_vlc.table, INTRA_MCBPC_VLC_BITS, 2);
- if (cbpc < 0){
- av_log(s->avctx, AV_LOG_ERROR, "I cbpc damaged at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
- }while(cbpc == 8);
-
- s->dsp.clear_blocks(s->block[0]);
-
- dquant = cbpc & 4;
- s->mb_intra = 1;
-intra:
- s->current_picture.mb_type[xy]= MB_TYPE_INTRA;
- if (s->h263_aic) {
- s->ac_pred = get_bits1(&s->gb);
- if(s->ac_pred){
- s->current_picture.mb_type[xy]= MB_TYPE_INTRA | MB_TYPE_ACPRED;
-
- s->h263_aic_dir = get_bits1(&s->gb);
- }
- }else
- s->ac_pred = 0;
-
- cbpy = get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1);
- if(cbpy<0){
- av_log(s->avctx, AV_LOG_ERROR, "I cbpy damaged at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
- cbp = (cbpc & 3) | (cbpy << 2);
- if (dquant) {
- h263_decode_dquant(s);
- }
-
- /* decode each block */
- for (i = 0; i < 6; i++) {
- if (h263_decode_block(s, block[i], i, cbp&32) < 0)
- return -1;
- cbp+=cbp;
- }
- }
-end:
-
- /* per-MB end of slice check */
- {
- int v= show_bits(&s->gb, 16);
-
- if(get_bits_count(&s->gb) + 16 > s->gb.size_in_bits){
- v>>= get_bits_count(&s->gb) + 16 - s->gb.size_in_bits;
- }
-
- if(v==0)
- return SLICE_END;
- }
-
- return SLICE_OK;
-}
-
-int ff_mpeg4_decode_mb(MpegEncContext *s,
- DCTELEM block[6][64])
-{
- int cbpc, cbpy, i, cbp, pred_x, pred_y, mx, my, dquant;
- int16_t *mot_val;
- static int8_t quant_tab[4] = { -1, -2, 1, 2 };
- const int xy= s->mb_x + s->mb_y * s->mb_stride;
-
- assert(s->h263_pred);
-
- if (s->pict_type == P_TYPE || s->pict_type==S_TYPE) {
- do{
- if (get_bits1(&s->gb)) {
- /* skip mb */
- s->mb_intra = 0;
- for(i=0;i<6;i++)
- s->block_last_index[i] = -1;
- s->mv_dir = MV_DIR_FORWARD;
- s->mv_type = MV_TYPE_16X16;
- if(s->pict_type==S_TYPE && s->vol_sprite_usage==GMC_SPRITE){
- s->current_picture.mb_type[xy]= MB_TYPE_SKIP | MB_TYPE_GMC | MB_TYPE_16x16 | MB_TYPE_L0;
- s->mcsel=1;
- s->mv[0][0][0]= get_amv(s, 0);
- s->mv[0][0][1]= get_amv(s, 1);
-
- s->mb_skipped = 0;
- }else{
- s->current_picture.mb_type[xy]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0;
- s->mcsel=0;
- s->mv[0][0][0] = 0;
- s->mv[0][0][1] = 0;
- s->mb_skipped = 1;
- }
- goto end;
- }
- cbpc = get_vlc2(&s->gb, inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2);
- //fprintf(stderr, "\tCBPC: %d", cbpc);
- if (cbpc < 0){
- av_log(s->avctx, AV_LOG_ERROR, "cbpc damaged at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
- }while(cbpc == 20);
-
- s->dsp.clear_blocks(s->block[0]);
- dquant = cbpc & 8;
- s->mb_intra = ((cbpc & 4) != 0);
- if (s->mb_intra) goto intra;
-
- if(s->pict_type==S_TYPE && s->vol_sprite_usage==GMC_SPRITE && (cbpc & 16) == 0)
- s->mcsel= get_bits1(&s->gb);
- else s->mcsel= 0;
- cbpy = get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1) ^ 0x0F;
-
- cbp = (cbpc & 3) | (cbpy << 2);
- if (dquant) {
- ff_set_qscale(s, s->qscale + quant_tab[get_bits(&s->gb, 2)]);
- }
- if((!s->progressive_sequence) && (cbp || (s->workaround_bugs&FF_BUG_XVID_ILACE)))
- s->interlaced_dct= get_bits1(&s->gb);
-
- s->mv_dir = MV_DIR_FORWARD;
- if ((cbpc & 16) == 0) {
- if(s->mcsel){
- s->current_picture.mb_type[xy]= MB_TYPE_GMC | MB_TYPE_16x16 | MB_TYPE_L0;
- /* 16x16 global motion prediction */
- s->mv_type = MV_TYPE_16X16;
- mx= get_amv(s, 0);
- my= get_amv(s, 1);
- s->mv[0][0][0] = mx;
- s->mv[0][0][1] = my;
- }else if((!s->progressive_sequence) && get_bits1(&s->gb)){
- s->current_picture.mb_type[xy]= MB_TYPE_16x8 | MB_TYPE_L0 | MB_TYPE_INTERLACED;
- /* 16x8 field motion prediction */
- s->mv_type= MV_TYPE_FIELD;
-
- s->field_select[0][0]= get_bits1(&s->gb);
- s->field_select[0][1]= get_bits1(&s->gb);
-
- h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
-
- for(i=0; i<2; i++){
- mx = h263_decode_motion(s, pred_x, s->f_code);
- if (mx >= 0xffff)
- return -1;
-
- my = h263_decode_motion(s, pred_y/2, s->f_code);
- if (my >= 0xffff)
- return -1;
-
- s->mv[0][i][0] = mx;
- s->mv[0][i][1] = my;
- }
- }else{
- s->current_picture.mb_type[xy]= MB_TYPE_16x16 | MB_TYPE_L0;
- /* 16x16 motion prediction */
- s->mv_type = MV_TYPE_16X16;
- h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
- mx = h263_decode_motion(s, pred_x, s->f_code);
-
- if (mx >= 0xffff)
- return -1;
-
- my = h263_decode_motion(s, pred_y, s->f_code);
-
- if (my >= 0xffff)
- return -1;
- s->mv[0][0][0] = mx;
- s->mv[0][0][1] = my;
- }
- } else {
- s->current_picture.mb_type[xy]= MB_TYPE_8x8 | MB_TYPE_L0;
- s->mv_type = MV_TYPE_8X8;
- for(i=0;i<4;i++) {
- mot_val = h263_pred_motion(s, i, 0, &pred_x, &pred_y);
- mx = h263_decode_motion(s, pred_x, s->f_code);
- if (mx >= 0xffff)
- return -1;
-
- my = h263_decode_motion(s, pred_y, s->f_code);
- if (my >= 0xffff)
- return -1;
- s->mv[0][i][0] = mx;
- s->mv[0][i][1] = my;
- mot_val[0] = mx;
- mot_val[1] = my;
- }
- }
- } else if(s->pict_type==B_TYPE) {
- int modb1; // first bit of modb
- int modb2; // second bit of modb
- int mb_type;
-
- s->mb_intra = 0; //B-frames never contain intra blocks
- s->mcsel=0; // ... true gmc blocks
-
- if(s->mb_x==0){
- for(i=0; i<2; i++){
- s->last_mv[i][0][0]=
- s->last_mv[i][0][1]=
- s->last_mv[i][1][0]=
- s->last_mv[i][1][1]= 0;
- }
- }
-
- /* if we skipped it in the future P Frame than skip it now too */
- s->mb_skipped= s->next_picture.mbskip_table[s->mb_y * s->mb_stride + s->mb_x]; // Note, skiptab=0 if last was GMC
-
- if(s->mb_skipped){
- /* skip mb */
- for(i=0;i<6;i++)
- s->block_last_index[i] = -1;
-
- s->mv_dir = MV_DIR_FORWARD;
- s->mv_type = MV_TYPE_16X16;
- s->mv[0][0][0] = 0;
- s->mv[0][0][1] = 0;
- s->mv[1][0][0] = 0;
- s->mv[1][0][1] = 0;
- s->current_picture.mb_type[xy]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0;
- goto end;
- }
-
- modb1= get_bits1(&s->gb);
- if(modb1){
- mb_type= MB_TYPE_DIRECT2 | MB_TYPE_SKIP | MB_TYPE_L0L1; //like MB_TYPE_B_DIRECT but no vectors coded
- cbp=0;
- }else{
- modb2= get_bits1(&s->gb);
- mb_type= get_vlc2(&s->gb, mb_type_b_vlc.table, MB_TYPE_B_VLC_BITS, 1);
- if(mb_type<0){
- av_log(s->avctx, AV_LOG_ERROR, "illegal MB_type\n");
- return -1;
- }
- mb_type= mb_type_b_map[ mb_type ];
- if(modb2) cbp= 0;
- else{
- s->dsp.clear_blocks(s->block[0]);
- cbp= get_bits(&s->gb, 6);
- }
-
- if ((!IS_DIRECT(mb_type)) && cbp) {
- if(get_bits1(&s->gb)){
- ff_set_qscale(s, s->qscale + get_bits1(&s->gb)*4 - 2);
- }
- }
-
- if(!s->progressive_sequence){
- if(cbp)
- s->interlaced_dct= get_bits1(&s->gb);
-
- if(!IS_DIRECT(mb_type) && get_bits1(&s->gb)){
- mb_type |= MB_TYPE_16x8 | MB_TYPE_INTERLACED;
- mb_type &= ~MB_TYPE_16x16;
-
- if(USES_LIST(mb_type, 0)){
- s->field_select[0][0]= get_bits1(&s->gb);
- s->field_select[0][1]= get_bits1(&s->gb);
- }
- if(USES_LIST(mb_type, 1)){
- s->field_select[1][0]= get_bits1(&s->gb);
- s->field_select[1][1]= get_bits1(&s->gb);
- }
- }
- }
-
- s->mv_dir = 0;
- if((mb_type & (MB_TYPE_DIRECT2|MB_TYPE_INTERLACED)) == 0){
- s->mv_type= MV_TYPE_16X16;
-
- if(USES_LIST(mb_type, 0)){
- s->mv_dir = MV_DIR_FORWARD;
-
- mx = h263_decode_motion(s, s->last_mv[0][0][0], s->f_code);
- my = h263_decode_motion(s, s->last_mv[0][0][1], s->f_code);
- s->last_mv[0][1][0]= s->last_mv[0][0][0]= s->mv[0][0][0] = mx;
- s->last_mv[0][1][1]= s->last_mv[0][0][1]= s->mv[0][0][1] = my;
- }
-
- if(USES_LIST(mb_type, 1)){
- s->mv_dir |= MV_DIR_BACKWARD;
-
- mx = h263_decode_motion(s, s->last_mv[1][0][0], s->b_code);
- my = h263_decode_motion(s, s->last_mv[1][0][1], s->b_code);
- s->last_mv[1][1][0]= s->last_mv[1][0][0]= s->mv[1][0][0] = mx;
- s->last_mv[1][1][1]= s->last_mv[1][0][1]= s->mv[1][0][1] = my;
- }
- }else if(!IS_DIRECT(mb_type)){
- s->mv_type= MV_TYPE_FIELD;
-
- if(USES_LIST(mb_type, 0)){
- s->mv_dir = MV_DIR_FORWARD;
-
- for(i=0; i<2; i++){
- mx = h263_decode_motion(s, s->last_mv[0][i][0] , s->f_code);
- my = h263_decode_motion(s, s->last_mv[0][i][1]/2, s->f_code);
- s->last_mv[0][i][0]= s->mv[0][i][0] = mx;
- s->last_mv[0][i][1]= (s->mv[0][i][1] = my)*2;
- }
- }
-
- if(USES_LIST(mb_type, 1)){
- s->mv_dir |= MV_DIR_BACKWARD;
-
- for(i=0; i<2; i++){
- mx = h263_decode_motion(s, s->last_mv[1][i][0] , s->b_code);
- my = h263_decode_motion(s, s->last_mv[1][i][1]/2, s->b_code);
- s->last_mv[1][i][0]= s->mv[1][i][0] = mx;
- s->last_mv[1][i][1]= (s->mv[1][i][1] = my)*2;
- }
- }
- }
- }
-
- if(IS_DIRECT(mb_type)){
- if(IS_SKIP(mb_type))
- mx=my=0;
- else{
- mx = h263_decode_motion(s, 0, 1);
- my = h263_decode_motion(s, 0, 1);
- }
-
- s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD | MV_DIRECT;
- mb_type |= ff_mpeg4_set_direct_mv(s, mx, my);
- }
- s->current_picture.mb_type[xy]= mb_type;
- } else { /* I-Frame */
- do{
- cbpc = get_vlc2(&s->gb, intra_MCBPC_vlc.table, INTRA_MCBPC_VLC_BITS, 2);
- if (cbpc < 0){
- av_log(s->avctx, AV_LOG_ERROR, "I cbpc damaged at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
- }while(cbpc == 8);
-
- dquant = cbpc & 4;
- s->mb_intra = 1;
-intra:
- s->ac_pred = get_bits1(&s->gb);
- if(s->ac_pred)
- s->current_picture.mb_type[xy]= MB_TYPE_INTRA | MB_TYPE_ACPRED;
- else
- s->current_picture.mb_type[xy]= MB_TYPE_INTRA;
-
- cbpy = get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1);
- if(cbpy<0){
- av_log(s->avctx, AV_LOG_ERROR, "I cbpy damaged at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
- cbp = (cbpc & 3) | (cbpy << 2);
-
- s->use_intra_dc_vlc= s->qscale < s->intra_dc_threshold;
-
- if (dquant) {
- ff_set_qscale(s, s->qscale + quant_tab[get_bits(&s->gb, 2)]);
- }
-
- if(!s->progressive_sequence)
- s->interlaced_dct= get_bits1(&s->gb);
-
- s->dsp.clear_blocks(s->block[0]);
- /* decode each block */
- for (i = 0; i < 6; i++) {
- if (mpeg4_decode_block(s, block[i], i, cbp&32, 1, 0) < 0)
- return -1;
- cbp+=cbp;
- }
- goto end;
- }
-
- /* decode each block */
- for (i = 0; i < 6; i++) {
- if (mpeg4_decode_block(s, block[i], i, cbp&32, 0, 0) < 0)
- return -1;
- cbp+=cbp;
- }
-end:
-
- /* per-MB end of slice check */
- if(s->codec_id==CODEC_ID_MPEG4){
- if(mpeg4_is_resync(s)){
- const int delta= s->mb_x + 1 == s->mb_width ? 2 : 1;
- if(s->pict_type==B_TYPE && s->next_picture.mbskip_table[xy + delta])
- return SLICE_OK;
- return SLICE_END;
- }
- }
-
- return SLICE_OK;
-}
-
-static int h263_decode_motion(MpegEncContext * s, int pred, int f_code)
-{
- int code, val, sign, shift, l;
- code = get_vlc2(&s->gb, mv_vlc.table, MV_VLC_BITS, 2);
-
- if (code == 0)
- return pred;
- if (code < 0)
- return 0xffff;
-
- sign = get_bits1(&s->gb);
- shift = f_code - 1;
- val = code;
- if (shift) {
- val = (val - 1) << shift;
- val |= get_bits(&s->gb, shift);
- val++;
- }
- if (sign)
- val = -val;
- val += pred;
-
- /* modulo decoding */
- if (!s->h263_long_vectors) {
- l = INT_BIT - 5 - f_code;
- val = (val<<l)>>l;
- } else {
- /* horrible h263 long vector mode */
- if (pred < -31 && val < -63)
- val += 64;
- if (pred > 32 && val > 63)
- val -= 64;
-
- }
- return val;
-}
-
-/* Decodes RVLC of H.263+ UMV */
-static int h263p_decode_umotion(MpegEncContext * s, int pred)
-{
- int code = 0, sign;
-
- if (get_bits1(&s->gb)) /* Motion difference = 0 */
- return pred;
-
- code = 2 + get_bits1(&s->gb);
-
- while (get_bits1(&s->gb))
- {
- code <<= 1;
- code += get_bits1(&s->gb);
- }
- sign = code & 1;
- code >>= 1;
-
- code = (sign) ? (pred - code) : (pred + code);
-#ifdef DEBUG
- av_log( s->avctx, AV_LOG_DEBUG,"H.263+ UMV Motion = %d\n", code);
-#endif
- return code;
-
-}
-
-static int h263_decode_block(MpegEncContext * s, DCTELEM * block,
- int n, int coded)
-{
- int code, level, i, j, last, run;
- RLTable *rl = &rl_inter;
- const uint8_t *scan_table;
- GetBitContext gb= s->gb;
-
- scan_table = s->intra_scantable.permutated;
- if (s->h263_aic && s->mb_intra) {
- rl = &rl_intra_aic;
- i = 0;
- if (s->ac_pred) {
- if (s->h263_aic_dir)
- scan_table = s->intra_v_scantable.permutated; /* left */
- else
- scan_table = s->intra_h_scantable.permutated; /* top */
- }
- } else if (s->mb_intra) {
- /* DC coef */
- if(s->codec_id == CODEC_ID_RV10){
-#ifdef CONFIG_RV10_DECODER
- if (s->rv10_version == 3 && s->pict_type == I_TYPE) {
- int component, diff;
- component = (n <= 3 ? 0 : n - 4 + 1);
- level = s->last_dc[component];
- if (s->rv10_first_dc_coded[component]) {
- diff = rv_decode_dc(s, n);
- if (diff == 0xffff)
- return -1;
- level += diff;
- level = level & 0xff; /* handle wrap round */
- s->last_dc[component] = level;
- } else {
- s->rv10_first_dc_coded[component] = 1;
- }
- } else {
- level = get_bits(&s->gb, 8);
- if (level == 255)
- level = 128;
- }
-#endif
- }else{
- level = get_bits(&s->gb, 8);
- if((level&0x7F) == 0){
- av_log(s->avctx, AV_LOG_ERROR, "illegal dc %d at %d %d\n", level, s->mb_x, s->mb_y);
- if(s->error_resilience >= FF_ER_COMPLIANT)
- return -1;
- }
- if (level == 255)
- level = 128;
- }
- block[0] = level;
- i = 1;
- } else {
- i = 0;
- }
- if (!coded) {
- if (s->mb_intra && s->h263_aic)
- goto not_coded;
- s->block_last_index[n] = i - 1;
- return 0;
- }
-retry:
- for(;;) {
- code = get_vlc2(&s->gb, rl->vlc.table, TEX_VLC_BITS, 2);
- if (code < 0){
- av_log(s->avctx, AV_LOG_ERROR, "illegal ac vlc code at %dx%d\n", s->mb_x, s->mb_y);
- return -1;
- }
- if (code == rl->n) {
- /* escape */
- if (s->h263_flv > 1) {
- int is11 = get_bits1(&s->gb);
- last = get_bits1(&s->gb);
- run = get_bits(&s->gb, 6);
- if(is11){
- level = get_sbits(&s->gb, 11);
- } else {
- level = get_sbits(&s->gb, 7);
- }
- } else {
- last = get_bits1(&s->gb);
- run = get_bits(&s->gb, 6);
- level = (int8_t)get_bits(&s->gb, 8);
- if(level == -128){
- if (s->codec_id == CODEC_ID_RV10) {
- /* XXX: should patch encoder too */
- level = get_sbits(&s->gb, 12);
- }else{
- level = get_bits(&s->gb, 5);
- level |= get_sbits(&s->gb, 6)<<5;
- }
- }
- }
- } else {
- run = rl->table_run[code];
- level = rl->table_level[code];
- last = code >= rl->last;
- if (get_bits1(&s->gb))
- level = -level;
- }
- i += run;
- if (i >= 64){
- if(s->alt_inter_vlc && rl == &rl_inter && !s->mb_intra){
- //looks like a hack but no, it's the way its supposed to work ...
- rl = &rl_intra_aic;
- i = 0;
- s->gb= gb;
- memset(block, 0, sizeof(DCTELEM)*64);
- goto retry;
- }
- av_log(s->avctx, AV_LOG_ERROR, "run overflow at %dx%d i:%d\n", s->mb_x, s->mb_y, s->mb_intra);
- return -1;
- }
- j = scan_table[i];
- block[j] = level;
- if (last)
- break;
- i++;
- }
-not_coded:
- if (s->mb_intra && s->h263_aic) {
- h263_pred_acdc(s, block, n);
- i = 63;
- }
- s->block_last_index[n] = i;
- return 0;
-}
-
-/**
- * decodes the dc value.
- * @param n block index (0-3 are luma, 4-5 are chroma)
- * @param dir_ptr the prediction direction will be stored here
- * @return the quantized dc
- */
-static inline int mpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr)
-{
- int level, code;
-
- if (n < 4)
- code = get_vlc2(&s->gb, dc_lum.table, DC_VLC_BITS, 1);
- else
- code = get_vlc2(&s->gb, dc_chrom.table, DC_VLC_BITS, 1);
- if (code < 0 || code > 9 /* && s->nbit<9 */){
- av_log(s->avctx, AV_LOG_ERROR, "illegal dc vlc\n");
- return -1;
- }
- if (code == 0) {
- level = 0;
- } else {
- if(IS_3IV1){
- if(code==1)
- level= 2*get_bits1(&s->gb)-1;
- else{
- if(get_bits1(&s->gb))
- level = get_bits(&s->gb, code-1) + (1<<(code-1));
- else
- level = -get_bits(&s->gb, code-1) - (1<<(code-1));
- }
- }else{
- level = get_xbits(&s->gb, code);
- }
-
- if (code > 8){
- if(get_bits1(&s->gb)==0){ /* marker */
- if(s->error_resilience>=2){
- av_log(s->avctx, AV_LOG_ERROR, "dc marker bit missing\n");
- return -1;
- }
- }
- }
- }
-
- return ff_mpeg4_pred_dc(s, n, level, dir_ptr, 0);
-}
-
-/**
- * decodes a block.
- * @return <0 if an error occured
- */
-static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
- int n, int coded, int intra, int rvlc)
-{
- int level, i, last, run;
- int dc_pred_dir;
- RLTable * rl;
- RL_VLC_ELEM * rl_vlc;
- const uint8_t * scan_table;
- int qmul, qadd;
-
- //Note intra & rvlc should be optimized away if this is inlined
-
- if(intra) {
- if(s->use_intra_dc_vlc){
- /* DC coef */
- if(s->partitioned_frame){
- level = s->dc_val[0][ s->block_index[n] ];
- if(n<4) level= FASTDIV((level + (s->y_dc_scale>>1)), s->y_dc_scale);
- else level= FASTDIV((level + (s->c_dc_scale>>1)), s->c_dc_scale);
- dc_pred_dir= (s->pred_dir_table[s->mb_x + s->mb_y*s->mb_stride]<<n)&32;
- }else{
- level = mpeg4_decode_dc(s, n, &dc_pred_dir);
- if (level < 0)
- return -1;
- }
- block[0] = level;
- i = 0;
- }else{
- i = -1;
- ff_mpeg4_pred_dc(s, n, 0, &dc_pred_dir, 0);
- }
- if (!coded)
- goto not_coded;
-
- if(rvlc){
- rl = &rvlc_rl_intra;
- rl_vlc = rvlc_rl_intra.rl_vlc[0];
- }else{
- rl = &rl_intra;
- rl_vlc = rl_intra.rl_vlc[0];
- }
- if (s->ac_pred) {
- if (dc_pred_dir == 0)
- scan_table = s->intra_v_scantable.permutated; /* left */
- else
- scan_table = s->intra_h_scantable.permutated; /* top */
- } else {
- scan_table = s->intra_scantable.permutated;
- }
- qmul=1;
- qadd=0;
- } else {
- i = -1;
- if (!coded) {
- s->block_last_index[n] = i;
- return 0;
- }
- if(rvlc) rl = &rvlc_rl_inter;
- else rl = &rl_inter;
-
- scan_table = s->intra_scantable.permutated;
-
- if(s->mpeg_quant){
- qmul=1;
- qadd=0;
- if(rvlc){
- rl_vlc = rvlc_rl_inter.rl_vlc[0];
- }else{
- rl_vlc = rl_inter.rl_vlc[0];
- }
- }else{
- qmul = s->qscale << 1;
- qadd = (s->qscale - 1) | 1;
- if(rvlc){
- rl_vlc = rvlc_rl_inter.rl_vlc[s->qscale];
- }else{
- rl_vlc = rl_inter.rl_vlc[s->qscale];
- }
- }
- }
- {
- OPEN_READER(re, &s->gb);
- for(;;) {
- UPDATE_CACHE(re, &s->gb);
- GET_RL_VLC(level, run, re, &s->gb, rl_vlc, TEX_VLC_BITS, 2, 0);
- if (level==0) {
- /* escape */
- if(rvlc){
- if(SHOW_UBITS(re, &s->gb, 1)==0){
- av_log(s->avctx, AV_LOG_ERROR, "1. marker bit missing in rvlc esc\n");
- return -1;
- }; SKIP_CACHE(re, &s->gb, 1);
-
- last= SHOW_UBITS(re, &s->gb, 1); SKIP_CACHE(re, &s->gb, 1);
- run= SHOW_UBITS(re, &s->gb, 6); LAST_SKIP_CACHE(re, &s->gb, 6);
- SKIP_COUNTER(re, &s->gb, 1+1+6);
- UPDATE_CACHE(re, &s->gb);
-
- if(SHOW_UBITS(re, &s->gb, 1)==0){
- av_log(s->avctx, AV_LOG_ERROR, "2. marker bit missing in rvlc esc\n");
- return -1;
- }; SKIP_CACHE(re, &s->gb, 1);
-
- level= SHOW_UBITS(re, &s->gb, 11); SKIP_CACHE(re, &s->gb, 11);
-
- if(SHOW_UBITS(re, &s->gb, 5)!=0x10){
- av_log(s->avctx, AV_LOG_ERROR, "reverse esc missing\n");
- return -1;
- }; SKIP_CACHE(re, &s->gb, 5);
-
- level= level * qmul + qadd;
- level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1); LAST_SKIP_CACHE(re, &s->gb, 1);
- SKIP_COUNTER(re, &s->gb, 1+11+5+1);
-
- i+= run + 1;
- if(last) i+=192;
- }else{
- int cache;
- cache= GET_CACHE(re, &s->gb);
-
- if(IS_3IV1)
- cache ^= 0xC0000000;
-
- if (cache&0x80000000) {
- if (cache&0x40000000) {
- /* third escape */
- SKIP_CACHE(re, &s->gb, 2);
- last= SHOW_UBITS(re, &s->gb, 1); SKIP_CACHE(re, &s->gb, 1);
- run= SHOW_UBITS(re, &s->gb, 6); LAST_SKIP_CACHE(re, &s->gb, 6);
- SKIP_COUNTER(re, &s->gb, 2+1+6);
- UPDATE_CACHE(re, &s->gb);
-
- if(IS_3IV1){
- level= SHOW_SBITS(re, &s->gb, 12); LAST_SKIP_BITS(re, &s->gb, 12);
- }else{
- if(SHOW_UBITS(re, &s->gb, 1)==0){
- av_log(s->avctx, AV_LOG_ERROR, "1. marker bit missing in 3. esc\n");
- return -1;
- }; SKIP_CACHE(re, &s->gb, 1);
-
- level= SHOW_SBITS(re, &s->gb, 12); SKIP_CACHE(re, &s->gb, 12);
-
- if(SHOW_UBITS(re, &s->gb, 1)==0){
- av_log(s->avctx, AV_LOG_ERROR, "2. marker bit missing in 3. esc\n");
- return -1;
- }; LAST_SKIP_CACHE(re, &s->gb, 1);
-
- SKIP_COUNTER(re, &s->gb, 1+12+1);
- }
-
-#if 0
- if(s->error_resilience >= FF_ER_COMPLIANT){
- const int abs_level= FFABS(level);
- if(abs_level<=MAX_LEVEL && run<=MAX_RUN){
- const int run1= run - rl->max_run[last][abs_level] - 1;
- if(abs_level <= rl->max_level[last][run]){
- av_log(s->avctx, AV_LOG_ERROR, "illegal 3. esc, vlc encoding possible\n");
- return -1;
- }
- if(s->error_resilience > FF_ER_COMPLIANT){
- if(abs_level <= rl->max_level[last][run]*2){
- av_log(s->avctx, AV_LOG_ERROR, "illegal 3. esc, esc 1 encoding possible\n");
- return -1;
- }
- if(run1 >= 0 && abs_level <= rl->max_level[last][run1]){
- av_log(s->avctx, AV_LOG_ERROR, "illegal 3. esc, esc 2 encoding possible\n");
- return -1;
- }
- }
- }
- }
-#endif
- if (level>0) level= level * qmul + qadd;
- else level= level * qmul - qadd;
-
- if((unsigned)(level + 2048) > 4095){
- if(s->error_resilience > FF_ER_COMPLIANT){
- if(level > 2560 || level<-2560){
- av_log(s->avctx, AV_LOG_ERROR, "|level| overflow in 3. esc, qp=%d\n", s->qscale);
- return -1;
- }
- }
- level= level<0 ? -2048 : 2047;
- }
-
- i+= run + 1;
- if(last) i+=192;
- } else {
- /* second escape */
-#if MIN_CACHE_BITS < 20
- LAST_SKIP_BITS(re, &s->gb, 2);
- UPDATE_CACHE(re, &s->gb);
-#else
- SKIP_BITS(re, &s->gb, 2);
-#endif
- GET_RL_VLC(level, run, re, &s->gb, rl_vlc, TEX_VLC_BITS, 2, 1);
- i+= run + rl->max_run[run>>7][level/qmul] +1; //FIXME opt indexing
- level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1);
- LAST_SKIP_BITS(re, &s->gb, 1);
- }
- } else {
- /* first escape */
-#if MIN_CACHE_BITS < 19
- LAST_SKIP_BITS(re, &s->gb, 1);
- UPDATE_CACHE(re, &s->gb);
-#else
- SKIP_BITS(re, &s->gb, 1);
-#endif
- GET_RL_VLC(level, run, re, &s->gb, rl_vlc, TEX_VLC_BITS, 2, 1);
- i+= run;
- level = level + rl->max_level[run>>7][(run-1)&63] * qmul;//FIXME opt indexing
- level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1);
- LAST_SKIP_BITS(re, &s->gb, 1);
- }
- }
- } else {
- i+= run;
- level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1);
- LAST_SKIP_BITS(re, &s->gb, 1);
- }
- if (i > 62){
- i-= 192;
- if(i&(~63)){
- av_log(s->avctx, AV_LOG_ERROR, "ac-tex damaged at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
-
- block[scan_table[i]] = level;
- break;
- }
-
- block[scan_table[i]] = level;
- }
- CLOSE_READER(re, &s->gb);
- }
- not_coded:
- if (intra) {
- if(!s->use_intra_dc_vlc){
- block[0] = ff_mpeg4_pred_dc(s, n, block[0], &dc_pred_dir, 0);
-
- i -= i>>31; //if(i == -1) i=0;
- }
-
- mpeg4_pred_ac(s, block, n, dc_pred_dir);
- if (s->ac_pred) {
- i = 63; /* XXX: not optimal */
- }
- }
- s->block_last_index[n] = i;
- return 0;
-}
-
-/* most is hardcoded. should extend to handle all h263 streams */
-int h263_decode_picture_header(MpegEncContext *s)
-{
- int format, width, height, i;
- uint32_t startcode;
-
- align_get_bits(&s->gb);
-
- startcode= get_bits(&s->gb, 22-8);
-
- for(i= s->gb.size_in_bits - get_bits_count(&s->gb); i>24; i-=8) {
- startcode = ((startcode << 8) | get_bits(&s->gb, 8)) & 0x003FFFFF;
-
- if(startcode == 0x20)
- break;
- }
-
- if (startcode != 0x20) {
- av_log(s->avctx, AV_LOG_ERROR, "Bad picture start code\n");
- return -1;
- }
- /* temporal reference */
- i = get_bits(&s->gb, 8); /* picture timestamp */
- if( (s->picture_number&~0xFF)+i < s->picture_number)
- i+= 256;
- s->current_picture_ptr->pts=
- s->picture_number= (s->picture_number&~0xFF) + i;
-
- /* PTYPE starts here */
- if (get_bits1(&s->gb) != 1) {
- /* marker */
- av_log(s->avctx, AV_LOG_ERROR, "Bad marker\n");
- return -1;
- }
- if (get_bits1(&s->gb) != 0) {
- av_log(s->avctx, AV_LOG_ERROR, "Bad H263 id\n");
- return -1; /* h263 id */
- }
- skip_bits1(&s->gb); /* split screen off */
- skip_bits1(&s->gb); /* camera off */
- skip_bits1(&s->gb); /* freeze picture release off */
-
- format = get_bits(&s->gb, 3);
- /*
- 0 forbidden
- 1 sub-QCIF
- 10 QCIF
- 7 extended PTYPE (PLUSPTYPE)
- */
-
- if (format != 7 && format != 6) {
- s->h263_plus = 0;
- /* H.263v1 */
- width = h263_format[format][0];
- height = h263_format[format][1];
- if (!width)
- return -1;
-
- s->pict_type = I_TYPE + get_bits1(&s->gb);
-
- s->h263_long_vectors = get_bits1(&s->gb);
-
- if (get_bits1(&s->gb) != 0) {
- av_log(s->avctx, AV_LOG_ERROR, "H263 SAC not supported\n");
- return -1; /* SAC: off */
- }
- s->obmc= get_bits1(&s->gb); /* Advanced prediction mode */
- s->unrestricted_mv = s->h263_long_vectors || s->obmc;
-
- if (get_bits1(&s->gb) != 0) {
- av_log(s->avctx, AV_LOG_ERROR, "H263 PB frame not supported\n");
- return -1; /* not PB frame */
- }
- s->chroma_qscale= s->qscale = get_bits(&s->gb, 5);
- skip_bits1(&s->gb); /* Continuous Presence Multipoint mode: off */
-
- s->width = width;
- s->height = height;
- s->avctx->sample_aspect_ratio= (AVRational){12,11};
- s->avctx->time_base= (AVRational){1001, 30000};
- } else {
- int ufep;
-
- /* H.263v2 */
- s->h263_plus = 1;
- ufep = get_bits(&s->gb, 3); /* Update Full Extended PTYPE */
-
- /* ufep other than 0 and 1 are reserved */
- if (ufep == 1) {
- /* OPPTYPE */
- format = get_bits(&s->gb, 3);
- dprintf("ufep=1, format: %d\n", format);
- s->custom_pcf= get_bits1(&s->gb);
- s->umvplus = get_bits(&s->gb, 1); /* Unrestricted Motion Vector */
- if (get_bits1(&s->gb) != 0) {
- av_log(s->avctx, AV_LOG_ERROR, "Syntax-based Arithmetic Coding (SAC) not supported\n");
- }
- s->obmc= get_bits1(&s->gb); /* Advanced prediction mode */
- s->h263_aic = get_bits1(&s->gb); /* Advanced Intra Coding (AIC) */
- s->loop_filter= get_bits1(&s->gb);
- s->unrestricted_mv = s->umvplus || s->obmc || s->loop_filter;
-
- s->h263_slice_structured= get_bits1(&s->gb);
- if (get_bits1(&s->gb) != 0) {
- av_log(s->avctx, AV_LOG_ERROR, "Reference Picture Selection not supported\n");
- }
- if (get_bits1(&s->gb) != 0) {
- av_log(s->avctx, AV_LOG_ERROR, "Independent Segment Decoding not supported\n");
- }
- s->alt_inter_vlc= get_bits1(&s->gb);
- s->modified_quant= get_bits1(&s->gb);
- if(s->modified_quant)
- s->chroma_qscale_table= ff_h263_chroma_qscale_table;
-
- skip_bits(&s->gb, 1); /* Prevent start code emulation */
-
- skip_bits(&s->gb, 3); /* Reserved */
- } else if (ufep != 0) {
- av_log(s->avctx, AV_LOG_ERROR, "Bad UFEP type (%d)\n", ufep);
- return -1;
- }
-
- /* MPPTYPE */
- s->pict_type = get_bits(&s->gb, 3);
- switch(s->pict_type){
- case 0: s->pict_type= I_TYPE;break;
- case 1: s->pict_type= P_TYPE;break;
- case 3: s->pict_type= B_TYPE;break;
- case 7: s->pict_type= I_TYPE;break; //ZYGO
- default:
- return -1;
- }
- skip_bits(&s->gb, 2);
- s->no_rounding = get_bits1(&s->gb);
- skip_bits(&s->gb, 4);
-
- /* Get the picture dimensions */
- if (ufep) {
- if (format == 6) {
- /* Custom Picture Format (CPFMT) */
- s->aspect_ratio_info = get_bits(&s->gb, 4);
- dprintf("aspect: %d\n", s->aspect_ratio_info);
- /* aspect ratios:
- 0 - forbidden
- 1 - 1:1
- 2 - 12:11 (CIF 4:3)
- 3 - 10:11 (525-type 4:3)
- 4 - 16:11 (CIF 16:9)
- 5 - 40:33 (525-type 16:9)
- 6-14 - reserved
- */
- width = (get_bits(&s->gb, 9) + 1) * 4;
- skip_bits1(&s->gb);
- height = get_bits(&s->gb, 9) * 4;
- dprintf("\nH.263+ Custom picture: %dx%d\n",width,height);
- if (s->aspect_ratio_info == FF_ASPECT_EXTENDED) {
- /* aspected dimensions */
- s->avctx->sample_aspect_ratio.num= get_bits(&s->gb, 8);
- s->avctx->sample_aspect_ratio.den= get_bits(&s->gb, 8);
- }else{
- s->avctx->sample_aspect_ratio= pixel_aspect[s->aspect_ratio_info];
- }
- } else {
- width = h263_format[format][0];
- height = h263_format[format][1];
- s->avctx->sample_aspect_ratio= (AVRational){12,11};
- }
- if ((width == 0) || (height == 0))
- return -1;
- s->width = width;
- s->height = height;
-
- if(s->custom_pcf){
- int gcd;
- s->avctx->time_base.den= 1800000;
- s->avctx->time_base.num= 1000 + get_bits1(&s->gb);
- s->avctx->time_base.num*= get_bits(&s->gb, 7);
- if(s->avctx->time_base.num == 0){
- av_log(s, AV_LOG_ERROR, "zero framerate\n");
- return -1;
- }
- gcd= ff_gcd(s->avctx->time_base.den, s->avctx->time_base.num);
- s->avctx->time_base.den /= gcd;
- s->avctx->time_base.num /= gcd;
-// av_log(s->avctx, AV_LOG_DEBUG, "%d/%d\n", s->avctx->time_base.den, s->avctx->time_base.num);
- }else{
- s->avctx->time_base= (AVRational){1001, 30000};
- }
- }
-
- if(s->custom_pcf){
- skip_bits(&s->gb, 2); //extended Temporal reference
- }
-
- if (ufep) {
- if (s->umvplus) {
- if(get_bits1(&s->gb)==0) /* Unlimited Unrestricted Motion Vectors Indicator (UUI) */
- skip_bits1(&s->gb);
- }
- if(s->h263_slice_structured){
- if (get_bits1(&s->gb) != 0) {
- av_log(s->avctx, AV_LOG_ERROR, "rectangular slices not supported\n");
- }
- if (get_bits1(&s->gb) != 0) {
- av_log(s->avctx, AV_LOG_ERROR, "unordered slices not supported\n");
- }
- }
- }
-
- s->qscale = get_bits(&s->gb, 5);
- }
-
- s->mb_width = (s->width + 15) / 16;
- s->mb_height = (s->height + 15) / 16;
- s->mb_num = s->mb_width * s->mb_height;
-
- /* PEI */
- while (get_bits1(&s->gb) != 0) {
- skip_bits(&s->gb, 8);
- }
-
- if(s->h263_slice_structured){
- if (get_bits1(&s->gb) != 1) {
- av_log(s->avctx, AV_LOG_ERROR, "SEPB1 marker missing\n");
- return -1;
- }
-
- ff_h263_decode_mba(s);
-
- if (get_bits1(&s->gb) != 1) {
- av_log(s->avctx, AV_LOG_ERROR, "SEPB2 marker missing\n");
- return -1;
- }
- }
- s->f_code = 1;
-
- if(s->h263_aic){
- s->y_dc_scale_table=
- s->c_dc_scale_table= ff_aic_dc_scale_table;
- }else{
- s->y_dc_scale_table=
- s->c_dc_scale_table= ff_mpeg1_dc_scale_table;
- }
-
- if(s->avctx->debug&FF_DEBUG_PICT_INFO){
- av_log(s->avctx, AV_LOG_DEBUG, "qp:%d %c size:%d rnd:%d%s%s%s%s%s%s%s%s%s %d/%d\n",
- s->qscale, av_get_pict_type_char(s->pict_type),
- s->gb.size_in_bits, 1-s->no_rounding,
- s->obmc ? " AP" : "",
- s->umvplus ? " UMV" : "",
- s->h263_long_vectors ? " LONG" : "",
- s->h263_plus ? " +" : "",
- s->h263_aic ? " AIC" : "",
- s->alt_inter_vlc ? " AIV" : "",
- s->modified_quant ? " MQ" : "",
- s->loop_filter ? " LOOP" : "",
- s->h263_slice_structured ? " SS" : "",
- s->avctx->time_base.den, s->avctx->time_base.num
- );
- }
-#if 1
- if (s->pict_type == I_TYPE && s->codec_tag == ff_get_fourcc("ZYGO")){
- int i,j;
- for(i=0; i<85; i++) av_log(s->avctx, AV_LOG_DEBUG, "%d", get_bits1(&s->gb));
- av_log(s->avctx, AV_LOG_DEBUG, "\n");
- for(i=0; i<13; i++){
- for(j=0; j<3; j++){
- int v= get_bits(&s->gb, 8);
- v |= get_sbits(&s->gb, 8)<<8;
- av_log(s->avctx, AV_LOG_DEBUG, " %5d", v);
- }
- av_log(s->avctx, AV_LOG_DEBUG, "\n");
- }
- for(i=0; i<50; i++) av_log(s->avctx, AV_LOG_DEBUG, "%d", get_bits1(&s->gb));
- }
-#endif
-
- return 0;
-}
-
-static void mpeg4_decode_sprite_trajectory(MpegEncContext * s, GetBitContext *gb)
-{
- int i;
- int a= 2<<s->sprite_warping_accuracy;
- int rho= 3-s->sprite_warping_accuracy;
- int r=16/a;
- const int vop_ref[4][2]= {{0,0}, {s->width,0}, {0, s->height}, {s->width, s->height}}; // only true for rectangle shapes
- int d[4][2]={{0,0}, {0,0}, {0,0}, {0,0}};
- int sprite_ref[4][2];
- int virtual_ref[2][2];
- int w2, h2, w3, h3;
- int alpha=0, beta=0;
- int w= s->width;
- int h= s->height;
- int min_ab;
-
- for(i=0; i<s->num_sprite_warping_points; i++){
- int length;
- int x=0, y=0;
-
- length= get_vlc2(gb, sprite_trajectory.table, SPRITE_TRAJ_VLC_BITS, 3);
- if(length){
- x= get_xbits(gb, length);
- }
- if(!(s->divx_version==500 && s->divx_build==413)) skip_bits1(gb); /* marker bit */
-
- length= get_vlc2(gb, sprite_trajectory.table, SPRITE_TRAJ_VLC_BITS, 3);
- if(length){
- y=get_xbits(gb, length);
- }
- skip_bits1(gb); /* marker bit */
-//printf("%d %d %d %d\n", x, y, i, s->sprite_warping_accuracy);
- d[i][0]= x;
- d[i][1]= y;
- }
-
- while((1<<alpha)<w) alpha++;
- while((1<<beta )<h) beta++; // there seems to be a typo in the mpeg4 std for the definition of w' and h'
- w2= 1<<alpha;
- h2= 1<<beta;
-
-// Note, the 4th point isn't used for GMC
- if(s->divx_version==500 && s->divx_build==413){
- sprite_ref[0][0]= a*vop_ref[0][0] + d[0][0];
- sprite_ref[0][1]= a*vop_ref[0][1] + d[0][1];
- sprite_ref[1][0]= a*vop_ref[1][0] + d[0][0] + d[1][0];
- sprite_ref[1][1]= a*vop_ref[1][1] + d[0][1] + d[1][1];
- sprite_ref[2][0]= a*vop_ref[2][0] + d[0][0] + d[2][0];
- sprite_ref[2][1]= a*vop_ref[2][1] + d[0][1] + d[2][1];
- } else {
- sprite_ref[0][0]= (a>>1)*(2*vop_ref[0][0] + d[0][0]);
- sprite_ref[0][1]= (a>>1)*(2*vop_ref[0][1] + d[0][1]);
- sprite_ref[1][0]= (a>>1)*(2*vop_ref[1][0] + d[0][0] + d[1][0]);
- sprite_ref[1][1]= (a>>1)*(2*vop_ref[1][1] + d[0][1] + d[1][1]);
- sprite_ref[2][0]= (a>>1)*(2*vop_ref[2][0] + d[0][0] + d[2][0]);
- sprite_ref[2][1]= (a>>1)*(2*vop_ref[2][1] + d[0][1] + d[2][1]);
- }
-/* sprite_ref[3][0]= (a>>1)*(2*vop_ref[3][0] + d[0][0] + d[1][0] + d[2][0] + d[3][0]);
- sprite_ref[3][1]= (a>>1)*(2*vop_ref[3][1] + d[0][1] + d[1][1] + d[2][1] + d[3][1]); */
-
-// this is mostly identical to the mpeg4 std (and is totally unreadable because of that ...)
-// perhaps it should be reordered to be more readable ...
-// the idea behind this virtual_ref mess is to be able to use shifts later per pixel instead of divides
-// so the distance between points is converted from w&h based to w2&h2 based which are of the 2^x form
- virtual_ref[0][0]= 16*(vop_ref[0][0] + w2)
- + ROUNDED_DIV(((w - w2)*(r*sprite_ref[0][0] - 16*vop_ref[0][0]) + w2*(r*sprite_ref[1][0] - 16*vop_ref[1][0])),w);
- virtual_ref[0][1]= 16*vop_ref[0][1]
- + ROUNDED_DIV(((w - w2)*(r*sprite_ref[0][1] - 16*vop_ref[0][1]) + w2*(r*sprite_ref[1][1] - 16*vop_ref[1][1])),w);
- virtual_ref[1][0]= 16*vop_ref[0][0]
- + ROUNDED_DIV(((h - h2)*(r*sprite_ref[0][0] - 16*vop_ref[0][0]) + h2*(r*sprite_ref[2][0] - 16*vop_ref[2][0])),h);
- virtual_ref[1][1]= 16*(vop_ref[0][1] + h2)
- + ROUNDED_DIV(((h - h2)*(r*sprite_ref[0][1] - 16*vop_ref[0][1]) + h2*(r*sprite_ref[2][1] - 16*vop_ref[2][1])),h);
-
- switch(s->num_sprite_warping_points)
- {
- case 0:
- s->sprite_offset[0][0]= 0;
- s->sprite_offset[0][1]= 0;
- s->sprite_offset[1][0]= 0;
- s->sprite_offset[1][1]= 0;
- s->sprite_delta[0][0]= a;
- s->sprite_delta[0][1]= 0;
- s->sprite_delta[1][0]= 0;
- s->sprite_delta[1][1]= a;
- s->sprite_shift[0]= 0;
- s->sprite_shift[1]= 0;
- break;
- case 1: //GMC only
- s->sprite_offset[0][0]= sprite_ref[0][0] - a*vop_ref[0][0];
- s->sprite_offset[0][1]= sprite_ref[0][1] - a*vop_ref[0][1];
- s->sprite_offset[1][0]= ((sprite_ref[0][0]>>1)|(sprite_ref[0][0]&1)) - a*(vop_ref[0][0]/2);
- s->sprite_offset[1][1]= ((sprite_ref[0][1]>>1)|(sprite_ref[0][1]&1)) - a*(vop_ref[0][1]/2);
- s->sprite_delta[0][0]= a;
- s->sprite_delta[0][1]= 0;
- s->sprite_delta[1][0]= 0;
- s->sprite_delta[1][1]= a;
- s->sprite_shift[0]= 0;
- s->sprite_shift[1]= 0;
- break;
- case 2:
- s->sprite_offset[0][0]= (sprite_ref[0][0]<<(alpha+rho))
- + (-r*sprite_ref[0][0] + virtual_ref[0][0])*(-vop_ref[0][0])
- + ( r*sprite_ref[0][1] - virtual_ref[0][1])*(-vop_ref[0][1])
- + (1<<(alpha+rho-1));
- s->sprite_offset[0][1]= (sprite_ref[0][1]<<(alpha+rho))
- + (-r*sprite_ref[0][1] + virtual_ref[0][1])*(-vop_ref[0][0])
- + (-r*sprite_ref[0][0] + virtual_ref[0][0])*(-vop_ref[0][1])
- + (1<<(alpha+rho-1));
- s->sprite_offset[1][0]= ( (-r*sprite_ref[0][0] + virtual_ref[0][0])*(-2*vop_ref[0][0] + 1)
- +( r*sprite_ref[0][1] - virtual_ref[0][1])*(-2*vop_ref[0][1] + 1)
- +2*w2*r*sprite_ref[0][0]
- - 16*w2
- + (1<<(alpha+rho+1)));
- s->sprite_offset[1][1]= ( (-r*sprite_ref[0][1] + virtual_ref[0][1])*(-2*vop_ref[0][0] + 1)
- +(-r*sprite_ref[0][0] + virtual_ref[0][0])*(-2*vop_ref[0][1] + 1)
- +2*w2*r*sprite_ref[0][1]
- - 16*w2
- + (1<<(alpha+rho+1)));
- s->sprite_delta[0][0]= (-r*sprite_ref[0][0] + virtual_ref[0][0]);
- s->sprite_delta[0][1]= (+r*sprite_ref[0][1] - virtual_ref[0][1]);
- s->sprite_delta[1][0]= (-r*sprite_ref[0][1] + virtual_ref[0][1]);
- s->sprite_delta[1][1]= (-r*sprite_ref[0][0] + virtual_ref[0][0]);
-
- s->sprite_shift[0]= alpha+rho;
- s->sprite_shift[1]= alpha+rho+2;
- break;
- case 3:
- min_ab= FFMIN(alpha, beta);
- w3= w2>>min_ab;
- h3= h2>>min_ab;
- s->sprite_offset[0][0]= (sprite_ref[0][0]<<(alpha+beta+rho-min_ab))
- + (-r*sprite_ref[0][0] + virtual_ref[0][0])*h3*(-vop_ref[0][0])
- + (-r*sprite_ref[0][0] + virtual_ref[1][0])*w3*(-vop_ref[0][1])
- + (1<<(alpha+beta+rho-min_ab-1));
- s->sprite_offset[0][1]= (sprite_ref[0][1]<<(alpha+beta+rho-min_ab))
- + (-r*sprite_ref[0][1] + virtual_ref[0][1])*h3*(-vop_ref[0][0])
- + (-r*sprite_ref[0][1] + virtual_ref[1][1])*w3*(-vop_ref[0][1])
- + (1<<(alpha+beta+rho-min_ab-1));
- s->sprite_offset[1][0]= (-r*sprite_ref[0][0] + virtual_ref[0][0])*h3*(-2*vop_ref[0][0] + 1)
- + (-r*sprite_ref[0][0] + virtual_ref[1][0])*w3*(-2*vop_ref[0][1] + 1)
- + 2*w2*h3*r*sprite_ref[0][0]
- - 16*w2*h3
- + (1<<(alpha+beta+rho-min_ab+1));
- s->sprite_offset[1][1]= (-r*sprite_ref[0][1] + virtual_ref[0][1])*h3*(-2*vop_ref[0][0] + 1)
- + (-r*sprite_ref[0][1] + virtual_ref[1][1])*w3*(-2*vop_ref[0][1] + 1)
- + 2*w2*h3*r*sprite_ref[0][1]
- - 16*w2*h3
- + (1<<(alpha+beta+rho-min_ab+1));
- s->sprite_delta[0][0]= (-r*sprite_ref[0][0] + virtual_ref[0][0])*h3;
- s->sprite_delta[0][1]= (-r*sprite_ref[0][0] + virtual_ref[1][0])*w3;
- s->sprite_delta[1][0]= (-r*sprite_ref[0][1] + virtual_ref[0][1])*h3;
- s->sprite_delta[1][1]= (-r*sprite_ref[0][1] + virtual_ref[1][1])*w3;
-
- s->sprite_shift[0]= alpha + beta + rho - min_ab;
- s->sprite_shift[1]= alpha + beta + rho - min_ab + 2;
- break;
- }
- /* try to simplify the situation */
- if( s->sprite_delta[0][0] == a<<s->sprite_shift[0]
- && s->sprite_delta[0][1] == 0
- && s->sprite_delta[1][0] == 0
- && s->sprite_delta[1][1] == a<<s->sprite_shift[0])
- {
- s->sprite_offset[0][0]>>=s->sprite_shift[0];
- s->sprite_offset[0][1]>>=s->sprite_shift[0];
- s->sprite_offset[1][0]>>=s->sprite_shift[1];
- s->sprite_offset[1][1]>>=s->sprite_shift[1];
- s->sprite_delta[0][0]= a;
- s->sprite_delta[0][1]= 0;
- s->sprite_delta[1][0]= 0;
- s->sprite_delta[1][1]= a;
- s->sprite_shift[0]= 0;
- s->sprite_shift[1]= 0;
- s->real_sprite_warping_points=1;
- }
- else{
- int shift_y= 16 - s->sprite_shift[0];
- int shift_c= 16 - s->sprite_shift[1];
-//printf("shifts %d %d\n", shift_y, shift_c);
- for(i=0; i<2; i++){
- s->sprite_offset[0][i]<<= shift_y;
- s->sprite_offset[1][i]<<= shift_c;
- s->sprite_delta[0][i]<<= shift_y;
- s->sprite_delta[1][i]<<= shift_y;
- s->sprite_shift[i]= 16;
- }
- s->real_sprite_warping_points= s->num_sprite_warping_points;
- }
-#if 0
-printf("vop:%d:%d %d:%d %d:%d, sprite:%d:%d %d:%d %d:%d, virtual: %d:%d %d:%d\n",
- vop_ref[0][0], vop_ref[0][1],
- vop_ref[1][0], vop_ref[1][1],
- vop_ref[2][0], vop_ref[2][1],
- sprite_ref[0][0], sprite_ref[0][1],
- sprite_ref[1][0], sprite_ref[1][1],
- sprite_ref[2][0], sprite_ref[2][1],
- virtual_ref[0][0], virtual_ref[0][1],
- virtual_ref[1][0], virtual_ref[1][1]
- );
-
-printf("offset: %d:%d , delta: %d %d %d %d, shift %d\n",
- s->sprite_offset[0][0], s->sprite_offset[0][1],
- s->sprite_delta[0][0], s->sprite_delta[0][1],
- s->sprite_delta[1][0], s->sprite_delta[1][1],
- s->sprite_shift[0]
- );
-#endif
-}
-
-static int mpeg4_decode_gop_header(MpegEncContext * s, GetBitContext *gb){
- int hours, minutes, seconds;
-
- hours= get_bits(gb, 5);
- minutes= get_bits(gb, 6);
- skip_bits1(gb);
- seconds= get_bits(gb, 6);
-
- s->time_base= seconds + 60*(minutes + 60*hours);
-
- skip_bits1(gb);
- skip_bits1(gb);
-
- return 0;
-}
-
-static int decode_vol_header(MpegEncContext *s, GetBitContext *gb){
- int width, height, vo_ver_id;
-
- /* vol header */
- skip_bits(gb, 1); /* random access */
- s->vo_type= get_bits(gb, 8);
- if (get_bits1(gb) != 0) { /* is_ol_id */
- vo_ver_id = get_bits(gb, 4); /* vo_ver_id */
- skip_bits(gb, 3); /* vo_priority */
- } else {
- vo_ver_id = 1;
- }
-//printf("vo type:%d\n",s->vo_type);
- s->aspect_ratio_info= get_bits(gb, 4);
- if(s->aspect_ratio_info == FF_ASPECT_EXTENDED){
- s->avctx->sample_aspect_ratio.num= get_bits(gb, 8); // par_width
- s->avctx->sample_aspect_ratio.den= get_bits(gb, 8); // par_height
- }else{
- s->avctx->sample_aspect_ratio= pixel_aspect[s->aspect_ratio_info];
- }
-
- if ((s->vol_control_parameters=get_bits1(gb))) { /* vol control parameter */
- int chroma_format= get_bits(gb, 2);
- if(chroma_format!=1){
- av_log(s->avctx, AV_LOG_ERROR, "illegal chroma format\n");
- }
- s->low_delay= get_bits1(gb);
- if(get_bits1(gb)){ /* vbv parameters */
- get_bits(gb, 15); /* first_half_bitrate */
- skip_bits1(gb); /* marker */
- get_bits(gb, 15); /* latter_half_bitrate */
- skip_bits1(gb); /* marker */
- get_bits(gb, 15); /* first_half_vbv_buffer_size */
- skip_bits1(gb); /* marker */
- get_bits(gb, 3); /* latter_half_vbv_buffer_size */
- get_bits(gb, 11); /* first_half_vbv_occupancy */
- skip_bits1(gb); /* marker */
- get_bits(gb, 15); /* latter_half_vbv_occupancy */
- skip_bits1(gb); /* marker */
- }
- }else{
- // set low delay flag only once the smartest? low delay detection won't be overriden
- if(s->picture_number==0)
- s->low_delay=0;
- }
-
- s->shape = get_bits(gb, 2); /* vol shape */
- if(s->shape != RECT_SHAPE) av_log(s->avctx, AV_LOG_ERROR, "only rectangular vol supported\n");
- if(s->shape == GRAY_SHAPE && vo_ver_id != 1){
- av_log(s->avctx, AV_LOG_ERROR, "Gray shape not supported\n");
- skip_bits(gb, 4); //video_object_layer_shape_extension
- }
-
- check_marker(gb, "before time_increment_resolution");
-
- s->avctx->time_base.den = get_bits(gb, 16);
- if(!s->avctx->time_base.den){
- av_log(s->avctx, AV_LOG_ERROR, "time_base.den==0\n");
- return -1;
- }
-
- s->time_increment_bits = av_log2(s->avctx->time_base.den - 1) + 1;
- if (s->time_increment_bits < 1)
- s->time_increment_bits = 1;
-
- check_marker(gb, "before fixed_vop_rate");
-
- if (get_bits1(gb) != 0) { /* fixed_vop_rate */
- s->avctx->time_base.num = get_bits(gb, s->time_increment_bits);
- }else
- s->avctx->time_base.num = 1;
-
- s->t_frame=0;
-
- if (s->shape != BIN_ONLY_SHAPE) {
- if (s->shape == RECT_SHAPE) {
- skip_bits1(gb); /* marker */
- width = get_bits(gb, 13);
- skip_bits1(gb); /* marker */
- height = get_bits(gb, 13);
- skip_bits1(gb); /* marker */
- if(width && height && !(s->width && s->codec_tag == ff_get_fourcc("MP4S"))){ /* they should be non zero but who knows ... */
- s->width = width;
- s->height = height;
-// printf("width/height: %d %d\n", width, height);
- }
- }
-
- s->progressive_sequence=
- s->progressive_frame= get_bits1(gb)^1;
- s->interlaced_dct=0;
- if(!get_bits1(gb) && (s->avctx->debug & FF_DEBUG_PICT_INFO))
- av_log(s->avctx, AV_LOG_INFO, "MPEG4 OBMC not supported (very likely buggy encoder)\n"); /* OBMC Disable */
- if (vo_ver_id == 1) {
- s->vol_sprite_usage = get_bits1(gb); /* vol_sprite_usage */
- } else {
- s->vol_sprite_usage = get_bits(gb, 2); /* vol_sprite_usage */
- }
- if(s->vol_sprite_usage==STATIC_SPRITE) av_log(s->avctx, AV_LOG_ERROR, "Static Sprites not supported\n");
- if(s->vol_sprite_usage==STATIC_SPRITE || s->vol_sprite_usage==GMC_SPRITE){
- if(s->vol_sprite_usage==STATIC_SPRITE){
- s->sprite_width = get_bits(gb, 13);
- skip_bits1(gb); /* marker */
- s->sprite_height= get_bits(gb, 13);
- skip_bits1(gb); /* marker */
- s->sprite_left = get_bits(gb, 13);
- skip_bits1(gb); /* marker */
- s->sprite_top = get_bits(gb, 13);
- skip_bits1(gb); /* marker */
- }
- s->num_sprite_warping_points= get_bits(gb, 6);
- s->sprite_warping_accuracy = get_bits(gb, 2);
- s->sprite_brightness_change= get_bits1(gb);
- if(s->vol_sprite_usage==STATIC_SPRITE)
- s->low_latency_sprite= get_bits1(gb);
- }
- // FIXME sadct disable bit if verid!=1 && shape not rect
-
- if (get_bits1(gb) == 1) { /* not_8_bit */
- s->quant_precision = get_bits(gb, 4); /* quant_precision */
- if(get_bits(gb, 4)!=8) av_log(s->avctx, AV_LOG_ERROR, "N-bit not supported\n"); /* bits_per_pixel */
- if(s->quant_precision!=5) av_log(s->avctx, AV_LOG_ERROR, "quant precision %d\n", s->quant_precision);
- } else {
- s->quant_precision = 5;
- }
-
- // FIXME a bunch of grayscale shape things
-
- if((s->mpeg_quant=get_bits1(gb))){ /* vol_quant_type */
- int i, v;
-
- /* load default matrixes */
- for(i=0; i<64; i++){
- int j= s->dsp.idct_permutation[i];
- v= ff_mpeg4_default_intra_matrix[i];
- s->intra_matrix[j]= v;
- s->chroma_intra_matrix[j]= v;
-
- v= ff_mpeg4_default_non_intra_matrix[i];
- s->inter_matrix[j]= v;
- s->chroma_inter_matrix[j]= v;
- }
-
- /* load custom intra matrix */
- if(get_bits1(gb)){
- int last=0;
- for(i=0; i<64; i++){
- int j;
- v= get_bits(gb, 8);
- if(v==0) break;
-
- last= v;
- j= s->dsp.idct_permutation[ ff_zigzag_direct[i] ];
- s->intra_matrix[j]= v;
- s->chroma_intra_matrix[j]= v;
- }
-
- /* replicate last value */
- for(; i<64; i++){
- int j= s->dsp.idct_permutation[ ff_zigzag_direct[i] ];
- s->intra_matrix[j]= last;
- s->chroma_intra_matrix[j]= last;
- }
- }
-
- /* load custom non intra matrix */
- if(get_bits1(gb)){
- int last=0;
- for(i=0; i<64; i++){
- int j;
- v= get_bits(gb, 8);
- if(v==0) break;
-
- last= v;
- j= s->dsp.idct_permutation[ ff_zigzag_direct[i] ];
- s->inter_matrix[j]= v;
- s->chroma_inter_matrix[j]= v;
- }
-
- /* replicate last value */
- for(; i<64; i++){
- int j= s->dsp.idct_permutation[ ff_zigzag_direct[i] ];
- s->inter_matrix[j]= last;
- s->chroma_inter_matrix[j]= last;
- }
- }
-
- // FIXME a bunch of grayscale shape things
- }
-
- if(vo_ver_id != 1)
- s->quarter_sample= get_bits1(gb);
- else s->quarter_sample=0;
-
- if(!get_bits1(gb)) av_log(s->avctx, AV_LOG_ERROR, "Complexity estimation not supported\n");
-
- s->resync_marker= !get_bits1(gb); /* resync_marker_disabled */
-
- s->data_partitioning= get_bits1(gb);
- if(s->data_partitioning){
- s->rvlc= get_bits1(gb);
- }
-
- if(vo_ver_id != 1) {
- s->new_pred= get_bits1(gb);
- if(s->new_pred){
- av_log(s->avctx, AV_LOG_ERROR, "new pred not supported\n");
- skip_bits(gb, 2); /* requested upstream message type */
- skip_bits1(gb); /* newpred segment type */
- }
- s->reduced_res_vop= get_bits1(gb);
- if(s->reduced_res_vop) av_log(s->avctx, AV_LOG_ERROR, "reduced resolution VOP not supported\n");
- }
- else{
- s->new_pred=0;
- s->reduced_res_vop= 0;
- }
-
- s->scalability= get_bits1(gb);
-
- if (s->scalability) {
- GetBitContext bak= *gb;
- int ref_layer_id;
- int ref_layer_sampling_dir;
- int h_sampling_factor_n;
- int h_sampling_factor_m;
- int v_sampling_factor_n;
- int v_sampling_factor_m;
-
- s->hierachy_type= get_bits1(gb);
- ref_layer_id= get_bits(gb, 4);
- ref_layer_sampling_dir= get_bits1(gb);
- h_sampling_factor_n= get_bits(gb, 5);
- h_sampling_factor_m= get_bits(gb, 5);
- v_sampling_factor_n= get_bits(gb, 5);
- v_sampling_factor_m= get_bits(gb, 5);
- s->enhancement_type= get_bits1(gb);
-
- if( h_sampling_factor_n==0 || h_sampling_factor_m==0
- || v_sampling_factor_n==0 || v_sampling_factor_m==0){
-
-// fprintf(stderr, "illegal scalability header (VERY broken encoder), trying to workaround\n");
- s->scalability=0;
-
- *gb= bak;
- }else
- av_log(s->avctx, AV_LOG_ERROR, "scalability not supported\n");
-
- // bin shape stuff FIXME
- }
- }
- return 0;
-}
-
-/**
- * decodes the user data stuff in the header.
- * allso inits divx/xvid/lavc_version/build
- */
-static int decode_user_data(MpegEncContext *s, GetBitContext *gb){
- char buf[256];
- int i;
- int e;
- int ver = 0, build = 0, ver2 = 0, ver3 = 0;
- char last;
-
- for(i=0; i<255 && get_bits_count(gb) < gb->size_in_bits; i++){
- if(show_bits(gb, 23) == 0) break;
- buf[i]= get_bits(gb, 8);
- }
- buf[i]=0;
-
- /* divx detection */
- e=sscanf(buf, "DivX%dBuild%d%c", &ver, &build, &last);
- if(e<2)
- e=sscanf(buf, "DivX%db%d%c", &ver, &build, &last);
- if(e>=2){
- s->divx_version= ver;
- s->divx_build= build;
- s->divx_packed= e==3 && last=='p';
- }
-
- /* ffmpeg detection */
- e=sscanf(buf, "FFmpe%*[^b]b%d", &build)+3;
- if(e!=4)
- e=sscanf(buf, "FFmpeg v%d.%d.%d / libavcodec build: %d", &ver, &ver2, &ver3, &build);
- if(e!=4){
- e=sscanf(buf, "Lavc%d.%d.%d", &ver, &ver2, &ver3)+1;
- if (e>1)
- build= (ver<<16) + (ver2<<8) + ver3;
- }
- if(e!=4){
- if(strcmp(buf, "ffmpeg")==0){
- s->lavc_build= 4600;
- }
- }
- if(e==4){
- s->lavc_build= build;
- }
-
- /* xvid detection */
- e=sscanf(buf, "XviD%d", &build);
- if(e==1){
- s->xvid_build= build;
- }
-
-//printf("User Data: %s\n", buf);
- return 0;
-}
-
-static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
- int time_incr, time_increment;
-
- s->pict_type = get_bits(gb, 2) + I_TYPE; /* pict type: I = 0 , P = 1 */
- if(s->pict_type==B_TYPE && s->low_delay && s->vol_control_parameters==0 && !(s->flags & CODEC_FLAG_LOW_DELAY)){
- av_log(s->avctx, AV_LOG_ERROR, "low_delay flag incorrectly, clearing it\n");
- s->low_delay=0;
- }
-
- s->partitioned_frame= s->data_partitioning && s->pict_type!=B_TYPE;
- if(s->partitioned_frame)
- s->decode_mb= mpeg4_decode_partitioned_mb;
- else
- s->decode_mb= ff_mpeg4_decode_mb;
-
- time_incr=0;
- while (get_bits1(gb) != 0)
- time_incr++;
-
- check_marker(gb, "before time_increment");
-
- if(s->time_increment_bits==0 || !(show_bits(gb, s->time_increment_bits+1)&1)){
- av_log(s->avctx, AV_LOG_ERROR, "hmm, seems the headers are not complete, trying to guess time_increment_bits\n");
-
- for(s->time_increment_bits=1 ;s->time_increment_bits<16; s->time_increment_bits++){
- if(show_bits(gb, s->time_increment_bits+1)&1) break;
- }
-
- av_log(s->avctx, AV_LOG_ERROR, "my guess is %d bits ;)\n",s->time_increment_bits);
- }
-
- if(IS_3IV1) time_increment= get_bits1(gb); //FIXME investigate further
- else time_increment= get_bits(gb, s->time_increment_bits);
-
-// printf("%d %X\n", s->time_increment_bits, time_increment);
-//av_log(s->avctx, AV_LOG_DEBUG, " type:%d modulo_time_base:%d increment:%d t_frame %d\n", s->pict_type, time_incr, time_increment, s->t_frame);
- if(s->pict_type!=B_TYPE){
- s->last_time_base= s->time_base;
- s->time_base+= time_incr;
- s->time= s->time_base*s->avctx->time_base.den + time_increment;
- if(s->workaround_bugs&FF_BUG_UMP4){
- if(s->time < s->last_non_b_time){
-// fprintf(stderr, "header is not mpeg4 compatible, broken encoder, trying to workaround\n");
- s->time_base++;
- s->time+= s->avctx->time_base.den;
- }
- }
- s->pp_time= s->time - s->last_non_b_time;
- s->last_non_b_time= s->time;
- }else{
- s->time= (s->last_time_base + time_incr)*s->avctx->time_base.den + time_increment;
- s->pb_time= s->pp_time - (s->last_non_b_time - s->time);
- if(s->pp_time <=s->pb_time || s->pp_time <= s->pp_time - s->pb_time || s->pp_time<=0){
-// printf("messed up order, maybe after seeking? skipping current b frame\n");
- return FRAME_SKIPPED;
- }
- ff_mpeg4_init_direct_mv(s);
-
- if(s->t_frame==0) s->t_frame= s->pb_time;
- if(s->t_frame==0) s->t_frame=1; // 1/0 protection
- s->pp_field_time= ( ROUNDED_DIV(s->last_non_b_time, s->t_frame)
- - ROUNDED_DIV(s->last_non_b_time - s->pp_time, s->t_frame))*2;
- s->pb_field_time= ( ROUNDED_DIV(s->time, s->t_frame)
- - ROUNDED_DIV(s->last_non_b_time - s->pp_time, s->t_frame))*2;
- if(!s->progressive_sequence){
- if(s->pp_field_time <= s->pb_field_time || s->pb_field_time <= 1)
- return FRAME_SKIPPED;
- }
- }
-//av_log(s->avctx, AV_LOG_DEBUG, "last nonb %"PRId64" last_base %d time %"PRId64" pp %d pb %d t %d ppf %d pbf %d\n", s->last_non_b_time, s->last_time_base, s->time, s->pp_time, s->pb_time, s->t_frame, s->pp_field_time, s->pb_field_time);
-
- if(s->avctx->time_base.num)
- s->current_picture_ptr->pts= (s->time + s->avctx->time_base.num/2) / s->avctx->time_base.num;
- else
- s->current_picture_ptr->pts= AV_NOPTS_VALUE;
- if(s->avctx->debug&FF_DEBUG_PTS)
- av_log(s->avctx, AV_LOG_DEBUG, "MPEG4 PTS: %"PRId64"\n", s->current_picture_ptr->pts);
-
- check_marker(gb, "before vop_coded");
-
- /* vop coded */
- if (get_bits1(gb) != 1){
- if(s->avctx->debug&FF_DEBUG_PICT_INFO)
- av_log(s->avctx, AV_LOG_ERROR, "vop not coded\n");
- return FRAME_SKIPPED;
- }
-//printf("time %d %d %d || %"PRId64" %"PRId64" %"PRId64"\n", s->time_increment_bits, s->avctx->time_base.den, s->time_base,
-//s->time, s->last_non_b_time, s->last_non_b_time - s->pp_time);
- if (s->shape != BIN_ONLY_SHAPE && ( s->pict_type == P_TYPE
- || (s->pict_type == S_TYPE && s->vol_sprite_usage==GMC_SPRITE))) {
- /* rounding type for motion estimation */
- s->no_rounding = get_bits1(gb);
- } else {
- s->no_rounding = 0;
- }
-//FIXME reduced res stuff
-
- if (s->shape != RECT_SHAPE) {
- if (s->vol_sprite_usage != 1 || s->pict_type != I_TYPE) {
- int width, height, hor_spat_ref, ver_spat_ref;
-
- width = get_bits(gb, 13);
- skip_bits1(gb); /* marker */
- height = get_bits(gb, 13);
- skip_bits1(gb); /* marker */
- hor_spat_ref = get_bits(gb, 13); /* hor_spat_ref */
- skip_bits1(gb); /* marker */
- ver_spat_ref = get_bits(gb, 13); /* ver_spat_ref */
- }
- skip_bits1(gb); /* change_CR_disable */
-
- if (get_bits1(gb) != 0) {
- skip_bits(gb, 8); /* constant_alpha_value */
- }
- }
-//FIXME complexity estimation stuff
-
- if (s->shape != BIN_ONLY_SHAPE) {
- s->intra_dc_threshold= mpeg4_dc_threshold[ get_bits(gb, 3) ];
- if(!s->progressive_sequence){
- s->top_field_first= get_bits1(gb);
- s->alternate_scan= get_bits1(gb);
- }else
- s->alternate_scan= 0;
- }
-
- if(s->alternate_scan){
- ff_init_scantable(s->dsp.idct_permutation, &s->inter_scantable , ff_alternate_vertical_scan);
- ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable , ff_alternate_vertical_scan);
- ff_init_scantable(s->dsp.idct_permutation, &s->intra_h_scantable, ff_alternate_vertical_scan);
- ff_init_scantable(s->dsp.idct_permutation, &s->intra_v_scantable, ff_alternate_vertical_scan);
- } else{
- ff_init_scantable(s->dsp.idct_permutation, &s->inter_scantable , ff_zigzag_direct);
- ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable , ff_zigzag_direct);
- ff_init_scantable(s->dsp.idct_permutation, &s->intra_h_scantable, ff_alternate_horizontal_scan);
- ff_init_scantable(s->dsp.idct_permutation, &s->intra_v_scantable, ff_alternate_vertical_scan);
- }
-
- if(s->pict_type == S_TYPE && (s->vol_sprite_usage==STATIC_SPRITE || s->vol_sprite_usage==GMC_SPRITE)){
- mpeg4_decode_sprite_trajectory(s, gb);
- if(s->sprite_brightness_change) av_log(s->avctx, AV_LOG_ERROR, "sprite_brightness_change not supported\n");
- if(s->vol_sprite_usage==STATIC_SPRITE) av_log(s->avctx, AV_LOG_ERROR, "static sprite not supported\n");
- }
-
- if (s->shape != BIN_ONLY_SHAPE) {
- s->chroma_qscale= s->qscale = get_bits(gb, s->quant_precision);
- if(s->qscale==0){
- av_log(s->avctx, AV_LOG_ERROR, "Error, header damaged or not MPEG4 header (qscale=0)\n");
- return -1; // makes no sense to continue, as there is nothing left from the image then
- }
-
- if (s->pict_type != I_TYPE) {
- s->f_code = get_bits(gb, 3); /* fcode_for */
- if(s->f_code==0){
- av_log(s->avctx, AV_LOG_ERROR, "Error, header damaged or not MPEG4 header (f_code=0)\n");
- return -1; // makes no sense to continue, as the MV decoding will break very quickly
- }
- }else
- s->f_code=1;
-
- if (s->pict_type == B_TYPE) {
- s->b_code = get_bits(gb, 3);
- }else
- s->b_code=1;
-
- if(s->avctx->debug&FF_DEBUG_PICT_INFO){
- av_log(s->avctx, AV_LOG_DEBUG, "qp:%d fc:%d,%d %s size:%d pro:%d alt:%d top:%d %spel part:%d resync:%d w:%d a:%d rnd:%d vot:%d%s dc:%d\n",
- s->qscale, s->f_code, s->b_code,
- s->pict_type == I_TYPE ? "I" : (s->pict_type == P_TYPE ? "P" : (s->pict_type == B_TYPE ? "B" : "S")),
- gb->size_in_bits,s->progressive_sequence, s->alternate_scan, s->top_field_first,
- s->quarter_sample ? "q" : "h", s->data_partitioning, s->resync_marker, s->num_sprite_warping_points,
- s->sprite_warping_accuracy, 1-s->no_rounding, s->vo_type, s->vol_control_parameters ? " VOLC" : " ", s->intra_dc_threshold);
- }
-
- if(!s->scalability){
- if (s->shape!=RECT_SHAPE && s->pict_type!=I_TYPE) {
- skip_bits1(gb); // vop shape coding type
- }
- }else{
- if(s->enhancement_type){
- int load_backward_shape= get_bits1(gb);
- if(load_backward_shape){
- av_log(s->avctx, AV_LOG_ERROR, "load backward shape isn't supported\n");
- }
- }
- skip_bits(gb, 2); //ref_select_code
- }
- }
- /* detect buggy encoders which don't set the low_delay flag (divx4/xvid/opendivx)*/
- // note we cannot detect divx5 without b-frames easily (although it's buggy too)
- if(s->vo_type==0 && s->vol_control_parameters==0 && s->divx_version==0 && s->picture_number==0){
- av_log(s->avctx, AV_LOG_ERROR, "looks like this file was encoded with (divx4/(old)xvid/opendivx) -> forcing low_delay flag\n");
- s->low_delay=1;
- }
-
- s->picture_number++; // better than pic number==0 always ;)
-
- s->y_dc_scale_table= ff_mpeg4_y_dc_scale_table; //FIXME add short header support
- s->c_dc_scale_table= ff_mpeg4_c_dc_scale_table;
-
- if(s->workaround_bugs&FF_BUG_EDGE){
- s->h_edge_pos= s->width;
- s->v_edge_pos= s->height;
- }
- return 0;
-}
-
-/**
- * decode mpeg4 headers
- * @return <0 if no VOP found (or a damaged one)
- * FRAME_SKIPPED if a not coded VOP is found
- * 0 if a VOP is found
- */
-int ff_mpeg4_decode_picture_header(MpegEncContext * s, GetBitContext *gb)
-{
- int startcode, v;
-
- /* search next start code */
- align_get_bits(gb);
-
- if(s->codec_tag == ff_get_fourcc("WV1F") && show_bits(gb, 24) == 0x575630){
- skip_bits(gb, 24);
- if(get_bits(gb, 8) == 0xF0)
- return decode_vop_header(s, gb);
- }
-
- startcode = 0xff;
- for(;;) {
- if(get_bits_count(gb) >= gb->size_in_bits){
- if(gb->size_in_bits==8 && (s->divx_version || s->xvid_build)){
- av_log(s->avctx, AV_LOG_ERROR, "frame skip %d\n", gb->size_in_bits);
- return FRAME_SKIPPED; //divx bug
- }else
- return -1; //end of stream
- }
-
- /* use the bits after the test */
- v = get_bits(gb, 8);
- startcode = ((startcode << 8) | v) & 0xffffffff;
-
- if((startcode&0xFFFFFF00) != 0x100)
- continue; //no startcode
-
- if(s->avctx->debug&FF_DEBUG_STARTCODE){
- av_log(s->avctx, AV_LOG_DEBUG, "startcode: %3X ", startcode);
- if (startcode<=0x11F) av_log(s->avctx, AV_LOG_DEBUG, "Video Object Start");
- else if(startcode<=0x12F) av_log(s->avctx, AV_LOG_DEBUG, "Video Object Layer Start");
- else if(startcode<=0x13F) av_log(s->avctx, AV_LOG_DEBUG, "Reserved");
- else if(startcode<=0x15F) av_log(s->avctx, AV_LOG_DEBUG, "FGS bp start");
- else if(startcode<=0x1AF) av_log(s->avctx, AV_LOG_DEBUG, "Reserved");
- else if(startcode==0x1B0) av_log(s->avctx, AV_LOG_DEBUG, "Visual Object Seq Start");
- else if(startcode==0x1B1) av_log(s->avctx, AV_LOG_DEBUG, "Visual Object Seq End");
- else if(startcode==0x1B2) av_log(s->avctx, AV_LOG_DEBUG, "User Data");
- else if(startcode==0x1B3) av_log(s->avctx, AV_LOG_DEBUG, "Group of VOP start");
- else if(startcode==0x1B4) av_log(s->avctx, AV_LOG_DEBUG, "Video Session Error");
- else if(startcode==0x1B5) av_log(s->avctx, AV_LOG_DEBUG, "Visual Object Start");
- else if(startcode==0x1B6) av_log(s->avctx, AV_LOG_DEBUG, "Video Object Plane start");
- else if(startcode==0x1B7) av_log(s->avctx, AV_LOG_DEBUG, "slice start");
- else if(startcode==0x1B8) av_log(s->avctx, AV_LOG_DEBUG, "extension start");
- else if(startcode==0x1B9) av_log(s->avctx, AV_LOG_DEBUG, "fgs start");
- else if(startcode==0x1BA) av_log(s->avctx, AV_LOG_DEBUG, "FBA Object start");
- else if(startcode==0x1BB) av_log(s->avctx, AV_LOG_DEBUG, "FBA Object Plane start");
- else if(startcode==0x1BC) av_log(s->avctx, AV_LOG_DEBUG, "Mesh Object start");
- else if(startcode==0x1BD) av_log(s->avctx, AV_LOG_DEBUG, "Mesh Object Plane start");
- else if(startcode==0x1BE) av_log(s->avctx, AV_LOG_DEBUG, "Still Texture Object start");
- else if(startcode==0x1BF) av_log(s->avctx, AV_LOG_DEBUG, "Texture Spatial Layer start");
- else if(startcode==0x1C0) av_log(s->avctx, AV_LOG_DEBUG, "Texture SNR Layer start");
- else if(startcode==0x1C1) av_log(s->avctx, AV_LOG_DEBUG, "Texture Tile start");
- else if(startcode==0x1C2) av_log(s->avctx, AV_LOG_DEBUG, "Texture Shape Layer start");
- else if(startcode==0x1C3) av_log(s->avctx, AV_LOG_DEBUG, "stuffing start");
- else if(startcode<=0x1C5) av_log(s->avctx, AV_LOG_DEBUG, "reserved");
- else if(startcode<=0x1FF) av_log(s->avctx, AV_LOG_DEBUG, "System start");
- av_log(s->avctx, AV_LOG_DEBUG, " at %d\n", get_bits_count(gb));
- }
-
- if(startcode >= 0x120 && startcode <= 0x12F){
- if(decode_vol_header(s, gb) < 0)
- return -1;
- }
- else if(startcode == USER_DATA_STARTCODE){
- decode_user_data(s, gb);
- }
- else if(startcode == GOP_STARTCODE){
- mpeg4_decode_gop_header(s, gb);
- }
- else if(startcode == VOP_STARTCODE){
- return decode_vop_header(s, gb);
- }
-
- align_get_bits(gb);
- startcode = 0xff;
- }
-}
-
-/* don't understand why they choose a different header ! */
-int intel_h263_decode_picture_header(MpegEncContext *s)
-{
- int format;
-
- /* picture header */
- if (get_bits_long(&s->gb, 22) != 0x20) {
- av_log(s->avctx, AV_LOG_ERROR, "Bad picture start code\n");
- return -1;
- }
- s->picture_number = get_bits(&s->gb, 8); /* picture timestamp */
-
- if (get_bits1(&s->gb) != 1) {
- av_log(s->avctx, AV_LOG_ERROR, "Bad marker\n");
- return -1; /* marker */
- }
- if (get_bits1(&s->gb) != 0) {
- av_log(s->avctx, AV_LOG_ERROR, "Bad H263 id\n");
- return -1; /* h263 id */
- }
- skip_bits1(&s->gb); /* split screen off */
- skip_bits1(&s->gb); /* camera off */
- skip_bits1(&s->gb); /* freeze picture release off */
-
- format = get_bits(&s->gb, 3);
- if (format != 7) {
- av_log(s->avctx, AV_LOG_ERROR, "Intel H263 free format not supported\n");
- return -1;
- }
- s->h263_plus = 0;
-
- s->pict_type = I_TYPE + get_bits1(&s->gb);
-
- s->unrestricted_mv = get_bits1(&s->gb);
- s->h263_long_vectors = s->unrestricted_mv;
-
- if (get_bits1(&s->gb) != 0) {
- av_log(s->avctx, AV_LOG_ERROR, "SAC not supported\n");
- return -1; /* SAC: off */
- }
- if (get_bits1(&s->gb) != 0) {
- s->obmc= 1;
- av_log(s->avctx, AV_LOG_ERROR, "Advanced Prediction Mode not supported\n");
-// return -1; /* advanced prediction mode: off */
- }
- if (get_bits1(&s->gb) != 0) {
- av_log(s->avctx, AV_LOG_ERROR, "PB frame mode no supported\n");
- return -1; /* PB frame mode */
- }
-
- /* skip unknown header garbage */
- skip_bits(&s->gb, 41);
-
- s->chroma_qscale= s->qscale = get_bits(&s->gb, 5);
- skip_bits1(&s->gb); /* Continuous Presence Multipoint mode: off */
-
- /* PEI */
- while (get_bits1(&s->gb) != 0) {
- skip_bits(&s->gb, 8);
- }
- s->f_code = 1;
-
- s->y_dc_scale_table=
- s->c_dc_scale_table= ff_mpeg1_dc_scale_table;
-
- return 0;
-}
-
-int flv_h263_decode_picture_header(MpegEncContext *s)
-{
- int format, width, height;
-
- /* picture header */
- if (get_bits_long(&s->gb, 17) != 1) {
- av_log(s->avctx, AV_LOG_ERROR, "Bad picture start code\n");
- return -1;
- }
- format = get_bits(&s->gb, 5);
- if (format != 0 && format != 1) {
- av_log(s->avctx, AV_LOG_ERROR, "Bad picture format\n");
- return -1;
- }
- s->h263_flv = format+1;
- s->picture_number = get_bits(&s->gb, 8); /* picture timestamp */
- format = get_bits(&s->gb, 3);
- switch (format) {
- case 0:
- width = get_bits(&s->gb, 8);
- height = get_bits(&s->gb, 8);
- break;
- case 1:
- width = get_bits(&s->gb, 16);
- height = get_bits(&s->gb, 16);
- break;
- case 2:
- width = 352;
- height = 288;
- break;
- case 3:
- width = 176;
- height = 144;
- break;
- case 4:
- width = 128;
- height = 96;
- break;
- case 5:
- width = 320;
- height = 240;
- break;
- case 6:
- width = 160;
- height = 120;
- break;
- default:
- width = height = 0;
- break;
- }
- if(avcodec_check_dimensions(s->avctx, width, height))
- return -1;
- s->width = width;
- s->height = height;
-
- s->pict_type = I_TYPE + get_bits(&s->gb, 2);
- s->dropable= s->pict_type > P_TYPE;
- if (s->dropable)
- s->pict_type = P_TYPE;
-
- skip_bits1(&s->gb); /* deblocking flag */
- s->chroma_qscale= s->qscale = get_bits(&s->gb, 5);
-
- s->h263_plus = 0;
-
- s->unrestricted_mv = 1;
- s->h263_long_vectors = 0;
-
- /* PEI */
- while (get_bits1(&s->gb) != 0) {
- skip_bits(&s->gb, 8);
- }
- s->f_code = 1;
-
- if(s->avctx->debug & FF_DEBUG_PICT_INFO){
- av_log(s->avctx, AV_LOG_DEBUG, "%c esc_type:%d, qp:%d num:%d\n",
- s->dropable ? 'D' : av_get_pict_type_char(s->pict_type), s->h263_flv-1, s->qscale, s->picture_number);
- }
-
- s->y_dc_scale_table=
- s->c_dc_scale_table= ff_mpeg1_dc_scale_table;
-
- return 0;
-}
diff --git a/src/libffmpeg/libavcodec/h263data.h b/src/libffmpeg/libavcodec/h263data.h
deleted file mode 100644
index 5eddc3b54..000000000
--- a/src/libffmpeg/libavcodec/h263data.h
+++ /dev/null
@@ -1,308 +0,0 @@
-/*
- * copyright (c) 2000,2001 Fabrice Bellard
- * H263+ support
- * copyright (c) 2001 Juan J. Sierralta P.
- * copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file h263data.h
- * H.263 tables.
- */
-
-
-/* intra MCBPC, mb_type = (intra), then (intraq) */
-const uint8_t intra_MCBPC_code[9] = { 1, 1, 2, 3, 1, 1, 2, 3, 1 };
-const uint8_t intra_MCBPC_bits[9] = { 1, 3, 3, 3, 4, 6, 6, 6, 9 };
-
-/* inter MCBPC, mb_type = (inter), (intra), (interq), (intraq), (inter4v) */
-/* Changed the tables for interq and inter4v+q, following the standard ** Juanjo ** */
-const uint8_t inter_MCBPC_code[28] = {
- 1, 3, 2, 5,
- 3, 4, 3, 3,
- 3, 7, 6, 5,
- 4, 4, 3, 2,
- 2, 5, 4, 5,
- 1, 0, 0, 0, /* Stuffing */
- 2, 12, 14, 15,
-};
-const uint8_t inter_MCBPC_bits[28] = {
- 1, 4, 4, 6, /* inter */
- 5, 8, 8, 7, /* intra */
- 3, 7, 7, 9, /* interQ */
- 6, 9, 9, 9, /* intraQ */
- 3, 7, 7, 8, /* inter4 */
- 9, 0, 0, 0, /* Stuffing */
- 11, 13, 13, 13,/* inter4Q*/
-};
-
-static const uint8_t h263_mbtype_b_tab[15][2] = {
- {1, 1},
- {3, 3},
- {1, 5},
- {4, 4},
- {5, 4},
- {6, 6},
- {2, 4},
- {3, 4},
- {7, 6},
- {4, 6},
- {5, 6},
- {1, 6},
- {1,10},
- {1, 7},
- {1, 8},
-};
-
-static const int h263_mb_type_b_map[15]= {
- MB_TYPE_DIRECT2 | MB_TYPE_L0L1,
- MB_TYPE_DIRECT2 | MB_TYPE_L0L1 | MB_TYPE_CBP,
- MB_TYPE_DIRECT2 | MB_TYPE_L0L1 | MB_TYPE_CBP | MB_TYPE_QUANT,
- MB_TYPE_L0 | MB_TYPE_16x16,
- MB_TYPE_L0 | MB_TYPE_CBP | MB_TYPE_16x16,
- MB_TYPE_L0 | MB_TYPE_CBP | MB_TYPE_QUANT | MB_TYPE_16x16,
- MB_TYPE_L1 | MB_TYPE_16x16,
- MB_TYPE_L1 | MB_TYPE_CBP | MB_TYPE_16x16,
- MB_TYPE_L1 | MB_TYPE_CBP | MB_TYPE_QUANT | MB_TYPE_16x16,
- MB_TYPE_L0L1 | MB_TYPE_16x16,
- MB_TYPE_L0L1 | MB_TYPE_CBP | MB_TYPE_16x16,
- MB_TYPE_L0L1 | MB_TYPE_CBP | MB_TYPE_QUANT | MB_TYPE_16x16,
- 0, //stuffing
- MB_TYPE_INTRA4x4 | MB_TYPE_CBP,
- MB_TYPE_INTRA4x4 | MB_TYPE_CBP | MB_TYPE_QUANT,
-};
-
-static const uint8_t cbpc_b_tab[4][2] = {
-{0, 1},
-{2, 2},
-{7, 3},
-{6, 3},
-};
-
-const uint8_t cbpy_tab[16][2] =
-{
- {3,4}, {5,5}, {4,5}, {9,4}, {3,5}, {7,4}, {2,6}, {11,4},
- {2,5}, {3,6}, {5,4}, {10,4}, {4,4}, {8,4}, {6,4}, {3,2}
-};
-
-const uint8_t mvtab[33][2] =
-{
- {1,1}, {1,2}, {1,3}, {1,4}, {3,6}, {5,7}, {4,7}, {3,7},
- {11,9}, {10,9}, {9,9}, {17,10}, {16,10}, {15,10}, {14,10}, {13,10},
- {12,10}, {11,10}, {10,10}, {9,10}, {8,10}, {7,10}, {6,10}, {5,10},
- {4,10}, {7,11}, {6,11}, {5,11}, {4,11}, {3,11}, {2,11}, {3,12},
- {2,12}
-};
-
-/* third non intra table */
-const uint16_t inter_vlc[103][2] = {
-{ 0x2, 2 },{ 0xf, 4 },{ 0x15, 6 },{ 0x17, 7 },
-{ 0x1f, 8 },{ 0x25, 9 },{ 0x24, 9 },{ 0x21, 10 },
-{ 0x20, 10 },{ 0x7, 11 },{ 0x6, 11 },{ 0x20, 11 },
-{ 0x6, 3 },{ 0x14, 6 },{ 0x1e, 8 },{ 0xf, 10 },
-{ 0x21, 11 },{ 0x50, 12 },{ 0xe, 4 },{ 0x1d, 8 },
-{ 0xe, 10 },{ 0x51, 12 },{ 0xd, 5 },{ 0x23, 9 },
-{ 0xd, 10 },{ 0xc, 5 },{ 0x22, 9 },{ 0x52, 12 },
-{ 0xb, 5 },{ 0xc, 10 },{ 0x53, 12 },{ 0x13, 6 },
-{ 0xb, 10 },{ 0x54, 12 },{ 0x12, 6 },{ 0xa, 10 },
-{ 0x11, 6 },{ 0x9, 10 },{ 0x10, 6 },{ 0x8, 10 },
-{ 0x16, 7 },{ 0x55, 12 },{ 0x15, 7 },{ 0x14, 7 },
-{ 0x1c, 8 },{ 0x1b, 8 },{ 0x21, 9 },{ 0x20, 9 },
-{ 0x1f, 9 },{ 0x1e, 9 },{ 0x1d, 9 },{ 0x1c, 9 },
-{ 0x1b, 9 },{ 0x1a, 9 },{ 0x22, 11 },{ 0x23, 11 },
-{ 0x56, 12 },{ 0x57, 12 },{ 0x7, 4 },{ 0x19, 9 },
-{ 0x5, 11 },{ 0xf, 6 },{ 0x4, 11 },{ 0xe, 6 },
-{ 0xd, 6 },{ 0xc, 6 },{ 0x13, 7 },{ 0x12, 7 },
-{ 0x11, 7 },{ 0x10, 7 },{ 0x1a, 8 },{ 0x19, 8 },
-{ 0x18, 8 },{ 0x17, 8 },{ 0x16, 8 },{ 0x15, 8 },
-{ 0x14, 8 },{ 0x13, 8 },{ 0x18, 9 },{ 0x17, 9 },
-{ 0x16, 9 },{ 0x15, 9 },{ 0x14, 9 },{ 0x13, 9 },
-{ 0x12, 9 },{ 0x11, 9 },{ 0x7, 10 },{ 0x6, 10 },
-{ 0x5, 10 },{ 0x4, 10 },{ 0x24, 11 },{ 0x25, 11 },
-{ 0x26, 11 },{ 0x27, 11 },{ 0x58, 12 },{ 0x59, 12 },
-{ 0x5a, 12 },{ 0x5b, 12 },{ 0x5c, 12 },{ 0x5d, 12 },
-{ 0x5e, 12 },{ 0x5f, 12 },{ 0x3, 7 },
-};
-
-const int8_t inter_level[102] = {
- 1, 2, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 1, 2, 3, 4,
- 5, 6, 1, 2, 3, 4, 1, 2,
- 3, 1, 2, 3, 1, 2, 3, 1,
- 2, 3, 1, 2, 1, 2, 1, 2,
- 1, 2, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 2, 3, 1, 2, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1,
-};
-
-const int8_t inter_run[102] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 1, 1, 1,
- 1, 1, 2, 2, 2, 2, 3, 3,
- 3, 4, 4, 4, 5, 5, 5, 6,
- 6, 6, 7, 7, 8, 8, 9, 9,
- 10, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, 24,
- 25, 26, 0, 0, 0, 1, 1, 2,
- 3, 4, 5, 6, 7, 8, 9, 10,
- 11, 12, 13, 14, 15, 16, 17, 18,
- 19, 20, 21, 22, 23, 24, 25, 26,
- 27, 28, 29, 30, 31, 32, 33, 34,
- 35, 36, 37, 38, 39, 40,
-};
-
-static RLTable rl_inter = {
- 102,
- 58,
- inter_vlc,
- inter_run,
- inter_level,
-};
-
-static const uint16_t intra_vlc_aic[103][2] = {
-{ 0x2, 2 }, { 0x6, 3 }, { 0xe, 4 }, { 0xc, 5 },
-{ 0xd, 5 }, { 0x10, 6 }, { 0x11, 6 }, { 0x12, 6 },
-{ 0x16, 7 }, { 0x1b, 8 }, { 0x20, 9 }, { 0x21, 9 },
-{ 0x1a, 9 }, { 0x1b, 9 }, { 0x1c, 9 }, { 0x1d, 9 },
-{ 0x1e, 9 }, { 0x1f, 9 }, { 0x23, 11 }, { 0x22, 11 },
-{ 0x57, 12 }, { 0x56, 12 }, { 0x55, 12 }, { 0x54, 12 },
-{ 0x53, 12 }, { 0xf, 4 }, { 0x14, 6 }, { 0x14, 7 },
-{ 0x1e, 8 }, { 0xf, 10 }, { 0x21, 11 }, { 0x50, 12 },
-{ 0xb, 5 }, { 0x15, 7 }, { 0xe, 10 }, { 0x9, 10 },
-{ 0x15, 6 }, { 0x1d, 8 }, { 0xd, 10 }, { 0x51, 12 },
-{ 0x13, 6 }, { 0x23, 9 }, { 0x7, 11 }, { 0x17, 7 },
-{ 0x22, 9 }, { 0x52, 12 }, { 0x1c, 8 }, { 0xc, 10 },
-{ 0x1f, 8 }, { 0xb, 10 }, { 0x25, 9 }, { 0xa, 10 },
-{ 0x24, 9 }, { 0x6, 11 }, { 0x21, 10 }, { 0x20, 10 },
-{ 0x8, 10 }, { 0x20, 11 }, { 0x7, 4 }, { 0xc, 6 },
-{ 0x10, 7 }, { 0x13, 8 }, { 0x11, 9 }, { 0x12, 9 },
-{ 0x4, 10 }, { 0x27, 11 }, { 0x26, 11 }, { 0x5f, 12 },
-{ 0xf, 6 }, { 0x13, 9 }, { 0x5, 10 }, { 0x25, 11 },
-{ 0xe, 6 }, { 0x14, 9 }, { 0x24, 11 }, { 0xd, 6 },
-{ 0x6, 10 }, { 0x5e, 12 }, { 0x11, 7 }, { 0x7, 10 },
-{ 0x13, 7 }, { 0x5d, 12 }, { 0x12, 7 }, { 0x5c, 12 },
-{ 0x14, 8 }, { 0x5b, 12 }, { 0x15, 8 }, { 0x1a, 8 },
-{ 0x19, 8 }, { 0x18, 8 }, { 0x17, 8 }, { 0x16, 8 },
-{ 0x19, 9 }, { 0x15, 9 }, { 0x16, 9 }, { 0x18, 9 },
-{ 0x17, 9 }, { 0x4, 11 }, { 0x5, 11 }, { 0x58, 12 },
-{ 0x59, 12 }, { 0x5a, 12 }, { 0x3, 7 },
-};
-
-static const int8_t intra_run_aic[102] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 1, 1, 1, 1, 1, 1,
- 2, 2, 2, 2, 3, 3, 3, 3,
- 4, 4, 4, 5, 5, 5, 6, 6,
- 7, 7, 8, 8, 9, 9, 10, 11,
-12, 13, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 1, 1, 1,
- 2, 2, 2, 3, 3, 3, 4, 4,
- 5, 5, 6, 6, 7, 7, 8, 9,
-10, 11, 12, 13, 14, 15, 16, 17,
-18, 19, 20, 21, 22, 23,
-};
-
-static const int8_t intra_level_aic[102] = {
- 1, 2, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 16,
-17, 18, 19, 20, 21, 22, 23, 24,
-25, 1, 2, 3, 4, 5, 6, 7,
- 1, 2, 3, 4, 1, 2, 3, 4,
- 1, 2, 3, 1, 2, 3, 1, 2,
- 1, 2, 1, 2, 1, 2, 1, 1,
- 1, 1, 1, 2, 3, 4, 5, 6,
- 7, 8, 9, 10, 1, 2, 3, 4,
- 1, 2, 3, 1, 2, 3, 1, 2,
- 1, 2, 1, 2, 1, 2, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1,
-};
-
-static RLTable rl_intra_aic = {
- 102,
- 58,
- intra_vlc_aic,
- intra_run_aic,
- intra_level_aic,
-};
-
-static const uint8_t wrong_run[102] = {
- 1, 2, 3, 5, 4, 10, 9, 8,
-11, 15, 17, 16, 23, 22, 21, 20,
-19, 18, 25, 24, 27, 26, 11, 7,
- 6, 1, 2, 13, 2, 2, 2, 2,
- 6, 12, 3, 9, 1, 3, 4, 3,
- 7, 4, 1, 1, 5, 5, 14, 6,
- 1, 7, 1, 8, 1, 1, 1, 1,
-10, 1, 1, 5, 9, 17, 25, 24,
-29, 33, 32, 41, 2, 23, 28, 31,
- 3, 22, 30, 4, 27, 40, 8, 26,
- 6, 39, 7, 38, 16, 37, 15, 10,
-11, 12, 13, 14, 1, 21, 20, 18,
-19, 2, 1, 34, 35, 36
-};
-
-static const uint16_t h263_format[8][2] = {
- { 0, 0 },
- { 128, 96 },
- { 176, 144 },
- { 352, 288 },
- { 704, 576 },
- { 1408, 1152 },
-};
-
-const uint8_t ff_aic_dc_scale_table[32]={
-// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
- 0, 2, 4, 6, 8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62
-};
-
-static const uint8_t modified_quant_tab[2][32]={
-// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
-{
- 0, 3, 1, 2, 3, 4, 5, 6, 7, 8, 9, 9,10,11,12,13,14,15,16,17,18,18,19,20,21,22,23,24,25,26,27,28
-},{
- 0, 2, 3, 4, 5, 6, 7, 8, 9,10,11,13,14,15,16,17,18,19,20,21,22,24,25,26,27,28,29,30,31,31,31,26
-}
-};
-
-const uint8_t ff_h263_chroma_qscale_table[32]={
-// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
- 0, 1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 9,10,10,11,11,12,12,12,13,13,13,14,14,14,14,14,15,15,15,15,15
-};
-
-const uint16_t ff_mba_max[6]={
- 47, 98, 395,1583,6335,9215
-};
-
-const uint8_t ff_mba_length[7]={
- 6, 7, 9, 11, 13, 14, 14
-};
-
-const uint8_t ff_h263_loop_filter_strength[32]={
-// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
- 0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9,10,10,10,11,11,11,12,12,12
-};
-
diff --git a/src/libffmpeg/libavcodec/h263dec.c b/src/libffmpeg/libavcodec/h263dec.c
deleted file mode 100644
index 9246b5217..000000000
--- a/src/libffmpeg/libavcodec/h263dec.c
+++ /dev/null
@@ -1,913 +0,0 @@
-/*
- * H.263 decoder
- * Copyright (c) 2001 Fabrice Bellard.
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file h263dec.c
- * H.263 decoder.
- */
-
-#include "avcodec.h"
-#include "dsputil.h"
-#include "mpegvideo.h"
-
-//#define DEBUG
-//#define PRINT_FRAME_TIME
-
-int ff_h263_decode_init(AVCodecContext *avctx)
-{
- MpegEncContext *s = avctx->priv_data;
-
- s->avctx = avctx;
- s->out_format = FMT_H263;
-
- s->width = avctx->coded_width;
- s->height = avctx->coded_height;
- s->workaround_bugs= avctx->workaround_bugs;
-
- // set defaults
- MPV_decode_defaults(s);
- s->quant_precision=5;
- s->decode_mb= ff_h263_decode_mb;
- s->low_delay= 1;
- avctx->pix_fmt= PIX_FMT_YUV420P;
- s->unrestricted_mv= 1;
-
- /* select sub codec */
- switch(avctx->codec->id) {
- case CODEC_ID_H263:
- s->unrestricted_mv= 0;
- break;
- case CODEC_ID_MPEG4:
- s->decode_mb= ff_mpeg4_decode_mb;
- s->time_increment_bits = 4; /* default value for broken headers */
- s->h263_pred = 1;
- s->low_delay = 0; //default, might be overriden in the vol header during header parsing
- break;
- case CODEC_ID_MSMPEG4V1:
- s->h263_msmpeg4 = 1;
- s->h263_pred = 1;
- s->msmpeg4_version=1;
- break;
- case CODEC_ID_MSMPEG4V2:
- s->h263_msmpeg4 = 1;
- s->h263_pred = 1;
- s->msmpeg4_version=2;
- break;
- case CODEC_ID_MSMPEG4V3:
- s->h263_msmpeg4 = 1;
- s->h263_pred = 1;
- s->msmpeg4_version=3;
- break;
- case CODEC_ID_WMV1:
- s->h263_msmpeg4 = 1;
- s->h263_pred = 1;
- s->msmpeg4_version=4;
- break;
- case CODEC_ID_WMV2:
- s->h263_msmpeg4 = 1;
- s->h263_pred = 1;
- s->msmpeg4_version=5;
- break;
- case CODEC_ID_VC1:
- case CODEC_ID_WMV3:
- s->h263_msmpeg4 = 1;
- s->h263_pred = 1;
- s->msmpeg4_version=6;
- break;
- case CODEC_ID_H263I:
- break;
- case CODEC_ID_FLV1:
- s->h263_flv = 1;
- break;
- default:
- return -1;
- }
- s->codec_id= avctx->codec->id;
-
- /* for h263, we allocate the images after having read the header */
- if (avctx->codec->id != CODEC_ID_H263 && avctx->codec->id != CODEC_ID_MPEG4)
- if (MPV_common_init(s) < 0)
- return -1;
-
- if (s->h263_msmpeg4)
- ff_msmpeg4_decode_init(s);
- else
- h263_decode_init_vlc(s);
-
- return 0;
-}
-
-int ff_h263_decode_end(AVCodecContext *avctx)
-{
- MpegEncContext *s = avctx->priv_data;
-
- MPV_common_end(s);
- return 0;
-}
-
-/**
- * returns the number of bytes consumed for building the current frame
- */
-static int get_consumed_bytes(MpegEncContext *s, int buf_size){
- int pos= (get_bits_count(&s->gb)+7)>>3;
-
- if(s->divx_packed){
- //we would have to scan through the whole buf to handle the weird reordering ...
- return buf_size;
- }else if(s->flags&CODEC_FLAG_TRUNCATED){
- pos -= s->parse_context.last_index;
- if(pos<0) pos=0; // padding is not really read so this might be -1
- return pos;
- }else{
- if(pos==0) pos=1; //avoid infinite loops (i doubt thats needed but ...)
- if(pos+10>buf_size) pos=buf_size; // oops ;)
-
- return pos;
- }
-}
-
-static int decode_slice(MpegEncContext *s){
- const int part_mask= s->partitioned_frame ? (AC_END|AC_ERROR) : 0x7F;
- const int mb_size= 16>>s->avctx->lowres;
- s->last_resync_gb= s->gb;
- s->first_slice_line= 1;
-
- s->resync_mb_x= s->mb_x;
- s->resync_mb_y= s->mb_y;
-
- ff_set_qscale(s, s->qscale);
-
- if(s->partitioned_frame){
- const int qscale= s->qscale;
-
- if(s->codec_id==CODEC_ID_MPEG4){
- if(ff_mpeg4_decode_partitions(s) < 0)
- return -1;
- }
-
- /* restore variables which were modified */
- s->first_slice_line=1;
- s->mb_x= s->resync_mb_x;
- s->mb_y= s->resync_mb_y;
- ff_set_qscale(s, qscale);
- }
-
- for(; s->mb_y < s->mb_height; s->mb_y++) {
- /* per-row end of slice checks */
- if(s->msmpeg4_version){
- if(s->resync_mb_y + s->slice_height == s->mb_y){
- ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, AC_END|DC_END|MV_END);
-
- return 0;
- }
- }
-
- if(s->msmpeg4_version==1){
- s->last_dc[0]=
- s->last_dc[1]=
- s->last_dc[2]= 128;
- }
-
- ff_init_block_index(s);
- for(; s->mb_x < s->mb_width; s->mb_x++) {
- int ret;
-
- ff_update_block_index(s);
-
- if(s->resync_mb_x == s->mb_x && s->resync_mb_y+1 == s->mb_y){
- s->first_slice_line=0;
- }
-
- /* DCT & quantize */
-
- s->mv_dir = MV_DIR_FORWARD;
- s->mv_type = MV_TYPE_16X16;
-// s->mb_skipped = 0;
-//printf("%d %d %06X\n", ret, get_bits_count(&s->gb), show_bits(&s->gb, 24));
- ret= s->decode_mb(s, s->block);
-
- if (s->pict_type!=B_TYPE)
- ff_h263_update_motion_val(s);
-
- if(ret<0){
- const int xy= s->mb_x + s->mb_y*s->mb_stride;
- if(ret==SLICE_END){
- MPV_decode_mb(s, s->block);
- if(s->loop_filter)
- ff_h263_loop_filter(s);
-
-//printf("%d %d %d %06X\n", s->mb_x, s->mb_y, s->gb.size*8 - get_bits_count(&s->gb), show_bits(&s->gb, 24));
- ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, (AC_END|DC_END|MV_END)&part_mask);
-
- s->padding_bug_score--;
-
- if(++s->mb_x >= s->mb_width){
- s->mb_x=0;
- ff_draw_horiz_band(s, s->mb_y*mb_size, mb_size);
- s->mb_y++;
- }
- return 0;
- }else if(ret==SLICE_NOEND){
- av_log(s->avctx, AV_LOG_ERROR, "Slice mismatch at MB: %d\n", xy);
- ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x+1, s->mb_y, (AC_END|DC_END|MV_END)&part_mask);
- return -1;
- }
- av_log(s->avctx, AV_LOG_ERROR, "Error at MB: %d\n", xy);
- ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, (AC_ERROR|DC_ERROR|MV_ERROR)&part_mask);
-
- return -1;
- }
-
- MPV_decode_mb(s, s->block);
- if(s->loop_filter)
- ff_h263_loop_filter(s);
- }
-
- ff_draw_horiz_band(s, s->mb_y*mb_size, mb_size);
-
- s->mb_x= 0;
- }
-
- assert(s->mb_x==0 && s->mb_y==s->mb_height);
-
- /* try to detect the padding bug */
- if( s->codec_id==CODEC_ID_MPEG4
- && (s->workaround_bugs&FF_BUG_AUTODETECT)
- && s->gb.size_in_bits - get_bits_count(&s->gb) >=0
- && s->gb.size_in_bits - get_bits_count(&s->gb) < 48
-// && !s->resync_marker
- && !s->data_partitioning){
-
- const int bits_count= get_bits_count(&s->gb);
- const int bits_left = s->gb.size_in_bits - bits_count;
-
- if(bits_left==0){
- s->padding_bug_score+=16;
- } else if(bits_left != 1){
- int v= show_bits(&s->gb, 8);
- v|= 0x7F >> (7-(bits_count&7));
-
- if(v==0x7F && bits_left<=8)
- s->padding_bug_score--;
- else if(v==0x7F && ((get_bits_count(&s->gb)+8)&8) && bits_left<=16)
- s->padding_bug_score+= 4;
- else
- s->padding_bug_score++;
- }
- }
-
- if(s->workaround_bugs&FF_BUG_AUTODETECT){
- if(s->padding_bug_score > -2 && !s->data_partitioning /*&& (s->divx_version || !s->resync_marker)*/)
- s->workaround_bugs |= FF_BUG_NO_PADDING;
- else
- s->workaround_bugs &= ~FF_BUG_NO_PADDING;
- }
-
- // handle formats which don't have unique end markers
- if(s->msmpeg4_version || (s->workaround_bugs&FF_BUG_NO_PADDING)){ //FIXME perhaps solve this more cleanly
- int left= s->gb.size_in_bits - get_bits_count(&s->gb);
- int max_extra=7;
-
- /* no markers in M$ crap */
- if(s->msmpeg4_version && s->pict_type==I_TYPE)
- max_extra+= 17;
-
- /* buggy padding but the frame should still end approximately at the bitstream end */
- if((s->workaround_bugs&FF_BUG_NO_PADDING) && s->error_resilience>=3)
- max_extra+= 48;
- else if((s->workaround_bugs&FF_BUG_NO_PADDING))
- max_extra+= 256*256*256*64;
-
- if(left>max_extra){
- av_log(s->avctx, AV_LOG_ERROR, "discarding %d junk bits at end, next would be %X\n", left, show_bits(&s->gb, 24));
- }
- else if(left<0){
- av_log(s->avctx, AV_LOG_ERROR, "overreading %d bits\n", -left);
- }else
- ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, AC_END|DC_END|MV_END);
-
- return 0;
- }
-
- av_log(s->avctx, AV_LOG_ERROR, "slice end not reached but screenspace end (%d left %06X, score= %d)\n",
- s->gb.size_in_bits - get_bits_count(&s->gb),
- show_bits(&s->gb, 24), s->padding_bug_score);
-
- ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, (AC_END|DC_END|MV_END)&part_mask);
-
- return -1;
-}
-
-/**
- * finds the end of the current frame in the bitstream.
- * @return the position of the first byte of the next frame, or -1
- */
-int ff_mpeg4_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size){
- int vop_found, i;
- uint32_t state;
-
- vop_found= pc->frame_start_found;
- state= pc->state;
-
- i=0;
- if(!vop_found){
- for(i=0; i<buf_size; i++){
- state= (state<<8) | buf[i];
- if(state == 0x1B6){
- i++;
- vop_found=1;
- break;
- }
- }
- }
-
- if(vop_found){
- /* EOF considered as end of frame */
- if (buf_size == 0)
- return 0;
- for(; i<buf_size; i++){
- state= (state<<8) | buf[i];
- if((state&0xFFFFFF00) == 0x100){
- pc->frame_start_found=0;
- pc->state=-1;
- return i-3;
- }
- }
- }
- pc->frame_start_found= vop_found;
- pc->state= state;
- return END_NOT_FOUND;
-}
-
-static int h263_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size){
- int vop_found, i;
- uint32_t state;
-
- vop_found= pc->frame_start_found;
- state= pc->state;
-
- i=0;
- if(!vop_found){
- for(i=0; i<buf_size; i++){
- state= (state<<8) | buf[i];
- if(state>>(32-22) == 0x20){
- i++;
- vop_found=1;
- break;
- }
- }
- }
-
- if(vop_found){
- for(; i<buf_size; i++){
- state= (state<<8) | buf[i];
- if(state>>(32-22) == 0x20){
- pc->frame_start_found=0;
- pc->state=-1;
- return i-3;
- }
- }
- }
- pc->frame_start_found= vop_found;
- pc->state= state;
-
- return END_NOT_FOUND;
-}
-
-#ifdef CONFIG_H263_PARSER
-static int h263_parse(AVCodecParserContext *s,
- AVCodecContext *avctx,
- uint8_t **poutbuf, int *poutbuf_size,
- const uint8_t *buf, int buf_size)
-{
- ParseContext *pc = s->priv_data;
- int next;
-
- next= h263_find_frame_end(pc, buf, buf_size);
-
- if (ff_combine_frame(pc, next, (uint8_t **)&buf, &buf_size) < 0) {
- *poutbuf = NULL;
- *poutbuf_size = 0;
- return buf_size;
- }
-
- *poutbuf = (uint8_t *)buf;
- *poutbuf_size = buf_size;
- return next;
-}
-#endif
-
-int ff_h263_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- MpegEncContext *s = avctx->priv_data;
- int ret;
- AVFrame *pict = data;
-
-#ifdef PRINT_FRAME_TIME
-uint64_t time= rdtsc();
-#endif
-#ifdef DEBUG
- av_log(avctx, AV_LOG_DEBUG, "*****frame %d size=%d\n", avctx->frame_number, buf_size);
- av_log(avctx, AV_LOG_DEBUG, "bytes=%x %x %x %x\n", buf[0], buf[1], buf[2], buf[3]);
-#endif
- s->flags= avctx->flags;
- s->flags2= avctx->flags2;
-
- /* no supplementary picture */
- if (buf_size == 0) {
- /* special case for last picture */
- if (s->low_delay==0 && s->next_picture_ptr) {
- *pict= *(AVFrame*)s->next_picture_ptr;
- s->next_picture_ptr= NULL;
-
- *data_size = sizeof(AVFrame);
- }
-
- return 0;
- }
-
- if(s->flags&CODEC_FLAG_TRUNCATED){
- int next;
-
- if(s->codec_id==CODEC_ID_MPEG4){
- next= ff_mpeg4_find_frame_end(&s->parse_context, buf, buf_size);
- }else if(s->codec_id==CODEC_ID_H263){
- next= h263_find_frame_end(&s->parse_context, buf, buf_size);
- }else{
- av_log(s->avctx, AV_LOG_ERROR, "this codec does not support truncated bitstreams\n");
- return -1;
- }
-
- if( ff_combine_frame(&s->parse_context, next, &buf, &buf_size) < 0 )
- return buf_size;
- }
-
-
-retry:
-
- if(s->bitstream_buffer_size && (s->divx_packed || buf_size<20)){ //divx 5.01+/xvid frame reorder
- init_get_bits(&s->gb, s->bitstream_buffer, s->bitstream_buffer_size*8);
- }else
- init_get_bits(&s->gb, buf, buf_size*8);
- s->bitstream_buffer_size=0;
-
- if (!s->context_initialized) {
- if (MPV_common_init(s) < 0) //we need the idct permutaton for reading a custom matrix
- return -1;
- }
-
- //we need to set current_picture_ptr before reading the header, otherwise we cant store anyting im there
- if(s->current_picture_ptr==NULL || s->current_picture_ptr->data[0]){
- int i= ff_find_unused_picture(s, 0);
- s->current_picture_ptr= &s->picture[i];
- }
-
- /* let's go :-) */
- if (s->msmpeg4_version==5) {
- ret= ff_wmv2_decode_picture_header(s);
- } else if (s->msmpeg4_version) {
- ret = msmpeg4_decode_picture_header(s);
- } else if (s->h263_pred) {
- if(s->avctx->extradata_size && s->picture_number==0){
- GetBitContext gb;
-
- init_get_bits(&gb, s->avctx->extradata, s->avctx->extradata_size*8);
- ret = ff_mpeg4_decode_picture_header(s, &gb);
- }
- ret = ff_mpeg4_decode_picture_header(s, &s->gb);
-
- if(s->flags& CODEC_FLAG_LOW_DELAY)
- s->low_delay=1;
- } else if (s->codec_id == CODEC_ID_H263I) {
- ret = intel_h263_decode_picture_header(s);
- } else if (s->h263_flv) {
- ret = flv_h263_decode_picture_header(s);
- } else {
- ret = h263_decode_picture_header(s);
- }
-
- if(ret==FRAME_SKIPPED) return get_consumed_bytes(s, buf_size);
-
- /* skip if the header was thrashed */
- if (ret < 0){
- av_log(s->avctx, AV_LOG_ERROR, "header damaged\n");
- return -1;
- }
-
- avctx->has_b_frames= !s->low_delay;
-
- if(s->xvid_build==0 && s->divx_version==0 && s->lavc_build==0){
- if(s->stream_codec_tag == ff_get_fourcc("XVID") ||
- s->codec_tag == ff_get_fourcc("XVID") || s->codec_tag == ff_get_fourcc("XVIX") ||
- s->codec_tag == ff_get_fourcc("RMP4"))
- s->xvid_build= -1;
-#if 0
- if(s->codec_tag == ff_get_fourcc("DIVX") && s->vo_type==0 && s->vol_control_parameters==1
- && s->padding_bug_score > 0 && s->low_delay) // XVID with modified fourcc
- s->xvid_build= -1;
-#endif
- }
-
- if(s->xvid_build==0 && s->divx_version==0 && s->lavc_build==0){
- if(s->codec_tag == ff_get_fourcc("DIVX") && s->vo_type==0 && s->vol_control_parameters==0)
- s->divx_version= 400; //divx 4
- }
-
- if(s->xvid_build && s->divx_version){
- s->divx_version=
- s->divx_build= 0;
- }
-
- if(s->workaround_bugs&FF_BUG_AUTODETECT){
- if(s->codec_tag == ff_get_fourcc("XVIX"))
- s->workaround_bugs|= FF_BUG_XVID_ILACE;
-
- if(s->codec_tag == ff_get_fourcc("UMP4")){
- s->workaround_bugs|= FF_BUG_UMP4;
- }
-
- if(s->divx_version>=500){
- s->workaround_bugs|= FF_BUG_QPEL_CHROMA;
- }
-
- if(s->divx_version>502){
- s->workaround_bugs|= FF_BUG_QPEL_CHROMA2;
- }
-
- if(s->xvid_build && s->xvid_build<=3)
- s->padding_bug_score= 256*256*256*64;
-
- if(s->xvid_build && s->xvid_build<=1)
- s->workaround_bugs|= FF_BUG_QPEL_CHROMA;
-
- if(s->xvid_build && s->xvid_build<=12)
- s->workaround_bugs|= FF_BUG_EDGE;
-
- if(s->xvid_build && s->xvid_build<=32)
- s->workaround_bugs|= FF_BUG_DC_CLIP;
-
-#define SET_QPEL_FUNC(postfix1, postfix2) \
- s->dsp.put_ ## postfix1 = ff_put_ ## postfix2;\
- s->dsp.put_no_rnd_ ## postfix1 = ff_put_no_rnd_ ## postfix2;\
- s->dsp.avg_ ## postfix1 = ff_avg_ ## postfix2;
-
- if(s->lavc_build && s->lavc_build<4653)
- s->workaround_bugs|= FF_BUG_STD_QPEL;
-
- if(s->lavc_build && s->lavc_build<4655)
- s->workaround_bugs|= FF_BUG_DIRECT_BLOCKSIZE;
-
- if(s->lavc_build && s->lavc_build<4670){
- s->workaround_bugs|= FF_BUG_EDGE;
- }
-
- if(s->lavc_build && s->lavc_build<=4712)
- s->workaround_bugs|= FF_BUG_DC_CLIP;
-
- if(s->divx_version)
- s->workaround_bugs|= FF_BUG_DIRECT_BLOCKSIZE;
-//printf("padding_bug_score: %d\n", s->padding_bug_score);
- if(s->divx_version==501 && s->divx_build==20020416)
- s->padding_bug_score= 256*256*256*64;
-
- if(s->divx_version && s->divx_version<500){
- s->workaround_bugs|= FF_BUG_EDGE;
- }
-
- if(s->divx_version)
- s->workaround_bugs|= FF_BUG_HPEL_CHROMA;
-#if 0
- if(s->divx_version==500)
- s->padding_bug_score= 256*256*256*64;
-
- /* very ugly XVID padding bug detection FIXME/XXX solve this differently
- * lets hope this at least works
- */
- if( s->resync_marker==0 && s->data_partitioning==0 && s->divx_version==0
- && s->codec_id==CODEC_ID_MPEG4 && s->vo_type==0)
- s->workaround_bugs|= FF_BUG_NO_PADDING;
-
- if(s->lavc_build && s->lavc_build<4609) //FIXME not sure about the version num but a 4609 file seems ok
- s->workaround_bugs|= FF_BUG_NO_PADDING;
-#endif
- }
-
- if(s->workaround_bugs& FF_BUG_STD_QPEL){
- SET_QPEL_FUNC(qpel_pixels_tab[0][ 5], qpel16_mc11_old_c)
- SET_QPEL_FUNC(qpel_pixels_tab[0][ 7], qpel16_mc31_old_c)
- SET_QPEL_FUNC(qpel_pixels_tab[0][ 9], qpel16_mc12_old_c)
- SET_QPEL_FUNC(qpel_pixels_tab[0][11], qpel16_mc32_old_c)
- SET_QPEL_FUNC(qpel_pixels_tab[0][13], qpel16_mc13_old_c)
- SET_QPEL_FUNC(qpel_pixels_tab[0][15], qpel16_mc33_old_c)
-
- SET_QPEL_FUNC(qpel_pixels_tab[1][ 5], qpel8_mc11_old_c)
- SET_QPEL_FUNC(qpel_pixels_tab[1][ 7], qpel8_mc31_old_c)
- SET_QPEL_FUNC(qpel_pixels_tab[1][ 9], qpel8_mc12_old_c)
- SET_QPEL_FUNC(qpel_pixels_tab[1][11], qpel8_mc32_old_c)
- SET_QPEL_FUNC(qpel_pixels_tab[1][13], qpel8_mc13_old_c)
- SET_QPEL_FUNC(qpel_pixels_tab[1][15], qpel8_mc33_old_c)
- }
-
- if(avctx->debug & FF_DEBUG_BUGS)
- av_log(s->avctx, AV_LOG_DEBUG, "bugs: %X lavc_build:%d xvid_build:%d divx_version:%d divx_build:%d %s\n",
- s->workaround_bugs, s->lavc_build, s->xvid_build, s->divx_version, s->divx_build,
- s->divx_packed ? "p" : "");
-
-#if 0 // dump bits per frame / qp / complexity
-{
- static FILE *f=NULL;
- if(!f) f=fopen("rate_qp_cplx.txt", "w");
- fprintf(f, "%d %d %f\n", buf_size, s->qscale, buf_size*(double)s->qscale);
-}
-#endif
-
-#if defined(HAVE_MMX) && defined(CONFIG_GPL)
- if(s->codec_id == CODEC_ID_MPEG4 && s->xvid_build && avctx->idct_algo == FF_IDCT_AUTO && (mm_flags & MM_MMX)){
- avctx->idct_algo= FF_IDCT_XVIDMMX;
- avctx->coded_width= 0; // force reinit
-// dsputil_init(&s->dsp, avctx);
- s->picture_number=0;
- }
-#endif
-
- /* After H263 & mpeg4 header decode we have the height, width,*/
- /* and other parameters. So then we could init the picture */
- /* FIXME: By the way H263 decoder is evolving it should have */
- /* an H263EncContext */
-
- if ( s->width != avctx->coded_width
- || s->height != avctx->coded_height) {
- /* H.263 could change picture size any time */
- ParseContext pc= s->parse_context; //FIXME move these demuxng hack to avformat
- s->parse_context.buffer=0;
- MPV_common_end(s);
- s->parse_context= pc;
- }
- if (!s->context_initialized) {
- avcodec_set_dimensions(avctx, s->width, s->height);
-
- goto retry;
- }
-
- if((s->codec_id==CODEC_ID_H263 || s->codec_id==CODEC_ID_H263P))
- s->gob_index = ff_h263_get_gob_height(s);
-
- // for hurry_up==5
- s->current_picture.pict_type= s->pict_type;
- s->current_picture.key_frame= s->pict_type == I_TYPE;
-
- /* skip B-frames if we don't have reference frames */
- if(s->last_picture_ptr==NULL && (s->pict_type==B_TYPE || s->dropable)) return get_consumed_bytes(s, buf_size);
- /* skip b frames if we are in a hurry */
- if(avctx->hurry_up && s->pict_type==B_TYPE) return get_consumed_bytes(s, buf_size);
- if( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==B_TYPE)
- || (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=I_TYPE)
- || avctx->skip_frame >= AVDISCARD_ALL)
- return get_consumed_bytes(s, buf_size);
- /* skip everything if we are in a hurry>=5 */
- if(avctx->hurry_up>=5) return get_consumed_bytes(s, buf_size);
-
- if(s->next_p_frame_damaged){
- if(s->pict_type==B_TYPE)
- return get_consumed_bytes(s, buf_size);
- else
- s->next_p_frame_damaged=0;
- }
-
- if((s->avctx->flags2 & CODEC_FLAG2_FAST) && s->pict_type==B_TYPE){
- s->me.qpel_put= s->dsp.put_2tap_qpel_pixels_tab;
- s->me.qpel_avg= s->dsp.avg_2tap_qpel_pixels_tab;
- }else if((!s->no_rounding) || s->pict_type==B_TYPE){
- s->me.qpel_put= s->dsp.put_qpel_pixels_tab;
- s->me.qpel_avg= s->dsp.avg_qpel_pixels_tab;
- }else{
- s->me.qpel_put= s->dsp.put_no_rnd_qpel_pixels_tab;
- s->me.qpel_avg= s->dsp.avg_qpel_pixels_tab;
- }
-
- if(MPV_frame_start(s, avctx) < 0)
- return -1;
-
-#ifdef DEBUG
- av_log(avctx, AV_LOG_DEBUG, "qscale=%d\n", s->qscale);
-#endif
-
- ff_er_frame_start(s);
-
- //the second part of the wmv2 header contains the MB skip bits which are stored in current_picture->mb_type
- //which isnt available before MPV_frame_start()
- if (s->msmpeg4_version==5){
- if(ff_wmv2_decode_secondary_picture_header(s) < 0)
- return -1;
- }
-
- /* decode each macroblock */
- s->mb_x=0;
- s->mb_y=0;
-
- decode_slice(s);
- while(s->mb_y<s->mb_height){
- if(s->msmpeg4_version){
- if(s->slice_height==0 || s->mb_x!=0 || (s->mb_y%s->slice_height)!=0 || get_bits_count(&s->gb) > s->gb.size_in_bits)
- break;
- }else{
- if(ff_h263_resync(s)<0)
- break;
- }
-
- if(s->msmpeg4_version<4 && s->h263_pred)
- ff_mpeg4_clean_buffers(s);
-
- decode_slice(s);
- }
-
- if (s->h263_msmpeg4 && s->msmpeg4_version<4 && s->pict_type==I_TYPE)
- if(msmpeg4_decode_ext_header(s, buf_size) < 0){
- s->error_status_table[s->mb_num-1]= AC_ERROR|DC_ERROR|MV_ERROR;
- }
-
- /* divx 5.01+ bistream reorder stuff */
- if(s->codec_id==CODEC_ID_MPEG4 && s->bitstream_buffer_size==0 && s->divx_packed){
- int current_pos= get_bits_count(&s->gb)>>3;
- int startcode_found=0;
-
- if(buf_size - current_pos > 5){
- int i;
- for(i=current_pos; i<buf_size-3; i++){
- if(buf[i]==0 && buf[i+1]==0 && buf[i+2]==1 && buf[i+3]==0xB6){
- startcode_found=1;
- break;
- }
- }
- }
- if(s->gb.buffer == s->bitstream_buffer && buf_size>20){ //xvid style
- startcode_found=1;
- current_pos=0;
- }
-
- if(startcode_found){
- s->bitstream_buffer= av_fast_realloc(
- s->bitstream_buffer,
- &s->allocated_bitstream_buffer_size,
- buf_size - current_pos + FF_INPUT_BUFFER_PADDING_SIZE);
- memcpy(s->bitstream_buffer, buf + current_pos, buf_size - current_pos);
- s->bitstream_buffer_size= buf_size - current_pos;
- }
- }
-
- ff_er_frame_end(s);
-
- MPV_frame_end(s);
-
-assert(s->current_picture.pict_type == s->current_picture_ptr->pict_type);
-assert(s->current_picture.pict_type == s->pict_type);
- if (s->pict_type == B_TYPE || s->low_delay) {
- *pict= *(AVFrame*)s->current_picture_ptr;
- } else if (s->last_picture_ptr != NULL) {
- *pict= *(AVFrame*)s->last_picture_ptr;
- }
-
- if(s->last_picture_ptr || s->low_delay){
- *data_size = sizeof(AVFrame);
- ff_print_debug_info(s, pict);
- }
-
- /* Return the Picture timestamp as the frame number */
- /* we substract 1 because it is added on utils.c */
- avctx->frame_number = s->picture_number - 1;
-
-#ifdef PRINT_FRAME_TIME
-av_log(avctx, AV_LOG_DEBUG, "%"PRId64"\n", rdtsc()-time);
-#endif
-
- return get_consumed_bytes(s, buf_size);
-}
-
-AVCodec mpeg4_decoder = {
- "mpeg4",
- CODEC_TYPE_VIDEO,
- CODEC_ID_MPEG4,
- sizeof(MpegEncContext),
- ff_h263_decode_init,
- NULL,
- ff_h263_decode_end,
- ff_h263_decode_frame,
- CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY,
- .flush= ff_mpeg_flush,
-};
-
-AVCodec h263_decoder = {
- "h263",
- CODEC_TYPE_VIDEO,
- CODEC_ID_H263,
- sizeof(MpegEncContext),
- ff_h263_decode_init,
- NULL,
- ff_h263_decode_end,
- ff_h263_decode_frame,
- CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY,
- .flush= ff_mpeg_flush,
-};
-
-AVCodec msmpeg4v1_decoder = {
- "msmpeg4v1",
- CODEC_TYPE_VIDEO,
- CODEC_ID_MSMPEG4V1,
- sizeof(MpegEncContext),
- ff_h263_decode_init,
- NULL,
- ff_h263_decode_end,
- ff_h263_decode_frame,
- CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
-};
-
-AVCodec msmpeg4v2_decoder = {
- "msmpeg4v2",
- CODEC_TYPE_VIDEO,
- CODEC_ID_MSMPEG4V2,
- sizeof(MpegEncContext),
- ff_h263_decode_init,
- NULL,
- ff_h263_decode_end,
- ff_h263_decode_frame,
- CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
-};
-
-AVCodec msmpeg4v3_decoder = {
- "msmpeg4",
- CODEC_TYPE_VIDEO,
- CODEC_ID_MSMPEG4V3,
- sizeof(MpegEncContext),
- ff_h263_decode_init,
- NULL,
- ff_h263_decode_end,
- ff_h263_decode_frame,
- CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
-};
-
-AVCodec wmv1_decoder = {
- "wmv1",
- CODEC_TYPE_VIDEO,
- CODEC_ID_WMV1,
- sizeof(MpegEncContext),
- ff_h263_decode_init,
- NULL,
- ff_h263_decode_end,
- ff_h263_decode_frame,
- CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
-};
-
-AVCodec h263i_decoder = {
- "h263i",
- CODEC_TYPE_VIDEO,
- CODEC_ID_H263I,
- sizeof(MpegEncContext),
- ff_h263_decode_init,
- NULL,
- ff_h263_decode_end,
- ff_h263_decode_frame,
- CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
-};
-
-AVCodec flv_decoder = {
- "flv",
- CODEC_TYPE_VIDEO,
- CODEC_ID_FLV1,
- sizeof(MpegEncContext),
- ff_h263_decode_init,
- NULL,
- ff_h263_decode_end,
- ff_h263_decode_frame,
- CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1
-};
-
-#ifdef CONFIG_H263_PARSER
-AVCodecParser h263_parser = {
- { CODEC_ID_H263 },
- sizeof(ParseContext),
- NULL,
- h263_parse,
- ff_parse_close,
-};
-#endif
diff --git a/src/libffmpeg/libavcodec/h264.c b/src/libffmpeg/libavcodec/h264.c
deleted file mode 100644
index d696676f0..000000000
--- a/src/libffmpeg/libavcodec/h264.c
+++ /dev/null
@@ -1,8653 +0,0 @@
-/*
- * H.26L/H.264/AVC/JVT/14496-10/... encoder/decoder
- * Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file h264.c
- * H.264 / AVC / MPEG4 part10 codec.
- * @author Michael Niedermayer <michaelni@gmx.at>
- */
-
-#include "common.h"
-#include "dsputil.h"
-#include "avcodec.h"
-#include "mpegvideo.h"
-#include "h264data.h"
-#include "golomb.h"
-
-#include "cabac.h"
-
-//#undef NDEBUG
-#include <assert.h>
-
-#define interlaced_dct interlaced_dct_is_a_bad_name
-#define mb_intra mb_intra_isnt_initalized_see_mb_type
-
-#define LUMA_DC_BLOCK_INDEX 25
-#define CHROMA_DC_BLOCK_INDEX 26
-
-#define CHROMA_DC_COEFF_TOKEN_VLC_BITS 8
-#define COEFF_TOKEN_VLC_BITS 8
-#define TOTAL_ZEROS_VLC_BITS 9
-#define CHROMA_DC_TOTAL_ZEROS_VLC_BITS 3
-#define RUN_VLC_BITS 3
-#define RUN7_VLC_BITS 6
-
-#define MAX_SPS_COUNT 32
-#define MAX_PPS_COUNT 256
-
-#define MAX_MMCO_COUNT 66
-
-/* Compiling in interlaced support reduces the speed
- * of progressive decoding by about 2%. */
-#define ALLOW_INTERLACE
-
-#ifdef ALLOW_INTERLACE
-#define MB_MBAFF h->mb_mbaff
-#define MB_FIELD h->mb_field_decoding_flag
-#define FRAME_MBAFF h->mb_aff_frame
-#else
-#define MB_MBAFF 0
-#define MB_FIELD 0
-#define FRAME_MBAFF 0
-#undef IS_INTERLACED
-#define IS_INTERLACED(mb_type) 0
-#endif
-
-/**
- * Sequence parameter set
- */
-typedef struct SPS{
-
- int profile_idc;
- int level_idc;
- int transform_bypass; ///< qpprime_y_zero_transform_bypass_flag
- int log2_max_frame_num; ///< log2_max_frame_num_minus4 + 4
- int poc_type; ///< pic_order_cnt_type
- int log2_max_poc_lsb; ///< log2_max_pic_order_cnt_lsb_minus4
- int delta_pic_order_always_zero_flag;
- int offset_for_non_ref_pic;
- int offset_for_top_to_bottom_field;
- int poc_cycle_length; ///< num_ref_frames_in_pic_order_cnt_cycle
- int ref_frame_count; ///< num_ref_frames
- int gaps_in_frame_num_allowed_flag;
- int mb_width; ///< frame_width_in_mbs_minus1 + 1
- int mb_height; ///< frame_height_in_mbs_minus1 + 1
- int frame_mbs_only_flag;
- int mb_aff; ///<mb_adaptive_frame_field_flag
- int direct_8x8_inference_flag;
- int crop; ///< frame_cropping_flag
- int crop_left; ///< frame_cropping_rect_left_offset
- int crop_right; ///< frame_cropping_rect_right_offset
- int crop_top; ///< frame_cropping_rect_top_offset
- int crop_bottom; ///< frame_cropping_rect_bottom_offset
- int vui_parameters_present_flag;
- AVRational sar;
- int timing_info_present_flag;
- uint32_t num_units_in_tick;
- uint32_t time_scale;
- int fixed_frame_rate_flag;
- short offset_for_ref_frame[256]; //FIXME dyn aloc?
- int bitstream_restriction_flag;
- int num_reorder_frames;
- int scaling_matrix_present;
- uint8_t scaling_matrix4[6][16];
- uint8_t scaling_matrix8[2][64];
-}SPS;
-
-/**
- * Picture parameter set
- */
-typedef struct PPS{
- unsigned int sps_id;
- int cabac; ///< entropy_coding_mode_flag
- int pic_order_present; ///< pic_order_present_flag
- int slice_group_count; ///< num_slice_groups_minus1 + 1
- int mb_slice_group_map_type;
- unsigned int ref_count[2]; ///< num_ref_idx_l0/1_active_minus1 + 1
- int weighted_pred; ///< weighted_pred_flag
- int weighted_bipred_idc;
- int init_qp; ///< pic_init_qp_minus26 + 26
- int init_qs; ///< pic_init_qs_minus26 + 26
- int chroma_qp_index_offset;
- int deblocking_filter_parameters_present; ///< deblocking_filter_parameters_present_flag
- int constrained_intra_pred; ///< constrained_intra_pred_flag
- int redundant_pic_cnt_present; ///< redundant_pic_cnt_present_flag
- int transform_8x8_mode; ///< transform_8x8_mode_flag
- uint8_t scaling_matrix4[6][16];
- uint8_t scaling_matrix8[2][64];
-}PPS;
-
-/**
- * Memory management control operation opcode.
- */
-typedef enum MMCOOpcode{
- MMCO_END=0,
- MMCO_SHORT2UNUSED,
- MMCO_LONG2UNUSED,
- MMCO_SHORT2LONG,
- MMCO_SET_MAX_LONG,
- MMCO_RESET,
- MMCO_LONG,
-} MMCOOpcode;
-
-/**
- * Memory management control operation.
- */
-typedef struct MMCO{
- MMCOOpcode opcode;
- int short_frame_num;
- int long_index;
-} MMCO;
-
-/**
- * H264Context
- */
-typedef struct H264Context{
- MpegEncContext s;
- int nal_ref_idc;
- int nal_unit_type;
- uint8_t *rbsp_buffer;
- unsigned int rbsp_buffer_size;
-
- /**
- * Used to parse AVC variant of h264
- */
- int is_avc; ///< this flag is != 0 if codec is avc1
- int got_avcC; ///< flag used to parse avcC data only once
- int nal_length_size; ///< Number of bytes used for nal length (1, 2 or 4)
-
- int chroma_qp; //QPc
-
- int prev_mb_skipped;
- int next_mb_skipped;
-
- //prediction stuff
- int chroma_pred_mode;
- int intra16x16_pred_mode;
-
- int top_mb_xy;
- int left_mb_xy[2];
-
- int8_t intra4x4_pred_mode_cache[5*8];
- int8_t (*intra4x4_pred_mode)[8];
- void (*pred4x4 [9+3])(uint8_t *src, uint8_t *topright, int stride);//FIXME move to dsp?
- void (*pred8x8l [9+3])(uint8_t *src, int topleft, int topright, int stride);
- void (*pred8x8 [4+3])(uint8_t *src, int stride);
- void (*pred16x16[4+3])(uint8_t *src, int stride);
- unsigned int topleft_samples_available;
- unsigned int top_samples_available;
- unsigned int topright_samples_available;
- unsigned int left_samples_available;
- uint8_t (*top_borders[2])[16+2*8];
- uint8_t left_border[2*(17+2*9)];
-
- /**
- * non zero coeff count cache.
- * is 64 if not available.
- */
- DECLARE_ALIGNED_8(uint8_t, non_zero_count_cache[6*8]);
- uint8_t (*non_zero_count)[16];
-
- /**
- * Motion vector cache.
- */
- DECLARE_ALIGNED_8(int16_t, mv_cache[2][5*8][2]);
- DECLARE_ALIGNED_8(int8_t, ref_cache[2][5*8]);
-#define LIST_NOT_USED -1 //FIXME rename?
-#define PART_NOT_AVAILABLE -2
-
- /**
- * is 1 if the specific list MV&references are set to 0,0,-2.
- */
- int mv_cache_clean[2];
-
- /**
- * number of neighbors (top and/or left) that used 8x8 dct
- */
- int neighbor_transform_size;
-
- /**
- * block_offset[ 0..23] for frame macroblocks
- * block_offset[24..47] for field macroblocks
- */
- int block_offset[2*(16+8)];
-
- uint32_t *mb2b_xy; //FIXME are these 4 a good idea?
- uint32_t *mb2b8_xy;
- int b_stride; //FIXME use s->b4_stride
- int b8_stride;
-
- int mb_linesize; ///< may be equal to s->linesize or s->linesize*2, for mbaff
- int mb_uvlinesize;
-
- int emu_edge_width;
- int emu_edge_height;
-
- int halfpel_flag;
- int thirdpel_flag;
-
- int unknown_svq3_flag;
- int next_slice_index;
-
- SPS sps_buffer[MAX_SPS_COUNT];
- SPS sps; ///< current sps
-
- PPS pps_buffer[MAX_PPS_COUNT];
- /**
- * current pps
- */
- PPS pps; //FIXME move to Picture perhaps? (->no) do we need that?
-
- uint32_t dequant4_buffer[6][52][16];
- uint32_t dequant8_buffer[2][52][64];
- uint32_t (*dequant4_coeff[6])[16];
- uint32_t (*dequant8_coeff[2])[64];
- int dequant_coeff_pps; ///< reinit tables when pps changes
-
- int slice_num;
- uint8_t *slice_table_base;
- uint8_t *slice_table; ///< slice_table_base + 2*mb_stride + 1
- int slice_type;
- int slice_type_fixed;
-
- //interlacing specific flags
- int mb_aff_frame;
- int mb_field_decoding_flag;
- int mb_mbaff; ///< mb_aff_frame && mb_field_decoding_flag
-
- unsigned int sub_mb_type[4];
-
- //POC stuff
- int poc_lsb;
- int poc_msb;
- int delta_poc_bottom;
- int delta_poc[2];
- int frame_num;
- int prev_poc_msb; ///< poc_msb of the last reference pic for POC type 0
- int prev_poc_lsb; ///< poc_lsb of the last reference pic for POC type 0
- int frame_num_offset; ///< for POC type 2
- int prev_frame_num_offset; ///< for POC type 2
- int prev_frame_num; ///< frame_num of the last pic for POC type 1/2
-
- /**
- * frame_num for frames or 2*frame_num for field pics.
- */
- int curr_pic_num;
-
- /**
- * max_frame_num or 2*max_frame_num for field pics.
- */
- int max_pic_num;
-
- //Weighted pred stuff
- int use_weight;
- int use_weight_chroma;
- int luma_log2_weight_denom;
- int chroma_log2_weight_denom;
- int luma_weight[2][48];
- int luma_offset[2][48];
- int chroma_weight[2][48][2];
- int chroma_offset[2][48][2];
- int implicit_weight[48][48];
-
- //deblock
- int deblocking_filter; ///< disable_deblocking_filter_idc with 1<->0
- int slice_alpha_c0_offset;
- int slice_beta_offset;
-
- int redundant_pic_count;
-
- int direct_spatial_mv_pred;
- int dist_scale_factor[16];
- int dist_scale_factor_field[32];
- int map_col_to_list0[2][16];
- int map_col_to_list0_field[2][32];
-
- /**
- * num_ref_idx_l0/1_active_minus1 + 1
- */
- unsigned int ref_count[2]; ///< counts frames or fields, depending on current mb mode
- Picture *short_ref[32];
- Picture *long_ref[32];
- Picture default_ref_list[2][32];
- Picture ref_list[2][48]; ///< 0..15: frame refs, 16..47: mbaff field refs
- Picture *delayed_pic[18]; //FIXME size?
- Picture *delayed_output_pic;
-
- /**
- * memory management control operations buffer.
- */
- MMCO mmco[MAX_MMCO_COUNT];
- int mmco_index;
-
- int long_ref_count; ///< number of actual long term references
- int short_ref_count; ///< number of actual short term references
-
- //data partitioning
- GetBitContext intra_gb;
- GetBitContext inter_gb;
- GetBitContext *intra_gb_ptr;
- GetBitContext *inter_gb_ptr;
-
- DECLARE_ALIGNED_8(DCTELEM, mb[16*24]);
- DCTELEM mb_padding[256]; ///< as mb is addressed by scantable[i] and scantable is uint8_t we can either check that i is not to large or ensure that there is some unused stuff after mb
-
- /**
- * Cabac
- */
- CABACContext cabac;
- uint8_t cabac_state[460];
- int cabac_init_idc;
-
- /* 0x100 -> non null luma_dc, 0x80/0x40 -> non null chroma_dc (cb/cr), 0x?0 -> chroma_cbp(0,1,2), 0x0? luma_cbp */
- uint16_t *cbp_table;
- int cbp;
- int top_cbp;
- int left_cbp;
- /* chroma_pred_mode for i4x4 or i16x16, else 0 */
- uint8_t *chroma_pred_mode_table;
- int last_qscale_diff;
- int16_t (*mvd_table[2])[2];
- DECLARE_ALIGNED_8(int16_t, mvd_cache[2][5*8][2]);
- uint8_t *direct_table;
- uint8_t direct_cache[5*8];
-
- uint8_t zigzag_scan[16];
- uint8_t zigzag_scan8x8[64];
- uint8_t zigzag_scan8x8_cavlc[64];
- uint8_t field_scan[16];
- uint8_t field_scan8x8[64];
- uint8_t field_scan8x8_cavlc[64];
- const uint8_t *zigzag_scan_q0;
- const uint8_t *zigzag_scan8x8_q0;
- const uint8_t *zigzag_scan8x8_cavlc_q0;
- const uint8_t *field_scan_q0;
- const uint8_t *field_scan8x8_q0;
- const uint8_t *field_scan8x8_cavlc_q0;
-
- int x264_build;
-}H264Context;
-
-static VLC coeff_token_vlc[4];
-static VLC chroma_dc_coeff_token_vlc;
-
-static VLC total_zeros_vlc[15];
-static VLC chroma_dc_total_zeros_vlc[3];
-
-static VLC run_vlc[6];
-static VLC run7_vlc;
-
-static void svq3_luma_dc_dequant_idct_c(DCTELEM *block, int qp);
-static void svq3_add_idct_c(uint8_t *dst, DCTELEM *block, int stride, int qp, int dc);
-static void filter_mb( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize);
-static void filter_mb_fast( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize);
-
-static av_always_inline uint32_t pack16to32(int a, int b){
-#ifdef WORDS_BIGENDIAN
- return (b&0xFFFF) + (a<<16);
-#else
- return (a&0xFFFF) + (b<<16);
-#endif
-}
-
-const uint8_t ff_rem6[52]={
-0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3,
-};
-
-const uint8_t ff_div6[52]={
-0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8,
-};
-
-
-/**
- * fill a rectangle.
- * @param h height of the rectangle, should be a constant
- * @param w width of the rectangle, should be a constant
- * @param size the size of val (1 or 4), should be a constant
- */
-static av_always_inline void fill_rectangle(void *vp, int w, int h, int stride, uint32_t val, int size){
- uint8_t *p= (uint8_t*)vp;
- assert(size==1 || size==4);
- assert(w<=4);
-
- w *= size;
- stride *= size;
-
- assert((((long)vp)&(FFMIN(w, STRIDE_ALIGN)-1)) == 0);
- assert((stride&(w-1))==0);
- if(w==2){
- const uint16_t v= size==4 ? val : val*0x0101;
- *(uint16_t*)(p + 0*stride)= v;
- if(h==1) return;
- *(uint16_t*)(p + 1*stride)= v;
- if(h==2) return;
- *(uint16_t*)(p + 2*stride)=
- *(uint16_t*)(p + 3*stride)= v;
- }else if(w==4){
- const uint32_t v= size==4 ? val : val*0x01010101;
- *(uint32_t*)(p + 0*stride)= v;
- if(h==1) return;
- *(uint32_t*)(p + 1*stride)= v;
- if(h==2) return;
- *(uint32_t*)(p + 2*stride)=
- *(uint32_t*)(p + 3*stride)= v;
- }else if(w==8){
- //gcc can't optimize 64bit math on x86_32
-#if defined(ARCH_X86_64) || (defined(MP_WORDSIZE) && MP_WORDSIZE >= 64)
- const uint64_t v= val*0x0100000001ULL;
- *(uint64_t*)(p + 0*stride)= v;
- if(h==1) return;
- *(uint64_t*)(p + 1*stride)= v;
- if(h==2) return;
- *(uint64_t*)(p + 2*stride)=
- *(uint64_t*)(p + 3*stride)= v;
- }else if(w==16){
- const uint64_t v= val*0x0100000001ULL;
- *(uint64_t*)(p + 0+0*stride)=
- *(uint64_t*)(p + 8+0*stride)=
- *(uint64_t*)(p + 0+1*stride)=
- *(uint64_t*)(p + 8+1*stride)= v;
- if(h==2) return;
- *(uint64_t*)(p + 0+2*stride)=
- *(uint64_t*)(p + 8+2*stride)=
- *(uint64_t*)(p + 0+3*stride)=
- *(uint64_t*)(p + 8+3*stride)= v;
-#else
- *(uint32_t*)(p + 0+0*stride)=
- *(uint32_t*)(p + 4+0*stride)= val;
- if(h==1) return;
- *(uint32_t*)(p + 0+1*stride)=
- *(uint32_t*)(p + 4+1*stride)= val;
- if(h==2) return;
- *(uint32_t*)(p + 0+2*stride)=
- *(uint32_t*)(p + 4+2*stride)=
- *(uint32_t*)(p + 0+3*stride)=
- *(uint32_t*)(p + 4+3*stride)= val;
- }else if(w==16){
- *(uint32_t*)(p + 0+0*stride)=
- *(uint32_t*)(p + 4+0*stride)=
- *(uint32_t*)(p + 8+0*stride)=
- *(uint32_t*)(p +12+0*stride)=
- *(uint32_t*)(p + 0+1*stride)=
- *(uint32_t*)(p + 4+1*stride)=
- *(uint32_t*)(p + 8+1*stride)=
- *(uint32_t*)(p +12+1*stride)= val;
- if(h==2) return;
- *(uint32_t*)(p + 0+2*stride)=
- *(uint32_t*)(p + 4+2*stride)=
- *(uint32_t*)(p + 8+2*stride)=
- *(uint32_t*)(p +12+2*stride)=
- *(uint32_t*)(p + 0+3*stride)=
- *(uint32_t*)(p + 4+3*stride)=
- *(uint32_t*)(p + 8+3*stride)=
- *(uint32_t*)(p +12+3*stride)= val;
-#endif
- }else
- assert(0);
- assert(h==4);
-}
-
-static void fill_caches(H264Context *h, int mb_type, int for_deblock){
- MpegEncContext * const s = &h->s;
- const int mb_xy= s->mb_x + s->mb_y*s->mb_stride;
- int topleft_xy, top_xy, topright_xy, left_xy[2];
- int topleft_type, top_type, topright_type, left_type[2];
- int left_block[8];
- int i;
-
- //FIXME deblocking could skip the intra and nnz parts.
- if(for_deblock && (h->slice_num == 1 || h->slice_table[mb_xy] == h->slice_table[mb_xy-s->mb_stride]) && !FRAME_MBAFF)
- return;
-
- //wow what a mess, why didn't they simplify the interlacing&intra stuff, i can't imagine that these complex rules are worth it
-
- top_xy = mb_xy - s->mb_stride;
- topleft_xy = top_xy - 1;
- topright_xy= top_xy + 1;
- left_xy[1] = left_xy[0] = mb_xy-1;
- left_block[0]= 0;
- left_block[1]= 1;
- left_block[2]= 2;
- left_block[3]= 3;
- left_block[4]= 7;
- left_block[5]= 10;
- left_block[6]= 8;
- left_block[7]= 11;
- if(FRAME_MBAFF){
- const int pair_xy = s->mb_x + (s->mb_y & ~1)*s->mb_stride;
- const int top_pair_xy = pair_xy - s->mb_stride;
- const int topleft_pair_xy = top_pair_xy - 1;
- const int topright_pair_xy = top_pair_xy + 1;
- const int topleft_mb_frame_flag = !IS_INTERLACED(s->current_picture.mb_type[topleft_pair_xy]);
- const int top_mb_frame_flag = !IS_INTERLACED(s->current_picture.mb_type[top_pair_xy]);
- const int topright_mb_frame_flag = !IS_INTERLACED(s->current_picture.mb_type[topright_pair_xy]);
- const int left_mb_frame_flag = !IS_INTERLACED(s->current_picture.mb_type[pair_xy-1]);
- const int curr_mb_frame_flag = !IS_INTERLACED(mb_type);
- const int bottom = (s->mb_y & 1);
- tprintf("fill_caches: curr_mb_frame_flag:%d, left_mb_frame_flag:%d, topleft_mb_frame_flag:%d, top_mb_frame_flag:%d, topright_mb_frame_flag:%d\n", curr_mb_frame_flag, left_mb_frame_flag, topleft_mb_frame_flag, top_mb_frame_flag, topright_mb_frame_flag);
- if (bottom
- ? !curr_mb_frame_flag // bottom macroblock
- : (!curr_mb_frame_flag && !top_mb_frame_flag) // top macroblock
- ) {
- top_xy -= s->mb_stride;
- }
- if (bottom
- ? !curr_mb_frame_flag // bottom macroblock
- : (!curr_mb_frame_flag && !topleft_mb_frame_flag) // top macroblock
- ) {
- topleft_xy -= s->mb_stride;
- }
- if (bottom
- ? !curr_mb_frame_flag // bottom macroblock
- : (!curr_mb_frame_flag && !topright_mb_frame_flag) // top macroblock
- ) {
- topright_xy -= s->mb_stride;
- }
- if (left_mb_frame_flag != curr_mb_frame_flag) {
- left_xy[1] = left_xy[0] = pair_xy - 1;
- if (curr_mb_frame_flag) {
- if (bottom) {
- left_block[0]= 2;
- left_block[1]= 2;
- left_block[2]= 3;
- left_block[3]= 3;
- left_block[4]= 8;
- left_block[5]= 11;
- left_block[6]= 8;
- left_block[7]= 11;
- } else {
- left_block[0]= 0;
- left_block[1]= 0;
- left_block[2]= 1;
- left_block[3]= 1;
- left_block[4]= 7;
- left_block[5]= 10;
- left_block[6]= 7;
- left_block[7]= 10;
- }
- } else {
- left_xy[1] += s->mb_stride;
- //left_block[0]= 0;
- left_block[1]= 2;
- left_block[2]= 0;
- left_block[3]= 2;
- //left_block[4]= 7;
- left_block[5]= 10;
- left_block[6]= 7;
- left_block[7]= 10;
- }
- }
- }
-
- h->top_mb_xy = top_xy;
- h->left_mb_xy[0] = left_xy[0];
- h->left_mb_xy[1] = left_xy[1];
- if(for_deblock){
- topleft_type = 0;
- topright_type = 0;
- top_type = h->slice_table[top_xy ] < 255 ? s->current_picture.mb_type[top_xy] : 0;
- left_type[0] = h->slice_table[left_xy[0] ] < 255 ? s->current_picture.mb_type[left_xy[0]] : 0;
- left_type[1] = h->slice_table[left_xy[1] ] < 255 ? s->current_picture.mb_type[left_xy[1]] : 0;
-
- if(FRAME_MBAFF && !IS_INTRA(mb_type)){
- int list;
- int v = *(uint16_t*)&h->non_zero_count[mb_xy][14];
- for(i=0; i<16; i++)
- h->non_zero_count_cache[scan8[i]] = (v>>i)&1;
- for(list=0; list<1+(h->slice_type==B_TYPE); list++){
- if(USES_LIST(mb_type,list)){
- uint32_t *src = (uint32_t*)s->current_picture.motion_val[list][h->mb2b_xy[mb_xy]];
- uint32_t *dst = (uint32_t*)h->mv_cache[list][scan8[0]];
- int8_t *ref = &s->current_picture.ref_index[list][h->mb2b8_xy[mb_xy]];
- for(i=0; i<4; i++, dst+=8, src+=h->b_stride){
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = src[2];
- dst[3] = src[3];
- }
- *(uint32_t*)&h->ref_cache[list][scan8[ 0]] =
- *(uint32_t*)&h->ref_cache[list][scan8[ 2]] = pack16to32(ref[0],ref[1])*0x0101;
- ref += h->b8_stride;
- *(uint32_t*)&h->ref_cache[list][scan8[ 8]] =
- *(uint32_t*)&h->ref_cache[list][scan8[10]] = pack16to32(ref[0],ref[1])*0x0101;
- }else{
- fill_rectangle(&h-> mv_cache[list][scan8[ 0]], 4, 4, 8, 0, 4);
- fill_rectangle(&h->ref_cache[list][scan8[ 0]], 4, 4, 8, (uint8_t)LIST_NOT_USED, 1);
- }
- }
- }
- }else{
- topleft_type = h->slice_table[topleft_xy ] == h->slice_num ? s->current_picture.mb_type[topleft_xy] : 0;
- top_type = h->slice_table[top_xy ] == h->slice_num ? s->current_picture.mb_type[top_xy] : 0;
- topright_type= h->slice_table[topright_xy] == h->slice_num ? s->current_picture.mb_type[topright_xy]: 0;
- left_type[0] = h->slice_table[left_xy[0] ] == h->slice_num ? s->current_picture.mb_type[left_xy[0]] : 0;
- left_type[1] = h->slice_table[left_xy[1] ] == h->slice_num ? s->current_picture.mb_type[left_xy[1]] : 0;
- }
-
- if(IS_INTRA(mb_type)){
- h->topleft_samples_available=
- h->top_samples_available=
- h->left_samples_available= 0xFFFF;
- h->topright_samples_available= 0xEEEA;
-
- if(!IS_INTRA(top_type) && (top_type==0 || h->pps.constrained_intra_pred)){
- h->topleft_samples_available= 0xB3FF;
- h->top_samples_available= 0x33FF;
- h->topright_samples_available= 0x26EA;
- }
- for(i=0; i<2; i++){
- if(!IS_INTRA(left_type[i]) && (left_type[i]==0 || h->pps.constrained_intra_pred)){
- h->topleft_samples_available&= 0xDF5F;
- h->left_samples_available&= 0x5F5F;
- }
- }
-
- if(!IS_INTRA(topleft_type) && (topleft_type==0 || h->pps.constrained_intra_pred))
- h->topleft_samples_available&= 0x7FFF;
-
- if(!IS_INTRA(topright_type) && (topright_type==0 || h->pps.constrained_intra_pred))
- h->topright_samples_available&= 0xFBFF;
-
- if(IS_INTRA4x4(mb_type)){
- if(IS_INTRA4x4(top_type)){
- h->intra4x4_pred_mode_cache[4+8*0]= h->intra4x4_pred_mode[top_xy][4];
- h->intra4x4_pred_mode_cache[5+8*0]= h->intra4x4_pred_mode[top_xy][5];
- h->intra4x4_pred_mode_cache[6+8*0]= h->intra4x4_pred_mode[top_xy][6];
- h->intra4x4_pred_mode_cache[7+8*0]= h->intra4x4_pred_mode[top_xy][3];
- }else{
- int pred;
- if(!top_type || (IS_INTER(top_type) && h->pps.constrained_intra_pred))
- pred= -1;
- else{
- pred= 2;
- }
- h->intra4x4_pred_mode_cache[4+8*0]=
- h->intra4x4_pred_mode_cache[5+8*0]=
- h->intra4x4_pred_mode_cache[6+8*0]=
- h->intra4x4_pred_mode_cache[7+8*0]= pred;
- }
- for(i=0; i<2; i++){
- if(IS_INTRA4x4(left_type[i])){
- h->intra4x4_pred_mode_cache[3+8*1 + 2*8*i]= h->intra4x4_pred_mode[left_xy[i]][left_block[0+2*i]];
- h->intra4x4_pred_mode_cache[3+8*2 + 2*8*i]= h->intra4x4_pred_mode[left_xy[i]][left_block[1+2*i]];
- }else{
- int pred;
- if(!left_type[i] || (IS_INTER(left_type[i]) && h->pps.constrained_intra_pred))
- pred= -1;
- else{
- pred= 2;
- }
- h->intra4x4_pred_mode_cache[3+8*1 + 2*8*i]=
- h->intra4x4_pred_mode_cache[3+8*2 + 2*8*i]= pred;
- }
- }
- }
- }
-
-
-/*
-0 . T T. T T T T
-1 L . .L . . . .
-2 L . .L . . . .
-3 . T TL . . . .
-4 L . .L . . . .
-5 L . .. . . . .
-*/
-//FIXME constraint_intra_pred & partitioning & nnz (lets hope this is just a typo in the spec)
- if(top_type){
- h->non_zero_count_cache[4+8*0]= h->non_zero_count[top_xy][4];
- h->non_zero_count_cache[5+8*0]= h->non_zero_count[top_xy][5];
- h->non_zero_count_cache[6+8*0]= h->non_zero_count[top_xy][6];
- h->non_zero_count_cache[7+8*0]= h->non_zero_count[top_xy][3];
-
- h->non_zero_count_cache[1+8*0]= h->non_zero_count[top_xy][9];
- h->non_zero_count_cache[2+8*0]= h->non_zero_count[top_xy][8];
-
- h->non_zero_count_cache[1+8*3]= h->non_zero_count[top_xy][12];
- h->non_zero_count_cache[2+8*3]= h->non_zero_count[top_xy][11];
-
- }else{
- h->non_zero_count_cache[4+8*0]=
- h->non_zero_count_cache[5+8*0]=
- h->non_zero_count_cache[6+8*0]=
- h->non_zero_count_cache[7+8*0]=
-
- h->non_zero_count_cache[1+8*0]=
- h->non_zero_count_cache[2+8*0]=
-
- h->non_zero_count_cache[1+8*3]=
- h->non_zero_count_cache[2+8*3]= h->pps.cabac && !IS_INTRA(mb_type) ? 0 : 64;
-
- }
-
- for (i=0; i<2; i++) {
- if(left_type[i]){
- h->non_zero_count_cache[3+8*1 + 2*8*i]= h->non_zero_count[left_xy[i]][left_block[0+2*i]];
- h->non_zero_count_cache[3+8*2 + 2*8*i]= h->non_zero_count[left_xy[i]][left_block[1+2*i]];
- h->non_zero_count_cache[0+8*1 + 8*i]= h->non_zero_count[left_xy[i]][left_block[4+2*i]];
- h->non_zero_count_cache[0+8*4 + 8*i]= h->non_zero_count[left_xy[i]][left_block[5+2*i]];
- }else{
- h->non_zero_count_cache[3+8*1 + 2*8*i]=
- h->non_zero_count_cache[3+8*2 + 2*8*i]=
- h->non_zero_count_cache[0+8*1 + 8*i]=
- h->non_zero_count_cache[0+8*4 + 8*i]= h->pps.cabac && !IS_INTRA(mb_type) ? 0 : 64;
- }
- }
-
- if( h->pps.cabac ) {
- // top_cbp
- if(top_type) {
- h->top_cbp = h->cbp_table[top_xy];
- } else if(IS_INTRA(mb_type)) {
- h->top_cbp = 0x1C0;
- } else {
- h->top_cbp = 0;
- }
- // left_cbp
- if (left_type[0]) {
- h->left_cbp = h->cbp_table[left_xy[0]] & 0x1f0;
- } else if(IS_INTRA(mb_type)) {
- h->left_cbp = 0x1C0;
- } else {
- h->left_cbp = 0;
- }
- if (left_type[0]) {
- h->left_cbp |= ((h->cbp_table[left_xy[0]]>>((left_block[0]&(~1))+1))&0x1) << 1;
- }
- if (left_type[1]) {
- h->left_cbp |= ((h->cbp_table[left_xy[1]]>>((left_block[2]&(~1))+1))&0x1) << 3;
- }
- }
-
-#if 1
- if(IS_INTER(mb_type) || IS_DIRECT(mb_type)){
- int list;
- for(list=0; list<1+(h->slice_type==B_TYPE); list++){
- if(!USES_LIST(mb_type, list) && !IS_DIRECT(mb_type) && !h->deblocking_filter){
- /*if(!h->mv_cache_clean[list]){
- memset(h->mv_cache [list], 0, 8*5*2*sizeof(int16_t)); //FIXME clean only input? clean at all?
- memset(h->ref_cache[list], PART_NOT_AVAILABLE, 8*5*sizeof(int8_t));
- h->mv_cache_clean[list]= 1;
- }*/
- continue;
- }
- h->mv_cache_clean[list]= 0;
-
- if(USES_LIST(top_type, list)){
- const int b_xy= h->mb2b_xy[top_xy] + 3*h->b_stride;
- const int b8_xy= h->mb2b8_xy[top_xy] + h->b8_stride;
- *(uint32_t*)h->mv_cache[list][scan8[0] + 0 - 1*8]= *(uint32_t*)s->current_picture.motion_val[list][b_xy + 0];
- *(uint32_t*)h->mv_cache[list][scan8[0] + 1 - 1*8]= *(uint32_t*)s->current_picture.motion_val[list][b_xy + 1];
- *(uint32_t*)h->mv_cache[list][scan8[0] + 2 - 1*8]= *(uint32_t*)s->current_picture.motion_val[list][b_xy + 2];
- *(uint32_t*)h->mv_cache[list][scan8[0] + 3 - 1*8]= *(uint32_t*)s->current_picture.motion_val[list][b_xy + 3];
- h->ref_cache[list][scan8[0] + 0 - 1*8]=
- h->ref_cache[list][scan8[0] + 1 - 1*8]= s->current_picture.ref_index[list][b8_xy + 0];
- h->ref_cache[list][scan8[0] + 2 - 1*8]=
- h->ref_cache[list][scan8[0] + 3 - 1*8]= s->current_picture.ref_index[list][b8_xy + 1];
- }else{
- *(uint32_t*)h->mv_cache [list][scan8[0] + 0 - 1*8]=
- *(uint32_t*)h->mv_cache [list][scan8[0] + 1 - 1*8]=
- *(uint32_t*)h->mv_cache [list][scan8[0] + 2 - 1*8]=
- *(uint32_t*)h->mv_cache [list][scan8[0] + 3 - 1*8]= 0;
- *(uint32_t*)&h->ref_cache[list][scan8[0] + 0 - 1*8]= ((top_type ? LIST_NOT_USED : PART_NOT_AVAILABLE)&0xFF)*0x01010101;
- }
-
- //FIXME unify cleanup or sth
- if(USES_LIST(left_type[0], list)){
- const int b_xy= h->mb2b_xy[left_xy[0]] + 3;
- const int b8_xy= h->mb2b8_xy[left_xy[0]] + 1;
- *(uint32_t*)h->mv_cache[list][scan8[0] - 1 + 0*8]= *(uint32_t*)s->current_picture.motion_val[list][b_xy + h->b_stride*left_block[0]];
- *(uint32_t*)h->mv_cache[list][scan8[0] - 1 + 1*8]= *(uint32_t*)s->current_picture.motion_val[list][b_xy + h->b_stride*left_block[1]];
- h->ref_cache[list][scan8[0] - 1 + 0*8]= s->current_picture.ref_index[list][b8_xy + h->b8_stride*(left_block[0]>>1)];
- h->ref_cache[list][scan8[0] - 1 + 1*8]= s->current_picture.ref_index[list][b8_xy + h->b8_stride*(left_block[1]>>1)];
- }else{
- *(uint32_t*)h->mv_cache [list][scan8[0] - 1 + 0*8]=
- *(uint32_t*)h->mv_cache [list][scan8[0] - 1 + 1*8]= 0;
- h->ref_cache[list][scan8[0] - 1 + 0*8]=
- h->ref_cache[list][scan8[0] - 1 + 1*8]= left_type[0] ? LIST_NOT_USED : PART_NOT_AVAILABLE;
- }
-
- if(USES_LIST(left_type[1], list)){
- const int b_xy= h->mb2b_xy[left_xy[1]] + 3;
- const int b8_xy= h->mb2b8_xy[left_xy[1]] + 1;
- *(uint32_t*)h->mv_cache[list][scan8[0] - 1 + 2*8]= *(uint32_t*)s->current_picture.motion_val[list][b_xy + h->b_stride*left_block[2]];
- *(uint32_t*)h->mv_cache[list][scan8[0] - 1 + 3*8]= *(uint32_t*)s->current_picture.motion_val[list][b_xy + h->b_stride*left_block[3]];
- h->ref_cache[list][scan8[0] - 1 + 2*8]= s->current_picture.ref_index[list][b8_xy + h->b8_stride*(left_block[2]>>1)];
- h->ref_cache[list][scan8[0] - 1 + 3*8]= s->current_picture.ref_index[list][b8_xy + h->b8_stride*(left_block[3]>>1)];
- }else{
- *(uint32_t*)h->mv_cache [list][scan8[0] - 1 + 2*8]=
- *(uint32_t*)h->mv_cache [list][scan8[0] - 1 + 3*8]= 0;
- h->ref_cache[list][scan8[0] - 1 + 2*8]=
- h->ref_cache[list][scan8[0] - 1 + 3*8]= left_type[0] ? LIST_NOT_USED : PART_NOT_AVAILABLE;
- assert((!left_type[0]) == (!left_type[1]));
- }
-
- if((for_deblock || (IS_DIRECT(mb_type) && !h->direct_spatial_mv_pred)) && !FRAME_MBAFF)
- continue;
-
- if(USES_LIST(topleft_type, list)){
- const int b_xy = h->mb2b_xy[topleft_xy] + 3 + 3*h->b_stride;
- const int b8_xy= h->mb2b8_xy[topleft_xy] + 1 + h->b8_stride;
- *(uint32_t*)h->mv_cache[list][scan8[0] - 1 - 1*8]= *(uint32_t*)s->current_picture.motion_val[list][b_xy];
- h->ref_cache[list][scan8[0] - 1 - 1*8]= s->current_picture.ref_index[list][b8_xy];
- }else{
- *(uint32_t*)h->mv_cache[list][scan8[0] - 1 - 1*8]= 0;
- h->ref_cache[list][scan8[0] - 1 - 1*8]= topleft_type ? LIST_NOT_USED : PART_NOT_AVAILABLE;
- }
-
- if(USES_LIST(topright_type, list)){
- const int b_xy= h->mb2b_xy[topright_xy] + 3*h->b_stride;
- const int b8_xy= h->mb2b8_xy[topright_xy] + h->b8_stride;
- *(uint32_t*)h->mv_cache[list][scan8[0] + 4 - 1*8]= *(uint32_t*)s->current_picture.motion_val[list][b_xy];
- h->ref_cache[list][scan8[0] + 4 - 1*8]= s->current_picture.ref_index[list][b8_xy];
- }else{
- *(uint32_t*)h->mv_cache [list][scan8[0] + 4 - 1*8]= 0;
- h->ref_cache[list][scan8[0] + 4 - 1*8]= topright_type ? LIST_NOT_USED : PART_NOT_AVAILABLE;
- }
-
- if((IS_SKIP(mb_type) || IS_DIRECT(mb_type)) && !FRAME_MBAFF)
- continue;
-
- h->ref_cache[list][scan8[5 ]+1] =
- h->ref_cache[list][scan8[7 ]+1] =
- h->ref_cache[list][scan8[13]+1] = //FIXME remove past 3 (init somewhere else)
- h->ref_cache[list][scan8[4 ]] =
- h->ref_cache[list][scan8[12]] = PART_NOT_AVAILABLE;
- *(uint32_t*)h->mv_cache [list][scan8[5 ]+1]=
- *(uint32_t*)h->mv_cache [list][scan8[7 ]+1]=
- *(uint32_t*)h->mv_cache [list][scan8[13]+1]= //FIXME remove past 3 (init somewhere else)
- *(uint32_t*)h->mv_cache [list][scan8[4 ]]=
- *(uint32_t*)h->mv_cache [list][scan8[12]]= 0;
-
- if( h->pps.cabac ) {
- /* XXX beurk, Load mvd */
- if(USES_LIST(top_type, list)){
- const int b_xy= h->mb2b_xy[top_xy] + 3*h->b_stride;
- *(uint32_t*)h->mvd_cache[list][scan8[0] + 0 - 1*8]= *(uint32_t*)h->mvd_table[list][b_xy + 0];
- *(uint32_t*)h->mvd_cache[list][scan8[0] + 1 - 1*8]= *(uint32_t*)h->mvd_table[list][b_xy + 1];
- *(uint32_t*)h->mvd_cache[list][scan8[0] + 2 - 1*8]= *(uint32_t*)h->mvd_table[list][b_xy + 2];
- *(uint32_t*)h->mvd_cache[list][scan8[0] + 3 - 1*8]= *(uint32_t*)h->mvd_table[list][b_xy + 3];
- }else{
- *(uint32_t*)h->mvd_cache [list][scan8[0] + 0 - 1*8]=
- *(uint32_t*)h->mvd_cache [list][scan8[0] + 1 - 1*8]=
- *(uint32_t*)h->mvd_cache [list][scan8[0] + 2 - 1*8]=
- *(uint32_t*)h->mvd_cache [list][scan8[0] + 3 - 1*8]= 0;
- }
- if(USES_LIST(left_type[0], list)){
- const int b_xy= h->mb2b_xy[left_xy[0]] + 3;
- *(uint32_t*)h->mvd_cache[list][scan8[0] - 1 + 0*8]= *(uint32_t*)h->mvd_table[list][b_xy + h->b_stride*left_block[0]];
- *(uint32_t*)h->mvd_cache[list][scan8[0] - 1 + 1*8]= *(uint32_t*)h->mvd_table[list][b_xy + h->b_stride*left_block[1]];
- }else{
- *(uint32_t*)h->mvd_cache [list][scan8[0] - 1 + 0*8]=
- *(uint32_t*)h->mvd_cache [list][scan8[0] - 1 + 1*8]= 0;
- }
- if(USES_LIST(left_type[1], list)){
- const int b_xy= h->mb2b_xy[left_xy[1]] + 3;
- *(uint32_t*)h->mvd_cache[list][scan8[0] - 1 + 2*8]= *(uint32_t*)h->mvd_table[list][b_xy + h->b_stride*left_block[2]];
- *(uint32_t*)h->mvd_cache[list][scan8[0] - 1 + 3*8]= *(uint32_t*)h->mvd_table[list][b_xy + h->b_stride*left_block[3]];
- }else{
- *(uint32_t*)h->mvd_cache [list][scan8[0] - 1 + 2*8]=
- *(uint32_t*)h->mvd_cache [list][scan8[0] - 1 + 3*8]= 0;
- }
- *(uint32_t*)h->mvd_cache [list][scan8[5 ]+1]=
- *(uint32_t*)h->mvd_cache [list][scan8[7 ]+1]=
- *(uint32_t*)h->mvd_cache [list][scan8[13]+1]= //FIXME remove past 3 (init somewhere else)
- *(uint32_t*)h->mvd_cache [list][scan8[4 ]]=
- *(uint32_t*)h->mvd_cache [list][scan8[12]]= 0;
-
- if(h->slice_type == B_TYPE){
- fill_rectangle(&h->direct_cache[scan8[0]], 4, 4, 8, 0, 1);
-
- if(IS_DIRECT(top_type)){
- *(uint32_t*)&h->direct_cache[scan8[0] - 1*8]= 0x01010101;
- }else if(IS_8X8(top_type)){
- int b8_xy = h->mb2b8_xy[top_xy] + h->b8_stride;
- h->direct_cache[scan8[0] + 0 - 1*8]= h->direct_table[b8_xy];
- h->direct_cache[scan8[0] + 2 - 1*8]= h->direct_table[b8_xy + 1];
- }else{
- *(uint32_t*)&h->direct_cache[scan8[0] - 1*8]= 0;
- }
-
- if(IS_DIRECT(left_type[0]))
- h->direct_cache[scan8[0] - 1 + 0*8]= 1;
- else if(IS_8X8(left_type[0]))
- h->direct_cache[scan8[0] - 1 + 0*8]= h->direct_table[h->mb2b8_xy[left_xy[0]] + 1 + h->b8_stride*(left_block[0]>>1)];
- else
- h->direct_cache[scan8[0] - 1 + 0*8]= 0;
-
- if(IS_DIRECT(left_type[1]))
- h->direct_cache[scan8[0] - 1 + 2*8]= 1;
- else if(IS_8X8(left_type[1]))
- h->direct_cache[scan8[0] - 1 + 2*8]= h->direct_table[h->mb2b8_xy[left_xy[1]] + 1 + h->b8_stride*(left_block[2]>>1)];
- else
- h->direct_cache[scan8[0] - 1 + 2*8]= 0;
- }
- }
-
- if(FRAME_MBAFF){
-#define MAP_MVS\
- MAP_F2F(scan8[0] - 1 - 1*8, topleft_type)\
- MAP_F2F(scan8[0] + 0 - 1*8, top_type)\
- MAP_F2F(scan8[0] + 1 - 1*8, top_type)\
- MAP_F2F(scan8[0] + 2 - 1*8, top_type)\
- MAP_F2F(scan8[0] + 3 - 1*8, top_type)\
- MAP_F2F(scan8[0] + 4 - 1*8, topright_type)\
- MAP_F2F(scan8[0] - 1 + 0*8, left_type[0])\
- MAP_F2F(scan8[0] - 1 + 1*8, left_type[0])\
- MAP_F2F(scan8[0] - 1 + 2*8, left_type[1])\
- MAP_F2F(scan8[0] - 1 + 3*8, left_type[1])
- if(MB_FIELD){
-#define MAP_F2F(idx, mb_type)\
- if(!IS_INTERLACED(mb_type) && h->ref_cache[list][idx] >= 0){\
- h->ref_cache[list][idx] <<= 1;\
- h->mv_cache[list][idx][1] /= 2;\
- h->mvd_cache[list][idx][1] /= 2;\
- }
- MAP_MVS
-#undef MAP_F2F
- }else{
-#define MAP_F2F(idx, mb_type)\
- if(IS_INTERLACED(mb_type) && h->ref_cache[list][idx] >= 0){\
- h->ref_cache[list][idx] >>= 1;\
- h->mv_cache[list][idx][1] <<= 1;\
- h->mvd_cache[list][idx][1] <<= 1;\
- }
- MAP_MVS
-#undef MAP_F2F
- }
- }
- }
- }
-#endif
-
- h->neighbor_transform_size= !!IS_8x8DCT(top_type) + !!IS_8x8DCT(left_type[0]);
-}
-
-static inline void write_back_intra_pred_mode(H264Context *h){
- MpegEncContext * const s = &h->s;
- const int mb_xy= s->mb_x + s->mb_y*s->mb_stride;
-
- h->intra4x4_pred_mode[mb_xy][0]= h->intra4x4_pred_mode_cache[7+8*1];
- h->intra4x4_pred_mode[mb_xy][1]= h->intra4x4_pred_mode_cache[7+8*2];
- h->intra4x4_pred_mode[mb_xy][2]= h->intra4x4_pred_mode_cache[7+8*3];
- h->intra4x4_pred_mode[mb_xy][3]= h->intra4x4_pred_mode_cache[7+8*4];
- h->intra4x4_pred_mode[mb_xy][4]= h->intra4x4_pred_mode_cache[4+8*4];
- h->intra4x4_pred_mode[mb_xy][5]= h->intra4x4_pred_mode_cache[5+8*4];
- h->intra4x4_pred_mode[mb_xy][6]= h->intra4x4_pred_mode_cache[6+8*4];
-}
-
-/**
- * checks if the top & left blocks are available if needed & changes the dc mode so it only uses the available blocks.
- */
-static inline int check_intra4x4_pred_mode(H264Context *h){
- MpegEncContext * const s = &h->s;
- static const int8_t top [12]= {-1, 0,LEFT_DC_PRED,-1,-1,-1,-1,-1, 0};
- static const int8_t left[12]= { 0,-1, TOP_DC_PRED, 0,-1,-1,-1, 0,-1,DC_128_PRED};
- int i;
-
- if(!(h->top_samples_available&0x8000)){
- for(i=0; i<4; i++){
- int status= top[ h->intra4x4_pred_mode_cache[scan8[0] + i] ];
- if(status<0){
- av_log(h->s.avctx, AV_LOG_ERROR, "top block unavailable for requested intra4x4 mode %d at %d %d\n", status, s->mb_x, s->mb_y);
- return -1;
- } else if(status){
- h->intra4x4_pred_mode_cache[scan8[0] + i]= status;
- }
- }
- }
-
- if(!(h->left_samples_available&0x8000)){
- for(i=0; i<4; i++){
- int status= left[ h->intra4x4_pred_mode_cache[scan8[0] + 8*i] ];
- if(status<0){
- av_log(h->s.avctx, AV_LOG_ERROR, "left block unavailable for requested intra4x4 mode %d at %d %d\n", status, s->mb_x, s->mb_y);
- return -1;
- } else if(status){
- h->intra4x4_pred_mode_cache[scan8[0] + 8*i]= status;
- }
- }
- }
-
- return 0;
-} //FIXME cleanup like next
-
-/**
- * checks if the top & left blocks are available if needed & changes the dc mode so it only uses the available blocks.
- */
-static inline int check_intra_pred_mode(H264Context *h, int mode){
- MpegEncContext * const s = &h->s;
- static const int8_t top [7]= {LEFT_DC_PRED8x8, 1,-1,-1};
- static const int8_t left[7]= { TOP_DC_PRED8x8,-1, 2,-1,DC_128_PRED8x8};
-
- if(mode < 0 || mode > 6) {
- av_log(h->s.avctx, AV_LOG_ERROR, "out of range intra chroma pred mode at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
-
- if(!(h->top_samples_available&0x8000)){
- mode= top[ mode ];
- if(mode<0){
- av_log(h->s.avctx, AV_LOG_ERROR, "top block unavailable for requested intra mode at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
- }
-
- if(!(h->left_samples_available&0x8000)){
- mode= left[ mode ];
- if(mode<0){
- av_log(h->s.avctx, AV_LOG_ERROR, "left block unavailable for requested intra mode at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
- }
-
- return mode;
-}
-
-/**
- * gets the predicted intra4x4 prediction mode.
- */
-static inline int pred_intra_mode(H264Context *h, int n){
- const int index8= scan8[n];
- const int left= h->intra4x4_pred_mode_cache[index8 - 1];
- const int top = h->intra4x4_pred_mode_cache[index8 - 8];
- const int min= FFMIN(left, top);
-
- tprintf("mode:%d %d min:%d\n", left ,top, min);
-
- if(min<0) return DC_PRED;
- else return min;
-}
-
-static inline void write_back_non_zero_count(H264Context *h){
- MpegEncContext * const s = &h->s;
- const int mb_xy= s->mb_x + s->mb_y*s->mb_stride;
-
- h->non_zero_count[mb_xy][0]= h->non_zero_count_cache[7+8*1];
- h->non_zero_count[mb_xy][1]= h->non_zero_count_cache[7+8*2];
- h->non_zero_count[mb_xy][2]= h->non_zero_count_cache[7+8*3];
- h->non_zero_count[mb_xy][3]= h->non_zero_count_cache[7+8*4];
- h->non_zero_count[mb_xy][4]= h->non_zero_count_cache[4+8*4];
- h->non_zero_count[mb_xy][5]= h->non_zero_count_cache[5+8*4];
- h->non_zero_count[mb_xy][6]= h->non_zero_count_cache[6+8*4];
-
- h->non_zero_count[mb_xy][9]= h->non_zero_count_cache[1+8*2];
- h->non_zero_count[mb_xy][8]= h->non_zero_count_cache[2+8*2];
- h->non_zero_count[mb_xy][7]= h->non_zero_count_cache[2+8*1];
-
- h->non_zero_count[mb_xy][12]=h->non_zero_count_cache[1+8*5];
- h->non_zero_count[mb_xy][11]=h->non_zero_count_cache[2+8*5];
- h->non_zero_count[mb_xy][10]=h->non_zero_count_cache[2+8*4];
-
- if(FRAME_MBAFF){
- // store all luma nnzs, for deblocking
- int v = 0, i;
- for(i=0; i<16; i++)
- v += (!!h->non_zero_count_cache[scan8[i]]) << i;
- *(uint16_t*)&h->non_zero_count[mb_xy][14] = v;
- }
-}
-
-/**
- * gets the predicted number of non zero coefficients.
- * @param n block index
- */
-static inline int pred_non_zero_count(H264Context *h, int n){
- const int index8= scan8[n];
- const int left= h->non_zero_count_cache[index8 - 1];
- const int top = h->non_zero_count_cache[index8 - 8];
- int i= left + top;
-
- if(i<64) i= (i+1)>>1;
-
- tprintf("pred_nnz L%X T%X n%d s%d P%X\n", left, top, n, scan8[n], i&31);
-
- return i&31;
-}
-
-static inline int fetch_diagonal_mv(H264Context *h, const int16_t **C, int i, int list, int part_width){
- const int topright_ref= h->ref_cache[list][ i - 8 + part_width ];
-
- /* there is no consistent mapping of mvs to neighboring locations that will
- * make mbaff happy, so we can't move all this logic to fill_caches */
- if(FRAME_MBAFF){
- MpegEncContext *s = &h->s;
- const uint32_t *mb_types = s->current_picture_ptr->mb_type;
- const int16_t *mv;
- *(uint32_t*)h->mv_cache[list][scan8[0]-2] = 0;
- *C = h->mv_cache[list][scan8[0]-2];
-
- if(!MB_FIELD
- && (s->mb_y&1) && i < scan8[0]+8 && topright_ref != PART_NOT_AVAILABLE){
- int topright_xy = s->mb_x + (s->mb_y-1)*s->mb_stride + (i == scan8[0]+3);
- if(IS_INTERLACED(mb_types[topright_xy])){
-#define SET_DIAG_MV(MV_OP, REF_OP, X4, Y4)\
- const int x4 = X4, y4 = Y4;\
- const int mb_type = mb_types[(x4>>2)+(y4>>2)*s->mb_stride];\
- if(!USES_LIST(mb_type,list) && !IS_8X8(mb_type))\
- return LIST_NOT_USED;\
- mv = s->current_picture_ptr->motion_val[list][x4 + y4*h->b_stride];\
- h->mv_cache[list][scan8[0]-2][0] = mv[0];\
- h->mv_cache[list][scan8[0]-2][1] = mv[1] MV_OP;\
- return s->current_picture_ptr->ref_index[list][(x4>>1) + (y4>>1)*h->b8_stride] REF_OP;
-
- SET_DIAG_MV(*2, >>1, s->mb_x*4+(i&7)-4+part_width, s->mb_y*4-1);
- }
- }
- if(topright_ref == PART_NOT_AVAILABLE
- && ((s->mb_y&1) || i >= scan8[0]+8) && (i&7)==4
- && h->ref_cache[list][scan8[0]-1] != PART_NOT_AVAILABLE){
- if(!MB_FIELD
- && IS_INTERLACED(mb_types[h->left_mb_xy[0]])){
- SET_DIAG_MV(*2, >>1, s->mb_x*4-1, (s->mb_y|1)*4+(s->mb_y&1)*2+(i>>4)-1);
- }
- if(MB_FIELD
- && !IS_INTERLACED(mb_types[h->left_mb_xy[0]])
- && i >= scan8[0]+8){
- // leftshift will turn LIST_NOT_USED into PART_NOT_AVAILABLE, but that's ok.
- SET_DIAG_MV(>>1, <<1, s->mb_x*4-1, (s->mb_y&~1)*4 - 1 + ((i-scan8[0])>>3)*2);
- }
- }
-#undef SET_DIAG_MV
- }
-
- if(topright_ref != PART_NOT_AVAILABLE){
- *C= h->mv_cache[list][ i - 8 + part_width ];
- return topright_ref;
- }else{
- tprintf("topright MV not available\n");
-
- *C= h->mv_cache[list][ i - 8 - 1 ];
- return h->ref_cache[list][ i - 8 - 1 ];
- }
-}
-
-/**
- * gets the predicted MV.
- * @param n the block index
- * @param part_width the width of the partition (4, 8,16) -> (1, 2, 4)
- * @param mx the x component of the predicted motion vector
- * @param my the y component of the predicted motion vector
- */
-static inline void pred_motion(H264Context * const h, int n, int part_width, int list, int ref, int * const mx, int * const my){
- const int index8= scan8[n];
- const int top_ref= h->ref_cache[list][ index8 - 8 ];
- const int left_ref= h->ref_cache[list][ index8 - 1 ];
- const int16_t * const A= h->mv_cache[list][ index8 - 1 ];
- const int16_t * const B= h->mv_cache[list][ index8 - 8 ];
- const int16_t * C;
- int diagonal_ref, match_count;
-
- assert(part_width==1 || part_width==2 || part_width==4);
-
-/* mv_cache
- B . . A T T T T
- U . . L . . , .
- U . . L . . . .
- U . . L . . , .
- . . . L . . . .
-*/
-
- diagonal_ref= fetch_diagonal_mv(h, &C, index8, list, part_width);
- match_count= (diagonal_ref==ref) + (top_ref==ref) + (left_ref==ref);
- tprintf("pred_motion match_count=%d\n", match_count);
- if(match_count > 1){ //most common
- *mx= mid_pred(A[0], B[0], C[0]);
- *my= mid_pred(A[1], B[1], C[1]);
- }else if(match_count==1){
- if(left_ref==ref){
- *mx= A[0];
- *my= A[1];
- }else if(top_ref==ref){
- *mx= B[0];
- *my= B[1];
- }else{
- *mx= C[0];
- *my= C[1];
- }
- }else{
- if(top_ref == PART_NOT_AVAILABLE && diagonal_ref == PART_NOT_AVAILABLE && left_ref != PART_NOT_AVAILABLE){
- *mx= A[0];
- *my= A[1];
- }else{
- *mx= mid_pred(A[0], B[0], C[0]);
- *my= mid_pred(A[1], B[1], C[1]);
- }
- }
-
- tprintf("pred_motion (%2d %2d %2d) (%2d %2d %2d) (%2d %2d %2d) -> (%2d %2d %2d) at %2d %2d %d list %d\n", top_ref, B[0], B[1], diagonal_ref, C[0], C[1], left_ref, A[0], A[1], ref, *mx, *my, h->s.mb_x, h->s.mb_y, n, list);
-}
-
-/**
- * gets the directionally predicted 16x8 MV.
- * @param n the block index
- * @param mx the x component of the predicted motion vector
- * @param my the y component of the predicted motion vector
- */
-static inline void pred_16x8_motion(H264Context * const h, int n, int list, int ref, int * const mx, int * const my){
- if(n==0){
- const int top_ref= h->ref_cache[list][ scan8[0] - 8 ];
- const int16_t * const B= h->mv_cache[list][ scan8[0] - 8 ];
-
- tprintf("pred_16x8: (%2d %2d %2d) at %2d %2d %d list %d\n", top_ref, B[0], B[1], h->s.mb_x, h->s.mb_y, n, list);
-
- if(top_ref == ref){
- *mx= B[0];
- *my= B[1];
- return;
- }
- }else{
- const int left_ref= h->ref_cache[list][ scan8[8] - 1 ];
- const int16_t * const A= h->mv_cache[list][ scan8[8] - 1 ];
-
- tprintf("pred_16x8: (%2d %2d %2d) at %2d %2d %d list %d\n", left_ref, A[0], A[1], h->s.mb_x, h->s.mb_y, n, list);
-
- if(left_ref == ref){
- *mx= A[0];
- *my= A[1];
- return;
- }
- }
-
- //RARE
- pred_motion(h, n, 4, list, ref, mx, my);
-}
-
-/**
- * gets the directionally predicted 8x16 MV.
- * @param n the block index
- * @param mx the x component of the predicted motion vector
- * @param my the y component of the predicted motion vector
- */
-static inline void pred_8x16_motion(H264Context * const h, int n, int list, int ref, int * const mx, int * const my){
- if(n==0){
- const int left_ref= h->ref_cache[list][ scan8[0] - 1 ];
- const int16_t * const A= h->mv_cache[list][ scan8[0] - 1 ];
-
- tprintf("pred_8x16: (%2d %2d %2d) at %2d %2d %d list %d\n", left_ref, A[0], A[1], h->s.mb_x, h->s.mb_y, n, list);
-
- if(left_ref == ref){
- *mx= A[0];
- *my= A[1];
- return;
- }
- }else{
- const int16_t * C;
- int diagonal_ref;
-
- diagonal_ref= fetch_diagonal_mv(h, &C, scan8[4], list, 2);
-
- tprintf("pred_8x16: (%2d %2d %2d) at %2d %2d %d list %d\n", diagonal_ref, C[0], C[1], h->s.mb_x, h->s.mb_y, n, list);
-
- if(diagonal_ref == ref){
- *mx= C[0];
- *my= C[1];
- return;
- }
- }
-
- //RARE
- pred_motion(h, n, 2, list, ref, mx, my);
-}
-
-static inline void pred_pskip_motion(H264Context * const h, int * const mx, int * const my){
- const int top_ref = h->ref_cache[0][ scan8[0] - 8 ];
- const int left_ref= h->ref_cache[0][ scan8[0] - 1 ];
-
- tprintf("pred_pskip: (%d) (%d) at %2d %2d\n", top_ref, left_ref, h->s.mb_x, h->s.mb_y);
-
- if(top_ref == PART_NOT_AVAILABLE || left_ref == PART_NOT_AVAILABLE
- || (top_ref == 0 && *(uint32_t*)h->mv_cache[0][ scan8[0] - 8 ] == 0)
- || (left_ref == 0 && *(uint32_t*)h->mv_cache[0][ scan8[0] - 1 ] == 0)){
-
- *mx = *my = 0;
- return;
- }
-
- pred_motion(h, 0, 4, 0, 0, mx, my);
-
- return;
-}
-
-static inline void direct_dist_scale_factor(H264Context * const h){
- const int poc = h->s.current_picture_ptr->poc;
- const int poc1 = h->ref_list[1][0].poc;
- int i;
- for(i=0; i<h->ref_count[0]; i++){
- int poc0 = h->ref_list[0][i].poc;
- int td = clip(poc1 - poc0, -128, 127);
- if(td == 0 /* FIXME || pic0 is a long-term ref */){
- h->dist_scale_factor[i] = 256;
- }else{
- int tb = clip(poc - poc0, -128, 127);
- int tx = (16384 + (FFABS(td) >> 1)) / td;
- h->dist_scale_factor[i] = clip((tb*tx + 32) >> 6, -1024, 1023);
- }
- }
- if(FRAME_MBAFF){
- for(i=0; i<h->ref_count[0]; i++){
- h->dist_scale_factor_field[2*i] =
- h->dist_scale_factor_field[2*i+1] = h->dist_scale_factor[i];
- }
- }
-}
-static inline void direct_ref_list_init(H264Context * const h){
- MpegEncContext * const s = &h->s;
- Picture * const ref1 = &h->ref_list[1][0];
- Picture * const cur = s->current_picture_ptr;
- int list, i, j;
- if(cur->pict_type == I_TYPE)
- cur->ref_count[0] = 0;
- if(cur->pict_type != B_TYPE)
- cur->ref_count[1] = 0;
- for(list=0; list<2; list++){
- cur->ref_count[list] = h->ref_count[list];
- for(j=0; j<h->ref_count[list]; j++)
- cur->ref_poc[list][j] = h->ref_list[list][j].poc;
- }
- if(cur->pict_type != B_TYPE || h->direct_spatial_mv_pred)
- return;
- for(list=0; list<2; list++){
- for(i=0; i<ref1->ref_count[list]; i++){
- const int poc = ref1->ref_poc[list][i];
- h->map_col_to_list0[list][i] = 0; /* bogus; fills in for missing frames */
- for(j=0; j<h->ref_count[list]; j++)
- if(h->ref_list[list][j].poc == poc){
- h->map_col_to_list0[list][i] = j;
- break;
- }
- }
- }
- if(FRAME_MBAFF){
- for(list=0; list<2; list++){
- for(i=0; i<ref1->ref_count[list]; i++){
- j = h->map_col_to_list0[list][i];
- h->map_col_to_list0_field[list][2*i] = 2*j;
- h->map_col_to_list0_field[list][2*i+1] = 2*j+1;
- }
- }
- }
-}
-
-static inline void pred_direct_motion(H264Context * const h, int *mb_type){
- MpegEncContext * const s = &h->s;
- const int mb_xy = s->mb_x + s->mb_y*s->mb_stride;
- const int b8_xy = 2*s->mb_x + 2*s->mb_y*h->b8_stride;
- const int b4_xy = 4*s->mb_x + 4*s->mb_y*h->b_stride;
- const int mb_type_col = h->ref_list[1][0].mb_type[mb_xy];
- const int16_t (*l1mv0)[2] = (const int16_t (*)[2]) &h->ref_list[1][0].motion_val[0][b4_xy];
- const int16_t (*l1mv1)[2] = (const int16_t (*)[2]) &h->ref_list[1][0].motion_val[1][b4_xy];
- const int8_t *l1ref0 = &h->ref_list[1][0].ref_index[0][b8_xy];
- const int8_t *l1ref1 = &h->ref_list[1][0].ref_index[1][b8_xy];
- const int is_b8x8 = IS_8X8(*mb_type);
- unsigned int sub_mb_type;
- int i8, i4;
-
-#define MB_TYPE_16x16_OR_INTRA (MB_TYPE_16x16|MB_TYPE_INTRA4x4|MB_TYPE_INTRA16x16|MB_TYPE_INTRA_PCM)
- if(IS_8X8(mb_type_col) && !h->sps.direct_8x8_inference_flag){
- /* FIXME save sub mb types from previous frames (or derive from MVs)
- * so we know exactly what block size to use */
- sub_mb_type = MB_TYPE_8x8|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2; /* B_SUB_4x4 */
- *mb_type = MB_TYPE_8x8|MB_TYPE_L0L1;
- }else if(!is_b8x8 && (mb_type_col & MB_TYPE_16x16_OR_INTRA)){
- sub_mb_type = MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2; /* B_SUB_8x8 */
- *mb_type = MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2; /* B_16x16 */
- }else{
- sub_mb_type = MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2; /* B_SUB_8x8 */
- *mb_type = MB_TYPE_8x8|MB_TYPE_L0L1;
- }
- if(!is_b8x8)
- *mb_type |= MB_TYPE_DIRECT2;
- if(MB_FIELD)
- *mb_type |= MB_TYPE_INTERLACED;
-
- tprintf("mb_type = %08x, sub_mb_type = %08x, is_b8x8 = %d, mb_type_col = %08x\n", *mb_type, sub_mb_type, is_b8x8, mb_type_col);
-
- if(h->direct_spatial_mv_pred){
- int ref[2];
- int mv[2][2];
- int list;
-
- /* FIXME interlacing + spatial direct uses wrong colocated block positions */
-
- /* ref = min(neighbors) */
- for(list=0; list<2; list++){
- int refa = h->ref_cache[list][scan8[0] - 1];
- int refb = h->ref_cache[list][scan8[0] - 8];
- int refc = h->ref_cache[list][scan8[0] - 8 + 4];
- if(refc == -2)
- refc = h->ref_cache[list][scan8[0] - 8 - 1];
- ref[list] = refa;
- if(ref[list] < 0 || (refb < ref[list] && refb >= 0))
- ref[list] = refb;
- if(ref[list] < 0 || (refc < ref[list] && refc >= 0))
- ref[list] = refc;
- if(ref[list] < 0)
- ref[list] = -1;
- }
-
- if(ref[0] < 0 && ref[1] < 0){
- ref[0] = ref[1] = 0;
- mv[0][0] = mv[0][1] =
- mv[1][0] = mv[1][1] = 0;
- }else{
- for(list=0; list<2; list++){
- if(ref[list] >= 0)
- pred_motion(h, 0, 4, list, ref[list], &mv[list][0], &mv[list][1]);
- else
- mv[list][0] = mv[list][1] = 0;
- }
- }
-
- if(ref[1] < 0){
- *mb_type &= ~MB_TYPE_P0L1;
- sub_mb_type &= ~MB_TYPE_P0L1;
- }else if(ref[0] < 0){
- *mb_type &= ~MB_TYPE_P0L0;
- sub_mb_type &= ~MB_TYPE_P0L0;
- }
-
- if(IS_16X16(*mb_type)){
- fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, (uint8_t)ref[0], 1);
- fill_rectangle(&h->ref_cache[1][scan8[0]], 4, 4, 8, (uint8_t)ref[1], 1);
- if(!IS_INTRA(mb_type_col)
- && ( (l1ref0[0] == 0 && FFABS(l1mv0[0][0]) <= 1 && FFABS(l1mv0[0][1]) <= 1)
- || (l1ref0[0] < 0 && l1ref1[0] == 0 && FFABS(l1mv1[0][0]) <= 1 && FFABS(l1mv1[0][1]) <= 1
- && (h->x264_build>33 || !h->x264_build)))){
- if(ref[0] > 0)
- fill_rectangle(&h->mv_cache[0][scan8[0]], 4, 4, 8, pack16to32(mv[0][0],mv[0][1]), 4);
- else
- fill_rectangle(&h->mv_cache[0][scan8[0]], 4, 4, 8, 0, 4);
- if(ref[1] > 0)
- fill_rectangle(&h->mv_cache[1][scan8[0]], 4, 4, 8, pack16to32(mv[1][0],mv[1][1]), 4);
- else
- fill_rectangle(&h->mv_cache[1][scan8[0]], 4, 4, 8, 0, 4);
- }else{
- fill_rectangle(&h->mv_cache[0][scan8[0]], 4, 4, 8, pack16to32(mv[0][0],mv[0][1]), 4);
- fill_rectangle(&h->mv_cache[1][scan8[0]], 4, 4, 8, pack16to32(mv[1][0],mv[1][1]), 4);
- }
- }else{
- for(i8=0; i8<4; i8++){
- const int x8 = i8&1;
- const int y8 = i8>>1;
-
- if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8]))
- continue;
- h->sub_mb_type[i8] = sub_mb_type;
-
- fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, pack16to32(mv[0][0],mv[0][1]), 4);
- fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, pack16to32(mv[1][0],mv[1][1]), 4);
- fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[0], 1);
- fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[1], 1);
-
- /* col_zero_flag */
- if(!IS_INTRA(mb_type_col) && ( l1ref0[x8 + y8*h->b8_stride] == 0
- || (l1ref0[x8 + y8*h->b8_stride] < 0 && l1ref1[x8 + y8*h->b8_stride] == 0
- && (h->x264_build>33 || !h->x264_build)))){
- const int16_t (*l1mv)[2]= l1ref0[x8 + y8*h->b8_stride] == 0 ? l1mv0 : l1mv1;
- if(IS_SUB_8X8(sub_mb_type)){
- const int16_t *mv_col = l1mv[x8*3 + y8*3*h->b_stride];
- if(FFABS(mv_col[0]) <= 1 && FFABS(mv_col[1]) <= 1){
- if(ref[0] == 0)
- fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, 0, 4);
- if(ref[1] == 0)
- fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, 0, 4);
- }
- }else
- for(i4=0; i4<4; i4++){
- const int16_t *mv_col = l1mv[x8*2 + (i4&1) + (y8*2 + (i4>>1))*h->b_stride];
- if(FFABS(mv_col[0]) <= 1 && FFABS(mv_col[1]) <= 1){
- if(ref[0] == 0)
- *(uint32_t*)h->mv_cache[0][scan8[i8*4+i4]] = 0;
- if(ref[1] == 0)
- *(uint32_t*)h->mv_cache[1][scan8[i8*4+i4]] = 0;
- }
- }
- }
- }
- }
- }else{ /* direct temporal mv pred */
- const int *map_col_to_list0[2] = {h->map_col_to_list0[0], h->map_col_to_list0[1]};
- const int *dist_scale_factor = h->dist_scale_factor;
-
- if(FRAME_MBAFF){
- if(IS_INTERLACED(*mb_type)){
- map_col_to_list0[0] = h->map_col_to_list0_field[0];
- map_col_to_list0[1] = h->map_col_to_list0_field[1];
- dist_scale_factor = h->dist_scale_factor_field;
- }
- if(IS_INTERLACED(*mb_type) != IS_INTERLACED(mb_type_col)){
- /* FIXME assumes direct_8x8_inference == 1 */
- const int pair_xy = s->mb_x + (s->mb_y&~1)*s->mb_stride;
- int mb_types_col[2];
- int y_shift;
-
- *mb_type = MB_TYPE_8x8|MB_TYPE_L0L1
- | (is_b8x8 ? 0 : MB_TYPE_DIRECT2)
- | (*mb_type & MB_TYPE_INTERLACED);
- sub_mb_type = MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2|MB_TYPE_16x16;
-
- if(IS_INTERLACED(*mb_type)){
- /* frame to field scaling */
- mb_types_col[0] = h->ref_list[1][0].mb_type[pair_xy];
- mb_types_col[1] = h->ref_list[1][0].mb_type[pair_xy+s->mb_stride];
- if(s->mb_y&1){
- l1ref0 -= 2*h->b8_stride;
- l1ref1 -= 2*h->b8_stride;
- l1mv0 -= 4*h->b_stride;
- l1mv1 -= 4*h->b_stride;
- }
- y_shift = 0;
-
- if( (mb_types_col[0] & MB_TYPE_16x16_OR_INTRA)
- && (mb_types_col[1] & MB_TYPE_16x16_OR_INTRA)
- && !is_b8x8)
- *mb_type |= MB_TYPE_16x8;
- else
- *mb_type |= MB_TYPE_8x8;
- }else{
- /* field to frame scaling */
- /* col_mb_y = (mb_y&~1) + (topAbsDiffPOC < bottomAbsDiffPOC ? 0 : 1)
- * but in MBAFF, top and bottom POC are equal */
- int dy = (s->mb_y&1) ? 1 : 2;
- mb_types_col[0] =
- mb_types_col[1] = h->ref_list[1][0].mb_type[pair_xy+s->mb_stride];
- l1ref0 += dy*h->b8_stride;
- l1ref1 += dy*h->b8_stride;
- l1mv0 += 2*dy*h->b_stride;
- l1mv1 += 2*dy*h->b_stride;
- y_shift = 2;
-
- if((mb_types_col[0] & (MB_TYPE_16x16_OR_INTRA|MB_TYPE_16x8))
- && !is_b8x8)
- *mb_type |= MB_TYPE_16x16;
- else
- *mb_type |= MB_TYPE_8x8;
- }
-
- for(i8=0; i8<4; i8++){
- const int x8 = i8&1;
- const int y8 = i8>>1;
- int ref0, scale;
- const int16_t (*l1mv)[2]= l1mv0;
-
- if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8]))
- continue;
- h->sub_mb_type[i8] = sub_mb_type;
-
- fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, 0, 1);
- if(IS_INTRA(mb_types_col[y8])){
- fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, 0, 1);
- fill_rectangle(&h-> mv_cache[0][scan8[i8*4]], 2, 2, 8, 0, 4);
- fill_rectangle(&h-> mv_cache[1][scan8[i8*4]], 2, 2, 8, 0, 4);
- continue;
- }
-
- ref0 = l1ref0[x8 + (y8*2>>y_shift)*h->b8_stride];
- if(ref0 >= 0)
- ref0 = map_col_to_list0[0][ref0*2>>y_shift];
- else{
- ref0 = map_col_to_list0[1][l1ref1[x8 + (y8*2>>y_shift)*h->b8_stride]*2>>y_shift];
- l1mv= l1mv1;
- }
- scale = dist_scale_factor[ref0];
- fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, ref0, 1);
-
- {
- const int16_t *mv_col = l1mv[x8*3 + (y8*6>>y_shift)*h->b_stride];
- int my_col = (mv_col[1]<<y_shift)/2;
- int mx = (scale * mv_col[0] + 128) >> 8;
- int my = (scale * my_col + 128) >> 8;
- fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, pack16to32(mx,my), 4);
- fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, pack16to32(mx-mv_col[0],my-my_col), 4);
- }
- }
- return;
- }
- }
-
- /* one-to-one mv scaling */
-
- if(IS_16X16(*mb_type)){
- fill_rectangle(&h->ref_cache[1][scan8[0]], 4, 4, 8, 0, 1);
- if(IS_INTRA(mb_type_col)){
- fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, 0, 1);
- fill_rectangle(&h-> mv_cache[0][scan8[0]], 4, 4, 8, 0, 4);
- fill_rectangle(&h-> mv_cache[1][scan8[0]], 4, 4, 8, 0, 4);
- }else{
- const int ref0 = l1ref0[0] >= 0 ? map_col_to_list0[0][l1ref0[0]]
- : map_col_to_list0[1][l1ref1[0]];
- const int scale = dist_scale_factor[ref0];
- const int16_t *mv_col = l1ref0[0] >= 0 ? l1mv0[0] : l1mv1[0];
- int mv_l0[2];
- mv_l0[0] = (scale * mv_col[0] + 128) >> 8;
- mv_l0[1] = (scale * mv_col[1] + 128) >> 8;
- fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, ref0, 1);
- fill_rectangle(&h-> mv_cache[0][scan8[0]], 4, 4, 8, pack16to32(mv_l0[0],mv_l0[1]), 4);
- fill_rectangle(&h-> mv_cache[1][scan8[0]], 4, 4, 8, pack16to32(mv_l0[0]-mv_col[0],mv_l0[1]-mv_col[1]), 4);
- }
- }else{
- for(i8=0; i8<4; i8++){
- const int x8 = i8&1;
- const int y8 = i8>>1;
- int ref0, scale;
- const int16_t (*l1mv)[2]= l1mv0;
-
- if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8]))
- continue;
- h->sub_mb_type[i8] = sub_mb_type;
- fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, 0, 1);
- if(IS_INTRA(mb_type_col)){
- fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, 0, 1);
- fill_rectangle(&h-> mv_cache[0][scan8[i8*4]], 2, 2, 8, 0, 4);
- fill_rectangle(&h-> mv_cache[1][scan8[i8*4]], 2, 2, 8, 0, 4);
- continue;
- }
-
- ref0 = l1ref0[x8 + y8*h->b8_stride];
- if(ref0 >= 0)
- ref0 = map_col_to_list0[0][ref0];
- else{
- ref0 = map_col_to_list0[1][l1ref1[x8 + y8*h->b8_stride]];
- l1mv= l1mv1;
- }
- scale = dist_scale_factor[ref0];
-
- fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, ref0, 1);
- if(IS_SUB_8X8(sub_mb_type)){
- const int16_t *mv_col = l1mv[x8*3 + y8*3*h->b_stride];
- int mx = (scale * mv_col[0] + 128) >> 8;
- int my = (scale * mv_col[1] + 128) >> 8;
- fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, pack16to32(mx,my), 4);
- fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, pack16to32(mx-mv_col[0],my-mv_col[1]), 4);
- }else
- for(i4=0; i4<4; i4++){
- const int16_t *mv_col = l1mv[x8*2 + (i4&1) + (y8*2 + (i4>>1))*h->b_stride];
- int16_t *mv_l0 = h->mv_cache[0][scan8[i8*4+i4]];
- mv_l0[0] = (scale * mv_col[0] + 128) >> 8;
- mv_l0[1] = (scale * mv_col[1] + 128) >> 8;
- *(uint32_t*)h->mv_cache[1][scan8[i8*4+i4]] =
- pack16to32(mv_l0[0]-mv_col[0],mv_l0[1]-mv_col[1]);
- }
- }
- }
- }
-}
-
-static inline void write_back_motion(H264Context *h, int mb_type){
- MpegEncContext * const s = &h->s;
- const int b_xy = 4*s->mb_x + 4*s->mb_y*h->b_stride;
- const int b8_xy= 2*s->mb_x + 2*s->mb_y*h->b8_stride;
- int list;
-
- if(!USES_LIST(mb_type, 0))
- fill_rectangle(&s->current_picture.ref_index[0][b8_xy], 2, 2, h->b8_stride, (uint8_t)LIST_NOT_USED, 1);
-
- for(list=0; list<2; list++){
- int y;
- if(!USES_LIST(mb_type, list))
- continue;
-
- for(y=0; y<4; y++){
- *(uint64_t*)s->current_picture.motion_val[list][b_xy + 0 + y*h->b_stride]= *(uint64_t*)h->mv_cache[list][scan8[0]+0 + 8*y];
- *(uint64_t*)s->current_picture.motion_val[list][b_xy + 2 + y*h->b_stride]= *(uint64_t*)h->mv_cache[list][scan8[0]+2 + 8*y];
- }
- if( h->pps.cabac ) {
- if(IS_SKIP(mb_type))
- fill_rectangle(h->mvd_table[list][b_xy], 4, 4, h->b_stride, 0, 4);
- else
- for(y=0; y<4; y++){
- *(uint64_t*)h->mvd_table[list][b_xy + 0 + y*h->b_stride]= *(uint64_t*)h->mvd_cache[list][scan8[0]+0 + 8*y];
- *(uint64_t*)h->mvd_table[list][b_xy + 2 + y*h->b_stride]= *(uint64_t*)h->mvd_cache[list][scan8[0]+2 + 8*y];
- }
- }
-
- {
- int8_t *ref_index = &s->current_picture.ref_index[list][b8_xy];
- ref_index[0+0*h->b8_stride]= h->ref_cache[list][scan8[0]];
- ref_index[1+0*h->b8_stride]= h->ref_cache[list][scan8[4]];
- ref_index[0+1*h->b8_stride]= h->ref_cache[list][scan8[8]];
- ref_index[1+1*h->b8_stride]= h->ref_cache[list][scan8[12]];
- }
- }
-
- if(h->slice_type == B_TYPE && h->pps.cabac){
- if(IS_8X8(mb_type)){
- uint8_t *direct_table = &h->direct_table[b8_xy];
- direct_table[1+0*h->b8_stride] = IS_DIRECT(h->sub_mb_type[1]) ? 1 : 0;
- direct_table[0+1*h->b8_stride] = IS_DIRECT(h->sub_mb_type[2]) ? 1 : 0;
- direct_table[1+1*h->b8_stride] = IS_DIRECT(h->sub_mb_type[3]) ? 1 : 0;
- }
- }
-}
-
-/**
- * Decodes a network abstraction layer unit.
- * @param consumed is the number of bytes used as input
- * @param length is the length of the array
- * @param dst_length is the number of decoded bytes FIXME here or a decode rbsp tailing?
- * @returns decoded bytes, might be src+1 if no escapes
- */
-static uint8_t *decode_nal(H264Context *h, uint8_t *src, int *dst_length, int *consumed, int length){
- int i, si, di;
- uint8_t *dst;
-
-// src[0]&0x80; //forbidden bit
- h->nal_ref_idc= src[0]>>5;
- h->nal_unit_type= src[0]&0x1F;
-
- src++; length--;
-#if 0
- for(i=0; i<length; i++)
- printf("%2X ", src[i]);
-#endif
- for(i=0; i+1<length; i+=2){
- if(src[i]) continue;
- if(i>0 && src[i-1]==0) i--;
- if(i+2<length && src[i+1]==0 && src[i+2]<=3){
- if(src[i+2]!=3){
- /* startcode, so we must be past the end */
- length=i;
- }
- break;
- }
- }
-
- if(i>=length-1){ //no escaped 0
- *dst_length= length;
- *consumed= length+1; //+1 for the header
- return src;
- }
-
- h->rbsp_buffer= av_fast_realloc(h->rbsp_buffer, &h->rbsp_buffer_size, length);
- dst= h->rbsp_buffer;
-
- if (dst == NULL){
- return NULL;
- }
-
-//printf("decoding esc\n");
- si=di=0;
- while(si<length){
- //remove escapes (very rare 1:2^22)
- if(si+2<length && src[si]==0 && src[si+1]==0 && src[si+2]<=3){
- if(src[si+2]==3){ //escape
- dst[di++]= 0;
- dst[di++]= 0;
- si+=3;
- continue;
- }else //next start code
- break;
- }
-
- dst[di++]= src[si++];
- }
-
- *dst_length= di;
- *consumed= si + 1;//+1 for the header
-//FIXME store exact number of bits in the getbitcontext (its needed for decoding)
- return dst;
-}
-
-/**
- * identifies the exact end of the bitstream
- * @return the length of the trailing, or 0 if damaged
- */
-static int decode_rbsp_trailing(uint8_t *src){
- int v= *src;
- int r;
-
- tprintf("rbsp trailing %X\n", v);
-
- for(r=1; r<9; r++){
- if(v&1) return r;
- v>>=1;
- }
- return 0;
-}
-
-/**
- * idct tranforms the 16 dc values and dequantize them.
- * @param qp quantization parameter
- */
-static void h264_luma_dc_dequant_idct_c(DCTELEM *block, int qp, int qmul){
-#define stride 16
- int i;
- int temp[16]; //FIXME check if this is a good idea
- static const int x_offset[4]={0, 1*stride, 4* stride, 5*stride};
- static const int y_offset[4]={0, 2*stride, 8* stride, 10*stride};
-
-//memset(block, 64, 2*256);
-//return;
- for(i=0; i<4; i++){
- const int offset= y_offset[i];
- const int z0= block[offset+stride*0] + block[offset+stride*4];
- const int z1= block[offset+stride*0] - block[offset+stride*4];
- const int z2= block[offset+stride*1] - block[offset+stride*5];
- const int z3= block[offset+stride*1] + block[offset+stride*5];
-
- temp[4*i+0]= z0+z3;
- temp[4*i+1]= z1+z2;
- temp[4*i+2]= z1-z2;
- temp[4*i+3]= z0-z3;
- }
-
- for(i=0; i<4; i++){
- const int offset= x_offset[i];
- const int z0= temp[4*0+i] + temp[4*2+i];
- const int z1= temp[4*0+i] - temp[4*2+i];
- const int z2= temp[4*1+i] - temp[4*3+i];
- const int z3= temp[4*1+i] + temp[4*3+i];
-
- block[stride*0 +offset]= ((((z0 + z3)*qmul + 128 ) >> 8)); //FIXME think about merging this into decode_resdual
- block[stride*2 +offset]= ((((z1 + z2)*qmul + 128 ) >> 8));
- block[stride*8 +offset]= ((((z1 - z2)*qmul + 128 ) >> 8));
- block[stride*10+offset]= ((((z0 - z3)*qmul + 128 ) >> 8));
- }
-}
-
-#if 0
-/**
- * dct tranforms the 16 dc values.
- * @param qp quantization parameter ??? FIXME
- */
-static void h264_luma_dc_dct_c(DCTELEM *block/*, int qp*/){
-// const int qmul= dequant_coeff[qp][0];
- int i;
- int temp[16]; //FIXME check if this is a good idea
- static const int x_offset[4]={0, 1*stride, 4* stride, 5*stride};
- static const int y_offset[4]={0, 2*stride, 8* stride, 10*stride};
-
- for(i=0; i<4; i++){
- const int offset= y_offset[i];
- const int z0= block[offset+stride*0] + block[offset+stride*4];
- const int z1= block[offset+stride*0] - block[offset+stride*4];
- const int z2= block[offset+stride*1] - block[offset+stride*5];
- const int z3= block[offset+stride*1] + block[offset+stride*5];
-
- temp[4*i+0]= z0+z3;
- temp[4*i+1]= z1+z2;
- temp[4*i+2]= z1-z2;
- temp[4*i+3]= z0-z3;
- }
-
- for(i=0; i<4; i++){
- const int offset= x_offset[i];
- const int z0= temp[4*0+i] + temp[4*2+i];
- const int z1= temp[4*0+i] - temp[4*2+i];
- const int z2= temp[4*1+i] - temp[4*3+i];
- const int z3= temp[4*1+i] + temp[4*3+i];
-
- block[stride*0 +offset]= (z0 + z3)>>1;
- block[stride*2 +offset]= (z1 + z2)>>1;
- block[stride*8 +offset]= (z1 - z2)>>1;
- block[stride*10+offset]= (z0 - z3)>>1;
- }
-}
-#endif
-
-#undef xStride
-#undef stride
-
-static void chroma_dc_dequant_idct_c(DCTELEM *block, int qp, int qmul){
- const int stride= 16*2;
- const int xStride= 16;
- int a,b,c,d,e;
-
- a= block[stride*0 + xStride*0];
- b= block[stride*0 + xStride*1];
- c= block[stride*1 + xStride*0];
- d= block[stride*1 + xStride*1];
-
- e= a-b;
- a= a+b;
- b= c-d;
- c= c+d;
-
- block[stride*0 + xStride*0]= ((a+c)*qmul) >> 7;
- block[stride*0 + xStride*1]= ((e+b)*qmul) >> 7;
- block[stride*1 + xStride*0]= ((a-c)*qmul) >> 7;
- block[stride*1 + xStride*1]= ((e-b)*qmul) >> 7;
-}
-
-#if 0
-static void chroma_dc_dct_c(DCTELEM *block){
- const int stride= 16*2;
- const int xStride= 16;
- int a,b,c,d,e;
-
- a= block[stride*0 + xStride*0];
- b= block[stride*0 + xStride*1];
- c= block[stride*1 + xStride*0];
- d= block[stride*1 + xStride*1];
-
- e= a-b;
- a= a+b;
- b= c-d;
- c= c+d;
-
- block[stride*0 + xStride*0]= (a+c);
- block[stride*0 + xStride*1]= (e+b);
- block[stride*1 + xStride*0]= (a-c);
- block[stride*1 + xStride*1]= (e-b);
-}
-#endif
-
-/**
- * gets the chroma qp.
- */
-static inline int get_chroma_qp(int chroma_qp_index_offset, int qscale){
-
- return chroma_qp[clip(qscale + chroma_qp_index_offset, 0, 51)];
-}
-
-//FIXME need to check that this doesnt overflow signed 32 bit for low qp, i am not sure, it's very close
-//FIXME check that gcc inlines this (and optimizes intra & seperate_dc stuff away)
-static inline int quantize_c(DCTELEM *block, uint8_t *scantable, int qscale, int intra, int seperate_dc){
- int i;
- const int * const quant_table= quant_coeff[qscale];
- const int bias= intra ? (1<<QUANT_SHIFT)/3 : (1<<QUANT_SHIFT)/6;
- const unsigned int threshold1= (1<<QUANT_SHIFT) - bias - 1;
- const unsigned int threshold2= (threshold1<<1);
- int last_non_zero;
-
- if(seperate_dc){
- if(qscale<=18){
- //avoid overflows
- const int dc_bias= intra ? (1<<(QUANT_SHIFT-2))/3 : (1<<(QUANT_SHIFT-2))/6;
- const unsigned int dc_threshold1= (1<<(QUANT_SHIFT-2)) - dc_bias - 1;
- const unsigned int dc_threshold2= (dc_threshold1<<1);
-
- int level= block[0]*quant_coeff[qscale+18][0];
- if(((unsigned)(level+dc_threshold1))>dc_threshold2){
- if(level>0){
- level= (dc_bias + level)>>(QUANT_SHIFT-2);
- block[0]= level;
- }else{
- level= (dc_bias - level)>>(QUANT_SHIFT-2);
- block[0]= -level;
- }
-// last_non_zero = i;
- }else{
- block[0]=0;
- }
- }else{
- const int dc_bias= intra ? (1<<(QUANT_SHIFT+1))/3 : (1<<(QUANT_SHIFT+1))/6;
- const unsigned int dc_threshold1= (1<<(QUANT_SHIFT+1)) - dc_bias - 1;
- const unsigned int dc_threshold2= (dc_threshold1<<1);
-
- int level= block[0]*quant_table[0];
- if(((unsigned)(level+dc_threshold1))>dc_threshold2){
- if(level>0){
- level= (dc_bias + level)>>(QUANT_SHIFT+1);
- block[0]= level;
- }else{
- level= (dc_bias - level)>>(QUANT_SHIFT+1);
- block[0]= -level;
- }
-// last_non_zero = i;
- }else{
- block[0]=0;
- }
- }
- last_non_zero= 0;
- i=1;
- }else{
- last_non_zero= -1;
- i=0;
- }
-
- for(; i<16; i++){
- const int j= scantable[i];
- int level= block[j]*quant_table[j];
-
-// if( bias+level >= (1<<(QMAT_SHIFT - 3))
-// || bias-level >= (1<<(QMAT_SHIFT - 3))){
- if(((unsigned)(level+threshold1))>threshold2){
- if(level>0){
- level= (bias + level)>>QUANT_SHIFT;
- block[j]= level;
- }else{
- level= (bias - level)>>QUANT_SHIFT;
- block[j]= -level;
- }
- last_non_zero = i;
- }else{
- block[j]=0;
- }
- }
-
- return last_non_zero;
-}
-
-static void pred4x4_vertical_c(uint8_t *src, uint8_t *topright, int stride){
- const uint32_t a= ((uint32_t*)(src-stride))[0];
- ((uint32_t*)(src+0*stride))[0]= a;
- ((uint32_t*)(src+1*stride))[0]= a;
- ((uint32_t*)(src+2*stride))[0]= a;
- ((uint32_t*)(src+3*stride))[0]= a;
-}
-
-static void pred4x4_horizontal_c(uint8_t *src, uint8_t *topright, int stride){
- ((uint32_t*)(src+0*stride))[0]= src[-1+0*stride]*0x01010101;
- ((uint32_t*)(src+1*stride))[0]= src[-1+1*stride]*0x01010101;
- ((uint32_t*)(src+2*stride))[0]= src[-1+2*stride]*0x01010101;
- ((uint32_t*)(src+3*stride))[0]= src[-1+3*stride]*0x01010101;
-}
-
-static void pred4x4_dc_c(uint8_t *src, uint8_t *topright, int stride){
- const int dc= ( src[-stride] + src[1-stride] + src[2-stride] + src[3-stride]
- + src[-1+0*stride] + src[-1+1*stride] + src[-1+2*stride] + src[-1+3*stride] + 4) >>3;
-
- ((uint32_t*)(src+0*stride))[0]=
- ((uint32_t*)(src+1*stride))[0]=
- ((uint32_t*)(src+2*stride))[0]=
- ((uint32_t*)(src+3*stride))[0]= dc* 0x01010101;
-}
-
-static void pred4x4_left_dc_c(uint8_t *src, uint8_t *topright, int stride){
- const int dc= ( src[-1+0*stride] + src[-1+1*stride] + src[-1+2*stride] + src[-1+3*stride] + 2) >>2;
-
- ((uint32_t*)(src+0*stride))[0]=
- ((uint32_t*)(src+1*stride))[0]=
- ((uint32_t*)(src+2*stride))[0]=
- ((uint32_t*)(src+3*stride))[0]= dc* 0x01010101;
-}
-
-static void pred4x4_top_dc_c(uint8_t *src, uint8_t *topright, int stride){
- const int dc= ( src[-stride] + src[1-stride] + src[2-stride] + src[3-stride] + 2) >>2;
-
- ((uint32_t*)(src+0*stride))[0]=
- ((uint32_t*)(src+1*stride))[0]=
- ((uint32_t*)(src+2*stride))[0]=
- ((uint32_t*)(src+3*stride))[0]= dc* 0x01010101;
-}
-
-static void pred4x4_128_dc_c(uint8_t *src, uint8_t *topright, int stride){
- ((uint32_t*)(src+0*stride))[0]=
- ((uint32_t*)(src+1*stride))[0]=
- ((uint32_t*)(src+2*stride))[0]=
- ((uint32_t*)(src+3*stride))[0]= 128U*0x01010101U;
-}
-
-
-#define LOAD_TOP_RIGHT_EDGE\
- const int t4= topright[0];\
- const int t5= topright[1];\
- const int t6= topright[2];\
- const int t7= topright[3];\
-
-#define LOAD_LEFT_EDGE\
- const int l0= src[-1+0*stride];\
- const int l1= src[-1+1*stride];\
- const int l2= src[-1+2*stride];\
- const int l3= src[-1+3*stride];\
-
-#define LOAD_TOP_EDGE\
- const int t0= src[ 0-1*stride];\
- const int t1= src[ 1-1*stride];\
- const int t2= src[ 2-1*stride];\
- const int t3= src[ 3-1*stride];\
-
-static void pred4x4_down_right_c(uint8_t *src, uint8_t *topright, int stride){
- const int lt= src[-1-1*stride];
- LOAD_TOP_EDGE
- LOAD_LEFT_EDGE
-
- src[0+3*stride]=(l3 + 2*l2 + l1 + 2)>>2;
- src[0+2*stride]=
- src[1+3*stride]=(l2 + 2*l1 + l0 + 2)>>2;
- src[0+1*stride]=
- src[1+2*stride]=
- src[2+3*stride]=(l1 + 2*l0 + lt + 2)>>2;
- src[0+0*stride]=
- src[1+1*stride]=
- src[2+2*stride]=
- src[3+3*stride]=(l0 + 2*lt + t0 + 2)>>2;
- src[1+0*stride]=
- src[2+1*stride]=
- src[3+2*stride]=(lt + 2*t0 + t1 + 2)>>2;
- src[2+0*stride]=
- src[3+1*stride]=(t0 + 2*t1 + t2 + 2)>>2;
- src[3+0*stride]=(t1 + 2*t2 + t3 + 2)>>2;
-}
-
-static void pred4x4_down_left_c(uint8_t *src, uint8_t *topright, int stride){
- LOAD_TOP_EDGE
- LOAD_TOP_RIGHT_EDGE
-// LOAD_LEFT_EDGE
-
- src[0+0*stride]=(t0 + t2 + 2*t1 + 2)>>2;
- src[1+0*stride]=
- src[0+1*stride]=(t1 + t3 + 2*t2 + 2)>>2;
- src[2+0*stride]=
- src[1+1*stride]=
- src[0+2*stride]=(t2 + t4 + 2*t3 + 2)>>2;
- src[3+0*stride]=
- src[2+1*stride]=
- src[1+2*stride]=
- src[0+3*stride]=(t3 + t5 + 2*t4 + 2)>>2;
- src[3+1*stride]=
- src[2+2*stride]=
- src[1+3*stride]=(t4 + t6 + 2*t5 + 2)>>2;
- src[3+2*stride]=
- src[2+3*stride]=(t5 + t7 + 2*t6 + 2)>>2;
- src[3+3*stride]=(t6 + 3*t7 + 2)>>2;
-}
-
-static void pred4x4_vertical_right_c(uint8_t *src, uint8_t *topright, int stride){
- const int lt= src[-1-1*stride];
- LOAD_TOP_EDGE
- LOAD_LEFT_EDGE
- const __attribute__((unused)) int unu= l3;
-
- src[0+0*stride]=
- src[1+2*stride]=(lt + t0 + 1)>>1;
- src[1+0*stride]=
- src[2+2*stride]=(t0 + t1 + 1)>>1;
- src[2+0*stride]=
- src[3+2*stride]=(t1 + t2 + 1)>>1;
- src[3+0*stride]=(t2 + t3 + 1)>>1;
- src[0+1*stride]=
- src[1+3*stride]=(l0 + 2*lt + t0 + 2)>>2;
- src[1+1*stride]=
- src[2+3*stride]=(lt + 2*t0 + t1 + 2)>>2;
- src[2+1*stride]=
- src[3+3*stride]=(t0 + 2*t1 + t2 + 2)>>2;
- src[3+1*stride]=(t1 + 2*t2 + t3 + 2)>>2;
- src[0+2*stride]=(lt + 2*l0 + l1 + 2)>>2;
- src[0+3*stride]=(l0 + 2*l1 + l2 + 2)>>2;
-}
-
-static void pred4x4_vertical_left_c(uint8_t *src, uint8_t *topright, int stride){
- LOAD_TOP_EDGE
- LOAD_TOP_RIGHT_EDGE
- const __attribute__((unused)) int unu= t7;
-
- src[0+0*stride]=(t0 + t1 + 1)>>1;
- src[1+0*stride]=
- src[0+2*stride]=(t1 + t2 + 1)>>1;
- src[2+0*stride]=
- src[1+2*stride]=(t2 + t3 + 1)>>1;
- src[3+0*stride]=
- src[2+2*stride]=(t3 + t4+ 1)>>1;
- src[3+2*stride]=(t4 + t5+ 1)>>1;
- src[0+1*stride]=(t0 + 2*t1 + t2 + 2)>>2;
- src[1+1*stride]=
- src[0+3*stride]=(t1 + 2*t2 + t3 + 2)>>2;
- src[2+1*stride]=
- src[1+3*stride]=(t2 + 2*t3 + t4 + 2)>>2;
- src[3+1*stride]=
- src[2+3*stride]=(t3 + 2*t4 + t5 + 2)>>2;
- src[3+3*stride]=(t4 + 2*t5 + t6 + 2)>>2;
-}
-
-static void pred4x4_horizontal_up_c(uint8_t *src, uint8_t *topright, int stride){
- LOAD_LEFT_EDGE
-
- src[0+0*stride]=(l0 + l1 + 1)>>1;
- src[1+0*stride]=(l0 + 2*l1 + l2 + 2)>>2;
- src[2+0*stride]=
- src[0+1*stride]=(l1 + l2 + 1)>>1;
- src[3+0*stride]=
- src[1+1*stride]=(l1 + 2*l2 + l3 + 2)>>2;
- src[2+1*stride]=
- src[0+2*stride]=(l2 + l3 + 1)>>1;
- src[3+1*stride]=
- src[1+2*stride]=(l2 + 2*l3 + l3 + 2)>>2;
- src[3+2*stride]=
- src[1+3*stride]=
- src[0+3*stride]=
- src[2+2*stride]=
- src[2+3*stride]=
- src[3+3*stride]=l3;
-}
-
-static void pred4x4_horizontal_down_c(uint8_t *src, uint8_t *topright, int stride){
- const int lt= src[-1-1*stride];
- LOAD_TOP_EDGE
- LOAD_LEFT_EDGE
- const __attribute__((unused)) int unu= t3;
-
- src[0+0*stride]=
- src[2+1*stride]=(lt + l0 + 1)>>1;
- src[1+0*stride]=
- src[3+1*stride]=(l0 + 2*lt + t0 + 2)>>2;
- src[2+0*stride]=(lt + 2*t0 + t1 + 2)>>2;
- src[3+0*stride]=(t0 + 2*t1 + t2 + 2)>>2;
- src[0+1*stride]=
- src[2+2*stride]=(l0 + l1 + 1)>>1;
- src[1+1*stride]=
- src[3+2*stride]=(lt + 2*l0 + l1 + 2)>>2;
- src[0+2*stride]=
- src[2+3*stride]=(l1 + l2+ 1)>>1;
- src[1+2*stride]=
- src[3+3*stride]=(l0 + 2*l1 + l2 + 2)>>2;
- src[0+3*stride]=(l2 + l3 + 1)>>1;
- src[1+3*stride]=(l1 + 2*l2 + l3 + 2)>>2;
-}
-
-void ff_pred16x16_vertical_c(uint8_t *src, int stride){
- int i;
- const uint32_t a= ((uint32_t*)(src-stride))[0];
- const uint32_t b= ((uint32_t*)(src-stride))[1];
- const uint32_t c= ((uint32_t*)(src-stride))[2];
- const uint32_t d= ((uint32_t*)(src-stride))[3];
-
- for(i=0; i<16; i++){
- ((uint32_t*)(src+i*stride))[0]= a;
- ((uint32_t*)(src+i*stride))[1]= b;
- ((uint32_t*)(src+i*stride))[2]= c;
- ((uint32_t*)(src+i*stride))[3]= d;
- }
-}
-
-void ff_pred16x16_horizontal_c(uint8_t *src, int stride){
- int i;
-
- for(i=0; i<16; i++){
- ((uint32_t*)(src+i*stride))[0]=
- ((uint32_t*)(src+i*stride))[1]=
- ((uint32_t*)(src+i*stride))[2]=
- ((uint32_t*)(src+i*stride))[3]= src[-1+i*stride]*0x01010101;
- }
-}
-
-void ff_pred16x16_dc_c(uint8_t *src, int stride){
- int i, dc=0;
-
- for(i=0;i<16; i++){
- dc+= src[-1+i*stride];
- }
-
- for(i=0;i<16; i++){
- dc+= src[i-stride];
- }
-
- dc= 0x01010101*((dc + 16)>>5);
-
- for(i=0; i<16; i++){
- ((uint32_t*)(src+i*stride))[0]=
- ((uint32_t*)(src+i*stride))[1]=
- ((uint32_t*)(src+i*stride))[2]=
- ((uint32_t*)(src+i*stride))[3]= dc;
- }
-}
-
-static void pred16x16_left_dc_c(uint8_t *src, int stride){
- int i, dc=0;
-
- for(i=0;i<16; i++){
- dc+= src[-1+i*stride];
- }
-
- dc= 0x01010101*((dc + 8)>>4);
-
- for(i=0; i<16; i++){
- ((uint32_t*)(src+i*stride))[0]=
- ((uint32_t*)(src+i*stride))[1]=
- ((uint32_t*)(src+i*stride))[2]=
- ((uint32_t*)(src+i*stride))[3]= dc;
- }
-}
-
-static void pred16x16_top_dc_c(uint8_t *src, int stride){
- int i, dc=0;
-
- for(i=0;i<16; i++){
- dc+= src[i-stride];
- }
- dc= 0x01010101*((dc + 8)>>4);
-
- for(i=0; i<16; i++){
- ((uint32_t*)(src+i*stride))[0]=
- ((uint32_t*)(src+i*stride))[1]=
- ((uint32_t*)(src+i*stride))[2]=
- ((uint32_t*)(src+i*stride))[3]= dc;
- }
-}
-
-void ff_pred16x16_128_dc_c(uint8_t *src, int stride){
- int i;
-
- for(i=0; i<16; i++){
- ((uint32_t*)(src+i*stride))[0]=
- ((uint32_t*)(src+i*stride))[1]=
- ((uint32_t*)(src+i*stride))[2]=
- ((uint32_t*)(src+i*stride))[3]= 0x01010101U*128U;
- }
-}
-
-static inline void pred16x16_plane_compat_c(uint8_t *src, int stride, const int svq3){
- int i, j, k;
- int a;
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
- const uint8_t * const src0 = src+7-stride;
- const uint8_t *src1 = src+8*stride-1;
- const uint8_t *src2 = src1-2*stride; // == src+6*stride-1;
- int H = src0[1] - src0[-1];
- int V = src1[0] - src2[ 0];
- for(k=2; k<=8; ++k) {
- src1 += stride; src2 -= stride;
- H += k*(src0[k] - src0[-k]);
- V += k*(src1[0] - src2[ 0]);
- }
- if(svq3){
- H = ( 5*(H/4) ) / 16;
- V = ( 5*(V/4) ) / 16;
-
- /* required for 100% accuracy */
- i = H; H = V; V = i;
- }else{
- H = ( 5*H+32 ) >> 6;
- V = ( 5*V+32 ) >> 6;
- }
-
- a = 16*(src1[0] + src2[16] + 1) - 7*(V+H);
- for(j=16; j>0; --j) {
- int b = a;
- a += V;
- for(i=-16; i<0; i+=4) {
- src[16+i] = cm[ (b ) >> 5 ];
- src[17+i] = cm[ (b+ H) >> 5 ];
- src[18+i] = cm[ (b+2*H) >> 5 ];
- src[19+i] = cm[ (b+3*H) >> 5 ];
- b += 4*H;
- }
- src += stride;
- }
-}
-
-void ff_pred16x16_plane_c(uint8_t *src, int stride){
- pred16x16_plane_compat_c(src, stride, 0);
-}
-
-void ff_pred8x8_vertical_c(uint8_t *src, int stride){
- int i;
- const uint32_t a= ((uint32_t*)(src-stride))[0];
- const uint32_t b= ((uint32_t*)(src-stride))[1];
-
- for(i=0; i<8; i++){
- ((uint32_t*)(src+i*stride))[0]= a;
- ((uint32_t*)(src+i*stride))[1]= b;
- }
-}
-
-void ff_pred8x8_horizontal_c(uint8_t *src, int stride){
- int i;
-
- for(i=0; i<8; i++){
- ((uint32_t*)(src+i*stride))[0]=
- ((uint32_t*)(src+i*stride))[1]= src[-1+i*stride]*0x01010101;
- }
-}
-
-void ff_pred8x8_128_dc_c(uint8_t *src, int stride){
- int i;
-
- for(i=0; i<8; i++){
- ((uint32_t*)(src+i*stride))[0]=
- ((uint32_t*)(src+i*stride))[1]= 0x01010101U*128U;
- }
-}
-
-static void pred8x8_left_dc_c(uint8_t *src, int stride){
- int i;
- int dc0, dc2;
-
- dc0=dc2=0;
- for(i=0;i<4; i++){
- dc0+= src[-1+i*stride];
- dc2+= src[-1+(i+4)*stride];
- }
- dc0= 0x01010101*((dc0 + 2)>>2);
- dc2= 0x01010101*((dc2 + 2)>>2);
-
- for(i=0; i<4; i++){
- ((uint32_t*)(src+i*stride))[0]=
- ((uint32_t*)(src+i*stride))[1]= dc0;
- }
- for(i=4; i<8; i++){
- ((uint32_t*)(src+i*stride))[0]=
- ((uint32_t*)(src+i*stride))[1]= dc2;
- }
-}
-
-static void pred8x8_top_dc_c(uint8_t *src, int stride){
- int i;
- int dc0, dc1;
-
- dc0=dc1=0;
- for(i=0;i<4; i++){
- dc0+= src[i-stride];
- dc1+= src[4+i-stride];
- }
- dc0= 0x01010101*((dc0 + 2)>>2);
- dc1= 0x01010101*((dc1 + 2)>>2);
-
- for(i=0; i<4; i++){
- ((uint32_t*)(src+i*stride))[0]= dc0;
- ((uint32_t*)(src+i*stride))[1]= dc1;
- }
- for(i=4; i<8; i++){
- ((uint32_t*)(src+i*stride))[0]= dc0;
- ((uint32_t*)(src+i*stride))[1]= dc1;
- }
-}
-
-
-void ff_pred8x8_dc_c(uint8_t *src, int stride){
- int i;
- int dc0, dc1, dc2, dc3;
-
- dc0=dc1=dc2=0;
- for(i=0;i<4; i++){
- dc0+= src[-1+i*stride] + src[i-stride];
- dc1+= src[4+i-stride];
- dc2+= src[-1+(i+4)*stride];
- }
- dc3= 0x01010101*((dc1 + dc2 + 4)>>3);
- dc0= 0x01010101*((dc0 + 4)>>3);
- dc1= 0x01010101*((dc1 + 2)>>2);
- dc2= 0x01010101*((dc2 + 2)>>2);
-
- for(i=0; i<4; i++){
- ((uint32_t*)(src+i*stride))[0]= dc0;
- ((uint32_t*)(src+i*stride))[1]= dc1;
- }
- for(i=4; i<8; i++){
- ((uint32_t*)(src+i*stride))[0]= dc2;
- ((uint32_t*)(src+i*stride))[1]= dc3;
- }
-}
-
-void ff_pred8x8_plane_c(uint8_t *src, int stride){
- int j, k;
- int a;
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
- const uint8_t * const src0 = src+3-stride;
- const uint8_t *src1 = src+4*stride-1;
- const uint8_t *src2 = src1-2*stride; // == src+2*stride-1;
- int H = src0[1] - src0[-1];
- int V = src1[0] - src2[ 0];
- for(k=2; k<=4; ++k) {
- src1 += stride; src2 -= stride;
- H += k*(src0[k] - src0[-k]);
- V += k*(src1[0] - src2[ 0]);
- }
- H = ( 17*H+16 ) >> 5;
- V = ( 17*V+16 ) >> 5;
-
- a = 16*(src1[0] + src2[8]+1) - 3*(V+H);
- for(j=8; j>0; --j) {
- int b = a;
- a += V;
- src[0] = cm[ (b ) >> 5 ];
- src[1] = cm[ (b+ H) >> 5 ];
- src[2] = cm[ (b+2*H) >> 5 ];
- src[3] = cm[ (b+3*H) >> 5 ];
- src[4] = cm[ (b+4*H) >> 5 ];
- src[5] = cm[ (b+5*H) >> 5 ];
- src[6] = cm[ (b+6*H) >> 5 ];
- src[7] = cm[ (b+7*H) >> 5 ];
- src += stride;
- }
-}
-
-#define SRC(x,y) src[(x)+(y)*stride]
-#define PL(y) \
- const int l##y = (SRC(-1,y-1) + 2*SRC(-1,y) + SRC(-1,y+1) + 2) >> 2;
-#define PREDICT_8x8_LOAD_LEFT \
- const int l0 = ((has_topleft ? SRC(-1,-1) : SRC(-1,0)) \
- + 2*SRC(-1,0) + SRC(-1,1) + 2) >> 2; \
- PL(1) PL(2) PL(3) PL(4) PL(5) PL(6) \
- const int l7 attribute_unused = (SRC(-1,6) + 3*SRC(-1,7) + 2) >> 2
-
-#define PT(x) \
- const int t##x = (SRC(x-1,-1) + 2*SRC(x,-1) + SRC(x+1,-1) + 2) >> 2;
-#define PREDICT_8x8_LOAD_TOP \
- const int t0 = ((has_topleft ? SRC(-1,-1) : SRC(0,-1)) \
- + 2*SRC(0,-1) + SRC(1,-1) + 2) >> 2; \
- PT(1) PT(2) PT(3) PT(4) PT(5) PT(6) \
- const int t7 attribute_unused = ((has_topright ? SRC(8,-1) : SRC(7,-1)) \
- + 2*SRC(7,-1) + SRC(6,-1) + 2) >> 2
-
-#define PTR(x) \
- t##x = (SRC(x-1,-1) + 2*SRC(x,-1) + SRC(x+1,-1) + 2) >> 2;
-#define PREDICT_8x8_LOAD_TOPRIGHT \
- int t8, t9, t10, t11, t12, t13, t14, t15; \
- if(has_topright) { \
- PTR(8) PTR(9) PTR(10) PTR(11) PTR(12) PTR(13) PTR(14) \
- t15 = (SRC(14,-1) + 3*SRC(15,-1) + 2) >> 2; \
- } else t8=t9=t10=t11=t12=t13=t14=t15= SRC(7,-1);
-
-#define PREDICT_8x8_LOAD_TOPLEFT \
- const int lt = (SRC(-1,0) + 2*SRC(-1,-1) + SRC(0,-1) + 2) >> 2
-
-#define PREDICT_8x8_DC(v) \
- int y; \
- for( y = 0; y < 8; y++ ) { \
- ((uint32_t*)src)[0] = \
- ((uint32_t*)src)[1] = v; \
- src += stride; \
- }
-
-static void pred8x8l_128_dc_c(uint8_t *src, int has_topleft, int has_topright, int stride)
-{
- PREDICT_8x8_DC(0x80808080);
-}
-static void pred8x8l_left_dc_c(uint8_t *src, int has_topleft, int has_topright, int stride)
-{
- PREDICT_8x8_LOAD_LEFT;
- const uint32_t dc = ((l0+l1+l2+l3+l4+l5+l6+l7+4) >> 3) * 0x01010101;
- PREDICT_8x8_DC(dc);
-}
-static void pred8x8l_top_dc_c(uint8_t *src, int has_topleft, int has_topright, int stride)
-{
- PREDICT_8x8_LOAD_TOP;
- const uint32_t dc = ((t0+t1+t2+t3+t4+t5+t6+t7+4) >> 3) * 0x01010101;
- PREDICT_8x8_DC(dc);
-}
-static void pred8x8l_dc_c(uint8_t *src, int has_topleft, int has_topright, int stride)
-{
- PREDICT_8x8_LOAD_LEFT;
- PREDICT_8x8_LOAD_TOP;
- const uint32_t dc = ((l0+l1+l2+l3+l4+l5+l6+l7
- +t0+t1+t2+t3+t4+t5+t6+t7+8) >> 4) * 0x01010101;
- PREDICT_8x8_DC(dc);
-}
-static void pred8x8l_horizontal_c(uint8_t *src, int has_topleft, int has_topright, int stride)
-{
- PREDICT_8x8_LOAD_LEFT;
-#define ROW(y) ((uint32_t*)(src+y*stride))[0] =\
- ((uint32_t*)(src+y*stride))[1] = 0x01010101 * l##y
- ROW(0); ROW(1); ROW(2); ROW(3); ROW(4); ROW(5); ROW(6); ROW(7);
-#undef ROW
-}
-static void pred8x8l_vertical_c(uint8_t *src, int has_topleft, int has_topright, int stride)
-{
- int y;
- PREDICT_8x8_LOAD_TOP;
- src[0] = t0;
- src[1] = t1;
- src[2] = t2;
- src[3] = t3;
- src[4] = t4;
- src[5] = t5;
- src[6] = t6;
- src[7] = t7;
- for( y = 1; y < 8; y++ )
- *(uint64_t*)(src+y*stride) = *(uint64_t*)src;
-}
-static void pred8x8l_down_left_c(uint8_t *src, int has_topleft, int has_topright, int stride)
-{
- PREDICT_8x8_LOAD_TOP;
- PREDICT_8x8_LOAD_TOPRIGHT;
- SRC(0,0)= (t0 + 2*t1 + t2 + 2) >> 2;
- SRC(0,1)=SRC(1,0)= (t1 + 2*t2 + t3 + 2) >> 2;
- SRC(0,2)=SRC(1,1)=SRC(2,0)= (t2 + 2*t3 + t4 + 2) >> 2;
- SRC(0,3)=SRC(1,2)=SRC(2,1)=SRC(3,0)= (t3 + 2*t4 + t5 + 2) >> 2;
- SRC(0,4)=SRC(1,3)=SRC(2,2)=SRC(3,1)=SRC(4,0)= (t4 + 2*t5 + t6 + 2) >> 2;
- SRC(0,5)=SRC(1,4)=SRC(2,3)=SRC(3,2)=SRC(4,1)=SRC(5,0)= (t5 + 2*t6 + t7 + 2) >> 2;
- SRC(0,6)=SRC(1,5)=SRC(2,4)=SRC(3,3)=SRC(4,2)=SRC(5,1)=SRC(6,0)= (t6 + 2*t7 + t8 + 2) >> 2;
- SRC(0,7)=SRC(1,6)=SRC(2,5)=SRC(3,4)=SRC(4,3)=SRC(5,2)=SRC(6,1)=SRC(7,0)= (t7 + 2*t8 + t9 + 2) >> 2;
- SRC(1,7)=SRC(2,6)=SRC(3,5)=SRC(4,4)=SRC(5,3)=SRC(6,2)=SRC(7,1)= (t8 + 2*t9 + t10 + 2) >> 2;
- SRC(2,7)=SRC(3,6)=SRC(4,5)=SRC(5,4)=SRC(6,3)=SRC(7,2)= (t9 + 2*t10 + t11 + 2) >> 2;
- SRC(3,7)=SRC(4,6)=SRC(5,5)=SRC(6,4)=SRC(7,3)= (t10 + 2*t11 + t12 + 2) >> 2;
- SRC(4,7)=SRC(5,6)=SRC(6,5)=SRC(7,4)= (t11 + 2*t12 + t13 + 2) >> 2;
- SRC(5,7)=SRC(6,6)=SRC(7,5)= (t12 + 2*t13 + t14 + 2) >> 2;
- SRC(6,7)=SRC(7,6)= (t13 + 2*t14 + t15 + 2) >> 2;
- SRC(7,7)= (t14 + 3*t15 + 2) >> 2;
-}
-static void pred8x8l_down_right_c(uint8_t *src, int has_topleft, int has_topright, int stride)
-{
- PREDICT_8x8_LOAD_TOP;
- PREDICT_8x8_LOAD_LEFT;
- PREDICT_8x8_LOAD_TOPLEFT;
- SRC(0,7)= (l7 + 2*l6 + l5 + 2) >> 2;
- SRC(0,6)=SRC(1,7)= (l6 + 2*l5 + l4 + 2) >> 2;
- SRC(0,5)=SRC(1,6)=SRC(2,7)= (l5 + 2*l4 + l3 + 2) >> 2;
- SRC(0,4)=SRC(1,5)=SRC(2,6)=SRC(3,7)= (l4 + 2*l3 + l2 + 2) >> 2;
- SRC(0,3)=SRC(1,4)=SRC(2,5)=SRC(3,6)=SRC(4,7)= (l3 + 2*l2 + l1 + 2) >> 2;
- SRC(0,2)=SRC(1,3)=SRC(2,4)=SRC(3,5)=SRC(4,6)=SRC(5,7)= (l2 + 2*l1 + l0 + 2) >> 2;
- SRC(0,1)=SRC(1,2)=SRC(2,3)=SRC(3,4)=SRC(4,5)=SRC(5,6)=SRC(6,7)= (l1 + 2*l0 + lt + 2) >> 2;
- SRC(0,0)=SRC(1,1)=SRC(2,2)=SRC(3,3)=SRC(4,4)=SRC(5,5)=SRC(6,6)=SRC(7,7)= (l0 + 2*lt + t0 + 2) >> 2;
- SRC(1,0)=SRC(2,1)=SRC(3,2)=SRC(4,3)=SRC(5,4)=SRC(6,5)=SRC(7,6)= (lt + 2*t0 + t1 + 2) >> 2;
- SRC(2,0)=SRC(3,1)=SRC(4,2)=SRC(5,3)=SRC(6,4)=SRC(7,5)= (t0 + 2*t1 + t2 + 2) >> 2;
- SRC(3,0)=SRC(4,1)=SRC(5,2)=SRC(6,3)=SRC(7,4)= (t1 + 2*t2 + t3 + 2) >> 2;
- SRC(4,0)=SRC(5,1)=SRC(6,2)=SRC(7,3)= (t2 + 2*t3 + t4 + 2) >> 2;
- SRC(5,0)=SRC(6,1)=SRC(7,2)= (t3 + 2*t4 + t5 + 2) >> 2;
- SRC(6,0)=SRC(7,1)= (t4 + 2*t5 + t6 + 2) >> 2;
- SRC(7,0)= (t5 + 2*t6 + t7 + 2) >> 2;
-
-}
-static void pred8x8l_vertical_right_c(uint8_t *src, int has_topleft, int has_topright, int stride)
-{
- PREDICT_8x8_LOAD_TOP;
- PREDICT_8x8_LOAD_LEFT;
- PREDICT_8x8_LOAD_TOPLEFT;
- SRC(0,6)= (l5 + 2*l4 + l3 + 2) >> 2;
- SRC(0,7)= (l6 + 2*l5 + l4 + 2) >> 2;
- SRC(0,4)=SRC(1,6)= (l3 + 2*l2 + l1 + 2) >> 2;
- SRC(0,5)=SRC(1,7)= (l4 + 2*l3 + l2 + 2) >> 2;
- SRC(0,2)=SRC(1,4)=SRC(2,6)= (l1 + 2*l0 + lt + 2) >> 2;
- SRC(0,3)=SRC(1,5)=SRC(2,7)= (l2 + 2*l1 + l0 + 2) >> 2;
- SRC(0,1)=SRC(1,3)=SRC(2,5)=SRC(3,7)= (l0 + 2*lt + t0 + 2) >> 2;
- SRC(0,0)=SRC(1,2)=SRC(2,4)=SRC(3,6)= (lt + t0 + 1) >> 1;
- SRC(1,1)=SRC(2,3)=SRC(3,5)=SRC(4,7)= (lt + 2*t0 + t1 + 2) >> 2;
- SRC(1,0)=SRC(2,2)=SRC(3,4)=SRC(4,6)= (t0 + t1 + 1) >> 1;
- SRC(2,1)=SRC(3,3)=SRC(4,5)=SRC(5,7)= (t0 + 2*t1 + t2 + 2) >> 2;
- SRC(2,0)=SRC(3,2)=SRC(4,4)=SRC(5,6)= (t1 + t2 + 1) >> 1;
- SRC(3,1)=SRC(4,3)=SRC(5,5)=SRC(6,7)= (t1 + 2*t2 + t3 + 2) >> 2;
- SRC(3,0)=SRC(4,2)=SRC(5,4)=SRC(6,6)= (t2 + t3 + 1) >> 1;
- SRC(4,1)=SRC(5,3)=SRC(6,5)=SRC(7,7)= (t2 + 2*t3 + t4 + 2) >> 2;
- SRC(4,0)=SRC(5,2)=SRC(6,4)=SRC(7,6)= (t3 + t4 + 1) >> 1;
- SRC(5,1)=SRC(6,3)=SRC(7,5)= (t3 + 2*t4 + t5 + 2) >> 2;
- SRC(5,0)=SRC(6,2)=SRC(7,4)= (t4 + t5 + 1) >> 1;
- SRC(6,1)=SRC(7,3)= (t4 + 2*t5 + t6 + 2) >> 2;
- SRC(6,0)=SRC(7,2)= (t5 + t6 + 1) >> 1;
- SRC(7,1)= (t5 + 2*t6 + t7 + 2) >> 2;
- SRC(7,0)= (t6 + t7 + 1) >> 1;
-}
-static void pred8x8l_horizontal_down_c(uint8_t *src, int has_topleft, int has_topright, int stride)
-{
- PREDICT_8x8_LOAD_TOP;
- PREDICT_8x8_LOAD_LEFT;
- PREDICT_8x8_LOAD_TOPLEFT;
- SRC(0,7)= (l6 + l7 + 1) >> 1;
- SRC(1,7)= (l5 + 2*l6 + l7 + 2) >> 2;
- SRC(0,6)=SRC(2,7)= (l5 + l6 + 1) >> 1;
- SRC(1,6)=SRC(3,7)= (l4 + 2*l5 + l6 + 2) >> 2;
- SRC(0,5)=SRC(2,6)=SRC(4,7)= (l4 + l5 + 1) >> 1;
- SRC(1,5)=SRC(3,6)=SRC(5,7)= (l3 + 2*l4 + l5 + 2) >> 2;
- SRC(0,4)=SRC(2,5)=SRC(4,6)=SRC(6,7)= (l3 + l4 + 1) >> 1;
- SRC(1,4)=SRC(3,5)=SRC(5,6)=SRC(7,7)= (l2 + 2*l3 + l4 + 2) >> 2;
- SRC(0,3)=SRC(2,4)=SRC(4,5)=SRC(6,6)= (l2 + l3 + 1) >> 1;
- SRC(1,3)=SRC(3,4)=SRC(5,5)=SRC(7,6)= (l1 + 2*l2 + l3 + 2) >> 2;
- SRC(0,2)=SRC(2,3)=SRC(4,4)=SRC(6,5)= (l1 + l2 + 1) >> 1;
- SRC(1,2)=SRC(3,3)=SRC(5,4)=SRC(7,5)= (l0 + 2*l1 + l2 + 2) >> 2;
- SRC(0,1)=SRC(2,2)=SRC(4,3)=SRC(6,4)= (l0 + l1 + 1) >> 1;
- SRC(1,1)=SRC(3,2)=SRC(5,3)=SRC(7,4)= (lt + 2*l0 + l1 + 2) >> 2;
- SRC(0,0)=SRC(2,1)=SRC(4,2)=SRC(6,3)= (lt + l0 + 1) >> 1;
- SRC(1,0)=SRC(3,1)=SRC(5,2)=SRC(7,3)= (l0 + 2*lt + t0 + 2) >> 2;
- SRC(2,0)=SRC(4,1)=SRC(6,2)= (t1 + 2*t0 + lt + 2) >> 2;
- SRC(3,0)=SRC(5,1)=SRC(7,2)= (t2 + 2*t1 + t0 + 2) >> 2;
- SRC(4,0)=SRC(6,1)= (t3 + 2*t2 + t1 + 2) >> 2;
- SRC(5,0)=SRC(7,1)= (t4 + 2*t3 + t2 + 2) >> 2;
- SRC(6,0)= (t5 + 2*t4 + t3 + 2) >> 2;
- SRC(7,0)= (t6 + 2*t5 + t4 + 2) >> 2;
-}
-static void pred8x8l_vertical_left_c(uint8_t *src, int has_topleft, int has_topright, int stride)
-{
- PREDICT_8x8_LOAD_TOP;
- PREDICT_8x8_LOAD_TOPRIGHT;
- SRC(0,0)= (t0 + t1 + 1) >> 1;
- SRC(0,1)= (t0 + 2*t1 + t2 + 2) >> 2;
- SRC(0,2)=SRC(1,0)= (t1 + t2 + 1) >> 1;
- SRC(0,3)=SRC(1,1)= (t1 + 2*t2 + t3 + 2) >> 2;
- SRC(0,4)=SRC(1,2)=SRC(2,0)= (t2 + t3 + 1) >> 1;
- SRC(0,5)=SRC(1,3)=SRC(2,1)= (t2 + 2*t3 + t4 + 2) >> 2;
- SRC(0,6)=SRC(1,4)=SRC(2,2)=SRC(3,0)= (t3 + t4 + 1) >> 1;
- SRC(0,7)=SRC(1,5)=SRC(2,3)=SRC(3,1)= (t3 + 2*t4 + t5 + 2) >> 2;
- SRC(1,6)=SRC(2,4)=SRC(3,2)=SRC(4,0)= (t4 + t5 + 1) >> 1;
- SRC(1,7)=SRC(2,5)=SRC(3,3)=SRC(4,1)= (t4 + 2*t5 + t6 + 2) >> 2;
- SRC(2,6)=SRC(3,4)=SRC(4,2)=SRC(5,0)= (t5 + t6 + 1) >> 1;
- SRC(2,7)=SRC(3,5)=SRC(4,3)=SRC(5,1)= (t5 + 2*t6 + t7 + 2) >> 2;
- SRC(3,6)=SRC(4,4)=SRC(5,2)=SRC(6,0)= (t6 + t7 + 1) >> 1;
- SRC(3,7)=SRC(4,5)=SRC(5,3)=SRC(6,1)= (t6 + 2*t7 + t8 + 2) >> 2;
- SRC(4,6)=SRC(5,4)=SRC(6,2)=SRC(7,0)= (t7 + t8 + 1) >> 1;
- SRC(4,7)=SRC(5,5)=SRC(6,3)=SRC(7,1)= (t7 + 2*t8 + t9 + 2) >> 2;
- SRC(5,6)=SRC(6,4)=SRC(7,2)= (t8 + t9 + 1) >> 1;
- SRC(5,7)=SRC(6,5)=SRC(7,3)= (t8 + 2*t9 + t10 + 2) >> 2;
- SRC(6,6)=SRC(7,4)= (t9 + t10 + 1) >> 1;
- SRC(6,7)=SRC(7,5)= (t9 + 2*t10 + t11 + 2) >> 2;
- SRC(7,6)= (t10 + t11 + 1) >> 1;
- SRC(7,7)= (t10 + 2*t11 + t12 + 2) >> 2;
-}
-static void pred8x8l_horizontal_up_c(uint8_t *src, int has_topleft, int has_topright, int stride)
-{
- PREDICT_8x8_LOAD_LEFT;
- SRC(0,0)= (l0 + l1 + 1) >> 1;
- SRC(1,0)= (l0 + 2*l1 + l2 + 2) >> 2;
- SRC(0,1)=SRC(2,0)= (l1 + l2 + 1) >> 1;
- SRC(1,1)=SRC(3,0)= (l1 + 2*l2 + l3 + 2) >> 2;
- SRC(0,2)=SRC(2,1)=SRC(4,0)= (l2 + l3 + 1) >> 1;
- SRC(1,2)=SRC(3,1)=SRC(5,0)= (l2 + 2*l3 + l4 + 2) >> 2;
- SRC(0,3)=SRC(2,2)=SRC(4,1)=SRC(6,0)= (l3 + l4 + 1) >> 1;
- SRC(1,3)=SRC(3,2)=SRC(5,1)=SRC(7,0)= (l3 + 2*l4 + l5 + 2) >> 2;
- SRC(0,4)=SRC(2,3)=SRC(4,2)=SRC(6,1)= (l4 + l5 + 1) >> 1;
- SRC(1,4)=SRC(3,3)=SRC(5,2)=SRC(7,1)= (l4 + 2*l5 + l6 + 2) >> 2;
- SRC(0,5)=SRC(2,4)=SRC(4,3)=SRC(6,2)= (l5 + l6 + 1) >> 1;
- SRC(1,5)=SRC(3,4)=SRC(5,3)=SRC(7,2)= (l5 + 2*l6 + l7 + 2) >> 2;
- SRC(0,6)=SRC(2,5)=SRC(4,4)=SRC(6,3)= (l6 + l7 + 1) >> 1;
- SRC(1,6)=SRC(3,5)=SRC(5,4)=SRC(7,3)= (l6 + 3*l7 + 2) >> 2;
- SRC(0,7)=SRC(1,7)=SRC(2,6)=SRC(2,7)=SRC(3,6)=
- SRC(3,7)=SRC(4,5)=SRC(4,6)=SRC(4,7)=SRC(5,5)=
- SRC(5,6)=SRC(5,7)=SRC(6,4)=SRC(6,5)=SRC(6,6)=
- SRC(6,7)=SRC(7,4)=SRC(7,5)=SRC(7,6)=SRC(7,7)= l7;
-}
-#undef PREDICT_8x8_LOAD_LEFT
-#undef PREDICT_8x8_LOAD_TOP
-#undef PREDICT_8x8_LOAD_TOPLEFT
-#undef PREDICT_8x8_LOAD_TOPRIGHT
-#undef PREDICT_8x8_DC
-#undef PTR
-#undef PT
-#undef PL
-#undef SRC
-
-static inline void mc_dir_part(H264Context *h, Picture *pic, int n, int square, int chroma_height, int delta, int list,
- uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
- int src_x_offset, int src_y_offset,
- qpel_mc_func *qpix_op, h264_chroma_mc_func chroma_op){
- MpegEncContext * const s = &h->s;
- const int mx= h->mv_cache[list][ scan8[n] ][0] + src_x_offset*8;
- int my= h->mv_cache[list][ scan8[n] ][1] + src_y_offset*8;
- const int luma_xy= (mx&3) + ((my&3)<<2);
- uint8_t * src_y = pic->data[0] + (mx>>2) + (my>>2)*h->mb_linesize;
- uint8_t * src_cb, * src_cr;
- int extra_width= h->emu_edge_width;
- int extra_height= h->emu_edge_height;
- int emu=0;
- const int full_mx= mx>>2;
- const int full_my= my>>2;
- const int pic_width = 16*s->mb_width;
- const int pic_height = 16*s->mb_height >> MB_MBAFF;
-
- if(!pic->data[0]) //FIXME this is unacceptable, some senseable error concealment must be done for missing reference frames
- return;
-
- if(mx&7) extra_width -= 3;
- if(my&7) extra_height -= 3;
-
- if( full_mx < 0-extra_width
- || full_my < 0-extra_height
- || full_mx + 16/*FIXME*/ > pic_width + extra_width
- || full_my + 16/*FIXME*/ > pic_height + extra_height){
- ff_emulated_edge_mc(s->edge_emu_buffer, src_y - 2 - 2*h->mb_linesize, h->mb_linesize, 16+5, 16+5/*FIXME*/, full_mx-2, full_my-2, pic_width, pic_height);
- src_y= s->edge_emu_buffer + 2 + 2*h->mb_linesize;
- emu=1;
- }
-
- qpix_op[luma_xy](dest_y, src_y, h->mb_linesize); //FIXME try variable height perhaps?
- if(!square){
- qpix_op[luma_xy](dest_y + delta, src_y + delta, h->mb_linesize);
- }
-
- if(s->flags&CODEC_FLAG_GRAY) return;
-
- if(MB_MBAFF){
- // chroma offset when predicting from a field of opposite parity
- my += 2 * ((s->mb_y & 1) - (h->ref_cache[list][scan8[n]] & 1));
- emu |= (my>>3) < 0 || (my>>3) + 8 >= (pic_height>>1);
- }
- src_cb= pic->data[1] + (mx>>3) + (my>>3)*h->mb_uvlinesize;
- src_cr= pic->data[2] + (mx>>3) + (my>>3)*h->mb_uvlinesize;
-
- if(emu){
- ff_emulated_edge_mc(s->edge_emu_buffer, src_cb, h->mb_uvlinesize, 9, 9/*FIXME*/, (mx>>3), (my>>3), pic_width>>1, pic_height>>1);
- src_cb= s->edge_emu_buffer;
- }
- chroma_op(dest_cb, src_cb, h->mb_uvlinesize, chroma_height, mx&7, my&7);
-
- if(emu){
- ff_emulated_edge_mc(s->edge_emu_buffer, src_cr, h->mb_uvlinesize, 9, 9/*FIXME*/, (mx>>3), (my>>3), pic_width>>1, pic_height>>1);
- src_cr= s->edge_emu_buffer;
- }
- chroma_op(dest_cr, src_cr, h->mb_uvlinesize, chroma_height, mx&7, my&7);
-}
-
-static inline void mc_part_std(H264Context *h, int n, int square, int chroma_height, int delta,
- uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
- int x_offset, int y_offset,
- qpel_mc_func *qpix_put, h264_chroma_mc_func chroma_put,
- qpel_mc_func *qpix_avg, h264_chroma_mc_func chroma_avg,
- int list0, int list1){
- MpegEncContext * const s = &h->s;
- qpel_mc_func *qpix_op= qpix_put;
- h264_chroma_mc_func chroma_op= chroma_put;
-
- dest_y += 2*x_offset + 2*y_offset*h-> mb_linesize;
- dest_cb += x_offset + y_offset*h->mb_uvlinesize;
- dest_cr += x_offset + y_offset*h->mb_uvlinesize;
- x_offset += 8*s->mb_x;
- y_offset += 8*(s->mb_y >> MB_MBAFF);
-
- if(list0){
- Picture *ref= &h->ref_list[0][ h->ref_cache[0][ scan8[n] ] ];
- mc_dir_part(h, ref, n, square, chroma_height, delta, 0,
- dest_y, dest_cb, dest_cr, x_offset, y_offset,
- qpix_op, chroma_op);
-
- qpix_op= qpix_avg;
- chroma_op= chroma_avg;
- }
-
- if(list1){
- Picture *ref= &h->ref_list[1][ h->ref_cache[1][ scan8[n] ] ];
- mc_dir_part(h, ref, n, square, chroma_height, delta, 1,
- dest_y, dest_cb, dest_cr, x_offset, y_offset,
- qpix_op, chroma_op);
- }
-}
-
-static inline void mc_part_weighted(H264Context *h, int n, int square, int chroma_height, int delta,
- uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
- int x_offset, int y_offset,
- qpel_mc_func *qpix_put, h264_chroma_mc_func chroma_put,
- h264_weight_func luma_weight_op, h264_weight_func chroma_weight_op,
- h264_biweight_func luma_weight_avg, h264_biweight_func chroma_weight_avg,
- int list0, int list1){
- MpegEncContext * const s = &h->s;
-
- dest_y += 2*x_offset + 2*y_offset*h-> mb_linesize;
- dest_cb += x_offset + y_offset*h->mb_uvlinesize;
- dest_cr += x_offset + y_offset*h->mb_uvlinesize;
- x_offset += 8*s->mb_x;
- y_offset += 8*(s->mb_y >> MB_MBAFF);
-
- if(list0 && list1){
- /* don't optimize for luma-only case, since B-frames usually
- * use implicit weights => chroma too. */
- uint8_t *tmp_cb = s->obmc_scratchpad;
- uint8_t *tmp_cr = s->obmc_scratchpad + 8;
- uint8_t *tmp_y = s->obmc_scratchpad + 8*h->mb_uvlinesize;
- int refn0 = h->ref_cache[0][ scan8[n] ];
- int refn1 = h->ref_cache[1][ scan8[n] ];
-
- mc_dir_part(h, &h->ref_list[0][refn0], n, square, chroma_height, delta, 0,
- dest_y, dest_cb, dest_cr,
- x_offset, y_offset, qpix_put, chroma_put);
- mc_dir_part(h, &h->ref_list[1][refn1], n, square, chroma_height, delta, 1,
- tmp_y, tmp_cb, tmp_cr,
- x_offset, y_offset, qpix_put, chroma_put);
-
- if(h->use_weight == 2){
- int weight0 = h->implicit_weight[refn0][refn1];
- int weight1 = 64 - weight0;
- luma_weight_avg( dest_y, tmp_y, h-> mb_linesize, 5, weight0, weight1, 0);
- chroma_weight_avg(dest_cb, tmp_cb, h->mb_uvlinesize, 5, weight0, weight1, 0);
- chroma_weight_avg(dest_cr, tmp_cr, h->mb_uvlinesize, 5, weight0, weight1, 0);
- }else{
- luma_weight_avg(dest_y, tmp_y, h->mb_linesize, h->luma_log2_weight_denom,
- h->luma_weight[0][refn0], h->luma_weight[1][refn1],
- h->luma_offset[0][refn0] + h->luma_offset[1][refn1]);
- chroma_weight_avg(dest_cb, tmp_cb, h->mb_uvlinesize, h->chroma_log2_weight_denom,
- h->chroma_weight[0][refn0][0], h->chroma_weight[1][refn1][0],
- h->chroma_offset[0][refn0][0] + h->chroma_offset[1][refn1][0]);
- chroma_weight_avg(dest_cr, tmp_cr, h->mb_uvlinesize, h->chroma_log2_weight_denom,
- h->chroma_weight[0][refn0][1], h->chroma_weight[1][refn1][1],
- h->chroma_offset[0][refn0][1] + h->chroma_offset[1][refn1][1]);
- }
- }else{
- int list = list1 ? 1 : 0;
- int refn = h->ref_cache[list][ scan8[n] ];
- Picture *ref= &h->ref_list[list][refn];
- mc_dir_part(h, ref, n, square, chroma_height, delta, list,
- dest_y, dest_cb, dest_cr, x_offset, y_offset,
- qpix_put, chroma_put);
-
- luma_weight_op(dest_y, h->mb_linesize, h->luma_log2_weight_denom,
- h->luma_weight[list][refn], h->luma_offset[list][refn]);
- if(h->use_weight_chroma){
- chroma_weight_op(dest_cb, h->mb_uvlinesize, h->chroma_log2_weight_denom,
- h->chroma_weight[list][refn][0], h->chroma_offset[list][refn][0]);
- chroma_weight_op(dest_cr, h->mb_uvlinesize, h->chroma_log2_weight_denom,
- h->chroma_weight[list][refn][1], h->chroma_offset[list][refn][1]);
- }
- }
-}
-
-static inline void mc_part(H264Context *h, int n, int square, int chroma_height, int delta,
- uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
- int x_offset, int y_offset,
- qpel_mc_func *qpix_put, h264_chroma_mc_func chroma_put,
- qpel_mc_func *qpix_avg, h264_chroma_mc_func chroma_avg,
- h264_weight_func *weight_op, h264_biweight_func *weight_avg,
- int list0, int list1){
- if((h->use_weight==2 && list0 && list1
- && (h->implicit_weight[ h->ref_cache[0][scan8[n]] ][ h->ref_cache[1][scan8[n]] ] != 32))
- || h->use_weight==1)
- mc_part_weighted(h, n, square, chroma_height, delta, dest_y, dest_cb, dest_cr,
- x_offset, y_offset, qpix_put, chroma_put,
- weight_op[0], weight_op[3], weight_avg[0], weight_avg[3], list0, list1);
- else
- mc_part_std(h, n, square, chroma_height, delta, dest_y, dest_cb, dest_cr,
- x_offset, y_offset, qpix_put, chroma_put, qpix_avg, chroma_avg, list0, list1);
-}
-
-static inline void prefetch_motion(H264Context *h, int list){
- /* fetch pixels for estimated mv 4 macroblocks ahead
- * optimized for 64byte cache lines */
- MpegEncContext * const s = &h->s;
- const int refn = h->ref_cache[list][scan8[0]];
- if(refn >= 0){
- const int mx= (h->mv_cache[list][scan8[0]][0]>>2) + 16*s->mb_x + 8;
- const int my= (h->mv_cache[list][scan8[0]][1]>>2) + 16*s->mb_y;
- uint8_t **src= h->ref_list[list][refn].data;
- int off= mx + (my + (s->mb_x&3)*4)*h->mb_linesize + 64;
- s->dsp.prefetch(src[0]+off, s->linesize, 4);
- off= (mx>>1) + ((my>>1) + (s->mb_x&7))*s->uvlinesize + 64;
- s->dsp.prefetch(src[1]+off, src[2]-src[1], 2);
- }
-}
-
-static void hl_motion(H264Context *h, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
- qpel_mc_func (*qpix_put)[16], h264_chroma_mc_func (*chroma_put),
- qpel_mc_func (*qpix_avg)[16], h264_chroma_mc_func (*chroma_avg),
- h264_weight_func *weight_op, h264_biweight_func *weight_avg){
- MpegEncContext * const s = &h->s;
- const int mb_xy= s->mb_x + s->mb_y*s->mb_stride;
- const int mb_type= s->current_picture.mb_type[mb_xy];
-
- assert(IS_INTER(mb_type));
-
- prefetch_motion(h, 0);
-
- if(IS_16X16(mb_type)){
- mc_part(h, 0, 1, 8, 0, dest_y, dest_cb, dest_cr, 0, 0,
- qpix_put[0], chroma_put[0], qpix_avg[0], chroma_avg[0],
- &weight_op[0], &weight_avg[0],
- IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1));
- }else if(IS_16X8(mb_type)){
- mc_part(h, 0, 0, 4, 8, dest_y, dest_cb, dest_cr, 0, 0,
- qpix_put[1], chroma_put[0], qpix_avg[1], chroma_avg[0],
- &weight_op[1], &weight_avg[1],
- IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1));
- mc_part(h, 8, 0, 4, 8, dest_y, dest_cb, dest_cr, 0, 4,
- qpix_put[1], chroma_put[0], qpix_avg[1], chroma_avg[0],
- &weight_op[1], &weight_avg[1],
- IS_DIR(mb_type, 1, 0), IS_DIR(mb_type, 1, 1));
- }else if(IS_8X16(mb_type)){
- mc_part(h, 0, 0, 8, 8*h->mb_linesize, dest_y, dest_cb, dest_cr, 0, 0,
- qpix_put[1], chroma_put[1], qpix_avg[1], chroma_avg[1],
- &weight_op[2], &weight_avg[2],
- IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1));
- mc_part(h, 4, 0, 8, 8*h->mb_linesize, dest_y, dest_cb, dest_cr, 4, 0,
- qpix_put[1], chroma_put[1], qpix_avg[1], chroma_avg[1],
- &weight_op[2], &weight_avg[2],
- IS_DIR(mb_type, 1, 0), IS_DIR(mb_type, 1, 1));
- }else{
- int i;
-
- assert(IS_8X8(mb_type));
-
- for(i=0; i<4; i++){
- const int sub_mb_type= h->sub_mb_type[i];
- const int n= 4*i;
- int x_offset= (i&1)<<2;
- int y_offset= (i&2)<<1;
-
- if(IS_SUB_8X8(sub_mb_type)){
- mc_part(h, n, 1, 4, 0, dest_y, dest_cb, dest_cr, x_offset, y_offset,
- qpix_put[1], chroma_put[1], qpix_avg[1], chroma_avg[1],
- &weight_op[3], &weight_avg[3],
- IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1));
- }else if(IS_SUB_8X4(sub_mb_type)){
- mc_part(h, n , 0, 2, 4, dest_y, dest_cb, dest_cr, x_offset, y_offset,
- qpix_put[2], chroma_put[1], qpix_avg[2], chroma_avg[1],
- &weight_op[4], &weight_avg[4],
- IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1));
- mc_part(h, n+2, 0, 2, 4, dest_y, dest_cb, dest_cr, x_offset, y_offset+2,
- qpix_put[2], chroma_put[1], qpix_avg[2], chroma_avg[1],
- &weight_op[4], &weight_avg[4],
- IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1));
- }else if(IS_SUB_4X8(sub_mb_type)){
- mc_part(h, n , 0, 4, 4*h->mb_linesize, dest_y, dest_cb, dest_cr, x_offset, y_offset,
- qpix_put[2], chroma_put[2], qpix_avg[2], chroma_avg[2],
- &weight_op[5], &weight_avg[5],
- IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1));
- mc_part(h, n+1, 0, 4, 4*h->mb_linesize, dest_y, dest_cb, dest_cr, x_offset+2, y_offset,
- qpix_put[2], chroma_put[2], qpix_avg[2], chroma_avg[2],
- &weight_op[5], &weight_avg[5],
- IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1));
- }else{
- int j;
- assert(IS_SUB_4X4(sub_mb_type));
- for(j=0; j<4; j++){
- int sub_x_offset= x_offset + 2*(j&1);
- int sub_y_offset= y_offset + (j&2);
- mc_part(h, n+j, 1, 2, 0, dest_y, dest_cb, dest_cr, sub_x_offset, sub_y_offset,
- qpix_put[2], chroma_put[2], qpix_avg[2], chroma_avg[2],
- &weight_op[6], &weight_avg[6],
- IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1));
- }
- }
- }
- }
-
- prefetch_motion(h, 1);
-}
-
-static void decode_init_vlc(){
- static int done = 0;
-
- if (!done) {
- int i;
- done = 1;
-
- init_vlc(&chroma_dc_coeff_token_vlc, CHROMA_DC_COEFF_TOKEN_VLC_BITS, 4*5,
- &chroma_dc_coeff_token_len [0], 1, 1,
- &chroma_dc_coeff_token_bits[0], 1, 1, 1);
-
- for(i=0; i<4; i++){
- init_vlc(&coeff_token_vlc[i], COEFF_TOKEN_VLC_BITS, 4*17,
- &coeff_token_len [i][0], 1, 1,
- &coeff_token_bits[i][0], 1, 1, 1);
- }
-
- for(i=0; i<3; i++){
- init_vlc(&chroma_dc_total_zeros_vlc[i], CHROMA_DC_TOTAL_ZEROS_VLC_BITS, 4,
- &chroma_dc_total_zeros_len [i][0], 1, 1,
- &chroma_dc_total_zeros_bits[i][0], 1, 1, 1);
- }
- for(i=0; i<15; i++){
- init_vlc(&total_zeros_vlc[i], TOTAL_ZEROS_VLC_BITS, 16,
- &total_zeros_len [i][0], 1, 1,
- &total_zeros_bits[i][0], 1, 1, 1);
- }
-
- for(i=0; i<6; i++){
- init_vlc(&run_vlc[i], RUN_VLC_BITS, 7,
- &run_len [i][0], 1, 1,
- &run_bits[i][0], 1, 1, 1);
- }
- init_vlc(&run7_vlc, RUN7_VLC_BITS, 16,
- &run_len [6][0], 1, 1,
- &run_bits[6][0], 1, 1, 1);
- }
-}
-
-/**
- * Sets the intra prediction function pointers.
- */
-static void init_pred_ptrs(H264Context *h){
-// MpegEncContext * const s = &h->s;
-
- h->pred4x4[VERT_PRED ]= pred4x4_vertical_c;
- h->pred4x4[HOR_PRED ]= pred4x4_horizontal_c;
- h->pred4x4[DC_PRED ]= pred4x4_dc_c;
- h->pred4x4[DIAG_DOWN_LEFT_PRED ]= pred4x4_down_left_c;
- h->pred4x4[DIAG_DOWN_RIGHT_PRED]= pred4x4_down_right_c;
- h->pred4x4[VERT_RIGHT_PRED ]= pred4x4_vertical_right_c;
- h->pred4x4[HOR_DOWN_PRED ]= pred4x4_horizontal_down_c;
- h->pred4x4[VERT_LEFT_PRED ]= pred4x4_vertical_left_c;
- h->pred4x4[HOR_UP_PRED ]= pred4x4_horizontal_up_c;
- h->pred4x4[LEFT_DC_PRED ]= pred4x4_left_dc_c;
- h->pred4x4[TOP_DC_PRED ]= pred4x4_top_dc_c;
- h->pred4x4[DC_128_PRED ]= pred4x4_128_dc_c;
-
- h->pred8x8l[VERT_PRED ]= pred8x8l_vertical_c;
- h->pred8x8l[HOR_PRED ]= pred8x8l_horizontal_c;
- h->pred8x8l[DC_PRED ]= pred8x8l_dc_c;
- h->pred8x8l[DIAG_DOWN_LEFT_PRED ]= pred8x8l_down_left_c;
- h->pred8x8l[DIAG_DOWN_RIGHT_PRED]= pred8x8l_down_right_c;
- h->pred8x8l[VERT_RIGHT_PRED ]= pred8x8l_vertical_right_c;
- h->pred8x8l[HOR_DOWN_PRED ]= pred8x8l_horizontal_down_c;
- h->pred8x8l[VERT_LEFT_PRED ]= pred8x8l_vertical_left_c;
- h->pred8x8l[HOR_UP_PRED ]= pred8x8l_horizontal_up_c;
- h->pred8x8l[LEFT_DC_PRED ]= pred8x8l_left_dc_c;
- h->pred8x8l[TOP_DC_PRED ]= pred8x8l_top_dc_c;
- h->pred8x8l[DC_128_PRED ]= pred8x8l_128_dc_c;
-
- h->pred8x8[DC_PRED8x8 ]= ff_pred8x8_dc_c;
- h->pred8x8[VERT_PRED8x8 ]= ff_pred8x8_vertical_c;
- h->pred8x8[HOR_PRED8x8 ]= ff_pred8x8_horizontal_c;
- h->pred8x8[PLANE_PRED8x8 ]= ff_pred8x8_plane_c;
- h->pred8x8[LEFT_DC_PRED8x8]= pred8x8_left_dc_c;
- h->pred8x8[TOP_DC_PRED8x8 ]= pred8x8_top_dc_c;
- h->pred8x8[DC_128_PRED8x8 ]= ff_pred8x8_128_dc_c;
-
- h->pred16x16[DC_PRED8x8 ]= ff_pred16x16_dc_c;
- h->pred16x16[VERT_PRED8x8 ]= ff_pred16x16_vertical_c;
- h->pred16x16[HOR_PRED8x8 ]= ff_pred16x16_horizontal_c;
- h->pred16x16[PLANE_PRED8x8 ]= ff_pred16x16_plane_c;
- h->pred16x16[LEFT_DC_PRED8x8]= pred16x16_left_dc_c;
- h->pred16x16[TOP_DC_PRED8x8 ]= pred16x16_top_dc_c;
- h->pred16x16[DC_128_PRED8x8 ]= ff_pred16x16_128_dc_c;
-}
-
-static void free_tables(H264Context *h){
- av_freep(&h->intra4x4_pred_mode);
- av_freep(&h->chroma_pred_mode_table);
- av_freep(&h->cbp_table);
- av_freep(&h->mvd_table[0]);
- av_freep(&h->mvd_table[1]);
- av_freep(&h->direct_table);
- av_freep(&h->non_zero_count);
- av_freep(&h->slice_table_base);
- av_freep(&h->top_borders[1]);
- av_freep(&h->top_borders[0]);
- h->slice_table= NULL;
-
- av_freep(&h->mb2b_xy);
- av_freep(&h->mb2b8_xy);
-
- av_freep(&h->s.obmc_scratchpad);
-}
-
-static void init_dequant8_coeff_table(H264Context *h){
- int i,q,x;
- const int transpose = (h->s.dsp.h264_idct8_add != ff_h264_idct8_add_c); //FIXME ugly
- h->dequant8_coeff[0] = h->dequant8_buffer[0];
- h->dequant8_coeff[1] = h->dequant8_buffer[1];
-
- for(i=0; i<2; i++ ){
- if(i && !memcmp(h->pps.scaling_matrix8[0], h->pps.scaling_matrix8[1], 64*sizeof(uint8_t))){
- h->dequant8_coeff[1] = h->dequant8_buffer[0];
- break;
- }
-
- for(q=0; q<52; q++){
- int shift = ff_div6[q];
- int idx = ff_rem6[q];
- for(x=0; x<64; x++)
- h->dequant8_coeff[i][q][transpose ? (x>>3)|((x&7)<<3) : x] =
- ((uint32_t)dequant8_coeff_init[idx][ dequant8_coeff_init_scan[((x>>1)&12) | (x&3)] ] *
- h->pps.scaling_matrix8[i][x]) << shift;
- }
- }
-}
-
-static void init_dequant4_coeff_table(H264Context *h){
- int i,j,q,x;
- const int transpose = (h->s.dsp.h264_idct_add != ff_h264_idct_add_c); //FIXME ugly
- for(i=0; i<6; i++ ){
- h->dequant4_coeff[i] = h->dequant4_buffer[i];
- for(j=0; j<i; j++){
- if(!memcmp(h->pps.scaling_matrix4[j], h->pps.scaling_matrix4[i], 16*sizeof(uint8_t))){
- h->dequant4_coeff[i] = h->dequant4_buffer[j];
- break;
- }
- }
- if(j<i)
- continue;
-
- for(q=0; q<52; q++){
- int shift = ff_div6[q] + 2;
- int idx = ff_rem6[q];
- for(x=0; x<16; x++)
- h->dequant4_coeff[i][q][transpose ? (x>>2)|((x<<2)&0xF) : x] =
- ((uint32_t)dequant4_coeff_init[idx][(x&1) + ((x>>2)&1)] *
- h->pps.scaling_matrix4[i][x]) << shift;
- }
- }
-}
-
-static void init_dequant_tables(H264Context *h){
- int i,x;
- init_dequant4_coeff_table(h);
- if(h->pps.transform_8x8_mode)
- init_dequant8_coeff_table(h);
- if(h->sps.transform_bypass){
- for(i=0; i<6; i++)
- for(x=0; x<16; x++)
- h->dequant4_coeff[i][0][x] = 1<<6;
- if(h->pps.transform_8x8_mode)
- for(i=0; i<2; i++)
- for(x=0; x<64; x++)
- h->dequant8_coeff[i][0][x] = 1<<6;
- }
-}
-
-
-/**
- * allocates tables.
- * needs width/height
- */
-static int alloc_tables(H264Context *h){
- MpegEncContext * const s = &h->s;
- const int big_mb_num= s->mb_stride * (s->mb_height+1);
- int x,y;
-
- CHECKED_ALLOCZ(h->intra4x4_pred_mode, big_mb_num * 8 * sizeof(uint8_t))
-
- CHECKED_ALLOCZ(h->non_zero_count , big_mb_num * 16 * sizeof(uint8_t))
- CHECKED_ALLOCZ(h->slice_table_base , (big_mb_num+s->mb_stride) * sizeof(uint8_t))
- CHECKED_ALLOCZ(h->top_borders[0] , s->mb_width * (16+8+8) * sizeof(uint8_t))
- CHECKED_ALLOCZ(h->top_borders[1] , s->mb_width * (16+8+8) * sizeof(uint8_t))
- CHECKED_ALLOCZ(h->cbp_table, big_mb_num * sizeof(uint16_t))
-
- if( h->pps.cabac ) {
- CHECKED_ALLOCZ(h->chroma_pred_mode_table, big_mb_num * sizeof(uint8_t))
- CHECKED_ALLOCZ(h->mvd_table[0], 32*big_mb_num * sizeof(uint16_t));
- CHECKED_ALLOCZ(h->mvd_table[1], 32*big_mb_num * sizeof(uint16_t));
- CHECKED_ALLOCZ(h->direct_table, 32*big_mb_num * sizeof(uint8_t));
- }
-
- memset(h->slice_table_base, -1, (big_mb_num+s->mb_stride) * sizeof(uint8_t));
- h->slice_table= h->slice_table_base + s->mb_stride*2 + 1;
-
- CHECKED_ALLOCZ(h->mb2b_xy , big_mb_num * sizeof(uint32_t));
- CHECKED_ALLOCZ(h->mb2b8_xy , big_mb_num * sizeof(uint32_t));
- for(y=0; y<s->mb_height; y++){
- for(x=0; x<s->mb_width; x++){
- const int mb_xy= x + y*s->mb_stride;
- const int b_xy = 4*x + 4*y*h->b_stride;
- const int b8_xy= 2*x + 2*y*h->b8_stride;
-
- h->mb2b_xy [mb_xy]= b_xy;
- h->mb2b8_xy[mb_xy]= b8_xy;
- }
- }
-
- s->obmc_scratchpad = NULL;
-
- if(!h->dequant4_coeff[0])
- init_dequant_tables(h);
-
- return 0;
-fail:
- free_tables(h);
- return -1;
-}
-
-static void common_init(H264Context *h){
- MpegEncContext * const s = &h->s;
-
- s->width = s->avctx->width;
- s->height = s->avctx->height;
- s->codec_id= s->avctx->codec->id;
-
- init_pred_ptrs(h);
-
- h->dequant_coeff_pps= -1;
- s->unrestricted_mv=1;
- s->decode=1; //FIXME
-
- memset(h->pps.scaling_matrix4, 16, 6*16*sizeof(uint8_t));
- memset(h->pps.scaling_matrix8, 16, 2*64*sizeof(uint8_t));
-}
-
-static int decode_init(AVCodecContext *avctx){
- H264Context *h= avctx->priv_data;
- MpegEncContext * const s = &h->s;
-
- MPV_decode_defaults(s);
-
- s->avctx = avctx;
- common_init(h);
-
- s->out_format = FMT_H264;
- s->workaround_bugs= avctx->workaround_bugs;
-
- // set defaults
-// s->decode_mb= ff_h263_decode_mb;
- s->low_delay= 1;
- avctx->pix_fmt= PIX_FMT_YUV420P;
-
- decode_init_vlc();
-
- if(avctx->extradata_size > 0 && avctx->extradata &&
- *(char *)avctx->extradata == 1){
- h->is_avc = 1;
- h->got_avcC = 0;
- } else {
- h->is_avc = 0;
- }
-
- return 0;
-}
-
-static int frame_start(H264Context *h){
- MpegEncContext * const s = &h->s;
- int i;
-
- if(MPV_frame_start(s, s->avctx) < 0)
- return -1;
- ff_er_frame_start(s);
-
- assert(s->linesize && s->uvlinesize);
-
- for(i=0; i<16; i++){
- h->block_offset[i]= 4*((scan8[i] - scan8[0])&7) + 4*s->linesize*((scan8[i] - scan8[0])>>3);
- h->block_offset[24+i]= 4*((scan8[i] - scan8[0])&7) + 8*s->linesize*((scan8[i] - scan8[0])>>3);
- }
- for(i=0; i<4; i++){
- h->block_offset[16+i]=
- h->block_offset[20+i]= 4*((scan8[i] - scan8[0])&7) + 4*s->uvlinesize*((scan8[i] - scan8[0])>>3);
- h->block_offset[24+16+i]=
- h->block_offset[24+20+i]= 4*((scan8[i] - scan8[0])&7) + 8*s->uvlinesize*((scan8[i] - scan8[0])>>3);
- }
-
- /* can't be in alloc_tables because linesize isn't known there.
- * FIXME: redo bipred weight to not require extra buffer? */
- if(!s->obmc_scratchpad)
- s->obmc_scratchpad = av_malloc(16*2*s->linesize + 8*2*s->uvlinesize);
-
- /* some macroblocks will be accessed before they're available */
- if(FRAME_MBAFF)
- memset(h->slice_table, -1, (s->mb_height*s->mb_stride-1) * sizeof(uint8_t));
-
-// s->decode= (s->flags&CODEC_FLAG_PSNR) || !s->encoding || s->current_picture.reference /*|| h->contains_intra*/ || 1;
- return 0;
-}
-
-static inline void backup_mb_border(H264Context *h, uint8_t *src_y, uint8_t *src_cb, uint8_t *src_cr, int linesize, int uvlinesize){
- MpegEncContext * const s = &h->s;
- int i;
-
- src_y -= linesize;
- src_cb -= uvlinesize;
- src_cr -= uvlinesize;
-
- // There are two lines saved, the line above the the top macroblock of a pair,
- // and the line above the bottom macroblock
- h->left_border[0]= h->top_borders[0][s->mb_x][15];
- for(i=1; i<17; i++){
- h->left_border[i]= src_y[15+i* linesize];
- }
-
- *(uint64_t*)(h->top_borders[0][s->mb_x]+0)= *(uint64_t*)(src_y + 16*linesize);
- *(uint64_t*)(h->top_borders[0][s->mb_x]+8)= *(uint64_t*)(src_y +8+16*linesize);
-
- if(!(s->flags&CODEC_FLAG_GRAY)){
- h->left_border[17 ]= h->top_borders[0][s->mb_x][16+7];
- h->left_border[17+9]= h->top_borders[0][s->mb_x][24+7];
- for(i=1; i<9; i++){
- h->left_border[i+17 ]= src_cb[7+i*uvlinesize];
- h->left_border[i+17+9]= src_cr[7+i*uvlinesize];
- }
- *(uint64_t*)(h->top_borders[0][s->mb_x]+16)= *(uint64_t*)(src_cb+8*uvlinesize);
- *(uint64_t*)(h->top_borders[0][s->mb_x]+24)= *(uint64_t*)(src_cr+8*uvlinesize);
- }
-}
-
-static inline void xchg_mb_border(H264Context *h, uint8_t *src_y, uint8_t *src_cb, uint8_t *src_cr, int linesize, int uvlinesize, int xchg){
- MpegEncContext * const s = &h->s;
- int temp8, i;
- uint64_t temp64;
- int deblock_left = (s->mb_x > 0);
- int deblock_top = (s->mb_y > 0);
-
- src_y -= linesize + 1;
- src_cb -= uvlinesize + 1;
- src_cr -= uvlinesize + 1;
-
-#define XCHG(a,b,t,xchg)\
-t= a;\
-if(xchg)\
- a= b;\
-b= t;
-
- if(deblock_left){
- for(i = !deblock_top; i<17; i++){
- XCHG(h->left_border[i ], src_y [i* linesize], temp8, xchg);
- }
- }
-
- if(deblock_top){
- XCHG(*(uint64_t*)(h->top_borders[0][s->mb_x]+0), *(uint64_t*)(src_y +1), temp64, xchg);
- XCHG(*(uint64_t*)(h->top_borders[0][s->mb_x]+8), *(uint64_t*)(src_y +9), temp64, 1);
- if(s->mb_x+1 < s->mb_width){
- XCHG(*(uint64_t*)(h->top_borders[0][s->mb_x+1]), *(uint64_t*)(src_y +17), temp64, 1);
- }
- }
-
- if(!(s->flags&CODEC_FLAG_GRAY)){
- if(deblock_left){
- for(i = !deblock_top; i<9; i++){
- XCHG(h->left_border[i+17 ], src_cb[i*uvlinesize], temp8, xchg);
- XCHG(h->left_border[i+17+9], src_cr[i*uvlinesize], temp8, xchg);
- }
- }
- if(deblock_top){
- XCHG(*(uint64_t*)(h->top_borders[0][s->mb_x]+16), *(uint64_t*)(src_cb+1), temp64, 1);
- XCHG(*(uint64_t*)(h->top_borders[0][s->mb_x]+24), *(uint64_t*)(src_cr+1), temp64, 1);
- }
- }
-}
-
-static inline void backup_pair_border(H264Context *h, uint8_t *src_y, uint8_t *src_cb, uint8_t *src_cr, int linesize, int uvlinesize){
- MpegEncContext * const s = &h->s;
- int i;
-
- src_y -= 2 * linesize;
- src_cb -= 2 * uvlinesize;
- src_cr -= 2 * uvlinesize;
-
- // There are two lines saved, the line above the the top macroblock of a pair,
- // and the line above the bottom macroblock
- h->left_border[0]= h->top_borders[0][s->mb_x][15];
- h->left_border[1]= h->top_borders[1][s->mb_x][15];
- for(i=2; i<34; i++){
- h->left_border[i]= src_y[15+i* linesize];
- }
-
- *(uint64_t*)(h->top_borders[0][s->mb_x]+0)= *(uint64_t*)(src_y + 32*linesize);
- *(uint64_t*)(h->top_borders[0][s->mb_x]+8)= *(uint64_t*)(src_y +8+32*linesize);
- *(uint64_t*)(h->top_borders[1][s->mb_x]+0)= *(uint64_t*)(src_y + 33*linesize);
- *(uint64_t*)(h->top_borders[1][s->mb_x]+8)= *(uint64_t*)(src_y +8+33*linesize);
-
- if(!(s->flags&CODEC_FLAG_GRAY)){
- h->left_border[34 ]= h->top_borders[0][s->mb_x][16+7];
- h->left_border[34+ 1]= h->top_borders[1][s->mb_x][16+7];
- h->left_border[34+18 ]= h->top_borders[0][s->mb_x][24+7];
- h->left_border[34+18+1]= h->top_borders[1][s->mb_x][24+7];
- for(i=2; i<18; i++){
- h->left_border[i+34 ]= src_cb[7+i*uvlinesize];
- h->left_border[i+34+18]= src_cr[7+i*uvlinesize];
- }
- *(uint64_t*)(h->top_borders[0][s->mb_x]+16)= *(uint64_t*)(src_cb+16*uvlinesize);
- *(uint64_t*)(h->top_borders[0][s->mb_x]+24)= *(uint64_t*)(src_cr+16*uvlinesize);
- *(uint64_t*)(h->top_borders[1][s->mb_x]+16)= *(uint64_t*)(src_cb+17*uvlinesize);
- *(uint64_t*)(h->top_borders[1][s->mb_x]+24)= *(uint64_t*)(src_cr+17*uvlinesize);
- }
-}
-
-static inline void xchg_pair_border(H264Context *h, uint8_t *src_y, uint8_t *src_cb, uint8_t *src_cr, int linesize, int uvlinesize, int xchg){
- MpegEncContext * const s = &h->s;
- int temp8, i;
- uint64_t temp64;
- int deblock_left = (s->mb_x > 0);
- int deblock_top = (s->mb_y > 1);
-
- tprintf("xchg_pair_border: src_y:%p src_cb:%p src_cr:%p ls:%d uvls:%d\n", src_y, src_cb, src_cr, linesize, uvlinesize);
-
- src_y -= 2 * linesize + 1;
- src_cb -= 2 * uvlinesize + 1;
- src_cr -= 2 * uvlinesize + 1;
-
-#define XCHG(a,b,t,xchg)\
-t= a;\
-if(xchg)\
- a= b;\
-b= t;
-
- if(deblock_left){
- for(i = (!deblock_top)<<1; i<34; i++){
- XCHG(h->left_border[i ], src_y [i* linesize], temp8, xchg);
- }
- }
-
- if(deblock_top){
- XCHG(*(uint64_t*)(h->top_borders[0][s->mb_x]+0), *(uint64_t*)(src_y +1), temp64, xchg);
- XCHG(*(uint64_t*)(h->top_borders[0][s->mb_x]+8), *(uint64_t*)(src_y +9), temp64, 1);
- XCHG(*(uint64_t*)(h->top_borders[1][s->mb_x]+0), *(uint64_t*)(src_y +1 +linesize), temp64, xchg);
- XCHG(*(uint64_t*)(h->top_borders[1][s->mb_x]+8), *(uint64_t*)(src_y +9 +linesize), temp64, 1);
- if(s->mb_x+1 < s->mb_width){
- XCHG(*(uint64_t*)(h->top_borders[0][s->mb_x+1]), *(uint64_t*)(src_y +17), temp64, 1);
- XCHG(*(uint64_t*)(h->top_borders[1][s->mb_x+1]), *(uint64_t*)(src_y +17 +linesize), temp64, 1);
- }
- }
-
- if(!(s->flags&CODEC_FLAG_GRAY)){
- if(deblock_left){
- for(i = (!deblock_top) << 1; i<18; i++){
- XCHG(h->left_border[i+34 ], src_cb[i*uvlinesize], temp8, xchg);
- XCHG(h->left_border[i+34+18], src_cr[i*uvlinesize], temp8, xchg);
- }
- }
- if(deblock_top){
- XCHG(*(uint64_t*)(h->top_borders[0][s->mb_x]+16), *(uint64_t*)(src_cb+1), temp64, 1);
- XCHG(*(uint64_t*)(h->top_borders[0][s->mb_x]+24), *(uint64_t*)(src_cr+1), temp64, 1);
- XCHG(*(uint64_t*)(h->top_borders[1][s->mb_x]+16), *(uint64_t*)(src_cb+1 +uvlinesize), temp64, 1);
- XCHG(*(uint64_t*)(h->top_borders[1][s->mb_x]+24), *(uint64_t*)(src_cr+1 +uvlinesize), temp64, 1);
- }
- }
-}
-
-static void hl_decode_mb(H264Context *h){
- MpegEncContext * const s = &h->s;
- const int mb_x= s->mb_x;
- const int mb_y= s->mb_y;
- const int mb_xy= mb_x + mb_y*s->mb_stride;
- const int mb_type= s->current_picture.mb_type[mb_xy];
- uint8_t *dest_y, *dest_cb, *dest_cr;
- int linesize, uvlinesize /*dct_offset*/;
- int i;
- int *block_offset = &h->block_offset[0];
- const unsigned int bottom = mb_y & 1;
- const int transform_bypass = (s->qscale == 0 && h->sps.transform_bypass);
- void (*idct_add)(uint8_t *dst, DCTELEM *block, int stride);
- void (*idct_dc_add)(uint8_t *dst, DCTELEM *block, int stride);
-
- if(!s->decode)
- return;
-
- dest_y = s->current_picture.data[0] + (mb_y * 16* s->linesize ) + mb_x * 16;
- dest_cb = s->current_picture.data[1] + (mb_y * 8 * s->uvlinesize) + mb_x * 8;
- dest_cr = s->current_picture.data[2] + (mb_y * 8 * s->uvlinesize) + mb_x * 8;
-
- s->dsp.prefetch(dest_y + (s->mb_x&3)*4*s->linesize + 64, s->linesize, 4);
- s->dsp.prefetch(dest_cb + (s->mb_x&7)*s->uvlinesize + 64, dest_cr - dest_cb, 2);
-
- if (MB_FIELD) {
- linesize = h->mb_linesize = s->linesize * 2;
- uvlinesize = h->mb_uvlinesize = s->uvlinesize * 2;
- block_offset = &h->block_offset[24];
- if(mb_y&1){ //FIXME move out of this func?
- dest_y -= s->linesize*15;
- dest_cb-= s->uvlinesize*7;
- dest_cr-= s->uvlinesize*7;
- }
- if(FRAME_MBAFF) {
- int list;
- for(list=0; list<2; list++){
- if(!USES_LIST(mb_type, list))
- continue;
- if(IS_16X16(mb_type)){
- int8_t *ref = &h->ref_cache[list][scan8[0]];
- fill_rectangle(ref, 4, 4, 8, 16+*ref^(s->mb_y&1), 1);
- }else{
- for(i=0; i<16; i+=4){
- //FIXME can refs be smaller than 8x8 when !direct_8x8_inference ?
- int ref = h->ref_cache[list][scan8[i]];
- if(ref >= 0)
- fill_rectangle(&h->ref_cache[list][scan8[i]], 2, 2, 8, 16+ref^(s->mb_y&1), 1);
- }
- }
- }
- }
- } else {
- linesize = h->mb_linesize = s->linesize;
- uvlinesize = h->mb_uvlinesize = s->uvlinesize;
-// dct_offset = s->linesize * 16;
- }
-
- if(transform_bypass){
- idct_dc_add =
- idct_add = IS_8x8DCT(mb_type) ? s->dsp.add_pixels8 : s->dsp.add_pixels4;
- }else if(IS_8x8DCT(mb_type)){
- idct_dc_add = s->dsp.h264_idct8_dc_add;
- idct_add = s->dsp.h264_idct8_add;
- }else{
- idct_dc_add = s->dsp.h264_idct_dc_add;
- idct_add = s->dsp.h264_idct_add;
- }
-
- if(FRAME_MBAFF && h->deblocking_filter && IS_INTRA(mb_type)
- && (!bottom || !IS_INTRA(s->current_picture.mb_type[mb_xy-s->mb_stride]))){
- int mbt_y = mb_y&~1;
- uint8_t *top_y = s->current_picture.data[0] + (mbt_y * 16* s->linesize ) + mb_x * 16;
- uint8_t *top_cb = s->current_picture.data[1] + (mbt_y * 8 * s->uvlinesize) + mb_x * 8;
- uint8_t *top_cr = s->current_picture.data[2] + (mbt_y * 8 * s->uvlinesize) + mb_x * 8;
- xchg_pair_border(h, top_y, top_cb, top_cr, s->linesize, s->uvlinesize, 1);
- }
-
- if (IS_INTRA_PCM(mb_type)) {
- unsigned int x, y;
-
- // The pixels are stored in h->mb array in the same order as levels,
- // copy them in output in the correct order.
- for(i=0; i<16; i++) {
- for (y=0; y<4; y++) {
- for (x=0; x<4; x++) {
- *(dest_y + block_offset[i] + y*linesize + x) = h->mb[i*16+y*4+x];
- }
- }
- }
- for(i=16; i<16+4; i++) {
- for (y=0; y<4; y++) {
- for (x=0; x<4; x++) {
- *(dest_cb + block_offset[i] + y*uvlinesize + x) = h->mb[i*16+y*4+x];
- }
- }
- }
- for(i=20; i<20+4; i++) {
- for (y=0; y<4; y++) {
- for (x=0; x<4; x++) {
- *(dest_cr + block_offset[i] + y*uvlinesize + x) = h->mb[i*16+y*4+x];
- }
- }
- }
- } else {
- if(IS_INTRA(mb_type)){
- if(h->deblocking_filter && !FRAME_MBAFF)
- xchg_mb_border(h, dest_y, dest_cb, dest_cr, linesize, uvlinesize, 1);
-
- if(!(s->flags&CODEC_FLAG_GRAY)){
- h->pred8x8[ h->chroma_pred_mode ](dest_cb, uvlinesize);
- h->pred8x8[ h->chroma_pred_mode ](dest_cr, uvlinesize);
- }
-
- if(IS_INTRA4x4(mb_type)){
- if(!s->encoding){
- if(IS_8x8DCT(mb_type)){
- for(i=0; i<16; i+=4){
- uint8_t * const ptr= dest_y + block_offset[i];
- const int dir= h->intra4x4_pred_mode_cache[ scan8[i] ];
- const int nnz = h->non_zero_count_cache[ scan8[i] ];
- h->pred8x8l[ dir ](ptr, (h->topleft_samples_available<<i)&0x8000,
- (h->topright_samples_available<<(i+1))&0x8000, linesize);
- if(nnz){
- if(nnz == 1 && h->mb[i*16])
- idct_dc_add(ptr, h->mb + i*16, linesize);
- else
- idct_add(ptr, h->mb + i*16, linesize);
- }
- }
- }else
- for(i=0; i<16; i++){
- uint8_t * const ptr= dest_y + block_offset[i];
- uint8_t *topright;
- const int dir= h->intra4x4_pred_mode_cache[ scan8[i] ];
- int nnz, tr;
-
- if(dir == DIAG_DOWN_LEFT_PRED || dir == VERT_LEFT_PRED){
- const int topright_avail= (h->topright_samples_available<<i)&0x8000;
- assert(mb_y || linesize <= block_offset[i]);
- if(!topright_avail){
- tr= ptr[3 - linesize]*0x01010101;
- topright= (uint8_t*) &tr;
- }else
- topright= ptr + 4 - linesize;
- }else
- topright= NULL;
-
- h->pred4x4[ dir ](ptr, topright, linesize);
- nnz = h->non_zero_count_cache[ scan8[i] ];
- if(nnz){
- if(s->codec_id == CODEC_ID_H264){
- if(nnz == 1 && h->mb[i*16])
- idct_dc_add(ptr, h->mb + i*16, linesize);
- else
- idct_add(ptr, h->mb + i*16, linesize);
- }else
- svq3_add_idct_c(ptr, h->mb + i*16, linesize, s->qscale, 0);
- }
- }
- }
- }else{
- h->pred16x16[ h->intra16x16_pred_mode ](dest_y , linesize);
- if(s->codec_id == CODEC_ID_H264){
- if(!transform_bypass)
- h264_luma_dc_dequant_idct_c(h->mb, s->qscale, h->dequant4_coeff[IS_INTRA(mb_type) ? 0:3][s->qscale][0]);
- }else
- svq3_luma_dc_dequant_idct_c(h->mb, s->qscale);
- }
- if(h->deblocking_filter && !FRAME_MBAFF)
- xchg_mb_border(h, dest_y, dest_cb, dest_cr, linesize, uvlinesize, 0);
- }else if(s->codec_id == CODEC_ID_H264){
- hl_motion(h, dest_y, dest_cb, dest_cr,
- s->me.qpel_put, s->dsp.put_h264_chroma_pixels_tab,
- s->me.qpel_avg, s->dsp.avg_h264_chroma_pixels_tab,
- s->dsp.weight_h264_pixels_tab, s->dsp.biweight_h264_pixels_tab);
- }
-
-
- if(!IS_INTRA4x4(mb_type)){
- if(s->codec_id == CODEC_ID_H264){
- if(IS_INTRA16x16(mb_type)){
- for(i=0; i<16; i++){
- if(h->non_zero_count_cache[ scan8[i] ])
- idct_add(dest_y + block_offset[i], h->mb + i*16, linesize);
- else if(h->mb[i*16])
- idct_dc_add(dest_y + block_offset[i], h->mb + i*16, linesize);
- }
- }else{
- const int di = IS_8x8DCT(mb_type) ? 4 : 1;
- for(i=0; i<16; i+=di){
- int nnz = h->non_zero_count_cache[ scan8[i] ];
- if(nnz){
- if(nnz==1 && h->mb[i*16])
- idct_dc_add(dest_y + block_offset[i], h->mb + i*16, linesize);
- else
- idct_add(dest_y + block_offset[i], h->mb + i*16, linesize);
- }
- }
- }
- }else{
- for(i=0; i<16; i++){
- if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){ //FIXME benchmark weird rule, & below
- uint8_t * const ptr= dest_y + block_offset[i];
- svq3_add_idct_c(ptr, h->mb + i*16, linesize, s->qscale, IS_INTRA(mb_type) ? 1 : 0);
- }
- }
- }
- }
-
- if(!(s->flags&CODEC_FLAG_GRAY)){
- uint8_t *dest[2] = {dest_cb, dest_cr};
- if(transform_bypass){
- idct_add = idct_dc_add = s->dsp.add_pixels4;
- }else{
- idct_add = s->dsp.h264_idct_add;
- idct_dc_add = s->dsp.h264_idct_dc_add;
- chroma_dc_dequant_idct_c(h->mb + 16*16, h->chroma_qp, h->dequant4_coeff[IS_INTRA(mb_type) ? 1:4][h->chroma_qp][0]);
- chroma_dc_dequant_idct_c(h->mb + 16*16+4*16, h->chroma_qp, h->dequant4_coeff[IS_INTRA(mb_type) ? 2:5][h->chroma_qp][0]);
- }
- if(s->codec_id == CODEC_ID_H264){
- for(i=16; i<16+8; i++){
- if(h->non_zero_count_cache[ scan8[i] ])
- idct_add(dest[(i&4)>>2] + block_offset[i], h->mb + i*16, uvlinesize);
- else if(h->mb[i*16])
- idct_dc_add(dest[(i&4)>>2] + block_offset[i], h->mb + i*16, uvlinesize);
- }
- }else{
- for(i=16; i<16+8; i++){
- if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){
- uint8_t * const ptr= dest[(i&4)>>2] + block_offset[i];
- svq3_add_idct_c(ptr, h->mb + i*16, uvlinesize, chroma_qp[s->qscale + 12] - 12, 2);
- }
- }
- }
- }
- }
- if(h->deblocking_filter) {
- if (FRAME_MBAFF) {
- //FIXME try deblocking one mb at a time?
- // the reduction in load/storing mvs and such might outweigh the extra backup/xchg_border
- const int mb_y = s->mb_y - 1;
- uint8_t *pair_dest_y, *pair_dest_cb, *pair_dest_cr;
- const int mb_xy= mb_x + mb_y*s->mb_stride;
- const int mb_type_top = s->current_picture.mb_type[mb_xy];
- const int mb_type_bottom= s->current_picture.mb_type[mb_xy+s->mb_stride];
- if (!bottom) return;
- pair_dest_y = s->current_picture.data[0] + (mb_y * 16* s->linesize ) + mb_x * 16;
- pair_dest_cb = s->current_picture.data[1] + (mb_y * 8 * s->uvlinesize) + mb_x * 8;
- pair_dest_cr = s->current_picture.data[2] + (mb_y * 8 * s->uvlinesize) + mb_x * 8;
-
- if(IS_INTRA(mb_type_top | mb_type_bottom))
- xchg_pair_border(h, pair_dest_y, pair_dest_cb, pair_dest_cr, s->linesize, s->uvlinesize, 0);
-
- backup_pair_border(h, pair_dest_y, pair_dest_cb, pair_dest_cr, s->linesize, s->uvlinesize);
- // deblock a pair
- // top
- s->mb_y--;
- tprintf("call mbaff filter_mb mb_x:%d mb_y:%d pair_dest_y = %p, dest_y = %p\n", mb_x, mb_y, pair_dest_y, dest_y);
- fill_caches(h, mb_type_top, 1); //FIXME don't fill stuff which isn't used by filter_mb
- h->chroma_qp = get_chroma_qp(h->pps.chroma_qp_index_offset, s->current_picture.qscale_table[mb_xy]);
- filter_mb(h, mb_x, mb_y, pair_dest_y, pair_dest_cb, pair_dest_cr, linesize, uvlinesize);
- // bottom
- s->mb_y++;
- tprintf("call mbaff filter_mb\n");
- fill_caches(h, mb_type_bottom, 1); //FIXME don't fill stuff which isn't used by filter_mb
- h->chroma_qp = get_chroma_qp(h->pps.chroma_qp_index_offset, s->current_picture.qscale_table[mb_xy+s->mb_stride]);
- filter_mb(h, mb_x, mb_y+1, dest_y, dest_cb, dest_cr, linesize, uvlinesize);
- } else {
- tprintf("call filter_mb\n");
- backup_mb_border(h, dest_y, dest_cb, dest_cr, linesize, uvlinesize);
- fill_caches(h, mb_type, 1); //FIXME don't fill stuff which isn't used by filter_mb
- filter_mb_fast(h, mb_x, mb_y, dest_y, dest_cb, dest_cr, linesize, uvlinesize);
- }
- }
-}
-
-/**
- * fills the default_ref_list.
- */
-static int fill_default_ref_list(H264Context *h){
- MpegEncContext * const s = &h->s;
- int i;
- int smallest_poc_greater_than_current = -1;
- Picture sorted_short_ref[32];
-
- if(h->slice_type==B_TYPE){
- int out_i;
- int limit= INT_MIN;
-
- /* sort frame according to poc in B slice */
- for(out_i=0; out_i<h->short_ref_count; out_i++){
- int best_i=INT_MIN;
- int best_poc=INT_MAX;
-
- for(i=0; i<h->short_ref_count; i++){
- const int poc= h->short_ref[i]->poc;
- if(poc > limit && poc < best_poc){
- best_poc= poc;
- best_i= i;
- }
- }
-
- assert(best_i != INT_MIN);
-
- limit= best_poc;
- sorted_short_ref[out_i]= *h->short_ref[best_i];
- tprintf("sorted poc: %d->%d poc:%d fn:%d\n", best_i, out_i, sorted_short_ref[out_i].poc, sorted_short_ref[out_i].frame_num);
- if (-1 == smallest_poc_greater_than_current) {
- if (h->short_ref[best_i]->poc >= s->current_picture_ptr->poc) {
- smallest_poc_greater_than_current = out_i;
- }
- }
- }
- }
-
- if(s->picture_structure == PICT_FRAME){
- if(h->slice_type==B_TYPE){
- int list;
- tprintf("current poc: %d, smallest_poc_greater_than_current: %d\n", s->current_picture_ptr->poc, smallest_poc_greater_than_current);
-
- // find the largest poc
- for(list=0; list<2; list++){
- int index = 0;
- int j= -99;
- int step= list ? -1 : 1;
-
- for(i=0; i<h->short_ref_count && index < h->ref_count[list]; i++, j+=step) {
- while(j<0 || j>= h->short_ref_count){
- if(j != -99 && step == (list ? -1 : 1))
- return -1;
- step = -step;
- j= smallest_poc_greater_than_current + (step>>1);
- }
- if(sorted_short_ref[j].reference != 3) continue;
- h->default_ref_list[list][index ]= sorted_short_ref[j];
- h->default_ref_list[list][index++].pic_id= sorted_short_ref[j].frame_num;
- }
-
- for(i = 0; i < 16 && index < h->ref_count[ list ]; i++){
- if(h->long_ref[i] == NULL) continue;
- if(h->long_ref[i]->reference != 3) continue;
-
- h->default_ref_list[ list ][index ]= *h->long_ref[i];
- h->default_ref_list[ list ][index++].pic_id= i;;
- }
-
- if(list && (smallest_poc_greater_than_current<=0 || smallest_poc_greater_than_current>=h->short_ref_count) && (1 < index)){
- // swap the two first elements of L1 when
- // L0 and L1 are identical
- Picture temp= h->default_ref_list[1][0];
- h->default_ref_list[1][0] = h->default_ref_list[1][1];
- h->default_ref_list[1][1] = temp;
- }
-
- if(index < h->ref_count[ list ])
- memset(&h->default_ref_list[list][index], 0, sizeof(Picture)*(h->ref_count[ list ] - index));
- }
- }else{
- int index=0;
- for(i=0; i<h->short_ref_count; i++){
- if(h->short_ref[i]->reference != 3) continue; //FIXME refernce field shit
- h->default_ref_list[0][index ]= *h->short_ref[i];
- h->default_ref_list[0][index++].pic_id= h->short_ref[i]->frame_num;
- }
- for(i = 0; i < 16; i++){
- if(h->long_ref[i] == NULL) continue;
- if(h->long_ref[i]->reference != 3) continue;
- h->default_ref_list[0][index ]= *h->long_ref[i];
- h->default_ref_list[0][index++].pic_id= i;;
- }
- if(index < h->ref_count[0])
- memset(&h->default_ref_list[0][index], 0, sizeof(Picture)*(h->ref_count[0] - index));
- }
- }else{ //FIELD
- if(h->slice_type==B_TYPE){
- }else{
- //FIXME second field balh
- }
- }
-#ifdef TRACE
- for (i=0; i<h->ref_count[0]; i++) {
- tprintf("List0: %s fn:%d 0x%p\n", (h->default_ref_list[0][i].long_ref ? "LT" : "ST"), h->default_ref_list[0][i].pic_id, h->default_ref_list[0][i].data[0]);
- }
- if(h->slice_type==B_TYPE){
- for (i=0; i<h->ref_count[1]; i++) {
- tprintf("List1: %s fn:%d 0x%p\n", (h->default_ref_list[1][i].long_ref ? "LT" : "ST"), h->default_ref_list[1][i].pic_id, h->default_ref_list[0][i].data[0]);
- }
- }
-#endif
- return 0;
-}
-
-static void print_short_term(H264Context *h);
-static void print_long_term(H264Context *h);
-
-static int decode_ref_pic_list_reordering(H264Context *h){
- MpegEncContext * const s = &h->s;
- int list, index;
-
- print_short_term(h);
- print_long_term(h);
- if(h->slice_type==I_TYPE || h->slice_type==SI_TYPE) return 0; //FIXME move before func
-
- for(list=0; list<2; list++){
- memcpy(h->ref_list[list], h->default_ref_list[list], sizeof(Picture)*h->ref_count[list]);
-
- if(get_bits1(&s->gb)){
- int pred= h->curr_pic_num;
-
- for(index=0; ; index++){
- unsigned int reordering_of_pic_nums_idc= get_ue_golomb(&s->gb);
- unsigned int pic_id;
- int i;
- Picture *ref = NULL;
-
- if(reordering_of_pic_nums_idc==3)
- break;
-
- if(index >= h->ref_count[list]){
- av_log(h->s.avctx, AV_LOG_ERROR, "reference count overflow\n");
- return -1;
- }
-
- if(reordering_of_pic_nums_idc<3){
- if(reordering_of_pic_nums_idc<2){
- const unsigned int abs_diff_pic_num= get_ue_golomb(&s->gb) + 1;
-
- if(abs_diff_pic_num >= h->max_pic_num){
- av_log(h->s.avctx, AV_LOG_ERROR, "abs_diff_pic_num overflow\n");
- return -1;
- }
-
- if(reordering_of_pic_nums_idc == 0) pred-= abs_diff_pic_num;
- else pred+= abs_diff_pic_num;
- pred &= h->max_pic_num - 1;
-
- for(i= h->short_ref_count-1; i>=0; i--){
- ref = h->short_ref[i];
- assert(ref->reference == 3);
- assert(!ref->long_ref);
- if(ref->data[0] != NULL && ref->frame_num == pred && ref->long_ref == 0) // ignore non existing pictures by testing data[0] pointer
- break;
- }
- if(i>=0)
- ref->pic_id= ref->frame_num;
- }else{
- pic_id= get_ue_golomb(&s->gb); //long_term_pic_idx
- if(pic_id>31){
- av_log(h->s.avctx, AV_LOG_ERROR, "long_term_pic_idx overflow\n");
- return -1;
- }
- ref = h->long_ref[pic_id];
- if(ref){
- ref->pic_id= pic_id;
- assert(ref->reference == 3);
- assert(ref->long_ref);
- i=0;
- }else{
- i=-1;
- }
- }
-
- if (i < 0) {
- av_log(h->s.avctx, AV_LOG_ERROR, "reference picture missing during reorder\n");
- memset(&h->ref_list[list][index], 0, sizeof(Picture)); //FIXME
- } else {
- for(i=index; i+1<h->ref_count[list]; i++){
- if(ref->long_ref == h->ref_list[list][i].long_ref && ref->pic_id == h->ref_list[list][i].pic_id)
- break;
- }
- for(; i > index; i--){
- h->ref_list[list][i]= h->ref_list[list][i-1];
- }
- h->ref_list[list][index]= *ref;
- }
- }else{
- av_log(h->s.avctx, AV_LOG_ERROR, "illegal reordering_of_pic_nums_idc\n");
- return -1;
- }
- }
- }
-
- if(h->slice_type!=B_TYPE) break;
- }
- for(list=0; list<2; list++){
- for(index= 0; index < h->ref_count[list]; index++){
- if(!h->ref_list[list][index].data[0])
- h->ref_list[list][index]= s->current_picture;
- }
- if(h->slice_type!=B_TYPE) break;
- }
-
- if(h->slice_type==B_TYPE && !h->direct_spatial_mv_pred)
- direct_dist_scale_factor(h);
- direct_ref_list_init(h);
- return 0;
-}
-
-static void fill_mbaff_ref_list(H264Context *h){
- int list, i, j;
- for(list=0; list<2; list++){
- for(i=0; i<h->ref_count[list]; i++){
- Picture *frame = &h->ref_list[list][i];
- Picture *field = &h->ref_list[list][16+2*i];
- field[0] = *frame;
- for(j=0; j<3; j++)
- field[0].linesize[j] <<= 1;
- field[1] = field[0];
- for(j=0; j<3; j++)
- field[1].data[j] += frame->linesize[j];
-
- h->luma_weight[list][16+2*i] = h->luma_weight[list][16+2*i+1] = h->luma_weight[list][i];
- h->luma_offset[list][16+2*i] = h->luma_offset[list][16+2*i+1] = h->luma_offset[list][i];
- for(j=0; j<2; j++){
- h->chroma_weight[list][16+2*i][j] = h->chroma_weight[list][16+2*i+1][j] = h->chroma_weight[list][i][j];
- h->chroma_offset[list][16+2*i][j] = h->chroma_offset[list][16+2*i+1][j] = h->chroma_offset[list][i][j];
- }
- }
- }
- for(j=0; j<h->ref_count[1]; j++){
- for(i=0; i<h->ref_count[0]; i++)
- h->implicit_weight[j][16+2*i] = h->implicit_weight[j][16+2*i+1] = h->implicit_weight[j][i];
- memcpy(h->implicit_weight[16+2*j], h->implicit_weight[j], sizeof(*h->implicit_weight));
- memcpy(h->implicit_weight[16+2*j+1], h->implicit_weight[j], sizeof(*h->implicit_weight));
- }
-}
-
-static int pred_weight_table(H264Context *h){
- MpegEncContext * const s = &h->s;
- int list, i;
- int luma_def, chroma_def;
-
- h->use_weight= 0;
- h->use_weight_chroma= 0;
- h->luma_log2_weight_denom= get_ue_golomb(&s->gb);
- h->chroma_log2_weight_denom= get_ue_golomb(&s->gb);
- luma_def = 1<<h->luma_log2_weight_denom;
- chroma_def = 1<<h->chroma_log2_weight_denom;
-
- for(list=0; list<2; list++){
- for(i=0; i<h->ref_count[list]; i++){
- int luma_weight_flag, chroma_weight_flag;
-
- luma_weight_flag= get_bits1(&s->gb);
- if(luma_weight_flag){
- h->luma_weight[list][i]= get_se_golomb(&s->gb);
- h->luma_offset[list][i]= get_se_golomb(&s->gb);
- if( h->luma_weight[list][i] != luma_def
- || h->luma_offset[list][i] != 0)
- h->use_weight= 1;
- }else{
- h->luma_weight[list][i]= luma_def;
- h->luma_offset[list][i]= 0;
- }
-
- chroma_weight_flag= get_bits1(&s->gb);
- if(chroma_weight_flag){
- int j;
- for(j=0; j<2; j++){
- h->chroma_weight[list][i][j]= get_se_golomb(&s->gb);
- h->chroma_offset[list][i][j]= get_se_golomb(&s->gb);
- if( h->chroma_weight[list][i][j] != chroma_def
- || h->chroma_offset[list][i][j] != 0)
- h->use_weight_chroma= 1;
- }
- }else{
- int j;
- for(j=0; j<2; j++){
- h->chroma_weight[list][i][j]= chroma_def;
- h->chroma_offset[list][i][j]= 0;
- }
- }
- }
- if(h->slice_type != B_TYPE) break;
- }
- h->use_weight= h->use_weight || h->use_weight_chroma;
- return 0;
-}
-
-static void implicit_weight_table(H264Context *h){
- MpegEncContext * const s = &h->s;
- int ref0, ref1;
- int cur_poc = s->current_picture_ptr->poc;
-
- if( h->ref_count[0] == 1 && h->ref_count[1] == 1
- && h->ref_list[0][0].poc + h->ref_list[1][0].poc == 2*cur_poc){
- h->use_weight= 0;
- h->use_weight_chroma= 0;
- return;
- }
-
- h->use_weight= 2;
- h->use_weight_chroma= 2;
- h->luma_log2_weight_denom= 5;
- h->chroma_log2_weight_denom= 5;
-
- for(ref0=0; ref0 < h->ref_count[0]; ref0++){
- int poc0 = h->ref_list[0][ref0].poc;
- for(ref1=0; ref1 < h->ref_count[1]; ref1++){
- int poc1 = h->ref_list[1][ref1].poc;
- int td = clip(poc1 - poc0, -128, 127);
- if(td){
- int tb = clip(cur_poc - poc0, -128, 127);
- int tx = (16384 + (FFABS(td) >> 1)) / td;
- int dist_scale_factor = clip((tb*tx + 32) >> 6, -1024, 1023) >> 2;
- if(dist_scale_factor < -64 || dist_scale_factor > 128)
- h->implicit_weight[ref0][ref1] = 32;
- else
- h->implicit_weight[ref0][ref1] = 64 - dist_scale_factor;
- }else
- h->implicit_weight[ref0][ref1] = 32;
- }
- }
-}
-
-static inline void unreference_pic(H264Context *h, Picture *pic){
- int i;
- pic->reference=0;
- if(pic == h->delayed_output_pic)
- pic->reference=1;
- else{
- for(i = 0; h->delayed_pic[i]; i++)
- if(pic == h->delayed_pic[i]){
- pic->reference=1;
- break;
- }
- }
-}
-
-/**
- * instantaneous decoder refresh.
- */
-static void idr(H264Context *h){
- int i;
-
- for(i=0; i<16; i++){
- if (h->long_ref[i] != NULL) {
- unreference_pic(h, h->long_ref[i]);
- h->long_ref[i]= NULL;
- }
- }
- h->long_ref_count=0;
-
- for(i=0; i<h->short_ref_count; i++){
- unreference_pic(h, h->short_ref[i]);
- h->short_ref[i]= NULL;
- }
- h->short_ref_count=0;
-}
-
-/* forget old pics after a seek */
-static void flush_dpb(AVCodecContext *avctx){
- H264Context *h= avctx->priv_data;
- int i;
- for(i=0; i<16; i++) {
- if(h->delayed_pic[i])
- h->delayed_pic[i]->reference= 0;
- h->delayed_pic[i]= NULL;
- }
- if(h->delayed_output_pic)
- h->delayed_output_pic->reference= 0;
- h->delayed_output_pic= NULL;
- idr(h);
- if(h->s.current_picture_ptr)
- h->s.current_picture_ptr->reference= 0;
-}
-
-/**
- *
- * @return the removed picture or NULL if an error occurs
- */
-static Picture * remove_short(H264Context *h, int frame_num){
- MpegEncContext * const s = &h->s;
- int i;
-
- if(s->avctx->debug&FF_DEBUG_MMCO)
- av_log(h->s.avctx, AV_LOG_DEBUG, "remove short %d count %d\n", frame_num, h->short_ref_count);
-
- for(i=0; i<h->short_ref_count; i++){
- Picture *pic= h->short_ref[i];
- if(s->avctx->debug&FF_DEBUG_MMCO)
- av_log(h->s.avctx, AV_LOG_DEBUG, "%d %d %p\n", i, pic->frame_num, pic);
- if(pic->frame_num == frame_num){
- h->short_ref[i]= NULL;
- memmove(&h->short_ref[i], &h->short_ref[i+1], (h->short_ref_count - i - 1)*sizeof(Picture*));
- h->short_ref_count--;
- return pic;
- }
- }
- return NULL;
-}
-
-/**
- *
- * @return the removed picture or NULL if an error occurs
- */
-static Picture * remove_long(H264Context *h, int i){
- Picture *pic;
-
- pic= h->long_ref[i];
- h->long_ref[i]= NULL;
- if(pic) h->long_ref_count--;
-
- return pic;
-}
-
-/**
- * print short term list
- */
-static void print_short_term(H264Context *h) {
- uint32_t i;
- if(h->s.avctx->debug&FF_DEBUG_MMCO) {
- av_log(h->s.avctx, AV_LOG_DEBUG, "short term list:\n");
- for(i=0; i<h->short_ref_count; i++){
- Picture *pic= h->short_ref[i];
- av_log(h->s.avctx, AV_LOG_DEBUG, "%d fn:%d poc:%d %p\n", i, pic->frame_num, pic->poc, pic->data[0]);
- }
- }
-}
-
-/**
- * print long term list
- */
-static void print_long_term(H264Context *h) {
- uint32_t i;
- if(h->s.avctx->debug&FF_DEBUG_MMCO) {
- av_log(h->s.avctx, AV_LOG_DEBUG, "long term list:\n");
- for(i = 0; i < 16; i++){
- Picture *pic= h->long_ref[i];
- if (pic) {
- av_log(h->s.avctx, AV_LOG_DEBUG, "%d fn:%d poc:%d %p\n", i, pic->frame_num, pic->poc, pic->data[0]);
- }
- }
- }
-}
-
-/**
- * Executes the reference picture marking (memory management control operations).
- */
-static int execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count){
- MpegEncContext * const s = &h->s;
- int i, j;
- int current_is_long=0;
- Picture *pic;
-
- if((s->avctx->debug&FF_DEBUG_MMCO) && mmco_count==0)
- av_log(h->s.avctx, AV_LOG_DEBUG, "no mmco here\n");
-
- for(i=0; i<mmco_count; i++){
- if(s->avctx->debug&FF_DEBUG_MMCO)
- av_log(h->s.avctx, AV_LOG_DEBUG, "mmco:%d %d %d\n", h->mmco[i].opcode, h->mmco[i].short_frame_num, h->mmco[i].long_index);
-
- switch(mmco[i].opcode){
- case MMCO_SHORT2UNUSED:
- pic= remove_short(h, mmco[i].short_frame_num);
- if(pic)
- unreference_pic(h, pic);
- else if(s->avctx->debug&FF_DEBUG_MMCO)
- av_log(h->s.avctx, AV_LOG_DEBUG, "mmco: remove_short() failure\n");
- break;
- case MMCO_SHORT2LONG:
- pic= remove_long(h, mmco[i].long_index);
- if(pic) unreference_pic(h, pic);
-
- h->long_ref[ mmco[i].long_index ]= remove_short(h, mmco[i].short_frame_num);
- if (h->long_ref[ mmco[i].long_index ]){
- h->long_ref[ mmco[i].long_index ]->long_ref=1;
- h->long_ref_count++;
- }
- break;
- case MMCO_LONG2UNUSED:
- pic= remove_long(h, mmco[i].long_index);
- if(pic)
- unreference_pic(h, pic);
- else if(s->avctx->debug&FF_DEBUG_MMCO)
- av_log(h->s.avctx, AV_LOG_DEBUG, "mmco: remove_long() failure\n");
- break;
- case MMCO_LONG:
- pic= remove_long(h, mmco[i].long_index);
- if(pic) unreference_pic(h, pic);
-
- h->long_ref[ mmco[i].long_index ]= s->current_picture_ptr;
- h->long_ref[ mmco[i].long_index ]->long_ref=1;
- h->long_ref_count++;
-
- current_is_long=1;
- break;
- case MMCO_SET_MAX_LONG:
- assert(mmco[i].long_index <= 16);
- // just remove the long term which index is greater than new max
- for(j = mmco[i].long_index; j<16; j++){
- pic = remove_long(h, j);
- if (pic) unreference_pic(h, pic);
- }
- break;
- case MMCO_RESET:
- while(h->short_ref_count){
- pic= remove_short(h, h->short_ref[0]->frame_num);
- if(pic) unreference_pic(h, pic);
- }
- for(j = 0; j < 16; j++) {
- pic= remove_long(h, j);
- if(pic) unreference_pic(h, pic);
- }
- break;
- default: assert(0);
- }
- }
-
- if(!current_is_long){
- pic= remove_short(h, s->current_picture_ptr->frame_num);
- if(pic){
- unreference_pic(h, pic);
- av_log(h->s.avctx, AV_LOG_ERROR, "illegal short term buffer state detected\n");
- }
-
- if(h->short_ref_count)
- memmove(&h->short_ref[1], &h->short_ref[0], h->short_ref_count*sizeof(Picture*));
-
- h->short_ref[0]= s->current_picture_ptr;
- h->short_ref[0]->long_ref=0;
- h->short_ref_count++;
- }
-
- print_short_term(h);
- print_long_term(h);
- return 0;
-}
-
-static int decode_ref_pic_marking(H264Context *h){
- MpegEncContext * const s = &h->s;
- int i;
-
- if(h->nal_unit_type == NAL_IDR_SLICE){ //FIXME fields
- s->broken_link= get_bits1(&s->gb) -1;
- h->mmco[0].long_index= get_bits1(&s->gb) - 1; // current_long_term_idx
- if(h->mmco[0].long_index == -1)
- h->mmco_index= 0;
- else{
- h->mmco[0].opcode= MMCO_LONG;
- h->mmco_index= 1;
- }
- }else{
- if(get_bits1(&s->gb)){ // adaptive_ref_pic_marking_mode_flag
- for(i= 0; i<MAX_MMCO_COUNT; i++) {
- MMCOOpcode opcode= get_ue_golomb(&s->gb);;
-
- h->mmco[i].opcode= opcode;
- if(opcode==MMCO_SHORT2UNUSED || opcode==MMCO_SHORT2LONG){
- h->mmco[i].short_frame_num= (h->frame_num - get_ue_golomb(&s->gb) - 1) & ((1<<h->sps.log2_max_frame_num)-1); //FIXME fields
-/* if(h->mmco[i].short_frame_num >= h->short_ref_count || h->short_ref[ h->mmco[i].short_frame_num ] == NULL){
- av_log(s->avctx, AV_LOG_ERROR, "illegal short ref in memory management control operation %d\n", mmco);
- return -1;
- }*/
- }
- if(opcode==MMCO_SHORT2LONG || opcode==MMCO_LONG2UNUSED || opcode==MMCO_LONG || opcode==MMCO_SET_MAX_LONG){
- unsigned int long_index= get_ue_golomb(&s->gb);
- if(/*h->mmco[i].long_index >= h->long_ref_count || h->long_ref[ h->mmco[i].long_index ] == NULL*/ long_index >= 16){
- av_log(h->s.avctx, AV_LOG_ERROR, "illegal long ref in memory management control operation %d\n", opcode);
- return -1;
- }
- h->mmco[i].long_index= long_index;
- }
-
- if(opcode > (unsigned)MMCO_LONG){
- av_log(h->s.avctx, AV_LOG_ERROR, "illegal memory management control operation %d\n", opcode);
- return -1;
- }
- if(opcode == MMCO_END)
- break;
- }
- h->mmco_index= i;
- }else{
- assert(h->long_ref_count + h->short_ref_count <= h->sps.ref_frame_count);
-
- if(h->long_ref_count + h->short_ref_count == h->sps.ref_frame_count){ //FIXME fields
- h->mmco[0].opcode= MMCO_SHORT2UNUSED;
- h->mmco[0].short_frame_num= h->short_ref[ h->short_ref_count - 1 ]->frame_num;
- h->mmco_index= 1;
- }else
- h->mmco_index= 0;
- }
- }
-
- return 0;
-}
-
-static int init_poc(H264Context *h){
- MpegEncContext * const s = &h->s;
- const int max_frame_num= 1<<h->sps.log2_max_frame_num;
- int field_poc[2];
-
- if(h->nal_unit_type == NAL_IDR_SLICE){
- h->frame_num_offset= 0;
- }else{
- if(h->frame_num < h->prev_frame_num)
- h->frame_num_offset= h->prev_frame_num_offset + max_frame_num;
- else
- h->frame_num_offset= h->prev_frame_num_offset;
- }
-
- if(h->sps.poc_type==0){
- const int max_poc_lsb= 1<<h->sps.log2_max_poc_lsb;
-
- if(h->nal_unit_type == NAL_IDR_SLICE){
- h->prev_poc_msb=
- h->prev_poc_lsb= 0;
- }
-
- if (h->poc_lsb < h->prev_poc_lsb && h->prev_poc_lsb - h->poc_lsb >= max_poc_lsb/2)
- h->poc_msb = h->prev_poc_msb + max_poc_lsb;
- else if(h->poc_lsb > h->prev_poc_lsb && h->prev_poc_lsb - h->poc_lsb < -max_poc_lsb/2)
- h->poc_msb = h->prev_poc_msb - max_poc_lsb;
- else
- h->poc_msb = h->prev_poc_msb;
-//printf("poc: %d %d\n", h->poc_msb, h->poc_lsb);
- field_poc[0] =
- field_poc[1] = h->poc_msb + h->poc_lsb;
- if(s->picture_structure == PICT_FRAME)
- field_poc[1] += h->delta_poc_bottom;
- }else if(h->sps.poc_type==1){
- int abs_frame_num, expected_delta_per_poc_cycle, expectedpoc;
- int i;
-
- if(h->sps.poc_cycle_length != 0)
- abs_frame_num = h->frame_num_offset + h->frame_num;
- else
- abs_frame_num = 0;
-
- if(h->nal_ref_idc==0 && abs_frame_num > 0)
- abs_frame_num--;
-
- expected_delta_per_poc_cycle = 0;
- for(i=0; i < h->sps.poc_cycle_length; i++)
- expected_delta_per_poc_cycle += h->sps.offset_for_ref_frame[ i ]; //FIXME integrate during sps parse
-
- if(abs_frame_num > 0){
- int poc_cycle_cnt = (abs_frame_num - 1) / h->sps.poc_cycle_length;
- int frame_num_in_poc_cycle = (abs_frame_num - 1) % h->sps.poc_cycle_length;
-
- expectedpoc = poc_cycle_cnt * expected_delta_per_poc_cycle;
- for(i = 0; i <= frame_num_in_poc_cycle; i++)
- expectedpoc = expectedpoc + h->sps.offset_for_ref_frame[ i ];
- } else
- expectedpoc = 0;
-
- if(h->nal_ref_idc == 0)
- expectedpoc = expectedpoc + h->sps.offset_for_non_ref_pic;
-
- field_poc[0] = expectedpoc + h->delta_poc[0];
- field_poc[1] = field_poc[0] + h->sps.offset_for_top_to_bottom_field;
-
- if(s->picture_structure == PICT_FRAME)
- field_poc[1] += h->delta_poc[1];
- }else{
- int poc;
- if(h->nal_unit_type == NAL_IDR_SLICE){
- poc= 0;
- }else{
- if(h->nal_ref_idc) poc= 2*(h->frame_num_offset + h->frame_num);
- else poc= 2*(h->frame_num_offset + h->frame_num) - 1;
- }
- field_poc[0]= poc;
- field_poc[1]= poc;
- }
-
- if(s->picture_structure != PICT_BOTTOM_FIELD)
- s->current_picture_ptr->field_poc[0]= field_poc[0];
- if(s->picture_structure != PICT_TOP_FIELD)
- s->current_picture_ptr->field_poc[1]= field_poc[1];
- if(s->picture_structure == PICT_FRAME) // FIXME field pix?
- s->current_picture_ptr->poc= FFMIN(field_poc[0], field_poc[1]);
-
- return 0;
-}
-
-/**
- * decodes a slice header.
- * this will allso call MPV_common_init() and frame_start() as needed
- */
-static int decode_slice_header(H264Context *h){
- MpegEncContext * const s = &h->s;
- unsigned int first_mb_in_slice;
- unsigned int pps_id;
- int num_ref_idx_active_override_flag;
- static const uint8_t slice_type_map[5]= {P_TYPE, B_TYPE, I_TYPE, SP_TYPE, SI_TYPE};
- unsigned int slice_type, tmp;
- int default_ref_list_done = 0;
-
- s->current_picture.reference= h->nal_ref_idc != 0;
- s->dropable= h->nal_ref_idc == 0;
-
- first_mb_in_slice= get_ue_golomb(&s->gb);
-
- slice_type= get_ue_golomb(&s->gb);
- if(slice_type > 9){
- av_log(h->s.avctx, AV_LOG_ERROR, "slice type too large (%d) at %d %d\n", h->slice_type, s->mb_x, s->mb_y);
- return -1;
- }
- if(slice_type > 4){
- slice_type -= 5;
- h->slice_type_fixed=1;
- }else
- h->slice_type_fixed=0;
-
- slice_type= slice_type_map[ slice_type ];
- if (slice_type == I_TYPE
- || (h->slice_num != 0 && slice_type == h->slice_type) ) {
- default_ref_list_done = 1;
- }
- h->slice_type= slice_type;
-
- s->pict_type= h->slice_type; // to make a few old func happy, it's wrong though
-
- pps_id= get_ue_golomb(&s->gb);
- if(pps_id>=MAX_PPS_COUNT){
- av_log(h->s.avctx, AV_LOG_ERROR, "pps_id out of range\n");
- return -1;
- }
- h->pps= h->pps_buffer[pps_id];
- if(h->pps.slice_group_count == 0){
- av_log(h->s.avctx, AV_LOG_ERROR, "non existing PPS referenced\n");
- return -1;
- }
-
- h->sps= h->sps_buffer[ h->pps.sps_id ];
- if(h->sps.log2_max_frame_num == 0){
- av_log(h->s.avctx, AV_LOG_ERROR, "non existing SPS referenced\n");
- return -1;
- }
-
- if(h->dequant_coeff_pps != pps_id){
- h->dequant_coeff_pps = pps_id;
- init_dequant_tables(h);
- }
-
- s->mb_width= h->sps.mb_width;
- s->mb_height= h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag);
-
- h->b_stride= s->mb_width*4;
- h->b8_stride= s->mb_width*2;
-
- s->width = 16*s->mb_width - 2*(h->sps.crop_left + h->sps.crop_right );
- if(h->sps.frame_mbs_only_flag)
- s->height= 16*s->mb_height - 2*(h->sps.crop_top + h->sps.crop_bottom);
- else
- s->height= 16*s->mb_height - 4*(h->sps.crop_top + h->sps.crop_bottom); //FIXME recheck
-
- if (s->context_initialized
- && ( s->width != s->avctx->width || s->height != s->avctx->height)) {
- free_tables(h);
- MPV_common_end(s);
- }
- if (!s->context_initialized) {
- if (MPV_common_init(s) < 0)
- return -1;
-
- if(s->dsp.h264_idct_add == ff_h264_idct_add_c){ //FIXME little ugly
- memcpy(h->zigzag_scan, zigzag_scan, 16*sizeof(uint8_t));
- memcpy(h-> field_scan, field_scan, 16*sizeof(uint8_t));
- }else{
- int i;
- for(i=0; i<16; i++){
-#define T(x) (x>>2) | ((x<<2) & 0xF)
- h->zigzag_scan[i] = T(zigzag_scan[i]);
- h-> field_scan[i] = T( field_scan[i]);
-#undef T
- }
- }
- if(s->dsp.h264_idct8_add == ff_h264_idct8_add_c){
- memcpy(h->zigzag_scan8x8, zigzag_scan8x8, 64*sizeof(uint8_t));
- memcpy(h->zigzag_scan8x8_cavlc, zigzag_scan8x8_cavlc, 64*sizeof(uint8_t));
- memcpy(h->field_scan8x8, field_scan8x8, 64*sizeof(uint8_t));
- memcpy(h->field_scan8x8_cavlc, field_scan8x8_cavlc, 64*sizeof(uint8_t));
- }else{
- int i;
- for(i=0; i<64; i++){
-#define T(x) (x>>3) | ((x&7)<<3)
- h->zigzag_scan8x8[i] = T(zigzag_scan8x8[i]);
- h->zigzag_scan8x8_cavlc[i] = T(zigzag_scan8x8_cavlc[i]);
- h->field_scan8x8[i] = T(field_scan8x8[i]);
- h->field_scan8x8_cavlc[i] = T(field_scan8x8_cavlc[i]);
-#undef T
- }
- }
- if(h->sps.transform_bypass){ //FIXME same ugly
- h->zigzag_scan_q0 = zigzag_scan;
- h->zigzag_scan8x8_q0 = zigzag_scan8x8;
- h->zigzag_scan8x8_cavlc_q0 = zigzag_scan8x8_cavlc;
- h->field_scan_q0 = field_scan;
- h->field_scan8x8_q0 = field_scan8x8;
- h->field_scan8x8_cavlc_q0 = field_scan8x8_cavlc;
- }else{
- h->zigzag_scan_q0 = h->zigzag_scan;
- h->zigzag_scan8x8_q0 = h->zigzag_scan8x8;
- h->zigzag_scan8x8_cavlc_q0 = h->zigzag_scan8x8_cavlc;
- h->field_scan_q0 = h->field_scan;
- h->field_scan8x8_q0 = h->field_scan8x8;
- h->field_scan8x8_cavlc_q0 = h->field_scan8x8_cavlc;
- }
-
- alloc_tables(h);
-
- s->avctx->width = s->width;
- s->avctx->height = s->height;
- s->avctx->sample_aspect_ratio= h->sps.sar;
- if(!s->avctx->sample_aspect_ratio.den)
- s->avctx->sample_aspect_ratio.den = 1;
-
- if(h->sps.timing_info_present_flag){
- s->avctx->time_base= (AVRational){h->sps.num_units_in_tick * 2, h->sps.time_scale};
- if(h->x264_build > 0 && h->x264_build < 44)
- s->avctx->time_base.den *= 2;
- av_reduce(&s->avctx->time_base.num, &s->avctx->time_base.den,
- s->avctx->time_base.num, s->avctx->time_base.den, 1<<30);
- }
- }
-
- if(h->slice_num == 0){
- if(frame_start(h) < 0)
- return -1;
- }
-
- s->current_picture_ptr->frame_num= //FIXME frame_num cleanup
- h->frame_num= get_bits(&s->gb, h->sps.log2_max_frame_num);
-
- h->mb_mbaff = 0;
- h->mb_aff_frame = 0;
- if(h->sps.frame_mbs_only_flag){
- s->picture_structure= PICT_FRAME;
- }else{
- if(get_bits1(&s->gb)) { //field_pic_flag
- s->picture_structure= PICT_TOP_FIELD + get_bits1(&s->gb); //bottom_field_flag
- av_log(h->s.avctx, AV_LOG_ERROR, "PAFF interlacing is not implemented\n");
- } else {
- s->picture_structure= PICT_FRAME;
- h->mb_aff_frame = h->sps.mb_aff;
- }
- }
- assert(s->mb_num == s->mb_width * s->mb_height);
- if(first_mb_in_slice << h->mb_aff_frame >= s->mb_num ||
- first_mb_in_slice >= s->mb_num){
- av_log(h->s.avctx, AV_LOG_ERROR, "first_mb_in_slice overflow\n");
- return -1;
- }
- s->resync_mb_x = s->mb_x = first_mb_in_slice % s->mb_width;
- s->resync_mb_y = s->mb_y = (first_mb_in_slice / s->mb_width) << h->mb_aff_frame;
- assert(s->mb_y < s->mb_height);
-
- if(s->picture_structure==PICT_FRAME){
- h->curr_pic_num= h->frame_num;
- h->max_pic_num= 1<< h->sps.log2_max_frame_num;
- }else{
- h->curr_pic_num= 2*h->frame_num;
- h->max_pic_num= 1<<(h->sps.log2_max_frame_num + 1);
- }
-
- if(h->nal_unit_type == NAL_IDR_SLICE){
- get_ue_golomb(&s->gb); /* idr_pic_id */
- }
-
- if(h->sps.poc_type==0){
- h->poc_lsb= get_bits(&s->gb, h->sps.log2_max_poc_lsb);
-
- if(h->pps.pic_order_present==1 && s->picture_structure==PICT_FRAME){
- h->delta_poc_bottom= get_se_golomb(&s->gb);
- }
- }
-
- if(h->sps.poc_type==1 && !h->sps.delta_pic_order_always_zero_flag){
- h->delta_poc[0]= get_se_golomb(&s->gb);
-
- if(h->pps.pic_order_present==1 && s->picture_structure==PICT_FRAME)
- h->delta_poc[1]= get_se_golomb(&s->gb);
- }
-
- init_poc(h);
-
- if(h->pps.redundant_pic_cnt_present){
- h->redundant_pic_count= get_ue_golomb(&s->gb);
- }
-
- //set defaults, might be overriden a few line later
- h->ref_count[0]= h->pps.ref_count[0];
- h->ref_count[1]= h->pps.ref_count[1];
-
- if(h->slice_type == P_TYPE || h->slice_type == SP_TYPE || h->slice_type == B_TYPE){
- if(h->slice_type == B_TYPE){
- h->direct_spatial_mv_pred= get_bits1(&s->gb);
- if(h->sps.mb_aff && h->direct_spatial_mv_pred)
- av_log(h->s.avctx, AV_LOG_ERROR, "MBAFF + spatial direct mode is not implemented\n");
- }
- num_ref_idx_active_override_flag= get_bits1(&s->gb);
-
- if(num_ref_idx_active_override_flag){
- h->ref_count[0]= get_ue_golomb(&s->gb) + 1;
- if(h->slice_type==B_TYPE)
- h->ref_count[1]= get_ue_golomb(&s->gb) + 1;
-
- if(h->ref_count[0] > 32 || h->ref_count[1] > 32){
- av_log(h->s.avctx, AV_LOG_ERROR, "reference overflow\n");
- h->ref_count[0]= h->ref_count[1]= 1;
- return -1;
- }
- }
- }
-
- if(!default_ref_list_done){
- fill_default_ref_list(h);
- }
-
- if(decode_ref_pic_list_reordering(h) < 0)
- return -1;
-
- if( (h->pps.weighted_pred && (h->slice_type == P_TYPE || h->slice_type == SP_TYPE ))
- || (h->pps.weighted_bipred_idc==1 && h->slice_type==B_TYPE ) )
- pred_weight_table(h);
- else if(h->pps.weighted_bipred_idc==2 && h->slice_type==B_TYPE)
- implicit_weight_table(h);
- else
- h->use_weight = 0;
-
- if(s->current_picture.reference)
- decode_ref_pic_marking(h);
-
- if(FRAME_MBAFF)
- fill_mbaff_ref_list(h);
-
- if( h->slice_type != I_TYPE && h->slice_type != SI_TYPE && h->pps.cabac ){
- tmp = get_ue_golomb(&s->gb);
- if(tmp > 2){
- av_log(s->avctx, AV_LOG_ERROR, "cabac_init_idc overflow\n");
- return -1;
- }
- h->cabac_init_idc= tmp;
- }
-
- h->last_qscale_diff = 0;
- tmp = h->pps.init_qp + get_se_golomb(&s->gb);
- if(tmp>51){
- av_log(s->avctx, AV_LOG_ERROR, "QP %u out of range\n", tmp);
- return -1;
- }
- s->qscale= tmp;
- h->chroma_qp = get_chroma_qp(h->pps.chroma_qp_index_offset, s->qscale);
- //FIXME qscale / qp ... stuff
- if(h->slice_type == SP_TYPE){
- get_bits1(&s->gb); /* sp_for_switch_flag */
- }
- if(h->slice_type==SP_TYPE || h->slice_type == SI_TYPE){
- get_se_golomb(&s->gb); /* slice_qs_delta */
- }
-
- h->deblocking_filter = 1;
- h->slice_alpha_c0_offset = 0;
- h->slice_beta_offset = 0;
- if( h->pps.deblocking_filter_parameters_present ) {
- tmp= get_ue_golomb(&s->gb);
- if(tmp > 2){
- av_log(s->avctx, AV_LOG_ERROR, "deblocking_filter_idc %u out of range\n", tmp);
- return -1;
- }
- h->deblocking_filter= tmp;
- if(h->deblocking_filter < 2)
- h->deblocking_filter^= 1; // 1<->0
-
- if( h->deblocking_filter ) {
- h->slice_alpha_c0_offset = get_se_golomb(&s->gb) << 1;
- h->slice_beta_offset = get_se_golomb(&s->gb) << 1;
- }
- }
- if( s->avctx->skip_loop_filter >= AVDISCARD_ALL
- ||(s->avctx->skip_loop_filter >= AVDISCARD_NONKEY && h->slice_type != I_TYPE)
- ||(s->avctx->skip_loop_filter >= AVDISCARD_BIDIR && h->slice_type == B_TYPE)
- ||(s->avctx->skip_loop_filter >= AVDISCARD_NONREF && h->nal_ref_idc == 0))
- h->deblocking_filter= 0;
-
-#if 0 //FMO
- if( h->pps.num_slice_groups > 1 && h->pps.mb_slice_group_map_type >= 3 && h->pps.mb_slice_group_map_type <= 5)
- slice_group_change_cycle= get_bits(&s->gb, ?);
-#endif
-
- h->slice_num++;
-
- h->emu_edge_width= (s->flags&CODEC_FLAG_EMU_EDGE) ? 0 : 16;
- h->emu_edge_height= FRAME_MBAFF ? 0 : h->emu_edge_width;
-
- if(s->avctx->debug&FF_DEBUG_PICT_INFO){
- av_log(h->s.avctx, AV_LOG_DEBUG, "slice:%d %s mb:%d %c pps:%u frame:%d poc:%d/%d ref:%d/%d qp:%d loop:%d:%d:%d weight:%d%s\n",
- h->slice_num,
- (s->picture_structure==PICT_FRAME ? "F" : s->picture_structure==PICT_TOP_FIELD ? "T" : "B"),
- first_mb_in_slice,
- av_get_pict_type_char(h->slice_type),
- pps_id, h->frame_num,
- s->current_picture_ptr->field_poc[0], s->current_picture_ptr->field_poc[1],
- h->ref_count[0], h->ref_count[1],
- s->qscale,
- h->deblocking_filter, h->slice_alpha_c0_offset/2, h->slice_beta_offset/2,
- h->use_weight,
- h->use_weight==1 && h->use_weight_chroma ? "c" : ""
- );
- }
-
- if((s->avctx->flags2 & CODEC_FLAG2_FAST) && !s->current_picture.reference){
- s->me.qpel_put= s->dsp.put_2tap_qpel_pixels_tab;
- s->me.qpel_avg= s->dsp.avg_2tap_qpel_pixels_tab;
- }else{
- s->me.qpel_put= s->dsp.put_h264_qpel_pixels_tab;
- s->me.qpel_avg= s->dsp.avg_h264_qpel_pixels_tab;
- }
-
- return 0;
-}
-
-/**
- *
- */
-static inline int get_level_prefix(GetBitContext *gb){
- unsigned int buf;
- int log;
-
- OPEN_READER(re, gb);
- UPDATE_CACHE(re, gb);
- buf=GET_CACHE(re, gb);
-
- log= 32 - av_log2(buf);
-#ifdef TRACE
- print_bin(buf>>(32-log), log);
- av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d lpr @%5d in %s get_level_prefix\n", buf>>(32-log), log, log-1, get_bits_count(gb), __FILE__);
-#endif
-
- LAST_SKIP_BITS(re, gb, log);
- CLOSE_READER(re, gb);
-
- return log-1;
-}
-
-static inline int get_dct8x8_allowed(H264Context *h){
- int i;
- for(i=0; i<4; i++){
- if(!IS_SUB_8X8(h->sub_mb_type[i])
- || (!h->sps.direct_8x8_inference_flag && IS_DIRECT(h->sub_mb_type[i])))
- return 0;
- }
- return 1;
-}
-
-/**
- * decodes a residual block.
- * @param n block index
- * @param scantable scantable
- * @param max_coeff number of coefficients in the block
- * @return <0 if an error occured
- */
-static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff){
- MpegEncContext * const s = &h->s;
- static const int coeff_token_table_index[17]= {0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3};
- int level[16];
- int zeros_left, coeff_num, coeff_token, total_coeff, i, j, trailing_ones, run_before;
-
- //FIXME put trailing_onex into the context
-
- if(n == CHROMA_DC_BLOCK_INDEX){
- coeff_token= get_vlc2(gb, chroma_dc_coeff_token_vlc.table, CHROMA_DC_COEFF_TOKEN_VLC_BITS, 1);
- total_coeff= coeff_token>>2;
- }else{
- if(n == LUMA_DC_BLOCK_INDEX){
- total_coeff= pred_non_zero_count(h, 0);
- coeff_token= get_vlc2(gb, coeff_token_vlc[ coeff_token_table_index[total_coeff] ].table, COEFF_TOKEN_VLC_BITS, 2);
- total_coeff= coeff_token>>2;
- }else{
- total_coeff= pred_non_zero_count(h, n);
- coeff_token= get_vlc2(gb, coeff_token_vlc[ coeff_token_table_index[total_coeff] ].table, COEFF_TOKEN_VLC_BITS, 2);
- total_coeff= coeff_token>>2;
- h->non_zero_count_cache[ scan8[n] ]= total_coeff;
- }
- }
-
- //FIXME set last_non_zero?
-
- if(total_coeff==0)
- return 0;
- if(total_coeff > (unsigned)max_coeff) {
- av_log(h->s.avctx, AV_LOG_ERROR, "corrupted macroblock %d %d (total_coeff=%d)\n", s->mb_x, s->mb_y, total_coeff);
- return -1;
- }
-
- trailing_ones= coeff_token&3;
- tprintf("trailing:%d, total:%d\n", trailing_ones, total_coeff);
- assert(total_coeff<=16);
-
- for(i=0; i<trailing_ones; i++){
- level[i]= 1 - 2*get_bits1(gb);
- }
-
- if(i<total_coeff) {
- int level_code, mask;
- int suffix_length = total_coeff > 10 && trailing_ones < 3;
- int prefix= get_level_prefix(gb);
-
- //first coefficient has suffix_length equal to 0 or 1
- if(prefix<14){ //FIXME try to build a large unified VLC table for all this
- if(suffix_length)
- level_code= (prefix<<suffix_length) + get_bits(gb, suffix_length); //part
- else
- level_code= (prefix<<suffix_length); //part
- }else if(prefix==14){
- if(suffix_length)
- level_code= (prefix<<suffix_length) + get_bits(gb, suffix_length); //part
- else
- level_code= prefix + get_bits(gb, 4); //part
- }else if(prefix==15){
- level_code= (prefix<<suffix_length) + get_bits(gb, 12); //part
- if(suffix_length==0) level_code+=15; //FIXME doesn't make (much)sense
- }else{
- av_log(h->s.avctx, AV_LOG_ERROR, "prefix too large at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
-
- if(trailing_ones < 3) level_code += 2;
-
- suffix_length = 1;
- if(level_code > 5)
- suffix_length++;
- mask= -(level_code&1);
- level[i]= (((2+level_code)>>1) ^ mask) - mask;
- i++;
-
- //remaining coefficients have suffix_length > 0
- for(;i<total_coeff;i++) {
- static const int suffix_limit[7] = {0,5,11,23,47,95,INT_MAX };
- prefix = get_level_prefix(gb);
- if(prefix<15){
- level_code = (prefix<<suffix_length) + get_bits(gb, suffix_length);
- }else if(prefix==15){
- level_code = (prefix<<suffix_length) + get_bits(gb, 12);
- }else{
- av_log(h->s.avctx, AV_LOG_ERROR, "prefix too large at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
- mask= -(level_code&1);
- level[i]= (((2+level_code)>>1) ^ mask) - mask;
- if(level_code > suffix_limit[suffix_length])
- suffix_length++;
- }
- }
-
- if(total_coeff == max_coeff)
- zeros_left=0;
- else{
- if(n == CHROMA_DC_BLOCK_INDEX)
- zeros_left= get_vlc2(gb, chroma_dc_total_zeros_vlc[ total_coeff-1 ].table, CHROMA_DC_TOTAL_ZEROS_VLC_BITS, 1);
- else
- zeros_left= get_vlc2(gb, total_zeros_vlc[ total_coeff-1 ].table, TOTAL_ZEROS_VLC_BITS, 1);
- }
-
- coeff_num = zeros_left + total_coeff - 1;
- j = scantable[coeff_num];
- if(n > 24){
- block[j] = level[0];
- for(i=1;i<total_coeff;i++) {
- if(zeros_left <= 0)
- run_before = 0;
- else if(zeros_left < 7){
- run_before= get_vlc2(gb, run_vlc[zeros_left-1].table, RUN_VLC_BITS, 1);
- }else{
- run_before= get_vlc2(gb, run7_vlc.table, RUN7_VLC_BITS, 2);
- }
- zeros_left -= run_before;
- coeff_num -= 1 + run_before;
- j= scantable[ coeff_num ];
-
- block[j]= level[i];
- }
- }else{
- block[j] = (level[0] * qmul[j] + 32)>>6;
- for(i=1;i<total_coeff;i++) {
- if(zeros_left <= 0)
- run_before = 0;
- else if(zeros_left < 7){
- run_before= get_vlc2(gb, run_vlc[zeros_left-1].table, RUN_VLC_BITS, 1);
- }else{
- run_before= get_vlc2(gb, run7_vlc.table, RUN7_VLC_BITS, 2);
- }
- zeros_left -= run_before;
- coeff_num -= 1 + run_before;
- j= scantable[ coeff_num ];
-
- block[j]= (level[i] * qmul[j] + 32)>>6;
- }
- }
-
- if(zeros_left<0){
- av_log(h->s.avctx, AV_LOG_ERROR, "negative number of zero coeffs at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
-
- return 0;
-}
-
-static void predict_field_decoding_flag(H264Context *h){
- MpegEncContext * const s = &h->s;
- const int mb_xy= s->mb_x + s->mb_y*s->mb_stride;
- int mb_type = (h->slice_table[mb_xy-1] == h->slice_num)
- ? s->current_picture.mb_type[mb_xy-1]
- : (h->slice_table[mb_xy-s->mb_stride] == h->slice_num)
- ? s->current_picture.mb_type[mb_xy-s->mb_stride]
- : 0;
- h->mb_mbaff = h->mb_field_decoding_flag = IS_INTERLACED(mb_type) ? 1 : 0;
-}
-
-/**
- * decodes a P_SKIP or B_SKIP macroblock
- */
-static void decode_mb_skip(H264Context *h){
- MpegEncContext * const s = &h->s;
- const int mb_xy= s->mb_x + s->mb_y*s->mb_stride;
- int mb_type=0;
-
- memset(h->non_zero_count[mb_xy], 0, 16);
- memset(h->non_zero_count_cache + 8, 0, 8*5); //FIXME ugly, remove pfui
-
- if(MB_FIELD)
- mb_type|= MB_TYPE_INTERLACED;
-
- if( h->slice_type == B_TYPE )
- {
- // just for fill_caches. pred_direct_motion will set the real mb_type
- mb_type|= MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2|MB_TYPE_SKIP;
-
- fill_caches(h, mb_type, 0); //FIXME check what is needed and what not ...
- pred_direct_motion(h, &mb_type);
- mb_type|= MB_TYPE_SKIP;
- }
- else
- {
- int mx, my;
- mb_type|= MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P1L0|MB_TYPE_SKIP;
-
- fill_caches(h, mb_type, 0); //FIXME check what is needed and what not ...
- pred_pskip_motion(h, &mx, &my);
- fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, 0, 1);
- fill_rectangle( h->mv_cache[0][scan8[0]], 4, 4, 8, pack16to32(mx,my), 4);
- }
-
- write_back_motion(h, mb_type);
- s->current_picture.mb_type[mb_xy]= mb_type;
- s->current_picture.qscale_table[mb_xy]= s->qscale;
- h->slice_table[ mb_xy ]= h->slice_num;
- h->prev_mb_skipped= 1;
-}
-
-/**
- * decodes a macroblock
- * @returns 0 if ok, AC_ERROR / DC_ERROR / MV_ERROR if an error is noticed
- */
-static int decode_mb_cavlc(H264Context *h){
- MpegEncContext * const s = &h->s;
- const int mb_xy= s->mb_x + s->mb_y*s->mb_stride;
- int partition_count;
- unsigned int mb_type, cbp;
- int dct8x8_allowed= h->pps.transform_8x8_mode;
-
- s->dsp.clear_blocks(h->mb); //FIXME avoid if already clear (move after skip handlong?
-
- tprintf("pic:%d mb:%d/%d\n", h->frame_num, s->mb_x, s->mb_y);
- cbp = 0; /* avoid warning. FIXME: find a solution without slowing
- down the code */
- if(h->slice_type != I_TYPE && h->slice_type != SI_TYPE){
- if(s->mb_skip_run==-1)
- s->mb_skip_run= get_ue_golomb(&s->gb);
-
- if (s->mb_skip_run--) {
- if(FRAME_MBAFF && (s->mb_y&1) == 0){
- if(s->mb_skip_run==0)
- h->mb_mbaff = h->mb_field_decoding_flag = get_bits1(&s->gb);
- else
- predict_field_decoding_flag(h);
- }
- decode_mb_skip(h);
- return 0;
- }
- }
- if(FRAME_MBAFF){
- if( (s->mb_y&1) == 0 )
- h->mb_mbaff = h->mb_field_decoding_flag = get_bits1(&s->gb);
- }else
- h->mb_field_decoding_flag= (s->picture_structure!=PICT_FRAME);
-
- h->prev_mb_skipped= 0;
-
- mb_type= get_ue_golomb(&s->gb);
- if(h->slice_type == B_TYPE){
- if(mb_type < 23){
- partition_count= b_mb_type_info[mb_type].partition_count;
- mb_type= b_mb_type_info[mb_type].type;
- }else{
- mb_type -= 23;
- goto decode_intra_mb;
- }
- }else if(h->slice_type == P_TYPE /*|| h->slice_type == SP_TYPE */){
- if(mb_type < 5){
- partition_count= p_mb_type_info[mb_type].partition_count;
- mb_type= p_mb_type_info[mb_type].type;
- }else{
- mb_type -= 5;
- goto decode_intra_mb;
- }
- }else{
- assert(h->slice_type == I_TYPE);
-decode_intra_mb:
- if(mb_type > 25){
- av_log(h->s.avctx, AV_LOG_ERROR, "mb_type %d in %c slice too large at %d %d\n", mb_type, av_get_pict_type_char(h->slice_type), s->mb_x, s->mb_y);
- return -1;
- }
- partition_count=0;
- cbp= i_mb_type_info[mb_type].cbp;
- h->intra16x16_pred_mode= i_mb_type_info[mb_type].pred_mode;
- mb_type= i_mb_type_info[mb_type].type;
- }
-
- if(MB_FIELD)
- mb_type |= MB_TYPE_INTERLACED;
-
- h->slice_table[ mb_xy ]= h->slice_num;
-
- if(IS_INTRA_PCM(mb_type)){
- unsigned int x, y;
-
- // we assume these blocks are very rare so we dont optimize it
- align_get_bits(&s->gb);
-
- // The pixels are stored in the same order as levels in h->mb array.
- for(y=0; y<16; y++){
- const int index= 4*(y&3) + 32*((y>>2)&1) + 128*(y>>3);
- for(x=0; x<16; x++){
- tprintf("LUMA ICPM LEVEL (%3d)\n", show_bits(&s->gb, 8));
- h->mb[index + (x&3) + 16*((x>>2)&1) + 64*(x>>3)]= get_bits(&s->gb, 8);
- }
- }
- for(y=0; y<8; y++){
- const int index= 256 + 4*(y&3) + 32*(y>>2);
- for(x=0; x<8; x++){
- tprintf("CHROMA U ICPM LEVEL (%3d)\n", show_bits(&s->gb, 8));
- h->mb[index + (x&3) + 16*(x>>2)]= get_bits(&s->gb, 8);
- }
- }
- for(y=0; y<8; y++){
- const int index= 256 + 64 + 4*(y&3) + 32*(y>>2);
- for(x=0; x<8; x++){
- tprintf("CHROMA V ICPM LEVEL (%3d)\n", show_bits(&s->gb, 8));
- h->mb[index + (x&3) + 16*(x>>2)]= get_bits(&s->gb, 8);
- }
- }
-
- // In deblocking, the quantizer is 0
- s->current_picture.qscale_table[mb_xy]= 0;
- h->chroma_qp = get_chroma_qp(h->pps.chroma_qp_index_offset, 0);
- // All coeffs are present
- memset(h->non_zero_count[mb_xy], 16, 16);
-
- s->current_picture.mb_type[mb_xy]= mb_type;
- return 0;
- }
-
- if(MB_MBAFF){
- h->ref_count[0] <<= 1;
- h->ref_count[1] <<= 1;
- }
-
- fill_caches(h, mb_type, 0);
-
- //mb_pred
- if(IS_INTRA(mb_type)){
- int pred_mode;
-// init_top_left_availability(h);
- if(IS_INTRA4x4(mb_type)){
- int i;
- int di = 1;
- if(dct8x8_allowed && get_bits1(&s->gb)){
- mb_type |= MB_TYPE_8x8DCT;
- di = 4;
- }
-
-// fill_intra4x4_pred_table(h);
- for(i=0; i<16; i+=di){
- int mode= pred_intra_mode(h, i);
-
- if(!get_bits1(&s->gb)){
- const int rem_mode= get_bits(&s->gb, 3);
- mode = rem_mode + (rem_mode >= mode);
- }
-
- if(di==4)
- fill_rectangle( &h->intra4x4_pred_mode_cache[ scan8[i] ], 2, 2, 8, mode, 1 );
- else
- h->intra4x4_pred_mode_cache[ scan8[i] ] = mode;
- }
- write_back_intra_pred_mode(h);
- if( check_intra4x4_pred_mode(h) < 0)
- return -1;
- }else{
- h->intra16x16_pred_mode= check_intra_pred_mode(h, h->intra16x16_pred_mode);
- if(h->intra16x16_pred_mode < 0)
- return -1;
- }
-
- pred_mode= check_intra_pred_mode(h, get_ue_golomb(&s->gb));
- if(pred_mode < 0)
- return -1;
- h->chroma_pred_mode= pred_mode;
- }else if(partition_count==4){
- int i, j, sub_partition_count[4], list, ref[2][4];
-
- if(h->slice_type == B_TYPE){
- for(i=0; i<4; i++){
- h->sub_mb_type[i]= get_ue_golomb(&s->gb);
- if(h->sub_mb_type[i] >=13){
- av_log(h->s.avctx, AV_LOG_ERROR, "B sub_mb_type %u out of range at %d %d\n", h->sub_mb_type[i], s->mb_x, s->mb_y);
- return -1;
- }
- sub_partition_count[i]= b_sub_mb_type_info[ h->sub_mb_type[i] ].partition_count;
- h->sub_mb_type[i]= b_sub_mb_type_info[ h->sub_mb_type[i] ].type;
- }
- if( IS_DIRECT(h->sub_mb_type[0]) || IS_DIRECT(h->sub_mb_type[1])
- || IS_DIRECT(h->sub_mb_type[2]) || IS_DIRECT(h->sub_mb_type[3])) {
- pred_direct_motion(h, &mb_type);
- h->ref_cache[0][scan8[4]] =
- h->ref_cache[1][scan8[4]] =
- h->ref_cache[0][scan8[12]] =
- h->ref_cache[1][scan8[12]] = PART_NOT_AVAILABLE;
- }
- }else{
- assert(h->slice_type == P_TYPE || h->slice_type == SP_TYPE); //FIXME SP correct ?
- for(i=0; i<4; i++){
- h->sub_mb_type[i]= get_ue_golomb(&s->gb);
- if(h->sub_mb_type[i] >=4){
- av_log(h->s.avctx, AV_LOG_ERROR, "P sub_mb_type %u out of range at %d %d\n", h->sub_mb_type[i], s->mb_x, s->mb_y);
- return -1;
- }
- sub_partition_count[i]= p_sub_mb_type_info[ h->sub_mb_type[i] ].partition_count;
- h->sub_mb_type[i]= p_sub_mb_type_info[ h->sub_mb_type[i] ].type;
- }
- }
-
- for(list=0; list<2; list++){
- int ref_count= IS_REF0(mb_type) ? 1 : h->ref_count[list];
- if(ref_count == 0) continue;
- for(i=0; i<4; i++){
- if(IS_DIRECT(h->sub_mb_type[i])) continue;
- if(IS_DIR(h->sub_mb_type[i], 0, list)){
- unsigned int tmp = get_te0_golomb(&s->gb, ref_count); //FIXME init to 0 before and skip?
- if(tmp>=ref_count){
- av_log(h->s.avctx, AV_LOG_ERROR, "ref %u overflow\n", tmp);
- return -1;
- }
- ref[list][i]= tmp;
- }else{
- //FIXME
- ref[list][i] = -1;
- }
- }
- }
-
- if(dct8x8_allowed)
- dct8x8_allowed = get_dct8x8_allowed(h);
-
- for(list=0; list<2; list++){
- const int ref_count= IS_REF0(mb_type) ? 1 : h->ref_count[list];
- if(ref_count == 0) continue;
-
- for(i=0; i<4; i++){
- if(IS_DIRECT(h->sub_mb_type[i])) {
- h->ref_cache[list][ scan8[4*i] ] = h->ref_cache[list][ scan8[4*i]+1 ];
- continue;
- }
- h->ref_cache[list][ scan8[4*i] ]=h->ref_cache[list][ scan8[4*i]+1 ]=
- h->ref_cache[list][ scan8[4*i]+8 ]=h->ref_cache[list][ scan8[4*i]+9 ]= ref[list][i];
-
- if(IS_DIR(h->sub_mb_type[i], 0, list)){
- const int sub_mb_type= h->sub_mb_type[i];
- const int block_width= (sub_mb_type & (MB_TYPE_16x16|MB_TYPE_16x8)) ? 2 : 1;
- for(j=0; j<sub_partition_count[i]; j++){
- int mx, my;
- const int index= 4*i + block_width*j;
- int16_t (* mv_cache)[2]= &h->mv_cache[list][ scan8[index] ];
- pred_motion(h, index, block_width, list, h->ref_cache[list][ scan8[index] ], &mx, &my);
- mx += get_se_golomb(&s->gb);
- my += get_se_golomb(&s->gb);
- tprintf("final mv:%d %d\n", mx, my);
-
- if(IS_SUB_8X8(sub_mb_type)){
- mv_cache[ 0 ][0]= mv_cache[ 1 ][0]=
- mv_cache[ 8 ][0]= mv_cache[ 9 ][0]= mx;
- mv_cache[ 0 ][1]= mv_cache[ 1 ][1]=
- mv_cache[ 8 ][1]= mv_cache[ 9 ][1]= my;
- }else if(IS_SUB_8X4(sub_mb_type)){
- mv_cache[ 0 ][0]= mv_cache[ 1 ][0]= mx;
- mv_cache[ 0 ][1]= mv_cache[ 1 ][1]= my;
- }else if(IS_SUB_4X8(sub_mb_type)){
- mv_cache[ 0 ][0]= mv_cache[ 8 ][0]= mx;
- mv_cache[ 0 ][1]= mv_cache[ 8 ][1]= my;
- }else{
- assert(IS_SUB_4X4(sub_mb_type));
- mv_cache[ 0 ][0]= mx;
- mv_cache[ 0 ][1]= my;
- }
- }
- }else{
- uint32_t *p= (uint32_t *)&h->mv_cache[list][ scan8[4*i] ][0];
- p[0] = p[1]=
- p[8] = p[9]= 0;
- }
- }
- }
- }else if(IS_DIRECT(mb_type)){
- pred_direct_motion(h, &mb_type);
- dct8x8_allowed &= h->sps.direct_8x8_inference_flag;
- }else{
- int list, mx, my, i;
- //FIXME we should set ref_idx_l? to 0 if we use that later ...
- if(IS_16X16(mb_type)){
- for(list=0; list<2; list++){
- if(h->ref_count[list]>0){
- if(IS_DIR(mb_type, 0, list)){
- unsigned int val= get_te0_golomb(&s->gb, h->ref_count[list]);
- if(val >= h->ref_count[list]){
- av_log(h->s.avctx, AV_LOG_ERROR, "ref %u overflow\n", val);
- return -1;
- }
- fill_rectangle(&h->ref_cache[list][ scan8[0] ], 4, 4, 8, val, 1);
- }else
- fill_rectangle(&h->ref_cache[list][ scan8[0] ], 4, 4, 8, (LIST_NOT_USED&0xFF), 1);
- }
- }
- for(list=0; list<2; list++){
- if(IS_DIR(mb_type, 0, list)){
- pred_motion(h, 0, 4, list, h->ref_cache[list][ scan8[0] ], &mx, &my);
- mx += get_se_golomb(&s->gb);
- my += get_se_golomb(&s->gb);
- tprintf("final mv:%d %d\n", mx, my);
-
- fill_rectangle(h->mv_cache[list][ scan8[0] ], 4, 4, 8, pack16to32(mx,my), 4);
- }else
- fill_rectangle(h->mv_cache[list][ scan8[0] ], 4, 4, 8, 0, 4);
- }
- }
- else if(IS_16X8(mb_type)){
- for(list=0; list<2; list++){
- if(h->ref_count[list]>0){
- for(i=0; i<2; i++){
- if(IS_DIR(mb_type, i, list)){
- unsigned int val= get_te0_golomb(&s->gb, h->ref_count[list]);
- if(val >= h->ref_count[list]){
- av_log(h->s.avctx, AV_LOG_ERROR, "ref %u overflow\n", val);
- return -1;
- }
- fill_rectangle(&h->ref_cache[list][ scan8[0] + 16*i ], 4, 2, 8, val, 1);
- }else
- fill_rectangle(&h->ref_cache[list][ scan8[0] + 16*i ], 4, 2, 8, (LIST_NOT_USED&0xFF), 1);
- }
- }
- }
- for(list=0; list<2; list++){
- for(i=0; i<2; i++){
- if(IS_DIR(mb_type, i, list)){
- pred_16x8_motion(h, 8*i, list, h->ref_cache[list][scan8[0] + 16*i], &mx, &my);
- mx += get_se_golomb(&s->gb);
- my += get_se_golomb(&s->gb);
- tprintf("final mv:%d %d\n", mx, my);
-
- fill_rectangle(h->mv_cache[list][ scan8[0] + 16*i ], 4, 2, 8, pack16to32(mx,my), 4);
- }else
- fill_rectangle(h->mv_cache[list][ scan8[0] + 16*i ], 4, 2, 8, 0, 4);
- }
- }
- }else{
- assert(IS_8X16(mb_type));
- for(list=0; list<2; list++){
- if(h->ref_count[list]>0){
- for(i=0; i<2; i++){
- if(IS_DIR(mb_type, i, list)){ //FIXME optimize
- unsigned int val= get_te0_golomb(&s->gb, h->ref_count[list]);
- if(val >= h->ref_count[list]){
- av_log(h->s.avctx, AV_LOG_ERROR, "ref %u overflow\n", val);
- return -1;
- }
- fill_rectangle(&h->ref_cache[list][ scan8[0] + 2*i ], 2, 4, 8, val, 1);
- }else
- fill_rectangle(&h->ref_cache[list][ scan8[0] + 2*i ], 2, 4, 8, (LIST_NOT_USED&0xFF), 1);
- }
- }
- }
- for(list=0; list<2; list++){
- for(i=0; i<2; i++){
- if(IS_DIR(mb_type, i, list)){
- pred_8x16_motion(h, i*4, list, h->ref_cache[list][ scan8[0] + 2*i ], &mx, &my);
- mx += get_se_golomb(&s->gb);
- my += get_se_golomb(&s->gb);
- tprintf("final mv:%d %d\n", mx, my);
-
- fill_rectangle(h->mv_cache[list][ scan8[0] + 2*i ], 2, 4, 8, pack16to32(mx,my), 4);
- }else
- fill_rectangle(h->mv_cache[list][ scan8[0] + 2*i ], 2, 4, 8, 0, 4);
- }
- }
- }
- }
-
- if(IS_INTER(mb_type))
- write_back_motion(h, mb_type);
-
- if(!IS_INTRA16x16(mb_type)){
- cbp= get_ue_golomb(&s->gb);
- if(cbp > 47){
- av_log(h->s.avctx, AV_LOG_ERROR, "cbp too large (%u) at %d %d\n", cbp, s->mb_x, s->mb_y);
- return -1;
- }
-
- if(IS_INTRA4x4(mb_type))
- cbp= golomb_to_intra4x4_cbp[cbp];
- else
- cbp= golomb_to_inter_cbp[cbp];
- }
- h->cbp = cbp;
-
- if(dct8x8_allowed && (cbp&15) && !IS_INTRA(mb_type)){
- if(get_bits1(&s->gb))
- mb_type |= MB_TYPE_8x8DCT;
- }
- s->current_picture.mb_type[mb_xy]= mb_type;
-
- if(cbp || IS_INTRA16x16(mb_type)){
- int i8x8, i4x4, chroma_idx;
- int chroma_qp, dquant;
- GetBitContext *gb= IS_INTRA(mb_type) ? h->intra_gb_ptr : h->inter_gb_ptr;
- const uint8_t *scan, *scan8x8, *dc_scan;
-
-// fill_non_zero_count_cache(h);
-
- if(IS_INTERLACED(mb_type)){
- scan8x8= s->qscale ? h->field_scan8x8_cavlc : h->field_scan8x8_cavlc_q0;
- scan= s->qscale ? h->field_scan : h->field_scan_q0;
- dc_scan= luma_dc_field_scan;
- }else{
- scan8x8= s->qscale ? h->zigzag_scan8x8_cavlc : h->zigzag_scan8x8_cavlc_q0;
- scan= s->qscale ? h->zigzag_scan : h->zigzag_scan_q0;
- dc_scan= luma_dc_zigzag_scan;
- }
-
- dquant= get_se_golomb(&s->gb);
-
- if( dquant > 25 || dquant < -26 ){
- av_log(h->s.avctx, AV_LOG_ERROR, "dquant out of range (%d) at %d %d\n", dquant, s->mb_x, s->mb_y);
- return -1;
- }
-
- s->qscale += dquant;
- if(((unsigned)s->qscale) > 51){
- if(s->qscale<0) s->qscale+= 52;
- else s->qscale-= 52;
- }
-
- h->chroma_qp= chroma_qp= get_chroma_qp(h->pps.chroma_qp_index_offset, s->qscale);
- if(IS_INTRA16x16(mb_type)){
- if( decode_residual(h, h->intra_gb_ptr, h->mb, LUMA_DC_BLOCK_INDEX, dc_scan, h->dequant4_coeff[0][s->qscale], 16) < 0){
- return -1; //FIXME continue if partitioned and other return -1 too
- }
-
- assert((cbp&15) == 0 || (cbp&15) == 15);
-
- if(cbp&15){
- for(i8x8=0; i8x8<4; i8x8++){
- for(i4x4=0; i4x4<4; i4x4++){
- const int index= i4x4 + 4*i8x8;
- if( decode_residual(h, h->intra_gb_ptr, h->mb + 16*index, index, scan + 1, h->dequant4_coeff[0][s->qscale], 15) < 0 ){
- return -1;
- }
- }
- }
- }else{
- fill_rectangle(&h->non_zero_count_cache[scan8[0]], 4, 4, 8, 0, 1);
- }
- }else{
- for(i8x8=0; i8x8<4; i8x8++){
- if(cbp & (1<<i8x8)){
- if(IS_8x8DCT(mb_type)){
- DCTELEM *buf = &h->mb[64*i8x8];
- uint8_t *nnz;
- for(i4x4=0; i4x4<4; i4x4++){
- if( decode_residual(h, gb, buf, i4x4+4*i8x8, scan8x8+16*i4x4,
- h->dequant8_coeff[IS_INTRA( mb_type ) ? 0:1][s->qscale], 16) <0 )
- return -1;
- }
- nnz= &h->non_zero_count_cache[ scan8[4*i8x8] ];
- nnz[0] += nnz[1] + nnz[8] + nnz[9];
- }else{
- for(i4x4=0; i4x4<4; i4x4++){
- const int index= i4x4 + 4*i8x8;
-
- if( decode_residual(h, gb, h->mb + 16*index, index, scan, h->dequant4_coeff[IS_INTRA( mb_type ) ? 0:3][s->qscale], 16) <0 ){
- return -1;
- }
- }
- }
- }else{
- uint8_t * const nnz= &h->non_zero_count_cache[ scan8[4*i8x8] ];
- nnz[0] = nnz[1] = nnz[8] = nnz[9] = 0;
- }
- }
- }
-
- if(cbp&0x30){
- for(chroma_idx=0; chroma_idx<2; chroma_idx++)
- if( decode_residual(h, gb, h->mb + 256 + 16*4*chroma_idx, CHROMA_DC_BLOCK_INDEX, chroma_dc_scan, NULL, 4) < 0){
- return -1;
- }
- }
-
- if(cbp&0x20){
- for(chroma_idx=0; chroma_idx<2; chroma_idx++){
- for(i4x4=0; i4x4<4; i4x4++){
- const int index= 16 + 4*chroma_idx + i4x4;
- if( decode_residual(h, gb, h->mb + 16*index, index, scan + 1, h->dequant4_coeff[chroma_idx+1+(IS_INTRA( mb_type ) ? 0:3)][chroma_qp], 15) < 0){
- return -1;
- }
- }
- }
- }else{
- uint8_t * const nnz= &h->non_zero_count_cache[0];
- nnz[ scan8[16]+0 ] = nnz[ scan8[16]+1 ] =nnz[ scan8[16]+8 ] =nnz[ scan8[16]+9 ] =
- nnz[ scan8[20]+0 ] = nnz[ scan8[20]+1 ] =nnz[ scan8[20]+8 ] =nnz[ scan8[20]+9 ] = 0;
- }
- }else{
- uint8_t * const nnz= &h->non_zero_count_cache[0];
- fill_rectangle(&nnz[scan8[0]], 4, 4, 8, 0, 1);
- nnz[ scan8[16]+0 ] = nnz[ scan8[16]+1 ] =nnz[ scan8[16]+8 ] =nnz[ scan8[16]+9 ] =
- nnz[ scan8[20]+0 ] = nnz[ scan8[20]+1 ] =nnz[ scan8[20]+8 ] =nnz[ scan8[20]+9 ] = 0;
- }
- s->current_picture.qscale_table[mb_xy]= s->qscale;
- write_back_non_zero_count(h);
-
- if(MB_MBAFF){
- h->ref_count[0] >>= 1;
- h->ref_count[1] >>= 1;
- }
-
- return 0;
-}
-
-static int decode_cabac_field_decoding_flag(H264Context *h) {
- MpegEncContext * const s = &h->s;
- const int mb_x = s->mb_x;
- const int mb_y = s->mb_y & ~1;
- const int mba_xy = mb_x - 1 + mb_y *s->mb_stride;
- const int mbb_xy = mb_x + (mb_y-2)*s->mb_stride;
-
- unsigned int ctx = 0;
-
- if( h->slice_table[mba_xy] == h->slice_num && IS_INTERLACED( s->current_picture.mb_type[mba_xy] ) ) {
- ctx += 1;
- }
- if( h->slice_table[mbb_xy] == h->slice_num && IS_INTERLACED( s->current_picture.mb_type[mbb_xy] ) ) {
- ctx += 1;
- }
-
- return get_cabac_noinline( &h->cabac, &h->cabac_state[70 + ctx] );
-}
-
-static int decode_cabac_intra_mb_type(H264Context *h, int ctx_base, int intra_slice) {
- uint8_t *state= &h->cabac_state[ctx_base];
- int mb_type;
-
- if(intra_slice){
- MpegEncContext * const s = &h->s;
- const int mba_xy = h->left_mb_xy[0];
- const int mbb_xy = h->top_mb_xy;
- int ctx=0;
- if( h->slice_table[mba_xy] == h->slice_num && !IS_INTRA4x4( s->current_picture.mb_type[mba_xy] ) )
- ctx++;
- if( h->slice_table[mbb_xy] == h->slice_num && !IS_INTRA4x4( s->current_picture.mb_type[mbb_xy] ) )
- ctx++;
- if( get_cabac_noinline( &h->cabac, &state[ctx] ) == 0 )
- return 0; /* I4x4 */
- state += 2;
- }else{
- if( get_cabac_noinline( &h->cabac, &state[0] ) == 0 )
- return 0; /* I4x4 */
- }
-
- if( get_cabac_terminate( &h->cabac ) )
- return 25; /* PCM */
-
- mb_type = 1; /* I16x16 */
- mb_type += 12 * get_cabac_noinline( &h->cabac, &state[1] ); /* cbp_luma != 0 */
- if( get_cabac_noinline( &h->cabac, &state[2] ) ) /* cbp_chroma */
- mb_type += 4 + 4 * get_cabac_noinline( &h->cabac, &state[2+intra_slice] );
- mb_type += 2 * get_cabac_noinline( &h->cabac, &state[3+intra_slice] );
- mb_type += 1 * get_cabac_noinline( &h->cabac, &state[3+2*intra_slice] );
- return mb_type;
-}
-
-static int decode_cabac_mb_type( H264Context *h ) {
- MpegEncContext * const s = &h->s;
-
- if( h->slice_type == I_TYPE ) {
- return decode_cabac_intra_mb_type(h, 3, 1);
- } else if( h->slice_type == P_TYPE ) {
- if( get_cabac_noinline( &h->cabac, &h->cabac_state[14] ) == 0 ) {
- /* P-type */
- if( get_cabac_noinline( &h->cabac, &h->cabac_state[15] ) == 0 ) {
- /* P_L0_D16x16, P_8x8 */
- return 3 * get_cabac_noinline( &h->cabac, &h->cabac_state[16] );
- } else {
- /* P_L0_D8x16, P_L0_D16x8 */
- return 2 - get_cabac_noinline( &h->cabac, &h->cabac_state[17] );
- }
- } else {
- return decode_cabac_intra_mb_type(h, 17, 0) + 5;
- }
- } else if( h->slice_type == B_TYPE ) {
- const int mba_xy = h->left_mb_xy[0];
- const int mbb_xy = h->top_mb_xy;
- int ctx = 0;
- int bits;
-
- if( h->slice_table[mba_xy] == h->slice_num && !IS_DIRECT( s->current_picture.mb_type[mba_xy] ) )
- ctx++;
- if( h->slice_table[mbb_xy] == h->slice_num && !IS_DIRECT( s->current_picture.mb_type[mbb_xy] ) )
- ctx++;
-
- if( !get_cabac_noinline( &h->cabac, &h->cabac_state[27+ctx] ) )
- return 0; /* B_Direct_16x16 */
-
- if( !get_cabac_noinline( &h->cabac, &h->cabac_state[27+3] ) ) {
- return 1 + get_cabac_noinline( &h->cabac, &h->cabac_state[27+5] ); /* B_L[01]_16x16 */
- }
-
- bits = get_cabac_noinline( &h->cabac, &h->cabac_state[27+4] ) << 3;
- bits|= get_cabac_noinline( &h->cabac, &h->cabac_state[27+5] ) << 2;
- bits|= get_cabac_noinline( &h->cabac, &h->cabac_state[27+5] ) << 1;
- bits|= get_cabac_noinline( &h->cabac, &h->cabac_state[27+5] );
- if( bits < 8 )
- return bits + 3; /* B_Bi_16x16 through B_L1_L0_16x8 */
- else if( bits == 13 ) {
- return decode_cabac_intra_mb_type(h, 32, 0) + 23;
- } else if( bits == 14 )
- return 11; /* B_L1_L0_8x16 */
- else if( bits == 15 )
- return 22; /* B_8x8 */
-
- bits= ( bits<<1 ) | get_cabac_noinline( &h->cabac, &h->cabac_state[27+5] );
- return bits - 4; /* B_L0_Bi_* through B_Bi_Bi_* */
- } else {
- /* TODO SI/SP frames? */
- return -1;
- }
-}
-
-static int decode_cabac_mb_skip( H264Context *h, int mb_x, int mb_y ) {
- MpegEncContext * const s = &h->s;
- int mba_xy, mbb_xy;
- int ctx = 0;
-
- if(FRAME_MBAFF){ //FIXME merge with the stuff in fill_caches?
- int mb_xy = mb_x + (mb_y&~1)*s->mb_stride;
- mba_xy = mb_xy - 1;
- if( (mb_y&1)
- && h->slice_table[mba_xy] == h->slice_num
- && MB_FIELD == !!IS_INTERLACED( s->current_picture.mb_type[mba_xy] ) )
- mba_xy += s->mb_stride;
- if( MB_FIELD ){
- mbb_xy = mb_xy - s->mb_stride;
- if( !(mb_y&1)
- && h->slice_table[mbb_xy] == h->slice_num
- && IS_INTERLACED( s->current_picture.mb_type[mbb_xy] ) )
- mbb_xy -= s->mb_stride;
- }else
- mbb_xy = mb_x + (mb_y-1)*s->mb_stride;
- }else{
- int mb_xy = mb_x + mb_y*s->mb_stride;
- mba_xy = mb_xy - 1;
- mbb_xy = mb_xy - s->mb_stride;
- }
-
- if( h->slice_table[mba_xy] == h->slice_num && !IS_SKIP( s->current_picture.mb_type[mba_xy] ))
- ctx++;
- if( h->slice_table[mbb_xy] == h->slice_num && !IS_SKIP( s->current_picture.mb_type[mbb_xy] ))
- ctx++;
-
- if( h->slice_type == B_TYPE )
- ctx += 13;
- return get_cabac_noinline( &h->cabac, &h->cabac_state[11+ctx] );
-}
-
-static int decode_cabac_mb_intra4x4_pred_mode( H264Context *h, int pred_mode ) {
- int mode = 0;
-
- if( get_cabac( &h->cabac, &h->cabac_state[68] ) )
- return pred_mode;
-
- mode += 1 * get_cabac( &h->cabac, &h->cabac_state[69] );
- mode += 2 * get_cabac( &h->cabac, &h->cabac_state[69] );
- mode += 4 * get_cabac( &h->cabac, &h->cabac_state[69] );
-
- if( mode >= pred_mode )
- return mode + 1;
- else
- return mode;
-}
-
-static int decode_cabac_mb_chroma_pre_mode( H264Context *h) {
- const int mba_xy = h->left_mb_xy[0];
- const int mbb_xy = h->top_mb_xy;
-
- int ctx = 0;
-
- /* No need to test for IS_INTRA4x4 and IS_INTRA16x16, as we set chroma_pred_mode_table to 0 */
- if( h->slice_table[mba_xy] == h->slice_num && h->chroma_pred_mode_table[mba_xy] != 0 )
- ctx++;
-
- if( h->slice_table[mbb_xy] == h->slice_num && h->chroma_pred_mode_table[mbb_xy] != 0 )
- ctx++;
-
- if( get_cabac_noinline( &h->cabac, &h->cabac_state[64+ctx] ) == 0 )
- return 0;
-
- if( get_cabac_noinline( &h->cabac, &h->cabac_state[64+3] ) == 0 )
- return 1;
- if( get_cabac_noinline( &h->cabac, &h->cabac_state[64+3] ) == 0 )
- return 2;
- else
- return 3;
-}
-
-static const uint8_t block_idx_x[16] = {
- 0, 1, 0, 1, 2, 3, 2, 3, 0, 1, 0, 1, 2, 3, 2, 3
-};
-static const uint8_t block_idx_y[16] = {
- 0, 0, 1, 1, 0, 0, 1, 1, 2, 2, 3, 3, 2, 2, 3, 3
-};
-static const uint8_t block_idx_xy[4][4] = {
- { 0, 2, 8, 10},
- { 1, 3, 9, 11},
- { 4, 6, 12, 14},
- { 5, 7, 13, 15}
-};
-
-static int decode_cabac_mb_cbp_luma( H264Context *h) {
- int cbp = 0;
- int cbp_b = -1;
- int i8x8;
-
- if( h->slice_table[h->top_mb_xy] == h->slice_num ) {
- cbp_b = h->top_cbp;
- tprintf("cbp_b = top_cbp = %x\n", cbp_b);
- }
-
- for( i8x8 = 0; i8x8 < 4; i8x8++ ) {
- int cbp_a = -1;
- int x, y;
- int ctx = 0;
-
- x = block_idx_x[4*i8x8];
- y = block_idx_y[4*i8x8];
-
- if( x > 0 )
- cbp_a = cbp;
- else if( h->slice_table[h->left_mb_xy[0]] == h->slice_num ) {
- cbp_a = h->left_cbp;
- tprintf("cbp_a = left_cbp = %x\n", cbp_a);
- }
-
- if( y > 0 )
- cbp_b = cbp;
-
- /* No need to test for skip as we put 0 for skip block */
- /* No need to test for IPCM as we put 1 for IPCM block */
- if( cbp_a >= 0 ) {
- int i8x8a = block_idx_xy[(x-1)&0x03][y]/4;
- if( ((cbp_a >> i8x8a)&0x01) == 0 )
- ctx++;
- }
-
- if( cbp_b >= 0 ) {
- int i8x8b = block_idx_xy[x][(y-1)&0x03]/4;
- if( ((cbp_b >> i8x8b)&0x01) == 0 )
- ctx += 2;
- }
-
- if( get_cabac( &h->cabac, &h->cabac_state[73 + ctx] ) ) {
- cbp |= 1 << i8x8;
- }
- }
- return cbp;
-}
-static int decode_cabac_mb_cbp_chroma( H264Context *h) {
- int ctx;
- int cbp_a, cbp_b;
-
- cbp_a = (h->left_cbp>>4)&0x03;
- cbp_b = (h-> top_cbp>>4)&0x03;
-
- ctx = 0;
- if( cbp_a > 0 ) ctx++;
- if( cbp_b > 0 ) ctx += 2;
- if( get_cabac_noinline( &h->cabac, &h->cabac_state[77 + ctx] ) == 0 )
- return 0;
-
- ctx = 4;
- if( cbp_a == 2 ) ctx++;
- if( cbp_b == 2 ) ctx += 2;
- return 1 + get_cabac_noinline( &h->cabac, &h->cabac_state[77 + ctx] );
-}
-static int decode_cabac_mb_dqp( H264Context *h) {
- MpegEncContext * const s = &h->s;
- int mbn_xy;
- int ctx = 0;
- int val = 0;
-
- if( s->mb_x > 0 )
- mbn_xy = s->mb_x + s->mb_y*s->mb_stride - 1;
- else
- mbn_xy = s->mb_width - 1 + (s->mb_y-1)*s->mb_stride;
-
- if( h->last_qscale_diff != 0 )
- ctx++;
-
- while( get_cabac_noinline( &h->cabac, &h->cabac_state[60 + ctx] ) ) {
- if( ctx < 2 )
- ctx = 2;
- else
- ctx = 3;
- val++;
- if(val > 102) //prevent infinite loop
- return INT_MIN;
- }
-
- if( val&0x01 )
- return (val + 1)/2;
- else
- return -(val + 1)/2;
-}
-static int decode_cabac_p_mb_sub_type( H264Context *h ) {
- if( get_cabac( &h->cabac, &h->cabac_state[21] ) )
- return 0; /* 8x8 */
- if( !get_cabac( &h->cabac, &h->cabac_state[22] ) )
- return 1; /* 8x4 */
- if( get_cabac( &h->cabac, &h->cabac_state[23] ) )
- return 2; /* 4x8 */
- return 3; /* 4x4 */
-}
-static int decode_cabac_b_mb_sub_type( H264Context *h ) {
- int type;
- if( !get_cabac( &h->cabac, &h->cabac_state[36] ) )
- return 0; /* B_Direct_8x8 */
- if( !get_cabac( &h->cabac, &h->cabac_state[37] ) )
- return 1 + get_cabac( &h->cabac, &h->cabac_state[39] ); /* B_L0_8x8, B_L1_8x8 */
- type = 3;
- if( get_cabac( &h->cabac, &h->cabac_state[38] ) ) {
- if( get_cabac( &h->cabac, &h->cabac_state[39] ) )
- return 11 + get_cabac( &h->cabac, &h->cabac_state[39] ); /* B_L1_4x4, B_Bi_4x4 */
- type += 4;
- }
- type += 2*get_cabac( &h->cabac, &h->cabac_state[39] );
- type += get_cabac( &h->cabac, &h->cabac_state[39] );
- return type;
-}
-
-static inline int decode_cabac_mb_transform_size( H264Context *h ) {
- return get_cabac_noinline( &h->cabac, &h->cabac_state[399 + h->neighbor_transform_size] );
-}
-
-static int decode_cabac_mb_ref( H264Context *h, int list, int n ) {
- int refa = h->ref_cache[list][scan8[n] - 1];
- int refb = h->ref_cache[list][scan8[n] - 8];
- int ref = 0;
- int ctx = 0;
-
- if( h->slice_type == B_TYPE) {
- if( refa > 0 && !h->direct_cache[scan8[n] - 1] )
- ctx++;
- if( refb > 0 && !h->direct_cache[scan8[n] - 8] )
- ctx += 2;
- } else {
- if( refa > 0 )
- ctx++;
- if( refb > 0 )
- ctx += 2;
- }
-
- while( get_cabac( &h->cabac, &h->cabac_state[54+ctx] ) ) {
- ref++;
- if( ctx < 4 )
- ctx = 4;
- else
- ctx = 5;
- if(ref >= 32 /*h->ref_list[list]*/){
- av_log(h->s.avctx, AV_LOG_ERROR, "overflow in decode_cabac_mb_ref\n");
- return 0; //FIXME we should return -1 and check the return everywhere
- }
- }
- return ref;
-}
-
-static int decode_cabac_mb_mvd( H264Context *h, int list, int n, int l ) {
- int amvd = abs( h->mvd_cache[list][scan8[n] - 1][l] ) +
- abs( h->mvd_cache[list][scan8[n] - 8][l] );
- int ctxbase = (l == 0) ? 40 : 47;
- int ctx, mvd;
-
- if( amvd < 3 )
- ctx = 0;
- else if( amvd > 32 )
- ctx = 2;
- else
- ctx = 1;
-
- if(!get_cabac(&h->cabac, &h->cabac_state[ctxbase+ctx]))
- return 0;
-
- mvd= 1;
- ctx= 3;
- while( mvd < 9 && get_cabac( &h->cabac, &h->cabac_state[ctxbase+ctx] ) ) {
- mvd++;
- if( ctx < 6 )
- ctx++;
- }
-
- if( mvd >= 9 ) {
- int k = 3;
- while( get_cabac_bypass( &h->cabac ) ) {
- mvd += 1 << k;
- k++;
- if(k>24){
- av_log(h->s.avctx, AV_LOG_ERROR, "overflow in decode_cabac_mb_mvd\n");
- return INT_MIN;
- }
- }
- while( k-- ) {
- if( get_cabac_bypass( &h->cabac ) )
- mvd += 1 << k;
- }
- }
- return get_cabac_bypass_sign( &h->cabac, -mvd );
-}
-
-static int inline get_cabac_cbf_ctx( H264Context *h, int cat, int idx ) {
- int nza, nzb;
- int ctx = 0;
-
- if( cat == 0 ) {
- nza = h->left_cbp&0x100;
- nzb = h-> top_cbp&0x100;
- } else if( cat == 1 || cat == 2 ) {
- nza = h->non_zero_count_cache[scan8[idx] - 1];
- nzb = h->non_zero_count_cache[scan8[idx] - 8];
- } else if( cat == 3 ) {
- nza = (h->left_cbp>>(6+idx))&0x01;
- nzb = (h-> top_cbp>>(6+idx))&0x01;
- } else {
- assert(cat == 4);
- nza = h->non_zero_count_cache[scan8[16+idx] - 1];
- nzb = h->non_zero_count_cache[scan8[16+idx] - 8];
- }
-
- if( nza > 0 )
- ctx++;
-
- if( nzb > 0 )
- ctx += 2;
-
- return ctx + 4 * cat;
-}
-
-static const __attribute((used)) uint8_t last_coeff_flag_offset_8x8[63] = {
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4,
- 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8
-};
-
-static int decode_cabac_residual( H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff) {
- const int mb_xy = h->s.mb_x + h->s.mb_y*h->s.mb_stride;
- static const int significant_coeff_flag_offset[2][6] = {
- { 105+0, 105+15, 105+29, 105+44, 105+47, 402 },
- { 277+0, 277+15, 277+29, 277+44, 277+47, 436 }
- };
- static const int last_coeff_flag_offset[2][6] = {
- { 166+0, 166+15, 166+29, 166+44, 166+47, 417 },
- { 338+0, 338+15, 338+29, 338+44, 338+47, 451 }
- };
- static const int coeff_abs_level_m1_offset[6] = {
- 227+0, 227+10, 227+20, 227+30, 227+39, 426
- };
- static const uint8_t significant_coeff_flag_offset_8x8[2][63] = {
- { 0, 1, 2, 3, 4, 5, 5, 4, 4, 3, 3, 4, 4, 4, 5, 5,
- 4, 4, 4, 4, 3, 3, 6, 7, 7, 7, 8, 9,10, 9, 8, 7,
- 7, 6,11,12,13,11, 6, 7, 8, 9,14,10, 9, 8, 6,11,
- 12,13,11, 6, 9,14,10, 9,11,12,13,11,14,10,12 },
- { 0, 1, 1, 2, 2, 3, 3, 4, 5, 6, 7, 7, 7, 8, 4, 5,
- 6, 9,10,10, 8,11,12,11, 9, 9,10,10, 8,11,12,11,
- 9, 9,10,10, 8,11,12,11, 9, 9,10,10, 8,13,13, 9,
- 9,10,10, 8,13,13, 9, 9,10,10,14,14,14,14,14 }
- };
-
- int index[64];
-
- int last;
- int coeff_count = 0;
-
- int abslevel1 = 1;
- int abslevelgt1 = 0;
-
- uint8_t *significant_coeff_ctx_base;
- uint8_t *last_coeff_ctx_base;
- uint8_t *abs_level_m1_ctx_base;
-
-#ifndef ARCH_X86
-#define CABAC_ON_STACK
-#endif
-#ifdef CABAC_ON_STACK
-#define CC &cc
- CABACContext cc;
- cc.range = h->cabac.range;
- cc.low = h->cabac.low;
- cc.bytestream= h->cabac.bytestream;
-#else
-#define CC &h->cabac
-#endif
-
-
- /* cat: 0-> DC 16x16 n = 0
- * 1-> AC 16x16 n = luma4x4idx
- * 2-> Luma4x4 n = luma4x4idx
- * 3-> DC Chroma n = iCbCr
- * 4-> AC Chroma n = 4 * iCbCr + chroma4x4idx
- * 5-> Luma8x8 n = 4 * luma8x8idx
- */
-
- /* read coded block flag */
- if( cat != 5 ) {
- if( get_cabac( CC, &h->cabac_state[85 + get_cabac_cbf_ctx( h, cat, n ) ] ) == 0 ) {
- if( cat == 1 || cat == 2 )
- h->non_zero_count_cache[scan8[n]] = 0;
- else if( cat == 4 )
- h->non_zero_count_cache[scan8[16+n]] = 0;
-#ifdef CABAC_ON_STACK
- h->cabac.range = cc.range ;
- h->cabac.low = cc.low ;
- h->cabac.bytestream= cc.bytestream;
-#endif
- return 0;
- }
- }
-
- significant_coeff_ctx_base = h->cabac_state
- + significant_coeff_flag_offset[MB_FIELD][cat];
- last_coeff_ctx_base = h->cabac_state
- + last_coeff_flag_offset[MB_FIELD][cat];
- abs_level_m1_ctx_base = h->cabac_state
- + coeff_abs_level_m1_offset[cat];
-
- if( cat == 5 ) {
-#define DECODE_SIGNIFICANCE( coefs, sig_off, last_off ) \
- for(last= 0; last < coefs; last++) { \
- uint8_t *sig_ctx = significant_coeff_ctx_base + sig_off; \
- if( get_cabac( CC, sig_ctx )) { \
- uint8_t *last_ctx = last_coeff_ctx_base + last_off; \
- index[coeff_count++] = last; \
- if( get_cabac( CC, last_ctx ) ) { \
- last= max_coeff; \
- break; \
- } \
- } \
- }\
- if( last == max_coeff -1 ) {\
- index[coeff_count++] = last;\
- }
- const uint8_t *sig_off = significant_coeff_flag_offset_8x8[MB_FIELD];
-#if defined(ARCH_X86) && !(defined(PIC) && defined(__GNUC__))
- coeff_count= decode_significance_8x8_x86(CC, significant_coeff_ctx_base, index, sig_off);
- } else {
- coeff_count= decode_significance_x86(CC, max_coeff, significant_coeff_ctx_base, index);
-#else
- DECODE_SIGNIFICANCE( 63, sig_off[last], last_coeff_flag_offset_8x8[last] );
- } else {
- DECODE_SIGNIFICANCE( max_coeff - 1, last, last );
-#endif
- }
- assert(coeff_count > 0);
-
- if( cat == 0 )
- h->cbp_table[mb_xy] |= 0x100;
- else if( cat == 1 || cat == 2 )
- h->non_zero_count_cache[scan8[n]] = coeff_count;
- else if( cat == 3 )
- h->cbp_table[mb_xy] |= 0x40 << n;
- else if( cat == 4 )
- h->non_zero_count_cache[scan8[16+n]] = coeff_count;
- else {
- assert( cat == 5 );
- fill_rectangle(&h->non_zero_count_cache[scan8[n]], 2, 2, 8, coeff_count, 1);
- }
-
- for( coeff_count--; coeff_count >= 0; coeff_count-- ) {
- uint8_t *ctx = (abslevelgt1 != 0 ? 0 : FFMIN( 4, abslevel1 )) + abs_level_m1_ctx_base;
- int j= scantable[index[coeff_count]];
-
- if( get_cabac( CC, ctx ) == 0 ) {
- if( !qmul ) {
- block[j] = get_cabac_bypass_sign( CC, -1);
- }else{
- block[j] = (get_cabac_bypass_sign( CC, -qmul[j]) + 32) >> 6;;
- }
-
- abslevel1++;
- } else {
- int coeff_abs = 2;
- ctx = 5 + FFMIN( 4, abslevelgt1 ) + abs_level_m1_ctx_base;
- while( coeff_abs < 15 && get_cabac( CC, ctx ) ) {
- coeff_abs++;
- }
-
- if( coeff_abs >= 15 ) {
- int j = 0;
- while( get_cabac_bypass( CC ) ) {
- j++;
- }
-
- coeff_abs=1;
- while( j-- ) {
- coeff_abs += coeff_abs + get_cabac_bypass( CC );
- }
- coeff_abs+= 14;
- }
-
- if( !qmul ) {
- if( get_cabac_bypass( CC ) ) block[j] = -coeff_abs;
- else block[j] = coeff_abs;
- }else{
- if( get_cabac_bypass( CC ) ) block[j] = (-coeff_abs * qmul[j] + 32) >> 6;
- else block[j] = ( coeff_abs * qmul[j] + 32) >> 6;
- }
-
- abslevelgt1++;
- }
- }
-#ifdef CABAC_ON_STACK
- h->cabac.range = cc.range ;
- h->cabac.low = cc.low ;
- h->cabac.bytestream= cc.bytestream;
-#endif
- return 0;
-}
-
-static void inline compute_mb_neighbors(H264Context *h)
-{
- MpegEncContext * const s = &h->s;
- const int mb_xy = s->mb_x + s->mb_y*s->mb_stride;
- h->top_mb_xy = mb_xy - s->mb_stride;
- h->left_mb_xy[0] = mb_xy - 1;
- if(FRAME_MBAFF){
- const int pair_xy = s->mb_x + (s->mb_y & ~1)*s->mb_stride;
- const int top_pair_xy = pair_xy - s->mb_stride;
- const int top_mb_frame_flag = !IS_INTERLACED(s->current_picture.mb_type[top_pair_xy]);
- const int left_mb_frame_flag = !IS_INTERLACED(s->current_picture.mb_type[pair_xy-1]);
- const int curr_mb_frame_flag = !MB_FIELD;
- const int bottom = (s->mb_y & 1);
- if (bottom
- ? !curr_mb_frame_flag // bottom macroblock
- : (!curr_mb_frame_flag && !top_mb_frame_flag) // top macroblock
- ) {
- h->top_mb_xy -= s->mb_stride;
- }
- if (left_mb_frame_flag != curr_mb_frame_flag) {
- h->left_mb_xy[0] = pair_xy - 1;
- }
- }
- return;
-}
-
-/**
- * decodes a macroblock
- * @returns 0 if ok, AC_ERROR / DC_ERROR / MV_ERROR if an error is noticed
- */
-static int decode_mb_cabac(H264Context *h) {
- MpegEncContext * const s = &h->s;
- const int mb_xy= s->mb_x + s->mb_y*s->mb_stride;
- int mb_type, partition_count, cbp = 0;
- int dct8x8_allowed= h->pps.transform_8x8_mode;
-
- s->dsp.clear_blocks(h->mb); //FIXME avoid if already clear (move after skip handlong?)
-
- tprintf("pic:%d mb:%d/%d\n", h->frame_num, s->mb_x, s->mb_y);
- if( h->slice_type != I_TYPE && h->slice_type != SI_TYPE ) {
- int skip;
- /* a skipped mb needs the aff flag from the following mb */
- if( FRAME_MBAFF && s->mb_x==0 && (s->mb_y&1)==0 )
- predict_field_decoding_flag(h);
- if( FRAME_MBAFF && (s->mb_y&1)==1 && h->prev_mb_skipped )
- skip = h->next_mb_skipped;
- else
- skip = decode_cabac_mb_skip( h, s->mb_x, s->mb_y );
- /* read skip flags */
- if( skip ) {
- if( FRAME_MBAFF && (s->mb_y&1)==0 ){
- s->current_picture.mb_type[mb_xy] = MB_TYPE_SKIP;
- h->next_mb_skipped = decode_cabac_mb_skip( h, s->mb_x, s->mb_y+1 );
- if(h->next_mb_skipped)
- predict_field_decoding_flag(h);
- else
- h->mb_mbaff = h->mb_field_decoding_flag = decode_cabac_field_decoding_flag(h);
- }
-
- decode_mb_skip(h);
-
- h->cbp_table[mb_xy] = 0;
- h->chroma_pred_mode_table[mb_xy] = 0;
- h->last_qscale_diff = 0;
-
- return 0;
-
- }
- }
- if(FRAME_MBAFF){
- if( (s->mb_y&1) == 0 )
- h->mb_mbaff =
- h->mb_field_decoding_flag = decode_cabac_field_decoding_flag(h);
- }else
- h->mb_field_decoding_flag= (s->picture_structure!=PICT_FRAME);
-
- h->prev_mb_skipped = 0;
-
- compute_mb_neighbors(h);
- if( ( mb_type = decode_cabac_mb_type( h ) ) < 0 ) {
- av_log( h->s.avctx, AV_LOG_ERROR, "decode_cabac_mb_type failed\n" );
- return -1;
- }
-
- if( h->slice_type == B_TYPE ) {
- if( mb_type < 23 ){
- partition_count= b_mb_type_info[mb_type].partition_count;
- mb_type= b_mb_type_info[mb_type].type;
- }else{
- mb_type -= 23;
- goto decode_intra_mb;
- }
- } else if( h->slice_type == P_TYPE ) {
- if( mb_type < 5) {
- partition_count= p_mb_type_info[mb_type].partition_count;
- mb_type= p_mb_type_info[mb_type].type;
- } else {
- mb_type -= 5;
- goto decode_intra_mb;
- }
- } else {
- assert(h->slice_type == I_TYPE);
-decode_intra_mb:
- partition_count = 0;
- cbp= i_mb_type_info[mb_type].cbp;
- h->intra16x16_pred_mode= i_mb_type_info[mb_type].pred_mode;
- mb_type= i_mb_type_info[mb_type].type;
- }
- if(MB_FIELD)
- mb_type |= MB_TYPE_INTERLACED;
-
- h->slice_table[ mb_xy ]= h->slice_num;
-
- if(IS_INTRA_PCM(mb_type)) {
- const uint8_t *ptr;
- unsigned int x, y;
-
- // We assume these blocks are very rare so we dont optimize it.
- // FIXME The two following lines get the bitstream position in the cabac
- // decode, I think it should be done by a function in cabac.h (or cabac.c).
- ptr= h->cabac.bytestream;
- if(h->cabac.low&0x1) ptr--;
- if(CABAC_BITS==16){
- if(h->cabac.low&0x1FF) ptr--;
- }
-
- // The pixels are stored in the same order as levels in h->mb array.
- for(y=0; y<16; y++){
- const int index= 4*(y&3) + 32*((y>>2)&1) + 128*(y>>3);
- for(x=0; x<16; x++){
- tprintf("LUMA ICPM LEVEL (%3d)\n", *ptr);
- h->mb[index + (x&3) + 16*((x>>2)&1) + 64*(x>>3)]= *ptr++;
- }
- }
- for(y=0; y<8; y++){
- const int index= 256 + 4*(y&3) + 32*(y>>2);
- for(x=0; x<8; x++){
- tprintf("CHROMA U ICPM LEVEL (%3d)\n", *ptr);
- h->mb[index + (x&3) + 16*(x>>2)]= *ptr++;
- }
- }
- for(y=0; y<8; y++){
- const int index= 256 + 64 + 4*(y&3) + 32*(y>>2);
- for(x=0; x<8; x++){
- tprintf("CHROMA V ICPM LEVEL (%3d)\n", *ptr);
- h->mb[index + (x&3) + 16*(x>>2)]= *ptr++;
- }
- }
-
- ff_init_cabac_decoder(&h->cabac, ptr, h->cabac.bytestream_end - ptr);
-
- // All blocks are present
- h->cbp_table[mb_xy] = 0x1ef;
- h->chroma_pred_mode_table[mb_xy] = 0;
- // In deblocking, the quantizer is 0
- s->current_picture.qscale_table[mb_xy]= 0;
- h->chroma_qp = get_chroma_qp(h->pps.chroma_qp_index_offset, 0);
- // All coeffs are present
- memset(h->non_zero_count[mb_xy], 16, 16);
- s->current_picture.mb_type[mb_xy]= mb_type;
- return 0;
- }
-
- if(MB_MBAFF){
- h->ref_count[0] <<= 1;
- h->ref_count[1] <<= 1;
- }
-
- fill_caches(h, mb_type, 0);
-
- if( IS_INTRA( mb_type ) ) {
- int i, pred_mode;
- if( IS_INTRA4x4( mb_type ) ) {
- if( dct8x8_allowed && decode_cabac_mb_transform_size( h ) ) {
- mb_type |= MB_TYPE_8x8DCT;
- for( i = 0; i < 16; i+=4 ) {
- int pred = pred_intra_mode( h, i );
- int mode = decode_cabac_mb_intra4x4_pred_mode( h, pred );
- fill_rectangle( &h->intra4x4_pred_mode_cache[ scan8[i] ], 2, 2, 8, mode, 1 );
- }
- } else {
- for( i = 0; i < 16; i++ ) {
- int pred = pred_intra_mode( h, i );
- h->intra4x4_pred_mode_cache[ scan8[i] ] = decode_cabac_mb_intra4x4_pred_mode( h, pred );
-
- //av_log( s->avctx, AV_LOG_ERROR, "i4x4 pred=%d mode=%d\n", pred, h->intra4x4_pred_mode_cache[ scan8[i] ] );
- }
- }
- write_back_intra_pred_mode(h);
- if( check_intra4x4_pred_mode(h) < 0 ) return -1;
- } else {
- h->intra16x16_pred_mode= check_intra_pred_mode( h, h->intra16x16_pred_mode );
- if( h->intra16x16_pred_mode < 0 ) return -1;
- }
- h->chroma_pred_mode_table[mb_xy] =
- pred_mode = decode_cabac_mb_chroma_pre_mode( h );
-
- pred_mode= check_intra_pred_mode( h, pred_mode );
- if( pred_mode < 0 ) return -1;
- h->chroma_pred_mode= pred_mode;
- } else if( partition_count == 4 ) {
- int i, j, sub_partition_count[4], list, ref[2][4];
-
- if( h->slice_type == B_TYPE ) {
- for( i = 0; i < 4; i++ ) {
- h->sub_mb_type[i] = decode_cabac_b_mb_sub_type( h );
- sub_partition_count[i]= b_sub_mb_type_info[ h->sub_mb_type[i] ].partition_count;
- h->sub_mb_type[i]= b_sub_mb_type_info[ h->sub_mb_type[i] ].type;
- }
- if( IS_DIRECT(h->sub_mb_type[0] | h->sub_mb_type[1] |
- h->sub_mb_type[2] | h->sub_mb_type[3]) ) {
- pred_direct_motion(h, &mb_type);
- if( h->ref_count[0] > 1 || h->ref_count[1] > 1 ) {
- for( i = 0; i < 4; i++ )
- if( IS_DIRECT(h->sub_mb_type[i]) )
- fill_rectangle( &h->direct_cache[scan8[4*i]], 2, 2, 8, 1, 1 );
- }
- }
- } else {
- for( i = 0; i < 4; i++ ) {
- h->sub_mb_type[i] = decode_cabac_p_mb_sub_type( h );
- sub_partition_count[i]= p_sub_mb_type_info[ h->sub_mb_type[i] ].partition_count;
- h->sub_mb_type[i]= p_sub_mb_type_info[ h->sub_mb_type[i] ].type;
- }
- }
-
- for( list = 0; list < 2; list++ ) {
- if( h->ref_count[list] > 0 ) {
- for( i = 0; i < 4; i++ ) {
- if(IS_DIRECT(h->sub_mb_type[i])) continue;
- if(IS_DIR(h->sub_mb_type[i], 0, list)){
- if( h->ref_count[list] > 1 )
- ref[list][i] = decode_cabac_mb_ref( h, list, 4*i );
- else
- ref[list][i] = 0;
- } else {
- ref[list][i] = -1;
- }
- h->ref_cache[list][ scan8[4*i]+1 ]=
- h->ref_cache[list][ scan8[4*i]+8 ]=h->ref_cache[list][ scan8[4*i]+9 ]= ref[list][i];
- }
- }
- }
-
- if(dct8x8_allowed)
- dct8x8_allowed = get_dct8x8_allowed(h);
-
- for(list=0; list<2; list++){
- for(i=0; i<4; i++){
- if(IS_DIRECT(h->sub_mb_type[i])){
- fill_rectangle(h->mvd_cache[list][scan8[4*i]], 2, 2, 8, 0, 4);
- continue;
- }
- h->ref_cache[list][ scan8[4*i] ]=h->ref_cache[list][ scan8[4*i]+1 ];
-
- if(IS_DIR(h->sub_mb_type[i], 0, list) && !IS_DIRECT(h->sub_mb_type[i])){
- const int sub_mb_type= h->sub_mb_type[i];
- const int block_width= (sub_mb_type & (MB_TYPE_16x16|MB_TYPE_16x8)) ? 2 : 1;
- for(j=0; j<sub_partition_count[i]; j++){
- int mpx, mpy;
- int mx, my;
- const int index= 4*i + block_width*j;
- int16_t (* mv_cache)[2]= &h->mv_cache[list][ scan8[index] ];
- int16_t (* mvd_cache)[2]= &h->mvd_cache[list][ scan8[index] ];
- pred_motion(h, index, block_width, list, h->ref_cache[list][ scan8[index] ], &mpx, &mpy);
-
- mx = mpx + decode_cabac_mb_mvd( h, list, index, 0 );
- my = mpy + decode_cabac_mb_mvd( h, list, index, 1 );
- tprintf("final mv:%d %d\n", mx, my);
-
- if(IS_SUB_8X8(sub_mb_type)){
- mv_cache[ 0 ][0]= mv_cache[ 1 ][0]=
- mv_cache[ 8 ][0]= mv_cache[ 9 ][0]= mx;
- mv_cache[ 0 ][1]= mv_cache[ 1 ][1]=
- mv_cache[ 8 ][1]= mv_cache[ 9 ][1]= my;
-
- mvd_cache[ 0 ][0]= mvd_cache[ 1 ][0]=
- mvd_cache[ 8 ][0]= mvd_cache[ 9 ][0]= mx - mpx;
- mvd_cache[ 0 ][1]= mvd_cache[ 1 ][1]=
- mvd_cache[ 8 ][1]= mvd_cache[ 9 ][1]= my - mpy;
- }else if(IS_SUB_8X4(sub_mb_type)){
- mv_cache[ 0 ][0]= mv_cache[ 1 ][0]= mx;
- mv_cache[ 0 ][1]= mv_cache[ 1 ][1]= my;
-
- mvd_cache[ 0 ][0]= mvd_cache[ 1 ][0]= mx- mpx;
- mvd_cache[ 0 ][1]= mvd_cache[ 1 ][1]= my - mpy;
- }else if(IS_SUB_4X8(sub_mb_type)){
- mv_cache[ 0 ][0]= mv_cache[ 8 ][0]= mx;
- mv_cache[ 0 ][1]= mv_cache[ 8 ][1]= my;
-
- mvd_cache[ 0 ][0]= mvd_cache[ 8 ][0]= mx - mpx;
- mvd_cache[ 0 ][1]= mvd_cache[ 8 ][1]= my - mpy;
- }else{
- assert(IS_SUB_4X4(sub_mb_type));
- mv_cache[ 0 ][0]= mx;
- mv_cache[ 0 ][1]= my;
-
- mvd_cache[ 0 ][0]= mx - mpx;
- mvd_cache[ 0 ][1]= my - mpy;
- }
- }
- }else{
- uint32_t *p= (uint32_t *)&h->mv_cache[list][ scan8[4*i] ][0];
- uint32_t *pd= (uint32_t *)&h->mvd_cache[list][ scan8[4*i] ][0];
- p[0] = p[1] = p[8] = p[9] = 0;
- pd[0]= pd[1]= pd[8]= pd[9]= 0;
- }
- }
- }
- } else if( IS_DIRECT(mb_type) ) {
- pred_direct_motion(h, &mb_type);
- fill_rectangle(h->mvd_cache[0][scan8[0]], 4, 4, 8, 0, 4);
- fill_rectangle(h->mvd_cache[1][scan8[0]], 4, 4, 8, 0, 4);
- dct8x8_allowed &= h->sps.direct_8x8_inference_flag;
- } else {
- int list, mx, my, i, mpx, mpy;
- if(IS_16X16(mb_type)){
- for(list=0; list<2; list++){
- if(IS_DIR(mb_type, 0, list)){
- if(h->ref_count[list] > 0 ){
- const int ref = h->ref_count[list] > 1 ? decode_cabac_mb_ref( h, list, 0 ) : 0;
- fill_rectangle(&h->ref_cache[list][ scan8[0] ], 4, 4, 8, ref, 1);
- }
- }else
- fill_rectangle(&h->ref_cache[list][ scan8[0] ], 4, 4, 8, (uint8_t)LIST_NOT_USED, 1);
- }
- for(list=0; list<2; list++){
- if(IS_DIR(mb_type, 0, list)){
- pred_motion(h, 0, 4, list, h->ref_cache[list][ scan8[0] ], &mpx, &mpy);
-
- mx = mpx + decode_cabac_mb_mvd( h, list, 0, 0 );
- my = mpy + decode_cabac_mb_mvd( h, list, 0, 1 );
- tprintf("final mv:%d %d\n", mx, my);
-
- fill_rectangle(h->mvd_cache[list][ scan8[0] ], 4, 4, 8, pack16to32(mx-mpx,my-mpy), 4);
- fill_rectangle(h->mv_cache[list][ scan8[0] ], 4, 4, 8, pack16to32(mx,my), 4);
- }else
- fill_rectangle(h->mv_cache[list][ scan8[0] ], 4, 4, 8, 0, 4);
- }
- }
- else if(IS_16X8(mb_type)){
- for(list=0; list<2; list++){
- if(h->ref_count[list]>0){
- for(i=0; i<2; i++){
- if(IS_DIR(mb_type, i, list)){
- const int ref= h->ref_count[list] > 1 ? decode_cabac_mb_ref( h, list, 8*i ) : 0;
- fill_rectangle(&h->ref_cache[list][ scan8[0] + 16*i ], 4, 2, 8, ref, 1);
- }else
- fill_rectangle(&h->ref_cache[list][ scan8[0] + 16*i ], 4, 2, 8, (LIST_NOT_USED&0xFF), 1);
- }
- }
- }
- for(list=0; list<2; list++){
- for(i=0; i<2; i++){
- if(IS_DIR(mb_type, i, list)){
- pred_16x8_motion(h, 8*i, list, h->ref_cache[list][scan8[0] + 16*i], &mpx, &mpy);
- mx = mpx + decode_cabac_mb_mvd( h, list, 8*i, 0 );
- my = mpy + decode_cabac_mb_mvd( h, list, 8*i, 1 );
- tprintf("final mv:%d %d\n", mx, my);
-
- fill_rectangle(h->mvd_cache[list][ scan8[0] + 16*i ], 4, 2, 8, pack16to32(mx-mpx,my-mpy), 4);
- fill_rectangle(h->mv_cache[list][ scan8[0] + 16*i ], 4, 2, 8, pack16to32(mx,my), 4);
- }else{
- fill_rectangle(h->mvd_cache[list][ scan8[0] + 16*i ], 4, 2, 8, 0, 4);
- fill_rectangle(h-> mv_cache[list][ scan8[0] + 16*i ], 4, 2, 8, 0, 4);
- }
- }
- }
- }else{
- assert(IS_8X16(mb_type));
- for(list=0; list<2; list++){
- if(h->ref_count[list]>0){
- for(i=0; i<2; i++){
- if(IS_DIR(mb_type, i, list)){ //FIXME optimize
- const int ref= h->ref_count[list] > 1 ? decode_cabac_mb_ref( h, list, 4*i ) : 0;
- fill_rectangle(&h->ref_cache[list][ scan8[0] + 2*i ], 2, 4, 8, ref, 1);
- }else
- fill_rectangle(&h->ref_cache[list][ scan8[0] + 2*i ], 2, 4, 8, (LIST_NOT_USED&0xFF), 1);
- }
- }
- }
- for(list=0; list<2; list++){
- for(i=0; i<2; i++){
- if(IS_DIR(mb_type, i, list)){
- pred_8x16_motion(h, i*4, list, h->ref_cache[list][ scan8[0] + 2*i ], &mpx, &mpy);
- mx = mpx + decode_cabac_mb_mvd( h, list, 4*i, 0 );
- my = mpy + decode_cabac_mb_mvd( h, list, 4*i, 1 );
-
- tprintf("final mv:%d %d\n", mx, my);
- fill_rectangle(h->mvd_cache[list][ scan8[0] + 2*i ], 2, 4, 8, pack16to32(mx-mpx,my-mpy), 4);
- fill_rectangle(h->mv_cache[list][ scan8[0] + 2*i ], 2, 4, 8, pack16to32(mx,my), 4);
- }else{
- fill_rectangle(h->mvd_cache[list][ scan8[0] + 2*i ], 2, 4, 8, 0, 4);
- fill_rectangle(h-> mv_cache[list][ scan8[0] + 2*i ], 2, 4, 8, 0, 4);
- }
- }
- }
- }
- }
-
- if( IS_INTER( mb_type ) ) {
- h->chroma_pred_mode_table[mb_xy] = 0;
- write_back_motion( h, mb_type );
- }
-
- if( !IS_INTRA16x16( mb_type ) ) {
- cbp = decode_cabac_mb_cbp_luma( h );
- cbp |= decode_cabac_mb_cbp_chroma( h ) << 4;
- }
-
- h->cbp_table[mb_xy] = h->cbp = cbp;
-
- if( dct8x8_allowed && (cbp&15) && !IS_INTRA( mb_type ) ) {
- if( decode_cabac_mb_transform_size( h ) )
- mb_type |= MB_TYPE_8x8DCT;
- }
- s->current_picture.mb_type[mb_xy]= mb_type;
-
- if( cbp || IS_INTRA16x16( mb_type ) ) {
- const uint8_t *scan, *scan8x8, *dc_scan;
- int dqp;
-
- if(IS_INTERLACED(mb_type)){
- scan8x8= s->qscale ? h->field_scan8x8 : h->field_scan8x8_q0;
- scan= s->qscale ? h->field_scan : h->field_scan_q0;
- dc_scan= luma_dc_field_scan;
- }else{
- scan8x8= s->qscale ? h->zigzag_scan8x8 : h->zigzag_scan8x8_q0;
- scan= s->qscale ? h->zigzag_scan : h->zigzag_scan_q0;
- dc_scan= luma_dc_zigzag_scan;
- }
-
- h->last_qscale_diff = dqp = decode_cabac_mb_dqp( h );
- if( dqp == INT_MIN ){
- av_log(h->s.avctx, AV_LOG_ERROR, "cabac decode of qscale diff failed at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
- s->qscale += dqp;
- if(((unsigned)s->qscale) > 51){
- if(s->qscale<0) s->qscale+= 52;
- else s->qscale-= 52;
- }
- h->chroma_qp = get_chroma_qp(h->pps.chroma_qp_index_offset, s->qscale);
-
- if( IS_INTRA16x16( mb_type ) ) {
- int i;
- //av_log( s->avctx, AV_LOG_ERROR, "INTRA16x16 DC\n" );
- if( decode_cabac_residual( h, h->mb, 0, 0, dc_scan, NULL, 16) < 0)
- return -1;
- if( cbp&15 ) {
- for( i = 0; i < 16; i++ ) {
- //av_log( s->avctx, AV_LOG_ERROR, "INTRA16x16 AC:%d\n", i );
- if( decode_cabac_residual(h, h->mb + 16*i, 1, i, scan + 1, h->dequant4_coeff[0][s->qscale], 15) < 0 )
- return -1;
- }
- } else {
- fill_rectangle(&h->non_zero_count_cache[scan8[0]], 4, 4, 8, 0, 1);
- }
- } else {
- int i8x8, i4x4;
- for( i8x8 = 0; i8x8 < 4; i8x8++ ) {
- if( cbp & (1<<i8x8) ) {
- if( IS_8x8DCT(mb_type) ) {
- if( decode_cabac_residual(h, h->mb + 64*i8x8, 5, 4*i8x8,
- scan8x8, h->dequant8_coeff[IS_INTRA( mb_type ) ? 0:1][s->qscale], 64) < 0 )
- return -1;
- } else
- for( i4x4 = 0; i4x4 < 4; i4x4++ ) {
- const int index = 4*i8x8 + i4x4;
- //av_log( s->avctx, AV_LOG_ERROR, "Luma4x4: %d\n", index );
-//START_TIMER
- if( decode_cabac_residual(h, h->mb + 16*index, 2, index, scan, h->dequant4_coeff[IS_INTRA( mb_type ) ? 0:3][s->qscale], 16) < 0 )
- return -1;
-//STOP_TIMER("decode_residual")
- }
- } else {
- uint8_t * const nnz= &h->non_zero_count_cache[ scan8[4*i8x8] ];
- nnz[0] = nnz[1] = nnz[8] = nnz[9] = 0;
- }
- }
- }
-
- if( cbp&0x30 ){
- int c;
- for( c = 0; c < 2; c++ ) {
- //av_log( s->avctx, AV_LOG_ERROR, "INTRA C%d-DC\n",c );
- if( decode_cabac_residual(h, h->mb + 256 + 16*4*c, 3, c, chroma_dc_scan, NULL, 4) < 0)
- return -1;
- }
- }
-
- if( cbp&0x20 ) {
- int c, i;
- for( c = 0; c < 2; c++ ) {
- for( i = 0; i < 4; i++ ) {
- const int index = 16 + 4 * c + i;
- //av_log( s->avctx, AV_LOG_ERROR, "INTRA C%d-AC %d\n",c, index - 16 );
- if( decode_cabac_residual(h, h->mb + 16*index, 4, index - 16, scan + 1, h->dequant4_coeff[c+1+(IS_INTRA( mb_type ) ? 0:3)][h->chroma_qp], 15) < 0)
- return -1;
- }
- }
- } else {
- uint8_t * const nnz= &h->non_zero_count_cache[0];
- nnz[ scan8[16]+0 ] = nnz[ scan8[16]+1 ] =nnz[ scan8[16]+8 ] =nnz[ scan8[16]+9 ] =
- nnz[ scan8[20]+0 ] = nnz[ scan8[20]+1 ] =nnz[ scan8[20]+8 ] =nnz[ scan8[20]+9 ] = 0;
- }
- } else {
- uint8_t * const nnz= &h->non_zero_count_cache[0];
- fill_rectangle(&nnz[scan8[0]], 4, 4, 8, 0, 1);
- nnz[ scan8[16]+0 ] = nnz[ scan8[16]+1 ] =nnz[ scan8[16]+8 ] =nnz[ scan8[16]+9 ] =
- nnz[ scan8[20]+0 ] = nnz[ scan8[20]+1 ] =nnz[ scan8[20]+8 ] =nnz[ scan8[20]+9 ] = 0;
- h->last_qscale_diff = 0;
- }
-
- s->current_picture.qscale_table[mb_xy]= s->qscale;
- write_back_non_zero_count(h);
-
- if(MB_MBAFF){
- h->ref_count[0] >>= 1;
- h->ref_count[1] >>= 1;
- }
-
- return 0;
-}
-
-
-static void filter_mb_edgev( H264Context *h, uint8_t *pix, int stride, int16_t bS[4], int qp ) {
- int i, d;
- const int index_a = qp + h->slice_alpha_c0_offset;
- const int alpha = (alpha_table+52)[index_a];
- const int beta = (beta_table+52)[qp + h->slice_beta_offset];
-
- if( bS[0] < 4 ) {
- int8_t tc[4];
- for(i=0; i<4; i++)
- tc[i] = bS[i] ? (tc0_table+52)[index_a][bS[i] - 1] : -1;
- h->s.dsp.h264_h_loop_filter_luma(pix, stride, alpha, beta, tc);
- } else {
- /* 16px edge length, because bS=4 is triggered by being at
- * the edge of an intra MB, so all 4 bS are the same */
- for( d = 0; d < 16; d++ ) {
- const int p0 = pix[-1];
- const int p1 = pix[-2];
- const int p2 = pix[-3];
-
- const int q0 = pix[0];
- const int q1 = pix[1];
- const int q2 = pix[2];
-
- if( FFABS( p0 - q0 ) < alpha &&
- FFABS( p1 - p0 ) < beta &&
- FFABS( q1 - q0 ) < beta ) {
-
- if(FFABS( p0 - q0 ) < (( alpha >> 2 ) + 2 )){
- if( FFABS( p2 - p0 ) < beta)
- {
- const int p3 = pix[-4];
- /* p0', p1', p2' */
- pix[-1] = ( p2 + 2*p1 + 2*p0 + 2*q0 + q1 + 4 ) >> 3;
- pix[-2] = ( p2 + p1 + p0 + q0 + 2 ) >> 2;
- pix[-3] = ( 2*p3 + 3*p2 + p1 + p0 + q0 + 4 ) >> 3;
- } else {
- /* p0' */
- pix[-1] = ( 2*p1 + p0 + q1 + 2 ) >> 2;
- }
- if( FFABS( q2 - q0 ) < beta)
- {
- const int q3 = pix[3];
- /* q0', q1', q2' */
- pix[0] = ( p1 + 2*p0 + 2*q0 + 2*q1 + q2 + 4 ) >> 3;
- pix[1] = ( p0 + q0 + q1 + q2 + 2 ) >> 2;
- pix[2] = ( 2*q3 + 3*q2 + q1 + q0 + p0 + 4 ) >> 3;
- } else {
- /* q0' */
- pix[0] = ( 2*q1 + q0 + p1 + 2 ) >> 2;
- }
- }else{
- /* p0', q0' */
- pix[-1] = ( 2*p1 + p0 + q1 + 2 ) >> 2;
- pix[ 0] = ( 2*q1 + q0 + p1 + 2 ) >> 2;
- }
- tprintf("filter_mb_edgev i:%d d:%d\n# bS:4 -> [%02x, %02x, %02x, %02x, %02x, %02x] =>[%02x, %02x, %02x, %02x]\n", i, d, p2, p1, p0, q0, q1, q2, pix[-2], pix[-1], pix[0], pix[1]);
- }
- pix += stride;
- }
- }
-}
-static void filter_mb_edgecv( H264Context *h, uint8_t *pix, int stride, int16_t bS[4], int qp ) {
- int i;
- const int index_a = qp + h->slice_alpha_c0_offset;
- const int alpha = (alpha_table+52)[index_a];
- const int beta = (beta_table+52)[qp + h->slice_beta_offset];
-
- if( bS[0] < 4 ) {
- int8_t tc[4];
- for(i=0; i<4; i++)
- tc[i] = bS[i] ? (tc0_table+52)[index_a][bS[i] - 1] + 1 : 0;
- h->s.dsp.h264_h_loop_filter_chroma(pix, stride, alpha, beta, tc);
- } else {
- h->s.dsp.h264_h_loop_filter_chroma_intra(pix, stride, alpha, beta);
- }
-}
-
-static void filter_mb_mbaff_edgev( H264Context *h, uint8_t *pix, int stride, int16_t bS[8], int qp[2] ) {
- int i;
- for( i = 0; i < 16; i++, pix += stride) {
- int index_a;
- int alpha;
- int beta;
-
- int qp_index;
- int bS_index = (i >> 1);
- if (!MB_FIELD) {
- bS_index &= ~1;
- bS_index |= (i & 1);
- }
-
- if( bS[bS_index] == 0 ) {
- continue;
- }
-
- qp_index = MB_FIELD ? (i >> 3) : (i & 1);
- index_a = qp[qp_index] + h->slice_alpha_c0_offset;
- alpha = (alpha_table+52)[index_a];
- beta = (beta_table+52)[qp[qp_index] + h->slice_beta_offset];
-
- if( bS[bS_index] < 4 ) {
- const int tc0 = (tc0_table+52)[index_a][bS[bS_index] - 1];
- const int p0 = pix[-1];
- const int p1 = pix[-2];
- const int p2 = pix[-3];
- const int q0 = pix[0];
- const int q1 = pix[1];
- const int q2 = pix[2];
-
- if( FFABS( p0 - q0 ) < alpha &&
- FFABS( p1 - p0 ) < beta &&
- FFABS( q1 - q0 ) < beta ) {
- int tc = tc0;
- int i_delta;
-
- if( FFABS( p2 - p0 ) < beta ) {
- pix[-2] = p1 + clip( ( p2 + ( ( p0 + q0 + 1 ) >> 1 ) - ( p1 << 1 ) ) >> 1, -tc0, tc0 );
- tc++;
- }
- if( FFABS( q2 - q0 ) < beta ) {
- pix[1] = q1 + clip( ( q2 + ( ( p0 + q0 + 1 ) >> 1 ) - ( q1 << 1 ) ) >> 1, -tc0, tc0 );
- tc++;
- }
-
- i_delta = clip( (((q0 - p0 ) << 2) + (p1 - q1) + 4) >> 3, -tc, tc );
- pix[-1] = clip_uint8( p0 + i_delta ); /* p0' */
- pix[0] = clip_uint8( q0 - i_delta ); /* q0' */
- tprintf("filter_mb_mbaff_edgev i:%d, qp:%d, indexA:%d, alpha:%d, beta:%d, tc:%d\n# bS:%d -> [%02x, %02x, %02x, %02x, %02x, %02x] =>[%02x, %02x, %02x, %02x]\n", i, qp[qp_index], index_a, alpha, beta, tc, bS[bS_index], pix[-3], p1, p0, q0, q1, pix[2], p1, pix[-1], pix[0], q1);
- }
- }else{
- const int p0 = pix[-1];
- const int p1 = pix[-2];
- const int p2 = pix[-3];
-
- const int q0 = pix[0];
- const int q1 = pix[1];
- const int q2 = pix[2];
-
- if( FFABS( p0 - q0 ) < alpha &&
- FFABS( p1 - p0 ) < beta &&
- FFABS( q1 - q0 ) < beta ) {
-
- if(FFABS( p0 - q0 ) < (( alpha >> 2 ) + 2 )){
- if( FFABS( p2 - p0 ) < beta)
- {
- const int p3 = pix[-4];
- /* p0', p1', p2' */
- pix[-1] = ( p2 + 2*p1 + 2*p0 + 2*q0 + q1 + 4 ) >> 3;
- pix[-2] = ( p2 + p1 + p0 + q0 + 2 ) >> 2;
- pix[-3] = ( 2*p3 + 3*p2 + p1 + p0 + q0 + 4 ) >> 3;
- } else {
- /* p0' */
- pix[-1] = ( 2*p1 + p0 + q1 + 2 ) >> 2;
- }
- if( FFABS( q2 - q0 ) < beta)
- {
- const int q3 = pix[3];
- /* q0', q1', q2' */
- pix[0] = ( p1 + 2*p0 + 2*q0 + 2*q1 + q2 + 4 ) >> 3;
- pix[1] = ( p0 + q0 + q1 + q2 + 2 ) >> 2;
- pix[2] = ( 2*q3 + 3*q2 + q1 + q0 + p0 + 4 ) >> 3;
- } else {
- /* q0' */
- pix[0] = ( 2*q1 + q0 + p1 + 2 ) >> 2;
- }
- }else{
- /* p0', q0' */
- pix[-1] = ( 2*p1 + p0 + q1 + 2 ) >> 2;
- pix[ 0] = ( 2*q1 + q0 + p1 + 2 ) >> 2;
- }
- tprintf("filter_mb_mbaff_edgev i:%d, qp:%d, indexA:%d, alpha:%d, beta:%d\n# bS:4 -> [%02x, %02x, %02x, %02x, %02x, %02x] =>[%02x, %02x, %02x, %02x, %02x, %02x]\n", i, qp[qp_index], index_a, alpha, beta, p2, p1, p0, q0, q1, q2, pix[-3], pix[-2], pix[-1], pix[0], pix[1], pix[2]);
- }
- }
- }
-}
-static void filter_mb_mbaff_edgecv( H264Context *h, uint8_t *pix, int stride, int16_t bS[8], int qp[2] ) {
- int i;
- for( i = 0; i < 8; i++, pix += stride) {
- int index_a;
- int alpha;
- int beta;
-
- int qp_index;
- int bS_index = i;
-
- if( bS[bS_index] == 0 ) {
- continue;
- }
-
- qp_index = MB_FIELD ? (i >> 2) : (i & 1);
- index_a = qp[qp_index] + h->slice_alpha_c0_offset;
- alpha = (alpha_table+52)[index_a];
- beta = (beta_table+52)[qp[qp_index] + h->slice_beta_offset];
-
- if( bS[bS_index] < 4 ) {
- const int tc = (tc0_table+52)[index_a][bS[bS_index] - 1] + 1;
- const int p0 = pix[-1];
- const int p1 = pix[-2];
- const int q0 = pix[0];
- const int q1 = pix[1];
-
- if( FFABS( p0 - q0 ) < alpha &&
- FFABS( p1 - p0 ) < beta &&
- FFABS( q1 - q0 ) < beta ) {
- const int i_delta = clip( (((q0 - p0 ) << 2) + (p1 - q1) + 4) >> 3, -tc, tc );
-
- pix[-1] = clip_uint8( p0 + i_delta ); /* p0' */
- pix[0] = clip_uint8( q0 - i_delta ); /* q0' */
- tprintf("filter_mb_mbaff_edgecv i:%d, qp:%d, indexA:%d, alpha:%d, beta:%d, tc:%d\n# bS:%d -> [%02x, %02x, %02x, %02x, %02x, %02x] =>[%02x, %02x, %02x, %02x]\n", i, qp[qp_index], index_a, alpha, beta, tc, bS[bS_index], pix[-3], p1, p0, q0, q1, pix[2], p1, pix[-1], pix[0], q1);
- }
- }else{
- const int p0 = pix[-1];
- const int p1 = pix[-2];
- const int q0 = pix[0];
- const int q1 = pix[1];
-
- if( FFABS( p0 - q0 ) < alpha &&
- FFABS( p1 - p0 ) < beta &&
- FFABS( q1 - q0 ) < beta ) {
-
- pix[-1] = ( 2*p1 + p0 + q1 + 2 ) >> 2; /* p0' */
- pix[0] = ( 2*q1 + q0 + p1 + 2 ) >> 2; /* q0' */
- tprintf("filter_mb_mbaff_edgecv i:%d\n# bS:4 -> [%02x, %02x, %02x, %02x, %02x, %02x] =>[%02x, %02x, %02x, %02x, %02x, %02x]\n", i, pix[-3], p1, p0, q0, q1, pix[2], pix[-3], pix[-2], pix[-1], pix[0], pix[1], pix[2]);
- }
- }
- }
-}
-
-static void filter_mb_edgeh( H264Context *h, uint8_t *pix, int stride, int16_t bS[4], int qp ) {
- int i, d;
- const int index_a = qp + h->slice_alpha_c0_offset;
- const int alpha = (alpha_table+52)[index_a];
- const int beta = (beta_table+52)[qp + h->slice_beta_offset];
- const int pix_next = stride;
-
- if( bS[0] < 4 ) {
- int8_t tc[4];
- for(i=0; i<4; i++)
- tc[i] = bS[i] ? (tc0_table+52)[index_a][bS[i] - 1] : -1;
- h->s.dsp.h264_v_loop_filter_luma(pix, stride, alpha, beta, tc);
- } else {
- /* 16px edge length, see filter_mb_edgev */
- for( d = 0; d < 16; d++ ) {
- const int p0 = pix[-1*pix_next];
- const int p1 = pix[-2*pix_next];
- const int p2 = pix[-3*pix_next];
- const int q0 = pix[0];
- const int q1 = pix[1*pix_next];
- const int q2 = pix[2*pix_next];
-
- if( FFABS( p0 - q0 ) < alpha &&
- FFABS( p1 - p0 ) < beta &&
- FFABS( q1 - q0 ) < beta ) {
-
- const int p3 = pix[-4*pix_next];
- const int q3 = pix[ 3*pix_next];
-
- if(FFABS( p0 - q0 ) < (( alpha >> 2 ) + 2 )){
- if( FFABS( p2 - p0 ) < beta) {
- /* p0', p1', p2' */
- pix[-1*pix_next] = ( p2 + 2*p1 + 2*p0 + 2*q0 + q1 + 4 ) >> 3;
- pix[-2*pix_next] = ( p2 + p1 + p0 + q0 + 2 ) >> 2;
- pix[-3*pix_next] = ( 2*p3 + 3*p2 + p1 + p0 + q0 + 4 ) >> 3;
- } else {
- /* p0' */
- pix[-1*pix_next] = ( 2*p1 + p0 + q1 + 2 ) >> 2;
- }
- if( FFABS( q2 - q0 ) < beta) {
- /* q0', q1', q2' */
- pix[0*pix_next] = ( p1 + 2*p0 + 2*q0 + 2*q1 + q2 + 4 ) >> 3;
- pix[1*pix_next] = ( p0 + q0 + q1 + q2 + 2 ) >> 2;
- pix[2*pix_next] = ( 2*q3 + 3*q2 + q1 + q0 + p0 + 4 ) >> 3;
- } else {
- /* q0' */
- pix[0*pix_next] = ( 2*q1 + q0 + p1 + 2 ) >> 2;
- }
- }else{
- /* p0', q0' */
- pix[-1*pix_next] = ( 2*p1 + p0 + q1 + 2 ) >> 2;
- pix[ 0*pix_next] = ( 2*q1 + q0 + p1 + 2 ) >> 2;
- }
- tprintf("filter_mb_edgeh i:%d d:%d, qp:%d, indexA:%d, alpha:%d, beta:%d\n# bS:%d -> [%02x, %02x, %02x, %02x, %02x, %02x] =>[%02x, %02x, %02x, %02x]\n", i, d, qp, index_a, alpha, beta, bS[i], p2, p1, p0, q0, q1, q2, pix[-2*pix_next], pix[-pix_next], pix[0], pix[pix_next]);
- }
- pix++;
- }
- }
-}
-
-static void filter_mb_edgech( H264Context *h, uint8_t *pix, int stride, int16_t bS[4], int qp ) {
- int i;
- const int index_a = qp + h->slice_alpha_c0_offset;
- const int alpha = (alpha_table+52)[index_a];
- const int beta = (beta_table+52)[qp + h->slice_beta_offset];
-
- if( bS[0] < 4 ) {
- int8_t tc[4];
- for(i=0; i<4; i++)
- tc[i] = bS[i] ? (tc0_table+52)[index_a][bS[i] - 1] + 1 : 0;
- h->s.dsp.h264_v_loop_filter_chroma(pix, stride, alpha, beta, tc);
- } else {
- h->s.dsp.h264_v_loop_filter_chroma_intra(pix, stride, alpha, beta);
- }
-}
-
-static void filter_mb_fast( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize) {
- MpegEncContext * const s = &h->s;
- int mb_xy, mb_type;
- int qp, qp0, qp1, qpc, qpc0, qpc1, qp_thresh;
-
- if(mb_x==0 || mb_y==0 || !s->dsp.h264_loop_filter_strength) {
- filter_mb(h, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize);
- return;
- }
- assert(!FRAME_MBAFF);
-
- mb_xy = mb_x + mb_y*s->mb_stride;
- mb_type = s->current_picture.mb_type[mb_xy];
- qp = s->current_picture.qscale_table[mb_xy];
- qp0 = s->current_picture.qscale_table[mb_xy-1];
- qp1 = s->current_picture.qscale_table[h->top_mb_xy];
- qpc = get_chroma_qp( h->pps.chroma_qp_index_offset, qp );
- qpc0 = get_chroma_qp( h->pps.chroma_qp_index_offset, qp0 );
- qpc1 = get_chroma_qp( h->pps.chroma_qp_index_offset, qp1 );
- qp0 = (qp + qp0 + 1) >> 1;
- qp1 = (qp + qp1 + 1) >> 1;
- qpc0 = (qpc + qpc0 + 1) >> 1;
- qpc1 = (qpc + qpc1 + 1) >> 1;
- qp_thresh = 15 - h->slice_alpha_c0_offset;
- if(qp <= qp_thresh && qp0 <= qp_thresh && qp1 <= qp_thresh &&
- qpc <= qp_thresh && qpc0 <= qp_thresh && qpc1 <= qp_thresh)
- return;
-
- if( IS_INTRA(mb_type) ) {
- int16_t bS4[4] = {4,4,4,4};
- int16_t bS3[4] = {3,3,3,3};
- if( IS_8x8DCT(mb_type) ) {
- filter_mb_edgev( h, &img_y[4*0], linesize, bS4, qp0 );
- filter_mb_edgev( h, &img_y[4*2], linesize, bS3, qp );
- filter_mb_edgeh( h, &img_y[4*0*linesize], linesize, bS4, qp1 );
- filter_mb_edgeh( h, &img_y[4*2*linesize], linesize, bS3, qp );
- } else {
- filter_mb_edgev( h, &img_y[4*0], linesize, bS4, qp0 );
- filter_mb_edgev( h, &img_y[4*1], linesize, bS3, qp );
- filter_mb_edgev( h, &img_y[4*2], linesize, bS3, qp );
- filter_mb_edgev( h, &img_y[4*3], linesize, bS3, qp );
- filter_mb_edgeh( h, &img_y[4*0*linesize], linesize, bS4, qp1 );
- filter_mb_edgeh( h, &img_y[4*1*linesize], linesize, bS3, qp );
- filter_mb_edgeh( h, &img_y[4*2*linesize], linesize, bS3, qp );
- filter_mb_edgeh( h, &img_y[4*3*linesize], linesize, bS3, qp );
- }
- filter_mb_edgecv( h, &img_cb[2*0], uvlinesize, bS4, qpc0 );
- filter_mb_edgecv( h, &img_cb[2*2], uvlinesize, bS3, qpc );
- filter_mb_edgecv( h, &img_cr[2*0], uvlinesize, bS4, qpc0 );
- filter_mb_edgecv( h, &img_cr[2*2], uvlinesize, bS3, qpc );
- filter_mb_edgech( h, &img_cb[2*0*uvlinesize], uvlinesize, bS4, qpc1 );
- filter_mb_edgech( h, &img_cb[2*2*uvlinesize], uvlinesize, bS3, qpc );
- filter_mb_edgech( h, &img_cr[2*0*uvlinesize], uvlinesize, bS4, qpc1 );
- filter_mb_edgech( h, &img_cr[2*2*uvlinesize], uvlinesize, bS3, qpc );
- return;
- } else {
- DECLARE_ALIGNED_8(int16_t, bS[2][4][4]);
- uint64_t (*bSv)[4] = (uint64_t(*)[4])bS;
- int edges;
- if( IS_8x8DCT(mb_type) && (h->cbp&7) == 7 ) {
- edges = 4;
- bSv[0][0] = bSv[0][2] = bSv[1][0] = bSv[1][2] = 0x0002000200020002ULL;
- } else {
- int mask_edge1 = (mb_type & (MB_TYPE_16x16 | MB_TYPE_8x16)) ? 3 :
- (mb_type & MB_TYPE_16x8) ? 1 : 0;
- int mask_edge0 = (mb_type & (MB_TYPE_16x16 | MB_TYPE_8x16))
- && (s->current_picture.mb_type[mb_xy-1] & (MB_TYPE_16x16 | MB_TYPE_8x16))
- ? 3 : 0;
- int step = IS_8x8DCT(mb_type) ? 2 : 1;
- edges = (mb_type & MB_TYPE_16x16) && !(h->cbp & 15) ? 1 : 4;
- s->dsp.h264_loop_filter_strength( bS, h->non_zero_count_cache, h->ref_cache, h->mv_cache,
- (h->slice_type == B_TYPE), edges, step, mask_edge0, mask_edge1 );
- }
- if( IS_INTRA(s->current_picture.mb_type[mb_xy-1]) )
- bSv[0][0] = 0x0004000400040004ULL;
- if( IS_INTRA(s->current_picture.mb_type[h->top_mb_xy]) )
- bSv[1][0] = 0x0004000400040004ULL;
-
-#define FILTER(hv,dir,edge)\
- if(bSv[dir][edge]) {\
- filter_mb_edge##hv( h, &img_y[4*edge*(dir?linesize:1)], linesize, bS[dir][edge], edge ? qp : qp##dir );\
- if(!(edge&1)) {\
- filter_mb_edgec##hv( h, &img_cb[2*edge*(dir?uvlinesize:1)], uvlinesize, bS[dir][edge], edge ? qpc : qpc##dir );\
- filter_mb_edgec##hv( h, &img_cr[2*edge*(dir?uvlinesize:1)], uvlinesize, bS[dir][edge], edge ? qpc : qpc##dir );\
- }\
- }
- if( edges == 1 ) {
- FILTER(v,0,0);
- FILTER(h,1,0);
- } else if( IS_8x8DCT(mb_type) ) {
- FILTER(v,0,0);
- FILTER(v,0,2);
- FILTER(h,1,0);
- FILTER(h,1,2);
- } else {
- FILTER(v,0,0);
- FILTER(v,0,1);
- FILTER(v,0,2);
- FILTER(v,0,3);
- FILTER(h,1,0);
- FILTER(h,1,1);
- FILTER(h,1,2);
- FILTER(h,1,3);
- }
-#undef FILTER
- }
-}
-
-static void filter_mb( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize) {
- MpegEncContext * const s = &h->s;
- const int mb_xy= mb_x + mb_y*s->mb_stride;
- const int mb_type = s->current_picture.mb_type[mb_xy];
- const int mvy_limit = IS_INTERLACED(mb_type) ? 2 : 4;
- int first_vertical_edge_done = 0;
- int dir;
- /* FIXME: A given frame may occupy more than one position in
- * the reference list. So ref2frm should be populated with
- * frame numbers, not indices. */
- static const int ref2frm[34] = {-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
- 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
-
- //for sufficiently low qp, filtering wouldn't do anything
- //this is a conservative estimate: could also check beta_offset and more accurate chroma_qp
- if(!FRAME_MBAFF){
- int qp_thresh = 15 - h->slice_alpha_c0_offset - FFMAX(0, h->pps.chroma_qp_index_offset);
- int qp = s->current_picture.qscale_table[mb_xy];
- if(qp <= qp_thresh
- && (mb_x == 0 || ((qp + s->current_picture.qscale_table[mb_xy-1] + 1)>>1) <= qp_thresh)
- && (mb_y == 0 || ((qp + s->current_picture.qscale_table[h->top_mb_xy] + 1)>>1) <= qp_thresh)){
- return;
- }
- }
-
- if (FRAME_MBAFF
- // left mb is in picture
- && h->slice_table[mb_xy-1] != 255
- // and current and left pair do not have the same interlaced type
- && (IS_INTERLACED(mb_type) != IS_INTERLACED(s->current_picture.mb_type[mb_xy-1]))
- // and left mb is in the same slice if deblocking_filter == 2
- && (h->deblocking_filter!=2 || h->slice_table[mb_xy-1] == h->slice_table[mb_xy])) {
- /* First vertical edge is different in MBAFF frames
- * There are 8 different bS to compute and 2 different Qp
- */
- const int pair_xy = mb_x + (mb_y&~1)*s->mb_stride;
- const int left_mb_xy[2] = { pair_xy-1, pair_xy-1+s->mb_stride };
- int16_t bS[8];
- int qp[2];
- int chroma_qp[2];
- int mb_qp, mbn0_qp, mbn1_qp;
- int i;
- first_vertical_edge_done = 1;
-
- if( IS_INTRA(mb_type) )
- bS[0] = bS[1] = bS[2] = bS[3] = bS[4] = bS[5] = bS[6] = bS[7] = 4;
- else {
- for( i = 0; i < 8; i++ ) {
- int mbn_xy = MB_FIELD ? left_mb_xy[i>>2] : left_mb_xy[i&1];
-
- if( IS_INTRA( s->current_picture.mb_type[mbn_xy] ) )
- bS[i] = 4;
- else if( h->non_zero_count_cache[12+8*(i>>1)] != 0 ||
- /* FIXME: with 8x8dct + cavlc, should check cbp instead of nnz */
- h->non_zero_count[mbn_xy][MB_FIELD ? i&3 : (i>>2)+(mb_y&1)*2] )
- bS[i] = 2;
- else
- bS[i] = 1;
- }
- }
-
- mb_qp = s->current_picture.qscale_table[mb_xy];
- mbn0_qp = s->current_picture.qscale_table[left_mb_xy[0]];
- mbn1_qp = s->current_picture.qscale_table[left_mb_xy[1]];
- qp[0] = ( mb_qp + mbn0_qp + 1 ) >> 1;
- chroma_qp[0] = ( get_chroma_qp( h->pps.chroma_qp_index_offset, mb_qp ) +
- get_chroma_qp( h->pps.chroma_qp_index_offset, mbn0_qp ) + 1 ) >> 1;
- qp[1] = ( mb_qp + mbn1_qp + 1 ) >> 1;
- chroma_qp[1] = ( get_chroma_qp( h->pps.chroma_qp_index_offset, mb_qp ) +
- get_chroma_qp( h->pps.chroma_qp_index_offset, mbn1_qp ) + 1 ) >> 1;
-
- /* Filter edge */
- tprintf("filter mb:%d/%d MBAFF, QPy:%d/%d, QPc:%d/%d ls:%d uvls:%d", mb_x, mb_y, qp[0], qp[1], chroma_qp[0], chroma_qp[1], linesize, uvlinesize);
- { int i; for (i = 0; i < 8; i++) tprintf(" bS[%d]:%d", i, bS[i]); tprintf("\n"); }
- filter_mb_mbaff_edgev ( h, &img_y [0], linesize, bS, qp );
- filter_mb_mbaff_edgecv( h, &img_cb[0], uvlinesize, bS, chroma_qp );
- filter_mb_mbaff_edgecv( h, &img_cr[0], uvlinesize, bS, chroma_qp );
- }
- /* dir : 0 -> vertical edge, 1 -> horizontal edge */
- for( dir = 0; dir < 2; dir++ )
- {
- int edge;
- const int mbm_xy = dir == 0 ? mb_xy -1 : h->top_mb_xy;
- const int mbm_type = s->current_picture.mb_type[mbm_xy];
- int start = h->slice_table[mbm_xy] == 255 ? 1 : 0;
-
- const int edges = (mb_type & (MB_TYPE_16x16|MB_TYPE_SKIP))
- == (MB_TYPE_16x16|MB_TYPE_SKIP) ? 1 : 4;
- // how often to recheck mv-based bS when iterating between edges
- const int mask_edge = (mb_type & (MB_TYPE_16x16 | (MB_TYPE_16x8 << dir))) ? 3 :
- (mb_type & (MB_TYPE_8x16 >> dir)) ? 1 : 0;
- // how often to recheck mv-based bS when iterating along each edge
- const int mask_par0 = mb_type & (MB_TYPE_16x16 | (MB_TYPE_8x16 >> dir));
-
- if (first_vertical_edge_done) {
- start = 1;
- first_vertical_edge_done = 0;
- }
-
- if (h->deblocking_filter==2 && h->slice_table[mbm_xy] != h->slice_table[mb_xy])
- start = 1;
-
- if (FRAME_MBAFF && (dir == 1) && ((mb_y&1) == 0) && start == 0
- && !IS_INTERLACED(mb_type)
- && IS_INTERLACED(mbm_type)
- ) {
- // This is a special case in the norm where the filtering must
- // be done twice (one each of the field) even if we are in a
- // frame macroblock.
- //
- static const int nnz_idx[4] = {4,5,6,3};
- unsigned int tmp_linesize = 2 * linesize;
- unsigned int tmp_uvlinesize = 2 * uvlinesize;
- int mbn_xy = mb_xy - 2 * s->mb_stride;
- int qp, chroma_qp;
- int i, j;
- int16_t bS[4];
-
- for(j=0; j<2; j++, mbn_xy += s->mb_stride){
- if( IS_INTRA(mb_type) ||
- IS_INTRA(s->current_picture.mb_type[mbn_xy]) ) {
- bS[0] = bS[1] = bS[2] = bS[3] = 3;
- } else {
- const uint8_t *mbn_nnz = h->non_zero_count[mbn_xy];
- for( i = 0; i < 4; i++ ) {
- if( h->non_zero_count_cache[scan8[0]+i] != 0 ||
- mbn_nnz[nnz_idx[i]] != 0 )
- bS[i] = 2;
- else
- bS[i] = 1;
- }
- }
- // Do not use s->qscale as luma quantizer because it has not the same
- // value in IPCM macroblocks.
- qp = ( s->current_picture.qscale_table[mb_xy] + s->current_picture.qscale_table[mbn_xy] + 1 ) >> 1;
- tprintf("filter mb:%d/%d dir:%d edge:%d, QPy:%d ls:%d uvls:%d", mb_x, mb_y, dir, edge, qp, tmp_linesize, tmp_uvlinesize);
- { int i; for (i = 0; i < 4; i++) tprintf(" bS[%d]:%d", i, bS[i]); tprintf("\n"); }
- filter_mb_edgeh( h, &img_y[j*linesize], tmp_linesize, bS, qp );
- chroma_qp = ( h->chroma_qp +
- get_chroma_qp( h->pps.chroma_qp_index_offset, s->current_picture.qscale_table[mbn_xy] ) + 1 ) >> 1;
- filter_mb_edgech( h, &img_cb[j*uvlinesize], tmp_uvlinesize, bS, chroma_qp );
- filter_mb_edgech( h, &img_cr[j*uvlinesize], tmp_uvlinesize, bS, chroma_qp );
- }
-
- start = 1;
- }
-
- /* Calculate bS */
- for( edge = start; edge < edges; edge++ ) {
- /* mbn_xy: neighbor macroblock */
- const int mbn_xy = edge > 0 ? mb_xy : mbm_xy;
- const int mbn_type = s->current_picture.mb_type[mbn_xy];
- int16_t bS[4];
- int qp;
-
- if( (edge&1) && IS_8x8DCT(mb_type) )
- continue;
-
- if( IS_INTRA(mb_type) ||
- IS_INTRA(mbn_type) ) {
- int value;
- if (edge == 0) {
- if ( (!IS_INTERLACED(mb_type) && !IS_INTERLACED(mbm_type))
- || ((FRAME_MBAFF || (s->picture_structure != PICT_FRAME)) && (dir == 0))
- ) {
- value = 4;
- } else {
- value = 3;
- }
- } else {
- value = 3;
- }
- bS[0] = bS[1] = bS[2] = bS[3] = value;
- } else {
- int i, l;
- int mv_done;
-
- if( edge & mask_edge ) {
- bS[0] = bS[1] = bS[2] = bS[3] = 0;
- mv_done = 1;
- }
- else if( FRAME_MBAFF && IS_INTERLACED(mb_type ^ mbn_type)) {
- bS[0] = bS[1] = bS[2] = bS[3] = 1;
- mv_done = 1;
- }
- else if( mask_par0 && (edge || (mbn_type & (MB_TYPE_16x16 | (MB_TYPE_8x16 >> dir)))) ) {
- int b_idx= 8 + 4 + edge * (dir ? 8:1);
- int bn_idx= b_idx - (dir ? 8:1);
- int v = 0;
- for( l = 0; !v && l < 1 + (h->slice_type == B_TYPE); l++ ) {
- v |= ref2frm[h->ref_cache[l][b_idx]+2] != ref2frm[h->ref_cache[l][bn_idx]+2] ||
- FFABS( h->mv_cache[l][b_idx][0] - h->mv_cache[l][bn_idx][0] ) >= 4 ||
- FFABS( h->mv_cache[l][b_idx][1] - h->mv_cache[l][bn_idx][1] ) >= mvy_limit;
- }
- bS[0] = bS[1] = bS[2] = bS[3] = v;
- mv_done = 1;
- }
- else
- mv_done = 0;
-
- for( i = 0; i < 4; i++ ) {
- int x = dir == 0 ? edge : i;
- int y = dir == 0 ? i : edge;
- int b_idx= 8 + 4 + x + 8*y;
- int bn_idx= b_idx - (dir ? 8:1);
-
- if( h->non_zero_count_cache[b_idx] != 0 ||
- h->non_zero_count_cache[bn_idx] != 0 ) {
- bS[i] = 2;
- }
- else if(!mv_done)
- {
- bS[i] = 0;
- for( l = 0; l < 1 + (h->slice_type == B_TYPE); l++ ) {
- if( ref2frm[h->ref_cache[l][b_idx]+2] != ref2frm[h->ref_cache[l][bn_idx]+2] ||
- FFABS( h->mv_cache[l][b_idx][0] - h->mv_cache[l][bn_idx][0] ) >= 4 ||
- FFABS( h->mv_cache[l][b_idx][1] - h->mv_cache[l][bn_idx][1] ) >= mvy_limit ) {
- bS[i] = 1;
- break;
- }
- }
- }
- }
-
- if(bS[0]+bS[1]+bS[2]+bS[3] == 0)
- continue;
- }
-
- /* Filter edge */
- // Do not use s->qscale as luma quantizer because it has not the same
- // value in IPCM macroblocks.
- qp = ( s->current_picture.qscale_table[mb_xy] + s->current_picture.qscale_table[mbn_xy] + 1 ) >> 1;
- //tprintf("filter mb:%d/%d dir:%d edge:%d, QPy:%d, QPc:%d, QPcn:%d\n", mb_x, mb_y, dir, edge, qp, h->chroma_qp, s->current_picture.qscale_table[mbn_xy]);
- tprintf("filter mb:%d/%d dir:%d edge:%d, QPy:%d ls:%d uvls:%d", mb_x, mb_y, dir, edge, qp, linesize, uvlinesize);
- { int i; for (i = 0; i < 4; i++) tprintf(" bS[%d]:%d", i, bS[i]); tprintf("\n"); }
- if( dir == 0 ) {
- filter_mb_edgev( h, &img_y[4*edge], linesize, bS, qp );
- if( (edge&1) == 0 ) {
- int chroma_qp = ( h->chroma_qp +
- get_chroma_qp( h->pps.chroma_qp_index_offset, s->current_picture.qscale_table[mbn_xy] ) + 1 ) >> 1;
- filter_mb_edgecv( h, &img_cb[2*edge], uvlinesize, bS, chroma_qp );
- filter_mb_edgecv( h, &img_cr[2*edge], uvlinesize, bS, chroma_qp );
- }
- } else {
- filter_mb_edgeh( h, &img_y[4*edge*linesize], linesize, bS, qp );
- if( (edge&1) == 0 ) {
- int chroma_qp = ( h->chroma_qp +
- get_chroma_qp( h->pps.chroma_qp_index_offset, s->current_picture.qscale_table[mbn_xy] ) + 1 ) >> 1;
- filter_mb_edgech( h, &img_cb[2*edge*uvlinesize], uvlinesize, bS, chroma_qp );
- filter_mb_edgech( h, &img_cr[2*edge*uvlinesize], uvlinesize, bS, chroma_qp );
- }
- }
- }
- }
-}
-
-static int decode_slice(H264Context *h){
- MpegEncContext * const s = &h->s;
- const int part_mask= s->partitioned_frame ? (AC_END|AC_ERROR) : 0x7F;
-
- s->mb_skip_run= -1;
-
- if( h->pps.cabac ) {
- int i;
-
- /* realign */
- align_get_bits( &s->gb );
-
- /* init cabac */
- ff_init_cabac_states( &h->cabac);
- ff_init_cabac_decoder( &h->cabac,
- s->gb.buffer + get_bits_count(&s->gb)/8,
- ( s->gb.size_in_bits - get_bits_count(&s->gb) + 7)/8);
- /* calculate pre-state */
- for( i= 0; i < 460; i++ ) {
- int pre;
- if( h->slice_type == I_TYPE )
- pre = clip( ((cabac_context_init_I[i][0] * s->qscale) >>4 ) + cabac_context_init_I[i][1], 1, 126 );
- else
- pre = clip( ((cabac_context_init_PB[h->cabac_init_idc][i][0] * s->qscale) >>4 ) + cabac_context_init_PB[h->cabac_init_idc][i][1], 1, 126 );
-
- if( pre <= 63 )
- h->cabac_state[i] = 2 * ( 63 - pre ) + 0;
- else
- h->cabac_state[i] = 2 * ( pre - 64 ) + 1;
- }
-
- for(;;){
-//START_TIMER
- int ret = decode_mb_cabac(h);
- int eos;
-//STOP_TIMER("decode_mb_cabac")
-
- if(ret>=0) hl_decode_mb(h);
-
- if( ret >= 0 && FRAME_MBAFF ) { //FIXME optimal? or let mb_decode decode 16x32 ?
- s->mb_y++;
-
- if(ret>=0) ret = decode_mb_cabac(h);
-
- if(ret>=0) hl_decode_mb(h);
- s->mb_y--;
- }
- eos = get_cabac_terminate( &h->cabac );
-
- if( ret < 0 || h->cabac.bytestream > h->cabac.bytestream_end + 2) {
- av_log(h->s.avctx, AV_LOG_ERROR, "error while decoding MB %d %d, bytestream (%d)\n", s->mb_x, s->mb_y, h->cabac.bytestream_end - h->cabac.bytestream);
- ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, (AC_ERROR|DC_ERROR|MV_ERROR)&part_mask);
- return -1;
- }
-
- if( ++s->mb_x >= s->mb_width ) {
- s->mb_x = 0;
- ff_draw_horiz_band(s, 16*s->mb_y, 16);
- ++s->mb_y;
- if(FRAME_MBAFF) {
- ++s->mb_y;
- }
- }
-
- if( eos || s->mb_y >= s->mb_height ) {
- tprintf("slice end %d %d\n", get_bits_count(&s->gb), s->gb.size_in_bits);
- ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, (AC_END|DC_END|MV_END)&part_mask);
- return 0;
- }
- }
-
- } else {
- for(;;){
- int ret = decode_mb_cavlc(h);
-
- if(ret>=0) hl_decode_mb(h);
-
- if(ret>=0 && FRAME_MBAFF){ //FIXME optimal? or let mb_decode decode 16x32 ?
- s->mb_y++;
- ret = decode_mb_cavlc(h);
-
- if(ret>=0) hl_decode_mb(h);
- s->mb_y--;
- }
-
- if(ret<0){
- av_log(h->s.avctx, AV_LOG_ERROR, "error while decoding MB %d %d\n", s->mb_x, s->mb_y);
- ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, (AC_ERROR|DC_ERROR|MV_ERROR)&part_mask);
-
- return -1;
- }
-
- if(++s->mb_x >= s->mb_width){
- s->mb_x=0;
- ff_draw_horiz_band(s, 16*s->mb_y, 16);
- ++s->mb_y;
- if(FRAME_MBAFF) {
- ++s->mb_y;
- }
- if(s->mb_y >= s->mb_height){
- tprintf("slice end %d %d\n", get_bits_count(&s->gb), s->gb.size_in_bits);
-
- if(get_bits_count(&s->gb) == s->gb.size_in_bits ) {
- ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, (AC_END|DC_END|MV_END)&part_mask);
-
- return 0;
- }else{
- ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, (AC_END|DC_END|MV_END)&part_mask);
-
- return -1;
- }
- }
- }
-
- if(get_bits_count(&s->gb) >= s->gb.size_in_bits && s->mb_skip_run<=0){
- tprintf("slice end %d %d\n", get_bits_count(&s->gb), s->gb.size_in_bits);
- if(get_bits_count(&s->gb) == s->gb.size_in_bits ){
- ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, (AC_END|DC_END|MV_END)&part_mask);
-
- return 0;
- }else{
- ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, (AC_ERROR|DC_ERROR|MV_ERROR)&part_mask);
-
- return -1;
- }
- }
- }
- }
-
-#if 0
- for(;s->mb_y < s->mb_height; s->mb_y++){
- for(;s->mb_x < s->mb_width; s->mb_x++){
- int ret= decode_mb(h);
-
- hl_decode_mb(h);
-
- if(ret<0){
- av_log(s->avctx, AV_LOG_ERROR, "error while decoding MB %d %d\n", s->mb_x, s->mb_y);
- ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, (AC_ERROR|DC_ERROR|MV_ERROR)&part_mask);
-
- return -1;
- }
-
- if(++s->mb_x >= s->mb_width){
- s->mb_x=0;
- if(++s->mb_y >= s->mb_height){
- if(get_bits_count(s->gb) == s->gb.size_in_bits){
- ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, (AC_END|DC_END|MV_END)&part_mask);
-
- return 0;
- }else{
- ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, (AC_END|DC_END|MV_END)&part_mask);
-
- return -1;
- }
- }
- }
-
- if(get_bits_count(s->?gb) >= s->gb?.size_in_bits){
- if(get_bits_count(s->gb) == s->gb.size_in_bits){
- ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, (AC_END|DC_END|MV_END)&part_mask);
-
- return 0;
- }else{
- ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, (AC_ERROR|DC_ERROR|MV_ERROR)&part_mask);
-
- return -1;
- }
- }
- }
- s->mb_x=0;
- ff_draw_horiz_band(s, 16*s->mb_y, 16);
- }
-#endif
- return -1; //not reached
-}
-
-static int decode_unregistered_user_data(H264Context *h, int size){
- MpegEncContext * const s = &h->s;
- uint8_t user_data[16+256];
- int e, build, i;
-
- if(size<16)
- return -1;
-
- for(i=0; i<sizeof(user_data)-1 && i<size; i++){
- user_data[i]= get_bits(&s->gb, 8);
- }
-
- user_data[i]= 0;
- e= sscanf(user_data+16, "x264 - core %d"/*%s - H.264/MPEG-4 AVC codec - Copyleft 2005 - http://www.videolan.org/x264.html*/, &build);
- if(e==1 && build>=0)
- h->x264_build= build;
-
- if(s->avctx->debug & FF_DEBUG_BUGS)
- av_log(s->avctx, AV_LOG_DEBUG, "user data:\"%s\"\n", user_data+16);
-
- for(; i<size; i++)
- skip_bits(&s->gb, 8);
-
- return 0;
-}
-
-static int decode_sei(H264Context *h){
- MpegEncContext * const s = &h->s;
-
- while(get_bits_count(&s->gb) + 16 < s->gb.size_in_bits){
- int size, type;
-
- type=0;
- do{
- type+= show_bits(&s->gb, 8);
- }while(get_bits(&s->gb, 8) == 255);
-
- size=0;
- do{
- size+= show_bits(&s->gb, 8);
- }while(get_bits(&s->gb, 8) == 255);
-
- switch(type){
- case 5:
- if(decode_unregistered_user_data(h, size) < 0)
- return -1;
- break;
- default:
- skip_bits(&s->gb, 8*size);
- }
-
- //FIXME check bits here
- align_get_bits(&s->gb);
- }
-
- return 0;
-}
-
-static inline void decode_hrd_parameters(H264Context *h, SPS *sps){
- MpegEncContext * const s = &h->s;
- int cpb_count, i;
- cpb_count = get_ue_golomb(&s->gb) + 1;
- get_bits(&s->gb, 4); /* bit_rate_scale */
- get_bits(&s->gb, 4); /* cpb_size_scale */
- for(i=0; i<cpb_count; i++){
- get_ue_golomb(&s->gb); /* bit_rate_value_minus1 */
- get_ue_golomb(&s->gb); /* cpb_size_value_minus1 */
- get_bits1(&s->gb); /* cbr_flag */
- }
- get_bits(&s->gb, 5); /* initial_cpb_removal_delay_length_minus1 */
- get_bits(&s->gb, 5); /* cpb_removal_delay_length_minus1 */
- get_bits(&s->gb, 5); /* dpb_output_delay_length_minus1 */
- get_bits(&s->gb, 5); /* time_offset_length */
-}
-
-static inline int decode_vui_parameters(H264Context *h, SPS *sps){
- MpegEncContext * const s = &h->s;
- int aspect_ratio_info_present_flag;
- unsigned int aspect_ratio_idc;
- int nal_hrd_parameters_present_flag, vcl_hrd_parameters_present_flag;
-
- aspect_ratio_info_present_flag= get_bits1(&s->gb);
-
- if( aspect_ratio_info_present_flag ) {
- aspect_ratio_idc= get_bits(&s->gb, 8);
- if( aspect_ratio_idc == EXTENDED_SAR ) {
- sps->sar.num= get_bits(&s->gb, 16);
- sps->sar.den= get_bits(&s->gb, 16);
- }else if(aspect_ratio_idc < 14){
- sps->sar= pixel_aspect[aspect_ratio_idc];
- }else{
- av_log(h->s.avctx, AV_LOG_ERROR, "illegal aspect ratio\n");
- return -1;
- }
- }else{
- sps->sar.num=
- sps->sar.den= 0;
- }
-// s->avctx->aspect_ratio= sar_width*s->width / (float)(s->height*sar_height);
-
- if(get_bits1(&s->gb)){ /* overscan_info_present_flag */
- get_bits1(&s->gb); /* overscan_appropriate_flag */
- }
-
- if(get_bits1(&s->gb)){ /* video_signal_type_present_flag */
- get_bits(&s->gb, 3); /* video_format */
- get_bits1(&s->gb); /* video_full_range_flag */
- if(get_bits1(&s->gb)){ /* colour_description_present_flag */
- get_bits(&s->gb, 8); /* colour_primaries */
- get_bits(&s->gb, 8); /* transfer_characteristics */
- get_bits(&s->gb, 8); /* matrix_coefficients */
- }
- }
-
- if(get_bits1(&s->gb)){ /* chroma_location_info_present_flag */
- get_ue_golomb(&s->gb); /* chroma_sample_location_type_top_field */
- get_ue_golomb(&s->gb); /* chroma_sample_location_type_bottom_field */
- }
-
- sps->timing_info_present_flag = get_bits1(&s->gb);
- if(sps->timing_info_present_flag){
- sps->num_units_in_tick = get_bits_long(&s->gb, 32);
- sps->time_scale = get_bits_long(&s->gb, 32);
- sps->fixed_frame_rate_flag = get_bits1(&s->gb);
- }
-
- nal_hrd_parameters_present_flag = get_bits1(&s->gb);
- if(nal_hrd_parameters_present_flag)
- decode_hrd_parameters(h, sps);
- vcl_hrd_parameters_present_flag = get_bits1(&s->gb);
- if(vcl_hrd_parameters_present_flag)
- decode_hrd_parameters(h, sps);
- if(nal_hrd_parameters_present_flag || vcl_hrd_parameters_present_flag)
- get_bits1(&s->gb); /* low_delay_hrd_flag */
- get_bits1(&s->gb); /* pic_struct_present_flag */
-
- sps->bitstream_restriction_flag = get_bits1(&s->gb);
- if(sps->bitstream_restriction_flag){
- unsigned int num_reorder_frames;
- get_bits1(&s->gb); /* motion_vectors_over_pic_boundaries_flag */
- get_ue_golomb(&s->gb); /* max_bytes_per_pic_denom */
- get_ue_golomb(&s->gb); /* max_bits_per_mb_denom */
- get_ue_golomb(&s->gb); /* log2_max_mv_length_horizontal */
- get_ue_golomb(&s->gb); /* log2_max_mv_length_vertical */
- num_reorder_frames= get_ue_golomb(&s->gb);
- get_ue_golomb(&s->gb); /*max_dec_frame_buffering*/
-
- if(num_reorder_frames > 16 /*max_dec_frame_buffering || max_dec_frame_buffering > 16*/){
- av_log(h->s.avctx, AV_LOG_ERROR, "illegal num_reorder_frames %d\n", num_reorder_frames);
- return -1;
- }
-
- sps->num_reorder_frames= num_reorder_frames;
- }
-
- return 0;
-}
-
-static void decode_scaling_list(H264Context *h, uint8_t *factors, int size,
- const uint8_t *jvt_list, const uint8_t *fallback_list){
- MpegEncContext * const s = &h->s;
- int i, last = 8, next = 8;
- const uint8_t *scan = size == 16 ? zigzag_scan : zigzag_scan8x8;
- if(!get_bits1(&s->gb)) /* matrix not written, we use the predicted one */
- memcpy(factors, fallback_list, size*sizeof(uint8_t));
- else
- for(i=0;i<size;i++){
- if(next)
- next = (last + get_se_golomb(&s->gb)) & 0xff;
- if(!i && !next){ /* matrix not written, we use the preset one */
- memcpy(factors, jvt_list, size*sizeof(uint8_t));
- break;
- }
- last = factors[scan[i]] = next ? next : last;
- }
-}
-
-static void decode_scaling_matrices(H264Context *h, SPS *sps, PPS *pps, int is_sps,
- uint8_t (*scaling_matrix4)[16], uint8_t (*scaling_matrix8)[64]){
- MpegEncContext * const s = &h->s;
- int fallback_sps = !is_sps && sps->scaling_matrix_present;
- const uint8_t *fallback[4] = {
- fallback_sps ? sps->scaling_matrix4[0] : default_scaling4[0],
- fallback_sps ? sps->scaling_matrix4[3] : default_scaling4[1],
- fallback_sps ? sps->scaling_matrix8[0] : default_scaling8[0],
- fallback_sps ? sps->scaling_matrix8[1] : default_scaling8[1]
- };
- if(get_bits1(&s->gb)){
- sps->scaling_matrix_present |= is_sps;
- decode_scaling_list(h,scaling_matrix4[0],16,default_scaling4[0],fallback[0]); // Intra, Y
- decode_scaling_list(h,scaling_matrix4[1],16,default_scaling4[0],scaling_matrix4[0]); // Intra, Cr
- decode_scaling_list(h,scaling_matrix4[2],16,default_scaling4[0],scaling_matrix4[1]); // Intra, Cb
- decode_scaling_list(h,scaling_matrix4[3],16,default_scaling4[1],fallback[1]); // Inter, Y
- decode_scaling_list(h,scaling_matrix4[4],16,default_scaling4[1],scaling_matrix4[3]); // Inter, Cr
- decode_scaling_list(h,scaling_matrix4[5],16,default_scaling4[1],scaling_matrix4[4]); // Inter, Cb
- if(is_sps || pps->transform_8x8_mode){
- decode_scaling_list(h,scaling_matrix8[0],64,default_scaling8[0],fallback[2]); // Intra, Y
- decode_scaling_list(h,scaling_matrix8[1],64,default_scaling8[1],fallback[3]); // Inter, Y
- }
- } else if(fallback_sps) {
- memcpy(scaling_matrix4, sps->scaling_matrix4, 6*16*sizeof(uint8_t));
- memcpy(scaling_matrix8, sps->scaling_matrix8, 2*64*sizeof(uint8_t));
- }
-}
-
-static inline int decode_seq_parameter_set(H264Context *h){
- MpegEncContext * const s = &h->s;
- int profile_idc, level_idc;
- unsigned int sps_id, tmp, mb_width, mb_height;
- int i;
- SPS *sps;
-
- profile_idc= get_bits(&s->gb, 8);
- get_bits1(&s->gb); //constraint_set0_flag
- get_bits1(&s->gb); //constraint_set1_flag
- get_bits1(&s->gb); //constraint_set2_flag
- get_bits1(&s->gb); //constraint_set3_flag
- get_bits(&s->gb, 4); // reserved
- level_idc= get_bits(&s->gb, 8);
- sps_id= get_ue_golomb(&s->gb);
-
- if (sps_id >= MAX_SPS_COUNT){
- // ok it has gone out of hand, someone is sending us bad stuff.
- av_log(h->s.avctx, AV_LOG_ERROR, "illegal sps_id (%d)\n", sps_id);
- return -1;
- }
-
- sps= &h->sps_buffer[ sps_id ];
- sps->profile_idc= profile_idc;
- sps->level_idc= level_idc;
-
- if(sps->profile_idc >= 100){ //high profile
- if(get_ue_golomb(&s->gb) == 3) //chroma_format_idc
- get_bits1(&s->gb); //residual_color_transform_flag
- get_ue_golomb(&s->gb); //bit_depth_luma_minus8
- get_ue_golomb(&s->gb); //bit_depth_chroma_minus8
- sps->transform_bypass = get_bits1(&s->gb);
- decode_scaling_matrices(h, sps, NULL, 1, sps->scaling_matrix4, sps->scaling_matrix8);
- }else
- sps->scaling_matrix_present = 0;
-
- sps->log2_max_frame_num= get_ue_golomb(&s->gb) + 4;
- sps->poc_type= get_ue_golomb(&s->gb);
-
- if(sps->poc_type == 0){ //FIXME #define
- sps->log2_max_poc_lsb= get_ue_golomb(&s->gb) + 4;
- } else if(sps->poc_type == 1){//FIXME #define
- sps->delta_pic_order_always_zero_flag= get_bits1(&s->gb);
- sps->offset_for_non_ref_pic= get_se_golomb(&s->gb);
- sps->offset_for_top_to_bottom_field= get_se_golomb(&s->gb);
- tmp= get_ue_golomb(&s->gb);
-
- if(tmp >= sizeof(sps->offset_for_ref_frame) / sizeof(sps->offset_for_ref_frame[0])){
- av_log(h->s.avctx, AV_LOG_ERROR, "poc_cycle_length overflow %u\n", tmp);
- return -1;
- }
- sps->poc_cycle_length= tmp;
-
- for(i=0; i<sps->poc_cycle_length; i++)
- sps->offset_for_ref_frame[i]= get_se_golomb(&s->gb);
- }else if(sps->poc_type != 2){
- av_log(h->s.avctx, AV_LOG_ERROR, "illegal POC type %d\n", sps->poc_type);
- return -1;
- }
-
- tmp= get_ue_golomb(&s->gb);
- if(tmp > MAX_PICTURE_COUNT-2){
- av_log(h->s.avctx, AV_LOG_ERROR, "too many reference frames\n");
- }
- sps->ref_frame_count= tmp;
- sps->gaps_in_frame_num_allowed_flag= get_bits1(&s->gb);
- mb_width= get_ue_golomb(&s->gb) + 1;
- mb_height= get_ue_golomb(&s->gb) + 1;
- if(mb_width >= INT_MAX/16 || mb_height >= INT_MAX/16 ||
- avcodec_check_dimensions(NULL, 16*mb_width, 16*mb_height)){
- av_log(h->s.avctx, AV_LOG_ERROR, "mb_width/height overflow\n");
- return -1;
- }
- sps->mb_width = mb_width;
- sps->mb_height= mb_height;
-
- sps->frame_mbs_only_flag= get_bits1(&s->gb);
- if(!sps->frame_mbs_only_flag)
- sps->mb_aff= get_bits1(&s->gb);
- else
- sps->mb_aff= 0;
-
- sps->direct_8x8_inference_flag= get_bits1(&s->gb);
-
-#ifndef ALLOW_INTERLACE
- if(sps->mb_aff)
- av_log(h->s.avctx, AV_LOG_ERROR, "MBAFF support not included; enable it at compile-time.\n");
-#endif
- if(!sps->direct_8x8_inference_flag && sps->mb_aff)
- av_log(h->s.avctx, AV_LOG_ERROR, "MBAFF + !direct_8x8_inference is not implemented\n");
-
- sps->crop= get_bits1(&s->gb);
- if(sps->crop){
- sps->crop_left = get_ue_golomb(&s->gb);
- sps->crop_right = get_ue_golomb(&s->gb);
- sps->crop_top = get_ue_golomb(&s->gb);
- sps->crop_bottom= get_ue_golomb(&s->gb);
- if(sps->crop_left || sps->crop_top){
- av_log(h->s.avctx, AV_LOG_ERROR, "insane cropping not completely supported, this could look slightly wrong ...\n");
- }
- }else{
- sps->crop_left =
- sps->crop_right =
- sps->crop_top =
- sps->crop_bottom= 0;
- }
-
- sps->vui_parameters_present_flag= get_bits1(&s->gb);
- if( sps->vui_parameters_present_flag )
- decode_vui_parameters(h, sps);
-
- if(s->avctx->debug&FF_DEBUG_PICT_INFO){
- av_log(h->s.avctx, AV_LOG_DEBUG, "sps:%u profile:%d/%d poc:%d ref:%d %dx%d %s %s crop:%d/%d/%d/%d %s\n",
- sps_id, sps->profile_idc, sps->level_idc,
- sps->poc_type,
- sps->ref_frame_count,
- sps->mb_width, sps->mb_height,
- sps->frame_mbs_only_flag ? "FRM" : (sps->mb_aff ? "MB-AFF" : "PIC-AFF"),
- sps->direct_8x8_inference_flag ? "8B8" : "",
- sps->crop_left, sps->crop_right,
- sps->crop_top, sps->crop_bottom,
- sps->vui_parameters_present_flag ? "VUI" : ""
- );
- }
- return 0;
-}
-
-static inline int decode_picture_parameter_set(H264Context *h, int bit_length){
- MpegEncContext * const s = &h->s;
- unsigned int tmp, pps_id= get_ue_golomb(&s->gb);
- PPS *pps;
-
- if(pps_id>=MAX_PPS_COUNT){
- av_log(h->s.avctx, AV_LOG_ERROR, "pps_id out of range\n");
- return -1;
- }
- pps = &h->pps_buffer[pps_id];
-
- tmp= get_ue_golomb(&s->gb);
- if(tmp>=MAX_SPS_COUNT){
- av_log(h->s.avctx, AV_LOG_ERROR, "sps_id out of range\n");
- return -1;
- }
- pps->sps_id= tmp;
-
- pps->cabac= get_bits1(&s->gb);
- pps->pic_order_present= get_bits1(&s->gb);
- pps->slice_group_count= get_ue_golomb(&s->gb) + 1;
- if(pps->slice_group_count > 1 ){
- pps->mb_slice_group_map_type= get_ue_golomb(&s->gb);
- av_log(h->s.avctx, AV_LOG_ERROR, "FMO not supported\n");
- switch(pps->mb_slice_group_map_type){
- case 0:
-#if 0
-| for( i = 0; i <= num_slice_groups_minus1; i++ ) | | |
-| run_length[ i ] |1 |ue(v) |
-#endif
- break;
- case 2:
-#if 0
-| for( i = 0; i < num_slice_groups_minus1; i++ ) | | |
-|{ | | |
-| top_left_mb[ i ] |1 |ue(v) |
-| bottom_right_mb[ i ] |1 |ue(v) |
-| } | | |
-#endif
- break;
- case 3:
- case 4:
- case 5:
-#if 0
-| slice_group_change_direction_flag |1 |u(1) |
-| slice_group_change_rate_minus1 |1 |ue(v) |
-#endif
- break;
- case 6:
-#if 0
-| slice_group_id_cnt_minus1 |1 |ue(v) |
-| for( i = 0; i <= slice_group_id_cnt_minus1; i++ | | |
-|) | | |
-| slice_group_id[ i ] |1 |u(v) |
-#endif
- break;
- }
- }
- pps->ref_count[0]= get_ue_golomb(&s->gb) + 1;
- pps->ref_count[1]= get_ue_golomb(&s->gb) + 1;
- if(pps->ref_count[0] > 32 || pps->ref_count[1] > 32){
- av_log(h->s.avctx, AV_LOG_ERROR, "reference overflow (pps)\n");
- pps->ref_count[0]= pps->ref_count[1]= 1;
- return -1;
- }
-
- pps->weighted_pred= get_bits1(&s->gb);
- pps->weighted_bipred_idc= get_bits(&s->gb, 2);
- pps->init_qp= get_se_golomb(&s->gb) + 26;
- pps->init_qs= get_se_golomb(&s->gb) + 26;
- pps->chroma_qp_index_offset= get_se_golomb(&s->gb);
- pps->deblocking_filter_parameters_present= get_bits1(&s->gb);
- pps->constrained_intra_pred= get_bits1(&s->gb);
- pps->redundant_pic_cnt_present = get_bits1(&s->gb);
-
- pps->transform_8x8_mode= 0;
- h->dequant_coeff_pps= -1; //contents of sps/pps can change even if id doesn't, so reinit
- memset(pps->scaling_matrix4, 16, 6*16*sizeof(uint8_t));
- memset(pps->scaling_matrix8, 16, 2*64*sizeof(uint8_t));
-
- if(get_bits_count(&s->gb) < bit_length){
- pps->transform_8x8_mode= get_bits1(&s->gb);
- decode_scaling_matrices(h, &h->sps_buffer[pps->sps_id], pps, 0, pps->scaling_matrix4, pps->scaling_matrix8);
- get_se_golomb(&s->gb); //second_chroma_qp_index_offset
- }
-
- if(s->avctx->debug&FF_DEBUG_PICT_INFO){
- av_log(h->s.avctx, AV_LOG_DEBUG, "pps:%u sps:%u %s slice_groups:%d ref:%d/%d %s qp:%d/%d/%d %s %s %s %s\n",
- pps_id, pps->sps_id,
- pps->cabac ? "CABAC" : "CAVLC",
- pps->slice_group_count,
- pps->ref_count[0], pps->ref_count[1],
- pps->weighted_pred ? "weighted" : "",
- pps->init_qp, pps->init_qs, pps->chroma_qp_index_offset,
- pps->deblocking_filter_parameters_present ? "LPAR" : "",
- pps->constrained_intra_pred ? "CONSTR" : "",
- pps->redundant_pic_cnt_present ? "REDU" : "",
- pps->transform_8x8_mode ? "8x8DCT" : ""
- );
- }
-
- return 0;
-}
-
-/**
- * finds the end of the current frame in the bitstream.
- * @return the position of the first byte of the next frame, or -1
- */
-static int find_frame_end(H264Context *h, const uint8_t *buf, int buf_size){
- int i;
- uint32_t state;
- ParseContext *pc = &(h->s.parse_context);
-//printf("first %02X%02X%02X%02X\n", buf[0], buf[1],buf[2],buf[3]);
-// mb_addr= pc->mb_addr - 1;
- state= pc->state;
- for(i=0; i<=buf_size; i++){
- if((state&0xFFFFFF1F) == 0x101 || (state&0xFFFFFF1F) == 0x102 || (state&0xFFFFFF1F) == 0x105){
- tprintf("find_frame_end new startcode = %08x, frame_start_found = %d, pos = %d\n", state, pc->frame_start_found, i);
- if(pc->frame_start_found){
- // If there isn't one more byte in the buffer
- // the test on first_mb_in_slice cannot be done yet
- // do it at next call.
- if (i >= buf_size) break;
- if (buf[i] & 0x80) {
- // first_mb_in_slice is 0, probably the first nal of a new
- // slice
- tprintf("find_frame_end frame_end_found, state = %08x, pos = %d\n", state, i);
- pc->state=-1;
- pc->frame_start_found= 0;
- return i-4;
- }
- }
- pc->frame_start_found = 1;
- }
- if((state&0xFFFFFF1F) == 0x107 || (state&0xFFFFFF1F) == 0x108 || (state&0xFFFFFF1F) == 0x109){
- if(pc->frame_start_found){
- pc->state=-1;
- pc->frame_start_found= 0;
- return i-4;
- }
- }
- if (i<buf_size)
- state= (state<<8) | buf[i];
- }
-
- pc->state= state;
- return END_NOT_FOUND;
-}
-
-#ifdef CONFIG_H264_PARSER
-static int h264_parse(AVCodecParserContext *s,
- AVCodecContext *avctx,
- uint8_t **poutbuf, int *poutbuf_size,
- const uint8_t *buf, int buf_size)
-{
- H264Context *h = s->priv_data;
- ParseContext *pc = &h->s.parse_context;
- int next;
-
- next= find_frame_end(h, buf, buf_size);
-
- if (ff_combine_frame(pc, next, (uint8_t **)&buf, &buf_size) < 0) {
- *poutbuf = NULL;
- *poutbuf_size = 0;
- return buf_size;
- }
-
- *poutbuf = (uint8_t *)buf;
- *poutbuf_size = buf_size;
- return next;
-}
-
-static int h264_split(AVCodecContext *avctx,
- const uint8_t *buf, int buf_size)
-{
- int i;
- uint32_t state = -1;
- int has_sps= 0;
-
- for(i=0; i<=buf_size; i++){
- if((state&0xFFFFFF1F) == 0x107)
- has_sps=1;
-/* if((state&0xFFFFFF1F) == 0x101 || (state&0xFFFFFF1F) == 0x102 || (state&0xFFFFFF1F) == 0x105){
- }*/
- if((state&0xFFFFFF00) == 0x100 && (state&0xFFFFFF1F) != 0x107 && (state&0xFFFFFF1F) != 0x108 && (state&0xFFFFFF1F) != 0x109){
- if(has_sps){
- while(i>4 && buf[i-5]==0) i--;
- return i-4;
- }
- }
- if (i<buf_size)
- state= (state<<8) | buf[i];
- }
- return 0;
-}
-#endif /* CONFIG_H264_PARSER */
-
-static int decode_nal_units(H264Context *h, uint8_t *buf, int buf_size){
- MpegEncContext * const s = &h->s;
- AVCodecContext * const avctx= s->avctx;
- int buf_index=0;
-#if 0
- int i;
- for(i=0; i<50; i++){
- av_log(NULL, AV_LOG_ERROR,"%02X ", buf[i]);
- }
-#endif
- h->slice_num = 0;
- s->current_picture_ptr= NULL;
- for(;;){
- int consumed;
- int dst_length;
- int bit_length;
- uint8_t *ptr;
- int i, nalsize = 0;
-
- if(h->is_avc) {
- if(buf_index >= buf_size) break;
- nalsize = 0;
- for(i = 0; i < h->nal_length_size; i++)
- nalsize = (nalsize << 8) | buf[buf_index++];
- if(nalsize <= 1 || nalsize > buf_size){
- if(nalsize == 1){
- buf_index++;
- continue;
- }else{
- av_log(h->s.avctx, AV_LOG_ERROR, "AVC: nal size %d\n", nalsize);
- break;
- }
- }
- } else {
- // start code prefix search
- for(; buf_index + 3 < buf_size; buf_index++){
- // this should allways succeed in the first iteration
- if(buf[buf_index] == 0 && buf[buf_index+1] == 0 && buf[buf_index+2] == 1)
- break;
- }
-
- if(buf_index+3 >= buf_size) break;
-
- buf_index+=3;
- }
-
- ptr= decode_nal(h, buf + buf_index, &dst_length, &consumed, h->is_avc ? nalsize : buf_size - buf_index);
- if (ptr==NULL || dst_length <= 0){
- return -1;
- }
- while(ptr[dst_length - 1] == 0 && dst_length > 1)
- dst_length--;
- bit_length= 8*dst_length - decode_rbsp_trailing(ptr + dst_length - 1);
-
- if(s->avctx->debug&FF_DEBUG_STARTCODE){
- av_log(h->s.avctx, AV_LOG_DEBUG, "NAL %d at %d/%d length %d\n", h->nal_unit_type, buf_index, buf_size, dst_length);
- }
-
- if (h->is_avc && (nalsize != consumed))
- av_log(h->s.avctx, AV_LOG_ERROR, "AVC: Consumed only %d bytes instead of %d\n", consumed, nalsize);
-
- buf_index += consumed;
-
- if( (s->hurry_up == 1 && h->nal_ref_idc == 0) //FIXME dont discard SEI id
- ||(avctx->skip_frame >= AVDISCARD_NONREF && h->nal_ref_idc == 0))
- continue;
-
- switch(h->nal_unit_type){
- case NAL_IDR_SLICE:
- idr(h); //FIXME ensure we don't loose some frames if there is reordering
- case NAL_SLICE:
- init_get_bits(&s->gb, ptr, bit_length);
- h->intra_gb_ptr=
- h->inter_gb_ptr= &s->gb;
- s->data_partitioning = 0;
-
- if(decode_slice_header(h) < 0){
- av_log(h->s.avctx, AV_LOG_ERROR, "decode_slice_header error\n");
- break;
- }
- s->current_picture_ptr->key_frame= (h->nal_unit_type == NAL_IDR_SLICE);
- if(h->redundant_pic_count==0 && s->hurry_up < 5
- && (avctx->skip_frame < AVDISCARD_NONREF || h->nal_ref_idc)
- && (avctx->skip_frame < AVDISCARD_BIDIR || h->slice_type!=B_TYPE)
- && (avctx->skip_frame < AVDISCARD_NONKEY || h->slice_type==I_TYPE)
- && avctx->skip_frame < AVDISCARD_ALL)
- decode_slice(h);
- break;
- case NAL_DPA:
- init_get_bits(&s->gb, ptr, bit_length);
- h->intra_gb_ptr=
- h->inter_gb_ptr= NULL;
- s->data_partitioning = 1;
-
- if(decode_slice_header(h) < 0){
- av_log(h->s.avctx, AV_LOG_ERROR, "decode_slice_header error\n");
- }
- break;
- case NAL_DPB:
- init_get_bits(&h->intra_gb, ptr, bit_length);
- h->intra_gb_ptr= &h->intra_gb;
- break;
- case NAL_DPC:
- init_get_bits(&h->inter_gb, ptr, bit_length);
- h->inter_gb_ptr= &h->inter_gb;
-
- if(h->redundant_pic_count==0 && h->intra_gb_ptr && s->data_partitioning
- && s->context_initialized
- && s->hurry_up < 5
- && (avctx->skip_frame < AVDISCARD_NONREF || h->nal_ref_idc)
- && (avctx->skip_frame < AVDISCARD_BIDIR || h->slice_type!=B_TYPE)
- && (avctx->skip_frame < AVDISCARD_NONKEY || h->slice_type==I_TYPE)
- && avctx->skip_frame < AVDISCARD_ALL)
- decode_slice(h);
- break;
- case NAL_SEI:
- init_get_bits(&s->gb, ptr, bit_length);
- decode_sei(h);
- break;
- case NAL_SPS:
- init_get_bits(&s->gb, ptr, bit_length);
- decode_seq_parameter_set(h);
-
- if(s->flags& CODEC_FLAG_LOW_DELAY)
- s->low_delay=1;
-
- if(avctx->has_b_frames < 2)
- avctx->has_b_frames= !s->low_delay;
- break;
- case NAL_PPS:
- init_get_bits(&s->gb, ptr, bit_length);
-
- decode_picture_parameter_set(h, bit_length);
-
- break;
- case NAL_AUD:
- case NAL_END_SEQUENCE:
- case NAL_END_STREAM:
- case NAL_FILLER_DATA:
- case NAL_SPS_EXT:
- case NAL_AUXILIARY_SLICE:
- break;
- default:
- av_log(avctx, AV_LOG_ERROR, "Unknown NAL code: %d\n", h->nal_unit_type);
- }
- }
-
- if(!s->current_picture_ptr) return buf_index; //no frame
-
- s->current_picture_ptr->qscale_type= FF_QSCALE_TYPE_H264;
- s->current_picture_ptr->pict_type= s->pict_type;
-
- h->prev_frame_num_offset= h->frame_num_offset;
- h->prev_frame_num= h->frame_num;
- if(s->current_picture_ptr->reference){
- h->prev_poc_msb= h->poc_msb;
- h->prev_poc_lsb= h->poc_lsb;
- }
- if(s->current_picture_ptr->reference)
- execute_ref_pic_marking(h, h->mmco, h->mmco_index);
-
- ff_er_frame_end(s);
-
- MPV_frame_end(s);
-
- return buf_index;
-}
-
-/**
- * returns the number of bytes consumed for building the current frame
- */
-static int get_consumed_bytes(MpegEncContext *s, int pos, int buf_size){
- if(s->flags&CODEC_FLAG_TRUNCATED){
- pos -= s->parse_context.last_index;
- if(pos<0) pos=0; // FIXME remove (unneeded?)
-
- return pos;
- }else{
- if(pos==0) pos=1; //avoid infinite loops (i doubt thats needed but ...)
- if(pos+10>buf_size) pos=buf_size; // oops ;)
-
- return pos;
- }
-}
-
-static int decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- H264Context *h = avctx->priv_data;
- MpegEncContext *s = &h->s;
- AVFrame *pict = data;
- int buf_index;
-
- s->flags= avctx->flags;
- s->flags2= avctx->flags2;
-
- /* no supplementary picture */
- if (buf_size == 0) {
- return 0;
- }
-
- if(s->flags&CODEC_FLAG_TRUNCATED){
- int next= find_frame_end(h, buf, buf_size);
-
- if( ff_combine_frame(&s->parse_context, next, &buf, &buf_size) < 0 )
- return buf_size;
-//printf("next:%d buf_size:%d last_index:%d\n", next, buf_size, s->parse_context.last_index);
- }
-
- if(h->is_avc && !h->got_avcC) {
- int i, cnt, nalsize;
- unsigned char *p = avctx->extradata;
- if(avctx->extradata_size < 7) {
- av_log(avctx, AV_LOG_ERROR, "avcC too short\n");
- return -1;
- }
- if(*p != 1) {
- av_log(avctx, AV_LOG_ERROR, "Unknown avcC version %d\n", *p);
- return -1;
- }
- /* sps and pps in the avcC always have length coded with 2 bytes,
- so put a fake nal_length_size = 2 while parsing them */
- h->nal_length_size = 2;
- // Decode sps from avcC
- cnt = *(p+5) & 0x1f; // Number of sps
- p += 6;
- for (i = 0; i < cnt; i++) {
- nalsize = AV_RB16(p) + 2;
- if(decode_nal_units(h, p, nalsize) < 0) {
- av_log(avctx, AV_LOG_ERROR, "Decoding sps %d from avcC failed\n", i);
- return -1;
- }
- p += nalsize;
- }
- // Decode pps from avcC
- cnt = *(p++); // Number of pps
- for (i = 0; i < cnt; i++) {
- nalsize = AV_RB16(p) + 2;
- if(decode_nal_units(h, p, nalsize) != nalsize) {
- av_log(avctx, AV_LOG_ERROR, "Decoding pps %d from avcC failed\n", i);
- return -1;
- }
- p += nalsize;
- }
- // Now store right nal length size, that will be use to parse all other nals
- h->nal_length_size = ((*(((char*)(avctx->extradata))+4))&0x03)+1;
- // Do not reparse avcC
- h->got_avcC = 1;
- }
-
- if(!h->is_avc && s->avctx->extradata_size && s->picture_number==0){
- if(decode_nal_units(h, s->avctx->extradata, s->avctx->extradata_size) < 0)
- return -1;
- }
-
- buf_index=decode_nal_units(h, buf, buf_size);
- if(buf_index < 0)
- return -1;
-
- //FIXME do something with unavailable reference frames
-
-// if(ret==FRAME_SKIPPED) return get_consumed_bytes(s, buf_index, buf_size);
- if(!s->current_picture_ptr){
- av_log(h->s.avctx, AV_LOG_DEBUG, "error, NO frame\n");
- return -1;
- }
-
- {
- Picture *out = s->current_picture_ptr;
-#if 0 //decode order
- *data_size = sizeof(AVFrame);
-#else
- /* Sort B-frames into display order */
- Picture *cur = s->current_picture_ptr;
- Picture *prev = h->delayed_output_pic;
- int i, pics, cross_idr, out_of_order, out_idx;
-
- if(h->sps.bitstream_restriction_flag
- && s->avctx->has_b_frames < h->sps.num_reorder_frames){
- s->avctx->has_b_frames = h->sps.num_reorder_frames;
- s->low_delay = 0;
- }
-
- pics = 0;
- while(h->delayed_pic[pics]) pics++;
-
- assert(pics+1 < sizeof(h->delayed_pic) / sizeof(h->delayed_pic[0]));
-
- h->delayed_pic[pics++] = cur;
- if(cur->reference == 0)
- cur->reference = 1;
-
- cross_idr = 0;
- for(i=0; h->delayed_pic[i]; i++)
- if(h->delayed_pic[i]->key_frame || h->delayed_pic[i]->poc==0)
- cross_idr = 1;
-
- out = h->delayed_pic[0];
- out_idx = 0;
- for(i=1; h->delayed_pic[i] && !h->delayed_pic[i]->key_frame; i++)
- if(h->delayed_pic[i]->poc < out->poc){
- out = h->delayed_pic[i];
- out_idx = i;
- }
-
- out_of_order = !cross_idr && prev && out->poc < prev->poc;
- if(h->sps.bitstream_restriction_flag && s->avctx->has_b_frames >= h->sps.num_reorder_frames)
- { }
- else if(prev && pics <= s->avctx->has_b_frames)
- out = prev;
- else if((out_of_order && pics-1 == s->avctx->has_b_frames && pics < 15)
- || (s->low_delay &&
- ((!cross_idr && prev && out->poc > prev->poc + 2)
- || cur->pict_type == B_TYPE)))
- {
- s->low_delay = 0;
- s->avctx->has_b_frames++;
- out = prev;
- }
- else if(out_of_order)
- out = prev;
-
- if(out_of_order || pics > s->avctx->has_b_frames){
- for(i=out_idx; h->delayed_pic[i]; i++)
- h->delayed_pic[i] = h->delayed_pic[i+1];
- }
-
- if(prev == out)
- *data_size = 0;
- else
- *data_size = sizeof(AVFrame);
- if(prev && prev != out && prev->reference == 1)
- prev->reference = 0;
- h->delayed_output_pic = out;
-#endif
-
- if(out)
- *pict= *(AVFrame*)out;
- else
- av_log(avctx, AV_LOG_DEBUG, "no picture\n");
- }
-
- assert(pict->data[0] || !*data_size);
- ff_print_debug_info(s, pict);
-//printf("out %d\n", (int)pict->data[0]);
-#if 0 //?
-
- /* Return the Picture timestamp as the frame number */
- /* we substract 1 because it is added on utils.c */
- avctx->frame_number = s->picture_number - 1;
-#endif
- return get_consumed_bytes(s, buf_index, buf_size);
-}
-#if 0
-static inline void fill_mb_avail(H264Context *h){
- MpegEncContext * const s = &h->s;
- const int mb_xy= s->mb_x + s->mb_y*s->mb_stride;
-
- if(s->mb_y){
- h->mb_avail[0]= s->mb_x && h->slice_table[mb_xy - s->mb_stride - 1] == h->slice_num;
- h->mb_avail[1]= h->slice_table[mb_xy - s->mb_stride ] == h->slice_num;
- h->mb_avail[2]= s->mb_x+1 < s->mb_width && h->slice_table[mb_xy - s->mb_stride + 1] == h->slice_num;
- }else{
- h->mb_avail[0]=
- h->mb_avail[1]=
- h->mb_avail[2]= 0;
- }
- h->mb_avail[3]= s->mb_x && h->slice_table[mb_xy - 1] == h->slice_num;
- h->mb_avail[4]= 1; //FIXME move out
- h->mb_avail[5]= 0; //FIXME move out
-}
-#endif
-
-#if 0 //selftest
-#define COUNT 8000
-#define SIZE (COUNT*40)
-int main(){
- int i;
- uint8_t temp[SIZE];
- PutBitContext pb;
- GetBitContext gb;
-// int int_temp[10000];
- DSPContext dsp;
- AVCodecContext avctx;
-
- dsputil_init(&dsp, &avctx);
-
- init_put_bits(&pb, temp, SIZE);
- printf("testing unsigned exp golomb\n");
- for(i=0; i<COUNT; i++){
- START_TIMER
- set_ue_golomb(&pb, i);
- STOP_TIMER("set_ue_golomb");
- }
- flush_put_bits(&pb);
-
- init_get_bits(&gb, temp, 8*SIZE);
- for(i=0; i<COUNT; i++){
- int j, s;
-
- s= show_bits(&gb, 24);
-
- START_TIMER
- j= get_ue_golomb(&gb);
- if(j != i){
- printf("missmatch! at %d (%d should be %d) bits:%6X\n", i, j, i, s);
-// return -1;
- }
- STOP_TIMER("get_ue_golomb");
- }
-
-
- init_put_bits(&pb, temp, SIZE);
- printf("testing signed exp golomb\n");
- for(i=0; i<COUNT; i++){
- START_TIMER
- set_se_golomb(&pb, i - COUNT/2);
- STOP_TIMER("set_se_golomb");
- }
- flush_put_bits(&pb);
-
- init_get_bits(&gb, temp, 8*SIZE);
- for(i=0; i<COUNT; i++){
- int j, s;
-
- s= show_bits(&gb, 24);
-
- START_TIMER
- j= get_se_golomb(&gb);
- if(j != i - COUNT/2){
- printf("missmatch! at %d (%d should be %d) bits:%6X\n", i, j, i, s);
-// return -1;
- }
- STOP_TIMER("get_se_golomb");
- }
-
- printf("testing 4x4 (I)DCT\n");
-
- DCTELEM block[16];
- uint8_t src[16], ref[16];
- uint64_t error= 0, max_error=0;
-
- for(i=0; i<COUNT; i++){
- int j;
-// printf("%d %d %d\n", r1, r2, (r2-r1)*16);
- for(j=0; j<16; j++){
- ref[j]= random()%255;
- src[j]= random()%255;
- }
-
- h264_diff_dct_c(block, src, ref, 4);
-
- //normalize
- for(j=0; j<16; j++){
-// printf("%d ", block[j]);
- block[j]= block[j]*4;
- if(j&1) block[j]= (block[j]*4 + 2)/5;
- if(j&4) block[j]= (block[j]*4 + 2)/5;
- }
-// printf("\n");
-
- s->dsp.h264_idct_add(ref, block, 4);
-/* for(j=0; j<16; j++){
- printf("%d ", ref[j]);
- }
- printf("\n");*/
-
- for(j=0; j<16; j++){
- int diff= FFABS(src[j] - ref[j]);
-
- error+= diff*diff;
- max_error= FFMAX(max_error, diff);
- }
- }
- printf("error=%f max_error=%d\n", ((float)error)/COUNT/16, (int)max_error );
-#if 0
- printf("testing quantizer\n");
- for(qp=0; qp<52; qp++){
- for(i=0; i<16; i++)
- src1_block[i]= src2_block[i]= random()%255;
-
- }
-#endif
- printf("Testing NAL layer\n");
-
- uint8_t bitstream[COUNT];
- uint8_t nal[COUNT*2];
- H264Context h;
- memset(&h, 0, sizeof(H264Context));
-
- for(i=0; i<COUNT; i++){
- int zeros= i;
- int nal_length;
- int consumed;
- int out_length;
- uint8_t *out;
- int j;
-
- for(j=0; j<COUNT; j++){
- bitstream[j]= (random() % 255) + 1;
- }
-
- for(j=0; j<zeros; j++){
- int pos= random() % COUNT;
- while(bitstream[pos] == 0){
- pos++;
- pos %= COUNT;
- }
- bitstream[pos]=0;
- }
-
- START_TIMER
-
- nal_length= encode_nal(&h, nal, bitstream, COUNT, COUNT*2);
- if(nal_length<0){
- printf("encoding failed\n");
- return -1;
- }
-
- out= decode_nal(&h, nal, &out_length, &consumed, nal_length);
-
- STOP_TIMER("NAL")
-
- if(out_length != COUNT){
- printf("incorrect length %d %d\n", out_length, COUNT);
- return -1;
- }
-
- if(consumed != nal_length){
- printf("incorrect consumed length %d %d\n", nal_length, consumed);
- return -1;
- }
-
- if(memcmp(bitstream, out, COUNT)){
- printf("missmatch\n");
- return -1;
- }
- }
-
- printf("Testing RBSP\n");
-
-
- return 0;
-}
-#endif
-
-
-static int decode_end(AVCodecContext *avctx)
-{
- H264Context *h = avctx->priv_data;
- MpegEncContext *s = &h->s;
-
- av_freep(&h->rbsp_buffer);
- free_tables(h); //FIXME cleanup init stuff perhaps
- MPV_common_end(s);
-
-// memset(h, 0, sizeof(H264Context));
-
- return 0;
-}
-
-
-AVCodec h264_decoder = {
- "h264",
- CODEC_TYPE_VIDEO,
- CODEC_ID_H264,
- sizeof(H264Context),
- decode_init,
- NULL,
- decode_end,
- decode_frame,
- /*CODEC_CAP_DRAW_HORIZ_BAND |*/ CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY,
- .flush= flush_dpb,
-};
-
-#ifdef CONFIG_H264_PARSER
-AVCodecParser h264_parser = {
- { CODEC_ID_H264 },
- sizeof(H264Context),
- NULL,
- h264_parse,
- ff_parse_close,
- h264_split,
-};
-#endif
-
-#include "svq3.c"
diff --git a/src/libffmpeg/libavcodec/h264data.h b/src/libffmpeg/libavcodec/h264data.h
deleted file mode 100644
index 74e720421..000000000
--- a/src/libffmpeg/libavcodec/h264data.h
+++ /dev/null
@@ -1,1323 +0,0 @@
-/*
- * H26L/H264/AVC/JVT/14496-10/... encoder/decoder
- * Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file h264data.h
- * @brief
- * H264 / AVC / MPEG4 part10 codec data table
- * @author Michael Niedermayer <michaelni@gmx.at>
- */
-
-#define VERT_PRED 0
-#define HOR_PRED 1
-#define DC_PRED 2
-#define DIAG_DOWN_LEFT_PRED 3
-#define DIAG_DOWN_RIGHT_PRED 4
-#define VERT_RIGHT_PRED 5
-#define HOR_DOWN_PRED 6
-#define VERT_LEFT_PRED 7
-#define HOR_UP_PRED 8
-
-#define LEFT_DC_PRED 9
-#define TOP_DC_PRED 10
-#define DC_128_PRED 11
-
-
-#define DC_PRED8x8 0
-#define HOR_PRED8x8 1
-#define VERT_PRED8x8 2
-#define PLANE_PRED8x8 3
-
-#define LEFT_DC_PRED8x8 4
-#define TOP_DC_PRED8x8 5
-#define DC_128_PRED8x8 6
-
-#define EXTENDED_SAR 255
-
-/* NAL unit types */
-enum {
-NAL_SLICE=1,
-NAL_DPA,
-NAL_DPB,
-NAL_DPC,
-NAL_IDR_SLICE,
-NAL_SEI,
-NAL_SPS,
-NAL_PPS,
-NAL_AUD,
-NAL_END_SEQUENCE,
-NAL_END_STREAM,
-NAL_FILLER_DATA,
-NAL_SPS_EXT,
-NAL_AUXILIARY_SLICE=19
-};
-
-static const AVRational pixel_aspect[14]={
- {0, 1},
- {1, 1},
- {12, 11},
- {10, 11},
- {16, 11},
- {40, 33},
- {24, 11},
- {20, 11},
- {32, 11},
- {80, 33},
- {18, 11},
- {15, 11},
- {64, 33},
- {160,99},
-};
-
-static const uint8_t golomb_to_pict_type[5]=
-{P_TYPE, B_TYPE, I_TYPE, SP_TYPE, SI_TYPE};
-
-static const uint8_t pict_type_to_golomb[7]=
-{-1, 2, 0, 1, -1, 4, 3};
-
-static const uint8_t chroma_qp[52]={
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,
- 12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,
- 28,29,29,30,31,32,32,33,34,34,35,35,36,36,37,37,
- 37,38,38,38,39,39,39,39
-
-};
-
-static const uint8_t golomb_to_intra4x4_cbp[48]={
- 47, 31, 15, 0, 23, 27, 29, 30, 7, 11, 13, 14, 39, 43, 45, 46,
- 16, 3, 5, 10, 12, 19, 21, 26, 28, 35, 37, 42, 44, 1, 2, 4,
- 8, 17, 18, 20, 24, 6, 9, 22, 25, 32, 33, 34, 36, 40, 38, 41
-};
-
-static const uint8_t golomb_to_inter_cbp[48]={
- 0, 16, 1, 2, 4, 8, 32, 3, 5, 10, 12, 15, 47, 7, 11, 13,
- 14, 6, 9, 31, 35, 37, 42, 44, 33, 34, 36, 40, 39, 43, 45, 46,
- 17, 18, 20, 24, 19, 21, 26, 28, 23, 27, 29, 30, 22, 25, 38, 41
-};
-
-static const uint8_t intra4x4_cbp_to_golomb[48]={
- 3, 29, 30, 17, 31, 18, 37, 8, 32, 38, 19, 9, 20, 10, 11, 2,
- 16, 33, 34, 21, 35, 22, 39, 4, 36, 40, 23, 5, 24, 6, 7, 1,
- 41, 42, 43, 25, 44, 26, 46, 12, 45, 47, 27, 13, 28, 14, 15, 0
-};
-
-static const uint8_t inter_cbp_to_golomb[48]={
- 0, 2, 3, 7, 4, 8, 17, 13, 5, 18, 9, 14, 10, 15, 16, 11,
- 1, 32, 33, 36, 34, 37, 44, 40, 35, 45, 38, 41, 39, 42, 43, 19,
- 6, 24, 25, 20, 26, 21, 46, 28, 27, 47, 22, 29, 23, 30, 31, 12
-};
-
-static const uint8_t chroma_dc_coeff_token_len[4*5]={
- 2, 0, 0, 0,
- 6, 1, 0, 0,
- 6, 6, 3, 0,
- 6, 7, 7, 6,
- 6, 8, 8, 7,
-};
-
-static const uint8_t chroma_dc_coeff_token_bits[4*5]={
- 1, 0, 0, 0,
- 7, 1, 0, 0,
- 4, 6, 1, 0,
- 3, 3, 2, 5,
- 2, 3, 2, 0,
-};
-
-static const uint8_t coeff_token_len[4][4*17]={
-{
- 1, 0, 0, 0,
- 6, 2, 0, 0, 8, 6, 3, 0, 9, 8, 7, 5, 10, 9, 8, 6,
- 11,10, 9, 7, 13,11,10, 8, 13,13,11, 9, 13,13,13,10,
- 14,14,13,11, 14,14,14,13, 15,15,14,14, 15,15,15,14,
- 16,15,15,15, 16,16,16,15, 16,16,16,16, 16,16,16,16,
-},
-{
- 2, 0, 0, 0,
- 6, 2, 0, 0, 6, 5, 3, 0, 7, 6, 6, 4, 8, 6, 6, 4,
- 8, 7, 7, 5, 9, 8, 8, 6, 11, 9, 9, 6, 11,11,11, 7,
- 12,11,11, 9, 12,12,12,11, 12,12,12,11, 13,13,13,12,
- 13,13,13,13, 13,14,13,13, 14,14,14,13, 14,14,14,14,
-},
-{
- 4, 0, 0, 0,
- 6, 4, 0, 0, 6, 5, 4, 0, 6, 5, 5, 4, 7, 5, 5, 4,
- 7, 5, 5, 4, 7, 6, 6, 4, 7, 6, 6, 4, 8, 7, 7, 5,
- 8, 8, 7, 6, 9, 8, 8, 7, 9, 9, 8, 8, 9, 9, 9, 8,
- 10, 9, 9, 9, 10,10,10,10, 10,10,10,10, 10,10,10,10,
-},
-{
- 6, 0, 0, 0,
- 6, 6, 0, 0, 6, 6, 6, 0, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
-}
-};
-
-static const uint8_t coeff_token_bits[4][4*17]={
-{
- 1, 0, 0, 0,
- 5, 1, 0, 0, 7, 4, 1, 0, 7, 6, 5, 3, 7, 6, 5, 3,
- 7, 6, 5, 4, 15, 6, 5, 4, 11,14, 5, 4, 8,10,13, 4,
- 15,14, 9, 4, 11,10,13,12, 15,14, 9,12, 11,10,13, 8,
- 15, 1, 9,12, 11,14,13, 8, 7,10, 9,12, 4, 6, 5, 8,
-},
-{
- 3, 0, 0, 0,
- 11, 2, 0, 0, 7, 7, 3, 0, 7,10, 9, 5, 7, 6, 5, 4,
- 4, 6, 5, 6, 7, 6, 5, 8, 15, 6, 5, 4, 11,14,13, 4,
- 15,10, 9, 4, 11,14,13,12, 8,10, 9, 8, 15,14,13,12,
- 11,10, 9,12, 7,11, 6, 8, 9, 8,10, 1, 7, 6, 5, 4,
-},
-{
- 15, 0, 0, 0,
- 15,14, 0, 0, 11,15,13, 0, 8,12,14,12, 15,10,11,11,
- 11, 8, 9,10, 9,14,13, 9, 8,10, 9, 8, 15,14,13,13,
- 11,14,10,12, 15,10,13,12, 11,14, 9,12, 8,10,13, 8,
- 13, 7, 9,12, 9,12,11,10, 5, 8, 7, 6, 1, 4, 3, 2,
-},
-{
- 3, 0, 0, 0,
- 0, 1, 0, 0, 4, 5, 6, 0, 8, 9,10,11, 12,13,14,15,
- 16,17,18,19, 20,21,22,23, 24,25,26,27, 28,29,30,31,
- 32,33,34,35, 36,37,38,39, 40,41,42,43, 44,45,46,47,
- 48,49,50,51, 52,53,54,55, 56,57,58,59, 60,61,62,63,
-}
-};
-
-static const uint8_t total_zeros_len[16][16]= {
- {1,3,3,4,4,5,5,6,6,7,7,8,8,9,9,9},
- {3,3,3,3,3,4,4,4,4,5,5,6,6,6,6},
- {4,3,3,3,4,4,3,3,4,5,5,6,5,6},
- {5,3,4,4,3,3,3,4,3,4,5,5,5},
- {4,4,4,3,3,3,3,3,4,5,4,5},
- {6,5,3,3,3,3,3,3,4,3,6},
- {6,5,3,3,3,2,3,4,3,6},
- {6,4,5,3,2,2,3,3,6},
- {6,6,4,2,2,3,2,5},
- {5,5,3,2,2,2,4},
- {4,4,3,3,1,3},
- {4,4,2,1,3},
- {3,3,1,2},
- {2,2,1},
- {1,1},
-};
-
-static const uint8_t total_zeros_bits[16][16]= {
- {1,3,2,3,2,3,2,3,2,3,2,3,2,3,2,1},
- {7,6,5,4,3,5,4,3,2,3,2,3,2,1,0},
- {5,7,6,5,4,3,4,3,2,3,2,1,1,0},
- {3,7,5,4,6,5,4,3,3,2,2,1,0},
- {5,4,3,7,6,5,4,3,2,1,1,0},
- {1,1,7,6,5,4,3,2,1,1,0},
- {1,1,5,4,3,3,2,1,1,0},
- {1,1,1,3,3,2,2,1,0},
- {1,0,1,3,2,1,1,1},
- {1,0,1,3,2,1,1},
- {0,1,1,2,1,3},
- {0,1,1,1,1},
- {0,1,1,1},
- {0,1,1},
- {0,1},
-};
-
-static const uint8_t chroma_dc_total_zeros_len[3][4]= {
- { 1, 2, 3, 3,},
- { 1, 2, 2, 0,},
- { 1, 1, 0, 0,},
-};
-
-static const uint8_t chroma_dc_total_zeros_bits[3][4]= {
- { 1, 1, 1, 0,},
- { 1, 1, 0, 0,},
- { 1, 0, 0, 0,},
-};
-
-static const uint8_t run_len[7][16]={
- {1,1},
- {1,2,2},
- {2,2,2,2},
- {2,2,2,3,3},
- {2,2,3,3,3,3},
- {2,3,3,3,3,3,3},
- {3,3,3,3,3,3,3,4,5,6,7,8,9,10,11},
-};
-
-static const uint8_t run_bits[7][16]={
- {1,0},
- {1,1,0},
- {3,2,1,0},
- {3,2,1,1,0},
- {3,2,3,2,1,0},
- {3,0,1,3,2,5,4},
- {7,6,5,4,3,2,1,1,1,1,1,1,1,1,1},
-};
-
-/*
-o-o o-o
- / / /
-o-o o-o
- ,---'
-o-o o-o
- / / /
-o-o o-o
-*/
-
-static const uint8_t scan8[16 + 2*4]={
- 4+1*8, 5+1*8, 4+2*8, 5+2*8,
- 6+1*8, 7+1*8, 6+2*8, 7+2*8,
- 4+3*8, 5+3*8, 4+4*8, 5+4*8,
- 6+3*8, 7+3*8, 6+4*8, 7+4*8,
- 1+1*8, 2+1*8,
- 1+2*8, 2+2*8,
- 1+4*8, 2+4*8,
- 1+5*8, 2+5*8,
-};
-
-static const uint8_t zigzag_scan[16]={
- 0+0*4, 1+0*4, 0+1*4, 0+2*4,
- 1+1*4, 2+0*4, 3+0*4, 2+1*4,
- 1+2*4, 0+3*4, 1+3*4, 2+2*4,
- 3+1*4, 3+2*4, 2+3*4, 3+3*4,
-};
-
-static const uint8_t field_scan[16]={
- 0+0*4, 0+1*4, 1+0*4, 0+2*4,
- 0+3*4, 1+1*4, 1+2*4, 1+3*4,
- 2+0*4, 2+1*4, 2+2*4, 2+3*4,
- 3+0*4, 3+1*4, 3+2*4, 3+3*4,
-};
-
-static const uint8_t luma_dc_zigzag_scan[16]={
- 0*16 + 0*64, 1*16 + 0*64, 2*16 + 0*64, 0*16 + 2*64,
- 3*16 + 0*64, 0*16 + 1*64, 1*16 + 1*64, 2*16 + 1*64,
- 1*16 + 2*64, 2*16 + 2*64, 3*16 + 2*64, 0*16 + 3*64,
- 3*16 + 1*64, 1*16 + 3*64, 2*16 + 3*64, 3*16 + 3*64,
-};
-
-static const uint8_t luma_dc_field_scan[16]={
- 0*16 + 0*64, 2*16 + 0*64, 1*16 + 0*64, 0*16 + 2*64,
- 2*16 + 2*64, 3*16 + 0*64, 1*16 + 2*64, 3*16 + 2*64,
- 0*16 + 1*64, 2*16 + 1*64, 0*16 + 3*64, 2*16 + 3*64,
- 1*16 + 1*64, 3*16 + 1*64, 1*16 + 3*64, 3*16 + 3*64,
-};
-
-static const uint8_t chroma_dc_scan[4]={
- (0+0*2)*16, (1+0*2)*16,
- (0+1*2)*16, (1+1*2)*16, //FIXME
-};
-
-static const uint8_t zigzag_scan8x8[64]={
- 0+0*8, 1+0*8, 0+1*8, 0+2*8,
- 1+1*8, 2+0*8, 3+0*8, 2+1*8,
- 1+2*8, 0+3*8, 0+4*8, 1+3*8,
- 2+2*8, 3+1*8, 4+0*8, 5+0*8,
- 4+1*8, 3+2*8, 2+3*8, 1+4*8,
- 0+5*8, 0+6*8, 1+5*8, 2+4*8,
- 3+3*8, 4+2*8, 5+1*8, 6+0*8,
- 7+0*8, 6+1*8, 5+2*8, 4+3*8,
- 3+4*8, 2+5*8, 1+6*8, 0+7*8,
- 1+7*8, 2+6*8, 3+5*8, 4+4*8,
- 5+3*8, 6+2*8, 7+1*8, 7+2*8,
- 6+3*8, 5+4*8, 4+5*8, 3+6*8,
- 2+7*8, 3+7*8, 4+6*8, 5+5*8,
- 6+4*8, 7+3*8, 7+4*8, 6+5*8,
- 5+6*8, 4+7*8, 5+7*8, 6+6*8,
- 7+5*8, 7+6*8, 6+7*8, 7+7*8,
-};
-
-// zigzag_scan8x8_cavlc[i] = zigzag_scan8x8[(i/4) + 16*(i%4)]
-static const uint8_t zigzag_scan8x8_cavlc[64]={
- 0+0*8, 1+1*8, 1+2*8, 2+2*8,
- 4+1*8, 0+5*8, 3+3*8, 7+0*8,
- 3+4*8, 1+7*8, 5+3*8, 6+3*8,
- 2+7*8, 6+4*8, 5+6*8, 7+5*8,
- 1+0*8, 2+0*8, 0+3*8, 3+1*8,
- 3+2*8, 0+6*8, 4+2*8, 6+1*8,
- 2+5*8, 2+6*8, 6+2*8, 5+4*8,
- 3+7*8, 7+3*8, 4+7*8, 7+6*8,
- 0+1*8, 3+0*8, 0+4*8, 4+0*8,
- 2+3*8, 1+5*8, 5+1*8, 5+2*8,
- 1+6*8, 3+5*8, 7+1*8, 4+5*8,
- 4+6*8, 7+4*8, 5+7*8, 6+7*8,
- 0+2*8, 2+1*8, 1+3*8, 5+0*8,
- 1+4*8, 2+4*8, 6+0*8, 4+3*8,
- 0+7*8, 4+4*8, 7+2*8, 3+6*8,
- 5+5*8, 6+5*8, 6+6*8, 7+7*8,
-};
-
-static const uint8_t field_scan8x8[64]={
- 0+0*8, 0+1*8, 0+2*8, 1+0*8,
- 1+1*8, 0+3*8, 0+4*8, 1+2*8,
- 2+0*8, 1+3*8, 0+5*8, 0+6*8,
- 0+7*8, 1+4*8, 2+1*8, 3+0*8,
- 2+2*8, 1+5*8, 1+6*8, 1+7*8,
- 2+3*8, 3+1*8, 4+0*8, 3+2*8,
- 2+4*8, 2+5*8, 2+6*8, 2+7*8,
- 3+3*8, 4+1*8, 5+0*8, 4+2*8,
- 3+4*8, 3+5*8, 3+6*8, 3+7*8,
- 4+3*8, 5+1*8, 6+0*8, 5+2*8,
- 4+4*8, 4+5*8, 4+6*8, 4+7*8,
- 5+3*8, 6+1*8, 6+2*8, 5+4*8,
- 5+5*8, 5+6*8, 5+7*8, 6+3*8,
- 7+0*8, 7+1*8, 6+4*8, 6+5*8,
- 6+6*8, 6+7*8, 7+2*8, 7+3*8,
- 7+4*8, 7+5*8, 7+6*8, 7+7*8,
-};
-
-static const uint8_t field_scan8x8_cavlc[64]={
- 0+0*8, 1+1*8, 2+0*8, 0+7*8,
- 2+2*8, 2+3*8, 2+4*8, 3+3*8,
- 3+4*8, 4+3*8, 4+4*8, 5+3*8,
- 5+5*8, 7+0*8, 6+6*8, 7+4*8,
- 0+1*8, 0+3*8, 1+3*8, 1+4*8,
- 1+5*8, 3+1*8, 2+5*8, 4+1*8,
- 3+5*8, 5+1*8, 4+5*8, 6+1*8,
- 5+6*8, 7+1*8, 6+7*8, 7+5*8,
- 0+2*8, 0+4*8, 0+5*8, 2+1*8,
- 1+6*8, 4+0*8, 2+6*8, 5+0*8,
- 3+6*8, 6+0*8, 4+6*8, 6+2*8,
- 5+7*8, 6+4*8, 7+2*8, 7+6*8,
- 1+0*8, 1+2*8, 0+6*8, 3+0*8,
- 1+7*8, 3+2*8, 2+7*8, 4+2*8,
- 3+7*8, 5+2*8, 4+7*8, 5+4*8,
- 6+3*8, 6+5*8, 7+3*8, 7+7*8,
-};
-
-#define MB_TYPE_REF0 MB_TYPE_ACPRED //dirty but it fits in 16bit
-#define MB_TYPE_8x8DCT 0x01000000
-#define IS_REF0(a) ((a)&MB_TYPE_REF0)
-#define IS_8x8DCT(a) ((a)&MB_TYPE_8x8DCT)
-
-
-typedef struct IMbInfo{
- uint16_t type;
- uint8_t pred_mode;
- uint8_t cbp;
-} IMbInfo;
-
-static const IMbInfo i_mb_type_info[26]={
-{MB_TYPE_INTRA4x4 , -1, -1},
-{MB_TYPE_INTRA16x16, 2, 0},
-{MB_TYPE_INTRA16x16, 1, 0},
-{MB_TYPE_INTRA16x16, 0, 0},
-{MB_TYPE_INTRA16x16, 3, 0},
-{MB_TYPE_INTRA16x16, 2, 16},
-{MB_TYPE_INTRA16x16, 1, 16},
-{MB_TYPE_INTRA16x16, 0, 16},
-{MB_TYPE_INTRA16x16, 3, 16},
-{MB_TYPE_INTRA16x16, 2, 32},
-{MB_TYPE_INTRA16x16, 1, 32},
-{MB_TYPE_INTRA16x16, 0, 32},
-{MB_TYPE_INTRA16x16, 3, 32},
-{MB_TYPE_INTRA16x16, 2, 15+0},
-{MB_TYPE_INTRA16x16, 1, 15+0},
-{MB_TYPE_INTRA16x16, 0, 15+0},
-{MB_TYPE_INTRA16x16, 3, 15+0},
-{MB_TYPE_INTRA16x16, 2, 15+16},
-{MB_TYPE_INTRA16x16, 1, 15+16},
-{MB_TYPE_INTRA16x16, 0, 15+16},
-{MB_TYPE_INTRA16x16, 3, 15+16},
-{MB_TYPE_INTRA16x16, 2, 15+32},
-{MB_TYPE_INTRA16x16, 1, 15+32},
-{MB_TYPE_INTRA16x16, 0, 15+32},
-{MB_TYPE_INTRA16x16, 3, 15+32},
-{MB_TYPE_INTRA_PCM , -1, -1},
-};
-
-typedef struct PMbInfo{
- uint16_t type;
- uint8_t partition_count;
-} PMbInfo;
-
-static const PMbInfo p_mb_type_info[5]={
-{MB_TYPE_16x16|MB_TYPE_P0L0 , 1},
-{MB_TYPE_16x8 |MB_TYPE_P0L0|MB_TYPE_P1L0, 2},
-{MB_TYPE_8x16 |MB_TYPE_P0L0|MB_TYPE_P1L0, 2},
-{MB_TYPE_8x8 |MB_TYPE_P0L0|MB_TYPE_P1L0, 4},
-{MB_TYPE_8x8 |MB_TYPE_P0L0|MB_TYPE_P1L0|MB_TYPE_REF0, 4},
-};
-
-static const PMbInfo p_sub_mb_type_info[4]={
-{MB_TYPE_16x16|MB_TYPE_P0L0 , 1},
-{MB_TYPE_16x8 |MB_TYPE_P0L0 , 2},
-{MB_TYPE_8x16 |MB_TYPE_P0L0 , 2},
-{MB_TYPE_8x8 |MB_TYPE_P0L0 , 4},
-};
-
-static const PMbInfo b_mb_type_info[23]={
-{MB_TYPE_DIRECT2 , 1, },
-{MB_TYPE_16x16|MB_TYPE_P0L0 , 1, },
-{MB_TYPE_16x16 |MB_TYPE_P0L1 , 1, },
-{MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P0L1 , 1, },
-{MB_TYPE_16x8 |MB_TYPE_P0L0 |MB_TYPE_P1L0 , 2, },
-{MB_TYPE_8x16 |MB_TYPE_P0L0 |MB_TYPE_P1L0 , 2, },
-{MB_TYPE_16x8 |MB_TYPE_P0L1 |MB_TYPE_P1L1, 2, },
-{MB_TYPE_8x16 |MB_TYPE_P0L1 |MB_TYPE_P1L1, 2, },
-{MB_TYPE_16x8 |MB_TYPE_P0L0 |MB_TYPE_P1L1, 2, },
-{MB_TYPE_8x16 |MB_TYPE_P0L0 |MB_TYPE_P1L1, 2, },
-{MB_TYPE_16x8 |MB_TYPE_P0L1|MB_TYPE_P1L0 , 2, },
-{MB_TYPE_8x16 |MB_TYPE_P0L1|MB_TYPE_P1L0 , 2, },
-{MB_TYPE_16x8 |MB_TYPE_P0L0 |MB_TYPE_P1L0|MB_TYPE_P1L1, 2, },
-{MB_TYPE_8x16 |MB_TYPE_P0L0 |MB_TYPE_P1L0|MB_TYPE_P1L1, 2, },
-{MB_TYPE_16x8 |MB_TYPE_P0L1|MB_TYPE_P1L0|MB_TYPE_P1L1, 2, },
-{MB_TYPE_8x16 |MB_TYPE_P0L1|MB_TYPE_P1L0|MB_TYPE_P1L1, 2, },
-{MB_TYPE_16x8 |MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_P1L0 , 2, },
-{MB_TYPE_8x16 |MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_P1L0 , 2, },
-{MB_TYPE_16x8 |MB_TYPE_P0L0|MB_TYPE_P0L1 |MB_TYPE_P1L1, 2, },
-{MB_TYPE_8x16 |MB_TYPE_P0L0|MB_TYPE_P0L1 |MB_TYPE_P1L1, 2, },
-{MB_TYPE_16x8 |MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_P1L0|MB_TYPE_P1L1, 2, },
-{MB_TYPE_8x16 |MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_P1L0|MB_TYPE_P1L1, 2, },
-{MB_TYPE_8x8 |MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_P1L0|MB_TYPE_P1L1, 4, },
-};
-
-static const PMbInfo b_sub_mb_type_info[13]={
-{MB_TYPE_DIRECT2 , 1, },
-{MB_TYPE_16x16|MB_TYPE_P0L0 , 1, },
-{MB_TYPE_16x16 |MB_TYPE_P0L1 , 1, },
-{MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P0L1 , 1, },
-{MB_TYPE_16x8 |MB_TYPE_P0L0 |MB_TYPE_P1L0 , 2, },
-{MB_TYPE_8x16 |MB_TYPE_P0L0 |MB_TYPE_P1L0 , 2, },
-{MB_TYPE_16x8 |MB_TYPE_P0L1 |MB_TYPE_P1L1, 2, },
-{MB_TYPE_8x16 |MB_TYPE_P0L1 |MB_TYPE_P1L1, 2, },
-{MB_TYPE_16x8 |MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_P1L0|MB_TYPE_P1L1, 2, },
-{MB_TYPE_8x16 |MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_P1L0|MB_TYPE_P1L1, 2, },
-{MB_TYPE_8x8 |MB_TYPE_P0L0 |MB_TYPE_P1L0 , 4, },
-{MB_TYPE_8x8 |MB_TYPE_P0L1 |MB_TYPE_P1L1, 4, },
-{MB_TYPE_8x8 |MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_P1L0|MB_TYPE_P1L1, 4, },
-};
-
-static const uint8_t default_scaling4[2][16]={
-{ 6,13,20,28,
- 13,20,28,32,
- 20,28,32,37,
- 28,32,37,42
-},{
- 10,14,20,24,
- 14,20,24,27,
- 20,24,27,30,
- 24,27,30,34
-}};
-
-static const uint8_t default_scaling8[2][64]={
-{ 6,10,13,16,18,23,25,27,
- 10,11,16,18,23,25,27,29,
- 13,16,18,23,25,27,29,31,
- 16,18,23,25,27,29,31,33,
- 18,23,25,27,29,31,33,36,
- 23,25,27,29,31,33,36,38,
- 25,27,29,31,33,36,38,40,
- 27,29,31,33,36,38,40,42
-},{
- 9,13,15,17,19,21,22,24,
- 13,13,17,19,21,22,24,25,
- 15,17,19,21,22,24,25,27,
- 17,19,21,22,24,25,27,28,
- 19,21,22,24,25,27,28,30,
- 21,22,24,25,27,28,30,32,
- 22,24,25,27,28,30,32,33,
- 24,25,27,28,30,32,33,35
-}};
-
-static const int dequant4_coeff_init[6][3]={
- {10,13,16},
- {11,14,18},
- {13,16,20},
- {14,18,23},
- {16,20,25},
- {18,23,29},
-};
-
-static const int dequant8_coeff_init_scan[16] = {
- 0,3,4,3, 3,1,5,1, 4,5,2,5, 3,1,5,1
-};
-static const int dequant8_coeff_init[6][6]={
- {20,18,32,19,25,24},
- {22,19,35,21,28,26},
- {26,23,42,24,33,31},
- {28,25,45,26,35,33},
- {32,28,51,30,40,38},
- {36,32,58,34,46,43},
-};
-
-#define QUANT_SHIFT 22
-
-static const int quant_coeff[52][16]={
- { 419430,258111,419430,258111,258111,167772,258111,167772,419430,258111,419430,258111,258111,167772,258111,167772,},
- { 381300,239675,381300,239675,239675,149131,239675,149131,381300,239675,381300,239675,239675,149131,239675,149131,},
- { 322639,209715,322639,209715,209715,134218,209715,134218,322639,209715,322639,209715,209715,134218,209715,134218,},
- { 299593,186414,299593,186414,186414,116711,186414,116711,299593,186414,299593,186414,186414,116711,186414,116711,},
- { 262144,167772,262144,167772,167772,107374,167772,107374,262144,167772,262144,167772,167772,107374,167772,107374,},
- { 233017,145889,233017,145889,145889, 92564,145889, 92564,233017,145889,233017,145889,145889, 92564,145889, 92564,},
- { 209715,129056,209715,129056,129056, 83886,129056, 83886,209715,129056,209715,129056,129056, 83886,129056, 83886,},
- { 190650,119837,190650,119837,119837, 74565,119837, 74565,190650,119837,190650,119837,119837, 74565,119837, 74565,},
- { 161319,104858,161319,104858,104858, 67109,104858, 67109,161319,104858,161319,104858,104858, 67109,104858, 67109,},
- { 149797, 93207,149797, 93207, 93207, 58356, 93207, 58356,149797, 93207,149797, 93207, 93207, 58356, 93207, 58356,},
- { 131072, 83886,131072, 83886, 83886, 53687, 83886, 53687,131072, 83886,131072, 83886, 83886, 53687, 83886, 53687,},
- { 116508, 72944,116508, 72944, 72944, 46282, 72944, 46282,116508, 72944,116508, 72944, 72944, 46282, 72944, 46282,},
- { 104858, 64528,104858, 64528, 64528, 41943, 64528, 41943,104858, 64528,104858, 64528, 64528, 41943, 64528, 41943,},
- { 95325, 59919, 95325, 59919, 59919, 37283, 59919, 37283, 95325, 59919, 95325, 59919, 59919, 37283, 59919, 37283,},
- { 80660, 52429, 80660, 52429, 52429, 33554, 52429, 33554, 80660, 52429, 80660, 52429, 52429, 33554, 52429, 33554,},
- { 74898, 46603, 74898, 46603, 46603, 29178, 46603, 29178, 74898, 46603, 74898, 46603, 46603, 29178, 46603, 29178,},
- { 65536, 41943, 65536, 41943, 41943, 26844, 41943, 26844, 65536, 41943, 65536, 41943, 41943, 26844, 41943, 26844,},
- { 58254, 36472, 58254, 36472, 36472, 23141, 36472, 23141, 58254, 36472, 58254, 36472, 36472, 23141, 36472, 23141,},
- { 52429, 32264, 52429, 32264, 32264, 20972, 32264, 20972, 52429, 32264, 52429, 32264, 32264, 20972, 32264, 20972,},
- { 47663, 29959, 47663, 29959, 29959, 18641, 29959, 18641, 47663, 29959, 47663, 29959, 29959, 18641, 29959, 18641,},
- { 40330, 26214, 40330, 26214, 26214, 16777, 26214, 16777, 40330, 26214, 40330, 26214, 26214, 16777, 26214, 16777,},
- { 37449, 23302, 37449, 23302, 23302, 14589, 23302, 14589, 37449, 23302, 37449, 23302, 23302, 14589, 23302, 14589,},
- { 32768, 20972, 32768, 20972, 20972, 13422, 20972, 13422, 32768, 20972, 32768, 20972, 20972, 13422, 20972, 13422,},
- { 29127, 18236, 29127, 18236, 18236, 11570, 18236, 11570, 29127, 18236, 29127, 18236, 18236, 11570, 18236, 11570,},
- { 26214, 16132, 26214, 16132, 16132, 10486, 16132, 10486, 26214, 16132, 26214, 16132, 16132, 10486, 16132, 10486,},
- { 23831, 14980, 23831, 14980, 14980, 9321, 14980, 9321, 23831, 14980, 23831, 14980, 14980, 9321, 14980, 9321,},
- { 20165, 13107, 20165, 13107, 13107, 8389, 13107, 8389, 20165, 13107, 20165, 13107, 13107, 8389, 13107, 8389,},
- { 18725, 11651, 18725, 11651, 11651, 7294, 11651, 7294, 18725, 11651, 18725, 11651, 11651, 7294, 11651, 7294,},
- { 16384, 10486, 16384, 10486, 10486, 6711, 10486, 6711, 16384, 10486, 16384, 10486, 10486, 6711, 10486, 6711,},
- { 14564, 9118, 14564, 9118, 9118, 5785, 9118, 5785, 14564, 9118, 14564, 9118, 9118, 5785, 9118, 5785,},
- { 13107, 8066, 13107, 8066, 8066, 5243, 8066, 5243, 13107, 8066, 13107, 8066, 8066, 5243, 8066, 5243,},
- { 11916, 7490, 11916, 7490, 7490, 4660, 7490, 4660, 11916, 7490, 11916, 7490, 7490, 4660, 7490, 4660,},
- { 10082, 6554, 10082, 6554, 6554, 4194, 6554, 4194, 10082, 6554, 10082, 6554, 6554, 4194, 6554, 4194,},
- { 9362, 5825, 9362, 5825, 5825, 3647, 5825, 3647, 9362, 5825, 9362, 5825, 5825, 3647, 5825, 3647,},
- { 8192, 5243, 8192, 5243, 5243, 3355, 5243, 3355, 8192, 5243, 8192, 5243, 5243, 3355, 5243, 3355,},
- { 7282, 4559, 7282, 4559, 4559, 2893, 4559, 2893, 7282, 4559, 7282, 4559, 4559, 2893, 4559, 2893,},
- { 6554, 4033, 6554, 4033, 4033, 2621, 4033, 2621, 6554, 4033, 6554, 4033, 4033, 2621, 4033, 2621,},
- { 5958, 3745, 5958, 3745, 3745, 2330, 3745, 2330, 5958, 3745, 5958, 3745, 3745, 2330, 3745, 2330,},
- { 5041, 3277, 5041, 3277, 3277, 2097, 3277, 2097, 5041, 3277, 5041, 3277, 3277, 2097, 3277, 2097,},
- { 4681, 2913, 4681, 2913, 2913, 1824, 2913, 1824, 4681, 2913, 4681, 2913, 2913, 1824, 2913, 1824,},
- { 4096, 2621, 4096, 2621, 2621, 1678, 2621, 1678, 4096, 2621, 4096, 2621, 2621, 1678, 2621, 1678,},
- { 3641, 2280, 3641, 2280, 2280, 1446, 2280, 1446, 3641, 2280, 3641, 2280, 2280, 1446, 2280, 1446,},
- { 3277, 2016, 3277, 2016, 2016, 1311, 2016, 1311, 3277, 2016, 3277, 2016, 2016, 1311, 2016, 1311,},
- { 2979, 1872, 2979, 1872, 1872, 1165, 1872, 1165, 2979, 1872, 2979, 1872, 1872, 1165, 1872, 1165,},
- { 2521, 1638, 2521, 1638, 1638, 1049, 1638, 1049, 2521, 1638, 2521, 1638, 1638, 1049, 1638, 1049,},
- { 2341, 1456, 2341, 1456, 1456, 912, 1456, 912, 2341, 1456, 2341, 1456, 1456, 912, 1456, 912,},
- { 2048, 1311, 2048, 1311, 1311, 839, 1311, 839, 2048, 1311, 2048, 1311, 1311, 839, 1311, 839,},
- { 1820, 1140, 1820, 1140, 1140, 723, 1140, 723, 1820, 1140, 1820, 1140, 1140, 723, 1140, 723,},
- { 1638, 1008, 1638, 1008, 1008, 655, 1008, 655, 1638, 1008, 1638, 1008, 1008, 655, 1008, 655,},
- { 1489, 936, 1489, 936, 936, 583, 936, 583, 1489, 936, 1489, 936, 936, 583, 936, 583,},
- { 1260, 819, 1260, 819, 819, 524, 819, 524, 1260, 819, 1260, 819, 819, 524, 819, 524,},
- { 1170, 728, 1170, 728, 728, 456, 728, 456, 1170, 728, 1170, 728, 728, 456, 728, 456,},
-};
-
-
-/* Deblocking filter (p153) */
-static const int alpha_table[52*3] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 4, 4, 5, 6,
- 7, 8, 9, 10, 12, 13, 15, 17, 20, 22,
- 25, 28, 32, 36, 40, 45, 50, 56, 63, 71,
- 80, 90,101,113,127,144,162,182,203,226,
- 255,255,
- 255,255,255,255,255,255,255,255,255,255,255,255,255,
- 255,255,255,255,255,255,255,255,255,255,255,255,255,
- 255,255,255,255,255,255,255,255,255,255,255,255,255,
- 255,255,255,255,255,255,255,255,255,255,255,255,255,
-};
-static const int beta_table[52*3] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 2, 2, 2, 3,
- 3, 3, 3, 4, 4, 4, 6, 6, 7, 7,
- 8, 8, 9, 9, 10, 10, 11, 11, 12, 12,
- 13, 13, 14, 14, 15, 15, 16, 16, 17, 17,
- 18, 18,
- 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
- 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
- 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
- 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
-};
-static const int tc0_table[52*3][3] = {
- { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 },
- { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 },
- { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 },
- { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 },
- { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 },
- { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 },
- { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 },
- { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 },
- { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 },
- { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 },
- { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 },
- { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 1 },
- { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 1, 1 }, { 0, 1, 1 }, { 1, 1, 1 },
- { 1, 1, 1 }, { 1, 1, 1 }, { 1, 1, 1 }, { 1, 1, 2 }, { 1, 1, 2 }, { 1, 1, 2 },
- { 1, 1, 2 }, { 1, 2, 3 }, { 1, 2, 3 }, { 2, 2, 3 }, { 2, 2, 4 }, { 2, 3, 4 },
- { 2, 3, 4 }, { 3, 3, 5 }, { 3, 4, 6 }, { 3, 4, 6 }, { 4, 5, 7 }, { 4, 5, 8 },
- { 4, 6, 9 }, { 5, 7,10 }, { 6, 8,11 }, { 6, 8,13 }, { 7,10,14 }, { 8,11,16 },
- { 9,12,18 }, {10,13,20 }, {11,15,23 }, {13,17,25 },
- {13,17,25 }, {13,17,25 }, {13,17,25 }, {13,17,25 }, {13,17,25 }, {13,17,25 },
- {13,17,25 }, {13,17,25 }, {13,17,25 }, {13,17,25 }, {13,17,25 }, {13,17,25 },
- {13,17,25 }, {13,17,25 }, {13,17,25 }, {13,17,25 }, {13,17,25 }, {13,17,25 },
- {13,17,25 }, {13,17,25 }, {13,17,25 }, {13,17,25 }, {13,17,25 }, {13,17,25 },
- {13,17,25 }, {13,17,25 }, {13,17,25 }, {13,17,25 }, {13,17,25 }, {13,17,25 },
- {13,17,25 }, {13,17,25 }, {13,17,25 }, {13,17,25 }, {13,17,25 }, {13,17,25 },
- {13,17,25 }, {13,17,25 }, {13,17,25 }, {13,17,25 }, {13,17,25 }, {13,17,25 },
- {13,17,25 }, {13,17,25 }, {13,17,25 }, {13,17,25 }, {13,17,25 }, {13,17,25 },
- {13,17,25 }, {13,17,25 }, {13,17,25 }, {13,17,25 },
-};
-
-/* Cabac pre state table */
-
-static const int cabac_context_init_I[460][2] =
-{
- /* 0 - 10 */
- { 20, -15 }, { 2, 54 }, { 3, 74 }, { 20, -15 },
- { 2, 54 }, { 3, 74 }, { -28,127 }, { -23, 104 },
- { -6, 53 }, { -1, 54 }, { 7, 51 },
-
- /* 11 - 23 unsused for I */
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
- { 0, 0 },
-
- /* 24- 39 */
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
-
- /* 40 - 53 */
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
- { 0, 0 }, { 0, 0 },
-
- /* 54 - 59 */
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
- { 0, 0 }, { 0, 0 },
-
- /* 60 - 69 */
- { 0, 41 }, { 0, 63 }, { 0, 63 }, { 0, 63 },
- { -9, 83 }, { 4, 86 }, { 0, 97 }, { -7, 72 },
- { 13, 41 }, { 3, 62 },
-
- /* 70 -> 87 */
- { 0, 11 }, { 1, 55 }, { 0, 69 }, { -17, 127 },
- { -13, 102 },{ 0, 82 }, { -7, 74 }, { -21, 107 },
- { -27, 127 },{ -31, 127 },{ -24, 127 }, { -18, 95 },
- { -27, 127 },{ -21, 114 },{ -30, 127 }, { -17, 123 },
- { -12, 115 },{ -16, 122 },
-
- /* 88 -> 104 */
- { -11, 115 },{ -12, 63 }, { -2, 68 }, { -15, 84 },
- { -13, 104 },{ -3, 70 }, { -8, 93 }, { -10, 90 },
- { -30, 127 },{ -1, 74 }, { -6, 97 }, { -7, 91 },
- { -20, 127 },{ -4, 56 }, { -5, 82 }, { -7, 76 },
- { -22, 125 },
-
- /* 105 -> 135 */
- { -7, 93 }, { -11, 87 }, { -3, 77 }, { -5, 71 },
- { -4, 63 }, { -4, 68 }, { -12, 84 }, { -7, 62 },
- { -7, 65 }, { 8, 61 }, { 5, 56 }, { -2, 66 },
- { 1, 64 }, { 0, 61 }, { -2, 78 }, { 1, 50 },
- { 7, 52 }, { 10, 35 }, { 0, 44 }, { 11, 38 },
- { 1, 45 }, { 0, 46 }, { 5, 44 }, { 31, 17 },
- { 1, 51 }, { 7, 50 }, { 28, 19 }, { 16, 33 },
- { 14, 62 }, { -13, 108 },{ -15, 100 },
-
- /* 136 -> 165 */
- { -13, 101 },{ -13, 91 }, { -12, 94 }, { -10, 88 },
- { -16, 84 }, { -10, 86 }, { -7, 83 }, { -13, 87 },
- { -19, 94 }, { 1, 70 }, { 0, 72 }, { -5, 74 },
- { 18, 59 }, { -8, 102 }, { -15, 100 }, { 0, 95 },
- { -4, 75 }, { 2, 72 }, { -11, 75 }, { -3, 71 },
- { 15, 46 }, { -13, 69 }, { 0, 62 }, { 0, 65 },
- { 21, 37 }, { -15, 72 }, { 9, 57 }, { 16, 54 },
- { 0, 62 }, { 12, 72 },
-
- /* 166 -> 196 */
- { 24, 0 }, { 15, 9 }, { 8, 25 }, { 13, 18 },
- { 15, 9 }, { 13, 19 }, { 10, 37 }, { 12, 18 },
- { 6, 29 }, { 20, 33 }, { 15, 30 }, { 4, 45 },
- { 1, 58 }, { 0, 62 }, { 7, 61 }, { 12, 38 },
- { 11, 45 }, { 15, 39 }, { 11, 42 }, { 13, 44 },
- { 16, 45 }, { 12, 41 }, { 10, 49 }, { 30, 34 },
- { 18, 42 }, { 10, 55 }, { 17, 51 }, { 17, 46 },
- { 0, 89 }, { 26, -19 }, { 22, -17 },
-
- /* 197 -> 226 */
- { 26, -17 }, { 30, -25 }, { 28, -20 }, { 33, -23 },
- { 37, -27 }, { 33, -23 }, { 40, -28 }, { 38, -17 },
- { 33, -11 }, { 40, -15 }, { 41, -6 }, { 38, 1 },
- { 41, 17 }, { 30, -6 }, { 27, 3 }, { 26, 22 },
- { 37, -16 }, { 35, -4 }, { 38, -8 }, { 38, -3 },
- { 37, 3 }, { 38, 5 }, { 42, 0 }, { 35, 16 },
- { 39, 22 }, { 14, 48 }, { 27, 37 }, { 21, 60 },
- { 12, 68 }, { 2, 97 },
-
- /* 227 -> 251 */
- { -3, 71 }, { -6, 42 }, { -5, 50 }, { -3, 54 },
- { -2, 62 }, { 0, 58 }, { 1, 63 }, { -2, 72 },
- { -1, 74 }, { -9, 91 }, { -5, 67 }, { -5, 27 },
- { -3, 39 }, { -2, 44 }, { 0, 46 }, { -16, 64 },
- { -8, 68 }, { -10, 78 }, { -6, 77 }, { -10, 86 },
- { -12, 92 }, { -15, 55 }, { -10, 60 }, { -6, 62 },
- { -4, 65 },
-
- /* 252 -> 275 */
- { -12, 73 }, { -8, 76 }, { -7, 80 }, { -9, 88 },
- { -17, 110 },{ -11, 97 }, { -20, 84 }, { -11, 79 },
- { -6, 73 }, { -4, 74 }, { -13, 86 }, { -13, 96 },
- { -11, 97 }, { -19, 117 },{ -8, 78 }, { -5, 33 },
- { -4, 48 }, { -2, 53 }, { -3, 62 }, { -13, 71 },
- { -10, 79 }, { -12, 86 }, { -13, 90 }, { -14, 97 },
-
- /* 276 a bit special (not used, bypass is used instead) */
- { 0, 0 },
-
- /* 277 -> 307 */
- { -6, 93 }, { -6, 84 }, { -8, 79 }, { 0, 66 },
- { -1, 71 }, { 0, 62 }, { -2, 60 }, { -2, 59 },
- { -5, 75 }, { -3, 62 }, { -4, 58 }, { -9, 66 },
- { -1, 79 }, { 0, 71 }, { 3, 68 }, { 10, 44 },
- { -7, 62 }, { 15, 36 }, { 14, 40 }, { 16, 27 },
- { 12, 29 }, { 1, 44 }, { 20, 36 }, { 18, 32 },
- { 5, 42 }, { 1, 48 }, { 10, 62 }, { 17, 46 },
- { 9, 64 }, { -12, 104 },{ -11, 97 },
-
- /* 308 -> 337 */
- { -16, 96 }, { -7, 88 }, { -8, 85 }, { -7, 85 },
- { -9, 85 }, { -13, 88 }, { 4, 66 }, { -3, 77 },
- { -3, 76 }, { -6, 76 }, { 10, 58 }, { -1, 76 },
- { -1, 83 }, { -7, 99 }, { -14, 95 }, { 2, 95 },
- { 0, 76 }, { -5, 74 }, { 0, 70 }, { -11, 75 },
- { 1, 68 }, { 0, 65 }, { -14, 73 }, { 3, 62 },
- { 4, 62 }, { -1, 68 }, { -13, 75 }, { 11, 55 },
- { 5, 64 }, { 12, 70 },
-
- /* 338 -> 368 */
- { 15, 6 }, { 6, 19 }, { 7, 16 }, { 12, 14 },
- { 18, 13 }, { 13, 11 }, { 13, 15 }, { 15, 16 },
- { 12, 23 }, { 13, 23 }, { 15, 20 }, { 14, 26 },
- { 14, 44 }, { 17, 40 }, { 17, 47 }, { 24, 17 },
- { 21, 21 }, { 25, 22 }, { 31, 27 }, { 22, 29 },
- { 19, 35 }, { 14, 50 }, { 10, 57 }, { 7, 63 },
- { -2, 77 }, { -4, 82 }, { -3, 94 }, { 9, 69 },
- { -12, 109 },{ 36, -35 }, { 36, -34 },
-
- /* 369 -> 398 */
- { 32, -26 }, { 37, -30 }, { 44, -32 }, { 34, -18 },
- { 34, -15 }, { 40, -15 }, { 33, -7 }, { 35, -5 },
- { 33, 0 }, { 38, 2 }, { 33, 13 }, { 23, 35 },
- { 13, 58 }, { 29, -3 }, { 26, 0 }, { 22, 30 },
- { 31, -7 }, { 35, -15 }, { 34, -3 }, { 34, 3 },
- { 36, -1 }, { 34, 5 }, { 32, 11 }, { 35, 5 },
- { 34, 12 }, { 39, 11 }, { 30, 29 }, { 34, 26 },
- { 29, 39 }, { 19, 66 },
-
- /* 399 -> 435 */
- { 31, 21 }, { 31, 31 }, { 25, 50 },
- { -17, 120 }, { -20, 112 }, { -18, 114 }, { -11, 85 },
- { -15, 92 }, { -14, 89 }, { -26, 71 }, { -15, 81 },
- { -14, 80 }, { 0, 68 }, { -14, 70 }, { -24, 56 },
- { -23, 68 }, { -24, 50 }, { -11, 74 }, { 23, -13 },
- { 26, -13 }, { 40, -15 }, { 49, -14 }, { 44, 3 },
- { 45, 6 }, { 44, 34 }, { 33, 54 }, { 19, 82 },
- { -3, 75 }, { -1, 23 }, { 1, 34 }, { 1, 43 },
- { 0, 54 }, { -2, 55 }, { 0, 61 }, { 1, 64 },
- { 0, 68 }, { -9, 92 },
-
- /* 436 -> 459 */
- { -14, 106 }, { -13, 97 }, { -15, 90 }, { -12, 90 },
- { -18, 88 }, { -10, 73 }, { -9, 79 }, { -14, 86 },
- { -10, 73 }, { -10, 70 }, { -10, 69 }, { -5, 66 },
- { -9, 64 }, { -5, 58 }, { 2, 59 }, { 21, -10 },
- { 24, -11 }, { 28, -8 }, { 28, -1 }, { 29, 3 },
- { 29, 9 }, { 35, 20 }, { 29, 36 }, { 14, 67 }
-};
-
-static const int cabac_context_init_PB[3][460][2] =
-{
- /* i_cabac_init_idc == 0 */
- {
- /* 0 - 10 */
- { 20, -15 }, { 2, 54 }, { 3, 74 }, { 20, -15 },
- { 2, 54 }, { 3, 74 }, { -28, 127 }, { -23, 104 },
- { -6, 53 }, { -1, 54 }, { 7, 51 },
-
- /* 11 - 23 */
- { 23, 33 }, { 23, 2 }, { 21, 0 }, { 1, 9 },
- { 0, 49 }, { -37, 118 }, { 5, 57 }, { -13, 78 },
- { -11, 65 }, { 1, 62 }, { 12, 49 }, { -4, 73 },
- { 17, 50 },
-
- /* 24 - 39 */
- { 18, 64 }, { 9, 43 }, { 29, 0 }, { 26, 67 },
- { 16, 90 }, { 9, 104 }, { -46, 127 }, { -20, 104 },
- { 1, 67 }, { -13, 78 }, { -11, 65 }, { 1, 62 },
- { -6, 86 }, { -17, 95 }, { -6, 61 }, { 9, 45 },
-
- /* 40 - 53 */
- { -3, 69 }, { -6, 81 }, { -11, 96 }, { 6, 55 },
- { 7, 67 }, { -5, 86 }, { 2, 88 }, { 0, 58 },
- { -3, 76 }, { -10, 94 }, { 5, 54 }, { 4, 69 },
- { -3, 81 }, { 0, 88 },
-
- /* 54 - 59 */
- { -7, 67 }, { -5, 74 }, { -4, 74 }, { -5, 80 },
- { -7, 72 }, { 1, 58 },
-
- /* 60 - 69 */
- { 0, 41 }, { 0, 63 }, { 0, 63 }, { 0, 63 },
- { -9, 83 }, { 4, 86 }, { 0, 97 }, { -7, 72 },
- { 13, 41 }, { 3, 62 },
-
- /* 70 - 87 */
- { 0, 45 }, { -4, 78 }, { -3, 96 }, { -27, 126 },
- { -28, 98 }, { -25, 101 }, { -23, 67 }, { -28, 82 },
- { -20, 94 }, { -16, 83 }, { -22, 110 }, { -21, 91 },
- { -18, 102 }, { -13, 93 }, { -29, 127 }, { -7, 92 },
- { -5, 89 }, { -7, 96 }, { -13, 108 }, { -3, 46 },
- { -1, 65 }, { -1, 57 }, { -9, 93 }, { -3, 74 },
- { -9, 92 }, { -8, 87 }, { -23, 126 }, { 5, 54 },
- { 6, 60 }, { 6, 59 }, { 6, 69 }, { -1, 48 },
- { 0, 68 }, { -4, 69 }, { -8, 88 },
-
- /* 105 -> 165 */
- { -2, 85 }, { -6, 78 }, { -1, 75 }, { -7, 77 },
- { 2, 54 }, { 5, 50 }, { -3, 68 }, { 1, 50 },
- { 6, 42 }, { -4, 81 }, { 1, 63 }, { -4, 70 },
- { 0, 67 }, { 2, 57 }, { -2, 76 }, { 11, 35 },
- { 4, 64 }, { 1, 61 }, { 11, 35 }, { 18, 25 },
- { 12, 24 }, { 13, 29 }, { 13, 36 }, { -10, 93 },
- { -7, 73 }, { -2, 73 }, { 13, 46 }, { 9, 49 },
- { -7, 100 }, { 9, 53 }, { 2, 53 }, { 5, 53 },
- { -2, 61 }, { 0, 56 }, { 0, 56 }, { -13, 63 },
- { -5, 60 }, { -1, 62 }, { 4, 57 }, { -6, 69 },
- { 4, 57 }, { 14, 39 }, { 4, 51 }, { 13, 68 },
- { 3, 64 }, { 1, 61 }, { 9, 63 }, { 7, 50 },
- { 16, 39 }, { 5, 44 }, { 4, 52 }, { 11, 48 },
- { -5, 60 }, { -1, 59 }, { 0, 59 }, { 22, 33 },
- { 5, 44 }, { 14, 43 }, { -1, 78 }, { 0, 60 },
- { 9, 69 },
-
- /* 166 - 226 */
- { 11, 28 }, { 2, 40 }, { 3, 44 }, { 0, 49 },
- { 0, 46 }, { 2, 44 }, { 2, 51 }, { 0, 47 },
- { 4, 39 }, { 2, 62 }, { 6, 46 }, { 0, 54 },
- { 3, 54 }, { 2, 58 }, { 4, 63 }, { 6, 51 },
- { 6, 57 }, { 7, 53 }, { 6, 52 }, { 6, 55 },
- { 11, 45 }, { 14, 36 }, { 8, 53 }, { -1, 82 },
- { 7, 55 }, { -3, 78 }, { 15, 46 }, { 22, 31 },
- { -1, 84 }, { 25, 7 }, { 30, -7 }, { 28, 3 },
- { 28, 4 }, { 32, 0 }, { 34, -1 }, { 30, 6 },
- { 30, 6 }, { 32, 9 }, { 31, 19 }, { 26, 27 },
- { 26, 30 }, { 37, 20 }, { 28, 34 }, { 17, 70 },
- { 1, 67 }, { 5, 59 }, { 9, 67 }, { 16, 30 },
- { 18, 32 }, { 18, 35 }, { 22, 29 }, { 24, 31 },
- { 23, 38 }, { 18, 43 }, { 20, 41 }, { 11, 63 },
- { 9, 59 }, { 9, 64 }, { -1, 94 }, { -2, 89 },
- { -9, 108 },
-
- /* 227 - 275 */
- { -6, 76 }, { -2, 44 }, { 0, 45 }, { 0, 52 },
- { -3, 64 }, { -2, 59 }, { -4, 70 }, { -4, 75 },
- { -8, 82 }, { -17, 102 }, { -9, 77 }, { 3, 24 },
- { 0, 42 }, { 0, 48 }, { 0, 55 }, { -6, 59 },
- { -7, 71 }, { -12, 83 }, { -11, 87 }, { -30, 119 },
- { 1, 58 }, { -3, 29 }, { -1, 36 }, { 1, 38 },
- { 2, 43 }, { -6, 55 }, { 0, 58 }, { 0, 64 },
- { -3, 74 }, { -10, 90 }, { 0, 70 }, { -4, 29 },
- { 5, 31 }, { 7, 42 }, { 1, 59 }, { -2, 58 },
- { -3, 72 }, { -3, 81 }, { -11, 97 }, { 0, 58 },
- { 8, 5 }, { 10, 14 }, { 14, 18 }, { 13, 27 },
- { 2, 40 }, { 0, 58 }, { -3, 70 }, { -6, 79 },
- { -8, 85 },
-
- /* 276 a bit special (not used, bypass is used instead) */
- { 0, 0 },
-
- /* 277 - 337 */
- { -13, 106 }, { -16, 106 }, { -10, 87 }, { -21, 114 },
- { -18, 110 }, { -14, 98 }, { -22, 110 }, { -21, 106 },
- { -18, 103 }, { -21, 107 }, { -23, 108 }, { -26, 112 },
- { -10, 96 }, { -12, 95 }, { -5, 91 }, { -9, 93 },
- { -22, 94 }, { -5, 86 }, { 9, 67 }, { -4, 80 },
- { -10, 85 }, { -1, 70 }, { 7, 60 }, { 9, 58 },
- { 5, 61 }, { 12, 50 }, { 15, 50 }, { 18, 49 },
- { 17, 54 }, { 10, 41 }, { 7, 46 }, { -1, 51 },
- { 7, 49 }, { 8, 52 }, { 9, 41 }, { 6, 47 },
- { 2, 55 }, { 13, 41 }, { 10, 44 }, { 6, 50 },
- { 5, 53 }, { 13, 49 }, { 4, 63 }, { 6, 64 },
- { -2, 69 }, { -2, 59 }, { 6, 70 }, { 10, 44 },
- { 9, 31 }, { 12, 43 }, { 3, 53 }, { 14, 34 },
- { 10, 38 }, { -3, 52 }, { 13, 40 }, { 17, 32 },
- { 7, 44 }, { 7, 38 }, { 13, 50 }, { 10, 57 },
- { 26, 43 },
-
- /* 338 - 398 */
- { 14, 11 }, { 11, 14 }, { 9, 11 }, { 18, 11 },
- { 21, 9 }, { 23, -2 }, { 32, -15 }, { 32, -15 },
- { 34, -21 }, { 39, -23 }, { 42, -33 }, { 41, -31 },
- { 46, -28 }, { 38, -12 }, { 21, 29 }, { 45, -24 },
- { 53, -45 }, { 48, -26 }, { 65, -43 }, { 43, -19 },
- { 39, -10 }, { 30, 9 }, { 18, 26 }, { 20, 27 },
- { 0, 57 }, { -14, 82 }, { -5, 75 }, { -19, 97 },
- { -35, 125 }, { 27, 0 }, { 28, 0 }, { 31, -4 },
- { 27, 6 }, { 34, 8 }, { 30, 10 }, { 24, 22 },
- { 33, 19 }, { 22, 32 }, { 26, 31 }, { 21, 41 },
- { 26, 44 }, { 23, 47 }, { 16, 65 }, { 14, 71 },
- { 8, 60 }, { 6, 63 }, { 17, 65 }, { 21, 24 },
- { 23, 20 }, { 26, 23 }, { 27, 32 }, { 28, 23 },
- { 28, 24 }, { 23, 40 }, { 24, 32 }, { 28, 29 },
- { 23, 42 }, { 19, 57 }, { 22, 53 }, { 22, 61 },
- { 11, 86 },
-
- /* 399 - 435 */
- { 12, 40 }, { 11, 51 }, { 14, 59 },
- { -4, 79 }, { -7, 71 }, { -5, 69 }, { -9, 70 },
- { -8, 66 }, { -10, 68 }, { -19, 73 }, { -12, 69 },
- { -16, 70 }, { -15, 67 }, { -20, 62 }, { -19, 70 },
- { -16, 66 }, { -22, 65 }, { -20, 63 }, { 9, -2 },
- { 26, -9 }, { 33, -9 }, { 39, -7 }, { 41, -2 },
- { 45, 3 }, { 49, 9 }, { 45, 27 }, { 36, 59 },
- { -6, 66 }, { -7, 35 }, { -7, 42 }, { -8, 45 },
- { -5, 48 }, { -12, 56 }, { -6, 60 }, { -5, 62 },
- { -8, 66 }, { -8, 76 },
-
- /* 436 - 459 */
- { -5, 85 }, { -6, 81 }, { -10, 77 }, { -7, 81 },
- { -17, 80 }, { -18, 73 }, { -4, 74 }, { -10, 83 },
- { -9, 71 }, { -9, 67 }, { -1, 61 }, { -8, 66 },
- { -14, 66 }, { 0, 59 }, { 2, 59 }, { 21, -13 },
- { 33, -14 }, { 39, -7 }, { 46, -2 }, { 51, 2 },
- { 60, 6 }, { 61, 17 }, { 55, 34 }, { 42, 62 },
- },
-
- /* i_cabac_init_idc == 1 */
- {
- /* 0 - 10 */
- { 20, -15 }, { 2, 54 }, { 3, 74 }, { 20, -15 },
- { 2, 54 }, { 3, 74 }, { -28, 127 }, { -23, 104 },
- { -6, 53 }, { -1, 54 }, { 7, 51 },
-
- /* 11 - 23 */
- { 22, 25 }, { 34, 0 }, { 16, 0 }, { -2, 9 },
- { 4, 41 }, { -29, 118 }, { 2, 65 }, { -6, 71 },
- { -13, 79 }, { 5, 52 }, { 9, 50 }, { -3, 70 },
- { 10, 54 },
-
- /* 24 - 39 */
- { 26, 34 }, { 19, 22 }, { 40, 0 }, { 57, 2 },
- { 41, 36 }, { 26, 69 }, { -45, 127 }, { -15, 101 },
- { -4, 76 }, { -6, 71 }, { -13, 79 }, { 5, 52 },
- { 6, 69 }, { -13, 90 }, { 0, 52 }, { 8, 43 },
-
- /* 40 - 53 */
- { -2, 69 },{ -5, 82 },{ -10, 96 },{ 2, 59 },
- { 2, 75 },{ -3, 87 },{ -3, 100 },{ 1, 56 },
- { -3, 74 },{ -6, 85 },{ 0, 59 },{ -3, 81 },
- { -7, 86 },{ -5, 95 },
-
- /* 54 - 59 */
- { -1, 66 },{ -1, 77 },{ 1, 70 },{ -2, 86 },
- { -5, 72 },{ 0, 61 },
-
- /* 60 - 69 */
- { 0, 41 }, { 0, 63 }, { 0, 63 }, { 0, 63 },
- { -9, 83 }, { 4, 86 }, { 0, 97 }, { -7, 72 },
- { 13, 41 }, { 3, 62 },
-
- /* 70 - 104 */
- { 13, 15 }, { 7, 51 }, { 2, 80 }, { -39, 127 },
- { -18, 91 }, { -17, 96 }, { -26, 81 }, { -35, 98 },
- { -24, 102 }, { -23, 97 }, { -27, 119 }, { -24, 99 },
- { -21, 110 }, { -18, 102 }, { -36, 127 }, { 0, 80 },
- { -5, 89 }, { -7, 94 }, { -4, 92 }, { 0, 39 },
- { 0, 65 }, { -15, 84 }, { -35, 127 }, { -2, 73 },
- { -12, 104 }, { -9, 91 }, { -31, 127 }, { 3, 55 },
- { 7, 56 }, { 7, 55 }, { 8, 61 }, { -3, 53 },
- { 0, 68 }, { -7, 74 }, { -9, 88 },
-
- /* 105 -> 165 */
- { -13, 103 }, { -13, 91 }, { -9, 89 }, { -14, 92 },
- { -8, 76 }, { -12, 87 }, { -23, 110 }, { -24, 105 },
- { -10, 78 }, { -20, 112 }, { -17, 99 }, { -78, 127 },
- { -70, 127 }, { -50, 127 }, { -46, 127 }, { -4, 66 },
- { -5, 78 }, { -4, 71 }, { -8, 72 }, { 2, 59 },
- { -1, 55 }, { -7, 70 }, { -6, 75 }, { -8, 89 },
- { -34, 119 }, { -3, 75 }, { 32, 20 }, { 30, 22 },
- { -44, 127 }, { 0, 54 }, { -5, 61 }, { 0, 58 },
- { -1, 60 }, { -3, 61 }, { -8, 67 }, { -25, 84 },
- { -14, 74 }, { -5, 65 }, { 5, 52 }, { 2, 57 },
- { 0, 61 }, { -9, 69 }, { -11, 70 }, { 18, 55 },
- { -4, 71 }, { 0, 58 }, { 7, 61 }, { 9, 41 },
- { 18, 25 }, { 9, 32 }, { 5, 43 }, { 9, 47 },
- { 0, 44 }, { 0, 51 }, { 2, 46 }, { 19, 38 },
- { -4, 66 }, { 15, 38 }, { 12, 42 }, { 9, 34 },
- { 0, 89 },
-
- /* 166 - 226 */
- { 4, 45 }, { 10, 28 }, { 10, 31 }, { 33, -11 },
- { 52, -43 }, { 18, 15 }, { 28, 0 }, { 35, -22 },
- { 38, -25 }, { 34, 0 }, { 39, -18 }, { 32, -12 },
- { 102, -94 }, { 0, 0 }, { 56, -15 }, { 33, -4 },
- { 29, 10 }, { 37, -5 }, { 51, -29 }, { 39, -9 },
- { 52, -34 }, { 69, -58 }, { 67, -63 }, { 44, -5 },
- { 32, 7 }, { 55, -29 }, { 32, 1 }, { 0, 0 },
- { 27, 36 }, { 33, -25 }, { 34, -30 }, { 36, -28 },
- { 38, -28 }, { 38, -27 }, { 34, -18 }, { 35, -16 },
- { 34, -14 }, { 32, -8 }, { 37, -6 }, { 35, 0 },
- { 30, 10 }, { 28, 18 }, { 26, 25 }, { 29, 41 },
- { 0, 75 }, { 2, 72 }, { 8, 77 }, { 14, 35 },
- { 18, 31 }, { 17, 35 }, { 21, 30 }, { 17, 45 },
- { 20, 42 }, { 18, 45 }, { 27, 26 }, { 16, 54 },
- { 7, 66 }, { 16, 56 }, { 11, 73 }, { 10, 67 },
- { -10, 116 },
-
- /* 227 - 275 */
- { -23, 112 }, { -15, 71 }, { -7, 61 }, { 0, 53 },
- { -5, 66 }, { -11, 77 }, { -9, 80 }, { -9, 84 },
- { -10, 87 }, { -34, 127 }, { -21, 101 }, { -3, 39 },
- { -5, 53 }, { -7, 61 }, { -11, 75 }, { -15, 77 },
- { -17, 91 }, { -25, 107 }, { -25, 111 }, { -28, 122 },
- { -11, 76 }, { -10, 44 }, { -10, 52 }, { -10, 57 },
- { -9, 58 }, { -16, 72 }, { -7, 69 }, { -4, 69 },
- { -5, 74 }, { -9, 86 }, { 2, 66 }, { -9, 34 },
- { 1, 32 }, { 11, 31 }, { 5, 52 }, { -2, 55 },
- { -2, 67 }, { 0, 73 }, { -8, 89 }, { 3, 52 },
- { 7, 4 }, { 10, 8 }, { 17, 8 }, { 16, 19 },
- { 3, 37 }, { -1, 61 }, { -5, 73 }, { -1, 70 },
- { -4, 78 },
-
- /* 276 a bit special (not used, bypass is used instead) */
- { 0, 0 },
-
- /* 277 - 337 */
- { -21, 126 }, { -23, 124 }, { -20, 110 }, { -26, 126 },
- { -25, 124 }, { -17, 105 }, { -27, 121 }, { -27, 117 },
- { -17, 102 }, { -26, 117 }, { -27, 116 }, { -33, 122 },
- { -10, 95 }, { -14, 100 }, { -8, 95 }, { -17, 111 },
- { -28, 114 }, { -6, 89 }, { -2, 80 }, { -4, 82 },
- { -9, 85 }, { -8, 81 }, { -1, 72 }, { 5, 64 },
- { 1, 67 }, { 9, 56 }, { 0, 69 }, { 1, 69 },
- { 7, 69 }, { -7, 69 }, { -6, 67 }, { -16, 77 },
- { -2, 64 }, { 2, 61 }, { -6, 67 }, { -3, 64 },
- { 2, 57 }, { -3, 65 }, { -3, 66 }, { 0, 62 },
- { 9, 51 }, { -1, 66 }, { -2, 71 }, { -2, 75 },
- { -1, 70 }, { -9, 72 }, { 14, 60 }, { 16, 37 },
- { 0, 47 }, { 18, 35 }, { 11, 37 }, { 12, 41 },
- { 10, 41 }, { 2, 48 }, { 12, 41 }, { 13, 41 },
- { 0, 59 }, { 3, 50 }, { 19, 40 }, { 3, 66 },
- { 18, 50 },
-
- /* 338 - 398 */
- { 19, -6 }, { 18, -6 }, { 14, 0 }, { 26, -12 },
- { 31, -16 }, { 33, -25 }, { 33, -22 }, { 37, -28 },
- { 39, -30 }, { 42, -30 }, { 47, -42 }, { 45, -36 },
- { 49, -34 }, { 41, -17 }, { 32, 9 }, { 69, -71 },
- { 63, -63 }, { 66, -64 }, { 77, -74 }, { 54, -39 },
- { 52, -35 }, { 41, -10 }, { 36, 0 }, { 40, -1 },
- { 30, 14 }, { 28, 26 }, { 23, 37 }, { 12, 55 },
- { 11, 65 }, { 37, -33 }, { 39, -36 }, { 40, -37 },
- { 38, -30 }, { 46, -33 }, { 42, -30 }, { 40, -24 },
- { 49, -29 }, { 38, -12 }, { 40, -10 }, { 38, -3 },
- { 46, -5 }, { 31, 20 }, { 29, 30 }, { 25, 44 },
- { 12, 48 }, { 11, 49 }, { 26, 45 }, { 22, 22 },
- { 23, 22 }, { 27, 21 }, { 33, 20 }, { 26, 28 },
- { 30, 24 }, { 27, 34 }, { 18, 42 }, { 25, 39 },
- { 18, 50 }, { 12, 70 }, { 21, 54 }, { 14, 71 },
- { 11, 83 },
-
- /* 399 - 435 */
- { 25, 32 }, { 21, 49 }, { 21, 54 },
- { -5, 85 }, { -6, 81 }, { -10, 77 }, { -7, 81 },
- { -17, 80 }, { -18, 73 }, { -4, 74 }, { -10, 83 },
- { -9, 71 }, { -9, 67 }, { -1, 61 }, { -8, 66 },
- { -14, 66 }, { 0, 59 }, { 2, 59 }, { 17, -10 },
- { 32, -13 }, { 42, -9 }, { 49, -5 }, { 53, 0 },
- { 64, 3 }, { 68, 10 }, { 66, 27 }, { 47, 57 },
- { -5, 71 }, { 0, 24 }, { -1, 36 }, { -2, 42 },
- { -2, 52 }, { -9, 57 }, { -6, 63 }, { -4, 65 },
- { -4, 67 }, { -7, 82 },
-
- /* 436 - 459 */
- { -3, 81 }, { -3, 76 }, { -7, 72 }, { -6, 78 },
- { -12, 72 }, { -14, 68 }, { -3, 70 }, { -6, 76 },
- { -5, 66 }, { -5, 62 }, { 0, 57 }, { -4, 61 },
- { -9, 60 }, { 1, 54 }, { 2, 58 }, { 17, -10 },
- { 32, -13 }, { 42, -9 }, { 49, -5 }, { 53, 0 },
- { 64, 3 }, { 68, 10 }, { 66, 27 }, { 47, 57 },
- },
-
- /* i_cabac_init_idc == 2 */
- {
- /* 0 - 10 */
- { 20, -15 }, { 2, 54 }, { 3, 74 }, { 20, -15 },
- { 2, 54 }, { 3, 74 }, { -28, 127 }, { -23, 104 },
- { -6, 53 }, { -1, 54 }, { 7, 51 },
-
- /* 11 - 23 */
- { 29, 16 }, { 25, 0 }, { 14, 0 }, { -10, 51 },
- { -3, 62 }, { -27, 99 }, { 26, 16 }, { -4, 85 },
- { -24, 102 }, { 5, 57 }, { 6, 57 }, { -17, 73 },
- { 14, 57 },
-
- /* 24 - 39 */
- { 20, 40 }, { 20, 10 }, { 29, 0 }, { 54, 0 },
- { 37, 42 }, { 12, 97 }, { -32, 127 }, { -22, 117 },
- { -2, 74 }, { -4, 85 }, { -24, 102 }, { 5, 57 },
- { -6, 93 }, { -14, 88 }, { -6, 44 }, { 4, 55 },
-
- /* 40 - 53 */
- { -11, 89 },{ -15, 103 },{ -21, 116 },{ 19, 57 },
- { 20, 58 },{ 4, 84 },{ 6, 96 },{ 1, 63 },
- { -5, 85 },{ -13, 106 },{ 5, 63 },{ 6, 75 },
- { -3, 90 },{ -1, 101 },
-
- /* 54 - 59 */
- { 3, 55 },{ -4, 79 },{ -2, 75 },{ -12, 97 },
- { -7, 50 },{ 1, 60 },
-
- /* 60 - 69 */
- { 0, 41 }, { 0, 63 }, { 0, 63 }, { 0, 63 },
- { -9, 83 }, { 4, 86 }, { 0, 97 }, { -7, 72 },
- { 13, 41 }, { 3, 62 },
-
- /* 70 - 104 */
- { 7, 34 }, { -9, 88 }, { -20, 127 }, { -36, 127 },
- { -17, 91 }, { -14, 95 }, { -25, 84 }, { -25, 86 },
- { -12, 89 }, { -17, 91 }, { -31, 127 }, { -14, 76 },
- { -18, 103 }, { -13, 90 }, { -37, 127 }, { 11, 80 },
- { 5, 76 }, { 2, 84 }, { 5, 78 }, { -6, 55 },
- { 4, 61 }, { -14, 83 }, { -37, 127 }, { -5, 79 },
- { -11, 104 }, { -11, 91 }, { -30, 127 }, { 0, 65 },
- { -2, 79 }, { 0, 72 }, { -4, 92 }, { -6, 56 },
- { 3, 68 }, { -8, 71 }, { -13, 98 },
-
- /* 105 -> 165 */
- { -4, 86 }, { -12, 88 }, { -5, 82 }, { -3, 72 },
- { -4, 67 }, { -8, 72 }, { -16, 89 }, { -9, 69 },
- { -1, 59 }, { 5, 66 }, { 4, 57 }, { -4, 71 },
- { -2, 71 }, { 2, 58 }, { -1, 74 }, { -4, 44 },
- { -1, 69 }, { 0, 62 }, { -7, 51 }, { -4, 47 },
- { -6, 42 }, { -3, 41 }, { -6, 53 }, { 8, 76 },
- { -9, 78 }, { -11, 83 }, { 9, 52 }, { 0, 67 },
- { -5, 90 }, { 1, 67 }, { -15, 72 }, { -5, 75 },
- { -8, 80 }, { -21, 83 }, { -21, 64 }, { -13, 31 },
- { -25, 64 }, { -29, 94 }, { 9, 75 }, { 17, 63 },
- { -8, 74 }, { -5, 35 }, { -2, 27 }, { 13, 91 },
- { 3, 65 }, { -7, 69 }, { 8, 77 }, { -10, 66 },
- { 3, 62 }, { -3, 68 }, { -20, 81 }, { 0, 30 },
- { 1, 7 }, { -3, 23 }, { -21, 74 }, { 16, 66 },
- { -23, 124 }, { 17, 37 }, { 44, -18 }, { 50, -34 },
- { -22, 127 },
-
- /* 166 - 226 */
- { 4, 39 }, { 0, 42 }, { 7, 34 }, { 11, 29 },
- { 8, 31 }, { 6, 37 }, { 7, 42 }, { 3, 40 },
- { 8, 33 }, { 13, 43 }, { 13, 36 }, { 4, 47 },
- { 3, 55 }, { 2, 58 }, { 6, 60 }, { 8, 44 },
- { 11, 44 }, { 14, 42 }, { 7, 48 }, { 4, 56 },
- { 4, 52 }, { 13, 37 }, { 9, 49 }, { 19, 58 },
- { 10, 48 }, { 12, 45 }, { 0, 69 }, { 20, 33 },
- { 8, 63 }, { 35, -18 }, { 33, -25 }, { 28, -3 },
- { 24, 10 }, { 27, 0 }, { 34, -14 }, { 52, -44 },
- { 39, -24 }, { 19, 17 }, { 31, 25 }, { 36, 29 },
- { 24, 33 }, { 34, 15 }, { 30, 20 }, { 22, 73 },
- { 20, 34 }, { 19, 31 }, { 27, 44 }, { 19, 16 },
- { 15, 36 }, { 15, 36 }, { 21, 28 }, { 25, 21 },
- { 30, 20 }, { 31, 12 }, { 27, 16 }, { 24, 42 },
- { 0, 93 }, { 14, 56 }, { 15, 57 }, { 26, 38 },
- { -24, 127 },
-
- /* 227 - 275 */
- { -24, 115 }, { -22, 82 }, { -9, 62 }, { 0, 53 },
- { 0, 59 }, { -14, 85 }, { -13, 89 }, { -13, 94 },
- { -11, 92 }, { -29, 127 }, { -21, 100 }, { -14, 57 },
- { -12, 67 }, { -11, 71 }, { -10, 77 }, { -21, 85 },
- { -16, 88 }, { -23, 104 }, { -15, 98 }, { -37, 127 },
- { -10, 82 }, { -8, 48 }, { -8, 61 }, { -8, 66 },
- { -7, 70 }, { -14, 75 }, { -10, 79 }, { -9, 83 },
- { -12, 92 }, { -18, 108 }, { -4, 79 }, { -22, 69 },
- { -16, 75 }, { -2, 58 }, { 1, 58 }, { -13, 78 },
- { -9, 83 }, { -4, 81 }, { -13, 99 }, { -13, 81 },
- { -6, 38 }, { -13, 62 }, { -6, 58 }, { -2, 59 },
- { -16, 73 }, { -10, 76 }, { -13, 86 }, { -9, 83 },
- { -10, 87 },
-
- /* 276 a bit special (not used, bypass is used instead) */
- { 0, 0 },
-
- /* 277 - 337 */
- { -22, 127 }, { -25, 127 }, { -25, 120 }, { -27, 127 },
- { -19, 114 }, { -23, 117 }, { -25, 118 }, { -26, 117 },
- { -24, 113 }, { -28, 118 }, { -31, 120 }, { -37, 124 },
- { -10, 94 }, { -15, 102 }, { -10, 99 }, { -13, 106 },
- { -50, 127 }, { -5, 92 }, { 17, 57 }, { -5, 86 },
- { -13, 94 }, { -12, 91 }, { -2, 77 }, { 0, 71 },
- { -1, 73 }, { 4, 64 }, { -7, 81 }, { 5, 64 },
- { 15, 57 }, { 1, 67 }, { 0, 68 }, { -10, 67 },
- { 1, 68 }, { 0, 77 }, { 2, 64 }, { 0, 68 },
- { -5, 78 }, { 7, 55 }, { 5, 59 }, { 2, 65 },
- { 14, 54 }, { 15, 44 }, { 5, 60 }, { 2, 70 },
- { -2, 76 }, { -18, 86 }, { 12, 70 }, { 5, 64 },
- { -12, 70 }, { 11, 55 }, { 5, 56 }, { 0, 69 },
- { 2, 65 }, { -6, 74 }, { 5, 54 }, { 7, 54 },
- { -6, 76 }, { -11, 82 }, { -2, 77 }, { -2, 77 },
- { 25, 42 },
-
- /* 338 - 398 */
- { 17, -13 }, { 16, -9 }, { 17, -12 }, { 27, -21 },
- { 37, -30 }, { 41, -40 }, { 42, -41 }, { 48, -47 },
- { 39, -32 }, { 46, -40 }, { 52, -51 }, { 46, -41 },
- { 52, -39 }, { 43, -19 }, { 32, 11 }, { 61, -55 },
- { 56, -46 }, { 62, -50 }, { 81, -67 }, { 45, -20 },
- { 35, -2 }, { 28, 15 }, { 34, 1 }, { 39, 1 },
- { 30, 17 }, { 20, 38 }, { 18, 45 }, { 15, 54 },
- { 0, 79 }, { 36, -16 }, { 37, -14 }, { 37, -17 },
- { 32, 1 }, { 34, 15 }, { 29, 15 }, { 24, 25 },
- { 34, 22 }, { 31, 16 }, { 35, 18 }, { 31, 28 },
- { 33, 41 }, { 36, 28 }, { 27, 47 }, { 21, 62 },
- { 18, 31 }, { 19, 26 }, { 36, 24 }, { 24, 23 },
- { 27, 16 }, { 24, 30 }, { 31, 29 }, { 22, 41 },
- { 22, 42 }, { 16, 60 }, { 15, 52 }, { 14, 60 },
- { 3, 78 }, { -16, 123 }, { 21, 53 }, { 22, 56 },
- { 25, 61 },
-
- /* 399 - 435 */
- { 21, 33 }, { 19, 50 }, { 17, 61 },
- { -3, 78 }, { -8, 74 }, { -9, 72 }, { -10, 72 },
- { -18, 75 }, { -12, 71 }, { -11, 63 }, { -5, 70 },
- { -17, 75 }, { -14, 72 }, { -16, 67 }, { -8, 53 },
- { -14, 59 }, { -9, 52 }, { -11, 68 }, { 9, -2 },
- { 30, -10 }, { 31, -4 }, { 33, -1 }, { 33, 7 },
- { 31, 12 }, { 37, 23 }, { 31, 38 }, { 20, 64 },
- { -9, 71 }, { -7, 37 }, { -8, 44 }, { -11, 49 },
- { -10, 56 }, { -12, 59 }, { -8, 63 }, { -9, 67 },
- { -6, 68 }, { -10, 79 },
-
- /* 436 - 459 */
- { -3, 78 }, { -8, 74 }, { -9, 72 }, { -10, 72 },
- { -18, 75 }, { -12, 71 }, { -11, 63 }, { -5, 70 },
- { -17, 75 }, { -14, 72 }, { -16, 67 }, { -8, 53 },
- { -14, 59 }, { -9, 52 }, { -11, 68 }, { 9, -2 },
- { 30, -10 }, { 31, -4 }, { 33, -1 }, { 33, 7 },
- { 31, 12 }, { 37, 23 }, { 31, 38 }, { 20, 64 },
- }
-};
diff --git a/src/libffmpeg/libavcodec/h264idct.c b/src/libffmpeg/libavcodec/h264idct.c
deleted file mode 100644
index a6a56d33a..000000000
--- a/src/libffmpeg/libavcodec/h264idct.c
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * H.264 IDCT
- * Copyright (c) 2004 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file h264-idct.c
- * H.264 IDCT.
- * @author Michael Niedermayer <michaelni@gmx.at>
- */
-
-#include "dsputil.h"
-
-static av_always_inline void idct_internal(uint8_t *dst, DCTELEM *block, int stride, int block_stride, int shift, int add){
- int i;
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-
- block[0] += 1<<(shift-1);
-
- for(i=0; i<4; i++){
- const int z0= block[0 + block_stride*i] + block[2 + block_stride*i];
- const int z1= block[0 + block_stride*i] - block[2 + block_stride*i];
- const int z2= (block[1 + block_stride*i]>>1) - block[3 + block_stride*i];
- const int z3= block[1 + block_stride*i] + (block[3 + block_stride*i]>>1);
-
- block[0 + block_stride*i]= z0 + z3;
- block[1 + block_stride*i]= z1 + z2;
- block[2 + block_stride*i]= z1 - z2;
- block[3 + block_stride*i]= z0 - z3;
- }
-
- for(i=0; i<4; i++){
- const int z0= block[i + block_stride*0] + block[i + block_stride*2];
- const int z1= block[i + block_stride*0] - block[i + block_stride*2];
- const int z2= (block[i + block_stride*1]>>1) - block[i + block_stride*3];
- const int z3= block[i + block_stride*1] + (block[i + block_stride*3]>>1);
-
- dst[i + 0*stride]= cm[ add*dst[i + 0*stride] + ((z0 + z3) >> shift) ];
- dst[i + 1*stride]= cm[ add*dst[i + 1*stride] + ((z1 + z2) >> shift) ];
- dst[i + 2*stride]= cm[ add*dst[i + 2*stride] + ((z1 - z2) >> shift) ];
- dst[i + 3*stride]= cm[ add*dst[i + 3*stride] + ((z0 - z3) >> shift) ];
- }
-}
-
-void ff_h264_idct_add_c(uint8_t *dst, DCTELEM *block, int stride){
- idct_internal(dst, block, stride, 4, 6, 1);
-}
-
-void ff_h264_lowres_idct_add_c(uint8_t *dst, int stride, DCTELEM *block){
- idct_internal(dst, block, stride, 8, 3, 1);
-}
-
-void ff_h264_lowres_idct_put_c(uint8_t *dst, int stride, DCTELEM *block){
- idct_internal(dst, block, stride, 8, 3, 0);
-}
-
-void ff_h264_idct8_add_c(uint8_t *dst, DCTELEM *block, int stride){
- int i;
- DCTELEM (*src)[8] = (DCTELEM(*)[8])block;
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-
- block[0] += 32;
-
- for( i = 0; i < 8; i++ )
- {
- const int a0 = src[i][0] + src[i][4];
- const int a2 = src[i][0] - src[i][4];
- const int a4 = (src[i][2]>>1) - src[i][6];
- const int a6 = (src[i][6]>>1) + src[i][2];
-
- const int b0 = a0 + a6;
- const int b2 = a2 + a4;
- const int b4 = a2 - a4;
- const int b6 = a0 - a6;
-
- const int a1 = -src[i][3] + src[i][5] - src[i][7] - (src[i][7]>>1);
- const int a3 = src[i][1] + src[i][7] - src[i][3] - (src[i][3]>>1);
- const int a5 = -src[i][1] + src[i][7] + src[i][5] + (src[i][5]>>1);
- const int a7 = src[i][3] + src[i][5] + src[i][1] + (src[i][1]>>1);
-
- const int b1 = (a7>>2) + a1;
- const int b3 = a3 + (a5>>2);
- const int b5 = (a3>>2) - a5;
- const int b7 = a7 - (a1>>2);
-
- src[i][0] = b0 + b7;
- src[i][7] = b0 - b7;
- src[i][1] = b2 + b5;
- src[i][6] = b2 - b5;
- src[i][2] = b4 + b3;
- src[i][5] = b4 - b3;
- src[i][3] = b6 + b1;
- src[i][4] = b6 - b1;
- }
- for( i = 0; i < 8; i++ )
- {
- const int a0 = src[0][i] + src[4][i];
- const int a2 = src[0][i] - src[4][i];
- const int a4 = (src[2][i]>>1) - src[6][i];
- const int a6 = (src[6][i]>>1) + src[2][i];
-
- const int b0 = a0 + a6;
- const int b2 = a2 + a4;
- const int b4 = a2 - a4;
- const int b6 = a0 - a6;
-
- const int a1 = -src[3][i] + src[5][i] - src[7][i] - (src[7][i]>>1);
- const int a3 = src[1][i] + src[7][i] - src[3][i] - (src[3][i]>>1);
- const int a5 = -src[1][i] + src[7][i] + src[5][i] + (src[5][i]>>1);
- const int a7 = src[3][i] + src[5][i] + src[1][i] + (src[1][i]>>1);
-
- const int b1 = (a7>>2) + a1;
- const int b3 = a3 + (a5>>2);
- const int b5 = (a3>>2) - a5;
- const int b7 = a7 - (a1>>2);
-
- dst[i + 0*stride] = cm[ dst[i + 0*stride] + ((b0 + b7) >> 6) ];
- dst[i + 1*stride] = cm[ dst[i + 1*stride] + ((b2 + b5) >> 6) ];
- dst[i + 2*stride] = cm[ dst[i + 2*stride] + ((b4 + b3) >> 6) ];
- dst[i + 3*stride] = cm[ dst[i + 3*stride] + ((b6 + b1) >> 6) ];
- dst[i + 4*stride] = cm[ dst[i + 4*stride] + ((b6 - b1) >> 6) ];
- dst[i + 5*stride] = cm[ dst[i + 5*stride] + ((b4 - b3) >> 6) ];
- dst[i + 6*stride] = cm[ dst[i + 6*stride] + ((b2 - b5) >> 6) ];
- dst[i + 7*stride] = cm[ dst[i + 7*stride] + ((b0 - b7) >> 6) ];
- }
-}
-
-// assumes all AC coefs are 0
-void ff_h264_idct_dc_add_c(uint8_t *dst, DCTELEM *block, int stride){
- int i, j;
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
- int dc = (block[0] + 32) >> 6;
- for( j = 0; j < 4; j++ )
- {
- for( i = 0; i < 4; i++ )
- dst[i] = cm[ dst[i] + dc ];
- dst += stride;
- }
-}
-
-void ff_h264_idct8_dc_add_c(uint8_t *dst, DCTELEM *block, int stride){
- int i, j;
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
- int dc = (block[0] + 32) >> 6;
- for( j = 0; j < 8; j++ )
- {
- for( i = 0; i < 8; i++ )
- dst[i] = cm[ dst[i] + dc ];
- dst += stride;
- }
-}
diff --git a/src/libffmpeg/libavcodec/huffyuv.c b/src/libffmpeg/libavcodec/huffyuv.c
deleted file mode 100644
index 0aefd6d72..000000000
--- a/src/libffmpeg/libavcodec/huffyuv.c
+++ /dev/null
@@ -1,1290 +0,0 @@
-/*
- * huffyuv codec for libavcodec
- *
- * Copyright (c) 2002-2003 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * see http://www.pcisys.net/~melanson/codecs/huffyuv.txt for a description of
- * the algorithm used
- */
-
-/**
- * @file huffyuv.c
- * huffyuv codec for libavcodec.
- */
-
-#include "common.h"
-#include "bitstream.h"
-#include "avcodec.h"
-#include "dsputil.h"
-
-#define VLC_BITS 11
-
-#ifdef WORDS_BIGENDIAN
-#define B 3
-#define G 2
-#define R 1
-#else
-#define B 0
-#define G 1
-#define R 2
-#endif
-
-typedef enum Predictor{
- LEFT= 0,
- PLANE,
- MEDIAN,
-} Predictor;
-
-typedef struct HYuvContext{
- AVCodecContext *avctx;
- Predictor predictor;
- GetBitContext gb;
- PutBitContext pb;
- int interlaced;
- int decorrelate;
- int bitstream_bpp;
- int version;
- int yuy2; //use yuy2 instead of 422P
- int bgr32; //use bgr32 instead of bgr24
- int width, height;
- int flags;
- int context;
- int picture_number;
- int last_slice_end;
- uint8_t *temp[3];
- uint64_t stats[3][256];
- uint8_t len[3][256];
- uint32_t bits[3][256];
- VLC vlc[3];
- AVFrame picture;
- uint8_t *bitstream_buffer;
- unsigned int bitstream_buffer_size;
- DSPContext dsp;
-}HYuvContext;
-
-static const unsigned char classic_shift_luma[] = {
- 34,36,35,69,135,232,9,16,10,24,11,23,12,16,13,10,14,8,15,8,
- 16,8,17,20,16,10,207,206,205,236,11,8,10,21,9,23,8,8,199,70,
- 69,68, 0
-};
-
-static const unsigned char classic_shift_chroma[] = {
- 66,36,37,38,39,40,41,75,76,77,110,239,144,81,82,83,84,85,118,183,
- 56,57,88,89,56,89,154,57,58,57,26,141,57,56,58,57,58,57,184,119,
- 214,245,116,83,82,49,80,79,78,77,44,75,41,40,39,38,37,36,34, 0
-};
-
-static const unsigned char classic_add_luma[256] = {
- 3, 9, 5, 12, 10, 35, 32, 29, 27, 50, 48, 45, 44, 41, 39, 37,
- 73, 70, 68, 65, 64, 61, 58, 56, 53, 50, 49, 46, 44, 41, 38, 36,
- 68, 65, 63, 61, 58, 55, 53, 51, 48, 46, 45, 43, 41, 39, 38, 36,
- 35, 33, 32, 30, 29, 27, 26, 25, 48, 47, 46, 44, 43, 41, 40, 39,
- 37, 36, 35, 34, 32, 31, 30, 28, 27, 26, 24, 23, 22, 20, 19, 37,
- 35, 34, 33, 31, 30, 29, 27, 26, 24, 23, 21, 20, 18, 17, 15, 29,
- 27, 26, 24, 22, 21, 19, 17, 16, 14, 26, 25, 23, 21, 19, 18, 16,
- 15, 27, 25, 23, 21, 19, 17, 16, 14, 26, 25, 23, 21, 18, 17, 14,
- 12, 17, 19, 13, 4, 9, 2, 11, 1, 7, 8, 0, 16, 3, 14, 6,
- 12, 10, 5, 15, 18, 11, 10, 13, 15, 16, 19, 20, 22, 24, 27, 15,
- 18, 20, 22, 24, 26, 14, 17, 20, 22, 24, 27, 15, 18, 20, 23, 25,
- 28, 16, 19, 22, 25, 28, 32, 36, 21, 25, 29, 33, 38, 42, 45, 49,
- 28, 31, 34, 37, 40, 42, 44, 47, 49, 50, 52, 54, 56, 57, 59, 60,
- 62, 64, 66, 67, 69, 35, 37, 39, 40, 42, 43, 45, 47, 48, 51, 52,
- 54, 55, 57, 59, 60, 62, 63, 66, 67, 69, 71, 72, 38, 40, 42, 43,
- 46, 47, 49, 51, 26, 28, 30, 31, 33, 34, 18, 19, 11, 13, 7, 8,
-};
-
-static const unsigned char classic_add_chroma[256] = {
- 3, 1, 2, 2, 2, 2, 3, 3, 7, 5, 7, 5, 8, 6, 11, 9,
- 7, 13, 11, 10, 9, 8, 7, 5, 9, 7, 6, 4, 7, 5, 8, 7,
- 11, 8, 13, 11, 19, 15, 22, 23, 20, 33, 32, 28, 27, 29, 51, 77,
- 43, 45, 76, 81, 46, 82, 75, 55, 56,144, 58, 80, 60, 74,147, 63,
- 143, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
- 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 27, 30, 21, 22,
- 17, 14, 5, 6,100, 54, 47, 50, 51, 53,106,107,108,109,110,111,
- 112,113,114,115, 4,117,118, 92, 94,121,122, 3,124,103, 2, 1,
- 0,129,130,131,120,119,126,125,136,137,138,139,140,141,142,134,
- 135,132,133,104, 64,101, 62, 57,102, 95, 93, 59, 61, 28, 97, 96,
- 52, 49, 48, 29, 32, 25, 24, 46, 23, 98, 45, 44, 43, 20, 42, 41,
- 19, 18, 99, 40, 15, 39, 38, 16, 13, 12, 11, 37, 10, 9, 8, 36,
- 7,128,127,105,123,116, 35, 34, 33,145, 31, 79, 42,146, 78, 26,
- 83, 48, 49, 50, 44, 47, 26, 31, 30, 18, 17, 19, 21, 24, 25, 13,
- 14, 16, 17, 18, 20, 21, 12, 14, 15, 9, 10, 6, 9, 6, 5, 8,
- 6, 12, 8, 10, 7, 9, 6, 4, 6, 2, 2, 3, 3, 3, 3, 2,
-};
-
-static inline int add_left_prediction(uint8_t *dst, uint8_t *src, int w, int acc){
- int i;
-
- for(i=0; i<w-1; i++){
- acc+= src[i];
- dst[i]= acc;
- i++;
- acc+= src[i];
- dst[i]= acc;
- }
-
- for(; i<w; i++){
- acc+= src[i];
- dst[i]= acc;
- }
-
- return acc;
-}
-
-static inline void add_median_prediction(uint8_t *dst, uint8_t *src1, uint8_t *diff, int w, int *left, int *left_top){
- int i;
- uint8_t l, lt;
-
- l= *left;
- lt= *left_top;
-
- for(i=0; i<w; i++){
- l= mid_pred(l, src1[i], (l + src1[i] - lt)&0xFF) + diff[i];
- lt= src1[i];
- dst[i]= l;
- }
-
- *left= l;
- *left_top= lt;
-}
-
-static inline void add_left_prediction_bgr32(uint8_t *dst, uint8_t *src, int w, int *red, int *green, int *blue){
- int i;
- int r,g,b;
- r= *red;
- g= *green;
- b= *blue;
-
- for(i=0; i<w; i++){
- b+= src[4*i+B];
- g+= src[4*i+G];
- r+= src[4*i+R];
-
- dst[4*i+B]= b;
- dst[4*i+G]= g;
- dst[4*i+R]= r;
- }
-
- *red= r;
- *green= g;
- *blue= b;
-}
-
-static inline int sub_left_prediction(HYuvContext *s, uint8_t *dst, uint8_t *src, int w, int left){
- int i;
- if(w<32){
- for(i=0; i<w; i++){
- const int temp= src[i];
- dst[i]= temp - left;
- left= temp;
- }
- return left;
- }else{
- for(i=0; i<16; i++){
- const int temp= src[i];
- dst[i]= temp - left;
- left= temp;
- }
- s->dsp.diff_bytes(dst+16, src+16, src+15, w-16);
- return src[w-1];
- }
-}
-
-static void read_len_table(uint8_t *dst, GetBitContext *gb){
- int i, val, repeat;
-
- for(i=0; i<256;){
- repeat= get_bits(gb, 3);
- val = get_bits(gb, 5);
- if(repeat==0)
- repeat= get_bits(gb, 8);
-//printf("%d %d\n", val, repeat);
- while (repeat--)
- dst[i++] = val;
- }
-}
-
-static int generate_bits_table(uint32_t *dst, uint8_t *len_table){
- int len, index;
- uint32_t bits=0;
-
- for(len=32; len>0; len--){
- for(index=0; index<256; index++){
- if(len_table[index]==len)
- dst[index]= bits++;
- }
- if(bits & 1){
- av_log(NULL, AV_LOG_ERROR, "Error generating huffman table\n");
- return -1;
- }
- bits >>= 1;
- }
- return 0;
-}
-
-#ifdef CONFIG_ENCODERS
-static void generate_len_table(uint8_t *dst, uint64_t *stats, int size){
- uint64_t counts[2*size];
- int up[2*size];
- int offset, i, next;
-
- for(offset=1; ; offset<<=1){
- for(i=0; i<size; i++){
- counts[i]= stats[i] + offset - 1;
- }
-
- for(next=size; next<size*2; next++){
- uint64_t min1, min2;
- int min1_i, min2_i;
-
- min1=min2= INT64_MAX;
- min1_i= min2_i=-1;
-
- for(i=0; i<next; i++){
- if(min2 > counts[i]){
- if(min1 > counts[i]){
- min2= min1;
- min2_i= min1_i;
- min1= counts[i];
- min1_i= i;
- }else{
- min2= counts[i];
- min2_i= i;
- }
- }
- }
-
- if(min2==INT64_MAX) break;
-
- counts[next]= min1 + min2;
- counts[min1_i]=
- counts[min2_i]= INT64_MAX;
- up[min1_i]=
- up[min2_i]= next;
- up[next]= -1;
- }
-
- for(i=0; i<size; i++){
- int len;
- int index=i;
-
- for(len=0; up[index] != -1; len++)
- index= up[index];
-
- if(len >= 32) break;
-
- dst[i]= len;
- }
- if(i==size) break;
- }
-}
-#endif /* CONFIG_ENCODERS */
-
-static int read_huffman_tables(HYuvContext *s, uint8_t *src, int length){
- GetBitContext gb;
- int i;
-
- init_get_bits(&gb, src, length*8);
-
- for(i=0; i<3; i++){
- read_len_table(s->len[i], &gb);
-
- if(generate_bits_table(s->bits[i], s->len[i])<0){
- return -1;
- }
-#if 0
-for(j=0; j<256; j++){
-printf("%6X, %2d, %3d\n", s->bits[i][j], s->len[i][j], j);
-}
-#endif
- free_vlc(&s->vlc[i]);
- init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1, s->bits[i], 4, 4, 0);
- }
-
- return (get_bits_count(&gb)+7)/8;
-}
-
-static int read_old_huffman_tables(HYuvContext *s){
-#if 1
- GetBitContext gb;
- int i;
-
- init_get_bits(&gb, classic_shift_luma, sizeof(classic_shift_luma)*8);
- read_len_table(s->len[0], &gb);
- init_get_bits(&gb, classic_shift_chroma, sizeof(classic_shift_chroma)*8);
- read_len_table(s->len[1], &gb);
-
- for(i=0; i<256; i++) s->bits[0][i] = classic_add_luma [i];
- for(i=0; i<256; i++) s->bits[1][i] = classic_add_chroma[i];
-
- if(s->bitstream_bpp >= 24){
- memcpy(s->bits[1], s->bits[0], 256*sizeof(uint32_t));
- memcpy(s->len[1] , s->len [0], 256*sizeof(uint8_t));
- }
- memcpy(s->bits[2], s->bits[1], 256*sizeof(uint32_t));
- memcpy(s->len[2] , s->len [1], 256*sizeof(uint8_t));
-
- for(i=0; i<3; i++){
- free_vlc(&s->vlc[i]);
- init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1, s->bits[i], 4, 4, 0);
- }
-
- return 0;
-#else
- av_log(s->avctx, AV_LOG_DEBUG, "v1 huffyuv is not supported \n");
- return -1;
-#endif
-}
-
-static void alloc_temp(HYuvContext *s){
- int i;
-
- if(s->bitstream_bpp<24){
- for(i=0; i<3; i++){
- s->temp[i]= av_malloc(s->width + 16);
- }
- }else{
- s->temp[0]= av_malloc(4*s->width + 16);
- }
-}
-
-static int common_init(AVCodecContext *avctx){
- HYuvContext *s = avctx->priv_data;
-
- s->avctx= avctx;
- s->flags= avctx->flags;
-
- dsputil_init(&s->dsp, avctx);
-
- s->width= avctx->width;
- s->height= avctx->height;
- assert(s->width>0 && s->height>0);
-
- return 0;
-}
-
-#ifdef CONFIG_DECODERS
-static int decode_init(AVCodecContext *avctx)
-{
- HYuvContext *s = avctx->priv_data;
-
- common_init(avctx);
- memset(s->vlc, 0, 3*sizeof(VLC));
-
- avctx->coded_frame= &s->picture;
- s->interlaced= s->height > 288;
-
-s->bgr32=1;
-//if(avctx->extradata)
-// printf("extradata:%X, extradata_size:%d\n", *(uint32_t*)avctx->extradata, avctx->extradata_size);
- if(avctx->extradata_size){
- if((avctx->bits_per_sample&7) && avctx->bits_per_sample != 12)
- s->version=1; // do such files exist at all?
- else
- s->version=2;
- }else
- s->version=0;
-
- if(s->version==2){
- int method, interlace;
-
- method= ((uint8_t*)avctx->extradata)[0];
- s->decorrelate= method&64 ? 1 : 0;
- s->predictor= method&63;
- s->bitstream_bpp= ((uint8_t*)avctx->extradata)[1];
- if(s->bitstream_bpp==0)
- s->bitstream_bpp= avctx->bits_per_sample&~7;
- interlace= (((uint8_t*)avctx->extradata)[2] & 0x30) >> 4;
- s->interlaced= (interlace==1) ? 1 : (interlace==2) ? 0 : s->interlaced;
- s->context= ((uint8_t*)avctx->extradata)[2] & 0x40 ? 1 : 0;
-
- if(read_huffman_tables(s, ((uint8_t*)avctx->extradata)+4, avctx->extradata_size) < 0)
- return -1;
- }else{
- switch(avctx->bits_per_sample&7){
- case 1:
- s->predictor= LEFT;
- s->decorrelate= 0;
- break;
- case 2:
- s->predictor= LEFT;
- s->decorrelate= 1;
- break;
- case 3:
- s->predictor= PLANE;
- s->decorrelate= avctx->bits_per_sample >= 24;
- break;
- case 4:
- s->predictor= MEDIAN;
- s->decorrelate= 0;
- break;
- default:
- s->predictor= LEFT; //OLD
- s->decorrelate= 0;
- break;
- }
- s->bitstream_bpp= avctx->bits_per_sample & ~7;
- s->context= 0;
-
- if(read_old_huffman_tables(s) < 0)
- return -1;
- }
-
- switch(s->bitstream_bpp){
- case 12:
- avctx->pix_fmt = PIX_FMT_YUV420P;
- break;
- case 16:
- if(s->yuy2){
- avctx->pix_fmt = PIX_FMT_YUV422;
- }else{
- avctx->pix_fmt = PIX_FMT_YUV422P;
- }
- break;
- case 24:
- case 32:
- if(s->bgr32){
- avctx->pix_fmt = PIX_FMT_RGBA32;
- }else{
- avctx->pix_fmt = PIX_FMT_BGR24;
- }
- break;
- default:
- assert(0);
- }
-
- alloc_temp(s);
-
-// av_log(NULL, AV_LOG_DEBUG, "pred:%d bpp:%d hbpp:%d il:%d\n", s->predictor, s->bitstream_bpp, avctx->bits_per_sample, s->interlaced);
-
- return 0;
-}
-#endif
-
-#ifdef CONFIG_ENCODERS
-static int store_table(HYuvContext *s, uint8_t *len, uint8_t *buf){
- int i;
- int index= 0;
-
- for(i=0; i<256;){
- int val= len[i];
- int repeat=0;
-
- for(; i<256 && len[i]==val && repeat<255; i++)
- repeat++;
-
- assert(val < 32 && val >0 && repeat<256 && repeat>0);
- if(repeat>7){
- buf[index++]= val;
- buf[index++]= repeat;
- }else{
- buf[index++]= val | (repeat<<5);
- }
- }
-
- return index;
-}
-
-static int encode_init(AVCodecContext *avctx)
-{
- HYuvContext *s = avctx->priv_data;
- int i, j;
-
- common_init(avctx);
-
- avctx->extradata= av_mallocz(1024*30); // 256*3+4 == 772
- avctx->stats_out= av_mallocz(1024*30); // 21*256*3(%llu ) + 3(\n) + 1(0) = 16132
- s->version=2;
-
- avctx->coded_frame= &s->picture;
-
- switch(avctx->pix_fmt){
- case PIX_FMT_YUV420P:
- s->bitstream_bpp= 12;
- break;
- case PIX_FMT_YUV422P:
- s->bitstream_bpp= 16;
- break;
- default:
- av_log(avctx, AV_LOG_ERROR, "format not supported\n");
- return -1;
- }
- avctx->bits_per_sample= s->bitstream_bpp;
- s->decorrelate= s->bitstream_bpp >= 24;
- s->predictor= avctx->prediction_method;
- s->interlaced= avctx->flags&CODEC_FLAG_INTERLACED_ME ? 1 : 0;
- if(avctx->context_model==1){
- s->context= avctx->context_model;
- if(s->flags & (CODEC_FLAG_PASS1|CODEC_FLAG_PASS2)){
- av_log(avctx, AV_LOG_ERROR, "context=1 is not compatible with 2 pass huffyuv encoding\n");
- return -1;
- }
- }else s->context= 0;
-
- if(avctx->codec->id==CODEC_ID_HUFFYUV){
- if(avctx->pix_fmt==PIX_FMT_YUV420P){
- av_log(avctx, AV_LOG_ERROR, "Error: YV12 is not supported by huffyuv; use vcodec=ffvhuff or format=422p\n");
- return -1;
- }
- if(avctx->context_model){
- av_log(avctx, AV_LOG_ERROR, "Error: per-frame huffman tables are not supported by huffyuv; use vcodec=ffvhuff\n");
- return -1;
- }
- if(s->interlaced != ( s->height > 288 ))
- av_log(avctx, AV_LOG_INFO, "using huffyuv 2.2.0 or newer interlacing flag\n");
- }
-
- ((uint8_t*)avctx->extradata)[0]= s->predictor;
- ((uint8_t*)avctx->extradata)[1]= s->bitstream_bpp;
- ((uint8_t*)avctx->extradata)[2]= s->interlaced ? 0x10 : 0x20;
- if(s->context)
- ((uint8_t*)avctx->extradata)[2]|= 0x40;
- ((uint8_t*)avctx->extradata)[3]= 0;
- s->avctx->extradata_size= 4;
-
- if(avctx->stats_in){
- char *p= avctx->stats_in;
-
- for(i=0; i<3; i++)
- for(j=0; j<256; j++)
- s->stats[i][j]= 1;
-
- for(;;){
- for(i=0; i<3; i++){
- char *next;
-
- for(j=0; j<256; j++){
- s->stats[i][j]+= strtol(p, &next, 0);
- if(next==p) return -1;
- p=next;
- }
- }
- if(p[0]==0 || p[1]==0 || p[2]==0) break;
- }
- }else{
- for(i=0; i<3; i++)
- for(j=0; j<256; j++){
- int d= FFMIN(j, 256-j);
-
- s->stats[i][j]= 100000000/(d+1);
- }
- }
-
- for(i=0; i<3; i++){
- generate_len_table(s->len[i], s->stats[i], 256);
-
- if(generate_bits_table(s->bits[i], s->len[i])<0){
- return -1;
- }
-
- s->avctx->extradata_size+=
- store_table(s, s->len[i], &((uint8_t*)s->avctx->extradata)[s->avctx->extradata_size]);
- }
-
- if(s->context){
- for(i=0; i<3; i++){
- int pels = s->width*s->height / (i?40:10);
- for(j=0; j<256; j++){
- int d= FFMIN(j, 256-j);
- s->stats[i][j]= pels/(d+1);
- }
- }
- }else{
- for(i=0; i<3; i++)
- for(j=0; j<256; j++)
- s->stats[i][j]= 0;
- }
-
-// printf("pred:%d bpp:%d hbpp:%d il:%d\n", s->predictor, s->bitstream_bpp, avctx->bits_per_sample, s->interlaced);
-
- alloc_temp(s);
-
- s->picture_number=0;
-
- return 0;
-}
-#endif /* CONFIG_ENCODERS */
-
-static void decode_422_bitstream(HYuvContext *s, int count){
- int i;
-
- count/=2;
-
- for(i=0; i<count; i++){
- s->temp[0][2*i ]= get_vlc2(&s->gb, s->vlc[0].table, VLC_BITS, 3);
- s->temp[1][ i ]= get_vlc2(&s->gb, s->vlc[1].table, VLC_BITS, 3);
- s->temp[0][2*i+1]= get_vlc2(&s->gb, s->vlc[0].table, VLC_BITS, 3);
- s->temp[2][ i ]= get_vlc2(&s->gb, s->vlc[2].table, VLC_BITS, 3);
- }
-}
-
-static void decode_gray_bitstream(HYuvContext *s, int count){
- int i;
-
- count/=2;
-
- for(i=0; i<count; i++){
- s->temp[0][2*i ]= get_vlc2(&s->gb, s->vlc[0].table, VLC_BITS, 3);
- s->temp[0][2*i+1]= get_vlc2(&s->gb, s->vlc[0].table, VLC_BITS, 3);
- }
-}
-
-#ifdef CONFIG_ENCODERS
-static int encode_422_bitstream(HYuvContext *s, int count){
- int i;
-
- if(s->pb.buf_end - s->pb.buf - (put_bits_count(&s->pb)>>3) < 2*4*count){
- av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n");
- return -1;
- }
-
- count/=2;
- if(s->flags&CODEC_FLAG_PASS1){
- for(i=0; i<count; i++){
- s->stats[0][ s->temp[0][2*i ] ]++;
- s->stats[1][ s->temp[1][ i ] ]++;
- s->stats[0][ s->temp[0][2*i+1] ]++;
- s->stats[2][ s->temp[2][ i ] ]++;
- }
- }
- if(s->avctx->flags2&CODEC_FLAG2_NO_OUTPUT)
- return 0;
- if(s->context){
- for(i=0; i<count; i++){
- s->stats[0][ s->temp[0][2*i ] ]++;
- put_bits(&s->pb, s->len[0][ s->temp[0][2*i ] ], s->bits[0][ s->temp[0][2*i ] ]);
- s->stats[1][ s->temp[1][ i ] ]++;
- put_bits(&s->pb, s->len[1][ s->temp[1][ i ] ], s->bits[1][ s->temp[1][ i ] ]);
- s->stats[0][ s->temp[0][2*i+1] ]++;
- put_bits(&s->pb, s->len[0][ s->temp[0][2*i+1] ], s->bits[0][ s->temp[0][2*i+1] ]);
- s->stats[2][ s->temp[2][ i ] ]++;
- put_bits(&s->pb, s->len[2][ s->temp[2][ i ] ], s->bits[2][ s->temp[2][ i ] ]);
- }
- }else{
- for(i=0; i<count; i++){
- put_bits(&s->pb, s->len[0][ s->temp[0][2*i ] ], s->bits[0][ s->temp[0][2*i ] ]);
- put_bits(&s->pb, s->len[1][ s->temp[1][ i ] ], s->bits[1][ s->temp[1][ i ] ]);
- put_bits(&s->pb, s->len[0][ s->temp[0][2*i+1] ], s->bits[0][ s->temp[0][2*i+1] ]);
- put_bits(&s->pb, s->len[2][ s->temp[2][ i ] ], s->bits[2][ s->temp[2][ i ] ]);
- }
- }
- return 0;
-}
-
-static int encode_gray_bitstream(HYuvContext *s, int count){
- int i;
-
- if(s->pb.buf_end - s->pb.buf - (put_bits_count(&s->pb)>>3) < 4*count){
- av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n");
- return -1;
- }
-
- count/=2;
- if(s->flags&CODEC_FLAG_PASS1){
- for(i=0; i<count; i++){
- s->stats[0][ s->temp[0][2*i ] ]++;
- s->stats[0][ s->temp[0][2*i+1] ]++;
- }
- }
- if(s->avctx->flags2&CODEC_FLAG2_NO_OUTPUT)
- return 0;
-
- if(s->context){
- for(i=0; i<count; i++){
- s->stats[0][ s->temp[0][2*i ] ]++;
- put_bits(&s->pb, s->len[0][ s->temp[0][2*i ] ], s->bits[0][ s->temp[0][2*i ] ]);
- s->stats[0][ s->temp[0][2*i+1] ]++;
- put_bits(&s->pb, s->len[0][ s->temp[0][2*i+1] ], s->bits[0][ s->temp[0][2*i+1] ]);
- }
- }else{
- for(i=0; i<count; i++){
- put_bits(&s->pb, s->len[0][ s->temp[0][2*i ] ], s->bits[0][ s->temp[0][2*i ] ]);
- put_bits(&s->pb, s->len[0][ s->temp[0][2*i+1] ], s->bits[0][ s->temp[0][2*i+1] ]);
- }
- }
- return 0;
-}
-#endif /* CONFIG_ENCODERS */
-
-static void decode_bgr_bitstream(HYuvContext *s, int count){
- int i;
-
- if(s->decorrelate){
- if(s->bitstream_bpp==24){
- for(i=0; i<count; i++){
- s->temp[0][4*i+G]= get_vlc2(&s->gb, s->vlc[1].table, VLC_BITS, 3);
- s->temp[0][4*i+B]= get_vlc2(&s->gb, s->vlc[0].table, VLC_BITS, 3) + s->temp[0][4*i+G];
- s->temp[0][4*i+R]= get_vlc2(&s->gb, s->vlc[2].table, VLC_BITS, 3) + s->temp[0][4*i+G];
- }
- }else{
- for(i=0; i<count; i++){
- s->temp[0][4*i+G]= get_vlc2(&s->gb, s->vlc[1].table, VLC_BITS, 3);
- s->temp[0][4*i+B]= get_vlc2(&s->gb, s->vlc[0].table, VLC_BITS, 3) + s->temp[0][4*i+G];
- s->temp[0][4*i+R]= get_vlc2(&s->gb, s->vlc[2].table, VLC_BITS, 3) + s->temp[0][4*i+G];
- get_vlc2(&s->gb, s->vlc[2].table, VLC_BITS, 3); //?!
- }
- }
- }else{
- if(s->bitstream_bpp==24){
- for(i=0; i<count; i++){
- s->temp[0][4*i+B]= get_vlc2(&s->gb, s->vlc[0].table, VLC_BITS, 3);
- s->temp[0][4*i+G]= get_vlc2(&s->gb, s->vlc[1].table, VLC_BITS, 3);
- s->temp[0][4*i+R]= get_vlc2(&s->gb, s->vlc[2].table, VLC_BITS, 3);
- }
- }else{
- for(i=0; i<count; i++){
- s->temp[0][4*i+B]= get_vlc2(&s->gb, s->vlc[0].table, VLC_BITS, 3);
- s->temp[0][4*i+G]= get_vlc2(&s->gb, s->vlc[1].table, VLC_BITS, 3);
- s->temp[0][4*i+R]= get_vlc2(&s->gb, s->vlc[2].table, VLC_BITS, 3);
- get_vlc2(&s->gb, s->vlc[2].table, VLC_BITS, 3); //?!
- }
- }
- }
-}
-
-#ifdef CONFIG_DECODERS
-static void draw_slice(HYuvContext *s, int y){
- int h, cy;
- int offset[4];
-
- if(s->avctx->draw_horiz_band==NULL)
- return;
-
- h= y - s->last_slice_end;
- y -= h;
-
- if(s->bitstream_bpp==12){
- cy= y>>1;
- }else{
- cy= y;
- }
-
- offset[0] = s->picture.linesize[0]*y;
- offset[1] = s->picture.linesize[1]*cy;
- offset[2] = s->picture.linesize[2]*cy;
- offset[3] = 0;
- emms_c();
-
- s->avctx->draw_horiz_band(s->avctx, &s->picture, offset, y, 3, h);
-
- s->last_slice_end= y + h;
-}
-
-static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size){
- HYuvContext *s = avctx->priv_data;
- const int width= s->width;
- const int width2= s->width>>1;
- const int height= s->height;
- int fake_ystride, fake_ustride, fake_vstride;
- AVFrame * const p= &s->picture;
- int table_size= 0;
-
- AVFrame *picture = data;
-
- s->bitstream_buffer= av_fast_realloc(s->bitstream_buffer, &s->bitstream_buffer_size, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
-
- s->dsp.bswap_buf((uint32_t*)s->bitstream_buffer, (uint32_t*)buf, buf_size/4);
-
- if(p->data[0])
- avctx->release_buffer(avctx, p);
-
- p->reference= 0;
- if(avctx->get_buffer(avctx, p) < 0){
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
-
- if(s->context){
- table_size = read_huffman_tables(s, s->bitstream_buffer, buf_size);
- if(table_size < 0)
- return -1;
- }
-
- if((unsigned)(buf_size-table_size) >= INT_MAX/8)
- return -1;
-
- init_get_bits(&s->gb, s->bitstream_buffer+table_size, (buf_size-table_size)*8);
-
- fake_ystride= s->interlaced ? p->linesize[0]*2 : p->linesize[0];
- fake_ustride= s->interlaced ? p->linesize[1]*2 : p->linesize[1];
- fake_vstride= s->interlaced ? p->linesize[2]*2 : p->linesize[2];
-
- s->last_slice_end= 0;
-
- if(s->bitstream_bpp<24){
- int y, cy;
- int lefty, leftu, leftv;
- int lefttopy, lefttopu, lefttopv;
-
- if(s->yuy2){
- p->data[0][3]= get_bits(&s->gb, 8);
- p->data[0][2]= get_bits(&s->gb, 8);
- p->data[0][1]= get_bits(&s->gb, 8);
- p->data[0][0]= get_bits(&s->gb, 8);
-
- av_log(avctx, AV_LOG_ERROR, "YUY2 output is not implemented yet\n");
- return -1;
- }else{
-
- leftv= p->data[2][0]= get_bits(&s->gb, 8);
- lefty= p->data[0][1]= get_bits(&s->gb, 8);
- leftu= p->data[1][0]= get_bits(&s->gb, 8);
- p->data[0][0]= get_bits(&s->gb, 8);
-
- switch(s->predictor){
- case LEFT:
- case PLANE:
- decode_422_bitstream(s, width-2);
- lefty= add_left_prediction(p->data[0] + 2, s->temp[0], width-2, lefty);
- if(!(s->flags&CODEC_FLAG_GRAY)){
- leftu= add_left_prediction(p->data[1] + 1, s->temp[1], width2-1, leftu);
- leftv= add_left_prediction(p->data[2] + 1, s->temp[2], width2-1, leftv);
- }
-
- for(cy=y=1; y<s->height; y++,cy++){
- uint8_t *ydst, *udst, *vdst;
-
- if(s->bitstream_bpp==12){
- decode_gray_bitstream(s, width);
-
- ydst= p->data[0] + p->linesize[0]*y;
-
- lefty= add_left_prediction(ydst, s->temp[0], width, lefty);
- if(s->predictor == PLANE){
- if(y>s->interlaced)
- s->dsp.add_bytes(ydst, ydst - fake_ystride, width);
- }
- y++;
- if(y>=s->height) break;
- }
-
- draw_slice(s, y);
-
- ydst= p->data[0] + p->linesize[0]*y;
- udst= p->data[1] + p->linesize[1]*cy;
- vdst= p->data[2] + p->linesize[2]*cy;
-
- decode_422_bitstream(s, width);
- lefty= add_left_prediction(ydst, s->temp[0], width, lefty);
- if(!(s->flags&CODEC_FLAG_GRAY)){
- leftu= add_left_prediction(udst, s->temp[1], width2, leftu);
- leftv= add_left_prediction(vdst, s->temp[2], width2, leftv);
- }
- if(s->predictor == PLANE){
- if(cy>s->interlaced){
- s->dsp.add_bytes(ydst, ydst - fake_ystride, width);
- if(!(s->flags&CODEC_FLAG_GRAY)){
- s->dsp.add_bytes(udst, udst - fake_ustride, width2);
- s->dsp.add_bytes(vdst, vdst - fake_vstride, width2);
- }
- }
- }
- }
- draw_slice(s, height);
-
- break;
- case MEDIAN:
- /* first line except first 2 pixels is left predicted */
- decode_422_bitstream(s, width-2);
- lefty= add_left_prediction(p->data[0] + 2, s->temp[0], width-2, lefty);
- if(!(s->flags&CODEC_FLAG_GRAY)){
- leftu= add_left_prediction(p->data[1] + 1, s->temp[1], width2-1, leftu);
- leftv= add_left_prediction(p->data[2] + 1, s->temp[2], width2-1, leftv);
- }
-
- cy=y=1;
-
- /* second line is left predicted for interlaced case */
- if(s->interlaced){
- decode_422_bitstream(s, width);
- lefty= add_left_prediction(p->data[0] + p->linesize[0], s->temp[0], width, lefty);
- if(!(s->flags&CODEC_FLAG_GRAY)){
- leftu= add_left_prediction(p->data[1] + p->linesize[2], s->temp[1], width2, leftu);
- leftv= add_left_prediction(p->data[2] + p->linesize[1], s->temp[2], width2, leftv);
- }
- y++; cy++;
- }
-
- /* next 4 pixels are left predicted too */
- decode_422_bitstream(s, 4);
- lefty= add_left_prediction(p->data[0] + fake_ystride, s->temp[0], 4, lefty);
- if(!(s->flags&CODEC_FLAG_GRAY)){
- leftu= add_left_prediction(p->data[1] + fake_ustride, s->temp[1], 2, leftu);
- leftv= add_left_prediction(p->data[2] + fake_vstride, s->temp[2], 2, leftv);
- }
-
- /* next line except the first 4 pixels is median predicted */
- lefttopy= p->data[0][3];
- decode_422_bitstream(s, width-4);
- add_median_prediction(p->data[0] + fake_ystride+4, p->data[0]+4, s->temp[0], width-4, &lefty, &lefttopy);
- if(!(s->flags&CODEC_FLAG_GRAY)){
- lefttopu= p->data[1][1];
- lefttopv= p->data[2][1];
- add_median_prediction(p->data[1] + fake_ustride+2, p->data[1]+2, s->temp[1], width2-2, &leftu, &lefttopu);
- add_median_prediction(p->data[2] + fake_vstride+2, p->data[2]+2, s->temp[2], width2-2, &leftv, &lefttopv);
- }
- y++; cy++;
-
- for(; y<height; y++,cy++){
- uint8_t *ydst, *udst, *vdst;
-
- if(s->bitstream_bpp==12){
- while(2*cy > y){
- decode_gray_bitstream(s, width);
- ydst= p->data[0] + p->linesize[0]*y;
- add_median_prediction(ydst, ydst - fake_ystride, s->temp[0], width, &lefty, &lefttopy);
- y++;
- }
- if(y>=height) break;
- }
- draw_slice(s, y);
-
- decode_422_bitstream(s, width);
-
- ydst= p->data[0] + p->linesize[0]*y;
- udst= p->data[1] + p->linesize[1]*cy;
- vdst= p->data[2] + p->linesize[2]*cy;
-
- add_median_prediction(ydst, ydst - fake_ystride, s->temp[0], width, &lefty, &lefttopy);
- if(!(s->flags&CODEC_FLAG_GRAY)){
- add_median_prediction(udst, udst - fake_ustride, s->temp[1], width2, &leftu, &lefttopu);
- add_median_prediction(vdst, vdst - fake_vstride, s->temp[2], width2, &leftv, &lefttopv);
- }
- }
-
- draw_slice(s, height);
- break;
- }
- }
- }else{
- int y;
- int leftr, leftg, leftb;
- const int last_line= (height-1)*p->linesize[0];
-
- if(s->bitstream_bpp==32){
- skip_bits(&s->gb, 8);
- leftr= p->data[0][last_line+R]= get_bits(&s->gb, 8);
- leftg= p->data[0][last_line+G]= get_bits(&s->gb, 8);
- leftb= p->data[0][last_line+B]= get_bits(&s->gb, 8);
- }else{
- leftr= p->data[0][last_line+R]= get_bits(&s->gb, 8);
- leftg= p->data[0][last_line+G]= get_bits(&s->gb, 8);
- leftb= p->data[0][last_line+B]= get_bits(&s->gb, 8);
- skip_bits(&s->gb, 8);
- }
-
- if(s->bgr32){
- switch(s->predictor){
- case LEFT:
- case PLANE:
- decode_bgr_bitstream(s, width-1);
- add_left_prediction_bgr32(p->data[0] + last_line+4, s->temp[0], width-1, &leftr, &leftg, &leftb);
-
- for(y=s->height-2; y>=0; y--){ //yes its stored upside down
- decode_bgr_bitstream(s, width);
-
- add_left_prediction_bgr32(p->data[0] + p->linesize[0]*y, s->temp[0], width, &leftr, &leftg, &leftb);
- if(s->predictor == PLANE){
- if((y&s->interlaced)==0 && y<s->height-1-s->interlaced){
- s->dsp.add_bytes(p->data[0] + p->linesize[0]*y,
- p->data[0] + p->linesize[0]*y + fake_ystride, fake_ystride);
- }
- }
- }
- draw_slice(s, height); // just 1 large slice as this is not possible in reverse order
- break;
- default:
- av_log(avctx, AV_LOG_ERROR, "prediction type not supported!\n");
- }
- }else{
-
- av_log(avctx, AV_LOG_ERROR, "BGR24 output is not implemented yet\n");
- return -1;
- }
- }
- emms_c();
-
- *picture= *p;
- *data_size = sizeof(AVFrame);
-
- return (get_bits_count(&s->gb)+31)/32*4 + table_size;
-}
-#endif
-
-static int common_end(HYuvContext *s){
- int i;
-
- for(i=0; i<3; i++){
- av_freep(&s->temp[i]);
- }
- return 0;
-}
-
-#ifdef CONFIG_DECODERS
-static int decode_end(AVCodecContext *avctx)
-{
- HYuvContext *s = avctx->priv_data;
- int i;
-
- common_end(s);
- av_freep(&s->bitstream_buffer);
-
- for(i=0; i<3; i++){
- free_vlc(&s->vlc[i]);
- }
-
- return 0;
-}
-#endif
-
-#ifdef CONFIG_ENCODERS
-static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){
- HYuvContext *s = avctx->priv_data;
- AVFrame *pict = data;
- const int width= s->width;
- const int width2= s->width>>1;
- const int height= s->height;
- const int fake_ystride= s->interlaced ? pict->linesize[0]*2 : pict->linesize[0];
- const int fake_ustride= s->interlaced ? pict->linesize[1]*2 : pict->linesize[1];
- const int fake_vstride= s->interlaced ? pict->linesize[2]*2 : pict->linesize[2];
- AVFrame * const p= &s->picture;
- int i, j, size=0;
-
- *p = *pict;
- p->pict_type= FF_I_TYPE;
- p->key_frame= 1;
-
- if(s->context){
- for(i=0; i<3; i++){
- generate_len_table(s->len[i], s->stats[i], 256);
- if(generate_bits_table(s->bits[i], s->len[i])<0)
- return -1;
- size+= store_table(s, s->len[i], &buf[size]);
- }
-
- for(i=0; i<3; i++)
- for(j=0; j<256; j++)
- s->stats[i][j] >>= 1;
- }
-
- init_put_bits(&s->pb, buf+size, buf_size-size);
-
- if(avctx->pix_fmt == PIX_FMT_YUV422P || avctx->pix_fmt == PIX_FMT_YUV420P){
- int lefty, leftu, leftv, y, cy;
-
- put_bits(&s->pb, 8, leftv= p->data[2][0]);
- put_bits(&s->pb, 8, lefty= p->data[0][1]);
- put_bits(&s->pb, 8, leftu= p->data[1][0]);
- put_bits(&s->pb, 8, p->data[0][0]);
-
- lefty= sub_left_prediction(s, s->temp[0], p->data[0]+2, width-2 , lefty);
- leftu= sub_left_prediction(s, s->temp[1], p->data[1]+1, width2-1, leftu);
- leftv= sub_left_prediction(s, s->temp[2], p->data[2]+1, width2-1, leftv);
-
- encode_422_bitstream(s, width-2);
-
- if(s->predictor==MEDIAN){
- int lefttopy, lefttopu, lefttopv;
- cy=y=1;
- if(s->interlaced){
- lefty= sub_left_prediction(s, s->temp[0], p->data[0]+p->linesize[0], width , lefty);
- leftu= sub_left_prediction(s, s->temp[1], p->data[1]+p->linesize[1], width2, leftu);
- leftv= sub_left_prediction(s, s->temp[2], p->data[2]+p->linesize[2], width2, leftv);
-
- encode_422_bitstream(s, width);
- y++; cy++;
- }
-
- lefty= sub_left_prediction(s, s->temp[0], p->data[0]+fake_ystride, 4, lefty);
- leftu= sub_left_prediction(s, s->temp[1], p->data[1]+fake_ustride, 2, leftu);
- leftv= sub_left_prediction(s, s->temp[2], p->data[2]+fake_vstride, 2, leftv);
-
- encode_422_bitstream(s, 4);
-
- lefttopy= p->data[0][3];
- lefttopu= p->data[1][1];
- lefttopv= p->data[2][1];
- s->dsp.sub_hfyu_median_prediction(s->temp[0], p->data[0]+4, p->data[0] + fake_ystride+4, width-4 , &lefty, &lefttopy);
- s->dsp.sub_hfyu_median_prediction(s->temp[1], p->data[1]+2, p->data[1] + fake_ustride+2, width2-2, &leftu, &lefttopu);
- s->dsp.sub_hfyu_median_prediction(s->temp[2], p->data[2]+2, p->data[2] + fake_vstride+2, width2-2, &leftv, &lefttopv);
- encode_422_bitstream(s, width-4);
- y++; cy++;
-
- for(; y<height; y++,cy++){
- uint8_t *ydst, *udst, *vdst;
-
- if(s->bitstream_bpp==12){
- while(2*cy > y){
- ydst= p->data[0] + p->linesize[0]*y;
- s->dsp.sub_hfyu_median_prediction(s->temp[0], ydst - fake_ystride, ydst, width , &lefty, &lefttopy);
- encode_gray_bitstream(s, width);
- y++;
- }
- if(y>=height) break;
- }
- ydst= p->data[0] + p->linesize[0]*y;
- udst= p->data[1] + p->linesize[1]*cy;
- vdst= p->data[2] + p->linesize[2]*cy;
-
- s->dsp.sub_hfyu_median_prediction(s->temp[0], ydst - fake_ystride, ydst, width , &lefty, &lefttopy);
- s->dsp.sub_hfyu_median_prediction(s->temp[1], udst - fake_ustride, udst, width2, &leftu, &lefttopu);
- s->dsp.sub_hfyu_median_prediction(s->temp[2], vdst - fake_vstride, vdst, width2, &leftv, &lefttopv);
-
- encode_422_bitstream(s, width);
- }
- }else{
- for(cy=y=1; y<height; y++,cy++){
- uint8_t *ydst, *udst, *vdst;
-
- /* encode a luma only line & y++ */
- if(s->bitstream_bpp==12){
- ydst= p->data[0] + p->linesize[0]*y;
-
- if(s->predictor == PLANE && s->interlaced < y){
- s->dsp.diff_bytes(s->temp[1], ydst, ydst - fake_ystride, width);
-
- lefty= sub_left_prediction(s, s->temp[0], s->temp[1], width , lefty);
- }else{
- lefty= sub_left_prediction(s, s->temp[0], ydst, width , lefty);
- }
- encode_gray_bitstream(s, width);
- y++;
- if(y>=height) break;
- }
-
- ydst= p->data[0] + p->linesize[0]*y;
- udst= p->data[1] + p->linesize[1]*cy;
- vdst= p->data[2] + p->linesize[2]*cy;
-
- if(s->predictor == PLANE && s->interlaced < cy){
- s->dsp.diff_bytes(s->temp[1], ydst, ydst - fake_ystride, width);
- s->dsp.diff_bytes(s->temp[2], udst, udst - fake_ustride, width2);
- s->dsp.diff_bytes(s->temp[2] + width2, vdst, vdst - fake_vstride, width2);
-
- lefty= sub_left_prediction(s, s->temp[0], s->temp[1], width , lefty);
- leftu= sub_left_prediction(s, s->temp[1], s->temp[2], width2, leftu);
- leftv= sub_left_prediction(s, s->temp[2], s->temp[2] + width2, width2, leftv);
- }else{
- lefty= sub_left_prediction(s, s->temp[0], ydst, width , lefty);
- leftu= sub_left_prediction(s, s->temp[1], udst, width2, leftu);
- leftv= sub_left_prediction(s, s->temp[2], vdst, width2, leftv);
- }
-
- encode_422_bitstream(s, width);
- }
- }
- }else{
- av_log(avctx, AV_LOG_ERROR, "Format not supported!\n");
- }
- emms_c();
-
- size+= (put_bits_count(&s->pb)+31)/8;
- size/= 4;
-
- if((s->flags&CODEC_FLAG_PASS1) && (s->picture_number&31)==0){
- int j;
- char *p= avctx->stats_out;
- char *end= p + 1024*30;
- for(i=0; i<3; i++){
- for(j=0; j<256; j++){
- snprintf(p, end-p, "%"PRIu64" ", s->stats[i][j]);
- p+= strlen(p);
- s->stats[i][j]= 0;
- }
- snprintf(p, end-p, "\n");
- p++;
- }
- }
- if(!(s->avctx->flags2 & CODEC_FLAG2_NO_OUTPUT)){
- flush_put_bits(&s->pb);
- s->dsp.bswap_buf((uint32_t*)buf, (uint32_t*)buf, size);
- avctx->stats_out[0] = '\0';
- }
-
- s->picture_number++;
-
- return size*4;
-}
-
-static int encode_end(AVCodecContext *avctx)
-{
- HYuvContext *s = avctx->priv_data;
-
- common_end(s);
-
- av_freep(&avctx->extradata);
- av_freep(&avctx->stats_out);
-
- return 0;
-}
-#endif /* CONFIG_ENCODERS */
-
-#ifdef CONFIG_DECODERS
-AVCodec huffyuv_decoder = {
- "huffyuv",
- CODEC_TYPE_VIDEO,
- CODEC_ID_HUFFYUV,
- sizeof(HYuvContext),
- decode_init,
- NULL,
- decode_end,
- decode_frame,
- CODEC_CAP_DR1 | CODEC_CAP_DRAW_HORIZ_BAND,
- NULL
-};
-
-AVCodec ffvhuff_decoder = {
- "ffvhuff",
- CODEC_TYPE_VIDEO,
- CODEC_ID_FFVHUFF,
- sizeof(HYuvContext),
- decode_init,
- NULL,
- decode_end,
- decode_frame,
- CODEC_CAP_DR1 | CODEC_CAP_DRAW_HORIZ_BAND,
- NULL
-};
-#endif
-
-#ifdef CONFIG_ENCODERS
-
-AVCodec huffyuv_encoder = {
- "huffyuv",
- CODEC_TYPE_VIDEO,
- CODEC_ID_HUFFYUV,
- sizeof(HYuvContext),
- encode_init,
- encode_frame,
- encode_end,
- .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV422P, -1},
-};
-
-AVCodec ffvhuff_encoder = {
- "ffvhuff",
- CODEC_TYPE_VIDEO,
- CODEC_ID_FFVHUFF,
- sizeof(HYuvContext),
- encode_init,
- encode_frame,
- encode_end,
- .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_YUV422P, -1},
-};
-
-#endif //CONFIG_ENCODERS
diff --git a/src/libffmpeg/libavcodec/i386/Makefile.am b/src/libffmpeg/libavcodec/i386/Makefile.am
deleted file mode 100644
index b9d33c3a7..000000000
--- a/src/libffmpeg/libavcodec/i386/Makefile.am
+++ /dev/null
@@ -1,54 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-# -fomit-frame-pointer is always needed. it might cause debug to not
-# work, but at least it compiles.
-AM_CFLAGS = -fomit-frame-pointer -fno-strict-aliasing
-# CFLAGS is here to filter out -funroll-loops because it causes bad
-# behavior of libavcodec
-CFLAGS := `echo @CFLAGS@ | sed -e 's/-funroll-loops//g'`
-AM_CPPFLAGS = $(LIBFFMPEG_CPPFLAGS) -I$(top_srcdir)/src/libffmpeg/libavutil -I$(top_srcdir)/src/libffmpeg -I$(top_builddir)/src/libffmpeg
-
-# Avoid "can't find register" failures with -O1 and higher
-dsputil_mmx.o dsputil_mmx.lo: CFLAGS=$(shell echo @CFLAGS@ | sed -e 's/-funroll-loops//g; s/$$/ -Os/')
-
-# Avoid errors on (at least) amd64 with -O0
-fdct_mmx.o fdct_mmx.lo: CFLAGS=`echo @CFLAGS@ | sed -e 's/^/-Os /; s/-O0\?\s/-Os /g'`
-
-# Avoid errors with -O0
-mpegvideo_mmx.o mpegvideo_mmx.lo: CFLAGS=`echo @CFLAGS@ | sed -e 's/-O0\?\s/-Os /g'`
-
-ASFLAGS =
-
-noinst_LTLIBRARIES = libavcodec_mmx.la
-
-libavcodec_mmx_src = \
- cputest.c \
- dsputil_mmx.c \
- fdct_mmx.c \
- fft_3dn.c \
- fft_3dn2.c \
- fft_sse.c \
- idct_mmx.c \
- idct_mmx_xvid.c \
- motion_est_mmx.c \
- mpegvideo_mmx.c \
- simple_idct_mmx.c \
- vp3dsp_mmx.c \
- vp3dsp_sse2.c
-
-libavcodec_mmx_dummy = libavcodec_mmx_dummy.c
-
-EXTRA_DIST = \
- $(libavcodec_mmx_dummy) \
- $(libavcodec_mmx_src) \
- dsputil_h264_template_mmx.c \
- h264dsp_mmx.c \
- mpegvideo_mmx_template.c
-
-if HAVE_MMX
-mmx_modules = $(libavcodec_mmx_src)
-endif
-
-libavcodec_mmx_la_SOURCES = $(mmx_modules) $(libavcodec_mmx_dummy)
-
-noinst_HEADERS = dsputil_mmx_avg.h dsputil_mmx_rnd.h mathops.h mmx.h
diff --git a/src/libffmpeg/libavcodec/i386/cputest.c b/src/libffmpeg/libavcodec/i386/cputest.c
deleted file mode 100644
index 0705ab3e5..000000000
--- a/src/libffmpeg/libavcodec/i386/cputest.c
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * CPU detection code, extracted from mmx.h
- * (c)1997-99 by H. Dietz and R. Fisher
- * Converted to C and improved by Fabrice Bellard.
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdlib.h>
-#include "../dsputil.h"
-
-#undef printf
-
-#ifdef ARCH_X86_64
-# define REG_b "rbx"
-# define REG_S "rsi"
-#else
-# define REG_b "ebx"
-# define REG_S "esi"
-#endif
-
-/* ebx saving is necessary for PIC. gcc seems unable to see it alone */
-#define cpuid(index,eax,ebx,ecx,edx)\
- __asm __volatile\
- ("mov %%"REG_b", %%"REG_S"\n\t"\
- "cpuid\n\t"\
- "xchg %%"REG_b", %%"REG_S\
- : "=a" (eax), "=S" (ebx),\
- "=c" (ecx), "=d" (edx)\
- : "0" (index));
-
-/* Function to test if multimedia instructions are supported... */
-int mm_support(void)
-{
- int rval = 0;
- int eax, ebx, ecx, edx;
- int max_std_level, max_ext_level, std_caps=0, ext_caps=0;
- long a, c;
-
- __asm__ __volatile__ (
- /* See if CPUID instruction is supported ... */
- /* ... Get copies of EFLAGS into eax and ecx */
- "pushf\n\t"
- "pop %0\n\t"
- "mov %0, %1\n\t"
-
- /* ... Toggle the ID bit in one copy and store */
- /* to the EFLAGS reg */
- "xor $0x200000, %0\n\t"
- "push %0\n\t"
- "popf\n\t"
-
- /* ... Get the (hopefully modified) EFLAGS */
- "pushf\n\t"
- "pop %0\n\t"
- : "=a" (a), "=c" (c)
- :
- : "cc"
- );
-
- if (a == c)
- return 0; /* CPUID not supported */
-
- cpuid(0, max_std_level, ebx, ecx, edx);
-
- if(max_std_level >= 1){
- cpuid(1, eax, ebx, ecx, std_caps);
- if (std_caps & (1<<23))
- rval |= MM_MMX;
- if (std_caps & (1<<25))
- rval |= MM_MMXEXT | MM_SSE;
- if (std_caps & (1<<26))
- rval |= MM_SSE2;
- if (ecx & 1)
- rval |= MM_SSE3;
- if (ecx & 0x00000200 )
- rval |= MM_SSSE3;
- }
-
- cpuid(0x80000000, max_ext_level, ebx, ecx, edx);
-
- if(max_ext_level >= 0x80000001){
- cpuid(0x80000001, eax, ebx, ecx, ext_caps);
- if (ext_caps & (1<<31))
- rval |= MM_3DNOW;
- if (ext_caps & (1<<30))
- rval |= MM_3DNOWEXT;
- if (ext_caps & (1<<23))
- rval |= MM_MMX;
- if (ext_caps & (1<<22))
- rval |= MM_MMXEXT;
- }
-
-#if 0
- av_log(NULL, AV_LOG_DEBUG, "%s%s%s%s%s%s%s%s\n",
- (rval&MM_MMX) ? "MMX ":"",
- (rval&MM_MMXEXT) ? "MMX2 ":"",
- (rval&MM_SSE) ? "SSE ":"",
- (rval&MM_SSE2) ? "SSE2 ":"",
- (rval&MM_SSE3) ? "SSE3 ":"",
- (rval&MM_SSSE3) ? "SSSE3 ":"",
- (rval&MM_3DNOW) ? "3DNow ":"",
- (rval&MM_3DNOWEXT) ? "3DNowExt ":"");
-#endif
- return rval;
-}
-
-#ifdef __TEST__
-int main ( void )
-{
- int mm_flags;
- mm_flags = mm_support();
- printf("mm_support = 0x%08X\n",mm_flags);
- return 0;
-}
-#endif
diff --git a/src/libffmpeg/libavcodec/i386/dsputil_h264_template_mmx.c b/src/libffmpeg/libavcodec/i386/dsputil_h264_template_mmx.c
deleted file mode 100644
index e09a1007e..000000000
--- a/src/libffmpeg/libavcodec/i386/dsputil_h264_template_mmx.c
+++ /dev/null
@@ -1,326 +0,0 @@
-/*
- * Copyright (c) 2005 Zoltan Hidvegi <hzoli -a- hzoli -d- com>,
- * Loren Merritt
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * MMX optimized version of (put|avg)_h264_chroma_mc8.
- * H264_CHROMA_MC8_TMPL must be defined to the desired function name
- * H264_CHROMA_OP must be defined to empty for put and pavgb/pavgusb for avg
- * H264_CHROMA_MC8_MV0 must be defined to a (put|avg)_pixels8 function
- */
-static void H264_CHROMA_MC8_TMPL(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y)
-{
- DECLARE_ALIGNED_8(uint64_t, AA);
- DECLARE_ALIGNED_8(uint64_t, DD);
- int i;
-
- if(y==0 && x==0) {
- /* no filter needed */
- H264_CHROMA_MC8_MV0(dst, src, stride, h);
- return;
- }
-
- assert(x<8 && y<8 && x>=0 && y>=0);
-
- if(y==0 || x==0)
- {
- /* 1 dimensional filter only */
- const int dxy = x ? 1 : stride;
-
- asm volatile(
- "movd %0, %%mm5\n\t"
- "movq %1, %%mm4\n\t"
- "punpcklwd %%mm5, %%mm5\n\t"
- "punpckldq %%mm5, %%mm5\n\t" /* mm5 = B = x */
- "movq %%mm4, %%mm6\n\t"
- "pxor %%mm7, %%mm7\n\t"
- "psubw %%mm5, %%mm4\n\t" /* mm4 = A = 8-x */
- "psrlw $1, %%mm6\n\t" /* mm6 = 4 */
- :: "rm"(x+y), "m"(ff_pw_8));
-
- for(i=0; i<h; i++) {
- asm volatile(
- /* mm0 = src[0..7], mm1 = src[1..8] */
- "movq %0, %%mm0\n\t"
- "movq %1, %%mm2\n\t"
- :: "m"(src[0]), "m"(src[dxy]));
-
- asm volatile(
- /* [mm0,mm1] = A * src[0..7] */
- /* [mm2,mm3] = B * src[1..8] */
- "movq %%mm0, %%mm1\n\t"
- "movq %%mm2, %%mm3\n\t"
- "punpcklbw %%mm7, %%mm0\n\t"
- "punpckhbw %%mm7, %%mm1\n\t"
- "punpcklbw %%mm7, %%mm2\n\t"
- "punpckhbw %%mm7, %%mm3\n\t"
- "pmullw %%mm4, %%mm0\n\t"
- "pmullw %%mm4, %%mm1\n\t"
- "pmullw %%mm5, %%mm2\n\t"
- "pmullw %%mm5, %%mm3\n\t"
-
- /* dst[0..7] = (A * src[0..7] + B * src[1..8] + 4) >> 3 */
- "paddw %%mm6, %%mm0\n\t"
- "paddw %%mm6, %%mm1\n\t"
- "paddw %%mm2, %%mm0\n\t"
- "paddw %%mm3, %%mm1\n\t"
- "psrlw $3, %%mm0\n\t"
- "psrlw $3, %%mm1\n\t"
- "packuswb %%mm1, %%mm0\n\t"
- H264_CHROMA_OP(%0, %%mm0)
- "movq %%mm0, %0\n\t"
- : "=m" (dst[0]));
-
- src += stride;
- dst += stride;
- }
- return;
- }
-
- /* general case, bilinear */
- asm volatile("movd %2, %%mm4\n\t"
- "movd %3, %%mm6\n\t"
- "punpcklwd %%mm4, %%mm4\n\t"
- "punpcklwd %%mm6, %%mm6\n\t"
- "punpckldq %%mm4, %%mm4\n\t" /* mm4 = x words */
- "punpckldq %%mm6, %%mm6\n\t" /* mm6 = y words */
- "movq %%mm4, %%mm5\n\t"
- "pmullw %%mm6, %%mm4\n\t" /* mm4 = x * y */
- "psllw $3, %%mm5\n\t"
- "psllw $3, %%mm6\n\t"
- "movq %%mm5, %%mm7\n\t"
- "paddw %%mm6, %%mm7\n\t"
- "movq %%mm4, %1\n\t" /* DD = x * y */
- "psubw %%mm4, %%mm5\n\t" /* mm5 = B = 8x - xy */
- "psubw %%mm4, %%mm6\n\t" /* mm6 = C = 8y - xy */
- "paddw %4, %%mm4\n\t"
- "psubw %%mm7, %%mm4\n\t" /* mm4 = A = xy - (8x+8y) + 64 */
- "pxor %%mm7, %%mm7\n\t"
- "movq %%mm4, %0\n\t"
- : "=m" (AA), "=m" (DD) : "rm" (x), "rm" (y), "m" (ff_pw_64));
-
- asm volatile(
- /* mm0 = src[0..7], mm1 = src[1..8] */
- "movq %0, %%mm0\n\t"
- "movq %1, %%mm1\n\t"
- : : "m" (src[0]), "m" (src[1]));
-
- for(i=0; i<h; i++) {
- src += stride;
-
- asm volatile(
- /* mm2 = A * src[0..3] + B * src[1..4] */
- /* mm3 = A * src[4..7] + B * src[5..8] */
- "movq %%mm0, %%mm2\n\t"
- "movq %%mm1, %%mm3\n\t"
- "punpckhbw %%mm7, %%mm0\n\t"
- "punpcklbw %%mm7, %%mm1\n\t"
- "punpcklbw %%mm7, %%mm2\n\t"
- "punpckhbw %%mm7, %%mm3\n\t"
- "pmullw %0, %%mm0\n\t"
- "pmullw %0, %%mm2\n\t"
- "pmullw %%mm5, %%mm1\n\t"
- "pmullw %%mm5, %%mm3\n\t"
- "paddw %%mm1, %%mm2\n\t"
- "paddw %%mm0, %%mm3\n\t"
- : : "m" (AA));
-
- asm volatile(
- /* [mm2,mm3] += C * src[0..7] */
- "movq %0, %%mm0\n\t"
- "movq %%mm0, %%mm1\n\t"
- "punpcklbw %%mm7, %%mm0\n\t"
- "punpckhbw %%mm7, %%mm1\n\t"
- "pmullw %%mm6, %%mm0\n\t"
- "pmullw %%mm6, %%mm1\n\t"
- "paddw %%mm0, %%mm2\n\t"
- "paddw %%mm1, %%mm3\n\t"
- : : "m" (src[0]));
-
- asm volatile(
- /* [mm2,mm3] += D * src[1..8] */
- "movq %1, %%mm1\n\t"
- "movq %%mm1, %%mm0\n\t"
- "movq %%mm1, %%mm4\n\t"
- "punpcklbw %%mm7, %%mm0\n\t"
- "punpckhbw %%mm7, %%mm4\n\t"
- "pmullw %2, %%mm0\n\t"
- "pmullw %2, %%mm4\n\t"
- "paddw %%mm0, %%mm2\n\t"
- "paddw %%mm4, %%mm3\n\t"
- "movq %0, %%mm0\n\t"
- : : "m" (src[0]), "m" (src[1]), "m" (DD));
-
- asm volatile(
- /* dst[0..7] = ([mm2,mm3] + 32) >> 6 */
- "paddw %1, %%mm2\n\t"
- "paddw %1, %%mm3\n\t"
- "psrlw $6, %%mm2\n\t"
- "psrlw $6, %%mm3\n\t"
- "packuswb %%mm3, %%mm2\n\t"
- H264_CHROMA_OP(%0, %%mm2)
- "movq %%mm2, %0\n\t"
- : "=m" (dst[0]) : "m" (ff_pw_32));
- dst+= stride;
- }
-}
-
-static void H264_CHROMA_MC4_TMPL(uint8_t *dst/*align 4*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y)
-{
- DECLARE_ALIGNED_8(uint64_t, AA);
- DECLARE_ALIGNED_8(uint64_t, DD);
- int i;
-
- /* no special case for mv=(0,0) in 4x*, since it's much less common than in 8x*.
- * could still save a few cycles, but maybe not worth the complexity. */
-
- assert(x<8 && y<8 && x>=0 && y>=0);
-
- asm volatile("movd %2, %%mm4\n\t"
- "movd %3, %%mm6\n\t"
- "punpcklwd %%mm4, %%mm4\n\t"
- "punpcklwd %%mm6, %%mm6\n\t"
- "punpckldq %%mm4, %%mm4\n\t" /* mm4 = x words */
- "punpckldq %%mm6, %%mm6\n\t" /* mm6 = y words */
- "movq %%mm4, %%mm5\n\t"
- "pmullw %%mm6, %%mm4\n\t" /* mm4 = x * y */
- "psllw $3, %%mm5\n\t"
- "psllw $3, %%mm6\n\t"
- "movq %%mm5, %%mm7\n\t"
- "paddw %%mm6, %%mm7\n\t"
- "movq %%mm4, %1\n\t" /* DD = x * y */
- "psubw %%mm4, %%mm5\n\t" /* mm5 = B = 8x - xy */
- "psubw %%mm4, %%mm6\n\t" /* mm6 = C = 8y - xy */
- "paddw %4, %%mm4\n\t"
- "psubw %%mm7, %%mm4\n\t" /* mm4 = A = xy - (8x+8y) + 64 */
- "pxor %%mm7, %%mm7\n\t"
- "movq %%mm4, %0\n\t"
- : "=m" (AA), "=m" (DD) : "rm" (x), "rm" (y), "m" (ff_pw_64));
-
- asm volatile(
- /* mm0 = src[0..3], mm1 = src[1..4] */
- "movd %0, %%mm0\n\t"
- "movd %1, %%mm1\n\t"
- "punpcklbw %%mm7, %%mm0\n\t"
- "punpcklbw %%mm7, %%mm1\n\t"
- : : "m" (src[0]), "m" (src[1]));
-
- for(i=0; i<h; i++) {
- asm volatile(
- /* mm2 = A * src[0..3] + B * src[1..4] */
- "movq %%mm0, %%mm2\n\t"
- "pmullw %0, %%mm2\n\t"
- "pmullw %%mm5, %%mm1\n\t"
- "paddw %%mm1, %%mm2\n\t"
- : : "m" (AA));
-
- src += stride;
- asm volatile(
- /* mm0 = src[0..3], mm1 = src[1..4] */
- "movd %0, %%mm0\n\t"
- "movd %1, %%mm1\n\t"
- "punpcklbw %%mm7, %%mm0\n\t"
- "punpcklbw %%mm7, %%mm1\n\t"
- : : "m" (src[0]), "m" (src[1]));
-
- asm volatile(
- /* mm2 += C * src[0..3] + D * src[1..4] */
- "movq %%mm0, %%mm3\n\t"
- "movq %%mm1, %%mm4\n\t"
- "pmullw %%mm6, %%mm3\n\t"
- "pmullw %0, %%mm4\n\t"
- "paddw %%mm3, %%mm2\n\t"
- "paddw %%mm4, %%mm2\n\t"
- : : "m" (DD));
-
- asm volatile(
- /* dst[0..3] = pack((mm2 + 32) >> 6) */
- "paddw %1, %%mm2\n\t"
- "psrlw $6, %%mm2\n\t"
- "packuswb %%mm7, %%mm2\n\t"
- H264_CHROMA_OP4(%0, %%mm2, %%mm3)
- "movd %%mm2, %0\n\t"
- : "=m" (dst[0]) : "m" (ff_pw_32));
- dst += stride;
- }
-}
-
-#ifdef H264_CHROMA_MC2_TMPL
-static void H264_CHROMA_MC2_TMPL(uint8_t *dst/*align 2*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y)
-{
- int CD=((1<<16)-1)*x*y + 8*y;
- int AB=((8<<16)-8)*x + 64 - CD;
- int i;
-
- asm volatile(
- /* mm5 = {A,B,A,B} */
- /* mm6 = {C,D,C,D} */
- "movd %0, %%mm5\n\t"
- "movd %1, %%mm6\n\t"
- "punpckldq %%mm5, %%mm5\n\t"
- "punpckldq %%mm6, %%mm6\n\t"
- "pxor %%mm7, %%mm7\n\t"
- :: "r"(AB), "r"(CD));
-
- asm volatile(
- /* mm0 = src[0,1,1,2] */
- "movd %0, %%mm0\n\t"
- "punpcklbw %%mm7, %%mm0\n\t"
- "pshufw $0x94, %%mm0, %%mm0\n\t"
- :: "m"(src[0]));
-
- for(i=0; i<h; i++) {
- asm volatile(
- /* mm1 = A * src[0,1] + B * src[1,2] */
- "movq %%mm0, %%mm1\n\t"
- "pmaddwd %%mm5, %%mm1\n\t"
- ::);
-
- src += stride;
- asm volatile(
- /* mm0 = src[0,1,1,2] */
- "movd %0, %%mm0\n\t"
- "punpcklbw %%mm7, %%mm0\n\t"
- "pshufw $0x94, %%mm0, %%mm0\n\t"
- :: "m"(src[0]));
-
- asm volatile(
- /* mm1 += C * src[0,1] + D * src[1,2] */
- "movq %%mm0, %%mm2\n\t"
- "pmaddwd %%mm6, %%mm2\n\t"
- "paddw %%mm2, %%mm1\n\t"
- ::);
-
- asm volatile(
- /* dst[0,1] = pack((mm1 + 32) >> 6) */
- "paddw %1, %%mm1\n\t"
- "psrlw $6, %%mm1\n\t"
- "packssdw %%mm7, %%mm1\n\t"
- "packuswb %%mm7, %%mm1\n\t"
- /* writes garbage to the right of dst.
- * ok because partitions are processed from left to right. */
- H264_CHROMA_OP4(%0, %%mm1, %%mm3)
- "movd %%mm1, %0\n\t"
- : "=m" (dst[0]) : "m" (ff_pw_32));
- dst += stride;
- }
-}
-#endif
-
diff --git a/src/libffmpeg/libavcodec/i386/dsputil_mmx.c b/src/libffmpeg/libavcodec/i386/dsputil_mmx.c
deleted file mode 100644
index 673e749c4..000000000
--- a/src/libffmpeg/libavcodec/i386/dsputil_mmx.c
+++ /dev/null
@@ -1,3540 +0,0 @@
-/*
- * MMX optimized DSP utils
- * Copyright (c) 2000, 2001 Fabrice Bellard.
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * MMX optimization by Nick Kurshev <nickols_k@mail.ru>
- */
-
-#include "../dsputil.h"
-#include "../simple_idct.h"
-#include "../mpegvideo.h"
-#include "x86_cpu.h"
-#include "mmx.h"
-
-//#undef NDEBUG
-//#include <assert.h>
-
-extern void ff_idct_xvid_mmx(short *block);
-extern void ff_idct_xvid_mmx2(short *block);
-
-int mm_flags; /* multimedia extension flags */
-
-/* pixel operations */
-static const uint64_t mm_bone attribute_used __attribute__ ((aligned(8))) = 0x0101010101010101ULL;
-static const uint64_t mm_wone attribute_used __attribute__ ((aligned(8))) = 0x0001000100010001ULL;
-static const uint64_t mm_wtwo attribute_used __attribute__ ((aligned(8))) = 0x0002000200020002ULL;
-
-static const uint64_t ff_pdw_80000000[2] attribute_used __attribute__ ((aligned(16))) =
-{0x8000000080000000ULL, 0x8000000080000000ULL};
-
-static const uint64_t ff_pw_20 attribute_used __attribute__ ((aligned(8))) = 0x0014001400140014ULL;
-static const uint64_t ff_pw_3 attribute_used __attribute__ ((aligned(8))) = 0x0003000300030003ULL;
-static const uint64_t ff_pw_4 attribute_used __attribute__ ((aligned(8))) = 0x0004000400040004ULL;
-static const uint64_t ff_pw_5 attribute_used __attribute__ ((aligned(8))) = 0x0005000500050005ULL;
-static const uint64_t ff_pw_8 attribute_used __attribute__ ((aligned(8))) = 0x0008000800080008ULL;
-static const uint64_t ff_pw_16 attribute_used __attribute__ ((aligned(8))) = 0x0010001000100010ULL;
-static const uint64_t ff_pw_32 attribute_used __attribute__ ((aligned(8))) = 0x0020002000200020ULL;
-static const uint64_t ff_pw_64 attribute_used __attribute__ ((aligned(8))) = 0x0040004000400040ULL;
-static const uint64_t ff_pw_15 attribute_used __attribute__ ((aligned(8))) = 0x000F000F000F000FULL;
-
-static const uint64_t ff_pb_1 attribute_used __attribute__ ((aligned(8))) = 0x0101010101010101ULL;
-static const uint64_t ff_pb_3 attribute_used __attribute__ ((aligned(8))) = 0x0303030303030303ULL;
-static const uint64_t ff_pb_7 attribute_used __attribute__ ((aligned(8))) = 0x0707070707070707ULL;
-static const uint64_t ff_pb_3F attribute_used __attribute__ ((aligned(8))) = 0x3F3F3F3F3F3F3F3FULL;
-static const uint64_t ff_pb_A1 attribute_used __attribute__ ((aligned(8))) = 0xA1A1A1A1A1A1A1A1ULL;
-static const uint64_t ff_pb_5F attribute_used __attribute__ ((aligned(8))) = 0x5F5F5F5F5F5F5F5FULL;
-static const uint64_t ff_pb_FC attribute_used __attribute__ ((aligned(8))) = 0xFCFCFCFCFCFCFCFCULL;
-
-#define JUMPALIGN() __asm __volatile (ASMALIGN(3)::)
-#define MOVQ_ZERO(regd) __asm __volatile ("pxor %%" #regd ", %%" #regd ::)
-
-#define MOVQ_WONE(regd) \
- __asm __volatile ( \
- "pcmpeqd %%" #regd ", %%" #regd " \n\t" \
- "psrlw $15, %%" #regd ::)
-
-#define MOVQ_BFE(regd) \
- __asm __volatile ( \
- "pcmpeqd %%" #regd ", %%" #regd " \n\t"\
- "paddb %%" #regd ", %%" #regd " \n\t" ::)
-
-#ifndef PIC
-#define MOVQ_BONE(regd) __asm __volatile ("movq %0, %%" #regd " \n\t" ::"m"(mm_bone))
-#define MOVQ_WTWO(regd) __asm __volatile ("movq %0, %%" #regd " \n\t" ::"m"(mm_wtwo))
-#else
-// for shared library it's better to use this way for accessing constants
-// pcmpeqd -> -1
-#define MOVQ_BONE(regd) \
- __asm __volatile ( \
- "pcmpeqd %%" #regd ", %%" #regd " \n\t" \
- "psrlw $15, %%" #regd " \n\t" \
- "packuswb %%" #regd ", %%" #regd " \n\t" ::)
-
-#define MOVQ_WTWO(regd) \
- __asm __volatile ( \
- "pcmpeqd %%" #regd ", %%" #regd " \n\t" \
- "psrlw $15, %%" #regd " \n\t" \
- "psllw $1, %%" #regd " \n\t"::)
-
-#endif
-
-// using regr as temporary and for the output result
-// first argument is unmodifed and second is trashed
-// regfe is supposed to contain 0xfefefefefefefefe
-#define PAVGB_MMX_NO_RND(rega, regb, regr, regfe) \
- "movq " #rega ", " #regr " \n\t"\
- "pand " #regb ", " #regr " \n\t"\
- "pxor " #rega ", " #regb " \n\t"\
- "pand " #regfe "," #regb " \n\t"\
- "psrlq $1, " #regb " \n\t"\
- "paddb " #regb ", " #regr " \n\t"
-
-#define PAVGB_MMX(rega, regb, regr, regfe) \
- "movq " #rega ", " #regr " \n\t"\
- "por " #regb ", " #regr " \n\t"\
- "pxor " #rega ", " #regb " \n\t"\
- "pand " #regfe "," #regb " \n\t"\
- "psrlq $1, " #regb " \n\t"\
- "psubb " #regb ", " #regr " \n\t"
-
-// mm6 is supposed to contain 0xfefefefefefefefe
-#define PAVGBP_MMX_NO_RND(rega, regb, regr, regc, regd, regp) \
- "movq " #rega ", " #regr " \n\t"\
- "movq " #regc ", " #regp " \n\t"\
- "pand " #regb ", " #regr " \n\t"\
- "pand " #regd ", " #regp " \n\t"\
- "pxor " #rega ", " #regb " \n\t"\
- "pxor " #regc ", " #regd " \n\t"\
- "pand %%mm6, " #regb " \n\t"\
- "pand %%mm6, " #regd " \n\t"\
- "psrlq $1, " #regb " \n\t"\
- "psrlq $1, " #regd " \n\t"\
- "paddb " #regb ", " #regr " \n\t"\
- "paddb " #regd ", " #regp " \n\t"
-
-#define PAVGBP_MMX(rega, regb, regr, regc, regd, regp) \
- "movq " #rega ", " #regr " \n\t"\
- "movq " #regc ", " #regp " \n\t"\
- "por " #regb ", " #regr " \n\t"\
- "por " #regd ", " #regp " \n\t"\
- "pxor " #rega ", " #regb " \n\t"\
- "pxor " #regc ", " #regd " \n\t"\
- "pand %%mm6, " #regb " \n\t"\
- "pand %%mm6, " #regd " \n\t"\
- "psrlq $1, " #regd " \n\t"\
- "psrlq $1, " #regb " \n\t"\
- "psubb " #regb ", " #regr " \n\t"\
- "psubb " #regd ", " #regp " \n\t"
-
-/***********************************/
-/* MMX no rounding */
-#define DEF(x, y) x ## _no_rnd_ ## y ##_mmx
-#define SET_RND MOVQ_WONE
-#define PAVGBP(a, b, c, d, e, f) PAVGBP_MMX_NO_RND(a, b, c, d, e, f)
-#define PAVGB(a, b, c, e) PAVGB_MMX_NO_RND(a, b, c, e)
-
-#include "dsputil_mmx_rnd.h"
-
-#undef DEF
-#undef SET_RND
-#undef PAVGBP
-#undef PAVGB
-/***********************************/
-/* MMX rounding */
-
-#define DEF(x, y) x ## _ ## y ##_mmx
-#define SET_RND MOVQ_WTWO
-#define PAVGBP(a, b, c, d, e, f) PAVGBP_MMX(a, b, c, d, e, f)
-#define PAVGB(a, b, c, e) PAVGB_MMX(a, b, c, e)
-
-#include "dsputil_mmx_rnd.h"
-
-#undef DEF
-#undef SET_RND
-#undef PAVGBP
-#undef PAVGB
-
-/***********************************/
-/* 3Dnow specific */
-
-#define DEF(x) x ## _3dnow
-/* for Athlons PAVGUSB is prefered */
-#define PAVGB "pavgusb"
-
-#include "dsputil_mmx_avg.h"
-
-#undef DEF
-#undef PAVGB
-
-/***********************************/
-/* MMX2 specific */
-
-#define DEF(x) x ## _mmx2
-
-/* Introduced only in MMX2 set */
-#define PAVGB "pavgb"
-
-#include "dsputil_mmx_avg.h"
-
-#undef DEF
-#undef PAVGB
-
-#define SBUTTERFLY(a,b,t,n)\
- "movq " #a ", " #t " \n\t" /* abcd */\
- "punpckl" #n " " #b ", " #a " \n\t" /* aebf */\
- "punpckh" #n " " #b ", " #t " \n\t" /* cgdh */\
-
-/***********************************/
-/* standard MMX */
-
-#ifdef CONFIG_ENCODERS
-static void get_pixels_mmx(DCTELEM *block, const uint8_t *pixels, int line_size)
-{
- asm volatile(
- "mov $-128, %%"REG_a" \n\t"
- "pxor %%mm7, %%mm7 \n\t"
- ASMALIGN(4)
- "1: \n\t"
- "movq (%0), %%mm0 \n\t"
- "movq (%0, %2), %%mm2 \n\t"
- "movq %%mm0, %%mm1 \n\t"
- "movq %%mm2, %%mm3 \n\t"
- "punpcklbw %%mm7, %%mm0 \n\t"
- "punpckhbw %%mm7, %%mm1 \n\t"
- "punpcklbw %%mm7, %%mm2 \n\t"
- "punpckhbw %%mm7, %%mm3 \n\t"
- "movq %%mm0, (%1, %%"REG_a") \n\t"
- "movq %%mm1, 8(%1, %%"REG_a") \n\t"
- "movq %%mm2, 16(%1, %%"REG_a") \n\t"
- "movq %%mm3, 24(%1, %%"REG_a") \n\t"
- "add %3, %0 \n\t"
- "add $32, %%"REG_a" \n\t"
- "js 1b \n\t"
- : "+r" (pixels)
- : "r" (block+64), "r" ((long)line_size), "r" ((long)line_size*2)
- : "%"REG_a
- );
-}
-
-static inline void diff_pixels_mmx(DCTELEM *block, const uint8_t *s1, const uint8_t *s2, int stride)
-{
- asm volatile(
- "pxor %%mm7, %%mm7 \n\t"
- "mov $-128, %%"REG_a" \n\t"
- ASMALIGN(4)
- "1: \n\t"
- "movq (%0), %%mm0 \n\t"
- "movq (%1), %%mm2 \n\t"
- "movq %%mm0, %%mm1 \n\t"
- "movq %%mm2, %%mm3 \n\t"
- "punpcklbw %%mm7, %%mm0 \n\t"
- "punpckhbw %%mm7, %%mm1 \n\t"
- "punpcklbw %%mm7, %%mm2 \n\t"
- "punpckhbw %%mm7, %%mm3 \n\t"
- "psubw %%mm2, %%mm0 \n\t"
- "psubw %%mm3, %%mm1 \n\t"
- "movq %%mm0, (%2, %%"REG_a") \n\t"
- "movq %%mm1, 8(%2, %%"REG_a") \n\t"
- "add %3, %0 \n\t"
- "add %3, %1 \n\t"
- "add $16, %%"REG_a" \n\t"
- "jnz 1b \n\t"
- : "+r" (s1), "+r" (s2)
- : "r" (block+64), "r" ((long)stride)
- : "%"REG_a
- );
-}
-#endif //CONFIG_ENCODERS
-
-void put_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size)
-{
- const DCTELEM *p;
- uint8_t *pix;
-
- /* read the pixels */
- p = block;
- pix = pixels;
- /* unrolled loop */
- __asm __volatile(
- "movq %3, %%mm0 \n\t"
- "movq 8%3, %%mm1 \n\t"
- "movq 16%3, %%mm2 \n\t"
- "movq 24%3, %%mm3 \n\t"
- "movq 32%3, %%mm4 \n\t"
- "movq 40%3, %%mm5 \n\t"
- "movq 48%3, %%mm6 \n\t"
- "movq 56%3, %%mm7 \n\t"
- "packuswb %%mm1, %%mm0 \n\t"
- "packuswb %%mm3, %%mm2 \n\t"
- "packuswb %%mm5, %%mm4 \n\t"
- "packuswb %%mm7, %%mm6 \n\t"
- "movq %%mm0, (%0) \n\t"
- "movq %%mm2, (%0, %1) \n\t"
- "movq %%mm4, (%0, %1, 2) \n\t"
- "movq %%mm6, (%0, %2) \n\t"
- ::"r" (pix), "r" ((long)line_size), "r" ((long)line_size*3), "m"(*p)
- :"memory");
- pix += line_size*4;
- p += 32;
-
- // if here would be an exact copy of the code above
- // compiler would generate some very strange code
- // thus using "r"
- __asm __volatile(
- "movq (%3), %%mm0 \n\t"
- "movq 8(%3), %%mm1 \n\t"
- "movq 16(%3), %%mm2 \n\t"
- "movq 24(%3), %%mm3 \n\t"
- "movq 32(%3), %%mm4 \n\t"
- "movq 40(%3), %%mm5 \n\t"
- "movq 48(%3), %%mm6 \n\t"
- "movq 56(%3), %%mm7 \n\t"
- "packuswb %%mm1, %%mm0 \n\t"
- "packuswb %%mm3, %%mm2 \n\t"
- "packuswb %%mm5, %%mm4 \n\t"
- "packuswb %%mm7, %%mm6 \n\t"
- "movq %%mm0, (%0) \n\t"
- "movq %%mm2, (%0, %1) \n\t"
- "movq %%mm4, (%0, %1, 2) \n\t"
- "movq %%mm6, (%0, %2) \n\t"
- ::"r" (pix), "r" ((long)line_size), "r" ((long)line_size*3), "r"(p)
- :"memory");
-}
-
-static DECLARE_ALIGNED_8(const unsigned char, vector128[8]) =
- { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 };
-
-void put_signed_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size)
-{
- int i;
-
- movq_m2r(*vector128, mm1);
- for (i = 0; i < 8; i++) {
- movq_m2r(*(block), mm0);
- packsswb_m2r(*(block + 4), mm0);
- block += 8;
- paddb_r2r(mm1, mm0);
- movq_r2m(mm0, *pixels);
- pixels += line_size;
- }
-}
-
-void add_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size)
-{
- const DCTELEM *p;
- uint8_t *pix;
- int i;
-
- /* read the pixels */
- p = block;
- pix = pixels;
- MOVQ_ZERO(mm7);
- i = 4;
- do {
- __asm __volatile(
- "movq (%2), %%mm0 \n\t"
- "movq 8(%2), %%mm1 \n\t"
- "movq 16(%2), %%mm2 \n\t"
- "movq 24(%2), %%mm3 \n\t"
- "movq %0, %%mm4 \n\t"
- "movq %1, %%mm6 \n\t"
- "movq %%mm4, %%mm5 \n\t"
- "punpcklbw %%mm7, %%mm4 \n\t"
- "punpckhbw %%mm7, %%mm5 \n\t"
- "paddsw %%mm4, %%mm0 \n\t"
- "paddsw %%mm5, %%mm1 \n\t"
- "movq %%mm6, %%mm5 \n\t"
- "punpcklbw %%mm7, %%mm6 \n\t"
- "punpckhbw %%mm7, %%mm5 \n\t"
- "paddsw %%mm6, %%mm2 \n\t"
- "paddsw %%mm5, %%mm3 \n\t"
- "packuswb %%mm1, %%mm0 \n\t"
- "packuswb %%mm3, %%mm2 \n\t"
- "movq %%mm0, %0 \n\t"
- "movq %%mm2, %1 \n\t"
- :"+m"(*pix), "+m"(*(pix+line_size))
- :"r"(p)
- :"memory");
- pix += line_size*2;
- p += 16;
- } while (--i);
-}
-
-static void put_pixels4_mmx(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-{
- __asm __volatile(
- "lea (%3, %3), %%"REG_a" \n\t"
- ASMALIGN(3)
- "1: \n\t"
- "movd (%1), %%mm0 \n\t"
- "movd (%1, %3), %%mm1 \n\t"
- "movd %%mm0, (%2) \n\t"
- "movd %%mm1, (%2, %3) \n\t"
- "add %%"REG_a", %1 \n\t"
- "add %%"REG_a", %2 \n\t"
- "movd (%1), %%mm0 \n\t"
- "movd (%1, %3), %%mm1 \n\t"
- "movd %%mm0, (%2) \n\t"
- "movd %%mm1, (%2, %3) \n\t"
- "add %%"REG_a", %1 \n\t"
- "add %%"REG_a", %2 \n\t"
- "subl $4, %0 \n\t"
- "jnz 1b \n\t"
- : "+g"(h), "+r" (pixels), "+r" (block)
- : "r"((long)line_size)
- : "%"REG_a, "memory"
- );
-}
-
-static void put_pixels8_mmx(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-{
- __asm __volatile(
- "lea (%3, %3), %%"REG_a" \n\t"
- ASMALIGN(3)
- "1: \n\t"
- "movq (%1), %%mm0 \n\t"
- "movq (%1, %3), %%mm1 \n\t"
- "movq %%mm0, (%2) \n\t"
- "movq %%mm1, (%2, %3) \n\t"
- "add %%"REG_a", %1 \n\t"
- "add %%"REG_a", %2 \n\t"
- "movq (%1), %%mm0 \n\t"
- "movq (%1, %3), %%mm1 \n\t"
- "movq %%mm0, (%2) \n\t"
- "movq %%mm1, (%2, %3) \n\t"
- "add %%"REG_a", %1 \n\t"
- "add %%"REG_a", %2 \n\t"
- "subl $4, %0 \n\t"
- "jnz 1b \n\t"
- : "+g"(h), "+r" (pixels), "+r" (block)
- : "r"((long)line_size)
- : "%"REG_a, "memory"
- );
-}
-
-static void put_pixels16_mmx(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-{
- __asm __volatile(
- "lea (%3, %3), %%"REG_a" \n\t"
- ASMALIGN(3)
- "1: \n\t"
- "movq (%1), %%mm0 \n\t"
- "movq 8(%1), %%mm4 \n\t"
- "movq (%1, %3), %%mm1 \n\t"
- "movq 8(%1, %3), %%mm5 \n\t"
- "movq %%mm0, (%2) \n\t"
- "movq %%mm4, 8(%2) \n\t"
- "movq %%mm1, (%2, %3) \n\t"
- "movq %%mm5, 8(%2, %3) \n\t"
- "add %%"REG_a", %1 \n\t"
- "add %%"REG_a", %2 \n\t"
- "movq (%1), %%mm0 \n\t"
- "movq 8(%1), %%mm4 \n\t"
- "movq (%1, %3), %%mm1 \n\t"
- "movq 8(%1, %3), %%mm5 \n\t"
- "movq %%mm0, (%2) \n\t"
- "movq %%mm4, 8(%2) \n\t"
- "movq %%mm1, (%2, %3) \n\t"
- "movq %%mm5, 8(%2, %3) \n\t"
- "add %%"REG_a", %1 \n\t"
- "add %%"REG_a", %2 \n\t"
- "subl $4, %0 \n\t"
- "jnz 1b \n\t"
- : "+g"(h), "+r" (pixels), "+r" (block)
- : "r"((long)line_size)
- : "%"REG_a, "memory"
- );
-}
-
-static void clear_blocks_mmx(DCTELEM *blocks)
-{
- __asm __volatile(
- "pxor %%mm7, %%mm7 \n\t"
- "mov $-128*6, %%"REG_a" \n\t"
- "1: \n\t"
- "movq %%mm7, (%0, %%"REG_a") \n\t"
- "movq %%mm7, 8(%0, %%"REG_a") \n\t"
- "movq %%mm7, 16(%0, %%"REG_a") \n\t"
- "movq %%mm7, 24(%0, %%"REG_a") \n\t"
- "add $32, %%"REG_a" \n\t"
- " js 1b \n\t"
- : : "r" (((uint8_t *)blocks)+128*6)
- : "%"REG_a
- );
-}
-
-#ifdef CONFIG_ENCODERS
-static int pix_sum16_mmx(uint8_t * pix, int line_size){
- const int h=16;
- int sum;
- long index= -line_size*h;
-
- __asm __volatile(
- "pxor %%mm7, %%mm7 \n\t"
- "pxor %%mm6, %%mm6 \n\t"
- "1: \n\t"
- "movq (%2, %1), %%mm0 \n\t"
- "movq (%2, %1), %%mm1 \n\t"
- "movq 8(%2, %1), %%mm2 \n\t"
- "movq 8(%2, %1), %%mm3 \n\t"
- "punpcklbw %%mm7, %%mm0 \n\t"
- "punpckhbw %%mm7, %%mm1 \n\t"
- "punpcklbw %%mm7, %%mm2 \n\t"
- "punpckhbw %%mm7, %%mm3 \n\t"
- "paddw %%mm0, %%mm1 \n\t"
- "paddw %%mm2, %%mm3 \n\t"
- "paddw %%mm1, %%mm3 \n\t"
- "paddw %%mm3, %%mm6 \n\t"
- "add %3, %1 \n\t"
- " js 1b \n\t"
- "movq %%mm6, %%mm5 \n\t"
- "psrlq $32, %%mm6 \n\t"
- "paddw %%mm5, %%mm6 \n\t"
- "movq %%mm6, %%mm5 \n\t"
- "psrlq $16, %%mm6 \n\t"
- "paddw %%mm5, %%mm6 \n\t"
- "movd %%mm6, %0 \n\t"
- "andl $0xFFFF, %0 \n\t"
- : "=&r" (sum), "+r" (index)
- : "r" (pix - index), "r" ((long)line_size)
- );
-
- return sum;
-}
-#endif //CONFIG_ENCODERS
-
-static void add_bytes_mmx(uint8_t *dst, uint8_t *src, int w){
- long i=0;
- asm volatile(
- "1: \n\t"
- "movq (%1, %0), %%mm0 \n\t"
- "movq (%2, %0), %%mm1 \n\t"
- "paddb %%mm0, %%mm1 \n\t"
- "movq %%mm1, (%2, %0) \n\t"
- "movq 8(%1, %0), %%mm0 \n\t"
- "movq 8(%2, %0), %%mm1 \n\t"
- "paddb %%mm0, %%mm1 \n\t"
- "movq %%mm1, 8(%2, %0) \n\t"
- "add $16, %0 \n\t"
- "cmp %3, %0 \n\t"
- " jb 1b \n\t"
- : "+r" (i)
- : "r"(src), "r"(dst), "r"((long)w-15)
- );
- for(; i<w; i++)
- dst[i+0] += src[i+0];
-}
-
-#define H263_LOOP_FILTER \
- "pxor %%mm7, %%mm7 \n\t"\
- "movq %0, %%mm0 \n\t"\
- "movq %0, %%mm1 \n\t"\
- "movq %3, %%mm2 \n\t"\
- "movq %3, %%mm3 \n\t"\
- "punpcklbw %%mm7, %%mm0 \n\t"\
- "punpckhbw %%mm7, %%mm1 \n\t"\
- "punpcklbw %%mm7, %%mm2 \n\t"\
- "punpckhbw %%mm7, %%mm3 \n\t"\
- "psubw %%mm2, %%mm0 \n\t"\
- "psubw %%mm3, %%mm1 \n\t"\
- "movq %1, %%mm2 \n\t"\
- "movq %1, %%mm3 \n\t"\
- "movq %2, %%mm4 \n\t"\
- "movq %2, %%mm5 \n\t"\
- "punpcklbw %%mm7, %%mm2 \n\t"\
- "punpckhbw %%mm7, %%mm3 \n\t"\
- "punpcklbw %%mm7, %%mm4 \n\t"\
- "punpckhbw %%mm7, %%mm5 \n\t"\
- "psubw %%mm2, %%mm4 \n\t"\
- "psubw %%mm3, %%mm5 \n\t"\
- "psllw $2, %%mm4 \n\t"\
- "psllw $2, %%mm5 \n\t"\
- "paddw %%mm0, %%mm4 \n\t"\
- "paddw %%mm1, %%mm5 \n\t"\
- "pxor %%mm6, %%mm6 \n\t"\
- "pcmpgtw %%mm4, %%mm6 \n\t"\
- "pcmpgtw %%mm5, %%mm7 \n\t"\
- "pxor %%mm6, %%mm4 \n\t"\
- "pxor %%mm7, %%mm5 \n\t"\
- "psubw %%mm6, %%mm4 \n\t"\
- "psubw %%mm7, %%mm5 \n\t"\
- "psrlw $3, %%mm4 \n\t"\
- "psrlw $3, %%mm5 \n\t"\
- "packuswb %%mm5, %%mm4 \n\t"\
- "packsswb %%mm7, %%mm6 \n\t"\
- "pxor %%mm7, %%mm7 \n\t"\
- "movd %4, %%mm2 \n\t"\
- "punpcklbw %%mm2, %%mm2 \n\t"\
- "punpcklbw %%mm2, %%mm2 \n\t"\
- "punpcklbw %%mm2, %%mm2 \n\t"\
- "psubusb %%mm4, %%mm2 \n\t"\
- "movq %%mm2, %%mm3 \n\t"\
- "psubusb %%mm4, %%mm3 \n\t"\
- "psubb %%mm3, %%mm2 \n\t"\
- "movq %1, %%mm3 \n\t"\
- "movq %2, %%mm4 \n\t"\
- "pxor %%mm6, %%mm3 \n\t"\
- "pxor %%mm6, %%mm4 \n\t"\
- "paddusb %%mm2, %%mm3 \n\t"\
- "psubusb %%mm2, %%mm4 \n\t"\
- "pxor %%mm6, %%mm3 \n\t"\
- "pxor %%mm6, %%mm4 \n\t"\
- "paddusb %%mm2, %%mm2 \n\t"\
- "packsswb %%mm1, %%mm0 \n\t"\
- "pcmpgtb %%mm0, %%mm7 \n\t"\
- "pxor %%mm7, %%mm0 \n\t"\
- "psubb %%mm7, %%mm0 \n\t"\
- "movq %%mm0, %%mm1 \n\t"\
- "psubusb %%mm2, %%mm0 \n\t"\
- "psubb %%mm0, %%mm1 \n\t"\
- "pand %5, %%mm1 \n\t"\
- "psrlw $2, %%mm1 \n\t"\
- "pxor %%mm7, %%mm1 \n\t"\
- "psubb %%mm7, %%mm1 \n\t"\
- "movq %0, %%mm5 \n\t"\
- "movq %3, %%mm6 \n\t"\
- "psubb %%mm1, %%mm5 \n\t"\
- "paddb %%mm1, %%mm6 \n\t"
-
-static void h263_v_loop_filter_mmx(uint8_t *src, int stride, int qscale){
- const int strength= ff_h263_loop_filter_strength[qscale];
-
- asm volatile(
-
- H263_LOOP_FILTER
-
- "movq %%mm3, %1 \n\t"
- "movq %%mm4, %2 \n\t"
- "movq %%mm5, %0 \n\t"
- "movq %%mm6, %3 \n\t"
- : "+m" (*(uint64_t*)(src - 2*stride)),
- "+m" (*(uint64_t*)(src - 1*stride)),
- "+m" (*(uint64_t*)(src + 0*stride)),
- "+m" (*(uint64_t*)(src + 1*stride))
- : "g" (2*strength), "m"(ff_pb_FC)
- );
-}
-
-static inline void transpose4x4(uint8_t *dst, uint8_t *src, int dst_stride, int src_stride){
- asm volatile( //FIXME could save 1 instruction if done as 8x4 ...
- "movd %4, %%mm0 \n\t"
- "movd %5, %%mm1 \n\t"
- "movd %6, %%mm2 \n\t"
- "movd %7, %%mm3 \n\t"
- "punpcklbw %%mm1, %%mm0 \n\t"
- "punpcklbw %%mm3, %%mm2 \n\t"
- "movq %%mm0, %%mm1 \n\t"
- "punpcklwd %%mm2, %%mm0 \n\t"
- "punpckhwd %%mm2, %%mm1 \n\t"
- "movd %%mm0, %0 \n\t"
- "punpckhdq %%mm0, %%mm0 \n\t"
- "movd %%mm0, %1 \n\t"
- "movd %%mm1, %2 \n\t"
- "punpckhdq %%mm1, %%mm1 \n\t"
- "movd %%mm1, %3 \n\t"
-
- : "=m" (*(uint32_t*)(dst + 0*dst_stride)),
- "=m" (*(uint32_t*)(dst + 1*dst_stride)),
- "=m" (*(uint32_t*)(dst + 2*dst_stride)),
- "=m" (*(uint32_t*)(dst + 3*dst_stride))
- : "m" (*(uint32_t*)(src + 0*src_stride)),
- "m" (*(uint32_t*)(src + 1*src_stride)),
- "m" (*(uint32_t*)(src + 2*src_stride)),
- "m" (*(uint32_t*)(src + 3*src_stride))
- );
-}
-
-static void h263_h_loop_filter_mmx(uint8_t *src, int stride, int qscale){
- const int strength= ff_h263_loop_filter_strength[qscale];
- uint64_t temp[4] __attribute__ ((aligned(8)));
- uint8_t *btemp= (uint8_t*)temp;
-
- src -= 2;
-
- transpose4x4(btemp , src , 8, stride);
- transpose4x4(btemp+4, src + 4*stride, 8, stride);
- asm volatile(
- H263_LOOP_FILTER // 5 3 4 6
-
- : "+m" (temp[0]),
- "+m" (temp[1]),
- "+m" (temp[2]),
- "+m" (temp[3])
- : "g" (2*strength), "m"(ff_pb_FC)
- );
-
- asm volatile(
- "movq %%mm5, %%mm1 \n\t"
- "movq %%mm4, %%mm0 \n\t"
- "punpcklbw %%mm3, %%mm5 \n\t"
- "punpcklbw %%mm6, %%mm4 \n\t"
- "punpckhbw %%mm3, %%mm1 \n\t"
- "punpckhbw %%mm6, %%mm0 \n\t"
- "movq %%mm5, %%mm3 \n\t"
- "movq %%mm1, %%mm6 \n\t"
- "punpcklwd %%mm4, %%mm5 \n\t"
- "punpcklwd %%mm0, %%mm1 \n\t"
- "punpckhwd %%mm4, %%mm3 \n\t"
- "punpckhwd %%mm0, %%mm6 \n\t"
- "movd %%mm5, (%0) \n\t"
- "punpckhdq %%mm5, %%mm5 \n\t"
- "movd %%mm5, (%0,%2) \n\t"
- "movd %%mm3, (%0,%2,2) \n\t"
- "punpckhdq %%mm3, %%mm3 \n\t"
- "movd %%mm3, (%0,%3) \n\t"
- "movd %%mm1, (%1) \n\t"
- "punpckhdq %%mm1, %%mm1 \n\t"
- "movd %%mm1, (%1,%2) \n\t"
- "movd %%mm6, (%1,%2,2) \n\t"
- "punpckhdq %%mm6, %%mm6 \n\t"
- "movd %%mm6, (%1,%3) \n\t"
- :: "r" (src),
- "r" (src + 4*stride),
- "r" ((long) stride ),
- "r" ((long)(3*stride))
- );
-}
-
-#ifdef CONFIG_ENCODERS
-static int pix_norm1_mmx(uint8_t *pix, int line_size) {
- int tmp;
- asm volatile (
- "movl $16,%%ecx\n"
- "pxor %%mm0,%%mm0\n"
- "pxor %%mm7,%%mm7\n"
- "1:\n"
- "movq (%0),%%mm2\n" /* mm2 = pix[0-7] */
- "movq 8(%0),%%mm3\n" /* mm3 = pix[8-15] */
-
- "movq %%mm2,%%mm1\n" /* mm1 = mm2 = pix[0-7] */
-
- "punpckhbw %%mm0,%%mm1\n" /* mm1 = [pix4-7] */
- "punpcklbw %%mm0,%%mm2\n" /* mm2 = [pix0-3] */
-
- "movq %%mm3,%%mm4\n" /* mm4 = mm3 = pix[8-15] */
- "punpckhbw %%mm0,%%mm3\n" /* mm3 = [pix12-15] */
- "punpcklbw %%mm0,%%mm4\n" /* mm4 = [pix8-11] */
-
- "pmaddwd %%mm1,%%mm1\n" /* mm1 = (pix0^2+pix1^2,pix2^2+pix3^2) */
- "pmaddwd %%mm2,%%mm2\n" /* mm2 = (pix4^2+pix5^2,pix6^2+pix7^2) */
-
- "pmaddwd %%mm3,%%mm3\n"
- "pmaddwd %%mm4,%%mm4\n"
-
- "paddd %%mm1,%%mm2\n" /* mm2 = (pix0^2+pix1^2+pix4^2+pix5^2,
- pix2^2+pix3^2+pix6^2+pix7^2) */
- "paddd %%mm3,%%mm4\n"
- "paddd %%mm2,%%mm7\n"
-
- "add %2, %0\n"
- "paddd %%mm4,%%mm7\n"
- "dec %%ecx\n"
- "jnz 1b\n"
-
- "movq %%mm7,%%mm1\n"
- "psrlq $32, %%mm7\n" /* shift hi dword to lo */
- "paddd %%mm7,%%mm1\n"
- "movd %%mm1,%1\n"
- : "+r" (pix), "=r"(tmp) : "r" ((long)line_size) : "%ecx" );
- return tmp;
-}
-
-static int sse8_mmx(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h) {
- int tmp;
- asm volatile (
- "movl %4,%%ecx\n"
- "shr $1,%%ecx\n"
- "pxor %%mm0,%%mm0\n" /* mm0 = 0 */
- "pxor %%mm7,%%mm7\n" /* mm7 holds the sum */
- "1:\n"
- "movq (%0),%%mm1\n" /* mm1 = pix1[0][0-7] */
- "movq (%1),%%mm2\n" /* mm2 = pix2[0][0-7] */
- "movq (%0,%3),%%mm3\n" /* mm3 = pix1[1][0-7] */
- "movq (%1,%3),%%mm4\n" /* mm4 = pix2[1][0-7] */
-
- /* todo: mm1-mm2, mm3-mm4 */
- /* algo: substract mm1 from mm2 with saturation and vice versa */
- /* OR the results to get absolute difference */
- "movq %%mm1,%%mm5\n"
- "movq %%mm3,%%mm6\n"
- "psubusb %%mm2,%%mm1\n"
- "psubusb %%mm4,%%mm3\n"
- "psubusb %%mm5,%%mm2\n"
- "psubusb %%mm6,%%mm4\n"
-
- "por %%mm1,%%mm2\n"
- "por %%mm3,%%mm4\n"
-
- /* now convert to 16-bit vectors so we can square them */
- "movq %%mm2,%%mm1\n"
- "movq %%mm4,%%mm3\n"
-
- "punpckhbw %%mm0,%%mm2\n"
- "punpckhbw %%mm0,%%mm4\n"
- "punpcklbw %%mm0,%%mm1\n" /* mm1 now spread over (mm1,mm2) */
- "punpcklbw %%mm0,%%mm3\n" /* mm4 now spread over (mm3,mm4) */
-
- "pmaddwd %%mm2,%%mm2\n"
- "pmaddwd %%mm4,%%mm4\n"
- "pmaddwd %%mm1,%%mm1\n"
- "pmaddwd %%mm3,%%mm3\n"
-
- "lea (%0,%3,2), %0\n" /* pix1 += 2*line_size */
- "lea (%1,%3,2), %1\n" /* pix2 += 2*line_size */
-
- "paddd %%mm2,%%mm1\n"
- "paddd %%mm4,%%mm3\n"
- "paddd %%mm1,%%mm7\n"
- "paddd %%mm3,%%mm7\n"
-
- "decl %%ecx\n"
- "jnz 1b\n"
-
- "movq %%mm7,%%mm1\n"
- "psrlq $32, %%mm7\n" /* shift hi dword to lo */
- "paddd %%mm7,%%mm1\n"
- "movd %%mm1,%2\n"
- : "+r" (pix1), "+r" (pix2), "=r"(tmp)
- : "r" ((long)line_size) , "m" (h)
- : "%ecx");
- return tmp;
-}
-
-static int sse16_mmx(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h) {
- int tmp;
- asm volatile (
- "movl %4,%%ecx\n"
- "pxor %%mm0,%%mm0\n" /* mm0 = 0 */
- "pxor %%mm7,%%mm7\n" /* mm7 holds the sum */
- "1:\n"
- "movq (%0),%%mm1\n" /* mm1 = pix1[0-7] */
- "movq (%1),%%mm2\n" /* mm2 = pix2[0-7] */
- "movq 8(%0),%%mm3\n" /* mm3 = pix1[8-15] */
- "movq 8(%1),%%mm4\n" /* mm4 = pix2[8-15] */
-
- /* todo: mm1-mm2, mm3-mm4 */
- /* algo: substract mm1 from mm2 with saturation and vice versa */
- /* OR the results to get absolute difference */
- "movq %%mm1,%%mm5\n"
- "movq %%mm3,%%mm6\n"
- "psubusb %%mm2,%%mm1\n"
- "psubusb %%mm4,%%mm3\n"
- "psubusb %%mm5,%%mm2\n"
- "psubusb %%mm6,%%mm4\n"
-
- "por %%mm1,%%mm2\n"
- "por %%mm3,%%mm4\n"
-
- /* now convert to 16-bit vectors so we can square them */
- "movq %%mm2,%%mm1\n"
- "movq %%mm4,%%mm3\n"
-
- "punpckhbw %%mm0,%%mm2\n"
- "punpckhbw %%mm0,%%mm4\n"
- "punpcklbw %%mm0,%%mm1\n" /* mm1 now spread over (mm1,mm2) */
- "punpcklbw %%mm0,%%mm3\n" /* mm4 now spread over (mm3,mm4) */
-
- "pmaddwd %%mm2,%%mm2\n"
- "pmaddwd %%mm4,%%mm4\n"
- "pmaddwd %%mm1,%%mm1\n"
- "pmaddwd %%mm3,%%mm3\n"
-
- "add %3,%0\n"
- "add %3,%1\n"
-
- "paddd %%mm2,%%mm1\n"
- "paddd %%mm4,%%mm3\n"
- "paddd %%mm1,%%mm7\n"
- "paddd %%mm3,%%mm7\n"
-
- "decl %%ecx\n"
- "jnz 1b\n"
-
- "movq %%mm7,%%mm1\n"
- "psrlq $32, %%mm7\n" /* shift hi dword to lo */
- "paddd %%mm7,%%mm1\n"
- "movd %%mm1,%2\n"
- : "+r" (pix1), "+r" (pix2), "=r"(tmp)
- : "r" ((long)line_size) , "m" (h)
- : "%ecx");
- return tmp;
-}
-
-static int sse16_sse2(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h) {
- int tmp;
- asm volatile (
- "shr $1,%2\n"
- "pxor %%xmm0,%%xmm0\n" /* mm0 = 0 */
- "pxor %%xmm7,%%xmm7\n" /* mm7 holds the sum */
- "1:\n"
- "movdqu (%0),%%xmm1\n" /* mm1 = pix1[0][0-15] */
- "movdqu (%1),%%xmm2\n" /* mm2 = pix2[0][0-15] */
- "movdqu (%0,%4),%%xmm3\n" /* mm3 = pix1[1][0-15] */
- "movdqu (%1,%4),%%xmm4\n" /* mm4 = pix2[1][0-15] */
-
- /* todo: mm1-mm2, mm3-mm4 */
- /* algo: substract mm1 from mm2 with saturation and vice versa */
- /* OR the results to get absolute difference */
- "movdqa %%xmm1,%%xmm5\n"
- "movdqa %%xmm3,%%xmm6\n"
- "psubusb %%xmm2,%%xmm1\n"
- "psubusb %%xmm4,%%xmm3\n"
- "psubusb %%xmm5,%%xmm2\n"
- "psubusb %%xmm6,%%xmm4\n"
-
- "por %%xmm1,%%xmm2\n"
- "por %%xmm3,%%xmm4\n"
-
- /* now convert to 16-bit vectors so we can square them */
- "movdqa %%xmm2,%%xmm1\n"
- "movdqa %%xmm4,%%xmm3\n"
-
- "punpckhbw %%xmm0,%%xmm2\n"
- "punpckhbw %%xmm0,%%xmm4\n"
- "punpcklbw %%xmm0,%%xmm1\n" /* mm1 now spread over (mm1,mm2) */
- "punpcklbw %%xmm0,%%xmm3\n" /* mm4 now spread over (mm3,mm4) */
-
- "pmaddwd %%xmm2,%%xmm2\n"
- "pmaddwd %%xmm4,%%xmm4\n"
- "pmaddwd %%xmm1,%%xmm1\n"
- "pmaddwd %%xmm3,%%xmm3\n"
-
- "lea (%0,%4,2), %0\n" /* pix1 += 2*line_size */
- "lea (%1,%4,2), %1\n" /* pix2 += 2*line_size */
-
- "paddd %%xmm2,%%xmm1\n"
- "paddd %%xmm4,%%xmm3\n"
- "paddd %%xmm1,%%xmm7\n"
- "paddd %%xmm3,%%xmm7\n"
-
- "decl %2\n"
- "jnz 1b\n"
-
- "movdqa %%xmm7,%%xmm1\n"
- "psrldq $8, %%xmm7\n" /* shift hi qword to lo */
- "paddd %%xmm1,%%xmm7\n"
- "movdqa %%xmm7,%%xmm1\n"
- "psrldq $4, %%xmm7\n" /* shift hi dword to lo */
- "paddd %%xmm1,%%xmm7\n"
- "movd %%xmm7,%3\n"
- : "+r" (pix1), "+r" (pix2), "+r"(h), "=r"(tmp)
- : "r" ((long)line_size));
- return tmp;
-}
-
-static int hf_noise8_mmx(uint8_t * pix1, int line_size, int h) {
- int tmp;
- asm volatile (
- "movl %3,%%ecx\n"
- "pxor %%mm7,%%mm7\n"
- "pxor %%mm6,%%mm6\n"
-
- "movq (%0),%%mm0\n"
- "movq %%mm0, %%mm1\n"
- "psllq $8, %%mm0\n"
- "psrlq $8, %%mm1\n"
- "psrlq $8, %%mm0\n"
- "movq %%mm0, %%mm2\n"
- "movq %%mm1, %%mm3\n"
- "punpcklbw %%mm7,%%mm0\n"
- "punpcklbw %%mm7,%%mm1\n"
- "punpckhbw %%mm7,%%mm2\n"
- "punpckhbw %%mm7,%%mm3\n"
- "psubw %%mm1, %%mm0\n"
- "psubw %%mm3, %%mm2\n"
-
- "add %2,%0\n"
-
- "movq (%0),%%mm4\n"
- "movq %%mm4, %%mm1\n"
- "psllq $8, %%mm4\n"
- "psrlq $8, %%mm1\n"
- "psrlq $8, %%mm4\n"
- "movq %%mm4, %%mm5\n"
- "movq %%mm1, %%mm3\n"
- "punpcklbw %%mm7,%%mm4\n"
- "punpcklbw %%mm7,%%mm1\n"
- "punpckhbw %%mm7,%%mm5\n"
- "punpckhbw %%mm7,%%mm3\n"
- "psubw %%mm1, %%mm4\n"
- "psubw %%mm3, %%mm5\n"
- "psubw %%mm4, %%mm0\n"
- "psubw %%mm5, %%mm2\n"
- "pxor %%mm3, %%mm3\n"
- "pxor %%mm1, %%mm1\n"
- "pcmpgtw %%mm0, %%mm3\n\t"
- "pcmpgtw %%mm2, %%mm1\n\t"
- "pxor %%mm3, %%mm0\n"
- "pxor %%mm1, %%mm2\n"
- "psubw %%mm3, %%mm0\n"
- "psubw %%mm1, %%mm2\n"
- "paddw %%mm0, %%mm2\n"
- "paddw %%mm2, %%mm6\n"
-
- "add %2,%0\n"
- "1:\n"
-
- "movq (%0),%%mm0\n"
- "movq %%mm0, %%mm1\n"
- "psllq $8, %%mm0\n"
- "psrlq $8, %%mm1\n"
- "psrlq $8, %%mm0\n"
- "movq %%mm0, %%mm2\n"
- "movq %%mm1, %%mm3\n"
- "punpcklbw %%mm7,%%mm0\n"
- "punpcklbw %%mm7,%%mm1\n"
- "punpckhbw %%mm7,%%mm2\n"
- "punpckhbw %%mm7,%%mm3\n"
- "psubw %%mm1, %%mm0\n"
- "psubw %%mm3, %%mm2\n"
- "psubw %%mm0, %%mm4\n"
- "psubw %%mm2, %%mm5\n"
- "pxor %%mm3, %%mm3\n"
- "pxor %%mm1, %%mm1\n"
- "pcmpgtw %%mm4, %%mm3\n\t"
- "pcmpgtw %%mm5, %%mm1\n\t"
- "pxor %%mm3, %%mm4\n"
- "pxor %%mm1, %%mm5\n"
- "psubw %%mm3, %%mm4\n"
- "psubw %%mm1, %%mm5\n"
- "paddw %%mm4, %%mm5\n"
- "paddw %%mm5, %%mm6\n"
-
- "add %2,%0\n"
-
- "movq (%0),%%mm4\n"
- "movq %%mm4, %%mm1\n"
- "psllq $8, %%mm4\n"
- "psrlq $8, %%mm1\n"
- "psrlq $8, %%mm4\n"
- "movq %%mm4, %%mm5\n"
- "movq %%mm1, %%mm3\n"
- "punpcklbw %%mm7,%%mm4\n"
- "punpcklbw %%mm7,%%mm1\n"
- "punpckhbw %%mm7,%%mm5\n"
- "punpckhbw %%mm7,%%mm3\n"
- "psubw %%mm1, %%mm4\n"
- "psubw %%mm3, %%mm5\n"
- "psubw %%mm4, %%mm0\n"
- "psubw %%mm5, %%mm2\n"
- "pxor %%mm3, %%mm3\n"
- "pxor %%mm1, %%mm1\n"
- "pcmpgtw %%mm0, %%mm3\n\t"
- "pcmpgtw %%mm2, %%mm1\n\t"
- "pxor %%mm3, %%mm0\n"
- "pxor %%mm1, %%mm2\n"
- "psubw %%mm3, %%mm0\n"
- "psubw %%mm1, %%mm2\n"
- "paddw %%mm0, %%mm2\n"
- "paddw %%mm2, %%mm6\n"
-
- "add %2,%0\n"
- "subl $2, %%ecx\n"
- " jnz 1b\n"
-
- "movq %%mm6, %%mm0\n"
- "punpcklwd %%mm7,%%mm0\n"
- "punpckhwd %%mm7,%%mm6\n"
- "paddd %%mm0, %%mm6\n"
-
- "movq %%mm6,%%mm0\n"
- "psrlq $32, %%mm6\n"
- "paddd %%mm6,%%mm0\n"
- "movd %%mm0,%1\n"
- : "+r" (pix1), "=r"(tmp)
- : "r" ((long)line_size) , "g" (h-2)
- : "%ecx");
- return tmp;
-}
-
-static int hf_noise16_mmx(uint8_t * pix1, int line_size, int h) {
- int tmp;
- uint8_t * pix= pix1;
- asm volatile (
- "movl %3,%%ecx\n"
- "pxor %%mm7,%%mm7\n"
- "pxor %%mm6,%%mm6\n"
-
- "movq (%0),%%mm0\n"
- "movq 1(%0),%%mm1\n"
- "movq %%mm0, %%mm2\n"
- "movq %%mm1, %%mm3\n"
- "punpcklbw %%mm7,%%mm0\n"
- "punpcklbw %%mm7,%%mm1\n"
- "punpckhbw %%mm7,%%mm2\n"
- "punpckhbw %%mm7,%%mm3\n"
- "psubw %%mm1, %%mm0\n"
- "psubw %%mm3, %%mm2\n"
-
- "add %2,%0\n"
-
- "movq (%0),%%mm4\n"
- "movq 1(%0),%%mm1\n"
- "movq %%mm4, %%mm5\n"
- "movq %%mm1, %%mm3\n"
- "punpcklbw %%mm7,%%mm4\n"
- "punpcklbw %%mm7,%%mm1\n"
- "punpckhbw %%mm7,%%mm5\n"
- "punpckhbw %%mm7,%%mm3\n"
- "psubw %%mm1, %%mm4\n"
- "psubw %%mm3, %%mm5\n"
- "psubw %%mm4, %%mm0\n"
- "psubw %%mm5, %%mm2\n"
- "pxor %%mm3, %%mm3\n"
- "pxor %%mm1, %%mm1\n"
- "pcmpgtw %%mm0, %%mm3\n\t"
- "pcmpgtw %%mm2, %%mm1\n\t"
- "pxor %%mm3, %%mm0\n"
- "pxor %%mm1, %%mm2\n"
- "psubw %%mm3, %%mm0\n"
- "psubw %%mm1, %%mm2\n"
- "paddw %%mm0, %%mm2\n"
- "paddw %%mm2, %%mm6\n"
-
- "add %2,%0\n"
- "1:\n"
-
- "movq (%0),%%mm0\n"
- "movq 1(%0),%%mm1\n"
- "movq %%mm0, %%mm2\n"
- "movq %%mm1, %%mm3\n"
- "punpcklbw %%mm7,%%mm0\n"
- "punpcklbw %%mm7,%%mm1\n"
- "punpckhbw %%mm7,%%mm2\n"
- "punpckhbw %%mm7,%%mm3\n"
- "psubw %%mm1, %%mm0\n"
- "psubw %%mm3, %%mm2\n"
- "psubw %%mm0, %%mm4\n"
- "psubw %%mm2, %%mm5\n"
- "pxor %%mm3, %%mm3\n"
- "pxor %%mm1, %%mm1\n"
- "pcmpgtw %%mm4, %%mm3\n\t"
- "pcmpgtw %%mm5, %%mm1\n\t"
- "pxor %%mm3, %%mm4\n"
- "pxor %%mm1, %%mm5\n"
- "psubw %%mm3, %%mm4\n"
- "psubw %%mm1, %%mm5\n"
- "paddw %%mm4, %%mm5\n"
- "paddw %%mm5, %%mm6\n"
-
- "add %2,%0\n"
-
- "movq (%0),%%mm4\n"
- "movq 1(%0),%%mm1\n"
- "movq %%mm4, %%mm5\n"
- "movq %%mm1, %%mm3\n"
- "punpcklbw %%mm7,%%mm4\n"
- "punpcklbw %%mm7,%%mm1\n"
- "punpckhbw %%mm7,%%mm5\n"
- "punpckhbw %%mm7,%%mm3\n"
- "psubw %%mm1, %%mm4\n"
- "psubw %%mm3, %%mm5\n"
- "psubw %%mm4, %%mm0\n"
- "psubw %%mm5, %%mm2\n"
- "pxor %%mm3, %%mm3\n"
- "pxor %%mm1, %%mm1\n"
- "pcmpgtw %%mm0, %%mm3\n\t"
- "pcmpgtw %%mm2, %%mm1\n\t"
- "pxor %%mm3, %%mm0\n"
- "pxor %%mm1, %%mm2\n"
- "psubw %%mm3, %%mm0\n"
- "psubw %%mm1, %%mm2\n"
- "paddw %%mm0, %%mm2\n"
- "paddw %%mm2, %%mm6\n"
-
- "add %2,%0\n"
- "subl $2, %%ecx\n"
- " jnz 1b\n"
-
- "movq %%mm6, %%mm0\n"
- "punpcklwd %%mm7,%%mm0\n"
- "punpckhwd %%mm7,%%mm6\n"
- "paddd %%mm0, %%mm6\n"
-
- "movq %%mm6,%%mm0\n"
- "psrlq $32, %%mm6\n"
- "paddd %%mm6,%%mm0\n"
- "movd %%mm0,%1\n"
- : "+r" (pix1), "=r"(tmp)
- : "r" ((long)line_size) , "g" (h-2)
- : "%ecx");
- return tmp + hf_noise8_mmx(pix+8, line_size, h);
-}
-
-static int nsse16_mmx(void *p, uint8_t * pix1, uint8_t * pix2, int line_size, int h) {
- MpegEncContext *c = p;
- int score1, score2;
-
- if(c) score1 = c->dsp.sse[0](c, pix1, pix2, line_size, h);
- else score1 = sse16_mmx(c, pix1, pix2, line_size, h);
- score2= hf_noise16_mmx(pix1, line_size, h) - hf_noise16_mmx(pix2, line_size, h);
-
- if(c) return score1 + FFABS(score2)*c->avctx->nsse_weight;
- else return score1 + FFABS(score2)*8;
-}
-
-static int nsse8_mmx(void *p, uint8_t * pix1, uint8_t * pix2, int line_size, int h) {
- MpegEncContext *c = p;
- int score1= sse8_mmx(c, pix1, pix2, line_size, h);
- int score2= hf_noise8_mmx(pix1, line_size, h) - hf_noise8_mmx(pix2, line_size, h);
-
- if(c) return score1 + FFABS(score2)*c->avctx->nsse_weight;
- else return score1 + FFABS(score2)*8;
-}
-
-static int vsad_intra16_mmx(void *v, uint8_t * pix, uint8_t * dummy, int line_size, int h) {
- int tmp;
-
- assert( (((int)pix) & 7) == 0);
- assert((line_size &7) ==0);
-
-#define SUM(in0, in1, out0, out1) \
- "movq (%0), %%mm2\n"\
- "movq 8(%0), %%mm3\n"\
- "add %2,%0\n"\
- "movq %%mm2, " #out0 "\n"\
- "movq %%mm3, " #out1 "\n"\
- "psubusb " #in0 ", %%mm2\n"\
- "psubusb " #in1 ", %%mm3\n"\
- "psubusb " #out0 ", " #in0 "\n"\
- "psubusb " #out1 ", " #in1 "\n"\
- "por %%mm2, " #in0 "\n"\
- "por %%mm3, " #in1 "\n"\
- "movq " #in0 ", %%mm2\n"\
- "movq " #in1 ", %%mm3\n"\
- "punpcklbw %%mm7, " #in0 "\n"\
- "punpcklbw %%mm7, " #in1 "\n"\
- "punpckhbw %%mm7, %%mm2\n"\
- "punpckhbw %%mm7, %%mm3\n"\
- "paddw " #in1 ", " #in0 "\n"\
- "paddw %%mm3, %%mm2\n"\
- "paddw %%mm2, " #in0 "\n"\
- "paddw " #in0 ", %%mm6\n"
-
-
- asm volatile (
- "movl %3,%%ecx\n"
- "pxor %%mm6,%%mm6\n"
- "pxor %%mm7,%%mm7\n"
- "movq (%0),%%mm0\n"
- "movq 8(%0),%%mm1\n"
- "add %2,%0\n"
- "subl $2, %%ecx\n"
- SUM(%%mm0, %%mm1, %%mm4, %%mm5)
- "1:\n"
-
- SUM(%%mm4, %%mm5, %%mm0, %%mm1)
-
- SUM(%%mm0, %%mm1, %%mm4, %%mm5)
-
- "subl $2, %%ecx\n"
- "jnz 1b\n"
-
- "movq %%mm6,%%mm0\n"
- "psrlq $32, %%mm6\n"
- "paddw %%mm6,%%mm0\n"
- "movq %%mm0,%%mm6\n"
- "psrlq $16, %%mm0\n"
- "paddw %%mm6,%%mm0\n"
- "movd %%mm0,%1\n"
- : "+r" (pix), "=r"(tmp)
- : "r" ((long)line_size) , "m" (h)
- : "%ecx");
- return tmp & 0xFFFF;
-}
-#undef SUM
-
-static int vsad_intra16_mmx2(void *v, uint8_t * pix, uint8_t * dummy, int line_size, int h) {
- int tmp;
-
- assert( (((int)pix) & 7) == 0);
- assert((line_size &7) ==0);
-
-#define SUM(in0, in1, out0, out1) \
- "movq (%0), " #out0 "\n"\
- "movq 8(%0), " #out1 "\n"\
- "add %2,%0\n"\
- "psadbw " #out0 ", " #in0 "\n"\
- "psadbw " #out1 ", " #in1 "\n"\
- "paddw " #in1 ", " #in0 "\n"\
- "paddw " #in0 ", %%mm6\n"
-
- asm volatile (
- "movl %3,%%ecx\n"
- "pxor %%mm6,%%mm6\n"
- "pxor %%mm7,%%mm7\n"
- "movq (%0),%%mm0\n"
- "movq 8(%0),%%mm1\n"
- "add %2,%0\n"
- "subl $2, %%ecx\n"
- SUM(%%mm0, %%mm1, %%mm4, %%mm5)
- "1:\n"
-
- SUM(%%mm4, %%mm5, %%mm0, %%mm1)
-
- SUM(%%mm0, %%mm1, %%mm4, %%mm5)
-
- "subl $2, %%ecx\n"
- "jnz 1b\n"
-
- "movd %%mm6,%1\n"
- : "+r" (pix), "=r"(tmp)
- : "r" ((long)line_size) , "m" (h)
- : "%ecx");
- return tmp;
-}
-#undef SUM
-
-static int vsad16_mmx(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h) {
- int tmp;
-
- assert( (((int)pix1) & 7) == 0);
- assert( (((int)pix2) & 7) == 0);
- assert((line_size &7) ==0);
-
-#define SUM(in0, in1, out0, out1) \
- "movq (%0),%%mm2\n"\
- "movq (%1)," #out0 "\n"\
- "movq 8(%0),%%mm3\n"\
- "movq 8(%1)," #out1 "\n"\
- "add %3,%0\n"\
- "add %3,%1\n"\
- "psubb " #out0 ", %%mm2\n"\
- "psubb " #out1 ", %%mm3\n"\
- "pxor %%mm7, %%mm2\n"\
- "pxor %%mm7, %%mm3\n"\
- "movq %%mm2, " #out0 "\n"\
- "movq %%mm3, " #out1 "\n"\
- "psubusb " #in0 ", %%mm2\n"\
- "psubusb " #in1 ", %%mm3\n"\
- "psubusb " #out0 ", " #in0 "\n"\
- "psubusb " #out1 ", " #in1 "\n"\
- "por %%mm2, " #in0 "\n"\
- "por %%mm3, " #in1 "\n"\
- "movq " #in0 ", %%mm2\n"\
- "movq " #in1 ", %%mm3\n"\
- "punpcklbw %%mm7, " #in0 "\n"\
- "punpcklbw %%mm7, " #in1 "\n"\
- "punpckhbw %%mm7, %%mm2\n"\
- "punpckhbw %%mm7, %%mm3\n"\
- "paddw " #in1 ", " #in0 "\n"\
- "paddw %%mm3, %%mm2\n"\
- "paddw %%mm2, " #in0 "\n"\
- "paddw " #in0 ", %%mm6\n"
-
-
- asm volatile (
- "movl %4,%%ecx\n"
- "pxor %%mm6,%%mm6\n"
- "pcmpeqw %%mm7,%%mm7\n"
- "psllw $15, %%mm7\n"
- "packsswb %%mm7, %%mm7\n"
- "movq (%0),%%mm0\n"
- "movq (%1),%%mm2\n"
- "movq 8(%0),%%mm1\n"
- "movq 8(%1),%%mm3\n"
- "add %3,%0\n"
- "add %3,%1\n"
- "subl $2, %%ecx\n"
- "psubb %%mm2, %%mm0\n"
- "psubb %%mm3, %%mm1\n"
- "pxor %%mm7, %%mm0\n"
- "pxor %%mm7, %%mm1\n"
- SUM(%%mm0, %%mm1, %%mm4, %%mm5)
- "1:\n"
-
- SUM(%%mm4, %%mm5, %%mm0, %%mm1)
-
- SUM(%%mm0, %%mm1, %%mm4, %%mm5)
-
- "subl $2, %%ecx\n"
- "jnz 1b\n"
-
- "movq %%mm6,%%mm0\n"
- "psrlq $32, %%mm6\n"
- "paddw %%mm6,%%mm0\n"
- "movq %%mm0,%%mm6\n"
- "psrlq $16, %%mm0\n"
- "paddw %%mm6,%%mm0\n"
- "movd %%mm0,%2\n"
- : "+r" (pix1), "+r" (pix2), "=r"(tmp)
- : "r" ((long)line_size) , "m" (h)
- : "%ecx");
- return tmp & 0x7FFF;
-}
-#undef SUM
-
-static int vsad16_mmx2(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h) {
- int tmp;
-
- assert( (((int)pix1) & 7) == 0);
- assert( (((int)pix2) & 7) == 0);
- assert((line_size &7) ==0);
-
-#define SUM(in0, in1, out0, out1) \
- "movq (%0)," #out0 "\n"\
- "movq (%1),%%mm2\n"\
- "movq 8(%0)," #out1 "\n"\
- "movq 8(%1),%%mm3\n"\
- "add %3,%0\n"\
- "add %3,%1\n"\
- "psubb %%mm2, " #out0 "\n"\
- "psubb %%mm3, " #out1 "\n"\
- "pxor %%mm7, " #out0 "\n"\
- "pxor %%mm7, " #out1 "\n"\
- "psadbw " #out0 ", " #in0 "\n"\
- "psadbw " #out1 ", " #in1 "\n"\
- "paddw " #in1 ", " #in0 "\n"\
- "paddw " #in0 ", %%mm6\n"
-
- asm volatile (
- "movl %4,%%ecx\n"
- "pxor %%mm6,%%mm6\n"
- "pcmpeqw %%mm7,%%mm7\n"
- "psllw $15, %%mm7\n"
- "packsswb %%mm7, %%mm7\n"
- "movq (%0),%%mm0\n"
- "movq (%1),%%mm2\n"
- "movq 8(%0),%%mm1\n"
- "movq 8(%1),%%mm3\n"
- "add %3,%0\n"
- "add %3,%1\n"
- "subl $2, %%ecx\n"
- "psubb %%mm2, %%mm0\n"
- "psubb %%mm3, %%mm1\n"
- "pxor %%mm7, %%mm0\n"
- "pxor %%mm7, %%mm1\n"
- SUM(%%mm0, %%mm1, %%mm4, %%mm5)
- "1:\n"
-
- SUM(%%mm4, %%mm5, %%mm0, %%mm1)
-
- SUM(%%mm0, %%mm1, %%mm4, %%mm5)
-
- "subl $2, %%ecx\n"
- "jnz 1b\n"
-
- "movd %%mm6,%2\n"
- : "+r" (pix1), "+r" (pix2), "=r"(tmp)
- : "r" ((long)line_size) , "m" (h)
- : "%ecx");
- return tmp;
-}
-#undef SUM
-
-static void diff_bytes_mmx(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w){
- long i=0;
- asm volatile(
- "1: \n\t"
- "movq (%2, %0), %%mm0 \n\t"
- "movq (%1, %0), %%mm1 \n\t"
- "psubb %%mm0, %%mm1 \n\t"
- "movq %%mm1, (%3, %0) \n\t"
- "movq 8(%2, %0), %%mm0 \n\t"
- "movq 8(%1, %0), %%mm1 \n\t"
- "psubb %%mm0, %%mm1 \n\t"
- "movq %%mm1, 8(%3, %0) \n\t"
- "add $16, %0 \n\t"
- "cmp %4, %0 \n\t"
- " jb 1b \n\t"
- : "+r" (i)
- : "r"(src1), "r"(src2), "r"(dst), "r"((long)w-15)
- );
- for(; i<w; i++)
- dst[i+0] = src1[i+0]-src2[i+0];
-}
-
-static void sub_hfyu_median_prediction_mmx2(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w, int *left, int *left_top){
- long i=0;
- uint8_t l, lt;
-
- asm volatile(
- "1: \n\t"
- "movq -1(%1, %0), %%mm0 \n\t" // LT
- "movq (%1, %0), %%mm1 \n\t" // T
- "movq -1(%2, %0), %%mm2 \n\t" // L
- "movq (%2, %0), %%mm3 \n\t" // X
- "movq %%mm2, %%mm4 \n\t" // L
- "psubb %%mm0, %%mm2 \n\t"
- "paddb %%mm1, %%mm2 \n\t" // L + T - LT
- "movq %%mm4, %%mm5 \n\t" // L
- "pmaxub %%mm1, %%mm4 \n\t" // max(T, L)
- "pminub %%mm5, %%mm1 \n\t" // min(T, L)
- "pminub %%mm2, %%mm4 \n\t"
- "pmaxub %%mm1, %%mm4 \n\t"
- "psubb %%mm4, %%mm3 \n\t" // dst - pred
- "movq %%mm3, (%3, %0) \n\t"
- "add $8, %0 \n\t"
- "cmp %4, %0 \n\t"
- " jb 1b \n\t"
- : "+r" (i)
- : "r"(src1), "r"(src2), "r"(dst), "r"((long)w)
- );
-
- l= *left;
- lt= *left_top;
-
- dst[0]= src2[0] - mid_pred(l, src1[0], (l + src1[0] - lt)&0xFF);
-
- *left_top= src1[w-1];
- *left = src2[w-1];
-}
-
-#define LBUTTERFLY2(a1,b1,a2,b2)\
- "paddw " #b1 ", " #a1 " \n\t"\
- "paddw " #b2 ", " #a2 " \n\t"\
- "paddw " #b1 ", " #b1 " \n\t"\
- "paddw " #b2 ", " #b2 " \n\t"\
- "psubw " #a1 ", " #b1 " \n\t"\
- "psubw " #a2 ", " #b2 " \n\t"
-
-#define HADAMARD48\
- LBUTTERFLY2(%%mm0, %%mm1, %%mm2, %%mm3)\
- LBUTTERFLY2(%%mm4, %%mm5, %%mm6, %%mm7)\
- LBUTTERFLY2(%%mm0, %%mm2, %%mm1, %%mm3)\
- LBUTTERFLY2(%%mm4, %%mm6, %%mm5, %%mm7)\
- LBUTTERFLY2(%%mm0, %%mm4, %%mm1, %%mm5)\
- LBUTTERFLY2(%%mm2, %%mm6, %%mm3, %%mm7)\
-
-#define MMABS(a,z)\
- "pxor " #z ", " #z " \n\t"\
- "pcmpgtw " #a ", " #z " \n\t"\
- "pxor " #z ", " #a " \n\t"\
- "psubw " #z ", " #a " \n\t"
-
-#define MMABS_SUM(a,z, sum)\
- "pxor " #z ", " #z " \n\t"\
- "pcmpgtw " #a ", " #z " \n\t"\
- "pxor " #z ", " #a " \n\t"\
- "psubw " #z ", " #a " \n\t"\
- "paddusw " #a ", " #sum " \n\t"
-
-#define MMABS_MMX2(a,z)\
- "pxor " #z ", " #z " \n\t"\
- "psubw " #a ", " #z " \n\t"\
- "pmaxsw " #z ", " #a " \n\t"
-
-#define MMABS_SUM_MMX2(a,z, sum)\
- "pxor " #z ", " #z " \n\t"\
- "psubw " #a ", " #z " \n\t"\
- "pmaxsw " #z ", " #a " \n\t"\
- "paddusw " #a ", " #sum " \n\t"
-
-#define TRANSPOSE4(a,b,c,d,t)\
- SBUTTERFLY(a,b,t,wd) /* a=aebf t=cgdh */\
- SBUTTERFLY(c,d,b,wd) /* c=imjn b=kolp */\
- SBUTTERFLY(a,c,d,dq) /* a=aeim d=bfjn */\
- SBUTTERFLY(t,b,c,dq) /* t=cgko c=dhlp */
-
-#define LOAD4(o, a, b, c, d)\
- "movq "#o"(%1), " #a " \n\t"\
- "movq "#o"+16(%1), " #b " \n\t"\
- "movq "#o"+32(%1), " #c " \n\t"\
- "movq "#o"+48(%1), " #d " \n\t"
-
-#define STORE4(o, a, b, c, d)\
- "movq "#a", "#o"(%1) \n\t"\
- "movq "#b", "#o"+16(%1) \n\t"\
- "movq "#c", "#o"+32(%1) \n\t"\
- "movq "#d", "#o"+48(%1) \n\t"\
-
-static int hadamard8_diff_mmx(void *s, uint8_t *src1, uint8_t *src2, int stride, int h){
- DECLARE_ALIGNED_8(uint64_t, temp[16]);
- int sum=0;
-
- assert(h==8);
-
- diff_pixels_mmx((DCTELEM*)temp, src1, src2, stride);
-
- asm volatile(
- LOAD4(0 , %%mm0, %%mm1, %%mm2, %%mm3)
- LOAD4(64, %%mm4, %%mm5, %%mm6, %%mm7)
-
- HADAMARD48
-
- "movq %%mm7, 112(%1) \n\t"
-
- TRANSPOSE4(%%mm0, %%mm1, %%mm2, %%mm3, %%mm7)
- STORE4(0 , %%mm0, %%mm3, %%mm7, %%mm2)
-
- "movq 112(%1), %%mm7 \n\t"
- TRANSPOSE4(%%mm4, %%mm5, %%mm6, %%mm7, %%mm0)
- STORE4(64, %%mm4, %%mm7, %%mm0, %%mm6)
-
- LOAD4(8 , %%mm0, %%mm1, %%mm2, %%mm3)
- LOAD4(72, %%mm4, %%mm5, %%mm6, %%mm7)
-
- HADAMARD48
-
- "movq %%mm7, 120(%1) \n\t"
-
- TRANSPOSE4(%%mm0, %%mm1, %%mm2, %%mm3, %%mm7)
- STORE4(8 , %%mm0, %%mm3, %%mm7, %%mm2)
-
- "movq 120(%1), %%mm7 \n\t"
- TRANSPOSE4(%%mm4, %%mm5, %%mm6, %%mm7, %%mm0)
- "movq %%mm7, %%mm5 \n\t"//FIXME remove
- "movq %%mm6, %%mm7 \n\t"
- "movq %%mm0, %%mm6 \n\t"
-// STORE4(72, %%mm4, %%mm7, %%mm0, %%mm6) //FIXME remove
-
- LOAD4(64, %%mm0, %%mm1, %%mm2, %%mm3)
-// LOAD4(72, %%mm4, %%mm5, %%mm6, %%mm7)
-
- HADAMARD48
- "movq %%mm7, 64(%1) \n\t"
- MMABS(%%mm0, %%mm7)
- MMABS_SUM(%%mm1, %%mm7, %%mm0)
- MMABS_SUM(%%mm2, %%mm7, %%mm0)
- MMABS_SUM(%%mm3, %%mm7, %%mm0)
- MMABS_SUM(%%mm4, %%mm7, %%mm0)
- MMABS_SUM(%%mm5, %%mm7, %%mm0)
- MMABS_SUM(%%mm6, %%mm7, %%mm0)
- "movq 64(%1), %%mm1 \n\t"
- MMABS_SUM(%%mm1, %%mm7, %%mm0)
- "movq %%mm0, 64(%1) \n\t"
-
- LOAD4(0 , %%mm0, %%mm1, %%mm2, %%mm3)
- LOAD4(8 , %%mm4, %%mm5, %%mm6, %%mm7)
-
- HADAMARD48
- "movq %%mm7, (%1) \n\t"
- MMABS(%%mm0, %%mm7)
- MMABS_SUM(%%mm1, %%mm7, %%mm0)
- MMABS_SUM(%%mm2, %%mm7, %%mm0)
- MMABS_SUM(%%mm3, %%mm7, %%mm0)
- MMABS_SUM(%%mm4, %%mm7, %%mm0)
- MMABS_SUM(%%mm5, %%mm7, %%mm0)
- MMABS_SUM(%%mm6, %%mm7, %%mm0)
- "movq (%1), %%mm1 \n\t"
- MMABS_SUM(%%mm1, %%mm7, %%mm0)
- "movq 64(%1), %%mm1 \n\t"
- MMABS_SUM(%%mm1, %%mm7, %%mm0)
-
- "movq %%mm0, %%mm1 \n\t"
- "psrlq $32, %%mm0 \n\t"
- "paddusw %%mm1, %%mm0 \n\t"
- "movq %%mm0, %%mm1 \n\t"
- "psrlq $16, %%mm0 \n\t"
- "paddusw %%mm1, %%mm0 \n\t"
- "movd %%mm0, %0 \n\t"
-
- : "=r" (sum)
- : "r"(temp)
- );
- return sum&0xFFFF;
-}
-
-static int hadamard8_diff_mmx2(void *s, uint8_t *src1, uint8_t *src2, int stride, int h){
- DECLARE_ALIGNED_8(uint64_t, temp[16]);
- int sum=0;
-
- assert(h==8);
-
- diff_pixels_mmx((DCTELEM*)temp, src1, src2, stride);
-
- asm volatile(
- LOAD4(0 , %%mm0, %%mm1, %%mm2, %%mm3)
- LOAD4(64, %%mm4, %%mm5, %%mm6, %%mm7)
-
- HADAMARD48
-
- "movq %%mm7, 112(%1) \n\t"
-
- TRANSPOSE4(%%mm0, %%mm1, %%mm2, %%mm3, %%mm7)
- STORE4(0 , %%mm0, %%mm3, %%mm7, %%mm2)
-
- "movq 112(%1), %%mm7 \n\t"
- TRANSPOSE4(%%mm4, %%mm5, %%mm6, %%mm7, %%mm0)
- STORE4(64, %%mm4, %%mm7, %%mm0, %%mm6)
-
- LOAD4(8 , %%mm0, %%mm1, %%mm2, %%mm3)
- LOAD4(72, %%mm4, %%mm5, %%mm6, %%mm7)
-
- HADAMARD48
-
- "movq %%mm7, 120(%1) \n\t"
-
- TRANSPOSE4(%%mm0, %%mm1, %%mm2, %%mm3, %%mm7)
- STORE4(8 , %%mm0, %%mm3, %%mm7, %%mm2)
-
- "movq 120(%1), %%mm7 \n\t"
- TRANSPOSE4(%%mm4, %%mm5, %%mm6, %%mm7, %%mm0)
- "movq %%mm7, %%mm5 \n\t"//FIXME remove
- "movq %%mm6, %%mm7 \n\t"
- "movq %%mm0, %%mm6 \n\t"
-// STORE4(72, %%mm4, %%mm7, %%mm0, %%mm6) //FIXME remove
-
- LOAD4(64, %%mm0, %%mm1, %%mm2, %%mm3)
-// LOAD4(72, %%mm4, %%mm5, %%mm6, %%mm7)
-
- HADAMARD48
- "movq %%mm7, 64(%1) \n\t"
- MMABS_MMX2(%%mm0, %%mm7)
- MMABS_SUM_MMX2(%%mm1, %%mm7, %%mm0)
- MMABS_SUM_MMX2(%%mm2, %%mm7, %%mm0)
- MMABS_SUM_MMX2(%%mm3, %%mm7, %%mm0)
- MMABS_SUM_MMX2(%%mm4, %%mm7, %%mm0)
- MMABS_SUM_MMX2(%%mm5, %%mm7, %%mm0)
- MMABS_SUM_MMX2(%%mm6, %%mm7, %%mm0)
- "movq 64(%1), %%mm1 \n\t"
- MMABS_SUM_MMX2(%%mm1, %%mm7, %%mm0)
- "movq %%mm0, 64(%1) \n\t"
-
- LOAD4(0 , %%mm0, %%mm1, %%mm2, %%mm3)
- LOAD4(8 , %%mm4, %%mm5, %%mm6, %%mm7)
-
- HADAMARD48
- "movq %%mm7, (%1) \n\t"
- MMABS_MMX2(%%mm0, %%mm7)
- MMABS_SUM_MMX2(%%mm1, %%mm7, %%mm0)
- MMABS_SUM_MMX2(%%mm2, %%mm7, %%mm0)
- MMABS_SUM_MMX2(%%mm3, %%mm7, %%mm0)
- MMABS_SUM_MMX2(%%mm4, %%mm7, %%mm0)
- MMABS_SUM_MMX2(%%mm5, %%mm7, %%mm0)
- MMABS_SUM_MMX2(%%mm6, %%mm7, %%mm0)
- "movq (%1), %%mm1 \n\t"
- MMABS_SUM_MMX2(%%mm1, %%mm7, %%mm0)
- "movq 64(%1), %%mm1 \n\t"
- MMABS_SUM_MMX2(%%mm1, %%mm7, %%mm0)
-
- "pshufw $0x0E, %%mm0, %%mm1 \n\t"
- "paddusw %%mm1, %%mm0 \n\t"
- "pshufw $0x01, %%mm0, %%mm1 \n\t"
- "paddusw %%mm1, %%mm0 \n\t"
- "movd %%mm0, %0 \n\t"
-
- : "=r" (sum)
- : "r"(temp)
- );
- return sum&0xFFFF;
-}
-
-
-WARPER8_16_SQ(hadamard8_diff_mmx, hadamard8_diff16_mmx)
-WARPER8_16_SQ(hadamard8_diff_mmx2, hadamard8_diff16_mmx2)
-#endif //CONFIG_ENCODERS
-
-#define put_no_rnd_pixels8_mmx(a,b,c,d) put_pixels8_mmx(a,b,c,d)
-#define put_no_rnd_pixels16_mmx(a,b,c,d) put_pixels16_mmx(a,b,c,d)
-
-#define QPEL_V_LOW(m3,m4,m5,m6, pw_20, pw_3, rnd, in0, in1, in2, in7, out, OP)\
- "paddw " #m4 ", " #m3 " \n\t" /* x1 */\
- "movq "MANGLE(ff_pw_20)", %%mm4 \n\t" /* 20 */\
- "pmullw " #m3 ", %%mm4 \n\t" /* 20x1 */\
- "movq "#in7", " #m3 " \n\t" /* d */\
- "movq "#in0", %%mm5 \n\t" /* D */\
- "paddw " #m3 ", %%mm5 \n\t" /* x4 */\
- "psubw %%mm5, %%mm4 \n\t" /* 20x1 - x4 */\
- "movq "#in1", %%mm5 \n\t" /* C */\
- "movq "#in2", %%mm6 \n\t" /* B */\
- "paddw " #m6 ", %%mm5 \n\t" /* x3 */\
- "paddw " #m5 ", %%mm6 \n\t" /* x2 */\
- "paddw %%mm6, %%mm6 \n\t" /* 2x2 */\
- "psubw %%mm6, %%mm5 \n\t" /* -2x2 + x3 */\
- "pmullw "MANGLE(ff_pw_3)", %%mm5 \n\t" /* -6x2 + 3x3 */\
- "paddw " #rnd ", %%mm4 \n\t" /* x2 */\
- "paddw %%mm4, %%mm5 \n\t" /* 20x1 - 6x2 + 3x3 - x4 */\
- "psraw $5, %%mm5 \n\t"\
- "packuswb %%mm5, %%mm5 \n\t"\
- OP(%%mm5, out, %%mm7, d)
-
-#define QPEL_BASE(OPNAME, ROUNDER, RND, OP_MMX2, OP_3DNOW)\
-static void OPNAME ## mpeg4_qpel16_h_lowpass_mmx2(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\
- uint64_t temp;\
-\
- asm volatile(\
- "pxor %%mm7, %%mm7 \n\t"\
- "1: \n\t"\
- "movq (%0), %%mm0 \n\t" /* ABCDEFGH */\
- "movq %%mm0, %%mm1 \n\t" /* ABCDEFGH */\
- "movq %%mm0, %%mm2 \n\t" /* ABCDEFGH */\
- "punpcklbw %%mm7, %%mm0 \n\t" /* 0A0B0C0D */\
- "punpckhbw %%mm7, %%mm1 \n\t" /* 0E0F0G0H */\
- "pshufw $0x90, %%mm0, %%mm5 \n\t" /* 0A0A0B0C */\
- "pshufw $0x41, %%mm0, %%mm6 \n\t" /* 0B0A0A0B */\
- "movq %%mm2, %%mm3 \n\t" /* ABCDEFGH */\
- "movq %%mm2, %%mm4 \n\t" /* ABCDEFGH */\
- "psllq $8, %%mm2 \n\t" /* 0ABCDEFG */\
- "psllq $16, %%mm3 \n\t" /* 00ABCDEF */\
- "psllq $24, %%mm4 \n\t" /* 000ABCDE */\
- "punpckhbw %%mm7, %%mm2 \n\t" /* 0D0E0F0G */\
- "punpckhbw %%mm7, %%mm3 \n\t" /* 0C0D0E0F */\
- "punpckhbw %%mm7, %%mm4 \n\t" /* 0B0C0D0E */\
- "paddw %%mm3, %%mm5 \n\t" /* b */\
- "paddw %%mm2, %%mm6 \n\t" /* c */\
- "paddw %%mm5, %%mm5 \n\t" /* 2b */\
- "psubw %%mm5, %%mm6 \n\t" /* c - 2b */\
- "pshufw $0x06, %%mm0, %%mm5 \n\t" /* 0C0B0A0A */\
- "pmullw "MANGLE(ff_pw_3)", %%mm6 \n\t" /* 3c - 6b */\
- "paddw %%mm4, %%mm0 \n\t" /* a */\
- "paddw %%mm1, %%mm5 \n\t" /* d */\
- "pmullw "MANGLE(ff_pw_20)", %%mm0 \n\t" /* 20a */\
- "psubw %%mm5, %%mm0 \n\t" /* 20a - d */\
- "paddw %6, %%mm6 \n\t"\
- "paddw %%mm6, %%mm0 \n\t" /* 20a - 6b + 3c - d */\
- "psraw $5, %%mm0 \n\t"\
- "movq %%mm0, %5 \n\t"\
- /* mm1=EFGH, mm2=DEFG, mm3=CDEF, mm4=BCDE, mm7=0 */\
- \
- "movq 5(%0), %%mm0 \n\t" /* FGHIJKLM */\
- "movq %%mm0, %%mm5 \n\t" /* FGHIJKLM */\
- "movq %%mm0, %%mm6 \n\t" /* FGHIJKLM */\
- "psrlq $8, %%mm0 \n\t" /* GHIJKLM0 */\
- "psrlq $16, %%mm5 \n\t" /* HIJKLM00 */\
- "punpcklbw %%mm7, %%mm0 \n\t" /* 0G0H0I0J */\
- "punpcklbw %%mm7, %%mm5 \n\t" /* 0H0I0J0K */\
- "paddw %%mm0, %%mm2 \n\t" /* b */\
- "paddw %%mm5, %%mm3 \n\t" /* c */\
- "paddw %%mm2, %%mm2 \n\t" /* 2b */\
- "psubw %%mm2, %%mm3 \n\t" /* c - 2b */\
- "movq %%mm6, %%mm2 \n\t" /* FGHIJKLM */\
- "psrlq $24, %%mm6 \n\t" /* IJKLM000 */\
- "punpcklbw %%mm7, %%mm2 \n\t" /* 0F0G0H0I */\
- "punpcklbw %%mm7, %%mm6 \n\t" /* 0I0J0K0L */\
- "pmullw "MANGLE(ff_pw_3)", %%mm3 \n\t" /* 3c - 6b */\
- "paddw %%mm2, %%mm1 \n\t" /* a */\
- "paddw %%mm6, %%mm4 \n\t" /* d */\
- "pmullw "MANGLE(ff_pw_20)", %%mm1 \n\t" /* 20a */\
- "psubw %%mm4, %%mm3 \n\t" /* - 6b +3c - d */\
- "paddw %6, %%mm1 \n\t"\
- "paddw %%mm1, %%mm3 \n\t" /* 20a - 6b +3c - d */\
- "psraw $5, %%mm3 \n\t"\
- "movq %5, %%mm1 \n\t"\
- "packuswb %%mm3, %%mm1 \n\t"\
- OP_MMX2(%%mm1, (%1),%%mm4, q)\
- /* mm0= GHIJ, mm2=FGHI, mm5=HIJK, mm6=IJKL, mm7=0 */\
- \
- "movq 9(%0), %%mm1 \n\t" /* JKLMNOPQ */\
- "movq %%mm1, %%mm4 \n\t" /* JKLMNOPQ */\
- "movq %%mm1, %%mm3 \n\t" /* JKLMNOPQ */\
- "psrlq $8, %%mm1 \n\t" /* KLMNOPQ0 */\
- "psrlq $16, %%mm4 \n\t" /* LMNOPQ00 */\
- "punpcklbw %%mm7, %%mm1 \n\t" /* 0K0L0M0N */\
- "punpcklbw %%mm7, %%mm4 \n\t" /* 0L0M0N0O */\
- "paddw %%mm1, %%mm5 \n\t" /* b */\
- "paddw %%mm4, %%mm0 \n\t" /* c */\
- "paddw %%mm5, %%mm5 \n\t" /* 2b */\
- "psubw %%mm5, %%mm0 \n\t" /* c - 2b */\
- "movq %%mm3, %%mm5 \n\t" /* JKLMNOPQ */\
- "psrlq $24, %%mm3 \n\t" /* MNOPQ000 */\
- "pmullw "MANGLE(ff_pw_3)", %%mm0 \n\t" /* 3c - 6b */\
- "punpcklbw %%mm7, %%mm3 \n\t" /* 0M0N0O0P */\
- "paddw %%mm3, %%mm2 \n\t" /* d */\
- "psubw %%mm2, %%mm0 \n\t" /* -6b + 3c - d */\
- "movq %%mm5, %%mm2 \n\t" /* JKLMNOPQ */\
- "punpcklbw %%mm7, %%mm2 \n\t" /* 0J0K0L0M */\
- "punpckhbw %%mm7, %%mm5 \n\t" /* 0N0O0P0Q */\
- "paddw %%mm2, %%mm6 \n\t" /* a */\
- "pmullw "MANGLE(ff_pw_20)", %%mm6 \n\t" /* 20a */\
- "paddw %6, %%mm0 \n\t"\
- "paddw %%mm6, %%mm0 \n\t" /* 20a - 6b + 3c - d */\
- "psraw $5, %%mm0 \n\t"\
- /* mm1=KLMN, mm2=JKLM, mm3=MNOP, mm4=LMNO, mm5=NOPQ mm7=0 */\
- \
- "paddw %%mm5, %%mm3 \n\t" /* a */\
- "pshufw $0xF9, %%mm5, %%mm6 \n\t" /* 0O0P0Q0Q */\
- "paddw %%mm4, %%mm6 \n\t" /* b */\
- "pshufw $0xBE, %%mm5, %%mm4 \n\t" /* 0P0Q0Q0P */\
- "pshufw $0x6F, %%mm5, %%mm5 \n\t" /* 0Q0Q0P0O */\
- "paddw %%mm1, %%mm4 \n\t" /* c */\
- "paddw %%mm2, %%mm5 \n\t" /* d */\
- "paddw %%mm6, %%mm6 \n\t" /* 2b */\
- "psubw %%mm6, %%mm4 \n\t" /* c - 2b */\
- "pmullw "MANGLE(ff_pw_20)", %%mm3 \n\t" /* 20a */\
- "pmullw "MANGLE(ff_pw_3)", %%mm4 \n\t" /* 3c - 6b */\
- "psubw %%mm5, %%mm3 \n\t" /* -6b + 3c - d */\
- "paddw %6, %%mm4 \n\t"\
- "paddw %%mm3, %%mm4 \n\t" /* 20a - 6b + 3c - d */\
- "psraw $5, %%mm4 \n\t"\
- "packuswb %%mm4, %%mm0 \n\t"\
- OP_MMX2(%%mm0, 8(%1), %%mm4, q)\
- \
- "add %3, %0 \n\t"\
- "add %4, %1 \n\t"\
- "decl %2 \n\t"\
- " jnz 1b \n\t"\
- : "+a"(src), "+c"(dst), "+m"(h)\
- : "d"((long)srcStride), "S"((long)dstStride), /*"m"(ff_pw_20), "m"(ff_pw_3),*/ "m"(temp), "m"(ROUNDER)\
- : "memory"\
- );\
-}\
-\
-static void OPNAME ## mpeg4_qpel16_h_lowpass_3dnow(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\
- int i;\
- int16_t temp[16];\
- /* quick HACK, XXX FIXME MUST be optimized */\
- for(i=0; i<h; i++)\
- {\
- temp[ 0]= (src[ 0]+src[ 1])*20 - (src[ 0]+src[ 2])*6 + (src[ 1]+src[ 3])*3 - (src[ 2]+src[ 4]);\
- temp[ 1]= (src[ 1]+src[ 2])*20 - (src[ 0]+src[ 3])*6 + (src[ 0]+src[ 4])*3 - (src[ 1]+src[ 5]);\
- temp[ 2]= (src[ 2]+src[ 3])*20 - (src[ 1]+src[ 4])*6 + (src[ 0]+src[ 5])*3 - (src[ 0]+src[ 6]);\
- temp[ 3]= (src[ 3]+src[ 4])*20 - (src[ 2]+src[ 5])*6 + (src[ 1]+src[ 6])*3 - (src[ 0]+src[ 7]);\
- temp[ 4]= (src[ 4]+src[ 5])*20 - (src[ 3]+src[ 6])*6 + (src[ 2]+src[ 7])*3 - (src[ 1]+src[ 8]);\
- temp[ 5]= (src[ 5]+src[ 6])*20 - (src[ 4]+src[ 7])*6 + (src[ 3]+src[ 8])*3 - (src[ 2]+src[ 9]);\
- temp[ 6]= (src[ 6]+src[ 7])*20 - (src[ 5]+src[ 8])*6 + (src[ 4]+src[ 9])*3 - (src[ 3]+src[10]);\
- temp[ 7]= (src[ 7]+src[ 8])*20 - (src[ 6]+src[ 9])*6 + (src[ 5]+src[10])*3 - (src[ 4]+src[11]);\
- temp[ 8]= (src[ 8]+src[ 9])*20 - (src[ 7]+src[10])*6 + (src[ 6]+src[11])*3 - (src[ 5]+src[12]);\
- temp[ 9]= (src[ 9]+src[10])*20 - (src[ 8]+src[11])*6 + (src[ 7]+src[12])*3 - (src[ 6]+src[13]);\
- temp[10]= (src[10]+src[11])*20 - (src[ 9]+src[12])*6 + (src[ 8]+src[13])*3 - (src[ 7]+src[14]);\
- temp[11]= (src[11]+src[12])*20 - (src[10]+src[13])*6 + (src[ 9]+src[14])*3 - (src[ 8]+src[15]);\
- temp[12]= (src[12]+src[13])*20 - (src[11]+src[14])*6 + (src[10]+src[15])*3 - (src[ 9]+src[16]);\
- temp[13]= (src[13]+src[14])*20 - (src[12]+src[15])*6 + (src[11]+src[16])*3 - (src[10]+src[16]);\
- temp[14]= (src[14]+src[15])*20 - (src[13]+src[16])*6 + (src[12]+src[16])*3 - (src[11]+src[15]);\
- temp[15]= (src[15]+src[16])*20 - (src[14]+src[16])*6 + (src[13]+src[15])*3 - (src[12]+src[14]);\
- asm volatile(\
- "movq (%0), %%mm0 \n\t"\
- "movq 8(%0), %%mm1 \n\t"\
- "paddw %2, %%mm0 \n\t"\
- "paddw %2, %%mm1 \n\t"\
- "psraw $5, %%mm0 \n\t"\
- "psraw $5, %%mm1 \n\t"\
- "packuswb %%mm1, %%mm0 \n\t"\
- OP_3DNOW(%%mm0, (%1), %%mm1, q)\
- "movq 16(%0), %%mm0 \n\t"\
- "movq 24(%0), %%mm1 \n\t"\
- "paddw %2, %%mm0 \n\t"\
- "paddw %2, %%mm1 \n\t"\
- "psraw $5, %%mm0 \n\t"\
- "psraw $5, %%mm1 \n\t"\
- "packuswb %%mm1, %%mm0 \n\t"\
- OP_3DNOW(%%mm0, 8(%1), %%mm1, q)\
- :: "r"(temp), "r"(dst), "m"(ROUNDER)\
- : "memory"\
- );\
- dst+=dstStride;\
- src+=srcStride;\
- }\
-}\
-\
-static void OPNAME ## mpeg4_qpel8_h_lowpass_mmx2(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\
- uint64_t temp;\
-\
- asm volatile(\
- "pxor %%mm7, %%mm7 \n\t"\
- "1: \n\t"\
- "movq (%0), %%mm0 \n\t" /* ABCDEFGH */\
- "movq %%mm0, %%mm1 \n\t" /* ABCDEFGH */\
- "movq %%mm0, %%mm2 \n\t" /* ABCDEFGH */\
- "punpcklbw %%mm7, %%mm0 \n\t" /* 0A0B0C0D */\
- "punpckhbw %%mm7, %%mm1 \n\t" /* 0E0F0G0H */\
- "pshufw $0x90, %%mm0, %%mm5 \n\t" /* 0A0A0B0C */\
- "pshufw $0x41, %%mm0, %%mm6 \n\t" /* 0B0A0A0B */\
- "movq %%mm2, %%mm3 \n\t" /* ABCDEFGH */\
- "movq %%mm2, %%mm4 \n\t" /* ABCDEFGH */\
- "psllq $8, %%mm2 \n\t" /* 0ABCDEFG */\
- "psllq $16, %%mm3 \n\t" /* 00ABCDEF */\
- "psllq $24, %%mm4 \n\t" /* 000ABCDE */\
- "punpckhbw %%mm7, %%mm2 \n\t" /* 0D0E0F0G */\
- "punpckhbw %%mm7, %%mm3 \n\t" /* 0C0D0E0F */\
- "punpckhbw %%mm7, %%mm4 \n\t" /* 0B0C0D0E */\
- "paddw %%mm3, %%mm5 \n\t" /* b */\
- "paddw %%mm2, %%mm6 \n\t" /* c */\
- "paddw %%mm5, %%mm5 \n\t" /* 2b */\
- "psubw %%mm5, %%mm6 \n\t" /* c - 2b */\
- "pshufw $0x06, %%mm0, %%mm5 \n\t" /* 0C0B0A0A */\
- "pmullw "MANGLE(ff_pw_3)", %%mm6 \n\t" /* 3c - 6b */\
- "paddw %%mm4, %%mm0 \n\t" /* a */\
- "paddw %%mm1, %%mm5 \n\t" /* d */\
- "pmullw "MANGLE(ff_pw_20)", %%mm0 \n\t" /* 20a */\
- "psubw %%mm5, %%mm0 \n\t" /* 20a - d */\
- "paddw %6, %%mm6 \n\t"\
- "paddw %%mm6, %%mm0 \n\t" /* 20a - 6b + 3c - d */\
- "psraw $5, %%mm0 \n\t"\
- /* mm1=EFGH, mm2=DEFG, mm3=CDEF, mm4=BCDE, mm7=0 */\
- \
- "movd 5(%0), %%mm5 \n\t" /* FGHI */\
- "punpcklbw %%mm7, %%mm5 \n\t" /* 0F0G0H0I */\
- "pshufw $0xF9, %%mm5, %%mm6 \n\t" /* 0G0H0I0I */\
- "paddw %%mm5, %%mm1 \n\t" /* a */\
- "paddw %%mm6, %%mm2 \n\t" /* b */\
- "pshufw $0xBE, %%mm5, %%mm6 \n\t" /* 0H0I0I0H */\
- "pshufw $0x6F, %%mm5, %%mm5 \n\t" /* 0I0I0H0G */\
- "paddw %%mm6, %%mm3 \n\t" /* c */\
- "paddw %%mm5, %%mm4 \n\t" /* d */\
- "paddw %%mm2, %%mm2 \n\t" /* 2b */\
- "psubw %%mm2, %%mm3 \n\t" /* c - 2b */\
- "pmullw "MANGLE(ff_pw_20)", %%mm1 \n\t" /* 20a */\
- "pmullw "MANGLE(ff_pw_3)", %%mm3 \n\t" /* 3c - 6b */\
- "psubw %%mm4, %%mm3 \n\t" /* -6b + 3c - d */\
- "paddw %6, %%mm1 \n\t"\
- "paddw %%mm1, %%mm3 \n\t" /* 20a - 6b + 3c - d */\
- "psraw $5, %%mm3 \n\t"\
- "packuswb %%mm3, %%mm0 \n\t"\
- OP_MMX2(%%mm0, (%1), %%mm4, q)\
- \
- "add %3, %0 \n\t"\
- "add %4, %1 \n\t"\
- "decl %2 \n\t"\
- " jnz 1b \n\t"\
- : "+a"(src), "+c"(dst), "+m"(h)\
- : "S"((long)srcStride), "D"((long)dstStride), /*"m"(ff_pw_20), "m"(ff_pw_3),*/ "m"(temp), "m"(ROUNDER)\
- : "memory"\
- );\
-}\
-\
-static void OPNAME ## mpeg4_qpel8_h_lowpass_3dnow(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\
- int i;\
- int16_t temp[8];\
- /* quick HACK, XXX FIXME MUST be optimized */\
- for(i=0; i<h; i++)\
- {\
- temp[ 0]= (src[ 0]+src[ 1])*20 - (src[ 0]+src[ 2])*6 + (src[ 1]+src[ 3])*3 - (src[ 2]+src[ 4]);\
- temp[ 1]= (src[ 1]+src[ 2])*20 - (src[ 0]+src[ 3])*6 + (src[ 0]+src[ 4])*3 - (src[ 1]+src[ 5]);\
- temp[ 2]= (src[ 2]+src[ 3])*20 - (src[ 1]+src[ 4])*6 + (src[ 0]+src[ 5])*3 - (src[ 0]+src[ 6]);\
- temp[ 3]= (src[ 3]+src[ 4])*20 - (src[ 2]+src[ 5])*6 + (src[ 1]+src[ 6])*3 - (src[ 0]+src[ 7]);\
- temp[ 4]= (src[ 4]+src[ 5])*20 - (src[ 3]+src[ 6])*6 + (src[ 2]+src[ 7])*3 - (src[ 1]+src[ 8]);\
- temp[ 5]= (src[ 5]+src[ 6])*20 - (src[ 4]+src[ 7])*6 + (src[ 3]+src[ 8])*3 - (src[ 2]+src[ 8]);\
- temp[ 6]= (src[ 6]+src[ 7])*20 - (src[ 5]+src[ 8])*6 + (src[ 4]+src[ 8])*3 - (src[ 3]+src[ 7]);\
- temp[ 7]= (src[ 7]+src[ 8])*20 - (src[ 6]+src[ 8])*6 + (src[ 5]+src[ 7])*3 - (src[ 4]+src[ 6]);\
- asm volatile(\
- "movq (%0), %%mm0 \n\t"\
- "movq 8(%0), %%mm1 \n\t"\
- "paddw %2, %%mm0 \n\t"\
- "paddw %2, %%mm1 \n\t"\
- "psraw $5, %%mm0 \n\t"\
- "psraw $5, %%mm1 \n\t"\
- "packuswb %%mm1, %%mm0 \n\t"\
- OP_3DNOW(%%mm0, (%1), %%mm1, q)\
- :: "r"(temp), "r"(dst), "m"(ROUNDER)\
- :"memory"\
- );\
- dst+=dstStride;\
- src+=srcStride;\
- }\
-}
-
-#define QPEL_OP(OPNAME, ROUNDER, RND, OP, MMX)\
-\
-static void OPNAME ## mpeg4_qpel16_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
- uint64_t temp[17*4];\
- uint64_t *temp_ptr= temp;\
- int count= 17;\
-\
- /*FIXME unroll */\
- asm volatile(\
- "pxor %%mm7, %%mm7 \n\t"\
- "1: \n\t"\
- "movq (%0), %%mm0 \n\t"\
- "movq (%0), %%mm1 \n\t"\
- "movq 8(%0), %%mm2 \n\t"\
- "movq 8(%0), %%mm3 \n\t"\
- "punpcklbw %%mm7, %%mm0 \n\t"\
- "punpckhbw %%mm7, %%mm1 \n\t"\
- "punpcklbw %%mm7, %%mm2 \n\t"\
- "punpckhbw %%mm7, %%mm3 \n\t"\
- "movq %%mm0, (%1) \n\t"\
- "movq %%mm1, 17*8(%1) \n\t"\
- "movq %%mm2, 2*17*8(%1) \n\t"\
- "movq %%mm3, 3*17*8(%1) \n\t"\
- "add $8, %1 \n\t"\
- "add %3, %0 \n\t"\
- "decl %2 \n\t"\
- " jnz 1b \n\t"\
- : "+r" (src), "+r" (temp_ptr), "+r"(count)\
- : "r" ((long)srcStride)\
- : "memory"\
- );\
- \
- temp_ptr= temp;\
- count=4;\
- \
-/*FIXME reorder for speed */\
- asm volatile(\
- /*"pxor %%mm7, %%mm7 \n\t"*/\
- "1: \n\t"\
- "movq (%0), %%mm0 \n\t"\
- "movq 8(%0), %%mm1 \n\t"\
- "movq 16(%0), %%mm2 \n\t"\
- "movq 24(%0), %%mm3 \n\t"\
- QPEL_V_LOW(%%mm0, %%mm1, %%mm2, %%mm3, %5, %6, %5, 16(%0), 8(%0), (%0), 32(%0), (%1), OP)\
- QPEL_V_LOW(%%mm1, %%mm2, %%mm3, %%mm0, %5, %6, %5, 8(%0), (%0), (%0), 40(%0), (%1, %3), OP)\
- "add %4, %1 \n\t"\
- QPEL_V_LOW(%%mm2, %%mm3, %%mm0, %%mm1, %5, %6, %5, (%0), (%0), 8(%0), 48(%0), (%1), OP)\
- \
- QPEL_V_LOW(%%mm3, %%mm0, %%mm1, %%mm2, %5, %6, %5, (%0), 8(%0), 16(%0), 56(%0), (%1, %3), OP)\
- "add %4, %1 \n\t"\
- QPEL_V_LOW(%%mm0, %%mm1, %%mm2, %%mm3, %5, %6, %5, 8(%0), 16(%0), 24(%0), 64(%0), (%1), OP)\
- QPEL_V_LOW(%%mm1, %%mm2, %%mm3, %%mm0, %5, %6, %5, 16(%0), 24(%0), 32(%0), 72(%0), (%1, %3), OP)\
- "add %4, %1 \n\t"\
- QPEL_V_LOW(%%mm2, %%mm3, %%mm0, %%mm1, %5, %6, %5, 24(%0), 32(%0), 40(%0), 80(%0), (%1), OP)\
- QPEL_V_LOW(%%mm3, %%mm0, %%mm1, %%mm2, %5, %6, %5, 32(%0), 40(%0), 48(%0), 88(%0), (%1, %3), OP)\
- "add %4, %1 \n\t"\
- QPEL_V_LOW(%%mm0, %%mm1, %%mm2, %%mm3, %5, %6, %5, 40(%0), 48(%0), 56(%0), 96(%0), (%1), OP)\
- QPEL_V_LOW(%%mm1, %%mm2, %%mm3, %%mm0, %5, %6, %5, 48(%0), 56(%0), 64(%0),104(%0), (%1, %3), OP)\
- "add %4, %1 \n\t"\
- QPEL_V_LOW(%%mm2, %%mm3, %%mm0, %%mm1, %5, %6, %5, 56(%0), 64(%0), 72(%0),112(%0), (%1), OP)\
- QPEL_V_LOW(%%mm3, %%mm0, %%mm1, %%mm2, %5, %6, %5, 64(%0), 72(%0), 80(%0),120(%0), (%1, %3), OP)\
- "add %4, %1 \n\t"\
- QPEL_V_LOW(%%mm0, %%mm1, %%mm2, %%mm3, %5, %6, %5, 72(%0), 80(%0), 88(%0),128(%0), (%1), OP)\
- \
- QPEL_V_LOW(%%mm1, %%mm2, %%mm3, %%mm0, %5, %6, %5, 80(%0), 88(%0), 96(%0),128(%0), (%1, %3), OP)\
- "add %4, %1 \n\t" \
- QPEL_V_LOW(%%mm2, %%mm3, %%mm0, %%mm1, %5, %6, %5, 88(%0), 96(%0),104(%0),120(%0), (%1), OP)\
- QPEL_V_LOW(%%mm3, %%mm0, %%mm1, %%mm2, %5, %6, %5, 96(%0),104(%0),112(%0),112(%0), (%1, %3), OP)\
- \
- "add $136, %0 \n\t"\
- "add %6, %1 \n\t"\
- "decl %2 \n\t"\
- " jnz 1b \n\t"\
- \
- : "+r"(temp_ptr), "+r"(dst), "+g"(count)\
- : "r"((long)dstStride), "r"(2*(long)dstStride), /*"m"(ff_pw_20), "m"(ff_pw_3),*/ "m"(ROUNDER), "g"(4-14*(long)dstStride)\
- :"memory"\
- );\
-}\
-\
-static void OPNAME ## mpeg4_qpel8_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
- uint64_t temp[9*2];\
- uint64_t *temp_ptr= temp;\
- int count= 9;\
-\
- /*FIXME unroll */\
- asm volatile(\
- "pxor %%mm7, %%mm7 \n\t"\
- "1: \n\t"\
- "movq (%0), %%mm0 \n\t"\
- "movq (%0), %%mm1 \n\t"\
- "punpcklbw %%mm7, %%mm0 \n\t"\
- "punpckhbw %%mm7, %%mm1 \n\t"\
- "movq %%mm0, (%1) \n\t"\
- "movq %%mm1, 9*8(%1) \n\t"\
- "add $8, %1 \n\t"\
- "add %3, %0 \n\t"\
- "decl %2 \n\t"\
- " jnz 1b \n\t"\
- : "+r" (src), "+r" (temp_ptr), "+r"(count)\
- : "r" ((long)srcStride)\
- : "memory"\
- );\
- \
- temp_ptr= temp;\
- count=2;\
- \
-/*FIXME reorder for speed */\
- asm volatile(\
- /*"pxor %%mm7, %%mm7 \n\t"*/\
- "1: \n\t"\
- "movq (%0), %%mm0 \n\t"\
- "movq 8(%0), %%mm1 \n\t"\
- "movq 16(%0), %%mm2 \n\t"\
- "movq 24(%0), %%mm3 \n\t"\
- QPEL_V_LOW(%%mm0, %%mm1, %%mm2, %%mm3, %5, %6, %5, 16(%0), 8(%0), (%0), 32(%0), (%1), OP)\
- QPEL_V_LOW(%%mm1, %%mm2, %%mm3, %%mm0, %5, %6, %5, 8(%0), (%0), (%0), 40(%0), (%1, %3), OP)\
- "add %4, %1 \n\t"\
- QPEL_V_LOW(%%mm2, %%mm3, %%mm0, %%mm1, %5, %6, %5, (%0), (%0), 8(%0), 48(%0), (%1), OP)\
- \
- QPEL_V_LOW(%%mm3, %%mm0, %%mm1, %%mm2, %5, %6, %5, (%0), 8(%0), 16(%0), 56(%0), (%1, %3), OP)\
- "add %4, %1 \n\t"\
- QPEL_V_LOW(%%mm0, %%mm1, %%mm2, %%mm3, %5, %6, %5, 8(%0), 16(%0), 24(%0), 64(%0), (%1), OP)\
- \
- QPEL_V_LOW(%%mm1, %%mm2, %%mm3, %%mm0, %5, %6, %5, 16(%0), 24(%0), 32(%0), 64(%0), (%1, %3), OP)\
- "add %4, %1 \n\t"\
- QPEL_V_LOW(%%mm2, %%mm3, %%mm0, %%mm1, %5, %6, %5, 24(%0), 32(%0), 40(%0), 56(%0), (%1), OP)\
- QPEL_V_LOW(%%mm3, %%mm0, %%mm1, %%mm2, %5, %6, %5, 32(%0), 40(%0), 48(%0), 48(%0), (%1, %3), OP)\
- \
- "add $72, %0 \n\t"\
- "add %6, %1 \n\t"\
- "decl %2 \n\t"\
- " jnz 1b \n\t"\
- \
- : "+r"(temp_ptr), "+r"(dst), "+g"(count)\
- : "r"((long)dstStride), "r"(2*(long)dstStride), /*"m"(ff_pw_20), "m"(ff_pw_3),*/ "m"(ROUNDER), "g"(4-6*(long)dstStride)\
- : "memory"\
- );\
-}\
-\
-static void OPNAME ## qpel8_mc00_ ## MMX (uint8_t *dst, uint8_t *src, int stride){\
- OPNAME ## pixels8_mmx(dst, src, stride, 8);\
-}\
-\
-static void OPNAME ## qpel8_mc10_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[8];\
- uint8_t * const half= (uint8_t*)temp;\
- put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(half, src, 8, stride, 8);\
- OPNAME ## pixels8_l2_ ## MMX(dst, src, half, stride, stride, 8);\
-}\
-\
-static void OPNAME ## qpel8_mc20_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- OPNAME ## mpeg4_qpel8_h_lowpass_ ## MMX(dst, src, stride, stride, 8);\
-}\
-\
-static void OPNAME ## qpel8_mc30_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[8];\
- uint8_t * const half= (uint8_t*)temp;\
- put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(half, src, 8, stride, 8);\
- OPNAME ## pixels8_l2_ ## MMX(dst, src+1, half, stride, stride, 8);\
-}\
-\
-static void OPNAME ## qpel8_mc01_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[8];\
- uint8_t * const half= (uint8_t*)temp;\
- put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(half, src, 8, stride);\
- OPNAME ## pixels8_l2_ ## MMX(dst, src, half, stride, stride, 8);\
-}\
-\
-static void OPNAME ## qpel8_mc02_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- OPNAME ## mpeg4_qpel8_v_lowpass_ ## MMX(dst, src, stride, stride);\
-}\
-\
-static void OPNAME ## qpel8_mc03_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[8];\
- uint8_t * const half= (uint8_t*)temp;\
- put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(half, src, 8, stride);\
- OPNAME ## pixels8_l2_ ## MMX(dst, src+stride, half, stride, stride, 8);\
-}\
-static void OPNAME ## qpel8_mc11_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t half[8 + 9];\
- uint8_t * const halfH= ((uint8_t*)half) + 64;\
- uint8_t * const halfHV= ((uint8_t*)half);\
- put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, stride, 9);\
- put ## RND ## pixels8_l2_ ## MMX(halfH, src, halfH, 8, stride, 9);\
- put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(halfHV, halfH, 8, 8);\
- OPNAME ## pixels8_l2_ ## MMX(dst, halfH, halfHV, stride, 8, 8);\
-}\
-static void OPNAME ## qpel8_mc31_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t half[8 + 9];\
- uint8_t * const halfH= ((uint8_t*)half) + 64;\
- uint8_t * const halfHV= ((uint8_t*)half);\
- put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, stride, 9);\
- put ## RND ## pixels8_l2_ ## MMX(halfH, src+1, halfH, 8, stride, 9);\
- put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(halfHV, halfH, 8, 8);\
- OPNAME ## pixels8_l2_ ## MMX(dst, halfH, halfHV, stride, 8, 8);\
-}\
-static void OPNAME ## qpel8_mc13_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t half[8 + 9];\
- uint8_t * const halfH= ((uint8_t*)half) + 64;\
- uint8_t * const halfHV= ((uint8_t*)half);\
- put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, stride, 9);\
- put ## RND ## pixels8_l2_ ## MMX(halfH, src, halfH, 8, stride, 9);\
- put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(halfHV, halfH, 8, 8);\
- OPNAME ## pixels8_l2_ ## MMX(dst, halfH+8, halfHV, stride, 8, 8);\
-}\
-static void OPNAME ## qpel8_mc33_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t half[8 + 9];\
- uint8_t * const halfH= ((uint8_t*)half) + 64;\
- uint8_t * const halfHV= ((uint8_t*)half);\
- put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, stride, 9);\
- put ## RND ## pixels8_l2_ ## MMX(halfH, src+1, halfH, 8, stride, 9);\
- put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(halfHV, halfH, 8, 8);\
- OPNAME ## pixels8_l2_ ## MMX(dst, halfH+8, halfHV, stride, 8, 8);\
-}\
-static void OPNAME ## qpel8_mc21_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t half[8 + 9];\
- uint8_t * const halfH= ((uint8_t*)half) + 64;\
- uint8_t * const halfHV= ((uint8_t*)half);\
- put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, stride, 9);\
- put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(halfHV, halfH, 8, 8);\
- OPNAME ## pixels8_l2_ ## MMX(dst, halfH, halfHV, stride, 8, 8);\
-}\
-static void OPNAME ## qpel8_mc23_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t half[8 + 9];\
- uint8_t * const halfH= ((uint8_t*)half) + 64;\
- uint8_t * const halfHV= ((uint8_t*)half);\
- put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, stride, 9);\
- put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(halfHV, halfH, 8, 8);\
- OPNAME ## pixels8_l2_ ## MMX(dst, halfH+8, halfHV, stride, 8, 8);\
-}\
-static void OPNAME ## qpel8_mc12_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t half[8 + 9];\
- uint8_t * const halfH= ((uint8_t*)half);\
- put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, stride, 9);\
- put ## RND ## pixels8_l2_ ## MMX(halfH, src, halfH, 8, stride, 9);\
- OPNAME ## mpeg4_qpel8_v_lowpass_ ## MMX(dst, halfH, stride, 8);\
-}\
-static void OPNAME ## qpel8_mc32_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t half[8 + 9];\
- uint8_t * const halfH= ((uint8_t*)half);\
- put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, stride, 9);\
- put ## RND ## pixels8_l2_ ## MMX(halfH, src+1, halfH, 8, stride, 9);\
- OPNAME ## mpeg4_qpel8_v_lowpass_ ## MMX(dst, halfH, stride, 8);\
-}\
-static void OPNAME ## qpel8_mc22_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t half[9];\
- uint8_t * const halfH= ((uint8_t*)half);\
- put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, stride, 9);\
- OPNAME ## mpeg4_qpel8_v_lowpass_ ## MMX(dst, halfH, stride, 8);\
-}\
-static void OPNAME ## qpel16_mc00_ ## MMX (uint8_t *dst, uint8_t *src, int stride){\
- OPNAME ## pixels16_mmx(dst, src, stride, 16);\
-}\
-\
-static void OPNAME ## qpel16_mc10_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[32];\
- uint8_t * const half= (uint8_t*)temp;\
- put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(half, src, 16, stride, 16);\
- OPNAME ## pixels16_l2_ ## MMX(dst, src, half, stride, stride, 16);\
-}\
-\
-static void OPNAME ## qpel16_mc20_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- OPNAME ## mpeg4_qpel16_h_lowpass_ ## MMX(dst, src, stride, stride, 16);\
-}\
-\
-static void OPNAME ## qpel16_mc30_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[32];\
- uint8_t * const half= (uint8_t*)temp;\
- put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(half, src, 16, stride, 16);\
- OPNAME ## pixels16_l2_ ## MMX(dst, src+1, half, stride, stride, 16);\
-}\
-\
-static void OPNAME ## qpel16_mc01_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[32];\
- uint8_t * const half= (uint8_t*)temp;\
- put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(half, src, 16, stride);\
- OPNAME ## pixels16_l2_ ## MMX(dst, src, half, stride, stride, 16);\
-}\
-\
-static void OPNAME ## qpel16_mc02_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- OPNAME ## mpeg4_qpel16_v_lowpass_ ## MMX(dst, src, stride, stride);\
-}\
-\
-static void OPNAME ## qpel16_mc03_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[32];\
- uint8_t * const half= (uint8_t*)temp;\
- put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(half, src, 16, stride);\
- OPNAME ## pixels16_l2_ ## MMX(dst, src+stride, half, stride, stride, 16);\
-}\
-static void OPNAME ## qpel16_mc11_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t half[16*2 + 17*2];\
- uint8_t * const halfH= ((uint8_t*)half) + 256;\
- uint8_t * const halfHV= ((uint8_t*)half);\
- put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, stride, 17);\
- put ## RND ## pixels16_l2_ ## MMX(halfH, src, halfH, 16, stride, 17);\
- put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(halfHV, halfH, 16, 16);\
- OPNAME ## pixels16_l2_ ## MMX(dst, halfH, halfHV, stride, 16, 16);\
-}\
-static void OPNAME ## qpel16_mc31_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t half[16*2 + 17*2];\
- uint8_t * const halfH= ((uint8_t*)half) + 256;\
- uint8_t * const halfHV= ((uint8_t*)half);\
- put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, stride, 17);\
- put ## RND ## pixels16_l2_ ## MMX(halfH, src+1, halfH, 16, stride, 17);\
- put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(halfHV, halfH, 16, 16);\
- OPNAME ## pixels16_l2_ ## MMX(dst, halfH, halfHV, stride, 16, 16);\
-}\
-static void OPNAME ## qpel16_mc13_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t half[16*2 + 17*2];\
- uint8_t * const halfH= ((uint8_t*)half) + 256;\
- uint8_t * const halfHV= ((uint8_t*)half);\
- put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, stride, 17);\
- put ## RND ## pixels16_l2_ ## MMX(halfH, src, halfH, 16, stride, 17);\
- put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(halfHV, halfH, 16, 16);\
- OPNAME ## pixels16_l2_ ## MMX(dst, halfH+16, halfHV, stride, 16, 16);\
-}\
-static void OPNAME ## qpel16_mc33_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t half[16*2 + 17*2];\
- uint8_t * const halfH= ((uint8_t*)half) + 256;\
- uint8_t * const halfHV= ((uint8_t*)half);\
- put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, stride, 17);\
- put ## RND ## pixels16_l2_ ## MMX(halfH, src+1, halfH, 16, stride, 17);\
- put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(halfHV, halfH, 16, 16);\
- OPNAME ## pixels16_l2_ ## MMX(dst, halfH+16, halfHV, stride, 16, 16);\
-}\
-static void OPNAME ## qpel16_mc21_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t half[16*2 + 17*2];\
- uint8_t * const halfH= ((uint8_t*)half) + 256;\
- uint8_t * const halfHV= ((uint8_t*)half);\
- put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, stride, 17);\
- put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(halfHV, halfH, 16, 16);\
- OPNAME ## pixels16_l2_ ## MMX(dst, halfH, halfHV, stride, 16, 16);\
-}\
-static void OPNAME ## qpel16_mc23_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t half[16*2 + 17*2];\
- uint8_t * const halfH= ((uint8_t*)half) + 256;\
- uint8_t * const halfHV= ((uint8_t*)half);\
- put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, stride, 17);\
- put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(halfHV, halfH, 16, 16);\
- OPNAME ## pixels16_l2_ ## MMX(dst, halfH+16, halfHV, stride, 16, 16);\
-}\
-static void OPNAME ## qpel16_mc12_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t half[17*2];\
- uint8_t * const halfH= ((uint8_t*)half);\
- put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, stride, 17);\
- put ## RND ## pixels16_l2_ ## MMX(halfH, src, halfH, 16, stride, 17);\
- OPNAME ## mpeg4_qpel16_v_lowpass_ ## MMX(dst, halfH, stride, 16);\
-}\
-static void OPNAME ## qpel16_mc32_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t half[17*2];\
- uint8_t * const halfH= ((uint8_t*)half);\
- put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, stride, 17);\
- put ## RND ## pixels16_l2_ ## MMX(halfH, src+1, halfH, 16, stride, 17);\
- OPNAME ## mpeg4_qpel16_v_lowpass_ ## MMX(dst, halfH, stride, 16);\
-}\
-static void OPNAME ## qpel16_mc22_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t half[17*2];\
- uint8_t * const halfH= ((uint8_t*)half);\
- put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, stride, 17);\
- OPNAME ## mpeg4_qpel16_v_lowpass_ ## MMX(dst, halfH, stride, 16);\
-}
-
-#define PUT_OP(a,b,temp, size) "mov" #size " " #a ", " #b " \n\t"
-#define AVG_3DNOW_OP(a,b,temp, size) \
-"mov" #size " " #b ", " #temp " \n\t"\
-"pavgusb " #temp ", " #a " \n\t"\
-"mov" #size " " #a ", " #b " \n\t"
-#define AVG_MMX2_OP(a,b,temp, size) \
-"mov" #size " " #b ", " #temp " \n\t"\
-"pavgb " #temp ", " #a " \n\t"\
-"mov" #size " " #a ", " #b " \n\t"
-
-QPEL_BASE(put_ , ff_pw_16, _ , PUT_OP, PUT_OP)
-QPEL_BASE(avg_ , ff_pw_16, _ , AVG_MMX2_OP, AVG_3DNOW_OP)
-QPEL_BASE(put_no_rnd_, ff_pw_15, _no_rnd_, PUT_OP, PUT_OP)
-QPEL_OP(put_ , ff_pw_16, _ , PUT_OP, 3dnow)
-QPEL_OP(avg_ , ff_pw_16, _ , AVG_3DNOW_OP, 3dnow)
-QPEL_OP(put_no_rnd_, ff_pw_15, _no_rnd_, PUT_OP, 3dnow)
-QPEL_OP(put_ , ff_pw_16, _ , PUT_OP, mmx2)
-QPEL_OP(avg_ , ff_pw_16, _ , AVG_MMX2_OP, mmx2)
-QPEL_OP(put_no_rnd_, ff_pw_15, _no_rnd_, PUT_OP, mmx2)
-
-/***********************************/
-/* bilinear qpel: not compliant to any spec, only for -lavdopts fast */
-
-#define QPEL_2TAP_XY(OPNAME, SIZE, MMX, XY, HPEL)\
-static void OPNAME ## 2tap_qpel ## SIZE ## _mc ## XY ## _ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- OPNAME ## pixels ## SIZE ## HPEL(dst, src, stride, SIZE);\
-}
-#define QPEL_2TAP_L3(OPNAME, SIZE, MMX, XY, S0, S1, S2)\
-static void OPNAME ## 2tap_qpel ## SIZE ## _mc ## XY ## _ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- OPNAME ## 2tap_qpel ## SIZE ## _l3_ ## MMX(dst, src+S0, stride, SIZE, S1, S2);\
-}
-
-#define QPEL_2TAP(OPNAME, SIZE, MMX)\
-QPEL_2TAP_XY(OPNAME, SIZE, MMX, 20, _x2_ ## MMX)\
-QPEL_2TAP_XY(OPNAME, SIZE, MMX, 02, _y2_ ## MMX)\
-QPEL_2TAP_XY(OPNAME, SIZE, MMX, 22, _xy2_mmx)\
-static const qpel_mc_func OPNAME ## 2tap_qpel ## SIZE ## _mc00_ ## MMX =\
- OPNAME ## qpel ## SIZE ## _mc00_ ## MMX;\
-static const qpel_mc_func OPNAME ## 2tap_qpel ## SIZE ## _mc21_ ## MMX =\
- OPNAME ## 2tap_qpel ## SIZE ## _mc20_ ## MMX;\
-static const qpel_mc_func OPNAME ## 2tap_qpel ## SIZE ## _mc12_ ## MMX =\
- OPNAME ## 2tap_qpel ## SIZE ## _mc02_ ## MMX;\
-static void OPNAME ## 2tap_qpel ## SIZE ## _mc32_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- OPNAME ## pixels ## SIZE ## _y2_ ## MMX(dst, src+1, stride, SIZE);\
-}\
-static void OPNAME ## 2tap_qpel ## SIZE ## _mc23_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- OPNAME ## pixels ## SIZE ## _x2_ ## MMX(dst, src+stride, stride, SIZE);\
-}\
-QPEL_2TAP_L3(OPNAME, SIZE, MMX, 10, 0, 1, 0)\
-QPEL_2TAP_L3(OPNAME, SIZE, MMX, 30, 1, -1, 0)\
-QPEL_2TAP_L3(OPNAME, SIZE, MMX, 01, 0, stride, 0)\
-QPEL_2TAP_L3(OPNAME, SIZE, MMX, 03, stride, -stride, 0)\
-QPEL_2TAP_L3(OPNAME, SIZE, MMX, 11, 0, stride, 1)\
-QPEL_2TAP_L3(OPNAME, SIZE, MMX, 31, 1, stride, -1)\
-QPEL_2TAP_L3(OPNAME, SIZE, MMX, 13, stride, -stride, 1)\
-QPEL_2TAP_L3(OPNAME, SIZE, MMX, 33, stride+1, -stride, -1)\
-
-QPEL_2TAP(put_, 16, mmx2)
-QPEL_2TAP(avg_, 16, mmx2)
-QPEL_2TAP(put_, 8, mmx2)
-QPEL_2TAP(avg_, 8, mmx2)
-QPEL_2TAP(put_, 16, 3dnow)
-QPEL_2TAP(avg_, 16, 3dnow)
-QPEL_2TAP(put_, 8, 3dnow)
-QPEL_2TAP(avg_, 8, 3dnow)
-
-
-#if 0
-static void just_return() { return; }
-#endif
-
-#define SET_QPEL_FUNC(postfix1, postfix2) \
- c->put_ ## postfix1 = put_ ## postfix2;\
- c->put_no_rnd_ ## postfix1 = put_no_rnd_ ## postfix2;\
- c->avg_ ## postfix1 = avg_ ## postfix2;
-
-static void gmc_mmx(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy,
- int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height){
- const int w = 8;
- const int ix = ox>>(16+shift);
- const int iy = oy>>(16+shift);
- const int oxs = ox>>4;
- const int oys = oy>>4;
- const int dxxs = dxx>>4;
- const int dxys = dxy>>4;
- const int dyxs = dyx>>4;
- const int dyys = dyy>>4;
- const uint16_t r4[4] = {r,r,r,r};
- const uint16_t dxy4[4] = {dxys,dxys,dxys,dxys};
- const uint16_t dyy4[4] = {dyys,dyys,dyys,dyys};
- const uint64_t shift2 = 2*shift;
- uint8_t edge_buf[(h+1)*stride];
- int x, y;
-
- const int dxw = (dxx-(1<<(16+shift)))*(w-1);
- const int dyh = (dyy-(1<<(16+shift)))*(h-1);
- const int dxh = dxy*(h-1);
- const int dyw = dyx*(w-1);
- if( // non-constant fullpel offset (3% of blocks)
- (ox^(ox+dxw) | ox^(ox+dxh) | ox^(ox+dxw+dxh) |
- oy^(oy+dyw) | oy^(oy+dyh) | oy^(oy+dyw+dyh)) >> (16+shift)
- // uses more than 16 bits of subpel mv (only at huge resolution)
- || (dxx|dxy|dyx|dyy)&15 )
- {
- //FIXME could still use mmx for some of the rows
- ff_gmc_c(dst, src, stride, h, ox, oy, dxx, dxy, dyx, dyy, shift, r, width, height);
- return;
- }
-
- src += ix + iy*stride;
- if( (unsigned)ix >= width-w ||
- (unsigned)iy >= height-h )
- {
- ff_emulated_edge_mc(edge_buf, src, stride, w+1, h+1, ix, iy, width, height);
- src = edge_buf;
- }
-
- asm volatile(
- "movd %0, %%mm6 \n\t"
- "pxor %%mm7, %%mm7 \n\t"
- "punpcklwd %%mm6, %%mm6 \n\t"
- "punpcklwd %%mm6, %%mm6 \n\t"
- :: "r"(1<<shift)
- );
-
- for(x=0; x<w; x+=4){
- uint16_t dx4[4] = { oxs - dxys + dxxs*(x+0),
- oxs - dxys + dxxs*(x+1),
- oxs - dxys + dxxs*(x+2),
- oxs - dxys + dxxs*(x+3) };
- uint16_t dy4[4] = { oys - dyys + dyxs*(x+0),
- oys - dyys + dyxs*(x+1),
- oys - dyys + dyxs*(x+2),
- oys - dyys + dyxs*(x+3) };
-
- for(y=0; y<h; y++){
- asm volatile(
- "movq %0, %%mm4 \n\t"
- "movq %1, %%mm5 \n\t"
- "paddw %2, %%mm4 \n\t"
- "paddw %3, %%mm5 \n\t"
- "movq %%mm4, %0 \n\t"
- "movq %%mm5, %1 \n\t"
- "psrlw $12, %%mm4 \n\t"
- "psrlw $12, %%mm5 \n\t"
- : "+m"(*dx4), "+m"(*dy4)
- : "m"(*dxy4), "m"(*dyy4)
- );
-
- asm volatile(
- "movq %%mm6, %%mm2 \n\t"
- "movq %%mm6, %%mm1 \n\t"
- "psubw %%mm4, %%mm2 \n\t"
- "psubw %%mm5, %%mm1 \n\t"
- "movq %%mm2, %%mm0 \n\t"
- "movq %%mm4, %%mm3 \n\t"
- "pmullw %%mm1, %%mm0 \n\t" // (s-dx)*(s-dy)
- "pmullw %%mm5, %%mm3 \n\t" // dx*dy
- "pmullw %%mm5, %%mm2 \n\t" // (s-dx)*dy
- "pmullw %%mm4, %%mm1 \n\t" // dx*(s-dy)
-
- "movd %3, %%mm5 \n\t"
- "movd %2, %%mm4 \n\t"
- "punpcklbw %%mm7, %%mm5 \n\t"
- "punpcklbw %%mm7, %%mm4 \n\t"
- "pmullw %%mm5, %%mm3 \n\t" // src[1,1] * dx*dy
- "pmullw %%mm4, %%mm2 \n\t" // src[0,1] * (s-dx)*dy
-
- "movd %1, %%mm5 \n\t"
- "movd %0, %%mm4 \n\t"
- "punpcklbw %%mm7, %%mm5 \n\t"
- "punpcklbw %%mm7, %%mm4 \n\t"
- "pmullw %%mm5, %%mm1 \n\t" // src[1,0] * dx*(s-dy)
- "pmullw %%mm4, %%mm0 \n\t" // src[0,0] * (s-dx)*(s-dy)
- "paddw %4, %%mm1 \n\t"
- "paddw %%mm3, %%mm2 \n\t"
- "paddw %%mm1, %%mm0 \n\t"
- "paddw %%mm2, %%mm0 \n\t"
-
- "psrlw %5, %%mm0 \n\t"
- "packuswb %%mm0, %%mm0 \n\t"
-
- :
- : "m"(src[0]), "m"(src[1]),
- "m"(src[stride]), "m"(src[stride+1]),
- "m"(*r4), "m"(shift2)
- );
-
- asm volatile(
- "movd %%mm0, %0 \n\t"
-
- : "=m"(dst[x+y*stride])
- :
- );
- src += stride;
- }
- src += 4-h*stride;
- }
-}
-
-#ifdef CONFIG_ENCODERS
-static int try_8x8basis_mmx(int16_t rem[64], int16_t weight[64], int16_t basis[64], int scale){
- long i=0;
-
- assert(FFABS(scale) < 256);
- scale<<= 16 + 1 - BASIS_SHIFT + RECON_SHIFT;
-
- asm volatile(
- "pcmpeqw %%mm6, %%mm6 \n\t" // -1w
- "psrlw $15, %%mm6 \n\t" // 1w
- "pxor %%mm7, %%mm7 \n\t"
- "movd %4, %%mm5 \n\t"
- "punpcklwd %%mm5, %%mm5 \n\t"
- "punpcklwd %%mm5, %%mm5 \n\t"
- "1: \n\t"
- "movq (%1, %0), %%mm0 \n\t"
- "movq 8(%1, %0), %%mm1 \n\t"
- "pmulhw %%mm5, %%mm0 \n\t"
- "pmulhw %%mm5, %%mm1 \n\t"
- "paddw %%mm6, %%mm0 \n\t"
- "paddw %%mm6, %%mm1 \n\t"
- "psraw $1, %%mm0 \n\t"
- "psraw $1, %%mm1 \n\t"
- "paddw (%2, %0), %%mm0 \n\t"
- "paddw 8(%2, %0), %%mm1 \n\t"
- "psraw $6, %%mm0 \n\t"
- "psraw $6, %%mm1 \n\t"
- "pmullw (%3, %0), %%mm0 \n\t"
- "pmullw 8(%3, %0), %%mm1 \n\t"
- "pmaddwd %%mm0, %%mm0 \n\t"
- "pmaddwd %%mm1, %%mm1 \n\t"
- "paddd %%mm1, %%mm0 \n\t"
- "psrld $4, %%mm0 \n\t"
- "paddd %%mm0, %%mm7 \n\t"
- "add $16, %0 \n\t"
- "cmp $128, %0 \n\t" //FIXME optimize & bench
- " jb 1b \n\t"
- "movq %%mm7, %%mm6 \n\t"
- "psrlq $32, %%mm7 \n\t"
- "paddd %%mm6, %%mm7 \n\t"
- "psrld $2, %%mm7 \n\t"
- "movd %%mm7, %0 \n\t"
-
- : "+r" (i)
- : "r"(basis), "r"(rem), "r"(weight), "g"(scale)
- );
- return i;
-}
-
-static void add_8x8basis_mmx(int16_t rem[64], int16_t basis[64], int scale){
- long i=0;
-
- if(FFABS(scale) < 256){
- scale<<= 16 + 1 - BASIS_SHIFT + RECON_SHIFT;
- asm volatile(
- "pcmpeqw %%mm6, %%mm6 \n\t" // -1w
- "psrlw $15, %%mm6 \n\t" // 1w
- "movd %3, %%mm5 \n\t"
- "punpcklwd %%mm5, %%mm5 \n\t"
- "punpcklwd %%mm5, %%mm5 \n\t"
- "1: \n\t"
- "movq (%1, %0), %%mm0 \n\t"
- "movq 8(%1, %0), %%mm1 \n\t"
- "pmulhw %%mm5, %%mm0 \n\t"
- "pmulhw %%mm5, %%mm1 \n\t"
- "paddw %%mm6, %%mm0 \n\t"
- "paddw %%mm6, %%mm1 \n\t"
- "psraw $1, %%mm0 \n\t"
- "psraw $1, %%mm1 \n\t"
- "paddw (%2, %0), %%mm0 \n\t"
- "paddw 8(%2, %0), %%mm1 \n\t"
- "movq %%mm0, (%2, %0) \n\t"
- "movq %%mm1, 8(%2, %0) \n\t"
- "add $16, %0 \n\t"
- "cmp $128, %0 \n\t" //FIXME optimize & bench
- " jb 1b \n\t"
-
- : "+r" (i)
- : "r"(basis), "r"(rem), "g"(scale)
- );
- }else{
- for(i=0; i<8*8; i++){
- rem[i] += (basis[i]*scale + (1<<(BASIS_SHIFT - RECON_SHIFT-1)))>>(BASIS_SHIFT - RECON_SHIFT);
- }
- }
-}
-#endif /* CONFIG_ENCODERS */
-
-#define PREFETCH(name, op) \
-static void name(void *mem, int stride, int h){\
- const uint8_t *p= mem;\
- do{\
- asm volatile(#op" %0" :: "m"(*p));\
- p+= stride;\
- }while(--h);\
-}
-PREFETCH(prefetch_mmx2, prefetcht0)
-PREFETCH(prefetch_3dnow, prefetch)
-#undef PREFETCH
-
-#include "h264dsp_mmx.c"
-
-/* AVS specific */
-void ff_cavsdsp_init_mmx2(DSPContext* c, AVCodecContext *avctx);
-
-void ff_put_cavs_qpel8_mc00_mmx2(uint8_t *dst, uint8_t *src, int stride) {
- put_pixels8_mmx(dst, src, stride, 8);
-}
-void ff_avg_cavs_qpel8_mc00_mmx2(uint8_t *dst, uint8_t *src, int stride) {
- avg_pixels8_mmx(dst, src, stride, 8);
-}
-void ff_put_cavs_qpel16_mc00_mmx2(uint8_t *dst, uint8_t *src, int stride) {
- put_pixels16_mmx(dst, src, stride, 16);
-}
-void ff_avg_cavs_qpel16_mc00_mmx2(uint8_t *dst, uint8_t *src, int stride) {
- avg_pixels16_mmx(dst, src, stride, 16);
-}
-
-/* external functions, from idct_mmx.c */
-void ff_mmx_idct(DCTELEM *block);
-void ff_mmxext_idct(DCTELEM *block);
-
-void ff_vp3_idct_sse2(int16_t *input_data);
-void ff_vp3_idct_mmx(int16_t *data);
-void ff_vp3_dsp_init_mmx(void);
-
-/* XXX: those functions should be suppressed ASAP when all IDCTs are
- converted */
-#ifdef CONFIG_GPL
-static void ff_libmpeg2mmx_idct_put(uint8_t *dest, int line_size, DCTELEM *block)
-{
- ff_mmx_idct (block);
- put_pixels_clamped_mmx(block, dest, line_size);
-}
-static void ff_libmpeg2mmx_idct_add(uint8_t *dest, int line_size, DCTELEM *block)
-{
- ff_mmx_idct (block);
- add_pixels_clamped_mmx(block, dest, line_size);
-}
-static void ff_libmpeg2mmx2_idct_put(uint8_t *dest, int line_size, DCTELEM *block)
-{
- ff_mmxext_idct (block);
- put_pixels_clamped_mmx(block, dest, line_size);
-}
-static void ff_libmpeg2mmx2_idct_add(uint8_t *dest, int line_size, DCTELEM *block)
-{
- ff_mmxext_idct (block);
- add_pixels_clamped_mmx(block, dest, line_size);
-}
-#endif
-static void ff_vp3_idct_put_sse2(uint8_t *dest, int line_size, DCTELEM *block)
-{
- ff_vp3_idct_sse2(block);
- put_signed_pixels_clamped_mmx(block, dest, line_size);
-}
-static void ff_vp3_idct_add_sse2(uint8_t *dest, int line_size, DCTELEM *block)
-{
- ff_vp3_idct_sse2(block);
- add_pixels_clamped_mmx(block, dest, line_size);
-}
-static void ff_vp3_idct_put_mmx(uint8_t *dest, int line_size, DCTELEM *block)
-{
- ff_vp3_idct_mmx(block);
- put_signed_pixels_clamped_mmx(block, dest, line_size);
-}
-static void ff_vp3_idct_add_mmx(uint8_t *dest, int line_size, DCTELEM *block)
-{
- ff_vp3_idct_mmx(block);
- add_pixels_clamped_mmx(block, dest, line_size);
-}
-static void ff_idct_xvid_mmx_put(uint8_t *dest, int line_size, DCTELEM *block)
-{
- ff_idct_xvid_mmx (block);
- put_pixels_clamped_mmx(block, dest, line_size);
-}
-static void ff_idct_xvid_mmx_add(uint8_t *dest, int line_size, DCTELEM *block)
-{
- ff_idct_xvid_mmx (block);
- add_pixels_clamped_mmx(block, dest, line_size);
-}
-static void ff_idct_xvid_mmx2_put(uint8_t *dest, int line_size, DCTELEM *block)
-{
- ff_idct_xvid_mmx2 (block);
- put_pixels_clamped_mmx(block, dest, line_size);
-}
-static void ff_idct_xvid_mmx2_add(uint8_t *dest, int line_size, DCTELEM *block)
-{
- ff_idct_xvid_mmx2 (block);
- add_pixels_clamped_mmx(block, dest, line_size);
-}
-
-static void vorbis_inverse_coupling_3dnow(float *mag, float *ang, int blocksize)
-{
- int i;
- asm volatile("pxor %%mm7, %%mm7":);
- for(i=0; i<blocksize; i+=2) {
- asm volatile(
- "movq %0, %%mm0 \n\t"
- "movq %1, %%mm1 \n\t"
- "movq %%mm0, %%mm2 \n\t"
- "movq %%mm1, %%mm3 \n\t"
- "pfcmpge %%mm7, %%mm2 \n\t" // m <= 0.0
- "pfcmpge %%mm7, %%mm3 \n\t" // a <= 0.0
- "pslld $31, %%mm2 \n\t" // keep only the sign bit
- "pxor %%mm2, %%mm1 \n\t"
- "movq %%mm3, %%mm4 \n\t"
- "pand %%mm1, %%mm3 \n\t"
- "pandn %%mm1, %%mm4 \n\t"
- "pfadd %%mm0, %%mm3 \n\t" // a = m + ((a<0) & (a ^ sign(m)))
- "pfsub %%mm4, %%mm0 \n\t" // m = m + ((a>0) & (a ^ sign(m)))
- "movq %%mm3, %1 \n\t"
- "movq %%mm0, %0 \n\t"
- :"+m"(mag[i]), "+m"(ang[i])
- ::"memory"
- );
- }
- asm volatile("femms");
-}
-static void vorbis_inverse_coupling_sse(float *mag, float *ang, int blocksize)
-{
- int i;
-
- asm volatile(
- "movaps %0, %%xmm5 \n\t"
- ::"m"(ff_pdw_80000000[0])
- );
- for(i=0; i<blocksize; i+=4) {
- asm volatile(
- "movaps %0, %%xmm0 \n\t"
- "movaps %1, %%xmm1 \n\t"
- "xorps %%xmm2, %%xmm2 \n\t"
- "xorps %%xmm3, %%xmm3 \n\t"
- "cmpleps %%xmm0, %%xmm2 \n\t" // m <= 0.0
- "cmpleps %%xmm1, %%xmm3 \n\t" // a <= 0.0
- "andps %%xmm5, %%xmm2 \n\t" // keep only the sign bit
- "xorps %%xmm2, %%xmm1 \n\t"
- "movaps %%xmm3, %%xmm4 \n\t"
- "andps %%xmm1, %%xmm3 \n\t"
- "andnps %%xmm1, %%xmm4 \n\t"
- "addps %%xmm0, %%xmm3 \n\t" // a = m + ((a<0) & (a ^ sign(m)))
- "subps %%xmm4, %%xmm0 \n\t" // m = m + ((a>0) & (a ^ sign(m)))
- "movaps %%xmm3, %1 \n\t"
- "movaps %%xmm0, %0 \n\t"
- :"+m"(mag[i]), "+m"(ang[i])
- ::"memory"
- );
- }
-}
-
-static void vector_fmul_3dnow(float *dst, const float *src, int len){
- long i = (len-4)*4;
- asm volatile(
- "1: \n\t"
- "movq (%1,%0), %%mm0 \n\t"
- "movq 8(%1,%0), %%mm1 \n\t"
- "pfmul (%2,%0), %%mm0 \n\t"
- "pfmul 8(%2,%0), %%mm1 \n\t"
- "movq %%mm0, (%1,%0) \n\t"
- "movq %%mm1, 8(%1,%0) \n\t"
- "sub $16, %0 \n\t"
- "jge 1b \n\t"
- "femms \n\t"
- :"+r"(i)
- :"r"(dst), "r"(src)
- :"memory"
- );
-}
-static void vector_fmul_sse(float *dst, const float *src, int len){
- long i = (len-8)*4;
- asm volatile(
- "1: \n\t"
- "movaps (%1,%0), %%xmm0 \n\t"
- "movaps 16(%1,%0), %%xmm1 \n\t"
- "mulps (%2,%0), %%xmm0 \n\t"
- "mulps 16(%2,%0), %%xmm1 \n\t"
- "movaps %%xmm0, (%1,%0) \n\t"
- "movaps %%xmm1, 16(%1,%0) \n\t"
- "sub $32, %0 \n\t"
- "jge 1b \n\t"
- :"+r"(i)
- :"r"(dst), "r"(src)
- :"memory"
- );
-}
-
-static void vector_fmul_reverse_3dnow2(float *dst, const float *src0, const float *src1, int len){
- long i = len*4-16;
- asm volatile(
- "1: \n\t"
- "pswapd 8(%1), %%mm0 \n\t"
- "pswapd (%1), %%mm1 \n\t"
- "pfmul (%3,%0), %%mm0 \n\t"
- "pfmul 8(%3,%0), %%mm1 \n\t"
- "movq %%mm0, (%2,%0) \n\t"
- "movq %%mm1, 8(%2,%0) \n\t"
- "add $16, %1 \n\t"
- "sub $16, %0 \n\t"
- "jge 1b \n\t"
- :"+r"(i), "+r"(src1)
- :"r"(dst), "r"(src0)
- );
- asm volatile("femms");
-}
-static void vector_fmul_reverse_sse(float *dst, const float *src0, const float *src1, int len){
- long i = len*4-32;
- asm volatile(
- "1: \n\t"
- "movaps 16(%1), %%xmm0 \n\t"
- "movaps (%1), %%xmm1 \n\t"
- "shufps $0x1b, %%xmm0, %%xmm0 \n\t"
- "shufps $0x1b, %%xmm1, %%xmm1 \n\t"
- "mulps (%3,%0), %%xmm0 \n\t"
- "mulps 16(%3,%0), %%xmm1 \n\t"
- "movaps %%xmm0, (%2,%0) \n\t"
- "movaps %%xmm1, 16(%2,%0) \n\t"
- "add $32, %1 \n\t"
- "sub $32, %0 \n\t"
- "jge 1b \n\t"
- :"+r"(i), "+r"(src1)
- :"r"(dst), "r"(src0)
- );
-}
-
-static void vector_fmul_add_add_3dnow(float *dst, const float *src0, const float *src1,
- const float *src2, int src3, int len, int step){
- long i = (len-4)*4;
- if(step == 2 && src3 == 0){
- dst += (len-4)*2;
- asm volatile(
- "1: \n\t"
- "movq (%2,%0), %%mm0 \n\t"
- "movq 8(%2,%0), %%mm1 \n\t"
- "pfmul (%3,%0), %%mm0 \n\t"
- "pfmul 8(%3,%0), %%mm1 \n\t"
- "pfadd (%4,%0), %%mm0 \n\t"
- "pfadd 8(%4,%0), %%mm1 \n\t"
- "movd %%mm0, (%1) \n\t"
- "movd %%mm1, 16(%1) \n\t"
- "psrlq $32, %%mm0 \n\t"
- "psrlq $32, %%mm1 \n\t"
- "movd %%mm0, 8(%1) \n\t"
- "movd %%mm1, 24(%1) \n\t"
- "sub $32, %1 \n\t"
- "sub $16, %0 \n\t"
- "jge 1b \n\t"
- :"+r"(i), "+r"(dst)
- :"r"(src0), "r"(src1), "r"(src2)
- :"memory"
- );
- }
- else if(step == 1 && src3 == 0){
- asm volatile(
- "1: \n\t"
- "movq (%2,%0), %%mm0 \n\t"
- "movq 8(%2,%0), %%mm1 \n\t"
- "pfmul (%3,%0), %%mm0 \n\t"
- "pfmul 8(%3,%0), %%mm1 \n\t"
- "pfadd (%4,%0), %%mm0 \n\t"
- "pfadd 8(%4,%0), %%mm1 \n\t"
- "movq %%mm0, (%1,%0) \n\t"
- "movq %%mm1, 8(%1,%0) \n\t"
- "sub $16, %0 \n\t"
- "jge 1b \n\t"
- :"+r"(i)
- :"r"(dst), "r"(src0), "r"(src1), "r"(src2)
- :"memory"
- );
- }
- else
- ff_vector_fmul_add_add_c(dst, src0, src1, src2, src3, len, step);
- asm volatile("femms");
-}
-static void vector_fmul_add_add_sse(float *dst, const float *src0, const float *src1,
- const float *src2, int src3, int len, int step){
- long i = (len-8)*4;
- if(step == 2 && src3 == 0){
- dst += (len-8)*2;
- asm volatile(
- "1: \n\t"
- "movaps (%2,%0), %%xmm0 \n\t"
- "movaps 16(%2,%0), %%xmm1 \n\t"
- "mulps (%3,%0), %%xmm0 \n\t"
- "mulps 16(%3,%0), %%xmm1 \n\t"
- "addps (%4,%0), %%xmm0 \n\t"
- "addps 16(%4,%0), %%xmm1 \n\t"
- "movss %%xmm0, (%1) \n\t"
- "movss %%xmm1, 32(%1) \n\t"
- "movhlps %%xmm0, %%xmm2 \n\t"
- "movhlps %%xmm1, %%xmm3 \n\t"
- "movss %%xmm2, 16(%1) \n\t"
- "movss %%xmm3, 48(%1) \n\t"
- "shufps $0xb1, %%xmm0, %%xmm0 \n\t"
- "shufps $0xb1, %%xmm1, %%xmm1 \n\t"
- "movss %%xmm0, 8(%1) \n\t"
- "movss %%xmm1, 40(%1) \n\t"
- "movhlps %%xmm0, %%xmm2 \n\t"
- "movhlps %%xmm1, %%xmm3 \n\t"
- "movss %%xmm2, 24(%1) \n\t"
- "movss %%xmm3, 56(%1) \n\t"
- "sub $64, %1 \n\t"
- "sub $32, %0 \n\t"
- "jge 1b \n\t"
- :"+r"(i), "+r"(dst)
- :"r"(src0), "r"(src1), "r"(src2)
- :"memory"
- );
- }
- else if(step == 1 && src3 == 0){
- asm volatile(
- "1: \n\t"
- "movaps (%2,%0), %%xmm0 \n\t"
- "movaps 16(%2,%0), %%xmm1 \n\t"
- "mulps (%3,%0), %%xmm0 \n\t"
- "mulps 16(%3,%0), %%xmm1 \n\t"
- "addps (%4,%0), %%xmm0 \n\t"
- "addps 16(%4,%0), %%xmm1 \n\t"
- "movaps %%xmm0, (%1,%0) \n\t"
- "movaps %%xmm1, 16(%1,%0) \n\t"
- "sub $32, %0 \n\t"
- "jge 1b \n\t"
- :"+r"(i)
- :"r"(dst), "r"(src0), "r"(src1), "r"(src2)
- :"memory"
- );
- }
- else
- ff_vector_fmul_add_add_c(dst, src0, src1, src2, src3, len, step);
-}
-
-static void float_to_int16_3dnow(int16_t *dst, const float *src, int len){
- // not bit-exact: pf2id uses different rounding than C and SSE
- int i;
- for(i=0; i<len; i+=4) {
- asm volatile(
- "pf2id %1, %%mm0 \n\t"
- "pf2id %2, %%mm1 \n\t"
- "packssdw %%mm1, %%mm0 \n\t"
- "movq %%mm0, %0 \n\t"
- :"=m"(dst[i])
- :"m"(src[i]), "m"(src[i+2])
- );
- }
- asm volatile("femms");
-}
-static void float_to_int16_sse(int16_t *dst, const float *src, int len){
- int i;
- for(i=0; i<len; i+=4) {
- asm volatile(
- "cvtps2pi %1, %%mm0 \n\t"
- "cvtps2pi %2, %%mm1 \n\t"
- "packssdw %%mm1, %%mm0 \n\t"
- "movq %%mm0, %0 \n\t"
- :"=m"(dst[i])
- :"m"(src[i]), "m"(src[i+2])
- );
- }
- asm volatile("emms");
-}
-
-#ifdef CONFIG_SNOW_ENCODER
-extern void ff_snow_horizontal_compose97i_sse2(DWTELEM *b, int width);
-extern void ff_snow_horizontal_compose97i_mmx(DWTELEM *b, int width);
-extern void ff_snow_vertical_compose97i_sse2(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, DWTELEM *b3, DWTELEM *b4, DWTELEM *b5, int width);
-extern void ff_snow_vertical_compose97i_mmx(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, DWTELEM *b3, DWTELEM *b4, DWTELEM *b5, int width);
-extern void ff_snow_inner_add_yblock_sse2(uint8_t *obmc, const int obmc_stride, uint8_t * * block, int b_w, int b_h,
- int src_x, int src_y, int src_stride, slice_buffer * sb, int add, uint8_t * dst8);
-extern void ff_snow_inner_add_yblock_mmx(uint8_t *obmc, const int obmc_stride, uint8_t * * block, int b_w, int b_h,
- int src_x, int src_y, int src_stride, slice_buffer * sb, int add, uint8_t * dst8);
-#endif
-
-void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
-{
- mm_flags = mm_support();
-
- if (avctx->dsp_mask) {
- if (avctx->dsp_mask & FF_MM_FORCE)
- mm_flags |= (avctx->dsp_mask & 0xffff);
- else
- mm_flags &= ~(avctx->dsp_mask & 0xffff);
- }
-
-#if 0
- av_log(avctx, AV_LOG_INFO, "libavcodec: CPU flags:");
- if (mm_flags & MM_MMX)
- av_log(avctx, AV_LOG_INFO, " mmx");
- if (mm_flags & MM_MMXEXT)
- av_log(avctx, AV_LOG_INFO, " mmxext");
- if (mm_flags & MM_3DNOW)
- av_log(avctx, AV_LOG_INFO, " 3dnow");
- if (mm_flags & MM_SSE)
- av_log(avctx, AV_LOG_INFO, " sse");
- if (mm_flags & MM_SSE2)
- av_log(avctx, AV_LOG_INFO, " sse2");
- av_log(avctx, AV_LOG_INFO, "\n");
-#endif
-
- if (mm_flags & MM_MMX) {
- const int idct_algo= avctx->idct_algo;
-
-#ifdef CONFIG_ENCODERS
- const int dct_algo = avctx->dct_algo;
- if(dct_algo==FF_DCT_AUTO || dct_algo==FF_DCT_MMX){
- if(mm_flags & MM_SSE2){
- c->fdct = ff_fdct_sse2;
- }else if(mm_flags & MM_MMXEXT){
- c->fdct = ff_fdct_mmx2;
- }else{
- c->fdct = ff_fdct_mmx;
- }
- }
-#endif //CONFIG_ENCODERS
- if(avctx->lowres==0){
- if(idct_algo==FF_IDCT_AUTO || idct_algo==FF_IDCT_SIMPLEMMX){
- c->idct_put= ff_simple_idct_put_mmx;
- c->idct_add= ff_simple_idct_add_mmx;
- c->idct = ff_simple_idct_mmx;
- c->idct_permutation_type= FF_SIMPLE_IDCT_PERM;
-#ifdef CONFIG_GPL
- }else if(idct_algo==FF_IDCT_LIBMPEG2MMX){
- if(mm_flags & MM_MMXEXT){
- c->idct_put= ff_libmpeg2mmx2_idct_put;
- c->idct_add= ff_libmpeg2mmx2_idct_add;
- c->idct = ff_mmxext_idct;
- }else{
- c->idct_put= ff_libmpeg2mmx_idct_put;
- c->idct_add= ff_libmpeg2mmx_idct_add;
- c->idct = ff_mmx_idct;
- }
- c->idct_permutation_type= FF_LIBMPEG2_IDCT_PERM;
-#endif
- }else if(idct_algo==FF_IDCT_VP3 &&
- avctx->codec->id!=CODEC_ID_THEORA &&
- !(avctx->flags & CODEC_FLAG_BITEXACT)){
- if(mm_flags & MM_SSE2){
- c->idct_put= ff_vp3_idct_put_sse2;
- c->idct_add= ff_vp3_idct_add_sse2;
- c->idct = ff_vp3_idct_sse2;
- c->idct_permutation_type= FF_TRANSPOSE_IDCT_PERM;
- }else{
- ff_vp3_dsp_init_mmx();
- c->idct_put= ff_vp3_idct_put_mmx;
- c->idct_add= ff_vp3_idct_add_mmx;
- c->idct = ff_vp3_idct_mmx;
- c->idct_permutation_type= FF_PARTTRANS_IDCT_PERM;
- }
- }else if(idct_algo==FF_IDCT_CAVS){
- c->idct_permutation_type= FF_TRANSPOSE_IDCT_PERM;
- }else if(idct_algo==FF_IDCT_XVIDMMX){
- if(mm_flags & MM_MMXEXT){
- c->idct_put= ff_idct_xvid_mmx2_put;
- c->idct_add= ff_idct_xvid_mmx2_add;
- c->idct = ff_idct_xvid_mmx2;
- }else{
- c->idct_put= ff_idct_xvid_mmx_put;
- c->idct_add= ff_idct_xvid_mmx_add;
- c->idct = ff_idct_xvid_mmx;
- }
- }
- }
-
-#ifdef CONFIG_ENCODERS
- c->get_pixels = get_pixels_mmx;
- c->diff_pixels = diff_pixels_mmx;
-#endif //CONFIG_ENCODERS
- c->put_pixels_clamped = put_pixels_clamped_mmx;
- c->put_signed_pixels_clamped = put_signed_pixels_clamped_mmx;
- c->add_pixels_clamped = add_pixels_clamped_mmx;
- c->clear_blocks = clear_blocks_mmx;
-#ifdef CONFIG_ENCODERS
- c->pix_sum = pix_sum16_mmx;
-#endif //CONFIG_ENCODERS
-
- c->put_pixels_tab[0][0] = put_pixels16_mmx;
- c->put_pixels_tab[0][1] = put_pixels16_x2_mmx;
- c->put_pixels_tab[0][2] = put_pixels16_y2_mmx;
- c->put_pixels_tab[0][3] = put_pixels16_xy2_mmx;
-
- c->put_no_rnd_pixels_tab[0][0] = put_pixels16_mmx;
- c->put_no_rnd_pixels_tab[0][1] = put_no_rnd_pixels16_x2_mmx;
- c->put_no_rnd_pixels_tab[0][2] = put_no_rnd_pixels16_y2_mmx;
- c->put_no_rnd_pixels_tab[0][3] = put_no_rnd_pixels16_xy2_mmx;
-
- c->avg_pixels_tab[0][0] = avg_pixels16_mmx;
- c->avg_pixels_tab[0][1] = avg_pixels16_x2_mmx;
- c->avg_pixels_tab[0][2] = avg_pixels16_y2_mmx;
- c->avg_pixels_tab[0][3] = avg_pixels16_xy2_mmx;
-
- c->avg_no_rnd_pixels_tab[0][0] = avg_no_rnd_pixels16_mmx;
- c->avg_no_rnd_pixels_tab[0][1] = avg_no_rnd_pixels16_x2_mmx;
- c->avg_no_rnd_pixels_tab[0][2] = avg_no_rnd_pixels16_y2_mmx;
- c->avg_no_rnd_pixels_tab[0][3] = avg_no_rnd_pixels16_xy2_mmx;
-
- c->put_pixels_tab[1][0] = put_pixels8_mmx;
- c->put_pixels_tab[1][1] = put_pixels8_x2_mmx;
- c->put_pixels_tab[1][2] = put_pixels8_y2_mmx;
- c->put_pixels_tab[1][3] = put_pixels8_xy2_mmx;
-
- c->put_no_rnd_pixels_tab[1][0] = put_pixels8_mmx;
- c->put_no_rnd_pixels_tab[1][1] = put_no_rnd_pixels8_x2_mmx;
- c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y2_mmx;
- c->put_no_rnd_pixels_tab[1][3] = put_no_rnd_pixels8_xy2_mmx;
-
- c->avg_pixels_tab[1][0] = avg_pixels8_mmx;
- c->avg_pixels_tab[1][1] = avg_pixels8_x2_mmx;
- c->avg_pixels_tab[1][2] = avg_pixels8_y2_mmx;
- c->avg_pixels_tab[1][3] = avg_pixels8_xy2_mmx;
-
- c->avg_no_rnd_pixels_tab[1][0] = avg_no_rnd_pixels8_mmx;
- c->avg_no_rnd_pixels_tab[1][1] = avg_no_rnd_pixels8_x2_mmx;
- c->avg_no_rnd_pixels_tab[1][2] = avg_no_rnd_pixels8_y2_mmx;
- c->avg_no_rnd_pixels_tab[1][3] = avg_no_rnd_pixels8_xy2_mmx;
-
- c->gmc= gmc_mmx;
-
- c->add_bytes= add_bytes_mmx;
-#ifdef CONFIG_ENCODERS
- c->diff_bytes= diff_bytes_mmx;
-
- c->hadamard8_diff[0]= hadamard8_diff16_mmx;
- c->hadamard8_diff[1]= hadamard8_diff_mmx;
-
- c->pix_norm1 = pix_norm1_mmx;
- c->sse[0] = (mm_flags & MM_SSE2) ? sse16_sse2 : sse16_mmx;
- c->sse[1] = sse8_mmx;
- c->vsad[4]= vsad_intra16_mmx;
-
- c->nsse[0] = nsse16_mmx;
- c->nsse[1] = nsse8_mmx;
- if(!(avctx->flags & CODEC_FLAG_BITEXACT)){
- c->vsad[0] = vsad16_mmx;
- }
-
- if(!(avctx->flags & CODEC_FLAG_BITEXACT)){
- c->try_8x8basis= try_8x8basis_mmx;
- }
- c->add_8x8basis= add_8x8basis_mmx;
-
-#endif //CONFIG_ENCODERS
-
- c->h263_v_loop_filter= h263_v_loop_filter_mmx;
- c->h263_h_loop_filter= h263_h_loop_filter_mmx;
- c->put_h264_chroma_pixels_tab[0]= put_h264_chroma_mc8_mmx;
- c->put_h264_chroma_pixels_tab[1]= put_h264_chroma_mc4_mmx;
-
- c->h264_idct_dc_add=
- c->h264_idct_add= ff_h264_idct_add_mmx;
- c->h264_idct8_dc_add=
- c->h264_idct8_add= ff_h264_idct8_add_mmx;
-
- if (mm_flags & MM_MMXEXT) {
- c->prefetch = prefetch_mmx2;
-
- c->put_pixels_tab[0][1] = put_pixels16_x2_mmx2;
- c->put_pixels_tab[0][2] = put_pixels16_y2_mmx2;
-
- c->avg_pixels_tab[0][0] = avg_pixels16_mmx2;
- c->avg_pixels_tab[0][1] = avg_pixels16_x2_mmx2;
- c->avg_pixels_tab[0][2] = avg_pixels16_y2_mmx2;
-
- c->put_pixels_tab[1][1] = put_pixels8_x2_mmx2;
- c->put_pixels_tab[1][2] = put_pixels8_y2_mmx2;
-
- c->avg_pixels_tab[1][0] = avg_pixels8_mmx2;
- c->avg_pixels_tab[1][1] = avg_pixels8_x2_mmx2;
- c->avg_pixels_tab[1][2] = avg_pixels8_y2_mmx2;
-
-#ifdef CONFIG_ENCODERS
- c->hadamard8_diff[0]= hadamard8_diff16_mmx2;
- c->hadamard8_diff[1]= hadamard8_diff_mmx2;
- c->vsad[4]= vsad_intra16_mmx2;
-#endif //CONFIG_ENCODERS
-
- c->h264_idct_dc_add= ff_h264_idct_dc_add_mmx2;
- c->h264_idct8_dc_add= ff_h264_idct8_dc_add_mmx2;
-
- if(!(avctx->flags & CODEC_FLAG_BITEXACT)){
- c->put_no_rnd_pixels_tab[0][1] = put_no_rnd_pixels16_x2_mmx2;
- c->put_no_rnd_pixels_tab[0][2] = put_no_rnd_pixels16_y2_mmx2;
- c->put_no_rnd_pixels_tab[1][1] = put_no_rnd_pixels8_x2_mmx2;
- c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y2_mmx2;
- c->avg_pixels_tab[0][3] = avg_pixels16_xy2_mmx2;
- c->avg_pixels_tab[1][3] = avg_pixels8_xy2_mmx2;
-#ifdef CONFIG_ENCODERS
- c->vsad[0] = vsad16_mmx2;
-#endif //CONFIG_ENCODERS
- }
-
-#if 1
- SET_QPEL_FUNC(qpel_pixels_tab[0][ 0], qpel16_mc00_mmx2)
- SET_QPEL_FUNC(qpel_pixels_tab[0][ 1], qpel16_mc10_mmx2)
- SET_QPEL_FUNC(qpel_pixels_tab[0][ 2], qpel16_mc20_mmx2)
- SET_QPEL_FUNC(qpel_pixels_tab[0][ 3], qpel16_mc30_mmx2)
- SET_QPEL_FUNC(qpel_pixels_tab[0][ 4], qpel16_mc01_mmx2)
- SET_QPEL_FUNC(qpel_pixels_tab[0][ 5], qpel16_mc11_mmx2)
- SET_QPEL_FUNC(qpel_pixels_tab[0][ 6], qpel16_mc21_mmx2)
- SET_QPEL_FUNC(qpel_pixels_tab[0][ 7], qpel16_mc31_mmx2)
- SET_QPEL_FUNC(qpel_pixels_tab[0][ 8], qpel16_mc02_mmx2)
- SET_QPEL_FUNC(qpel_pixels_tab[0][ 9], qpel16_mc12_mmx2)
- SET_QPEL_FUNC(qpel_pixels_tab[0][10], qpel16_mc22_mmx2)
- SET_QPEL_FUNC(qpel_pixels_tab[0][11], qpel16_mc32_mmx2)
- SET_QPEL_FUNC(qpel_pixels_tab[0][12], qpel16_mc03_mmx2)
- SET_QPEL_FUNC(qpel_pixels_tab[0][13], qpel16_mc13_mmx2)
- SET_QPEL_FUNC(qpel_pixels_tab[0][14], qpel16_mc23_mmx2)
- SET_QPEL_FUNC(qpel_pixels_tab[0][15], qpel16_mc33_mmx2)
- SET_QPEL_FUNC(qpel_pixels_tab[1][ 0], qpel8_mc00_mmx2)
- SET_QPEL_FUNC(qpel_pixels_tab[1][ 1], qpel8_mc10_mmx2)
- SET_QPEL_FUNC(qpel_pixels_tab[1][ 2], qpel8_mc20_mmx2)
- SET_QPEL_FUNC(qpel_pixels_tab[1][ 3], qpel8_mc30_mmx2)
- SET_QPEL_FUNC(qpel_pixels_tab[1][ 4], qpel8_mc01_mmx2)
- SET_QPEL_FUNC(qpel_pixels_tab[1][ 5], qpel8_mc11_mmx2)
- SET_QPEL_FUNC(qpel_pixels_tab[1][ 6], qpel8_mc21_mmx2)
- SET_QPEL_FUNC(qpel_pixels_tab[1][ 7], qpel8_mc31_mmx2)
- SET_QPEL_FUNC(qpel_pixels_tab[1][ 8], qpel8_mc02_mmx2)
- SET_QPEL_FUNC(qpel_pixels_tab[1][ 9], qpel8_mc12_mmx2)
- SET_QPEL_FUNC(qpel_pixels_tab[1][10], qpel8_mc22_mmx2)
- SET_QPEL_FUNC(qpel_pixels_tab[1][11], qpel8_mc32_mmx2)
- SET_QPEL_FUNC(qpel_pixels_tab[1][12], qpel8_mc03_mmx2)
- SET_QPEL_FUNC(qpel_pixels_tab[1][13], qpel8_mc13_mmx2)
- SET_QPEL_FUNC(qpel_pixels_tab[1][14], qpel8_mc23_mmx2)
- SET_QPEL_FUNC(qpel_pixels_tab[1][15], qpel8_mc33_mmx2)
-#endif
-
-//FIXME 3dnow too
-#define dspfunc(PFX, IDX, NUM) \
- c->PFX ## _pixels_tab[IDX][ 0] = PFX ## NUM ## _mc00_mmx2; \
- c->PFX ## _pixels_tab[IDX][ 1] = PFX ## NUM ## _mc10_mmx2; \
- c->PFX ## _pixels_tab[IDX][ 2] = PFX ## NUM ## _mc20_mmx2; \
- c->PFX ## _pixels_tab[IDX][ 3] = PFX ## NUM ## _mc30_mmx2; \
- c->PFX ## _pixels_tab[IDX][ 4] = PFX ## NUM ## _mc01_mmx2; \
- c->PFX ## _pixels_tab[IDX][ 5] = PFX ## NUM ## _mc11_mmx2; \
- c->PFX ## _pixels_tab[IDX][ 6] = PFX ## NUM ## _mc21_mmx2; \
- c->PFX ## _pixels_tab[IDX][ 7] = PFX ## NUM ## _mc31_mmx2; \
- c->PFX ## _pixels_tab[IDX][ 8] = PFX ## NUM ## _mc02_mmx2; \
- c->PFX ## _pixels_tab[IDX][ 9] = PFX ## NUM ## _mc12_mmx2; \
- c->PFX ## _pixels_tab[IDX][10] = PFX ## NUM ## _mc22_mmx2; \
- c->PFX ## _pixels_tab[IDX][11] = PFX ## NUM ## _mc32_mmx2; \
- c->PFX ## _pixels_tab[IDX][12] = PFX ## NUM ## _mc03_mmx2; \
- c->PFX ## _pixels_tab[IDX][13] = PFX ## NUM ## _mc13_mmx2; \
- c->PFX ## _pixels_tab[IDX][14] = PFX ## NUM ## _mc23_mmx2; \
- c->PFX ## _pixels_tab[IDX][15] = PFX ## NUM ## _mc33_mmx2
-
- dspfunc(put_h264_qpel, 0, 16);
- dspfunc(put_h264_qpel, 1, 8);
- dspfunc(put_h264_qpel, 2, 4);
- dspfunc(avg_h264_qpel, 0, 16);
- dspfunc(avg_h264_qpel, 1, 8);
- dspfunc(avg_h264_qpel, 2, 4);
-
- dspfunc(put_2tap_qpel, 0, 16);
- dspfunc(put_2tap_qpel, 1, 8);
- dspfunc(avg_2tap_qpel, 0, 16);
- dspfunc(avg_2tap_qpel, 1, 8);
-#undef dspfunc
-
- c->avg_h264_chroma_pixels_tab[0]= avg_h264_chroma_mc8_mmx2;
- c->avg_h264_chroma_pixels_tab[1]= avg_h264_chroma_mc4_mmx2;
- c->avg_h264_chroma_pixels_tab[2]= avg_h264_chroma_mc2_mmx2;
- c->put_h264_chroma_pixels_tab[2]= put_h264_chroma_mc2_mmx2;
- c->h264_v_loop_filter_luma= h264_v_loop_filter_luma_mmx2;
- c->h264_h_loop_filter_luma= h264_h_loop_filter_luma_mmx2;
- c->h264_v_loop_filter_chroma= h264_v_loop_filter_chroma_mmx2;
- c->h264_h_loop_filter_chroma= h264_h_loop_filter_chroma_mmx2;
- c->h264_v_loop_filter_chroma_intra= h264_v_loop_filter_chroma_intra_mmx2;
- c->h264_h_loop_filter_chroma_intra= h264_h_loop_filter_chroma_intra_mmx2;
- c->h264_loop_filter_strength= h264_loop_filter_strength_mmx2;
-
- c->weight_h264_pixels_tab[0]= ff_h264_weight_16x16_mmx2;
- c->weight_h264_pixels_tab[1]= ff_h264_weight_16x8_mmx2;
- c->weight_h264_pixels_tab[2]= ff_h264_weight_8x16_mmx2;
- c->weight_h264_pixels_tab[3]= ff_h264_weight_8x8_mmx2;
- c->weight_h264_pixels_tab[4]= ff_h264_weight_8x4_mmx2;
- c->weight_h264_pixels_tab[5]= ff_h264_weight_4x8_mmx2;
- c->weight_h264_pixels_tab[6]= ff_h264_weight_4x4_mmx2;
- c->weight_h264_pixels_tab[7]= ff_h264_weight_4x2_mmx2;
-
- c->biweight_h264_pixels_tab[0]= ff_h264_biweight_16x16_mmx2;
- c->biweight_h264_pixels_tab[1]= ff_h264_biweight_16x8_mmx2;
- c->biweight_h264_pixels_tab[2]= ff_h264_biweight_8x16_mmx2;
- c->biweight_h264_pixels_tab[3]= ff_h264_biweight_8x8_mmx2;
- c->biweight_h264_pixels_tab[4]= ff_h264_biweight_8x4_mmx2;
- c->biweight_h264_pixels_tab[5]= ff_h264_biweight_4x8_mmx2;
- c->biweight_h264_pixels_tab[6]= ff_h264_biweight_4x4_mmx2;
- c->biweight_h264_pixels_tab[7]= ff_h264_biweight_4x2_mmx2;
-
-#ifdef CONFIG_CAVS_DECODER
- ff_cavsdsp_init_mmx2(c, avctx);
-#endif
-
-#ifdef CONFIG_ENCODERS
- c->sub_hfyu_median_prediction= sub_hfyu_median_prediction_mmx2;
-#endif //CONFIG_ENCODERS
- } else if (mm_flags & MM_3DNOW) {
- c->prefetch = prefetch_3dnow;
-
- c->put_pixels_tab[0][1] = put_pixels16_x2_3dnow;
- c->put_pixels_tab[0][2] = put_pixels16_y2_3dnow;
-
- c->avg_pixels_tab[0][0] = avg_pixels16_3dnow;
- c->avg_pixels_tab[0][1] = avg_pixels16_x2_3dnow;
- c->avg_pixels_tab[0][2] = avg_pixels16_y2_3dnow;
-
- c->put_pixels_tab[1][1] = put_pixels8_x2_3dnow;
- c->put_pixels_tab[1][2] = put_pixels8_y2_3dnow;
-
- c->avg_pixels_tab[1][0] = avg_pixels8_3dnow;
- c->avg_pixels_tab[1][1] = avg_pixels8_x2_3dnow;
- c->avg_pixels_tab[1][2] = avg_pixels8_y2_3dnow;
-
- if(!(avctx->flags & CODEC_FLAG_BITEXACT)){
- c->put_no_rnd_pixels_tab[0][1] = put_no_rnd_pixels16_x2_3dnow;
- c->put_no_rnd_pixels_tab[0][2] = put_no_rnd_pixels16_y2_3dnow;
- c->put_no_rnd_pixels_tab[1][1] = put_no_rnd_pixels8_x2_3dnow;
- c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y2_3dnow;
- c->avg_pixels_tab[0][3] = avg_pixels16_xy2_3dnow;
- c->avg_pixels_tab[1][3] = avg_pixels8_xy2_3dnow;
- }
-
- SET_QPEL_FUNC(qpel_pixels_tab[0][ 0], qpel16_mc00_3dnow)
- SET_QPEL_FUNC(qpel_pixels_tab[0][ 1], qpel16_mc10_3dnow)
- SET_QPEL_FUNC(qpel_pixels_tab[0][ 2], qpel16_mc20_3dnow)
- SET_QPEL_FUNC(qpel_pixels_tab[0][ 3], qpel16_mc30_3dnow)
- SET_QPEL_FUNC(qpel_pixels_tab[0][ 4], qpel16_mc01_3dnow)
- SET_QPEL_FUNC(qpel_pixels_tab[0][ 5], qpel16_mc11_3dnow)
- SET_QPEL_FUNC(qpel_pixels_tab[0][ 6], qpel16_mc21_3dnow)
- SET_QPEL_FUNC(qpel_pixels_tab[0][ 7], qpel16_mc31_3dnow)
- SET_QPEL_FUNC(qpel_pixels_tab[0][ 8], qpel16_mc02_3dnow)
- SET_QPEL_FUNC(qpel_pixels_tab[0][ 9], qpel16_mc12_3dnow)
- SET_QPEL_FUNC(qpel_pixels_tab[0][10], qpel16_mc22_3dnow)
- SET_QPEL_FUNC(qpel_pixels_tab[0][11], qpel16_mc32_3dnow)
- SET_QPEL_FUNC(qpel_pixels_tab[0][12], qpel16_mc03_3dnow)
- SET_QPEL_FUNC(qpel_pixels_tab[0][13], qpel16_mc13_3dnow)
- SET_QPEL_FUNC(qpel_pixels_tab[0][14], qpel16_mc23_3dnow)
- SET_QPEL_FUNC(qpel_pixels_tab[0][15], qpel16_mc33_3dnow)
- SET_QPEL_FUNC(qpel_pixels_tab[1][ 0], qpel8_mc00_3dnow)
- SET_QPEL_FUNC(qpel_pixels_tab[1][ 1], qpel8_mc10_3dnow)
- SET_QPEL_FUNC(qpel_pixels_tab[1][ 2], qpel8_mc20_3dnow)
- SET_QPEL_FUNC(qpel_pixels_tab[1][ 3], qpel8_mc30_3dnow)
- SET_QPEL_FUNC(qpel_pixels_tab[1][ 4], qpel8_mc01_3dnow)
- SET_QPEL_FUNC(qpel_pixels_tab[1][ 5], qpel8_mc11_3dnow)
- SET_QPEL_FUNC(qpel_pixels_tab[1][ 6], qpel8_mc21_3dnow)
- SET_QPEL_FUNC(qpel_pixels_tab[1][ 7], qpel8_mc31_3dnow)
- SET_QPEL_FUNC(qpel_pixels_tab[1][ 8], qpel8_mc02_3dnow)
- SET_QPEL_FUNC(qpel_pixels_tab[1][ 9], qpel8_mc12_3dnow)
- SET_QPEL_FUNC(qpel_pixels_tab[1][10], qpel8_mc22_3dnow)
- SET_QPEL_FUNC(qpel_pixels_tab[1][11], qpel8_mc32_3dnow)
- SET_QPEL_FUNC(qpel_pixels_tab[1][12], qpel8_mc03_3dnow)
- SET_QPEL_FUNC(qpel_pixels_tab[1][13], qpel8_mc13_3dnow)
- SET_QPEL_FUNC(qpel_pixels_tab[1][14], qpel8_mc23_3dnow)
- SET_QPEL_FUNC(qpel_pixels_tab[1][15], qpel8_mc33_3dnow)
-
-#define dspfunc(PFX, IDX, NUM) \
- c->PFX ## _pixels_tab[IDX][ 0] = PFX ## NUM ## _mc00_3dnow; \
- c->PFX ## _pixels_tab[IDX][ 1] = PFX ## NUM ## _mc10_3dnow; \
- c->PFX ## _pixels_tab[IDX][ 2] = PFX ## NUM ## _mc20_3dnow; \
- c->PFX ## _pixels_tab[IDX][ 3] = PFX ## NUM ## _mc30_3dnow; \
- c->PFX ## _pixels_tab[IDX][ 4] = PFX ## NUM ## _mc01_3dnow; \
- c->PFX ## _pixels_tab[IDX][ 5] = PFX ## NUM ## _mc11_3dnow; \
- c->PFX ## _pixels_tab[IDX][ 6] = PFX ## NUM ## _mc21_3dnow; \
- c->PFX ## _pixels_tab[IDX][ 7] = PFX ## NUM ## _mc31_3dnow; \
- c->PFX ## _pixels_tab[IDX][ 8] = PFX ## NUM ## _mc02_3dnow; \
- c->PFX ## _pixels_tab[IDX][ 9] = PFX ## NUM ## _mc12_3dnow; \
- c->PFX ## _pixels_tab[IDX][10] = PFX ## NUM ## _mc22_3dnow; \
- c->PFX ## _pixels_tab[IDX][11] = PFX ## NUM ## _mc32_3dnow; \
- c->PFX ## _pixels_tab[IDX][12] = PFX ## NUM ## _mc03_3dnow; \
- c->PFX ## _pixels_tab[IDX][13] = PFX ## NUM ## _mc13_3dnow; \
- c->PFX ## _pixels_tab[IDX][14] = PFX ## NUM ## _mc23_3dnow; \
- c->PFX ## _pixels_tab[IDX][15] = PFX ## NUM ## _mc33_3dnow
-
- dspfunc(put_h264_qpel, 0, 16);
- dspfunc(put_h264_qpel, 1, 8);
- dspfunc(put_h264_qpel, 2, 4);
- dspfunc(avg_h264_qpel, 0, 16);
- dspfunc(avg_h264_qpel, 1, 8);
- dspfunc(avg_h264_qpel, 2, 4);
-
- dspfunc(put_2tap_qpel, 0, 16);
- dspfunc(put_2tap_qpel, 1, 8);
- dspfunc(avg_2tap_qpel, 0, 16);
- dspfunc(avg_2tap_qpel, 1, 8);
-
- c->avg_h264_chroma_pixels_tab[0]= avg_h264_chroma_mc8_3dnow;
- c->avg_h264_chroma_pixels_tab[1]= avg_h264_chroma_mc4_3dnow;
- }
-
-#ifdef CONFIG_SNOW_ENCODER
- if(mm_flags & MM_SSE2){
- c->horizontal_compose97i = ff_snow_horizontal_compose97i_sse2;
- c->vertical_compose97i = ff_snow_vertical_compose97i_sse2;
- c->inner_add_yblock = ff_snow_inner_add_yblock_sse2;
- }
- else{
- c->horizontal_compose97i = ff_snow_horizontal_compose97i_mmx;
- c->vertical_compose97i = ff_snow_vertical_compose97i_mmx;
- c->inner_add_yblock = ff_snow_inner_add_yblock_mmx;
- }
-#endif
-
- if(mm_flags & MM_3DNOW){
- c->vorbis_inverse_coupling = vorbis_inverse_coupling_3dnow;
- c->vector_fmul = vector_fmul_3dnow;
- if(!(avctx->flags & CODEC_FLAG_BITEXACT))
- c->float_to_int16 = float_to_int16_3dnow;
- }
- if(mm_flags & MM_3DNOWEXT)
- c->vector_fmul_reverse = vector_fmul_reverse_3dnow2;
- if(mm_flags & MM_SSE){
- c->vorbis_inverse_coupling = vorbis_inverse_coupling_sse;
- c->vector_fmul = vector_fmul_sse;
- c->float_to_int16 = float_to_int16_sse;
- c->vector_fmul_reverse = vector_fmul_reverse_sse;
- c->vector_fmul_add_add = vector_fmul_add_add_sse;
- }
- if(mm_flags & MM_3DNOW)
- c->vector_fmul_add_add = vector_fmul_add_add_3dnow; // faster than sse
- }
-
-#ifdef CONFIG_ENCODERS
- dsputil_init_pix_mmx(c, avctx);
-#endif //CONFIG_ENCODERS
-#if 0
- // for speed testing
- get_pixels = just_return;
- put_pixels_clamped = just_return;
- add_pixels_clamped = just_return;
-
- pix_abs16x16 = just_return;
- pix_abs16x16_x2 = just_return;
- pix_abs16x16_y2 = just_return;
- pix_abs16x16_xy2 = just_return;
-
- put_pixels_tab[0] = just_return;
- put_pixels_tab[1] = just_return;
- put_pixels_tab[2] = just_return;
- put_pixels_tab[3] = just_return;
-
- put_no_rnd_pixels_tab[0] = just_return;
- put_no_rnd_pixels_tab[1] = just_return;
- put_no_rnd_pixels_tab[2] = just_return;
- put_no_rnd_pixels_tab[3] = just_return;
-
- avg_pixels_tab[0] = just_return;
- avg_pixels_tab[1] = just_return;
- avg_pixels_tab[2] = just_return;
- avg_pixels_tab[3] = just_return;
-
- avg_no_rnd_pixels_tab[0] = just_return;
- avg_no_rnd_pixels_tab[1] = just_return;
- avg_no_rnd_pixels_tab[2] = just_return;
- avg_no_rnd_pixels_tab[3] = just_return;
-
- //av_fdct = just_return;
- //ff_idct = just_return;
-#endif
-}
diff --git a/src/libffmpeg/libavcodec/i386/dsputil_mmx_avg.h b/src/libffmpeg/libavcodec/i386/dsputil_mmx_avg.h
deleted file mode 100644
index b365cea57..000000000
--- a/src/libffmpeg/libavcodec/i386/dsputil_mmx_avg.h
+++ /dev/null
@@ -1,870 +0,0 @@
-/*
- * DSP utils : average functions are compiled twice for 3dnow/mmx2
- * Copyright (c) 2000, 2001 Fabrice Bellard.
- * Copyright (c) 2002-2004 Michael Niedermayer
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * MMX optimization by Nick Kurshev <nickols_k@mail.ru>
- * mostly rewritten by Michael Niedermayer <michaelni@gmx.at>
- * and improved by Zdenek Kabelac <kabi@users.sf.net>
- */
-
-/* XXX: we use explicit registers to avoid a gcc 2.95.2 register asm
- clobber bug - now it will work with 2.95.2 and also with -fPIC
- */
-static void DEF(put_pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-{
- __asm __volatile(
- "lea (%3, %3), %%"REG_a" \n\t"
- "1: \n\t"
- "movq (%1), %%mm0 \n\t"
- "movq (%1, %3), %%mm1 \n\t"
- PAVGB" 1(%1), %%mm0 \n\t"
- PAVGB" 1(%1, %3), %%mm1 \n\t"
- "movq %%mm0, (%2) \n\t"
- "movq %%mm1, (%2, %3) \n\t"
- "add %%"REG_a", %1 \n\t"
- "add %%"REG_a", %2 \n\t"
- "movq (%1), %%mm0 \n\t"
- "movq (%1, %3), %%mm1 \n\t"
- PAVGB" 1(%1), %%mm0 \n\t"
- PAVGB" 1(%1, %3), %%mm1 \n\t"
- "add %%"REG_a", %1 \n\t"
- "movq %%mm0, (%2) \n\t"
- "movq %%mm1, (%2, %3) \n\t"
- "add %%"REG_a", %2 \n\t"
- "subl $4, %0 \n\t"
- "jnz 1b \n\t"
- :"+g"(h), "+S"(pixels), "+D"(block)
- :"r" ((long)line_size)
- :"%"REG_a, "memory");
-}
-
-static void DEF(put_pixels4_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
-{
- __asm __volatile(
- "testl $1, %0 \n\t"
- " jz 1f \n\t"
- "movd (%1), %%mm0 \n\t"
- "movd (%2), %%mm1 \n\t"
- "add %4, %1 \n\t"
- "add $4, %2 \n\t"
- PAVGB" %%mm1, %%mm0 \n\t"
- "movd %%mm0, (%3) \n\t"
- "add %5, %3 \n\t"
- "decl %0 \n\t"
- "1: \n\t"
- "movd (%1), %%mm0 \n\t"
- "add %4, %1 \n\t"
- "movd (%1), %%mm1 \n\t"
- "movd (%2), %%mm2 \n\t"
- "movd 4(%2), %%mm3 \n\t"
- "add %4, %1 \n\t"
- PAVGB" %%mm2, %%mm0 \n\t"
- PAVGB" %%mm3, %%mm1 \n\t"
- "movd %%mm0, (%3) \n\t"
- "add %5, %3 \n\t"
- "movd %%mm1, (%3) \n\t"
- "add %5, %3 \n\t"
- "movd (%1), %%mm0 \n\t"
- "add %4, %1 \n\t"
- "movd (%1), %%mm1 \n\t"
- "movd 8(%2), %%mm2 \n\t"
- "movd 12(%2), %%mm3 \n\t"
- "add %4, %1 \n\t"
- PAVGB" %%mm2, %%mm0 \n\t"
- PAVGB" %%mm3, %%mm1 \n\t"
- "movd %%mm0, (%3) \n\t"
- "add %5, %3 \n\t"
- "movd %%mm1, (%3) \n\t"
- "add %5, %3 \n\t"
- "add $16, %2 \n\t"
- "subl $4, %0 \n\t"
- "jnz 1b \n\t"
-#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
- :"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
-#else
- :"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
-#endif
- :"S"((long)src1Stride), "D"((long)dstStride)
- :"memory");
-}
-
-
-static void DEF(put_pixels8_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
-{
- __asm __volatile(
- "testl $1, %0 \n\t"
- " jz 1f \n\t"
- "movq (%1), %%mm0 \n\t"
- "movq (%2), %%mm1 \n\t"
- "add %4, %1 \n\t"
- "add $8, %2 \n\t"
- PAVGB" %%mm1, %%mm0 \n\t"
- "movq %%mm0, (%3) \n\t"
- "add %5, %3 \n\t"
- "decl %0 \n\t"
- "1: \n\t"
- "movq (%1), %%mm0 \n\t"
- "add %4, %1 \n\t"
- "movq (%1), %%mm1 \n\t"
- "add %4, %1 \n\t"
- PAVGB" (%2), %%mm0 \n\t"
- PAVGB" 8(%2), %%mm1 \n\t"
- "movq %%mm0, (%3) \n\t"
- "add %5, %3 \n\t"
- "movq %%mm1, (%3) \n\t"
- "add %5, %3 \n\t"
- "movq (%1), %%mm0 \n\t"
- "add %4, %1 \n\t"
- "movq (%1), %%mm1 \n\t"
- "add %4, %1 \n\t"
- PAVGB" 16(%2), %%mm0 \n\t"
- PAVGB" 24(%2), %%mm1 \n\t"
- "movq %%mm0, (%3) \n\t"
- "add %5, %3 \n\t"
- "movq %%mm1, (%3) \n\t"
- "add %5, %3 \n\t"
- "add $32, %2 \n\t"
- "subl $4, %0 \n\t"
- "jnz 1b \n\t"
-#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
- :"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
-#else
- :"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
-#endif
- :"S"((long)src1Stride), "D"((long)dstStride)
- :"memory");
-//the following should be used, though better not with gcc ...
-/* :"+g"(h), "+r"(src1), "+r"(src2), "+r"(dst)
- :"r"(src1Stride), "r"(dstStride)
- :"memory");*/
-}
-
-static void DEF(put_no_rnd_pixels8_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
-{
- __asm __volatile(
- "pcmpeqb %%mm6, %%mm6 \n\t"
- "testl $1, %0 \n\t"
- " jz 1f \n\t"
- "movq (%1), %%mm0 \n\t"
- "movq (%2), %%mm1 \n\t"
- "add %4, %1 \n\t"
- "add $8, %2 \n\t"
- "pxor %%mm6, %%mm0 \n\t"
- "pxor %%mm6, %%mm1 \n\t"
- PAVGB" %%mm1, %%mm0 \n\t"
- "pxor %%mm6, %%mm0 \n\t"
- "movq %%mm0, (%3) \n\t"
- "add %5, %3 \n\t"
- "decl %0 \n\t"
- "1: \n\t"
- "movq (%1), %%mm0 \n\t"
- "add %4, %1 \n\t"
- "movq (%1), %%mm1 \n\t"
- "add %4, %1 \n\t"
- "movq (%2), %%mm2 \n\t"
- "movq 8(%2), %%mm3 \n\t"
- "pxor %%mm6, %%mm0 \n\t"
- "pxor %%mm6, %%mm1 \n\t"
- "pxor %%mm6, %%mm2 \n\t"
- "pxor %%mm6, %%mm3 \n\t"
- PAVGB" %%mm2, %%mm0 \n\t"
- PAVGB" %%mm3, %%mm1 \n\t"
- "pxor %%mm6, %%mm0 \n\t"
- "pxor %%mm6, %%mm1 \n\t"
- "movq %%mm0, (%3) \n\t"
- "add %5, %3 \n\t"
- "movq %%mm1, (%3) \n\t"
- "add %5, %3 \n\t"
- "movq (%1), %%mm0 \n\t"
- "add %4, %1 \n\t"
- "movq (%1), %%mm1 \n\t"
- "add %4, %1 \n\t"
- "movq 16(%2), %%mm2 \n\t"
- "movq 24(%2), %%mm3 \n\t"
- "pxor %%mm6, %%mm0 \n\t"
- "pxor %%mm6, %%mm1 \n\t"
- "pxor %%mm6, %%mm2 \n\t"
- "pxor %%mm6, %%mm3 \n\t"
- PAVGB" %%mm2, %%mm0 \n\t"
- PAVGB" %%mm3, %%mm1 \n\t"
- "pxor %%mm6, %%mm0 \n\t"
- "pxor %%mm6, %%mm1 \n\t"
- "movq %%mm0, (%3) \n\t"
- "add %5, %3 \n\t"
- "movq %%mm1, (%3) \n\t"
- "add %5, %3 \n\t"
- "add $32, %2 \n\t"
- "subl $4, %0 \n\t"
- "jnz 1b \n\t"
-#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
- :"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
-#else
- :"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
-#endif
- :"S"((long)src1Stride), "D"((long)dstStride)
- :"memory");
-//the following should be used, though better not with gcc ...
-/* :"+g"(h), "+r"(src1), "+r"(src2), "+r"(dst)
- :"r"(src1Stride), "r"(dstStride)
- :"memory");*/
-}
-
-static void DEF(avg_pixels4_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
-{
- __asm __volatile(
- "testl $1, %0 \n\t"
- " jz 1f \n\t"
- "movd (%1), %%mm0 \n\t"
- "movd (%2), %%mm1 \n\t"
- "add %4, %1 \n\t"
- "add $4, %2 \n\t"
- PAVGB" %%mm1, %%mm0 \n\t"
- PAVGB" (%3), %%mm0 \n\t"
- "movd %%mm0, (%3) \n\t"
- "add %5, %3 \n\t"
- "decl %0 \n\t"
- "1: \n\t"
- "movd (%1), %%mm0 \n\t"
- "add %4, %1 \n\t"
- "movd (%1), %%mm1 \n\t"
- "add %4, %1 \n\t"
- PAVGB" (%2), %%mm0 \n\t"
- PAVGB" 4(%2), %%mm1 \n\t"
- PAVGB" (%3), %%mm0 \n\t"
- "movd %%mm0, (%3) \n\t"
- "add %5, %3 \n\t"
- PAVGB" (%3), %%mm1 \n\t"
- "movd %%mm1, (%3) \n\t"
- "add %5, %3 \n\t"
- "movd (%1), %%mm0 \n\t"
- "add %4, %1 \n\t"
- "movd (%1), %%mm1 \n\t"
- "add %4, %1 \n\t"
- PAVGB" 8(%2), %%mm0 \n\t"
- PAVGB" 12(%2), %%mm1 \n\t"
- PAVGB" (%3), %%mm0 \n\t"
- "movd %%mm0, (%3) \n\t"
- "add %5, %3 \n\t"
- PAVGB" (%3), %%mm1 \n\t"
- "movd %%mm1, (%3) \n\t"
- "add %5, %3 \n\t"
- "add $16, %2 \n\t"
- "subl $4, %0 \n\t"
- "jnz 1b \n\t"
-#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
- :"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
-#else
- :"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
-#endif
- :"S"((long)src1Stride), "D"((long)dstStride)
- :"memory");
-}
-
-
-static void DEF(avg_pixels8_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
-{
- __asm __volatile(
- "testl $1, %0 \n\t"
- " jz 1f \n\t"
- "movq (%1), %%mm0 \n\t"
- "movq (%2), %%mm1 \n\t"
- "add %4, %1 \n\t"
- "add $8, %2 \n\t"
- PAVGB" %%mm1, %%mm0 \n\t"
- PAVGB" (%3), %%mm0 \n\t"
- "movq %%mm0, (%3) \n\t"
- "add %5, %3 \n\t"
- "decl %0 \n\t"
- "1: \n\t"
- "movq (%1), %%mm0 \n\t"
- "add %4, %1 \n\t"
- "movq (%1), %%mm1 \n\t"
- "add %4, %1 \n\t"
- PAVGB" (%2), %%mm0 \n\t"
- PAVGB" 8(%2), %%mm1 \n\t"
- PAVGB" (%3), %%mm0 \n\t"
- "movq %%mm0, (%3) \n\t"
- "add %5, %3 \n\t"
- PAVGB" (%3), %%mm1 \n\t"
- "movq %%mm1, (%3) \n\t"
- "add %5, %3 \n\t"
- "movq (%1), %%mm0 \n\t"
- "add %4, %1 \n\t"
- "movq (%1), %%mm1 \n\t"
- "add %4, %1 \n\t"
- PAVGB" 16(%2), %%mm0 \n\t"
- PAVGB" 24(%2), %%mm1 \n\t"
- PAVGB" (%3), %%mm0 \n\t"
- "movq %%mm0, (%3) \n\t"
- "add %5, %3 \n\t"
- PAVGB" (%3), %%mm1 \n\t"
- "movq %%mm1, (%3) \n\t"
- "add %5, %3 \n\t"
- "add $32, %2 \n\t"
- "subl $4, %0 \n\t"
- "jnz 1b \n\t"
-#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
- :"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
-#else
- :"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
-#endif
- :"S"((long)src1Stride), "D"((long)dstStride)
- :"memory");
-//the following should be used, though better not with gcc ...
-/* :"+g"(h), "+r"(src1), "+r"(src2), "+r"(dst)
- :"r"(src1Stride), "r"(dstStride)
- :"memory");*/
-}
-
-static void DEF(put_pixels16_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-{
- __asm __volatile(
- "lea (%3, %3), %%"REG_a" \n\t"
- "1: \n\t"
- "movq (%1), %%mm0 \n\t"
- "movq (%1, %3), %%mm1 \n\t"
- "movq 8(%1), %%mm2 \n\t"
- "movq 8(%1, %3), %%mm3 \n\t"
- PAVGB" 1(%1), %%mm0 \n\t"
- PAVGB" 1(%1, %3), %%mm1 \n\t"
- PAVGB" 9(%1), %%mm2 \n\t"
- PAVGB" 9(%1, %3), %%mm3 \n\t"
- "movq %%mm0, (%2) \n\t"
- "movq %%mm1, (%2, %3) \n\t"
- "movq %%mm2, 8(%2) \n\t"
- "movq %%mm3, 8(%2, %3) \n\t"
- "add %%"REG_a", %1 \n\t"
- "add %%"REG_a", %2 \n\t"
- "movq (%1), %%mm0 \n\t"
- "movq (%1, %3), %%mm1 \n\t"
- "movq 8(%1), %%mm2 \n\t"
- "movq 8(%1, %3), %%mm3 \n\t"
- PAVGB" 1(%1), %%mm0 \n\t"
- PAVGB" 1(%1, %3), %%mm1 \n\t"
- PAVGB" 9(%1), %%mm2 \n\t"
- PAVGB" 9(%1, %3), %%mm3 \n\t"
- "add %%"REG_a", %1 \n\t"
- "movq %%mm0, (%2) \n\t"
- "movq %%mm1, (%2, %3) \n\t"
- "movq %%mm2, 8(%2) \n\t"
- "movq %%mm3, 8(%2, %3) \n\t"
- "add %%"REG_a", %2 \n\t"
- "subl $4, %0 \n\t"
- "jnz 1b \n\t"
- :"+g"(h), "+S"(pixels), "+D"(block)
- :"r" ((long)line_size)
- :"%"REG_a, "memory");
-}
-
-static void DEF(put_pixels16_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
-{
- __asm __volatile(
- "testl $1, %0 \n\t"
- " jz 1f \n\t"
- "movq (%1), %%mm0 \n\t"
- "movq 8(%1), %%mm1 \n\t"
- PAVGB" (%2), %%mm0 \n\t"
- PAVGB" 8(%2), %%mm1 \n\t"
- "add %4, %1 \n\t"
- "add $16, %2 \n\t"
- "movq %%mm0, (%3) \n\t"
- "movq %%mm1, 8(%3) \n\t"
- "add %5, %3 \n\t"
- "decl %0 \n\t"
- "1: \n\t"
- "movq (%1), %%mm0 \n\t"
- "movq 8(%1), %%mm1 \n\t"
- "add %4, %1 \n\t"
- PAVGB" (%2), %%mm0 \n\t"
- PAVGB" 8(%2), %%mm1 \n\t"
- "movq %%mm0, (%3) \n\t"
- "movq %%mm1, 8(%3) \n\t"
- "add %5, %3 \n\t"
- "movq (%1), %%mm0 \n\t"
- "movq 8(%1), %%mm1 \n\t"
- "add %4, %1 \n\t"
- PAVGB" 16(%2), %%mm0 \n\t"
- PAVGB" 24(%2), %%mm1 \n\t"
- "movq %%mm0, (%3) \n\t"
- "movq %%mm1, 8(%3) \n\t"
- "add %5, %3 \n\t"
- "add $32, %2 \n\t"
- "subl $2, %0 \n\t"
- "jnz 1b \n\t"
-#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
- :"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
-#else
- :"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
-#endif
- :"S"((long)src1Stride), "D"((long)dstStride)
- :"memory");
-//the following should be used, though better not with gcc ...
-/* :"+g"(h), "+r"(src1), "+r"(src2), "+r"(dst)
- :"r"(src1Stride), "r"(dstStride)
- :"memory");*/
-}
-
-static void DEF(avg_pixels16_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
-{
- __asm __volatile(
- "testl $1, %0 \n\t"
- " jz 1f \n\t"
- "movq (%1), %%mm0 \n\t"
- "movq 8(%1), %%mm1 \n\t"
- PAVGB" (%2), %%mm0 \n\t"
- PAVGB" 8(%2), %%mm1 \n\t"
- "add %4, %1 \n\t"
- "add $16, %2 \n\t"
- PAVGB" (%3), %%mm0 \n\t"
- PAVGB" 8(%3), %%mm1 \n\t"
- "movq %%mm0, (%3) \n\t"
- "movq %%mm1, 8(%3) \n\t"
- "add %5, %3 \n\t"
- "decl %0 \n\t"
- "1: \n\t"
- "movq (%1), %%mm0 \n\t"
- "movq 8(%1), %%mm1 \n\t"
- "add %4, %1 \n\t"
- PAVGB" (%2), %%mm0 \n\t"
- PAVGB" 8(%2), %%mm1 \n\t"
- PAVGB" (%3), %%mm0 \n\t"
- PAVGB" 8(%3), %%mm1 \n\t"
- "movq %%mm0, (%3) \n\t"
- "movq %%mm1, 8(%3) \n\t"
- "add %5, %3 \n\t"
- "movq (%1), %%mm0 \n\t"
- "movq 8(%1), %%mm1 \n\t"
- "add %4, %1 \n\t"
- PAVGB" 16(%2), %%mm0 \n\t"
- PAVGB" 24(%2), %%mm1 \n\t"
- PAVGB" (%3), %%mm0 \n\t"
- PAVGB" 8(%3), %%mm1 \n\t"
- "movq %%mm0, (%3) \n\t"
- "movq %%mm1, 8(%3) \n\t"
- "add %5, %3 \n\t"
- "add $32, %2 \n\t"
- "subl $2, %0 \n\t"
- "jnz 1b \n\t"
-#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
- :"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
-#else
- :"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
-#endif
- :"S"((long)src1Stride), "D"((long)dstStride)
- :"memory");
-//the following should be used, though better not with gcc ...
-/* :"+g"(h), "+r"(src1), "+r"(src2), "+r"(dst)
- :"r"(src1Stride), "r"(dstStride)
- :"memory");*/
-}
-
-static void DEF(put_no_rnd_pixels16_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
-{
- __asm __volatile(
- "pcmpeqb %%mm6, %%mm6 \n\t"
- "testl $1, %0 \n\t"
- " jz 1f \n\t"
- "movq (%1), %%mm0 \n\t"
- "movq 8(%1), %%mm1 \n\t"
- "movq (%2), %%mm2 \n\t"
- "movq 8(%2), %%mm3 \n\t"
- "pxor %%mm6, %%mm0 \n\t"
- "pxor %%mm6, %%mm1 \n\t"
- "pxor %%mm6, %%mm2 \n\t"
- "pxor %%mm6, %%mm3 \n\t"
- PAVGB" %%mm2, %%mm0 \n\t"
- PAVGB" %%mm3, %%mm1 \n\t"
- "pxor %%mm6, %%mm0 \n\t"
- "pxor %%mm6, %%mm1 \n\t"
- "add %4, %1 \n\t"
- "add $16, %2 \n\t"
- "movq %%mm0, (%3) \n\t"
- "movq %%mm1, 8(%3) \n\t"
- "add %5, %3 \n\t"
- "decl %0 \n\t"
- "1: \n\t"
- "movq (%1), %%mm0 \n\t"
- "movq 8(%1), %%mm1 \n\t"
- "add %4, %1 \n\t"
- "movq (%2), %%mm2 \n\t"
- "movq 8(%2), %%mm3 \n\t"
- "pxor %%mm6, %%mm0 \n\t"
- "pxor %%mm6, %%mm1 \n\t"
- "pxor %%mm6, %%mm2 \n\t"
- "pxor %%mm6, %%mm3 \n\t"
- PAVGB" %%mm2, %%mm0 \n\t"
- PAVGB" %%mm3, %%mm1 \n\t"
- "pxor %%mm6, %%mm0 \n\t"
- "pxor %%mm6, %%mm1 \n\t"
- "movq %%mm0, (%3) \n\t"
- "movq %%mm1, 8(%3) \n\t"
- "add %5, %3 \n\t"
- "movq (%1), %%mm0 \n\t"
- "movq 8(%1), %%mm1 \n\t"
- "add %4, %1 \n\t"
- "movq 16(%2), %%mm2 \n\t"
- "movq 24(%2), %%mm3 \n\t"
- "pxor %%mm6, %%mm0 \n\t"
- "pxor %%mm6, %%mm1 \n\t"
- "pxor %%mm6, %%mm2 \n\t"
- "pxor %%mm6, %%mm3 \n\t"
- PAVGB" %%mm2, %%mm0 \n\t"
- PAVGB" %%mm3, %%mm1 \n\t"
- "pxor %%mm6, %%mm0 \n\t"
- "pxor %%mm6, %%mm1 \n\t"
- "movq %%mm0, (%3) \n\t"
- "movq %%mm1, 8(%3) \n\t"
- "add %5, %3 \n\t"
- "add $32, %2 \n\t"
- "subl $2, %0 \n\t"
- "jnz 1b \n\t"
-#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
- :"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
-#else
- :"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
-#endif
- :"S"((long)src1Stride), "D"((long)dstStride)
- :"memory");
-//the following should be used, though better not with gcc ...
-/* :"+g"(h), "+r"(src1), "+r"(src2), "+r"(dst)
- :"r"(src1Stride), "r"(dstStride)
- :"memory");*/
-}
-
-/* GL: this function does incorrect rounding if overflow */
-static void DEF(put_no_rnd_pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-{
- MOVQ_BONE(mm6);
- __asm __volatile(
- "lea (%3, %3), %%"REG_a" \n\t"
- "1: \n\t"
- "movq (%1), %%mm0 \n\t"
- "movq (%1, %3), %%mm2 \n\t"
- "movq 1(%1), %%mm1 \n\t"
- "movq 1(%1, %3), %%mm3 \n\t"
- "add %%"REG_a", %1 \n\t"
- "psubusb %%mm6, %%mm0 \n\t"
- "psubusb %%mm6, %%mm2 \n\t"
- PAVGB" %%mm1, %%mm0 \n\t"
- PAVGB" %%mm3, %%mm2 \n\t"
- "movq %%mm0, (%2) \n\t"
- "movq %%mm2, (%2, %3) \n\t"
- "movq (%1), %%mm0 \n\t"
- "movq 1(%1), %%mm1 \n\t"
- "movq (%1, %3), %%mm2 \n\t"
- "movq 1(%1, %3), %%mm3 \n\t"
- "add %%"REG_a", %2 \n\t"
- "add %%"REG_a", %1 \n\t"
- "psubusb %%mm6, %%mm0 \n\t"
- "psubusb %%mm6, %%mm2 \n\t"
- PAVGB" %%mm1, %%mm0 \n\t"
- PAVGB" %%mm3, %%mm2 \n\t"
- "movq %%mm0, (%2) \n\t"
- "movq %%mm2, (%2, %3) \n\t"
- "add %%"REG_a", %2 \n\t"
- "subl $4, %0 \n\t"
- "jnz 1b \n\t"
- :"+g"(h), "+S"(pixels), "+D"(block)
- :"r" ((long)line_size)
- :"%"REG_a, "memory");
-}
-
-static void DEF(put_pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-{
- __asm __volatile(
- "lea (%3, %3), %%"REG_a" \n\t"
- "movq (%1), %%mm0 \n\t"
- "sub %3, %2 \n\t"
- "1: \n\t"
- "movq (%1, %3), %%mm1 \n\t"
- "movq (%1, %%"REG_a"), %%mm2 \n\t"
- "add %%"REG_a", %1 \n\t"
- PAVGB" %%mm1, %%mm0 \n\t"
- PAVGB" %%mm2, %%mm1 \n\t"
- "movq %%mm0, (%2, %3) \n\t"
- "movq %%mm1, (%2, %%"REG_a") \n\t"
- "movq (%1, %3), %%mm1 \n\t"
- "movq (%1, %%"REG_a"), %%mm0 \n\t"
- "add %%"REG_a", %2 \n\t"
- "add %%"REG_a", %1 \n\t"
- PAVGB" %%mm1, %%mm2 \n\t"
- PAVGB" %%mm0, %%mm1 \n\t"
- "movq %%mm2, (%2, %3) \n\t"
- "movq %%mm1, (%2, %%"REG_a") \n\t"
- "add %%"REG_a", %2 \n\t"
- "subl $4, %0 \n\t"
- "jnz 1b \n\t"
- :"+g"(h), "+S"(pixels), "+D" (block)
- :"r" ((long)line_size)
- :"%"REG_a, "memory");
-}
-
-/* GL: this function does incorrect rounding if overflow */
-static void DEF(put_no_rnd_pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-{
- MOVQ_BONE(mm6);
- __asm __volatile(
- "lea (%3, %3), %%"REG_a" \n\t"
- "movq (%1), %%mm0 \n\t"
- "sub %3, %2 \n\t"
- "1: \n\t"
- "movq (%1, %3), %%mm1 \n\t"
- "movq (%1, %%"REG_a"), %%mm2 \n\t"
- "add %%"REG_a", %1 \n\t"
- "psubusb %%mm6, %%mm1 \n\t"
- PAVGB" %%mm1, %%mm0 \n\t"
- PAVGB" %%mm2, %%mm1 \n\t"
- "movq %%mm0, (%2, %3) \n\t"
- "movq %%mm1, (%2, %%"REG_a") \n\t"
- "movq (%1, %3), %%mm1 \n\t"
- "movq (%1, %%"REG_a"), %%mm0 \n\t"
- "add %%"REG_a", %2 \n\t"
- "add %%"REG_a", %1 \n\t"
- "psubusb %%mm6, %%mm1 \n\t"
- PAVGB" %%mm1, %%mm2 \n\t"
- PAVGB" %%mm0, %%mm1 \n\t"
- "movq %%mm2, (%2, %3) \n\t"
- "movq %%mm1, (%2, %%"REG_a") \n\t"
- "add %%"REG_a", %2 \n\t"
- "subl $4, %0 \n\t"
- "jnz 1b \n\t"
- :"+g"(h), "+S"(pixels), "+D" (block)
- :"r" ((long)line_size)
- :"%"REG_a, "memory");
-}
-
-static void DEF(avg_pixels8)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-{
- __asm __volatile(
- "lea (%3, %3), %%"REG_a" \n\t"
- "1: \n\t"
- "movq (%2), %%mm0 \n\t"
- "movq (%2, %3), %%mm1 \n\t"
- PAVGB" (%1), %%mm0 \n\t"
- PAVGB" (%1, %3), %%mm1 \n\t"
- "movq %%mm0, (%2) \n\t"
- "movq %%mm1, (%2, %3) \n\t"
- "add %%"REG_a", %1 \n\t"
- "add %%"REG_a", %2 \n\t"
- "movq (%2), %%mm0 \n\t"
- "movq (%2, %3), %%mm1 \n\t"
- PAVGB" (%1), %%mm0 \n\t"
- PAVGB" (%1, %3), %%mm1 \n\t"
- "add %%"REG_a", %1 \n\t"
- "movq %%mm0, (%2) \n\t"
- "movq %%mm1, (%2, %3) \n\t"
- "add %%"REG_a", %2 \n\t"
- "subl $4, %0 \n\t"
- "jnz 1b \n\t"
- :"+g"(h), "+S"(pixels), "+D"(block)
- :"r" ((long)line_size)
- :"%"REG_a, "memory");
-}
-
-static void DEF(avg_pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-{
- __asm __volatile(
- "lea (%3, %3), %%"REG_a" \n\t"
- "1: \n\t"
- "movq (%1), %%mm0 \n\t"
- "movq (%1, %3), %%mm2 \n\t"
- PAVGB" 1(%1), %%mm0 \n\t"
- PAVGB" 1(%1, %3), %%mm2 \n\t"
- PAVGB" (%2), %%mm0 \n\t"
- PAVGB" (%2, %3), %%mm2 \n\t"
- "add %%"REG_a", %1 \n\t"
- "movq %%mm0, (%2) \n\t"
- "movq %%mm2, (%2, %3) \n\t"
- "movq (%1), %%mm0 \n\t"
- "movq (%1, %3), %%mm2 \n\t"
- PAVGB" 1(%1), %%mm0 \n\t"
- PAVGB" 1(%1, %3), %%mm2 \n\t"
- "add %%"REG_a", %2 \n\t"
- "add %%"REG_a", %1 \n\t"
- PAVGB" (%2), %%mm0 \n\t"
- PAVGB" (%2, %3), %%mm2 \n\t"
- "movq %%mm0, (%2) \n\t"
- "movq %%mm2, (%2, %3) \n\t"
- "add %%"REG_a", %2 \n\t"
- "subl $4, %0 \n\t"
- "jnz 1b \n\t"
- :"+g"(h), "+S"(pixels), "+D"(block)
- :"r" ((long)line_size)
- :"%"REG_a, "memory");
-}
-
-static void DEF(avg_pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-{
- __asm __volatile(
- "lea (%3, %3), %%"REG_a" \n\t"
- "movq (%1), %%mm0 \n\t"
- "sub %3, %2 \n\t"
- "1: \n\t"
- "movq (%1, %3), %%mm1 \n\t"
- "movq (%1, %%"REG_a"), %%mm2 \n\t"
- "add %%"REG_a", %1 \n\t"
- PAVGB" %%mm1, %%mm0 \n\t"
- PAVGB" %%mm2, %%mm1 \n\t"
- "movq (%2, %3), %%mm3 \n\t"
- "movq (%2, %%"REG_a"), %%mm4 \n\t"
- PAVGB" %%mm3, %%mm0 \n\t"
- PAVGB" %%mm4, %%mm1 \n\t"
- "movq %%mm0, (%2, %3) \n\t"
- "movq %%mm1, (%2, %%"REG_a") \n\t"
- "movq (%1, %3), %%mm1 \n\t"
- "movq (%1, %%"REG_a"), %%mm0 \n\t"
- PAVGB" %%mm1, %%mm2 \n\t"
- PAVGB" %%mm0, %%mm1 \n\t"
- "add %%"REG_a", %2 \n\t"
- "add %%"REG_a", %1 \n\t"
- "movq (%2, %3), %%mm3 \n\t"
- "movq (%2, %%"REG_a"), %%mm4 \n\t"
- PAVGB" %%mm3, %%mm2 \n\t"
- PAVGB" %%mm4, %%mm1 \n\t"
- "movq %%mm2, (%2, %3) \n\t"
- "movq %%mm1, (%2, %%"REG_a") \n\t"
- "add %%"REG_a", %2 \n\t"
- "subl $4, %0 \n\t"
- "jnz 1b \n\t"
- :"+g"(h), "+S"(pixels), "+D"(block)
- :"r" ((long)line_size)
- :"%"REG_a, "memory");
-}
-
-// Note this is not correctly rounded, but this function is only used for b frames so it doesnt matter
-static void DEF(avg_pixels8_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-{
- MOVQ_BONE(mm6);
- __asm __volatile(
- "lea (%3, %3), %%"REG_a" \n\t"
- "movq (%1), %%mm0 \n\t"
- PAVGB" 1(%1), %%mm0 \n\t"
- ASMALIGN(3)
- "1: \n\t"
- "movq (%1, %%"REG_a"), %%mm2 \n\t"
- "movq (%1, %3), %%mm1 \n\t"
- "psubusb %%mm6, %%mm2 \n\t"
- PAVGB" 1(%1, %3), %%mm1 \n\t"
- PAVGB" 1(%1, %%"REG_a"), %%mm2 \n\t"
- "add %%"REG_a", %1 \n\t"
- PAVGB" %%mm1, %%mm0 \n\t"
- PAVGB" %%mm2, %%mm1 \n\t"
- PAVGB" (%2), %%mm0 \n\t"
- PAVGB" (%2, %3), %%mm1 \n\t"
- "movq %%mm0, (%2) \n\t"
- "movq %%mm1, (%2, %3) \n\t"
- "movq (%1, %3), %%mm1 \n\t"
- "movq (%1, %%"REG_a"), %%mm0 \n\t"
- PAVGB" 1(%1, %3), %%mm1 \n\t"
- PAVGB" 1(%1, %%"REG_a"), %%mm0 \n\t"
- "add %%"REG_a", %2 \n\t"
- "add %%"REG_a", %1 \n\t"
- PAVGB" %%mm1, %%mm2 \n\t"
- PAVGB" %%mm0, %%mm1 \n\t"
- PAVGB" (%2), %%mm2 \n\t"
- PAVGB" (%2, %3), %%mm1 \n\t"
- "movq %%mm2, (%2) \n\t"
- "movq %%mm1, (%2, %3) \n\t"
- "add %%"REG_a", %2 \n\t"
- "subl $4, %0 \n\t"
- "jnz 1b \n\t"
- :"+g"(h), "+S"(pixels), "+D"(block)
- :"r" ((long)line_size)
- :"%"REG_a, "memory");
-}
-
-//FIXME the following could be optimized too ...
-static void DEF(put_no_rnd_pixels16_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
- DEF(put_no_rnd_pixels8_x2)(block , pixels , line_size, h);
- DEF(put_no_rnd_pixels8_x2)(block+8, pixels+8, line_size, h);
-}
-static void DEF(put_pixels16_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
- DEF(put_pixels8_y2)(block , pixels , line_size, h);
- DEF(put_pixels8_y2)(block+8, pixels+8, line_size, h);
-}
-static void DEF(put_no_rnd_pixels16_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
- DEF(put_no_rnd_pixels8_y2)(block , pixels , line_size, h);
- DEF(put_no_rnd_pixels8_y2)(block+8, pixels+8, line_size, h);
-}
-static void DEF(avg_pixels16)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
- DEF(avg_pixels8)(block , pixels , line_size, h);
- DEF(avg_pixels8)(block+8, pixels+8, line_size, h);
-}
-static void DEF(avg_pixels16_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
- DEF(avg_pixels8_x2)(block , pixels , line_size, h);
- DEF(avg_pixels8_x2)(block+8, pixels+8, line_size, h);
-}
-static void DEF(avg_pixels16_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
- DEF(avg_pixels8_y2)(block , pixels , line_size, h);
- DEF(avg_pixels8_y2)(block+8, pixels+8, line_size, h);
-}
-static void DEF(avg_pixels16_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
- DEF(avg_pixels8_xy2)(block , pixels , line_size, h);
- DEF(avg_pixels8_xy2)(block+8, pixels+8, line_size, h);
-}
-
-#define QPEL_2TAP_L3(OPNAME) \
-static void DEF(OPNAME ## 2tap_qpel16_l3)(uint8_t *dst, uint8_t *src, int stride, int h, int off1, int off2){\
- asm volatile(\
- "1: \n\t"\
- "movq (%1,%2), %%mm0 \n\t"\
- "movq 8(%1,%2), %%mm1 \n\t"\
- PAVGB" (%1,%3), %%mm0 \n\t"\
- PAVGB" 8(%1,%3), %%mm1 \n\t"\
- PAVGB" (%1), %%mm0 \n\t"\
- PAVGB" 8(%1), %%mm1 \n\t"\
- STORE_OP( (%1,%4),%%mm0)\
- STORE_OP(8(%1,%4),%%mm1)\
- "movq %%mm0, (%1,%4) \n\t"\
- "movq %%mm1, 8(%1,%4) \n\t"\
- "add %5, %1 \n\t"\
- "decl %0 \n\t"\
- "jnz 1b \n\t"\
- :"+g"(h), "+r"(src)\
- :"r"((long)off1), "r"((long)off2),\
- "r"((long)(dst-src)), "r"((long)stride)\
- :"memory"\
- );\
-}\
-static void DEF(OPNAME ## 2tap_qpel8_l3)(uint8_t *dst, uint8_t *src, int stride, int h, int off1, int off2){\
- asm volatile(\
- "1: \n\t"\
- "movq (%1,%2), %%mm0 \n\t"\
- PAVGB" (%1,%3), %%mm0 \n\t"\
- PAVGB" (%1), %%mm0 \n\t"\
- STORE_OP((%1,%4),%%mm0)\
- "movq %%mm0, (%1,%4) \n\t"\
- "add %5, %1 \n\t"\
- "decl %0 \n\t"\
- "jnz 1b \n\t"\
- :"+g"(h), "+r"(src)\
- :"r"((long)off1), "r"((long)off2),\
- "r"((long)(dst-src)), "r"((long)stride)\
- :"memory"\
- );\
-}
-
-#define STORE_OP(a,b) PAVGB" "#a","#b" \n\t"
-QPEL_2TAP_L3(avg_)
-#undef STORE_OP
-#define STORE_OP(a,b)
-QPEL_2TAP_L3(put_)
-#undef STORE_OP
-#undef QPEL_2TAP_L3
diff --git a/src/libffmpeg/libavcodec/i386/dsputil_mmx_rnd.h b/src/libffmpeg/libavcodec/i386/dsputil_mmx_rnd.h
deleted file mode 100644
index f53b34662..000000000
--- a/src/libffmpeg/libavcodec/i386/dsputil_mmx_rnd.h
+++ /dev/null
@@ -1,592 +0,0 @@
-/*
- * DSP utils mmx functions are compiled twice for rnd/no_rnd
- * Copyright (c) 2000, 2001 Fabrice Bellard.
- * Copyright (c) 2003-2004 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * MMX optimization by Nick Kurshev <nickols_k@mail.ru>
- * mostly rewritten by Michael Niedermayer <michaelni@gmx.at>
- * and improved by Zdenek Kabelac <kabi@users.sf.net>
- */
-
-// put_pixels
-static void DEF(put, pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-{
- MOVQ_BFE(mm6);
- __asm __volatile(
- "lea (%3, %3), %%"REG_a" \n\t"
- ASMALIGN(3)
- "1: \n\t"
- "movq (%1), %%mm0 \n\t"
- "movq 1(%1), %%mm1 \n\t"
- "movq (%1, %3), %%mm2 \n\t"
- "movq 1(%1, %3), %%mm3 \n\t"
- PAVGBP(%%mm0, %%mm1, %%mm4, %%mm2, %%mm3, %%mm5)
- "movq %%mm4, (%2) \n\t"
- "movq %%mm5, (%2, %3) \n\t"
- "add %%"REG_a", %1 \n\t"
- "add %%"REG_a", %2 \n\t"
- "movq (%1), %%mm0 \n\t"
- "movq 1(%1), %%mm1 \n\t"
- "movq (%1, %3), %%mm2 \n\t"
- "movq 1(%1, %3), %%mm3 \n\t"
- PAVGBP(%%mm0, %%mm1, %%mm4, %%mm2, %%mm3, %%mm5)
- "movq %%mm4, (%2) \n\t"
- "movq %%mm5, (%2, %3) \n\t"
- "add %%"REG_a", %1 \n\t"
- "add %%"REG_a", %2 \n\t"
- "subl $4, %0 \n\t"
- "jnz 1b \n\t"
- :"+g"(h), "+S"(pixels), "+D"(block)
- :"r"((long)line_size)
- :REG_a, "memory");
-}
-
-static void attribute_unused DEF(put, pixels8_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
-{
- MOVQ_BFE(mm6);
- __asm __volatile(
- "testl $1, %0 \n\t"
- " jz 1f \n\t"
- "movq (%1), %%mm0 \n\t"
- "movq (%2), %%mm1 \n\t"
- "add %4, %1 \n\t"
- "add $8, %2 \n\t"
- PAVGB(%%mm0, %%mm1, %%mm4, %%mm6)
- "movq %%mm4, (%3) \n\t"
- "add %5, %3 \n\t"
- "decl %0 \n\t"
- ASMALIGN(3)
- "1: \n\t"
- "movq (%1), %%mm0 \n\t"
- "movq (%2), %%mm1 \n\t"
- "add %4, %1 \n\t"
- "movq (%1), %%mm2 \n\t"
- "movq 8(%2), %%mm3 \n\t"
- "add %4, %1 \n\t"
- PAVGBP(%%mm0, %%mm1, %%mm4, %%mm2, %%mm3, %%mm5)
- "movq %%mm4, (%3) \n\t"
- "add %5, %3 \n\t"
- "movq %%mm5, (%3) \n\t"
- "add %5, %3 \n\t"
- "movq (%1), %%mm0 \n\t"
- "movq 16(%2), %%mm1 \n\t"
- "add %4, %1 \n\t"
- "movq (%1), %%mm2 \n\t"
- "movq 24(%2), %%mm3 \n\t"
- "add %4, %1 \n\t"
- "add $32, %2 \n\t"
- PAVGBP(%%mm0, %%mm1, %%mm4, %%mm2, %%mm3, %%mm5)
- "movq %%mm4, (%3) \n\t"
- "add %5, %3 \n\t"
- "movq %%mm5, (%3) \n\t"
- "add %5, %3 \n\t"
- "subl $4, %0 \n\t"
- "jnz 1b \n\t"
-#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
- :"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
-#else
- :"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
-#endif
- :"S"((long)src1Stride), "D"((long)dstStride)
- :"memory");
-}
-
-static void DEF(put, pixels16_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-{
- MOVQ_BFE(mm6);
- __asm __volatile(
- "lea (%3, %3), %%"REG_a" \n\t"
- ASMALIGN(3)
- "1: \n\t"
- "movq (%1), %%mm0 \n\t"
- "movq 1(%1), %%mm1 \n\t"
- "movq (%1, %3), %%mm2 \n\t"
- "movq 1(%1, %3), %%mm3 \n\t"
- PAVGBP(%%mm0, %%mm1, %%mm4, %%mm2, %%mm3, %%mm5)
- "movq %%mm4, (%2) \n\t"
- "movq %%mm5, (%2, %3) \n\t"
- "movq 8(%1), %%mm0 \n\t"
- "movq 9(%1), %%mm1 \n\t"
- "movq 8(%1, %3), %%mm2 \n\t"
- "movq 9(%1, %3), %%mm3 \n\t"
- PAVGBP(%%mm0, %%mm1, %%mm4, %%mm2, %%mm3, %%mm5)
- "movq %%mm4, 8(%2) \n\t"
- "movq %%mm5, 8(%2, %3) \n\t"
- "add %%"REG_a", %1 \n\t"
- "add %%"REG_a", %2 \n\t"
- "movq (%1), %%mm0 \n\t"
- "movq 1(%1), %%mm1 \n\t"
- "movq (%1, %3), %%mm2 \n\t"
- "movq 1(%1, %3), %%mm3 \n\t"
- PAVGBP(%%mm0, %%mm1, %%mm4, %%mm2, %%mm3, %%mm5)
- "movq %%mm4, (%2) \n\t"
- "movq %%mm5, (%2, %3) \n\t"
- "movq 8(%1), %%mm0 \n\t"
- "movq 9(%1), %%mm1 \n\t"
- "movq 8(%1, %3), %%mm2 \n\t"
- "movq 9(%1, %3), %%mm3 \n\t"
- PAVGBP(%%mm0, %%mm1, %%mm4, %%mm2, %%mm3, %%mm5)
- "movq %%mm4, 8(%2) \n\t"
- "movq %%mm5, 8(%2, %3) \n\t"
- "add %%"REG_a", %1 \n\t"
- "add %%"REG_a", %2 \n\t"
- "subl $4, %0 \n\t"
- "jnz 1b \n\t"
- :"+g"(h), "+S"(pixels), "+D"(block)
- :"r"((long)line_size)
- :REG_a, "memory");
-}
-
-static void attribute_unused DEF(put, pixels16_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
-{
- MOVQ_BFE(mm6);
- __asm __volatile(
- "testl $1, %0 \n\t"
- " jz 1f \n\t"
- "movq (%1), %%mm0 \n\t"
- "movq (%2), %%mm1 \n\t"
- "movq 8(%1), %%mm2 \n\t"
- "movq 8(%2), %%mm3 \n\t"
- "add %4, %1 \n\t"
- "add $16, %2 \n\t"
- PAVGBP(%%mm0, %%mm1, %%mm4, %%mm2, %%mm3, %%mm5)
- "movq %%mm4, (%3) \n\t"
- "movq %%mm5, 8(%3) \n\t"
- "add %5, %3 \n\t"
- "decl %0 \n\t"
- ASMALIGN(3)
- "1: \n\t"
- "movq (%1), %%mm0 \n\t"
- "movq (%2), %%mm1 \n\t"
- "movq 8(%1), %%mm2 \n\t"
- "movq 8(%2), %%mm3 \n\t"
- "add %4, %1 \n\t"
- PAVGBP(%%mm0, %%mm1, %%mm4, %%mm2, %%mm3, %%mm5)
- "movq %%mm4, (%3) \n\t"
- "movq %%mm5, 8(%3) \n\t"
- "add %5, %3 \n\t"
- "movq (%1), %%mm0 \n\t"
- "movq 16(%2), %%mm1 \n\t"
- "movq 8(%1), %%mm2 \n\t"
- "movq 24(%2), %%mm3 \n\t"
- "add %4, %1 \n\t"
- PAVGBP(%%mm0, %%mm1, %%mm4, %%mm2, %%mm3, %%mm5)
- "movq %%mm4, (%3) \n\t"
- "movq %%mm5, 8(%3) \n\t"
- "add %5, %3 \n\t"
- "add $32, %2 \n\t"
- "subl $2, %0 \n\t"
- "jnz 1b \n\t"
-#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
- :"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
-#else
- :"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
-#endif
- :"S"((long)src1Stride), "D"((long)dstStride)
- :"memory");
-}
-
-static void DEF(put, pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-{
- MOVQ_BFE(mm6);
- __asm __volatile(
- "lea (%3, %3), %%"REG_a" \n\t"
- "movq (%1), %%mm0 \n\t"
- ASMALIGN(3)
- "1: \n\t"
- "movq (%1, %3), %%mm1 \n\t"
- "movq (%1, %%"REG_a"),%%mm2 \n\t"
- PAVGBP(%%mm1, %%mm0, %%mm4, %%mm2, %%mm1, %%mm5)
- "movq %%mm4, (%2) \n\t"
- "movq %%mm5, (%2, %3) \n\t"
- "add %%"REG_a", %1 \n\t"
- "add %%"REG_a", %2 \n\t"
- "movq (%1, %3), %%mm1 \n\t"
- "movq (%1, %%"REG_a"),%%mm0 \n\t"
- PAVGBP(%%mm1, %%mm2, %%mm4, %%mm0, %%mm1, %%mm5)
- "movq %%mm4, (%2) \n\t"
- "movq %%mm5, (%2, %3) \n\t"
- "add %%"REG_a", %1 \n\t"
- "add %%"REG_a", %2 \n\t"
- "subl $4, %0 \n\t"
- "jnz 1b \n\t"
- :"+g"(h), "+S"(pixels), "+D"(block)
- :"r"((long)line_size)
- :REG_a, "memory");
-}
-
-static void DEF(put, pixels8_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-{
- MOVQ_ZERO(mm7);
- SET_RND(mm6); // =2 for rnd and =1 for no_rnd version
- __asm __volatile(
- "movq (%1), %%mm0 \n\t"
- "movq 1(%1), %%mm4 \n\t"
- "movq %%mm0, %%mm1 \n\t"
- "movq %%mm4, %%mm5 \n\t"
- "punpcklbw %%mm7, %%mm0 \n\t"
- "punpcklbw %%mm7, %%mm4 \n\t"
- "punpckhbw %%mm7, %%mm1 \n\t"
- "punpckhbw %%mm7, %%mm5 \n\t"
- "paddusw %%mm0, %%mm4 \n\t"
- "paddusw %%mm1, %%mm5 \n\t"
- "xor %%"REG_a", %%"REG_a" \n\t"
- "add %3, %1 \n\t"
- ASMALIGN(3)
- "1: \n\t"
- "movq (%1, %%"REG_a"), %%mm0 \n\t"
- "movq 1(%1, %%"REG_a"), %%mm2 \n\t"
- "movq %%mm0, %%mm1 \n\t"
- "movq %%mm2, %%mm3 \n\t"
- "punpcklbw %%mm7, %%mm0 \n\t"
- "punpcklbw %%mm7, %%mm2 \n\t"
- "punpckhbw %%mm7, %%mm1 \n\t"
- "punpckhbw %%mm7, %%mm3 \n\t"
- "paddusw %%mm2, %%mm0 \n\t"
- "paddusw %%mm3, %%mm1 \n\t"
- "paddusw %%mm6, %%mm4 \n\t"
- "paddusw %%mm6, %%mm5 \n\t"
- "paddusw %%mm0, %%mm4 \n\t"
- "paddusw %%mm1, %%mm5 \n\t"
- "psrlw $2, %%mm4 \n\t"
- "psrlw $2, %%mm5 \n\t"
- "packuswb %%mm5, %%mm4 \n\t"
- "movq %%mm4, (%2, %%"REG_a") \n\t"
- "add %3, %%"REG_a" \n\t"
-
- "movq (%1, %%"REG_a"), %%mm2 \n\t" // 0 <-> 2 1 <-> 3
- "movq 1(%1, %%"REG_a"), %%mm4 \n\t"
- "movq %%mm2, %%mm3 \n\t"
- "movq %%mm4, %%mm5 \n\t"
- "punpcklbw %%mm7, %%mm2 \n\t"
- "punpcklbw %%mm7, %%mm4 \n\t"
- "punpckhbw %%mm7, %%mm3 \n\t"
- "punpckhbw %%mm7, %%mm5 \n\t"
- "paddusw %%mm2, %%mm4 \n\t"
- "paddusw %%mm3, %%mm5 \n\t"
- "paddusw %%mm6, %%mm0 \n\t"
- "paddusw %%mm6, %%mm1 \n\t"
- "paddusw %%mm4, %%mm0 \n\t"
- "paddusw %%mm5, %%mm1 \n\t"
- "psrlw $2, %%mm0 \n\t"
- "psrlw $2, %%mm1 \n\t"
- "packuswb %%mm1, %%mm0 \n\t"
- "movq %%mm0, (%2, %%"REG_a") \n\t"
- "add %3, %%"REG_a" \n\t"
-
- "subl $2, %0 \n\t"
- "jnz 1b \n\t"
- :"+g"(h), "+S"(pixels)
- :"D"(block), "r"((long)line_size)
- :REG_a, "memory");
-}
-
-// avg_pixels
-static void attribute_unused DEF(avg, pixels4)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-{
- MOVQ_BFE(mm6);
- JUMPALIGN();
- do {
- __asm __volatile(
- "movd %0, %%mm0 \n\t"
- "movd %1, %%mm1 \n\t"
- PAVGB(%%mm0, %%mm1, %%mm2, %%mm6)
- "movd %%mm2, %0 \n\t"
- :"+m"(*block)
- :"m"(*pixels)
- :"memory");
- pixels += line_size;
- block += line_size;
- }
- while (--h);
-}
-
-// in case more speed is needed - unroling would certainly help
-static void DEF(avg, pixels8)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-{
- MOVQ_BFE(mm6);
- JUMPALIGN();
- do {
- __asm __volatile(
- "movq %0, %%mm0 \n\t"
- "movq %1, %%mm1 \n\t"
- PAVGB(%%mm0, %%mm1, %%mm2, %%mm6)
- "movq %%mm2, %0 \n\t"
- :"+m"(*block)
- :"m"(*pixels)
- :"memory");
- pixels += line_size;
- block += line_size;
- }
- while (--h);
-}
-
-static void DEF(avg, pixels16)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-{
- MOVQ_BFE(mm6);
- JUMPALIGN();
- do {
- __asm __volatile(
- "movq %0, %%mm0 \n\t"
- "movq %1, %%mm1 \n\t"
- PAVGB(%%mm0, %%mm1, %%mm2, %%mm6)
- "movq %%mm2, %0 \n\t"
- "movq 8%0, %%mm0 \n\t"
- "movq 8%1, %%mm1 \n\t"
- PAVGB(%%mm0, %%mm1, %%mm2, %%mm6)
- "movq %%mm2, 8%0 \n\t"
- :"+m"(*block)
- :"m"(*pixels)
- :"memory");
- pixels += line_size;
- block += line_size;
- }
- while (--h);
-}
-
-static void DEF(avg, pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-{
- MOVQ_BFE(mm6);
- JUMPALIGN();
- do {
- __asm __volatile(
- "movq %1, %%mm0 \n\t"
- "movq 1%1, %%mm1 \n\t"
- "movq %0, %%mm3 \n\t"
- PAVGB(%%mm0, %%mm1, %%mm2, %%mm6)
- PAVGB(%%mm3, %%mm2, %%mm0, %%mm6)
- "movq %%mm0, %0 \n\t"
- :"+m"(*block)
- :"m"(*pixels)
- :"memory");
- pixels += line_size;
- block += line_size;
- } while (--h);
-}
-
-static __attribute__((unused)) void DEF(avg, pixels8_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
-{
- MOVQ_BFE(mm6);
- JUMPALIGN();
- do {
- __asm __volatile(
- "movq %1, %%mm0 \n\t"
- "movq %2, %%mm1 \n\t"
- "movq %0, %%mm3 \n\t"
- PAVGB(%%mm0, %%mm1, %%mm2, %%mm6)
- PAVGB(%%mm3, %%mm2, %%mm0, %%mm6)
- "movq %%mm0, %0 \n\t"
- :"+m"(*dst)
- :"m"(*src1), "m"(*src2)
- :"memory");
- dst += dstStride;
- src1 += src1Stride;
- src2 += 8;
- } while (--h);
-}
-
-static void DEF(avg, pixels16_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-{
- MOVQ_BFE(mm6);
- JUMPALIGN();
- do {
- __asm __volatile(
- "movq %1, %%mm0 \n\t"
- "movq 1%1, %%mm1 \n\t"
- "movq %0, %%mm3 \n\t"
- PAVGB(%%mm0, %%mm1, %%mm2, %%mm6)
- PAVGB(%%mm3, %%mm2, %%mm0, %%mm6)
- "movq %%mm0, %0 \n\t"
- "movq 8%1, %%mm0 \n\t"
- "movq 9%1, %%mm1 \n\t"
- "movq 8%0, %%mm3 \n\t"
- PAVGB(%%mm0, %%mm1, %%mm2, %%mm6)
- PAVGB(%%mm3, %%mm2, %%mm0, %%mm6)
- "movq %%mm0, 8%0 \n\t"
- :"+m"(*block)
- :"m"(*pixels)
- :"memory");
- pixels += line_size;
- block += line_size;
- } while (--h);
-}
-
-static __attribute__((unused)) void DEF(avg, pixels16_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
-{
- MOVQ_BFE(mm6);
- JUMPALIGN();
- do {
- __asm __volatile(
- "movq %1, %%mm0 \n\t"
- "movq %2, %%mm1 \n\t"
- "movq %0, %%mm3 \n\t"
- PAVGB(%%mm0, %%mm1, %%mm2, %%mm6)
- PAVGB(%%mm3, %%mm2, %%mm0, %%mm6)
- "movq %%mm0, %0 \n\t"
- "movq 8%1, %%mm0 \n\t"
- "movq 8%2, %%mm1 \n\t"
- "movq 8%0, %%mm3 \n\t"
- PAVGB(%%mm0, %%mm1, %%mm2, %%mm6)
- PAVGB(%%mm3, %%mm2, %%mm0, %%mm6)
- "movq %%mm0, 8%0 \n\t"
- :"+m"(*dst)
- :"m"(*src1), "m"(*src2)
- :"memory");
- dst += dstStride;
- src1 += src1Stride;
- src2 += 16;
- } while (--h);
-}
-
-static void DEF(avg, pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-{
- MOVQ_BFE(mm6);
- __asm __volatile(
- "lea (%3, %3), %%"REG_a" \n\t"
- "movq (%1), %%mm0 \n\t"
- ASMALIGN(3)
- "1: \n\t"
- "movq (%1, %3), %%mm1 \n\t"
- "movq (%1, %%"REG_a"), %%mm2 \n\t"
- PAVGBP(%%mm1, %%mm0, %%mm4, %%mm2, %%mm1, %%mm5)
- "movq (%2), %%mm3 \n\t"
- PAVGB(%%mm3, %%mm4, %%mm0, %%mm6)
- "movq (%2, %3), %%mm3 \n\t"
- PAVGB(%%mm3, %%mm5, %%mm1, %%mm6)
- "movq %%mm0, (%2) \n\t"
- "movq %%mm1, (%2, %3) \n\t"
- "add %%"REG_a", %1 \n\t"
- "add %%"REG_a", %2 \n\t"
-
- "movq (%1, %3), %%mm1 \n\t"
- "movq (%1, %%"REG_a"), %%mm0 \n\t"
- PAVGBP(%%mm1, %%mm2, %%mm4, %%mm0, %%mm1, %%mm5)
- "movq (%2), %%mm3 \n\t"
- PAVGB(%%mm3, %%mm4, %%mm2, %%mm6)
- "movq (%2, %3), %%mm3 \n\t"
- PAVGB(%%mm3, %%mm5, %%mm1, %%mm6)
- "movq %%mm2, (%2) \n\t"
- "movq %%mm1, (%2, %3) \n\t"
- "add %%"REG_a", %1 \n\t"
- "add %%"REG_a", %2 \n\t"
-
- "subl $4, %0 \n\t"
- "jnz 1b \n\t"
- :"+g"(h), "+S"(pixels), "+D"(block)
- :"r"((long)line_size)
- :REG_a, "memory");
-}
-
-// this routine is 'slightly' suboptimal but mostly unused
-static void DEF(avg, pixels8_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-{
- MOVQ_ZERO(mm7);
- SET_RND(mm6); // =2 for rnd and =1 for no_rnd version
- __asm __volatile(
- "movq (%1), %%mm0 \n\t"
- "movq 1(%1), %%mm4 \n\t"
- "movq %%mm0, %%mm1 \n\t"
- "movq %%mm4, %%mm5 \n\t"
- "punpcklbw %%mm7, %%mm0 \n\t"
- "punpcklbw %%mm7, %%mm4 \n\t"
- "punpckhbw %%mm7, %%mm1 \n\t"
- "punpckhbw %%mm7, %%mm5 \n\t"
- "paddusw %%mm0, %%mm4 \n\t"
- "paddusw %%mm1, %%mm5 \n\t"
- "xor %%"REG_a", %%"REG_a" \n\t"
- "add %3, %1 \n\t"
- ASMALIGN(3)
- "1: \n\t"
- "movq (%1, %%"REG_a"), %%mm0 \n\t"
- "movq 1(%1, %%"REG_a"), %%mm2 \n\t"
- "movq %%mm0, %%mm1 \n\t"
- "movq %%mm2, %%mm3 \n\t"
- "punpcklbw %%mm7, %%mm0 \n\t"
- "punpcklbw %%mm7, %%mm2 \n\t"
- "punpckhbw %%mm7, %%mm1 \n\t"
- "punpckhbw %%mm7, %%mm3 \n\t"
- "paddusw %%mm2, %%mm0 \n\t"
- "paddusw %%mm3, %%mm1 \n\t"
- "paddusw %%mm6, %%mm4 \n\t"
- "paddusw %%mm6, %%mm5 \n\t"
- "paddusw %%mm0, %%mm4 \n\t"
- "paddusw %%mm1, %%mm5 \n\t"
- "psrlw $2, %%mm4 \n\t"
- "psrlw $2, %%mm5 \n\t"
- "movq (%2, %%"REG_a"), %%mm3 \n\t"
- "packuswb %%mm5, %%mm4 \n\t"
- "pcmpeqd %%mm2, %%mm2 \n\t"
- "paddb %%mm2, %%mm2 \n\t"
- PAVGB(%%mm3, %%mm4, %%mm5, %%mm2)
- "movq %%mm5, (%2, %%"REG_a") \n\t"
- "add %3, %%"REG_a" \n\t"
-
- "movq (%1, %%"REG_a"), %%mm2 \n\t" // 0 <-> 2 1 <-> 3
- "movq 1(%1, %%"REG_a"), %%mm4 \n\t"
- "movq %%mm2, %%mm3 \n\t"
- "movq %%mm4, %%mm5 \n\t"
- "punpcklbw %%mm7, %%mm2 \n\t"
- "punpcklbw %%mm7, %%mm4 \n\t"
- "punpckhbw %%mm7, %%mm3 \n\t"
- "punpckhbw %%mm7, %%mm5 \n\t"
- "paddusw %%mm2, %%mm4 \n\t"
- "paddusw %%mm3, %%mm5 \n\t"
- "paddusw %%mm6, %%mm0 \n\t"
- "paddusw %%mm6, %%mm1 \n\t"
- "paddusw %%mm4, %%mm0 \n\t"
- "paddusw %%mm5, %%mm1 \n\t"
- "psrlw $2, %%mm0 \n\t"
- "psrlw $2, %%mm1 \n\t"
- "movq (%2, %%"REG_a"), %%mm3 \n\t"
- "packuswb %%mm1, %%mm0 \n\t"
- "pcmpeqd %%mm2, %%mm2 \n\t"
- "paddb %%mm2, %%mm2 \n\t"
- PAVGB(%%mm3, %%mm0, %%mm1, %%mm2)
- "movq %%mm1, (%2, %%"REG_a") \n\t"
- "add %3, %%"REG_a" \n\t"
-
- "subl $2, %0 \n\t"
- "jnz 1b \n\t"
- :"+g"(h), "+S"(pixels)
- :"D"(block), "r"((long)line_size)
- :REG_a, "memory");
-}
-
-//FIXME optimize
-static void DEF(put, pixels16_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
- DEF(put, pixels8_y2)(block , pixels , line_size, h);
- DEF(put, pixels8_y2)(block+8, pixels+8, line_size, h);
-}
-
-static void DEF(put, pixels16_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
- DEF(put, pixels8_xy2)(block , pixels , line_size, h);
- DEF(put, pixels8_xy2)(block+8, pixels+8, line_size, h);
-}
-
-static void DEF(avg, pixels16_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
- DEF(avg, pixels8_y2)(block , pixels , line_size, h);
- DEF(avg, pixels8_y2)(block+8, pixels+8, line_size, h);
-}
-
-static void DEF(avg, pixels16_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
- DEF(avg, pixels8_xy2)(block , pixels , line_size, h);
- DEF(avg, pixels8_xy2)(block+8, pixels+8, line_size, h);
-}
-
-
diff --git a/src/libffmpeg/libavcodec/i386/fdct_mmx.c b/src/libffmpeg/libavcodec/i386/fdct_mmx.c
deleted file mode 100644
index 7e2682a4a..000000000
--- a/src/libffmpeg/libavcodec/i386/fdct_mmx.c
+++ /dev/null
@@ -1,566 +0,0 @@
-/*
- * MMX optimized forward DCT
- * The gcc porting is Copyright (c) 2001 Fabrice Bellard.
- * cleanup/optimizations are Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
- * SSE2 optimization is Copyright (c) 2004 Denes Balatoni.
- *
- * from fdctam32.c - AP922 MMX(3D-Now) forward-DCT
- *
- * Intel Application Note AP-922 - fast, precise implementation of DCT
- * http://developer.intel.com/vtune/cbts/appnotes.htm
- *
- * Also of inspiration:
- * a page about fdct at http://www.geocities.com/ssavekar/dct.htm
- * Skal's fdct at http://skal.planet-d.net/coding/dct.html
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "common.h"
-#include "../dsputil.h"
-#include "mmx.h"
-
-#define ATTR_ALIGN(align) __attribute__ ((__aligned__ (align)))
-
-//////////////////////////////////////////////////////////////////////
-//
-// constants for the forward DCT
-// -----------------------------
-//
-// Be sure to check that your compiler is aligning all constants to QWORD
-// (8-byte) memory boundaries! Otherwise the unaligned memory access will
-// severely stall MMX execution.
-//
-//////////////////////////////////////////////////////////////////////
-
-#define BITS_FRW_ACC 3 //; 2 or 3 for accuracy
-#define SHIFT_FRW_COL BITS_FRW_ACC
-#define SHIFT_FRW_ROW (BITS_FRW_ACC + 17 - 3)
-#define RND_FRW_ROW (1 << (SHIFT_FRW_ROW-1))
-//#define RND_FRW_COL (1 << (SHIFT_FRW_COL-1))
-
-//concatenated table, for forward DCT transformation
-static const int16_t fdct_tg_all_16[] ATTR_ALIGN(8) = {
- 13036, 13036, 13036, 13036, // tg * (2<<16) + 0.5
- 27146, 27146, 27146, 27146, // tg * (2<<16) + 0.5
- -21746, -21746, -21746, -21746, // tg * (2<<16) + 0.5
-};
-
-static const int16_t ocos_4_16[4] ATTR_ALIGN(8) = {
- 23170, 23170, 23170, 23170, //cos * (2<<15) + 0.5
-};
-
-static const int64_t fdct_one_corr ATTR_ALIGN(8) = 0x0001000100010001LL;
-
-static const int32_t fdct_r_row[2] ATTR_ALIGN(8) = {RND_FRW_ROW, RND_FRW_ROW };
-
-static struct
-{
- const int32_t fdct_r_row_sse2[4] ATTR_ALIGN(16);
-} fdct_r_row_sse2 ATTR_ALIGN(16)=
-{{
- RND_FRW_ROW, RND_FRW_ROW, RND_FRW_ROW, RND_FRW_ROW
-}};
-//static const long fdct_r_row_sse2[4] ATTR_ALIGN(16) = {RND_FRW_ROW, RND_FRW_ROW, RND_FRW_ROW, RND_FRW_ROW};
-
-static const int16_t tab_frw_01234567[] ATTR_ALIGN(8) = { // forward_dct coeff table
- 16384, 16384, 22725, 19266,
- 16384, 16384, 12873, 4520,
- 21407, 8867, 19266, -4520,
- -8867, -21407, -22725, -12873,
- 16384, -16384, 12873, -22725,
- -16384, 16384, 4520, 19266,
- 8867, -21407, 4520, -12873,
- 21407, -8867, 19266, -22725,
-
- 22725, 22725, 31521, 26722,
- 22725, 22725, 17855, 6270,
- 29692, 12299, 26722, -6270,
- -12299, -29692, -31521, -17855,
- 22725, -22725, 17855, -31521,
- -22725, 22725, 6270, 26722,
- 12299, -29692, 6270, -17855,
- 29692, -12299, 26722, -31521,
-
- 21407, 21407, 29692, 25172,
- 21407, 21407, 16819, 5906,
- 27969, 11585, 25172, -5906,
- -11585, -27969, -29692, -16819,
- 21407, -21407, 16819, -29692,
- -21407, 21407, 5906, 25172,
- 11585, -27969, 5906, -16819,
- 27969, -11585, 25172, -29692,
-
- 19266, 19266, 26722, 22654,
- 19266, 19266, 15137, 5315,
- 25172, 10426, 22654, -5315,
- -10426, -25172, -26722, -15137,
- 19266, -19266, 15137, -26722,
- -19266, 19266, 5315, 22654,
- 10426, -25172, 5315, -15137,
- 25172, -10426, 22654, -26722,
-
- 16384, 16384, 22725, 19266,
- 16384, 16384, 12873, 4520,
- 21407, 8867, 19266, -4520,
- -8867, -21407, -22725, -12873,
- 16384, -16384, 12873, -22725,
- -16384, 16384, 4520, 19266,
- 8867, -21407, 4520, -12873,
- 21407, -8867, 19266, -22725,
-
- 19266, 19266, 26722, 22654,
- 19266, 19266, 15137, 5315,
- 25172, 10426, 22654, -5315,
- -10426, -25172, -26722, -15137,
- 19266, -19266, 15137, -26722,
- -19266, 19266, 5315, 22654,
- 10426, -25172, 5315, -15137,
- 25172, -10426, 22654, -26722,
-
- 21407, 21407, 29692, 25172,
- 21407, 21407, 16819, 5906,
- 27969, 11585, 25172, -5906,
- -11585, -27969, -29692, -16819,
- 21407, -21407, 16819, -29692,
- -21407, 21407, 5906, 25172,
- 11585, -27969, 5906, -16819,
- 27969, -11585, 25172, -29692,
-
- 22725, 22725, 31521, 26722,
- 22725, 22725, 17855, 6270,
- 29692, 12299, 26722, -6270,
- -12299, -29692, -31521, -17855,
- 22725, -22725, 17855, -31521,
- -22725, 22725, 6270, 26722,
- 12299, -29692, 6270, -17855,
- 29692, -12299, 26722, -31521,
-};
-
-static struct
-{
- const int16_t tab_frw_01234567_sse2[256] ATTR_ALIGN(16);
-} tab_frw_01234567_sse2 ATTR_ALIGN(16) =
-{{
-//static const int16_t tab_frw_01234567_sse2[] ATTR_ALIGN(16) = { // forward_dct coeff table
-#define TABLE_SSE2 C4, C4, C1, C3, -C6, -C2, -C1, -C5, \
- C4, C4, C5, C7, C2, C6, C3, -C7, \
- -C4, C4, C7, C3, C6, -C2, C7, -C5, \
- C4, -C4, C5, -C1, C2, -C6, C3, -C1,
-// c1..c7 * cos(pi/4) * 2^15
-#define C1 22725
-#define C2 21407
-#define C3 19266
-#define C4 16384
-#define C5 12873
-#define C6 8867
-#define C7 4520
-TABLE_SSE2
-
-#undef C1
-#undef C2
-#undef C3
-#undef C4
-#undef C5
-#undef C6
-#undef C7
-#define C1 31521
-#define C2 29692
-#define C3 26722
-#define C4 22725
-#define C5 17855
-#define C6 12299
-#define C7 6270
-TABLE_SSE2
-
-#undef C1
-#undef C2
-#undef C3
-#undef C4
-#undef C5
-#undef C6
-#undef C7
-#define C1 29692
-#define C2 27969
-#define C3 25172
-#define C4 21407
-#define C5 16819
-#define C6 11585
-#define C7 5906
-TABLE_SSE2
-
-#undef C1
-#undef C2
-#undef C3
-#undef C4
-#undef C5
-#undef C6
-#undef C7
-#define C1 26722
-#define C2 25172
-#define C3 22654
-#define C4 19266
-#define C5 15137
-#define C6 10426
-#define C7 5315
-TABLE_SSE2
-
-#undef C1
-#undef C2
-#undef C3
-#undef C4
-#undef C5
-#undef C6
-#undef C7
-#define C1 22725
-#define C2 21407
-#define C3 19266
-#define C4 16384
-#define C5 12873
-#define C6 8867
-#define C7 4520
-TABLE_SSE2
-
-#undef C1
-#undef C2
-#undef C3
-#undef C4
-#undef C5
-#undef C6
-#undef C7
-#define C1 26722
-#define C2 25172
-#define C3 22654
-#define C4 19266
-#define C5 15137
-#define C6 10426
-#define C7 5315
-TABLE_SSE2
-
-#undef C1
-#undef C2
-#undef C3
-#undef C4
-#undef C5
-#undef C6
-#undef C7
-#define C1 29692
-#define C2 27969
-#define C3 25172
-#define C4 21407
-#define C5 16819
-#define C6 11585
-#define C7 5906
-TABLE_SSE2
-
-#undef C1
-#undef C2
-#undef C3
-#undef C4
-#undef C5
-#undef C6
-#undef C7
-#define C1 31521
-#define C2 29692
-#define C3 26722
-#define C4 22725
-#define C5 17855
-#define C6 12299
-#define C7 6270
-TABLE_SSE2
-}};
-
-
-static av_always_inline void fdct_col(const int16_t *in, int16_t *out, int offset)
-{
- movq_m2r(*(in + offset + 1 * 8), mm0);
- movq_m2r(*(in + offset + 6 * 8), mm1);
- movq_r2r(mm0, mm2);
- movq_m2r(*(in + offset + 2 * 8), mm3);
- paddsw_r2r(mm1, mm0);
- movq_m2r(*(in + offset + 5 * 8), mm4);
- psllw_i2r(SHIFT_FRW_COL, mm0);
- movq_m2r(*(in + offset + 0 * 8), mm5);
- paddsw_r2r(mm3, mm4);
- paddsw_m2r(*(in + offset + 7 * 8), mm5);
- psllw_i2r(SHIFT_FRW_COL, mm4);
- movq_r2r(mm0, mm6);
- psubsw_r2r(mm1, mm2);
- movq_m2r(*(fdct_tg_all_16 + 4), mm1);
- psubsw_r2r(mm4, mm0);
- movq_m2r(*(in + offset + 3 * 8), mm7);
- pmulhw_r2r(mm0, mm1);
- paddsw_m2r(*(in + offset + 4 * 8), mm7);
- psllw_i2r(SHIFT_FRW_COL, mm5);
- paddsw_r2r(mm4, mm6);
- psllw_i2r(SHIFT_FRW_COL, mm7);
- movq_r2r(mm5, mm4);
- psubsw_r2r(mm7, mm5);
- paddsw_r2r(mm5, mm1);
- paddsw_r2r(mm7, mm4);
- por_m2r(fdct_one_corr, mm1);
- psllw_i2r(SHIFT_FRW_COL + 1, mm2);
- pmulhw_m2r(*(fdct_tg_all_16 + 4), mm5);
- movq_r2r(mm4, mm7);
- psubsw_m2r(*(in + offset + 5 * 8), mm3);
- psubsw_r2r(mm6, mm4);
- movq_r2m(mm1, *(out + offset + 2 * 8));
- paddsw_r2r(mm6, mm7);
- movq_m2r(*(in + offset + 3 * 8), mm1);
- psllw_i2r(SHIFT_FRW_COL + 1, mm3);
- psubsw_m2r(*(in + offset + 4 * 8), mm1);
- movq_r2r(mm2, mm6);
- movq_r2m(mm4, *(out + offset + 4 * 8));
- paddsw_r2r(mm3, mm2);
- pmulhw_m2r(*ocos_4_16, mm2);
- psubsw_r2r(mm3, mm6);
- pmulhw_m2r(*ocos_4_16, mm6);
- psubsw_r2r(mm0, mm5);
- por_m2r(fdct_one_corr, mm5);
- psllw_i2r(SHIFT_FRW_COL, mm1);
- por_m2r(fdct_one_corr, mm2);
- movq_r2r(mm1, mm4);
- movq_m2r(*(in + offset + 0 * 8), mm3);
- paddsw_r2r(mm6, mm1);
- psubsw_m2r(*(in + offset + 7 * 8), mm3);
- psubsw_r2r(mm6, mm4);
- movq_m2r(*(fdct_tg_all_16 + 0), mm0);
- psllw_i2r(SHIFT_FRW_COL, mm3);
- movq_m2r(*(fdct_tg_all_16 + 8), mm6);
- pmulhw_r2r(mm1, mm0);
- movq_r2m(mm7, *(out + offset + 0 * 8));
- pmulhw_r2r(mm4, mm6);
- movq_r2m(mm5, *(out + offset + 6 * 8));
- movq_r2r(mm3, mm7);
- movq_m2r(*(fdct_tg_all_16 + 8), mm5);
- psubsw_r2r(mm2, mm7);
- paddsw_r2r(mm2, mm3);
- pmulhw_r2r(mm7, mm5);
- paddsw_r2r(mm3, mm0);
- paddsw_r2r(mm4, mm6);
- pmulhw_m2r(*(fdct_tg_all_16 + 0), mm3);
- por_m2r(fdct_one_corr, mm0);
- paddsw_r2r(mm7, mm5);
- psubsw_r2r(mm6, mm7);
- movq_r2m(mm0, *(out + offset + 1 * 8));
- paddsw_r2r(mm4, mm5);
- movq_r2m(mm7, *(out + offset + 3 * 8));
- psubsw_r2r(mm1, mm3);
- movq_r2m(mm5, *(out + offset + 5 * 8));
- movq_r2m(mm3, *(out + offset + 7 * 8));
-}
-
-
-static av_always_inline void fdct_row_sse2(const int16_t *in, int16_t *out)
-{
- asm volatile(
-#define FDCT_ROW_SSE2_H1(i,t) \
- "movq " #i "(%0), %%xmm2 \n\t" \
- "movq " #i "+8(%0), %%xmm0 \n\t" \
- "movdqa " #t "+32(%1), %%xmm3 \n\t" \
- "movdqa " #t "+48(%1), %%xmm7 \n\t" \
- "movdqa " #t "(%1), %%xmm4 \n\t" \
- "movdqa " #t "+16(%1), %%xmm5 \n\t"
-
-#define FDCT_ROW_SSE2_H2(i,t) \
- "movq " #i "(%0), %%xmm2 \n\t" \
- "movq " #i "+8(%0), %%xmm0 \n\t" \
- "movdqa " #t "+32(%1), %%xmm3 \n\t" \
- "movdqa " #t "+48(%1), %%xmm7 \n\t"
-
-#define FDCT_ROW_SSE2(i) \
- "movq %%xmm2, %%xmm1 \n\t" \
- "pshuflw $27, %%xmm0, %%xmm0 \n\t" \
- "paddsw %%xmm0, %%xmm1 \n\t" \
- "psubsw %%xmm0, %%xmm2 \n\t" \
- "punpckldq %%xmm2, %%xmm1 \n\t" \
- "pshufd $78, %%xmm1, %%xmm2 \n\t" \
- "pmaddwd %%xmm2, %%xmm3 \n\t" \
- "pmaddwd %%xmm1, %%xmm7 \n\t" \
- "pmaddwd %%xmm5, %%xmm2 \n\t" \
- "pmaddwd %%xmm4, %%xmm1 \n\t" \
- "paddd %%xmm7, %%xmm3 \n\t" \
- "paddd %%xmm2, %%xmm1 \n\t" \
- "paddd %%xmm6, %%xmm3 \n\t" \
- "paddd %%xmm6, %%xmm1 \n\t" \
- "psrad %3, %%xmm3 \n\t" \
- "psrad %3, %%xmm1 \n\t" \
- "packssdw %%xmm3, %%xmm1 \n\t" \
- "movdqa %%xmm1, " #i "(%4) \n\t"
-
- "movdqa (%2), %%xmm6 \n\t"
- FDCT_ROW_SSE2_H1(0,0)
- FDCT_ROW_SSE2(0)
- FDCT_ROW_SSE2_H2(64,0)
- FDCT_ROW_SSE2(64)
-
- FDCT_ROW_SSE2_H1(16,64)
- FDCT_ROW_SSE2(16)
- FDCT_ROW_SSE2_H2(112,64)
- FDCT_ROW_SSE2(112)
-
- FDCT_ROW_SSE2_H1(32,128)
- FDCT_ROW_SSE2(32)
- FDCT_ROW_SSE2_H2(96,128)
- FDCT_ROW_SSE2(96)
-
- FDCT_ROW_SSE2_H1(48,192)
- FDCT_ROW_SSE2(48)
- FDCT_ROW_SSE2_H2(80,192)
- FDCT_ROW_SSE2(80)
- :
- : "r" (in), "r" (tab_frw_01234567_sse2.tab_frw_01234567_sse2), "r" (fdct_r_row_sse2.fdct_r_row_sse2), "i" (SHIFT_FRW_ROW), "r" (out)
- );
-}
-
-static av_always_inline void fdct_row_mmx2(const int16_t *in, int16_t *out, const int16_t *table)
-{
- pshufw_m2r(*(in + 4), mm5, 0x1B);
- movq_m2r(*(in + 0), mm0);
- movq_r2r(mm0, mm1);
- paddsw_r2r(mm5, mm0);
- psubsw_r2r(mm5, mm1);
- movq_r2r(mm0, mm2);
- punpckldq_r2r(mm1, mm0);
- punpckhdq_r2r(mm1, mm2);
- movq_m2r(*(table + 0), mm1);
- movq_m2r(*(table + 4), mm3);
- movq_m2r(*(table + 8), mm4);
- movq_m2r(*(table + 12), mm5);
- movq_m2r(*(table + 16), mm6);
- movq_m2r(*(table + 20), mm7);
- pmaddwd_r2r(mm0, mm1);
- pmaddwd_r2r(mm2, mm3);
- pmaddwd_r2r(mm0, mm4);
- pmaddwd_r2r(mm2, mm5);
- pmaddwd_r2r(mm0, mm6);
- pmaddwd_r2r(mm2, mm7);
- pmaddwd_m2r(*(table + 24), mm0);
- pmaddwd_m2r(*(table + 28), mm2);
- paddd_r2r(mm1, mm3);
- paddd_r2r(mm4, mm5);
- paddd_r2r(mm6, mm7);
- paddd_r2r(mm0, mm2);
- movq_m2r(*fdct_r_row, mm0);
- paddd_r2r(mm0, mm3);
- paddd_r2r(mm0, mm5);
- paddd_r2r(mm0, mm7);
- paddd_r2r(mm0, mm2);
- psrad_i2r(SHIFT_FRW_ROW, mm3);
- psrad_i2r(SHIFT_FRW_ROW, mm5);
- psrad_i2r(SHIFT_FRW_ROW, mm7);
- psrad_i2r(SHIFT_FRW_ROW, mm2);
- packssdw_r2r(mm5, mm3);
- packssdw_r2r(mm2, mm7);
- movq_r2m(mm3, *(out + 0));
- movq_r2m(mm7, *(out + 4));
-}
-
-static av_always_inline void fdct_row_mmx(const int16_t *in, int16_t *out, const int16_t *table)
-{
-//FIXME reorder (i dont have a old mmx only cpu here to benchmark ...)
- movd_m2r(*(in + 6), mm1);
- punpcklwd_m2r(*(in + 4), mm1);
- movq_r2r(mm1, mm2);
- psrlq_i2r(0x20, mm1);
- movq_m2r(*(in + 0), mm0);
- punpcklwd_r2r(mm2, mm1);
- movq_r2r(mm0, mm5);
- paddsw_r2r(mm1, mm0);
- psubsw_r2r(mm1, mm5);
- movq_r2r(mm0, mm2);
- punpckldq_r2r(mm5, mm0);
- punpckhdq_r2r(mm5, mm2);
- movq_m2r(*(table + 0), mm1);
- movq_m2r(*(table + 4), mm3);
- movq_m2r(*(table + 8), mm4);
- movq_m2r(*(table + 12), mm5);
- movq_m2r(*(table + 16), mm6);
- movq_m2r(*(table + 20), mm7);
- pmaddwd_r2r(mm0, mm1);
- pmaddwd_r2r(mm2, mm3);
- pmaddwd_r2r(mm0, mm4);
- pmaddwd_r2r(mm2, mm5);
- pmaddwd_r2r(mm0, mm6);
- pmaddwd_r2r(mm2, mm7);
- pmaddwd_m2r(*(table + 24), mm0);
- pmaddwd_m2r(*(table + 28), mm2);
- paddd_r2r(mm1, mm3);
- paddd_r2r(mm4, mm5);
- paddd_r2r(mm6, mm7);
- paddd_r2r(mm0, mm2);
- movq_m2r(*fdct_r_row, mm0);
- paddd_r2r(mm0, mm3);
- paddd_r2r(mm0, mm5);
- paddd_r2r(mm0, mm7);
- paddd_r2r(mm0, mm2);
- psrad_i2r(SHIFT_FRW_ROW, mm3);
- psrad_i2r(SHIFT_FRW_ROW, mm5);
- psrad_i2r(SHIFT_FRW_ROW, mm7);
- psrad_i2r(SHIFT_FRW_ROW, mm2);
- packssdw_r2r(mm5, mm3);
- packssdw_r2r(mm2, mm7);
- movq_r2m(mm3, *(out + 0));
- movq_r2m(mm7, *(out + 4));
-}
-
-void ff_fdct_mmx(int16_t *block)
-{
- int64_t align_tmp[16] ATTR_ALIGN(8);
- int16_t * block1= (int16_t*)align_tmp;
- const int16_t *table= tab_frw_01234567;
- int i;
-
- fdct_col(block, block1, 0);
- fdct_col(block, block1, 4);
-
- for(i=8;i>0;i--) {
- fdct_row_mmx(block1, block, table);
- block1 += 8;
- table += 32;
- block += 8;
- }
-}
-
-void ff_fdct_mmx2(int16_t *block)
-{
- int64_t align_tmp[16] ATTR_ALIGN(8);
- int16_t *block1= (int16_t*)align_tmp;
- const int16_t *table= tab_frw_01234567;
- int i;
-
- fdct_col(block, block1, 0);
- fdct_col(block, block1, 4);
-
- for(i=8;i>0;i--) {
- fdct_row_mmx2(block1, block, table);
- block1 += 8;
- table += 32;
- block += 8;
- }
-}
-
-void ff_fdct_sse2(int16_t *block)
-{
- int64_t align_tmp[16] ATTR_ALIGN(16);
- int16_t * const block1= (int16_t*)align_tmp;
-
- fdct_col(block, block1, 0);
- fdct_col(block, block1, 4);
-
- fdct_row_sse2(block1, block);
-}
-
diff --git a/src/libffmpeg/libavcodec/i386/fft_3dn.c b/src/libffmpeg/libavcodec/i386/fft_3dn.c
deleted file mode 100644
index 8087f1932..000000000
--- a/src/libffmpeg/libavcodec/i386/fft_3dn.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * FFT/MDCT transform with 3DNow! optimizations
- * Copyright (c) 2006 Zuxy MENG Jie, Loren Merritt
- * Based on fft_sse.c copyright (c) 2002 Fabrice Bellard.
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "../dsputil.h"
-
-static const int p1m1[2] __attribute__((aligned(8))) =
- { 0, 1 << 31 };
-
-static const int m1p1[2] __attribute__((aligned(8))) =
- { 1 << 31, 0 };
-
-void ff_fft_calc_3dn(FFTContext *s, FFTComplex *z)
-{
- int ln = s->nbits;
- long i, j;
- long nblocks, nloops;
- FFTComplex *p, *cptr;
-
- asm volatile(
- /* FEMMS is not a must here but recommended by AMD */
- "femms \n\t"
- "movq %0, %%mm7 \n\t"
- ::"m"(*(s->inverse ? m1p1 : p1m1))
- );
-
- i = 8 << ln;
- asm volatile(
- "1: \n\t"
- "sub $32, %0 \n\t"
- "movq (%0,%1), %%mm0 \n\t"
- "movq 16(%0,%1), %%mm1 \n\t"
- "movq 8(%0,%1), %%mm2 \n\t"
- "movq 24(%0,%1), %%mm3 \n\t"
- "movq %%mm0, %%mm4 \n\t"
- "movq %%mm1, %%mm5 \n\t"
- "pfadd %%mm2, %%mm0 \n\t"
- "pfadd %%mm3, %%mm1 \n\t"
- "pfsub %%mm2, %%mm4 \n\t"
- "pfsub %%mm3, %%mm5 \n\t"
- "movq %%mm0, %%mm2 \n\t"
- "punpckldq %%mm5, %%mm6 \n\t"
- "punpckhdq %%mm6, %%mm5 \n\t"
- "movq %%mm4, %%mm3 \n\t"
- "pxor %%mm7, %%mm5 \n\t"
- "pfadd %%mm1, %%mm0 \n\t"
- "pfadd %%mm5, %%mm4 \n\t"
- "pfsub %%mm1, %%mm2 \n\t"
- "pfsub %%mm5, %%mm3 \n\t"
- "movq %%mm0, (%0,%1) \n\t"
- "movq %%mm4, 8(%0,%1) \n\t"
- "movq %%mm2, 16(%0,%1) \n\t"
- "movq %%mm3, 24(%0,%1) \n\t"
- "jg 1b \n\t"
- :"+r"(i)
- :"r"(z)
- );
- /* pass 2 .. ln-1 */
-
- nblocks = 1 << (ln-3);
- nloops = 1 << 2;
- cptr = s->exptab1;
- do {
- p = z;
- j = nblocks;
- do {
- i = nloops*8;
- asm volatile(
- "1: \n\t"
- "sub $16, %0 \n\t"
- "movq (%1,%0), %%mm0 \n\t"
- "movq 8(%1,%0), %%mm1 \n\t"
- "movq (%2,%0), %%mm2 \n\t"
- "movq 8(%2,%0), %%mm3 \n\t"
- "movq %%mm2, %%mm4 \n\t"
- "movq %%mm3, %%mm5 \n\t"
- "punpckldq %%mm2, %%mm2 \n\t"
- "punpckldq %%mm3, %%mm3 \n\t"
- "punpckhdq %%mm4, %%mm4 \n\t"
- "punpckhdq %%mm5, %%mm5 \n\t"
- "pfmul (%3,%0,2), %%mm2 \n\t" // cre*re cim*re
- "pfmul 8(%3,%0,2), %%mm3 \n\t"
- "pfmul 16(%3,%0,2), %%mm4 \n\t" // -cim*im cre*im
- "pfmul 24(%3,%0,2), %%mm5 \n\t"
- "pfadd %%mm2, %%mm4 \n\t" // cre*re-cim*im cim*re+cre*im
- "pfadd %%mm3, %%mm5 \n\t"
- "movq %%mm0, %%mm2 \n\t"
- "movq %%mm1, %%mm3 \n\t"
- "pfadd %%mm4, %%mm0 \n\t"
- "pfadd %%mm5, %%mm1 \n\t"
- "pfsub %%mm4, %%mm2 \n\t"
- "pfsub %%mm5, %%mm3 \n\t"
- "movq %%mm0, (%1,%0) \n\t"
- "movq %%mm1, 8(%1,%0) \n\t"
- "movq %%mm2, (%2,%0) \n\t"
- "movq %%mm3, 8(%2,%0) \n\t"
- "jg 1b \n\t"
- :"+r"(i)
- :"r"(p), "r"(p + nloops), "r"(cptr)
- );
- p += nloops*2;
- } while (--j);
- cptr += nloops*2;
- nblocks >>= 1;
- nloops <<= 1;
- } while (nblocks != 0);
- asm volatile("femms");
-}
diff --git a/src/libffmpeg/libavcodec/i386/fft_3dn2.c b/src/libffmpeg/libavcodec/i386/fft_3dn2.c
deleted file mode 100644
index a4fe5f0b6..000000000
--- a/src/libffmpeg/libavcodec/i386/fft_3dn2.c
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * FFT/MDCT transform with Extended 3DNow! optimizations
- * Copyright (c) 2006 Zuxy MENG Jie, Loren Merritt
- * Based on fft_sse.c copyright (c) 2002 Fabrice Bellard.
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "../dsputil.h"
-
-static const int p1m1[2] __attribute__((aligned(8))) =
- { 0, 1 << 31 };
-
-static const int m1p1[2] __attribute__((aligned(8))) =
- { 1 << 31, 0 };
-
-void ff_fft_calc_3dn2(FFTContext *s, FFTComplex *z)
-{
- int ln = s->nbits;
- long i, j;
- long nblocks, nloops;
- FFTComplex *p, *cptr;
-
- asm volatile(
- /* FEMMS is not a must here but recommended by AMD */
- "femms \n\t"
- "movq %0, %%mm7 \n\t"
- ::"m"(*(s->inverse ? m1p1 : p1m1))
- );
-
- i = 8 << ln;
- asm volatile(
- "1: \n\t"
- "sub $32, %0 \n\t"
- "movq (%0,%1), %%mm0 \n\t"
- "movq 16(%0,%1), %%mm1 \n\t"
- "movq 8(%0,%1), %%mm2 \n\t"
- "movq 24(%0,%1), %%mm3 \n\t"
- "movq %%mm0, %%mm4 \n\t"
- "movq %%mm1, %%mm5 \n\t"
- "pfadd %%mm2, %%mm0 \n\t"
- "pfadd %%mm3, %%mm1 \n\t"
- "pfsub %%mm2, %%mm4 \n\t"
- "pfsub %%mm3, %%mm5 \n\t"
- "movq %%mm0, %%mm2 \n\t"
- "pswapd %%mm5, %%mm5 \n\t"
- "movq %%mm4, %%mm3 \n\t"
- "pxor %%mm7, %%mm5 \n\t"
- "pfadd %%mm1, %%mm0 \n\t"
- "pfadd %%mm5, %%mm4 \n\t"
- "pfsub %%mm1, %%mm2 \n\t"
- "pfsub %%mm5, %%mm3 \n\t"
- "movq %%mm0, (%0,%1) \n\t"
- "movq %%mm4, 8(%0,%1) \n\t"
- "movq %%mm2, 16(%0,%1) \n\t"
- "movq %%mm3, 24(%0,%1) \n\t"
- "jg 1b \n\t"
- :"+r"(i)
- :"r"(z)
- );
- /* pass 2 .. ln-1 */
-
- nblocks = 1 << (ln-3);
- nloops = 1 << 2;
- cptr = s->exptab1;
- do {
- p = z;
- j = nblocks;
- do {
- i = nloops*8;
- asm volatile(
- "1: \n\t"
- "sub $16, %0 \n\t"
- "movq (%1,%0), %%mm0 \n\t"
- "movq 8(%1,%0), %%mm1 \n\t"
- "movq (%2,%0), %%mm2 \n\t"
- "movq 8(%2,%0), %%mm3 \n\t"
- "movq (%3,%0,2), %%mm4 \n\t"
- "movq 8(%3,%0,2), %%mm5 \n\t"
- "pswapd %%mm4, %%mm6 \n\t" // no need for cptr[2] & cptr[3]
- "pswapd %%mm5, %%mm7 \n\t"
- "pfmul %%mm2, %%mm4 \n\t" // cre*re cim*im
- "pfmul %%mm3, %%mm5 \n\t"
- "pfmul %%mm2, %%mm6 \n\t" // cim*re cre*im
- "pfmul %%mm3, %%mm7 \n\t"
- "pfpnacc %%mm6, %%mm4 \n\t" // cre*re-cim*im cim*re+cre*im
- "pfpnacc %%mm7, %%mm5 \n\t"
- "movq %%mm0, %%mm2 \n\t"
- "movq %%mm1, %%mm3 \n\t"
- "pfadd %%mm4, %%mm0 \n\t"
- "pfadd %%mm5, %%mm1 \n\t"
- "pfsub %%mm4, %%mm2 \n\t"
- "pfsub %%mm5, %%mm3 \n\t"
- "movq %%mm0, (%1,%0) \n\t"
- "movq %%mm1, 8(%1,%0) \n\t"
- "movq %%mm2, (%2,%0) \n\t"
- "movq %%mm3, 8(%2,%0) \n\t"
- "jg 1b \n\t"
- :"+r"(i)
- :"r"(p), "r"(p + nloops), "r"(cptr)
- );
- p += nloops*2;
- } while (--j);
- cptr += nloops*2;
- nblocks >>= 1;
- nloops <<= 1;
- } while (nblocks != 0);
- asm volatile("femms");
-}
-
-void ff_imdct_calc_3dn2(MDCTContext *s, FFTSample *output,
- const FFTSample *input, FFTSample *tmp)
-{
- long k, n8, n4, n2, n;
- const uint16_t *revtab = s->fft.revtab;
- const FFTSample *tcos = s->tcos;
- const FFTSample *tsin = s->tsin;
- const FFTSample *in1, *in2;
- FFTComplex *z = (FFTComplex *)tmp;
-
- n = 1 << s->nbits;
- n2 = n >> 1;
- n4 = n >> 2;
- n8 = n >> 3;
-
- /* pre rotation */
- in1 = input;
- in2 = input + n2 - 1;
- for(k = 0; k < n4; k++) {
- // FIXME a single block is faster, but gcc 2.95 and 3.4.x on 32bit can't compile it
- asm volatile(
- "movd %0, %%mm0 \n\t"
- "movd %2, %%mm1 \n\t"
- "punpckldq %1, %%mm0 \n\t"
- "punpckldq %3, %%mm1 \n\t"
- "movq %%mm0, %%mm2 \n\t"
- "pfmul %%mm1, %%mm0 \n\t"
- "pswapd %%mm1, %%mm1 \n\t"
- "pfmul %%mm1, %%mm2 \n\t"
- "pfpnacc %%mm2, %%mm0 \n\t"
- ::"m"(in2[-2*k]), "m"(in1[2*k]),
- "m"(tcos[k]), "m"(tsin[k])
- );
- asm volatile(
- "movq %%mm0, %0 \n\t"
- :"=m"(z[revtab[k]])
- );
- }
-
- ff_fft_calc(&s->fft, z);
-
- /* post rotation + reordering */
- for(k = 0; k < n4; k++) {
- asm volatile(
- "movq %0, %%mm0 \n\t"
- "movd %1, %%mm1 \n\t"
- "punpckldq %2, %%mm1 \n\t"
- "movq %%mm0, %%mm2 \n\t"
- "pfmul %%mm1, %%mm0 \n\t"
- "pswapd %%mm1, %%mm1 \n\t"
- "pfmul %%mm1, %%mm2 \n\t"
- "pfpnacc %%mm2, %%mm0 \n\t"
- "movq %%mm0, %0 \n\t"
- :"+m"(z[k])
- :"m"(tcos[k]), "m"(tsin[k])
- );
- }
-
- k = n-8;
- asm volatile("movd %0, %%mm7" ::"r"(1<<31));
- asm volatile(
- "1: \n\t"
- "movq (%4,%0), %%mm0 \n\t" // z[n8+k]
- "neg %0 \n\t"
- "pswapd -8(%4,%0), %%mm1 \n\t" // z[n8-1-k]
- "movq %%mm0, %%mm2 \n\t"
- "pxor %%mm7, %%mm2 \n\t"
- "punpckldq %%mm1, %%mm2 \n\t"
- "pswapd %%mm2, %%mm3 \n\t"
- "punpckhdq %%mm1, %%mm0 \n\t"
- "pswapd %%mm0, %%mm4 \n\t"
- "pxor %%mm7, %%mm0 \n\t"
- "pxor %%mm7, %%mm4 \n\t"
- "movq %%mm3, -8(%3,%0) \n\t" // output[n-2-2*k] = { z[n8-1-k].im, -z[n8+k].re }
- "movq %%mm4, -8(%2,%0) \n\t" // output[n2-2-2*k]= { -z[n8-1-k].re, z[n8+k].im }
- "neg %0 \n\t"
- "movq %%mm0, (%1,%0) \n\t" // output[2*k] = { -z[n8+k].im, z[n8-1-k].re }
- "movq %%mm2, (%2,%0) \n\t" // output[n2+2*k] = { -z[n8+k].re, z[n8-1-k].im }
- "sub $8, %0 \n\t"
- "jge 1b \n\t"
- :"+r"(k)
- :"r"(output), "r"(output+n2), "r"(output+n), "r"(z+n8)
- :"memory"
- );
- asm volatile("femms");
-}
-
diff --git a/src/libffmpeg/libavcodec/i386/fft_sse.c b/src/libffmpeg/libavcodec/i386/fft_sse.c
deleted file mode 100644
index 0dc0c61c1..000000000
--- a/src/libffmpeg/libavcodec/i386/fft_sse.c
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * FFT/MDCT transform with SSE optimizations
- * Copyright (c) 2002 Fabrice Bellard.
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "../dsputil.h"
-
-static const int p1p1p1m1[4] __attribute__((aligned(16))) =
- { 0, 0, 0, 1 << 31 };
-
-static const int p1p1m1p1[4] __attribute__((aligned(16))) =
- { 0, 0, 1 << 31, 0 };
-
-static const int p1p1m1m1[4] __attribute__((aligned(16))) =
- { 0, 0, 1 << 31, 1 << 31 };
-
-static const int p1m1p1m1[4] __attribute__((aligned(16))) =
- { 0, 1 << 31, 0, 1 << 31 };
-
-static const int m1m1m1m1[4] __attribute__((aligned(16))) =
- { 1 << 31, 1 << 31, 1 << 31, 1 << 31 };
-
-#if 0
-static void print_v4sf(const char *str, __m128 a)
-{
- float *p = (float *)&a;
- printf("%s: %f %f %f %f\n",
- str, p[0], p[1], p[2], p[3]);
-}
-#endif
-
-/* XXX: handle reverse case */
-void ff_fft_calc_sse(FFTContext *s, FFTComplex *z)
-{
- int ln = s->nbits;
- long i, j;
- long nblocks, nloops;
- FFTComplex *p, *cptr;
-
- asm volatile(
- "movaps %0, %%xmm4 \n\t"
- "movaps %1, %%xmm5 \n\t"
- ::"m"(*p1p1m1m1),
- "m"(*(s->inverse ? p1p1m1p1 : p1p1p1m1))
- );
-
- i = 8 << ln;
- asm volatile(
- "1: \n\t"
- "sub $32, %0 \n\t"
- /* do the pass 0 butterfly */
- "movaps (%0,%1), %%xmm0 \n\t"
- "movaps %%xmm0, %%xmm1 \n\t"
- "shufps $0x4E, %%xmm0, %%xmm0 \n\t"
- "xorps %%xmm4, %%xmm1 \n\t"
- "addps %%xmm1, %%xmm0 \n\t"
- "movaps 16(%0,%1), %%xmm2 \n\t"
- "movaps %%xmm2, %%xmm3 \n\t"
- "shufps $0x4E, %%xmm2, %%xmm2 \n\t"
- "xorps %%xmm4, %%xmm3 \n\t"
- "addps %%xmm3, %%xmm2 \n\t"
- /* multiply third by -i */
- /* by toggling the sign bit */
- "shufps $0xB4, %%xmm2, %%xmm2 \n\t"
- "xorps %%xmm5, %%xmm2 \n\t"
- /* do the pass 1 butterfly */
- "movaps %%xmm0, %%xmm1 \n\t"
- "addps %%xmm2, %%xmm0 \n\t"
- "subps %%xmm2, %%xmm1 \n\t"
- "movaps %%xmm0, (%0,%1) \n\t"
- "movaps %%xmm1, 16(%0,%1) \n\t"
- "jg 1b \n\t"
- :"+r"(i)
- :"r"(z)
- );
- /* pass 2 .. ln-1 */
-
- nblocks = 1 << (ln-3);
- nloops = 1 << 2;
- cptr = s->exptab1;
- do {
- p = z;
- j = nblocks;
- do {
- i = nloops*8;
- asm volatile(
- "1: \n\t"
- "sub $16, %0 \n\t"
- "movaps (%2,%0), %%xmm1 \n\t"
- "movaps (%1,%0), %%xmm0 \n\t"
- "movaps %%xmm1, %%xmm2 \n\t"
- "shufps $0xA0, %%xmm1, %%xmm1 \n\t"
- "shufps $0xF5, %%xmm2, %%xmm2 \n\t"
- "mulps (%3,%0,2), %%xmm1 \n\t" // cre*re cim*re
- "mulps 16(%3,%0,2), %%xmm2 \n\t" // -cim*im cre*im
- "addps %%xmm2, %%xmm1 \n\t"
- "movaps %%xmm0, %%xmm3 \n\t"
- "addps %%xmm1, %%xmm0 \n\t"
- "subps %%xmm1, %%xmm3 \n\t"
- "movaps %%xmm0, (%1,%0) \n\t"
- "movaps %%xmm3, (%2,%0) \n\t"
- "jg 1b \n\t"
- :"+r"(i)
- :"r"(p), "r"(p + nloops), "r"(cptr)
- );
- p += nloops*2;
- } while (--j);
- cptr += nloops*2;
- nblocks >>= 1;
- nloops <<= 1;
- } while (nblocks != 0);
-}
-
-void ff_imdct_calc_sse(MDCTContext *s, FFTSample *output,
- const FFTSample *input, FFTSample *tmp)
-{
- long k, n8, n4, n2, n;
- const uint16_t *revtab = s->fft.revtab;
- const FFTSample *tcos = s->tcos;
- const FFTSample *tsin = s->tsin;
- const FFTSample *in1, *in2;
- FFTComplex *z = (FFTComplex *)tmp;
-
- n = 1 << s->nbits;
- n2 = n >> 1;
- n4 = n >> 2;
- n8 = n >> 3;
-
- asm volatile ("movaps %0, %%xmm7\n\t"::"m"(*p1m1p1m1));
-
- /* pre rotation */
- in1 = input;
- in2 = input + n2 - 4;
-
- /* Complex multiplication
- Two complex products per iteration, we could have 4 with 8 xmm
- registers, 8 with 16 xmm registers.
- Maybe we should unroll more.
- */
- for (k = 0; k < n4; k += 2) {
- asm volatile (
- "movaps %0, %%xmm0 \n\t" // xmm0 = r0 X r1 X : in2
- "movaps %1, %%xmm3 \n\t" // xmm3 = X i1 X i0: in1
- "movlps %2, %%xmm1 \n\t" // xmm1 = X X R1 R0: tcos
- "movlps %3, %%xmm2 \n\t" // xmm2 = X X I1 I0: tsin
- "shufps $95, %%xmm0, %%xmm0 \n\t" // xmm0 = r1 r1 r0 r0
- "shufps $160,%%xmm3, %%xmm3 \n\t" // xmm3 = i1 i1 i0 i0
- "unpcklps %%xmm2, %%xmm1 \n\t" // xmm1 = I1 R1 I0 R0
- "movaps %%xmm1, %%xmm2 \n\t" // xmm2 = I1 R1 I0 R0
- "xorps %%xmm7, %%xmm2 \n\t" // xmm2 = -I1 R1 -I0 R0
- "mulps %%xmm1, %%xmm0 \n\t" // xmm0 = rI rR rI rR
- "shufps $177,%%xmm2, %%xmm2 \n\t" // xmm2 = R1 -I1 R0 -I0
- "mulps %%xmm2, %%xmm3 \n\t" // xmm3 = Ri -Ii Ri -Ii
- "addps %%xmm3, %%xmm0 \n\t" // xmm0 = result
- ::"m"(in2[-2*k]), "m"(in1[2*k]),
- "m"(tcos[k]), "m"(tsin[k])
- );
- /* Should be in the same block, hack for gcc2.95 & gcc3 */
- asm (
- "movlps %%xmm0, %0 \n\t"
- "movhps %%xmm0, %1 \n\t"
- :"=m"(z[revtab[k]]), "=m"(z[revtab[k + 1]])
- );
- }
-
- ff_fft_calc_sse(&s->fft, z);
-
- /* Not currently needed, added for safety */
- asm volatile ("movaps %0, %%xmm7\n\t"::"m"(*p1m1p1m1));
-
- /* post rotation + reordering */
- for (k = 0; k < n4; k += 2) {
- asm (
- "movaps %0, %%xmm0 \n\t" // xmm0 = i1 r1 i0 r0: z
- "movlps %1, %%xmm1 \n\t" // xmm1 = X X R1 R0: tcos
- "movaps %%xmm0, %%xmm3 \n\t" // xmm3 = i1 r1 i0 r0
- "movlps %2, %%xmm2 \n\t" // xmm2 = X X I1 I0: tsin
- "shufps $160,%%xmm0, %%xmm0 \n\t" // xmm0 = r1 r1 r0 r0
- "shufps $245,%%xmm3, %%xmm3 \n\t" // xmm3 = i1 i1 i0 i0
- "unpcklps %%xmm2, %%xmm1 \n\t" // xmm1 = I1 R1 I0 R0
- "movaps %%xmm1, %%xmm2 \n\t" // xmm2 = I1 R1 I0 R0
- "xorps %%xmm7, %%xmm2 \n\t" // xmm2 = -I1 R1 -I0 R0
- "mulps %%xmm1, %%xmm0 \n\t" // xmm0 = rI rR rI rR
- "shufps $177,%%xmm2, %%xmm2 \n\t" // xmm2 = R1 -I1 R0 -I0
- "mulps %%xmm2, %%xmm3 \n\t" // xmm3 = Ri -Ii Ri -Ii
- "addps %%xmm3, %%xmm0 \n\t" // xmm0 = result
- "movaps %%xmm0, %0 \n\t"
- :"+m"(z[k])
- :"m"(tcos[k]), "m"(tsin[k])
- );
- }
-
- /*
- Mnemonics:
- 0 = z[k].re
- 1 = z[k].im
- 2 = z[k + 1].re
- 3 = z[k + 1].im
- 4 = z[-k - 2].re
- 5 = z[-k - 2].im
- 6 = z[-k - 1].re
- 7 = z[-k - 1].im
- */
- k = 16-n;
- asm volatile("movaps %0, %%xmm7 \n\t"::"m"(*m1m1m1m1));
- asm volatile(
- "1: \n\t"
- "movaps -16(%4,%0), %%xmm1 \n\t" // xmm1 = 4 5 6 7 = z[-2-k]
- "neg %0 \n\t"
- "movaps (%4,%0), %%xmm0 \n\t" // xmm0 = 0 1 2 3 = z[k]
- "xorps %%xmm7, %%xmm0 \n\t" // xmm0 = -0 -1 -2 -3
- "movaps %%xmm0, %%xmm2 \n\t" // xmm2 = -0 -1 -2 -3
- "shufps $141,%%xmm1, %%xmm0 \n\t" // xmm0 = -1 -3 4 6
- "shufps $216,%%xmm1, %%xmm2 \n\t" // xmm2 = -0 -2 5 7
- "shufps $156,%%xmm0, %%xmm0 \n\t" // xmm0 = -1 6 -3 4 !
- "shufps $156,%%xmm2, %%xmm2 \n\t" // xmm2 = -0 7 -2 5 !
- "movaps %%xmm0, (%1,%0) \n\t" // output[2*k]
- "movaps %%xmm2, (%2,%0) \n\t" // output[n2+2*k]
- "neg %0 \n\t"
- "shufps $27, %%xmm0, %%xmm0 \n\t" // xmm0 = 4 -3 6 -1
- "xorps %%xmm7, %%xmm0 \n\t" // xmm0 = -4 3 -6 1 !
- "shufps $27, %%xmm2, %%xmm2 \n\t" // xmm2 = 5 -2 7 -0 !
- "movaps %%xmm0, -16(%2,%0) \n\t" // output[n2-4-2*k]
- "movaps %%xmm2, -16(%3,%0) \n\t" // output[n-4-2*k]
- "add $16, %0 \n\t"
- "jle 1b \n\t"
- :"+r"(k)
- :"r"(output), "r"(output+n2), "r"(output+n), "r"(z+n8)
- :"memory"
- );
-}
-
diff --git a/src/libffmpeg/libavcodec/i386/h264dsp_mmx.c b/src/libffmpeg/libavcodec/i386/h264dsp_mmx.c
deleted file mode 100644
index 40baf199b..000000000
--- a/src/libffmpeg/libavcodec/i386/h264dsp_mmx.c
+++ /dev/null
@@ -1,1513 +0,0 @@
-/*
- * Copyright (c) 2004-2005 Michael Niedermayer, Loren Merritt
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-
-/***********************************/
-/* IDCT */
-
-/* in/out: mma=mma+mmb, mmb=mmb-mma */
-#define SUMSUB_BA( a, b ) \
- "paddw "#b", "#a" \n\t"\
- "paddw "#b", "#b" \n\t"\
- "psubw "#a", "#b" \n\t"
-
-#define SUMSUB_BADC( a, b, c, d ) \
- "paddw "#b", "#a" \n\t"\
- "paddw "#d", "#c" \n\t"\
- "paddw "#b", "#b" \n\t"\
- "paddw "#d", "#d" \n\t"\
- "psubw "#a", "#b" \n\t"\
- "psubw "#c", "#d" \n\t"
-
-#define SUMSUBD2_AB( a, b, t ) \
- "movq "#b", "#t" \n\t"\
- "psraw $1 , "#b" \n\t"\
- "paddw "#a", "#b" \n\t"\
- "psraw $1 , "#a" \n\t"\
- "psubw "#t", "#a" \n\t"
-
-#define IDCT4_1D( s02, s13, d02, d13, t ) \
- SUMSUB_BA ( s02, d02 )\
- SUMSUBD2_AB( s13, d13, t )\
- SUMSUB_BADC( d13, s02, s13, d02 )
-
-#define TRANSPOSE4(a,b,c,d,t)\
- SBUTTERFLY(a,b,t,wd) /* a=aebf t=cgdh */\
- SBUTTERFLY(c,d,b,wd) /* c=imjn b=kolp */\
- SBUTTERFLY(a,c,d,dq) /* a=aeim d=bfjn */\
- SBUTTERFLY(t,b,c,dq) /* t=cgko c=dhlp */
-
-#define STORE_DIFF_4P( p, t, z ) \
- "psraw $6, "#p" \n\t"\
- "movd (%0), "#t" \n\t"\
- "punpcklbw "#z", "#t" \n\t"\
- "paddsw "#t", "#p" \n\t"\
- "packuswb "#z", "#p" \n\t"\
- "movd "#p", (%0) \n\t"
-
-static void ff_h264_idct_add_mmx(uint8_t *dst, int16_t *block, int stride)
-{
- /* Load dct coeffs */
- asm volatile(
- "movq (%0), %%mm0 \n\t"
- "movq 8(%0), %%mm1 \n\t"
- "movq 16(%0), %%mm2 \n\t"
- "movq 24(%0), %%mm3 \n\t"
- :: "r"(block) );
-
- asm volatile(
- /* mm1=s02+s13 mm2=s02-s13 mm4=d02+d13 mm0=d02-d13 */
- IDCT4_1D( %%mm2, %%mm1, %%mm0, %%mm3, %%mm4 )
-
- "movq %0, %%mm6 \n\t"
- /* in: 1,4,0,2 out: 1,2,3,0 */
- TRANSPOSE4( %%mm3, %%mm1, %%mm0, %%mm2, %%mm4 )
-
- "paddw %%mm6, %%mm3 \n\t"
-
- /* mm2=s02+s13 mm3=s02-s13 mm4=d02+d13 mm1=d02-d13 */
- IDCT4_1D( %%mm4, %%mm2, %%mm3, %%mm0, %%mm1 )
-
- "pxor %%mm7, %%mm7 \n\t"
- :: "m"(ff_pw_32));
-
- asm volatile(
- STORE_DIFF_4P( %%mm0, %%mm1, %%mm7)
- "add %1, %0 \n\t"
- STORE_DIFF_4P( %%mm2, %%mm1, %%mm7)
- "add %1, %0 \n\t"
- STORE_DIFF_4P( %%mm3, %%mm1, %%mm7)
- "add %1, %0 \n\t"
- STORE_DIFF_4P( %%mm4, %%mm1, %%mm7)
- : "+r"(dst)
- : "r" ((long)stride)
- );
-}
-
-static inline void h264_idct8_1d(int16_t *block)
-{
- asm volatile(
- "movq 112(%0), %%mm7 \n\t"
- "movq 80(%0), %%mm5 \n\t"
- "movq 48(%0), %%mm3 \n\t"
- "movq 16(%0), %%mm1 \n\t"
-
- "movq %%mm7, %%mm4 \n\t"
- "movq %%mm3, %%mm6 \n\t"
- "movq %%mm5, %%mm0 \n\t"
- "movq %%mm7, %%mm2 \n\t"
- "psraw $1, %%mm4 \n\t"
- "psraw $1, %%mm6 \n\t"
- "psubw %%mm7, %%mm0 \n\t"
- "psubw %%mm6, %%mm2 \n\t"
- "psubw %%mm4, %%mm0 \n\t"
- "psubw %%mm3, %%mm2 \n\t"
- "psubw %%mm3, %%mm0 \n\t"
- "paddw %%mm1, %%mm2 \n\t"
-
- "movq %%mm5, %%mm4 \n\t"
- "movq %%mm1, %%mm6 \n\t"
- "psraw $1, %%mm4 \n\t"
- "psraw $1, %%mm6 \n\t"
- "paddw %%mm5, %%mm4 \n\t"
- "paddw %%mm1, %%mm6 \n\t"
- "paddw %%mm7, %%mm4 \n\t"
- "paddw %%mm5, %%mm6 \n\t"
- "psubw %%mm1, %%mm4 \n\t"
- "paddw %%mm3, %%mm6 \n\t"
-
- "movq %%mm0, %%mm1 \n\t"
- "movq %%mm4, %%mm3 \n\t"
- "movq %%mm2, %%mm5 \n\t"
- "movq %%mm6, %%mm7 \n\t"
- "psraw $2, %%mm6 \n\t"
- "psraw $2, %%mm3 \n\t"
- "psraw $2, %%mm5 \n\t"
- "psraw $2, %%mm0 \n\t"
- "paddw %%mm6, %%mm1 \n\t"
- "paddw %%mm2, %%mm3 \n\t"
- "psubw %%mm4, %%mm5 \n\t"
- "psubw %%mm0, %%mm7 \n\t"
-
- "movq 32(%0), %%mm2 \n\t"
- "movq 96(%0), %%mm6 \n\t"
- "movq %%mm2, %%mm4 \n\t"
- "movq %%mm6, %%mm0 \n\t"
- "psraw $1, %%mm4 \n\t"
- "psraw $1, %%mm6 \n\t"
- "psubw %%mm0, %%mm4 \n\t"
- "paddw %%mm2, %%mm6 \n\t"
-
- "movq (%0), %%mm2 \n\t"
- "movq 64(%0), %%mm0 \n\t"
- SUMSUB_BA( %%mm0, %%mm2 )
- SUMSUB_BA( %%mm6, %%mm0 )
- SUMSUB_BA( %%mm4, %%mm2 )
- SUMSUB_BA( %%mm7, %%mm6 )
- SUMSUB_BA( %%mm5, %%mm4 )
- SUMSUB_BA( %%mm3, %%mm2 )
- SUMSUB_BA( %%mm1, %%mm0 )
- :: "r"(block)
- );
-}
-
-static void ff_h264_idct8_add_mmx(uint8_t *dst, int16_t *block, int stride)
-{
- int i;
- int16_t __attribute__ ((aligned(8))) b2[64];
-
- block[0] += 32;
-
- for(i=0; i<2; i++){
- DECLARE_ALIGNED_8(uint64_t, tmp);
-
- h264_idct8_1d(block+4*i);
-
- asm volatile(
- "movq %%mm7, %0 \n\t"
- TRANSPOSE4( %%mm0, %%mm2, %%mm4, %%mm6, %%mm7 )
- "movq %%mm0, 8(%1) \n\t"
- "movq %%mm6, 24(%1) \n\t"
- "movq %%mm7, 40(%1) \n\t"
- "movq %%mm4, 56(%1) \n\t"
- "movq %0, %%mm7 \n\t"
- TRANSPOSE4( %%mm7, %%mm5, %%mm3, %%mm1, %%mm0 )
- "movq %%mm7, (%1) \n\t"
- "movq %%mm1, 16(%1) \n\t"
- "movq %%mm0, 32(%1) \n\t"
- "movq %%mm3, 48(%1) \n\t"
- : "=m"(tmp)
- : "r"(b2+32*i)
- : "memory"
- );
- }
-
- for(i=0; i<2; i++){
- h264_idct8_1d(b2+4*i);
-
- asm volatile(
- "psraw $6, %%mm7 \n\t"
- "psraw $6, %%mm6 \n\t"
- "psraw $6, %%mm5 \n\t"
- "psraw $6, %%mm4 \n\t"
- "psraw $6, %%mm3 \n\t"
- "psraw $6, %%mm2 \n\t"
- "psraw $6, %%mm1 \n\t"
- "psraw $6, %%mm0 \n\t"
-
- "movq %%mm7, (%0) \n\t"
- "movq %%mm5, 16(%0) \n\t"
- "movq %%mm3, 32(%0) \n\t"
- "movq %%mm1, 48(%0) \n\t"
- "movq %%mm0, 64(%0) \n\t"
- "movq %%mm2, 80(%0) \n\t"
- "movq %%mm4, 96(%0) \n\t"
- "movq %%mm6, 112(%0) \n\t"
- :: "r"(b2+4*i)
- : "memory"
- );
- }
-
- add_pixels_clamped_mmx(b2, dst, stride);
-}
-
-static void ff_h264_idct_dc_add_mmx2(uint8_t *dst, int16_t *block, int stride)
-{
- int dc = (block[0] + 32) >> 6;
- asm volatile(
- "movd %0, %%mm0 \n\t"
- "pshufw $0, %%mm0, %%mm0 \n\t"
- "pxor %%mm1, %%mm1 \n\t"
- "psubw %%mm0, %%mm1 \n\t"
- "packuswb %%mm0, %%mm0 \n\t"
- "packuswb %%mm1, %%mm1 \n\t"
- ::"r"(dc)
- );
- asm volatile(
- "movd %0, %%mm2 \n\t"
- "movd %1, %%mm3 \n\t"
- "movd %2, %%mm4 \n\t"
- "movd %3, %%mm5 \n\t"
- "paddusb %%mm0, %%mm2 \n\t"
- "paddusb %%mm0, %%mm3 \n\t"
- "paddusb %%mm0, %%mm4 \n\t"
- "paddusb %%mm0, %%mm5 \n\t"
- "psubusb %%mm1, %%mm2 \n\t"
- "psubusb %%mm1, %%mm3 \n\t"
- "psubusb %%mm1, %%mm4 \n\t"
- "psubusb %%mm1, %%mm5 \n\t"
- "movd %%mm2, %0 \n\t"
- "movd %%mm3, %1 \n\t"
- "movd %%mm4, %2 \n\t"
- "movd %%mm5, %3 \n\t"
- :"+m"(*(uint32_t*)(dst+0*stride)),
- "+m"(*(uint32_t*)(dst+1*stride)),
- "+m"(*(uint32_t*)(dst+2*stride)),
- "+m"(*(uint32_t*)(dst+3*stride))
- );
-}
-
-static void ff_h264_idct8_dc_add_mmx2(uint8_t *dst, int16_t *block, int stride)
-{
- int dc = (block[0] + 32) >> 6;
- int y;
- asm volatile(
- "movd %0, %%mm0 \n\t"
- "pshufw $0, %%mm0, %%mm0 \n\t"
- "pxor %%mm1, %%mm1 \n\t"
- "psubw %%mm0, %%mm1 \n\t"
- "packuswb %%mm0, %%mm0 \n\t"
- "packuswb %%mm1, %%mm1 \n\t"
- ::"r"(dc)
- );
- for(y=2; y--; dst += 4*stride){
- asm volatile(
- "movq %0, %%mm2 \n\t"
- "movq %1, %%mm3 \n\t"
- "movq %2, %%mm4 \n\t"
- "movq %3, %%mm5 \n\t"
- "paddusb %%mm0, %%mm2 \n\t"
- "paddusb %%mm0, %%mm3 \n\t"
- "paddusb %%mm0, %%mm4 \n\t"
- "paddusb %%mm0, %%mm5 \n\t"
- "psubusb %%mm1, %%mm2 \n\t"
- "psubusb %%mm1, %%mm3 \n\t"
- "psubusb %%mm1, %%mm4 \n\t"
- "psubusb %%mm1, %%mm5 \n\t"
- "movq %%mm2, %0 \n\t"
- "movq %%mm3, %1 \n\t"
- "movq %%mm4, %2 \n\t"
- "movq %%mm5, %3 \n\t"
- :"+m"(*(uint64_t*)(dst+0*stride)),
- "+m"(*(uint64_t*)(dst+1*stride)),
- "+m"(*(uint64_t*)(dst+2*stride)),
- "+m"(*(uint64_t*)(dst+3*stride))
- );
- }
-}
-
-
-/***********************************/
-/* deblocking */
-
-// out: o = |x-y|>a
-// clobbers: t
-#define DIFF_GT_MMX(x,y,a,o,t)\
- "movq "#y", "#t" \n\t"\
- "movq "#x", "#o" \n\t"\
- "psubusb "#x", "#t" \n\t"\
- "psubusb "#y", "#o" \n\t"\
- "por "#t", "#o" \n\t"\
- "psubusb "#a", "#o" \n\t"
-
-// out: o = |x-y|>a
-// clobbers: t
-#define DIFF_GT2_MMX(x,y,a,o,t)\
- "movq "#y", "#t" \n\t"\
- "movq "#x", "#o" \n\t"\
- "psubusb "#x", "#t" \n\t"\
- "psubusb "#y", "#o" \n\t"\
- "psubusb "#a", "#t" \n\t"\
- "psubusb "#a", "#o" \n\t"\
- "pcmpeqb "#t", "#o" \n\t"\
-
-// in: mm0=p1 mm1=p0 mm2=q0 mm3=q1
-// out: mm5=beta-1, mm7=mask
-// clobbers: mm4,mm6
-#define H264_DEBLOCK_MASK(alpha1, beta1) \
- "pshufw $0, "#alpha1", %%mm4 \n\t"\
- "pshufw $0, "#beta1 ", %%mm5 \n\t"\
- "packuswb %%mm4, %%mm4 \n\t"\
- "packuswb %%mm5, %%mm5 \n\t"\
- DIFF_GT_MMX(%%mm1, %%mm2, %%mm4, %%mm7, %%mm6) /* |p0-q0| > alpha-1 */\
- DIFF_GT_MMX(%%mm0, %%mm1, %%mm5, %%mm4, %%mm6) /* |p1-p0| > beta-1 */\
- "por %%mm4, %%mm7 \n\t"\
- DIFF_GT_MMX(%%mm3, %%mm2, %%mm5, %%mm4, %%mm6) /* |q1-q0| > beta-1 */\
- "por %%mm4, %%mm7 \n\t"\
- "pxor %%mm6, %%mm6 \n\t"\
- "pcmpeqb %%mm6, %%mm7 \n\t"
-
-// in: mm0=p1 mm1=p0 mm2=q0 mm3=q1 mm7=(tc&mask)
-// out: mm1=p0' mm2=q0'
-// clobbers: mm0,3-6
-#define H264_DEBLOCK_P0_Q0(pb_01, pb_3f)\
- "movq %%mm1 , %%mm5 \n\t"\
- "pxor %%mm2 , %%mm5 \n\t" /* p0^q0*/\
- "pand "#pb_01" , %%mm5 \n\t" /* (p0^q0)&1*/\
- "pcmpeqb %%mm4 , %%mm4 \n\t"\
- "pxor %%mm4 , %%mm3 \n\t"\
- "pavgb %%mm0 , %%mm3 \n\t" /* (p1 - q1 + 256)>>1*/\
- "pavgb "MANGLE(ff_pb_3)" , %%mm3 \n\t" /*(((p1 - q1 + 256)>>1)+4)>>1 = 64+2+(p1-q1)>>2*/\
- "pxor %%mm1 , %%mm4 \n\t"\
- "pavgb %%mm2 , %%mm4 \n\t" /* (q0 - p0 + 256)>>1*/\
- "pavgb %%mm5 , %%mm3 \n\t"\
- "paddusb %%mm4 , %%mm3 \n\t" /* d+128+33*/\
- "movq "MANGLE(ff_pb_A1)" , %%mm6 \n\t"\
- "psubusb %%mm3 , %%mm6 \n\t"\
- "psubusb "MANGLE(ff_pb_A1)" , %%mm3 \n\t"\
- "pminub %%mm7 , %%mm6 \n\t"\
- "pminub %%mm7 , %%mm3 \n\t"\
- "psubusb %%mm6 , %%mm1 \n\t"\
- "psubusb %%mm3 , %%mm2 \n\t"\
- "paddusb %%mm3 , %%mm1 \n\t"\
- "paddusb %%mm6 , %%mm2 \n\t"
-
-// in: mm0=p1 mm1=p0 mm2=q0 mm3=q1 mm7=(tc&mask) %8=mm_bone
-// out: (q1addr) = clip( (q2+((p0+q0+1)>>1))>>1, q1-tc0, q1+tc0 )
-// clobbers: q2, tmp, tc0
-#define H264_DEBLOCK_Q1(p1, q2, q2addr, q1addr, tc0, tmp)\
- "movq %%mm1, "#tmp" \n\t"\
- "pavgb %%mm2, "#tmp" \n\t"\
- "pavgb "#tmp", "#q2" \n\t" /* avg(p2,avg(p0,q0)) */\
- "pxor "q2addr", "#tmp" \n\t"\
- "pand %8, "#tmp" \n\t" /* (p2^avg(p0,q0))&1 */\
- "psubusb "#tmp", "#q2" \n\t" /* (p2+((p0+q0+1)>>1))>>1 */\
- "movq "#p1", "#tmp" \n\t"\
- "psubusb "#tc0", "#tmp" \n\t"\
- "paddusb "#p1", "#tc0" \n\t"\
- "pmaxub "#tmp", "#q2" \n\t"\
- "pminub "#tc0", "#q2" \n\t"\
- "movq "#q2", "q1addr" \n\t"
-
-static inline void h264_loop_filter_luma_mmx2(uint8_t *pix, int stride, int alpha1, int beta1, int8_t *tc0)
-{
- DECLARE_ALIGNED_8(uint64_t, tmp0[2]);
-
- asm volatile(
- "movq (%1,%3), %%mm0 \n\t" //p1
- "movq (%1,%3,2), %%mm1 \n\t" //p0
- "movq (%2), %%mm2 \n\t" //q0
- "movq (%2,%3), %%mm3 \n\t" //q1
- H264_DEBLOCK_MASK(%6, %7)
-
- "movd %5, %%mm4 \n\t"
- "punpcklbw %%mm4, %%mm4 \n\t"
- "punpcklwd %%mm4, %%mm4 \n\t"
- "pcmpeqb %%mm3, %%mm3 \n\t"
- "movq %%mm4, %%mm6 \n\t"
- "pcmpgtb %%mm3, %%mm4 \n\t"
- "movq %%mm6, 8+%0 \n\t"
- "pand %%mm4, %%mm7 \n\t"
- "movq %%mm7, %0 \n\t"
-
- /* filter p1 */
- "movq (%1), %%mm3 \n\t" //p2
- DIFF_GT2_MMX(%%mm1, %%mm3, %%mm5, %%mm6, %%mm4) // |p2-p0|>beta-1
- "pand %%mm7, %%mm6 \n\t" // mask & |p2-p0|<beta
- "pand 8+%0, %%mm7 \n\t" // mask & tc0
- "movq %%mm7, %%mm4 \n\t"
- "psubb %%mm6, %%mm7 \n\t"
- "pand %%mm4, %%mm6 \n\t" // mask & |p2-p0|<beta & tc0
- H264_DEBLOCK_Q1(%%mm0, %%mm3, "(%1)", "(%1,%3)", %%mm6, %%mm4)
-
- /* filter q1 */
- "movq (%2,%3,2), %%mm4 \n\t" //q2
- DIFF_GT2_MMX(%%mm2, %%mm4, %%mm5, %%mm6, %%mm3) // |q2-q0|>beta-1
- "pand %0, %%mm6 \n\t"
- "movq 8+%0, %%mm5 \n\t" // can be merged with the and below but is slower then
- "pand %%mm6, %%mm5 \n\t"
- "psubb %%mm6, %%mm7 \n\t"
- "movq (%2,%3), %%mm3 \n\t"
- H264_DEBLOCK_Q1(%%mm3, %%mm4, "(%2,%3,2)", "(%2,%3)", %%mm5, %%mm6)
-
- /* filter p0, q0 */
- H264_DEBLOCK_P0_Q0(%8, unused)
- "movq %%mm1, (%1,%3,2) \n\t"
- "movq %%mm2, (%2) \n\t"
-
- : "=m"(*tmp0)
- : "r"(pix-3*stride), "r"(pix), "r"((long)stride),
- "m"(*tmp0/*unused*/), "m"(*(uint32_t*)tc0), "m"(alpha1), "m"(beta1),
- "m"(mm_bone)
- );
-}
-
-static void h264_v_loop_filter_luma_mmx2(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
-{
- if((tc0[0] & tc0[1]) >= 0)
- h264_loop_filter_luma_mmx2(pix, stride, alpha-1, beta-1, tc0);
- if((tc0[2] & tc0[3]) >= 0)
- h264_loop_filter_luma_mmx2(pix+8, stride, alpha-1, beta-1, tc0+2);
-}
-static void h264_h_loop_filter_luma_mmx2(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
-{
- //FIXME: could cut some load/stores by merging transpose with filter
- // also, it only needs to transpose 6x8
- DECLARE_ALIGNED_8(uint8_t, trans[8*8]);
- int i;
- for(i=0; i<2; i++, pix+=8*stride, tc0+=2) {
- if((tc0[0] & tc0[1]) < 0)
- continue;
- transpose4x4(trans, pix-4, 8, stride);
- transpose4x4(trans +4*8, pix, 8, stride);
- transpose4x4(trans+4, pix-4+4*stride, 8, stride);
- transpose4x4(trans+4+4*8, pix +4*stride, 8, stride);
- h264_loop_filter_luma_mmx2(trans+4*8, 8, alpha-1, beta-1, tc0);
- transpose4x4(pix-2, trans +2*8, stride, 8);
- transpose4x4(pix-2+4*stride, trans+4+2*8, stride, 8);
- }
-}
-
-static inline void h264_loop_filter_chroma_mmx2(uint8_t *pix, int stride, int alpha1, int beta1, int8_t *tc0)
-{
- asm volatile(
- "movq (%0), %%mm0 \n\t" //p1
- "movq (%0,%2), %%mm1 \n\t" //p0
- "movq (%1), %%mm2 \n\t" //q0
- "movq (%1,%2), %%mm3 \n\t" //q1
- H264_DEBLOCK_MASK(%4, %5)
- "movd %3, %%mm6 \n\t"
- "punpcklbw %%mm6, %%mm6 \n\t"
- "pand %%mm6, %%mm7 \n\t" // mm7 = tc&mask
- H264_DEBLOCK_P0_Q0(%6, %7)
- "movq %%mm1, (%0,%2) \n\t"
- "movq %%mm2, (%1) \n\t"
-
- :: "r"(pix-2*stride), "r"(pix), "r"((long)stride),
- "r"(*(uint32_t*)tc0),
- "m"(alpha1), "m"(beta1), "m"(mm_bone), "m"(ff_pb_3F)
- );
-}
-
-static void h264_v_loop_filter_chroma_mmx2(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
-{
- h264_loop_filter_chroma_mmx2(pix, stride, alpha-1, beta-1, tc0);
-}
-
-static void h264_h_loop_filter_chroma_mmx2(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
-{
- //FIXME: could cut some load/stores by merging transpose with filter
- DECLARE_ALIGNED_8(uint8_t, trans[8*4]);
- transpose4x4(trans, pix-2, 8, stride);
- transpose4x4(trans+4, pix-2+4*stride, 8, stride);
- h264_loop_filter_chroma_mmx2(trans+2*8, 8, alpha-1, beta-1, tc0);
- transpose4x4(pix-2, trans, stride, 8);
- transpose4x4(pix-2+4*stride, trans+4, stride, 8);
-}
-
-// p0 = (p0 + q1 + 2*p1 + 2) >> 2
-#define H264_FILTER_CHROMA4(p0, p1, q1, one) \
- "movq "#p0", %%mm4 \n\t"\
- "pxor "#q1", %%mm4 \n\t"\
- "pand "#one", %%mm4 \n\t" /* mm4 = (p0^q1)&1 */\
- "pavgb "#q1", "#p0" \n\t"\
- "psubusb %%mm4, "#p0" \n\t"\
- "pavgb "#p1", "#p0" \n\t" /* dst = avg(p1, avg(p0,q1) - ((p0^q1)&1)) */\
-
-static inline void h264_loop_filter_chroma_intra_mmx2(uint8_t *pix, int stride, int alpha1, int beta1)
-{
- asm volatile(
- "movq (%0), %%mm0 \n\t"
- "movq (%0,%2), %%mm1 \n\t"
- "movq (%1), %%mm2 \n\t"
- "movq (%1,%2), %%mm3 \n\t"
- H264_DEBLOCK_MASK(%3, %4)
- "movq %%mm1, %%mm5 \n\t"
- "movq %%mm2, %%mm6 \n\t"
- H264_FILTER_CHROMA4(%%mm1, %%mm0, %%mm3, %5) //p0'
- H264_FILTER_CHROMA4(%%mm2, %%mm3, %%mm0, %5) //q0'
- "psubb %%mm5, %%mm1 \n\t"
- "psubb %%mm6, %%mm2 \n\t"
- "pand %%mm7, %%mm1 \n\t"
- "pand %%mm7, %%mm2 \n\t"
- "paddb %%mm5, %%mm1 \n\t"
- "paddb %%mm6, %%mm2 \n\t"
- "movq %%mm1, (%0,%2) \n\t"
- "movq %%mm2, (%1) \n\t"
- :: "r"(pix-2*stride), "r"(pix), "r"((long)stride),
- "m"(alpha1), "m"(beta1), "m"(mm_bone)
- );
-}
-
-static void h264_v_loop_filter_chroma_intra_mmx2(uint8_t *pix, int stride, int alpha, int beta)
-{
- h264_loop_filter_chroma_intra_mmx2(pix, stride, alpha-1, beta-1);
-}
-
-static void h264_h_loop_filter_chroma_intra_mmx2(uint8_t *pix, int stride, int alpha, int beta)
-{
- //FIXME: could cut some load/stores by merging transpose with filter
- DECLARE_ALIGNED_8(uint8_t, trans[8*4]);
- transpose4x4(trans, pix-2, 8, stride);
- transpose4x4(trans+4, pix-2+4*stride, 8, stride);
- h264_loop_filter_chroma_intra_mmx2(trans+2*8, 8, alpha-1, beta-1);
- transpose4x4(pix-2, trans, stride, 8);
- transpose4x4(pix-2+4*stride, trans+4, stride, 8);
-}
-
-static void h264_loop_filter_strength_mmx2( int16_t bS[2][4][4], uint8_t nnz[40], int8_t ref[2][40], int16_t mv[2][40][2],
- int bidir, int edges, int step, int mask_mv0, int mask_mv1 ) {
- int dir;
- asm volatile(
- "pxor %%mm7, %%mm7 \n\t"
- "movq %0, %%mm6 \n\t"
- "movq %1, %%mm5 \n\t"
- "movq %2, %%mm4 \n\t"
- ::"m"(ff_pb_1), "m"(ff_pb_3), "m"(ff_pb_7)
- );
- // could do a special case for dir==0 && edges==1, but it only reduces the
- // average filter time by 1.2%
- for( dir=1; dir>=0; dir-- ) {
- const int d_idx = dir ? -8 : -1;
- const int mask_mv = dir ? mask_mv1 : mask_mv0;
- DECLARE_ALIGNED_8(const uint64_t, mask_dir) = dir ? 0 : 0xffffffffffffffffULL;
- int b_idx, edge, l;
- for( b_idx=12, edge=0; edge<edges; edge+=step, b_idx+=8*step ) {
- asm volatile(
- "pand %0, %%mm0 \n\t"
- ::"m"(mask_dir)
- );
- if(!(mask_mv & edge)) {
- asm volatile("pxor %%mm0, %%mm0 \n\t":);
- for( l = bidir; l >= 0; l-- ) {
- asm volatile(
- "movd %0, %%mm1 \n\t"
- "punpckldq %1, %%mm1 \n\t"
- "movq %%mm1, %%mm2 \n\t"
- "psrlw $7, %%mm2 \n\t"
- "pand %%mm6, %%mm2 \n\t"
- "por %%mm2, %%mm1 \n\t" // ref_cache with -2 mapped to -1
- "punpckldq %%mm1, %%mm2 \n\t"
- "pcmpeqb %%mm2, %%mm1 \n\t"
- "paddb %%mm6, %%mm1 \n\t"
- "punpckhbw %%mm7, %%mm1 \n\t" // ref[b] != ref[bn]
- "por %%mm1, %%mm0 \n\t"
-
- "movq %2, %%mm1 \n\t"
- "movq %3, %%mm2 \n\t"
- "psubw %4, %%mm1 \n\t"
- "psubw %5, %%mm2 \n\t"
- "packsswb %%mm2, %%mm1 \n\t"
- "paddb %%mm5, %%mm1 \n\t"
- "pminub %%mm4, %%mm1 \n\t"
- "pcmpeqb %%mm4, %%mm1 \n\t" // abs(mv[b] - mv[bn]) >= limit
- "por %%mm1, %%mm0 \n\t"
- ::"m"(ref[l][b_idx]),
- "m"(ref[l][b_idx+d_idx]),
- "m"(mv[l][b_idx][0]),
- "m"(mv[l][b_idx+2][0]),
- "m"(mv[l][b_idx+d_idx][0]),
- "m"(mv[l][b_idx+d_idx+2][0])
- );
- }
- }
- asm volatile(
- "movd %0, %%mm1 \n\t"
- "por %1, %%mm1 \n\t"
- "punpcklbw %%mm7, %%mm1 \n\t"
- "pcmpgtw %%mm7, %%mm1 \n\t" // nnz[b] || nnz[bn]
- ::"m"(nnz[b_idx]),
- "m"(nnz[b_idx+d_idx])
- );
- asm volatile(
- "pcmpeqw %%mm7, %%mm0 \n\t"
- "pcmpeqw %%mm7, %%mm0 \n\t"
- "psrlw $15, %%mm0 \n\t" // nonzero -> 1
- "psrlw $14, %%mm1 \n\t"
- "movq %%mm0, %%mm2 \n\t"
- "por %%mm1, %%mm2 \n\t"
- "psrlw $1, %%mm1 \n\t"
- "pandn %%mm2, %%mm1 \n\t"
- "movq %%mm1, %0 \n\t"
- :"=m"(*bS[dir][edge])
- ::"memory"
- );
- }
- edges = 4;
- step = 1;
- }
- asm volatile(
- "movq (%0), %%mm0 \n\t"
- "movq 8(%0), %%mm1 \n\t"
- "movq 16(%0), %%mm2 \n\t"
- "movq 24(%0), %%mm3 \n\t"
- TRANSPOSE4(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4)
- "movq %%mm0, (%0) \n\t"
- "movq %%mm3, 8(%0) \n\t"
- "movq %%mm4, 16(%0) \n\t"
- "movq %%mm2, 24(%0) \n\t"
- ::"r"(bS[0])
- :"memory"
- );
-}
-
-/***********************************/
-/* motion compensation */
-
-#define QPEL_H264V(A,B,C,D,E,F,OP)\
- "movd (%0), "#F" \n\t"\
- "movq "#C", %%mm6 \n\t"\
- "paddw "#D", %%mm6 \n\t"\
- "psllw $2, %%mm6 \n\t"\
- "psubw "#B", %%mm6 \n\t"\
- "psubw "#E", %%mm6 \n\t"\
- "pmullw %4, %%mm6 \n\t"\
- "add %2, %0 \n\t"\
- "punpcklbw %%mm7, "#F" \n\t"\
- "paddw %5, "#A" \n\t"\
- "paddw "#F", "#A" \n\t"\
- "paddw "#A", %%mm6 \n\t"\
- "psraw $5, %%mm6 \n\t"\
- "packuswb %%mm6, %%mm6 \n\t"\
- OP(%%mm6, (%1), A, d)\
- "add %3, %1 \n\t"
-
-#define QPEL_H264HV(A,B,C,D,E,F,OF)\
- "movd (%0), "#F" \n\t"\
- "movq "#C", %%mm6 \n\t"\
- "paddw "#D", %%mm6 \n\t"\
- "psllw $2, %%mm6 \n\t"\
- "psubw "#B", %%mm6 \n\t"\
- "psubw "#E", %%mm6 \n\t"\
- "pmullw %3, %%mm6 \n\t"\
- "add %2, %0 \n\t"\
- "punpcklbw %%mm7, "#F" \n\t"\
- "paddw "#F", "#A" \n\t"\
- "paddw "#A", %%mm6 \n\t"\
- "movq %%mm6, "#OF"(%1) \n\t"
-
-#define QPEL_H264(OPNAME, OP, MMX)\
-static void OPNAME ## h264_qpel4_h_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
- int h=4;\
-\
- asm volatile(\
- "pxor %%mm7, %%mm7 \n\t"\
- "movq %5, %%mm4 \n\t"\
- "movq %6, %%mm5 \n\t"\
- "1: \n\t"\
- "movd -1(%0), %%mm1 \n\t"\
- "movd (%0), %%mm2 \n\t"\
- "movd 1(%0), %%mm3 \n\t"\
- "movd 2(%0), %%mm0 \n\t"\
- "punpcklbw %%mm7, %%mm1 \n\t"\
- "punpcklbw %%mm7, %%mm2 \n\t"\
- "punpcklbw %%mm7, %%mm3 \n\t"\
- "punpcklbw %%mm7, %%mm0 \n\t"\
- "paddw %%mm0, %%mm1 \n\t"\
- "paddw %%mm3, %%mm2 \n\t"\
- "movd -2(%0), %%mm0 \n\t"\
- "movd 3(%0), %%mm3 \n\t"\
- "punpcklbw %%mm7, %%mm0 \n\t"\
- "punpcklbw %%mm7, %%mm3 \n\t"\
- "paddw %%mm3, %%mm0 \n\t"\
- "psllw $2, %%mm2 \n\t"\
- "psubw %%mm1, %%mm2 \n\t"\
- "pmullw %%mm4, %%mm2 \n\t"\
- "paddw %%mm5, %%mm0 \n\t"\
- "paddw %%mm2, %%mm0 \n\t"\
- "psraw $5, %%mm0 \n\t"\
- "packuswb %%mm0, %%mm0 \n\t"\
- OP(%%mm0, (%1),%%mm6, d)\
- "add %3, %0 \n\t"\
- "add %4, %1 \n\t"\
- "decl %2 \n\t"\
- " jnz 1b \n\t"\
- : "+a"(src), "+c"(dst), "+m"(h)\
- : "d"((long)srcStride), "S"((long)dstStride), "m"(ff_pw_5), "m"(ff_pw_16)\
- : "memory"\
- );\
-}\
-static void OPNAME ## h264_qpel4_h_lowpass_l2_ ## MMX(uint8_t *dst, uint8_t *src, uint8_t *src2, int dstStride, int src2Stride){\
- int h=4;\
- asm volatile(\
- "pxor %%mm7, %%mm7 \n\t"\
- "movq %0, %%mm4 \n\t"\
- "movq %1, %%mm5 \n\t"\
- :: "m"(ff_pw_5), "m"(ff_pw_16)\
- );\
- do{\
- asm volatile(\
- "movd -1(%0), %%mm1 \n\t"\
- "movd (%0), %%mm2 \n\t"\
- "movd 1(%0), %%mm3 \n\t"\
- "movd 2(%0), %%mm0 \n\t"\
- "punpcklbw %%mm7, %%mm1 \n\t"\
- "punpcklbw %%mm7, %%mm2 \n\t"\
- "punpcklbw %%mm7, %%mm3 \n\t"\
- "punpcklbw %%mm7, %%mm0 \n\t"\
- "paddw %%mm0, %%mm1 \n\t"\
- "paddw %%mm3, %%mm2 \n\t"\
- "movd -2(%0), %%mm0 \n\t"\
- "movd 3(%0), %%mm3 \n\t"\
- "punpcklbw %%mm7, %%mm0 \n\t"\
- "punpcklbw %%mm7, %%mm3 \n\t"\
- "paddw %%mm3, %%mm0 \n\t"\
- "psllw $2, %%mm2 \n\t"\
- "psubw %%mm1, %%mm2 \n\t"\
- "pmullw %%mm4, %%mm2 \n\t"\
- "paddw %%mm5, %%mm0 \n\t"\
- "paddw %%mm2, %%mm0 \n\t"\
- "movd (%2), %%mm3 \n\t"\
- "psraw $5, %%mm0 \n\t"\
- "packuswb %%mm0, %%mm0 \n\t"\
- PAVGB" %%mm3, %%mm0 \n\t"\
- OP(%%mm0, (%1),%%mm6, d)\
- "add %4, %0 \n\t"\
- "add %4, %1 \n\t"\
- "add %3, %2 \n\t"\
- : "+a"(src), "+c"(dst), "+d"(src2)\
- : "D"((long)src2Stride), "S"((long)dstStride)\
- : "memory"\
- );\
- }while(--h);\
-}\
-static void OPNAME ## h264_qpel4_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
- src -= 2*srcStride;\
- asm volatile(\
- "pxor %%mm7, %%mm7 \n\t"\
- "movd (%0), %%mm0 \n\t"\
- "add %2, %0 \n\t"\
- "movd (%0), %%mm1 \n\t"\
- "add %2, %0 \n\t"\
- "movd (%0), %%mm2 \n\t"\
- "add %2, %0 \n\t"\
- "movd (%0), %%mm3 \n\t"\
- "add %2, %0 \n\t"\
- "movd (%0), %%mm4 \n\t"\
- "add %2, %0 \n\t"\
- "punpcklbw %%mm7, %%mm0 \n\t"\
- "punpcklbw %%mm7, %%mm1 \n\t"\
- "punpcklbw %%mm7, %%mm2 \n\t"\
- "punpcklbw %%mm7, %%mm3 \n\t"\
- "punpcklbw %%mm7, %%mm4 \n\t"\
- QPEL_H264V(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, OP)\
- QPEL_H264V(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, OP)\
- QPEL_H264V(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, OP)\
- QPEL_H264V(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, OP)\
- \
- : "+a"(src), "+c"(dst)\
- : "S"((long)srcStride), "D"((long)dstStride), "m"(ff_pw_5), "m"(ff_pw_16)\
- : "memory"\
- );\
-}\
-static void OPNAME ## h264_qpel4_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\
- int h=4;\
- int w=3;\
- src -= 2*srcStride+2;\
- while(w--){\
- asm volatile(\
- "pxor %%mm7, %%mm7 \n\t"\
- "movd (%0), %%mm0 \n\t"\
- "add %2, %0 \n\t"\
- "movd (%0), %%mm1 \n\t"\
- "add %2, %0 \n\t"\
- "movd (%0), %%mm2 \n\t"\
- "add %2, %0 \n\t"\
- "movd (%0), %%mm3 \n\t"\
- "add %2, %0 \n\t"\
- "movd (%0), %%mm4 \n\t"\
- "add %2, %0 \n\t"\
- "punpcklbw %%mm7, %%mm0 \n\t"\
- "punpcklbw %%mm7, %%mm1 \n\t"\
- "punpcklbw %%mm7, %%mm2 \n\t"\
- "punpcklbw %%mm7, %%mm3 \n\t"\
- "punpcklbw %%mm7, %%mm4 \n\t"\
- QPEL_H264HV(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, 0*8*3)\
- QPEL_H264HV(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, 1*8*3)\
- QPEL_H264HV(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, 2*8*3)\
- QPEL_H264HV(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, 3*8*3)\
- \
- : "+a"(src)\
- : "c"(tmp), "S"((long)srcStride), "m"(ff_pw_5)\
- : "memory"\
- );\
- tmp += 4;\
- src += 4 - 9*srcStride;\
- }\
- tmp -= 3*4;\
- asm volatile(\
- "movq %4, %%mm6 \n\t"\
- "1: \n\t"\
- "movq (%0), %%mm0 \n\t"\
- "paddw 10(%0), %%mm0 \n\t"\
- "movq 2(%0), %%mm1 \n\t"\
- "paddw 8(%0), %%mm1 \n\t"\
- "movq 4(%0), %%mm2 \n\t"\
- "paddw 6(%0), %%mm2 \n\t"\
- "psubw %%mm1, %%mm0 \n\t"/*a-b (abccba)*/\
- "psraw $2, %%mm0 \n\t"/*(a-b)/4 */\
- "psubw %%mm1, %%mm0 \n\t"/*(a-b)/4-b */\
- "paddsw %%mm2, %%mm0 \n\t"\
- "psraw $2, %%mm0 \n\t"/*((a-b)/4-b+c)/4 */\
- "paddw %%mm6, %%mm2 \n\t"\
- "paddw %%mm2, %%mm0 \n\t"/*(a-5*b+20*c)/16 +32 */\
- "psraw $6, %%mm0 \n\t"\
- "packuswb %%mm0, %%mm0 \n\t"\
- OP(%%mm0, (%1),%%mm7, d)\
- "add $24, %0 \n\t"\
- "add %3, %1 \n\t"\
- "decl %2 \n\t"\
- " jnz 1b \n\t"\
- : "+a"(tmp), "+c"(dst), "+m"(h)\
- : "S"((long)dstStride), "m"(ff_pw_32)\
- : "memory"\
- );\
-}\
-\
-static void OPNAME ## h264_qpel8_h_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
- int h=8;\
- asm volatile(\
- "pxor %%mm7, %%mm7 \n\t"\
- "movq %5, %%mm6 \n\t"\
- "1: \n\t"\
- "movq (%0), %%mm0 \n\t"\
- "movq 1(%0), %%mm2 \n\t"\
- "movq %%mm0, %%mm1 \n\t"\
- "movq %%mm2, %%mm3 \n\t"\
- "punpcklbw %%mm7, %%mm0 \n\t"\
- "punpckhbw %%mm7, %%mm1 \n\t"\
- "punpcklbw %%mm7, %%mm2 \n\t"\
- "punpckhbw %%mm7, %%mm3 \n\t"\
- "paddw %%mm2, %%mm0 \n\t"\
- "paddw %%mm3, %%mm1 \n\t"\
- "psllw $2, %%mm0 \n\t"\
- "psllw $2, %%mm1 \n\t"\
- "movq -1(%0), %%mm2 \n\t"\
- "movq 2(%0), %%mm4 \n\t"\
- "movq %%mm2, %%mm3 \n\t"\
- "movq %%mm4, %%mm5 \n\t"\
- "punpcklbw %%mm7, %%mm2 \n\t"\
- "punpckhbw %%mm7, %%mm3 \n\t"\
- "punpcklbw %%mm7, %%mm4 \n\t"\
- "punpckhbw %%mm7, %%mm5 \n\t"\
- "paddw %%mm4, %%mm2 \n\t"\
- "paddw %%mm3, %%mm5 \n\t"\
- "psubw %%mm2, %%mm0 \n\t"\
- "psubw %%mm5, %%mm1 \n\t"\
- "pmullw %%mm6, %%mm0 \n\t"\
- "pmullw %%mm6, %%mm1 \n\t"\
- "movd -2(%0), %%mm2 \n\t"\
- "movd 7(%0), %%mm5 \n\t"\
- "punpcklbw %%mm7, %%mm2 \n\t"\
- "punpcklbw %%mm7, %%mm5 \n\t"\
- "paddw %%mm3, %%mm2 \n\t"\
- "paddw %%mm5, %%mm4 \n\t"\
- "movq %6, %%mm5 \n\t"\
- "paddw %%mm5, %%mm2 \n\t"\
- "paddw %%mm5, %%mm4 \n\t"\
- "paddw %%mm2, %%mm0 \n\t"\
- "paddw %%mm4, %%mm1 \n\t"\
- "psraw $5, %%mm0 \n\t"\
- "psraw $5, %%mm1 \n\t"\
- "packuswb %%mm1, %%mm0 \n\t"\
- OP(%%mm0, (%1),%%mm5, q)\
- "add %3, %0 \n\t"\
- "add %4, %1 \n\t"\
- "decl %2 \n\t"\
- " jnz 1b \n\t"\
- : "+a"(src), "+c"(dst), "+m"(h)\
- : "d"((long)srcStride), "S"((long)dstStride), "m"(ff_pw_5), "m"(ff_pw_16)\
- : "memory"\
- );\
-}\
-\
-static void OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(uint8_t *dst, uint8_t *src, uint8_t *src2, int dstStride, int src2Stride){\
- int h=8;\
- asm volatile(\
- "pxor %%mm7, %%mm7 \n\t"\
- "movq %0, %%mm6 \n\t"\
- :: "m"(ff_pw_5)\
- );\
- do{\
- asm volatile(\
- "movq (%0), %%mm0 \n\t"\
- "movq 1(%0), %%mm2 \n\t"\
- "movq %%mm0, %%mm1 \n\t"\
- "movq %%mm2, %%mm3 \n\t"\
- "punpcklbw %%mm7, %%mm0 \n\t"\
- "punpckhbw %%mm7, %%mm1 \n\t"\
- "punpcklbw %%mm7, %%mm2 \n\t"\
- "punpckhbw %%mm7, %%mm3 \n\t"\
- "paddw %%mm2, %%mm0 \n\t"\
- "paddw %%mm3, %%mm1 \n\t"\
- "psllw $2, %%mm0 \n\t"\
- "psllw $2, %%mm1 \n\t"\
- "movq -1(%0), %%mm2 \n\t"\
- "movq 2(%0), %%mm4 \n\t"\
- "movq %%mm2, %%mm3 \n\t"\
- "movq %%mm4, %%mm5 \n\t"\
- "punpcklbw %%mm7, %%mm2 \n\t"\
- "punpckhbw %%mm7, %%mm3 \n\t"\
- "punpcklbw %%mm7, %%mm4 \n\t"\
- "punpckhbw %%mm7, %%mm5 \n\t"\
- "paddw %%mm4, %%mm2 \n\t"\
- "paddw %%mm3, %%mm5 \n\t"\
- "psubw %%mm2, %%mm0 \n\t"\
- "psubw %%mm5, %%mm1 \n\t"\
- "pmullw %%mm6, %%mm0 \n\t"\
- "pmullw %%mm6, %%mm1 \n\t"\
- "movd -2(%0), %%mm2 \n\t"\
- "movd 7(%0), %%mm5 \n\t"\
- "punpcklbw %%mm7, %%mm2 \n\t"\
- "punpcklbw %%mm7, %%mm5 \n\t"\
- "paddw %%mm3, %%mm2 \n\t"\
- "paddw %%mm5, %%mm4 \n\t"\
- "movq %5, %%mm5 \n\t"\
- "paddw %%mm5, %%mm2 \n\t"\
- "paddw %%mm5, %%mm4 \n\t"\
- "paddw %%mm2, %%mm0 \n\t"\
- "paddw %%mm4, %%mm1 \n\t"\
- "psraw $5, %%mm0 \n\t"\
- "psraw $5, %%mm1 \n\t"\
- "movq (%2), %%mm4 \n\t"\
- "packuswb %%mm1, %%mm0 \n\t"\
- PAVGB" %%mm4, %%mm0 \n\t"\
- OP(%%mm0, (%1),%%mm5, q)\
- "add %4, %0 \n\t"\
- "add %4, %1 \n\t"\
- "add %3, %2 \n\t"\
- : "+a"(src), "+c"(dst), "+d"(src2)\
- : "D"((long)src2Stride), "S"((long)dstStride),\
- "m"(ff_pw_16)\
- : "memory"\
- );\
- }while(--h);\
-}\
-\
-static inline void OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\
- int w= 2;\
- src -= 2*srcStride;\
- \
- while(w--){\
- asm volatile(\
- "pxor %%mm7, %%mm7 \n\t"\
- "movd (%0), %%mm0 \n\t"\
- "add %2, %0 \n\t"\
- "movd (%0), %%mm1 \n\t"\
- "add %2, %0 \n\t"\
- "movd (%0), %%mm2 \n\t"\
- "add %2, %0 \n\t"\
- "movd (%0), %%mm3 \n\t"\
- "add %2, %0 \n\t"\
- "movd (%0), %%mm4 \n\t"\
- "add %2, %0 \n\t"\
- "punpcklbw %%mm7, %%mm0 \n\t"\
- "punpcklbw %%mm7, %%mm1 \n\t"\
- "punpcklbw %%mm7, %%mm2 \n\t"\
- "punpcklbw %%mm7, %%mm3 \n\t"\
- "punpcklbw %%mm7, %%mm4 \n\t"\
- QPEL_H264V(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, OP)\
- QPEL_H264V(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, OP)\
- QPEL_H264V(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, OP)\
- QPEL_H264V(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, OP)\
- QPEL_H264V(%%mm4, %%mm5, %%mm0, %%mm1, %%mm2, %%mm3, OP)\
- QPEL_H264V(%%mm5, %%mm0, %%mm1, %%mm2, %%mm3, %%mm4, OP)\
- QPEL_H264V(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, OP)\
- QPEL_H264V(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, OP)\
- \
- : "+a"(src), "+c"(dst)\
- : "S"((long)srcStride), "D"((long)dstStride), "m"(ff_pw_5), "m"(ff_pw_16)\
- : "memory"\
- );\
- if(h==16){\
- asm volatile(\
- QPEL_H264V(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, OP)\
- QPEL_H264V(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, OP)\
- QPEL_H264V(%%mm4, %%mm5, %%mm0, %%mm1, %%mm2, %%mm3, OP)\
- QPEL_H264V(%%mm5, %%mm0, %%mm1, %%mm2, %%mm3, %%mm4, OP)\
- QPEL_H264V(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, OP)\
- QPEL_H264V(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, OP)\
- QPEL_H264V(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, OP)\
- QPEL_H264V(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, OP)\
- \
- : "+a"(src), "+c"(dst)\
- : "S"((long)srcStride), "D"((long)dstStride), "m"(ff_pw_5), "m"(ff_pw_16)\
- : "memory"\
- );\
- }\
- src += 4-(h+5)*srcStride;\
- dst += 4-h*dstStride;\
- }\
-}\
-static inline void OPNAME ## h264_qpel8or16_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride, int size){\
- int h = size;\
- int w = (size+8)>>2;\
- src -= 2*srcStride+2;\
- while(w--){\
- asm volatile(\
- "pxor %%mm7, %%mm7 \n\t"\
- "movd (%0), %%mm0 \n\t"\
- "add %2, %0 \n\t"\
- "movd (%0), %%mm1 \n\t"\
- "add %2, %0 \n\t"\
- "movd (%0), %%mm2 \n\t"\
- "add %2, %0 \n\t"\
- "movd (%0), %%mm3 \n\t"\
- "add %2, %0 \n\t"\
- "movd (%0), %%mm4 \n\t"\
- "add %2, %0 \n\t"\
- "punpcklbw %%mm7, %%mm0 \n\t"\
- "punpcklbw %%mm7, %%mm1 \n\t"\
- "punpcklbw %%mm7, %%mm2 \n\t"\
- "punpcklbw %%mm7, %%mm3 \n\t"\
- "punpcklbw %%mm7, %%mm4 \n\t"\
- QPEL_H264HV(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, 0*48)\
- QPEL_H264HV(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, 1*48)\
- QPEL_H264HV(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, 2*48)\
- QPEL_H264HV(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, 3*48)\
- QPEL_H264HV(%%mm4, %%mm5, %%mm0, %%mm1, %%mm2, %%mm3, 4*48)\
- QPEL_H264HV(%%mm5, %%mm0, %%mm1, %%mm2, %%mm3, %%mm4, 5*48)\
- QPEL_H264HV(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, 6*48)\
- QPEL_H264HV(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, 7*48)\
- : "+a"(src)\
- : "c"(tmp), "S"((long)srcStride), "m"(ff_pw_5)\
- : "memory"\
- );\
- if(size==16){\
- asm volatile(\
- QPEL_H264HV(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, 8*48)\
- QPEL_H264HV(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, 9*48)\
- QPEL_H264HV(%%mm4, %%mm5, %%mm0, %%mm1, %%mm2, %%mm3, 10*48)\
- QPEL_H264HV(%%mm5, %%mm0, %%mm1, %%mm2, %%mm3, %%mm4, 11*48)\
- QPEL_H264HV(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, 12*48)\
- QPEL_H264HV(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, 13*48)\
- QPEL_H264HV(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, 14*48)\
- QPEL_H264HV(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, 15*48)\
- : "+a"(src)\
- : "c"(tmp), "S"((long)srcStride), "m"(ff_pw_5)\
- : "memory"\
- );\
- }\
- tmp += 4;\
- src += 4 - (size+5)*srcStride;\
- }\
- tmp -= size+8;\
- w = size>>4;\
- do{\
- h = size;\
- asm volatile(\
- "movq %4, %%mm6 \n\t"\
- "1: \n\t"\
- "movq (%0), %%mm0 \n\t"\
- "movq 8(%0), %%mm3 \n\t"\
- "movq 2(%0), %%mm1 \n\t"\
- "movq 10(%0), %%mm4 \n\t"\
- "paddw %%mm4, %%mm0 \n\t"\
- "paddw %%mm3, %%mm1 \n\t"\
- "paddw 18(%0), %%mm3 \n\t"\
- "paddw 16(%0), %%mm4 \n\t"\
- "movq 4(%0), %%mm2 \n\t"\
- "movq 12(%0), %%mm5 \n\t"\
- "paddw 6(%0), %%mm2 \n\t"\
- "paddw 14(%0), %%mm5 \n\t"\
- "psubw %%mm1, %%mm0 \n\t"\
- "psubw %%mm4, %%mm3 \n\t"\
- "psraw $2, %%mm0 \n\t"\
- "psraw $2, %%mm3 \n\t"\
- "psubw %%mm1, %%mm0 \n\t"\
- "psubw %%mm4, %%mm3 \n\t"\
- "paddsw %%mm2, %%mm0 \n\t"\
- "paddsw %%mm5, %%mm3 \n\t"\
- "psraw $2, %%mm0 \n\t"\
- "psraw $2, %%mm3 \n\t"\
- "paddw %%mm6, %%mm2 \n\t"\
- "paddw %%mm6, %%mm5 \n\t"\
- "paddw %%mm2, %%mm0 \n\t"\
- "paddw %%mm5, %%mm3 \n\t"\
- "psraw $6, %%mm0 \n\t"\
- "psraw $6, %%mm3 \n\t"\
- "packuswb %%mm3, %%mm0 \n\t"\
- OP(%%mm0, (%1),%%mm7, q)\
- "add $48, %0 \n\t"\
- "add %3, %1 \n\t"\
- "decl %2 \n\t"\
- " jnz 1b \n\t"\
- : "+a"(tmp), "+c"(dst), "+m"(h)\
- : "S"((long)dstStride), "m"(ff_pw_32)\
- : "memory"\
- );\
- tmp += 8 - size*24;\
- dst += 8 - size*dstStride;\
- }while(w--);\
-}\
-\
-static void OPNAME ## h264_qpel8_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
- OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(dst , src , dstStride, srcStride, 8);\
-}\
-static void OPNAME ## h264_qpel16_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
- OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(dst , src , dstStride, srcStride, 16);\
- OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride, 16);\
-}\
-\
-static void OPNAME ## h264_qpel16_h_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
- OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst , src , dstStride, srcStride);\
- OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride);\
- src += 8*srcStride;\
- dst += 8*dstStride;\
- OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst , src , dstStride, srcStride);\
- OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride);\
-}\
-\
-static void OPNAME ## h264_qpel16_h_lowpass_l2_ ## MMX(uint8_t *dst, uint8_t *src, uint8_t *src2, int dstStride, int src2Stride){\
- OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst , src , src2 , dstStride, src2Stride);\
- OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst+8, src+8, src2+8, dstStride, src2Stride);\
- src += 8*dstStride;\
- dst += 8*dstStride;\
- src2 += 8*src2Stride;\
- OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst , src , src2 , dstStride, src2Stride);\
- OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst+8, src+8, src2+8, dstStride, src2Stride);\
-}\
-\
-static void OPNAME ## h264_qpel8_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\
- OPNAME ## h264_qpel8or16_hv_lowpass_ ## MMX(dst , tmp , src , dstStride, tmpStride, srcStride, 8);\
-}\
-\
-static void OPNAME ## h264_qpel16_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\
- OPNAME ## h264_qpel8or16_hv_lowpass_ ## MMX(dst , tmp , src , dstStride, tmpStride, srcStride, 16);\
-}\
-\
-static void OPNAME ## pixels4_l2_shift5_ ## MMX(uint8_t *dst, int16_t *src16, uint8_t *src8, int dstStride, int src8Stride, int h)\
-{\
- asm volatile(\
- "movq %5, %%mm6 \n\t"\
- "movq (%1), %%mm0 \n\t"\
- "movq 24(%1), %%mm1 \n\t"\
- "paddw %%mm6, %%mm0 \n\t"\
- "paddw %%mm6, %%mm1 \n\t"\
- "psraw $5, %%mm0 \n\t"\
- "psraw $5, %%mm1 \n\t"\
- "packuswb %%mm0, %%mm0 \n\t"\
- "packuswb %%mm1, %%mm1 \n\t"\
- PAVGB" (%0), %%mm0 \n\t"\
- PAVGB" (%0,%3), %%mm1 \n\t"\
- OP(%%mm0, (%2), %%mm4, d)\
- OP(%%mm1, (%2,%4), %%mm5, d)\
- "lea (%0,%3,2), %0 \n\t"\
- "lea (%2,%4,2), %2 \n\t"\
- "movq 48(%1), %%mm0 \n\t"\
- "movq 72(%1), %%mm1 \n\t"\
- "paddw %%mm6, %%mm0 \n\t"\
- "paddw %%mm6, %%mm1 \n\t"\
- "psraw $5, %%mm0 \n\t"\
- "psraw $5, %%mm1 \n\t"\
- "packuswb %%mm0, %%mm0 \n\t"\
- "packuswb %%mm1, %%mm1 \n\t"\
- PAVGB" (%0), %%mm0 \n\t"\
- PAVGB" (%0,%3), %%mm1 \n\t"\
- OP(%%mm0, (%2), %%mm4, d)\
- OP(%%mm1, (%2,%4), %%mm5, d)\
- :"+a"(src8), "+c"(src16), "+d"(dst)\
- :"S"((long)src8Stride), "D"((long)dstStride), "m"(ff_pw_16)\
- :"memory");\
-}\
-static void OPNAME ## pixels8_l2_shift5_ ## MMX(uint8_t *dst, int16_t *src16, uint8_t *src8, int dstStride, int src8Stride, int h)\
-{\
- asm volatile(\
- "movq %0, %%mm6 \n\t"\
- ::"m"(ff_pw_16)\
- );\
- while(h--){\
- asm volatile(\
- "movq (%1), %%mm0 \n\t"\
- "movq 8(%1), %%mm1 \n\t"\
- "paddw %%mm6, %%mm0 \n\t"\
- "paddw %%mm6, %%mm1 \n\t"\
- "psraw $5, %%mm0 \n\t"\
- "psraw $5, %%mm1 \n\t"\
- "packuswb %%mm1, %%mm0 \n\t"\
- PAVGB" (%0), %%mm0 \n\t"\
- OP(%%mm0, (%2), %%mm5, q)\
- ::"a"(src8), "c"(src16), "d"(dst)\
- :"memory");\
- src8 += src8Stride;\
- src16 += 24;\
- dst += dstStride;\
- }\
-}\
-static void OPNAME ## pixels16_l2_shift5_ ## MMX(uint8_t *dst, int16_t *src16, uint8_t *src8, int dstStride, int src8Stride, int h)\
-{\
- OPNAME ## pixels8_l2_shift5_ ## MMX(dst , src16 , src8 , dstStride, src8Stride, h);\
- OPNAME ## pixels8_l2_shift5_ ## MMX(dst+8, src16+8, src8+8, dstStride, src8Stride, h);\
-}\
-
-
-#define H264_MC(OPNAME, SIZE, MMX) \
-static void OPNAME ## h264_qpel ## SIZE ## _mc00_ ## MMX (uint8_t *dst, uint8_t *src, int stride){\
- OPNAME ## pixels ## SIZE ## _mmx(dst, src, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc10_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, src, stride, stride);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc20_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- OPNAME ## h264_qpel ## SIZE ## _h_lowpass_ ## MMX(dst, src, stride, stride);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc30_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, src+1, stride, stride);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc01_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*SIZE/8];\
- uint8_t * const half= (uint8_t*)temp;\
- put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(half, src, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src, half, stride, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc02_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- OPNAME ## h264_qpel ## SIZE ## _v_lowpass_ ## MMX(dst, src, stride, stride);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc03_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*SIZE/8];\
- uint8_t * const half= (uint8_t*)temp;\
- put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(half, src, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src+stride, half, stride, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc11_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*SIZE/8];\
- uint8_t * const halfV= (uint8_t*)temp;\
- put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(halfV, src, SIZE, stride);\
- OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, halfV, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc31_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*SIZE/8];\
- uint8_t * const halfV= (uint8_t*)temp;\
- put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(halfV, src+1, SIZE, stride);\
- OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, halfV, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc13_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*SIZE/8];\
- uint8_t * const halfV= (uint8_t*)temp;\
- put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(halfV, src, SIZE, stride);\
- OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src+stride, halfV, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc33_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*SIZE/8];\
- uint8_t * const halfV= (uint8_t*)temp;\
- put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(halfV, src+1, SIZE, stride);\
- OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src+stride, halfV, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc22_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*(SIZE<8?12:24)/4];\
- int16_t * const tmp= (int16_t*)temp;\
- OPNAME ## h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(dst, tmp, src, stride, SIZE, stride);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc21_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*(SIZE<8?12:24)/4 + SIZE*SIZE/8];\
- uint8_t * const halfHV= (uint8_t*)temp;\
- int16_t * const tmp= ((int16_t*)temp) + SIZE*SIZE/2;\
- put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, tmp, src, SIZE, SIZE, stride);\
- OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, halfHV, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc23_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*(SIZE<8?12:24)/4 + SIZE*SIZE/8];\
- uint8_t * const halfHV= (uint8_t*)temp;\
- int16_t * const tmp= ((int16_t*)temp) + SIZE*SIZE/2;\
- put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, tmp, src, SIZE, SIZE, stride);\
- OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src+stride, halfHV, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc12_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*(SIZE<8?12:24)/4 + SIZE*SIZE/8];\
- int16_t * const halfV= ((int16_t*)temp) + SIZE*SIZE/2;\
- uint8_t * const halfHV= ((uint8_t*)temp);\
- put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, halfV, src, SIZE, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_shift5_ ## MMX(dst, halfV+2, halfHV, stride, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc32_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*(SIZE<8?12:24)/4 + SIZE*SIZE/8];\
- int16_t * const halfV= ((int16_t*)temp) + SIZE*SIZE/2;\
- uint8_t * const halfHV= ((uint8_t*)temp);\
- put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, halfV, src, SIZE, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_shift5_ ## MMX(dst, halfV+3, halfHV, stride, SIZE, SIZE);\
-}\
-
-
-#define AVG_3DNOW_OP(a,b,temp, size) \
-"mov" #size " " #b ", " #temp " \n\t"\
-"pavgusb " #temp ", " #a " \n\t"\
-"mov" #size " " #a ", " #b " \n\t"
-#define AVG_MMX2_OP(a,b,temp, size) \
-"mov" #size " " #b ", " #temp " \n\t"\
-"pavgb " #temp ", " #a " \n\t"\
-"mov" #size " " #a ", " #b " \n\t"
-
-#define PAVGB "pavgusb"
-QPEL_H264(put_, PUT_OP, 3dnow)
-QPEL_H264(avg_, AVG_3DNOW_OP, 3dnow)
-#undef PAVGB
-#define PAVGB "pavgb"
-QPEL_H264(put_, PUT_OP, mmx2)
-QPEL_H264(avg_, AVG_MMX2_OP, mmx2)
-#undef PAVGB
-
-H264_MC(put_, 4, 3dnow)
-H264_MC(put_, 8, 3dnow)
-H264_MC(put_, 16,3dnow)
-H264_MC(avg_, 4, 3dnow)
-H264_MC(avg_, 8, 3dnow)
-H264_MC(avg_, 16,3dnow)
-H264_MC(put_, 4, mmx2)
-H264_MC(put_, 8, mmx2)
-H264_MC(put_, 16,mmx2)
-H264_MC(avg_, 4, mmx2)
-H264_MC(avg_, 8, mmx2)
-H264_MC(avg_, 16,mmx2)
-
-
-#define H264_CHROMA_OP(S,D)
-#define H264_CHROMA_OP4(S,D,T)
-#define H264_CHROMA_MC8_TMPL put_h264_chroma_mc8_mmx
-#define H264_CHROMA_MC4_TMPL put_h264_chroma_mc4_mmx
-#define H264_CHROMA_MC2_TMPL put_h264_chroma_mc2_mmx2
-#define H264_CHROMA_MC8_MV0 put_pixels8_mmx
-#include "dsputil_h264_template_mmx.c"
-#undef H264_CHROMA_OP
-#undef H264_CHROMA_OP4
-#undef H264_CHROMA_MC8_TMPL
-#undef H264_CHROMA_MC4_TMPL
-#undef H264_CHROMA_MC2_TMPL
-#undef H264_CHROMA_MC8_MV0
-
-#define H264_CHROMA_OP(S,D) "pavgb " #S ", " #D " \n\t"
-#define H264_CHROMA_OP4(S,D,T) "movd " #S ", " #T " \n\t"\
- "pavgb " #T ", " #D " \n\t"
-#define H264_CHROMA_MC8_TMPL avg_h264_chroma_mc8_mmx2
-#define H264_CHROMA_MC4_TMPL avg_h264_chroma_mc4_mmx2
-#define H264_CHROMA_MC2_TMPL avg_h264_chroma_mc2_mmx2
-#define H264_CHROMA_MC8_MV0 avg_pixels8_mmx2
-#include "dsputil_h264_template_mmx.c"
-#undef H264_CHROMA_OP
-#undef H264_CHROMA_OP4
-#undef H264_CHROMA_MC8_TMPL
-#undef H264_CHROMA_MC4_TMPL
-#undef H264_CHROMA_MC2_TMPL
-#undef H264_CHROMA_MC8_MV0
-
-#define H264_CHROMA_OP(S,D) "pavgusb " #S ", " #D " \n\t"
-#define H264_CHROMA_OP4(S,D,T) "movd " #S ", " #T " \n\t"\
- "pavgusb " #T ", " #D " \n\t"
-#define H264_CHROMA_MC8_TMPL avg_h264_chroma_mc8_3dnow
-#define H264_CHROMA_MC4_TMPL avg_h264_chroma_mc4_3dnow
-#define H264_CHROMA_MC8_MV0 avg_pixels8_3dnow
-#include "dsputil_h264_template_mmx.c"
-#undef H264_CHROMA_OP
-#undef H264_CHROMA_OP4
-#undef H264_CHROMA_MC8_TMPL
-#undef H264_CHROMA_MC4_TMPL
-#undef H264_CHROMA_MC8_MV0
-
-/***********************************/
-/* weighted prediction */
-
-static inline void ff_h264_weight_WxH_mmx2(uint8_t *dst, int stride, int log2_denom, int weight, int offset, int w, int h)
-{
- int x, y;
- offset <<= log2_denom;
- offset += (1 << log2_denom) >> 1;
- asm volatile(
- "movd %0, %%mm4 \n\t"
- "movd %1, %%mm5 \n\t"
- "movd %2, %%mm6 \n\t"
- "pshufw $0, %%mm4, %%mm4 \n\t"
- "pshufw $0, %%mm5, %%mm5 \n\t"
- "pxor %%mm7, %%mm7 \n\t"
- :: "g"(weight), "g"(offset), "g"(log2_denom)
- );
- for(y=0; y<h; y+=2){
- for(x=0; x<w; x+=4){
- asm volatile(
- "movd %0, %%mm0 \n\t"
- "movd %1, %%mm1 \n\t"
- "punpcklbw %%mm7, %%mm0 \n\t"
- "punpcklbw %%mm7, %%mm1 \n\t"
- "pmullw %%mm4, %%mm0 \n\t"
- "pmullw %%mm4, %%mm1 \n\t"
- "paddsw %%mm5, %%mm0 \n\t"
- "paddsw %%mm5, %%mm1 \n\t"
- "psraw %%mm6, %%mm0 \n\t"
- "psraw %%mm6, %%mm1 \n\t"
- "packuswb %%mm7, %%mm0 \n\t"
- "packuswb %%mm7, %%mm1 \n\t"
- "movd %%mm0, %0 \n\t"
- "movd %%mm1, %1 \n\t"
- : "+m"(*(uint32_t*)(dst+x)),
- "+m"(*(uint32_t*)(dst+x+stride))
- );
- }
- dst += 2*stride;
- }
-}
-
-static inline void ff_h264_biweight_WxH_mmx2(uint8_t *dst, uint8_t *src, int stride, int log2_denom, int weightd, int weights, int offset, int w, int h)
-{
- int x, y;
- offset = ((offset + 1) | 1) << log2_denom;
- asm volatile(
- "movd %0, %%mm3 \n\t"
- "movd %1, %%mm4 \n\t"
- "movd %2, %%mm5 \n\t"
- "movd %3, %%mm6 \n\t"
- "pshufw $0, %%mm3, %%mm3 \n\t"
- "pshufw $0, %%mm4, %%mm4 \n\t"
- "pshufw $0, %%mm5, %%mm5 \n\t"
- "pxor %%mm7, %%mm7 \n\t"
- :: "g"(weightd), "g"(weights), "g"(offset), "g"(log2_denom+1)
- );
- for(y=0; y<h; y++){
- for(x=0; x<w; x+=4){
- asm volatile(
- "movd %0, %%mm0 \n\t"
- "movd %1, %%mm1 \n\t"
- "punpcklbw %%mm7, %%mm0 \n\t"
- "punpcklbw %%mm7, %%mm1 \n\t"
- "pmullw %%mm3, %%mm0 \n\t"
- "pmullw %%mm4, %%mm1 \n\t"
- "paddsw %%mm1, %%mm0 \n\t"
- "paddsw %%mm5, %%mm0 \n\t"
- "psraw %%mm6, %%mm0 \n\t"
- "packuswb %%mm0, %%mm0 \n\t"
- "movd %%mm0, %0 \n\t"
- : "+m"(*(uint32_t*)(dst+x))
- : "m"(*(uint32_t*)(src+x))
- );
- }
- src += stride;
- dst += stride;
- }
-}
-
-#define H264_WEIGHT(W,H) \
-static void ff_h264_biweight_ ## W ## x ## H ## _mmx2(uint8_t *dst, uint8_t *src, int stride, int log2_denom, int weightd, int weights, int offset){ \
- ff_h264_biweight_WxH_mmx2(dst, src, stride, log2_denom, weightd, weights, offset, W, H); \
-} \
-static void ff_h264_weight_ ## W ## x ## H ## _mmx2(uint8_t *dst, int stride, int log2_denom, int weight, int offset){ \
- ff_h264_weight_WxH_mmx2(dst, stride, log2_denom, weight, offset, W, H); \
-}
-
-H264_WEIGHT(16,16)
-H264_WEIGHT(16, 8)
-H264_WEIGHT( 8,16)
-H264_WEIGHT( 8, 8)
-H264_WEIGHT( 8, 4)
-H264_WEIGHT( 4, 8)
-H264_WEIGHT( 4, 4)
-H264_WEIGHT( 4, 2)
-
diff --git a/src/libffmpeg/libavcodec/i386/idct_mmx.c b/src/libffmpeg/libavcodec/i386/idct_mmx.c
deleted file mode 100644
index 4c548fdce..000000000
--- a/src/libffmpeg/libavcodec/i386/idct_mmx.c
+++ /dev/null
@@ -1,597 +0,0 @@
-/*
- * idct_mmx.c
- * Copyright (C) 1999-2001 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
- *
- * This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
- *
- * mpeg2dec is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * mpeg2dec is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with mpeg2dec; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "common.h"
-#include "../dsputil.h"
-
-#include "mmx.h"
-
-#define ATTR_ALIGN(align) __attribute__ ((__aligned__ (align)))
-
-#define ROW_SHIFT 11
-#define COL_SHIFT 6
-
-#define round(bias) ((int)(((bias)+0.5) * (1<<ROW_SHIFT)))
-#define rounder(bias) {round (bias), round (bias)}
-
-#if 0
-/* C row IDCT - its just here to document the MMXEXT and MMX versions */
-static inline void idct_row (int16_t * row, int offset,
- int16_t * table, int32_t * rounder)
-{
- int C1, C2, C3, C4, C5, C6, C7;
- int a0, a1, a2, a3, b0, b1, b2, b3;
-
- row += offset;
-
- C1 = table[1];
- C2 = table[2];
- C3 = table[3];
- C4 = table[4];
- C5 = table[5];
- C6 = table[6];
- C7 = table[7];
-
- a0 = C4*row[0] + C2*row[2] + C4*row[4] + C6*row[6] + *rounder;
- a1 = C4*row[0] + C6*row[2] - C4*row[4] - C2*row[6] + *rounder;
- a2 = C4*row[0] - C6*row[2] - C4*row[4] + C2*row[6] + *rounder;
- a3 = C4*row[0] - C2*row[2] + C4*row[4] - C6*row[6] + *rounder;
-
- b0 = C1*row[1] + C3*row[3] + C5*row[5] + C7*row[7];
- b1 = C3*row[1] - C7*row[3] - C1*row[5] - C5*row[7];
- b2 = C5*row[1] - C1*row[3] + C7*row[5] + C3*row[7];
- b3 = C7*row[1] - C5*row[3] + C3*row[5] - C1*row[7];
-
- row[0] = (a0 + b0) >> ROW_SHIFT;
- row[1] = (a1 + b1) >> ROW_SHIFT;
- row[2] = (a2 + b2) >> ROW_SHIFT;
- row[3] = (a3 + b3) >> ROW_SHIFT;
- row[4] = (a3 - b3) >> ROW_SHIFT;
- row[5] = (a2 - b2) >> ROW_SHIFT;
- row[6] = (a1 - b1) >> ROW_SHIFT;
- row[7] = (a0 - b0) >> ROW_SHIFT;
-}
-#endif
-
-
-/* MMXEXT row IDCT */
-
-#define mmxext_table(c1,c2,c3,c4,c5,c6,c7) { c4, c2, -c4, -c2, \
- c4, c6, c4, c6, \
- c1, c3, -c1, -c5, \
- c5, c7, c3, -c7, \
- c4, -c6, c4, -c6, \
- -c4, c2, c4, -c2, \
- c5, -c1, c3, -c1, \
- c7, c3, c7, -c5 }
-
-static inline void mmxext_row_head (int16_t * row, int offset, const int16_t * table)
-{
- movq_m2r (*(row+offset), mm2); // mm2 = x6 x4 x2 x0
-
- movq_m2r (*(row+offset+4), mm5); // mm5 = x7 x5 x3 x1
- movq_r2r (mm2, mm0); // mm0 = x6 x4 x2 x0
-
- movq_m2r (*table, mm3); // mm3 = -C2 -C4 C2 C4
- movq_r2r (mm5, mm6); // mm6 = x7 x5 x3 x1
-
- movq_m2r (*(table+4), mm4); // mm4 = C6 C4 C6 C4
- pmaddwd_r2r (mm0, mm3); // mm3 = -C4*x4-C2*x6 C4*x0+C2*x2
-
- pshufw_r2r (mm2, mm2, 0x4e); // mm2 = x2 x0 x6 x4
-}
-
-static inline void mmxext_row (const int16_t * table, const int32_t * rounder)
-{
- movq_m2r (*(table+8), mm1); // mm1 = -C5 -C1 C3 C1
- pmaddwd_r2r (mm2, mm4); // mm4 = C4*x0+C6*x2 C4*x4+C6*x6
-
- pmaddwd_m2r (*(table+16), mm0); // mm0 = C4*x4-C6*x6 C4*x0-C6*x2
- pshufw_r2r (mm6, mm6, 0x4e); // mm6 = x3 x1 x7 x5
-
- movq_m2r (*(table+12), mm7); // mm7 = -C7 C3 C7 C5
- pmaddwd_r2r (mm5, mm1); // mm1 = -C1*x5-C5*x7 C1*x1+C3*x3
-
- paddd_m2r (*rounder, mm3); // mm3 += rounder
- pmaddwd_r2r (mm6, mm7); // mm7 = C3*x1-C7*x3 C5*x5+C7*x7
-
- pmaddwd_m2r (*(table+20), mm2); // mm2 = C4*x0-C2*x2 -C4*x4+C2*x6
- paddd_r2r (mm4, mm3); // mm3 = a1 a0 + rounder
-
- pmaddwd_m2r (*(table+24), mm5); // mm5 = C3*x5-C1*x7 C5*x1-C1*x3
- movq_r2r (mm3, mm4); // mm4 = a1 a0 + rounder
-
- pmaddwd_m2r (*(table+28), mm6); // mm6 = C7*x1-C5*x3 C7*x5+C3*x7
- paddd_r2r (mm7, mm1); // mm1 = b1 b0
-
- paddd_m2r (*rounder, mm0); // mm0 += rounder
- psubd_r2r (mm1, mm3); // mm3 = a1-b1 a0-b0 + rounder
-
- psrad_i2r (ROW_SHIFT, mm3); // mm3 = y6 y7
- paddd_r2r (mm4, mm1); // mm1 = a1+b1 a0+b0 + rounder
-
- paddd_r2r (mm2, mm0); // mm0 = a3 a2 + rounder
- psrad_i2r (ROW_SHIFT, mm1); // mm1 = y1 y0
-
- paddd_r2r (mm6, mm5); // mm5 = b3 b2
- movq_r2r (mm0, mm4); // mm4 = a3 a2 + rounder
-
- paddd_r2r (mm5, mm0); // mm0 = a3+b3 a2+b2 + rounder
- psubd_r2r (mm5, mm4); // mm4 = a3-b3 a2-b2 + rounder
-}
-
-static inline void mmxext_row_tail (int16_t * row, int store)
-{
- psrad_i2r (ROW_SHIFT, mm0); // mm0 = y3 y2
-
- psrad_i2r (ROW_SHIFT, mm4); // mm4 = y4 y5
-
- packssdw_r2r (mm0, mm1); // mm1 = y3 y2 y1 y0
-
- packssdw_r2r (mm3, mm4); // mm4 = y6 y7 y4 y5
-
- movq_r2m (mm1, *(row+store)); // save y3 y2 y1 y0
- pshufw_r2r (mm4, mm4, 0xb1); // mm4 = y7 y6 y5 y4
-
- /* slot */
-
- movq_r2m (mm4, *(row+store+4)); // save y7 y6 y5 y4
-}
-
-static inline void mmxext_row_mid (int16_t * row, int store,
- int offset, const int16_t * table)
-{
- movq_m2r (*(row+offset), mm2); // mm2 = x6 x4 x2 x0
- psrad_i2r (ROW_SHIFT, mm0); // mm0 = y3 y2
-
- movq_m2r (*(row+offset+4), mm5); // mm5 = x7 x5 x3 x1
- psrad_i2r (ROW_SHIFT, mm4); // mm4 = y4 y5
-
- packssdw_r2r (mm0, mm1); // mm1 = y3 y2 y1 y0
- movq_r2r (mm5, mm6); // mm6 = x7 x5 x3 x1
-
- packssdw_r2r (mm3, mm4); // mm4 = y6 y7 y4 y5
- movq_r2r (mm2, mm0); // mm0 = x6 x4 x2 x0
-
- movq_r2m (mm1, *(row+store)); // save y3 y2 y1 y0
- pshufw_r2r (mm4, mm4, 0xb1); // mm4 = y7 y6 y5 y4
-
- movq_m2r (*table, mm3); // mm3 = -C2 -C4 C2 C4
- movq_r2m (mm4, *(row+store+4)); // save y7 y6 y5 y4
-
- pmaddwd_r2r (mm0, mm3); // mm3 = -C4*x4-C2*x6 C4*x0+C2*x2
-
- movq_m2r (*(table+4), mm4); // mm4 = C6 C4 C6 C4
- pshufw_r2r (mm2, mm2, 0x4e); // mm2 = x2 x0 x6 x4
-}
-
-
-/* MMX row IDCT */
-
-#define mmx_table(c1,c2,c3,c4,c5,c6,c7) { c4, c2, c4, c6, \
- c4, c6, -c4, -c2, \
- c1, c3, c3, -c7, \
- c5, c7, -c1, -c5, \
- c4, -c6, c4, -c2, \
- -c4, c2, c4, -c6, \
- c5, -c1, c7, -c5, \
- c7, c3, c3, -c1 }
-
-static inline void mmx_row_head (int16_t * row, int offset, const int16_t * table)
-{
- movq_m2r (*(row+offset), mm2); // mm2 = x6 x4 x2 x0
-
- movq_m2r (*(row+offset+4), mm5); // mm5 = x7 x5 x3 x1
- movq_r2r (mm2, mm0); // mm0 = x6 x4 x2 x0
-
- movq_m2r (*table, mm3); // mm3 = C6 C4 C2 C4
- movq_r2r (mm5, mm6); // mm6 = x7 x5 x3 x1
-
- punpckldq_r2r (mm0, mm0); // mm0 = x2 x0 x2 x0
-
- movq_m2r (*(table+4), mm4); // mm4 = -C2 -C4 C6 C4
- pmaddwd_r2r (mm0, mm3); // mm3 = C4*x0+C6*x2 C4*x0+C2*x2
-
- movq_m2r (*(table+8), mm1); // mm1 = -C7 C3 C3 C1
- punpckhdq_r2r (mm2, mm2); // mm2 = x6 x4 x6 x4
-}
-
-static inline void mmx_row (const int16_t * table, const int32_t * rounder)
-{
- pmaddwd_r2r (mm2, mm4); // mm4 = -C4*x4-C2*x6 C4*x4+C6*x6
- punpckldq_r2r (mm5, mm5); // mm5 = x3 x1 x3 x1
-
- pmaddwd_m2r (*(table+16), mm0); // mm0 = C4*x0-C2*x2 C4*x0-C6*x2
- punpckhdq_r2r (mm6, mm6); // mm6 = x7 x5 x7 x5
-
- movq_m2r (*(table+12), mm7); // mm7 = -C5 -C1 C7 C5
- pmaddwd_r2r (mm5, mm1); // mm1 = C3*x1-C7*x3 C1*x1+C3*x3
-
- paddd_m2r (*rounder, mm3); // mm3 += rounder
- pmaddwd_r2r (mm6, mm7); // mm7 = -C1*x5-C5*x7 C5*x5+C7*x7
-
- pmaddwd_m2r (*(table+20), mm2); // mm2 = C4*x4-C6*x6 -C4*x4+C2*x6
- paddd_r2r (mm4, mm3); // mm3 = a1 a0 + rounder
-
- pmaddwd_m2r (*(table+24), mm5); // mm5 = C7*x1-C5*x3 C5*x1-C1*x3
- movq_r2r (mm3, mm4); // mm4 = a1 a0 + rounder
-
- pmaddwd_m2r (*(table+28), mm6); // mm6 = C3*x5-C1*x7 C7*x5+C3*x7
- paddd_r2r (mm7, mm1); // mm1 = b1 b0
-
- paddd_m2r (*rounder, mm0); // mm0 += rounder
- psubd_r2r (mm1, mm3); // mm3 = a1-b1 a0-b0 + rounder
-
- psrad_i2r (ROW_SHIFT, mm3); // mm3 = y6 y7
- paddd_r2r (mm4, mm1); // mm1 = a1+b1 a0+b0 + rounder
-
- paddd_r2r (mm2, mm0); // mm0 = a3 a2 + rounder
- psrad_i2r (ROW_SHIFT, mm1); // mm1 = y1 y0
-
- paddd_r2r (mm6, mm5); // mm5 = b3 b2
- movq_r2r (mm0, mm7); // mm7 = a3 a2 + rounder
-
- paddd_r2r (mm5, mm0); // mm0 = a3+b3 a2+b2 + rounder
- psubd_r2r (mm5, mm7); // mm7 = a3-b3 a2-b2 + rounder
-}
-
-static inline void mmx_row_tail (int16_t * row, int store)
-{
- psrad_i2r (ROW_SHIFT, mm0); // mm0 = y3 y2
-
- psrad_i2r (ROW_SHIFT, mm7); // mm7 = y4 y5
-
- packssdw_r2r (mm0, mm1); // mm1 = y3 y2 y1 y0
-
- packssdw_r2r (mm3, mm7); // mm7 = y6 y7 y4 y5
-
- movq_r2m (mm1, *(row+store)); // save y3 y2 y1 y0
- movq_r2r (mm7, mm4); // mm4 = y6 y7 y4 y5
-
- pslld_i2r (16, mm7); // mm7 = y7 0 y5 0
-
- psrld_i2r (16, mm4); // mm4 = 0 y6 0 y4
-
- por_r2r (mm4, mm7); // mm7 = y7 y6 y5 y4
-
- /* slot */
-
- movq_r2m (mm7, *(row+store+4)); // save y7 y6 y5 y4
-}
-
-static inline void mmx_row_mid (int16_t * row, int store,
- int offset, const int16_t * table)
-{
- movq_m2r (*(row+offset), mm2); // mm2 = x6 x4 x2 x0
- psrad_i2r (ROW_SHIFT, mm0); // mm0 = y3 y2
-
- movq_m2r (*(row+offset+4), mm5); // mm5 = x7 x5 x3 x1
- psrad_i2r (ROW_SHIFT, mm7); // mm7 = y4 y5
-
- packssdw_r2r (mm0, mm1); // mm1 = y3 y2 y1 y0
- movq_r2r (mm5, mm6); // mm6 = x7 x5 x3 x1
-
- packssdw_r2r (mm3, mm7); // mm7 = y6 y7 y4 y5
- movq_r2r (mm2, mm0); // mm0 = x6 x4 x2 x0
-
- movq_r2m (mm1, *(row+store)); // save y3 y2 y1 y0
- movq_r2r (mm7, mm1); // mm1 = y6 y7 y4 y5
-
- punpckldq_r2r (mm0, mm0); // mm0 = x2 x0 x2 x0
- psrld_i2r (16, mm7); // mm7 = 0 y6 0 y4
-
- movq_m2r (*table, mm3); // mm3 = C6 C4 C2 C4
- pslld_i2r (16, mm1); // mm1 = y7 0 y5 0
-
- movq_m2r (*(table+4), mm4); // mm4 = -C2 -C4 C6 C4
- por_r2r (mm1, mm7); // mm7 = y7 y6 y5 y4
-
- movq_m2r (*(table+8), mm1); // mm1 = -C7 C3 C3 C1
- punpckhdq_r2r (mm2, mm2); // mm2 = x6 x4 x6 x4
-
- movq_r2m (mm7, *(row+store+4)); // save y7 y6 y5 y4
- pmaddwd_r2r (mm0, mm3); // mm3 = C4*x0+C6*x2 C4*x0+C2*x2
-}
-
-
-#if 0
-// C column IDCT - its just here to document the MMXEXT and MMX versions
-static inline void idct_col (int16_t * col, int offset)
-{
-/* multiplication - as implemented on mmx */
-#define F(c,x) (((c) * (x)) >> 16)
-
-/* saturation - it helps us handle torture test cases */
-#define S(x) (((x)>32767) ? 32767 : ((x)<-32768) ? -32768 : (x))
-
- int16_t x0, x1, x2, x3, x4, x5, x6, x7;
- int16_t y0, y1, y2, y3, y4, y5, y6, y7;
- int16_t a0, a1, a2, a3, b0, b1, b2, b3;
- int16_t u04, v04, u26, v26, u17, v17, u35, v35, u12, v12;
-
- col += offset;
-
- x0 = col[0*8];
- x1 = col[1*8];
- x2 = col[2*8];
- x3 = col[3*8];
- x4 = col[4*8];
- x5 = col[5*8];
- x6 = col[6*8];
- x7 = col[7*8];
-
- u04 = S (x0 + x4);
- v04 = S (x0 - x4);
- u26 = S (F (T2, x6) + x2);
- v26 = S (F (T2, x2) - x6);
-
- a0 = S (u04 + u26);
- a1 = S (v04 + v26);
- a2 = S (v04 - v26);
- a3 = S (u04 - u26);
-
- u17 = S (F (T1, x7) + x1);
- v17 = S (F (T1, x1) - x7);
- u35 = S (F (T3, x5) + x3);
- v35 = S (F (T3, x3) - x5);
-
- b0 = S (u17 + u35);
- b3 = S (v17 - v35);
- u12 = S (u17 - u35);
- v12 = S (v17 + v35);
- u12 = S (2 * F (C4, u12));
- v12 = S (2 * F (C4, v12));
- b1 = S (u12 + v12);
- b2 = S (u12 - v12);
-
- y0 = S (a0 + b0) >> COL_SHIFT;
- y1 = S (a1 + b1) >> COL_SHIFT;
- y2 = S (a2 + b2) >> COL_SHIFT;
- y3 = S (a3 + b3) >> COL_SHIFT;
-
- y4 = S (a3 - b3) >> COL_SHIFT;
- y5 = S (a2 - b2) >> COL_SHIFT;
- y6 = S (a1 - b1) >> COL_SHIFT;
- y7 = S (a0 - b0) >> COL_SHIFT;
-
- col[0*8] = y0;
- col[1*8] = y1;
- col[2*8] = y2;
- col[3*8] = y3;
- col[4*8] = y4;
- col[5*8] = y5;
- col[6*8] = y6;
- col[7*8] = y7;
-}
-#endif
-
-
-// MMX column IDCT
-static inline void idct_col (int16_t * col, int offset)
-{
-#define T1 13036
-#define T2 27146
-#define T3 43790
-#define C4 23170
-
- static const short _T1[] ATTR_ALIGN(8) = {T1,T1,T1,T1};
- static const short _T2[] ATTR_ALIGN(8) = {T2,T2,T2,T2};
- static const short _T3[] ATTR_ALIGN(8) = {T3,T3,T3,T3};
- static const short _C4[] ATTR_ALIGN(8) = {C4,C4,C4,C4};
-
- /* column code adapted from peter gubanov */
- /* http://www.elecard.com/peter/idct.shtml */
-
- movq_m2r (*_T1, mm0); // mm0 = T1
-
- movq_m2r (*(col+offset+1*8), mm1); // mm1 = x1
- movq_r2r (mm0, mm2); // mm2 = T1
-
- movq_m2r (*(col+offset+7*8), mm4); // mm4 = x7
- pmulhw_r2r (mm1, mm0); // mm0 = T1*x1
-
- movq_m2r (*_T3, mm5); // mm5 = T3
- pmulhw_r2r (mm4, mm2); // mm2 = T1*x7
-
- movq_m2r (*(col+offset+5*8), mm6); // mm6 = x5
- movq_r2r (mm5, mm7); // mm7 = T3-1
-
- movq_m2r (*(col+offset+3*8), mm3); // mm3 = x3
- psubsw_r2r (mm4, mm0); // mm0 = v17
-
- movq_m2r (*_T2, mm4); // mm4 = T2
- pmulhw_r2r (mm3, mm5); // mm5 = (T3-1)*x3
-
- paddsw_r2r (mm2, mm1); // mm1 = u17
- pmulhw_r2r (mm6, mm7); // mm7 = (T3-1)*x5
-
- /* slot */
-
- movq_r2r (mm4, mm2); // mm2 = T2
- paddsw_r2r (mm3, mm5); // mm5 = T3*x3
-
- pmulhw_m2r (*(col+offset+2*8), mm4);// mm4 = T2*x2
- paddsw_r2r (mm6, mm7); // mm7 = T3*x5
-
- psubsw_r2r (mm6, mm5); // mm5 = v35
- paddsw_r2r (mm3, mm7); // mm7 = u35
-
- movq_m2r (*(col+offset+6*8), mm3); // mm3 = x6
- movq_r2r (mm0, mm6); // mm6 = v17
-
- pmulhw_r2r (mm3, mm2); // mm2 = T2*x6
- psubsw_r2r (mm5, mm0); // mm0 = b3
-
- psubsw_r2r (mm3, mm4); // mm4 = v26
- paddsw_r2r (mm6, mm5); // mm5 = v12
-
- movq_r2m (mm0, *(col+offset+3*8)); // save b3 in scratch0
- movq_r2r (mm1, mm6); // mm6 = u17
-
- paddsw_m2r (*(col+offset+2*8), mm2);// mm2 = u26
- paddsw_r2r (mm7, mm6); // mm6 = b0
-
- psubsw_r2r (mm7, mm1); // mm1 = u12
- movq_r2r (mm1, mm7); // mm7 = u12
-
- movq_m2r (*(col+offset+0*8), mm3); // mm3 = x0
- paddsw_r2r (mm5, mm1); // mm1 = u12+v12
-
- movq_m2r (*_C4, mm0); // mm0 = C4/2
- psubsw_r2r (mm5, mm7); // mm7 = u12-v12
-
- movq_r2m (mm6, *(col+offset+5*8)); // save b0 in scratch1
- pmulhw_r2r (mm0, mm1); // mm1 = b1/2
-
- movq_r2r (mm4, mm6); // mm6 = v26
- pmulhw_r2r (mm0, mm7); // mm7 = b2/2
-
- movq_m2r (*(col+offset+4*8), mm5); // mm5 = x4
- movq_r2r (mm3, mm0); // mm0 = x0
-
- psubsw_r2r (mm5, mm3); // mm3 = v04
- paddsw_r2r (mm5, mm0); // mm0 = u04
-
- paddsw_r2r (mm3, mm4); // mm4 = a1
- movq_r2r (mm0, mm5); // mm5 = u04
-
- psubsw_r2r (mm6, mm3); // mm3 = a2
- paddsw_r2r (mm2, mm5); // mm5 = a0
-
- paddsw_r2r (mm1, mm1); // mm1 = b1
- psubsw_r2r (mm2, mm0); // mm0 = a3
-
- paddsw_r2r (mm7, mm7); // mm7 = b2
- movq_r2r (mm3, mm2); // mm2 = a2
-
- movq_r2r (mm4, mm6); // mm6 = a1
- paddsw_r2r (mm7, mm3); // mm3 = a2+b2
-
- psraw_i2r (COL_SHIFT, mm3); // mm3 = y2
- paddsw_r2r (mm1, mm4); // mm4 = a1+b1
-
- psraw_i2r (COL_SHIFT, mm4); // mm4 = y1
- psubsw_r2r (mm1, mm6); // mm6 = a1-b1
-
- movq_m2r (*(col+offset+5*8), mm1); // mm1 = b0
- psubsw_r2r (mm7, mm2); // mm2 = a2-b2
-
- psraw_i2r (COL_SHIFT, mm6); // mm6 = y6
- movq_r2r (mm5, mm7); // mm7 = a0
-
- movq_r2m (mm4, *(col+offset+1*8)); // save y1
- psraw_i2r (COL_SHIFT, mm2); // mm2 = y5
-
- movq_r2m (mm3, *(col+offset+2*8)); // save y2
- paddsw_r2r (mm1, mm5); // mm5 = a0+b0
-
- movq_m2r (*(col+offset+3*8), mm4); // mm4 = b3
- psubsw_r2r (mm1, mm7); // mm7 = a0-b0
-
- psraw_i2r (COL_SHIFT, mm5); // mm5 = y0
- movq_r2r (mm0, mm3); // mm3 = a3
-
- movq_r2m (mm2, *(col+offset+5*8)); // save y5
- psubsw_r2r (mm4, mm3); // mm3 = a3-b3
-
- psraw_i2r (COL_SHIFT, mm7); // mm7 = y7
- paddsw_r2r (mm0, mm4); // mm4 = a3+b3
-
- movq_r2m (mm5, *(col+offset+0*8)); // save y0
- psraw_i2r (COL_SHIFT, mm3); // mm3 = y4
-
- movq_r2m (mm6, *(col+offset+6*8)); // save y6
- psraw_i2r (COL_SHIFT, mm4); // mm4 = y3
-
- movq_r2m (mm7, *(col+offset+7*8)); // save y7
-
- movq_r2m (mm3, *(col+offset+4*8)); // save y4
-
- movq_r2m (mm4, *(col+offset+3*8)); // save y3
-
-#undef T1
-#undef T2
-#undef T3
-#undef C4
-}
-
-static const int32_t rounder0[] ATTR_ALIGN(8) =
- rounder ((1 << (COL_SHIFT - 1)) - 0.5);
-static const int32_t rounder4[] ATTR_ALIGN(8) = rounder (0);
-static const int32_t rounder1[] ATTR_ALIGN(8) =
- rounder (1.25683487303); /* C1*(C1/C4+C1+C7)/2 */
-static const int32_t rounder7[] ATTR_ALIGN(8) =
- rounder (-0.25); /* C1*(C7/C4+C7-C1)/2 */
-static const int32_t rounder2[] ATTR_ALIGN(8) =
- rounder (0.60355339059); /* C2 * (C6+C2)/2 */
-static const int32_t rounder6[] ATTR_ALIGN(8) =
- rounder (-0.25); /* C2 * (C6-C2)/2 */
-static const int32_t rounder3[] ATTR_ALIGN(8) =
- rounder (0.087788325588); /* C3*(-C3/C4+C3+C5)/2 */
-static const int32_t rounder5[] ATTR_ALIGN(8) =
- rounder (-0.441341716183); /* C3*(-C5/C4+C5-C3)/2 */
-
-#undef COL_SHIFT
-#undef ROW_SHIFT
-
-#define declare_idct(idct,table,idct_row_head,idct_row,idct_row_tail,idct_row_mid) \
-void idct (int16_t * block) \
-{ \
- static const int16_t table04[] ATTR_ALIGN(16) = \
- table (22725, 21407, 19266, 16384, 12873, 8867, 4520); \
- static const int16_t table17[] ATTR_ALIGN(16) = \
- table (31521, 29692, 26722, 22725, 17855, 12299, 6270); \
- static const int16_t table26[] ATTR_ALIGN(16) = \
- table (29692, 27969, 25172, 21407, 16819, 11585, 5906); \
- static const int16_t table35[] ATTR_ALIGN(16) = \
- table (26722, 25172, 22654, 19266, 15137, 10426, 5315); \
- \
- idct_row_head (block, 0*8, table04); \
- idct_row (table04, rounder0); \
- idct_row_mid (block, 0*8, 4*8, table04); \
- idct_row (table04, rounder4); \
- idct_row_mid (block, 4*8, 1*8, table17); \
- idct_row (table17, rounder1); \
- idct_row_mid (block, 1*8, 7*8, table17); \
- idct_row (table17, rounder7); \
- idct_row_mid (block, 7*8, 2*8, table26); \
- idct_row (table26, rounder2); \
- idct_row_mid (block, 2*8, 6*8, table26); \
- idct_row (table26, rounder6); \
- idct_row_mid (block, 6*8, 3*8, table35); \
- idct_row (table35, rounder3); \
- idct_row_mid (block, 3*8, 5*8, table35); \
- idct_row (table35, rounder5); \
- idct_row_tail (block, 5*8); \
- \
- idct_col (block, 0); \
- idct_col (block, 4); \
-}
-
-void ff_mmx_idct(DCTELEM *block);
-void ff_mmxext_idct(DCTELEM *block);
-
-declare_idct (ff_mmxext_idct, mmxext_table,
- mmxext_row_head, mmxext_row, mmxext_row_tail, mmxext_row_mid)
-
-declare_idct (ff_mmx_idct, mmx_table,
- mmx_row_head, mmx_row, mmx_row_tail, mmx_row_mid)
-
diff --git a/src/libffmpeg/libavcodec/i386/idct_mmx_xvid.c b/src/libffmpeg/libavcodec/i386/idct_mmx_xvid.c
deleted file mode 100644
index 59b255943..000000000
--- a/src/libffmpeg/libavcodec/i386/idct_mmx_xvid.c
+++ /dev/null
@@ -1,535 +0,0 @@
-///****************************************************************************
-// *
-// * XVID MPEG-4 VIDEO CODEC
-// * - MMX and XMM forward discrete cosine transform -
-// *
-// * Copyright(C) 2001 Peter Ross <pross@xvid.org>
-// *
-// * This file is part of FFmpeg.
-// *
-// * FFmpeg is free software; you can redistribute it and/or
-// * modify it under the terms of the GNU Lesser General Public
-// * License as published by the Free Software Foundation; either
-// * version 2.1 of the License, or (at your option) any later version.
-// *
-// * FFmpeg is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// * Lesser General Public License for more details.
-// *
-// * You should have received a copy of the GNU Lesser General Public License
-// * along with FFmpeg; if not, write to the Free Software Foundation,
-// * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-// *
-// * $Id: idct_mmx_xvid.c,v 1.4 2006/12/04 22:25:26 miguelfreitas Exp $
-// *
-// ***************************************************************************/
-
-// ****************************************************************************
-//
-// Originally provided by Intel at AP-922
-// http://developer.intel.com/vtune/cbts/strmsimd/922down.htm
-// (See more app notes at http://developer.intel.com/vtune/cbts/strmsimd/appnotes.htm)
-// but in a limited edition.
-// New macro implements a column part for precise iDCT
-// The routine precision now satisfies IEEE standard 1180-1990.
-//
-// Copyright(C) 2000-2001 Peter Gubanov <peter@elecard.net.ru>
-// Rounding trick Copyright(C) 2000 Michel Lespinasse <walken@zoy.org>
-//
-// http://www.elecard.com/peter/idct.html
-// http://www.linuxvideo.org/mpeg2dec/
-//
-// ***************************************************************************/
-//
-// These examples contain code fragments for first stage iDCT 8x8
-// (for rows) and first stage DCT 8x8 (for columns)
-//
-
-// conversion to gcc syntax by michael niedermayer
-
-
-#include <inttypes.h>
-#include "../avcodec.h"
-
-//=============================================================================
-// Macros and other preprocessor constants
-//=============================================================================
-
-#define BITS_INV_ACC 5 // 4 or 5 for IEEE
-#define SHIFT_INV_ROW (16 - BITS_INV_ACC) //11
-#define SHIFT_INV_COL (1 + BITS_INV_ACC) //6
-#define RND_INV_ROW (1024 * (6 - BITS_INV_ACC))
-#define RND_INV_COL (16 * (BITS_INV_ACC - 3))
-#define RND_INV_CORR (RND_INV_COL - 1)
-
-#define BITS_FRW_ACC 3 // 2 or 3 for accuracy
-#define SHIFT_FRW_COL BITS_FRW_ACC
-#define SHIFT_FRW_ROW (BITS_FRW_ACC + 17)
-#define RND_FRW_ROW (262144*(BITS_FRW_ACC - 1))
-
-
-//-----------------------------------------------------------------------------
-// Various memory constants (trigonometric values or rounding values)
-//-----------------------------------------------------------------------------
-
-
-static const int16_t tg_1_16[4*4] attribute_used __attribute__ ((aligned(8))) = {
- 13036,13036,13036,13036, // tg * (2<<16) + 0.5
- 27146,27146,27146,27146, // tg * (2<<16) + 0.5
- -21746,-21746,-21746,-21746, // tg * (2<<16) + 0.5
- 23170,23170,23170,23170}; // cos * (2<<15) + 0.5
-
-static const int32_t rounder_0[2*8] attribute_used __attribute__ ((aligned(8))) = {
- 65536,65536,
- 3597,3597,
- 2260,2260,
- 1203,1203,
- 0,0,
- 120,120,
- 512,512,
- 512,512};
-
-//-----------------------------------------------------------------------------
-//
-// The first stage iDCT 8x8 - inverse DCTs of rows
-//
-//-----------------------------------------------------------------------------
-// The 8-point inverse DCT direct algorithm
-//-----------------------------------------------------------------------------
-//
-// static const short w[32] = {
-// FIX(cos_4_16), FIX(cos_2_16), FIX(cos_4_16), FIX(cos_6_16),
-// FIX(cos_4_16), FIX(cos_6_16), -FIX(cos_4_16), -FIX(cos_2_16),
-// FIX(cos_4_16), -FIX(cos_6_16), -FIX(cos_4_16), FIX(cos_2_16),
-// FIX(cos_4_16), -FIX(cos_2_16), FIX(cos_4_16), -FIX(cos_6_16),
-// FIX(cos_1_16), FIX(cos_3_16), FIX(cos_5_16), FIX(cos_7_16),
-// FIX(cos_3_16), -FIX(cos_7_16), -FIX(cos_1_16), -FIX(cos_5_16),
-// FIX(cos_5_16), -FIX(cos_1_16), FIX(cos_7_16), FIX(cos_3_16),
-// FIX(cos_7_16), -FIX(cos_5_16), FIX(cos_3_16), -FIX(cos_1_16) };
-//
-// #define DCT_8_INV_ROW(x, y)
-// {
-// int a0, a1, a2, a3, b0, b1, b2, b3;
-//
-// a0 =x[0]*w[0]+x[2]*w[1]+x[4]*w[2]+x[6]*w[3];
-// a1 =x[0]*w[4]+x[2]*w[5]+x[4]*w[6]+x[6]*w[7];
-// a2 = x[0] * w[ 8] + x[2] * w[ 9] + x[4] * w[10] + x[6] * w[11];
-// a3 = x[0] * w[12] + x[2] * w[13] + x[4] * w[14] + x[6] * w[15];
-// b0 = x[1] * w[16] + x[3] * w[17] + x[5] * w[18] + x[7] * w[19];
-// b1 = x[1] * w[20] + x[3] * w[21] + x[5] * w[22] + x[7] * w[23];
-// b2 = x[1] * w[24] + x[3] * w[25] + x[5] * w[26] + x[7] * w[27];
-// b3 = x[1] * w[28] + x[3] * w[29] + x[5] * w[30] + x[7] * w[31];
-//
-// y[0] = SHIFT_ROUND ( a0 + b0 );
-// y[1] = SHIFT_ROUND ( a1 + b1 );
-// y[2] = SHIFT_ROUND ( a2 + b2 );
-// y[3] = SHIFT_ROUND ( a3 + b3 );
-// y[4] = SHIFT_ROUND ( a3 - b3 );
-// y[5] = SHIFT_ROUND ( a2 - b2 );
-// y[6] = SHIFT_ROUND ( a1 - b1 );
-// y[7] = SHIFT_ROUND ( a0 - b0 );
-// }
-//
-//-----------------------------------------------------------------------------
-//
-// In this implementation the outputs of the iDCT-1D are multiplied
-// for rows 0,4 - by cos_4_16,
-// for rows 1,7 - by cos_1_16,
-// for rows 2,6 - by cos_2_16,
-// for rows 3,5 - by cos_3_16
-// and are shifted to the left for better accuracy
-//
-// For the constants used,
-// FIX(float_const) = (short) (float_const * (1<<15) + 0.5)
-//
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// Tables for mmx processors
-//-----------------------------------------------------------------------------
-
-// Table for rows 0,4 - constants are multiplied by cos_4_16
-static const int16_t tab_i_04_mmx[32*4] attribute_used __attribute__ ((aligned(8))) = {
- 16384,16384,16384,-16384, // movq-> w06 w04 w02 w00
- 21407,8867,8867,-21407, // w07 w05 w03 w01
- 16384,-16384,16384,16384, // w14 w12 w10 w08
- -8867,21407,-21407,-8867, // w15 w13 w11 w09
- 22725,12873,19266,-22725, // w22 w20 w18 w16
- 19266,4520,-4520,-12873, // w23 w21 w19 w17
- 12873,4520,4520,19266, // w30 w28 w26 w24
- -22725,19266,-12873,-22725, // w31 w29 w27 w25
-// Table for rows 1,7 - constants are multiplied by cos_1_16
- 22725,22725,22725,-22725, // movq-> w06 w04 w02 w00
- 29692,12299,12299,-29692, // w07 w05 w03 w01
- 22725,-22725,22725,22725, // w14 w12 w10 w08
- -12299,29692,-29692,-12299, // w15 w13 w11 w09
- 31521,17855,26722,-31521, // w22 w20 w18 w16
- 26722,6270,-6270,-17855, // w23 w21 w19 w17
- 17855,6270,6270,26722, // w30 w28 w26 w24
- -31521,26722,-17855,-31521, // w31 w29 w27 w25
-// Table for rows 2,6 - constants are multiplied by cos_2_16
- 21407,21407,21407,-21407, // movq-> w06 w04 w02 w00
- 27969,11585,11585,-27969, // w07 w05 w03 w01
- 21407,-21407,21407,21407, // w14 w12 w10 w08
- -11585,27969,-27969,-11585, // w15 w13 w11 w09
- 29692,16819,25172,-29692, // w22 w20 w18 w16
- 25172,5906,-5906,-16819, // w23 w21 w19 w17
- 16819,5906,5906,25172, // w30 w28 w26 w24
- -29692,25172,-16819,-29692, // w31 w29 w27 w25
-// Table for rows 3,5 - constants are multiplied by cos_3_16
- 19266,19266,19266,-19266, // movq-> w06 w04 w02 w00
- 25172,10426,10426,-25172, // w07 w05 w03 w01
- 19266,-19266,19266,19266, // w14 w12 w10 w08
- -10426,25172,-25172,-10426, // w15 w13 w11 w09
- 26722,15137,22654,-26722, // w22 w20 w18 w16
- 22654,5315,-5315,-15137, // w23 w21 w19 w17
- 15137,5315,5315,22654, // w30 w28 w26 w24
- -26722,22654,-15137,-26722, // w31 w29 w27 w25
-};
-//-----------------------------------------------------------------------------
-// Tables for xmm processors
-//-----------------------------------------------------------------------------
-
-// %3 for rows 0,4 - constants are multiplied by cos_4_16
-static const int16_t tab_i_04_xmm[32*4] attribute_used __attribute__ ((aligned(8))) = {
- 16384,21407,16384,8867, // movq-> w05 w04 w01 w00
- 16384,8867,-16384,-21407, // w07 w06 w03 w02
- 16384,-8867,16384,-21407, // w13 w12 w09 w08
- -16384,21407,16384,-8867, // w15 w14 w11 w10
- 22725,19266,19266,-4520, // w21 w20 w17 w16
- 12873,4520,-22725,-12873, // w23 w22 w19 w18
- 12873,-22725,4520,-12873, // w29 w28 w25 w24
- 4520,19266,19266,-22725, // w31 w30 w27 w26
-// %3 for rows 1,7 - constants are multiplied by cos_1_16
- 22725,29692,22725,12299, // movq-> w05 w04 w01 w00
- 22725,12299,-22725,-29692, // w07 w06 w03 w02
- 22725,-12299,22725,-29692, // w13 w12 w09 w08
- -22725,29692,22725,-12299, // w15 w14 w11 w10
- 31521,26722,26722,-6270, // w21 w20 w17 w16
- 17855,6270,-31521,-17855, // w23 w22 w19 w18
- 17855,-31521,6270,-17855, // w29 w28 w25 w24
- 6270,26722,26722,-31521, // w31 w30 w27 w26
-// %3 for rows 2,6 - constants are multiplied by cos_2_16
- 21407,27969,21407,11585, // movq-> w05 w04 w01 w00
- 21407,11585,-21407,-27969, // w07 w06 w03 w02
- 21407,-11585,21407,-27969, // w13 w12 w09 w08
- -21407,27969,21407,-11585, // w15 w14 w11 w10
- 29692,25172,25172,-5906, // w21 w20 w17 w16
- 16819,5906,-29692,-16819, // w23 w22 w19 w18
- 16819,-29692,5906,-16819, // w29 w28 w25 w24
- 5906,25172,25172,-29692, // w31 w30 w27 w26
-// %3 for rows 3,5 - constants are multiplied by cos_3_16
- 19266,25172,19266,10426, // movq-> w05 w04 w01 w00
- 19266,10426,-19266,-25172, // w07 w06 w03 w02
- 19266,-10426,19266,-25172, // w13 w12 w09 w08
- -19266,25172,19266,-10426, // w15 w14 w11 w10
- 26722,22654,22654,-5315, // w21 w20 w17 w16
- 15137,5315,-26722,-15137, // w23 w22 w19 w18
- 15137,-26722,5315,-15137, // w29 w28 w25 w24
- 5315,22654,22654,-26722, // w31 w30 w27 w26
-};
-//=============================================================================
-// Helper macros for the code
-//=============================================================================
-
-//-----------------------------------------------------------------------------
-// DCT_8_INV_ROW_MMX( INP, OUT, TABLE, ROUNDER
-//-----------------------------------------------------------------------------
-
-#define DCT_8_INV_ROW_MMX(A1,A2,A3,A4)\
- "movq " #A1 ",%%mm0 \n\t"/* 0 ; x3 x2 x1 x0*/\
- "movq 8+" #A1 ",%%mm1 \n\t"/* 1 ; x7 x6 x5 x4*/\
- "movq %%mm0,%%mm2 \n\t"/* 2 ; x3 x2 x1 x0*/\
- "movq " #A3 ",%%mm3 \n\t"/* 3 ; w06 w04 w02 w00*/\
- "punpcklwd %%mm1,%%mm0 \n\t"/* x5 x1 x4 x0*/\
- "movq %%mm0,%%mm5 \n\t"/* 5 ; x5 x1 x4 x0*/\
- "punpckldq %%mm0,%%mm0 \n\t"/* x4 x0 x4 x0*/\
- "movq 8+" #A3 ",%%mm4 \n\t"/* 4 ; w07 w05 w03 w01*/\
- "punpckhwd %%mm1,%%mm2 \n\t"/* 1 ; x7 x3 x6 x2*/\
- "pmaddwd %%mm0,%%mm3 \n\t"/* x4*w06+x0*w04 x4*w02+x0*w00*/\
- "movq %%mm2,%%mm6 \n\t"/* 6 ; x7 x3 x6 x2*/\
- "movq 32+" #A3 ",%%mm1 \n\t"/* 1 ; w22 w20 w18 w16*/\
- "punpckldq %%mm2,%%mm2 \n\t"/* x6 x2 x6 x2*/\
- "pmaddwd %%mm2,%%mm4 \n\t"/* x6*w07+x2*w05 x6*w03+x2*w01*/\
- "punpckhdq %%mm5,%%mm5 \n\t"/* x5 x1 x5 x1*/\
- "pmaddwd 16+" #A3 ",%%mm0 \n\t"/* x4*w14+x0*w12 x4*w10+x0*w08*/\
- "punpckhdq %%mm6,%%mm6 \n\t"/* x7 x3 x7 x3*/\
- "movq 40+" #A3 ",%%mm7 \n\t"/* 7 ; w23 w21 w19 w17*/\
- "pmaddwd %%mm5,%%mm1 \n\t"/* x5*w22+x1*w20 x5*w18+x1*w16*/\
- "paddd " #A4 ",%%mm3 \n\t"/* +%4*/\
- "pmaddwd %%mm6,%%mm7 \n\t"/* x7*w23+x3*w21 x7*w19+x3*w17*/\
- "pmaddwd 24+" #A3 ",%%mm2 \n\t"/* x6*w15+x2*w13 x6*w11+x2*w09*/\
- "paddd %%mm4,%%mm3 \n\t"/* 4 ; a1=sum(even1) a0=sum(even0)*/\
- "pmaddwd 48+" #A3 ",%%mm5 \n\t"/* x5*w30+x1*w28 x5*w26+x1*w24*/\
- "movq %%mm3,%%mm4 \n\t"/* 4 ; a1 a0*/\
- "pmaddwd 56+" #A3 ",%%mm6 \n\t"/* x7*w31+x3*w29 x7*w27+x3*w25*/\
- "paddd %%mm7,%%mm1 \n\t"/* 7 ; b1=sum(odd1) b0=sum(odd0)*/\
- "paddd " #A4 ",%%mm0 \n\t"/* +%4*/\
- "psubd %%mm1,%%mm3 \n\t"/* a1-b1 a0-b0*/\
- "psrad $11,%%mm3 \n\t"/* y6=a1-b1 y7=a0-b0*/\
- "paddd %%mm4,%%mm1 \n\t"/* 4 ; a1+b1 a0+b0*/\
- "paddd %%mm2,%%mm0 \n\t"/* 2 ; a3=sum(even3) a2=sum(even2)*/\
- "psrad $11,%%mm1 \n\t"/* y1=a1+b1 y0=a0+b0*/\
- "paddd %%mm6,%%mm5 \n\t"/* 6 ; b3=sum(odd3) b2=sum(odd2)*/\
- "movq %%mm0,%%mm4 \n\t"/* 4 ; a3 a2*/\
- "paddd %%mm5,%%mm0 \n\t"/* a3+b3 a2+b2*/\
- "psubd %%mm5,%%mm4 \n\t"/* 5 ; a3-b3 a2-b2*/\
- "psrad $11,%%mm0 \n\t"/* y3=a3+b3 y2=a2+b2*/\
- "psrad $11,%%mm4 \n\t"/* y4=a3-b3 y5=a2-b2*/\
- "packssdw %%mm0,%%mm1 \n\t"/* 0 ; y3 y2 y1 y0*/\
- "packssdw %%mm3,%%mm4 \n\t"/* 3 ; y6 y7 y4 y5*/\
- "movq %%mm4,%%mm7 \n\t"/* 7 ; y6 y7 y4 y5*/\
- "psrld $16,%%mm4 \n\t"/* 0 y6 0 y4*/\
- "pslld $16,%%mm7 \n\t"/* y7 0 y5 0*/\
- "movq %%mm1," #A2 " \n\t"/* 1 ; save y3 y2 y1 y0*/\
- "por %%mm4,%%mm7 \n\t"/* 4 ; y7 y6 y5 y4*/\
- "movq %%mm7,8 +" #A2 "\n\t"/* 7 ; save y7 y6 y5 y4*/\
-
-
-//-----------------------------------------------------------------------------
-// DCT_8_INV_ROW_XMM( INP, OUT, TABLE, ROUNDER
-//-----------------------------------------------------------------------------
-
-#define DCT_8_INV_ROW_XMM(A1,A2,A3,A4)\
- "movq " #A1 ",%%mm0 \n\t"/* 0 ; x3 x2 x1 x0*/\
- "movq 8+" #A1 ",%%mm1 \n\t"/* 1 ; x7 x6 x5 x4*/\
- "movq %%mm0,%%mm2 \n\t"/* 2 ; x3 x2 x1 x0*/\
- "movq " #A3 ",%%mm3 \n\t"/* 3 ; w05 w04 w01 w00*/\
- "pshufw $0x88,%%mm0,%%mm0 \n\t"/* x2 x0 x2 x0*/\
- "movq 8+" #A3 ",%%mm4 \n\t"/* 4 ; w07 w06 w03 w02*/\
- "movq %%mm1,%%mm5 \n\t"/* 5 ; x7 x6 x5 x4*/\
- "pmaddwd %%mm0,%%mm3 \n\t"/* x2*w05+x0*w04 x2*w01+x0*w00*/\
- "movq 32+" #A3 ",%%mm6 \n\t"/* 6 ; w21 w20 w17 w16*/\
- "pshufw $0x88,%%mm1,%%mm1 \n\t"/* x6 x4 x6 x4*/\
- "pmaddwd %%mm1,%%mm4 \n\t"/* x6*w07+x4*w06 x6*w03+x4*w02*/\
- "movq 40+" #A3 ",%%mm7 \n\t"/* 7 ; w23 w22 w19 w18*/\
- "pshufw $0xdd,%%mm2,%%mm2 \n\t"/* x3 x1 x3 x1*/\
- "pmaddwd %%mm2,%%mm6 \n\t"/* x3*w21+x1*w20 x3*w17+x1*w16*/\
- "pshufw $0xdd,%%mm5,%%mm5 \n\t"/* x7 x5 x7 x5*/\
- "pmaddwd %%mm5,%%mm7 \n\t"/* x7*w23+x5*w22 x7*w19+x5*w18*/\
- "paddd " #A4 ",%%mm3 \n\t"/* +%4*/\
- "pmaddwd 16+" #A3 ",%%mm0 \n\t"/* x2*w13+x0*w12 x2*w09+x0*w08*/\
- "paddd %%mm4,%%mm3 \n\t"/* 4 ; a1=sum(even1) a0=sum(even0)*/\
- "pmaddwd 24+" #A3 ",%%mm1 \n\t"/* x6*w15+x4*w14 x6*w11+x4*w10*/\
- "movq %%mm3,%%mm4 \n\t"/* 4 ; a1 a0*/\
- "pmaddwd 48+" #A3 ",%%mm2 \n\t"/* x3*w29+x1*w28 x3*w25+x1*w24*/\
- "paddd %%mm7,%%mm6 \n\t"/* 7 ; b1=sum(odd1) b0=sum(odd0)*/\
- "pmaddwd 56+" #A3 ",%%mm5 \n\t"/* x7*w31+x5*w30 x7*w27+x5*w26*/\
- "paddd %%mm6,%%mm3 \n\t"/* a1+b1 a0+b0*/\
- "paddd " #A4 ",%%mm0 \n\t"/* +%4*/\
- "psrad $11,%%mm3 \n\t"/* y1=a1+b1 y0=a0+b0*/\
- "paddd %%mm1,%%mm0 \n\t"/* 1 ; a3=sum(even3) a2=sum(even2)*/\
- "psubd %%mm6,%%mm4 \n\t"/* 6 ; a1-b1 a0-b0*/\
- "movq %%mm0,%%mm7 \n\t"/* 7 ; a3 a2*/\
- "paddd %%mm5,%%mm2 \n\t"/* 5 ; b3=sum(odd3) b2=sum(odd2)*/\
- "paddd %%mm2,%%mm0 \n\t"/* a3+b3 a2+b2*/\
- "psrad $11,%%mm4 \n\t"/* y6=a1-b1 y7=a0-b0*/\
- "psubd %%mm2,%%mm7 \n\t"/* 2 ; a3-b3 a2-b2*/\
- "psrad $11,%%mm0 \n\t"/* y3=a3+b3 y2=a2+b2*/\
- "psrad $11,%%mm7 \n\t"/* y4=a3-b3 y5=a2-b2*/\
- "packssdw %%mm0,%%mm3 \n\t"/* 0 ; y3 y2 y1 y0*/\
- "packssdw %%mm4,%%mm7 \n\t"/* 4 ; y6 y7 y4 y5*/\
- "movq %%mm3, " #A2 " \n\t"/* 3 ; save y3 y2 y1 y0*/\
- "pshufw $0xb1,%%mm7,%%mm7 \n\t"/* y7 y6 y5 y4*/\
- "movq %%mm7,8 +" #A2 "\n\t"/* 7 ; save y7 y6 y5 y4*/\
-
-
-//-----------------------------------------------------------------------------
-//
-// The first stage DCT 8x8 - forward DCTs of columns
-//
-// The %2puts are multiplied
-// for rows 0,4 - on cos_4_16,
-// for rows 1,7 - on cos_1_16,
-// for rows 2,6 - on cos_2_16,
-// for rows 3,5 - on cos_3_16
-// and are shifted to the left for rise of accuracy
-//
-//-----------------------------------------------------------------------------
-//
-// The 8-point scaled forward DCT algorithm (26a8m)
-//
-//-----------------------------------------------------------------------------
-//
-// #define DCT_8_FRW_COL(x, y)
-//{
-// short t0, t1, t2, t3, t4, t5, t6, t7;
-// short tp03, tm03, tp12, tm12, tp65, tm65;
-// short tp465, tm465, tp765, tm765;
-//
-// t0 = LEFT_SHIFT ( x[0] + x[7] );
-// t1 = LEFT_SHIFT ( x[1] + x[6] );
-// t2 = LEFT_SHIFT ( x[2] + x[5] );
-// t3 = LEFT_SHIFT ( x[3] + x[4] );
-// t4 = LEFT_SHIFT ( x[3] - x[4] );
-// t5 = LEFT_SHIFT ( x[2] - x[5] );
-// t6 = LEFT_SHIFT ( x[1] - x[6] );
-// t7 = LEFT_SHIFT ( x[0] - x[7] );
-//
-// tp03 = t0 + t3;
-// tm03 = t0 - t3;
-// tp12 = t1 + t2;
-// tm12 = t1 - t2;
-//
-// y[0] = tp03 + tp12;
-// y[4] = tp03 - tp12;
-//
-// y[2] = tm03 + tm12 * tg_2_16;
-// y[6] = tm03 * tg_2_16 - tm12;
-//
-// tp65 =(t6 +t5 )*cos_4_16;
-// tm65 =(t6 -t5 )*cos_4_16;
-//
-// tp765 = t7 + tp65;
-// tm765 = t7 - tp65;
-// tp465 = t4 + tm65;
-// tm465 = t4 - tm65;
-//
-// y[1] = tp765 + tp465 * tg_1_16;
-// y[7] = tp765 * tg_1_16 - tp465;
-// y[5] = tm765 * tg_3_16 + tm465;
-// y[3] = tm765 - tm465 * tg_3_16;
-//}
-//
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// DCT_8_INV_COL_4 INP,OUT
-//-----------------------------------------------------------------------------
-
-#define DCT_8_INV_COL(A1,A2)\
- "movq 2*8(%3),%%mm0\n\t"\
- "movq 16*3+" #A1 ",%%mm3\n\t"\
- "movq %%mm0,%%mm1 \n\t"/* tg_3_16*/\
- "movq 16*5+" #A1 ",%%mm5\n\t"\
- "pmulhw %%mm3,%%mm0 \n\t"/* x3*(tg_3_16-1)*/\
- "movq (%3),%%mm4\n\t"\
- "pmulhw %%mm5,%%mm1 \n\t"/* x5*(tg_3_16-1)*/\
- "movq 16*7+" #A1 ",%%mm7\n\t"\
- "movq %%mm4,%%mm2 \n\t"/* tg_1_16*/\
- "movq 16*1+" #A1 ",%%mm6\n\t"\
- "pmulhw %%mm7,%%mm4 \n\t"/* x7*tg_1_16*/\
- "paddsw %%mm3,%%mm0 \n\t"/* x3*tg_3_16*/\
- "pmulhw %%mm6,%%mm2 \n\t"/* x1*tg_1_16*/\
- "paddsw %%mm3,%%mm1 \n\t"/* x3+x5*(tg_3_16-1)*/\
- "psubsw %%mm5,%%mm0 \n\t"/* x3*tg_3_16-x5 = tm35*/\
- "movq 3*8(%3),%%mm3\n\t"\
- "paddsw %%mm5,%%mm1 \n\t"/* x3+x5*tg_3_16 = tp35*/\
- "paddsw %%mm6,%%mm4 \n\t"/* x1+tg_1_16*x7 = tp17*/\
- "psubsw %%mm7,%%mm2 \n\t"/* x1*tg_1_16-x7 = tm17*/\
- "movq %%mm4,%%mm5 \n\t"/* tp17*/\
- "movq %%mm2,%%mm6 \n\t"/* tm17*/\
- "paddsw %%mm1,%%mm5 \n\t"/* tp17+tp35 = b0*/\
- "psubsw %%mm0,%%mm6 \n\t"/* tm17-tm35 = b3*/\
- "psubsw %%mm1,%%mm4 \n\t"/* tp17-tp35 = t1*/\
- "paddsw %%mm0,%%mm2 \n\t"/* tm17+tm35 = t2*/\
- "movq 1*8(%3),%%mm7\n\t"\
- "movq %%mm4,%%mm1 \n\t"/* t1*/\
- "movq %%mm5,3*16 +" #A2 "\n\t"/* save b0*/\
- "paddsw %%mm2,%%mm1 \n\t"/* t1+t2*/\
- "movq %%mm6,5*16 +" #A2 "\n\t"/* save b3*/\
- "psubsw %%mm2,%%mm4 \n\t"/* t1-t2*/\
- "movq 2*16+" #A1 ",%%mm5\n\t"\
- "movq %%mm7,%%mm0 \n\t"/* tg_2_16*/\
- "movq 6*16+" #A1 ",%%mm6\n\t"\
- "pmulhw %%mm5,%%mm0 \n\t"/* x2*tg_2_16*/\
- "pmulhw %%mm6,%%mm7 \n\t"/* x6*tg_2_16*/\
- "pmulhw %%mm3,%%mm1 \n\t"/* ocos_4_16*(t1+t2) = b1/2*/\
- "movq 0*16+" #A1 ",%%mm2\n\t"\
- "pmulhw %%mm3,%%mm4 \n\t"/* ocos_4_16*(t1-t2) = b2/2*/\
- "psubsw %%mm6,%%mm0 \n\t"/* t2*tg_2_16-x6 = tm26*/\
- "movq %%mm2,%%mm3 \n\t"/* x0*/\
- "movq 4*16+" #A1 ",%%mm6\n\t"\
- "paddsw %%mm5,%%mm7 \n\t"/* x2+x6*tg_2_16 = tp26*/\
- "paddsw %%mm6,%%mm2 \n\t"/* x0+x4 = tp04*/\
- "psubsw %%mm6,%%mm3 \n\t"/* x0-x4 = tm04*/\
- "movq %%mm2,%%mm5 \n\t"/* tp04*/\
- "movq %%mm3,%%mm6 \n\t"/* tm04*/\
- "psubsw %%mm7,%%mm2 \n\t"/* tp04-tp26 = a3*/\
- "paddsw %%mm0,%%mm3 \n\t"/* tm04+tm26 = a1*/\
- "paddsw %%mm1,%%mm1 \n\t"/* b1*/\
- "paddsw %%mm4,%%mm4 \n\t"/* b2*/\
- "paddsw %%mm7,%%mm5 \n\t"/* tp04+tp26 = a0*/\
- "psubsw %%mm0,%%mm6 \n\t"/* tm04-tm26 = a2*/\
- "movq %%mm3,%%mm7 \n\t"/* a1*/\
- "movq %%mm6,%%mm0 \n\t"/* a2*/\
- "paddsw %%mm1,%%mm3 \n\t"/* a1+b1*/\
- "paddsw %%mm4,%%mm6 \n\t"/* a2+b2*/\
- "psraw $6,%%mm3 \n\t"/* dst1*/\
- "psubsw %%mm1,%%mm7 \n\t"/* a1-b1*/\
- "psraw $6,%%mm6 \n\t"/* dst2*/\
- "psubsw %%mm4,%%mm0 \n\t"/* a2-b2*/\
- "movq 3*16+" #A2 ",%%mm1 \n\t"/* load b0*/\
- "psraw $6,%%mm7 \n\t"/* dst6*/\
- "movq %%mm5,%%mm4 \n\t"/* a0*/\
- "psraw $6,%%mm0 \n\t"/* dst5*/\
- "movq %%mm3,1*16+" #A2 "\n\t"\
- "paddsw %%mm1,%%mm5 \n\t"/* a0+b0*/\
- "movq %%mm6,2*16+" #A2 "\n\t"\
- "psubsw %%mm1,%%mm4 \n\t"/* a0-b0*/\
- "movq 5*16+" #A2 ",%%mm3 \n\t"/* load b3*/\
- "psraw $6,%%mm5 \n\t"/* dst0*/\
- "movq %%mm2,%%mm6 \n\t"/* a3*/\
- "psraw $6,%%mm4 \n\t"/* dst7*/\
- "movq %%mm0,5*16+" #A2 "\n\t"\
- "paddsw %%mm3,%%mm2 \n\t"/* a3+b3*/\
- "movq %%mm7,6*16+" #A2 "\n\t"\
- "psubsw %%mm3,%%mm6 \n\t"/* a3-b3*/\
- "movq %%mm5,0*16+" #A2 "\n\t"\
- "psraw $6,%%mm2 \n\t"/* dst3*/\
- "movq %%mm4,7*16+" #A2 "\n\t"\
- "psraw $6,%%mm6 \n\t"/* dst4*/\
- "movq %%mm2,3*16+" #A2 "\n\t"\
- "movq %%mm6,4*16+" #A2 "\n\t"
-
-//=============================================================================
-// Code
-//=============================================================================
-
-//-----------------------------------------------------------------------------
-// void idct_mmx(uint16_t block[64]);
-//-----------------------------------------------------------------------------
-
-
-void ff_idct_xvid_mmx(short *block){
-asm volatile(
- //# Process each row
- DCT_8_INV_ROW_MMX(0*16(%0), 0*16(%0), 64*0(%2), 8*0(%1))
- DCT_8_INV_ROW_MMX(1*16(%0), 1*16(%0), 64*1(%2), 8*1(%1))
- DCT_8_INV_ROW_MMX(2*16(%0), 2*16(%0), 64*2(%2), 8*2(%1))
- DCT_8_INV_ROW_MMX(3*16(%0), 3*16(%0), 64*3(%2), 8*3(%1))
- DCT_8_INV_ROW_MMX(4*16(%0), 4*16(%0), 64*0(%2), 8*4(%1))
- DCT_8_INV_ROW_MMX(5*16(%0), 5*16(%0), 64*3(%2), 8*5(%1))
- DCT_8_INV_ROW_MMX(6*16(%0), 6*16(%0), 64*2(%2), 8*6(%1))
- DCT_8_INV_ROW_MMX(7*16(%0), 7*16(%0), 64*1(%2), 8*7(%1))
-
- //# Process the columns (4 at a time)
- DCT_8_INV_COL(0(%0), 0(%0))
- DCT_8_INV_COL(8(%0), 8(%0))
- :: "r"(block), "r"(rounder_0), "r"(tab_i_04_mmx), "r"(tg_1_16));
-}
-
-//-----------------------------------------------------------------------------
-// void idct_xmm(uint16_t block[64]);
-//-----------------------------------------------------------------------------
-
-
-void ff_idct_xvid_mmx2(short *block){
-asm volatile(
- //# Process each row
- DCT_8_INV_ROW_XMM(0*16(%0), 0*16(%0), 64*0(%2), 8*0(%1))
- DCT_8_INV_ROW_XMM(1*16(%0), 1*16(%0), 64*1(%2), 8*1(%1))
- DCT_8_INV_ROW_XMM(2*16(%0), 2*16(%0), 64*2(%2), 8*2(%1))
- DCT_8_INV_ROW_XMM(3*16(%0), 3*16(%0), 64*3(%2), 8*3(%1))
- DCT_8_INV_ROW_XMM(4*16(%0), 4*16(%0), 64*0(%2), 8*4(%1))
- DCT_8_INV_ROW_XMM(5*16(%0), 5*16(%0), 64*3(%2), 8*5(%1))
- DCT_8_INV_ROW_XMM(6*16(%0), 6*16(%0), 64*2(%2), 8*6(%1))
- DCT_8_INV_ROW_XMM(7*16(%0), 7*16(%0), 64*1(%2), 8*7(%1))
-
- //# Process the columns (4 at a time)
- DCT_8_INV_COL(0(%0), 0(%0))
- DCT_8_INV_COL(8(%0), 8(%0))
- :: "r"(block), "r"(rounder_0), "r"(tab_i_04_xmm), "r"(tg_1_16));
-}
-
diff --git a/src/libffmpeg/libavcodec/i386/libavcodec_mmx_dummy.c b/src/libffmpeg/libavcodec/i386/libavcodec_mmx_dummy.c
deleted file mode 100644
index 04a6fc298..000000000
--- a/src/libffmpeg/libavcodec/i386/libavcodec_mmx_dummy.c
+++ /dev/null
@@ -1,2 +0,0 @@
-
-char libavcodec_mmx_dummy;
diff --git a/src/libffmpeg/libavcodec/i386/mathops.h b/src/libffmpeg/libavcodec/i386/mathops.h
deleted file mode 100644
index 3553a4025..000000000
--- a/src/libffmpeg/libavcodec/i386/mathops.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * simple math operations
- * Copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at> et al
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifdef FRAC_BITS
-# define MULL(ra, rb) \
- ({ int rt, dummy; asm (\
- "imull %3 \n\t"\
- "shrdl %4, %%edx, %%eax \n\t"\
- : "=a"(rt), "=d"(dummy)\
- : "a" (ra), "rm" (rb), "i"(FRAC_BITS));\
- rt; })
-#endif
-
-#define MULH(ra, rb) \
- ({ int rt, dummy;\
- asm ("imull %3\n\t" : "=d"(rt), "=a"(dummy): "a" (ra), "rm" (rb));\
- rt; })
-
-#define MUL64(ra, rb) \
- ({ int64_t rt;\
- asm ("imull %2\n\t" : "=A"(rt) : "a" (ra), "g" (rb));\
- rt; })
-
diff --git a/src/libffmpeg/libavcodec/i386/mmx.h b/src/libffmpeg/libavcodec/i386/mmx.h
deleted file mode 100644
index 41aae6c21..000000000
--- a/src/libffmpeg/libavcodec/i386/mmx.h
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- * mmx.h
- * Copyright (C) 1997-2001 H. Dietz and R. Fisher
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#ifndef AVCODEC_I386MMX_H
-#define AVCODEC_I386MMX_H
-
-/*
- * The type of an value that fits in an MMX register (note that long
- * long constant values MUST be suffixed by LL and unsigned long long
- * values by ULL, lest they be truncated by the compiler)
- */
-
-typedef union {
- long long q; /* Quadword (64-bit) value */
- unsigned long long uq; /* Unsigned Quadword */
- int d[2]; /* 2 Doubleword (32-bit) values */
- unsigned int ud[2]; /* 2 Unsigned Doubleword */
- short w[4]; /* 4 Word (16-bit) values */
- unsigned short uw[4]; /* 4 Unsigned Word */
- char b[8]; /* 8 Byte (8-bit) values */
- unsigned char ub[8]; /* 8 Unsigned Byte */
- float s[2]; /* Single-precision (32-bit) value */
-} mmx_t; /* On an 8-byte (64-bit) boundary */
-
-
-#define mmx_i2r(op,imm,reg) \
- __asm__ __volatile__ (#op " %0, %%" #reg \
- : /* nothing */ \
- : "i" (imm) )
-
-#define mmx_m2r(op,mem,reg) \
- __asm__ __volatile__ (#op " %0, %%" #reg \
- : /* nothing */ \
- : "m" (mem))
-
-#define mmx_r2m(op,reg,mem) \
- __asm__ __volatile__ (#op " %%" #reg ", %0" \
- : "=m" (mem) \
- : /* nothing */ )
-
-#define mmx_r2r(op,regs,regd) \
- __asm__ __volatile__ (#op " %" #regs ", %" #regd)
-
-
-#define emms() __asm__ __volatile__ ("emms")
-
-#define movd_m2r(var,reg) mmx_m2r (movd, var, reg)
-#define movd_r2m(reg,var) mmx_r2m (movd, reg, var)
-#define movd_r2r(regs,regd) mmx_r2r (movd, regs, regd)
-
-#define movq_m2r(var,reg) mmx_m2r (movq, var, reg)
-#define movq_r2m(reg,var) mmx_r2m (movq, reg, var)
-#define movq_r2r(regs,regd) mmx_r2r (movq, regs, regd)
-
-#define packssdw_m2r(var,reg) mmx_m2r (packssdw, var, reg)
-#define packssdw_r2r(regs,regd) mmx_r2r (packssdw, regs, regd)
-#define packsswb_m2r(var,reg) mmx_m2r (packsswb, var, reg)
-#define packsswb_r2r(regs,regd) mmx_r2r (packsswb, regs, regd)
-
-#define packuswb_m2r(var,reg) mmx_m2r (packuswb, var, reg)
-#define packuswb_r2r(regs,regd) mmx_r2r (packuswb, regs, regd)
-
-#define paddb_m2r(var,reg) mmx_m2r (paddb, var, reg)
-#define paddb_r2r(regs,regd) mmx_r2r (paddb, regs, regd)
-#define paddd_m2r(var,reg) mmx_m2r (paddd, var, reg)
-#define paddd_r2r(regs,regd) mmx_r2r (paddd, regs, regd)
-#define paddw_m2r(var,reg) mmx_m2r (paddw, var, reg)
-#define paddw_r2r(regs,regd) mmx_r2r (paddw, regs, regd)
-
-#define paddsb_m2r(var,reg) mmx_m2r (paddsb, var, reg)
-#define paddsb_r2r(regs,regd) mmx_r2r (paddsb, regs, regd)
-#define paddsw_m2r(var,reg) mmx_m2r (paddsw, var, reg)
-#define paddsw_r2r(regs,regd) mmx_r2r (paddsw, regs, regd)
-
-#define paddusb_m2r(var,reg) mmx_m2r (paddusb, var, reg)
-#define paddusb_r2r(regs,regd) mmx_r2r (paddusb, regs, regd)
-#define paddusw_m2r(var,reg) mmx_m2r (paddusw, var, reg)
-#define paddusw_r2r(regs,regd) mmx_r2r (paddusw, regs, regd)
-
-#define pand_m2r(var,reg) mmx_m2r (pand, var, reg)
-#define pand_r2r(regs,regd) mmx_r2r (pand, regs, regd)
-
-#define pandn_m2r(var,reg) mmx_m2r (pandn, var, reg)
-#define pandn_r2r(regs,regd) mmx_r2r (pandn, regs, regd)
-
-#define pcmpeqb_m2r(var,reg) mmx_m2r (pcmpeqb, var, reg)
-#define pcmpeqb_r2r(regs,regd) mmx_r2r (pcmpeqb, regs, regd)
-#define pcmpeqd_m2r(var,reg) mmx_m2r (pcmpeqd, var, reg)
-#define pcmpeqd_r2r(regs,regd) mmx_r2r (pcmpeqd, regs, regd)
-#define pcmpeqw_m2r(var,reg) mmx_m2r (pcmpeqw, var, reg)
-#define pcmpeqw_r2r(regs,regd) mmx_r2r (pcmpeqw, regs, regd)
-
-#define pcmpgtb_m2r(var,reg) mmx_m2r (pcmpgtb, var, reg)
-#define pcmpgtb_r2r(regs,regd) mmx_r2r (pcmpgtb, regs, regd)
-#define pcmpgtd_m2r(var,reg) mmx_m2r (pcmpgtd, var, reg)
-#define pcmpgtd_r2r(regs,regd) mmx_r2r (pcmpgtd, regs, regd)
-#define pcmpgtw_m2r(var,reg) mmx_m2r (pcmpgtw, var, reg)
-#define pcmpgtw_r2r(regs,regd) mmx_r2r (pcmpgtw, regs, regd)
-
-#define pmaddwd_m2r(var,reg) mmx_m2r (pmaddwd, var, reg)
-#define pmaddwd_r2r(regs,regd) mmx_r2r (pmaddwd, regs, regd)
-
-#define pmulhw_m2r(var,reg) mmx_m2r (pmulhw, var, reg)
-#define pmulhw_r2r(regs,regd) mmx_r2r (pmulhw, regs, regd)
-
-#define pmullw_m2r(var,reg) mmx_m2r (pmullw, var, reg)
-#define pmullw_r2r(regs,regd) mmx_r2r (pmullw, regs, regd)
-
-#define por_m2r(var,reg) mmx_m2r (por, var, reg)
-#define por_r2r(regs,regd) mmx_r2r (por, regs, regd)
-
-#define pslld_i2r(imm,reg) mmx_i2r (pslld, imm, reg)
-#define pslld_m2r(var,reg) mmx_m2r (pslld, var, reg)
-#define pslld_r2r(regs,regd) mmx_r2r (pslld, regs, regd)
-#define psllq_i2r(imm,reg) mmx_i2r (psllq, imm, reg)
-#define psllq_m2r(var,reg) mmx_m2r (psllq, var, reg)
-#define psllq_r2r(regs,regd) mmx_r2r (psllq, regs, regd)
-#define psllw_i2r(imm,reg) mmx_i2r (psllw, imm, reg)
-#define psllw_m2r(var,reg) mmx_m2r (psllw, var, reg)
-#define psllw_r2r(regs,regd) mmx_r2r (psllw, regs, regd)
-
-#define psrad_i2r(imm,reg) mmx_i2r (psrad, imm, reg)
-#define psrad_m2r(var,reg) mmx_m2r (psrad, var, reg)
-#define psrad_r2r(regs,regd) mmx_r2r (psrad, regs, regd)
-#define psraw_i2r(imm,reg) mmx_i2r (psraw, imm, reg)
-#define psraw_m2r(var,reg) mmx_m2r (psraw, var, reg)
-#define psraw_r2r(regs,regd) mmx_r2r (psraw, regs, regd)
-
-#define psrld_i2r(imm,reg) mmx_i2r (psrld, imm, reg)
-#define psrld_m2r(var,reg) mmx_m2r (psrld, var, reg)
-#define psrld_r2r(regs,regd) mmx_r2r (psrld, regs, regd)
-#define psrlq_i2r(imm,reg) mmx_i2r (psrlq, imm, reg)
-#define psrlq_m2r(var,reg) mmx_m2r (psrlq, var, reg)
-#define psrlq_r2r(regs,regd) mmx_r2r (psrlq, regs, regd)
-#define psrlw_i2r(imm,reg) mmx_i2r (psrlw, imm, reg)
-#define psrlw_m2r(var,reg) mmx_m2r (psrlw, var, reg)
-#define psrlw_r2r(regs,regd) mmx_r2r (psrlw, regs, regd)
-
-#define psubb_m2r(var,reg) mmx_m2r (psubb, var, reg)
-#define psubb_r2r(regs,regd) mmx_r2r (psubb, regs, regd)
-#define psubd_m2r(var,reg) mmx_m2r (psubd, var, reg)
-#define psubd_r2r(regs,regd) mmx_r2r (psubd, regs, regd)
-#define psubw_m2r(var,reg) mmx_m2r (psubw, var, reg)
-#define psubw_r2r(regs,regd) mmx_r2r (psubw, regs, regd)
-
-#define psubsb_m2r(var,reg) mmx_m2r (psubsb, var, reg)
-#define psubsb_r2r(regs,regd) mmx_r2r (psubsb, regs, regd)
-#define psubsw_m2r(var,reg) mmx_m2r (psubsw, var, reg)
-#define psubsw_r2r(regs,regd) mmx_r2r (psubsw, regs, regd)
-
-#define psubusb_m2r(var,reg) mmx_m2r (psubusb, var, reg)
-#define psubusb_r2r(regs,regd) mmx_r2r (psubusb, regs, regd)
-#define psubusw_m2r(var,reg) mmx_m2r (psubusw, var, reg)
-#define psubusw_r2r(regs,regd) mmx_r2r (psubusw, regs, regd)
-
-#define punpckhbw_m2r(var,reg) mmx_m2r (punpckhbw, var, reg)
-#define punpckhbw_r2r(regs,regd) mmx_r2r (punpckhbw, regs, regd)
-#define punpckhdq_m2r(var,reg) mmx_m2r (punpckhdq, var, reg)
-#define punpckhdq_r2r(regs,regd) mmx_r2r (punpckhdq, regs, regd)
-#define punpckhwd_m2r(var,reg) mmx_m2r (punpckhwd, var, reg)
-#define punpckhwd_r2r(regs,regd) mmx_r2r (punpckhwd, regs, regd)
-
-#define punpcklbw_m2r(var,reg) mmx_m2r (punpcklbw, var, reg)
-#define punpcklbw_r2r(regs,regd) mmx_r2r (punpcklbw, regs, regd)
-#define punpckldq_m2r(var,reg) mmx_m2r (punpckldq, var, reg)
-#define punpckldq_r2r(regs,regd) mmx_r2r (punpckldq, regs, regd)
-#define punpcklwd_m2r(var,reg) mmx_m2r (punpcklwd, var, reg)
-#define punpcklwd_r2r(regs,regd) mmx_r2r (punpcklwd, regs, regd)
-
-#define pxor_m2r(var,reg) mmx_m2r (pxor, var, reg)
-#define pxor_r2r(regs,regd) mmx_r2r (pxor, regs, regd)
-
-
-/* 3DNOW extensions */
-
-#define pavgusb_m2r(var,reg) mmx_m2r (pavgusb, var, reg)
-#define pavgusb_r2r(regs,regd) mmx_r2r (pavgusb, regs, regd)
-
-
-/* AMD MMX extensions - also available in intel SSE */
-
-
-#define mmx_m2ri(op,mem,reg,imm) \
- __asm__ __volatile__ (#op " %1, %0, %%" #reg \
- : /* nothing */ \
- : "m" (mem), "i" (imm))
-#define mmx_r2ri(op,regs,regd,imm) \
- __asm__ __volatile__ (#op " %0, %%" #regs ", %%" #regd \
- : /* nothing */ \
- : "i" (imm) )
-
-#define mmx_fetch(mem,hint) \
- __asm__ __volatile__ ("prefetch" #hint " %0" \
- : /* nothing */ \
- : "m" (mem))
-
-
-#define maskmovq(regs,maskreg) mmx_r2ri (maskmovq, regs, maskreg)
-
-#define movntq_r2m(mmreg,var) mmx_r2m (movntq, mmreg, var)
-
-#define pavgb_m2r(var,reg) mmx_m2r (pavgb, var, reg)
-#define pavgb_r2r(regs,regd) mmx_r2r (pavgb, regs, regd)
-#define pavgw_m2r(var,reg) mmx_m2r (pavgw, var, reg)
-#define pavgw_r2r(regs,regd) mmx_r2r (pavgw, regs, regd)
-
-#define pextrw_r2r(mmreg,reg,imm) mmx_r2ri (pextrw, mmreg, reg, imm)
-
-#define pinsrw_r2r(reg,mmreg,imm) mmx_r2ri (pinsrw, reg, mmreg, imm)
-
-#define pmaxsw_m2r(var,reg) mmx_m2r (pmaxsw, var, reg)
-#define pmaxsw_r2r(regs,regd) mmx_r2r (pmaxsw, regs, regd)
-
-#define pmaxub_m2r(var,reg) mmx_m2r (pmaxub, var, reg)
-#define pmaxub_r2r(regs,regd) mmx_r2r (pmaxub, regs, regd)
-
-#define pminsw_m2r(var,reg) mmx_m2r (pminsw, var, reg)
-#define pminsw_r2r(regs,regd) mmx_r2r (pminsw, regs, regd)
-
-#define pminub_m2r(var,reg) mmx_m2r (pminub, var, reg)
-#define pminub_r2r(regs,regd) mmx_r2r (pminub, regs, regd)
-
-#define pmovmskb(mmreg,reg) \
- __asm__ __volatile__ ("movmskps %" #mmreg ", %" #reg)
-
-#define pmulhuw_m2r(var,reg) mmx_m2r (pmulhuw, var, reg)
-#define pmulhuw_r2r(regs,regd) mmx_r2r (pmulhuw, regs, regd)
-
-#define prefetcht0(mem) mmx_fetch (mem, t0)
-#define prefetcht1(mem) mmx_fetch (mem, t1)
-#define prefetcht2(mem) mmx_fetch (mem, t2)
-#define prefetchnta(mem) mmx_fetch (mem, nta)
-
-#define psadbw_m2r(var,reg) mmx_m2r (psadbw, var, reg)
-#define psadbw_r2r(regs,regd) mmx_r2r (psadbw, regs, regd)
-
-#define pshufw_m2r(var,reg,imm) mmx_m2ri(pshufw, var, reg, imm)
-#define pshufw_r2r(regs,regd,imm) mmx_r2ri(pshufw, regs, regd, imm)
-
-#define sfence() __asm__ __volatile__ ("sfence\n\t")
-
-/* SSE2 */
-#define pshufhw_m2r(var,reg,imm) mmx_m2ri(pshufhw, var, reg, imm)
-#define pshufhw_r2r(regs,regd,imm) mmx_r2ri(pshufhw, regs, regd, imm)
-#define pshuflw_m2r(var,reg,imm) mmx_m2ri(pshuflw, var, reg, imm)
-#define pshuflw_r2r(regs,regd,imm) mmx_r2ri(pshuflw, regs, regd, imm)
-
-#define pshufd_r2r(regs,regd,imm) mmx_r2ri(pshufd, regs, regd, imm)
-
-#define movdqa_m2r(var,reg) mmx_m2r (movdqa, var, reg)
-#define movdqa_r2m(reg,var) mmx_r2m (movdqa, reg, var)
-#define movdqa_r2r(regs,regd) mmx_r2r (movdqa, regs, regd)
-#define movdqu_m2r(var,reg) mmx_m2r (movdqu, var, reg)
-#define movdqu_r2m(reg,var) mmx_r2m (movdqu, reg, var)
-#define movdqu_r2r(regs,regd) mmx_r2r (movdqu, regs, regd)
-
-#define pmullw_r2m(reg,var) mmx_r2m (pmullw, reg, var)
-
-#define pslldq_i2r(imm,reg) mmx_i2r (pslldq, imm, reg)
-#define psrldq_i2r(imm,reg) mmx_i2r (psrldq, imm, reg)
-
-#define punpcklqdq_r2r(regs,regd) mmx_r2r (punpcklqdq, regs, regd)
-#define punpckhqdq_r2r(regs,regd) mmx_r2r (punpckhqdq, regs, regd)
-
-
-#endif /* AVCODEC_I386MMX_H */
diff --git a/src/libffmpeg/libavcodec/i386/motion_est_mmx.c b/src/libffmpeg/libavcodec/i386/motion_est_mmx.c
deleted file mode 100644
index e33870e0f..000000000
--- a/src/libffmpeg/libavcodec/i386/motion_est_mmx.c
+++ /dev/null
@@ -1,408 +0,0 @@
-/*
- * MMX optimized motion estimation
- * Copyright (c) 2001 Fabrice Bellard.
- * Copyright (c) 2002-2004 Michael Niedermayer
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * mostly by Michael Niedermayer <michaelni@gmx.at>
- */
-#include "../dsputil.h"
-#include "x86_cpu.h"
-
-static const __attribute__ ((aligned(8))) uint64_t round_tab[3]={
-0x0000000000000000ULL,
-0x0001000100010001ULL,
-0x0002000200020002ULL,
-};
-
-static attribute_used __attribute__ ((aligned(8))) uint64_t bone= 0x0101010101010101LL;
-
-static inline void sad8_1_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h)
-{
- long len= -(stride*h);
- asm volatile(
- ASMALIGN(4)
- "1: \n\t"
- "movq (%1, %%"REG_a"), %%mm0 \n\t"
- "movq (%2, %%"REG_a"), %%mm2 \n\t"
- "movq (%2, %%"REG_a"), %%mm4 \n\t"
- "add %3, %%"REG_a" \n\t"
- "psubusb %%mm0, %%mm2 \n\t"
- "psubusb %%mm4, %%mm0 \n\t"
- "movq (%1, %%"REG_a"), %%mm1 \n\t"
- "movq (%2, %%"REG_a"), %%mm3 \n\t"
- "movq (%2, %%"REG_a"), %%mm5 \n\t"
- "psubusb %%mm1, %%mm3 \n\t"
- "psubusb %%mm5, %%mm1 \n\t"
- "por %%mm2, %%mm0 \n\t"
- "por %%mm1, %%mm3 \n\t"
- "movq %%mm0, %%mm1 \n\t"
- "movq %%mm3, %%mm2 \n\t"
- "punpcklbw %%mm7, %%mm0 \n\t"
- "punpckhbw %%mm7, %%mm1 \n\t"
- "punpcklbw %%mm7, %%mm3 \n\t"
- "punpckhbw %%mm7, %%mm2 \n\t"
- "paddw %%mm1, %%mm0 \n\t"
- "paddw %%mm3, %%mm2 \n\t"
- "paddw %%mm2, %%mm0 \n\t"
- "paddw %%mm0, %%mm6 \n\t"
- "add %3, %%"REG_a" \n\t"
- " js 1b \n\t"
- : "+a" (len)
- : "r" (blk1 - len), "r" (blk2 - len), "r" ((long)stride)
- );
-}
-
-static inline void sad8_1_mmx2(uint8_t *blk1, uint8_t *blk2, int stride, int h)
-{
- long len= -(stride*h);
- asm volatile(
- ASMALIGN(4)
- "1: \n\t"
- "movq (%1, %%"REG_a"), %%mm0 \n\t"
- "movq (%2, %%"REG_a"), %%mm2 \n\t"
- "psadbw %%mm2, %%mm0 \n\t"
- "add %3, %%"REG_a" \n\t"
- "movq (%1, %%"REG_a"), %%mm1 \n\t"
- "movq (%2, %%"REG_a"), %%mm3 \n\t"
- "psadbw %%mm1, %%mm3 \n\t"
- "paddw %%mm3, %%mm0 \n\t"
- "paddw %%mm0, %%mm6 \n\t"
- "add %3, %%"REG_a" \n\t"
- " js 1b \n\t"
- : "+a" (len)
- : "r" (blk1 - len), "r" (blk2 - len), "r" ((long)stride)
- );
-}
-
-static inline void sad8_2_mmx2(uint8_t *blk1a, uint8_t *blk1b, uint8_t *blk2, int stride, int h)
-{
- long len= -(stride*h);
- asm volatile(
- ASMALIGN(4)
- "1: \n\t"
- "movq (%1, %%"REG_a"), %%mm0 \n\t"
- "movq (%2, %%"REG_a"), %%mm2 \n\t"
- "pavgb %%mm2, %%mm0 \n\t"
- "movq (%3, %%"REG_a"), %%mm2 \n\t"
- "psadbw %%mm2, %%mm0 \n\t"
- "add %4, %%"REG_a" \n\t"
- "movq (%1, %%"REG_a"), %%mm1 \n\t"
- "movq (%2, %%"REG_a"), %%mm3 \n\t"
- "pavgb %%mm1, %%mm3 \n\t"
- "movq (%3, %%"REG_a"), %%mm1 \n\t"
- "psadbw %%mm1, %%mm3 \n\t"
- "paddw %%mm3, %%mm0 \n\t"
- "paddw %%mm0, %%mm6 \n\t"
- "add %4, %%"REG_a" \n\t"
- " js 1b \n\t"
- : "+a" (len)
- : "r" (blk1a - len), "r" (blk1b -len), "r" (blk2 - len), "r" ((long)stride)
- );
-}
-
-static inline void sad8_4_mmx2(uint8_t *blk1, uint8_t *blk2, int stride, int h)
-{ //FIXME reuse src
- long len= -(stride*h);
- asm volatile(
- ASMALIGN(4)
- "movq "MANGLE(bone)", %%mm5 \n\t"
- "1: \n\t"
- "movq (%1, %%"REG_a"), %%mm0 \n\t"
- "movq (%2, %%"REG_a"), %%mm2 \n\t"
- "movq 1(%1, %%"REG_a"), %%mm1 \n\t"
- "movq 1(%2, %%"REG_a"), %%mm3 \n\t"
- "pavgb %%mm2, %%mm0 \n\t"
- "pavgb %%mm1, %%mm3 \n\t"
- "psubusb %%mm5, %%mm3 \n\t"
- "pavgb %%mm3, %%mm0 \n\t"
- "movq (%3, %%"REG_a"), %%mm2 \n\t"
- "psadbw %%mm2, %%mm0 \n\t"
- "add %4, %%"REG_a" \n\t"
- "movq (%1, %%"REG_a"), %%mm1 \n\t"
- "movq (%2, %%"REG_a"), %%mm3 \n\t"
- "movq 1(%1, %%"REG_a"), %%mm2 \n\t"
- "movq 1(%2, %%"REG_a"), %%mm4 \n\t"
- "pavgb %%mm3, %%mm1 \n\t"
- "pavgb %%mm4, %%mm2 \n\t"
- "psubusb %%mm5, %%mm2 \n\t"
- "pavgb %%mm1, %%mm2 \n\t"
- "movq (%3, %%"REG_a"), %%mm1 \n\t"
- "psadbw %%mm1, %%mm2 \n\t"
- "paddw %%mm2, %%mm0 \n\t"
- "paddw %%mm0, %%mm6 \n\t"
- "add %4, %%"REG_a" \n\t"
- " js 1b \n\t"
- : "+a" (len)
- : "r" (blk1 - len), "r" (blk1 - len + stride), "r" (blk2 - len), "r" ((long)stride)
- );
-}
-
-static inline void sad8_2_mmx(uint8_t *blk1a, uint8_t *blk1b, uint8_t *blk2, int stride, int h)
-{
- long len= -(stride*h);
- asm volatile(
- ASMALIGN(4)
- "1: \n\t"
- "movq (%1, %%"REG_a"), %%mm0 \n\t"
- "movq (%2, %%"REG_a"), %%mm1 \n\t"
- "movq (%1, %%"REG_a"), %%mm2 \n\t"
- "movq (%2, %%"REG_a"), %%mm3 \n\t"
- "punpcklbw %%mm7, %%mm0 \n\t"
- "punpcklbw %%mm7, %%mm1 \n\t"
- "punpckhbw %%mm7, %%mm2 \n\t"
- "punpckhbw %%mm7, %%mm3 \n\t"
- "paddw %%mm0, %%mm1 \n\t"
- "paddw %%mm2, %%mm3 \n\t"
- "movq (%3, %%"REG_a"), %%mm4 \n\t"
- "movq (%3, %%"REG_a"), %%mm2 \n\t"
- "paddw %%mm5, %%mm1 \n\t"
- "paddw %%mm5, %%mm3 \n\t"
- "psrlw $1, %%mm1 \n\t"
- "psrlw $1, %%mm3 \n\t"
- "packuswb %%mm3, %%mm1 \n\t"
- "psubusb %%mm1, %%mm4 \n\t"
- "psubusb %%mm2, %%mm1 \n\t"
- "por %%mm4, %%mm1 \n\t"
- "movq %%mm1, %%mm0 \n\t"
- "punpcklbw %%mm7, %%mm0 \n\t"
- "punpckhbw %%mm7, %%mm1 \n\t"
- "paddw %%mm1, %%mm0 \n\t"
- "paddw %%mm0, %%mm6 \n\t"
- "add %4, %%"REG_a" \n\t"
- " js 1b \n\t"
- : "+a" (len)
- : "r" (blk1a - len), "r" (blk1b -len), "r" (blk2 - len), "r" ((long)stride)
- );
-}
-
-static inline void sad8_4_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h)
-{
- long len= -(stride*h);
- asm volatile(
- ASMALIGN(4)
- "1: \n\t"
- "movq (%1, %%"REG_a"), %%mm0 \n\t"
- "movq (%2, %%"REG_a"), %%mm1 \n\t"
- "movq %%mm0, %%mm4 \n\t"
- "movq %%mm1, %%mm2 \n\t"
- "punpcklbw %%mm7, %%mm0 \n\t"
- "punpcklbw %%mm7, %%mm1 \n\t"
- "punpckhbw %%mm7, %%mm4 \n\t"
- "punpckhbw %%mm7, %%mm2 \n\t"
- "paddw %%mm1, %%mm0 \n\t"
- "paddw %%mm2, %%mm4 \n\t"
- "movq 1(%1, %%"REG_a"), %%mm2 \n\t"
- "movq 1(%2, %%"REG_a"), %%mm3 \n\t"
- "movq %%mm2, %%mm1 \n\t"
- "punpcklbw %%mm7, %%mm2 \n\t"
- "punpckhbw %%mm7, %%mm1 \n\t"
- "paddw %%mm0, %%mm2 \n\t"
- "paddw %%mm4, %%mm1 \n\t"
- "movq %%mm3, %%mm4 \n\t"
- "punpcklbw %%mm7, %%mm3 \n\t"
- "punpckhbw %%mm7, %%mm4 \n\t"
- "paddw %%mm3, %%mm2 \n\t"
- "paddw %%mm4, %%mm1 \n\t"
- "movq (%3, %%"REG_a"), %%mm3 \n\t"
- "movq (%3, %%"REG_a"), %%mm4 \n\t"
- "paddw %%mm5, %%mm2 \n\t"
- "paddw %%mm5, %%mm1 \n\t"
- "psrlw $2, %%mm2 \n\t"
- "psrlw $2, %%mm1 \n\t"
- "packuswb %%mm1, %%mm2 \n\t"
- "psubusb %%mm2, %%mm3 \n\t"
- "psubusb %%mm4, %%mm2 \n\t"
- "por %%mm3, %%mm2 \n\t"
- "movq %%mm2, %%mm0 \n\t"
- "punpcklbw %%mm7, %%mm0 \n\t"
- "punpckhbw %%mm7, %%mm2 \n\t"
- "paddw %%mm2, %%mm0 \n\t"
- "paddw %%mm0, %%mm6 \n\t"
- "add %4, %%"REG_a" \n\t"
- " js 1b \n\t"
- : "+a" (len)
- : "r" (blk1 - len), "r" (blk1 -len + stride), "r" (blk2 - len), "r" ((long)stride)
- );
-}
-
-static inline int sum_mmx(void)
-{
- int ret;
- asm volatile(
- "movq %%mm6, %%mm0 \n\t"
- "psrlq $32, %%mm6 \n\t"
- "paddw %%mm0, %%mm6 \n\t"
- "movq %%mm6, %%mm0 \n\t"
- "psrlq $16, %%mm6 \n\t"
- "paddw %%mm0, %%mm6 \n\t"
- "movd %%mm6, %0 \n\t"
- : "=r" (ret)
- );
- return ret&0xFFFF;
-}
-
-static inline int sum_mmx2(void)
-{
- int ret;
- asm volatile(
- "movd %%mm6, %0 \n\t"
- : "=r" (ret)
- );
- return ret;
-}
-
-
-#define PIX_SAD(suf)\
-static int sad8_ ## suf(void *v, uint8_t *blk2, uint8_t *blk1, int stride, int h)\
-{\
- assert(h==8);\
- asm volatile("pxor %%mm7, %%mm7 \n\t"\
- "pxor %%mm6, %%mm6 \n\t":);\
-\
- sad8_1_ ## suf(blk1, blk2, stride, 8);\
-\
- return sum_ ## suf();\
-}\
-static int sad8_x2_ ## suf(void *v, uint8_t *blk2, uint8_t *blk1, int stride, int h)\
-{\
- assert(h==8);\
- asm volatile("pxor %%mm7, %%mm7 \n\t"\
- "pxor %%mm6, %%mm6 \n\t"\
- "movq %0, %%mm5 \n\t"\
- :: "m"(round_tab[1]) \
- );\
-\
- sad8_2_ ## suf(blk1, blk1+1, blk2, stride, 8);\
-\
- return sum_ ## suf();\
-}\
-\
-static int sad8_y2_ ## suf(void *v, uint8_t *blk2, uint8_t *blk1, int stride, int h)\
-{\
- assert(h==8);\
- asm volatile("pxor %%mm7, %%mm7 \n\t"\
- "pxor %%mm6, %%mm6 \n\t"\
- "movq %0, %%mm5 \n\t"\
- :: "m"(round_tab[1]) \
- );\
-\
- sad8_2_ ## suf(blk1, blk1+stride, blk2, stride, 8);\
-\
- return sum_ ## suf();\
-}\
-\
-static int sad8_xy2_ ## suf(void *v, uint8_t *blk2, uint8_t *blk1, int stride, int h)\
-{\
- assert(h==8);\
- asm volatile("pxor %%mm7, %%mm7 \n\t"\
- "pxor %%mm6, %%mm6 \n\t"\
- "movq %0, %%mm5 \n\t"\
- :: "m"(round_tab[2]) \
- );\
-\
- sad8_4_ ## suf(blk1, blk2, stride, 8);\
-\
- return sum_ ## suf();\
-}\
-\
-static int sad16_ ## suf(void *v, uint8_t *blk2, uint8_t *blk1, int stride, int h)\
-{\
- asm volatile("pxor %%mm7, %%mm7 \n\t"\
- "pxor %%mm6, %%mm6 \n\t":);\
-\
- sad8_1_ ## suf(blk1 , blk2 , stride, h);\
- sad8_1_ ## suf(blk1+8, blk2+8, stride, h);\
-\
- return sum_ ## suf();\
-}\
-static int sad16_x2_ ## suf(void *v, uint8_t *blk2, uint8_t *blk1, int stride, int h)\
-{\
- asm volatile("pxor %%mm7, %%mm7 \n\t"\
- "pxor %%mm6, %%mm6 \n\t"\
- "movq %0, %%mm5 \n\t"\
- :: "m"(round_tab[1]) \
- );\
-\
- sad8_2_ ## suf(blk1 , blk1+1, blk2 , stride, h);\
- sad8_2_ ## suf(blk1+8, blk1+9, blk2+8, stride, h);\
-\
- return sum_ ## suf();\
-}\
-static int sad16_y2_ ## suf(void *v, uint8_t *blk2, uint8_t *blk1, int stride, int h)\
-{\
- asm volatile("pxor %%mm7, %%mm7 \n\t"\
- "pxor %%mm6, %%mm6 \n\t"\
- "movq %0, %%mm5 \n\t"\
- :: "m"(round_tab[1]) \
- );\
-\
- sad8_2_ ## suf(blk1 , blk1+stride, blk2 , stride, h);\
- sad8_2_ ## suf(blk1+8, blk1+stride+8,blk2+8, stride, h);\
-\
- return sum_ ## suf();\
-}\
-static int sad16_xy2_ ## suf(void *v, uint8_t *blk2, uint8_t *blk1, int stride, int h)\
-{\
- asm volatile("pxor %%mm7, %%mm7 \n\t"\
- "pxor %%mm6, %%mm6 \n\t"\
- "movq %0, %%mm5 \n\t"\
- :: "m"(round_tab[2]) \
- );\
-\
- sad8_4_ ## suf(blk1 , blk2 , stride, h);\
- sad8_4_ ## suf(blk1+8, blk2+8, stride, h);\
-\
- return sum_ ## suf();\
-}\
-
-PIX_SAD(mmx)
-PIX_SAD(mmx2)
-
-void dsputil_init_pix_mmx(DSPContext* c, AVCodecContext *avctx)
-{
- if (mm_flags & MM_MMX) {
- c->pix_abs[0][0] = sad16_mmx;
- c->pix_abs[0][1] = sad16_x2_mmx;
- c->pix_abs[0][2] = sad16_y2_mmx;
- c->pix_abs[0][3] = sad16_xy2_mmx;
- c->pix_abs[1][0] = sad8_mmx;
- c->pix_abs[1][1] = sad8_x2_mmx;
- c->pix_abs[1][2] = sad8_y2_mmx;
- c->pix_abs[1][3] = sad8_xy2_mmx;
-
- c->sad[0]= sad16_mmx;
- c->sad[1]= sad8_mmx;
- }
- if (mm_flags & MM_MMXEXT) {
- c->pix_abs[0][0] = sad16_mmx2;
- c->pix_abs[1][0] = sad8_mmx2;
-
- c->sad[0]= sad16_mmx2;
- c->sad[1]= sad8_mmx2;
-
- if(!(avctx->flags & CODEC_FLAG_BITEXACT)){
- c->pix_abs[0][1] = sad16_x2_mmx2;
- c->pix_abs[0][2] = sad16_y2_mmx2;
- c->pix_abs[0][3] = sad16_xy2_mmx2;
- c->pix_abs[1][1] = sad8_x2_mmx2;
- c->pix_abs[1][2] = sad8_y2_mmx2;
- c->pix_abs[1][3] = sad8_xy2_mmx2;
- }
- }
-}
diff --git a/src/libffmpeg/libavcodec/i386/mpegvideo_mmx.c b/src/libffmpeg/libavcodec/i386/mpegvideo_mmx.c
deleted file mode 100644
index 1b7b1c19f..000000000
--- a/src/libffmpeg/libavcodec/i386/mpegvideo_mmx.c
+++ /dev/null
@@ -1,725 +0,0 @@
-/*
- * The simplest mpeg encoder (well, it was the simplest!)
- * Copyright (c) 2000,2001 Fabrice Bellard.
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Optimized for ia32 cpus by Nick Kurshev <nickols_k@mail.ru>
- * h263, mpeg1, mpeg2 dequantizer & draw_edges by Michael Niedermayer <michaelni@gmx.at>
- */
-
-#include "../dsputil.h"
-#include "../mpegvideo.h"
-#include "../avcodec.h"
-#include "x86_cpu.h"
-
-extern uint16_t inv_zigzag_direct16[64];
-
-static const unsigned long long int mm_wabs __attribute__ ((aligned(8))) = 0xffffffffffffffffULL;
-static const unsigned long long int mm_wone __attribute__ ((aligned(8))) = 0x0001000100010001ULL;
-
-
-static void dct_unquantize_h263_intra_mmx(MpegEncContext *s,
- DCTELEM *block, int n, int qscale)
-{
- long level, qmul, qadd, nCoeffs;
-
- qmul = qscale << 1;
-
- assert(s->block_last_index[n]>=0 || s->h263_aic);
-
- if (!s->h263_aic) {
- if (n < 4)
- level = block[0] * s->y_dc_scale;
- else
- level = block[0] * s->c_dc_scale;
- qadd = (qscale - 1) | 1;
- }else{
- qadd = 0;
- level= block[0];
- }
- if(s->ac_pred)
- nCoeffs=63;
- else
- nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
-//printf("%d %d ", qmul, qadd);
-asm volatile(
- "movd %1, %%mm6 \n\t" //qmul
- "packssdw %%mm6, %%mm6 \n\t"
- "packssdw %%mm6, %%mm6 \n\t"
- "movd %2, %%mm5 \n\t" //qadd
- "pxor %%mm7, %%mm7 \n\t"
- "packssdw %%mm5, %%mm5 \n\t"
- "packssdw %%mm5, %%mm5 \n\t"
- "psubw %%mm5, %%mm7 \n\t"
- "pxor %%mm4, %%mm4 \n\t"
- ASMALIGN(4)
- "1: \n\t"
- "movq (%0, %3), %%mm0 \n\t"
- "movq 8(%0, %3), %%mm1 \n\t"
-
- "pmullw %%mm6, %%mm0 \n\t"
- "pmullw %%mm6, %%mm1 \n\t"
-
- "movq (%0, %3), %%mm2 \n\t"
- "movq 8(%0, %3), %%mm3 \n\t"
-
- "pcmpgtw %%mm4, %%mm2 \n\t" // block[i] < 0 ? -1 : 0
- "pcmpgtw %%mm4, %%mm3 \n\t" // block[i] < 0 ? -1 : 0
-
- "pxor %%mm2, %%mm0 \n\t"
- "pxor %%mm3, %%mm1 \n\t"
-
- "paddw %%mm7, %%mm0 \n\t"
- "paddw %%mm7, %%mm1 \n\t"
-
- "pxor %%mm0, %%mm2 \n\t"
- "pxor %%mm1, %%mm3 \n\t"
-
- "pcmpeqw %%mm7, %%mm0 \n\t" // block[i] == 0 ? -1 : 0
- "pcmpeqw %%mm7, %%mm1 \n\t" // block[i] == 0 ? -1 : 0
-
- "pandn %%mm2, %%mm0 \n\t"
- "pandn %%mm3, %%mm1 \n\t"
-
- "movq %%mm0, (%0, %3) \n\t"
- "movq %%mm1, 8(%0, %3) \n\t"
-
- "add $16, %3 \n\t"
- "jng 1b \n\t"
- ::"r" (block+nCoeffs), "g"(qmul), "g" (qadd), "r" (2*(-nCoeffs))
- : "memory"
- );
- block[0]= level;
-}
-
-
-static void dct_unquantize_h263_inter_mmx(MpegEncContext *s,
- DCTELEM *block, int n, int qscale)
-{
- long qmul, qadd, nCoeffs;
-
- qmul = qscale << 1;
- qadd = (qscale - 1) | 1;
-
- assert(s->block_last_index[n]>=0 || s->h263_aic);
-
- nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
-//printf("%d %d ", qmul, qadd);
-asm volatile(
- "movd %1, %%mm6 \n\t" //qmul
- "packssdw %%mm6, %%mm6 \n\t"
- "packssdw %%mm6, %%mm6 \n\t"
- "movd %2, %%mm5 \n\t" //qadd
- "pxor %%mm7, %%mm7 \n\t"
- "packssdw %%mm5, %%mm5 \n\t"
- "packssdw %%mm5, %%mm5 \n\t"
- "psubw %%mm5, %%mm7 \n\t"
- "pxor %%mm4, %%mm4 \n\t"
- ASMALIGN(4)
- "1: \n\t"
- "movq (%0, %3), %%mm0 \n\t"
- "movq 8(%0, %3), %%mm1 \n\t"
-
- "pmullw %%mm6, %%mm0 \n\t"
- "pmullw %%mm6, %%mm1 \n\t"
-
- "movq (%0, %3), %%mm2 \n\t"
- "movq 8(%0, %3), %%mm3 \n\t"
-
- "pcmpgtw %%mm4, %%mm2 \n\t" // block[i] < 0 ? -1 : 0
- "pcmpgtw %%mm4, %%mm3 \n\t" // block[i] < 0 ? -1 : 0
-
- "pxor %%mm2, %%mm0 \n\t"
- "pxor %%mm3, %%mm1 \n\t"
-
- "paddw %%mm7, %%mm0 \n\t"
- "paddw %%mm7, %%mm1 \n\t"
-
- "pxor %%mm0, %%mm2 \n\t"
- "pxor %%mm1, %%mm3 \n\t"
-
- "pcmpeqw %%mm7, %%mm0 \n\t" // block[i] == 0 ? -1 : 0
- "pcmpeqw %%mm7, %%mm1 \n\t" // block[i] == 0 ? -1 : 0
-
- "pandn %%mm2, %%mm0 \n\t"
- "pandn %%mm3, %%mm1 \n\t"
-
- "movq %%mm0, (%0, %3) \n\t"
- "movq %%mm1, 8(%0, %3) \n\t"
-
- "add $16, %3 \n\t"
- "jng 1b \n\t"
- ::"r" (block+nCoeffs), "g"(qmul), "g" (qadd), "r" (2*(-nCoeffs))
- : "memory"
- );
-}
-
-
-/*
- NK:
- Note: looking at PARANOID:
- "enable all paranoid tests for rounding, overflows, etc..."
-
-#ifdef PARANOID
- if (level < -2048 || level > 2047)
- fprintf(stderr, "unquant error %d %d\n", i, level);
-#endif
- We can suppose that result of two multiplications can't be greate of 0xFFFF
- i.e. is 16-bit, so we use here only PMULLW instruction and can avoid
- a complex multiplication.
-=====================================================
- Full formula for multiplication of 2 integer numbers
- which are represent as high:low words:
- input: value1 = high1:low1
- value2 = high2:low2
- output: value3 = value1*value2
- value3=high3:low3 (on overflow: modulus 2^32 wrap-around)
- this mean that for 0x123456 * 0x123456 correct result is 0x766cb0ce4
- but this algorithm will compute only 0x66cb0ce4
- this limited by 16-bit size of operands
- ---------------------------------
- tlow1 = high1*low2
- tlow2 = high2*low1
- tlow1 = tlow1 + tlow2
- high3:low3 = low1*low2
- high3 += tlow1
-*/
-static void dct_unquantize_mpeg1_intra_mmx(MpegEncContext *s,
- DCTELEM *block, int n, int qscale)
-{
- long nCoeffs;
- const uint16_t *quant_matrix;
- int block0;
-
- assert(s->block_last_index[n]>=0);
-
- nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ]+1;
-
- if (n < 4)
- block0 = block[0] * s->y_dc_scale;
- else
- block0 = block[0] * s->c_dc_scale;
- /* XXX: only mpeg1 */
- quant_matrix = s->intra_matrix;
-asm volatile(
- "pcmpeqw %%mm7, %%mm7 \n\t"
- "psrlw $15, %%mm7 \n\t"
- "movd %2, %%mm6 \n\t"
- "packssdw %%mm6, %%mm6 \n\t"
- "packssdw %%mm6, %%mm6 \n\t"
- "mov %3, %%"REG_a" \n\t"
- ASMALIGN(4)
- "1: \n\t"
- "movq (%0, %%"REG_a"), %%mm0 \n\t"
- "movq 8(%0, %%"REG_a"), %%mm1 \n\t"
- "movq (%1, %%"REG_a"), %%mm4 \n\t"
- "movq 8(%1, %%"REG_a"), %%mm5 \n\t"
- "pmullw %%mm6, %%mm4 \n\t" // q=qscale*quant_matrix[i]
- "pmullw %%mm6, %%mm5 \n\t" // q=qscale*quant_matrix[i]
- "pxor %%mm2, %%mm2 \n\t"
- "pxor %%mm3, %%mm3 \n\t"
- "pcmpgtw %%mm0, %%mm2 \n\t" // block[i] < 0 ? -1 : 0
- "pcmpgtw %%mm1, %%mm3 \n\t" // block[i] < 0 ? -1 : 0
- "pxor %%mm2, %%mm0 \n\t"
- "pxor %%mm3, %%mm1 \n\t"
- "psubw %%mm2, %%mm0 \n\t" // abs(block[i])
- "psubw %%mm3, %%mm1 \n\t" // abs(block[i])
- "pmullw %%mm4, %%mm0 \n\t" // abs(block[i])*q
- "pmullw %%mm5, %%mm1 \n\t" // abs(block[i])*q
- "pxor %%mm4, %%mm4 \n\t"
- "pxor %%mm5, %%mm5 \n\t" // FIXME slow
- "pcmpeqw (%0, %%"REG_a"), %%mm4 \n\t" // block[i] == 0 ? -1 : 0
- "pcmpeqw 8(%0, %%"REG_a"), %%mm5\n\t" // block[i] == 0 ? -1 : 0
- "psraw $3, %%mm0 \n\t"
- "psraw $3, %%mm1 \n\t"
- "psubw %%mm7, %%mm0 \n\t"
- "psubw %%mm7, %%mm1 \n\t"
- "por %%mm7, %%mm0 \n\t"
- "por %%mm7, %%mm1 \n\t"
- "pxor %%mm2, %%mm0 \n\t"
- "pxor %%mm3, %%mm1 \n\t"
- "psubw %%mm2, %%mm0 \n\t"
- "psubw %%mm3, %%mm1 \n\t"
- "pandn %%mm0, %%mm4 \n\t"
- "pandn %%mm1, %%mm5 \n\t"
- "movq %%mm4, (%0, %%"REG_a") \n\t"
- "movq %%mm5, 8(%0, %%"REG_a") \n\t"
-
- "add $16, %%"REG_a" \n\t"
- "js 1b \n\t"
- ::"r" (block+nCoeffs), "r"(quant_matrix+nCoeffs), "g" (qscale), "g" (-2*nCoeffs)
- : "%"REG_a, "memory"
- );
- block[0]= block0;
-}
-
-static void dct_unquantize_mpeg1_inter_mmx(MpegEncContext *s,
- DCTELEM *block, int n, int qscale)
-{
- long nCoeffs;
- const uint16_t *quant_matrix;
-
- assert(s->block_last_index[n]>=0);
-
- nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ]+1;
-
- quant_matrix = s->inter_matrix;
-asm volatile(
- "pcmpeqw %%mm7, %%mm7 \n\t"
- "psrlw $15, %%mm7 \n\t"
- "movd %2, %%mm6 \n\t"
- "packssdw %%mm6, %%mm6 \n\t"
- "packssdw %%mm6, %%mm6 \n\t"
- "mov %3, %%"REG_a" \n\t"
- ASMALIGN(4)
- "1: \n\t"
- "movq (%0, %%"REG_a"), %%mm0 \n\t"
- "movq 8(%0, %%"REG_a"), %%mm1 \n\t"
- "movq (%1, %%"REG_a"), %%mm4 \n\t"
- "movq 8(%1, %%"REG_a"), %%mm5 \n\t"
- "pmullw %%mm6, %%mm4 \n\t" // q=qscale*quant_matrix[i]
- "pmullw %%mm6, %%mm5 \n\t" // q=qscale*quant_matrix[i]
- "pxor %%mm2, %%mm2 \n\t"
- "pxor %%mm3, %%mm3 \n\t"
- "pcmpgtw %%mm0, %%mm2 \n\t" // block[i] < 0 ? -1 : 0
- "pcmpgtw %%mm1, %%mm3 \n\t" // block[i] < 0 ? -1 : 0
- "pxor %%mm2, %%mm0 \n\t"
- "pxor %%mm3, %%mm1 \n\t"
- "psubw %%mm2, %%mm0 \n\t" // abs(block[i])
- "psubw %%mm3, %%mm1 \n\t" // abs(block[i])
- "paddw %%mm0, %%mm0 \n\t" // abs(block[i])*2
- "paddw %%mm1, %%mm1 \n\t" // abs(block[i])*2
- "paddw %%mm7, %%mm0 \n\t" // abs(block[i])*2 + 1
- "paddw %%mm7, %%mm1 \n\t" // abs(block[i])*2 + 1
- "pmullw %%mm4, %%mm0 \n\t" // (abs(block[i])*2 + 1)*q
- "pmullw %%mm5, %%mm1 \n\t" // (abs(block[i])*2 + 1)*q
- "pxor %%mm4, %%mm4 \n\t"
- "pxor %%mm5, %%mm5 \n\t" // FIXME slow
- "pcmpeqw (%0, %%"REG_a"), %%mm4 \n\t" // block[i] == 0 ? -1 : 0
- "pcmpeqw 8(%0, %%"REG_a"), %%mm5\n\t" // block[i] == 0 ? -1 : 0
- "psraw $4, %%mm0 \n\t"
- "psraw $4, %%mm1 \n\t"
- "psubw %%mm7, %%mm0 \n\t"
- "psubw %%mm7, %%mm1 \n\t"
- "por %%mm7, %%mm0 \n\t"
- "por %%mm7, %%mm1 \n\t"
- "pxor %%mm2, %%mm0 \n\t"
- "pxor %%mm3, %%mm1 \n\t"
- "psubw %%mm2, %%mm0 \n\t"
- "psubw %%mm3, %%mm1 \n\t"
- "pandn %%mm0, %%mm4 \n\t"
- "pandn %%mm1, %%mm5 \n\t"
- "movq %%mm4, (%0, %%"REG_a") \n\t"
- "movq %%mm5, 8(%0, %%"REG_a") \n\t"
-
- "add $16, %%"REG_a" \n\t"
- "js 1b \n\t"
- ::"r" (block+nCoeffs), "r"(quant_matrix+nCoeffs), "g" (qscale), "g" (-2*nCoeffs)
- : "%"REG_a, "memory"
- );
-}
-
-static void dct_unquantize_mpeg2_intra_mmx(MpegEncContext *s,
- DCTELEM *block, int n, int qscale)
-{
- long nCoeffs;
- const uint16_t *quant_matrix;
- int block0;
-
- assert(s->block_last_index[n]>=0);
-
- if(s->alternate_scan) nCoeffs= 63; //FIXME
- else nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ];
-
- if (n < 4)
- block0 = block[0] * s->y_dc_scale;
- else
- block0 = block[0] * s->c_dc_scale;
- quant_matrix = s->intra_matrix;
-asm volatile(
- "pcmpeqw %%mm7, %%mm7 \n\t"
- "psrlw $15, %%mm7 \n\t"
- "movd %2, %%mm6 \n\t"
- "packssdw %%mm6, %%mm6 \n\t"
- "packssdw %%mm6, %%mm6 \n\t"
- "mov %3, %%"REG_a" \n\t"
- ASMALIGN(4)
- "1: \n\t"
- "movq (%0, %%"REG_a"), %%mm0 \n\t"
- "movq 8(%0, %%"REG_a"), %%mm1 \n\t"
- "movq (%1, %%"REG_a"), %%mm4 \n\t"
- "movq 8(%1, %%"REG_a"), %%mm5 \n\t"
- "pmullw %%mm6, %%mm4 \n\t" // q=qscale*quant_matrix[i]
- "pmullw %%mm6, %%mm5 \n\t" // q=qscale*quant_matrix[i]
- "pxor %%mm2, %%mm2 \n\t"
- "pxor %%mm3, %%mm3 \n\t"
- "pcmpgtw %%mm0, %%mm2 \n\t" // block[i] < 0 ? -1 : 0
- "pcmpgtw %%mm1, %%mm3 \n\t" // block[i] < 0 ? -1 : 0
- "pxor %%mm2, %%mm0 \n\t"
- "pxor %%mm3, %%mm1 \n\t"
- "psubw %%mm2, %%mm0 \n\t" // abs(block[i])
- "psubw %%mm3, %%mm1 \n\t" // abs(block[i])
- "pmullw %%mm4, %%mm0 \n\t" // abs(block[i])*q
- "pmullw %%mm5, %%mm1 \n\t" // abs(block[i])*q
- "pxor %%mm4, %%mm4 \n\t"
- "pxor %%mm5, %%mm5 \n\t" // FIXME slow
- "pcmpeqw (%0, %%"REG_a"), %%mm4 \n\t" // block[i] == 0 ? -1 : 0
- "pcmpeqw 8(%0, %%"REG_a"), %%mm5\n\t" // block[i] == 0 ? -1 : 0
- "psraw $3, %%mm0 \n\t"
- "psraw $3, %%mm1 \n\t"
- "pxor %%mm2, %%mm0 \n\t"
- "pxor %%mm3, %%mm1 \n\t"
- "psubw %%mm2, %%mm0 \n\t"
- "psubw %%mm3, %%mm1 \n\t"
- "pandn %%mm0, %%mm4 \n\t"
- "pandn %%mm1, %%mm5 \n\t"
- "movq %%mm4, (%0, %%"REG_a") \n\t"
- "movq %%mm5, 8(%0, %%"REG_a") \n\t"
-
- "add $16, %%"REG_a" \n\t"
- "jng 1b \n\t"
- ::"r" (block+nCoeffs), "r"(quant_matrix+nCoeffs), "g" (qscale), "g" (-2*nCoeffs)
- : "%"REG_a, "memory"
- );
- block[0]= block0;
- //Note, we dont do mismatch control for intra as errors cannot accumulate
-}
-
-static void dct_unquantize_mpeg2_inter_mmx(MpegEncContext *s,
- DCTELEM *block, int n, int qscale)
-{
- long nCoeffs;
- const uint16_t *quant_matrix;
-
- assert(s->block_last_index[n]>=0);
-
- if(s->alternate_scan) nCoeffs= 63; //FIXME
- else nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ];
-
- quant_matrix = s->inter_matrix;
-asm volatile(
- "pcmpeqw %%mm7, %%mm7 \n\t"
- "psrlq $48, %%mm7 \n\t"
- "movd %2, %%mm6 \n\t"
- "packssdw %%mm6, %%mm6 \n\t"
- "packssdw %%mm6, %%mm6 \n\t"
- "mov %3, %%"REG_a" \n\t"
- ASMALIGN(4)
- "1: \n\t"
- "movq (%0, %%"REG_a"), %%mm0 \n\t"
- "movq 8(%0, %%"REG_a"), %%mm1 \n\t"
- "movq (%1, %%"REG_a"), %%mm4 \n\t"
- "movq 8(%1, %%"REG_a"), %%mm5 \n\t"
- "pmullw %%mm6, %%mm4 \n\t" // q=qscale*quant_matrix[i]
- "pmullw %%mm6, %%mm5 \n\t" // q=qscale*quant_matrix[i]
- "pxor %%mm2, %%mm2 \n\t"
- "pxor %%mm3, %%mm3 \n\t"
- "pcmpgtw %%mm0, %%mm2 \n\t" // block[i] < 0 ? -1 : 0
- "pcmpgtw %%mm1, %%mm3 \n\t" // block[i] < 0 ? -1 : 0
- "pxor %%mm2, %%mm0 \n\t"
- "pxor %%mm3, %%mm1 \n\t"
- "psubw %%mm2, %%mm0 \n\t" // abs(block[i])
- "psubw %%mm3, %%mm1 \n\t" // abs(block[i])
- "paddw %%mm0, %%mm0 \n\t" // abs(block[i])*2
- "paddw %%mm1, %%mm1 \n\t" // abs(block[i])*2
- "pmullw %%mm4, %%mm0 \n\t" // abs(block[i])*2*q
- "pmullw %%mm5, %%mm1 \n\t" // abs(block[i])*2*q
- "paddw %%mm4, %%mm0 \n\t" // (abs(block[i])*2 + 1)*q
- "paddw %%mm5, %%mm1 \n\t" // (abs(block[i])*2 + 1)*q
- "pxor %%mm4, %%mm4 \n\t"
- "pxor %%mm5, %%mm5 \n\t" // FIXME slow
- "pcmpeqw (%0, %%"REG_a"), %%mm4 \n\t" // block[i] == 0 ? -1 : 0
- "pcmpeqw 8(%0, %%"REG_a"), %%mm5\n\t" // block[i] == 0 ? -1 : 0
- "psrlw $4, %%mm0 \n\t"
- "psrlw $4, %%mm1 \n\t"
- "pxor %%mm2, %%mm0 \n\t"
- "pxor %%mm3, %%mm1 \n\t"
- "psubw %%mm2, %%mm0 \n\t"
- "psubw %%mm3, %%mm1 \n\t"
- "pandn %%mm0, %%mm4 \n\t"
- "pandn %%mm1, %%mm5 \n\t"
- "pxor %%mm4, %%mm7 \n\t"
- "pxor %%mm5, %%mm7 \n\t"
- "movq %%mm4, (%0, %%"REG_a") \n\t"
- "movq %%mm5, 8(%0, %%"REG_a") \n\t"
-
- "add $16, %%"REG_a" \n\t"
- "jng 1b \n\t"
- "movd 124(%0, %3), %%mm0 \n\t"
- "movq %%mm7, %%mm6 \n\t"
- "psrlq $32, %%mm7 \n\t"
- "pxor %%mm6, %%mm7 \n\t"
- "movq %%mm7, %%mm6 \n\t"
- "psrlq $16, %%mm7 \n\t"
- "pxor %%mm6, %%mm7 \n\t"
- "pslld $31, %%mm7 \n\t"
- "psrlq $15, %%mm7 \n\t"
- "pxor %%mm7, %%mm0 \n\t"
- "movd %%mm0, 124(%0, %3) \n\t"
-
- ::"r" (block+nCoeffs), "r"(quant_matrix+nCoeffs), "g" (qscale), "r" (-2*nCoeffs)
- : "%"REG_a, "memory"
- );
-}
-
-/* draw the edges of width 'w' of an image of size width, height
- this mmx version can only handle w==8 || w==16 */
-static void draw_edges_mmx(uint8_t *buf, int wrap, int width, int height, int w)
-{
- uint8_t *ptr, *last_line;
- int i;
-
- last_line = buf + (height - 1) * wrap;
- /* left and right */
- ptr = buf;
- if(w==8)
- {
- asm volatile(
- "1: \n\t"
- "movd (%0), %%mm0 \n\t"
- "punpcklbw %%mm0, %%mm0 \n\t"
- "punpcklwd %%mm0, %%mm0 \n\t"
- "punpckldq %%mm0, %%mm0 \n\t"
- "movq %%mm0, -8(%0) \n\t"
- "movq -8(%0, %2), %%mm1 \n\t"
- "punpckhbw %%mm1, %%mm1 \n\t"
- "punpckhwd %%mm1, %%mm1 \n\t"
- "punpckhdq %%mm1, %%mm1 \n\t"
- "movq %%mm1, (%0, %2) \n\t"
- "add %1, %0 \n\t"
- "cmp %3, %0 \n\t"
- " jb 1b \n\t"
- : "+r" (ptr)
- : "r" ((long)wrap), "r" ((long)width), "r" (ptr + wrap*height)
- );
- }
- else
- {
- asm volatile(
- "1: \n\t"
- "movd (%0), %%mm0 \n\t"
- "punpcklbw %%mm0, %%mm0 \n\t"
- "punpcklwd %%mm0, %%mm0 \n\t"
- "punpckldq %%mm0, %%mm0 \n\t"
- "movq %%mm0, -8(%0) \n\t"
- "movq %%mm0, -16(%0) \n\t"
- "movq -8(%0, %2), %%mm1 \n\t"
- "punpckhbw %%mm1, %%mm1 \n\t"
- "punpckhwd %%mm1, %%mm1 \n\t"
- "punpckhdq %%mm1, %%mm1 \n\t"
- "movq %%mm1, (%0, %2) \n\t"
- "movq %%mm1, 8(%0, %2) \n\t"
- "add %1, %0 \n\t"
- "cmp %3, %0 \n\t"
- " jb 1b \n\t"
- : "+r" (ptr)
- : "r" ((long)wrap), "r" ((long)width), "r" (ptr + wrap*height)
- );
- }
-
- for(i=0;i<w;i+=4) {
- /* top and bottom (and hopefully also the corners) */
- ptr= buf - (i + 1) * wrap - w;
- asm volatile(
- "1: \n\t"
- "movq (%1, %0), %%mm0 \n\t"
- "movq %%mm0, (%0) \n\t"
- "movq %%mm0, (%0, %2) \n\t"
- "movq %%mm0, (%0, %2, 2) \n\t"
- "movq %%mm0, (%0, %3) \n\t"
- "add $8, %0 \n\t"
- "cmp %4, %0 \n\t"
- " jb 1b \n\t"
- : "+r" (ptr)
- : "r" ((long)buf - (long)ptr - w), "r" ((long)-wrap), "r" ((long)-wrap*3), "r" (ptr+width+2*w)
- );
- ptr= last_line + (i + 1) * wrap - w;
- asm volatile(
- "1: \n\t"
- "movq (%1, %0), %%mm0 \n\t"
- "movq %%mm0, (%0) \n\t"
- "movq %%mm0, (%0, %2) \n\t"
- "movq %%mm0, (%0, %2, 2) \n\t"
- "movq %%mm0, (%0, %3) \n\t"
- "add $8, %0 \n\t"
- "cmp %4, %0 \n\t"
- " jb 1b \n\t"
- : "+r" (ptr)
- : "r" ((long)last_line - (long)ptr - w), "r" ((long)wrap), "r" ((long)wrap*3), "r" (ptr+width+2*w)
- );
- }
-}
-
-static void denoise_dct_mmx(MpegEncContext *s, DCTELEM *block){
- const int intra= s->mb_intra;
- int *sum= s->dct_error_sum[intra];
- uint16_t *offset= s->dct_offset[intra];
-
- s->dct_count[intra]++;
-
- asm volatile(
- "pxor %%mm7, %%mm7 \n\t"
- "1: \n\t"
- "pxor %%mm0, %%mm0 \n\t"
- "pxor %%mm1, %%mm1 \n\t"
- "movq (%0), %%mm2 \n\t"
- "movq 8(%0), %%mm3 \n\t"
- "pcmpgtw %%mm2, %%mm0 \n\t"
- "pcmpgtw %%mm3, %%mm1 \n\t"
- "pxor %%mm0, %%mm2 \n\t"
- "pxor %%mm1, %%mm3 \n\t"
- "psubw %%mm0, %%mm2 \n\t"
- "psubw %%mm1, %%mm3 \n\t"
- "movq %%mm2, %%mm4 \n\t"
- "movq %%mm3, %%mm5 \n\t"
- "psubusw (%2), %%mm2 \n\t"
- "psubusw 8(%2), %%mm3 \n\t"
- "pxor %%mm0, %%mm2 \n\t"
- "pxor %%mm1, %%mm3 \n\t"
- "psubw %%mm0, %%mm2 \n\t"
- "psubw %%mm1, %%mm3 \n\t"
- "movq %%mm2, (%0) \n\t"
- "movq %%mm3, 8(%0) \n\t"
- "movq %%mm4, %%mm2 \n\t"
- "movq %%mm5, %%mm3 \n\t"
- "punpcklwd %%mm7, %%mm4 \n\t"
- "punpckhwd %%mm7, %%mm2 \n\t"
- "punpcklwd %%mm7, %%mm5 \n\t"
- "punpckhwd %%mm7, %%mm3 \n\t"
- "paddd (%1), %%mm4 \n\t"
- "paddd 8(%1), %%mm2 \n\t"
- "paddd 16(%1), %%mm5 \n\t"
- "paddd 24(%1), %%mm3 \n\t"
- "movq %%mm4, (%1) \n\t"
- "movq %%mm2, 8(%1) \n\t"
- "movq %%mm5, 16(%1) \n\t"
- "movq %%mm3, 24(%1) \n\t"
- "add $16, %0 \n\t"
- "add $32, %1 \n\t"
- "add $16, %2 \n\t"
- "cmp %3, %0 \n\t"
- " jb 1b \n\t"
- : "+r" (block), "+r" (sum), "+r" (offset)
- : "r"(block+64)
- );
-}
-
-static void denoise_dct_sse2(MpegEncContext *s, DCTELEM *block){
- const int intra= s->mb_intra;
- int *sum= s->dct_error_sum[intra];
- uint16_t *offset= s->dct_offset[intra];
-
- s->dct_count[intra]++;
-
- asm volatile(
- "pxor %%xmm7, %%xmm7 \n\t"
- "1: \n\t"
- "pxor %%xmm0, %%xmm0 \n\t"
- "pxor %%xmm1, %%xmm1 \n\t"
- "movdqa (%0), %%xmm2 \n\t"
- "movdqa 16(%0), %%xmm3 \n\t"
- "pcmpgtw %%xmm2, %%xmm0 \n\t"
- "pcmpgtw %%xmm3, %%xmm1 \n\t"
- "pxor %%xmm0, %%xmm2 \n\t"
- "pxor %%xmm1, %%xmm3 \n\t"
- "psubw %%xmm0, %%xmm2 \n\t"
- "psubw %%xmm1, %%xmm3 \n\t"
- "movdqa %%xmm2, %%xmm4 \n\t"
- "movdqa %%xmm3, %%xmm5 \n\t"
- "psubusw (%2), %%xmm2 \n\t"
- "psubusw 16(%2), %%xmm3 \n\t"
- "pxor %%xmm0, %%xmm2 \n\t"
- "pxor %%xmm1, %%xmm3 \n\t"
- "psubw %%xmm0, %%xmm2 \n\t"
- "psubw %%xmm1, %%xmm3 \n\t"
- "movdqa %%xmm2, (%0) \n\t"
- "movdqa %%xmm3, 16(%0) \n\t"
- "movdqa %%xmm4, %%xmm6 \n\t"
- "movdqa %%xmm5, %%xmm0 \n\t"
- "punpcklwd %%xmm7, %%xmm4 \n\t"
- "punpckhwd %%xmm7, %%xmm6 \n\t"
- "punpcklwd %%xmm7, %%xmm5 \n\t"
- "punpckhwd %%xmm7, %%xmm0 \n\t"
- "paddd (%1), %%xmm4 \n\t"
- "paddd 16(%1), %%xmm6 \n\t"
- "paddd 32(%1), %%xmm5 \n\t"
- "paddd 48(%1), %%xmm0 \n\t"
- "movdqa %%xmm4, (%1) \n\t"
- "movdqa %%xmm6, 16(%1) \n\t"
- "movdqa %%xmm5, 32(%1) \n\t"
- "movdqa %%xmm0, 48(%1) \n\t"
- "add $32, %0 \n\t"
- "add $64, %1 \n\t"
- "add $32, %2 \n\t"
- "cmp %3, %0 \n\t"
- " jb 1b \n\t"
- : "+r" (block), "+r" (sum), "+r" (offset)
- : "r"(block+64)
- );
-}
-
-#undef HAVE_MMX2
-#define RENAME(a) a ## _MMX
-#define RENAMEl(a) a ## _mmx
-#include "mpegvideo_mmx_template.c"
-
-#define HAVE_MMX2
-#undef RENAME
-#undef RENAMEl
-#define RENAME(a) a ## _MMX2
-#define RENAMEl(a) a ## _mmx2
-#include "mpegvideo_mmx_template.c"
-
-#undef RENAME
-#undef RENAMEl
-#define RENAME(a) a ## _SSE2
-#define RENAMEl(a) a ## _sse2
-#include "mpegvideo_mmx_template.c"
-
-void MPV_common_init_mmx(MpegEncContext *s)
-{
- if (mm_flags & MM_MMX) {
- const int dct_algo = s->avctx->dct_algo;
-
- s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_mmx;
- s->dct_unquantize_h263_inter = dct_unquantize_h263_inter_mmx;
- s->dct_unquantize_mpeg1_intra = dct_unquantize_mpeg1_intra_mmx;
- s->dct_unquantize_mpeg1_inter = dct_unquantize_mpeg1_inter_mmx;
- if(!(s->flags & CODEC_FLAG_BITEXACT))
- s->dct_unquantize_mpeg2_intra = dct_unquantize_mpeg2_intra_mmx;
- s->dct_unquantize_mpeg2_inter = dct_unquantize_mpeg2_inter_mmx;
-
- draw_edges = draw_edges_mmx;
-
- if (mm_flags & MM_SSE2) {
- s->denoise_dct= denoise_dct_sse2;
- } else {
- s->denoise_dct= denoise_dct_mmx;
- }
-
- if(dct_algo==FF_DCT_AUTO || dct_algo==FF_DCT_MMX){
- if(mm_flags & MM_SSE2){
- s->dct_quantize= dct_quantize_SSE2;
- } else if(mm_flags & MM_MMXEXT){
- s->dct_quantize= dct_quantize_MMX2;
- } else {
- s->dct_quantize= dct_quantize_MMX;
- }
- }
- }
-}
diff --git a/src/libffmpeg/libavcodec/i386/mpegvideo_mmx_template.c b/src/libffmpeg/libavcodec/i386/mpegvideo_mmx_template.c
deleted file mode 100644
index d59b6efd9..000000000
--- a/src/libffmpeg/libavcodec/i386/mpegvideo_mmx_template.c
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
- * MPEG video MMX templates
- *
- * Copyright (c) 2002 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#undef SPREADW
-#undef PMAXW
-#undef PMAX
-#ifdef HAVE_MMX2
-#define SPREADW(a) "pshufw $0, " #a ", " #a " \n\t"
-#define PMAXW(a,b) "pmaxsw " #a ", " #b " \n\t"
-#define PMAX(a,b) \
- "pshufw $0x0E," #a ", " #b " \n\t"\
- PMAXW(b, a)\
- "pshufw $0x01," #a ", " #b " \n\t"\
- PMAXW(b, a)
-#else
-#define SPREADW(a) \
- "punpcklwd " #a ", " #a " \n\t"\
- "punpcklwd " #a ", " #a " \n\t"
-#define PMAXW(a,b) \
- "psubusw " #a ", " #b " \n\t"\
- "paddw " #a ", " #b " \n\t"
-#define PMAX(a,b) \
- "movq " #a ", " #b " \n\t"\
- "psrlq $32, " #a " \n\t"\
- PMAXW(b, a)\
- "movq " #a ", " #b " \n\t"\
- "psrlq $16, " #a " \n\t"\
- PMAXW(b, a)
-
-#endif
-
-static int RENAME(dct_quantize)(MpegEncContext *s,
- DCTELEM *block, int n,
- int qscale, int *overflow)
-{
- long last_non_zero_p1;
- int level=0, q; //=0 is cuz gcc says uninitalized ...
- const uint16_t *qmat, *bias;
- DECLARE_ALIGNED_8(int16_t, temp_block[64]);
-
- assert((7&(int)(&temp_block[0])) == 0); //did gcc align it correctly?
-
- //s->fdct (block);
- RENAMEl(ff_fdct) (block); //cant be anything else ...
-
- if(s->dct_error_sum)
- s->denoise_dct(s, block);
-
- if (s->mb_intra) {
- int dummy;
- if (n < 4)
- q = s->y_dc_scale;
- else
- q = s->c_dc_scale;
- /* note: block[0] is assumed to be positive */
- if (!s->h263_aic) {
-#if 1
- asm volatile (
- "mul %%ecx \n\t"
- : "=d" (level), "=a"(dummy)
- : "a" ((block[0]>>2) + q), "c" (ff_inverse[q<<1])
- );
-#else
- asm volatile (
- "xorl %%edx, %%edx \n\t"
- "divw %%cx \n\t"
- "movzwl %%ax, %%eax \n\t"
- : "=a" (level)
- : "a" ((block[0]>>2) + q), "c" (q<<1)
- : "%edx"
- );
-#endif
- } else
- /* For AIC we skip quant/dequant of INTRADC */
- level = (block[0] + 4)>>3;
-
- block[0]=0; //avoid fake overflow
-// temp_block[0] = (block[0] + (q >> 1)) / q;
- last_non_zero_p1 = 1;
- bias = s->q_intra_matrix16[qscale][1];
- qmat = s->q_intra_matrix16[qscale][0];
- } else {
- last_non_zero_p1 = 0;
- bias = s->q_inter_matrix16[qscale][1];
- qmat = s->q_inter_matrix16[qscale][0];
- }
-
- if((s->out_format == FMT_H263 || s->out_format == FMT_H261) && s->mpeg_quant==0){
-
- asm volatile(
- "movd %%"REG_a", %%mm3 \n\t" // last_non_zero_p1
- SPREADW(%%mm3)
- "pxor %%mm7, %%mm7 \n\t" // 0
- "pxor %%mm4, %%mm4 \n\t" // 0
- "movq (%2), %%mm5 \n\t" // qmat[0]
- "pxor %%mm6, %%mm6 \n\t"
- "psubw (%3), %%mm6 \n\t" // -bias[0]
- "mov $-128, %%"REG_a" \n\t"
- ASMALIGN(4)
- "1: \n\t"
- "pxor %%mm1, %%mm1 \n\t" // 0
- "movq (%1, %%"REG_a"), %%mm0 \n\t" // block[i]
- "pcmpgtw %%mm0, %%mm1 \n\t" // block[i] <= 0 ? 0xFF : 0x00
- "pxor %%mm1, %%mm0 \n\t"
- "psubw %%mm1, %%mm0 \n\t" // ABS(block[i])
- "psubusw %%mm6, %%mm0 \n\t" // ABS(block[i]) + bias[0]
- "pmulhw %%mm5, %%mm0 \n\t" // (ABS(block[i])*qmat[0] - bias[0]*qmat[0])>>16
- "por %%mm0, %%mm4 \n\t"
- "pxor %%mm1, %%mm0 \n\t"
- "psubw %%mm1, %%mm0 \n\t" // out=((ABS(block[i])*qmat[0] - bias[0]*qmat[0])>>16)*sign(block[i])
- "movq %%mm0, (%5, %%"REG_a") \n\t"
- "pcmpeqw %%mm7, %%mm0 \n\t" // out==0 ? 0xFF : 0x00
- "movq (%4, %%"REG_a"), %%mm1 \n\t"
- "movq %%mm7, (%1, %%"REG_a") \n\t" // 0
- "pandn %%mm1, %%mm0 \n\t"
- PMAXW(%%mm0, %%mm3)
- "add $8, %%"REG_a" \n\t"
- " js 1b \n\t"
- PMAX(%%mm3, %%mm0)
- "movd %%mm3, %%"REG_a" \n\t"
- "movzb %%al, %%"REG_a" \n\t" // last_non_zero_p1
- : "+a" (last_non_zero_p1)
- : "r" (block+64), "r" (qmat), "r" (bias),
- "r" (inv_zigzag_direct16+64), "r" (temp_block+64)
- );
- // note the asm is split cuz gcc doesnt like that many operands ...
- asm volatile(
- "movd %1, %%mm1 \n\t" // max_qcoeff
- SPREADW(%%mm1)
- "psubusw %%mm1, %%mm4 \n\t"
- "packuswb %%mm4, %%mm4 \n\t"
- "movd %%mm4, %0 \n\t" // *overflow
- : "=g" (*overflow)
- : "g" (s->max_qcoeff)
- );
- }else{ // FMT_H263
- asm volatile(
- "movd %%"REG_a", %%mm3 \n\t" // last_non_zero_p1
- SPREADW(%%mm3)
- "pxor %%mm7, %%mm7 \n\t" // 0
- "pxor %%mm4, %%mm4 \n\t" // 0
- "mov $-128, %%"REG_a" \n\t"
- ASMALIGN(4)
- "1: \n\t"
- "pxor %%mm1, %%mm1 \n\t" // 0
- "movq (%1, %%"REG_a"), %%mm0 \n\t" // block[i]
- "pcmpgtw %%mm0, %%mm1 \n\t" // block[i] <= 0 ? 0xFF : 0x00
- "pxor %%mm1, %%mm0 \n\t"
- "psubw %%mm1, %%mm0 \n\t" // ABS(block[i])
- "movq (%3, %%"REG_a"), %%mm6 \n\t" // bias[0]
- "paddusw %%mm6, %%mm0 \n\t" // ABS(block[i]) + bias[0]
- "movq (%2, %%"REG_a"), %%mm5 \n\t" // qmat[i]
- "pmulhw %%mm5, %%mm0 \n\t" // (ABS(block[i])*qmat[0] + bias[0]*qmat[0])>>16
- "por %%mm0, %%mm4 \n\t"
- "pxor %%mm1, %%mm0 \n\t"
- "psubw %%mm1, %%mm0 \n\t" // out=((ABS(block[i])*qmat[0] - bias[0]*qmat[0])>>16)*sign(block[i])
- "movq %%mm0, (%5, %%"REG_a") \n\t"
- "pcmpeqw %%mm7, %%mm0 \n\t" // out==0 ? 0xFF : 0x00
- "movq (%4, %%"REG_a"), %%mm1 \n\t"
- "movq %%mm7, (%1, %%"REG_a") \n\t" // 0
- "pandn %%mm1, %%mm0 \n\t"
- PMAXW(%%mm0, %%mm3)
- "add $8, %%"REG_a" \n\t"
- " js 1b \n\t"
- PMAX(%%mm3, %%mm0)
- "movd %%mm3, %%"REG_a" \n\t"
- "movzb %%al, %%"REG_a" \n\t" // last_non_zero_p1
- : "+a" (last_non_zero_p1)
- : "r" (block+64), "r" (qmat+64), "r" (bias+64),
- "r" (inv_zigzag_direct16+64), "r" (temp_block+64)
- );
- // note the asm is split cuz gcc doesnt like that many operands ...
- asm volatile(
- "movd %1, %%mm1 \n\t" // max_qcoeff
- SPREADW(%%mm1)
- "psubusw %%mm1, %%mm4 \n\t"
- "packuswb %%mm4, %%mm4 \n\t"
- "movd %%mm4, %0 \n\t" // *overflow
- : "=g" (*overflow)
- : "g" (s->max_qcoeff)
- );
- }
-
- if(s->mb_intra) block[0]= level;
- else block[0]= temp_block[0];
-
- if(s->dsp.idct_permutation_type == FF_SIMPLE_IDCT_PERM){
- if(last_non_zero_p1 <= 1) goto end;
- block[0x08] = temp_block[0x01]; block[0x10] = temp_block[0x08];
- block[0x20] = temp_block[0x10];
- if(last_non_zero_p1 <= 4) goto end;
- block[0x18] = temp_block[0x09]; block[0x04] = temp_block[0x02];
- block[0x09] = temp_block[0x03];
- if(last_non_zero_p1 <= 7) goto end;
- block[0x14] = temp_block[0x0A]; block[0x28] = temp_block[0x11];
- block[0x12] = temp_block[0x18]; block[0x02] = temp_block[0x20];
- if(last_non_zero_p1 <= 11) goto end;
- block[0x1A] = temp_block[0x19]; block[0x24] = temp_block[0x12];
- block[0x19] = temp_block[0x0B]; block[0x01] = temp_block[0x04];
- block[0x0C] = temp_block[0x05];
- if(last_non_zero_p1 <= 16) goto end;
- block[0x11] = temp_block[0x0C]; block[0x29] = temp_block[0x13];
- block[0x16] = temp_block[0x1A]; block[0x0A] = temp_block[0x21];
- block[0x30] = temp_block[0x28]; block[0x22] = temp_block[0x30];
- block[0x38] = temp_block[0x29]; block[0x06] = temp_block[0x22];
- if(last_non_zero_p1 <= 24) goto end;
- block[0x1B] = temp_block[0x1B]; block[0x21] = temp_block[0x14];
- block[0x1C] = temp_block[0x0D]; block[0x05] = temp_block[0x06];
- block[0x0D] = temp_block[0x07]; block[0x15] = temp_block[0x0E];
- block[0x2C] = temp_block[0x15]; block[0x13] = temp_block[0x1C];
- if(last_non_zero_p1 <= 32) goto end;
- block[0x0B] = temp_block[0x23]; block[0x34] = temp_block[0x2A];
- block[0x2A] = temp_block[0x31]; block[0x32] = temp_block[0x38];
- block[0x3A] = temp_block[0x39]; block[0x26] = temp_block[0x32];
- block[0x39] = temp_block[0x2B]; block[0x03] = temp_block[0x24];
- if(last_non_zero_p1 <= 40) goto end;
- block[0x1E] = temp_block[0x1D]; block[0x25] = temp_block[0x16];
- block[0x1D] = temp_block[0x0F]; block[0x2D] = temp_block[0x17];
- block[0x17] = temp_block[0x1E]; block[0x0E] = temp_block[0x25];
- block[0x31] = temp_block[0x2C]; block[0x2B] = temp_block[0x33];
- if(last_non_zero_p1 <= 48) goto end;
- block[0x36] = temp_block[0x3A]; block[0x3B] = temp_block[0x3B];
- block[0x23] = temp_block[0x34]; block[0x3C] = temp_block[0x2D];
- block[0x07] = temp_block[0x26]; block[0x1F] = temp_block[0x1F];
- block[0x0F] = temp_block[0x27]; block[0x35] = temp_block[0x2E];
- if(last_non_zero_p1 <= 56) goto end;
- block[0x2E] = temp_block[0x35]; block[0x33] = temp_block[0x3C];
- block[0x3E] = temp_block[0x3D]; block[0x27] = temp_block[0x36];
- block[0x3D] = temp_block[0x2F]; block[0x2F] = temp_block[0x37];
- block[0x37] = temp_block[0x3E]; block[0x3F] = temp_block[0x3F];
- }else if(s->dsp.idct_permutation_type == FF_LIBMPEG2_IDCT_PERM){
- if(last_non_zero_p1 <= 1) goto end;
- block[0x04] = temp_block[0x01];
- block[0x08] = temp_block[0x08]; block[0x10] = temp_block[0x10];
- if(last_non_zero_p1 <= 4) goto end;
- block[0x0C] = temp_block[0x09]; block[0x01] = temp_block[0x02];
- block[0x05] = temp_block[0x03];
- if(last_non_zero_p1 <= 7) goto end;
- block[0x09] = temp_block[0x0A]; block[0x14] = temp_block[0x11];
- block[0x18] = temp_block[0x18]; block[0x20] = temp_block[0x20];
- if(last_non_zero_p1 <= 11) goto end;
- block[0x1C] = temp_block[0x19];
- block[0x11] = temp_block[0x12]; block[0x0D] = temp_block[0x0B];
- block[0x02] = temp_block[0x04]; block[0x06] = temp_block[0x05];
- if(last_non_zero_p1 <= 16) goto end;
- block[0x0A] = temp_block[0x0C]; block[0x15] = temp_block[0x13];
- block[0x19] = temp_block[0x1A]; block[0x24] = temp_block[0x21];
- block[0x28] = temp_block[0x28]; block[0x30] = temp_block[0x30];
- block[0x2C] = temp_block[0x29]; block[0x21] = temp_block[0x22];
- if(last_non_zero_p1 <= 24) goto end;
- block[0x1D] = temp_block[0x1B]; block[0x12] = temp_block[0x14];
- block[0x0E] = temp_block[0x0D]; block[0x03] = temp_block[0x06];
- block[0x07] = temp_block[0x07]; block[0x0B] = temp_block[0x0E];
- block[0x16] = temp_block[0x15]; block[0x1A] = temp_block[0x1C];
- if(last_non_zero_p1 <= 32) goto end;
- block[0x25] = temp_block[0x23]; block[0x29] = temp_block[0x2A];
- block[0x34] = temp_block[0x31]; block[0x38] = temp_block[0x38];
- block[0x3C] = temp_block[0x39]; block[0x31] = temp_block[0x32];
- block[0x2D] = temp_block[0x2B]; block[0x22] = temp_block[0x24];
- if(last_non_zero_p1 <= 40) goto end;
- block[0x1E] = temp_block[0x1D]; block[0x13] = temp_block[0x16];
- block[0x0F] = temp_block[0x0F]; block[0x17] = temp_block[0x17];
- block[0x1B] = temp_block[0x1E]; block[0x26] = temp_block[0x25];
- block[0x2A] = temp_block[0x2C]; block[0x35] = temp_block[0x33];
- if(last_non_zero_p1 <= 48) goto end;
- block[0x39] = temp_block[0x3A]; block[0x3D] = temp_block[0x3B];
- block[0x32] = temp_block[0x34]; block[0x2E] = temp_block[0x2D];
- block[0x23] = temp_block[0x26]; block[0x1F] = temp_block[0x1F];
- block[0x27] = temp_block[0x27]; block[0x2B] = temp_block[0x2E];
- if(last_non_zero_p1 <= 56) goto end;
- block[0x36] = temp_block[0x35]; block[0x3A] = temp_block[0x3C];
- block[0x3E] = temp_block[0x3D]; block[0x33] = temp_block[0x36];
- block[0x2F] = temp_block[0x2F]; block[0x37] = temp_block[0x37];
- block[0x3B] = temp_block[0x3E]; block[0x3F] = temp_block[0x3F];
- }else{
- if(last_non_zero_p1 <= 1) goto end;
- block[0x01] = temp_block[0x01];
- block[0x08] = temp_block[0x08]; block[0x10] = temp_block[0x10];
- if(last_non_zero_p1 <= 4) goto end;
- block[0x09] = temp_block[0x09]; block[0x02] = temp_block[0x02];
- block[0x03] = temp_block[0x03];
- if(last_non_zero_p1 <= 7) goto end;
- block[0x0A] = temp_block[0x0A]; block[0x11] = temp_block[0x11];
- block[0x18] = temp_block[0x18]; block[0x20] = temp_block[0x20];
- if(last_non_zero_p1 <= 11) goto end;
- block[0x19] = temp_block[0x19];
- block[0x12] = temp_block[0x12]; block[0x0B] = temp_block[0x0B];
- block[0x04] = temp_block[0x04]; block[0x05] = temp_block[0x05];
- if(last_non_zero_p1 <= 16) goto end;
- block[0x0C] = temp_block[0x0C]; block[0x13] = temp_block[0x13];
- block[0x1A] = temp_block[0x1A]; block[0x21] = temp_block[0x21];
- block[0x28] = temp_block[0x28]; block[0x30] = temp_block[0x30];
- block[0x29] = temp_block[0x29]; block[0x22] = temp_block[0x22];
- if(last_non_zero_p1 <= 24) goto end;
- block[0x1B] = temp_block[0x1B]; block[0x14] = temp_block[0x14];
- block[0x0D] = temp_block[0x0D]; block[0x06] = temp_block[0x06];
- block[0x07] = temp_block[0x07]; block[0x0E] = temp_block[0x0E];
- block[0x15] = temp_block[0x15]; block[0x1C] = temp_block[0x1C];
- if(last_non_zero_p1 <= 32) goto end;
- block[0x23] = temp_block[0x23]; block[0x2A] = temp_block[0x2A];
- block[0x31] = temp_block[0x31]; block[0x38] = temp_block[0x38];
- block[0x39] = temp_block[0x39]; block[0x32] = temp_block[0x32];
- block[0x2B] = temp_block[0x2B]; block[0x24] = temp_block[0x24];
- if(last_non_zero_p1 <= 40) goto end;
- block[0x1D] = temp_block[0x1D]; block[0x16] = temp_block[0x16];
- block[0x0F] = temp_block[0x0F]; block[0x17] = temp_block[0x17];
- block[0x1E] = temp_block[0x1E]; block[0x25] = temp_block[0x25];
- block[0x2C] = temp_block[0x2C]; block[0x33] = temp_block[0x33];
- if(last_non_zero_p1 <= 48) goto end;
- block[0x3A] = temp_block[0x3A]; block[0x3B] = temp_block[0x3B];
- block[0x34] = temp_block[0x34]; block[0x2D] = temp_block[0x2D];
- block[0x26] = temp_block[0x26]; block[0x1F] = temp_block[0x1F];
- block[0x27] = temp_block[0x27]; block[0x2E] = temp_block[0x2E];
- if(last_non_zero_p1 <= 56) goto end;
- block[0x35] = temp_block[0x35]; block[0x3C] = temp_block[0x3C];
- block[0x3D] = temp_block[0x3D]; block[0x36] = temp_block[0x36];
- block[0x2F] = temp_block[0x2F]; block[0x37] = temp_block[0x37];
- block[0x3E] = temp_block[0x3E]; block[0x3F] = temp_block[0x3F];
- }
- end:
-/*
- for(i=0; i<last_non_zero_p1; i++)
- {
- int j= zigzag_direct_noperm[i];
- block[block_permute_op(j)]= temp_block[j];
- }
-*/
-
- return last_non_zero_p1 - 1;
-}
diff --git a/src/libffmpeg/libavcodec/i386/simple_idct_mmx.c b/src/libffmpeg/libavcodec/i386/simple_idct_mmx.c
deleted file mode 100644
index 525ef34f7..000000000
--- a/src/libffmpeg/libavcodec/i386/simple_idct_mmx.c
+++ /dev/null
@@ -1,1294 +0,0 @@
-/*
- * Simple IDCT MMX
- *
- * Copyright (c) 2001, 2002 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "../dsputil.h"
-#include "../simple_idct.h"
-
-/*
-23170.475006
-22725.260826
-21406.727617
-19265.545870
-16384.000000
-12872.826198
-8866.956905
-4520.335430
-*/
-#define C0 23170 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-#define C1 22725 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-#define C2 21407 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-#define C3 19266 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-#if 0
-#define C4 16384 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-#else
-#define C4 16383 //cos(i*M_PI/16)*sqrt(2)*(1<<14) - 0.5
-#endif
-#define C5 12873 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-#define C6 8867 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-#define C7 4520 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-
-#define ROW_SHIFT 11
-#define COL_SHIFT 20 // 6
-
-static const uint64_t attribute_used __attribute__((aligned(8))) wm1010= 0xFFFF0000FFFF0000ULL;
-static const uint64_t attribute_used __attribute__((aligned(8))) d40000= 0x0000000000040000ULL;
-
-static const int16_t __attribute__((aligned(8))) coeffs[]= {
- 1<<(ROW_SHIFT-1), 0, 1<<(ROW_SHIFT-1), 0,
-// 1<<(COL_SHIFT-1), 0, 1<<(COL_SHIFT-1), 0,
-// 0, 1<<(COL_SHIFT-1-16), 0, 1<<(COL_SHIFT-1-16),
- 1<<(ROW_SHIFT-1), 1, 1<<(ROW_SHIFT-1), 0,
- // the 1 = ((1<<(COL_SHIFT-1))/C4)<<ROW_SHIFT :)
-// 0, 0, 0, 0,
-// 0, 0, 0, 0,
-
- C4, C4, C4, C4,
- C4, -C4, C4, -C4,
-
- C2, C6, C2, C6,
- C6, -C2, C6, -C2,
-
- C1, C3, C1, C3,
- C5, C7, C5, C7,
-
- C3, -C7, C3, -C7,
--C1, -C5, -C1, -C5,
-
- C5, -C1, C5, -C1,
- C7, C3, C7, C3,
-
- C7, -C5, C7, -C5,
- C3, -C1, C3, -C1
-};
-
-#if 0
-static void unused_var_killer(){
- int a= wm1010 + d40000;
- temp[0]=a;
-}
-
-static void inline idctCol (int16_t * col, int16_t *input)
-{
-#undef C0
-#undef C1
-#undef C2
-#undef C3
-#undef C4
-#undef C5
-#undef C6
-#undef C7
- int a0, a1, a2, a3, b0, b1, b2, b3;
- const int C0 = 23170; //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
- const int C1 = 22725; //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
- const int C2 = 21407; //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
- const int C3 = 19266; //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
- const int C4 = 16383; //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
- const int C5 = 12873; //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
- const int C6 = 8867; //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
- const int C7 = 4520; //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-/*
- if( !(col[8*1] | col[8*2] |col[8*3] |col[8*4] |col[8*5] |col[8*6] | col[8*7])) {
- col[8*0] = col[8*1] = col[8*2] = col[8*3] = col[8*4] =
- col[8*5] = col[8*6] = col[8*7] = col[8*0]<<3;
- return;
- }*/
-
-col[8*0] = input[8*0 + 0];
-col[8*1] = input[8*2 + 0];
-col[8*2] = input[8*0 + 1];
-col[8*3] = input[8*2 + 1];
-col[8*4] = input[8*4 + 0];
-col[8*5] = input[8*6 + 0];
-col[8*6] = input[8*4 + 1];
-col[8*7] = input[8*6 + 1];
-
- a0 = C4*col[8*0] + C2*col[8*2] + C4*col[8*4] + C6*col[8*6] + (1<<(COL_SHIFT-1));
- a1 = C4*col[8*0] + C6*col[8*2] - C4*col[8*4] - C2*col[8*6] + (1<<(COL_SHIFT-1));
- a2 = C4*col[8*0] - C6*col[8*2] - C4*col[8*4] + C2*col[8*6] + (1<<(COL_SHIFT-1));
- a3 = C4*col[8*0] - C2*col[8*2] + C4*col[8*4] - C6*col[8*6] + (1<<(COL_SHIFT-1));
-
- b0 = C1*col[8*1] + C3*col[8*3] + C5*col[8*5] + C7*col[8*7];
- b1 = C3*col[8*1] - C7*col[8*3] - C1*col[8*5] - C5*col[8*7];
- b2 = C5*col[8*1] - C1*col[8*3] + C7*col[8*5] + C3*col[8*7];
- b3 = C7*col[8*1] - C5*col[8*3] + C3*col[8*5] - C1*col[8*7];
-
- col[8*0] = (a0 + b0) >> COL_SHIFT;
- col[8*1] = (a1 + b1) >> COL_SHIFT;
- col[8*2] = (a2 + b2) >> COL_SHIFT;
- col[8*3] = (a3 + b3) >> COL_SHIFT;
- col[8*4] = (a3 - b3) >> COL_SHIFT;
- col[8*5] = (a2 - b2) >> COL_SHIFT;
- col[8*6] = (a1 - b1) >> COL_SHIFT;
- col[8*7] = (a0 - b0) >> COL_SHIFT;
-}
-
-static void inline idctRow (int16_t * output, int16_t * input)
-{
- int16_t row[8];
-
- int a0, a1, a2, a3, b0, b1, b2, b3;
- const int C0 = 23170; //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
- const int C1 = 22725; //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
- const int C2 = 21407; //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
- const int C3 = 19266; //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
- const int C4 = 16383; //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
- const int C5 = 12873; //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
- const int C6 = 8867; //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
- const int C7 = 4520; //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-
-row[0] = input[0];
-row[2] = input[1];
-row[4] = input[4];
-row[6] = input[5];
-row[1] = input[8];
-row[3] = input[9];
-row[5] = input[12];
-row[7] = input[13];
-
- if( !(row[1] | row[2] |row[3] |row[4] |row[5] |row[6] | row[7]) ) {
- row[0] = row[1] = row[2] = row[3] = row[4] =
- row[5] = row[6] = row[7] = row[0]<<3;
- output[0] = row[0];
- output[2] = row[1];
- output[4] = row[2];
- output[6] = row[3];
- output[8] = row[4];
- output[10] = row[5];
- output[12] = row[6];
- output[14] = row[7];
- return;
- }
-
- a0 = C4*row[0] + C2*row[2] + C4*row[4] + C6*row[6] + (1<<(ROW_SHIFT-1));
- a1 = C4*row[0] + C6*row[2] - C4*row[4] - C2*row[6] + (1<<(ROW_SHIFT-1));
- a2 = C4*row[0] - C6*row[2] - C4*row[4] + C2*row[6] + (1<<(ROW_SHIFT-1));
- a3 = C4*row[0] - C2*row[2] + C4*row[4] - C6*row[6] + (1<<(ROW_SHIFT-1));
-
- b0 = C1*row[1] + C3*row[3] + C5*row[5] + C7*row[7];
- b1 = C3*row[1] - C7*row[3] - C1*row[5] - C5*row[7];
- b2 = C5*row[1] - C1*row[3] + C7*row[5] + C3*row[7];
- b3 = C7*row[1] - C5*row[3] + C3*row[5] - C1*row[7];
-
- row[0] = (a0 + b0) >> ROW_SHIFT;
- row[1] = (a1 + b1) >> ROW_SHIFT;
- row[2] = (a2 + b2) >> ROW_SHIFT;
- row[3] = (a3 + b3) >> ROW_SHIFT;
- row[4] = (a3 - b3) >> ROW_SHIFT;
- row[5] = (a2 - b2) >> ROW_SHIFT;
- row[6] = (a1 - b1) >> ROW_SHIFT;
- row[7] = (a0 - b0) >> ROW_SHIFT;
-
- output[0] = row[0];
- output[2] = row[1];
- output[4] = row[2];
- output[6] = row[3];
- output[8] = row[4];
- output[10] = row[5];
- output[12] = row[6];
- output[14] = row[7];
-}
-#endif
-
-static inline void idct(int16_t *block)
-{
- int64_t __attribute__((aligned(8))) align_tmp[16];
- int16_t * const temp= (int16_t*)align_tmp;
-
- asm volatile(
-#if 0 //Alternative, simpler variant
-
-#define ROW_IDCT(src0, src4, src1, src5, dst, rounder, shift) \
- "movq " #src0 ", %%mm0 \n\t" /* R4 R0 r4 r0 */\
- "movq " #src4 ", %%mm1 \n\t" /* R6 R2 r6 r2 */\
- "movq " #src1 ", %%mm2 \n\t" /* R3 R1 r3 r1 */\
- "movq " #src5 ", %%mm3 \n\t" /* R7 R5 r7 r5 */\
- "movq 16(%2), %%mm4 \n\t" /* C4 C4 C4 C4 */\
- "pmaddwd %%mm0, %%mm4 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
- "movq 24(%2), %%mm5 \n\t" /* -C4 C4 -C4 C4 */\
- "pmaddwd %%mm5, %%mm0 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
- "movq 32(%2), %%mm5 \n\t" /* C6 C2 C6 C2 */\
- "pmaddwd %%mm1, %%mm5 \n\t" /* C6R6+C2R2 C6r6+C2r2 */\
- "movq 40(%2), %%mm6 \n\t" /* -C2 C6 -C2 C6 */\
- "pmaddwd %%mm6, %%mm1 \n\t" /* -C2R6+C6R2 -C2r6+C6r2 */\
- "movq 48(%2), %%mm7 \n\t" /* C3 C1 C3 C1 */\
- "pmaddwd %%mm2, %%mm7 \n\t" /* C3R3+C1R1 C3r3+C1r1 */\
- #rounder ", %%mm4 \n\t"\
- "movq %%mm4, %%mm6 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
- "paddd %%mm5, %%mm4 \n\t" /* A0 a0 */\
- "psubd %%mm5, %%mm6 \n\t" /* A3 a3 */\
- "movq 56(%2), %%mm5 \n\t" /* C7 C5 C7 C5 */\
- "pmaddwd %%mm3, %%mm5 \n\t" /* C7R7+C5R5 C7r7+C5r5 */\
- #rounder ", %%mm0 \n\t"\
- "paddd %%mm0, %%mm1 \n\t" /* A1 a1 */\
- "paddd %%mm0, %%mm0 \n\t" \
- "psubd %%mm1, %%mm0 \n\t" /* A2 a2 */\
- "pmaddwd 64(%2), %%mm2 \n\t" /* -C7R3+C3R1 -C7r3+C3r1 */\
- "paddd %%mm5, %%mm7 \n\t" /* B0 b0 */\
- "movq 72(%2), %%mm5 \n\t" /* -C5 -C1 -C5 -C1 */\
- "pmaddwd %%mm3, %%mm5 \n\t" /* -C5R7-C1R5 -C5r7-C1r5 */\
- "paddd %%mm4, %%mm7 \n\t" /* A0+B0 a0+b0 */\
- "paddd %%mm4, %%mm4 \n\t" /* 2A0 2a0 */\
- "psubd %%mm7, %%mm4 \n\t" /* A0-B0 a0-b0 */\
- "paddd %%mm2, %%mm5 \n\t" /* B1 b1 */\
- "psrad $" #shift ", %%mm7 \n\t"\
- "psrad $" #shift ", %%mm4 \n\t"\
- "movq %%mm1, %%mm2 \n\t" /* A1 a1 */\
- "paddd %%mm5, %%mm1 \n\t" /* A1+B1 a1+b1 */\
- "psubd %%mm5, %%mm2 \n\t" /* A1-B1 a1-b1 */\
- "psrad $" #shift ", %%mm1 \n\t"\
- "psrad $" #shift ", %%mm2 \n\t"\
- "packssdw %%mm1, %%mm7 \n\t" /* A1+B1 a1+b1 A0+B0 a0+b0 */\
- "packssdw %%mm4, %%mm2 \n\t" /* A0-B0 a0-b0 A1-B1 a1-b1 */\
- "movq %%mm7, " #dst " \n\t"\
- "movq " #src1 ", %%mm1 \n\t" /* R3 R1 r3 r1 */\
- "movq 80(%2), %%mm4 \n\t" /* -C1 C5 -C1 C5 */\
- "movq %%mm2, 24+" #dst " \n\t"\
- "pmaddwd %%mm1, %%mm4 \n\t" /* -C1R3+C5R1 -C1r3+C5r1 */\
- "movq 88(%2), %%mm7 \n\t" /* C3 C7 C3 C7 */\
- "pmaddwd 96(%2), %%mm1 \n\t" /* -C5R3+C7R1 -C5r3+C7r1 */\
- "pmaddwd %%mm3, %%mm7 \n\t" /* C3R7+C7R5 C3r7+C7r5 */\
- "movq %%mm0, %%mm2 \n\t" /* A2 a2 */\
- "pmaddwd 104(%2), %%mm3 \n\t" /* -C1R7+C3R5 -C1r7+C3r5 */\
- "paddd %%mm7, %%mm4 \n\t" /* B2 b2 */\
- "paddd %%mm4, %%mm2 \n\t" /* A2+B2 a2+b2 */\
- "psubd %%mm4, %%mm0 \n\t" /* a2-B2 a2-b2 */\
- "psrad $" #shift ", %%mm2 \n\t"\
- "psrad $" #shift ", %%mm0 \n\t"\
- "movq %%mm6, %%mm4 \n\t" /* A3 a3 */\
- "paddd %%mm1, %%mm3 \n\t" /* B3 b3 */\
- "paddd %%mm3, %%mm6 \n\t" /* A3+B3 a3+b3 */\
- "psubd %%mm3, %%mm4 \n\t" /* a3-B3 a3-b3 */\
- "psrad $" #shift ", %%mm6 \n\t"\
- "packssdw %%mm6, %%mm2 \n\t" /* A3+B3 a3+b3 A2+B2 a2+b2 */\
- "movq %%mm2, 8+" #dst " \n\t"\
- "psrad $" #shift ", %%mm4 \n\t"\
- "packssdw %%mm0, %%mm4 \n\t" /* A2-B2 a2-b2 A3-B3 a3-b3 */\
- "movq %%mm4, 16+" #dst " \n\t"\
-
-#define COL_IDCT(src0, src4, src1, src5, dst, shift) \
- "movq " #src0 ", %%mm0 \n\t" /* R4 R0 r4 r0 */\
- "movq " #src4 ", %%mm1 \n\t" /* R6 R2 r6 r2 */\
- "movq " #src1 ", %%mm2 \n\t" /* R3 R1 r3 r1 */\
- "movq " #src5 ", %%mm3 \n\t" /* R7 R5 r7 r5 */\
- "movq 16(%2), %%mm4 \n\t" /* C4 C4 C4 C4 */\
- "pmaddwd %%mm0, %%mm4 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
- "movq 24(%2), %%mm5 \n\t" /* -C4 C4 -C4 C4 */\
- "pmaddwd %%mm5, %%mm0 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
- "movq 32(%2), %%mm5 \n\t" /* C6 C2 C6 C2 */\
- "pmaddwd %%mm1, %%mm5 \n\t" /* C6R6+C2R2 C6r6+C2r2 */\
- "movq 40(%2), %%mm6 \n\t" /* -C2 C6 -C2 C6 */\
- "pmaddwd %%mm6, %%mm1 \n\t" /* -C2R6+C6R2 -C2r6+C6r2 */\
- "movq %%mm4, %%mm6 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
- "movq 48(%2), %%mm7 \n\t" /* C3 C1 C3 C1 */\
- "pmaddwd %%mm2, %%mm7 \n\t" /* C3R3+C1R1 C3r3+C1r1 */\
- "paddd %%mm5, %%mm4 \n\t" /* A0 a0 */\
- "psubd %%mm5, %%mm6 \n\t" /* A3 a3 */\
- "movq %%mm0, %%mm5 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
- "paddd %%mm1, %%mm0 \n\t" /* A1 a1 */\
- "psubd %%mm1, %%mm5 \n\t" /* A2 a2 */\
- "movq 56(%2), %%mm1 \n\t" /* C7 C5 C7 C5 */\
- "pmaddwd %%mm3, %%mm1 \n\t" /* C7R7+C5R5 C7r7+C5r5 */\
- "pmaddwd 64(%2), %%mm2 \n\t" /* -C7R3+C3R1 -C7r3+C3r1 */\
- "paddd %%mm1, %%mm7 \n\t" /* B0 b0 */\
- "movq 72(%2), %%mm1 \n\t" /* -C5 -C1 -C5 -C1 */\
- "pmaddwd %%mm3, %%mm1 \n\t" /* -C5R7-C1R5 -C5r7-C1r5 */\
- "paddd %%mm4, %%mm7 \n\t" /* A0+B0 a0+b0 */\
- "paddd %%mm4, %%mm4 \n\t" /* 2A0 2a0 */\
- "psubd %%mm7, %%mm4 \n\t" /* A0-B0 a0-b0 */\
- "paddd %%mm2, %%mm1 \n\t" /* B1 b1 */\
- "psrad $" #shift ", %%mm7 \n\t"\
- "psrad $" #shift ", %%mm4 \n\t"\
- "movq %%mm0, %%mm2 \n\t" /* A1 a1 */\
- "paddd %%mm1, %%mm0 \n\t" /* A1+B1 a1+b1 */\
- "psubd %%mm1, %%mm2 \n\t" /* A1-B1 a1-b1 */\
- "psrad $" #shift ", %%mm0 \n\t"\
- "psrad $" #shift ", %%mm2 \n\t"\
- "packssdw %%mm7, %%mm7 \n\t" /* A0+B0 a0+b0 */\
- "movd %%mm7, " #dst " \n\t"\
- "packssdw %%mm0, %%mm0 \n\t" /* A1+B1 a1+b1 */\
- "movd %%mm0, 16+" #dst " \n\t"\
- "packssdw %%mm2, %%mm2 \n\t" /* A1-B1 a1-b1 */\
- "movd %%mm2, 96+" #dst " \n\t"\
- "packssdw %%mm4, %%mm4 \n\t" /* A0-B0 a0-b0 */\
- "movd %%mm4, 112+" #dst " \n\t"\
- "movq " #src1 ", %%mm0 \n\t" /* R3 R1 r3 r1 */\
- "movq 80(%2), %%mm4 \n\t" /* -C1 C5 -C1 C5 */\
- "pmaddwd %%mm0, %%mm4 \n\t" /* -C1R3+C5R1 -C1r3+C5r1 */\
- "movq 88(%2), %%mm7 \n\t" /* C3 C7 C3 C7 */\
- "pmaddwd 96(%2), %%mm0 \n\t" /* -C5R3+C7R1 -C5r3+C7r1 */\
- "pmaddwd %%mm3, %%mm7 \n\t" /* C3R7+C7R5 C3r7+C7r5 */\
- "movq %%mm5, %%mm2 \n\t" /* A2 a2 */\
- "pmaddwd 104(%2), %%mm3 \n\t" /* -C1R7+C3R5 -C1r7+C3r5 */\
- "paddd %%mm7, %%mm4 \n\t" /* B2 b2 */\
- "paddd %%mm4, %%mm2 \n\t" /* A2+B2 a2+b2 */\
- "psubd %%mm4, %%mm5 \n\t" /* a2-B2 a2-b2 */\
- "psrad $" #shift ", %%mm2 \n\t"\
- "psrad $" #shift ", %%mm5 \n\t"\
- "movq %%mm6, %%mm4 \n\t" /* A3 a3 */\
- "paddd %%mm0, %%mm3 \n\t" /* B3 b3 */\
- "paddd %%mm3, %%mm6 \n\t" /* A3+B3 a3+b3 */\
- "psubd %%mm3, %%mm4 \n\t" /* a3-B3 a3-b3 */\
- "psrad $" #shift ", %%mm6 \n\t"\
- "psrad $" #shift ", %%mm4 \n\t"\
- "packssdw %%mm2, %%mm2 \n\t" /* A2+B2 a2+b2 */\
- "packssdw %%mm6, %%mm6 \n\t" /* A3+B3 a3+b3 */\
- "movd %%mm2, 32+" #dst " \n\t"\
- "packssdw %%mm4, %%mm4 \n\t" /* A3-B3 a3-b3 */\
- "packssdw %%mm5, %%mm5 \n\t" /* A2-B2 a2-b2 */\
- "movd %%mm6, 48+" #dst " \n\t"\
- "movd %%mm4, 64+" #dst " \n\t"\
- "movd %%mm5, 80+" #dst " \n\t"\
-
-
-#define DC_COND_ROW_IDCT(src0, src4, src1, src5, dst, rounder, shift) \
- "movq " #src0 ", %%mm0 \n\t" /* R4 R0 r4 r0 */\
- "movq " #src4 ", %%mm1 \n\t" /* R6 R2 r6 r2 */\
- "movq " #src1 ", %%mm2 \n\t" /* R3 R1 r3 r1 */\
- "movq " #src5 ", %%mm3 \n\t" /* R7 R5 r7 r5 */\
- "movq "MANGLE(wm1010)", %%mm4 \n\t"\
- "pand %%mm0, %%mm4 \n\t"\
- "por %%mm1, %%mm4 \n\t"\
- "por %%mm2, %%mm4 \n\t"\
- "por %%mm3, %%mm4 \n\t"\
- "packssdw %%mm4,%%mm4 \n\t"\
- "movd %%mm4, %%eax \n\t"\
- "orl %%eax, %%eax \n\t"\
- "jz 1f \n\t"\
- "movq 16(%2), %%mm4 \n\t" /* C4 C4 C4 C4 */\
- "pmaddwd %%mm0, %%mm4 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
- "movq 24(%2), %%mm5 \n\t" /* -C4 C4 -C4 C4 */\
- "pmaddwd %%mm5, %%mm0 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
- "movq 32(%2), %%mm5 \n\t" /* C6 C2 C6 C2 */\
- "pmaddwd %%mm1, %%mm5 \n\t" /* C6R6+C2R2 C6r6+C2r2 */\
- "movq 40(%2), %%mm6 \n\t" /* -C2 C6 -C2 C6 */\
- "pmaddwd %%mm6, %%mm1 \n\t" /* -C2R6+C6R2 -C2r6+C6r2 */\
- "movq 48(%2), %%mm7 \n\t" /* C3 C1 C3 C1 */\
- "pmaddwd %%mm2, %%mm7 \n\t" /* C3R3+C1R1 C3r3+C1r1 */\
- #rounder ", %%mm4 \n\t"\
- "movq %%mm4, %%mm6 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
- "paddd %%mm5, %%mm4 \n\t" /* A0 a0 */\
- "psubd %%mm5, %%mm6 \n\t" /* A3 a3 */\
- "movq 56(%2), %%mm5 \n\t" /* C7 C5 C7 C5 */\
- "pmaddwd %%mm3, %%mm5 \n\t" /* C7R7+C5R5 C7r7+C5r5 */\
- #rounder ", %%mm0 \n\t"\
- "paddd %%mm0, %%mm1 \n\t" /* A1 a1 */\
- "paddd %%mm0, %%mm0 \n\t" \
- "psubd %%mm1, %%mm0 \n\t" /* A2 a2 */\
- "pmaddwd 64(%2), %%mm2 \n\t" /* -C7R3+C3R1 -C7r3+C3r1 */\
- "paddd %%mm5, %%mm7 \n\t" /* B0 b0 */\
- "movq 72(%2), %%mm5 \n\t" /* -C5 -C1 -C5 -C1 */\
- "pmaddwd %%mm3, %%mm5 \n\t" /* -C5R7-C1R5 -C5r7-C1r5 */\
- "paddd %%mm4, %%mm7 \n\t" /* A0+B0 a0+b0 */\
- "paddd %%mm4, %%mm4 \n\t" /* 2A0 2a0 */\
- "psubd %%mm7, %%mm4 \n\t" /* A0-B0 a0-b0 */\
- "paddd %%mm2, %%mm5 \n\t" /* B1 b1 */\
- "psrad $" #shift ", %%mm7 \n\t"\
- "psrad $" #shift ", %%mm4 \n\t"\
- "movq %%mm1, %%mm2 \n\t" /* A1 a1 */\
- "paddd %%mm5, %%mm1 \n\t" /* A1+B1 a1+b1 */\
- "psubd %%mm5, %%mm2 \n\t" /* A1-B1 a1-b1 */\
- "psrad $" #shift ", %%mm1 \n\t"\
- "psrad $" #shift ", %%mm2 \n\t"\
- "packssdw %%mm1, %%mm7 \n\t" /* A1+B1 a1+b1 A0+B0 a0+b0 */\
- "packssdw %%mm4, %%mm2 \n\t" /* A0-B0 a0-b0 A1-B1 a1-b1 */\
- "movq %%mm7, " #dst " \n\t"\
- "movq " #src1 ", %%mm1 \n\t" /* R3 R1 r3 r1 */\
- "movq 80(%2), %%mm4 \n\t" /* -C1 C5 -C1 C5 */\
- "movq %%mm2, 24+" #dst " \n\t"\
- "pmaddwd %%mm1, %%mm4 \n\t" /* -C1R3+C5R1 -C1r3+C5r1 */\
- "movq 88(%2), %%mm7 \n\t" /* C3 C7 C3 C7 */\
- "pmaddwd 96(%2), %%mm1 \n\t" /* -C5R3+C7R1 -C5r3+C7r1 */\
- "pmaddwd %%mm3, %%mm7 \n\t" /* C3R7+C7R5 C3r7+C7r5 */\
- "movq %%mm0, %%mm2 \n\t" /* A2 a2 */\
- "pmaddwd 104(%2), %%mm3 \n\t" /* -C1R7+C3R5 -C1r7+C3r5 */\
- "paddd %%mm7, %%mm4 \n\t" /* B2 b2 */\
- "paddd %%mm4, %%mm2 \n\t" /* A2+B2 a2+b2 */\
- "psubd %%mm4, %%mm0 \n\t" /* a2-B2 a2-b2 */\
- "psrad $" #shift ", %%mm2 \n\t"\
- "psrad $" #shift ", %%mm0 \n\t"\
- "movq %%mm6, %%mm4 \n\t" /* A3 a3 */\
- "paddd %%mm1, %%mm3 \n\t" /* B3 b3 */\
- "paddd %%mm3, %%mm6 \n\t" /* A3+B3 a3+b3 */\
- "psubd %%mm3, %%mm4 \n\t" /* a3-B3 a3-b3 */\
- "psrad $" #shift ", %%mm6 \n\t"\
- "packssdw %%mm6, %%mm2 \n\t" /* A3+B3 a3+b3 A2+B2 a2+b2 */\
- "movq %%mm2, 8+" #dst " \n\t"\
- "psrad $" #shift ", %%mm4 \n\t"\
- "packssdw %%mm0, %%mm4 \n\t" /* A2-B2 a2-b2 A3-B3 a3-b3 */\
- "movq %%mm4, 16+" #dst " \n\t"\
- "jmp 2f \n\t"\
- "1: \n\t"\
- "pslld $16, %%mm0 \n\t"\
- "#paddd "MANGLE(d40000)", %%mm0 \n\t"\
- "psrad $13, %%mm0 \n\t"\
- "packssdw %%mm0, %%mm0 \n\t"\
- "movq %%mm0, " #dst " \n\t"\
- "movq %%mm0, 8+" #dst " \n\t"\
- "movq %%mm0, 16+" #dst " \n\t"\
- "movq %%mm0, 24+" #dst " \n\t"\
- "2: \n\t"
-
-
-//IDCT( src0, src4, src1, src5, dst, rounder, shift)
-ROW_IDCT( (%0), 8(%0), 16(%0), 24(%0), 0(%1),paddd 8(%2), 11)
-/*ROW_IDCT( 32(%0), 40(%0), 48(%0), 56(%0), 32(%1), paddd (%2), 11)
-ROW_IDCT( 64(%0), 72(%0), 80(%0), 88(%0), 64(%1), paddd (%2), 11)
-ROW_IDCT( 96(%0),104(%0),112(%0),120(%0), 96(%1), paddd (%2), 11)*/
-
-DC_COND_ROW_IDCT( 32(%0), 40(%0), 48(%0), 56(%0), 32(%1),paddd (%2), 11)
-DC_COND_ROW_IDCT( 64(%0), 72(%0), 80(%0), 88(%0), 64(%1),paddd (%2), 11)
-DC_COND_ROW_IDCT( 96(%0),104(%0),112(%0),120(%0), 96(%1),paddd (%2), 11)
-
-
-//IDCT( src0, src4, src1, src5, dst, shift)
-COL_IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0), 20)
-COL_IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0), 20)
-COL_IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), 20)
-COL_IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0), 20)
-
-#else
-
-#define DC_COND_IDCT(src0, src4, src1, src5, dst, rounder, shift) \
- "movq " #src0 ", %%mm0 \n\t" /* R4 R0 r4 r0 */\
- "movq " #src4 ", %%mm1 \n\t" /* R6 R2 r6 r2 */\
- "movq " #src1 ", %%mm2 \n\t" /* R3 R1 r3 r1 */\
- "movq " #src5 ", %%mm3 \n\t" /* R7 R5 r7 r5 */\
- "movq "MANGLE(wm1010)", %%mm4 \n\t"\
- "pand %%mm0, %%mm4 \n\t"\
- "por %%mm1, %%mm4 \n\t"\
- "por %%mm2, %%mm4 \n\t"\
- "por %%mm3, %%mm4 \n\t"\
- "packssdw %%mm4,%%mm4 \n\t"\
- "movd %%mm4, %%eax \n\t"\
- "orl %%eax, %%eax \n\t"\
- "jz 1f \n\t"\
- "movq 16(%2), %%mm4 \n\t" /* C4 C4 C4 C4 */\
- "pmaddwd %%mm0, %%mm4 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
- "movq 24(%2), %%mm5 \n\t" /* -C4 C4 -C4 C4 */\
- "pmaddwd %%mm5, %%mm0 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
- "movq 32(%2), %%mm5 \n\t" /* C6 C2 C6 C2 */\
- "pmaddwd %%mm1, %%mm5 \n\t" /* C6R6+C2R2 C6r6+C2r2 */\
- "movq 40(%2), %%mm6 \n\t" /* -C2 C6 -C2 C6 */\
- "pmaddwd %%mm6, %%mm1 \n\t" /* -C2R6+C6R2 -C2r6+C6r2 */\
- "movq 48(%2), %%mm7 \n\t" /* C3 C1 C3 C1 */\
- "pmaddwd %%mm2, %%mm7 \n\t" /* C3R3+C1R1 C3r3+C1r1 */\
- #rounder ", %%mm4 \n\t"\
- "movq %%mm4, %%mm6 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
- "paddd %%mm5, %%mm4 \n\t" /* A0 a0 */\
- "psubd %%mm5, %%mm6 \n\t" /* A3 a3 */\
- "movq 56(%2), %%mm5 \n\t" /* C7 C5 C7 C5 */\
- "pmaddwd %%mm3, %%mm5 \n\t" /* C7R7+C5R5 C7r7+C5r5 */\
- #rounder ", %%mm0 \n\t"\
- "paddd %%mm0, %%mm1 \n\t" /* A1 a1 */\
- "paddd %%mm0, %%mm0 \n\t" \
- "psubd %%mm1, %%mm0 \n\t" /* A2 a2 */\
- "pmaddwd 64(%2), %%mm2 \n\t" /* -C7R3+C3R1 -C7r3+C3r1 */\
- "paddd %%mm5, %%mm7 \n\t" /* B0 b0 */\
- "movq 72(%2), %%mm5 \n\t" /* -C5 -C1 -C5 -C1 */\
- "pmaddwd %%mm3, %%mm5 \n\t" /* -C5R7-C1R5 -C5r7-C1r5 */\
- "paddd %%mm4, %%mm7 \n\t" /* A0+B0 a0+b0 */\
- "paddd %%mm4, %%mm4 \n\t" /* 2A0 2a0 */\
- "psubd %%mm7, %%mm4 \n\t" /* A0-B0 a0-b0 */\
- "paddd %%mm2, %%mm5 \n\t" /* B1 b1 */\
- "psrad $" #shift ", %%mm7 \n\t"\
- "psrad $" #shift ", %%mm4 \n\t"\
- "movq %%mm1, %%mm2 \n\t" /* A1 a1 */\
- "paddd %%mm5, %%mm1 \n\t" /* A1+B1 a1+b1 */\
- "psubd %%mm5, %%mm2 \n\t" /* A1-B1 a1-b1 */\
- "psrad $" #shift ", %%mm1 \n\t"\
- "psrad $" #shift ", %%mm2 \n\t"\
- "packssdw %%mm1, %%mm7 \n\t" /* A1+B1 a1+b1 A0+B0 a0+b0 */\
- "packssdw %%mm4, %%mm2 \n\t" /* A0-B0 a0-b0 A1-B1 a1-b1 */\
- "movq %%mm7, " #dst " \n\t"\
- "movq " #src1 ", %%mm1 \n\t" /* R3 R1 r3 r1 */\
- "movq 80(%2), %%mm4 \n\t" /* -C1 C5 -C1 C5 */\
- "movq %%mm2, 24+" #dst " \n\t"\
- "pmaddwd %%mm1, %%mm4 \n\t" /* -C1R3+C5R1 -C1r3+C5r1 */\
- "movq 88(%2), %%mm7 \n\t" /* C3 C7 C3 C7 */\
- "pmaddwd 96(%2), %%mm1 \n\t" /* -C5R3+C7R1 -C5r3+C7r1 */\
- "pmaddwd %%mm3, %%mm7 \n\t" /* C3R7+C7R5 C3r7+C7r5 */\
- "movq %%mm0, %%mm2 \n\t" /* A2 a2 */\
- "pmaddwd 104(%2), %%mm3 \n\t" /* -C1R7+C3R5 -C1r7+C3r5 */\
- "paddd %%mm7, %%mm4 \n\t" /* B2 b2 */\
- "paddd %%mm4, %%mm2 \n\t" /* A2+B2 a2+b2 */\
- "psubd %%mm4, %%mm0 \n\t" /* a2-B2 a2-b2 */\
- "psrad $" #shift ", %%mm2 \n\t"\
- "psrad $" #shift ", %%mm0 \n\t"\
- "movq %%mm6, %%mm4 \n\t" /* A3 a3 */\
- "paddd %%mm1, %%mm3 \n\t" /* B3 b3 */\
- "paddd %%mm3, %%mm6 \n\t" /* A3+B3 a3+b3 */\
- "psubd %%mm3, %%mm4 \n\t" /* a3-B3 a3-b3 */\
- "psrad $" #shift ", %%mm6 \n\t"\
- "packssdw %%mm6, %%mm2 \n\t" /* A3+B3 a3+b3 A2+B2 a2+b2 */\
- "movq %%mm2, 8+" #dst " \n\t"\
- "psrad $" #shift ", %%mm4 \n\t"\
- "packssdw %%mm0, %%mm4 \n\t" /* A2-B2 a2-b2 A3-B3 a3-b3 */\
- "movq %%mm4, 16+" #dst " \n\t"\
- "jmp 2f \n\t"\
- "1: \n\t"\
- "pslld $16, %%mm0 \n\t"\
- "paddd "MANGLE(d40000)", %%mm0 \n\t"\
- "psrad $13, %%mm0 \n\t"\
- "packssdw %%mm0, %%mm0 \n\t"\
- "movq %%mm0, " #dst " \n\t"\
- "movq %%mm0, 8+" #dst " \n\t"\
- "movq %%mm0, 16+" #dst " \n\t"\
- "movq %%mm0, 24+" #dst " \n\t"\
- "2: \n\t"
-
-#define Z_COND_IDCT(src0, src4, src1, src5, dst, rounder, shift, bt) \
- "movq " #src0 ", %%mm0 \n\t" /* R4 R0 r4 r0 */\
- "movq " #src4 ", %%mm1 \n\t" /* R6 R2 r6 r2 */\
- "movq " #src1 ", %%mm2 \n\t" /* R3 R1 r3 r1 */\
- "movq " #src5 ", %%mm3 \n\t" /* R7 R5 r7 r5 */\
- "movq %%mm0, %%mm4 \n\t"\
- "por %%mm1, %%mm4 \n\t"\
- "por %%mm2, %%mm4 \n\t"\
- "por %%mm3, %%mm4 \n\t"\
- "packssdw %%mm4,%%mm4 \n\t"\
- "movd %%mm4, %%eax \n\t"\
- "orl %%eax, %%eax \n\t"\
- "jz " #bt " \n\t"\
- "movq 16(%2), %%mm4 \n\t" /* C4 C4 C4 C4 */\
- "pmaddwd %%mm0, %%mm4 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
- "movq 24(%2), %%mm5 \n\t" /* -C4 C4 -C4 C4 */\
- "pmaddwd %%mm5, %%mm0 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
- "movq 32(%2), %%mm5 \n\t" /* C6 C2 C6 C2 */\
- "pmaddwd %%mm1, %%mm5 \n\t" /* C6R6+C2R2 C6r6+C2r2 */\
- "movq 40(%2), %%mm6 \n\t" /* -C2 C6 -C2 C6 */\
- "pmaddwd %%mm6, %%mm1 \n\t" /* -C2R6+C6R2 -C2r6+C6r2 */\
- "movq 48(%2), %%mm7 \n\t" /* C3 C1 C3 C1 */\
- "pmaddwd %%mm2, %%mm7 \n\t" /* C3R3+C1R1 C3r3+C1r1 */\
- #rounder ", %%mm4 \n\t"\
- "movq %%mm4, %%mm6 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
- "paddd %%mm5, %%mm4 \n\t" /* A0 a0 */\
- "psubd %%mm5, %%mm6 \n\t" /* A3 a3 */\
- "movq 56(%2), %%mm5 \n\t" /* C7 C5 C7 C5 */\
- "pmaddwd %%mm3, %%mm5 \n\t" /* C7R7+C5R5 C7r7+C5r5 */\
- #rounder ", %%mm0 \n\t"\
- "paddd %%mm0, %%mm1 \n\t" /* A1 a1 */\
- "paddd %%mm0, %%mm0 \n\t" \
- "psubd %%mm1, %%mm0 \n\t" /* A2 a2 */\
- "pmaddwd 64(%2), %%mm2 \n\t" /* -C7R3+C3R1 -C7r3+C3r1 */\
- "paddd %%mm5, %%mm7 \n\t" /* B0 b0 */\
- "movq 72(%2), %%mm5 \n\t" /* -C5 -C1 -C5 -C1 */\
- "pmaddwd %%mm3, %%mm5 \n\t" /* -C5R7-C1R5 -C5r7-C1r5 */\
- "paddd %%mm4, %%mm7 \n\t" /* A0+B0 a0+b0 */\
- "paddd %%mm4, %%mm4 \n\t" /* 2A0 2a0 */\
- "psubd %%mm7, %%mm4 \n\t" /* A0-B0 a0-b0 */\
- "paddd %%mm2, %%mm5 \n\t" /* B1 b1 */\
- "psrad $" #shift ", %%mm7 \n\t"\
- "psrad $" #shift ", %%mm4 \n\t"\
- "movq %%mm1, %%mm2 \n\t" /* A1 a1 */\
- "paddd %%mm5, %%mm1 \n\t" /* A1+B1 a1+b1 */\
- "psubd %%mm5, %%mm2 \n\t" /* A1-B1 a1-b1 */\
- "psrad $" #shift ", %%mm1 \n\t"\
- "psrad $" #shift ", %%mm2 \n\t"\
- "packssdw %%mm1, %%mm7 \n\t" /* A1+B1 a1+b1 A0+B0 a0+b0 */\
- "packssdw %%mm4, %%mm2 \n\t" /* A0-B0 a0-b0 A1-B1 a1-b1 */\
- "movq %%mm7, " #dst " \n\t"\
- "movq " #src1 ", %%mm1 \n\t" /* R3 R1 r3 r1 */\
- "movq 80(%2), %%mm4 \n\t" /* -C1 C5 -C1 C5 */\
- "movq %%mm2, 24+" #dst " \n\t"\
- "pmaddwd %%mm1, %%mm4 \n\t" /* -C1R3+C5R1 -C1r3+C5r1 */\
- "movq 88(%2), %%mm7 \n\t" /* C3 C7 C3 C7 */\
- "pmaddwd 96(%2), %%mm1 \n\t" /* -C5R3+C7R1 -C5r3+C7r1 */\
- "pmaddwd %%mm3, %%mm7 \n\t" /* C3R7+C7R5 C3r7+C7r5 */\
- "movq %%mm0, %%mm2 \n\t" /* A2 a2 */\
- "pmaddwd 104(%2), %%mm3 \n\t" /* -C1R7+C3R5 -C1r7+C3r5 */\
- "paddd %%mm7, %%mm4 \n\t" /* B2 b2 */\
- "paddd %%mm4, %%mm2 \n\t" /* A2+B2 a2+b2 */\
- "psubd %%mm4, %%mm0 \n\t" /* a2-B2 a2-b2 */\
- "psrad $" #shift ", %%mm2 \n\t"\
- "psrad $" #shift ", %%mm0 \n\t"\
- "movq %%mm6, %%mm4 \n\t" /* A3 a3 */\
- "paddd %%mm1, %%mm3 \n\t" /* B3 b3 */\
- "paddd %%mm3, %%mm6 \n\t" /* A3+B3 a3+b3 */\
- "psubd %%mm3, %%mm4 \n\t" /* a3-B3 a3-b3 */\
- "psrad $" #shift ", %%mm6 \n\t"\
- "packssdw %%mm6, %%mm2 \n\t" /* A3+B3 a3+b3 A2+B2 a2+b2 */\
- "movq %%mm2, 8+" #dst " \n\t"\
- "psrad $" #shift ", %%mm4 \n\t"\
- "packssdw %%mm0, %%mm4 \n\t" /* A2-B2 a2-b2 A3-B3 a3-b3 */\
- "movq %%mm4, 16+" #dst " \n\t"\
-
-#define ROW_IDCT(src0, src4, src1, src5, dst, rounder, shift) \
- "movq " #src0 ", %%mm0 \n\t" /* R4 R0 r4 r0 */\
- "movq " #src4 ", %%mm1 \n\t" /* R6 R2 r6 r2 */\
- "movq " #src1 ", %%mm2 \n\t" /* R3 R1 r3 r1 */\
- "movq " #src5 ", %%mm3 \n\t" /* R7 R5 r7 r5 */\
- "movq 16(%2), %%mm4 \n\t" /* C4 C4 C4 C4 */\
- "pmaddwd %%mm0, %%mm4 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
- "movq 24(%2), %%mm5 \n\t" /* -C4 C4 -C4 C4 */\
- "pmaddwd %%mm5, %%mm0 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
- "movq 32(%2), %%mm5 \n\t" /* C6 C2 C6 C2 */\
- "pmaddwd %%mm1, %%mm5 \n\t" /* C6R6+C2R2 C6r6+C2r2 */\
- "movq 40(%2), %%mm6 \n\t" /* -C2 C6 -C2 C6 */\
- "pmaddwd %%mm6, %%mm1 \n\t" /* -C2R6+C6R2 -C2r6+C6r2 */\
- "movq 48(%2), %%mm7 \n\t" /* C3 C1 C3 C1 */\
- "pmaddwd %%mm2, %%mm7 \n\t" /* C3R3+C1R1 C3r3+C1r1 */\
- #rounder ", %%mm4 \n\t"\
- "movq %%mm4, %%mm6 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
- "paddd %%mm5, %%mm4 \n\t" /* A0 a0 */\
- "psubd %%mm5, %%mm6 \n\t" /* A3 a3 */\
- "movq 56(%2), %%mm5 \n\t" /* C7 C5 C7 C5 */\
- "pmaddwd %%mm3, %%mm5 \n\t" /* C7R7+C5R5 C7r7+C5r5 */\
- #rounder ", %%mm0 \n\t"\
- "paddd %%mm0, %%mm1 \n\t" /* A1 a1 */\
- "paddd %%mm0, %%mm0 \n\t" \
- "psubd %%mm1, %%mm0 \n\t" /* A2 a2 */\
- "pmaddwd 64(%2), %%mm2 \n\t" /* -C7R3+C3R1 -C7r3+C3r1 */\
- "paddd %%mm5, %%mm7 \n\t" /* B0 b0 */\
- "movq 72(%2), %%mm5 \n\t" /* -C5 -C1 -C5 -C1 */\
- "pmaddwd %%mm3, %%mm5 \n\t" /* -C5R7-C1R5 -C5r7-C1r5 */\
- "paddd %%mm4, %%mm7 \n\t" /* A0+B0 a0+b0 */\
- "paddd %%mm4, %%mm4 \n\t" /* 2A0 2a0 */\
- "psubd %%mm7, %%mm4 \n\t" /* A0-B0 a0-b0 */\
- "paddd %%mm2, %%mm5 \n\t" /* B1 b1 */\
- "psrad $" #shift ", %%mm7 \n\t"\
- "psrad $" #shift ", %%mm4 \n\t"\
- "movq %%mm1, %%mm2 \n\t" /* A1 a1 */\
- "paddd %%mm5, %%mm1 \n\t" /* A1+B1 a1+b1 */\
- "psubd %%mm5, %%mm2 \n\t" /* A1-B1 a1-b1 */\
- "psrad $" #shift ", %%mm1 \n\t"\
- "psrad $" #shift ", %%mm2 \n\t"\
- "packssdw %%mm1, %%mm7 \n\t" /* A1+B1 a1+b1 A0+B0 a0+b0 */\
- "packssdw %%mm4, %%mm2 \n\t" /* A0-B0 a0-b0 A1-B1 a1-b1 */\
- "movq %%mm7, " #dst " \n\t"\
- "movq " #src1 ", %%mm1 \n\t" /* R3 R1 r3 r1 */\
- "movq 80(%2), %%mm4 \n\t" /* -C1 C5 -C1 C5 */\
- "movq %%mm2, 24+" #dst " \n\t"\
- "pmaddwd %%mm1, %%mm4 \n\t" /* -C1R3+C5R1 -C1r3+C5r1 */\
- "movq 88(%2), %%mm7 \n\t" /* C3 C7 C3 C7 */\
- "pmaddwd 96(%2), %%mm1 \n\t" /* -C5R3+C7R1 -C5r3+C7r1 */\
- "pmaddwd %%mm3, %%mm7 \n\t" /* C3R7+C7R5 C3r7+C7r5 */\
- "movq %%mm0, %%mm2 \n\t" /* A2 a2 */\
- "pmaddwd 104(%2), %%mm3 \n\t" /* -C1R7+C3R5 -C1r7+C3r5 */\
- "paddd %%mm7, %%mm4 \n\t" /* B2 b2 */\
- "paddd %%mm4, %%mm2 \n\t" /* A2+B2 a2+b2 */\
- "psubd %%mm4, %%mm0 \n\t" /* a2-B2 a2-b2 */\
- "psrad $" #shift ", %%mm2 \n\t"\
- "psrad $" #shift ", %%mm0 \n\t"\
- "movq %%mm6, %%mm4 \n\t" /* A3 a3 */\
- "paddd %%mm1, %%mm3 \n\t" /* B3 b3 */\
- "paddd %%mm3, %%mm6 \n\t" /* A3+B3 a3+b3 */\
- "psubd %%mm3, %%mm4 \n\t" /* a3-B3 a3-b3 */\
- "psrad $" #shift ", %%mm6 \n\t"\
- "packssdw %%mm6, %%mm2 \n\t" /* A3+B3 a3+b3 A2+B2 a2+b2 */\
- "movq %%mm2, 8+" #dst " \n\t"\
- "psrad $" #shift ", %%mm4 \n\t"\
- "packssdw %%mm0, %%mm4 \n\t" /* A2-B2 a2-b2 A3-B3 a3-b3 */\
- "movq %%mm4, 16+" #dst " \n\t"\
-
-//IDCT( src0, src4, src1, src5, dst, rounder, shift)
-DC_COND_IDCT( 0(%0), 8(%0), 16(%0), 24(%0), 0(%1),paddd 8(%2), 11)
-Z_COND_IDCT( 32(%0), 40(%0), 48(%0), 56(%0), 32(%1),paddd (%2), 11, 4f)
-Z_COND_IDCT( 64(%0), 72(%0), 80(%0), 88(%0), 64(%1),paddd (%2), 11, 2f)
-Z_COND_IDCT( 96(%0),104(%0),112(%0),120(%0), 96(%1),paddd (%2), 11, 1f)
-
-#undef IDCT
-#define IDCT(src0, src4, src1, src5, dst, shift) \
- "movq " #src0 ", %%mm0 \n\t" /* R4 R0 r4 r0 */\
- "movq " #src4 ", %%mm1 \n\t" /* R6 R2 r6 r2 */\
- "movq " #src1 ", %%mm2 \n\t" /* R3 R1 r3 r1 */\
- "movq " #src5 ", %%mm3 \n\t" /* R7 R5 r7 r5 */\
- "movq 16(%2), %%mm4 \n\t" /* C4 C4 C4 C4 */\
- "pmaddwd %%mm0, %%mm4 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
- "movq 24(%2), %%mm5 \n\t" /* -C4 C4 -C4 C4 */\
- "pmaddwd %%mm5, %%mm0 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
- "movq 32(%2), %%mm5 \n\t" /* C6 C2 C6 C2 */\
- "pmaddwd %%mm1, %%mm5 \n\t" /* C6R6+C2R2 C6r6+C2r2 */\
- "movq 40(%2), %%mm6 \n\t" /* -C2 C6 -C2 C6 */\
- "pmaddwd %%mm6, %%mm1 \n\t" /* -C2R6+C6R2 -C2r6+C6r2 */\
- "movq %%mm4, %%mm6 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
- "movq 48(%2), %%mm7 \n\t" /* C3 C1 C3 C1 */\
- "pmaddwd %%mm2, %%mm7 \n\t" /* C3R3+C1R1 C3r3+C1r1 */\
- "paddd %%mm5, %%mm4 \n\t" /* A0 a0 */\
- "psubd %%mm5, %%mm6 \n\t" /* A3 a3 */\
- "movq %%mm0, %%mm5 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
- "paddd %%mm1, %%mm0 \n\t" /* A1 a1 */\
- "psubd %%mm1, %%mm5 \n\t" /* A2 a2 */\
- "movq 56(%2), %%mm1 \n\t" /* C7 C5 C7 C5 */\
- "pmaddwd %%mm3, %%mm1 \n\t" /* C7R7+C5R5 C7r7+C5r5 */\
- "pmaddwd 64(%2), %%mm2 \n\t" /* -C7R3+C3R1 -C7r3+C3r1 */\
- "paddd %%mm1, %%mm7 \n\t" /* B0 b0 */\
- "movq 72(%2), %%mm1 \n\t" /* -C5 -C1 -C5 -C1 */\
- "pmaddwd %%mm3, %%mm1 \n\t" /* -C5R7-C1R5 -C5r7-C1r5 */\
- "paddd %%mm4, %%mm7 \n\t" /* A0+B0 a0+b0 */\
- "paddd %%mm4, %%mm4 \n\t" /* 2A0 2a0 */\
- "psubd %%mm7, %%mm4 \n\t" /* A0-B0 a0-b0 */\
- "paddd %%mm2, %%mm1 \n\t" /* B1 b1 */\
- "psrad $" #shift ", %%mm7 \n\t"\
- "psrad $" #shift ", %%mm4 \n\t"\
- "movq %%mm0, %%mm2 \n\t" /* A1 a1 */\
- "paddd %%mm1, %%mm0 \n\t" /* A1+B1 a1+b1 */\
- "psubd %%mm1, %%mm2 \n\t" /* A1-B1 a1-b1 */\
- "psrad $" #shift ", %%mm0 \n\t"\
- "psrad $" #shift ", %%mm2 \n\t"\
- "packssdw %%mm7, %%mm7 \n\t" /* A0+B0 a0+b0 */\
- "movd %%mm7, " #dst " \n\t"\
- "packssdw %%mm0, %%mm0 \n\t" /* A1+B1 a1+b1 */\
- "movd %%mm0, 16+" #dst " \n\t"\
- "packssdw %%mm2, %%mm2 \n\t" /* A1-B1 a1-b1 */\
- "movd %%mm2, 96+" #dst " \n\t"\
- "packssdw %%mm4, %%mm4 \n\t" /* A0-B0 a0-b0 */\
- "movd %%mm4, 112+" #dst " \n\t"\
- "movq " #src1 ", %%mm0 \n\t" /* R3 R1 r3 r1 */\
- "movq 80(%2), %%mm4 \n\t" /* -C1 C5 -C1 C5 */\
- "pmaddwd %%mm0, %%mm4 \n\t" /* -C1R3+C5R1 -C1r3+C5r1 */\
- "movq 88(%2), %%mm7 \n\t" /* C3 C7 C3 C7 */\
- "pmaddwd 96(%2), %%mm0 \n\t" /* -C5R3+C7R1 -C5r3+C7r1 */\
- "pmaddwd %%mm3, %%mm7 \n\t" /* C3R7+C7R5 C3r7+C7r5 */\
- "movq %%mm5, %%mm2 \n\t" /* A2 a2 */\
- "pmaddwd 104(%2), %%mm3 \n\t" /* -C1R7+C3R5 -C1r7+C3r5 */\
- "paddd %%mm7, %%mm4 \n\t" /* B2 b2 */\
- "paddd %%mm4, %%mm2 \n\t" /* A2+B2 a2+b2 */\
- "psubd %%mm4, %%mm5 \n\t" /* a2-B2 a2-b2 */\
- "psrad $" #shift ", %%mm2 \n\t"\
- "psrad $" #shift ", %%mm5 \n\t"\
- "movq %%mm6, %%mm4 \n\t" /* A3 a3 */\
- "paddd %%mm0, %%mm3 \n\t" /* B3 b3 */\
- "paddd %%mm3, %%mm6 \n\t" /* A3+B3 a3+b3 */\
- "psubd %%mm3, %%mm4 \n\t" /* a3-B3 a3-b3 */\
- "psrad $" #shift ", %%mm6 \n\t"\
- "psrad $" #shift ", %%mm4 \n\t"\
- "packssdw %%mm2, %%mm2 \n\t" /* A2+B2 a2+b2 */\
- "packssdw %%mm6, %%mm6 \n\t" /* A3+B3 a3+b3 */\
- "movd %%mm2, 32+" #dst " \n\t"\
- "packssdw %%mm4, %%mm4 \n\t" /* A3-B3 a3-b3 */\
- "packssdw %%mm5, %%mm5 \n\t" /* A2-B2 a2-b2 */\
- "movd %%mm6, 48+" #dst " \n\t"\
- "movd %%mm4, 64+" #dst " \n\t"\
- "movd %%mm5, 80+" #dst " \n\t"
-
-
-//IDCT( src0, src4, src1, src5, dst, shift)
-IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0), 20)
-IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0), 20)
-IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), 20)
-IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0), 20)
- "jmp 9f \n\t"
-
- "#" ASMALIGN(4) \
- "4: \n\t"
-Z_COND_IDCT( 64(%0), 72(%0), 80(%0), 88(%0), 64(%1),paddd (%2), 11, 6f)
-Z_COND_IDCT( 96(%0),104(%0),112(%0),120(%0), 96(%1),paddd (%2), 11, 5f)
-
-#undef IDCT
-#define IDCT(src0, src4, src1, src5, dst, shift) \
- "movq " #src0 ", %%mm0 \n\t" /* R4 R0 r4 r0 */\
- "movq " #src4 ", %%mm1 \n\t" /* R6 R2 r6 r2 */\
- "movq " #src5 ", %%mm3 \n\t" /* R7 R5 r7 r5 */\
- "movq 16(%2), %%mm4 \n\t" /* C4 C4 C4 C4 */\
- "pmaddwd %%mm0, %%mm4 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
- "movq 24(%2), %%mm5 \n\t" /* -C4 C4 -C4 C4 */\
- "pmaddwd %%mm5, %%mm0 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
- "movq 32(%2), %%mm5 \n\t" /* C6 C2 C6 C2 */\
- "pmaddwd %%mm1, %%mm5 \n\t" /* C6R6+C2R2 C6r6+C2r2 */\
- "movq 40(%2), %%mm6 \n\t" /* -C2 C6 -C2 C6 */\
- "pmaddwd %%mm6, %%mm1 \n\t" /* -C2R6+C6R2 -C2r6+C6r2 */\
- "movq %%mm4, %%mm6 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
- "paddd %%mm5, %%mm4 \n\t" /* A0 a0 */\
- "psubd %%mm5, %%mm6 \n\t" /* A3 a3 */\
- "movq %%mm0, %%mm5 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
- "paddd %%mm1, %%mm0 \n\t" /* A1 a1 */\
- "psubd %%mm1, %%mm5 \n\t" /* A2 a2 */\
- "movq 56(%2), %%mm1 \n\t" /* C7 C5 C7 C5 */\
- "pmaddwd %%mm3, %%mm1 \n\t" /* C7R7+C5R5 C7r7+C5r5 */\
- "movq 72(%2), %%mm7 \n\t" /* -C5 -C1 -C5 -C1 */\
- "pmaddwd %%mm3, %%mm7 \n\t" /* -C5R7-C1R5 -C5r7-C1r5 */\
- "paddd %%mm4, %%mm1 \n\t" /* A0+B0 a0+b0 */\
- "paddd %%mm4, %%mm4 \n\t" /* 2A0 2a0 */\
- "psubd %%mm1, %%mm4 \n\t" /* A0-B0 a0-b0 */\
- "psrad $" #shift ", %%mm1 \n\t"\
- "psrad $" #shift ", %%mm4 \n\t"\
- "movq %%mm0, %%mm2 \n\t" /* A1 a1 */\
- "paddd %%mm7, %%mm0 \n\t" /* A1+B1 a1+b1 */\
- "psubd %%mm7, %%mm2 \n\t" /* A1-B1 a1-b1 */\
- "psrad $" #shift ", %%mm0 \n\t"\
- "psrad $" #shift ", %%mm2 \n\t"\
- "packssdw %%mm1, %%mm1 \n\t" /* A0+B0 a0+b0 */\
- "movd %%mm1, " #dst " \n\t"\
- "packssdw %%mm0, %%mm0 \n\t" /* A1+B1 a1+b1 */\
- "movd %%mm0, 16+" #dst " \n\t"\
- "packssdw %%mm2, %%mm2 \n\t" /* A1-B1 a1-b1 */\
- "movd %%mm2, 96+" #dst " \n\t"\
- "packssdw %%mm4, %%mm4 \n\t" /* A0-B0 a0-b0 */\
- "movd %%mm4, 112+" #dst " \n\t"\
- "movq 88(%2), %%mm1 \n\t" /* C3 C7 C3 C7 */\
- "pmaddwd %%mm3, %%mm1 \n\t" /* C3R7+C7R5 C3r7+C7r5 */\
- "movq %%mm5, %%mm2 \n\t" /* A2 a2 */\
- "pmaddwd 104(%2), %%mm3 \n\t" /* -C1R7+C3R5 -C1r7+C3r5 */\
- "paddd %%mm1, %%mm2 \n\t" /* A2+B2 a2+b2 */\
- "psubd %%mm1, %%mm5 \n\t" /* a2-B2 a2-b2 */\
- "psrad $" #shift ", %%mm2 \n\t"\
- "psrad $" #shift ", %%mm5 \n\t"\
- "movq %%mm6, %%mm1 \n\t" /* A3 a3 */\
- "paddd %%mm3, %%mm6 \n\t" /* A3+B3 a3+b3 */\
- "psubd %%mm3, %%mm1 \n\t" /* a3-B3 a3-b3 */\
- "psrad $" #shift ", %%mm6 \n\t"\
- "psrad $" #shift ", %%mm1 \n\t"\
- "packssdw %%mm2, %%mm2 \n\t" /* A2+B2 a2+b2 */\
- "packssdw %%mm6, %%mm6 \n\t" /* A3+B3 a3+b3 */\
- "movd %%mm2, 32+" #dst " \n\t"\
- "packssdw %%mm1, %%mm1 \n\t" /* A3-B3 a3-b3 */\
- "packssdw %%mm5, %%mm5 \n\t" /* A2-B2 a2-b2 */\
- "movd %%mm6, 48+" #dst " \n\t"\
- "movd %%mm1, 64+" #dst " \n\t"\
- "movd %%mm5, 80+" #dst " \n\t"
-
-//IDCT( src0, src4, src1, src5, dst, shift)
-IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0), 20)
-IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0), 20)
-IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), 20)
-IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0), 20)
- "jmp 9f \n\t"
-
- "#" ASMALIGN(4) \
- "6: \n\t"
-Z_COND_IDCT( 96(%0),104(%0),112(%0),120(%0), 96(%1),paddd (%2), 11, 7f)
-
-#undef IDCT
-#define IDCT(src0, src4, src1, src5, dst, shift) \
- "movq " #src0 ", %%mm0 \n\t" /* R4 R0 r4 r0 */\
- "movq " #src5 ", %%mm3 \n\t" /* R7 R5 r7 r5 */\
- "movq 16(%2), %%mm4 \n\t" /* C4 C4 C4 C4 */\
- "pmaddwd %%mm0, %%mm4 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
- "movq 24(%2), %%mm5 \n\t" /* -C4 C4 -C4 C4 */\
- "pmaddwd %%mm5, %%mm0 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
- "movq %%mm4, %%mm6 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
- "movq %%mm0, %%mm5 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
- "movq 56(%2), %%mm1 \n\t" /* C7 C5 C7 C5 */\
- "pmaddwd %%mm3, %%mm1 \n\t" /* C7R7+C5R5 C7r7+C5r5 */\
- "movq 72(%2), %%mm7 \n\t" /* -C5 -C1 -C5 -C1 */\
- "pmaddwd %%mm3, %%mm7 \n\t" /* -C5R7-C1R5 -C5r7-C1r5 */\
- "paddd %%mm4, %%mm1 \n\t" /* A0+B0 a0+b0 */\
- "paddd %%mm4, %%mm4 \n\t" /* 2A0 2a0 */\
- "psubd %%mm1, %%mm4 \n\t" /* A0-B0 a0-b0 */\
- "psrad $" #shift ", %%mm1 \n\t"\
- "psrad $" #shift ", %%mm4 \n\t"\
- "movq %%mm0, %%mm2 \n\t" /* A1 a1 */\
- "paddd %%mm7, %%mm0 \n\t" /* A1+B1 a1+b1 */\
- "psubd %%mm7, %%mm2 \n\t" /* A1-B1 a1-b1 */\
- "psrad $" #shift ", %%mm0 \n\t"\
- "psrad $" #shift ", %%mm2 \n\t"\
- "packssdw %%mm1, %%mm1 \n\t" /* A0+B0 a0+b0 */\
- "movd %%mm1, " #dst " \n\t"\
- "packssdw %%mm0, %%mm0 \n\t" /* A1+B1 a1+b1 */\
- "movd %%mm0, 16+" #dst " \n\t"\
- "packssdw %%mm2, %%mm2 \n\t" /* A1-B1 a1-b1 */\
- "movd %%mm2, 96+" #dst " \n\t"\
- "packssdw %%mm4, %%mm4 \n\t" /* A0-B0 a0-b0 */\
- "movd %%mm4, 112+" #dst " \n\t"\
- "movq 88(%2), %%mm1 \n\t" /* C3 C7 C3 C7 */\
- "pmaddwd %%mm3, %%mm1 \n\t" /* C3R7+C7R5 C3r7+C7r5 */\
- "movq %%mm5, %%mm2 \n\t" /* A2 a2 */\
- "pmaddwd 104(%2), %%mm3 \n\t" /* -C1R7+C3R5 -C1r7+C3r5 */\
- "paddd %%mm1, %%mm2 \n\t" /* A2+B2 a2+b2 */\
- "psubd %%mm1, %%mm5 \n\t" /* a2-B2 a2-b2 */\
- "psrad $" #shift ", %%mm2 \n\t"\
- "psrad $" #shift ", %%mm5 \n\t"\
- "movq %%mm6, %%mm1 \n\t" /* A3 a3 */\
- "paddd %%mm3, %%mm6 \n\t" /* A3+B3 a3+b3 */\
- "psubd %%mm3, %%mm1 \n\t" /* a3-B3 a3-b3 */\
- "psrad $" #shift ", %%mm6 \n\t"\
- "psrad $" #shift ", %%mm1 \n\t"\
- "packssdw %%mm2, %%mm2 \n\t" /* A2+B2 a2+b2 */\
- "packssdw %%mm6, %%mm6 \n\t" /* A3+B3 a3+b3 */\
- "movd %%mm2, 32+" #dst " \n\t"\
- "packssdw %%mm1, %%mm1 \n\t" /* A3-B3 a3-b3 */\
- "packssdw %%mm5, %%mm5 \n\t" /* A2-B2 a2-b2 */\
- "movd %%mm6, 48+" #dst " \n\t"\
- "movd %%mm1, 64+" #dst " \n\t"\
- "movd %%mm5, 80+" #dst " \n\t"
-
-
-//IDCT( src0, src4, src1, src5, dst, shift)
-IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0), 20)
-IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0), 20)
-IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), 20)
-IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0), 20)
- "jmp 9f \n\t"
-
- "#" ASMALIGN(4) \
- "2: \n\t"
-Z_COND_IDCT( 96(%0),104(%0),112(%0),120(%0), 96(%1),paddd (%2), 11, 3f)
-
-#undef IDCT
-#define IDCT(src0, src4, src1, src5, dst, shift) \
- "movq " #src0 ", %%mm0 \n\t" /* R4 R0 r4 r0 */\
- "movq " #src1 ", %%mm2 \n\t" /* R3 R1 r3 r1 */\
- "movq " #src5 ", %%mm3 \n\t" /* R7 R5 r7 r5 */\
- "movq 16(%2), %%mm4 \n\t" /* C4 C4 C4 C4 */\
- "pmaddwd %%mm0, %%mm4 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
- "movq 24(%2), %%mm5 \n\t" /* -C4 C4 -C4 C4 */\
- "pmaddwd %%mm5, %%mm0 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
- "movq %%mm4, %%mm6 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
- "movq 48(%2), %%mm7 \n\t" /* C3 C1 C3 C1 */\
- "pmaddwd %%mm2, %%mm7 \n\t" /* C3R3+C1R1 C3r3+C1r1 */\
- "movq %%mm0, %%mm5 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
- "movq 56(%2), %%mm1 \n\t" /* C7 C5 C7 C5 */\
- "pmaddwd %%mm3, %%mm1 \n\t" /* C7R7+C5R5 C7r7+C5r5 */\
- "pmaddwd 64(%2), %%mm2 \n\t" /* -C7R3+C3R1 -C7r3+C3r1 */\
- "paddd %%mm1, %%mm7 \n\t" /* B0 b0 */\
- "movq 72(%2), %%mm1 \n\t" /* -C5 -C1 -C5 -C1 */\
- "pmaddwd %%mm3, %%mm1 \n\t" /* -C5R7-C1R5 -C5r7-C1r5 */\
- "paddd %%mm4, %%mm7 \n\t" /* A0+B0 a0+b0 */\
- "paddd %%mm4, %%mm4 \n\t" /* 2A0 2a0 */\
- "psubd %%mm7, %%mm4 \n\t" /* A0-B0 a0-b0 */\
- "paddd %%mm2, %%mm1 \n\t" /* B1 b1 */\
- "psrad $" #shift ", %%mm7 \n\t"\
- "psrad $" #shift ", %%mm4 \n\t"\
- "movq %%mm0, %%mm2 \n\t" /* A1 a1 */\
- "paddd %%mm1, %%mm0 \n\t" /* A1+B1 a1+b1 */\
- "psubd %%mm1, %%mm2 \n\t" /* A1-B1 a1-b1 */\
- "psrad $" #shift ", %%mm0 \n\t"\
- "psrad $" #shift ", %%mm2 \n\t"\
- "packssdw %%mm7, %%mm7 \n\t" /* A0+B0 a0+b0 */\
- "movd %%mm7, " #dst " \n\t"\
- "packssdw %%mm0, %%mm0 \n\t" /* A1+B1 a1+b1 */\
- "movd %%mm0, 16+" #dst " \n\t"\
- "packssdw %%mm2, %%mm2 \n\t" /* A1-B1 a1-b1 */\
- "movd %%mm2, 96+" #dst " \n\t"\
- "packssdw %%mm4, %%mm4 \n\t" /* A0-B0 a0-b0 */\
- "movd %%mm4, 112+" #dst " \n\t"\
- "movq " #src1 ", %%mm0 \n\t" /* R3 R1 r3 r1 */\
- "movq 80(%2), %%mm4 \n\t" /* -C1 C5 -C1 C5 */\
- "pmaddwd %%mm0, %%mm4 \n\t" /* -C1R3+C5R1 -C1r3+C5r1 */\
- "movq 88(%2), %%mm7 \n\t" /* C3 C7 C3 C7 */\
- "pmaddwd 96(%2), %%mm0 \n\t" /* -C5R3+C7R1 -C5r3+C7r1 */\
- "pmaddwd %%mm3, %%mm7 \n\t" /* C3R7+C7R5 C3r7+C7r5 */\
- "movq %%mm5, %%mm2 \n\t" /* A2 a2 */\
- "pmaddwd 104(%2), %%mm3 \n\t" /* -C1R7+C3R5 -C1r7+C3r5 */\
- "paddd %%mm7, %%mm4 \n\t" /* B2 b2 */\
- "paddd %%mm4, %%mm2 \n\t" /* A2+B2 a2+b2 */\
- "psubd %%mm4, %%mm5 \n\t" /* a2-B2 a2-b2 */\
- "psrad $" #shift ", %%mm2 \n\t"\
- "psrad $" #shift ", %%mm5 \n\t"\
- "movq %%mm6, %%mm4 \n\t" /* A3 a3 */\
- "paddd %%mm0, %%mm3 \n\t" /* B3 b3 */\
- "paddd %%mm3, %%mm6 \n\t" /* A3+B3 a3+b3 */\
- "psubd %%mm3, %%mm4 \n\t" /* a3-B3 a3-b3 */\
- "psrad $" #shift ", %%mm6 \n\t"\
- "psrad $" #shift ", %%mm4 \n\t"\
- "packssdw %%mm2, %%mm2 \n\t" /* A2+B2 a2+b2 */\
- "packssdw %%mm6, %%mm6 \n\t" /* A3+B3 a3+b3 */\
- "movd %%mm2, 32+" #dst " \n\t"\
- "packssdw %%mm4, %%mm4 \n\t" /* A3-B3 a3-b3 */\
- "packssdw %%mm5, %%mm5 \n\t" /* A2-B2 a2-b2 */\
- "movd %%mm6, 48+" #dst " \n\t"\
- "movd %%mm4, 64+" #dst " \n\t"\
- "movd %%mm5, 80+" #dst " \n\t"
-
-//IDCT( src0, src4, src1, src5, dst, shift)
-IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0), 20)
-IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0), 20)
-IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), 20)
-IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0), 20)
- "jmp 9f \n\t"
-
- "#" ASMALIGN(4) \
- "3: \n\t"
-#undef IDCT
-#define IDCT(src0, src4, src1, src5, dst, shift) \
- "movq " #src0 ", %%mm0 \n\t" /* R4 R0 r4 r0 */\
- "movq " #src1 ", %%mm2 \n\t" /* R3 R1 r3 r1 */\
- "movq 16(%2), %%mm4 \n\t" /* C4 C4 C4 C4 */\
- "pmaddwd %%mm0, %%mm4 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
- "movq 24(%2), %%mm5 \n\t" /* -C4 C4 -C4 C4 */\
- "pmaddwd %%mm5, %%mm0 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
- "movq %%mm4, %%mm6 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
- "movq 48(%2), %%mm7 \n\t" /* C3 C1 C3 C1 */\
- "pmaddwd %%mm2, %%mm7 \n\t" /* C3R3+C1R1 C3r3+C1r1 */\
- "movq %%mm0, %%mm5 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
- "movq 64(%2), %%mm3 \n\t"\
- "pmaddwd %%mm2, %%mm3 \n\t" /* -C7R3+C3R1 -C7r3+C3r1 */\
- "paddd %%mm4, %%mm7 \n\t" /* A0+B0 a0+b0 */\
- "paddd %%mm4, %%mm4 \n\t" /* 2A0 2a0 */\
- "psubd %%mm7, %%mm4 \n\t" /* A0-B0 a0-b0 */\
- "psrad $" #shift ", %%mm7 \n\t"\
- "psrad $" #shift ", %%mm4 \n\t"\
- "movq %%mm0, %%mm1 \n\t" /* A1 a1 */\
- "paddd %%mm3, %%mm0 \n\t" /* A1+B1 a1+b1 */\
- "psubd %%mm3, %%mm1 \n\t" /* A1-B1 a1-b1 */\
- "psrad $" #shift ", %%mm0 \n\t"\
- "psrad $" #shift ", %%mm1 \n\t"\
- "packssdw %%mm7, %%mm7 \n\t" /* A0+B0 a0+b0 */\
- "movd %%mm7, " #dst " \n\t"\
- "packssdw %%mm0, %%mm0 \n\t" /* A1+B1 a1+b1 */\
- "movd %%mm0, 16+" #dst " \n\t"\
- "packssdw %%mm1, %%mm1 \n\t" /* A1-B1 a1-b1 */\
- "movd %%mm1, 96+" #dst " \n\t"\
- "packssdw %%mm4, %%mm4 \n\t" /* A0-B0 a0-b0 */\
- "movd %%mm4, 112+" #dst " \n\t"\
- "movq 80(%2), %%mm4 \n\t" /* -C1 C5 -C1 C5 */\
- "pmaddwd %%mm2, %%mm4 \n\t" /* -C1R3+C5R1 -C1r3+C5r1 */\
- "pmaddwd 96(%2), %%mm2 \n\t" /* -C5R3+C7R1 -C5r3+C7r1 */\
- "movq %%mm5, %%mm1 \n\t" /* A2 a2 */\
- "paddd %%mm4, %%mm1 \n\t" /* A2+B2 a2+b2 */\
- "psubd %%mm4, %%mm5 \n\t" /* a2-B2 a2-b2 */\
- "psrad $" #shift ", %%mm1 \n\t"\
- "psrad $" #shift ", %%mm5 \n\t"\
- "movq %%mm6, %%mm4 \n\t" /* A3 a3 */\
- "paddd %%mm2, %%mm6 \n\t" /* A3+B3 a3+b3 */\
- "psubd %%mm2, %%mm4 \n\t" /* a3-B3 a3-b3 */\
- "psrad $" #shift ", %%mm6 \n\t"\
- "psrad $" #shift ", %%mm4 \n\t"\
- "packssdw %%mm1, %%mm1 \n\t" /* A2+B2 a2+b2 */\
- "packssdw %%mm6, %%mm6 \n\t" /* A3+B3 a3+b3 */\
- "movd %%mm1, 32+" #dst " \n\t"\
- "packssdw %%mm4, %%mm4 \n\t" /* A3-B3 a3-b3 */\
- "packssdw %%mm5, %%mm5 \n\t" /* A2-B2 a2-b2 */\
- "movd %%mm6, 48+" #dst " \n\t"\
- "movd %%mm4, 64+" #dst " \n\t"\
- "movd %%mm5, 80+" #dst " \n\t"
-
-
-//IDCT( src0, src4, src1, src5, dst, shift)
-IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0), 20)
-IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0), 20)
-IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), 20)
-IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0), 20)
- "jmp 9f \n\t"
-
- "#" ASMALIGN(4) \
- "5: \n\t"
-#undef IDCT
-#define IDCT(src0, src4, src1, src5, dst, shift) \
- "movq " #src0 ", %%mm0 \n\t" /* R4 R0 r4 r0 */\
- "movq " #src4 ", %%mm1 \n\t" /* R6 R2 r6 r2 */\
- "movq 16(%2), %%mm4 \n\t" /* C4 C4 C4 C4 */\
- "pmaddwd %%mm0, %%mm4 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
- "movq 24(%2), %%mm5 \n\t" /* -C4 C4 -C4 C4 */\
- "pmaddwd %%mm5, %%mm0 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
- "movq 32(%2), %%mm5 \n\t" /* C6 C2 C6 C2 */\
- "pmaddwd %%mm1, %%mm5 \n\t" /* C6R6+C2R2 C6r6+C2r2 */\
- "movq 40(%2), %%mm6 \n\t" /* -C2 C6 -C2 C6 */\
- "pmaddwd %%mm6, %%mm1 \n\t" /* -C2R6+C6R2 -C2r6+C6r2 */\
- "movq %%mm4, %%mm6 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
- "paddd %%mm5, %%mm4 \n\t" /* A0 a0 */\
- "psubd %%mm5, %%mm6 \n\t" /* A3 a3 */\
- "movq %%mm0, %%mm5 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
- "paddd %%mm1, %%mm0 \n\t" /* A1 a1 */\
- "psubd %%mm1, %%mm5 \n\t" /* A2 a2 */\
- "movq 8+" #src0 ", %%mm2 \n\t" /* R4 R0 r4 r0 */\
- "movq 8+" #src4 ", %%mm3 \n\t" /* R6 R2 r6 r2 */\
- "movq 16(%2), %%mm1 \n\t" /* C4 C4 C4 C4 */\
- "pmaddwd %%mm2, %%mm1 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
- "movq 24(%2), %%mm7 \n\t" /* -C4 C4 -C4 C4 */\
- "pmaddwd %%mm7, %%mm2 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
- "movq 32(%2), %%mm7 \n\t" /* C6 C2 C6 C2 */\
- "pmaddwd %%mm3, %%mm7 \n\t" /* C6R6+C2R2 C6r6+C2r2 */\
- "pmaddwd 40(%2), %%mm3 \n\t" /* -C2R6+C6R2 -C2r6+C6r2 */\
- "paddd %%mm1, %%mm7 \n\t" /* A0 a0 */\
- "paddd %%mm1, %%mm1 \n\t" /* 2C0 2c0 */\
- "psubd %%mm7, %%mm1 \n\t" /* A3 a3 */\
- "paddd %%mm2, %%mm3 \n\t" /* A1 a1 */\
- "paddd %%mm2, %%mm2 \n\t" /* 2C1 2c1 */\
- "psubd %%mm3, %%mm2 \n\t" /* A2 a2 */\
- "psrad $" #shift ", %%mm4 \n\t"\
- "psrad $" #shift ", %%mm7 \n\t"\
- "psrad $" #shift ", %%mm3 \n\t"\
- "packssdw %%mm7, %%mm4 \n\t" /* A0 a0 */\
- "movq %%mm4, " #dst " \n\t"\
- "psrad $" #shift ", %%mm0 \n\t"\
- "packssdw %%mm3, %%mm0 \n\t" /* A1 a1 */\
- "movq %%mm0, 16+" #dst " \n\t"\
- "movq %%mm0, 96+" #dst " \n\t"\
- "movq %%mm4, 112+" #dst " \n\t"\
- "psrad $" #shift ", %%mm5 \n\t"\
- "psrad $" #shift ", %%mm6 \n\t"\
- "psrad $" #shift ", %%mm2 \n\t"\
- "packssdw %%mm2, %%mm5 \n\t" /* A2-B2 a2-b2 */\
- "movq %%mm5, 32+" #dst " \n\t"\
- "psrad $" #shift ", %%mm1 \n\t"\
- "packssdw %%mm1, %%mm6 \n\t" /* A3+B3 a3+b3 */\
- "movq %%mm6, 48+" #dst " \n\t"\
- "movq %%mm6, 64+" #dst " \n\t"\
- "movq %%mm5, 80+" #dst " \n\t"
-
-
-//IDCT( src0, src4, src1, src5, dst, shift)
-IDCT( 0(%1), 64(%1), 32(%1), 96(%1), 0(%0), 20)
-//IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0), 20)
-IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), 20)
-//IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0), 20)
- "jmp 9f \n\t"
-
-
- "#" ASMALIGN(4) \
- "1: \n\t"
-#undef IDCT
-#define IDCT(src0, src4, src1, src5, dst, shift) \
- "movq " #src0 ", %%mm0 \n\t" /* R4 R0 r4 r0 */\
- "movq " #src4 ", %%mm1 \n\t" /* R6 R2 r6 r2 */\
- "movq " #src1 ", %%mm2 \n\t" /* R3 R1 r3 r1 */\
- "movq 16(%2), %%mm4 \n\t" /* C4 C4 C4 C4 */\
- "pmaddwd %%mm0, %%mm4 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
- "movq 24(%2), %%mm5 \n\t" /* -C4 C4 -C4 C4 */\
- "pmaddwd %%mm5, %%mm0 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
- "movq 32(%2), %%mm5 \n\t" /* C6 C2 C6 C2 */\
- "pmaddwd %%mm1, %%mm5 \n\t" /* C6R6+C2R2 C6r6+C2r2 */\
- "movq 40(%2), %%mm6 \n\t" /* -C2 C6 -C2 C6 */\
- "pmaddwd %%mm6, %%mm1 \n\t" /* -C2R6+C6R2 -C2r6+C6r2 */\
- "movq %%mm4, %%mm6 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
- "movq 48(%2), %%mm7 \n\t" /* C3 C1 C3 C1 */\
- "pmaddwd %%mm2, %%mm7 \n\t" /* C3R3+C1R1 C3r3+C1r1 */\
- "paddd %%mm5, %%mm4 \n\t" /* A0 a0 */\
- "psubd %%mm5, %%mm6 \n\t" /* A3 a3 */\
- "movq %%mm0, %%mm5 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
- "paddd %%mm1, %%mm0 \n\t" /* A1 a1 */\
- "psubd %%mm1, %%mm5 \n\t" /* A2 a2 */\
- "movq 64(%2), %%mm1 \n\t"\
- "pmaddwd %%mm2, %%mm1 \n\t" /* -C7R3+C3R1 -C7r3+C3r1 */\
- "paddd %%mm4, %%mm7 \n\t" /* A0+B0 a0+b0 */\
- "paddd %%mm4, %%mm4 \n\t" /* 2A0 2a0 */\
- "psubd %%mm7, %%mm4 \n\t" /* A0-B0 a0-b0 */\
- "psrad $" #shift ", %%mm7 \n\t"\
- "psrad $" #shift ", %%mm4 \n\t"\
- "movq %%mm0, %%mm3 \n\t" /* A1 a1 */\
- "paddd %%mm1, %%mm0 \n\t" /* A1+B1 a1+b1 */\
- "psubd %%mm1, %%mm3 \n\t" /* A1-B1 a1-b1 */\
- "psrad $" #shift ", %%mm0 \n\t"\
- "psrad $" #shift ", %%mm3 \n\t"\
- "packssdw %%mm7, %%mm7 \n\t" /* A0+B0 a0+b0 */\
- "movd %%mm7, " #dst " \n\t"\
- "packssdw %%mm0, %%mm0 \n\t" /* A1+B1 a1+b1 */\
- "movd %%mm0, 16+" #dst " \n\t"\
- "packssdw %%mm3, %%mm3 \n\t" /* A1-B1 a1-b1 */\
- "movd %%mm3, 96+" #dst " \n\t"\
- "packssdw %%mm4, %%mm4 \n\t" /* A0-B0 a0-b0 */\
- "movd %%mm4, 112+" #dst " \n\t"\
- "movq 80(%2), %%mm4 \n\t" /* -C1 C5 -C1 C5 */\
- "pmaddwd %%mm2, %%mm4 \n\t" /* -C1R3+C5R1 -C1r3+C5r1 */\
- "pmaddwd 96(%2), %%mm2 \n\t" /* -C5R3+C7R1 -C5r3+C7r1 */\
- "movq %%mm5, %%mm3 \n\t" /* A2 a2 */\
- "paddd %%mm4, %%mm3 \n\t" /* A2+B2 a2+b2 */\
- "psubd %%mm4, %%mm5 \n\t" /* a2-B2 a2-b2 */\
- "psrad $" #shift ", %%mm3 \n\t"\
- "psrad $" #shift ", %%mm5 \n\t"\
- "movq %%mm6, %%mm4 \n\t" /* A3 a3 */\
- "paddd %%mm2, %%mm6 \n\t" /* A3+B3 a3+b3 */\
- "psubd %%mm2, %%mm4 \n\t" /* a3-B3 a3-b3 */\
- "psrad $" #shift ", %%mm6 \n\t"\
- "packssdw %%mm3, %%mm3 \n\t" /* A2+B2 a2+b2 */\
- "movd %%mm3, 32+" #dst " \n\t"\
- "psrad $" #shift ", %%mm4 \n\t"\
- "packssdw %%mm6, %%mm6 \n\t" /* A3+B3 a3+b3 */\
- "movd %%mm6, 48+" #dst " \n\t"\
- "packssdw %%mm4, %%mm4 \n\t" /* A3-B3 a3-b3 */\
- "packssdw %%mm5, %%mm5 \n\t" /* A2-B2 a2-b2 */\
- "movd %%mm4, 64+" #dst " \n\t"\
- "movd %%mm5, 80+" #dst " \n\t"
-
-
-//IDCT( src0, src4, src1, src5, dst, shift)
-IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0), 20)
-IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0), 20)
-IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), 20)
-IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0), 20)
- "jmp 9f \n\t"
-
-
- "#" ASMALIGN(4)
- "7: \n\t"
-#undef IDCT
-#define IDCT(src0, src4, src1, src5, dst, shift) \
- "movq " #src0 ", %%mm0 \n\t" /* R4 R0 r4 r0 */\
- "movq 16(%2), %%mm4 \n\t" /* C4 C4 C4 C4 */\
- "pmaddwd %%mm0, %%mm4 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
- "movq 24(%2), %%mm5 \n\t" /* -C4 C4 -C4 C4 */\
- "pmaddwd %%mm5, %%mm0 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
- "psrad $" #shift ", %%mm4 \n\t"\
- "psrad $" #shift ", %%mm0 \n\t"\
- "movq 8+" #src0 ", %%mm2 \n\t" /* R4 R0 r4 r0 */\
- "movq 16(%2), %%mm1 \n\t" /* C4 C4 C4 C4 */\
- "pmaddwd %%mm2, %%mm1 \n\t" /* C4R4+C4R0 C4r4+C4r0 */\
- "movq 24(%2), %%mm7 \n\t" /* -C4 C4 -C4 C4 */\
- "pmaddwd %%mm7, %%mm2 \n\t" /* -C4R4+C4R0 -C4r4+C4r0 */\
- "movq 32(%2), %%mm7 \n\t" /* C6 C2 C6 C2 */\
- "psrad $" #shift ", %%mm1 \n\t"\
- "packssdw %%mm1, %%mm4 \n\t" /* A0 a0 */\
- "movq %%mm4, " #dst " \n\t"\
- "psrad $" #shift ", %%mm2 \n\t"\
- "packssdw %%mm2, %%mm0 \n\t" /* A1 a1 */\
- "movq %%mm0, 16+" #dst " \n\t"\
- "movq %%mm0, 96+" #dst " \n\t"\
- "movq %%mm4, 112+" #dst " \n\t"\
- "movq %%mm0, 32+" #dst " \n\t"\
- "movq %%mm4, 48+" #dst " \n\t"\
- "movq %%mm4, 64+" #dst " \n\t"\
- "movq %%mm0, 80+" #dst " \n\t"
-
-//IDCT( src0, src4, src1, src5, dst, shift)
-IDCT( 0(%1), 64(%1), 32(%1), 96(%1), 0(%0), 20)
-//IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0), 20)
-IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), 20)
-//IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0), 20)
-
-
-#endif
-
-/*
-Input
- 00 40 04 44 20 60 24 64
- 10 30 14 34 50 70 54 74
- 01 41 03 43 21 61 23 63
- 11 31 13 33 51 71 53 73
- 02 42 06 46 22 62 26 66
- 12 32 16 36 52 72 56 76
- 05 45 07 47 25 65 27 67
- 15 35 17 37 55 75 57 77
-
-Temp
- 00 04 10 14 20 24 30 34
- 40 44 50 54 60 64 70 74
- 01 03 11 13 21 23 31 33
- 41 43 51 53 61 63 71 73
- 02 06 12 16 22 26 32 36
- 42 46 52 56 62 66 72 76
- 05 07 15 17 25 27 35 37
- 45 47 55 57 65 67 75 77
-*/
-
-"9: \n\t"
- :: "r" (block), "r" (temp), "r" (coeffs)
- : "%eax"
- );
-}
-
-void ff_simple_idct_mmx(int16_t *block)
-{
- idct(block);
-}
-
-//FIXME merge add/put into the idct
-
-void ff_simple_idct_put_mmx(uint8_t *dest, int line_size, DCTELEM *block)
-{
- idct(block);
- put_pixels_clamped_mmx(block, dest, line_size);
-}
-void ff_simple_idct_add_mmx(uint8_t *dest, int line_size, DCTELEM *block)
-{
- idct(block);
- add_pixels_clamped_mmx(block, dest, line_size);
-}
diff --git a/src/libffmpeg/libavcodec/i386/vp3dsp_mmx.c b/src/libffmpeg/libavcodec/i386/vp3dsp_mmx.c
deleted file mode 100644
index f715dc803..000000000
--- a/src/libffmpeg/libavcodec/i386/vp3dsp_mmx.c
+++ /dev/null
@@ -1,324 +0,0 @@
-/*
- * Copyright (C) 2004 the ffmpeg project
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file vp3dsp_mmx.c
- * MMX-optimized functions cribbed from the original VP3 source code.
- */
-
-#include "../dsputil.h"
-#include "mmx.h"
-
-#define IdctAdjustBeforeShift 8
-
-/* (12 * 4) 2-byte memory locations ( = 96 bytes total)
- * idct_constants[0..15] = Mask table (M(I))
- * idct_constants[16..43] = Cosine table (C(I))
- * idct_constants[44..47] = 8
- */
-static uint16_t idct_constants[(4 + 7 + 1) * 4];
-static const uint16_t idct_cosine_table[7] = {
- 64277, 60547, 54491, 46341, 36410, 25080, 12785
-};
-
-#define r0 mm0
-#define r1 mm1
-#define r2 mm2
-#define r3 mm3
-#define r4 mm4
-#define r5 mm5
-#define r6 mm6
-#define r7 mm7
-
-/* from original comments: The Macro does IDct on 4 1-D Dcts */
-#define BeginIDCT() { \
- movq_m2r(*I(3), r2); \
- movq_m2r(*C(3), r6); \
- movq_r2r(r2, r4); \
- movq_m2r(*J(5), r7); \
- pmulhw_r2r(r6, r4); /* r4 = c3*i3 - i3 */ \
- movq_m2r(*C(5), r1); \
- pmulhw_r2r(r7, r6); /* r6 = c3*i5 - i5 */ \
- movq_r2r(r1, r5); \
- pmulhw_r2r(r2, r1); /* r1 = c5*i3 - i3 */ \
- movq_m2r(*I(1), r3); \
- pmulhw_r2r(r7, r5); /* r5 = c5*i5 - i5 */ \
- movq_m2r(*C(1), r0); /* (all registers are in use) */ \
- paddw_r2r(r2, r4); /* r4 = c3*i3 */ \
- paddw_r2r(r7, r6); /* r6 = c3*i5 */ \
- paddw_r2r(r1, r2); /* r2 = c5*i3 */ \
- movq_m2r(*J(7), r1); \
- paddw_r2r(r5, r7); /* r7 = c5*i5 */ \
- movq_r2r(r0, r5); /* r5 = c1 */ \
- pmulhw_r2r(r3, r0); /* r0 = c1*i1 - i1 */ \
- paddsw_r2r(r7, r4); /* r4 = C = c3*i3 + c5*i5 */ \
- pmulhw_r2r(r1, r5); /* r5 = c1*i7 - i7 */ \
- movq_m2r(*C(7), r7); \
- psubsw_r2r(r2, r6); /* r6 = D = c3*i5 - c5*i3 */ \
- paddw_r2r(r3, r0); /* r0 = c1*i1 */ \
- pmulhw_r2r(r7, r3); /* r3 = c7*i1 */ \
- movq_m2r(*I(2), r2); \
- pmulhw_r2r(r1, r7); /* r7 = c7*i7 */ \
- paddw_r2r(r1, r5); /* r5 = c1*i7 */ \
- movq_r2r(r2, r1); /* r1 = i2 */ \
- pmulhw_m2r(*C(2), r2); /* r2 = c2*i2 - i2 */ \
- psubsw_r2r(r5, r3); /* r3 = B = c7*i1 - c1*i7 */ \
- movq_m2r(*J(6), r5); \
- paddsw_r2r(r7, r0); /* r0 = A = c1*i1 + c7*i7 */ \
- movq_r2r(r5, r7); /* r7 = i6 */ \
- psubsw_r2r(r4, r0); /* r0 = A - C */ \
- pmulhw_m2r(*C(2), r5); /* r5 = c2*i6 - i6 */ \
- paddw_r2r(r1, r2); /* r2 = c2*i2 */ \
- pmulhw_m2r(*C(6), r1); /* r1 = c6*i2 */ \
- paddsw_r2r(r4, r4); /* r4 = C + C */ \
- paddsw_r2r(r0, r4); /* r4 = C. = A + C */ \
- psubsw_r2r(r6, r3); /* r3 = B - D */ \
- paddw_r2r(r7, r5); /* r5 = c2*i6 */ \
- paddsw_r2r(r6, r6); /* r6 = D + D */ \
- pmulhw_m2r(*C(6), r7); /* r7 = c6*i6 */ \
- paddsw_r2r(r3, r6); /* r6 = D. = B + D */ \
- movq_r2m(r4, *I(1)); /* save C. at I(1) */ \
- psubsw_r2r(r5, r1); /* r1 = H = c6*i2 - c2*i6 */ \
- movq_m2r(*C(4), r4); \
- movq_r2r(r3, r5); /* r5 = B - D */ \
- pmulhw_r2r(r4, r3); /* r3 = (c4 - 1) * (B - D) */ \
- paddsw_r2r(r2, r7); /* r7 = G = c6*i6 + c2*i2 */ \
- movq_r2m(r6, *I(2)); /* save D. at I(2) */ \
- movq_r2r(r0, r2); /* r2 = A - C */ \
- movq_m2r(*I(0), r6); \
- pmulhw_r2r(r4, r0); /* r0 = (c4 - 1) * (A - C) */ \
- paddw_r2r(r3, r5); /* r5 = B. = c4 * (B - D) */ \
- movq_m2r(*J(4), r3); \
- psubsw_r2r(r1, r5); /* r5 = B.. = B. - H */ \
- paddw_r2r(r0, r2); /* r0 = A. = c4 * (A - C) */ \
- psubsw_r2r(r3, r6); /* r6 = i0 - i4 */ \
- movq_r2r(r6, r0); \
- pmulhw_r2r(r4, r6); /* r6 = (c4 - 1) * (i0 - i4) */ \
- paddsw_r2r(r3, r3); /* r3 = i4 + i4 */ \
- paddsw_r2r(r1, r1); /* r1 = H + H */ \
- paddsw_r2r(r0, r3); /* r3 = i0 + i4 */ \
- paddsw_r2r(r5, r1); /* r1 = H. = B + H */ \
- pmulhw_r2r(r3, r4); /* r4 = (c4 - 1) * (i0 + i4) */ \
- paddsw_r2r(r0, r6); /* r6 = F = c4 * (i0 - i4) */ \
- psubsw_r2r(r2, r6); /* r6 = F. = F - A. */ \
- paddsw_r2r(r2, r2); /* r2 = A. + A. */ \
- movq_m2r(*I(1), r0); /* r0 = C. */ \
- paddsw_r2r(r6, r2); /* r2 = A.. = F + A. */ \
- paddw_r2r(r3, r4); /* r4 = E = c4 * (i0 + i4) */ \
- psubsw_r2r(r1, r2); /* r2 = R2 = A.. - H. */ \
-}
-
-/* RowIDCT gets ready to transpose */
-#define RowIDCT() { \
- \
- BeginIDCT(); \
- \
- movq_m2r(*I(2), r3); /* r3 = D. */ \
- psubsw_r2r(r7, r4); /* r4 = E. = E - G */ \
- paddsw_r2r(r1, r1); /* r1 = H. + H. */ \
- paddsw_r2r(r7, r7); /* r7 = G + G */ \
- paddsw_r2r(r2, r1); /* r1 = R1 = A.. + H. */ \
- paddsw_r2r(r4, r7); /* r7 = G. = E + G */ \
- psubsw_r2r(r3, r4); /* r4 = R4 = E. - D. */ \
- paddsw_r2r(r3, r3); \
- psubsw_r2r(r5, r6); /* r6 = R6 = F. - B.. */ \
- paddsw_r2r(r5, r5); \
- paddsw_r2r(r4, r3); /* r3 = R3 = E. + D. */ \
- paddsw_r2r(r6, r5); /* r5 = R5 = F. + B.. */ \
- psubsw_r2r(r0, r7); /* r7 = R7 = G. - C. */ \
- paddsw_r2r(r0, r0); \
- movq_r2m(r1, *I(1)); /* save R1 */ \
- paddsw_r2r(r7, r0); /* r0 = R0 = G. + C. */ \
-}
-
-/* Column IDCT normalizes and stores final results */
-#define ColumnIDCT() { \
- \
- BeginIDCT(); \
- \
- paddsw_m2r(*Eight, r2); /* adjust R2 (and R1) for shift */ \
- paddsw_r2r(r1, r1); /* r1 = H. + H. */ \
- paddsw_r2r(r2, r1); /* r1 = R1 = A.. + H. */ \
- psraw_i2r(4, r2); /* r2 = NR2 */ \
- psubsw_r2r(r7, r4); /* r4 = E. = E - G */ \
- psraw_i2r(4, r1); /* r1 = NR1 */ \
- movq_m2r(*I(2), r3); /* r3 = D. */ \
- paddsw_r2r(r7, r7); /* r7 = G + G */ \
- movq_r2m(r2, *I(2)); /* store NR2 at I2 */ \
- paddsw_r2r(r4, r7); /* r7 = G. = E + G */ \
- movq_r2m(r1, *I(1)); /* store NR1 at I1 */ \
- psubsw_r2r(r3, r4); /* r4 = R4 = E. - D. */ \
- paddsw_m2r(*Eight, r4); /* adjust R4 (and R3) for shift */ \
- paddsw_r2r(r3, r3); /* r3 = D. + D. */ \
- paddsw_r2r(r4, r3); /* r3 = R3 = E. + D. */ \
- psraw_i2r(4, r4); /* r4 = NR4 */ \
- psubsw_r2r(r5, r6); /* r6 = R6 = F. - B.. */ \
- psraw_i2r(4, r3); /* r3 = NR3 */ \
- paddsw_m2r(*Eight, r6); /* adjust R6 (and R5) for shift */ \
- paddsw_r2r(r5, r5); /* r5 = B.. + B.. */ \
- paddsw_r2r(r6, r5); /* r5 = R5 = F. + B.. */ \
- psraw_i2r(4, r6); /* r6 = NR6 */ \
- movq_r2m(r4, *J(4)); /* store NR4 at J4 */ \
- psraw_i2r(4, r5); /* r5 = NR5 */ \
- movq_r2m(r3, *I(3)); /* store NR3 at I3 */ \
- psubsw_r2r(r0, r7); /* r7 = R7 = G. - C. */ \
- paddsw_m2r(*Eight, r7); /* adjust R7 (and R0) for shift */ \
- paddsw_r2r(r0, r0); /* r0 = C. + C. */ \
- paddsw_r2r(r7, r0); /* r0 = R0 = G. + C. */ \
- psraw_i2r(4, r7); /* r7 = NR7 */ \
- movq_r2m(r6, *J(6)); /* store NR6 at J6 */ \
- psraw_i2r(4, r0); /* r0 = NR0 */ \
- movq_r2m(r5, *J(5)); /* store NR5 at J5 */ \
- movq_r2m(r7, *J(7)); /* store NR7 at J7 */ \
- movq_r2m(r0, *I(0)); /* store NR0 at I0 */ \
-}
-
-/* Following macro does two 4x4 transposes in place.
-
- At entry (we assume):
-
- r0 = a3 a2 a1 a0
- I(1) = b3 b2 b1 b0
- r2 = c3 c2 c1 c0
- r3 = d3 d2 d1 d0
-
- r4 = e3 e2 e1 e0
- r5 = f3 f2 f1 f0
- r6 = g3 g2 g1 g0
- r7 = h3 h2 h1 h0
-
- At exit, we have:
-
- I(0) = d0 c0 b0 a0
- I(1) = d1 c1 b1 a1
- I(2) = d2 c2 b2 a2
- I(3) = d3 c3 b3 a3
-
- J(4) = h0 g0 f0 e0
- J(5) = h1 g1 f1 e1
- J(6) = h2 g2 f2 e2
- J(7) = h3 g3 f3 e3
-
- I(0) I(1) I(2) I(3) is the transpose of r0 I(1) r2 r3.
- J(4) J(5) J(6) J(7) is the transpose of r4 r5 r6 r7.
-
- Since r1 is free at entry, we calculate the Js first. */
-
-#define Transpose() { \
- movq_r2r(r4, r1); /* r1 = e3 e2 e1 e0 */ \
- punpcklwd_r2r(r5, r4); /* r4 = f1 e1 f0 e0 */ \
- movq_r2m(r0, *I(0)); /* save a3 a2 a1 a0 */ \
- punpckhwd_r2r(r5, r1); /* r1 = f3 e3 f2 e2 */ \
- movq_r2r(r6, r0); /* r0 = g3 g2 g1 g0 */ \
- punpcklwd_r2r(r7, r6); /* r6 = h1 g1 h0 g0 */ \
- movq_r2r(r4, r5); /* r5 = f1 e1 f0 e0 */ \
- punpckldq_r2r(r6, r4); /* r4 = h0 g0 f0 e0 = R4 */ \
- punpckhdq_r2r(r6, r5); /* r5 = h1 g1 f1 e1 = R5 */ \
- movq_r2r(r1, r6); /* r6 = f3 e3 f2 e2 */ \
- movq_r2m(r4, *J(4)); \
- punpckhwd_r2r(r7, r0); /* r0 = h3 g3 h2 g2 */ \
- movq_r2m(r5, *J(5)); \
- punpckhdq_r2r(r0, r6); /* r6 = h3 g3 f3 e3 = R7 */ \
- movq_m2r(*I(0), r4); /* r4 = a3 a2 a1 a0 */ \
- punpckldq_r2r(r0, r1); /* r1 = h2 g2 f2 e2 = R6 */ \
- movq_m2r(*I(1), r5); /* r5 = b3 b2 b1 b0 */ \
- movq_r2r(r4, r0); /* r0 = a3 a2 a1 a0 */ \
- movq_r2m(r6, *J(7)); \
- punpcklwd_r2r(r5, r0); /* r0 = b1 a1 b0 a0 */ \
- movq_r2m(r1, *J(6)); \
- punpckhwd_r2r(r5, r4); /* r4 = b3 a3 b2 a2 */ \
- movq_r2r(r2, r5); /* r5 = c3 c2 c1 c0 */ \
- punpcklwd_r2r(r3, r2); /* r2 = d1 c1 d0 c0 */ \
- movq_r2r(r0, r1); /* r1 = b1 a1 b0 a0 */ \
- punpckldq_r2r(r2, r0); /* r0 = d0 c0 b0 a0 = R0 */ \
- punpckhdq_r2r(r2, r1); /* r1 = d1 c1 b1 a1 = R1 */ \
- movq_r2r(r4, r2); /* r2 = b3 a3 b2 a2 */ \
- movq_r2m(r0, *I(0)); \
- punpckhwd_r2r(r3, r5); /* r5 = d3 c3 d2 c2 */ \
- movq_r2m(r1, *I(1)); \
- punpckhdq_r2r(r5, r4); /* r4 = d3 c3 b3 a3 = R3 */ \
- punpckldq_r2r(r5, r2); /* r2 = d2 c2 b2 a2 = R2 */ \
- movq_r2m(r4, *I(3)); \
- movq_r2m(r2, *I(2)); \
-}
-
-void ff_vp3_dsp_init_mmx(void)
-{
- int j = 16;
- uint16_t *p;
-
- j = 1;
- do {
- p = idct_constants + ((j + 3) << 2);
- p[0] = p[1] = p[2] = p[3] = idct_cosine_table[j - 1];
- } while (++j <= 7);
-
- idct_constants[44] = idct_constants[45] =
- idct_constants[46] = idct_constants[47] = IdctAdjustBeforeShift;
-}
-
-void ff_vp3_idct_mmx(int16_t *output_data)
-{
- /* eax = quantized input
- * ebx = dequantizer matrix
- * ecx = IDCT constants
- * M(I) = ecx + MaskOffset(0) + I * 8
- * C(I) = ecx + CosineOffset(32) + (I-1) * 8
- * edx = output
- * r0..r7 = mm0..mm7
- */
-
-#define C(x) (idct_constants + 16 + (x - 1) * 4)
-#define Eight (idct_constants + 44)
-
- /* at this point, function has completed dequantization + dezigzag +
- * partial transposition; now do the idct itself */
-#define I(K) (output_data + K * 8)
-#define J(K) (output_data + ((K - 4) * 8) + 4)
-
- RowIDCT();
- Transpose();
-
-#undef I
-#undef J
-#define I(K) (output_data + (K * 8) + 32)
-#define J(K) (output_data + ((K - 4) * 8) + 36)
-
- RowIDCT();
- Transpose();
-
-#undef I
-#undef J
-#define I(K) (output_data + K * 8)
-#define J(K) (output_data + K * 8)
-
- ColumnIDCT();
-
-#undef I
-#undef J
-#define I(K) (output_data + (K * 8) + 4)
-#define J(K) (output_data + (K * 8) + 4)
-
- ColumnIDCT();
-
-#undef I
-#undef J
-
-}
diff --git a/src/libffmpeg/libavcodec/i386/vp3dsp_sse2.c b/src/libffmpeg/libavcodec/i386/vp3dsp_sse2.c
deleted file mode 100644
index bd2911d59..000000000
--- a/src/libffmpeg/libavcodec/i386/vp3dsp_sse2.c
+++ /dev/null
@@ -1,827 +0,0 @@
-/*
- * Copyright (C) 2004 the ffmpeg project
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file vp3dsp_sse2.c
- * SSE2-optimized functions cribbed from the original VP3 source code.
- */
-
-#include "../dsputil.h"
-#include "mmx.h"
-
-static DECLARE_ALIGNED_16(const unsigned short, SSE2_dequant_const[]) =
-{
- 0,65535,65535,0,0,0,0,0, // 0x0000 0000 0000 0000 0000 FFFF FFFF 0000
- 0,0,0,0,65535,65535,0,0, // 0x0000 0000 FFFF FFFF 0000 0000 0000 0000
- 65535,65535,65535,0,0,0,0,0,// 0x0000 0000 0000 0000 0000 FFFF FFFF FFFF
- 0,0,0,65535,0,0,0,0, // 0x0000 0000 0000 0000 FFFF 0000 0000 0000
- 0,0,0,65535,65535,0,0,0, // 0x0000 0000 0000 FFFF FFFF 0000 0000 0000
- 65535,0,0,0,0,65535,0,0, // 0x0000 0000 FFFF 0000 0000 0000 0000 FFFF
- 0,0,65535,65535, 0,0,0,0 // 0x0000 0000 0000 0000 FFFF FFFF 0000 0000
-};
-
-static DECLARE_ALIGNED_16(const unsigned int, eight_data[]) =
-{
- 0x00080008,
- 0x00080008,
- 0x00080008,
- 0x00080008
-};
-
-static DECLARE_ALIGNED_16(const unsigned short, SSE2_idct_data[7 * 8]) =
-{
- 64277,64277,64277,64277,64277,64277,64277,64277,
- 60547,60547,60547,60547,60547,60547,60547,60547,
- 54491,54491,54491,54491,54491,54491,54491,54491,
- 46341,46341,46341,46341,46341,46341,46341,46341,
- 36410,36410,36410,36410,36410,36410,36410,36410,
- 25080,25080,25080,25080,25080,25080,25080,25080,
- 12785,12785,12785,12785,12785,12785,12785,12785
-};
-
-
-#define SSE2_Column_IDCT() { \
- \
- movdqu_m2r(*I(3), xmm2); /* xmm2 = i3 */ \
- movdqu_m2r(*C(3), xmm6); /* xmm6 = c3 */ \
- \
- movdqu_r2r(xmm2, xmm4); /* xmm4 = i3 */ \
- movdqu_m2r(*I(5), xmm7); /* xmm7 = i5 */ \
- \
- pmulhw_r2r(xmm6, xmm4); /* xmm4 = c3 * i3 - i3 */ \
- movdqu_m2r(*C(5), xmm1); /* xmm1 = c5 */ \
- \
- pmulhw_r2r(xmm7, xmm6); /* xmm6 = c3 * i5 - i5 */ \
- movdqu_r2r(xmm1, xmm5); /* xmm5 = c5 */ \
- \
- pmulhw_r2r(xmm2, xmm1); /* xmm1 = c5 * i3 - i3 */ \
- movdqu_m2r(*I(1), xmm3); /* xmm3 = i1 */ \
- \
- pmulhw_r2r(xmm7, xmm5); /* xmm5 = c5 * i5 - i5 */ \
- movdqu_m2r(*C(1), xmm0); /* xmm0 = c1 */ \
- \
- /* all registers are in use */ \
- \
- paddw_r2r(xmm2, xmm4); /* xmm4 = c3 * i3 */ \
- paddw_r2r(xmm7, xmm6); /* xmm6 = c3 * i5 */ \
- \
- paddw_r2r(xmm1, xmm2); /* xmm2 = c5 * i3 */ \
- movdqu_m2r(*I(7), xmm1); /* xmm1 = i7 */ \
- \
- paddw_r2r(xmm5, xmm7); /* xmm7 = c5 * i5 */ \
- movdqu_r2r(xmm0, xmm5); /* xmm5 = c1 */ \
- \
- pmulhw_r2r(xmm3, xmm0); /* xmm0 = c1 * i1 - i1 */ \
- paddsw_r2r(xmm7, xmm4); /* xmm4 = c3 * i3 + c5 * i5 = C */ \
- \
- pmulhw_r2r(xmm1, xmm5); /* xmm5 = c1 * i7 - i7 */ \
- movdqu_m2r(*C(7), xmm7); /* xmm7 = c7 */ \
- \
- psubsw_r2r(xmm2, xmm6); /* xmm6 = c3 * i5 - c5 * i3 = D */ \
- paddw_r2r(xmm3, xmm0); /* xmm0 = c1 * i1 */ \
- \
- pmulhw_r2r(xmm7, xmm3); /* xmm3 = c7 * i1 */ \
- movdqu_m2r(*I(2), xmm2); /* xmm2 = i2 */ \
- \
- pmulhw_r2r(xmm1, xmm7); /* xmm7 = c7 * i7 */ \
- paddw_r2r(xmm1, xmm5); /* xmm5 = c1 * i7 */ \
- \
- movdqu_r2r(xmm2, xmm1); /* xmm1 = i2 */ \
- pmulhw_m2r(*C(2), xmm2); /* xmm2 = i2 * c2 -i2 */ \
- \
- psubsw_r2r(xmm5, xmm3); /* xmm3 = c7 * i1 - c1 * i7 = B */ \
- movdqu_m2r(*I(6), xmm5); /* xmm5 = i6 */ \
- \
- paddsw_r2r(xmm7, xmm0); /* xmm0 = c1 * i1 + c7 * i7 = A */ \
- movdqu_r2r(xmm5, xmm7); /* xmm7 = i6 */ \
- \
- psubsw_r2r(xmm4, xmm0); /* xmm0 = A - C */ \
- pmulhw_m2r(*C(2), xmm5); /* xmm5 = c2 * i6 - i6 */ \
- \
- paddw_r2r(xmm1, xmm2); /* xmm2 = i2 * c2 */ \
- pmulhw_m2r(*C(6), xmm1); /* xmm1 = c6 * i2 */ \
- \
- paddsw_r2r(xmm4, xmm4); /* xmm4 = C + C */ \
- paddsw_r2r(xmm0, xmm4); /* xmm4 = A + C = C. */ \
- \
- psubsw_r2r(xmm6, xmm3); /* xmm3 = B - D */ \
- paddw_r2r(xmm7, xmm5); /* xmm5 = c2 * i6 */ \
- \
- paddsw_r2r(xmm6, xmm6); /* xmm6 = D + D */ \
- pmulhw_m2r(*C(6), xmm7); /* xmm7 = c6 * i6 */ \
- \
- paddsw_r2r(xmm3, xmm6); /* xmm6 = B + D = D. */ \
- movdqu_r2m(xmm4, *I(1)); /* Save C. at I(1) */ \
- \
- psubsw_r2r(xmm5, xmm1); /* xmm1 = c6 * i2 - c2 * i6 = H */ \
- movdqu_m2r(*C(4), xmm4); /* xmm4 = c4 */ \
- \
- movdqu_r2r(xmm3, xmm5); /* xmm5 = B - D */ \
- pmulhw_r2r(xmm4, xmm3); /* xmm3 = ( c4 -1 ) * ( B - D ) */ \
- \
- paddsw_r2r(xmm2, xmm7); /* xmm7 = c2 * i2 + c6 * i6 = G */ \
- movdqu_r2m(xmm6, *I(2)); /* Save D. at I(2) */ \
- \
- movdqu_r2r(xmm0, xmm2); /* xmm2 = A - C */ \
- movdqu_m2r(*I(0), xmm6); /* xmm6 = i0 */ \
- \
- pmulhw_r2r(xmm4, xmm0); /* xmm0 = ( c4 - 1 ) * ( A - C ) = A. */ \
- paddw_r2r(xmm3, xmm5); /* xmm5 = c4 * ( B - D ) = B. */ \
- \
- movdqu_m2r(*I(4), xmm3); /* xmm3 = i4 */ \
- psubsw_r2r(xmm1, xmm5); /* xmm5 = B. - H = B.. */ \
- \
- paddw_r2r(xmm0, xmm2); /* xmm2 = c4 * ( A - C) = A. */ \
- psubsw_r2r(xmm3, xmm6); /* xmm6 = i0 - i4 */ \
- \
- movdqu_r2r(xmm6, xmm0); /* xmm0 = i0 - i4 */ \
- pmulhw_r2r(xmm4, xmm6); /* xmm6 = (c4 - 1) * (i0 - i4) = F */ \
- \
- paddsw_r2r(xmm3, xmm3); /* xmm3 = i4 + i4 */ \
- paddsw_r2r(xmm1, xmm1); /* xmm1 = H + H */ \
- \
- paddsw_r2r(xmm0, xmm3); /* xmm3 = i0 + i4 */ \
- paddsw_r2r(xmm5, xmm1); /* xmm1 = B. + H = H. */ \
- \
- pmulhw_r2r(xmm3, xmm4); /* xmm4 = ( c4 - 1 ) * ( i0 + i4 ) */ \
- paddw_r2r(xmm0, xmm6); /* xmm6 = c4 * ( i0 - i4 ) */ \
- \
- psubsw_r2r(xmm2, xmm6); /* xmm6 = F - A. = F. */ \
- paddsw_r2r(xmm2, xmm2); /* xmm2 = A. + A. */ \
- \
- movdqu_m2r(*I(1), xmm0); /* Load C. from I(1) */ \
- paddsw_r2r(xmm6, xmm2); /* xmm2 = F + A. = A.. */ \
- \
- paddw_r2r(xmm3, xmm4); /* xmm4 = c4 * ( i0 + i4 ) = 3 */ \
- psubsw_r2r(xmm1, xmm2); /* xmm2 = A.. - H. = R2 */ \
- \
- paddsw_m2r(*Eight, xmm2); /* Adjust R2 and R1 before shifting */ \
- paddsw_r2r(xmm1, xmm1); /* xmm1 = H. + H. */ \
- \
- paddsw_r2r(xmm2, xmm1); /* xmm1 = A.. + H. = R1 */ \
- psraw_i2r(4, xmm2); /* xmm2 = op2 */ \
- \
- psubsw_r2r(xmm7, xmm4); /* xmm4 = E - G = E. */ \
- psraw_i2r(4, xmm1); /* xmm1 = op1 */ \
- \
- movdqu_m2r(*I(2), xmm3); /* Load D. from I(2) */ \
- paddsw_r2r(xmm7, xmm7); /* xmm7 = G + G */ \
- \
- movdqu_r2m(xmm2, *O(2)); /* Write out op2 */ \
- paddsw_r2r(xmm4, xmm7); /* xmm7 = E + G = G. */ \
- \
- movdqu_r2m(xmm1, *O(1)); /* Write out op1 */ \
- psubsw_r2r(xmm3, xmm4); /* xmm4 = E. - D. = R4 */ \
- \
- paddsw_m2r(*Eight, xmm4); /* Adjust R4 and R3 before shifting */ \
- paddsw_r2r(xmm3, xmm3); /* xmm3 = D. + D. */ \
- \
- paddsw_r2r(xmm4, xmm3); /* xmm3 = E. + D. = R3 */ \
- psraw_i2r(4, xmm4); /* xmm4 = op4 */ \
- \
- psubsw_r2r(xmm5, xmm6); /* xmm6 = F. - B..= R6 */ \
- psraw_i2r(4, xmm3); /* xmm3 = op3 */ \
- \
- paddsw_m2r(*Eight, xmm6); /* Adjust R6 and R5 before shifting */ \
- paddsw_r2r(xmm5, xmm5); /* xmm5 = B.. + B.. */ \
- \
- paddsw_r2r(xmm6, xmm5); /* xmm5 = F. + B.. = R5 */ \
- psraw_i2r(4, xmm6); /* xmm6 = op6 */ \
- \
- movdqu_r2m(xmm4, *O(4)); /* Write out op4 */ \
- psraw_i2r(4, xmm5); /* xmm5 = op5 */ \
- \
- movdqu_r2m(xmm3, *O(3)); /* Write out op3 */ \
- psubsw_r2r(xmm0, xmm7); /* xmm7 = G. - C. = R7 */ \
- \
- paddsw_m2r(*Eight, xmm7); /* Adjust R7 and R0 before shifting */ \
- paddsw_r2r(xmm0, xmm0); /* xmm0 = C. + C. */ \
- \
- paddsw_r2r(xmm7, xmm0); /* xmm0 = G. + C. */ \
- psraw_i2r(4, xmm7); /* xmm7 = op7 */ \
- \
- movdqu_r2m(xmm6, *O(6)); /* Write out op6 */ \
- psraw_i2r(4, xmm0); /* xmm0 = op0 */ \
- \
- movdqu_r2m(xmm5, *O(5)); /* Write out op5 */ \
- movdqu_r2m(xmm7, *O(7)); /* Write out op7 */ \
- \
- movdqu_r2m(xmm0, *O(0)); /* Write out op0 */ \
- \
-} /* End of SSE2_Column_IDCT macro */
-
-
-#define SSE2_Row_IDCT() { \
- \
- movdqu_m2r(*I(3), xmm2); /* xmm2 = i3 */ \
- movdqu_m2r(*C(3), xmm6); /* xmm6 = c3 */ \
- \
- movdqu_r2r(xmm2, xmm4); /* xmm4 = i3 */ \
- movdqu_m2r(*I(5), xmm7); /* xmm7 = i5 */ \
- \
- pmulhw_r2r(xmm6, xmm4); /* xmm4 = c3 * i3 - i3 */ \
- movdqu_m2r(*C(5), xmm1); /* xmm1 = c5 */ \
- \
- pmulhw_r2r(xmm7, xmm6); /* xmm6 = c3 * i5 - i5 */ \
- movdqu_r2r(xmm1, xmm5); /* xmm5 = c5 */ \
- \
- pmulhw_r2r(xmm2, xmm1); /* xmm1 = c5 * i3 - i3 */ \
- movdqu_m2r(*I(1), xmm3); /* xmm3 = i1 */ \
- \
- pmulhw_r2r(xmm7, xmm5); /* xmm5 = c5 * i5 - i5 */ \
- movdqu_m2r(*C(1), xmm0); /* xmm0 = c1 */ \
- \
- /* all registers are in use */ \
- \
- paddw_r2r(xmm2, xmm4); /* xmm4 = c3 * i3 */ \
- paddw_r2r(xmm7, xmm6); /* xmm6 = c3 * i5 */ \
- \
- paddw_r2r(xmm1, xmm2); /* xmm2 = c5 * i3 */ \
- movdqu_m2r(*I(7), xmm1); /* xmm1 = i7 */ \
- \
- paddw_r2r(xmm5, xmm7); /* xmm7 = c5 * i5 */ \
- movdqu_r2r(xmm0, xmm5); /* xmm5 = c1 */ \
- \
- pmulhw_r2r(xmm3, xmm0); /* xmm0 = c1 * i1 - i1 */ \
- paddsw_r2r(xmm7, xmm4); /* xmm4 = c3 * i3 + c5 * i5 = C */ \
- \
- pmulhw_r2r(xmm1, xmm5); /* xmm5 = c1 * i7 - i7 */ \
- movdqu_m2r(*C(7), xmm7); /* xmm7 = c7 */ \
- \
- psubsw_r2r(xmm2, xmm6); /* xmm6 = c3 * i5 - c5 * i3 = D */ \
- paddw_r2r(xmm3, xmm0); /* xmm0 = c1 * i1 */ \
- \
- pmulhw_r2r(xmm7, xmm3); /* xmm3 = c7 * i1 */ \
- movdqu_m2r(*I(2), xmm2); /* xmm2 = i2 */ \
- \
- pmulhw_r2r(xmm1, xmm7); /* xmm7 = c7 * i7 */ \
- paddw_r2r(xmm1, xmm5); /* xmm5 = c1 * i7 */ \
- \
- movdqu_r2r(xmm2, xmm1); /* xmm1 = i2 */ \
- pmulhw_m2r(*C(2), xmm2); /* xmm2 = i2 * c2 -i2 */ \
- \
- psubsw_r2r(xmm5, xmm3); /* xmm3 = c7 * i1 - c1 * i7 = B */ \
- movdqu_m2r(*I(6), xmm5); /* xmm5 = i6 */ \
- \
- paddsw_r2r(xmm7, xmm0); /* xmm0 = c1 * i1 + c7 * i7 = A */ \
- movdqu_r2r(xmm5, xmm7); /* xmm7 = i6 */ \
- \
- psubsw_r2r(xmm4, xmm0); /* xmm0 = A - C */ \
- pmulhw_m2r(*C(2), xmm5); /* xmm5 = c2 * i6 - i6 */ \
- \
- paddw_r2r(xmm1, xmm2); /* xmm2 = i2 * c2 */ \
- pmulhw_m2r(*C(6), xmm1); /* xmm1 = c6 * i2 */ \
- \
- paddsw_r2r(xmm4, xmm4); /* xmm4 = C + C */ \
- paddsw_r2r(xmm0, xmm4); /* xmm4 = A + C = C. */ \
- \
- psubsw_r2r(xmm6, xmm3); /* xmm3 = B - D */ \
- paddw_r2r(xmm7, xmm5); /* xmm5 = c2 * i6 */ \
- \
- paddsw_r2r(xmm6, xmm6); /* xmm6 = D + D */ \
- pmulhw_m2r(*C(6), xmm7); /* xmm7 = c6 * i6 */ \
- \
- paddsw_r2r(xmm3, xmm6); /* xmm6 = B + D = D. */ \
- movdqu_r2m(xmm4, *I(1)); /* Save C. at I(1) */ \
- \
- psubsw_r2r(xmm5, xmm1); /* xmm1 = c6 * i2 - c2 * i6 = H */ \
- movdqu_m2r(*C(4), xmm4); /* xmm4 = c4 */ \
- \
- movdqu_r2r(xmm3, xmm5); /* xmm5 = B - D */ \
- pmulhw_r2r(xmm4, xmm3); /* xmm3 = ( c4 -1 ) * ( B - D ) */ \
- \
- paddsw_r2r(xmm2, xmm7); /* xmm7 = c2 * i2 + c6 * i6 = G */ \
- movdqu_r2m(xmm6, *I(2)); /* Save D. at I(2) */ \
- \
- movdqu_r2r(xmm0, xmm2); /* xmm2 = A - C */ \
- movdqu_m2r(*I(0), xmm6); /* xmm6 = i0 */ \
- \
- pmulhw_r2r(xmm4, xmm0); /* xmm0 = ( c4 - 1 ) * ( A - C ) = A. */ \
- paddw_r2r(xmm3, xmm5); /* xmm5 = c4 * ( B - D ) = B. */ \
- \
- movdqu_m2r(*I(4), xmm3); /* xmm3 = i4 */ \
- psubsw_r2r(xmm1, xmm5); /* xmm5 = B. - H = B.. */ \
- \
- paddw_r2r(xmm0, xmm2); /* xmm2 = c4 * ( A - C) = A. */ \
- psubsw_r2r(xmm3, xmm6); /* xmm6 = i0 - i4 */ \
- \
- movdqu_r2r(xmm6, xmm0); /* xmm0 = i0 - i4 */ \
- pmulhw_r2r(xmm4, xmm6); /* xmm6 = ( c4 - 1 ) * ( i0 - i4 ) = F */ \
- \
- paddsw_r2r(xmm3, xmm3); /* xmm3 = i4 + i4 */ \
- paddsw_r2r(xmm1, xmm1); /* xmm1 = H + H */ \
- \
- paddsw_r2r(xmm0, xmm3); /* xmm3 = i0 + i4 */ \
- paddsw_r2r(xmm5, xmm1); /* xmm1 = B. + H = H. */ \
- \
- pmulhw_r2r(xmm3, xmm4); /* xmm4 = ( c4 - 1 ) * ( i0 + i4 ) */ \
- paddw_r2r(xmm0, xmm6); /* xmm6 = c4 * ( i0 - i4 ) */ \
- \
- psubsw_r2r(xmm2, xmm6); /* xmm6 = F - A. = F. */ \
- paddsw_r2r(xmm2, xmm2); /* xmm2 = A. + A. */ \
- \
- movdqu_m2r(*I(1), xmm0); /* Load C. from I(1) */ \
- paddsw_r2r(xmm6, xmm2); /* xmm2 = F + A. = A.. */ \
- \
- paddw_r2r(xmm3, xmm4); /* xmm4 = c4 * ( i0 + i4 ) = 3 */ \
- psubsw_r2r(xmm1, xmm2); /* xmm2 = A.. - H. = R2 */ \
- \
- paddsw_r2r(xmm1, xmm1); /* xmm1 = H. + H. */ \
- paddsw_r2r(xmm2, xmm1); /* xmm1 = A.. + H. = R1 */ \
- \
- psubsw_r2r(xmm7, xmm4); /* xmm4 = E - G = E. */ \
- \
- movdqu_m2r(*I(2), xmm3); /* Load D. from I(2) */ \
- paddsw_r2r(xmm7, xmm7); /* xmm7 = G + G */ \
- \
- movdqu_r2m(xmm2, *I(2)); /* Write out op2 */ \
- paddsw_r2r(xmm4, xmm7); /* xmm7 = E + G = G. */ \
- \
- movdqu_r2m(xmm1, *I(1)); /* Write out op1 */ \
- psubsw_r2r(xmm3, xmm4); /* xmm4 = E. - D. = R4 */ \
- \
- paddsw_r2r(xmm3, xmm3); /* xmm3 = D. + D. */ \
- \
- paddsw_r2r(xmm4, xmm3); /* xmm3 = E. + D. = R3 */ \
- \
- psubsw_r2r(xmm5, xmm6); /* xmm6 = F. - B..= R6 */ \
- \
- paddsw_r2r(xmm5, xmm5); /* xmm5 = B.. + B.. */ \
- \
- paddsw_r2r(xmm6, xmm5); /* xmm5 = F. + B.. = R5 */ \
- \
- movdqu_r2m(xmm4, *I(4)); /* Write out op4 */ \
- \
- movdqu_r2m(xmm3, *I(3)); /* Write out op3 */ \
- psubsw_r2r(xmm0, xmm7); /* xmm7 = G. - C. = R7 */ \
- \
- paddsw_r2r(xmm0, xmm0); /* xmm0 = C. + C. */ \
- \
- paddsw_r2r(xmm7, xmm0); /* xmm0 = G. + C. */ \
- \
- movdqu_r2m(xmm6, *I(6)); /* Write out op6 */ \
- \
- movdqu_r2m(xmm5, *I(5)); /* Write out op5 */ \
- movdqu_r2m(xmm7, *I(7)); /* Write out op7 */ \
- \
- movdqu_r2m(xmm0, *I(0)); /* Write out op0 */ \
- \
-} /* End of SSE2_Row_IDCT macro */
-
-
-#define SSE2_Transpose() { \
- \
- movdqu_m2r(*I(4), xmm4); /* xmm4=e7e6e5e4e3e2e1e0 */ \
- movdqu_m2r(*I(5), xmm0); /* xmm4=f7f6f5f4f3f2f1f0 */ \
- \
- movdqu_r2r(xmm4, xmm5); /* make a copy */ \
- punpcklwd_r2r(xmm0, xmm4); /* xmm4=f3e3f2e2f1e1f0e0 */ \
- \
- punpckhwd_r2r(xmm0, xmm5); /* xmm5=f7e7f6e6f5e5f4e4 */ \
- movdqu_m2r(*I(6), xmm6); /* xmm6=g7g6g5g4g3g2g1g0 */ \
- \
- movdqu_m2r(*I(7), xmm0); /* xmm0=h7h6h5h4h3h2h1h0 */ \
- movdqu_r2r(xmm6, xmm7); /* make a copy */ \
- \
- punpcklwd_r2r(xmm0, xmm6); /* xmm6=h3g3h3g2h1g1h0g0 */ \
- punpckhwd_r2r(xmm0, xmm7); /* xmm7=h7g7h6g6h5g5h4g4 */ \
- \
- movdqu_r2r(xmm4, xmm3); /* make a copy */ \
- punpckldq_r2r(xmm6, xmm4); /* xmm4=h1g1f1e1h0g0f0e0 */ \
- \
- punpckhdq_r2r(xmm6, xmm3); /* xmm3=h3g3g3e3h2g2f2e2 */ \
- movdqu_r2m(xmm3, *I(6)); /* save h3g3g3e3h2g2f2e2 */ \
- /* Free xmm6 */ \
- movdqu_r2r(xmm5, xmm6); /* make a copy */ \
- punpckldq_r2r(xmm7, xmm5); /* xmm5=h5g5f5e5h4g4f4e4 */ \
- \
- punpckhdq_r2r(xmm7, xmm6); /* xmm6=h7g7f7e7h6g6f6e6 */ \
- movdqu_m2r(*I(0), xmm0); /* xmm0=a7a6a5a4a3a2a1a0 */ \
- /* Free xmm7 */ \
- movdqu_m2r(*I(1), xmm1); /* xmm1=b7b6b5b4b3b2b1b0 */ \
- movdqu_r2r(xmm0, xmm7); /* make a copy */ \
- \
- punpcklwd_r2r(xmm1, xmm0); /* xmm0=b3a3b2a2b1a1b0a0 */ \
- punpckhwd_r2r(xmm1, xmm7); /* xmm7=b7a7b6a6b5a5b4a4 */ \
- /* Free xmm1 */ \
- movdqu_m2r(*I(2), xmm2); /* xmm2=c7c6c5c4c3c2c1c0 */ \
- movdqu_m2r(*I(3), xmm3); /* xmm3=d7d6d5d4d3d2d1d0 */ \
- \
- movdqu_r2r(xmm2, xmm1); /* make a copy */ \
- punpcklwd_r2r(xmm3, xmm2); /* xmm2=d3c3d2c2d1c1d0c0 */ \
- \
- punpckhwd_r2r(xmm3, xmm1); /* xmm1=d7c7d6c6d5c5d4c4 */ \
- movdqu_r2r(xmm0, xmm3); /* make a copy */ \
- \
- punpckldq_r2r(xmm2, xmm0); /* xmm0=d1c1b1a1d0c0b0a0 */ \
- punpckhdq_r2r(xmm2, xmm3); /* xmm3=d3c3b3a3d2c2b2a2 */ \
- /* Free xmm2 */ \
- movdqu_r2r(xmm7, xmm2); /* make a copy */ \
- punpckldq_r2r(xmm1, xmm2); /* xmm2=d5c5b5a5d4c4b4a4 */ \
- \
- punpckhdq_r2r(xmm1, xmm7); /* xmm7=d7c7b7a7d6c6b6a6 */ \
- movdqu_r2r(xmm0, xmm1); /* make a copy */ \
- \
- punpcklqdq_r2r(xmm4, xmm0); /* xmm0=h0g0f0e0d0c0b0a0 */ \
- punpckhqdq_r2r(xmm4, xmm1); /* xmm1=h1g1g1e1d1c1b1a1 */ \
- \
- movdqu_r2m(xmm0, *I(0)); /* save I(0) */ \
- movdqu_r2m(xmm1, *I(1)); /* save I(1) */ \
- \
- movdqu_m2r(*I(6), xmm0); /* load h3g3g3e3h2g2f2e2 */ \
- movdqu_r2r(xmm3, xmm1); /* make a copy */ \
- \
- punpcklqdq_r2r(xmm0, xmm1); /* xmm1=h2g2f2e2d2c2b2a2 */ \
- punpckhqdq_r2r(xmm0, xmm3); /* xmm3=h3g3f3e3d3c3b3a3 */ \
- \
- movdqu_r2r(xmm2, xmm4); /* make a copy */ \
- punpcklqdq_r2r(xmm5, xmm4); /* xmm4=h4g4f4e4d4c4b4a4 */ \
- \
- punpckhqdq_r2r(xmm5, xmm2); /* xmm2=h5g5f5e5d5c5b5a5 */ \
- movdqu_r2m(xmm1, *I(2)); /* save I(2) */ \
- \
- movdqu_r2m(xmm3, *I(3)); /* save I(3) */ \
- movdqu_r2m(xmm4, *I(4)); /* save I(4) */ \
- \
- movdqu_r2m(xmm2, *I(5)); /* save I(5) */ \
- movdqu_r2r(xmm7, xmm5); /* make a copy */ \
- \
- punpcklqdq_r2r(xmm6, xmm5); /* xmm5=h6g6f6e6d6c6b6a6 */ \
- punpckhqdq_r2r(xmm6, xmm7); /* xmm7=h7g7f7e7d7c7b7a7 */ \
- \
- movdqu_r2m(xmm5, *I(6)); /* save I(6) */ \
- movdqu_r2m(xmm7, *I(7)); /* save I(7) */ \
- \
-} /* End of Transpose Macro */
-
-
-#define SSE2_Dequantize() { \
- movdqu_m2r(*(eax), xmm0); \
- \
- pmullw_m2r(*(ebx), xmm0); /* xmm0 = 07 06 05 04 03 02 01 00 */ \
- movdqu_m2r(*(eax + 16), xmm1); \
- \
- pmullw_m2r(*(ebx + 16), xmm1); /* xmm1 = 17 16 15 14 13 12 11 10 */ \
- pshuflw_r2r(xmm0, xmm3, 0x078); /* xmm3 = 07 06 05 04 01 03 02 00 */ \
- \
- movdqu_r2r(xmm1, xmm2); /* xmm2 = 17 16 15 14 13 12 11 10 */ \
- movdqu_m2r(*(ecx), xmm7); /* xmm7 = -- -- -- -- -- FF FF -- */ \
- \
- movdqu_m2r(*(eax + 32), xmm4); \
- movdqu_m2r(*(eax + 64), xmm5); \
- \
- pmullw_m2r(*(ebx + 32), xmm4); /* xmm4 = 27 26 25 24 23 22 21 20 */ \
- pmullw_m2r(*(ebx + 64), xmm5); /* xmm5 = 47 46 45 44 43 42 41 40 */ \
- \
- movdqu_m2r(*(ecx + 16), xmm6); /* xmm6 = -- -- FF FF -- -- -- -- */ \
- pand_r2r(xmm2, xmm7); /* xmm7 = -- -- -- -- -- 12 11 -- */ \
- \
- pand_r2r(xmm4, xmm6); /* xmm6 = -- -- 25 24 -- -- -- -- */ \
- pxor_r2r(xmm7, xmm2); /* xmm2 = 17 16 15 14 13 -- -- 10 */ \
- \
- pxor_r2r(xmm6, xmm4); /* xmm4 = 27 26 -- -- 23 22 21 20 */ \
- pslldq_i2r(4, xmm7); /* xmm7 = -- -- -- 12 11 -- -- -- */ \
- \
- pslldq_i2r(2, xmm6); /* xmm6 = -- 25 24 -- -- -- -- -- */ \
- por_r2r(xmm6, xmm7); /* xmm7 = -- 25 24 12 11 -- -- -- */ \
- \
- movdqu_m2r(*(ecx + 32), xmm0); /* xmm0 = -- -- -- -- -- FF FF FF */ \
- movdqu_m2r(*(ecx + 48), xmm6); /* xmm6 = -- -- -- -- FF -- -- -- */ \
- \
- pand_r2r(xmm3, xmm0); /* xmm0 = -- -- -- -- -- 03 02 00 */ \
- pand_r2r(xmm5, xmm6); /* xmm6 = -- -- -- -- 43 -- -- -- */ \
- \
- pxor_r2r(xmm0, xmm3); /* xmm3 = 07 06 05 04 01 -- -- -- */ \
- pxor_r2r(xmm6, xmm5); /* xmm5 = 47 46 45 44 -- 42 41 40 */ \
- \
- por_r2r(xmm7, xmm0); /* xmm0 = -- 25 24 12 11 03 02 00 */ \
- pslldq_i2r(8, xmm6); /* xmm6 = 43 -- -- -- -- -- -- -- */ \
- \
- por_r2r(xmm6, xmm0); /* xmm0 = 43 25 24 12 11 03 02 00 */ \
- /* 02345 in use */ \
- \
- movdqu_m2r(*(ecx + 64 ), xmm1); /* xmm1 = -- -- -- FF FF -- -- -- */ \
- pshuflw_r2r(xmm5, xmm5, 0x0B4); /* xmm5 = 47 46 45 44 42 -- 41 40 */ \
- \
- movdqu_r2r(xmm1, xmm7); /* xmm7 = -- -- -- FF FF -- -- -- */ \
- movdqu_r2r(xmm1, xmm6); /* xmm6 = -- -- -- FF FF -- -- -- */ \
- \
- movdqu_r2m(xmm0, *(eax)); /* write 43 25 24 12 11 03 02 00 */ \
- pshufhw_r2r(xmm4, xmm4, 0x0C2); /* xmm4 = 27 -- -- 26 23 22 21 20 */ \
- \
- pand_r2r(xmm4, xmm7); /* xmm7 = -- -- -- 26 23 -- -- -- */ \
- pand_r2r(xmm5, xmm1); /* xmm1 = -- -- -- 44 42 -- -- -- */ \
- \
- pxor_r2r(xmm7, xmm4); /* xmm4 = 27 -- -- -- -- 22 21 20 */ \
- pxor_r2r(xmm1, xmm5); /* xmm5 = 47 46 45 -- -- -- 41 40 */ \
- \
- pshuflw_r2r(xmm2, xmm2, 0x0C6); /* xmm2 = 17 16 15 14 13 10 -- -- */ \
- movdqu_r2r(xmm6, xmm0); /* xmm0 = -- -- -- FF FF -- -- -- */ \
- \
- pslldq_i2r(2, xmm7); /* xmm7 = -- -- 26 23 -- -- -- -- */ \
- pslldq_i2r(6, xmm1); /* xmm1 = 44 42 -- -- -- -- -- -- */ \
- \
- psrldq_i2r(2, xmm0); /* xmm0 = -- -- -- -- FF FF -- -- */ \
- pand_r2r(xmm3, xmm6); /* xmm6 = -- -- -- 04 01 -- -- -- */ \
- \
- pand_r2r(xmm2, xmm0); /* xmm0 = -- -- -- -- 13 10 -- -- */ \
- pxor_r2r(xmm6, xmm3); /* xmm3 = 07 06 05 -- -- -- -- -- */ \
- \
- pxor_r2r(xmm0, xmm2); /* xmm2 = 17 16 15 14 -- -- -- -- */ \
- psrldq_i2r(6, xmm6); /* xmm0 = -- -- -- -- -- -- 04 01 */ \
- \
- por_r2r(xmm7, xmm1); /* xmm1 = 44 42 26 23 -- -- -- -- */ \
- por_r2r(xmm6, xmm0); /* xmm1 = -- -- -- -- 13 10 04 01 */ \
- /* 12345 in use */ \
- por_r2r(xmm0, xmm1); /* xmm1 = 44 42 26 23 13 10 04 01 */ \
- pshuflw_r2r(xmm4, xmm4, 0x093); /* xmm4 = 27 -- -- -- 22 21 20 -- */ \
- \
- pshufhw_r2r(xmm4, xmm4, 0x093); /* xmm4 = -- -- -- 27 22 21 20 -- */ \
- movdqu_r2m(xmm1, *(eax + 16)); /* write 44 42 26 23 13 10 04 01 */ \
- \
- pshufhw_r2r(xmm3, xmm3, 0x0D2); /* xmm3 = 07 05 -- 06 -- -- -- -- */ \
- movdqu_m2r(*(ecx + 64), xmm0); /* xmm0 = -- -- -- FF FF -- -- -- */ \
- \
- pand_r2r(xmm3, xmm0); /* xmm0 = -- -- -- 06 -- -- -- -- */ \
- psrldq_i2r(12, xmm3); /* xmm3 = -- -- -- -- -- -- 07 05 */ \
- \
- psrldq_i2r(8, xmm0); /* xmm0 = -- -- -- -- -- -- -- 06 */ \
- \
- movdqu_m2r(*(ecx + 64), xmm6); /* xmm6 = -- -- -- FF FF -- -- -- */ \
- movdqu_m2r(*(ecx + 96), xmm7); /* xmm7 = -- -- -- -- FF FF -- -- */ \
- \
- pand_r2r(xmm4, xmm6); /* xmm6 = -- -- -- 27 22 -- -- -- */ \
- pxor_r2r(xmm6, xmm4); /* xmm4 = -- -- -- -- -- 21 20 -- */ \
- \
- por_r2r(xmm6, xmm3); /* xmm3 = -- -- -- 27 22 -- 07 05 */ \
- pand_r2r(xmm4, xmm7); /* xmm7 = -- -- -- -- -- 21 -- -- */ \
- \
- por_r2r(xmm7, xmm0); /* xmm0 = -- -- -- -- -- 21 -- 06 */ \
- pxor_r2r(xmm7, xmm4); /* xmm4 = -- -- -- -- -- -- 20 -- */ \
- \
- movdqu_m2r(*(ecx + 16 ), xmm6); /* xmm6 = -- -- FF FF -- -- -- -- */ \
- movdqu_m2r(*(ecx + 64 ), xmm1); /* xmm1 = -- -- -- FF FF -- -- -- */ \
- \
- pand_r2r(xmm2, xmm6); /* xmm6 = -- -- 15 14 -- -- -- -- */ \
- pand_r2r(xmm6, xmm1); /* xmm1 = -- -- -- 14 -- -- -- -- */ \
- \
- pxor_r2r(xmm6, xmm2); /* xmm2 = 17 16 -- -- -- -- -- -- */ \
- pxor_r2r(xmm1, xmm6); /* xmm6 = -- -- 15 -- -- -- -- -- */ \
- \
- psrldq_i2r(4, xmm1); /* xmm1 = -- -- -- -- -- 14 -- -- */ \
- \
- psrldq_i2r(8, xmm6); /* xmm6 = -- -- -- -- -- -- 15 -- */ \
- por_r2r(xmm1, xmm3); /* xmm3 = -- -- -- 27 22 14 07 05 */ \
- \
- por_r2r(xmm6, xmm0); /* xmm0 = -- -- -- -- -- 21 15 06 */ \
- pshufhw_r2r(xmm5, xmm5, 0x0E1); /* xmm5 = 47 46 -- 45 -- -- 41 40 */ \
- \
- movdqu_m2r(*(ecx + 64), xmm1); /* xmm1 = -- -- -- FF FF -- -- -- */ \
- pshuflw_r2r(xmm5, xmm5, 0x072); /* xmm5 = 47 46 -- 45 41 -- 40 -- */ \
- \
- movdqu_r2r(xmm1, xmm6); /* xmm6 = -- -- -- FF FF -- -- -- */ \
- pand_r2r(xmm5, xmm1); /* xmm1 = -- -- -- 45 41 -- -- -- */ \
- \
- pxor_r2r(xmm1, xmm5); /* xmm5 = 47 46 -- -- -- -- 40 -- */ \
- pslldq_i2r(4, xmm1); /* xmm1 = -- 45 41 -- -- -- -- -- */ \
- \
- pshufd_r2r(xmm5, xmm5, 0x09C); /* xmm5 = -- -- -- -- 47 46 40 -- */ \
- por_r2r(xmm1, xmm3); /* xmm3 = -- 45 41 27 22 14 07 05 */ \
- \
- movdqu_m2r(*(eax + 96), xmm1); /* xmm1 = 67 66 65 64 63 62 61 60 */ \
- pmullw_m2r(*(ebx + 96), xmm1); \
- \
- movdqu_m2r(*(ecx), xmm7); /* xmm7 = -- -- -- -- -- FF FF -- */ \
- \
- psrldq_i2r(8, xmm6); /* xmm6 = -- -- -- -- -- -- -- FF */ \
- pand_r2r(xmm5, xmm7); /* xmm7 = -- -- -- -- -- 46 40 -- */ \
- \
- pand_r2r(xmm1, xmm6); /* xmm6 = -- -- -- -- -- -- -- 60 */ \
- pxor_r2r(xmm7, xmm5); /* xmm5 = -- -- -- -- 47 -- -- -- */ \
- \
- pxor_r2r(xmm6, xmm1); /* xmm1 = 67 66 65 64 63 62 61 -- */ \
- pslldq_i2r(2, xmm5); /* xmm5 = -- -- -- 47 -- -- -- -- */ \
- \
- pslldq_i2r(14, xmm6); /* xmm6 = 60 -- -- -- -- -- -- -- */ \
- por_r2r(xmm5, xmm4); /* xmm4 = -- -- -- 47 -- -- 20 -- */ \
- \
- por_r2r(xmm6, xmm3); /* xmm3 = 60 45 41 27 22 14 07 05 */ \
- pslldq_i2r(6, xmm7); /* xmm7 = -- -- 46 40 -- -- -- -- */ \
- \
- movdqu_r2m(xmm3, *(eax+32)); /* write 60 45 41 27 22 14 07 05 */ \
- por_r2r(xmm7, xmm0); /* xmm0 = -- -- 46 40 -- 21 15 06 */ \
- /* 0, 1, 2, 4 in use */ \
- movdqu_m2r(*(eax + 48), xmm3); /* xmm3 = 37 36 35 34 33 32 31 30 */ \
- movdqu_m2r(*(eax + 80), xmm5); /* xmm5 = 57 56 55 54 53 52 51 50 */ \
- \
- pmullw_m2r(*(ebx + 48), xmm3); \
- pmullw_m2r(*(ebx + 80), xmm5); \
- \
- movdqu_m2r(*(ecx + 64), xmm6); /* xmm6 = -- -- -- FF FF -- -- -- */ \
- movdqu_m2r(*(ecx + 64), xmm7); /* xmm7 = -- -- -- FF FF -- -- -- */ \
- \
- psrldq_i2r(8, xmm6); /* xmm6 = -- -- -- -- -- -- -- FF */ \
- pslldq_i2r(8, xmm7); /* xmm7 = FF -- -- -- -- -- -- -- */ \
- \
- pand_r2r(xmm3, xmm6); /* xmm6 = -- -- -- -- -- -- -- 30 */ \
- pand_r2r(xmm5, xmm7); /* xmm7 = 57 -- -- -- -- -- -- -- */ \
- \
- pxor_r2r(xmm6, xmm3); /* xmm3 = 37 36 35 34 33 32 31 -- */ \
- pxor_r2r(xmm7, xmm5); /* xmm5 = __ 56 55 54 53 52 51 50 */ \
- \
- pslldq_i2r(6, xmm6); /* xmm6 = -- -- -- -- 30 -- -- -- */ \
- psrldq_i2r(2, xmm7); /* xmm7 = -- 57 -- -- -- -- -- -- */ \
- \
- por_r2r(xmm7, xmm6); /* xmm6 = -- 57 -- -- 30 -- -- -- */ \
- movdqu_m2r(*(ecx), xmm7); /* xmm7 = -- -- -- -- -- FF FF -- */ \
- \
- por_r2r(xmm6, xmm0); /* xmm0 = -- 57 46 40 30 21 15 06 */ \
- psrldq_i2r(2, xmm7); /* xmm7 = -- -- -- -- -- -- FF FF */ \
- \
- movdqu_r2r(xmm2, xmm6); /* xmm6 = 17 16 -- -- -- -- -- -- */ \
- pand_r2r(xmm1, xmm7); /* xmm7 = -- -- -- -- -- -- 61 -- */ \
- \
- pslldq_i2r(2, xmm6); /* xmm6 = 16 -- -- -- -- -- -- -- */ \
- psrldq_i2r(14, xmm2); /* xmm2 = -- -- -- -- -- -- -- 17 */ \
- \
- pxor_r2r(xmm7, xmm1); /* xmm1 = 67 66 65 64 63 62 -- -- */ \
- pslldq_i2r(12, xmm7); /* xmm7 = 61 -- -- -- -- -- -- -- */ \
- \
- psrldq_i2r(14, xmm6); /* xmm6 = -- -- -- -- -- -- -- 16 */ \
- por_r2r(xmm6, xmm4); /* xmm4 = -- -- -- 47 -- -- 20 16 */ \
- \
- por_r2r(xmm7, xmm0); /* xmm0 = 61 57 46 40 30 21 15 06 */ \
- movdqu_m2r(*(ecx), xmm6); /* xmm6 = -- -- -- -- -- FF FF -- */ \
- \
- psrldq_i2r(2, xmm6); /* xmm6 = -- -- -- -- -- -- FF FF */ \
- movdqu_r2m(xmm0, *(eax+48)); /* write 61 57 46 40 30 21 15 06 */ \
- /* 1, 2, 3, 4, 5 in use */\
- movdqu_m2r(*(ecx), xmm0); /* xmm0 = -- -- -- -- -- FF FF -- */ \
- pand_r2r(xmm3, xmm6); /* xmm6 = -- -- -- -- -- -- 31 -- */ \
- \
- movdqu_r2r(xmm3, xmm7); /* xmm7 = 37 36 35 34 33 32 31 -- */ \
- pxor_r2r(xmm6, xmm3); /* xmm3 = 37 36 35 34 33 32 -- -- */ \
- \
- pslldq_i2r(2, xmm3); /* xmm3 = 36 35 34 33 32 -- -- -- */ \
- pand_r2r(xmm1, xmm0); /* xmm0 = -- -- -- -- -- 62 -- -- */ \
- \
- psrldq_i2r(14, xmm7); /* xmm7 = -- -- -- -- -- -- -- 37 */ \
- pxor_r2r(xmm0, xmm1); /* xmm1 = 67 66 65 64 63 -- -- -- */ \
- \
- por_r2r(xmm7, xmm6); /* xmm6 = -- -- -- -- -- -- 31 37 */ \
- movdqu_m2r(*(ecx + 64), xmm7); /* xmm7 = -- -- -- FF FF -- -- -- */ \
- \
- pshuflw_r2r(xmm6, xmm6, 0x01E); /* xmm6 = -- -- -- -- 37 31 -- -- */ \
- pslldq_i2r(6, xmm7); /* xmm7 = FF FF -- -- -- -- -- -- */ \
- \
- por_r2r(xmm6, xmm4); /* xmm4 = -- -- -- 47 37 31 20 16 */ \
- pand_r2r(xmm5, xmm7); /* xmm7 = -- 56 -- -- -- -- -- -- */ \
- \
- pslldq_i2r(8, xmm0); /* xmm0 = -- 62 -- -- -- -- -- -- */ \
- pxor_r2r(xmm7, xmm5); /* xmm5 = -- -- 55 54 53 52 51 50 */ \
- \
- psrldq_i2r(2, xmm7); /* xmm7 = -- -- 56 -- -- -- -- -- */ \
- \
- pshufhw_r2r(xmm3, xmm3, 0x087); /* xmm3 = 35 33 34 36 32 -- -- -- */ \
- por_r2r(xmm7, xmm0); /* xmm0 = -- 62 56 -- -- -- -- -- */ \
- \
- movdqu_m2r(*(eax + 112), xmm7); /* xmm7 = 77 76 75 74 73 72 71 70 */ \
- pmullw_m2r(*(ebx + 112), xmm7); \
- \
- movdqu_m2r(*(ecx + 64), xmm6); /* xmm6 = -- -- -- FF FF -- -- -- */ \
- por_r2r(xmm0, xmm4); /* xmm4 = -- 62 56 47 37 31 20 16 */ \
- \
- pshuflw_r2r(xmm7, xmm7, 0x0E1); /* xmm7 = 77 76 75 74 73 72 70 71 */ \
- psrldq_i2r(8, xmm6); /* xmm6 = -- -- -- -- -- -- -- FF */ \
- \
- movdqu_m2r(*(ecx + 64), xmm0); /* xmm0 = -- -- -- FF FF -- -- -- */ \
- pand_r2r(xmm7, xmm6); /* xmm6 = -- -- -- -- -- -- -- 71 */ \
- \
- pand_r2r(xmm3, xmm0); /* xmm0 = -- -- -- 36 32 -- -- -- */ \
- pxor_r2r(xmm6, xmm7); /* xmm7 = 77 76 75 74 73 72 70 -- */ \
- \
- pxor_r2r(xmm0, xmm3); /* xmm3 = 35 33 34 -- -- -- -- -- */ \
- pslldq_i2r(14, xmm6); /* xmm6 = 71 -- -- -- -- -- -- -- */ \
- \
- psrldq_i2r(4, xmm0); /* xmm0 = -- -- -- -- -- 36 32 -- */ \
- por_r2r(xmm6, xmm4); /* xmm4 = 71 62 56 47 37 31 20 16 */ \
- \
- por_r2r(xmm0, xmm2); /* xmm2 = -- -- -- -- -- 36 32 17 */ \
- movdqu_r2m(xmm4, *(eax + 64)); /* write 71 62 56 47 37 31 20 16 */ \
- /* 1, 2, 3, 5, 7 in use */ \
- movdqu_m2r(*(ecx + 80), xmm6); /* xmm6 = -- -- FF -- -- -- -- FF */ \
- pshufhw_r2r(xmm7, xmm7, 0x0D2); /* xmm7 = 77 75 74 76 73 72 70 __ */ \
- \
- movdqu_m2r(*(ecx), xmm4); /* xmm4 = -- -- -- -- -- FF FF -- */ \
- movdqu_m2r(*(ecx+48), xmm0); /* xmm0 = -- -- -- -- FF -- -- -- */ \
- \
- pand_r2r(xmm5, xmm6); /* xmm6 = -- -- 55 -- -- -- -- 50 */ \
- pand_r2r(xmm7, xmm4); /* xmm4 = -- -- -- -- -- 72 70 -- */ \
- \
- pand_r2r(xmm1, xmm0); /* xmm0 = -- -- -- -- 63 -- -- -- */ \
- pxor_r2r(xmm6, xmm5); /* xmm5 = -- -- -- 54 53 52 51 -- */ \
- \
- pxor_r2r(xmm4, xmm7); /* xmm7 = 77 75 74 76 73 -- -- -- */ \
- pxor_r2r(xmm0, xmm1); /* xmm1 = 67 66 65 64 -- -- -- -- */ \
- \
- pshuflw_r2r(xmm6, xmm6, 0x02B); /* xmm6 = -- -- 55 -- 50 -- -- -- */ \
- pslldq_i2r(10, xmm4); /* xmm4 = 72 20 -- -- -- -- -- -- */ \
- \
- pshufhw_r2r(xmm6, xmm6, 0x0B1); /* xmm6 = -- -- -- 55 50 -- -- -- */ \
- pslldq_i2r(4, xmm0); /* xmm0 = -- -- 63 -- -- -- -- -- */ \
- \
- por_r2r(xmm4, xmm6); /* xmm6 = 72 70 -- 55 50 -- -- -- */ \
- por_r2r(xmm0, xmm2); /* xmm2 = -- -- 63 -- -- 36 32 17 */ \
- \
- por_r2r(xmm6, xmm2); /* xmm2 = 72 70 64 55 50 36 32 17 */ \
- pshufhw_r2r(xmm1, xmm1, 0x0C9); /* xmm1 = 67 64 66 65 -- -- -- -- */ \
- \
- movdqu_r2r(xmm3, xmm6); /* xmm6 = 35 33 34 -- -- -- -- -- */ \
- movdqu_r2m(xmm2, *(eax+80)); /* write 72 70 64 55 50 36 32 17 */ \
- \
- psrldq_i2r(12, xmm6); /* xmm6 = -- -- -- -- -- -- 35 33 */ \
- pslldq_i2r(4, xmm3); /* xmm3 = 34 -- -- -- -- -- -- -- */ \
- \
- pshuflw_r2r(xmm5, xmm5, 0x04E); /* xmm5 = -- -- -- 54 51 -- 53 52 */ \
- movdqu_r2r(xmm7, xmm4); /* xmm4 = 77 75 74 76 73 -- -- -- */ \
- \
- movdqu_r2r(xmm5, xmm2); /* xmm2 = -- -- -- 54 51 -- 53 52 */ \
- psrldq_i2r(10, xmm7); /* xmm7 = -- -- -- -- -- 77 75 74 */ \
- \
- pslldq_i2r(6, xmm4); /* xmm4 = 76 73 -- -- -- -- -- -- */ \
- pslldq_i2r(12, xmm2); /* xmm2 = 53 52 -- -- -- -- -- -- */ \
- \
- movdqu_r2r(xmm1, xmm0); /* xmm0 = 67 64 66 65 -- -- -- -- */ \
- psrldq_i2r(12, xmm1); /* xmm1 = -- -- -- -- -- -- 67 64 */ \
- \
- psrldq_i2r(6, xmm5); /* xmm5 = -- -- -- -- -- -- 54 51 */ \
- psrldq_i2r(14, xmm3); /* xmm3 = -- -- -- -- -- -- -- 34 */ \
- \
- pslldq_i2r(10, xmm7); /* xmm7 = 77 75 74 -- -- -- -- -- */ \
- por_r2r(xmm6, xmm4); /* xmm4 = 76 73 -- -- -- -- 35 33 */ \
- \
- psrldq_i2r(10, xmm2); /* xmm2 = -- -- -- -- -- 53 52 -- */ \
- pslldq_i2r(4, xmm0); /* xmm0 = 66 65 -- -- -- -- -- -- */ \
- \
- pslldq_i2r(8, xmm1); /* xmm1 = -- -- 67 64 -- -- -- -- */ \
- por_r2r(xmm7, xmm3); /* xmm3 = 77 75 74 -- -- -- -- 34 */ \
- \
- psrldq_i2r(6, xmm0); /* xmm0 = -- -- -- 66 65 -- -- -- */ \
- pslldq_i2r(4, xmm5); /* xmm5 = -- -- -- -- 54 51 -- -- */ \
- \
- por_r2r(xmm1, xmm4); /* xmm4 = 76 73 67 64 -- -- 35 33 */ \
- por_r2r(xmm2, xmm3); /* xmm3 = 77 75 74 -- -- 53 52 34 */ \
- \
- por_r2r(xmm5, xmm4); /* xmm4 = 76 73 67 64 54 51 35 33 */ \
- por_r2r(xmm0, xmm3); /* xmm3 = 77 75 74 66 65 53 52 34 */ \
- \
- movdqu_r2m(xmm4, *(eax+96)); /* write 76 73 67 64 54 51 35 33 */ \
- movdqu_r2m(xmm3, *(eax+112)); /* write 77 75 74 66 65 53 52 34 */ \
- \
-} /* end of SSE2_Dequantize Macro */
-
-
-void ff_vp3_idct_sse2(int16_t *input_data)
-{
- unsigned char *input_bytes = (unsigned char *)input_data;
- unsigned char *output_data_bytes = (unsigned char *)input_data;
- unsigned char *idct_data_bytes = (unsigned char *)SSE2_idct_data;
- unsigned char *Eight = (unsigned char *)eight_data;
-
-#define eax input_bytes
-//#define ebx dequant_matrix_bytes
-#define ecx dequant_const_bytes
-#define edx idct_data_bytes
-
-#define I(i) (eax + 16 * i)
-#define O(i) (ebx + 16 * i)
-#define C(i) (edx + 16 * (i-1))
-
- // SSE2_Dequantize();
-
-#undef ebx
-#define ebx output_data_bytes
-
- SSE2_Row_IDCT();
-
- SSE2_Transpose();
-
- SSE2_Column_IDCT();
-}
diff --git a/src/libffmpeg/libavcodec/idcinvideo.c b/src/libffmpeg/libavcodec/idcinvideo.c
deleted file mode 100644
index 112da7bc6..000000000
--- a/src/libffmpeg/libavcodec/idcinvideo.c
+++ /dev/null
@@ -1,272 +0,0 @@
-/*
- * Id Quake II CIN Video Decoder
- * Copyright (C) 2003 the ffmpeg project
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file idcinvideo.c
- * Id Quake II Cin Video Decoder by Dr. Tim Ferguson
- * For more information about the Id CIN format, visit:
- * http://www.csse.monash.edu.au/~timf/
- *
- * This video decoder outputs PAL8 colorspace data. Interacting with this
- * decoder is a little involved. During initialization, the demuxer must
- * transmit the 65536-byte Huffman table(s) to the decoder via extradata.
- * Then, whenever a palette change is encountered while demuxing the file,
- * the demuxer must use the same extradata space to transmit an
- * AVPaletteControl structure.
- *
- * Id CIN video is purely Huffman-coded, intraframe-only codec. It achieves
- * a little more compression by exploiting the fact that adjacent pixels
- * tend to be similar.
- *
- * Note that this decoder could use ffmpeg's optimized VLC facilities
- * rather than naive, tree-based Huffman decoding. However, there are 256
- * Huffman tables. Plus, the VLC bit coding order is right -> left instead
- * or left -> right, so all of the bits would have to be reversed. Further,
- * the original Quake II implementation likely used a similar naive
- * decoding algorithm and it worked fine on much lower spec machines.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "common.h"
-#include "avcodec.h"
-#include "dsputil.h"
-
-#define HUFFMAN_TABLE_SIZE 64 * 1024
-#define HUF_TOKENS 256
-#define PALETTE_COUNT 256
-
-typedef struct
-{
- int count;
- unsigned char used;
- int children[2];
-} hnode_t;
-
-typedef struct IdcinContext {
-
- AVCodecContext *avctx;
- DSPContext dsp;
- AVFrame frame;
-
- unsigned char *buf;
- int size;
-
- hnode_t huff_nodes[256][HUF_TOKENS*2];
- int num_huff_nodes[256];
-
-} IdcinContext;
-
-/*
- * Find the lowest probability node in a Huffman table, and mark it as
- * being assigned to a higher probability.
- * Returns the node index of the lowest unused node, or -1 if all nodes
- * are used.
- */
-static int huff_smallest_node(hnode_t *hnodes, int num_hnodes) {
- int i;
- int best, best_node;
-
- best = 99999999;
- best_node = -1;
- for(i = 0; i < num_hnodes; i++) {
- if(hnodes[i].used)
- continue;
- if(!hnodes[i].count)
- continue;
- if(hnodes[i].count < best) {
- best = hnodes[i].count;
- best_node = i;
- }
- }
-
- if(best_node == -1)
- return -1;
- hnodes[best_node].used = 1;
- return best_node;
-}
-
-/*
- * Build the Huffman tree using the generated/loaded probabilities histogram.
- *
- * On completion:
- * huff_nodes[prev][i < HUF_TOKENS] - are the nodes at the base of the tree.
- * huff_nodes[prev][i >= HUF_TOKENS] - are used to construct the tree.
- * num_huff_nodes[prev] - contains the index to the root node of the tree.
- * That is: huff_nodes[prev][num_huff_nodes[prev]] is the root node.
- */
-static void huff_build_tree(IdcinContext *s, int prev) {
- hnode_t *node, *hnodes;
- int num_hnodes, i;
-
- num_hnodes = HUF_TOKENS;
- hnodes = s->huff_nodes[prev];
- for(i = 0; i < HUF_TOKENS * 2; i++)
- hnodes[i].used = 0;
-
- while (1) {
- node = &hnodes[num_hnodes]; /* next free node */
-
- /* pick two lowest counts */
- node->children[0] = huff_smallest_node(hnodes, num_hnodes);
- if(node->children[0] == -1)
- break; /* reached the root node */
-
- node->children[1] = huff_smallest_node(hnodes, num_hnodes);
- if(node->children[1] == -1)
- break; /* reached the root node */
-
- /* combine nodes probability for new node */
- node->count = hnodes[node->children[0]].count +
- hnodes[node->children[1]].count;
- num_hnodes++;
- }
-
- s->num_huff_nodes[prev] = num_hnodes - 1;
-}
-
-static int idcin_decode_init(AVCodecContext *avctx)
-{
- IdcinContext *s = (IdcinContext *)avctx->priv_data;
- int i, j, histogram_index = 0;
- unsigned char *histograms;
-
- s->avctx = avctx;
- avctx->pix_fmt = PIX_FMT_PAL8;
- avctx->has_b_frames = 0;
- dsputil_init(&s->dsp, avctx);
-
- /* make sure the Huffman tables make it */
- if (s->avctx->extradata_size != HUFFMAN_TABLE_SIZE) {
- av_log(s->avctx, AV_LOG_ERROR, " Id CIN video: expected extradata size of %d\n", HUFFMAN_TABLE_SIZE);
- return -1;
- }
-
- /* build the 256 Huffman decode trees */
- histograms = (unsigned char *)s->avctx->extradata;
- for (i = 0; i < 256; i++) {
- for(j = 0; j < HUF_TOKENS; j++)
- s->huff_nodes[i][j].count = histograms[histogram_index++];
- huff_build_tree(s, i);
- }
-
- s->frame.data[0] = NULL;
-
- return 0;
-}
-
-static void idcin_decode_vlcs(IdcinContext *s)
-{
- hnode_t *hnodes;
- long x, y;
- int prev;
- unsigned char v = 0;
- int bit_pos, node_num, dat_pos;
-
- prev = bit_pos = dat_pos = 0;
- for (y = 0; y < (s->frame.linesize[0] * s->avctx->height);
- y += s->frame.linesize[0]) {
- for (x = y; x < y + s->avctx->width; x++) {
- node_num = s->num_huff_nodes[prev];
- hnodes = s->huff_nodes[prev];
-
- while(node_num >= HUF_TOKENS) {
- if(!bit_pos) {
- if(dat_pos >= s->size) {
- av_log(s->avctx, AV_LOG_ERROR, "Huffman decode error.\n");
- return;
- }
- bit_pos = 8;
- v = s->buf[dat_pos++];
- }
-
- node_num = hnodes[node_num].children[v & 0x01];
- v = v >> 1;
- bit_pos--;
- }
-
- s->frame.data[0][x] = node_num;
- prev = node_num;
- }
- }
-}
-
-static int idcin_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- IdcinContext *s = (IdcinContext *)avctx->priv_data;
- AVPaletteControl *palette_control = avctx->palctrl;
-
- s->buf = buf;
- s->size = buf_size;
-
- if (s->frame.data[0])
- avctx->release_buffer(avctx, &s->frame);
-
- if (avctx->get_buffer(avctx, &s->frame)) {
- av_log(avctx, AV_LOG_ERROR, " Id CIN Video: get_buffer() failed\n");
- return -1;
- }
-
- idcin_decode_vlcs(s);
-
- /* make the palette available on the way out */
- memcpy(s->frame.data[1], palette_control->palette, PALETTE_COUNT * 4);
- /* If palette changed inform application*/
- if (palette_control->palette_changed) {
- palette_control->palette_changed = 0;
- s->frame.palette_has_changed = 1;
- }
-
- *data_size = sizeof(AVFrame);
- *(AVFrame*)data = s->frame;
-
- /* report that the buffer was completely consumed */
- return buf_size;
-}
-
-static int idcin_decode_end(AVCodecContext *avctx)
-{
- IdcinContext *s = (IdcinContext *)avctx->priv_data;
-
- if (s->frame.data[0])
- avctx->release_buffer(avctx, &s->frame);
-
- return 0;
-}
-
-AVCodec idcin_decoder = {
- "idcinvideo",
- CODEC_TYPE_VIDEO,
- CODEC_ID_IDCIN,
- sizeof(IdcinContext),
- idcin_decode_init,
- NULL,
- idcin_decode_end,
- idcin_decode_frame,
- CODEC_CAP_DR1,
-};
-
diff --git a/src/libffmpeg/libavcodec/imgconvert.c b/src/libffmpeg/libavcodec/imgconvert.c
deleted file mode 100644
index b2305cd63..000000000
--- a/src/libffmpeg/libavcodec/imgconvert.c
+++ /dev/null
@@ -1,2855 +0,0 @@
-/*
- * Misc image convertion routines
- * Copyright (c) 2001, 2002, 2003 Fabrice Bellard.
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file imgconvert.c
- * Misc image convertion routines.
- */
-
-/* TODO:
- * - write 'ffimg' program to test all the image related stuff
- * - move all api to slice based system
- * - integrate deinterlacing, postprocessing and scaling in the conversion process
- */
-
-#include "avcodec.h"
-#include "dsputil.h"
-
-#ifdef USE_FASTMEMCPY
-#include "libvo/fastmemcpy.h"
-#endif
-
-#ifdef HAVE_MMX
-#include "i386/mmx.h"
-#endif
-
-#define xglue(x, y) x ## y
-#define glue(x, y) xglue(x, y)
-
-#define FF_COLOR_RGB 0 /* RGB color space */
-#define FF_COLOR_GRAY 1 /* gray color space */
-#define FF_COLOR_YUV 2 /* YUV color space. 16 <= Y <= 235, 16 <= U, V <= 240 */
-#define FF_COLOR_YUV_JPEG 3 /* YUV color space. 0 <= Y <= 255, 0 <= U, V <= 255 */
-
-#define FF_PIXEL_PLANAR 0 /* each channel has one component in AVPicture */
-#define FF_PIXEL_PACKED 1 /* only one components containing all the channels */
-#define FF_PIXEL_PALETTE 2 /* one components containing indexes for a palette */
-
-typedef struct PixFmtInfo {
- const char *name;
- uint8_t nb_channels; /* number of channels (including alpha) */
- uint8_t color_type; /* color type (see FF_COLOR_xxx constants) */
- uint8_t pixel_type; /* pixel storage type (see FF_PIXEL_xxx constants) */
- uint8_t is_alpha : 1; /* true if alpha can be specified */
- uint8_t x_chroma_shift; /* X chroma subsampling factor is 2 ^ shift */
- uint8_t y_chroma_shift; /* Y chroma subsampling factor is 2 ^ shift */
- uint8_t depth; /* bit depth of the color components */
-} PixFmtInfo;
-
-/* this table gives more information about formats */
-static const PixFmtInfo pix_fmt_info[PIX_FMT_NB] = {
- /* YUV formats */
- [PIX_FMT_YUV420P] = {
- .name = "yuv420p",
- .nb_channels = 3,
- .color_type = FF_COLOR_YUV,
- .pixel_type = FF_PIXEL_PLANAR,
- .depth = 8,
- .x_chroma_shift = 1, .y_chroma_shift = 1,
- },
- [PIX_FMT_YUV422P] = {
- .name = "yuv422p",
- .nb_channels = 3,
- .color_type = FF_COLOR_YUV,
- .pixel_type = FF_PIXEL_PLANAR,
- .depth = 8,
- .x_chroma_shift = 1, .y_chroma_shift = 0,
- },
- [PIX_FMT_YUV444P] = {
- .name = "yuv444p",
- .nb_channels = 3,
- .color_type = FF_COLOR_YUV,
- .pixel_type = FF_PIXEL_PLANAR,
- .depth = 8,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
- },
- [PIX_FMT_YUV422] = {
- .name = "yuv422",
- .nb_channels = 1,
- .color_type = FF_COLOR_YUV,
- .pixel_type = FF_PIXEL_PACKED,
- .depth = 8,
- .x_chroma_shift = 1, .y_chroma_shift = 0,
- },
- [PIX_FMT_UYVY422] = {
- .name = "uyvy422",
- .nb_channels = 1,
- .color_type = FF_COLOR_YUV,
- .pixel_type = FF_PIXEL_PACKED,
- .depth = 8,
- .x_chroma_shift = 1, .y_chroma_shift = 0,
- },
- [PIX_FMT_YUV410P] = {
- .name = "yuv410p",
- .nb_channels = 3,
- .color_type = FF_COLOR_YUV,
- .pixel_type = FF_PIXEL_PLANAR,
- .depth = 8,
- .x_chroma_shift = 2, .y_chroma_shift = 2,
- },
- [PIX_FMT_YUV411P] = {
- .name = "yuv411p",
- .nb_channels = 3,
- .color_type = FF_COLOR_YUV,
- .pixel_type = FF_PIXEL_PLANAR,
- .depth = 8,
- .x_chroma_shift = 2, .y_chroma_shift = 0,
- },
-
- /* JPEG YUV */
- [PIX_FMT_YUVJ420P] = {
- .name = "yuvj420p",
- .nb_channels = 3,
- .color_type = FF_COLOR_YUV_JPEG,
- .pixel_type = FF_PIXEL_PLANAR,
- .depth = 8,
- .x_chroma_shift = 1, .y_chroma_shift = 1,
- },
- [PIX_FMT_YUVJ422P] = {
- .name = "yuvj422p",
- .nb_channels = 3,
- .color_type = FF_COLOR_YUV_JPEG,
- .pixel_type = FF_PIXEL_PLANAR,
- .depth = 8,
- .x_chroma_shift = 1, .y_chroma_shift = 0,
- },
- [PIX_FMT_YUVJ444P] = {
- .name = "yuvj444p",
- .nb_channels = 3,
- .color_type = FF_COLOR_YUV_JPEG,
- .pixel_type = FF_PIXEL_PLANAR,
- .depth = 8,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
- },
-
- /* RGB formats */
- [PIX_FMT_RGB24] = {
- .name = "rgb24",
- .nb_channels = 3,
- .color_type = FF_COLOR_RGB,
- .pixel_type = FF_PIXEL_PACKED,
- .depth = 8,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
- },
- [PIX_FMT_BGR24] = {
- .name = "bgr24",
- .nb_channels = 3,
- .color_type = FF_COLOR_RGB,
- .pixel_type = FF_PIXEL_PACKED,
- .depth = 8,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
- },
- [PIX_FMT_RGBA32] = {
- .name = "rgba32",
- .nb_channels = 4, .is_alpha = 1,
- .color_type = FF_COLOR_RGB,
- .pixel_type = FF_PIXEL_PACKED,
- .depth = 8,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
- },
- [PIX_FMT_RGB565] = {
- .name = "rgb565",
- .nb_channels = 3,
- .color_type = FF_COLOR_RGB,
- .pixel_type = FF_PIXEL_PACKED,
- .depth = 5,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
- },
- [PIX_FMT_RGB555] = {
- .name = "rgb555",
- .nb_channels = 3,
- .color_type = FF_COLOR_RGB,
- .pixel_type = FF_PIXEL_PACKED,
- .depth = 5,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
- },
-
- /* gray / mono formats */
- [PIX_FMT_GRAY16BE] = {
- .name = "gray16be",
- .nb_channels = 1,
- .color_type = FF_COLOR_GRAY,
- .pixel_type = FF_PIXEL_PLANAR,
- .depth = 16,
- },
- [PIX_FMT_GRAY16LE] = {
- .name = "gray16le",
- .nb_channels = 1,
- .color_type = FF_COLOR_GRAY,
- .pixel_type = FF_PIXEL_PLANAR,
- .depth = 16,
- },
- [PIX_FMT_GRAY8] = {
- .name = "gray",
- .nb_channels = 1,
- .color_type = FF_COLOR_GRAY,
- .pixel_type = FF_PIXEL_PLANAR,
- .depth = 8,
- },
- [PIX_FMT_MONOWHITE] = {
- .name = "monow",
- .nb_channels = 1,
- .color_type = FF_COLOR_GRAY,
- .pixel_type = FF_PIXEL_PLANAR,
- .depth = 1,
- },
- [PIX_FMT_MONOBLACK] = {
- .name = "monob",
- .nb_channels = 1,
- .color_type = FF_COLOR_GRAY,
- .pixel_type = FF_PIXEL_PLANAR,
- .depth = 1,
- },
-
- /* paletted formats */
- [PIX_FMT_PAL8] = {
- .name = "pal8",
- .nb_channels = 4, .is_alpha = 1,
- .color_type = FF_COLOR_RGB,
- .pixel_type = FF_PIXEL_PALETTE,
- .depth = 8,
- },
- [PIX_FMT_XVMC_MPEG2_MC] = {
- .name = "xvmcmc",
- },
- [PIX_FMT_XVMC_MPEG2_IDCT] = {
- .name = "xvmcidct",
- },
- [PIX_FMT_UYVY411] = {
- .name = "uyvy411",
- .nb_channels = 1,
- .color_type = FF_COLOR_YUV,
- .pixel_type = FF_PIXEL_PACKED,
- .depth = 8,
- .x_chroma_shift = 2, .y_chroma_shift = 0,
- },
- [PIX_FMT_BGR32] = {
- .name = "bgr32",
- .nb_channels = 4, .is_alpha = 1,
- .color_type = FF_COLOR_RGB,
- .pixel_type = FF_PIXEL_PACKED,
- .depth = 8,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
- },
- [PIX_FMT_BGR565] = {
- .name = "bgr565",
- .nb_channels = 3,
- .color_type = FF_COLOR_RGB,
- .pixel_type = FF_PIXEL_PACKED,
- .depth = 5,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
- },
- [PIX_FMT_BGR555] = {
- .name = "bgr555",
- .nb_channels = 3,
- .color_type = FF_COLOR_RGB,
- .pixel_type = FF_PIXEL_PACKED,
- .depth = 5,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
- },
- [PIX_FMT_RGB8] = {
- .name = "rgb8",
- .nb_channels = 1,
- .color_type = FF_COLOR_RGB,
- .pixel_type = FF_PIXEL_PACKED,
- .depth = 8,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
- },
- [PIX_FMT_RGB4] = {
- .name = "rgb4",
- .nb_channels = 1,
- .color_type = FF_COLOR_RGB,
- .pixel_type = FF_PIXEL_PACKED,
- .depth = 4,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
- },
- [PIX_FMT_RGB4_BYTE] = {
- .name = "rgb4_byte",
- .nb_channels = 1,
- .color_type = FF_COLOR_RGB,
- .pixel_type = FF_PIXEL_PACKED,
- .depth = 8,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
- },
- [PIX_FMT_BGR8] = {
- .name = "bgr8",
- .nb_channels = 1,
- .color_type = FF_COLOR_RGB,
- .pixel_type = FF_PIXEL_PACKED,
- .depth = 8,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
- },
- [PIX_FMT_BGR4] = {
- .name = "bgr4",
- .nb_channels = 1,
- .color_type = FF_COLOR_RGB,
- .pixel_type = FF_PIXEL_PACKED,
- .depth = 4,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
- },
- [PIX_FMT_BGR4_BYTE] = {
- .name = "bgr4_byte",
- .nb_channels = 1,
- .color_type = FF_COLOR_RGB,
- .pixel_type = FF_PIXEL_PACKED,
- .depth = 8,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
- },
- [PIX_FMT_NV12] = {
- .name = "nv12",
- .nb_channels = 2,
- .color_type = FF_COLOR_YUV,
- .pixel_type = FF_PIXEL_PLANAR,
- .depth = 8,
- .x_chroma_shift = 1, .y_chroma_shift = 1,
- },
- [PIX_FMT_NV21] = {
- .name = "nv12",
- .nb_channels = 2,
- .color_type = FF_COLOR_YUV,
- .pixel_type = FF_PIXEL_PLANAR,
- .depth = 8,
- .x_chroma_shift = 1, .y_chroma_shift = 1,
- },
-
- [PIX_FMT_BGR32_1] = {
- .name = "bgr32_1",
- .nb_channels = 4, .is_alpha = 1,
- .color_type = FF_COLOR_RGB,
- .pixel_type = FF_PIXEL_PACKED,
- .depth = 8,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
- },
- [PIX_FMT_RGB32_1] = {
- .name = "rgb32_1",
- .nb_channels = 4, .is_alpha = 1,
- .color_type = FF_COLOR_RGB,
- .pixel_type = FF_PIXEL_PACKED,
- .depth = 8,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
- },
-};
-
-void avcodec_get_chroma_sub_sample(int pix_fmt, int *h_shift, int *v_shift)
-{
- *h_shift = pix_fmt_info[pix_fmt].x_chroma_shift;
- *v_shift = pix_fmt_info[pix_fmt].y_chroma_shift;
-}
-
-const char *avcodec_get_pix_fmt_name(int pix_fmt)
-{
- if (pix_fmt < 0 || pix_fmt >= PIX_FMT_NB)
- return "???";
- else
- return pix_fmt_info[pix_fmt].name;
-}
-
-enum PixelFormat avcodec_get_pix_fmt(const char* name)
-{
- int i;
-
- for (i=0; i < PIX_FMT_NB; i++)
- if (!strcmp(pix_fmt_info[i].name, name))
- break;
- return i;
-}
-
-/* Picture field are filled with 'ptr' addresses. Also return size */
-int avpicture_fill(AVPicture *picture, uint8_t *ptr,
- int pix_fmt, int width, int height)
-{
- int size, w2, h2, size2;
- const PixFmtInfo *pinfo;
-
- if(avcodec_check_dimensions(NULL, width, height))
- goto fail;
-
- pinfo = &pix_fmt_info[pix_fmt];
- size = width * height;
- switch(pix_fmt) {
- case PIX_FMT_YUV420P:
- case PIX_FMT_YUV422P:
- case PIX_FMT_YUV444P:
- case PIX_FMT_YUV410P:
- case PIX_FMT_YUV411P:
- case PIX_FMT_YUVJ420P:
- case PIX_FMT_YUVJ422P:
- case PIX_FMT_YUVJ444P:
- w2 = (width + (1 << pinfo->x_chroma_shift) - 1) >> pinfo->x_chroma_shift;
- h2 = (height + (1 << pinfo->y_chroma_shift) - 1) >> pinfo->y_chroma_shift;
- size2 = w2 * h2;
- picture->data[0] = ptr;
- picture->data[1] = picture->data[0] + size;
- picture->data[2] = picture->data[1] + size2;
- picture->linesize[0] = width;
- picture->linesize[1] = w2;
- picture->linesize[2] = w2;
- return size + 2 * size2;
- case PIX_FMT_NV12:
- case PIX_FMT_NV21:
- w2 = (width + (1 << pinfo->x_chroma_shift) - 1) >> pinfo->x_chroma_shift;
- h2 = (height + (1 << pinfo->y_chroma_shift) - 1) >> pinfo->y_chroma_shift;
- size2 = w2 * h2 * 2;
- picture->data[0] = ptr;
- picture->data[1] = picture->data[0] + size;
- picture->data[2] = NULL;
- picture->linesize[0] = width;
- picture->linesize[1] = w2;
- picture->linesize[2] = 0;
- return size + 2 * size2;
- case PIX_FMT_RGB24:
- case PIX_FMT_BGR24:
- picture->data[0] = ptr;
- picture->data[1] = NULL;
- picture->data[2] = NULL;
- picture->linesize[0] = width * 3;
- return size * 3;
- case PIX_FMT_RGBA32:
- case PIX_FMT_BGR32:
- case PIX_FMT_RGB32_1:
- case PIX_FMT_BGR32_1:
- picture->data[0] = ptr;
- picture->data[1] = NULL;
- picture->data[2] = NULL;
- picture->linesize[0] = width * 4;
- return size * 4;
- case PIX_FMT_GRAY16BE:
- case PIX_FMT_GRAY16LE:
- case PIX_FMT_BGR555:
- case PIX_FMT_BGR565:
- case PIX_FMT_RGB555:
- case PIX_FMT_RGB565:
- case PIX_FMT_YUV422:
- picture->data[0] = ptr;
- picture->data[1] = NULL;
- picture->data[2] = NULL;
- picture->linesize[0] = width * 2;
- return size * 2;
- case PIX_FMT_UYVY422:
- picture->data[0] = ptr;
- picture->data[1] = NULL;
- picture->data[2] = NULL;
- picture->linesize[0] = width * 2;
- return size * 2;
- case PIX_FMT_UYVY411:
- picture->data[0] = ptr;
- picture->data[1] = NULL;
- picture->data[2] = NULL;
- picture->linesize[0] = width + width/2;
- return size + size/2;
- case PIX_FMT_RGB8:
- case PIX_FMT_BGR8:
- case PIX_FMT_RGB4_BYTE:
- case PIX_FMT_BGR4_BYTE:
- case PIX_FMT_GRAY8:
- picture->data[0] = ptr;
- picture->data[1] = NULL;
- picture->data[2] = NULL;
- picture->linesize[0] = width;
- return size;
- case PIX_FMT_RGB4:
- case PIX_FMT_BGR4:
- picture->data[0] = ptr;
- picture->data[1] = NULL;
- picture->data[2] = NULL;
- picture->linesize[0] = width / 2;
- return size / 2;
- case PIX_FMT_MONOWHITE:
- case PIX_FMT_MONOBLACK:
- picture->data[0] = ptr;
- picture->data[1] = NULL;
- picture->data[2] = NULL;
- picture->linesize[0] = (width + 7) >> 3;
- return picture->linesize[0] * height;
- case PIX_FMT_PAL8:
- size2 = (size + 3) & ~3;
- picture->data[0] = ptr;
- picture->data[1] = ptr + size2; /* palette is stored here as 256 32 bit words */
- picture->data[2] = NULL;
- picture->linesize[0] = width;
- picture->linesize[1] = 4;
- return size2 + 256 * 4;
- default:
-fail:
- picture->data[0] = NULL;
- picture->data[1] = NULL;
- picture->data[2] = NULL;
- picture->data[3] = NULL;
- return -1;
- }
-}
-
-int avpicture_layout(const AVPicture* src, int pix_fmt, int width, int height,
- unsigned char *dest, int dest_size)
-{
- const PixFmtInfo* pf = &pix_fmt_info[pix_fmt];
- int i, j, w, h, data_planes;
- const unsigned char* s;
- int size = avpicture_get_size(pix_fmt, width, height);
-
- if (size > dest_size || size < 0)
- return -1;
-
- if (pf->pixel_type == FF_PIXEL_PACKED || pf->pixel_type == FF_PIXEL_PALETTE) {
- if (pix_fmt == PIX_FMT_YUV422 ||
- pix_fmt == PIX_FMT_UYVY422 ||
- pix_fmt == PIX_FMT_BGR565 ||
- pix_fmt == PIX_FMT_BGR555 ||
- pix_fmt == PIX_FMT_RGB565 ||
- pix_fmt == PIX_FMT_RGB555)
- w = width * 2;
- else if (pix_fmt == PIX_FMT_UYVY411)
- w = width + width/2;
- else if (pix_fmt == PIX_FMT_PAL8)
- w = width;
- else
- w = width * (pf->depth * pf->nb_channels / 8);
-
- data_planes = 1;
- h = height;
- } else {
- data_planes = pf->nb_channels;
- w = (width*pf->depth + 7)/8;
- h = height;
- }
-
- for (i=0; i<data_planes; i++) {
- if (i == 1) {
- w = width >> pf->x_chroma_shift;
- h = height >> pf->y_chroma_shift;
- }
- s = src->data[i];
- for(j=0; j<h; j++) {
- memcpy(dest, s, w);
- dest += w;
- s += src->linesize[i];
- }
- }
-
- if (pf->pixel_type == FF_PIXEL_PALETTE)
- memcpy((unsigned char *)(((size_t)dest + 3) & ~3), src->data[1], 256 * 4);
-
- return size;
-}
-
-int avpicture_get_size(int pix_fmt, int width, int height)
-{
- AVPicture dummy_pict;
- return avpicture_fill(&dummy_pict, NULL, pix_fmt, width, height);
-}
-
-/**
- * compute the loss when converting from a pixel format to another
- */
-int avcodec_get_pix_fmt_loss(int dst_pix_fmt, int src_pix_fmt,
- int has_alpha)
-{
- const PixFmtInfo *pf, *ps;
- int loss;
-
- ps = &pix_fmt_info[src_pix_fmt];
- pf = &pix_fmt_info[dst_pix_fmt];
-
- /* compute loss */
- loss = 0;
- pf = &pix_fmt_info[dst_pix_fmt];
- if (pf->depth < ps->depth ||
- (dst_pix_fmt == PIX_FMT_RGB555 && src_pix_fmt == PIX_FMT_RGB565))
- loss |= FF_LOSS_DEPTH;
- if (pf->x_chroma_shift > ps->x_chroma_shift ||
- pf->y_chroma_shift > ps->y_chroma_shift)
- loss |= FF_LOSS_RESOLUTION;
- switch(pf->color_type) {
- case FF_COLOR_RGB:
- if (ps->color_type != FF_COLOR_RGB &&
- ps->color_type != FF_COLOR_GRAY)
- loss |= FF_LOSS_COLORSPACE;
- break;
- case FF_COLOR_GRAY:
- if (ps->color_type != FF_COLOR_GRAY)
- loss |= FF_LOSS_COLORSPACE;
- break;
- case FF_COLOR_YUV:
- if (ps->color_type != FF_COLOR_YUV)
- loss |= FF_LOSS_COLORSPACE;
- break;
- case FF_COLOR_YUV_JPEG:
- if (ps->color_type != FF_COLOR_YUV_JPEG &&
- ps->color_type != FF_COLOR_YUV &&
- ps->color_type != FF_COLOR_GRAY)
- loss |= FF_LOSS_COLORSPACE;
- break;
- default:
- /* fail safe test */
- if (ps->color_type != pf->color_type)
- loss |= FF_LOSS_COLORSPACE;
- break;
- }
- if (pf->color_type == FF_COLOR_GRAY &&
- ps->color_type != FF_COLOR_GRAY)
- loss |= FF_LOSS_CHROMA;
- if (!pf->is_alpha && (ps->is_alpha && has_alpha))
- loss |= FF_LOSS_ALPHA;
- if (pf->pixel_type == FF_PIXEL_PALETTE &&
- (ps->pixel_type != FF_PIXEL_PALETTE && ps->color_type != FF_COLOR_GRAY))
- loss |= FF_LOSS_COLORQUANT;
- return loss;
-}
-
-static int avg_bits_per_pixel(int pix_fmt)
-{
- int bits;
- const PixFmtInfo *pf;
-
- pf = &pix_fmt_info[pix_fmt];
- switch(pf->pixel_type) {
- case FF_PIXEL_PACKED:
- switch(pix_fmt) {
- case PIX_FMT_YUV422:
- case PIX_FMT_UYVY422:
- case PIX_FMT_RGB565:
- case PIX_FMT_RGB555:
- case PIX_FMT_BGR565:
- case PIX_FMT_BGR555:
- bits = 16;
- break;
- case PIX_FMT_UYVY411:
- bits = 12;
- break;
- default:
- bits = pf->depth * pf->nb_channels;
- break;
- }
- break;
- case FF_PIXEL_PLANAR:
- if (pf->x_chroma_shift == 0 && pf->y_chroma_shift == 0) {
- bits = pf->depth * pf->nb_channels;
- } else {
- bits = pf->depth + ((2 * pf->depth) >>
- (pf->x_chroma_shift + pf->y_chroma_shift));
- }
- break;
- case FF_PIXEL_PALETTE:
- bits = 8;
- break;
- default:
- bits = -1;
- break;
- }
- return bits;
-}
-
-static int avcodec_find_best_pix_fmt1(int pix_fmt_mask,
- int src_pix_fmt,
- int has_alpha,
- int loss_mask)
-{
- int dist, i, loss, min_dist, dst_pix_fmt;
-
- /* find exact color match with smallest size */
- dst_pix_fmt = -1;
- min_dist = 0x7fffffff;
- for(i = 0;i < PIX_FMT_NB; i++) {
- if (pix_fmt_mask & (1 << i)) {
- loss = avcodec_get_pix_fmt_loss(i, src_pix_fmt, has_alpha) & loss_mask;
- if (loss == 0) {
- dist = avg_bits_per_pixel(i);
- if (dist < min_dist) {
- min_dist = dist;
- dst_pix_fmt = i;
- }
- }
- }
- }
- return dst_pix_fmt;
-}
-
-/**
- * find best pixel format to convert to. Return -1 if none found
- */
-int avcodec_find_best_pix_fmt(int pix_fmt_mask, int src_pix_fmt,
- int has_alpha, int *loss_ptr)
-{
- int dst_pix_fmt, loss_mask, i;
- static const int loss_mask_order[] = {
- ~0, /* no loss first */
- ~FF_LOSS_ALPHA,
- ~FF_LOSS_RESOLUTION,
- ~(FF_LOSS_COLORSPACE | FF_LOSS_RESOLUTION),
- ~FF_LOSS_COLORQUANT,
- ~FF_LOSS_DEPTH,
- 0,
- };
-
- /* try with successive loss */
- i = 0;
- for(;;) {
- loss_mask = loss_mask_order[i++];
- dst_pix_fmt = avcodec_find_best_pix_fmt1(pix_fmt_mask, src_pix_fmt,
- has_alpha, loss_mask);
- if (dst_pix_fmt >= 0)
- goto found;
- if (loss_mask == 0)
- break;
- }
- return -1;
- found:
- if (loss_ptr)
- *loss_ptr = avcodec_get_pix_fmt_loss(dst_pix_fmt, src_pix_fmt, has_alpha);
- return dst_pix_fmt;
-}
-
-void ff_img_copy_plane(uint8_t *dst, int dst_wrap,
- const uint8_t *src, int src_wrap,
- int width, int height)
-{
- if((!dst) || (!src))
- return;
- for(;height > 0; height--) {
- memcpy(dst, src, width);
- dst += dst_wrap;
- src += src_wrap;
- }
-}
-
-/**
- * Copy image 'src' to 'dst'.
- */
-void img_copy(AVPicture *dst, const AVPicture *src,
- int pix_fmt, int width, int height)
-{
- int bwidth, bits, i;
- const PixFmtInfo *pf = &pix_fmt_info[pix_fmt];
-
- pf = &pix_fmt_info[pix_fmt];
- switch(pf->pixel_type) {
- case FF_PIXEL_PACKED:
- switch(pix_fmt) {
- case PIX_FMT_YUV422:
- case PIX_FMT_UYVY422:
- case PIX_FMT_RGB565:
- case PIX_FMT_RGB555:
- case PIX_FMT_BGR565:
- case PIX_FMT_BGR555:
- bits = 16;
- break;
- case PIX_FMT_UYVY411:
- bits = 12;
- break;
- default:
- bits = pf->depth * pf->nb_channels;
- break;
- }
- bwidth = (width * bits + 7) >> 3;
- ff_img_copy_plane(dst->data[0], dst->linesize[0],
- src->data[0], src->linesize[0],
- bwidth, height);
- break;
- case FF_PIXEL_PLANAR:
- for(i = 0; i < pf->nb_channels; i++) {
- int w, h;
- w = width;
- h = height;
- if (i == 1 || i == 2) {
- w >>= pf->x_chroma_shift;
- h >>= pf->y_chroma_shift;
- }
- bwidth = (w * pf->depth + 7) >> 3;
- ff_img_copy_plane(dst->data[i], dst->linesize[i],
- src->data[i], src->linesize[i],
- bwidth, h);
- }
- break;
- case FF_PIXEL_PALETTE:
- ff_img_copy_plane(dst->data[0], dst->linesize[0],
- src->data[0], src->linesize[0],
- width, height);
- /* copy the palette */
- ff_img_copy_plane(dst->data[1], dst->linesize[1],
- src->data[1], src->linesize[1],
- 4, 256);
- break;
- }
-}
-
-/* XXX: totally non optimized */
-
-static void yuv422_to_yuv420p(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- const uint8_t *p, *p1;
- uint8_t *lum, *cr, *cb, *lum1, *cr1, *cb1;
- int w;
-
- p1 = src->data[0];
- lum1 = dst->data[0];
- cb1 = dst->data[1];
- cr1 = dst->data[2];
-
- for(;height >= 1; height -= 2) {
- p = p1;
- lum = lum1;
- cb = cb1;
- cr = cr1;
- for(w = width; w >= 2; w -= 2) {
- lum[0] = p[0];
- cb[0] = p[1];
- lum[1] = p[2];
- cr[0] = p[3];
- p += 4;
- lum += 2;
- cb++;
- cr++;
- }
- if (w) {
- lum[0] = p[0];
- cb[0] = p[1];
- cr[0] = p[3];
- cb++;
- cr++;
- }
- p1 += src->linesize[0];
- lum1 += dst->linesize[0];
- if (height>1) {
- p = p1;
- lum = lum1;
- for(w = width; w >= 2; w -= 2) {
- lum[0] = p[0];
- lum[1] = p[2];
- p += 4;
- lum += 2;
- }
- if (w) {
- lum[0] = p[0];
- }
- p1 += src->linesize[0];
- lum1 += dst->linesize[0];
- }
- cb1 += dst->linesize[1];
- cr1 += dst->linesize[2];
- }
-}
-
-static void uyvy422_to_yuv420p(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- const uint8_t *p, *p1;
- uint8_t *lum, *cr, *cb, *lum1, *cr1, *cb1;
- int w;
-
- p1 = src->data[0];
-
- lum1 = dst->data[0];
- cb1 = dst->data[1];
- cr1 = dst->data[2];
-
- for(;height >= 1; height -= 2) {
- p = p1;
- lum = lum1;
- cb = cb1;
- cr = cr1;
- for(w = width; w >= 2; w -= 2) {
- lum[0] = p[1];
- cb[0] = p[0];
- lum[1] = p[3];
- cr[0] = p[2];
- p += 4;
- lum += 2;
- cb++;
- cr++;
- }
- if (w) {
- lum[0] = p[1];
- cb[0] = p[0];
- cr[0] = p[2];
- cb++;
- cr++;
- }
- p1 += src->linesize[0];
- lum1 += dst->linesize[0];
- if (height>1) {
- p = p1;
- lum = lum1;
- for(w = width; w >= 2; w -= 2) {
- lum[0] = p[1];
- lum[1] = p[3];
- p += 4;
- lum += 2;
- }
- if (w) {
- lum[0] = p[1];
- }
- p1 += src->linesize[0];
- lum1 += dst->linesize[0];
- }
- cb1 += dst->linesize[1];
- cr1 += dst->linesize[2];
- }
-}
-
-
-static void uyvy422_to_yuv422p(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- const uint8_t *p, *p1;
- uint8_t *lum, *cr, *cb, *lum1, *cr1, *cb1;
- int w;
-
- p1 = src->data[0];
- lum1 = dst->data[0];
- cb1 = dst->data[1];
- cr1 = dst->data[2];
- for(;height > 0; height--) {
- p = p1;
- lum = lum1;
- cb = cb1;
- cr = cr1;
- for(w = width; w >= 2; w -= 2) {
- lum[0] = p[1];
- cb[0] = p[0];
- lum[1] = p[3];
- cr[0] = p[2];
- p += 4;
- lum += 2;
- cb++;
- cr++;
- }
- p1 += src->linesize[0];
- lum1 += dst->linesize[0];
- cb1 += dst->linesize[1];
- cr1 += dst->linesize[2];
- }
-}
-
-
-static void yuv422_to_yuv422p(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- const uint8_t *p, *p1;
- uint8_t *lum, *cr, *cb, *lum1, *cr1, *cb1;
- int w;
-
- p1 = src->data[0];
- lum1 = dst->data[0];
- cb1 = dst->data[1];
- cr1 = dst->data[2];
- for(;height > 0; height--) {
- p = p1;
- lum = lum1;
- cb = cb1;
- cr = cr1;
- for(w = width; w >= 2; w -= 2) {
- lum[0] = p[0];
- cb[0] = p[1];
- lum[1] = p[2];
- cr[0] = p[3];
- p += 4;
- lum += 2;
- cb++;
- cr++;
- }
- p1 += src->linesize[0];
- lum1 += dst->linesize[0];
- cb1 += dst->linesize[1];
- cr1 += dst->linesize[2];
- }
-}
-
-static void yuv422p_to_yuv422(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- uint8_t *p, *p1;
- const uint8_t *lum, *cr, *cb, *lum1, *cr1, *cb1;
- int w;
-
- p1 = dst->data[0];
- lum1 = src->data[0];
- cb1 = src->data[1];
- cr1 = src->data[2];
- for(;height > 0; height--) {
- p = p1;
- lum = lum1;
- cb = cb1;
- cr = cr1;
- for(w = width; w >= 2; w -= 2) {
- p[0] = lum[0];
- p[1] = cb[0];
- p[2] = lum[1];
- p[3] = cr[0];
- p += 4;
- lum += 2;
- cb++;
- cr++;
- }
- p1 += dst->linesize[0];
- lum1 += src->linesize[0];
- cb1 += src->linesize[1];
- cr1 += src->linesize[2];
- }
-}
-
-static void yuv422p_to_uyvy422(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- uint8_t *p, *p1;
- const uint8_t *lum, *cr, *cb, *lum1, *cr1, *cb1;
- int w;
-
- p1 = dst->data[0];
- lum1 = src->data[0];
- cb1 = src->data[1];
- cr1 = src->data[2];
- for(;height > 0; height--) {
- p = p1;
- lum = lum1;
- cb = cb1;
- cr = cr1;
- for(w = width; w >= 2; w -= 2) {
- p[1] = lum[0];
- p[0] = cb[0];
- p[3] = lum[1];
- p[2] = cr[0];
- p += 4;
- lum += 2;
- cb++;
- cr++;
- }
- p1 += dst->linesize[0];
- lum1 += src->linesize[0];
- cb1 += src->linesize[1];
- cr1 += src->linesize[2];
- }
-}
-
-static void uyvy411_to_yuv411p(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- const uint8_t *p, *p1;
- uint8_t *lum, *cr, *cb, *lum1, *cr1, *cb1;
- int w;
-
- p1 = src->data[0];
- lum1 = dst->data[0];
- cb1 = dst->data[1];
- cr1 = dst->data[2];
- for(;height > 0; height--) {
- p = p1;
- lum = lum1;
- cb = cb1;
- cr = cr1;
- for(w = width; w >= 4; w -= 4) {
- cb[0] = p[0];
- lum[0] = p[1];
- lum[1] = p[2];
- cr[0] = p[3];
- lum[2] = p[4];
- lum[3] = p[5];
- p += 6;
- lum += 4;
- cb++;
- cr++;
- }
- p1 += src->linesize[0];
- lum1 += dst->linesize[0];
- cb1 += dst->linesize[1];
- cr1 += dst->linesize[2];
- }
-}
-
-
-static void yuv420p_to_yuv422(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- int w, h;
- uint8_t *line1, *line2, *linesrc = dst->data[0];
- uint8_t *lum1, *lum2, *lumsrc = src->data[0];
- uint8_t *cb1, *cb2 = src->data[1];
- uint8_t *cr1, *cr2 = src->data[2];
-
- for(h = height / 2; h--;) {
- line1 = linesrc;
- line2 = linesrc + dst->linesize[0];
-
- lum1 = lumsrc;
- lum2 = lumsrc + src->linesize[0];
-
- cb1 = cb2;
- cr1 = cr2;
-
- for(w = width / 2; w--;) {
- *line1++ = *lum1++; *line2++ = *lum2++;
- *line1++ = *line2++ = *cb1++;
- *line1++ = *lum1++; *line2++ = *lum2++;
- *line1++ = *line2++ = *cr1++;
- }
-
- linesrc += dst->linesize[0] * 2;
- lumsrc += src->linesize[0] * 2;
- cb2 += src->linesize[1];
- cr2 += src->linesize[2];
- }
-}
-
-static void yuv420p_to_uyvy422(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- int w, h;
- uint8_t *line1, *line2, *linesrc = dst->data[0];
- uint8_t *lum1, *lum2, *lumsrc = src->data[0];
- uint8_t *cb1, *cb2 = src->data[1];
- uint8_t *cr1, *cr2 = src->data[2];
-
- for(h = height / 2; h--;) {
- line1 = linesrc;
- line2 = linesrc + dst->linesize[0];
-
- lum1 = lumsrc;
- lum2 = lumsrc + src->linesize[0];
-
- cb1 = cb2;
- cr1 = cr2;
-
- for(w = width / 2; w--;) {
- *line1++ = *line2++ = *cb1++;
- *line1++ = *lum1++; *line2++ = *lum2++;
- *line1++ = *line2++ = *cr1++;
- *line1++ = *lum1++; *line2++ = *lum2++;
- }
-
- linesrc += dst->linesize[0] * 2;
- lumsrc += src->linesize[0] * 2;
- cb2 += src->linesize[1];
- cr2 += src->linesize[2];
- }
-}
-
-#define SCALEBITS 10
-#define ONE_HALF (1 << (SCALEBITS - 1))
-#define FIX(x) ((int) ((x) * (1<<SCALEBITS) + 0.5))
-
-#define YUV_TO_RGB1_CCIR(cb1, cr1)\
-{\
- cb = (cb1) - 128;\
- cr = (cr1) - 128;\
- r_add = FIX(1.40200*255.0/224.0) * cr + ONE_HALF;\
- g_add = - FIX(0.34414*255.0/224.0) * cb - FIX(0.71414*255.0/224.0) * cr + \
- ONE_HALF;\
- b_add = FIX(1.77200*255.0/224.0) * cb + ONE_HALF;\
-}
-
-#define YUV_TO_RGB2_CCIR(r, g, b, y1)\
-{\
- y = ((y1) - 16) * FIX(255.0/219.0);\
- r = cm[(y + r_add) >> SCALEBITS];\
- g = cm[(y + g_add) >> SCALEBITS];\
- b = cm[(y + b_add) >> SCALEBITS];\
-}
-
-#define YUV_TO_RGB1(cb1, cr1)\
-{\
- cb = (cb1) - 128;\
- cr = (cr1) - 128;\
- r_add = FIX(1.40200) * cr + ONE_HALF;\
- g_add = - FIX(0.34414) * cb - FIX(0.71414) * cr + ONE_HALF;\
- b_add = FIX(1.77200) * cb + ONE_HALF;\
-}
-
-#define YUV_TO_RGB2(r, g, b, y1)\
-{\
- y = (y1) << SCALEBITS;\
- r = cm[(y + r_add) >> SCALEBITS];\
- g = cm[(y + g_add) >> SCALEBITS];\
- b = cm[(y + b_add) >> SCALEBITS];\
-}
-
-#define Y_CCIR_TO_JPEG(y)\
- cm[((y) * FIX(255.0/219.0) + (ONE_HALF - 16 * FIX(255.0/219.0))) >> SCALEBITS]
-
-#define Y_JPEG_TO_CCIR(y)\
- (((y) * FIX(219.0/255.0) + (ONE_HALF + (16 << SCALEBITS))) >> SCALEBITS)
-
-#define C_CCIR_TO_JPEG(y)\
- cm[(((y) - 128) * FIX(127.0/112.0) + (ONE_HALF + (128 << SCALEBITS))) >> SCALEBITS]
-
-/* NOTE: the clamp is really necessary! */
-static inline int C_JPEG_TO_CCIR(int y) {
- y = (((y - 128) * FIX(112.0/127.0) + (ONE_HALF + (128 << SCALEBITS))) >> SCALEBITS);
- if (y < 16)
- y = 16;
- return y;
-}
-
-
-#define RGB_TO_Y(r, g, b) \
-((FIX(0.29900) * (r) + FIX(0.58700) * (g) + \
- FIX(0.11400) * (b) + ONE_HALF) >> SCALEBITS)
-
-#define RGB_TO_U(r1, g1, b1, shift)\
-(((- FIX(0.16874) * r1 - FIX(0.33126) * g1 + \
- FIX(0.50000) * b1 + (ONE_HALF << shift) - 1) >> (SCALEBITS + shift)) + 128)
-
-#define RGB_TO_V(r1, g1, b1, shift)\
-(((FIX(0.50000) * r1 - FIX(0.41869) * g1 - \
- FIX(0.08131) * b1 + (ONE_HALF << shift) - 1) >> (SCALEBITS + shift)) + 128)
-
-#define RGB_TO_Y_CCIR(r, g, b) \
-((FIX(0.29900*219.0/255.0) * (r) + FIX(0.58700*219.0/255.0) * (g) + \
- FIX(0.11400*219.0/255.0) * (b) + (ONE_HALF + (16 << SCALEBITS))) >> SCALEBITS)
-
-#define RGB_TO_U_CCIR(r1, g1, b1, shift)\
-(((- FIX(0.16874*224.0/255.0) * r1 - FIX(0.33126*224.0/255.0) * g1 + \
- FIX(0.50000*224.0/255.0) * b1 + (ONE_HALF << shift) - 1) >> (SCALEBITS + shift)) + 128)
-
-#define RGB_TO_V_CCIR(r1, g1, b1, shift)\
-(((FIX(0.50000*224.0/255.0) * r1 - FIX(0.41869*224.0/255.0) * g1 - \
- FIX(0.08131*224.0/255.0) * b1 + (ONE_HALF << shift) - 1) >> (SCALEBITS + shift)) + 128)
-
-static uint8_t y_ccir_to_jpeg[256];
-static uint8_t y_jpeg_to_ccir[256];
-static uint8_t c_ccir_to_jpeg[256];
-static uint8_t c_jpeg_to_ccir[256];
-
-/* init various conversion tables */
-static void img_convert_init(void)
-{
- int i;
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-
- for(i = 0;i < 256; i++) {
- y_ccir_to_jpeg[i] = Y_CCIR_TO_JPEG(i);
- y_jpeg_to_ccir[i] = Y_JPEG_TO_CCIR(i);
- c_ccir_to_jpeg[i] = C_CCIR_TO_JPEG(i);
- c_jpeg_to_ccir[i] = C_JPEG_TO_CCIR(i);
- }
-}
-
-/* apply to each pixel the given table */
-static void img_apply_table(uint8_t *dst, int dst_wrap,
- const uint8_t *src, int src_wrap,
- int width, int height, const uint8_t *table1)
-{
- int n;
- const uint8_t *s;
- uint8_t *d;
- const uint8_t *table;
-
- table = table1;
- for(;height > 0; height--) {
- s = src;
- d = dst;
- n = width;
- while (n >= 4) {
- d[0] = table[s[0]];
- d[1] = table[s[1]];
- d[2] = table[s[2]];
- d[3] = table[s[3]];
- d += 4;
- s += 4;
- n -= 4;
- }
- while (n > 0) {
- d[0] = table[s[0]];
- d++;
- s++;
- n--;
- }
- dst += dst_wrap;
- src += src_wrap;
- }
-}
-
-/* XXX: use generic filter ? */
-/* XXX: in most cases, the sampling position is incorrect */
-
-/* 4x1 -> 1x1 */
-static void shrink41(uint8_t *dst, int dst_wrap,
- const uint8_t *src, int src_wrap,
- int width, int height)
-{
- int w;
- const uint8_t *s;
- uint8_t *d;
-
- for(;height > 0; height--) {
- s = src;
- d = dst;
- for(w = width;w > 0; w--) {
- d[0] = (s[0] + s[1] + s[2] + s[3] + 2) >> 2;
- s += 4;
- d++;
- }
- src += src_wrap;
- dst += dst_wrap;
- }
-}
-
-/* 2x1 -> 1x1 */
-static void shrink21(uint8_t *dst, int dst_wrap,
- const uint8_t *src, int src_wrap,
- int width, int height)
-{
- int w;
- const uint8_t *s;
- uint8_t *d;
-
- for(;height > 0; height--) {
- s = src;
- d = dst;
- for(w = width;w > 0; w--) {
- d[0] = (s[0] + s[1]) >> 1;
- s += 2;
- d++;
- }
- src += src_wrap;
- dst += dst_wrap;
- }
-}
-
-/* 1x2 -> 1x1 */
-static void shrink12(uint8_t *dst, int dst_wrap,
- const uint8_t *src, int src_wrap,
- int width, int height)
-{
- int w;
- uint8_t *d;
- const uint8_t *s1, *s2;
-
- for(;height > 0; height--) {
- s1 = src;
- s2 = s1 + src_wrap;
- d = dst;
- for(w = width;w >= 4; w-=4) {
- d[0] = (s1[0] + s2[0]) >> 1;
- d[1] = (s1[1] + s2[1]) >> 1;
- d[2] = (s1[2] + s2[2]) >> 1;
- d[3] = (s1[3] + s2[3]) >> 1;
- s1 += 4;
- s2 += 4;
- d += 4;
- }
- for(;w > 0; w--) {
- d[0] = (s1[0] + s2[0]) >> 1;
- s1++;
- s2++;
- d++;
- }
- src += 2 * src_wrap;
- dst += dst_wrap;
- }
-}
-
-/* 2x2 -> 1x1 */
-void ff_shrink22(uint8_t *dst, int dst_wrap,
- const uint8_t *src, int src_wrap,
- int width, int height)
-{
- int w;
- const uint8_t *s1, *s2;
- uint8_t *d;
-
- for(;height > 0; height--) {
- s1 = src;
- s2 = s1 + src_wrap;
- d = dst;
- for(w = width;w >= 4; w-=4) {
- d[0] = (s1[0] + s1[1] + s2[0] + s2[1] + 2) >> 2;
- d[1] = (s1[2] + s1[3] + s2[2] + s2[3] + 2) >> 2;
- d[2] = (s1[4] + s1[5] + s2[4] + s2[5] + 2) >> 2;
- d[3] = (s1[6] + s1[7] + s2[6] + s2[7] + 2) >> 2;
- s1 += 8;
- s2 += 8;
- d += 4;
- }
- for(;w > 0; w--) {
- d[0] = (s1[0] + s1[1] + s2[0] + s2[1] + 2) >> 2;
- s1 += 2;
- s2 += 2;
- d++;
- }
- src += 2 * src_wrap;
- dst += dst_wrap;
- }
-}
-
-/* 4x4 -> 1x1 */
-void ff_shrink44(uint8_t *dst, int dst_wrap,
- const uint8_t *src, int src_wrap,
- int width, int height)
-{
- int w;
- const uint8_t *s1, *s2, *s3, *s4;
- uint8_t *d;
-
- for(;height > 0; height--) {
- s1 = src;
- s2 = s1 + src_wrap;
- s3 = s2 + src_wrap;
- s4 = s3 + src_wrap;
- d = dst;
- for(w = width;w > 0; w--) {
- d[0] = (s1[0] + s1[1] + s1[2] + s1[3] +
- s2[0] + s2[1] + s2[2] + s2[3] +
- s3[0] + s3[1] + s3[2] + s3[3] +
- s4[0] + s4[1] + s4[2] + s4[3] + 8) >> 4;
- s1 += 4;
- s2 += 4;
- s3 += 4;
- s4 += 4;
- d++;
- }
- src += 4 * src_wrap;
- dst += dst_wrap;
- }
-}
-
-/* 8x8 -> 1x1 */
-void ff_shrink88(uint8_t *dst, int dst_wrap,
- const uint8_t *src, int src_wrap,
- int width, int height)
-{
- int w, i;
-
- for(;height > 0; height--) {
- for(w = width;w > 0; w--) {
- int tmp=0;
- for(i=0; i<8; i++){
- tmp += src[0] + src[1] + src[2] + src[3] + src[4] + src[5] + src[6] + src[7];
- src += src_wrap;
- }
- *(dst++) = (tmp + 32)>>6;
- src += 8 - 8*src_wrap;
- }
- src += 8*src_wrap - 8*width;
- dst += dst_wrap - width;
- }
-}
-
-static void grow21_line(uint8_t *dst, const uint8_t *src,
- int width)
-{
- int w;
- const uint8_t *s1;
- uint8_t *d;
-
- s1 = src;
- d = dst;
- for(w = width;w >= 4; w-=4) {
- d[1] = d[0] = s1[0];
- d[3] = d[2] = s1[1];
- s1 += 2;
- d += 4;
- }
- for(;w >= 2; w -= 2) {
- d[1] = d[0] = s1[0];
- s1 ++;
- d += 2;
- }
- /* only needed if width is not a multiple of two */
- /* XXX: veryfy that */
- if (w) {
- d[0] = s1[0];
- }
-}
-
-static void grow41_line(uint8_t *dst, const uint8_t *src,
- int width)
-{
- int w, v;
- const uint8_t *s1;
- uint8_t *d;
-
- s1 = src;
- d = dst;
- for(w = width;w >= 4; w-=4) {
- v = s1[0];
- d[0] = v;
- d[1] = v;
- d[2] = v;
- d[3] = v;
- s1 ++;
- d += 4;
- }
-}
-
-/* 1x1 -> 2x1 */
-static void grow21(uint8_t *dst, int dst_wrap,
- const uint8_t *src, int src_wrap,
- int width, int height)
-{
- for(;height > 0; height--) {
- grow21_line(dst, src, width);
- src += src_wrap;
- dst += dst_wrap;
- }
-}
-
-/* 1x1 -> 2x2 */
-static void grow22(uint8_t *dst, int dst_wrap,
- const uint8_t *src, int src_wrap,
- int width, int height)
-{
- for(;height > 0; height--) {
- grow21_line(dst, src, width);
- if (height%2)
- src += src_wrap;
- dst += dst_wrap;
- }
-}
-
-/* 1x1 -> 4x1 */
-static void grow41(uint8_t *dst, int dst_wrap,
- const uint8_t *src, int src_wrap,
- int width, int height)
-{
- for(;height > 0; height--) {
- grow41_line(dst, src, width);
- src += src_wrap;
- dst += dst_wrap;
- }
-}
-
-/* 1x1 -> 4x4 */
-static void grow44(uint8_t *dst, int dst_wrap,
- const uint8_t *src, int src_wrap,
- int width, int height)
-{
- for(;height > 0; height--) {
- grow41_line(dst, src, width);
- if ((height & 3) == 1)
- src += src_wrap;
- dst += dst_wrap;
- }
-}
-
-/* 1x2 -> 2x1 */
-static void conv411(uint8_t *dst, int dst_wrap,
- const uint8_t *src, int src_wrap,
- int width, int height)
-{
- int w, c;
- const uint8_t *s1, *s2;
- uint8_t *d;
-
- width>>=1;
-
- for(;height > 0; height--) {
- s1 = src;
- s2 = src + src_wrap;
- d = dst;
- for(w = width;w > 0; w--) {
- c = (s1[0] + s2[0]) >> 1;
- d[0] = c;
- d[1] = c;
- s1++;
- s2++;
- d += 2;
- }
- src += src_wrap * 2;
- dst += dst_wrap;
- }
-}
-
-/* XXX: add jpeg quantize code */
-
-#define TRANSP_INDEX (6*6*6)
-
-/* this is maybe slow, but allows for extensions */
-static inline unsigned char gif_clut_index(uint8_t r, uint8_t g, uint8_t b)
-{
- return ((((r)/47)%6)*6*6+(((g)/47)%6)*6+(((b)/47)%6));
-}
-
-static void build_rgb_palette(uint8_t *palette, int has_alpha)
-{
- uint32_t *pal;
- static const uint8_t pal_value[6] = { 0x00, 0x33, 0x66, 0x99, 0xcc, 0xff };
- int i, r, g, b;
-
- pal = (uint32_t *)palette;
- i = 0;
- for(r = 0; r < 6; r++) {
- for(g = 0; g < 6; g++) {
- for(b = 0; b < 6; b++) {
- pal[i++] = (0xff << 24) | (pal_value[r] << 16) |
- (pal_value[g] << 8) | pal_value[b];
- }
- }
- }
- if (has_alpha)
- pal[i++] = 0;
- while (i < 256)
- pal[i++] = 0xff000000;
-}
-
-/* copy bit n to bits 0 ... n - 1 */
-static inline unsigned int bitcopy_n(unsigned int a, int n)
-{
- int mask;
- mask = (1 << n) - 1;
- return (a & (0xff & ~mask)) | ((-((a >> n) & 1)) & mask);
-}
-
-/* rgb555 handling */
-
-#define RGB_NAME rgb555
-
-#define RGB_IN(r, g, b, s)\
-{\
- unsigned int v = ((const uint16_t *)(s))[0];\
- r = bitcopy_n(v >> (10 - 3), 3);\
- g = bitcopy_n(v >> (5 - 3), 3);\
- b = bitcopy_n(v << 3, 3);\
-}
-
-
-#define RGB_OUT(d, r, g, b)\
-{\
- ((uint16_t *)(d))[0] = ((r >> 3) << 10) | ((g >> 3) << 5) | (b >> 3);\
-}
-
-#define BPP 2
-
-#include "imgconvert_template.h"
-
-/* rgb565 handling */
-
-#define RGB_NAME rgb565
-
-#define RGB_IN(r, g, b, s)\
-{\
- unsigned int v = ((const uint16_t *)(s))[0];\
- r = bitcopy_n(v >> (11 - 3), 3);\
- g = bitcopy_n(v >> (5 - 2), 2);\
- b = bitcopy_n(v << 3, 3);\
-}
-
-#define RGB_OUT(d, r, g, b)\
-{\
- ((uint16_t *)(d))[0] = ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3);\
-}
-
-#define BPP 2
-
-#include "imgconvert_template.h"
-
-/* bgr24 handling */
-
-#define RGB_NAME bgr24
-
-#define RGB_IN(r, g, b, s)\
-{\
- b = (s)[0];\
- g = (s)[1];\
- r = (s)[2];\
-}
-
-#define RGB_OUT(d, r, g, b)\
-{\
- (d)[0] = b;\
- (d)[1] = g;\
- (d)[2] = r;\
-}
-
-#define BPP 3
-
-#include "imgconvert_template.h"
-
-#undef RGB_IN
-#undef RGB_OUT
-#undef BPP
-
-/* rgb24 handling */
-
-#define RGB_NAME rgb24
-#define FMT_RGB24
-
-#define RGB_IN(r, g, b, s)\
-{\
- r = (s)[0];\
- g = (s)[1];\
- b = (s)[2];\
-}
-
-#define RGB_OUT(d, r, g, b)\
-{\
- (d)[0] = r;\
- (d)[1] = g;\
- (d)[2] = b;\
-}
-
-#define BPP 3
-
-#include "imgconvert_template.h"
-
-/* rgba32 handling */
-
-#define RGB_NAME rgba32
-#define FMT_RGBA32
-
-#define RGB_IN(r, g, b, s)\
-{\
- unsigned int v = ((const uint32_t *)(s))[0];\
- r = (v >> 16) & 0xff;\
- g = (v >> 8) & 0xff;\
- b = v & 0xff;\
-}
-
-#define RGBA_IN(r, g, b, a, s)\
-{\
- unsigned int v = ((const uint32_t *)(s))[0];\
- a = (v >> 24) & 0xff;\
- r = (v >> 16) & 0xff;\
- g = (v >> 8) & 0xff;\
- b = v & 0xff;\
-}
-
-#define RGBA_OUT(d, r, g, b, a)\
-{\
- ((uint32_t *)(d))[0] = (a << 24) | (r << 16) | (g << 8) | b;\
-}
-
-#define BPP 4
-
-#include "imgconvert_template.h"
-
-static void mono_to_gray(AVPicture *dst, const AVPicture *src,
- int width, int height, int xor_mask)
-{
- const unsigned char *p;
- unsigned char *q;
- int v, dst_wrap, src_wrap;
- int y, w;
-
- p = src->data[0];
- src_wrap = src->linesize[0] - ((width + 7) >> 3);
-
- q = dst->data[0];
- dst_wrap = dst->linesize[0] - width;
- for(y=0;y<height;y++) {
- w = width;
- while (w >= 8) {
- v = *p++ ^ xor_mask;
- q[0] = -(v >> 7);
- q[1] = -((v >> 6) & 1);
- q[2] = -((v >> 5) & 1);
- q[3] = -((v >> 4) & 1);
- q[4] = -((v >> 3) & 1);
- q[5] = -((v >> 2) & 1);
- q[6] = -((v >> 1) & 1);
- q[7] = -((v >> 0) & 1);
- w -= 8;
- q += 8;
- }
- if (w > 0) {
- v = *p++ ^ xor_mask;
- do {
- q[0] = -((v >> 7) & 1);
- q++;
- v <<= 1;
- } while (--w);
- }
- p += src_wrap;
- q += dst_wrap;
- }
-}
-
-static void monowhite_to_gray(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- mono_to_gray(dst, src, width, height, 0xff);
-}
-
-static void monoblack_to_gray(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- mono_to_gray(dst, src, width, height, 0x00);
-}
-
-static void gray_to_mono(AVPicture *dst, const AVPicture *src,
- int width, int height, int xor_mask)
-{
- int n;
- const uint8_t *s;
- uint8_t *d;
- int j, b, v, n1, src_wrap, dst_wrap, y;
-
- s = src->data[0];
- src_wrap = src->linesize[0] - width;
-
- d = dst->data[0];
- dst_wrap = dst->linesize[0] - ((width + 7) >> 3);
-
- for(y=0;y<height;y++) {
- n = width;
- while (n >= 8) {
- v = 0;
- for(j=0;j<8;j++) {
- b = s[0];
- s++;
- v = (v << 1) | (b >> 7);
- }
- d[0] = v ^ xor_mask;
- d++;
- n -= 8;
- }
- if (n > 0) {
- n1 = n;
- v = 0;
- while (n > 0) {
- b = s[0];
- s++;
- v = (v << 1) | (b >> 7);
- n--;
- }
- d[0] = (v << (8 - (n1 & 7))) ^ xor_mask;
- d++;
- }
- s += src_wrap;
- d += dst_wrap;
- }
-}
-
-static void gray_to_monowhite(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- gray_to_mono(dst, src, width, height, 0xff);
-}
-
-static void gray_to_monoblack(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- gray_to_mono(dst, src, width, height, 0x00);
-}
-
-static void gray_to_gray16(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- int x, y, src_wrap, dst_wrap;
- uint8_t *s, *d;
- s = src->data[0];
- src_wrap = src->linesize[0] - width;
- d = dst->data[0];
- dst_wrap = dst->linesize[0] - width * 2;
- for(y=0; y<height; y++){
- for(x=0; x<width; x++){
- *d++ = *s;
- *d++ = *s++;
- }
- s += src_wrap;
- d += dst_wrap;
- }
-}
-
-static void gray16_to_gray(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- int x, y, src_wrap, dst_wrap;
- uint8_t *s, *d;
- s = src->data[0];
- src_wrap = src->linesize[0] - width * 2;
- d = dst->data[0];
- dst_wrap = dst->linesize[0] - width;
- for(y=0; y<height; y++){
- for(x=0; x<width; x++){
- *d++ = *s;
- s += 2;
- }
- s += src_wrap;
- d += dst_wrap;
- }
-}
-
-static void gray16be_to_gray(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- gray16_to_gray(dst, src, width, height);
-}
-
-static void gray16le_to_gray(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- gray16_to_gray(dst, src + 1, width, height);
-}
-
-static void gray16_to_gray16(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- int x, y, src_wrap, dst_wrap;
- uint16_t *s, *d;
- s = src->data[0];
- src_wrap = (src->linesize[0] - width * 2)/2;
- d = dst->data[0];
- dst_wrap = (dst->linesize[0] - width * 2)/2;
- for(y=0; y<height; y++){
- for(x=0; x<width; x++){
- *d++ = bswap_16(*s++);
- }
- s += src_wrap;
- d += dst_wrap;
- }
-}
-
-
-typedef struct ConvertEntry {
- void (*convert)(AVPicture *dst,
- const AVPicture *src, int width, int height);
-} ConvertEntry;
-
-/* Add each new convertion function in this table. In order to be able
- to convert from any format to any format, the following constraints
- must be satisfied:
-
- - all FF_COLOR_RGB formats must convert to and from PIX_FMT_RGB24
-
- - all FF_COLOR_GRAY formats must convert to and from PIX_FMT_GRAY8
-
- - all FF_COLOR_RGB formats with alpha must convert to and from PIX_FMT_RGBA32
-
- - PIX_FMT_YUV444P and PIX_FMT_YUVJ444P must convert to and from
- PIX_FMT_RGB24.
-
- - PIX_FMT_422 must convert to and from PIX_FMT_422P.
-
- The other conversion functions are just optimisations for common cases.
-*/
-static const ConvertEntry convert_table[PIX_FMT_NB][PIX_FMT_NB] = {
- [PIX_FMT_YUV420P] = {
- [PIX_FMT_YUV422] = {
- .convert = yuv420p_to_yuv422,
- },
- [PIX_FMT_RGB555] = {
- .convert = yuv420p_to_rgb555
- },
- [PIX_FMT_RGB565] = {
- .convert = yuv420p_to_rgb565
- },
- [PIX_FMT_BGR24] = {
- .convert = yuv420p_to_bgr24
- },
- [PIX_FMT_RGB24] = {
- .convert = yuv420p_to_rgb24
- },
- [PIX_FMT_RGBA32] = {
- .convert = yuv420p_to_rgba32
- },
- [PIX_FMT_UYVY422] = {
- .convert = yuv420p_to_uyvy422,
- },
- },
- [PIX_FMT_YUV422P] = {
- [PIX_FMT_YUV422] = {
- .convert = yuv422p_to_yuv422,
- },
- [PIX_FMT_UYVY422] = {
- .convert = yuv422p_to_uyvy422,
- },
- },
- [PIX_FMT_YUV444P] = {
- [PIX_FMT_RGB24] = {
- .convert = yuv444p_to_rgb24
- },
- },
- [PIX_FMT_YUVJ420P] = {
- [PIX_FMT_RGB555] = {
- .convert = yuvj420p_to_rgb555
- },
- [PIX_FMT_RGB565] = {
- .convert = yuvj420p_to_rgb565
- },
- [PIX_FMT_BGR24] = {
- .convert = yuvj420p_to_bgr24
- },
- [PIX_FMT_RGB24] = {
- .convert = yuvj420p_to_rgb24
- },
- [PIX_FMT_RGBA32] = {
- .convert = yuvj420p_to_rgba32
- },
- },
- [PIX_FMT_YUVJ444P] = {
- [PIX_FMT_RGB24] = {
- .convert = yuvj444p_to_rgb24
- },
- },
- [PIX_FMT_YUV422] = {
- [PIX_FMT_YUV420P] = {
- .convert = yuv422_to_yuv420p,
- },
- [PIX_FMT_YUV422P] = {
- .convert = yuv422_to_yuv422p,
- },
- },
- [PIX_FMT_UYVY422] = {
- [PIX_FMT_YUV420P] = {
- .convert = uyvy422_to_yuv420p,
- },
- [PIX_FMT_YUV422P] = {
- .convert = uyvy422_to_yuv422p,
- },
- },
- [PIX_FMT_RGB24] = {
- [PIX_FMT_YUV420P] = {
- .convert = rgb24_to_yuv420p
- },
- [PIX_FMT_RGB565] = {
- .convert = rgb24_to_rgb565
- },
- [PIX_FMT_RGB555] = {
- .convert = rgb24_to_rgb555
- },
- [PIX_FMT_RGBA32] = {
- .convert = rgb24_to_rgba32
- },
- [PIX_FMT_BGR24] = {
- .convert = rgb24_to_bgr24
- },
- [PIX_FMT_GRAY8] = {
- .convert = rgb24_to_gray
- },
- [PIX_FMT_PAL8] = {
- .convert = rgb24_to_pal8
- },
- [PIX_FMT_YUV444P] = {
- .convert = rgb24_to_yuv444p
- },
- [PIX_FMT_YUVJ420P] = {
- .convert = rgb24_to_yuvj420p
- },
- [PIX_FMT_YUVJ444P] = {
- .convert = rgb24_to_yuvj444p
- },
- },
- [PIX_FMT_RGBA32] = {
- [PIX_FMT_RGB24] = {
- .convert = rgba32_to_rgb24
- },
- [PIX_FMT_BGR24] = {
- .convert = rgba32_to_bgr24
- },
- [PIX_FMT_RGB565] = {
- .convert = rgba32_to_rgb565
- },
- [PIX_FMT_RGB555] = {
- .convert = rgba32_to_rgb555
- },
- [PIX_FMT_PAL8] = {
- .convert = rgba32_to_pal8
- },
- [PIX_FMT_YUV420P] = {
- .convert = rgba32_to_yuv420p
- },
- [PIX_FMT_GRAY8] = {
- .convert = rgba32_to_gray
- },
- },
- [PIX_FMT_BGR24] = {
- [PIX_FMT_RGBA32] = {
- .convert = bgr24_to_rgba32
- },
- [PIX_FMT_RGB24] = {
- .convert = bgr24_to_rgb24
- },
- [PIX_FMT_YUV420P] = {
- .convert = bgr24_to_yuv420p
- },
- [PIX_FMT_GRAY8] = {
- .convert = bgr24_to_gray
- },
- },
- [PIX_FMT_RGB555] = {
- [PIX_FMT_RGB24] = {
- .convert = rgb555_to_rgb24
- },
- [PIX_FMT_RGBA32] = {
- .convert = rgb555_to_rgba32
- },
- [PIX_FMT_YUV420P] = {
- .convert = rgb555_to_yuv420p
- },
- [PIX_FMT_GRAY8] = {
- .convert = rgb555_to_gray
- },
- },
- [PIX_FMT_RGB565] = {
- [PIX_FMT_RGBA32] = {
- .convert = rgb565_to_rgba32
- },
- [PIX_FMT_RGB24] = {
- .convert = rgb565_to_rgb24
- },
- [PIX_FMT_YUV420P] = {
- .convert = rgb565_to_yuv420p
- },
- [PIX_FMT_GRAY8] = {
- .convert = rgb565_to_gray
- },
- },
- [PIX_FMT_GRAY16BE] = {
- [PIX_FMT_GRAY8] = {
- .convert = gray16be_to_gray
- },
- [PIX_FMT_GRAY16LE] = {
- .convert = gray16_to_gray16
- },
- },
- [PIX_FMT_GRAY16LE] = {
- [PIX_FMT_GRAY8] = {
- .convert = gray16le_to_gray
- },
- [PIX_FMT_GRAY16BE] = {
- .convert = gray16_to_gray16
- },
- },
- [PIX_FMT_GRAY8] = {
- [PIX_FMT_RGB555] = {
- .convert = gray_to_rgb555
- },
- [PIX_FMT_RGB565] = {
- .convert = gray_to_rgb565
- },
- [PIX_FMT_RGB24] = {
- .convert = gray_to_rgb24
- },
- [PIX_FMT_BGR24] = {
- .convert = gray_to_bgr24
- },
- [PIX_FMT_RGBA32] = {
- .convert = gray_to_rgba32
- },
- [PIX_FMT_MONOWHITE] = {
- .convert = gray_to_monowhite
- },
- [PIX_FMT_MONOBLACK] = {
- .convert = gray_to_monoblack
- },
- [PIX_FMT_GRAY16LE] = {
- .convert = gray_to_gray16
- },
- [PIX_FMT_GRAY16BE] = {
- .convert = gray_to_gray16
- },
- },
- [PIX_FMT_MONOWHITE] = {
- [PIX_FMT_GRAY8] = {
- .convert = monowhite_to_gray
- },
- },
- [PIX_FMT_MONOBLACK] = {
- [PIX_FMT_GRAY8] = {
- .convert = monoblack_to_gray
- },
- },
- [PIX_FMT_PAL8] = {
- [PIX_FMT_RGB555] = {
- .convert = pal8_to_rgb555
- },
- [PIX_FMT_RGB565] = {
- .convert = pal8_to_rgb565
- },
- [PIX_FMT_BGR24] = {
- .convert = pal8_to_bgr24
- },
- [PIX_FMT_RGB24] = {
- .convert = pal8_to_rgb24
- },
- [PIX_FMT_RGBA32] = {
- .convert = pal8_to_rgba32
- },
- },
- [PIX_FMT_UYVY411] = {
- [PIX_FMT_YUV411P] = {
- .convert = uyvy411_to_yuv411p,
- },
- },
-
-};
-
-int avpicture_alloc(AVPicture *picture,
- int pix_fmt, int width, int height)
-{
- int size;
- void *ptr;
-
- size = avpicture_get_size(pix_fmt, width, height);
- if(size<0)
- goto fail;
- ptr = av_malloc(size);
- if (!ptr)
- goto fail;
- avpicture_fill(picture, ptr, pix_fmt, width, height);
- return 0;
- fail:
- memset(picture, 0, sizeof(AVPicture));
- return -1;
-}
-
-void avpicture_free(AVPicture *picture)
-{
- av_free(picture->data[0]);
-}
-
-/* return true if yuv planar */
-static inline int is_yuv_planar(const PixFmtInfo *ps)
-{
- return (ps->color_type == FF_COLOR_YUV ||
- ps->color_type == FF_COLOR_YUV_JPEG) &&
- ps->pixel_type == FF_PIXEL_PLANAR;
-}
-
-/**
- * Crop image top and left side
- */
-int img_crop(AVPicture *dst, const AVPicture *src,
- int pix_fmt, int top_band, int left_band)
-{
- int y_shift;
- int x_shift;
-
- if (pix_fmt < 0 || pix_fmt >= PIX_FMT_NB || !is_yuv_planar(&pix_fmt_info[pix_fmt]))
- return -1;
-
- y_shift = pix_fmt_info[pix_fmt].y_chroma_shift;
- x_shift = pix_fmt_info[pix_fmt].x_chroma_shift;
-
- dst->data[0] = src->data[0] + (top_band * src->linesize[0]) + left_band;
- dst->data[1] = src->data[1] + ((top_band >> y_shift) * src->linesize[1]) + (left_band >> x_shift);
- dst->data[2] = src->data[2] + ((top_band >> y_shift) * src->linesize[2]) + (left_band >> x_shift);
-
- dst->linesize[0] = src->linesize[0];
- dst->linesize[1] = src->linesize[1];
- dst->linesize[2] = src->linesize[2];
- return 0;
-}
-
-/**
- * Pad image
- */
-int img_pad(AVPicture *dst, const AVPicture *src, int height, int width,
- int pix_fmt, int padtop, int padbottom, int padleft, int padright,
- int *color)
-{
- uint8_t *optr;
- int y_shift;
- int x_shift;
- int yheight;
- int i, y;
-
- if (pix_fmt < 0 || pix_fmt >= PIX_FMT_NB ||
- !is_yuv_planar(&pix_fmt_info[pix_fmt])) return -1;
-
- for (i = 0; i < 3; i++) {
- x_shift = i ? pix_fmt_info[pix_fmt].x_chroma_shift : 0;
- y_shift = i ? pix_fmt_info[pix_fmt].y_chroma_shift : 0;
-
- if (padtop || padleft) {
- memset(dst->data[i], color[i],
- dst->linesize[i] * (padtop >> y_shift) + (padleft >> x_shift));
- }
-
- if (padleft || padright) {
- optr = dst->data[i] + dst->linesize[i] * (padtop >> y_shift) +
- (dst->linesize[i] - (padright >> x_shift));
- yheight = (height - 1 - (padtop + padbottom)) >> y_shift;
- for (y = 0; y < yheight; y++) {
- memset(optr, color[i], (padleft + padright) >> x_shift);
- optr += dst->linesize[i];
- }
- }
-
- if (src) { /* first line */
- uint8_t *iptr = src->data[i];
- optr = dst->data[i] + dst->linesize[i] * (padtop >> y_shift) +
- (padleft >> x_shift);
- memcpy(optr, iptr, src->linesize[i]);
- iptr += src->linesize[i];
- optr = dst->data[i] + dst->linesize[i] * (padtop >> y_shift) +
- (dst->linesize[i] - (padright >> x_shift));
- yheight = (height - 1 - (padtop + padbottom)) >> y_shift;
- for (y = 0; y < yheight; y++) {
- memset(optr, color[i], (padleft + padright) >> x_shift);
- memcpy(optr + ((padleft + padright) >> x_shift), iptr,
- src->linesize[i]);
- iptr += src->linesize[i];
- optr += dst->linesize[i];
- }
- }
-
- if (padbottom || padright) {
- optr = dst->data[i] + dst->linesize[i] *
- ((height - padbottom) >> y_shift) - (padright >> x_shift);
- memset(optr, color[i],dst->linesize[i] *
- (padbottom >> y_shift) + (padright >> x_shift));
- }
- }
- return 0;
-}
-
-#ifndef CONFIG_SWSCALER
-/* XXX: always use linesize. Return -1 if not supported */
-int img_convert(AVPicture *dst, int dst_pix_fmt,
- const AVPicture *src, int src_pix_fmt,
- int src_width, int src_height)
-{
- static int inited;
- int i, ret, dst_width, dst_height, int_pix_fmt;
- const PixFmtInfo *src_pix, *dst_pix;
- const ConvertEntry *ce;
- AVPicture tmp1, *tmp = &tmp1;
-
- if (src_pix_fmt < 0 || src_pix_fmt >= PIX_FMT_NB ||
- dst_pix_fmt < 0 || dst_pix_fmt >= PIX_FMT_NB)
- return -1;
- if (src_width <= 0 || src_height <= 0)
- return 0;
-
- if (!inited) {
- inited = 1;
- img_convert_init();
- }
-
- dst_width = src_width;
- dst_height = src_height;
-
- dst_pix = &pix_fmt_info[dst_pix_fmt];
- src_pix = &pix_fmt_info[src_pix_fmt];
- if (src_pix_fmt == dst_pix_fmt) {
- /* no conversion needed: just copy */
- img_copy(dst, src, dst_pix_fmt, dst_width, dst_height);
- return 0;
- }
-
- ce = &convert_table[src_pix_fmt][dst_pix_fmt];
- if (ce->convert) {
- /* specific conversion routine */
- ce->convert(dst, src, dst_width, dst_height);
- return 0;
- }
-
- /* gray to YUV */
- if (is_yuv_planar(dst_pix) &&
- src_pix_fmt == PIX_FMT_GRAY8) {
- int w, h, y;
- uint8_t *d;
-
- if (dst_pix->color_type == FF_COLOR_YUV_JPEG) {
- ff_img_copy_plane(dst->data[0], dst->linesize[0],
- src->data[0], src->linesize[0],
- dst_width, dst_height);
- } else {
- img_apply_table(dst->data[0], dst->linesize[0],
- src->data[0], src->linesize[0],
- dst_width, dst_height,
- y_jpeg_to_ccir);
- }
- /* fill U and V with 128 */
- w = dst_width;
- h = dst_height;
- w >>= dst_pix->x_chroma_shift;
- h >>= dst_pix->y_chroma_shift;
- for(i = 1; i <= 2; i++) {
- d = dst->data[i];
- for(y = 0; y< h; y++) {
- memset(d, 128, w);
- d += dst->linesize[i];
- }
- }
- return 0;
- }
-
- /* YUV to gray */
- if (is_yuv_planar(src_pix) &&
- dst_pix_fmt == PIX_FMT_GRAY8) {
- if (src_pix->color_type == FF_COLOR_YUV_JPEG) {
- ff_img_copy_plane(dst->data[0], dst->linesize[0],
- src->data[0], src->linesize[0],
- dst_width, dst_height);
- } else {
- img_apply_table(dst->data[0], dst->linesize[0],
- src->data[0], src->linesize[0],
- dst_width, dst_height,
- y_ccir_to_jpeg);
- }
- return 0;
- }
-
- /* YUV to YUV planar */
- if (is_yuv_planar(dst_pix) && is_yuv_planar(src_pix)) {
- int x_shift, y_shift, w, h, xy_shift;
- void (*resize_func)(uint8_t *dst, int dst_wrap,
- const uint8_t *src, int src_wrap,
- int width, int height);
-
- /* compute chroma size of the smallest dimensions */
- w = dst_width;
- h = dst_height;
- if (dst_pix->x_chroma_shift >= src_pix->x_chroma_shift)
- w >>= dst_pix->x_chroma_shift;
- else
- w >>= src_pix->x_chroma_shift;
- if (dst_pix->y_chroma_shift >= src_pix->y_chroma_shift)
- h >>= dst_pix->y_chroma_shift;
- else
- h >>= src_pix->y_chroma_shift;
-
- x_shift = (dst_pix->x_chroma_shift - src_pix->x_chroma_shift);
- y_shift = (dst_pix->y_chroma_shift - src_pix->y_chroma_shift);
- xy_shift = ((x_shift & 0xf) << 4) | (y_shift & 0xf);
- /* there must be filters for conversion at least from and to
- YUV444 format */
- switch(xy_shift) {
- case 0x00:
- resize_func = ff_img_copy_plane;
- break;
- case 0x10:
- resize_func = shrink21;
- break;
- case 0x20:
- resize_func = shrink41;
- break;
- case 0x01:
- resize_func = shrink12;
- break;
- case 0x11:
- resize_func = ff_shrink22;
- break;
- case 0x22:
- resize_func = ff_shrink44;
- break;
- case 0xf0:
- resize_func = grow21;
- break;
- case 0xe0:
- resize_func = grow41;
- break;
- case 0xff:
- resize_func = grow22;
- break;
- case 0xee:
- resize_func = grow44;
- break;
- case 0xf1:
- resize_func = conv411;
- break;
- default:
- /* currently not handled */
- goto no_chroma_filter;
- }
-
- ff_img_copy_plane(dst->data[0], dst->linesize[0],
- src->data[0], src->linesize[0],
- dst_width, dst_height);
-
- for(i = 1;i <= 2; i++)
- resize_func(dst->data[i], dst->linesize[i],
- src->data[i], src->linesize[i],
- dst_width>>dst_pix->x_chroma_shift, dst_height>>dst_pix->y_chroma_shift);
- /* if yuv color space conversion is needed, we do it here on
- the destination image */
- if (dst_pix->color_type != src_pix->color_type) {
- const uint8_t *y_table, *c_table;
- if (dst_pix->color_type == FF_COLOR_YUV) {
- y_table = y_jpeg_to_ccir;
- c_table = c_jpeg_to_ccir;
- } else {
- y_table = y_ccir_to_jpeg;
- c_table = c_ccir_to_jpeg;
- }
- img_apply_table(dst->data[0], dst->linesize[0],
- dst->data[0], dst->linesize[0],
- dst_width, dst_height,
- y_table);
-
- for(i = 1;i <= 2; i++)
- img_apply_table(dst->data[i], dst->linesize[i],
- dst->data[i], dst->linesize[i],
- dst_width>>dst_pix->x_chroma_shift,
- dst_height>>dst_pix->y_chroma_shift,
- c_table);
- }
- return 0;
- }
- no_chroma_filter:
-
- /* try to use an intermediate format */
- if (src_pix_fmt == PIX_FMT_YUV422 ||
- dst_pix_fmt == PIX_FMT_YUV422) {
- /* specific case: convert to YUV422P first */
- int_pix_fmt = PIX_FMT_YUV422P;
- } else if (src_pix_fmt == PIX_FMT_UYVY422 ||
- dst_pix_fmt == PIX_FMT_UYVY422) {
- /* specific case: convert to YUV422P first */
- int_pix_fmt = PIX_FMT_YUV422P;
- } else if (src_pix_fmt == PIX_FMT_UYVY411 ||
- dst_pix_fmt == PIX_FMT_UYVY411) {
- /* specific case: convert to YUV411P first */
- int_pix_fmt = PIX_FMT_YUV411P;
- } else if ((src_pix->color_type == FF_COLOR_GRAY &&
- src_pix_fmt != PIX_FMT_GRAY8) ||
- (dst_pix->color_type == FF_COLOR_GRAY &&
- dst_pix_fmt != PIX_FMT_GRAY8)) {
- /* gray8 is the normalized format */
- int_pix_fmt = PIX_FMT_GRAY8;
- } else if ((is_yuv_planar(src_pix) &&
- src_pix_fmt != PIX_FMT_YUV444P &&
- src_pix_fmt != PIX_FMT_YUVJ444P)) {
- /* yuv444 is the normalized format */
- if (src_pix->color_type == FF_COLOR_YUV_JPEG)
- int_pix_fmt = PIX_FMT_YUVJ444P;
- else
- int_pix_fmt = PIX_FMT_YUV444P;
- } else if ((is_yuv_planar(dst_pix) &&
- dst_pix_fmt != PIX_FMT_YUV444P &&
- dst_pix_fmt != PIX_FMT_YUVJ444P)) {
- /* yuv444 is the normalized format */
- if (dst_pix->color_type == FF_COLOR_YUV_JPEG)
- int_pix_fmt = PIX_FMT_YUVJ444P;
- else
- int_pix_fmt = PIX_FMT_YUV444P;
- } else {
- /* the two formats are rgb or gray8 or yuv[j]444p */
- if (src_pix->is_alpha && dst_pix->is_alpha)
- int_pix_fmt = PIX_FMT_RGBA32;
- else
- int_pix_fmt = PIX_FMT_RGB24;
- }
- if (avpicture_alloc(tmp, int_pix_fmt, dst_width, dst_height) < 0)
- return -1;
- ret = -1;
- if (img_convert(tmp, int_pix_fmt,
- src, src_pix_fmt, src_width, src_height) < 0)
- goto fail1;
- if (img_convert(dst, dst_pix_fmt,
- tmp, int_pix_fmt, dst_width, dst_height) < 0)
- goto fail1;
- ret = 0;
- fail1:
- avpicture_free(tmp);
- return ret;
-}
-#endif
-
-/* NOTE: we scan all the pixels to have an exact information */
-static int get_alpha_info_pal8(const AVPicture *src, int width, int height)
-{
- const unsigned char *p;
- int src_wrap, ret, x, y;
- unsigned int a;
- uint32_t *palette = (uint32_t *)src->data[1];
-
- p = src->data[0];
- src_wrap = src->linesize[0] - width;
- ret = 0;
- for(y=0;y<height;y++) {
- for(x=0;x<width;x++) {
- a = palette[p[0]] >> 24;
- if (a == 0x00) {
- ret |= FF_ALPHA_TRANSP;
- } else if (a != 0xff) {
- ret |= FF_ALPHA_SEMI_TRANSP;
- }
- p++;
- }
- p += src_wrap;
- }
- return ret;
-}
-
-/**
- * Tell if an image really has transparent alpha values.
- * @return ored mask of FF_ALPHA_xxx constants
- */
-int img_get_alpha_info(const AVPicture *src,
- int pix_fmt, int width, int height)
-{
- const PixFmtInfo *pf = &pix_fmt_info[pix_fmt];
- int ret;
-
- pf = &pix_fmt_info[pix_fmt];
- /* no alpha can be represented in format */
- if (!pf->is_alpha)
- return 0;
- switch(pix_fmt) {
- case PIX_FMT_RGBA32:
- ret = get_alpha_info_rgba32(src, width, height);
- break;
- case PIX_FMT_PAL8:
- ret = get_alpha_info_pal8(src, width, height);
- break;
- default:
- /* we do not know, so everything is indicated */
- ret = FF_ALPHA_TRANSP | FF_ALPHA_SEMI_TRANSP;
- break;
- }
- return ret;
-}
-
-#ifdef HAVE_MMX
-#define DEINT_INPLACE_LINE_LUM \
- movd_m2r(lum_m4[0],mm0);\
- movd_m2r(lum_m3[0],mm1);\
- movd_m2r(lum_m2[0],mm2);\
- movd_m2r(lum_m1[0],mm3);\
- movd_m2r(lum[0],mm4);\
- punpcklbw_r2r(mm7,mm0);\
- movd_r2m(mm2,lum_m4[0]);\
- punpcklbw_r2r(mm7,mm1);\
- punpcklbw_r2r(mm7,mm2);\
- punpcklbw_r2r(mm7,mm3);\
- punpcklbw_r2r(mm7,mm4);\
- paddw_r2r(mm3,mm1);\
- psllw_i2r(1,mm2);\
- paddw_r2r(mm4,mm0);\
- psllw_i2r(2,mm1);\
- paddw_r2r(mm6,mm2);\
- paddw_r2r(mm2,mm1);\
- psubusw_r2r(mm0,mm1);\
- psrlw_i2r(3,mm1);\
- packuswb_r2r(mm7,mm1);\
- movd_r2m(mm1,lum_m2[0]);
-
-#define DEINT_LINE_LUM \
- movd_m2r(lum_m4[0],mm0);\
- movd_m2r(lum_m3[0],mm1);\
- movd_m2r(lum_m2[0],mm2);\
- movd_m2r(lum_m1[0],mm3);\
- movd_m2r(lum[0],mm4);\
- punpcklbw_r2r(mm7,mm0);\
- punpcklbw_r2r(mm7,mm1);\
- punpcklbw_r2r(mm7,mm2);\
- punpcklbw_r2r(mm7,mm3);\
- punpcklbw_r2r(mm7,mm4);\
- paddw_r2r(mm3,mm1);\
- psllw_i2r(1,mm2);\
- paddw_r2r(mm4,mm0);\
- psllw_i2r(2,mm1);\
- paddw_r2r(mm6,mm2);\
- paddw_r2r(mm2,mm1);\
- psubusw_r2r(mm0,mm1);\
- psrlw_i2r(3,mm1);\
- packuswb_r2r(mm7,mm1);\
- movd_r2m(mm1,dst[0]);
-#endif
-
-/* filter parameters: [-1 4 2 4 -1] // 8 */
-static void deinterlace_line(uint8_t *dst,
- const uint8_t *lum_m4, const uint8_t *lum_m3,
- const uint8_t *lum_m2, const uint8_t *lum_m1,
- const uint8_t *lum,
- int size)
-{
-#ifndef HAVE_MMX
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
- int sum;
-
- for(;size > 0;size--) {
- sum = -lum_m4[0];
- sum += lum_m3[0] << 2;
- sum += lum_m2[0] << 1;
- sum += lum_m1[0] << 2;
- sum += -lum[0];
- dst[0] = cm[(sum + 4) >> 3];
- lum_m4++;
- lum_m3++;
- lum_m2++;
- lum_m1++;
- lum++;
- dst++;
- }
-#else
-
- {
- mmx_t rounder;
- rounder.uw[0]=4;
- rounder.uw[1]=4;
- rounder.uw[2]=4;
- rounder.uw[3]=4;
- pxor_r2r(mm7,mm7);
- movq_m2r(rounder,mm6);
- }
- for (;size > 3; size-=4) {
- DEINT_LINE_LUM
- lum_m4+=4;
- lum_m3+=4;
- lum_m2+=4;
- lum_m1+=4;
- lum+=4;
- dst+=4;
- }
-#endif
-}
-static void deinterlace_line_inplace(uint8_t *lum_m4, uint8_t *lum_m3, uint8_t *lum_m2, uint8_t *lum_m1, uint8_t *lum,
- int size)
-{
-#ifndef HAVE_MMX
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
- int sum;
-
- for(;size > 0;size--) {
- sum = -lum_m4[0];
- sum += lum_m3[0] << 2;
- sum += lum_m2[0] << 1;
- lum_m4[0]=lum_m2[0];
- sum += lum_m1[0] << 2;
- sum += -lum[0];
- lum_m2[0] = cm[(sum + 4) >> 3];
- lum_m4++;
- lum_m3++;
- lum_m2++;
- lum_m1++;
- lum++;
- }
-#else
-
- {
- mmx_t rounder;
- rounder.uw[0]=4;
- rounder.uw[1]=4;
- rounder.uw[2]=4;
- rounder.uw[3]=4;
- pxor_r2r(mm7,mm7);
- movq_m2r(rounder,mm6);
- }
- for (;size > 3; size-=4) {
- DEINT_INPLACE_LINE_LUM
- lum_m4+=4;
- lum_m3+=4;
- lum_m2+=4;
- lum_m1+=4;
- lum+=4;
- }
-#endif
-}
-
-/* deinterlacing : 2 temporal taps, 3 spatial taps linear filter. The
- top field is copied as is, but the bottom field is deinterlaced
- against the top field. */
-static void deinterlace_bottom_field(uint8_t *dst, int dst_wrap,
- const uint8_t *src1, int src_wrap,
- int width, int height)
-{
- const uint8_t *src_m2, *src_m1, *src_0, *src_p1, *src_p2;
- int y;
-
- src_m2 = src1;
- src_m1 = src1;
- src_0=&src_m1[src_wrap];
- src_p1=&src_0[src_wrap];
- src_p2=&src_p1[src_wrap];
- for(y=0;y<(height-2);y+=2) {
- memcpy(dst,src_m1,width);
- dst += dst_wrap;
- deinterlace_line(dst,src_m2,src_m1,src_0,src_p1,src_p2,width);
- src_m2 = src_0;
- src_m1 = src_p1;
- src_0 = src_p2;
- src_p1 += 2*src_wrap;
- src_p2 += 2*src_wrap;
- dst += dst_wrap;
- }
- memcpy(dst,src_m1,width);
- dst += dst_wrap;
- /* do last line */
- deinterlace_line(dst,src_m2,src_m1,src_0,src_0,src_0,width);
-}
-
-static void deinterlace_bottom_field_inplace(uint8_t *src1, int src_wrap,
- int width, int height)
-{
- uint8_t *src_m1, *src_0, *src_p1, *src_p2;
- int y;
- uint8_t *buf;
- buf = (uint8_t*)av_malloc(width);
-
- src_m1 = src1;
- memcpy(buf,src_m1,width);
- src_0=&src_m1[src_wrap];
- src_p1=&src_0[src_wrap];
- src_p2=&src_p1[src_wrap];
- for(y=0;y<(height-2);y+=2) {
- deinterlace_line_inplace(buf,src_m1,src_0,src_p1,src_p2,width);
- src_m1 = src_p1;
- src_0 = src_p2;
- src_p1 += 2*src_wrap;
- src_p2 += 2*src_wrap;
- }
- /* do last line */
- deinterlace_line_inplace(buf,src_m1,src_0,src_0,src_0,width);
- av_free(buf);
-}
-
-
-/* deinterlace - if not supported return -1 */
-int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
- int pix_fmt, int width, int height)
-{
- int i;
-
- if (pix_fmt != PIX_FMT_YUV420P &&
- pix_fmt != PIX_FMT_YUV422P &&
- pix_fmt != PIX_FMT_YUV444P &&
- pix_fmt != PIX_FMT_YUV411P)
- return -1;
- if ((width & 3) != 0 || (height & 3) != 0)
- return -1;
-
- for(i=0;i<3;i++) {
- if (i == 1) {
- switch(pix_fmt) {
- case PIX_FMT_YUV420P:
- width >>= 1;
- height >>= 1;
- break;
- case PIX_FMT_YUV422P:
- width >>= 1;
- break;
- case PIX_FMT_YUV411P:
- width >>= 2;
- break;
- default:
- break;
- }
- }
- if (src == dst) {
- deinterlace_bottom_field_inplace(dst->data[i], dst->linesize[i],
- width, height);
- } else {
- deinterlace_bottom_field(dst->data[i],dst->linesize[i],
- src->data[i], src->linesize[i],
- width, height);
- }
- }
-#ifdef HAVE_MMX
- emms();
-#endif
- return 0;
-}
-
-#undef FIX
diff --git a/src/libffmpeg/libavcodec/imgconvert_template.h b/src/libffmpeg/libavcodec/imgconvert_template.h
deleted file mode 100644
index 4cc898bab..000000000
--- a/src/libffmpeg/libavcodec/imgconvert_template.h
+++ /dev/null
@@ -1,875 +0,0 @@
-/*
- * Templates for image convertion routines
- * Copyright (c) 2001, 2002, 2003 Fabrice Bellard.
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef RGB_OUT
-#define RGB_OUT(d, r, g, b) RGBA_OUT(d, r, g, b, 0xff)
-#endif
-
-static void glue(yuv420p_to_, RGB_NAME)(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- const uint8_t *y1_ptr, *y2_ptr, *cb_ptr, *cr_ptr;
- uint8_t *d, *d1, *d2;
- int w, y, cb, cr, r_add, g_add, b_add, width2;
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
- unsigned int r, g, b;
-
- d = dst->data[0];
- y1_ptr = src->data[0];
- cb_ptr = src->data[1];
- cr_ptr = src->data[2];
- width2 = (width + 1) >> 1;
- for(;height >= 2; height -= 2) {
- d1 = d;
- d2 = d + dst->linesize[0];
- y2_ptr = y1_ptr + src->linesize[0];
- for(w = width; w >= 2; w -= 2) {
- YUV_TO_RGB1_CCIR(cb_ptr[0], cr_ptr[0]);
- /* output 4 pixels */
- YUV_TO_RGB2_CCIR(r, g, b, y1_ptr[0]);
- RGB_OUT(d1, r, g, b);
-
- YUV_TO_RGB2_CCIR(r, g, b, y1_ptr[1]);
- RGB_OUT(d1 + BPP, r, g, b);
-
- YUV_TO_RGB2_CCIR(r, g, b, y2_ptr[0]);
- RGB_OUT(d2, r, g, b);
-
- YUV_TO_RGB2_CCIR(r, g, b, y2_ptr[1]);
- RGB_OUT(d2 + BPP, r, g, b);
-
- d1 += 2 * BPP;
- d2 += 2 * BPP;
-
- y1_ptr += 2;
- y2_ptr += 2;
- cb_ptr++;
- cr_ptr++;
- }
- /* handle odd width */
- if (w) {
- YUV_TO_RGB1_CCIR(cb_ptr[0], cr_ptr[0]);
- YUV_TO_RGB2_CCIR(r, g, b, y1_ptr[0]);
- RGB_OUT(d1, r, g, b);
-
- YUV_TO_RGB2_CCIR(r, g, b, y2_ptr[0]);
- RGB_OUT(d2, r, g, b);
- d1 += BPP;
- d2 += BPP;
- y1_ptr++;
- y2_ptr++;
- cb_ptr++;
- cr_ptr++;
- }
- d += 2 * dst->linesize[0];
- y1_ptr += 2 * src->linesize[0] - width;
- cb_ptr += src->linesize[1] - width2;
- cr_ptr += src->linesize[2] - width2;
- }
- /* handle odd height */
- if (height) {
- d1 = d;
- for(w = width; w >= 2; w -= 2) {
- YUV_TO_RGB1_CCIR(cb_ptr[0], cr_ptr[0]);
- /* output 2 pixels */
- YUV_TO_RGB2_CCIR(r, g, b, y1_ptr[0]);
- RGB_OUT(d1, r, g, b);
-
- YUV_TO_RGB2_CCIR(r, g, b, y1_ptr[1]);
- RGB_OUT(d1 + BPP, r, g, b);
-
- d1 += 2 * BPP;
-
- y1_ptr += 2;
- cb_ptr++;
- cr_ptr++;
- }
- /* handle width */
- if (w) {
- YUV_TO_RGB1_CCIR(cb_ptr[0], cr_ptr[0]);
- /* output 2 pixels */
- YUV_TO_RGB2_CCIR(r, g, b, y1_ptr[0]);
- RGB_OUT(d1, r, g, b);
- d1 += BPP;
-
- y1_ptr++;
- cb_ptr++;
- cr_ptr++;
- }
- }
-}
-
-static void glue(yuvj420p_to_, RGB_NAME)(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- const uint8_t *y1_ptr, *y2_ptr, *cb_ptr, *cr_ptr;
- uint8_t *d, *d1, *d2;
- int w, y, cb, cr, r_add, g_add, b_add, width2;
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
- unsigned int r, g, b;
-
- d = dst->data[0];
- y1_ptr = src->data[0];
- cb_ptr = src->data[1];
- cr_ptr = src->data[2];
- width2 = (width + 1) >> 1;
- for(;height >= 2; height -= 2) {
- d1 = d;
- d2 = d + dst->linesize[0];
- y2_ptr = y1_ptr + src->linesize[0];
- for(w = width; w >= 2; w -= 2) {
- YUV_TO_RGB1(cb_ptr[0], cr_ptr[0]);
- /* output 4 pixels */
- YUV_TO_RGB2(r, g, b, y1_ptr[0]);
- RGB_OUT(d1, r, g, b);
-
- YUV_TO_RGB2(r, g, b, y1_ptr[1]);
- RGB_OUT(d1 + BPP, r, g, b);
-
- YUV_TO_RGB2(r, g, b, y2_ptr[0]);
- RGB_OUT(d2, r, g, b);
-
- YUV_TO_RGB2(r, g, b, y2_ptr[1]);
- RGB_OUT(d2 + BPP, r, g, b);
-
- d1 += 2 * BPP;
- d2 += 2 * BPP;
-
- y1_ptr += 2;
- y2_ptr += 2;
- cb_ptr++;
- cr_ptr++;
- }
- /* handle odd width */
- if (w) {
- YUV_TO_RGB1(cb_ptr[0], cr_ptr[0]);
- YUV_TO_RGB2(r, g, b, y1_ptr[0]);
- RGB_OUT(d1, r, g, b);
-
- YUV_TO_RGB2(r, g, b, y2_ptr[0]);
- RGB_OUT(d2, r, g, b);
- d1 += BPP;
- d2 += BPP;
- y1_ptr++;
- y2_ptr++;
- cb_ptr++;
- cr_ptr++;
- }
- d += 2 * dst->linesize[0];
- y1_ptr += 2 * src->linesize[0] - width;
- cb_ptr += src->linesize[1] - width2;
- cr_ptr += src->linesize[2] - width2;
- }
- /* handle odd height */
- if (height) {
- d1 = d;
- for(w = width; w >= 2; w -= 2) {
- YUV_TO_RGB1(cb_ptr[0], cr_ptr[0]);
- /* output 2 pixels */
- YUV_TO_RGB2(r, g, b, y1_ptr[0]);
- RGB_OUT(d1, r, g, b);
-
- YUV_TO_RGB2(r, g, b, y1_ptr[1]);
- RGB_OUT(d1 + BPP, r, g, b);
-
- d1 += 2 * BPP;
-
- y1_ptr += 2;
- cb_ptr++;
- cr_ptr++;
- }
- /* handle width */
- if (w) {
- YUV_TO_RGB1(cb_ptr[0], cr_ptr[0]);
- /* output 2 pixels */
- YUV_TO_RGB2(r, g, b, y1_ptr[0]);
- RGB_OUT(d1, r, g, b);
- d1 += BPP;
-
- y1_ptr++;
- cb_ptr++;
- cr_ptr++;
- }
- }
-}
-
-static void glue(RGB_NAME, _to_yuv420p)(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- int wrap, wrap3, width2;
- int r, g, b, r1, g1, b1, w;
- uint8_t *lum, *cb, *cr;
- const uint8_t *p;
-
- lum = dst->data[0];
- cb = dst->data[1];
- cr = dst->data[2];
-
- width2 = (width + 1) >> 1;
- wrap = dst->linesize[0];
- wrap3 = src->linesize[0];
- p = src->data[0];
- for(;height>=2;height -= 2) {
- for(w = width; w >= 2; w -= 2) {
- RGB_IN(r, g, b, p);
- r1 = r;
- g1 = g;
- b1 = b;
- lum[0] = RGB_TO_Y_CCIR(r, g, b);
-
- RGB_IN(r, g, b, p + BPP);
- r1 += r;
- g1 += g;
- b1 += b;
- lum[1] = RGB_TO_Y_CCIR(r, g, b);
- p += wrap3;
- lum += wrap;
-
- RGB_IN(r, g, b, p);
- r1 += r;
- g1 += g;
- b1 += b;
- lum[0] = RGB_TO_Y_CCIR(r, g, b);
-
- RGB_IN(r, g, b, p + BPP);
- r1 += r;
- g1 += g;
- b1 += b;
- lum[1] = RGB_TO_Y_CCIR(r, g, b);
-
- cb[0] = RGB_TO_U_CCIR(r1, g1, b1, 2);
- cr[0] = RGB_TO_V_CCIR(r1, g1, b1, 2);
-
- cb++;
- cr++;
- p += -wrap3 + 2 * BPP;
- lum += -wrap + 2;
- }
- if (w) {
- RGB_IN(r, g, b, p);
- r1 = r;
- g1 = g;
- b1 = b;
- lum[0] = RGB_TO_Y_CCIR(r, g, b);
- p += wrap3;
- lum += wrap;
- RGB_IN(r, g, b, p);
- r1 += r;
- g1 += g;
- b1 += b;
- lum[0] = RGB_TO_Y_CCIR(r, g, b);
- cb[0] = RGB_TO_U_CCIR(r1, g1, b1, 1);
- cr[0] = RGB_TO_V_CCIR(r1, g1, b1, 1);
- cb++;
- cr++;
- p += -wrap3 + BPP;
- lum += -wrap + 1;
- }
- p += wrap3 + (wrap3 - width * BPP);
- lum += wrap + (wrap - width);
- cb += dst->linesize[1] - width2;
- cr += dst->linesize[2] - width2;
- }
- /* handle odd height */
- if (height) {
- for(w = width; w >= 2; w -= 2) {
- RGB_IN(r, g, b, p);
- r1 = r;
- g1 = g;
- b1 = b;
- lum[0] = RGB_TO_Y_CCIR(r, g, b);
-
- RGB_IN(r, g, b, p + BPP);
- r1 += r;
- g1 += g;
- b1 += b;
- lum[1] = RGB_TO_Y_CCIR(r, g, b);
- cb[0] = RGB_TO_U_CCIR(r1, g1, b1, 1);
- cr[0] = RGB_TO_V_CCIR(r1, g1, b1, 1);
- cb++;
- cr++;
- p += 2 * BPP;
- lum += 2;
- }
- if (w) {
- RGB_IN(r, g, b, p);
- lum[0] = RGB_TO_Y_CCIR(r, g, b);
- cb[0] = RGB_TO_U_CCIR(r, g, b, 0);
- cr[0] = RGB_TO_V_CCIR(r, g, b, 0);
- }
- }
-}
-
-static void glue(RGB_NAME, _to_gray)(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- const unsigned char *p;
- unsigned char *q;
- int r, g, b, dst_wrap, src_wrap;
- int x, y;
-
- p = src->data[0];
- src_wrap = src->linesize[0] - BPP * width;
-
- q = dst->data[0];
- dst_wrap = dst->linesize[0] - width;
-
- for(y=0;y<height;y++) {
- for(x=0;x<width;x++) {
- RGB_IN(r, g, b, p);
- q[0] = RGB_TO_Y(r, g, b);
- q++;
- p += BPP;
- }
- p += src_wrap;
- q += dst_wrap;
- }
-}
-
-static void glue(gray_to_, RGB_NAME)(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- const unsigned char *p;
- unsigned char *q;
- int r, dst_wrap, src_wrap;
- int x, y;
-
- p = src->data[0];
- src_wrap = src->linesize[0] - width;
-
- q = dst->data[0];
- dst_wrap = dst->linesize[0] - BPP * width;
-
- for(y=0;y<height;y++) {
- for(x=0;x<width;x++) {
- r = p[0];
- RGB_OUT(q, r, r, r);
- q += BPP;
- p ++;
- }
- p += src_wrap;
- q += dst_wrap;
- }
-}
-
-static void glue(pal8_to_, RGB_NAME)(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- const unsigned char *p;
- unsigned char *q;
- int r, g, b, dst_wrap, src_wrap;
- int x, y;
- uint32_t v;
- const uint32_t *palette;
-
- p = src->data[0];
- src_wrap = src->linesize[0] - width;
- palette = (uint32_t *)src->data[1];
-
- q = dst->data[0];
- dst_wrap = dst->linesize[0] - BPP * width;
-
- for(y=0;y<height;y++) {
- for(x=0;x<width;x++) {
- v = palette[p[0]];
- r = (v >> 16) & 0xff;
- g = (v >> 8) & 0xff;
- b = (v) & 0xff;
-#ifdef RGBA_OUT
- {
- int a;
- a = (v >> 24) & 0xff;
- RGBA_OUT(q, r, g, b, a);
- }
-#else
- RGB_OUT(q, r, g, b);
-#endif
- q += BPP;
- p ++;
- }
- p += src_wrap;
- q += dst_wrap;
- }
-}
-
-// RGB24 has optimised routines
-#if !defined(FMT_RGBA32) && !defined(FMT_RGB24)
-/* alpha support */
-
-static void glue(rgba32_to_, RGB_NAME)(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- const uint8_t *s;
- uint8_t *d;
- int src_wrap, dst_wrap, j, y;
- unsigned int v, r, g, b;
-#ifdef RGBA_OUT
- unsigned int a;
-#endif
-
- s = src->data[0];
- src_wrap = src->linesize[0] - width * 4;
-
- d = dst->data[0];
- dst_wrap = dst->linesize[0] - width * BPP;
-
- for(y=0;y<height;y++) {
- for(j = 0;j < width; j++) {
- v = ((const uint32_t *)(s))[0];
- r = (v >> 16) & 0xff;
- g = (v >> 8) & 0xff;
- b = v & 0xff;
-#ifdef RGBA_OUT
- a = (v >> 24) & 0xff;
- RGBA_OUT(d, r, g, b, a);
-#else
- RGB_OUT(d, r, g, b);
-#endif
- s += 4;
- d += BPP;
- }
- s += src_wrap;
- d += dst_wrap;
- }
-}
-
-static void glue(RGB_NAME, _to_rgba32)(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- const uint8_t *s;
- uint8_t *d;
- int src_wrap, dst_wrap, j, y;
- unsigned int r, g, b;
-#ifdef RGBA_IN
- unsigned int a;
-#endif
-
- s = src->data[0];
- src_wrap = src->linesize[0] - width * BPP;
-
- d = dst->data[0];
- dst_wrap = dst->linesize[0] - width * 4;
-
- for(y=0;y<height;y++) {
- for(j = 0;j < width; j++) {
-#ifdef RGBA_IN
- RGBA_IN(r, g, b, a, s);
- ((uint32_t *)(d))[0] = (a << 24) | (r << 16) | (g << 8) | b;
-#else
- RGB_IN(r, g, b, s);
- ((uint32_t *)(d))[0] = (0xff << 24) | (r << 16) | (g << 8) | b;
-#endif
- d += 4;
- s += BPP;
- }
- s += src_wrap;
- d += dst_wrap;
- }
-}
-
-#endif /* !defined(FMT_RGBA32) */
-
-#ifndef FMT_RGB24
-
-static void glue(rgb24_to_, RGB_NAME)(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- const uint8_t *s;
- uint8_t *d;
- int src_wrap, dst_wrap, j, y;
- unsigned int r, g, b;
-
- s = src->data[0];
- src_wrap = src->linesize[0] - width * 3;
-
- d = dst->data[0];
- dst_wrap = dst->linesize[0] - width * BPP;
-
- for(y=0;y<height;y++) {
- for(j = 0;j < width; j++) {
- r = s[0];
- g = s[1];
- b = s[2];
- RGB_OUT(d, r, g, b);
- s += 3;
- d += BPP;
- }
- s += src_wrap;
- d += dst_wrap;
- }
-}
-
-static void glue(RGB_NAME, _to_rgb24)(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- const uint8_t *s;
- uint8_t *d;
- int src_wrap, dst_wrap, j, y;
- unsigned int r, g , b;
-
- s = src->data[0];
- src_wrap = src->linesize[0] - width * BPP;
-
- d = dst->data[0];
- dst_wrap = dst->linesize[0] - width * 3;
-
- for(y=0;y<height;y++) {
- for(j = 0;j < width; j++) {
- RGB_IN(r, g, b, s)
- d[0] = r;
- d[1] = g;
- d[2] = b;
- d += 3;
- s += BPP;
- }
- s += src_wrap;
- d += dst_wrap;
- }
-}
-
-#endif /* !FMT_RGB24 */
-
-#ifdef FMT_RGB24
-
-static void yuv444p_to_rgb24(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- const uint8_t *y1_ptr, *cb_ptr, *cr_ptr;
- uint8_t *d, *d1;
- int w, y, cb, cr, r_add, g_add, b_add;
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
- unsigned int r, g, b;
-
- d = dst->data[0];
- y1_ptr = src->data[0];
- cb_ptr = src->data[1];
- cr_ptr = src->data[2];
- for(;height > 0; height --) {
- d1 = d;
- for(w = width; w > 0; w--) {
- YUV_TO_RGB1_CCIR(cb_ptr[0], cr_ptr[0]);
-
- YUV_TO_RGB2_CCIR(r, g, b, y1_ptr[0]);
- RGB_OUT(d1, r, g, b);
- d1 += BPP;
-
- y1_ptr++;
- cb_ptr++;
- cr_ptr++;
- }
- d += dst->linesize[0];
- y1_ptr += src->linesize[0] - width;
- cb_ptr += src->linesize[1] - width;
- cr_ptr += src->linesize[2] - width;
- }
-}
-
-static void yuvj444p_to_rgb24(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- const uint8_t *y1_ptr, *cb_ptr, *cr_ptr;
- uint8_t *d, *d1;
- int w, y, cb, cr, r_add, g_add, b_add;
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
- unsigned int r, g, b;
-
- d = dst->data[0];
- y1_ptr = src->data[0];
- cb_ptr = src->data[1];
- cr_ptr = src->data[2];
- for(;height > 0; height --) {
- d1 = d;
- for(w = width; w > 0; w--) {
- YUV_TO_RGB1(cb_ptr[0], cr_ptr[0]);
-
- YUV_TO_RGB2(r, g, b, y1_ptr[0]);
- RGB_OUT(d1, r, g, b);
- d1 += BPP;
-
- y1_ptr++;
- cb_ptr++;
- cr_ptr++;
- }
- d += dst->linesize[0];
- y1_ptr += src->linesize[0] - width;
- cb_ptr += src->linesize[1] - width;
- cr_ptr += src->linesize[2] - width;
- }
-}
-
-static void rgb24_to_yuv444p(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- int src_wrap, x, y;
- int r, g, b;
- uint8_t *lum, *cb, *cr;
- const uint8_t *p;
-
- lum = dst->data[0];
- cb = dst->data[1];
- cr = dst->data[2];
-
- src_wrap = src->linesize[0] - width * BPP;
- p = src->data[0];
- for(y=0;y<height;y++) {
- for(x=0;x<width;x++) {
- RGB_IN(r, g, b, p);
- lum[0] = RGB_TO_Y_CCIR(r, g, b);
- cb[0] = RGB_TO_U_CCIR(r, g, b, 0);
- cr[0] = RGB_TO_V_CCIR(r, g, b, 0);
- p += BPP;
- cb++;
- cr++;
- lum++;
- }
- p += src_wrap;
- lum += dst->linesize[0] - width;
- cb += dst->linesize[1] - width;
- cr += dst->linesize[2] - width;
- }
-}
-
-static void rgb24_to_yuvj420p(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- int wrap, wrap3, width2;
- int r, g, b, r1, g1, b1, w;
- uint8_t *lum, *cb, *cr;
- const uint8_t *p;
-
- lum = dst->data[0];
- cb = dst->data[1];
- cr = dst->data[2];
-
- width2 = (width + 1) >> 1;
- wrap = dst->linesize[0];
- wrap3 = src->linesize[0];
- p = src->data[0];
- for(;height>=2;height -= 2) {
- for(w = width; w >= 2; w -= 2) {
- RGB_IN(r, g, b, p);
- r1 = r;
- g1 = g;
- b1 = b;
- lum[0] = RGB_TO_Y(r, g, b);
-
- RGB_IN(r, g, b, p + BPP);
- r1 += r;
- g1 += g;
- b1 += b;
- lum[1] = RGB_TO_Y(r, g, b);
- p += wrap3;
- lum += wrap;
-
- RGB_IN(r, g, b, p);
- r1 += r;
- g1 += g;
- b1 += b;
- lum[0] = RGB_TO_Y(r, g, b);
-
- RGB_IN(r, g, b, p + BPP);
- r1 += r;
- g1 += g;
- b1 += b;
- lum[1] = RGB_TO_Y(r, g, b);
-
- cb[0] = RGB_TO_U(r1, g1, b1, 2);
- cr[0] = RGB_TO_V(r1, g1, b1, 2);
-
- cb++;
- cr++;
- p += -wrap3 + 2 * BPP;
- lum += -wrap + 2;
- }
- if (w) {
- RGB_IN(r, g, b, p);
- r1 = r;
- g1 = g;
- b1 = b;
- lum[0] = RGB_TO_Y(r, g, b);
- p += wrap3;
- lum += wrap;
- RGB_IN(r, g, b, p);
- r1 += r;
- g1 += g;
- b1 += b;
- lum[0] = RGB_TO_Y(r, g, b);
- cb[0] = RGB_TO_U(r1, g1, b1, 1);
- cr[0] = RGB_TO_V(r1, g1, b1, 1);
- cb++;
- cr++;
- p += -wrap3 + BPP;
- lum += -wrap + 1;
- }
- p += wrap3 + (wrap3 - width * BPP);
- lum += wrap + (wrap - width);
- cb += dst->linesize[1] - width2;
- cr += dst->linesize[2] - width2;
- }
- /* handle odd height */
- if (height) {
- for(w = width; w >= 2; w -= 2) {
- RGB_IN(r, g, b, p);
- r1 = r;
- g1 = g;
- b1 = b;
- lum[0] = RGB_TO_Y(r, g, b);
-
- RGB_IN(r, g, b, p + BPP);
- r1 += r;
- g1 += g;
- b1 += b;
- lum[1] = RGB_TO_Y(r, g, b);
- cb[0] = RGB_TO_U(r1, g1, b1, 1);
- cr[0] = RGB_TO_V(r1, g1, b1, 1);
- cb++;
- cr++;
- p += 2 * BPP;
- lum += 2;
- }
- if (w) {
- RGB_IN(r, g, b, p);
- lum[0] = RGB_TO_Y(r, g, b);
- cb[0] = RGB_TO_U(r, g, b, 0);
- cr[0] = RGB_TO_V(r, g, b, 0);
- }
- }
-}
-
-static void rgb24_to_yuvj444p(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- int src_wrap, x, y;
- int r, g, b;
- uint8_t *lum, *cb, *cr;
- const uint8_t *p;
-
- lum = dst->data[0];
- cb = dst->data[1];
- cr = dst->data[2];
-
- src_wrap = src->linesize[0] - width * BPP;
- p = src->data[0];
- for(y=0;y<height;y++) {
- for(x=0;x<width;x++) {
- RGB_IN(r, g, b, p);
- lum[0] = RGB_TO_Y(r, g, b);
- cb[0] = RGB_TO_U(r, g, b, 0);
- cr[0] = RGB_TO_V(r, g, b, 0);
- p += BPP;
- cb++;
- cr++;
- lum++;
- }
- p += src_wrap;
- lum += dst->linesize[0] - width;
- cb += dst->linesize[1] - width;
- cr += dst->linesize[2] - width;
- }
-}
-
-#endif /* FMT_RGB24 */
-
-#if defined(FMT_RGB24) || defined(FMT_RGBA32)
-
-static void glue(RGB_NAME, _to_pal8)(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- const unsigned char *p;
- unsigned char *q;
- int dst_wrap, src_wrap;
- int x, y, has_alpha;
- unsigned int r, g, b;
-
- p = src->data[0];
- src_wrap = src->linesize[0] - BPP * width;
-
- q = dst->data[0];
- dst_wrap = dst->linesize[0] - width;
- has_alpha = 0;
-
- for(y=0;y<height;y++) {
- for(x=0;x<width;x++) {
-#ifdef RGBA_IN
- {
- unsigned int a;
- RGBA_IN(r, g, b, a, p);
- /* crude approximation for alpha ! */
- if (a < 0x80) {
- has_alpha = 1;
- q[0] = TRANSP_INDEX;
- } else {
- q[0] = gif_clut_index(r, g, b);
- }
- }
-#else
- RGB_IN(r, g, b, p);
- q[0] = gif_clut_index(r, g, b);
-#endif
- q++;
- p += BPP;
- }
- p += src_wrap;
- q += dst_wrap;
- }
-
- build_rgb_palette(dst->data[1], has_alpha);
-}
-
-#endif /* defined(FMT_RGB24) || defined(FMT_RGBA32) */
-
-#ifdef RGBA_IN
-
-static int glue(get_alpha_info_, RGB_NAME)(const AVPicture *src,
- int width, int height)
-{
- const unsigned char *p;
- int src_wrap, ret, x, y;
- unsigned int r, g, b, a;
-
- p = src->data[0];
- src_wrap = src->linesize[0] - BPP * width;
- ret = 0;
- for(y=0;y<height;y++) {
- for(x=0;x<width;x++) {
- RGBA_IN(r, g, b, a, p);
- if (a == 0x00) {
- ret |= FF_ALPHA_TRANSP;
- } else if (a != 0xff) {
- ret |= FF_ALPHA_SEMI_TRANSP;
- }
- p += BPP;
- }
- p += src_wrap;
- }
- return ret;
-}
-
-#endif /* RGBA_IN */
-
-#undef RGB_IN
-#undef RGBA_IN
-#undef RGB_OUT
-#undef RGBA_OUT
-#undef BPP
-#undef RGB_NAME
-#undef FMT_RGB24
-#undef FMT_RGBA32
diff --git a/src/libffmpeg/libavcodec/imgresample.c b/src/libffmpeg/libavcodec/imgresample.c
deleted file mode 100644
index adcfd0481..000000000
--- a/src/libffmpeg/libavcodec/imgresample.c
+++ /dev/null
@@ -1,949 +0,0 @@
-/*
- * High quality image resampling with polyphase filters
- * Copyright (c) 2001 Fabrice Bellard.
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file imgresample.c
- * High quality image resampling with polyphase filters .
- */
-
-#include "avcodec.h"
-#include "swscale.h"
-#include "dsputil.h"
-
-#ifdef USE_FASTMEMCPY
-#include "libvo/fastmemcpy.h"
-#endif
-
-#define NB_COMPONENTS 3
-
-#define PHASE_BITS 4
-#define NB_PHASES (1 << PHASE_BITS)
-#define NB_TAPS 4
-#define FCENTER 1 /* index of the center of the filter */
-//#define TEST 1 /* Test it */
-
-#define POS_FRAC_BITS 16
-#define POS_FRAC (1 << POS_FRAC_BITS)
-/* 6 bits precision is needed for MMX */
-#define FILTER_BITS 8
-
-#define LINE_BUF_HEIGHT (NB_TAPS * 4)
-
-struct SwsContext {
- struct ImgReSampleContext *resampling_ctx;
- enum PixelFormat src_pix_fmt, dst_pix_fmt;
-};
-
-struct ImgReSampleContext {
- int iwidth, iheight, owidth, oheight;
- int topBand, bottomBand, leftBand, rightBand;
- int padtop, padbottom, padleft, padright;
- int pad_owidth, pad_oheight;
- int h_incr, v_incr;
- DECLARE_ALIGNED_8(int16_t, h_filters[NB_PHASES][NB_TAPS]); /* horizontal filters */
- DECLARE_ALIGNED_8(int16_t, v_filters[NB_PHASES][NB_TAPS]); /* vertical filters */
- uint8_t *line_buf;
-};
-
-void av_build_filter(int16_t *filter, double factor, int tap_count, int phase_count, int scale, int type);
-
-static inline int get_phase(int pos)
-{
- return ((pos) >> (POS_FRAC_BITS - PHASE_BITS)) & ((1 << PHASE_BITS) - 1);
-}
-
-/* This function must be optimized */
-static void h_resample_fast(uint8_t *dst, int dst_width, const uint8_t *src,
- int src_width, int src_start, int src_incr,
- int16_t *filters)
-{
- int src_pos, phase, sum, i;
- const uint8_t *s;
- int16_t *filter;
-
- src_pos = src_start;
- for(i=0;i<dst_width;i++) {
-#ifdef TEST
- /* test */
- if ((src_pos >> POS_FRAC_BITS) < 0 ||
- (src_pos >> POS_FRAC_BITS) > (src_width - NB_TAPS))
- av_abort();
-#endif
- s = src + (src_pos >> POS_FRAC_BITS);
- phase = get_phase(src_pos);
- filter = filters + phase * NB_TAPS;
-#if NB_TAPS == 4
- sum = s[0] * filter[0] +
- s[1] * filter[1] +
- s[2] * filter[2] +
- s[3] * filter[3];
-#else
- {
- int j;
- sum = 0;
- for(j=0;j<NB_TAPS;j++)
- sum += s[j] * filter[j];
- }
-#endif
- sum = sum >> FILTER_BITS;
- if (sum < 0)
- sum = 0;
- else if (sum > 255)
- sum = 255;
- dst[0] = sum;
- src_pos += src_incr;
- dst++;
- }
-}
-
-/* This function must be optimized */
-static void v_resample(uint8_t *dst, int dst_width, const uint8_t *src,
- int wrap, int16_t *filter)
-{
- int sum, i;
- const uint8_t *s;
-
- s = src;
- for(i=0;i<dst_width;i++) {
-#if NB_TAPS == 4
- sum = s[0 * wrap] * filter[0] +
- s[1 * wrap] * filter[1] +
- s[2 * wrap] * filter[2] +
- s[3 * wrap] * filter[3];
-#else
- {
- int j;
- uint8_t *s1 = s;
-
- sum = 0;
- for(j=0;j<NB_TAPS;j++) {
- sum += s1[0] * filter[j];
- s1 += wrap;
- }
- }
-#endif
- sum = sum >> FILTER_BITS;
- if (sum < 0)
- sum = 0;
- else if (sum > 255)
- sum = 255;
- dst[0] = sum;
- dst++;
- s++;
- }
-}
-
-#ifdef HAVE_MMX
-
-#include "i386/mmx.h"
-
-#define FILTER4(reg) \
-{\
- s = src + (src_pos >> POS_FRAC_BITS);\
- phase = get_phase(src_pos);\
- filter = filters + phase * NB_TAPS;\
- movq_m2r(*s, reg);\
- punpcklbw_r2r(mm7, reg);\
- movq_m2r(*filter, mm6);\
- pmaddwd_r2r(reg, mm6);\
- movq_r2r(mm6, reg);\
- psrlq_i2r(32, reg);\
- paddd_r2r(mm6, reg);\
- psrad_i2r(FILTER_BITS, reg);\
- src_pos += src_incr;\
-}
-
-#define DUMP(reg) movq_r2m(reg, tmp); printf(#reg "=%016"PRIx64"\n", tmp.uq);
-
-/* XXX: do four pixels at a time */
-static void h_resample_fast4_mmx(uint8_t *dst, int dst_width,
- const uint8_t *src, int src_width,
- int src_start, int src_incr, int16_t *filters)
-{
- int src_pos, phase;
- const uint8_t *s;
- int16_t *filter;
- mmx_t tmp;
-
- src_pos = src_start;
- pxor_r2r(mm7, mm7);
-
- while (dst_width >= 4) {
-
- FILTER4(mm0);
- FILTER4(mm1);
- FILTER4(mm2);
- FILTER4(mm3);
-
- packuswb_r2r(mm7, mm0);
- packuswb_r2r(mm7, mm1);
- packuswb_r2r(mm7, mm3);
- packuswb_r2r(mm7, mm2);
- movq_r2m(mm0, tmp);
- dst[0] = tmp.ub[0];
- movq_r2m(mm1, tmp);
- dst[1] = tmp.ub[0];
- movq_r2m(mm2, tmp);
- dst[2] = tmp.ub[0];
- movq_r2m(mm3, tmp);
- dst[3] = tmp.ub[0];
- dst += 4;
- dst_width -= 4;
- }
- while (dst_width > 0) {
- FILTER4(mm0);
- packuswb_r2r(mm7, mm0);
- movq_r2m(mm0, tmp);
- dst[0] = tmp.ub[0];
- dst++;
- dst_width--;
- }
- emms();
-}
-
-static void v_resample4_mmx(uint8_t *dst, int dst_width, const uint8_t *src,
- int wrap, int16_t *filter)
-{
- int sum, i, v;
- const uint8_t *s;
- mmx_t tmp;
- mmx_t coefs[4];
-
- for(i=0;i<4;i++) {
- v = filter[i];
- coefs[i].uw[0] = v;
- coefs[i].uw[1] = v;
- coefs[i].uw[2] = v;
- coefs[i].uw[3] = v;
- }
-
- pxor_r2r(mm7, mm7);
- s = src;
- while (dst_width >= 4) {
- movq_m2r(s[0 * wrap], mm0);
- punpcklbw_r2r(mm7, mm0);
- movq_m2r(s[1 * wrap], mm1);
- punpcklbw_r2r(mm7, mm1);
- movq_m2r(s[2 * wrap], mm2);
- punpcklbw_r2r(mm7, mm2);
- movq_m2r(s[3 * wrap], mm3);
- punpcklbw_r2r(mm7, mm3);
-
- pmullw_m2r(coefs[0], mm0);
- pmullw_m2r(coefs[1], mm1);
- pmullw_m2r(coefs[2], mm2);
- pmullw_m2r(coefs[3], mm3);
-
- paddw_r2r(mm1, mm0);
- paddw_r2r(mm3, mm2);
- paddw_r2r(mm2, mm0);
- psraw_i2r(FILTER_BITS, mm0);
-
- packuswb_r2r(mm7, mm0);
- movq_r2m(mm0, tmp);
-
- *(uint32_t *)dst = tmp.ud[0];
- dst += 4;
- s += 4;
- dst_width -= 4;
- }
- while (dst_width > 0) {
- sum = s[0 * wrap] * filter[0] +
- s[1 * wrap] * filter[1] +
- s[2 * wrap] * filter[2] +
- s[3 * wrap] * filter[3];
- sum = sum >> FILTER_BITS;
- if (sum < 0)
- sum = 0;
- else if (sum > 255)
- sum = 255;
- dst[0] = sum;
- dst++;
- s++;
- dst_width--;
- }
- emms();
-}
-#endif
-
-#ifdef HAVE_ALTIVEC
-typedef union {
- vector unsigned char v;
- unsigned char c[16];
-} vec_uc_t;
-
-typedef union {
- vector signed short v;
- signed short s[8];
-} vec_ss_t;
-
-void v_resample16_altivec(uint8_t *dst, int dst_width, const uint8_t *src,
- int wrap, int16_t *filter)
-{
- int sum, i;
- const uint8_t *s;
- vector unsigned char *tv, tmp, dstv, zero;
- vec_ss_t srchv[4], srclv[4], fv[4];
- vector signed short zeros, sumhv, sumlv;
- s = src;
-
- for(i=0;i<4;i++)
- {
- /*
- The vec_madds later on does an implicit >>15 on the result.
- Since FILTER_BITS is 8, and we have 15 bits of magnitude in
- a signed short, we have just enough bits to pre-shift our
- filter constants <<7 to compensate for vec_madds.
- */
- fv[i].s[0] = filter[i] << (15-FILTER_BITS);
- fv[i].v = vec_splat(fv[i].v, 0);
- }
-
- zero = vec_splat_u8(0);
- zeros = vec_splat_s16(0);
-
-
- /*
- When we're resampling, we'd ideally like both our input buffers,
- and output buffers to be 16-byte aligned, so we can do both aligned
- reads and writes. Sadly we can't always have this at the moment, so
- we opt for aligned writes, as unaligned writes have a huge overhead.
- To do this, do enough scalar resamples to get dst 16-byte aligned.
- */
- i = (-(int)dst) & 0xf;
- while(i>0) {
- sum = s[0 * wrap] * filter[0] +
- s[1 * wrap] * filter[1] +
- s[2 * wrap] * filter[2] +
- s[3 * wrap] * filter[3];
- sum = sum >> FILTER_BITS;
- if (sum<0) sum = 0; else if (sum>255) sum=255;
- dst[0] = sum;
- dst++;
- s++;
- dst_width--;
- i--;
- }
-
- /* Do our altivec resampling on 16 pixels at once. */
- while(dst_width>=16) {
- /*
- Read 16 (potentially unaligned) bytes from each of
- 4 lines into 4 vectors, and split them into shorts.
- Interleave the multipy/accumulate for the resample
- filter with the loads to hide the 3 cycle latency
- the vec_madds have.
- */
- tv = (vector unsigned char *) &s[0 * wrap];
- tmp = vec_perm(tv[0], tv[1], vec_lvsl(0, &s[i * wrap]));
- srchv[0].v = (vector signed short) vec_mergeh(zero, tmp);
- srclv[0].v = (vector signed short) vec_mergel(zero, tmp);
- sumhv = vec_madds(srchv[0].v, fv[0].v, zeros);
- sumlv = vec_madds(srclv[0].v, fv[0].v, zeros);
-
- tv = (vector unsigned char *) &s[1 * wrap];
- tmp = vec_perm(tv[0], tv[1], vec_lvsl(0, &s[1 * wrap]));
- srchv[1].v = (vector signed short) vec_mergeh(zero, tmp);
- srclv[1].v = (vector signed short) vec_mergel(zero, tmp);
- sumhv = vec_madds(srchv[1].v, fv[1].v, sumhv);
- sumlv = vec_madds(srclv[1].v, fv[1].v, sumlv);
-
- tv = (vector unsigned char *) &s[2 * wrap];
- tmp = vec_perm(tv[0], tv[1], vec_lvsl(0, &s[2 * wrap]));
- srchv[2].v = (vector signed short) vec_mergeh(zero, tmp);
- srclv[2].v = (vector signed short) vec_mergel(zero, tmp);
- sumhv = vec_madds(srchv[2].v, fv[2].v, sumhv);
- sumlv = vec_madds(srclv[2].v, fv[2].v, sumlv);
-
- tv = (vector unsigned char *) &s[3 * wrap];
- tmp = vec_perm(tv[0], tv[1], vec_lvsl(0, &s[3 * wrap]));
- srchv[3].v = (vector signed short) vec_mergeh(zero, tmp);
- srclv[3].v = (vector signed short) vec_mergel(zero, tmp);
- sumhv = vec_madds(srchv[3].v, fv[3].v, sumhv);
- sumlv = vec_madds(srclv[3].v, fv[3].v, sumlv);
-
- /*
- Pack the results into our destination vector,
- and do an aligned write of that back to memory.
- */
- dstv = vec_packsu(sumhv, sumlv) ;
- vec_st(dstv, 0, (vector unsigned char *) dst);
-
- dst+=16;
- s+=16;
- dst_width-=16;
- }
-
- /*
- If there are any leftover pixels, resample them
- with the slow scalar method.
- */
- while(dst_width>0) {
- sum = s[0 * wrap] * filter[0] +
- s[1 * wrap] * filter[1] +
- s[2 * wrap] * filter[2] +
- s[3 * wrap] * filter[3];
- sum = sum >> FILTER_BITS;
- if (sum<0) sum = 0; else if (sum>255) sum=255;
- dst[0] = sum;
- dst++;
- s++;
- dst_width--;
- }
-}
-#endif
-
-/* slow version to handle limit cases. Does not need optimisation */
-static void h_resample_slow(uint8_t *dst, int dst_width,
- const uint8_t *src, int src_width,
- int src_start, int src_incr, int16_t *filters)
-{
- int src_pos, phase, sum, j, v, i;
- const uint8_t *s, *src_end;
- int16_t *filter;
-
- src_end = src + src_width;
- src_pos = src_start;
- for(i=0;i<dst_width;i++) {
- s = src + (src_pos >> POS_FRAC_BITS);
- phase = get_phase(src_pos);
- filter = filters + phase * NB_TAPS;
- sum = 0;
- for(j=0;j<NB_TAPS;j++) {
- if (s < src)
- v = src[0];
- else if (s >= src_end)
- v = src_end[-1];
- else
- v = s[0];
- sum += v * filter[j];
- s++;
- }
- sum = sum >> FILTER_BITS;
- if (sum < 0)
- sum = 0;
- else if (sum > 255)
- sum = 255;
- dst[0] = sum;
- src_pos += src_incr;
- dst++;
- }
-}
-
-static void h_resample(uint8_t *dst, int dst_width, const uint8_t *src,
- int src_width, int src_start, int src_incr,
- int16_t *filters)
-{
- int n, src_end;
-
- if (src_start < 0) {
- n = (0 - src_start + src_incr - 1) / src_incr;
- h_resample_slow(dst, n, src, src_width, src_start, src_incr, filters);
- dst += n;
- dst_width -= n;
- src_start += n * src_incr;
- }
- src_end = src_start + dst_width * src_incr;
- if (src_end > ((src_width - NB_TAPS) << POS_FRAC_BITS)) {
- n = (((src_width - NB_TAPS + 1) << POS_FRAC_BITS) - 1 - src_start) /
- src_incr;
- } else {
- n = dst_width;
- }
-#ifdef HAVE_MMX
- if ((mm_flags & MM_MMX) && NB_TAPS == 4)
- h_resample_fast4_mmx(dst, n,
- src, src_width, src_start, src_incr, filters);
- else
-#endif
- h_resample_fast(dst, n,
- src, src_width, src_start, src_incr, filters);
- if (n < dst_width) {
- dst += n;
- dst_width -= n;
- src_start += n * src_incr;
- h_resample_slow(dst, dst_width,
- src, src_width, src_start, src_incr, filters);
- }
-}
-
-static void component_resample(ImgReSampleContext *s,
- uint8_t *output, int owrap, int owidth, int oheight,
- uint8_t *input, int iwrap, int iwidth, int iheight)
-{
- int src_y, src_y1, last_src_y, ring_y, phase_y, y1, y;
- uint8_t *new_line, *src_line;
-
- last_src_y = - FCENTER - 1;
- /* position of the bottom of the filter in the source image */
- src_y = (last_src_y + NB_TAPS) * POS_FRAC;
- ring_y = NB_TAPS; /* position in ring buffer */
- for(y=0;y<oheight;y++) {
- /* apply horizontal filter on new lines from input if needed */
- src_y1 = src_y >> POS_FRAC_BITS;
- while (last_src_y < src_y1) {
- if (++ring_y >= LINE_BUF_HEIGHT + NB_TAPS)
- ring_y = NB_TAPS;
- last_src_y++;
- /* handle limit conditions : replicate line (slightly
- inefficient because we filter multiple times) */
- y1 = last_src_y;
- if (y1 < 0) {
- y1 = 0;
- } else if (y1 >= iheight) {
- y1 = iheight - 1;
- }
- src_line = input + y1 * iwrap;
- new_line = s->line_buf + ring_y * owidth;
- /* apply filter and handle limit cases correctly */
- h_resample(new_line, owidth,
- src_line, iwidth, - FCENTER * POS_FRAC, s->h_incr,
- &s->h_filters[0][0]);
- /* handle ring buffer wraping */
- if (ring_y >= LINE_BUF_HEIGHT) {
- memcpy(s->line_buf + (ring_y - LINE_BUF_HEIGHT) * owidth,
- new_line, owidth);
- }
- }
- /* apply vertical filter */
- phase_y = get_phase(src_y);
-#ifdef HAVE_MMX
- /* desactivated MMX because loss of precision */
- if ((mm_flags & MM_MMX) && NB_TAPS == 4 && 0)
- v_resample4_mmx(output, owidth,
- s->line_buf + (ring_y - NB_TAPS + 1) * owidth, owidth,
- &s->v_filters[phase_y][0]);
- else
-#endif
-#ifdef HAVE_ALTIVEC
- if ((mm_flags & MM_ALTIVEC) && NB_TAPS == 4 && FILTER_BITS <= 6)
- v_resample16_altivec(output, owidth,
- s->line_buf + (ring_y - NB_TAPS + 1) * owidth, owidth,
- &s->v_filters[phase_y][0]);
- else
-#endif
- v_resample(output, owidth,
- s->line_buf + (ring_y - NB_TAPS + 1) * owidth, owidth,
- &s->v_filters[phase_y][0]);
-
- src_y += s->v_incr;
-
- output += owrap;
- }
-}
-
-ImgReSampleContext *img_resample_init(int owidth, int oheight,
- int iwidth, int iheight)
-{
- return img_resample_full_init(owidth, oheight, iwidth, iheight,
- 0, 0, 0, 0, 0, 0, 0, 0);
-}
-
-ImgReSampleContext *img_resample_full_init(int owidth, int oheight,
- int iwidth, int iheight,
- int topBand, int bottomBand,
- int leftBand, int rightBand,
- int padtop, int padbottom,
- int padleft, int padright)
-{
- ImgReSampleContext *s;
-
- if (!owidth || !oheight || !iwidth || !iheight)
- return NULL;
-
- s = av_mallocz(sizeof(ImgReSampleContext));
- if (!s)
- return NULL;
- if((unsigned)owidth >= UINT_MAX / (LINE_BUF_HEIGHT + NB_TAPS))
- return NULL;
- s->line_buf = av_mallocz(owidth * (LINE_BUF_HEIGHT + NB_TAPS));
- if (!s->line_buf)
- goto fail;
-
- s->owidth = owidth;
- s->oheight = oheight;
- s->iwidth = iwidth;
- s->iheight = iheight;
-
- s->topBand = topBand;
- s->bottomBand = bottomBand;
- s->leftBand = leftBand;
- s->rightBand = rightBand;
-
- s->padtop = padtop;
- s->padbottom = padbottom;
- s->padleft = padleft;
- s->padright = padright;
-
- s->pad_owidth = owidth - (padleft + padright);
- s->pad_oheight = oheight - (padtop + padbottom);
-
- s->h_incr = ((iwidth - leftBand - rightBand) * POS_FRAC) / s->pad_owidth;
- s->v_incr = ((iheight - topBand - bottomBand) * POS_FRAC) / s->pad_oheight;
-
- av_build_filter(&s->h_filters[0][0], (float) s->pad_owidth /
- (float) (iwidth - leftBand - rightBand), NB_TAPS, NB_PHASES, 1<<FILTER_BITS, 0);
- av_build_filter(&s->v_filters[0][0], (float) s->pad_oheight /
- (float) (iheight - topBand - bottomBand), NB_TAPS, NB_PHASES, 1<<FILTER_BITS, 0);
-
- return s;
-fail:
- av_free(s);
- return NULL;
-}
-
-void img_resample(ImgReSampleContext *s,
- AVPicture *output, const AVPicture *input)
-{
- int i, shift;
- uint8_t* optr;
-
- for (i=0;i<3;i++) {
- shift = (i == 0) ? 0 : 1;
-
- optr = output->data[i] + (((output->linesize[i] *
- s->padtop) + s->padleft) >> shift);
-
- component_resample(s, optr, output->linesize[i],
- s->pad_owidth >> shift, s->pad_oheight >> shift,
- input->data[i] + (input->linesize[i] *
- (s->topBand >> shift)) + (s->leftBand >> shift),
- input->linesize[i], ((s->iwidth - s->leftBand -
- s->rightBand) >> shift),
- (s->iheight - s->topBand - s->bottomBand) >> shift);
- }
-}
-
-void img_resample_close(ImgReSampleContext *s)
-{
- av_free(s->line_buf);
- av_free(s);
-}
-
-struct SwsContext *sws_getContext(int srcW, int srcH, int srcFormat,
- int dstW, int dstH, int dstFormat,
- int flags, SwsFilter *srcFilter,
- SwsFilter *dstFilter, double *param)
-{
- struct SwsContext *ctx;
-
- ctx = av_malloc(sizeof(struct SwsContext));
- if (ctx == NULL) {
- av_log(NULL, AV_LOG_ERROR, "Cannot allocate a resampling context!\n");
-
- return NULL;
- }
-
- if ((srcH != dstH) || (srcW != dstW)) {
- if ((srcFormat != PIX_FMT_YUV420P) || (dstFormat != PIX_FMT_YUV420P)) {
- av_log(NULL, AV_LOG_INFO, "PIX_FMT_YUV420P will be used as an intermediate format for rescaling\n");
- }
- ctx->resampling_ctx = img_resample_init(dstW, dstH, srcW, srcH);
- } else {
- ctx->resampling_ctx = av_malloc(sizeof(ImgReSampleContext));
- ctx->resampling_ctx->iheight = srcH;
- ctx->resampling_ctx->iwidth = srcW;
- ctx->resampling_ctx->oheight = dstH;
- ctx->resampling_ctx->owidth = dstW;
- }
- ctx->src_pix_fmt = srcFormat;
- ctx->dst_pix_fmt = dstFormat;
-
- return ctx;
-}
-
-void sws_freeContext(struct SwsContext *ctx)
-{
- if (!ctx)
- return;
- if ((ctx->resampling_ctx->iwidth != ctx->resampling_ctx->owidth) ||
- (ctx->resampling_ctx->iheight != ctx->resampling_ctx->oheight)) {
- img_resample_close(ctx->resampling_ctx);
- } else {
- av_free(ctx->resampling_ctx);
- }
- av_free(ctx);
-}
-
-
-/**
- * Checks if context is valid or reallocs a new one instead.
- * If context is NULL, just calls sws_getContext() to get a new one.
- * Otherwise, checks if the parameters are the same already saved in context.
- * If that is the case, returns the current context.
- * Otherwise, frees context and gets a new one.
- *
- * Be warned that srcFilter, dstFilter are not checked, they are
- * asumed to remain valid.
- */
-struct SwsContext *sws_getCachedContext(struct SwsContext *ctx,
- int srcW, int srcH, int srcFormat,
- int dstW, int dstH, int dstFormat, int flags,
- SwsFilter *srcFilter, SwsFilter *dstFilter, double *param)
-{
- if (ctx != NULL) {
- if ((ctx->resampling_ctx->iwidth != srcW) ||
- (ctx->resampling_ctx->iheight != srcH) ||
- (ctx->src_pix_fmt != srcFormat) ||
- (ctx->resampling_ctx->owidth != dstW) ||
- (ctx->resampling_ctx->oheight != dstH) ||
- (ctx->dst_pix_fmt != dstFormat))
- {
- sws_freeContext(ctx);
- ctx = NULL;
- }
- }
- if (ctx == NULL) {
- return sws_getContext(srcW, srcH, srcFormat,
- dstW, dstH, dstFormat, flags,
- srcFilter, dstFilter, param);
- }
- return ctx;
-}
-
-int sws_scale(struct SwsContext *ctx, uint8_t* src[], int srcStride[],
- int srcSliceY, int srcSliceH, uint8_t* dst[], int dstStride[])
-{
- AVPicture src_pict, dst_pict;
- int i, res = 0;
- AVPicture picture_format_temp;
- AVPicture picture_resample_temp, *formatted_picture, *resampled_picture;
- uint8_t *buf1 = NULL, *buf2 = NULL;
- enum PixelFormat current_pix_fmt;
-
- for (i = 0; i < 4; i++) {
- src_pict.data[i] = src[i];
- src_pict.linesize[i] = srcStride[i];
- dst_pict.data[i] = dst[i];
- dst_pict.linesize[i] = dstStride[i];
- }
- if ((ctx->resampling_ctx->iwidth != ctx->resampling_ctx->owidth) ||
- (ctx->resampling_ctx->iheight != ctx->resampling_ctx->oheight)) {
- /* We have to rescale the picture, but only YUV420P rescaling is supported... */
-
- if (ctx->src_pix_fmt != PIX_FMT_YUV420P) {
- int size;
-
- /* create temporary picture for rescaling input*/
- size = avpicture_get_size(PIX_FMT_YUV420P, ctx->resampling_ctx->iwidth, ctx->resampling_ctx->iheight);
- buf1 = av_malloc(size);
- if (!buf1) {
- res = -1;
- goto the_end;
- }
- formatted_picture = &picture_format_temp;
- avpicture_fill((AVPicture*)formatted_picture, buf1,
- PIX_FMT_YUV420P, ctx->resampling_ctx->iwidth, ctx->resampling_ctx->iheight);
-
- if (img_convert((AVPicture*)formatted_picture, PIX_FMT_YUV420P,
- &src_pict, ctx->src_pix_fmt,
- ctx->resampling_ctx->iwidth, ctx->resampling_ctx->iheight) < 0) {
-
- av_log(NULL, AV_LOG_ERROR, "pixel format conversion not handled\n");
- res = -1;
- goto the_end;
- }
- } else {
- formatted_picture = &src_pict;
- }
-
- if (ctx->dst_pix_fmt != PIX_FMT_YUV420P) {
- int size;
-
- /* create temporary picture for rescaling output*/
- size = avpicture_get_size(PIX_FMT_YUV420P, ctx->resampling_ctx->owidth, ctx->resampling_ctx->oheight);
- buf2 = av_malloc(size);
- if (!buf2) {
- res = -1;
- goto the_end;
- }
- resampled_picture = &picture_resample_temp;
- avpicture_fill((AVPicture*)resampled_picture, buf2,
- PIX_FMT_YUV420P, ctx->resampling_ctx->owidth, ctx->resampling_ctx->oheight);
-
- } else {
- resampled_picture = &dst_pict;
- }
-
- /* ...and finally rescale!!! */
- img_resample(ctx->resampling_ctx, resampled_picture, formatted_picture);
- current_pix_fmt = PIX_FMT_YUV420P;
- } else {
- resampled_picture = &src_pict;
- current_pix_fmt = ctx->src_pix_fmt;
- }
-
- if (current_pix_fmt != ctx->dst_pix_fmt) {
- if (img_convert(&dst_pict, ctx->dst_pix_fmt,
- resampled_picture, current_pix_fmt,
- ctx->resampling_ctx->owidth, ctx->resampling_ctx->oheight) < 0) {
-
- av_log(NULL, AV_LOG_ERROR, "pixel format conversion not handled\n");
-
- res = -1;
- goto the_end;
- }
- } else if (resampled_picture != &dst_pict) {
- img_copy(&dst_pict, resampled_picture, current_pix_fmt,
- ctx->resampling_ctx->owidth, ctx->resampling_ctx->oheight);
- }
-
-the_end:
- av_free(buf1);
- av_free(buf2);
- return res;
-}
-
-
-#ifdef TEST
-#include <stdio.h>
-
-/* input */
-#define XSIZE 256
-#define YSIZE 256
-uint8_t img[XSIZE * YSIZE];
-
-/* output */
-#define XSIZE1 512
-#define YSIZE1 512
-uint8_t img1[XSIZE1 * YSIZE1];
-uint8_t img2[XSIZE1 * YSIZE1];
-
-void save_pgm(const char *filename, uint8_t *img, int xsize, int ysize)
-{
-#undef fprintf
- FILE *f;
- f=fopen(filename,"w");
- fprintf(f,"P5\n%d %d\n%d\n", xsize, ysize, 255);
- fwrite(img,1, xsize * ysize,f);
- fclose(f);
-#define fprintf please_use_av_log
-}
-
-static void dump_filter(int16_t *filter)
-{
- int i, ph;
-
- for(ph=0;ph<NB_PHASES;ph++) {
- av_log(NULL, AV_LOG_INFO, "%2d: ", ph);
- for(i=0;i<NB_TAPS;i++) {
- av_log(NULL, AV_LOG_INFO, " %5.2f", filter[ph * NB_TAPS + i] / 256.0);
- }
- av_log(NULL, AV_LOG_INFO, "\n");
- }
-}
-
-#ifdef HAVE_MMX
-int mm_flags;
-#endif
-
-int main(int argc, char **argv)
-{
- int x, y, v, i, xsize, ysize;
- ImgReSampleContext *s;
- float fact, factors[] = { 1/2.0, 3.0/4.0, 1.0, 4.0/3.0, 16.0/9.0, 2.0 };
- char buf[256];
-
- /* build test image */
- for(y=0;y<YSIZE;y++) {
- for(x=0;x<XSIZE;x++) {
- if (x < XSIZE/2 && y < YSIZE/2) {
- if (x < XSIZE/4 && y < YSIZE/4) {
- if ((x % 10) <= 6 &&
- (y % 10) <= 6)
- v = 0xff;
- else
- v = 0x00;
- } else if (x < XSIZE/4) {
- if (x & 1)
- v = 0xff;
- else
- v = 0;
- } else if (y < XSIZE/4) {
- if (y & 1)
- v = 0xff;
- else
- v = 0;
- } else {
- if (y < YSIZE*3/8) {
- if ((y+x) & 1)
- v = 0xff;
- else
- v = 0;
- } else {
- if (((x+3) % 4) <= 1 &&
- ((y+3) % 4) <= 1)
- v = 0xff;
- else
- v = 0x00;
- }
- }
- } else if (x < XSIZE/2) {
- v = ((x - (XSIZE/2)) * 255) / (XSIZE/2);
- } else if (y < XSIZE/2) {
- v = ((y - (XSIZE/2)) * 255) / (XSIZE/2);
- } else {
- v = ((x + y - XSIZE) * 255) / XSIZE;
- }
- img[(YSIZE - y) * XSIZE + (XSIZE - x)] = v;
- }
- }
- save_pgm("/tmp/in.pgm", img, XSIZE, YSIZE);
- for(i=0;i<sizeof(factors)/sizeof(float);i++) {
- fact = factors[i];
- xsize = (int)(XSIZE * fact);
- ysize = (int)((YSIZE - 100) * fact);
- s = img_resample_full_init(xsize, ysize, XSIZE, YSIZE, 50 ,50, 0, 0, 0, 0, 0, 0);
- av_log(NULL, AV_LOG_INFO, "Factor=%0.2f\n", fact);
- dump_filter(&s->h_filters[0][0]);
- component_resample(s, img1, xsize, xsize, ysize,
- img + 50 * XSIZE, XSIZE, XSIZE, YSIZE - 100);
- img_resample_close(s);
-
- snprintf(buf, sizeof(buf), "/tmp/out%d.pgm", i);
- save_pgm(buf, img1, xsize, ysize);
- }
-
- /* mmx test */
-#ifdef HAVE_MMX
- av_log(NULL, AV_LOG_INFO, "MMX test\n");
- fact = 0.72;
- xsize = (int)(XSIZE * fact);
- ysize = (int)(YSIZE * fact);
- mm_flags = MM_MMX;
- s = img_resample_init(xsize, ysize, XSIZE, YSIZE);
- component_resample(s, img1, xsize, xsize, ysize,
- img, XSIZE, XSIZE, YSIZE);
-
- mm_flags = 0;
- s = img_resample_init(xsize, ysize, XSIZE, YSIZE);
- component_resample(s, img2, xsize, xsize, ysize,
- img, XSIZE, XSIZE, YSIZE);
- if (memcmp(img1, img2, xsize * ysize) != 0) {
- av_log(NULL, AV_LOG_ERROR, "mmx error\n");
- exit(1);
- }
- av_log(NULL, AV_LOG_INFO, "MMX OK\n");
-#endif
- return 0;
-}
-
-#endif
diff --git a/src/libffmpeg/libavcodec/indeo2.c b/src/libffmpeg/libavcodec/indeo2.c
deleted file mode 100644
index f3917ff3a..000000000
--- a/src/libffmpeg/libavcodec/indeo2.c
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * Intel Indeo 2 codec
- * Copyright (c) 2005 Konstantin Shishkov
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file indeo2.c
- * Intel Indeo 2 decoder.
- */
-#define ALT_BITSTREAM_READER_LE
-#include "avcodec.h"
-#include "bitstream.h"
-#include "indeo2data.h"
-
-typedef struct Ir2Context{
- AVCodecContext *avctx;
- AVFrame picture;
- GetBitContext gb;
- int decode_delta;
-} Ir2Context;
-
-#define CODE_VLC_BITS 14
-static VLC ir2_vlc;
-
-/* Indeo 2 codes are in range 0x01..0x7F and 0x81..0x90 */
-static inline int ir2_get_code(GetBitContext *gb)
-{
- return get_vlc2(gb, ir2_vlc.table, CODE_VLC_BITS, 1) + 1;
-}
-
-static int ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *dst, int stride,
- const uint8_t *table)
-{
- int i;
- int j;
- int out = 0;
- int c;
- int t;
-
- if(width&1)
- return -1;
-
- /* first line contain absolute values, other lines contain deltas */
- while (out < width){
- c = ir2_get_code(&ctx->gb);
- if(c >= 0x80) { /* we have a run */
- c -= 0x7F;
- if(out + c*2 > width)
- return -1;
- for (i = 0; i < c * 2; i++)
- dst[out++] = 0x80;
- } else { /* copy two values from table */
- dst[out++] = table[c * 2];
- dst[out++] = table[(c * 2) + 1];
- }
- }
- dst += stride;
-
- for (j = 1; j < height; j++){
- out = 0;
- while (out < width){
- c = ir2_get_code(&ctx->gb);
- if(c >= 0x80) { /* we have a skip */
- c -= 0x7F;
- if(out + c*2 > width)
- return -1;
- for (i = 0; i < c * 2; i++) {
- dst[out] = dst[out - stride];
- out++;
- }
- } else { /* add two deltas from table */
- t = dst[out - stride] + (table[c * 2] - 128);
- t= clip_uint8(t);
- dst[out] = t;
- out++;
- t = dst[out - stride] + (table[(c * 2) + 1] - 128);
- t= clip_uint8(t);
- dst[out] = t;
- out++;
- }
- }
- dst += stride;
- }
- return 0;
-}
-
-static int ir2_decode_plane_inter(Ir2Context *ctx, int width, int height, uint8_t *dst, int stride,
- const uint8_t *table)
-{
- int j;
- int out = 0;
- int c;
- int t;
-
- if(width&1)
- return -1;
-
- for (j = 0; j < height; j++){
- out = 0;
- while (out < width){
- c = ir2_get_code(&ctx->gb);
- if(c >= 0x80) { /* we have a skip */
- c -= 0x7F;
- out += c * 2;
- } else { /* add two deltas from table */
- t = dst[out] + (((table[c * 2] - 128)*3) >> 2);
- t= clip_uint8(t);
- dst[out] = t;
- out++;
- t = dst[out] + (((table[(c * 2) + 1] - 128)*3) >> 2);
- t= clip_uint8(t);
- dst[out] = t;
- out++;
- }
- }
- dst += stride;
- }
- return 0;
-}
-
-static int ir2_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- Ir2Context * const s = avctx->priv_data;
- AVFrame *picture = data;
- AVFrame * const p= (AVFrame*)&s->picture;
- int start;
-
- if(p->data[0])
- avctx->release_buffer(avctx, p);
-
- p->reference = 1;
- p->buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
- if (avctx->reget_buffer(avctx, p)) {
- av_log(s->avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
- return -1;
- }
-
- s->decode_delta = buf[18];
-
- /* decide whether frame uses deltas or not */
-#ifndef ALT_BITSTREAM_READER_LE
- for (i = 0; i < buf_size; i++)
- buf[i] = ff_reverse[buf[i]];
-#endif
- start = 48; /* hardcoded for now */
-
- init_get_bits(&s->gb, buf + start, buf_size - start);
-
- if (s->decode_delta) { /* intraframe */
- ir2_decode_plane(s, avctx->width, avctx->height,
- s->picture.data[0], s->picture.linesize[0], ir2_luma_table);
- /* swapped U and V */
- ir2_decode_plane(s, avctx->width >> 2, avctx->height >> 2,
- s->picture.data[2], s->picture.linesize[2], ir2_luma_table);
- ir2_decode_plane(s, avctx->width >> 2, avctx->height >> 2,
- s->picture.data[1], s->picture.linesize[1], ir2_luma_table);
- } else { /* interframe */
- ir2_decode_plane_inter(s, avctx->width, avctx->height,
- s->picture.data[0], s->picture.linesize[0], ir2_luma_table);
- /* swapped U and V */
- ir2_decode_plane_inter(s, avctx->width >> 2, avctx->height >> 2,
- s->picture.data[2], s->picture.linesize[2], ir2_luma_table);
- ir2_decode_plane_inter(s, avctx->width >> 2, avctx->height >> 2,
- s->picture.data[1], s->picture.linesize[1], ir2_luma_table);
- }
-
- *picture= *(AVFrame*)&s->picture;
- *data_size = sizeof(AVPicture);
-
- return buf_size;
-}
-
-static int ir2_decode_init(AVCodecContext *avctx){
- Ir2Context * const ic = avctx->priv_data;
-
- ic->avctx = avctx;
-
- avctx->pix_fmt= PIX_FMT_YUV410P;
-
- if (!ir2_vlc.table)
- init_vlc(&ir2_vlc, CODE_VLC_BITS, IR2_CODES,
- &ir2_codes[0][1], 4, 2,
-#ifdef ALT_BITSTREAM_READER_LE
- &ir2_codes[0][0], 4, 2, INIT_VLC_USE_STATIC | INIT_VLC_LE);
-#else
- &ir2_codes[0][0], 4, 2, INIT_VLC_USE_STATIC);
-#endif
-
- return 0;
-}
-
-AVCodec indeo2_decoder = {
- "indeo2",
- CODEC_TYPE_VIDEO,
- CODEC_ID_INDEO2,
- sizeof(Ir2Context),
- ir2_decode_init,
- NULL,
- NULL,
- ir2_decode_frame,
- CODEC_CAP_DR1,
-};
diff --git a/src/libffmpeg/libavcodec/indeo2data.h b/src/libffmpeg/libavcodec/indeo2data.h
deleted file mode 100644
index 71d250af7..000000000
--- a/src/libffmpeg/libavcodec/indeo2data.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Intel Indeo 2 codec
- * copyright (c) 2005 Konstantin Shishkov
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#define IR2_CODES 143
-static const uint16_t ir2_codes[IR2_CODES][2] = {
-#ifdef ALT_BITSTREAM_READER_LE
-{0x0000, 3}, {0x0004, 3}, {0x0006, 3}, {0x0001, 5},
-{0x0009, 5}, {0x0019, 5}, {0x000D, 5}, {0x001D, 5},
-{0x0023, 6}, {0x0013, 6}, {0x0033, 6}, {0x000B, 6},
-{0x002B, 6}, {0x001B, 6}, {0x0007, 8}, {0x0087, 8},
-{0x0027, 8}, {0x00A7, 8}, {0x0067, 8}, {0x00E7, 8},
-{0x0097, 8}, {0x0057, 8}, {0x0037, 8}, {0x00B7, 8},
-{0x00F7, 8}, {0x000F, 9}, {0x008F, 9}, {0x018F, 9},
-{0x014F, 9}, {0x00CF, 9}, {0x002F, 9}, {0x012F, 9},
-{0x01AF, 9}, {0x006F, 9}, {0x00EF, 9}, {0x01EF, 9},
-{0x001F, 10}, {0x021F, 10}, {0x011F, 10}, {0x031F, 10},
-{0x009F, 10}, {0x029F, 10}, {0x019F, 10}, {0x039F, 10},
-{0x005F, 10}, {0x025F, 10}, {0x015F, 10}, {0x035F, 10},
-{0x00DF, 10}, {0x02DF, 10}, {0x01DF, 10}, {0x03DF, 10},
-{0x003F, 13}, {0x103F, 13}, {0x083F, 13}, {0x183F, 13},
-{0x043F, 13}, {0x143F, 13}, {0x0C3F, 13}, {0x1C3F, 13},
-{0x023F, 13}, {0x123F, 13}, {0x0A3F, 13}, {0x1A3F, 13},
-{0x063F, 13}, {0x163F, 13}, {0x0E3F, 13}, {0x1E3F, 13},
-{0x013F, 13}, {0x113F, 13}, {0x093F, 13}, {0x193F, 13},
-{0x053F, 13}, {0x153F, 13}, {0x0D3F, 13}, {0x1D3F, 13},
-{0x033F, 13}, {0x133F, 13}, {0x0B3F, 13}, {0x1B3F, 13},
-{0x073F, 13}, {0x173F, 13}, {0x0F3F, 13}, {0x1F3F, 13},
-{0x00BF, 13}, {0x10BF, 13}, {0x08BF, 13}, {0x18BF, 13},
-{0x04BF, 13}, {0x14BF, 13}, {0x0CBF, 13}, {0x1CBF, 13},
-{0x02BF, 13}, {0x12BF, 13}, {0x0ABF, 13}, {0x1ABF, 13},
-{0x06BF, 13}, {0x16BF, 13}, {0x0EBF, 13}, {0x1EBF, 13},
-{0x01BF, 13}, {0x11BF, 13}, {0x09BF, 13}, {0x19BF, 13},
-{0x05BF, 13}, {0x15BF, 13}, {0x0DBF, 13}, {0x1DBF, 13},
-{0x03BF, 13}, {0x13BF, 13}, {0x0BBF, 13}, {0x1BBF, 13},
-{0x07BF, 13}, {0x17BF, 13}, {0x0FBF, 13}, {0x1FBF, 13},
-{0x007F, 14}, {0x207F, 14}, {0x107F, 14}, {0x307F, 14},
-{0x087F, 14}, {0x287F, 14}, {0x187F, 14}, {0x387F, 14},
-{0x047F, 14}, {0x247F, 14}, {0x147F, 14}, {0x0002, 3},
-{0x0011, 5}, {0x0005, 5}, {0x0015, 5}, {0x0003, 6},
-{0x003B, 6}, {0x0047, 8}, {0x00C7, 8}, {0x0017, 8},
-{0x00D7, 8}, {0x0077, 8}, {0x010F, 9}, {0x004F, 9},
-{0x01CF, 9}, {0x00AF, 9}, {0x016F, 9},
-#else
- {0x0000, 3}, {0x0001, 3}, {0x0003, 3}, {0x0010, 5},
- {0x0012, 5}, {0x0013, 5}, {0x0016, 5}, {0x0017, 5},
- {0x0031, 6}, {0x0032, 6}, {0x0033, 6}, {0x0034, 6},
- {0x0035, 6}, {0x0036, 6}, {0x00E0, 8}, {0x00E1, 8},
- {0x00E4, 8}, {0x00E5, 8}, {0x00E6, 8}, {0x00E7, 8},
- {0x00E9, 8}, {0x00EA, 8}, {0x00EC, 8}, {0x00ED, 8},
- {0x00EF, 8}, {0x01E0, 9}, {0x01E2, 9}, {0x01E3, 9},
- {0x01E5, 9}, {0x01E6, 9}, {0x01E8, 9}, {0x01E9, 9},
- {0x01EB, 9}, {0x01EC, 9}, {0x01EE, 9}, {0x01EF, 9},
- {0x03E0, 10}, {0x03E1, 10}, {0x03E2, 10}, {0x03E3, 10},
- {0x03E4, 10}, {0x03E5, 10}, {0x03E6, 10}, {0x03E7, 10},
- {0x03E8, 10}, {0x03E9, 10}, {0x03EA, 10}, {0x03EB, 10},
- {0x03EC, 10}, {0x03ED, 10}, {0x03EE, 10}, {0x03EF, 10},
- {0x1F80, 13}, {0x1F81, 13}, {0x1F82, 13}, {0x1F83, 13},
- {0x1F84, 13}, {0x1F85, 13}, {0x1F86, 13}, {0x1F87, 13},
- {0x1F88, 13}, {0x1F89, 13}, {0x1F8A, 13}, {0x1F8B, 13},
- {0x1F8C, 13}, {0x1F8D, 13}, {0x1F8E, 13}, {0x1F8F, 13},
- {0x1F90, 13}, {0x1F91, 13}, {0x1F92, 13}, {0x1F93, 13},
- {0x1F94, 13}, {0x1F95, 13}, {0x1F96, 13}, {0x1F97, 13},
- {0x1F98, 13}, {0x1F99, 13}, {0x1F9A, 13}, {0x1F9B, 13},
- {0x1F9C, 13}, {0x1F9D, 13}, {0x1F9E, 13}, {0x1F9F, 13},
- {0x1FA0, 13}, {0x1FA1, 13}, {0x1FA2, 13}, {0x1FA3, 13},
- {0x1FA4, 13}, {0x1FA5, 13}, {0x1FA6, 13}, {0x1FA7, 13},
- {0x1FA8, 13}, {0x1FA9, 13}, {0x1FAA, 13}, {0x1FAB, 13},
- {0x1FAC, 13}, {0x1FAD, 13}, {0x1FAE, 13}, {0x1FAF, 13},
- {0x1FB0, 13}, {0x1FB1, 13}, {0x1FB2, 13}, {0x1FB3, 13},
- {0x1FB4, 13}, {0x1FB5, 13}, {0x1FB6, 13}, {0x1FB7, 13},
- {0x1FB8, 13}, {0x1FB9, 13}, {0x1FBA, 13}, {0x1FBB, 13},
- {0x1FBC, 13}, {0x1FBD, 13}, {0x1FBE, 13}, {0x1FBF, 13},
- {0x3F80, 14}, {0x3F81, 14}, {0x3F82, 14}, {0x3F83, 14},
- {0x3F84, 14}, {0x3F85, 14}, {0x3F86, 14}, {0x3F87, 14},
- {0x3F88, 14}, {0x3F89, 14}, {0x3F8A, 14}, {0x0002, 3},
- {0x0011, 5}, {0x0014, 5}, {0x0015, 5}, {0x0030, 6},
- {0x0037, 6}, {0x00E2, 8}, {0x00E3, 8}, {0x00E8, 8},
- {0x00EB, 8}, {0x00EE, 8}, {0x01E1, 9}, {0x01E4, 9},
- {0x01E7, 9}, {0x01EA, 9}, {0x01ED, 9}
-#endif
-};
-
-static const uint8_t ir2_luma_table[256] = {
- 0x80, 0x80, 0x84, 0x84, 0x7C, 0x7C, 0x7F, 0x85,
- 0x81, 0x7B, 0x85, 0x7F, 0x7B, 0x81, 0x8C, 0x8C,
- 0x74, 0x74, 0x83, 0x8D, 0x7D, 0x73, 0x8D, 0x83,
- 0x73, 0x7D, 0x77, 0x89, 0x89, 0x77, 0x89, 0x77,
- 0x77, 0x89, 0x8C, 0x95, 0x74, 0x6B, 0x95, 0x8C,
- 0x6B, 0x74, 0x7C, 0x90, 0x84, 0x70, 0x90, 0x7C,
- 0x70, 0x84, 0x96, 0x96, 0x6A, 0x6A, 0x82, 0x98,
- 0x7E, 0x68, 0x98, 0x82, 0x68, 0x7E, 0x97, 0xA2,
- 0x69, 0x5E, 0xA2, 0x97, 0x5E, 0x69, 0xA2, 0xA2,
- 0x5E, 0x5E, 0x8B, 0xA3, 0x75, 0x5D, 0xA3, 0x8B,
- 0x5D, 0x75, 0x71, 0x95, 0x8F, 0x6B, 0x95, 0x71,
- 0x6B, 0x8F, 0x78, 0x9D, 0x88, 0x63, 0x9D, 0x78,
- 0x63, 0x88, 0x7F, 0xA7, 0x81, 0x59, 0xA7, 0x7F,
- 0x59, 0x81, 0xA4, 0xB1, 0x5C, 0x4F, 0xB1, 0xA4,
- 0x4F, 0x5C, 0x96, 0xB1, 0x6A, 0x4F, 0xB1, 0x96,
- 0x4F, 0x6A, 0xB2, 0xB2, 0x4E, 0x4E, 0x65, 0x9B,
- 0x9B, 0x65, 0x9B, 0x65, 0x65, 0x9B, 0x89, 0xB4,
- 0x77, 0x4C, 0xB4, 0x89, 0x4C, 0x77, 0x6A, 0xA3,
- 0x96, 0x5D, 0xA3, 0x6A, 0x5D, 0x96, 0x73, 0xAC,
- 0x8D, 0x54, 0xAC, 0x73, 0x54, 0x8D, 0xB4, 0xC3,
- 0x4C, 0x3D, 0xC3, 0xB4, 0x3D, 0x4C, 0xA4, 0xC3,
- 0x5C, 0x3D, 0xC3, 0xA4, 0x3D, 0x5C, 0xC4, 0xC4,
- 0x3C, 0x3C, 0x96, 0xC6, 0x6A, 0x3A, 0xC6, 0x96,
- 0x3A, 0x6A, 0x7C, 0xBA, 0x84, 0x46, 0xBA, 0x7C,
- 0x46, 0x84, 0x5B, 0xAB, 0xA5, 0x55, 0xAB, 0x5B,
- 0x55, 0xA5, 0x63, 0xB4, 0x9D, 0x4C, 0xB4, 0x63,
- 0x4C, 0x9D, 0x86, 0xCA, 0x7A, 0x36, 0xCA, 0x86,
- 0x36, 0x7A, 0xB6, 0xD7, 0x4A, 0x29, 0xD7, 0xB6,
- 0x29, 0x4A, 0xC8, 0xD7, 0x38, 0x29, 0xD7, 0xC8,
- 0x29, 0x38, 0xA4, 0xD8, 0x5C, 0x28, 0xD8, 0xA4,
- 0x28, 0x5C, 0x6C, 0xC1, 0x94, 0x3F, 0xC1, 0x6C,
- 0x3F, 0x94, 0xD9, 0xD9, 0x27, 0x27, 0x80, 0x80
-};
diff --git a/src/libffmpeg/libavcodec/indeo3.c b/src/libffmpeg/libavcodec/indeo3.c
deleted file mode 100644
index 33dcff820..000000000
--- a/src/libffmpeg/libavcodec/indeo3.c
+++ /dev/null
@@ -1,1153 +0,0 @@
-/*
- * Intel Indeo 3 (IV31, IV32, etc.) video decoder for ffmpeg
- * written, produced, and directed by Alan Smithee
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "common.h"
-#include "avcodec.h"
-#include "dsputil.h"
-#include "mpegvideo.h"
-
-#include "indeo3data.h"
-
-typedef struct
-{
- unsigned char *Ybuf;
- unsigned char *Ubuf;
- unsigned char *Vbuf;
- unsigned char *the_buf;
- unsigned int the_buf_size;
- unsigned short y_w, y_h;
- unsigned short uv_w, uv_h;
-} YUVBufs;
-
-typedef struct Indeo3DecodeContext {
- AVCodecContext *avctx;
- int width, height;
- AVFrame frame;
-
- YUVBufs iv_frame[2];
- YUVBufs *cur_frame;
- YUVBufs *ref_frame;
-
- unsigned char *ModPred;
- unsigned short *corrector_type;
-} Indeo3DecodeContext;
-
-static int corrector_type_0[24] = {
- 195, 159, 133, 115, 101, 93, 87, 77,
- 195, 159, 133, 115, 101, 93, 87, 77,
- 128, 79, 79, 79, 79, 79, 79, 79
-};
-
-static int corrector_type_2[8] = { 9, 7, 6, 8, 5, 4, 3, 2 };
-
-static void build_modpred(Indeo3DecodeContext *s)
-{
- int i, j;
-
- s->ModPred = (unsigned char *) av_malloc (8 * 128);
-
- for (i=0; i < 128; ++i) {
- s->ModPred[i+0*128] = (i > 126) ? 254 : 2*((i + 1) - ((i + 1) % 2));
- s->ModPred[i+1*128] = (i == 7) ? 20 : ((i == 119 || i == 120)
- ? 236 : 2*((i + 2) - ((i + 1) % 3)));
- s->ModPred[i+2*128] = (i > 125) ? 248 : 2*((i + 2) - ((i + 2) % 4));
- s->ModPred[i+3*128] = 2*((i + 1) - ((i - 3) % 5));
- s->ModPred[i+4*128] = (i == 8) ? 20 : 2*((i + 1) - ((i - 3) % 6));
- s->ModPred[i+5*128] = 2*((i + 4) - ((i + 3) % 7));
- s->ModPred[i+6*128] = (i > 123) ? 240 : 2*((i + 4) - ((i + 4) % 8));
- s->ModPred[i+7*128] = 2*((i + 5) - ((i + 4) % 9));
- }
-
- s->corrector_type = (unsigned short *) av_malloc (24 * 256 * sizeof(unsigned short));
-
- for (i=0; i < 24; ++i) {
- for (j=0; j < 256; ++j) {
- s->corrector_type[i*256+j] = (j < corrector_type_0[i])
- ? 1 : ((j < 248 || (i == 16 && j == 248))
- ? 0 : corrector_type_2[j - 248]);
- }
- }
-}
-
-static void iv_Decode_Chunk(Indeo3DecodeContext *s, unsigned char *cur,
- unsigned char *ref, int width, int height, unsigned char *buf1,
- long fflags2, unsigned char *hdr,
- unsigned char *buf2, int min_width_160);
-
-#ifndef min
-#define min(a,b) ((a) < (b) ? (a) : (b))
-#endif
-
-/* ---------------------------------------------------------------------- */
-static void iv_alloc_frames(Indeo3DecodeContext *s)
-{
- int luma_width, luma_height, luma_pixels, chroma_width, chroma_height,
- chroma_pixels, i;
- unsigned int bufsize;
-
- luma_width = (s->width + 3) & (~3);
- luma_height = (s->height + 3) & (~3);
-
- s->iv_frame[0].y_w = s->iv_frame[0].y_h =
- s->iv_frame[0].the_buf_size = 0;
- s->iv_frame[1].y_w = s->iv_frame[1].y_h =
- s->iv_frame[1].the_buf_size = 0;
- s->iv_frame[1].the_buf = NULL;
-
- chroma_width = ((luma_width >> 2) + 3) & (~3);
- chroma_height = ((luma_height>> 2) + 3) & (~3);
- luma_pixels = luma_width * luma_height;
- chroma_pixels = chroma_width * chroma_height;
-
- bufsize = luma_pixels * 2 + luma_width * 3 +
- (chroma_pixels + chroma_width) * 4;
-
- if((s->iv_frame[0].the_buf =
- (s->iv_frame[0].the_buf_size == 0 ? av_malloc(bufsize) :
- av_realloc(s->iv_frame[0].the_buf, bufsize))) == NULL)
- return;
- s->iv_frame[0].y_w = s->iv_frame[1].y_w = luma_width;
- s->iv_frame[0].y_h = s->iv_frame[1].y_h = luma_height;
- s->iv_frame[0].uv_w = s->iv_frame[1].uv_w = chroma_width;
- s->iv_frame[0].uv_h = s->iv_frame[1].uv_h = chroma_height;
- s->iv_frame[0].the_buf_size = bufsize;
-
- s->iv_frame[0].Ybuf = s->iv_frame[0].the_buf + luma_width;
- i = luma_pixels + luma_width * 2;
- s->iv_frame[1].Ybuf = s->iv_frame[0].the_buf + i;
- i += (luma_pixels + luma_width);
- s->iv_frame[0].Ubuf = s->iv_frame[0].the_buf + i;
- i += (chroma_pixels + chroma_width);
- s->iv_frame[1].Ubuf = s->iv_frame[0].the_buf + i;
- i += (chroma_pixels + chroma_width);
- s->iv_frame[0].Vbuf = s->iv_frame[0].the_buf + i;
- i += (chroma_pixels + chroma_width);
- s->iv_frame[1].Vbuf = s->iv_frame[0].the_buf + i;
-
- for(i = 1; i <= luma_width; i++)
- s->iv_frame[0].Ybuf[-i] = s->iv_frame[1].Ybuf[-i] =
- s->iv_frame[0].Ubuf[-i] = 0x80;
-
- for(i = 1; i <= chroma_width; i++) {
- s->iv_frame[1].Ubuf[-i] = 0x80;
- s->iv_frame[0].Vbuf[-i] = 0x80;
- s->iv_frame[1].Vbuf[-i] = 0x80;
- s->iv_frame[1].Vbuf[chroma_pixels+i-1] = 0x80;
- }
-}
-
-/* ---------------------------------------------------------------------- */
-static void iv_free_func(Indeo3DecodeContext *s)
-{
- int i;
-
- for(i = 0 ; i < 2 ; i++) {
- if(s->iv_frame[i].the_buf != NULL)
- av_free(s->iv_frame[i].the_buf);
- s->iv_frame[i].Ybuf = s->iv_frame[i].Ubuf =
- s->iv_frame[i].Vbuf = NULL;
- s->iv_frame[i].the_buf = NULL;
- s->iv_frame[i].the_buf_size = 0;
- s->iv_frame[i].y_w = s->iv_frame[i].y_h = 0;
- s->iv_frame[i].uv_w = s->iv_frame[i].uv_h = 0;
- }
-
- av_free(s->ModPred);
- av_free(s->corrector_type);
-}
-
-/* ---------------------------------------------------------------------- */
-static unsigned long iv_decode_frame(Indeo3DecodeContext *s,
- unsigned char *buf, int buf_size)
-{
- unsigned int hdr_width, hdr_height,
- chroma_width, chroma_height;
- unsigned long fflags1, fflags2, fflags3, offs1, offs2, offs3, offs;
- unsigned char *hdr_pos, *buf_pos;
-
- buf_pos = buf;
- buf_pos += 18;
-
- fflags1 = le2me_16(*(uint16_t *)buf_pos);
- buf_pos += 2;
- fflags3 = le2me_32(*(uint32_t *)buf_pos);
- buf_pos += 4;
- fflags2 = *buf_pos++;
- buf_pos += 3;
- hdr_height = le2me_16(*(uint16_t *)buf_pos);
- buf_pos += 2;
- hdr_width = le2me_16(*(uint16_t *)buf_pos);
-
- if(avcodec_check_dimensions(NULL, hdr_width, hdr_height))
- return -1;
-
- buf_pos += 2;
- chroma_height = ((hdr_height >> 2) + 3) & 0x7ffc;
- chroma_width = ((hdr_width >> 2) + 3) & 0x7ffc;
- offs1 = le2me_32(*(uint32_t *)buf_pos);
- buf_pos += 4;
- offs2 = le2me_32(*(uint32_t *)buf_pos);
- buf_pos += 4;
- offs3 = le2me_32(*(uint32_t *)buf_pos);
- buf_pos += 8;
- hdr_pos = buf_pos;
- if(fflags3 == 0x80) return 4;
-
- if(fflags1 & 0x200) {
- s->cur_frame = s->iv_frame + 1;
- s->ref_frame = s->iv_frame;
- } else {
- s->cur_frame = s->iv_frame;
- s->ref_frame = s->iv_frame + 1;
- }
-
- buf_pos = buf + 16 + offs1;
- offs = le2me_32(*(uint32_t *)buf_pos);
- buf_pos += 4;
-
- iv_Decode_Chunk(s, s->cur_frame->Ybuf, s->ref_frame->Ybuf, hdr_width,
- hdr_height, buf_pos + offs * 2, fflags2, hdr_pos, buf_pos,
- min(hdr_width, 160));
-
- if (!(s->avctx->flags & CODEC_FLAG_GRAY))
- {
-
- buf_pos = buf + 16 + offs2;
- offs = le2me_32(*(uint32_t *)buf_pos);
- buf_pos += 4;
-
- iv_Decode_Chunk(s, s->cur_frame->Vbuf, s->ref_frame->Vbuf, chroma_width,
- chroma_height, buf_pos + offs * 2, fflags2, hdr_pos, buf_pos,
- min(chroma_width, 40));
-
- buf_pos = buf + 16 + offs3;
- offs = le2me_32(*(uint32_t *)buf_pos);
- buf_pos += 4;
-
- iv_Decode_Chunk(s, s->cur_frame->Ubuf, s->ref_frame->Ubuf, chroma_width,
- chroma_height, buf_pos + offs * 2, fflags2, hdr_pos, buf_pos,
- min(chroma_width, 40));
-
- }
-
- return 8;
-}
-
-typedef struct {
- long xpos;
- long ypos;
- long width;
- long height;
- long split_flag;
- long split_direction;
- long usl7;
-} ustr_t;
-
-/* ---------------------------------------------------------------------- */
-
-#define LV1_CHECK(buf1,rle_v3,lv1,lp2) \
- if((lv1 & 0x80) != 0) { \
- if(rle_v3 != 0) \
- rle_v3 = 0; \
- else { \
- rle_v3 = 1; \
- buf1 -= 2; \
- } \
- } \
- lp2 = 4;
-
-
-#define RLE_V3_CHECK(buf1,rle_v1,rle_v2,rle_v3) \
- if(rle_v3 == 0) { \
- rle_v2 = *buf1; \
- rle_v1 = 1; \
- if(rle_v2 > 32) { \
- rle_v2 -= 32; \
- rle_v1 = 0; \
- } \
- rle_v3 = 1; \
- } \
- buf1--;
-
-
-#define LP2_CHECK(buf1,rle_v3,lp2) \
- if(lp2 == 0 && rle_v3 != 0) \
- rle_v3 = 0; \
- else { \
- buf1--; \
- rle_v3 = 1; \
- }
-
-
-#define RLE_V2_CHECK(buf1,rle_v2, rle_v3,lp2) \
- rle_v2--; \
- if(rle_v2 == 0) { \
- rle_v3 = 0; \
- buf1 += 2; \
- } \
- lp2 = 4;
-
-static void iv_Decode_Chunk(Indeo3DecodeContext *s,
- unsigned char *cur, unsigned char *ref, int width, int height,
- unsigned char *buf1, long fflags2, unsigned char *hdr,
- unsigned char *buf2, int min_width_160)
-{
- unsigned char bit_buf;
- unsigned long bit_pos, lv, lv1, lv2;
- long *width_tbl, width_tbl_arr[10];
- signed char *ref_vectors;
- unsigned char *cur_frm_pos, *ref_frm_pos, *cp, *cp2;
- uint32_t *cur_lp, *ref_lp;
- const uint32_t *correction_lp[2], *correctionloworder_lp[2], *correctionhighorder_lp[2];
- unsigned short *correction_type_sp[2];
- ustr_t strip_tbl[20], *strip;
- int i, j, k, lp1, lp2, flag1, cmd, blks_width, blks_height, region_160_width,
- rle_v1, rle_v2, rle_v3;
- unsigned short res;
-
- bit_buf = 0;
- ref_vectors = NULL;
-
- width_tbl = width_tbl_arr + 1;
- i = (width < 0 ? width + 3 : width)/4;
- for(j = -1; j < 8; j++)
- width_tbl[j] = i * j;
-
- strip = strip_tbl;
-
- for(region_160_width = 0; region_160_width < (width - min_width_160); region_160_width += min_width_160);
-
- strip->ypos = strip->xpos = 0;
- for(strip->width = min_width_160; width > strip->width; strip->width *= 2);
- strip->height = height;
- strip->split_direction = 0;
- strip->split_flag = 0;
- strip->usl7 = 0;
-
- bit_pos = 0;
-
- rle_v1 = rle_v2 = rle_v3 = 0;
-
- while(strip >= strip_tbl) {
- if(bit_pos <= 0) {
- bit_pos = 8;
- bit_buf = *buf1++;
- }
-
- bit_pos -= 2;
- cmd = (bit_buf >> bit_pos) & 0x03;
-
- if(cmd == 0) {
- strip++;
- memcpy(strip, strip-1, sizeof(ustr_t));
- strip->split_flag = 1;
- strip->split_direction = 0;
- strip->height = (strip->height > 8 ? ((strip->height+8)>>4)<<3 : 4);
- continue;
- } else if(cmd == 1) {
- strip++;
- memcpy(strip, strip-1, sizeof(ustr_t));
- strip->split_flag = 1;
- strip->split_direction = 1;
- strip->width = (strip->width > 8 ? ((strip->width+8)>>4)<<3 : 4);
- continue;
- } else if(cmd == 2) {
- if(strip->usl7 == 0) {
- strip->usl7 = 1;
- ref_vectors = NULL;
- continue;
- }
- } else if(cmd == 3) {
- if(strip->usl7 == 0) {
- strip->usl7 = 1;
- ref_vectors = (signed char*)buf2 + (*buf1 * 2);
- buf1++;
- continue;
- }
- }
-
- cur_frm_pos = cur + width * strip->ypos + strip->xpos;
-
- if((blks_width = strip->width) < 0)
- blks_width += 3;
- blks_width >>= 2;
- blks_height = strip->height;
-
- if(ref_vectors != NULL) {
- ref_frm_pos = ref + (ref_vectors[0] + strip->ypos) * width +
- ref_vectors[1] + strip->xpos;
- } else
- ref_frm_pos = cur_frm_pos - width_tbl[4];
-
- if(cmd == 2) {
- if(bit_pos <= 0) {
- bit_pos = 8;
- bit_buf = *buf1++;
- }
-
- bit_pos -= 2;
- cmd = (bit_buf >> bit_pos) & 0x03;
-
- if(cmd == 0 || ref_vectors != NULL) {
- for(lp1 = 0; lp1 < blks_width; lp1++) {
- for(i = 0, j = 0; i < blks_height; i++, j += width_tbl[1])
- ((uint32_t *)cur_frm_pos)[j] = ((uint32_t *)ref_frm_pos)[j];
- cur_frm_pos += 4;
- ref_frm_pos += 4;
- }
- } else if(cmd != 1)
- return;
- } else {
- k = *buf1 >> 4;
- j = *buf1 & 0x0f;
- buf1++;
- lv = j + fflags2;
-
- if((lv - 8) <= 7 && (k == 0 || k == 3 || k == 10)) {
- cp2 = s->ModPred + ((lv - 8) << 7);
- cp = ref_frm_pos;
- for(i = 0; i < blks_width << 2; i++) {
- int v = *cp >> 1;
- *(cp++) = cp2[v];
- }
- }
-
- if(k == 1 || k == 4) {
- lv = (hdr[j] & 0xf) + fflags2;
- correction_type_sp[0] = s->corrector_type + (lv << 8);
- correction_lp[0] = correction + (lv << 8);
- lv = (hdr[j] >> 4) + fflags2;
- correction_lp[1] = correction + (lv << 8);
- correction_type_sp[1] = s->corrector_type + (lv << 8);
- } else {
- correctionloworder_lp[0] = correctionloworder_lp[1] = correctionloworder + (lv << 8);
- correctionhighorder_lp[0] = correctionhighorder_lp[1] = correctionhighorder + (lv << 8);
- correction_type_sp[0] = correction_type_sp[1] = s->corrector_type + (lv << 8);
- correction_lp[0] = correction_lp[1] = correction + (lv << 8);
- }
-
- switch(k) {
- case 1:
- case 0: /********** CASE 0 **********/
- for( ; blks_height > 0; blks_height -= 4) {
- for(lp1 = 0; lp1 < blks_width; lp1++) {
- for(lp2 = 0; lp2 < 4; ) {
- k = *buf1++;
- cur_lp = ((uint32_t *)cur_frm_pos) + width_tbl[lp2];
- ref_lp = ((uint32_t *)ref_frm_pos) + width_tbl[lp2];
-
- switch(correction_type_sp[0][k]) {
- case 0:
- *cur_lp = le2me_32(((le2me_32(*ref_lp) >> 1) + correction_lp[lp2 & 0x01][k]) << 1);
- lp2++;
- break;
- case 1:
- res = ((le2me_16(((unsigned short *)(ref_lp))[0]) >> 1) + correction_lp[lp2 & 0x01][*buf1]) << 1;
- ((unsigned short *)cur_lp)[0] = le2me_16(res);
- res = ((le2me_16(((unsigned short *)(ref_lp))[1]) >> 1) + correction_lp[lp2 & 0x01][k]) << 1;
- ((unsigned short *)cur_lp)[1] = le2me_16(res);
- buf1++;
- lp2++;
- break;
- case 2:
- if(lp2 == 0) {
- for(i = 0, j = 0; i < 2; i++, j += width_tbl[1])
- cur_lp[j] = ref_lp[j];
- lp2 += 2;
- }
- break;
- case 3:
- if(lp2 < 2) {
- for(i = 0, j = 0; i < (3 - lp2); i++, j += width_tbl[1])
- cur_lp[j] = ref_lp[j];
- lp2 = 3;
- }
- break;
- case 8:
- if(lp2 == 0) {
- RLE_V3_CHECK(buf1,rle_v1,rle_v2,rle_v3)
-
- if(rle_v1 == 1 || ref_vectors != NULL) {
- for(i = 0, j = 0; i < 4; i++, j += width_tbl[1])
- cur_lp[j] = ref_lp[j];
- }
-
- RLE_V2_CHECK(buf1,rle_v2, rle_v3,lp2)
- break;
- } else {
- rle_v1 = 1;
- rle_v2 = *buf1 - 1;
- }
- case 5:
- LP2_CHECK(buf1,rle_v3,lp2)
- case 4:
- for(i = 0, j = 0; i < (4 - lp2); i++, j += width_tbl[1])
- cur_lp[j] = ref_lp[j];
- lp2 = 4;
- break;
-
- case 7:
- if(rle_v3 != 0)
- rle_v3 = 0;
- else {
- buf1--;
- rle_v3 = 1;
- }
- case 6:
- if(ref_vectors != NULL) {
- for(i = 0, j = 0; i < 4; i++, j += width_tbl[1])
- cur_lp[j] = ref_lp[j];
- }
- lp2 = 4;
- break;
-
- case 9:
- lv1 = *buf1++;
- lv = (lv1 & 0x7F) << 1;
- lv += (lv << 8);
- lv += (lv << 16);
- for(i = 0, j = 0; i < 4; i++, j += width_tbl[1])
- cur_lp[j] = lv;
-
- LV1_CHECK(buf1,rle_v3,lv1,lp2)
- break;
- default:
- return;
- }
- }
-
- cur_frm_pos += 4;
- ref_frm_pos += 4;
- }
-
- cur_frm_pos += ((width - blks_width) * 4);
- ref_frm_pos += ((width - blks_width) * 4);
- }
- break;
-
- case 4:
- case 3: /********** CASE 3 **********/
- if(ref_vectors != NULL)
- return;
- flag1 = 1;
-
- for( ; blks_height > 0; blks_height -= 8) {
- for(lp1 = 0; lp1 < blks_width; lp1++) {
- for(lp2 = 0; lp2 < 4; ) {
- k = *buf1++;
-
- cur_lp = ((uint32_t *)cur_frm_pos) + width_tbl[lp2 * 2];
- ref_lp = ((uint32_t *)cur_frm_pos) + width_tbl[(lp2 * 2) - 1];
-
- switch(correction_type_sp[lp2 & 0x01][k]) {
- case 0:
- cur_lp[width_tbl[1]] = le2me_32(((le2me_32(*ref_lp) >> 1) + correction_lp[lp2 & 0x01][k]) << 1);
- if(lp2 > 0 || flag1 == 0 || strip->ypos != 0)
- cur_lp[0] = ((cur_lp[-width_tbl[1]] >> 1) + (cur_lp[width_tbl[1]] >> 1)) & 0xFEFEFEFE;
- else
- cur_lp[0] = le2me_32(((le2me_32(*ref_lp) >> 1) + correction_lp[lp2 & 0x01][k]) << 1);
- lp2++;
- break;
-
- case 1:
- res = ((le2me_16(((unsigned short *)ref_lp)[0]) >> 1) + correction_lp[lp2 & 0x01][*buf1]) << 1;
- ((unsigned short *)cur_lp)[width_tbl[2]] = le2me_16(res);
- res = ((le2me_16(((unsigned short *)ref_lp)[1]) >> 1) + correction_lp[lp2 & 0x01][k]) << 1;
- ((unsigned short *)cur_lp)[width_tbl[2]+1] = le2me_16(res);
-
- if(lp2 > 0 || flag1 == 0 || strip->ypos != 0)
- cur_lp[0] = ((cur_lp[-width_tbl[1]] >> 1) + (cur_lp[width_tbl[1]] >> 1)) & 0xFEFEFEFE;
- else
- cur_lp[0] = cur_lp[width_tbl[1]];
- buf1++;
- lp2++;
- break;
-
- case 2:
- if(lp2 == 0) {
- for(i = 0, j = 0; i < 4; i++, j += width_tbl[1])
- cur_lp[j] = *ref_lp;
- lp2 += 2;
- }
- break;
-
- case 3:
- if(lp2 < 2) {
- for(i = 0, j = 0; i < 6 - (lp2 * 2); i++, j += width_tbl[1])
- cur_lp[j] = *ref_lp;
- lp2 = 3;
- }
- break;
-
- case 6:
- lp2 = 4;
- break;
-
- case 7:
- if(rle_v3 != 0)
- rle_v3 = 0;
- else {
- buf1--;
- rle_v3 = 1;
- }
- lp2 = 4;
- break;
-
- case 8:
- if(lp2 == 0) {
- RLE_V3_CHECK(buf1,rle_v1,rle_v2,rle_v3)
-
- if(rle_v1 == 1) {
- for(i = 0, j = 0; i < 8; i++, j += width_tbl[1])
- cur_lp[j] = ref_lp[j];
- }
-
- RLE_V2_CHECK(buf1,rle_v2, rle_v3,lp2)
- break;
- } else {
- rle_v2 = (*buf1) - 1;
- rle_v1 = 1;
- }
- case 5:
- LP2_CHECK(buf1,rle_v3,lp2)
- case 4:
- for(i = 0, j = 0; i < 8 - (lp2 * 2); i++, j += width_tbl[1])
- cur_lp[j] = *ref_lp;
- lp2 = 4;
- break;
-
- case 9:
- av_log(s->avctx, AV_LOG_ERROR, "UNTESTED.\n");
- lv1 = *buf1++;
- lv = (lv1 & 0x7F) << 1;
- lv += (lv << 8);
- lv += (lv << 16);
-
- for(i = 0, j = 0; i < 4; i++, j += width_tbl[1])
- cur_lp[j] = lv;
-
- LV1_CHECK(buf1,rle_v3,lv1,lp2)
- break;
-
- default:
- return;
- }
- }
-
- cur_frm_pos += 4;
- }
-
- cur_frm_pos += (((width * 2) - blks_width) * 4);
- flag1 = 0;
- }
- break;
-
- case 10: /********** CASE 10 **********/
- if(ref_vectors == NULL) {
- flag1 = 1;
-
- for( ; blks_height > 0; blks_height -= 8) {
- for(lp1 = 0; lp1 < blks_width; lp1 += 2) {
- for(lp2 = 0; lp2 < 4; ) {
- k = *buf1++;
- cur_lp = ((uint32_t *)cur_frm_pos) + width_tbl[lp2 * 2];
- ref_lp = ((uint32_t *)cur_frm_pos) + width_tbl[(lp2 * 2) - 1];
- lv1 = ref_lp[0];
- lv2 = ref_lp[1];
- if(lp2 == 0 && flag1 != 0) {
-#ifdef WORDS_BIGENDIAN
- lv1 = lv1 & 0xFF00FF00;
- lv1 = (lv1 >> 8) | lv1;
- lv2 = lv2 & 0xFF00FF00;
- lv2 = (lv2 >> 8) | lv2;
-#else
- lv1 = lv1 & 0x00FF00FF;
- lv1 = (lv1 << 8) | lv1;
- lv2 = lv2 & 0x00FF00FF;
- lv2 = (lv2 << 8) | lv2;
-#endif
- }
-
- switch(correction_type_sp[lp2 & 0x01][k]) {
- case 0:
- cur_lp[width_tbl[1]] = le2me_32(((le2me_32(lv1) >> 1) + correctionloworder_lp[lp2 & 0x01][k]) << 1);
- cur_lp[width_tbl[1]+1] = le2me_32(((le2me_32(lv2) >> 1) + correctionhighorder_lp[lp2 & 0x01][k]) << 1);
- if(lp2 > 0 || strip->ypos != 0 || flag1 == 0) {
- cur_lp[0] = ((cur_lp[-width_tbl[1]] >> 1) + (cur_lp[width_tbl[1]] >> 1)) & 0xFEFEFEFE;
- cur_lp[1] = ((cur_lp[-width_tbl[1]+1] >> 1) + (cur_lp[width_tbl[1]+1] >> 1)) & 0xFEFEFEFE;
- } else {
- cur_lp[0] = cur_lp[width_tbl[1]];
- cur_lp[1] = cur_lp[width_tbl[1]+1];
- }
- lp2++;
- break;
-
- case 1:
- cur_lp[width_tbl[1]] = le2me_32(((le2me_32(lv1) >> 1) + correctionloworder_lp[lp2 & 0x01][*buf1]) << 1);
- cur_lp[width_tbl[1]+1] = le2me_32(((le2me_32(lv2) >> 1) + correctionloworder_lp[lp2 & 0x01][k]) << 1);
- if(lp2 > 0 || strip->ypos != 0 || flag1 == 0) {
- cur_lp[0] = ((cur_lp[-width_tbl[1]] >> 1) + (cur_lp[width_tbl[1]] >> 1)) & 0xFEFEFEFE;
- cur_lp[1] = ((cur_lp[-width_tbl[1]+1] >> 1) + (cur_lp[width_tbl[1]+1] >> 1)) & 0xFEFEFEFE;
- } else {
- cur_lp[0] = cur_lp[width_tbl[1]];
- cur_lp[1] = cur_lp[width_tbl[1]+1];
- }
- buf1++;
- lp2++;
- break;
-
- case 2:
- if(lp2 == 0) {
- if(flag1 != 0) {
- for(i = 0, j = width_tbl[1]; i < 3; i++, j += width_tbl[1]) {
- cur_lp[j] = lv1;
- cur_lp[j+1] = lv2;
- }
- cur_lp[0] = ((cur_lp[-width_tbl[1]] >> 1) + (cur_lp[width_tbl[1]] >> 1)) & 0xFEFEFEFE;
- cur_lp[1] = ((cur_lp[-width_tbl[1]+1] >> 1) + (cur_lp[width_tbl[1]+1] >> 1)) & 0xFEFEFEFE;
- } else {
- for(i = 0, j = 0; i < 4; i++, j += width_tbl[1]) {
- cur_lp[j] = lv1;
- cur_lp[j+1] = lv2;
- }
- }
- lp2 += 2;
- }
- break;
-
- case 3:
- if(lp2 < 2) {
- if(lp2 == 0 && flag1 != 0) {
- for(i = 0, j = width_tbl[1]; i < 5; i++, j += width_tbl[1]) {
- cur_lp[j] = lv1;
- cur_lp[j+1] = lv2;
- }
- cur_lp[0] = ((cur_lp[-width_tbl[1]] >> 1) + (cur_lp[width_tbl[1]] >> 1)) & 0xFEFEFEFE;
- cur_lp[1] = ((cur_lp[-width_tbl[1]+1] >> 1) + (cur_lp[width_tbl[1]+1] >> 1)) & 0xFEFEFEFE;
- } else {
- for(i = 0, j = 0; i < 6 - (lp2 * 2); i++, j += width_tbl[1]) {
- cur_lp[j] = lv1;
- cur_lp[j+1] = lv2;
- }
- }
- lp2 = 3;
- }
- break;
-
- case 8:
- if(lp2 == 0) {
- RLE_V3_CHECK(buf1,rle_v1,rle_v2,rle_v3)
- if(rle_v1 == 1) {
- if(flag1 != 0) {
- for(i = 0, j = width_tbl[1]; i < 7; i++, j += width_tbl[1]) {
- cur_lp[j] = lv1;
- cur_lp[j+1] = lv2;
- }
- cur_lp[0] = ((cur_lp[-width_tbl[1]] >> 1) + (cur_lp[width_tbl[1]] >> 1)) & 0xFEFEFEFE;
- cur_lp[1] = ((cur_lp[-width_tbl[1]+1] >> 1) + (cur_lp[width_tbl[1]+1] >> 1)) & 0xFEFEFEFE;
- } else {
- for(i = 0, j = 0; i < 8; i++, j += width_tbl[1]) {
- cur_lp[j] = lv1;
- cur_lp[j+1] = lv2;
- }
- }
- }
- RLE_V2_CHECK(buf1,rle_v2, rle_v3,lp2)
- break;
- } else {
- rle_v1 = 1;
- rle_v2 = (*buf1) - 1;
- }
- case 5:
- LP2_CHECK(buf1,rle_v3,lp2)
- case 4:
- if(lp2 == 0 && flag1 != 0) {
- for(i = 0, j = width_tbl[1]; i < 7; i++, j += width_tbl[1]) {
- cur_lp[j] = lv1;
- cur_lp[j+1] = lv2;
- }
- cur_lp[0] = ((cur_lp[-width_tbl[1]] >> 1) + (cur_lp[width_tbl[1]] >> 1)) & 0xFEFEFEFE;
- cur_lp[1] = ((cur_lp[-width_tbl[1]+1] >> 1) + (cur_lp[width_tbl[1]+1] >> 1)) & 0xFEFEFEFE;
- } else {
- for(i = 0, j = 0; i < 8 - (lp2 * 2); i++, j += width_tbl[1]) {
- cur_lp[j] = lv1;
- cur_lp[j+1] = lv2;
- }
- }
- lp2 = 4;
- break;
-
- case 6:
- lp2 = 4;
- break;
-
- case 7:
- if(lp2 == 0) {
- if(rle_v3 != 0)
- rle_v3 = 0;
- else {
- buf1--;
- rle_v3 = 1;
- }
- lp2 = 4;
- }
- break;
-
- case 9:
- av_log(s->avctx, AV_LOG_ERROR, "UNTESTED.\n");
- lv1 = *buf1;
- lv = (lv1 & 0x7F) << 1;
- lv += (lv << 8);
- lv += (lv << 16);
- for(i = 0, j = 0; i < 8; i++, j += width_tbl[1])
- cur_lp[j] = lv;
- LV1_CHECK(buf1,rle_v3,lv1,lp2)
- break;
-
- default:
- return;
- }
- }
-
- cur_frm_pos += 8;
- }
-
- cur_frm_pos += (((width * 2) - blks_width) * 4);
- flag1 = 0;
- }
- } else {
- for( ; blks_height > 0; blks_height -= 8) {
- for(lp1 = 0; lp1 < blks_width; lp1 += 2) {
- for(lp2 = 0; lp2 < 4; ) {
- k = *buf1++;
- cur_lp = ((uint32_t *)cur_frm_pos) + width_tbl[lp2 * 2];
- ref_lp = ((uint32_t *)ref_frm_pos) + width_tbl[lp2 * 2];
-
- switch(correction_type_sp[lp2 & 0x01][k]) {
- case 0:
- lv1 = correctionloworder_lp[lp2 & 0x01][k];
- lv2 = correctionhighorder_lp[lp2 & 0x01][k];
- cur_lp[0] = le2me_32(((le2me_32(ref_lp[0]) >> 1) + lv1) << 1);
- cur_lp[1] = le2me_32(((le2me_32(ref_lp[1]) >> 1) + lv2) << 1);
- cur_lp[width_tbl[1]] = le2me_32(((le2me_32(ref_lp[width_tbl[1]]) >> 1) + lv1) << 1);
- cur_lp[width_tbl[1]+1] = le2me_32(((le2me_32(ref_lp[width_tbl[1]+1]) >> 1) + lv2) << 1);
- lp2++;
- break;
-
- case 1:
- lv1 = correctionloworder_lp[lp2 & 0x01][*buf1++];
- lv2 = correctionloworder_lp[lp2 & 0x01][k];
- cur_lp[0] = le2me_32(((le2me_32(ref_lp[0]) >> 1) + lv1) << 1);
- cur_lp[1] = le2me_32(((le2me_32(ref_lp[1]) >> 1) + lv2) << 1);
- cur_lp[width_tbl[1]] = le2me_32(((le2me_32(ref_lp[width_tbl[1]]) >> 1) + lv1) << 1);
- cur_lp[width_tbl[1]+1] = le2me_32(((le2me_32(ref_lp[width_tbl[1]+1]) >> 1) + lv2) << 1);
- lp2++;
- break;
-
- case 2:
- if(lp2 == 0) {
- for(i = 0, j = 0; i < 4; i++, j += width_tbl[1]) {
- cur_lp[j] = ref_lp[j];
- cur_lp[j+1] = ref_lp[j+1];
- }
- lp2 += 2;
- }
- break;
-
- case 3:
- if(lp2 < 2) {
- for(i = 0, j = 0; i < 6 - (lp2 * 2); i++, j += width_tbl[1]) {
- cur_lp[j] = ref_lp[j];
- cur_lp[j+1] = ref_lp[j+1];
- }
- lp2 = 3;
- }
- break;
-
- case 8:
- if(lp2 == 0) {
- RLE_V3_CHECK(buf1,rle_v1,rle_v2,rle_v3)
- for(i = 0, j = 0; i < 8; i++, j += width_tbl[1]) {
- ((uint32_t *)cur_frm_pos)[j] = ((uint32_t *)ref_frm_pos)[j];
- ((uint32_t *)cur_frm_pos)[j+1] = ((uint32_t *)ref_frm_pos)[j+1];
- }
- RLE_V2_CHECK(buf1,rle_v2, rle_v3,lp2)
- break;
- } else {
- rle_v1 = 1;
- rle_v2 = (*buf1) - 1;
- }
- case 5:
- case 7:
- LP2_CHECK(buf1,rle_v3,lp2)
- case 6:
- case 4:
- for(i = 0, j = 0; i < 8 - (lp2 * 2); i++, j += width_tbl[1]) {
- cur_lp[j] = ref_lp[j];
- cur_lp[j+1] = ref_lp[j+1];
- }
- lp2 = 4;
- break;
-
- case 9:
- av_log(s->avctx, AV_LOG_ERROR, "UNTESTED.\n");
- lv1 = *buf1;
- lv = (lv1 & 0x7F) << 1;
- lv += (lv << 8);
- lv += (lv << 16);
- for(i = 0, j = 0; i < 8; i++, j += width_tbl[1])
- ((uint32_t *)cur_frm_pos)[j] = ((uint32_t *)cur_frm_pos)[j+1] = lv;
- LV1_CHECK(buf1,rle_v3,lv1,lp2)
- break;
-
- default:
- return;
- }
- }
-
- cur_frm_pos += 8;
- ref_frm_pos += 8;
- }
-
- cur_frm_pos += (((width * 2) - blks_width) * 4);
- ref_frm_pos += (((width * 2) - blks_width) * 4);
- }
- }
- break;
-
- case 11: /********** CASE 11 **********/
- if(ref_vectors == NULL)
- return;
-
- for( ; blks_height > 0; blks_height -= 8) {
- for(lp1 = 0; lp1 < blks_width; lp1++) {
- for(lp2 = 0; lp2 < 4; ) {
- k = *buf1++;
- cur_lp = ((uint32_t *)cur_frm_pos) + width_tbl[lp2 * 2];
- ref_lp = ((uint32_t *)ref_frm_pos) + width_tbl[lp2 * 2];
-
- switch(correction_type_sp[lp2 & 0x01][k]) {
- case 0:
- cur_lp[0] = le2me_32(((le2me_32(*ref_lp) >> 1) + correction_lp[lp2 & 0x01][k]) << 1);
- cur_lp[width_tbl[1]] = le2me_32(((le2me_32(ref_lp[width_tbl[1]]) >> 1) + correction_lp[lp2 & 0x01][k]) << 1);
- lp2++;
- break;
-
- case 1:
- lv1 = (unsigned short)(correction_lp[lp2 & 0x01][*buf1++]);
- lv2 = (unsigned short)(correction_lp[lp2 & 0x01][k]);
- res = (unsigned short)(((le2me_16(((unsigned short *)ref_lp)[0]) >> 1) + lv1) << 1);
- ((unsigned short *)cur_lp)[0] = le2me_16(res);
- res = (unsigned short)(((le2me_16(((unsigned short *)ref_lp)[1]) >> 1) + lv2) << 1);
- ((unsigned short *)cur_lp)[1] = le2me_16(res);
- res = (unsigned short)(((le2me_16(((unsigned short *)ref_lp)[width_tbl[2]]) >> 1) + lv1) << 1);
- ((unsigned short *)cur_lp)[width_tbl[2]] = le2me_16(res);
- res = (unsigned short)(((le2me_16(((unsigned short *)ref_lp)[width_tbl[2]+1]) >> 1) + lv2) << 1);
- ((unsigned short *)cur_lp)[width_tbl[2]+1] = le2me_16(res);
- lp2++;
- break;
-
- case 2:
- if(lp2 == 0) {
- for(i = 0, j = 0; i < 4; i++, j += width_tbl[1])
- cur_lp[j] = ref_lp[j];
- lp2 += 2;
- }
- break;
-
- case 3:
- if(lp2 < 2) {
- for(i = 0, j = 0; i < 6 - (lp2 * 2); i++, j += width_tbl[1])
- cur_lp[j] = ref_lp[j];
- lp2 = 3;
- }
- break;
-
- case 8:
- if(lp2 == 0) {
- RLE_V3_CHECK(buf1,rle_v1,rle_v2,rle_v3)
-
- for(i = 0, j = 0; i < 8; i++, j += width_tbl[1])
- cur_lp[j] = ref_lp[j];
-
- RLE_V2_CHECK(buf1,rle_v2, rle_v3,lp2)
- break;
- } else {
- rle_v1 = 1;
- rle_v2 = (*buf1) - 1;
- }
- case 5:
- case 7:
- LP2_CHECK(buf1,rle_v3,lp2)
- case 4:
- case 6:
- for(i = 0, j = 0; i < 8 - (lp2 * 2); i++, j += width_tbl[1])
- cur_lp[j] = ref_lp[j];
- lp2 = 4;
- break;
-
- case 9:
- av_log(s->avctx, AV_LOG_ERROR, "UNTESTED.\n");
- lv1 = *buf1++;
- lv = (lv1 & 0x7F) << 1;
- lv += (lv << 8);
- lv += (lv << 16);
- for(i = 0, j = 0; i < 4; i++, j += width_tbl[1])
- cur_lp[j] = lv;
- LV1_CHECK(buf1,rle_v3,lv1,lp2)
- break;
-
- default:
- return;
- }
- }
-
- cur_frm_pos += 4;
- ref_frm_pos += 4;
- }
-
- cur_frm_pos += (((width * 2) - blks_width) * 4);
- ref_frm_pos += (((width * 2) - blks_width) * 4);
- }
- break;
-
- default:
- return;
- }
- }
-
- if(strip < strip_tbl)
- return;
-
- for( ; strip >= strip_tbl; strip--) {
- if(strip->split_flag != 0) {
- strip->split_flag = 0;
- strip->usl7 = (strip-1)->usl7;
-
- if(strip->split_direction) {
- strip->xpos += strip->width;
- strip->width = (strip-1)->width - strip->width;
- if(region_160_width <= strip->xpos && width < strip->width + strip->xpos)
- strip->width = width - strip->xpos;
- } else {
- strip->ypos += strip->height;
- strip->height = (strip-1)->height - strip->height;
- }
- break;
- }
- }
- }
-}
-
-static int indeo3_decode_init(AVCodecContext *avctx)
-{
- Indeo3DecodeContext *s = avctx->priv_data;
-
- s->avctx = avctx;
- s->width = avctx->width;
- s->height = avctx->height;
- avctx->pix_fmt = PIX_FMT_YUV410P;
- avctx->has_b_frames = 0;
-
- build_modpred(s);
- iv_alloc_frames(s);
-
- return 0;
-}
-
-static int indeo3_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- unsigned char *buf, int buf_size)
-{
- Indeo3DecodeContext *s=avctx->priv_data;
- unsigned char *src, *dest;
- int y;
-
- iv_decode_frame(s, buf, buf_size);
-
- if(s->frame.data[0])
- avctx->release_buffer(avctx, &s->frame);
-
- s->frame.reference = 0;
- if(avctx->get_buffer(avctx, &s->frame) < 0) {
- av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
-
- src = s->cur_frame->Ybuf;
- dest = s->frame.data[0];
- for (y = 0; y < s->height; y++) {
- memcpy(dest, src, s->cur_frame->y_w);
- src += s->cur_frame->y_w;
- dest += s->frame.linesize[0];
- }
-
- if (!(s->avctx->flags & CODEC_FLAG_GRAY))
- {
- src = s->cur_frame->Ubuf;
- dest = s->frame.data[1];
- for (y = 0; y < s->height / 4; y++) {
- memcpy(dest, src, s->cur_frame->uv_w);
- src += s->cur_frame->uv_w;
- dest += s->frame.linesize[1];
- }
-
- src = s->cur_frame->Vbuf;
- dest = s->frame.data[2];
- for (y = 0; y < s->height / 4; y++) {
- memcpy(dest, src, s->cur_frame->uv_w);
- src += s->cur_frame->uv_w;
- dest += s->frame.linesize[2];
- }
- }
-
- *data_size=sizeof(AVFrame);
- *(AVFrame*)data= s->frame;
-
- return buf_size;
-}
-
-static int indeo3_decode_end(AVCodecContext *avctx)
-{
- Indeo3DecodeContext *s = avctx->priv_data;
-
- iv_free_func(s);
-
- return 0;
-}
-
-AVCodec indeo3_decoder = {
- "indeo3",
- CODEC_TYPE_VIDEO,
- CODEC_ID_INDEO3,
- sizeof(Indeo3DecodeContext),
- indeo3_decode_init,
- NULL,
- indeo3_decode_end,
- indeo3_decode_frame,
- 0,
- NULL
-};
diff --git a/src/libffmpeg/libavcodec/indeo3data.h b/src/libffmpeg/libavcodec/indeo3data.h
deleted file mode 100644
index e69a09f0e..000000000
--- a/src/libffmpeg/libavcodec/indeo3data.h
+++ /dev/null
@@ -1,2335 +0,0 @@
-/*
- * Intel Indeo 3 (IV31, IV32, etc.) video decoder for ffmpeg
- * written, produced, and directed by Alan Smithee
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-static const uint32_t correction[] = {
- 0x00000000, 0x00000202, 0xfffffdfe, 0x000002ff, 0xfffffd01, 0xffffff03, 0x000000fd, 0x00000404,
- 0xfffffbfc, 0x00000501, 0xfffffaff, 0x00000105, 0xfffffefb, 0x000003fc, 0xfffffc04, 0x000005fe,
- 0xfffffa02, 0xfffffe06, 0x000001fa, 0x00000904, 0xfffff6fc, 0x00000409, 0xfffffbf7, 0x00000909,
- 0xfffff6f7, 0x00000a01, 0xfffff5ff, 0x0000010a, 0xfffffef6, 0x000007fb, 0xfffff805, 0xfffffb08,
- 0x000004f8, 0x00000f09, 0xfffff0f7, 0x0000090f, 0xfffff6f1, 0x00000bfd, 0xfffff403, 0xfffffd0c,
- 0x000002f4, 0x00001004, 0xffffeffc, 0x00000410, 0xfffffbf0, 0x00001010, 0xffffeff0, 0x00001200,
- 0xffffee00, 0x00000012, 0xffffffee, 0x00000bf4, 0xfffff40c, 0x00000ff7, 0xfffff009, 0xfffff710,
- 0x000008f0, 0x00001b0b, 0xffffe4f5, 0x00000b1b, 0xfffff4e5, 0x00001c13, 0xffffe3ed, 0x0000131c,
- 0xffffece4, 0x000015fa, 0xffffea06, 0xfffffa16, 0x000005ea, 0x00001d04, 0xffffe2fc, 0x0000041d,
- 0xfffffbe3, 0x00001e1e, 0xffffe1e2, 0x000020fe, 0xffffdf02, 0xfffffe21, 0x000001df, 0x000016ee,
- 0xffffe912, 0xffffee17, 0x000011e9, 0x00001df1, 0xffffe20f, 0xfffff11e, 0x00000ee2, 0x00002e16,
- 0xffffd1ea, 0x0000162e, 0xffffe9d2, 0x00002f0d, 0xffffd0f3, 0x00000d2f, 0xfffff2d1, 0x00003123,
- 0xffffcedd, 0x00002331, 0xffffdccf, 0x000028f5, 0xffffd70b, 0xfffff529, 0x00000ad7, 0x00003304,
- 0xffffccfc, 0x00000433, 0xfffffbcd, 0x00003636, 0xffffc9ca, 0x000021de, 0xffffde22, 0x000029e3,
- 0xffffd61d, 0xffffe32a, 0x00001cd6, 0x00003bfa, 0xffffc406, 0xfffffa3c, 0x000005c4, 0x00004c1b,
- 0xffffb3e5, 0x00001b4c, 0xffffe4b4, 0x00004d2b, 0xffffb2d5, 0x00002b4d, 0xffffd4b3, 0x000036e8,
- 0xffffc918, 0xffffe837, 0x000017c9, 0x00004f0e, 0xffffb0f2, 0x00000e4f, 0xfffff1b1, 0x0000533f,
- 0xffffacc1, 0x00003f53, 0xffffc0ad, 0x000049ec, 0xffffb614, 0xffffec4a, 0x000013b6, 0x00005802,
- 0xffffa7fe, 0x00000258, 0xfffffda8, 0x00005d5d, 0xffffa2a3, 0x00003ccc, 0xffffc334, 0xffffcc3d,
- 0x000033c3, 0x00007834, 0xffff87cc, 0x00003478, 0xffffcb88, 0x00004ad3, 0xffffb52d, 0xffffd34b,
- 0x00002cb5, 0x00007d4b, 0xffff82b5, 0x00004b7d, 0xffffb483, 0x00007a21, 0xffff85df, 0x0000217a,
- 0xffffde86, 0x000066f3, 0xffff990d, 0xfffff367, 0x00000c99, 0x00005fd8, 0xffffa028, 0xffffd860,
- 0x000027a0, 0x00007ede, 0xffff8122, 0xffffde7f, 0x00002181, 0x000058a7, 0xffffa759, 0x000068b2,
- 0xffff974e, 0xffffb269, 0x00004d97, 0x00000c0c, 0xfffff3f4, 0x00001717, 0xffffe8e9, 0x00002a2a,
- 0xffffd5d6, 0x00004949, 0xffffb6b7, 0x00000000, 0x02020000, 0xfdfe0000, 0x02ff0000, 0xfd010000,
- 0xff030000, 0x00fd0000, 0x00000202, 0x02020202, 0xfdfe0202, 0x02ff0202, 0xfd010202, 0xff030202,
- 0x00fd0202, 0xfffffdfe, 0x0201fdfe, 0xfdfdfdfe, 0x02fefdfe, 0xfd00fdfe, 0xff02fdfe, 0x00fcfdfe,
- 0x000002ff, 0x020202ff, 0xfdfe02ff, 0x02ff02ff, 0xfd0102ff, 0xff0302ff, 0x00fd02ff, 0xfffffd01,
- 0x0201fd01, 0xfdfdfd01, 0x02fefd01, 0xfd00fd01, 0xff02fd01, 0x00fcfd01, 0xffffff03, 0x0201ff03,
- 0xfdfdff03, 0x02feff03, 0xfd00ff03, 0xff02ff03, 0x00fcff03, 0x000000fd, 0x020200fd, 0xfdfe00fd,
- 0x02ff00fd, 0xfd0100fd, 0xff0300fd, 0x00fd00fd, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000303, 0xfffffcfd, 0x000003ff, 0xfffffc01, 0xffffff04, 0x000000fc, 0x00000707,
- 0xfffff8f9, 0x00000802, 0xfffff7fe, 0x00000208, 0xfffffdf8, 0x000008fe, 0xfffff702, 0xfffffe09,
- 0x000001f7, 0x000005fa, 0xfffffa06, 0x00000d06, 0xfffff2fa, 0x0000060d, 0xfffff9f3, 0x00000d0d,
- 0xfffff2f3, 0x00000e01, 0xfffff1ff, 0x0000010e, 0xfffffef2, 0x00000bf8, 0xfffff408, 0xfffff80c,
- 0x000007f4, 0x0000170e, 0xffffe8f2, 0x00000e17, 0xfffff1e9, 0x000011fb, 0xffffee05, 0xfffffb12,
- 0x000004ee, 0x00001806, 0xffffe7fa, 0x00000618, 0xfffff9e8, 0x00001818, 0xffffe7e8, 0x00001aff,
- 0xffffe501, 0xffffff1b, 0x000000e5, 0x000010ef, 0xffffef11, 0x000016f3, 0xffffe90d, 0xfffff317,
- 0x00000ce9, 0x00002810, 0xffffd7f0, 0x00001028, 0xffffefd8, 0x0000291c, 0xffffd6e4, 0x00001c29,
- 0xffffe3d7, 0x000020f7, 0xffffdf09, 0xfffff721, 0x000008df, 0x00002b06, 0xffffd4fa, 0x0000062b,
- 0xfffff9d5, 0x00002e2e, 0xffffd1d2, 0x000031fc, 0xffffce04, 0xfffffc32, 0x000003ce, 0x000021e5,
- 0xffffde1b, 0xffffe522, 0x00001ade, 0x00002cea, 0xffffd316, 0xffffea2d, 0x000015d3, 0x00004522,
- 0xffffbade, 0x00002245, 0xffffddbb, 0x00004613, 0xffffb9ed, 0x00001346, 0xffffecba, 0x00004935,
- 0xffffb6cb, 0x00003549, 0xffffcab7, 0x00003def, 0xffffc211, 0xffffef3e, 0x000010c2, 0x00004d05,
- 0xffffb2fb, 0x0000054d, 0xfffffab3, 0x00005252, 0xffffadae, 0x000032cd, 0xffffcd33, 0x00003fd5,
- 0xffffc02b, 0xffffd540, 0x00002ac0, 0x000059f6, 0xffffa60a, 0xfffff65a, 0x000009a6, 0x00007229,
- 0xffff8dd7, 0x00002972, 0xffffd68e, 0x00007440, 0xffff8bc0, 0x00004074, 0xffffbf8c, 0x000051db,
- 0xffffae25, 0xffffdb52, 0x000024ae, 0x00007716, 0xffff88ea, 0x00001677, 0xffffe989, 0x00007c5f,
- 0xffff83a1, 0x00005f7c, 0xffffa084, 0x00006ee2, 0xffff911e, 0xffffe26f, 0x00001d91, 0x00005bb2,
- 0xffffa44e, 0xffffb25c, 0x00004da4, 0x000070bc, 0xffff8f44, 0xffffbc71, 0x0000438f, 0x00001212,
- 0xffffedee, 0x00002222, 0xffffddde, 0x00003f3f, 0xffffc0c1, 0x00006d6d, 0xffff9293, 0x00000000,
- 0x03030000, 0xfcfd0000, 0x03ff0000, 0xfc010000, 0xff040000, 0x00fc0000, 0x07070000, 0xf8f90000,
- 0x00000303, 0x03030303, 0xfcfd0303, 0x03ff0303, 0xfc010303, 0xff040303, 0x00fc0303, 0x07070303,
- 0xf8f90303, 0xfffffcfd, 0x0302fcfd, 0xfcfcfcfd, 0x03fefcfd, 0xfc00fcfd, 0xff03fcfd, 0x00fbfcfd,
- 0x0706fcfd, 0xf8f8fcfd, 0x000003ff, 0x030303ff, 0xfcfd03ff, 0x03ff03ff, 0xfc0103ff, 0xff0403ff,
- 0x00fc03ff, 0x070703ff, 0xf8f903ff, 0xfffffc01, 0x0302fc01, 0xfcfcfc01, 0x03fefc01, 0xfc00fc01,
- 0xff03fc01, 0x00fbfc01, 0x0706fc01, 0xf8f8fc01, 0xffffff04, 0x0302ff04, 0xfcfcff04, 0x03feff04,
- 0xfc00ff04, 0xff03ff04, 0x00fbff04, 0x0706ff04, 0xf8f8ff04, 0x000000fc, 0x030300fc, 0xfcfd00fc,
- 0x03ff00fc, 0xfc0100fc, 0xff0400fc, 0x00fc00fc, 0x070700fc, 0xf8f900fc, 0x00000707, 0x03030707,
- 0xfcfd0707, 0x03ff0707, 0xfc010707, 0xff040707, 0x00fc0707, 0x07070707, 0xf8f90707, 0xfffff8f9,
- 0x0302f8f9, 0xfcfcf8f9, 0x03fef8f9, 0xfc00f8f9, 0xff03f8f9, 0x00fbf8f9, 0x0706f8f9, 0xf8f8f8f9,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000404, 0xfffffbfc, 0x000004ff, 0xfffffb01, 0xffffff05, 0x000000fb, 0x00000a03,
- 0xfffff5fd, 0x0000030a, 0xfffffcf6, 0x00000909, 0xfffff6f7, 0x000006f9, 0xfffff907, 0x00000bfd,
- 0xfffff403, 0xfffffd0c, 0x000002f4, 0x00001108, 0xffffeef8, 0x00000811, 0xfffff7ef, 0x00001111,
- 0xffffeeef, 0x00001301, 0xffffecff, 0x00000113, 0xfffffeed, 0x00000ff5, 0xfffff00b, 0xfffff510,
- 0x00000af0, 0x000016fa, 0xffffe906, 0xfffffa17, 0x000005e9, 0x00001f12, 0xffffe0ee, 0x0000121f,
- 0xffffede1, 0x00002008, 0xffffdff8, 0x00000820, 0xfffff7e0, 0x00002121, 0xffffdedf, 0x000023ff,
- 0xffffdc01, 0xffffff24, 0x000000dc, 0x000016e9, 0xffffe917, 0x00001eef, 0xffffe111, 0xffffef1f,
- 0x000010e1, 0x00003615, 0xffffc9eb, 0x00001536, 0xffffeaca, 0x00003725, 0xffffc8db, 0x00002537,
- 0xffffdac9, 0x00002bf4, 0xffffd40c, 0xfffff42c, 0x00000bd4, 0x00003908, 0xffffc6f8, 0x00000839,
- 0xfffff7c7, 0x00003d3d, 0xffffc2c3, 0x000041fb, 0xffffbe05, 0xfffffb42, 0x000004be, 0x00002cdc,
- 0xffffd324, 0xffffdc2d, 0x000023d3, 0x00003be3, 0xffffc41d, 0xffffe33c, 0x00001cc4, 0x00005c2d,
- 0xffffa3d3, 0x00002d5c, 0xffffd2a4, 0x00005d19, 0xffffa2e7, 0x0000195d, 0xffffe6a3, 0x00006147,
- 0xffff9eb9, 0x00004761, 0xffffb89f, 0x000052ea, 0xffffad16, 0xffffea53, 0x000015ad, 0x00006607,
- 0xffff99f9, 0x00000766, 0xfffff89a, 0x00006d6d, 0xffff9293, 0x000043bc, 0xffffbc44, 0x000054c7,
- 0xffffab39, 0xffffc755, 0x000038ab, 0x000077f3, 0xffff880d, 0xfffff378, 0x00000c88, 0x00006dcf,
- 0xffff9231, 0xffffcf6e, 0x00003092, 0x00007a98, 0xffff8568, 0xffff987b, 0x00006785, 0x00001818,
- 0xffffe7e8, 0x00002e2e, 0xffffd1d2, 0x00005454, 0xffffabac, 0x00000000, 0x04040000, 0xfbfc0000,
- 0x04ff0000, 0xfb010000, 0xff050000, 0x00fb0000, 0x0a030000, 0xf5fd0000, 0x030a0000, 0x00000404,
- 0x04040404, 0xfbfc0404, 0x04ff0404, 0xfb010404, 0xff050404, 0x00fb0404, 0x0a030404, 0xf5fd0404,
- 0x030a0404, 0xfffffbfc, 0x0403fbfc, 0xfbfbfbfc, 0x04fefbfc, 0xfb00fbfc, 0xff04fbfc, 0x00fafbfc,
- 0x0a02fbfc, 0xf5fcfbfc, 0x0309fbfc, 0x000004ff, 0x040404ff, 0xfbfc04ff, 0x04ff04ff, 0xfb0104ff,
- 0xff0504ff, 0x00fb04ff, 0x0a0304ff, 0xf5fd04ff, 0x030a04ff, 0xfffffb01, 0x0403fb01, 0xfbfbfb01,
- 0x04fefb01, 0xfb00fb01, 0xff04fb01, 0x00fafb01, 0x0a02fb01, 0xf5fcfb01, 0x0309fb01, 0xffffff05,
- 0x0403ff05, 0xfbfbff05, 0x04feff05, 0xfb00ff05, 0xff04ff05, 0x00faff05, 0x0a02ff05, 0xf5fcff05,
- 0x0309ff05, 0x000000fb, 0x040400fb, 0xfbfc00fb, 0x04ff00fb, 0xfb0100fb, 0xff0500fb, 0x00fb00fb,
- 0x0a0300fb, 0xf5fd00fb, 0x030a00fb, 0x00000a03, 0x04040a03, 0xfbfc0a03, 0x04ff0a03, 0xfb010a03,
- 0xff050a03, 0x00fb0a03, 0x0a030a03, 0xf5fd0a03, 0x030a0a03, 0xfffff5fd, 0x0403f5fd, 0xfbfbf5fd,
- 0x04fef5fd, 0xfb00f5fd, 0xff04f5fd, 0x00faf5fd, 0x0a02f5fd, 0xf5fcf5fd, 0x0309f5fd, 0x0000030a,
- 0x0404030a, 0xfbfc030a, 0x04ff030a, 0xfb01030a, 0xff05030a, 0x00fb030a, 0x0a03030a, 0xf5fd030a,
- 0x030a030a, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000505, 0xfffffafb, 0x000006fe, 0xfffff902, 0xfffffe07, 0x000001f9, 0x00000b0b,
- 0xfffff4f5, 0x00000d03, 0xfffff2fd, 0x0000030d, 0xfffffcf3, 0x000008f7, 0xfffff709, 0x00000efc,
- 0xfffff104, 0xfffffc0f, 0x000003f1, 0x0000160b, 0xffffe9f5, 0x00000b16, 0xfffff4ea, 0x00001515,
- 0xffffeaeb, 0x00001802, 0xffffe7fe, 0x00000218, 0xfffffde8, 0x000013f2, 0xffffec0e, 0xfffff214,
- 0x00000dec, 0x00002617, 0xffffd9e9, 0x00001726, 0xffffe8da, 0x00001cf8, 0xffffe308, 0xfffff81d,
- 0x000007e3, 0x0000270b, 0xffffd8f5, 0x00000b27, 0xfffff4d9, 0x00002929, 0xffffd6d7, 0x00002cff,
- 0xffffd301, 0xffffff2d, 0x000000d3, 0x00001ce3, 0xffffe31d, 0x000026ea, 0xffffd916, 0xffffea27,
- 0x000015d9, 0x0000431b, 0xffffbce5, 0x00001b43, 0xffffe4bd, 0x0000452f, 0xffffbad1, 0x00002f45,
- 0xffffd0bb, 0x000037f1, 0xffffc80f, 0xfffff138, 0x00000ec8, 0x0000470b, 0xffffb8f5, 0x00000b47,
- 0xfffff4b9, 0x00004c4c, 0xffffb3b4, 0x000052fa, 0xffffad06, 0xfffffa53, 0x000005ad, 0x000038d3,
- 0xffffc72d, 0xffffd339, 0x00002cc7, 0x00004adc, 0xffffb524, 0xffffdc4b, 0x000023b5, 0x00007338,
- 0xffff8cc8, 0x00003873, 0xffffc78d, 0x0000751f, 0xffff8ae1, 0x00001f75, 0xffffe08b, 0x00007a58,
- 0xffff85a8, 0x0000587a, 0xffffa786, 0x000067e4, 0xffff981c, 0xffffe468, 0x00001b98, 0x000054ab,
- 0xffffab55, 0x000069b8, 0xffff9648, 0xffffb86a, 0x00004796, 0x00001e1e, 0xffffe1e2, 0x00003a3a,
- 0xffffc5c6, 0x00006969, 0xffff9697, 0x00000000, 0x05050000, 0xfafb0000, 0x06fe0000, 0xf9020000,
- 0xfe070000, 0x01f90000, 0x0b0b0000, 0xf4f50000, 0x0d030000, 0xf2fd0000, 0x00000505, 0x05050505,
- 0xfafb0505, 0x06fe0505, 0xf9020505, 0xfe070505, 0x01f90505, 0x0b0b0505, 0xf4f50505, 0x0d030505,
- 0xf2fd0505, 0xfffffafb, 0x0504fafb, 0xfafafafb, 0x06fdfafb, 0xf901fafb, 0xfe06fafb, 0x01f8fafb,
- 0x0b0afafb, 0xf4f4fafb, 0x0d02fafb, 0xf2fcfafb, 0x000006fe, 0x050506fe, 0xfafb06fe, 0x06fe06fe,
- 0xf90206fe, 0xfe0706fe, 0x01f906fe, 0x0b0b06fe, 0xf4f506fe, 0x0d0306fe, 0xf2fd06fe, 0xfffff902,
- 0x0504f902, 0xfafaf902, 0x06fdf902, 0xf901f902, 0xfe06f902, 0x01f8f902, 0x0b0af902, 0xf4f4f902,
- 0x0d02f902, 0xf2fcf902, 0xfffffe07, 0x0504fe07, 0xfafafe07, 0x06fdfe07, 0xf901fe07, 0xfe06fe07,
- 0x01f8fe07, 0x0b0afe07, 0xf4f4fe07, 0x0d02fe07, 0xf2fcfe07, 0x000001f9, 0x050501f9, 0xfafb01f9,
- 0x06fe01f9, 0xf90201f9, 0xfe0701f9, 0x01f901f9, 0x0b0b01f9, 0xf4f501f9, 0x0d0301f9, 0xf2fd01f9,
- 0x00000b0b, 0x05050b0b, 0xfafb0b0b, 0x06fe0b0b, 0xf9020b0b, 0xfe070b0b, 0x01f90b0b, 0x0b0b0b0b,
- 0xf4f50b0b, 0x0d030b0b, 0xf2fd0b0b, 0xfffff4f5, 0x0504f4f5, 0xfafaf4f5, 0x06fdf4f5, 0xf901f4f5,
- 0xfe06f4f5, 0x01f8f4f5, 0x0b0af4f5, 0xf4f4f4f5, 0x0d02f4f5, 0xf2fcf4f5, 0x00000d03, 0x05050d03,
- 0xfafb0d03, 0x06fe0d03, 0xf9020d03, 0xfe070d03, 0x01f90d03, 0x0b0b0d03, 0xf4f50d03, 0x0d030d03,
- 0xf2fd0d03, 0xfffff2fd, 0x0504f2fd, 0xfafaf2fd, 0x06fdf2fd, 0xf901f2fd, 0xfe06f2fd, 0x01f8f2fd,
- 0x0b0af2fd, 0xf4f4f2fd, 0x0d02f2fd, 0xf2fcf2fd, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000606, 0xfffff9fa, 0x000007fe, 0xfffff802, 0xfffffe08, 0x000001f8, 0x00000d0d,
- 0xfffff2f3, 0x00000f04, 0xfffff0fc, 0x0000040f, 0xfffffbf1, 0x00000af5, 0xfffff50b, 0x000011fb,
- 0xffffee05, 0xfffffb12, 0x000004ee, 0x00001a0d, 0xffffe5f3, 0x00000d1a, 0xfffff2e6, 0x00001a1a,
- 0xffffe5e6, 0x00001d02, 0xffffe2fe, 0x0000021d, 0xfffffde3, 0x000017f0, 0xffffe810, 0xfffff018,
- 0x00000fe8, 0x00002e1c, 0xffffd1e4, 0x00001c2e, 0xffffe3d2, 0x000022f7, 0xffffdd09, 0xfffff723,
- 0x000008dd, 0x00002f0d, 0xffffd0f3, 0x00000d2f, 0xfffff2d1, 0x00003131, 0xffffcecf, 0x000035ff,
- 0xffffca01, 0xffffff36, 0x000000ca, 0x000022dd, 0xffffdd23, 0x00002ee6, 0xffffd11a, 0xffffe62f,
- 0x000019d1, 0x00005120, 0xffffaee0, 0x00002051, 0xffffdfaf, 0x00005338, 0xffffacc8, 0x00003853,
- 0xffffc7ad, 0x000042ee, 0xffffbd12, 0xffffee43, 0x000011bd, 0x0000560d, 0xffffa9f3, 0x00000d56,
- 0xfffff2aa, 0x00005b5b, 0xffffa4a5, 0x000062f9, 0xffff9d07, 0xfffff963, 0x0000069d, 0x000043ca,
- 0xffffbc36, 0xffffca44, 0x000035bc, 0x000059d4, 0xffffa62c, 0xffffd45a, 0x00002ba6, 0x00007bdf,
- 0xffff8421, 0xffffdf7c, 0x00002084, 0x00006699, 0xffff9967, 0x00007eaa, 0xffff8156, 0xffffaa7f,
- 0x00005581, 0x00002525, 0xffffdadb, 0x00004545, 0xffffbabb, 0x00000000, 0x06060000, 0xf9fa0000,
- 0x07fe0000, 0xf8020000, 0xfe080000, 0x01f80000, 0x0d0d0000, 0xf2f30000, 0x0f040000, 0xf0fc0000,
- 0x040f0000, 0x00000606, 0x06060606, 0xf9fa0606, 0x07fe0606, 0xf8020606, 0xfe080606, 0x01f80606,
- 0x0d0d0606, 0xf2f30606, 0x0f040606, 0xf0fc0606, 0x040f0606, 0xfffff9fa, 0x0605f9fa, 0xf9f9f9fa,
- 0x07fdf9fa, 0xf801f9fa, 0xfe07f9fa, 0x01f7f9fa, 0x0d0cf9fa, 0xf2f2f9fa, 0x0f03f9fa, 0xf0fbf9fa,
- 0x040ef9fa, 0x000007fe, 0x060607fe, 0xf9fa07fe, 0x07fe07fe, 0xf80207fe, 0xfe0807fe, 0x01f807fe,
- 0x0d0d07fe, 0xf2f307fe, 0x0f0407fe, 0xf0fc07fe, 0x040f07fe, 0xfffff802, 0x0605f802, 0xf9f9f802,
- 0x07fdf802, 0xf801f802, 0xfe07f802, 0x01f7f802, 0x0d0cf802, 0xf2f2f802, 0x0f03f802, 0xf0fbf802,
- 0x040ef802, 0xfffffe08, 0x0605fe08, 0xf9f9fe08, 0x07fdfe08, 0xf801fe08, 0xfe07fe08, 0x01f7fe08,
- 0x0d0cfe08, 0xf2f2fe08, 0x0f03fe08, 0xf0fbfe08, 0x040efe08, 0x000001f8, 0x060601f8, 0xf9fa01f8,
- 0x07fe01f8, 0xf80201f8, 0xfe0801f8, 0x01f801f8, 0x0d0d01f8, 0xf2f301f8, 0x0f0401f8, 0xf0fc01f8,
- 0x040f01f8, 0x00000d0d, 0x06060d0d, 0xf9fa0d0d, 0x07fe0d0d, 0xf8020d0d, 0xfe080d0d, 0x01f80d0d,
- 0x0d0d0d0d, 0xf2f30d0d, 0x0f040d0d, 0xf0fc0d0d, 0x040f0d0d, 0xfffff2f3, 0x0605f2f3, 0xf9f9f2f3,
- 0x07fdf2f3, 0xf801f2f3, 0xfe07f2f3, 0x01f7f2f3, 0x0d0cf2f3, 0xf2f2f2f3, 0x0f03f2f3, 0xf0fbf2f3,
- 0x040ef2f3, 0x00000f04, 0x06060f04, 0xf9fa0f04, 0x07fe0f04, 0xf8020f04, 0xfe080f04, 0x01f80f04,
- 0x0d0d0f04, 0xf2f30f04, 0x0f040f04, 0xf0fc0f04, 0x040f0f04, 0xfffff0fc, 0x0605f0fc, 0xf9f9f0fc,
- 0x07fdf0fc, 0xf801f0fc, 0xfe07f0fc, 0x01f7f0fc, 0x0d0cf0fc, 0xf2f2f0fc, 0x0f03f0fc, 0xf0fbf0fc,
- 0x040ef0fc, 0x0000040f, 0x0606040f, 0xf9fa040f, 0x07fe040f, 0xf802040f, 0xfe08040f, 0x01f8040f,
- 0x0d0d040f, 0xf2f3040f, 0x0f04040f, 0xf0fc040f, 0x040f040f, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000707, 0xfffff8f9, 0x000009fd, 0xfffff603, 0xfffffd0a, 0x000002f6, 0x00001010,
- 0xffffeff0, 0x00001205, 0xffffedfb, 0x00000512, 0xfffffaee, 0x00000cf3, 0xfffff30d, 0x000014fa,
- 0xffffeb06, 0xfffffa15, 0x000005eb, 0x00001e0f, 0xffffe1f1, 0x00000f1e, 0xfffff0e2, 0x00001e1e,
- 0xffffe1e2, 0x00002202, 0xffffddfe, 0x00000222, 0xfffffdde, 0x00001bed, 0xffffe413, 0xffffed1c,
- 0x000012e4, 0x00003620, 0xffffc9e0, 0x00002036, 0xffffdfca, 0x000028f5, 0xffffd70b, 0xfffff529,
- 0x00000ad7, 0x0000370f, 0xffffc8f1, 0x00000f37, 0xfffff0c9, 0x00003939, 0xffffc6c7, 0x00003eff,
- 0xffffc101, 0xffffff3f, 0x000000c1, 0x000027d8, 0xffffd828, 0x000036e2, 0xffffc91e, 0xffffe237,
- 0x00001dc9, 0x00005e25, 0xffffa1db, 0x0000255e, 0xffffdaa2, 0x00006041, 0xffff9fbf, 0x00004160,
- 0xffffbea0, 0x00004deb, 0xffffb215, 0xffffeb4e, 0x000014b2, 0x0000640f, 0xffff9bf1, 0x00000f64,
- 0xfffff09c, 0x00006a6a, 0xffff9596, 0x000073f8, 0xffff8c08, 0xfffff874, 0x0000078c, 0x00004ec1,
- 0xffffb13f, 0xffffc14f, 0x00003eb1, 0x000068cd, 0xffff9733, 0xffffcd69, 0x00003297, 0x00007788,
- 0xffff8878, 0x00002b2b, 0xffffd4d5, 0x00005050, 0xffffafb0, 0x00000000, 0x07070000, 0xf8f90000,
- 0x09fd0000, 0xf6030000, 0xfd0a0000, 0x02f60000, 0x10100000, 0xeff00000, 0x12050000, 0xedfb0000,
- 0x05120000, 0x00000707, 0x07070707, 0xf8f90707, 0x09fd0707, 0xf6030707, 0xfd0a0707, 0x02f60707,
- 0x10100707, 0xeff00707, 0x12050707, 0xedfb0707, 0x05120707, 0xfffff8f9, 0x0706f8f9, 0xf8f8f8f9,
- 0x09fcf8f9, 0xf602f8f9, 0xfd09f8f9, 0x02f5f8f9, 0x100ff8f9, 0xefeff8f9, 0x1204f8f9, 0xedfaf8f9,
- 0x0511f8f9, 0x000009fd, 0x070709fd, 0xf8f909fd, 0x09fd09fd, 0xf60309fd, 0xfd0a09fd, 0x02f609fd,
- 0x101009fd, 0xeff009fd, 0x120509fd, 0xedfb09fd, 0x051209fd, 0xfffff603, 0x0706f603, 0xf8f8f603,
- 0x09fcf603, 0xf602f603, 0xfd09f603, 0x02f5f603, 0x100ff603, 0xefeff603, 0x1204f603, 0xedfaf603,
- 0x0511f603, 0xfffffd0a, 0x0706fd0a, 0xf8f8fd0a, 0x09fcfd0a, 0xf602fd0a, 0xfd09fd0a, 0x02f5fd0a,
- 0x100ffd0a, 0xefeffd0a, 0x1204fd0a, 0xedfafd0a, 0x0511fd0a, 0x000002f6, 0x070702f6, 0xf8f902f6,
- 0x09fd02f6, 0xf60302f6, 0xfd0a02f6, 0x02f602f6, 0x101002f6, 0xeff002f6, 0x120502f6, 0xedfb02f6,
- 0x051202f6, 0x00001010, 0x07071010, 0xf8f91010, 0x09fd1010, 0xf6031010, 0xfd0a1010, 0x02f61010,
- 0x10101010, 0xeff01010, 0x12051010, 0xedfb1010, 0x05121010, 0xffffeff0, 0x0706eff0, 0xf8f8eff0,
- 0x09fceff0, 0xf602eff0, 0xfd09eff0, 0x02f5eff0, 0x100feff0, 0xefefeff0, 0x1204eff0, 0xedfaeff0,
- 0x0511eff0, 0x00001205, 0x07071205, 0xf8f91205, 0x09fd1205, 0xf6031205, 0xfd0a1205, 0x02f61205,
- 0x10101205, 0xeff01205, 0x12051205, 0xedfb1205, 0x05121205, 0xffffedfb, 0x0706edfb, 0xf8f8edfb,
- 0x09fcedfb, 0xf602edfb, 0xfd09edfb, 0x02f5edfb, 0x100fedfb, 0xefefedfb, 0x1204edfb, 0xedfaedfb,
- 0x0511edfb, 0x00000512, 0x07070512, 0xf8f90512, 0x09fd0512, 0xf6030512, 0xfd0a0512, 0x02f60512,
- 0x10100512, 0xeff00512, 0x12050512, 0xedfb0512, 0x05120512, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000808, 0xfffff7f8, 0x00000afd, 0xfffff503, 0xfffffd0b, 0x000002f5, 0x00001212,
- 0xffffedee, 0x00001405, 0xffffebfb, 0x00000514, 0xfffffaec, 0x00000ef1, 0xfffff10f, 0x000017f9,
- 0xffffe807, 0xfffff918, 0x000006e8, 0x00002311, 0xffffdcef, 0x00001123, 0xffffeedd, 0x00002222,
- 0xffffddde, 0x00002603, 0xffffd9fd, 0x00000326, 0xfffffcda, 0x00001fea, 0xffffe016, 0xffffea20,
- 0x000015e0, 0x00003d25, 0xffffc2db, 0x0000253d, 0xffffdac3, 0x00002ef3, 0xffffd10d, 0xfffff32f,
- 0x00000cd1, 0x00003f11, 0xffffc0ef, 0x0000113f, 0xffffeec1, 0x00004141, 0xffffbebf, 0x000047ff,
- 0xffffb801, 0xffffff48, 0x000000b8, 0x00002dd2, 0xffffd22e, 0x00003edd, 0xffffc123, 0xffffdd3f,
- 0x000022c1, 0x00006b2b, 0xffff94d5, 0x00002b6b, 0xffffd495, 0x00006e4b, 0xffff91b5, 0x00004b6e,
- 0xffffb492, 0x000058e8, 0xffffa718, 0xffffe859, 0x000017a7, 0x00007211, 0xffff8def, 0x00001172,
- 0xffffee8e, 0x00007979, 0xffff8687, 0x00005ab8, 0xffffa548, 0xffffb85b, 0x000047a5, 0x000077c6,
- 0xffff883a, 0xffffc678, 0x00003988, 0x00003131, 0xffffcecf, 0x00005c5c, 0xffffa3a4, 0x00000000,
- 0x08080000, 0xf7f80000, 0x0afd0000, 0xf5030000, 0xfd0b0000, 0x02f50000, 0x12120000, 0xedee0000,
- 0x14050000, 0xebfb0000, 0x05140000, 0x00000808, 0x08080808, 0xf7f80808, 0x0afd0808, 0xf5030808,
- 0xfd0b0808, 0x02f50808, 0x12120808, 0xedee0808, 0x14050808, 0xebfb0808, 0x05140808, 0xfffff7f8,
- 0x0807f7f8, 0xf7f7f7f8, 0x0afcf7f8, 0xf502f7f8, 0xfd0af7f8, 0x02f4f7f8, 0x1211f7f8, 0xededf7f8,
- 0x1404f7f8, 0xebfaf7f8, 0x0513f7f8, 0x00000afd, 0x08080afd, 0xf7f80afd, 0x0afd0afd, 0xf5030afd,
- 0xfd0b0afd, 0x02f50afd, 0x12120afd, 0xedee0afd, 0x14050afd, 0xebfb0afd, 0x05140afd, 0xfffff503,
- 0x0807f503, 0xf7f7f503, 0x0afcf503, 0xf502f503, 0xfd0af503, 0x02f4f503, 0x1211f503, 0xededf503,
- 0x1404f503, 0xebfaf503, 0x0513f503, 0xfffffd0b, 0x0807fd0b, 0xf7f7fd0b, 0x0afcfd0b, 0xf502fd0b,
- 0xfd0afd0b, 0x02f4fd0b, 0x1211fd0b, 0xededfd0b, 0x1404fd0b, 0xebfafd0b, 0x0513fd0b, 0x000002f5,
- 0x080802f5, 0xf7f802f5, 0x0afd02f5, 0xf50302f5, 0xfd0b02f5, 0x02f502f5, 0x121202f5, 0xedee02f5,
- 0x140502f5, 0xebfb02f5, 0x051402f5, 0x00001212, 0x08081212, 0xf7f81212, 0x0afd1212, 0xf5031212,
- 0xfd0b1212, 0x02f51212, 0x12121212, 0xedee1212, 0x14051212, 0xebfb1212, 0x05141212, 0xffffedee,
- 0x0807edee, 0xf7f7edee, 0x0afcedee, 0xf502edee, 0xfd0aedee, 0x02f4edee, 0x1211edee, 0xedededee,
- 0x1404edee, 0xebfaedee, 0x0513edee, 0x00001405, 0x08081405, 0xf7f81405, 0x0afd1405, 0xf5031405,
- 0xfd0b1405, 0x02f51405, 0x12121405, 0xedee1405, 0x14051405, 0xebfb1405, 0x05141405, 0xffffebfb,
- 0x0807ebfb, 0xf7f7ebfb, 0x0afcebfb, 0xf502ebfb, 0xfd0aebfb, 0x02f4ebfb, 0x1211ebfb, 0xededebfb,
- 0x1404ebfb, 0xebfaebfb, 0x0513ebfb, 0x00000514, 0x08080514, 0xf7f80514, 0x0afd0514, 0xf5030514,
- 0xfd0b0514, 0x02f50514, 0x12120514, 0xedee0514, 0x14050514, 0xebfb0514, 0x05140514, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000909, 0xfffff6f7, 0x00000bfd, 0xfffff403, 0xfffffd0c, 0x000002f4, 0x00001414,
- 0xffffebec, 0x00001706, 0xffffe8fa, 0x00000617, 0xfffff9e9, 0x000010ef, 0xffffef11, 0x00001af9,
- 0xffffe507, 0xfffff91b, 0x000006e5, 0x00002713, 0xffffd8ed, 0x00001327, 0xffffecd9, 0x00002727,
- 0xffffd8d9, 0x00002b03, 0xffffd4fd, 0x0000032b, 0xfffffcd5, 0x000023e8, 0xffffdc18, 0xffffe824,
- 0x000017dc, 0x0000452a, 0xffffbad6, 0x00002a45, 0xffffd5bb, 0x000034f2, 0xffffcb0e, 0xfffff235,
- 0x00000dcb, 0x00004713, 0xffffb8ed, 0x00001347, 0xffffecb9, 0x00004949, 0xffffb6b7, 0x00004ffe,
- 0xffffb002, 0xfffffe50, 0x000001b0, 0x000033cc, 0xffffcc34, 0x000045d9, 0xffffba27, 0xffffd946,
- 0x000026ba, 0x00007930, 0xffff86d0, 0x00003079, 0xffffcf87, 0x00007c54, 0xffff83ac, 0x0000547c,
- 0xffffab84, 0x000063e5, 0xffff9c1b, 0xffffe564, 0x00001a9c, 0x000065af, 0xffff9a51, 0xffffaf66,
- 0x0000509a, 0x00003737, 0xffffc8c9, 0x00006868, 0xffff9798, 0x00000000, 0x09090000, 0xf6f70000,
- 0x0bfd0000, 0xf4030000, 0xfd0c0000, 0x02f40000, 0x14140000, 0xebec0000, 0x17060000, 0xe8fa0000,
- 0x06170000, 0xf9e90000, 0x00000909, 0x09090909, 0xf6f70909, 0x0bfd0909, 0xf4030909, 0xfd0c0909,
- 0x02f40909, 0x14140909, 0xebec0909, 0x17060909, 0xe8fa0909, 0x06170909, 0xf9e90909, 0xfffff6f7,
- 0x0908f6f7, 0xf6f6f6f7, 0x0bfcf6f7, 0xf402f6f7, 0xfd0bf6f7, 0x02f3f6f7, 0x1413f6f7, 0xebebf6f7,
- 0x1705f6f7, 0xe8f9f6f7, 0x0616f6f7, 0xf9e8f6f7, 0x00000bfd, 0x09090bfd, 0xf6f70bfd, 0x0bfd0bfd,
- 0xf4030bfd, 0xfd0c0bfd, 0x02f40bfd, 0x14140bfd, 0xebec0bfd, 0x17060bfd, 0xe8fa0bfd, 0x06170bfd,
- 0xf9e90bfd, 0xfffff403, 0x0908f403, 0xf6f6f403, 0x0bfcf403, 0xf402f403, 0xfd0bf403, 0x02f3f403,
- 0x1413f403, 0xebebf403, 0x1705f403, 0xe8f9f403, 0x0616f403, 0xf9e8f403, 0xfffffd0c, 0x0908fd0c,
- 0xf6f6fd0c, 0x0bfcfd0c, 0xf402fd0c, 0xfd0bfd0c, 0x02f3fd0c, 0x1413fd0c, 0xebebfd0c, 0x1705fd0c,
- 0xe8f9fd0c, 0x0616fd0c, 0xf9e8fd0c, 0x000002f4, 0x090902f4, 0xf6f702f4, 0x0bfd02f4, 0xf40302f4,
- 0xfd0c02f4, 0x02f402f4, 0x141402f4, 0xebec02f4, 0x170602f4, 0xe8fa02f4, 0x061702f4, 0xf9e902f4,
- 0x00001414, 0x09091414, 0xf6f71414, 0x0bfd1414, 0xf4031414, 0xfd0c1414, 0x02f41414, 0x14141414,
- 0xebec1414, 0x17061414, 0xe8fa1414, 0x06171414, 0xf9e91414, 0xffffebec, 0x0908ebec, 0xf6f6ebec,
- 0x0bfcebec, 0xf402ebec, 0xfd0bebec, 0x02f3ebec, 0x1413ebec, 0xebebebec, 0x1705ebec, 0xe8f9ebec,
- 0x0616ebec, 0xf9e8ebec, 0x00001706, 0x09091706, 0xf6f71706, 0x0bfd1706, 0xf4031706, 0xfd0c1706,
- 0x02f41706, 0x14141706, 0xebec1706, 0x17061706, 0xe8fa1706, 0x06171706, 0xf9e91706, 0xffffe8fa,
- 0x0908e8fa, 0xf6f6e8fa, 0x0bfce8fa, 0xf402e8fa, 0xfd0be8fa, 0x02f3e8fa, 0x1413e8fa, 0xebebe8fa,
- 0x1705e8fa, 0xe8f9e8fa, 0x0616e8fa, 0xf9e8e8fa, 0x00000617, 0x09090617, 0xf6f70617, 0x0bfd0617,
- 0xf4030617, 0xfd0c0617, 0x02f40617, 0x14140617, 0xebec0617, 0x17060617, 0xe8fa0617, 0x06170617,
- 0xf9e90617, 0xfffff9e9, 0x0908f9e9, 0xf6f6f9e9, 0x0bfcf9e9, 0xf402f9e9, 0xfd0bf9e9, 0x02f3f9e9,
- 0x1413f9e9, 0xebebf9e9, 0x1705f9e9, 0xe8f9f9e9, 0x0616f9e9, 0xf9e8f9e9, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000202, 0xfffffdfe, 0x00000200, 0xfffffe00, 0x00000002, 0xfffffffe, 0x00000404,
- 0xfffffbfc, 0x00000400, 0xfffffc00, 0x00000004, 0xfffffffc, 0x000003fc, 0xfffffc04, 0x000005fe,
- 0xfffffa02, 0xfffffe06, 0x000001fa, 0x00000804, 0xfffff7fc, 0x00000408, 0xfffffbf8, 0x00000808,
- 0xfffff7f8, 0x00000a00, 0xfffff600, 0x0000000a, 0xfffffff6, 0x000007fc, 0xfffff804, 0xfffffc08,
- 0x000003f8, 0x00000e08, 0xfffff1f8, 0x0000080e, 0xfffff7f2, 0x00000bfe, 0xfffff402, 0xfffffe0c,
- 0x000001f4, 0x00001004, 0xffffeffc, 0x00000410, 0xfffffbf0, 0x00001010, 0xffffeff0, 0x00001200,
- 0xffffee00, 0x00000012, 0xffffffee, 0x00000bf4, 0xfffff40c, 0x00000ff8, 0xfffff008, 0xfffff810,
- 0x000007f0, 0x00001a0a, 0xffffe5f6, 0x00000a1a, 0xfffff5e6, 0x00001c12, 0xffffe3ee, 0x0000121c,
- 0xffffede4, 0x000015fa, 0xffffea06, 0xfffffa16, 0x000005ea, 0x00001c04, 0xffffe3fc, 0x0000041c,
- 0xfffffbe4, 0x00001e1e, 0xffffe1e2, 0x00001ffe, 0xffffe002, 0xfffffe20, 0x000001e0, 0x000015ee,
- 0xffffea12, 0xffffee16, 0x000011ea, 0x00001df2, 0xffffe20e, 0xfffff21e, 0x00000de2, 0x00002e16,
- 0xffffd1ea, 0x0000162e, 0xffffe9d2, 0x00002e0c, 0xffffd1f4, 0x00000c2e, 0xfffff3d2, 0x00003022,
- 0xffffcfde, 0x00002230, 0xffffddd0, 0x000027f6, 0xffffd80a, 0xfffff628, 0x000009d8, 0x00003204,
- 0xffffcdfc, 0x00000432, 0xfffffbce, 0x00003636, 0xffffc9ca, 0x000021de, 0xffffde22, 0x000029e4,
- 0xffffd61c, 0xffffe42a, 0x00001bd6, 0x00003bfa, 0xffffc406, 0xfffffa3c, 0x000005c4, 0x00004c1a,
- 0xffffb3e6, 0x00001a4c, 0xffffe5b4, 0x00004c2a, 0xffffb3d6, 0x00002a4c, 0xffffd5b4, 0x000035e8,
- 0xffffca18, 0xffffe836, 0x000017ca, 0x00004e0e, 0xffffb1f2, 0x00000e4e, 0xfffff1b2, 0x0000523e,
- 0xffffadc2, 0x00003e52, 0xffffc1ae, 0x000049ec, 0xffffb614, 0xffffec4a, 0x000013b6, 0x00005802,
- 0xffffa7fe, 0x00000258, 0xfffffda8, 0x00005c5c, 0xffffa3a4, 0x00003bcc, 0xffffc434, 0xffffcc3c,
- 0x000033c4, 0x00007634, 0xffff89cc, 0x00003476, 0xffffcb8a, 0x000049d4, 0xffffb62c, 0xffffd44a,
- 0x00002bb6, 0x0000764a, 0xffff89b6, 0x00004a76, 0xffffb58a, 0x00007620, 0xffff89e0, 0x00002076,
- 0xffffdf8a, 0x000065f4, 0xffff9a0c, 0xfffff466, 0x00000b9a, 0x00005fd8, 0xffffa028, 0xffffd860,
- 0x000027a0, 0x000075de, 0xffff8a22, 0xffffde76, 0x0000218a, 0x000057a8, 0xffffa858, 0x000067b2,
- 0xffff984e, 0xffffb268, 0x00004d98, 0x00000c0c, 0xfffff3f4, 0x00001616, 0xffffe9ea, 0x00002a2a,
- 0xffffd5d6, 0x00004848, 0xffffb7b8, 0x00000000, 0x02020000, 0xfdfe0000, 0x02000000, 0xfe000000,
- 0x00020000, 0xfffe0000, 0x00000202, 0x02020202, 0xfdfe0202, 0x02000202, 0xfe000202, 0x00020202,
- 0xfffe0202, 0xfffffdfe, 0x0201fdfe, 0xfdfdfdfe, 0x01fffdfe, 0xfdfffdfe, 0x0001fdfe, 0xfffdfdfe,
- 0x00000200, 0x02020200, 0xfdfe0200, 0x02000200, 0xfe000200, 0x00020200, 0xfffe0200, 0xfffffe00,
- 0x0201fe00, 0xfdfdfe00, 0x01fffe00, 0xfdfffe00, 0x0001fe00, 0xfffdfe00, 0x00000002, 0x02020002,
- 0xfdfe0002, 0x02000002, 0xfe000002, 0x00020002, 0xfffe0002, 0xfffffffe, 0x0201fffe, 0xfdfdfffe,
- 0x01fffffe, 0xfdfffffe, 0x0001fffe, 0xfffdfffe, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000303, 0xfffffcfd, 0x00000300, 0xfffffd00, 0x00000003, 0xfffffffd, 0x00000606,
- 0xfffff9fa, 0x00000903, 0xfffff6fd, 0x00000309, 0xfffffcf7, 0x000008fd, 0xfffff703, 0xfffffd09,
- 0x000002f7, 0x000005fa, 0xfffffa06, 0x00000c06, 0xfffff3fa, 0x0000060c, 0xfffff9f4, 0x00000c0c,
- 0xfffff3f4, 0x00000f00, 0xfffff100, 0x0000000f, 0xfffffff1, 0x00000bf7, 0xfffff409, 0xfffff70c,
- 0x000008f4, 0x0000180f, 0xffffe7f1, 0x00000f18, 0xfffff0e8, 0x000011fa, 0xffffee06, 0xfffffa12,
- 0x000005ee, 0x00001806, 0xffffe7fa, 0x00000618, 0xfffff9e8, 0x00001818, 0xffffe7e8, 0x00001b00,
- 0xffffe500, 0x0000001b, 0xffffffe5, 0x000011ee, 0xffffee12, 0x000017f4, 0xffffe80c, 0xfffff418,
- 0x00000be8, 0x0000270f, 0xffffd8f1, 0x00000f27, 0xfffff0d9, 0x00002a1b, 0xffffd5e5, 0x00001b2a,
- 0xffffe4d6, 0x000020f7, 0xffffdf09, 0xfffff721, 0x000008df, 0x00002a06, 0xffffd5fa, 0x0000062a,
- 0xfffff9d6, 0x00002d2d, 0xffffd2d3, 0x000032fd, 0xffffcd03, 0xfffffd33, 0x000002cd, 0x000020e5,
- 0xffffdf1b, 0xffffe521, 0x00001adf, 0x00002ceb, 0xffffd315, 0xffffeb2d, 0x000014d3, 0x00004521,
- 0xffffbadf, 0x00002145, 0xffffdebb, 0x00004512, 0xffffbaee, 0x00001245, 0xffffedbb, 0x00004836,
- 0xffffb7ca, 0x00003648, 0xffffc9b8, 0x00003eee, 0xffffc112, 0xffffee3f, 0x000011c1, 0x00004e06,
- 0xffffb1fa, 0x0000064e, 0xfffff9b2, 0x00005151, 0xffffaeaf, 0x000032cd, 0xffffcd33, 0x00003ed6,
- 0xffffc12a, 0xffffd63f, 0x000029c1, 0x000059f7, 0xffffa609, 0xfffff75a, 0x000008a6, 0x0000722a,
- 0xffff8dd6, 0x00002a72, 0xffffd58e, 0x0000753f, 0xffff8ac1, 0x00003f75, 0xffffc08b, 0x000050dc,
- 0xffffaf24, 0xffffdc51, 0x000023af, 0x00007815, 0xffff87eb, 0x00001578, 0xffffea88, 0x00007b60,
- 0xffff84a0, 0x0000607b, 0xffff9f85, 0x00006ee2, 0xffff911e, 0xffffe26f, 0x00001d91, 0x00005cb2,
- 0xffffa34e, 0xffffb25d, 0x00004da3, 0x000071bb, 0xffff8e45, 0xffffbb72, 0x0000448e, 0x00001212,
- 0xffffedee, 0x00002121, 0xffffdedf, 0x00003f3f, 0xffffc0c1, 0x00006c6c, 0xffff9394, 0x00000000,
- 0x03030000, 0xfcfd0000, 0x03000000, 0xfd000000, 0x00030000, 0xfffd0000, 0x06060000, 0xf9fa0000,
- 0x00000303, 0x03030303, 0xfcfd0303, 0x03000303, 0xfd000303, 0x00030303, 0xfffd0303, 0x06060303,
- 0xf9fa0303, 0xfffffcfd, 0x0302fcfd, 0xfcfcfcfd, 0x02fffcfd, 0xfcfffcfd, 0x0002fcfd, 0xfffcfcfd,
- 0x0605fcfd, 0xf9f9fcfd, 0x00000300, 0x03030300, 0xfcfd0300, 0x03000300, 0xfd000300, 0x00030300,
- 0xfffd0300, 0x06060300, 0xf9fa0300, 0xfffffd00, 0x0302fd00, 0xfcfcfd00, 0x02fffd00, 0xfcfffd00,
- 0x0002fd00, 0xfffcfd00, 0x0605fd00, 0xf9f9fd00, 0x00000003, 0x03030003, 0xfcfd0003, 0x03000003,
- 0xfd000003, 0x00030003, 0xfffd0003, 0x06060003, 0xf9fa0003, 0xfffffffd, 0x0302fffd, 0xfcfcfffd,
- 0x02fffffd, 0xfcfffffd, 0x0002fffd, 0xfffcfffd, 0x0605fffd, 0xf9f9fffd, 0x00000606, 0x03030606,
- 0xfcfd0606, 0x03000606, 0xfd000606, 0x00030606, 0xfffd0606, 0x06060606, 0xf9fa0606, 0xfffff9fa,
- 0x0302f9fa, 0xfcfcf9fa, 0x02fff9fa, 0xfcfff9fa, 0x0002f9fa, 0xfffcf9fa, 0x0605f9fa, 0xf9f9f9fa,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000404, 0xfffffbfc, 0x00000400, 0xfffffc00, 0x00000004, 0xfffffffc, 0x00000804,
- 0xfffff7fc, 0x00000408, 0xfffffbf8, 0x00000808, 0xfffff7f8, 0x000007f8, 0xfffff808, 0x00000bfc,
- 0xfffff404, 0xfffffc0c, 0x000003f4, 0x00001008, 0xffffeff8, 0x00000810, 0xfffff7f0, 0x00001010,
- 0xffffeff0, 0x00001400, 0xffffec00, 0x00000014, 0xffffffec, 0x00000ff4, 0xfffff00c, 0xfffff410,
- 0x00000bf0, 0x000017fc, 0xffffe804, 0xfffffc18, 0x000003e8, 0x00002010, 0xffffdff0, 0x00001020,
- 0xffffefe0, 0x00002008, 0xffffdff8, 0x00000820, 0xfffff7e0, 0x00002020, 0xffffdfe0, 0x00002400,
- 0xffffdc00, 0x00000024, 0xffffffdc, 0x000017e8, 0xffffe818, 0x00001ff0, 0xffffe010, 0xfffff020,
- 0x00000fe0, 0x00003414, 0xffffcbec, 0x00001434, 0xffffebcc, 0x00003824, 0xffffc7dc, 0x00002438,
- 0xffffdbc8, 0x00002bf4, 0xffffd40c, 0xfffff42c, 0x00000bd4, 0x00003808, 0xffffc7f8, 0x00000838,
- 0xfffff7c8, 0x00003c3c, 0xffffc3c4, 0x00003ffc, 0xffffc004, 0xfffffc40, 0x000003c0, 0x00002bdc,
- 0xffffd424, 0xffffdc2c, 0x000023d4, 0x00003be4, 0xffffc41c, 0xffffe43c, 0x00001bc4, 0x00005c2c,
- 0xffffa3d4, 0x00002c5c, 0xffffd3a4, 0x00005c18, 0xffffa3e8, 0x0000185c, 0xffffe7a4, 0x00006048,
- 0xffff9fb8, 0x00004860, 0xffffb7a0, 0x000053ec, 0xffffac14, 0xffffec54, 0x000013ac, 0x00006408,
- 0xffff9bf8, 0x00000864, 0xfffff79c, 0x00006c6c, 0xffff9394, 0x000043bc, 0xffffbc44, 0x000053c8,
- 0xffffac38, 0xffffc854, 0x000037ac, 0x000077f4, 0xffff880c, 0xfffff478, 0x00000b88, 0x00006bd0,
- 0xffff9430, 0xffffd06c, 0x00002f94, 0x00007b98, 0xffff8468, 0xffff987c, 0x00006784, 0x00001818,
- 0xffffe7e8, 0x00002c2c, 0xffffd3d4, 0x00005454, 0xffffabac, 0x00000000, 0x04040000, 0xfbfc0000,
- 0x04000000, 0xfc000000, 0x00040000, 0xfffc0000, 0x08040000, 0xf7fc0000, 0x04080000, 0x00000404,
- 0x04040404, 0xfbfc0404, 0x04000404, 0xfc000404, 0x00040404, 0xfffc0404, 0x08040404, 0xf7fc0404,
- 0x04080404, 0xfffffbfc, 0x0403fbfc, 0xfbfbfbfc, 0x03fffbfc, 0xfbfffbfc, 0x0003fbfc, 0xfffbfbfc,
- 0x0803fbfc, 0xf7fbfbfc, 0x0407fbfc, 0x00000400, 0x04040400, 0xfbfc0400, 0x04000400, 0xfc000400,
- 0x00040400, 0xfffc0400, 0x08040400, 0xf7fc0400, 0x04080400, 0xfffffc00, 0x0403fc00, 0xfbfbfc00,
- 0x03fffc00, 0xfbfffc00, 0x0003fc00, 0xfffbfc00, 0x0803fc00, 0xf7fbfc00, 0x0407fc00, 0x00000004,
- 0x04040004, 0xfbfc0004, 0x04000004, 0xfc000004, 0x00040004, 0xfffc0004, 0x08040004, 0xf7fc0004,
- 0x04080004, 0xfffffffc, 0x0403fffc, 0xfbfbfffc, 0x03fffffc, 0xfbfffffc, 0x0003fffc, 0xfffbfffc,
- 0x0803fffc, 0xf7fbfffc, 0x0407fffc, 0x00000804, 0x04040804, 0xfbfc0804, 0x04000804, 0xfc000804,
- 0x00040804, 0xfffc0804, 0x08040804, 0xf7fc0804, 0x04080804, 0xfffff7fc, 0x0403f7fc, 0xfbfbf7fc,
- 0x03fff7fc, 0xfbfff7fc, 0x0003f7fc, 0xfffbf7fc, 0x0803f7fc, 0xf7fbf7fc, 0x0407f7fc, 0x00000408,
- 0x04040408, 0xfbfc0408, 0x04000408, 0xfc000408, 0x00040408, 0xfffc0408, 0x08040408, 0xf7fc0408,
- 0x04080408, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000505, 0xfffffafb, 0x00000500, 0xfffffb00, 0x00000005, 0xfffffffb, 0x00000a0a,
- 0xfffff5f6, 0x00000f05, 0xfffff0fb, 0x0000050f, 0xfffffaf1, 0x000009f6, 0xfffff60a, 0x00000efb,
- 0xfffff105, 0xfffffb0f, 0x000004f1, 0x0000140a, 0xffffebf6, 0x00000a14, 0xfffff5ec, 0x00001414,
- 0xffffebec, 0x00001900, 0xffffe700, 0x00000019, 0xffffffe7, 0x000013f1, 0xffffec0f, 0xfffff114,
- 0x00000eec, 0x00002819, 0xffffd7e7, 0x00001928, 0xffffe6d8, 0x00001df6, 0xffffe20a, 0xfffff61e,
- 0x000009e2, 0x0000280a, 0xffffd7f6, 0x00000a28, 0xfffff5d8, 0x00002828, 0xffffd7d8, 0x00002d00,
- 0xffffd300, 0x0000002d, 0xffffffd3, 0x00001de2, 0xffffe21e, 0x000027ec, 0xffffd814, 0xffffec28,
- 0x000013d8, 0x00004119, 0xffffbee7, 0x00001941, 0xffffe6bf, 0x0000462d, 0xffffb9d3, 0x00002d46,
- 0xffffd2ba, 0x000036f1, 0xffffc90f, 0xfffff137, 0x00000ec9, 0x0000460a, 0xffffb9f6, 0x00000a46,
- 0xfffff5ba, 0x00004b4b, 0xffffb4b5, 0x000054fb, 0xffffab05, 0xfffffb55, 0x000004ab, 0x000036d3,
- 0xffffc92d, 0xffffd337, 0x00002cc9, 0x00004add, 0xffffb523, 0xffffdd4b, 0x000022b5, 0x00007337,
- 0xffff8cc9, 0x00003773, 0xffffc88d, 0x0000731e, 0xffff8ce2, 0x00001e73, 0xffffe18d, 0x0000785a,
- 0xffff87a6, 0x00005a78, 0xffffa588, 0x000068e2, 0xffff971e, 0xffffe269, 0x00001d97, 0x000054ab,
- 0xffffab55, 0x000068ba, 0xffff9746, 0xffffba69, 0x00004597, 0x00001e1e, 0xffffe1e2, 0x00003c3c,
- 0xffffc3c4, 0x00006969, 0xffff9697, 0x00000000, 0x05050000, 0xfafb0000, 0x05000000, 0xfb000000,
- 0x00050000, 0xfffb0000, 0x0a0a0000, 0xf5f60000, 0x0f050000, 0xf0fb0000, 0x00000505, 0x05050505,
- 0xfafb0505, 0x05000505, 0xfb000505, 0x00050505, 0xfffb0505, 0x0a0a0505, 0xf5f60505, 0x0f050505,
- 0xf0fb0505, 0xfffffafb, 0x0504fafb, 0xfafafafb, 0x04fffafb, 0xfafffafb, 0x0004fafb, 0xfffafafb,
- 0x0a09fafb, 0xf5f5fafb, 0x0f04fafb, 0xf0fafafb, 0x00000500, 0x05050500, 0xfafb0500, 0x05000500,
- 0xfb000500, 0x00050500, 0xfffb0500, 0x0a0a0500, 0xf5f60500, 0x0f050500, 0xf0fb0500, 0xfffffb00,
- 0x0504fb00, 0xfafafb00, 0x04fffb00, 0xfafffb00, 0x0004fb00, 0xfffafb00, 0x0a09fb00, 0xf5f5fb00,
- 0x0f04fb00, 0xf0fafb00, 0x00000005, 0x05050005, 0xfafb0005, 0x05000005, 0xfb000005, 0x00050005,
- 0xfffb0005, 0x0a0a0005, 0xf5f60005, 0x0f050005, 0xf0fb0005, 0xfffffffb, 0x0504fffb, 0xfafafffb,
- 0x04fffffb, 0xfafffffb, 0x0004fffb, 0xfffafffb, 0x0a09fffb, 0xf5f5fffb, 0x0f04fffb, 0xf0fafffb,
- 0x00000a0a, 0x05050a0a, 0xfafb0a0a, 0x05000a0a, 0xfb000a0a, 0x00050a0a, 0xfffb0a0a, 0x0a0a0a0a,
- 0xf5f60a0a, 0x0f050a0a, 0xf0fb0a0a, 0xfffff5f6, 0x0504f5f6, 0xfafaf5f6, 0x04fff5f6, 0xfafff5f6,
- 0x0004f5f6, 0xfffaf5f6, 0x0a09f5f6, 0xf5f5f5f6, 0x0f04f5f6, 0xf0faf5f6, 0x00000f05, 0x05050f05,
- 0xfafb0f05, 0x05000f05, 0xfb000f05, 0x00050f05, 0xfffb0f05, 0x0a0a0f05, 0xf5f60f05, 0x0f050f05,
- 0xf0fb0f05, 0xfffff0fb, 0x0504f0fb, 0xfafaf0fb, 0x04fff0fb, 0xfafff0fb, 0x0004f0fb, 0xfffaf0fb,
- 0x0a09f0fb, 0xf5f5f0fb, 0x0f04f0fb, 0xf0faf0fb, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000606, 0xfffff9fa, 0x00000600, 0xfffffa00, 0x00000006, 0xfffffffa, 0x00000c0c,
- 0xfffff3f4, 0x00000c06, 0xfffff3fa, 0x0000060c, 0xfffff9f4, 0x00000bf4, 0xfffff40c, 0x000011fa,
- 0xffffee06, 0xfffffa12, 0x000005ee, 0x0000180c, 0xffffe7f4, 0x00000c18, 0xfffff3e8, 0x00001818,
- 0xffffe7e8, 0x00001e00, 0xffffe200, 0x0000001e, 0xffffffe2, 0x000017ee, 0xffffe812, 0xffffee18,
- 0x000011e8, 0x0000301e, 0xffffcfe2, 0x00001e30, 0xffffe1d0, 0x000023fa, 0xffffdc06, 0xfffffa24,
- 0x000005dc, 0x0000300c, 0xffffcff4, 0x00000c30, 0xfffff3d0, 0x00003030, 0xffffcfd0, 0x00003600,
- 0xffffca00, 0x00000036, 0xffffffca, 0x000023dc, 0xffffdc24, 0x00002fe8, 0xffffd018, 0xffffe830,
- 0x000017d0, 0x00004e1e, 0xffffb1e2, 0x00001e4e, 0xffffe1b2, 0x00005436, 0xffffabca, 0x00003654,
- 0xffffc9ac, 0x000041ee, 0xffffbe12, 0xffffee42, 0x000011be, 0x0000540c, 0xffffabf4, 0x00000c54,
- 0xfffff3ac, 0x00005a5a, 0xffffa5a6, 0x00005ffa, 0xffffa006, 0xfffffa60, 0x000005a0, 0x000041ca,
- 0xffffbe36, 0xffffca42, 0x000035be, 0x000059d6, 0xffffa62a, 0xffffd65a, 0x000029a6, 0x00007de2,
- 0xffff821e, 0xffffe27e, 0x00001d82, 0x0000659a, 0xffff9a66, 0x00007dac, 0xffff8254, 0xffffac7e,
- 0x00005382, 0x00002424, 0xffffdbdc, 0x00004242, 0xffffbdbe, 0x00000000, 0x06060000, 0xf9fa0000,
- 0x06000000, 0xfa000000, 0x00060000, 0xfffa0000, 0x0c0c0000, 0xf3f40000, 0x0c060000, 0xf3fa0000,
- 0x060c0000, 0x00000606, 0x06060606, 0xf9fa0606, 0x06000606, 0xfa000606, 0x00060606, 0xfffa0606,
- 0x0c0c0606, 0xf3f40606, 0x0c060606, 0xf3fa0606, 0x060c0606, 0xfffff9fa, 0x0605f9fa, 0xf9f9f9fa,
- 0x05fff9fa, 0xf9fff9fa, 0x0005f9fa, 0xfff9f9fa, 0x0c0bf9fa, 0xf3f3f9fa, 0x0c05f9fa, 0xf3f9f9fa,
- 0x060bf9fa, 0x00000600, 0x06060600, 0xf9fa0600, 0x06000600, 0xfa000600, 0x00060600, 0xfffa0600,
- 0x0c0c0600, 0xf3f40600, 0x0c060600, 0xf3fa0600, 0x060c0600, 0xfffffa00, 0x0605fa00, 0xf9f9fa00,
- 0x05fffa00, 0xf9fffa00, 0x0005fa00, 0xfff9fa00, 0x0c0bfa00, 0xf3f3fa00, 0x0c05fa00, 0xf3f9fa00,
- 0x060bfa00, 0x00000006, 0x06060006, 0xf9fa0006, 0x06000006, 0xfa000006, 0x00060006, 0xfffa0006,
- 0x0c0c0006, 0xf3f40006, 0x0c060006, 0xf3fa0006, 0x060c0006, 0xfffffffa, 0x0605fffa, 0xf9f9fffa,
- 0x05fffffa, 0xf9fffffa, 0x0005fffa, 0xfff9fffa, 0x0c0bfffa, 0xf3f3fffa, 0x0c05fffa, 0xf3f9fffa,
- 0x060bfffa, 0x00000c0c, 0x06060c0c, 0xf9fa0c0c, 0x06000c0c, 0xfa000c0c, 0x00060c0c, 0xfffa0c0c,
- 0x0c0c0c0c, 0xf3f40c0c, 0x0c060c0c, 0xf3fa0c0c, 0x060c0c0c, 0xfffff3f4, 0x0605f3f4, 0xf9f9f3f4,
- 0x05fff3f4, 0xf9fff3f4, 0x0005f3f4, 0xfff9f3f4, 0x0c0bf3f4, 0xf3f3f3f4, 0x0c05f3f4, 0xf3f9f3f4,
- 0x060bf3f4, 0x00000c06, 0x06060c06, 0xf9fa0c06, 0x06000c06, 0xfa000c06, 0x00060c06, 0xfffa0c06,
- 0x0c0c0c06, 0xf3f40c06, 0x0c060c06, 0xf3fa0c06, 0x060c0c06, 0xfffff3fa, 0x0605f3fa, 0xf9f9f3fa,
- 0x05fff3fa, 0xf9fff3fa, 0x0005f3fa, 0xfff9f3fa, 0x0c0bf3fa, 0xf3f3f3fa, 0x0c05f3fa, 0xf3f9f3fa,
- 0x060bf3fa, 0x0000060c, 0x0606060c, 0xf9fa060c, 0x0600060c, 0xfa00060c, 0x0006060c, 0xfffa060c,
- 0x0c0c060c, 0xf3f4060c, 0x0c06060c, 0xf3fa060c, 0x060c060c, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000707, 0xfffff8f9, 0x00000700, 0xfffff900, 0x00000007, 0xfffffff9, 0x00000e0e,
- 0xfffff1f2, 0x00001507, 0xffffeaf9, 0x00000715, 0xfffff8eb, 0x00000df2, 0xfffff20e, 0x000014f9,
- 0xffffeb07, 0xfffff915, 0x000006eb, 0x00001c0e, 0xffffe3f2, 0x00000e1c, 0xfffff1e4, 0x00001c1c,
- 0xffffe3e4, 0x00002300, 0xffffdd00, 0x00000023, 0xffffffdd, 0x00001beb, 0xffffe415, 0xffffeb1c,
- 0x000014e4, 0x00003823, 0xffffc7dd, 0x00002338, 0xffffdcc8, 0x000029f2, 0xffffd60e, 0xfffff22a,
- 0x00000dd6, 0x0000380e, 0xffffc7f2, 0x00000e38, 0xfffff1c8, 0x00003838, 0xffffc7c8, 0x00003f00,
- 0xffffc100, 0x0000003f, 0xffffffc1, 0x000029d6, 0xffffd62a, 0x000037e4, 0xffffc81c, 0xffffe438,
- 0x00001bc8, 0x00005b23, 0xffffa4dd, 0x0000235b, 0xffffdca5, 0x0000623f, 0xffff9dc1, 0x00003f62,
- 0xffffc09e, 0x00004ceb, 0xffffb315, 0xffffeb4d, 0x000014b3, 0x0000620e, 0xffff9df2, 0x00000e62,
- 0xfffff19e, 0x00006969, 0xffff9697, 0x000076f9, 0xffff8907, 0xfffff977, 0x00000689, 0x00004cc1,
- 0xffffb33f, 0xffffc14d, 0x00003eb3, 0x000068cf, 0xffff9731, 0xffffcf69, 0x00003097, 0x00007689,
- 0xffff8977, 0x00002a2a, 0xffffd5d6, 0x00004d4d, 0xffffb2b3, 0x00000000, 0x07070000, 0xf8f90000,
- 0x07000000, 0xf9000000, 0x00070000, 0xfff90000, 0x0e0e0000, 0xf1f20000, 0x15070000, 0xeaf90000,
- 0x07150000, 0x00000707, 0x07070707, 0xf8f90707, 0x07000707, 0xf9000707, 0x00070707, 0xfff90707,
- 0x0e0e0707, 0xf1f20707, 0x15070707, 0xeaf90707, 0x07150707, 0xfffff8f9, 0x0706f8f9, 0xf8f8f8f9,
- 0x06fff8f9, 0xf8fff8f9, 0x0006f8f9, 0xfff8f8f9, 0x0e0df8f9, 0xf1f1f8f9, 0x1506f8f9, 0xeaf8f8f9,
- 0x0714f8f9, 0x00000700, 0x07070700, 0xf8f90700, 0x07000700, 0xf9000700, 0x00070700, 0xfff90700,
- 0x0e0e0700, 0xf1f20700, 0x15070700, 0xeaf90700, 0x07150700, 0xfffff900, 0x0706f900, 0xf8f8f900,
- 0x06fff900, 0xf8fff900, 0x0006f900, 0xfff8f900, 0x0e0df900, 0xf1f1f900, 0x1506f900, 0xeaf8f900,
- 0x0714f900, 0x00000007, 0x07070007, 0xf8f90007, 0x07000007, 0xf9000007, 0x00070007, 0xfff90007,
- 0x0e0e0007, 0xf1f20007, 0x15070007, 0xeaf90007, 0x07150007, 0xfffffff9, 0x0706fff9, 0xf8f8fff9,
- 0x06fffff9, 0xf8fffff9, 0x0006fff9, 0xfff8fff9, 0x0e0dfff9, 0xf1f1fff9, 0x1506fff9, 0xeaf8fff9,
- 0x0714fff9, 0x00000e0e, 0x07070e0e, 0xf8f90e0e, 0x07000e0e, 0xf9000e0e, 0x00070e0e, 0xfff90e0e,
- 0x0e0e0e0e, 0xf1f20e0e, 0x15070e0e, 0xeaf90e0e, 0x07150e0e, 0xfffff1f2, 0x0706f1f2, 0xf8f8f1f2,
- 0x06fff1f2, 0xf8fff1f2, 0x0006f1f2, 0xfff8f1f2, 0x0e0df1f2, 0xf1f1f1f2, 0x1506f1f2, 0xeaf8f1f2,
- 0x0714f1f2, 0x00001507, 0x07071507, 0xf8f91507, 0x07001507, 0xf9001507, 0x00071507, 0xfff91507,
- 0x0e0e1507, 0xf1f21507, 0x15071507, 0xeaf91507, 0x07151507, 0xffffeaf9, 0x0706eaf9, 0xf8f8eaf9,
- 0x06ffeaf9, 0xf8ffeaf9, 0x0006eaf9, 0xfff8eaf9, 0x0e0deaf9, 0xf1f1eaf9, 0x1506eaf9, 0xeaf8eaf9,
- 0x0714eaf9, 0x00000715, 0x07070715, 0xf8f90715, 0x07000715, 0xf9000715, 0x00070715, 0xfff90715,
- 0x0e0e0715, 0xf1f20715, 0x15070715, 0xeaf90715, 0x07150715, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000808, 0xfffff7f8, 0x00000800, 0xfffff800, 0x00000008, 0xfffffff8, 0x00001010,
- 0xffffeff0, 0x00001008, 0xffffeff8, 0x00000810, 0xfffff7f0, 0x00000ff0, 0xfffff010, 0x000017f8,
- 0xffffe808, 0xfffff818, 0x000007e8, 0x00002010, 0xffffdff0, 0x00001020, 0xffffefe0, 0x00002020,
- 0xffffdfe0, 0x00002800, 0xffffd800, 0x00000028, 0xffffffd8, 0x00001fe8, 0xffffe018, 0xffffe820,
- 0x000017e0, 0x00004028, 0xffffbfd8, 0x00002840, 0xffffd7c0, 0x00002ff0, 0xffffd010, 0xfffff030,
- 0x00000fd0, 0x00004010, 0xffffbff0, 0x00001040, 0xffffefc0, 0x00004040, 0xffffbfc0, 0x00004800,
- 0xffffb800, 0x00000048, 0xffffffb8, 0x00002fd0, 0xffffd030, 0x00003fe0, 0xffffc020, 0xffffe040,
- 0x00001fc0, 0x00006828, 0xffff97d8, 0x00002868, 0xffffd798, 0x00007048, 0xffff8fb8, 0x00004870,
- 0xffffb790, 0x000057e8, 0xffffa818, 0xffffe858, 0x000017a8, 0x00007010, 0xffff8ff0, 0x00001070,
- 0xffffef90, 0x00007878, 0xffff8788, 0x000057b8, 0xffffa848, 0xffffb858, 0x000047a8, 0x000077c8,
- 0xffff8838, 0xffffc878, 0x00003788, 0x00003030, 0xffffcfd0, 0x00005858, 0xffffa7a8, 0x00000000,
- 0x08080000, 0xf7f80000, 0x08000000, 0xf8000000, 0x00080000, 0xfff80000, 0x10100000, 0xeff00000,
- 0x10080000, 0xeff80000, 0x08100000, 0x00000808, 0x08080808, 0xf7f80808, 0x08000808, 0xf8000808,
- 0x00080808, 0xfff80808, 0x10100808, 0xeff00808, 0x10080808, 0xeff80808, 0x08100808, 0xfffff7f8,
- 0x0807f7f8, 0xf7f7f7f8, 0x07fff7f8, 0xf7fff7f8, 0x0007f7f8, 0xfff7f7f8, 0x100ff7f8, 0xefeff7f8,
- 0x1007f7f8, 0xeff7f7f8, 0x080ff7f8, 0x00000800, 0x08080800, 0xf7f80800, 0x08000800, 0xf8000800,
- 0x00080800, 0xfff80800, 0x10100800, 0xeff00800, 0x10080800, 0xeff80800, 0x08100800, 0xfffff800,
- 0x0807f800, 0xf7f7f800, 0x07fff800, 0xf7fff800, 0x0007f800, 0xfff7f800, 0x100ff800, 0xefeff800,
- 0x1007f800, 0xeff7f800, 0x080ff800, 0x00000008, 0x08080008, 0xf7f80008, 0x08000008, 0xf8000008,
- 0x00080008, 0xfff80008, 0x10100008, 0xeff00008, 0x10080008, 0xeff80008, 0x08100008, 0xfffffff8,
- 0x0807fff8, 0xf7f7fff8, 0x07fffff8, 0xf7fffff8, 0x0007fff8, 0xfff7fff8, 0x100ffff8, 0xefeffff8,
- 0x1007fff8, 0xeff7fff8, 0x080ffff8, 0x00001010, 0x08081010, 0xf7f81010, 0x08001010, 0xf8001010,
- 0x00081010, 0xfff81010, 0x10101010, 0xeff01010, 0x10081010, 0xeff81010, 0x08101010, 0xffffeff0,
- 0x0807eff0, 0xf7f7eff0, 0x07ffeff0, 0xf7ffeff0, 0x0007eff0, 0xfff7eff0, 0x100feff0, 0xefefeff0,
- 0x1007eff0, 0xeff7eff0, 0x080feff0, 0x00001008, 0x08081008, 0xf7f81008, 0x08001008, 0xf8001008,
- 0x00081008, 0xfff81008, 0x10101008, 0xeff01008, 0x10081008, 0xeff81008, 0x08101008, 0xffffeff8,
- 0x0807eff8, 0xf7f7eff8, 0x07ffeff8, 0xf7ffeff8, 0x0007eff8, 0xfff7eff8, 0x100feff8, 0xefefeff8,
- 0x1007eff8, 0xeff7eff8, 0x080feff8, 0x00000810, 0x08080810, 0xf7f80810, 0x08000810, 0xf8000810,
- 0x00080810, 0xfff80810, 0x10100810, 0xeff00810, 0x10080810, 0xeff80810, 0x08100810, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000909, 0xfffff6f7, 0x00000900, 0xfffff700, 0x00000009, 0xfffffff7, 0x00001212,
- 0xffffedee, 0x00001b09, 0xffffe4f7, 0x0000091b, 0xfffff6e5, 0x000011ee, 0xffffee12, 0x00001af7,
- 0xffffe509, 0xfffff71b, 0x000008e5, 0x00002412, 0xffffdbee, 0x00001224, 0xffffeddc, 0x00002424,
- 0xffffdbdc, 0x00002d00, 0xffffd300, 0x0000002d, 0xffffffd3, 0x000023e5, 0xffffdc1b, 0xffffe524,
- 0x00001adc, 0x0000482d, 0xffffb7d3, 0x00002d48, 0xffffd2b8, 0x000035ee, 0xffffca12, 0xffffee36,
- 0x000011ca, 0x00004812, 0xffffb7ee, 0x00001248, 0xffffedb8, 0x00004848, 0xffffb7b8, 0x00005100,
- 0xffffaf00, 0x00000051, 0xffffffaf, 0x000035ca, 0xffffca36, 0x000047dc, 0xffffb824, 0xffffdc48,
- 0x000023b8, 0x0000752d, 0xffff8ad3, 0x00002d75, 0xffffd28b, 0x00007e51, 0xffff81af, 0x0000517e,
- 0xffffae82, 0x000062e5, 0xffff9d1b, 0xffffe563, 0x00001a9d, 0x000062af, 0xffff9d51, 0xffffaf63,
- 0x0000509d, 0x00003636, 0xffffc9ca, 0x00006c6c, 0xffff9394, 0x00000000, 0x09090000, 0xf6f70000,
- 0x09000000, 0xf7000000, 0x00090000, 0xfff70000, 0x12120000, 0xedee0000, 0x1b090000, 0xe4f70000,
- 0x091b0000, 0xf6e50000, 0x00000909, 0x09090909, 0xf6f70909, 0x09000909, 0xf7000909, 0x00090909,
- 0xfff70909, 0x12120909, 0xedee0909, 0x1b090909, 0xe4f70909, 0x091b0909, 0xf6e50909, 0xfffff6f7,
- 0x0908f6f7, 0xf6f6f6f7, 0x08fff6f7, 0xf6fff6f7, 0x0008f6f7, 0xfff6f6f7, 0x1211f6f7, 0xededf6f7,
- 0x1b08f6f7, 0xe4f6f6f7, 0x091af6f7, 0xf6e4f6f7, 0x00000900, 0x09090900, 0xf6f70900, 0x09000900,
- 0xf7000900, 0x00090900, 0xfff70900, 0x12120900, 0xedee0900, 0x1b090900, 0xe4f70900, 0x091b0900,
- 0xf6e50900, 0xfffff700, 0x0908f700, 0xf6f6f700, 0x08fff700, 0xf6fff700, 0x0008f700, 0xfff6f700,
- 0x1211f700, 0xededf700, 0x1b08f700, 0xe4f6f700, 0x091af700, 0xf6e4f700, 0x00000009, 0x09090009,
- 0xf6f70009, 0x09000009, 0xf7000009, 0x00090009, 0xfff70009, 0x12120009, 0xedee0009, 0x1b090009,
- 0xe4f70009, 0x091b0009, 0xf6e50009, 0xfffffff7, 0x0908fff7, 0xf6f6fff7, 0x08fffff7, 0xf6fffff7,
- 0x0008fff7, 0xfff6fff7, 0x1211fff7, 0xededfff7, 0x1b08fff7, 0xe4f6fff7, 0x091afff7, 0xf6e4fff7,
- 0x00001212, 0x09091212, 0xf6f71212, 0x09001212, 0xf7001212, 0x00091212, 0xfff71212, 0x12121212,
- 0xedee1212, 0x1b091212, 0xe4f71212, 0x091b1212, 0xf6e51212, 0xffffedee, 0x0908edee, 0xf6f6edee,
- 0x08ffedee, 0xf6ffedee, 0x0008edee, 0xfff6edee, 0x1211edee, 0xedededee, 0x1b08edee, 0xe4f6edee,
- 0x091aedee, 0xf6e4edee, 0x00001b09, 0x09091b09, 0xf6f71b09, 0x09001b09, 0xf7001b09, 0x00091b09,
- 0xfff71b09, 0x12121b09, 0xedee1b09, 0x1b091b09, 0xe4f71b09, 0x091b1b09, 0xf6e51b09, 0xffffe4f7,
- 0x0908e4f7, 0xf6f6e4f7, 0x08ffe4f7, 0xf6ffe4f7, 0x0008e4f7, 0xfff6e4f7, 0x1211e4f7, 0xedede4f7,
- 0x1b08e4f7, 0xe4f6e4f7, 0x091ae4f7, 0xf6e4e4f7, 0x0000091b, 0x0909091b, 0xf6f7091b, 0x0900091b,
- 0xf700091b, 0x0009091b, 0xfff7091b, 0x1212091b, 0xedee091b, 0x1b09091b, 0xe4f7091b, 0x091b091b,
- 0xf6e5091b, 0xfffff6e5, 0x0908f6e5, 0xf6f6f6e5, 0x08fff6e5, 0xf6fff6e5, 0x0008f6e5, 0xfff6f6e5,
- 0x1211f6e5, 0xededf6e5, 0x1b08f6e5, 0xe4f6f6e5, 0x091af6e5, 0xf6e4f6e5, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000202, 0xfffffdfe, 0x00000300, 0xfffffd00, 0x00000003, 0xfffffffd, 0x00000606,
- 0xfffff9fa, 0x00000700, 0xfffff900, 0x00000007, 0xfffffff9, 0x000004fb, 0xfffffb05, 0xfffffb05,
- 0x000004fb, 0x00000b06, 0xfffff4fa, 0x0000060b, 0xfffff9f5, 0x00000800, 0xfffff800, 0x00000008,
- 0xfffffff8, 0x00000b0b, 0xfffff4f5, 0x00000c00, 0xfffff400, 0x0000000c, 0xfffffff4, 0x0000110c,
- 0xffffeef4, 0x00000c11, 0xfffff3ef, 0x00001111, 0xffffeeef, 0x00001206, 0xffffedfa, 0x00000612,
- 0xfffff9ee, 0x00000af8, 0xfffff508, 0xfffff80b, 0x000007f5, 0x00000f00, 0xfffff100, 0x0000000f,
- 0xfffffff1, 0x00001400, 0xffffec00, 0x00000014, 0xffffffec, 0x00001912, 0xffffe6ee, 0x00001219,
- 0xffffede7, 0x0000190b, 0xffffe6f5, 0x00000b19, 0xfffff4e7, 0x00001919, 0xffffe6e7, 0x00000df2,
- 0xfffff20e, 0xfffff20e, 0x00000df2, 0x00001a00, 0xffffe600, 0x0000001a, 0xffffffe6, 0x000011f5,
- 0xffffee0b, 0xfffff512, 0x00000aee, 0x000015f9, 0xffffea07, 0xfffff916, 0x000006ea, 0x0000221a,
- 0xffffdde6, 0x00001a22, 0xffffe5de, 0x00002212, 0xffffddee, 0x00001222, 0xffffedde, 0x00002222,
- 0xffffddde, 0x0000230b, 0xffffdcf5, 0x00000b23, 0xfffff4dd, 0x00001d00, 0xffffe300, 0x0000001d,
- 0xffffffe3, 0x000015ed, 0xffffea13, 0xffffed16, 0x000012ea, 0x000019f1, 0xffffe60f, 0xfffff11a,
- 0x00000ee6, 0x00002500, 0xffffdb00, 0x00000025, 0xffffffdb, 0x00002c1b, 0xffffd3e5, 0x00001b2c,
- 0xffffe4d4, 0x00002c24, 0xffffd3dc, 0x0000242c, 0xffffdbd4, 0x00002c12, 0xffffd3ee, 0x0000122c,
- 0xffffedd4, 0x000020f6, 0xffffdf0a, 0xfffff621, 0x000009df, 0x00002d2d, 0xffffd2d3, 0x00000000,
- 0x00000000, 0x00000202, 0xfffffdfe, 0x00000300, 0xfffffd00, 0x00000003, 0xfffffffd, 0x00000606,
- 0xfffff9fa, 0x00000700, 0xfffff900, 0x02020000, 0x02020202, 0x0201fdfe, 0x02020300, 0x0201fd00,
- 0x02020003, 0x0201fffd, 0x02020606, 0x0201f9fa, 0x02020700, 0x0201f900, 0xfdfe0000, 0xfdfe0202,
- 0xfdfdfdfe, 0xfdfe0300, 0xfdfdfd00, 0xfdfe0003, 0xfdfdfffd, 0xfdfe0606, 0xfdfdf9fa, 0xfdfe0700,
- 0xfdfdf900, 0x03000000, 0x03000202, 0x02fffdfe, 0x03000300, 0x02fffd00, 0x03000003, 0x02fffffd,
- 0x03000606, 0x02fff9fa, 0x03000700, 0x02fff900, 0xfd000000, 0xfd000202, 0xfcfffdfe, 0xfd000300,
- 0xfcfffd00, 0xfd000003, 0xfcfffffd, 0xfd000606, 0xfcfff9fa, 0xfd000700, 0xfcfff900, 0x00030000,
- 0x00030202, 0x0002fdfe, 0x00030300, 0x0002fd00, 0x00030003, 0x0002fffd, 0x00030606, 0x0002f9fa,
- 0x00030700, 0x0002f900, 0xfffd0000, 0xfffd0202, 0xfffcfdfe, 0xfffd0300, 0xfffcfd00, 0xfffd0003,
- 0xfffcfffd, 0xfffd0606, 0xfffcf9fa, 0xfffd0700, 0xfffcf900, 0x06060000, 0x06060202, 0x0605fdfe,
- 0x06060300, 0x0605fd00, 0x06060003, 0x0605fffd, 0x06060606, 0x0605f9fa, 0x06060700, 0x0605f900,
- 0xf9fa0000, 0xf9fa0202, 0xf9f9fdfe, 0xf9fa0300, 0xf9f9fd00, 0xf9fa0003, 0xf9f9fffd, 0xf9fa0606,
- 0xf9f9f9fa, 0xf9fa0700, 0xf9f9f900, 0x07000000, 0x07000202, 0x06fffdfe, 0x07000300, 0x06fffd00,
- 0x07000003, 0x06fffffd, 0x07000606, 0x06fff9fa, 0x07000700, 0x06fff900, 0xf9000000, 0xf9000202,
- 0xf8fffdfe, 0xf9000300, 0xf8fffd00, 0xf9000003, 0xf8fffffd, 0xf9000606, 0xf8fff9fa, 0xf9000700,
- 0xf8fff900, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000200, 0xfffffe00, 0x00000002, 0xfffffffe, 0x00000202, 0xfffffdfe, 0x00000606,
- 0xfffff9fa, 0x00000600, 0xfffffa00, 0x00000006, 0xfffffffa, 0x000003fc, 0xfffffc04, 0xfffffa0a,
- 0x000005f6, 0xfffff400, 0x00000c00, 0xfffff3fa, 0xfffff406, 0x00000bfa, 0x00000c06, 0xfffffff2,
- 0x0000000e, 0x00000c0c, 0xfffff3f4, 0xffffee00, 0x00001200, 0xfffff40e, 0x00000bf2, 0xfffff9ee,
- 0xfffffa12, 0x000005ee, 0x00000612, 0xffffedf6, 0xffffee0a, 0x000011f6, 0x0000120a, 0xffffffea,
- 0x00000016, 0xffffe800, 0x00001800, 0xfffff3ea, 0xfffff416, 0x00000bea, 0x00000c16, 0xffffe7f8,
- 0xffffe808, 0x000017f8, 0x00001808, 0xfffff9e6, 0xfffffa1a, 0x000005e6, 0x0000061a, 0xffffffe4,
- 0x0000001c, 0x00001414, 0xffffebec, 0xffffe5f2, 0x00001a0e, 0xfffff3e2, 0x00000c1e, 0xffffdff6,
- 0x0000200a, 0xffffdfee, 0x00002012, 0xffffe5e6, 0x00001a1a, 0xffffebde, 0x00001422, 0xfffff3da,
- 0x00000c26, 0xffffdfe0, 0x00002020, 0x00002020, 0xffffd7ea, 0xffffddde, 0x00002222, 0x00000000,
- 0x00000200, 0xfffffe00, 0x00000002, 0xfffffffe, 0x00000202, 0xfffffdfe, 0x00000606, 0xfffff9fa,
- 0x00000600, 0xfffffa00, 0x00000006, 0xfffffffa, 0x02000000, 0x02000200, 0x01fffe00, 0x02000002,
- 0x01fffffe, 0x02000202, 0x01fffdfe, 0x02000606, 0x01fff9fa, 0x02000600, 0x01fffa00, 0x02000006,
- 0x01fffffa, 0xfe000000, 0xfe000200, 0xfdfffe00, 0xfe000002, 0xfdfffffe, 0xfe000202, 0xfdfffdfe,
- 0xfe000606, 0xfdfff9fa, 0xfe000600, 0xfdfffa00, 0xfe000006, 0xfdfffffa, 0x00020000, 0x00020200,
- 0x0001fe00, 0x00020002, 0x0001fffe, 0x00020202, 0x0001fdfe, 0x00020606, 0x0001f9fa, 0x00020600,
- 0x0001fa00, 0x00020006, 0x0001fffa, 0xfffe0000, 0xfffe0200, 0xfffdfe00, 0xfffe0002, 0xfffdfffe,
- 0xfffe0202, 0xfffdfdfe, 0xfffe0606, 0xfffdf9fa, 0xfffe0600, 0xfffdfa00, 0xfffe0006, 0xfffdfffa,
- 0x02020000, 0x02020200, 0x0201fe00, 0x02020002, 0x0201fffe, 0x02020202, 0x0201fdfe, 0x02020606,
- 0x0201f9fa, 0x02020600, 0x0201fa00, 0x02020006, 0x0201fffa, 0xfdfe0000, 0xfdfe0200, 0xfdfdfe00,
- 0xfdfe0002, 0xfdfdfffe, 0xfdfe0202, 0xfdfdfdfe, 0xfdfe0606, 0xfdfdf9fa, 0xfdfe0600, 0xfdfdfa00,
- 0xfdfe0006, 0xfdfdfffa, 0x06060000, 0x06060200, 0x0605fe00, 0x06060002, 0x0605fffe, 0x06060202,
- 0x0605fdfe, 0x06060606, 0x0605f9fa, 0x06060600, 0x0605fa00, 0x06060006, 0x0605fffa, 0xf9fa0000,
- 0xf9fa0200, 0xf9f9fe00, 0xf9fa0002, 0xf9f9fffe, 0xf9fa0202, 0xf9f9fdfe, 0xf9fa0606, 0xf9f9f9fa,
- 0xf9fa0600, 0xf9f9fa00, 0xf9fa0006, 0xf9f9fffa, 0x06000000, 0x06000200, 0x05fffe00, 0x06000002,
- 0x05fffffe, 0x06000202, 0x05fffdfe, 0x06000606, 0x05fff9fa, 0x06000600, 0x05fffa00, 0x06000006,
- 0x05fffffa, 0xfa000000, 0xfa000200, 0xf9fffe00, 0xfa000002, 0xf9fffffe, 0xfa000202, 0xf9fffdfe,
- 0xfa000606, 0xf9fff9fa, 0xfa000600, 0xf9fffa00, 0xfa000006, 0xf9fffffa, 0x00060000, 0x00060200,
- 0x0005fe00, 0x00060002, 0x0005fffe, 0x00060202, 0x0005fdfe, 0x00060606, 0x0005f9fa, 0x00060600,
- 0x0005fa00, 0x00060006, 0x0005fffa, 0xfffa0000, 0xfffa0200, 0xfff9fe00, 0xfffa0002, 0xfff9fffe,
- 0xfffa0202, 0xfff9fdfe, 0xfffa0606, 0xfff9f9fa, 0xfffa0600, 0xfff9fa00, 0xfffa0006, 0xfff9fffa,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000200, 0xfffffe00, 0x00000002, 0xfffffffe, 0x00000404, 0xfffffbfc, 0x00000a0a,
- 0xfffff5f6, 0x00000a00, 0xfffff600, 0x0000000a, 0xfffffff6, 0x000005fa, 0xfffffa06, 0xfffff80e,
- 0x000007f2, 0xffffffee, 0x00000012, 0xfffff00a, 0x00000ff6, 0xffffe800, 0x00001800, 0xfffff7e8,
- 0xfffff818, 0x000007e8, 0x00000818, 0x00001212, 0xffffedee, 0xfffff014, 0x00000fec, 0xffffe5f2,
- 0xffffe60e, 0x000019f2, 0x00001a0e, 0xffffffe2, 0x0000001e, 0xffffde00, 0x00002200, 0xfffff7de,
- 0xfffff822, 0x000007de, 0x00000822, 0xffffede2, 0xffffee1e, 0x000011e2, 0x0000121e, 0xffffddf6,
- 0xffffde0a, 0x000021f6, 0x0000220a, 0xffffddec, 0x00002214, 0xffffffd8, 0x00000028, 0x00001e1e,
- 0xffffe1e2, 0xffffedd8, 0x00001228, 0xffffd400, 0x00002c00, 0xffffd3f0, 0x00002c10, 0xffffdbdc,
- 0xffffdbdc, 0x00002424, 0xffffd3e6, 0x00002c1a, 0xffffe5d2, 0x00001a2e, 0xffffedcc, 0x00001234,
- 0xffffc9ec, 0xffffd3d4, 0x00002c2c, 0xffffc9e0, 0xffffd1d2, 0xffffd1d2, 0x00002e2e, 0x00000000,
- 0x00000200, 0xfffffe00, 0x00000002, 0xfffffffe, 0x00000404, 0xfffffbfc, 0x00000a0a, 0xfffff5f6,
- 0x00000a00, 0xfffff600, 0x0000000a, 0xfffffff6, 0x02000000, 0x02000200, 0x01fffe00, 0x02000002,
- 0x01fffffe, 0x02000404, 0x01fffbfc, 0x02000a0a, 0x01fff5f6, 0x02000a00, 0x01fff600, 0x0200000a,
- 0x01fffff6, 0xfe000000, 0xfe000200, 0xfdfffe00, 0xfe000002, 0xfdfffffe, 0xfe000404, 0xfdfffbfc,
- 0xfe000a0a, 0xfdfff5f6, 0xfe000a00, 0xfdfff600, 0xfe00000a, 0xfdfffff6, 0x00020000, 0x00020200,
- 0x0001fe00, 0x00020002, 0x0001fffe, 0x00020404, 0x0001fbfc, 0x00020a0a, 0x0001f5f6, 0x00020a00,
- 0x0001f600, 0x0002000a, 0x0001fff6, 0xfffe0000, 0xfffe0200, 0xfffdfe00, 0xfffe0002, 0xfffdfffe,
- 0xfffe0404, 0xfffdfbfc, 0xfffe0a0a, 0xfffdf5f6, 0xfffe0a00, 0xfffdf600, 0xfffe000a, 0xfffdfff6,
- 0x04040000, 0x04040200, 0x0403fe00, 0x04040002, 0x0403fffe, 0x04040404, 0x0403fbfc, 0x04040a0a,
- 0x0403f5f6, 0x04040a00, 0x0403f600, 0x0404000a, 0x0403fff6, 0xfbfc0000, 0xfbfc0200, 0xfbfbfe00,
- 0xfbfc0002, 0xfbfbfffe, 0xfbfc0404, 0xfbfbfbfc, 0xfbfc0a0a, 0xfbfbf5f6, 0xfbfc0a00, 0xfbfbf600,
- 0xfbfc000a, 0xfbfbfff6, 0x0a0a0000, 0x0a0a0200, 0x0a09fe00, 0x0a0a0002, 0x0a09fffe, 0x0a0a0404,
- 0x0a09fbfc, 0x0a0a0a0a, 0x0a09f5f6, 0x0a0a0a00, 0x0a09f600, 0x0a0a000a, 0x0a09fff6, 0xf5f60000,
- 0xf5f60200, 0xf5f5fe00, 0xf5f60002, 0xf5f5fffe, 0xf5f60404, 0xf5f5fbfc, 0xf5f60a0a, 0xf5f5f5f6,
- 0xf5f60a00, 0xf5f5f600, 0xf5f6000a, 0xf5f5fff6, 0x0a000000, 0x0a000200, 0x09fffe00, 0x0a000002,
- 0x09fffffe, 0x0a000404, 0x09fffbfc, 0x0a000a0a, 0x09fff5f6, 0x0a000a00, 0x09fff600, 0x0a00000a,
- 0x09fffff6, 0xf6000000, 0xf6000200, 0xf5fffe00, 0xf6000002, 0xf5fffffe, 0xf6000404, 0xf5fffbfc,
- 0xf6000a0a, 0xf5fff5f6, 0xf6000a00, 0xf5fff600, 0xf600000a, 0xf5fffff6, 0x000a0000, 0x000a0200,
- 0x0009fe00, 0x000a0002, 0x0009fffe, 0x000a0404, 0x0009fbfc, 0x000a0a0a, 0x0009f5f6, 0x000a0a00,
- 0x0009f600, 0x000a000a, 0x0009fff6, 0xfff60000, 0xfff60200, 0xfff5fe00, 0xfff60002, 0xfff5fffe,
- 0xfff60404, 0xfff5fbfc, 0xfff60a0a, 0xfff5f5f6, 0xfff60a00, 0xfff5f600, 0xfff6000a, 0xfff5fff6,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000400, 0xfffffc00, 0x00000004, 0xfffffffc, 0x00000404, 0xfffffbfc, 0x00000c0c,
- 0xfffff3f4, 0x00000c00, 0xfffff400, 0x0000000c, 0xfffffff4, 0x000007f8, 0xfffff808, 0xfffff008,
- 0x00000ff8, 0xffffe800, 0x00001800, 0xfffff7e8, 0xfffff818, 0x000007e8, 0x00000818, 0xfffff014,
- 0x00000fec, 0xffffffe4, 0x0000001c, 0xffffe7f0, 0xffffe810, 0x000017f0, 0x00001810, 0xffffe000,
- 0x00002000, 0xffffefe4, 0xfffff01c, 0x00000fe4, 0x0000101c, 0xffffdff8, 0xffffe008, 0xfffff7e0,
- 0xfffff820, 0x000007e0, 0x00000820, 0x00001ff8, 0x00002008, 0x00001818, 0xffffe7e8, 0xffffe818,
- 0x000017e8, 0xffffdfec, 0x00002014, 0xffffffd8, 0x00000028, 0xffffefd8, 0x00001028, 0xffffd400,
- 0xffffd400, 0xffffffd4, 0x0000002c, 0x00002c00, 0x00002c00, 0xffffdfe0, 0x00002020, 0xffffd3f0,
- 0x00002c10, 0xffffd3e8, 0xffffe7d4, 0x0000182c, 0x00002c18, 0xffffefd0, 0x00001030, 0xffffdbdc,
- 0xffffdbdc, 0x00002424, 0x00002424, 0xffffcbec, 0x00002828, 0xffffd7d8, 0xffffcbe0, 0x00000000,
- 0x00000400, 0xfffffc00, 0x00000004, 0xfffffffc, 0x00000404, 0xfffffbfc, 0x00000c0c, 0xfffff3f4,
- 0x00000c00, 0xfffff400, 0x0000000c, 0xfffffff4, 0x04000000, 0x04000400, 0x03fffc00, 0x04000004,
- 0x03fffffc, 0x04000404, 0x03fffbfc, 0x04000c0c, 0x03fff3f4, 0x04000c00, 0x03fff400, 0x0400000c,
- 0x03fffff4, 0xfc000000, 0xfc000400, 0xfbfffc00, 0xfc000004, 0xfbfffffc, 0xfc000404, 0xfbfffbfc,
- 0xfc000c0c, 0xfbfff3f4, 0xfc000c00, 0xfbfff400, 0xfc00000c, 0xfbfffff4, 0x00040000, 0x00040400,
- 0x0003fc00, 0x00040004, 0x0003fffc, 0x00040404, 0x0003fbfc, 0x00040c0c, 0x0003f3f4, 0x00040c00,
- 0x0003f400, 0x0004000c, 0x0003fff4, 0xfffc0000, 0xfffc0400, 0xfffbfc00, 0xfffc0004, 0xfffbfffc,
- 0xfffc0404, 0xfffbfbfc, 0xfffc0c0c, 0xfffbf3f4, 0xfffc0c00, 0xfffbf400, 0xfffc000c, 0xfffbfff4,
- 0x04040000, 0x04040400, 0x0403fc00, 0x04040004, 0x0403fffc, 0x04040404, 0x0403fbfc, 0x04040c0c,
- 0x0403f3f4, 0x04040c00, 0x0403f400, 0x0404000c, 0x0403fff4, 0xfbfc0000, 0xfbfc0400, 0xfbfbfc00,
- 0xfbfc0004, 0xfbfbfffc, 0xfbfc0404, 0xfbfbfbfc, 0xfbfc0c0c, 0xfbfbf3f4, 0xfbfc0c00, 0xfbfbf400,
- 0xfbfc000c, 0xfbfbfff4, 0x0c0c0000, 0x0c0c0400, 0x0c0bfc00, 0x0c0c0004, 0x0c0bfffc, 0x0c0c0404,
- 0x0c0bfbfc, 0x0c0c0c0c, 0x0c0bf3f4, 0x0c0c0c00, 0x0c0bf400, 0x0c0c000c, 0x0c0bfff4, 0xf3f40000,
- 0xf3f40400, 0xf3f3fc00, 0xf3f40004, 0xf3f3fffc, 0xf3f40404, 0xf3f3fbfc, 0xf3f40c0c, 0xf3f3f3f4,
- 0xf3f40c00, 0xf3f3f400, 0xf3f4000c, 0xf3f3fff4, 0x0c000000, 0x0c000400, 0x0bfffc00, 0x0c000004,
- 0x0bfffffc, 0x0c000404, 0x0bfffbfc, 0x0c000c0c, 0x0bfff3f4, 0x0c000c00, 0x0bfff400, 0x0c00000c,
- 0x0bfffff4, 0xf4000000, 0xf4000400, 0xf3fffc00, 0xf4000004, 0xf3fffffc, 0xf4000404, 0xf3fffbfc,
- 0xf4000c0c, 0xf3fff3f4, 0xf4000c00, 0xf3fff400, 0xf400000c, 0xf3fffff4, 0x000c0000, 0x000c0400,
- 0x000bfc00, 0x000c0004, 0x000bfffc, 0x000c0404, 0x000bfbfc, 0x000c0c0c, 0x000bf3f4, 0x000c0c00,
- 0x000bf400, 0x000c000c, 0x000bfff4, 0xfff40000, 0xfff40400, 0xfff3fc00, 0xfff40004, 0xfff3fffc,
- 0xfff40404, 0xfff3fbfc, 0xfff40c0c, 0xfff3f3f4, 0xfff40c00, 0xfff3f400, 0xfff4000c, 0xfff3fff4,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000202, 0xfffffdfe, 0x00000606, 0xfffff9fa, 0x00000c0c, 0xfffff3f4, 0x00001414,
- 0xffffebec, 0x00002020, 0xffffdfe0, 0x00002e2e, 0xffffd1d2, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000202, 0xfffffdfe, 0x00000606, 0xfffff9fa, 0x00000c0c, 0xfffff3f4, 0x00001414, 0xffffebec,
- 0x00002020, 0xffffdfe0, 0x00002e2e, 0xffffd1d2, 0x02020000, 0x02020202, 0x0201fdfe, 0x02020606,
- 0x0201f9fa, 0x02020c0c, 0x0201f3f4, 0x02021414, 0x0201ebec, 0x02022020, 0x0201dfe0, 0x02022e2e,
- 0x0201d1d2, 0xfdfe0000, 0xfdfe0202, 0xfdfdfdfe, 0xfdfe0606, 0xfdfdf9fa, 0xfdfe0c0c, 0xfdfdf3f4,
- 0xfdfe1414, 0xfdfdebec, 0xfdfe2020, 0xfdfddfe0, 0xfdfe2e2e, 0xfdfdd1d2, 0x06060000, 0x06060202,
- 0x0605fdfe, 0x06060606, 0x0605f9fa, 0x06060c0c, 0x0605f3f4, 0x06061414, 0x0605ebec, 0x06062020,
- 0x0605dfe0, 0x06062e2e, 0x0605d1d2, 0xf9fa0000, 0xf9fa0202, 0xf9f9fdfe, 0xf9fa0606, 0xf9f9f9fa,
- 0xf9fa0c0c, 0xf9f9f3f4, 0xf9fa1414, 0xf9f9ebec, 0xf9fa2020, 0xf9f9dfe0, 0xf9fa2e2e, 0xf9f9d1d2,
- 0x0c0c0000, 0x0c0c0202, 0x0c0bfdfe, 0x0c0c0606, 0x0c0bf9fa, 0x0c0c0c0c, 0x0c0bf3f4, 0x0c0c1414,
- 0x0c0bebec, 0x0c0c2020, 0x0c0bdfe0, 0x0c0c2e2e, 0x0c0bd1d2, 0xf3f40000, 0xf3f40202, 0xf3f3fdfe,
- 0xf3f40606, 0xf3f3f9fa, 0xf3f40c0c, 0xf3f3f3f4, 0xf3f41414, 0xf3f3ebec, 0xf3f42020, 0xf3f3dfe0,
- 0xf3f42e2e, 0xf3f3d1d2, 0x14140000, 0x14140202, 0x1413fdfe, 0x14140606, 0x1413f9fa, 0x14140c0c,
- 0x1413f3f4, 0x14141414, 0x1413ebec, 0x14142020, 0x1413dfe0, 0x14142e2e, 0x1413d1d2, 0xebec0000,
- 0xebec0202, 0xebebfdfe, 0xebec0606, 0xebebf9fa, 0xebec0c0c, 0xebebf3f4, 0xebec1414, 0xebebebec,
- 0xebec2020, 0xebebdfe0, 0xebec2e2e, 0xebebd1d2, 0x20200000, 0x20200202, 0x201ffdfe, 0x20200606,
- 0x201ff9fa, 0x20200c0c, 0x201ff3f4, 0x20201414, 0x201febec, 0x20202020, 0x201fdfe0, 0x20202e2e,
- 0x201fd1d2, 0xdfe00000, 0xdfe00202, 0xdfdffdfe, 0xdfe00606, 0xdfdff9fa, 0xdfe00c0c, 0xdfdff3f4,
- 0xdfe01414, 0xdfdfebec, 0xdfe02020, 0xdfdfdfe0, 0xdfe02e2e, 0xdfdfd1d2, 0x2e2e0000, 0x2e2e0202,
- 0x2e2dfdfe, 0x2e2e0606, 0x2e2df9fa, 0x2e2e0c0c, 0x2e2df3f4, 0x2e2e1414, 0x2e2debec, 0x2e2e2020,
- 0x2e2ddfe0, 0x2e2e2e2e, 0x2e2dd1d2, 0xd1d20000, 0xd1d20202, 0xd1d1fdfe, 0xd1d20606, 0xd1d1f9fa,
- 0xd1d20c0c, 0xd1d1f3f4, 0xd1d21414, 0xd1d1ebec, 0xd1d22020, 0xd1d1dfe0, 0xd1d22e2e, 0xd1d1d1d2,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000202, 0xfffffdfe, 0x00000606, 0xfffff9fa, 0x00000c0c, 0xfffff3f4, 0x00001414,
- 0xffffebec, 0x00002020, 0xffffdfe0, 0x00002e2e, 0xffffd1d2, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000202, 0xfffffdfe, 0x00000606, 0xfffff9fa, 0x00000c0c, 0xfffff3f4, 0x00001414, 0xffffebec,
- 0x00002020, 0xffffdfe0, 0x00002e2e, 0xffffd1d2, 0x02020000, 0x02020202, 0x0201fdfe, 0x02020606,
- 0x0201f9fa, 0x02020c0c, 0x0201f3f4, 0x02021414, 0x0201ebec, 0x02022020, 0x0201dfe0, 0x02022e2e,
- 0x0201d1d2, 0xfdfe0000, 0xfdfe0202, 0xfdfdfdfe, 0xfdfe0606, 0xfdfdf9fa, 0xfdfe0c0c, 0xfdfdf3f4,
- 0xfdfe1414, 0xfdfdebec, 0xfdfe2020, 0xfdfddfe0, 0xfdfe2e2e, 0xfdfdd1d2, 0x06060000, 0x06060202,
- 0x0605fdfe, 0x06060606, 0x0605f9fa, 0x06060c0c, 0x0605f3f4, 0x06061414, 0x0605ebec, 0x06062020,
- 0x0605dfe0, 0x06062e2e, 0x0605d1d2, 0xf9fa0000, 0xf9fa0202, 0xf9f9fdfe, 0xf9fa0606, 0xf9f9f9fa,
- 0xf9fa0c0c, 0xf9f9f3f4, 0xf9fa1414, 0xf9f9ebec, 0xf9fa2020, 0xf9f9dfe0, 0xf9fa2e2e, 0xf9f9d1d2,
- 0x0c0c0000, 0x0c0c0202, 0x0c0bfdfe, 0x0c0c0606, 0x0c0bf9fa, 0x0c0c0c0c, 0x0c0bf3f4, 0x0c0c1414,
- 0x0c0bebec, 0x0c0c2020, 0x0c0bdfe0, 0x0c0c2e2e, 0x0c0bd1d2, 0xf3f40000, 0xf3f40202, 0xf3f3fdfe,
- 0xf3f40606, 0xf3f3f9fa, 0xf3f40c0c, 0xf3f3f3f4, 0xf3f41414, 0xf3f3ebec, 0xf3f42020, 0xf3f3dfe0,
- 0xf3f42e2e, 0xf3f3d1d2, 0x14140000, 0x14140202, 0x1413fdfe, 0x14140606, 0x1413f9fa, 0x14140c0c,
- 0x1413f3f4, 0x14141414, 0x1413ebec, 0x14142020, 0x1413dfe0, 0x14142e2e, 0x1413d1d2, 0xebec0000,
- 0xebec0202, 0xebebfdfe, 0xebec0606, 0xebebf9fa, 0xebec0c0c, 0xebebf3f4, 0xebec1414, 0xebebebec,
- 0xebec2020, 0xebebdfe0, 0xebec2e2e, 0xebebd1d2, 0x20200000, 0x20200202, 0x201ffdfe, 0x20200606,
- 0x201ff9fa, 0x20200c0c, 0x201ff3f4, 0x20201414, 0x201febec, 0x20202020, 0x201fdfe0, 0x20202e2e,
- 0x201fd1d2, 0xdfe00000, 0xdfe00202, 0xdfdffdfe, 0xdfe00606, 0xdfdff9fa, 0xdfe00c0c, 0xdfdff3f4,
- 0xdfe01414, 0xdfdfebec, 0xdfe02020, 0xdfdfdfe0, 0xdfe02e2e, 0xdfdfd1d2, 0x2e2e0000, 0x2e2e0202,
- 0x2e2dfdfe, 0x2e2e0606, 0x2e2df9fa, 0x2e2e0c0c, 0x2e2df3f4, 0x2e2e1414, 0x2e2debec, 0x2e2e2020,
- 0x2e2ddfe0, 0x2e2e2e2e, 0x2e2dd1d2, 0xd1d20000, 0xd1d20202, 0xd1d1fdfe, 0xd1d20606, 0xd1d1f9fa,
- 0xd1d20c0c, 0xd1d1f3f4, 0xd1d21414, 0xd1d1ebec, 0xd1d22020, 0xd1d1dfe0, 0xd1d22e2e, 0xd1d1d1d2,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000202, 0xfffffdfe, 0x00000606, 0xfffff9fa, 0x00000c0c, 0xfffff3f4, 0x00001414,
- 0xffffebec, 0x00002020, 0xffffdfe0, 0x00002e2e, 0xffffd1d2, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000202, 0xfffffdfe, 0x00000606, 0xfffff9fa, 0x00000c0c, 0xfffff3f4, 0x00001414, 0xffffebec,
- 0x00002020, 0xffffdfe0, 0x00002e2e, 0xffffd1d2, 0x02020000, 0x02020202, 0x0201fdfe, 0x02020606,
- 0x0201f9fa, 0x02020c0c, 0x0201f3f4, 0x02021414, 0x0201ebec, 0x02022020, 0x0201dfe0, 0x02022e2e,
- 0x0201d1d2, 0xfdfe0000, 0xfdfe0202, 0xfdfdfdfe, 0xfdfe0606, 0xfdfdf9fa, 0xfdfe0c0c, 0xfdfdf3f4,
- 0xfdfe1414, 0xfdfdebec, 0xfdfe2020, 0xfdfddfe0, 0xfdfe2e2e, 0xfdfdd1d2, 0x06060000, 0x06060202,
- 0x0605fdfe, 0x06060606, 0x0605f9fa, 0x06060c0c, 0x0605f3f4, 0x06061414, 0x0605ebec, 0x06062020,
- 0x0605dfe0, 0x06062e2e, 0x0605d1d2, 0xf9fa0000, 0xf9fa0202, 0xf9f9fdfe, 0xf9fa0606, 0xf9f9f9fa,
- 0xf9fa0c0c, 0xf9f9f3f4, 0xf9fa1414, 0xf9f9ebec, 0xf9fa2020, 0xf9f9dfe0, 0xf9fa2e2e, 0xf9f9d1d2,
- 0x0c0c0000, 0x0c0c0202, 0x0c0bfdfe, 0x0c0c0606, 0x0c0bf9fa, 0x0c0c0c0c, 0x0c0bf3f4, 0x0c0c1414,
- 0x0c0bebec, 0x0c0c2020, 0x0c0bdfe0, 0x0c0c2e2e, 0x0c0bd1d2, 0xf3f40000, 0xf3f40202, 0xf3f3fdfe,
- 0xf3f40606, 0xf3f3f9fa, 0xf3f40c0c, 0xf3f3f3f4, 0xf3f41414, 0xf3f3ebec, 0xf3f42020, 0xf3f3dfe0,
- 0xf3f42e2e, 0xf3f3d1d2, 0x14140000, 0x14140202, 0x1413fdfe, 0x14140606, 0x1413f9fa, 0x14140c0c,
- 0x1413f3f4, 0x14141414, 0x1413ebec, 0x14142020, 0x1413dfe0, 0x14142e2e, 0x1413d1d2, 0xebec0000,
- 0xebec0202, 0xebebfdfe, 0xebec0606, 0xebebf9fa, 0xebec0c0c, 0xebebf3f4, 0xebec1414, 0xebebebec,
- 0xebec2020, 0xebebdfe0, 0xebec2e2e, 0xebebd1d2, 0x20200000, 0x20200202, 0x201ffdfe, 0x20200606,
- 0x201ff9fa, 0x20200c0c, 0x201ff3f4, 0x20201414, 0x201febec, 0x20202020, 0x201fdfe0, 0x20202e2e,
- 0x201fd1d2, 0xdfe00000, 0xdfe00202, 0xdfdffdfe, 0xdfe00606, 0xdfdff9fa, 0xdfe00c0c, 0xdfdff3f4,
- 0xdfe01414, 0xdfdfebec, 0xdfe02020, 0xdfdfdfe0, 0xdfe02e2e, 0xdfdfd1d2, 0x2e2e0000, 0x2e2e0202,
- 0x2e2dfdfe, 0x2e2e0606, 0x2e2df9fa, 0x2e2e0c0c, 0x2e2df3f4, 0x2e2e1414, 0x2e2debec, 0x2e2e2020,
- 0x2e2ddfe0, 0x2e2e2e2e, 0x2e2dd1d2, 0xd1d20000, 0xd1d20202, 0xd1d1fdfe, 0xd1d20606, 0xd1d1f9fa,
- 0xd1d20c0c, 0xd1d1f3f4, 0xd1d21414, 0xd1d1ebec, 0xd1d22020, 0xd1d1dfe0, 0xd1d22e2e, 0xd1d1d1d2,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000202, 0xfffffdfe, 0x00000606, 0xfffff9fa, 0x00000c0c, 0xfffff3f4, 0x00001414,
- 0xffffebec, 0x00002020, 0xffffdfe0, 0x00002e2e, 0xffffd1d2, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000202, 0xfffffdfe, 0x00000606, 0xfffff9fa, 0x00000c0c, 0xfffff3f4, 0x00001414, 0xffffebec,
- 0x00002020, 0xffffdfe0, 0x00002e2e, 0xffffd1d2, 0x02020000, 0x02020202, 0x0201fdfe, 0x02020606,
- 0x0201f9fa, 0x02020c0c, 0x0201f3f4, 0x02021414, 0x0201ebec, 0x02022020, 0x0201dfe0, 0x02022e2e,
- 0x0201d1d2, 0xfdfe0000, 0xfdfe0202, 0xfdfdfdfe, 0xfdfe0606, 0xfdfdf9fa, 0xfdfe0c0c, 0xfdfdf3f4,
- 0xfdfe1414, 0xfdfdebec, 0xfdfe2020, 0xfdfddfe0, 0xfdfe2e2e, 0xfdfdd1d2, 0x06060000, 0x06060202,
- 0x0605fdfe, 0x06060606, 0x0605f9fa, 0x06060c0c, 0x0605f3f4, 0x06061414, 0x0605ebec, 0x06062020,
- 0x0605dfe0, 0x06062e2e, 0x0605d1d2, 0xf9fa0000, 0xf9fa0202, 0xf9f9fdfe, 0xf9fa0606, 0xf9f9f9fa,
- 0xf9fa0c0c, 0xf9f9f3f4, 0xf9fa1414, 0xf9f9ebec, 0xf9fa2020, 0xf9f9dfe0, 0xf9fa2e2e, 0xf9f9d1d2,
- 0x0c0c0000, 0x0c0c0202, 0x0c0bfdfe, 0x0c0c0606, 0x0c0bf9fa, 0x0c0c0c0c, 0x0c0bf3f4, 0x0c0c1414,
- 0x0c0bebec, 0x0c0c2020, 0x0c0bdfe0, 0x0c0c2e2e, 0x0c0bd1d2, 0xf3f40000, 0xf3f40202, 0xf3f3fdfe,
- 0xf3f40606, 0xf3f3f9fa, 0xf3f40c0c, 0xf3f3f3f4, 0xf3f41414, 0xf3f3ebec, 0xf3f42020, 0xf3f3dfe0,
- 0xf3f42e2e, 0xf3f3d1d2, 0x14140000, 0x14140202, 0x1413fdfe, 0x14140606, 0x1413f9fa, 0x14140c0c,
- 0x1413f3f4, 0x14141414, 0x1413ebec, 0x14142020, 0x1413dfe0, 0x14142e2e, 0x1413d1d2, 0xebec0000,
- 0xebec0202, 0xebebfdfe, 0xebec0606, 0xebebf9fa, 0xebec0c0c, 0xebebf3f4, 0xebec1414, 0xebebebec,
- 0xebec2020, 0xebebdfe0, 0xebec2e2e, 0xebebd1d2, 0x20200000, 0x20200202, 0x201ffdfe, 0x20200606,
- 0x201ff9fa, 0x20200c0c, 0x201ff3f4, 0x20201414, 0x201febec, 0x20202020, 0x201fdfe0, 0x20202e2e,
- 0x201fd1d2, 0xdfe00000, 0xdfe00202, 0xdfdffdfe, 0xdfe00606, 0xdfdff9fa, 0xdfe00c0c, 0xdfdff3f4,
- 0xdfe01414, 0xdfdfebec, 0xdfe02020, 0xdfdfdfe0, 0xdfe02e2e, 0xdfdfd1d2, 0x2e2e0000, 0x2e2e0202,
- 0x2e2dfdfe, 0x2e2e0606, 0x2e2df9fa, 0x2e2e0c0c, 0x2e2df3f4, 0x2e2e1414, 0x2e2debec, 0x2e2e2020,
- 0x2e2ddfe0, 0x2e2e2e2e, 0x2e2dd1d2, 0xd1d20000, 0xd1d20202, 0xd1d1fdfe, 0xd1d20606, 0xd1d1f9fa,
- 0xd1d20c0c, 0xd1d1f3f4, 0xd1d21414, 0xd1d1ebec, 0xd1d22020, 0xd1d1dfe0, 0xd1d22e2e, 0xd1d1d1d2,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000
-};
-
-
-static const uint32_t correctionloworder[] = {
- 0x00000000, 0x02020202, 0xfdfdfdfe, 0x0302feff, 0xfcfd0101, 0xfeff0303, 0x0100fcfd, 0x04040404,
- 0xfbfbfbfc, 0x05050101, 0xfafafeff, 0x01010505, 0xfefefafb, 0x0403fbfc, 0xfbfc0404, 0x0605fdfe,
- 0xf9fa0202, 0xfdfe0606, 0x0201f9fa, 0x09090404, 0xf6f6fbfc, 0x04040909, 0xfbfbf6f7, 0x09090909,
- 0xf6f6f6f7, 0x0a0a0101, 0xf5f5feff, 0x01010a0a, 0xfefef5f6, 0x0807fafb, 0xf7f80505, 0xfafb0808,
- 0x0504f7f8, 0x0f0f0909, 0xf0f0f6f7, 0x09090f0f, 0xf6f6f0f1, 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c,
- 0x0302f3f4, 0x10100404, 0xefeffbfc, 0x04041010, 0xfbfbeff0, 0x10101010, 0xefefeff0, 0x12120000,
- 0xedee0000, 0x00001212, 0xffffedee, 0x0c0bf3f4, 0xf3f40c0c, 0x100ff6f7, 0xeff00909, 0xf6f71010,
- 0x0908eff0, 0x1b1b0b0b, 0xe4e4f4f5, 0x0b0b1b1b, 0xf4f4e4e5, 0x1c1c1313, 0xe3e3eced, 0x13131c1c,
- 0xecece3e4, 0x1615f9fa, 0xe9ea0606, 0xf9fa1616, 0x0605e9ea, 0x1d1d0404, 0xe2e2fbfc, 0x04041d1d,
- 0xfbfbe2e3, 0x1e1e1e1e, 0xe1e1e1e2, 0x2120fdfe, 0xdedf0202, 0xfdfe2121, 0x0201dedf, 0x1716edee,
- 0xe8e91212, 0xedee1717, 0x1211e8e9, 0x1e1df0f1, 0xe1e20f0f, 0xf0f11e1e, 0x0f0ee1e2, 0x2e2e1616,
- 0xd1d1e9ea, 0x16162e2e, 0xe9e9d1d2, 0x2f2f0d0d, 0xd0d0f2f3, 0x0d0d2f2f, 0xf2f2d0d1, 0x31312323,
- 0xcecedcdd, 0x23233131, 0xdcdccecf, 0x2928f4f5, 0xd6d70b0b, 0xf4f52929, 0x0b0ad6d7, 0x33330404,
- 0xccccfbfc, 0x04043333, 0xfbfbcccd, 0x36363636, 0xc9c9c9ca, 0x2221ddde, 0xddde2222, 0x2a29e2e3,
- 0xd5d61d1d, 0xe2e32a2a, 0x1d1cd5d6, 0x3c3bf9fa, 0xc3c40606, 0xf9fa3c3c, 0x0605c3c4, 0x4c4c1b1b,
- 0xb3b3e4e5, 0x1b1b4c4c, 0xe4e4b3b4, 0x4d4d2b2b, 0xb2b2d4d5, 0x2b2b4d4d, 0xd4d4b2b3, 0x3736e7e8,
- 0xc8c91818, 0xe7e83737, 0x1817c8c9, 0x4f4f0e0e, 0xb0b0f1f2, 0x0e0e4f4f, 0xf1f1b0b1, 0x53533f3f,
- 0xacacc0c1, 0x3f3f5353, 0xc0c0acad, 0x4a49ebec, 0xb5b61414, 0xebec4a4a, 0x1413b5b6, 0x58580202,
- 0xa7a7fdfe, 0x02025858, 0xfdfda7a8, 0x5d5d5d5d, 0xa2a2a2a3, 0x3d3ccbcc, 0xc2c33434, 0xcbcc3d3d,
- 0x3433c2c3, 0x78783434, 0x8787cbcc, 0x34347878, 0xcbcb8788, 0x4b4ad2d3, 0xb4b52d2d, 0xd2d34b4b,
- 0x2d2cb4b5, 0x7d7d4b4b, 0x8282b4b5, 0x4b4b7d7d, 0xb4b48283, 0x7a7a2121, 0x8585dedf, 0x21217a7a,
- 0xdede8586, 0x6766f2f3, 0x98990d0d, 0xf2f36767, 0x0d0c9899, 0x605fd7d8, 0x9fa02828, 0xd7d86060,
- 0x28279fa0, 0x7f7eddde, 0x80812222, 0xddde7f7f, 0x22218081, 0x5958a6a7, 0xa6a75959, 0x6968b1b2,
- 0x96974e4e, 0xb1b26969, 0x4e4d9697, 0x0c0c0c0c, 0xf3f3f3f4, 0x17171717, 0xe8e8e8e9, 0x2a2a2a2a,
- 0xd5d5d5d6, 0x49494949, 0xb6b6b6b7, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
- 0x02020202, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe,
- 0x0302feff, 0x0302feff, 0x0302feff, 0x0302feff, 0x0302feff, 0x0302feff, 0x0302feff, 0xfcfd0101,
- 0xfcfd0101, 0xfcfd0101, 0xfcfd0101, 0xfcfd0101, 0xfcfd0101, 0xfcfd0101, 0xfeff0303, 0xfeff0303,
- 0xfeff0303, 0xfeff0303, 0xfeff0303, 0xfeff0303, 0xfeff0303, 0x0100fcfd, 0x0100fcfd, 0x0100fcfd,
- 0x0100fcfd, 0x0100fcfd, 0x0100fcfd, 0x0100fcfd, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x03030303, 0xfcfcfcfd, 0x0403feff, 0xfbfc0101, 0xfeff0404, 0x0100fbfc, 0x07070707,
- 0xf8f8f8f9, 0x08080202, 0xf7f7fdfe, 0x02020808, 0xfdfdf7f8, 0x0908fdfe, 0xf6f70202, 0xfdfe0909,
- 0x0201f6f7, 0x0605f9fa, 0xf9fa0606, 0x0d0d0606, 0xf2f2f9fa, 0x06060d0d, 0xf9f9f2f3, 0x0d0d0d0d,
- 0xf2f2f2f3, 0x0e0e0101, 0xf1f1feff, 0x01010e0e, 0xfefef1f2, 0x0c0bf7f8, 0xf3f40808, 0xf7f80c0c,
- 0x0807f3f4, 0x17170e0e, 0xe8e8f1f2, 0x0e0e1717, 0xf1f1e8e9, 0x1211fafb, 0xedee0505, 0xfafb1212,
- 0x0504edee, 0x18180606, 0xe7e7f9fa, 0x06061818, 0xf9f9e7e8, 0x18181818, 0xe7e7e7e8, 0x1b1afeff,
- 0xe4e50101, 0xfeff1b1b, 0x0100e4e5, 0x1110eeef, 0xeeef1111, 0x1716f2f3, 0xe8e90d0d, 0xf2f31717,
- 0x0d0ce8e9, 0x28281010, 0xd7d7eff0, 0x10102828, 0xefefd7d8, 0x29291c1c, 0xd6d6e3e4, 0x1c1c2929,
- 0xe3e3d6d7, 0x2120f6f7, 0xdedf0909, 0xf6f72121, 0x0908dedf, 0x2b2b0606, 0xd4d4f9fa, 0x06062b2b,
- 0xf9f9d4d5, 0x2e2e2e2e, 0xd1d1d1d2, 0x3231fbfc, 0xcdce0404, 0xfbfc3232, 0x0403cdce, 0x2221e4e5,
- 0xddde1b1b, 0xe4e52222, 0x1b1addde, 0x2d2ce9ea, 0xd2d31616, 0xe9ea2d2d, 0x1615d2d3, 0x45452222,
- 0xbabaddde, 0x22224545, 0xddddbabb, 0x46461313, 0xb9b9eced, 0x13134646, 0xececb9ba, 0x49493535,
- 0xb6b6cacb, 0x35354949, 0xcacab6b7, 0x3e3deeef, 0xc1c21111, 0xeeef3e3e, 0x1110c1c2, 0x4d4d0505,
- 0xb2b2fafb, 0x05054d4d, 0xfafab2b3, 0x52525252, 0xadadadae, 0x3332cccd, 0xcccd3333, 0x403fd4d5,
- 0xbfc02b2b, 0xd4d54040, 0x2b2abfc0, 0x5a59f5f6, 0xa5a60a0a, 0xf5f65a5a, 0x0a09a5a6, 0x72722929,
- 0x8d8dd6d7, 0x29297272, 0xd6d68d8e, 0x74744040, 0x8b8bbfc0, 0x40407474, 0xbfbf8b8c, 0x5251dadb,
- 0xadae2525, 0xdadb5252, 0x2524adae, 0x77771616, 0x8888e9ea, 0x16167777, 0xe9e98889, 0x7c7c5f5f,
- 0x8383a0a1, 0x5f5f7c7c, 0xa0a08384, 0x6f6ee1e2, 0x90911e1e, 0xe1e26f6f, 0x1e1d9091, 0x5c5bb1b2,
- 0xa3a44e4e, 0xb1b25c5c, 0x4e4da3a4, 0x7170bbbc, 0x8e8f4444, 0xbbbc7171, 0x44438e8f, 0x12121212,
- 0xedededee, 0x22222222, 0xddddddde, 0x3f3f3f3f, 0xc0c0c0c1, 0x6d6d6d6d, 0x92929293, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x03030303, 0x03030303, 0x03030303, 0x03030303, 0x03030303, 0x03030303, 0x03030303, 0x03030303,
- 0x03030303, 0xfcfcfcfd, 0xfcfcfcfd, 0xfcfcfcfd, 0xfcfcfcfd, 0xfcfcfcfd, 0xfcfcfcfd, 0xfcfcfcfd,
- 0xfcfcfcfd, 0xfcfcfcfd, 0x0403feff, 0x0403feff, 0x0403feff, 0x0403feff, 0x0403feff, 0x0403feff,
- 0x0403feff, 0x0403feff, 0x0403feff, 0xfbfc0101, 0xfbfc0101, 0xfbfc0101, 0xfbfc0101, 0xfbfc0101,
- 0xfbfc0101, 0xfbfc0101, 0xfbfc0101, 0xfbfc0101, 0xfeff0404, 0xfeff0404, 0xfeff0404, 0xfeff0404,
- 0xfeff0404, 0xfeff0404, 0xfeff0404, 0xfeff0404, 0xfeff0404, 0x0100fbfc, 0x0100fbfc, 0x0100fbfc,
- 0x0100fbfc, 0x0100fbfc, 0x0100fbfc, 0x0100fbfc, 0x0100fbfc, 0x0100fbfc, 0x07070707, 0x07070707,
- 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0xf8f8f8f9,
- 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x04040404, 0xfbfbfbfc, 0x0504feff, 0xfafb0101, 0xfeff0505, 0x0100fafb, 0x0a0a0303,
- 0xf5f5fcfd, 0x03030a0a, 0xfcfcf5f6, 0x09090909, 0xf6f6f6f7, 0x0706f8f9, 0xf8f90707, 0x0c0bfcfd,
- 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4, 0x11110808, 0xeeeef7f8, 0x08081111, 0xf7f7eeef, 0x11111111,
- 0xeeeeeeef, 0x13130101, 0xececfeff, 0x01011313, 0xfefeeced, 0x100ff4f5, 0xeff00b0b, 0xf4f51010,
- 0x0b0aeff0, 0x1716f9fa, 0xe8e90606, 0xf9fa1717, 0x0605e8e9, 0x1f1f1212, 0xe0e0edee, 0x12121f1f,
- 0xedede0e1, 0x20200808, 0xdfdff7f8, 0x08082020, 0xf7f7dfe0, 0x21212121, 0xdedededf, 0x2423feff,
- 0xdbdc0101, 0xfeff2424, 0x0100dbdc, 0x1716e8e9, 0xe8e91717, 0x1f1eeeef, 0xe0e11111, 0xeeef1f1f,
- 0x1110e0e1, 0x36361515, 0xc9c9eaeb, 0x15153636, 0xeaeac9ca, 0x37372525, 0xc8c8dadb, 0x25253737,
- 0xdadac8c9, 0x2c2bf3f4, 0xd3d40c0c, 0xf3f42c2c, 0x0c0bd3d4, 0x39390808, 0xc6c6f7f8, 0x08083939,
- 0xf7f7c6c7, 0x3d3d3d3d, 0xc2c2c2c3, 0x4241fafb, 0xbdbe0505, 0xfafb4242, 0x0504bdbe, 0x2d2cdbdc,
- 0xd2d32424, 0xdbdc2d2d, 0x2423d2d3, 0x3c3be2e3, 0xc3c41d1d, 0xe2e33c3c, 0x1d1cc3c4, 0x5c5c2d2d,
- 0xa3a3d2d3, 0x2d2d5c5c, 0xd2d2a3a4, 0x5d5d1919, 0xa2a2e6e7, 0x19195d5d, 0xe6e6a2a3, 0x61614747,
- 0x9e9eb8b9, 0x47476161, 0xb8b89e9f, 0x5352e9ea, 0xacad1616, 0xe9ea5353, 0x1615acad, 0x66660707,
- 0x9999f8f9, 0x07076666, 0xf8f8999a, 0x6d6d6d6d, 0x92929293, 0x4443bbbc, 0xbbbc4444, 0x5554c6c7,
- 0xaaab3939, 0xc6c75555, 0x3938aaab, 0x7877f2f3, 0x87880d0d, 0xf2f37878, 0x0d0c8788, 0x6e6dcecf,
- 0x91923131, 0xcecf6e6e, 0x31309192, 0x7b7a9798, 0x84856868, 0x97987b7b, 0x68678485, 0x18181818,
- 0xe7e7e7e8, 0x2e2e2e2e, 0xd1d1d1d2, 0x54545454, 0xabababac, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x04040404,
- 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404,
- 0x04040404, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc,
- 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0x0504feff, 0x0504feff, 0x0504feff, 0x0504feff, 0x0504feff,
- 0x0504feff, 0x0504feff, 0x0504feff, 0x0504feff, 0x0504feff, 0xfafb0101, 0xfafb0101, 0xfafb0101,
- 0xfafb0101, 0xfafb0101, 0xfafb0101, 0xfafb0101, 0xfafb0101, 0xfafb0101, 0xfafb0101, 0xfeff0505,
- 0xfeff0505, 0xfeff0505, 0xfeff0505, 0xfeff0505, 0xfeff0505, 0xfeff0505, 0xfeff0505, 0xfeff0505,
- 0xfeff0505, 0x0100fafb, 0x0100fafb, 0x0100fafb, 0x0100fafb, 0x0100fafb, 0x0100fafb, 0x0100fafb,
- 0x0100fafb, 0x0100fafb, 0x0100fafb, 0x0a0a0303, 0x0a0a0303, 0x0a0a0303, 0x0a0a0303, 0x0a0a0303,
- 0x0a0a0303, 0x0a0a0303, 0x0a0a0303, 0x0a0a0303, 0x0a0a0303, 0xf5f5fcfd, 0xf5f5fcfd, 0xf5f5fcfd,
- 0xf5f5fcfd, 0xf5f5fcfd, 0xf5f5fcfd, 0xf5f5fcfd, 0xf5f5fcfd, 0xf5f5fcfd, 0xf5f5fcfd, 0x03030a0a,
- 0x03030a0a, 0x03030a0a, 0x03030a0a, 0x03030a0a, 0x03030a0a, 0x03030a0a, 0x03030a0a, 0x03030a0a,
- 0x03030a0a, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x05050505, 0xfafafafb, 0x0706fdfe, 0xf8f90202, 0xfdfe0707, 0x0201f8f9, 0x0b0b0b0b,
- 0xf4f4f4f5, 0x0d0d0303, 0xf2f2fcfd, 0x03030d0d, 0xfcfcf2f3, 0x0908f6f7, 0xf6f70909, 0x0f0efbfc,
- 0xf0f10404, 0xfbfc0f0f, 0x0403f0f1, 0x16160b0b, 0xe9e9f4f5, 0x0b0b1616, 0xf4f4e9ea, 0x15151515,
- 0xeaeaeaeb, 0x18180202, 0xe7e7fdfe, 0x02021818, 0xfdfde7e8, 0x1413f1f2, 0xebec0e0e, 0xf1f21414,
- 0x0e0debec, 0x26261717, 0xd9d9e8e9, 0x17172626, 0xe8e8d9da, 0x1d1cf7f8, 0xe2e30808, 0xf7f81d1d,
- 0x0807e2e3, 0x27270b0b, 0xd8d8f4f5, 0x0b0b2727, 0xf4f4d8d9, 0x29292929, 0xd6d6d6d7, 0x2d2cfeff,
- 0xd2d30101, 0xfeff2d2d, 0x0100d2d3, 0x1d1ce2e3, 0xe2e31d1d, 0x2726e9ea, 0xd8d91616, 0xe9ea2727,
- 0x1615d8d9, 0x43431b1b, 0xbcbce4e5, 0x1b1b4343, 0xe4e4bcbd, 0x45452f2f, 0xbabad0d1, 0x2f2f4545,
- 0xd0d0babb, 0x3837f0f1, 0xc7c80f0f, 0xf0f13838, 0x0f0ec7c8, 0x47470b0b, 0xb8b8f4f5, 0x0b0b4747,
- 0xf4f4b8b9, 0x4c4c4c4c, 0xb3b3b3b4, 0x5352f9fa, 0xacad0606, 0xf9fa5353, 0x0605acad, 0x3938d2d3,
- 0xc6c72d2d, 0xd2d33939, 0x2d2cc6c7, 0x4b4adbdc, 0xb4b52424, 0xdbdc4b4b, 0x2423b4b5, 0x73733838,
- 0x8c8cc7c8, 0x38387373, 0xc7c78c8d, 0x75751f1f, 0x8a8ae0e1, 0x1f1f7575, 0xe0e08a8b, 0x7a7a5858,
- 0x8585a7a8, 0x58587a7a, 0xa7a78586, 0x6867e3e4, 0x97981c1c, 0xe3e46868, 0x1c1b9798, 0x5554aaab,
- 0xaaab5555, 0x6a69b7b8, 0x95964848, 0xb7b86a6a, 0x48479596, 0x1e1e1e1e, 0xe1e1e1e2, 0x3a3a3a3a,
- 0xc5c5c5c6, 0x69696969, 0x96969697, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x05050505, 0x05050505,
- 0x05050505, 0x05050505, 0x05050505, 0x05050505, 0x05050505, 0x05050505, 0x05050505, 0x05050505,
- 0x05050505, 0xfafafafb, 0xfafafafb, 0xfafafafb, 0xfafafafb, 0xfafafafb, 0xfafafafb, 0xfafafafb,
- 0xfafafafb, 0xfafafafb, 0xfafafafb, 0xfafafafb, 0x0706fdfe, 0x0706fdfe, 0x0706fdfe, 0x0706fdfe,
- 0x0706fdfe, 0x0706fdfe, 0x0706fdfe, 0x0706fdfe, 0x0706fdfe, 0x0706fdfe, 0x0706fdfe, 0xf8f90202,
- 0xf8f90202, 0xf8f90202, 0xf8f90202, 0xf8f90202, 0xf8f90202, 0xf8f90202, 0xf8f90202, 0xf8f90202,
- 0xf8f90202, 0xf8f90202, 0xfdfe0707, 0xfdfe0707, 0xfdfe0707, 0xfdfe0707, 0xfdfe0707, 0xfdfe0707,
- 0xfdfe0707, 0xfdfe0707, 0xfdfe0707, 0xfdfe0707, 0xfdfe0707, 0x0201f8f9, 0x0201f8f9, 0x0201f8f9,
- 0x0201f8f9, 0x0201f8f9, 0x0201f8f9, 0x0201f8f9, 0x0201f8f9, 0x0201f8f9, 0x0201f8f9, 0x0201f8f9,
- 0x0b0b0b0b, 0x0b0b0b0b, 0x0b0b0b0b, 0x0b0b0b0b, 0x0b0b0b0b, 0x0b0b0b0b, 0x0b0b0b0b, 0x0b0b0b0b,
- 0x0b0b0b0b, 0x0b0b0b0b, 0x0b0b0b0b, 0xf4f4f4f5, 0xf4f4f4f5, 0xf4f4f4f5, 0xf4f4f4f5, 0xf4f4f4f5,
- 0xf4f4f4f5, 0xf4f4f4f5, 0xf4f4f4f5, 0xf4f4f4f5, 0xf4f4f4f5, 0xf4f4f4f5, 0x0d0d0303, 0x0d0d0303,
- 0x0d0d0303, 0x0d0d0303, 0x0d0d0303, 0x0d0d0303, 0x0d0d0303, 0x0d0d0303, 0x0d0d0303, 0x0d0d0303,
- 0x0d0d0303, 0xf2f2fcfd, 0xf2f2fcfd, 0xf2f2fcfd, 0xf2f2fcfd, 0xf2f2fcfd, 0xf2f2fcfd, 0xf2f2fcfd,
- 0xf2f2fcfd, 0xf2f2fcfd, 0xf2f2fcfd, 0xf2f2fcfd, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x06060606, 0xf9f9f9fa, 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8, 0x0d0d0d0d,
- 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc, 0x04040f0f, 0xfbfbf0f1, 0x0b0af4f5, 0xf4f50b0b, 0x1211fafb,
- 0xedee0505, 0xfafb1212, 0x0504edee, 0x1a1a0d0d, 0xe5e5f2f3, 0x0d0d1a1a, 0xf2f2e5e6, 0x1a1a1a1a,
- 0xe5e5e5e6, 0x1d1d0202, 0xe2e2fdfe, 0x02021d1d, 0xfdfde2e3, 0x1817eff0, 0xe7e81010, 0xeff01818,
- 0x100fe7e8, 0x2e2e1c1c, 0xd1d1e3e4, 0x1c1c2e2e, 0xe3e3d1d2, 0x2322f6f7, 0xdcdd0909, 0xf6f72323,
- 0x0908dcdd, 0x2f2f0d0d, 0xd0d0f2f3, 0x0d0d2f2f, 0xf2f2d0d1, 0x31313131, 0xcecececf, 0x3635feff,
- 0xc9ca0101, 0xfeff3636, 0x0100c9ca, 0x2322dcdd, 0xdcdd2323, 0x2f2ee5e6, 0xd0d11a1a, 0xe5e62f2f,
- 0x1a19d0d1, 0x51512020, 0xaeaedfe0, 0x20205151, 0xdfdfaeaf, 0x53533838, 0xacacc7c8, 0x38385353,
- 0xc7c7acad, 0x4342edee, 0xbcbd1212, 0xedee4343, 0x1211bcbd, 0x56560d0d, 0xa9a9f2f3, 0x0d0d5656,
- 0xf2f2a9aa, 0x5b5b5b5b, 0xa4a4a4a5, 0x6362f8f9, 0x9c9d0707, 0xf8f96363, 0x07069c9d, 0x4443c9ca,
- 0xbbbc3636, 0xc9ca4444, 0x3635bbbc, 0x5a59d3d4, 0xa5a62c2c, 0xd3d45a5a, 0x2c2ba5a6, 0x7c7bdedf,
- 0x83842121, 0xdedf7c7c, 0x21208384, 0x67669899, 0x98996767, 0x7f7ea9aa, 0x80815656, 0xa9aa7f7f,
- 0x56558081, 0x25252525, 0xdadadadb, 0x45454545, 0xbabababb, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606,
- 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
- 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
- 0xf9f9f9fa, 0x0807fdfe, 0x0807fdfe, 0x0807fdfe, 0x0807fdfe, 0x0807fdfe, 0x0807fdfe, 0x0807fdfe,
- 0x0807fdfe, 0x0807fdfe, 0x0807fdfe, 0x0807fdfe, 0x0807fdfe, 0xf7f80202, 0xf7f80202, 0xf7f80202,
- 0xf7f80202, 0xf7f80202, 0xf7f80202, 0xf7f80202, 0xf7f80202, 0xf7f80202, 0xf7f80202, 0xf7f80202,
- 0xf7f80202, 0xfdfe0808, 0xfdfe0808, 0xfdfe0808, 0xfdfe0808, 0xfdfe0808, 0xfdfe0808, 0xfdfe0808,
- 0xfdfe0808, 0xfdfe0808, 0xfdfe0808, 0xfdfe0808, 0xfdfe0808, 0x0201f7f8, 0x0201f7f8, 0x0201f7f8,
- 0x0201f7f8, 0x0201f7f8, 0x0201f7f8, 0x0201f7f8, 0x0201f7f8, 0x0201f7f8, 0x0201f7f8, 0x0201f7f8,
- 0x0201f7f8, 0x0d0d0d0d, 0x0d0d0d0d, 0x0d0d0d0d, 0x0d0d0d0d, 0x0d0d0d0d, 0x0d0d0d0d, 0x0d0d0d0d,
- 0x0d0d0d0d, 0x0d0d0d0d, 0x0d0d0d0d, 0x0d0d0d0d, 0x0d0d0d0d, 0xf2f2f2f3, 0xf2f2f2f3, 0xf2f2f2f3,
- 0xf2f2f2f3, 0xf2f2f2f3, 0xf2f2f2f3, 0xf2f2f2f3, 0xf2f2f2f3, 0xf2f2f2f3, 0xf2f2f2f3, 0xf2f2f2f3,
- 0xf2f2f2f3, 0x0f0f0404, 0x0f0f0404, 0x0f0f0404, 0x0f0f0404, 0x0f0f0404, 0x0f0f0404, 0x0f0f0404,
- 0x0f0f0404, 0x0f0f0404, 0x0f0f0404, 0x0f0f0404, 0x0f0f0404, 0xf0f0fbfc, 0xf0f0fbfc, 0xf0f0fbfc,
- 0xf0f0fbfc, 0xf0f0fbfc, 0xf0f0fbfc, 0xf0f0fbfc, 0xf0f0fbfc, 0xf0f0fbfc, 0xf0f0fbfc, 0xf0f0fbfc,
- 0xf0f0fbfc, 0x04040f0f, 0x04040f0f, 0x04040f0f, 0x04040f0f, 0x04040f0f, 0x04040f0f, 0x04040f0f,
- 0x04040f0f, 0x04040f0f, 0x04040f0f, 0x04040f0f, 0x04040f0f, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x07070707, 0xf8f8f8f9, 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6, 0x10101010,
- 0xefefeff0, 0x12120505, 0xededfafb, 0x05051212, 0xfafaedee, 0x0d0cf2f3, 0xf2f30d0d, 0x1514f9fa,
- 0xeaeb0606, 0xf9fa1515, 0x0605eaeb, 0x1e1e0f0f, 0xe1e1f0f1, 0x0f0f1e1e, 0xf0f0e1e2, 0x1e1e1e1e,
- 0xe1e1e1e2, 0x22220202, 0xddddfdfe, 0x02022222, 0xfdfdddde, 0x1c1beced, 0xe3e41313, 0xeced1c1c,
- 0x1312e3e4, 0x36362020, 0xc9c9dfe0, 0x20203636, 0xdfdfc9ca, 0x2928f4f5, 0xd6d70b0b, 0xf4f52929,
- 0x0b0ad6d7, 0x37370f0f, 0xc8c8f0f1, 0x0f0f3737, 0xf0f0c8c9, 0x39393939, 0xc6c6c6c7, 0x3f3efeff,
- 0xc0c10101, 0xfeff3f3f, 0x0100c0c1, 0x2827d7d8, 0xd7d82828, 0x3736e1e2, 0xc8c91e1e, 0xe1e23737,
- 0x1e1dc8c9, 0x5e5e2525, 0xa1a1dadb, 0x25255e5e, 0xdadaa1a2, 0x60604141, 0x9f9fbebf, 0x41416060,
- 0xbebe9fa0, 0x4e4deaeb, 0xb1b21515, 0xeaeb4e4e, 0x1514b1b2, 0x64640f0f, 0x9b9bf0f1, 0x0f0f6464,
- 0xf0f09b9c, 0x6a6a6a6a, 0x95959596, 0x7473f7f8, 0x8b8c0808, 0xf7f87474, 0x08078b8c, 0x4f4ec0c1,
- 0xb0b13f3f, 0xc0c14f4f, 0x3f3eb0b1, 0x6968cccd, 0x96973333, 0xcccd6969, 0x33329697, 0x78778788,
- 0x87887878, 0x2b2b2b2b, 0xd4d4d4d5, 0x50505050, 0xafafafb0, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0x07070707,
- 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9,
- 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9,
- 0xf8f8f8f9, 0x0a09fcfd, 0x0a09fcfd, 0x0a09fcfd, 0x0a09fcfd, 0x0a09fcfd, 0x0a09fcfd, 0x0a09fcfd,
- 0x0a09fcfd, 0x0a09fcfd, 0x0a09fcfd, 0x0a09fcfd, 0x0a09fcfd, 0xf5f60303, 0xf5f60303, 0xf5f60303,
- 0xf5f60303, 0xf5f60303, 0xf5f60303, 0xf5f60303, 0xf5f60303, 0xf5f60303, 0xf5f60303, 0xf5f60303,
- 0xf5f60303, 0xfcfd0a0a, 0xfcfd0a0a, 0xfcfd0a0a, 0xfcfd0a0a, 0xfcfd0a0a, 0xfcfd0a0a, 0xfcfd0a0a,
- 0xfcfd0a0a, 0xfcfd0a0a, 0xfcfd0a0a, 0xfcfd0a0a, 0xfcfd0a0a, 0x0302f5f6, 0x0302f5f6, 0x0302f5f6,
- 0x0302f5f6, 0x0302f5f6, 0x0302f5f6, 0x0302f5f6, 0x0302f5f6, 0x0302f5f6, 0x0302f5f6, 0x0302f5f6,
- 0x0302f5f6, 0x10101010, 0x10101010, 0x10101010, 0x10101010, 0x10101010, 0x10101010, 0x10101010,
- 0x10101010, 0x10101010, 0x10101010, 0x10101010, 0x10101010, 0xefefeff0, 0xefefeff0, 0xefefeff0,
- 0xefefeff0, 0xefefeff0, 0xefefeff0, 0xefefeff0, 0xefefeff0, 0xefefeff0, 0xefefeff0, 0xefefeff0,
- 0xefefeff0, 0x12120505, 0x12120505, 0x12120505, 0x12120505, 0x12120505, 0x12120505, 0x12120505,
- 0x12120505, 0x12120505, 0x12120505, 0x12120505, 0x12120505, 0xededfafb, 0xededfafb, 0xededfafb,
- 0xededfafb, 0xededfafb, 0xededfafb, 0xededfafb, 0xededfafb, 0xededfafb, 0xededfafb, 0xededfafb,
- 0xededfafb, 0x05051212, 0x05051212, 0x05051212, 0x05051212, 0x05051212, 0x05051212, 0x05051212,
- 0x05051212, 0x05051212, 0x05051212, 0x05051212, 0x05051212, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303, 0xfcfd0b0b, 0x0302f4f5, 0x12121212,
- 0xedededee, 0x14140505, 0xebebfafb, 0x05051414, 0xfafaebec, 0x0f0ef0f1, 0xf0f10f0f, 0x1817f8f9,
- 0xe7e80707, 0xf8f91818, 0x0706e7e8, 0x23231111, 0xdcdceeef, 0x11112323, 0xeeeedcdd, 0x22222222,
- 0xddddddde, 0x26260303, 0xd9d9fcfd, 0x03032626, 0xfcfcd9da, 0x201fe9ea, 0xdfe01616, 0xe9ea2020,
- 0x1615dfe0, 0x3d3d2525, 0xc2c2dadb, 0x25253d3d, 0xdadac2c3, 0x2f2ef2f3, 0xd0d10d0d, 0xf2f32f2f,
- 0x0d0cd0d1, 0x3f3f1111, 0xc0c0eeef, 0x11113f3f, 0xeeeec0c1, 0x41414141, 0xbebebebf, 0x4847feff,
- 0xb7b80101, 0xfeff4848, 0x0100b7b8, 0x2e2dd1d2, 0xd1d22e2e, 0x3f3edcdd, 0xc0c12323, 0xdcdd3f3f,
- 0x2322c0c1, 0x6b6b2b2b, 0x9494d4d5, 0x2b2b6b6b, 0xd4d49495, 0x6e6e4b4b, 0x9191b4b5, 0x4b4b6e6e,
- 0xb4b49192, 0x5958e7e8, 0xa6a71818, 0xe7e85959, 0x1817a6a7, 0x72721111, 0x8d8deeef, 0x11117272,
- 0xeeee8d8e, 0x79797979, 0x86868687, 0x5b5ab7b8, 0xa4a54848, 0xb7b85b5b, 0x4847a4a5, 0x7877c5c6,
- 0x87883a3a, 0xc5c67878, 0x3a398788, 0x31313131, 0xcecececf, 0x5c5c5c5c, 0xa3a3a3a4, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x08080808, 0x08080808, 0x08080808, 0x08080808, 0x08080808,
- 0x08080808, 0x08080808, 0x08080808, 0x08080808, 0x08080808, 0x08080808, 0x08080808, 0xf7f7f7f8,
- 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8,
- 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0x0b0afcfd, 0x0b0afcfd, 0x0b0afcfd, 0x0b0afcfd, 0x0b0afcfd,
- 0x0b0afcfd, 0x0b0afcfd, 0x0b0afcfd, 0x0b0afcfd, 0x0b0afcfd, 0x0b0afcfd, 0x0b0afcfd, 0xf4f50303,
- 0xf4f50303, 0xf4f50303, 0xf4f50303, 0xf4f50303, 0xf4f50303, 0xf4f50303, 0xf4f50303, 0xf4f50303,
- 0xf4f50303, 0xf4f50303, 0xf4f50303, 0xfcfd0b0b, 0xfcfd0b0b, 0xfcfd0b0b, 0xfcfd0b0b, 0xfcfd0b0b,
- 0xfcfd0b0b, 0xfcfd0b0b, 0xfcfd0b0b, 0xfcfd0b0b, 0xfcfd0b0b, 0xfcfd0b0b, 0xfcfd0b0b, 0x0302f4f5,
- 0x0302f4f5, 0x0302f4f5, 0x0302f4f5, 0x0302f4f5, 0x0302f4f5, 0x0302f4f5, 0x0302f4f5, 0x0302f4f5,
- 0x0302f4f5, 0x0302f4f5, 0x0302f4f5, 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0x12121212,
- 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0xedededee,
- 0xedededee, 0xedededee, 0xedededee, 0xedededee, 0xedededee, 0xedededee, 0xedededee, 0xedededee,
- 0xedededee, 0xedededee, 0xedededee, 0x14140505, 0x14140505, 0x14140505, 0x14140505, 0x14140505,
- 0x14140505, 0x14140505, 0x14140505, 0x14140505, 0x14140505, 0x14140505, 0x14140505, 0xebebfafb,
- 0xebebfafb, 0xebebfafb, 0xebebfafb, 0xebebfafb, 0xebebfafb, 0xebebfafb, 0xebebfafb, 0xebebfafb,
- 0xebebfafb, 0xebebfafb, 0xebebfafb, 0x05051414, 0x05051414, 0x05051414, 0x05051414, 0x05051414,
- 0x05051414, 0x05051414, 0x05051414, 0x05051414, 0x05051414, 0x05051414, 0x05051414, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x09090909, 0xf6f6f6f7, 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4, 0x14141414,
- 0xebebebec, 0x17170606, 0xe8e8f9fa, 0x06061717, 0xf9f9e8e9, 0x1110eeef, 0xeeef1111, 0x1b1af8f9,
- 0xe4e50707, 0xf8f91b1b, 0x0706e4e5, 0x27271313, 0xd8d8eced, 0x13132727, 0xececd8d9, 0x27272727,
- 0xd8d8d8d9, 0x2b2b0303, 0xd4d4fcfd, 0x03032b2b, 0xfcfcd4d5, 0x2423e7e8, 0xdbdc1818, 0xe7e82424,
- 0x1817dbdc, 0x45452a2a, 0xbabad5d6, 0x2a2a4545, 0xd5d5babb, 0x3534f1f2, 0xcacb0e0e, 0xf1f23535,
- 0x0e0dcacb, 0x47471313, 0xb8b8eced, 0x13134747, 0xececb8b9, 0x49494949, 0xb6b6b6b7, 0x504ffdfe,
- 0xafb00202, 0xfdfe5050, 0x0201afb0, 0x3433cbcc, 0xcbcc3434, 0x4645d8d9, 0xb9ba2727, 0xd8d94646,
- 0x2726b9ba, 0x79793030, 0x8686cfd0, 0x30307979, 0xcfcf8687, 0x7c7c5454, 0x8383abac, 0x54547c7c,
- 0xabab8384, 0x6463e4e5, 0x9b9c1b1b, 0xe4e56464, 0x1b1a9b9c, 0x6665aeaf, 0x999a5151, 0xaeaf6666,
- 0x5150999a, 0x37373737, 0xc8c8c8c9, 0x68686868, 0x97979798, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0x09090909,
- 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0xf6f6f6f7,
- 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7,
- 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0x0c0bfcfd, 0x0c0bfcfd, 0x0c0bfcfd, 0x0c0bfcfd,
- 0x0c0bfcfd, 0x0c0bfcfd, 0x0c0bfcfd, 0x0c0bfcfd, 0x0c0bfcfd, 0x0c0bfcfd, 0x0c0bfcfd, 0x0c0bfcfd,
- 0x0c0bfcfd, 0xf3f40303, 0xf3f40303, 0xf3f40303, 0xf3f40303, 0xf3f40303, 0xf3f40303, 0xf3f40303,
- 0xf3f40303, 0xf3f40303, 0xf3f40303, 0xf3f40303, 0xf3f40303, 0xf3f40303, 0xfcfd0c0c, 0xfcfd0c0c,
- 0xfcfd0c0c, 0xfcfd0c0c, 0xfcfd0c0c, 0xfcfd0c0c, 0xfcfd0c0c, 0xfcfd0c0c, 0xfcfd0c0c, 0xfcfd0c0c,
- 0xfcfd0c0c, 0xfcfd0c0c, 0xfcfd0c0c, 0x0302f3f4, 0x0302f3f4, 0x0302f3f4, 0x0302f3f4, 0x0302f3f4,
- 0x0302f3f4, 0x0302f3f4, 0x0302f3f4, 0x0302f3f4, 0x0302f3f4, 0x0302f3f4, 0x0302f3f4, 0x0302f3f4,
- 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414,
- 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0xebebebec, 0xebebebec, 0xebebebec,
- 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec,
- 0xebebebec, 0xebebebec, 0x17170606, 0x17170606, 0x17170606, 0x17170606, 0x17170606, 0x17170606,
- 0x17170606, 0x17170606, 0x17170606, 0x17170606, 0x17170606, 0x17170606, 0x17170606, 0xe8e8f9fa,
- 0xe8e8f9fa, 0xe8e8f9fa, 0xe8e8f9fa, 0xe8e8f9fa, 0xe8e8f9fa, 0xe8e8f9fa, 0xe8e8f9fa, 0xe8e8f9fa,
- 0xe8e8f9fa, 0xe8e8f9fa, 0xe8e8f9fa, 0xe8e8f9fa, 0x06061717, 0x06061717, 0x06061717, 0x06061717,
- 0x06061717, 0x06061717, 0x06061717, 0x06061717, 0x06061717, 0x06061717, 0x06061717, 0x06061717,
- 0x06061717, 0xf9f9e8e9, 0xf9f9e8e9, 0xf9f9e8e9, 0xf9f9e8e9, 0xf9f9e8e9, 0xf9f9e8e9, 0xf9f9e8e9,
- 0xf9f9e8e9, 0xf9f9e8e9, 0xf9f9e8e9, 0xf9f9e8e9, 0xf9f9e8e9, 0xf9f9e8e9, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x02020202, 0xfdfdfdfe, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x04040404,
- 0xfbfbfbfc, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x0403fbfc, 0xfbfc0404, 0x0605fdfe,
- 0xf9fa0202, 0xfdfe0606, 0x0201f9fa, 0x08080404, 0xf7f7fbfc, 0x04040808, 0xfbfbf7f8, 0x08080808,
- 0xf7f7f7f8, 0x0a0a0000, 0xf5f60000, 0x00000a0a, 0xfffff5f6, 0x0807fbfc, 0xf7f80404, 0xfbfc0808,
- 0x0403f7f8, 0x0e0e0808, 0xf1f1f7f8, 0x08080e0e, 0xf7f7f1f2, 0x0c0bfdfe, 0xf3f40202, 0xfdfe0c0c,
- 0x0201f3f4, 0x10100404, 0xefeffbfc, 0x04041010, 0xfbfbeff0, 0x10101010, 0xefefeff0, 0x12120000,
- 0xedee0000, 0x00001212, 0xffffedee, 0x0c0bf3f4, 0xf3f40c0c, 0x100ff7f8, 0xeff00808, 0xf7f81010,
- 0x0807eff0, 0x1a1a0a0a, 0xe5e5f5f6, 0x0a0a1a1a, 0xf5f5e5e6, 0x1c1c1212, 0xe3e3edee, 0x12121c1c,
- 0xedede3e4, 0x1615f9fa, 0xe9ea0606, 0xf9fa1616, 0x0605e9ea, 0x1c1c0404, 0xe3e3fbfc, 0x04041c1c,
- 0xfbfbe3e4, 0x1e1e1e1e, 0xe1e1e1e2, 0x201ffdfe, 0xdfe00202, 0xfdfe2020, 0x0201dfe0, 0x1615edee,
- 0xe9ea1212, 0xedee1616, 0x1211e9ea, 0x1e1df1f2, 0xe1e20e0e, 0xf1f21e1e, 0x0e0de1e2, 0x2e2e1616,
- 0xd1d1e9ea, 0x16162e2e, 0xe9e9d1d2, 0x2e2e0c0c, 0xd1d1f3f4, 0x0c0c2e2e, 0xf3f3d1d2, 0x30302222,
- 0xcfcfddde, 0x22223030, 0xddddcfd0, 0x2827f5f6, 0xd7d80a0a, 0xf5f62828, 0x0a09d7d8, 0x32320404,
- 0xcdcdfbfc, 0x04043232, 0xfbfbcdce, 0x36363636, 0xc9c9c9ca, 0x2221ddde, 0xddde2222, 0x2a29e3e4,
- 0xd5d61c1c, 0xe3e42a2a, 0x1c1bd5d6, 0x3c3bf9fa, 0xc3c40606, 0xf9fa3c3c, 0x0605c3c4, 0x4c4c1a1a,
- 0xb3b3e5e6, 0x1a1a4c4c, 0xe5e5b3b4, 0x4c4c2a2a, 0xb3b3d5d6, 0x2a2a4c4c, 0xd5d5b3b4, 0x3635e7e8,
- 0xc9ca1818, 0xe7e83636, 0x1817c9ca, 0x4e4e0e0e, 0xb1b1f1f2, 0x0e0e4e4e, 0xf1f1b1b2, 0x52523e3e,
- 0xadadc1c2, 0x3e3e5252, 0xc1c1adae, 0x4a49ebec, 0xb5b61414, 0xebec4a4a, 0x1413b5b6, 0x58580202,
- 0xa7a7fdfe, 0x02025858, 0xfdfda7a8, 0x5c5c5c5c, 0xa3a3a3a4, 0x3c3bcbcc, 0xc3c43434, 0xcbcc3c3c,
- 0x3433c3c4, 0x76763434, 0x8989cbcc, 0x34347676, 0xcbcb898a, 0x4a49d3d4, 0xb5b62c2c, 0xd3d44a4a,
- 0x2c2bb5b6, 0x76764a4a, 0x8989b5b6, 0x4a4a7676, 0xb5b5898a, 0x76762020, 0x8989dfe0, 0x20207676,
- 0xdfdf898a, 0x6665f3f4, 0x999a0c0c, 0xf3f46666, 0x0c0b999a, 0x605fd7d8, 0x9fa02828, 0xd7d86060,
- 0x28279fa0, 0x7675ddde, 0x898a2222, 0xddde7676, 0x2221898a, 0x5857a7a8, 0xa7a85858, 0x6867b1b2,
- 0x97984e4e, 0xb1b26868, 0x4e4d9798, 0x0c0c0c0c, 0xf3f3f3f4, 0x16161616, 0xe9e9e9ea, 0x2a2a2a2a,
- 0xd5d5d5d6, 0x48484848, 0xb7b7b7b8, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
- 0x02020202, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe,
- 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0xfdfe0000,
- 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0x00000202, 0x00000202,
- 0x00000202, 0x00000202, 0x00000202, 0x00000202, 0x00000202, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe,
- 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x03030303, 0xfcfcfcfd, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606,
- 0xf9f9f9fa, 0x09090303, 0xf6f6fcfd, 0x03030909, 0xfcfcf6f7, 0x0908fcfd, 0xf6f70303, 0xfcfd0909,
- 0x0302f6f7, 0x0605f9fa, 0xf9fa0606, 0x0c0c0606, 0xf3f3f9fa, 0x06060c0c, 0xf9f9f3f4, 0x0c0c0c0c,
- 0xf3f3f3f4, 0x0f0f0000, 0xf0f10000, 0x00000f0f, 0xfffff0f1, 0x0c0bf6f7, 0xf3f40909, 0xf6f70c0c,
- 0x0908f3f4, 0x18180f0f, 0xe7e7f0f1, 0x0f0f1818, 0xf0f0e7e8, 0x1211f9fa, 0xedee0606, 0xf9fa1212,
- 0x0605edee, 0x18180606, 0xe7e7f9fa, 0x06061818, 0xf9f9e7e8, 0x18181818, 0xe7e7e7e8, 0x1b1b0000,
- 0xe4e50000, 0x00001b1b, 0xffffe4e5, 0x1211edee, 0xedee1212, 0x1817f3f4, 0xe7e80c0c, 0xf3f41818,
- 0x0c0be7e8, 0x27270f0f, 0xd8d8f0f1, 0x0f0f2727, 0xf0f0d8d9, 0x2a2a1b1b, 0xd5d5e4e5, 0x1b1b2a2a,
- 0xe4e4d5d6, 0x2120f6f7, 0xdedf0909, 0xf6f72121, 0x0908dedf, 0x2a2a0606, 0xd5d5f9fa, 0x06062a2a,
- 0xf9f9d5d6, 0x2d2d2d2d, 0xd2d2d2d3, 0x3332fcfd, 0xcccd0303, 0xfcfd3333, 0x0302cccd, 0x2120e4e5,
- 0xdedf1b1b, 0xe4e52121, 0x1b1adedf, 0x2d2ceaeb, 0xd2d31515, 0xeaeb2d2d, 0x1514d2d3, 0x45452121,
- 0xbabadedf, 0x21214545, 0xdedebabb, 0x45451212, 0xbabaedee, 0x12124545, 0xededbabb, 0x48483636,
- 0xb7b7c9ca, 0x36364848, 0xc9c9b7b8, 0x3f3eedee, 0xc0c11212, 0xedee3f3f, 0x1211c0c1, 0x4e4e0606,
- 0xb1b1f9fa, 0x06064e4e, 0xf9f9b1b2, 0x51515151, 0xaeaeaeaf, 0x3332cccd, 0xcccd3333, 0x3f3ed5d6,
- 0xc0c12a2a, 0xd5d63f3f, 0x2a29c0c1, 0x5a59f6f7, 0xa5a60909, 0xf6f75a5a, 0x0908a5a6, 0x72722a2a,
- 0x8d8dd5d6, 0x2a2a7272, 0xd5d58d8e, 0x75753f3f, 0x8a8ac0c1, 0x3f3f7575, 0xc0c08a8b, 0x5150dbdc,
- 0xaeaf2424, 0xdbdc5151, 0x2423aeaf, 0x78781515, 0x8787eaeb, 0x15157878, 0xeaea8788, 0x7b7b6060,
- 0x84849fa0, 0x60607b7b, 0x9f9f8485, 0x6f6ee1e2, 0x90911e1e, 0xe1e26f6f, 0x1e1d9091, 0x5d5cb1b2,
- 0xa2a34e4e, 0xb1b25d5d, 0x4e4da2a3, 0x7271babb, 0x8d8e4545, 0xbabb7272, 0x45448d8e, 0x12121212,
- 0xedededee, 0x21212121, 0xdedededf, 0x3f3f3f3f, 0xc0c0c0c1, 0x6c6c6c6c, 0x93939394, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x03030303, 0x03030303, 0x03030303, 0x03030303, 0x03030303, 0x03030303, 0x03030303, 0x03030303,
- 0x03030303, 0xfcfcfcfd, 0xfcfcfcfd, 0xfcfcfcfd, 0xfcfcfcfd, 0xfcfcfcfd, 0xfcfcfcfd, 0xfcfcfcfd,
- 0xfcfcfcfd, 0xfcfcfcfd, 0x03030000, 0x03030000, 0x03030000, 0x03030000, 0x03030000, 0x03030000,
- 0x03030000, 0x03030000, 0x03030000, 0xfcfd0000, 0xfcfd0000, 0xfcfd0000, 0xfcfd0000, 0xfcfd0000,
- 0xfcfd0000, 0xfcfd0000, 0xfcfd0000, 0xfcfd0000, 0x00000303, 0x00000303, 0x00000303, 0x00000303,
- 0x00000303, 0x00000303, 0x00000303, 0x00000303, 0x00000303, 0xfffffcfd, 0xfffffcfd, 0xfffffcfd,
- 0xfffffcfd, 0xfffffcfd, 0xfffffcfd, 0xfffffcfd, 0xfffffcfd, 0xfffffcfd, 0x06060606, 0x06060606,
- 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0xf9f9f9fa,
- 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x04040404, 0xfbfbfbfc, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x08080404,
- 0xf7f7fbfc, 0x04040808, 0xfbfbf7f8, 0x08080808, 0xf7f7f7f8, 0x0807f7f8, 0xf7f80808, 0x0c0bfbfc,
- 0xf3f40404, 0xfbfc0c0c, 0x0403f3f4, 0x10100808, 0xefeff7f8, 0x08081010, 0xf7f7eff0, 0x10101010,
- 0xefefeff0, 0x14140000, 0xebec0000, 0x00001414, 0xffffebec, 0x100ff3f4, 0xeff00c0c, 0xf3f41010,
- 0x0c0beff0, 0x1817fbfc, 0xe7e80404, 0xfbfc1818, 0x0403e7e8, 0x20201010, 0xdfdfeff0, 0x10102020,
- 0xefefdfe0, 0x20200808, 0xdfdff7f8, 0x08082020, 0xf7f7dfe0, 0x20202020, 0xdfdfdfe0, 0x24240000,
- 0xdbdc0000, 0x00002424, 0xffffdbdc, 0x1817e7e8, 0xe7e81818, 0x201feff0, 0xdfe01010, 0xeff02020,
- 0x100fdfe0, 0x34341414, 0xcbcbebec, 0x14143434, 0xebebcbcc, 0x38382424, 0xc7c7dbdc, 0x24243838,
- 0xdbdbc7c8, 0x2c2bf3f4, 0xd3d40c0c, 0xf3f42c2c, 0x0c0bd3d4, 0x38380808, 0xc7c7f7f8, 0x08083838,
- 0xf7f7c7c8, 0x3c3c3c3c, 0xc3c3c3c4, 0x403ffbfc, 0xbfc00404, 0xfbfc4040, 0x0403bfc0, 0x2c2bdbdc,
- 0xd3d42424, 0xdbdc2c2c, 0x2423d3d4, 0x3c3be3e4, 0xc3c41c1c, 0xe3e43c3c, 0x1c1bc3c4, 0x5c5c2c2c,
- 0xa3a3d3d4, 0x2c2c5c5c, 0xd3d3a3a4, 0x5c5c1818, 0xa3a3e7e8, 0x18185c5c, 0xe7e7a3a4, 0x60604848,
- 0x9f9fb7b8, 0x48486060, 0xb7b79fa0, 0x5453ebec, 0xabac1414, 0xebec5454, 0x1413abac, 0x64640808,
- 0x9b9bf7f8, 0x08086464, 0xf7f79b9c, 0x6c6c6c6c, 0x93939394, 0x4443bbbc, 0xbbbc4444, 0x5453c7c8,
- 0xabac3838, 0xc7c85454, 0x3837abac, 0x7877f3f4, 0x87880c0c, 0xf3f47878, 0x0c0b8788, 0x6c6bcfd0,
- 0x93943030, 0xcfd06c6c, 0x302f9394, 0x7c7b9798, 0x83846868, 0x97987c7c, 0x68678384, 0x18181818,
- 0xe7e7e7e8, 0x2c2c2c2c, 0xd3d3d3d4, 0x54545454, 0xabababac, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x04040404,
- 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404,
- 0x04040404, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc,
- 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0x04040000, 0x04040000, 0x04040000, 0x04040000, 0x04040000,
- 0x04040000, 0x04040000, 0x04040000, 0x04040000, 0x04040000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000,
- 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0x00000404,
- 0x00000404, 0x00000404, 0x00000404, 0x00000404, 0x00000404, 0x00000404, 0x00000404, 0x00000404,
- 0x00000404, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc,
- 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0x08080404, 0x08080404, 0x08080404, 0x08080404, 0x08080404,
- 0x08080404, 0x08080404, 0x08080404, 0x08080404, 0x08080404, 0xf7f7fbfc, 0xf7f7fbfc, 0xf7f7fbfc,
- 0xf7f7fbfc, 0xf7f7fbfc, 0xf7f7fbfc, 0xf7f7fbfc, 0xf7f7fbfc, 0xf7f7fbfc, 0xf7f7fbfc, 0x04040808,
- 0x04040808, 0x04040808, 0x04040808, 0x04040808, 0x04040808, 0x04040808, 0x04040808, 0x04040808,
- 0x04040808, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x05050505, 0xfafafafb, 0x05050000, 0xfafb0000, 0x00000505, 0xfffffafb, 0x0a0a0a0a,
- 0xf5f5f5f6, 0x0f0f0505, 0xf0f0fafb, 0x05050f0f, 0xfafaf0f1, 0x0a09f5f6, 0xf5f60a0a, 0x0f0efafb,
- 0xf0f10505, 0xfafb0f0f, 0x0504f0f1, 0x14140a0a, 0xebebf5f6, 0x0a0a1414, 0xf5f5ebec, 0x14141414,
- 0xebebebec, 0x19190000, 0xe6e70000, 0x00001919, 0xffffe6e7, 0x1413f0f1, 0xebec0f0f, 0xf0f11414,
- 0x0f0eebec, 0x28281919, 0xd7d7e6e7, 0x19192828, 0xe6e6d7d8, 0x1e1df5f6, 0xe1e20a0a, 0xf5f61e1e,
- 0x0a09e1e2, 0x28280a0a, 0xd7d7f5f6, 0x0a0a2828, 0xf5f5d7d8, 0x28282828, 0xd7d7d7d8, 0x2d2d0000,
- 0xd2d30000, 0x00002d2d, 0xffffd2d3, 0x1e1de1e2, 0xe1e21e1e, 0x2827ebec, 0xd7d81414, 0xebec2828,
- 0x1413d7d8, 0x41411919, 0xbebee6e7, 0x19194141, 0xe6e6bebf, 0x46462d2d, 0xb9b9d2d3, 0x2d2d4646,
- 0xd2d2b9ba, 0x3736f0f1, 0xc8c90f0f, 0xf0f13737, 0x0f0ec8c9, 0x46460a0a, 0xb9b9f5f6, 0x0a0a4646,
- 0xf5f5b9ba, 0x4b4b4b4b, 0xb4b4b4b5, 0x5554fafb, 0xaaab0505, 0xfafb5555, 0x0504aaab, 0x3736d2d3,
- 0xc8c92d2d, 0xd2d33737, 0x2d2cc8c9, 0x4b4adcdd, 0xb4b52323, 0xdcdd4b4b, 0x2322b4b5, 0x73733737,
- 0x8c8cc8c9, 0x37377373, 0xc8c88c8d, 0x73731e1e, 0x8c8ce1e2, 0x1e1e7373, 0xe1e18c8d, 0x78785a5a,
- 0x8787a5a6, 0x5a5a7878, 0xa5a58788, 0x6968e1e2, 0x96971e1e, 0xe1e26969, 0x1e1d9697, 0x5554aaab,
- 0xaaab5555, 0x6968b9ba, 0x96974646, 0xb9ba6969, 0x46459697, 0x1e1e1e1e, 0xe1e1e1e2, 0x3c3c3c3c,
- 0xc3c3c3c4, 0x69696969, 0x96969697, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x05050505, 0x05050505,
- 0x05050505, 0x05050505, 0x05050505, 0x05050505, 0x05050505, 0x05050505, 0x05050505, 0x05050505,
- 0x05050505, 0xfafafafb, 0xfafafafb, 0xfafafafb, 0xfafafafb, 0xfafafafb, 0xfafafafb, 0xfafafafb,
- 0xfafafafb, 0xfafafafb, 0xfafafafb, 0xfafafafb, 0x05050000, 0x05050000, 0x05050000, 0x05050000,
- 0x05050000, 0x05050000, 0x05050000, 0x05050000, 0x05050000, 0x05050000, 0x05050000, 0xfafb0000,
- 0xfafb0000, 0xfafb0000, 0xfafb0000, 0xfafb0000, 0xfafb0000, 0xfafb0000, 0xfafb0000, 0xfafb0000,
- 0xfafb0000, 0xfafb0000, 0x00000505, 0x00000505, 0x00000505, 0x00000505, 0x00000505, 0x00000505,
- 0x00000505, 0x00000505, 0x00000505, 0x00000505, 0x00000505, 0xfffffafb, 0xfffffafb, 0xfffffafb,
- 0xfffffafb, 0xfffffafb, 0xfffffafb, 0xfffffafb, 0xfffffafb, 0xfffffafb, 0xfffffafb, 0xfffffafb,
- 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a,
- 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6,
- 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0x0f0f0505, 0x0f0f0505,
- 0x0f0f0505, 0x0f0f0505, 0x0f0f0505, 0x0f0f0505, 0x0f0f0505, 0x0f0f0505, 0x0f0f0505, 0x0f0f0505,
- 0x0f0f0505, 0xf0f0fafb, 0xf0f0fafb, 0xf0f0fafb, 0xf0f0fafb, 0xf0f0fafb, 0xf0f0fafb, 0xf0f0fafb,
- 0xf0f0fafb, 0xf0f0fafb, 0xf0f0fafb, 0xf0f0fafb, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x0c0c0c0c,
- 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa, 0x06060c0c, 0xf9f9f3f4, 0x0c0bf3f4, 0xf3f40c0c, 0x1211f9fa,
- 0xedee0606, 0xf9fa1212, 0x0605edee, 0x18180c0c, 0xe7e7f3f4, 0x0c0c1818, 0xf3f3e7e8, 0x18181818,
- 0xe7e7e7e8, 0x1e1e0000, 0xe1e20000, 0x00001e1e, 0xffffe1e2, 0x1817edee, 0xe7e81212, 0xedee1818,
- 0x1211e7e8, 0x30301e1e, 0xcfcfe1e2, 0x1e1e3030, 0xe1e1cfd0, 0x2423f9fa, 0xdbdc0606, 0xf9fa2424,
- 0x0605dbdc, 0x30300c0c, 0xcfcff3f4, 0x0c0c3030, 0xf3f3cfd0, 0x30303030, 0xcfcfcfd0, 0x36360000,
- 0xc9ca0000, 0x00003636, 0xffffc9ca, 0x2423dbdc, 0xdbdc2424, 0x302fe7e8, 0xcfd01818, 0xe7e83030,
- 0x1817cfd0, 0x4e4e1e1e, 0xb1b1e1e2, 0x1e1e4e4e, 0xe1e1b1b2, 0x54543636, 0xababc9ca, 0x36365454,
- 0xc9c9abac, 0x4241edee, 0xbdbe1212, 0xedee4242, 0x1211bdbe, 0x54540c0c, 0xababf3f4, 0x0c0c5454,
- 0xf3f3abac, 0x5a5a5a5a, 0xa5a5a5a6, 0x605ff9fa, 0x9fa00606, 0xf9fa6060, 0x06059fa0, 0x4241c9ca,
- 0xbdbe3636, 0xc9ca4242, 0x3635bdbe, 0x5a59d5d6, 0xa5a62a2a, 0xd5d65a5a, 0x2a29a5a6, 0x7e7de1e2,
- 0x81821e1e, 0xe1e27e7e, 0x1e1d8182, 0x6665999a, 0x999a6666, 0x7e7dabac, 0x81825454, 0xabac7e7e,
- 0x54538182, 0x24242424, 0xdbdbdbdc, 0x42424242, 0xbdbdbdbe, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606,
- 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
- 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
- 0xf9f9f9fa, 0x06060000, 0x06060000, 0x06060000, 0x06060000, 0x06060000, 0x06060000, 0x06060000,
- 0x06060000, 0x06060000, 0x06060000, 0x06060000, 0x06060000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000,
- 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000,
- 0xf9fa0000, 0x00000606, 0x00000606, 0x00000606, 0x00000606, 0x00000606, 0x00000606, 0x00000606,
- 0x00000606, 0x00000606, 0x00000606, 0x00000606, 0x00000606, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa,
- 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa,
- 0xfffff9fa, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c,
- 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4,
- 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4,
- 0xf3f3f3f4, 0x0c0c0606, 0x0c0c0606, 0x0c0c0606, 0x0c0c0606, 0x0c0c0606, 0x0c0c0606, 0x0c0c0606,
- 0x0c0c0606, 0x0c0c0606, 0x0c0c0606, 0x0c0c0606, 0x0c0c0606, 0xf3f3f9fa, 0xf3f3f9fa, 0xf3f3f9fa,
- 0xf3f3f9fa, 0xf3f3f9fa, 0xf3f3f9fa, 0xf3f3f9fa, 0xf3f3f9fa, 0xf3f3f9fa, 0xf3f3f9fa, 0xf3f3f9fa,
- 0xf3f3f9fa, 0x06060c0c, 0x06060c0c, 0x06060c0c, 0x06060c0c, 0x06060c0c, 0x06060c0c, 0x06060c0c,
- 0x06060c0c, 0x06060c0c, 0x06060c0c, 0x06060c0c, 0x06060c0c, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x07070707, 0xf8f8f8f9, 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9, 0x0e0e0e0e,
- 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9, 0x07071515, 0xf8f8eaeb, 0x0e0df1f2, 0xf1f20e0e, 0x1514f8f9,
- 0xeaeb0707, 0xf8f91515, 0x0706eaeb, 0x1c1c0e0e, 0xe3e3f1f2, 0x0e0e1c1c, 0xf1f1e3e4, 0x1c1c1c1c,
- 0xe3e3e3e4, 0x23230000, 0xdcdd0000, 0x00002323, 0xffffdcdd, 0x1c1beaeb, 0xe3e41515, 0xeaeb1c1c,
- 0x1514e3e4, 0x38382323, 0xc7c7dcdd, 0x23233838, 0xdcdcc7c8, 0x2a29f1f2, 0xd5d60e0e, 0xf1f22a2a,
- 0x0e0dd5d6, 0x38380e0e, 0xc7c7f1f2, 0x0e0e3838, 0xf1f1c7c8, 0x38383838, 0xc7c7c7c8, 0x3f3f0000,
- 0xc0c10000, 0x00003f3f, 0xffffc0c1, 0x2a29d5d6, 0xd5d62a2a, 0x3837e3e4, 0xc7c81c1c, 0xe3e43838,
- 0x1c1bc7c8, 0x5b5b2323, 0xa4a4dcdd, 0x23235b5b, 0xdcdca4a5, 0x62623f3f, 0x9d9dc0c1, 0x3f3f6262,
- 0xc0c09d9e, 0x4d4ceaeb, 0xb2b31515, 0xeaeb4d4d, 0x1514b2b3, 0x62620e0e, 0x9d9df1f2, 0x0e0e6262,
- 0xf1f19d9e, 0x69696969, 0x96969697, 0x7776f8f9, 0x88890707, 0xf8f97777, 0x07068889, 0x4d4cc0c1,
- 0xb2b33f3f, 0xc0c14d4d, 0x3f3eb2b3, 0x6968cecf, 0x96973131, 0xcecf6969, 0x31309697, 0x77768889,
- 0x88897777, 0x2a2a2a2a, 0xd5d5d5d6, 0x4d4d4d4d, 0xb2b2b2b3, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0x07070707,
- 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9,
- 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9,
- 0xf8f8f8f9, 0x07070000, 0x07070000, 0x07070000, 0x07070000, 0x07070000, 0x07070000, 0x07070000,
- 0x07070000, 0x07070000, 0x07070000, 0x07070000, 0x07070000, 0xf8f90000, 0xf8f90000, 0xf8f90000,
- 0xf8f90000, 0xf8f90000, 0xf8f90000, 0xf8f90000, 0xf8f90000, 0xf8f90000, 0xf8f90000, 0xf8f90000,
- 0xf8f90000, 0x00000707, 0x00000707, 0x00000707, 0x00000707, 0x00000707, 0x00000707, 0x00000707,
- 0x00000707, 0x00000707, 0x00000707, 0x00000707, 0x00000707, 0xfffff8f9, 0xfffff8f9, 0xfffff8f9,
- 0xfffff8f9, 0xfffff8f9, 0xfffff8f9, 0xfffff8f9, 0xfffff8f9, 0xfffff8f9, 0xfffff8f9, 0xfffff8f9,
- 0xfffff8f9, 0x0e0e0e0e, 0x0e0e0e0e, 0x0e0e0e0e, 0x0e0e0e0e, 0x0e0e0e0e, 0x0e0e0e0e, 0x0e0e0e0e,
- 0x0e0e0e0e, 0x0e0e0e0e, 0x0e0e0e0e, 0x0e0e0e0e, 0x0e0e0e0e, 0xf1f1f1f2, 0xf1f1f1f2, 0xf1f1f1f2,
- 0xf1f1f1f2, 0xf1f1f1f2, 0xf1f1f1f2, 0xf1f1f1f2, 0xf1f1f1f2, 0xf1f1f1f2, 0xf1f1f1f2, 0xf1f1f1f2,
- 0xf1f1f1f2, 0x15150707, 0x15150707, 0x15150707, 0x15150707, 0x15150707, 0x15150707, 0x15150707,
- 0x15150707, 0x15150707, 0x15150707, 0x15150707, 0x15150707, 0xeaeaf8f9, 0xeaeaf8f9, 0xeaeaf8f9,
- 0xeaeaf8f9, 0xeaeaf8f9, 0xeaeaf8f9, 0xeaeaf8f9, 0xeaeaf8f9, 0xeaeaf8f9, 0xeaeaf8f9, 0xeaeaf8f9,
- 0xeaeaf8f9, 0x07071515, 0x07071515, 0x07071515, 0x07071515, 0x07071515, 0x07071515, 0x07071515,
- 0x07071515, 0x07071515, 0x07071515, 0x07071515, 0x07071515, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000, 0x00000808, 0xfffff7f8, 0x10101010,
- 0xefefeff0, 0x10100808, 0xefeff7f8, 0x08081010, 0xf7f7eff0, 0x100feff0, 0xeff01010, 0x1817f7f8,
- 0xe7e80808, 0xf7f81818, 0x0807e7e8, 0x20201010, 0xdfdfeff0, 0x10102020, 0xefefdfe0, 0x20202020,
- 0xdfdfdfe0, 0x28280000, 0xd7d80000, 0x00002828, 0xffffd7d8, 0x201fe7e8, 0xdfe01818, 0xe7e82020,
- 0x1817dfe0, 0x40402828, 0xbfbfd7d8, 0x28284040, 0xd7d7bfc0, 0x302feff0, 0xcfd01010, 0xeff03030,
- 0x100fcfd0, 0x40401010, 0xbfbfeff0, 0x10104040, 0xefefbfc0, 0x40404040, 0xbfbfbfc0, 0x48480000,
- 0xb7b80000, 0x00004848, 0xffffb7b8, 0x302fcfd0, 0xcfd03030, 0x403fdfe0, 0xbfc02020, 0xdfe04040,
- 0x201fbfc0, 0x68682828, 0x9797d7d8, 0x28286868, 0xd7d79798, 0x70704848, 0x8f8fb7b8, 0x48487070,
- 0xb7b78f90, 0x5857e7e8, 0xa7a81818, 0xe7e85858, 0x1817a7a8, 0x70701010, 0x8f8feff0, 0x10107070,
- 0xefef8f90, 0x78787878, 0x87878788, 0x5857b7b8, 0xa7a84848, 0xb7b85858, 0x4847a7a8, 0x7877c7c8,
- 0x87883838, 0xc7c87878, 0x38378788, 0x30303030, 0xcfcfcfd0, 0x58585858, 0xa7a7a7a8, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x08080808, 0x08080808, 0x08080808, 0x08080808, 0x08080808,
- 0x08080808, 0x08080808, 0x08080808, 0x08080808, 0x08080808, 0x08080808, 0x08080808, 0xf7f7f7f8,
- 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8,
- 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0x08080000, 0x08080000, 0x08080000, 0x08080000, 0x08080000,
- 0x08080000, 0x08080000, 0x08080000, 0x08080000, 0x08080000, 0x08080000, 0x08080000, 0xf7f80000,
- 0xf7f80000, 0xf7f80000, 0xf7f80000, 0xf7f80000, 0xf7f80000, 0xf7f80000, 0xf7f80000, 0xf7f80000,
- 0xf7f80000, 0xf7f80000, 0xf7f80000, 0x00000808, 0x00000808, 0x00000808, 0x00000808, 0x00000808,
- 0x00000808, 0x00000808, 0x00000808, 0x00000808, 0x00000808, 0x00000808, 0x00000808, 0xfffff7f8,
- 0xfffff7f8, 0xfffff7f8, 0xfffff7f8, 0xfffff7f8, 0xfffff7f8, 0xfffff7f8, 0xfffff7f8, 0xfffff7f8,
- 0xfffff7f8, 0xfffff7f8, 0xfffff7f8, 0x10101010, 0x10101010, 0x10101010, 0x10101010, 0x10101010,
- 0x10101010, 0x10101010, 0x10101010, 0x10101010, 0x10101010, 0x10101010, 0x10101010, 0xefefeff0,
- 0xefefeff0, 0xefefeff0, 0xefefeff0, 0xefefeff0, 0xefefeff0, 0xefefeff0, 0xefefeff0, 0xefefeff0,
- 0xefefeff0, 0xefefeff0, 0xefefeff0, 0x10100808, 0x10100808, 0x10100808, 0x10100808, 0x10100808,
- 0x10100808, 0x10100808, 0x10100808, 0x10100808, 0x10100808, 0x10100808, 0x10100808, 0xefeff7f8,
- 0xefeff7f8, 0xefeff7f8, 0xefeff7f8, 0xefeff7f8, 0xefeff7f8, 0xefeff7f8, 0xefeff7f8, 0xefeff7f8,
- 0xefeff7f8, 0xefeff7f8, 0xefeff7f8, 0x08081010, 0x08081010, 0x08081010, 0x08081010, 0x08081010,
- 0x08081010, 0x08081010, 0x08081010, 0x08081010, 0x08081010, 0x08081010, 0x08081010, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x09090909, 0xf6f6f6f7, 0x09090000, 0xf6f70000, 0x00000909, 0xfffff6f7, 0x12121212,
- 0xedededee, 0x1b1b0909, 0xe4e4f6f7, 0x09091b1b, 0xf6f6e4e5, 0x1211edee, 0xedee1212, 0x1b1af6f7,
- 0xe4e50909, 0xf6f71b1b, 0x0908e4e5, 0x24241212, 0xdbdbedee, 0x12122424, 0xededdbdc, 0x24242424,
- 0xdbdbdbdc, 0x2d2d0000, 0xd2d30000, 0x00002d2d, 0xffffd2d3, 0x2423e4e5, 0xdbdc1b1b, 0xe4e52424,
- 0x1b1adbdc, 0x48482d2d, 0xb7b7d2d3, 0x2d2d4848, 0xd2d2b7b8, 0x3635edee, 0xc9ca1212, 0xedee3636,
- 0x1211c9ca, 0x48481212, 0xb7b7edee, 0x12124848, 0xededb7b8, 0x48484848, 0xb7b7b7b8, 0x51510000,
- 0xaeaf0000, 0x00005151, 0xffffaeaf, 0x3635c9ca, 0xc9ca3636, 0x4847dbdc, 0xb7b82424, 0xdbdc4848,
- 0x2423b7b8, 0x75752d2d, 0x8a8ad2d3, 0x2d2d7575, 0xd2d28a8b, 0x7e7e5151, 0x8181aeaf, 0x51517e7e,
- 0xaeae8182, 0x6362e4e5, 0x9c9d1b1b, 0xe4e56363, 0x1b1a9c9d, 0x6362aeaf, 0x9c9d5151, 0xaeaf6363,
- 0x51509c9d, 0x36363636, 0xc9c9c9ca, 0x6c6c6c6c, 0x93939394, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0x09090909,
- 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0xf6f6f6f7,
- 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7,
- 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0x09090000, 0x09090000, 0x09090000, 0x09090000,
- 0x09090000, 0x09090000, 0x09090000, 0x09090000, 0x09090000, 0x09090000, 0x09090000, 0x09090000,
- 0x09090000, 0xf6f70000, 0xf6f70000, 0xf6f70000, 0xf6f70000, 0xf6f70000, 0xf6f70000, 0xf6f70000,
- 0xf6f70000, 0xf6f70000, 0xf6f70000, 0xf6f70000, 0xf6f70000, 0xf6f70000, 0x00000909, 0x00000909,
- 0x00000909, 0x00000909, 0x00000909, 0x00000909, 0x00000909, 0x00000909, 0x00000909, 0x00000909,
- 0x00000909, 0x00000909, 0x00000909, 0xfffff6f7, 0xfffff6f7, 0xfffff6f7, 0xfffff6f7, 0xfffff6f7,
- 0xfffff6f7, 0xfffff6f7, 0xfffff6f7, 0xfffff6f7, 0xfffff6f7, 0xfffff6f7, 0xfffff6f7, 0xfffff6f7,
- 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0x12121212,
- 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0xedededee, 0xedededee, 0xedededee,
- 0xedededee, 0xedededee, 0xedededee, 0xedededee, 0xedededee, 0xedededee, 0xedededee, 0xedededee,
- 0xedededee, 0xedededee, 0x1b1b0909, 0x1b1b0909, 0x1b1b0909, 0x1b1b0909, 0x1b1b0909, 0x1b1b0909,
- 0x1b1b0909, 0x1b1b0909, 0x1b1b0909, 0x1b1b0909, 0x1b1b0909, 0x1b1b0909, 0x1b1b0909, 0xe4e4f6f7,
- 0xe4e4f6f7, 0xe4e4f6f7, 0xe4e4f6f7, 0xe4e4f6f7, 0xe4e4f6f7, 0xe4e4f6f7, 0xe4e4f6f7, 0xe4e4f6f7,
- 0xe4e4f6f7, 0xe4e4f6f7, 0xe4e4f6f7, 0xe4e4f6f7, 0x09091b1b, 0x09091b1b, 0x09091b1b, 0x09091b1b,
- 0x09091b1b, 0x09091b1b, 0x09091b1b, 0x09091b1b, 0x09091b1b, 0x09091b1b, 0x09091b1b, 0x09091b1b,
- 0x09091b1b, 0xf6f6e4e5, 0xf6f6e4e5, 0xf6f6e4e5, 0xf6f6e4e5, 0xf6f6e4e5, 0xf6f6e4e5, 0xf6f6e4e5,
- 0xf6f6e4e5, 0xf6f6e4e5, 0xf6f6e4e5, 0xf6f6e4e5, 0xf6f6e4e5, 0xf6f6e4e5, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x02020202, 0xfdfdfdfe, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606,
- 0xf9f9f9fa, 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9, 0x0504fafb, 0xfafb0505, 0xfafb0505,
- 0x0504fafb, 0x0b0b0606, 0xf4f4f9fa, 0x06060b0b, 0xf9f9f4f5, 0x08080000, 0xf7f80000, 0x00000808,
- 0xfffff7f8, 0x0b0b0b0b, 0xf4f4f4f5, 0x0c0c0000, 0xf3f40000, 0x00000c0c, 0xfffff3f4, 0x11110c0c,
- 0xeeeef3f4, 0x0c0c1111, 0xf3f3eeef, 0x11111111, 0xeeeeeeef, 0x12120606, 0xededf9fa, 0x06061212,
- 0xf9f9edee, 0x0b0af7f8, 0xf4f50808, 0xf7f80b0b, 0x0807f4f5, 0x0f0f0000, 0xf0f10000, 0x00000f0f,
- 0xfffff0f1, 0x14140000, 0xebec0000, 0x00001414, 0xffffebec, 0x19191212, 0xe6e6edee, 0x12121919,
- 0xedede6e7, 0x19190b0b, 0xe6e6f4f5, 0x0b0b1919, 0xf4f4e6e7, 0x19191919, 0xe6e6e6e7, 0x0e0df1f2,
- 0xf1f20e0e, 0xf1f20e0e, 0x0e0df1f2, 0x1a1a0000, 0xe5e60000, 0x00001a1a, 0xffffe5e6, 0x1211f4f5,
- 0xedee0b0b, 0xf4f51212, 0x0b0aedee, 0x1615f8f9, 0xe9ea0707, 0xf8f91616, 0x0706e9ea, 0x22221a1a,
- 0xdddde5e6, 0x1a1a2222, 0xe5e5ddde, 0x22221212, 0xddddedee, 0x12122222, 0xededddde, 0x22222222,
- 0xddddddde, 0x23230b0b, 0xdcdcf4f5, 0x0b0b2323, 0xf4f4dcdd, 0x1d1d0000, 0xe2e30000, 0x00001d1d,
- 0xffffe2e3, 0x1615eced, 0xe9ea1313, 0xeced1616, 0x1312e9ea, 0x1a19f0f1, 0xe5e60f0f, 0xf0f11a1a,
- 0x0f0ee5e6, 0x25250000, 0xdadb0000, 0x00002525, 0xffffdadb, 0x2c2c1b1b, 0xd3d3e4e5, 0x1b1b2c2c,
- 0xe4e4d3d4, 0x2c2c2424, 0xd3d3dbdc, 0x24242c2c, 0xdbdbd3d4, 0x2c2c1212, 0xd3d3edee, 0x12122c2c,
- 0xededd3d4, 0x2120f5f6, 0xdedf0a0a, 0xf5f62121, 0x0a09dedf, 0x2d2d2d2d, 0xd2d2d2d3, 0x00000000,
- 0x00000000, 0x02020202, 0xfdfdfdfe, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606,
- 0xf9f9f9fa, 0x07070000, 0xf8f90000, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x03030000, 0xfcfd0000,
- 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x07070000, 0xf8f90000, 0x00000000, 0x02020202,
- 0xfdfdfdfe, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x07070000,
- 0xf8f90000, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd,
- 0x06060606, 0xf9f9f9fa, 0x07070000, 0xf8f90000, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x03030000,
- 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x07070000, 0xf8f90000, 0x00000000,
- 0x02020202, 0xfdfdfdfe, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa,
- 0x07070000, 0xf8f90000, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x03030000, 0xfcfd0000, 0x00000303,
- 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x07070000, 0xf8f90000, 0x00000000, 0x02020202, 0xfdfdfdfe,
- 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x07070000, 0xf8f90000,
- 0x00000000, 0x02020202, 0xfdfdfdfe, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606,
- 0xf9f9f9fa, 0x07070000, 0xf8f90000, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x03030000, 0xfcfd0000,
- 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x07070000, 0xf8f90000, 0x00000000, 0x02020202,
- 0xfdfdfdfe, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x07070000,
- 0xf8f90000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x02020202, 0xfdfdfdfe, 0x06060606,
- 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x0403fbfc, 0xfbfc0404, 0xf9fa0a0a,
- 0x0605f5f6, 0xf3f40000, 0x0c0c0000, 0xf3f3f9fa, 0xf3f40606, 0x0c0bf9fa, 0x0c0c0606, 0xfffff1f2,
- 0x00000e0e, 0x0c0c0c0c, 0xf3f3f3f4, 0xedee0000, 0x12120000, 0xf3f40e0e, 0x0c0bf1f2, 0xf9f9edee,
- 0xf9fa1212, 0x0605edee, 0x06061212, 0xededf5f6, 0xedee0a0a, 0x1211f5f6, 0x12120a0a, 0xffffe9ea,
- 0x00001616, 0xe7e80000, 0x18180000, 0xf3f3e9ea, 0xf3f41616, 0x0c0be9ea, 0x0c0c1616, 0xe7e7f7f8,
- 0xe7e80808, 0x1817f7f8, 0x18180808, 0xf9f9e5e6, 0xf9fa1a1a, 0x0605e5e6, 0x06061a1a, 0xffffe3e4,
- 0x00001c1c, 0x14141414, 0xebebebec, 0xe5e5f1f2, 0x1a1a0e0e, 0xf3f3e1e2, 0x0c0c1e1e, 0xdfdff5f6,
- 0x20200a0a, 0xdfdfedee, 0x20201212, 0xe5e5e5e6, 0x1a1a1a1a, 0xebebddde, 0x14142222, 0xf3f3d9da,
- 0x0c0c2626, 0xdfdfdfe0, 0x20202020, 0x20202020, 0xd7d7e9ea, 0xddddddde, 0x22222222, 0x00000000,
- 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa,
- 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202,
- 0xfffffdfe, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606,
- 0xfffff9fa, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x02020202, 0xfdfdfdfe,
- 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x00000000, 0x02020000,
- 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x06060000,
- 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe,
- 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa,
- 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x02020202, 0xfdfdfdfe, 0x06060606,
- 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x00000000, 0x02020000, 0xfdfe0000,
- 0x00000202, 0xfffffdfe, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000,
- 0x00000606, 0xfffff9fa, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x02020202,
- 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x00000000,
- 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa,
- 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202,
- 0xfffffdfe, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606,
- 0xfffff9fa, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x02020202, 0xfdfdfdfe,
- 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x00000000, 0x02020000,
- 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x06060000,
- 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe,
- 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x04040404, 0xfbfbfbfc, 0x0a0a0a0a,
- 0xf5f5f5f6, 0x0a0a0000, 0xf5f60000, 0x00000a0a, 0xfffff5f6, 0x0605f9fa, 0xf9fa0606, 0xf7f80e0e,
- 0x0807f1f2, 0xffffedee, 0x00001212, 0xeff00a0a, 0x100ff5f6, 0xe7e80000, 0x18180000, 0xf7f7e7e8,
- 0xf7f81818, 0x0807e7e8, 0x08081818, 0x12121212, 0xedededee, 0xeff01414, 0x100febec, 0xe5e5f1f2,
- 0xe5e60e0e, 0x1a19f1f2, 0x1a1a0e0e, 0xffffe1e2, 0x00001e1e, 0xddde0000, 0x22220000, 0xf7f7ddde,
- 0xf7f82222, 0x0807ddde, 0x08082222, 0xedede1e2, 0xedee1e1e, 0x1211e1e2, 0x12121e1e, 0xddddf5f6,
- 0xddde0a0a, 0x2221f5f6, 0x22220a0a, 0xddddebec, 0x22221414, 0xffffd7d8, 0x00002828, 0x1e1e1e1e,
- 0xe1e1e1e2, 0xededd7d8, 0x12122828, 0xd3d40000, 0x2c2c0000, 0xd3d3eff0, 0x2c2c1010, 0xdbdbdbdc,
- 0xdbdbdbdc, 0x24242424, 0xd3d3e5e6, 0x2c2c1a1a, 0xe5e5d1d2, 0x1a1a2e2e, 0xededcbcc, 0x12123434,
- 0xc9c9ebec, 0xd3d3d3d4, 0x2c2c2c2c, 0xc9c9dfe0, 0xd1d1d1d2, 0xd1d1d1d2, 0x2e2e2e2e, 0x00000000,
- 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x04040404, 0xfbfbfbfc, 0x0a0a0a0a, 0xf5f5f5f6,
- 0x0a0a0000, 0xf5f60000, 0x00000a0a, 0xfffff5f6, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202,
- 0xfffffdfe, 0x04040404, 0xfbfbfbfc, 0x0a0a0a0a, 0xf5f5f5f6, 0x0a0a0000, 0xf5f60000, 0x00000a0a,
- 0xfffff5f6, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x04040404, 0xfbfbfbfc,
- 0x0a0a0a0a, 0xf5f5f5f6, 0x0a0a0000, 0xf5f60000, 0x00000a0a, 0xfffff5f6, 0x00000000, 0x02020000,
- 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x04040404, 0xfbfbfbfc, 0x0a0a0a0a, 0xf5f5f5f6, 0x0a0a0000,
- 0xf5f60000, 0x00000a0a, 0xfffff5f6, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe,
- 0x04040404, 0xfbfbfbfc, 0x0a0a0a0a, 0xf5f5f5f6, 0x0a0a0000, 0xf5f60000, 0x00000a0a, 0xfffff5f6,
- 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x04040404, 0xfbfbfbfc, 0x0a0a0a0a,
- 0xf5f5f5f6, 0x0a0a0000, 0xf5f60000, 0x00000a0a, 0xfffff5f6, 0x00000000, 0x02020000, 0xfdfe0000,
- 0x00000202, 0xfffffdfe, 0x04040404, 0xfbfbfbfc, 0x0a0a0a0a, 0xf5f5f5f6, 0x0a0a0000, 0xf5f60000,
- 0x00000a0a, 0xfffff5f6, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x04040404,
- 0xfbfbfbfc, 0x0a0a0a0a, 0xf5f5f5f6, 0x0a0a0000, 0xf5f60000, 0x00000a0a, 0xfffff5f6, 0x00000000,
- 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x04040404, 0xfbfbfbfc, 0x0a0a0a0a, 0xf5f5f5f6,
- 0x0a0a0000, 0xf5f60000, 0x00000a0a, 0xfffff5f6, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202,
- 0xfffffdfe, 0x04040404, 0xfbfbfbfc, 0x0a0a0a0a, 0xf5f5f5f6, 0x0a0a0000, 0xf5f60000, 0x00000a0a,
- 0xfffff5f6, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x04040404, 0xfbfbfbfc,
- 0x0a0a0a0a, 0xf5f5f5f6, 0x0a0a0000, 0xf5f60000, 0x00000a0a, 0xfffff5f6, 0x00000000, 0x02020000,
- 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x04040404, 0xfbfbfbfc, 0x0a0a0a0a, 0xf5f5f5f6, 0x0a0a0000,
- 0xf5f60000, 0x00000a0a, 0xfffff5f6, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe,
- 0x04040404, 0xfbfbfbfc, 0x0a0a0a0a, 0xf5f5f5f6, 0x0a0a0000, 0xf5f60000, 0x00000a0a, 0xfffff5f6,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x04040404, 0xfbfbfbfc, 0x0c0c0c0c,
- 0xf3f3f3f4, 0x0c0c0000, 0xf3f40000, 0x00000c0c, 0xfffff3f4, 0x0807f7f8, 0xf7f80808, 0xeff00808,
- 0x100ff7f8, 0xe7e80000, 0x18180000, 0xf7f7e7e8, 0xf7f81818, 0x0807e7e8, 0x08081818, 0xeff01414,
- 0x100febec, 0xffffe3e4, 0x00001c1c, 0xe7e7eff0, 0xe7e81010, 0x1817eff0, 0x18181010, 0xdfe00000,
- 0x20200000, 0xefefe3e4, 0xeff01c1c, 0x100fe3e4, 0x10101c1c, 0xdfdff7f8, 0xdfe00808, 0xf7f7dfe0,
- 0xf7f82020, 0x0807dfe0, 0x08082020, 0x201ff7f8, 0x20200808, 0x18181818, 0xe7e7e7e8, 0xe7e81818,
- 0x1817e7e8, 0xdfdfebec, 0x20201414, 0xffffd7d8, 0x00002828, 0xefefd7d8, 0x10102828, 0xd3d40000,
- 0xd3d40000, 0xffffd3d4, 0x00002c2c, 0x2c2c0000, 0x2c2c0000, 0xdfdfdfe0, 0x20202020, 0xd3d3eff0,
- 0x2c2c1010, 0xd3d3e7e8, 0xe7e7d3d4, 0x18182c2c, 0x2c2c1818, 0xefefcfd0, 0x10103030, 0xdbdbdbdc,
- 0xdbdbdbdc, 0x24242424, 0x24242424, 0xcbcbebec, 0x28282828, 0xd7d7d7d8, 0xcbcbdfe0, 0x00000000,
- 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x04040404, 0xfbfbfbfc, 0x0c0c0c0c, 0xf3f3f3f4,
- 0x0c0c0000, 0xf3f40000, 0x00000c0c, 0xfffff3f4, 0x00000000, 0x04040000, 0xfbfc0000, 0x00000404,
- 0xfffffbfc, 0x04040404, 0xfbfbfbfc, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0000, 0xf3f40000, 0x00000c0c,
- 0xfffff3f4, 0x00000000, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x04040404, 0xfbfbfbfc,
- 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0000, 0xf3f40000, 0x00000c0c, 0xfffff3f4, 0x00000000, 0x04040000,
- 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x04040404, 0xfbfbfbfc, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0000,
- 0xf3f40000, 0x00000c0c, 0xfffff3f4, 0x00000000, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc,
- 0x04040404, 0xfbfbfbfc, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0000, 0xf3f40000, 0x00000c0c, 0xfffff3f4,
- 0x00000000, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x04040404, 0xfbfbfbfc, 0x0c0c0c0c,
- 0xf3f3f3f4, 0x0c0c0000, 0xf3f40000, 0x00000c0c, 0xfffff3f4, 0x00000000, 0x04040000, 0xfbfc0000,
- 0x00000404, 0xfffffbfc, 0x04040404, 0xfbfbfbfc, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0000, 0xf3f40000,
- 0x00000c0c, 0xfffff3f4, 0x00000000, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x04040404,
- 0xfbfbfbfc, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0000, 0xf3f40000, 0x00000c0c, 0xfffff3f4, 0x00000000,
- 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x04040404, 0xfbfbfbfc, 0x0c0c0c0c, 0xf3f3f3f4,
- 0x0c0c0000, 0xf3f40000, 0x00000c0c, 0xfffff3f4, 0x00000000, 0x04040000, 0xfbfc0000, 0x00000404,
- 0xfffffbfc, 0x04040404, 0xfbfbfbfc, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0000, 0xf3f40000, 0x00000c0c,
- 0xfffff3f4, 0x00000000, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x04040404, 0xfbfbfbfc,
- 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0000, 0xf3f40000, 0x00000c0c, 0xfffff3f4, 0x00000000, 0x04040000,
- 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x04040404, 0xfbfbfbfc, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0000,
- 0xf3f40000, 0x00000c0c, 0xfffff3f4, 0x00000000, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc,
- 0x04040404, 0xfbfbfbfc, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0000, 0xf3f40000, 0x00000c0c, 0xfffff3f4,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414,
- 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec,
- 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606,
- 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e,
- 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4,
- 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202,
- 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020,
- 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa,
- 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2,
- 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414,
- 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe,
- 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0,
- 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c,
- 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000,
- 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec,
- 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606,
- 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e,
- 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4,
- 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202,
- 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020,
- 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa,
- 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414,
- 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec,
- 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606,
- 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e,
- 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4,
- 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202,
- 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020,
- 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa,
- 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2,
- 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414,
- 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe,
- 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0,
- 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c,
- 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000,
- 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec,
- 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606,
- 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e,
- 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4,
- 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202,
- 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020,
- 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa,
- 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414,
- 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec,
- 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606,
- 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e,
- 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4,
- 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202,
- 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020,
- 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa,
- 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2,
- 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414,
- 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe,
- 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0,
- 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c,
- 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000,
- 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec,
- 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606,
- 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e,
- 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4,
- 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202,
- 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020,
- 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa,
- 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414,
- 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec,
- 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606,
- 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e,
- 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4,
- 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202,
- 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020,
- 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa,
- 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2,
- 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414,
- 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe,
- 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0,
- 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c,
- 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000,
- 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec,
- 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606,
- 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e,
- 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4,
- 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202,
- 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020,
- 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa,
- 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000
-};
-
-
-static const uint32_t correctionhighorder[] = {
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x0302feff, 0xfcfd0101,
- 0xfeff0303, 0x0100fcfd, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x0302feff, 0xfcfd0101, 0xfeff0303,
- 0x0100fcfd, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x0302feff, 0xfcfd0101, 0xfeff0303, 0x0100fcfd,
- 0x00000000, 0x02020202, 0xfdfdfdfe, 0x0302feff, 0xfcfd0101, 0xfeff0303, 0x0100fcfd, 0x00000000,
- 0x02020202, 0xfdfdfdfe, 0x0302feff, 0xfcfd0101, 0xfeff0303, 0x0100fcfd, 0x00000000, 0x02020202,
- 0xfdfdfdfe, 0x0302feff, 0xfcfd0101, 0xfeff0303, 0x0100fcfd, 0x00000000, 0x02020202, 0xfdfdfdfe,
- 0x0302feff, 0xfcfd0101, 0xfeff0303, 0x0100fcfd, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000,
- 0x03030303, 0xfcfcfcfd, 0x0403feff, 0xfbfc0101, 0xfeff0404, 0x0100fbfc, 0x07070707, 0xf8f8f8f9,
- 0x00000000, 0x03030303, 0xfcfcfcfd, 0x0403feff, 0xfbfc0101, 0xfeff0404, 0x0100fbfc, 0x07070707,
- 0xf8f8f8f9, 0x00000000, 0x03030303, 0xfcfcfcfd, 0x0403feff, 0xfbfc0101, 0xfeff0404, 0x0100fbfc,
- 0x07070707, 0xf8f8f8f9, 0x00000000, 0x03030303, 0xfcfcfcfd, 0x0403feff, 0xfbfc0101, 0xfeff0404,
- 0x0100fbfc, 0x07070707, 0xf8f8f8f9, 0x00000000, 0x03030303, 0xfcfcfcfd, 0x0403feff, 0xfbfc0101,
- 0xfeff0404, 0x0100fbfc, 0x07070707, 0xf8f8f8f9, 0x00000000, 0x03030303, 0xfcfcfcfd, 0x0403feff,
- 0xfbfc0101, 0xfeff0404, 0x0100fbfc, 0x07070707, 0xf8f8f8f9, 0x00000000, 0x03030303, 0xfcfcfcfd,
- 0x0403feff, 0xfbfc0101, 0xfeff0404, 0x0100fbfc, 0x07070707, 0xf8f8f8f9, 0x00000000, 0x03030303,
- 0xfcfcfcfd, 0x0403feff, 0xfbfc0101, 0xfeff0404, 0x0100fbfc, 0x07070707, 0xf8f8f8f9, 0x00000000,
- 0x03030303, 0xfcfcfcfd, 0x0403feff, 0xfbfc0101, 0xfeff0404, 0x0100fbfc, 0x07070707, 0xf8f8f8f9,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x04040404, 0xfbfbfbfc,
- 0x0504feff, 0xfafb0101, 0xfeff0505, 0x0100fafb, 0x0a0a0303, 0xf5f5fcfd, 0x03030a0a, 0x00000000,
- 0x04040404, 0xfbfbfbfc, 0x0504feff, 0xfafb0101, 0xfeff0505, 0x0100fafb, 0x0a0a0303, 0xf5f5fcfd,
- 0x03030a0a, 0x00000000, 0x04040404, 0xfbfbfbfc, 0x0504feff, 0xfafb0101, 0xfeff0505, 0x0100fafb,
- 0x0a0a0303, 0xf5f5fcfd, 0x03030a0a, 0x00000000, 0x04040404, 0xfbfbfbfc, 0x0504feff, 0xfafb0101,
- 0xfeff0505, 0x0100fafb, 0x0a0a0303, 0xf5f5fcfd, 0x03030a0a, 0x00000000, 0x04040404, 0xfbfbfbfc,
- 0x0504feff, 0xfafb0101, 0xfeff0505, 0x0100fafb, 0x0a0a0303, 0xf5f5fcfd, 0x03030a0a, 0x00000000,
- 0x04040404, 0xfbfbfbfc, 0x0504feff, 0xfafb0101, 0xfeff0505, 0x0100fafb, 0x0a0a0303, 0xf5f5fcfd,
- 0x03030a0a, 0x00000000, 0x04040404, 0xfbfbfbfc, 0x0504feff, 0xfafb0101, 0xfeff0505, 0x0100fafb,
- 0x0a0a0303, 0xf5f5fcfd, 0x03030a0a, 0x00000000, 0x04040404, 0xfbfbfbfc, 0x0504feff, 0xfafb0101,
- 0xfeff0505, 0x0100fafb, 0x0a0a0303, 0xf5f5fcfd, 0x03030a0a, 0x00000000, 0x04040404, 0xfbfbfbfc,
- 0x0504feff, 0xfafb0101, 0xfeff0505, 0x0100fafb, 0x0a0a0303, 0xf5f5fcfd, 0x03030a0a, 0x00000000,
- 0x04040404, 0xfbfbfbfc, 0x0504feff, 0xfafb0101, 0xfeff0505, 0x0100fafb, 0x0a0a0303, 0xf5f5fcfd,
- 0x03030a0a, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x05050505, 0xfafafafb, 0x0706fdfe, 0xf8f90202,
- 0xfdfe0707, 0x0201f8f9, 0x0b0b0b0b, 0xf4f4f4f5, 0x0d0d0303, 0xf2f2fcfd, 0x00000000, 0x05050505,
- 0xfafafafb, 0x0706fdfe, 0xf8f90202, 0xfdfe0707, 0x0201f8f9, 0x0b0b0b0b, 0xf4f4f4f5, 0x0d0d0303,
- 0xf2f2fcfd, 0x00000000, 0x05050505, 0xfafafafb, 0x0706fdfe, 0xf8f90202, 0xfdfe0707, 0x0201f8f9,
- 0x0b0b0b0b, 0xf4f4f4f5, 0x0d0d0303, 0xf2f2fcfd, 0x00000000, 0x05050505, 0xfafafafb, 0x0706fdfe,
- 0xf8f90202, 0xfdfe0707, 0x0201f8f9, 0x0b0b0b0b, 0xf4f4f4f5, 0x0d0d0303, 0xf2f2fcfd, 0x00000000,
- 0x05050505, 0xfafafafb, 0x0706fdfe, 0xf8f90202, 0xfdfe0707, 0x0201f8f9, 0x0b0b0b0b, 0xf4f4f4f5,
- 0x0d0d0303, 0xf2f2fcfd, 0x00000000, 0x05050505, 0xfafafafb, 0x0706fdfe, 0xf8f90202, 0xfdfe0707,
- 0x0201f8f9, 0x0b0b0b0b, 0xf4f4f4f5, 0x0d0d0303, 0xf2f2fcfd, 0x00000000, 0x05050505, 0xfafafafb,
- 0x0706fdfe, 0xf8f90202, 0xfdfe0707, 0x0201f8f9, 0x0b0b0b0b, 0xf4f4f4f5, 0x0d0d0303, 0xf2f2fcfd,
- 0x00000000, 0x05050505, 0xfafafafb, 0x0706fdfe, 0xf8f90202, 0xfdfe0707, 0x0201f8f9, 0x0b0b0b0b,
- 0xf4f4f4f5, 0x0d0d0303, 0xf2f2fcfd, 0x00000000, 0x05050505, 0xfafafafb, 0x0706fdfe, 0xf8f90202,
- 0xfdfe0707, 0x0201f8f9, 0x0b0b0b0b, 0xf4f4f4f5, 0x0d0d0303, 0xf2f2fcfd, 0x00000000, 0x05050505,
- 0xfafafafb, 0x0706fdfe, 0xf8f90202, 0xfdfe0707, 0x0201f8f9, 0x0b0b0b0b, 0xf4f4f4f5, 0x0d0d0303,
- 0xf2f2fcfd, 0x00000000, 0x05050505, 0xfafafafb, 0x0706fdfe, 0xf8f90202, 0xfdfe0707, 0x0201f8f9,
- 0x0b0b0b0b, 0xf4f4f4f5, 0x0d0d0303, 0xf2f2fcfd, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x06060606, 0xf9f9f9fa,
- 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8, 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc,
- 0x04040f0f, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8,
- 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc, 0x04040f0f, 0x00000000, 0x06060606, 0xf9f9f9fa,
- 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8, 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc,
- 0x04040f0f, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8,
- 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc, 0x04040f0f, 0x00000000, 0x06060606, 0xf9f9f9fa,
- 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8, 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc,
- 0x04040f0f, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8,
- 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc, 0x04040f0f, 0x00000000, 0x06060606, 0xf9f9f9fa,
- 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8, 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc,
- 0x04040f0f, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8,
- 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc, 0x04040f0f, 0x00000000, 0x06060606, 0xf9f9f9fa,
- 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8, 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc,
- 0x04040f0f, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8,
- 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc, 0x04040f0f, 0x00000000, 0x06060606, 0xf9f9f9fa,
- 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8, 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc,
- 0x04040f0f, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8,
- 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc, 0x04040f0f, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x07070707, 0xf8f8f8f9,
- 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6, 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb,
- 0x05051212, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6,
- 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb, 0x05051212, 0x00000000, 0x07070707, 0xf8f8f8f9,
- 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6, 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb,
- 0x05051212, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6,
- 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb, 0x05051212, 0x00000000, 0x07070707, 0xf8f8f8f9,
- 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6, 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb,
- 0x05051212, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6,
- 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb, 0x05051212, 0x00000000, 0x07070707, 0xf8f8f8f9,
- 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6, 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb,
- 0x05051212, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6,
- 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb, 0x05051212, 0x00000000, 0x07070707, 0xf8f8f8f9,
- 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6, 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb,
- 0x05051212, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6,
- 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb, 0x05051212, 0x00000000, 0x07070707, 0xf8f8f8f9,
- 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6, 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb,
- 0x05051212, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6,
- 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb, 0x05051212, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000,
- 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303, 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee,
- 0x14140505, 0xebebfafb, 0x05051414, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303,
- 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee, 0x14140505, 0xebebfafb, 0x05051414, 0x00000000,
- 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303, 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee,
- 0x14140505, 0xebebfafb, 0x05051414, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303,
- 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee, 0x14140505, 0xebebfafb, 0x05051414, 0x00000000,
- 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303, 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee,
- 0x14140505, 0xebebfafb, 0x05051414, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303,
- 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee, 0x14140505, 0xebebfafb, 0x05051414, 0x00000000,
- 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303, 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee,
- 0x14140505, 0xebebfafb, 0x05051414, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303,
- 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee, 0x14140505, 0xebebfafb, 0x05051414, 0x00000000,
- 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303, 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee,
- 0x14140505, 0xebebfafb, 0x05051414, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303,
- 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee, 0x14140505, 0xebebfafb, 0x05051414, 0x00000000,
- 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303, 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee,
- 0x14140505, 0xebebfafb, 0x05051414, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303,
- 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee, 0x14140505, 0xebebfafb, 0x05051414, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x09090909, 0xf6f6f6f7,
- 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4, 0x14141414, 0xebebebec, 0x17170606, 0xe8e8f9fa,
- 0x06061717, 0xf9f9e8e9, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c,
- 0x0302f3f4, 0x14141414, 0xebebebec, 0x17170606, 0xe8e8f9fa, 0x06061717, 0xf9f9e8e9, 0x00000000,
- 0x09090909, 0xf6f6f6f7, 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4, 0x14141414, 0xebebebec,
- 0x17170606, 0xe8e8f9fa, 0x06061717, 0xf9f9e8e9, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x0c0bfcfd,
- 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4, 0x14141414, 0xebebebec, 0x17170606, 0xe8e8f9fa, 0x06061717,
- 0xf9f9e8e9, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4,
- 0x14141414, 0xebebebec, 0x17170606, 0xe8e8f9fa, 0x06061717, 0xf9f9e8e9, 0x00000000, 0x09090909,
- 0xf6f6f6f7, 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4, 0x14141414, 0xebebebec, 0x17170606,
- 0xe8e8f9fa, 0x06061717, 0xf9f9e8e9, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x0c0bfcfd, 0xf3f40303,
- 0xfcfd0c0c, 0x0302f3f4, 0x14141414, 0xebebebec, 0x17170606, 0xe8e8f9fa, 0x06061717, 0xf9f9e8e9,
- 0x00000000, 0x09090909, 0xf6f6f6f7, 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4, 0x14141414,
- 0xebebebec, 0x17170606, 0xe8e8f9fa, 0x06061717, 0xf9f9e8e9, 0x00000000, 0x09090909, 0xf6f6f6f7,
- 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4, 0x14141414, 0xebebebec, 0x17170606, 0xe8e8f9fa,
- 0x06061717, 0xf9f9e8e9, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c,
- 0x0302f3f4, 0x14141414, 0xebebebec, 0x17170606, 0xe8e8f9fa, 0x06061717, 0xf9f9e8e9, 0x00000000,
- 0x09090909, 0xf6f6f6f7, 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4, 0x14141414, 0xebebebec,
- 0x17170606, 0xe8e8f9fa, 0x06061717, 0xf9f9e8e9, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x0c0bfcfd,
- 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4, 0x14141414, 0xebebebec, 0x17170606, 0xe8e8f9fa, 0x06061717,
- 0xf9f9e8e9, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4,
- 0x14141414, 0xebebebec, 0x17170606, 0xe8e8f9fa, 0x06061717, 0xf9f9e8e9, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x02020000, 0xfdfe0000,
- 0x00000202, 0xfffffdfe, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x02020000, 0xfdfe0000, 0x00000202,
- 0xfffffdfe, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe,
- 0x00000000, 0x02020202, 0xfdfdfdfe, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x00000000,
- 0x02020202, 0xfdfdfdfe, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x00000000, 0x02020202,
- 0xfdfdfdfe, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x00000000, 0x02020202, 0xfdfdfdfe,
- 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000,
- 0x03030303, 0xfcfcfcfd, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa,
- 0x00000000, 0x03030303, 0xfcfcfcfd, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606,
- 0xf9f9f9fa, 0x00000000, 0x03030303, 0xfcfcfcfd, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd,
- 0x06060606, 0xf9f9f9fa, 0x00000000, 0x03030303, 0xfcfcfcfd, 0x03030000, 0xfcfd0000, 0x00000303,
- 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x00000000, 0x03030303, 0xfcfcfcfd, 0x03030000, 0xfcfd0000,
- 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x00000000, 0x03030303, 0xfcfcfcfd, 0x03030000,
- 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x00000000, 0x03030303, 0xfcfcfcfd,
- 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x00000000, 0x03030303,
- 0xfcfcfcfd, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x00000000,
- 0x03030303, 0xfcfcfcfd, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x04040404, 0xfbfbfbfc,
- 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x08080404, 0xf7f7fbfc, 0x04040808, 0x00000000,
- 0x04040404, 0xfbfbfbfc, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x08080404, 0xf7f7fbfc,
- 0x04040808, 0x00000000, 0x04040404, 0xfbfbfbfc, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc,
- 0x08080404, 0xf7f7fbfc, 0x04040808, 0x00000000, 0x04040404, 0xfbfbfbfc, 0x04040000, 0xfbfc0000,
- 0x00000404, 0xfffffbfc, 0x08080404, 0xf7f7fbfc, 0x04040808, 0x00000000, 0x04040404, 0xfbfbfbfc,
- 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x08080404, 0xf7f7fbfc, 0x04040808, 0x00000000,
- 0x04040404, 0xfbfbfbfc, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x08080404, 0xf7f7fbfc,
- 0x04040808, 0x00000000, 0x04040404, 0xfbfbfbfc, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc,
- 0x08080404, 0xf7f7fbfc, 0x04040808, 0x00000000, 0x04040404, 0xfbfbfbfc, 0x04040000, 0xfbfc0000,
- 0x00000404, 0xfffffbfc, 0x08080404, 0xf7f7fbfc, 0x04040808, 0x00000000, 0x04040404, 0xfbfbfbfc,
- 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x08080404, 0xf7f7fbfc, 0x04040808, 0x00000000,
- 0x04040404, 0xfbfbfbfc, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x08080404, 0xf7f7fbfc,
- 0x04040808, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x05050505, 0xfafafafb, 0x05050000, 0xfafb0000,
- 0x00000505, 0xfffffafb, 0x0a0a0a0a, 0xf5f5f5f6, 0x0f0f0505, 0xf0f0fafb, 0x00000000, 0x05050505,
- 0xfafafafb, 0x05050000, 0xfafb0000, 0x00000505, 0xfffffafb, 0x0a0a0a0a, 0xf5f5f5f6, 0x0f0f0505,
- 0xf0f0fafb, 0x00000000, 0x05050505, 0xfafafafb, 0x05050000, 0xfafb0000, 0x00000505, 0xfffffafb,
- 0x0a0a0a0a, 0xf5f5f5f6, 0x0f0f0505, 0xf0f0fafb, 0x00000000, 0x05050505, 0xfafafafb, 0x05050000,
- 0xfafb0000, 0x00000505, 0xfffffafb, 0x0a0a0a0a, 0xf5f5f5f6, 0x0f0f0505, 0xf0f0fafb, 0x00000000,
- 0x05050505, 0xfafafafb, 0x05050000, 0xfafb0000, 0x00000505, 0xfffffafb, 0x0a0a0a0a, 0xf5f5f5f6,
- 0x0f0f0505, 0xf0f0fafb, 0x00000000, 0x05050505, 0xfafafafb, 0x05050000, 0xfafb0000, 0x00000505,
- 0xfffffafb, 0x0a0a0a0a, 0xf5f5f5f6, 0x0f0f0505, 0xf0f0fafb, 0x00000000, 0x05050505, 0xfafafafb,
- 0x05050000, 0xfafb0000, 0x00000505, 0xfffffafb, 0x0a0a0a0a, 0xf5f5f5f6, 0x0f0f0505, 0xf0f0fafb,
- 0x00000000, 0x05050505, 0xfafafafb, 0x05050000, 0xfafb0000, 0x00000505, 0xfffffafb, 0x0a0a0a0a,
- 0xf5f5f5f6, 0x0f0f0505, 0xf0f0fafb, 0x00000000, 0x05050505, 0xfafafafb, 0x05050000, 0xfafb0000,
- 0x00000505, 0xfffffafb, 0x0a0a0a0a, 0xf5f5f5f6, 0x0f0f0505, 0xf0f0fafb, 0x00000000, 0x05050505,
- 0xfafafafb, 0x05050000, 0xfafb0000, 0x00000505, 0xfffffafb, 0x0a0a0a0a, 0xf5f5f5f6, 0x0f0f0505,
- 0xf0f0fafb, 0x00000000, 0x05050505, 0xfafafafb, 0x05050000, 0xfafb0000, 0x00000505, 0xfffffafb,
- 0x0a0a0a0a, 0xf5f5f5f6, 0x0f0f0505, 0xf0f0fafb, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x06060606, 0xf9f9f9fa,
- 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa,
- 0x06060c0c, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa,
- 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa, 0x06060c0c, 0x00000000, 0x06060606, 0xf9f9f9fa,
- 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa,
- 0x06060c0c, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa,
- 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa, 0x06060c0c, 0x00000000, 0x06060606, 0xf9f9f9fa,
- 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa,
- 0x06060c0c, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa,
- 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa, 0x06060c0c, 0x00000000, 0x06060606, 0xf9f9f9fa,
- 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa,
- 0x06060c0c, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa,
- 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa, 0x06060c0c, 0x00000000, 0x06060606, 0xf9f9f9fa,
- 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa,
- 0x06060c0c, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa,
- 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa, 0x06060c0c, 0x00000000, 0x06060606, 0xf9f9f9fa,
- 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa,
- 0x06060c0c, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa,
- 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa, 0x06060c0c, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x07070707, 0xf8f8f8f9,
- 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9, 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9,
- 0x07071515, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9,
- 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9, 0x07071515, 0x00000000, 0x07070707, 0xf8f8f8f9,
- 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9, 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9,
- 0x07071515, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9,
- 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9, 0x07071515, 0x00000000, 0x07070707, 0xf8f8f8f9,
- 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9, 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9,
- 0x07071515, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9,
- 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9, 0x07071515, 0x00000000, 0x07070707, 0xf8f8f8f9,
- 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9, 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9,
- 0x07071515, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9,
- 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9, 0x07071515, 0x00000000, 0x07070707, 0xf8f8f8f9,
- 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9, 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9,
- 0x07071515, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9,
- 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9, 0x07071515, 0x00000000, 0x07070707, 0xf8f8f8f9,
- 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9, 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9,
- 0x07071515, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9,
- 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9, 0x07071515, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000,
- 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000, 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0,
- 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000,
- 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0, 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000,
- 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000, 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0,
- 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000,
- 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0, 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000,
- 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000, 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0,
- 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000,
- 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0, 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000,
- 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000, 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0,
- 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000,
- 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0, 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000,
- 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000, 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0,
- 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000,
- 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0, 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000,
- 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000, 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0,
- 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000,
- 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0, 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x09090909, 0xf6f6f6f7,
- 0x09090000, 0xf6f70000, 0x00000909, 0xfffff6f7, 0x12121212, 0xedededee, 0x1b1b0909, 0xe4e4f6f7,
- 0x09091b1b, 0xf6f6e4e5, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x09090000, 0xf6f70000, 0x00000909,
- 0xfffff6f7, 0x12121212, 0xedededee, 0x1b1b0909, 0xe4e4f6f7, 0x09091b1b, 0xf6f6e4e5, 0x00000000,
- 0x09090909, 0xf6f6f6f7, 0x09090000, 0xf6f70000, 0x00000909, 0xfffff6f7, 0x12121212, 0xedededee,
- 0x1b1b0909, 0xe4e4f6f7, 0x09091b1b, 0xf6f6e4e5, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x09090000,
- 0xf6f70000, 0x00000909, 0xfffff6f7, 0x12121212, 0xedededee, 0x1b1b0909, 0xe4e4f6f7, 0x09091b1b,
- 0xf6f6e4e5, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x09090000, 0xf6f70000, 0x00000909, 0xfffff6f7,
- 0x12121212, 0xedededee, 0x1b1b0909, 0xe4e4f6f7, 0x09091b1b, 0xf6f6e4e5, 0x00000000, 0x09090909,
- 0xf6f6f6f7, 0x09090000, 0xf6f70000, 0x00000909, 0xfffff6f7, 0x12121212, 0xedededee, 0x1b1b0909,
- 0xe4e4f6f7, 0x09091b1b, 0xf6f6e4e5, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x09090000, 0xf6f70000,
- 0x00000909, 0xfffff6f7, 0x12121212, 0xedededee, 0x1b1b0909, 0xe4e4f6f7, 0x09091b1b, 0xf6f6e4e5,
- 0x00000000, 0x09090909, 0xf6f6f6f7, 0x09090000, 0xf6f70000, 0x00000909, 0xfffff6f7, 0x12121212,
- 0xedededee, 0x1b1b0909, 0xe4e4f6f7, 0x09091b1b, 0xf6f6e4e5, 0x00000000, 0x09090909, 0xf6f6f6f7,
- 0x09090000, 0xf6f70000, 0x00000909, 0xfffff6f7, 0x12121212, 0xedededee, 0x1b1b0909, 0xe4e4f6f7,
- 0x09091b1b, 0xf6f6e4e5, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x09090000, 0xf6f70000, 0x00000909,
- 0xfffff6f7, 0x12121212, 0xedededee, 0x1b1b0909, 0xe4e4f6f7, 0x09091b1b, 0xf6f6e4e5, 0x00000000,
- 0x09090909, 0xf6f6f6f7, 0x09090000, 0xf6f70000, 0x00000909, 0xfffff6f7, 0x12121212, 0xedededee,
- 0x1b1b0909, 0xe4e4f6f7, 0x09091b1b, 0xf6f6e4e5, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x09090000,
- 0xf6f70000, 0x00000909, 0xfffff6f7, 0x12121212, 0xedededee, 0x1b1b0909, 0xe4e4f6f7, 0x09091b1b,
- 0xf6f6e4e5, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x09090000, 0xf6f70000, 0x00000909, 0xfffff6f7,
- 0x12121212, 0xedededee, 0x1b1b0909, 0xe4e4f6f7, 0x09091b1b, 0xf6f6e4e5, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
- 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0xfdfdfdfe, 0xfdfdfdfe,
- 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe,
- 0xfdfdfdfe, 0x03030000, 0x03030000, 0x03030000, 0x03030000, 0x03030000, 0x03030000, 0x03030000,
- 0x03030000, 0x03030000, 0x03030000, 0x03030000, 0xfcfd0000, 0xfcfd0000, 0xfcfd0000, 0xfcfd0000,
- 0xfcfd0000, 0xfcfd0000, 0xfcfd0000, 0xfcfd0000, 0xfcfd0000, 0xfcfd0000, 0xfcfd0000, 0x00000303,
- 0x00000303, 0x00000303, 0x00000303, 0x00000303, 0x00000303, 0x00000303, 0x00000303, 0x00000303,
- 0x00000303, 0x00000303, 0xfffffcfd, 0xfffffcfd, 0xfffffcfd, 0xfffffcfd, 0xfffffcfd, 0xfffffcfd,
- 0xfffffcfd, 0xfffffcfd, 0xfffffcfd, 0xfffffcfd, 0xfffffcfd, 0x06060606, 0x06060606, 0x06060606,
- 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606,
- 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
- 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0x07070000, 0x07070000, 0x07070000, 0x07070000, 0x07070000,
- 0x07070000, 0x07070000, 0x07070000, 0x07070000, 0x07070000, 0x07070000, 0xf8f90000, 0xf8f90000,
- 0xf8f90000, 0xf8f90000, 0xf8f90000, 0xf8f90000, 0xf8f90000, 0xf8f90000, 0xf8f90000, 0xf8f90000,
- 0xf8f90000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02020000, 0x02020000, 0x02020000, 0x02020000,
- 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0x02020000,
- 0x02020000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000,
- 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0x00000202, 0x00000202,
- 0x00000202, 0x00000202, 0x00000202, 0x00000202, 0x00000202, 0x00000202, 0x00000202, 0x00000202,
- 0x00000202, 0x00000202, 0x00000202, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe,
- 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe,
- 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
- 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe,
- 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe,
- 0xfdfdfdfe, 0xfdfdfdfe, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606,
- 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0xf9f9f9fa,
- 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
- 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0x06060000, 0x06060000, 0x06060000, 0x06060000,
- 0x06060000, 0x06060000, 0x06060000, 0x06060000, 0x06060000, 0x06060000, 0x06060000, 0x06060000,
- 0x06060000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000,
- 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0x00000606, 0x00000606,
- 0x00000606, 0x00000606, 0x00000606, 0x00000606, 0x00000606, 0x00000606, 0x00000606, 0x00000606,
- 0x00000606, 0x00000606, 0x00000606, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa,
- 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02020000, 0x02020000, 0x02020000, 0x02020000,
- 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0x02020000,
- 0x02020000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000,
- 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0x00000202, 0x00000202,
- 0x00000202, 0x00000202, 0x00000202, 0x00000202, 0x00000202, 0x00000202, 0x00000202, 0x00000202,
- 0x00000202, 0x00000202, 0x00000202, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe,
- 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe,
- 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404,
- 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc,
- 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc,
- 0xfbfbfbfc, 0xfbfbfbfc, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a,
- 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0xf5f5f5f6,
- 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6,
- 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0x0a0a0000, 0x0a0a0000, 0x0a0a0000, 0x0a0a0000,
- 0x0a0a0000, 0x0a0a0000, 0x0a0a0000, 0x0a0a0000, 0x0a0a0000, 0x0a0a0000, 0x0a0a0000, 0x0a0a0000,
- 0x0a0a0000, 0xf5f60000, 0xf5f60000, 0xf5f60000, 0xf5f60000, 0xf5f60000, 0xf5f60000, 0xf5f60000,
- 0xf5f60000, 0xf5f60000, 0xf5f60000, 0xf5f60000, 0xf5f60000, 0xf5f60000, 0x00000a0a, 0x00000a0a,
- 0x00000a0a, 0x00000a0a, 0x00000a0a, 0x00000a0a, 0x00000a0a, 0x00000a0a, 0x00000a0a, 0x00000a0a,
- 0x00000a0a, 0x00000a0a, 0x00000a0a, 0xfffff5f6, 0xfffff5f6, 0xfffff5f6, 0xfffff5f6, 0xfffff5f6,
- 0xfffff5f6, 0xfffff5f6, 0xfffff5f6, 0xfffff5f6, 0xfffff5f6, 0xfffff5f6, 0xfffff5f6, 0xfffff5f6,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x04040000, 0x04040000, 0x04040000, 0x04040000,
- 0x04040000, 0x04040000, 0x04040000, 0x04040000, 0x04040000, 0x04040000, 0x04040000, 0x04040000,
- 0x04040000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000,
- 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0x00000404, 0x00000404,
- 0x00000404, 0x00000404, 0x00000404, 0x00000404, 0x00000404, 0x00000404, 0x00000404, 0x00000404,
- 0x00000404, 0x00000404, 0x00000404, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc,
- 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc,
- 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404,
- 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc,
- 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc,
- 0xfbfbfbfc, 0xfbfbfbfc, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c,
- 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0xf3f3f3f4,
- 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4,
- 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0x0c0c0000, 0x0c0c0000, 0x0c0c0000, 0x0c0c0000,
- 0x0c0c0000, 0x0c0c0000, 0x0c0c0000, 0x0c0c0000, 0x0c0c0000, 0x0c0c0000, 0x0c0c0000, 0x0c0c0000,
- 0x0c0c0000, 0xf3f40000, 0xf3f40000, 0xf3f40000, 0xf3f40000, 0xf3f40000, 0xf3f40000, 0xf3f40000,
- 0xf3f40000, 0xf3f40000, 0xf3f40000, 0xf3f40000, 0xf3f40000, 0xf3f40000, 0x00000c0c, 0x00000c0c,
- 0x00000c0c, 0x00000c0c, 0x00000c0c, 0x00000c0c, 0x00000c0c, 0x00000c0c, 0x00000c0c, 0x00000c0c,
- 0x00000c0c, 0x00000c0c, 0x00000c0c, 0xfffff3f4, 0xfffff3f4, 0xfffff3f4, 0xfffff3f4, 0xfffff3f4,
- 0xfffff3f4, 0xfffff3f4, 0xfffff3f4, 0xfffff3f4, 0xfffff3f4, 0xfffff3f4, 0xfffff3f4, 0xfffff3f4,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
- 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
- 0x02020202, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe,
- 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0x06060606, 0x06060606,
- 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606,
- 0x06060606, 0x06060606, 0x06060606, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
- 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
- 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c,
- 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4,
- 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4,
- 0xf3f3f3f4, 0xf3f3f3f4, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414,
- 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0xebebebec,
- 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec,
- 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0x20202020, 0x20202020, 0x20202020, 0x20202020,
- 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020,
- 0x20202020, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0,
- 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0x2e2e2e2e, 0x2e2e2e2e,
- 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e,
- 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2,
- 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
- 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
- 0x02020202, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe,
- 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0x06060606, 0x06060606,
- 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606,
- 0x06060606, 0x06060606, 0x06060606, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
- 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
- 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c,
- 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4,
- 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4,
- 0xf3f3f3f4, 0xf3f3f3f4, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414,
- 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0xebebebec,
- 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec,
- 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0x20202020, 0x20202020, 0x20202020, 0x20202020,
- 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020,
- 0x20202020, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0,
- 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0x2e2e2e2e, 0x2e2e2e2e,
- 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e,
- 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2,
- 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
- 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
- 0x02020202, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe,
- 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0x06060606, 0x06060606,
- 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606,
- 0x06060606, 0x06060606, 0x06060606, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
- 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
- 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c,
- 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4,
- 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4,
- 0xf3f3f3f4, 0xf3f3f3f4, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414,
- 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0xebebebec,
- 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec,
- 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0x20202020, 0x20202020, 0x20202020, 0x20202020,
- 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020,
- 0x20202020, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0,
- 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0x2e2e2e2e, 0x2e2e2e2e,
- 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e,
- 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2,
- 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
- 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
- 0x02020202, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe,
- 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0x06060606, 0x06060606,
- 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606,
- 0x06060606, 0x06060606, 0x06060606, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
- 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
- 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c,
- 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4,
- 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4,
- 0xf3f3f3f4, 0xf3f3f3f4, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414,
- 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0xebebebec,
- 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec,
- 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0x20202020, 0x20202020, 0x20202020, 0x20202020,
- 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020,
- 0x20202020, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0,
- 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0x2e2e2e2e, 0x2e2e2e2e,
- 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e,
- 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2,
- 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000
-};
diff --git a/src/libffmpeg/libavcodec/interplayvideo.c b/src/libffmpeg/libavcodec/interplayvideo.c
deleted file mode 100644
index 95059c365..000000000
--- a/src/libffmpeg/libavcodec/interplayvideo.c
+++ /dev/null
@@ -1,964 +0,0 @@
-/*
- * Interplay MVE Video Decoder
- * Copyright (C) 2003 the ffmpeg project
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file interplayvideo.c
- * Interplay MVE Video Decoder by Mike Melanson (melanson@pcisys.net)
- * For more information about the Interplay MVE format, visit:
- * http://www.pcisys.net/~melanson/codecs/interplay-mve.txt
- * This code is written in such a way that the identifiers match up
- * with the encoding descriptions in the document.
- *
- * This decoder presently only supports a PAL8 output colorspace.
- *
- * An Interplay video frame consists of 2 parts: The decoding map and
- * the video data. A demuxer must load these 2 parts together in a single
- * buffer before sending it through the stream to this decoder.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "common.h"
-#include "avcodec.h"
-#include "dsputil.h"
-
-#define PALETTE_COUNT 256
-
-/* debugging support */
-#define DEBUG_INTERPLAY 0
-#if DEBUG_INTERPLAY
-#define debug_interplay(x,...) av_log(NULL, AV_LOG_DEBUG, x, __VA_ARGS__)
-#else
-static inline void debug_interplay(const char *format, ...) { }
-#endif
-
-typedef struct IpvideoContext {
-
- AVCodecContext *avctx;
- DSPContext dsp;
- AVFrame second_last_frame;
- AVFrame last_frame;
- AVFrame current_frame;
- unsigned char *decoding_map;
- int decoding_map_size;
-
- unsigned char *buf;
- int size;
-
- unsigned char *stream_ptr;
- unsigned char *stream_end;
- unsigned char *pixel_ptr;
- int line_inc;
- int stride;
- int upper_motion_limit_offset;
-
-} IpvideoContext;
-
-#define CHECK_STREAM_PTR(n) \
- if ((s->stream_ptr + n) > s->stream_end) { \
- av_log(s->avctx, AV_LOG_ERROR, "Interplay video warning: stream_ptr out of bounds (%p >= %p)\n", \
- s->stream_ptr + n, s->stream_end); \
- return -1; \
- }
-
-#define COPY_FROM_CURRENT() \
- motion_offset = current_offset; \
- motion_offset += y * s->stride; \
- motion_offset += x; \
- if (motion_offset < 0) { \
- av_log(s->avctx, AV_LOG_ERROR, " Interplay video: motion offset < 0 (%d)\n", motion_offset); \
- return -1; \
- } else if (motion_offset > s->upper_motion_limit_offset) { \
- av_log(s->avctx, AV_LOG_ERROR, " Interplay video: motion offset above limit (%d >= %d)\n", \
- motion_offset, s->upper_motion_limit_offset); \
- return -1; \
- } \
- s->dsp.put_pixels_tab[0][0](s->pixel_ptr, \
- s->current_frame.data[0] + motion_offset, s->stride, 8);
-
-#define COPY_FROM_PREVIOUS() \
- motion_offset = current_offset; \
- motion_offset += y * s->stride; \
- motion_offset += x; \
- if (motion_offset < 0) { \
- av_log(s->avctx, AV_LOG_ERROR, " Interplay video: motion offset < 0 (%d)\n", motion_offset); \
- return -1; \
- } else if (motion_offset > s->upper_motion_limit_offset) { \
- av_log(s->avctx, AV_LOG_ERROR, " Interplay video: motion offset above limit (%d >= %d)\n", \
- motion_offset, s->upper_motion_limit_offset); \
- return -1; \
- } \
- s->dsp.put_pixels_tab[0][0](s->pixel_ptr, \
- s->last_frame.data[0] + motion_offset, s->stride, 8);
-
-#define COPY_FROM_SECOND_LAST() \
- motion_offset = current_offset; \
- motion_offset += y * s->stride; \
- motion_offset += x; \
- if (motion_offset < 0) { \
- av_log(s->avctx, AV_LOG_ERROR, " Interplay video: motion offset < 0 (%d)\n", motion_offset); \
- return -1; \
- } else if (motion_offset > s->upper_motion_limit_offset) { \
- av_log(s->avctx, AV_LOG_ERROR, " Interplay video: motion offset above limit (%d >= %d)\n", \
- motion_offset, s->upper_motion_limit_offset); \
- return -1; \
- } \
- s->dsp.put_pixels_tab[0][0](s->pixel_ptr, \
- s->second_last_frame.data[0] + motion_offset, s->stride, 8);
-
-static int ipvideo_decode_block_opcode_0x0(IpvideoContext *s)
-{
- int x, y;
- int motion_offset;
- int current_offset = s->pixel_ptr - s->current_frame.data[0];
-
- /* copy a block from the previous frame */
- x = y = 0;
- COPY_FROM_PREVIOUS();
-
- /* report success */
- return 0;
-}
-
-static int ipvideo_decode_block_opcode_0x1(IpvideoContext *s)
-{
- int x, y;
- int motion_offset;
- int current_offset = s->pixel_ptr - s->current_frame.data[0];
-
- /* copy block from 2 frames ago */
- x = y = 0;
- COPY_FROM_SECOND_LAST();
-
- /* report success */
- return 0;
-}
-
-static int ipvideo_decode_block_opcode_0x2(IpvideoContext *s)
-{
- unsigned char B;
- int x, y;
- int motion_offset;
- int current_offset = s->pixel_ptr - s->current_frame.data[0];
-
- /* copy block from 2 frames ago using a motion vector; need 1 more byte */
- CHECK_STREAM_PTR(1);
- B = *s->stream_ptr++;
-
- if (B < 56) {
- x = 8 + (B % 7);
- y = B / 7;
- } else {
- x = -14 + ((B - 56) % 29);
- y = 8 + ((B - 56) / 29);
- }
-
- debug_interplay (" motion byte = %d, (x, y) = (%d, %d)\n", B, x, y);
- COPY_FROM_SECOND_LAST();
-
- /* report success */
- return 0;
-}
-
-static int ipvideo_decode_block_opcode_0x3(IpvideoContext *s)
-{
- unsigned char B;
- int x, y;
- int motion_offset;
- int current_offset = s->pixel_ptr - s->current_frame.data[0];
-
- /* copy 8x8 block from current frame from an up/left block */
-
- /* need 1 more byte for motion */
- CHECK_STREAM_PTR(1);
- B = *s->stream_ptr++;
-
- if (B < 56) {
- x = -(8 + (B % 7));
- y = -(B / 7);
- } else {
- x = -(-14 + ((B - 56) % 29));
- y = -( 8 + ((B - 56) / 29));
- }
-
- debug_interplay (" motion byte = %d, (x, y) = (%d, %d)\n", B, x, y);
- COPY_FROM_CURRENT();
-
- /* report success */
- return 0;
-}
-
-static int ipvideo_decode_block_opcode_0x4(IpvideoContext *s)
-{
- int x, y;
- unsigned char B, BL, BH;
- int motion_offset;
- int current_offset = s->pixel_ptr - s->current_frame.data[0];
-
- /* copy a block from the previous frame; need 1 more byte */
- CHECK_STREAM_PTR(1);
-
- B = *s->stream_ptr++;
- BL = B & 0x0F;
- BH = (B >> 4) & 0x0F;
- x = -8 + BL;
- y = -8 + BH;
-
- debug_interplay (" motion byte = %d, (x, y) = (%d, %d)\n", B, x, y);
- COPY_FROM_PREVIOUS();
-
- /* report success */
- return 0;
-}
-
-static int ipvideo_decode_block_opcode_0x5(IpvideoContext *s)
-{
- signed char x, y;
- int motion_offset;
- int current_offset = s->pixel_ptr - s->current_frame.data[0];
-
- /* copy a block from the previous frame using an expanded range;
- * need 2 more bytes */
- CHECK_STREAM_PTR(2);
-
- x = *s->stream_ptr++;
- y = *s->stream_ptr++;
-
- debug_interplay (" motion bytes = %d, %d\n", x, y);
- COPY_FROM_PREVIOUS();
-
- /* report success */
- return 0;
-}
-
-static int ipvideo_decode_block_opcode_0x6(IpvideoContext *s)
-{
- /* mystery opcode? skip multiple blocks? */
- av_log(s->avctx, AV_LOG_ERROR, " Interplay video: Help! Mystery opcode 0x6 seen\n");
-
- /* report success */
- return 0;
-}
-
-static int ipvideo_decode_block_opcode_0x7(IpvideoContext *s)
-{
- int x, y;
- unsigned char P0, P1;
- unsigned char B[8];
- unsigned int flags;
- int bitmask;
-
- /* 2-color encoding */
- CHECK_STREAM_PTR(2);
-
- P0 = *s->stream_ptr++;
- P1 = *s->stream_ptr++;
-
- if (P0 <= P1) {
-
- /* need 8 more bytes from the stream */
- CHECK_STREAM_PTR(8);
- for (y = 0; y < 8; y++)
- B[y] = *s->stream_ptr++;
-
- for (y = 0; y < 8; y++) {
- flags = B[y];
- for (x = 0x01; x <= 0x80; x <<= 1) {
- if (flags & x)
- *s->pixel_ptr++ = P1;
- else
- *s->pixel_ptr++ = P0;
- }
- s->pixel_ptr += s->line_inc;
- }
-
- } else {
-
- /* need 2 more bytes from the stream */
- CHECK_STREAM_PTR(2);
- B[0] = *s->stream_ptr++;
- B[1] = *s->stream_ptr++;
-
- flags = (B[1] << 8) | B[0];
- bitmask = 0x0001;
- for (y = 0; y < 8; y += 2) {
- for (x = 0; x < 8; x += 2, bitmask <<= 1) {
- if (flags & bitmask) {
- *(s->pixel_ptr + x) = P1;
- *(s->pixel_ptr + x + 1) = P1;
- *(s->pixel_ptr + s->stride + x) = P1;
- *(s->pixel_ptr + s->stride + x + 1) = P1;
- } else {
- *(s->pixel_ptr + x) = P0;
- *(s->pixel_ptr + x + 1) = P0;
- *(s->pixel_ptr + s->stride + x) = P0;
- *(s->pixel_ptr + s->stride + x + 1) = P0;
- }
- }
- s->pixel_ptr += s->stride * 2;
- }
- }
-
- /* report success */
- return 0;
-}
-
-static int ipvideo_decode_block_opcode_0x8(IpvideoContext *s)
-{
- int x, y;
- unsigned char P[8];
- unsigned char B[8];
- unsigned int flags = 0;
- unsigned int bitmask = 0;
- unsigned char P0 = 0, P1 = 0;
- int lower_half = 0;
-
- /* 2-color encoding for each 4x4 quadrant, or 2-color encoding on
- * either top and bottom or left and right halves */
- CHECK_STREAM_PTR(2);
-
- P[0] = *s->stream_ptr++;
- P[1] = *s->stream_ptr++;
-
- if (P[0] <= P[1]) {
-
- /* need 12 more bytes */
- CHECK_STREAM_PTR(12);
- B[0] = *s->stream_ptr++; B[1] = *s->stream_ptr++;
- P[2] = *s->stream_ptr++; P[3] = *s->stream_ptr++;
- B[2] = *s->stream_ptr++; B[3] = *s->stream_ptr++;
- P[4] = *s->stream_ptr++; P[5] = *s->stream_ptr++;
- B[4] = *s->stream_ptr++; B[5] = *s->stream_ptr++;
- P[6] = *s->stream_ptr++; P[7] = *s->stream_ptr++;
- B[6] = *s->stream_ptr++; B[7] = *s->stream_ptr++;
-
- for (y = 0; y < 8; y++) {
-
- /* time to reload flags? */
- if (y == 0) {
- flags =
- ((B[0] & 0xF0) << 4) | ((B[4] & 0xF0) << 8) |
- ((B[0] & 0x0F) ) | ((B[4] & 0x0F) << 4) |
- ((B[1] & 0xF0) << 20) | ((B[5] & 0xF0) << 24) |
- ((B[1] & 0x0F) << 16) | ((B[5] & 0x0F) << 20);
- bitmask = 0x00000001;
- lower_half = 0; /* still on top half */
- } else if (y == 4) {
- flags =
- ((B[2] & 0xF0) << 4) | ((B[6] & 0xF0) << 8) |
- ((B[2] & 0x0F) ) | ((B[6] & 0x0F) << 4) |
- ((B[3] & 0xF0) << 20) | ((B[7] & 0xF0) << 24) |
- ((B[3] & 0x0F) << 16) | ((B[7] & 0x0F) << 20);
- bitmask = 0x00000001;
- lower_half = 2;
- }
-
- for (x = 0; x < 8; x++, bitmask <<= 1) {
- /* get the pixel values ready for this quadrant */
- if (x == 0) {
- P0 = P[lower_half + 0];
- P1 = P[lower_half + 1];
- } else if (x == 4) {
- P0 = P[lower_half + 4];
- P1 = P[lower_half + 5];
- }
-
- if (flags & bitmask)
- *s->pixel_ptr++ = P1;
- else
- *s->pixel_ptr++ = P0;
- }
- s->pixel_ptr += s->line_inc;
- }
-
- } else {
-
- /* need 10 more bytes */
- CHECK_STREAM_PTR(10);
- B[0] = *s->stream_ptr++; B[1] = *s->stream_ptr++;
- B[2] = *s->stream_ptr++; B[3] = *s->stream_ptr++;
- P[2] = *s->stream_ptr++; P[3] = *s->stream_ptr++;
- B[4] = *s->stream_ptr++; B[5] = *s->stream_ptr++;
- B[6] = *s->stream_ptr++; B[7] = *s->stream_ptr++;
-
- if (P[2] <= P[3]) {
-
- /* vertical split; left & right halves are 2-color encoded */
-
- for (y = 0; y < 8; y++) {
-
- /* time to reload flags? */
- if (y == 0) {
- flags =
- ((B[0] & 0xF0) << 4) | ((B[4] & 0xF0) << 8) |
- ((B[0] & 0x0F) ) | ((B[4] & 0x0F) << 4) |
- ((B[1] & 0xF0) << 20) | ((B[5] & 0xF0) << 24) |
- ((B[1] & 0x0F) << 16) | ((B[5] & 0x0F) << 20);
- bitmask = 0x00000001;
- } else if (y == 4) {
- flags =
- ((B[2] & 0xF0) << 4) | ((B[6] & 0xF0) << 8) |
- ((B[2] & 0x0F) ) | ((B[6] & 0x0F) << 4) |
- ((B[3] & 0xF0) << 20) | ((B[7] & 0xF0) << 24) |
- ((B[3] & 0x0F) << 16) | ((B[7] & 0x0F) << 20);
- bitmask = 0x00000001;
- }
-
- for (x = 0; x < 8; x++, bitmask <<= 1) {
- /* get the pixel values ready for this half */
- if (x == 0) {
- P0 = P[0];
- P1 = P[1];
- } else if (x == 4) {
- P0 = P[2];
- P1 = P[3];
- }
-
- if (flags & bitmask)
- *s->pixel_ptr++ = P1;
- else
- *s->pixel_ptr++ = P0;
- }
- s->pixel_ptr += s->line_inc;
- }
-
- } else {
-
- /* horizontal split; top & bottom halves are 2-color encoded */
-
- for (y = 0; y < 8; y++) {
-
- flags = B[y];
- if (y == 0) {
- P0 = P[0];
- P1 = P[1];
- } else if (y == 4) {
- P0 = P[2];
- P1 = P[3];
- }
-
- for (bitmask = 0x01; bitmask <= 0x80; bitmask <<= 1) {
-
- if (flags & bitmask)
- *s->pixel_ptr++ = P1;
- else
- *s->pixel_ptr++ = P0;
- }
- s->pixel_ptr += s->line_inc;
- }
- }
- }
-
- /* report success */
- return 0;
-}
-
-static int ipvideo_decode_block_opcode_0x9(IpvideoContext *s)
-{
- int x, y;
- unsigned char P[4];
- unsigned char B[4];
- unsigned int flags = 0;
- int shifter = 0;
- unsigned char pix;
-
- /* 4-color encoding */
- CHECK_STREAM_PTR(4);
-
- for (y = 0; y < 4; y++)
- P[y] = *s->stream_ptr++;
-
- if ((P[0] <= P[1]) && (P[2] <= P[3])) {
-
- /* 1 of 4 colors for each pixel, need 16 more bytes */
- CHECK_STREAM_PTR(16);
-
- for (y = 0; y < 8; y++) {
- /* get the next set of 8 2-bit flags */
- flags = (s->stream_ptr[1] << 8) | s->stream_ptr[0];
- s->stream_ptr += 2;
- for (x = 0, shifter = 0; x < 8; x++, shifter += 2) {
- *s->pixel_ptr++ = P[(flags >> shifter) & 0x03];
- }
- s->pixel_ptr += s->line_inc;
- }
-
- } else if ((P[0] <= P[1]) && (P[2] > P[3])) {
-
- /* 1 of 4 colors for each 2x2 block, need 4 more bytes */
- CHECK_STREAM_PTR(4);
-
- B[0] = *s->stream_ptr++;
- B[1] = *s->stream_ptr++;
- B[2] = *s->stream_ptr++;
- B[3] = *s->stream_ptr++;
- flags = (B[3] << 24) | (B[2] << 16) | (B[1] << 8) | B[0];
- shifter = 0;
-
- for (y = 0; y < 8; y += 2) {
- for (x = 0; x < 8; x += 2, shifter += 2) {
- pix = P[(flags >> shifter) & 0x03];
- *(s->pixel_ptr + x) = pix;
- *(s->pixel_ptr + x + 1) = pix;
- *(s->pixel_ptr + s->stride + x) = pix;
- *(s->pixel_ptr + s->stride + x + 1) = pix;
- }
- s->pixel_ptr += s->stride * 2;
- }
-
- } else if ((P[0] > P[1]) && (P[2] <= P[3])) {
-
- /* 1 of 4 colors for each 2x1 block, need 8 more bytes */
- CHECK_STREAM_PTR(8);
-
- for (y = 0; y < 8; y++) {
- /* time to reload flags? */
- if ((y == 0) || (y == 4)) {
- B[0] = *s->stream_ptr++;
- B[1] = *s->stream_ptr++;
- B[2] = *s->stream_ptr++;
- B[3] = *s->stream_ptr++;
- flags = (B[3] << 24) | (B[2] << 16) | (B[1] << 8) | B[0];
- shifter = 0;
- }
- for (x = 0; x < 8; x += 2, shifter += 2) {
- pix = P[(flags >> shifter) & 0x03];
- *(s->pixel_ptr + x) = pix;
- *(s->pixel_ptr + x + 1) = pix;
- }
- s->pixel_ptr += s->stride;
- }
-
- } else {
-
- /* 1 of 4 colors for each 1x2 block, need 8 more bytes */
- CHECK_STREAM_PTR(8);
-
- for (y = 0; y < 8; y += 2) {
- /* time to reload flags? */
- if ((y == 0) || (y == 4)) {
- B[0] = *s->stream_ptr++;
- B[1] = *s->stream_ptr++;
- B[2] = *s->stream_ptr++;
- B[3] = *s->stream_ptr++;
- flags = (B[3] << 24) | (B[2] << 16) | (B[1] << 8) | B[0];
- shifter = 0;
- }
- for (x = 0; x < 8; x++, shifter += 2) {
- pix = P[(flags >> shifter) & 0x03];
- *(s->pixel_ptr + x) = pix;
- *(s->pixel_ptr + s->stride + x) = pix;
- }
- s->pixel_ptr += s->stride * 2;
- }
- }
-
- /* report success */
- return 0;
-}
-
-static int ipvideo_decode_block_opcode_0xA(IpvideoContext *s)
-{
- int x, y;
- unsigned char P[16];
- unsigned char B[16];
- int flags = 0;
- int shifter = 0;
- int index;
- int split;
- int lower_half;
-
- /* 4-color encoding for each 4x4 quadrant, or 4-color encoding on
- * either top and bottom or left and right halves */
- CHECK_STREAM_PTR(4);
-
- for (y = 0; y < 4; y++)
- P[y] = *s->stream_ptr++;
-
- if (P[0] <= P[1]) {
-
- /* 4-color encoding for each quadrant; need 28 more bytes */
- CHECK_STREAM_PTR(28);
-
- for (y = 0; y < 4; y++)
- B[y] = *s->stream_ptr++;
- for (y = 4; y < 16; y += 4) {
- for (x = y; x < y + 4; x++)
- P[x] = *s->stream_ptr++;
- for (x = y; x < y + 4; x++)
- B[x] = *s->stream_ptr++;
- }
-
- for (y = 0; y < 8; y++) {
-
- lower_half = (y >= 4) ? 4 : 0;
- flags = (B[y + 8] << 8) | B[y];
-
- for (x = 0, shifter = 0; x < 8; x++, shifter += 2) {
- split = (x >= 4) ? 8 : 0;
- index = split + lower_half + ((flags >> shifter) & 0x03);
- *s->pixel_ptr++ = P[index];
- }
-
- s->pixel_ptr += s->line_inc;
- }
-
- } else {
-
- /* 4-color encoding for either left and right or top and bottom
- * halves; need 20 more bytes */
- CHECK_STREAM_PTR(20);
-
- for (y = 0; y < 8; y++)
- B[y] = *s->stream_ptr++;
- for (y = 4; y < 8; y++)
- P[y] = *s->stream_ptr++;
- for (y = 8; y < 16; y++)
- B[y] = *s->stream_ptr++;
-
- if (P[4] <= P[5]) {
-
- /* block is divided into left and right halves */
- for (y = 0; y < 8; y++) {
-
- flags = (B[y + 8] << 8) | B[y];
- split = 0;
-
- for (x = 0, shifter = 0; x < 8; x++, shifter += 2) {
- if (x == 4)
- split = 4;
- *s->pixel_ptr++ = P[split + ((flags >> shifter) & 0x03)];
- }
-
- s->pixel_ptr += s->line_inc;
- }
-
- } else {
-
- /* block is divided into top and bottom halves */
- split = 0;
- for (y = 0; y < 8; y++) {
-
- flags = (B[y * 2 + 1] << 8) | B[y * 2];
- if (y == 4)
- split = 4;
-
- for (x = 0, shifter = 0; x < 8; x++, shifter += 2)
- *s->pixel_ptr++ = P[split + ((flags >> shifter) & 0x03)];
-
- s->pixel_ptr += s->line_inc;
- }
- }
- }
-
- /* report success */
- return 0;
-}
-
-static int ipvideo_decode_block_opcode_0xB(IpvideoContext *s)
-{
- int x, y;
-
- /* 64-color encoding (each pixel in block is a different color) */
- CHECK_STREAM_PTR(64);
-
- for (y = 0; y < 8; y++) {
- for (x = 0; x < 8; x++) {
- *s->pixel_ptr++ = *s->stream_ptr++;
- }
- s->pixel_ptr += s->line_inc;
- }
-
- /* report success */
- return 0;
-}
-
-static int ipvideo_decode_block_opcode_0xC(IpvideoContext *s)
-{
- int x, y;
- unsigned char pix;
-
- /* 16-color block encoding: each 2x2 block is a different color */
- CHECK_STREAM_PTR(16);
-
- for (y = 0; y < 8; y += 2) {
- for (x = 0; x < 8; x += 2) {
- pix = *s->stream_ptr++;
- *(s->pixel_ptr + x) = pix;
- *(s->pixel_ptr + x + 1) = pix;
- *(s->pixel_ptr + s->stride + x) = pix;
- *(s->pixel_ptr + s->stride + x + 1) = pix;
- }
- s->pixel_ptr += s->stride * 2;
- }
-
- /* report success */
- return 0;
-}
-
-static int ipvideo_decode_block_opcode_0xD(IpvideoContext *s)
-{
- int x, y;
- unsigned char P[4];
- unsigned char index = 0;
-
- /* 4-color block encoding: each 4x4 block is a different color */
- CHECK_STREAM_PTR(4);
-
- for (y = 0; y < 4; y++)
- P[y] = *s->stream_ptr++;
-
- for (y = 0; y < 8; y++) {
- if (y < 4)
- index = 0;
- else
- index = 2;
-
- for (x = 0; x < 8; x++) {
- if (x == 4)
- index++;
- *s->pixel_ptr++ = P[index];
- }
- s->pixel_ptr += s->line_inc;
- }
-
- /* report success */
- return 0;
-}
-
-static int ipvideo_decode_block_opcode_0xE(IpvideoContext *s)
-{
- int x, y;
- unsigned char pix;
-
- /* 1-color encoding: the whole block is 1 solid color */
- CHECK_STREAM_PTR(1);
- pix = *s->stream_ptr++;
-
- for (y = 0; y < 8; y++) {
- for (x = 0; x < 8; x++) {
- *s->pixel_ptr++ = pix;
- }
- s->pixel_ptr += s->line_inc;
- }
-
- /* report success */
- return 0;
-}
-
-static int ipvideo_decode_block_opcode_0xF(IpvideoContext *s)
-{
- int x, y;
- unsigned char sample0, sample1;
-
- /* dithered encoding */
- CHECK_STREAM_PTR(2);
- sample0 = *s->stream_ptr++;
- sample1 = *s->stream_ptr++;
-
- for (y = 0; y < 8; y++) {
- for (x = 0; x < 8; x += 2) {
- if (y & 1) {
- *s->pixel_ptr++ = sample1;
- *s->pixel_ptr++ = sample0;
- } else {
- *s->pixel_ptr++ = sample0;
- *s->pixel_ptr++ = sample1;
- }
- }
- s->pixel_ptr += s->line_inc;
- }
-
- /* report success */
- return 0;
-}
-
-static int (*ipvideo_decode_block[16])(IpvideoContext *s);
-
-static void ipvideo_decode_opcodes(IpvideoContext *s)
-{
- int x, y;
- int index = 0;
- unsigned char opcode;
- int ret;
- int code_counts[16];
- static int frame = 0;
-
- debug_interplay("------------------ frame %d\n", frame);
- frame++;
-
- for (x = 0; x < 16; x++)
- code_counts[x] = 0;
-
- /* this is PAL8, so make the palette available */
- memcpy(s->current_frame.data[1], s->avctx->palctrl->palette, PALETTE_COUNT * 4);
-
- s->stride = s->current_frame.linesize[0];
- s->stream_ptr = s->buf + 14; /* data starts 14 bytes in */
- s->stream_end = s->buf + s->size;
- s->line_inc = s->stride - 8;
- s->upper_motion_limit_offset = (s->avctx->height - 8) * s->stride
- + s->avctx->width - 8;
- s->dsp = s->dsp;
-
- for (y = 0; y < (s->stride * s->avctx->height); y += s->stride * 8) {
- for (x = y; x < y + s->avctx->width; x += 8) {
- /* bottom nibble first, then top nibble (which makes it
- * hard to use a GetBitcontext) */
- if (index & 1)
- opcode = s->decoding_map[index >> 1] >> 4;
- else
- opcode = s->decoding_map[index >> 1] & 0xF;
- index++;
-
- debug_interplay(" block @ (%3d, %3d): encoding 0x%X, data ptr @ %p\n",
- x - y, y / s->stride, opcode, s->stream_ptr);
- code_counts[opcode]++;
-
- s->pixel_ptr = s->current_frame.data[0] + x;
- ret = ipvideo_decode_block[opcode](s);
- if (ret != 0) {
- av_log(s->avctx, AV_LOG_ERROR, " Interplay video: decode problem on frame %d, @ block (%d, %d)\n",
- frame, x - y, y / s->stride);
- return;
- }
- }
- }
- if ((s->stream_ptr != s->stream_end) &&
- (s->stream_ptr + 1 != s->stream_end)) {
- av_log(s->avctx, AV_LOG_ERROR, " Interplay video: decode finished with %td bytes left over\n",
- s->stream_end - s->stream_ptr);
- }
-}
-
-static int ipvideo_decode_init(AVCodecContext *avctx)
-{
- IpvideoContext *s = avctx->priv_data;
-
- s->avctx = avctx;
-
- if (s->avctx->palctrl == NULL) {
- av_log(avctx, AV_LOG_ERROR, " Interplay video: palette expected.\n");
- return -1;
- }
-
- avctx->pix_fmt = PIX_FMT_PAL8;
- avctx->has_b_frames = 0;
- dsputil_init(&s->dsp, avctx);
-
- /* decoding map contains 4 bits of information per 8x8 block */
- s->decoding_map_size = avctx->width * avctx->height / (8 * 8 * 2);
-
- /* assign block decode functions */
- ipvideo_decode_block[0x0] = ipvideo_decode_block_opcode_0x0;
- ipvideo_decode_block[0x1] = ipvideo_decode_block_opcode_0x1;
- ipvideo_decode_block[0x2] = ipvideo_decode_block_opcode_0x2;
- ipvideo_decode_block[0x3] = ipvideo_decode_block_opcode_0x3;
- ipvideo_decode_block[0x4] = ipvideo_decode_block_opcode_0x4;
- ipvideo_decode_block[0x5] = ipvideo_decode_block_opcode_0x5;
- ipvideo_decode_block[0x6] = ipvideo_decode_block_opcode_0x6;
- ipvideo_decode_block[0x7] = ipvideo_decode_block_opcode_0x7;
- ipvideo_decode_block[0x8] = ipvideo_decode_block_opcode_0x8;
- ipvideo_decode_block[0x9] = ipvideo_decode_block_opcode_0x9;
- ipvideo_decode_block[0xA] = ipvideo_decode_block_opcode_0xA;
- ipvideo_decode_block[0xB] = ipvideo_decode_block_opcode_0xB;
- ipvideo_decode_block[0xC] = ipvideo_decode_block_opcode_0xC;
- ipvideo_decode_block[0xD] = ipvideo_decode_block_opcode_0xD;
- ipvideo_decode_block[0xE] = ipvideo_decode_block_opcode_0xE;
- ipvideo_decode_block[0xF] = ipvideo_decode_block_opcode_0xF;
-
- s->current_frame.data[0] = s->last_frame.data[0] =
- s->second_last_frame.data[0] = NULL;
-
- return 0;
-}
-
-static int ipvideo_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- IpvideoContext *s = avctx->priv_data;
- AVPaletteControl *palette_control = avctx->palctrl;
-
- /* compressed buffer needs to be large enough to at least hold an entire
- * decoding map */
- if (buf_size < s->decoding_map_size)
- return buf_size;
-
- s->decoding_map = buf;
- s->buf = buf + s->decoding_map_size;
- s->size = buf_size - s->decoding_map_size;
-
- s->current_frame.reference = 3;
- if (avctx->get_buffer(avctx, &s->current_frame)) {
- av_log(avctx, AV_LOG_ERROR, " Interplay Video: get_buffer() failed\n");
- return -1;
- }
-
- ipvideo_decode_opcodes(s);
-
- if (palette_control->palette_changed) {
- palette_control->palette_changed = 0;
- s->current_frame.palette_has_changed = 1;
- }
-
- *data_size = sizeof(AVFrame);
- *(AVFrame*)data = s->current_frame;
-
- /* shuffle frames */
- if (s->second_last_frame.data[0])
- avctx->release_buffer(avctx, &s->second_last_frame);
- s->second_last_frame = s->last_frame;
- s->last_frame = s->current_frame;
- s->current_frame.data[0] = NULL; /* catch any access attempts */
-
- /* report that the buffer was completely consumed */
- return buf_size;
-}
-
-static int ipvideo_decode_end(AVCodecContext *avctx)
-{
- IpvideoContext *s = avctx->priv_data;
-
- /* release the last frame */
- if (s->last_frame.data[0])
- avctx->release_buffer(avctx, &s->last_frame);
- if (s->second_last_frame.data[0])
- avctx->release_buffer(avctx, &s->second_last_frame);
-
- return 0;
-}
-
-AVCodec interplay_video_decoder = {
- "interplayvideo",
- CODEC_TYPE_VIDEO,
- CODEC_ID_INTERPLAY_VIDEO,
- sizeof(IpvideoContext),
- ipvideo_decode_init,
- NULL,
- ipvideo_decode_end,
- ipvideo_decode_frame,
- CODEC_CAP_DR1,
-};
diff --git a/src/libffmpeg/libavcodec/jfdctfst.c b/src/libffmpeg/libavcodec/jfdctfst.c
deleted file mode 100644
index a9dcfab82..000000000
--- a/src/libffmpeg/libavcodec/jfdctfst.c
+++ /dev/null
@@ -1,338 +0,0 @@
-/*
- * jfdctfst.c
- *
- * This file is part of the Independent JPEG Group's software.
- *
- * The authors make NO WARRANTY or representation, either express or implied,
- * with respect to this software, its quality, accuracy, merchantability, or
- * fitness for a particular purpose. This software is provided "AS IS", and
- * you, its user, assume the entire risk as to its quality and accuracy.
- *
- * This software is copyright (C) 1994-1996, Thomas G. Lane.
- * All Rights Reserved except as specified below.
- *
- * Permission is hereby granted to use, copy, modify, and distribute this
- * software (or portions thereof) for any purpose, without fee, subject to
- * these conditions:
- * (1) If any part of the source code for this software is distributed, then
- * this README file must be included, with this copyright and no-warranty
- * notice unaltered; and any additions, deletions, or changes to the original
- * files must be clearly indicated in accompanying documentation.
- * (2) If only executable code is distributed, then the accompanying
- * documentation must state that "this software is based in part on the work
- * of the Independent JPEG Group".
- * (3) Permission for use of this software is granted only if the user accepts
- * full responsibility for any undesirable consequences; the authors accept
- * NO LIABILITY for damages of any kind.
- *
- * These conditions apply to any software derived from or based on the IJG
- * code, not just to the unmodified library. If you use our work, you ought
- * to acknowledge us.
- *
- * Permission is NOT granted for the use of any IJG author's name or company
- * name in advertising or publicity relating to this software or products
- * derived from it. This software may be referred to only as "the Independent
- * JPEG Group's software".
- *
- * We specifically permit and encourage the use of this software as the basis
- * of commercial products, provided that all warranty or liability claims are
- * assumed by the product vendor.
- *
- * This file contains a fast, not so accurate integer implementation of the
- * forward DCT (Discrete Cosine Transform).
- *
- * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT
- * on each column. Direct algorithms are also available, but they are
- * much more complex and seem not to be any faster when reduced to code.
- *
- * This implementation is based on Arai, Agui, and Nakajima's algorithm for
- * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in
- * Japanese, but the algorithm is described in the Pennebaker & Mitchell
- * JPEG textbook (see REFERENCES section in file README). The following code
- * is based directly on figure 4-8 in P&M.
- * While an 8-point DCT cannot be done in less than 11 multiplies, it is
- * possible to arrange the computation so that many of the multiplies are
- * simple scalings of the final outputs. These multiplies can then be
- * folded into the multiplications or divisions by the JPEG quantization
- * table entries. The AA&N method leaves only 5 multiplies and 29 adds
- * to be done in the DCT itself.
- * The primary disadvantage of this method is that with fixed-point math,
- * accuracy is lost due to imprecise representation of the scaled
- * quantization values. The smaller the quantization table entry, the less
- * precise the scaled value, so this implementation does worse with high-
- * quality-setting files than with low-quality ones.
- */
-
-/**
- * @file jfdctfst.c
- * Independent JPEG Group's fast AAN dct.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include "common.h"
-#include "dsputil.h"
-
-#define DCTSIZE 8
-#define GLOBAL(x) x
-#define RIGHT_SHIFT(x, n) ((x) >> (n))
-#define SHIFT_TEMPS
-
-/*
- * This module is specialized to the case DCTSIZE = 8.
- */
-
-#if DCTSIZE != 8
- Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
-#endif
-
-
-/* Scaling decisions are generally the same as in the LL&M algorithm;
- * see jfdctint.c for more details. However, we choose to descale
- * (right shift) multiplication products as soon as they are formed,
- * rather than carrying additional fractional bits into subsequent additions.
- * This compromises accuracy slightly, but it lets us save a few shifts.
- * More importantly, 16-bit arithmetic is then adequate (for 8-bit samples)
- * everywhere except in the multiplications proper; this saves a good deal
- * of work on 16-bit-int machines.
- *
- * Again to save a few shifts, the intermediate results between pass 1 and
- * pass 2 are not upscaled, but are represented only to integral precision.
- *
- * A final compromise is to represent the multiplicative constants to only
- * 8 fractional bits, rather than 13. This saves some shifting work on some
- * machines, and may also reduce the cost of multiplication (since there
- * are fewer one-bits in the constants).
- */
-
-#define CONST_BITS 8
-
-
-/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus
- * causing a lot of useless floating-point operations at run time.
- * To get around this we use the following pre-calculated constants.
- * If you change CONST_BITS you may want to add appropriate values.
- * (With a reasonable C compiler, you can just rely on the FIX() macro...)
- */
-
-#if CONST_BITS == 8
-#define FIX_0_382683433 ((int32_t) 98) /* FIX(0.382683433) */
-#define FIX_0_541196100 ((int32_t) 139) /* FIX(0.541196100) */
-#define FIX_0_707106781 ((int32_t) 181) /* FIX(0.707106781) */
-#define FIX_1_306562965 ((int32_t) 334) /* FIX(1.306562965) */
-#else
-#define FIX_0_382683433 FIX(0.382683433)
-#define FIX_0_541196100 FIX(0.541196100)
-#define FIX_0_707106781 FIX(0.707106781)
-#define FIX_1_306562965 FIX(1.306562965)
-#endif
-
-
-/* We can gain a little more speed, with a further compromise in accuracy,
- * by omitting the addition in a descaling shift. This yields an incorrectly
- * rounded result half the time...
- */
-
-#ifndef USE_ACCURATE_ROUNDING
-#undef DESCALE
-#define DESCALE(x,n) RIGHT_SHIFT(x, n)
-#endif
-
-
-/* Multiply a DCTELEM variable by an int32_t constant, and immediately
- * descale to yield a DCTELEM result.
- */
-
-#define MULTIPLY(var,const) ((DCTELEM) DESCALE((var) * (const), CONST_BITS))
-
-static av_always_inline void row_fdct(DCTELEM * data){
- int_fast16_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
- int_fast16_t tmp10, tmp11, tmp12, tmp13;
- int_fast16_t z1, z2, z3, z4, z5, z11, z13;
- DCTELEM *dataptr;
- int ctr;
- SHIFT_TEMPS
-
- /* Pass 1: process rows. */
-
- dataptr = data;
- for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
- tmp0 = dataptr[0] + dataptr[7];
- tmp7 = dataptr[0] - dataptr[7];
- tmp1 = dataptr[1] + dataptr[6];
- tmp6 = dataptr[1] - dataptr[6];
- tmp2 = dataptr[2] + dataptr[5];
- tmp5 = dataptr[2] - dataptr[5];
- tmp3 = dataptr[3] + dataptr[4];
- tmp4 = dataptr[3] - dataptr[4];
-
- /* Even part */
-
- tmp10 = tmp0 + tmp3; /* phase 2 */
- tmp13 = tmp0 - tmp3;
- tmp11 = tmp1 + tmp2;
- tmp12 = tmp1 - tmp2;
-
- dataptr[0] = tmp10 + tmp11; /* phase 3 */
- dataptr[4] = tmp10 - tmp11;
-
- z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */
- dataptr[2] = tmp13 + z1; /* phase 5 */
- dataptr[6] = tmp13 - z1;
-
- /* Odd part */
-
- tmp10 = tmp4 + tmp5; /* phase 2 */
- tmp11 = tmp5 + tmp6;
- tmp12 = tmp6 + tmp7;
-
- /* The rotator is modified from fig 4-8 to avoid extra negations. */
- z5 = MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */
- z2 = MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */
- z4 = MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */
- z3 = MULTIPLY(tmp11, FIX_0_707106781); /* c4 */
-
- z11 = tmp7 + z3; /* phase 5 */
- z13 = tmp7 - z3;
-
- dataptr[5] = z13 + z2; /* phase 6 */
- dataptr[3] = z13 - z2;
- dataptr[1] = z11 + z4;
- dataptr[7] = z11 - z4;
-
- dataptr += DCTSIZE; /* advance pointer to next row */
- }
-}
-
-/*
- * Perform the forward DCT on one block of samples.
- */
-
-GLOBAL(void)
-fdct_ifast (DCTELEM * data)
-{
- int_fast16_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
- int_fast16_t tmp10, tmp11, tmp12, tmp13;
- int_fast16_t z1, z2, z3, z4, z5, z11, z13;
- DCTELEM *dataptr;
- int ctr;
- SHIFT_TEMPS
-
- row_fdct(data);
-
- /* Pass 2: process columns. */
-
- dataptr = data;
- for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
- tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7];
- tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7];
- tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6];
- tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6];
- tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5];
- tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];
- tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];
- tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];
-
- /* Even part */
-
- tmp10 = tmp0 + tmp3; /* phase 2 */
- tmp13 = tmp0 - tmp3;
- tmp11 = tmp1 + tmp2;
- tmp12 = tmp1 - tmp2;
-
- dataptr[DCTSIZE*0] = tmp10 + tmp11; /* phase 3 */
- dataptr[DCTSIZE*4] = tmp10 - tmp11;
-
- z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */
- dataptr[DCTSIZE*2] = tmp13 + z1; /* phase 5 */
- dataptr[DCTSIZE*6] = tmp13 - z1;
-
- /* Odd part */
-
- tmp10 = tmp4 + tmp5; /* phase 2 */
- tmp11 = tmp5 + tmp6;
- tmp12 = tmp6 + tmp7;
-
- /* The rotator is modified from fig 4-8 to avoid extra negations. */
- z5 = MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */
- z2 = MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */
- z4 = MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */
- z3 = MULTIPLY(tmp11, FIX_0_707106781); /* c4 */
-
- z11 = tmp7 + z3; /* phase 5 */
- z13 = tmp7 - z3;
-
- dataptr[DCTSIZE*5] = z13 + z2; /* phase 6 */
- dataptr[DCTSIZE*3] = z13 - z2;
- dataptr[DCTSIZE*1] = z11 + z4;
- dataptr[DCTSIZE*7] = z11 - z4;
-
- dataptr++; /* advance pointer to next column */
- }
-}
-
-/*
- * Perform the forward 2-4-8 DCT on one block of samples.
- */
-
-GLOBAL(void)
-fdct_ifast248 (DCTELEM * data)
-{
- int_fast16_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
- int_fast16_t tmp10, tmp11, tmp12, tmp13;
- int_fast16_t z1;
- DCTELEM *dataptr;
- int ctr;
- SHIFT_TEMPS
-
- row_fdct(data);
-
- /* Pass 2: process columns. */
-
- dataptr = data;
- for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
- tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*1];
- tmp1 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*3];
- tmp2 = dataptr[DCTSIZE*4] + dataptr[DCTSIZE*5];
- tmp3 = dataptr[DCTSIZE*6] + dataptr[DCTSIZE*7];
- tmp4 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*1];
- tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*3];
- tmp6 = dataptr[DCTSIZE*4] - dataptr[DCTSIZE*5];
- tmp7 = dataptr[DCTSIZE*6] - dataptr[DCTSIZE*7];
-
- /* Even part */
-
- tmp10 = tmp0 + tmp3;
- tmp11 = tmp1 + tmp2;
- tmp12 = tmp1 - tmp2;
- tmp13 = tmp0 - tmp3;
-
- dataptr[DCTSIZE*0] = tmp10 + tmp11;
- dataptr[DCTSIZE*4] = tmp10 - tmp11;
-
- z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781);
- dataptr[DCTSIZE*2] = tmp13 + z1;
- dataptr[DCTSIZE*6] = tmp13 - z1;
-
- tmp10 = tmp4 + tmp7;
- tmp11 = tmp5 + tmp6;
- tmp12 = tmp5 - tmp6;
- tmp13 = tmp4 - tmp7;
-
- dataptr[DCTSIZE*1] = tmp10 + tmp11;
- dataptr[DCTSIZE*5] = tmp10 - tmp11;
-
- z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781);
- dataptr[DCTSIZE*3] = tmp13 + z1;
- dataptr[DCTSIZE*7] = tmp13 - z1;
-
- dataptr++; /* advance pointer to next column */
- }
-}
-
-
-#undef GLOBAL
-#undef CONST_BITS
-#undef DESCALE
-#undef FIX_0_541196100
-#undef FIX_1_306562965
diff --git a/src/libffmpeg/libavcodec/jfdctint.c b/src/libffmpeg/libavcodec/jfdctint.c
deleted file mode 100644
index 250312467..000000000
--- a/src/libffmpeg/libavcodec/jfdctint.c
+++ /dev/null
@@ -1,406 +0,0 @@
-/*
- * jfdctint.c
- *
- * This file is part of the Independent JPEG Group's software.
- *
- * The authors make NO WARRANTY or representation, either express or implied,
- * with respect to this software, its quality, accuracy, merchantability, or
- * fitness for a particular purpose. This software is provided "AS IS", and
- * you, its user, assume the entire risk as to its quality and accuracy.
- *
- * This software is copyright (C) 1991-1996, Thomas G. Lane.
- * All Rights Reserved except as specified below.
- *
- * Permission is hereby granted to use, copy, modify, and distribute this
- * software (or portions thereof) for any purpose, without fee, subject to
- * these conditions:
- * (1) If any part of the source code for this software is distributed, then
- * this README file must be included, with this copyright and no-warranty
- * notice unaltered; and any additions, deletions, or changes to the original
- * files must be clearly indicated in accompanying documentation.
- * (2) If only executable code is distributed, then the accompanying
- * documentation must state that "this software is based in part on the work
- * of the Independent JPEG Group".
- * (3) Permission for use of this software is granted only if the user accepts
- * full responsibility for any undesirable consequences; the authors accept
- * NO LIABILITY for damages of any kind.
- *
- * These conditions apply to any software derived from or based on the IJG
- * code, not just to the unmodified library. If you use our work, you ought
- * to acknowledge us.
- *
- * Permission is NOT granted for the use of any IJG author's name or company
- * name in advertising or publicity relating to this software or products
- * derived from it. This software may be referred to only as "the Independent
- * JPEG Group's software".
- *
- * We specifically permit and encourage the use of this software as the basis
- * of commercial products, provided that all warranty or liability claims are
- * assumed by the product vendor.
- *
- * This file contains a slow-but-accurate integer implementation of the
- * forward DCT (Discrete Cosine Transform).
- *
- * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT
- * on each column. Direct algorithms are also available, but they are
- * much more complex and seem not to be any faster when reduced to code.
- *
- * This implementation is based on an algorithm described in
- * C. Loeffler, A. Ligtenberg and G. Moschytz, "Practical Fast 1-D DCT
- * Algorithms with 11 Multiplications", Proc. Int'l. Conf. on Acoustics,
- * Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991.
- * The primary algorithm described there uses 11 multiplies and 29 adds.
- * We use their alternate method with 12 multiplies and 32 adds.
- * The advantage of this method is that no data path contains more than one
- * multiplication; this allows a very simple and accurate implementation in
- * scaled fixed-point arithmetic, with a minimal number of shifts.
- */
-
-/**
- * @file jfdctint.c
- * Independent JPEG Group's slow & accurate dct.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include "common.h"
-#include "dsputil.h"
-
-#define SHIFT_TEMPS
-#define DCTSIZE 8
-#define BITS_IN_JSAMPLE 8
-#define GLOBAL(x) x
-#define RIGHT_SHIFT(x, n) ((x) >> (n))
-#define MULTIPLY16C16(var,const) ((var)*(const))
-
-#if 1 //def USE_ACCURATE_ROUNDING
-#define DESCALE(x,n) RIGHT_SHIFT((x) + (1 << ((n) - 1)), n)
-#else
-#define DESCALE(x,n) RIGHT_SHIFT(x, n)
-#endif
-
-
-/*
- * This module is specialized to the case DCTSIZE = 8.
- */
-
-#if DCTSIZE != 8
- Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
-#endif
-
-
-/*
- * The poop on this scaling stuff is as follows:
- *
- * Each 1-D DCT step produces outputs which are a factor of sqrt(N)
- * larger than the true DCT outputs. The final outputs are therefore
- * a factor of N larger than desired; since N=8 this can be cured by
- * a simple right shift at the end of the algorithm. The advantage of
- * this arrangement is that we save two multiplications per 1-D DCT,
- * because the y0 and y4 outputs need not be divided by sqrt(N).
- * In the IJG code, this factor of 8 is removed by the quantization step
- * (in jcdctmgr.c), NOT in this module.
- *
- * We have to do addition and subtraction of the integer inputs, which
- * is no problem, and multiplication by fractional constants, which is
- * a problem to do in integer arithmetic. We multiply all the constants
- * by CONST_SCALE and convert them to integer constants (thus retaining
- * CONST_BITS bits of precision in the constants). After doing a
- * multiplication we have to divide the product by CONST_SCALE, with proper
- * rounding, to produce the correct output. This division can be done
- * cheaply as a right shift of CONST_BITS bits. We postpone shifting
- * as long as possible so that partial sums can be added together with
- * full fractional precision.
- *
- * The outputs of the first pass are scaled up by PASS1_BITS bits so that
- * they are represented to better-than-integral precision. These outputs
- * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word
- * with the recommended scaling. (For 12-bit sample data, the intermediate
- * array is int32_t anyway.)
- *
- * To avoid overflow of the 32-bit intermediate results in pass 2, we must
- * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26. Error analysis
- * shows that the values given below are the most effective.
- */
-
-#if BITS_IN_JSAMPLE == 8
-#define CONST_BITS 13
-#define PASS1_BITS 4 /* set this to 2 if 16x16 multiplies are faster */
-#else
-#define CONST_BITS 13
-#define PASS1_BITS 1 /* lose a little precision to avoid overflow */
-#endif
-
-/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus
- * causing a lot of useless floating-point operations at run time.
- * To get around this we use the following pre-calculated constants.
- * If you change CONST_BITS you may want to add appropriate values.
- * (With a reasonable C compiler, you can just rely on the FIX() macro...)
- */
-
-#if CONST_BITS == 13
-#define FIX_0_298631336 ((int32_t) 2446) /* FIX(0.298631336) */
-#define FIX_0_390180644 ((int32_t) 3196) /* FIX(0.390180644) */
-#define FIX_0_541196100 ((int32_t) 4433) /* FIX(0.541196100) */
-#define FIX_0_765366865 ((int32_t) 6270) /* FIX(0.765366865) */
-#define FIX_0_899976223 ((int32_t) 7373) /* FIX(0.899976223) */
-#define FIX_1_175875602 ((int32_t) 9633) /* FIX(1.175875602) */
-#define FIX_1_501321110 ((int32_t) 12299) /* FIX(1.501321110) */
-#define FIX_1_847759065 ((int32_t) 15137) /* FIX(1.847759065) */
-#define FIX_1_961570560 ((int32_t) 16069) /* FIX(1.961570560) */
-#define FIX_2_053119869 ((int32_t) 16819) /* FIX(2.053119869) */
-#define FIX_2_562915447 ((int32_t) 20995) /* FIX(2.562915447) */
-#define FIX_3_072711026 ((int32_t) 25172) /* FIX(3.072711026) */
-#else
-#define FIX_0_298631336 FIX(0.298631336)
-#define FIX_0_390180644 FIX(0.390180644)
-#define FIX_0_541196100 FIX(0.541196100)
-#define FIX_0_765366865 FIX(0.765366865)
-#define FIX_0_899976223 FIX(0.899976223)
-#define FIX_1_175875602 FIX(1.175875602)
-#define FIX_1_501321110 FIX(1.501321110)
-#define FIX_1_847759065 FIX(1.847759065)
-#define FIX_1_961570560 FIX(1.961570560)
-#define FIX_2_053119869 FIX(2.053119869)
-#define FIX_2_562915447 FIX(2.562915447)
-#define FIX_3_072711026 FIX(3.072711026)
-#endif
-
-
-/* Multiply an int32_t variable by an int32_t constant to yield an int32_t result.
- * For 8-bit samples with the recommended scaling, all the variable
- * and constant values involved are no more than 16 bits wide, so a
- * 16x16->32 bit multiply can be used instead of a full 32x32 multiply.
- * For 12-bit samples, a full 32-bit multiplication will be needed.
- */
-
-#if BITS_IN_JSAMPLE == 8 && CONST_BITS<=13 && PASS1_BITS<=2
-#define MULTIPLY(var,const) MULTIPLY16C16(var,const)
-#else
-#define MULTIPLY(var,const) ((var) * (const))
-#endif
-
-
-static av_always_inline void row_fdct(DCTELEM * data){
- int_fast32_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
- int_fast32_t tmp10, tmp11, tmp12, tmp13;
- int_fast32_t z1, z2, z3, z4, z5;
- DCTELEM *dataptr;
- int ctr;
- SHIFT_TEMPS
-
- /* Pass 1: process rows. */
- /* Note results are scaled up by sqrt(8) compared to a true DCT; */
- /* furthermore, we scale the results by 2**PASS1_BITS. */
-
- dataptr = data;
- for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
- tmp0 = dataptr[0] + dataptr[7];
- tmp7 = dataptr[0] - dataptr[7];
- tmp1 = dataptr[1] + dataptr[6];
- tmp6 = dataptr[1] - dataptr[6];
- tmp2 = dataptr[2] + dataptr[5];
- tmp5 = dataptr[2] - dataptr[5];
- tmp3 = dataptr[3] + dataptr[4];
- tmp4 = dataptr[3] - dataptr[4];
-
- /* Even part per LL&M figure 1 --- note that published figure is faulty;
- * rotator "sqrt(2)*c1" should be "sqrt(2)*c6".
- */
-
- tmp10 = tmp0 + tmp3;
- tmp13 = tmp0 - tmp3;
- tmp11 = tmp1 + tmp2;
- tmp12 = tmp1 - tmp2;
-
- dataptr[0] = (DCTELEM) ((tmp10 + tmp11) << PASS1_BITS);
- dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS);
-
- z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);
- dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865),
- CONST_BITS-PASS1_BITS);
- dataptr[6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065),
- CONST_BITS-PASS1_BITS);
-
- /* Odd part per figure 8 --- note paper omits factor of sqrt(2).
- * cK represents cos(K*pi/16).
- * i0..i3 in the paper are tmp4..tmp7 here.
- */
-
- z1 = tmp4 + tmp7;
- z2 = tmp5 + tmp6;
- z3 = tmp4 + tmp6;
- z4 = tmp5 + tmp7;
- z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */
-
- tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */
- tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
- tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
- tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */
- z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */
- z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
- z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
- z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */
-
- z3 += z5;
- z4 += z5;
-
- dataptr[7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS);
- dataptr[5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS);
- dataptr[3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS);
- dataptr[1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS);
-
- dataptr += DCTSIZE; /* advance pointer to next row */
- }
-}
-
-/*
- * Perform the forward DCT on one block of samples.
- */
-
-GLOBAL(void)
-ff_jpeg_fdct_islow (DCTELEM * data)
-{
- int_fast32_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
- int_fast32_t tmp10, tmp11, tmp12, tmp13;
- int_fast32_t z1, z2, z3, z4, z5;
- DCTELEM *dataptr;
- int ctr;
- SHIFT_TEMPS
-
- row_fdct(data);
-
- /* Pass 2: process columns.
- * We remove the PASS1_BITS scaling, but leave the results scaled up
- * by an overall factor of 8.
- */
-
- dataptr = data;
- for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
- tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7];
- tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7];
- tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6];
- tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6];
- tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5];
- tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];
- tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];
- tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];
-
- /* Even part per LL&M figure 1 --- note that published figure is faulty;
- * rotator "sqrt(2)*c1" should be "sqrt(2)*c6".
- */
-
- tmp10 = tmp0 + tmp3;
- tmp13 = tmp0 - tmp3;
- tmp11 = tmp1 + tmp2;
- tmp12 = tmp1 - tmp2;
-
- dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp11, PASS1_BITS);
- dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp10 - tmp11, PASS1_BITS);
-
- z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);
- dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865),
- CONST_BITS+PASS1_BITS);
- dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065),
- CONST_BITS+PASS1_BITS);
-
- /* Odd part per figure 8 --- note paper omits factor of sqrt(2).
- * cK represents cos(K*pi/16).
- * i0..i3 in the paper are tmp4..tmp7 here.
- */
-
- z1 = tmp4 + tmp7;
- z2 = tmp5 + tmp6;
- z3 = tmp4 + tmp6;
- z4 = tmp5 + tmp7;
- z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */
-
- tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */
- tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
- tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
- tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */
- z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */
- z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
- z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
- z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */
-
- z3 += z5;
- z4 += z5;
-
- dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp4 + z1 + z3,
- CONST_BITS+PASS1_BITS);
- dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp5 + z2 + z4,
- CONST_BITS+PASS1_BITS);
- dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp6 + z2 + z3,
- CONST_BITS+PASS1_BITS);
- dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp7 + z1 + z4,
- CONST_BITS+PASS1_BITS);
-
- dataptr++; /* advance pointer to next column */
- }
-}
-
-/*
- * The secret of DCT2-4-8 is really simple -- you do the usual 1-DCT
- * on the rows and then, instead of doing even and odd, part on the colums
- * you do even part two times.
- */
-GLOBAL(void)
-ff_fdct248_islow (DCTELEM * data)
-{
- int_fast32_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
- int_fast32_t tmp10, tmp11, tmp12, tmp13;
- int_fast32_t z1;
- DCTELEM *dataptr;
- int ctr;
- SHIFT_TEMPS
-
- row_fdct(data);
-
- /* Pass 2: process columns.
- * We remove the PASS1_BITS scaling, but leave the results scaled up
- * by an overall factor of 8.
- */
-
- dataptr = data;
- for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
- tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*1];
- tmp1 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*3];
- tmp2 = dataptr[DCTSIZE*4] + dataptr[DCTSIZE*5];
- tmp3 = dataptr[DCTSIZE*6] + dataptr[DCTSIZE*7];
- tmp4 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*1];
- tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*3];
- tmp6 = dataptr[DCTSIZE*4] - dataptr[DCTSIZE*5];
- tmp7 = dataptr[DCTSIZE*6] - dataptr[DCTSIZE*7];
-
- tmp10 = tmp0 + tmp3;
- tmp11 = tmp1 + tmp2;
- tmp12 = tmp1 - tmp2;
- tmp13 = tmp0 - tmp3;
-
- dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp11, PASS1_BITS);
- dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp10 - tmp11, PASS1_BITS);
-
- z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);
- dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865),
- CONST_BITS+PASS1_BITS);
- dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065),
- CONST_BITS+PASS1_BITS);
-
- tmp10 = tmp4 + tmp7;
- tmp11 = tmp5 + tmp6;
- tmp12 = tmp5 - tmp6;
- tmp13 = tmp4 - tmp7;
-
- dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp10 + tmp11, PASS1_BITS);
- dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp10 - tmp11, PASS1_BITS);
-
- z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);
- dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865),
- CONST_BITS+PASS1_BITS);
- dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065),
- CONST_BITS+PASS1_BITS);
-
- dataptr++; /* advance pointer to next column */
- }
-}
diff --git a/src/libffmpeg/libavcodec/jpeg_ls.c b/src/libffmpeg/libavcodec/jpeg_ls.c
deleted file mode 100644
index 4629176ad..000000000
--- a/src/libffmpeg/libavcodec/jpeg_ls.c
+++ /dev/null
@@ -1,860 +0,0 @@
-/*
- * JPEG-LS encoder and decoder
- * Copyright (c) 2003 Michael Niedermayer
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "golomb.h"
-
-/**
- * @file jpeg_ls.c
- * JPEG-LS encoder and decoder.
- */
-
-typedef struct JpeglsContext{
- AVCodecContext *avctx;
- AVFrame picture;
-}JpeglsContext;
-
-typedef struct JLSState{
- int T1, T2, T3;
- int A[367], B[367], C[365], N[367];
- int limit, reset, bpp, qbpp, maxval, range;
- int near, twonear;
- int run_index[3];
-}JLSState;
-
-static const uint8_t log2_run[32]={
- 0, 0, 0, 0, 1, 1, 1, 1,
- 2, 2, 2, 2, 3, 3, 3, 3,
- 4, 4, 5, 5, 6, 6, 7, 7,
- 8, 9,10,11,12,13,14,15
-};
-
-/*
-* Uncomment this to significantly speed up decoding of broken JPEG-LS
-* (or test broken JPEG-LS decoder) and slow down ordinary decoding a bit.
-*
-* There is no Golomb code with length >= 32 bits possible, so check and
-* avoid situation of 32 zeros, FFmpeg Golomb decoder is painfully slow
-* on this errors.
-*/
-//#define JLS_BROKEN
-
-/********** Functions for both encoder and decoder **********/
-
-/**
- * Calculate initial JPEG-LS parameters
- */
-static void ls_init_state(JLSState *state){
- int i;
-
- state->twonear = state->near * 2 + 1;
- state->range = ((state->maxval + state->twonear - 1) / state->twonear) + 1;
-
- // QBPP = ceil(log2(RANGE))
- for(state->qbpp = 0; (1 << state->qbpp) < state->range; state->qbpp++);
-
- if(state->bpp < 8)
- state->limit = 16 + 2 * state->bpp - state->qbpp;
- else
- state->limit = (4 * state->bpp) - state->qbpp;
-
- for(i = 0; i < 367; i++) {
- state->A[i] = FFMAX((state->range + 32) >> 6, 2);
- state->N[i] = 1;
- }
-
-}
-
-/**
- * Calculate quantized gradient value, used for context determination
- */
-static inline int quantize(JLSState *s, int v){ //FIXME optimize
- if(v==0) return 0;
- if(v < 0){
- if(v <= -s->T3) return -4;
- if(v <= -s->T2) return -3;
- if(v <= -s->T1) return -2;
- if(v < -s->near) return -1;
- return 0;
- }else{
- if(v <= s->near) return 0;
- if(v < s->T1) return 1;
- if(v < s->T2) return 2;
- if(v < s->T3) return 3;
- return 4;
- }
-}
-
-/**
- * Custom value clipping function used in T1, T2, T3 calculation
- */
-static inline int iso_clip(int v, int vmin, int vmax){
- if(v > vmax || v < vmin) return vmin;
- else return v;
-}
-
-/**
- * Calculate JPEG-LS codec values
- */
-static void reset_ls_coding_parameters(JLSState *s, int reset_all){
- const int basic_t1= 3;
- const int basic_t2= 7;
- const int basic_t3= 21;
- int factor;
-
- if(s->maxval==0 || reset_all) s->maxval= (1 << s->bpp) - 1;
-
- if(s->maxval >=128){
- factor= (FFMIN(s->maxval, 4095) + 128)>>8;
-
- if(s->T1==0 || reset_all)
- s->T1= iso_clip(factor*(basic_t1-2) + 2 + 3*s->near, s->near+1, s->maxval);
- if(s->T2==0 || reset_all)
- s->T2= iso_clip(factor*(basic_t2-3) + 3 + 5*s->near, s->T1, s->maxval);
- if(s->T3==0 || reset_all)
- s->T3= iso_clip(factor*(basic_t3-4) + 4 + 7*s->near, s->T2, s->maxval);
- }else{
- factor= 256 / (s->maxval + 1);
-
- if(s->T1==0 || reset_all)
- s->T1= iso_clip(FFMAX(2, basic_t1/factor + 3*s->near), s->near+1, s->maxval);
- if(s->T2==0 || reset_all)
- s->T2= iso_clip(FFMAX(3, basic_t2/factor + 5*s->near), s->T1, s->maxval);
- if(s->T3==0 || reset_all)
- s->T3= iso_clip(FFMAX(4, basic_t3/factor + 6*s->near), s->T2, s->maxval);
- }
-
- if(s->reset==0 || reset_all) s->reset= 64;
-// av_log(NULL, AV_LOG_DEBUG, "[JPEG-LS RESET] T=%i,%i,%i\n", s->T1, s->T2, s->T3);
-}
-
-
-/********** Decoder-specific functions **********/
-
-/**
- * Decode LSE block with initialization parameters
- */
-static int decode_lse(MJpegDecodeContext *s)
-{
- int len, id;
-
- /* XXX: verify len field validity */
- len = get_bits(&s->gb, 16);
- id = get_bits(&s->gb, 8);
-
- switch(id){
- case 1:
- s->maxval= get_bits(&s->gb, 16);
- s->t1= get_bits(&s->gb, 16);
- s->t2= get_bits(&s->gb, 16);
- s->t3= get_bits(&s->gb, 16);
- s->reset= get_bits(&s->gb, 16);
-
-// reset_ls_coding_parameters(s, 0);
- //FIXME quant table?
- break;
- case 2:
- case 3:
- av_log(s->avctx, AV_LOG_ERROR, "palette not supported\n");
- return -1;
- case 4:
- av_log(s->avctx, AV_LOG_ERROR, "oversize image not supported\n");
- return -1;
- default:
- av_log(s->avctx, AV_LOG_ERROR, "invalid id %d\n", id);
- return -1;
- }
-// av_log(s->avctx, AV_LOG_DEBUG, "ID=%i, T=%i,%i,%i\n", id, s->t1, s->t2, s->t3);
-
- return 0;
-}
-
-static void inline downscale_state(JLSState *state, int Q){
- if(state->N[Q] == state->reset){
- state->A[Q] >>=1;
- state->B[Q] >>=1;
- state->N[Q] >>=1;
- }
- state->N[Q]++;
-}
-
-static inline int update_state_regular(JLSState *state, int Q, int err){
- state->A[Q] += FFABS(err);
- err *= state->twonear;
- state->B[Q] += err;
-
- downscale_state(state, Q);
-
- if(state->B[Q] <= -state->N[Q]) {
- state->B[Q]= FFMAX(state->B[Q] + state->N[Q], 1-state->N[Q]);
- if(state->C[Q] > -128)
- state->C[Q]--;
- }else if(state->B[Q] > 0){
- state->B[Q]= FFMIN(state->B[Q] - state->N[Q], 0);
- if(state->C[Q] < 127)
- state->C[Q]++;
- }
-
- return err;
-}
-
-/**
- * Get context-dependent Golomb code, decode it and update context
- */
-static inline int ls_get_code_regular(GetBitContext *gb, JLSState *state, int Q){
- int k, ret;
-
- for(k = 0; (state->N[Q] << k) < state->A[Q]; k++);
-
-#ifdef JLS_BROKEN
- if(!show_bits_long(gb, 32))return -1;
-#endif
- ret = get_ur_golomb_jpegls(gb, k, state->limit, state->qbpp);
-
- /* decode mapped error */
- if(ret & 1)
- ret = -((ret + 1) >> 1);
- else
- ret >>= 1;
-
- /* for NEAR=0, k=0 and 2*B[Q] <= - N[Q] mapping is reversed */
- if(!state->near && !k && (2 * state->B[Q] <= -state->N[Q]))
- ret = -(ret + 1);
-
- ret= update_state_regular(state, Q, ret);
-
- return ret;
-}
-
-/**
- * Get Golomb code, decode it and update state for run termination
- */
-static inline int ls_get_code_runterm(GetBitContext *gb, JLSState *state, int RItype, int limit_add){
- int k, ret, temp, map;
- int Q = 365 + RItype;
-
- temp= state->A[Q];
- if(RItype)
- temp += state->N[Q] >> 1;
-
- for(k = 0; (state->N[Q] << k) < temp; k++);
-
-#ifdef JLS_BROKEN
- if(!show_bits_long(gb, 32))return -1;
-#endif
- ret = get_ur_golomb_jpegls(gb, k, state->limit - limit_add - 1, state->qbpp);
-
- /* decode mapped error */
- map = 0;
- if(!k && (RItype || ret) && (2 * state->B[Q] < state->N[Q]))
- map = 1;
- ret += RItype + map;
-
- if(ret & 1){
- ret = map - ((ret + 1) >> 1);
- state->B[Q]++;
- } else {
- ret = ret >> 1;
- }
-
- /* update state */
- state->A[Q] += FFABS(ret) - RItype;
- ret *= state->twonear;
- downscale_state(state, Q);
-
- return ret;
-}
-
-#define R(a, i ) (bits == 8 ? ((uint8_t*)(a))[i] : ((uint16_t*)(a))[i] )
-#define W(a, i, v) (bits == 8 ? (((uint8_t*)(a))[i]=v) : (((uint16_t*)(a))[i]=v))
-/**
- * Decode one line of image
- */
-static inline void ls_decode_line(JLSState *state, MJpegDecodeContext *s, void *last, void *dst, int last2, int w, int stride, int comp, int bits){
- int i, x = 0;
- int Ra, Rb, Rc, Rd;
- int D0, D1, D2;
-
- while(x < w) {
- int err, pred;
-
- /* compute gradients */
- Ra = x ? R(dst, x - stride) : R(last, x);
- Rb = R(last, x);
- Rc = x ? R(last, x - stride) : last2;
- Rd = (x >= w - stride) ? R(last, x) : R(last, x + stride);
- D0 = Rd - Rb;
- D1 = Rb - Rc;
- D2 = Rc - Ra;
- /* run mode */
- if((FFABS(D0) <= state->near) && (FFABS(D1) <= state->near) && (FFABS(D2) <= state->near)) {
- int r;
- int RItype;
-
- /* decode full runs while available */
- while(get_bits1(&s->gb)) {
- int r;
- r = 1 << log2_run[state->run_index[comp]];
- if(x + r * stride > w) {
- r = (w - x) / stride;
- }
- for(i = 0; i < r; i++) {
- W(dst, x, Ra);
- x += stride;
- }
- /* if EOL reached, we stop decoding */
- if(r != (1 << log2_run[state->run_index[comp]]))
- return;
- if(state->run_index[comp] < 31)
- state->run_index[comp]++;
- if(x + stride > w)
- return;
- }
- /* decode aborted run */
- r = log2_run[state->run_index[comp]];
- if(r)
- r = get_bits_long(&s->gb, r);
- for(i = 0; i < r; i++) {
- W(dst, x, Ra);
- x += stride;
- }
-
- /* decode run termination value */
- Rb = R(last, x);
- RItype = (FFABS(Ra - Rb) <= state->near) ? 1 : 0;
- err = ls_get_code_runterm(&s->gb, state, RItype, log2_run[state->run_index[comp]]);
- if(state->run_index[comp])
- state->run_index[comp]--;
-
- if(state->near && RItype){
- pred = Ra + err;
- } else {
- if(Rb < Ra)
- pred = Rb - err;
- else
- pred = Rb + err;
- }
- } else { /* regular mode */
- int context, sign;
-
- context = quantize(state, D0) * 81 + quantize(state, D1) * 9 + quantize(state, D2);
- pred = mid_pred(Ra, Ra + Rb - Rc, Rb);
-
- if(context < 0){
- context = -context;
- sign = 1;
- }else{
- sign = 0;
- }
-
- if(sign){
- pred = clip(pred - state->C[context], 0, state->maxval);
- err = -ls_get_code_regular(&s->gb, state, context);
- } else {
- pred = clip(pred + state->C[context], 0, state->maxval);
- err = ls_get_code_regular(&s->gb, state, context);
- }
-
- /* we have to do something more for near-lossless coding */
- pred += err;
- }
- if(state->near){
- if(pred < -state->near)
- pred += state->range * state->twonear;
- else if(pred > state->maxval + state->near)
- pred -= state->range * state->twonear;
- pred = clip(pred, 0, state->maxval);
- }
-
- pred &= state->maxval;
- W(dst, x, pred);
- x += stride;
- }
-}
-
-static int ls_decode_picture(MJpegDecodeContext *s, int near, int point_transform, int ilv){
- int i, t = 0;
- uint8_t *zero, *last, *cur;
- JLSState *state;
- int off = 0, stride = 1, width, shift;
-
- zero = av_mallocz(s->picture.linesize[0]);
- last = zero;
- cur = s->picture.data[0];
-
- state = av_mallocz(sizeof(JLSState));
- /* initialize JPEG-LS state from JPEG parameters */
- state->near = near;
- state->bpp = (s->bits < 2) ? 2 : s->bits;
- state->maxval = s->maxval;
- state->T1 = s->t1;
- state->T2 = s->t2;
- state->T3 = s->t3;
- state->reset = s->reset;
- reset_ls_coding_parameters(state, 0);
- ls_init_state(state);
-
- if(s->bits <= 8)
- shift = point_transform + (8 - s->bits);
- else
- shift = point_transform + (16 - s->bits);
-
-// av_log(s->avctx, AV_LOG_DEBUG, "JPEG-LS params: %ix%i NEAR=%i MV=%i T(%i,%i,%i) RESET=%i, LIMIT=%i, qbpp=%i, RANGE=%i\n",s->width,s->height,state->near,state->maxval,state->T1,state->T2,state->T3,state->reset,state->limit,state->qbpp, state->range);
-// av_log(s->avctx, AV_LOG_DEBUG, "JPEG params: ILV=%i Pt=%i BPP=%i, scan = %i\n", ilv, point_transform, s->bits, s->cur_scan);
- if(ilv == 0) { /* separate planes */
- off = s->cur_scan - 1;
- stride = (s->nb_components > 1) ? 3 : 1;
- width = s->width * stride;
- cur += off;
- for(i = 0; i < s->height; i++) {
- if(s->bits <= 8){
- ls_decode_line(state, s, last, cur, t, width, stride, off, 8);
- t = last[0];
- }else{
- ls_decode_line(state, s, last, cur, t, width, stride, off, 16);
- t = *((uint16_t*)last);
- }
- last = cur;
- cur += s->picture.linesize[0];
-
- if (s->restart_interval && !--s->restart_count) {
- align_get_bits(&s->gb);
- skip_bits(&s->gb, 16); /* skip RSTn */
- }
- }
- } else if(ilv == 1) { /* line interleaving */
- int j;
- int Rc[3] = {0, 0, 0};
- memset(cur, 0, s->picture.linesize[0]);
- width = s->width * 3;
- for(i = 0; i < s->height; i++) {
- for(j = 0; j < 3; j++) {
- ls_decode_line(state, s, last + j, cur + j, Rc[j], width, 3, j, 8);
- Rc[j] = last[j];
-
- if (s->restart_interval && !--s->restart_count) {
- align_get_bits(&s->gb);
- skip_bits(&s->gb, 16); /* skip RSTn */
- }
- }
- last = cur;
- cur += s->picture.linesize[0];
- }
- } else if(ilv == 2) { /* sample interleaving */
- av_log(s->avctx, AV_LOG_ERROR, "Sample interleaved images are not supported.\n");
- av_free(state);
- av_free(zero);
- return -1;
- }
-
- if(shift){ /* we need to do point transform or normalize samples */
- int x, w;
-
- w = s->width * s->nb_components;
-
- if(s->bits <= 8){
- uint8_t *src = s->picture.data[0];
-
- for(i = 0; i < s->height; i++){
- for(x = off; x < w; x+= stride){
- src[x] <<= shift;
- }
- src += s->picture.linesize[0];
- }
- }else{
- uint16_t *src = s->picture.data[0];
-
- for(i = 0; i < s->height; i++){
- for(x = 0; x < w; x++){
- src[x] <<= shift;
- }
- src += s->picture.linesize[0]/2;
- }
- }
- }
- av_free(state);
- av_free(zero);
-
- return 0;
-}
-
-#if defined(CONFIG_ENCODERS) && defined(CONFIG_JPEGLS_ENCODER)
-/********** Encoder-specific functions **********/
-
-/**
- * Encode error from regular symbol
- */
-static inline void ls_encode_regular(JLSState *state, PutBitContext *pb, int Q, int err){
- int k;
- int val;
- int map;
-
- for(k = 0; (state->N[Q] << k) < state->A[Q]; k++);
-
- map = !state->near && !k && (2 * state->B[Q] <= -state->N[Q]);
-
- if(err < 0)
- err += state->range;
- if(err >= ((state->range + 1) >> 1)) {
- err -= state->range;
- val = 2 * FFABS(err) - 1 - map;
- } else
- val = 2 * err + map;
-
- set_ur_golomb_jpegls(pb, val, k, state->limit, state->qbpp);
-
- update_state_regular(state, Q, err);
-}
-
-/**
- * Encode error from run termination
- */
-static inline void ls_encode_runterm(JLSState *state, PutBitContext *pb, int RItype, int err, int limit_add){
- int k;
- int val, map;
- int Q = 365 + RItype;
- int temp;
-
- temp = state->A[Q];
- if(RItype)
- temp += state->N[Q] >> 1;
- for(k = 0; (state->N[Q] << k) < temp; k++);
- map = 0;
- if(!k && err && (2 * state->B[Q] < state->N[Q]))
- map = 1;
-
- if(err < 0)
- val = - (2 * err) - 1 - RItype + map;
- else
- val = 2 * err - RItype - map;
- set_ur_golomb_jpegls(pb, val, k, state->limit - limit_add - 1, state->qbpp);
-
- if(err < 0)
- state->B[Q]++;
- state->A[Q] += (val + 1 - RItype) >> 1;
-
- downscale_state(state, Q);
-}
-
-/**
- * Encode run value as specified by JPEG-LS standard
- */
-static inline void ls_encode_run(JLSState *state, PutBitContext *pb, int run, int comp, int trail){
- while(run >= (1 << log2_run[state->run_index[comp]])){
- put_bits(pb, 1, 1);
- run -= 1 << log2_run[state->run_index[comp]];
- if(state->run_index[comp] < 31)
- state->run_index[comp]++;
- }
- /* if hit EOL, encode another full run, else encode aborted run */
- if(!trail && run) {
- put_bits(pb, 1, 1);
- }else if(trail){
- put_bits(pb, 1, 0);
- if(log2_run[state->run_index[comp]])
- put_bits(pb, log2_run[state->run_index[comp]], run);
- }
-}
-
-/**
- * Encode one line of image
- */
-static inline void ls_encode_line(JLSState *state, PutBitContext *pb, void *last, void *cur, int last2, int w, int stride, int comp, int bits){
- int x = 0;
- int Ra, Rb, Rc, Rd;
- int D0, D1, D2;
-
- while(x < w) {
- int err, pred, sign;
-
- /* compute gradients */
- Ra = x ? R(cur, x - stride) : R(last, x);
- Rb = R(last, x);
- Rc = x ? R(last, x - stride) : last2;
- Rd = (x >= w - stride) ? R(last, x) : R(last, x + stride);
- D0 = Rd - Rb;
- D1 = Rb - Rc;
- D2 = Rc - Ra;
-
- /* run mode */
- if((FFABS(D0) <= state->near) && (FFABS(D1) <= state->near) && (FFABS(D2) <= state->near)) {
- int RUNval, RItype, run;
-
- run = 0;
- RUNval = Ra;
- while(x < w && (FFABS(R(cur, x) - RUNval) <= state->near)){
- run++;
- W(cur, x, Ra);
- x += stride;
- }
- ls_encode_run(state, pb, run, comp, x < w);
- if(x >= w)
- return;
- Rb = R(last, x);
- RItype = (FFABS(Ra - Rb) <= state->near);
- pred = RItype ? Ra : Rb;
- err = R(cur, x) - pred;
-
- if(!RItype && Ra > Rb)
- err = -err;
-
- if(state->near){
- if(err > 0)
- err = (state->near + err) / state->twonear;
- else
- err = -(state->near - err) / state->twonear;
-
- if(RItype || (Rb >= Ra))
- Ra = clip(pred + err * state->twonear, 0, state->maxval);
- else
- Ra = clip(pred - err * state->twonear, 0, state->maxval);
- W(cur, x, Ra);
- }
- if(err < 0)
- err += state->range;
- if(err >= ((state->range + 1) >> 1))
- err -= state->range;
-
- ls_encode_runterm(state, pb, RItype, err, log2_run[state->run_index[comp]]);
-
- if(state->run_index[comp] > 0)
- state->run_index[comp]--;
- } else { /* regular mode */
- int context;
-
- context = quantize(state, D0) * 81 + quantize(state, D1) * 9 + quantize(state, D2);
- pred = mid_pred(Ra, Ra + Rb - Rc, Rb);
-
- if(context < 0){
- context = -context;
- sign = 1;
- pred = clip(pred - state->C[context], 0, state->maxval);
- err = pred - R(cur, x);
- }else{
- sign = 0;
- pred = clip(pred + state->C[context], 0, state->maxval);
- err = R(cur, x) - pred;
- }
-
- if(state->near){
- if(err > 0)
- err = (state->near + err) / state->twonear;
- else
- err = -(state->near - err) / state->twonear;
- if(!sign)
- Ra = clip(pred + err * state->twonear, 0, state->maxval);
- else
- Ra = clip(pred - err * state->twonear, 0, state->maxval);
- W(cur, x, Ra);
- }
-
- ls_encode_regular(state, pb, context, err);
- }
- x += stride;
- }
-}
-
-static void ls_store_lse(JLSState *state, PutBitContext *pb){
- /* Test if we have default params and don't need to store LSE */
- JLSState state2;
- memset(&state2, 0, sizeof(JLSState));
- state2.bpp = state->bpp;
- state2.near = state->near;
- reset_ls_coding_parameters(&state2, 1);
- if(state->T1 == state2.T1 && state->T2 == state2.T2 && state->T3 == state2.T3 && state->reset == state2.reset)
- return;
- /* store LSE type 1 */
- put_marker(pb, LSE);
- put_bits(pb, 16, 13);
- put_bits(pb, 8, 1);
- put_bits(pb, 16, state->maxval);
- put_bits(pb, 16, state->T1);
- put_bits(pb, 16, state->T2);
- put_bits(pb, 16, state->T3);
- put_bits(pb, 16, state->reset);
-}
-
-static int encode_picture_ls(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){
- JpeglsContext * const s = avctx->priv_data;
- AVFrame *pict = data;
- AVFrame * const p= (AVFrame*)&s->picture;
- const int near = avctx->prediction_method;
- PutBitContext pb, pb2;
- GetBitContext gb;
- uint8_t *buf2, *zero, *cur, *last;
- JLSState *state;
- int i, size;
- int comps;
-
- buf2 = av_malloc(buf_size);
-
- init_put_bits(&pb, buf, buf_size);
- init_put_bits(&pb2, buf2, buf_size);
-
- *p = *pict;
- p->pict_type= FF_I_TYPE;
- p->key_frame= 1;
-
- if(avctx->pix_fmt == PIX_FMT_GRAY8 || avctx->pix_fmt == PIX_FMT_GRAY16)
- comps = 1;
- else
- comps = 3;
-
- /* write our own JPEG header, can't use mjpeg_picture_header */
- put_marker(&pb, SOI);
- put_marker(&pb, SOF48);
- put_bits(&pb, 16, 8 + comps * 3); // header size depends on components
- put_bits(&pb, 8, (avctx->pix_fmt == PIX_FMT_GRAY16) ? 16 : 8); // bpp
- put_bits(&pb, 16, avctx->height);
- put_bits(&pb, 16, avctx->width);
- put_bits(&pb, 8, comps); // components
- for(i = 1; i <= comps; i++) {
- put_bits(&pb, 8, i); // component ID
- put_bits(&pb, 8, 0x11); // subsampling: none
- put_bits(&pb, 8, 0); // Tiq, used by JPEG-LS ext
- }
-
- put_marker(&pb, SOS);
- put_bits(&pb, 16, 6 + comps * 2);
- put_bits(&pb, 8, comps);
- for(i = 1; i <= comps; i++) {
- put_bits(&pb, 8, i); // component ID
- put_bits(&pb, 8, 0); // mapping index: none
- }
- put_bits(&pb, 8, near);
- put_bits(&pb, 8, (comps > 1) ? 1 : 0); // interleaving: 0 - plane, 1 - line
- put_bits(&pb, 8, 0); // point transform: none
-
- state = av_mallocz(sizeof(JLSState));
- /* initialize JPEG-LS state from JPEG parameters */
- state->near = near;
- state->bpp = (avctx->pix_fmt == PIX_FMT_GRAY16) ? 16 : 8;
- reset_ls_coding_parameters(state, 0);
- ls_init_state(state);
-
- ls_store_lse(state, &pb);
-
- zero = av_mallocz(p->linesize[0]);
- last = zero;
- cur = p->data[0];
- if(avctx->pix_fmt == PIX_FMT_GRAY8){
- int t = 0;
-
- for(i = 0; i < avctx->height; i++) {
- ls_encode_line(state, &pb2, last, cur, t, avctx->width, 1, 0, 8);
- t = last[0];
- last = cur;
- cur += p->linesize[0];
- }
- }else if(avctx->pix_fmt == PIX_FMT_GRAY16){
- int t = 0;
-
- for(i = 0; i < avctx->height; i++) {
- ls_encode_line(state, &pb2, last, cur, t, avctx->width, 1, 0, 16);
- t = *((uint16_t*)last);
- last = cur;
- cur += p->linesize[0];
- }
- }else if(avctx->pix_fmt == PIX_FMT_RGB24){
- int j, width;
- int Rc[3] = {0, 0, 0};
-
- width = avctx->width * 3;
- for(i = 0; i < avctx->height; i++) {
- for(j = 0; j < 3; j++) {
- ls_encode_line(state, &pb2, last + j, cur + j, Rc[j], width, 3, j, 8);
- Rc[j] = last[j];
- }
- last = cur;
- cur += s->picture.linesize[0];
- }
- }else if(avctx->pix_fmt == PIX_FMT_BGR24){
- int j, width;
- int Rc[3] = {0, 0, 0};
-
- width = avctx->width * 3;
- for(i = 0; i < avctx->height; i++) {
- for(j = 2; j >= 0; j--) {
- ls_encode_line(state, &pb2, last + j, cur + j, Rc[j], width, 3, j, 8);
- Rc[j] = last[j];
- }
- last = cur;
- cur += s->picture.linesize[0];
- }
- }
-
- av_free(zero);
- av_free(state);
-
- // the specification says that after doing 0xff escaping unused bits in the
- // last byte must be set to 0, so just append 7 "optional" zero-bits to
- // avoid special-casing.
- put_bits(&pb2, 7, 0);
- size = put_bits_count(&pb2);
- flush_put_bits(&pb2);
- /* do escape coding */
- init_get_bits(&gb, buf2, size);
- size -= 7;
- while(get_bits_count(&gb) < size){
- int v;
- v = get_bits(&gb, 8);
- put_bits(&pb, 8, v);
- if(v == 0xFF){
- v = get_bits(&gb, 7);
- put_bits(&pb, 8, v);
- }
- }
- align_put_bits(&pb);
- av_free(buf2);
-
- /* End of image */
- put_marker(&pb, EOI);
- flush_put_bits(&pb);
-
- emms_c();
-
- return put_bits_count(&pb) >> 3;
-}
-
-static int encode_init_ls(AVCodecContext *ctx) {
- JpeglsContext *c = (JpeglsContext*)ctx->priv_data;
-
- c->avctx = ctx;
- ctx->coded_frame = &c->picture;
-
- if(ctx->pix_fmt != PIX_FMT_GRAY8 && ctx->pix_fmt != PIX_FMT_GRAY16 && ctx->pix_fmt != PIX_FMT_RGB24 && ctx->pix_fmt != PIX_FMT_BGR24){
- av_log(ctx, AV_LOG_ERROR, "Only grayscale and RGB24/BGR24 images are supported\n");
- return -1;
- }
- return 0;
-}
-
-AVCodec jpegls_encoder = { //FIXME avoid MPV_* lossless jpeg shouldnt need them
- "jpegls",
- CODEC_TYPE_VIDEO,
- CODEC_ID_JPEGLS,
- sizeof(JpeglsContext),
- encode_init_ls,
- encode_picture_ls,
- NULL,
- .pix_fmts= (enum PixelFormat[]){PIX_FMT_BGR24, PIX_FMT_RGB24, PIX_FMT_GRAY8, PIX_FMT_GRAY16, -1},
-};
-#endif
diff --git a/src/libffmpeg/libavcodec/jrevdct.c b/src/libffmpeg/libavcodec/jrevdct.c
deleted file mode 100644
index f055cc1ac..000000000
--- a/src/libffmpeg/libavcodec/jrevdct.c
+++ /dev/null
@@ -1,1159 +0,0 @@
-/*
- * jrevdct.c
- *
- * This file is part of the Independent JPEG Group's software.
- *
- * The authors make NO WARRANTY or representation, either express or implied,
- * with respect to this software, its quality, accuracy, merchantability, or
- * fitness for a particular purpose. This software is provided "AS IS", and
- * you, its user, assume the entire risk as to its quality and accuracy.
- *
- * This software is copyright (C) 1991, 1992, Thomas G. Lane.
- * All Rights Reserved except as specified below.
- *
- * Permission is hereby granted to use, copy, modify, and distribute this
- * software (or portions thereof) for any purpose, without fee, subject to
- * these conditions:
- * (1) If any part of the source code for this software is distributed, then
- * this README file must be included, with this copyright and no-warranty
- * notice unaltered; and any additions, deletions, or changes to the original
- * files must be clearly indicated in accompanying documentation.
- * (2) If only executable code is distributed, then the accompanying
- * documentation must state that "this software is based in part on the work
- * of the Independent JPEG Group".
- * (3) Permission for use of this software is granted only if the user accepts
- * full responsibility for any undesirable consequences; the authors accept
- * NO LIABILITY for damages of any kind.
- *
- * These conditions apply to any software derived from or based on the IJG
- * code, not just to the unmodified library. If you use our work, you ought
- * to acknowledge us.
- *
- * Permission is NOT granted for the use of any IJG author's name or company
- * name in advertising or publicity relating to this software or products
- * derived from it. This software may be referred to only as "the Independent
- * JPEG Group's software".
- *
- * We specifically permit and encourage the use of this software as the basis
- * of commercial products, provided that all warranty or liability claims are
- * assumed by the product vendor.
- *
- * This file contains the basic inverse-DCT transformation subroutine.
- *
- * This implementation is based on an algorithm described in
- * C. Loeffler, A. Ligtenberg and G. Moschytz, "Practical Fast 1-D DCT
- * Algorithms with 11 Multiplications", Proc. Int'l. Conf. on Acoustics,
- * Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991.
- * The primary algorithm described there uses 11 multiplies and 29 adds.
- * We use their alternate method with 12 multiplies and 32 adds.
- * The advantage of this method is that no data path contains more than one
- * multiplication; this allows a very simple and accurate implementation in
- * scaled fixed-point arithmetic, with a minimal number of shifts.
- *
- * I've made lots of modifications to attempt to take advantage of the
- * sparse nature of the DCT matrices we're getting. Although the logic
- * is cumbersome, it's straightforward and the resulting code is much
- * faster.
- *
- * A better way to do this would be to pass in the DCT block as a sparse
- * matrix, perhaps with the difference cases encoded.
- */
-
-/**
- * @file jrevdct.c
- * Independent JPEG Group's LLM idct.
- */
-
-#include "common.h"
-#include "dsputil.h"
-
-#define EIGHT_BIT_SAMPLES
-
-#define DCTSIZE 8
-#define DCTSIZE2 64
-
-#define GLOBAL
-
-#define RIGHT_SHIFT(x, n) ((x) >> (n))
-
-typedef DCTELEM DCTBLOCK[DCTSIZE2];
-
-#define CONST_BITS 13
-
-/*
- * This routine is specialized to the case DCTSIZE = 8.
- */
-
-#if DCTSIZE != 8
- Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
-#endif
-
-
-/*
- * A 2-D IDCT can be done by 1-D IDCT on each row followed by 1-D IDCT
- * on each column. Direct algorithms are also available, but they are
- * much more complex and seem not to be any faster when reduced to code.
- *
- * The poop on this scaling stuff is as follows:
- *
- * Each 1-D IDCT step produces outputs which are a factor of sqrt(N)
- * larger than the true IDCT outputs. The final outputs are therefore
- * a factor of N larger than desired; since N=8 this can be cured by
- * a simple right shift at the end of the algorithm. The advantage of
- * this arrangement is that we save two multiplications per 1-D IDCT,
- * because the y0 and y4 inputs need not be divided by sqrt(N).
- *
- * We have to do addition and subtraction of the integer inputs, which
- * is no problem, and multiplication by fractional constants, which is
- * a problem to do in integer arithmetic. We multiply all the constants
- * by CONST_SCALE and convert them to integer constants (thus retaining
- * CONST_BITS bits of precision in the constants). After doing a
- * multiplication we have to divide the product by CONST_SCALE, with proper
- * rounding, to produce the correct output. This division can be done
- * cheaply as a right shift of CONST_BITS bits. We postpone shifting
- * as long as possible so that partial sums can be added together with
- * full fractional precision.
- *
- * The outputs of the first pass are scaled up by PASS1_BITS bits so that
- * they are represented to better-than-integral precision. These outputs
- * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word
- * with the recommended scaling. (To scale up 12-bit sample data further, an
- * intermediate int32 array would be needed.)
- *
- * To avoid overflow of the 32-bit intermediate results in pass 2, we must
- * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26. Error analysis
- * shows that the values given below are the most effective.
- */
-
-#ifdef EIGHT_BIT_SAMPLES
-#define PASS1_BITS 2
-#else
-#define PASS1_BITS 1 /* lose a little precision to avoid overflow */
-#endif
-
-#define ONE ((int32_t) 1)
-
-#define CONST_SCALE (ONE << CONST_BITS)
-
-/* Convert a positive real constant to an integer scaled by CONST_SCALE.
- * IMPORTANT: if your compiler doesn't do this arithmetic at compile time,
- * you will pay a significant penalty in run time. In that case, figure
- * the correct integer constant values and insert them by hand.
- */
-
-/* Actually FIX is no longer used, we precomputed them all */
-#define FIX(x) ((int32_t) ((x) * CONST_SCALE + 0.5))
-
-/* Descale and correctly round an int32_t value that's scaled by N bits.
- * We assume RIGHT_SHIFT rounds towards minus infinity, so adding
- * the fudge factor is correct for either sign of X.
- */
-
-#define DESCALE(x,n) RIGHT_SHIFT((x) + (ONE << ((n)-1)), n)
-
-/* Multiply an int32_t variable by an int32_t constant to yield an int32_t result.
- * For 8-bit samples with the recommended scaling, all the variable
- * and constant values involved are no more than 16 bits wide, so a
- * 16x16->32 bit multiply can be used instead of a full 32x32 multiply;
- * this provides a useful speedup on many machines.
- * There is no way to specify a 16x16->32 multiply in portable C, but
- * some C compilers will do the right thing if you provide the correct
- * combination of casts.
- * NB: for 12-bit samples, a full 32-bit multiplication will be needed.
- */
-
-#ifdef EIGHT_BIT_SAMPLES
-#ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */
-#define MULTIPLY(var,const) (((int16_t) (var)) * ((int16_t) (const)))
-#endif
-#ifdef SHORTxLCONST_32 /* known to work with Microsoft C 6.0 */
-#define MULTIPLY(var,const) (((int16_t) (var)) * ((int32_t) (const)))
-#endif
-#endif
-
-#ifndef MULTIPLY /* default definition */
-#define MULTIPLY(var,const) ((var) * (const))
-#endif
-
-
-/*
- Unlike our decoder where we approximate the FIXes, we need to use exact
-ones here or successive P-frames will drift too much with Reference frame coding
-*/
-#define FIX_0_211164243 1730
-#define FIX_0_275899380 2260
-#define FIX_0_298631336 2446
-#define FIX_0_390180644 3196
-#define FIX_0_509795579 4176
-#define FIX_0_541196100 4433
-#define FIX_0_601344887 4926
-#define FIX_0_765366865 6270
-#define FIX_0_785694958 6436
-#define FIX_0_899976223 7373
-#define FIX_1_061594337 8697
-#define FIX_1_111140466 9102
-#define FIX_1_175875602 9633
-#define FIX_1_306562965 10703
-#define FIX_1_387039845 11363
-#define FIX_1_451774981 11893
-#define FIX_1_501321110 12299
-#define FIX_1_662939225 13623
-#define FIX_1_847759065 15137
-#define FIX_1_961570560 16069
-#define FIX_2_053119869 16819
-#define FIX_2_172734803 17799
-#define FIX_2_562915447 20995
-#define FIX_3_072711026 25172
-
-/*
- * Perform the inverse DCT on one block of coefficients.
- */
-
-void j_rev_dct(DCTBLOCK data)
-{
- int32_t tmp0, tmp1, tmp2, tmp3;
- int32_t tmp10, tmp11, tmp12, tmp13;
- int32_t z1, z2, z3, z4, z5;
- int32_t d0, d1, d2, d3, d4, d5, d6, d7;
- register DCTELEM *dataptr;
- int rowctr;
-
- /* Pass 1: process rows. */
- /* Note results are scaled up by sqrt(8) compared to a true IDCT; */
- /* furthermore, we scale the results by 2**PASS1_BITS. */
-
- dataptr = data;
-
- for (rowctr = DCTSIZE-1; rowctr >= 0; rowctr--) {
- /* Due to quantization, we will usually find that many of the input
- * coefficients are zero, especially the AC terms. We can exploit this
- * by short-circuiting the IDCT calculation for any row in which all
- * the AC terms are zero. In that case each output is equal to the
- * DC coefficient (with scale factor as needed).
- * With typical images and quantization tables, half or more of the
- * row DCT calculations can be simplified this way.
- */
-
- register int *idataptr = (int*)dataptr;
-
- /* WARNING: we do the same permutation as MMX idct to simplify the
- video core */
- d0 = dataptr[0];
- d2 = dataptr[1];
- d4 = dataptr[2];
- d6 = dataptr[3];
- d1 = dataptr[4];
- d3 = dataptr[5];
- d5 = dataptr[6];
- d7 = dataptr[7];
-
- if ((d1 | d2 | d3 | d4 | d5 | d6 | d7) == 0) {
- /* AC terms all zero */
- if (d0) {
- /* Compute a 32 bit value to assign. */
- DCTELEM dcval = (DCTELEM) (d0 << PASS1_BITS);
- register int v = (dcval & 0xffff) | ((dcval << 16) & 0xffff0000);
-
- idataptr[0] = v;
- idataptr[1] = v;
- idataptr[2] = v;
- idataptr[3] = v;
- }
-
- dataptr += DCTSIZE; /* advance pointer to next row */
- continue;
- }
-
- /* Even part: reverse the even part of the forward DCT. */
- /* The rotator is sqrt(2)*c(-6). */
-{
- if (d6) {
- if (d2) {
- /* d0 != 0, d2 != 0, d4 != 0, d6 != 0 */
- z1 = MULTIPLY(d2 + d6, FIX_0_541196100);
- tmp2 = z1 + MULTIPLY(-d6, FIX_1_847759065);
- tmp3 = z1 + MULTIPLY(d2, FIX_0_765366865);
-
- tmp0 = (d0 + d4) << CONST_BITS;
- tmp1 = (d0 - d4) << CONST_BITS;
-
- tmp10 = tmp0 + tmp3;
- tmp13 = tmp0 - tmp3;
- tmp11 = tmp1 + tmp2;
- tmp12 = tmp1 - tmp2;
- } else {
- /* d0 != 0, d2 == 0, d4 != 0, d6 != 0 */
- tmp2 = MULTIPLY(-d6, FIX_1_306562965);
- tmp3 = MULTIPLY(d6, FIX_0_541196100);
-
- tmp0 = (d0 + d4) << CONST_BITS;
- tmp1 = (d0 - d4) << CONST_BITS;
-
- tmp10 = tmp0 + tmp3;
- tmp13 = tmp0 - tmp3;
- tmp11 = tmp1 + tmp2;
- tmp12 = tmp1 - tmp2;
- }
- } else {
- if (d2) {
- /* d0 != 0, d2 != 0, d4 != 0, d6 == 0 */
- tmp2 = MULTIPLY(d2, FIX_0_541196100);
- tmp3 = MULTIPLY(d2, FIX_1_306562965);
-
- tmp0 = (d0 + d4) << CONST_BITS;
- tmp1 = (d0 - d4) << CONST_BITS;
-
- tmp10 = tmp0 + tmp3;
- tmp13 = tmp0 - tmp3;
- tmp11 = tmp1 + tmp2;
- tmp12 = tmp1 - tmp2;
- } else {
- /* d0 != 0, d2 == 0, d4 != 0, d6 == 0 */
- tmp10 = tmp13 = (d0 + d4) << CONST_BITS;
- tmp11 = tmp12 = (d0 - d4) << CONST_BITS;
- }
- }
-
- /* Odd part per figure 8; the matrix is unitary and hence its
- * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively.
- */
-
- if (d7) {
- if (d5) {
- if (d3) {
- if (d1) {
- /* d1 != 0, d3 != 0, d5 != 0, d7 != 0 */
- z1 = d7 + d1;
- z2 = d5 + d3;
- z3 = d7 + d3;
- z4 = d5 + d1;
- z5 = MULTIPLY(z3 + z4, FIX_1_175875602);
-
- tmp0 = MULTIPLY(d7, FIX_0_298631336);
- tmp1 = MULTIPLY(d5, FIX_2_053119869);
- tmp2 = MULTIPLY(d3, FIX_3_072711026);
- tmp3 = MULTIPLY(d1, FIX_1_501321110);
- z1 = MULTIPLY(-z1, FIX_0_899976223);
- z2 = MULTIPLY(-z2, FIX_2_562915447);
- z3 = MULTIPLY(-z3, FIX_1_961570560);
- z4 = MULTIPLY(-z4, FIX_0_390180644);
-
- z3 += z5;
- z4 += z5;
-
- tmp0 += z1 + z3;
- tmp1 += z2 + z4;
- tmp2 += z2 + z3;
- tmp3 += z1 + z4;
- } else {
- /* d1 == 0, d3 != 0, d5 != 0, d7 != 0 */
- z2 = d5 + d3;
- z3 = d7 + d3;
- z5 = MULTIPLY(z3 + d5, FIX_1_175875602);
-
- tmp0 = MULTIPLY(d7, FIX_0_298631336);
- tmp1 = MULTIPLY(d5, FIX_2_053119869);
- tmp2 = MULTIPLY(d3, FIX_3_072711026);
- z1 = MULTIPLY(-d7, FIX_0_899976223);
- z2 = MULTIPLY(-z2, FIX_2_562915447);
- z3 = MULTIPLY(-z3, FIX_1_961570560);
- z4 = MULTIPLY(-d5, FIX_0_390180644);
-
- z3 += z5;
- z4 += z5;
-
- tmp0 += z1 + z3;
- tmp1 += z2 + z4;
- tmp2 += z2 + z3;
- tmp3 = z1 + z4;
- }
- } else {
- if (d1) {
- /* d1 != 0, d3 == 0, d5 != 0, d7 != 0 */
- z1 = d7 + d1;
- z4 = d5 + d1;
- z5 = MULTIPLY(d7 + z4, FIX_1_175875602);
-
- tmp0 = MULTIPLY(d7, FIX_0_298631336);
- tmp1 = MULTIPLY(d5, FIX_2_053119869);
- tmp3 = MULTIPLY(d1, FIX_1_501321110);
- z1 = MULTIPLY(-z1, FIX_0_899976223);
- z2 = MULTIPLY(-d5, FIX_2_562915447);
- z3 = MULTIPLY(-d7, FIX_1_961570560);
- z4 = MULTIPLY(-z4, FIX_0_390180644);
-
- z3 += z5;
- z4 += z5;
-
- tmp0 += z1 + z3;
- tmp1 += z2 + z4;
- tmp2 = z2 + z3;
- tmp3 += z1 + z4;
- } else {
- /* d1 == 0, d3 == 0, d5 != 0, d7 != 0 */
- tmp0 = MULTIPLY(-d7, FIX_0_601344887);
- z1 = MULTIPLY(-d7, FIX_0_899976223);
- z3 = MULTIPLY(-d7, FIX_1_961570560);
- tmp1 = MULTIPLY(-d5, FIX_0_509795579);
- z2 = MULTIPLY(-d5, FIX_2_562915447);
- z4 = MULTIPLY(-d5, FIX_0_390180644);
- z5 = MULTIPLY(d5 + d7, FIX_1_175875602);
-
- z3 += z5;
- z4 += z5;
-
- tmp0 += z3;
- tmp1 += z4;
- tmp2 = z2 + z3;
- tmp3 = z1 + z4;
- }
- }
- } else {
- if (d3) {
- if (d1) {
- /* d1 != 0, d3 != 0, d5 == 0, d7 != 0 */
- z1 = d7 + d1;
- z3 = d7 + d3;
- z5 = MULTIPLY(z3 + d1, FIX_1_175875602);
-
- tmp0 = MULTIPLY(d7, FIX_0_298631336);
- tmp2 = MULTIPLY(d3, FIX_3_072711026);
- tmp3 = MULTIPLY(d1, FIX_1_501321110);
- z1 = MULTIPLY(-z1, FIX_0_899976223);
- z2 = MULTIPLY(-d3, FIX_2_562915447);
- z3 = MULTIPLY(-z3, FIX_1_961570560);
- z4 = MULTIPLY(-d1, FIX_0_390180644);
-
- z3 += z5;
- z4 += z5;
-
- tmp0 += z1 + z3;
- tmp1 = z2 + z4;
- tmp2 += z2 + z3;
- tmp3 += z1 + z4;
- } else {
- /* d1 == 0, d3 != 0, d5 == 0, d7 != 0 */
- z3 = d7 + d3;
-
- tmp0 = MULTIPLY(-d7, FIX_0_601344887);
- z1 = MULTIPLY(-d7, FIX_0_899976223);
- tmp2 = MULTIPLY(d3, FIX_0_509795579);
- z2 = MULTIPLY(-d3, FIX_2_562915447);
- z5 = MULTIPLY(z3, FIX_1_175875602);
- z3 = MULTIPLY(-z3, FIX_0_785694958);
-
- tmp0 += z3;
- tmp1 = z2 + z5;
- tmp2 += z3;
- tmp3 = z1 + z5;
- }
- } else {
- if (d1) {
- /* d1 != 0, d3 == 0, d5 == 0, d7 != 0 */
- z1 = d7 + d1;
- z5 = MULTIPLY(z1, FIX_1_175875602);
-
- z1 = MULTIPLY(z1, FIX_0_275899380);
- z3 = MULTIPLY(-d7, FIX_1_961570560);
- tmp0 = MULTIPLY(-d7, FIX_1_662939225);
- z4 = MULTIPLY(-d1, FIX_0_390180644);
- tmp3 = MULTIPLY(d1, FIX_1_111140466);
-
- tmp0 += z1;
- tmp1 = z4 + z5;
- tmp2 = z3 + z5;
- tmp3 += z1;
- } else {
- /* d1 == 0, d3 == 0, d5 == 0, d7 != 0 */
- tmp0 = MULTIPLY(-d7, FIX_1_387039845);
- tmp1 = MULTIPLY(d7, FIX_1_175875602);
- tmp2 = MULTIPLY(-d7, FIX_0_785694958);
- tmp3 = MULTIPLY(d7, FIX_0_275899380);
- }
- }
- }
- } else {
- if (d5) {
- if (d3) {
- if (d1) {
- /* d1 != 0, d3 != 0, d5 != 0, d7 == 0 */
- z2 = d5 + d3;
- z4 = d5 + d1;
- z5 = MULTIPLY(d3 + z4, FIX_1_175875602);
-
- tmp1 = MULTIPLY(d5, FIX_2_053119869);
- tmp2 = MULTIPLY(d3, FIX_3_072711026);
- tmp3 = MULTIPLY(d1, FIX_1_501321110);
- z1 = MULTIPLY(-d1, FIX_0_899976223);
- z2 = MULTIPLY(-z2, FIX_2_562915447);
- z3 = MULTIPLY(-d3, FIX_1_961570560);
- z4 = MULTIPLY(-z4, FIX_0_390180644);
-
- z3 += z5;
- z4 += z5;
-
- tmp0 = z1 + z3;
- tmp1 += z2 + z4;
- tmp2 += z2 + z3;
- tmp3 += z1 + z4;
- } else {
- /* d1 == 0, d3 != 0, d5 != 0, d7 == 0 */
- z2 = d5 + d3;
-
- z5 = MULTIPLY(z2, FIX_1_175875602);
- tmp1 = MULTIPLY(d5, FIX_1_662939225);
- z4 = MULTIPLY(-d5, FIX_0_390180644);
- z2 = MULTIPLY(-z2, FIX_1_387039845);
- tmp2 = MULTIPLY(d3, FIX_1_111140466);
- z3 = MULTIPLY(-d3, FIX_1_961570560);
-
- tmp0 = z3 + z5;
- tmp1 += z2;
- tmp2 += z2;
- tmp3 = z4 + z5;
- }
- } else {
- if (d1) {
- /* d1 != 0, d3 == 0, d5 != 0, d7 == 0 */
- z4 = d5 + d1;
-
- z5 = MULTIPLY(z4, FIX_1_175875602);
- z1 = MULTIPLY(-d1, FIX_0_899976223);
- tmp3 = MULTIPLY(d1, FIX_0_601344887);
- tmp1 = MULTIPLY(-d5, FIX_0_509795579);
- z2 = MULTIPLY(-d5, FIX_2_562915447);
- z4 = MULTIPLY(z4, FIX_0_785694958);
-
- tmp0 = z1 + z5;
- tmp1 += z4;
- tmp2 = z2 + z5;
- tmp3 += z4;
- } else {
- /* d1 == 0, d3 == 0, d5 != 0, d7 == 0 */
- tmp0 = MULTIPLY(d5, FIX_1_175875602);
- tmp1 = MULTIPLY(d5, FIX_0_275899380);
- tmp2 = MULTIPLY(-d5, FIX_1_387039845);
- tmp3 = MULTIPLY(d5, FIX_0_785694958);
- }
- }
- } else {
- if (d3) {
- if (d1) {
- /* d1 != 0, d3 != 0, d5 == 0, d7 == 0 */
- z5 = d1 + d3;
- tmp3 = MULTIPLY(d1, FIX_0_211164243);
- tmp2 = MULTIPLY(-d3, FIX_1_451774981);
- z1 = MULTIPLY(d1, FIX_1_061594337);
- z2 = MULTIPLY(-d3, FIX_2_172734803);
- z4 = MULTIPLY(z5, FIX_0_785694958);
- z5 = MULTIPLY(z5, FIX_1_175875602);
-
- tmp0 = z1 - z4;
- tmp1 = z2 + z4;
- tmp2 += z5;
- tmp3 += z5;
- } else {
- /* d1 == 0, d3 != 0, d5 == 0, d7 == 0 */
- tmp0 = MULTIPLY(-d3, FIX_0_785694958);
- tmp1 = MULTIPLY(-d3, FIX_1_387039845);
- tmp2 = MULTIPLY(-d3, FIX_0_275899380);
- tmp3 = MULTIPLY(d3, FIX_1_175875602);
- }
- } else {
- if (d1) {
- /* d1 != 0, d3 == 0, d5 == 0, d7 == 0 */
- tmp0 = MULTIPLY(d1, FIX_0_275899380);
- tmp1 = MULTIPLY(d1, FIX_0_785694958);
- tmp2 = MULTIPLY(d1, FIX_1_175875602);
- tmp3 = MULTIPLY(d1, FIX_1_387039845);
- } else {
- /* d1 == 0, d3 == 0, d5 == 0, d7 == 0 */
- tmp0 = tmp1 = tmp2 = tmp3 = 0;
- }
- }
- }
- }
-}
- /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
-
- dataptr[0] = (DCTELEM) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS);
- dataptr[7] = (DCTELEM) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS);
- dataptr[1] = (DCTELEM) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS);
- dataptr[6] = (DCTELEM) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS);
- dataptr[2] = (DCTELEM) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS);
- dataptr[5] = (DCTELEM) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS);
- dataptr[3] = (DCTELEM) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS);
- dataptr[4] = (DCTELEM) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS);
-
- dataptr += DCTSIZE; /* advance pointer to next row */
- }
-
- /* Pass 2: process columns. */
- /* Note that we must descale the results by a factor of 8 == 2**3, */
- /* and also undo the PASS1_BITS scaling. */
-
- dataptr = data;
- for (rowctr = DCTSIZE-1; rowctr >= 0; rowctr--) {
- /* Columns of zeroes can be exploited in the same way as we did with rows.
- * However, the row calculation has created many nonzero AC terms, so the
- * simplification applies less often (typically 5% to 10% of the time).
- * On machines with very fast multiplication, it's possible that the
- * test takes more time than it's worth. In that case this section
- * may be commented out.
- */
-
- d0 = dataptr[DCTSIZE*0];
- d1 = dataptr[DCTSIZE*1];
- d2 = dataptr[DCTSIZE*2];
- d3 = dataptr[DCTSIZE*3];
- d4 = dataptr[DCTSIZE*4];
- d5 = dataptr[DCTSIZE*5];
- d6 = dataptr[DCTSIZE*6];
- d7 = dataptr[DCTSIZE*7];
-
- /* Even part: reverse the even part of the forward DCT. */
- /* The rotator is sqrt(2)*c(-6). */
- if (d6) {
- if (d2) {
- /* d0 != 0, d2 != 0, d4 != 0, d6 != 0 */
- z1 = MULTIPLY(d2 + d6, FIX_0_541196100);
- tmp2 = z1 + MULTIPLY(-d6, FIX_1_847759065);
- tmp3 = z1 + MULTIPLY(d2, FIX_0_765366865);
-
- tmp0 = (d0 + d4) << CONST_BITS;
- tmp1 = (d0 - d4) << CONST_BITS;
-
- tmp10 = tmp0 + tmp3;
- tmp13 = tmp0 - tmp3;
- tmp11 = tmp1 + tmp2;
- tmp12 = tmp1 - tmp2;
- } else {
- /* d0 != 0, d2 == 0, d4 != 0, d6 != 0 */
- tmp2 = MULTIPLY(-d6, FIX_1_306562965);
- tmp3 = MULTIPLY(d6, FIX_0_541196100);
-
- tmp0 = (d0 + d4) << CONST_BITS;
- tmp1 = (d0 - d4) << CONST_BITS;
-
- tmp10 = tmp0 + tmp3;
- tmp13 = tmp0 - tmp3;
- tmp11 = tmp1 + tmp2;
- tmp12 = tmp1 - tmp2;
- }
- } else {
- if (d2) {
- /* d0 != 0, d2 != 0, d4 != 0, d6 == 0 */
- tmp2 = MULTIPLY(d2, FIX_0_541196100);
- tmp3 = MULTIPLY(d2, FIX_1_306562965);
-
- tmp0 = (d0 + d4) << CONST_BITS;
- tmp1 = (d0 - d4) << CONST_BITS;
-
- tmp10 = tmp0 + tmp3;
- tmp13 = tmp0 - tmp3;
- tmp11 = tmp1 + tmp2;
- tmp12 = tmp1 - tmp2;
- } else {
- /* d0 != 0, d2 == 0, d4 != 0, d6 == 0 */
- tmp10 = tmp13 = (d0 + d4) << CONST_BITS;
- tmp11 = tmp12 = (d0 - d4) << CONST_BITS;
- }
- }
-
- /* Odd part per figure 8; the matrix is unitary and hence its
- * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively.
- */
- if (d7) {
- if (d5) {
- if (d3) {
- if (d1) {
- /* d1 != 0, d3 != 0, d5 != 0, d7 != 0 */
- z1 = d7 + d1;
- z2 = d5 + d3;
- z3 = d7 + d3;
- z4 = d5 + d1;
- z5 = MULTIPLY(z3 + z4, FIX_1_175875602);
-
- tmp0 = MULTIPLY(d7, FIX_0_298631336);
- tmp1 = MULTIPLY(d5, FIX_2_053119869);
- tmp2 = MULTIPLY(d3, FIX_3_072711026);
- tmp3 = MULTIPLY(d1, FIX_1_501321110);
- z1 = MULTIPLY(-z1, FIX_0_899976223);
- z2 = MULTIPLY(-z2, FIX_2_562915447);
- z3 = MULTIPLY(-z3, FIX_1_961570560);
- z4 = MULTIPLY(-z4, FIX_0_390180644);
-
- z3 += z5;
- z4 += z5;
-
- tmp0 += z1 + z3;
- tmp1 += z2 + z4;
- tmp2 += z2 + z3;
- tmp3 += z1 + z4;
- } else {
- /* d1 == 0, d3 != 0, d5 != 0, d7 != 0 */
- z1 = d7;
- z2 = d5 + d3;
- z3 = d7 + d3;
- z5 = MULTIPLY(z3 + d5, FIX_1_175875602);
-
- tmp0 = MULTIPLY(d7, FIX_0_298631336);
- tmp1 = MULTIPLY(d5, FIX_2_053119869);
- tmp2 = MULTIPLY(d3, FIX_3_072711026);
- z1 = MULTIPLY(-d7, FIX_0_899976223);
- z2 = MULTIPLY(-z2, FIX_2_562915447);
- z3 = MULTIPLY(-z3, FIX_1_961570560);
- z4 = MULTIPLY(-d5, FIX_0_390180644);
-
- z3 += z5;
- z4 += z5;
-
- tmp0 += z1 + z3;
- tmp1 += z2 + z4;
- tmp2 += z2 + z3;
- tmp3 = z1 + z4;
- }
- } else {
- if (d1) {
- /* d1 != 0, d3 == 0, d5 != 0, d7 != 0 */
- z1 = d7 + d1;
- z2 = d5;
- z3 = d7;
- z4 = d5 + d1;
- z5 = MULTIPLY(z3 + z4, FIX_1_175875602);
-
- tmp0 = MULTIPLY(d7, FIX_0_298631336);
- tmp1 = MULTIPLY(d5, FIX_2_053119869);
- tmp3 = MULTIPLY(d1, FIX_1_501321110);
- z1 = MULTIPLY(-z1, FIX_0_899976223);
- z2 = MULTIPLY(-d5, FIX_2_562915447);
- z3 = MULTIPLY(-d7, FIX_1_961570560);
- z4 = MULTIPLY(-z4, FIX_0_390180644);
-
- z3 += z5;
- z4 += z5;
-
- tmp0 += z1 + z3;
- tmp1 += z2 + z4;
- tmp2 = z2 + z3;
- tmp3 += z1 + z4;
- } else {
- /* d1 == 0, d3 == 0, d5 != 0, d7 != 0 */
- tmp0 = MULTIPLY(-d7, FIX_0_601344887);
- z1 = MULTIPLY(-d7, FIX_0_899976223);
- z3 = MULTIPLY(-d7, FIX_1_961570560);
- tmp1 = MULTIPLY(-d5, FIX_0_509795579);
- z2 = MULTIPLY(-d5, FIX_2_562915447);
- z4 = MULTIPLY(-d5, FIX_0_390180644);
- z5 = MULTIPLY(d5 + d7, FIX_1_175875602);
-
- z3 += z5;
- z4 += z5;
-
- tmp0 += z3;
- tmp1 += z4;
- tmp2 = z2 + z3;
- tmp3 = z1 + z4;
- }
- }
- } else {
- if (d3) {
- if (d1) {
- /* d1 != 0, d3 != 0, d5 == 0, d7 != 0 */
- z1 = d7 + d1;
- z3 = d7 + d3;
- z5 = MULTIPLY(z3 + d1, FIX_1_175875602);
-
- tmp0 = MULTIPLY(d7, FIX_0_298631336);
- tmp2 = MULTIPLY(d3, FIX_3_072711026);
- tmp3 = MULTIPLY(d1, FIX_1_501321110);
- z1 = MULTIPLY(-z1, FIX_0_899976223);
- z2 = MULTIPLY(-d3, FIX_2_562915447);
- z3 = MULTIPLY(-z3, FIX_1_961570560);
- z4 = MULTIPLY(-d1, FIX_0_390180644);
-
- z3 += z5;
- z4 += z5;
-
- tmp0 += z1 + z3;
- tmp1 = z2 + z4;
- tmp2 += z2 + z3;
- tmp3 += z1 + z4;
- } else {
- /* d1 == 0, d3 != 0, d5 == 0, d7 != 0 */
- z3 = d7 + d3;
-
- tmp0 = MULTIPLY(-d7, FIX_0_601344887);
- z1 = MULTIPLY(-d7, FIX_0_899976223);
- tmp2 = MULTIPLY(d3, FIX_0_509795579);
- z2 = MULTIPLY(-d3, FIX_2_562915447);
- z5 = MULTIPLY(z3, FIX_1_175875602);
- z3 = MULTIPLY(-z3, FIX_0_785694958);
-
- tmp0 += z3;
- tmp1 = z2 + z5;
- tmp2 += z3;
- tmp3 = z1 + z5;
- }
- } else {
- if (d1) {
- /* d1 != 0, d3 == 0, d5 == 0, d7 != 0 */
- z1 = d7 + d1;
- z5 = MULTIPLY(z1, FIX_1_175875602);
-
- z1 = MULTIPLY(z1, FIX_0_275899380);
- z3 = MULTIPLY(-d7, FIX_1_961570560);
- tmp0 = MULTIPLY(-d7, FIX_1_662939225);
- z4 = MULTIPLY(-d1, FIX_0_390180644);
- tmp3 = MULTIPLY(d1, FIX_1_111140466);
-
- tmp0 += z1;
- tmp1 = z4 + z5;
- tmp2 = z3 + z5;
- tmp3 += z1;
- } else {
- /* d1 == 0, d3 == 0, d5 == 0, d7 != 0 */
- tmp0 = MULTIPLY(-d7, FIX_1_387039845);
- tmp1 = MULTIPLY(d7, FIX_1_175875602);
- tmp2 = MULTIPLY(-d7, FIX_0_785694958);
- tmp3 = MULTIPLY(d7, FIX_0_275899380);
- }
- }
- }
- } else {
- if (d5) {
- if (d3) {
- if (d1) {
- /* d1 != 0, d3 != 0, d5 != 0, d7 == 0 */
- z2 = d5 + d3;
- z4 = d5 + d1;
- z5 = MULTIPLY(d3 + z4, FIX_1_175875602);
-
- tmp1 = MULTIPLY(d5, FIX_2_053119869);
- tmp2 = MULTIPLY(d3, FIX_3_072711026);
- tmp3 = MULTIPLY(d1, FIX_1_501321110);
- z1 = MULTIPLY(-d1, FIX_0_899976223);
- z2 = MULTIPLY(-z2, FIX_2_562915447);
- z3 = MULTIPLY(-d3, FIX_1_961570560);
- z4 = MULTIPLY(-z4, FIX_0_390180644);
-
- z3 += z5;
- z4 += z5;
-
- tmp0 = z1 + z3;
- tmp1 += z2 + z4;
- tmp2 += z2 + z3;
- tmp3 += z1 + z4;
- } else {
- /* d1 == 0, d3 != 0, d5 != 0, d7 == 0 */
- z2 = d5 + d3;
-
- z5 = MULTIPLY(z2, FIX_1_175875602);
- tmp1 = MULTIPLY(d5, FIX_1_662939225);
- z4 = MULTIPLY(-d5, FIX_0_390180644);
- z2 = MULTIPLY(-z2, FIX_1_387039845);
- tmp2 = MULTIPLY(d3, FIX_1_111140466);
- z3 = MULTIPLY(-d3, FIX_1_961570560);
-
- tmp0 = z3 + z5;
- tmp1 += z2;
- tmp2 += z2;
- tmp3 = z4 + z5;
- }
- } else {
- if (d1) {
- /* d1 != 0, d3 == 0, d5 != 0, d7 == 0 */
- z4 = d5 + d1;
-
- z5 = MULTIPLY(z4, FIX_1_175875602);
- z1 = MULTIPLY(-d1, FIX_0_899976223);
- tmp3 = MULTIPLY(d1, FIX_0_601344887);
- tmp1 = MULTIPLY(-d5, FIX_0_509795579);
- z2 = MULTIPLY(-d5, FIX_2_562915447);
- z4 = MULTIPLY(z4, FIX_0_785694958);
-
- tmp0 = z1 + z5;
- tmp1 += z4;
- tmp2 = z2 + z5;
- tmp3 += z4;
- } else {
- /* d1 == 0, d3 == 0, d5 != 0, d7 == 0 */
- tmp0 = MULTIPLY(d5, FIX_1_175875602);
- tmp1 = MULTIPLY(d5, FIX_0_275899380);
- tmp2 = MULTIPLY(-d5, FIX_1_387039845);
- tmp3 = MULTIPLY(d5, FIX_0_785694958);
- }
- }
- } else {
- if (d3) {
- if (d1) {
- /* d1 != 0, d3 != 0, d5 == 0, d7 == 0 */
- z5 = d1 + d3;
- tmp3 = MULTIPLY(d1, FIX_0_211164243);
- tmp2 = MULTIPLY(-d3, FIX_1_451774981);
- z1 = MULTIPLY(d1, FIX_1_061594337);
- z2 = MULTIPLY(-d3, FIX_2_172734803);
- z4 = MULTIPLY(z5, FIX_0_785694958);
- z5 = MULTIPLY(z5, FIX_1_175875602);
-
- tmp0 = z1 - z4;
- tmp1 = z2 + z4;
- tmp2 += z5;
- tmp3 += z5;
- } else {
- /* d1 == 0, d3 != 0, d5 == 0, d7 == 0 */
- tmp0 = MULTIPLY(-d3, FIX_0_785694958);
- tmp1 = MULTIPLY(-d3, FIX_1_387039845);
- tmp2 = MULTIPLY(-d3, FIX_0_275899380);
- tmp3 = MULTIPLY(d3, FIX_1_175875602);
- }
- } else {
- if (d1) {
- /* d1 != 0, d3 == 0, d5 == 0, d7 == 0 */
- tmp0 = MULTIPLY(d1, FIX_0_275899380);
- tmp1 = MULTIPLY(d1, FIX_0_785694958);
- tmp2 = MULTIPLY(d1, FIX_1_175875602);
- tmp3 = MULTIPLY(d1, FIX_1_387039845);
- } else {
- /* d1 == 0, d3 == 0, d5 == 0, d7 == 0 */
- tmp0 = tmp1 = tmp2 = tmp3 = 0;
- }
- }
- }
- }
-
- /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
-
- dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp3,
- CONST_BITS+PASS1_BITS+3);
- dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp10 - tmp3,
- CONST_BITS+PASS1_BITS+3);
- dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp11 + tmp2,
- CONST_BITS+PASS1_BITS+3);
- dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(tmp11 - tmp2,
- CONST_BITS+PASS1_BITS+3);
- dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(tmp12 + tmp1,
- CONST_BITS+PASS1_BITS+3);
- dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp12 - tmp1,
- CONST_BITS+PASS1_BITS+3);
- dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp13 + tmp0,
- CONST_BITS+PASS1_BITS+3);
- dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp13 - tmp0,
- CONST_BITS+PASS1_BITS+3);
-
- dataptr++; /* advance pointer to next column */
- }
-}
-
-#undef DCTSIZE
-#define DCTSIZE 4
-#define DCTSTRIDE 8
-
-void j_rev_dct4(DCTBLOCK data)
-{
- int32_t tmp0, tmp1, tmp2, tmp3;
- int32_t tmp10, tmp11, tmp12, tmp13;
- int32_t z1;
- int32_t d0, d2, d4, d6;
- register DCTELEM *dataptr;
- int rowctr;
-
- /* Pass 1: process rows. */
- /* Note results are scaled up by sqrt(8) compared to a true IDCT; */
- /* furthermore, we scale the results by 2**PASS1_BITS. */
-
- data[0] += 4;
-
- dataptr = data;
-
- for (rowctr = DCTSIZE-1; rowctr >= 0; rowctr--) {
- /* Due to quantization, we will usually find that many of the input
- * coefficients are zero, especially the AC terms. We can exploit this
- * by short-circuiting the IDCT calculation for any row in which all
- * the AC terms are zero. In that case each output is equal to the
- * DC coefficient (with scale factor as needed).
- * With typical images and quantization tables, half or more of the
- * row DCT calculations can be simplified this way.
- */
-
- register int *idataptr = (int*)dataptr;
-
- d0 = dataptr[0];
- d2 = dataptr[1];
- d4 = dataptr[2];
- d6 = dataptr[3];
-
- if ((d2 | d4 | d6) == 0) {
- /* AC terms all zero */
- if (d0) {
- /* Compute a 32 bit value to assign. */
- DCTELEM dcval = (DCTELEM) (d0 << PASS1_BITS);
- register int v = (dcval & 0xffff) | ((dcval << 16) & 0xffff0000);
-
- idataptr[0] = v;
- idataptr[1] = v;
- }
-
- dataptr += DCTSTRIDE; /* advance pointer to next row */
- continue;
- }
-
- /* Even part: reverse the even part of the forward DCT. */
- /* The rotator is sqrt(2)*c(-6). */
- if (d6) {
- if (d2) {
- /* d0 != 0, d2 != 0, d4 != 0, d6 != 0 */
- z1 = MULTIPLY(d2 + d6, FIX_0_541196100);
- tmp2 = z1 + MULTIPLY(-d6, FIX_1_847759065);
- tmp3 = z1 + MULTIPLY(d2, FIX_0_765366865);
-
- tmp0 = (d0 + d4) << CONST_BITS;
- tmp1 = (d0 - d4) << CONST_BITS;
-
- tmp10 = tmp0 + tmp3;
- tmp13 = tmp0 - tmp3;
- tmp11 = tmp1 + tmp2;
- tmp12 = tmp1 - tmp2;
- } else {
- /* d0 != 0, d2 == 0, d4 != 0, d6 != 0 */
- tmp2 = MULTIPLY(-d6, FIX_1_306562965);
- tmp3 = MULTIPLY(d6, FIX_0_541196100);
-
- tmp0 = (d0 + d4) << CONST_BITS;
- tmp1 = (d0 - d4) << CONST_BITS;
-
- tmp10 = tmp0 + tmp3;
- tmp13 = tmp0 - tmp3;
- tmp11 = tmp1 + tmp2;
- tmp12 = tmp1 - tmp2;
- }
- } else {
- if (d2) {
- /* d0 != 0, d2 != 0, d4 != 0, d6 == 0 */
- tmp2 = MULTIPLY(d2, FIX_0_541196100);
- tmp3 = MULTIPLY(d2, FIX_1_306562965);
-
- tmp0 = (d0 + d4) << CONST_BITS;
- tmp1 = (d0 - d4) << CONST_BITS;
-
- tmp10 = tmp0 + tmp3;
- tmp13 = tmp0 - tmp3;
- tmp11 = tmp1 + tmp2;
- tmp12 = tmp1 - tmp2;
- } else {
- /* d0 != 0, d2 == 0, d4 != 0, d6 == 0 */
- tmp10 = tmp13 = (d0 + d4) << CONST_BITS;
- tmp11 = tmp12 = (d0 - d4) << CONST_BITS;
- }
- }
-
- /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
-
- dataptr[0] = (DCTELEM) DESCALE(tmp10, CONST_BITS-PASS1_BITS);
- dataptr[1] = (DCTELEM) DESCALE(tmp11, CONST_BITS-PASS1_BITS);
- dataptr[2] = (DCTELEM) DESCALE(tmp12, CONST_BITS-PASS1_BITS);
- dataptr[3] = (DCTELEM) DESCALE(tmp13, CONST_BITS-PASS1_BITS);
-
- dataptr += DCTSTRIDE; /* advance pointer to next row */
- }
-
- /* Pass 2: process columns. */
- /* Note that we must descale the results by a factor of 8 == 2**3, */
- /* and also undo the PASS1_BITS scaling. */
-
- dataptr = data;
- for (rowctr = DCTSIZE-1; rowctr >= 0; rowctr--) {
- /* Columns of zeroes can be exploited in the same way as we did with rows.
- * However, the row calculation has created many nonzero AC terms, so the
- * simplification applies less often (typically 5% to 10% of the time).
- * On machines with very fast multiplication, it's possible that the
- * test takes more time than it's worth. In that case this section
- * may be commented out.
- */
-
- d0 = dataptr[DCTSTRIDE*0];
- d2 = dataptr[DCTSTRIDE*1];
- d4 = dataptr[DCTSTRIDE*2];
- d6 = dataptr[DCTSTRIDE*3];
-
- /* Even part: reverse the even part of the forward DCT. */
- /* The rotator is sqrt(2)*c(-6). */
- if (d6) {
- if (d2) {
- /* d0 != 0, d2 != 0, d4 != 0, d6 != 0 */
- z1 = MULTIPLY(d2 + d6, FIX_0_541196100);
- tmp2 = z1 + MULTIPLY(-d6, FIX_1_847759065);
- tmp3 = z1 + MULTIPLY(d2, FIX_0_765366865);
-
- tmp0 = (d0 + d4) << CONST_BITS;
- tmp1 = (d0 - d4) << CONST_BITS;
-
- tmp10 = tmp0 + tmp3;
- tmp13 = tmp0 - tmp3;
- tmp11 = tmp1 + tmp2;
- tmp12 = tmp1 - tmp2;
- } else {
- /* d0 != 0, d2 == 0, d4 != 0, d6 != 0 */
- tmp2 = MULTIPLY(-d6, FIX_1_306562965);
- tmp3 = MULTIPLY(d6, FIX_0_541196100);
-
- tmp0 = (d0 + d4) << CONST_BITS;
- tmp1 = (d0 - d4) << CONST_BITS;
-
- tmp10 = tmp0 + tmp3;
- tmp13 = tmp0 - tmp3;
- tmp11 = tmp1 + tmp2;
- tmp12 = tmp1 - tmp2;
- }
- } else {
- if (d2) {
- /* d0 != 0, d2 != 0, d4 != 0, d6 == 0 */
- tmp2 = MULTIPLY(d2, FIX_0_541196100);
- tmp3 = MULTIPLY(d2, FIX_1_306562965);
-
- tmp0 = (d0 + d4) << CONST_BITS;
- tmp1 = (d0 - d4) << CONST_BITS;
-
- tmp10 = tmp0 + tmp3;
- tmp13 = tmp0 - tmp3;
- tmp11 = tmp1 + tmp2;
- tmp12 = tmp1 - tmp2;
- } else {
- /* d0 != 0, d2 == 0, d4 != 0, d6 == 0 */
- tmp10 = tmp13 = (d0 + d4) << CONST_BITS;
- tmp11 = tmp12 = (d0 - d4) << CONST_BITS;
- }
- }
-
- /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
-
- dataptr[DCTSTRIDE*0] = tmp10 >> (CONST_BITS+PASS1_BITS+3);
- dataptr[DCTSTRIDE*1] = tmp11 >> (CONST_BITS+PASS1_BITS+3);
- dataptr[DCTSTRIDE*2] = tmp12 >> (CONST_BITS+PASS1_BITS+3);
- dataptr[DCTSTRIDE*3] = tmp13 >> (CONST_BITS+PASS1_BITS+3);
-
- dataptr++; /* advance pointer to next column */
- }
-}
-
-void j_rev_dct2(DCTBLOCK data){
- int d00, d01, d10, d11;
-
- data[0] += 4;
- d00 = data[0+0*DCTSTRIDE] + data[1+0*DCTSTRIDE];
- d01 = data[0+0*DCTSTRIDE] - data[1+0*DCTSTRIDE];
- d10 = data[0+1*DCTSTRIDE] + data[1+1*DCTSTRIDE];
- d11 = data[0+1*DCTSTRIDE] - data[1+1*DCTSTRIDE];
-
- data[0+0*DCTSTRIDE]= (d00 + d10)>>3;
- data[1+0*DCTSTRIDE]= (d01 + d11)>>3;
- data[0+1*DCTSTRIDE]= (d00 - d10)>>3;
- data[1+1*DCTSTRIDE]= (d01 - d11)>>3;
-}
-
-void j_rev_dct1(DCTBLOCK data){
- data[0] = (data[0] + 4)>>3;
-}
-
-#undef FIX
-#undef CONST_BITS
diff --git a/src/libffmpeg/libavcodec/kmvc.c b/src/libffmpeg/libavcodec/kmvc.c
deleted file mode 100644
index 28dc01483..000000000
--- a/src/libffmpeg/libavcodec/kmvc.c
+++ /dev/null
@@ -1,417 +0,0 @@
-/*
- * KMVC decoder
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file kmvc.c
- * Karl Morton's Video Codec decoder
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "common.h"
-#include "avcodec.h"
-
-#define KMVC_KEYFRAME 0x80
-#define KMVC_PALETTE 0x40
-#define KMVC_METHOD 0x0F
-
-/*
- * Decoder context
- */
-typedef struct KmvcContext {
- AVCodecContext *avctx;
- AVFrame pic;
-
- int setpal;
- int palsize;
- uint32_t pal[256];
- uint8_t *cur, *prev;
- uint8_t *frm0, *frm1;
-} KmvcContext;
-
-typedef struct BitBuf {
- int bits;
- int bitbuf;
-} BitBuf;
-
-#define BLK(data, x, y) data[(x) + (y) * 320]
-
-#define kmvc_init_getbits(bb, src) bb.bits = 7; bb.bitbuf = *src++;
-
-#define kmvc_getbit(bb, src, res) {\
- res = 0; \
- if (bb.bitbuf & (1 << bb.bits)) res = 1; \
- bb.bits--; \
- if(bb.bits == -1) { \
- bb.bitbuf = *src++; \
- bb.bits = 7; \
- } \
-}
-
-static void kmvc_decode_intra_8x8(KmvcContext * ctx, uint8_t * src, int w, int h)
-{
- BitBuf bb;
- int res, val;
- int i, j;
- int bx, by;
- int l0x, l1x, l0y, l1y;
- int mx, my;
-
- kmvc_init_getbits(bb, src);
-
- for (by = 0; by < h; by += 8)
- for (bx = 0; bx < w; bx += 8) {
- kmvc_getbit(bb, src, res);
- if (!res) { // fill whole 8x8 block
- val = *src++;
- for (i = 0; i < 64; i++)
- BLK(ctx->cur, bx + (i & 0x7), by + (i >> 3)) = val;
- } else { // handle four 4x4 subblocks
- for (i = 0; i < 4; i++) {
- l0x = bx + (i & 1) * 4;
- l0y = by + (i & 2) * 2;
- kmvc_getbit(bb, src, res);
- if (!res) {
- kmvc_getbit(bb, src, res);
- if (!res) { // fill whole 4x4 block
- val = *src++;
- for (j = 0; j < 16; j++)
- BLK(ctx->cur, l0x + (j & 3), l0y + (j >> 2)) = val;
- } else { // copy block from already decoded place
- val = *src++;
- mx = val & 0xF;
- my = val >> 4;
- for (j = 0; j < 16; j++)
- BLK(ctx->cur, l0x + (j & 3), l0y + (j >> 2)) =
- BLK(ctx->cur, l0x + (j & 3) - mx, l0y + (j >> 2) - my);
- }
- } else { // descend to 2x2 sub-sub-blocks
- for (j = 0; j < 4; j++) {
- l1x = l0x + (j & 1) * 2;
- l1y = l0y + (j & 2);
- kmvc_getbit(bb, src, res);
- if (!res) {
- kmvc_getbit(bb, src, res);
- if (!res) { // fill whole 2x2 block
- val = *src++;
- BLK(ctx->cur, l1x, l1y) = val;
- BLK(ctx->cur, l1x + 1, l1y) = val;
- BLK(ctx->cur, l1x, l1y + 1) = val;
- BLK(ctx->cur, l1x + 1, l1y + 1) = val;
- } else { // copy block from already decoded place
- val = *src++;
- mx = val & 0xF;
- my = val >> 4;
- BLK(ctx->cur, l1x, l1y) = BLK(ctx->cur, l1x - mx, l1y - my);
- BLK(ctx->cur, l1x + 1, l1y) =
- BLK(ctx->cur, l1x + 1 - mx, l1y - my);
- BLK(ctx->cur, l1x, l1y + 1) =
- BLK(ctx->cur, l1x - mx, l1y + 1 - my);
- BLK(ctx->cur, l1x + 1, l1y + 1) =
- BLK(ctx->cur, l1x + 1 - mx, l1y + 1 - my);
- }
- } else { // read values for block
- BLK(ctx->cur, l1x, l1y) = *src++;
- BLK(ctx->cur, l1x + 1, l1y) = *src++;
- BLK(ctx->cur, l1x, l1y + 1) = *src++;
- BLK(ctx->cur, l1x + 1, l1y + 1) = *src++;
- }
- }
- }
- }
- }
- }
-}
-
-static void kmvc_decode_inter_8x8(KmvcContext * ctx, uint8_t * src, int w, int h)
-{
- BitBuf bb;
- int res, val;
- int i, j;
- int bx, by;
- int l0x, l1x, l0y, l1y;
- int mx, my;
-
- kmvc_init_getbits(bb, src);
-
- for (by = 0; by < h; by += 8)
- for (bx = 0; bx < w; bx += 8) {
- kmvc_getbit(bb, src, res);
- if (!res) {
- kmvc_getbit(bb, src, res);
- if (!res) { // fill whole 8x8 block
- val = *src++;
- for (i = 0; i < 64; i++)
- BLK(ctx->cur, bx + (i & 0x7), by + (i >> 3)) = val;
- } else { // copy block from previous frame
- for (i = 0; i < 64; i++)
- BLK(ctx->cur, bx + (i & 0x7), by + (i >> 3)) =
- BLK(ctx->prev, bx + (i & 0x7), by + (i >> 3));
- }
- } else { // handle four 4x4 subblocks
- for (i = 0; i < 4; i++) {
- l0x = bx + (i & 1) * 4;
- l0y = by + (i & 2) * 2;
- kmvc_getbit(bb, src, res);
- if (!res) {
- kmvc_getbit(bb, src, res);
- if (!res) { // fill whole 4x4 block
- val = *src++;
- for (j = 0; j < 16; j++)
- BLK(ctx->cur, l0x + (j & 3), l0y + (j >> 2)) = val;
- } else { // copy block
- val = *src++;
- mx = (val & 0xF) - 8;
- my = (val >> 4) - 8;
- for (j = 0; j < 16; j++)
- BLK(ctx->cur, l0x + (j & 3), l0y + (j >> 2)) =
- BLK(ctx->prev, l0x + (j & 3) + mx, l0y + (j >> 2) + my);
- }
- } else { // descend to 2x2 sub-sub-blocks
- for (j = 0; j < 4; j++) {
- l1x = l0x + (j & 1) * 2;
- l1y = l0y + (j & 2);
- kmvc_getbit(bb, src, res);
- if (!res) {
- kmvc_getbit(bb, src, res);
- if (!res) { // fill whole 2x2 block
- val = *src++;
- BLK(ctx->cur, l1x, l1y) = val;
- BLK(ctx->cur, l1x + 1, l1y) = val;
- BLK(ctx->cur, l1x, l1y + 1) = val;
- BLK(ctx->cur, l1x + 1, l1y + 1) = val;
- } else { // copy block
- val = *src++;
- mx = (val & 0xF) - 8;
- my = (val >> 4) - 8;
- BLK(ctx->cur, l1x, l1y) = BLK(ctx->prev, l1x + mx, l1y + my);
- BLK(ctx->cur, l1x + 1, l1y) =
- BLK(ctx->prev, l1x + 1 + mx, l1y + my);
- BLK(ctx->cur, l1x, l1y + 1) =
- BLK(ctx->prev, l1x + mx, l1y + 1 + my);
- BLK(ctx->cur, l1x + 1, l1y + 1) =
- BLK(ctx->prev, l1x + 1 + mx, l1y + 1 + my);
- }
- } else { // read values for block
- BLK(ctx->cur, l1x, l1y) = *src++;
- BLK(ctx->cur, l1x + 1, l1y) = *src++;
- BLK(ctx->cur, l1x, l1y + 1) = *src++;
- BLK(ctx->cur, l1x + 1, l1y + 1) = *src++;
- }
- }
- }
- }
- }
- }
-}
-
-static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, uint8_t * buf,
- int buf_size)
-{
- KmvcContext *const ctx = (KmvcContext *) avctx->priv_data;
- uint8_t *out, *src;
- int i;
- int header;
- int blocksize;
-
- if (ctx->pic.data[0])
- avctx->release_buffer(avctx, &ctx->pic);
-
- ctx->pic.reference = 1;
- ctx->pic.buffer_hints = FF_BUFFER_HINTS_VALID;
- if (avctx->get_buffer(avctx, &ctx->pic) < 0) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
-
- header = *buf++;
-
- /* blocksize 127 is really palette change event */
- if (buf[0] == 127) {
- buf += 3;
- for (i = 0; i < 127; i++) {
- ctx->pal[i + (header & 0x81)] = (buf[0] << 16) | (buf[1] << 8) | buf[2];
- buf += 4;
- }
- buf -= 127 * 4 + 3;
- }
-
- if (header & KMVC_KEYFRAME) {
- ctx->pic.key_frame = 1;
- ctx->pic.pict_type = FF_I_TYPE;
- } else {
- ctx->pic.key_frame = 0;
- ctx->pic.pict_type = FF_P_TYPE;
- }
-
- /* if palette has been changed, copy it from palctrl */
- if (ctx->avctx->palctrl && ctx->avctx->palctrl->palette_changed) {
- memcpy(ctx->pal, ctx->avctx->palctrl->palette, AVPALETTE_SIZE);
- ctx->setpal = 1;
- ctx->avctx->palctrl->palette_changed = 0;
- }
-
- if (header & KMVC_PALETTE) {
- ctx->pic.palette_has_changed = 1;
- // palette starts from index 1 and has 127 entries
- for (i = 1; i <= ctx->palsize; i++) {
- ctx->pal[i] = (buf[0] << 16) | (buf[1] << 8) | buf[2];
- buf += 3;
- }
- }
-
- if (ctx->setpal) {
- ctx->setpal = 0;
- ctx->pic.palette_has_changed = 1;
- }
-
- /* make the palette available on the way out */
- memcpy(ctx->pic.data[1], ctx->pal, 1024);
-
- blocksize = *buf++;
-
- if (blocksize != 8 && blocksize != 127) {
- av_log(avctx, AV_LOG_ERROR, "Block size = %i\n", blocksize);
- return -1;
- }
- memset(ctx->cur, 0, 320 * 200);
- switch (header & KMVC_METHOD) {
- case 0:
- case 1: // used in palette changed event
- memcpy(ctx->cur, ctx->prev, 320 * 200);
- break;
- case 3:
- kmvc_decode_intra_8x8(ctx, buf, avctx->width, avctx->height);
- break;
- case 4:
- kmvc_decode_inter_8x8(ctx, buf, avctx->width, avctx->height);
- break;
- default:
- av_log(avctx, AV_LOG_ERROR, "Unknown compression method %i\n", header & KMVC_METHOD);
- return -1;
- }
-
- out = ctx->pic.data[0];
- src = ctx->cur;
- for (i = 0; i < avctx->height; i++) {
- memcpy(out, src, avctx->width);
- src += 320;
- out += ctx->pic.linesize[0];
- }
-
- /* flip buffers */
- if (ctx->cur == ctx->frm0) {
- ctx->cur = ctx->frm1;
- ctx->prev = ctx->frm0;
- } else {
- ctx->cur = ctx->frm0;
- ctx->prev = ctx->frm1;
- }
-
- *data_size = sizeof(AVFrame);
- *(AVFrame *) data = ctx->pic;
-
- /* always report that the buffer was completely consumed */
- return buf_size;
-}
-
-
-
-/*
- * Init kmvc decoder
- */
-static int decode_init(AVCodecContext * avctx)
-{
- KmvcContext *const c = (KmvcContext *) avctx->priv_data;
- int i;
-
- c->avctx = avctx;
- avctx->has_b_frames = 0;
-
- c->pic.data[0] = NULL;
-
- if (avctx->width > 320 || avctx->height > 200) {
- av_log(avctx, AV_LOG_ERROR, "KMVC supports frames <= 320x200\n");
- return -1;
- }
-
- c->frm0 = av_mallocz(320 * 200);
- c->frm1 = av_mallocz(320 * 200);
- c->cur = c->frm0;
- c->prev = c->frm1;
-
- for (i = 0; i < 256; i++) {
- c->pal[i] = i * 0x10101;
- }
-
- if (avctx->extradata_size < 12) {
- av_log(NULL, 0, "Extradata missing, decoding may not work properly...\n");
- c->palsize = 127;
- } else {
- c->palsize = AV_RL16(avctx->extradata + 10);
- }
-
- if (avctx->extradata_size == 1036) { // palette in extradata
- uint8_t *src = avctx->extradata + 12;
- for (i = 0; i < 256; i++) {
- c->pal[i] = AV_RL32(src);
- src += 4;
- }
- c->setpal = 1;
- if (c->avctx->palctrl) {
- c->avctx->palctrl->palette_changed = 0;
- }
- }
-
- avctx->pix_fmt = PIX_FMT_PAL8;
-
- return 0;
-}
-
-
-
-/*
- * Uninit kmvc decoder
- */
-static int decode_end(AVCodecContext * avctx)
-{
- KmvcContext *const c = (KmvcContext *) avctx->priv_data;
-
- av_freep(&c->frm0);
- av_freep(&c->frm1);
- if (c->pic.data[0])
- avctx->release_buffer(avctx, &c->pic);
-
- return 0;
-}
-
-AVCodec kmvc_decoder = {
- "kmvc",
- CODEC_TYPE_VIDEO,
- CODEC_ID_KMVC,
- sizeof(KmvcContext),
- decode_init,
- NULL,
- decode_end,
- decode_frame
-};
diff --git a/src/libffmpeg/libavcodec/lcl.c b/src/libffmpeg/libavcodec/lcl.c
deleted file mode 100644
index b02ea1543..000000000
--- a/src/libffmpeg/libavcodec/lcl.c
+++ /dev/null
@@ -1,928 +0,0 @@
-/*
- * LCL (LossLess Codec Library) Codec
- * Copyright (c) 2002-2004 Roberto Togni
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file lcl.c
- * LCL (LossLess Codec Library) Video Codec
- * Decoder for MSZH and ZLIB codecs
- * Experimental encoder for ZLIB RGB24
- *
- * Fourcc: MSZH, ZLIB
- *
- * Original Win32 dll:
- * Ver2.23 By Kenji Oshima 2000.09.20
- * avimszh.dll, avizlib.dll
- *
- * A description of the decoding algorithm can be found here:
- * http://www.pcisys.net/~melanson/codecs
- *
- * Supports: BGR24 (RGB 24bpp)
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "common.h"
-#include "bitstream.h"
-#include "avcodec.h"
-
-#ifdef CONFIG_ZLIB
-#include <zlib.h>
-#endif
-
-
-#define BMPTYPE_YUV 1
-#define BMPTYPE_RGB 2
-
-#define IMGTYPE_YUV111 0
-#define IMGTYPE_YUV422 1
-#define IMGTYPE_RGB24 2
-#define IMGTYPE_YUV411 3
-#define IMGTYPE_YUV211 4
-#define IMGTYPE_YUV420 5
-
-#define COMP_MSZH 0
-#define COMP_MSZH_NOCOMP 1
-#define COMP_ZLIB_HISPEED 1
-#define COMP_ZLIB_HICOMP 9
-#define COMP_ZLIB_NORMAL -1
-
-#define FLAG_MULTITHREAD 1
-#define FLAG_NULLFRAME 2
-#define FLAG_PNGFILTER 4
-#define FLAGMASK_UNUSED 0xf8
-
-#define CODEC_MSZH 1
-#define CODEC_ZLIB 3
-
-#define FOURCC_MSZH mmioFOURCC('M','S','Z','H')
-#define FOURCC_ZLIB mmioFOURCC('Z','L','I','B')
-
-/*
- * Decoder context
- */
-typedef struct LclContext {
-
- AVCodecContext *avctx;
- AVFrame pic;
- PutBitContext pb;
-
- // Image type
- int imgtype;
- // Compression type
- int compression;
- // Flags
- int flags;
- // Decompressed data size
- unsigned int decomp_size;
- // Decompression buffer
- unsigned char* decomp_buf;
- // Maximum compressed data size
- unsigned int max_comp_size;
- // Compression buffer
- unsigned char* comp_buf;
-#ifdef CONFIG_ZLIB
- z_stream zstream;
-#endif
-} LclContext;
-
-
-/*
- *
- * Helper functions
- *
- */
-static inline unsigned char fix (int pix14)
-{
- int tmp;
-
- tmp = (pix14 + 0x80000) >> 20;
- if (tmp < 0)
- return 0;
- if (tmp > 255)
- return 255;
- return tmp;
-}
-
-
-
-static inline unsigned char get_b (unsigned char yq, signed char bq)
-{
- return fix((yq << 20) + bq * 1858076);
-}
-
-
-
-static inline unsigned char get_g (unsigned char yq, signed char bq, signed char rq)
-{
- return fix((yq << 20) - bq * 360857 - rq * 748830);
-}
-
-
-
-static inline unsigned char get_r (unsigned char yq, signed char rq)
-{
- return fix((yq << 20) + rq * 1470103);
-}
-
-
-
-static unsigned int mszh_decomp(unsigned char * srcptr, int srclen, unsigned char * destptr, unsigned int destsize)
-{
- unsigned char *destptr_bak = destptr;
- unsigned char *destptr_end = destptr + destsize;
- unsigned char mask = 0;
- unsigned char maskbit = 0;
- unsigned int ofs, cnt;
-
- while ((srclen > 0) && (destptr < destptr_end)) {
- if (maskbit == 0) {
- mask = *(srcptr++);
- maskbit = 8;
- srclen--;
- continue;
- }
- if ((mask & (1 << (--maskbit))) == 0) {
- if (destptr + 4 > destptr_end)
- break;
- *(int*)destptr = *(int*)srcptr;
- srclen -= 4;
- destptr += 4;
- srcptr += 4;
- } else {
- ofs = *(srcptr++);
- cnt = *(srcptr++);
- ofs += cnt * 256;;
- cnt = ((cnt >> 3) & 0x1f) + 1;
- ofs &= 0x7ff;
- srclen -= 2;
- cnt *= 4;
- if (destptr + cnt > destptr_end) {
- cnt = destptr_end - destptr;
- }
- for (; cnt > 0; cnt--) {
- *(destptr) = *(destptr - ofs);
- destptr++;
- }
- }
- }
-
- return (destptr - destptr_bak);
-}
-
-
-
-#ifdef CONFIG_DECODERS
-/*
- *
- * Decode a frame
- *
- */
-static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size)
-{
- LclContext * const c = (LclContext *)avctx->priv_data;
- unsigned char *encoded = (unsigned char *)buf;
- unsigned int pixel_ptr;
- int row, col;
- unsigned char *outptr;
- unsigned int width = avctx->width; // Real image width
- unsigned int height = avctx->height; // Real image height
- unsigned int mszh_dlen;
- unsigned char yq, y1q, uq, vq;
- int uqvq;
- unsigned int mthread_inlen, mthread_outlen;
-#ifdef CONFIG_ZLIB
- int zret; // Zlib return code
-#endif
- unsigned int len = buf_size;
-
- if(c->pic.data[0])
- avctx->release_buffer(avctx, &c->pic);
-
- c->pic.reference = 0;
- c->pic.buffer_hints = FF_BUFFER_HINTS_VALID;
- if(avctx->get_buffer(avctx, &c->pic) < 0){
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
-
- outptr = c->pic.data[0]; // Output image pointer
-
- /* Decompress frame */
- switch (avctx->codec_id) {
- case CODEC_ID_MSZH:
- switch (c->compression) {
- case COMP_MSZH:
- if (c->flags & FLAG_MULTITHREAD) {
- mthread_inlen = *((unsigned int*)encoded);
- mthread_outlen = *((unsigned int*)(encoded+4));
- if (mthread_outlen > c->decomp_size) // this should not happen
- mthread_outlen = c->decomp_size;
- mszh_dlen = mszh_decomp(encoded + 8, mthread_inlen, c->decomp_buf, c->decomp_size);
- if (mthread_outlen != mszh_dlen) {
- av_log(avctx, AV_LOG_ERROR, "Mthread1 decoded size differs (%d != %d)\n",
- mthread_outlen, mszh_dlen);
- return -1;
- }
- mszh_dlen = mszh_decomp(encoded + 8 + mthread_inlen, len - mthread_inlen,
- c->decomp_buf + mthread_outlen, c->decomp_size - mthread_outlen);
- if (mthread_outlen != mszh_dlen) {
- av_log(avctx, AV_LOG_ERROR, "Mthread2 decoded size differs (%d != %d)\n",
- mthread_outlen, mszh_dlen);
- return -1;
- }
- encoded = c->decomp_buf;
- len = c->decomp_size;
- } else {
- mszh_dlen = mszh_decomp(encoded, len, c->decomp_buf, c->decomp_size);
- if (c->decomp_size != mszh_dlen) {
- av_log(avctx, AV_LOG_ERROR, "Decoded size differs (%d != %d)\n",
- c->decomp_size, mszh_dlen);
- return -1;
- }
- encoded = c->decomp_buf;
- len = mszh_dlen;
- }
- break;
- case COMP_MSZH_NOCOMP:
- break;
- default:
- av_log(avctx, AV_LOG_ERROR, "BUG! Unknown MSZH compression in frame decoder.\n");
- return -1;
- }
- break;
- case CODEC_ID_ZLIB:
-#ifdef CONFIG_ZLIB
- /* Using the original dll with normal compression (-1) and RGB format
- * gives a file with ZLIB fourcc, but frame is really uncompressed.
- * To be sure that's true check also frame size */
- if ((c->compression == COMP_ZLIB_NORMAL) && (c->imgtype == IMGTYPE_RGB24) &&
- (len == width * height * 3))
- break;
- zret = inflateReset(&(c->zstream));
- if (zret != Z_OK) {
- av_log(avctx, AV_LOG_ERROR, "Inflate reset error: %d\n", zret);
- return -1;
- }
- if (c->flags & FLAG_MULTITHREAD) {
- mthread_inlen = *((unsigned int*)encoded);
- mthread_outlen = *((unsigned int*)(encoded+4));
- if (mthread_outlen > c->decomp_size)
- mthread_outlen = c->decomp_size;
- c->zstream.next_in = encoded + 8;
- c->zstream.avail_in = mthread_inlen;
- c->zstream.next_out = c->decomp_buf;
- c->zstream.avail_out = c->decomp_size;
- zret = inflate(&(c->zstream), Z_FINISH);
- if ((zret != Z_OK) && (zret != Z_STREAM_END)) {
- av_log(avctx, AV_LOG_ERROR, "Mthread1 inflate error: %d\n", zret);
- return -1;
- }
- if (mthread_outlen != (unsigned int)(c->zstream.total_out)) {
- av_log(avctx, AV_LOG_ERROR, "Mthread1 decoded size differs (%u != %lu)\n",
- mthread_outlen, c->zstream.total_out);
- return -1;
- }
- zret = inflateReset(&(c->zstream));
- if (zret != Z_OK) {
- av_log(avctx, AV_LOG_ERROR, "Mthread2 inflate reset error: %d\n", zret);
- return -1;
- }
- c->zstream.next_in = encoded + 8 + mthread_inlen;
- c->zstream.avail_in = len - mthread_inlen;
- c->zstream.next_out = c->decomp_buf + mthread_outlen;
- c->zstream.avail_out = c->decomp_size - mthread_outlen;
- zret = inflate(&(c->zstream), Z_FINISH);
- if ((zret != Z_OK) && (zret != Z_STREAM_END)) {
- av_log(avctx, AV_LOG_ERROR, "Mthread2 inflate error: %d\n", zret);
- return -1;
- }
- if (mthread_outlen != (unsigned int)(c->zstream.total_out)) {
- av_log(avctx, AV_LOG_ERROR, "Mthread2 decoded size differs (%d != %lu)\n",
- mthread_outlen, c->zstream.total_out);
- return -1;
- }
- } else {
- c->zstream.next_in = encoded;
- c->zstream.avail_in = len;
- c->zstream.next_out = c->decomp_buf;
- c->zstream.avail_out = c->decomp_size;
- zret = inflate(&(c->zstream), Z_FINISH);
- if ((zret != Z_OK) && (zret != Z_STREAM_END)) {
- av_log(avctx, AV_LOG_ERROR, "Inflate error: %d\n", zret);
- return -1;
- }
- if (c->decomp_size != (unsigned int)(c->zstream.total_out)) {
- av_log(avctx, AV_LOG_ERROR, "Decoded size differs (%d != %lu)\n",
- c->decomp_size, c->zstream.total_out);
- return -1;
- }
- }
- encoded = c->decomp_buf;
- len = c->decomp_size;;
-#else
- av_log(avctx, AV_LOG_ERROR, "BUG! Zlib support not compiled in frame decoder.\n");
- return -1;
-#endif
- break;
- default:
- av_log(avctx, AV_LOG_ERROR, "BUG! Unknown codec in frame decoder compression switch.\n");
- return -1;
- }
-
-
- /* Apply PNG filter */
- if ((avctx->codec_id == CODEC_ID_ZLIB) && (c->flags & FLAG_PNGFILTER)) {
- switch (c->imgtype) {
- case IMGTYPE_YUV111:
- case IMGTYPE_RGB24:
- for (row = 0; row < height; row++) {
- pixel_ptr = row * width * 3;
- yq = encoded[pixel_ptr++];
- uqvq = encoded[pixel_ptr++];
- uqvq+=(encoded[pixel_ptr++] << 8);
- for (col = 1; col < width; col++) {
- encoded[pixel_ptr] = yq -= encoded[pixel_ptr];
- uqvq -= (encoded[pixel_ptr+1] | (encoded[pixel_ptr+2]<<8));
- encoded[pixel_ptr+1] = (uqvq) & 0xff;
- encoded[pixel_ptr+2] = ((uqvq)>>8) & 0xff;
- pixel_ptr += 3;
- }
- }
- break;
- case IMGTYPE_YUV422:
- for (row = 0; row < height; row++) {
- pixel_ptr = row * width * 2;
- yq = uq = vq =0;
- for (col = 0; col < width/4; col++) {
- encoded[pixel_ptr] = yq -= encoded[pixel_ptr];
- encoded[pixel_ptr+1] = yq -= encoded[pixel_ptr+1];
- encoded[pixel_ptr+2] = yq -= encoded[pixel_ptr+2];
- encoded[pixel_ptr+3] = yq -= encoded[pixel_ptr+3];
- encoded[pixel_ptr+4] = uq -= encoded[pixel_ptr+4];
- encoded[pixel_ptr+5] = uq -= encoded[pixel_ptr+5];
- encoded[pixel_ptr+6] = vq -= encoded[pixel_ptr+6];
- encoded[pixel_ptr+7] = vq -= encoded[pixel_ptr+7];
- pixel_ptr += 8;
- }
- }
- break;
- case IMGTYPE_YUV411:
- for (row = 0; row < height; row++) {
- pixel_ptr = row * width / 2 * 3;
- yq = uq = vq =0;
- for (col = 0; col < width/4; col++) {
- encoded[pixel_ptr] = yq -= encoded[pixel_ptr];
- encoded[pixel_ptr+1] = yq -= encoded[pixel_ptr+1];
- encoded[pixel_ptr+2] = yq -= encoded[pixel_ptr+2];
- encoded[pixel_ptr+3] = yq -= encoded[pixel_ptr+3];
- encoded[pixel_ptr+4] = uq -= encoded[pixel_ptr+4];
- encoded[pixel_ptr+5] = vq -= encoded[pixel_ptr+5];
- pixel_ptr += 6;
- }
- }
- break;
- case IMGTYPE_YUV211:
- for (row = 0; row < height; row++) {
- pixel_ptr = row * width * 2;
- yq = uq = vq =0;
- for (col = 0; col < width/2; col++) {
- encoded[pixel_ptr] = yq -= encoded[pixel_ptr];
- encoded[pixel_ptr+1] = yq -= encoded[pixel_ptr+1];
- encoded[pixel_ptr+2] = uq -= encoded[pixel_ptr+2];
- encoded[pixel_ptr+3] = vq -= encoded[pixel_ptr+3];
- pixel_ptr += 4;
- }
- }
- break;
- case IMGTYPE_YUV420:
- for (row = 0; row < height/2; row++) {
- pixel_ptr = row * width * 3;
- yq = y1q = uq = vq =0;
- for (col = 0; col < width/2; col++) {
- encoded[pixel_ptr] = yq -= encoded[pixel_ptr];
- encoded[pixel_ptr+1] = yq -= encoded[pixel_ptr+1];
- encoded[pixel_ptr+2] = y1q -= encoded[pixel_ptr+2];
- encoded[pixel_ptr+3] = y1q -= encoded[pixel_ptr+3];
- encoded[pixel_ptr+4] = uq -= encoded[pixel_ptr+4];
- encoded[pixel_ptr+5] = vq -= encoded[pixel_ptr+5];
- pixel_ptr += 6;
- }
- }
- break;
- default:
- av_log(avctx, AV_LOG_ERROR, "BUG! Unknown imagetype in pngfilter switch.\n");
- return -1;
- }
- }
-
- /* Convert colorspace */
- switch (c->imgtype) {
- case IMGTYPE_YUV111:
- for (row = height - 1; row >= 0; row--) {
- pixel_ptr = row * c->pic.linesize[0];
- for (col = 0; col < width; col++) {
- outptr[pixel_ptr++] = get_b(encoded[0], encoded[1]);
- outptr[pixel_ptr++] = get_g(encoded[0], encoded[1], encoded[2]);
- outptr[pixel_ptr++] = get_r(encoded[0], encoded[2]);
- encoded += 3;
- }
- }
- break;
- case IMGTYPE_YUV422:
- for (row = height - 1; row >= 0; row--) {
- pixel_ptr = row * c->pic.linesize[0];
- for (col = 0; col < width/4; col++) {
- outptr[pixel_ptr++] = get_b(encoded[0], encoded[4]);
- outptr[pixel_ptr++] = get_g(encoded[0], encoded[4], encoded[6]);
- outptr[pixel_ptr++] = get_r(encoded[0], encoded[6]);
- outptr[pixel_ptr++] = get_b(encoded[1], encoded[4]);
- outptr[pixel_ptr++] = get_g(encoded[1], encoded[4], encoded[6]);
- outptr[pixel_ptr++] = get_r(encoded[1], encoded[6]);
- outptr[pixel_ptr++] = get_b(encoded[2], encoded[5]);
- outptr[pixel_ptr++] = get_g(encoded[2], encoded[5], encoded[7]);
- outptr[pixel_ptr++] = get_r(encoded[2], encoded[7]);
- outptr[pixel_ptr++] = get_b(encoded[3], encoded[5]);
- outptr[pixel_ptr++] = get_g(encoded[3], encoded[5], encoded[7]);
- outptr[pixel_ptr++] = get_r(encoded[3], encoded[7]);
- encoded += 8;
- }
- }
- break;
- case IMGTYPE_RGB24:
- for (row = height - 1; row >= 0; row--) {
- pixel_ptr = row * c->pic.linesize[0];
- for (col = 0; col < width; col++) {
- outptr[pixel_ptr++] = encoded[0];
- outptr[pixel_ptr++] = encoded[1];
- outptr[pixel_ptr++] = encoded[2];
- encoded += 3;
- }
- }
- break;
- case IMGTYPE_YUV411:
- for (row = height - 1; row >= 0; row--) {
- pixel_ptr = row * c->pic.linesize[0];
- for (col = 0; col < width/4; col++) {
- outptr[pixel_ptr++] = get_b(encoded[0], encoded[4]);
- outptr[pixel_ptr++] = get_g(encoded[0], encoded[4], encoded[5]);
- outptr[pixel_ptr++] = get_r(encoded[0], encoded[5]);
- outptr[pixel_ptr++] = get_b(encoded[1], encoded[4]);
- outptr[pixel_ptr++] = get_g(encoded[1], encoded[4], encoded[5]);
- outptr[pixel_ptr++] = get_r(encoded[1], encoded[5]);
- outptr[pixel_ptr++] = get_b(encoded[2], encoded[4]);
- outptr[pixel_ptr++] = get_g(encoded[2], encoded[4], encoded[5]);
- outptr[pixel_ptr++] = get_r(encoded[2], encoded[5]);
- outptr[pixel_ptr++] = get_b(encoded[3], encoded[4]);
- outptr[pixel_ptr++] = get_g(encoded[3], encoded[4], encoded[5]);
- outptr[pixel_ptr++] = get_r(encoded[3], encoded[5]);
- encoded += 6;
- }
- }
- break;
- case IMGTYPE_YUV211:
- for (row = height - 1; row >= 0; row--) {
- pixel_ptr = row * c->pic.linesize[0];
- for (col = 0; col < width/2; col++) {
- outptr[pixel_ptr++] = get_b(encoded[0], encoded[2]);
- outptr[pixel_ptr++] = get_g(encoded[0], encoded[2], encoded[3]);
- outptr[pixel_ptr++] = get_r(encoded[0], encoded[3]);
- outptr[pixel_ptr++] = get_b(encoded[1], encoded[2]);
- outptr[pixel_ptr++] = get_g(encoded[1], encoded[2], encoded[3]);
- outptr[pixel_ptr++] = get_r(encoded[1], encoded[3]);
- encoded += 4;
- }
- }
- break;
- case IMGTYPE_YUV420:
- for (row = height / 2 - 1; row >= 0; row--) {
- pixel_ptr = 2 * row * c->pic.linesize[0];
- for (col = 0; col < width/2; col++) {
- outptr[pixel_ptr] = get_b(encoded[0], encoded[4]);
- outptr[pixel_ptr+1] = get_g(encoded[0], encoded[4], encoded[5]);
- outptr[pixel_ptr+2] = get_r(encoded[0], encoded[5]);
- outptr[pixel_ptr+3] = get_b(encoded[1], encoded[4]);
- outptr[pixel_ptr+4] = get_g(encoded[1], encoded[4], encoded[5]);
- outptr[pixel_ptr+5] = get_r(encoded[1], encoded[5]);
- outptr[pixel_ptr-c->pic.linesize[0]] = get_b(encoded[2], encoded[4]);
- outptr[pixel_ptr-c->pic.linesize[0]+1] = get_g(encoded[2], encoded[4], encoded[5]);
- outptr[pixel_ptr-c->pic.linesize[0]+2] = get_r(encoded[2], encoded[5]);
- outptr[pixel_ptr-c->pic.linesize[0]+3] = get_b(encoded[3], encoded[4]);
- outptr[pixel_ptr-c->pic.linesize[0]+4] = get_g(encoded[3], encoded[4], encoded[5]);
- outptr[pixel_ptr-c->pic.linesize[0]+5] = get_r(encoded[3], encoded[5]);
- pixel_ptr += 6;
- encoded += 6;
- }
- }
- break;
- default:
- av_log(avctx, AV_LOG_ERROR, "BUG! Unknown imagetype in image decoder.\n");
- return -1;
- }
-
- *data_size = sizeof(AVFrame);
- *(AVFrame*)data = c->pic;
-
- /* always report that the buffer was completely consumed */
- return buf_size;
-}
-#endif
-
-#ifdef CONFIG_ENCODERS
-/*
- *
- * Encode a frame
- *
- */
-static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){
- LclContext *c = avctx->priv_data;
- AVFrame *pict = data;
- AVFrame * const p = &c->pic;
- int i;
- int zret; // Zlib return code
-
-#ifndef CONFIG_ZLIB
- av_log(avctx, AV_LOG_ERROR, "Zlib support not compiled in.\n");
- return -1;
-#else
-
- init_put_bits(&c->pb, buf, buf_size);
-
- *p = *pict;
- p->pict_type= FF_I_TYPE;
- p->key_frame= 1;
-
- if(avctx->pix_fmt != PIX_FMT_BGR24){
- av_log(avctx, AV_LOG_ERROR, "Format not supported!\n");
- return -1;
- }
-
- zret = deflateReset(&(c->zstream));
- if (zret != Z_OK) {
- av_log(avctx, AV_LOG_ERROR, "Deflate reset error: %d\n", zret);
- return -1;
- }
- c->zstream.next_out = c->comp_buf;
- c->zstream.avail_out = c->max_comp_size;
-
- for(i = avctx->height - 1; i >= 0; i--) {
- c->zstream.next_in = p->data[0]+p->linesize[0]*i;
- c->zstream.avail_in = avctx->width*3;
- zret = deflate(&(c->zstream), Z_NO_FLUSH);
- if (zret != Z_OK) {
- av_log(avctx, AV_LOG_ERROR, "Deflate error: %d\n", zret);
- return -1;
- }
- }
- zret = deflate(&(c->zstream), Z_FINISH);
- if (zret != Z_STREAM_END) {
- av_log(avctx, AV_LOG_ERROR, "Deflate error: %d\n", zret);
- return -1;
- }
-
- for (i = 0; i < c->zstream.total_out; i++)
- put_bits(&c->pb, 8, c->comp_buf[i]);
- flush_put_bits(&c->pb);
-
- return c->zstream.total_out;
-#endif
-}
-#endif /* CONFIG_ENCODERS */
-
-#ifdef CONFIG_DECODERS
-/*
- *
- * Init lcl decoder
- *
- */
-static int decode_init(AVCodecContext *avctx)
-{
- LclContext * const c = (LclContext *)avctx->priv_data;
- unsigned int basesize = avctx->width * avctx->height;
- unsigned int max_basesize = ((avctx->width + 3) & ~3) * ((avctx->height + 3) & ~3);
- unsigned int max_decomp_size;
- int zret; // Zlib return code
-
- c->avctx = avctx;
- avctx->has_b_frames = 0;
-
- c->pic.data[0] = NULL;
-
-#ifdef CONFIG_ZLIB
- // Needed if zlib unused or init aborted before inflateInit
- memset(&(c->zstream), 0, sizeof(z_stream));
-#endif
-
- if (avctx->extradata_size < 8) {
- av_log(avctx, AV_LOG_ERROR, "Extradata size too small.\n");
- return 1;
- }
-
- if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
- return 1;
- }
-
- /* Check codec type */
- if (((avctx->codec_id == CODEC_ID_MSZH) && (*((char *)avctx->extradata + 7) != CODEC_MSZH)) ||
- ((avctx->codec_id == CODEC_ID_ZLIB) && (*((char *)avctx->extradata + 7) != CODEC_ZLIB))) {
- av_log(avctx, AV_LOG_ERROR, "Codec id and codec type mismatch. This should not happen.\n");
- }
-
- /* Detect image type */
- switch (c->imgtype = *((char *)avctx->extradata + 4)) {
- case IMGTYPE_YUV111:
- c->decomp_size = basesize * 3;
- max_decomp_size = max_basesize * 3;
- av_log(avctx, AV_LOG_INFO, "Image type is YUV 1:1:1.\n");
- break;
- case IMGTYPE_YUV422:
- c->decomp_size = basesize * 2;
- max_decomp_size = max_basesize * 2;
- av_log(avctx, AV_LOG_INFO, "Image type is YUV 4:2:2.\n");
- break;
- case IMGTYPE_RGB24:
- c->decomp_size = basesize * 3;
- max_decomp_size = max_basesize * 3;
- av_log(avctx, AV_LOG_INFO, "Image type is RGB 24.\n");
- break;
- case IMGTYPE_YUV411:
- c->decomp_size = basesize / 2 * 3;
- max_decomp_size = max_basesize / 2 * 3;
- av_log(avctx, AV_LOG_INFO, "Image type is YUV 4:1:1.\n");
- break;
- case IMGTYPE_YUV211:
- c->decomp_size = basesize * 2;
- max_decomp_size = max_basesize * 2;
- av_log(avctx, AV_LOG_INFO, "Image type is YUV 2:1:1.\n");
- break;
- case IMGTYPE_YUV420:
- c->decomp_size = basesize / 2 * 3;
- max_decomp_size = max_basesize / 2 * 3;
- av_log(avctx, AV_LOG_INFO, "Image type is YUV 4:2:0.\n");
- break;
- default:
- av_log(avctx, AV_LOG_ERROR, "Unsupported image format %d.\n", c->imgtype);
- return 1;
- }
-
- /* Detect compression method */
- c->compression = *((char *)avctx->extradata + 5);
- switch (avctx->codec_id) {
- case CODEC_ID_MSZH:
- switch (c->compression) {
- case COMP_MSZH:
- av_log(avctx, AV_LOG_INFO, "Compression enabled.\n");
- break;
- case COMP_MSZH_NOCOMP:
- c->decomp_size = 0;
- av_log(avctx, AV_LOG_INFO, "No compression.\n");
- break;
- default:
- av_log(avctx, AV_LOG_ERROR, "Unsupported compression format for MSZH (%d).\n", c->compression);
- return 1;
- }
- break;
- case CODEC_ID_ZLIB:
-#ifdef CONFIG_ZLIB
- switch (c->compression) {
- case COMP_ZLIB_HISPEED:
- av_log(avctx, AV_LOG_INFO, "High speed compression.\n");
- break;
- case COMP_ZLIB_HICOMP:
- av_log(avctx, AV_LOG_INFO, "High compression.\n");
- break;
- case COMP_ZLIB_NORMAL:
- av_log(avctx, AV_LOG_INFO, "Normal compression.\n");
- break;
- default:
- if ((c->compression < Z_NO_COMPRESSION) || (c->compression > Z_BEST_COMPRESSION)) {
- av_log(avctx, AV_LOG_ERROR, "Unsupported compression level for ZLIB: (%d).\n", c->compression);
- return 1;
- }
- av_log(avctx, AV_LOG_INFO, "Compression level for ZLIB: (%d).\n", c->compression);
- }
-#else
- av_log(avctx, AV_LOG_ERROR, "Zlib support not compiled.\n");
- return 1;
-#endif
- break;
- default:
- av_log(avctx, AV_LOG_ERROR, "BUG! Unknown codec in compression switch.\n");
- return 1;
- }
-
- /* Allocate decompression buffer */
- if (c->decomp_size) {
- if ((c->decomp_buf = av_malloc(max_decomp_size)) == NULL) {
- av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n");
- return 1;
- }
- }
-
- /* Detect flags */
- c->flags = *((char *)avctx->extradata + 6);
- if (c->flags & FLAG_MULTITHREAD)
- av_log(avctx, AV_LOG_INFO, "Multithread encoder flag set.\n");
- if (c->flags & FLAG_NULLFRAME)
- av_log(avctx, AV_LOG_INFO, "Nullframe insertion flag set.\n");
- if ((avctx->codec_id == CODEC_ID_ZLIB) && (c->flags & FLAG_PNGFILTER))
- av_log(avctx, AV_LOG_INFO, "PNG filter flag set.\n");
- if (c->flags & FLAGMASK_UNUSED)
- av_log(avctx, AV_LOG_ERROR, "Unknown flag set (%d).\n", c->flags);
-
- /* If needed init zlib */
- if (avctx->codec_id == CODEC_ID_ZLIB) {
-#ifdef CONFIG_ZLIB
- c->zstream.zalloc = Z_NULL;
- c->zstream.zfree = Z_NULL;
- c->zstream.opaque = Z_NULL;
- zret = inflateInit(&(c->zstream));
- if (zret != Z_OK) {
- av_log(avctx, AV_LOG_ERROR, "Inflate init error: %d\n", zret);
- return 1;
- }
-#else
- av_log(avctx, AV_LOG_ERROR, "Zlib support not compiled.\n");
- return 1;
-#endif
- }
-
- avctx->pix_fmt = PIX_FMT_BGR24;
-
- return 0;
-}
-#endif /* CONFIG_DECODERS */
-
-#ifdef CONFIG_ENCODERS
-/*
- *
- * Init lcl encoder
- *
- */
-static int encode_init(AVCodecContext *avctx)
-{
- LclContext *c = avctx->priv_data;
- int zret; // Zlib return code
-
-#ifndef CONFIG_ZLIB
- av_log(avctx, AV_LOG_ERROR, "Zlib support not compiled.\n");
- return 1;
-#else
-
- c->avctx= avctx;
-
- assert(avctx->width && avctx->height);
-
- avctx->extradata= av_mallocz(8);
- avctx->coded_frame= &c->pic;
-
- // Will be user settable someday
- c->compression = 6;
- c->flags = 0;
-
- switch(avctx->pix_fmt){
- case PIX_FMT_BGR24:
- c->imgtype = IMGTYPE_RGB24;
- c->decomp_size = avctx->width * avctx->height * 3;
- avctx->bits_per_sample= 24;
- break;
- default:
- av_log(avctx, AV_LOG_ERROR, "Format %d not supported\n", avctx->pix_fmt);
- return -1;
- }
-
- ((uint8_t*)avctx->extradata)[0]= 4;
- ((uint8_t*)avctx->extradata)[1]= 0;
- ((uint8_t*)avctx->extradata)[2]= 0;
- ((uint8_t*)avctx->extradata)[3]= 0;
- ((uint8_t*)avctx->extradata)[4]= c->imgtype;
- ((uint8_t*)avctx->extradata)[5]= c->compression;
- ((uint8_t*)avctx->extradata)[6]= c->flags;
- ((uint8_t*)avctx->extradata)[7]= CODEC_ZLIB;
- c->avctx->extradata_size= 8;
-
- c->zstream.zalloc = Z_NULL;
- c->zstream.zfree = Z_NULL;
- c->zstream.opaque = Z_NULL;
- zret = deflateInit(&(c->zstream), c->compression);
- if (zret != Z_OK) {
- av_log(avctx, AV_LOG_ERROR, "Deflate init error: %d\n", zret);
- return 1;
- }
-
- /* Conservative upper bound taken from zlib v1.2.1 source */
- c->max_comp_size = c->decomp_size + ((c->decomp_size + 7) >> 3) +
- ((c->decomp_size + 63) >> 6) + 11;
- if ((c->comp_buf = av_malloc(c->max_comp_size)) == NULL) {
- av_log(avctx, AV_LOG_ERROR, "Can't allocate compression buffer.\n");
- return 1;
- }
-
- return 0;
-#endif
-}
-#endif /* CONFIG_ENCODERS */
-
-
-
-#ifdef CONFIG_DECODERS
-/*
- *
- * Uninit lcl decoder
- *
- */
-static int decode_end(AVCodecContext *avctx)
-{
- LclContext * const c = (LclContext *)avctx->priv_data;
-
- if (c->pic.data[0])
- avctx->release_buffer(avctx, &c->pic);
-#ifdef CONFIG_ZLIB
- inflateEnd(&(c->zstream));
-#endif
-
- return 0;
-}
-#endif
-
-#ifdef CONFIG_ENCODERS
-/*
- *
- * Uninit lcl encoder
- *
- */
-static int encode_end(AVCodecContext *avctx)
-{
- LclContext *c = avctx->priv_data;
-
- av_freep(&avctx->extradata);
- av_freep(&c->comp_buf);
-#ifdef CONFIG_ZLIB
- deflateEnd(&(c->zstream));
-#endif
-
- return 0;
-}
-#endif
-
-#ifdef CONFIG_MSZH_DECODER
-AVCodec mszh_decoder = {
- "mszh",
- CODEC_TYPE_VIDEO,
- CODEC_ID_MSZH,
- sizeof(LclContext),
- decode_init,
- NULL,
- decode_end,
- decode_frame,
- CODEC_CAP_DR1,
-};
-#endif
-
-#ifdef CONFIG_ZLIB_DECODER
-AVCodec zlib_decoder = {
- "zlib",
- CODEC_TYPE_VIDEO,
- CODEC_ID_ZLIB,
- sizeof(LclContext),
- decode_init,
- NULL,
- decode_end,
- decode_frame,
- CODEC_CAP_DR1,
-};
-#endif
-
-#ifdef CONFIG_ENCODERS
-
-AVCodec zlib_encoder = {
- "zlib",
- CODEC_TYPE_VIDEO,
- CODEC_ID_ZLIB,
- sizeof(LclContext),
- encode_init,
- encode_frame,
- encode_end,
-};
-
-#endif //CONFIG_ENCODERS
diff --git a/src/libffmpeg/libavcodec/libpostproc/Makefile.am b/src/libffmpeg/libavcodec/libpostproc/Makefile.am
deleted file mode 100644
index 66bd17e53..000000000
--- a/src/libffmpeg/libavcodec/libpostproc/Makefile.am
+++ /dev/null
@@ -1,19 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-# -fomit-frame-pointer is always needed. it might cause debug to not
-# work, but at least it compiles.
-AM_CFLAGS = -fomit-frame-pointer -fno-strict-aliasing
-AM_CPPFLAGS = $(LIBFFMPEG_CPPFLAGS) -I$(top_srcdir)/src/libffmpeg/libavcodec
-
-# Avoid errors with -O0
-postprocess.o postprocess.lo: CFLAGS=`echo @CFLAGS@ | sed -e 's/-O0\?\s/-Os /g'`
-
-ASFLAGS =
-
-noinst_LTLIBRARIES = libpostprocess.la
-
-EXTRA_DIST = postprocess_template.c postprocess_altivec_template.c
-
-libpostprocess_la_SOURCES = postprocess.c
-
-noinst_HEADERS = mangle.h postprocess.h postprocess_internal.h
diff --git a/src/libffmpeg/libavcodec/libpostproc/mangle.h b/src/libffmpeg/libavcodec/libpostproc/mangle.h
deleted file mode 100644
index 46480ab43..000000000
--- a/src/libffmpeg/libavcodec/libpostproc/mangle.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* mangle.h - This file has some CPP macros to deal with different symbol
- * mangling across binary formats.
- * (c)2002 by Felix Buenemann <atmosfear at users.sourceforge.net>
- * File licensed under the GPL, see http://www.fsf.org/ for more info.
- */
-
-#ifndef __MANGLE_H
-#define __MANGLE_H
-
-/* Feel free to add more to the list, eg. a.out IMO */
-/* Use rip-relative addressing if compiling PIC code on x86-64. */
-#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__OS2__) || \
- (defined(__OpenBSD__) && !defined(__ELF__))
-#if defined(ARCH_X86_64) && defined(PIC)
-#define MANGLE(a) "_" #a"(%%rip)"
-#else
-#define MANGLE(a) "_" #a
-#endif
-#else
-#if defined(ARCH_X86_64) && defined(PIC)
-#define MANGLE(a) #a"(%%rip)"
-#elif defined(CONFIG_DARWIN)
-#define MANGLE(a) "_" #a
-#else
-#define MANGLE(a) #a
-#endif
-#endif
-
-#endif /* !__MANGLE_H */
-
diff --git a/src/libffmpeg/libavcodec/libpostproc/postprocess.c b/src/libffmpeg/libavcodec/libpostproc/postprocess.c
deleted file mode 100644
index 63d65fece..000000000
--- a/src/libffmpeg/libavcodec/libpostproc/postprocess.c
+++ /dev/null
@@ -1,1157 +0,0 @@
-/*
- Copyright (C) 2001-2003 Michael Niedermayer (michaelni@gmx.at)
-
- AltiVec optimizations (C) 2004 Romain Dolbeau <romain@dolbeau.org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*/
-
-/**
- * @file postprocess.c
- * postprocessing.
- */
-
-/*
- C MMX MMX2 3DNow AltiVec
-isVertDC Ec Ec Ec
-isVertMinMaxOk Ec Ec Ec
-doVertLowPass E e e Ec
-doVertDefFilter Ec Ec e e Ec
-isHorizDC Ec Ec Ec
-isHorizMinMaxOk a E Ec
-doHorizLowPass E e e Ec
-doHorizDefFilter Ec Ec e e Ec
-do_a_deblock Ec E Ec E
-deRing E e e* Ecp
-Vertical RKAlgo1 E a a
-Horizontal RKAlgo1 a a
-Vertical X1# a E E
-Horizontal X1# a E E
-LinIpolDeinterlace e E E*
-CubicIpolDeinterlace a e e*
-LinBlendDeinterlace e E E*
-MedianDeinterlace# E Ec Ec
-TempDeNoiser# E e e Ec
-
-* i dont have a 3dnow CPU -> its untested, but noone said it doesnt work so it seems to work
-# more or less selfinvented filters so the exactness isnt too meaningfull
-E = Exact implementation
-e = allmost exact implementation (slightly different rounding,...)
-a = alternative / approximate impl
-c = checked against the other implementations (-vo md5)
-p = partially optimized, still some work to do
-*/
-
-/*
-TODO:
-reduce the time wasted on the mem transfer
-unroll stuff if instructions depend too much on the prior one
-move YScale thing to the end instead of fixing QP
-write a faster and higher quality deblocking filter :)
-make the mainloop more flexible (variable number of blocks at once
- (the if/else stuff per block is slowing things down)
-compare the quality & speed of all filters
-split this huge file
-optimize c versions
-try to unroll inner for(x=0 ... loop to avoid these damn if(x ... checks
-...
-*/
-
-//Changelog: use the CVS log
-
-#include "config.h"
-#include <inttypes.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-//#undef HAVE_MMX2
-//#define HAVE_3DNOW
-//#undef HAVE_MMX
-//#undef ARCH_X86
-//#define DEBUG_BRIGHTNESS
-#ifdef USE_FASTMEMCPY
-#include "fastmemcpy.h"
-#endif
-#include "postprocess.h"
-#include "postprocess_internal.h"
-
-#include "mangle.h" //FIXME should be supressed
-
-#ifdef HAVE_ALTIVEC_H
-#include <altivec.h>
-#endif
-
-#ifndef HAVE_MEMALIGN
-#define memalign(a,b) malloc(b)
-#endif
-
-#define MIN(a,b) ((a) > (b) ? (b) : (a))
-#define MAX(a,b) ((a) < (b) ? (b) : (a))
-#define ABS(a) ((a) > 0 ? (a) : (-(a)))
-#define SIGN(a) ((a) > 0 ? 1 : -1)
-
-#define GET_MODE_BUFFER_SIZE 500
-#define OPTIONS_ARRAY_SIZE 10
-#define BLOCK_SIZE 8
-#define TEMP_STRIDE 8
-//#define NUM_BLOCKS_AT_ONCE 16 //not used yet
-
-#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
-# define attribute_used __attribute__((used))
-# define always_inline __attribute__((always_inline)) inline
-#else
-# define attribute_used
-# define always_inline inline
-#endif
-
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
-static uint64_t __attribute__((aligned(8))) attribute_used w05= 0x0005000500050005LL;
-static uint64_t __attribute__((aligned(8))) attribute_used w04= 0x0004000400040004LL;
-static uint64_t __attribute__((aligned(8))) attribute_used w20= 0x0020002000200020LL;
-static uint64_t __attribute__((aligned(8))) attribute_used b00= 0x0000000000000000LL;
-static uint64_t __attribute__((aligned(8))) attribute_used b01= 0x0101010101010101LL;
-static uint64_t __attribute__((aligned(8))) attribute_used b02= 0x0202020202020202LL;
-static uint64_t __attribute__((aligned(8))) attribute_used b08= 0x0808080808080808LL;
-static uint64_t __attribute__((aligned(8))) attribute_used b80= 0x8080808080808080LL;
-#endif
-
-static uint8_t clip_table[3*256];
-static uint8_t * const clip_tab= clip_table + 256;
-
-static const int verbose= 0;
-
-static const int attribute_used deringThreshold= 20;
-
-
-static struct PPFilter filters[]=
-{
- {"hb", "hdeblock", 1, 1, 3, H_DEBLOCK},
- {"vb", "vdeblock", 1, 2, 4, V_DEBLOCK},
-/* {"hr", "rkhdeblock", 1, 1, 3, H_RK1_FILTER},
- {"vr", "rkvdeblock", 1, 2, 4, V_RK1_FILTER},*/
- {"h1", "x1hdeblock", 1, 1, 3, H_X1_FILTER},
- {"v1", "x1vdeblock", 1, 2, 4, V_X1_FILTER},
- {"ha", "ahdeblock", 1, 1, 3, H_A_DEBLOCK},
- {"va", "avdeblock", 1, 2, 4, V_A_DEBLOCK},
- {"dr", "dering", 1, 5, 6, DERING},
- {"al", "autolevels", 0, 1, 2, LEVEL_FIX},
- {"lb", "linblenddeint", 1, 1, 4, LINEAR_BLEND_DEINT_FILTER},
- {"li", "linipoldeint", 1, 1, 4, LINEAR_IPOL_DEINT_FILTER},
- {"ci", "cubicipoldeint", 1, 1, 4, CUBIC_IPOL_DEINT_FILTER},
- {"md", "mediandeint", 1, 1, 4, MEDIAN_DEINT_FILTER},
- {"fd", "ffmpegdeint", 1, 1, 4, FFMPEG_DEINT_FILTER},
- {"l5", "lowpass5", 1, 1, 4, LOWPASS5_DEINT_FILTER},
- {"tn", "tmpnoise", 1, 7, 8, TEMP_NOISE_FILTER},
- {"fq", "forcequant", 1, 0, 0, FORCE_QUANT},
- {NULL, NULL,0,0,0,0} //End Marker
-};
-
-static char *replaceTable[]=
-{
- "default", "hdeblock:a,vdeblock:a,dering:a",
- "de", "hdeblock:a,vdeblock:a,dering:a",
- "fast", "x1hdeblock:a,x1vdeblock:a,dering:a",
- "fa", "x1hdeblock:a,x1vdeblock:a,dering:a",
- "ac", "ha:a:128:7,va:a,dering:a",
- NULL //End Marker
-};
-
-
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
-static inline void prefetchnta(void *p)
-{
- asm volatile( "prefetchnta (%0)\n\t"
- : : "r" (p)
- );
-}
-
-static inline void prefetcht0(void *p)
-{
- asm volatile( "prefetcht0 (%0)\n\t"
- : : "r" (p)
- );
-}
-
-static inline void prefetcht1(void *p)
-{
- asm volatile( "prefetcht1 (%0)\n\t"
- : : "r" (p)
- );
-}
-
-static inline void prefetcht2(void *p)
-{
- asm volatile( "prefetcht2 (%0)\n\t"
- : : "r" (p)
- );
-}
-#endif
-
-// The horizontal Functions exist only in C cuz the MMX code is faster with vertical filters and transposing
-
-/**
- * Check if the given 8x8 Block is mostly "flat"
- */
-static inline int isHorizDC_C(uint8_t src[], int stride, PPContext *c)
-{
- int numEq= 0;
- int y;
- const int dcOffset= ((c->nonBQP*c->ppMode.baseDcDiff)>>8) + 1;
- const int dcThreshold= dcOffset*2 + 1;
-
- for(y=0; y<BLOCK_SIZE; y++)
- {
- if(((unsigned)(src[0] - src[1] + dcOffset)) < dcThreshold) numEq++;
- if(((unsigned)(src[1] - src[2] + dcOffset)) < dcThreshold) numEq++;
- if(((unsigned)(src[2] - src[3] + dcOffset)) < dcThreshold) numEq++;
- if(((unsigned)(src[3] - src[4] + dcOffset)) < dcThreshold) numEq++;
- if(((unsigned)(src[4] - src[5] + dcOffset)) < dcThreshold) numEq++;
- if(((unsigned)(src[5] - src[6] + dcOffset)) < dcThreshold) numEq++;
- if(((unsigned)(src[6] - src[7] + dcOffset)) < dcThreshold) numEq++;
- src+= stride;
- }
- return numEq > c->ppMode.flatnessThreshold;
-}
-
-/**
- * Check if the middle 8x8 Block in the given 8x16 block is flat
- */
-static inline int isVertDC_C(uint8_t src[], int stride, PPContext *c){
- int numEq= 0;
- int y;
- const int dcOffset= ((c->nonBQP*c->ppMode.baseDcDiff)>>8) + 1;
- const int dcThreshold= dcOffset*2 + 1;
-
- src+= stride*4; // src points to begin of the 8x8 Block
- for(y=0; y<BLOCK_SIZE-1; y++)
- {
- if(((unsigned)(src[0] - src[0+stride] + dcOffset)) < dcThreshold) numEq++;
- if(((unsigned)(src[1] - src[1+stride] + dcOffset)) < dcThreshold) numEq++;
- if(((unsigned)(src[2] - src[2+stride] + dcOffset)) < dcThreshold) numEq++;
- if(((unsigned)(src[3] - src[3+stride] + dcOffset)) < dcThreshold) numEq++;
- if(((unsigned)(src[4] - src[4+stride] + dcOffset)) < dcThreshold) numEq++;
- if(((unsigned)(src[5] - src[5+stride] + dcOffset)) < dcThreshold) numEq++;
- if(((unsigned)(src[6] - src[6+stride] + dcOffset)) < dcThreshold) numEq++;
- if(((unsigned)(src[7] - src[7+stride] + dcOffset)) < dcThreshold) numEq++;
- src+= stride;
- }
- return numEq > c->ppMode.flatnessThreshold;
-}
-
-static inline int isHorizMinMaxOk_C(uint8_t src[], int stride, int QP)
-{
- int i;
-#if 1
- for(i=0; i<2; i++){
- if((unsigned)(src[0] - src[5] + 2*QP) > 4*QP) return 0;
- src += stride;
- if((unsigned)(src[2] - src[7] + 2*QP) > 4*QP) return 0;
- src += stride;
- if((unsigned)(src[4] - src[1] + 2*QP) > 4*QP) return 0;
- src += stride;
- if((unsigned)(src[6] - src[3] + 2*QP) > 4*QP) return 0;
- src += stride;
- }
-#else
- for(i=0; i<8; i++){
- if((unsigned)(src[0] - src[7] + 2*QP) > 4*QP) return 0;
- src += stride;
- }
-#endif
- return 1;
-}
-
-static inline int isVertMinMaxOk_C(uint8_t src[], int stride, int QP)
-{
-#if 1
-#if 1
- int x;
- src+= stride*4;
- for(x=0; x<BLOCK_SIZE; x+=4)
- {
- if((unsigned)(src[ x + 0*stride] - src[ x + 5*stride] + 2*QP) > 4*QP) return 0;
- if((unsigned)(src[1+x + 2*stride] - src[1+x + 7*stride] + 2*QP) > 4*QP) return 0;
- if((unsigned)(src[2+x + 4*stride] - src[2+x + 1*stride] + 2*QP) > 4*QP) return 0;
- if((unsigned)(src[3+x + 6*stride] - src[3+x + 3*stride] + 2*QP) > 4*QP) return 0;
- }
-#else
- int x;
- src+= stride*3;
- for(x=0; x<BLOCK_SIZE; x++)
- {
- if((unsigned)(src[x + stride] - src[x + (stride<<3)] + 2*QP) > 4*QP) return 0;
- }
-#endif
- return 1;
-#else
- int x;
- src+= stride*4;
- for(x=0; x<BLOCK_SIZE; x++)
- {
- int min=255;
- int max=0;
- int y;
- for(y=0; y<8; y++){
- int v= src[x + y*stride];
- if(v>max) max=v;
- if(v<min) min=v;
- }
- if(max-min > 2*QP) return 0;
- }
- return 1;
-#endif
-}
-
-static inline int horizClassify_C(uint8_t src[], int stride, PPContext *c){
- if( isHorizDC_C(src, stride, c) ){
- if( isHorizMinMaxOk_C(src, stride, c->QP) )
- return 1;
- else
- return 0;
- }else{
- return 2;
- }
-}
-
-static inline int vertClassify_C(uint8_t src[], int stride, PPContext *c){
- if( isVertDC_C(src, stride, c) ){
- if( isVertMinMaxOk_C(src, stride, c->QP) )
- return 1;
- else
- return 0;
- }else{
- return 2;
- }
-}
-
-static inline void doHorizDefFilter_C(uint8_t dst[], int stride, PPContext *c)
-{
- int y;
- for(y=0; y<BLOCK_SIZE; y++)
- {
- const int middleEnergy= 5*(dst[4] - dst[3]) + 2*(dst[2] - dst[5]);
-
- if(ABS(middleEnergy) < 8*c->QP)
- {
- const int q=(dst[3] - dst[4])/2;
- const int leftEnergy= 5*(dst[2] - dst[1]) + 2*(dst[0] - dst[3]);
- const int rightEnergy= 5*(dst[6] - dst[5]) + 2*(dst[4] - dst[7]);
-
- int d= ABS(middleEnergy) - MIN( ABS(leftEnergy), ABS(rightEnergy) );
- d= MAX(d, 0);
-
- d= (5*d + 32) >> 6;
- d*= SIGN(-middleEnergy);
-
- if(q>0)
- {
- d= d<0 ? 0 : d;
- d= d>q ? q : d;
- }
- else
- {
- d= d>0 ? 0 : d;
- d= d<q ? q : d;
- }
-
- dst[3]-= d;
- dst[4]+= d;
- }
- dst+= stride;
- }
-}
-
-/**
- * Do a horizontal low pass filter on the 10x8 block (dst points to middle 8x8 Block)
- * using the 9-Tap Filter (1,1,2,2,4,2,2,1,1)/16 (C version)
- */
-static inline void doHorizLowPass_C(uint8_t dst[], int stride, PPContext *c)
-{
- int y;
- for(y=0; y<BLOCK_SIZE; y++)
- {
- const int first= ABS(dst[-1] - dst[0]) < c->QP ? dst[-1] : dst[0];
- const int last= ABS(dst[8] - dst[7]) < c->QP ? dst[8] : dst[7];
-
- int sums[10];
- sums[0] = 4*first + dst[0] + dst[1] + dst[2] + 4;
- sums[1] = sums[0] - first + dst[3];
- sums[2] = sums[1] - first + dst[4];
- sums[3] = sums[2] - first + dst[5];
- sums[4] = sums[3] - first + dst[6];
- sums[5] = sums[4] - dst[0] + dst[7];
- sums[6] = sums[5] - dst[1] + last;
- sums[7] = sums[6] - dst[2] + last;
- sums[8] = sums[7] - dst[3] + last;
- sums[9] = sums[8] - dst[4] + last;
-
- dst[0]= (sums[0] + sums[2] + 2*dst[0])>>4;
- dst[1]= (sums[1] + sums[3] + 2*dst[1])>>4;
- dst[2]= (sums[2] + sums[4] + 2*dst[2])>>4;
- dst[3]= (sums[3] + sums[5] + 2*dst[3])>>4;
- dst[4]= (sums[4] + sums[6] + 2*dst[4])>>4;
- dst[5]= (sums[5] + sums[7] + 2*dst[5])>>4;
- dst[6]= (sums[6] + sums[8] + 2*dst[6])>>4;
- dst[7]= (sums[7] + sums[9] + 2*dst[7])>>4;
-
- dst+= stride;
- }
-}
-
-/**
- * Experimental Filter 1 (Horizontal)
- * will not damage linear gradients
- * Flat blocks should look like they where passed through the (1,1,2,2,4,2,2,1,1) 9-Tap filter
- * can only smooth blocks at the expected locations (it cant smooth them if they did move)
- * MMX2 version does correct clipping C version doesnt
- * not identical with the vertical one
- */
-static inline void horizX1Filter(uint8_t *src, int stride, int QP)
-{
- int y;
- static uint64_t *lut= NULL;
- if(lut==NULL)
- {
- int i;
- lut= (uint64_t*)memalign(8, 256*8);
- for(i=0; i<256; i++)
- {
- int v= i < 128 ? 2*i : 2*(i-256);
-/*
-//Simulate 112242211 9-Tap filter
- uint64_t a= (v/16) & 0xFF;
- uint64_t b= (v/8) & 0xFF;
- uint64_t c= (v/4) & 0xFF;
- uint64_t d= (3*v/8) & 0xFF;
-*/
-//Simulate piecewise linear interpolation
- uint64_t a= (v/16) & 0xFF;
- uint64_t b= (v*3/16) & 0xFF;
- uint64_t c= (v*5/16) & 0xFF;
- uint64_t d= (7*v/16) & 0xFF;
- uint64_t A= (0x100 - a)&0xFF;
- uint64_t B= (0x100 - b)&0xFF;
- uint64_t C= (0x100 - c)&0xFF;
- uint64_t D= (0x100 - c)&0xFF;
-
- lut[i] = (a<<56) | (b<<48) | (c<<40) | (d<<32) |
- (D<<24) | (C<<16) | (B<<8) | (A);
- //lut[i] = (v<<32) | (v<<24);
- }
- }
-
- for(y=0; y<BLOCK_SIZE; y++)
- {
- int a= src[1] - src[2];
- int b= src[3] - src[4];
- int c= src[5] - src[6];
-
- int d= MAX(ABS(b) - (ABS(a) + ABS(c))/2, 0);
-
- if(d < QP)
- {
- int v = d * SIGN(-b);
-
- src[1] +=v/8;
- src[2] +=v/4;
- src[3] +=3*v/8;
- src[4] -=3*v/8;
- src[5] -=v/4;
- src[6] -=v/8;
-
- }
- src+=stride;
- }
-}
-
-/**
- * accurate deblock filter
- */
-static always_inline void do_a_deblock_C(uint8_t *src, int step, int stride, PPContext *c){
- int y;
- const int QP= c->QP;
- const int dcOffset= ((c->nonBQP*c->ppMode.baseDcDiff)>>8) + 1;
- const int dcThreshold= dcOffset*2 + 1;
-//START_TIMER
- src+= step*4; // src points to begin of the 8x8 Block
- for(y=0; y<8; y++){
- int numEq= 0;
-
- if(((unsigned)(src[-1*step] - src[0*step] + dcOffset)) < dcThreshold) numEq++;
- if(((unsigned)(src[ 0*step] - src[1*step] + dcOffset)) < dcThreshold) numEq++;
- if(((unsigned)(src[ 1*step] - src[2*step] + dcOffset)) < dcThreshold) numEq++;
- if(((unsigned)(src[ 2*step] - src[3*step] + dcOffset)) < dcThreshold) numEq++;
- if(((unsigned)(src[ 3*step] - src[4*step] + dcOffset)) < dcThreshold) numEq++;
- if(((unsigned)(src[ 4*step] - src[5*step] + dcOffset)) < dcThreshold) numEq++;
- if(((unsigned)(src[ 5*step] - src[6*step] + dcOffset)) < dcThreshold) numEq++;
- if(((unsigned)(src[ 6*step] - src[7*step] + dcOffset)) < dcThreshold) numEq++;
- if(((unsigned)(src[ 7*step] - src[8*step] + dcOffset)) < dcThreshold) numEq++;
- if(numEq > c->ppMode.flatnessThreshold){
- int min, max, x;
-
- if(src[0] > src[step]){
- max= src[0];
- min= src[step];
- }else{
- max= src[step];
- min= src[0];
- }
- for(x=2; x<8; x+=2){
- if(src[x*step] > src[(x+1)*step]){
- if(src[x *step] > max) max= src[ x *step];
- if(src[(x+1)*step] < min) min= src[(x+1)*step];
- }else{
- if(src[(x+1)*step] > max) max= src[(x+1)*step];
- if(src[ x *step] < min) min= src[ x *step];
- }
- }
- if(max-min < 2*QP){
- const int first= ABS(src[-1*step] - src[0]) < QP ? src[-1*step] : src[0];
- const int last= ABS(src[8*step] - src[7*step]) < QP ? src[8*step] : src[7*step];
-
- int sums[10];
- sums[0] = 4*first + src[0*step] + src[1*step] + src[2*step] + 4;
- sums[1] = sums[0] - first + src[3*step];
- sums[2] = sums[1] - first + src[4*step];
- sums[3] = sums[2] - first + src[5*step];
- sums[4] = sums[3] - first + src[6*step];
- sums[5] = sums[4] - src[0*step] + src[7*step];
- sums[6] = sums[5] - src[1*step] + last;
- sums[7] = sums[6] - src[2*step] + last;
- sums[8] = sums[7] - src[3*step] + last;
- sums[9] = sums[8] - src[4*step] + last;
-
- src[0*step]= (sums[0] + sums[2] + 2*src[0*step])>>4;
- src[1*step]= (sums[1] + sums[3] + 2*src[1*step])>>4;
- src[2*step]= (sums[2] + sums[4] + 2*src[2*step])>>4;
- src[3*step]= (sums[3] + sums[5] + 2*src[3*step])>>4;
- src[4*step]= (sums[4] + sums[6] + 2*src[4*step])>>4;
- src[5*step]= (sums[5] + sums[7] + 2*src[5*step])>>4;
- src[6*step]= (sums[6] + sums[8] + 2*src[6*step])>>4;
- src[7*step]= (sums[7] + sums[9] + 2*src[7*step])>>4;
- }
- }else{
- const int middleEnergy= 5*(src[4*step] - src[3*step]) + 2*(src[2*step] - src[5*step]);
-
- if(ABS(middleEnergy) < 8*QP)
- {
- const int q=(src[3*step] - src[4*step])/2;
- const int leftEnergy= 5*(src[2*step] - src[1*step]) + 2*(src[0*step] - src[3*step]);
- const int rightEnergy= 5*(src[6*step] - src[5*step]) + 2*(src[4*step] - src[7*step]);
-
- int d= ABS(middleEnergy) - MIN( ABS(leftEnergy), ABS(rightEnergy) );
- d= MAX(d, 0);
-
- d= (5*d + 32) >> 6;
- d*= SIGN(-middleEnergy);
-
- if(q>0)
- {
- d= d<0 ? 0 : d;
- d= d>q ? q : d;
- }
- else
- {
- d= d>0 ? 0 : d;
- d= d<q ? q : d;
- }
-
- src[3*step]-= d;
- src[4*step]+= d;
- }
- }
-
- src += stride;
- }
-/*if(step==16){
- STOP_TIMER("step16")
-}else{
- STOP_TIMER("stepX")
-}*/
-}
-
-//Note: we have C, MMX, MMX2, 3DNOW version there is no 3DNOW+MMX2 one
-//Plain C versions
-#if !defined (HAVE_MMX) || defined (RUNTIME_CPUDETECT)
-#define COMPILE_C
-#endif
-
-#ifdef ARCH_POWERPC
-#ifdef HAVE_ALTIVEC
-#define COMPILE_ALTIVEC
-#endif //HAVE_ALTIVEC
-#endif //ARCH_POWERPC
-
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
-
-#if (defined (HAVE_MMX) && !defined (HAVE_3DNOW) && !defined (HAVE_MMX2)) || defined (RUNTIME_CPUDETECT)
-#define COMPILE_MMX
-#endif
-
-#if defined (HAVE_MMX2) || defined (RUNTIME_CPUDETECT)
-#define COMPILE_MMX2
-#endif
-
-#if (defined (HAVE_3DNOW) && !defined (HAVE_MMX2)) || defined (RUNTIME_CPUDETECT)
-#define COMPILE_3DNOW
-#endif
-#endif //ARCH_X86
-
-#undef HAVE_MMX
-#undef HAVE_MMX2
-#undef HAVE_3DNOW
-#undef HAVE_ALTIVEC
-
-#ifdef COMPILE_C
-#undef HAVE_MMX
-#undef HAVE_MMX2
-#undef HAVE_3DNOW
-#define RENAME(a) a ## _C
-#include "postprocess_template.c"
-#endif
-
-#ifdef ARCH_POWERPC
-#ifdef COMPILE_ALTIVEC
-#undef RENAME
-#define HAVE_ALTIVEC
-#define RENAME(a) a ## _altivec
-#include "postprocess_altivec_template.c"
-#include "postprocess_template.c"
-#endif
-#endif //ARCH_POWERPC
-
-//MMX versions
-#ifdef COMPILE_MMX
-#undef RENAME
-#define HAVE_MMX
-#undef HAVE_MMX2
-#undef HAVE_3DNOW
-#define RENAME(a) a ## _MMX
-#include "postprocess_template.c"
-#endif
-
-//MMX2 versions
-#ifdef COMPILE_MMX2
-#undef RENAME
-#define HAVE_MMX
-#define HAVE_MMX2
-#undef HAVE_3DNOW
-#define RENAME(a) a ## _MMX2
-#include "postprocess_template.c"
-#endif
-
-//3DNOW versions
-#ifdef COMPILE_3DNOW
-#undef RENAME
-#define HAVE_MMX
-#undef HAVE_MMX2
-#define HAVE_3DNOW
-#define RENAME(a) a ## _3DNow
-#include "postprocess_template.c"
-#endif
-
-// minor note: the HAVE_xyz is messed up after that line so dont use it
-
-static inline void postProcess(uint8_t src[], int srcStride, uint8_t dst[], int dstStride, int width, int height,
- QP_STORE_T QPs[], int QPStride, int isColor, pp_mode_t *vm, pp_context_t *vc)
-{
- PPContext *c= (PPContext *)vc;
- PPMode *ppMode= (PPMode *)vm;
- c->ppMode= *ppMode; //FIXME
-
- // useing ifs here as they are faster than function pointers allthough the
- // difference wouldnt be messureable here but its much better because
- // someone might exchange the cpu whithout restarting mplayer ;)
-#ifdef RUNTIME_CPUDETECT
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
- // ordered per speed fasterst first
- if(c->cpuCaps & PP_CPU_CAPS_MMX2)
- postProcess_MMX2(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c);
- else if(c->cpuCaps & PP_CPU_CAPS_3DNOW)
- postProcess_3DNow(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c);
- else if(c->cpuCaps & PP_CPU_CAPS_MMX)
- postProcess_MMX(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c);
- else
- postProcess_C(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c);
-#else
-#ifdef ARCH_POWERPC
-#ifdef HAVE_ALTIVEC
- if(c->cpuCaps & PP_CPU_CAPS_ALTIVEC)
- postProcess_altivec(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c);
- else
-#endif
-#endif
- postProcess_C(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c);
-#endif
-#else //RUNTIME_CPUDETECT
-#ifdef HAVE_MMX2
- postProcess_MMX2(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c);
-#elif defined (HAVE_3DNOW)
- postProcess_3DNow(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c);
-#elif defined (HAVE_MMX)
- postProcess_MMX(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c);
-#elif defined (HAVE_ALTIVEC)
- postProcess_altivec(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c);
-#else
- postProcess_C(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c);
-#endif
-#endif //!RUNTIME_CPUDETECT
-}
-
-//static void postProcess(uint8_t src[], int srcStride, uint8_t dst[], int dstStride, int width, int height,
-// QP_STORE_T QPs[], int QPStride, int isColor, struct PPMode *ppMode);
-
-/* -pp Command line Help
-*/
-char *pp_help=
-"Available postprocessing filters:\n"
-"Filters Options\n"
-"short long name short long option Description\n"
-"* * a autoq CPU power dependent enabler\n"
-" c chrom chrominance filtering enabled\n"
-" y nochrom chrominance filtering disabled\n"
-" n noluma luma filtering disabled\n"
-"hb hdeblock (2 threshold) horizontal deblocking filter\n"
-" 1. difference factor: default=32, higher -> more deblocking\n"
-" 2. flatness threshold: default=39, lower -> more deblocking\n"
-" the h & v deblocking filters share these\n"
-" so you can't set different thresholds for h / v\n"
-"vb vdeblock (2 threshold) vertical deblocking filter\n"
-"ha hadeblock (2 threshold) horizontal deblocking filter\n"
-"va vadeblock (2 threshold) vertical deblocking filter\n"
-"h1 x1hdeblock experimental h deblock filter 1\n"
-"v1 x1vdeblock experimental v deblock filter 1\n"
-"dr dering deringing filter\n"
-"al autolevels automatic brightness / contrast\n"
-" f fullyrange stretch luminance to (0..255)\n"
-"lb linblenddeint linear blend deinterlacer\n"
-"li linipoldeint linear interpolating deinterlace\n"
-"ci cubicipoldeint cubic interpolating deinterlacer\n"
-"md mediandeint median deinterlacer\n"
-"fd ffmpegdeint ffmpeg deinterlacer\n"
-"l5 lowpass5 FIR lowpass deinterlacer\n"
-"de default hb:a,vb:a,dr:a\n"
-"fa fast h1:a,v1:a,dr:a\n"
-"ac ha:a:128:7,va:a,dr:a\n"
-"tn tmpnoise (3 threshold) temporal noise reducer\n"
-" 1. <= 2. <= 3. larger -> stronger filtering\n"
-"fq forceQuant <quantizer> force quantizer\n"
-"Usage:\n"
-"<filterName>[:<option>[:<option>...]][[,|/][-]<filterName>[:<option>...]]...\n"
-"long form example:\n"
-"vdeblock:autoq/hdeblock:autoq/linblenddeint default,-vdeblock\n"
-"short form example:\n"
-"vb:a/hb:a/lb de,-vb\n"
-"more examples:\n"
-"tn:64:128:256\n"
-;
-
-pp_mode_t *pp_get_mode_by_name_and_quality(char *name, int quality)
-{
- char temp[GET_MODE_BUFFER_SIZE];
- char *p= temp;
- char *filterDelimiters= ",/";
- char *optionDelimiters= ":";
- struct PPMode *ppMode;
- char *filterToken;
-
- ppMode= memalign(8, sizeof(PPMode));
-
- ppMode->lumMode= 0;
- ppMode->chromMode= 0;
- ppMode->maxTmpNoise[0]= 700;
- ppMode->maxTmpNoise[1]= 1500;
- ppMode->maxTmpNoise[2]= 3000;
- ppMode->maxAllowedY= 234;
- ppMode->minAllowedY= 16;
- ppMode->baseDcDiff= 256/8;
- ppMode->flatnessThreshold= 56-16-1;
- ppMode->maxClippedThreshold= 0.01;
- ppMode->error=0;
-
- strncpy(temp, name, GET_MODE_BUFFER_SIZE);
-
- if(verbose>1) printf("pp: %s\n", name);
-
- for(;;){
- char *filterName;
- int q= 1000000; //PP_QUALITY_MAX;
- int chrom=-1;
- int luma=-1;
- char *option;
- char *options[OPTIONS_ARRAY_SIZE];
- int i;
- int filterNameOk=0;
- int numOfUnknownOptions=0;
- int enable=1; //does the user want us to enabled or disabled the filter
-
- filterToken= strtok(p, filterDelimiters);
- if(filterToken == NULL) break;
- p+= strlen(filterToken) + 1; // p points to next filterToken
- filterName= strtok(filterToken, optionDelimiters);
- if(verbose>1) printf("pp: %s::%s\n", filterToken, filterName);
-
- if(*filterName == '-')
- {
- enable=0;
- filterName++;
- }
-
- for(;;){ //for all options
- option= strtok(NULL, optionDelimiters);
- if(option == NULL) break;
-
- if(verbose>1) printf("pp: option: %s\n", option);
- if(!strcmp("autoq", option) || !strcmp("a", option)) q= quality;
- else if(!strcmp("nochrom", option) || !strcmp("y", option)) chrom=0;
- else if(!strcmp("chrom", option) || !strcmp("c", option)) chrom=1;
- else if(!strcmp("noluma", option) || !strcmp("n", option)) luma=0;
- else
- {
- options[numOfUnknownOptions] = option;
- numOfUnknownOptions++;
- }
- if(numOfUnknownOptions >= OPTIONS_ARRAY_SIZE-1) break;
- }
- options[numOfUnknownOptions] = NULL;
-
- /* replace stuff from the replace Table */
- for(i=0; replaceTable[2*i]!=NULL; i++)
- {
- if(!strcmp(replaceTable[2*i], filterName))
- {
- int newlen= strlen(replaceTable[2*i + 1]);
- int plen;
- int spaceLeft;
-
- if(p==NULL) p= temp, *p=0; //last filter
- else p--, *p=','; //not last filter
-
- plen= strlen(p);
- spaceLeft= p - temp + plen;
- if(spaceLeft + newlen >= GET_MODE_BUFFER_SIZE)
- {
- ppMode->error++;
- break;
- }
- memmove(p + newlen, p, plen+1);
- memcpy(p, replaceTable[2*i + 1], newlen);
- filterNameOk=1;
- }
- }
-
- for(i=0; filters[i].shortName!=NULL; i++)
- {
-// printf("Compareing %s, %s, %s\n", filters[i].shortName,filters[i].longName, filterName);
- if( !strcmp(filters[i].longName, filterName)
- || !strcmp(filters[i].shortName, filterName))
- {
- ppMode->lumMode &= ~filters[i].mask;
- ppMode->chromMode &= ~filters[i].mask;
-
- filterNameOk=1;
- if(!enable) break; // user wants to disable it
-
- if(q >= filters[i].minLumQuality && luma)
- ppMode->lumMode|= filters[i].mask;
- if(chrom==1 || (chrom==-1 && filters[i].chromDefault))
- if(q >= filters[i].minChromQuality)
- ppMode->chromMode|= filters[i].mask;
-
- if(filters[i].mask == LEVEL_FIX)
- {
- int o;
- ppMode->minAllowedY= 16;
- ppMode->maxAllowedY= 234;
- for(o=0; options[o]!=NULL; o++)
- {
- if( !strcmp(options[o],"fullyrange")
- ||!strcmp(options[o],"f"))
- {
- ppMode->minAllowedY= 0;
- ppMode->maxAllowedY= 255;
- numOfUnknownOptions--;
- }
- }
- }
- else if(filters[i].mask == TEMP_NOISE_FILTER)
- {
- int o;
- int numOfNoises=0;
-
- for(o=0; options[o]!=NULL; o++)
- {
- char *tail;
- ppMode->maxTmpNoise[numOfNoises]=
- strtol(options[o], &tail, 0);
- if(tail!=options[o])
- {
- numOfNoises++;
- numOfUnknownOptions--;
- if(numOfNoises >= 3) break;
- }
- }
- }
- else if(filters[i].mask == V_DEBLOCK || filters[i].mask == H_DEBLOCK
- || filters[i].mask == V_A_DEBLOCK || filters[i].mask == H_A_DEBLOCK)
- {
- int o;
-
- for(o=0; options[o]!=NULL && o<2; o++)
- {
- char *tail;
- int val= strtol(options[o], &tail, 0);
- if(tail==options[o]) break;
-
- numOfUnknownOptions--;
- if(o==0) ppMode->baseDcDiff= val;
- else ppMode->flatnessThreshold= val;
- }
- }
- else if(filters[i].mask == FORCE_QUANT)
- {
- int o;
- ppMode->forcedQuant= 15;
-
- for(o=0; options[o]!=NULL && o<1; o++)
- {
- char *tail;
- int val= strtol(options[o], &tail, 0);
- if(tail==options[o]) break;
-
- numOfUnknownOptions--;
- ppMode->forcedQuant= val;
- }
- }
- }
- }
- if(!filterNameOk) ppMode->error++;
- ppMode->error += numOfUnknownOptions;
- }
-
- if(verbose>1) printf("pp: lumMode=%X, chromMode=%X\n", ppMode->lumMode, ppMode->chromMode);
- if(ppMode->error)
- {
- fprintf(stderr, "%d errors in postprocess string \"%s\"\n", ppMode->error, name);
- free(ppMode);
- return NULL;
- }
- return ppMode;
-}
-
-void pp_free_mode(pp_mode_t *mode){
- if(mode) free(mode);
-}
-
-static void reallocAlign(void **p, int alignment, int size){
- if(*p) free(*p);
- *p= memalign(alignment, size);
- memset(*p, 0, size);
-}
-
-static void reallocBuffers(PPContext *c, int width, int height, int stride, int qpStride){
- int mbWidth = (width+15)>>4;
- int mbHeight= (height+15)>>4;
- int i;
-
- c->stride= stride;
- c->qpStride= qpStride;
-
- reallocAlign((void **)&c->tempDst, 8, stride*24);
- reallocAlign((void **)&c->tempSrc, 8, stride*24);
- reallocAlign((void **)&c->tempBlocks, 8, 2*16*8);
- reallocAlign((void **)&c->yHistogram, 8, 256*sizeof(uint64_t));
- for(i=0; i<256; i++)
- c->yHistogram[i]= width*height/64*15/256;
-
- for(i=0; i<3; i++)
- {
- //Note:the +17*1024 is just there so i dont have to worry about r/w over te end
- reallocAlign((void **)&c->tempBlured[i], 8, stride*mbHeight*16 + 17*1024);
- reallocAlign((void **)&c->tempBluredPast[i], 8, 256*((height+7)&(~7))/2 + 17*1024);//FIXME size
- }
-
- reallocAlign((void **)&c->deintTemp, 8, 2*width+32);
- reallocAlign((void **)&c->nonBQPTable, 8, qpStride*mbHeight*sizeof(QP_STORE_T));
- reallocAlign((void **)&c->stdQPTable, 8, qpStride*mbHeight*sizeof(QP_STORE_T));
- reallocAlign((void **)&c->forcedQPTable, 8, mbWidth*sizeof(QP_STORE_T));
-}
-
-static void global_init(void){
- int i;
- memset(clip_table, 0, 256);
- for(i=256; i<512; i++)
- clip_table[i]= i;
- memset(clip_table+512, 0, 256);
-}
-
-pp_context_t *pp_get_context(int width, int height, int cpuCaps){
- PPContext *c= memalign(32, sizeof(PPContext));
- int stride= (width+15)&(~15); //assumed / will realloc if needed
- int qpStride= (width+15)/16 + 2; //assumed / will realloc if needed
-
- global_init();
-
- memset(c, 0, sizeof(PPContext));
- c->cpuCaps= cpuCaps;
- if(cpuCaps&PP_FORMAT){
- c->hChromaSubSample= cpuCaps&0x3;
- c->vChromaSubSample= (cpuCaps>>4)&0x3;
- }else{
- c->hChromaSubSample= 1;
- c->vChromaSubSample= 1;
- }
-
- reallocBuffers(c, width, height, stride, qpStride);
-
- c->frameNum=-1;
-
- return c;
-}
-
-void pp_free_context(void *vc){
- PPContext *c = (PPContext*)vc;
- int i;
-
- for(i=0; i<3; i++) free(c->tempBlured[i]);
- for(i=0; i<3; i++) free(c->tempBluredPast[i]);
-
- free(c->tempBlocks);
- free(c->yHistogram);
- free(c->tempDst);
- free(c->tempSrc);
- free(c->deintTemp);
- free(c->stdQPTable);
- free(c->nonBQPTable);
- free(c->forcedQPTable);
-
- memset(c, 0, sizeof(PPContext));
-
- free(c);
-}
-
-void pp_postprocess(uint8_t * src[3], int srcStride[3],
- uint8_t * dst[3], int dstStride[3],
- int width, int height,
- QP_STORE_T *QP_store, int QPStride,
- pp_mode_t *vm, void *vc, int pict_type)
-{
- int mbWidth = (width+15)>>4;
- int mbHeight= (height+15)>>4;
- PPMode *mode = (PPMode*)vm;
- PPContext *c = (PPContext*)vc;
- int minStride= MAX(ABS(srcStride[0]), ABS(dstStride[0]));
- int absQPStride = ABS(QPStride);
-
- // c->stride and c->QPStride are always positive
- if(c->stride < minStride || c->qpStride < absQPStride)
- reallocBuffers(c, width, height,
- MAX(minStride, c->stride),
- MAX(c->qpStride, absQPStride));
-
- if(QP_store==NULL || (mode->lumMode & FORCE_QUANT))
- {
- int i;
- QP_store= c->forcedQPTable;
- absQPStride = QPStride = 0;
- if(mode->lumMode & FORCE_QUANT)
- for(i=0; i<mbWidth; i++) QP_store[i]= mode->forcedQuant;
- else
- for(i=0; i<mbWidth; i++) QP_store[i]= 1;
- }
-//printf("pict_type:%d\n", pict_type);
-
- if(pict_type & PP_PICT_TYPE_QP2){
- int i;
- const int count= mbHeight * absQPStride;
- for(i=0; i<(count>>2); i++){
- ((uint32_t*)c->stdQPTable)[i] = (((uint32_t*)QP_store)[i]>>1) & 0x7F7F7F7F;
- }
- for(i<<=2; i<count; i++){
- c->stdQPTable[i] = QP_store[i]>>1;
- }
- QP_store= c->stdQPTable;
- QPStride= absQPStride;
- }
-
-if(0){
-int x,y;
-for(y=0; y<mbHeight; y++){
- for(x=0; x<mbWidth; x++){
- printf("%2d ", QP_store[x + y*QPStride]);
- }
- printf("\n");
-}
- printf("\n");
-}
-
- if((pict_type&7)!=3)
- {
- if (QPStride >= 0) {
- int i;
- const int count= mbHeight * QPStride;
- for(i=0; i<(count>>2); i++){
- ((uint32_t*)c->nonBQPTable)[i] = ((uint32_t*)QP_store)[i] & 0x3F3F3F3F;
- }
- for(i<<=2; i<count; i++){
- c->nonBQPTable[i] = QP_store[i] & 0x3F;
- }
- } else {
- int i,j;
- for(i=0; i<mbHeight; i++) {
- for(j=0; j<absQPStride; j++) {
- c->nonBQPTable[i*absQPStride+j] = QP_store[i*QPStride+j] & 0x3F;
- }
- }
- }
- }
-
- if(verbose>2)
- {
- printf("using npp filters 0x%X/0x%X\n", mode->lumMode, mode->chromMode);
- }
-
- postProcess(src[0], srcStride[0], dst[0], dstStride[0],
- width, height, QP_store, QPStride, 0, mode, c);
-
- width = (width )>>c->hChromaSubSample;
- height = (height)>>c->vChromaSubSample;
-
- if(mode->chromMode)
- {
- postProcess(src[1], srcStride[1], dst[1], dstStride[1],
- width, height, QP_store, QPStride, 1, mode, c);
- postProcess(src[2], srcStride[2], dst[2], dstStride[2],
- width, height, QP_store, QPStride, 2, mode, c);
- }
- else if(srcStride[1] == dstStride[1] && srcStride[2] == dstStride[2])
- {
- linecpy(dst[1], src[1], height, srcStride[1]);
- linecpy(dst[2], src[2], height, srcStride[2]);
- }
- else
- {
- int y;
- for(y=0; y<height; y++)
- {
- memcpy(&(dst[1][y*dstStride[1]]), &(src[1][y*srcStride[1]]), width);
- memcpy(&(dst[2][y*dstStride[2]]), &(src[2][y*srcStride[2]]), width);
- }
- }
-}
-
diff --git a/src/libffmpeg/libavcodec/libpostproc/postprocess.h b/src/libffmpeg/libavcodec/libpostproc/postprocess.h
deleted file mode 100644
index 114c88a38..000000000
--- a/src/libffmpeg/libavcodec/libpostproc/postprocess.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- Copyright (C) 2001-2003 Michael Niedermayer (michaelni@gmx.at)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*/
-
-#ifndef NEWPOSTPROCESS_H
-#define NEWPOSTPROCESS_H
-
-/**
- * @file postprocess.h
- * @brief
- * external api for the pp stuff
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define LIBPOSTPROC_VERSION_INT ((51<<16)+(1<<8)+0)
-#define LIBPOSTPROC_VERSION 51.1.0
-#define LIBPOSTPROC_BUILD LIBPOSTPROC_VERSION_INT
-
-#define LIBPOSTPROC_IDENT "postproc" AV_STRINGIFY(LIBPOSTPROC_VERSION)
-
-#define PP_QUALITY_MAX 6
-
-#define QP_STORE_T int8_t
-
-typedef void pp_context_t;
-typedef void pp_mode_t;
-
-extern char *pp_help; ///< a simple help text
-
-void pp_postprocess(uint8_t * src[3], int srcStride[3],
- uint8_t * dst[3], int dstStride[3],
- int horizontalSize, int verticalSize,
- QP_STORE_T *QP_store, int QP_stride,
- pp_mode_t *mode, pp_context_t *ppContext, int pict_type);
-
-
-/**
- * returns a pp_mode_t or NULL if an error occured
- * name is the string after "-pp" on the command line
- * quality is a number from 0 to PP_QUALITY_MAX
- */
-pp_mode_t *pp_get_mode_by_name_and_quality(char *name, int quality);
-void pp_free_mode(pp_mode_t *mode);
-
-pp_context_t *pp_get_context(int width, int height, int flags);
-void pp_free_context(pp_context_t *ppContext);
-
-#define PP_CPU_CAPS_MMX 0x80000000
-#define PP_CPU_CAPS_MMX2 0x20000000
-#define PP_CPU_CAPS_3DNOW 0x40000000
-#define PP_CPU_CAPS_ALTIVEC 0x10000000
-
-#define PP_FORMAT 0x00000008
-#define PP_FORMAT_420 (0x00000011|PP_FORMAT)
-#define PP_FORMAT_422 (0x00000001|PP_FORMAT)
-#define PP_FORMAT_411 (0x00000002|PP_FORMAT)
-#define PP_FORMAT_444 (0x00000000|PP_FORMAT)
-
-#define PP_PICT_TYPE_QP2 0x00000010 ///< MPEG2 style QScale
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/src/libffmpeg/libavcodec/libpostproc/postprocess_altivec_template.c b/src/libffmpeg/libavcodec/libpostproc/postprocess_altivec_template.c
deleted file mode 100644
index 38adeb32d..000000000
--- a/src/libffmpeg/libavcodec/libpostproc/postprocess_altivec_template.c
+++ /dev/null
@@ -1,1196 +0,0 @@
-/*
- AltiVec optimizations (C) 2004 Romain Dolbeau <romain@dolbeau.org>
-
- based on code by Copyright (C) 2001-2003 Michael Niedermayer (michaelni@gmx.at)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*/
-
-
-#ifdef CONFIG_DARWIN
-#define AVV(x...) (x)
-#else
-#define AVV(x...) {x}
-#endif
-
-#define ALTIVEC_TRANSPOSE_8x8_SHORT(src_a,src_b,src_c,src_d,src_e,src_f,src_g,src_h) \
- do { \
- __typeof__(src_a) tempA1, tempB1, tempC1, tempD1; \
- __typeof__(src_a) tempE1, tempF1, tempG1, tempH1; \
- __typeof__(src_a) tempA2, tempB2, tempC2, tempD2; \
- __typeof__(src_a) tempE2, tempF2, tempG2, tempH2; \
- tempA1 = vec_mergeh (src_a, src_e); \
- tempB1 = vec_mergel (src_a, src_e); \
- tempC1 = vec_mergeh (src_b, src_f); \
- tempD1 = vec_mergel (src_b, src_f); \
- tempE1 = vec_mergeh (src_c, src_g); \
- tempF1 = vec_mergel (src_c, src_g); \
- tempG1 = vec_mergeh (src_d, src_h); \
- tempH1 = vec_mergel (src_d, src_h); \
- tempA2 = vec_mergeh (tempA1, tempE1); \
- tempB2 = vec_mergel (tempA1, tempE1); \
- tempC2 = vec_mergeh (tempB1, tempF1); \
- tempD2 = vec_mergel (tempB1, tempF1); \
- tempE2 = vec_mergeh (tempC1, tempG1); \
- tempF2 = vec_mergel (tempC1, tempG1); \
- tempG2 = vec_mergeh (tempD1, tempH1); \
- tempH2 = vec_mergel (tempD1, tempH1); \
- src_a = vec_mergeh (tempA2, tempE2); \
- src_b = vec_mergel (tempA2, tempE2); \
- src_c = vec_mergeh (tempB2, tempF2); \
- src_d = vec_mergel (tempB2, tempF2); \
- src_e = vec_mergeh (tempC2, tempG2); \
- src_f = vec_mergel (tempC2, tempG2); \
- src_g = vec_mergeh (tempD2, tempH2); \
- src_h = vec_mergel (tempD2, tempH2); \
- } while (0)
-
-
-static inline int vertClassify_altivec(uint8_t src[], int stride, PPContext *c) {
- /*
- this code makes no assumption on src or stride.
- One could remove the recomputation of the perm
- vector by assuming (stride % 16) == 0, unfortunately
- this is not always true.
- */
- register int y;
- short __attribute__ ((aligned(16))) data[8];
- int numEq;
- uint8_t *src2 = src;
- vector signed short v_dcOffset;
- vector signed short v2QP;
- vector unsigned short v4QP;
- vector unsigned short v_dcThreshold;
- const int properStride = (stride % 16);
- const int srcAlign = ((unsigned long)src2 % 16);
- const int two_vectors = ((srcAlign > 8) || properStride) ? 1 : 0;
- const vector signed int zero = vec_splat_s32(0);
- const vector signed short mask = vec_splat_s16(1);
- vector signed int v_numEq = vec_splat_s32(0);
-
- data[0] = ((c->nonBQP*c->ppMode.baseDcDiff)>>8) + 1;
- data[1] = data[0] * 2 + 1;
- data[2] = c->QP * 2;
- data[3] = c->QP * 4;
- vector signed short v_data = vec_ld(0, data);
- v_dcOffset = vec_splat(v_data, 0);
- v_dcThreshold = (vector unsigned short)vec_splat(v_data, 1);
- v2QP = vec_splat(v_data, 2);
- v4QP = (vector unsigned short)vec_splat(v_data, 3);
-
- src2 += stride * 4;
-
- vector signed short v_srcAss0, v_srcAss1, v_srcAss2, v_srcAss3, v_srcAss4, v_srcAss5, v_srcAss6, v_srcAss7;
-
-#define LOAD_LINE(i) \
- register int j##i = i * stride; \
- vector unsigned char perm##i = vec_lvsl(j##i, src2); \
- const vector unsigned char v_srcA1##i = vec_ld(j##i, src2); \
- vector unsigned char v_srcA2##i; \
- if (two_vectors) \
- v_srcA2##i = vec_ld(j##i + 16, src2); \
- const vector unsigned char v_srcA##i = \
- vec_perm(v_srcA1##i, v_srcA2##i, perm##i); \
- v_srcAss##i = \
- (vector signed short)vec_mergeh((vector signed char)zero, \
- (vector signed char)v_srcA##i)
-
-#define LOAD_LINE_ALIGNED(i) \
- register int j##i = i * stride; \
- const vector unsigned char v_srcA##i = vec_ld(j##i, src2); \
- v_srcAss##i = \
- (vector signed short)vec_mergeh((vector signed char)zero, \
- (vector signed char)v_srcA##i)
-
- // special casing the aligned case is worthwhile, as all call from
- // the (transposed) horizontable deblocks will be aligned, i naddition
- // to the naturraly aligned vertical deblocks.
- if (properStride && srcAlign) {
- LOAD_LINE_ALIGNED(0);
- LOAD_LINE_ALIGNED(1);
- LOAD_LINE_ALIGNED(2);
- LOAD_LINE_ALIGNED(3);
- LOAD_LINE_ALIGNED(4);
- LOAD_LINE_ALIGNED(5);
- LOAD_LINE_ALIGNED(6);
- LOAD_LINE_ALIGNED(7);
- } else {
- LOAD_LINE(0);
- LOAD_LINE(1);
- LOAD_LINE(2);
- LOAD_LINE(3);
- LOAD_LINE(4);
- LOAD_LINE(5);
- LOAD_LINE(6);
- LOAD_LINE(7);
- }
-#undef LOAD_LINE
-#undef LOAD_LINE_ALIGNED
-
-#define ITER(i, j) \
- const vector signed short v_diff##i = \
- vec_sub(v_srcAss##i, v_srcAss##j); \
- const vector signed short v_sum##i = \
- vec_add(v_diff##i, v_dcOffset); \
- const vector signed short v_comp##i = \
- (vector signed short)vec_cmplt((vector unsigned short)v_sum##i, \
- v_dcThreshold); \
- const vector signed short v_part##i = vec_and(mask, v_comp##i); \
- v_numEq = vec_sum4s(v_part##i, v_numEq);
-
- ITER(0, 1);
- ITER(1, 2);
- ITER(2, 3);
- ITER(3, 4);
- ITER(4, 5);
- ITER(5, 6);
- ITER(6, 7);
-#undef ITER
-
- v_numEq = vec_sums(v_numEq, zero);
-
- v_numEq = vec_splat(v_numEq, 3);
- vec_ste(v_numEq, 0, &numEq);
-
- if (numEq > c->ppMode.flatnessThreshold)
- {
- const vector unsigned char mmoP1 = (const vector unsigned char)
- AVV(0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f,
- 0x00, 0x01, 0x12, 0x13, 0x08, 0x09, 0x1A, 0x1B);
- const vector unsigned char mmoP2 = (const vector unsigned char)
- AVV(0x04, 0x05, 0x16, 0x17, 0x0C, 0x0D, 0x1E, 0x1F,
- 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f);
- const vector unsigned char mmoP = (const vector unsigned char)
- vec_lvsl(8, (unsigned char*)0);
-
- vector signed short mmoL1 = vec_perm(v_srcAss0, v_srcAss2, mmoP1);
- vector signed short mmoL2 = vec_perm(v_srcAss4, v_srcAss6, mmoP2);
- vector signed short mmoL = vec_perm(mmoL1, mmoL2, mmoP);
- vector signed short mmoR1 = vec_perm(v_srcAss5, v_srcAss7, mmoP1);
- vector signed short mmoR2 = vec_perm(v_srcAss1, v_srcAss3, mmoP2);
- vector signed short mmoR = vec_perm(mmoR1, mmoR2, mmoP);
- vector signed short mmoDiff = vec_sub(mmoL, mmoR);
- vector unsigned short mmoSum = (vector unsigned short)vec_add(mmoDiff, v2QP);
-
- if (vec_any_gt(mmoSum, v4QP))
- return 0;
- else
- return 1;
- }
- else return 2;
-}
-
-static inline void doVertLowPass_altivec(uint8_t *src, int stride, PPContext *c) {
- /*
- this code makes no assumption on src or stride.
- One could remove the recomputation of the perm
- vector by assuming (stride % 16) == 0, unfortunately
- this is not always true. Quite a lot of load/stores
- can be removed by assuming proper alignement of
- src & stride :-(
- */
- uint8_t *src2 = src;
- const vector signed int zero = vec_splat_s32(0);
- const int properStride = (stride % 16);
- const int srcAlign = ((unsigned long)src2 % 16);
- short __attribute__ ((aligned(16))) qp[8];
- qp[0] = c->QP;
- vector signed short vqp = vec_ld(0, qp);
- vqp = vec_splat(vqp, 0);
-
- src2 += stride*3;
-
- vector signed short vb0, vb1, vb2, vb3, vb4, vb5, vb6, vb7, vb8, vb9;
- vector unsigned char vbA0, vbA1, vbA2, vbA3, vbA4, vbA5, vbA6, vbA7, vbA8, vbA9;
- vector unsigned char vbB0, vbB1, vbB2, vbB3, vbB4, vbB5, vbB6, vbB7, vbB8, vbB9;
- vector unsigned char vbT0, vbT1, vbT2, vbT3, vbT4, vbT5, vbT6, vbT7, vbT8, vbT9;
-
-#define LOAD_LINE(i) \
- const vector unsigned char perml##i = \
- vec_lvsl(i * stride, src2); \
- vbA##i = vec_ld(i * stride, src2); \
- vbB##i = vec_ld(i * stride + 16, src2); \
- vbT##i = vec_perm(vbA##i, vbB##i, perml##i); \
- vb##i = \
- (vector signed short)vec_mergeh((vector unsigned char)zero, \
- (vector unsigned char)vbT##i)
-
-#define LOAD_LINE_ALIGNED(i) \
- register int j##i = i * stride; \
- vbT##i = vec_ld(j##i, src2); \
- vb##i = \
- (vector signed short)vec_mergeh((vector signed char)zero, \
- (vector signed char)vbT##i)
-
- // special casing the aligned case is worthwhile, as all call from
- // the (transposed) horizontable deblocks will be aligned, in addition
- // to the naturraly aligned vertical deblocks.
- if (properStride && srcAlign) {
- LOAD_LINE_ALIGNED(0);
- LOAD_LINE_ALIGNED(1);
- LOAD_LINE_ALIGNED(2);
- LOAD_LINE_ALIGNED(3);
- LOAD_LINE_ALIGNED(4);
- LOAD_LINE_ALIGNED(5);
- LOAD_LINE_ALIGNED(6);
- LOAD_LINE_ALIGNED(7);
- LOAD_LINE_ALIGNED(8);
- LOAD_LINE_ALIGNED(9);
- } else {
- LOAD_LINE(0);
- LOAD_LINE(1);
- LOAD_LINE(2);
- LOAD_LINE(3);
- LOAD_LINE(4);
- LOAD_LINE(5);
- LOAD_LINE(6);
- LOAD_LINE(7);
- LOAD_LINE(8);
- LOAD_LINE(9);
- }
-#undef LOAD_LINE
-#undef LOAD_LINE_ALIGNED
-
- const vector unsigned short v_1 = vec_splat_u16(1);
- const vector unsigned short v_2 = vec_splat_u16(2);
- const vector unsigned short v_4 = vec_splat_u16(4);
-
- const vector signed short v_diff01 = vec_sub(vb0, vb1);
- const vector unsigned short v_cmp01 =
- (const vector unsigned short) vec_cmplt(vec_abs(v_diff01), vqp);
- const vector signed short v_first = vec_sel(vb1, vb0, v_cmp01);
- const vector signed short v_diff89 = vec_sub(vb8, vb9);
- const vector unsigned short v_cmp89 =
- (const vector unsigned short) vec_cmplt(vec_abs(v_diff89), vqp);
- const vector signed short v_last = vec_sel(vb8, vb9, v_cmp89);
-
- const vector signed short temp01 = vec_mladd(v_first, (vector signed short)v_4, vb1);
- const vector signed short temp02 = vec_add(vb2, vb3);
- const vector signed short temp03 = vec_add(temp01, (vector signed short)v_4);
- const vector signed short v_sumsB0 = vec_add(temp02, temp03);
-
- const vector signed short temp11 = vec_sub(v_sumsB0, v_first);
- const vector signed short v_sumsB1 = vec_add(temp11, vb4);
-
- const vector signed short temp21 = vec_sub(v_sumsB1, v_first);
- const vector signed short v_sumsB2 = vec_add(temp21, vb5);
-
- const vector signed short temp31 = vec_sub(v_sumsB2, v_first);
- const vector signed short v_sumsB3 = vec_add(temp31, vb6);
-
- const vector signed short temp41 = vec_sub(v_sumsB3, v_first);
- const vector signed short v_sumsB4 = vec_add(temp41, vb7);
-
- const vector signed short temp51 = vec_sub(v_sumsB4, vb1);
- const vector signed short v_sumsB5 = vec_add(temp51, vb8);
-
- const vector signed short temp61 = vec_sub(v_sumsB5, vb2);
- const vector signed short v_sumsB6 = vec_add(temp61, v_last);
-
- const vector signed short temp71 = vec_sub(v_sumsB6, vb3);
- const vector signed short v_sumsB7 = vec_add(temp71, v_last);
-
- const vector signed short temp81 = vec_sub(v_sumsB7, vb4);
- const vector signed short v_sumsB8 = vec_add(temp81, v_last);
-
- const vector signed short temp91 = vec_sub(v_sumsB8, vb5);
- const vector signed short v_sumsB9 = vec_add(temp91, v_last);
-
-#define COMPUTE_VR(i, j, k) \
- const vector signed short temps1##i = \
- vec_add(v_sumsB##i, v_sumsB##k); \
- const vector signed short temps2##i = \
- vec_mladd(vb##j, (vector signed short)v_2, temps1##i); \
- const vector signed short vr##j = vec_sra(temps2##i, v_4)
-
- COMPUTE_VR(0, 1, 2);
- COMPUTE_VR(1, 2, 3);
- COMPUTE_VR(2, 3, 4);
- COMPUTE_VR(3, 4, 5);
- COMPUTE_VR(4, 5, 6);
- COMPUTE_VR(5, 6, 7);
- COMPUTE_VR(6, 7, 8);
- COMPUTE_VR(7, 8, 9);
-
- const vector signed char neg1 = vec_splat_s8(-1);
- const vector unsigned char permHH = (const vector unsigned char)AVV(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F);
-
-#define PACK_AND_STORE(i) \
- const vector unsigned char perms##i = \
- vec_lvsr(i * stride, src2); \
- const vector unsigned char vf##i = \
- vec_packsu(vr##i, (vector signed short)zero); \
- const vector unsigned char vg##i = \
- vec_perm(vf##i, vbT##i, permHH); \
- const vector unsigned char mask##i = \
- vec_perm((vector unsigned char)zero, (vector unsigned char)neg1, perms##i); \
- const vector unsigned char vg2##i = \
- vec_perm(vg##i, vg##i, perms##i); \
- const vector unsigned char svA##i = \
- vec_sel(vbA##i, vg2##i, mask##i); \
- const vector unsigned char svB##i = \
- vec_sel(vg2##i, vbB##i, mask##i); \
- vec_st(svA##i, i * stride, src2); \
- vec_st(svB##i, i * stride + 16, src2)
-
-#define PACK_AND_STORE_ALIGNED(i) \
- const vector unsigned char vf##i = \
- vec_packsu(vr##i, (vector signed short)zero); \
- const vector unsigned char vg##i = \
- vec_perm(vf##i, vbT##i, permHH); \
- vec_st(vg##i, i * stride, src2)
-
- // special casing the aligned case is worthwhile, as all call from
- // the (transposed) horizontable deblocks will be aligned, in addition
- // to the naturraly aligned vertical deblocks.
- if (properStride && srcAlign) {
- PACK_AND_STORE_ALIGNED(1);
- PACK_AND_STORE_ALIGNED(2);
- PACK_AND_STORE_ALIGNED(3);
- PACK_AND_STORE_ALIGNED(4);
- PACK_AND_STORE_ALIGNED(5);
- PACK_AND_STORE_ALIGNED(6);
- PACK_AND_STORE_ALIGNED(7);
- PACK_AND_STORE_ALIGNED(8);
- } else {
- PACK_AND_STORE(1);
- PACK_AND_STORE(2);
- PACK_AND_STORE(3);
- PACK_AND_STORE(4);
- PACK_AND_STORE(5);
- PACK_AND_STORE(6);
- PACK_AND_STORE(7);
- PACK_AND_STORE(8);
- }
-#undef PACK_AND_STORE
-#undef PACK_AND_STORE_ALIGNED
-}
-
-
-
-static inline void doVertDefFilter_altivec(uint8_t src[], int stride, PPContext *c) {
- /*
- this code makes no assumption on src or stride.
- One could remove the recomputation of the perm
- vector by assuming (stride % 16) == 0, unfortunately
- this is not always true. Quite a lot of load/stores
- can be removed by assuming proper alignement of
- src & stride :-(
- */
- uint8_t *src2 = src;
- const vector signed int zero = vec_splat_s32(0);
- short __attribute__ ((aligned(16))) qp[8];
- qp[0] = 8*c->QP;
- vector signed short vqp = vec_ld(0, qp);
- vqp = vec_splat(vqp, 0);
-
-#define LOAD_LINE(i) \
- const vector unsigned char perm##i = \
- vec_lvsl(i * stride, src2); \
- const vector unsigned char vbA##i = \
- vec_ld(i * stride, src2); \
- const vector unsigned char vbB##i = \
- vec_ld(i * stride + 16, src2); \
- const vector unsigned char vbT##i = \
- vec_perm(vbA##i, vbB##i, perm##i); \
- const vector signed short vb##i = \
- (vector signed short)vec_mergeh((vector unsigned char)zero, \
- (vector unsigned char)vbT##i)
-
- src2 += stride*3;
-
- LOAD_LINE(1);
- LOAD_LINE(2);
- LOAD_LINE(3);
- LOAD_LINE(4);
- LOAD_LINE(5);
- LOAD_LINE(6);
- LOAD_LINE(7);
- LOAD_LINE(8);
-#undef LOAD_LINE
-
- const vector signed short v_1 = vec_splat_s16(1);
- const vector signed short v_2 = vec_splat_s16(2);
- const vector signed short v_5 = vec_splat_s16(5);
- const vector signed short v_32 = vec_sl(v_1,
- (vector unsigned short)v_5);
- /* middle energy */
- const vector signed short l3minusl6 = vec_sub(vb3, vb6);
- const vector signed short l5minusl4 = vec_sub(vb5, vb4);
- const vector signed short twotimes_l3minusl6 = vec_mladd(v_2, l3minusl6, (vector signed short)zero);
- const vector signed short mE = vec_mladd(v_5, l5minusl4, twotimes_l3minusl6);
- const vector signed short absmE = vec_abs(mE);
- /* left & right energy */
- const vector signed short l1minusl4 = vec_sub(vb1, vb4);
- const vector signed short l3minusl2 = vec_sub(vb3, vb2);
- const vector signed short l5minusl8 = vec_sub(vb5, vb8);
- const vector signed short l7minusl6 = vec_sub(vb7, vb6);
- const vector signed short twotimes_l1minusl4 = vec_mladd(v_2, l1minusl4, (vector signed short)zero);
- const vector signed short twotimes_l5minusl8 = vec_mladd(v_2, l5minusl8, (vector signed short)zero);
- const vector signed short lE = vec_mladd(v_5, l3minusl2, twotimes_l1minusl4);
- const vector signed short rE = vec_mladd(v_5, l7minusl6, twotimes_l5minusl8);
- /* d */
- const vector signed short ddiff = vec_sub(absmE,
- vec_min(vec_abs(lE),
- vec_abs(rE)));
- const vector signed short ddiffclamp = vec_max(ddiff, (vector signed short)zero);
- const vector signed short dtimes64 = vec_mladd(v_5, ddiffclamp, v_32);
- const vector signed short d = vec_sra(dtimes64, vec_splat_u16(6));
- const vector signed short minusd = vec_sub((vector signed short)zero, d);
- const vector signed short finald = vec_sel(minusd,
- d,
- vec_cmpgt(vec_sub((vector signed short)zero, mE),
- (vector signed short)zero));
- /* q */
- const vector signed short qtimes2 = vec_sub(vb4, vb5);
- /* for a shift right to behave like /2, we need to add one
- to all negative integer */
- const vector signed short rounddown = vec_sel((vector signed short)zero,
- v_1,
- vec_cmplt(qtimes2, (vector signed short)zero));
- const vector signed short q = vec_sra(vec_add(qtimes2, rounddown), vec_splat_u16(1));
- /* clamp */
- const vector signed short dclamp_P1 = vec_max((vector signed short)zero, finald);
- const vector signed short dclamp_P = vec_min(dclamp_P1, q);
- const vector signed short dclamp_N1 = vec_min((vector signed short)zero, finald);
- const vector signed short dclamp_N = vec_max(dclamp_N1, q);
-
- const vector signed short dclampedfinal = vec_sel(dclamp_N,
- dclamp_P,
- vec_cmpgt(q, (vector signed short)zero));
- const vector signed short dornotd = vec_sel((vector signed short)zero,
- dclampedfinal,
- vec_cmplt(absmE, vqp));
- /* add/substract to l4 and l5 */
- const vector signed short vb4minusd = vec_sub(vb4, dornotd);
- const vector signed short vb5plusd = vec_add(vb5, dornotd);
- /* finally, stores */
- const vector unsigned char st4 = vec_packsu(vb4minusd, (vector signed short)zero);
- const vector unsigned char st5 = vec_packsu(vb5plusd, (vector signed short)zero);
-
- const vector signed char neg1 = vec_splat_s8(-1);
- const vector unsigned char permHH = (const vector unsigned char)AVV(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F);
-
-#define STORE(i) \
- const vector unsigned char perms##i = \
- vec_lvsr(i * stride, src2); \
- const vector unsigned char vg##i = \
- vec_perm(st##i, vbT##i, permHH); \
- const vector unsigned char mask##i = \
- vec_perm((vector unsigned char)zero, (vector unsigned char)neg1, perms##i); \
- const vector unsigned char vg2##i = \
- vec_perm(vg##i, vg##i, perms##i); \
- const vector unsigned char svA##i = \
- vec_sel(vbA##i, vg2##i, mask##i); \
- const vector unsigned char svB##i = \
- vec_sel(vg2##i, vbB##i, mask##i); \
- vec_st(svA##i, i * stride, src2); \
- vec_st(svB##i, i * stride + 16, src2)
-
- STORE(4);
- STORE(5);
-}
-
-static inline void dering_altivec(uint8_t src[], int stride, PPContext *c) {
- /*
- this code makes no assumption on src or stride.
- One could remove the recomputation of the perm
- vector by assuming (stride % 16) == 0, unfortunately
- this is not always true. Quite a lot of load/stores
- can be removed by assuming proper alignement of
- src & stride :-(
- */
- uint8_t *srcCopy = src;
- uint8_t __attribute__((aligned(16))) dt[16];
- const vector unsigned char vuint8_1 = vec_splat_u8(1);
- const vector signed int zero = vec_splat_s32(0);
- vector unsigned char v_dt;
- dt[0] = deringThreshold;
- v_dt = vec_splat(vec_ld(0, dt), 0);
-
-#define LOAD_LINE(i) \
- const vector unsigned char perm##i = \
- vec_lvsl(i * stride, srcCopy); \
- vector unsigned char sA##i = vec_ld(i * stride, srcCopy); \
- vector unsigned char sB##i = vec_ld(i * stride + 16, srcCopy); \
- vector unsigned char src##i = vec_perm(sA##i, sB##i, perm##i)
-
- LOAD_LINE(0);
- LOAD_LINE(1);
- LOAD_LINE(2);
- LOAD_LINE(3);
- LOAD_LINE(4);
- LOAD_LINE(5);
- LOAD_LINE(6);
- LOAD_LINE(7);
- LOAD_LINE(8);
- LOAD_LINE(9);
-#undef LOAD_LINE
-
- vector unsigned char v_avg;
- {
- const vector unsigned char trunc_perm = (vector unsigned char)
- AVV(0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
- 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18);
- const vector unsigned char trunc_src12 = vec_perm(src1, src2, trunc_perm);
- const vector unsigned char trunc_src34 = vec_perm(src3, src4, trunc_perm);
- const vector unsigned char trunc_src56 = vec_perm(src5, src6, trunc_perm);
- const vector unsigned char trunc_src78 = vec_perm(src7, src8, trunc_perm);
-
-#define EXTRACT(op) do { \
- const vector unsigned char s##op##_1 = vec_##op(trunc_src12, trunc_src34); \
- const vector unsigned char s##op##_2 = vec_##op(trunc_src56, trunc_src78); \
- const vector unsigned char s##op##_6 = vec_##op(s##op##_1, s##op##_2); \
- const vector unsigned char s##op##_8h = vec_mergeh(s##op##_6, s##op##_6); \
- const vector unsigned char s##op##_8l = vec_mergel(s##op##_6, s##op##_6); \
- const vector unsigned char s##op##_9 = vec_##op(s##op##_8h, s##op##_8l); \
- const vector unsigned char s##op##_9h = vec_mergeh(s##op##_9, s##op##_9); \
- const vector unsigned char s##op##_9l = vec_mergel(s##op##_9, s##op##_9); \
- const vector unsigned char s##op##_10 = vec_##op(s##op##_9h, s##op##_9l); \
- const vector unsigned char s##op##_10h = vec_mergeh(s##op##_10, s##op##_10); \
- const vector unsigned char s##op##_10l = vec_mergel(s##op##_10, s##op##_10); \
- const vector unsigned char s##op##_11 = vec_##op(s##op##_10h, s##op##_10l); \
- const vector unsigned char s##op##_11h = vec_mergeh(s##op##_11, s##op##_11); \
- const vector unsigned char s##op##_11l = vec_mergel(s##op##_11, s##op##_11); \
- v_##op = vec_##op(s##op##_11h, s##op##_11l); } while (0)
-
- vector unsigned char v_min;
- vector unsigned char v_max;
- EXTRACT(min);
- EXTRACT(max);
-#undef EXTRACT
-
- if (vec_all_lt(vec_sub(v_max, v_min), v_dt))
- return;
-
- v_avg = vec_avg(v_min, v_max);
- }
-
- signed int __attribute__((aligned(16))) S[8];
- {
- const vector unsigned short mask1 = (vector unsigned short)
- AVV(0x0001, 0x0002, 0x0004, 0x0008,
- 0x0010, 0x0020, 0x0040, 0x0080);
- const vector unsigned short mask2 = (vector unsigned short)
- AVV(0x0100, 0x0200, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000);
-
- const vector unsigned int vuint32_16 = vec_sl(vec_splat_u32(1), vec_splat_u32(4));
- const vector unsigned int vuint32_1 = vec_splat_u32(1);
-
-#define COMPARE(i) \
- vector signed int sum##i; \
- do { \
- const vector unsigned char cmp##i = \
- (vector unsigned char)vec_cmpgt(src##i, v_avg); \
- const vector unsigned short cmpHi##i = \
- (vector unsigned short)vec_mergeh(cmp##i, cmp##i); \
- const vector unsigned short cmpLi##i = \
- (vector unsigned short)vec_mergel(cmp##i, cmp##i); \
- const vector signed short cmpHf##i = \
- (vector signed short)vec_and(cmpHi##i, mask1); \
- const vector signed short cmpLf##i = \
- (vector signed short)vec_and(cmpLi##i, mask2); \
- const vector signed int sump##i = vec_sum4s(cmpHf##i, zero); \
- const vector signed int sumq##i = vec_sum4s(cmpLf##i, sump##i); \
- sum##i = vec_sums(sumq##i, zero); } while (0)
-
- COMPARE(0);
- COMPARE(1);
- COMPARE(2);
- COMPARE(3);
- COMPARE(4);
- COMPARE(5);
- COMPARE(6);
- COMPARE(7);
- COMPARE(8);
- COMPARE(9);
-#undef COMPARE
-
- vector signed int sumA2;
- vector signed int sumB2;
- {
- const vector signed int sump02 = vec_mergel(sum0, sum2);
- const vector signed int sump13 = vec_mergel(sum1, sum3);
- const vector signed int sumA = vec_mergel(sump02, sump13);
-
- const vector signed int sump46 = vec_mergel(sum4, sum6);
- const vector signed int sump57 = vec_mergel(sum5, sum7);
- const vector signed int sumB = vec_mergel(sump46, sump57);
-
- const vector signed int sump8A = vec_mergel(sum8, zero);
- const vector signed int sump9B = vec_mergel(sum9, zero);
- const vector signed int sumC = vec_mergel(sump8A, sump9B);
-
- const vector signed int tA = vec_sl(vec_nor(zero, sumA), vuint32_16);
- const vector signed int tB = vec_sl(vec_nor(zero, sumB), vuint32_16);
- const vector signed int tC = vec_sl(vec_nor(zero, sumC), vuint32_16);
- const vector signed int t2A = vec_or(sumA, tA);
- const vector signed int t2B = vec_or(sumB, tB);
- const vector signed int t2C = vec_or(sumC, tC);
- const vector signed int t3A = vec_and(vec_sra(t2A, vuint32_1),
- vec_sl(t2A, vuint32_1));
- const vector signed int t3B = vec_and(vec_sra(t2B, vuint32_1),
- vec_sl(t2B, vuint32_1));
- const vector signed int t3C = vec_and(vec_sra(t2C, vuint32_1),
- vec_sl(t2C, vuint32_1));
- const vector signed int yA = vec_and(t2A, t3A);
- const vector signed int yB = vec_and(t2B, t3B);
- const vector signed int yC = vec_and(t2C, t3C);
-
- const vector unsigned char strangeperm1 = vec_lvsl(4, (unsigned char*)0);
- const vector unsigned char strangeperm2 = vec_lvsl(8, (unsigned char*)0);
- const vector signed int sumAd4 = vec_perm(yA, yB, strangeperm1);
- const vector signed int sumAd8 = vec_perm(yA, yB, strangeperm2);
- const vector signed int sumBd4 = vec_perm(yB, yC, strangeperm1);
- const vector signed int sumBd8 = vec_perm(yB, yC, strangeperm2);
- const vector signed int sumAp = vec_and(yA,
- vec_and(sumAd4,sumAd8));
- const vector signed int sumBp = vec_and(yB,
- vec_and(sumBd4,sumBd8));
- sumA2 = vec_or(sumAp,
- vec_sra(sumAp,
- vuint32_16));
- sumB2 = vec_or(sumBp,
- vec_sra(sumBp,
- vuint32_16));
- }
- vec_st(sumA2, 0, S);
- vec_st(sumB2, 16, S);
- }
-
- /* I'm not sure the following is actually faster
- than straight, unvectorized C code :-( */
-
- int __attribute__((aligned(16))) tQP2[4];
- tQP2[0]= c->QP/2 + 1;
- vector signed int vQP2 = vec_ld(0, tQP2);
- vQP2 = vec_splat(vQP2, 0);
- const vector unsigned char vuint8_2 = vec_splat_u8(2);
- const vector signed int vsint32_8 = vec_splat_s32(8);
- const vector unsigned int vuint32_4 = vec_splat_u32(4);
-
- const vector unsigned char permA1 = (vector unsigned char)
- AVV(0x00, 0x01, 0x02, 0x10, 0x11, 0x12, 0x1F, 0x1F,
- 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F);
- const vector unsigned char permA2 = (vector unsigned char)
- AVV(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x10, 0x11,
- 0x12, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F);
- const vector unsigned char permA1inc = (vector unsigned char)
- AVV(0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
- const vector unsigned char permA2inc = (vector unsigned char)
- AVV(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
- const vector unsigned char magic = (vector unsigned char)
- AVV(0x01, 0x02, 0x01, 0x02, 0x04, 0x02, 0x01, 0x02,
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
- const vector unsigned char extractPerm = (vector unsigned char)
- AVV(0x10, 0x10, 0x10, 0x01, 0x10, 0x10, 0x10, 0x01,
- 0x10, 0x10, 0x10, 0x01, 0x10, 0x10, 0x10, 0x01);
- const vector unsigned char extractPermInc = (vector unsigned char)
- AVV(0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
- 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01);
- const vector unsigned char identity = vec_lvsl(0,(unsigned char *)0);
- const vector unsigned char tenRight = (vector unsigned char)
- AVV(0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
- const vector unsigned char eightLeft = (vector unsigned char)
- AVV(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08);
-
-
-#define F_INIT(i) \
- vector unsigned char tenRightM##i = tenRight; \
- vector unsigned char permA1M##i = permA1; \
- vector unsigned char permA2M##i = permA2; \
- vector unsigned char extractPermM##i = extractPerm
-
-#define F2(i, j, k, l) \
- if (S[i] & (1 << (l+1))) { \
- const vector unsigned char a_##j##_A##l = \
- vec_perm(src##i, src##j, permA1M##i); \
- const vector unsigned char a_##j##_B##l = \
- vec_perm(a_##j##_A##l, src##k, permA2M##i); \
- const vector signed int a_##j##_sump##l = \
- (vector signed int)vec_msum(a_##j##_B##l, magic, \
- (vector unsigned int)zero); \
- vector signed int F_##j##_##l = \
- vec_sr(vec_sums(a_##j##_sump##l, vsint32_8), vuint32_4); \
- F_##j##_##l = vec_splat(F_##j##_##l, 3); \
- const vector signed int p_##j##_##l = \
- (vector signed int)vec_perm(src##j, \
- (vector unsigned char)zero, \
- extractPermM##i); \
- const vector signed int sum_##j##_##l = vec_add( p_##j##_##l, vQP2);\
- const vector signed int diff_##j##_##l = vec_sub( p_##j##_##l, vQP2);\
- vector signed int newpm_##j##_##l; \
- if (vec_all_lt(sum_##j##_##l, F_##j##_##l)) \
- newpm_##j##_##l = sum_##j##_##l; \
- else if (vec_all_gt(diff_##j##_##l, F_##j##_##l)) \
- newpm_##j##_##l = diff_##j##_##l; \
- else newpm_##j##_##l = F_##j##_##l; \
- const vector unsigned char newpm2_##j##_##l = \
- vec_splat((vector unsigned char)newpm_##j##_##l, 15); \
- const vector unsigned char mask##j##l = vec_add(identity, \
- tenRightM##i); \
- src##j = vec_perm(src##j, newpm2_##j##_##l, mask##j##l); \
- } \
- permA1M##i = vec_add(permA1M##i, permA1inc); \
- permA2M##i = vec_add(permA2M##i, permA2inc); \
- tenRightM##i = vec_sro(tenRightM##i, eightLeft); \
- extractPermM##i = vec_add(extractPermM##i, extractPermInc)
-
-#define ITER(i, j, k) \
- F_INIT(i); \
- F2(i, j, k, 0); \
- F2(i, j, k, 1); \
- F2(i, j, k, 2); \
- F2(i, j, k, 3); \
- F2(i, j, k, 4); \
- F2(i, j, k, 5); \
- F2(i, j, k, 6); \
- F2(i, j, k, 7)
-
- ITER(0, 1, 2);
- ITER(1, 2, 3);
- ITER(2, 3, 4);
- ITER(3, 4, 5);
- ITER(4, 5, 6);
- ITER(5, 6, 7);
- ITER(6, 7, 8);
- ITER(7, 8, 9);
-
- const vector signed char neg1 = vec_splat_s8(-1);
-
-#define STORE_LINE(i) \
- const vector unsigned char permST##i = \
- vec_lvsr(i * stride, srcCopy); \
- const vector unsigned char maskST##i = \
- vec_perm((vector unsigned char)zero, \
- (vector unsigned char)neg1, permST##i); \
- src##i = vec_perm(src##i ,src##i, permST##i); \
- sA##i= vec_sel(sA##i, src##i, maskST##i); \
- sB##i= vec_sel(src##i, sB##i, maskST##i); \
- vec_st(sA##i, i * stride, srcCopy); \
- vec_st(sB##i, i * stride + 16, srcCopy)
-
- STORE_LINE(1);
- STORE_LINE(2);
- STORE_LINE(3);
- STORE_LINE(4);
- STORE_LINE(5);
- STORE_LINE(6);
- STORE_LINE(7);
- STORE_LINE(8);
-
-#undef STORE_LINE
-#undef ITER
-#undef F2
-}
-
-#define doHorizLowPass_altivec(a...) doHorizLowPass_C(a)
-#define doHorizDefFilter_altivec(a...) doHorizDefFilter_C(a)
-#define do_a_deblock_altivec(a...) do_a_deblock_C(a)
-
-static inline void RENAME(tempNoiseReducer)(uint8_t *src, int stride,
- uint8_t *tempBlured, uint32_t *tempBluredPast, int *maxNoise)
-{
- const vector signed int zero = vec_splat_s32(0);
- const vector signed short vsint16_1 = vec_splat_s16(1);
- vector signed int v_dp = zero;
- vector signed int v_sysdp = zero;
- int d, sysd, i;
-
- tempBluredPast[127]= maxNoise[0];
- tempBluredPast[128]= maxNoise[1];
- tempBluredPast[129]= maxNoise[2];
-
-#define LOAD_LINE(src, i) \
- register int j##src##i = i * stride; \
- vector unsigned char perm##src##i = vec_lvsl(j##src##i, src); \
- const vector unsigned char v_##src##A1##i = vec_ld(j##src##i, src); \
- const vector unsigned char v_##src##A2##i = vec_ld(j##src##i + 16, src); \
- const vector unsigned char v_##src##A##i = \
- vec_perm(v_##src##A1##i, v_##src##A2##i, perm##src##i); \
- vector signed short v_##src##Ass##i = \
- (vector signed short)vec_mergeh((vector signed char)zero, \
- (vector signed char)v_##src##A##i)
-
- LOAD_LINE(src, 0);
- LOAD_LINE(src, 1);
- LOAD_LINE(src, 2);
- LOAD_LINE(src, 3);
- LOAD_LINE(src, 4);
- LOAD_LINE(src, 5);
- LOAD_LINE(src, 6);
- LOAD_LINE(src, 7);
-
- LOAD_LINE(tempBlured, 0);
- LOAD_LINE(tempBlured, 1);
- LOAD_LINE(tempBlured, 2);
- LOAD_LINE(tempBlured, 3);
- LOAD_LINE(tempBlured, 4);
- LOAD_LINE(tempBlured, 5);
- LOAD_LINE(tempBlured, 6);
- LOAD_LINE(tempBlured, 7);
-#undef LOAD_LINE
-
-#define ACCUMULATE_DIFFS(i) \
- vector signed short v_d##i = vec_sub(v_tempBluredAss##i, \
- v_srcAss##i); \
- v_dp = vec_msums(v_d##i, v_d##i, v_dp); \
- v_sysdp = vec_msums(v_d##i, vsint16_1, v_sysdp)
-
- ACCUMULATE_DIFFS(0);
- ACCUMULATE_DIFFS(1);
- ACCUMULATE_DIFFS(2);
- ACCUMULATE_DIFFS(3);
- ACCUMULATE_DIFFS(4);
- ACCUMULATE_DIFFS(5);
- ACCUMULATE_DIFFS(6);
- ACCUMULATE_DIFFS(7);
-#undef ACCUMULATE_DIFFS
-
- v_dp = vec_sums(v_dp, zero);
- v_sysdp = vec_sums(v_sysdp, zero);
-
- v_dp = vec_splat(v_dp, 3);
- v_sysdp = vec_splat(v_sysdp, 3);
-
- vec_ste(v_dp, 0, &d);
- vec_ste(v_sysdp, 0, &sysd);
-
- i = d;
- d = (4*d
- +(*(tempBluredPast-256))
- +(*(tempBluredPast-1))+ (*(tempBluredPast+1))
- +(*(tempBluredPast+256))
- +4)>>3;
-
- *tempBluredPast=i;
-
- if (d > maxNoise[1]) {
- if (d < maxNoise[2]) {
-#define OP(i) v_tempBluredAss##i = vec_avg(v_tempBluredAss##i, v_srcAss##i);
-
- OP(0);
- OP(1);
- OP(2);
- OP(3);
- OP(4);
- OP(5);
- OP(6);
- OP(7);
-#undef OP
- } else {
-#define OP(i) v_tempBluredAss##i = v_srcAss##i;
-
- OP(0);
- OP(1);
- OP(2);
- OP(3);
- OP(4);
- OP(5);
- OP(6);
- OP(7);
-#undef OP
- }
- } else {
- if (d < maxNoise[0]) {
- const vector signed short vsint16_7 = vec_splat_s16(7);
- const vector signed short vsint16_4 = vec_splat_s16(4);
- const vector unsigned short vuint16_3 = vec_splat_u16(3);
-
-#define OP(i) \
- const vector signed short v_temp##i = \
- vec_mladd(v_tempBluredAss##i, \
- vsint16_7, v_srcAss##i); \
- const vector signed short v_temp2##i = \
- vec_add(v_temp##i, vsint16_4); \
- v_tempBluredAss##i = vec_sr(v_temp2##i, vuint16_3)
-
- OP(0);
- OP(1);
- OP(2);
- OP(3);
- OP(4);
- OP(5);
- OP(6);
- OP(7);
-#undef OP
- } else {
- const vector signed short vsint16_3 = vec_splat_s16(3);
- const vector signed short vsint16_2 = vec_splat_s16(2);
-
-#define OP(i) \
- const vector signed short v_temp##i = \
- vec_mladd(v_tempBluredAss##i, \
- vsint16_3, v_srcAss##i); \
- const vector signed short v_temp2##i = \
- vec_add(v_temp##i, vsint16_2); \
- v_tempBluredAss##i = vec_sr(v_temp2##i, (vector unsigned short)vsint16_2)
-
- OP(0);
- OP(1);
- OP(2);
- OP(3);
- OP(4);
- OP(5);
- OP(6);
- OP(7);
-#undef OP
- }
- }
-
- const vector signed char neg1 = vec_splat_s8(-1);
- const vector unsigned char permHH = (const vector unsigned char)AVV(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F);
-
-#define PACK_AND_STORE(src, i) \
- const vector unsigned char perms##src##i = \
- vec_lvsr(i * stride, src); \
- const vector unsigned char vf##src##i = \
- vec_packsu(v_tempBluredAss##i, (vector signed short)zero); \
- const vector unsigned char vg##src##i = \
- vec_perm(vf##src##i, v_##src##A##i, permHH); \
- const vector unsigned char mask##src##i = \
- vec_perm((vector unsigned char)zero, (vector unsigned char)neg1, perms##src##i); \
- const vector unsigned char vg2##src##i = \
- vec_perm(vg##src##i, vg##src##i, perms##src##i); \
- const vector unsigned char svA##src##i = \
- vec_sel(v_##src##A1##i, vg2##src##i, mask##src##i); \
- const vector unsigned char svB##src##i = \
- vec_sel(vg2##src##i, v_##src##A2##i, mask##src##i); \
- vec_st(svA##src##i, i * stride, src); \
- vec_st(svB##src##i, i * stride + 16, src)
-
- PACK_AND_STORE(src, 0);
- PACK_AND_STORE(src, 1);
- PACK_AND_STORE(src, 2);
- PACK_AND_STORE(src, 3);
- PACK_AND_STORE(src, 4);
- PACK_AND_STORE(src, 5);
- PACK_AND_STORE(src, 6);
- PACK_AND_STORE(src, 7);
- PACK_AND_STORE(tempBlured, 0);
- PACK_AND_STORE(tempBlured, 1);
- PACK_AND_STORE(tempBlured, 2);
- PACK_AND_STORE(tempBlured, 3);
- PACK_AND_STORE(tempBlured, 4);
- PACK_AND_STORE(tempBlured, 5);
- PACK_AND_STORE(tempBlured, 6);
- PACK_AND_STORE(tempBlured, 7);
-#undef PACK_AND_STORE
-}
-
-static inline void transpose_16x8_char_toPackedAlign_altivec(unsigned char* dst, unsigned char* src, int stride) {
- const vector unsigned char zero = vec_splat_u8(0);
-
-#define LOAD_DOUBLE_LINE(i, j) \
- vector unsigned char perm1##i = vec_lvsl(i * stride, src); \
- vector unsigned char perm2##i = vec_lvsl(j * stride, src); \
- vector unsigned char srcA##i = vec_ld(i * stride, src); \
- vector unsigned char srcB##i = vec_ld(i * stride + 16, src); \
- vector unsigned char srcC##i = vec_ld(j * stride, src); \
- vector unsigned char srcD##i = vec_ld(j * stride+ 16, src); \
- vector unsigned char src##i = vec_perm(srcA##i, srcB##i, perm1##i); \
- vector unsigned char src##j = vec_perm(srcC##i, srcD##i, perm2##i)
-
- LOAD_DOUBLE_LINE(0, 1);
- LOAD_DOUBLE_LINE(2, 3);
- LOAD_DOUBLE_LINE(4, 5);
- LOAD_DOUBLE_LINE(6, 7);
-#undef LOAD_DOUBLE_LINE
-
- vector unsigned char tempA = vec_mergeh(src0, zero);
- vector unsigned char tempB = vec_mergel(src0, zero);
- vector unsigned char tempC = vec_mergeh(src1, zero);
- vector unsigned char tempD = vec_mergel(src1, zero);
- vector unsigned char tempE = vec_mergeh(src2, zero);
- vector unsigned char tempF = vec_mergel(src2, zero);
- vector unsigned char tempG = vec_mergeh(src3, zero);
- vector unsigned char tempH = vec_mergel(src3, zero);
- vector unsigned char tempI = vec_mergeh(src4, zero);
- vector unsigned char tempJ = vec_mergel(src4, zero);
- vector unsigned char tempK = vec_mergeh(src5, zero);
- vector unsigned char tempL = vec_mergel(src5, zero);
- vector unsigned char tempM = vec_mergeh(src6, zero);
- vector unsigned char tempN = vec_mergel(src6, zero);
- vector unsigned char tempO = vec_mergeh(src7, zero);
- vector unsigned char tempP = vec_mergel(src7, zero);
-
- vector unsigned char temp0 = vec_mergeh(tempA, tempI);
- vector unsigned char temp1 = vec_mergel(tempA, tempI);
- vector unsigned char temp2 = vec_mergeh(tempB, tempJ);
- vector unsigned char temp3 = vec_mergel(tempB, tempJ);
- vector unsigned char temp4 = vec_mergeh(tempC, tempK);
- vector unsigned char temp5 = vec_mergel(tempC, tempK);
- vector unsigned char temp6 = vec_mergeh(tempD, tempL);
- vector unsigned char temp7 = vec_mergel(tempD, tempL);
- vector unsigned char temp8 = vec_mergeh(tempE, tempM);
- vector unsigned char temp9 = vec_mergel(tempE, tempM);
- vector unsigned char temp10 = vec_mergeh(tempF, tempN);
- vector unsigned char temp11 = vec_mergel(tempF, tempN);
- vector unsigned char temp12 = vec_mergeh(tempG, tempO);
- vector unsigned char temp13 = vec_mergel(tempG, tempO);
- vector unsigned char temp14 = vec_mergeh(tempH, tempP);
- vector unsigned char temp15 = vec_mergel(tempH, tempP);
-
- tempA = vec_mergeh(temp0, temp8);
- tempB = vec_mergel(temp0, temp8);
- tempC = vec_mergeh(temp1, temp9);
- tempD = vec_mergel(temp1, temp9);
- tempE = vec_mergeh(temp2, temp10);
- tempF = vec_mergel(temp2, temp10);
- tempG = vec_mergeh(temp3, temp11);
- tempH = vec_mergel(temp3, temp11);
- tempI = vec_mergeh(temp4, temp12);
- tempJ = vec_mergel(temp4, temp12);
- tempK = vec_mergeh(temp5, temp13);
- tempL = vec_mergel(temp5, temp13);
- tempM = vec_mergeh(temp6, temp14);
- tempN = vec_mergel(temp6, temp14);
- tempO = vec_mergeh(temp7, temp15);
- tempP = vec_mergel(temp7, temp15);
-
- temp0 = vec_mergeh(tempA, tempI);
- temp1 = vec_mergel(tempA, tempI);
- temp2 = vec_mergeh(tempB, tempJ);
- temp3 = vec_mergel(tempB, tempJ);
- temp4 = vec_mergeh(tempC, tempK);
- temp5 = vec_mergel(tempC, tempK);
- temp6 = vec_mergeh(tempD, tempL);
- temp7 = vec_mergel(tempD, tempL);
- temp8 = vec_mergeh(tempE, tempM);
- temp9 = vec_mergel(tempE, tempM);
- temp10 = vec_mergeh(tempF, tempN);
- temp11 = vec_mergel(tempF, tempN);
- temp12 = vec_mergeh(tempG, tempO);
- temp13 = vec_mergel(tempG, tempO);
- temp14 = vec_mergeh(tempH, tempP);
- temp15 = vec_mergel(tempH, tempP);
-
- vec_st(temp0, 0, dst);
- vec_st(temp1, 16, dst);
- vec_st(temp2, 32, dst);
- vec_st(temp3, 48, dst);
- vec_st(temp4, 64, dst);
- vec_st(temp5, 80, dst);
- vec_st(temp6, 96, dst);
- vec_st(temp7, 112, dst);
- vec_st(temp8, 128, dst);
- vec_st(temp9, 144, dst);
- vec_st(temp10, 160, dst);
- vec_st(temp11, 176, dst);
- vec_st(temp12, 192, dst);
- vec_st(temp13, 208, dst);
- vec_st(temp14, 224, dst);
- vec_st(temp15, 240, dst);
-}
-
-static inline void transpose_8x16_char_fromPackedAlign_altivec(unsigned char* dst, unsigned char* src, int stride) {
- const vector unsigned char zero = vec_splat_u8(0);
- const vector unsigned char magic_perm = (const vector unsigned char)
- AVV(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F);
-
-#define LOAD_DOUBLE_LINE(i, j) \
- vector unsigned char src##i = vec_ld(i * 16, src); \
- vector unsigned char src##j = vec_ld(j * 16, src)
-
- LOAD_DOUBLE_LINE(0, 1);
- LOAD_DOUBLE_LINE(2, 3);
- LOAD_DOUBLE_LINE(4, 5);
- LOAD_DOUBLE_LINE(6, 7);
- LOAD_DOUBLE_LINE(8, 9);
- LOAD_DOUBLE_LINE(10, 11);
- LOAD_DOUBLE_LINE(12, 13);
- LOAD_DOUBLE_LINE(14, 15);
-#undef LOAD_DOUBLE_LINE
-
- vector unsigned char tempA = vec_mergeh(src0, src8);
- vector unsigned char tempB;
- vector unsigned char tempC = vec_mergeh(src1, src9);
- vector unsigned char tempD;
- vector unsigned char tempE = vec_mergeh(src2, src10);
- vector unsigned char tempG = vec_mergeh(src3, src11);
- vector unsigned char tempI = vec_mergeh(src4, src12);
- vector unsigned char tempJ;
- vector unsigned char tempK = vec_mergeh(src5, src13);
- vector unsigned char tempL;
- vector unsigned char tempM = vec_mergeh(src6, src14);
- vector unsigned char tempO = vec_mergeh(src7, src15);
-
- vector unsigned char temp0 = vec_mergeh(tempA, tempI);
- vector unsigned char temp1 = vec_mergel(tempA, tempI);
- vector unsigned char temp2;
- vector unsigned char temp3;
- vector unsigned char temp4 = vec_mergeh(tempC, tempK);
- vector unsigned char temp5 = vec_mergel(tempC, tempK);
- vector unsigned char temp6;
- vector unsigned char temp7;
- vector unsigned char temp8 = vec_mergeh(tempE, tempM);
- vector unsigned char temp9 = vec_mergel(tempE, tempM);
- vector unsigned char temp12 = vec_mergeh(tempG, tempO);
- vector unsigned char temp13 = vec_mergel(tempG, tempO);
-
- tempA = vec_mergeh(temp0, temp8);
- tempB = vec_mergel(temp0, temp8);
- tempC = vec_mergeh(temp1, temp9);
- tempD = vec_mergel(temp1, temp9);
- tempI = vec_mergeh(temp4, temp12);
- tempJ = vec_mergel(temp4, temp12);
- tempK = vec_mergeh(temp5, temp13);
- tempL = vec_mergel(temp5, temp13);
-
- temp0 = vec_mergeh(tempA, tempI);
- temp1 = vec_mergel(tempA, tempI);
- temp2 = vec_mergeh(tempB, tempJ);
- temp3 = vec_mergel(tempB, tempJ);
- temp4 = vec_mergeh(tempC, tempK);
- temp5 = vec_mergel(tempC, tempK);
- temp6 = vec_mergeh(tempD, tempL);
- temp7 = vec_mergel(tempD, tempL);
-
-
- const vector signed char neg1 = vec_splat_s8(-1);
-#define STORE_DOUBLE_LINE(i, j) \
- vector unsigned char dstA##i = vec_ld(i * stride, dst); \
- vector unsigned char dstB##i = vec_ld(i * stride + 16, dst); \
- vector unsigned char dstA##j = vec_ld(j * stride, dst); \
- vector unsigned char dstB##j = vec_ld(j * stride+ 16, dst); \
- vector unsigned char align##i = vec_lvsr(i * stride, dst); \
- vector unsigned char align##j = vec_lvsr(j * stride, dst); \
- vector unsigned char mask##i = vec_perm(zero, (vector unsigned char)neg1, align##i); \
- vector unsigned char mask##j = vec_perm(zero, (vector unsigned char)neg1, align##j); \
- vector unsigned char dstR##i = vec_perm(temp##i, temp##i, align##i); \
- vector unsigned char dstR##j = vec_perm(temp##j, temp##j, align##j); \
- vector unsigned char dstAF##i = vec_sel(dstA##i, dstR##i, mask##i); \
- vector unsigned char dstBF##i = vec_sel(dstR##i, dstB##i, mask##i); \
- vector unsigned char dstAF##j = vec_sel(dstA##j, dstR##j, mask##j); \
- vector unsigned char dstBF##j = vec_sel(dstR##j, dstB##j, mask##j); \
- vec_st(dstAF##i, i * stride, dst); \
- vec_st(dstBF##i, i * stride + 16, dst); \
- vec_st(dstAF##j, j * stride, dst); \
- vec_st(dstBF##j, j * stride + 16, dst)
-
- STORE_DOUBLE_LINE(0,1);
- STORE_DOUBLE_LINE(2,3);
- STORE_DOUBLE_LINE(4,5);
- STORE_DOUBLE_LINE(6,7);
-}
diff --git a/src/libffmpeg/libavcodec/libpostproc/postprocess_internal.h b/src/libffmpeg/libavcodec/libpostproc/postprocess_internal.h
deleted file mode 100644
index 3d19c694b..000000000
--- a/src/libffmpeg/libavcodec/libpostproc/postprocess_internal.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- Copyright (C) 2001-2002 Michael Niedermayer (michaelni@gmx.at)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*/
-
-/**
- * @file postprocess_internal.h
- * internal api header.
- */
-
-#define V_DEBLOCK 0x01
-#define H_DEBLOCK 0x02
-#define DERING 0x04
-#define LEVEL_FIX 0x08 ///< Brightness & Contrast
-
-#define LUM_V_DEBLOCK V_DEBLOCK // 1
-#define LUM_H_DEBLOCK H_DEBLOCK // 2
-#define CHROM_V_DEBLOCK (V_DEBLOCK<<4) // 16
-#define CHROM_H_DEBLOCK (H_DEBLOCK<<4) // 32
-#define LUM_DERING DERING // 4
-#define CHROM_DERING (DERING<<4) // 64
-#define LUM_LEVEL_FIX LEVEL_FIX // 8
-#define CHROM_LEVEL_FIX (LEVEL_FIX<<4) // 128 (not implemented yet)
-
-// Experimental vertical filters
-#define V_X1_FILTER 0x0200 // 512
-#define V_A_DEBLOCK 0x0400
-
-// Experimental horizontal filters
-#define H_X1_FILTER 0x2000 // 8192
-#define H_A_DEBLOCK 0x4000
-
-/// select between full y range (255-0) or standart one (234-16)
-#define FULL_Y_RANGE 0x8000 // 32768
-
-//Deinterlacing Filters
-#define LINEAR_IPOL_DEINT_FILTER 0x10000 // 65536
-#define LINEAR_BLEND_DEINT_FILTER 0x20000 // 131072
-#define CUBIC_BLEND_DEINT_FILTER 0x8000 // (not implemented yet)
-#define CUBIC_IPOL_DEINT_FILTER 0x40000 // 262144
-#define MEDIAN_DEINT_FILTER 0x80000 // 524288
-#define FFMPEG_DEINT_FILTER 0x400000
-#define LOWPASS5_DEINT_FILTER 0x800000
-
-#define TEMP_NOISE_FILTER 0x100000
-#define FORCE_QUANT 0x200000
-
-#if ( defined(__PIC__) || defined(__pic__) ) && ! defined(PIC)
-# define PIC
-#endif
-
-//use if u want a faster postprocessing code
-//cant differentiate between chroma & luma filters (both on or both off)
-//obviosly the -pp option at the commandline has no effect except turning the here selected
-//filters on
-//#define COMPILE_TIME_MODE 0x77
-
-#if 1
-static inline int CLIP(int a){
- if(a&256) return ((a)>>31)^(-1);
- else return a;
-}
-//#define CLIP(a) (((a)&256) ? ((a)>>31)^(-1) : (a))
-#elif 0
-#define CLIP(a) clip_tab[a]
-#else
-#define CLIP(a) (a)
-#endif
-/**
- * Postprocessng filter.
- */
-struct PPFilter{
- char *shortName;
- char *longName;
- int chromDefault; ///< is chrominance filtering on by default if this filter is manually activated
- int minLumQuality; ///< minimum quality to turn luminance filtering on
- int minChromQuality; ///< minimum quality to turn chrominance filtering on
- int mask; ///< Bitmask to turn this filter on
-};
-
-/**
- * Postprocessng mode.
- */
-typedef struct PPMode{
- int lumMode; ///< acivates filters for luminance
- int chromMode; ///< acivates filters for chrominance
- int error; ///< non zero on error
-
- int minAllowedY; ///< for brigtness correction
- int maxAllowedY; ///< for brihtness correction
- float maxClippedThreshold; ///< amount of "black" u r willing to loose to get a brightness corrected picture
-
- int maxTmpNoise[3]; ///< for Temporal Noise Reducing filter (Maximal sum of abs differences)
-
- int baseDcDiff;
- int flatnessThreshold;
-
- int forcedQuant; ///< quantizer if FORCE_QUANT is used
-} PPMode;
-
-/**
- * postprocess context.
- */
-typedef struct PPContext{
- uint8_t *tempBlocks; ///<used for the horizontal code
-
- /**
- * luma histogram.
- * we need 64bit here otherwise we'll going to have a problem
- * after watching a black picture for 5 hours
- */
- uint64_t *yHistogram;
-
- uint64_t __attribute__((aligned(8))) packedYOffset;
- uint64_t __attribute__((aligned(8))) packedYScale;
-
- /** Temporal noise reducing buffers */
- uint8_t *tempBlured[3];
- int32_t *tempBluredPast[3];
-
- /** Temporary buffers for handling the last row(s) */
- uint8_t *tempDst;
- uint8_t *tempSrc;
-
- uint8_t *deintTemp;
-
- uint64_t __attribute__((aligned(8))) pQPb;
- uint64_t __attribute__((aligned(8))) pQPb2;
-
- uint64_t __attribute__((aligned(8))) mmxDcOffset[64];
- uint64_t __attribute__((aligned(8))) mmxDcThreshold[64];
-
- QP_STORE_T *stdQPTable; ///< used to fix MPEG2 style qscale
- QP_STORE_T *nonBQPTable;
- QP_STORE_T *forcedQPTable;
-
- int QP;
- int nonBQP;
-
- int frameNum;
-
- int cpuCaps;
-
- int qpStride; ///<size of qp buffers (needed to realloc them if needed)
- int stride; ///<size of some buffers (needed to realloc them if needed)
-
- int hChromaSubSample;
- int vChromaSubSample;
-
- PPMode ppMode;
-} PPContext;
-
-
-static inline void linecpy(void *dest, void *src, int lines, int stride)
-{
- if (stride > 0) {
- memcpy(dest, src, lines*stride);
- } else {
- memcpy(dest+(lines-1)*stride, src+(lines-1)*stride, -lines*stride);
- }
-}
diff --git a/src/libffmpeg/libavcodec/libpostproc/postprocess_template.c b/src/libffmpeg/libavcodec/libpostproc/postprocess_template.c
deleted file mode 100644
index 1171bd2aa..000000000
--- a/src/libffmpeg/libavcodec/libpostproc/postprocess_template.c
+++ /dev/null
@@ -1,3847 +0,0 @@
-/*
- Copyright (C) 2001-2002 Michael Niedermayer (michaelni@gmx.at)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*/
-
-/**
- * @file postprocess_template.c
- * mmx/mmx2/3dnow postprocess code.
- */
-
-
-#ifdef ARCH_X86_64
-# define REGa rax
-# define REGc rcx
-# define REGd rdx
-# define REG_a "rax"
-# define REG_c "rcx"
-# define REG_d "rdx"
-# define REG_SP "rsp"
-# define ALIGN_MASK "$0xFFFFFFFFFFFFFFF8"
-#else
-# define REGa eax
-# define REGc ecx
-# define REGd edx
-# define REG_a "eax"
-# define REG_c "ecx"
-# define REG_d "edx"
-# define REG_SP "esp"
-# define ALIGN_MASK "$0xFFFFFFF8"
-#endif
-
-
-#undef PAVGB
-#undef PMINUB
-#undef PMAXUB
-
-#ifdef HAVE_MMX2
-#define REAL_PAVGB(a,b) "pavgb " #a ", " #b " \n\t"
-#elif defined (HAVE_3DNOW)
-#define REAL_PAVGB(a,b) "pavgusb " #a ", " #b " \n\t"
-#endif
-#define PAVGB(a,b) REAL_PAVGB(a,b)
-
-#ifdef HAVE_MMX2
-#define PMINUB(a,b,t) "pminub " #a ", " #b " \n\t"
-#elif defined (HAVE_MMX)
-#define PMINUB(b,a,t) \
- "movq " #a ", " #t " \n\t"\
- "psubusb " #b ", " #t " \n\t"\
- "psubb " #t ", " #a " \n\t"
-#endif
-
-#ifdef HAVE_MMX2
-#define PMAXUB(a,b) "pmaxub " #a ", " #b " \n\t"
-#elif defined (HAVE_MMX)
-#define PMAXUB(a,b) \
- "psubusb " #a ", " #b " \n\t"\
- "paddb " #a ", " #b " \n\t"
-#endif
-
-//FIXME? |255-0| = 1 (shouldnt be a problem ...)
-#ifdef HAVE_MMX
-/**
- * Check if the middle 8x8 Block in the given 8x16 block is flat
- */
-static inline int RENAME(vertClassify)(uint8_t src[], int stride, PPContext *c){
- int numEq= 0, dcOk;
- src+= stride*4; // src points to begin of the 8x8 Block
-asm volatile(
- "movq %0, %%mm7 \n\t"
- "movq %1, %%mm6 \n\t"
- : : "m" (c->mmxDcOffset[c->nonBQP]), "m" (c->mmxDcThreshold[c->nonBQP])
- );
-
-asm volatile(
- "lea (%2, %3), %%"REG_a" \n\t"
-// 0 1 2 3 4 5 6 7 8 9
-// %1 eax eax+%2 eax+2%2 %1+4%2 ecx ecx+%2 ecx+2%2 %1+8%2 ecx+4%2
-
- "movq (%2), %%mm0 \n\t"
- "movq (%%"REG_a"), %%mm1 \n\t"
- "movq %%mm0, %%mm3 \n\t"
- "movq %%mm0, %%mm4 \n\t"
- PMAXUB(%%mm1, %%mm4)
- PMINUB(%%mm1, %%mm3, %%mm5)
- "psubb %%mm1, %%mm0 \n\t" // mm0 = differnece
- "paddb %%mm7, %%mm0 \n\t"
- "pcmpgtb %%mm6, %%mm0 \n\t"
-
- "movq (%%"REG_a",%3), %%mm2 \n\t"
- PMAXUB(%%mm2, %%mm4)
- PMINUB(%%mm2, %%mm3, %%mm5)
- "psubb %%mm2, %%mm1 \n\t"
- "paddb %%mm7, %%mm1 \n\t"
- "pcmpgtb %%mm6, %%mm1 \n\t"
- "paddb %%mm1, %%mm0 \n\t"
-
- "movq (%%"REG_a", %3, 2), %%mm1 \n\t"
- PMAXUB(%%mm1, %%mm4)
- PMINUB(%%mm1, %%mm3, %%mm5)
- "psubb %%mm1, %%mm2 \n\t"
- "paddb %%mm7, %%mm2 \n\t"
- "pcmpgtb %%mm6, %%mm2 \n\t"
- "paddb %%mm2, %%mm0 \n\t"
-
- "lea (%%"REG_a", %3, 4), %%"REG_a" \n\t"
-
- "movq (%2, %3, 4), %%mm2 \n\t"
- PMAXUB(%%mm2, %%mm4)
- PMINUB(%%mm2, %%mm3, %%mm5)
- "psubb %%mm2, %%mm1 \n\t"
- "paddb %%mm7, %%mm1 \n\t"
- "pcmpgtb %%mm6, %%mm1 \n\t"
- "paddb %%mm1, %%mm0 \n\t"
-
- "movq (%%"REG_a"), %%mm1 \n\t"
- PMAXUB(%%mm1, %%mm4)
- PMINUB(%%mm1, %%mm3, %%mm5)
- "psubb %%mm1, %%mm2 \n\t"
- "paddb %%mm7, %%mm2 \n\t"
- "pcmpgtb %%mm6, %%mm2 \n\t"
- "paddb %%mm2, %%mm0 \n\t"
-
- "movq (%%"REG_a", %3), %%mm2 \n\t"
- PMAXUB(%%mm2, %%mm4)
- PMINUB(%%mm2, %%mm3, %%mm5)
- "psubb %%mm2, %%mm1 \n\t"
- "paddb %%mm7, %%mm1 \n\t"
- "pcmpgtb %%mm6, %%mm1 \n\t"
- "paddb %%mm1, %%mm0 \n\t"
-
- "movq (%%"REG_a", %3, 2), %%mm1 \n\t"
- PMAXUB(%%mm1, %%mm4)
- PMINUB(%%mm1, %%mm3, %%mm5)
- "psubb %%mm1, %%mm2 \n\t"
- "paddb %%mm7, %%mm2 \n\t"
- "pcmpgtb %%mm6, %%mm2 \n\t"
- "paddb %%mm2, %%mm0 \n\t"
- "psubusb %%mm3, %%mm4 \n\t"
-
- " \n\t"
-#ifdef HAVE_MMX2
- "pxor %%mm7, %%mm7 \n\t"
- "psadbw %%mm7, %%mm0 \n\t"
-#else
- "movq %%mm0, %%mm1 \n\t"
- "psrlw $8, %%mm0 \n\t"
- "paddb %%mm1, %%mm0 \n\t"
- "movq %%mm0, %%mm1 \n\t"
- "psrlq $16, %%mm0 \n\t"
- "paddb %%mm1, %%mm0 \n\t"
- "movq %%mm0, %%mm1 \n\t"
- "psrlq $32, %%mm0 \n\t"
- "paddb %%mm1, %%mm0 \n\t"
-#endif
- "movq %4, %%mm7 \n\t" // QP,..., QP
- "paddusb %%mm7, %%mm7 \n\t" // 2QP ... 2QP
- "psubusb %%mm7, %%mm4 \n\t" // Diff <= 2QP -> 0
- "packssdw %%mm4, %%mm4 \n\t"
- "movd %%mm0, %0 \n\t"
- "movd %%mm4, %1 \n\t"
-
- : "=r" (numEq), "=r" (dcOk)
- : "r" (src), "r" ((long)stride), "m" (c->pQPb)
- : "%"REG_a
- );
-
- numEq= (-numEq) &0xFF;
- if(numEq > c->ppMode.flatnessThreshold){
- if(dcOk) return 0;
- else return 1;
- }else{
- return 2;
- }
-}
-#endif //HAVE_MMX
-
-/**
- * Do a vertical low pass filter on the 8x16 block (only write to the 8x8 block in the middle)
- * using the 9-Tap Filter (1,1,2,2,4,2,2,1,1)/16
- */
-#ifndef HAVE_ALTIVEC
-static inline void RENAME(doVertLowPass)(uint8_t *src, int stride, PPContext *c)
-{
-#if defined (HAVE_MMX2) || defined (HAVE_3DNOW)
- src+= stride*3;
- asm volatile( //"movv %0 %1 %2\n\t"
- "movq %2, %%mm0 \n\t" // QP,..., QP
- "pxor %%mm4, %%mm4 \n\t"
-
- "movq (%0), %%mm6 \n\t"
- "movq (%0, %1), %%mm5 \n\t"
- "movq %%mm5, %%mm1 \n\t"
- "movq %%mm6, %%mm2 \n\t"
- "psubusb %%mm6, %%mm5 \n\t"
- "psubusb %%mm1, %%mm2 \n\t"
- "por %%mm5, %%mm2 \n\t" // ABS Diff of lines
- "psubusb %%mm0, %%mm2 \n\t" // diff <= QP -> 0
- "pcmpeqb %%mm4, %%mm2 \n\t" // diff <= QP -> FF
-
- "pand %%mm2, %%mm6 \n\t"
- "pandn %%mm1, %%mm2 \n\t"
- "por %%mm2, %%mm6 \n\t"// First Line to Filter
-
- "movq (%0, %1, 8), %%mm5 \n\t"
- "lea (%0, %1, 4), %%"REG_a" \n\t"
- "lea (%0, %1, 8), %%"REG_c" \n\t"
- "sub %1, %%"REG_c" \n\t"
- "add %1, %0 \n\t" // %0 points to line 1 not 0
- "movq (%0, %1, 8), %%mm7 \n\t"
- "movq %%mm5, %%mm1 \n\t"
- "movq %%mm7, %%mm2 \n\t"
- "psubusb %%mm7, %%mm5 \n\t"
- "psubusb %%mm1, %%mm2 \n\t"
- "por %%mm5, %%mm2 \n\t" // ABS Diff of lines
- "psubusb %%mm0, %%mm2 \n\t" // diff <= QP -> 0
- "pcmpeqb %%mm4, %%mm2 \n\t" // diff <= QP -> FF
-
- "pand %%mm2, %%mm7 \n\t"
- "pandn %%mm1, %%mm2 \n\t"
- "por %%mm2, %%mm7 \n\t" // First Line to Filter
-
-
- // 1 2 3 4 5 6 7 8
- // %0 %0+%1 %0+2%1 eax %0+4%1 eax+2%1 ecx eax+4%1
- // 6 4 2 2 1 1
- // 6 4 4 2
- // 6 8 2
-
- "movq (%0, %1), %%mm0 \n\t" // 1
- "movq %%mm0, %%mm1 \n\t" // 1
- PAVGB(%%mm6, %%mm0) //1 1 /2
- PAVGB(%%mm6, %%mm0) //3 1 /4
-
- "movq (%0, %1, 4), %%mm2 \n\t" // 1
- "movq %%mm2, %%mm5 \n\t" // 1
- PAVGB((%%REGa), %%mm2) // 11 /2
- PAVGB((%0, %1, 2), %%mm2) // 211 /4
- "movq %%mm2, %%mm3 \n\t" // 211 /4
- "movq (%0), %%mm4 \n\t" // 1
- PAVGB(%%mm4, %%mm3) // 4 211 /8
- PAVGB(%%mm0, %%mm3) //642211 /16
- "movq %%mm3, (%0) \n\t" // X
- // mm1=2 mm2=3(211) mm4=1 mm5=5 mm6=0 mm7=9
- "movq %%mm1, %%mm0 \n\t" // 1
- PAVGB(%%mm6, %%mm0) //1 1 /2
- "movq %%mm4, %%mm3 \n\t" // 1
- PAVGB((%0,%1,2), %%mm3) // 1 1 /2
- PAVGB((%%REGa,%1,2), %%mm5) // 11 /2
- PAVGB((%%REGa), %%mm5) // 211 /4
- PAVGB(%%mm5, %%mm3) // 2 2211 /8
- PAVGB(%%mm0, %%mm3) //4242211 /16
- "movq %%mm3, (%0,%1) \n\t" // X
- // mm1=2 mm2=3(211) mm4=1 mm5=4(211) mm6=0 mm7=9
- PAVGB(%%mm4, %%mm6) //11 /2
- "movq (%%"REG_c"), %%mm0 \n\t" // 1
- PAVGB((%%REGa, %1, 2), %%mm0) // 11/2
- "movq %%mm0, %%mm3 \n\t" // 11/2
- PAVGB(%%mm1, %%mm0) // 2 11/4
- PAVGB(%%mm6, %%mm0) //222 11/8
- PAVGB(%%mm2, %%mm0) //22242211/16
- "movq (%0, %1, 2), %%mm2 \n\t" // 1
- "movq %%mm0, (%0, %1, 2) \n\t" // X
- // mm1=2 mm2=3 mm3=6(11) mm4=1 mm5=4(211) mm6=0(11) mm7=9
- "movq (%%"REG_a", %1, 4), %%mm0 \n\t" // 1
- PAVGB((%%REGc), %%mm0) // 11 /2
- PAVGB(%%mm0, %%mm6) //11 11 /4
- PAVGB(%%mm1, %%mm4) // 11 /2
- PAVGB(%%mm2, %%mm1) // 11 /2
- PAVGB(%%mm1, %%mm6) //1122 11 /8
- PAVGB(%%mm5, %%mm6) //112242211 /16
- "movq (%%"REG_a"), %%mm5 \n\t" // 1
- "movq %%mm6, (%%"REG_a") \n\t" // X
- // mm0=7(11) mm1=2(11) mm2=3 mm3=6(11) mm4=1(11) mm5=4 mm7=9
- "movq (%%"REG_a", %1, 4), %%mm6 \n\t" // 1
- PAVGB(%%mm7, %%mm6) // 11 /2
- PAVGB(%%mm4, %%mm6) // 11 11 /4
- PAVGB(%%mm3, %%mm6) // 11 2211 /8
- PAVGB(%%mm5, %%mm2) // 11 /2
- "movq (%0, %1, 4), %%mm4 \n\t" // 1
- PAVGB(%%mm4, %%mm2) // 112 /4
- PAVGB(%%mm2, %%mm6) // 112242211 /16
- "movq %%mm6, (%0, %1, 4) \n\t" // X
- // mm0=7(11) mm1=2(11) mm2=3(112) mm3=6(11) mm4=5 mm5=4 mm7=9
- PAVGB(%%mm7, %%mm1) // 11 2 /4
- PAVGB(%%mm4, %%mm5) // 11 /2
- PAVGB(%%mm5, %%mm0) // 11 11 /4
- "movq (%%"REG_a", %1, 2), %%mm6 \n\t" // 1
- PAVGB(%%mm6, %%mm1) // 11 4 2 /8
- PAVGB(%%mm0, %%mm1) // 11224222 /16
- "movq %%mm1, (%%"REG_a", %1, 2) \n\t" // X
- // mm2=3(112) mm3=6(11) mm4=5 mm5=4(11) mm6=6 mm7=9
- PAVGB((%%REGc), %%mm2) // 112 4 /8
- "movq (%%"REG_a", %1, 4), %%mm0 \n\t" // 1
- PAVGB(%%mm0, %%mm6) // 1 1 /2
- PAVGB(%%mm7, %%mm6) // 1 12 /4
- PAVGB(%%mm2, %%mm6) // 1122424 /4
- "movq %%mm6, (%%"REG_c") \n\t" // X
- // mm0=8 mm3=6(11) mm4=5 mm5=4(11) mm7=9
- PAVGB(%%mm7, %%mm5) // 11 2 /4
- PAVGB(%%mm7, %%mm5) // 11 6 /8
-
- PAVGB(%%mm3, %%mm0) // 112 /4
- PAVGB(%%mm0, %%mm5) // 112246 /16
- "movq %%mm5, (%%"REG_a", %1, 4) \n\t" // X
- "sub %1, %0 \n\t"
-
- :
- : "r" (src), "r" ((long)stride), "m" (c->pQPb)
- : "%"REG_a, "%"REG_c
- );
-#else //defined (HAVE_MMX2) || defined (HAVE_3DNOW)
- const int l1= stride;
- const int l2= stride + l1;
- const int l3= stride + l2;
- const int l4= stride + l3;
- const int l5= stride + l4;
- const int l6= stride + l5;
- const int l7= stride + l6;
- const int l8= stride + l7;
- const int l9= stride + l8;
- int x;
- src+= stride*3;
- for(x=0; x<BLOCK_SIZE; x++)
- {
- const int first= ABS(src[0] - src[l1]) < c->QP ? src[0] : src[l1];
- const int last= ABS(src[l8] - src[l9]) < c->QP ? src[l9] : src[l8];
-
- int sums[10];
- sums[0] = 4*first + src[l1] + src[l2] + src[l3] + 4;
- sums[1] = sums[0] - first + src[l4];
- sums[2] = sums[1] - first + src[l5];
- sums[3] = sums[2] - first + src[l6];
- sums[4] = sums[3] - first + src[l7];
- sums[5] = sums[4] - src[l1] + src[l8];
- sums[6] = sums[5] - src[l2] + last;
- sums[7] = sums[6] - src[l3] + last;
- sums[8] = sums[7] - src[l4] + last;
- sums[9] = sums[8] - src[l5] + last;
-
- src[l1]= (sums[0] + sums[2] + 2*src[l1])>>4;
- src[l2]= (sums[1] + sums[3] + 2*src[l2])>>4;
- src[l3]= (sums[2] + sums[4] + 2*src[l3])>>4;
- src[l4]= (sums[3] + sums[5] + 2*src[l4])>>4;
- src[l5]= (sums[4] + sums[6] + 2*src[l5])>>4;
- src[l6]= (sums[5] + sums[7] + 2*src[l6])>>4;
- src[l7]= (sums[6] + sums[8] + 2*src[l7])>>4;
- src[l8]= (sums[7] + sums[9] + 2*src[l8])>>4;
-
- src++;
- }
-#endif //defined (HAVE_MMX2) || defined (HAVE_3DNOW)
-}
-#endif //HAVE_ALTIVEC
-
-#if 0
-/**
- * Experimental implementation of the filter (Algorithm 1) described in a paper from Ramkishor & Karandikar
- * values are correctly clipped (MMX2)
- * values are wraparound (C)
- * conclusion: its fast, but introduces ugly horizontal patterns if there is a continious gradient
- 0 8 16 24
- x = 8
- x/2 = 4
- x/8 = 1
- 1 12 12 23
- */
-static inline void RENAME(vertRK1Filter)(uint8_t *src, int stride, int QP)
-{
-#if defined (HAVE_MMX2) || defined (HAVE_3DNOW)
- src+= stride*3;
-// FIXME rounding
- asm volatile(
- "pxor %%mm7, %%mm7 \n\t" // 0
- "movq "MANGLE(b80)", %%mm6 \n\t" // MIN_SIGNED_BYTE
- "leal (%0, %1), %%"REG_a" \n\t"
- "leal (%%"REG_a", %1, 4), %%"REG_c" \n\t"
-// 0 1 2 3 4 5 6 7 8 9
-// %0 eax eax+%1 eax+2%1 %0+4%1 ecx ecx+%1 ecx+2%1 %0+8%1 ecx+4%1
- "movq "MANGLE(pQPb)", %%mm0 \n\t" // QP,..., QP
- "movq %%mm0, %%mm1 \n\t" // QP,..., QP
- "paddusb "MANGLE(b02)", %%mm0 \n\t"
- "psrlw $2, %%mm0 \n\t"
- "pand "MANGLE(b3F)", %%mm0 \n\t" // QP/4,..., QP/4
- "paddusb %%mm1, %%mm0 \n\t" // QP*1.25 ...
- "movq (%0, %1, 4), %%mm2 \n\t" // line 4
- "movq (%%"REG_c"), %%mm3 \n\t" // line 5
- "movq %%mm2, %%mm4 \n\t" // line 4
- "pcmpeqb %%mm5, %%mm5 \n\t" // -1
- "pxor %%mm2, %%mm5 \n\t" // -line 4 - 1
- PAVGB(%%mm3, %%mm5)
- "paddb %%mm6, %%mm5 \n\t" // (l5-l4)/2
- "psubusb %%mm3, %%mm4 \n\t"
- "psubusb %%mm2, %%mm3 \n\t"
- "por %%mm3, %%mm4 \n\t" // |l4 - l5|
- "psubusb %%mm0, %%mm4 \n\t"
- "pcmpeqb %%mm7, %%mm4 \n\t"
- "pand %%mm4, %%mm5 \n\t" // d/2
-
-// "paddb %%mm6, %%mm2 \n\t" // line 4 + 0x80
- "paddb %%mm5, %%mm2 \n\t"
-// "psubb %%mm6, %%mm2 \n\t"
- "movq %%mm2, (%0,%1, 4) \n\t"
-
- "movq (%%"REG_c"), %%mm2 \n\t"
-// "paddb %%mm6, %%mm2 \n\t" // line 5 + 0x80
- "psubb %%mm5, %%mm2 \n\t"
-// "psubb %%mm6, %%mm2 \n\t"
- "movq %%mm2, (%%"REG_c") \n\t"
-
- "paddb %%mm6, %%mm5 \n\t"
- "psrlw $2, %%mm5 \n\t"
- "pand "MANGLE(b3F)", %%mm5 \n\t"
- "psubb "MANGLE(b20)", %%mm5 \n\t" // (l5-l4)/8
-
- "movq (%%"REG_a", %1, 2), %%mm2 \n\t"
- "paddb %%mm6, %%mm2 \n\t" // line 3 + 0x80
- "paddsb %%mm5, %%mm2 \n\t"
- "psubb %%mm6, %%mm2 \n\t"
- "movq %%mm2, (%%"REG_a", %1, 2) \n\t"
-
- "movq (%%"REG_c", %1), %%mm2 \n\t"
- "paddb %%mm6, %%mm2 \n\t" // line 6 + 0x80
- "psubsb %%mm5, %%mm2 \n\t"
- "psubb %%mm6, %%mm2 \n\t"
- "movq %%mm2, (%%"REG_c", %1) \n\t"
-
- :
- : "r" (src), "r" ((long)stride)
- : "%"REG_a, "%"REG_c
- );
-#else //defined (HAVE_MMX2) || defined (HAVE_3DNOW)
- const int l1= stride;
- const int l2= stride + l1;
- const int l3= stride + l2;
- const int l4= stride + l3;
- const int l5= stride + l4;
- const int l6= stride + l5;
-// const int l7= stride + l6;
-// const int l8= stride + l7;
-// const int l9= stride + l8;
- int x;
- const int QP15= QP + (QP>>2);
- src+= stride*3;
- for(x=0; x<BLOCK_SIZE; x++)
- {
- const int v = (src[x+l5] - src[x+l4]);
- if(ABS(v) < QP15)
- {
- src[x+l3] +=v>>3;
- src[x+l4] +=v>>1;
- src[x+l5] -=v>>1;
- src[x+l6] -=v>>3;
-
- }
- }
-
-#endif //defined (HAVE_MMX2) || defined (HAVE_3DNOW)
-}
-#endif //0
-
-/**
- * Experimental Filter 1
- * will not damage linear gradients
- * Flat blocks should look like they where passed through the (1,1,2,2,4,2,2,1,1) 9-Tap filter
- * can only smooth blocks at the expected locations (it cant smooth them if they did move)
- * MMX2 version does correct clipping C version doesnt
- */
-static inline void RENAME(vertX1Filter)(uint8_t *src, int stride, PPContext *co)
-{
-#if defined (HAVE_MMX2) || defined (HAVE_3DNOW)
- src+= stride*3;
-
- asm volatile(
- "pxor %%mm7, %%mm7 \n\t" // 0
- "lea (%0, %1), %%"REG_a" \n\t"
- "lea (%%"REG_a", %1, 4), %%"REG_c" \n\t"
-// 0 1 2 3 4 5 6 7 8 9
-// %0 eax eax+%1 eax+2%1 %0+4%1 ecx ecx+%1 ecx+2%1 %0+8%1 ecx+4%1
- "movq (%%"REG_a", %1, 2), %%mm0 \n\t" // line 3
- "movq (%0, %1, 4), %%mm1 \n\t" // line 4
- "movq %%mm1, %%mm2 \n\t" // line 4
- "psubusb %%mm0, %%mm1 \n\t"
- "psubusb %%mm2, %%mm0 \n\t"
- "por %%mm1, %%mm0 \n\t" // |l2 - l3|
- "movq (%%"REG_c"), %%mm3 \n\t" // line 5
- "movq (%%"REG_c", %1), %%mm4 \n\t" // line 6
- "movq %%mm3, %%mm5 \n\t" // line 5
- "psubusb %%mm4, %%mm3 \n\t"
- "psubusb %%mm5, %%mm4 \n\t"
- "por %%mm4, %%mm3 \n\t" // |l5 - l6|
- PAVGB(%%mm3, %%mm0) // (|l2 - l3| + |l5 - l6|)/2
- "movq %%mm2, %%mm1 \n\t" // line 4
- "psubusb %%mm5, %%mm2 \n\t"
- "movq %%mm2, %%mm4 \n\t"
- "pcmpeqb %%mm7, %%mm2 \n\t" // (l4 - l5) <= 0 ? -1 : 0
- "psubusb %%mm1, %%mm5 \n\t"
- "por %%mm5, %%mm4 \n\t" // |l4 - l5|
- "psubusb %%mm0, %%mm4 \n\t" //d = MAX(0, |l4-l5| - (|l2-l3| + |l5-l6|)/2)
- "movq %%mm4, %%mm3 \n\t" // d
- "movq %2, %%mm0 \n\t"
- "paddusb %%mm0, %%mm0 \n\t"
- "psubusb %%mm0, %%mm4 \n\t"
- "pcmpeqb %%mm7, %%mm4 \n\t" // d <= QP ? -1 : 0
- "psubusb "MANGLE(b01)", %%mm3 \n\t"
- "pand %%mm4, %%mm3 \n\t" // d <= QP ? d : 0
-
- PAVGB(%%mm7, %%mm3) // d/2
- "movq %%mm3, %%mm1 \n\t" // d/2
- PAVGB(%%mm7, %%mm3) // d/4
- PAVGB(%%mm1, %%mm3) // 3*d/8
-
- "movq (%0, %1, 4), %%mm0 \n\t" // line 4
- "pxor %%mm2, %%mm0 \n\t" //(l4 - l5) <= 0 ? -l4-1 : l4
- "psubusb %%mm3, %%mm0 \n\t"
- "pxor %%mm2, %%mm0 \n\t"
- "movq %%mm0, (%0, %1, 4) \n\t" // line 4
-
- "movq (%%"REG_c"), %%mm0 \n\t" // line 5
- "pxor %%mm2, %%mm0 \n\t" //(l4 - l5) <= 0 ? -l5-1 : l5
- "paddusb %%mm3, %%mm0 \n\t"
- "pxor %%mm2, %%mm0 \n\t"
- "movq %%mm0, (%%"REG_c") \n\t" // line 5
-
- PAVGB(%%mm7, %%mm1) // d/4
-
- "movq (%%"REG_a", %1, 2), %%mm0 \n\t" // line 3
- "pxor %%mm2, %%mm0 \n\t" //(l4 - l5) <= 0 ? -l4-1 : l4
- "psubusb %%mm1, %%mm0 \n\t"
- "pxor %%mm2, %%mm0 \n\t"
- "movq %%mm0, (%%"REG_a", %1, 2) \n\t" // line 3
-
- "movq (%%"REG_c", %1), %%mm0 \n\t" // line 6
- "pxor %%mm2, %%mm0 \n\t" //(l4 - l5) <= 0 ? -l5-1 : l5
- "paddusb %%mm1, %%mm0 \n\t"
- "pxor %%mm2, %%mm0 \n\t"
- "movq %%mm0, (%%"REG_c", %1) \n\t" // line 6
-
- PAVGB(%%mm7, %%mm1) // d/8
-
- "movq (%%"REG_a", %1), %%mm0 \n\t" // line 2
- "pxor %%mm2, %%mm0 \n\t" //(l4 - l5) <= 0 ? -l2-1 : l2
- "psubusb %%mm1, %%mm0 \n\t"
- "pxor %%mm2, %%mm0 \n\t"
- "movq %%mm0, (%%"REG_a", %1) \n\t" // line 2
-
- "movq (%%"REG_c", %1, 2), %%mm0 \n\t" // line 7
- "pxor %%mm2, %%mm0 \n\t" //(l4 - l5) <= 0 ? -l7-1 : l7
- "paddusb %%mm1, %%mm0 \n\t"
- "pxor %%mm2, %%mm0 \n\t"
- "movq %%mm0, (%%"REG_c", %1, 2) \n\t" // line 7
-
- :
- : "r" (src), "r" ((long)stride), "m" (co->pQPb)
- : "%"REG_a, "%"REG_c
- );
-#else //defined (HAVE_MMX2) || defined (HAVE_3DNOW)
-
- const int l1= stride;
- const int l2= stride + l1;
- const int l3= stride + l2;
- const int l4= stride + l3;
- const int l5= stride + l4;
- const int l6= stride + l5;
- const int l7= stride + l6;
-// const int l8= stride + l7;
-// const int l9= stride + l8;
- int x;
-
- src+= stride*3;
- for(x=0; x<BLOCK_SIZE; x++)
- {
- int a= src[l3] - src[l4];
- int b= src[l4] - src[l5];
- int c= src[l5] - src[l6];
-
- int d= ABS(b) - ((ABS(a) + ABS(c))>>1);
- d= MAX(d, 0);
-
- if(d < co->QP*2)
- {
- int v = d * SIGN(-b);
-
- src[l2] +=v>>3;
- src[l3] +=v>>2;
- src[l4] +=(3*v)>>3;
- src[l5] -=(3*v)>>3;
- src[l6] -=v>>2;
- src[l7] -=v>>3;
-
- }
- src++;
- }
-#endif //defined (HAVE_MMX2) || defined (HAVE_3DNOW)
-}
-
-#ifndef HAVE_ALTIVEC
-static inline void RENAME(doVertDefFilter)(uint8_t src[], int stride, PPContext *c)
-{
-#if defined (HAVE_MMX2) || defined (HAVE_3DNOW)
-/*
- uint8_t tmp[16];
- const int l1= stride;
- const int l2= stride + l1;
- const int l3= stride + l2;
- const int l4= (int)tmp - (int)src - stride*3;
- const int l5= (int)tmp - (int)src - stride*3 + 8;
- const int l6= stride*3 + l3;
- const int l7= stride + l6;
- const int l8= stride + l7;
-
- memcpy(tmp, src+stride*7, 8);
- memcpy(tmp+8, src+stride*8, 8);
-*/
- src+= stride*4;
- asm volatile(
-
-#if 0 //sligtly more accurate and slightly slower
- "pxor %%mm7, %%mm7 \n\t" // 0
- "lea (%0, %1), %%"REG_a" \n\t"
- "lea (%%"REG_a", %1, 4), %%"REG_c" \n\t"
-// 0 1 2 3 4 5 6 7
-// %0 %0+%1 %0+2%1 eax+2%1 %0+4%1 eax+4%1 ecx+%1 ecx+2%1
-// %0 eax eax+%1 eax+2%1 %0+4%1 ecx ecx+%1 ecx+2%1
-
-
- "movq (%0, %1, 2), %%mm0 \n\t" // l2
- "movq (%0), %%mm1 \n\t" // l0
- "movq %%mm0, %%mm2 \n\t" // l2
- PAVGB(%%mm7, %%mm0) // ~l2/2
- PAVGB(%%mm1, %%mm0) // ~(l2 + 2l0)/4
- PAVGB(%%mm2, %%mm0) // ~(5l2 + 2l0)/8
-
- "movq (%%"REG_a"), %%mm1 \n\t" // l1
- "movq (%%"REG_a", %1, 2), %%mm3 \n\t" // l3
- "movq %%mm1, %%mm4 \n\t" // l1
- PAVGB(%%mm7, %%mm1) // ~l1/2
- PAVGB(%%mm3, %%mm1) // ~(l1 + 2l3)/4
- PAVGB(%%mm4, %%mm1) // ~(5l1 + 2l3)/8
-
- "movq %%mm0, %%mm4 \n\t" // ~(5l2 + 2l0)/8
- "psubusb %%mm1, %%mm0 \n\t"
- "psubusb %%mm4, %%mm1 \n\t"
- "por %%mm0, %%mm1 \n\t" // ~|2l0 - 5l1 + 5l2 - 2l3|/8
-// mm1= |lenergy|, mm2= l2, mm3= l3, mm7=0
-
- "movq (%0, %1, 4), %%mm0 \n\t" // l4
- "movq %%mm0, %%mm4 \n\t" // l4
- PAVGB(%%mm7, %%mm0) // ~l4/2
- PAVGB(%%mm2, %%mm0) // ~(l4 + 2l2)/4
- PAVGB(%%mm4, %%mm0) // ~(5l4 + 2l2)/8
-
- "movq (%%"REG_c"), %%mm2 \n\t" // l5
- "movq %%mm3, %%mm5 \n\t" // l3
- PAVGB(%%mm7, %%mm3) // ~l3/2
- PAVGB(%%mm2, %%mm3) // ~(l3 + 2l5)/4
- PAVGB(%%mm5, %%mm3) // ~(5l3 + 2l5)/8
-
- "movq %%mm0, %%mm6 \n\t" // ~(5l4 + 2l2)/8
- "psubusb %%mm3, %%mm0 \n\t"
- "psubusb %%mm6, %%mm3 \n\t"
- "por %%mm0, %%mm3 \n\t" // ~|2l2 - 5l3 + 5l4 - 2l5|/8
- "pcmpeqb %%mm7, %%mm0 \n\t" // SIGN(2l2 - 5l3 + 5l4 - 2l5)
-// mm0= SIGN(menergy), mm1= |lenergy|, mm2= l5, mm3= |menergy|, mm4=l4, mm5= l3, mm7=0
-
- "movq (%%"REG_c", %1), %%mm6 \n\t" // l6
- "movq %%mm6, %%mm5 \n\t" // l6
- PAVGB(%%mm7, %%mm6) // ~l6/2
- PAVGB(%%mm4, %%mm6) // ~(l6 + 2l4)/4
- PAVGB(%%mm5, %%mm6) // ~(5l6 + 2l4)/8
-
- "movq (%%"REG_c", %1, 2), %%mm5 \n\t" // l7
- "movq %%mm2, %%mm4 \n\t" // l5
- PAVGB(%%mm7, %%mm2) // ~l5/2
- PAVGB(%%mm5, %%mm2) // ~(l5 + 2l7)/4
- PAVGB(%%mm4, %%mm2) // ~(5l5 + 2l7)/8
-
- "movq %%mm6, %%mm4 \n\t" // ~(5l6 + 2l4)/8
- "psubusb %%mm2, %%mm6 \n\t"
- "psubusb %%mm4, %%mm2 \n\t"
- "por %%mm6, %%mm2 \n\t" // ~|2l4 - 5l5 + 5l6 - 2l7|/8
-// mm0= SIGN(menergy), mm1= |lenergy|/8, mm2= |renergy|/8, mm3= |menergy|/8, mm7=0
-
-
- PMINUB(%%mm2, %%mm1, %%mm4) // MIN(|lenergy|,|renergy|)/8
- "movq %2, %%mm4 \n\t" // QP //FIXME QP+1 ?
- "paddusb "MANGLE(b01)", %%mm4 \n\t"
- "pcmpgtb %%mm3, %%mm4 \n\t" // |menergy|/8 < QP
- "psubusb %%mm1, %%mm3 \n\t" // d=|menergy|/8-MIN(|lenergy|,|renergy|)/8
- "pand %%mm4, %%mm3 \n\t"
-
- "movq %%mm3, %%mm1 \n\t"
-// "psubusb "MANGLE(b01)", %%mm3 \n\t"
- PAVGB(%%mm7, %%mm3)
- PAVGB(%%mm7, %%mm3)
- "paddusb %%mm1, %%mm3 \n\t"
-// "paddusb "MANGLE(b01)", %%mm3 \n\t"
-
- "movq (%%"REG_a", %1, 2), %%mm6 \n\t" //l3
- "movq (%0, %1, 4), %%mm5 \n\t" //l4
- "movq (%0, %1, 4), %%mm4 \n\t" //l4
- "psubusb %%mm6, %%mm5 \n\t"
- "psubusb %%mm4, %%mm6 \n\t"
- "por %%mm6, %%mm5 \n\t" // |l3-l4|
- "pcmpeqb %%mm7, %%mm6 \n\t" // SIGN(l3-l4)
- "pxor %%mm6, %%mm0 \n\t"
- "pand %%mm0, %%mm3 \n\t"
- PMINUB(%%mm5, %%mm3, %%mm0)
-
- "psubusb "MANGLE(b01)", %%mm3 \n\t"
- PAVGB(%%mm7, %%mm3)
-
- "movq (%%"REG_a", %1, 2), %%mm0 \n\t"
- "movq (%0, %1, 4), %%mm2 \n\t"
- "pxor %%mm6, %%mm0 \n\t"
- "pxor %%mm6, %%mm2 \n\t"
- "psubb %%mm3, %%mm0 \n\t"
- "paddb %%mm3, %%mm2 \n\t"
- "pxor %%mm6, %%mm0 \n\t"
- "pxor %%mm6, %%mm2 \n\t"
- "movq %%mm0, (%%"REG_a", %1, 2) \n\t"
- "movq %%mm2, (%0, %1, 4) \n\t"
-#endif //0
-
- "lea (%0, %1), %%"REG_a" \n\t"
- "pcmpeqb %%mm6, %%mm6 \n\t" // -1
-// 0 1 2 3 4 5 6 7
-// %0 %0+%1 %0+2%1 eax+2%1 %0+4%1 eax+4%1 ecx+%1 ecx+2%1
-// %0 eax eax+%1 eax+2%1 %0+4%1 ecx ecx+%1 ecx+2%1
-
-
- "movq (%%"REG_a", %1, 2), %%mm1 \n\t" // l3
- "movq (%0, %1, 4), %%mm0 \n\t" // l4
- "pxor %%mm6, %%mm1 \n\t" // -l3-1
- PAVGB(%%mm1, %%mm0) // -q+128 = (l4-l3+256)/2
-// mm1=-l3-1, mm0=128-q
-
- "movq (%%"REG_a", %1, 4), %%mm2 \n\t" // l5
- "movq (%%"REG_a", %1), %%mm3 \n\t" // l2
- "pxor %%mm6, %%mm2 \n\t" // -l5-1
- "movq %%mm2, %%mm5 \n\t" // -l5-1
- "movq "MANGLE(b80)", %%mm4 \n\t" // 128
- "lea (%%"REG_a", %1, 4), %%"REG_c" \n\t"
- PAVGB(%%mm3, %%mm2) // (l2-l5+256)/2
- PAVGB(%%mm0, %%mm4) // ~(l4-l3)/4 + 128
- PAVGB(%%mm2, %%mm4) // ~(l2-l5)/4 +(l4-l3)/8 + 128
- PAVGB(%%mm0, %%mm4) // ~(l2-l5)/8 +5(l4-l3)/16 + 128
-// mm1=-l3-1, mm0=128-q, mm3=l2, mm4=menergy/16 + 128, mm5= -l5-1
-
- "movq (%%"REG_a"), %%mm2 \n\t" // l1
- "pxor %%mm6, %%mm2 \n\t" // -l1-1
- PAVGB(%%mm3, %%mm2) // (l2-l1+256)/2
- PAVGB((%0), %%mm1) // (l0-l3+256)/2
- "movq "MANGLE(b80)", %%mm3 \n\t" // 128
- PAVGB(%%mm2, %%mm3) // ~(l2-l1)/4 + 128
- PAVGB(%%mm1, %%mm3) // ~(l0-l3)/4 +(l2-l1)/8 + 128
- PAVGB(%%mm2, %%mm3) // ~(l0-l3)/8 +5(l2-l1)/16 + 128
-// mm0=128-q, mm3=lenergy/16 + 128, mm4= menergy/16 + 128, mm5= -l5-1
-
- PAVGB((%%REGc, %1), %%mm5) // (l6-l5+256)/2
- "movq (%%"REG_c", %1, 2), %%mm1 \n\t" // l7
- "pxor %%mm6, %%mm1 \n\t" // -l7-1
- PAVGB((%0, %1, 4), %%mm1) // (l4-l7+256)/2
- "movq "MANGLE(b80)", %%mm2 \n\t" // 128
- PAVGB(%%mm5, %%mm2) // ~(l6-l5)/4 + 128
- PAVGB(%%mm1, %%mm2) // ~(l4-l7)/4 +(l6-l5)/8 + 128
- PAVGB(%%mm5, %%mm2) // ~(l4-l7)/8 +5(l6-l5)/16 + 128
-// mm0=128-q, mm2=renergy/16 + 128, mm3=lenergy/16 + 128, mm4= menergy/16 + 128
-
- "movq "MANGLE(b00)", %%mm1 \n\t" // 0
- "movq "MANGLE(b00)", %%mm5 \n\t" // 0
- "psubb %%mm2, %%mm1 \n\t" // 128 - renergy/16
- "psubb %%mm3, %%mm5 \n\t" // 128 - lenergy/16
- PMAXUB(%%mm1, %%mm2) // 128 + |renergy/16|
- PMAXUB(%%mm5, %%mm3) // 128 + |lenergy/16|
- PMINUB(%%mm2, %%mm3, %%mm1) // 128 + MIN(|lenergy|,|renergy|)/16
-
-// mm0=128-q, mm3=128 + MIN(|lenergy|,|renergy|)/16, mm4= menergy/16 + 128
-
- "movq "MANGLE(b00)", %%mm7 \n\t" // 0
- "movq %2, %%mm2 \n\t" // QP
- PAVGB(%%mm6, %%mm2) // 128 + QP/2
- "psubb %%mm6, %%mm2 \n\t"
-
- "movq %%mm4, %%mm1 \n\t"
- "pcmpgtb %%mm7, %%mm1 \n\t" // SIGN(menergy)
- "pxor %%mm1, %%mm4 \n\t"
- "psubb %%mm1, %%mm4 \n\t" // 128 + |menergy|/16
- "pcmpgtb %%mm4, %%mm2 \n\t" // |menergy|/16 < QP/2
- "psubusb %%mm3, %%mm4 \n\t" //d=|menergy|/16 - MIN(|lenergy|,|renergy|)/16
-// mm0=128-q, mm1= SIGN(menergy), mm2= |menergy|/16 < QP/2, mm4= d/16
-
- "movq %%mm4, %%mm3 \n\t" // d
- "psubusb "MANGLE(b01)", %%mm4 \n\t"
- PAVGB(%%mm7, %%mm4) // d/32
- PAVGB(%%mm7, %%mm4) // (d + 32)/64
- "paddb %%mm3, %%mm4 \n\t" // 5d/64
- "pand %%mm2, %%mm4 \n\t"
-
- "movq "MANGLE(b80)", %%mm5 \n\t" // 128
- "psubb %%mm0, %%mm5 \n\t" // q
- "paddsb %%mm6, %%mm5 \n\t" // fix bad rounding
- "pcmpgtb %%mm5, %%mm7 \n\t" // SIGN(q)
- "pxor %%mm7, %%mm5 \n\t"
-
- PMINUB(%%mm5, %%mm4, %%mm3) // MIN(|q|, 5d/64)
- "pxor %%mm1, %%mm7 \n\t" // SIGN(d*q)
-
- "pand %%mm7, %%mm4 \n\t"
- "movq (%%"REG_a", %1, 2), %%mm0 \n\t"
- "movq (%0, %1, 4), %%mm2 \n\t"
- "pxor %%mm1, %%mm0 \n\t"
- "pxor %%mm1, %%mm2 \n\t"
- "paddb %%mm4, %%mm0 \n\t"
- "psubb %%mm4, %%mm2 \n\t"
- "pxor %%mm1, %%mm0 \n\t"
- "pxor %%mm1, %%mm2 \n\t"
- "movq %%mm0, (%%"REG_a", %1, 2) \n\t"
- "movq %%mm2, (%0, %1, 4) \n\t"
-
- :
- : "r" (src), "r" ((long)stride), "m" (c->pQPb)
- : "%"REG_a, "%"REG_c
- );
-
-/*
- {
- int x;
- src-= stride;
- for(x=0; x<BLOCK_SIZE; x++)
- {
- const int middleEnergy= 5*(src[l5] - src[l4]) + 2*(src[l3] - src[l6]);
- if(ABS(middleEnergy)< 8*QP)
- {
- const int q=(src[l4] - src[l5])/2;
- const int leftEnergy= 5*(src[l3] - src[l2]) + 2*(src[l1] - src[l4]);
- const int rightEnergy= 5*(src[l7] - src[l6]) + 2*(src[l5] - src[l8]);
-
- int d= ABS(middleEnergy) - MIN( ABS(leftEnergy), ABS(rightEnergy) );
- d= MAX(d, 0);
-
- d= (5*d + 32) >> 6;
- d*= SIGN(-middleEnergy);
-
- if(q>0)
- {
- d= d<0 ? 0 : d;
- d= d>q ? q : d;
- }
- else
- {
- d= d>0 ? 0 : d;
- d= d<q ? q : d;
- }
-
- src[l4]-= d;
- src[l5]+= d;
- }
- src++;
- }
-src-=8;
- for(x=0; x<8; x++)
- {
- int y;
- for(y=4; y<6; y++)
- {
- int d= src[x+y*stride] - tmp[x+(y-4)*8];
- int ad= ABS(d);
- static int max=0;
- static int sum=0;
- static int num=0;
- static int bias=0;
-
- if(max<ad) max=ad;
- sum+= ad>3 ? 1 : 0;
- if(ad>3)
- {
- src[0] = src[7] = src[stride*7] = src[(stride+1)*7]=255;
- }
- if(y==4) bias+=d;
- num++;
- if(num%1000000 == 0)
- {
- printf(" %d %d %d %d\n", num, sum, max, bias);
- }
- }
- }
-}
-*/
-#elif defined (HAVE_MMX)
- src+= stride*4;
- asm volatile(
- "pxor %%mm7, %%mm7 \n\t"
- "lea -40(%%"REG_SP"), %%"REG_c" \n\t" // make space for 4 8-byte vars
- "and "ALIGN_MASK", %%"REG_c" \n\t" // align
-// 0 1 2 3 4 5 6 7
-// %0 %0+%1 %0+2%1 eax+2%1 %0+4%1 eax+4%1 edx+%1 edx+2%1
-// %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1
-
- "movq (%0), %%mm0 \n\t"
- "movq %%mm0, %%mm1 \n\t"
- "punpcklbw %%mm7, %%mm0 \n\t" // low part of line 0
- "punpckhbw %%mm7, %%mm1 \n\t" // high part of line 0
-
- "movq (%0, %1), %%mm2 \n\t"
- "lea (%0, %1, 2), %%"REG_a" \n\t"
- "movq %%mm2, %%mm3 \n\t"
- "punpcklbw %%mm7, %%mm2 \n\t" // low part of line 1
- "punpckhbw %%mm7, %%mm3 \n\t" // high part of line 1
-
- "movq (%%"REG_a"), %%mm4 \n\t"
- "movq %%mm4, %%mm5 \n\t"
- "punpcklbw %%mm7, %%mm4 \n\t" // low part of line 2
- "punpckhbw %%mm7, %%mm5 \n\t" // high part of line 2
-
- "paddw %%mm0, %%mm0 \n\t" // 2L0
- "paddw %%mm1, %%mm1 \n\t" // 2H0
- "psubw %%mm4, %%mm2 \n\t" // L1 - L2
- "psubw %%mm5, %%mm3 \n\t" // H1 - H2
- "psubw %%mm2, %%mm0 \n\t" // 2L0 - L1 + L2
- "psubw %%mm3, %%mm1 \n\t" // 2H0 - H1 + H2
-
- "psllw $2, %%mm2 \n\t" // 4L1 - 4L2
- "psllw $2, %%mm3 \n\t" // 4H1 - 4H2
- "psubw %%mm2, %%mm0 \n\t" // 2L0 - 5L1 + 5L2
- "psubw %%mm3, %%mm1 \n\t" // 2H0 - 5H1 + 5H2
-
- "movq (%%"REG_a", %1), %%mm2 \n\t"
- "movq %%mm2, %%mm3 \n\t"
- "punpcklbw %%mm7, %%mm2 \n\t" // L3
- "punpckhbw %%mm7, %%mm3 \n\t" // H3
-
- "psubw %%mm2, %%mm0 \n\t" // 2L0 - 5L1 + 5L2 - L3
- "psubw %%mm3, %%mm1 \n\t" // 2H0 - 5H1 + 5H2 - H3
- "psubw %%mm2, %%mm0 \n\t" // 2L0 - 5L1 + 5L2 - 2L3
- "psubw %%mm3, %%mm1 \n\t" // 2H0 - 5H1 + 5H2 - 2H3
- "movq %%mm0, (%%"REG_c") \n\t" // 2L0 - 5L1 + 5L2 - 2L3
- "movq %%mm1, 8(%%"REG_c") \n\t" // 2H0 - 5H1 + 5H2 - 2H3
-
- "movq (%%"REG_a", %1, 2), %%mm0 \n\t"
- "movq %%mm0, %%mm1 \n\t"
- "punpcklbw %%mm7, %%mm0 \n\t" // L4
- "punpckhbw %%mm7, %%mm1 \n\t" // H4
-
- "psubw %%mm0, %%mm2 \n\t" // L3 - L4
- "psubw %%mm1, %%mm3 \n\t" // H3 - H4
- "movq %%mm2, 16(%%"REG_c") \n\t" // L3 - L4
- "movq %%mm3, 24(%%"REG_c") \n\t" // H3 - H4
- "paddw %%mm4, %%mm4 \n\t" // 2L2
- "paddw %%mm5, %%mm5 \n\t" // 2H2
- "psubw %%mm2, %%mm4 \n\t" // 2L2 - L3 + L4
- "psubw %%mm3, %%mm5 \n\t" // 2H2 - H3 + H4
-
- "lea (%%"REG_a", %1), %0 \n\t"
- "psllw $2, %%mm2 \n\t" // 4L3 - 4L4
- "psllw $2, %%mm3 \n\t" // 4H3 - 4H4
- "psubw %%mm2, %%mm4 \n\t" // 2L2 - 5L3 + 5L4
- "psubw %%mm3, %%mm5 \n\t" // 2H2 - 5H3 + 5H4
-//50 opcodes so far
- "movq (%0, %1, 2), %%mm2 \n\t"
- "movq %%mm2, %%mm3 \n\t"
- "punpcklbw %%mm7, %%mm2 \n\t" // L5
- "punpckhbw %%mm7, %%mm3 \n\t" // H5
- "psubw %%mm2, %%mm4 \n\t" // 2L2 - 5L3 + 5L4 - L5
- "psubw %%mm3, %%mm5 \n\t" // 2H2 - 5H3 + 5H4 - H5
- "psubw %%mm2, %%mm4 \n\t" // 2L2 - 5L3 + 5L4 - 2L5
- "psubw %%mm3, %%mm5 \n\t" // 2H2 - 5H3 + 5H4 - 2H5
-
- "movq (%%"REG_a", %1, 4), %%mm6 \n\t"
- "punpcklbw %%mm7, %%mm6 \n\t" // L6
- "psubw %%mm6, %%mm2 \n\t" // L5 - L6
- "movq (%%"REG_a", %1, 4), %%mm6 \n\t"
- "punpckhbw %%mm7, %%mm6 \n\t" // H6
- "psubw %%mm6, %%mm3 \n\t" // H5 - H6
-
- "paddw %%mm0, %%mm0 \n\t" // 2L4
- "paddw %%mm1, %%mm1 \n\t" // 2H4
- "psubw %%mm2, %%mm0 \n\t" // 2L4 - L5 + L6
- "psubw %%mm3, %%mm1 \n\t" // 2H4 - H5 + H6
-
- "psllw $2, %%mm2 \n\t" // 4L5 - 4L6
- "psllw $2, %%mm3 \n\t" // 4H5 - 4H6
- "psubw %%mm2, %%mm0 \n\t" // 2L4 - 5L5 + 5L6
- "psubw %%mm3, %%mm1 \n\t" // 2H4 - 5H5 + 5H6
-
- "movq (%0, %1, 4), %%mm2 \n\t"
- "movq %%mm2, %%mm3 \n\t"
- "punpcklbw %%mm7, %%mm2 \n\t" // L7
- "punpckhbw %%mm7, %%mm3 \n\t" // H7
-
- "paddw %%mm2, %%mm2 \n\t" // 2L7
- "paddw %%mm3, %%mm3 \n\t" // 2H7
- "psubw %%mm2, %%mm0 \n\t" // 2L4 - 5L5 + 5L6 - 2L7
- "psubw %%mm3, %%mm1 \n\t" // 2H4 - 5H5 + 5H6 - 2H7
-
- "movq (%%"REG_c"), %%mm2 \n\t" // 2L0 - 5L1 + 5L2 - 2L3
- "movq 8(%%"REG_c"), %%mm3 \n\t" // 2H0 - 5H1 + 5H2 - 2H3
-
-#ifdef HAVE_MMX2
- "movq %%mm7, %%mm6 \n\t" // 0
- "psubw %%mm0, %%mm6 \n\t"
- "pmaxsw %%mm6, %%mm0 \n\t" // |2L4 - 5L5 + 5L6 - 2L7|
- "movq %%mm7, %%mm6 \n\t" // 0
- "psubw %%mm1, %%mm6 \n\t"
- "pmaxsw %%mm6, %%mm1 \n\t" // |2H4 - 5H5 + 5H6 - 2H7|
- "movq %%mm7, %%mm6 \n\t" // 0
- "psubw %%mm2, %%mm6 \n\t"
- "pmaxsw %%mm6, %%mm2 \n\t" // |2L0 - 5L1 + 5L2 - 2L3|
- "movq %%mm7, %%mm6 \n\t" // 0
- "psubw %%mm3, %%mm6 \n\t"
- "pmaxsw %%mm6, %%mm3 \n\t" // |2H0 - 5H1 + 5H2 - 2H3|
-#else
- "movq %%mm7, %%mm6 \n\t" // 0
- "pcmpgtw %%mm0, %%mm6 \n\t"
- "pxor %%mm6, %%mm0 \n\t"
- "psubw %%mm6, %%mm0 \n\t" // |2L4 - 5L5 + 5L6 - 2L7|
- "movq %%mm7, %%mm6 \n\t" // 0
- "pcmpgtw %%mm1, %%mm6 \n\t"
- "pxor %%mm6, %%mm1 \n\t"
- "psubw %%mm6, %%mm1 \n\t" // |2H4 - 5H5 + 5H6 - 2H7|
- "movq %%mm7, %%mm6 \n\t" // 0
- "pcmpgtw %%mm2, %%mm6 \n\t"
- "pxor %%mm6, %%mm2 \n\t"
- "psubw %%mm6, %%mm2 \n\t" // |2L0 - 5L1 + 5L2 - 2L3|
- "movq %%mm7, %%mm6 \n\t" // 0
- "pcmpgtw %%mm3, %%mm6 \n\t"
- "pxor %%mm6, %%mm3 \n\t"
- "psubw %%mm6, %%mm3 \n\t" // |2H0 - 5H1 + 5H2 - 2H3|
-#endif
-
-#ifdef HAVE_MMX2
- "pminsw %%mm2, %%mm0 \n\t"
- "pminsw %%mm3, %%mm1 \n\t"
-#else
- "movq %%mm0, %%mm6 \n\t"
- "psubusw %%mm2, %%mm6 \n\t"
- "psubw %%mm6, %%mm0 \n\t"
- "movq %%mm1, %%mm6 \n\t"
- "psubusw %%mm3, %%mm6 \n\t"
- "psubw %%mm6, %%mm1 \n\t"
-#endif
-
- "movd %2, %%mm2 \n\t" // QP
- "punpcklbw %%mm7, %%mm2 \n\t"
-
- "movq %%mm7, %%mm6 \n\t" // 0
- "pcmpgtw %%mm4, %%mm6 \n\t" // sign(2L2 - 5L3 + 5L4 - 2L5)
- "pxor %%mm6, %%mm4 \n\t"
- "psubw %%mm6, %%mm4 \n\t" // |2L2 - 5L3 + 5L4 - 2L5|
- "pcmpgtw %%mm5, %%mm7 \n\t" // sign(2H2 - 5H3 + 5H4 - 2H5)
- "pxor %%mm7, %%mm5 \n\t"
- "psubw %%mm7, %%mm5 \n\t" // |2H2 - 5H3 + 5H4 - 2H5|
-// 100 opcodes
- "psllw $3, %%mm2 \n\t" // 8QP
- "movq %%mm2, %%mm3 \n\t" // 8QP
- "pcmpgtw %%mm4, %%mm2 \n\t"
- "pcmpgtw %%mm5, %%mm3 \n\t"
- "pand %%mm2, %%mm4 \n\t"
- "pand %%mm3, %%mm5 \n\t"
-
-
- "psubusw %%mm0, %%mm4 \n\t" // hd
- "psubusw %%mm1, %%mm5 \n\t" // ld
-
-
- "movq "MANGLE(w05)", %%mm2 \n\t" // 5
- "pmullw %%mm2, %%mm4 \n\t"
- "pmullw %%mm2, %%mm5 \n\t"
- "movq "MANGLE(w20)", %%mm2 \n\t" // 32
- "paddw %%mm2, %%mm4 \n\t"
- "paddw %%mm2, %%mm5 \n\t"
- "psrlw $6, %%mm4 \n\t"
- "psrlw $6, %%mm5 \n\t"
-
- "movq 16(%%"REG_c"), %%mm0 \n\t" // L3 - L4
- "movq 24(%%"REG_c"), %%mm1 \n\t" // H3 - H4
-
- "pxor %%mm2, %%mm2 \n\t"
- "pxor %%mm3, %%mm3 \n\t"
-
- "pcmpgtw %%mm0, %%mm2 \n\t" // sign (L3-L4)
- "pcmpgtw %%mm1, %%mm3 \n\t" // sign (H3-H4)
- "pxor %%mm2, %%mm0 \n\t"
- "pxor %%mm3, %%mm1 \n\t"
- "psubw %%mm2, %%mm0 \n\t" // |L3-L4|
- "psubw %%mm3, %%mm1 \n\t" // |H3-H4|
- "psrlw $1, %%mm0 \n\t" // |L3 - L4|/2
- "psrlw $1, %%mm1 \n\t" // |H3 - H4|/2
-
- "pxor %%mm6, %%mm2 \n\t"
- "pxor %%mm7, %%mm3 \n\t"
- "pand %%mm2, %%mm4 \n\t"
- "pand %%mm3, %%mm5 \n\t"
-
-#ifdef HAVE_MMX2
- "pminsw %%mm0, %%mm4 \n\t"
- "pminsw %%mm1, %%mm5 \n\t"
-#else
- "movq %%mm4, %%mm2 \n\t"
- "psubusw %%mm0, %%mm2 \n\t"
- "psubw %%mm2, %%mm4 \n\t"
- "movq %%mm5, %%mm2 \n\t"
- "psubusw %%mm1, %%mm2 \n\t"
- "psubw %%mm2, %%mm5 \n\t"
-#endif
- "pxor %%mm6, %%mm4 \n\t"
- "pxor %%mm7, %%mm5 \n\t"
- "psubw %%mm6, %%mm4 \n\t"
- "psubw %%mm7, %%mm5 \n\t"
- "packsswb %%mm5, %%mm4 \n\t"
- "movq (%0), %%mm0 \n\t"
- "paddb %%mm4, %%mm0 \n\t"
- "movq %%mm0, (%0) \n\t"
- "movq (%0, %1), %%mm0 \n\t"
- "psubb %%mm4, %%mm0 \n\t"
- "movq %%mm0, (%0, %1) \n\t"
-
- : "+r" (src)
- : "r" ((long)stride), "m" (c->pQPb)
- : "%"REG_a, "%"REG_c
- );
-#else //defined (HAVE_MMX2) || defined (HAVE_3DNOW)
- const int l1= stride;
- const int l2= stride + l1;
- const int l3= stride + l2;
- const int l4= stride + l3;
- const int l5= stride + l4;
- const int l6= stride + l5;
- const int l7= stride + l6;
- const int l8= stride + l7;
-// const int l9= stride + l8;
- int x;
- src+= stride*3;
- for(x=0; x<BLOCK_SIZE; x++)
- {
- const int middleEnergy= 5*(src[l5] - src[l4]) + 2*(src[l3] - src[l6]);
- if(ABS(middleEnergy) < 8*c->QP)
- {
- const int q=(src[l4] - src[l5])/2;
- const int leftEnergy= 5*(src[l3] - src[l2]) + 2*(src[l1] - src[l4]);
- const int rightEnergy= 5*(src[l7] - src[l6]) + 2*(src[l5] - src[l8]);
-
- int d= ABS(middleEnergy) - MIN( ABS(leftEnergy), ABS(rightEnergy) );
- d= MAX(d, 0);
-
- d= (5*d + 32) >> 6;
- d*= SIGN(-middleEnergy);
-
- if(q>0)
- {
- d= d<0 ? 0 : d;
- d= d>q ? q : d;
- }
- else
- {
- d= d>0 ? 0 : d;
- d= d<q ? q : d;
- }
-
- src[l4]-= d;
- src[l5]+= d;
- }
- src++;
- }
-#endif //defined (HAVE_MMX2) || defined (HAVE_3DNOW)
-}
-#endif //HAVE_ALTIVEC
-
-#ifndef HAVE_ALTIVEC
-static inline void RENAME(dering)(uint8_t src[], int stride, PPContext *c)
-{
-#if defined (HAVE_MMX2) || defined (HAVE_3DNOW)
- asm volatile(
- "pxor %%mm6, %%mm6 \n\t"
- "pcmpeqb %%mm7, %%mm7 \n\t"
- "movq %2, %%mm0 \n\t"
- "punpcklbw %%mm6, %%mm0 \n\t"
- "psrlw $1, %%mm0 \n\t"
- "psubw %%mm7, %%mm0 \n\t"
- "packuswb %%mm0, %%mm0 \n\t"
- "movq %%mm0, %3 \n\t"
-
- "lea (%0, %1), %%"REG_a" \n\t"
- "lea (%%"REG_a", %1, 4), %%"REG_d" \n\t"
-
-// 0 1 2 3 4 5 6 7 8 9
-// %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 %0+8%1 edx+4%1
-
-#undef FIND_MIN_MAX
-#ifdef HAVE_MMX2
-#define REAL_FIND_MIN_MAX(addr)\
- "movq " #addr ", %%mm0 \n\t"\
- "pminub %%mm0, %%mm7 \n\t"\
- "pmaxub %%mm0, %%mm6 \n\t"
-#else
-#define REAL_FIND_MIN_MAX(addr)\
- "movq " #addr ", %%mm0 \n\t"\
- "movq %%mm7, %%mm1 \n\t"\
- "psubusb %%mm0, %%mm6 \n\t"\
- "paddb %%mm0, %%mm6 \n\t"\
- "psubusb %%mm0, %%mm1 \n\t"\
- "psubb %%mm1, %%mm7 \n\t"
-#endif
-#define FIND_MIN_MAX(addr) REAL_FIND_MIN_MAX(addr)
-
-FIND_MIN_MAX((%%REGa))
-FIND_MIN_MAX((%%REGa, %1))
-FIND_MIN_MAX((%%REGa, %1, 2))
-FIND_MIN_MAX((%0, %1, 4))
-FIND_MIN_MAX((%%REGd))
-FIND_MIN_MAX((%%REGd, %1))
-FIND_MIN_MAX((%%REGd, %1, 2))
-FIND_MIN_MAX((%0, %1, 8))
-
- "movq %%mm7, %%mm4 \n\t"
- "psrlq $8, %%mm7 \n\t"
-#ifdef HAVE_MMX2
- "pminub %%mm4, %%mm7 \n\t" // min of pixels
- "pshufw $0xF9, %%mm7, %%mm4 \n\t"
- "pminub %%mm4, %%mm7 \n\t" // min of pixels
- "pshufw $0xFE, %%mm7, %%mm4 \n\t"
- "pminub %%mm4, %%mm7 \n\t"
-#else
- "movq %%mm7, %%mm1 \n\t"
- "psubusb %%mm4, %%mm1 \n\t"
- "psubb %%mm1, %%mm7 \n\t"
- "movq %%mm7, %%mm4 \n\t"
- "psrlq $16, %%mm7 \n\t"
- "movq %%mm7, %%mm1 \n\t"
- "psubusb %%mm4, %%mm1 \n\t"
- "psubb %%mm1, %%mm7 \n\t"
- "movq %%mm7, %%mm4 \n\t"
- "psrlq $32, %%mm7 \n\t"
- "movq %%mm7, %%mm1 \n\t"
- "psubusb %%mm4, %%mm1 \n\t"
- "psubb %%mm1, %%mm7 \n\t"
-#endif
-
-
- "movq %%mm6, %%mm4 \n\t"
- "psrlq $8, %%mm6 \n\t"
-#ifdef HAVE_MMX2
- "pmaxub %%mm4, %%mm6 \n\t" // max of pixels
- "pshufw $0xF9, %%mm6, %%mm4 \n\t"
- "pmaxub %%mm4, %%mm6 \n\t"
- "pshufw $0xFE, %%mm6, %%mm4 \n\t"
- "pmaxub %%mm4, %%mm6 \n\t"
-#else
- "psubusb %%mm4, %%mm6 \n\t"
- "paddb %%mm4, %%mm6 \n\t"
- "movq %%mm6, %%mm4 \n\t"
- "psrlq $16, %%mm6 \n\t"
- "psubusb %%mm4, %%mm6 \n\t"
- "paddb %%mm4, %%mm6 \n\t"
- "movq %%mm6, %%mm4 \n\t"
- "psrlq $32, %%mm6 \n\t"
- "psubusb %%mm4, %%mm6 \n\t"
- "paddb %%mm4, %%mm6 \n\t"
-#endif
- "movq %%mm6, %%mm0 \n\t" // max
- "psubb %%mm7, %%mm6 \n\t" // max - min
- "movd %%mm6, %%ecx \n\t"
- "cmpb "MANGLE(deringThreshold)", %%cl \n\t"
- " jb 1f \n\t"
- "lea -24(%%"REG_SP"), %%"REG_c" \n\t"
- "and "ALIGN_MASK", %%"REG_c" \n\t"
- PAVGB(%%mm0, %%mm7) // a=(max + min)/2
- "punpcklbw %%mm7, %%mm7 \n\t"
- "punpcklbw %%mm7, %%mm7 \n\t"
- "punpcklbw %%mm7, %%mm7 \n\t"
- "movq %%mm7, (%%"REG_c") \n\t"
-
- "movq (%0), %%mm0 \n\t" // L10
- "movq %%mm0, %%mm1 \n\t" // L10
- "movq %%mm0, %%mm2 \n\t" // L10
- "psllq $8, %%mm1 \n\t"
- "psrlq $8, %%mm2 \n\t"
- "movd -4(%0), %%mm3 \n\t"
- "movd 8(%0), %%mm4 \n\t"
- "psrlq $24, %%mm3 \n\t"
- "psllq $56, %%mm4 \n\t"
- "por %%mm3, %%mm1 \n\t" // L00
- "por %%mm4, %%mm2 \n\t" // L20
- "movq %%mm1, %%mm3 \n\t" // L00
- PAVGB(%%mm2, %%mm1) // (L20 + L00)/2
- PAVGB(%%mm0, %%mm1) // (L20 + L00 + 2L10)/4
- "psubusb %%mm7, %%mm0 \n\t"
- "psubusb %%mm7, %%mm2 \n\t"
- "psubusb %%mm7, %%mm3 \n\t"
- "pcmpeqb "MANGLE(b00)", %%mm0 \n\t" // L10 > a ? 0 : -1
- "pcmpeqb "MANGLE(b00)", %%mm2 \n\t" // L20 > a ? 0 : -1
- "pcmpeqb "MANGLE(b00)", %%mm3 \n\t" // L00 > a ? 0 : -1
- "paddb %%mm2, %%mm0 \n\t"
- "paddb %%mm3, %%mm0 \n\t"
-
- "movq (%%"REG_a"), %%mm2 \n\t" // L11
- "movq %%mm2, %%mm3 \n\t" // L11
- "movq %%mm2, %%mm4 \n\t" // L11
- "psllq $8, %%mm3 \n\t"
- "psrlq $8, %%mm4 \n\t"
- "movd -4(%%"REG_a"), %%mm5 \n\t"
- "movd 8(%%"REG_a"), %%mm6 \n\t"
- "psrlq $24, %%mm5 \n\t"
- "psllq $56, %%mm6 \n\t"
- "por %%mm5, %%mm3 \n\t" // L01
- "por %%mm6, %%mm4 \n\t" // L21
- "movq %%mm3, %%mm5 \n\t" // L01
- PAVGB(%%mm4, %%mm3) // (L21 + L01)/2
- PAVGB(%%mm2, %%mm3) // (L21 + L01 + 2L11)/4
- "psubusb %%mm7, %%mm2 \n\t"
- "psubusb %%mm7, %%mm4 \n\t"
- "psubusb %%mm7, %%mm5 \n\t"
- "pcmpeqb "MANGLE(b00)", %%mm2 \n\t" // L11 > a ? 0 : -1
- "pcmpeqb "MANGLE(b00)", %%mm4 \n\t" // L21 > a ? 0 : -1
- "pcmpeqb "MANGLE(b00)", %%mm5 \n\t" // L01 > a ? 0 : -1
- "paddb %%mm4, %%mm2 \n\t"
- "paddb %%mm5, %%mm2 \n\t"
-// 0, 2, 3, 1
-#define REAL_DERING_CORE(dst,src,ppsx,psx,sx,pplx,plx,lx,t0,t1) \
- "movq " #src ", " #sx " \n\t" /* src[0] */\
- "movq " #sx ", " #lx " \n\t" /* src[0] */\
- "movq " #sx ", " #t0 " \n\t" /* src[0] */\
- "psllq $8, " #lx " \n\t"\
- "psrlq $8, " #t0 " \n\t"\
- "movd -4" #src ", " #t1 " \n\t"\
- "psrlq $24, " #t1 " \n\t"\
- "por " #t1 ", " #lx " \n\t" /* src[-1] */\
- "movd 8" #src ", " #t1 " \n\t"\
- "psllq $56, " #t1 " \n\t"\
- "por " #t1 ", " #t0 " \n\t" /* src[+1] */\
- "movq " #lx ", " #t1 " \n\t" /* src[-1] */\
- PAVGB(t0, lx) /* (src[-1] + src[+1])/2 */\
- PAVGB(sx, lx) /* (src[-1] + 2src[0] + src[+1])/4 */\
- PAVGB(lx, pplx) \
- "movq " #lx ", 8(%%"REG_c") \n\t"\
- "movq (%%"REG_c"), " #lx " \n\t"\
- "psubusb " #lx ", " #t1 " \n\t"\
- "psubusb " #lx ", " #t0 " \n\t"\
- "psubusb " #lx ", " #sx " \n\t"\
- "movq "MANGLE(b00)", " #lx " \n\t"\
- "pcmpeqb " #lx ", " #t1 " \n\t" /* src[-1] > a ? 0 : -1*/\
- "pcmpeqb " #lx ", " #t0 " \n\t" /* src[+1] > a ? 0 : -1*/\
- "pcmpeqb " #lx ", " #sx " \n\t" /* src[0] > a ? 0 : -1*/\
- "paddb " #t1 ", " #t0 " \n\t"\
- "paddb " #t0 ", " #sx " \n\t"\
-\
- PAVGB(plx, pplx) /* filtered */\
- "movq " #dst ", " #t0 " \n\t" /* dst */\
- "movq " #t0 ", " #t1 " \n\t" /* dst */\
- "psubusb %3, " #t0 " \n\t"\
- "paddusb %3, " #t1 " \n\t"\
- PMAXUB(t0, pplx)\
- PMINUB(t1, pplx, t0)\
- "paddb " #sx ", " #ppsx " \n\t"\
- "paddb " #psx ", " #ppsx " \n\t"\
- "#paddb "MANGLE(b02)", " #ppsx " \n\t"\
- "pand "MANGLE(b08)", " #ppsx " \n\t"\
- "pcmpeqb " #lx ", " #ppsx " \n\t"\
- "pand " #ppsx ", " #pplx " \n\t"\
- "pandn " #dst ", " #ppsx " \n\t"\
- "por " #pplx ", " #ppsx " \n\t"\
- "movq " #ppsx ", " #dst " \n\t"\
- "movq 8(%%"REG_c"), " #lx " \n\t"
-
-#define DERING_CORE(dst,src,ppsx,psx,sx,pplx,plx,lx,t0,t1) \
- REAL_DERING_CORE(dst,src,ppsx,psx,sx,pplx,plx,lx,t0,t1)
-/*
-0000000
-1111111
-
-1111110
-1111101
-1111100
-1111011
-1111010
-1111001
-
-1111000
-1110111
-
-*/
-//DERING_CORE(dst ,src ,ppsx ,psx ,sx ,pplx ,plx ,lx ,t0 ,t1)
-DERING_CORE((%%REGa) ,(%%REGa, %1) ,%%mm0,%%mm2,%%mm4,%%mm1,%%mm3,%%mm5,%%mm6,%%mm7)
-DERING_CORE((%%REGa, %1) ,(%%REGa, %1, 2),%%mm2,%%mm4,%%mm0,%%mm3,%%mm5,%%mm1,%%mm6,%%mm7)
-DERING_CORE((%%REGa, %1, 2),(%0, %1, 4) ,%%mm4,%%mm0,%%mm2,%%mm5,%%mm1,%%mm3,%%mm6,%%mm7)
-DERING_CORE((%0, %1, 4) ,(%%REGd) ,%%mm0,%%mm2,%%mm4,%%mm1,%%mm3,%%mm5,%%mm6,%%mm7)
-DERING_CORE((%%REGd) ,(%%REGd, %1) ,%%mm2,%%mm4,%%mm0,%%mm3,%%mm5,%%mm1,%%mm6,%%mm7)
-DERING_CORE((%%REGd, %1) ,(%%REGd, %1, 2),%%mm4,%%mm0,%%mm2,%%mm5,%%mm1,%%mm3,%%mm6,%%mm7)
-DERING_CORE((%%REGd, %1, 2),(%0, %1, 8) ,%%mm0,%%mm2,%%mm4,%%mm1,%%mm3,%%mm5,%%mm6,%%mm7)
-DERING_CORE((%0, %1, 8) ,(%%REGd, %1, 4),%%mm2,%%mm4,%%mm0,%%mm3,%%mm5,%%mm1,%%mm6,%%mm7)
-
- "1: \n\t"
- : : "r" (src), "r" ((long)stride), "m" (c->pQPb), "m"(c->pQPb2)
- : "%"REG_a, "%"REG_d, "%"REG_c
- );
-#else //defined (HAVE_MMX2) || defined (HAVE_3DNOW)
- int y;
- int min=255;
- int max=0;
- int avg;
- uint8_t *p;
- int s[10];
- const int QP2= c->QP/2 + 1;
-
- for(y=1; y<9; y++)
- {
- int x;
- p= src + stride*y;
- for(x=1; x<9; x++)
- {
- p++;
- if(*p > max) max= *p;
- if(*p < min) min= *p;
- }
- }
- avg= (min + max + 1)>>1;
-
- if(max - min <deringThreshold) return;
-
- for(y=0; y<10; y++)
- {
- int t = 0;
-
- if(src[stride*y + 0] > avg) t+= 1;
- if(src[stride*y + 1] > avg) t+= 2;
- if(src[stride*y + 2] > avg) t+= 4;
- if(src[stride*y + 3] > avg) t+= 8;
- if(src[stride*y + 4] > avg) t+= 16;
- if(src[stride*y + 5] > avg) t+= 32;
- if(src[stride*y + 6] > avg) t+= 64;
- if(src[stride*y + 7] > avg) t+= 128;
- if(src[stride*y + 8] > avg) t+= 256;
- if(src[stride*y + 9] > avg) t+= 512;
-
- t |= (~t)<<16;
- t &= (t<<1) & (t>>1);
- s[y] = t;
- }
-
- for(y=1; y<9; y++)
- {
- int t = s[y-1] & s[y] & s[y+1];
- t|= t>>16;
- s[y-1]= t;
- }
-
- for(y=1; y<9; y++)
- {
- int x;
- int t = s[y-1];
-
- p= src + stride*y;
- for(x=1; x<9; x++)
- {
- p++;
- if(t & (1<<x))
- {
- int f= (*(p-stride-1)) + 2*(*(p-stride)) + (*(p-stride+1))
- +2*(*(p -1)) + 4*(*p ) + 2*(*(p +1))
- +(*(p+stride-1)) + 2*(*(p+stride)) + (*(p+stride+1));
- f= (f + 8)>>4;
-
-#ifdef DEBUG_DERING_THRESHOLD
- asm volatile("emms\n\t":);
- {
- static long long numPixels=0;
- if(x!=1 && x!=8 && y!=1 && y!=8) numPixels++;
-// if((max-min)<20 || (max-min)*QP<200)
-// if((max-min)*QP < 500)
-// if(max-min<QP/2)
- if(max-min < 20)
- {
- static int numSkiped=0;
- static int errorSum=0;
- static int worstQP=0;
- static int worstRange=0;
- static int worstDiff=0;
- int diff= (f - *p);
- int absDiff= ABS(diff);
- int error= diff*diff;
-
- if(x==1 || x==8 || y==1 || y==8) continue;
-
- numSkiped++;
- if(absDiff > worstDiff)
- {
- worstDiff= absDiff;
- worstQP= QP;
- worstRange= max-min;
- }
- errorSum+= error;
-
- if(1024LL*1024LL*1024LL % numSkiped == 0)
- {
- printf( "sum:%1.3f, skip:%d, wQP:%d, "
- "wRange:%d, wDiff:%d, relSkip:%1.3f\n",
- (float)errorSum/numSkiped, numSkiped, worstQP, worstRange,
- worstDiff, (float)numSkiped/numPixels);
- }
- }
- }
-#endif
- if (*p + QP2 < f) *p= *p + QP2;
- else if(*p - QP2 > f) *p= *p - QP2;
- else *p=f;
- }
- }
- }
-#ifdef DEBUG_DERING_THRESHOLD
- if(max-min < 20)
- {
- for(y=1; y<9; y++)
- {
- int x;
- int t = 0;
- p= src + stride*y;
- for(x=1; x<9; x++)
- {
- p++;
- *p = MIN(*p + 20, 255);
- }
- }
-// src[0] = src[7]=src[stride*7]=src[stride*7 + 7]=255;
- }
-#endif
-#endif //defined (HAVE_MMX2) || defined (HAVE_3DNOW)
-}
-#endif //HAVE_ALTIVEC
-
-/**
- * Deinterlaces the given block by linearly interpolating every second line.
- * will be called for every 8x8 block and can read & write from line 4-15
- * lines 0-3 have been passed through the deblock / dering filters allready, but can be read too
- * lines 4-12 will be read into the deblocking filter and should be deinterlaced
- */
-static inline void RENAME(deInterlaceInterpolateLinear)(uint8_t src[], int stride)
-{
-#if defined (HAVE_MMX2) || defined (HAVE_3DNOW)
- src+= 4*stride;
- asm volatile(
- "lea (%0, %1), %%"REG_a" \n\t"
- "lea (%%"REG_a", %1, 4), %%"REG_c" \n\t"
-// 0 1 2 3 4 5 6 7 8 9
-// %0 eax eax+%1 eax+2%1 %0+4%1 ecx ecx+%1 ecx+2%1 %0+8%1 ecx+4%1
-
- "movq (%0), %%mm0 \n\t"
- "movq (%%"REG_a", %1), %%mm1 \n\t"
- PAVGB(%%mm1, %%mm0)
- "movq %%mm0, (%%"REG_a") \n\t"
- "movq (%0, %1, 4), %%mm0 \n\t"
- PAVGB(%%mm0, %%mm1)
- "movq %%mm1, (%%"REG_a", %1, 2) \n\t"
- "movq (%%"REG_c", %1), %%mm1 \n\t"
- PAVGB(%%mm1, %%mm0)
- "movq %%mm0, (%%"REG_c") \n\t"
- "movq (%0, %1, 8), %%mm0 \n\t"
- PAVGB(%%mm0, %%mm1)
- "movq %%mm1, (%%"REG_c", %1, 2) \n\t"
-
- : : "r" (src), "r" ((long)stride)
- : "%"REG_a, "%"REG_c
- );
-#else
- int a, b, x;
- src+= 4*stride;
-
- for(x=0; x<2; x++){
- a= *(uint32_t*)&src[stride*0];
- b= *(uint32_t*)&src[stride*2];
- *(uint32_t*)&src[stride*1]= (a|b) - (((a^b)&0xFEFEFEFEUL)>>1);
- a= *(uint32_t*)&src[stride*4];
- *(uint32_t*)&src[stride*3]= (a|b) - (((a^b)&0xFEFEFEFEUL)>>1);
- b= *(uint32_t*)&src[stride*6];
- *(uint32_t*)&src[stride*5]= (a|b) - (((a^b)&0xFEFEFEFEUL)>>1);
- a= *(uint32_t*)&src[stride*8];
- *(uint32_t*)&src[stride*7]= (a|b) - (((a^b)&0xFEFEFEFEUL)>>1);
- src += 4;
- }
-#endif
-}
-
-/**
- * Deinterlaces the given block by cubic interpolating every second line.
- * will be called for every 8x8 block and can read & write from line 4-15
- * lines 0-3 have been passed through the deblock / dering filters allready, but can be read too
- * lines 4-12 will be read into the deblocking filter and should be deinterlaced
- * this filter will read lines 3-15 and write 7-13
- */
-static inline void RENAME(deInterlaceInterpolateCubic)(uint8_t src[], int stride)
-{
-#if defined (HAVE_MMX2) || defined (HAVE_3DNOW)
- src+= stride*3;
- asm volatile(
- "lea (%0, %1), %%"REG_a" \n\t"
- "lea (%%"REG_a", %1, 4), %%"REG_d" \n\t"
- "lea (%%"REG_d", %1, 4), %%"REG_c" \n\t"
- "add %1, %%"REG_c" \n\t"
- "pxor %%mm7, %%mm7 \n\t"
-// 0 1 2 3 4 5 6 7 8 9 10
-// %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 %0+8%1 edx+4%1 ecx
-
-#define REAL_DEINT_CUBIC(a,b,c,d,e)\
- "movq " #a ", %%mm0 \n\t"\
- "movq " #b ", %%mm1 \n\t"\
- "movq " #d ", %%mm2 \n\t"\
- "movq " #e ", %%mm3 \n\t"\
- PAVGB(%%mm2, %%mm1) /* (b+d) /2 */\
- PAVGB(%%mm3, %%mm0) /* a(a+e) /2 */\
- "movq %%mm0, %%mm2 \n\t"\
- "punpcklbw %%mm7, %%mm0 \n\t"\
- "punpckhbw %%mm7, %%mm2 \n\t"\
- "movq %%mm1, %%mm3 \n\t"\
- "punpcklbw %%mm7, %%mm1 \n\t"\
- "punpckhbw %%mm7, %%mm3 \n\t"\
- "psubw %%mm1, %%mm0 \n\t" /* L(a+e - (b+d))/2 */\
- "psubw %%mm3, %%mm2 \n\t" /* H(a+e - (b+d))/2 */\
- "psraw $3, %%mm0 \n\t" /* L(a+e - (b+d))/16 */\
- "psraw $3, %%mm2 \n\t" /* H(a+e - (b+d))/16 */\
- "psubw %%mm0, %%mm1 \n\t" /* L(9b + 9d - a - e)/16 */\
- "psubw %%mm2, %%mm3 \n\t" /* H(9b + 9d - a - e)/16 */\
- "packuswb %%mm3, %%mm1 \n\t"\
- "movq %%mm1, " #c " \n\t"
-#define DEINT_CUBIC(a,b,c,d,e) REAL_DEINT_CUBIC(a,b,c,d,e)
-
-DEINT_CUBIC((%0) , (%%REGa, %1), (%%REGa, %1, 2), (%0, %1, 4) , (%%REGd, %1))
-DEINT_CUBIC((%%REGa, %1), (%0, %1, 4) , (%%REGd) , (%%REGd, %1), (%0, %1, 8))
-DEINT_CUBIC((%0, %1, 4) , (%%REGd, %1), (%%REGd, %1, 2), (%0, %1, 8) , (%%REGc))
-DEINT_CUBIC((%%REGd, %1), (%0, %1, 8) , (%%REGd, %1, 4), (%%REGc) , (%%REGc, %1, 2))
-
- : : "r" (src), "r" ((long)stride)
- : "%"REG_a, "%"REG_d, "%"REG_c
- );
-#else //defined (HAVE_MMX2) || defined (HAVE_3DNOW)
- int x;
- src+= stride*3;
- for(x=0; x<8; x++)
- {
- src[stride*3] = CLIP((-src[0] + 9*src[stride*2] + 9*src[stride*4] - src[stride*6])>>4);
- src[stride*5] = CLIP((-src[stride*2] + 9*src[stride*4] + 9*src[stride*6] - src[stride*8])>>4);
- src[stride*7] = CLIP((-src[stride*4] + 9*src[stride*6] + 9*src[stride*8] - src[stride*10])>>4);
- src[stride*9] = CLIP((-src[stride*6] + 9*src[stride*8] + 9*src[stride*10] - src[stride*12])>>4);
- src++;
- }
-#endif //defined (HAVE_MMX2) || defined (HAVE_3DNOW)
-}
-
-/**
- * Deinterlaces the given block by filtering every second line with a (-1 4 2 4 -1) filter.
- * will be called for every 8x8 block and can read & write from line 4-15
- * lines 0-3 have been passed through the deblock / dering filters allready, but can be read too
- * lines 4-12 will be read into the deblocking filter and should be deinterlaced
- * this filter will read lines 4-13 and write 5-11
- */
-static inline void RENAME(deInterlaceFF)(uint8_t src[], int stride, uint8_t *tmp)
-{
-#if defined (HAVE_MMX2) || defined (HAVE_3DNOW)
- src+= stride*4;
- asm volatile(
- "lea (%0, %1), %%"REG_a" \n\t"
- "lea (%%"REG_a", %1, 4), %%"REG_d" \n\t"
- "pxor %%mm7, %%mm7 \n\t"
- "movq (%2), %%mm0 \n\t"
-// 0 1 2 3 4 5 6 7 8 9 10
-// %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 %0+8%1 edx+4%1 ecx
-
-#define REAL_DEINT_FF(a,b,c,d)\
- "movq " #a ", %%mm1 \n\t"\
- "movq " #b ", %%mm2 \n\t"\
- "movq " #c ", %%mm3 \n\t"\
- "movq " #d ", %%mm4 \n\t"\
- PAVGB(%%mm3, %%mm1) \
- PAVGB(%%mm4, %%mm0) \
- "movq %%mm0, %%mm3 \n\t"\
- "punpcklbw %%mm7, %%mm0 \n\t"\
- "punpckhbw %%mm7, %%mm3 \n\t"\
- "movq %%mm1, %%mm4 \n\t"\
- "punpcklbw %%mm7, %%mm1 \n\t"\
- "punpckhbw %%mm7, %%mm4 \n\t"\
- "psllw $2, %%mm1 \n\t"\
- "psllw $2, %%mm4 \n\t"\
- "psubw %%mm0, %%mm1 \n\t"\
- "psubw %%mm3, %%mm4 \n\t"\
- "movq %%mm2, %%mm5 \n\t"\
- "movq %%mm2, %%mm0 \n\t"\
- "punpcklbw %%mm7, %%mm2 \n\t"\
- "punpckhbw %%mm7, %%mm5 \n\t"\
- "paddw %%mm2, %%mm1 \n\t"\
- "paddw %%mm5, %%mm4 \n\t"\
- "psraw $2, %%mm1 \n\t"\
- "psraw $2, %%mm4 \n\t"\
- "packuswb %%mm4, %%mm1 \n\t"\
- "movq %%mm1, " #b " \n\t"\
-
-#define DEINT_FF(a,b,c,d) REAL_DEINT_FF(a,b,c,d)
-
-DEINT_FF((%0) , (%%REGa) , (%%REGa, %1), (%%REGa, %1, 2))
-DEINT_FF((%%REGa, %1), (%%REGa, %1, 2), (%0, %1, 4) , (%%REGd) )
-DEINT_FF((%0, %1, 4) , (%%REGd) , (%%REGd, %1), (%%REGd, %1, 2))
-DEINT_FF((%%REGd, %1), (%%REGd, %1, 2), (%0, %1, 8) , (%%REGd, %1, 4))
-
- "movq %%mm0, (%2) \n\t"
- : : "r" (src), "r" ((long)stride), "r"(tmp)
- : "%"REG_a, "%"REG_d
- );
-#else //defined (HAVE_MMX2) || defined (HAVE_3DNOW)
- int x;
- src+= stride*4;
- for(x=0; x<8; x++)
- {
- int t1= tmp[x];
- int t2= src[stride*1];
-
- src[stride*1]= CLIP((-t1 + 4*src[stride*0] + 2*t2 + 4*src[stride*2] - src[stride*3] + 4)>>3);
- t1= src[stride*4];
- src[stride*3]= CLIP((-t2 + 4*src[stride*2] + 2*t1 + 4*src[stride*4] - src[stride*5] + 4)>>3);
- t2= src[stride*6];
- src[stride*5]= CLIP((-t1 + 4*src[stride*4] + 2*t2 + 4*src[stride*6] - src[stride*7] + 4)>>3);
- t1= src[stride*8];
- src[stride*7]= CLIP((-t2 + 4*src[stride*6] + 2*t1 + 4*src[stride*8] - src[stride*9] + 4)>>3);
- tmp[x]= t1;
-
- src++;
- }
-#endif //defined (HAVE_MMX2) || defined (HAVE_3DNOW)
-}
-
-/**
- * Deinterlaces the given block by filtering every line with a (-1 2 6 2 -1) filter.
- * will be called for every 8x8 block and can read & write from line 4-15
- * lines 0-3 have been passed through the deblock / dering filters allready, but can be read too
- * lines 4-12 will be read into the deblocking filter and should be deinterlaced
- * this filter will read lines 4-13 and write 4-11
- */
-static inline void RENAME(deInterlaceL5)(uint8_t src[], int stride, uint8_t *tmp, uint8_t *tmp2)
-{
-#if defined (HAVE_MMX2) || defined (HAVE_3DNOW)
- src+= stride*4;
- asm volatile(
- "lea (%0, %1), %%"REG_a" \n\t"
- "lea (%%"REG_a", %1, 4), %%"REG_d" \n\t"
- "pxor %%mm7, %%mm7 \n\t"
- "movq (%2), %%mm0 \n\t"
- "movq (%3), %%mm1 \n\t"
-// 0 1 2 3 4 5 6 7 8 9 10
-// %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 %0+8%1 edx+4%1 ecx
-
-#define REAL_DEINT_L5(t1,t2,a,b,c)\
- "movq " #a ", %%mm2 \n\t"\
- "movq " #b ", %%mm3 \n\t"\
- "movq " #c ", %%mm4 \n\t"\
- PAVGB(t2, %%mm3) \
- PAVGB(t1, %%mm4) \
- "movq %%mm2, %%mm5 \n\t"\
- "movq %%mm2, " #t1 " \n\t"\
- "punpcklbw %%mm7, %%mm2 \n\t"\
- "punpckhbw %%mm7, %%mm5 \n\t"\
- "movq %%mm2, %%mm6 \n\t"\
- "paddw %%mm2, %%mm2 \n\t"\
- "paddw %%mm6, %%mm2 \n\t"\
- "movq %%mm5, %%mm6 \n\t"\
- "paddw %%mm5, %%mm5 \n\t"\
- "paddw %%mm6, %%mm5 \n\t"\
- "movq %%mm3, %%mm6 \n\t"\
- "punpcklbw %%mm7, %%mm3 \n\t"\
- "punpckhbw %%mm7, %%mm6 \n\t"\
- "paddw %%mm3, %%mm3 \n\t"\
- "paddw %%mm6, %%mm6 \n\t"\
- "paddw %%mm3, %%mm2 \n\t"\
- "paddw %%mm6, %%mm5 \n\t"\
- "movq %%mm4, %%mm6 \n\t"\
- "punpcklbw %%mm7, %%mm4 \n\t"\
- "punpckhbw %%mm7, %%mm6 \n\t"\
- "psubw %%mm4, %%mm2 \n\t"\
- "psubw %%mm6, %%mm5 \n\t"\
- "psraw $2, %%mm2 \n\t"\
- "psraw $2, %%mm5 \n\t"\
- "packuswb %%mm5, %%mm2 \n\t"\
- "movq %%mm2, " #a " \n\t"\
-
-#define DEINT_L5(t1,t2,a,b,c) REAL_DEINT_L5(t1,t2,a,b,c)
-
-DEINT_L5(%%mm0, %%mm1, (%0) , (%%REGa) , (%%REGa, %1) )
-DEINT_L5(%%mm1, %%mm0, (%%REGa) , (%%REGa, %1) , (%%REGa, %1, 2))
-DEINT_L5(%%mm0, %%mm1, (%%REGa, %1) , (%%REGa, %1, 2), (%0, %1, 4) )
-DEINT_L5(%%mm1, %%mm0, (%%REGa, %1, 2), (%0, %1, 4) , (%%REGd) )
-DEINT_L5(%%mm0, %%mm1, (%0, %1, 4) , (%%REGd) , (%%REGd, %1) )
-DEINT_L5(%%mm1, %%mm0, (%%REGd) , (%%REGd, %1) , (%%REGd, %1, 2))
-DEINT_L5(%%mm0, %%mm1, (%%REGd, %1) , (%%REGd, %1, 2), (%0, %1, 8) )
-DEINT_L5(%%mm1, %%mm0, (%%REGd, %1, 2), (%0, %1, 8) , (%%REGd, %1, 4))
-
- "movq %%mm0, (%2) \n\t"
- "movq %%mm1, (%3) \n\t"
- : : "r" (src), "r" ((long)stride), "r"(tmp), "r"(tmp2)
- : "%"REG_a, "%"REG_d
- );
-#else //defined (HAVE_MMX2) || defined (HAVE_3DNOW)
- int x;
- src+= stride*4;
- for(x=0; x<8; x++)
- {
- int t1= tmp[x];
- int t2= tmp2[x];
- int t3= src[0];
-
- src[stride*0]= CLIP((-(t1 + src[stride*2]) + 2*(t2 + src[stride*1]) + 6*t3 + 4)>>3);
- t1= src[stride*1];
- src[stride*1]= CLIP((-(t2 + src[stride*3]) + 2*(t3 + src[stride*2]) + 6*t1 + 4)>>3);
- t2= src[stride*2];
- src[stride*2]= CLIP((-(t3 + src[stride*4]) + 2*(t1 + src[stride*3]) + 6*t2 + 4)>>3);
- t3= src[stride*3];
- src[stride*3]= CLIP((-(t1 + src[stride*5]) + 2*(t2 + src[stride*4]) + 6*t3 + 4)>>3);
- t1= src[stride*4];
- src[stride*4]= CLIP((-(t2 + src[stride*6]) + 2*(t3 + src[stride*5]) + 6*t1 + 4)>>3);
- t2= src[stride*5];
- src[stride*5]= CLIP((-(t3 + src[stride*7]) + 2*(t1 + src[stride*6]) + 6*t2 + 4)>>3);
- t3= src[stride*6];
- src[stride*6]= CLIP((-(t1 + src[stride*8]) + 2*(t2 + src[stride*7]) + 6*t3 + 4)>>3);
- t1= src[stride*7];
- src[stride*7]= CLIP((-(t2 + src[stride*9]) + 2*(t3 + src[stride*8]) + 6*t1 + 4)>>3);
-
- tmp[x]= t3;
- tmp2[x]= t1;
-
- src++;
- }
-#endif //defined (HAVE_MMX2) || defined (HAVE_3DNOW)
-}
-
-/**
- * Deinterlaces the given block by filtering all lines with a (1 2 1) filter.
- * will be called for every 8x8 block and can read & write from line 4-15
- * lines 0-3 have been passed through the deblock / dering filters allready, but can be read too
- * lines 4-12 will be read into the deblocking filter and should be deinterlaced
- * this filter will read lines 4-13 and write 4-11
- */
-static inline void RENAME(deInterlaceBlendLinear)(uint8_t src[], int stride, uint8_t *tmp)
-{
-#if defined (HAVE_MMX2) || defined (HAVE_3DNOW)
- src+= 4*stride;
- asm volatile(
- "lea (%0, %1), %%"REG_a" \n\t"
- "lea (%%"REG_a", %1, 4), %%"REG_d" \n\t"
-// 0 1 2 3 4 5 6 7 8 9
-// %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 %0+8%1 edx+4%1
-
- "movq (%2), %%mm0 \n\t" // L0
- "movq (%%"REG_a"), %%mm1 \n\t" // L2
- PAVGB(%%mm1, %%mm0) // L0+L2
- "movq (%0), %%mm2 \n\t" // L1
- PAVGB(%%mm2, %%mm0)
- "movq %%mm0, (%0) \n\t"
- "movq (%%"REG_a", %1), %%mm0 \n\t" // L3
- PAVGB(%%mm0, %%mm2) // L1+L3
- PAVGB(%%mm1, %%mm2) // 2L2 + L1 + L3
- "movq %%mm2, (%%"REG_a") \n\t"
- "movq (%%"REG_a", %1, 2), %%mm2 \n\t" // L4
- PAVGB(%%mm2, %%mm1) // L2+L4
- PAVGB(%%mm0, %%mm1) // 2L3 + L2 + L4
- "movq %%mm1, (%%"REG_a", %1) \n\t"
- "movq (%0, %1, 4), %%mm1 \n\t" // L5
- PAVGB(%%mm1, %%mm0) // L3+L5
- PAVGB(%%mm2, %%mm0) // 2L4 + L3 + L5
- "movq %%mm0, (%%"REG_a", %1, 2) \n\t"
- "movq (%%"REG_d"), %%mm0 \n\t" // L6
- PAVGB(%%mm0, %%mm2) // L4+L6
- PAVGB(%%mm1, %%mm2) // 2L5 + L4 + L6
- "movq %%mm2, (%0, %1, 4) \n\t"
- "movq (%%"REG_d", %1), %%mm2 \n\t" // L7
- PAVGB(%%mm2, %%mm1) // L5+L7
- PAVGB(%%mm0, %%mm1) // 2L6 + L5 + L7
- "movq %%mm1, (%%"REG_d") \n\t"
- "movq (%%"REG_d", %1, 2), %%mm1 \n\t" // L8
- PAVGB(%%mm1, %%mm0) // L6+L8
- PAVGB(%%mm2, %%mm0) // 2L7 + L6 + L8
- "movq %%mm0, (%%"REG_d", %1) \n\t"
- "movq (%0, %1, 8), %%mm0 \n\t" // L9
- PAVGB(%%mm0, %%mm2) // L7+L9
- PAVGB(%%mm1, %%mm2) // 2L8 + L7 + L9
- "movq %%mm2, (%%"REG_d", %1, 2) \n\t"
- "movq %%mm1, (%2) \n\t"
-
- : : "r" (src), "r" ((long)stride), "r" (tmp)
- : "%"REG_a, "%"REG_d
- );
-#else //defined (HAVE_MMX2) || defined (HAVE_3DNOW)
- int a, b, c, x;
- src+= 4*stride;
-
- for(x=0; x<2; x++){
- a= *(uint32_t*)&tmp[stride*0];
- b= *(uint32_t*)&src[stride*0];
- c= *(uint32_t*)&src[stride*1];
- a= (a&c) + (((a^c)&0xFEFEFEFEUL)>>1);
- *(uint32_t*)&src[stride*0]= (a|b) - (((a^b)&0xFEFEFEFEUL)>>1);
-
- a= *(uint32_t*)&src[stride*2];
- b= (a&b) + (((a^b)&0xFEFEFEFEUL)>>1);
- *(uint32_t*)&src[stride*1]= (c|b) - (((c^b)&0xFEFEFEFEUL)>>1);
-
- b= *(uint32_t*)&src[stride*3];
- c= (b&c) + (((b^c)&0xFEFEFEFEUL)>>1);
- *(uint32_t*)&src[stride*2]= (c|a) - (((c^a)&0xFEFEFEFEUL)>>1);
-
- c= *(uint32_t*)&src[stride*4];
- a= (a&c) + (((a^c)&0xFEFEFEFEUL)>>1);
- *(uint32_t*)&src[stride*3]= (a|b) - (((a^b)&0xFEFEFEFEUL)>>1);
-
- a= *(uint32_t*)&src[stride*5];
- b= (a&b) + (((a^b)&0xFEFEFEFEUL)>>1);
- *(uint32_t*)&src[stride*4]= (c|b) - (((c^b)&0xFEFEFEFEUL)>>1);
-
- b= *(uint32_t*)&src[stride*6];
- c= (b&c) + (((b^c)&0xFEFEFEFEUL)>>1);
- *(uint32_t*)&src[stride*5]= (c|a) - (((c^a)&0xFEFEFEFEUL)>>1);
-
- c= *(uint32_t*)&src[stride*7];
- a= (a&c) + (((a^c)&0xFEFEFEFEUL)>>1);
- *(uint32_t*)&src[stride*6]= (a|b) - (((a^b)&0xFEFEFEFEUL)>>1);
-
- a= *(uint32_t*)&src[stride*8];
- b= (a&b) + (((a^b)&0xFEFEFEFEUL)>>1);
- *(uint32_t*)&src[stride*7]= (c|b) - (((c^b)&0xFEFEFEFEUL)>>1);
-
- *(uint32_t*)&tmp[stride*0]= c;
- src += 4;
- tmp += 4;
- }
-#endif //defined (HAVE_MMX2) || defined (HAVE_3DNOW)
-}
-
-/**
- * Deinterlaces the given block by applying a median filter to every second line.
- * will be called for every 8x8 block and can read & write from line 4-15,
- * lines 0-3 have been passed through the deblock / dering filters allready, but can be read too
- * lines 4-12 will be read into the deblocking filter and should be deinterlaced
- */
-static inline void RENAME(deInterlaceMedian)(uint8_t src[], int stride)
-{
-#ifdef HAVE_MMX
- src+= 4*stride;
-#ifdef HAVE_MMX2
- asm volatile(
- "lea (%0, %1), %%"REG_a" \n\t"
- "lea (%%"REG_a", %1, 4), %%"REG_d" \n\t"
-// 0 1 2 3 4 5 6 7 8 9
-// %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 %0+8%1 edx+4%1
-
- "movq (%0), %%mm0 \n\t" //
- "movq (%%"REG_a", %1), %%mm2 \n\t" //
- "movq (%%"REG_a"), %%mm1 \n\t" //
- "movq %%mm0, %%mm3 \n\t"
- "pmaxub %%mm1, %%mm0 \n\t" //
- "pminub %%mm3, %%mm1 \n\t" //
- "pmaxub %%mm2, %%mm1 \n\t" //
- "pminub %%mm1, %%mm0 \n\t"
- "movq %%mm0, (%%"REG_a") \n\t"
-
- "movq (%0, %1, 4), %%mm0 \n\t" //
- "movq (%%"REG_a", %1, 2), %%mm1 \n\t" //
- "movq %%mm2, %%mm3 \n\t"
- "pmaxub %%mm1, %%mm2 \n\t" //
- "pminub %%mm3, %%mm1 \n\t" //
- "pmaxub %%mm0, %%mm1 \n\t" //
- "pminub %%mm1, %%mm2 \n\t"
- "movq %%mm2, (%%"REG_a", %1, 2) \n\t"
-
- "movq (%%"REG_d"), %%mm2 \n\t" //
- "movq (%%"REG_d", %1), %%mm1 \n\t" //
- "movq %%mm2, %%mm3 \n\t"
- "pmaxub %%mm0, %%mm2 \n\t" //
- "pminub %%mm3, %%mm0 \n\t" //
- "pmaxub %%mm1, %%mm0 \n\t" //
- "pminub %%mm0, %%mm2 \n\t"
- "movq %%mm2, (%%"REG_d") \n\t"
-
- "movq (%%"REG_d", %1, 2), %%mm2 \n\t" //
- "movq (%0, %1, 8), %%mm0 \n\t" //
- "movq %%mm2, %%mm3 \n\t"
- "pmaxub %%mm0, %%mm2 \n\t" //
- "pminub %%mm3, %%mm0 \n\t" //
- "pmaxub %%mm1, %%mm0 \n\t" //
- "pminub %%mm0, %%mm2 \n\t"
- "movq %%mm2, (%%"REG_d", %1, 2) \n\t"
-
-
- : : "r" (src), "r" ((long)stride)
- : "%"REG_a, "%"REG_d
- );
-
-#else // MMX without MMX2
- asm volatile(
- "lea (%0, %1), %%"REG_a" \n\t"
- "lea (%%"REG_a", %1, 4), %%"REG_d" \n\t"
-// 0 1 2 3 4 5 6 7 8 9
-// %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 %0+8%1 edx+4%1
- "pxor %%mm7, %%mm7 \n\t"
-
-#define REAL_MEDIAN(a,b,c)\
- "movq " #a ", %%mm0 \n\t"\
- "movq " #b ", %%mm2 \n\t"\
- "movq " #c ", %%mm1 \n\t"\
- "movq %%mm0, %%mm3 \n\t"\
- "movq %%mm1, %%mm4 \n\t"\
- "movq %%mm2, %%mm5 \n\t"\
- "psubusb %%mm1, %%mm3 \n\t"\
- "psubusb %%mm2, %%mm4 \n\t"\
- "psubusb %%mm0, %%mm5 \n\t"\
- "pcmpeqb %%mm7, %%mm3 \n\t"\
- "pcmpeqb %%mm7, %%mm4 \n\t"\
- "pcmpeqb %%mm7, %%mm5 \n\t"\
- "movq %%mm3, %%mm6 \n\t"\
- "pxor %%mm4, %%mm3 \n\t"\
- "pxor %%mm5, %%mm4 \n\t"\
- "pxor %%mm6, %%mm5 \n\t"\
- "por %%mm3, %%mm1 \n\t"\
- "por %%mm4, %%mm2 \n\t"\
- "por %%mm5, %%mm0 \n\t"\
- "pand %%mm2, %%mm0 \n\t"\
- "pand %%mm1, %%mm0 \n\t"\
- "movq %%mm0, " #b " \n\t"
-#define MEDIAN(a,b,c) REAL_MEDIAN(a,b,c)
-
-MEDIAN((%0) , (%%REGa) , (%%REGa, %1))
-MEDIAN((%%REGa, %1), (%%REGa, %1, 2), (%0, %1, 4))
-MEDIAN((%0, %1, 4) , (%%REGd) , (%%REGd, %1))
-MEDIAN((%%REGd, %1), (%%REGd, %1, 2), (%0, %1, 8))
-
- : : "r" (src), "r" ((long)stride)
- : "%"REG_a, "%"REG_d
- );
-#endif //HAVE_MMX2
-#else //HAVE_MMX
- int x, y;
- src+= 4*stride;
- // FIXME - there should be a way to do a few columns in parallel like w/mmx
- for(x=0; x<8; x++)
- {
- uint8_t *colsrc = src;
- for (y=0; y<4; y++)
- {
- int a, b, c, d, e, f;
- a = colsrc[0 ];
- b = colsrc[stride ];
- c = colsrc[stride*2];
- d = (a-b)>>31;
- e = (b-c)>>31;
- f = (c-a)>>31;
- colsrc[stride ] = (a|(d^f)) & (b|(d^e)) & (c|(e^f));
- colsrc += stride*2;
- }
- src++;
- }
-#endif //HAVE_MMX
-}
-
-#ifdef HAVE_MMX
-/**
- * transposes and shift the given 8x8 Block into dst1 and dst2
- */
-static inline void RENAME(transpose1)(uint8_t *dst1, uint8_t *dst2, uint8_t *src, int srcStride)
-{
- asm(
- "lea (%0, %1), %%"REG_a" \n\t"
-// 0 1 2 3 4 5 6 7 8 9
-// %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 %0+8%1 edx+4%1
- "movq (%0), %%mm0 \n\t" // 12345678
- "movq (%%"REG_a"), %%mm1 \n\t" // abcdefgh
- "movq %%mm0, %%mm2 \n\t" // 12345678
- "punpcklbw %%mm1, %%mm0 \n\t" // 1a2b3c4d
- "punpckhbw %%mm1, %%mm2 \n\t" // 5e6f7g8h
-
- "movq (%%"REG_a", %1), %%mm1 \n\t"
- "movq (%%"REG_a", %1, 2), %%mm3 \n\t"
- "movq %%mm1, %%mm4 \n\t"
- "punpcklbw %%mm3, %%mm1 \n\t"
- "punpckhbw %%mm3, %%mm4 \n\t"
-
- "movq %%mm0, %%mm3 \n\t"
- "punpcklwd %%mm1, %%mm0 \n\t"
- "punpckhwd %%mm1, %%mm3 \n\t"
- "movq %%mm2, %%mm1 \n\t"
- "punpcklwd %%mm4, %%mm2 \n\t"
- "punpckhwd %%mm4, %%mm1 \n\t"
-
- "movd %%mm0, 128(%2) \n\t"
- "psrlq $32, %%mm0 \n\t"
- "movd %%mm0, 144(%2) \n\t"
- "movd %%mm3, 160(%2) \n\t"
- "psrlq $32, %%mm3 \n\t"
- "movd %%mm3, 176(%2) \n\t"
- "movd %%mm3, 48(%3) \n\t"
- "movd %%mm2, 192(%2) \n\t"
- "movd %%mm2, 64(%3) \n\t"
- "psrlq $32, %%mm2 \n\t"
- "movd %%mm2, 80(%3) \n\t"
- "movd %%mm1, 96(%3) \n\t"
- "psrlq $32, %%mm1 \n\t"
- "movd %%mm1, 112(%3) \n\t"
-
- "lea (%%"REG_a", %1, 4), %%"REG_a" \n\t"
-
- "movq (%0, %1, 4), %%mm0 \n\t" // 12345678
- "movq (%%"REG_a"), %%mm1 \n\t" // abcdefgh
- "movq %%mm0, %%mm2 \n\t" // 12345678
- "punpcklbw %%mm1, %%mm0 \n\t" // 1a2b3c4d
- "punpckhbw %%mm1, %%mm2 \n\t" // 5e6f7g8h
-
- "movq (%%"REG_a", %1), %%mm1 \n\t"
- "movq (%%"REG_a", %1, 2), %%mm3 \n\t"
- "movq %%mm1, %%mm4 \n\t"
- "punpcklbw %%mm3, %%mm1 \n\t"
- "punpckhbw %%mm3, %%mm4 \n\t"
-
- "movq %%mm0, %%mm3 \n\t"
- "punpcklwd %%mm1, %%mm0 \n\t"
- "punpckhwd %%mm1, %%mm3 \n\t"
- "movq %%mm2, %%mm1 \n\t"
- "punpcklwd %%mm4, %%mm2 \n\t"
- "punpckhwd %%mm4, %%mm1 \n\t"
-
- "movd %%mm0, 132(%2) \n\t"
- "psrlq $32, %%mm0 \n\t"
- "movd %%mm0, 148(%2) \n\t"
- "movd %%mm3, 164(%2) \n\t"
- "psrlq $32, %%mm3 \n\t"
- "movd %%mm3, 180(%2) \n\t"
- "movd %%mm3, 52(%3) \n\t"
- "movd %%mm2, 196(%2) \n\t"
- "movd %%mm2, 68(%3) \n\t"
- "psrlq $32, %%mm2 \n\t"
- "movd %%mm2, 84(%3) \n\t"
- "movd %%mm1, 100(%3) \n\t"
- "psrlq $32, %%mm1 \n\t"
- "movd %%mm1, 116(%3) \n\t"
-
-
- :: "r" (src), "r" ((long)srcStride), "r" (dst1), "r" (dst2)
- : "%"REG_a
- );
-}
-
-/**
- * transposes the given 8x8 block
- */
-static inline void RENAME(transpose2)(uint8_t *dst, int dstStride, uint8_t *src)
-{
- asm(
- "lea (%0, %1), %%"REG_a" \n\t"
- "lea (%%"REG_a",%1,4), %%"REG_d" \n\t"
-// 0 1 2 3 4 5 6 7 8 9
-// %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 %0+8%1 edx+4%1
- "movq (%2), %%mm0 \n\t" // 12345678
- "movq 16(%2), %%mm1 \n\t" // abcdefgh
- "movq %%mm0, %%mm2 \n\t" // 12345678
- "punpcklbw %%mm1, %%mm0 \n\t" // 1a2b3c4d
- "punpckhbw %%mm1, %%mm2 \n\t" // 5e6f7g8h
-
- "movq 32(%2), %%mm1 \n\t"
- "movq 48(%2), %%mm3 \n\t"
- "movq %%mm1, %%mm4 \n\t"
- "punpcklbw %%mm3, %%mm1 \n\t"
- "punpckhbw %%mm3, %%mm4 \n\t"
-
- "movq %%mm0, %%mm3 \n\t"
- "punpcklwd %%mm1, %%mm0 \n\t"
- "punpckhwd %%mm1, %%mm3 \n\t"
- "movq %%mm2, %%mm1 \n\t"
- "punpcklwd %%mm4, %%mm2 \n\t"
- "punpckhwd %%mm4, %%mm1 \n\t"
-
- "movd %%mm0, (%0) \n\t"
- "psrlq $32, %%mm0 \n\t"
- "movd %%mm0, (%%"REG_a") \n\t"
- "movd %%mm3, (%%"REG_a", %1) \n\t"
- "psrlq $32, %%mm3 \n\t"
- "movd %%mm3, (%%"REG_a", %1, 2) \n\t"
- "movd %%mm2, (%0, %1, 4) \n\t"
- "psrlq $32, %%mm2 \n\t"
- "movd %%mm2, (%%"REG_d") \n\t"
- "movd %%mm1, (%%"REG_d", %1) \n\t"
- "psrlq $32, %%mm1 \n\t"
- "movd %%mm1, (%%"REG_d", %1, 2) \n\t"
-
-
- "movq 64(%2), %%mm0 \n\t" // 12345678
- "movq 80(%2), %%mm1 \n\t" // abcdefgh
- "movq %%mm0, %%mm2 \n\t" // 12345678
- "punpcklbw %%mm1, %%mm0 \n\t" // 1a2b3c4d
- "punpckhbw %%mm1, %%mm2 \n\t" // 5e6f7g8h
-
- "movq 96(%2), %%mm1 \n\t"
- "movq 112(%2), %%mm3 \n\t"
- "movq %%mm1, %%mm4 \n\t"
- "punpcklbw %%mm3, %%mm1 \n\t"
- "punpckhbw %%mm3, %%mm4 \n\t"
-
- "movq %%mm0, %%mm3 \n\t"
- "punpcklwd %%mm1, %%mm0 \n\t"
- "punpckhwd %%mm1, %%mm3 \n\t"
- "movq %%mm2, %%mm1 \n\t"
- "punpcklwd %%mm4, %%mm2 \n\t"
- "punpckhwd %%mm4, %%mm1 \n\t"
-
- "movd %%mm0, 4(%0) \n\t"
- "psrlq $32, %%mm0 \n\t"
- "movd %%mm0, 4(%%"REG_a") \n\t"
- "movd %%mm3, 4(%%"REG_a", %1) \n\t"
- "psrlq $32, %%mm3 \n\t"
- "movd %%mm3, 4(%%"REG_a", %1, 2) \n\t"
- "movd %%mm2, 4(%0, %1, 4) \n\t"
- "psrlq $32, %%mm2 \n\t"
- "movd %%mm2, 4(%%"REG_d") \n\t"
- "movd %%mm1, 4(%%"REG_d", %1) \n\t"
- "psrlq $32, %%mm1 \n\t"
- "movd %%mm1, 4(%%"REG_d", %1, 2) \n\t"
-
- :: "r" (dst), "r" ((long)dstStride), "r" (src)
- : "%"REG_a, "%"REG_d
- );
-}
-#endif //HAVE_MMX
-//static long test=0;
-
-#ifndef HAVE_ALTIVEC
-static inline void RENAME(tempNoiseReducer)(uint8_t *src, int stride,
- uint8_t *tempBlured, uint32_t *tempBluredPast, int *maxNoise)
-{
- // to save a register (FIXME do this outside of the loops)
- tempBluredPast[127]= maxNoise[0];
- tempBluredPast[128]= maxNoise[1];
- tempBluredPast[129]= maxNoise[2];
-
-#define FAST_L2_DIFF
-//#define L1_DIFF //u should change the thresholds too if u try that one
-#if defined (HAVE_MMX2) || defined (HAVE_3DNOW)
- asm volatile(
- "lea (%2, %2, 2), %%"REG_a" \n\t" // 3*stride
- "lea (%2, %2, 4), %%"REG_d" \n\t" // 5*stride
- "lea (%%"REG_d", %2, 2), %%"REG_c" \n\t" // 7*stride
-// 0 1 2 3 4 5 6 7 8 9
-// %x %x+%2 %x+2%2 %x+eax %x+4%2 %x+edx %x+2eax %x+ecx %x+8%2
-//FIXME reorder?
-#ifdef L1_DIFF //needs mmx2
- "movq (%0), %%mm0 \n\t" // L0
- "psadbw (%1), %%mm0 \n\t" // |L0-R0|
- "movq (%0, %2), %%mm1 \n\t" // L1
- "psadbw (%1, %2), %%mm1 \n\t" // |L1-R1|
- "movq (%0, %2, 2), %%mm2 \n\t" // L2
- "psadbw (%1, %2, 2), %%mm2 \n\t" // |L2-R2|
- "movq (%0, %%"REG_a"), %%mm3 \n\t" // L3
- "psadbw (%1, %%"REG_a"), %%mm3 \n\t" // |L3-R3|
-
- "movq (%0, %2, 4), %%mm4 \n\t" // L4
- "paddw %%mm1, %%mm0 \n\t"
- "psadbw (%1, %2, 4), %%mm4 \n\t" // |L4-R4|
- "movq (%0, %%"REG_d"), %%mm5 \n\t" // L5
- "paddw %%mm2, %%mm0 \n\t"
- "psadbw (%1, %%"REG_d"), %%mm5 \n\t" // |L5-R5|
- "movq (%0, %%"REG_a", 2), %%mm6 \n\t" // L6
- "paddw %%mm3, %%mm0 \n\t"
- "psadbw (%1, %%"REG_a", 2), %%mm6 \n\t" // |L6-R6|
- "movq (%0, %%"REG_c"), %%mm7 \n\t" // L7
- "paddw %%mm4, %%mm0 \n\t"
- "psadbw (%1, %%"REG_c"), %%mm7 \n\t" // |L7-R7|
- "paddw %%mm5, %%mm6 \n\t"
- "paddw %%mm7, %%mm6 \n\t"
- "paddw %%mm6, %%mm0 \n\t"
-#else //L1_DIFF
-#if defined (FAST_L2_DIFF)
- "pcmpeqb %%mm7, %%mm7 \n\t"
- "movq "MANGLE(b80)", %%mm6 \n\t"
- "pxor %%mm0, %%mm0 \n\t"
-#define REAL_L2_DIFF_CORE(a, b)\
- "movq " #a ", %%mm5 \n\t"\
- "movq " #b ", %%mm2 \n\t"\
- "pxor %%mm7, %%mm2 \n\t"\
- PAVGB(%%mm2, %%mm5)\
- "paddb %%mm6, %%mm5 \n\t"\
- "movq %%mm5, %%mm2 \n\t"\
- "psllw $8, %%mm5 \n\t"\
- "pmaddwd %%mm5, %%mm5 \n\t"\
- "pmaddwd %%mm2, %%mm2 \n\t"\
- "paddd %%mm2, %%mm5 \n\t"\
- "psrld $14, %%mm5 \n\t"\
- "paddd %%mm5, %%mm0 \n\t"
-
-#else //defined (FAST_L2_DIFF)
- "pxor %%mm7, %%mm7 \n\t"
- "pxor %%mm0, %%mm0 \n\t"
-#define REAL_L2_DIFF_CORE(a, b)\
- "movq " #a ", %%mm5 \n\t"\
- "movq " #b ", %%mm2 \n\t"\
- "movq %%mm5, %%mm1 \n\t"\
- "movq %%mm2, %%mm3 \n\t"\
- "punpcklbw %%mm7, %%mm5 \n\t"\
- "punpckhbw %%mm7, %%mm1 \n\t"\
- "punpcklbw %%mm7, %%mm2 \n\t"\
- "punpckhbw %%mm7, %%mm3 \n\t"\
- "psubw %%mm2, %%mm5 \n\t"\
- "psubw %%mm3, %%mm1 \n\t"\
- "pmaddwd %%mm5, %%mm5 \n\t"\
- "pmaddwd %%mm1, %%mm1 \n\t"\
- "paddd %%mm1, %%mm5 \n\t"\
- "paddd %%mm5, %%mm0 \n\t"
-
-#endif //defined (FAST_L2_DIFF)
-
-#define L2_DIFF_CORE(a, b) REAL_L2_DIFF_CORE(a, b)
-
-L2_DIFF_CORE((%0) , (%1))
-L2_DIFF_CORE((%0, %2) , (%1, %2))
-L2_DIFF_CORE((%0, %2, 2) , (%1, %2, 2))
-L2_DIFF_CORE((%0, %%REGa) , (%1, %%REGa))
-L2_DIFF_CORE((%0, %2, 4) , (%1, %2, 4))
-L2_DIFF_CORE((%0, %%REGd) , (%1, %%REGd))
-L2_DIFF_CORE((%0, %%REGa,2), (%1, %%REGa,2))
-L2_DIFF_CORE((%0, %%REGc) , (%1, %%REGc))
-
-#endif //L1_DIFF
-
- "movq %%mm0, %%mm4 \n\t"
- "psrlq $32, %%mm0 \n\t"
- "paddd %%mm0, %%mm4 \n\t"
- "movd %%mm4, %%ecx \n\t"
- "shll $2, %%ecx \n\t"
- "mov %3, %%"REG_d" \n\t"
- "addl -4(%%"REG_d"), %%ecx \n\t"
- "addl 4(%%"REG_d"), %%ecx \n\t"
- "addl -1024(%%"REG_d"), %%ecx \n\t"
- "addl $4, %%ecx \n\t"
- "addl 1024(%%"REG_d"), %%ecx \n\t"
- "shrl $3, %%ecx \n\t"
- "movl %%ecx, (%%"REG_d") \n\t"
-
-// "mov %3, %%"REG_c" \n\t"
-// "mov %%"REG_c", test \n\t"
-// "jmp 4f \n\t"
- "cmpl 512(%%"REG_d"), %%ecx \n\t"
- " jb 2f \n\t"
- "cmpl 516(%%"REG_d"), %%ecx \n\t"
- " jb 1f \n\t"
-
- "lea (%%"REG_a", %2, 2), %%"REG_d" \n\t" // 5*stride
- "lea (%%"REG_d", %2, 2), %%"REG_c" \n\t" // 7*stride
- "movq (%0), %%mm0 \n\t" // L0
- "movq (%0, %2), %%mm1 \n\t" // L1
- "movq (%0, %2, 2), %%mm2 \n\t" // L2
- "movq (%0, %%"REG_a"), %%mm3 \n\t" // L3
- "movq (%0, %2, 4), %%mm4 \n\t" // L4
- "movq (%0, %%"REG_d"), %%mm5 \n\t" // L5
- "movq (%0, %%"REG_a", 2), %%mm6 \n\t" // L6
- "movq (%0, %%"REG_c"), %%mm7 \n\t" // L7
- "movq %%mm0, (%1) \n\t" // L0
- "movq %%mm1, (%1, %2) \n\t" // L1
- "movq %%mm2, (%1, %2, 2) \n\t" // L2
- "movq %%mm3, (%1, %%"REG_a") \n\t" // L3
- "movq %%mm4, (%1, %2, 4) \n\t" // L4
- "movq %%mm5, (%1, %%"REG_d") \n\t" // L5
- "movq %%mm6, (%1, %%"REG_a", 2) \n\t" // L6
- "movq %%mm7, (%1, %%"REG_c") \n\t" // L7
- "jmp 4f \n\t"
-
- "1: \n\t"
- "lea (%%"REG_a", %2, 2), %%"REG_d" \n\t" // 5*stride
- "lea (%%"REG_d", %2, 2), %%"REG_c" \n\t" // 7*stride
- "movq (%0), %%mm0 \n\t" // L0
- PAVGB((%1), %%mm0) // L0
- "movq (%0, %2), %%mm1 \n\t" // L1
- PAVGB((%1, %2), %%mm1) // L1
- "movq (%0, %2, 2), %%mm2 \n\t" // L2
- PAVGB((%1, %2, 2), %%mm2) // L2
- "movq (%0, %%"REG_a"), %%mm3 \n\t" // L3
- PAVGB((%1, %%REGa), %%mm3) // L3
- "movq (%0, %2, 4), %%mm4 \n\t" // L4
- PAVGB((%1, %2, 4), %%mm4) // L4
- "movq (%0, %%"REG_d"), %%mm5 \n\t" // L5
- PAVGB((%1, %%REGd), %%mm5) // L5
- "movq (%0, %%"REG_a", 2), %%mm6 \n\t" // L6
- PAVGB((%1, %%REGa, 2), %%mm6) // L6
- "movq (%0, %%"REG_c"), %%mm7 \n\t" // L7
- PAVGB((%1, %%REGc), %%mm7) // L7
- "movq %%mm0, (%1) \n\t" // R0
- "movq %%mm1, (%1, %2) \n\t" // R1
- "movq %%mm2, (%1, %2, 2) \n\t" // R2
- "movq %%mm3, (%1, %%"REG_a") \n\t" // R3
- "movq %%mm4, (%1, %2, 4) \n\t" // R4
- "movq %%mm5, (%1, %%"REG_d") \n\t" // R5
- "movq %%mm6, (%1, %%"REG_a", 2) \n\t" // R6
- "movq %%mm7, (%1, %%"REG_c") \n\t" // R7
- "movq %%mm0, (%0) \n\t" // L0
- "movq %%mm1, (%0, %2) \n\t" // L1
- "movq %%mm2, (%0, %2, 2) \n\t" // L2
- "movq %%mm3, (%0, %%"REG_a") \n\t" // L3
- "movq %%mm4, (%0, %2, 4) \n\t" // L4
- "movq %%mm5, (%0, %%"REG_d") \n\t" // L5
- "movq %%mm6, (%0, %%"REG_a", 2) \n\t" // L6
- "movq %%mm7, (%0, %%"REG_c") \n\t" // L7
- "jmp 4f \n\t"
-
- "2: \n\t"
- "cmpl 508(%%"REG_d"), %%ecx \n\t"
- " jb 3f \n\t"
-
- "lea (%%"REG_a", %2, 2), %%"REG_d" \n\t" // 5*stride
- "lea (%%"REG_d", %2, 2), %%"REG_c" \n\t" // 7*stride
- "movq (%0), %%mm0 \n\t" // L0
- "movq (%0, %2), %%mm1 \n\t" // L1
- "movq (%0, %2, 2), %%mm2 \n\t" // L2
- "movq (%0, %%"REG_a"), %%mm3 \n\t" // L3
- "movq (%1), %%mm4 \n\t" // R0
- "movq (%1, %2), %%mm5 \n\t" // R1
- "movq (%1, %2, 2), %%mm6 \n\t" // R2
- "movq (%1, %%"REG_a"), %%mm7 \n\t" // R3
- PAVGB(%%mm4, %%mm0)
- PAVGB(%%mm5, %%mm1)
- PAVGB(%%mm6, %%mm2)
- PAVGB(%%mm7, %%mm3)
- PAVGB(%%mm4, %%mm0)
- PAVGB(%%mm5, %%mm1)
- PAVGB(%%mm6, %%mm2)
- PAVGB(%%mm7, %%mm3)
- "movq %%mm0, (%1) \n\t" // R0
- "movq %%mm1, (%1, %2) \n\t" // R1
- "movq %%mm2, (%1, %2, 2) \n\t" // R2
- "movq %%mm3, (%1, %%"REG_a") \n\t" // R3
- "movq %%mm0, (%0) \n\t" // L0
- "movq %%mm1, (%0, %2) \n\t" // L1
- "movq %%mm2, (%0, %2, 2) \n\t" // L2
- "movq %%mm3, (%0, %%"REG_a") \n\t" // L3
-
- "movq (%0, %2, 4), %%mm0 \n\t" // L4
- "movq (%0, %%"REG_d"), %%mm1 \n\t" // L5
- "movq (%0, %%"REG_a", 2), %%mm2 \n\t" // L6
- "movq (%0, %%"REG_c"), %%mm3 \n\t" // L7
- "movq (%1, %2, 4), %%mm4 \n\t" // R4
- "movq (%1, %%"REG_d"), %%mm5 \n\t" // R5
- "movq (%1, %%"REG_a", 2), %%mm6 \n\t" // R6
- "movq (%1, %%"REG_c"), %%mm7 \n\t" // R7
- PAVGB(%%mm4, %%mm0)
- PAVGB(%%mm5, %%mm1)
- PAVGB(%%mm6, %%mm2)
- PAVGB(%%mm7, %%mm3)
- PAVGB(%%mm4, %%mm0)
- PAVGB(%%mm5, %%mm1)
- PAVGB(%%mm6, %%mm2)
- PAVGB(%%mm7, %%mm3)
- "movq %%mm0, (%1, %2, 4) \n\t" // R4
- "movq %%mm1, (%1, %%"REG_d") \n\t" // R5
- "movq %%mm2, (%1, %%"REG_a", 2) \n\t" // R6
- "movq %%mm3, (%1, %%"REG_c") \n\t" // R7
- "movq %%mm0, (%0, %2, 4) \n\t" // L4
- "movq %%mm1, (%0, %%"REG_d") \n\t" // L5
- "movq %%mm2, (%0, %%"REG_a", 2) \n\t" // L6
- "movq %%mm3, (%0, %%"REG_c") \n\t" // L7
- "jmp 4f \n\t"
-
- "3: \n\t"
- "lea (%%"REG_a", %2, 2), %%"REG_d" \n\t" // 5*stride
- "lea (%%"REG_d", %2, 2), %%"REG_c" \n\t" // 7*stride
- "movq (%0), %%mm0 \n\t" // L0
- "movq (%0, %2), %%mm1 \n\t" // L1
- "movq (%0, %2, 2), %%mm2 \n\t" // L2
- "movq (%0, %%"REG_a"), %%mm3 \n\t" // L3
- "movq (%1), %%mm4 \n\t" // R0
- "movq (%1, %2), %%mm5 \n\t" // R1
- "movq (%1, %2, 2), %%mm6 \n\t" // R2
- "movq (%1, %%"REG_a"), %%mm7 \n\t" // R3
- PAVGB(%%mm4, %%mm0)
- PAVGB(%%mm5, %%mm1)
- PAVGB(%%mm6, %%mm2)
- PAVGB(%%mm7, %%mm3)
- PAVGB(%%mm4, %%mm0)
- PAVGB(%%mm5, %%mm1)
- PAVGB(%%mm6, %%mm2)
- PAVGB(%%mm7, %%mm3)
- PAVGB(%%mm4, %%mm0)
- PAVGB(%%mm5, %%mm1)
- PAVGB(%%mm6, %%mm2)
- PAVGB(%%mm7, %%mm3)
- "movq %%mm0, (%1) \n\t" // R0
- "movq %%mm1, (%1, %2) \n\t" // R1
- "movq %%mm2, (%1, %2, 2) \n\t" // R2
- "movq %%mm3, (%1, %%"REG_a") \n\t" // R3
- "movq %%mm0, (%0) \n\t" // L0
- "movq %%mm1, (%0, %2) \n\t" // L1
- "movq %%mm2, (%0, %2, 2) \n\t" // L2
- "movq %%mm3, (%0, %%"REG_a") \n\t" // L3
-
- "movq (%0, %2, 4), %%mm0 \n\t" // L4
- "movq (%0, %%"REG_d"), %%mm1 \n\t" // L5
- "movq (%0, %%"REG_a", 2), %%mm2 \n\t" // L6
- "movq (%0, %%"REG_c"), %%mm3 \n\t" // L7
- "movq (%1, %2, 4), %%mm4 \n\t" // R4
- "movq (%1, %%"REG_d"), %%mm5 \n\t" // R5
- "movq (%1, %%"REG_a", 2), %%mm6 \n\t" // R6
- "movq (%1, %%"REG_c"), %%mm7 \n\t" // R7
- PAVGB(%%mm4, %%mm0)
- PAVGB(%%mm5, %%mm1)
- PAVGB(%%mm6, %%mm2)
- PAVGB(%%mm7, %%mm3)
- PAVGB(%%mm4, %%mm0)
- PAVGB(%%mm5, %%mm1)
- PAVGB(%%mm6, %%mm2)
- PAVGB(%%mm7, %%mm3)
- PAVGB(%%mm4, %%mm0)
- PAVGB(%%mm5, %%mm1)
- PAVGB(%%mm6, %%mm2)
- PAVGB(%%mm7, %%mm3)
- "movq %%mm0, (%1, %2, 4) \n\t" // R4
- "movq %%mm1, (%1, %%"REG_d") \n\t" // R5
- "movq %%mm2, (%1, %%"REG_a", 2) \n\t" // R6
- "movq %%mm3, (%1, %%"REG_c") \n\t" // R7
- "movq %%mm0, (%0, %2, 4) \n\t" // L4
- "movq %%mm1, (%0, %%"REG_d") \n\t" // L5
- "movq %%mm2, (%0, %%"REG_a", 2) \n\t" // L6
- "movq %%mm3, (%0, %%"REG_c") \n\t" // L7
-
- "4: \n\t"
-
- :: "r" (src), "r" (tempBlured), "r"((long)stride), "m" (tempBluredPast)
- : "%"REG_a, "%"REG_d, "%"REG_c, "memory"
- );
-//printf("%d\n", test);
-#else //defined (HAVE_MMX2) || defined (HAVE_3DNOW)
-{
- int y;
- int d=0;
-// int sysd=0;
- int i;
-
- for(y=0; y<8; y++)
- {
- int x;
- for(x=0; x<8; x++)
- {
- int ref= tempBlured[ x + y*stride ];
- int cur= src[ x + y*stride ];
- int d1=ref - cur;
-// if(x==0 || x==7) d1+= d1>>1;
-// if(y==0 || y==7) d1+= d1>>1;
-// d+= ABS(d1);
- d+= d1*d1;
-// sysd+= d1;
- }
- }
- i=d;
- d= (
- 4*d
- +(*(tempBluredPast-256))
- +(*(tempBluredPast-1))+ (*(tempBluredPast+1))
- +(*(tempBluredPast+256))
- +4)>>3;
- *tempBluredPast=i;
-// ((*tempBluredPast)*3 + d + 2)>>2;
-
-//printf("%d %d %d\n", maxNoise[0], maxNoise[1], maxNoise[2]);
-/*
-Switch between
- 1 0 0 0 0 0 0 (0)
-64 32 16 8 4 2 1 (1)
-64 48 36 27 20 15 11 (33) (approx)
-64 56 49 43 37 33 29 (200) (approx)
-*/
- if(d > maxNoise[1])
- {
- if(d < maxNoise[2])
- {
- for(y=0; y<8; y++)
- {
- int x;
- for(x=0; x<8; x++)
- {
- int ref= tempBlured[ x + y*stride ];
- int cur= src[ x + y*stride ];
- tempBlured[ x + y*stride ]=
- src[ x + y*stride ]=
- (ref + cur + 1)>>1;
- }
- }
- }
- else
- {
- for(y=0; y<8; y++)
- {
- int x;
- for(x=0; x<8; x++)
- {
- tempBlured[ x + y*stride ]= src[ x + y*stride ];
- }
- }
- }
- }
- else
- {
- if(d < maxNoise[0])
- {
- for(y=0; y<8; y++)
- {
- int x;
- for(x=0; x<8; x++)
- {
- int ref= tempBlured[ x + y*stride ];
- int cur= src[ x + y*stride ];
- tempBlured[ x + y*stride ]=
- src[ x + y*stride ]=
- (ref*7 + cur + 4)>>3;
- }
- }
- }
- else
- {
- for(y=0; y<8; y++)
- {
- int x;
- for(x=0; x<8; x++)
- {
- int ref= tempBlured[ x + y*stride ];
- int cur= src[ x + y*stride ];
- tempBlured[ x + y*stride ]=
- src[ x + y*stride ]=
- (ref*3 + cur + 2)>>2;
- }
- }
- }
- }
-}
-#endif //defined (HAVE_MMX2) || defined (HAVE_3DNOW)
-}
-#endif //HAVE_ALTIVEC
-
-#ifdef HAVE_MMX
-/**
- * accurate deblock filter
- */
-static always_inline void RENAME(do_a_deblock)(uint8_t *src, int step, int stride, PPContext *c){
- int64_t dc_mask, eq_mask, both_masks;
- int64_t sums[10*8*2];
- src+= step*3; // src points to begin of the 8x8 Block
-//START_TIMER
-asm volatile(
- "movq %0, %%mm7 \n\t"
- "movq %1, %%mm6 \n\t"
- : : "m" (c->mmxDcOffset[c->nonBQP]), "m" (c->mmxDcThreshold[c->nonBQP])
- );
-
-asm volatile(
- "lea (%2, %3), %%"REG_a" \n\t"
-// 0 1 2 3 4 5 6 7 8 9
-// %1 eax eax+%2 eax+2%2 %1+4%2 ecx ecx+%2 ecx+2%2 %1+8%2 ecx+4%2
-
- "movq (%2), %%mm0 \n\t"
- "movq (%%"REG_a"), %%mm1 \n\t"
- "movq %%mm1, %%mm3 \n\t"
- "movq %%mm1, %%mm4 \n\t"
- "psubb %%mm1, %%mm0 \n\t" // mm0 = differnece
- "paddb %%mm7, %%mm0 \n\t"
- "pcmpgtb %%mm6, %%mm0 \n\t"
-
- "movq (%%"REG_a",%3), %%mm2 \n\t"
- PMAXUB(%%mm2, %%mm4)
- PMINUB(%%mm2, %%mm3, %%mm5)
- "psubb %%mm2, %%mm1 \n\t"
- "paddb %%mm7, %%mm1 \n\t"
- "pcmpgtb %%mm6, %%mm1 \n\t"
- "paddb %%mm1, %%mm0 \n\t"
-
- "movq (%%"REG_a", %3, 2), %%mm1 \n\t"
- PMAXUB(%%mm1, %%mm4)
- PMINUB(%%mm1, %%mm3, %%mm5)
- "psubb %%mm1, %%mm2 \n\t"
- "paddb %%mm7, %%mm2 \n\t"
- "pcmpgtb %%mm6, %%mm2 \n\t"
- "paddb %%mm2, %%mm0 \n\t"
-
- "lea (%%"REG_a", %3, 4), %%"REG_a" \n\t"
-
- "movq (%2, %3, 4), %%mm2 \n\t"
- PMAXUB(%%mm2, %%mm4)
- PMINUB(%%mm2, %%mm3, %%mm5)
- "psubb %%mm2, %%mm1 \n\t"
- "paddb %%mm7, %%mm1 \n\t"
- "pcmpgtb %%mm6, %%mm1 \n\t"
- "paddb %%mm1, %%mm0 \n\t"
-
- "movq (%%"REG_a"), %%mm1 \n\t"
- PMAXUB(%%mm1, %%mm4)
- PMINUB(%%mm1, %%mm3, %%mm5)
- "psubb %%mm1, %%mm2 \n\t"
- "paddb %%mm7, %%mm2 \n\t"
- "pcmpgtb %%mm6, %%mm2 \n\t"
- "paddb %%mm2, %%mm0 \n\t"
-
- "movq (%%"REG_a", %3), %%mm2 \n\t"
- PMAXUB(%%mm2, %%mm4)
- PMINUB(%%mm2, %%mm3, %%mm5)
- "psubb %%mm2, %%mm1 \n\t"
- "paddb %%mm7, %%mm1 \n\t"
- "pcmpgtb %%mm6, %%mm1 \n\t"
- "paddb %%mm1, %%mm0 \n\t"
-
- "movq (%%"REG_a", %3, 2), %%mm1 \n\t"
- PMAXUB(%%mm1, %%mm4)
- PMINUB(%%mm1, %%mm3, %%mm5)
- "psubb %%mm1, %%mm2 \n\t"
- "paddb %%mm7, %%mm2 \n\t"
- "pcmpgtb %%mm6, %%mm2 \n\t"
- "paddb %%mm2, %%mm0 \n\t"
-
- "movq (%2, %3, 8), %%mm2 \n\t"
- PMAXUB(%%mm2, %%mm4)
- PMINUB(%%mm2, %%mm3, %%mm5)
- "psubb %%mm2, %%mm1 \n\t"
- "paddb %%mm7, %%mm1 \n\t"
- "pcmpgtb %%mm6, %%mm1 \n\t"
- "paddb %%mm1, %%mm0 \n\t"
-
- "movq (%%"REG_a", %3, 4), %%mm1 \n\t"
- "psubb %%mm1, %%mm2 \n\t"
- "paddb %%mm7, %%mm2 \n\t"
- "pcmpgtb %%mm6, %%mm2 \n\t"
- "paddb %%mm2, %%mm0 \n\t"
- "psubusb %%mm3, %%mm4 \n\t"
-
- "pxor %%mm6, %%mm6 \n\t"
- "movq %4, %%mm7 \n\t" // QP,..., QP
- "paddusb %%mm7, %%mm7 \n\t" // 2QP ... 2QP
- "psubusb %%mm4, %%mm7 \n\t" // Diff >=2QP -> 0
- "pcmpeqb %%mm6, %%mm7 \n\t" // Diff < 2QP -> 0
- "pcmpeqb %%mm6, %%mm7 \n\t" // Diff < 2QP -> 0
- "movq %%mm7, %1 \n\t"
-
- "movq %5, %%mm7 \n\t"
- "punpcklbw %%mm7, %%mm7 \n\t"
- "punpcklbw %%mm7, %%mm7 \n\t"
- "punpcklbw %%mm7, %%mm7 \n\t"
- "psubb %%mm0, %%mm6 \n\t"
- "pcmpgtb %%mm7, %%mm6 \n\t"
- "movq %%mm6, %0 \n\t"
-
- : "=m" (eq_mask), "=m" (dc_mask)
- : "r" (src), "r" ((long)step), "m" (c->pQPb), "m"(c->ppMode.flatnessThreshold)
- : "%"REG_a
- );
-
- both_masks = dc_mask & eq_mask;
-
- if(both_masks){
- long offset= -8*step;
- int64_t *temp_sums= sums;
-
- asm volatile(
- "movq %2, %%mm0 \n\t" // QP,..., QP
- "pxor %%mm4, %%mm4 \n\t"
-
- "movq (%0), %%mm6 \n\t"
- "movq (%0, %1), %%mm5 \n\t"
- "movq %%mm5, %%mm1 \n\t"
- "movq %%mm6, %%mm2 \n\t"
- "psubusb %%mm6, %%mm5 \n\t"
- "psubusb %%mm1, %%mm2 \n\t"
- "por %%mm5, %%mm2 \n\t" // ABS Diff of lines
- "psubusb %%mm2, %%mm0 \n\t" // diff >= QP -> 0
- "pcmpeqb %%mm4, %%mm0 \n\t" // diff >= QP -> FF
-
- "pxor %%mm6, %%mm1 \n\t"
- "pand %%mm0, %%mm1 \n\t"
- "pxor %%mm1, %%mm6 \n\t"
- // 0:QP 6:First
-
- "movq (%0, %1, 8), %%mm5 \n\t"
- "add %1, %0 \n\t" // %0 points to line 1 not 0
- "movq (%0, %1, 8), %%mm7 \n\t"
- "movq %%mm5, %%mm1 \n\t"
- "movq %%mm7, %%mm2 \n\t"
- "psubusb %%mm7, %%mm5 \n\t"
- "psubusb %%mm1, %%mm2 \n\t"
- "por %%mm5, %%mm2 \n\t" // ABS Diff of lines
- "movq %2, %%mm0 \n\t" // QP,..., QP
- "psubusb %%mm2, %%mm0 \n\t" // diff >= QP -> 0
- "pcmpeqb %%mm4, %%mm0 \n\t" // diff >= QP -> FF
-
- "pxor %%mm7, %%mm1 \n\t"
- "pand %%mm0, %%mm1 \n\t"
- "pxor %%mm1, %%mm7 \n\t"
-
- "movq %%mm6, %%mm5 \n\t"
- "punpckhbw %%mm4, %%mm6 \n\t"
- "punpcklbw %%mm4, %%mm5 \n\t"
- // 4:0 5/6:First 7:Last
-
- "movq %%mm5, %%mm0 \n\t"
- "movq %%mm6, %%mm1 \n\t"
- "psllw $2, %%mm0 \n\t"
- "psllw $2, %%mm1 \n\t"
- "paddw "MANGLE(w04)", %%mm0 \n\t"
- "paddw "MANGLE(w04)", %%mm1 \n\t"
-
-#define NEXT\
- "movq (%0), %%mm2 \n\t"\
- "movq (%0), %%mm3 \n\t"\
- "add %1, %0 \n\t"\
- "punpcklbw %%mm4, %%mm2 \n\t"\
- "punpckhbw %%mm4, %%mm3 \n\t"\
- "paddw %%mm2, %%mm0 \n\t"\
- "paddw %%mm3, %%mm1 \n\t"
-
-#define PREV\
- "movq (%0), %%mm2 \n\t"\
- "movq (%0), %%mm3 \n\t"\
- "add %1, %0 \n\t"\
- "punpcklbw %%mm4, %%mm2 \n\t"\
- "punpckhbw %%mm4, %%mm3 \n\t"\
- "psubw %%mm2, %%mm0 \n\t"\
- "psubw %%mm3, %%mm1 \n\t"
-
-
- NEXT //0
- NEXT //1
- NEXT //2
- "movq %%mm0, (%3) \n\t"
- "movq %%mm1, 8(%3) \n\t"
-
- NEXT //3
- "psubw %%mm5, %%mm0 \n\t"
- "psubw %%mm6, %%mm1 \n\t"
- "movq %%mm0, 16(%3) \n\t"
- "movq %%mm1, 24(%3) \n\t"
-
- NEXT //4
- "psubw %%mm5, %%mm0 \n\t"
- "psubw %%mm6, %%mm1 \n\t"
- "movq %%mm0, 32(%3) \n\t"
- "movq %%mm1, 40(%3) \n\t"
-
- NEXT //5
- "psubw %%mm5, %%mm0 \n\t"
- "psubw %%mm6, %%mm1 \n\t"
- "movq %%mm0, 48(%3) \n\t"
- "movq %%mm1, 56(%3) \n\t"
-
- NEXT //6
- "psubw %%mm5, %%mm0 \n\t"
- "psubw %%mm6, %%mm1 \n\t"
- "movq %%mm0, 64(%3) \n\t"
- "movq %%mm1, 72(%3) \n\t"
-
- "movq %%mm7, %%mm6 \n\t"
- "punpckhbw %%mm4, %%mm7 \n\t"
- "punpcklbw %%mm4, %%mm6 \n\t"
-
- NEXT //7
- "mov %4, %0 \n\t"
- "add %1, %0 \n\t"
- PREV //0
- "movq %%mm0, 80(%3) \n\t"
- "movq %%mm1, 88(%3) \n\t"
-
- PREV //1
- "paddw %%mm6, %%mm0 \n\t"
- "paddw %%mm7, %%mm1 \n\t"
- "movq %%mm0, 96(%3) \n\t"
- "movq %%mm1, 104(%3) \n\t"
-
- PREV //2
- "paddw %%mm6, %%mm0 \n\t"
- "paddw %%mm7, %%mm1 \n\t"
- "movq %%mm0, 112(%3) \n\t"
- "movq %%mm1, 120(%3) \n\t"
-
- PREV //3
- "paddw %%mm6, %%mm0 \n\t"
- "paddw %%mm7, %%mm1 \n\t"
- "movq %%mm0, 128(%3) \n\t"
- "movq %%mm1, 136(%3) \n\t"
-
- PREV //4
- "paddw %%mm6, %%mm0 \n\t"
- "paddw %%mm7, %%mm1 \n\t"
- "movq %%mm0, 144(%3) \n\t"
- "movq %%mm1, 152(%3) \n\t"
-
- "mov %4, %0 \n\t" //FIXME
-
- : "+&r"(src)
- : "r" ((long)step), "m" (c->pQPb), "r"(sums), "g"(src)
- );
-
- src+= step; // src points to begin of the 8x8 Block
-
- asm volatile(
- "movq %4, %%mm6 \n\t"
- "pcmpeqb %%mm5, %%mm5 \n\t"
- "pxor %%mm6, %%mm5 \n\t"
- "pxor %%mm7, %%mm7 \n\t"
-
- "1: \n\t"
- "movq (%1), %%mm0 \n\t"
- "movq 8(%1), %%mm1 \n\t"
- "paddw 32(%1), %%mm0 \n\t"
- "paddw 40(%1), %%mm1 \n\t"
- "movq (%0, %3), %%mm2 \n\t"
- "movq %%mm2, %%mm3 \n\t"
- "movq %%mm2, %%mm4 \n\t"
- "punpcklbw %%mm7, %%mm2 \n\t"
- "punpckhbw %%mm7, %%mm3 \n\t"
- "paddw %%mm2, %%mm0 \n\t"
- "paddw %%mm3, %%mm1 \n\t"
- "paddw %%mm2, %%mm0 \n\t"
- "paddw %%mm3, %%mm1 \n\t"
- "psrlw $4, %%mm0 \n\t"
- "psrlw $4, %%mm1 \n\t"
- "packuswb %%mm1, %%mm0 \n\t"
- "pand %%mm6, %%mm0 \n\t"
- "pand %%mm5, %%mm4 \n\t"
- "por %%mm4, %%mm0 \n\t"
- "movq %%mm0, (%0, %3) \n\t"
- "add $16, %1 \n\t"
- "add %2, %0 \n\t"
- " js 1b \n\t"
-
- : "+r"(offset), "+r"(temp_sums)
- : "r" ((long)step), "r"(src - offset), "m"(both_masks)
- );
- }else
- src+= step; // src points to begin of the 8x8 Block
-
- if(eq_mask != -1LL){
- uint8_t *temp_src= src;
- asm volatile(
- "pxor %%mm7, %%mm7 \n\t"
- "lea -40(%%"REG_SP"), %%"REG_c" \n\t" // make space for 4 8-byte vars
- "and "ALIGN_MASK", %%"REG_c" \n\t" // align
-// 0 1 2 3 4 5 6 7 8 9
-// %0 eax eax+%1 eax+2%1 %0+4%1 ecx ecx+%1 ecx+2%1 %1+8%1 ecx+4%1
-
- "movq (%0), %%mm0 \n\t"
- "movq %%mm0, %%mm1 \n\t"
- "punpcklbw %%mm7, %%mm0 \n\t" // low part of line 0
- "punpckhbw %%mm7, %%mm1 \n\t" // high part of line 0
-
- "movq (%0, %1), %%mm2 \n\t"
- "lea (%0, %1, 2), %%"REG_a" \n\t"
- "movq %%mm2, %%mm3 \n\t"
- "punpcklbw %%mm7, %%mm2 \n\t" // low part of line 1
- "punpckhbw %%mm7, %%mm3 \n\t" // high part of line 1
-
- "movq (%%"REG_a"), %%mm4 \n\t"
- "movq %%mm4, %%mm5 \n\t"
- "punpcklbw %%mm7, %%mm4 \n\t" // low part of line 2
- "punpckhbw %%mm7, %%mm5 \n\t" // high part of line 2
-
- "paddw %%mm0, %%mm0 \n\t" // 2L0
- "paddw %%mm1, %%mm1 \n\t" // 2H0
- "psubw %%mm4, %%mm2 \n\t" // L1 - L2
- "psubw %%mm5, %%mm3 \n\t" // H1 - H2
- "psubw %%mm2, %%mm0 \n\t" // 2L0 - L1 + L2
- "psubw %%mm3, %%mm1 \n\t" // 2H0 - H1 + H2
-
- "psllw $2, %%mm2 \n\t" // 4L1 - 4L2
- "psllw $2, %%mm3 \n\t" // 4H1 - 4H2
- "psubw %%mm2, %%mm0 \n\t" // 2L0 - 5L1 + 5L2
- "psubw %%mm3, %%mm1 \n\t" // 2H0 - 5H1 + 5H2
-
- "movq (%%"REG_a", %1), %%mm2 \n\t"
- "movq %%mm2, %%mm3 \n\t"
- "punpcklbw %%mm7, %%mm2 \n\t" // L3
- "punpckhbw %%mm7, %%mm3 \n\t" // H3
-
- "psubw %%mm2, %%mm0 \n\t" // 2L0 - 5L1 + 5L2 - L3
- "psubw %%mm3, %%mm1 \n\t" // 2H0 - 5H1 + 5H2 - H3
- "psubw %%mm2, %%mm0 \n\t" // 2L0 - 5L1 + 5L2 - 2L3
- "psubw %%mm3, %%mm1 \n\t" // 2H0 - 5H1 + 5H2 - 2H3
- "movq %%mm0, (%%"REG_c") \n\t" // 2L0 - 5L1 + 5L2 - 2L3
- "movq %%mm1, 8(%%"REG_c") \n\t" // 2H0 - 5H1 + 5H2 - 2H3
-
- "movq (%%"REG_a", %1, 2), %%mm0 \n\t"
- "movq %%mm0, %%mm1 \n\t"
- "punpcklbw %%mm7, %%mm0 \n\t" // L4
- "punpckhbw %%mm7, %%mm1 \n\t" // H4
-
- "psubw %%mm0, %%mm2 \n\t" // L3 - L4
- "psubw %%mm1, %%mm3 \n\t" // H3 - H4
- "movq %%mm2, 16(%%"REG_c") \n\t" // L3 - L4
- "movq %%mm3, 24(%%"REG_c") \n\t" // H3 - H4
- "paddw %%mm4, %%mm4 \n\t" // 2L2
- "paddw %%mm5, %%mm5 \n\t" // 2H2
- "psubw %%mm2, %%mm4 \n\t" // 2L2 - L3 + L4
- "psubw %%mm3, %%mm5 \n\t" // 2H2 - H3 + H4
-
- "lea (%%"REG_a", %1), %0 \n\t"
- "psllw $2, %%mm2 \n\t" // 4L3 - 4L4
- "psllw $2, %%mm3 \n\t" // 4H3 - 4H4
- "psubw %%mm2, %%mm4 \n\t" // 2L2 - 5L3 + 5L4
- "psubw %%mm3, %%mm5 \n\t" // 2H2 - 5H3 + 5H4
-//50 opcodes so far
- "movq (%0, %1, 2), %%mm2 \n\t"
- "movq %%mm2, %%mm3 \n\t"
- "punpcklbw %%mm7, %%mm2 \n\t" // L5
- "punpckhbw %%mm7, %%mm3 \n\t" // H5
- "psubw %%mm2, %%mm4 \n\t" // 2L2 - 5L3 + 5L4 - L5
- "psubw %%mm3, %%mm5 \n\t" // 2H2 - 5H3 + 5H4 - H5
- "psubw %%mm2, %%mm4 \n\t" // 2L2 - 5L3 + 5L4 - 2L5
- "psubw %%mm3, %%mm5 \n\t" // 2H2 - 5H3 + 5H4 - 2H5
-
- "movq (%%"REG_a", %1, 4), %%mm6 \n\t"
- "punpcklbw %%mm7, %%mm6 \n\t" // L6
- "psubw %%mm6, %%mm2 \n\t" // L5 - L6
- "movq (%%"REG_a", %1, 4), %%mm6 \n\t"
- "punpckhbw %%mm7, %%mm6 \n\t" // H6
- "psubw %%mm6, %%mm3 \n\t" // H5 - H6
-
- "paddw %%mm0, %%mm0 \n\t" // 2L4
- "paddw %%mm1, %%mm1 \n\t" // 2H4
- "psubw %%mm2, %%mm0 \n\t" // 2L4 - L5 + L6
- "psubw %%mm3, %%mm1 \n\t" // 2H4 - H5 + H6
-
- "psllw $2, %%mm2 \n\t" // 4L5 - 4L6
- "psllw $2, %%mm3 \n\t" // 4H5 - 4H6
- "psubw %%mm2, %%mm0 \n\t" // 2L4 - 5L5 + 5L6
- "psubw %%mm3, %%mm1 \n\t" // 2H4 - 5H5 + 5H6
-
- "movq (%0, %1, 4), %%mm2 \n\t"
- "movq %%mm2, %%mm3 \n\t"
- "punpcklbw %%mm7, %%mm2 \n\t" // L7
- "punpckhbw %%mm7, %%mm3 \n\t" // H7
-
- "paddw %%mm2, %%mm2 \n\t" // 2L7
- "paddw %%mm3, %%mm3 \n\t" // 2H7
- "psubw %%mm2, %%mm0 \n\t" // 2L4 - 5L5 + 5L6 - 2L7
- "psubw %%mm3, %%mm1 \n\t" // 2H4 - 5H5 + 5H6 - 2H7
-
- "movq (%%"REG_c"), %%mm2 \n\t" // 2L0 - 5L1 + 5L2 - 2L3
- "movq 8(%%"REG_c"), %%mm3 \n\t" // 2H0 - 5H1 + 5H2 - 2H3
-
-#ifdef HAVE_MMX2
- "movq %%mm7, %%mm6 \n\t" // 0
- "psubw %%mm0, %%mm6 \n\t"
- "pmaxsw %%mm6, %%mm0 \n\t" // |2L4 - 5L5 + 5L6 - 2L7|
- "movq %%mm7, %%mm6 \n\t" // 0
- "psubw %%mm1, %%mm6 \n\t"
- "pmaxsw %%mm6, %%mm1 \n\t" // |2H4 - 5H5 + 5H6 - 2H7|
- "movq %%mm7, %%mm6 \n\t" // 0
- "psubw %%mm2, %%mm6 \n\t"
- "pmaxsw %%mm6, %%mm2 \n\t" // |2L0 - 5L1 + 5L2 - 2L3|
- "movq %%mm7, %%mm6 \n\t" // 0
- "psubw %%mm3, %%mm6 \n\t"
- "pmaxsw %%mm6, %%mm3 \n\t" // |2H0 - 5H1 + 5H2 - 2H3|
-#else
- "movq %%mm7, %%mm6 \n\t" // 0
- "pcmpgtw %%mm0, %%mm6 \n\t"
- "pxor %%mm6, %%mm0 \n\t"
- "psubw %%mm6, %%mm0 \n\t" // |2L4 - 5L5 + 5L6 - 2L7|
- "movq %%mm7, %%mm6 \n\t" // 0
- "pcmpgtw %%mm1, %%mm6 \n\t"
- "pxor %%mm6, %%mm1 \n\t"
- "psubw %%mm6, %%mm1 \n\t" // |2H4 - 5H5 + 5H6 - 2H7|
- "movq %%mm7, %%mm6 \n\t" // 0
- "pcmpgtw %%mm2, %%mm6 \n\t"
- "pxor %%mm6, %%mm2 \n\t"
- "psubw %%mm6, %%mm2 \n\t" // |2L0 - 5L1 + 5L2 - 2L3|
- "movq %%mm7, %%mm6 \n\t" // 0
- "pcmpgtw %%mm3, %%mm6 \n\t"
- "pxor %%mm6, %%mm3 \n\t"
- "psubw %%mm6, %%mm3 \n\t" // |2H0 - 5H1 + 5H2 - 2H3|
-#endif
-
-#ifdef HAVE_MMX2
- "pminsw %%mm2, %%mm0 \n\t"
- "pminsw %%mm3, %%mm1 \n\t"
-#else
- "movq %%mm0, %%mm6 \n\t"
- "psubusw %%mm2, %%mm6 \n\t"
- "psubw %%mm6, %%mm0 \n\t"
- "movq %%mm1, %%mm6 \n\t"
- "psubusw %%mm3, %%mm6 \n\t"
- "psubw %%mm6, %%mm1 \n\t"
-#endif
-
- "movd %2, %%mm2 \n\t" // QP
- "punpcklbw %%mm7, %%mm2 \n\t"
-
- "movq %%mm7, %%mm6 \n\t" // 0
- "pcmpgtw %%mm4, %%mm6 \n\t" // sign(2L2 - 5L3 + 5L4 - 2L5)
- "pxor %%mm6, %%mm4 \n\t"
- "psubw %%mm6, %%mm4 \n\t" // |2L2 - 5L3 + 5L4 - 2L5|
- "pcmpgtw %%mm5, %%mm7 \n\t" // sign(2H2 - 5H3 + 5H4 - 2H5)
- "pxor %%mm7, %%mm5 \n\t"
- "psubw %%mm7, %%mm5 \n\t" // |2H2 - 5H3 + 5H4 - 2H5|
-// 100 opcodes
- "psllw $3, %%mm2 \n\t" // 8QP
- "movq %%mm2, %%mm3 \n\t" // 8QP
- "pcmpgtw %%mm4, %%mm2 \n\t"
- "pcmpgtw %%mm5, %%mm3 \n\t"
- "pand %%mm2, %%mm4 \n\t"
- "pand %%mm3, %%mm5 \n\t"
-
-
- "psubusw %%mm0, %%mm4 \n\t" // hd
- "psubusw %%mm1, %%mm5 \n\t" // ld
-
-
- "movq "MANGLE(w05)", %%mm2 \n\t" // 5
- "pmullw %%mm2, %%mm4 \n\t"
- "pmullw %%mm2, %%mm5 \n\t"
- "movq "MANGLE(w20)", %%mm2 \n\t" // 32
- "paddw %%mm2, %%mm4 \n\t"
- "paddw %%mm2, %%mm5 \n\t"
- "psrlw $6, %%mm4 \n\t"
- "psrlw $6, %%mm5 \n\t"
-
- "movq 16(%%"REG_c"), %%mm0 \n\t" // L3 - L4
- "movq 24(%%"REG_c"), %%mm1 \n\t" // H3 - H4
-
- "pxor %%mm2, %%mm2 \n\t"
- "pxor %%mm3, %%mm3 \n\t"
-
- "pcmpgtw %%mm0, %%mm2 \n\t" // sign (L3-L4)
- "pcmpgtw %%mm1, %%mm3 \n\t" // sign (H3-H4)
- "pxor %%mm2, %%mm0 \n\t"
- "pxor %%mm3, %%mm1 \n\t"
- "psubw %%mm2, %%mm0 \n\t" // |L3-L4|
- "psubw %%mm3, %%mm1 \n\t" // |H3-H4|
- "psrlw $1, %%mm0 \n\t" // |L3 - L4|/2
- "psrlw $1, %%mm1 \n\t" // |H3 - H4|/2
-
- "pxor %%mm6, %%mm2 \n\t"
- "pxor %%mm7, %%mm3 \n\t"
- "pand %%mm2, %%mm4 \n\t"
- "pand %%mm3, %%mm5 \n\t"
-
-#ifdef HAVE_MMX2
- "pminsw %%mm0, %%mm4 \n\t"
- "pminsw %%mm1, %%mm5 \n\t"
-#else
- "movq %%mm4, %%mm2 \n\t"
- "psubusw %%mm0, %%mm2 \n\t"
- "psubw %%mm2, %%mm4 \n\t"
- "movq %%mm5, %%mm2 \n\t"
- "psubusw %%mm1, %%mm2 \n\t"
- "psubw %%mm2, %%mm5 \n\t"
-#endif
- "pxor %%mm6, %%mm4 \n\t"
- "pxor %%mm7, %%mm5 \n\t"
- "psubw %%mm6, %%mm4 \n\t"
- "psubw %%mm7, %%mm5 \n\t"
- "packsswb %%mm5, %%mm4 \n\t"
- "movq %3, %%mm1 \n\t"
- "pandn %%mm4, %%mm1 \n\t"
- "movq (%0), %%mm0 \n\t"
- "paddb %%mm1, %%mm0 \n\t"
- "movq %%mm0, (%0) \n\t"
- "movq (%0, %1), %%mm0 \n\t"
- "psubb %%mm1, %%mm0 \n\t"
- "movq %%mm0, (%0, %1) \n\t"
-
- : "+r" (temp_src)
- : "r" ((long)step), "m" (c->pQPb), "m"(eq_mask)
- : "%"REG_a, "%"REG_c
- );
- }
-/*if(step==16){
- STOP_TIMER("step16")
-}else{
- STOP_TIMER("stepX")
-}*/
-}
-#endif //HAVE_MMX
-
-static void RENAME(postProcess)(uint8_t src[], int srcStride, uint8_t dst[], int dstStride, int width, int height,
- QP_STORE_T QPs[], int QPStride, int isColor, PPContext *c);
-
-/**
- * Copies a block from src to dst and fixes the blacklevel
- * levelFix == 0 -> dont touch the brighness & contrast
- */
-#undef SCALED_CPY
-
-static inline void RENAME(blockCopy)(uint8_t dst[], int dstStride, uint8_t src[], int srcStride,
- int levelFix, int64_t *packedOffsetAndScale)
-{
-#ifndef HAVE_MMX
- int i;
-#endif
- if(levelFix)
- {
-#ifdef HAVE_MMX
- asm volatile(
- "movq (%%"REG_a"), %%mm2 \n\t" // packedYOffset
- "movq 8(%%"REG_a"), %%mm3 \n\t" // packedYScale
- "lea (%2,%4), %%"REG_a" \n\t"
- "lea (%3,%5), %%"REG_d" \n\t"
- "pxor %%mm4, %%mm4 \n\t"
-#ifdef HAVE_MMX2
-#define REAL_SCALED_CPY(src1, src2, dst1, dst2) \
- "movq " #src1 ", %%mm0 \n\t"\
- "movq " #src1 ", %%mm5 \n\t"\
- "movq " #src2 ", %%mm1 \n\t"\
- "movq " #src2 ", %%mm6 \n\t"\
- "punpcklbw %%mm0, %%mm0 \n\t"\
- "punpckhbw %%mm5, %%mm5 \n\t"\
- "punpcklbw %%mm1, %%mm1 \n\t"\
- "punpckhbw %%mm6, %%mm6 \n\t"\
- "pmulhuw %%mm3, %%mm0 \n\t"\
- "pmulhuw %%mm3, %%mm5 \n\t"\
- "pmulhuw %%mm3, %%mm1 \n\t"\
- "pmulhuw %%mm3, %%mm6 \n\t"\
- "psubw %%mm2, %%mm0 \n\t"\
- "psubw %%mm2, %%mm5 \n\t"\
- "psubw %%mm2, %%mm1 \n\t"\
- "psubw %%mm2, %%mm6 \n\t"\
- "packuswb %%mm5, %%mm0 \n\t"\
- "packuswb %%mm6, %%mm1 \n\t"\
- "movq %%mm0, " #dst1 " \n\t"\
- "movq %%mm1, " #dst2 " \n\t"\
-
-#else //HAVE_MMX2
-#define REAL_SCALED_CPY(src1, src2, dst1, dst2) \
- "movq " #src1 ", %%mm0 \n\t"\
- "movq " #src1 ", %%mm5 \n\t"\
- "punpcklbw %%mm4, %%mm0 \n\t"\
- "punpckhbw %%mm4, %%mm5 \n\t"\
- "psubw %%mm2, %%mm0 \n\t"\
- "psubw %%mm2, %%mm5 \n\t"\
- "movq " #src2 ", %%mm1 \n\t"\
- "psllw $6, %%mm0 \n\t"\
- "psllw $6, %%mm5 \n\t"\
- "pmulhw %%mm3, %%mm0 \n\t"\
- "movq " #src2 ", %%mm6 \n\t"\
- "pmulhw %%mm3, %%mm5 \n\t"\
- "punpcklbw %%mm4, %%mm1 \n\t"\
- "punpckhbw %%mm4, %%mm6 \n\t"\
- "psubw %%mm2, %%mm1 \n\t"\
- "psubw %%mm2, %%mm6 \n\t"\
- "psllw $6, %%mm1 \n\t"\
- "psllw $6, %%mm6 \n\t"\
- "pmulhw %%mm3, %%mm1 \n\t"\
- "pmulhw %%mm3, %%mm6 \n\t"\
- "packuswb %%mm5, %%mm0 \n\t"\
- "packuswb %%mm6, %%mm1 \n\t"\
- "movq %%mm0, " #dst1 " \n\t"\
- "movq %%mm1, " #dst2 " \n\t"\
-
-#endif //HAVE_MMX2
-#define SCALED_CPY(src1, src2, dst1, dst2)\
- REAL_SCALED_CPY(src1, src2, dst1, dst2)
-
-SCALED_CPY((%2) , (%2, %4) , (%3) , (%3, %5))
-SCALED_CPY((%2, %4, 2), (%%REGa, %4, 2), (%3, %5, 2), (%%REGd, %5, 2))
-SCALED_CPY((%2, %4, 4), (%%REGa, %4, 4), (%3, %5, 4), (%%REGd, %5, 4))
- "lea (%%"REG_a",%4,4), %%"REG_a" \n\t"
- "lea (%%"REG_d",%5,4), %%"REG_d" \n\t"
-SCALED_CPY((%%REGa, %4), (%%REGa, %4, 2), (%%REGd, %5), (%%REGd, %5, 2))
-
-
- : "=&a" (packedOffsetAndScale)
- : "0" (packedOffsetAndScale),
- "r"(src),
- "r"(dst),
- "r" ((long)srcStride),
- "r" ((long)dstStride)
- : "%"REG_d
- );
-#else //HAVE_MMX
- for(i=0; i<8; i++)
- memcpy( &(dst[dstStride*i]),
- &(src[srcStride*i]), BLOCK_SIZE);
-#endif //HAVE_MMX
- }
- else
- {
-#ifdef HAVE_MMX
- asm volatile(
- "lea (%0,%2), %%"REG_a" \n\t"
- "lea (%1,%3), %%"REG_d" \n\t"
-
-#define REAL_SIMPLE_CPY(src1, src2, dst1, dst2) \
- "movq " #src1 ", %%mm0 \n\t"\
- "movq " #src2 ", %%mm1 \n\t"\
- "movq %%mm0, " #dst1 " \n\t"\
- "movq %%mm1, " #dst2 " \n\t"\
-
-#define SIMPLE_CPY(src1, src2, dst1, dst2)\
- REAL_SIMPLE_CPY(src1, src2, dst1, dst2)
-
-SIMPLE_CPY((%0) , (%0, %2) , (%1) , (%1, %3))
-SIMPLE_CPY((%0, %2, 2), (%%REGa, %2, 2), (%1, %3, 2), (%%REGd, %3, 2))
-SIMPLE_CPY((%0, %2, 4), (%%REGa, %2, 4), (%1, %3, 4), (%%REGd, %3, 4))
- "lea (%%"REG_a",%2,4), %%"REG_a" \n\t"
- "lea (%%"REG_d",%3,4), %%"REG_d" \n\t"
-SIMPLE_CPY((%%REGa, %2), (%%REGa, %2, 2), (%%REGd, %3), (%%REGd, %3, 2))
-
- : : "r" (src),
- "r" (dst),
- "r" ((long)srcStride),
- "r" ((long)dstStride)
- : "%"REG_a, "%"REG_d
- );
-#else //HAVE_MMX
- for(i=0; i<8; i++)
- memcpy( &(dst[dstStride*i]),
- &(src[srcStride*i]), BLOCK_SIZE);
-#endif //HAVE_MMX
- }
-}
-
-/**
- * Duplicates the given 8 src pixels ? times upward
- */
-static inline void RENAME(duplicate)(uint8_t src[], int stride)
-{
-#ifdef HAVE_MMX
- asm volatile(
- "movq (%0), %%mm0 \n\t"
- "add %1, %0 \n\t"
- "movq %%mm0, (%0) \n\t"
- "movq %%mm0, (%0, %1) \n\t"
- "movq %%mm0, (%0, %1, 2) \n\t"
- : "+r" (src)
- : "r" ((long)-stride)
- );
-#else
- int i;
- uint8_t *p=src;
- for(i=0; i<3; i++)
- {
- p-= stride;
- memcpy(p, src, 8);
- }
-#endif
-}
-
-/**
- * Filters array of bytes (Y or U or V values)
- */
-static void RENAME(postProcess)(uint8_t src[], int srcStride, uint8_t dst[], int dstStride, int width, int height,
- QP_STORE_T QPs[], int QPStride, int isColor, PPContext *c2)
-{
- PPContext __attribute__((aligned(8))) c= *c2; //copy to stack for faster access
- int x,y;
-#ifdef COMPILE_TIME_MODE
- const int mode= COMPILE_TIME_MODE;
-#else
- const int mode= isColor ? c.ppMode.chromMode : c.ppMode.lumMode;
-#endif
- int black=0, white=255; // blackest black and whitest white in the picture
- int QPCorrecture= 256*256;
-
- int copyAhead;
-#ifdef HAVE_MMX
- int i;
-#endif
-
- const int qpHShift= isColor ? 4-c.hChromaSubSample : 4;
- const int qpVShift= isColor ? 4-c.vChromaSubSample : 4;
-
- //FIXME remove
- uint64_t * const yHistogram= c.yHistogram;
- uint8_t * const tempSrc= srcStride > 0 ? c.tempSrc : c.tempSrc - 23*srcStride;
- uint8_t * const tempDst= dstStride > 0 ? c.tempDst : c.tempDst - 23*dstStride;
- //const int mbWidth= isColor ? (width+7)>>3 : (width+15)>>4;
-
-#ifdef HAVE_MMX
- for(i=0; i<57; i++){
- int offset= ((i*c.ppMode.baseDcDiff)>>8) + 1;
- int threshold= offset*2 + 1;
- c.mmxDcOffset[i]= 0x7F - offset;
- c.mmxDcThreshold[i]= 0x7F - threshold;
- c.mmxDcOffset[i]*= 0x0101010101010101LL;
- c.mmxDcThreshold[i]*= 0x0101010101010101LL;
- }
-#endif
-
- if(mode & CUBIC_IPOL_DEINT_FILTER) copyAhead=16;
- else if( (mode & LINEAR_BLEND_DEINT_FILTER)
- || (mode & FFMPEG_DEINT_FILTER)
- || (mode & LOWPASS5_DEINT_FILTER)) copyAhead=14;
- else if( (mode & V_DEBLOCK)
- || (mode & LINEAR_IPOL_DEINT_FILTER)
- || (mode & MEDIAN_DEINT_FILTER)
- || (mode & V_A_DEBLOCK)) copyAhead=13;
- else if(mode & V_X1_FILTER) copyAhead=11;
-// else if(mode & V_RK1_FILTER) copyAhead=10;
- else if(mode & DERING) copyAhead=9;
- else copyAhead=8;
-
- copyAhead-= 8;
-
- if(!isColor)
- {
- uint64_t sum= 0;
- int i;
- uint64_t maxClipped;
- uint64_t clipped;
- double scale;
-
- c.frameNum++;
- // first frame is fscked so we ignore it
- if(c.frameNum == 1) yHistogram[0]= width*height/64*15/256;
-
- for(i=0; i<256; i++)
- {
- sum+= yHistogram[i];
-// printf("%d ", yHistogram[i]);
- }
-// printf("\n\n");
-
- /* we allways get a completly black picture first */
- maxClipped= (uint64_t)(sum * c.ppMode.maxClippedThreshold);
-
- clipped= sum;
- for(black=255; black>0; black--)
- {
- if(clipped < maxClipped) break;
- clipped-= yHistogram[black];
- }
-
- clipped= sum;
- for(white=0; white<256; white++)
- {
- if(clipped < maxClipped) break;
- clipped-= yHistogram[white];
- }
-
- scale= (double)(c.ppMode.maxAllowedY - c.ppMode.minAllowedY) / (double)(white-black);
-
-#ifdef HAVE_MMX2
- c.packedYScale= (uint16_t)(scale*256.0 + 0.5);
- c.packedYOffset= (((black*c.packedYScale)>>8) - c.ppMode.minAllowedY) & 0xFFFF;
-#else
- c.packedYScale= (uint16_t)(scale*1024.0 + 0.5);
- c.packedYOffset= (black - c.ppMode.minAllowedY) & 0xFFFF;
-#endif
-
- c.packedYOffset|= c.packedYOffset<<32;
- c.packedYOffset|= c.packedYOffset<<16;
-
- c.packedYScale|= c.packedYScale<<32;
- c.packedYScale|= c.packedYScale<<16;
-
- if(mode & LEVEL_FIX) QPCorrecture= (int)(scale*256*256 + 0.5);
- else QPCorrecture= 256*256;
- }
- else
- {
- c.packedYScale= 0x0100010001000100LL;
- c.packedYOffset= 0;
- QPCorrecture= 256*256;
- }
-
- /* copy & deinterlace first row of blocks */
- y=-BLOCK_SIZE;
- {
- uint8_t *srcBlock= &(src[y*srcStride]);
- uint8_t *dstBlock= tempDst + dstStride;
-
- // From this point on it is guranteed that we can read and write 16 lines downward
- // finish 1 block before the next otherwise we might have a problem
- // with the L1 Cache of the P4 ... or only a few blocks at a time or soemthing
- for(x=0; x<width; x+=BLOCK_SIZE)
- {
-
-#ifdef HAVE_MMX2
-/*
- prefetchnta(srcBlock + (((x>>2)&6) + 5)*srcStride + 32);
- prefetchnta(srcBlock + (((x>>2)&6) + 6)*srcStride + 32);
- prefetcht0(dstBlock + (((x>>2)&6) + 5)*dstStride + 32);
- prefetcht0(dstBlock + (((x>>2)&6) + 6)*dstStride + 32);
-*/
-
- asm(
- "mov %4, %%"REG_a" \n\t"
- "shr $2, %%"REG_a" \n\t"
- "and $6, %%"REG_a" \n\t"
- "add %5, %%"REG_a" \n\t"
- "mov %%"REG_a", %%"REG_d" \n\t"
- "imul %1, %%"REG_a" \n\t"
- "imul %3, %%"REG_d" \n\t"
- "prefetchnta 32(%%"REG_a", %0) \n\t"
- "prefetcht0 32(%%"REG_d", %2) \n\t"
- "add %1, %%"REG_a" \n\t"
- "add %3, %%"REG_d" \n\t"
- "prefetchnta 32(%%"REG_a", %0) \n\t"
- "prefetcht0 32(%%"REG_d", %2) \n\t"
- :: "r" (srcBlock), "r" ((long)srcStride), "r" (dstBlock), "r" ((long)dstStride),
- "g" ((long)x), "g" ((long)copyAhead)
- : "%"REG_a, "%"REG_d
- );
-
-#elif defined(HAVE_3DNOW)
-//FIXME check if this is faster on an 3dnow chip or if its faster without the prefetch or ...
-/* prefetch(srcBlock + (((x>>3)&3) + 5)*srcStride + 32);
- prefetch(srcBlock + (((x>>3)&3) + 9)*srcStride + 32);
- prefetchw(dstBlock + (((x>>3)&3) + 5)*dstStride + 32);
- prefetchw(dstBlock + (((x>>3)&3) + 9)*dstStride + 32);
-*/
-#endif
-
- RENAME(blockCopy)(dstBlock + dstStride*8, dstStride,
- srcBlock + srcStride*8, srcStride, mode & LEVEL_FIX, &c.packedYOffset);
-
- RENAME(duplicate)(dstBlock + dstStride*8, dstStride);
-
- if(mode & LINEAR_IPOL_DEINT_FILTER)
- RENAME(deInterlaceInterpolateLinear)(dstBlock, dstStride);
- else if(mode & LINEAR_BLEND_DEINT_FILTER)
- RENAME(deInterlaceBlendLinear)(dstBlock, dstStride, c.deintTemp + x);
- else if(mode & MEDIAN_DEINT_FILTER)
- RENAME(deInterlaceMedian)(dstBlock, dstStride);
- else if(mode & CUBIC_IPOL_DEINT_FILTER)
- RENAME(deInterlaceInterpolateCubic)(dstBlock, dstStride);
- else if(mode & FFMPEG_DEINT_FILTER)
- RENAME(deInterlaceFF)(dstBlock, dstStride, c.deintTemp + x);
- else if(mode & LOWPASS5_DEINT_FILTER)
- RENAME(deInterlaceL5)(dstBlock, dstStride, c.deintTemp + x, c.deintTemp + width + x);
-/* else if(mode & CUBIC_BLEND_DEINT_FILTER)
- RENAME(deInterlaceBlendCubic)(dstBlock, dstStride);
-*/
- dstBlock+=8;
- srcBlock+=8;
- }
- if(width==ABS(dstStride))
- linecpy(dst, tempDst + 9*dstStride, copyAhead, dstStride);
- else
- {
- int i;
- for(i=0; i<copyAhead; i++)
- {
- memcpy(dst + i*dstStride, tempDst + (9+i)*dstStride, width);
- }
- }
- }
-
-//printf("\n");
- for(y=0; y<height; y+=BLOCK_SIZE)
- {
- //1% speedup if these are here instead of the inner loop
- uint8_t *srcBlock= &(src[y*srcStride]);
- uint8_t *dstBlock= &(dst[y*dstStride]);
-#ifdef HAVE_MMX
- uint8_t *tempBlock1= c.tempBlocks;
- uint8_t *tempBlock2= c.tempBlocks + 8;
-#endif
- int8_t *QPptr= &QPs[(y>>qpVShift)*QPStride];
- int8_t *nonBQPptr= &c.nonBQPTable[(y>>qpVShift)*ABS(QPStride)];
- int QP=0;
- /* can we mess with a 8x16 block from srcBlock/dstBlock downwards and 1 line upwards
- if not than use a temporary buffer */
- if(y+15 >= height)
- {
- int i;
- /* copy from line (copyAhead) to (copyAhead+7) of src, these will be copied with
- blockcopy to dst later */
- linecpy(tempSrc + srcStride*copyAhead, srcBlock + srcStride*copyAhead,
- MAX(height-y-copyAhead, 0), srcStride);
-
- /* duplicate last line of src to fill the void upto line (copyAhead+7) */
- for(i=MAX(height-y, 8); i<copyAhead+8; i++)
- memcpy(tempSrc + srcStride*i, src + srcStride*(height-1), ABS(srcStride));
-
- /* copy up to (copyAhead+1) lines of dst (line -1 to (copyAhead-1))*/
- linecpy(tempDst, dstBlock - dstStride, MIN(height-y+1, copyAhead+1), dstStride);
-
- /* duplicate last line of dst to fill the void upto line (copyAhead) */
- for(i=height-y+1; i<=copyAhead; i++)
- memcpy(tempDst + dstStride*i, dst + dstStride*(height-1), ABS(dstStride));
-
- dstBlock= tempDst + dstStride;
- srcBlock= tempSrc;
- }
-//printf("\n");
-
- // From this point on it is guranteed that we can read and write 16 lines downward
- // finish 1 block before the next otherwise we might have a problem
- // with the L1 Cache of the P4 ... or only a few blocks at a time or soemthing
- for(x=0; x<width; x+=BLOCK_SIZE)
- {
- const int stride= dstStride;
-#ifdef HAVE_MMX
- uint8_t *tmpXchg;
-#endif
- if(isColor)
- {
- QP= QPptr[x>>qpHShift];
- c.nonBQP= nonBQPptr[x>>qpHShift];
- }
- else
- {
- QP= QPptr[x>>4];
- QP= (QP* QPCorrecture + 256*128)>>16;
- c.nonBQP= nonBQPptr[x>>4];
- c.nonBQP= (c.nonBQP* QPCorrecture + 256*128)>>16;
- yHistogram[ srcBlock[srcStride*12 + 4] ]++;
- }
- c.QP= QP;
-#ifdef HAVE_MMX
- asm volatile(
- "movd %1, %%mm7 \n\t"
- "packuswb %%mm7, %%mm7 \n\t" // 0, 0, 0, QP, 0, 0, 0, QP
- "packuswb %%mm7, %%mm7 \n\t" // 0,QP, 0, QP, 0,QP, 0, QP
- "packuswb %%mm7, %%mm7 \n\t" // QP,..., QP
- "movq %%mm7, %0 \n\t"
- : "=m" (c.pQPb)
- : "r" (QP)
- );
-#endif
-
-
-#ifdef HAVE_MMX2
-/*
- prefetchnta(srcBlock + (((x>>2)&6) + 5)*srcStride + 32);
- prefetchnta(srcBlock + (((x>>2)&6) + 6)*srcStride + 32);
- prefetcht0(dstBlock + (((x>>2)&6) + 5)*dstStride + 32);
- prefetcht0(dstBlock + (((x>>2)&6) + 6)*dstStride + 32);
-*/
-
- asm(
- "mov %4, %%"REG_a" \n\t"
- "shr $2, %%"REG_a" \n\t"
- "and $6, %%"REG_a" \n\t"
- "add %5, %%"REG_a" \n\t"
- "mov %%"REG_a", %%"REG_d" \n\t"
- "imul %1, %%"REG_a" \n\t"
- "imul %3, %%"REG_d" \n\t"
- "prefetchnta 32(%%"REG_a", %0) \n\t"
- "prefetcht0 32(%%"REG_d", %2) \n\t"
- "add %1, %%"REG_a" \n\t"
- "add %3, %%"REG_d" \n\t"
- "prefetchnta 32(%%"REG_a", %0) \n\t"
- "prefetcht0 32(%%"REG_d", %2) \n\t"
- :: "r" (srcBlock), "r" ((long)srcStride), "r" (dstBlock), "r" ((long)dstStride),
- "g" ((long)x), "g" ((long)copyAhead)
- : "%"REG_a, "%"REG_d
- );
-
-#elif defined(HAVE_3DNOW)
-//FIXME check if this is faster on an 3dnow chip or if its faster without the prefetch or ...
-/* prefetch(srcBlock + (((x>>3)&3) + 5)*srcStride + 32);
- prefetch(srcBlock + (((x>>3)&3) + 9)*srcStride + 32);
- prefetchw(dstBlock + (((x>>3)&3) + 5)*dstStride + 32);
- prefetchw(dstBlock + (((x>>3)&3) + 9)*dstStride + 32);
-*/
-#endif
-
- RENAME(blockCopy)(dstBlock + dstStride*copyAhead, dstStride,
- srcBlock + srcStride*copyAhead, srcStride, mode & LEVEL_FIX, &c.packedYOffset);
-
- if(mode & LINEAR_IPOL_DEINT_FILTER)
- RENAME(deInterlaceInterpolateLinear)(dstBlock, dstStride);
- else if(mode & LINEAR_BLEND_DEINT_FILTER)
- RENAME(deInterlaceBlendLinear)(dstBlock, dstStride, c.deintTemp + x);
- else if(mode & MEDIAN_DEINT_FILTER)
- RENAME(deInterlaceMedian)(dstBlock, dstStride);
- else if(mode & CUBIC_IPOL_DEINT_FILTER)
- RENAME(deInterlaceInterpolateCubic)(dstBlock, dstStride);
- else if(mode & FFMPEG_DEINT_FILTER)
- RENAME(deInterlaceFF)(dstBlock, dstStride, c.deintTemp + x);
- else if(mode & LOWPASS5_DEINT_FILTER)
- RENAME(deInterlaceL5)(dstBlock, dstStride, c.deintTemp + x, c.deintTemp + width + x);
-/* else if(mode & CUBIC_BLEND_DEINT_FILTER)
- RENAME(deInterlaceBlendCubic)(dstBlock, dstStride);
-*/
-
- /* only deblock if we have 2 blocks */
- if(y + 8 < height)
- {
- if(mode & V_X1_FILTER)
- RENAME(vertX1Filter)(dstBlock, stride, &c);
- else if(mode & V_DEBLOCK)
- {
- const int t= RENAME(vertClassify)(dstBlock, stride, &c);
-
- if(t==1)
- RENAME(doVertLowPass)(dstBlock, stride, &c);
- else if(t==2)
- RENAME(doVertDefFilter)(dstBlock, stride, &c);
- }else if(mode & V_A_DEBLOCK){
- RENAME(do_a_deblock)(dstBlock, stride, 1, &c);
- }
- }
-
-#ifdef HAVE_MMX
- RENAME(transpose1)(tempBlock1, tempBlock2, dstBlock, dstStride);
-#endif
- /* check if we have a previous block to deblock it with dstBlock */
- if(x - 8 >= 0)
- {
-#ifdef HAVE_MMX
- if(mode & H_X1_FILTER)
- RENAME(vertX1Filter)(tempBlock1, 16, &c);
- else if(mode & H_DEBLOCK)
- {
-//START_TIMER
- const int t= RENAME(vertClassify)(tempBlock1, 16, &c);
-//STOP_TIMER("dc & minmax")
- if(t==1)
- RENAME(doVertLowPass)(tempBlock1, 16, &c);
- else if(t==2)
- RENAME(doVertDefFilter)(tempBlock1, 16, &c);
- }else if(mode & H_A_DEBLOCK){
- RENAME(do_a_deblock)(tempBlock1, 16, 1, &c);
- }
-
- RENAME(transpose2)(dstBlock-4, dstStride, tempBlock1 + 4*16);
-
-#else
- if(mode & H_X1_FILTER)
- horizX1Filter(dstBlock-4, stride, QP);
- else if(mode & H_DEBLOCK)
- {
-#ifdef HAVE_ALTIVEC
- unsigned char __attribute__ ((aligned(16))) tempBlock[272];
- transpose_16x8_char_toPackedAlign_altivec(tempBlock, dstBlock - (4 + 1), stride);
-
- const int t=vertClassify_altivec(tempBlock-48, 16, &c);
- if(t==1) {
- doVertLowPass_altivec(tempBlock-48, 16, &c);
- transpose_8x16_char_fromPackedAlign_altivec(dstBlock - (4 + 1), tempBlock, stride);
- }
- else if(t==2) {
- doVertDefFilter_altivec(tempBlock-48, 16, &c);
- transpose_8x16_char_fromPackedAlign_altivec(dstBlock - (4 + 1), tempBlock, stride);
- }
-#else
- const int t= RENAME(horizClassify)(dstBlock-4, stride, &c);
-
- if(t==1)
- RENAME(doHorizLowPass)(dstBlock-4, stride, &c);
- else if(t==2)
- RENAME(doHorizDefFilter)(dstBlock-4, stride, &c);
-#endif
- }else if(mode & H_A_DEBLOCK){
- RENAME(do_a_deblock)(dstBlock-8, 1, stride, &c);
- }
-#endif //HAVE_MMX
- if(mode & DERING)
- {
- //FIXME filter first line
- if(y>0) RENAME(dering)(dstBlock - stride - 8, stride, &c);
- }
-
- if(mode & TEMP_NOISE_FILTER)
- {
- RENAME(tempNoiseReducer)(dstBlock-8, stride,
- c.tempBlured[isColor] + y*dstStride + x,
- c.tempBluredPast[isColor] + (y>>3)*256 + (x>>3),
- c.ppMode.maxTmpNoise);
- }
- }
-
- dstBlock+=8;
- srcBlock+=8;
-
-#ifdef HAVE_MMX
- tmpXchg= tempBlock1;
- tempBlock1= tempBlock2;
- tempBlock2 = tmpXchg;
-#endif
- }
-
- if(mode & DERING)
- {
- if(y > 0) RENAME(dering)(dstBlock - dstStride - 8, dstStride, &c);
- }
-
- if((mode & TEMP_NOISE_FILTER))
- {
- RENAME(tempNoiseReducer)(dstBlock-8, dstStride,
- c.tempBlured[isColor] + y*dstStride + x,
- c.tempBluredPast[isColor] + (y>>3)*256 + (x>>3),
- c.ppMode.maxTmpNoise);
- }
-
- /* did we use a tmp buffer for the last lines*/
- if(y+15 >= height)
- {
- uint8_t *dstBlock= &(dst[y*dstStride]);
- if(width==ABS(dstStride))
- linecpy(dstBlock, tempDst + dstStride, height-y, dstStride);
- else
- {
- int i;
- for(i=0; i<height-y; i++)
- {
- memcpy(dstBlock + i*dstStride, tempDst + (i+1)*dstStride, width);
- }
- }
- }
-/*
- for(x=0; x<width; x+=32)
- {
- volatile int i;
- i+= + dstBlock[x + 7*dstStride] + dstBlock[x + 8*dstStride]
- + dstBlock[x + 9*dstStride] + dstBlock[x +10*dstStride]
- + dstBlock[x +11*dstStride] + dstBlock[x +12*dstStride];
-// + dstBlock[x +13*dstStride]
-// + dstBlock[x +14*dstStride] + dstBlock[x +15*dstStride];
- }*/
- }
-#ifdef HAVE_3DNOW
- asm volatile("femms");
-#elif defined (HAVE_MMX)
- asm volatile("emms");
-#endif
-
-#ifdef DEBUG_BRIGHTNESS
- if(!isColor)
- {
- int max=1;
- int i;
- for(i=0; i<256; i++)
- if(yHistogram[i] > max) max=yHistogram[i];
-
- for(i=1; i<256; i++)
- {
- int x;
- int start=yHistogram[i-1]/(max/256+1);
- int end=yHistogram[i]/(max/256+1);
- int inc= end > start ? 1 : -1;
- for(x=start; x!=end+inc; x+=inc)
- dst[ i*dstStride + x]+=128;
- }
-
- for(i=0; i<100; i+=2)
- {
- dst[ (white)*dstStride + i]+=128;
- dst[ (black)*dstStride + i]+=128;
- }
-
- }
-#endif
-
- *c2= c; //copy local context back
-
-}
diff --git a/src/libffmpeg/libavcodec/loco.c b/src/libffmpeg/libavcodec/loco.c
deleted file mode 100644
index b1f99f425..000000000
--- a/src/libffmpeg/libavcodec/loco.c
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
- * LOCO codec
- * Copyright (c) 2005 Konstantin Shishkov
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file loco.c
- * LOCO codec.
- */
-
-#include "avcodec.h"
-#include "common.h"
-#include "bitstream.h"
-#include "golomb.h"
-
-enum LOCO_MODE {LOCO_UNKN=0, LOCO_CYUY2=-1, LOCO_CRGB=-2, LOCO_CRGBA=-3, LOCO_CYV12=-4,
- LOCO_YUY2=1, LOCO_UYVY=2, LOCO_RGB=3, LOCO_RGBA=4, LOCO_YV12=5};
-
-typedef struct LOCOContext{
- AVCodecContext *avctx;
- AVFrame pic;
- int lossy;
- int mode;
-} LOCOContext;
-
-typedef struct RICEContext{
- GetBitContext gb;
- int save, run, run2; /* internal rice decoder state */
- int sum, count; /* sum and count for getting rice parameter */
- int lossy;
-}RICEContext;
-
-static int loco_get_rice_param(RICEContext *r)
-{
- int cnt = 0;
- int val = r->count;
-
- while(r->sum > val && cnt < 9) {
- val <<= 1;
- cnt++;
- }
-
- return cnt;
-}
-
-static inline void loco_update_rice_param(RICEContext *r, int val)
-{
- r->sum += val;
- r->count++;
-
- if(r->count == 16) {
- r->sum >>= 1;
- r->count >>= 1;
- }
-}
-
-static inline int loco_get_rice(RICEContext *r)
-{
- int v;
- if (r->run > 0) { /* we have zero run */
- r->run--;
- loco_update_rice_param(r, 0);
- return 0;
- }
- v = get_ur_golomb_jpegls(&r->gb, loco_get_rice_param(r), INT_MAX, 0);
- loco_update_rice_param(r, (v+1)>>1);
- if (!v) {
- if (r->save >= 0) {
- r->run = get_ur_golomb_jpegls(&r->gb, 2, INT_MAX, 0);
- if(r->run > 1)
- r->save += r->run + 1;
- else
- r->save -= 3;
- }
- else
- r->run2++;
- } else {
- v = ((v>>1) + r->lossy) ^ -(v&1);
- if (r->run2 > 0) {
- if (r->run2 > 2)
- r->save += r->run2;
- else
- r->save -= 3;
- r->run2 = 0;
- }
- }
-
- return v;
-}
-
-/* LOCO main predictor - LOCO-I/JPEG-LS predictor */
-static inline int loco_predict(uint8_t* data, int stride, int step)
-{
- int a, b, c;
-
- a = data[-stride];
- b = data[-step];
- c = data[-stride - step];
-
- return mid_pred(a, a + b - c, b);
-}
-
-static int loco_decode_plane(LOCOContext *l, uint8_t *data, int width, int height,
- int stride, uint8_t *buf, int buf_size, int step)
-{
- RICEContext rc;
- int val;
- int i, j;
-
- init_get_bits(&rc.gb, buf, buf_size*8);
- rc.save = 0;
- rc.run = 0;
- rc.run2 = 0;
- rc.lossy = l->lossy;
-
- rc.sum = 8;
- rc.count = 1;
-
- /* restore top left pixel */
- val = loco_get_rice(&rc);
- data[0] = 128 + val;
- /* restore top line */
- for (i = 1; i < width; i++) {
- val = loco_get_rice(&rc);
- data[i * step] = data[i * step - step] + val;
- }
- data += stride;
- for (j = 1; j < height; j++) {
- /* restore left column */
- val = loco_get_rice(&rc);
- data[0] = data[-stride] + val;
- /* restore all other pixels */
- for (i = 1; i < width; i++) {
- val = loco_get_rice(&rc);
- data[i * step] = loco_predict(&data[i * step], stride, step) + val;
- }
- data += stride;
- }
-
- return ((get_bits_count(&rc.gb) + 7) >> 3);
-}
-
-static int decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- LOCOContext * const l = avctx->priv_data;
- AVFrame * const p= (AVFrame*)&l->pic;
- int decoded;
-
- if(p->data[0])
- avctx->release_buffer(avctx, p);
-
- p->reference = 0;
- if(avctx->get_buffer(avctx, p) < 0){
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
- p->key_frame = 1;
-
- switch(l->mode) {
- case LOCO_CYUY2: case LOCO_YUY2: case LOCO_UYVY:
- decoded = loco_decode_plane(l, p->data[0], avctx->width, avctx->height,
- p->linesize[0], buf, buf_size, 1);
- buf += decoded; buf_size -= decoded;
- decoded = loco_decode_plane(l, p->data[1], avctx->width / 2, avctx->height,
- p->linesize[1], buf, buf_size, 1);
- buf += decoded; buf_size -= decoded;
- decoded = loco_decode_plane(l, p->data[2], avctx->width / 2, avctx->height,
- p->linesize[2], buf, buf_size, 1);
- break;
- case LOCO_CYV12: case LOCO_YV12:
- decoded = loco_decode_plane(l, p->data[0], avctx->width, avctx->height,
- p->linesize[0], buf, buf_size, 1);
- buf += decoded; buf_size -= decoded;
- decoded = loco_decode_plane(l, p->data[2], avctx->width / 2, avctx->height / 2,
- p->linesize[2], buf, buf_size, 1);
- buf += decoded; buf_size -= decoded;
- decoded = loco_decode_plane(l, p->data[1], avctx->width / 2, avctx->height / 2,
- p->linesize[1], buf, buf_size, 1);
- break;
- case LOCO_CRGB: case LOCO_RGB:
- decoded = loco_decode_plane(l, p->data[0] + p->linesize[0]*(avctx->height-1), avctx->width, avctx->height,
- -p->linesize[0], buf, buf_size, 3);
- buf += decoded; buf_size -= decoded;
- decoded = loco_decode_plane(l, p->data[0] + p->linesize[0]*(avctx->height-1) + 1, avctx->width, avctx->height,
- -p->linesize[0], buf, buf_size, 3);
- buf += decoded; buf_size -= decoded;
- decoded = loco_decode_plane(l, p->data[0] + p->linesize[0]*(avctx->height-1) + 2, avctx->width, avctx->height,
- -p->linesize[0], buf, buf_size, 3);
- break;
- case LOCO_RGBA:
- decoded = loco_decode_plane(l, p->data[0], avctx->width, avctx->height,
- p->linesize[0], buf, buf_size, 4);
- buf += decoded; buf_size -= decoded;
- decoded = loco_decode_plane(l, p->data[0] + 1, avctx->width, avctx->height,
- p->linesize[0], buf, buf_size, 4);
- buf += decoded; buf_size -= decoded;
- decoded = loco_decode_plane(l, p->data[0] + 2, avctx->width, avctx->height,
- p->linesize[0], buf, buf_size, 4);
- buf += decoded; buf_size -= decoded;
- decoded = loco_decode_plane(l, p->data[0] + 3, avctx->width, avctx->height,
- p->linesize[0], buf, buf_size, 4);
- break;
- }
-
- *data_size = sizeof(AVFrame);
- *(AVFrame*)data = l->pic;
-
- return buf_size;
-}
-
-static int decode_init(AVCodecContext *avctx){
- LOCOContext * const l = avctx->priv_data;
- int version;
-
- l->avctx = avctx;
- if (avctx->extradata_size < 12) {
- av_log(avctx, AV_LOG_ERROR, "Extradata size must be >= 12 instead of %i\n",
- avctx->extradata_size);
- return -1;
- }
- version = AV_RL32(avctx->extradata);
- switch(version) {
- case 1:
- l->lossy = 0;
- break;
- case 2:
- l->lossy = AV_RL32(avctx->extradata + 8);
- break;
- default:
- l->lossy = AV_RL32(avctx->extradata + 8);
- av_log(avctx, AV_LOG_INFO, "This is LOCO codec version %i, please upload file for study\n", version);
- }
-
- l->mode = AV_RL32(avctx->extradata + 4);
- switch(l->mode) {
- case LOCO_CYUY2: case LOCO_YUY2: case LOCO_UYVY:
- avctx->pix_fmt = PIX_FMT_YUV422P;
- break;
- case LOCO_CRGB: case LOCO_RGB:
- avctx->pix_fmt = PIX_FMT_BGR24;
- break;
- case LOCO_CYV12: case LOCO_YV12:
- avctx->pix_fmt = PIX_FMT_YUV420P;
- break;
- case LOCO_CRGBA: case LOCO_RGBA:
- avctx->pix_fmt = PIX_FMT_RGBA32;
- break;
- default:
- av_log(avctx, AV_LOG_INFO, "Unknown colorspace, index = %i\n", l->mode);
- return -1;
- }
- if(avctx->debug & FF_DEBUG_PICT_INFO)
- av_log(avctx, AV_LOG_INFO, "lossy:%i, version:%i, mode: %i\n", l->lossy, version, l->mode);
-
- return 0;
-}
-
-AVCodec loco_decoder = {
- "loco",
- CODEC_TYPE_VIDEO,
- CODEC_ID_LOCO,
- sizeof(LOCOContext),
- decode_init,
- NULL,
- NULL,
- decode_frame,
- CODEC_CAP_DR1,
-};
diff --git a/src/libffmpeg/libavcodec/lzo.c b/src/libffmpeg/libavcodec/lzo.c
deleted file mode 100644
index 0ee7eca04..000000000
--- a/src/libffmpeg/libavcodec/lzo.c
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- * LZO 1x decompression
- * Copyright (c) 2006 Reimar Doeffinger
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "common.h"
-//! avoid e.g. MPlayers fast_memcpy, it slows things down here
-#undef memcpy
-#include <string.h>
-#include "lzo.h"
-
-//! define if we may write up to 12 bytes beyond the output buffer
-#define OUTBUF_PADDED 1
-//! define if we may read up to 8 bytes beyond the input buffer
-#define INBUF_PADDED 1
-typedef struct LZOContext {
- uint8_t *in, *in_end;
- uint8_t *out_start, *out, *out_end;
- int error;
-} LZOContext;
-
-/**
- * \brief read one byte from input buffer, avoiding overrun
- * \return byte read
- */
-static inline int get_byte(LZOContext *c) {
- if (c->in < c->in_end)
- return *c->in++;
- c->error |= LZO_INPUT_DEPLETED;
- return 1;
-}
-
-#ifdef INBUF_PADDED
-#define GETB(c) (*(c).in++)
-#else
-#define GETB(c) get_byte(&(c))
-#endif
-
-/**
- * \brief decode a length value in the coding used by lzo
- * \param x previous byte value
- * \param mask bits used from x
- * \return decoded length value
- */
-static inline int get_len(LZOContext *c, int x, int mask) {
- int cnt = x & mask;
- if (!cnt) {
- while (!(x = get_byte(c))) cnt += 255;
- cnt += mask + x;
- }
- return cnt;
-}
-
-/**
- * \brief copy bytes from input to output buffer with checking
- * \param cnt number of bytes to copy, must be > 0
- */
-static inline void copy(LZOContext *c, int cnt) {
- register uint8_t *src = c->in;
- register uint8_t *dst = c->out;
- if (src + cnt > c->in_end || src + cnt < src) {
- cnt = c->in_end - src;
- c->error |= LZO_INPUT_DEPLETED;
- }
- if (dst + cnt > c->out_end || dst + cnt < dst) {
- cnt = c->out_end - dst;
- c->error |= LZO_OUTPUT_FULL;
- }
-#if defined(INBUF_PADDED) && defined(OUTBUF_PADDED)
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = src[2];
- dst[3] = src[3];
- src += 4;
- dst += 4;
- cnt -= 4;
- if (cnt > 0)
-#endif
- memcpy(dst, src, cnt);
- c->in = src + cnt;
- c->out = dst + cnt;
-}
-
-/**
- * \brief copy previously decoded bytes to current position
- * \param back how many bytes back we start
- * \param cnt number of bytes to copy, must be > 0
- *
- * cnt > back is valid, this will copy the bytes we just copied,
- * thus creating a repeating pattern with a period length of back.
- */
-static inline void copy_backptr(LZOContext *c, int back, int cnt) {
- register uint8_t *src = &c->out[-back];
- register uint8_t *dst = c->out;
- if (src < c->out_start || src > dst) {
- c->error |= LZO_INVALID_BACKPTR;
- return;
- }
- if (dst + cnt > c->out_end || dst + cnt < dst) {
- cnt = c->out_end - dst;
- c->error |= LZO_OUTPUT_FULL;
- }
- if (back == 1) {
- memset(dst, *src, cnt);
- dst += cnt;
- } else {
-#ifdef OUTBUF_PADDED
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = src[2];
- dst[3] = src[3];
- src += 4;
- dst += 4;
- cnt -= 4;
- if (cnt > 0) {
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = src[2];
- dst[3] = src[3];
- dst[4] = src[4];
- dst[5] = src[5];
- dst[6] = src[6];
- dst[7] = src[7];
- src += 8;
- dst += 8;
- cnt -= 8;
- }
-#endif
- if (cnt > 0) {
- int blocklen = back;
- while (cnt > blocklen) {
- memcpy(dst, src, blocklen);
- dst += blocklen;
- cnt -= blocklen;
- blocklen <<= 1;
- }
- memcpy(dst, src, cnt);
- }
- dst += cnt;
- }
- c->out = dst;
-}
-
-/**
- * \brief decode LZO 1x compressed data
- * \param out output buffer
- * \param outlen size of output buffer, number of bytes left are returned here
- * \param in input buffer
- * \param inlen size of input buffer, number of bytes left are returned here
- * \return 0 on success, otherwise error flags, see lzo.h
- *
- * make sure all buffers are appropriately padded, in must provide
- * LZO_INPUT_PADDING, out must provide LZO_OUTPUT_PADDING additional bytes
- */
-int lzo1x_decode(void *out, int *outlen, void *in, int *inlen) {
- enum {COPY, BACKPTR} state = COPY;
- int x;
- LZOContext c;
- c.in = in;
- c.in_end = (uint8_t *)in + *inlen;
- c.out = c.out_start = out;
- c.out_end = (uint8_t *)out + * outlen;
- c.error = 0;
- x = GETB(c);
- if (x > 17) {
- copy(&c, x - 17);
- x = GETB(c);
- if (x < 16) c.error |= LZO_ERROR;
- }
- while (!c.error) {
- int cnt, back;
- if (x >> 4) {
- if (x >> 6) {
- cnt = (x >> 5) - 1;
- back = (GETB(c) << 3) + ((x >> 2) & 7) + 1;
- } else if (x >> 5) {
- cnt = get_len(&c, x, 31);
- x = GETB(c);
- back = (GETB(c) << 6) + (x >> 2) + 1;
- } else {
- cnt = get_len(&c, x, 7);
- back = (1 << 14) + ((x & 8) << 11);
- x = GETB(c);
- back += (GETB(c) << 6) + (x >> 2);
- if (back == (1 << 14)) {
- if (cnt != 1)
- c.error |= LZO_ERROR;
- break;
- }
- }
- } else
- switch (state) {
- case COPY:
- cnt = get_len(&c, x, 15);
- copy(&c, cnt + 3);
- x = GETB(c);
- if (x >> 4)
- continue;
- cnt = 1;
- back = (1 << 11) + (GETB(c) << 2) + (x >> 2) + 1;
- break;
- case BACKPTR:
- cnt = 0;
- back = (GETB(c) << 2) + (x >> 2) + 1;
- break;
- }
- copy_backptr(&c, back, cnt + 2);
- cnt = x & 3;
- state = cnt ? BACKPTR : COPY;
- if (cnt)
- copy(&c, cnt);
- x = GETB(c);
- if (c.in > c.in_end)
- c.error |= LZO_INPUT_DEPLETED;
- }
- *inlen = c.in_end - c.in;
- if (c.in > c.in_end)
- *inlen = 0;
- *outlen = c.out_end - c.out;
- return c.error;
-}
-
-#ifdef TEST
-#include <stdio.h>
-#include <lzo/lzo1x.h>
-#include "log.h"
-#define MAXSZ (10*1024*1024)
-int main(int argc, char *argv[]) {
- FILE *in = fopen(argv[1], "rb");
- uint8_t *orig = av_malloc(MAXSZ + 16);
- uint8_t *comp = av_malloc(2*MAXSZ + 16);
- uint8_t *decomp = av_malloc(MAXSZ + 16);
- size_t s = fread(orig, 1, MAXSZ, in);
- lzo_uint clen = 0;
- long tmp[LZO1X_MEM_COMPRESS];
- int inlen, outlen;
- int i;
- av_log_level = AV_LOG_DEBUG;
- lzo1x_999_compress(orig, s, comp, &clen, tmp);
- for (i = 0; i < 300; i++) {
-START_TIMER
- inlen = clen; outlen = MAXSZ;
- if (lzo1x_decode(decomp, &outlen, comp, &inlen))
- av_log(NULL, AV_LOG_ERROR, "decompression error\n");
-STOP_TIMER("lzod")
- }
- if (memcmp(orig, decomp, s))
- av_log(NULL, AV_LOG_ERROR, "decompression incorrect\n");
- else
- av_log(NULL, AV_LOG_ERROR, "decompression ok\n");
- return 0;
-}
-#endif
diff --git a/src/libffmpeg/libavcodec/lzo.h b/src/libffmpeg/libavcodec/lzo.h
deleted file mode 100644
index 5b3d98f40..000000000
--- a/src/libffmpeg/libavcodec/lzo.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * LZO 1x decompression
- * copyright (c) 2006 Reimar Doeffinger
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef LZO_H
-#define LZO_H
-
-#define LZO_INPUT_DEPLETED 1
-#define LZO_OUTPUT_FULL 2
-#define LZO_INVALID_BACKPTR 4
-#define LZO_ERROR 8
-
-#define LZO_INPUT_PADDING 8
-#define LZO_OUTPUT_PADDING 12
-
-int lzo1x_decode(void *out, int *outlen, void *in, int *inlen);
-
-#endif
diff --git a/src/libffmpeg/libavcodec/mace.c b/src/libffmpeg/libavcodec/mace.c
deleted file mode 100644
index 95839379a..000000000
--- a/src/libffmpeg/libavcodec/mace.c
+++ /dev/null
@@ -1,456 +0,0 @@
-/*
- * MACE decoder
- * Copyright (c) 2002 Laszlo Torok <torokl@alpha.dfmk.hu>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file mace.c
- * MACE decoder.
- */
-
-#include "avcodec.h"
-
-/*
- * Adapted to ffmpeg by Francois Revol <revol@free.fr>
- * (removed 68k REG stuff, changed types, added some statics and consts,
- * libavcodec api, context stuff, interlaced stereo out).
- */
-
-static const uint16_t MACEtab1[] = { 0xfff3, 0x0008, 0x004c, 0x00de, 0x00de, 0x004c, 0x0008, 0xfff3 };
-
-static const uint16_t MACEtab3[] = { 0xffee, 0x008c, 0x008c, 0xffee };
-
-static const uint16_t MACEtab2[][8] = {
- { 0x0025, 0x0074, 0x00CE, 0x014A, 0xFEB5, 0xFF31, 0xFF8B, 0xFFDA },
- { 0x0027, 0x0079, 0x00D8, 0x015A, 0xFEA5, 0xFF27, 0xFF86, 0xFFD8 },
- { 0x0029, 0x007F, 0x00E1, 0x0169, 0xFE96, 0xFF1E, 0xFF80, 0xFFD6 },
- { 0x002A, 0x0084, 0x00EB, 0x0179, 0xFE86, 0xFF14, 0xFF7B, 0xFFD5 },
- { 0x002C, 0x0089, 0x00F5, 0x0188, 0xFE77, 0xFF0A, 0xFF76, 0xFFD3 },
- { 0x002E, 0x0090, 0x0100, 0x019A, 0xFE65, 0xFEFF, 0xFF6F, 0xFFD1 },
- { 0x0030, 0x0096, 0x010B, 0x01AC, 0xFE53, 0xFEF4, 0xFF69, 0xFFCF },
- { 0x0033, 0x009D, 0x0118, 0x01C1, 0xFE3E, 0xFEE7, 0xFF62, 0xFFCC },
- { 0x0035, 0x00A5, 0x0125, 0x01D6, 0xFE29, 0xFEDA, 0xFF5A, 0xFFCA },
- { 0x0037, 0x00AC, 0x0132, 0x01EA, 0xFE15, 0xFECD, 0xFF53, 0xFFC8 },
- { 0x003A, 0x00B3, 0x013F, 0x01FF, 0xFE00, 0xFEC0, 0xFF4C, 0xFFC5 },
- { 0x003C, 0x00BB, 0x014D, 0x0216, 0xFDE9, 0xFEB2, 0xFF44, 0xFFC3 },
- { 0x003F, 0x00C3, 0x015C, 0x022D, 0xFDD2, 0xFEA3, 0xFF3C, 0xFFC0 },
- { 0x0042, 0x00CD, 0x016C, 0x0247, 0xFDB8, 0xFE93, 0xFF32, 0xFFBD },
- { 0x0045, 0x00D6, 0x017C, 0x0261, 0xFD9E, 0xFE83, 0xFF29, 0xFFBA },
- { 0x0048, 0x00DF, 0x018C, 0x027B, 0xFD84, 0xFE73, 0xFF20, 0xFFB7 },
- { 0x004B, 0x00E9, 0x019E, 0x0297, 0xFD68, 0xFE61, 0xFF16, 0xFFB4 },
- { 0x004F, 0x00F4, 0x01B1, 0x02B6, 0xFD49, 0xFE4E, 0xFF0B, 0xFFB0 },
- { 0x0052, 0x00FE, 0x01C5, 0x02D5, 0xFD2A, 0xFE3A, 0xFF01, 0xFFAD },
- { 0x0056, 0x0109, 0x01D8, 0x02F4, 0xFD0B, 0xFE27, 0xFEF6, 0xFFA9 },
- { 0x005A, 0x0116, 0x01EF, 0x0318, 0xFCE7, 0xFE10, 0xFEE9, 0xFFA5 },
- { 0x005E, 0x0122, 0x0204, 0x033A, 0xFCC5, 0xFDFB, 0xFEDD, 0xFFA1 },
- { 0x0062, 0x012F, 0x021A, 0x035E, 0xFCA1, 0xFDE5, 0xFED0, 0xFF9D },
- { 0x0066, 0x013C, 0x0232, 0x0385, 0xFC7A, 0xFDCD, 0xFEC3, 0xFF99 },
- { 0x006B, 0x014B, 0x024C, 0x03AE, 0xFC51, 0xFDB3, 0xFEB4, 0xFF94 },
- { 0x0070, 0x0159, 0x0266, 0x03D7, 0xFC28, 0xFD99, 0xFEA6, 0xFF8F },
- { 0x0075, 0x0169, 0x0281, 0x0403, 0xFBFC, 0xFD7E, 0xFE96, 0xFF8A },
- { 0x007A, 0x0179, 0x029E, 0x0432, 0xFBCD, 0xFD61, 0xFE86, 0xFF85 },
- { 0x007F, 0x018A, 0x02BD, 0x0463, 0xFB9C, 0xFD42, 0xFE75, 0xFF80 },
- { 0x0085, 0x019B, 0x02DC, 0x0494, 0xFB6B, 0xFD23, 0xFE64, 0xFF7A },
- { 0x008B, 0x01AE, 0x02FC, 0x04C8, 0xFB37, 0xFD03, 0xFE51, 0xFF74 },
- { 0x0091, 0x01C1, 0x031F, 0x0500, 0xFAFF, 0xFCE0, 0xFE3E, 0xFF6E },
- { 0x0098, 0x01D5, 0x0343, 0x0539, 0xFAC6, 0xFCBC, 0xFE2A, 0xFF67 },
- { 0x009F, 0x01EA, 0x0368, 0x0575, 0xFA8A, 0xFC97, 0xFE15, 0xFF60 },
- { 0x00A6, 0x0200, 0x038F, 0x05B3, 0xFA4C, 0xFC70, 0xFDFF, 0xFF59 },
- { 0x00AD, 0x0217, 0x03B7, 0x05F3, 0xFA0C, 0xFC48, 0xFDE8, 0xFF52 },
- { 0x00B5, 0x022E, 0x03E1, 0x0636, 0xF9C9, 0xFC1E, 0xFDD1, 0xFF4A },
- { 0x00BD, 0x0248, 0x040E, 0x067F, 0xF980, 0xFBF1, 0xFDB7, 0xFF42 },
- { 0x00C5, 0x0262, 0x043D, 0x06CA, 0xF935, 0xFBC2, 0xFD9D, 0xFF3A },
- { 0x00CE, 0x027D, 0x046D, 0x0717, 0xF8E8, 0xFB92, 0xFD82, 0xFF31 },
- { 0x00D7, 0x0299, 0x049F, 0x0767, 0xF898, 0xFB60, 0xFD66, 0xFF28 },
- { 0x00E1, 0x02B7, 0x04D5, 0x07BC, 0xF843, 0xFB2A, 0xFD48, 0xFF1E },
- { 0x00EB, 0x02D6, 0x050B, 0x0814, 0xF7EB, 0xFAF4, 0xFD29, 0xFF14 },
- { 0x00F6, 0x02F7, 0x0545, 0x0871, 0xF78E, 0xFABA, 0xFD08, 0xFF09 },
- { 0x0101, 0x0318, 0x0581, 0x08D1, 0xF72E, 0xFA7E, 0xFCE7, 0xFEFE },
- { 0x010C, 0x033C, 0x05C0, 0x0935, 0xF6CA, 0xFA3F, 0xFCC3, 0xFEF3 },
- { 0x0118, 0x0361, 0x0602, 0x099F, 0xF660, 0xF9FD, 0xFC9E, 0xFEE7 },
- { 0x0125, 0x0387, 0x0646, 0x0A0C, 0xF5F3, 0xF9B9, 0xFC78, 0xFEDA },
- { 0x0132, 0x03B0, 0x068E, 0x0A80, 0xF57F, 0xF971, 0xFC4F, 0xFECD },
- { 0x013F, 0x03DA, 0x06D9, 0x0AF7, 0xF508, 0xF926, 0xFC25, 0xFEC0 },
- { 0x014E, 0x0406, 0x0728, 0x0B75, 0xF48A, 0xF8D7, 0xFBF9, 0xFEB1 },
- { 0x015D, 0x0434, 0x077A, 0x0BF9, 0xF406, 0xF885, 0xFBCB, 0xFEA2 },
- { 0x016C, 0x0464, 0x07CF, 0x0C82, 0xF37D, 0xF830, 0xFB9B, 0xFE93 },
- { 0x017C, 0x0496, 0x0828, 0x0D10, 0xF2EF, 0xF7D7, 0xFB69, 0xFE83 },
- { 0x018E, 0x04CB, 0x0886, 0x0DA6, 0xF259, 0xF779, 0xFB34, 0xFE71 },
- { 0x019F, 0x0501, 0x08E6, 0x0E41, 0xF1BE, 0xF719, 0xFAFE, 0xFE60 },
- { 0x01B2, 0x053B, 0x094C, 0x0EE3, 0xF11C, 0xF6B3, 0xFAC4, 0xFE4D },
- { 0x01C5, 0x0576, 0x09B6, 0x0F8E, 0xF071, 0xF649, 0xFA89, 0xFE3A },
- { 0x01D9, 0x05B5, 0x0A26, 0x1040, 0xEFBF, 0xF5D9, 0xFA4A, 0xFE26 },
- { 0x01EF, 0x05F6, 0x0A9A, 0x10FA, 0xEF05, 0xF565, 0xFA09, 0xFE10 },
- { 0x0205, 0x063A, 0x0B13, 0x11BC, 0xEE43, 0xF4EC, 0xF9C5, 0xFDFA },
- { 0x021C, 0x0681, 0x0B91, 0x1285, 0xED7A, 0xF46E, 0xF97E, 0xFDE3 },
- { 0x0234, 0x06CC, 0x0C15, 0x1359, 0xECA6, 0xF3EA, 0xF933, 0xFDCB },
- { 0x024D, 0x071A, 0x0CA0, 0x1437, 0xEBC8, 0xF35F, 0xF8E5, 0xFDB2 },
- { 0x0267, 0x076A, 0x0D2F, 0x151D, 0xEAE2, 0xF2D0, 0xF895, 0xFD98 },
- { 0x0283, 0x07C0, 0x0DC7, 0x160F, 0xE9F0, 0xF238, 0xF83F, 0xFD7C },
- { 0x029F, 0x0818, 0x0E63, 0x170A, 0xE8F5, 0xF19C, 0xF7E7, 0xFD60 },
- { 0x02BD, 0x0874, 0x0F08, 0x1811, 0xE7EE, 0xF0F7, 0xF78B, 0xFD42 },
- { 0x02DD, 0x08D5, 0x0FB4, 0x1926, 0xE6D9, 0xF04B, 0xF72A, 0xFD22 },
- { 0x02FE, 0x093A, 0x1067, 0x1A44, 0xE5BB, 0xEF98, 0xF6C5, 0xFD01 },
- { 0x0320, 0x09A3, 0x1122, 0x1B70, 0xE48F, 0xEEDD, 0xF65C, 0xFCDF },
- { 0x0344, 0x0A12, 0x11E7, 0x1CAB, 0xE354, 0xEE18, 0xF5ED, 0xFCBB },
- { 0x0369, 0x0A84, 0x12B2, 0x1DF0, 0xE20F, 0xED4D, 0xF57B, 0xFC96 },
- { 0x0390, 0x0AFD, 0x1389, 0x1F48, 0xE0B7, 0xEC76, 0xF502, 0xFC6F },
- { 0x03B8, 0x0B7A, 0x1467, 0x20AC, 0xDF53, 0xEB98, 0xF485, 0xFC47 },
- { 0x03E3, 0x0BFE, 0x1551, 0x2223, 0xDDDC, 0xEAAE, 0xF401, 0xFC1C },
- { 0x040F, 0x0C87, 0x1645, 0x23A9, 0xDC56, 0xE9BA, 0xF378, 0xFBF0 },
- { 0x043E, 0x0D16, 0x1744, 0x2541, 0xDABE, 0xE8BB, 0xF2E9, 0xFBC1 },
- { 0x046E, 0x0DAB, 0x184C, 0x26E8, 0xD917, 0xE7B3, 0xF254, 0xFB91 },
- { 0x04A1, 0x0E47, 0x1961, 0x28A4, 0xD75B, 0xE69E, 0xF1B8, 0xFB5E },
- { 0x04D6, 0x0EEA, 0x1A84, 0x2A75, 0xD58A, 0xE57B, 0xF115, 0xFB29 },
- { 0x050D, 0x0F95, 0x1BB3, 0x2C5B, 0xD3A4, 0xE44C, 0xF06A, 0xFAF2 },
- { 0x0547, 0x1046, 0x1CEF, 0x2E55, 0xD1AA, 0xE310, 0xEFB9, 0xFAB8 },
- { 0x0583, 0x1100, 0x1E3A, 0x3066, 0xCF99, 0xE1C5, 0xEEFF, 0xFA7C },
- { 0x05C2, 0x11C3, 0x1F94, 0x3292, 0xCD6D, 0xE06B, 0xEE3C, 0xFA3D },
- { 0x0604, 0x128E, 0x20FC, 0x34D2, 0xCB2D, 0xDF03, 0xED71, 0xF9FB },
- { 0x0649, 0x1362, 0x2275, 0x372E, 0xC8D1, 0xDD8A, 0xEC9D, 0xF9B6 },
- { 0x0690, 0x143F, 0x23FF, 0x39A4, 0xC65B, 0xDC00, 0xEBC0, 0xF96F },
- { 0x06DC, 0x1527, 0x259A, 0x3C37, 0xC3C8, 0xDA65, 0xEAD8, 0xF923 },
- { 0x072A, 0x1619, 0x2749, 0x3EE8, 0xC117, 0xD8B6, 0xE9E6, 0xF8D5 },
- { 0x077C, 0x1715, 0x2909, 0x41B6, 0xBE49, 0xD6F6, 0xE8EA, 0xF883 },
- { 0x07D1, 0x181D, 0x2ADF, 0x44A6, 0xBB59, 0xD520, 0xE7E2, 0xF82E },
- { 0x082B, 0x1930, 0x2CC7, 0x47B4, 0xB84B, 0xD338, 0xE6CF, 0xF7D4 },
- { 0x0888, 0x1A50, 0x2EC6, 0x4AE7, 0xB518, 0xD139, 0xE5AF, 0xF777 },
- { 0x08EA, 0x1B7D, 0x30DE, 0x4E40, 0xB1BF, 0xCF21, 0xE482, 0xF715 },
- { 0x094F, 0x1CB7, 0x330C, 0x51BE, 0xAE41, 0xCCF3, 0xE348, 0xF6B0 },
- { 0x09BA, 0x1DFF, 0x3554, 0x5565, 0xAA9A, 0xCAAB, 0xE200, 0xF645 },
- { 0x0A29, 0x1F55, 0x37B4, 0x5932, 0xA6CD, 0xC84B, 0xE0AA, 0xF5D6 },
- { 0x0A9D, 0x20BC, 0x3A31, 0x5D2E, 0xA2D1, 0xC5CE, 0xDF43, 0xF562 },
- { 0x0B16, 0x2231, 0x3CC9, 0x6156, 0x9EA9, 0xC336, 0xDDCE, 0xF4E9 },
- { 0x0B95, 0x23B8, 0x3F80, 0x65AF, 0x9A50, 0xC07F, 0xDC47, 0xF46A },
- { 0x0C19, 0x2551, 0x4256, 0x6A39, 0x95C6, 0xBDA9, 0xDAAE, 0xF3E6 },
- { 0x0CA4, 0x26FB, 0x454C, 0x6EF7, 0x9108, 0xBAB3, 0xD904, 0xF35B },
- { 0x0D34, 0x28B8, 0x4864, 0x73EB, 0x8C14, 0xB79B, 0xD747, 0xF2CB },
- { 0x0DCB, 0x2A8A, 0x4B9F, 0x7918, 0x86E7, 0xB460, 0xD575, 0xF234 },
- { 0x0E68, 0x2C6F, 0x4EFE, 0x7E7E, 0x8181, 0xB101, 0xD390, 0xF197 },
- { 0x0F0D, 0x2E6B, 0x5285, 0x7FFF, 0x8000, 0xAD7A, 0xD194, 0xF0F2 },
- { 0x0FB9, 0x307E, 0x5635, 0x7FFF, 0x8000, 0xA9CA, 0xCF81, 0xF046 },
- { 0x106D, 0x32A7, 0x5A0D, 0x7FFF, 0x8000, 0xA5F2, 0xCD58, 0xEF92 },
- { 0x1128, 0x34EA, 0x5E12, 0x7FFF, 0x8000, 0xA1ED, 0xCB15, 0xEED7 },
- { 0x11ED, 0x3747, 0x6245, 0x7FFF, 0x8000, 0x9DBA, 0xC8B8, 0xEE12 },
- { 0x12B9, 0x39BF, 0x66A8, 0x7FFF, 0x8000, 0x9957, 0xC640, 0xED46 },
- { 0x138F, 0x3C52, 0x6B3C, 0x7FFF, 0x8000, 0x94C3, 0xC3AD, 0xEC70 },
- { 0x146F, 0x3F04, 0x7006, 0x7FFF, 0x8000, 0x8FF9, 0xC0FB, 0xEB90 },
- { 0x1558, 0x41D3, 0x7505, 0x7FFF, 0x8000, 0x8AFA, 0xBE2C, 0xEAA7 },
- { 0x164C, 0x44C3, 0x7A3E, 0x7FFF, 0x8000, 0x85C1, 0xBB3C, 0xE9B3 },
- { 0x174B, 0x47D5, 0x7FB3, 0x7FFF, 0x8000, 0x804C, 0xB82A, 0xE8B4 },
- { 0x1855, 0x4B0A, 0x7FFF, 0x7FFF, 0x8000, 0x8000, 0xB4F5, 0xE7AA },
- { 0x196B, 0x4E63, 0x7FFF, 0x7FFF, 0x8000, 0x8000, 0xB19C, 0xE694 },
- { 0x1A8D, 0x51E3, 0x7FFF, 0x7FFF, 0x8000, 0x8000, 0xAE1C, 0xE572 },
- { 0x1BBD, 0x558B, 0x7FFF, 0x7FFF, 0x8000, 0x8000, 0xAA74, 0xE442 },
- { 0x1CFA, 0x595C, 0x7FFF, 0x7FFF, 0x8000, 0x8000, 0xA6A3, 0xE305 },
- { 0x1E45, 0x5D59, 0x7FFF, 0x7FFF, 0x8000, 0x8000, 0xA2A6, 0xE1BA },
- { 0x1F9F, 0x6184, 0x7FFF, 0x7FFF, 0x8000, 0x8000, 0x9E7B, 0xE060 },
- { 0x2108, 0x65DE, 0x7FFF, 0x7FFF, 0x8000, 0x8000, 0x9A21, 0xDEF7 },
- { 0x2281, 0x6A6A, 0x7FFF, 0x7FFF, 0x8000, 0x8000, 0x9595, 0xDD7E },
- { 0x240C, 0x6F29, 0x7FFF, 0x7FFF, 0x8000, 0x8000, 0x90D6, 0xDBF3 },
- { 0x25A7, 0x741F, 0x7FFF, 0x7FFF, 0x8000, 0x8000, 0x8BE0, 0xDA58 },
-};
-
-static const uint16_t MACEtab4[][8] = {
- { 0x0040, 0x00D8, 0xFF27, 0xFFBF, 0, 0, 0, 0 }, { 0x0043, 0x00E2, 0xFF1D, 0xFFBC, 0, 0, 0, 0 },
- { 0x0046, 0x00EC, 0xFF13, 0xFFB9, 0, 0, 0, 0 }, { 0x004A, 0x00F6, 0xFF09, 0xFFB5, 0, 0, 0, 0 },
- { 0x004D, 0x0101, 0xFEFE, 0xFFB2, 0, 0, 0, 0 }, { 0x0050, 0x010C, 0xFEF3, 0xFFAF, 0, 0, 0, 0 },
- { 0x0054, 0x0118, 0xFEE7, 0xFFAB, 0, 0, 0, 0 }, { 0x0058, 0x0126, 0xFED9, 0xFFA7, 0, 0, 0, 0 },
- { 0x005C, 0x0133, 0xFECC, 0xFFA3, 0, 0, 0, 0 }, { 0x0060, 0x0141, 0xFEBE, 0xFF9F, 0, 0, 0, 0 },
- { 0x0064, 0x014E, 0xFEB1, 0xFF9B, 0, 0, 0, 0 }, { 0x0068, 0x015E, 0xFEA1, 0xFF97, 0, 0, 0, 0 },
- { 0x006D, 0x016D, 0xFE92, 0xFF92, 0, 0, 0, 0 }, { 0x0072, 0x017E, 0xFE81, 0xFF8D, 0, 0, 0, 0 },
- { 0x0077, 0x018F, 0xFE70, 0xFF88, 0, 0, 0, 0 }, { 0x007C, 0x01A0, 0xFE5F, 0xFF83, 0, 0, 0, 0 },
- { 0x0082, 0x01B2, 0xFE4D, 0xFF7D, 0, 0, 0, 0 }, { 0x0088, 0x01C6, 0xFE39, 0xFF77, 0, 0, 0, 0 },
- { 0x008E, 0x01DB, 0xFE24, 0xFF71, 0, 0, 0, 0 }, { 0x0094, 0x01EF, 0xFE10, 0xFF6B, 0, 0, 0, 0 },
- { 0x009B, 0x0207, 0xFDF8, 0xFF64, 0, 0, 0, 0 }, { 0x00A2, 0x021D, 0xFDE2, 0xFF5D, 0, 0, 0, 0 },
- { 0x00A9, 0x0234, 0xFDCB, 0xFF56, 0, 0, 0, 0 }, { 0x00B0, 0x024E, 0xFDB1, 0xFF4F, 0, 0, 0, 0 },
- { 0x00B9, 0x0269, 0xFD96, 0xFF46, 0, 0, 0, 0 }, { 0x00C1, 0x0284, 0xFD7B, 0xFF3E, 0, 0, 0, 0 },
- { 0x00C9, 0x02A1, 0xFD5E, 0xFF36, 0, 0, 0, 0 }, { 0x00D2, 0x02BF, 0xFD40, 0xFF2D, 0, 0, 0, 0 },
- { 0x00DC, 0x02DF, 0xFD20, 0xFF23, 0, 0, 0, 0 }, { 0x00E6, 0x02FF, 0xFD00, 0xFF19, 0, 0, 0, 0 },
- { 0x00F0, 0x0321, 0xFCDE, 0xFF0F, 0, 0, 0, 0 }, { 0x00FB, 0x0346, 0xFCB9, 0xFF04, 0, 0, 0, 0 },
- { 0x0106, 0x036C, 0xFC93, 0xFEF9, 0, 0, 0, 0 }, { 0x0112, 0x0392, 0xFC6D, 0xFEED, 0, 0, 0, 0 },
- { 0x011E, 0x03BB, 0xFC44, 0xFEE1, 0, 0, 0, 0 }, { 0x012B, 0x03E5, 0xFC1A, 0xFED4, 0, 0, 0, 0 },
- { 0x0138, 0x0411, 0xFBEE, 0xFEC7, 0, 0, 0, 0 }, { 0x0146, 0x0441, 0xFBBE, 0xFEB9, 0, 0, 0, 0 },
- { 0x0155, 0x0472, 0xFB8D, 0xFEAA, 0, 0, 0, 0 }, { 0x0164, 0x04A4, 0xFB5B, 0xFE9B, 0, 0, 0, 0 },
- { 0x0174, 0x04D9, 0xFB26, 0xFE8B, 0, 0, 0, 0 }, { 0x0184, 0x0511, 0xFAEE, 0xFE7B, 0, 0, 0, 0 },
- { 0x0196, 0x054A, 0xFAB5, 0xFE69, 0, 0, 0, 0 }, { 0x01A8, 0x0587, 0xFA78, 0xFE57, 0, 0, 0, 0 },
- { 0x01BB, 0x05C6, 0xFA39, 0xFE44, 0, 0, 0, 0 }, { 0x01CE, 0x0608, 0xF9F7, 0xFE31, 0, 0, 0, 0 },
- { 0x01E3, 0x064D, 0xF9B2, 0xFE1C, 0, 0, 0, 0 }, { 0x01F9, 0x0694, 0xF96B, 0xFE06, 0, 0, 0, 0 },
- { 0x020F, 0x06E0, 0xF91F, 0xFDF0, 0, 0, 0, 0 }, { 0x0227, 0x072E, 0xF8D1, 0xFDD8, 0, 0, 0, 0 },
- { 0x0240, 0x0781, 0xF87E, 0xFDBF, 0, 0, 0, 0 }, { 0x0259, 0x07D7, 0xF828, 0xFDA6, 0, 0, 0, 0 },
- { 0x0274, 0x0831, 0xF7CE, 0xFD8B, 0, 0, 0, 0 }, { 0x0290, 0x088E, 0xF771, 0xFD6F, 0, 0, 0, 0 },
- { 0x02AE, 0x08F0, 0xF70F, 0xFD51, 0, 0, 0, 0 }, { 0x02CC, 0x0955, 0xF6AA, 0xFD33, 0, 0, 0, 0 },
- { 0x02EC, 0x09C0, 0xF63F, 0xFD13, 0, 0, 0, 0 }, { 0x030D, 0x0A2F, 0xF5D0, 0xFCF2, 0, 0, 0, 0 },
- { 0x0330, 0x0AA4, 0xF55B, 0xFCCF, 0, 0, 0, 0 }, { 0x0355, 0x0B1E, 0xF4E1, 0xFCAA, 0, 0, 0, 0 },
- { 0x037B, 0x0B9D, 0xF462, 0xFC84, 0, 0, 0, 0 }, { 0x03A2, 0x0C20, 0xF3DF, 0xFC5D, 0, 0, 0, 0 },
- { 0x03CC, 0x0CAB, 0xF354, 0xFC33, 0, 0, 0, 0 }, { 0x03F8, 0x0D3D, 0xF2C2, 0xFC07, 0, 0, 0, 0 },
- { 0x0425, 0x0DD3, 0xF22C, 0xFBDA, 0, 0, 0, 0 }, { 0x0454, 0x0E72, 0xF18D, 0xFBAB, 0, 0, 0, 0 },
- { 0x0486, 0x0F16, 0xF0E9, 0xFB79, 0, 0, 0, 0 }, { 0x04B9, 0x0FC3, 0xF03C, 0xFB46, 0, 0, 0, 0 },
- { 0x04F0, 0x1078, 0xEF87, 0xFB0F, 0, 0, 0, 0 }, { 0x0528, 0x1133, 0xEECC, 0xFAD7, 0, 0, 0, 0 },
- { 0x0563, 0x11F7, 0xEE08, 0xFA9C, 0, 0, 0, 0 }, { 0x05A1, 0x12C6, 0xED39, 0xFA5E, 0, 0, 0, 0 },
- { 0x05E1, 0x139B, 0xEC64, 0xFA1E, 0, 0, 0, 0 }, { 0x0624, 0x147C, 0xEB83, 0xF9DB, 0, 0, 0, 0 },
- { 0x066A, 0x1565, 0xEA9A, 0xF995, 0, 0, 0, 0 }, { 0x06B3, 0x165A, 0xE9A5, 0xF94C, 0, 0, 0, 0 },
- { 0x0700, 0x175A, 0xE8A5, 0xF8FF, 0, 0, 0, 0 }, { 0x0750, 0x1865, 0xE79A, 0xF8AF, 0, 0, 0, 0 },
- { 0x07A3, 0x197A, 0xE685, 0xF85C, 0, 0, 0, 0 }, { 0x07FB, 0x1A9D, 0xE562, 0xF804, 0, 0, 0, 0 },
- { 0x0856, 0x1BCE, 0xE431, 0xF7A9, 0, 0, 0, 0 }, { 0x08B5, 0x1D0C, 0xE2F3, 0xF74A, 0, 0, 0, 0 },
- { 0x0919, 0x1E57, 0xE1A8, 0xF6E6, 0, 0, 0, 0 }, { 0x0980, 0x1FB2, 0xE04D, 0xF67F, 0, 0, 0, 0 },
- { 0x09ED, 0x211D, 0xDEE2, 0xF612, 0, 0, 0, 0 }, { 0x0A5F, 0x2296, 0xDD69, 0xF5A0, 0, 0, 0, 0 },
- { 0x0AD5, 0x2422, 0xDBDD, 0xF52A, 0, 0, 0, 0 }, { 0x0B51, 0x25BF, 0xDA40, 0xF4AE, 0, 0, 0, 0 },
- { 0x0BD2, 0x276E, 0xD891, 0xF42D, 0, 0, 0, 0 }, { 0x0C5A, 0x2932, 0xD6CD, 0xF3A5, 0, 0, 0, 0 },
- { 0x0CE7, 0x2B08, 0xD4F7, 0xF318, 0, 0, 0, 0 }, { 0x0D7A, 0x2CF4, 0xD30B, 0xF285, 0, 0, 0, 0 },
- { 0x0E14, 0x2EF4, 0xD10B, 0xF1EB, 0, 0, 0, 0 }, { 0x0EB5, 0x310C, 0xCEF3, 0xF14A, 0, 0, 0, 0 },
- { 0x0F5D, 0x333E, 0xCCC1, 0xF0A2, 0, 0, 0, 0 }, { 0x100C, 0x3587, 0xCA78, 0xEFF3, 0, 0, 0, 0 },
- { 0x10C4, 0x37EB, 0xC814, 0xEF3B, 0, 0, 0, 0 }, { 0x1183, 0x3A69, 0xC596, 0xEE7C, 0, 0, 0, 0 },
- { 0x124B, 0x3D05, 0xC2FA, 0xEDB4, 0, 0, 0, 0 }, { 0x131C, 0x3FBE, 0xC041, 0xECE3, 0, 0, 0, 0 },
- { 0x13F7, 0x4296, 0xBD69, 0xEC08, 0, 0, 0, 0 }, { 0x14DB, 0x458F, 0xBA70, 0xEB24, 0, 0, 0, 0 },
- { 0x15C9, 0x48AA, 0xB755, 0xEA36, 0, 0, 0, 0 }, { 0x16C2, 0x4BE9, 0xB416, 0xE93D, 0, 0, 0, 0 },
- { 0x17C6, 0x4F4C, 0xB0B3, 0xE839, 0, 0, 0, 0 }, { 0x18D6, 0x52D5, 0xAD2A, 0xE729, 0, 0, 0, 0 },
- { 0x19F2, 0x5688, 0xA977, 0xE60D, 0, 0, 0, 0 }, { 0x1B1A, 0x5A65, 0xA59A, 0xE4E5, 0, 0, 0, 0 },
- { 0x1C50, 0x5E6D, 0xA192, 0xE3AF, 0, 0, 0, 0 }, { 0x1D93, 0x62A4, 0x9D5B, 0xE26C, 0, 0, 0, 0 },
- { 0x1EE5, 0x670C, 0x98F3, 0xE11A, 0, 0, 0, 0 }, { 0x2046, 0x6BA5, 0x945A, 0xDFB9, 0, 0, 0, 0 },
- { 0x21B7, 0x7072, 0x8F8D, 0xDE48, 0, 0, 0, 0 }, { 0x2338, 0x7578, 0x8A87, 0xDCC7, 0, 0, 0, 0 },
- { 0x24CB, 0x7AB5, 0x854A, 0xDB34, 0, 0, 0, 0 }, { 0x266F, 0x7FFF, 0x8000, 0xD990, 0, 0, 0, 0 },
- { 0x2826, 0x7FFF, 0x8000, 0xD7D9, 0, 0, 0, 0 }, { 0x29F1, 0x7FFF, 0x8000, 0xD60E, 0, 0, 0, 0 },
- { 0x2BD0, 0x7FFF, 0x8000, 0xD42F, 0, 0, 0, 0 }, { 0x2DC5, 0x7FFF, 0x8000, 0xD23A, 0, 0, 0, 0 },
- { 0x2FD0, 0x7FFF, 0x8000, 0xD02F, 0, 0, 0, 0 }, { 0x31F2, 0x7FFF, 0x8000, 0xCE0D, 0, 0, 0, 0 },
- { 0x342C, 0x7FFF, 0x8000, 0xCBD3, 0, 0, 0, 0 }, { 0x3681, 0x7FFF, 0x8000, 0xC97E, 0, 0, 0, 0 },
- { 0x38F0, 0x7FFF, 0x8000, 0xC70F, 0, 0, 0, 0 }, { 0x3B7A, 0x7FFF, 0x8000, 0xC485, 0, 0, 0, 0 },
- { 0x3E22, 0x7FFF, 0x8000, 0xC1DD, 0, 0, 0, 0 }, { 0x40E7, 0x7FFF, 0x8000, 0xBF18, 0, 0, 0, 0 },
-};
-/* end of constants */
-
-typedef struct MACEContext {
- short index, lev, factor, prev2, previous, level;
- short *outPtr;
-} MACEContext;
-
-/* /// "chomp3()" */
-static void chomp3(MACEContext *ctx,
- uint8_t val,
- const uint16_t tab1[],
- const uint16_t tab2[][8],
- uint32_t numChannels)
-{
- short current;
-
- current=(short)tab2[(ctx->index & 0x7f0) >> 4][val];
- if (current+ctx->lev > 32767) current=32767;
- else if (current+ctx->lev < -32768) current=-32767;
- else current+=ctx->lev;
- ctx->lev=current-(current >> 3);
-// *ctx->outPtr++=current >> 8;
- *ctx->outPtr=current;
- ctx->outPtr+=numChannels;
- if ( ( ctx->index += tab1[val]-(ctx->index>>5) ) < 0 ) ctx->index = 0;
-}
-/* \\\ */
-
-/* /// "Exp1to3()" */
-static void Exp1to3(MACEContext *ctx,
- uint8_t *inBuffer,
- void *outBuffer,
- uint32_t cnt,
- uint32_t numChannels,
- uint32_t whichChannel)
-{
- uint8_t pkt;
-
-/*
- if (inState) {
- ctx->index=inState[0];
- ctx->lev=inState[1];
- } else
-*/
- ctx->index=ctx->lev=0;
-
- inBuffer+=(whichChannel-1)*2;
-
- ctx->outPtr=outBuffer;
-
- while (cnt>0) {
- pkt=inBuffer[0];
- chomp3(ctx, pkt & 7, MACEtab1, MACEtab2, numChannels);
- chomp3(ctx,(pkt >> 3) & 3, MACEtab3, MACEtab4, numChannels);
- chomp3(ctx, pkt >> 5 , MACEtab1, MACEtab2, numChannels);
- pkt=inBuffer[1];
- chomp3(ctx, pkt & 7, MACEtab1, MACEtab2, numChannels);
- chomp3(ctx,(pkt >> 3) & 3, MACEtab3, MACEtab4, numChannels);
- chomp3(ctx, pkt >> 5 , MACEtab1, MACEtab2, numChannels);
-
- inBuffer+=numChannels*2;
- --cnt;
- }
-
-/*
- if (outState) {
- outState[0]=ctx->index;
- outState[1]=ctx->lev;
- }
-*/
-}
-/* \\\ */
-
-/* /// "chomp6()" */
-static void chomp6(MACEContext *ctx,
- uint8_t val,
- const uint16_t tab1[],
- const uint16_t tab2[][8],
- uint32_t numChannels)
-{
- short current;
-
- current=(short)tab2[(ctx->index & 0x7f0) >> 4][val];
-
- if ((ctx->previous^current)>=0) {
- if (ctx->factor+506>32767) ctx->factor=32767;
- else ctx->factor+=506;
- } else {
- if (ctx->factor-314<-32768) ctx->factor=-32767;
- else ctx->factor-=314;
- }
-
- if (current+ctx->level>32767) current=32767;
- else if (current+ctx->level<-32768) current=-32767;
- else current+=ctx->level;
-
- ctx->level=((current*ctx->factor) >> 15);
- current>>=1;
-
-// *ctx->outPtr++=(ctx->previous+ctx->prev2-((ctx->prev2-current) >> 2)) >> 8;
-// *ctx->outPtr++=(ctx->previous+current+((ctx->prev2-current) >> 2)) >> 8;
- *ctx->outPtr=(ctx->previous+ctx->prev2-((ctx->prev2-current) >> 2));
- ctx->outPtr+=numChannels;
- *ctx->outPtr=(ctx->previous+current+((ctx->prev2-current) >> 2));
- ctx->outPtr+=numChannels;
- ctx->prev2=ctx->previous;
- ctx->previous=current;
-
- if( ( ctx->index += tab1[val]-(ctx->index>>5) ) < 0 ) ctx->index = 0;
-}
-/* \\\ */
-
-/* /// "Exp1to6()" */
-static void Exp1to6(MACEContext *ctx,
- uint8_t *inBuffer,
- void *outBuffer,
- uint32_t cnt,
- uint32_t numChannels,
- uint32_t whichChannel)
-{
- uint8_t pkt;
-
-/*
- if (inState) {
- ctx->previous=inState[0];
- ctx->prev2=inState[1];
- ctx->index=inState[2];
- ctx->level=inState[3];
- ctx->factor=inState[4];
- } else
-*/
- ctx->previous=ctx->prev2=ctx->index=ctx->level=ctx->factor=0;
-
- inBuffer+=(whichChannel-1);
- ctx->outPtr=outBuffer;
-
- while (cnt>0) {
- pkt=*inBuffer;
-
- chomp6(ctx, pkt >> 5 , MACEtab1, MACEtab2, numChannels);
- chomp6(ctx,(pkt >> 3) & 3, MACEtab3, MACEtab4, numChannels);
- chomp6(ctx, pkt & 7, MACEtab1, MACEtab2, numChannels);
-
- inBuffer+=numChannels;
- --cnt;
- }
-
-/*
- if (outState) {
- outState[0]=ctx->previous;
- outState[1]=ctx->prev2;
- outState[2]=ctx->index;
- outState[3]=ctx->level;
- outState[4]=ctx->factor;
- }
-*/
-}
-/* \\\ */
-
-static int mace_decode_init(AVCodecContext * avctx)
-{
- if (avctx->channels > 2)
- return -1;
- return 0;
-}
-
-static int mace_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- short *samples;
- MACEContext *c = avctx->priv_data;
-
- samples = (short *)data;
- switch (avctx->codec->id) {
- case CODEC_ID_MACE3:
-#ifdef DEBUG
-puts("mace_decode_frame[3]()");
-#endif
- Exp1to3(c, buf, samples, buf_size / 2 / avctx->channels, avctx->channels, 1);
- if (avctx->channels == 2)
- Exp1to3(c, buf, samples+1, buf_size / 2 / 2, 2, 2);
- *data_size = 2 * 3 * buf_size;
- break;
- case CODEC_ID_MACE6:
-#ifdef DEBUG
-puts("mace_decode_frame[6]()");
-#endif
- Exp1to6(c, buf, samples, buf_size / avctx->channels, avctx->channels, 1);
- if (avctx->channels == 2)
- Exp1to6(c, buf, samples+1, buf_size / 2, 2, 2);
- *data_size = 2 * 6 * buf_size;
- break;
- default:
- return -1;
- }
- return buf_size;
-}
-
-AVCodec mace3_decoder = {
- "mace3",
- CODEC_TYPE_AUDIO,
- CODEC_ID_MACE3,
- sizeof(MACEContext),
- mace_decode_init,
- NULL,
- NULL,
- mace_decode_frame,
-};
-
-AVCodec mace6_decoder = {
- "mace6",
- CODEC_TYPE_AUDIO,
- CODEC_ID_MACE6,
- sizeof(MACEContext),
- mace_decode_init,
- NULL,
- NULL,
- mace_decode_frame,
-};
-
diff --git a/src/libffmpeg/libavcodec/mathops.h b/src/libffmpeg/libavcodec/mathops.h
deleted file mode 100644
index c6ec70597..000000000
--- a/src/libffmpeg/libavcodec/mathops.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * simple math operations
- * Copyright (c) 2001, 2002 Fabrice Bellard.
- * Copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at> et al
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#ifndef MATHOPS_H
-#define MATHOPS_H
-
-#ifdef ARCH_X86_32
-
-#include "i386/mathops.h"
-
-#elif defined(ARCH_ARMV4L)
-
-#include "armv4l/mathops.h"
-
-#elif defined(ARCH_PPC)
-
-#include "ppc/mathops.h"
-
-#endif
-
-/* generic implementation */
-
-#ifndef MULL
-# define MULL(a,b) (((int64_t)(a) * (int64_t)(b)) >> FRAC_BITS)
-#endif
-
-#ifndef MULH
-//gcc 3.4 creates an incredibly bloated mess out of this
-//# define MULH(a,b) (((int64_t)(a) * (int64_t)(b))>>32)
-
-static av_always_inline int MULH(int a, int b){
- return ((int64_t)(a) * (int64_t)(b))>>32;
-}
-#endif
-
-#ifndef MUL64
-# define MUL64(a,b) ((int64_t)(a) * (int64_t)(b))
-#endif
-
-/* signed 16x16 -> 32 multiply add accumulate */
-#ifndef MAC16
-# define MAC16(rt, ra, rb) rt += (ra) * (rb)
-#endif
-
-/* signed 16x16 -> 32 multiply */
-#ifndef MUL16
-# define MUL16(ra, rb) ((ra) * (rb))
-#endif
-
-#endif //MATHOPS_H
-
diff --git a/src/libffmpeg/libavcodec/mdct.c b/src/libffmpeg/libavcodec/mdct.c
deleted file mode 100644
index de3275289..000000000
--- a/src/libffmpeg/libavcodec/mdct.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * MDCT/IMDCT transforms
- * Copyright (c) 2002 Fabrice Bellard.
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "dsputil.h"
-
-/**
- * @file mdct.c
- * MDCT/IMDCT transforms.
- */
-
-/**
- * init MDCT or IMDCT computation.
- */
-int ff_mdct_init(MDCTContext *s, int nbits, int inverse)
-{
- int n, n4, i;
- float alpha;
-
- memset(s, 0, sizeof(*s));
- n = 1 << nbits;
- s->nbits = nbits;
- s->n = n;
- n4 = n >> 2;
- s->tcos = av_malloc(n4 * sizeof(FFTSample));
- if (!s->tcos)
- goto fail;
- s->tsin = av_malloc(n4 * sizeof(FFTSample));
- if (!s->tsin)
- goto fail;
-
- for(i=0;i<n4;i++) {
- alpha = 2 * M_PI * (i + 1.0 / 8.0) / n;
- s->tcos[i] = -cos(alpha);
- s->tsin[i] = -sin(alpha);
- }
- if (ff_fft_init(&s->fft, s->nbits - 2, inverse) < 0)
- goto fail;
- return 0;
- fail:
- av_freep(&s->tcos);
- av_freep(&s->tsin);
- return -1;
-}
-
-/* complex multiplication: p = a * b */
-#define CMUL(pre, pim, are, aim, bre, bim) \
-{\
- float _are = (are);\
- float _aim = (aim);\
- float _bre = (bre);\
- float _bim = (bim);\
- (pre) = _are * _bre - _aim * _bim;\
- (pim) = _are * _bim + _aim * _bre;\
-}
-
-/**
- * Compute inverse MDCT of size N = 2^nbits
- * @param output N samples
- * @param input N/2 samples
- * @param tmp N/2 samples
- */
-void ff_imdct_calc(MDCTContext *s, FFTSample *output,
- const FFTSample *input, FFTSample *tmp)
-{
- int k, n8, n4, n2, n, j;
- const uint16_t *revtab = s->fft.revtab;
- const FFTSample *tcos = s->tcos;
- const FFTSample *tsin = s->tsin;
- const FFTSample *in1, *in2;
- FFTComplex *z = (FFTComplex *)tmp;
-
- n = 1 << s->nbits;
- n2 = n >> 1;
- n4 = n >> 2;
- n8 = n >> 3;
-
- /* pre rotation */
- in1 = input;
- in2 = input + n2 - 1;
- for(k = 0; k < n4; k++) {
- j=revtab[k];
- CMUL(z[j].re, z[j].im, *in2, *in1, tcos[k], tsin[k]);
- in1 += 2;
- in2 -= 2;
- }
- ff_fft_calc(&s->fft, z);
-
- /* post rotation + reordering */
- /* XXX: optimize */
- for(k = 0; k < n4; k++) {
- CMUL(z[k].re, z[k].im, z[k].re, z[k].im, tcos[k], tsin[k]);
- }
- for(k = 0; k < n8; k++) {
- output[2*k] = -z[n8 + k].im;
- output[n2-1-2*k] = z[n8 + k].im;
-
- output[2*k+1] = z[n8-1-k].re;
- output[n2-1-2*k-1] = -z[n8-1-k].re;
-
- output[n2 + 2*k]=-z[k+n8].re;
- output[n-1- 2*k]=-z[k+n8].re;
-
- output[n2 + 2*k+1]=z[n8-k-1].im;
- output[n-2 - 2 * k] = z[n8-k-1].im;
- }
-}
-
-/**
- * Compute MDCT of size N = 2^nbits
- * @param input N samples
- * @param out N/2 samples
- * @param tmp temporary storage of N/2 samples
- */
-void ff_mdct_calc(MDCTContext *s, FFTSample *out,
- const FFTSample *input, FFTSample *tmp)
-{
- int i, j, n, n8, n4, n2, n3;
- FFTSample re, im, re1, im1;
- const uint16_t *revtab = s->fft.revtab;
- const FFTSample *tcos = s->tcos;
- const FFTSample *tsin = s->tsin;
- FFTComplex *x = (FFTComplex *)tmp;
-
- n = 1 << s->nbits;
- n2 = n >> 1;
- n4 = n >> 2;
- n8 = n >> 3;
- n3 = 3 * n4;
-
- /* pre rotation */
- for(i=0;i<n8;i++) {
- re = -input[2*i+3*n4] - input[n3-1-2*i];
- im = -input[n4+2*i] + input[n4-1-2*i];
- j = revtab[i];
- CMUL(x[j].re, x[j].im, re, im, -tcos[i], tsin[i]);
-
- re = input[2*i] - input[n2-1-2*i];
- im = -(input[n2+2*i] + input[n-1-2*i]);
- j = revtab[n8 + i];
- CMUL(x[j].re, x[j].im, re, im, -tcos[n8 + i], tsin[n8 + i]);
- }
-
- ff_fft_calc(&s->fft, x);
-
- /* post rotation */
- for(i=0;i<n4;i++) {
- re = x[i].re;
- im = x[i].im;
- CMUL(re1, im1, re, im, -tsin[i], -tcos[i]);
- out[2*i] = im1;
- out[n2-1-2*i] = re1;
- }
-}
-
-void ff_mdct_end(MDCTContext *s)
-{
- av_freep(&s->tcos);
- av_freep(&s->tsin);
- ff_fft_end(&s->fft);
-}
diff --git a/src/libffmpeg/libavcodec/mdec.c b/src/libffmpeg/libavcodec/mdec.c
deleted file mode 100644
index ee43b2777..000000000
--- a/src/libffmpeg/libavcodec/mdec.c
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- * PSX MDEC codec
- * Copyright (c) 2003 Michael Niedermayer
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * based upon code from Sebastian Jedruszkiewicz <elf@frogger.rules.pl>
- */
-
-/**
- * @file mdec.c
- * PSX MDEC codec.
- * This is very similar to intra only MPEG1.
- */
-
-#include "avcodec.h"
-#include "dsputil.h"
-#include "mpegvideo.h"
-
-//#undef NDEBUG
-//#include <assert.h>
-
-typedef struct MDECContext{
- AVCodecContext *avctx;
- DSPContext dsp;
- AVFrame picture;
- PutBitContext pb;
- GetBitContext gb;
- ScanTable scantable;
- int version;
- int qscale;
- int last_dc[3];
- int mb_width;
- int mb_height;
- int mb_x, mb_y;
- DECLARE_ALIGNED_8(DCTELEM, block[6][64]);
- DECLARE_ALIGNED_8(uint16_t, intra_matrix[64]);
- DECLARE_ALIGNED_8(int, q_intra_matrix[64]);
- uint8_t *bitstream_buffer;
- unsigned int bitstream_buffer_size;
- int block_last_index[6];
-} MDECContext;
-
-//very similar to mpeg1
-static inline int mdec_decode_block_intra(MDECContext *a, DCTELEM *block, int n)
-{
- int level, diff, i, j, run;
- int component;
- RLTable *rl = &rl_mpeg1;
- uint8_t * const scantable= a->scantable.permutated;
- const uint16_t *quant_matrix= ff_mpeg1_default_intra_matrix;
- const int qscale= a->qscale;
-
- /* DC coef */
- if(a->version==2){
- block[0]= 2*get_sbits(&a->gb, 10) + 1024;
- }else{
- component = (n <= 3 ? 0 : n - 4 + 1);
- diff = decode_dc(&a->gb, component);
- if (diff >= 0xffff)
- return -1;
- a->last_dc[component]+= diff;
- block[0] = a->last_dc[component]<<3;
- }
-
- i = 0;
- {
- OPEN_READER(re, &a->gb);
- /* now quantify & encode AC coefs */
- for(;;) {
- UPDATE_CACHE(re, &a->gb);
- GET_RL_VLC(level, run, re, &a->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0);
-
- if(level == 127){
- break;
- } else if(level != 0) {
- i += run;
- j = scantable[i];
- level= (level*qscale*quant_matrix[j])>>3;
-// level= (level-1)|1;
- level = (level ^ SHOW_SBITS(re, &a->gb, 1)) - SHOW_SBITS(re, &a->gb, 1);
- LAST_SKIP_BITS(re, &a->gb, 1);
- } else {
- /* escape */
- run = SHOW_UBITS(re, &a->gb, 6)+1; LAST_SKIP_BITS(re, &a->gb, 6);
- UPDATE_CACHE(re, &a->gb);
- level = SHOW_SBITS(re, &a->gb, 10); SKIP_BITS(re, &a->gb, 10);
- i += run;
- j = scantable[i];
- if(level<0){
- level= -level;
- level= (level*qscale*quant_matrix[j])>>3;
- level= (level-1)|1;
- level= -level;
- }else{
- level= (level*qscale*quant_matrix[j])>>3;
- level= (level-1)|1;
- }
- }
- if (i > 63){
- av_log(a->avctx, AV_LOG_ERROR, "ac-tex damaged at %d %d\n", a->mb_x, a->mb_y);
- return -1;
- }
-
- block[j] = level;
- }
- CLOSE_READER(re, &a->gb);
- }
- a->block_last_index[n] = i;
- return 0;
-}
-
-static inline int decode_mb(MDECContext *a, DCTELEM block[6][64]){
- int i;
- const int block_index[6]= {5,4,0,1,2,3};
-
- a->dsp.clear_blocks(block[0]);
-
- for(i=0; i<6; i++){
- if( mdec_decode_block_intra(a, block[ block_index[i] ], block_index[i]) < 0)
- return -1;
- }
- return 0;
-}
-
-static inline void idct_put(MDECContext *a, int mb_x, int mb_y){
- DCTELEM (*block)[64]= a->block;
- int linesize= a->picture.linesize[0];
-
- uint8_t *dest_y = a->picture.data[0] + (mb_y * 16* linesize ) + mb_x * 16;
- uint8_t *dest_cb = a->picture.data[1] + (mb_y * 8 * a->picture.linesize[1]) + mb_x * 8;
- uint8_t *dest_cr = a->picture.data[2] + (mb_y * 8 * a->picture.linesize[2]) + mb_x * 8;
-
- a->dsp.idct_put(dest_y , linesize, block[0]);
- a->dsp.idct_put(dest_y + 8, linesize, block[1]);
- a->dsp.idct_put(dest_y + 8*linesize , linesize, block[2]);
- a->dsp.idct_put(dest_y + 8*linesize + 8, linesize, block[3]);
-
- if(!(a->avctx->flags&CODEC_FLAG_GRAY)){
- a->dsp.idct_put(dest_cb, a->picture.linesize[1], block[4]);
- a->dsp.idct_put(dest_cr, a->picture.linesize[2], block[5]);
- }
-}
-
-static int decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- MDECContext * const a = avctx->priv_data;
- AVFrame *picture = data;
- AVFrame * const p= (AVFrame*)&a->picture;
- int i;
-
- if(p->data[0])
- avctx->release_buffer(avctx, p);
-
- p->reference= 0;
- if(avctx->get_buffer(avctx, p) < 0){
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
- p->pict_type= I_TYPE;
- p->key_frame= 1;
- a->last_dc[0]=
- a->last_dc[1]=
- a->last_dc[2]= 0;
-
- a->bitstream_buffer= av_fast_realloc(a->bitstream_buffer, &a->bitstream_buffer_size, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
- for(i=0; i<buf_size; i+=2){
- a->bitstream_buffer[i] = buf[i+1];
- a->bitstream_buffer[i+1]= buf[i ];
- }
- init_get_bits(&a->gb, a->bitstream_buffer, buf_size*8);
-
- /* skip over 4 preamble bytes in stream (typically 0xXX 0xXX 0x00 0x38) */
- skip_bits(&a->gb, 32);
-
- a->qscale= get_bits(&a->gb, 16);
- a->version= get_bits(&a->gb, 16);
-
-// printf("qscale:%d (0x%X), version:%d (0x%X)\n", a->qscale, a->qscale, a->version, a->version);
-
- for(a->mb_x=0; a->mb_x<a->mb_width; a->mb_x++){
- for(a->mb_y=0; a->mb_y<a->mb_height; a->mb_y++){
- if( decode_mb(a, a->block) <0)
- return -1;
-
- idct_put(a, a->mb_x, a->mb_y);
- }
- }
-
-// p->quality= (32 + a->inv_qscale/2)/a->inv_qscale;
-// memset(p->qscale_table, p->quality, p->qstride*a->mb_height);
-
- *picture= *(AVFrame*)&a->picture;
- *data_size = sizeof(AVPicture);
-
- emms_c();
-
- return (get_bits_count(&a->gb)+31)/32*4;
-}
-
-static void mdec_common_init(AVCodecContext *avctx){
- MDECContext * const a = avctx->priv_data;
-
- dsputil_init(&a->dsp, avctx);
-
- a->mb_width = (avctx->coded_width + 15) / 16;
- a->mb_height = (avctx->coded_height + 15) / 16;
-
- avctx->coded_frame= (AVFrame*)&a->picture;
- a->avctx= avctx;
-}
-
-static int decode_init(AVCodecContext *avctx){
- MDECContext * const a = avctx->priv_data;
- AVFrame *p= (AVFrame*)&a->picture;
-
- mdec_common_init(avctx);
- init_vlcs();
- ff_init_scantable(a->dsp.idct_permutation, &a->scantable, ff_zigzag_direct);
-/*
- for(i=0; i<64; i++){
- int index= ff_zigzag_direct[i];
- a->intra_matrix[i]= 64*ff_mpeg1_default_intra_matrix[index] / a->inv_qscale;
- }
-*/
- p->qstride= a->mb_width;
- p->qscale_table= av_mallocz( p->qstride * a->mb_height);
- avctx->pix_fmt= PIX_FMT_YUV420P;
-
- return 0;
-}
-
-static int decode_end(AVCodecContext *avctx){
- MDECContext * const a = avctx->priv_data;
-
- av_freep(&a->bitstream_buffer);
- av_freep(&a->picture.qscale_table);
- a->bitstream_buffer_size=0;
-
- return 0;
-}
-
-AVCodec mdec_decoder = {
- "mdec",
- CODEC_TYPE_VIDEO,
- CODEC_ID_MDEC,
- sizeof(MDECContext),
- decode_init,
- NULL,
- decode_end,
- decode_frame,
- CODEC_CAP_DR1,
-};
-
diff --git a/src/libffmpeg/libavcodec/mjpeg.c b/src/libffmpeg/libavcodec/mjpeg.c
deleted file mode 100644
index 3d4dd9cc4..000000000
--- a/src/libffmpeg/libavcodec/mjpeg.c
+++ /dev/null
@@ -1,2632 +0,0 @@
-/*
- * MJPEG encoder and decoder
- * Copyright (c) 2000, 2001 Fabrice Bellard.
- * Copyright (c) 2003 Alex Beregszaszi
- * Copyright (c) 2003-2004 Michael Niedermayer
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Support for external huffman table, various fixes (AVID workaround),
- * aspecting, new decode_frame mechanism and apple mjpeg-b support
- * by Alex Beregszaszi <alex@naxine.org>
- */
-
-/**
- * @file mjpeg.c
- * MJPEG encoder and decoder.
- */
-
-//#define DEBUG
-#include <assert.h>
-
-#include "avcodec.h"
-#include "dsputil.h"
-#include "mpegvideo.h"
-#include "bytestream.h"
-
-/* if xine's MPEG encoder is enabled, enable the encoding features in
- * this particular module */
-#if defined(XINE_MPEG_ENCODER) && !defined(CONFIG_ENCODERS)
-#define CONFIG_ENCODERS
-#endif
-
-
-/* use two quantizer tables (one for luminance and one for chrominance) */
-/* not yet working */
-#undef TWOMATRIXES
-
-typedef struct MJpegContext {
- uint8_t huff_size_dc_luminance[12]; //FIXME use array [3] instead of lumi / chrom, for easier addressing
- uint16_t huff_code_dc_luminance[12];
- uint8_t huff_size_dc_chrominance[12];
- uint16_t huff_code_dc_chrominance[12];
-
- uint8_t huff_size_ac_luminance[256];
- uint16_t huff_code_ac_luminance[256];
- uint8_t huff_size_ac_chrominance[256];
- uint16_t huff_code_ac_chrominance[256];
-} MJpegContext;
-
-/* JPEG marker codes */
-typedef enum {
- /* start of frame */
- SOF0 = 0xc0, /* baseline */
- SOF1 = 0xc1, /* extended sequential, huffman */
- SOF2 = 0xc2, /* progressive, huffman */
- SOF3 = 0xc3, /* lossless, huffman */
-
- SOF5 = 0xc5, /* differential sequential, huffman */
- SOF6 = 0xc6, /* differential progressive, huffman */
- SOF7 = 0xc7, /* differential lossless, huffman */
- JPG = 0xc8, /* reserved for JPEG extension */
- SOF9 = 0xc9, /* extended sequential, arithmetic */
- SOF10 = 0xca, /* progressive, arithmetic */
- SOF11 = 0xcb, /* lossless, arithmetic */
-
- SOF13 = 0xcd, /* differential sequential, arithmetic */
- SOF14 = 0xce, /* differential progressive, arithmetic */
- SOF15 = 0xcf, /* differential lossless, arithmetic */
-
- DHT = 0xc4, /* define huffman tables */
-
- DAC = 0xcc, /* define arithmetic-coding conditioning */
-
- /* restart with modulo 8 count "m" */
- RST0 = 0xd0,
- RST1 = 0xd1,
- RST2 = 0xd2,
- RST3 = 0xd3,
- RST4 = 0xd4,
- RST5 = 0xd5,
- RST6 = 0xd6,
- RST7 = 0xd7,
-
- SOI = 0xd8, /* start of image */
- EOI = 0xd9, /* end of image */
- SOS = 0xda, /* start of scan */
- DQT = 0xdb, /* define quantization tables */
- DNL = 0xdc, /* define number of lines */
- DRI = 0xdd, /* define restart interval */
- DHP = 0xde, /* define hierarchical progression */
- EXP = 0xdf, /* expand reference components */
-
- APP0 = 0xe0,
- APP1 = 0xe1,
- APP2 = 0xe2,
- APP3 = 0xe3,
- APP4 = 0xe4,
- APP5 = 0xe5,
- APP6 = 0xe6,
- APP7 = 0xe7,
- APP8 = 0xe8,
- APP9 = 0xe9,
- APP10 = 0xea,
- APP11 = 0xeb,
- APP12 = 0xec,
- APP13 = 0xed,
- APP14 = 0xee,
- APP15 = 0xef,
-
- JPG0 = 0xf0,
- JPG1 = 0xf1,
- JPG2 = 0xf2,
- JPG3 = 0xf3,
- JPG4 = 0xf4,
- JPG5 = 0xf5,
- JPG6 = 0xf6,
- SOF48 = 0xf7, ///< JPEG-LS
- LSE = 0xf8, ///< JPEG-LS extension parameters
- JPG9 = 0xf9,
- JPG10 = 0xfa,
- JPG11 = 0xfb,
- JPG12 = 0xfc,
- JPG13 = 0xfd,
-
- COM = 0xfe, /* comment */
-
- TEM = 0x01, /* temporary private use for arithmetic coding */
-
- /* 0x02 -> 0xbf reserved */
-} JPEG_MARKER;
-
-#if 0
-/* These are the sample quantization tables given in JPEG spec section K.1.
- * The spec says that the values given produce "good" quality, and
- * when divided by 2, "very good" quality.
- */
-static const unsigned char std_luminance_quant_tbl[64] = {
- 16, 11, 10, 16, 24, 40, 51, 61,
- 12, 12, 14, 19, 26, 58, 60, 55,
- 14, 13, 16, 24, 40, 57, 69, 56,
- 14, 17, 22, 29, 51, 87, 80, 62,
- 18, 22, 37, 56, 68, 109, 103, 77,
- 24, 35, 55, 64, 81, 104, 113, 92,
- 49, 64, 78, 87, 103, 121, 120, 101,
- 72, 92, 95, 98, 112, 100, 103, 99
-};
-static const unsigned char std_chrominance_quant_tbl[64] = {
- 17, 18, 24, 47, 99, 99, 99, 99,
- 18, 21, 26, 66, 99, 99, 99, 99,
- 24, 26, 56, 99, 99, 99, 99, 99,
- 47, 66, 99, 99, 99, 99, 99, 99,
- 99, 99, 99, 99, 99, 99, 99, 99,
- 99, 99, 99, 99, 99, 99, 99, 99,
- 99, 99, 99, 99, 99, 99, 99, 99,
- 99, 99, 99, 99, 99, 99, 99, 99
-};
-#endif
-
-/* Set up the standard Huffman tables (cf. JPEG standard section K.3) */
-/* IMPORTANT: these are only valid for 8-bit data precision! */
-static const uint8_t bits_dc_luminance[17] =
-{ /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };
-static const uint8_t val_dc_luminance[] =
-{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
-
-static const uint8_t bits_dc_chrominance[17] =
-{ /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 };
-static const uint8_t val_dc_chrominance[] =
-{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
-
-static const uint8_t bits_ac_luminance[17] =
-{ /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d };
-static const uint8_t val_ac_luminance[] =
-{ 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
- 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,
- 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,
- 0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0,
- 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16,
- 0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28,
- 0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
- 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
- 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,
- 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
- 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
- 0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
- 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
- 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
- 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,
- 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5,
- 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4,
- 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,
- 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,
- 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
- 0xf9, 0xfa
-};
-
-static const uint8_t bits_ac_chrominance[17] =
-{ /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 };
-
-static const uint8_t val_ac_chrominance[] =
-{ 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,
- 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,
- 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,
- 0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0,
- 0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34,
- 0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26,
- 0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38,
- 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
- 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
- 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
- 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
- 0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
- 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96,
- 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5,
- 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4,
- 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3,
- 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2,
- 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda,
- 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
- 0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
- 0xf9, 0xfa
-};
-
-/* isn't this function nicer than the one in the libjpeg ? */
-static void build_huffman_codes(uint8_t *huff_size, uint16_t *huff_code,
- const uint8_t *bits_table, const uint8_t *val_table)
-{
- int i, j, k,nb, code, sym;
-
- code = 0;
- k = 0;
- for(i=1;i<=16;i++) {
- nb = bits_table[i];
- for(j=0;j<nb;j++) {
- sym = val_table[k++];
- huff_size[sym] = i;
- huff_code[sym] = code;
- code++;
- }
- code <<= 1;
- }
-}
-
-#ifdef CONFIG_ENCODERS
-int mjpeg_init(MpegEncContext *s)
-{
- MJpegContext *m;
-
- m = av_malloc(sizeof(MJpegContext));
- if (!m)
- return -1;
-
- s->min_qcoeff=-1023;
- s->max_qcoeff= 1023;
-
- /* build all the huffman tables */
- build_huffman_codes(m->huff_size_dc_luminance,
- m->huff_code_dc_luminance,
- bits_dc_luminance,
- val_dc_luminance);
- build_huffman_codes(m->huff_size_dc_chrominance,
- m->huff_code_dc_chrominance,
- bits_dc_chrominance,
- val_dc_chrominance);
- build_huffman_codes(m->huff_size_ac_luminance,
- m->huff_code_ac_luminance,
- bits_ac_luminance,
- val_ac_luminance);
- build_huffman_codes(m->huff_size_ac_chrominance,
- m->huff_code_ac_chrominance,
- bits_ac_chrominance,
- val_ac_chrominance);
-
- s->mjpeg_ctx = m;
- return 0;
-}
-
-void mjpeg_close(MpegEncContext *s)
-{
- av_free(s->mjpeg_ctx);
-}
-#endif //CONFIG_ENCODERS
-
-#define PREDICT(ret, topleft, top, left, predictor)\
- switch(predictor){\
- case 1: ret= left; break;\
- case 2: ret= top; break;\
- case 3: ret= topleft; break;\
- case 4: ret= left + top - topleft; break;\
- case 5: ret= left + ((top - topleft)>>1); break;\
- case 6: ret= top + ((left - topleft)>>1); break;\
- default:\
- case 7: ret= (left + top)>>1; break;\
- }
-
-#ifdef CONFIG_ENCODERS
-static inline void put_marker(PutBitContext *p, int code)
-{
- put_bits(p, 8, 0xff);
- put_bits(p, 8, code);
-}
-
-/* table_class: 0 = DC coef, 1 = AC coefs */
-static int put_huffman_table(MpegEncContext *s, int table_class, int table_id,
- const uint8_t *bits_table, const uint8_t *value_table)
-{
- PutBitContext *p = &s->pb;
- int n, i;
-
- put_bits(p, 4, table_class);
- put_bits(p, 4, table_id);
-
- n = 0;
- for(i=1;i<=16;i++) {
- n += bits_table[i];
- put_bits(p, 8, bits_table[i]);
- }
-
- for(i=0;i<n;i++)
- put_bits(p, 8, value_table[i]);
-
- return n + 17;
-}
-
-static void jpeg_table_header(MpegEncContext *s)
-{
- PutBitContext *p = &s->pb;
- int i, j, size;
- uint8_t *ptr;
-
- /* quant matrixes */
- put_marker(p, DQT);
-#ifdef TWOMATRIXES
- put_bits(p, 16, 2 + 2 * (1 + 64));
-#else
- put_bits(p, 16, 2 + 1 * (1 + 64));
-#endif
- put_bits(p, 4, 0); /* 8 bit precision */
- put_bits(p, 4, 0); /* table 0 */
- for(i=0;i<64;i++) {
- j = s->intra_scantable.permutated[i];
- put_bits(p, 8, s->intra_matrix[j]);
- }
-#ifdef TWOMATRIXES
- put_bits(p, 4, 0); /* 8 bit precision */
- put_bits(p, 4, 1); /* table 1 */
- for(i=0;i<64;i++) {
- j = s->intra_scantable.permutated[i];
- put_bits(p, 8, s->chroma_intra_matrix[j]);
- }
-#endif
-
- /* huffman table */
- put_marker(p, DHT);
- flush_put_bits(p);
- ptr = pbBufPtr(p);
- put_bits(p, 16, 0); /* patched later */
- size = 2;
- size += put_huffman_table(s, 0, 0, bits_dc_luminance, val_dc_luminance);
- size += put_huffman_table(s, 0, 1, bits_dc_chrominance, val_dc_chrominance);
-
- size += put_huffman_table(s, 1, 0, bits_ac_luminance, val_ac_luminance);
- size += put_huffman_table(s, 1, 1, bits_ac_chrominance, val_ac_chrominance);
- ptr[0] = size >> 8;
- ptr[1] = size;
-}
-
-static void jpeg_put_comments(MpegEncContext *s)
-{
- PutBitContext *p = &s->pb;
- int size;
- uint8_t *ptr;
-
- if (s->aspect_ratio_info /* && !lossless */)
- {
- /* JFIF header */
- put_marker(p, APP0);
- put_bits(p, 16, 16);
- ff_put_string(p, "JFIF", 1); /* this puts the trailing zero-byte too */
- put_bits(p, 16, 0x0201); /* v 1.02 */
- put_bits(p, 8, 0); /* units type: 0 - aspect ratio */
- put_bits(p, 16, s->avctx->sample_aspect_ratio.num);
- put_bits(p, 16, s->avctx->sample_aspect_ratio.den);
- put_bits(p, 8, 0); /* thumbnail width */
- put_bits(p, 8, 0); /* thumbnail height */
- }
-
- /* comment */
- if(!(s->flags & CODEC_FLAG_BITEXACT)){
- put_marker(p, COM);
- flush_put_bits(p);
- ptr = pbBufPtr(p);
- put_bits(p, 16, 0); /* patched later */
- ff_put_string(p, LIBAVCODEC_IDENT, 1);
- size = strlen(LIBAVCODEC_IDENT)+3;
- ptr[0] = size >> 8;
- ptr[1] = size;
- }
-
- if( s->avctx->pix_fmt == PIX_FMT_YUV420P
- ||s->avctx->pix_fmt == PIX_FMT_YUV422P
- ||s->avctx->pix_fmt == PIX_FMT_YUV444P){
- put_marker(p, COM);
- flush_put_bits(p);
- ptr = pbBufPtr(p);
- put_bits(p, 16, 0); /* patched later */
- ff_put_string(p, "CS=ITU601", 1);
- size = strlen("CS=ITU601")+3;
- ptr[0] = size >> 8;
- ptr[1] = size;
- }
-}
-
-void mjpeg_picture_header(MpegEncContext *s)
-{
- const int lossless= s->avctx->codec_id != CODEC_ID_MJPEG;
- const int ls = s->avctx->codec_id == CODEC_ID_JPEGLS;
-
- assert(!(ls && s->mjpeg_write_tables));
-
- put_marker(&s->pb, SOI);
-
- if (!s->mjpeg_data_only_frames)
- {
- jpeg_put_comments(s);
-
- if (s->mjpeg_write_tables) jpeg_table_header(s);
-
- switch(s->avctx->codec_id){
- case CODEC_ID_MJPEG: put_marker(&s->pb, SOF0 ); break;
- case CODEC_ID_LJPEG: put_marker(&s->pb, SOF3 ); break;
- case CODEC_ID_JPEGLS: put_marker(&s->pb, SOF48); break;
- default: assert(0);
- }
-
- put_bits(&s->pb, 16, 17);
- if(lossless && s->avctx->pix_fmt == PIX_FMT_RGBA32)
- put_bits(&s->pb, 8, 9); /* 9 bits/component RCT */
- else
- put_bits(&s->pb, 8, 8); /* 8 bits/component */
- put_bits(&s->pb, 16, s->height);
- put_bits(&s->pb, 16, s->width);
- put_bits(&s->pb, 8, 3); /* 3 components */
-
- /* Y component */
- put_bits(&s->pb, 8, 1); /* component number */
- put_bits(&s->pb, 4, s->mjpeg_hsample[0]); /* H factor */
- put_bits(&s->pb, 4, s->mjpeg_vsample[0]); /* V factor */
- put_bits(&s->pb, 8, 0); /* select matrix */
-
- /* Cb component */
- put_bits(&s->pb, 8, 2); /* component number */
- put_bits(&s->pb, 4, s->mjpeg_hsample[1]); /* H factor */
- put_bits(&s->pb, 4, s->mjpeg_vsample[1]); /* V factor */
-#ifdef TWOMATRIXES
- put_bits(&s->pb, 8, lossless ? 0 : 1); /* select matrix */
-#else
- put_bits(&s->pb, 8, 0); /* select matrix */
-#endif
-
- /* Cr component */
- put_bits(&s->pb, 8, 3); /* component number */
- put_bits(&s->pb, 4, s->mjpeg_hsample[2]); /* H factor */
- put_bits(&s->pb, 4, s->mjpeg_vsample[2]); /* V factor */
-#ifdef TWOMATRIXES
- put_bits(&s->pb, 8, lossless ? 0 : 1); /* select matrix */
-#else
- put_bits(&s->pb, 8, 0); /* select matrix */
-#endif
- }
-
- /* scan header */
- put_marker(&s->pb, SOS);
- put_bits(&s->pb, 16, 12); /* length */
- put_bits(&s->pb, 8, 3); /* 3 components */
-
- /* Y component */
- put_bits(&s->pb, 8, 1); /* index */
- put_bits(&s->pb, 4, 0); /* DC huffman table index */
- put_bits(&s->pb, 4, 0); /* AC huffman table index */
-
- /* Cb component */
- put_bits(&s->pb, 8, 2); /* index */
- put_bits(&s->pb, 4, 1); /* DC huffman table index */
- put_bits(&s->pb, 4, lossless ? 0 : 1); /* AC huffman table index */
-
- /* Cr component */
- put_bits(&s->pb, 8, 3); /* index */
- put_bits(&s->pb, 4, 1); /* DC huffman table index */
- put_bits(&s->pb, 4, lossless ? 0 : 1); /* AC huffman table index */
-
- put_bits(&s->pb, 8, (lossless && !ls) ? s->avctx->prediction_method+1 : 0); /* Ss (not used) */
-
- switch(s->avctx->codec_id){
- case CODEC_ID_MJPEG: put_bits(&s->pb, 8, 63); break; /* Se (not used) */
- case CODEC_ID_LJPEG: put_bits(&s->pb, 8, 0); break; /* not used */
- case CODEC_ID_JPEGLS: put_bits(&s->pb, 8, 1); break; /* ILV = line interleaved */
- default: assert(0);
- }
-
- put_bits(&s->pb, 8, 0); /* Ah/Al (not used) */
-
- //FIXME DC/AC entropy table selectors stuff in jpegls
-}
-
-static void escape_FF(MpegEncContext *s, int start)
-{
- int size= put_bits_count(&s->pb) - start*8;
- int i, ff_count;
- uint8_t *buf= s->pb.buf + start;
- int align= (-(size_t)(buf))&3;
-
- assert((size&7) == 0);
- size >>= 3;
-
- ff_count=0;
- for(i=0; i<size && i<align; i++){
- if(buf[i]==0xFF) ff_count++;
- }
- for(; i<size-15; i+=16){
- int acc, v;
-
- v= *(uint32_t*)(&buf[i]);
- acc= (((v & (v>>4))&0x0F0F0F0F)+0x01010101)&0x10101010;
- v= *(uint32_t*)(&buf[i+4]);
- acc+=(((v & (v>>4))&0x0F0F0F0F)+0x01010101)&0x10101010;
- v= *(uint32_t*)(&buf[i+8]);
- acc+=(((v & (v>>4))&0x0F0F0F0F)+0x01010101)&0x10101010;
- v= *(uint32_t*)(&buf[i+12]);
- acc+=(((v & (v>>4))&0x0F0F0F0F)+0x01010101)&0x10101010;
-
- acc>>=4;
- acc+= (acc>>16);
- acc+= (acc>>8);
- ff_count+= acc&0xFF;
- }
- for(; i<size; i++){
- if(buf[i]==0xFF) ff_count++;
- }
-
- if(ff_count==0) return;
-
- /* skip put bits */
- for(i=0; i<ff_count-3; i+=4)
- put_bits(&s->pb, 32, 0);
- put_bits(&s->pb, (ff_count-i)*8, 0);
- flush_put_bits(&s->pb);
-
- for(i=size-1; ff_count; i--){
- int v= buf[i];
-
- if(v==0xFF){
-//printf("%d %d\n", i, ff_count);
- buf[i+ff_count]= 0;
- ff_count--;
- }
-
- buf[i+ff_count]= v;
- }
-}
-
-void ff_mjpeg_stuffing(PutBitContext * pbc)
-{
- int length;
- length= (-put_bits_count(pbc))&7;
- if(length) put_bits(pbc, length, (1<<length)-1);
-}
-
-void mjpeg_picture_trailer(MpegEncContext *s)
-{
- ff_mjpeg_stuffing(&s->pb);
- flush_put_bits(&s->pb);
-
- assert((s->header_bits&7)==0);
-
- escape_FF(s, s->header_bits>>3);
-
- put_marker(&s->pb, EOI);
-}
-
-static inline void mjpeg_encode_dc(MpegEncContext *s, int val,
- uint8_t *huff_size, uint16_t *huff_code)
-{
- int mant, nbits;
-
- if (val == 0) {
- put_bits(&s->pb, huff_size[0], huff_code[0]);
- } else {
- mant = val;
- if (val < 0) {
- val = -val;
- mant--;
- }
-
- nbits= av_log2_16bit(val) + 1;
-
- put_bits(&s->pb, huff_size[nbits], huff_code[nbits]);
-
- put_bits(&s->pb, nbits, mant & ((1 << nbits) - 1));
- }
-}
-
-static void encode_block(MpegEncContext *s, DCTELEM *block, int n)
-{
- int mant, nbits, code, i, j;
- int component, dc, run, last_index, val;
- MJpegContext *m = s->mjpeg_ctx;
- uint8_t *huff_size_ac;
- uint16_t *huff_code_ac;
-
- /* DC coef */
- component = (n <= 3 ? 0 : (n&1) + 1);
- dc = block[0]; /* overflow is impossible */
- val = dc - s->last_dc[component];
- if (n < 4) {
- mjpeg_encode_dc(s, val, m->huff_size_dc_luminance, m->huff_code_dc_luminance);
- huff_size_ac = m->huff_size_ac_luminance;
- huff_code_ac = m->huff_code_ac_luminance;
- } else {
- mjpeg_encode_dc(s, val, m->huff_size_dc_chrominance, m->huff_code_dc_chrominance);
- huff_size_ac = m->huff_size_ac_chrominance;
- huff_code_ac = m->huff_code_ac_chrominance;
- }
- s->last_dc[component] = dc;
-
- /* AC coefs */
-
- run = 0;
- last_index = s->block_last_index[n];
- for(i=1;i<=last_index;i++) {
- j = s->intra_scantable.permutated[i];
- val = block[j];
- if (val == 0) {
- run++;
- } else {
- while (run >= 16) {
- put_bits(&s->pb, huff_size_ac[0xf0], huff_code_ac[0xf0]);
- run -= 16;
- }
- mant = val;
- if (val < 0) {
- val = -val;
- mant--;
- }
-
- nbits= av_log2(val) + 1;
- code = (run << 4) | nbits;
-
- put_bits(&s->pb, huff_size_ac[code], huff_code_ac[code]);
-
- put_bits(&s->pb, nbits, mant & ((1 << nbits) - 1));
- run = 0;
- }
- }
-
- /* output EOB only if not already 64 values */
- if (last_index < 63 || run != 0)
- put_bits(&s->pb, huff_size_ac[0], huff_code_ac[0]);
-}
-
-void mjpeg_encode_mb(MpegEncContext *s,
- DCTELEM block[6][64])
-{
- int i;
- for(i=0;i<5;i++) {
- encode_block(s, block[i], i);
- }
- if (s->chroma_format == CHROMA_420) {
- encode_block(s, block[5], 5);
- } else {
- encode_block(s, block[6], 6);
- encode_block(s, block[5], 5);
- encode_block(s, block[7], 7);
- }
-}
-
-static int encode_picture_lossless(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){
- MpegEncContext * const s = avctx->priv_data;
- MJpegContext * const m = s->mjpeg_ctx;
- AVFrame *pict = data;
- const int width= s->width;
- const int height= s->height;
- AVFrame * const p= (AVFrame*)&s->current_picture;
- const int predictor= avctx->prediction_method+1;
-
- init_put_bits(&s->pb, buf, buf_size);
-
- *p = *pict;
- p->pict_type= FF_I_TYPE;
- p->key_frame= 1;
-
- mjpeg_picture_header(s);
-
- s->header_bits= put_bits_count(&s->pb);
-
- if(avctx->pix_fmt == PIX_FMT_RGBA32){
- int x, y, i;
- const int linesize= p->linesize[0];
- uint16_t (*buffer)[4]= (void *) s->rd_scratchpad;
- int left[3], top[3], topleft[3];
-
- for(i=0; i<3; i++){
- buffer[0][i]= 1 << (9 - 1);
- }
-
- for(y = 0; y < height; y++) {
- const int modified_predictor= y ? predictor : 1;
- uint8_t *ptr = p->data[0] + (linesize * y);
-
- if(s->pb.buf_end - s->pb.buf - (put_bits_count(&s->pb)>>3) < width*3*4){
- av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n");
- return -1;
- }
-
- for(i=0; i<3; i++){
- top[i]= left[i]= topleft[i]= buffer[0][i];
- }
- for(x = 0; x < width; x++) {
- buffer[x][1] = ptr[4*x+0] - ptr[4*x+1] + 0x100;
- buffer[x][2] = ptr[4*x+2] - ptr[4*x+1] + 0x100;
- buffer[x][0] = (ptr[4*x+0] + 2*ptr[4*x+1] + ptr[4*x+2])>>2;
-
- for(i=0;i<3;i++) {
- int pred, diff;
-
- PREDICT(pred, topleft[i], top[i], left[i], modified_predictor);
-
- topleft[i]= top[i];
- top[i]= buffer[x+1][i];
-
- left[i]= buffer[x][i];
-
- diff= ((left[i] - pred + 0x100)&0x1FF) - 0x100;
-
- if(i==0)
- mjpeg_encode_dc(s, diff, m->huff_size_dc_luminance, m->huff_code_dc_luminance); //FIXME ugly
- else
- mjpeg_encode_dc(s, diff, m->huff_size_dc_chrominance, m->huff_code_dc_chrominance);
- }
- }
- }
- }else{
- int mb_x, mb_y, i;
- const int mb_width = (width + s->mjpeg_hsample[0] - 1) / s->mjpeg_hsample[0];
- const int mb_height = (height + s->mjpeg_vsample[0] - 1) / s->mjpeg_vsample[0];
-
- for(mb_y = 0; mb_y < mb_height; mb_y++) {
- if(s->pb.buf_end - s->pb.buf - (put_bits_count(&s->pb)>>3) < mb_width * 4 * 3 * s->mjpeg_hsample[0] * s->mjpeg_vsample[0]){
- av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n");
- return -1;
- }
- for(mb_x = 0; mb_x < mb_width; mb_x++) {
- if(mb_x==0 || mb_y==0){
- for(i=0;i<3;i++) {
- uint8_t *ptr;
- int x, y, h, v, linesize;
- h = s->mjpeg_hsample[i];
- v = s->mjpeg_vsample[i];
- linesize= p->linesize[i];
-
- for(y=0; y<v; y++){
- for(x=0; x<h; x++){
- int pred;
-
- ptr = p->data[i] + (linesize * (v * mb_y + y)) + (h * mb_x + x); //FIXME optimize this crap
- if(y==0 && mb_y==0){
- if(x==0 && mb_x==0){
- pred= 128;
- }else{
- pred= ptr[-1];
- }
- }else{
- if(x==0 && mb_x==0){
- pred= ptr[-linesize];
- }else{
- PREDICT(pred, ptr[-linesize-1], ptr[-linesize], ptr[-1], predictor);
- }
- }
-
- if(i==0)
- mjpeg_encode_dc(s, (int8_t)(*ptr - pred), m->huff_size_dc_luminance, m->huff_code_dc_luminance); //FIXME ugly
- else
- mjpeg_encode_dc(s, (int8_t)(*ptr - pred), m->huff_size_dc_chrominance, m->huff_code_dc_chrominance);
- }
- }
- }
- }else{
- for(i=0;i<3;i++) {
- uint8_t *ptr;
- int x, y, h, v, linesize;
- h = s->mjpeg_hsample[i];
- v = s->mjpeg_vsample[i];
- linesize= p->linesize[i];
-
- for(y=0; y<v; y++){
- for(x=0; x<h; x++){
- int pred;
-
- ptr = p->data[i] + (linesize * (v * mb_y + y)) + (h * mb_x + x); //FIXME optimize this crap
-//printf("%d %d %d %d %8X\n", mb_x, mb_y, x, y, ptr);
- PREDICT(pred, ptr[-linesize-1], ptr[-linesize], ptr[-1], predictor);
-
- if(i==0)
- mjpeg_encode_dc(s, (int8_t)(*ptr - pred), m->huff_size_dc_luminance, m->huff_code_dc_luminance); //FIXME ugly
- else
- mjpeg_encode_dc(s, (int8_t)(*ptr - pred), m->huff_size_dc_chrominance, m->huff_code_dc_chrominance);
- }
- }
- }
- }
- }
- }
- }
-
- emms_c();
-
- mjpeg_picture_trailer(s);
- s->picture_number++;
-
- flush_put_bits(&s->pb);
- return pbBufPtr(&s->pb) - s->pb.buf;
-// return (put_bits_count(&f->pb)+7)/8;
-}
-
-#endif //CONFIG_ENCODERS
-
-/******************************************/
-/* decoding */
-
-#define MAX_COMPONENTS 4
-
-typedef struct MJpegDecodeContext {
- AVCodecContext *avctx;
- GetBitContext gb;
- int mpeg_enc_ctx_allocated; /* true if decoding context allocated */
-
- int start_code; /* current start code */
- int buffer_size;
- uint8_t *buffer;
-
- int16_t quant_matrixes[4][64];
- VLC vlcs[2][4];
- int qscale[4]; ///< quantizer scale calculated from quant_matrixes
-
- int org_height; /* size given at codec init */
- int first_picture; /* true if decoding first picture */
- int interlaced; /* true if interlaced */
- int bottom_field; /* true if bottom field */
- int lossless;
- int ls;
- int progressive;
- int rgb;
- int rct; /* standard rct */
- int pegasus_rct; /* pegasus reversible colorspace transform */
- int bits; /* bits per component */
-
- int maxval;
- int near; ///< near lossless bound (si 0 for lossless)
- int t1,t2,t3;
- int reset; ///< context halfing intervall ?rename
-
- int width, height;
- int mb_width, mb_height;
- int nb_components;
- int component_id[MAX_COMPONENTS];
- int h_count[MAX_COMPONENTS]; /* horizontal and vertical count for each component */
- int v_count[MAX_COMPONENTS];
- int comp_index[MAX_COMPONENTS];
- int dc_index[MAX_COMPONENTS];
- int ac_index[MAX_COMPONENTS];
- int nb_blocks[MAX_COMPONENTS];
- int h_scount[MAX_COMPONENTS];
- int v_scount[MAX_COMPONENTS];
- int h_max, v_max; /* maximum h and v counts */
- int quant_index[4]; /* quant table index for each component */
- int last_dc[MAX_COMPONENTS]; /* last DEQUANTIZED dc (XXX: am I right to do that ?) */
- AVFrame picture; /* picture structure */
- int linesize[MAX_COMPONENTS]; ///< linesize << interlaced
- int8_t *qscale_table;
- DECLARE_ALIGNED_8(DCTELEM, block[64]);
- ScanTable scantable;
- void (*idct_put)(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/);
- void (*idct_add)(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/);
-
- int restart_interval;
- int restart_count;
-
- int buggy_avid;
- int cs_itu601;
- int interlace_polarity;
-
- int mjpb_skiptosod;
-
- int cur_scan; /* current scan, used by JPEG-LS */
-} MJpegDecodeContext;
-
-#include "jpeg_ls.c" //FIXME make jpeg-ls more independant
-
-static int mjpeg_decode_dht(MJpegDecodeContext *s);
-
-static int build_vlc(VLC *vlc, const uint8_t *bits_table, const uint8_t *val_table,
- int nb_codes, int use_static, int is_ac)
-{
- uint8_t huff_size[256+16];
- uint16_t huff_code[256+16];
-
- assert(nb_codes <= 256);
-
- memset(huff_size, 0, sizeof(huff_size));
- build_huffman_codes(huff_size, huff_code, bits_table, val_table);
-
- if(is_ac){
- memmove(huff_size+16, huff_size, sizeof(uint8_t)*nb_codes);
- memmove(huff_code+16, huff_code, sizeof(uint16_t)*nb_codes);
- memset(huff_size, 0, sizeof(uint8_t)*16);
- memset(huff_code, 0, sizeof(uint16_t)*16);
- nb_codes += 16;
- }
-
- return init_vlc(vlc, 9, nb_codes, huff_size, 1, 1, huff_code, 2, 2, use_static);
-}
-
-static int mjpeg_decode_init(AVCodecContext *avctx)
-{
- MJpegDecodeContext *s = avctx->priv_data;
- MpegEncContext s2;
- memset(s, 0, sizeof(MJpegDecodeContext));
-
- s->avctx = avctx;
-
- /* ugly way to get the idct & scantable FIXME */
- memset(&s2, 0, sizeof(MpegEncContext));
- s2.avctx= avctx;
-// s2->out_format = FMT_MJPEG;
- dsputil_init(&s2.dsp, avctx);
- DCT_common_init(&s2);
-
- s->scantable= s2.intra_scantable;
- s->idct_put= s2.dsp.idct_put;
- s->idct_add= s2.dsp.idct_add;
-
- s->mpeg_enc_ctx_allocated = 0;
- s->buffer_size = 0;
- s->buffer = NULL;
- s->start_code = -1;
- s->first_picture = 1;
- s->org_height = avctx->coded_height;
-
- build_vlc(&s->vlcs[0][0], bits_dc_luminance, val_dc_luminance, 12, 0, 0);
- build_vlc(&s->vlcs[0][1], bits_dc_chrominance, val_dc_chrominance, 12, 0, 0);
- build_vlc(&s->vlcs[1][0], bits_ac_luminance, val_ac_luminance, 251, 0, 1);
- build_vlc(&s->vlcs[1][1], bits_ac_chrominance, val_ac_chrominance, 251, 0, 1);
-
- if (avctx->flags & CODEC_FLAG_EXTERN_HUFF)
- {
- av_log(avctx, AV_LOG_INFO, "mjpeg: using external huffman table\n");
- init_get_bits(&s->gb, avctx->extradata, avctx->extradata_size*8);
- mjpeg_decode_dht(s);
- /* should check for error - but dunno */
- }
-
- return 0;
-}
-
-
-/**
- * finds the end of the current frame in the bitstream.
- * @return the position of the first byte of the next frame, or -1
- */
-static int find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size){
- int vop_found, i;
- uint16_t state;
-
- vop_found= pc->frame_start_found;
- state= pc->state;
-
- i=0;
- if(!vop_found){
- for(i=0; i<buf_size; i++){
- state= (state<<8) | buf[i];
- if(state == 0xFFD8){
- i++;
- vop_found=1;
- break;
- }
- }
- }
-
- if(vop_found){
- /* EOF considered as end of frame */
- if (buf_size == 0)
- return 0;
- for(; i<buf_size; i++){
- state= (state<<8) | buf[i];
- if(state == 0xFFD8){
- pc->frame_start_found=0;
- pc->state=0;
- return i-1;
- }
- }
- }
- pc->frame_start_found= vop_found;
- pc->state= state;
- return END_NOT_FOUND;
-}
-
-static int jpeg_parse(AVCodecParserContext *s,
- AVCodecContext *avctx,
- uint8_t **poutbuf, int *poutbuf_size,
- const uint8_t *buf, int buf_size)
-{
- ParseContext *pc = s->priv_data;
- int next;
-
- next= find_frame_end(pc, buf, buf_size);
-
- if (ff_combine_frame(pc, next, (uint8_t **)&buf, &buf_size) < 0) {
- *poutbuf = NULL;
- *poutbuf_size = 0;
- return buf_size;
- }
-
- *poutbuf = (uint8_t *)buf;
- *poutbuf_size = buf_size;
- return next;
-}
-
-/* quantize tables */
-static int mjpeg_decode_dqt(MJpegDecodeContext *s)
-{
- int len, index, i, j;
-
- len = get_bits(&s->gb, 16) - 2;
-
- while (len >= 65) {
- /* only 8 bit precision handled */
- if (get_bits(&s->gb, 4) != 0)
- {
- dprintf("dqt: 16bit precision\n");
- return -1;
- }
- index = get_bits(&s->gb, 4);
- if (index >= 4)
- return -1;
- dprintf("index=%d\n", index);
- /* read quant table */
- for(i=0;i<64;i++) {
- j = s->scantable.permutated[i];
- s->quant_matrixes[index][j] = get_bits(&s->gb, 8);
- }
-
- //XXX FIXME finetune, and perhaps add dc too
- s->qscale[index]= FFMAX(
- s->quant_matrixes[index][s->scantable.permutated[1]],
- s->quant_matrixes[index][s->scantable.permutated[8]]) >> 1;
- dprintf("qscale[%d]: %d\n", index, s->qscale[index]);
- len -= 65;
- }
-
- return 0;
-}
-
-/* decode huffman tables and build VLC decoders */
-static int mjpeg_decode_dht(MJpegDecodeContext *s)
-{
- int len, index, i, class, n, v, code_max;
- uint8_t bits_table[17];
- uint8_t val_table[256];
-
- len = get_bits(&s->gb, 16) - 2;
-
- while (len > 0) {
- if (len < 17)
- return -1;
- class = get_bits(&s->gb, 4);
- if (class >= 2)
- return -1;
- index = get_bits(&s->gb, 4);
- if (index >= 4)
- return -1;
- n = 0;
- for(i=1;i<=16;i++) {
- bits_table[i] = get_bits(&s->gb, 8);
- n += bits_table[i];
- }
- len -= 17;
- if (len < n || n > 256)
- return -1;
-
- code_max = 0;
- for(i=0;i<n;i++) {
- v = get_bits(&s->gb, 8);
- if (v > code_max)
- code_max = v;
- val_table[i] = v;
- }
- len -= n;
-
- /* build VLC and flush previous vlc if present */
- free_vlc(&s->vlcs[class][index]);
- dprintf("class=%d index=%d nb_codes=%d\n",
- class, index, code_max + 1);
- if(build_vlc(&s->vlcs[class][index], bits_table, val_table, code_max + 1, 0, class > 0) < 0){
- return -1;
- }
- }
- return 0;
-}
-
-static int mjpeg_decode_sof(MJpegDecodeContext *s)
-{
- int len, nb_components, i, width, height, pix_fmt_id;
-
- /* XXX: verify len field validity */
- len = get_bits(&s->gb, 16);
- s->bits= get_bits(&s->gb, 8);
-
- if(s->pegasus_rct) s->bits=9;
- if(s->bits==9 && !s->pegasus_rct) s->rct=1; //FIXME ugly
-
- if (s->bits != 8 && !s->lossless){
- av_log(s->avctx, AV_LOG_ERROR, "only 8 bits/component accepted\n");
- return -1;
- }
-
- height = get_bits(&s->gb, 16);
- width = get_bits(&s->gb, 16);
-
- dprintf("sof0: picture: %dx%d\n", width, height);
- if(avcodec_check_dimensions(s->avctx, width, height))
- return -1;
-
- nb_components = get_bits(&s->gb, 8);
- if (nb_components <= 0 ||
- nb_components > MAX_COMPONENTS)
- return -1;
- if (s->ls && !(s->bits <= 8 || nb_components == 1)){
- av_log(s->avctx, AV_LOG_ERROR, "only <= 8 bits/component or 16-bit gray accepted for JPEG-LS\n");
- return -1;
- }
- s->nb_components = nb_components;
- s->h_max = 1;
- s->v_max = 1;
- for(i=0;i<nb_components;i++) {
- /* component id */
- s->component_id[i] = get_bits(&s->gb, 8) - 1;
- s->h_count[i] = get_bits(&s->gb, 4);
- s->v_count[i] = get_bits(&s->gb, 4);
- /* compute hmax and vmax (only used in interleaved case) */
- if (s->h_count[i] > s->h_max)
- s->h_max = s->h_count[i];
- if (s->v_count[i] > s->v_max)
- s->v_max = s->v_count[i];
- s->quant_index[i] = get_bits(&s->gb, 8);
- if (s->quant_index[i] >= 4)
- return -1;
- dprintf("component %d %d:%d id: %d quant:%d\n", i, s->h_count[i],
- s->v_count[i], s->component_id[i], s->quant_index[i]);
- }
-
- if(s->ls && (s->h_max > 1 || s->v_max > 1)) {
- av_log(s->avctx, AV_LOG_ERROR, "Subsampling in JPEG-LS is not supported.\n");
- return -1;
- }
-
- if(s->v_max==1 && s->h_max==1 && s->lossless==1) s->rgb=1;
-
- /* if different size, realloc/alloc picture */
- /* XXX: also check h_count and v_count */
- if (width != s->width || height != s->height) {
- av_freep(&s->qscale_table);
-
- s->width = width;
- s->height = height;
-
- /* test interlaced mode */
- if (s->first_picture &&
- s->org_height != 0 &&
- s->height < ((s->org_height * 3) / 4)) {
- s->interlaced = 1;
-// s->bottom_field = (s->interlace_polarity) ? 1 : 0;
- s->bottom_field = 0;
- height *= 2;
- }
-
- avcodec_set_dimensions(s->avctx, width, height);
-
- s->qscale_table= av_mallocz((s->width+15)/16);
-
- s->first_picture = 0;
- }
-
- if(s->interlaced && s->bottom_field)
- return 0;
-
- /* XXX: not complete test ! */
- pix_fmt_id = (s->h_count[0] << 20) | (s->v_count[0] << 16) |
- (s->h_count[1] << 12) | (s->v_count[1] << 8) |
- (s->h_count[2] << 4) | s->v_count[2];
- dprintf("pix fmt id %x\n", pix_fmt_id);
- switch(pix_fmt_id){
- case 0x222222:
- case 0x111111:
- if(s->rgb){
- s->avctx->pix_fmt = PIX_FMT_RGBA32;
- }else if(s->nb_components==3)
- s->avctx->pix_fmt = s->cs_itu601 ? PIX_FMT_YUV444P : PIX_FMT_YUVJ444P;
- else
- s->avctx->pix_fmt = PIX_FMT_GRAY8;
- break;
- case 0x211111:
- case 0x221212:
- s->avctx->pix_fmt = s->cs_itu601 ? PIX_FMT_YUV422P : PIX_FMT_YUVJ422P;
- break;
- default:
- case 0x221111:
- s->avctx->pix_fmt = s->cs_itu601 ? PIX_FMT_YUV420P : PIX_FMT_YUVJ420P;
- break;
- }
- if(s->ls){
- if(s->nb_components > 1)
- s->avctx->pix_fmt = PIX_FMT_RGB24;
- else if(s->bits <= 8)
- s->avctx->pix_fmt = PIX_FMT_GRAY8;
- else
- s->avctx->pix_fmt = PIX_FMT_GRAY16;
- }
-
- if(s->picture.data[0])
- s->avctx->release_buffer(s->avctx, &s->picture);
-
- s->picture.reference= 0;
- if(s->avctx->get_buffer(s->avctx, &s->picture) < 0){
- av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
- s->picture.pict_type= I_TYPE;
- s->picture.key_frame= 1;
-
- for(i=0; i<3; i++){
- s->linesize[i]= s->picture.linesize[i] << s->interlaced;
- }
-
-// printf("%d %d %d %d %d %d\n", s->width, s->height, s->linesize[0], s->linesize[1], s->interlaced, s->avctx->height);
-
- if (len != (8+(3*nb_components)))
- {
- dprintf("decode_sof0: error, len(%d) mismatch\n", len);
- }
-
- /* totally blank picture as progressive JPEG will only add details to it */
- if(s->progressive){
- memset(s->picture.data[0], 0, s->picture.linesize[0] * s->height);
- memset(s->picture.data[1], 0, s->picture.linesize[1] * s->height >> (s->v_max - s->v_count[1]));
- memset(s->picture.data[2], 0, s->picture.linesize[2] * s->height >> (s->v_max - s->v_count[2]));
- }
- return 0;
-}
-
-static inline int mjpeg_decode_dc(MJpegDecodeContext *s, int dc_index)
-{
- int code;
- code = get_vlc2(&s->gb, s->vlcs[0][dc_index].table, 9, 2);
- if (code < 0)
- {
- dprintf("mjpeg_decode_dc: bad vlc: %d:%d (%p)\n", 0, dc_index,
- &s->vlcs[0][dc_index]);
- return 0xffff;
- }
-
- if(code)
- return get_xbits(&s->gb, code);
- else
- return 0;
-}
-
-/* decode block and dequantize */
-static int decode_block(MJpegDecodeContext *s, DCTELEM *block,
- int component, int dc_index, int ac_index, int16_t *quant_matrix)
-{
- int code, i, j, level, val;
-
- /* DC coef */
- val = mjpeg_decode_dc(s, dc_index);
- if (val == 0xffff) {
- dprintf("error dc\n");
- return -1;
- }
- val = val * quant_matrix[0] + s->last_dc[component];
- s->last_dc[component] = val;
- block[0] = val;
- /* AC coefs */
- i = 0;
- {OPEN_READER(re, &s->gb)
- for(;;) {
- UPDATE_CACHE(re, &s->gb);
- GET_VLC(code, re, &s->gb, s->vlcs[1][ac_index].table, 9, 2)
-
- /* EOB */
- if (code == 0x10)
- break;
- i += ((unsigned)code) >> 4;
- if(code != 0x100){
- code &= 0xf;
- if(code > MIN_CACHE_BITS - 16){
- UPDATE_CACHE(re, &s->gb)
- }
- {
- int cache=GET_CACHE(re,&s->gb);
- int sign=(~cache)>>31;
- level = (NEG_USR32(sign ^ cache,code) ^ sign) - sign;
- }
-
- LAST_SKIP_BITS(re, &s->gb, code)
-
- if (i >= 63) {
- if(i == 63){
- j = s->scantable.permutated[63];
- block[j] = level * quant_matrix[j];
- break;
- }
- dprintf("error count: %d\n", i);
- return -1;
- }
- j = s->scantable.permutated[i];
- block[j] = level * quant_matrix[j];
- }
- }
- CLOSE_READER(re, &s->gb)}
-
- return 0;
-}
-
-/* decode block and dequantize - progressive JPEG version */
-static int decode_block_progressive(MJpegDecodeContext *s, DCTELEM *block,
- int component, int dc_index, int ac_index, int16_t *quant_matrix,
- int ss, int se, int Ah, int Al, int *EOBRUN)
-{
- int code, i, j, level, val, run;
-
- /* DC coef */
- if(!ss){
- val = mjpeg_decode_dc(s, dc_index);
- if (val == 0xffff) {
- dprintf("error dc\n");
- return -1;
- }
- val = (val * quant_matrix[0] << Al) + s->last_dc[component];
- }else
- val = 0;
- s->last_dc[component] = val;
- block[0] = val;
- if(!se) return 0;
- /* AC coefs */
- if(*EOBRUN){
- (*EOBRUN)--;
- return 0;
- }
- {OPEN_READER(re, &s->gb)
- for(i=ss;;i++) {
- UPDATE_CACHE(re, &s->gb);
- GET_VLC(code, re, &s->gb, s->vlcs[1][ac_index].table, 9, 2)
- /* Progressive JPEG use AC coeffs from zero and this decoder sets offset 16 by default */
- code -= 16;
- if(code & 0xF) {
- i += ((unsigned) code) >> 4;
- code &= 0xf;
- if(code > MIN_CACHE_BITS - 16){
- UPDATE_CACHE(re, &s->gb)
- }
- {
- int cache=GET_CACHE(re,&s->gb);
- int sign=(~cache)>>31;
- level = (NEG_USR32(sign ^ cache,code) ^ sign) - sign;
- }
-
- LAST_SKIP_BITS(re, &s->gb, code)
-
- if (i >= se) {
- if(i == se){
- j = s->scantable.permutated[se];
- block[j] = level * quant_matrix[j] << Al;
- break;
- }
- dprintf("error count: %d\n", i);
- return -1;
- }
- j = s->scantable.permutated[i];
- block[j] = level * quant_matrix[j] << Al;
- }else{
- run = ((unsigned) code) >> 4;
- if(run == 0xF){// ZRL - skip 15 coefficients
- i += 15;
- }else{
- val = run;
- run = (1 << run);
- UPDATE_CACHE(re, &s->gb);
- run += (GET_CACHE(re, &s->gb) >> (32 - val)) & (run - 1);
- if(val)
- LAST_SKIP_BITS(re, &s->gb, val);
- *EOBRUN = run - 1;
- break;
- }
- }
- }
- CLOSE_READER(re, &s->gb)}
-
- return 0;
-}
-
-static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s, int predictor, int point_transform){
- int i, mb_x, mb_y;
- uint16_t buffer[32768][4];
- int left[3], top[3], topleft[3];
- const int linesize= s->linesize[0];
- const int mask= (1<<s->bits)-1;
-
- if((unsigned)s->mb_width > 32768) //dynamic alloc
- return -1;
-
- for(i=0; i<3; i++){
- buffer[0][i]= 1 << (s->bits + point_transform - 1);
- }
- for(mb_y = 0; mb_y < s->mb_height; mb_y++) {
- const int modified_predictor= mb_y ? predictor : 1;
- uint8_t *ptr = s->picture.data[0] + (linesize * mb_y);
-
- if (s->interlaced && s->bottom_field)
- ptr += linesize >> 1;
-
- for(i=0; i<3; i++){
- top[i]= left[i]= topleft[i]= buffer[0][i];
- }
- for(mb_x = 0; mb_x < s->mb_width; mb_x++) {
- if (s->restart_interval && !s->restart_count)
- s->restart_count = s->restart_interval;
-
- for(i=0;i<3;i++) {
- int pred;
-
- topleft[i]= top[i];
- top[i]= buffer[mb_x][i];
-
- PREDICT(pred, topleft[i], top[i], left[i], modified_predictor);
-
- left[i]=
- buffer[mb_x][i]= mask & (pred + (mjpeg_decode_dc(s, s->dc_index[i]) << point_transform));
- }
-
- if (s->restart_interval && !--s->restart_count) {
- align_get_bits(&s->gb);
- skip_bits(&s->gb, 16); /* skip RSTn */
- }
- }
-
- if(s->rct){
- for(mb_x = 0; mb_x < s->mb_width; mb_x++) {
- ptr[4*mb_x+1] = buffer[mb_x][0] - ((buffer[mb_x][1] + buffer[mb_x][2] - 0x200)>>2);
- ptr[4*mb_x+0] = buffer[mb_x][1] + ptr[4*mb_x+1];
- ptr[4*mb_x+2] = buffer[mb_x][2] + ptr[4*mb_x+1];
- }
- }else if(s->pegasus_rct){
- for(mb_x = 0; mb_x < s->mb_width; mb_x++) {
- ptr[4*mb_x+1] = buffer[mb_x][0] - ((buffer[mb_x][1] + buffer[mb_x][2])>>2);
- ptr[4*mb_x+0] = buffer[mb_x][1] + ptr[4*mb_x+1];
- ptr[4*mb_x+2] = buffer[mb_x][2] + ptr[4*mb_x+1];
- }
- }else{
- for(mb_x = 0; mb_x < s->mb_width; mb_x++) {
- ptr[4*mb_x+0] = buffer[mb_x][0];
- ptr[4*mb_x+1] = buffer[mb_x][1];
- ptr[4*mb_x+2] = buffer[mb_x][2];
- }
- }
- }
- return 0;
-}
-
-static int ljpeg_decode_yuv_scan(MJpegDecodeContext *s, int predictor, int point_transform){
- int i, mb_x, mb_y;
- const int nb_components=3;
-
- for(mb_y = 0; mb_y < s->mb_height; mb_y++) {
- for(mb_x = 0; mb_x < s->mb_width; mb_x++) {
- if (s->restart_interval && !s->restart_count)
- s->restart_count = s->restart_interval;
-
- if(mb_x==0 || mb_y==0 || s->interlaced){
- for(i=0;i<nb_components;i++) {
- uint8_t *ptr;
- int n, h, v, x, y, c, j, linesize;
- n = s->nb_blocks[i];
- c = s->comp_index[i];
- h = s->h_scount[i];
- v = s->v_scount[i];
- x = 0;
- y = 0;
- linesize= s->linesize[c];
-
- for(j=0; j<n; j++) {
- int pred;
-
- ptr = s->picture.data[c] + (linesize * (v * mb_y + y)) + (h * mb_x + x); //FIXME optimize this crap
- if(y==0 && mb_y==0){
- if(x==0 && mb_x==0){
- pred= 128 << point_transform;
- }else{
- pred= ptr[-1];
- }
- }else{
- if(x==0 && mb_x==0){
- pred= ptr[-linesize];
- }else{
- PREDICT(pred, ptr[-linesize-1], ptr[-linesize], ptr[-1], predictor);
- }
- }
-
- if (s->interlaced && s->bottom_field)
- ptr += linesize >> 1;
- *ptr= pred + (mjpeg_decode_dc(s, s->dc_index[i]) << point_transform);
-
- if (++x == h) {
- x = 0;
- y++;
- }
- }
- }
- }else{
- for(i=0;i<nb_components;i++) {
- uint8_t *ptr;
- int n, h, v, x, y, c, j, linesize;
- n = s->nb_blocks[i];
- c = s->comp_index[i];
- h = s->h_scount[i];
- v = s->v_scount[i];
- x = 0;
- y = 0;
- linesize= s->linesize[c];
-
- for(j=0; j<n; j++) {
- int pred;
-
- ptr = s->picture.data[c] + (linesize * (v * mb_y + y)) + (h * mb_x + x); //FIXME optimize this crap
- PREDICT(pred, ptr[-linesize-1], ptr[-linesize], ptr[-1], predictor);
- *ptr= pred + (mjpeg_decode_dc(s, s->dc_index[i]) << point_transform);
- if (++x == h) {
- x = 0;
- y++;
- }
- }
- }
- }
- if (s->restart_interval && !--s->restart_count) {
- align_get_bits(&s->gb);
- skip_bits(&s->gb, 16); /* skip RSTn */
- }
- }
- }
- return 0;
-}
-
-static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int ss, int se, int Ah, int Al){
- int i, mb_x, mb_y;
- int EOBRUN = 0;
-
- if(Ah) return 0; /* TODO decode refinement planes too */
- for(mb_y = 0; mb_y < s->mb_height; mb_y++) {
- for(mb_x = 0; mb_x < s->mb_width; mb_x++) {
- if (s->restart_interval && !s->restart_count)
- s->restart_count = s->restart_interval;
-
- for(i=0;i<nb_components;i++) {
- uint8_t *ptr;
- int n, h, v, x, y, c, j;
- n = s->nb_blocks[i];
- c = s->comp_index[i];
- h = s->h_scount[i];
- v = s->v_scount[i];
- x = 0;
- y = 0;
- for(j=0;j<n;j++) {
- memset(s->block, 0, sizeof(s->block));
- if (!s->progressive && decode_block(s, s->block, i,
- s->dc_index[i], s->ac_index[i],
- s->quant_matrixes[ s->quant_index[c] ]) < 0) {
- dprintf("error y=%d x=%d\n", mb_y, mb_x);
- return -1;
- }
- if (s->progressive && decode_block_progressive(s, s->block, i,
- s->dc_index[i], s->ac_index[i],
- s->quant_matrixes[ s->quant_index[c] ], ss, se, Ah, Al, &EOBRUN) < 0) {
- dprintf("error y=%d x=%d\n", mb_y, mb_x);
- return -1;
- }
-// dprintf("mb: %d %d processed\n", mb_y, mb_x);
- ptr = s->picture.data[c] +
- (((s->linesize[c] * (v * mb_y + y) * 8) +
- (h * mb_x + x) * 8) >> s->avctx->lowres);
- if (s->interlaced && s->bottom_field)
- ptr += s->linesize[c] >> 1;
-//av_log(NULL, AV_LOG_DEBUG, "%d %d %d %d %d %d %d %d \n", mb_x, mb_y, x, y, c, s->bottom_field, (v * mb_y + y) * 8, (h * mb_x + x) * 8);
- if(!s->progressive)
- s->idct_put(ptr, s->linesize[c], s->block);
- else
- s->idct_add(ptr, s->linesize[c], s->block);
- if (++x == h) {
- x = 0;
- y++;
- }
- }
- }
- /* (< 1350) buggy workaround for Spectralfan.mov, should be fixed */
- if (s->restart_interval && (s->restart_interval < 1350) &&
- !--s->restart_count) {
- align_get_bits(&s->gb);
- skip_bits(&s->gb, 16); /* skip RSTn */
- for (i=0; i<nb_components; i++) /* reset dc */
- s->last_dc[i] = 1024;
- }
- }
- }
- return 0;
-}
-
-static int mjpeg_decode_sos(MJpegDecodeContext *s)
-{
- int len, nb_components, i, h, v, predictor, point_transform;
- int vmax, hmax, index, id;
- const int block_size= s->lossless ? 1 : 8;
- int ilv, prev_shift;
-
- /* XXX: verify len field validity */
- len = get_bits(&s->gb, 16);
- nb_components = get_bits(&s->gb, 8);
- if (len != 6+2*nb_components)
- {
- dprintf("decode_sos: invalid len (%d)\n", len);
- return -1;
- }
- vmax = 0;
- hmax = 0;
- for(i=0;i<nb_components;i++) {
- id = get_bits(&s->gb, 8) - 1;
- dprintf("component: %d\n", id);
- /* find component index */
- for(index=0;index<s->nb_components;index++)
- if (id == s->component_id[index])
- break;
- if (index == s->nb_components)
- {
- dprintf("decode_sos: index(%d) out of components\n", index);
- return -1;
- }
-
- s->comp_index[i] = index;
-
- s->nb_blocks[i] = s->h_count[index] * s->v_count[index];
- s->h_scount[i] = s->h_count[index];
- s->v_scount[i] = s->v_count[index];
-
- s->dc_index[i] = get_bits(&s->gb, 4);
- s->ac_index[i] = get_bits(&s->gb, 4);
-
- if (s->dc_index[i] < 0 || s->ac_index[i] < 0 ||
- s->dc_index[i] >= 4 || s->ac_index[i] >= 4)
- goto out_of_range;
-#if 0 //buggy
- switch(s->start_code)
- {
- case SOF0:
- if (dc_index[i] > 1 || ac_index[i] > 1)
- goto out_of_range;
- break;
- case SOF1:
- case SOF2:
- if (dc_index[i] > 3 || ac_index[i] > 3)
- goto out_of_range;
- break;
- case SOF3:
- if (dc_index[i] > 3 || ac_index[i] != 0)
- goto out_of_range;
- break;
- }
-#endif
- }
-
- predictor= get_bits(&s->gb, 8); /* JPEG Ss / lossless JPEG predictor /JPEG-LS NEAR */
- ilv= get_bits(&s->gb, 8); /* JPEG Se / JPEG-LS ILV */
- prev_shift = get_bits(&s->gb, 4); /* Ah */
- point_transform= get_bits(&s->gb, 4); /* Al */
-
- for(i=0;i<nb_components;i++)
- s->last_dc[i] = 1024;
-
- if (nb_components > 1) {
- /* interleaved stream */
- s->mb_width = (s->width + s->h_max * block_size - 1) / (s->h_max * block_size);
- s->mb_height = (s->height + s->v_max * block_size - 1) / (s->v_max * block_size);
- } else if(!s->ls) { /* skip this for JPEG-LS */
- h = s->h_max / s->h_scount[0];
- v = s->v_max / s->v_scount[0];
- s->mb_width = (s->width + h * block_size - 1) / (h * block_size);
- s->mb_height = (s->height + v * block_size - 1) / (v * block_size);
- s->nb_blocks[0] = 1;
- s->h_scount[0] = 1;
- s->v_scount[0] = 1;
- }
-
- if(s->avctx->debug & FF_DEBUG_PICT_INFO)
- av_log(s->avctx, AV_LOG_DEBUG, "%s %s p:%d >>:%d ilv:%d bits:%d %s\n", s->lossless ? "lossless" : "sequencial DCT", s->rgb ? "RGB" : "",
- predictor, point_transform, ilv, s->bits,
- s->pegasus_rct ? "PRCT" : (s->rct ? "RCT" : ""));
-
-
- /* mjpeg-b can have padding bytes between sos and image data, skip them */
- for (i = s->mjpb_skiptosod; i > 0; i--)
- skip_bits(&s->gb, 8);
-
- if(s->lossless){
- if(s->ls){
-// for(){
-// reset_ls_coding_parameters(s, 0);
-
- ls_decode_picture(s, predictor, point_transform, ilv);
- }else{
- if(s->rgb){
- if(ljpeg_decode_rgb_scan(s, predictor, point_transform) < 0)
- return -1;
- }else{
- if(ljpeg_decode_yuv_scan(s, predictor, point_transform) < 0)
- return -1;
- }
- }
- }else{
- if(mjpeg_decode_scan(s, nb_components, predictor, ilv, prev_shift, point_transform) < 0)
- return -1;
- }
- emms_c();
- return 0;
- out_of_range:
- dprintf("decode_sos: ac/dc index out of range\n");
- return -1;
-}
-
-static int mjpeg_decode_dri(MJpegDecodeContext *s)
-{
- if (get_bits(&s->gb, 16) != 4)
- return -1;
- s->restart_interval = get_bits(&s->gb, 16);
- s->restart_count = 0;
- dprintf("restart interval: %d\n", s->restart_interval);
-
- return 0;
-}
-
-static int mjpeg_decode_app(MJpegDecodeContext *s)
-{
- int len, id;
-
- len = get_bits(&s->gb, 16);
- if (len < 5)
- return -1;
- if(8*len + get_bits_count(&s->gb) > s->gb.size_in_bits)
- return -1;
-
- id = (get_bits(&s->gb, 16) << 16) | get_bits(&s->gb, 16);
- id = be2me_32(id);
- len -= 6;
-
- if(s->avctx->debug & FF_DEBUG_STARTCODE){
- av_log(s->avctx, AV_LOG_DEBUG, "APPx %8X\n", id);
- }
-
- /* buggy AVID, it puts EOI only at every 10th frame */
- /* also this fourcc is used by non-avid files too, it holds some
- informations, but it's always present in AVID creates files */
- if (id == ff_get_fourcc("AVI1"))
- {
- /* structure:
- 4bytes AVI1
- 1bytes polarity
- 1bytes always zero
- 4bytes field_size
- 4bytes field_size_less_padding
- */
- s->buggy_avid = 1;
-// if (s->first_picture)
-// printf("mjpeg: workarounding buggy AVID\n");
- s->interlace_polarity = get_bits(&s->gb, 8);
-#if 0
- skip_bits(&s->gb, 8);
- skip_bits(&s->gb, 32);
- skip_bits(&s->gb, 32);
- len -= 10;
-#endif
-// if (s->interlace_polarity)
-// printf("mjpeg: interlace polarity: %d\n", s->interlace_polarity);
- goto out;
- }
-
-// len -= 2;
-
- if (id == ff_get_fourcc("JFIF"))
- {
- int t_w, t_h, v1, v2;
- skip_bits(&s->gb, 8); /* the trailing zero-byte */
- v1= get_bits(&s->gb, 8);
- v2= get_bits(&s->gb, 8);
- skip_bits(&s->gb, 8);
-
- s->avctx->sample_aspect_ratio.num= get_bits(&s->gb, 16);
- s->avctx->sample_aspect_ratio.den= get_bits(&s->gb, 16);
-
- if (s->avctx->debug & FF_DEBUG_PICT_INFO)
- av_log(s->avctx, AV_LOG_INFO, "mjpeg: JFIF header found (version: %x.%x) SAR=%d/%d\n",
- v1, v2,
- s->avctx->sample_aspect_ratio.num,
- s->avctx->sample_aspect_ratio.den
- );
-
- t_w = get_bits(&s->gb, 8);
- t_h = get_bits(&s->gb, 8);
- if (t_w && t_h)
- {
- /* skip thumbnail */
- if (len-10-(t_w*t_h*3) > 0)
- len -= t_w*t_h*3;
- }
- len -= 10;
- goto out;
- }
-
- if (id == ff_get_fourcc("Adob") && (get_bits(&s->gb, 8) == 'e'))
- {
- if (s->avctx->debug & FF_DEBUG_PICT_INFO)
- av_log(s->avctx, AV_LOG_INFO, "mjpeg: Adobe header found\n");
- skip_bits(&s->gb, 16); /* version */
- skip_bits(&s->gb, 16); /* flags0 */
- skip_bits(&s->gb, 16); /* flags1 */
- skip_bits(&s->gb, 8); /* transform */
- len -= 7;
- goto out;
- }
-
- if (id == ff_get_fourcc("LJIF")){
- if (s->avctx->debug & FF_DEBUG_PICT_INFO)
- av_log(s->avctx, AV_LOG_INFO, "Pegasus lossless jpeg header found\n");
- skip_bits(&s->gb, 16); /* version ? */
- skip_bits(&s->gb, 16); /* unknwon always 0? */
- skip_bits(&s->gb, 16); /* unknwon always 0? */
- skip_bits(&s->gb, 16); /* unknwon always 0? */
- switch( get_bits(&s->gb, 8)){
- case 1:
- s->rgb= 1;
- s->pegasus_rct=0;
- break;
- case 2:
- s->rgb= 1;
- s->pegasus_rct=1;
- break;
- default:
- av_log(s->avctx, AV_LOG_ERROR, "unknown colorspace\n");
- }
- len -= 9;
- goto out;
- }
-
- /* Apple MJPEG-A */
- if ((s->start_code == APP1) && (len > (0x28 - 8)))
- {
- id = (get_bits(&s->gb, 16) << 16) | get_bits(&s->gb, 16);
- id = be2me_32(id);
- len -= 4;
- if (id == ff_get_fourcc("mjpg")) /* Apple MJPEG-A */
- {
-#if 0
- skip_bits(&s->gb, 32); /* field size */
- skip_bits(&s->gb, 32); /* pad field size */
- skip_bits(&s->gb, 32); /* next off */
- skip_bits(&s->gb, 32); /* quant off */
- skip_bits(&s->gb, 32); /* huff off */
- skip_bits(&s->gb, 32); /* image off */
- skip_bits(&s->gb, 32); /* scan off */
- skip_bits(&s->gb, 32); /* data off */
-#endif
- if (s->avctx->debug & FF_DEBUG_PICT_INFO)
- av_log(s->avctx, AV_LOG_INFO, "mjpeg: Apple MJPEG-A header found\n");
- }
- }
-
-out:
- /* slow but needed for extreme adobe jpegs */
- if (len < 0)
- av_log(s->avctx, AV_LOG_ERROR, "mjpeg: error, decode_app parser read over the end\n");
- while(--len > 0)
- skip_bits(&s->gb, 8);
-
- return 0;
-}
-
-static int mjpeg_decode_com(MJpegDecodeContext *s)
-{
- int len = get_bits(&s->gb, 16);
- if (len >= 2 && 8*len - 16 + get_bits_count(&s->gb) <= s->gb.size_in_bits) {
- char *cbuf = av_malloc(len - 1);
- if (cbuf) {
- int i;
- for (i = 0; i < len - 2; i++)
- cbuf[i] = get_bits(&s->gb, 8);
- if (i > 0 && cbuf[i-1] == '\n')
- cbuf[i-1] = 0;
- else
- cbuf[i] = 0;
-
- if(s->avctx->debug & FF_DEBUG_PICT_INFO)
- av_log(s->avctx, AV_LOG_INFO, "mjpeg comment: '%s'\n", cbuf);
-
- /* buggy avid, it puts EOI only at every 10th frame */
- if (!strcmp(cbuf, "AVID"))
- {
- s->buggy_avid = 1;
- // if (s->first_picture)
- // printf("mjpeg: workarounding buggy AVID\n");
- }
- else if(!strcmp(cbuf, "CS=ITU601")){
- s->cs_itu601= 1;
- }
-
- av_free(cbuf);
- }
- }
-
- return 0;
-}
-
-#if 0
-static int valid_marker_list[] =
-{
- /* 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f */
-/* 0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-/* 1 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-/* 2 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-/* 3 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-/* 4 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-/* 5 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-/* 6 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-/* 7 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-/* 8 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-/* 9 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-/* a */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-/* b */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-/* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-/* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-/* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-/* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
-}
-#endif
-
-/* return the 8 bit start code value and update the search
- state. Return -1 if no start code found */
-static int find_marker(uint8_t **pbuf_ptr, uint8_t *buf_end)
-{
- uint8_t *buf_ptr;
- unsigned int v, v2;
- int val;
-#ifdef DEBUG
- int skipped=0;
-#endif
-
- buf_ptr = *pbuf_ptr;
- while (buf_ptr < buf_end) {
- v = *buf_ptr++;
- v2 = *buf_ptr;
- if ((v == 0xff) && (v2 >= 0xc0) && (v2 <= 0xfe) && buf_ptr < buf_end) {
- val = *buf_ptr++;
- goto found;
- }
-#ifdef DEBUG
- skipped++;
-#endif
- }
- val = -1;
-found:
-#ifdef DEBUG
- dprintf("find_marker skipped %d bytes\n", skipped);
-#endif
- *pbuf_ptr = buf_ptr;
- return val;
-}
-
-static int mjpeg_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- MJpegDecodeContext *s = avctx->priv_data;
- uint8_t *buf_end, *buf_ptr;
- int start_code;
- AVFrame *picture = data;
-
- buf_ptr = buf;
- buf_end = buf + buf_size;
- while (buf_ptr < buf_end) {
- /* find start next marker */
- start_code = find_marker(&buf_ptr, buf_end);
- {
- /* EOF */
- if (start_code < 0) {
- goto the_end;
- } else {
- dprintf("marker=%x avail_size_in_buf=%d\n", start_code, buf_end - buf_ptr);
-
- if ((buf_end - buf_ptr) > s->buffer_size)
- {
- av_free(s->buffer);
- s->buffer_size = buf_end-buf_ptr;
- s->buffer = av_malloc(s->buffer_size + FF_INPUT_BUFFER_PADDING_SIZE);
- dprintf("buffer too small, expanding to %d bytes\n",
- s->buffer_size);
- }
-
- /* unescape buffer of SOS, use special treatment for JPEG-LS */
- if (start_code == SOS && !s->ls)
- {
- uint8_t *src = buf_ptr;
- uint8_t *dst = s->buffer;
-
- while (src<buf_end)
- {
- uint8_t x = *(src++);
-
- *(dst++) = x;
- if (x == 0xff)
- {
- while(src<buf_end && x == 0xff)
- x = *(src++);
-
- if (x >= 0xd0 && x <= 0xd7)
- *(dst++) = x;
- else if (x)
- break;
- }
- }
- init_get_bits(&s->gb, s->buffer, (dst - s->buffer)*8);
-
- dprintf("escaping removed %d bytes\n",
- (buf_end - buf_ptr) - (dst - s->buffer));
- }
- else if(start_code == SOS && s->ls){
- uint8_t *src = buf_ptr;
- uint8_t *dst = s->buffer;
- int bit_count = 0;
- int t = 0, b = 0;
- PutBitContext pb;
-
- s->cur_scan++;
-
- /* find marker */
- while (src + t < buf_end){
- uint8_t x = src[t++];
- if (x == 0xff){
- while((src + t < buf_end) && x == 0xff)
- x = src[t++];
- if (x & 0x80) {
- t -= 2;
- break;
- }
- }
- }
- bit_count = t * 8;
-
- init_put_bits(&pb, dst, t);
-
- /* unescape bitstream */
- while(b < t){
- uint8_t x = src[b++];
- put_bits(&pb, 8, x);
- if(x == 0xFF){
- x = src[b++];
- put_bits(&pb, 7, x);
- bit_count--;
- }
- }
- flush_put_bits(&pb);
-
- init_get_bits(&s->gb, dst, bit_count);
- }
- else
- init_get_bits(&s->gb, buf_ptr, (buf_end - buf_ptr)*8);
-
- s->start_code = start_code;
- if(s->avctx->debug & FF_DEBUG_STARTCODE){
- av_log(s->avctx, AV_LOG_DEBUG, "startcode: %X\n", start_code);
- }
-
- /* process markers */
- if (start_code >= 0xd0 && start_code <= 0xd7) {
- dprintf("restart marker: %d\n", start_code&0x0f);
- /* APP fields */
- } else if (start_code >= APP0 && start_code <= APP15) {
- mjpeg_decode_app(s);
- /* Comment */
- } else if (start_code == COM){
- mjpeg_decode_com(s);
- }
-
- switch(start_code) {
- case SOI:
- s->restart_interval = 0;
-
- s->restart_count = 0;
- /* nothing to do on SOI */
- break;
- case DQT:
- mjpeg_decode_dqt(s);
- break;
- case DHT:
- if(mjpeg_decode_dht(s) < 0){
- av_log(s->avctx, AV_LOG_ERROR, "huffman table decode error\n");
- return -1;
- }
- break;
- case SOF0:
- s->lossless=0;
- s->progressive=0;
- if (mjpeg_decode_sof(s) < 0)
- return -1;
- break;
- case SOF2:
- s->lossless=0;
- s->progressive=1;
- if (mjpeg_decode_sof(s) < 0)
- return -1;
- break;
- case SOF3:
- s->lossless=1;
- s->progressive=0;
- if (mjpeg_decode_sof(s) < 0)
- return -1;
- break;
- case SOF48:
- s->lossless=1;
- s->ls=1;
- s->progressive=0;
- if (mjpeg_decode_sof(s) < 0)
- return -1;
- break;
- case LSE:
- if (decode_lse(s) < 0)
- return -1;
- break;
- case EOI:
- s->cur_scan = 0;
- if ((s->buggy_avid && !s->interlaced) || s->restart_interval)
- break;
-eoi_parser:
- {
- if (s->interlaced) {
- s->bottom_field ^= 1;
- /* if not bottom field, do not output image yet */
- if (s->bottom_field)
- goto not_the_end;
- }
- *picture = s->picture;
- *data_size = sizeof(AVFrame);
-
- if(!s->lossless){
- picture->quality= FFMAX(FFMAX(s->qscale[0], s->qscale[1]), s->qscale[2]);
- picture->qstride= 0;
- picture->qscale_table= s->qscale_table;
- memset(picture->qscale_table, picture->quality, (s->width+15)/16);
- if(avctx->debug & FF_DEBUG_QP)
- av_log(s->avctx, AV_LOG_DEBUG, "QP: %d\n", picture->quality);
- picture->quality*= FF_QP2LAMBDA;
- }
-
- goto the_end;
- }
- break;
- case SOS:
- mjpeg_decode_sos(s);
- /* buggy avid puts EOI every 10-20th frame */
- /* if restart period is over process EOI */
- if ((s->buggy_avid && !s->interlaced) || s->restart_interval)
- goto eoi_parser;
- break;
- case DRI:
- mjpeg_decode_dri(s);
- break;
- case SOF1:
- case SOF5:
- case SOF6:
- case SOF7:
- case SOF9:
- case SOF10:
- case SOF11:
- case SOF13:
- case SOF14:
- case SOF15:
- case JPG:
- av_log(s->avctx, AV_LOG_ERROR, "mjpeg: unsupported coding type (%x)\n", start_code);
- break;
-// default:
-// printf("mjpeg: unsupported marker (%x)\n", start_code);
-// break;
- }
-
-not_the_end:
- /* eof process start code */
- buf_ptr += (get_bits_count(&s->gb)+7)/8;
- dprintf("marker parser used %d bytes (%d bits)\n",
- (get_bits_count(&s->gb)+7)/8, get_bits_count(&s->gb));
- }
- }
- }
-the_end:
- dprintf("mjpeg decode frame unused %d bytes\n", buf_end - buf_ptr);
-// return buf_end - buf_ptr;
- return buf_ptr - buf;
-}
-
-static int mjpegb_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- MJpegDecodeContext *s = avctx->priv_data;
- uint8_t *buf_end, *buf_ptr;
- AVFrame *picture = data;
- GetBitContext hgb; /* for the header */
- uint32_t dqt_offs, dht_offs, sof_offs, sos_offs, second_field_offs;
- uint32_t field_size, sod_offs;
-
- buf_ptr = buf;
- buf_end = buf + buf_size;
-
-read_header:
- /* reset on every SOI */
- s->restart_interval = 0;
- s->restart_count = 0;
- s->mjpb_skiptosod = 0;
-
- init_get_bits(&hgb, buf_ptr, /*buf_size*/(buf_end - buf_ptr)*8);
-
- skip_bits(&hgb, 32); /* reserved zeros */
-
- if (get_bits_long(&hgb, 32) != be2me_32(ff_get_fourcc("mjpg")))
- {
- dprintf("not mjpeg-b (bad fourcc)\n");
- return 0;
- }
-
- field_size = get_bits_long(&hgb, 32); /* field size */
- dprintf("field size: 0x%x\n", field_size);
- skip_bits(&hgb, 32); /* padded field size */
- second_field_offs = get_bits_long(&hgb, 32);
- dprintf("second field offs: 0x%x\n", second_field_offs);
- if (second_field_offs)
- s->interlaced = 1;
-
- dqt_offs = get_bits_long(&hgb, 32);
- dprintf("dqt offs: 0x%x\n", dqt_offs);
- if (dqt_offs)
- {
- init_get_bits(&s->gb, buf+dqt_offs, (buf_end - (buf+dqt_offs))*8);
- s->start_code = DQT;
- mjpeg_decode_dqt(s);
- }
-
- dht_offs = get_bits_long(&hgb, 32);
- dprintf("dht offs: 0x%x\n", dht_offs);
- if (dht_offs)
- {
- init_get_bits(&s->gb, buf+dht_offs, (buf_end - (buf+dht_offs))*8);
- s->start_code = DHT;
- mjpeg_decode_dht(s);
- }
-
- sof_offs = get_bits_long(&hgb, 32);
- dprintf("sof offs: 0x%x\n", sof_offs);
- if (sof_offs)
- {
- init_get_bits(&s->gb, buf+sof_offs, (buf_end - (buf+sof_offs))*8);
- s->start_code = SOF0;
- if (mjpeg_decode_sof(s) < 0)
- return -1;
- }
-
- sos_offs = get_bits_long(&hgb, 32);
- dprintf("sos offs: 0x%x\n", sos_offs);
- sod_offs = get_bits_long(&hgb, 32);
- dprintf("sod offs: 0x%x\n", sod_offs);
- if (sos_offs)
- {
-// init_get_bits(&s->gb, buf+sos_offs, (buf_end - (buf+sos_offs))*8);
- init_get_bits(&s->gb, buf+sos_offs, field_size*8);
- s->mjpb_skiptosod = (sod_offs - sos_offs - show_bits(&s->gb, 16));
- s->start_code = SOS;
- mjpeg_decode_sos(s);
- }
-
- if (s->interlaced) {
- s->bottom_field ^= 1;
- /* if not bottom field, do not output image yet */
- if (s->bottom_field && second_field_offs)
- {
- buf_ptr = buf + second_field_offs;
- second_field_offs = 0;
- goto read_header;
- }
- }
-
- //XXX FIXME factorize, this looks very similar to the EOI code
-
- *picture= s->picture;
- *data_size = sizeof(AVFrame);
-
- if(!s->lossless){
- picture->quality= FFMAX(FFMAX(s->qscale[0], s->qscale[1]), s->qscale[2]);
- picture->qstride= 0;
- picture->qscale_table= s->qscale_table;
- memset(picture->qscale_table, picture->quality, (s->width+15)/16);
- if(avctx->debug & FF_DEBUG_QP)
- av_log(avctx, AV_LOG_DEBUG, "QP: %d\n", picture->quality);
- picture->quality*= FF_QP2LAMBDA;
- }
-
- return buf_ptr - buf;
-}
-
-#include "sp5x.h"
-
-static int sp5x_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
-#if 0
- MJpegDecodeContext *s = avctx->priv_data;
-#endif
- const int qscale = 5;
- uint8_t *buf_ptr, *buf_end, *recoded;
- int i = 0, j = 0;
-
- if (!avctx->width || !avctx->height)
- return -1;
-
- buf_ptr = buf;
- buf_end = buf + buf_size;
-
-#if 1
- recoded = av_mallocz(buf_size + 1024);
- if (!recoded)
- return -1;
-
- /* SOI */
- recoded[j++] = 0xFF;
- recoded[j++] = 0xD8;
-
- memcpy(recoded+j, &sp5x_data_dqt[0], sizeof(sp5x_data_dqt));
- memcpy(recoded+j+5, &sp5x_quant_table[qscale * 2], 64);
- memcpy(recoded+j+70, &sp5x_quant_table[(qscale * 2) + 1], 64);
- j += sizeof(sp5x_data_dqt);
-
- memcpy(recoded+j, &sp5x_data_dht[0], sizeof(sp5x_data_dht));
- j += sizeof(sp5x_data_dht);
-
- memcpy(recoded+j, &sp5x_data_sof[0], sizeof(sp5x_data_sof));
- recoded[j+5] = (avctx->coded_height >> 8) & 0xFF;
- recoded[j+6] = avctx->coded_height & 0xFF;
- recoded[j+7] = (avctx->coded_width >> 8) & 0xFF;
- recoded[j+8] = avctx->coded_width & 0xFF;
- j += sizeof(sp5x_data_sof);
-
- memcpy(recoded+j, &sp5x_data_sos[0], sizeof(sp5x_data_sos));
- j += sizeof(sp5x_data_sos);
-
- for (i = 14; i < buf_size && j < buf_size+1024-2; i++)
- {
- recoded[j++] = buf[i];
- if (buf[i] == 0xff)
- recoded[j++] = 0;
- }
-
- /* EOI */
- recoded[j++] = 0xFF;
- recoded[j++] = 0xD9;
-
- i = mjpeg_decode_frame(avctx, data, data_size, recoded, j);
-
- av_free(recoded);
-
-#else
- /* SOF */
- s->bits = 8;
- s->width = avctx->coded_width;
- s->height = avctx->coded_height;
- s->nb_components = 3;
- s->component_id[0] = 0;
- s->h_count[0] = 2;
- s->v_count[0] = 2;
- s->quant_index[0] = 0;
- s->component_id[1] = 1;
- s->h_count[1] = 1;
- s->v_count[1] = 1;
- s->quant_index[1] = 1;
- s->component_id[2] = 2;
- s->h_count[2] = 1;
- s->v_count[2] = 1;
- s->quant_index[2] = 1;
- s->h_max = 2;
- s->v_max = 2;
-
- s->qscale_table = av_mallocz((s->width+15)/16);
- avctx->pix_fmt = s->cs_itu601 ? PIX_FMT_YUV420P : PIX_FMT_YUVJ420;
- s->interlaced = 0;
-
- s->picture.reference = 0;
- if (avctx->get_buffer(avctx, &s->picture) < 0)
- {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
-
- s->picture.pict_type = I_TYPE;
- s->picture.key_frame = 1;
-
- for (i = 0; i < 3; i++)
- s->linesize[i] = s->picture.linesize[i] << s->interlaced;
-
- /* DQT */
- for (i = 0; i < 64; i++)
- {
- j = s->scantable.permutated[i];
- s->quant_matrixes[0][j] = sp5x_quant_table[(qscale * 2) + i];
- }
- s->qscale[0] = FFMAX(
- s->quant_matrixes[0][s->scantable.permutated[1]],
- s->quant_matrixes[0][s->scantable.permutated[8]]) >> 1;
-
- for (i = 0; i < 64; i++)
- {
- j = s->scantable.permutated[i];
- s->quant_matrixes[1][j] = sp5x_quant_table[(qscale * 2) + 1 + i];
- }
- s->qscale[1] = FFMAX(
- s->quant_matrixes[1][s->scantable.permutated[1]],
- s->quant_matrixes[1][s->scantable.permutated[8]]) >> 1;
-
- /* DHT */
-
- /* SOS */
- s->comp_index[0] = 0;
- s->nb_blocks[0] = s->h_count[0] * s->v_count[0];
- s->h_scount[0] = s->h_count[0];
- s->v_scount[0] = s->v_count[0];
- s->dc_index[0] = 0;
- s->ac_index[0] = 0;
-
- s->comp_index[1] = 1;
- s->nb_blocks[1] = s->h_count[1] * s->v_count[1];
- s->h_scount[1] = s->h_count[1];
- s->v_scount[1] = s->v_count[1];
- s->dc_index[1] = 1;
- s->ac_index[1] = 1;
-
- s->comp_index[2] = 2;
- s->nb_blocks[2] = s->h_count[2] * s->v_count[2];
- s->h_scount[2] = s->h_count[2];
- s->v_scount[2] = s->v_count[2];
- s->dc_index[2] = 1;
- s->ac_index[2] = 1;
-
- for (i = 0; i < 3; i++)
- s->last_dc[i] = 1024;
-
- s->mb_width = (s->width * s->h_max * 8 -1) / (s->h_max * 8);
- s->mb_height = (s->height * s->v_max * 8 -1) / (s->v_max * 8);
-
- init_get_bits(&s->gb, buf+14, (buf_size-14)*8);
-
- return mjpeg_decode_scan(s);
-#endif
-
- return i;
-}
-
-static int mjpeg_decode_end(AVCodecContext *avctx)
-{
- MJpegDecodeContext *s = avctx->priv_data;
- int i, j;
-
- av_free(s->buffer);
- av_free(s->qscale_table);
-
- for(i=0;i<2;i++) {
- for(j=0;j<4;j++)
- free_vlc(&s->vlcs[i][j]);
- }
- return 0;
-}
-
-static int mjpega_dump_header(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args,
- uint8_t **poutbuf, int *poutbuf_size,
- const uint8_t *buf, int buf_size, int keyframe)
-{
- uint8_t *poutbufp;
- int i;
-
- if (avctx->codec_id != CODEC_ID_MJPEG) {
- av_log(avctx, AV_LOG_ERROR, "mjpega bitstream filter only applies to mjpeg codec\n");
- return 0;
- }
-
- *poutbuf_size = 0;
- *poutbuf = av_malloc(buf_size + 44 + FF_INPUT_BUFFER_PADDING_SIZE);
- poutbufp = *poutbuf;
- bytestream_put_byte(&poutbufp, 0xff);
- bytestream_put_byte(&poutbufp, SOI);
- bytestream_put_byte(&poutbufp, 0xff);
- bytestream_put_byte(&poutbufp, APP1);
- bytestream_put_be16(&poutbufp, 42); /* size */
- bytestream_put_be32(&poutbufp, 0);
- bytestream_put_buffer(&poutbufp, "mjpg", 4);
- bytestream_put_be32(&poutbufp, buf_size + 44); /* field size */
- bytestream_put_be32(&poutbufp, buf_size + 44); /* pad field size */
- bytestream_put_be32(&poutbufp, 0); /* next ptr */
-
- for (i = 0; i < buf_size - 1; i++) {
- if (buf[i] == 0xff) {
- switch (buf[i + 1]) {
- case DQT: /* quant off */
- case DHT: /* huff off */
- case SOF0: /* image off */
- bytestream_put_be32(&poutbufp, i + 46);
- break;
- case SOS:
- bytestream_put_be32(&poutbufp, i + 46); /* scan off */
- bytestream_put_be32(&poutbufp, i + 46 + AV_RB16(buf + i + 2)); /* data off */
- bytestream_put_buffer(&poutbufp, buf + 2, buf_size - 2); /* skip already written SOI */
- *poutbuf_size = poutbufp - *poutbuf;
- return 1;
- case APP1:
- if (i + 8 < buf_size && AV_RL32(buf + i + 8) == ff_get_fourcc("mjpg")) {
- av_log(avctx, AV_LOG_ERROR, "bitstream already formatted\n");
- memcpy(*poutbuf, buf, buf_size);
- *poutbuf_size = buf_size;
- return 1;
- }
- }
- }
- }
- av_freep(poutbuf);
- av_log(avctx, AV_LOG_ERROR, "could not find SOS marker in bitstream\n");
- return 0;
-}
-
-AVCodec mjpeg_decoder = {
- "mjpeg",
- CODEC_TYPE_VIDEO,
- CODEC_ID_MJPEG,
- sizeof(MJpegDecodeContext),
- mjpeg_decode_init,
- NULL,
- mjpeg_decode_end,
- mjpeg_decode_frame,
- CODEC_CAP_DR1,
- NULL
-};
-
-AVCodec mjpegb_decoder = {
- "mjpegb",
- CODEC_TYPE_VIDEO,
- CODEC_ID_MJPEGB,
- sizeof(MJpegDecodeContext),
- mjpeg_decode_init,
- NULL,
- mjpeg_decode_end,
- mjpegb_decode_frame,
- CODEC_CAP_DR1,
- NULL
-};
-
-AVCodec sp5x_decoder = {
- "sp5x",
- CODEC_TYPE_VIDEO,
- CODEC_ID_SP5X,
- sizeof(MJpegDecodeContext),
- mjpeg_decode_init,
- NULL,
- mjpeg_decode_end,
- sp5x_decode_frame,
- CODEC_CAP_DR1,
- NULL
-};
-
-#ifdef CONFIG_ENCODERS
-AVCodec ljpeg_encoder = { //FIXME avoid MPV_* lossless jpeg shouldnt need them
- "ljpeg",
- CODEC_TYPE_VIDEO,
- CODEC_ID_LJPEG,
- sizeof(MpegEncContext),
- MPV_encode_init,
- encode_picture_lossless,
- MPV_encode_end,
-};
-#endif
-
-AVCodecParser mjpeg_parser = {
- { CODEC_ID_MJPEG },
- sizeof(ParseContext),
- NULL,
- jpeg_parse,
- ff_parse_close,
-};
-
-AVBitStreamFilter mjpega_dump_header_bsf = {
- "mjpegadump",
- 0,
- mjpega_dump_header,
-};
diff --git a/src/libffmpeg/libavcodec/mlib/Makefile.am b/src/libffmpeg/libavcodec/mlib/Makefile.am
deleted file mode 100644
index 4861a0463..000000000
--- a/src/libffmpeg/libavcodec/mlib/Makefile.am
+++ /dev/null
@@ -1,18 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-AM_CPPFLAGS = $(LIBFFMPEG_CPPFLAGS) -I$(top_srcdir)/src/libffmpeg/libavutil -I$(top_srcdir)/src/libffmpeg -I$(top_builddir)/src/libffmpeg
-AM_CFLAGS = -fno-strict-aliasing
-ASFLAGS =
-
-noinst_LTLIBRARIES = libavcodec_mlib.la
-
-libavcodec_mlib_src = dsputil_mlib.c
-libavcodec_mlib_dummy = libavcodec_mlib_dummy.c
-
-EXTRA_DIST = $(libavcodec_mlib_src) $(libavcodec_mlib_dummy)
-
-if HAVE_MLIB
-mlib_modules = $(libavcodec_mlib_src)
-endif
-
-libavcodec_mlib_la_SOURCES = $(mlib_modules) $(libavcodec_mlib_dummy)
diff --git a/src/libffmpeg/libavcodec/mlib/dsputil_mlib.c b/src/libffmpeg/libavcodec/mlib/dsputil_mlib.c
deleted file mode 100644
index 59c56b1dd..000000000
--- a/src/libffmpeg/libavcodec/mlib/dsputil_mlib.c
+++ /dev/null
@@ -1,466 +0,0 @@
-/*
- * Sun mediaLib optimized DSP utils
- * Copyright (c) 2001 Fabrice Bellard.
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "../dsputil.h"
-#include "../mpegvideo.h"
-
-#include "../../../xine-utils/xineutils.h"
-
-#include <mlib_types.h>
-#include <mlib_status.h>
-#include <mlib_sys.h>
-#include <mlib_algebra.h>
-#include <mlib_video.h>
-
-/* misc */
-
-static void get_pixels_mlib(DCTELEM *restrict block, const uint8_t *pixels, int line_size)
-{
- int i;
-
- for (i=0;i<8;i++) {
- mlib_VectorConvert_S16_U8_Mod((mlib_s16 *)block, (mlib_u8 *)pixels, 8);
-
- pixels += line_size;
- block += 8;
- }
-}
-
-static void diff_pixels_mlib(DCTELEM *restrict block, const uint8_t *s1, const uint8_t *s2, int line_size)
-{
- int i;
-
- for (i=0;i<8;i++) {
- mlib_VectorSub_S16_U8_Mod((mlib_s16 *)block, (mlib_u8 *)s1, (mlib_u8 *)s2, 8);
-
- s1 += line_size;
- s2 += line_size;
- block += 8;
- }
-}
-
-static void add_pixels_clamped_mlib(const DCTELEM *block, uint8_t *pixels, int line_size)
-{
- mlib_VideoAddBlock_U8_S16(pixels, (mlib_s16 *)block, line_size);
-}
-
-/* put block, width 16 pixel, height 8/16 */
-
-static void put_pixels16_mlib (uint8_t * dest, const uint8_t * ref,
- int stride, int height)
-{
- switch (height) {
- case 8:
- mlib_VideoCopyRef_U8_U8_16x8(dest, (uint8_t *)ref, stride);
- break;
-
- case 16:
- mlib_VideoCopyRef_U8_U8_16x16(dest, (uint8_t *)ref, stride);
- break;
-
- default:
- assert(0);
- }
-}
-
-static void put_pixels16_x2_mlib (uint8_t * dest, const uint8_t * ref,
- int stride, int height)
-{
- switch (height) {
- case 8:
- mlib_VideoInterpX_U8_U8_16x8(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 16:
- mlib_VideoInterpX_U8_U8_16x16(dest, (uint8_t *)ref, stride, stride);
- break;
-
- default:
- assert(0);
- }
-}
-
-static void put_pixels16_y2_mlib (uint8_t * dest, const uint8_t * ref,
- int stride, int height)
-{
- switch (height) {
- case 8:
- mlib_VideoInterpY_U8_U8_16x8(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 16:
- mlib_VideoInterpY_U8_U8_16x16(dest, (uint8_t *)ref, stride, stride);
- break;
-
- default:
- assert(0);
- }
-}
-
-static void put_pixels16_xy2_mlib(uint8_t * dest, const uint8_t * ref,
- int stride, int height)
-{
- switch (height) {
- case 8:
- mlib_VideoInterpXY_U8_U8_16x8(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 16:
- mlib_VideoInterpXY_U8_U8_16x16(dest, (uint8_t *)ref, stride, stride);
- break;
-
- default:
- assert(0);
- }
-}
-
-/* put block, width 8 pixel, height 4/8/16 */
-
-static void put_pixels8_mlib (uint8_t * dest, const uint8_t * ref,
- int stride, int height)
-{
- switch (height) {
- case 4:
- mlib_VideoCopyRef_U8_U8_8x4(dest, (uint8_t *)ref, stride);
- break;
-
- case 8:
- mlib_VideoCopyRef_U8_U8_8x8(dest, (uint8_t *)ref, stride);
- break;
-
- case 16:
- mlib_VideoCopyRef_U8_U8_8x16(dest, (uint8_t *)ref, stride);
- break;
-
- default:
- assert(0);
- }
-}
-
-static void put_pixels8_x2_mlib (uint8_t * dest, const uint8_t * ref,
- int stride, int height)
-{
- switch (height) {
- case 4:
- mlib_VideoInterpX_U8_U8_8x4(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 8:
- mlib_VideoInterpX_U8_U8_8x8(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 16:
- mlib_VideoInterpX_U8_U8_8x16(dest, (uint8_t *)ref, stride, stride);
- break;
-
- default:
- assert(0);
- }
-}
-
-static void put_pixels8_y2_mlib (uint8_t * dest, const uint8_t * ref,
- int stride, int height)
-{
- switch (height) {
- case 4:
- mlib_VideoInterpY_U8_U8_8x4(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 8:
- mlib_VideoInterpY_U8_U8_8x8(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 16:
- mlib_VideoInterpY_U8_U8_8x16(dest, (uint8_t *)ref, stride, stride);
- break;
-
- default:
- assert(0);
- }
-}
-
-static void put_pixels8_xy2_mlib(uint8_t * dest, const uint8_t * ref,
- int stride, int height)
-{
- switch (height) {
- case 4:
- mlib_VideoInterpXY_U8_U8_8x4(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 8:
- mlib_VideoInterpXY_U8_U8_8x8(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 16:
- mlib_VideoInterpXY_U8_U8_8x16(dest, (uint8_t *)ref, stride, stride);
- break;
-
- default:
- assert(0);
- }
-}
-
-/* average block, width 16 pixel, height 8/16 */
-
-static void avg_pixels16_mlib (uint8_t * dest, const uint8_t * ref,
- int stride, int height)
-{
- switch (height) {
- case 8:
- mlib_VideoCopyRefAve_U8_U8_16x8(dest, (uint8_t *)ref, stride);
- break;
-
- case 16:
- mlib_VideoCopyRefAve_U8_U8_16x16(dest, (uint8_t *)ref, stride);
- break;
-
- default:
- assert(0);
- }
-}
-
-static void avg_pixels16_x2_mlib (uint8_t * dest, const uint8_t * ref,
- int stride, int height)
-{
- switch (height) {
- case 8:
- mlib_VideoInterpAveX_U8_U8_16x8(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 16:
- mlib_VideoInterpAveX_U8_U8_16x16(dest, (uint8_t *)ref, stride, stride);
- break;
-
- default:
- assert(0);
- }
-}
-
-static void avg_pixels16_y2_mlib (uint8_t * dest, const uint8_t * ref,
- int stride, int height)
-{
- switch (height) {
- case 8:
- mlib_VideoInterpAveY_U8_U8_16x8(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 16:
- mlib_VideoInterpAveY_U8_U8_16x16(dest, (uint8_t *)ref, stride, stride);
- break;
-
- default:
- assert(0);
- }
-}
-
-static void avg_pixels16_xy2_mlib(uint8_t * dest, const uint8_t * ref,
- int stride, int height)
-{
- switch (height) {
- case 8:
- mlib_VideoInterpAveXY_U8_U8_16x8(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 16:
- mlib_VideoInterpAveXY_U8_U8_16x16(dest, (uint8_t *)ref, stride, stride);
- break;
-
- default:
- assert(0);
- }
-}
-
-/* average block, width 8 pixel, height 4/8/16 */
-
-static void avg_pixels8_mlib (uint8_t * dest, const uint8_t * ref,
- int stride, int height)
-{
- switch (height) {
- case 4:
- mlib_VideoCopyRefAve_U8_U8_8x4(dest, (uint8_t *)ref, stride);
- break;
-
- case 8:
- mlib_VideoCopyRefAve_U8_U8_8x8(dest, (uint8_t *)ref, stride);
- break;
-
- case 16:
- mlib_VideoCopyRefAve_U8_U8_8x16(dest, (uint8_t *)ref, stride);
- break;
-
- default:
- assert(0);
- }
-}
-
-static void avg_pixels8_x2_mlib (uint8_t * dest, const uint8_t * ref,
- int stride, int height)
-{
- switch (height) {
- case 4:
- mlib_VideoInterpAveX_U8_U8_8x4(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 8:
- mlib_VideoInterpAveX_U8_U8_8x8(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 16:
- mlib_VideoInterpAveX_U8_U8_8x16(dest, (uint8_t *)ref, stride, stride);
- break;
-
- default:
- assert(0);
- }
-}
-
-static void avg_pixels8_y2_mlib (uint8_t * dest, const uint8_t * ref,
- int stride, int height)
-{
- switch (height) {
- case 4:
- mlib_VideoInterpAveY_U8_U8_8x4(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 8:
- mlib_VideoInterpAveY_U8_U8_8x8(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 16:
- mlib_VideoInterpAveY_U8_U8_8x16(dest, (uint8_t *)ref, stride, stride);
- break;
-
- default:
- assert(0);
- }
-}
-
-static void avg_pixels8_xy2_mlib(uint8_t * dest, const uint8_t * ref,
- int stride, int height)
-{
- switch (height) {
- case 4:
- mlib_VideoInterpAveXY_U8_U8_8x4(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 8:
- mlib_VideoInterpAveXY_U8_U8_8x8(dest, (uint8_t *)ref, stride, stride);
- break;
-
- case 16:
- mlib_VideoInterpAveXY_U8_U8_8x16(dest, (uint8_t *)ref, stride, stride);
- break;
-
- default:
- assert(0);
- }
-}
-
-/* swap byte order of a buffer */
-
-static void bswap_buf_mlib(uint32_t *dst, uint32_t *src, int w)
-{
- mlib_VectorReverseByteOrder_U32_U32(dst, src, w);
-}
-
-/* transformations */
-
-static void ff_idct_put_mlib(uint8_t *dest, int line_size, DCTELEM *data)
-{
- int i;
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-
- mlib_VideoIDCT8x8_S16_S16 (data, data);
-
- for(i=0;i<8;i++) {
- dest[0] = cm[data[0]];
- dest[1] = cm[data[1]];
- dest[2] = cm[data[2]];
- dest[3] = cm[data[3]];
- dest[4] = cm[data[4]];
- dest[5] = cm[data[5]];
- dest[6] = cm[data[6]];
- dest[7] = cm[data[7]];
-
- dest += line_size;
- data += 8;
- }
-}
-
-static void ff_idct_add_mlib(uint8_t *dest, int line_size, DCTELEM *data)
-{
- mlib_VideoIDCT8x8_S16_S16 (data, data);
- mlib_VideoAddBlock_U8_S16(dest, (mlib_s16 *)data, line_size);
-}
-
-static void ff_idct_mlib(DCTELEM *data)
-{
- mlib_VideoIDCT8x8_S16_S16 (data, data);
-}
-
-static void ff_fdct_mlib(DCTELEM *data)
-{
- mlib_VideoDCT8x8_S16_S16 (data, data);
-}
-
-void dsputil_init_mlib(DSPContext* c, AVCodecContext *avctx)
-{
- c->get_pixels = get_pixels_mlib;
- c->diff_pixels = diff_pixels_mlib;
- c->add_pixels_clamped = add_pixels_clamped_mlib;
-
- c->put_pixels_tab[0][0] = put_pixels16_mlib;
- c->put_pixels_tab[0][1] = put_pixels16_x2_mlib;
- c->put_pixels_tab[0][2] = put_pixels16_y2_mlib;
- c->put_pixels_tab[0][3] = put_pixels16_xy2_mlib;
- c->put_pixels_tab[1][0] = put_pixels8_mlib;
- c->put_pixels_tab[1][1] = put_pixels8_x2_mlib;
- c->put_pixels_tab[1][2] = put_pixels8_y2_mlib;
- c->put_pixels_tab[1][3] = put_pixels8_xy2_mlib;
-
- c->avg_pixels_tab[0][0] = avg_pixels16_mlib;
- c->avg_pixels_tab[0][1] = avg_pixels16_x2_mlib;
- c->avg_pixels_tab[0][2] = avg_pixels16_y2_mlib;
- c->avg_pixels_tab[0][3] = avg_pixels16_xy2_mlib;
- c->avg_pixels_tab[1][0] = avg_pixels8_mlib;
- c->avg_pixels_tab[1][1] = avg_pixels8_x2_mlib;
- c->avg_pixels_tab[1][2] = avg_pixels8_y2_mlib;
- c->avg_pixels_tab[1][3] = avg_pixels8_xy2_mlib;
-
- c->put_no_rnd_pixels_tab[0][0] = put_pixels16_mlib;
- c->put_no_rnd_pixels_tab[1][0] = put_pixels8_mlib;
-
- c->bswap_buf = bswap_buf_mlib;
-}
-
-void MPV_common_init_mlib(MpegEncContext *s)
-{
- if(s->avctx->dct_algo==FF_DCT_AUTO || s->avctx->dct_algo==FF_DCT_MLIB){
- s->dsp.fdct = ff_fdct_mlib;
- }
-
- if(s->avctx->idct_algo==FF_IDCT_AUTO || s->avctx->idct_algo==FF_IDCT_MLIB){
- s->dsp.idct_put= ff_idct_put_mlib;
- s->dsp.idct_add= ff_idct_add_mlib;
- s->dsp.idct = ff_idct_mlib;
- s->dsp.idct_permutation_type= FF_NO_IDCT_PERM;
- }
-}
diff --git a/src/libffmpeg/libavcodec/mlib/libavcodec_mlib_dummy.c b/src/libffmpeg/libavcodec/mlib/libavcodec_mlib_dummy.c
deleted file mode 100644
index a09ee4e28..000000000
--- a/src/libffmpeg/libavcodec/mlib/libavcodec_mlib_dummy.c
+++ /dev/null
@@ -1,2 +0,0 @@
-
-char libavcodec_mlib_dummy;
diff --git a/src/libffmpeg/libavcodec/mmvideo.c b/src/libffmpeg/libavcodec/mmvideo.c
deleted file mode 100644
index 7ba1321cb..000000000
--- a/src/libffmpeg/libavcodec/mmvideo.c
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * American Laser Games MM Video Decoder
- * Copyright (c) 2006 Peter Ross
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file mm.c
- * American Laser Games MM Video Decoder
- * by Peter Ross (suxen_drol at hotmail dot com)
- *
- * The MM format was used by IBM-PC ports of ALG's "arcade shooter" games,
- * including Mad Dog McCree and Crime Patrol.
- *
- * Technical details here:
- * http://wiki.multimedia.cx/index.php?title=American_Laser_Games_MM
- */
-
-#include "avcodec.h"
-
-#define MM_PREAMBLE_SIZE 6
-
-#define MM_TYPE_INTER 0x5
-#define MM_TYPE_INTRA 0x8
-#define MM_TYPE_INTRA_HH 0xc
-#define MM_TYPE_INTER_HH 0xd
-#define MM_TYPE_INTRA_HHV 0xe
-#define MM_TYPE_INTER_HHV 0xf
-
-typedef struct MmContext {
- AVCodecContext *avctx;
- AVFrame frame;
-} MmContext;
-
-static int mm_decode_init(AVCodecContext *avctx)
-{
- MmContext *s = avctx->priv_data;
-
- s->avctx = avctx;
-
- if (s->avctx->palctrl == NULL) {
- av_log(avctx, AV_LOG_ERROR, "mmvideo: palette expected.\n");
- return -1;
- }
-
- avctx->pix_fmt = PIX_FMT_PAL8;
- avctx->has_b_frames = 0;
-
- if (avcodec_check_dimensions(avctx, avctx->width, avctx->height))
- return -1;
-
- s->frame.reference = 1;
- if (avctx->get_buffer(avctx, &s->frame)) {
- av_log(s->avctx, AV_LOG_ERROR, "mmvideo: get_buffer() failed\n");
- return -1;
- }
-
- return 0;
-}
-
-static void mm_decode_intra(MmContext * s, int half_horiz, int half_vert, const uint8_t *buf, int buf_size)
-{
- int i, x, y;
- i=0; x=0; y=0;
-
- while(i<buf_size) {
- int run_length, color;
-
- if (buf[i] & 0x80) {
- run_length = 1;
- color = buf[i];
- i++;
- }else{
- run_length = (buf[i] & 0x7f) + 2;
- color = buf[i+1];
- i+=2;
- }
-
- if (half_horiz)
- run_length *=2;
-
- if (color) {
- memset(s->frame.data[0] + y*s->frame.linesize[0] + x, color, run_length);
- if (half_vert)
- memset(s->frame.data[0] + (y+1)*s->frame.linesize[0] + x, color, run_length);
- }
- x+= run_length;
-
- if (x >= s->avctx->width) {
- x=0;
- y += half_vert ? 2 : 1;
- }
- }
-}
-
-static void mm_decode_inter(MmContext * s, int half_horiz, int half_vert, const uint8_t *buf, int buf_size)
-{
- const int data_ptr = 2 + AV_RL16(&buf[0]);
- int d, r, y;
- d = data_ptr; r = 2; y = 0;
-
- while(r < data_ptr) {
- int i, j;
- int length = buf[r] & 0x7f;
- int x = buf[r+1] + ((buf[r] & 0x80) << 1);
- r += 2;
-
- if (length==0) {
- y += x;
- continue;
- }
-
- for(i=0; i<length; i++) {
- for(j=0; j<8; j++) {
- int replace = (buf[r+i] >> (7-j)) & 1;
- if (replace) {
- int color = buf[d];
- s->frame.data[0][y*s->frame.linesize[0] + x] = color;
- if (half_horiz)
- s->frame.data[0][y*s->frame.linesize[0] + x + 1] = color;
- if (half_vert) {
- s->frame.data[0][(y+1)*s->frame.linesize[0] + x] = color;
- if (half_horiz)
- s->frame.data[0][(y+1)*s->frame.linesize[0] + x + 1] = color;
- }
- d++;
- }
- x += half_horiz ? 2 : 1;
- }
- }
-
- r += length;
- y += half_vert ? 2 : 1;
- }
-}
-
-static int mm_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- MmContext *s = avctx->priv_data;
- AVPaletteControl *palette_control = avctx->palctrl;
- int type;
-
- if (palette_control->palette_changed) {
- memcpy(s->frame.data[1], palette_control->palette, AVPALETTE_SIZE);
- palette_control->palette_changed = 0;
- }
-
- type = AV_RL16(&buf[0]);
- buf += MM_PREAMBLE_SIZE;
- buf_size -= MM_PREAMBLE_SIZE;
-
- switch(type) {
- case MM_TYPE_INTRA : mm_decode_intra(s, 0, 0, buf, buf_size); break;
- case MM_TYPE_INTRA_HH : mm_decode_intra(s, 1, 0, buf, buf_size); break;
- case MM_TYPE_INTRA_HHV : mm_decode_intra(s, 1, 1, buf, buf_size); break;
- case MM_TYPE_INTER : mm_decode_inter(s, 0, 0, buf, buf_size); break;
- case MM_TYPE_INTER_HH : mm_decode_inter(s, 1, 0, buf, buf_size); break;
- case MM_TYPE_INTER_HHV : mm_decode_inter(s, 1, 1, buf, buf_size); break;
- default :
- return -1;
- }
-
- *data_size = sizeof(AVFrame);
- *(AVFrame*)data = s->frame;
-
- return buf_size;
-}
-
-static int mm_decode_end(AVCodecContext *avctx)
-{
- MmContext *s = avctx->priv_data;
-
- if(s->frame.data[0])
- avctx->release_buffer(avctx, &s->frame);
-
- return 0;
-}
-
-AVCodec mmvideo_decoder = {
- "mmvideo",
- CODEC_TYPE_VIDEO,
- CODEC_ID_MMVIDEO,
- sizeof(MmContext),
- mm_decode_init,
- NULL,
- mm_decode_end,
- mm_decode_frame,
- CODEC_CAP_DR1,
-};
diff --git a/src/libffmpeg/libavcodec/motion_est.c b/src/libffmpeg/libavcodec/motion_est.c
deleted file mode 100644
index a11787bac..000000000
--- a/src/libffmpeg/libavcodec/motion_est.c
+++ /dev/null
@@ -1,2149 +0,0 @@
-/*
- * Motion estimation
- * Copyright (c) 2000,2001 Fabrice Bellard.
- * Copyright (c) 2002-2004 Michael Niedermayer
- *
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * new Motion Estimation (X1/EPZS) by Michael Niedermayer <michaelni@gmx.at>
- */
-
-/* motion estimation only needed for encoders */
-#ifdef CONFIG_ENCODERS
-
-/**
- * @file motion_est.c
- * Motion estimation.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <limits.h>
-#include "avcodec.h"
-#include "dsputil.h"
-#include "mpegvideo.h"
-
-#undef NDEBUG
-#include <assert.h>
-
-#define SQ(a) ((a)*(a))
-
-#define P_LEFT P[1]
-#define P_TOP P[2]
-#define P_TOPRIGHT P[3]
-#define P_MEDIAN P[4]
-#define P_MV1 P[9]
-
-static inline int sad_hpel_motion_search(MpegEncContext * s,
- int *mx_ptr, int *my_ptr, int dmin,
- int src_index, int ref_index,
- int size, int h);
-
-static inline int update_map_generation(MotionEstContext *c)
-{
- c->map_generation+= 1<<(ME_MAP_MV_BITS*2);
- if(c->map_generation==0){
- c->map_generation= 1<<(ME_MAP_MV_BITS*2);
- memset(c->map, 0, sizeof(uint32_t)*ME_MAP_SIZE);
- }
- return c->map_generation;
-}
-
-/* shape adaptive search stuff */
-typedef struct Minima{
- int height;
- int x, y;
- int checked;
-}Minima;
-
-static int minima_cmp(const void *a, const void *b){
- const Minima *da = (const Minima *) a;
- const Minima *db = (const Minima *) b;
-
- return da->height - db->height;
-}
-
-#define FLAG_QPEL 1 //must be 1
-#define FLAG_CHROMA 2
-#define FLAG_DIRECT 4
-
-static inline void init_ref(MotionEstContext *c, uint8_t *src[3], uint8_t *ref[3], uint8_t *ref2[3], int x, int y, int ref_index){
- const int offset[3]= {
- y*c-> stride + x,
- ((y*c->uvstride + x)>>1),
- ((y*c->uvstride + x)>>1),
- };
- int i;
- for(i=0; i<3; i++){
- c->src[0][i]= src [i] + offset[i];
- c->ref[0][i]= ref [i] + offset[i];
- }
- if(ref_index){
- for(i=0; i<3; i++){
- c->ref[ref_index][i]= ref2[i] + offset[i];
- }
- }
-}
-
-static int get_flags(MotionEstContext *c, int direct, int chroma){
- return ((c->avctx->flags&CODEC_FLAG_QPEL) ? FLAG_QPEL : 0)
- + (direct ? FLAG_DIRECT : 0)
- + (chroma ? FLAG_CHROMA : 0);
-}
-
-static av_always_inline int cmp(MpegEncContext *s, const int x, const int y, const int subx, const int suby,
- const int size, const int h, int ref_index, int src_index,
- me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags){
- MotionEstContext * const c= &s->me;
- const int stride= c->stride;
- const int uvstride= c->uvstride;
- const int qpel= flags&FLAG_QPEL;
- const int chroma= flags&FLAG_CHROMA;
- const int dxy= subx + (suby<<(1+qpel)); //FIXME log2_subpel?
- const int hx= subx + (x<<(1+qpel));
- const int hy= suby + (y<<(1+qpel));
- uint8_t * const * const ref= c->ref[ref_index];
- uint8_t * const * const src= c->src[src_index];
- int d;
- //FIXME check chroma 4mv, (no crashes ...)
- if(flags&FLAG_DIRECT){
- assert(x >= c->xmin && hx <= c->xmax<<(qpel+1) && y >= c->ymin && hy <= c->ymax<<(qpel+1));
- if(x >= c->xmin && hx <= c->xmax<<(qpel+1) && y >= c->ymin && hy <= c->ymax<<(qpel+1)){
- const int time_pp= s->pp_time;
- const int time_pb= s->pb_time;
- const int mask= 2*qpel+1;
- if(s->mv_type==MV_TYPE_8X8){
- int i;
- for(i=0; i<4; i++){
- int fx = c->direct_basis_mv[i][0] + hx;
- int fy = c->direct_basis_mv[i][1] + hy;
- int bx = hx ? fx - c->co_located_mv[i][0] : c->co_located_mv[i][0]*(time_pb - time_pp)/time_pp + ((i &1)<<(qpel+4));
- int by = hy ? fy - c->co_located_mv[i][1] : c->co_located_mv[i][1]*(time_pb - time_pp)/time_pp + ((i>>1)<<(qpel+4));
- int fxy= (fx&mask) + ((fy&mask)<<(qpel+1));
- int bxy= (bx&mask) + ((by&mask)<<(qpel+1));
-
- uint8_t *dst= c->temp + 8*(i&1) + 8*stride*(i>>1);
- if(qpel){
- c->qpel_put[1][fxy](dst, ref[0] + (fx>>2) + (fy>>2)*stride, stride);
- c->qpel_avg[1][bxy](dst, ref[8] + (bx>>2) + (by>>2)*stride, stride);
- }else{
- c->hpel_put[1][fxy](dst, ref[0] + (fx>>1) + (fy>>1)*stride, stride, 8);
- c->hpel_avg[1][bxy](dst, ref[8] + (bx>>1) + (by>>1)*stride, stride, 8);
- }
- }
- }else{
- int fx = c->direct_basis_mv[0][0] + hx;
- int fy = c->direct_basis_mv[0][1] + hy;
- int bx = hx ? fx - c->co_located_mv[0][0] : (c->co_located_mv[0][0]*(time_pb - time_pp)/time_pp);
- int by = hy ? fy - c->co_located_mv[0][1] : (c->co_located_mv[0][1]*(time_pb - time_pp)/time_pp);
- int fxy= (fx&mask) + ((fy&mask)<<(qpel+1));
- int bxy= (bx&mask) + ((by&mask)<<(qpel+1));
-
- if(qpel){
- c->qpel_put[1][fxy](c->temp , ref[0] + (fx>>2) + (fy>>2)*stride , stride);
- c->qpel_put[1][fxy](c->temp + 8 , ref[0] + (fx>>2) + (fy>>2)*stride + 8 , stride);
- c->qpel_put[1][fxy](c->temp + 8*stride, ref[0] + (fx>>2) + (fy>>2)*stride + 8*stride, stride);
- c->qpel_put[1][fxy](c->temp + 8 + 8*stride, ref[0] + (fx>>2) + (fy>>2)*stride + 8 + 8*stride, stride);
- c->qpel_avg[1][bxy](c->temp , ref[8] + (bx>>2) + (by>>2)*stride , stride);
- c->qpel_avg[1][bxy](c->temp + 8 , ref[8] + (bx>>2) + (by>>2)*stride + 8 , stride);
- c->qpel_avg[1][bxy](c->temp + 8*stride, ref[8] + (bx>>2) + (by>>2)*stride + 8*stride, stride);
- c->qpel_avg[1][bxy](c->temp + 8 + 8*stride, ref[8] + (bx>>2) + (by>>2)*stride + 8 + 8*stride, stride);
- }else{
- assert((fx>>1) + 16*s->mb_x >= -16);
- assert((fy>>1) + 16*s->mb_y >= -16);
- assert((fx>>1) + 16*s->mb_x <= s->width);
- assert((fy>>1) + 16*s->mb_y <= s->height);
- assert((bx>>1) + 16*s->mb_x >= -16);
- assert((by>>1) + 16*s->mb_y >= -16);
- assert((bx>>1) + 16*s->mb_x <= s->width);
- assert((by>>1) + 16*s->mb_y <= s->height);
-
- c->hpel_put[0][fxy](c->temp, ref[0] + (fx>>1) + (fy>>1)*stride, stride, 16);
- c->hpel_avg[0][bxy](c->temp, ref[8] + (bx>>1) + (by>>1)*stride, stride, 16);
- }
- }
- d = cmp_func(s, c->temp, src[0], stride, 16);
- }else
- d= 256*256*256*32;
- }else{
- int uvdxy; /* no, it might not be used uninitialized */
- if(dxy){
- if(qpel){
- c->qpel_put[size][dxy](c->temp, ref[0] + x + y*stride, stride); //FIXME prototype (add h)
- if(chroma){
- int cx= hx/2;
- int cy= hy/2;
- cx= (cx>>1)|(cx&1);
- cy= (cy>>1)|(cy&1);
- uvdxy= (cx&1) + 2*(cy&1);
- //FIXME x/y wrong, but mpeg4 qpel is sick anyway, we should drop as much of it as possible in favor for h264
- }
- }else{
- c->hpel_put[size][dxy](c->temp, ref[0] + x + y*stride, stride, h);
- if(chroma)
- uvdxy= dxy | (x&1) | (2*(y&1));
- }
- d = cmp_func(s, c->temp, src[0], stride, h);
- }else{
- d = cmp_func(s, src[0], ref[0] + x + y*stride, stride, h);
- if(chroma)
- uvdxy= (x&1) + 2*(y&1);
- }
- if(chroma){
- uint8_t * const uvtemp= c->temp + 16*stride;
- c->hpel_put[size+1][uvdxy](uvtemp , ref[1] + (x>>1) + (y>>1)*uvstride, uvstride, h>>1);
- c->hpel_put[size+1][uvdxy](uvtemp+8, ref[2] + (x>>1) + (y>>1)*uvstride, uvstride, h>>1);
- d += chroma_cmp_func(s, uvtemp , src[1], uvstride, h>>1);
- d += chroma_cmp_func(s, uvtemp+8, src[2], uvstride, h>>1);
- }
- }
-#if 0
- if(full_pel){
- const int index= (((y)<<ME_MAP_SHIFT) + (x))&(ME_MAP_SIZE-1);
- score_map[index]= d;
- }
-
- d += (c->mv_penalty[hx - c->pred_x] + c->mv_penalty[hy - c->pred_y])*c->penalty_factor;
-#endif
- return d;
-}
-
-#include "motion_est_template.c"
-
-static int zero_cmp(void *s, uint8_t *a, uint8_t *b, int stride, int h){
- return 0;
-}
-
-static void zero_hpel(uint8_t *a, const uint8_t *b, int stride, int h){
-}
-
-void ff_init_me(MpegEncContext *s){
- MotionEstContext * const c= &s->me;
- int cache_size= FFMIN(ME_MAP_SIZE>>ME_MAP_SHIFT, 1<<ME_MAP_SHIFT);
- int dia_size= FFMAX(FFABS(s->avctx->dia_size)&255, FFABS(s->avctx->pre_dia_size)&255);
- c->avctx= s->avctx;
-
- if(cache_size < 2*dia_size && !c->stride){
- av_log(s->avctx, AV_LOG_INFO, "ME_MAP size may be a little small for the selected diamond size\n");
- }
-
- ff_set_cmp(&s->dsp, s->dsp.me_pre_cmp, c->avctx->me_pre_cmp);
- ff_set_cmp(&s->dsp, s->dsp.me_cmp, c->avctx->me_cmp);
- ff_set_cmp(&s->dsp, s->dsp.me_sub_cmp, c->avctx->me_sub_cmp);
- ff_set_cmp(&s->dsp, s->dsp.mb_cmp, c->avctx->mb_cmp);
-
- c->flags = get_flags(c, 0, c->avctx->me_cmp &FF_CMP_CHROMA);
- c->sub_flags= get_flags(c, 0, c->avctx->me_sub_cmp&FF_CMP_CHROMA);
- c->mb_flags = get_flags(c, 0, c->avctx->mb_cmp &FF_CMP_CHROMA);
-
-/*FIXME s->no_rounding b_type*/
- if(s->flags&CODEC_FLAG_QPEL){
- c->sub_motion_search= qpel_motion_search;
- c->qpel_avg= s->dsp.avg_qpel_pixels_tab;
- if(s->no_rounding) c->qpel_put= s->dsp.put_no_rnd_qpel_pixels_tab;
- else c->qpel_put= s->dsp.put_qpel_pixels_tab;
- }else{
- if(c->avctx->me_sub_cmp&FF_CMP_CHROMA)
- c->sub_motion_search= hpel_motion_search;
- else if( c->avctx->me_sub_cmp == FF_CMP_SAD
- && c->avctx-> me_cmp == FF_CMP_SAD
- && c->avctx-> mb_cmp == FF_CMP_SAD)
- c->sub_motion_search= sad_hpel_motion_search; // 2050 vs. 2450 cycles
- else
- c->sub_motion_search= hpel_motion_search;
- }
- c->hpel_avg= s->dsp.avg_pixels_tab;
- if(s->no_rounding) c->hpel_put= s->dsp.put_no_rnd_pixels_tab;
- else c->hpel_put= s->dsp.put_pixels_tab;
-
- if(s->linesize){
- c->stride = s->linesize;
- c->uvstride= s->uvlinesize;
- }else{
- c->stride = 16*s->mb_width + 32;
- c->uvstride= 8*s->mb_width + 16;
- }
-
- // 8x8 fullpel search would need a 4x4 chroma compare, which we dont have yet, and even if we had the motion estimation code doesnt expect it
- if(s->codec_id != CODEC_ID_SNOW){
- if((c->avctx->me_cmp&FF_CMP_CHROMA)/* && !s->dsp.me_cmp[2]*/){
- s->dsp.me_cmp[2]= zero_cmp;
- }
- if((c->avctx->me_sub_cmp&FF_CMP_CHROMA) && !s->dsp.me_sub_cmp[2]){
- s->dsp.me_sub_cmp[2]= zero_cmp;
- }
- c->hpel_put[2][0]= c->hpel_put[2][1]=
- c->hpel_put[2][2]= c->hpel_put[2][3]= zero_hpel;
- }
-
- if(s->codec_id == CODEC_ID_H261){
- c->sub_motion_search= no_sub_motion_search;
- }
-
- c->temp= c->scratchpad;
-}
-
-#if 0
-static int pix_dev(uint8_t * pix, int line_size, int mean)
-{
- int s, i, j;
-
- s = 0;
- for (i = 0; i < 16; i++) {
- for (j = 0; j < 16; j += 8) {
- s += FFABS(pix[0]-mean);
- s += FFABS(pix[1]-mean);
- s += FFABS(pix[2]-mean);
- s += FFABS(pix[3]-mean);
- s += FFABS(pix[4]-mean);
- s += FFABS(pix[5]-mean);
- s += FFABS(pix[6]-mean);
- s += FFABS(pix[7]-mean);
- pix += 8;
- }
- pix += line_size - 16;
- }
- return s;
-}
-#endif
-
-static inline void no_motion_search(MpegEncContext * s,
- int *mx_ptr, int *my_ptr)
-{
- *mx_ptr = 16 * s->mb_x;
- *my_ptr = 16 * s->mb_y;
-}
-
-#if 0 /* the use of these functions is inside #if 0 */
-static int full_motion_search(MpegEncContext * s,
- int *mx_ptr, int *my_ptr, int range,
- int xmin, int ymin, int xmax, int ymax, uint8_t *ref_picture)
-{
- int x1, y1, x2, y2, xx, yy, x, y;
- int mx, my, dmin, d;
- uint8_t *pix;
-
- xx = 16 * s->mb_x;
- yy = 16 * s->mb_y;
- x1 = xx - range + 1; /* we loose one pixel to avoid boundary pb with half pixel pred */
- if (x1 < xmin)
- x1 = xmin;
- x2 = xx + range - 1;
- if (x2 > xmax)
- x2 = xmax;
- y1 = yy - range + 1;
- if (y1 < ymin)
- y1 = ymin;
- y2 = yy + range - 1;
- if (y2 > ymax)
- y2 = ymax;
- pix = s->new_picture.data[0] + (yy * s->linesize) + xx;
- dmin = 0x7fffffff;
- mx = 0;
- my = 0;
- for (y = y1; y <= y2; y++) {
- for (x = x1; x <= x2; x++) {
- d = s->dsp.pix_abs[0][0](NULL, pix, ref_picture + (y * s->linesize) + x,
- s->linesize, 16);
- if (d < dmin ||
- (d == dmin &&
- (abs(x - xx) + abs(y - yy)) <
- (abs(mx - xx) + abs(my - yy)))) {
- dmin = d;
- mx = x;
- my = y;
- }
- }
- }
-
- *mx_ptr = mx;
- *my_ptr = my;
-
-#if 0
- if (*mx_ptr < -(2 * range) || *mx_ptr >= (2 * range) ||
- *my_ptr < -(2 * range) || *my_ptr >= (2 * range)) {
- av_log(NULL, AV_LOG_ERROR, "error %d %d\n", *mx_ptr, *my_ptr);
- }
-#endif
- return dmin;
-}
-
-
-static int log_motion_search(MpegEncContext * s,
- int *mx_ptr, int *my_ptr, int range,
- int xmin, int ymin, int xmax, int ymax, uint8_t *ref_picture)
-{
- int x1, y1, x2, y2, xx, yy, x, y;
- int mx, my, dmin, d;
- uint8_t *pix;
-
- xx = s->mb_x << 4;
- yy = s->mb_y << 4;
-
- /* Left limit */
- x1 = xx - range;
- if (x1 < xmin)
- x1 = xmin;
-
- /* Right limit */
- x2 = xx + range;
- if (x2 > xmax)
- x2 = xmax;
-
- /* Upper limit */
- y1 = yy - range;
- if (y1 < ymin)
- y1 = ymin;
-
- /* Lower limit */
- y2 = yy + range;
- if (y2 > ymax)
- y2 = ymax;
-
- pix = s->new_picture.data[0] + (yy * s->linesize) + xx;
- dmin = 0x7fffffff;
- mx = 0;
- my = 0;
-
- do {
- for (y = y1; y <= y2; y += range) {
- for (x = x1; x <= x2; x += range) {
- d = s->dsp.pix_abs[0][0](NULL, pix, ref_picture + (y * s->linesize) + x, s->linesize, 16);
- if (d < dmin || (d == dmin && (abs(x - xx) + abs(y - yy)) < (abs(mx - xx) + abs(my - yy)))) {
- dmin = d;
- mx = x;
- my = y;
- }
- }
- }
-
- range = range >> 1;
-
- x1 = mx - range;
- if (x1 < xmin)
- x1 = xmin;
-
- x2 = mx + range;
- if (x2 > xmax)
- x2 = xmax;
-
- y1 = my - range;
- if (y1 < ymin)
- y1 = ymin;
-
- y2 = my + range;
- if (y2 > ymax)
- y2 = ymax;
-
- } while (range >= 1);
-
-#ifdef DEBUG
- av_log(s->avctx, AV_LOG_DEBUG, "log - MX: %d\tMY: %d\n", mx, my);
-#endif
- *mx_ptr = mx;
- *my_ptr = my;
- return dmin;
-}
-
-static int phods_motion_search(MpegEncContext * s,
- int *mx_ptr, int *my_ptr, int range,
- int xmin, int ymin, int xmax, int ymax, uint8_t *ref_picture)
-{
- int x1, y1, x2, y2, xx, yy, x, y, lastx, d;
- int mx, my, dminx, dminy;
- uint8_t *pix;
-
- xx = s->mb_x << 4;
- yy = s->mb_y << 4;
-
- /* Left limit */
- x1 = xx - range;
- if (x1 < xmin)
- x1 = xmin;
-
- /* Right limit */
- x2 = xx + range;
- if (x2 > xmax)
- x2 = xmax;
-
- /* Upper limit */
- y1 = yy - range;
- if (y1 < ymin)
- y1 = ymin;
-
- /* Lower limit */
- y2 = yy + range;
- if (y2 > ymax)
- y2 = ymax;
-
- pix = s->new_picture.data[0] + (yy * s->linesize) + xx;
- mx = 0;
- my = 0;
-
- x = xx;
- y = yy;
- do {
- dminx = 0x7fffffff;
- dminy = 0x7fffffff;
-
- lastx = x;
- for (x = x1; x <= x2; x += range) {
- d = s->dsp.pix_abs[0][0](NULL, pix, ref_picture + (y * s->linesize) + x, s->linesize, 16);
- if (d < dminx || (d == dminx && (abs(x - xx) + abs(y - yy)) < (abs(mx - xx) + abs(my - yy)))) {
- dminx = d;
- mx = x;
- }
- }
-
- x = lastx;
- for (y = y1; y <= y2; y += range) {
- d = s->dsp.pix_abs[0][0](NULL, pix, ref_picture + (y * s->linesize) + x, s->linesize, 16);
- if (d < dminy || (d == dminy && (abs(x - xx) + abs(y - yy)) < (abs(mx - xx) + abs(my - yy)))) {
- dminy = d;
- my = y;
- }
- }
-
- range = range >> 1;
-
- x = mx;
- y = my;
- x1 = mx - range;
- if (x1 < xmin)
- x1 = xmin;
-
- x2 = mx + range;
- if (x2 > xmax)
- x2 = xmax;
-
- y1 = my - range;
- if (y1 < ymin)
- y1 = ymin;
-
- y2 = my + range;
- if (y2 > ymax)
- y2 = ymax;
-
- } while (range >= 1);
-
-#ifdef DEBUG
- av_log(s->avctx, AV_LOG_DEBUG, "phods - MX: %d\tMY: %d\n", mx, my);
-#endif
-
- /* half pixel search */
- *mx_ptr = mx;
- *my_ptr = my;
- return dminy;
-}
-#endif /* 0 */
-
-#define Z_THRESHOLD 256
-
-#define CHECK_SAD_HALF_MV(suffix, x, y) \
-{\
- d= s->dsp.pix_abs[size][(x?1:0)+(y?2:0)](NULL, pix, ptr+((x)>>1), stride, h);\
- d += (mv_penalty[pen_x + x] + mv_penalty[pen_y + y])*penalty_factor;\
- COPY3_IF_LT(dminh, d, dx, x, dy, y)\
-}
-
-static inline int sad_hpel_motion_search(MpegEncContext * s,
- int *mx_ptr, int *my_ptr, int dmin,
- int src_index, int ref_index,
- int size, int h)
-{
- MotionEstContext * const c= &s->me;
- const int penalty_factor= c->sub_penalty_factor;
- int mx, my, dminh;
- uint8_t *pix, *ptr;
- int stride= c->stride;
- const int flags= c->sub_flags;
- LOAD_COMMON
-
- assert(flags == 0);
-
- if(c->skip){
-// printf("S");
- *mx_ptr = 0;
- *my_ptr = 0;
- return dmin;
- }
-// printf("N");
-
- pix = c->src[src_index][0];
-
- mx = *mx_ptr;
- my = *my_ptr;
- ptr = c->ref[ref_index][0] + (my * stride) + mx;
-
- dminh = dmin;
-
- if (mx > xmin && mx < xmax &&
- my > ymin && my < ymax) {
- int dx=0, dy=0;
- int d, pen_x, pen_y;
- const int index= (my<<ME_MAP_SHIFT) + mx;
- const int t= score_map[(index-(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)];
- const int l= score_map[(index- 1 )&(ME_MAP_SIZE-1)];
- const int r= score_map[(index+ 1 )&(ME_MAP_SIZE-1)];
- const int b= score_map[(index+(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)];
- mx<<=1;
- my<<=1;
-
-
- pen_x= pred_x + mx;
- pen_y= pred_y + my;
-
- ptr-= stride;
- if(t<=b){
- CHECK_SAD_HALF_MV(y2 , 0, -1)
- if(l<=r){
- CHECK_SAD_HALF_MV(xy2, -1, -1)
- if(t+r<=b+l){
- CHECK_SAD_HALF_MV(xy2, +1, -1)
- ptr+= stride;
- }else{
- ptr+= stride;
- CHECK_SAD_HALF_MV(xy2, -1, +1)
- }
- CHECK_SAD_HALF_MV(x2 , -1, 0)
- }else{
- CHECK_SAD_HALF_MV(xy2, +1, -1)
- if(t+l<=b+r){
- CHECK_SAD_HALF_MV(xy2, -1, -1)
- ptr+= stride;
- }else{
- ptr+= stride;
- CHECK_SAD_HALF_MV(xy2, +1, +1)
- }
- CHECK_SAD_HALF_MV(x2 , +1, 0)
- }
- }else{
- if(l<=r){
- if(t+l<=b+r){
- CHECK_SAD_HALF_MV(xy2, -1, -1)
- ptr+= stride;
- }else{
- ptr+= stride;
- CHECK_SAD_HALF_MV(xy2, +1, +1)
- }
- CHECK_SAD_HALF_MV(x2 , -1, 0)
- CHECK_SAD_HALF_MV(xy2, -1, +1)
- }else{
- if(t+r<=b+l){
- CHECK_SAD_HALF_MV(xy2, +1, -1)
- ptr+= stride;
- }else{
- ptr+= stride;
- CHECK_SAD_HALF_MV(xy2, -1, +1)
- }
- CHECK_SAD_HALF_MV(x2 , +1, 0)
- CHECK_SAD_HALF_MV(xy2, +1, +1)
- }
- CHECK_SAD_HALF_MV(y2 , 0, +1)
- }
- mx+=dx;
- my+=dy;
-
- }else{
- mx<<=1;
- my<<=1;
- }
-
- *mx_ptr = mx;
- *my_ptr = my;
- return dminh;
-}
-
-static inline void set_p_mv_tables(MpegEncContext * s, int mx, int my, int mv4)
-{
- const int xy= s->mb_x + s->mb_y*s->mb_stride;
-
- s->p_mv_table[xy][0] = mx;
- s->p_mv_table[xy][1] = my;
-
- /* has already been set to the 4 MV if 4MV is done */
- if(mv4){
- int mot_xy= s->block_index[0];
-
- s->current_picture.motion_val[0][mot_xy ][0]= mx;
- s->current_picture.motion_val[0][mot_xy ][1]= my;
- s->current_picture.motion_val[0][mot_xy+1][0]= mx;
- s->current_picture.motion_val[0][mot_xy+1][1]= my;
-
- mot_xy += s->b8_stride;
- s->current_picture.motion_val[0][mot_xy ][0]= mx;
- s->current_picture.motion_val[0][mot_xy ][1]= my;
- s->current_picture.motion_val[0][mot_xy+1][0]= mx;
- s->current_picture.motion_val[0][mot_xy+1][1]= my;
- }
-}
-
-/**
- * get fullpel ME search limits.
- */
-static inline void get_limits(MpegEncContext *s, int x, int y)
-{
- MotionEstContext * const c= &s->me;
- int range= c->avctx->me_range >> (1 + !!(c->flags&FLAG_QPEL));
-/*
- if(c->avctx->me_range) c->range= c->avctx->me_range >> 1;
- else c->range= 16;
-*/
- if (s->unrestricted_mv) {
- c->xmin = - x - 16;
- c->ymin = - y - 16;
- c->xmax = - x + s->mb_width *16;
- c->ymax = - y + s->mb_height*16;
- } else if (s->out_format == FMT_H261){
- // Search range of H261 is different from other codec standards
- c->xmin = (x > 15) ? - 15 : 0;
- c->ymin = (y > 15) ? - 15 : 0;
- c->xmax = (x < s->mb_width * 16 - 16) ? 15 : 0;
- c->ymax = (y < s->mb_height * 16 - 16) ? 15 : 0;
- } else {
- c->xmin = - x;
- c->ymin = - y;
- c->xmax = - x + s->mb_width *16 - 16;
- c->ymax = - y + s->mb_height*16 - 16;
- }
- if(range){
- c->xmin = FFMAX(c->xmin,-range);
- c->xmax = FFMIN(c->xmax, range);
- c->ymin = FFMAX(c->ymin,-range);
- c->ymax = FFMIN(c->ymax, range);
- }
-}
-
-static inline void init_mv4_ref(MotionEstContext *c){
- const int stride= c->stride;
-
- c->ref[1][0] = c->ref[0][0] + 8;
- c->ref[2][0] = c->ref[0][0] + 8*stride;
- c->ref[3][0] = c->ref[2][0] + 8;
- c->src[1][0] = c->src[0][0] + 8;
- c->src[2][0] = c->src[0][0] + 8*stride;
- c->src[3][0] = c->src[2][0] + 8;
-}
-
-static inline int h263_mv4_search(MpegEncContext *s, int mx, int my, int shift)
-{
- MotionEstContext * const c= &s->me;
- const int size= 1;
- const int h=8;
- int block;
- int P[10][2];
- int dmin_sum=0, mx4_sum=0, my4_sum=0;
- int same=1;
- const int stride= c->stride;
- uint8_t *mv_penalty= c->current_mv_penalty;
-
- init_mv4_ref(c);
-
- for(block=0; block<4; block++){
- int mx4, my4;
- int pred_x4, pred_y4;
- int dmin4;
- static const int off[4]= {2, 1, 1, -1};
- const int mot_stride = s->b8_stride;
- const int mot_xy = s->block_index[block];
-
- P_LEFT[0] = s->current_picture.motion_val[0][mot_xy - 1][0];
- P_LEFT[1] = s->current_picture.motion_val[0][mot_xy - 1][1];
-
- if(P_LEFT[0] > (c->xmax<<shift)) P_LEFT[0] = (c->xmax<<shift);
-
- /* special case for first line */
- if (s->first_slice_line && block<2) {
- c->pred_x= pred_x4= P_LEFT[0];
- c->pred_y= pred_y4= P_LEFT[1];
- } else {
- P_TOP[0] = s->current_picture.motion_val[0][mot_xy - mot_stride ][0];
- P_TOP[1] = s->current_picture.motion_val[0][mot_xy - mot_stride ][1];
- P_TOPRIGHT[0] = s->current_picture.motion_val[0][mot_xy - mot_stride + off[block]][0];
- P_TOPRIGHT[1] = s->current_picture.motion_val[0][mot_xy - mot_stride + off[block]][1];
- if(P_TOP[1] > (c->ymax<<shift)) P_TOP[1] = (c->ymax<<shift);
- if(P_TOPRIGHT[0] < (c->xmin<<shift)) P_TOPRIGHT[0]= (c->xmin<<shift);
- if(P_TOPRIGHT[0] > (c->xmax<<shift)) P_TOPRIGHT[0]= (c->xmax<<shift);
- if(P_TOPRIGHT[1] > (c->ymax<<shift)) P_TOPRIGHT[1]= (c->ymax<<shift);
-
- P_MEDIAN[0]= mid_pred(P_LEFT[0], P_TOP[0], P_TOPRIGHT[0]);
- P_MEDIAN[1]= mid_pred(P_LEFT[1], P_TOP[1], P_TOPRIGHT[1]);
-
- c->pred_x= pred_x4 = P_MEDIAN[0];
- c->pred_y= pred_y4 = P_MEDIAN[1];
- }
- P_MV1[0]= mx;
- P_MV1[1]= my;
-
- dmin4 = epzs_motion_search4(s, &mx4, &my4, P, block, block, s->p_mv_table, (1<<16)>>shift);
-
- dmin4= c->sub_motion_search(s, &mx4, &my4, dmin4, block, block, size, h);
-
- if(s->dsp.me_sub_cmp[0] != s->dsp.mb_cmp[0]){
- int dxy;
- const int offset= ((block&1) + (block>>1)*stride)*8;
- uint8_t *dest_y = c->scratchpad + offset;
- if(s->quarter_sample){
- uint8_t *ref= c->ref[block][0] + (mx4>>2) + (my4>>2)*stride;
- dxy = ((my4 & 3) << 2) | (mx4 & 3);
-
- if(s->no_rounding)
- s->dsp.put_no_rnd_qpel_pixels_tab[1][dxy](dest_y , ref , stride);
- else
- s->dsp.put_qpel_pixels_tab [1][dxy](dest_y , ref , stride);
- }else{
- uint8_t *ref= c->ref[block][0] + (mx4>>1) + (my4>>1)*stride;
- dxy = ((my4 & 1) << 1) | (mx4 & 1);
-
- if(s->no_rounding)
- s->dsp.put_no_rnd_pixels_tab[1][dxy](dest_y , ref , stride, h);
- else
- s->dsp.put_pixels_tab [1][dxy](dest_y , ref , stride, h);
- }
- dmin_sum+= (mv_penalty[mx4-pred_x4] + mv_penalty[my4-pred_y4])*c->mb_penalty_factor;
- }else
- dmin_sum+= dmin4;
-
- if(s->quarter_sample){
- mx4_sum+= mx4/2;
- my4_sum+= my4/2;
- }else{
- mx4_sum+= mx4;
- my4_sum+= my4;
- }
-
- s->current_picture.motion_val[0][ s->block_index[block] ][0]= mx4;
- s->current_picture.motion_val[0][ s->block_index[block] ][1]= my4;
-
- if(mx4 != mx || my4 != my) same=0;
- }
-
- if(same)
- return INT_MAX;
-
- if(s->dsp.me_sub_cmp[0] != s->dsp.mb_cmp[0]){
- dmin_sum += s->dsp.mb_cmp[0](s, s->new_picture.data[0] + s->mb_x*16 + s->mb_y*16*stride, c->scratchpad, stride, 16);
- }
-
- if(c->avctx->mb_cmp&FF_CMP_CHROMA){
- int dxy;
- int mx, my;
- int offset;
-
- mx= ff_h263_round_chroma(mx4_sum);
- my= ff_h263_round_chroma(my4_sum);
- dxy = ((my & 1) << 1) | (mx & 1);
-
- offset= (s->mb_x*8 + (mx>>1)) + (s->mb_y*8 + (my>>1))*s->uvlinesize;
-
- if(s->no_rounding){
- s->dsp.put_no_rnd_pixels_tab[1][dxy](c->scratchpad , s->last_picture.data[1] + offset, s->uvlinesize, 8);
- s->dsp.put_no_rnd_pixels_tab[1][dxy](c->scratchpad+8 , s->last_picture.data[2] + offset, s->uvlinesize, 8);
- }else{
- s->dsp.put_pixels_tab [1][dxy](c->scratchpad , s->last_picture.data[1] + offset, s->uvlinesize, 8);
- s->dsp.put_pixels_tab [1][dxy](c->scratchpad+8 , s->last_picture.data[2] + offset, s->uvlinesize, 8);
- }
-
- dmin_sum += s->dsp.mb_cmp[1](s, s->new_picture.data[1] + s->mb_x*8 + s->mb_y*8*s->uvlinesize, c->scratchpad , s->uvlinesize, 8);
- dmin_sum += s->dsp.mb_cmp[1](s, s->new_picture.data[2] + s->mb_x*8 + s->mb_y*8*s->uvlinesize, c->scratchpad+8, s->uvlinesize, 8);
- }
-
- c->pred_x= mx;
- c->pred_y= my;
-
- switch(c->avctx->mb_cmp&0xFF){
- /*case FF_CMP_SSE:
- return dmin_sum+ 32*s->qscale*s->qscale;*/
- case FF_CMP_RD:
- return dmin_sum;
- default:
- return dmin_sum+ 11*c->mb_penalty_factor;
- }
-}
-
-static inline void init_interlaced_ref(MpegEncContext *s, int ref_index){
- MotionEstContext * const c= &s->me;
-
- c->ref[1+ref_index][0] = c->ref[0+ref_index][0] + s->linesize;
- c->src[1][0] = c->src[0][0] + s->linesize;
- if(c->flags & FLAG_CHROMA){
- c->ref[1+ref_index][1] = c->ref[0+ref_index][1] + s->uvlinesize;
- c->ref[1+ref_index][2] = c->ref[0+ref_index][2] + s->uvlinesize;
- c->src[1][1] = c->src[0][1] + s->uvlinesize;
- c->src[1][2] = c->src[0][2] + s->uvlinesize;
- }
-}
-
-static int interlaced_search(MpegEncContext *s, int ref_index,
- int16_t (*mv_tables[2][2])[2], uint8_t *field_select_tables[2], int mx, int my, int user_field_select)
-{
- MotionEstContext * const c= &s->me;
- const int size=0;
- const int h=8;
- int block;
- int P[10][2];
- uint8_t * const mv_penalty= c->current_mv_penalty;
- int same=1;
- const int stride= 2*s->linesize;
- int dmin_sum= 0;
- const int mot_stride= s->mb_stride;
- const int xy= s->mb_x + s->mb_y*mot_stride;
-
- c->ymin>>=1;
- c->ymax>>=1;
- c->stride<<=1;
- c->uvstride<<=1;
- init_interlaced_ref(s, ref_index);
-
- for(block=0; block<2; block++){
- int field_select;
- int best_dmin= INT_MAX;
- int best_field= -1;
-
- for(field_select=0; field_select<2; field_select++){
- int dmin, mx_i, my_i;
- int16_t (*mv_table)[2]= mv_tables[block][field_select];
-
- if(user_field_select){
- assert(field_select==0 || field_select==1);
- assert(field_select_tables[block][xy]==0 || field_select_tables[block][xy]==1);
- if(field_select_tables[block][xy] != field_select)
- continue;
- }
-
- P_LEFT[0] = mv_table[xy - 1][0];
- P_LEFT[1] = mv_table[xy - 1][1];
- if(P_LEFT[0] > (c->xmax<<1)) P_LEFT[0] = (c->xmax<<1);
-
- c->pred_x= P_LEFT[0];
- c->pred_y= P_LEFT[1];
-
- if(!s->first_slice_line){
- P_TOP[0] = mv_table[xy - mot_stride][0];
- P_TOP[1] = mv_table[xy - mot_stride][1];
- P_TOPRIGHT[0] = mv_table[xy - mot_stride + 1][0];
- P_TOPRIGHT[1] = mv_table[xy - mot_stride + 1][1];
- if(P_TOP[1] > (c->ymax<<1)) P_TOP[1] = (c->ymax<<1);
- if(P_TOPRIGHT[0] < (c->xmin<<1)) P_TOPRIGHT[0]= (c->xmin<<1);
- if(P_TOPRIGHT[0] > (c->xmax<<1)) P_TOPRIGHT[0]= (c->xmax<<1);
- if(P_TOPRIGHT[1] > (c->ymax<<1)) P_TOPRIGHT[1]= (c->ymax<<1);
-
- P_MEDIAN[0]= mid_pred(P_LEFT[0], P_TOP[0], P_TOPRIGHT[0]);
- P_MEDIAN[1]= mid_pred(P_LEFT[1], P_TOP[1], P_TOPRIGHT[1]);
- }
- P_MV1[0]= mx; //FIXME not correct if block != field_select
- P_MV1[1]= my / 2;
-
- dmin = epzs_motion_search2(s, &mx_i, &my_i, P, block, field_select+ref_index, mv_table, (1<<16)>>1);
-
- dmin= c->sub_motion_search(s, &mx_i, &my_i, dmin, block, field_select+ref_index, size, h);
-
- mv_table[xy][0]= mx_i;
- mv_table[xy][1]= my_i;
-
- if(s->dsp.me_sub_cmp[0] != s->dsp.mb_cmp[0]){
- int dxy;
-
- //FIXME chroma ME
- uint8_t *ref= c->ref[field_select+ref_index][0] + (mx_i>>1) + (my_i>>1)*stride;
- dxy = ((my_i & 1) << 1) | (mx_i & 1);
-
- if(s->no_rounding){
- s->dsp.put_no_rnd_pixels_tab[size][dxy](c->scratchpad, ref , stride, h);
- }else{
- s->dsp.put_pixels_tab [size][dxy](c->scratchpad, ref , stride, h);
- }
- dmin= s->dsp.mb_cmp[size](s, c->src[block][0], c->scratchpad, stride, h);
- dmin+= (mv_penalty[mx_i-c->pred_x] + mv_penalty[my_i-c->pred_y] + 1)*c->mb_penalty_factor;
- }else
- dmin+= c->mb_penalty_factor; //field_select bits
-
- dmin += field_select != block; //slightly prefer same field
-
- if(dmin < best_dmin){
- best_dmin= dmin;
- best_field= field_select;
- }
- }
- {
- int16_t (*mv_table)[2]= mv_tables[block][best_field];
-
- if(mv_table[xy][0] != mx) same=0; //FIXME check if these checks work and are any good at all
- if(mv_table[xy][1]&1) same=0;
- if(mv_table[xy][1]*2 != my) same=0;
- if(best_field != block) same=0;
- }
-
- field_select_tables[block][xy]= best_field;
- dmin_sum += best_dmin;
- }
-
- c->ymin<<=1;
- c->ymax<<=1;
- c->stride>>=1;
- c->uvstride>>=1;
-
- if(same)
- return INT_MAX;
-
- switch(c->avctx->mb_cmp&0xFF){
- /*case FF_CMP_SSE:
- return dmin_sum+ 32*s->qscale*s->qscale;*/
- case FF_CMP_RD:
- return dmin_sum;
- default:
- return dmin_sum+ 11*c->mb_penalty_factor;
- }
-}
-
-static void clip_input_mv(MpegEncContext * s, int16_t *mv, int interlaced){
- int ymax= s->me.ymax>>interlaced;
- int ymin= s->me.ymin>>interlaced;
-
- if(mv[0] < s->me.xmin) mv[0] = s->me.xmin;
- if(mv[0] > s->me.xmax) mv[0] = s->me.xmax;
- if(mv[1] < ymin) mv[1] = ymin;
- if(mv[1] > ymax) mv[1] = ymax;
-}
-
-static inline int check_input_motion(MpegEncContext * s, int mb_x, int mb_y, int p_type){
- MotionEstContext * const c= &s->me;
- Picture *p= s->current_picture_ptr;
- int mb_xy= mb_x + mb_y*s->mb_stride;
- int xy= 2*mb_x + 2*mb_y*s->b8_stride;
- int mb_type= s->current_picture.mb_type[mb_xy];
- int flags= c->flags;
- int shift= (flags&FLAG_QPEL) + 1;
- int mask= (1<<shift)-1;
- int x, y, i;
- int d=0;
- me_cmp_func cmpf= s->dsp.sse[0];
- me_cmp_func chroma_cmpf= s->dsp.sse[1];
-
- if(p_type && USES_LIST(mb_type, 1)){
- av_log(c->avctx, AV_LOG_ERROR, "backward motion vector in P frame\n");
- return INT_MAX/2;
- }
- assert(IS_INTRA(mb_type) || USES_LIST(mb_type,0) || USES_LIST(mb_type,1));
-
- for(i=0; i<4; i++){
- int xy= s->block_index[i];
- clip_input_mv(s, p->motion_val[0][xy], !!IS_INTERLACED(mb_type));
- clip_input_mv(s, p->motion_val[1][xy], !!IS_INTERLACED(mb_type));
- }
-
- if(IS_INTERLACED(mb_type)){
- int xy2= xy + s->b8_stride;
- s->mb_type[mb_xy]=CANDIDATE_MB_TYPE_INTRA;
- c->stride<<=1;
- c->uvstride<<=1;
-
- if(!(s->flags & CODEC_FLAG_INTERLACED_ME)){
- av_log(c->avctx, AV_LOG_ERROR, "Interlaced macroblock selected but interlaced motion estimation disabled\n");
- return INT_MAX/2;
- }
-
- if(USES_LIST(mb_type, 0)){
- int field_select0= p->ref_index[0][xy ];
- int field_select1= p->ref_index[0][xy2];
- assert(field_select0==0 ||field_select0==1);
- assert(field_select1==0 ||field_select1==1);
- init_interlaced_ref(s, 0);
-
- if(p_type){
- s->p_field_select_table[0][mb_xy]= field_select0;
- s->p_field_select_table[1][mb_xy]= field_select1;
- *(uint32_t*)s->p_field_mv_table[0][field_select0][mb_xy]= *(uint32_t*)p->motion_val[0][xy ];
- *(uint32_t*)s->p_field_mv_table[1][field_select1][mb_xy]= *(uint32_t*)p->motion_val[0][xy2];
- s->mb_type[mb_xy]=CANDIDATE_MB_TYPE_INTER_I;
- }else{
- s->b_field_select_table[0][0][mb_xy]= field_select0;
- s->b_field_select_table[0][1][mb_xy]= field_select1;
- *(uint32_t*)s->b_field_mv_table[0][0][field_select0][mb_xy]= *(uint32_t*)p->motion_val[0][xy ];
- *(uint32_t*)s->b_field_mv_table[0][1][field_select1][mb_xy]= *(uint32_t*)p->motion_val[0][xy2];
- s->mb_type[mb_xy]= CANDIDATE_MB_TYPE_FORWARD_I;
- }
-
- x= p->motion_val[0][xy ][0];
- y= p->motion_val[0][xy ][1];
- d = cmp(s, x>>shift, y>>shift, x&mask, y&mask, 0, 8, field_select0, 0, cmpf, chroma_cmpf, flags);
- x= p->motion_val[0][xy2][0];
- y= p->motion_val[0][xy2][1];
- d+= cmp(s, x>>shift, y>>shift, x&mask, y&mask, 0, 8, field_select1, 1, cmpf, chroma_cmpf, flags);
- }
- if(USES_LIST(mb_type, 1)){
- int field_select0= p->ref_index[1][xy ];
- int field_select1= p->ref_index[1][xy2];
- assert(field_select0==0 ||field_select0==1);
- assert(field_select1==0 ||field_select1==1);
- init_interlaced_ref(s, 2);
-
- s->b_field_select_table[1][0][mb_xy]= field_select0;
- s->b_field_select_table[1][1][mb_xy]= field_select1;
- *(uint32_t*)s->b_field_mv_table[1][0][field_select0][mb_xy]= *(uint32_t*)p->motion_val[1][xy ];
- *(uint32_t*)s->b_field_mv_table[1][1][field_select1][mb_xy]= *(uint32_t*)p->motion_val[1][xy2];
- if(USES_LIST(mb_type, 0)){
- s->mb_type[mb_xy]= CANDIDATE_MB_TYPE_BIDIR_I;
- }else{
- s->mb_type[mb_xy]= CANDIDATE_MB_TYPE_BACKWARD_I;
- }
-
- x= p->motion_val[1][xy ][0];
- y= p->motion_val[1][xy ][1];
- d = cmp(s, x>>shift, y>>shift, x&mask, y&mask, 0, 8, field_select0+2, 0, cmpf, chroma_cmpf, flags);
- x= p->motion_val[1][xy2][0];
- y= p->motion_val[1][xy2][1];
- d+= cmp(s, x>>shift, y>>shift, x&mask, y&mask, 0, 8, field_select1+2, 1, cmpf, chroma_cmpf, flags);
- //FIXME bidir scores
- }
- c->stride>>=1;
- c->uvstride>>=1;
- }else if(IS_8X8(mb_type)){
- if(!(s->flags & CODEC_FLAG_4MV)){
- av_log(c->avctx, AV_LOG_ERROR, "4MV macroblock selected but 4MV encoding disabled\n");
- return INT_MAX/2;
- }
- cmpf= s->dsp.sse[1];
- chroma_cmpf= s->dsp.sse[1];
- init_mv4_ref(c);
- for(i=0; i<4; i++){
- xy= s->block_index[i];
- x= p->motion_val[0][xy][0];
- y= p->motion_val[0][xy][1];
- d+= cmp(s, x>>shift, y>>shift, x&mask, y&mask, 1, 8, i, i, cmpf, chroma_cmpf, flags);
- }
- s->mb_type[mb_xy]=CANDIDATE_MB_TYPE_INTER4V;
- }else{
- if(USES_LIST(mb_type, 0)){
- if(p_type){
- *(uint32_t*)s->p_mv_table[mb_xy]= *(uint32_t*)p->motion_val[0][xy];
- s->mb_type[mb_xy]=CANDIDATE_MB_TYPE_INTER;
- }else if(USES_LIST(mb_type, 1)){
- *(uint32_t*)s->b_bidir_forw_mv_table[mb_xy]= *(uint32_t*)p->motion_val[0][xy];
- *(uint32_t*)s->b_bidir_back_mv_table[mb_xy]= *(uint32_t*)p->motion_val[1][xy];
- s->mb_type[mb_xy]=CANDIDATE_MB_TYPE_BIDIR;
- }else{
- *(uint32_t*)s->b_forw_mv_table[mb_xy]= *(uint32_t*)p->motion_val[0][xy];
- s->mb_type[mb_xy]=CANDIDATE_MB_TYPE_FORWARD;
- }
- x= p->motion_val[0][xy][0];
- y= p->motion_val[0][xy][1];
- d = cmp(s, x>>shift, y>>shift, x&mask, y&mask, 0, 16, 0, 0, cmpf, chroma_cmpf, flags);
- }else if(USES_LIST(mb_type, 1)){
- *(uint32_t*)s->b_back_mv_table[mb_xy]= *(uint32_t*)p->motion_val[1][xy];
- s->mb_type[mb_xy]=CANDIDATE_MB_TYPE_BACKWARD;
-
- x= p->motion_val[1][xy][0];
- y= p->motion_val[1][xy][1];
- d = cmp(s, x>>shift, y>>shift, x&mask, y&mask, 0, 16, 2, 0, cmpf, chroma_cmpf, flags);
- }else
- s->mb_type[mb_xy]=CANDIDATE_MB_TYPE_INTRA;
- }
- return d;
-}
-
-void ff_estimate_p_frame_motion(MpegEncContext * s,
- int mb_x, int mb_y)
-{
- MotionEstContext * const c= &s->me;
- uint8_t *pix, *ppix;
- int sum, mx, my, dmin;
- int varc; ///< the variance of the block (sum of squared (p[y][x]-average))
- int vard; ///< sum of squared differences with the estimated motion vector
- int P[10][2];
- const int shift= 1+s->quarter_sample;
- int mb_type=0;
- Picture * const pic= &s->current_picture;
-
- init_ref(c, s->new_picture.data, s->last_picture.data, NULL, 16*mb_x, 16*mb_y, 0);
-
- assert(s->quarter_sample==0 || s->quarter_sample==1);
- assert(s->linesize == c->stride);
- assert(s->uvlinesize == c->uvstride);
-
- c->penalty_factor = get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_cmp);
- c->sub_penalty_factor= get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_sub_cmp);
- c->mb_penalty_factor = get_penalty_factor(s->lambda, s->lambda2, c->avctx->mb_cmp);
- c->current_mv_penalty= c->mv_penalty[s->f_code] + MAX_MV;
-
- get_limits(s, 16*mb_x, 16*mb_y);
- c->skip=0;
-
- /* intra / predictive decision */
- pix = c->src[0][0];
- sum = s->dsp.pix_sum(pix, s->linesize);
- varc = s->dsp.pix_norm1(pix, s->linesize) - (((unsigned)(sum*sum))>>8) + 500;
-
- pic->mb_mean[s->mb_stride * mb_y + mb_x] = (sum+128)>>8;
- pic->mb_var [s->mb_stride * mb_y + mb_x] = (varc+128)>>8;
- c->mb_var_sum_temp += (varc+128)>>8;
-
- if(c->avctx->me_threshold){
- vard= check_input_motion(s, mb_x, mb_y, 1);
-
- if((vard+128)>>8 < c->avctx->me_threshold){
- int p_score= FFMIN(vard, varc-500+(s->lambda2>>FF_LAMBDA_SHIFT)*100);
- int i_score= varc-500+(s->lambda2>>FF_LAMBDA_SHIFT)*20;
- pic->mc_mb_var[s->mb_stride * mb_y + mb_x] = (vard+128)>>8;
- c->mc_mb_var_sum_temp += (vard+128)>>8;
- c->scene_change_score+= ff_sqrt(p_score) - ff_sqrt(i_score);
- return;
- }
- if((vard+128)>>8 < c->avctx->mb_threshold)
- mb_type= s->mb_type[mb_x + mb_y*s->mb_stride];
- }
-
- switch(s->me_method) {
- case ME_ZERO:
- default:
- no_motion_search(s, &mx, &my);
- mx-= mb_x*16;
- my-= mb_y*16;
- dmin = 0;
- break;
-#if 0
- case ME_FULL:
- dmin = full_motion_search(s, &mx, &my, range, ref_picture);
- mx-= mb_x*16;
- my-= mb_y*16;
- break;
- case ME_LOG:
- dmin = log_motion_search(s, &mx, &my, range / 2, ref_picture);
- mx-= mb_x*16;
- my-= mb_y*16;
- break;
- case ME_PHODS:
- dmin = phods_motion_search(s, &mx, &my, range / 2, ref_picture);
- mx-= mb_x*16;
- my-= mb_y*16;
- break;
-#endif
- case ME_X1:
- case ME_EPZS:
- {
- const int mot_stride = s->b8_stride;
- const int mot_xy = s->block_index[0];
-
- P_LEFT[0] = s->current_picture.motion_val[0][mot_xy - 1][0];
- P_LEFT[1] = s->current_picture.motion_val[0][mot_xy - 1][1];
-
- if(P_LEFT[0] > (c->xmax<<shift)) P_LEFT[0] = (c->xmax<<shift);
-
- if(!s->first_slice_line) {
- P_TOP[0] = s->current_picture.motion_val[0][mot_xy - mot_stride ][0];
- P_TOP[1] = s->current_picture.motion_val[0][mot_xy - mot_stride ][1];
- P_TOPRIGHT[0] = s->current_picture.motion_val[0][mot_xy - mot_stride + 2][0];
- P_TOPRIGHT[1] = s->current_picture.motion_val[0][mot_xy - mot_stride + 2][1];
- if(P_TOP[1] > (c->ymax<<shift)) P_TOP[1] = (c->ymax<<shift);
- if(P_TOPRIGHT[0] < (c->xmin<<shift)) P_TOPRIGHT[0]= (c->xmin<<shift);
- if(P_TOPRIGHT[1] > (c->ymax<<shift)) P_TOPRIGHT[1]= (c->ymax<<shift);
-
- P_MEDIAN[0]= mid_pred(P_LEFT[0], P_TOP[0], P_TOPRIGHT[0]);
- P_MEDIAN[1]= mid_pred(P_LEFT[1], P_TOP[1], P_TOPRIGHT[1]);
-
- if(s->out_format == FMT_H263){
- c->pred_x = P_MEDIAN[0];
- c->pred_y = P_MEDIAN[1];
- }else { /* mpeg1 at least */
- c->pred_x= P_LEFT[0];
- c->pred_y= P_LEFT[1];
- }
- }else{
- c->pred_x= P_LEFT[0];
- c->pred_y= P_LEFT[1];
- }
-
- }
- dmin = ff_epzs_motion_search(s, &mx, &my, P, 0, 0, s->p_mv_table, (1<<16)>>shift, 0, 16);
-
- break;
- }
-
- /* At this point (mx,my) are full-pell and the relative displacement */
- ppix = c->ref[0][0] + (my * s->linesize) + mx;
-
- vard = s->dsp.sse[0](NULL, pix, ppix, s->linesize, 16);
-
- pic->mc_mb_var[s->mb_stride * mb_y + mb_x] = (vard+128)>>8;
-// pic->mb_cmp_score[s->mb_stride * mb_y + mb_x] = dmin;
- c->mc_mb_var_sum_temp += (vard+128)>>8;
-
-#if 0
- printf("varc=%4d avg_var=%4d (sum=%4d) vard=%4d mx=%2d my=%2d\n",
- varc, s->avg_mb_var, sum, vard, mx - xx, my - yy);
-#endif
- if(mb_type){
- int p_score= FFMIN(vard, varc-500+(s->lambda2>>FF_LAMBDA_SHIFT)*100);
- int i_score= varc-500+(s->lambda2>>FF_LAMBDA_SHIFT)*20;
- c->scene_change_score+= ff_sqrt(p_score) - ff_sqrt(i_score);
-
- if(mb_type == CANDIDATE_MB_TYPE_INTER){
- c->sub_motion_search(s, &mx, &my, dmin, 0, 0, 0, 16);
- set_p_mv_tables(s, mx, my, 1);
- }else{
- mx <<=shift;
- my <<=shift;
- }
- if(mb_type == CANDIDATE_MB_TYPE_INTER4V){
- h263_mv4_search(s, mx, my, shift);
-
- set_p_mv_tables(s, mx, my, 0);
- }
- if(mb_type == CANDIDATE_MB_TYPE_INTER_I){
- interlaced_search(s, 0, s->p_field_mv_table, s->p_field_select_table, mx, my, 1);
- }
- }else if(c->avctx->mb_decision > FF_MB_DECISION_SIMPLE){
- int p_score= FFMIN(vard, varc-500+(s->lambda2>>FF_LAMBDA_SHIFT)*100);
- int i_score= varc-500+(s->lambda2>>FF_LAMBDA_SHIFT)*20;
- c->scene_change_score+= ff_sqrt(p_score) - ff_sqrt(i_score);
-
- if (vard*2 + 200*256 > varc)
- mb_type|= CANDIDATE_MB_TYPE_INTRA;
- if (varc*2 + 200*256 > vard || s->qscale > 24){
-// if (varc*2 + 200*256 + 50*(s->lambda2>>FF_LAMBDA_SHIFT) > vard){
- mb_type|= CANDIDATE_MB_TYPE_INTER;
- c->sub_motion_search(s, &mx, &my, dmin, 0, 0, 0, 16);
- if(s->flags&CODEC_FLAG_MV0)
- if(mx || my)
- mb_type |= CANDIDATE_MB_TYPE_SKIPPED; //FIXME check difference
- }else{
- mx <<=shift;
- my <<=shift;
- }
- if((s->flags&CODEC_FLAG_4MV)
- && !c->skip && varc>50<<8 && vard>10<<8){
- if(h263_mv4_search(s, mx, my, shift) < INT_MAX)
- mb_type|=CANDIDATE_MB_TYPE_INTER4V;
-
- set_p_mv_tables(s, mx, my, 0);
- }else
- set_p_mv_tables(s, mx, my, 1);
- if((s->flags&CODEC_FLAG_INTERLACED_ME)
- && !c->skip){ //FIXME varc/d checks
- if(interlaced_search(s, 0, s->p_field_mv_table, s->p_field_select_table, mx, my, 0) < INT_MAX)
- mb_type |= CANDIDATE_MB_TYPE_INTER_I;
- }
- }else{
- int intra_score, i;
- mb_type= CANDIDATE_MB_TYPE_INTER;
-
- dmin= c->sub_motion_search(s, &mx, &my, dmin, 0, 0, 0, 16);
- if(c->avctx->me_sub_cmp != c->avctx->mb_cmp && !c->skip)
- dmin= ff_get_mb_score(s, mx, my, 0, 0, 0, 16, 1);
-
- if((s->flags&CODEC_FLAG_4MV)
- && !c->skip && varc>50<<8 && vard>10<<8){
- int dmin4= h263_mv4_search(s, mx, my, shift);
- if(dmin4 < dmin){
- mb_type= CANDIDATE_MB_TYPE_INTER4V;
- dmin=dmin4;
- }
- }
- if((s->flags&CODEC_FLAG_INTERLACED_ME)
- && !c->skip){ //FIXME varc/d checks
- int dmin_i= interlaced_search(s, 0, s->p_field_mv_table, s->p_field_select_table, mx, my, 0);
- if(dmin_i < dmin){
- mb_type = CANDIDATE_MB_TYPE_INTER_I;
- dmin= dmin_i;
- }
- }
-
-// pic->mb_cmp_score[s->mb_stride * mb_y + mb_x] = dmin;
- set_p_mv_tables(s, mx, my, mb_type!=CANDIDATE_MB_TYPE_INTER4V);
-
- /* get intra luma score */
- if((c->avctx->mb_cmp&0xFF)==FF_CMP_SSE){
- intra_score= varc - 500;
- }else{
- int mean= (sum+128)>>8;
- mean*= 0x01010101;
-
- for(i=0; i<16; i++){
- *(uint32_t*)(&c->scratchpad[i*s->linesize+ 0]) = mean;
- *(uint32_t*)(&c->scratchpad[i*s->linesize+ 4]) = mean;
- *(uint32_t*)(&c->scratchpad[i*s->linesize+ 8]) = mean;
- *(uint32_t*)(&c->scratchpad[i*s->linesize+12]) = mean;
- }
-
- intra_score= s->dsp.mb_cmp[0](s, c->scratchpad, pix, s->linesize, 16);
- }
-#if 0 //FIXME
- /* get chroma score */
- if(c->avctx->mb_cmp&FF_CMP_CHROMA){
- for(i=1; i<3; i++){
- uint8_t *dest_c;
- int mean;
-
- if(s->out_format == FMT_H263){
- mean= (s->dc_val[i][mb_x + mb_y*s->b8_stride] + 4)>>3; //FIXME not exact but simple ;)
- }else{
- mean= (s->last_dc[i] + 4)>>3;
- }
- dest_c = s->new_picture.data[i] + (mb_y * 8 * (s->uvlinesize)) + mb_x * 8;
-
- mean*= 0x01010101;
- for(i=0; i<8; i++){
- *(uint32_t*)(&c->scratchpad[i*s->uvlinesize+ 0]) = mean;
- *(uint32_t*)(&c->scratchpad[i*s->uvlinesize+ 4]) = mean;
- }
-
- intra_score+= s->dsp.mb_cmp[1](s, c->scratchpad, dest_c, s->uvlinesize);
- }
- }
-#endif
- intra_score += c->mb_penalty_factor*16;
-
- if(intra_score < dmin){
- mb_type= CANDIDATE_MB_TYPE_INTRA;
- s->current_picture.mb_type[mb_y*s->mb_stride + mb_x]= CANDIDATE_MB_TYPE_INTRA; //FIXME cleanup
- }else
- s->current_picture.mb_type[mb_y*s->mb_stride + mb_x]= 0;
-
- {
- int p_score= FFMIN(vard, varc-500+(s->lambda2>>FF_LAMBDA_SHIFT)*100);
- int i_score= varc-500+(s->lambda2>>FF_LAMBDA_SHIFT)*20;
- c->scene_change_score+= ff_sqrt(p_score) - ff_sqrt(i_score);
- }
- }
-
- s->mb_type[mb_y*s->mb_stride + mb_x]= mb_type;
-}
-
-int ff_pre_estimate_p_frame_motion(MpegEncContext * s,
- int mb_x, int mb_y)
-{
- MotionEstContext * const c= &s->me;
- int mx, my, dmin;
- int P[10][2];
- const int shift= 1+s->quarter_sample;
- const int xy= mb_x + mb_y*s->mb_stride;
- init_ref(c, s->new_picture.data, s->last_picture.data, NULL, 16*mb_x, 16*mb_y, 0);
-
- assert(s->quarter_sample==0 || s->quarter_sample==1);
-
- c->pre_penalty_factor = get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_pre_cmp);
- c->current_mv_penalty= c->mv_penalty[s->f_code] + MAX_MV;
-
- get_limits(s, 16*mb_x, 16*mb_y);
- c->skip=0;
-
- P_LEFT[0] = s->p_mv_table[xy + 1][0];
- P_LEFT[1] = s->p_mv_table[xy + 1][1];
-
- if(P_LEFT[0] < (c->xmin<<shift)) P_LEFT[0] = (c->xmin<<shift);
-
- /* special case for first line */
- if (s->first_slice_line) {
- c->pred_x= P_LEFT[0];
- c->pred_y= P_LEFT[1];
- P_TOP[0]= P_TOPRIGHT[0]= P_MEDIAN[0]=
- P_TOP[1]= P_TOPRIGHT[1]= P_MEDIAN[1]= 0; //FIXME
- } else {
- P_TOP[0] = s->p_mv_table[xy + s->mb_stride ][0];
- P_TOP[1] = s->p_mv_table[xy + s->mb_stride ][1];
- P_TOPRIGHT[0] = s->p_mv_table[xy + s->mb_stride - 1][0];
- P_TOPRIGHT[1] = s->p_mv_table[xy + s->mb_stride - 1][1];
- if(P_TOP[1] < (c->ymin<<shift)) P_TOP[1] = (c->ymin<<shift);
- if(P_TOPRIGHT[0] > (c->xmax<<shift)) P_TOPRIGHT[0]= (c->xmax<<shift);
- if(P_TOPRIGHT[1] < (c->ymin<<shift)) P_TOPRIGHT[1]= (c->ymin<<shift);
-
- P_MEDIAN[0]= mid_pred(P_LEFT[0], P_TOP[0], P_TOPRIGHT[0]);
- P_MEDIAN[1]= mid_pred(P_LEFT[1], P_TOP[1], P_TOPRIGHT[1]);
-
- c->pred_x = P_MEDIAN[0];
- c->pred_y = P_MEDIAN[1];
- }
-
- dmin = ff_epzs_motion_search(s, &mx, &my, P, 0, 0, s->p_mv_table, (1<<16)>>shift, 0, 16);
-
- s->p_mv_table[xy][0] = mx<<shift;
- s->p_mv_table[xy][1] = my<<shift;
-
- return dmin;
-}
-
-static int ff_estimate_motion_b(MpegEncContext * s,
- int mb_x, int mb_y, int16_t (*mv_table)[2], int ref_index, int f_code)
-{
- MotionEstContext * const c= &s->me;
- int mx, my, dmin;
- int P[10][2];
- const int shift= 1+s->quarter_sample;
- const int mot_stride = s->mb_stride;
- const int mot_xy = mb_y*mot_stride + mb_x;
- uint8_t * const mv_penalty= c->mv_penalty[f_code] + MAX_MV;
- int mv_scale;
-
- c->penalty_factor = get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_cmp);
- c->sub_penalty_factor= get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_sub_cmp);
- c->mb_penalty_factor = get_penalty_factor(s->lambda, s->lambda2, c->avctx->mb_cmp);
- c->current_mv_penalty= mv_penalty;
-
- get_limits(s, 16*mb_x, 16*mb_y);
-
- switch(s->me_method) {
- case ME_ZERO:
- default:
- no_motion_search(s, &mx, &my);
- dmin = 0;
- mx-= mb_x*16;
- my-= mb_y*16;
- break;
-#if 0
- case ME_FULL:
- dmin = full_motion_search(s, &mx, &my, range, ref_picture);
- mx-= mb_x*16;
- my-= mb_y*16;
- break;
- case ME_LOG:
- dmin = log_motion_search(s, &mx, &my, range / 2, ref_picture);
- mx-= mb_x*16;
- my-= mb_y*16;
- break;
- case ME_PHODS:
- dmin = phods_motion_search(s, &mx, &my, range / 2, ref_picture);
- mx-= mb_x*16;
- my-= mb_y*16;
- break;
-#endif
- case ME_X1:
- case ME_EPZS:
- {
- P_LEFT[0] = mv_table[mot_xy - 1][0];
- P_LEFT[1] = mv_table[mot_xy - 1][1];
-
- if(P_LEFT[0] > (c->xmax<<shift)) P_LEFT[0] = (c->xmax<<shift);
-
- /* special case for first line */
- if (!s->first_slice_line) {
- P_TOP[0] = mv_table[mot_xy - mot_stride ][0];
- P_TOP[1] = mv_table[mot_xy - mot_stride ][1];
- P_TOPRIGHT[0] = mv_table[mot_xy - mot_stride + 1 ][0];
- P_TOPRIGHT[1] = mv_table[mot_xy - mot_stride + 1 ][1];
- if(P_TOP[1] > (c->ymax<<shift)) P_TOP[1]= (c->ymax<<shift);
- if(P_TOPRIGHT[0] < (c->xmin<<shift)) P_TOPRIGHT[0]= (c->xmin<<shift);
- if(P_TOPRIGHT[1] > (c->ymax<<shift)) P_TOPRIGHT[1]= (c->ymax<<shift);
-
- P_MEDIAN[0]= mid_pred(P_LEFT[0], P_TOP[0], P_TOPRIGHT[0]);
- P_MEDIAN[1]= mid_pred(P_LEFT[1], P_TOP[1], P_TOPRIGHT[1]);
- }
- c->pred_x= P_LEFT[0];
- c->pred_y= P_LEFT[1];
- }
-
- if(mv_table == s->b_forw_mv_table){
- mv_scale= (s->pb_time<<16) / (s->pp_time<<shift);
- }else{
- mv_scale= ((s->pb_time - s->pp_time)<<16) / (s->pp_time<<shift);
- }
-
- dmin = ff_epzs_motion_search(s, &mx, &my, P, 0, ref_index, s->p_mv_table, mv_scale, 0, 16);
-
- break;
- }
-
- dmin= c->sub_motion_search(s, &mx, &my, dmin, 0, ref_index, 0, 16);
-
- if(c->avctx->me_sub_cmp != c->avctx->mb_cmp && !c->skip)
- dmin= ff_get_mb_score(s, mx, my, 0, ref_index, 0, 16, 1);
-
-//printf("%d %d %d %d//", s->mb_x, s->mb_y, mx, my);
-// s->mb_type[mb_y*s->mb_width + mb_x]= mb_type;
- mv_table[mot_xy][0]= mx;
- mv_table[mot_xy][1]= my;
-
- return dmin;
-}
-
-static inline int check_bidir_mv(MpegEncContext * s,
- int motion_fx, int motion_fy,
- int motion_bx, int motion_by,
- int pred_fx, int pred_fy,
- int pred_bx, int pred_by,
- int size, int h)
-{
- //FIXME optimize?
- //FIXME better f_code prediction (max mv & distance)
- //FIXME pointers
- MotionEstContext * const c= &s->me;
- uint8_t * const mv_penalty_f= c->mv_penalty[s->f_code] + MAX_MV; // f_code of the prev frame
- uint8_t * const mv_penalty_b= c->mv_penalty[s->b_code] + MAX_MV; // f_code of the prev frame
- int stride= c->stride;
- uint8_t *dest_y = c->scratchpad;
- uint8_t *ptr;
- int dxy;
- int src_x, src_y;
- int fbmin;
- uint8_t **src_data= c->src[0];
- uint8_t **ref_data= c->ref[0];
- uint8_t **ref2_data= c->ref[2];
-
- if(s->quarter_sample){
- dxy = ((motion_fy & 3) << 2) | (motion_fx & 3);
- src_x = motion_fx >> 2;
- src_y = motion_fy >> 2;
-
- ptr = ref_data[0] + (src_y * stride) + src_x;
- s->dsp.put_qpel_pixels_tab[0][dxy](dest_y , ptr , stride);
-
- dxy = ((motion_by & 3) << 2) | (motion_bx & 3);
- src_x = motion_bx >> 2;
- src_y = motion_by >> 2;
-
- ptr = ref2_data[0] + (src_y * stride) + src_x;
- s->dsp.avg_qpel_pixels_tab[size][dxy](dest_y , ptr , stride);
- }else{
- dxy = ((motion_fy & 1) << 1) | (motion_fx & 1);
- src_x = motion_fx >> 1;
- src_y = motion_fy >> 1;
-
- ptr = ref_data[0] + (src_y * stride) + src_x;
- s->dsp.put_pixels_tab[size][dxy](dest_y , ptr , stride, h);
-
- dxy = ((motion_by & 1) << 1) | (motion_bx & 1);
- src_x = motion_bx >> 1;
- src_y = motion_by >> 1;
-
- ptr = ref2_data[0] + (src_y * stride) + src_x;
- s->dsp.avg_pixels_tab[size][dxy](dest_y , ptr , stride, h);
- }
-
- fbmin = (mv_penalty_f[motion_fx-pred_fx] + mv_penalty_f[motion_fy-pred_fy])*c->mb_penalty_factor
- +(mv_penalty_b[motion_bx-pred_bx] + mv_penalty_b[motion_by-pred_by])*c->mb_penalty_factor
- + s->dsp.mb_cmp[size](s, src_data[0], dest_y, stride, h); //FIXME new_pic
-
- if(c->avctx->mb_cmp&FF_CMP_CHROMA){
- }
- //FIXME CHROMA !!!
-
- return fbmin;
-}
-
-/* refine the bidir vectors in hq mode and return the score in both lq & hq mode*/
-static inline int bidir_refine(MpegEncContext * s, int mb_x, int mb_y)
-{
- MotionEstContext * const c= &s->me;
- const int mot_stride = s->mb_stride;
- const int xy = mb_y *mot_stride + mb_x;
- int fbmin;
- int pred_fx= s->b_bidir_forw_mv_table[xy-1][0];
- int pred_fy= s->b_bidir_forw_mv_table[xy-1][1];
- int pred_bx= s->b_bidir_back_mv_table[xy-1][0];
- int pred_by= s->b_bidir_back_mv_table[xy-1][1];
- int motion_fx= s->b_bidir_forw_mv_table[xy][0]= s->b_forw_mv_table[xy][0];
- int motion_fy= s->b_bidir_forw_mv_table[xy][1]= s->b_forw_mv_table[xy][1];
- int motion_bx= s->b_bidir_back_mv_table[xy][0]= s->b_back_mv_table[xy][0];
- int motion_by= s->b_bidir_back_mv_table[xy][1]= s->b_back_mv_table[xy][1];
- const int flags= c->sub_flags;
- const int qpel= flags&FLAG_QPEL;
- const int shift= 1+qpel;
- const int xmin= c->xmin<<shift;
- const int ymin= c->ymin<<shift;
- const int xmax= c->xmax<<shift;
- const int ymax= c->ymax<<shift;
- uint8_t map[8][8][8][8];
-
- memset(map,0,sizeof(map));
-#define BIDIR_MAP(fx,fy,bx,by) \
- map[(motion_fx+fx)&7][(motion_fy+fy)&7][(motion_bx+bx)&7][(motion_by+by)&7]
- BIDIR_MAP(0,0,0,0) = 1;
-
- fbmin= check_bidir_mv(s, motion_fx, motion_fy,
- motion_bx, motion_by,
- pred_fx, pred_fy,
- pred_bx, pred_by,
- 0, 16);
-
- if(s->avctx->bidir_refine){
- int score, end;
-#define CHECK_BIDIR(fx,fy,bx,by)\
- if( !BIDIR_MAP(fx,fy,bx,by)\
- &&(fx<=0 || motion_fx+fx<=xmax) && (fy<=0 || motion_fy+fy<=ymax) && (bx<=0 || motion_bx+bx<=xmax) && (by<=0 || motion_by+by<=ymax)\
- &&(fx>=0 || motion_fx+fx>=xmin) && (fy>=0 || motion_fy+fy>=ymin) && (bx>=0 || motion_bx+bx>=xmin) && (by>=0 || motion_by+by>=ymin)){\
- BIDIR_MAP(fx,fy,bx,by) = 1;\
- score= check_bidir_mv(s, motion_fx+fx, motion_fy+fy, motion_bx+bx, motion_by+by, pred_fx, pred_fy, pred_bx, pred_by, 0, 16);\
- if(score < fbmin){\
- fbmin= score;\
- motion_fx+=fx;\
- motion_fy+=fy;\
- motion_bx+=bx;\
- motion_by+=by;\
- end=0;\
- }\
- }
-#define CHECK_BIDIR2(a,b,c,d)\
-CHECK_BIDIR(a,b,c,d)\
-CHECK_BIDIR(-(a),-(b),-(c),-(d))
-
-#define CHECK_BIDIRR(a,b,c,d)\
-CHECK_BIDIR2(a,b,c,d)\
-CHECK_BIDIR2(b,c,d,a)\
-CHECK_BIDIR2(c,d,a,b)\
-CHECK_BIDIR2(d,a,b,c)
-
- do{
- end=1;
-
- CHECK_BIDIRR( 0, 0, 0, 1)
- if(s->avctx->bidir_refine > 1){
- CHECK_BIDIRR( 0, 0, 1, 1)
- CHECK_BIDIR2( 0, 1, 0, 1)
- CHECK_BIDIR2( 1, 0, 1, 0)
- CHECK_BIDIRR( 0, 0,-1, 1)
- CHECK_BIDIR2( 0,-1, 0, 1)
- CHECK_BIDIR2(-1, 0, 1, 0)
- if(s->avctx->bidir_refine > 2){
- CHECK_BIDIRR( 0, 1, 1, 1)
- CHECK_BIDIRR( 0,-1, 1, 1)
- CHECK_BIDIRR( 0, 1,-1, 1)
- CHECK_BIDIRR( 0, 1, 1,-1)
- if(s->avctx->bidir_refine > 3){
- CHECK_BIDIR2( 1, 1, 1, 1)
- CHECK_BIDIRR( 1, 1, 1,-1)
- CHECK_BIDIR2( 1, 1,-1,-1)
- CHECK_BIDIR2( 1,-1,-1, 1)
- CHECK_BIDIR2( 1,-1, 1,-1)
- }
- }
- }
- }while(!end);
- }
-
- s->b_bidir_forw_mv_table[xy][0]= motion_fx;
- s->b_bidir_forw_mv_table[xy][1]= motion_fy;
- s->b_bidir_back_mv_table[xy][0]= motion_bx;
- s->b_bidir_back_mv_table[xy][1]= motion_by;
-
- return fbmin;
-}
-
-static inline int direct_search(MpegEncContext * s, int mb_x, int mb_y)
-{
- MotionEstContext * const c= &s->me;
- int P[10][2];
- const int mot_stride = s->mb_stride;
- const int mot_xy = mb_y*mot_stride + mb_x;
- const int shift= 1+s->quarter_sample;
- int dmin, i;
- const int time_pp= s->pp_time;
- const int time_pb= s->pb_time;
- int mx, my, xmin, xmax, ymin, ymax;
- int16_t (*mv_table)[2]= s->b_direct_mv_table;
-
- c->current_mv_penalty= c->mv_penalty[1] + MAX_MV;
- ymin= xmin=(-32)>>shift;
- ymax= xmax= 31>>shift;
-
- if(IS_8X8(s->next_picture.mb_type[mot_xy])){
- s->mv_type= MV_TYPE_8X8;
- }else{
- s->mv_type= MV_TYPE_16X16;
- }
-
- for(i=0; i<4; i++){
- int index= s->block_index[i];
- int min, max;
-
- c->co_located_mv[i][0]= s->next_picture.motion_val[0][index][0];
- c->co_located_mv[i][1]= s->next_picture.motion_val[0][index][1];
- c->direct_basis_mv[i][0]= c->co_located_mv[i][0]*time_pb/time_pp + ((i& 1)<<(shift+3));
- c->direct_basis_mv[i][1]= c->co_located_mv[i][1]*time_pb/time_pp + ((i>>1)<<(shift+3));
-// c->direct_basis_mv[1][i][0]= c->co_located_mv[i][0]*(time_pb - time_pp)/time_pp + ((i &1)<<(shift+3);
-// c->direct_basis_mv[1][i][1]= c->co_located_mv[i][1]*(time_pb - time_pp)/time_pp + ((i>>1)<<(shift+3);
-
- max= FFMAX(c->direct_basis_mv[i][0], c->direct_basis_mv[i][0] - c->co_located_mv[i][0])>>shift;
- min= FFMIN(c->direct_basis_mv[i][0], c->direct_basis_mv[i][0] - c->co_located_mv[i][0])>>shift;
- max+= 16*mb_x + 1; // +-1 is for the simpler rounding
- min+= 16*mb_x - 1;
- xmax= FFMIN(xmax, s->width - max);
- xmin= FFMAX(xmin, - 16 - min);
-
- max= FFMAX(c->direct_basis_mv[i][1], c->direct_basis_mv[i][1] - c->co_located_mv[i][1])>>shift;
- min= FFMIN(c->direct_basis_mv[i][1], c->direct_basis_mv[i][1] - c->co_located_mv[i][1])>>shift;
- max+= 16*mb_y + 1; // +-1 is for the simpler rounding
- min+= 16*mb_y - 1;
- ymax= FFMIN(ymax, s->height - max);
- ymin= FFMAX(ymin, - 16 - min);
-
- if(s->mv_type == MV_TYPE_16X16) break;
- }
-
- assert(xmax <= 15 && ymax <= 15 && xmin >= -16 && ymin >= -16);
-
- if(xmax < 0 || xmin >0 || ymax < 0 || ymin > 0){
- s->b_direct_mv_table[mot_xy][0]= 0;
- s->b_direct_mv_table[mot_xy][1]= 0;
-
- return 256*256*256*64;
- }
-
- c->xmin= xmin;
- c->ymin= ymin;
- c->xmax= xmax;
- c->ymax= ymax;
- c->flags |= FLAG_DIRECT;
- c->sub_flags |= FLAG_DIRECT;
- c->pred_x=0;
- c->pred_y=0;
-
- P_LEFT[0] = clip(mv_table[mot_xy - 1][0], xmin<<shift, xmax<<shift);
- P_LEFT[1] = clip(mv_table[mot_xy - 1][1], ymin<<shift, ymax<<shift);
-
- /* special case for first line */
- if (!s->first_slice_line) { //FIXME maybe allow this over thread boundary as its clipped
- P_TOP[0] = clip(mv_table[mot_xy - mot_stride ][0], xmin<<shift, xmax<<shift);
- P_TOP[1] = clip(mv_table[mot_xy - mot_stride ][1], ymin<<shift, ymax<<shift);
- P_TOPRIGHT[0] = clip(mv_table[mot_xy - mot_stride + 1 ][0], xmin<<shift, xmax<<shift);
- P_TOPRIGHT[1] = clip(mv_table[mot_xy - mot_stride + 1 ][1], ymin<<shift, ymax<<shift);
-
- P_MEDIAN[0]= mid_pred(P_LEFT[0], P_TOP[0], P_TOPRIGHT[0]);
- P_MEDIAN[1]= mid_pred(P_LEFT[1], P_TOP[1], P_TOPRIGHT[1]);
- }
-
- dmin = ff_epzs_motion_search(s, &mx, &my, P, 0, 0, mv_table, 1<<(16-shift), 0, 16);
- if(c->sub_flags&FLAG_QPEL)
- dmin = qpel_motion_search(s, &mx, &my, dmin, 0, 0, 0, 16);
- else
- dmin = hpel_motion_search(s, &mx, &my, dmin, 0, 0, 0, 16);
-
- if(c->avctx->me_sub_cmp != c->avctx->mb_cmp && !c->skip)
- dmin= ff_get_mb_score(s, mx, my, 0, 0, 0, 16, 1);
-
- get_limits(s, 16*mb_x, 16*mb_y); //restore c->?min/max, maybe not needed
-
- mv_table[mot_xy][0]= mx;
- mv_table[mot_xy][1]= my;
- c->flags &= ~FLAG_DIRECT;
- c->sub_flags &= ~FLAG_DIRECT;
-
- return dmin;
-}
-
-void ff_estimate_b_frame_motion(MpegEncContext * s,
- int mb_x, int mb_y)
-{
- MotionEstContext * const c= &s->me;
- const int penalty_factor= c->mb_penalty_factor;
- int fmin, bmin, dmin, fbmin, bimin, fimin;
- int type=0;
- const int xy = mb_y*s->mb_stride + mb_x;
- init_ref(c, s->new_picture.data, s->last_picture.data, s->next_picture.data, 16*mb_x, 16*mb_y, 2);
-
- get_limits(s, 16*mb_x, 16*mb_y);
-
- c->skip=0;
-
- if(s->codec_id == CODEC_ID_MPEG4 && s->next_picture.mbskip_table[xy]){
- int score= direct_search(s, mb_x, mb_y); //FIXME just check 0,0
-
- score= ((unsigned)(score*score + 128*256))>>16;
- c->mc_mb_var_sum_temp += score;
- s->current_picture.mc_mb_var[mb_y*s->mb_stride + mb_x] = score; //FIXME use SSE
- s->mb_type[mb_y*s->mb_stride + mb_x]= CANDIDATE_MB_TYPE_DIRECT0;
-
- return;
- }
-
- if(c->avctx->me_threshold){
- int vard= check_input_motion(s, mb_x, mb_y, 0);
-
- if((vard+128)>>8 < c->avctx->me_threshold){
-// pix = c->src[0][0];
-// sum = s->dsp.pix_sum(pix, s->linesize);
-// varc = s->dsp.pix_norm1(pix, s->linesize) - (((unsigned)(sum*sum))>>8) + 500;
-
-// pic->mb_var [s->mb_stride * mb_y + mb_x] = (varc+128)>>8;
- s->current_picture.mc_mb_var[s->mb_stride * mb_y + mb_x] = (vard+128)>>8;
-/* pic->mb_mean [s->mb_stride * mb_y + mb_x] = (sum+128)>>8;
- c->mb_var_sum_temp += (varc+128)>>8;*/
- c->mc_mb_var_sum_temp += (vard+128)>>8;
-/* if (vard <= 64<<8 || vard < varc) {
- c->scene_change_score+= ff_sqrt(vard) - ff_sqrt(varc);
- }else{
- c->scene_change_score+= s->qscale * s->avctx->scenechange_factor;
- }*/
- return;
- }
- if((vard+128)>>8 < c->avctx->mb_threshold){
- type= s->mb_type[mb_y*s->mb_stride + mb_x];
- if(type == CANDIDATE_MB_TYPE_DIRECT){
- direct_search(s, mb_x, mb_y);
- }
- if(type == CANDIDATE_MB_TYPE_FORWARD || type == CANDIDATE_MB_TYPE_BIDIR){
- c->skip=0;
- ff_estimate_motion_b(s, mb_x, mb_y, s->b_forw_mv_table, 0, s->f_code);
- }
- if(type == CANDIDATE_MB_TYPE_BACKWARD || type == CANDIDATE_MB_TYPE_BIDIR){
- c->skip=0;
- ff_estimate_motion_b(s, mb_x, mb_y, s->b_back_mv_table, 2, s->b_code);
- }
- if(type == CANDIDATE_MB_TYPE_FORWARD_I || type == CANDIDATE_MB_TYPE_BIDIR_I){
- c->skip=0;
- c->current_mv_penalty= c->mv_penalty[s->f_code] + MAX_MV;
- interlaced_search(s, 0,
- s->b_field_mv_table[0], s->b_field_select_table[0],
- s->b_forw_mv_table[xy][0], s->b_forw_mv_table[xy][1], 1);
- }
- if(type == CANDIDATE_MB_TYPE_BACKWARD_I || type == CANDIDATE_MB_TYPE_BIDIR_I){
- c->skip=0;
- c->current_mv_penalty= c->mv_penalty[s->b_code] + MAX_MV;
- interlaced_search(s, 2,
- s->b_field_mv_table[1], s->b_field_select_table[1],
- s->b_back_mv_table[xy][0], s->b_back_mv_table[xy][1], 1);
- }
- return;
- }
- }
-
- if (s->codec_id == CODEC_ID_MPEG4)
- dmin= direct_search(s, mb_x, mb_y);
- else
- dmin= INT_MAX;
-//FIXME penalty stuff for non mpeg4
- c->skip=0;
- fmin= ff_estimate_motion_b(s, mb_x, mb_y, s->b_forw_mv_table, 0, s->f_code) + 3*penalty_factor;
-
- c->skip=0;
- bmin= ff_estimate_motion_b(s, mb_x, mb_y, s->b_back_mv_table, 2, s->b_code) + 2*penalty_factor;
-//printf(" %d %d ", s->b_forw_mv_table[xy][0], s->b_forw_mv_table[xy][1]);
-
- c->skip=0;
- fbmin= bidir_refine(s, mb_x, mb_y) + penalty_factor;
-//printf("%d %d %d %d\n", dmin, fmin, bmin, fbmin);
-
- if(s->flags & CODEC_FLAG_INTERLACED_ME){
-//FIXME mb type penalty
- c->skip=0;
- c->current_mv_penalty= c->mv_penalty[s->f_code] + MAX_MV;
- fimin= interlaced_search(s, 0,
- s->b_field_mv_table[0], s->b_field_select_table[0],
- s->b_forw_mv_table[xy][0], s->b_forw_mv_table[xy][1], 0);
- c->current_mv_penalty= c->mv_penalty[s->b_code] + MAX_MV;
- bimin= interlaced_search(s, 2,
- s->b_field_mv_table[1], s->b_field_select_table[1],
- s->b_back_mv_table[xy][0], s->b_back_mv_table[xy][1], 0);
- }else
- fimin= bimin= INT_MAX;
-
- {
- int score= fmin;
- type = CANDIDATE_MB_TYPE_FORWARD;
-
- if (dmin <= score){
- score = dmin;
- type = CANDIDATE_MB_TYPE_DIRECT;
- }
- if(bmin<score){
- score=bmin;
- type= CANDIDATE_MB_TYPE_BACKWARD;
- }
- if(fbmin<score){
- score=fbmin;
- type= CANDIDATE_MB_TYPE_BIDIR;
- }
- if(fimin<score){
- score=fimin;
- type= CANDIDATE_MB_TYPE_FORWARD_I;
- }
- if(bimin<score){
- score=bimin;
- type= CANDIDATE_MB_TYPE_BACKWARD_I;
- }
-
- score= ((unsigned)(score*score + 128*256))>>16;
- c->mc_mb_var_sum_temp += score;
- s->current_picture.mc_mb_var[mb_y*s->mb_stride + mb_x] = score; //FIXME use SSE
- }
-
- if(c->avctx->mb_decision > FF_MB_DECISION_SIMPLE){
- type= CANDIDATE_MB_TYPE_FORWARD | CANDIDATE_MB_TYPE_BACKWARD | CANDIDATE_MB_TYPE_BIDIR | CANDIDATE_MB_TYPE_DIRECT;
- if(fimin < INT_MAX)
- type |= CANDIDATE_MB_TYPE_FORWARD_I;
- if(bimin < INT_MAX)
- type |= CANDIDATE_MB_TYPE_BACKWARD_I;
- if(fimin < INT_MAX && bimin < INT_MAX){
- type |= CANDIDATE_MB_TYPE_BIDIR_I;
- }
- //FIXME something smarter
- if(dmin>256*256*16) type&= ~CANDIDATE_MB_TYPE_DIRECT; //dont try direct mode if its invalid for this MB
- if(s->codec_id == CODEC_ID_MPEG4 && type&CANDIDATE_MB_TYPE_DIRECT && s->flags&CODEC_FLAG_MV0 && *(uint32_t*)s->b_direct_mv_table[xy])
- type |= CANDIDATE_MB_TYPE_DIRECT0;
-#if 0
- if(s->out_format == FMT_MPEG1)
- type |= CANDIDATE_MB_TYPE_INTRA;
-#endif
- }
-
- s->mb_type[mb_y*s->mb_stride + mb_x]= type;
-}
-
-/* find best f_code for ME which do unlimited searches */
-int ff_get_best_fcode(MpegEncContext * s, int16_t (*mv_table)[2], int type)
-{
- if(s->me_method>=ME_EPZS){
- int score[8];
- int i, y, range= s->avctx->me_range ? s->avctx->me_range : (INT_MAX/2);
- uint8_t * fcode_tab= s->fcode_tab;
- int best_fcode=-1;
- int best_score=-10000000;
-
- if(s->msmpeg4_version)
- range= FFMIN(range, 16);
- else if(s->codec_id == CODEC_ID_MPEG2VIDEO && s->avctx->strict_std_compliance >= FF_COMPLIANCE_NORMAL)
- range= FFMIN(range, 256);
-
- for(i=0; i<8; i++) score[i]= s->mb_num*(8-i);
-
- for(y=0; y<s->mb_height; y++){
- int x;
- int xy= y*s->mb_stride;
- for(x=0; x<s->mb_width; x++){
- if(s->mb_type[xy] & type){
- int mx= mv_table[xy][0];
- int my= mv_table[xy][1];
- int fcode= FFMAX(fcode_tab[mx + MAX_MV],
- fcode_tab[my + MAX_MV]);
- int j;
-
- if(mx >= range || mx < -range ||
- my >= range || my < -range)
- continue;
-
- for(j=0; j<fcode && j<8; j++){
- if(s->pict_type==B_TYPE || s->current_picture.mc_mb_var[xy] < s->current_picture.mb_var[xy])
- score[j]-= 170;
- }
- }
- xy++;
- }
- }
-
- for(i=1; i<8; i++){
- if(score[i] > best_score){
- best_score= score[i];
- best_fcode= i;
- }
-// printf("%d %d\n", i, score[i]);
- }
-
-// printf("fcode: %d type: %d\n", i, s->pict_type);
- return best_fcode;
-/* for(i=0; i<=MAX_FCODE; i++){
- printf("%d ", mv_num[i]);
- }
- printf("\n");*/
- }else{
- return 1;
- }
-}
-
-void ff_fix_long_p_mvs(MpegEncContext * s)
-{
- MotionEstContext * const c= &s->me;
- const int f_code= s->f_code;
- int y, range;
- assert(s->pict_type==P_TYPE);
-
- range = (((s->out_format == FMT_MPEG1 || s->msmpeg4_version) ? 8 : 16) << f_code);
-
- assert(range <= 16 || !s->msmpeg4_version);
- assert(range <=256 || !(s->codec_id == CODEC_ID_MPEG2VIDEO && s->avctx->strict_std_compliance >= FF_COMPLIANCE_NORMAL));
-
- if(c->avctx->me_range && range > c->avctx->me_range) range= c->avctx->me_range;
-
-//printf("%d no:%d %d//\n", clip, noclip, f_code);
- if(s->flags&CODEC_FLAG_4MV){
- const int wrap= s->b8_stride;
-
- /* clip / convert to intra 8x8 type MVs */
- for(y=0; y<s->mb_height; y++){
- int xy= y*2*wrap;
- int i= y*s->mb_stride;
- int x;
-
- for(x=0; x<s->mb_width; x++){
- if(s->mb_type[i]&CANDIDATE_MB_TYPE_INTER4V){
- int block;
- for(block=0; block<4; block++){
- int off= (block& 1) + (block>>1)*wrap;
- int mx= s->current_picture.motion_val[0][ xy + off ][0];
- int my= s->current_picture.motion_val[0][ xy + off ][1];
-
- if( mx >=range || mx <-range
- || my >=range || my <-range){
- s->mb_type[i] &= ~CANDIDATE_MB_TYPE_INTER4V;
- s->mb_type[i] |= CANDIDATE_MB_TYPE_INTRA;
- s->current_picture.mb_type[i]= CANDIDATE_MB_TYPE_INTRA;
- }
- }
- }
- xy+=2;
- i++;
- }
- }
- }
-}
-
-/**
- *
- * @param truncate 1 for truncation, 0 for using intra
- */
-void ff_fix_long_mvs(MpegEncContext * s, uint8_t *field_select_table, int field_select,
- int16_t (*mv_table)[2], int f_code, int type, int truncate)
-{
- MotionEstContext * const c= &s->me;
- int y, h_range, v_range;
-
- // RAL: 8 in MPEG-1, 16 in MPEG-4
- int range = (((s->out_format == FMT_MPEG1 || s->msmpeg4_version) ? 8 : 16) << f_code);
-
- if(c->avctx->me_range && range > c->avctx->me_range) range= c->avctx->me_range;
-
- h_range= range;
- v_range= field_select_table ? range>>1 : range;
-
- /* clip / convert to intra 16x16 type MVs */
- for(y=0; y<s->mb_height; y++){
- int x;
- int xy= y*s->mb_stride;
- for(x=0; x<s->mb_width; x++){
- if (s->mb_type[xy] & type){ // RAL: "type" test added...
- if(field_select_table==NULL || field_select_table[xy] == field_select){
- if( mv_table[xy][0] >=h_range || mv_table[xy][0] <-h_range
- || mv_table[xy][1] >=v_range || mv_table[xy][1] <-v_range){
-
- if(truncate){
- if (mv_table[xy][0] > h_range-1) mv_table[xy][0]= h_range-1;
- else if(mv_table[xy][0] < -h_range ) mv_table[xy][0]= -h_range;
- if (mv_table[xy][1] > v_range-1) mv_table[xy][1]= v_range-1;
- else if(mv_table[xy][1] < -v_range ) mv_table[xy][1]= -v_range;
- }else{
- s->mb_type[xy] &= ~type;
- s->mb_type[xy] |= CANDIDATE_MB_TYPE_INTRA;
- mv_table[xy][0]=
- mv_table[xy][1]= 0;
- }
- }
- }
- }
- xy++;
- }
- }
-}
-
-#endif /* CONFIG_ENCODERS */
diff --git a/src/libffmpeg/libavcodec/motion_est_template.c b/src/libffmpeg/libavcodec/motion_est_template.c
deleted file mode 100644
index 897c08e3d..000000000
--- a/src/libffmpeg/libavcodec/motion_est_template.c
+++ /dev/null
@@ -1,1238 +0,0 @@
-/*
- * Motion estimation
- * Copyright (c) 2002-2004 Michael Niedermayer
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file motion_est_template.c
- * Motion estimation template.
- */
-
-//lets hope gcc will remove the unused vars ...(gcc 3.2.2 seems to do it ...)
-#define LOAD_COMMON\
- uint32_t attribute_unused * const score_map= c->score_map;\
- const int attribute_unused xmin= c->xmin;\
- const int attribute_unused ymin= c->ymin;\
- const int attribute_unused xmax= c->xmax;\
- const int attribute_unused ymax= c->ymax;\
- uint8_t *mv_penalty= c->current_mv_penalty;\
- const int pred_x= c->pred_x;\
- const int pred_y= c->pred_y;\
-
-#define CHECK_HALF_MV(dx, dy, x, y)\
-{\
- const int hx= 2*(x)+(dx);\
- const int hy= 2*(y)+(dy);\
- d= cmp(s, x, y, dx, dy, size, h, ref_index, src_index, cmp_sub, chroma_cmp_sub, flags);\
- d += (mv_penalty[hx - pred_x] + mv_penalty[hy - pred_y])*penalty_factor;\
- COPY3_IF_LT(dmin, d, bx, hx, by, hy)\
-}
-
-#if 0
-static int hpel_motion_search)(MpegEncContext * s,
- int *mx_ptr, int *my_ptr, int dmin,
- uint8_t *ref_data[3],
- int size)
-{
- const int xx = 16 * s->mb_x + 8*(n&1);
- const int yy = 16 * s->mb_y + 8*(n>>1);
- const int mx = *mx_ptr;
- const int my = *my_ptr;
- const int penalty_factor= c->sub_penalty_factor;
-
- LOAD_COMMON
-
- // INIT;
- //FIXME factorize
- me_cmp_func cmp, chroma_cmp, cmp_sub, chroma_cmp_sub;
-
- if(s->no_rounding /*FIXME b_type*/){
- hpel_put= &s->dsp.put_no_rnd_pixels_tab[size];
- chroma_hpel_put= &s->dsp.put_no_rnd_pixels_tab[size+1];
- }else{
- hpel_put=& s->dsp.put_pixels_tab[size];
- chroma_hpel_put= &s->dsp.put_pixels_tab[size+1];
- }
- cmpf= s->dsp.me_cmp[size];
- chroma_cmpf= s->dsp.me_cmp[size+1];
- cmp_sub= s->dsp.me_sub_cmp[size];
- chroma_cmp_sub= s->dsp.me_sub_cmp[size+1];
-
- if(c->skip){ //FIXME somehow move up (benchmark)
- *mx_ptr = 0;
- *my_ptr = 0;
- return dmin;
- }
-
- if(c->avctx->me_cmp != c->avctx->me_sub_cmp){
- CMP_HPEL(dmin, 0, 0, mx, my, size);
- if(mx || my)
- dmin += (mv_penalty[2*mx - pred_x] + mv_penalty[2*my - pred_y])*penalty_factor;
- }
-
- if (mx > xmin && mx < xmax &&
- my > ymin && my < ymax) {
- int bx=2*mx, by=2*my;
- int d= dmin;
-
- CHECK_HALF_MV(1, 1, mx-1, my-1)
- CHECK_HALF_MV(0, 1, mx , my-1)
- CHECK_HALF_MV(1, 1, mx , my-1)
- CHECK_HALF_MV(1, 0, mx-1, my )
- CHECK_HALF_MV(1, 0, mx , my )
- CHECK_HALF_MV(1, 1, mx-1, my )
- CHECK_HALF_MV(0, 1, mx , my )
- CHECK_HALF_MV(1, 1, mx , my )
-
- assert(bx >= xmin*2 || bx <= xmax*2 || by >= ymin*2 || by <= ymax*2);
-
- *mx_ptr = bx;
- *my_ptr = by;
- }else{
- *mx_ptr =2*mx;
- *my_ptr =2*my;
- }
-
- return dmin;
-}
-
-#else
-static int hpel_motion_search(MpegEncContext * s,
- int *mx_ptr, int *my_ptr, int dmin,
- int src_index, int ref_index,
- int size, int h)
-{
- MotionEstContext * const c= &s->me;
- const int mx = *mx_ptr;
- const int my = *my_ptr;
- const int penalty_factor= c->sub_penalty_factor;
- me_cmp_func cmp_sub, chroma_cmp_sub;
- int bx=2*mx, by=2*my;
-
- LOAD_COMMON
- int flags= c->sub_flags;
-
- //FIXME factorize
-
- cmp_sub= s->dsp.me_sub_cmp[size];
- chroma_cmp_sub= s->dsp.me_sub_cmp[size+1];
-
- if(c->skip){ //FIXME move out of hpel?
- *mx_ptr = 0;
- *my_ptr = 0;
- return dmin;
- }
-
- if(c->avctx->me_cmp != c->avctx->me_sub_cmp){
- dmin= cmp(s, mx, my, 0, 0, size, h, ref_index, src_index, cmp_sub, chroma_cmp_sub, flags);
- if(mx || my || size>0)
- dmin += (mv_penalty[2*mx - pred_x] + mv_penalty[2*my - pred_y])*penalty_factor;
- }
-
- if (mx > xmin && mx < xmax &&
- my > ymin && my < ymax) {
- int d= dmin;
- const int index= (my<<ME_MAP_SHIFT) + mx;
- const int t= score_map[(index-(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)]
- + (mv_penalty[bx - pred_x] + mv_penalty[by-2 - pred_y])*c->penalty_factor;
- const int l= score_map[(index- 1 )&(ME_MAP_SIZE-1)]
- + (mv_penalty[bx-2 - pred_x] + mv_penalty[by - pred_y])*c->penalty_factor;
- const int r= score_map[(index+ 1 )&(ME_MAP_SIZE-1)]
- + (mv_penalty[bx+2 - pred_x] + mv_penalty[by - pred_y])*c->penalty_factor;
- const int b= score_map[(index+(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)]
- + (mv_penalty[bx - pred_x] + mv_penalty[by+2 - pred_y])*c->penalty_factor;
-
-#if 1
- int key;
- int map_generation= c->map_generation;
-#ifndef NDEBUG
- uint32_t *map= c->map;
-#endif
- key= ((my-1)<<ME_MAP_MV_BITS) + (mx) + map_generation;
- assert(map[(index-(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)] == key);
- key= ((my+1)<<ME_MAP_MV_BITS) + (mx) + map_generation;
- assert(map[(index+(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)] == key);
- key= ((my)<<ME_MAP_MV_BITS) + (mx+1) + map_generation;
- assert(map[(index+1)&(ME_MAP_SIZE-1)] == key);
- key= ((my)<<ME_MAP_MV_BITS) + (mx-1) + map_generation;
- assert(map[(index-1)&(ME_MAP_SIZE-1)] == key);
-#endif
- if(t<=b){
- CHECK_HALF_MV(0, 1, mx ,my-1)
- if(l<=r){
- CHECK_HALF_MV(1, 1, mx-1, my-1)
- if(t+r<=b+l){
- CHECK_HALF_MV(1, 1, mx , my-1)
- }else{
- CHECK_HALF_MV(1, 1, mx-1, my )
- }
- CHECK_HALF_MV(1, 0, mx-1, my )
- }else{
- CHECK_HALF_MV(1, 1, mx , my-1)
- if(t+l<=b+r){
- CHECK_HALF_MV(1, 1, mx-1, my-1)
- }else{
- CHECK_HALF_MV(1, 1, mx , my )
- }
- CHECK_HALF_MV(1, 0, mx , my )
- }
- }else{
- if(l<=r){
- if(t+l<=b+r){
- CHECK_HALF_MV(1, 1, mx-1, my-1)
- }else{
- CHECK_HALF_MV(1, 1, mx , my )
- }
- CHECK_HALF_MV(1, 0, mx-1, my)
- CHECK_HALF_MV(1, 1, mx-1, my)
- }else{
- if(t+r<=b+l){
- CHECK_HALF_MV(1, 1, mx , my-1)
- }else{
- CHECK_HALF_MV(1, 1, mx-1, my)
- }
- CHECK_HALF_MV(1, 0, mx , my)
- CHECK_HALF_MV(1, 1, mx , my)
- }
- CHECK_HALF_MV(0, 1, mx , my)
- }
- assert(bx >= xmin*2 && bx <= xmax*2 && by >= ymin*2 && by <= ymax*2);
- }
-
- *mx_ptr = bx;
- *my_ptr = by;
-
- return dmin;
-}
-#endif
-
-static int no_sub_motion_search(MpegEncContext * s,
- int *mx_ptr, int *my_ptr, int dmin,
- int src_index, int ref_index,
- int size, int h)
-{
- (*mx_ptr)<<=1;
- (*my_ptr)<<=1;
- return dmin;
-}
-
-inline int ff_get_mb_score(MpegEncContext * s, int mx, int my, int src_index,
- int ref_index, int size, int h, int add_rate)
-{
-// const int check_luma= s->dsp.me_sub_cmp != s->dsp.mb_cmp;
- MotionEstContext * const c= &s->me;
- const int penalty_factor= c->mb_penalty_factor;
- const int flags= c->mb_flags;
- const int qpel= flags & FLAG_QPEL;
- const int mask= 1+2*qpel;
- me_cmp_func cmp_sub, chroma_cmp_sub;
- int d;
-
- LOAD_COMMON
-
- //FIXME factorize
-
- cmp_sub= s->dsp.mb_cmp[size];
- chroma_cmp_sub= s->dsp.mb_cmp[size+1];
-
-// assert(!c->skip);
-// assert(c->avctx->me_sub_cmp != c->avctx->mb_cmp);
-
- d= cmp(s, mx>>(qpel+1), my>>(qpel+1), mx&mask, my&mask, size, h, ref_index, src_index, cmp_sub, chroma_cmp_sub, flags);
- //FIXME check cbp before adding penalty for (0,0) vector
- if(add_rate && (mx || my || size>0))
- d += (mv_penalty[mx - pred_x] + mv_penalty[my - pred_y])*penalty_factor;
-
- return d;
-}
-
-#define CHECK_QUARTER_MV(dx, dy, x, y)\
-{\
- const int hx= 4*(x)+(dx);\
- const int hy= 4*(y)+(dy);\
- d= cmp(s, x, y, dx, dy, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags);\
- d += (mv_penalty[hx - pred_x] + mv_penalty[hy - pred_y])*penalty_factor;\
- COPY3_IF_LT(dmin, d, bx, hx, by, hy)\
-}
-
-static int qpel_motion_search(MpegEncContext * s,
- int *mx_ptr, int *my_ptr, int dmin,
- int src_index, int ref_index,
- int size, int h)
-{
- MotionEstContext * const c= &s->me;
- const int mx = *mx_ptr;
- const int my = *my_ptr;
- const int penalty_factor= c->sub_penalty_factor;
- const int map_generation= c->map_generation;
- const int subpel_quality= c->avctx->me_subpel_quality;
- uint32_t *map= c->map;
- me_cmp_func cmpf, chroma_cmpf;
- me_cmp_func cmp_sub, chroma_cmp_sub;
-
- LOAD_COMMON
- int flags= c->sub_flags;
-
- cmpf= s->dsp.me_cmp[size];
- chroma_cmpf= s->dsp.me_cmp[size+1]; //factorize FIXME
- //FIXME factorize
-
- cmp_sub= s->dsp.me_sub_cmp[size];
- chroma_cmp_sub= s->dsp.me_sub_cmp[size+1];
-
- if(c->skip){ //FIXME somehow move up (benchmark)
- *mx_ptr = 0;
- *my_ptr = 0;
- return dmin;
- }
-
- if(c->avctx->me_cmp != c->avctx->me_sub_cmp){
- dmin= cmp(s, mx, my, 0, 0, size, h, ref_index, src_index, cmp_sub, chroma_cmp_sub, flags);
- if(mx || my || size>0)
- dmin += (mv_penalty[4*mx - pred_x] + mv_penalty[4*my - pred_y])*penalty_factor;
- }
-
- if (mx > xmin && mx < xmax &&
- my > ymin && my < ymax) {
- int bx=4*mx, by=4*my;
- int d= dmin;
- int i, nx, ny;
- const int index= (my<<ME_MAP_SHIFT) + mx;
- const int t= score_map[(index-(1<<ME_MAP_SHIFT) )&(ME_MAP_SIZE-1)];
- const int l= score_map[(index- 1 )&(ME_MAP_SIZE-1)];
- const int r= score_map[(index+ 1 )&(ME_MAP_SIZE-1)];
- const int b= score_map[(index+(1<<ME_MAP_SHIFT) )&(ME_MAP_SIZE-1)];
- const int c= score_map[(index )&(ME_MAP_SIZE-1)];
- int best[8];
- int best_pos[8][2];
-
- memset(best, 64, sizeof(int)*8);
-#if 1
- if(s->me.dia_size>=2){
- const int tl= score_map[(index-(1<<ME_MAP_SHIFT)-1)&(ME_MAP_SIZE-1)];
- const int bl= score_map[(index+(1<<ME_MAP_SHIFT)-1)&(ME_MAP_SIZE-1)];
- const int tr= score_map[(index-(1<<ME_MAP_SHIFT)+1)&(ME_MAP_SIZE-1)];
- const int br= score_map[(index+(1<<ME_MAP_SHIFT)+1)&(ME_MAP_SIZE-1)];
-
- for(ny= -3; ny <= 3; ny++){
- for(nx= -3; nx <= 3; nx++){
- //FIXME this could overflow (unlikely though)
- const int64_t t2= nx*nx*(tr + tl - 2*t) + 4*nx*(tr-tl) + 32*t;
- const int64_t c2= nx*nx*( r + l - 2*c) + 4*nx*( r- l) + 32*c;
- const int64_t b2= nx*nx*(br + bl - 2*b) + 4*nx*(br-bl) + 32*b;
- int score= (ny*ny*(b2 + t2 - 2*c2) + 4*ny*(b2 - t2) + 32*c2 + 512)>>10;
- int i;
-
- if((nx&3)==0 && (ny&3)==0) continue;
-
- score += (mv_penalty[4*mx + nx - pred_x] + mv_penalty[4*my + ny - pred_y])*penalty_factor;
-
-// if(nx&1) score-=1024*c->penalty_factor;
-// if(ny&1) score-=1024*c->penalty_factor;
-
- for(i=0; i<8; i++){
- if(score < best[i]){
- memmove(&best[i+1], &best[i], sizeof(int)*(7-i));
- memmove(&best_pos[i+1][0], &best_pos[i][0], sizeof(int)*2*(7-i));
- best[i]= score;
- best_pos[i][0]= nx + 4*mx;
- best_pos[i][1]= ny + 4*my;
- break;
- }
- }
- }
- }
- }else{
- int tl;
- //FIXME this could overflow (unlikely though)
- const int cx = 4*(r - l);
- const int cx2= r + l - 2*c;
- const int cy = 4*(b - t);
- const int cy2= b + t - 2*c;
- int cxy;
-
- if(map[(index-(1<<ME_MAP_SHIFT)-1)&(ME_MAP_SIZE-1)] == (my<<ME_MAP_MV_BITS) + mx + map_generation && 0){ //FIXME
- tl= score_map[(index-(1<<ME_MAP_SHIFT)-1)&(ME_MAP_SIZE-1)];
- }else{
- tl= cmp(s, mx-1, my-1, 0, 0, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags);//FIXME wrong if chroma me is different
- }
-
- cxy= 2*tl + (cx + cy)/4 - (cx2 + cy2) - 2*c;
-
- assert(16*cx2 + 4*cx + 32*c == 32*r);
- assert(16*cx2 - 4*cx + 32*c == 32*l);
- assert(16*cy2 + 4*cy + 32*c == 32*b);
- assert(16*cy2 - 4*cy + 32*c == 32*t);
- assert(16*cxy + 16*cy2 + 16*cx2 - 4*cy - 4*cx + 32*c == 32*tl);
-
- for(ny= -3; ny <= 3; ny++){
- for(nx= -3; nx <= 3; nx++){
- //FIXME this could overflow (unlikely though)
- int score= ny*nx*cxy + nx*nx*cx2 + ny*ny*cy2 + nx*cx + ny*cy + 32*c; //FIXME factor
- int i;
-
- if((nx&3)==0 && (ny&3)==0) continue;
-
- score += 32*(mv_penalty[4*mx + nx - pred_x] + mv_penalty[4*my + ny - pred_y])*penalty_factor;
-// if(nx&1) score-=32*c->penalty_factor;
- // if(ny&1) score-=32*c->penalty_factor;
-
- for(i=0; i<8; i++){
- if(score < best[i]){
- memmove(&best[i+1], &best[i], sizeof(int)*(7-i));
- memmove(&best_pos[i+1][0], &best_pos[i][0], sizeof(int)*2*(7-i));
- best[i]= score;
- best_pos[i][0]= nx + 4*mx;
- best_pos[i][1]= ny + 4*my;
- break;
- }
- }
- }
- }
- }
- for(i=0; i<subpel_quality; i++){
- nx= best_pos[i][0];
- ny= best_pos[i][1];
- CHECK_QUARTER_MV(nx&3, ny&3, nx>>2, ny>>2)
- }
-
-#if 0
- const int tl= score_map[(index-(1<<ME_MAP_SHIFT)-1)&(ME_MAP_SIZE-1)];
- const int bl= score_map[(index+(1<<ME_MAP_SHIFT)-1)&(ME_MAP_SIZE-1)];
- const int tr= score_map[(index-(1<<ME_MAP_SHIFT)+1)&(ME_MAP_SIZE-1)];
- const int br= score_map[(index+(1<<ME_MAP_SHIFT)+1)&(ME_MAP_SIZE-1)];
-// if(l < r && l < t && l < b && l < tl && l < bl && l < tr && l < br && bl < tl){
- if(tl<br){
-
-// nx= FFMAX(4*mx - bx, bx - 4*mx);
-// ny= FFMAX(4*my - by, by - 4*my);
-
- static int stats[7][7], count;
- count++;
- stats[4*mx - bx + 3][4*my - by + 3]++;
- if(256*256*256*64 % count ==0){
- for(i=0; i<49; i++){
- if((i%7)==0) printf("\n");
- printf("%6d ", stats[0][i]);
- }
- printf("\n");
- }
- }
-#endif
-#else
-
- CHECK_QUARTER_MV(2, 2, mx-1, my-1)
- CHECK_QUARTER_MV(0, 2, mx , my-1)
- CHECK_QUARTER_MV(2, 2, mx , my-1)
- CHECK_QUARTER_MV(2, 0, mx , my )
- CHECK_QUARTER_MV(2, 2, mx , my )
- CHECK_QUARTER_MV(0, 2, mx , my )
- CHECK_QUARTER_MV(2, 2, mx-1, my )
- CHECK_QUARTER_MV(2, 0, mx-1, my )
-
- nx= bx;
- ny= by;
-
- for(i=0; i<8; i++){
- int ox[8]= {0, 1, 1, 1, 0,-1,-1,-1};
- int oy[8]= {1, 1, 0,-1,-1,-1, 0, 1};
- CHECK_QUARTER_MV((nx + ox[i])&3, (ny + oy[i])&3, (nx + ox[i])>>2, (ny + oy[i])>>2)
- }
-#endif
-#if 0
- //outer ring
- CHECK_QUARTER_MV(1, 3, mx-1, my-1)
- CHECK_QUARTER_MV(1, 2, mx-1, my-1)
- CHECK_QUARTER_MV(1, 1, mx-1, my-1)
- CHECK_QUARTER_MV(2, 1, mx-1, my-1)
- CHECK_QUARTER_MV(3, 1, mx-1, my-1)
- CHECK_QUARTER_MV(0, 1, mx , my-1)
- CHECK_QUARTER_MV(1, 1, mx , my-1)
- CHECK_QUARTER_MV(2, 1, mx , my-1)
- CHECK_QUARTER_MV(3, 1, mx , my-1)
- CHECK_QUARTER_MV(3, 2, mx , my-1)
- CHECK_QUARTER_MV(3, 3, mx , my-1)
- CHECK_QUARTER_MV(3, 0, mx , my )
- CHECK_QUARTER_MV(3, 1, mx , my )
- CHECK_QUARTER_MV(3, 2, mx , my )
- CHECK_QUARTER_MV(3, 3, mx , my )
- CHECK_QUARTER_MV(2, 3, mx , my )
- CHECK_QUARTER_MV(1, 3, mx , my )
- CHECK_QUARTER_MV(0, 3, mx , my )
- CHECK_QUARTER_MV(3, 3, mx-1, my )
- CHECK_QUARTER_MV(2, 3, mx-1, my )
- CHECK_QUARTER_MV(1, 3, mx-1, my )
- CHECK_QUARTER_MV(1, 2, mx-1, my )
- CHECK_QUARTER_MV(1, 1, mx-1, my )
- CHECK_QUARTER_MV(1, 0, mx-1, my )
-#endif
- assert(bx >= xmin*4 && bx <= xmax*4 && by >= ymin*4 && by <= ymax*4);
-
- *mx_ptr = bx;
- *my_ptr = by;
- }else{
- *mx_ptr =4*mx;
- *my_ptr =4*my;
- }
-
- return dmin;
-}
-
-
-#define CHECK_MV(x,y)\
-{\
- const int key= ((y)<<ME_MAP_MV_BITS) + (x) + map_generation;\
- const int index= (((y)<<ME_MAP_SHIFT) + (x))&(ME_MAP_SIZE-1);\
- assert((x) >= xmin);\
- assert((x) <= xmax);\
- assert((y) >= ymin);\
- assert((y) <= ymax);\
-/*printf("check_mv %d %d\n", x, y);*/\
- if(map[index]!=key){\
- d= cmp(s, x, y, 0, 0, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags);\
- map[index]= key;\
- score_map[index]= d;\
- d += (mv_penalty[((x)<<shift)-pred_x] + mv_penalty[((y)<<shift)-pred_y])*penalty_factor;\
-/*printf("score:%d\n", d);*/\
- COPY3_IF_LT(dmin, d, best[0], x, best[1], y)\
- }\
-}
-
-#define CHECK_CLIPPED_MV(ax,ay)\
-{\
- const int Lx= ax;\
- const int Ly= ay;\
- const int Lx2= FFMAX(xmin, FFMIN(Lx, xmax));\
- const int Ly2= FFMAX(ymin, FFMIN(Ly, ymax));\
- CHECK_MV(Lx2, Ly2)\
-}
-
-#define CHECK_MV_DIR(x,y,new_dir)\
-{\
- const int key= ((y)<<ME_MAP_MV_BITS) + (x) + map_generation;\
- const int index= (((y)<<ME_MAP_SHIFT) + (x))&(ME_MAP_SIZE-1);\
-/*printf("check_mv_dir %d %d %d\n", x, y, new_dir);*/\
- if(map[index]!=key){\
- d= cmp(s, x, y, 0, 0, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags);\
- map[index]= key;\
- score_map[index]= d;\
- d += (mv_penalty[((x)<<shift)-pred_x] + mv_penalty[((y)<<shift)-pred_y])*penalty_factor;\
-/*printf("score:%d\n", d);*/\
- if(d<dmin){\
- best[0]=x;\
- best[1]=y;\
- dmin=d;\
- next_dir= new_dir;\
- }\
- }\
-}
-
-#define check(x,y,S,v)\
-if( (x)<(xmin<<(S)) ) printf("%d %d %d %d %d xmin" #v, xmin, (x), (y), s->mb_x, s->mb_y);\
-if( (x)>(xmax<<(S)) ) printf("%d %d %d %d %d xmax" #v, xmax, (x), (y), s->mb_x, s->mb_y);\
-if( (y)<(ymin<<(S)) ) printf("%d %d %d %d %d ymin" #v, ymin, (x), (y), s->mb_x, s->mb_y);\
-if( (y)>(ymax<<(S)) ) printf("%d %d %d %d %d ymax" #v, ymax, (x), (y), s->mb_x, s->mb_y);\
-
-#define LOAD_COMMON2\
- uint32_t *map= c->map;\
- const int qpel= flags&FLAG_QPEL;\
- const int shift= 1+qpel;\
-
-static av_always_inline int small_diamond_search(MpegEncContext * s, int *best, int dmin,
- int src_index, int ref_index, int const penalty_factor,
- int size, int h, int flags)
-{
- MotionEstContext * const c= &s->me;
- me_cmp_func cmpf, chroma_cmpf;
- int next_dir=-1;
- LOAD_COMMON
- LOAD_COMMON2
- int map_generation= c->map_generation;
-
- cmpf= s->dsp.me_cmp[size];
- chroma_cmpf= s->dsp.me_cmp[size+1];
-
- { /* ensure that the best point is in the MAP as h/qpel refinement needs it */
- const int key= (best[1]<<ME_MAP_MV_BITS) + best[0] + map_generation;
- const int index= ((best[1]<<ME_MAP_SHIFT) + best[0])&(ME_MAP_SIZE-1);
- if(map[index]!=key){ //this will be executed only very rarey
- score_map[index]= cmp(s, best[0], best[1], 0, 0, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags);
- map[index]= key;
- }
- }
-
- for(;;){
- int d;
- const int dir= next_dir;
- const int x= best[0];
- const int y= best[1];
- next_dir=-1;
-
-//printf("%d", dir);
- if(dir!=2 && x>xmin) CHECK_MV_DIR(x-1, y , 0)
- if(dir!=3 && y>ymin) CHECK_MV_DIR(x , y-1, 1)
- if(dir!=0 && x<xmax) CHECK_MV_DIR(x+1, y , 2)
- if(dir!=1 && y<ymax) CHECK_MV_DIR(x , y+1, 3)
-
- if(next_dir==-1){
- return dmin;
- }
- }
-}
-
-static int funny_diamond_search(MpegEncContext * s, int *best, int dmin,
- int src_index, int ref_index, int const penalty_factor,
- int size, int h, int flags)
-{
- MotionEstContext * const c= &s->me;
- me_cmp_func cmpf, chroma_cmpf;
- int dia_size;
- LOAD_COMMON
- LOAD_COMMON2
- int map_generation= c->map_generation;
-
- cmpf= s->dsp.me_cmp[size];
- chroma_cmpf= s->dsp.me_cmp[size+1];
-
- for(dia_size=1; dia_size<=4; dia_size++){
- int dir;
- const int x= best[0];
- const int y= best[1];
-
- if(dia_size&(dia_size-1)) continue;
-
- if( x + dia_size > xmax
- || x - dia_size < xmin
- || y + dia_size > ymax
- || y - dia_size < ymin)
- continue;
-
- for(dir= 0; dir<dia_size; dir+=2){
- int d;
-
- CHECK_MV(x + dir , y + dia_size - dir);
- CHECK_MV(x + dia_size - dir, y - dir );
- CHECK_MV(x - dir , y - dia_size + dir);
- CHECK_MV(x - dia_size + dir, y + dir );
- }
-
- if(x!=best[0] || y!=best[1])
- dia_size=0;
-#if 0
-{
-int dx, dy, i;
-static int stats[8*8];
-dx= FFABS(x-best[0]);
-dy= FFABS(y-best[1]);
-if(dy>dx){
- dx^=dy; dy^=dx; dx^=dy;
-}
-stats[dy*8 + dx] ++;
-if(256*256*256*64 % (stats[0]+1)==0){
- for(i=0; i<64; i++){
- if((i&7)==0) printf("\n");
- printf("%8d ", stats[i]);
- }
- printf("\n");
-}
-}
-#endif
- }
- return dmin;
-}
-
-static int hex_search(MpegEncContext * s, int *best, int dmin,
- int src_index, int ref_index, int const penalty_factor,
- int size, int h, int flags, int dia_size)
-{
- MotionEstContext * const c= &s->me;
- me_cmp_func cmpf, chroma_cmpf;
- LOAD_COMMON
- LOAD_COMMON2
- int map_generation= c->map_generation;
- int x,y,d;
- const int dec= dia_size & (dia_size-1);
-
- cmpf= s->dsp.me_cmp[size];
- chroma_cmpf= s->dsp.me_cmp[size+1];
-
- for(;dia_size; dia_size= dec ? dia_size-1 : dia_size>>1){
- do{
- x= best[0];
- y= best[1];
-
- CHECK_CLIPPED_MV(x -dia_size , y);
- CHECK_CLIPPED_MV(x+ dia_size , y);
- CHECK_CLIPPED_MV(x+( dia_size>>1), y+dia_size);
- CHECK_CLIPPED_MV(x+( dia_size>>1), y-dia_size);
- if(dia_size>1){
- CHECK_CLIPPED_MV(x+(-dia_size>>1), y+dia_size);
- CHECK_CLIPPED_MV(x+(-dia_size>>1), y-dia_size);
- }
- }while(best[0] != x || best[1] != y);
- }
-
- return dmin;
-}
-
-static int l2s_dia_search(MpegEncContext * s, int *best, int dmin,
- int src_index, int ref_index, int const penalty_factor,
- int size, int h, int flags)
-{
- MotionEstContext * const c= &s->me;
- me_cmp_func cmpf, chroma_cmpf;
- LOAD_COMMON
- LOAD_COMMON2
- int map_generation= c->map_generation;
- int x,y,i,d;
- int dia_size= c->dia_size&0xFF;
- const int dec= dia_size & (dia_size-1);
- static const int hex[8][2]={{-2, 0}, {-1,-1}, { 0,-2}, { 1,-1},
- { 2, 0}, { 1, 1}, { 0, 2}, {-1, 1}};
-
- cmpf= s->dsp.me_cmp[size];
- chroma_cmpf= s->dsp.me_cmp[size+1];
-
- for(; dia_size; dia_size= dec ? dia_size-1 : dia_size>>1){
- do{
- x= best[0];
- y= best[1];
- for(i=0; i<8; i++){
- CHECK_CLIPPED_MV(x+hex[i][0]*dia_size, y+hex[i][1]*dia_size);
- }
- }while(best[0] != x || best[1] != y);
- }
-
- x= best[0];
- y= best[1];
- CHECK_CLIPPED_MV(x+1, y);
- CHECK_CLIPPED_MV(x, y+1);
- CHECK_CLIPPED_MV(x-1, y);
- CHECK_CLIPPED_MV(x, y-1);
-
- return dmin;
-}
-
-static int umh_search(MpegEncContext * s, int *best, int dmin,
- int src_index, int ref_index, int const penalty_factor,
- int size, int h, int flags)
-{
- MotionEstContext * const c= &s->me;
- me_cmp_func cmpf, chroma_cmpf;
- LOAD_COMMON
- LOAD_COMMON2
- int map_generation= c->map_generation;
- int x,y,x2,y2, i, j, d;
- const int dia_size= c->dia_size&0xFE;
- static const int hex[16][2]={{-4,-2}, {-4,-1}, {-4, 0}, {-4, 1}, {-4, 2},
- { 4,-2}, { 4,-1}, { 4, 0}, { 4, 1}, { 4, 2},
- {-2, 3}, { 0, 4}, { 2, 3},
- {-2,-3}, { 0,-4}, { 2,-3},};
-
- cmpf= s->dsp.me_cmp[size];
- chroma_cmpf= s->dsp.me_cmp[size+1];
-
- x= best[0];
- y= best[1];
- for(x2=FFMAX(x-dia_size+1, xmin); x2<=FFMIN(x+dia_size-1,xmax); x2+=2){
- CHECK_MV(x2, y);
- }
- for(y2=FFMAX(y-dia_size/2+1, ymin); y2<=FFMIN(y+dia_size/2-1,ymax); y2+=2){
- CHECK_MV(x, y2);
- }
-
- x= best[0];
- y= best[1];
- for(y2=FFMAX(y-2, ymin); y2<=FFMIN(y+2,ymax); y2++){
- for(x2=FFMAX(x-2, xmin); x2<=FFMIN(x+2,xmax); x2++){
- CHECK_MV(x2, y2);
- }
- }
-
-//FIXME prevent the CLIP stuff
-
- for(j=1; j<=dia_size/4; j++){
- for(i=0; i<16; i++){
- CHECK_CLIPPED_MV(x+hex[i][0]*j, y+hex[i][1]*j);
- }
- }
-
- return hex_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags, 2);
-}
-
-#define SAB_CHECK_MV(ax,ay)\
-{\
- const int key= ((ay)<<ME_MAP_MV_BITS) + (ax) + map_generation;\
- const int index= (((ay)<<ME_MAP_SHIFT) + (ax))&(ME_MAP_SIZE-1);\
-/*printf("sab check %d %d\n", ax, ay);*/\
- if(map[index]!=key){\
- d= cmp(s, ax, ay, 0, 0, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags);\
- map[index]= key;\
- score_map[index]= d;\
- d += (mv_penalty[((ax)<<shift)-pred_x] + mv_penalty[((ay)<<shift)-pred_y])*penalty_factor;\
-/*printf("score: %d\n", d);*/\
- if(d < minima[minima_count-1].height){\
- int j=0;\
- \
- while(d >= minima[j].height) j++;\
-\
- memmove(&minima [j+1], &minima [j], (minima_count - j - 1)*sizeof(Minima));\
-\
- minima[j].checked= 0;\
- minima[j].height= d;\
- minima[j].x= ax;\
- minima[j].y= ay;\
- \
- i=-1;\
- continue;\
- }\
- }\
-}
-
-#define MAX_SAB_SIZE ME_MAP_SIZE
-static int sab_diamond_search(MpegEncContext * s, int *best, int dmin,
- int src_index, int ref_index, int const penalty_factor,
- int size, int h, int flags)
-{
- MotionEstContext * const c= &s->me;
- me_cmp_func cmpf, chroma_cmpf;
- Minima minima[MAX_SAB_SIZE];
- const int minima_count= FFABS(c->dia_size);
- int i, j;
- LOAD_COMMON
- LOAD_COMMON2
- int map_generation= c->map_generation;
-
- cmpf= s->dsp.me_cmp[size];
- chroma_cmpf= s->dsp.me_cmp[size+1];
-
- /*Note j<MAX_SAB_SIZE is needed if MAX_SAB_SIZE < ME_MAP_SIZE as j can
- become larger due to MVs overflowing their ME_MAP_MV_BITS bits space in map
- */
- for(j=i=0; i<ME_MAP_SIZE && j<MAX_SAB_SIZE; i++){
- uint32_t key= map[i];
-
- key += (1<<(ME_MAP_MV_BITS-1)) + (1<<(2*ME_MAP_MV_BITS-1));
-
- if((key&((-1)<<(2*ME_MAP_MV_BITS))) != map_generation) continue;
-
- minima[j].height= score_map[i];
- minima[j].x= key & ((1<<ME_MAP_MV_BITS)-1); key>>=ME_MAP_MV_BITS;
- minima[j].y= key & ((1<<ME_MAP_MV_BITS)-1);
- minima[j].x-= (1<<(ME_MAP_MV_BITS-1));
- minima[j].y-= (1<<(ME_MAP_MV_BITS-1));
-
- // all entries in map should be in range except if the mv overflows their ME_MAP_MV_BITS bits space
- if( minima[j].x > xmax || minima[j].x < xmin
- || minima[j].y > ymax || minima[j].y < ymin)
- continue;
-
- minima[j].checked=0;
- if(minima[j].x || minima[j].y)
- minima[j].height+= (mv_penalty[((minima[j].x)<<shift)-pred_x] + mv_penalty[((minima[j].y)<<shift)-pred_y])*penalty_factor;
-
- j++;
- }
-
- qsort(minima, j, sizeof(Minima), minima_cmp);
-
- for(; j<minima_count; j++){
- minima[j].height=256*256*256*64;
- minima[j].checked=0;
- minima[j].x= minima[j].y=0;
- }
-
- for(i=0; i<minima_count; i++){
- const int x= minima[i].x;
- const int y= minima[i].y;
- int d;
-
- if(minima[i].checked) continue;
-
- if( x >= xmax || x <= xmin
- || y >= ymax || y <= ymin)
- continue;
-
- SAB_CHECK_MV(x-1, y)
- SAB_CHECK_MV(x+1, y)
- SAB_CHECK_MV(x , y-1)
- SAB_CHECK_MV(x , y+1)
-
- minima[i].checked= 1;
- }
-
- best[0]= minima[0].x;
- best[1]= minima[0].y;
- dmin= minima[0].height;
-
- if( best[0] < xmax && best[0] > xmin
- && best[1] < ymax && best[1] > ymin){
- int d;
- //ensure that the refernece samples for hpel refinement are in the map
- CHECK_MV(best[0]-1, best[1])
- CHECK_MV(best[0]+1, best[1])
- CHECK_MV(best[0], best[1]-1)
- CHECK_MV(best[0], best[1]+1)
- }
- return dmin;
-}
-
-static int var_diamond_search(MpegEncContext * s, int *best, int dmin,
- int src_index, int ref_index, int const penalty_factor,
- int size, int h, int flags)
-{
- MotionEstContext * const c= &s->me;
- me_cmp_func cmpf, chroma_cmpf;
- int dia_size;
- LOAD_COMMON
- LOAD_COMMON2
- int map_generation= c->map_generation;
-
- cmpf= s->dsp.me_cmp[size];
- chroma_cmpf= s->dsp.me_cmp[size+1];
-
- for(dia_size=1; dia_size<=c->dia_size; dia_size++){
- int dir, start, end;
- const int x= best[0];
- const int y= best[1];
-
- start= FFMAX(0, y + dia_size - ymax);
- end = FFMIN(dia_size, xmax - x + 1);
- for(dir= start; dir<end; dir++){
- int d;
-
-//check(x + dir,y + dia_size - dir,0, a0)
- CHECK_MV(x + dir , y + dia_size - dir);
- }
-
- start= FFMAX(0, x + dia_size - xmax);
- end = FFMIN(dia_size, y - ymin + 1);
- for(dir= start; dir<end; dir++){
- int d;
-
-//check(x + dia_size - dir, y - dir,0, a1)
- CHECK_MV(x + dia_size - dir, y - dir );
- }
-
- start= FFMAX(0, -y + dia_size + ymin );
- end = FFMIN(dia_size, x - xmin + 1);
- for(dir= start; dir<end; dir++){
- int d;
-
-//check(x - dir,y - dia_size + dir,0, a2)
- CHECK_MV(x - dir , y - dia_size + dir);
- }
-
- start= FFMAX(0, -x + dia_size + xmin );
- end = FFMIN(dia_size, ymax - y + 1);
- for(dir= start; dir<end; dir++){
- int d;
-
-//check(x - dia_size + dir, y + dir,0, a3)
- CHECK_MV(x - dia_size + dir, y + dir );
- }
-
- if(x!=best[0] || y!=best[1])
- dia_size=0;
-#if 0
-{
-int dx, dy, i;
-static int stats[8*8];
-dx= FFABS(x-best[0]);
-dy= FFABS(y-best[1]);
-stats[dy*8 + dx] ++;
-if(256*256*256*64 % (stats[0]+1)==0){
- for(i=0; i<64; i++){
- if((i&7)==0) printf("\n");
- printf("%6d ", stats[i]);
- }
- printf("\n");
-}
-}
-#endif
- }
- return dmin;
-}
-
-static av_always_inline int diamond_search(MpegEncContext * s, int *best, int dmin,
- int src_index, int ref_index, int const penalty_factor,
- int size, int h, int flags){
- MotionEstContext * const c= &s->me;
- if(c->dia_size==-1)
- return funny_diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
- else if(c->dia_size<-1)
- return sab_diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
- else if(c->dia_size<2)
- return small_diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
- else if(c->dia_size>768)
- return umh_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
- else if(c->dia_size>512)
- return hex_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags, c->dia_size&0xFF);
- else if(c->dia_size>256)
- return l2s_dia_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
- else
- return var_diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
-}
-
-static av_always_inline int epzs_motion_search_internal(MpegEncContext * s, int *mx_ptr, int *my_ptr,
- int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2],
- int ref_mv_scale, int flags, int size, int h)
-{
- MotionEstContext * const c= &s->me;
- int best[2]={0, 0};
- int d, dmin;
- int map_generation;
- int penalty_factor;
- const int ref_mv_stride= s->mb_stride; //pass as arg FIXME
- const int ref_mv_xy= s->mb_x + s->mb_y*ref_mv_stride; //add to last_mv beforepassing FIXME
- me_cmp_func cmpf, chroma_cmpf;
-
- LOAD_COMMON
- LOAD_COMMON2
-
- if(c->pre_pass){
- penalty_factor= c->pre_penalty_factor;
- cmpf= s->dsp.me_pre_cmp[size];
- chroma_cmpf= s->dsp.me_pre_cmp[size+1];
- }else{
- penalty_factor= c->penalty_factor;
- cmpf= s->dsp.me_cmp[size];
- chroma_cmpf= s->dsp.me_cmp[size+1];
- }
-
- map_generation= update_map_generation(c);
-
- assert(cmpf);
- dmin= cmp(s, 0, 0, 0, 0, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags);
- map[0]= map_generation;
- score_map[0]= dmin;
-
- //FIXME precalc first term below?
- if((s->pict_type == B_TYPE && !(c->flags & FLAG_DIRECT)) || s->flags&CODEC_FLAG_MV0)
- dmin += (mv_penalty[pred_x] + mv_penalty[pred_y])*penalty_factor;
-
- /* first line */
- if (s->first_slice_line) {
- CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
- CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
- (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
- }else{
- if(dmin<((h*h*s->avctx->mv0_threshold)>>8)
- && ( P_LEFT[0] |P_LEFT[1]
- |P_TOP[0] |P_TOP[1]
- |P_TOPRIGHT[0]|P_TOPRIGHT[1])==0){
- *mx_ptr= 0;
- *my_ptr= 0;
- c->skip=1;
- return dmin;
- }
- CHECK_MV( P_MEDIAN[0] >>shift , P_MEDIAN[1] >>shift)
- CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift) , (P_MEDIAN[1]>>shift)-1)
- CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift) , (P_MEDIAN[1]>>shift)+1)
- CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)-1, (P_MEDIAN[1]>>shift) )
- CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)+1, (P_MEDIAN[1]>>shift) )
- CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
- (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
- CHECK_MV(P_LEFT[0] >>shift, P_LEFT[1] >>shift)
- CHECK_MV(P_TOP[0] >>shift, P_TOP[1] >>shift)
- CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift)
- }
- if(dmin>h*h*4){
- if(c->pre_pass){
- CHECK_CLIPPED_MV((last_mv[ref_mv_xy-1][0]*ref_mv_scale + (1<<15))>>16,
- (last_mv[ref_mv_xy-1][1]*ref_mv_scale + (1<<15))>>16)
- if(!s->first_slice_line)
- CHECK_CLIPPED_MV((last_mv[ref_mv_xy-ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16,
- (last_mv[ref_mv_xy-ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16)
- }else{
- CHECK_CLIPPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16,
- (last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16)
- if(s->mb_y+1<s->end_mb_y) //FIXME replace at least with last_slice_line
- CHECK_CLIPPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16,
- (last_mv[ref_mv_xy+ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16)
- }
- }
-
- if(c->avctx->last_predictor_count){
- const int count= c->avctx->last_predictor_count;
- const int xstart= FFMAX(0, s->mb_x - count);
- const int ystart= FFMAX(0, s->mb_y - count);
- const int xend= FFMIN(s->mb_width , s->mb_x + count + 1);
- const int yend= FFMIN(s->mb_height, s->mb_y + count + 1);
- int mb_y;
-
- for(mb_y=ystart; mb_y<yend; mb_y++){
- int mb_x;
- for(mb_x=xstart; mb_x<xend; mb_x++){
- const int xy= mb_x + 1 + (mb_y + 1)*ref_mv_stride;
- int mx= (last_mv[xy][0]*ref_mv_scale + (1<<15))>>16;
- int my= (last_mv[xy][1]*ref_mv_scale + (1<<15))>>16;
-
- if(mx>xmax || mx<xmin || my>ymax || my<ymin) continue;
- CHECK_MV(mx,my)
- }
- }
- }
-
-//check(best[0],best[1],0, b0)
- dmin= diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
-
-//check(best[0],best[1],0, b1)
- *mx_ptr= best[0];
- *my_ptr= best[1];
-
-// printf("%d %d %d \n", best[0], best[1], dmin);
- return dmin;
-}
-
-//this function is dedicated to the braindamaged gcc
-inline int ff_epzs_motion_search(MpegEncContext * s, int *mx_ptr, int *my_ptr,
- int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2],
- int ref_mv_scale, int size, int h)
-{
- MotionEstContext * const c= &s->me;
-//FIXME convert other functions in the same way if faster
- if(c->flags==0 && h==16 && size==0){
- return epzs_motion_search_internal(s, mx_ptr, my_ptr, P, src_index, ref_index, last_mv, ref_mv_scale, 0, 0, 16);
-// case FLAG_QPEL:
-// return epzs_motion_search_internal(s, mx_ptr, my_ptr, P, src_index, ref_index, last_mv, ref_mv_scale, FLAG_QPEL);
- }else{
- return epzs_motion_search_internal(s, mx_ptr, my_ptr, P, src_index, ref_index, last_mv, ref_mv_scale, c->flags, size, h);
- }
-}
-
-static int epzs_motion_search4(MpegEncContext * s,
- int *mx_ptr, int *my_ptr, int P[10][2],
- int src_index, int ref_index, int16_t (*last_mv)[2],
- int ref_mv_scale)
-{
- MotionEstContext * const c= &s->me;
- int best[2]={0, 0};
- int d, dmin;
- int map_generation;
- const int penalty_factor= c->penalty_factor;
- const int size=1;
- const int h=8;
- const int ref_mv_stride= s->mb_stride;
- const int ref_mv_xy= s->mb_x + s->mb_y *ref_mv_stride;
- me_cmp_func cmpf, chroma_cmpf;
- LOAD_COMMON
- int flags= c->flags;
- LOAD_COMMON2
-
- cmpf= s->dsp.me_cmp[size];
- chroma_cmpf= s->dsp.me_cmp[size+1];
-
- map_generation= update_map_generation(c);
-
- dmin = 1000000;
-//printf("%d %d %d %d //",xmin, ymin, xmax, ymax);
- /* first line */
- if (s->first_slice_line) {
- CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
- CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
- (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
- CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift)
- }else{
- CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift)
- //FIXME try some early stop
- CHECK_MV(P_MEDIAN[0]>>shift, P_MEDIAN[1]>>shift)
- CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
- CHECK_MV(P_TOP[0]>>shift, P_TOP[1]>>shift)
- CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift)
- CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
- (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
- }
- if(dmin>64*4){
- CHECK_CLIPPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16,
- (last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16)
- if(s->mb_y+1<s->end_mb_y) //FIXME replace at least with last_slice_line
- CHECK_CLIPPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16,
- (last_mv[ref_mv_xy+ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16)
- }
-
- dmin= diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
-
- *mx_ptr= best[0];
- *my_ptr= best[1];
-
-// printf("%d %d %d \n", best[0], best[1], dmin);
- return dmin;
-}
-
-//try to merge with above FIXME (needs PSNR test)
-static int epzs_motion_search2(MpegEncContext * s,
- int *mx_ptr, int *my_ptr, int P[10][2],
- int src_index, int ref_index, int16_t (*last_mv)[2],
- int ref_mv_scale)
-{
- MotionEstContext * const c= &s->me;
- int best[2]={0, 0};
- int d, dmin;
- int map_generation;
- const int penalty_factor= c->penalty_factor;
- const int size=0; //FIXME pass as arg
- const int h=8;
- const int ref_mv_stride= s->mb_stride;
- const int ref_mv_xy= s->mb_x + s->mb_y *ref_mv_stride;
- me_cmp_func cmpf, chroma_cmpf;
- LOAD_COMMON
- int flags= c->flags;
- LOAD_COMMON2
-
- cmpf= s->dsp.me_cmp[size];
- chroma_cmpf= s->dsp.me_cmp[size+1];
-
- map_generation= update_map_generation(c);
-
- dmin = 1000000;
-//printf("%d %d %d %d //",xmin, ymin, xmax, ymax);
- /* first line */
- if (s->first_slice_line) {
- CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
- CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
- (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
- CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift)
- }else{
- CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift)
- //FIXME try some early stop
- CHECK_MV(P_MEDIAN[0]>>shift, P_MEDIAN[1]>>shift)
- CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
- CHECK_MV(P_TOP[0]>>shift, P_TOP[1]>>shift)
- CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift)
- CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
- (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
- }
- if(dmin>64*4){
- CHECK_CLIPPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16,
- (last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16)
- if(s->mb_y+1<s->end_mb_y) //FIXME replace at least with last_slice_line
- CHECK_CLIPPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16,
- (last_mv[ref_mv_xy+ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16)
- }
-
- dmin= diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
-
- *mx_ptr= best[0];
- *my_ptr= best[1];
-
-// printf("%d %d %d \n", best[0], best[1], dmin);
- return dmin;
-}
diff --git a/src/libffmpeg/libavcodec/mpeg12.c b/src/libffmpeg/libavcodec/mpeg12.c
deleted file mode 100644
index 63fb00feb..000000000
--- a/src/libffmpeg/libavcodec/mpeg12.c
+++ /dev/null
@@ -1,3504 +0,0 @@
-/*
- * MPEG1 codec / MPEG2 decoder
- * Copyright (c) 2000,2001 Fabrice Bellard.
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file mpeg12.c
- * MPEG1/2 codec
- */
-
-//#define DEBUG
-#include "avcodec.h"
-#include "dsputil.h"
-#include "mpegvideo.h"
-
-#include "mpeg12data.h"
-
-//#undef NDEBUG
-//#include <assert.h>
-
-
-/* if xine's MPEG encoder is enabled, enable the encoding features in
- * this particular module */
-#if defined(XINE_MPEG_ENCODER) && !defined(CONFIG_ENCODERS)
-#define CONFIG_ENCODERS
-#endif
-
-
-/* Start codes. */
-#define SEQ_END_CODE 0x000001b7
-#define SEQ_START_CODE 0x000001b3
-#define GOP_START_CODE 0x000001b8
-#define PICTURE_START_CODE 0x00000100
-#define SLICE_MIN_START_CODE 0x00000101
-#define SLICE_MAX_START_CODE 0x000001af
-#define EXT_START_CODE 0x000001b5
-#define USER_START_CODE 0x000001b2
-
-#define DC_VLC_BITS 9
-#define MV_VLC_BITS 9
-#define MBINCR_VLC_BITS 9
-#define MB_PAT_VLC_BITS 9
-#define MB_PTYPE_VLC_BITS 6
-#define MB_BTYPE_VLC_BITS 6
-#define TEX_VLC_BITS 9
-
-#ifdef CONFIG_ENCODERS
-static void mpeg1_encode_block(MpegEncContext *s,
- DCTELEM *block,
- int component);
-static void mpeg1_encode_motion(MpegEncContext *s, int val, int f_or_b_code); // RAL: f_code parameter added
-#endif //CONFIG_ENCODERS
-static inline int mpeg1_decode_block_inter(MpegEncContext *s,
- DCTELEM *block,
- int n);
-static inline int mpeg1_decode_block_intra(MpegEncContext *s,
- DCTELEM *block,
- int n);
-static inline int mpeg1_fast_decode_block_inter(MpegEncContext *s, DCTELEM *block, int n);
-static inline int mpeg2_decode_block_non_intra(MpegEncContext *s,
- DCTELEM *block,
- int n);
-static inline int mpeg2_decode_block_intra(MpegEncContext *s,
- DCTELEM *block,
- int n);
-static inline int mpeg2_fast_decode_block_non_intra(MpegEncContext *s, DCTELEM *block, int n);
-static inline int mpeg2_fast_decode_block_intra(MpegEncContext *s, DCTELEM *block, int n);
-static int mpeg_decode_motion(MpegEncContext *s, int fcode, int pred);
-static void exchange_uv(MpegEncContext *s);
-
-#ifdef HAVE_XVMC
-extern int XVMC_field_start(MpegEncContext *s, AVCodecContext *avctx);
-extern int XVMC_field_end(MpegEncContext *s);
-extern void XVMC_pack_pblocks(MpegEncContext *s,int cbp);
-extern void XVMC_init_block(MpegEncContext *s);//set s->block
-#endif
-
-static const enum PixelFormat pixfmt_yuv_420[]= {PIX_FMT_YUV420P,-1};
-static const enum PixelFormat pixfmt_yuv_422[]= {PIX_FMT_YUV422P,-1};
-static const enum PixelFormat pixfmt_yuv_444[]= {PIX_FMT_YUV444P,-1};
-static const enum PixelFormat pixfmt_xvmc_mpg2_420[] = {
- PIX_FMT_XVMC_MPEG2_IDCT,
- PIX_FMT_XVMC_MPEG2_MC,
- -1};
-#ifdef CONFIG_ENCODERS
-static uint8_t (*mv_penalty)[MAX_MV*2+1]= NULL;
-static uint8_t fcode_tab[MAX_MV*2+1];
-
-static uint8_t uni_mpeg1_ac_vlc_len [64*64*2];
-static uint8_t uni_mpeg2_ac_vlc_len [64*64*2];
-
-/* simple include everything table for dc, first byte is bits number next 3 are code*/
-static uint32_t mpeg1_lum_dc_uni[512];
-static uint32_t mpeg1_chr_dc_uni[512];
-
-static uint8_t mpeg1_index_run[2][64];
-static int8_t mpeg1_max_level[2][64];
-#endif //CONFIG_ENCODERS
-
-static void init_2d_vlc_rl(RLTable *rl, int use_static)
-{
- int i;
-
- init_vlc(&rl->vlc, TEX_VLC_BITS, rl->n + 2,
- &rl->table_vlc[0][1], 4, 2,
- &rl->table_vlc[0][0], 4, 2, use_static);
-
- if(use_static)
- rl->rl_vlc[0]= av_mallocz_static(rl->vlc.table_size*sizeof(RL_VLC_ELEM));
- else
- rl->rl_vlc[0]= av_malloc(rl->vlc.table_size*sizeof(RL_VLC_ELEM));
-
- for(i=0; i<rl->vlc.table_size; i++){
- int code= rl->vlc.table[i][0];
- int len = rl->vlc.table[i][1];
- int level, run;
-
- if(len==0){ // illegal code
- run= 65;
- level= MAX_LEVEL;
- }else if(len<0){ //more bits needed
- run= 0;
- level= code;
- }else{
- if(code==rl->n){ //esc
- run= 65;
- level= 0;
- }else if(code==rl->n+1){ //eob
- run= 0;
- level= 127;
- }else{
- run= rl->table_run [code] + 1;
- level= rl->table_level[code];
- }
- }
- rl->rl_vlc[0][i].len= len;
- rl->rl_vlc[0][i].level= level;
- rl->rl_vlc[0][i].run= run;
- }
-}
-
-#ifdef CONFIG_ENCODERS
-static void init_uni_ac_vlc(RLTable *rl, uint8_t *uni_ac_vlc_len){
- int i;
-
- for(i=0; i<128; i++){
- int level= i-64;
- int run;
- for(run=0; run<64; run++){
- int len, bits, code;
-
- int alevel= FFABS(level);
- int sign= (level>>31)&1;
-
- if (alevel > rl->max_level[0][run])
- code= 111; /*rl->n*/
- else
- code= rl->index_run[0][run] + alevel - 1;
-
- if (code < 111 /* rl->n */) {
- /* store the vlc & sign at once */
- len= rl->table_vlc[code][1]+1;
- bits= (rl->table_vlc[code][0]<<1) + sign;
- } else {
- len= rl->table_vlc[111/*rl->n*/][1]+6;
- bits= rl->table_vlc[111/*rl->n*/][0]<<6;
-
- bits|= run;
- if (alevel < 128) {
- bits<<=8; len+=8;
- bits|= level & 0xff;
- } else {
- bits<<=16; len+=16;
- bits|= level & 0xff;
- if (level < 0) {
- bits|= 0x8001 + level + 255;
- } else {
- bits|= level & 0xffff;
- }
- }
- }
-
- uni_ac_vlc_len [UNI_AC_ENC_INDEX(run, i)]= len;
- }
- }
-}
-
-
-static int find_frame_rate_index(MpegEncContext *s){
- int i;
- int64_t dmin= INT64_MAX;
- int64_t d;
-
- for(i=1;i<14;i++) {
- int64_t n0= 1001LL/ff_frame_rate_tab[i].den*ff_frame_rate_tab[i].num*s->avctx->time_base.num;
- int64_t n1= 1001LL*s->avctx->time_base.den;
- if(s->avctx->strict_std_compliance > FF_COMPLIANCE_INOFFICIAL && i>=9) break;
-
- d = FFABS(n0 - n1);
- if(d < dmin){
- dmin=d;
- s->frame_rate_index= i;
- }
- }
- if(dmin)
- return -1;
- else
- return 0;
-}
-
-static int encode_init(AVCodecContext *avctx)
-{
- MpegEncContext *s = avctx->priv_data;
-
- if(MPV_encode_init(avctx) < 0)
- return -1;
-
- if(find_frame_rate_index(s) < 0){
- if(s->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL){
- av_log(avctx, AV_LOG_ERROR, "MPEG1/2 does not support %d/%d fps\n", avctx->time_base.den, avctx->time_base.num);
- return -1;
- }else{
- av_log(avctx, AV_LOG_INFO, "MPEG1/2 does not support %d/%d fps, there may be AV sync issues\n", avctx->time_base.den, avctx->time_base.num);
- }
- }
-
- if(avctx->profile == FF_PROFILE_UNKNOWN)
- avctx->profile = s->chroma_format == CHROMA_420 ? 4 : 0;
-
- if(avctx->level == FF_LEVEL_UNKNOWN)
- avctx->level = s->chroma_format == CHROMA_420 ? 8 : 5;
-
- if((avctx->flags2 & CODEC_FLAG2_DROP_FRAME_TIMECODE) && s->frame_rate_index != 4){
- av_log(avctx, AV_LOG_ERROR, "Drop frame time code only allowed with 1001/30000 fps\n");
- return -1;
- }
-
- return 0;
-}
-
-static void put_header(MpegEncContext *s, int header)
-{
- align_put_bits(&s->pb);
- put_bits(&s->pb, 16, header>>16);
- put_bits(&s->pb, 16, header&0xFFFF);
-}
-
-/* put sequence header if needed */
-static void mpeg1_encode_sequence_header(MpegEncContext *s)
-{
- unsigned int vbv_buffer_size;
- unsigned int fps, v;
- int i;
- uint64_t time_code;
- float best_aspect_error= 1E10;
- float aspect_ratio= av_q2d(s->avctx->sample_aspect_ratio);
- int constraint_parameter_flag;
-
- if(aspect_ratio==0.0) aspect_ratio= 1.0; //pixel aspect 1:1 (VGA)
-
- if (s->current_picture.key_frame) {
- AVRational framerate= ff_frame_rate_tab[s->frame_rate_index];
-
- /* mpeg1 header repeated every gop */
- put_header(s, SEQ_START_CODE);
-
- put_bits(&s->pb, 12, s->width);
- put_bits(&s->pb, 12, s->height);
-
- for(i=1; i<15; i++){
- float error= aspect_ratio;
- if(s->codec_id == CODEC_ID_MPEG1VIDEO || i <=1)
- error-= 1.0/mpeg1_aspect[i];
- else
- error-= av_q2d(mpeg2_aspect[i])*s->height/s->width;
-
- error= FFABS(error);
-
- if(error < best_aspect_error){
- best_aspect_error= error;
- s->aspect_ratio_info= i;
- }
- }
-
- put_bits(&s->pb, 4, s->aspect_ratio_info);
- put_bits(&s->pb, 4, s->frame_rate_index);
-
- if(s->avctx->rc_max_rate){
- v = (s->avctx->rc_max_rate + 399) / 400;
- if (v > 0x3ffff && s->codec_id == CODEC_ID_MPEG1VIDEO)
- v = 0x3ffff;
- }else{
- v= 0x3FFFF;
- }
-
- if(s->avctx->rc_buffer_size)
- vbv_buffer_size = s->avctx->rc_buffer_size;
- else
- /* VBV calculation: Scaled so that a VCD has the proper VBV size of 40 kilobytes */
- vbv_buffer_size = (( 20 * s->bit_rate) / (1151929 / 2)) * 8 * 1024;
- vbv_buffer_size= (vbv_buffer_size + 16383) / 16384;
-
- put_bits(&s->pb, 18, v & 0x3FFFF);
- put_bits(&s->pb, 1, 1); /* marker */
- put_bits(&s->pb, 10, vbv_buffer_size & 0x3FF);
-
- constraint_parameter_flag=
- s->width <= 768 && s->height <= 576 &&
- s->mb_width * s->mb_height <= 396 &&
- s->mb_width * s->mb_height * framerate.num <= framerate.den*396*25 &&
- framerate.num <= framerate.den*30 &&
- s->avctx->me_range && s->avctx->me_range < 128 &&
- vbv_buffer_size <= 20 &&
- v <= 1856000/400 &&
- s->codec_id == CODEC_ID_MPEG1VIDEO;
-
- put_bits(&s->pb, 1, constraint_parameter_flag);
-
- ff_write_quant_matrix(&s->pb, s->avctx->intra_matrix);
- ff_write_quant_matrix(&s->pb, s->avctx->inter_matrix);
-
- if(s->codec_id == CODEC_ID_MPEG2VIDEO){
- put_header(s, EXT_START_CODE);
- put_bits(&s->pb, 4, 1); //seq ext
-
- put_bits(&s->pb, 1, s->chroma_format == CHROMA_422); //escx
-
- put_bits(&s->pb, 3, s->avctx->profile); //profile
- put_bits(&s->pb, 4, s->avctx->level); //level
-
- put_bits(&s->pb, 1, s->progressive_sequence);
- put_bits(&s->pb, 2, s->chroma_format);
- put_bits(&s->pb, 2, 0); //horizontal size ext
- put_bits(&s->pb, 2, 0); //vertical size ext
- put_bits(&s->pb, 12, v>>18); //bitrate ext
- put_bits(&s->pb, 1, 1); //marker
- put_bits(&s->pb, 8, vbv_buffer_size >>10); //vbv buffer ext
- put_bits(&s->pb, 1, s->low_delay);
- put_bits(&s->pb, 2, 0); // frame_rate_ext_n
- put_bits(&s->pb, 5, 0); // frame_rate_ext_d
- }
-
- put_header(s, GOP_START_CODE);
- put_bits(&s->pb, 1, !!(s->avctx->flags & CODEC_FLAG2_DROP_FRAME_TIMECODE)); /* drop frame flag */
- /* time code : we must convert from the real frame rate to a
- fake mpeg frame rate in case of low frame rate */
- fps = (framerate.num + framerate.den/2)/ framerate.den;
- time_code = s->current_picture_ptr->coded_picture_number + s->avctx->timecode_frame_start;
-
- s->gop_picture_number = s->current_picture_ptr->coded_picture_number;
- if (s->avctx->flags2 & CODEC_FLAG2_DROP_FRAME_TIMECODE) {
- /* only works for NTSC 29.97 */
- int d = time_code / 17982;
- int m = time_code % 17982;
- //if (m < 2) m += 2; /* not needed since -2,-1 / 1798 in C returns 0 */
- time_code += 18 * d + 2 * ((m - 2) / 1798);
- }
- put_bits(&s->pb, 5, (uint32_t)((time_code / (fps * 3600)) % 24));
- put_bits(&s->pb, 6, (uint32_t)((time_code / (fps * 60)) % 60));
- put_bits(&s->pb, 1, 1);
- put_bits(&s->pb, 6, (uint32_t)((time_code / fps) % 60));
- put_bits(&s->pb, 6, (uint32_t)((time_code % fps)));
- put_bits(&s->pb, 1, !!(s->flags & CODEC_FLAG_CLOSED_GOP));
- put_bits(&s->pb, 1, 0); /* broken link */
- }
-}
-
-static inline void encode_mb_skip_run(MpegEncContext *s, int run){
- while (run >= 33) {
- put_bits(&s->pb, 11, 0x008);
- run -= 33;
- }
- put_bits(&s->pb, mbAddrIncrTable[run][1],
- mbAddrIncrTable[run][0]);
-}
-#endif //CONFIG_ENCODERS
-
-static void common_init(MpegEncContext *s)
-{
-
- s->y_dc_scale_table=
- s->c_dc_scale_table= mpeg2_dc_scale_table[s->intra_dc_precision];
-
-}
-
-void ff_mpeg1_clean_buffers(MpegEncContext *s){
- s->last_dc[0] = 1 << (7 + s->intra_dc_precision);
- s->last_dc[1] = s->last_dc[0];
- s->last_dc[2] = s->last_dc[0];
- memset(s->last_mv, 0, sizeof(s->last_mv));
-}
-
-#ifdef CONFIG_ENCODERS
-
-void ff_mpeg1_encode_slice_header(MpegEncContext *s){
- put_header(s, SLICE_MIN_START_CODE + s->mb_y);
- put_bits(&s->pb, 5, s->qscale); /* quantizer scale */
- put_bits(&s->pb, 1, 0); /* slice extra information */
-}
-
-void mpeg1_encode_picture_header(MpegEncContext *s, int picture_number)
-{
- mpeg1_encode_sequence_header(s);
-
- /* mpeg1 picture header */
- put_header(s, PICTURE_START_CODE);
- /* temporal reference */
-
- // RAL: s->picture_number instead of s->fake_picture_number
- put_bits(&s->pb, 10, (s->picture_number -
- s->gop_picture_number) & 0x3ff);
- put_bits(&s->pb, 3, s->pict_type);
-
- s->vbv_delay_ptr= s->pb.buf + put_bits_count(&s->pb)/8;
- put_bits(&s->pb, 16, 0xFFFF); /* vbv_delay */
-
- // RAL: Forward f_code also needed for B frames
- if (s->pict_type == P_TYPE || s->pict_type == B_TYPE) {
- put_bits(&s->pb, 1, 0); /* half pel coordinates */
- if(s->codec_id == CODEC_ID_MPEG1VIDEO)
- put_bits(&s->pb, 3, s->f_code); /* forward_f_code */
- else
- put_bits(&s->pb, 3, 7); /* forward_f_code */
- }
-
- // RAL: Backward f_code necessary for B frames
- if (s->pict_type == B_TYPE) {
- put_bits(&s->pb, 1, 0); /* half pel coordinates */
- if(s->codec_id == CODEC_ID_MPEG1VIDEO)
- put_bits(&s->pb, 3, s->b_code); /* backward_f_code */
- else
- put_bits(&s->pb, 3, 7); /* backward_f_code */
- }
-
- put_bits(&s->pb, 1, 0); /* extra bit picture */
-
- s->frame_pred_frame_dct = 1;
- if(s->codec_id == CODEC_ID_MPEG2VIDEO){
- put_header(s, EXT_START_CODE);
- put_bits(&s->pb, 4, 8); //pic ext
- if (s->pict_type == P_TYPE || s->pict_type == B_TYPE) {
- put_bits(&s->pb, 4, s->f_code);
- put_bits(&s->pb, 4, s->f_code);
- }else{
- put_bits(&s->pb, 8, 255);
- }
- if (s->pict_type == B_TYPE) {
- put_bits(&s->pb, 4, s->b_code);
- put_bits(&s->pb, 4, s->b_code);
- }else{
- put_bits(&s->pb, 8, 255);
- }
- put_bits(&s->pb, 2, s->intra_dc_precision);
-
- assert(s->picture_structure == PICT_FRAME);
- put_bits(&s->pb, 2, s->picture_structure);
- if (s->progressive_sequence) {
- put_bits(&s->pb, 1, 0); /* no repeat */
- } else {
- put_bits(&s->pb, 1, s->current_picture_ptr->top_field_first);
- }
- /* XXX: optimize the generation of this flag with entropy
- measures */
- s->frame_pred_frame_dct = s->progressive_sequence;
-
- put_bits(&s->pb, 1, s->frame_pred_frame_dct);
- put_bits(&s->pb, 1, s->concealment_motion_vectors);
- put_bits(&s->pb, 1, s->q_scale_type);
- put_bits(&s->pb, 1, s->intra_vlc_format);
- put_bits(&s->pb, 1, s->alternate_scan);
- put_bits(&s->pb, 1, s->repeat_first_field);
- s->progressive_frame = s->progressive_sequence;
- put_bits(&s->pb, 1, s->chroma_format == CHROMA_420 ? s->progressive_frame : 0); /* chroma_420_type */
- put_bits(&s->pb, 1, s->progressive_frame);
- put_bits(&s->pb, 1, 0); //composite_display_flag
- }
- if(s->flags & CODEC_FLAG_SVCD_SCAN_OFFSET){
- int i;
-
- put_header(s, USER_START_CODE);
- for(i=0; i<sizeof(svcd_scan_offset_placeholder); i++){
- put_bits(&s->pb, 8, svcd_scan_offset_placeholder[i]);
- }
- }
-
- s->mb_y=0;
- ff_mpeg1_encode_slice_header(s);
-}
-
-static inline void put_mb_modes(MpegEncContext *s, int n, int bits,
- int has_mv, int field_motion)
-{
- put_bits(&s->pb, n, bits);
- if (!s->frame_pred_frame_dct) {
- if (has_mv)
- put_bits(&s->pb, 2, 2 - field_motion); /* motion_type: frame/field */
- put_bits(&s->pb, 1, s->interlaced_dct);
- }
-}
-
-static av_always_inline void mpeg1_encode_mb_internal(MpegEncContext *s,
- DCTELEM block[6][64],
- int motion_x, int motion_y,
- int mb_block_count)
-{
- int i, cbp;
- const int mb_x = s->mb_x;
- const int mb_y = s->mb_y;
- const int first_mb= mb_x == s->resync_mb_x && mb_y == s->resync_mb_y;
-
- /* compute cbp */
- cbp = 0;
- for(i=0;i<mb_block_count;i++) {
- if (s->block_last_index[i] >= 0)
- cbp |= 1 << (mb_block_count - 1 - i);
- }
-
- if (cbp == 0 && !first_mb && s->mv_type == MV_TYPE_16X16 &&
- (mb_x != s->mb_width - 1 || (mb_y != s->mb_height - 1 && s->codec_id == CODEC_ID_MPEG1VIDEO)) &&
- ((s->pict_type == P_TYPE && (motion_x | motion_y) == 0) ||
- (s->pict_type == B_TYPE && s->mv_dir == s->last_mv_dir && (((s->mv_dir & MV_DIR_FORWARD) ? ((s->mv[0][0][0] - s->last_mv[0][0][0])|(s->mv[0][0][1] - s->last_mv[0][0][1])) : 0) |
- ((s->mv_dir & MV_DIR_BACKWARD) ? ((s->mv[1][0][0] - s->last_mv[1][0][0])|(s->mv[1][0][1] - s->last_mv[1][0][1])) : 0)) == 0))) {
- s->mb_skip_run++;
- s->qscale -= s->dquant;
- s->skip_count++;
- s->misc_bits++;
- s->last_bits++;
- if(s->pict_type == P_TYPE){
- s->last_mv[0][1][0]= s->last_mv[0][0][0]=
- s->last_mv[0][1][1]= s->last_mv[0][0][1]= 0;
- }
- } else {
- if(first_mb){
- assert(s->mb_skip_run == 0);
- encode_mb_skip_run(s, s->mb_x);
- }else{
- encode_mb_skip_run(s, s->mb_skip_run);
- }
-
- if (s->pict_type == I_TYPE) {
- if(s->dquant && cbp){
- put_mb_modes(s, 2, 1, 0, 0); /* macroblock_type : macroblock_quant = 1 */
- put_bits(&s->pb, 5, s->qscale);
- }else{
- put_mb_modes(s, 1, 1, 0, 0); /* macroblock_type : macroblock_quant = 0 */
- s->qscale -= s->dquant;
- }
- s->misc_bits+= get_bits_diff(s);
- s->i_count++;
- } else if (s->mb_intra) {
- if(s->dquant && cbp){
- put_mb_modes(s, 6, 0x01, 0, 0);
- put_bits(&s->pb, 5, s->qscale);
- }else{
- put_mb_modes(s, 5, 0x03, 0, 0);
- s->qscale -= s->dquant;
- }
- s->misc_bits+= get_bits_diff(s);
- s->i_count++;
- memset(s->last_mv, 0, sizeof(s->last_mv));
- } else if (s->pict_type == P_TYPE) {
- if(s->mv_type == MV_TYPE_16X16){
- if (cbp != 0) {
- if ((motion_x|motion_y) == 0) {
- if(s->dquant){
- put_mb_modes(s, 5, 1, 0, 0); /* macroblock_pattern & quant */
- put_bits(&s->pb, 5, s->qscale);
- }else{
- put_mb_modes(s, 2, 1, 0, 0); /* macroblock_pattern only */
- }
- s->misc_bits+= get_bits_diff(s);
- } else {
- if(s->dquant){
- put_mb_modes(s, 5, 2, 1, 0); /* motion + cbp */
- put_bits(&s->pb, 5, s->qscale);
- }else{
- put_mb_modes(s, 1, 1, 1, 0); /* motion + cbp */
- }
- s->misc_bits+= get_bits_diff(s);
- mpeg1_encode_motion(s, motion_x - s->last_mv[0][0][0], s->f_code); // RAL: f_code parameter added
- mpeg1_encode_motion(s, motion_y - s->last_mv[0][0][1], s->f_code); // RAL: f_code parameter added
- s->mv_bits+= get_bits_diff(s);
- }
- } else {
- put_bits(&s->pb, 3, 1); /* motion only */
- if (!s->frame_pred_frame_dct)
- put_bits(&s->pb, 2, 2); /* motion_type: frame */
- s->misc_bits+= get_bits_diff(s);
- mpeg1_encode_motion(s, motion_x - s->last_mv[0][0][0], s->f_code); // RAL: f_code parameter added
- mpeg1_encode_motion(s, motion_y - s->last_mv[0][0][1], s->f_code); // RAL: f_code parameter added
- s->qscale -= s->dquant;
- s->mv_bits+= get_bits_diff(s);
- }
- s->last_mv[0][1][0]= s->last_mv[0][0][0]= motion_x;
- s->last_mv[0][1][1]= s->last_mv[0][0][1]= motion_y;
- }else{
- assert(!s->frame_pred_frame_dct && s->mv_type == MV_TYPE_FIELD);
-
- if (cbp) {
- if(s->dquant){
- put_mb_modes(s, 5, 2, 1, 1); /* motion + cbp */
- put_bits(&s->pb, 5, s->qscale);
- }else{
- put_mb_modes(s, 1, 1, 1, 1); /* motion + cbp */
- }
- } else {
- put_bits(&s->pb, 3, 1); /* motion only */
- put_bits(&s->pb, 2, 1); /* motion_type: field */
- s->qscale -= s->dquant;
- }
- s->misc_bits+= get_bits_diff(s);
- for(i=0; i<2; i++){
- put_bits(&s->pb, 1, s->field_select[0][i]);
- mpeg1_encode_motion(s, s->mv[0][i][0] - s->last_mv[0][i][0] , s->f_code);
- mpeg1_encode_motion(s, s->mv[0][i][1] - (s->last_mv[0][i][1]>>1), s->f_code);
- s->last_mv[0][i][0]= s->mv[0][i][0];
- s->last_mv[0][i][1]= 2*s->mv[0][i][1];
- }
- s->mv_bits+= get_bits_diff(s);
- }
- if(cbp) {
- if (s->chroma_y_shift) {
- put_bits(&s->pb, mbPatTable[cbp][1], mbPatTable[cbp][0]);
- } else {
- put_bits(&s->pb, mbPatTable[cbp>>2][1], mbPatTable[cbp>>2][0]);
- put_bits(&s->pb, 2, cbp & 3);
- }
- }
- s->f_count++;
- } else{
- static const int mb_type_len[4]={0,3,4,2}; //bak,for,bi
-
- if(s->mv_type == MV_TYPE_16X16){
- if (cbp){ // With coded bloc pattern
- if (s->dquant) {
- if(s->mv_dir == MV_DIR_FORWARD)
- put_mb_modes(s, 6, 3, 1, 0);
- else
- put_mb_modes(s, mb_type_len[s->mv_dir]+3, 2, 1, 0);
- put_bits(&s->pb, 5, s->qscale);
- } else {
- put_mb_modes(s, mb_type_len[s->mv_dir], 3, 1, 0);
- }
- }else{ // No coded bloc pattern
- put_bits(&s->pb, mb_type_len[s->mv_dir], 2);
- if (!s->frame_pred_frame_dct)
- put_bits(&s->pb, 2, 2); /* motion_type: frame */
- s->qscale -= s->dquant;
- }
- s->misc_bits += get_bits_diff(s);
- if (s->mv_dir&MV_DIR_FORWARD){
- mpeg1_encode_motion(s, s->mv[0][0][0] - s->last_mv[0][0][0], s->f_code);
- mpeg1_encode_motion(s, s->mv[0][0][1] - s->last_mv[0][0][1], s->f_code);
- s->last_mv[0][0][0]=s->last_mv[0][1][0]= s->mv[0][0][0];
- s->last_mv[0][0][1]=s->last_mv[0][1][1]= s->mv[0][0][1];
- s->f_count++;
- }
- if (s->mv_dir&MV_DIR_BACKWARD){
- mpeg1_encode_motion(s, s->mv[1][0][0] - s->last_mv[1][0][0], s->b_code);
- mpeg1_encode_motion(s, s->mv[1][0][1] - s->last_mv[1][0][1], s->b_code);
- s->last_mv[1][0][0]=s->last_mv[1][1][0]= s->mv[1][0][0];
- s->last_mv[1][0][1]=s->last_mv[1][1][1]= s->mv[1][0][1];
- s->b_count++;
- }
- }else{
- assert(s->mv_type == MV_TYPE_FIELD);
- assert(!s->frame_pred_frame_dct);
- if (cbp){ // With coded bloc pattern
- if (s->dquant) {
- if(s->mv_dir == MV_DIR_FORWARD)
- put_mb_modes(s, 6, 3, 1, 1);
- else
- put_mb_modes(s, mb_type_len[s->mv_dir]+3, 2, 1, 1);
- put_bits(&s->pb, 5, s->qscale);
- } else {
- put_mb_modes(s, mb_type_len[s->mv_dir], 3, 1, 1);
- }
- }else{ // No coded bloc pattern
- put_bits(&s->pb, mb_type_len[s->mv_dir], 2);
- put_bits(&s->pb, 2, 1); /* motion_type: field */
- s->qscale -= s->dquant;
- }
- s->misc_bits += get_bits_diff(s);
- if (s->mv_dir&MV_DIR_FORWARD){
- for(i=0; i<2; i++){
- put_bits(&s->pb, 1, s->field_select[0][i]);
- mpeg1_encode_motion(s, s->mv[0][i][0] - s->last_mv[0][i][0] , s->f_code);
- mpeg1_encode_motion(s, s->mv[0][i][1] - (s->last_mv[0][i][1]>>1), s->f_code);
- s->last_mv[0][i][0]= s->mv[0][i][0];
- s->last_mv[0][i][1]= 2*s->mv[0][i][1];
- }
- s->f_count++;
- }
- if (s->mv_dir&MV_DIR_BACKWARD){
- for(i=0; i<2; i++){
- put_bits(&s->pb, 1, s->field_select[1][i]);
- mpeg1_encode_motion(s, s->mv[1][i][0] - s->last_mv[1][i][0] , s->b_code);
- mpeg1_encode_motion(s, s->mv[1][i][1] - (s->last_mv[1][i][1]>>1), s->b_code);
- s->last_mv[1][i][0]= s->mv[1][i][0];
- s->last_mv[1][i][1]= 2*s->mv[1][i][1];
- }
- s->b_count++;
- }
- }
- s->mv_bits += get_bits_diff(s);
- if(cbp) {
- if (s->chroma_y_shift) {
- put_bits(&s->pb, mbPatTable[cbp][1], mbPatTable[cbp][0]);
- } else {
- put_bits(&s->pb, mbPatTable[cbp>>2][1], mbPatTable[cbp>>2][0]);
- put_bits(&s->pb, 2, cbp & 3);
- }
- }
- }
- for(i=0;i<mb_block_count;i++) {
- if (cbp & (1 << (mb_block_count - 1 - i))) {
- mpeg1_encode_block(s, block[i], i);
- }
- }
- s->mb_skip_run = 0;
- if(s->mb_intra)
- s->i_tex_bits+= get_bits_diff(s);
- else
- s->p_tex_bits+= get_bits_diff(s);
- }
-}
-
-void mpeg1_encode_mb(MpegEncContext *s, DCTELEM block[6][64], int motion_x, int motion_y)
-{
- if (s->chroma_format == CHROMA_420) mpeg1_encode_mb_internal(s, block, motion_x, motion_y, 6);
- else mpeg1_encode_mb_internal(s, block, motion_x, motion_y, 8);
-}
-
-// RAL: Parameter added: f_or_b_code
-static void mpeg1_encode_motion(MpegEncContext *s, int val, int f_or_b_code)
-{
- int code, bit_size, l, bits, range, sign;
-
- if (val == 0) {
- /* zero vector */
- code = 0;
- put_bits(&s->pb,
- mbMotionVectorTable[0][1],
- mbMotionVectorTable[0][0]);
- } else {
- bit_size = f_or_b_code - 1;
- range = 1 << bit_size;
- /* modulo encoding */
- l= INT_BIT - 5 - bit_size;
- val= (val<<l)>>l;
-
- if (val >= 0) {
- val--;
- code = (val >> bit_size) + 1;
- bits = val & (range - 1);
- sign = 0;
- } else {
- val = -val;
- val--;
- code = (val >> bit_size) + 1;
- bits = val & (range - 1);
- sign = 1;
- }
-
- assert(code > 0 && code <= 16);
-
- put_bits(&s->pb,
- mbMotionVectorTable[code][1],
- mbMotionVectorTable[code][0]);
-
- put_bits(&s->pb, 1, sign);
- if (bit_size > 0) {
- put_bits(&s->pb, bit_size, bits);
- }
- }
-}
-
-void ff_mpeg1_encode_init(MpegEncContext *s)
-{
- static int done=0;
-
- common_init(s);
-
- if(!done){
- int f_code;
- int mv;
- int i;
-
- done=1;
- init_rl(&rl_mpeg1, 1);
- if(s->intra_vlc_format)
- init_rl(&rl_mpeg2, 1);
-
- for(i=0; i<64; i++)
- {
- mpeg1_max_level[0][i]= rl_mpeg1.max_level[0][i];
- mpeg1_index_run[0][i]= rl_mpeg1.index_run[0][i];
- }
-
- init_uni_ac_vlc(&rl_mpeg1, uni_mpeg1_ac_vlc_len);
- if(s->intra_vlc_format)
- init_uni_ac_vlc(&rl_mpeg2, uni_mpeg2_ac_vlc_len);
-
- /* build unified dc encoding tables */
- for(i=-255; i<256; i++)
- {
- int adiff, index;
- int bits, code;
- int diff=i;
-
- adiff = FFABS(diff);
- if(diff<0) diff--;
- index = av_log2(2*adiff);
-
- bits= vlc_dc_lum_bits[index] + index;
- code= (vlc_dc_lum_code[index]<<index) + (diff & ((1 << index) - 1));
- mpeg1_lum_dc_uni[i+255]= bits + (code<<8);
-
- bits= vlc_dc_chroma_bits[index] + index;
- code= (vlc_dc_chroma_code[index]<<index) + (diff & ((1 << index) - 1));
- mpeg1_chr_dc_uni[i+255]= bits + (code<<8);
- }
-
- mv_penalty= av_mallocz( sizeof(uint8_t)*(MAX_FCODE+1)*(2*MAX_MV+1) );
-
- for(f_code=1; f_code<=MAX_FCODE; f_code++){
- for(mv=-MAX_MV; mv<=MAX_MV; mv++){
- int len;
-
- if(mv==0) len= mbMotionVectorTable[0][1];
- else{
- int val, bit_size, range, code;
-
- bit_size = f_code - 1;
- range = 1 << bit_size;
-
- val=mv;
- if (val < 0)
- val = -val;
- val--;
- code = (val >> bit_size) + 1;
- if(code<17){
- len= mbMotionVectorTable[code][1] + 1 + bit_size;
- }else{
- len= mbMotionVectorTable[16][1] + 2 + bit_size;
- }
- }
-
- mv_penalty[f_code][mv+MAX_MV]= len;
- }
- }
-
-
- for(f_code=MAX_FCODE; f_code>0; f_code--){
- for(mv=-(8<<f_code); mv<(8<<f_code); mv++){
- fcode_tab[mv+MAX_MV]= f_code;
- }
- }
- }
- s->me.mv_penalty= mv_penalty;
- s->fcode_tab= fcode_tab;
- if(s->codec_id == CODEC_ID_MPEG1VIDEO){
- s->min_qcoeff=-255;
- s->max_qcoeff= 255;
- }else{
- s->min_qcoeff=-2047;
- s->max_qcoeff= 2047;
- }
- if (s->intra_vlc_format) {
- s->intra_ac_vlc_length=
- s->intra_ac_vlc_last_length= uni_mpeg2_ac_vlc_len;
- } else {
- s->intra_ac_vlc_length=
- s->intra_ac_vlc_last_length= uni_mpeg1_ac_vlc_len;
- }
- s->inter_ac_vlc_length=
- s->inter_ac_vlc_last_length= uni_mpeg1_ac_vlc_len;
-}
-
-static inline void encode_dc(MpegEncContext *s, int diff, int component)
-{
- if(((unsigned) (diff+255)) >= 511){
- int index;
-
- if(diff<0){
- index= av_log2_16bit(-2*diff);
- diff--;
- }else{
- index= av_log2_16bit(2*diff);
- }
- if (component == 0) {
- put_bits(
- &s->pb,
- vlc_dc_lum_bits[index] + index,
- (vlc_dc_lum_code[index]<<index) + (diff & ((1 << index) - 1)));
- }else{
- put_bits(
- &s->pb,
- vlc_dc_chroma_bits[index] + index,
- (vlc_dc_chroma_code[index]<<index) + (diff & ((1 << index) - 1)));
- }
- }else{
- if (component == 0) {
- put_bits(
- &s->pb,
- mpeg1_lum_dc_uni[diff+255]&0xFF,
- mpeg1_lum_dc_uni[diff+255]>>8);
- } else {
- put_bits(
- &s->pb,
- mpeg1_chr_dc_uni[diff+255]&0xFF,
- mpeg1_chr_dc_uni[diff+255]>>8);
- }
- }
-}
-
-static void mpeg1_encode_block(MpegEncContext *s,
- DCTELEM *block,
- int n)
-{
- int alevel, level, last_non_zero, dc, diff, i, j, run, last_index, sign;
- int code, component;
- const uint16_t (*table_vlc)[2] = rl_mpeg1.table_vlc;
-
- last_index = s->block_last_index[n];
-
- /* DC coef */
- if (s->mb_intra) {
- component = (n <= 3 ? 0 : (n&1) + 1);
- dc = block[0]; /* overflow is impossible */
- diff = dc - s->last_dc[component];
- encode_dc(s, diff, component);
- s->last_dc[component] = dc;
- i = 1;
- if (s->intra_vlc_format)
- table_vlc = rl_mpeg2.table_vlc;
- } else {
- /* encode the first coefficient : needs to be done here because
- it is handled slightly differently */
- level = block[0];
- if (abs(level) == 1) {
- code = ((uint32_t)level >> 31); /* the sign bit */
- put_bits(&s->pb, 2, code | 0x02);
- i = 1;
- } else {
- i = 0;
- last_non_zero = -1;
- goto next_coef;
- }
- }
-
- /* now quantify & encode AC coefs */
- last_non_zero = i - 1;
-
- for(;i<=last_index;i++) {
- j = s->intra_scantable.permutated[i];
- level = block[j];
- next_coef:
-#if 0
- if (level != 0)
- dprintf("level[%d]=%d\n", i, level);
-#endif
- /* encode using VLC */
- if (level != 0) {
- run = i - last_non_zero - 1;
-
- alevel= level;
- MASK_ABS(sign, alevel)
- sign&=1;
-
- if (alevel <= mpeg1_max_level[0][run]){
- code= mpeg1_index_run[0][run] + alevel - 1;
- /* store the vlc & sign at once */
- put_bits(&s->pb, table_vlc[code][1]+1, (table_vlc[code][0]<<1) + sign);
- } else {
- /* escape seems to be pretty rare <5% so i dont optimize it */
- put_bits(&s->pb, table_vlc[111][1], table_vlc[111][0]);
- /* escape: only clip in this case */
- put_bits(&s->pb, 6, run);
- if(s->codec_id == CODEC_ID_MPEG1VIDEO){
- if (alevel < 128) {
- put_bits(&s->pb, 8, level & 0xff);
- } else {
- if (level < 0) {
- put_bits(&s->pb, 16, 0x8001 + level + 255);
- } else {
- put_bits(&s->pb, 16, level & 0xffff);
- }
- }
- }else{
- put_bits(&s->pb, 12, level & 0xfff);
- }
- }
- last_non_zero = i;
- }
- }
- /* end of block */
- put_bits(&s->pb, table_vlc[112][1], table_vlc[112][0]);
-}
-#endif //CONFIG_ENCODERS
-
-/******************************************/
-/* decoding */
-
-static VLC dc_lum_vlc;
-static VLC dc_chroma_vlc;
-static VLC mv_vlc;
-static VLC mbincr_vlc;
-static VLC mb_ptype_vlc;
-static VLC mb_btype_vlc;
-static VLC mb_pat_vlc;
-
-static void init_vlcs(void)
-{
- static int done = 0;
-
- if (!done) {
- done = 1;
-
- init_vlc(&dc_lum_vlc, DC_VLC_BITS, 12,
- vlc_dc_lum_bits, 1, 1,
- vlc_dc_lum_code, 2, 2, 1);
- init_vlc(&dc_chroma_vlc, DC_VLC_BITS, 12,
- vlc_dc_chroma_bits, 1, 1,
- vlc_dc_chroma_code, 2, 2, 1);
- init_vlc(&mv_vlc, MV_VLC_BITS, 17,
- &mbMotionVectorTable[0][1], 2, 1,
- &mbMotionVectorTable[0][0], 2, 1, 1);
- init_vlc(&mbincr_vlc, MBINCR_VLC_BITS, 36,
- &mbAddrIncrTable[0][1], 2, 1,
- &mbAddrIncrTable[0][0], 2, 1, 1);
- init_vlc(&mb_pat_vlc, MB_PAT_VLC_BITS, 64,
- &mbPatTable[0][1], 2, 1,
- &mbPatTable[0][0], 2, 1, 1);
-
- init_vlc(&mb_ptype_vlc, MB_PTYPE_VLC_BITS, 7,
- &table_mb_ptype[0][1], 2, 1,
- &table_mb_ptype[0][0], 2, 1, 1);
- init_vlc(&mb_btype_vlc, MB_BTYPE_VLC_BITS, 11,
- &table_mb_btype[0][1], 2, 1,
- &table_mb_btype[0][0], 2, 1, 1);
- init_rl(&rl_mpeg1, 1);
- init_rl(&rl_mpeg2, 1);
-
- init_2d_vlc_rl(&rl_mpeg1, 1);
- init_2d_vlc_rl(&rl_mpeg2, 1);
- }
-}
-
-static inline int get_dmv(MpegEncContext *s)
-{
- if(get_bits1(&s->gb))
- return 1 - (get_bits1(&s->gb) << 1);
- else
- return 0;
-}
-
-static inline int get_qscale(MpegEncContext *s)
-{
- int qscale = get_bits(&s->gb, 5);
- if (s->q_scale_type) {
- return non_linear_qscale[qscale];
- } else {
- return qscale << 1;
- }
-}
-
-/* motion type (for mpeg2) */
-#define MT_FIELD 1
-#define MT_FRAME 2
-#define MT_16X8 2
-#define MT_DMV 3
-
-static int mpeg_decode_mb(MpegEncContext *s,
- DCTELEM block[12][64])
-{
- int i, j, k, cbp, val, mb_type, motion_type;
- const int mb_block_count = 4 + (1<< s->chroma_format);
-
- dprintf("decode_mb: x=%d y=%d\n", s->mb_x, s->mb_y);
-
- assert(s->mb_skipped==0);
-
- if (s->mb_skip_run-- != 0) {
- if(s->pict_type == I_TYPE){
- av_log(s->avctx, AV_LOG_ERROR, "skipped MB in I frame at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
-
- /* skip mb */
- s->mb_intra = 0;
- for(i=0;i<12;i++)
- s->block_last_index[i] = -1;
- if(s->picture_structure == PICT_FRAME)
- s->mv_type = MV_TYPE_16X16;
- else
- s->mv_type = MV_TYPE_FIELD;
- if (s->pict_type == P_TYPE) {
- /* if P type, zero motion vector is implied */
- s->mv_dir = MV_DIR_FORWARD;
- s->mv[0][0][0] = s->mv[0][0][1] = 0;
- s->last_mv[0][0][0] = s->last_mv[0][0][1] = 0;
- s->last_mv[0][1][0] = s->last_mv[0][1][1] = 0;
- s->field_select[0][0]= s->picture_structure - 1;
- s->mb_skipped = 1;
- s->current_picture.mb_type[ s->mb_x + s->mb_y*s->mb_stride ]= MB_TYPE_SKIP | MB_TYPE_L0 | MB_TYPE_16x16;
- } else {
- int mb_type;
-
- if(s->mb_x)
- mb_type= s->current_picture.mb_type[ s->mb_x + s->mb_y*s->mb_stride - 1];
- else
- mb_type= s->current_picture.mb_type[ s->mb_width + (s->mb_y-1)*s->mb_stride - 1]; // FIXME not sure if this is allowed in mpeg at all,
- if(IS_INTRA(mb_type))
- return -1;
-
- /* if B type, reuse previous vectors and directions */
- s->mv[0][0][0] = s->last_mv[0][0][0];
- s->mv[0][0][1] = s->last_mv[0][0][1];
- s->mv[1][0][0] = s->last_mv[1][0][0];
- s->mv[1][0][1] = s->last_mv[1][0][1];
-
- s->current_picture.mb_type[ s->mb_x + s->mb_y*s->mb_stride ]=
- mb_type | MB_TYPE_SKIP;
-// assert(s->current_picture.mb_type[ s->mb_x + s->mb_y*s->mb_stride - 1]&(MB_TYPE_16x16|MB_TYPE_16x8));
-
- if((s->mv[0][0][0]|s->mv[0][0][1]|s->mv[1][0][0]|s->mv[1][0][1])==0)
- s->mb_skipped = 1;
- }
-
- return 0;
- }
-
- switch(s->pict_type) {
- default:
- case I_TYPE:
- if (get_bits1(&s->gb) == 0) {
- if (get_bits1(&s->gb) == 0){
- av_log(s->avctx, AV_LOG_ERROR, "invalid mb type in I Frame at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
- mb_type = MB_TYPE_QUANT | MB_TYPE_INTRA;
- } else {
- mb_type = MB_TYPE_INTRA;
- }
- break;
- case P_TYPE:
- mb_type = get_vlc2(&s->gb, mb_ptype_vlc.table, MB_PTYPE_VLC_BITS, 1);
- if (mb_type < 0){
- av_log(s->avctx, AV_LOG_ERROR, "invalid mb type in P Frame at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
- mb_type = ptype2mb_type[ mb_type ];
- break;
- case B_TYPE:
- mb_type = get_vlc2(&s->gb, mb_btype_vlc.table, MB_BTYPE_VLC_BITS, 1);
- if (mb_type < 0){
- av_log(s->avctx, AV_LOG_ERROR, "invalid mb type in B Frame at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
- mb_type = btype2mb_type[ mb_type ];
- break;
- }
- dprintf("mb_type=%x\n", mb_type);
-// motion_type = 0; /* avoid warning */
- if (IS_INTRA(mb_type)) {
- s->dsp.clear_blocks(s->block[0]);
-
- if(!s->chroma_y_shift){
- s->dsp.clear_blocks(s->block[6]);
- }
-
- /* compute dct type */
- if (s->picture_structure == PICT_FRAME && //FIXME add a interlaced_dct coded var?
- !s->frame_pred_frame_dct) {
- s->interlaced_dct = get_bits1(&s->gb);
- }
-
- if (IS_QUANT(mb_type))
- s->qscale = get_qscale(s);
-
- if (s->concealment_motion_vectors) {
- /* just parse them */
- if (s->picture_structure != PICT_FRAME)
- skip_bits1(&s->gb); /* field select */
-
- s->mv[0][0][0]= s->last_mv[0][0][0]= s->last_mv[0][1][0] =
- mpeg_decode_motion(s, s->mpeg_f_code[0][0], s->last_mv[0][0][0]);
- s->mv[0][0][1]= s->last_mv[0][0][1]= s->last_mv[0][1][1] =
- mpeg_decode_motion(s, s->mpeg_f_code[0][1], s->last_mv[0][0][1]);
-
- skip_bits1(&s->gb); /* marker */
- }else
- memset(s->last_mv, 0, sizeof(s->last_mv)); /* reset mv prediction */
- s->mb_intra = 1;
-#ifdef HAVE_XVMC
- //one 1 we memcpy blocks in xvmcvideo
- if(s->avctx->xvmc_acceleration > 1){
- XVMC_pack_pblocks(s,-1);//inter are always full blocks
- if(s->swap_uv){
- exchange_uv(s);
- }
- }
-#endif
-
- if (s->codec_id == CODEC_ID_MPEG2VIDEO) {
- if(s->flags2 & CODEC_FLAG2_FAST){
- for(i=0;i<6;i++) {
- mpeg2_fast_decode_block_intra(s, s->pblocks[i], i);
- }
- }else{
- for(i=0;i<mb_block_count;i++) {
- if (mpeg2_decode_block_intra(s, s->pblocks[i], i) < 0)
- return -1;
- }
- }
- } else {
- for(i=0;i<6;i++) {
- if (mpeg1_decode_block_intra(s, s->pblocks[i], i) < 0)
- return -1;
- }
- }
- } else {
- if (mb_type & MB_TYPE_ZERO_MV){
- assert(mb_type & MB_TYPE_CBP);
-
- /* compute dct type */
- if (s->picture_structure == PICT_FRAME && //FIXME add a interlaced_dct coded var?
- !s->frame_pred_frame_dct) {
- s->interlaced_dct = get_bits1(&s->gb);
- }
-
- if (IS_QUANT(mb_type))
- s->qscale = get_qscale(s);
-
- s->mv_dir = MV_DIR_FORWARD;
- if(s->picture_structure == PICT_FRAME)
- s->mv_type = MV_TYPE_16X16;
- else{
- s->mv_type = MV_TYPE_FIELD;
- mb_type |= MB_TYPE_INTERLACED;
- s->field_select[0][0]= s->picture_structure - 1;
- }
- s->last_mv[0][0][0] = 0;
- s->last_mv[0][0][1] = 0;
- s->last_mv[0][1][0] = 0;
- s->last_mv[0][1][1] = 0;
- s->mv[0][0][0] = 0;
- s->mv[0][0][1] = 0;
- }else{
- assert(mb_type & MB_TYPE_L0L1);
-//FIXME decide if MBs in field pictures are MB_TYPE_INTERLACED
- /* get additionnal motion vector type */
- if (s->frame_pred_frame_dct)
- motion_type = MT_FRAME;
- else{
- motion_type = get_bits(&s->gb, 2);
- }
-
- /* compute dct type */
- if (s->picture_structure == PICT_FRAME && //FIXME add a interlaced_dct coded var?
- !s->frame_pred_frame_dct && HAS_CBP(mb_type)) {
- s->interlaced_dct = get_bits1(&s->gb);
- }
-
- if (IS_QUANT(mb_type))
- s->qscale = get_qscale(s);
-
- /* motion vectors */
- s->mv_dir = 0;
- for(i=0;i<2;i++) {
- if (USES_LIST(mb_type, i)) {
- s->mv_dir |= (MV_DIR_FORWARD >> i);
- dprintf("motion_type=%d\n", motion_type);
- switch(motion_type) {
- case MT_FRAME: /* or MT_16X8 */
- if (s->picture_structure == PICT_FRAME) {
- /* MT_FRAME */
- mb_type |= MB_TYPE_16x16;
- s->mv_type = MV_TYPE_16X16;
- s->mv[i][0][0]= s->last_mv[i][0][0]= s->last_mv[i][1][0] =
- mpeg_decode_motion(s, s->mpeg_f_code[i][0], s->last_mv[i][0][0]);
- s->mv[i][0][1]= s->last_mv[i][0][1]= s->last_mv[i][1][1] =
- mpeg_decode_motion(s, s->mpeg_f_code[i][1], s->last_mv[i][0][1]);
- /* full_pel: only for mpeg1 */
- if (s->full_pel[i]){
- s->mv[i][0][0] <<= 1;
- s->mv[i][0][1] <<= 1;
- }
- } else {
- /* MT_16X8 */
- mb_type |= MB_TYPE_16x8 | MB_TYPE_INTERLACED;
- s->mv_type = MV_TYPE_16X8;
- for(j=0;j<2;j++) {
- s->field_select[i][j] = get_bits1(&s->gb);
- for(k=0;k<2;k++) {
- val = mpeg_decode_motion(s, s->mpeg_f_code[i][k],
- s->last_mv[i][j][k]);
- s->last_mv[i][j][k] = val;
- s->mv[i][j][k] = val;
- }
- }
- }
- break;
- case MT_FIELD:
- s->mv_type = MV_TYPE_FIELD;
- if (s->picture_structure == PICT_FRAME) {
- mb_type |= MB_TYPE_16x8 | MB_TYPE_INTERLACED;
- for(j=0;j<2;j++) {
- s->field_select[i][j] = get_bits1(&s->gb);
- val = mpeg_decode_motion(s, s->mpeg_f_code[i][0],
- s->last_mv[i][j][0]);
- s->last_mv[i][j][0] = val;
- s->mv[i][j][0] = val;
- dprintf("fmx=%d\n", val);
- val = mpeg_decode_motion(s, s->mpeg_f_code[i][1],
- s->last_mv[i][j][1] >> 1);
- s->last_mv[i][j][1] = val << 1;
- s->mv[i][j][1] = val;
- dprintf("fmy=%d\n", val);
- }
- } else {
- mb_type |= MB_TYPE_16x16 | MB_TYPE_INTERLACED;
- s->field_select[i][0] = get_bits1(&s->gb);
- for(k=0;k<2;k++) {
- val = mpeg_decode_motion(s, s->mpeg_f_code[i][k],
- s->last_mv[i][0][k]);
- s->last_mv[i][0][k] = val;
- s->last_mv[i][1][k] = val;
- s->mv[i][0][k] = val;
- }
- }
- break;
- case MT_DMV:
- {
- int dmx, dmy, mx, my, m;
-
- mx = mpeg_decode_motion(s, s->mpeg_f_code[i][0],
- s->last_mv[i][0][0]);
- s->last_mv[i][0][0] = mx;
- s->last_mv[i][1][0] = mx;
- dmx = get_dmv(s);
- my = mpeg_decode_motion(s, s->mpeg_f_code[i][1],
- s->last_mv[i][0][1] >> 1);
- dmy = get_dmv(s);
- s->mv_type = MV_TYPE_DMV;
-
-
- s->last_mv[i][0][1] = my<<1;
- s->last_mv[i][1][1] = my<<1;
-
- s->mv[i][0][0] = mx;
- s->mv[i][0][1] = my;
- s->mv[i][1][0] = mx;//not used
- s->mv[i][1][1] = my;//not used
-
- if (s->picture_structure == PICT_FRAME) {
- mb_type |= MB_TYPE_16x16 | MB_TYPE_INTERLACED;
-
- //m = 1 + 2 * s->top_field_first;
- m = s->top_field_first ? 1 : 3;
-
- /* top -> top pred */
- s->mv[i][2][0] = ((mx * m + (mx > 0)) >> 1) + dmx;
- s->mv[i][2][1] = ((my * m + (my > 0)) >> 1) + dmy - 1;
- m = 4 - m;
- s->mv[i][3][0] = ((mx * m + (mx > 0)) >> 1) + dmx;
- s->mv[i][3][1] = ((my * m + (my > 0)) >> 1) + dmy + 1;
- } else {
- mb_type |= MB_TYPE_16x16;
-
- s->mv[i][2][0] = ((mx + (mx > 0)) >> 1) + dmx;
- s->mv[i][2][1] = ((my + (my > 0)) >> 1) + dmy;
- if(s->picture_structure == PICT_TOP_FIELD)
- s->mv[i][2][1]--;
- else
- s->mv[i][2][1]++;
- }
- }
- break;
- default:
- av_log(s->avctx, AV_LOG_ERROR, "00 motion_type at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
- }
- }
- }
-
- s->mb_intra = 0;
- if (HAS_CBP(mb_type)) {
- s->dsp.clear_blocks(s->block[0]);
-
- if(!s->chroma_y_shift){
- s->dsp.clear_blocks(s->block[6]);
- }
-
- cbp = get_vlc2(&s->gb, mb_pat_vlc.table, MB_PAT_VLC_BITS, 1);
- if (cbp < 0 || ((cbp == 0) && (s->chroma_format < 2)) ){
- av_log(s->avctx, AV_LOG_ERROR, "invalid cbp at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
- if(mb_block_count > 6){
- cbp<<= mb_block_count-6;
- cbp |= get_bits(&s->gb, mb_block_count-6);
- }
-
-#ifdef HAVE_XVMC
- //on 1 we memcpy blocks in xvmcvideo
- if(s->avctx->xvmc_acceleration > 1){
- XVMC_pack_pblocks(s,cbp);
- if(s->swap_uv){
- exchange_uv(s);
- }
- }
-#endif
-
- if (s->codec_id == CODEC_ID_MPEG2VIDEO) {
- if(s->flags2 & CODEC_FLAG2_FAST){
- for(i=0;i<6;i++) {
- if(cbp & 32) {
- mpeg2_fast_decode_block_non_intra(s, s->pblocks[i], i);
- } else {
- s->block_last_index[i] = -1;
- }
- cbp+=cbp;
- }
- }else{
- cbp<<= 12-mb_block_count;
-
- for(i=0;i<mb_block_count;i++) {
- if ( cbp & (1<<11) ) {
- if (mpeg2_decode_block_non_intra(s, s->pblocks[i], i) < 0)
- return -1;
- } else {
- s->block_last_index[i] = -1;
- }
- cbp+=cbp;
- }
- }
- } else {
- if(s->flags2 & CODEC_FLAG2_FAST){
- for(i=0;i<6;i++) {
- if (cbp & 32) {
- mpeg1_fast_decode_block_inter(s, s->pblocks[i], i);
- } else {
- s->block_last_index[i] = -1;
- }
- cbp+=cbp;
- }
- }else{
- for(i=0;i<6;i++) {
- if (cbp & 32) {
- if (mpeg1_decode_block_inter(s, s->pblocks[i], i) < 0)
- return -1;
- } else {
- s->block_last_index[i] = -1;
- }
- cbp+=cbp;
- }
- }
- }
- }else{
- for(i=0;i<12;i++)
- s->block_last_index[i] = -1;
- }
- }
-
- s->current_picture.mb_type[ s->mb_x + s->mb_y*s->mb_stride ]= mb_type;
-
- return 0;
-}
-
-/* as h263, but only 17 codes */
-static int mpeg_decode_motion(MpegEncContext *s, int fcode, int pred)
-{
- int code, sign, val, l, shift;
-
- code = get_vlc2(&s->gb, mv_vlc.table, MV_VLC_BITS, 2);
- if (code == 0) {
- return pred;
- }
- if (code < 0) {
- return 0xffff;
- }
-
- sign = get_bits1(&s->gb);
- shift = fcode - 1;
- val = code;
- if (shift) {
- val = (val - 1) << shift;
- val |= get_bits(&s->gb, shift);
- val++;
- }
- if (sign)
- val = -val;
- val += pred;
-
- /* modulo decoding */
- l= INT_BIT - 5 - shift;
- val = (val<<l)>>l;
- return val;
-}
-
-static inline int decode_dc(GetBitContext *gb, int component)
-{
- int code, diff;
-
- if (component == 0) {
- code = get_vlc2(gb, dc_lum_vlc.table, DC_VLC_BITS, 2);
- } else {
- code = get_vlc2(gb, dc_chroma_vlc.table, DC_VLC_BITS, 2);
- }
- if (code < 0){
- av_log(NULL, AV_LOG_ERROR, "invalid dc code at\n");
- return 0xffff;
- }
- if (code == 0) {
- diff = 0;
- } else {
- diff = get_xbits(gb, code);
- }
- return diff;
-}
-
-static inline int mpeg1_decode_block_intra(MpegEncContext *s,
- DCTELEM *block,
- int n)
-{
- int level, dc, diff, i, j, run;
- int component;
- RLTable *rl = &rl_mpeg1;
- uint8_t * const scantable= s->intra_scantable.permutated;
- const uint16_t *quant_matrix= s->intra_matrix;
- const int qscale= s->qscale;
-
- /* DC coef */
- component = (n <= 3 ? 0 : n - 4 + 1);
- diff = decode_dc(&s->gb, component);
- if (diff >= 0xffff)
- return -1;
- dc = s->last_dc[component];
- dc += diff;
- s->last_dc[component] = dc;
- block[0] = dc<<3;
- dprintf("dc=%d diff=%d\n", dc, diff);
- i = 0;
- {
- OPEN_READER(re, &s->gb);
- /* now quantify & encode AC coefs */
- for(;;) {
- UPDATE_CACHE(re, &s->gb);
- GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0);
-
- if(level == 127){
- break;
- } else if(level != 0) {
- i += run;
- j = scantable[i];
- level= (level*qscale*quant_matrix[j])>>4;
- level= (level-1)|1;
- level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1);
- LAST_SKIP_BITS(re, &s->gb, 1);
- } else {
- /* escape */
- run = SHOW_UBITS(re, &s->gb, 6)+1; LAST_SKIP_BITS(re, &s->gb, 6);
- UPDATE_CACHE(re, &s->gb);
- level = SHOW_SBITS(re, &s->gb, 8); SKIP_BITS(re, &s->gb, 8);
- if (level == -128) {
- level = SHOW_UBITS(re, &s->gb, 8) - 256; LAST_SKIP_BITS(re, &s->gb, 8);
- } else if (level == 0) {
- level = SHOW_UBITS(re, &s->gb, 8) ; LAST_SKIP_BITS(re, &s->gb, 8);
- }
- i += run;
- j = scantable[i];
- if(level<0){
- level= -level;
- level= (level*qscale*quant_matrix[j])>>4;
- level= (level-1)|1;
- level= -level;
- }else{
- level= (level*qscale*quant_matrix[j])>>4;
- level= (level-1)|1;
- }
- }
- if (i > 63){
- av_log(s->avctx, AV_LOG_ERROR, "ac-tex damaged at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
-
- block[j] = level;
- }
- CLOSE_READER(re, &s->gb);
- }
- s->block_last_index[n] = i;
- return 0;
-}
-
-static inline int mpeg1_decode_block_inter(MpegEncContext *s,
- DCTELEM *block,
- int n)
-{
- int level, i, j, run;
- RLTable *rl = &rl_mpeg1;
- uint8_t * const scantable= s->intra_scantable.permutated;
- const uint16_t *quant_matrix= s->inter_matrix;
- const int qscale= s->qscale;
-
- {
- OPEN_READER(re, &s->gb);
- i = -1;
- /* special case for the first coef. no need to add a second vlc table */
- UPDATE_CACHE(re, &s->gb);
- if (((int32_t)GET_CACHE(re, &s->gb)) < 0) {
- level= (3*qscale*quant_matrix[0])>>5;
- level= (level-1)|1;
- if(GET_CACHE(re, &s->gb)&0x40000000)
- level= -level;
- block[0] = level;
- i++;
- SKIP_BITS(re, &s->gb, 2);
- if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
- goto end;
- }
-
- /* now quantify & encode AC coefs */
- for(;;) {
- GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0);
-
- if(level != 0) {
- i += run;
- j = scantable[i];
- level= ((level*2+1)*qscale*quant_matrix[j])>>5;
- level= (level-1)|1;
- level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1);
- SKIP_BITS(re, &s->gb, 1);
- } else {
- /* escape */
- run = SHOW_UBITS(re, &s->gb, 6)+1; LAST_SKIP_BITS(re, &s->gb, 6);
- UPDATE_CACHE(re, &s->gb);
- level = SHOW_SBITS(re, &s->gb, 8); SKIP_BITS(re, &s->gb, 8);
- if (level == -128) {
- level = SHOW_UBITS(re, &s->gb, 8) - 256; SKIP_BITS(re, &s->gb, 8);
- } else if (level == 0) {
- level = SHOW_UBITS(re, &s->gb, 8) ; SKIP_BITS(re, &s->gb, 8);
- }
- i += run;
- j = scantable[i];
- if(level<0){
- level= -level;
- level= ((level*2+1)*qscale*quant_matrix[j])>>5;
- level= (level-1)|1;
- level= -level;
- }else{
- level= ((level*2+1)*qscale*quant_matrix[j])>>5;
- level= (level-1)|1;
- }
- }
- if (i > 63){
- av_log(s->avctx, AV_LOG_ERROR, "ac-tex damaged at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
-
- block[j] = level;
- if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
- break;
- UPDATE_CACHE(re, &s->gb);
- }
-end:
- LAST_SKIP_BITS(re, &s->gb, 2);
- CLOSE_READER(re, &s->gb);
- }
- s->block_last_index[n] = i;
- return 0;
-}
-
-static inline int mpeg1_fast_decode_block_inter(MpegEncContext *s, DCTELEM *block, int n)
-{
- int level, i, j, run;
- RLTable *rl = &rl_mpeg1;
- uint8_t * const scantable= s->intra_scantable.permutated;
- const int qscale= s->qscale;
-
- {
- OPEN_READER(re, &s->gb);
- i = -1;
- /* special case for the first coef. no need to add a second vlc table */
- UPDATE_CACHE(re, &s->gb);
- if (((int32_t)GET_CACHE(re, &s->gb)) < 0) {
- level= (3*qscale)>>1;
- level= (level-1)|1;
- if(GET_CACHE(re, &s->gb)&0x40000000)
- level= -level;
- block[0] = level;
- i++;
- SKIP_BITS(re, &s->gb, 2);
- if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
- goto end;
- }
-
- /* now quantify & encode AC coefs */
- for(;;) {
- GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0);
-
- if(level != 0) {
- i += run;
- j = scantable[i];
- level= ((level*2+1)*qscale)>>1;
- level= (level-1)|1;
- level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1);
- SKIP_BITS(re, &s->gb, 1);
- } else {
- /* escape */
- run = SHOW_UBITS(re, &s->gb, 6)+1; LAST_SKIP_BITS(re, &s->gb, 6);
- UPDATE_CACHE(re, &s->gb);
- level = SHOW_SBITS(re, &s->gb, 8); SKIP_BITS(re, &s->gb, 8);
- if (level == -128) {
- level = SHOW_UBITS(re, &s->gb, 8) - 256; SKIP_BITS(re, &s->gb, 8);
- } else if (level == 0) {
- level = SHOW_UBITS(re, &s->gb, 8) ; SKIP_BITS(re, &s->gb, 8);
- }
- i += run;
- j = scantable[i];
- if(level<0){
- level= -level;
- level= ((level*2+1)*qscale)>>1;
- level= (level-1)|1;
- level= -level;
- }else{
- level= ((level*2+1)*qscale)>>1;
- level= (level-1)|1;
- }
- }
-
- block[j] = level;
- if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
- break;
- UPDATE_CACHE(re, &s->gb);
- }
-end:
- LAST_SKIP_BITS(re, &s->gb, 2);
- CLOSE_READER(re, &s->gb);
- }
- s->block_last_index[n] = i;
- return 0;
-}
-
-
-static inline int mpeg2_decode_block_non_intra(MpegEncContext *s,
- DCTELEM *block,
- int n)
-{
- int level, i, j, run;
- RLTable *rl = &rl_mpeg1;
- uint8_t * const scantable= s->intra_scantable.permutated;
- const uint16_t *quant_matrix;
- const int qscale= s->qscale;
- int mismatch;
-
- mismatch = 1;
-
- {
- OPEN_READER(re, &s->gb);
- i = -1;
- if (n < 4)
- quant_matrix = s->inter_matrix;
- else
- quant_matrix = s->chroma_inter_matrix;
-
- /* special case for the first coef. no need to add a second vlc table */
- UPDATE_CACHE(re, &s->gb);
- if (((int32_t)GET_CACHE(re, &s->gb)) < 0) {
- level= (3*qscale*quant_matrix[0])>>5;
- if(GET_CACHE(re, &s->gb)&0x40000000)
- level= -level;
- block[0] = level;
- mismatch ^= level;
- i++;
- SKIP_BITS(re, &s->gb, 2);
- if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
- goto end;
- }
-
- /* now quantify & encode AC coefs */
- for(;;) {
- GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0);
-
- if(level != 0) {
- i += run;
- j = scantable[i];
- level= ((level*2+1)*qscale*quant_matrix[j])>>5;
- level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1);
- SKIP_BITS(re, &s->gb, 1);
- } else {
- /* escape */
- run = SHOW_UBITS(re, &s->gb, 6)+1; LAST_SKIP_BITS(re, &s->gb, 6);
- UPDATE_CACHE(re, &s->gb);
- level = SHOW_SBITS(re, &s->gb, 12); SKIP_BITS(re, &s->gb, 12);
-
- i += run;
- j = scantable[i];
- if(level<0){
- level= ((-level*2+1)*qscale*quant_matrix[j])>>5;
- level= -level;
- }else{
- level= ((level*2+1)*qscale*quant_matrix[j])>>5;
- }
- }
- if (i > 63){
- av_log(s->avctx, AV_LOG_ERROR, "ac-tex damaged at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
-
- mismatch ^= level;
- block[j] = level;
- if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
- break;
- UPDATE_CACHE(re, &s->gb);
- }
-end:
- LAST_SKIP_BITS(re, &s->gb, 2);
- CLOSE_READER(re, &s->gb);
- }
- block[63] ^= (mismatch & 1);
-
- s->block_last_index[n] = i;
- return 0;
-}
-
-static inline int mpeg2_fast_decode_block_non_intra(MpegEncContext *s,
- DCTELEM *block,
- int n)
-{
- int level, i, j, run;
- RLTable *rl = &rl_mpeg1;
- uint8_t * const scantable= s->intra_scantable.permutated;
- const int qscale= s->qscale;
- OPEN_READER(re, &s->gb);
- i = -1;
-
- /* special case for the first coef. no need to add a second vlc table */
- UPDATE_CACHE(re, &s->gb);
- if (((int32_t)GET_CACHE(re, &s->gb)) < 0) {
- level= (3*qscale)>>1;
- if(GET_CACHE(re, &s->gb)&0x40000000)
- level= -level;
- block[0] = level;
- i++;
- SKIP_BITS(re, &s->gb, 2);
- if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
- goto end;
- }
-
- /* now quantify & encode AC coefs */
- for(;;) {
- GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0);
-
- if(level != 0) {
- i += run;
- j = scantable[i];
- level= ((level*2+1)*qscale)>>1;
- level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1);
- SKIP_BITS(re, &s->gb, 1);
- } else {
- /* escape */
- run = SHOW_UBITS(re, &s->gb, 6)+1; LAST_SKIP_BITS(re, &s->gb, 6);
- UPDATE_CACHE(re, &s->gb);
- level = SHOW_SBITS(re, &s->gb, 12); SKIP_BITS(re, &s->gb, 12);
-
- i += run;
- j = scantable[i];
- if(level<0){
- level= ((-level*2+1)*qscale)>>1;
- level= -level;
- }else{
- level= ((level*2+1)*qscale)>>1;
- }
- }
-
- block[j] = level;
- if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
- break;
- UPDATE_CACHE(re, &s->gb);
- }
-end:
- LAST_SKIP_BITS(re, &s->gb, 2);
- CLOSE_READER(re, &s->gb);
- s->block_last_index[n] = i;
- return 0;
-}
-
-
-static inline int mpeg2_decode_block_intra(MpegEncContext *s,
- DCTELEM *block,
- int n)
-{
- int level, dc, diff, i, j, run;
- int component;
- RLTable *rl;
- uint8_t * const scantable= s->intra_scantable.permutated;
- const uint16_t *quant_matrix;
- const int qscale= s->qscale;
- int mismatch;
-
- /* DC coef */
- if (n < 4){
- quant_matrix = s->intra_matrix;
- component = 0;
- }else{
- quant_matrix = s->chroma_intra_matrix;
- component = (n&1) + 1;
- }
- diff = decode_dc(&s->gb, component);
- if (diff >= 0xffff)
- return -1;
- dc = s->last_dc[component];
- dc += diff;
- s->last_dc[component] = dc;
- block[0] = dc << (3 - s->intra_dc_precision);
- dprintf("dc=%d\n", block[0]);
- mismatch = block[0] ^ 1;
- i = 0;
- if (s->intra_vlc_format)
- rl = &rl_mpeg2;
- else
- rl = &rl_mpeg1;
-
- {
- OPEN_READER(re, &s->gb);
- /* now quantify & encode AC coefs */
- for(;;) {
- UPDATE_CACHE(re, &s->gb);
- GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0);
-
- if(level == 127){
- break;
- } else if(level != 0) {
- i += run;
- j = scantable[i];
- level= (level*qscale*quant_matrix[j])>>4;
- level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1);
- LAST_SKIP_BITS(re, &s->gb, 1);
- } else {
- /* escape */
- run = SHOW_UBITS(re, &s->gb, 6)+1; LAST_SKIP_BITS(re, &s->gb, 6);
- UPDATE_CACHE(re, &s->gb);
- level = SHOW_SBITS(re, &s->gb, 12); SKIP_BITS(re, &s->gb, 12);
- i += run;
- j = scantable[i];
- if(level<0){
- level= (-level*qscale*quant_matrix[j])>>4;
- level= -level;
- }else{
- level= (level*qscale*quant_matrix[j])>>4;
- }
- }
- if (i > 63){
- av_log(s->avctx, AV_LOG_ERROR, "ac-tex damaged at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
-
- mismatch^= level;
- block[j] = level;
- }
- CLOSE_READER(re, &s->gb);
- }
- block[63]^= mismatch&1;
-
- s->block_last_index[n] = i;
- return 0;
-}
-
-static inline int mpeg2_fast_decode_block_intra(MpegEncContext *s,
- DCTELEM *block,
- int n)
-{
- int level, dc, diff, j, run;
- int component;
- RLTable *rl;
- uint8_t * scantable= s->intra_scantable.permutated;
- const uint16_t *quant_matrix;
- const int qscale= s->qscale;
-
- /* DC coef */
- if (n < 4){
- quant_matrix = s->intra_matrix;
- component = 0;
- }else{
- quant_matrix = s->chroma_intra_matrix;
- component = (n&1) + 1;
- }
- diff = decode_dc(&s->gb, component);
- if (diff >= 0xffff)
- return -1;
- dc = s->last_dc[component];
- dc += diff;
- s->last_dc[component] = dc;
- block[0] = dc << (3 - s->intra_dc_precision);
- if (s->intra_vlc_format)
- rl = &rl_mpeg2;
- else
- rl = &rl_mpeg1;
-
- {
- OPEN_READER(re, &s->gb);
- /* now quantify & encode AC coefs */
- for(;;) {
- UPDATE_CACHE(re, &s->gb);
- GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0);
-
- if(level == 127){
- break;
- } else if(level != 0) {
- scantable += run;
- j = *scantable;
- level= (level*qscale*quant_matrix[j])>>4;
- level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1);
- LAST_SKIP_BITS(re, &s->gb, 1);
- } else {
- /* escape */
- run = SHOW_UBITS(re, &s->gb, 6)+1; LAST_SKIP_BITS(re, &s->gb, 6);
- UPDATE_CACHE(re, &s->gb);
- level = SHOW_SBITS(re, &s->gb, 12); SKIP_BITS(re, &s->gb, 12);
- scantable += run;
- j = *scantable;
- if(level<0){
- level= (-level*qscale*quant_matrix[j])>>4;
- level= -level;
- }else{
- level= (level*qscale*quant_matrix[j])>>4;
- }
- }
-
- block[j] = level;
- }
- CLOSE_READER(re, &s->gb);
- }
-
- s->block_last_index[n] = scantable - s->intra_scantable.permutated;
- return 0;
-}
-
-typedef struct Mpeg1Context {
- MpegEncContext mpeg_enc_ctx;
- int mpeg_enc_ctx_allocated; /* true if decoding context allocated */
- int repeat_field; /* true if we must repeat the field */
- AVPanScan pan_scan; /** some temporary storage for the panscan */
- int slice_count;
- int swap_uv;//indicate VCR2
- int save_aspect_info;
- AVRational frame_rate_ext; ///< MPEG-2 specific framerate modificator
-
-} Mpeg1Context;
-
-static int mpeg_decode_init(AVCodecContext *avctx)
-{
- Mpeg1Context *s = avctx->priv_data;
- MpegEncContext *s2 = &s->mpeg_enc_ctx;
- int i;
-
- //we need some parmutation to store
- //matrixes, until MPV_common_init()
- //set the real permutatuon
- for(i=0;i<64;i++)
- s2->dsp.idct_permutation[i]=i;
-
- MPV_decode_defaults(s2);
-
- s->mpeg_enc_ctx.avctx= avctx;
- s->mpeg_enc_ctx.flags= avctx->flags;
- s->mpeg_enc_ctx.flags2= avctx->flags2;
- common_init(&s->mpeg_enc_ctx);
- init_vlcs();
-
- s->mpeg_enc_ctx_allocated = 0;
- s->mpeg_enc_ctx.picture_number = 0;
- s->repeat_field = 0;
- s->mpeg_enc_ctx.codec_id= avctx->codec->id;
- return 0;
-}
-
-static void quant_matrix_rebuild(uint16_t *matrix, const uint8_t *old_perm,
- const uint8_t *new_perm){
- uint16_t temp_matrix[64];
- int i;
-
- memcpy(temp_matrix,matrix,64*sizeof(uint16_t));
-
- for(i=0;i<64;i++){
- matrix[new_perm[i]] = temp_matrix[old_perm[i]];
- }
-}
-
-//Call this function when we know all parameters
-//it may be called in different places for mpeg1 and mpeg2
-static int mpeg_decode_postinit(AVCodecContext *avctx){
- Mpeg1Context *s1 = avctx->priv_data;
- MpegEncContext *s = &s1->mpeg_enc_ctx;
- uint8_t old_permutation[64];
-
- if (
- (s1->mpeg_enc_ctx_allocated == 0)||
- avctx->coded_width != s->width ||
- avctx->coded_height != s->height||
- s1->save_aspect_info != s->aspect_ratio_info||
- 0)
- {
-
- if (s1->mpeg_enc_ctx_allocated) {
- ParseContext pc= s->parse_context;
- s->parse_context.buffer=0;
- MPV_common_end(s);
- s->parse_context= pc;
- }
-
- if( (s->width == 0 )||(s->height == 0))
- return -2;
-
- avcodec_set_dimensions(avctx, s->width, s->height);
- avctx->bit_rate = s->bit_rate;
- s1->save_aspect_info = s->aspect_ratio_info;
-
- //low_delay may be forced, in this case we will have B frames
- //that behave like P frames
- avctx->has_b_frames = !(s->low_delay);
-
- if(avctx->sub_id==1){//s->codec_id==avctx->codec_id==CODEC_ID
- //mpeg1 fps
- avctx->time_base.den= ff_frame_rate_tab[s->frame_rate_index].num;
- avctx->time_base.num= ff_frame_rate_tab[s->frame_rate_index].den;
- //mpeg1 aspect
- avctx->sample_aspect_ratio= av_d2q(
- 1.0/mpeg1_aspect[s->aspect_ratio_info], 255);
-
- }else{//mpeg2
- //mpeg2 fps
- av_reduce(
- &s->avctx->time_base.den,
- &s->avctx->time_base.num,
- ff_frame_rate_tab[s->frame_rate_index].num * s1->frame_rate_ext.num,
- ff_frame_rate_tab[s->frame_rate_index].den * s1->frame_rate_ext.den,
- 1<<30);
- //mpeg2 aspect
- if(s->aspect_ratio_info > 1){
- if( (s1->pan_scan.width == 0 )||(s1->pan_scan.height == 0) ){
- s->avctx->sample_aspect_ratio=
- av_div_q(
- mpeg2_aspect[s->aspect_ratio_info],
- (AVRational){s->width, s->height}
- );
- }else{
- s->avctx->sample_aspect_ratio=
- av_div_q(
- mpeg2_aspect[s->aspect_ratio_info],
- (AVRational){s1->pan_scan.width, s1->pan_scan.height}
- );
- }
- }else{
- s->avctx->sample_aspect_ratio=
- mpeg2_aspect[s->aspect_ratio_info];
- }
- }//mpeg2
-
- if(avctx->xvmc_acceleration){
- avctx->pix_fmt = avctx->get_format(avctx,pixfmt_xvmc_mpg2_420);
- }else{
- if(s->chroma_format < 2){
- avctx->pix_fmt = avctx->get_format(avctx,pixfmt_yuv_420);
- }else
- if(s->chroma_format == 2){
- avctx->pix_fmt = avctx->get_format(avctx,pixfmt_yuv_422);
- }else
- if(s->chroma_format > 2){
- avctx->pix_fmt = avctx->get_format(avctx,pixfmt_yuv_444);
- }
- }
- //until then pix_fmt may be changed right after codec init
- if( avctx->pix_fmt == PIX_FMT_XVMC_MPEG2_IDCT )
- if( avctx->idct_algo == FF_IDCT_AUTO )
- avctx->idct_algo = FF_IDCT_SIMPLE;
-
- //quantization matrixes may need reordering
- //if dct permutation is changed
- memcpy(old_permutation,s->dsp.idct_permutation,64*sizeof(uint8_t));
-
- if (MPV_common_init(s) < 0)
- return -2;
-
- quant_matrix_rebuild(s->intra_matrix, old_permutation,s->dsp.idct_permutation);
- quant_matrix_rebuild(s->inter_matrix, old_permutation,s->dsp.idct_permutation);
- quant_matrix_rebuild(s->chroma_intra_matrix,old_permutation,s->dsp.idct_permutation);
- quant_matrix_rebuild(s->chroma_inter_matrix,old_permutation,s->dsp.idct_permutation);
-
- s1->mpeg_enc_ctx_allocated = 1;
- }
- return 0;
-}
-
-static int mpeg1_decode_picture(AVCodecContext *avctx,
- const uint8_t *buf, int buf_size)
-{
- Mpeg1Context *s1 = avctx->priv_data;
- MpegEncContext *s = &s1->mpeg_enc_ctx;
- int ref, f_code, vbv_delay;
-
- if(mpeg_decode_postinit(s->avctx) < 0)
- return -2;
-
- init_get_bits(&s->gb, buf, buf_size*8);
-
- ref = get_bits(&s->gb, 10); /* temporal ref */
- s->pict_type = get_bits(&s->gb, 3);
- if(s->pict_type == 0 || s->pict_type > 3)
- return -1;
-
- vbv_delay= get_bits(&s->gb, 16);
- if (s->pict_type == P_TYPE || s->pict_type == B_TYPE) {
- s->full_pel[0] = get_bits1(&s->gb);
- f_code = get_bits(&s->gb, 3);
- if (f_code == 0 && avctx->error_resilience >= FF_ER_COMPLIANT)
- return -1;
- s->mpeg_f_code[0][0] = f_code;
- s->mpeg_f_code[0][1] = f_code;
- }
- if (s->pict_type == B_TYPE) {
- s->full_pel[1] = get_bits1(&s->gb);
- f_code = get_bits(&s->gb, 3);
- if (f_code == 0 && avctx->error_resilience >= FF_ER_COMPLIANT)
- return -1;
- s->mpeg_f_code[1][0] = f_code;
- s->mpeg_f_code[1][1] = f_code;
- }
- s->current_picture.pict_type= s->pict_type;
- s->current_picture.key_frame= s->pict_type == I_TYPE;
-
- if(avctx->debug & FF_DEBUG_PICT_INFO)
- av_log(avctx, AV_LOG_DEBUG, "vbv_delay %d, ref %d type:%d\n", vbv_delay, ref, s->pict_type);
-
- s->y_dc_scale = 8;
- s->c_dc_scale = 8;
- s->first_slice = 1;
- return 0;
-}
-
-static void mpeg_decode_sequence_extension(Mpeg1Context *s1)
-{
- MpegEncContext *s= &s1->mpeg_enc_ctx;
- int horiz_size_ext, vert_size_ext;
- int bit_rate_ext;
-
- skip_bits(&s->gb, 1); /* profil and level esc*/
- s->avctx->profile= get_bits(&s->gb, 3);
- s->avctx->level= get_bits(&s->gb, 4);
- s->progressive_sequence = get_bits1(&s->gb); /* progressive_sequence */
- s->chroma_format = get_bits(&s->gb, 2); /* chroma_format 1=420, 2=422, 3=444 */
- horiz_size_ext = get_bits(&s->gb, 2);
- vert_size_ext = get_bits(&s->gb, 2);
- s->width |= (horiz_size_ext << 12);
- s->height |= (vert_size_ext << 12);
- bit_rate_ext = get_bits(&s->gb, 12); /* XXX: handle it */
- s->bit_rate += (bit_rate_ext << 18) * 400;
- skip_bits1(&s->gb); /* marker */
- s->avctx->rc_buffer_size += get_bits(&s->gb, 8)*1024*16<<10;
-
- s->low_delay = get_bits1(&s->gb);
- if(s->flags & CODEC_FLAG_LOW_DELAY) s->low_delay=1;
-
- s1->frame_rate_ext.num = get_bits(&s->gb, 2)+1;
- s1->frame_rate_ext.den = get_bits(&s->gb, 5)+1;
-
- dprintf("sequence extension\n");
- s->codec_id= s->avctx->codec_id= CODEC_ID_MPEG2VIDEO;
- s->avctx->sub_id = 2; /* indicates mpeg2 found */
-
- if(s->avctx->debug & FF_DEBUG_PICT_INFO)
- av_log(s->avctx, AV_LOG_DEBUG, "profile: %d, level: %d vbv buffer: %d, bitrate:%d\n",
- s->avctx->profile, s->avctx->level, s->avctx->rc_buffer_size, s->bit_rate);
-
-}
-
-static void mpeg_decode_sequence_display_extension(Mpeg1Context *s1)
-{
- MpegEncContext *s= &s1->mpeg_enc_ctx;
- int color_description, w, h;
-
- skip_bits(&s->gb, 3); /* video format */
- color_description= get_bits1(&s->gb);
- if(color_description){
- skip_bits(&s->gb, 8); /* color primaries */
- skip_bits(&s->gb, 8); /* transfer_characteristics */
- skip_bits(&s->gb, 8); /* matrix_coefficients */
- }
- w= get_bits(&s->gb, 14);
- skip_bits(&s->gb, 1); //marker
- h= get_bits(&s->gb, 14);
- skip_bits(&s->gb, 1); //marker
-
- s1->pan_scan.width= 16*w;
- s1->pan_scan.height=16*h;
-
- if(s->avctx->debug & FF_DEBUG_PICT_INFO)
- av_log(s->avctx, AV_LOG_DEBUG, "sde w:%d, h:%d\n", w, h);
-}
-
-static void mpeg_decode_picture_display_extension(Mpeg1Context *s1)
-{
- MpegEncContext *s= &s1->mpeg_enc_ctx;
- int i,nofco;
-
- nofco = 1;
- if(s->progressive_sequence){
- if(s->repeat_first_field){
- nofco++;
- if(s->top_field_first)
- nofco++;
- }
- }else{
- if(s->picture_structure == PICT_FRAME){
- nofco++;
- if(s->repeat_first_field)
- nofco++;
- }
- }
- for(i=0; i<nofco; i++){
- s1->pan_scan.position[i][0]= get_sbits(&s->gb, 16);
- skip_bits(&s->gb, 1); //marker
- s1->pan_scan.position[i][1]= get_sbits(&s->gb, 16);
- skip_bits(&s->gb, 1); //marker
- }
-
- if(s->avctx->debug & FF_DEBUG_PICT_INFO)
- av_log(s->avctx, AV_LOG_DEBUG, "pde (%d,%d) (%d,%d) (%d,%d)\n",
- s1->pan_scan.position[0][0], s1->pan_scan.position[0][1],
- s1->pan_scan.position[1][0], s1->pan_scan.position[1][1],
- s1->pan_scan.position[2][0], s1->pan_scan.position[2][1]
- );
-}
-
-static void mpeg_decode_quant_matrix_extension(MpegEncContext *s)
-{
- int i, v, j;
-
- dprintf("matrix extension\n");
-
- if (get_bits1(&s->gb)) {
- for(i=0;i<64;i++) {
- v = get_bits(&s->gb, 8);
- j= s->dsp.idct_permutation[ ff_zigzag_direct[i] ];
- s->intra_matrix[j] = v;
- s->chroma_intra_matrix[j] = v;
- }
- }
- if (get_bits1(&s->gb)) {
- for(i=0;i<64;i++) {
- v = get_bits(&s->gb, 8);
- j= s->dsp.idct_permutation[ ff_zigzag_direct[i] ];
- s->inter_matrix[j] = v;
- s->chroma_inter_matrix[j] = v;
- }
- }
- if (get_bits1(&s->gb)) {
- for(i=0;i<64;i++) {
- v = get_bits(&s->gb, 8);
- j= s->dsp.idct_permutation[ ff_zigzag_direct[i] ];
- s->chroma_intra_matrix[j] = v;
- }
- }
- if (get_bits1(&s->gb)) {
- for(i=0;i<64;i++) {
- v = get_bits(&s->gb, 8);
- j= s->dsp.idct_permutation[ ff_zigzag_direct[i] ];
- s->chroma_inter_matrix[j] = v;
- }
- }
-}
-
-static void mpeg_decode_picture_coding_extension(MpegEncContext *s)
-{
- s->full_pel[0] = s->full_pel[1] = 0;
- s->mpeg_f_code[0][0] = get_bits(&s->gb, 4);
- s->mpeg_f_code[0][1] = get_bits(&s->gb, 4);
- s->mpeg_f_code[1][0] = get_bits(&s->gb, 4);
- s->mpeg_f_code[1][1] = get_bits(&s->gb, 4);
- s->intra_dc_precision = get_bits(&s->gb, 2);
- s->picture_structure = get_bits(&s->gb, 2);
- s->top_field_first = get_bits1(&s->gb);
- s->frame_pred_frame_dct = get_bits1(&s->gb);
- s->concealment_motion_vectors = get_bits1(&s->gb);
- s->q_scale_type = get_bits1(&s->gb);
- s->intra_vlc_format = get_bits1(&s->gb);
- s->alternate_scan = get_bits1(&s->gb);
- s->repeat_first_field = get_bits1(&s->gb);
- s->chroma_420_type = get_bits1(&s->gb);
- s->progressive_frame = get_bits1(&s->gb);
-
- if(s->picture_structure == PICT_FRAME){
- s->first_field=0;
- s->v_edge_pos= 16*s->mb_height;
- }else{
- s->first_field ^= 1;
- s->v_edge_pos= 8*s->mb_height;
- memset(s->mbskip_table, 0, s->mb_stride*s->mb_height);
- }
-
- if(s->alternate_scan){
- ff_init_scantable(s->dsp.idct_permutation, &s->inter_scantable , ff_alternate_vertical_scan);
- ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable , ff_alternate_vertical_scan);
- }else{
- ff_init_scantable(s->dsp.idct_permutation, &s->inter_scantable , ff_zigzag_direct);
- ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable , ff_zigzag_direct);
- }
-
- /* composite display not parsed */
- dprintf("intra_dc_precision=%d\n", s->intra_dc_precision);
- dprintf("picture_structure=%d\n", s->picture_structure);
- dprintf("top field first=%d\n", s->top_field_first);
- dprintf("repeat first field=%d\n", s->repeat_first_field);
- dprintf("conceal=%d\n", s->concealment_motion_vectors);
- dprintf("intra_vlc_format=%d\n", s->intra_vlc_format);
- dprintf("alternate_scan=%d\n", s->alternate_scan);
- dprintf("frame_pred_frame_dct=%d\n", s->frame_pred_frame_dct);
- dprintf("progressive_frame=%d\n", s->progressive_frame);
-}
-
-static void mpeg_decode_extension(AVCodecContext *avctx,
- const uint8_t *buf, int buf_size)
-{
- Mpeg1Context *s1 = avctx->priv_data;
- MpegEncContext *s = &s1->mpeg_enc_ctx;
- int ext_type;
-
- init_get_bits(&s->gb, buf, buf_size*8);
-
- ext_type = get_bits(&s->gb, 4);
- switch(ext_type) {
- case 0x1:
- mpeg_decode_sequence_extension(s1);
- break;
- case 0x2:
- mpeg_decode_sequence_display_extension(s1);
- break;
- case 0x3:
- mpeg_decode_quant_matrix_extension(s);
- break;
- case 0x7:
- mpeg_decode_picture_display_extension(s1);
- break;
- case 0x8:
- mpeg_decode_picture_coding_extension(s);
- break;
- }
-}
-
-static void exchange_uv(MpegEncContext *s){
- short * tmp = s->pblocks[4];
- s->pblocks[4] = s->pblocks[5];
- s->pblocks[5] = tmp;
-}
-
-static int mpeg_field_start(MpegEncContext *s){
- AVCodecContext *avctx= s->avctx;
- Mpeg1Context *s1 = (Mpeg1Context*)s;
-
- /* start frame decoding */
- if(s->first_field || s->picture_structure==PICT_FRAME){
- if(MPV_frame_start(s, avctx) < 0)
- return -1;
-
- ff_er_frame_start(s);
-
- /* first check if we must repeat the frame */
- s->current_picture_ptr->repeat_pict = 0;
- if (s->repeat_first_field) {
- if (s->progressive_sequence) {
- if (s->top_field_first)
- s->current_picture_ptr->repeat_pict = 4;
- else
- s->current_picture_ptr->repeat_pict = 2;
- } else if (s->progressive_frame) {
- s->current_picture_ptr->repeat_pict = 1;
- }
- }
-
- *s->current_picture_ptr->pan_scan= s1->pan_scan;
- }else{ //second field
- int i;
-
- if(!s->current_picture_ptr){
- av_log(s->avctx, AV_LOG_ERROR, "first field missing\n");
- return -1;
- }
-
- for(i=0; i<4; i++){
- s->current_picture.data[i] = s->current_picture_ptr->data[i];
- if(s->picture_structure == PICT_BOTTOM_FIELD){
- s->current_picture.data[i] += s->current_picture_ptr->linesize[i];
- }
- }
- }
-#ifdef HAVE_XVMC
-// MPV_frame_start will call this function too,
-// but we need to call it on every field
- if(s->avctx->xvmc_acceleration)
- XVMC_field_start(s,avctx);
-#endif
-
- return 0;
-}
-
-#define DECODE_SLICE_ERROR -1
-#define DECODE_SLICE_OK 0
-
-/**
- * decodes a slice. MpegEncContext.mb_y must be set to the MB row from the startcode
- * @return DECODE_SLICE_ERROR if the slice is damaged<br>
- * DECODE_SLICE_OK if this slice is ok<br>
- */
-static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y,
- const uint8_t **buf, int buf_size)
-{
- MpegEncContext *s = &s1->mpeg_enc_ctx;
- AVCodecContext *avctx= s->avctx;
- int ret;
- const int field_pic= s->picture_structure != PICT_FRAME;
- const int lowres= s->avctx->lowres;
-
- s->resync_mb_x=
- s->resync_mb_y= -1;
-
- if (mb_y<<field_pic >= s->mb_height){
- av_log(s->avctx, AV_LOG_ERROR, "slice below image (%d >= %d)\n", mb_y, s->mb_height);
- return -1;
- }
-
- init_get_bits(&s->gb, *buf, buf_size*8);
-
- ff_mpeg1_clean_buffers(s);
- s->interlaced_dct = 0;
-
- s->qscale = get_qscale(s);
-
- if(s->qscale == 0){
- av_log(s->avctx, AV_LOG_ERROR, "qscale == 0\n");
- return -1;
- }
-
- /* extra slice info */
- while (get_bits1(&s->gb) != 0) {
- skip_bits(&s->gb, 8);
- }
-
- s->mb_x=0;
-
- for(;;) {
- int code = get_vlc2(&s->gb, mbincr_vlc.table, MBINCR_VLC_BITS, 2);
- if (code < 0){
- av_log(s->avctx, AV_LOG_ERROR, "first mb_incr damaged\n");
- return -1;
- }
- if (code >= 33) {
- if (code == 33) {
- s->mb_x += 33;
- }
- /* otherwise, stuffing, nothing to do */
- } else {
- s->mb_x += code;
- break;
- }
- }
-
- s->resync_mb_x= s->mb_x;
- s->resync_mb_y= s->mb_y= mb_y;
- s->mb_skip_run= 0;
- ff_init_block_index(s);
-
- if (s->mb_y==0 && s->mb_x==0 && (s->first_field || s->picture_structure==PICT_FRAME)) {
- if(s->avctx->debug&FF_DEBUG_PICT_INFO){
- av_log(s->avctx, AV_LOG_DEBUG, "qp:%d fc:%2d%2d%2d%2d %s %s %s %s %s dc:%d pstruct:%d fdct:%d cmv:%d qtype:%d ivlc:%d rff:%d %s\n",
- s->qscale, s->mpeg_f_code[0][0],s->mpeg_f_code[0][1],s->mpeg_f_code[1][0],s->mpeg_f_code[1][1],
- s->pict_type == I_TYPE ? "I" : (s->pict_type == P_TYPE ? "P" : (s->pict_type == B_TYPE ? "B" : "S")),
- s->progressive_sequence ? "ps" :"", s->progressive_frame ? "pf" : "", s->alternate_scan ? "alt" :"", s->top_field_first ? "top" :"",
- s->intra_dc_precision, s->picture_structure, s->frame_pred_frame_dct, s->concealment_motion_vectors,
- s->q_scale_type, s->intra_vlc_format, s->repeat_first_field, s->chroma_420_type ? "420" :"");
- }
- }
-
- for(;;) {
-#ifdef HAVE_XVMC
- //one 1 we memcpy blocks in xvmcvideo
- if(s->avctx->xvmc_acceleration > 1)
- XVMC_init_block(s);//set s->block
-#endif
-
- ret = mpeg_decode_mb(s, s->block);
- s->chroma_qscale= s->qscale;
-
- dprintf("ret=%d\n", ret);
- if (ret < 0)
- return -1;
-
- if(s->current_picture.motion_val[0] && !s->encoding){ //note motion_val is normally NULL unless we want to extract the MVs
- const int wrap = field_pic ? 2*s->b8_stride : s->b8_stride;
- int xy = s->mb_x*2 + s->mb_y*2*wrap;
- int motion_x, motion_y, dir, i;
- if(field_pic && !s->first_field)
- xy += wrap/2;
-
- for(i=0; i<2; i++){
- for(dir=0; dir<2; dir++){
- if (s->mb_intra || (dir==1 && s->pict_type != B_TYPE)) {
- motion_x = motion_y = 0;
- }else if (s->mv_type == MV_TYPE_16X16 || (s->mv_type == MV_TYPE_FIELD && field_pic)){
- motion_x = s->mv[dir][0][0];
- motion_y = s->mv[dir][0][1];
- } else /*if ((s->mv_type == MV_TYPE_FIELD) || (s->mv_type == MV_TYPE_16X8))*/ {
- motion_x = s->mv[dir][i][0];
- motion_y = s->mv[dir][i][1];
- }
-
- s->current_picture.motion_val[dir][xy ][0] = motion_x;
- s->current_picture.motion_val[dir][xy ][1] = motion_y;
- s->current_picture.motion_val[dir][xy + 1][0] = motion_x;
- s->current_picture.motion_val[dir][xy + 1][1] = motion_y;
- s->current_picture.ref_index [dir][xy ]=
- s->current_picture.ref_index [dir][xy + 1]= s->field_select[dir][i];
- assert(s->field_select[dir][i]==0 || s->field_select[dir][i]==1);
- }
- xy += wrap;
- }
- }
-
- s->dest[0] += 16 >> lowres;
- s->dest[1] += 16 >> (s->chroma_x_shift + lowres);
- s->dest[2] += 16 >> (s->chroma_x_shift + lowres);
-
- MPV_decode_mb(s, s->block);
-
- if (++s->mb_x >= s->mb_width) {
- const int mb_size= 16>>s->avctx->lowres;
-
- ff_draw_horiz_band(s, mb_size*s->mb_y, mb_size);
-
- s->mb_x = 0;
- s->mb_y++;
-
- if(s->mb_y<<field_pic >= s->mb_height){
- int left= s->gb.size_in_bits - get_bits_count(&s->gb);
- int is_d10= s->chroma_format==2 && s->pict_type==I_TYPE && avctx->profile==0 && avctx->level==5
- && s->intra_dc_precision == 2 && s->q_scale_type == 1 && s->alternate_scan == 0
- && s->progressive_frame == 0 /* vbv_delay == 0xBBB || 0xE10*/;
-
- if(left < 0 || (left && show_bits(&s->gb, FFMIN(left, 23)) && !is_d10)
- || (avctx->error_resilience >= FF_ER_AGGRESSIVE && left>8)){
- av_log(avctx, AV_LOG_ERROR, "end mismatch left=%d %0X\n", left, show_bits(&s->gb, FFMIN(left, 23)));
- return -1;
- }else
- goto eos;
- }
-
- ff_init_block_index(s);
- }
-
- /* skip mb handling */
- if (s->mb_skip_run == -1) {
- /* read again increment */
- s->mb_skip_run = 0;
- for(;;) {
- int code = get_vlc2(&s->gb, mbincr_vlc.table, MBINCR_VLC_BITS, 2);
- if (code < 0){
- av_log(s->avctx, AV_LOG_ERROR, "mb incr damaged\n");
- return -1;
- }
- if (code >= 33) {
- if (code == 33) {
- s->mb_skip_run += 33;
- }else if(code == 35){
- if(s->mb_skip_run != 0 || show_bits(&s->gb, 15) != 0){
- av_log(s->avctx, AV_LOG_ERROR, "slice mismatch\n");
- return -1;
- }
- goto eos; /* end of slice */
- }
- /* otherwise, stuffing, nothing to do */
- } else {
- s->mb_skip_run += code;
- break;
- }
- }
- }
- }
-eos: // end of slice
- *buf += get_bits_count(&s->gb)/8 - 1;
-//printf("y %d %d %d %d\n", s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y);
- return 0;
-}
-
-static int slice_decode_thread(AVCodecContext *c, void *arg){
- MpegEncContext *s= arg;
- const uint8_t *buf= s->gb.buffer;
- int mb_y= s->start_mb_y;
-
- s->error_count= 3*(s->end_mb_y - s->start_mb_y)*s->mb_width;
-
- for(;;){
- uint32_t start_code;
- int ret;
-
- ret= mpeg_decode_slice((Mpeg1Context*)s, mb_y, &buf, s->gb.buffer_end - buf);
- emms_c();
-//av_log(c, AV_LOG_DEBUG, "ret:%d resync:%d/%d mb:%d/%d ts:%d/%d ec:%d\n",
-//ret, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, s->start_mb_y, s->end_mb_y, s->error_count);
- if(ret < 0){
- if(s->resync_mb_x>=0 && s->resync_mb_y>=0)
- ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, AC_ERROR|DC_ERROR|MV_ERROR);
- }else{
- ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, AC_END|DC_END|MV_END);
- }
-
- if(s->mb_y == s->end_mb_y)
- return 0;
-
- start_code= -1;
- buf = ff_find_start_code(buf, s->gb.buffer_end, &start_code);
- mb_y= start_code - SLICE_MIN_START_CODE;
- if(mb_y < 0 || mb_y >= s->end_mb_y)
- return -1;
- }
-
- return 0; //not reached
-}
-
-/**
- * handles slice ends.
- * @return 1 if it seems to be the last slice of
- */
-static int slice_end(AVCodecContext *avctx, AVFrame *pict)
-{
- Mpeg1Context *s1 = avctx->priv_data;
- MpegEncContext *s = &s1->mpeg_enc_ctx;
-
- if (!s1->mpeg_enc_ctx_allocated || !s->current_picture_ptr)
- return 0;
-
-#ifdef HAVE_XVMC
- if(s->avctx->xvmc_acceleration)
- XVMC_field_end(s);
-#endif
- /* end of slice reached */
- if (/*s->mb_y<<field_pic == s->mb_height &&*/ !s->first_field) {
- /* end of image */
-
- s->current_picture_ptr->qscale_type= FF_QSCALE_TYPE_MPEG2;
-
- ff_er_frame_end(s);
-
- MPV_frame_end(s);
-
- if (s->pict_type == B_TYPE || s->low_delay) {
- *pict= *(AVFrame*)s->current_picture_ptr;
- ff_print_debug_info(s, pict);
- } else {
- s->picture_number++;
- /* latency of 1 frame for I and P frames */
- /* XXX: use another variable than picture_number */
- if (s->last_picture_ptr != NULL) {
- *pict= *(AVFrame*)s->last_picture_ptr;
- ff_print_debug_info(s, pict);
- }
- }
-
- return 1;
- } else {
- return 0;
- }
-}
-
-static int mpeg1_decode_sequence(AVCodecContext *avctx,
- const uint8_t *buf, int buf_size)
-{
- Mpeg1Context *s1 = avctx->priv_data;
- MpegEncContext *s = &s1->mpeg_enc_ctx;
- int width,height;
- int i, v, j;
-
- init_get_bits(&s->gb, buf, buf_size*8);
-
- width = get_bits(&s->gb, 12);
- height = get_bits(&s->gb, 12);
- if (width <= 0 || height <= 0 ||
- (width % 2) != 0 || (height % 2) != 0)
- return -1;
- s->aspect_ratio_info= get_bits(&s->gb, 4);
- if (s->aspect_ratio_info == 0)
- return -1;
- s->frame_rate_index = get_bits(&s->gb, 4);
- if (s->frame_rate_index == 0 || s->frame_rate_index > 13)
- return -1;
- s->bit_rate = get_bits(&s->gb, 18) * 400;
- if (get_bits1(&s->gb) == 0) /* marker */
- return -1;
- s->width = width;
- s->height = height;
-
- s->avctx->rc_buffer_size= get_bits(&s->gb, 10) * 1024*16;
- skip_bits(&s->gb, 1);
-
- /* get matrix */
- if (get_bits1(&s->gb)) {
- for(i=0;i<64;i++) {
- v = get_bits(&s->gb, 8);
- if(v==0){
- av_log(s->avctx, AV_LOG_ERROR, "intra matrix damaged\n");
- return -1;
- }
- j = s->dsp.idct_permutation[ ff_zigzag_direct[i] ];
- s->intra_matrix[j] = v;
- s->chroma_intra_matrix[j] = v;
- }
-#ifdef DEBUG
- dprintf("intra matrix present\n");
- for(i=0;i<64;i++)
- dprintf(" %d", s->intra_matrix[s->dsp.idct_permutation[i]]);
- dprintf("\n");
-#endif
- } else {
- for(i=0;i<64;i++) {
- j = s->dsp.idct_permutation[i];
- v = ff_mpeg1_default_intra_matrix[i];
- s->intra_matrix[j] = v;
- s->chroma_intra_matrix[j] = v;
- }
- }
- if (get_bits1(&s->gb)) {
- for(i=0;i<64;i++) {
- v = get_bits(&s->gb, 8);
- if(v==0){
- av_log(s->avctx, AV_LOG_ERROR, "inter matrix damaged\n");
- return -1;
- }
- j = s->dsp.idct_permutation[ ff_zigzag_direct[i] ];
- s->inter_matrix[j] = v;
- s->chroma_inter_matrix[j] = v;
- }
-#ifdef DEBUG
- dprintf("non intra matrix present\n");
- for(i=0;i<64;i++)
- dprintf(" %d", s->inter_matrix[s->dsp.idct_permutation[i]]);
- dprintf("\n");
-#endif
- } else {
- for(i=0;i<64;i++) {
- int j= s->dsp.idct_permutation[i];
- v = ff_mpeg1_default_non_intra_matrix[i];
- s->inter_matrix[j] = v;
- s->chroma_inter_matrix[j] = v;
- }
- }
-
- if(show_bits(&s->gb, 23) != 0){
- av_log(s->avctx, AV_LOG_ERROR, "sequence header damaged\n");
- return -1;
- }
-
- /* we set mpeg2 parameters so that it emulates mpeg1 */
- s->progressive_sequence = 1;
- s->progressive_frame = 1;
- s->picture_structure = PICT_FRAME;
- s->frame_pred_frame_dct = 1;
- s->chroma_format = 1;
- s->codec_id= s->avctx->codec_id= CODEC_ID_MPEG1VIDEO;
- avctx->sub_id = 1; /* indicates mpeg1 */
- s->out_format = FMT_MPEG1;
- s->swap_uv = 0;//AFAIK VCR2 don't have SEQ_HEADER
- if(s->flags & CODEC_FLAG_LOW_DELAY) s->low_delay=1;
-
- if(s->avctx->debug & FF_DEBUG_PICT_INFO)
- av_log(s->avctx, AV_LOG_DEBUG, "vbv buffer: %d, bitrate:%d\n",
- s->avctx->rc_buffer_size, s->bit_rate);
-
- return 0;
-}
-
-static int vcr2_init_sequence(AVCodecContext *avctx)
-{
- Mpeg1Context *s1 = avctx->priv_data;
- MpegEncContext *s = &s1->mpeg_enc_ctx;
- int i, v;
-
- /* start new mpeg1 context decoding */
- s->out_format = FMT_MPEG1;
- if (s1->mpeg_enc_ctx_allocated) {
- MPV_common_end(s);
- }
- s->width = avctx->coded_width;
- s->height = avctx->coded_height;
- avctx->has_b_frames= 0; //true?
- s->low_delay= 1;
-
- if(avctx->xvmc_acceleration){
- avctx->pix_fmt = avctx->get_format(avctx,pixfmt_xvmc_mpg2_420);
- }else{
- avctx->pix_fmt = avctx->get_format(avctx,pixfmt_yuv_420);
- }
-
- if( avctx->pix_fmt == PIX_FMT_XVMC_MPEG2_IDCT )
- if( avctx->idct_algo == FF_IDCT_AUTO )
- avctx->idct_algo = FF_IDCT_SIMPLE;
-
- if (MPV_common_init(s) < 0)
- return -1;
- exchange_uv(s);//common init reset pblocks, so we swap them here
- s->swap_uv = 1;// in case of xvmc we need to swap uv for each MB
- s1->mpeg_enc_ctx_allocated = 1;
-
- for(i=0;i<64;i++) {
- int j= s->dsp.idct_permutation[i];
- v = ff_mpeg1_default_intra_matrix[i];
- s->intra_matrix[j] = v;
- s->chroma_intra_matrix[j] = v;
-
- v = ff_mpeg1_default_non_intra_matrix[i];
- s->inter_matrix[j] = v;
- s->chroma_inter_matrix[j] = v;
- }
-
- s->progressive_sequence = 1;
- s->progressive_frame = 1;
- s->picture_structure = PICT_FRAME;
- s->frame_pred_frame_dct = 1;
- s->chroma_format = 1;
- s->codec_id= s->avctx->codec_id= CODEC_ID_MPEG2VIDEO;
- avctx->sub_id = 2; /* indicates mpeg2 */
- return 0;
-}
-
-
-static void mpeg_decode_user_data(AVCodecContext *avctx,
- const uint8_t *buf, int buf_size)
-{
- const uint8_t *p;
- int len, flags;
- p = buf;
- len = buf_size;
-
- /* we parse the DTG active format information */
- if (len >= 5 &&
- p[0] == 'D' && p[1] == 'T' && p[2] == 'G' && p[3] == '1') {
- flags = p[4];
- p += 5;
- len -= 5;
- if (flags & 0x80) {
- /* skip event id */
- if (len < 2)
- return;
- p += 2;
- len -= 2;
- }
- if (flags & 0x40) {
- if (len < 1)
- return;
- avctx->dtg_active_format = p[0] & 0x0f;
- }
- }
-}
-
-static void mpeg_decode_gop(AVCodecContext *avctx,
- const uint8_t *buf, int buf_size){
- Mpeg1Context *s1 = avctx->priv_data;
- MpegEncContext *s = &s1->mpeg_enc_ctx;
-
- int drop_frame_flag;
- int time_code_hours, time_code_minutes;
- int time_code_seconds, time_code_pictures;
- int broken_link;
-
- init_get_bits(&s->gb, buf, buf_size*8);
-
- drop_frame_flag = get_bits1(&s->gb);
-
- time_code_hours=get_bits(&s->gb,5);
- time_code_minutes = get_bits(&s->gb,6);
- skip_bits1(&s->gb);//marker bit
- time_code_seconds = get_bits(&s->gb,6);
- time_code_pictures = get_bits(&s->gb,6);
-
- /*broken_link indicate that after editing the
- reference frames of the first B-Frames after GOP I-Frame
- are missing (open gop)*/
- broken_link = get_bits1(&s->gb);
-
- if(s->avctx->debug & FF_DEBUG_PICT_INFO)
- av_log(s->avctx, AV_LOG_DEBUG, "GOP (%2d:%02d:%02d.[%02d]) broken_link=%d\n",
- time_code_hours, time_code_minutes, time_code_seconds,
- time_code_pictures, broken_link);
-}
-/**
- * finds the end of the current frame in the bitstream.
- * @return the position of the first byte of the next frame, or -1
- */
-static int mpeg1_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size)
-{
- int i;
- uint32_t state= pc->state;
-
- i=0;
- if(!pc->frame_start_found){
- for(i=0; i<buf_size; i++){
- i= ff_find_start_code(buf+i, buf+buf_size, &state) - buf - 1;
- if(state >= SLICE_MIN_START_CODE && state <= SLICE_MAX_START_CODE){
- i++;
- pc->frame_start_found=1;
- break;
- }
- }
- }
-
- if(pc->frame_start_found){
- /* EOF considered as end of frame */
- if (buf_size == 0)
- return 0;
- for(; i<buf_size; i++){
- i= ff_find_start_code(buf+i, buf+buf_size, &state) - buf - 1;
- if((state&0xFFFFFF00) == 0x100){
- if(state < SLICE_MIN_START_CODE || state > SLICE_MAX_START_CODE){
- pc->frame_start_found=0;
- pc->state=-1;
- return i-3;
- }
- }
- }
- }
- pc->state= state;
- return END_NOT_FOUND;
-}
-
-/* handle buffering and image synchronisation */
-static int mpeg_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- Mpeg1Context *s = avctx->priv_data;
- const uint8_t *buf_end;
- const uint8_t *buf_ptr;
- uint32_t start_code;
- int ret, input_size;
- AVFrame *picture = data;
- MpegEncContext *s2 = &s->mpeg_enc_ctx;
- dprintf("fill_buffer\n");
-
- if (buf_size == 0) {
- /* special case for last picture */
- if (s2->low_delay==0 && s2->next_picture_ptr) {
- *picture= *(AVFrame*)s2->next_picture_ptr;
- s2->next_picture_ptr= NULL;
-
- *data_size = sizeof(AVFrame);
- }
- return 0;
- }
-
- if(s2->flags&CODEC_FLAG_TRUNCATED){
- int next= mpeg1_find_frame_end(&s2->parse_context, buf, buf_size);
-
- if( ff_combine_frame(&s2->parse_context, next, &buf, &buf_size) < 0 )
- return buf_size;
- }
-
- buf_ptr = buf;
- buf_end = buf + buf_size;
-
-#if 0
- if (s->repeat_field % 2 == 1) {
- s->repeat_field++;
- //fprintf(stderr,"\nRepeating last frame: %d -> %d! pict: %d %d", avctx->frame_number-1, avctx->frame_number,
- // s2->picture_number, s->repeat_field);
- if (avctx->flags & CODEC_FLAG_REPEAT_FIELD) {
- *data_size = sizeof(AVPicture);
- goto the_end;
- }
- }
-#endif
-
- if(s->mpeg_enc_ctx_allocated==0 && avctx->codec_tag == ff_get_fourcc("VCR2"))
- vcr2_init_sequence(avctx);
-
- s->slice_count= 0;
-
- for(;;) {
- /* find start next code */
- start_code = -1;
- buf_ptr = ff_find_start_code(buf_ptr,buf_end, &start_code);
- if (start_code > 0x1ff){
- if(s2->pict_type != B_TYPE || avctx->skip_frame <= AVDISCARD_DEFAULT){
- if(avctx->thread_count > 1){
- int i;
-
- avctx->execute(avctx, slice_decode_thread, (void**)&(s2->thread_context[0]), NULL, s->slice_count);
- for(i=0; i<s->slice_count; i++)
- s2->error_count += s2->thread_context[i]->error_count;
- }
- if (slice_end(avctx, picture)) {
- if(s2->last_picture_ptr || s2->low_delay) //FIXME merge with the stuff in mpeg_decode_slice
- *data_size = sizeof(AVPicture);
- }
- }
- return FFMAX(0, buf_ptr - buf - s2->parse_context.last_index);
- }
-
- input_size = buf_end - buf_ptr;
-
- if(avctx->debug & FF_DEBUG_STARTCODE){
- av_log(avctx, AV_LOG_DEBUG, "%3X at %zd left %d\n", start_code, buf_ptr-buf, input_size);
- }
-
- /* prepare data for next start code */
- switch(start_code) {
- case SEQ_START_CODE:
- mpeg1_decode_sequence(avctx, buf_ptr,
- input_size);
- break;
-
- case PICTURE_START_CODE:
- /* we have a complete image : we try to decompress it */
- mpeg1_decode_picture(avctx,
- buf_ptr, input_size);
- break;
- case EXT_START_CODE:
- mpeg_decode_extension(avctx,
- buf_ptr, input_size);
- break;
- case USER_START_CODE:
- mpeg_decode_user_data(avctx,
- buf_ptr, input_size);
- break;
- case GOP_START_CODE:
- s2->first_field=0;
- mpeg_decode_gop(avctx,
- buf_ptr, input_size);
- break;
- default:
- if (start_code >= SLICE_MIN_START_CODE &&
- start_code <= SLICE_MAX_START_CODE) {
- int mb_y= start_code - SLICE_MIN_START_CODE;
-
- if(s2->last_picture_ptr==NULL){
- /* skip b frames if we dont have reference frames */
- if(s2->pict_type==B_TYPE) break;
- /* skip P frames if we dont have reference frame no valid header */
-// if(s2->pict_type==P_TYPE && s2->first_field && !s2->first_slice) break;
- }
- /* skip b frames if we are in a hurry */
- if(avctx->hurry_up && s2->pict_type==B_TYPE) break;
- if( (avctx->skip_frame >= AVDISCARD_NONREF && s2->pict_type==B_TYPE)
- ||(avctx->skip_frame >= AVDISCARD_NONKEY && s2->pict_type!=I_TYPE)
- || avctx->skip_frame >= AVDISCARD_ALL)
- break;
- /* skip everything if we are in a hurry>=5 */
- if(avctx->hurry_up>=5) break;
-
- if (!s->mpeg_enc_ctx_allocated) break;
-
- if(s2->codec_id == CODEC_ID_MPEG2VIDEO){
- if(mb_y < avctx->skip_top || mb_y >= s2->mb_height - avctx->skip_bottom)
- break;
- }
-
- if(s2->first_slice){
- s2->first_slice=0;
- if(mpeg_field_start(s2) < 0)
- return -1;
- }
- if(!s2->current_picture_ptr){
- av_log(avctx, AV_LOG_ERROR, "current_picture not initalized\n");
- return -1;
- }
-
- if(avctx->thread_count > 1){
- int threshold= (s2->mb_height*s->slice_count + avctx->thread_count/2) / avctx->thread_count;
- if(threshold <= mb_y){
- MpegEncContext *thread_context= s2->thread_context[s->slice_count];
-
- thread_context->start_mb_y= mb_y;
- thread_context->end_mb_y = s2->mb_height;
- if(s->slice_count){
- s2->thread_context[s->slice_count-1]->end_mb_y= mb_y;
- ff_update_duplicate_context(thread_context, s2);
- }
- init_get_bits(&thread_context->gb, buf_ptr, input_size*8);
- s->slice_count++;
- }
- buf_ptr += 2; //FIXME add minimum num of bytes per slice
- }else{
- ret = mpeg_decode_slice(s, mb_y, &buf_ptr, input_size);
- emms_c();
-
- if(ret < 0){
- if(s2->resync_mb_x>=0 && s2->resync_mb_y>=0)
- ff_er_add_slice(s2, s2->resync_mb_x, s2->resync_mb_y, s2->mb_x, s2->mb_y, AC_ERROR|DC_ERROR|MV_ERROR);
- }else{
- ff_er_add_slice(s2, s2->resync_mb_x, s2->resync_mb_y, s2->mb_x-1, s2->mb_y, AC_END|DC_END|MV_END);
- }
- }
- }
- break;
- }
- }
-}
-
-static int mpeg_decode_end(AVCodecContext *avctx)
-{
- Mpeg1Context *s = avctx->priv_data;
-
- if (s->mpeg_enc_ctx_allocated)
- MPV_common_end(&s->mpeg_enc_ctx);
- return 0;
-}
-
-AVCodec mpeg1video_decoder = {
- "mpeg1video",
- CODEC_TYPE_VIDEO,
- CODEC_ID_MPEG1VIDEO,
- sizeof(Mpeg1Context),
- mpeg_decode_init,
- NULL,
- mpeg_decode_end,
- mpeg_decode_frame,
- CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY,
- .flush= ff_mpeg_flush,
-};
-
-AVCodec mpeg2video_decoder = {
- "mpeg2video",
- CODEC_TYPE_VIDEO,
- CODEC_ID_MPEG2VIDEO,
- sizeof(Mpeg1Context),
- mpeg_decode_init,
- NULL,
- mpeg_decode_end,
- mpeg_decode_frame,
- CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY,
- .flush= ff_mpeg_flush,
-};
-
-//legacy decoder
-AVCodec mpegvideo_decoder = {
- "mpegvideo",
- CODEC_TYPE_VIDEO,
- CODEC_ID_MPEG2VIDEO,
- sizeof(Mpeg1Context),
- mpeg_decode_init,
- NULL,
- mpeg_decode_end,
- mpeg_decode_frame,
- CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY,
- .flush= ff_mpeg_flush,
-};
-
-#ifdef CONFIG_ENCODERS
-
-AVCodec mpeg1video_encoder = {
- "mpeg1video",
- CODEC_TYPE_VIDEO,
- CODEC_ID_MPEG1VIDEO,
- sizeof(MpegEncContext),
- encode_init,
- MPV_encode_picture,
- MPV_encode_end,
- .supported_framerates= ff_frame_rate_tab+1,
- .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV420P, -1},
- .capabilities= CODEC_CAP_DELAY,
-};
-
-AVCodec mpeg2video_encoder = {
- "mpeg2video",
- CODEC_TYPE_VIDEO,
- CODEC_ID_MPEG2VIDEO,
- sizeof(MpegEncContext),
- encode_init,
- MPV_encode_picture,
- MPV_encode_end,
- .supported_framerates= ff_frame_rate_tab+1,
- .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_YUV422P, -1},
- .capabilities= CODEC_CAP_DELAY,
-};
-#endif
-
-#ifdef HAVE_XVMC
-static int mpeg_mc_decode_init(AVCodecContext *avctx){
- Mpeg1Context *s;
-
- if( avctx->thread_count > 1)
- return -1;
- if( !(avctx->slice_flags & SLICE_FLAG_CODED_ORDER) )
- return -1;
- if( !(avctx->slice_flags & SLICE_FLAG_ALLOW_FIELD) ){
- dprintf("mpeg12.c: XvMC decoder will work better if SLICE_FLAG_ALLOW_FIELD is set\n");
- }
- mpeg_decode_init(avctx);
- s = avctx->priv_data;
-
- avctx->pix_fmt = PIX_FMT_XVMC_MPEG2_IDCT;
- avctx->xvmc_acceleration = 2;//2 - the blocks are packed!
-
- return 0;
-}
-
-AVCodec mpeg_xvmc_decoder = {
- "mpegvideo_xvmc",
- CODEC_TYPE_VIDEO,
- CODEC_ID_MPEG2VIDEO_XVMC,
- sizeof(Mpeg1Context),
- mpeg_mc_decode_init,
- NULL,
- mpeg_decode_end,
- mpeg_decode_frame,
- CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED| CODEC_CAP_HWACCEL | CODEC_CAP_DELAY,
- .flush= ff_mpeg_flush,
-};
-
-#endif
-
-#ifdef CONFIG_MPEGVIDEO_PARSER
-static void mpegvideo_extract_headers(AVCodecParserContext *s,
- AVCodecContext *avctx,
- const uint8_t *buf, int buf_size)
-{
- ParseContext1 *pc = s->priv_data;
- const uint8_t *buf_end;
- uint32_t start_code;
- int frame_rate_index, ext_type, bytes_left;
- int frame_rate_ext_n, frame_rate_ext_d;
- int picture_structure, top_field_first, repeat_first_field, progressive_frame;
- int horiz_size_ext, vert_size_ext, bit_rate_ext;
-//FIXME replace the crap with get_bits()
- s->repeat_pict = 0;
- buf_end = buf + buf_size;
- while (buf < buf_end) {
- start_code= -1;
- buf= ff_find_start_code(buf, buf_end, &start_code);
- bytes_left = buf_end - buf;
- switch(start_code) {
- case PICTURE_START_CODE:
- if (bytes_left >= 2) {
- s->pict_type = (buf[1] >> 3) & 7;
- }
- break;
- case SEQ_START_CODE:
- if (bytes_left >= 7) {
- pc->width = (buf[0] << 4) | (buf[1] >> 4);
- pc->height = ((buf[1] & 0x0f) << 8) | buf[2];
- avcodec_set_dimensions(avctx, pc->width, pc->height);
- frame_rate_index = buf[3] & 0xf;
- pc->frame_rate.den = avctx->time_base.den = ff_frame_rate_tab[frame_rate_index].num;
- pc->frame_rate.num = avctx->time_base.num = ff_frame_rate_tab[frame_rate_index].den;
- avctx->bit_rate = ((buf[4]<<10) | (buf[5]<<2) | (buf[6]>>6))*400;
- avctx->codec_id = CODEC_ID_MPEG1VIDEO;
- avctx->sub_id = 1;
- }
- break;
- case EXT_START_CODE:
- if (bytes_left >= 1) {
- ext_type = (buf[0] >> 4);
- switch(ext_type) {
- case 0x1: /* sequence extension */
- if (bytes_left >= 6) {
- horiz_size_ext = ((buf[1] & 1) << 1) | (buf[2] >> 7);
- vert_size_ext = (buf[2] >> 5) & 3;
- bit_rate_ext = ((buf[2] & 0x1F)<<7) | (buf[3]>>1);
- frame_rate_ext_n = (buf[5] >> 5) & 3;
- frame_rate_ext_d = (buf[5] & 0x1f);
- pc->progressive_sequence = buf[1] & (1 << 3);
- avctx->has_b_frames= !(buf[5] >> 7);
-
- pc->width |=(horiz_size_ext << 12);
- pc->height |=( vert_size_ext << 12);
- avctx->bit_rate += (bit_rate_ext << 18) * 400;
- avcodec_set_dimensions(avctx, pc->width, pc->height);
- avctx->time_base.den = pc->frame_rate.den * (frame_rate_ext_n + 1);
- avctx->time_base.num = pc->frame_rate.num * (frame_rate_ext_d + 1);
- avctx->codec_id = CODEC_ID_MPEG2VIDEO;
- avctx->sub_id = 2; /* forces MPEG2 */
- }
- break;
- case 0x8: /* picture coding extension */
- if (bytes_left >= 5) {
- picture_structure = buf[2]&3;
- top_field_first = buf[3] & (1 << 7);
- repeat_first_field = buf[3] & (1 << 1);
- progressive_frame = buf[4] & (1 << 7);
-
- /* check if we must repeat the frame */
- if (repeat_first_field) {
- if (pc->progressive_sequence) {
- if (top_field_first)
- s->repeat_pict = 4;
- else
- s->repeat_pict = 2;
- } else if (progressive_frame) {
- s->repeat_pict = 1;
- }
- }
-
- /* the packet only represents half a frame
- XXX,FIXME maybe find a different solution */
- if(picture_structure != 3)
- s->repeat_pict = -1;
- }
- break;
- }
- }
- break;
- case -1:
- goto the_end;
- default:
- /* we stop parsing when we encounter a slice. It ensures
- that this function takes a negligible amount of time */
- if (start_code >= SLICE_MIN_START_CODE &&
- start_code <= SLICE_MAX_START_CODE)
- goto the_end;
- break;
- }
- }
- the_end: ;
-}
-
-static int mpegvideo_parse(AVCodecParserContext *s,
- AVCodecContext *avctx,
- uint8_t **poutbuf, int *poutbuf_size,
- const uint8_t *buf, int buf_size)
-{
- ParseContext1 *pc1 = s->priv_data;
- ParseContext *pc= &pc1->pc;
- int next;
-
- if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){
- next= buf_size;
- }else{
- next= mpeg1_find_frame_end(pc, buf, buf_size);
-
- if (ff_combine_frame(pc, next, (uint8_t **)&buf, &buf_size) < 0) {
- *poutbuf = NULL;
- *poutbuf_size = 0;
- return buf_size;
- }
-
- }
- /* we have a full frame : we just parse the first few MPEG headers
- to have the full timing information. The time take by this
- function should be negligible for uncorrupted streams */
- mpegvideo_extract_headers(s, avctx, buf, buf_size);
-#if 0
- printf("pict_type=%d frame_rate=%0.3f repeat_pict=%d\n",
- s->pict_type, (double)avctx->time_base.den / avctx->time_base.num, s->repeat_pict);
-#endif
-
- *poutbuf = (uint8_t *)buf;
- *poutbuf_size = buf_size;
- return next;
-}
-
-static int mpegvideo_split(AVCodecContext *avctx,
- const uint8_t *buf, int buf_size)
-{
- int i;
- uint32_t state= -1;
-
- for(i=0; i<buf_size; i++){
- state= (state<<8) | buf[i];
- if(state != 0x1B3 && state != 0x1B5 && state < 0x200 && state >= 0x100)
- return i-3;
- }
- return 0;
-}
-
-AVCodecParser mpegvideo_parser = {
- { CODEC_ID_MPEG1VIDEO, CODEC_ID_MPEG2VIDEO },
- sizeof(ParseContext1),
- NULL,
- mpegvideo_parse,
- ff_parse1_close,
- mpegvideo_split,
-};
-#endif /* !CONFIG_MPEGVIDEO_PARSER */
-
-/* this is ugly i know, but the alternative is too make
- hundreds of vars global and prefix them with ff_mpeg1_
- which is far uglier. */
-#include "mdec.c"
diff --git a/src/libffmpeg/libavcodec/mpeg12data.h b/src/libffmpeg/libavcodec/mpeg12data.h
deleted file mode 100644
index 6c96a495b..000000000
--- a/src/libffmpeg/libavcodec/mpeg12data.h
+++ /dev/null
@@ -1,469 +0,0 @@
-/*
- * MPEG1 codec / MPEG2 decoder
- * copyright (c) 2000,2001 Fabrice Bellard
- * copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file mpeg12data.h
- * MPEG1/2 tables.
- */
-
-const uint16_t ff_mpeg1_default_intra_matrix[64] = {
- 8, 16, 19, 22, 26, 27, 29, 34,
- 16, 16, 22, 24, 27, 29, 34, 37,
- 19, 22, 26, 27, 29, 34, 34, 38,
- 22, 22, 26, 27, 29, 34, 37, 40,
- 22, 26, 27, 29, 32, 35, 40, 48,
- 26, 27, 29, 32, 35, 40, 48, 58,
- 26, 27, 29, 34, 38, 46, 56, 69,
- 27, 29, 35, 38, 46, 56, 69, 83
-};
-
-const uint16_t ff_mpeg1_default_non_intra_matrix[64] = {
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
-};
-
-static const uint16_t vlc_dc_lum_code[12] = {
- 0x4, 0x0, 0x1, 0x5, 0x6, 0xe, 0x1e, 0x3e, 0x7e, 0xfe, 0x1fe, 0x1ff,
-};
-static const unsigned char vlc_dc_lum_bits[12] = {
- 3, 2, 2, 3, 3, 4, 5, 6, 7, 8, 9, 9,
-};
-
-static const uint16_t vlc_dc_chroma_code[12] = {
- 0x0, 0x1, 0x2, 0x6, 0xe, 0x1e, 0x3e, 0x7e, 0xfe, 0x1fe, 0x3fe, 0x3ff,
-};
-static const unsigned char vlc_dc_chroma_bits[12] = {
- 2, 2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10,
-};
-
-static const uint16_t mpeg1_vlc[113][2] = {
- { 0x3, 2 }, { 0x4, 4 }, { 0x5, 5 }, { 0x6, 7 },
- { 0x26, 8 }, { 0x21, 8 }, { 0xa, 10 }, { 0x1d, 12 },
- { 0x18, 12 }, { 0x13, 12 }, { 0x10, 12 }, { 0x1a, 13 },
- { 0x19, 13 }, { 0x18, 13 }, { 0x17, 13 }, { 0x1f, 14 },
- { 0x1e, 14 }, { 0x1d, 14 }, { 0x1c, 14 }, { 0x1b, 14 },
- { 0x1a, 14 }, { 0x19, 14 }, { 0x18, 14 }, { 0x17, 14 },
- { 0x16, 14 }, { 0x15, 14 }, { 0x14, 14 }, { 0x13, 14 },
- { 0x12, 14 }, { 0x11, 14 }, { 0x10, 14 }, { 0x18, 15 },
- { 0x17, 15 }, { 0x16, 15 }, { 0x15, 15 }, { 0x14, 15 },
- { 0x13, 15 }, { 0x12, 15 }, { 0x11, 15 }, { 0x10, 15 },
- { 0x3, 3 }, { 0x6, 6 }, { 0x25, 8 }, { 0xc, 10 },
- { 0x1b, 12 }, { 0x16, 13 }, { 0x15, 13 }, { 0x1f, 15 },
- { 0x1e, 15 }, { 0x1d, 15 }, { 0x1c, 15 }, { 0x1b, 15 },
- { 0x1a, 15 }, { 0x19, 15 }, { 0x13, 16 }, { 0x12, 16 },
- { 0x11, 16 }, { 0x10, 16 }, { 0x5, 4 }, { 0x4, 7 },
- { 0xb, 10 }, { 0x14, 12 }, { 0x14, 13 }, { 0x7, 5 },
- { 0x24, 8 }, { 0x1c, 12 }, { 0x13, 13 }, { 0x6, 5 },
- { 0xf, 10 }, { 0x12, 12 }, { 0x7, 6 }, { 0x9, 10 },
- { 0x12, 13 }, { 0x5, 6 }, { 0x1e, 12 }, { 0x14, 16 },
- { 0x4, 6 }, { 0x15, 12 }, { 0x7, 7 }, { 0x11, 12 },
- { 0x5, 7 }, { 0x11, 13 }, { 0x27, 8 }, { 0x10, 13 },
- { 0x23, 8 }, { 0x1a, 16 }, { 0x22, 8 }, { 0x19, 16 },
- { 0x20, 8 }, { 0x18, 16 }, { 0xe, 10 }, { 0x17, 16 },
- { 0xd, 10 }, { 0x16, 16 }, { 0x8, 10 }, { 0x15, 16 },
- { 0x1f, 12 }, { 0x1a, 12 }, { 0x19, 12 }, { 0x17, 12 },
- { 0x16, 12 }, { 0x1f, 13 }, { 0x1e, 13 }, { 0x1d, 13 },
- { 0x1c, 13 }, { 0x1b, 13 }, { 0x1f, 16 }, { 0x1e, 16 },
- { 0x1d, 16 }, { 0x1c, 16 }, { 0x1b, 16 },
- { 0x1, 6 }, /* escape */
- { 0x2, 2 }, /* EOB */
-};
-
-static const uint16_t mpeg2_vlc[113][2] = {
- {0x02, 2}, {0x06, 3}, {0x07, 4}, {0x1c, 5},
- {0x1d, 5}, {0x05, 6}, {0x04, 6}, {0x7b, 7},
- {0x7c, 7}, {0x23, 8}, {0x22, 8}, {0xfa, 8},
- {0xfb, 8}, {0xfe, 8}, {0xff, 8}, {0x1f,14},
- {0x1e,14}, {0x1d,14}, {0x1c,14}, {0x1b,14},
- {0x1a,14}, {0x19,14}, {0x18,14}, {0x17,14},
- {0x16,14}, {0x15,14}, {0x14,14}, {0x13,14},
- {0x12,14}, {0x11,14}, {0x10,14}, {0x18,15},
- {0x17,15}, {0x16,15}, {0x15,15}, {0x14,15},
- {0x13,15}, {0x12,15}, {0x11,15}, {0x10,15},
- {0x02, 3}, {0x06, 5}, {0x79, 7}, {0x27, 8},
- {0x20, 8}, {0x16,13}, {0x15,13}, {0x1f,15},
- {0x1e,15}, {0x1d,15}, {0x1c,15}, {0x1b,15},
- {0x1a,15}, {0x19,15}, {0x13,16}, {0x12,16},
- {0x11,16}, {0x10,16}, {0x05, 5}, {0x07, 7},
- {0xfc, 8}, {0x0c,10}, {0x14,13}, {0x07, 5},
- {0x26, 8}, {0x1c,12}, {0x13,13}, {0x06, 6},
- {0xfd, 8}, {0x12,12}, {0x07, 6}, {0x04, 9},
- {0x12,13}, {0x06, 7}, {0x1e,12}, {0x14,16},
- {0x04, 7}, {0x15,12}, {0x05, 7}, {0x11,12},
- {0x78, 7}, {0x11,13}, {0x7a, 7}, {0x10,13},
- {0x21, 8}, {0x1a,16}, {0x25, 8}, {0x19,16},
- {0x24, 8}, {0x18,16}, {0x05, 9}, {0x17,16},
- {0x07, 9}, {0x16,16}, {0x0d,10}, {0x15,16},
- {0x1f,12}, {0x1a,12}, {0x19,12}, {0x17,12},
- {0x16,12}, {0x1f,13}, {0x1e,13}, {0x1d,13},
- {0x1c,13}, {0x1b,13}, {0x1f,16}, {0x1e,16},
- {0x1d,16}, {0x1c,16}, {0x1b,16},
- {0x01,6}, /* escape */
- {0x06,4}, /* EOB */
-};
-
-static const int8_t mpeg1_level[111] = {
- 1, 2, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, 24,
- 25, 26, 27, 28, 29, 30, 31, 32,
- 33, 34, 35, 36, 37, 38, 39, 40,
- 1, 2, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 1, 2, 3, 4, 5, 1,
- 2, 3, 4, 1, 2, 3, 1, 2,
- 3, 1, 2, 3, 1, 2, 1, 2,
- 1, 2, 1, 2, 1, 2, 1, 2,
- 1, 2, 1, 2, 1, 2, 1, 2,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1,
-};
-
-static const int8_t mpeg1_run[111] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 2, 2, 2, 2, 2, 3,
- 3, 3, 3, 4, 4, 4, 5, 5,
- 5, 6, 6, 6, 7, 7, 8, 8,
- 9, 9, 10, 10, 11, 11, 12, 12,
- 13, 13, 14, 14, 15, 15, 16, 16,
- 17, 18, 19, 20, 21, 22, 23, 24,
- 25, 26, 27, 28, 29, 30, 31,
-};
-
-static RLTable rl_mpeg1 = {
- 111,
- 111,
- mpeg1_vlc,
- mpeg1_run,
- mpeg1_level,
-};
-
-static RLTable rl_mpeg2 = {
- 111,
- 111,
- mpeg2_vlc,
- mpeg1_run,
- mpeg1_level,
-};
-
-static const uint8_t mbAddrIncrTable[36][2] = {
- {0x1, 1},
- {0x3, 3},
- {0x2, 3},
- {0x3, 4},
- {0x2, 4},
- {0x3, 5},
- {0x2, 5},
- {0x7, 7},
- {0x6, 7},
- {0xb, 8},
- {0xa, 8},
- {0x9, 8},
- {0x8, 8},
- {0x7, 8},
- {0x6, 8},
- {0x17, 10},
- {0x16, 10},
- {0x15, 10},
- {0x14, 10},
- {0x13, 10},
- {0x12, 10},
- {0x23, 11},
- {0x22, 11},
- {0x21, 11},
- {0x20, 11},
- {0x1f, 11},
- {0x1e, 11},
- {0x1d, 11},
- {0x1c, 11},
- {0x1b, 11},
- {0x1a, 11},
- {0x19, 11},
- {0x18, 11},
- {0x8, 11}, /* escape */
- {0xf, 11}, /* stuffing */
- {0x0, 8}, /* end (and 15 more 0 bits should follow) */
-};
-
-static const uint8_t mbPatTable[64][2] = {
- {0x1, 9},
- {0xb, 5},
- {0x9, 5},
- {0xd, 6},
- {0xd, 4},
- {0x17, 7},
- {0x13, 7},
- {0x1f, 8},
- {0xc, 4},
- {0x16, 7},
- {0x12, 7},
- {0x1e, 8},
- {0x13, 5},
- {0x1b, 8},
- {0x17, 8},
- {0x13, 8},
- {0xb, 4},
- {0x15, 7},
- {0x11, 7},
- {0x1d, 8},
- {0x11, 5},
- {0x19, 8},
- {0x15, 8},
- {0x11, 8},
- {0xf, 6},
- {0xf, 8},
- {0xd, 8},
- {0x3, 9},
- {0xf, 5},
- {0xb, 8},
- {0x7, 8},
- {0x7, 9},
- {0xa, 4},
- {0x14, 7},
- {0x10, 7},
- {0x1c, 8},
- {0xe, 6},
- {0xe, 8},
- {0xc, 8},
- {0x2, 9},
- {0x10, 5},
- {0x18, 8},
- {0x14, 8},
- {0x10, 8},
- {0xe, 5},
- {0xa, 8},
- {0x6, 8},
- {0x6, 9},
- {0x12, 5},
- {0x1a, 8},
- {0x16, 8},
- {0x12, 8},
- {0xd, 5},
- {0x9, 8},
- {0x5, 8},
- {0x5, 9},
- {0xc, 5},
- {0x8, 8},
- {0x4, 8},
- {0x4, 9},
- {0x7, 3},
- {0xa, 5},
- {0x8, 5},
- {0xc, 6}
-};
-
-#define MB_TYPE_ZERO_MV 0x20000000
-#define IS_ZERO_MV(a) ((a)&MB_TYPE_ZERO_MV)
-
-static const uint8_t table_mb_ptype[7][2] = {
- { 3, 5 }, // 0x01 MB_INTRA
- { 1, 2 }, // 0x02 MB_PAT
- { 1, 3 }, // 0x08 MB_FOR
- { 1, 1 }, // 0x0A MB_FOR|MB_PAT
- { 1, 6 }, // 0x11 MB_QUANT|MB_INTRA
- { 1, 5 }, // 0x12 MB_QUANT|MB_PAT
- { 2, 5 }, // 0x1A MB_QUANT|MB_FOR|MB_PAT
-};
-
-static const uint32_t ptype2mb_type[7] = {
- MB_TYPE_INTRA,
- MB_TYPE_L0 | MB_TYPE_CBP | MB_TYPE_ZERO_MV | MB_TYPE_16x16,
- MB_TYPE_L0,
- MB_TYPE_L0 | MB_TYPE_CBP,
- MB_TYPE_QUANT | MB_TYPE_INTRA,
- MB_TYPE_QUANT | MB_TYPE_L0 | MB_TYPE_CBP | MB_TYPE_ZERO_MV | MB_TYPE_16x16,
- MB_TYPE_QUANT | MB_TYPE_L0 | MB_TYPE_CBP,
-};
-
-static const uint8_t table_mb_btype[11][2] = {
- { 3, 5 }, // 0x01 MB_INTRA
- { 2, 3 }, // 0x04 MB_BACK
- { 3, 3 }, // 0x06 MB_BACK|MB_PAT
- { 2, 4 }, // 0x08 MB_FOR
- { 3, 4 }, // 0x0A MB_FOR|MB_PAT
- { 2, 2 }, // 0x0C MB_FOR|MB_BACK
- { 3, 2 }, // 0x0E MB_FOR|MB_BACK|MB_PAT
- { 1, 6 }, // 0x11 MB_QUANT|MB_INTRA
- { 2, 6 }, // 0x16 MB_QUANT|MB_BACK|MB_PAT
- { 3, 6 }, // 0x1A MB_QUANT|MB_FOR|MB_PAT
- { 2, 5 }, // 0x1E MB_QUANT|MB_FOR|MB_BACK|MB_PAT
-};
-
-static const uint32_t btype2mb_type[11] = {
- MB_TYPE_INTRA,
- MB_TYPE_L1,
- MB_TYPE_L1 | MB_TYPE_CBP,
- MB_TYPE_L0,
- MB_TYPE_L0 | MB_TYPE_CBP,
- MB_TYPE_L0L1,
- MB_TYPE_L0L1 | MB_TYPE_CBP,
- MB_TYPE_QUANT | MB_TYPE_INTRA,
- MB_TYPE_QUANT | MB_TYPE_L1 | MB_TYPE_CBP,
- MB_TYPE_QUANT | MB_TYPE_L0 | MB_TYPE_CBP,
- MB_TYPE_QUANT | MB_TYPE_L0L1 | MB_TYPE_CBP,
-};
-
-static const uint8_t mbMotionVectorTable[17][2] = {
-{ 0x1, 1 },
-{ 0x1, 2 },
-{ 0x1, 3 },
-{ 0x1, 4 },
-{ 0x3, 6 },
-{ 0x5, 7 },
-{ 0x4, 7 },
-{ 0x3, 7 },
-{ 0xb, 9 },
-{ 0xa, 9 },
-{ 0x9, 9 },
-{ 0x11, 10 },
-{ 0x10, 10 },
-{ 0xf, 10 },
-{ 0xe, 10 },
-{ 0xd, 10 },
-{ 0xc, 10 },
-};
-
-const AVRational ff_frame_rate_tab[] = {
- { 0, 0},
- {24000, 1001},
- { 24, 1},
- { 25, 1},
- {30000, 1001},
- { 30, 1},
- { 50, 1},
- {60000, 1001},
- { 60, 1},
- // Xing's 15fps: (9)
- { 15, 1},
- // libmpeg3's "Unofficial economy rates": (10-13)
- { 5, 1},
- { 10, 1},
- { 12, 1},
- { 15, 1},
- { 0, 0},
-};
-
-static const uint8_t non_linear_qscale[32] = {
- 0, 1, 2, 3, 4, 5, 6, 7,
- 8,10,12,14,16,18,20,22,
- 24,28,32,36,40,44,48,52,
- 56,64,72,80,88,96,104,112,
-};
-
-const uint8_t ff_mpeg1_dc_scale_table[128]={
-// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-};
-
-static const uint8_t mpeg2_dc_scale_table1[128]={
-// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
-};
-
-static const uint8_t mpeg2_dc_scale_table2[128]={
-// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-};
-
-static const uint8_t mpeg2_dc_scale_table3[128]={
-// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-};
-
-static const uint8_t *mpeg2_dc_scale_table[4]={
- ff_mpeg1_dc_scale_table,
- mpeg2_dc_scale_table1,
- mpeg2_dc_scale_table2,
- mpeg2_dc_scale_table3,
-};
-
-static const float mpeg1_aspect[16]={
- 0.0000,
- 1.0000,
- 0.6735,
- 0.7031,
-
- 0.7615,
- 0.8055,
- 0.8437,
- 0.8935,
-
- 0.9157,
- 0.9815,
- 1.0255,
- 1.0695,
-
- 1.0950,
- 1.1575,
- 1.2015,
-};
-
-static const AVRational mpeg2_aspect[16]={
- {0,1},
- {1,1},
- {4,3},
- {16,9},
- {221,100},
- {0,1},
- {0,1},
- {0,1},
- {0,1},
- {0,1},
- {0,1},
- {0,1},
- {0,1},
- {0,1},
- {0,1},
- {0,1},
-};
-
-static const uint8_t svcd_scan_offset_placeholder[14]={
- 0x10, 0x0E,
- 0x00, 0x80, 0x81,
- 0x00, 0x80, 0x81,
- 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff,
-};
diff --git a/src/libffmpeg/libavcodec/mpeg4data.h b/src/libffmpeg/libavcodec/mpeg4data.h
deleted file mode 100644
index e199c6a14..000000000
--- a/src/libffmpeg/libavcodec/mpeg4data.h
+++ /dev/null
@@ -1,423 +0,0 @@
-/*
- * copyright (c) 2000,2001 Fabrice Bellard
- * H263+ support
- * copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file mpeg4data.h
- * mpeg4 tables.
- */
-
-// shapes
-#define RECT_SHAPE 0
-#define BIN_SHAPE 1
-#define BIN_ONLY_SHAPE 2
-#define GRAY_SHAPE 3
-
-#define SIMPLE_VO_TYPE 1
-#define CORE_VO_TYPE 3
-#define MAIN_VO_TYPE 4
-#define NBIT_VO_TYPE 5
-#define ARTS_VO_TYPE 10
-#define ACE_VO_TYPE 12
-#define ADV_SIMPLE_VO_TYPE 17
-
-// aspect_ratio_info
-#define EXTENDED_PAR 15
-
-//vol_sprite_usage / sprite_enable
-#define STATIC_SPRITE 1
-#define GMC_SPRITE 2
-
-#define MOTION_MARKER 0x1F001
-#define DC_MARKER 0x6B001
-
-static const int mb_type_b_map[4]= {
- MB_TYPE_DIRECT2 | MB_TYPE_L0L1,
- MB_TYPE_L0L1 | MB_TYPE_16x16,
- MB_TYPE_L1 | MB_TYPE_16x16,
- MB_TYPE_L0 | MB_TYPE_16x16,
-};
-
-#define VOS_STARTCODE 0x1B0
-#define USER_DATA_STARTCODE 0x1B2
-#define GOP_STARTCODE 0x1B3
-#define VISUAL_OBJ_STARTCODE 0x1B5
-#define VOP_STARTCODE 0x1B6
-
-/* dc encoding for mpeg4 */
-const uint8_t DCtab_lum[13][2] =
-{
- {3,3}, {3,2}, {2,2}, {2,3}, {1,3}, {1,4}, {1,5}, {1,6}, {1,7},
- {1,8}, {1,9}, {1,10}, {1,11},
-};
-
-const uint8_t DCtab_chrom[13][2] =
-{
- {3,2}, {2,2}, {1,2}, {1,3}, {1,4}, {1,5}, {1,6}, {1,7}, {1,8},
- {1,9}, {1,10}, {1,11}, {1,12},
-};
-
-const uint16_t intra_vlc[103][2] = {
-{ 0x2, 2 },
-{ 0x6, 3 },{ 0xf, 4 },{ 0xd, 5 },{ 0xc, 5 },
-{ 0x15, 6 },{ 0x13, 6 },{ 0x12, 6 },{ 0x17, 7 },
-{ 0x1f, 8 },{ 0x1e, 8 },{ 0x1d, 8 },{ 0x25, 9 },
-{ 0x24, 9 },{ 0x23, 9 },{ 0x21, 9 },{ 0x21, 10 },
-{ 0x20, 10 },{ 0xf, 10 },{ 0xe, 10 },{ 0x7, 11 },
-{ 0x6, 11 },{ 0x20, 11 },{ 0x21, 11 },{ 0x50, 12 },
-{ 0x51, 12 },{ 0x52, 12 },{ 0xe, 4 },{ 0x14, 6 },
-{ 0x16, 7 },{ 0x1c, 8 },{ 0x20, 9 },{ 0x1f, 9 },
-{ 0xd, 10 },{ 0x22, 11 },{ 0x53, 12 },{ 0x55, 12 },
-{ 0xb, 5 },{ 0x15, 7 },{ 0x1e, 9 },{ 0xc, 10 },
-{ 0x56, 12 },{ 0x11, 6 },{ 0x1b, 8 },{ 0x1d, 9 },
-{ 0xb, 10 },{ 0x10, 6 },{ 0x22, 9 },{ 0xa, 10 },
-{ 0xd, 6 },{ 0x1c, 9 },{ 0x8, 10 },{ 0x12, 7 },
-{ 0x1b, 9 },{ 0x54, 12 },{ 0x14, 7 },{ 0x1a, 9 },
-{ 0x57, 12 },{ 0x19, 8 },{ 0x9, 10 },{ 0x18, 8 },
-{ 0x23, 11 },{ 0x17, 8 },{ 0x19, 9 },{ 0x18, 9 },
-{ 0x7, 10 },{ 0x58, 12 },{ 0x7, 4 },{ 0xc, 6 },
-{ 0x16, 8 },{ 0x17, 9 },{ 0x6, 10 },{ 0x5, 11 },
-{ 0x4, 11 },{ 0x59, 12 },{ 0xf, 6 },{ 0x16, 9 },
-{ 0x5, 10 },{ 0xe, 6 },{ 0x4, 10 },{ 0x11, 7 },
-{ 0x24, 11 },{ 0x10, 7 },{ 0x25, 11 },{ 0x13, 7 },
-{ 0x5a, 12 },{ 0x15, 8 },{ 0x5b, 12 },{ 0x14, 8 },
-{ 0x13, 8 },{ 0x1a, 8 },{ 0x15, 9 },{ 0x14, 9 },
-{ 0x13, 9 },{ 0x12, 9 },{ 0x11, 9 },{ 0x26, 11 },
-{ 0x27, 11 },{ 0x5c, 12 },{ 0x5d, 12 },{ 0x5e, 12 },
-{ 0x5f, 12 },{ 0x3, 7 },
-};
-
-const int8_t intra_level[102] = {
- 1, 2, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, 24,
- 25, 26, 27, 1, 2, 3, 4, 5,
- 6, 7, 8, 9, 10, 1, 2, 3,
- 4, 5, 1, 2, 3, 4, 1, 2,
- 3, 1, 2, 3, 1, 2, 3, 1,
- 2, 3, 1, 2, 1, 2, 1, 1,
- 1, 1, 1, 1, 2, 3, 4, 5,
- 6, 7, 8, 1, 2, 3, 1, 2,
- 1, 2, 1, 2, 1, 2, 1, 2,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1,
-};
-
-const int8_t intra_run[102] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 2, 2, 2,
- 2, 2, 3, 3, 3, 3, 4, 4,
- 4, 5, 5, 5, 6, 6, 6, 7,
- 7, 7, 8, 8, 9, 9, 10, 11,
- 12, 13, 14, 0, 0, 0, 0, 0,
- 0, 0, 0, 1, 1, 1, 2, 2,
- 3, 3, 4, 4, 5, 5, 6, 6,
- 7, 8, 9, 10, 11, 12, 13, 14,
- 15, 16, 17, 18, 19, 20,
-};
-
-static RLTable rl_intra = {
- 102,
- 67,
- intra_vlc,
- intra_run,
- intra_level,
-};
-
-static const uint16_t inter_rvlc[170][2]={ //note this is identical to the intra rvlc except that its reordered
-{0x0006, 3},{0x0001, 4},{0x0004, 5},{0x001C, 7},
-{0x003C, 8},{0x003D, 8},{0x007C, 9},{0x00FC, 10},
-{0x00FD, 10},{0x01FC, 11},{0x01FD, 11},{0x03FC, 12},
-{0x07FC, 13},{0x07FD, 13},{0x0BFC, 13},{0x0BFD, 13},
-{0x0FFC, 14},{0x0FFD, 14},{0x1FFC, 15},{0x0007, 3},
-{0x000C, 6},{0x005C, 8},{0x007D, 9},{0x017C, 10},
-{0x02FC, 11},{0x03FD, 12},{0x0DFC, 13},{0x17FC, 14},
-{0x17FD, 14},{0x000A, 4},{0x001D, 7},{0x00BC, 9},
-{0x02FD, 11},{0x05FC, 12},{0x1BFC, 14},{0x1BFD, 14},
-{0x0005, 5},{0x005D, 8},{0x017D, 10},{0x05FD, 12},
-{0x0DFD, 13},{0x1DFC, 14},{0x1FFD, 15},{0x0008, 5},
-{0x006C, 8},{0x037C, 11},{0x0EFC, 13},{0x2FFC, 15},
-{0x0009, 5},{0x00BD, 9},{0x037D, 11},{0x0EFD, 13},
-{0x000D, 6},{0x01BC, 10},{0x06FC, 12},{0x1DFD, 14},
-{0x0014, 6},{0x01BD, 10},{0x06FD, 12},{0x2FFD, 15},
-{0x0015, 6},{0x01DC, 10},{0x0F7C, 13},{0x002C, 7},
-{0x01DD, 10},{0x1EFC, 14},{0x002D, 7},{0x03BC, 11},
-{0x0034, 7},{0x077C, 12},{0x006D, 8},{0x0F7D, 13},
-{0x0074, 8},{0x1EFD, 14},{0x0075, 8},{0x1F7C, 14},
-{0x00DC, 9},{0x1F7D, 14},{0x00DD, 9},{0x1FBC, 14},
-{0x00EC, 9},{0x37FC, 15},{0x01EC, 10},{0x01ED, 10},
-{0x01F4, 10},{0x03BD, 11},{0x03DC, 11},{0x03DD, 11},
-{0x03EC, 11},{0x03ED, 11},{0x03F4, 11},{0x077D, 12},
-{0x07BC, 12},{0x07BD, 12},{0x0FBC, 13},{0x0FBD, 13},
-{0x0FDC, 13},{0x0FDD, 13},{0x1FBD, 14},{0x1FDC, 14},
-{0x1FDD, 14},{0x37FD, 15},{0x3BFC, 15},
-{0x000B, 4},{0x0078, 8},{0x03F5, 11},{0x0FEC, 13},
-{0x1FEC, 14},{0x0012, 5},{0x00ED, 9},{0x07DC, 12},
-{0x1FED, 14},{0x3BFD, 15},{0x0013, 5},{0x03F8, 11},
-{0x3DFC, 15},{0x0018, 6},{0x07DD, 12},{0x0019, 6},
-{0x07EC, 12},{0x0022, 6},{0x0FED, 13},{0x0023, 6},
-{0x0FF4, 13},{0x0035, 7},{0x0FF5, 13},{0x0038, 7},
-{0x0FF8, 13},{0x0039, 7},{0x0FF9, 13},{0x0042, 7},
-{0x1FF4, 14},{0x0043, 7},{0x1FF5, 14},{0x0079, 8},
-{0x1FF8, 14},{0x0082, 8},{0x3DFD, 15},{0x0083, 8},
-{0x00F4, 9},{0x00F5, 9},{0x00F8, 9},{0x00F9, 9},
-{0x0102, 9},{0x0103, 9},{0x01F5, 10},{0x01F8, 10},
-{0x01F9, 10},{0x0202, 10},{0x0203, 10},{0x03F9, 11},
-{0x0402, 11},{0x0403, 11},{0x07ED, 12},{0x07F4, 12},
-{0x07F5, 12},{0x07F8, 12},{0x07F9, 12},{0x0802, 12},
-{0x0803, 12},{0x1002, 13},{0x1003, 13},{0x1FF9, 14},
-{0x2002, 14},{0x2003, 14},{0x3EFC, 15},{0x3EFD, 15},
-{0x3F7C, 15},{0x3F7D, 15},{0x0000, 4}
-};
-
-static const int8_t inter_rvlc_run[169]={
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 2, 2, 2,
- 2, 2, 2, 2, 3, 3, 3, 3,
- 3, 3, 3, 4, 4, 4, 4, 4,
- 5, 5, 5, 5, 6, 6, 6, 6,
- 7, 7, 7, 7, 8, 8, 8, 9,
- 9, 9, 10, 10, 11, 11, 12, 12,
-13, 13, 14, 14, 15, 15, 16, 16,
-17, 17, 18, 19, 20, 21, 22, 23,
-24, 25, 26, 27, 28, 29, 30, 31,
-32, 33, 34, 35, 36, 37, 38,
- 0, 0, 0, 0, 0, 1, 1, 1,
- 1, 1, 2, 2, 2, 3, 3, 4,
- 4, 5, 5, 6, 6, 7, 7, 8,
- 8, 9, 9, 10, 10, 11, 11, 12,
-12, 13, 13, 14, 15, 16, 17, 18,
-19, 20, 21, 22, 23, 24, 25, 26,
-27, 28, 29, 30, 31, 32, 33, 34,
-35, 36, 37, 38, 39, 40, 41, 42,
-43, 44,
-};
-
-static const int8_t inter_rvlc_level[169]={
- 1, 2, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 16,
-17, 18, 19, 1, 2, 3, 4, 5,
- 6, 7, 8, 9, 10, 1, 2, 3,
- 4, 5, 6, 7, 1, 2, 3, 4,
- 5, 6, 7, 1, 2, 3, 4, 5,
- 1, 2, 3, 4, 1, 2, 3, 4,
- 1, 2, 3, 4, 1, 2, 3, 1,
- 2, 3, 1, 2, 1, 2, 1, 2,
- 1, 2, 1, 2, 1, 2, 1, 2,
- 1, 2, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1,
- 1, 2, 3, 4, 5, 1, 2, 3,
- 4, 5, 1, 2, 3, 1, 2, 1,
- 2, 1, 2, 1, 2, 1, 2, 1,
- 2, 1, 2, 1, 2, 1, 2, 1,
- 2, 1, 2, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1,
-};
-
-static RLTable rvlc_rl_inter = {
- 169,
- 103,
- inter_rvlc,
- inter_rvlc_run,
- inter_rvlc_level,
-};
-
-static const uint16_t intra_rvlc[170][2]={
-{0x0006, 3},{0x0007, 3},{0x000A, 4},{0x0009, 5},
-{0x0014, 6},{0x0015, 6},{0x0034, 7},{0x0074, 8},
-{0x0075, 8},{0x00DD, 9},{0x00EC, 9},{0x01EC, 10},
-{0x01ED, 10},{0x01F4, 10},{0x03EC, 11},{0x03ED, 11},
-{0x03F4, 11},{0x077D, 12},{0x07BC, 12},{0x0FBD, 13},
-{0x0FDC, 13},{0x07BD, 12},{0x0FDD, 13},{0x1FBD, 14},
-{0x1FDC, 14},{0x1FDD, 14},{0x1FFC, 15},{0x0001, 4},
-{0x0008, 5},{0x002D, 7},{0x006C, 8},{0x006D, 8},
-{0x00DC, 9},{0x01DD, 10},{0x03DC, 11},{0x03DD, 11},
-{0x077C, 12},{0x0FBC, 13},{0x1F7D, 14},{0x1FBC, 14},
-{0x0004, 5},{0x002C, 7},{0x00BC, 9},{0x01DC, 10},
-{0x03BC, 11},{0x03BD, 11},{0x0EFD, 13},{0x0F7C, 13},
-{0x0F7D, 13},{0x1EFD, 14},{0x1F7C, 14},{0x0005, 5},
-{0x005C, 8},{0x00BD, 9},{0x037D, 11},{0x06FC, 12},
-{0x0EFC, 13},{0x1DFD, 14},{0x1EFC, 14},{0x1FFD, 15},
-{0x000C, 6},{0x005D, 8},{0x01BD, 10},{0x03FD, 12},
-{0x06FD, 12},{0x1BFD, 14},{0x000D, 6},{0x007D, 9},
-{0x02FC, 11},{0x05FC, 12},{0x1BFC, 14},{0x1DFC, 14},
-{0x001C, 7},{0x017C, 10},{0x02FD, 11},{0x05FD, 12},
-{0x2FFC, 15},{0x001D, 7},{0x017D, 10},{0x037C, 11},
-{0x0DFD, 13},{0x2FFD, 15},{0x003C, 8},{0x01BC, 10},
-{0x0BFD, 13},{0x17FD, 14},{0x003D, 8},{0x01FD, 11},
-{0x0DFC, 13},{0x37FC, 15},{0x007C, 9},{0x03FC, 12},
-{0x00FC, 10},{0x0BFC, 13},{0x00FD, 10},{0x37FD, 15},
-{0x01FC, 11},{0x07FC, 13},{0x07FD, 13},{0x0FFC, 14},
-{0x0FFD, 14},{0x17FC, 14},{0x3BFC, 15},
-{0x000B, 4},{0x0078, 8},{0x03F5, 11},{0x0FEC, 13},
-{0x1FEC, 14},{0x0012, 5},{0x00ED, 9},{0x07DC, 12},
-{0x1FED, 14},{0x3BFD, 15},{0x0013, 5},{0x03F8, 11},
-{0x3DFC, 15},{0x0018, 6},{0x07DD, 12},{0x0019, 6},
-{0x07EC, 12},{0x0022, 6},{0x0FED, 13},{0x0023, 6},
-{0x0FF4, 13},{0x0035, 7},{0x0FF5, 13},{0x0038, 7},
-{0x0FF8, 13},{0x0039, 7},{0x0FF9, 13},{0x0042, 7},
-{0x1FF4, 14},{0x0043, 7},{0x1FF5, 14},{0x0079, 8},
-{0x1FF8, 14},{0x0082, 8},{0x3DFD, 15},{0x0083, 8},
-{0x00F4, 9},{0x00F5, 9},{0x00F8, 9},{0x00F9, 9},
-{0x0102, 9},{0x0103, 9},{0x01F5, 10},{0x01F8, 10},
-{0x01F9, 10},{0x0202, 10},{0x0203, 10},{0x03F9, 11},
-{0x0402, 11},{0x0403, 11},{0x07ED, 12},{0x07F4, 12},
-{0x07F5, 12},{0x07F8, 12},{0x07F9, 12},{0x0802, 12},
-{0x0803, 12},{0x1002, 13},{0x1003, 13},{0x1FF9, 14},
-{0x2002, 14},{0x2003, 14},{0x3EFC, 15},{0x3EFD, 15},
-{0x3F7C, 15},{0x3F7D, 15},{0x0000, 4}
-};
-
-static const int8_t intra_rvlc_run[169]={
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 4, 4, 4, 4,
- 4, 4, 5, 5, 5, 5, 5, 5,
- 6, 6, 6, 6, 6, 7, 7, 7,
- 7, 7, 8, 8, 8, 8, 9, 9,
- 9, 9, 10, 10, 11, 11, 12, 12,
-13, 14, 15, 16, 17, 18, 19,
- 0, 0, 0, 0, 0, 1, 1, 1,
- 1, 1, 2, 2, 2, 3, 3, 4,
- 4, 5, 5, 6, 6, 7, 7, 8,
- 8, 9, 9, 10, 10, 11, 11, 12,
-12, 13, 13, 14, 15, 16, 17, 18,
-19, 20, 21, 22, 23, 24, 25, 26,
-27, 28, 29, 30, 31, 32, 33, 34,
-35, 36, 37, 38, 39, 40, 41, 42,
-43, 44,
-};
-
-static const int8_t intra_rvlc_level[169]={
- 1, 2, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 16,
-17, 18, 19, 20, 21, 22, 23, 24,
-25, 26, 27, 1, 2, 3, 4, 5,
- 6, 7, 8, 9, 10, 11, 12, 13,
- 1, 2, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 1, 2, 3, 4, 5,
- 6, 7, 8, 9, 1, 2, 3, 4,
- 5, 6, 1, 2, 3, 4, 5, 6,
- 1, 2, 3, 4, 5, 1, 2, 3,
- 4, 5, 1, 2, 3, 4, 1, 2,
- 3, 4, 1, 2, 1, 2, 1, 2,
- 1, 1, 1, 1, 1, 1, 1,
- 1, 2, 3, 4, 5, 1, 2, 3,
- 4, 5, 1, 2, 3, 1, 2, 1,
- 2, 1, 2, 1, 2, 1, 2, 1,
- 2, 1, 2, 1, 2, 1, 2, 1,
- 2, 1, 2, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1,
-};
-
-static RLTable rvlc_rl_intra = {
- 169,
- 103,
- intra_rvlc,
- intra_rvlc_run,
- intra_rvlc_level,
-};
-
-static const uint16_t sprite_trajectory_tab[15][2] = {
- {0x00, 2}, {0x02, 3}, {0x03, 3}, {0x04, 3}, {0x05, 3}, {0x06, 3},
- {0x0E, 4}, {0x1E, 5}, {0x3E, 6}, {0x7E, 7}, {0xFE, 8},
- {0x1FE, 9},{0x3FE, 10},{0x7FE, 11},{0xFFE, 12},
-};
-
-static const uint8_t mb_type_b_tab[4][2] = {
- {1, 1}, {1, 2}, {1, 3}, {1, 4},
-};
-
-static const AVRational pixel_aspect[16]={
- {0, 1},
- {1, 1},
- {12, 11},
- {10, 11},
- {16, 11},
- {40, 33},
- {0, 1},
- {0, 1},
- {0, 1},
- {0, 1},
- {0, 1},
- {0, 1},
- {0, 1},
- {0, 1},
- {0, 1},
- {0, 1},
-};
-
-/* these matrixes will be permuted for the idct */
-const int16_t ff_mpeg4_default_intra_matrix[64] = {
- 8, 17, 18, 19, 21, 23, 25, 27,
- 17, 18, 19, 21, 23, 25, 27, 28,
- 20, 21, 22, 23, 24, 26, 28, 30,
- 21, 22, 23, 24, 26, 28, 30, 32,
- 22, 23, 24, 26, 28, 30, 32, 35,
- 23, 24, 26, 28, 30, 32, 35, 38,
- 25, 26, 28, 30, 32, 35, 38, 41,
- 27, 28, 30, 32, 35, 38, 41, 45,
-};
-
-const int16_t ff_mpeg4_default_non_intra_matrix[64] = {
- 16, 17, 18, 19, 20, 21, 22, 23,
- 17, 18, 19, 20, 21, 22, 23, 24,
- 18, 19, 20, 21, 22, 23, 24, 25,
- 19, 20, 21, 22, 23, 24, 26, 27,
- 20, 21, 22, 23, 25, 26, 27, 28,
- 21, 22, 23, 24, 26, 27, 28, 30,
- 22, 23, 24, 26, 27, 28, 30, 31,
- 23, 24, 25, 27, 28, 30, 31, 33,
-};
-
-const uint8_t ff_mpeg4_y_dc_scale_table[32]={
-// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
- 0, 8, 8, 8, 8,10,12,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,34,36,38,40,42,44,46
-};
-const uint8_t ff_mpeg4_c_dc_scale_table[32]={
-// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
- 0, 8, 8, 8, 8, 9, 9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,20,21,22,23,24,25
-};
-
-const uint16_t ff_mpeg4_resync_prefix[8]={
- 0x7F00, 0x7E00, 0x7C00, 0x7800, 0x7000, 0x6000, 0x4000, 0x0000
-};
-
-static const uint8_t mpeg4_dc_threshold[8]={
- 99, 13, 15, 17, 19, 21, 23, 0
-};
diff --git a/src/libffmpeg/libavcodec/mpegaudio.h b/src/libffmpeg/libavcodec/mpegaudio.h
deleted file mode 100644
index 3eadf92a8..000000000
--- a/src/libffmpeg/libavcodec/mpegaudio.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file mpegaudio.h
- * mpeg audio declarations for both encoder and decoder.
- */
-
-/* max frame size, in samples */
-#define MPA_FRAME_SIZE 1152
-
-/* max compressed frame size */
-#define MPA_MAX_CODED_FRAME_SIZE 1792
-
-#define MPA_MAX_CHANNELS 2
-
-#define SBLIMIT 32 /* number of subbands */
-
-#define MPA_STEREO 0
-#define MPA_JSTEREO 1
-#define MPA_DUAL 2
-#define MPA_MONO 3
-
-/* header + layer + bitrate + freq + lsf/mpeg25 */
-#define SAME_HEADER_MASK \
- (0xffe00000 | (3 << 17) | (0xf << 12) | (3 << 10) | (3 << 19))
-
-/* define USE_HIGHPRECISION to have a bit exact (but slower) mpeg
- audio decoder */
-
-#ifdef USE_HIGHPRECISION
-#define FRAC_BITS 23 /* fractional bits for sb_samples and dct */
-#define WFRAC_BITS 16 /* fractional bits for window */
-#else
-#define FRAC_BITS 15 /* fractional bits for sb_samples and dct */
-#define WFRAC_BITS 14 /* fractional bits for window */
-#endif
-
-#if defined(USE_HIGHPRECISION) && defined(CONFIG_AUDIO_NONSHORT)
-typedef int32_t OUT_INT;
-#define OUT_MAX INT32_MAX
-#define OUT_MIN INT32_MIN
-#define OUT_SHIFT (WFRAC_BITS + FRAC_BITS - 31)
-#else
-typedef int16_t OUT_INT;
-#define OUT_MAX INT16_MAX
-#define OUT_MIN INT16_MIN
-#define OUT_SHIFT (WFRAC_BITS + FRAC_BITS - 15)
-#endif
-
-#if FRAC_BITS <= 15
-typedef int16_t MPA_INT;
-#else
-typedef int32_t MPA_INT;
-#endif
-
-int l2_select_table(int bitrate, int nb_channels, int freq, int lsf);
-int mpa_decode_header(AVCodecContext *avctx, uint32_t head, int *sample_rate);
-void ff_mpa_synth_init(MPA_INT *window);
-void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
- MPA_INT *window, int *dither_state,
- OUT_INT *samples, int incr,
- int32_t sb_samples[SBLIMIT]);
-
-extern const uint16_t mpa_bitrate_tab[2][3][15];
-extern const uint16_t mpa_freq_tab[3];
-extern const unsigned char *alloc_tables[5];
-extern const double enwindow[512];
-extern const int sblimit_table[5];
-extern const int quant_steps[17];
-extern const int quant_bits[17];
-extern const int32_t mpa_enwindow[257];
-
-/* fast header check for resync */
-static inline int ff_mpa_check_header(uint32_t header){
- /* header */
- if ((header & 0xffe00000) != 0xffe00000)
- return -1;
- /* layer check */
- if ((header & (3<<17)) == 0)
- return -1;
- /* bit rate */
- if ((header & (0xf<<12)) == 0xf<<12)
- return -1;
- /* frequency */
- if ((header & (3<<10)) == 3<<10)
- return -1;
- return 0;
-}
diff --git a/src/libffmpeg/libavcodec/mpegaudiodec.c b/src/libffmpeg/libavcodec/mpegaudiodec.c
deleted file mode 100644
index 367400581..000000000
--- a/src/libffmpeg/libavcodec/mpegaudiodec.c
+++ /dev/null
@@ -1,2879 +0,0 @@
-/*
- * MPEG Audio decoder
- * Copyright (c) 2001, 2002 Fabrice Bellard.
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file mpegaudiodec.c
- * MPEG Audio decoder.
- */
-
-//#define DEBUG
-#include "avcodec.h"
-#include "bitstream.h"
-#include "dsputil.h"
-
-/*
- * TODO:
- * - in low precision mode, use more 16 bit multiplies in synth filter
- * - test lsf / mpeg25 extensively.
- */
-
-/* define USE_HIGHPRECISION to have a bit exact (but slower) mpeg
- audio decoder */
-#ifdef CONFIG_MPEGAUDIO_HP
-# define USE_HIGHPRECISION
-#endif
-
-#include "mpegaudio.h"
-
-#include "mathops.h"
-
-#define FRAC_ONE (1 << FRAC_BITS)
-
-#define FIX(a) ((int)((a) * FRAC_ONE))
-/* WARNING: only correct for posititive numbers */
-#define FIXR(a) ((int)((a) * FRAC_ONE + 0.5))
-#define FRAC_RND(a) (((a) + (FRAC_ONE/2)) >> FRAC_BITS)
-
-#define FIXHR(a) ((int)((a) * (1LL<<32) + 0.5))
-
-/****************/
-
-#define HEADER_SIZE 4
-#define BACKSTEP_SIZE 512
-#define EXTRABYTES 24
-
-struct GranuleDef;
-
-typedef struct MPADecodeContext {
- DECLARE_ALIGNED_8(uint8_t, last_buf[2*BACKSTEP_SIZE + EXTRABYTES]);
- int last_buf_size;
- int frame_size;
- /* next header (used in free format parsing) */
- uint32_t free_format_next_header;
- int error_protection;
- int layer;
- int sample_rate;
- int sample_rate_index; /* between 0 and 8 */
- int bit_rate;
- GetBitContext gb;
- GetBitContext in_gb;
- int nb_channels;
- int mode;
- int mode_ext;
- int lsf;
- MPA_INT synth_buf[MPA_MAX_CHANNELS][512 * 2] __attribute__((aligned(16)));
- int synth_buf_offset[MPA_MAX_CHANNELS];
- int32_t sb_samples[MPA_MAX_CHANNELS][36][SBLIMIT] __attribute__((aligned(16)));
- int32_t mdct_buf[MPA_MAX_CHANNELS][SBLIMIT * 18]; /* previous samples, for layer 3 MDCT */
-#ifdef DEBUG
- int frame_count;
-#endif
- void (*compute_antialias)(struct MPADecodeContext *s, struct GranuleDef *g);
- int adu_mode; ///< 0 for standard mp3, 1 for adu formatted mp3
- int dither_state;
- int error_resilience;
-} MPADecodeContext;
-
-/**
- * Context for MP3On4 decoder
- */
-typedef struct MP3On4DecodeContext {
- int frames; ///< number of mp3 frames per block (number of mp3 decoder instances)
- int chan_cfg; ///< channel config number
- MPADecodeContext *mp3decctx[5]; ///< MPADecodeContext for every decoder instance
-} MP3On4DecodeContext;
-
-/* layer 3 "granule" */
-typedef struct GranuleDef {
- uint8_t scfsi;
- int part2_3_length;
- int big_values;
- int global_gain;
- int scalefac_compress;
- uint8_t block_type;
- uint8_t switch_point;
- int table_select[3];
- int subblock_gain[3];
- uint8_t scalefac_scale;
- uint8_t count1table_select;
- int region_size[3]; /* number of huffman codes in each region */
- int preflag;
- int short_start, long_end; /* long/short band indexes */
- uint8_t scale_factors[40];
- int32_t sb_hybrid[SBLIMIT * 18]; /* 576 samples */
-} GranuleDef;
-
-#define MODE_EXT_MS_STEREO 2
-#define MODE_EXT_I_STEREO 1
-
-/* layer 3 huffman tables */
-typedef struct HuffTable {
- int xsize;
- const uint8_t *bits;
- const uint16_t *codes;
-} HuffTable;
-
-#include "mpegaudiodectab.h"
-
-static void compute_antialias_integer(MPADecodeContext *s, GranuleDef *g);
-static void compute_antialias_float(MPADecodeContext *s, GranuleDef *g);
-
-/* vlc structure for decoding layer 3 huffman tables */
-static VLC huff_vlc[16];
-static VLC huff_quad_vlc[2];
-/* computed from band_size_long */
-static uint16_t band_index_long[9][23];
-/* XXX: free when all decoders are closed */
-#define TABLE_4_3_SIZE (8191 + 16)*4
-static int8_t *table_4_3_exp;
-static uint32_t *table_4_3_value;
-static uint32_t exp_table[512];
-static uint32_t expval_table[512][16];
-/* intensity stereo coef table */
-static int32_t is_table[2][16];
-static int32_t is_table_lsf[2][2][16];
-static int32_t csa_table[8][4];
-static float csa_table_float[8][4];
-static int32_t mdct_win[8][36];
-
-/* lower 2 bits: modulo 3, higher bits: shift */
-static uint16_t scale_factor_modshift[64];
-/* [i][j]: 2^(-j/3) * FRAC_ONE * 2^(i+2) / (2^(i+2) - 1) */
-static int32_t scale_factor_mult[15][3];
-/* mult table for layer 2 group quantization */
-
-#define SCALE_GEN(v) \
-{ FIXR(1.0 * (v)), FIXR(0.7937005259 * (v)), FIXR(0.6299605249 * (v)) }
-
-static const int32_t scale_factor_mult2[3][3] = {
- SCALE_GEN(4.0 / 3.0), /* 3 steps */
- SCALE_GEN(4.0 / 5.0), /* 5 steps */
- SCALE_GEN(4.0 / 9.0), /* 9 steps */
-};
-
-static MPA_INT window[512] __attribute__((aligned(16)));
-
-/* layer 1 unscaling */
-/* n = number of bits of the mantissa minus 1 */
-static inline int l1_unscale(int n, int mant, int scale_factor)
-{
- int shift, mod;
- int64_t val;
-
- shift = scale_factor_modshift[scale_factor];
- mod = shift & 3;
- shift >>= 2;
- val = MUL64(mant + (-1 << n) + 1, scale_factor_mult[n-1][mod]);
- shift += n;
- /* NOTE: at this point, 1 <= shift >= 21 + 15 */
- return (int)((val + (1LL << (shift - 1))) >> shift);
-}
-
-static inline int l2_unscale_group(int steps, int mant, int scale_factor)
-{
- int shift, mod, val;
-
- shift = scale_factor_modshift[scale_factor];
- mod = shift & 3;
- shift >>= 2;
-
- val = (mant - (steps >> 1)) * scale_factor_mult2[steps >> 2][mod];
- /* NOTE: at this point, 0 <= shift <= 21 */
- if (shift > 0)
- val = (val + (1 << (shift - 1))) >> shift;
- return val;
-}
-
-/* compute value^(4/3) * 2^(exponent/4). It normalized to FRAC_BITS */
-static inline int l3_unscale(int value, int exponent)
-{
- unsigned int m;
- int e;
-
- e = table_4_3_exp [4*value + (exponent&3)];
- m = table_4_3_value[4*value + (exponent&3)];
- e -= (exponent >> 2);
- assert(e>=1);
- if (e > 31)
- return 0;
- m = (m + (1 << (e-1))) >> e;
-
- return m;
-}
-
-/* all integer n^(4/3) computation code */
-#define DEV_ORDER 13
-
-#define POW_FRAC_BITS 24
-#define POW_FRAC_ONE (1 << POW_FRAC_BITS)
-#define POW_FIX(a) ((int)((a) * POW_FRAC_ONE))
-#define POW_MULL(a,b) (((int64_t)(a) * (int64_t)(b)) >> POW_FRAC_BITS)
-
-static int dev_4_3_coefs[DEV_ORDER];
-
-#if 0 /* unused */
-static int pow_mult3[3] = {
- POW_FIX(1.0),
- POW_FIX(1.25992104989487316476),
- POW_FIX(1.58740105196819947474),
-};
-#endif
-
-static void int_pow_init(void)
-{
- int i, a;
-
- a = POW_FIX(1.0);
- for(i=0;i<DEV_ORDER;i++) {
- a = POW_MULL(a, POW_FIX(4.0 / 3.0) - i * POW_FIX(1.0)) / (i + 1);
- dev_4_3_coefs[i] = a;
- }
-}
-
-#if 0 /* unused, remove? */
-/* return the mantissa and the binary exponent */
-static int int_pow(int i, int *exp_ptr)
-{
- int e, er, eq, j;
- int a, a1;
-
- /* renormalize */
- a = i;
- e = POW_FRAC_BITS;
- while (a < (1 << (POW_FRAC_BITS - 1))) {
- a = a << 1;
- e--;
- }
- a -= (1 << POW_FRAC_BITS);
- a1 = 0;
- for(j = DEV_ORDER - 1; j >= 0; j--)
- a1 = POW_MULL(a, dev_4_3_coefs[j] + a1);
- a = (1 << POW_FRAC_BITS) + a1;
- /* exponent compute (exact) */
- e = e * 4;
- er = e % 3;
- eq = e / 3;
- a = POW_MULL(a, pow_mult3[er]);
- while (a >= 2 * POW_FRAC_ONE) {
- a = a >> 1;
- eq++;
- }
- /* convert to float */
- while (a < POW_FRAC_ONE) {
- a = a << 1;
- eq--;
- }
- /* now POW_FRAC_ONE <= a < 2 * POW_FRAC_ONE */
-#if POW_FRAC_BITS > FRAC_BITS
- a = (a + (1 << (POW_FRAC_BITS - FRAC_BITS - 1))) >> (POW_FRAC_BITS - FRAC_BITS);
- /* correct overflow */
- if (a >= 2 * (1 << FRAC_BITS)) {
- a = a >> 1;
- eq++;
- }
-#endif
- *exp_ptr = eq;
- return a;
-}
-#endif
-
-static int decode_init(AVCodecContext * avctx)
-{
- MPADecodeContext *s = avctx->priv_data;
- static int init=0;
- int i, j, k;
-
-#if defined(USE_HIGHPRECISION) && defined(CONFIG_AUDIO_NONSHORT)
- avctx->sample_fmt= SAMPLE_FMT_S32;
-#else
- avctx->sample_fmt= SAMPLE_FMT_S16;
-#endif
- s->error_resilience= avctx->error_resilience;
-
- if(avctx->antialias_algo != FF_AA_FLOAT)
- s->compute_antialias= compute_antialias_integer;
- else
- s->compute_antialias= compute_antialias_float;
-
- if (!init && !avctx->parse_only) {
- /* scale factors table for layer 1/2 */
- for(i=0;i<64;i++) {
- int shift, mod;
- /* 1.0 (i = 3) is normalized to 2 ^ FRAC_BITS */
- shift = (i / 3);
- mod = i % 3;
- scale_factor_modshift[i] = mod | (shift << 2);
- }
-
- /* scale factor multiply for layer 1 */
- for(i=0;i<15;i++) {
- int n, norm;
- n = i + 2;
- norm = ((INT64_C(1) << n) * FRAC_ONE) / ((1 << n) - 1);
- scale_factor_mult[i][0] = MULL(FIXR(1.0 * 2.0), norm);
- scale_factor_mult[i][1] = MULL(FIXR(0.7937005259 * 2.0), norm);
- scale_factor_mult[i][2] = MULL(FIXR(0.6299605249 * 2.0), norm);
- dprintf("%d: norm=%x s=%x %x %x\n",
- i, norm,
- scale_factor_mult[i][0],
- scale_factor_mult[i][1],
- scale_factor_mult[i][2]);
- }
-
- ff_mpa_synth_init(window);
-
- /* huffman decode tables */
- for(i=1;i<16;i++) {
- const HuffTable *h = &mpa_huff_tables[i];
- int xsize, x, y;
- unsigned int n;
- uint8_t tmp_bits [512];
- uint16_t tmp_codes[512];
-
- memset(tmp_bits , 0, sizeof(tmp_bits ));
- memset(tmp_codes, 0, sizeof(tmp_codes));
-
- xsize = h->xsize;
- n = xsize * xsize;
-
- j = 0;
- for(x=0;x<xsize;x++) {
- for(y=0;y<xsize;y++){
- tmp_bits [(x << 5) | y | ((x&&y)<<4)]= h->bits [j ];
- tmp_codes[(x << 5) | y | ((x&&y)<<4)]= h->codes[j++];
- }
- }
-
- /* XXX: fail test */
- init_vlc(&huff_vlc[i], 7, 512,
- tmp_bits, 1, 1, tmp_codes, 2, 2, 1);
- }
- for(i=0;i<2;i++) {
- init_vlc(&huff_quad_vlc[i], i == 0 ? 7 : 4, 16,
- mpa_quad_bits[i], 1, 1, mpa_quad_codes[i], 1, 1, 1);
- }
-
- for(i=0;i<9;i++) {
- k = 0;
- for(j=0;j<22;j++) {
- band_index_long[i][j] = k;
- k += band_size_long[i][j];
- }
- band_index_long[i][22] = k;
- }
-
- /* compute n ^ (4/3) and store it in mantissa/exp format */
- table_4_3_exp= av_mallocz_static(TABLE_4_3_SIZE * sizeof(table_4_3_exp[0]));
- if(!table_4_3_exp)
- return -1;
- table_4_3_value= av_mallocz_static(TABLE_4_3_SIZE * sizeof(table_4_3_value[0]));
- if(!table_4_3_value)
- return -1;
-
- int_pow_init();
- for(i=1;i<TABLE_4_3_SIZE;i++) {
- double f, fm;
- int e, m;
- f = pow((double)(i/4), 4.0 / 3.0) * pow(2, (i&3)*0.25);
- fm = frexp(f, &e);
- m = (uint32_t)(fm*(1LL<<31) + 0.5);
- e+= FRAC_BITS - 31 + 5 - 100;
-
- /* normalized to FRAC_BITS */
- table_4_3_value[i] = m;
-// av_log(NULL, AV_LOG_DEBUG, "%d %d %f\n", i, m, pow((double)i, 4.0 / 3.0));
- table_4_3_exp[i] = -e;
- }
- for(i=0; i<512*16; i++){
- int exponent= (i>>4);
- double f= pow(i&15, 4.0 / 3.0) * pow(2, (exponent-400)*0.25 + FRAC_BITS + 5);
- expval_table[exponent][i&15]= llrint(f);
- if((i&15)==1)
- exp_table[exponent]= llrint(f);
- }
-
- for(i=0;i<7;i++) {
- float f;
- int v;
- if (i != 6) {
- f = tan((double)i * M_PI / 12.0);
- v = FIXR(f / (1.0 + f));
- } else {
- v = FIXR(1.0);
- }
- is_table[0][i] = v;
- is_table[1][6 - i] = v;
- }
- /* invalid values */
- for(i=7;i<16;i++)
- is_table[0][i] = is_table[1][i] = 0.0;
-
- for(i=0;i<16;i++) {
- double f;
- int e, k;
-
- for(j=0;j<2;j++) {
- e = -(j + 1) * ((i + 1) >> 1);
- f = pow(2.0, e / 4.0);
- k = i & 1;
- is_table_lsf[j][k ^ 1][i] = FIXR(f);
- is_table_lsf[j][k][i] = FIXR(1.0);
- dprintf("is_table_lsf %d %d: %x %x\n",
- i, j, is_table_lsf[j][0][i], is_table_lsf[j][1][i]);
- }
- }
-
- for(i=0;i<8;i++) {
- float ci, cs, ca;
- ci = ci_table[i];
- cs = 1.0 / sqrt(1.0 + ci * ci);
- ca = cs * ci;
- csa_table[i][0] = FIXHR(cs/4);
- csa_table[i][1] = FIXHR(ca/4);
- csa_table[i][2] = FIXHR(ca/4) + FIXHR(cs/4);
- csa_table[i][3] = FIXHR(ca/4) - FIXHR(cs/4);
- csa_table_float[i][0] = cs;
- csa_table_float[i][1] = ca;
- csa_table_float[i][2] = ca + cs;
- csa_table_float[i][3] = ca - cs;
-// printf("%d %d %d %d\n", FIX(cs), FIX(cs-1), FIX(ca), FIX(cs)-FIX(ca));
-// av_log(NULL, AV_LOG_DEBUG,"%f %f %f %f\n", cs, ca, ca+cs, ca-cs);
- }
-
- /* compute mdct windows */
- for(i=0;i<36;i++) {
- for(j=0; j<4; j++){
- double d;
-
- if(j==2 && i%3 != 1)
- continue;
-
- d= sin(M_PI * (i + 0.5) / 36.0);
- if(j==1){
- if (i>=30) d= 0;
- else if(i>=24) d= sin(M_PI * (i - 18 + 0.5) / 12.0);
- else if(i>=18) d= 1;
- }else if(j==3){
- if (i< 6) d= 0;
- else if(i< 12) d= sin(M_PI * (i - 6 + 0.5) / 12.0);
- else if(i< 18) d= 1;
- }
- //merge last stage of imdct into the window coefficients
- d*= 0.5 / cos(M_PI*(2*i + 19)/72);
-
- if(j==2)
- mdct_win[j][i/3] = FIXHR((d / (1<<5)));
- else
- mdct_win[j][i ] = FIXHR((d / (1<<5)));
-// av_log(NULL, AV_LOG_DEBUG, "%2d %d %f\n", i,j,d / (1<<5));
- }
- }
-
- /* NOTE: we do frequency inversion adter the MDCT by changing
- the sign of the right window coefs */
- for(j=0;j<4;j++) {
- for(i=0;i<36;i+=2) {
- mdct_win[j + 4][i] = mdct_win[j][i];
- mdct_win[j + 4][i + 1] = -mdct_win[j][i + 1];
- }
- }
-
-#if defined(DEBUG)
- for(j=0;j<8;j++) {
- av_log(avctx, AV_LOG_DEBUG, "win%d=\n", j);
- for(i=0;i<36;i++)
- av_log(avctx, AV_LOG_DEBUG, "%f, ", (double)mdct_win[j][i] / FRAC_ONE);
- av_log(avctx, AV_LOG_DEBUG, "\n");
- }
-#endif
- init = 1;
- }
-
-#ifdef DEBUG
- s->frame_count = 0;
-#endif
- if (avctx->codec_id == CODEC_ID_MP3ADU)
- s->adu_mode = 1;
- return 0;
-}
-
-/* tab[i][j] = 1.0 / (2.0 * cos(pi*(2*k+1) / 2^(6 - j))) */
-
-/* cos(i*pi/64) */
-
-#define COS0_0 FIXHR(0.50060299823519630134/2)
-#define COS0_1 FIXHR(0.50547095989754365998/2)
-#define COS0_2 FIXHR(0.51544730992262454697/2)
-#define COS0_3 FIXHR(0.53104259108978417447/2)
-#define COS0_4 FIXHR(0.55310389603444452782/2)
-#define COS0_5 FIXHR(0.58293496820613387367/2)
-#define COS0_6 FIXHR(0.62250412303566481615/2)
-#define COS0_7 FIXHR(0.67480834145500574602/2)
-#define COS0_8 FIXHR(0.74453627100229844977/2)
-#define COS0_9 FIXHR(0.83934964541552703873/2)
-#define COS0_10 FIXHR(0.97256823786196069369/2)
-#define COS0_11 FIXHR(1.16943993343288495515/4)
-#define COS0_12 FIXHR(1.48416461631416627724/4)
-#define COS0_13 FIXHR(2.05778100995341155085/8)
-#define COS0_14 FIXHR(3.40760841846871878570/8)
-#define COS0_15 FIXHR(10.19000812354805681150/32)
-
-#define COS1_0 FIXHR(0.50241928618815570551/2)
-#define COS1_1 FIXHR(0.52249861493968888062/2)
-#define COS1_2 FIXHR(0.56694403481635770368/2)
-#define COS1_3 FIXHR(0.64682178335999012954/2)
-#define COS1_4 FIXHR(0.78815462345125022473/2)
-#define COS1_5 FIXHR(1.06067768599034747134/4)
-#define COS1_6 FIXHR(1.72244709823833392782/4)
-#define COS1_7 FIXHR(5.10114861868916385802/16)
-
-#define COS2_0 FIXHR(0.50979557910415916894/2)
-#define COS2_1 FIXHR(0.60134488693504528054/2)
-#define COS2_2 FIXHR(0.89997622313641570463/2)
-#define COS2_3 FIXHR(2.56291544774150617881/8)
-
-#define COS3_0 FIXHR(0.54119610014619698439/2)
-#define COS3_1 FIXHR(1.30656296487637652785/4)
-
-#define COS4_0 FIXHR(0.70710678118654752439/2)
-
-/* butterfly operator */
-#define BF(a, b, c, s)\
-{\
- tmp0 = tab[a] + tab[b];\
- tmp1 = tab[a] - tab[b];\
- tab[a] = tmp0;\
- tab[b] = MULH(tmp1<<(s), c);\
-}
-
-#define BF1(a, b, c, d)\
-{\
- BF(a, b, COS4_0, 1);\
- BF(c, d,-COS4_0, 1);\
- tab[c] += tab[d];\
-}
-
-#define BF2(a, b, c, d)\
-{\
- BF(a, b, COS4_0, 1);\
- BF(c, d,-COS4_0, 1);\
- tab[c] += tab[d];\
- tab[a] += tab[c];\
- tab[c] += tab[b];\
- tab[b] += tab[d];\
-}
-
-#define ADD(a, b) tab[a] += tab[b]
-
-/* DCT32 without 1/sqrt(2) coef zero scaling. */
-static void dct32(int32_t *out, int32_t *tab)
-{
- int tmp0, tmp1;
-
- /* pass 1 */
- BF( 0, 31, COS0_0 , 1);
- BF(15, 16, COS0_15, 5);
- /* pass 2 */
- BF( 0, 15, COS1_0 , 1);
- BF(16, 31,-COS1_0 , 1);
- /* pass 1 */
- BF( 7, 24, COS0_7 , 1);
- BF( 8, 23, COS0_8 , 1);
- /* pass 2 */
- BF( 7, 8, COS1_7 , 4);
- BF(23, 24,-COS1_7 , 4);
- /* pass 3 */
- BF( 0, 7, COS2_0 , 1);
- BF( 8, 15,-COS2_0 , 1);
- BF(16, 23, COS2_0 , 1);
- BF(24, 31,-COS2_0 , 1);
- /* pass 1 */
- BF( 3, 28, COS0_3 , 1);
- BF(12, 19, COS0_12, 2);
- /* pass 2 */
- BF( 3, 12, COS1_3 , 1);
- BF(19, 28,-COS1_3 , 1);
- /* pass 1 */
- BF( 4, 27, COS0_4 , 1);
- BF(11, 20, COS0_11, 2);
- /* pass 2 */
- BF( 4, 11, COS1_4 , 1);
- BF(20, 27,-COS1_4 , 1);
- /* pass 3 */
- BF( 3, 4, COS2_3 , 3);
- BF(11, 12,-COS2_3 , 3);
- BF(19, 20, COS2_3 , 3);
- BF(27, 28,-COS2_3 , 3);
- /* pass 4 */
- BF( 0, 3, COS3_0 , 1);
- BF( 4, 7,-COS3_0 , 1);
- BF( 8, 11, COS3_0 , 1);
- BF(12, 15,-COS3_0 , 1);
- BF(16, 19, COS3_0 , 1);
- BF(20, 23,-COS3_0 , 1);
- BF(24, 27, COS3_0 , 1);
- BF(28, 31,-COS3_0 , 1);
-
-
-
- /* pass 1 */
- BF( 1, 30, COS0_1 , 1);
- BF(14, 17, COS0_14, 3);
- /* pass 2 */
- BF( 1, 14, COS1_1 , 1);
- BF(17, 30,-COS1_1 , 1);
- /* pass 1 */
- BF( 6, 25, COS0_6 , 1);
- BF( 9, 22, COS0_9 , 1);
- /* pass 2 */
- BF( 6, 9, COS1_6 , 2);
- BF(22, 25,-COS1_6 , 2);
- /* pass 3 */
- BF( 1, 6, COS2_1 , 1);
- BF( 9, 14,-COS2_1 , 1);
- BF(17, 22, COS2_1 , 1);
- BF(25, 30,-COS2_1 , 1);
-
- /* pass 1 */
- BF( 2, 29, COS0_2 , 1);
- BF(13, 18, COS0_13, 3);
- /* pass 2 */
- BF( 2, 13, COS1_2 , 1);
- BF(18, 29,-COS1_2 , 1);
- /* pass 1 */
- BF( 5, 26, COS0_5 , 1);
- BF(10, 21, COS0_10, 1);
- /* pass 2 */
- BF( 5, 10, COS1_5 , 2);
- BF(21, 26,-COS1_5 , 2);
- /* pass 3 */
- BF( 2, 5, COS2_2 , 1);
- BF(10, 13,-COS2_2 , 1);
- BF(18, 21, COS2_2 , 1);
- BF(26, 29,-COS2_2 , 1);
- /* pass 4 */
- BF( 1, 2, COS3_1 , 2);
- BF( 5, 6,-COS3_1 , 2);
- BF( 9, 10, COS3_1 , 2);
- BF(13, 14,-COS3_1 , 2);
- BF(17, 18, COS3_1 , 2);
- BF(21, 22,-COS3_1 , 2);
- BF(25, 26, COS3_1 , 2);
- BF(29, 30,-COS3_1 , 2);
-
- /* pass 5 */
- BF1( 0, 1, 2, 3);
- BF2( 4, 5, 6, 7);
- BF1( 8, 9, 10, 11);
- BF2(12, 13, 14, 15);
- BF1(16, 17, 18, 19);
- BF2(20, 21, 22, 23);
- BF1(24, 25, 26, 27);
- BF2(28, 29, 30, 31);
-
- /* pass 6 */
-
- ADD( 8, 12);
- ADD(12, 10);
- ADD(10, 14);
- ADD(14, 9);
- ADD( 9, 13);
- ADD(13, 11);
- ADD(11, 15);
-
- out[ 0] = tab[0];
- out[16] = tab[1];
- out[ 8] = tab[2];
- out[24] = tab[3];
- out[ 4] = tab[4];
- out[20] = tab[5];
- out[12] = tab[6];
- out[28] = tab[7];
- out[ 2] = tab[8];
- out[18] = tab[9];
- out[10] = tab[10];
- out[26] = tab[11];
- out[ 6] = tab[12];
- out[22] = tab[13];
- out[14] = tab[14];
- out[30] = tab[15];
-
- ADD(24, 28);
- ADD(28, 26);
- ADD(26, 30);
- ADD(30, 25);
- ADD(25, 29);
- ADD(29, 27);
- ADD(27, 31);
-
- out[ 1] = tab[16] + tab[24];
- out[17] = tab[17] + tab[25];
- out[ 9] = tab[18] + tab[26];
- out[25] = tab[19] + tab[27];
- out[ 5] = tab[20] + tab[28];
- out[21] = tab[21] + tab[29];
- out[13] = tab[22] + tab[30];
- out[29] = tab[23] + tab[31];
- out[ 3] = tab[24] + tab[20];
- out[19] = tab[25] + tab[21];
- out[11] = tab[26] + tab[22];
- out[27] = tab[27] + tab[23];
- out[ 7] = tab[28] + tab[18];
- out[23] = tab[29] + tab[19];
- out[15] = tab[30] + tab[17];
- out[31] = tab[31];
-}
-
-#if FRAC_BITS <= 15
-
-static inline int round_sample(int *sum)
-{
- int sum1;
- sum1 = (*sum) >> OUT_SHIFT;
- *sum &= (1<<OUT_SHIFT)-1;
- if (sum1 < OUT_MIN)
- sum1 = OUT_MIN;
- else if (sum1 > OUT_MAX)
- sum1 = OUT_MAX;
- return sum1;
-}
-
-/* signed 16x16 -> 32 multiply add accumulate */
-#define MACS(rt, ra, rb) MAC16(rt, ra, rb)
-
-/* signed 16x16 -> 32 multiply */
-#define MULS(ra, rb) MUL16(ra, rb)
-
-#else
-
-static inline int round_sample(int64_t *sum)
-{
- int sum1;
- sum1 = (int)((*sum) >> OUT_SHIFT);
- *sum &= (1<<OUT_SHIFT)-1;
- if (sum1 < OUT_MIN)
- sum1 = OUT_MIN;
- else if (sum1 > OUT_MAX)
- sum1 = OUT_MAX;
- return sum1;
-}
-
-# define MULS(ra, rb) MUL64(ra, rb)
-#endif
-
-#define SUM8(sum, op, w, p) \
-{ \
- sum op MULS((w)[0 * 64], p[0 * 64]);\
- sum op MULS((w)[1 * 64], p[1 * 64]);\
- sum op MULS((w)[2 * 64], p[2 * 64]);\
- sum op MULS((w)[3 * 64], p[3 * 64]);\
- sum op MULS((w)[4 * 64], p[4 * 64]);\
- sum op MULS((w)[5 * 64], p[5 * 64]);\
- sum op MULS((w)[6 * 64], p[6 * 64]);\
- sum op MULS((w)[7 * 64], p[7 * 64]);\
-}
-
-#define SUM8P2(sum1, op1, sum2, op2, w1, w2, p) \
-{ \
- int tmp;\
- tmp = p[0 * 64];\
- sum1 op1 MULS((w1)[0 * 64], tmp);\
- sum2 op2 MULS((w2)[0 * 64], tmp);\
- tmp = p[1 * 64];\
- sum1 op1 MULS((w1)[1 * 64], tmp);\
- sum2 op2 MULS((w2)[1 * 64], tmp);\
- tmp = p[2 * 64];\
- sum1 op1 MULS((w1)[2 * 64], tmp);\
- sum2 op2 MULS((w2)[2 * 64], tmp);\
- tmp = p[3 * 64];\
- sum1 op1 MULS((w1)[3 * 64], tmp);\
- sum2 op2 MULS((w2)[3 * 64], tmp);\
- tmp = p[4 * 64];\
- sum1 op1 MULS((w1)[4 * 64], tmp);\
- sum2 op2 MULS((w2)[4 * 64], tmp);\
- tmp = p[5 * 64];\
- sum1 op1 MULS((w1)[5 * 64], tmp);\
- sum2 op2 MULS((w2)[5 * 64], tmp);\
- tmp = p[6 * 64];\
- sum1 op1 MULS((w1)[6 * 64], tmp);\
- sum2 op2 MULS((w2)[6 * 64], tmp);\
- tmp = p[7 * 64];\
- sum1 op1 MULS((w1)[7 * 64], tmp);\
- sum2 op2 MULS((w2)[7 * 64], tmp);\
-}
-
-void ff_mpa_synth_init(MPA_INT *window)
-{
- int i;
-
- /* max = 18760, max sum over all 16 coefs : 44736 */
- for(i=0;i<257;i++) {
- int v;
- v = mpa_enwindow[i];
-#if WFRAC_BITS < 16
- v = (v + (1 << (16 - WFRAC_BITS - 1))) >> (16 - WFRAC_BITS);
-#endif
- window[i] = v;
- if ((i & 63) != 0)
- v = -v;
- if (i != 0)
- window[512 - i] = v;
- }
-}
-
-/* 32 sub band synthesis filter. Input: 32 sub band samples, Output:
- 32 samples. */
-/* XXX: optimize by avoiding ring buffer usage */
-void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
- MPA_INT *window, int *dither_state,
- OUT_INT *samples, int incr,
- int32_t sb_samples[SBLIMIT])
-{
- int32_t tmp[32];
- register MPA_INT *synth_buf;
- register const MPA_INT *w, *w2, *p;
- int j, offset, v;
- OUT_INT *samples2;
-#if FRAC_BITS <= 15
- int sum, sum2;
-#else
- int64_t sum, sum2;
-#endif
-
- dct32(tmp, sb_samples);
-
- offset = *synth_buf_offset;
- synth_buf = synth_buf_ptr + offset;
-
- for(j=0;j<32;j++) {
- v = tmp[j];
-#if FRAC_BITS <= 15
- /* NOTE: can cause a loss in precision if very high amplitude
- sound */
- if (v > 32767)
- v = 32767;
- else if (v < -32768)
- v = -32768;
-#endif
- synth_buf[j] = v;
- }
- /* copy to avoid wrap */
- memcpy(synth_buf + 512, synth_buf, 32 * sizeof(MPA_INT));
-
- samples2 = samples + 31 * incr;
- w = window;
- w2 = window + 31;
-
- sum = *dither_state;
- p = synth_buf + 16;
- SUM8(sum, +=, w, p);
- p = synth_buf + 48;
- SUM8(sum, -=, w + 32, p);
- *samples = round_sample(&sum);
- samples += incr;
- w++;
-
- /* we calculate two samples at the same time to avoid one memory
- access per two sample */
- for(j=1;j<16;j++) {
- sum2 = 0;
- p = synth_buf + 16 + j;
- SUM8P2(sum, +=, sum2, -=, w, w2, p);
- p = synth_buf + 48 - j;
- SUM8P2(sum, -=, sum2, -=, w + 32, w2 + 32, p);
-
- *samples = round_sample(&sum);
- samples += incr;
- sum += sum2;
- *samples2 = round_sample(&sum);
- samples2 -= incr;
- w++;
- w2--;
- }
-
- p = synth_buf + 32;
- SUM8(sum, -=, w + 32, p);
- *samples = round_sample(&sum);
- *dither_state= sum;
-
- offset = (offset - 32) & 511;
- *synth_buf_offset = offset;
-}
-
-#define C3 FIXHR(0.86602540378443864676/2)
-
-/* 0.5 / cos(pi*(2*i+1)/36) */
-static const int icos36[9] = {
- FIXR(0.50190991877167369479),
- FIXR(0.51763809020504152469), //0
- FIXR(0.55168895948124587824),
- FIXR(0.61038729438072803416),
- FIXR(0.70710678118654752439), //1
- FIXR(0.87172339781054900991),
- FIXR(1.18310079157624925896),
- FIXR(1.93185165257813657349), //2
- FIXR(5.73685662283492756461),
-};
-
-/* 0.5 / cos(pi*(2*i+1)/36) */
-static const int icos36h[9] = {
- FIXHR(0.50190991877167369479/2),
- FIXHR(0.51763809020504152469/2), //0
- FIXHR(0.55168895948124587824/2),
- FIXHR(0.61038729438072803416/2),
- FIXHR(0.70710678118654752439/2), //1
- FIXHR(0.87172339781054900991/2),
- FIXHR(1.18310079157624925896/4),
- FIXHR(1.93185165257813657349/4), //2
-// FIXHR(5.73685662283492756461),
-};
-
-/* 12 points IMDCT. We compute it "by hand" by factorizing obvious
- cases. */
-static void imdct12(int *out, int *in)
-{
- int in0, in1, in2, in3, in4, in5, t1, t2;
-
- in0= in[0*3];
- in1= in[1*3] + in[0*3];
- in2= in[2*3] + in[1*3];
- in3= in[3*3] + in[2*3];
- in4= in[4*3] + in[3*3];
- in5= in[5*3] + in[4*3];
- in5 += in3;
- in3 += in1;
-
- in2= MULH(2*in2, C3);
- in3= MULH(4*in3, C3);
-
- t1 = in0 - in4;
- t2 = MULH(2*(in1 - in5), icos36h[4]);
-
- out[ 7]=
- out[10]= t1 + t2;
- out[ 1]=
- out[ 4]= t1 - t2;
-
- in0 += in4>>1;
- in4 = in0 + in2;
- in5 += 2*in1;
- in1 = MULH(in5 + in3, icos36h[1]);
- out[ 8]=
- out[ 9]= in4 + in1;
- out[ 2]=
- out[ 3]= in4 - in1;
-
- in0 -= in2;
- in5 = MULH(2*(in5 - in3), icos36h[7]);
- out[ 0]=
- out[ 5]= in0 - in5;
- out[ 6]=
- out[11]= in0 + in5;
-}
-
-/* cos(pi*i/18) */
-#define C1 FIXHR(0.98480775301220805936/2)
-#define C2 FIXHR(0.93969262078590838405/2)
-#define C3 FIXHR(0.86602540378443864676/2)
-#define C4 FIXHR(0.76604444311897803520/2)
-#define C5 FIXHR(0.64278760968653932632/2)
-#define C6 FIXHR(0.5/2)
-#define C7 FIXHR(0.34202014332566873304/2)
-#define C8 FIXHR(0.17364817766693034885/2)
-
-
-/* using Lee like decomposition followed by hand coded 9 points DCT */
-static void imdct36(int *out, int *buf, int *in, int *win)
-{
- int i, j, t0, t1, t2, t3, s0, s1, s2, s3;
- int tmp[18], *tmp1, *in1;
-
- for(i=17;i>=1;i--)
- in[i] += in[i-1];
- for(i=17;i>=3;i-=2)
- in[i] += in[i-2];
-
- for(j=0;j<2;j++) {
- tmp1 = tmp + j;
- in1 = in + j;
-#if 0
-//more accurate but slower
- int64_t t0, t1, t2, t3;
- t2 = in1[2*4] + in1[2*8] - in1[2*2];
-
- t3 = (in1[2*0] + (int64_t)(in1[2*6]>>1))<<32;
- t1 = in1[2*0] - in1[2*6];
- tmp1[ 6] = t1 - (t2>>1);
- tmp1[16] = t1 + t2;
-
- t0 = MUL64(2*(in1[2*2] + in1[2*4]), C2);
- t1 = MUL64( in1[2*4] - in1[2*8] , -2*C8);
- t2 = MUL64(2*(in1[2*2] + in1[2*8]), -C4);
-
- tmp1[10] = (t3 - t0 - t2) >> 32;
- tmp1[ 2] = (t3 + t0 + t1) >> 32;
- tmp1[14] = (t3 + t2 - t1) >> 32;
-
- tmp1[ 4] = MULH(2*(in1[2*5] + in1[2*7] - in1[2*1]), -C3);
- t2 = MUL64(2*(in1[2*1] + in1[2*5]), C1);
- t3 = MUL64( in1[2*5] - in1[2*7] , -2*C7);
- t0 = MUL64(2*in1[2*3], C3);
-
- t1 = MUL64(2*(in1[2*1] + in1[2*7]), -C5);
-
- tmp1[ 0] = (t2 + t3 + t0) >> 32;
- tmp1[12] = (t2 + t1 - t0) >> 32;
- tmp1[ 8] = (t3 - t1 - t0) >> 32;
-#else
- t2 = in1[2*4] + in1[2*8] - in1[2*2];
-
- t3 = in1[2*0] + (in1[2*6]>>1);
- t1 = in1[2*0] - in1[2*6];
- tmp1[ 6] = t1 - (t2>>1);
- tmp1[16] = t1 + t2;
-
- t0 = MULH(2*(in1[2*2] + in1[2*4]), C2);
- t1 = MULH( in1[2*4] - in1[2*8] , -2*C8);
- t2 = MULH(2*(in1[2*2] + in1[2*8]), -C4);
-
- tmp1[10] = t3 - t0 - t2;
- tmp1[ 2] = t3 + t0 + t1;
- tmp1[14] = t3 + t2 - t1;
-
- tmp1[ 4] = MULH(2*(in1[2*5] + in1[2*7] - in1[2*1]), -C3);
- t2 = MULH(2*(in1[2*1] + in1[2*5]), C1);
- t3 = MULH( in1[2*5] - in1[2*7] , -2*C7);
- t0 = MULH(2*in1[2*3], C3);
-
- t1 = MULH(2*(in1[2*1] + in1[2*7]), -C5);
-
- tmp1[ 0] = t2 + t3 + t0;
- tmp1[12] = t2 + t1 - t0;
- tmp1[ 8] = t3 - t1 - t0;
-#endif
- }
-
- i = 0;
- for(j=0;j<4;j++) {
- t0 = tmp[i];
- t1 = tmp[i + 2];
- s0 = t1 + t0;
- s2 = t1 - t0;
-
- t2 = tmp[i + 1];
- t3 = tmp[i + 3];
- s1 = MULH(2*(t3 + t2), icos36h[j]);
- s3 = MULL(t3 - t2, icos36[8 - j]);
-
- t0 = s0 + s1;
- t1 = s0 - s1;
- out[(9 + j)*SBLIMIT] = MULH(t1, win[9 + j]) + buf[9 + j];
- out[(8 - j)*SBLIMIT] = MULH(t1, win[8 - j]) + buf[8 - j];
- buf[9 + j] = MULH(t0, win[18 + 9 + j]);
- buf[8 - j] = MULH(t0, win[18 + 8 - j]);
-
- t0 = s2 + s3;
- t1 = s2 - s3;
- out[(9 + 8 - j)*SBLIMIT] = MULH(t1, win[9 + 8 - j]) + buf[9 + 8 - j];
- out[( j)*SBLIMIT] = MULH(t1, win[ j]) + buf[ j];
- buf[9 + 8 - j] = MULH(t0, win[18 + 9 + 8 - j]);
- buf[ + j] = MULH(t0, win[18 + j]);
- i += 4;
- }
-
- s0 = tmp[16];
- s1 = MULH(2*tmp[17], icos36h[4]);
- t0 = s0 + s1;
- t1 = s0 - s1;
- out[(9 + 4)*SBLIMIT] = MULH(t1, win[9 + 4]) + buf[9 + 4];
- out[(8 - 4)*SBLIMIT] = MULH(t1, win[8 - 4]) + buf[8 - 4];
- buf[9 + 4] = MULH(t0, win[18 + 9 + 4]);
- buf[8 - 4] = MULH(t0, win[18 + 8 - 4]);
-}
-
-/* header decoding. MUST check the header before because no
- consistency check is done there. Return 1 if free format found and
- that the frame size must be computed externally */
-static int decode_header(MPADecodeContext *s, uint32_t header)
-{
- int sample_rate, frame_size, mpeg25, padding;
- int sample_rate_index, bitrate_index;
- if (header & (1<<20)) {
- s->lsf = (header & (1<<19)) ? 0 : 1;
- mpeg25 = 0;
- } else {
- s->lsf = 1;
- mpeg25 = 1;
- }
-
- s->layer = 4 - ((header >> 17) & 3);
- /* extract frequency */
- sample_rate_index = (header >> 10) & 3;
- sample_rate = mpa_freq_tab[sample_rate_index] >> (s->lsf + mpeg25);
- sample_rate_index += 3 * (s->lsf + mpeg25);
- s->sample_rate_index = sample_rate_index;
- s->error_protection = ((header >> 16) & 1) ^ 1;
- s->sample_rate = sample_rate;
-
- bitrate_index = (header >> 12) & 0xf;
- padding = (header >> 9) & 1;
- //extension = (header >> 8) & 1;
- s->mode = (header >> 6) & 3;
- s->mode_ext = (header >> 4) & 3;
- //copyright = (header >> 3) & 1;
- //original = (header >> 2) & 1;
- //emphasis = header & 3;
-
- if (s->mode == MPA_MONO)
- s->nb_channels = 1;
- else
- s->nb_channels = 2;
-
- if (bitrate_index != 0) {
- frame_size = mpa_bitrate_tab[s->lsf][s->layer - 1][bitrate_index];
- s->bit_rate = frame_size * 1000;
- switch(s->layer) {
- case 1:
- frame_size = (frame_size * 12000) / sample_rate;
- frame_size = (frame_size + padding) * 4;
- break;
- case 2:
- frame_size = (frame_size * 144000) / sample_rate;
- frame_size += padding;
- break;
- default:
- case 3:
- frame_size = (frame_size * 144000) / (sample_rate << s->lsf);
- frame_size += padding;
- break;
- }
- s->frame_size = frame_size;
- } else {
- /* if no frame size computed, signal it */
- return 1;
- }
-
-#if defined(DEBUG)
- dprintf("layer%d, %d Hz, %d kbits/s, ",
- s->layer, s->sample_rate, s->bit_rate);
- if (s->nb_channels == 2) {
- if (s->layer == 3) {
- if (s->mode_ext & MODE_EXT_MS_STEREO)
- dprintf("ms-");
- if (s->mode_ext & MODE_EXT_I_STEREO)
- dprintf("i-");
- }
- dprintf("stereo");
- } else {
- dprintf("mono");
- }
- dprintf("\n");
-#endif
- return 0;
-}
-
-/* useful helper to get mpeg audio stream infos. Return -1 if error in
- header, otherwise the coded frame size in bytes */
-int mpa_decode_header(AVCodecContext *avctx, uint32_t head, int *sample_rate)
-{
- MPADecodeContext s1, *s = &s1;
-
- if (ff_mpa_check_header(head) != 0)
- return -1;
-
- if (decode_header(s, head) != 0) {
- return -1;
- }
-
- switch(s->layer) {
- case 1:
- avctx->frame_size = 384;
- break;
- case 2:
- avctx->frame_size = 1152;
- break;
- default:
- case 3:
- if (s->lsf)
- avctx->frame_size = 576;
- else
- avctx->frame_size = 1152;
- break;
- }
-
- *sample_rate = s->sample_rate;
- avctx->channels = s->nb_channels;
- avctx->bit_rate = s->bit_rate;
- avctx->sub_id = s->layer;
- return s->frame_size;
-}
-
-/* return the number of decoded frames */
-static int mp_decode_layer1(MPADecodeContext *s)
-{
- int bound, i, v, n, ch, j, mant;
- uint8_t allocation[MPA_MAX_CHANNELS][SBLIMIT];
- uint8_t scale_factors[MPA_MAX_CHANNELS][SBLIMIT];
-
- if (s->mode == MPA_JSTEREO)
- bound = (s->mode_ext + 1) * 4;
- else
- bound = SBLIMIT;
-
- /* allocation bits */
- for(i=0;i<bound;i++) {
- for(ch=0;ch<s->nb_channels;ch++) {
- allocation[ch][i] = get_bits(&s->gb, 4);
- }
- }
- for(i=bound;i<SBLIMIT;i++) {
- allocation[0][i] = get_bits(&s->gb, 4);
- }
-
- /* scale factors */
- for(i=0;i<bound;i++) {
- for(ch=0;ch<s->nb_channels;ch++) {
- if (allocation[ch][i])
- scale_factors[ch][i] = get_bits(&s->gb, 6);
- }
- }
- for(i=bound;i<SBLIMIT;i++) {
- if (allocation[0][i]) {
- scale_factors[0][i] = get_bits(&s->gb, 6);
- scale_factors[1][i] = get_bits(&s->gb, 6);
- }
- }
-
- /* compute samples */
- for(j=0;j<12;j++) {
- for(i=0;i<bound;i++) {
- for(ch=0;ch<s->nb_channels;ch++) {
- n = allocation[ch][i];
- if (n) {
- mant = get_bits(&s->gb, n + 1);
- v = l1_unscale(n, mant, scale_factors[ch][i]);
- } else {
- v = 0;
- }
- s->sb_samples[ch][j][i] = v;
- }
- }
- for(i=bound;i<SBLIMIT;i++) {
- n = allocation[0][i];
- if (n) {
- mant = get_bits(&s->gb, n + 1);
- v = l1_unscale(n, mant, scale_factors[0][i]);
- s->sb_samples[0][j][i] = v;
- v = l1_unscale(n, mant, scale_factors[1][i]);
- s->sb_samples[1][j][i] = v;
- } else {
- s->sb_samples[0][j][i] = 0;
- s->sb_samples[1][j][i] = 0;
- }
- }
- }
- return 12;
-}
-
-/* bitrate is in kb/s */
-int l2_select_table(int bitrate, int nb_channels, int freq, int lsf)
-{
- int ch_bitrate, table;
-
- ch_bitrate = bitrate / nb_channels;
- if (!lsf) {
- if ((freq == 48000 && ch_bitrate >= 56) ||
- (ch_bitrate >= 56 && ch_bitrate <= 80))
- table = 0;
- else if (freq != 48000 && ch_bitrate >= 96)
- table = 1;
- else if (freq != 32000 && ch_bitrate <= 48)
- table = 2;
- else
- table = 3;
- } else {
- table = 4;
- }
- return table;
-}
-
-static int mp_decode_layer2(MPADecodeContext *s)
-{
- int sblimit; /* number of used subbands */
- const unsigned char *alloc_table;
- int table, bit_alloc_bits, i, j, ch, bound, v;
- unsigned char bit_alloc[MPA_MAX_CHANNELS][SBLIMIT];
- unsigned char scale_code[MPA_MAX_CHANNELS][SBLIMIT];
- unsigned char scale_factors[MPA_MAX_CHANNELS][SBLIMIT][3], *sf;
- int scale, qindex, bits, steps, k, l, m, b;
-
- /* select decoding table */
- table = l2_select_table(s->bit_rate / 1000, s->nb_channels,
- s->sample_rate, s->lsf);
- sblimit = sblimit_table[table];
- alloc_table = alloc_tables[table];
-
- if (s->mode == MPA_JSTEREO)
- bound = (s->mode_ext + 1) * 4;
- else
- bound = sblimit;
-
- dprintf("bound=%d sblimit=%d\n", bound, sblimit);
-
- /* sanity check */
- if( bound > sblimit ) bound = sblimit;
-
- /* parse bit allocation */
- j = 0;
- for(i=0;i<bound;i++) {
- bit_alloc_bits = alloc_table[j];
- for(ch=0;ch<s->nb_channels;ch++) {
- bit_alloc[ch][i] = get_bits(&s->gb, bit_alloc_bits);
- }
- j += 1 << bit_alloc_bits;
- }
- for(i=bound;i<sblimit;i++) {
- bit_alloc_bits = alloc_table[j];
- v = get_bits(&s->gb, bit_alloc_bits);
- bit_alloc[0][i] = v;
- bit_alloc[1][i] = v;
- j += 1 << bit_alloc_bits;
- }
-
-#ifdef DEBUG
- {
- for(ch=0;ch<s->nb_channels;ch++) {
- for(i=0;i<sblimit;i++)
- dprintf(" %d", bit_alloc[ch][i]);
- dprintf("\n");
- }
- }
-#endif
-
- /* scale codes */
- for(i=0;i<sblimit;i++) {
- for(ch=0;ch<s->nb_channels;ch++) {
- if (bit_alloc[ch][i])
- scale_code[ch][i] = get_bits(&s->gb, 2);
- }
- }
-
- /* scale factors */
- for(i=0;i<sblimit;i++) {
- for(ch=0;ch<s->nb_channels;ch++) {
- if (bit_alloc[ch][i]) {
- sf = scale_factors[ch][i];
- switch(scale_code[ch][i]) {
- default:
- case 0:
- sf[0] = get_bits(&s->gb, 6);
- sf[1] = get_bits(&s->gb, 6);
- sf[2] = get_bits(&s->gb, 6);
- break;
- case 2:
- sf[0] = get_bits(&s->gb, 6);
- sf[1] = sf[0];
- sf[2] = sf[0];
- break;
- case 1:
- sf[0] = get_bits(&s->gb, 6);
- sf[2] = get_bits(&s->gb, 6);
- sf[1] = sf[0];
- break;
- case 3:
- sf[0] = get_bits(&s->gb, 6);
- sf[2] = get_bits(&s->gb, 6);
- sf[1] = sf[2];
- break;
- }
- }
- }
- }
-
-#ifdef DEBUG
- for(ch=0;ch<s->nb_channels;ch++) {
- for(i=0;i<sblimit;i++) {
- if (bit_alloc[ch][i]) {
- sf = scale_factors[ch][i];
- dprintf(" %d %d %d", sf[0], sf[1], sf[2]);
- } else {
- dprintf(" -");
- }
- }
- dprintf("\n");
- }
-#endif
-
- /* samples */
- for(k=0;k<3;k++) {
- for(l=0;l<12;l+=3) {
- j = 0;
- for(i=0;i<bound;i++) {
- bit_alloc_bits = alloc_table[j];
- for(ch=0;ch<s->nb_channels;ch++) {
- b = bit_alloc[ch][i];
- if (b) {
- scale = scale_factors[ch][i][k];
- qindex = alloc_table[j+b];
- bits = quant_bits[qindex];
- if (bits < 0) {
- /* 3 values at the same time */
- v = get_bits(&s->gb, -bits);
- steps = quant_steps[qindex];
- s->sb_samples[ch][k * 12 + l + 0][i] =
- l2_unscale_group(steps, v % steps, scale);
- v = v / steps;
- s->sb_samples[ch][k * 12 + l + 1][i] =
- l2_unscale_group(steps, v % steps, scale);
- v = v / steps;
- s->sb_samples[ch][k * 12 + l + 2][i] =
- l2_unscale_group(steps, v, scale);
- } else {
- for(m=0;m<3;m++) {
- v = get_bits(&s->gb, bits);
- v = l1_unscale(bits - 1, v, scale);
- s->sb_samples[ch][k * 12 + l + m][i] = v;
- }
- }
- } else {
- s->sb_samples[ch][k * 12 + l + 0][i] = 0;
- s->sb_samples[ch][k * 12 + l + 1][i] = 0;
- s->sb_samples[ch][k * 12 + l + 2][i] = 0;
- }
- }
- /* next subband in alloc table */
- j += 1 << bit_alloc_bits;
- }
- /* XXX: find a way to avoid this duplication of code */
- for(i=bound;i<sblimit;i++) {
- bit_alloc_bits = alloc_table[j];
- b = bit_alloc[0][i];
- if (b) {
- int mant, scale0, scale1;
- scale0 = scale_factors[0][i][k];
- scale1 = scale_factors[1][i][k];
- qindex = alloc_table[j+b];
- bits = quant_bits[qindex];
- if (bits < 0) {
- /* 3 values at the same time */
- v = get_bits(&s->gb, -bits);
- steps = quant_steps[qindex];
- mant = v % steps;
- v = v / steps;
- s->sb_samples[0][k * 12 + l + 0][i] =
- l2_unscale_group(steps, mant, scale0);
- s->sb_samples[1][k * 12 + l + 0][i] =
- l2_unscale_group(steps, mant, scale1);
- mant = v % steps;
- v = v / steps;
- s->sb_samples[0][k * 12 + l + 1][i] =
- l2_unscale_group(steps, mant, scale0);
- s->sb_samples[1][k * 12 + l + 1][i] =
- l2_unscale_group(steps, mant, scale1);
- s->sb_samples[0][k * 12 + l + 2][i] =
- l2_unscale_group(steps, v, scale0);
- s->sb_samples[1][k * 12 + l + 2][i] =
- l2_unscale_group(steps, v, scale1);
- } else {
- for(m=0;m<3;m++) {
- mant = get_bits(&s->gb, bits);
- s->sb_samples[0][k * 12 + l + m][i] =
- l1_unscale(bits - 1, mant, scale0);
- s->sb_samples[1][k * 12 + l + m][i] =
- l1_unscale(bits - 1, mant, scale1);
- }
- }
- } else {
- s->sb_samples[0][k * 12 + l + 0][i] = 0;
- s->sb_samples[0][k * 12 + l + 1][i] = 0;
- s->sb_samples[0][k * 12 + l + 2][i] = 0;
- s->sb_samples[1][k * 12 + l + 0][i] = 0;
- s->sb_samples[1][k * 12 + l + 1][i] = 0;
- s->sb_samples[1][k * 12 + l + 2][i] = 0;
- }
- /* next subband in alloc table */
- j += 1 << bit_alloc_bits;
- }
- /* fill remaining samples to zero */
- for(i=sblimit;i<SBLIMIT;i++) {
- for(ch=0;ch<s->nb_channels;ch++) {
- s->sb_samples[ch][k * 12 + l + 0][i] = 0;
- s->sb_samples[ch][k * 12 + l + 1][i] = 0;
- s->sb_samples[ch][k * 12 + l + 2][i] = 0;
- }
- }
- }
- }
- return 3 * 12;
-}
-
-static inline void lsf_sf_expand(int *slen,
- int sf, int n1, int n2, int n3)
-{
- if (n3) {
- slen[3] = sf % n3;
- sf /= n3;
- } else {
- slen[3] = 0;
- }
- if (n2) {
- slen[2] = sf % n2;
- sf /= n2;
- } else {
- slen[2] = 0;
- }
- slen[1] = sf % n1;
- sf /= n1;
- slen[0] = sf;
-}
-
-static void exponents_from_scale_factors(MPADecodeContext *s,
- GranuleDef *g,
- int16_t *exponents)
-{
- const uint8_t *bstab, *pretab;
- int len, i, j, k, l, v0, shift, gain, gains[3];
- int16_t *exp_ptr;
-
- exp_ptr = exponents;
- gain = g->global_gain - 210;
- shift = g->scalefac_scale + 1;
-
- bstab = band_size_long[s->sample_rate_index];
- pretab = mpa_pretab[g->preflag];
- for(i=0;i<g->long_end;i++) {
- v0 = gain - ((g->scale_factors[i] + pretab[i]) << shift) + 400;
- len = bstab[i];
- for(j=len;j>0;j--)
- *exp_ptr++ = v0;
- }
-
- if (g->short_start < 13) {
- bstab = band_size_short[s->sample_rate_index];
- gains[0] = gain - (g->subblock_gain[0] << 3);
- gains[1] = gain - (g->subblock_gain[1] << 3);
- gains[2] = gain - (g->subblock_gain[2] << 3);
- k = g->long_end;
- for(i=g->short_start;i<13;i++) {
- len = bstab[i];
- for(l=0;l<3;l++) {
- v0 = gains[l] - (g->scale_factors[k++] << shift) + 400;
- for(j=len;j>0;j--)
- *exp_ptr++ = v0;
- }
- }
- }
-}
-
-/* handle n = 0 too */
-static inline int get_bitsz(GetBitContext *s, int n)
-{
- if (n == 0)
- return 0;
- else
- return get_bits(s, n);
-}
-
-static int huffman_decode(MPADecodeContext *s, GranuleDef *g,
- int16_t *exponents, int end_pos2)
-{
- int s_index;
- int i;
- int last_pos, bits_left;
- VLC *vlc;
- int end_pos= FFMIN(end_pos2, s->gb.size_in_bits);
-
- /* low frequencies (called big values) */
- s_index = 0;
- for(i=0;i<3;i++) {
- int j, k, l, linbits;
- j = g->region_size[i];
- if (j == 0)
- continue;
- /* select vlc table */
- k = g->table_select[i];
- l = mpa_huff_data[k][0];
- linbits = mpa_huff_data[k][1];
- vlc = &huff_vlc[l];
-
- if(!l){
- memset(&g->sb_hybrid[s_index], 0, sizeof(*g->sb_hybrid)*2*j);
- s_index += 2*j;
- continue;
- }
-
- /* read huffcode and compute each couple */
- for(;j>0;j--) {
- int exponent, x, y, v;
- int pos= get_bits_count(&s->gb);
-
- if (pos >= end_pos){
-// av_log(NULL, AV_LOG_ERROR, "pos: %d %d %d %d\n", pos, end_pos, end_pos2, s_index);
- if(s->in_gb.buffer && pos >= s->gb.size_in_bits){
- s->gb= s->in_gb;
- s->in_gb.buffer=NULL;
- assert((get_bits_count(&s->gb) & 7) == 0);
- skip_bits_long(&s->gb, pos - end_pos);
- end_pos2=
- end_pos= end_pos2 + get_bits_count(&s->gb) - pos;
- pos= get_bits_count(&s->gb);
- }
-// av_log(NULL, AV_LOG_ERROR, "new pos: %d %d\n", pos, end_pos);
- if(pos >= end_pos)
- break;
- }
- y = get_vlc2(&s->gb, vlc->table, 7, 3);
-
- if(!y){
- g->sb_hybrid[s_index ] =
- g->sb_hybrid[s_index+1] = 0;
- s_index += 2;
- continue;
- }
-
- exponent= exponents[s_index];
-
- dprintf("region=%d n=%d x=%d y=%d exp=%d\n",
- i, g->region_size[i] - j, x, y, exponent);
- if(y&16){
- x = y >> 5;
- y = y & 0x0f;
- if (x < 15){
- v = expval_table[ exponent ][ x ];
-// v = expval_table[ (exponent&3) ][ x ] >> FFMIN(0 - (exponent>>2), 31);
- }else{
- x += get_bitsz(&s->gb, linbits);
- v = l3_unscale(x, exponent);
- }
- if (get_bits1(&s->gb))
- v = -v;
- g->sb_hybrid[s_index] = v;
- if (y < 15){
- v = expval_table[ exponent ][ y ];
- }else{
- y += get_bitsz(&s->gb, linbits);
- v = l3_unscale(y, exponent);
- }
- if (get_bits1(&s->gb))
- v = -v;
- g->sb_hybrid[s_index+1] = v;
- }else{
- x = y >> 5;
- y = y & 0x0f;
- x += y;
- if (x < 15){
- v = expval_table[ exponent ][ x ];
- }else{
- x += get_bitsz(&s->gb, linbits);
- v = l3_unscale(x, exponent);
- }
- if (get_bits1(&s->gb))
- v = -v;
- g->sb_hybrid[s_index+!!y] = v;
- g->sb_hybrid[s_index+ !y] = 0;
- }
- s_index+=2;
- }
- }
-
- /* high frequencies */
- vlc = &huff_quad_vlc[g->count1table_select];
- last_pos=0;
- while (s_index <= 572) {
- int pos, code;
- pos = get_bits_count(&s->gb);
- if (pos >= end_pos) {
- if (pos > end_pos2 && last_pos){
- /* some encoders generate an incorrect size for this
- part. We must go back into the data */
- s_index -= 4;
- skip_bits_long(&s->gb, last_pos - pos);
- av_log(NULL, AV_LOG_INFO, "overread, skip %d enddists: %d %d\n", last_pos - pos, end_pos-pos, end_pos2-pos);
- if(s->error_resilience >= FF_ER_COMPLIANT)
- s_index=0;
- break;
- }
-// av_log(NULL, AV_LOG_ERROR, "pos2: %d %d %d %d\n", pos, end_pos, end_pos2, s_index);
- if(s->in_gb.buffer && pos >= s->gb.size_in_bits){
- s->gb= s->in_gb;
- s->in_gb.buffer=NULL;
- assert((get_bits_count(&s->gb) & 7) == 0);
- skip_bits_long(&s->gb, pos - end_pos);
- end_pos2=
- end_pos= end_pos2 + get_bits_count(&s->gb) - pos;
- pos= get_bits_count(&s->gb);
- }
-// av_log(NULL, AV_LOG_ERROR, "new pos2: %d %d %d\n", pos, end_pos, s_index);
- if(pos >= end_pos)
- break;
- }
- last_pos= pos;
-
- code = get_vlc2(&s->gb, vlc->table, vlc->bits, 1);
- dprintf("t=%d code=%d\n", g->count1table_select, code);
- g->sb_hybrid[s_index+0]=
- g->sb_hybrid[s_index+1]=
- g->sb_hybrid[s_index+2]=
- g->sb_hybrid[s_index+3]= 0;
- while(code){
- const static int idxtab[16]={3,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0};
- int v;
- int pos= s_index+idxtab[code];
- code ^= 8>>idxtab[code];
- v = exp_table[ exponents[pos] ];
-// v = exp_table[ (exponents[pos]&3) ] >> FFMIN(0 - (exponents[pos]>>2), 31);
- if(get_bits1(&s->gb))
- v = -v;
- g->sb_hybrid[pos] = v;
- }
- s_index+=4;
- }
- /* skip extension bits */
- bits_left = end_pos - get_bits_count(&s->gb);
-//av_log(NULL, AV_LOG_ERROR, "left:%d buf:%p\n", bits_left, s->in_gb.buffer);
- if (bits_left < 0 || bits_left > 500) {
- av_log(NULL, AV_LOG_ERROR, "bits_left=%d\n", bits_left);
- s_index=0;
- }else if(bits_left > 0 && s->error_resilience >= FF_ER_AGGRESSIVE){
- av_log(NULL, AV_LOG_ERROR, "bits_left=%d\n", bits_left);
- s_index=0;
- }
- memset(&g->sb_hybrid[s_index], 0, sizeof(*g->sb_hybrid)*(576 - s_index));
- skip_bits_long(&s->gb, bits_left);
-
- return 0;
-}
-
-/* Reorder short blocks from bitstream order to interleaved order. It
- would be faster to do it in parsing, but the code would be far more
- complicated */
-static void reorder_block(MPADecodeContext *s, GranuleDef *g)
-{
- int i, j, len;
- int32_t *ptr, *dst, *ptr1;
- int32_t tmp[576];
-
- if (g->block_type != 2)
- return;
-
- if (g->switch_point) {
- if (s->sample_rate_index != 8) {
- ptr = g->sb_hybrid + 36;
- } else {
- ptr = g->sb_hybrid + 48;
- }
- } else {
- ptr = g->sb_hybrid;
- }
-
- for(i=g->short_start;i<13;i++) {
- len = band_size_short[s->sample_rate_index][i];
- ptr1 = ptr;
- dst = tmp;
- for(j=len;j>0;j--) {
- *dst++ = ptr[0*len];
- *dst++ = ptr[1*len];
- *dst++ = ptr[2*len];
- ptr++;
- }
- ptr+=2*len;
- memcpy(ptr1, tmp, len * 3 * sizeof(*ptr1));
- }
-}
-
-#define ISQRT2 FIXR(0.70710678118654752440)
-
-static void compute_stereo(MPADecodeContext *s,
- GranuleDef *g0, GranuleDef *g1)
-{
- int i, j, k, l;
- int32_t v1, v2;
- int sf_max, tmp0, tmp1, sf, len, non_zero_found;
- int32_t (*is_tab)[16];
- int32_t *tab0, *tab1;
- int non_zero_found_short[3];
-
- /* intensity stereo */
- if (s->mode_ext & MODE_EXT_I_STEREO) {
- if (!s->lsf) {
- is_tab = is_table;
- sf_max = 7;
- } else {
- is_tab = is_table_lsf[g1->scalefac_compress & 1];
- sf_max = 16;
- }
-
- tab0 = g0->sb_hybrid + 576;
- tab1 = g1->sb_hybrid + 576;
-
- non_zero_found_short[0] = 0;
- non_zero_found_short[1] = 0;
- non_zero_found_short[2] = 0;
- k = (13 - g1->short_start) * 3 + g1->long_end - 3;
- for(i = 12;i >= g1->short_start;i--) {
- /* for last band, use previous scale factor */
- if (i != 11)
- k -= 3;
- len = band_size_short[s->sample_rate_index][i];
- for(l=2;l>=0;l--) {
- tab0 -= len;
- tab1 -= len;
- if (!non_zero_found_short[l]) {
- /* test if non zero band. if so, stop doing i-stereo */
- for(j=0;j<len;j++) {
- if (tab1[j] != 0) {
- non_zero_found_short[l] = 1;
- goto found1;
- }
- }
- sf = g1->scale_factors[k + l];
- if (sf >= sf_max)
- goto found1;
-
- v1 = is_tab[0][sf];
- v2 = is_tab[1][sf];
- for(j=0;j<len;j++) {
- tmp0 = tab0[j];
- tab0[j] = MULL(tmp0, v1);
- tab1[j] = MULL(tmp0, v2);
- }
- } else {
- found1:
- if (s->mode_ext & MODE_EXT_MS_STEREO) {
- /* lower part of the spectrum : do ms stereo
- if enabled */
- for(j=0;j<len;j++) {
- tmp0 = tab0[j];
- tmp1 = tab1[j];
- tab0[j] = MULL(tmp0 + tmp1, ISQRT2);
- tab1[j] = MULL(tmp0 - tmp1, ISQRT2);
- }
- }
- }
- }
- }
-
- non_zero_found = non_zero_found_short[0] |
- non_zero_found_short[1] |
- non_zero_found_short[2];
-
- for(i = g1->long_end - 1;i >= 0;i--) {
- len = band_size_long[s->sample_rate_index][i];
- tab0 -= len;
- tab1 -= len;
- /* test if non zero band. if so, stop doing i-stereo */
- if (!non_zero_found) {
- for(j=0;j<len;j++) {
- if (tab1[j] != 0) {
- non_zero_found = 1;
- goto found2;
- }
- }
- /* for last band, use previous scale factor */
- k = (i == 21) ? 20 : i;
- sf = g1->scale_factors[k];
- if (sf >= sf_max)
- goto found2;
- v1 = is_tab[0][sf];
- v2 = is_tab[1][sf];
- for(j=0;j<len;j++) {
- tmp0 = tab0[j];
- tab0[j] = MULL(tmp0, v1);
- tab1[j] = MULL(tmp0, v2);
- }
- } else {
- found2:
- if (s->mode_ext & MODE_EXT_MS_STEREO) {
- /* lower part of the spectrum : do ms stereo
- if enabled */
- for(j=0;j<len;j++) {
- tmp0 = tab0[j];
- tmp1 = tab1[j];
- tab0[j] = MULL(tmp0 + tmp1, ISQRT2);
- tab1[j] = MULL(tmp0 - tmp1, ISQRT2);
- }
- }
- }
- }
- } else if (s->mode_ext & MODE_EXT_MS_STEREO) {
- /* ms stereo ONLY */
- /* NOTE: the 1/sqrt(2) normalization factor is included in the
- global gain */
- tab0 = g0->sb_hybrid;
- tab1 = g1->sb_hybrid;
- for(i=0;i<576;i++) {
- tmp0 = tab0[i];
- tmp1 = tab1[i];
- tab0[i] = tmp0 + tmp1;
- tab1[i] = tmp0 - tmp1;
- }
- }
-}
-
-static void compute_antialias_integer(MPADecodeContext *s,
- GranuleDef *g)
-{
- int32_t *ptr, *csa;
- int n, i;
-
- /* we antialias only "long" bands */
- if (g->block_type == 2) {
- if (!g->switch_point)
- return;
- /* XXX: check this for 8000Hz case */
- n = 1;
- } else {
- n = SBLIMIT - 1;
- }
-
- ptr = g->sb_hybrid + 18;
- for(i = n;i > 0;i--) {
- int tmp0, tmp1, tmp2;
- csa = &csa_table[0][0];
-#define INT_AA(j) \
- tmp0 = ptr[-1-j];\
- tmp1 = ptr[ j];\
- tmp2= MULH(tmp0 + tmp1, csa[0+4*j]);\
- ptr[-1-j] = 4*(tmp2 - MULH(tmp1, csa[2+4*j]));\
- ptr[ j] = 4*(tmp2 + MULH(tmp0, csa[3+4*j]));
-
- INT_AA(0)
- INT_AA(1)
- INT_AA(2)
- INT_AA(3)
- INT_AA(4)
- INT_AA(5)
- INT_AA(6)
- INT_AA(7)
-
- ptr += 18;
- }
-}
-
-static void compute_antialias_float(MPADecodeContext *s,
- GranuleDef *g)
-{
- int32_t *ptr;
- int n, i;
-
- /* we antialias only "long" bands */
- if (g->block_type == 2) {
- if (!g->switch_point)
- return;
- /* XXX: check this for 8000Hz case */
- n = 1;
- } else {
- n = SBLIMIT - 1;
- }
-
- ptr = g->sb_hybrid + 18;
- for(i = n;i > 0;i--) {
- float tmp0, tmp1;
- float *csa = &csa_table_float[0][0];
-#define FLOAT_AA(j)\
- tmp0= ptr[-1-j];\
- tmp1= ptr[ j];\
- ptr[-1-j] = lrintf(tmp0 * csa[0+4*j] - tmp1 * csa[1+4*j]);\
- ptr[ j] = lrintf(tmp0 * csa[1+4*j] + tmp1 * csa[0+4*j]);
-
- FLOAT_AA(0)
- FLOAT_AA(1)
- FLOAT_AA(2)
- FLOAT_AA(3)
- FLOAT_AA(4)
- FLOAT_AA(5)
- FLOAT_AA(6)
- FLOAT_AA(7)
-
- ptr += 18;
- }
-}
-
-static void compute_imdct(MPADecodeContext *s,
- GranuleDef *g,
- int32_t *sb_samples,
- int32_t *mdct_buf)
-{
- int32_t *ptr, *win, *win1, *buf, *out_ptr, *ptr1;
- int32_t out2[12];
- int i, j, mdct_long_end, v, sblimit;
-
- /* find last non zero block */
- ptr = g->sb_hybrid + 576;
- ptr1 = g->sb_hybrid + 2 * 18;
- while (ptr >= ptr1) {
- ptr -= 6;
- v = ptr[0] | ptr[1] | ptr[2] | ptr[3] | ptr[4] | ptr[5];
- if (v != 0)
- break;
- }
- sblimit = ((ptr - g->sb_hybrid) / 18) + 1;
-
- if (g->block_type == 2) {
- /* XXX: check for 8000 Hz */
- if (g->switch_point)
- mdct_long_end = 2;
- else
- mdct_long_end = 0;
- } else {
- mdct_long_end = sblimit;
- }
-
- buf = mdct_buf;
- ptr = g->sb_hybrid;
- for(j=0;j<mdct_long_end;j++) {
- /* apply window & overlap with previous buffer */
- out_ptr = sb_samples + j;
- /* select window */
- if (g->switch_point && j < 2)
- win1 = mdct_win[0];
- else
- win1 = mdct_win[g->block_type];
- /* select frequency inversion */
- win = win1 + ((4 * 36) & -(j & 1));
- imdct36(out_ptr, buf, ptr, win);
- out_ptr += 18*SBLIMIT;
- ptr += 18;
- buf += 18;
- }
- for(j=mdct_long_end;j<sblimit;j++) {
- /* select frequency inversion */
- win = mdct_win[2] + ((4 * 36) & -(j & 1));
- out_ptr = sb_samples + j;
-
- for(i=0; i<6; i++){
- *out_ptr = buf[i];
- out_ptr += SBLIMIT;
- }
- imdct12(out2, ptr + 0);
- for(i=0;i<6;i++) {
- *out_ptr = MULH(out2[i], win[i]) + buf[i + 6*1];
- buf[i + 6*2] = MULH(out2[i + 6], win[i + 6]);
- out_ptr += SBLIMIT;
- }
- imdct12(out2, ptr + 1);
- for(i=0;i<6;i++) {
- *out_ptr = MULH(out2[i], win[i]) + buf[i + 6*2];
- buf[i + 6*0] = MULH(out2[i + 6], win[i + 6]);
- out_ptr += SBLIMIT;
- }
- imdct12(out2, ptr + 2);
- for(i=0;i<6;i++) {
- buf[i + 6*0] = MULH(out2[i], win[i]) + buf[i + 6*0];
- buf[i + 6*1] = MULH(out2[i + 6], win[i + 6]);
- buf[i + 6*2] = 0;
- }
- ptr += 18;
- buf += 18;
- }
- /* zero bands */
- for(j=sblimit;j<SBLIMIT;j++) {
- /* overlap */
- out_ptr = sb_samples + j;
- for(i=0;i<18;i++) {
- *out_ptr = buf[i];
- buf[i] = 0;
- out_ptr += SBLIMIT;
- }
- buf += 18;
- }
-}
-
-#if defined(DEBUG)
-void sample_dump(int fnum, int32_t *tab, int n)
-{
- static FILE *files[16], *f;
- char buf[512];
- int i;
- int32_t v;
-
- f = files[fnum];
- if (!f) {
- snprintf(buf, sizeof(buf), "/tmp/out%d.%s.pcm",
- fnum,
-#ifdef USE_HIGHPRECISION
- "hp"
-#else
- "lp"
-#endif
- );
- f = fopen(buf, "w");
- if (!f)
- return;
- files[fnum] = f;
- }
-
- if (fnum == 0) {
- static int pos = 0;
- av_log(NULL, AV_LOG_DEBUG, "pos=%d\n", pos);
- for(i=0;i<n;i++) {
- av_log(NULL, AV_LOG_DEBUG, " %0.4f", (double)tab[i] / FRAC_ONE);
- if ((i % 18) == 17)
- av_log(NULL, AV_LOG_DEBUG, "\n");
- }
- pos += n;
- }
- for(i=0;i<n;i++) {
- /* normalize to 23 frac bits */
- v = tab[i] << (23 - FRAC_BITS);
- fwrite(&v, 1, sizeof(int32_t), f);
- }
-}
-#endif
-
-
-/* main layer3 decoding function */
-static int mp_decode_layer3(MPADecodeContext *s)
-{
- int nb_granules, main_data_begin, private_bits;
- int gr, ch, blocksplit_flag, i, j, k, n, bits_pos;
- GranuleDef granules[2][2], *g;
- int16_t exponents[576];
-
- /* read side info */
- if (s->lsf) {
- main_data_begin = get_bits(&s->gb, 8);
- private_bits = get_bits(&s->gb, s->nb_channels);
- nb_granules = 1;
- } else {
- main_data_begin = get_bits(&s->gb, 9);
- if (s->nb_channels == 2)
- private_bits = get_bits(&s->gb, 3);
- else
- private_bits = get_bits(&s->gb, 5);
- nb_granules = 2;
- for(ch=0;ch<s->nb_channels;ch++) {
- granules[ch][0].scfsi = 0; /* all scale factors are transmitted */
- granules[ch][1].scfsi = get_bits(&s->gb, 4);
- }
- }
-
- for(gr=0;gr<nb_granules;gr++) {
- for(ch=0;ch<s->nb_channels;ch++) {
- dprintf("gr=%d ch=%d: side_info\n", gr, ch);
- g = &granules[ch][gr];
- g->part2_3_length = get_bits(&s->gb, 12);
- g->big_values = get_bits(&s->gb, 9);
- if(g->big_values > 288){
- av_log(NULL, AV_LOG_ERROR, "big_values too big\n");
- return -1;
- }
-
- g->global_gain = get_bits(&s->gb, 8);
- /* if MS stereo only is selected, we precompute the
- 1/sqrt(2) renormalization factor */
- if ((s->mode_ext & (MODE_EXT_MS_STEREO | MODE_EXT_I_STEREO)) ==
- MODE_EXT_MS_STEREO)
- g->global_gain -= 2;
- if (s->lsf)
- g->scalefac_compress = get_bits(&s->gb, 9);
- else
- g->scalefac_compress = get_bits(&s->gb, 4);
- blocksplit_flag = get_bits(&s->gb, 1);
- if (blocksplit_flag) {
- g->block_type = get_bits(&s->gb, 2);
- if (g->block_type == 0){
- av_log(NULL, AV_LOG_ERROR, "invalid block type\n");
- return -1;
- }
- g->switch_point = get_bits(&s->gb, 1);
- for(i=0;i<2;i++)
- g->table_select[i] = get_bits(&s->gb, 5);
- for(i=0;i<3;i++)
- g->subblock_gain[i] = get_bits(&s->gb, 3);
- /* compute huffman coded region sizes */
- if (g->block_type == 2)
- g->region_size[0] = (36 / 2);
- else {
- if (s->sample_rate_index <= 2)
- g->region_size[0] = (36 / 2);
- else if (s->sample_rate_index != 8)
- g->region_size[0] = (54 / 2);
- else
- g->region_size[0] = (108 / 2);
- }
- g->region_size[1] = (576 / 2);
- } else {
- int region_address1, region_address2, l;
- g->block_type = 0;
- g->switch_point = 0;
- for(i=0;i<3;i++)
- g->table_select[i] = get_bits(&s->gb, 5);
- /* compute huffman coded region sizes */
- region_address1 = get_bits(&s->gb, 4);
- region_address2 = get_bits(&s->gb, 3);
- dprintf("region1=%d region2=%d\n",
- region_address1, region_address2);
- g->region_size[0] =
- band_index_long[s->sample_rate_index][region_address1 + 1] >> 1;
- l = region_address1 + region_address2 + 2;
- /* should not overflow */
- if (l > 22)
- l = 22;
- g->region_size[1] =
- band_index_long[s->sample_rate_index][l] >> 1;
- }
- /* convert region offsets to region sizes and truncate
- size to big_values */
- g->region_size[2] = (576 / 2);
- j = 0;
- for(i=0;i<3;i++) {
- k = FFMIN(g->region_size[i], g->big_values);
- g->region_size[i] = k - j;
- j = k;
- }
-
- /* compute band indexes */
- if (g->block_type == 2) {
- if (g->switch_point) {
- /* if switched mode, we handle the 36 first samples as
- long blocks. For 8000Hz, we handle the 48 first
- exponents as long blocks (XXX: check this!) */
- if (s->sample_rate_index <= 2)
- g->long_end = 8;
- else if (s->sample_rate_index != 8)
- g->long_end = 6;
- else
- g->long_end = 4; /* 8000 Hz */
-
- g->short_start = 2 + (s->sample_rate_index != 8);
- } else {
- g->long_end = 0;
- g->short_start = 0;
- }
- } else {
- g->short_start = 13;
- g->long_end = 22;
- }
-
- g->preflag = 0;
- if (!s->lsf)
- g->preflag = get_bits(&s->gb, 1);
- g->scalefac_scale = get_bits(&s->gb, 1);
- g->count1table_select = get_bits(&s->gb, 1);
- dprintf("block_type=%d switch_point=%d\n",
- g->block_type, g->switch_point);
- }
- }
-
- if (!s->adu_mode) {
- const uint8_t *ptr = s->gb.buffer + (get_bits_count(&s->gb)>>3);
- assert((get_bits_count(&s->gb) & 7) == 0);
- /* now we get bits from the main_data_begin offset */
- dprintf("seekback: %d\n", main_data_begin);
-//av_log(NULL, AV_LOG_ERROR, "backstep:%d, lastbuf:%d\n", main_data_begin, s->last_buf_size);
-
- memcpy(s->last_buf + s->last_buf_size, ptr, EXTRABYTES);
- s->in_gb= s->gb;
- init_get_bits(&s->gb, s->last_buf, s->last_buf_size*8);
- skip_bits_long(&s->gb, 8*(s->last_buf_size - main_data_begin));
- }
-
- for(gr=0;gr<nb_granules;gr++) {
- for(ch=0;ch<s->nb_channels;ch++) {
- g = &granules[ch][gr];
- if(get_bits_count(&s->gb)<0){
- av_log(NULL, AV_LOG_ERROR, "mdb:%d, lastbuf:%d skiping granule %d\n",
- main_data_begin, s->last_buf_size, gr);
- skip_bits_long(&s->gb, g->part2_3_length);
- memset(g->sb_hybrid, 0, sizeof(g->sb_hybrid));
- if(get_bits_count(&s->gb) >= s->gb.size_in_bits && s->in_gb.buffer){
- skip_bits_long(&s->in_gb, get_bits_count(&s->gb) - s->gb.size_in_bits);
- s->gb= s->in_gb;
- s->in_gb.buffer=NULL;
- }
- continue;
- }
-
- bits_pos = get_bits_count(&s->gb);
-
- if (!s->lsf) {
- uint8_t *sc;
- int slen, slen1, slen2;
-
- /* MPEG1 scale factors */
- slen1 = slen_table[0][g->scalefac_compress];
- slen2 = slen_table[1][g->scalefac_compress];
- dprintf("slen1=%d slen2=%d\n", slen1, slen2);
- if (g->block_type == 2) {
- n = g->switch_point ? 17 : 18;
- j = 0;
- if(slen1){
- for(i=0;i<n;i++)
- g->scale_factors[j++] = get_bits(&s->gb, slen1);
- }else{
- for(i=0;i<n;i++)
- g->scale_factors[j++] = 0;
- }
- if(slen2){
- for(i=0;i<18;i++)
- g->scale_factors[j++] = get_bits(&s->gb, slen2);
- for(i=0;i<3;i++)
- g->scale_factors[j++] = 0;
- }else{
- for(i=0;i<21;i++)
- g->scale_factors[j++] = 0;
- }
- } else {
- sc = granules[ch][0].scale_factors;
- j = 0;
- for(k=0;k<4;k++) {
- n = (k == 0 ? 6 : 5);
- if ((g->scfsi & (0x8 >> k)) == 0) {
- slen = (k < 2) ? slen1 : slen2;
- if(slen){
- for(i=0;i<n;i++)
- g->scale_factors[j++] = get_bits(&s->gb, slen);
- }else{
- for(i=0;i<n;i++)
- g->scale_factors[j++] = 0;
- }
- } else {
- /* simply copy from last granule */
- for(i=0;i<n;i++) {
- g->scale_factors[j] = sc[j];
- j++;
- }
- }
- }
- g->scale_factors[j++] = 0;
- }
-#if defined(DEBUG)
- {
- dprintf("scfsi=%x gr=%d ch=%d scale_factors:\n",
- g->scfsi, gr, ch);
- for(i=0;i<j;i++)
- dprintf(" %d", g->scale_factors[i]);
- dprintf("\n");
- }
-#endif
- } else {
- int tindex, tindex2, slen[4], sl, sf;
-
- /* LSF scale factors */
- if (g->block_type == 2) {
- tindex = g->switch_point ? 2 : 1;
- } else {
- tindex = 0;
- }
- sf = g->scalefac_compress;
- if ((s->mode_ext & MODE_EXT_I_STEREO) && ch == 1) {
- /* intensity stereo case */
- sf >>= 1;
- if (sf < 180) {
- lsf_sf_expand(slen, sf, 6, 6, 0);
- tindex2 = 3;
- } else if (sf < 244) {
- lsf_sf_expand(slen, sf - 180, 4, 4, 0);
- tindex2 = 4;
- } else {
- lsf_sf_expand(slen, sf - 244, 3, 0, 0);
- tindex2 = 5;
- }
- } else {
- /* normal case */
- if (sf < 400) {
- lsf_sf_expand(slen, sf, 5, 4, 4);
- tindex2 = 0;
- } else if (sf < 500) {
- lsf_sf_expand(slen, sf - 400, 5, 4, 0);
- tindex2 = 1;
- } else {
- lsf_sf_expand(slen, sf - 500, 3, 0, 0);
- tindex2 = 2;
- g->preflag = 1;
- }
- }
-
- j = 0;
- for(k=0;k<4;k++) {
- n = lsf_nsf_table[tindex2][tindex][k];
- sl = slen[k];
- if(sl){
- for(i=0;i<n;i++)
- g->scale_factors[j++] = get_bits(&s->gb, sl);
- }else{
- for(i=0;i<n;i++)
- g->scale_factors[j++] = 0;
- }
- }
- /* XXX: should compute exact size */
- for(;j<40;j++)
- g->scale_factors[j] = 0;
-#if defined(DEBUG)
- {
- dprintf("gr=%d ch=%d scale_factors:\n",
- gr, ch);
- for(i=0;i<40;i++)
- dprintf(" %d", g->scale_factors[i]);
- dprintf("\n");
- }
-#endif
- }
-
- exponents_from_scale_factors(s, g, exponents);
-
- /* read Huffman coded residue */
- huffman_decode(s, g, exponents, bits_pos + g->part2_3_length);
-#if defined(DEBUG)
- sample_dump(0, g->sb_hybrid, 576);
-#endif
- } /* ch */
-
- if (s->nb_channels == 2)
- compute_stereo(s, &granules[0][gr], &granules[1][gr]);
-
- for(ch=0;ch<s->nb_channels;ch++) {
- g = &granules[ch][gr];
-
- reorder_block(s, g);
-#if defined(DEBUG)
- sample_dump(0, g->sb_hybrid, 576);
-#endif
- s->compute_antialias(s, g);
-#if defined(DEBUG)
- sample_dump(1, g->sb_hybrid, 576);
-#endif
- compute_imdct(s, g, &s->sb_samples[ch][18 * gr][0], s->mdct_buf[ch]);
-#if defined(DEBUG)
- sample_dump(2, &s->sb_samples[ch][18 * gr][0], 576);
-#endif
- }
- } /* gr */
- if(get_bits_count(&s->gb)<0)
- skip_bits_long(&s->gb, -get_bits_count(&s->gb));
- return nb_granules * 18;
-}
-
-static int mp_decode_frame(MPADecodeContext *s,
- OUT_INT *samples, const uint8_t *buf, int buf_size)
-{
- int i, nb_frames, ch;
- OUT_INT *samples_ptr;
-
- init_get_bits(&s->gb, buf + HEADER_SIZE, (buf_size - HEADER_SIZE)*8);
-
- /* skip error protection field */
- if (s->error_protection)
- get_bits(&s->gb, 16);
-
- dprintf("frame %d:\n", s->frame_count);
- switch(s->layer) {
- case 1:
- nb_frames = mp_decode_layer1(s);
- break;
- case 2:
- nb_frames = mp_decode_layer2(s);
- break;
- case 3:
- default:
- nb_frames = mp_decode_layer3(s);
-
- s->last_buf_size=0;
- if(s->in_gb.buffer){
- align_get_bits(&s->gb);
- i= (s->gb.size_in_bits - get_bits_count(&s->gb))>>3;
- if(i >= 0 && i <= BACKSTEP_SIZE){
- memmove(s->last_buf, s->gb.buffer + (get_bits_count(&s->gb)>>3), i);
- s->last_buf_size=i;
- }else
- av_log(NULL, AV_LOG_ERROR, "invalid old backstep %d\n", i);
- s->gb= s->in_gb;
- s->in_gb.buffer= NULL;
- }
-
- align_get_bits(&s->gb);
- assert((get_bits_count(&s->gb) & 7) == 0);
- i= (s->gb.size_in_bits - get_bits_count(&s->gb))>>3;
-
- if(i<0 || i > BACKSTEP_SIZE || nb_frames<0){
- av_log(NULL, AV_LOG_ERROR, "invalid new backstep %d\n", i);
- i= FFMIN(BACKSTEP_SIZE, buf_size - HEADER_SIZE);
- }
- assert(i <= buf_size - HEADER_SIZE && i>= 0);
- memcpy(s->last_buf + s->last_buf_size, s->gb.buffer + buf_size - HEADER_SIZE - i, i);
- s->last_buf_size += i;
-
- break;
- }
-#if defined(DEBUG)
- for(i=0;i<nb_frames;i++) {
- for(ch=0;ch<s->nb_channels;ch++) {
- int j;
- dprintf("%d-%d:", i, ch);
- for(j=0;j<SBLIMIT;j++)
- dprintf(" %0.6f", (double)s->sb_samples[ch][i][j] / FRAC_ONE);
- dprintf("\n");
- }
- }
-#endif
- /* apply the synthesis filter */
- for(ch=0;ch<s->nb_channels;ch++) {
- samples_ptr = samples + ch;
- for(i=0;i<nb_frames;i++) {
- ff_mpa_synth_filter(s->synth_buf[ch], &(s->synth_buf_offset[ch]),
- window, &s->dither_state,
- samples_ptr, s->nb_channels,
- s->sb_samples[ch][i]);
- samples_ptr += 32 * s->nb_channels;
- }
- }
-#ifdef DEBUG
- s->frame_count++;
-#endif
- return nb_frames * 32 * sizeof(OUT_INT) * s->nb_channels;
-}
-
-static int decode_frame(AVCodecContext * avctx,
- void *data, int *data_size,
- uint8_t * buf, int buf_size)
-{
- MPADecodeContext *s = avctx->priv_data;
- uint32_t header;
- int out_size;
- OUT_INT *out_samples = data;
-
-retry:
- if(buf_size < HEADER_SIZE)
- return -1;
-
- header = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3];
- if(ff_mpa_check_header(header) < 0){
- buf++;
-// buf_size--;
- av_log(avctx, AV_LOG_ERROR, "Header missing skipping one byte.\n");
- goto retry;
- }
-
- if (decode_header(s, header) == 1) {
- /* free format: prepare to compute frame size */
- s->frame_size = -1;
- return -1;
- }
- /* update codec info */
- avctx->channels = s->nb_channels;
- avctx->bit_rate = s->bit_rate;
- avctx->sub_id = s->layer;
- switch(s->layer) {
- case 1:
- avctx->frame_size = 384;
- break;
- case 2:
- avctx->frame_size = 1152;
- break;
- case 3:
- if (s->lsf)
- avctx->frame_size = 576;
- else
- avctx->frame_size = 1152;
- break;
- }
-
- if(s->frame_size<=0 || s->frame_size > buf_size){
- av_log(avctx, AV_LOG_ERROR, "incomplete frame\n");
- return -1;
- }else if(s->frame_size < buf_size){
- av_log(avctx, AV_LOG_ERROR, "incorrect frame size\n");
- }
-
- out_size = mp_decode_frame(s, out_samples, buf, buf_size);
- if(out_size>=0){
- *data_size = out_size;
- avctx->sample_rate = s->sample_rate;
- //FIXME maybe move the other codec info stuff from above here too
- }else
- av_log(avctx, AV_LOG_DEBUG, "Error while decoding MPEG audio frame.\n"); //FIXME return -1 / but also return the number of bytes consumed
- s->frame_size = 0;
- return buf_size;
-}
-
-static void flush(AVCodecContext *avctx){
- MPADecodeContext *s = avctx->priv_data;
- s->last_buf_size= 0;
-}
-
-#ifdef CONFIG_MP3ADU_DECODER
-static int decode_frame_adu(AVCodecContext * avctx,
- void *data, int *data_size,
- uint8_t * buf, int buf_size)
-{
- MPADecodeContext *s = avctx->priv_data;
- uint32_t header;
- int len, out_size;
- OUT_INT *out_samples = data;
-
- len = buf_size;
-
- // Discard too short frames
- if (buf_size < HEADER_SIZE) {
- *data_size = 0;
- return buf_size;
- }
-
-
- if (len > MPA_MAX_CODED_FRAME_SIZE)
- len = MPA_MAX_CODED_FRAME_SIZE;
-
- // Get header and restore sync word
- header = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3] | 0xffe00000;
-
- if (ff_mpa_check_header(header) < 0) { // Bad header, discard frame
- *data_size = 0;
- return buf_size;
- }
-
- decode_header(s, header);
- /* update codec info */
- avctx->sample_rate = s->sample_rate;
- avctx->channels = s->nb_channels;
- avctx->bit_rate = s->bit_rate;
- avctx->sub_id = s->layer;
-
- avctx->frame_size=s->frame_size = len;
-
- if (avctx->parse_only) {
- out_size = buf_size;
- } else {
- out_size = mp_decode_frame(s, out_samples, buf, buf_size);
- }
-
- *data_size = out_size;
- return buf_size;
-}
-#endif /* CONFIG_MP3ADU_DECODER */
-
-#ifdef CONFIG_MP3ON4_DECODER
-/* Next 3 arrays are indexed by channel config number (passed via codecdata) */
-static int mp3Frames[16] = {0,1,1,2,3,3,4,5,2}; /* number of mp3 decoder instances */
-static int mp3Channels[16] = {0,1,2,3,4,5,6,8,4}; /* total output channels */
-/* offsets into output buffer, assume output order is FL FR BL BR C LFE */
-static int chan_offset[9][5] = {
- {0},
- {0}, // C
- {0}, // FLR
- {2,0}, // C FLR
- {2,0,3}, // C FLR BS
- {4,0,2}, // C FLR BLRS
- {4,0,2,5}, // C FLR BLRS LFE
- {4,0,2,6,5}, // C FLR BLRS BLR LFE
- {0,2} // FLR BLRS
-};
-
-
-static int decode_init_mp3on4(AVCodecContext * avctx)
-{
- MP3On4DecodeContext *s = avctx->priv_data;
- int i;
-
- if ((avctx->extradata_size < 2) || (avctx->extradata == NULL)) {
- av_log(avctx, AV_LOG_ERROR, "Codec extradata missing or too short.\n");
- return -1;
- }
-
- s->chan_cfg = (((unsigned char *)avctx->extradata)[1] >> 3) & 0x0f;
- s->frames = mp3Frames[s->chan_cfg];
- if(!s->frames) {
- av_log(avctx, AV_LOG_ERROR, "Invalid channel config number.\n");
- return -1;
- }
- avctx->channels = mp3Channels[s->chan_cfg];
-
- /* Init the first mp3 decoder in standard way, so that all tables get builded
- * We replace avctx->priv_data with the context of the first decoder so that
- * decode_init() does not have to be changed.
- * Other decoders will be inited here copying data from the first context
- */
- // Allocate zeroed memory for the first decoder context
- s->mp3decctx[0] = av_mallocz(sizeof(MPADecodeContext));
- // Put decoder context in place to make init_decode() happy
- avctx->priv_data = s->mp3decctx[0];
- decode_init(avctx);
- // Restore mp3on4 context pointer
- avctx->priv_data = s;
- s->mp3decctx[0]->adu_mode = 1; // Set adu mode
-
- /* Create a separate codec/context for each frame (first is already ok).
- * Each frame is 1 or 2 channels - up to 5 frames allowed
- */
- for (i = 1; i < s->frames; i++) {
- s->mp3decctx[i] = av_mallocz(sizeof(MPADecodeContext));
- s->mp3decctx[i]->compute_antialias = s->mp3decctx[0]->compute_antialias;
- s->mp3decctx[i]->adu_mode = 1;
- }
-
- return 0;
-}
-
-
-static int decode_close_mp3on4(AVCodecContext * avctx)
-{
- MP3On4DecodeContext *s = avctx->priv_data;
- int i;
-
- for (i = 0; i < s->frames; i++)
- if (s->mp3decctx[i])
- av_free(s->mp3decctx[i]);
-
- return 0;
-}
-
-
-static int decode_frame_mp3on4(AVCodecContext * avctx,
- void *data, int *data_size,
- uint8_t * buf, int buf_size)
-{
- MP3On4DecodeContext *s = avctx->priv_data;
- MPADecodeContext *m;
- int len, out_size = 0;
- uint32_t header;
- OUT_INT *out_samples = data;
- OUT_INT decoded_buf[MPA_FRAME_SIZE * MPA_MAX_CHANNELS];
- OUT_INT *outptr, *bp;
- int fsize;
- unsigned char *start2 = buf, *start;
- int fr, i, j, n;
- int off = avctx->channels;
- int *coff = chan_offset[s->chan_cfg];
-
- len = buf_size;
-
- // Discard too short frames
- if (buf_size < HEADER_SIZE) {
- *data_size = 0;
- return buf_size;
- }
-
- // If only one decoder interleave is not needed
- outptr = s->frames == 1 ? out_samples : decoded_buf;
-
- for (fr = 0; fr < s->frames; fr++) {
- start = start2;
- fsize = (start[0] << 4) | (start[1] >> 4);
- start2 += fsize;
- if (fsize > len)
- fsize = len;
- len -= fsize;
- if (fsize > MPA_MAX_CODED_FRAME_SIZE)
- fsize = MPA_MAX_CODED_FRAME_SIZE;
- m = s->mp3decctx[fr];
- assert (m != NULL);
-
- // Get header
- header = (start[0] << 24) | (start[1] << 16) | (start[2] << 8) | start[3] | 0xfff00000;
-
- if (ff_mpa_check_header(header) < 0) { // Bad header, discard block
- *data_size = 0;
- return buf_size;
- }
-
- decode_header(m, header);
- mp_decode_frame(m, decoded_buf, start, fsize);
-
- n = MPA_FRAME_SIZE * m->nb_channels;
- out_size += n * sizeof(OUT_INT);
- if(s->frames > 1) {
- /* interleave output data */
- bp = out_samples + coff[fr];
- if(m->nb_channels == 1) {
- for(j = 0; j < n; j++) {
- *bp = decoded_buf[j];
- bp += off;
- }
- } else {
- for(j = 0; j < n; j++) {
- bp[0] = decoded_buf[j++];
- bp[1] = decoded_buf[j];
- bp += off;
- }
- }
- }
- }
-
- /* update codec info */
- avctx->sample_rate = s->mp3decctx[0]->sample_rate;
- avctx->frame_size= buf_size;
- avctx->bit_rate = 0;
- for (i = 0; i < s->frames; i++)
- avctx->bit_rate += s->mp3decctx[i]->bit_rate;
-
- *data_size = out_size;
- return buf_size;
-}
-#endif /* CONFIG_MP3ON4_DECODER */
-
-#ifdef CONFIG_MP2_DECODER
-AVCodec mp2_decoder =
-{
- "mp2",
- CODEC_TYPE_AUDIO,
- CODEC_ID_MP2,
- sizeof(MPADecodeContext),
- decode_init,
- NULL,
- NULL,
- decode_frame,
- CODEC_CAP_PARSE_ONLY,
-};
-#endif
-#ifdef CONFIG_MP3_DECODER
-AVCodec mp3_decoder =
-{
- "mp3",
- CODEC_TYPE_AUDIO,
- CODEC_ID_MP3,
- sizeof(MPADecodeContext),
- decode_init,
- NULL,
- NULL,
- decode_frame,
- CODEC_CAP_PARSE_ONLY,
- .flush= flush,
-};
-#endif
-#ifdef CONFIG_MP3ADU_DECODER
-AVCodec mp3adu_decoder =
-{
- "mp3adu",
- CODEC_TYPE_AUDIO,
- CODEC_ID_MP3ADU,
- sizeof(MPADecodeContext),
- decode_init,
- NULL,
- NULL,
- decode_frame_adu,
- CODEC_CAP_PARSE_ONLY,
- .flush= flush,
-};
-#endif
-#ifdef CONFIG_MP3ON4_DECODER
-AVCodec mp3on4_decoder =
-{
- "mp3on4",
- CODEC_TYPE_AUDIO,
- CODEC_ID_MP3ON4,
- sizeof(MP3On4DecodeContext),
- decode_init_mp3on4,
- NULL,
- decode_close_mp3on4,
- decode_frame_mp3on4,
- .flush= flush,
-};
-#endif
diff --git a/src/libffmpeg/libavcodec/mpegaudiodectab.h b/src/libffmpeg/libavcodec/mpegaudiodectab.h
deleted file mode 100644
index fdd1096fc..000000000
--- a/src/libffmpeg/libavcodec/mpegaudiodectab.h
+++ /dev/null
@@ -1,795 +0,0 @@
-/*
- * MPEG Audio decoder
- * copyright (c) 2002 Fabrice Bellard
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file mpegaudiodectab.h
- * mpeg audio layer decoder tables.
- */
-
-const uint16_t mpa_bitrate_tab[2][3][15] = {
- { {0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448 },
- {0, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384 },
- {0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320 } },
- { {0, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256},
- {0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160},
- {0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160}
- }
-};
-
-const uint16_t mpa_freq_tab[3] = { 44100, 48000, 32000 };
-
-/*******************************************************/
-/* half mpeg encoding window (full precision) */
-const int32_t mpa_enwindow[257] = {
- 0, -1, -1, -1, -1, -1, -1, -2,
- -2, -2, -2, -3, -3, -4, -4, -5,
- -5, -6, -7, -7, -8, -9, -10, -11,
- -13, -14, -16, -17, -19, -21, -24, -26,
- -29, -31, -35, -38, -41, -45, -49, -53,
- -58, -63, -68, -73, -79, -85, -91, -97,
- -104, -111, -117, -125, -132, -139, -147, -154,
- -161, -169, -176, -183, -190, -196, -202, -208,
- 213, 218, 222, 225, 227, 228, 228, 227,
- 224, 221, 215, 208, 200, 189, 177, 163,
- 146, 127, 106, 83, 57, 29, -2, -36,
- -72, -111, -153, -197, -244, -294, -347, -401,
- -459, -519, -581, -645, -711, -779, -848, -919,
- -991, -1064, -1137, -1210, -1283, -1356, -1428, -1498,
- -1567, -1634, -1698, -1759, -1817, -1870, -1919, -1962,
- -2001, -2032, -2057, -2075, -2085, -2087, -2080, -2063,
- 2037, 2000, 1952, 1893, 1822, 1739, 1644, 1535,
- 1414, 1280, 1131, 970, 794, 605, 402, 185,
- -45, -288, -545, -814, -1095, -1388, -1692, -2006,
- -2330, -2663, -3004, -3351, -3705, -4063, -4425, -4788,
- -5153, -5517, -5879, -6237, -6589, -6935, -7271, -7597,
- -7910, -8209, -8491, -8755, -8998, -9219, -9416, -9585,
- -9727, -9838, -9916, -9959, -9966, -9935, -9863, -9750,
- -9592, -9389, -9139, -8840, -8492, -8092, -7640, -7134,
- 6574, 5959, 5288, 4561, 3776, 2935, 2037, 1082,
- 70, -998, -2122, -3300, -4533, -5818, -7154, -8540,
- -9975,-11455,-12980,-14548,-16155,-17799,-19478,-21189,
--22929,-24694,-26482,-28289,-30112,-31947,-33791,-35640,
--37489,-39336,-41176,-43006,-44821,-46617,-48390,-50137,
--51853,-53534,-55178,-56778,-58333,-59838,-61289,-62684,
--64019,-65290,-66494,-67629,-68692,-69679,-70590,-71420,
--72169,-72835,-73415,-73908,-74313,-74630,-74856,-74992,
- 75038,
-};
-
-/*******************************************************/
-/* layer 2 tables */
-
-const int sblimit_table[5] = { 27 , 30 , 8, 12 , 30 };
-
-const int quant_steps[17] = {
- 3, 5, 7, 9, 15,
- 31, 63, 127, 255, 511,
- 1023, 2047, 4095, 8191, 16383,
- 32767, 65535
-};
-
-/* we use a negative value if grouped */
-const int quant_bits[17] = {
- -5, -7, 3, -10, 4,
- 5, 6, 7, 8, 9,
- 10, 11, 12, 13, 14,
- 15, 16
-};
-
-/* encoding tables which give the quantization index. Note how it is
- possible to store them efficiently ! */
-static const unsigned char alloc_table_0[] = {
- 4, 0, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
- 4, 0, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
- 4, 0, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 2, 0, 1, 16,
- 2, 0, 1, 16,
- 2, 0, 1, 16,
- 2, 0, 1, 16,
-};
-
-static const unsigned char alloc_table_1[] = {
- 4, 0, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
- 4, 0, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
- 4, 0, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 2, 0, 1, 16,
- 2, 0, 1, 16,
- 2, 0, 1, 16,
- 2, 0, 1, 16,
- 2, 0, 1, 16,
- 2, 0, 1, 16,
- 2, 0, 1, 16,
-};
-
-static const unsigned char alloc_table_2[] = {
- 4, 0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 4, 0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
-};
-
-static const unsigned char alloc_table_3[] = {
- 4, 0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 4, 0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
-};
-
-static const unsigned char alloc_table_4[] = {
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
-};
-
-const unsigned char *alloc_tables[5] =
-{ alloc_table_0, alloc_table_1, alloc_table_2, alloc_table_3, alloc_table_4, };
-
-/*******************************************************/
-/* layer 3 tables */
-
-/* layer3 scale factor size */
-static const uint8_t slen_table[2][16] = {
- { 0, 0, 0, 0, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4 },
- { 0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 2, 3 },
-};
-
-/* number of lsf scale factors for a given size */
-static const uint8_t lsf_nsf_table[6][3][4] = {
- { { 6, 5, 5, 5 }, { 9, 9, 9, 9 }, { 6, 9, 9, 9 } },
- { { 6, 5, 7, 3 }, { 9, 9, 12, 6 }, { 6, 9, 12, 6 } },
- { { 11, 10, 0, 0 }, { 18, 18, 0, 0 }, { 15, 18, 0, 0 } },
- { { 7, 7, 7, 0 }, { 12, 12, 12, 0 }, { 6, 15, 12, 0 } },
- { { 6, 6, 6, 3 }, { 12, 9, 9, 6 }, { 6, 12, 9, 6 } },
- { { 8, 8, 5, 0 }, { 15, 12, 9, 0 }, { 6, 18, 9, 0 } },
-};
-
-/* mpegaudio layer 3 huffman tables */
-
-static const uint16_t mpa_huffcodes_1[4] = {
- 0x0001, 0x0001, 0x0001, 0x0000,
-};
-
-static const uint8_t mpa_huffbits_1[4] = {
- 1, 3, 2, 3,
-};
-
-static const uint16_t mpa_huffcodes_2[9] = {
- 0x0001, 0x0002, 0x0001, 0x0003, 0x0001, 0x0001, 0x0003, 0x0002,
- 0x0000,
-};
-
-static const uint8_t mpa_huffbits_2[9] = {
- 1, 3, 6, 3, 3, 5, 5, 5,
- 6,
-};
-
-static const uint16_t mpa_huffcodes_3[9] = {
- 0x0003, 0x0002, 0x0001, 0x0001, 0x0001, 0x0001, 0x0003, 0x0002,
- 0x0000,
-};
-
-static const uint8_t mpa_huffbits_3[9] = {
- 2, 2, 6, 3, 2, 5, 5, 5,
- 6,
-};
-
-static const uint16_t mpa_huffcodes_5[16] = {
- 0x0001, 0x0002, 0x0006, 0x0005, 0x0003, 0x0001, 0x0004, 0x0004,
- 0x0007, 0x0005, 0x0007, 0x0001, 0x0006, 0x0001, 0x0001, 0x0000,
-};
-
-static const uint8_t mpa_huffbits_5[16] = {
- 1, 3, 6, 7, 3, 3, 6, 7,
- 6, 6, 7, 8, 7, 6, 7, 8,
-};
-
-static const uint16_t mpa_huffcodes_6[16] = {
- 0x0007, 0x0003, 0x0005, 0x0001, 0x0006, 0x0002, 0x0003, 0x0002,
- 0x0005, 0x0004, 0x0004, 0x0001, 0x0003, 0x0003, 0x0002, 0x0000,
-};
-
-static const uint8_t mpa_huffbits_6[16] = {
- 3, 3, 5, 7, 3, 2, 4, 5,
- 4, 4, 5, 6, 6, 5, 6, 7,
-};
-
-static const uint16_t mpa_huffcodes_7[36] = {
- 0x0001, 0x0002, 0x000a, 0x0013, 0x0010, 0x000a, 0x0003, 0x0003,
- 0x0007, 0x000a, 0x0005, 0x0003, 0x000b, 0x0004, 0x000d, 0x0011,
- 0x0008, 0x0004, 0x000c, 0x000b, 0x0012, 0x000f, 0x000b, 0x0002,
- 0x0007, 0x0006, 0x0009, 0x000e, 0x0003, 0x0001, 0x0006, 0x0004,
- 0x0005, 0x0003, 0x0002, 0x0000,
-};
-
-static const uint8_t mpa_huffbits_7[36] = {
- 1, 3, 6, 8, 8, 9, 3, 4,
- 6, 7, 7, 8, 6, 5, 7, 8,
- 8, 9, 7, 7, 8, 9, 9, 9,
- 7, 7, 8, 9, 9, 10, 8, 8,
- 9, 10, 10, 10,
-};
-
-static const uint16_t mpa_huffcodes_8[36] = {
- 0x0003, 0x0004, 0x0006, 0x0012, 0x000c, 0x0005, 0x0005, 0x0001,
- 0x0002, 0x0010, 0x0009, 0x0003, 0x0007, 0x0003, 0x0005, 0x000e,
- 0x0007, 0x0003, 0x0013, 0x0011, 0x000f, 0x000d, 0x000a, 0x0004,
- 0x000d, 0x0005, 0x0008, 0x000b, 0x0005, 0x0001, 0x000c, 0x0004,
- 0x0004, 0x0001, 0x0001, 0x0000,
-};
-
-static const uint8_t mpa_huffbits_8[36] = {
- 2, 3, 6, 8, 8, 9, 3, 2,
- 4, 8, 8, 8, 6, 4, 6, 8,
- 8, 9, 8, 8, 8, 9, 9, 10,
- 8, 7, 8, 9, 10, 10, 9, 8,
- 9, 9, 11, 11,
-};
-
-static const uint16_t mpa_huffcodes_9[36] = {
- 0x0007, 0x0005, 0x0009, 0x000e, 0x000f, 0x0007, 0x0006, 0x0004,
- 0x0005, 0x0005, 0x0006, 0x0007, 0x0007, 0x0006, 0x0008, 0x0008,
- 0x0008, 0x0005, 0x000f, 0x0006, 0x0009, 0x000a, 0x0005, 0x0001,
- 0x000b, 0x0007, 0x0009, 0x0006, 0x0004, 0x0001, 0x000e, 0x0004,
- 0x0006, 0x0002, 0x0006, 0x0000,
-};
-
-static const uint8_t mpa_huffbits_9[36] = {
- 3, 3, 5, 6, 8, 9, 3, 3,
- 4, 5, 6, 8, 4, 4, 5, 6,
- 7, 8, 6, 5, 6, 7, 7, 8,
- 7, 6, 7, 7, 8, 9, 8, 7,
- 8, 8, 9, 9,
-};
-
-static const uint16_t mpa_huffcodes_10[64] = {
- 0x0001, 0x0002, 0x000a, 0x0017, 0x0023, 0x001e, 0x000c, 0x0011,
- 0x0003, 0x0003, 0x0008, 0x000c, 0x0012, 0x0015, 0x000c, 0x0007,
- 0x000b, 0x0009, 0x000f, 0x0015, 0x0020, 0x0028, 0x0013, 0x0006,
- 0x000e, 0x000d, 0x0016, 0x0022, 0x002e, 0x0017, 0x0012, 0x0007,
- 0x0014, 0x0013, 0x0021, 0x002f, 0x001b, 0x0016, 0x0009, 0x0003,
- 0x001f, 0x0016, 0x0029, 0x001a, 0x0015, 0x0014, 0x0005, 0x0003,
- 0x000e, 0x000d, 0x000a, 0x000b, 0x0010, 0x0006, 0x0005, 0x0001,
- 0x0009, 0x0008, 0x0007, 0x0008, 0x0004, 0x0004, 0x0002, 0x0000,
-};
-
-static const uint8_t mpa_huffbits_10[64] = {
- 1, 3, 6, 8, 9, 9, 9, 10,
- 3, 4, 6, 7, 8, 9, 8, 8,
- 6, 6, 7, 8, 9, 10, 9, 9,
- 7, 7, 8, 9, 10, 10, 9, 10,
- 8, 8, 9, 10, 10, 10, 10, 10,
- 9, 9, 10, 10, 11, 11, 10, 11,
- 8, 8, 9, 10, 10, 10, 11, 11,
- 9, 8, 9, 10, 10, 11, 11, 11,
-};
-
-static const uint16_t mpa_huffcodes_11[64] = {
- 0x0003, 0x0004, 0x000a, 0x0018, 0x0022, 0x0021, 0x0015, 0x000f,
- 0x0005, 0x0003, 0x0004, 0x000a, 0x0020, 0x0011, 0x000b, 0x000a,
- 0x000b, 0x0007, 0x000d, 0x0012, 0x001e, 0x001f, 0x0014, 0x0005,
- 0x0019, 0x000b, 0x0013, 0x003b, 0x001b, 0x0012, 0x000c, 0x0005,
- 0x0023, 0x0021, 0x001f, 0x003a, 0x001e, 0x0010, 0x0007, 0x0005,
- 0x001c, 0x001a, 0x0020, 0x0013, 0x0011, 0x000f, 0x0008, 0x000e,
- 0x000e, 0x000c, 0x0009, 0x000d, 0x000e, 0x0009, 0x0004, 0x0001,
- 0x000b, 0x0004, 0x0006, 0x0006, 0x0006, 0x0003, 0x0002, 0x0000,
-};
-
-static const uint8_t mpa_huffbits_11[64] = {
- 2, 3, 5, 7, 8, 9, 8, 9,
- 3, 3, 4, 6, 8, 8, 7, 8,
- 5, 5, 6, 7, 8, 9, 8, 8,
- 7, 6, 7, 9, 8, 10, 8, 9,
- 8, 8, 8, 9, 9, 10, 9, 10,
- 8, 8, 9, 10, 10, 11, 10, 11,
- 8, 7, 7, 8, 9, 10, 10, 10,
- 8, 7, 8, 9, 10, 10, 10, 10,
-};
-
-static const uint16_t mpa_huffcodes_12[64] = {
- 0x0009, 0x0006, 0x0010, 0x0021, 0x0029, 0x0027, 0x0026, 0x001a,
- 0x0007, 0x0005, 0x0006, 0x0009, 0x0017, 0x0010, 0x001a, 0x000b,
- 0x0011, 0x0007, 0x000b, 0x000e, 0x0015, 0x001e, 0x000a, 0x0007,
- 0x0011, 0x000a, 0x000f, 0x000c, 0x0012, 0x001c, 0x000e, 0x0005,
- 0x0020, 0x000d, 0x0016, 0x0013, 0x0012, 0x0010, 0x0009, 0x0005,
- 0x0028, 0x0011, 0x001f, 0x001d, 0x0011, 0x000d, 0x0004, 0x0002,
- 0x001b, 0x000c, 0x000b, 0x000f, 0x000a, 0x0007, 0x0004, 0x0001,
- 0x001b, 0x000c, 0x0008, 0x000c, 0x0006, 0x0003, 0x0001, 0x0000,
-};
-
-static const uint8_t mpa_huffbits_12[64] = {
- 4, 3, 5, 7, 8, 9, 9, 9,
- 3, 3, 4, 5, 7, 7, 8, 8,
- 5, 4, 5, 6, 7, 8, 7, 8,
- 6, 5, 6, 6, 7, 8, 8, 8,
- 7, 6, 7, 7, 8, 8, 8, 9,
- 8, 7, 8, 8, 8, 9, 8, 9,
- 8, 7, 7, 8, 8, 9, 9, 10,
- 9, 8, 8, 9, 9, 9, 9, 10,
-};
-
-static const uint16_t mpa_huffcodes_13[256] = {
- 0x0001, 0x0005, 0x000e, 0x0015, 0x0022, 0x0033, 0x002e, 0x0047,
- 0x002a, 0x0034, 0x0044, 0x0034, 0x0043, 0x002c, 0x002b, 0x0013,
- 0x0003, 0x0004, 0x000c, 0x0013, 0x001f, 0x001a, 0x002c, 0x0021,
- 0x001f, 0x0018, 0x0020, 0x0018, 0x001f, 0x0023, 0x0016, 0x000e,
- 0x000f, 0x000d, 0x0017, 0x0024, 0x003b, 0x0031, 0x004d, 0x0041,
- 0x001d, 0x0028, 0x001e, 0x0028, 0x001b, 0x0021, 0x002a, 0x0010,
- 0x0016, 0x0014, 0x0025, 0x003d, 0x0038, 0x004f, 0x0049, 0x0040,
- 0x002b, 0x004c, 0x0038, 0x0025, 0x001a, 0x001f, 0x0019, 0x000e,
- 0x0023, 0x0010, 0x003c, 0x0039, 0x0061, 0x004b, 0x0072, 0x005b,
- 0x0036, 0x0049, 0x0037, 0x0029, 0x0030, 0x0035, 0x0017, 0x0018,
- 0x003a, 0x001b, 0x0032, 0x0060, 0x004c, 0x0046, 0x005d, 0x0054,
- 0x004d, 0x003a, 0x004f, 0x001d, 0x004a, 0x0031, 0x0029, 0x0011,
- 0x002f, 0x002d, 0x004e, 0x004a, 0x0073, 0x005e, 0x005a, 0x004f,
- 0x0045, 0x0053, 0x0047, 0x0032, 0x003b, 0x0026, 0x0024, 0x000f,
- 0x0048, 0x0022, 0x0038, 0x005f, 0x005c, 0x0055, 0x005b, 0x005a,
- 0x0056, 0x0049, 0x004d, 0x0041, 0x0033, 0x002c, 0x002b, 0x002a,
- 0x002b, 0x0014, 0x001e, 0x002c, 0x0037, 0x004e, 0x0048, 0x0057,
- 0x004e, 0x003d, 0x002e, 0x0036, 0x0025, 0x001e, 0x0014, 0x0010,
- 0x0035, 0x0019, 0x0029, 0x0025, 0x002c, 0x003b, 0x0036, 0x0051,
- 0x0042, 0x004c, 0x0039, 0x0036, 0x0025, 0x0012, 0x0027, 0x000b,
- 0x0023, 0x0021, 0x001f, 0x0039, 0x002a, 0x0052, 0x0048, 0x0050,
- 0x002f, 0x003a, 0x0037, 0x0015, 0x0016, 0x001a, 0x0026, 0x0016,
- 0x0035, 0x0019, 0x0017, 0x0026, 0x0046, 0x003c, 0x0033, 0x0024,
- 0x0037, 0x001a, 0x0022, 0x0017, 0x001b, 0x000e, 0x0009, 0x0007,
- 0x0022, 0x0020, 0x001c, 0x0027, 0x0031, 0x004b, 0x001e, 0x0034,
- 0x0030, 0x0028, 0x0034, 0x001c, 0x0012, 0x0011, 0x0009, 0x0005,
- 0x002d, 0x0015, 0x0022, 0x0040, 0x0038, 0x0032, 0x0031, 0x002d,
- 0x001f, 0x0013, 0x000c, 0x000f, 0x000a, 0x0007, 0x0006, 0x0003,
- 0x0030, 0x0017, 0x0014, 0x0027, 0x0024, 0x0023, 0x0035, 0x0015,
- 0x0010, 0x0017, 0x000d, 0x000a, 0x0006, 0x0001, 0x0004, 0x0002,
- 0x0010, 0x000f, 0x0011, 0x001b, 0x0019, 0x0014, 0x001d, 0x000b,
- 0x0011, 0x000c, 0x0010, 0x0008, 0x0001, 0x0001, 0x0000, 0x0001,
-};
-
-static const uint8_t mpa_huffbits_13[256] = {
- 1, 4, 6, 7, 8, 9, 9, 10,
- 9, 10, 11, 11, 12, 12, 13, 13,
- 3, 4, 6, 7, 8, 8, 9, 9,
- 9, 9, 10, 10, 11, 12, 12, 12,
- 6, 6, 7, 8, 9, 9, 10, 10,
- 9, 10, 10, 11, 11, 12, 13, 13,
- 7, 7, 8, 9, 9, 10, 10, 10,
- 10, 11, 11, 11, 11, 12, 13, 13,
- 8, 7, 9, 9, 10, 10, 11, 11,
- 10, 11, 11, 12, 12, 13, 13, 14,
- 9, 8, 9, 10, 10, 10, 11, 11,
- 11, 11, 12, 11, 13, 13, 14, 14,
- 9, 9, 10, 10, 11, 11, 11, 11,
- 11, 12, 12, 12, 13, 13, 14, 14,
- 10, 9, 10, 11, 11, 11, 12, 12,
- 12, 12, 13, 13, 13, 14, 16, 16,
- 9, 8, 9, 10, 10, 11, 11, 12,
- 12, 12, 12, 13, 13, 14, 15, 15,
- 10, 9, 10, 10, 11, 11, 11, 13,
- 12, 13, 13, 14, 14, 14, 16, 15,
- 10, 10, 10, 11, 11, 12, 12, 13,
- 12, 13, 14, 13, 14, 15, 16, 17,
- 11, 10, 10, 11, 12, 12, 12, 12,
- 13, 13, 13, 14, 15, 15, 15, 16,
- 11, 11, 11, 12, 12, 13, 12, 13,
- 14, 14, 15, 15, 15, 16, 16, 16,
- 12, 11, 12, 13, 13, 13, 14, 14,
- 14, 14, 14, 15, 16, 15, 16, 16,
- 13, 12, 12, 13, 13, 13, 15, 14,
- 14, 17, 15, 15, 15, 17, 16, 16,
- 12, 12, 13, 14, 14, 14, 15, 14,
- 15, 15, 16, 16, 19, 18, 19, 16,
-};
-
-static const uint16_t mpa_huffcodes_15[256] = {
- 0x0007, 0x000c, 0x0012, 0x0035, 0x002f, 0x004c, 0x007c, 0x006c,
- 0x0059, 0x007b, 0x006c, 0x0077, 0x006b, 0x0051, 0x007a, 0x003f,
- 0x000d, 0x0005, 0x0010, 0x001b, 0x002e, 0x0024, 0x003d, 0x0033,
- 0x002a, 0x0046, 0x0034, 0x0053, 0x0041, 0x0029, 0x003b, 0x0024,
- 0x0013, 0x0011, 0x000f, 0x0018, 0x0029, 0x0022, 0x003b, 0x0030,
- 0x0028, 0x0040, 0x0032, 0x004e, 0x003e, 0x0050, 0x0038, 0x0021,
- 0x001d, 0x001c, 0x0019, 0x002b, 0x0027, 0x003f, 0x0037, 0x005d,
- 0x004c, 0x003b, 0x005d, 0x0048, 0x0036, 0x004b, 0x0032, 0x001d,
- 0x0034, 0x0016, 0x002a, 0x0028, 0x0043, 0x0039, 0x005f, 0x004f,
- 0x0048, 0x0039, 0x0059, 0x0045, 0x0031, 0x0042, 0x002e, 0x001b,
- 0x004d, 0x0025, 0x0023, 0x0042, 0x003a, 0x0034, 0x005b, 0x004a,
- 0x003e, 0x0030, 0x004f, 0x003f, 0x005a, 0x003e, 0x0028, 0x0026,
- 0x007d, 0x0020, 0x003c, 0x0038, 0x0032, 0x005c, 0x004e, 0x0041,
- 0x0037, 0x0057, 0x0047, 0x0033, 0x0049, 0x0033, 0x0046, 0x001e,
- 0x006d, 0x0035, 0x0031, 0x005e, 0x0058, 0x004b, 0x0042, 0x007a,
- 0x005b, 0x0049, 0x0038, 0x002a, 0x0040, 0x002c, 0x0015, 0x0019,
- 0x005a, 0x002b, 0x0029, 0x004d, 0x0049, 0x003f, 0x0038, 0x005c,
- 0x004d, 0x0042, 0x002f, 0x0043, 0x0030, 0x0035, 0x0024, 0x0014,
- 0x0047, 0x0022, 0x0043, 0x003c, 0x003a, 0x0031, 0x0058, 0x004c,
- 0x0043, 0x006a, 0x0047, 0x0036, 0x0026, 0x0027, 0x0017, 0x000f,
- 0x006d, 0x0035, 0x0033, 0x002f, 0x005a, 0x0052, 0x003a, 0x0039,
- 0x0030, 0x0048, 0x0039, 0x0029, 0x0017, 0x001b, 0x003e, 0x0009,
- 0x0056, 0x002a, 0x0028, 0x0025, 0x0046, 0x0040, 0x0034, 0x002b,
- 0x0046, 0x0037, 0x002a, 0x0019, 0x001d, 0x0012, 0x000b, 0x000b,
- 0x0076, 0x0044, 0x001e, 0x0037, 0x0032, 0x002e, 0x004a, 0x0041,
- 0x0031, 0x0027, 0x0018, 0x0010, 0x0016, 0x000d, 0x000e, 0x0007,
- 0x005b, 0x002c, 0x0027, 0x0026, 0x0022, 0x003f, 0x0034, 0x002d,
- 0x001f, 0x0034, 0x001c, 0x0013, 0x000e, 0x0008, 0x0009, 0x0003,
- 0x007b, 0x003c, 0x003a, 0x0035, 0x002f, 0x002b, 0x0020, 0x0016,
- 0x0025, 0x0018, 0x0011, 0x000c, 0x000f, 0x000a, 0x0002, 0x0001,
- 0x0047, 0x0025, 0x0022, 0x001e, 0x001c, 0x0014, 0x0011, 0x001a,
- 0x0015, 0x0010, 0x000a, 0x0006, 0x0008, 0x0006, 0x0002, 0x0000,
-};
-
-static const uint8_t mpa_huffbits_15[256] = {
- 3, 4, 5, 7, 7, 8, 9, 9,
- 9, 10, 10, 11, 11, 11, 12, 13,
- 4, 3, 5, 6, 7, 7, 8, 8,
- 8, 9, 9, 10, 10, 10, 11, 11,
- 5, 5, 5, 6, 7, 7, 8, 8,
- 8, 9, 9, 10, 10, 11, 11, 11,
- 6, 6, 6, 7, 7, 8, 8, 9,
- 9, 9, 10, 10, 10, 11, 11, 11,
- 7, 6, 7, 7, 8, 8, 9, 9,
- 9, 9, 10, 10, 10, 11, 11, 11,
- 8, 7, 7, 8, 8, 8, 9, 9,
- 9, 9, 10, 10, 11, 11, 11, 12,
- 9, 7, 8, 8, 8, 9, 9, 9,
- 9, 10, 10, 10, 11, 11, 12, 12,
- 9, 8, 8, 9, 9, 9, 9, 10,
- 10, 10, 10, 10, 11, 11, 11, 12,
- 9, 8, 8, 9, 9, 9, 9, 10,
- 10, 10, 10, 11, 11, 12, 12, 12,
- 9, 8, 9, 9, 9, 9, 10, 10,
- 10, 11, 11, 11, 11, 12, 12, 12,
- 10, 9, 9, 9, 10, 10, 10, 10,
- 10, 11, 11, 11, 11, 12, 13, 12,
- 10, 9, 9, 9, 10, 10, 10, 10,
- 11, 11, 11, 11, 12, 12, 12, 13,
- 11, 10, 9, 10, 10, 10, 11, 11,
- 11, 11, 11, 11, 12, 12, 13, 13,
- 11, 10, 10, 10, 10, 11, 11, 11,
- 11, 12, 12, 12, 12, 12, 13, 13,
- 12, 11, 11, 11, 11, 11, 11, 11,
- 12, 12, 12, 12, 13, 13, 12, 13,
- 12, 11, 11, 11, 11, 11, 11, 12,
- 12, 12, 12, 12, 13, 13, 13, 13,
-};
-
-static const uint16_t mpa_huffcodes_16[256] = {
- 0x0001, 0x0005, 0x000e, 0x002c, 0x004a, 0x003f, 0x006e, 0x005d,
- 0x00ac, 0x0095, 0x008a, 0x00f2, 0x00e1, 0x00c3, 0x0178, 0x0011,
- 0x0003, 0x0004, 0x000c, 0x0014, 0x0023, 0x003e, 0x0035, 0x002f,
- 0x0053, 0x004b, 0x0044, 0x0077, 0x00c9, 0x006b, 0x00cf, 0x0009,
- 0x000f, 0x000d, 0x0017, 0x0026, 0x0043, 0x003a, 0x0067, 0x005a,
- 0x00a1, 0x0048, 0x007f, 0x0075, 0x006e, 0x00d1, 0x00ce, 0x0010,
- 0x002d, 0x0015, 0x0027, 0x0045, 0x0040, 0x0072, 0x0063, 0x0057,
- 0x009e, 0x008c, 0x00fc, 0x00d4, 0x00c7, 0x0183, 0x016d, 0x001a,
- 0x004b, 0x0024, 0x0044, 0x0041, 0x0073, 0x0065, 0x00b3, 0x00a4,
- 0x009b, 0x0108, 0x00f6, 0x00e2, 0x018b, 0x017e, 0x016a, 0x0009,
- 0x0042, 0x001e, 0x003b, 0x0038, 0x0066, 0x00b9, 0x00ad, 0x0109,
- 0x008e, 0x00fd, 0x00e8, 0x0190, 0x0184, 0x017a, 0x01bd, 0x0010,
- 0x006f, 0x0036, 0x0034, 0x0064, 0x00b8, 0x00b2, 0x00a0, 0x0085,
- 0x0101, 0x00f4, 0x00e4, 0x00d9, 0x0181, 0x016e, 0x02cb, 0x000a,
- 0x0062, 0x0030, 0x005b, 0x0058, 0x00a5, 0x009d, 0x0094, 0x0105,
- 0x00f8, 0x0197, 0x018d, 0x0174, 0x017c, 0x0379, 0x0374, 0x0008,
- 0x0055, 0x0054, 0x0051, 0x009f, 0x009c, 0x008f, 0x0104, 0x00f9,
- 0x01ab, 0x0191, 0x0188, 0x017f, 0x02d7, 0x02c9, 0x02c4, 0x0007,
- 0x009a, 0x004c, 0x0049, 0x008d, 0x0083, 0x0100, 0x00f5, 0x01aa,
- 0x0196, 0x018a, 0x0180, 0x02df, 0x0167, 0x02c6, 0x0160, 0x000b,
- 0x008b, 0x0081, 0x0043, 0x007d, 0x00f7, 0x00e9, 0x00e5, 0x00db,
- 0x0189, 0x02e7, 0x02e1, 0x02d0, 0x0375, 0x0372, 0x01b7, 0x0004,
- 0x00f3, 0x0078, 0x0076, 0x0073, 0x00e3, 0x00df, 0x018c, 0x02ea,
- 0x02e6, 0x02e0, 0x02d1, 0x02c8, 0x02c2, 0x00df, 0x01b4, 0x0006,
- 0x00ca, 0x00e0, 0x00de, 0x00da, 0x00d8, 0x0185, 0x0182, 0x017d,
- 0x016c, 0x0378, 0x01bb, 0x02c3, 0x01b8, 0x01b5, 0x06c0, 0x0004,
- 0x02eb, 0x00d3, 0x00d2, 0x00d0, 0x0172, 0x017b, 0x02de, 0x02d3,
- 0x02ca, 0x06c7, 0x0373, 0x036d, 0x036c, 0x0d83, 0x0361, 0x0002,
- 0x0179, 0x0171, 0x0066, 0x00bb, 0x02d6, 0x02d2, 0x0166, 0x02c7,
- 0x02c5, 0x0362, 0x06c6, 0x0367, 0x0d82, 0x0366, 0x01b2, 0x0000,
- 0x000c, 0x000a, 0x0007, 0x000b, 0x000a, 0x0011, 0x000b, 0x0009,
- 0x000d, 0x000c, 0x000a, 0x0007, 0x0005, 0x0003, 0x0001, 0x0003,
-};
-
-static const uint8_t mpa_huffbits_16[256] = {
- 1, 4, 6, 8, 9, 9, 10, 10,
- 11, 11, 11, 12, 12, 12, 13, 9,
- 3, 4, 6, 7, 8, 9, 9, 9,
- 10, 10, 10, 11, 12, 11, 12, 8,
- 6, 6, 7, 8, 9, 9, 10, 10,
- 11, 10, 11, 11, 11, 12, 12, 9,
- 8, 7, 8, 9, 9, 10, 10, 10,
- 11, 11, 12, 12, 12, 13, 13, 10,
- 9, 8, 9, 9, 10, 10, 11, 11,
- 11, 12, 12, 12, 13, 13, 13, 9,
- 9, 8, 9, 9, 10, 11, 11, 12,
- 11, 12, 12, 13, 13, 13, 14, 10,
- 10, 9, 9, 10, 11, 11, 11, 11,
- 12, 12, 12, 12, 13, 13, 14, 10,
- 10, 9, 10, 10, 11, 11, 11, 12,
- 12, 13, 13, 13, 13, 15, 15, 10,
- 10, 10, 10, 11, 11, 11, 12, 12,
- 13, 13, 13, 13, 14, 14, 14, 10,
- 11, 10, 10, 11, 11, 12, 12, 13,
- 13, 13, 13, 14, 13, 14, 13, 11,
- 11, 11, 10, 11, 12, 12, 12, 12,
- 13, 14, 14, 14, 15, 15, 14, 10,
- 12, 11, 11, 11, 12, 12, 13, 14,
- 14, 14, 14, 14, 14, 13, 14, 11,
- 12, 12, 12, 12, 12, 13, 13, 13,
- 13, 15, 14, 14, 14, 14, 16, 11,
- 14, 12, 12, 12, 13, 13, 14, 14,
- 14, 16, 15, 15, 15, 17, 15, 11,
- 13, 13, 11, 12, 14, 14, 13, 14,
- 14, 15, 16, 15, 17, 15, 14, 11,
- 9, 8, 8, 9, 9, 10, 10, 10,
- 11, 11, 11, 11, 11, 11, 11, 8,
-};
-
-static const uint16_t mpa_huffcodes_24[256] = {
- 0x000f, 0x000d, 0x002e, 0x0050, 0x0092, 0x0106, 0x00f8, 0x01b2,
- 0x01aa, 0x029d, 0x028d, 0x0289, 0x026d, 0x0205, 0x0408, 0x0058,
- 0x000e, 0x000c, 0x0015, 0x0026, 0x0047, 0x0082, 0x007a, 0x00d8,
- 0x00d1, 0x00c6, 0x0147, 0x0159, 0x013f, 0x0129, 0x0117, 0x002a,
- 0x002f, 0x0016, 0x0029, 0x004a, 0x0044, 0x0080, 0x0078, 0x00dd,
- 0x00cf, 0x00c2, 0x00b6, 0x0154, 0x013b, 0x0127, 0x021d, 0x0012,
- 0x0051, 0x0027, 0x004b, 0x0046, 0x0086, 0x007d, 0x0074, 0x00dc,
- 0x00cc, 0x00be, 0x00b2, 0x0145, 0x0137, 0x0125, 0x010f, 0x0010,
- 0x0093, 0x0048, 0x0045, 0x0087, 0x007f, 0x0076, 0x0070, 0x00d2,
- 0x00c8, 0x00bc, 0x0160, 0x0143, 0x0132, 0x011d, 0x021c, 0x000e,
- 0x0107, 0x0042, 0x0081, 0x007e, 0x0077, 0x0072, 0x00d6, 0x00ca,
- 0x00c0, 0x00b4, 0x0155, 0x013d, 0x012d, 0x0119, 0x0106, 0x000c,
- 0x00f9, 0x007b, 0x0079, 0x0075, 0x0071, 0x00d7, 0x00ce, 0x00c3,
- 0x00b9, 0x015b, 0x014a, 0x0134, 0x0123, 0x0110, 0x0208, 0x000a,
- 0x01b3, 0x0073, 0x006f, 0x006d, 0x00d3, 0x00cb, 0x00c4, 0x00bb,
- 0x0161, 0x014c, 0x0139, 0x012a, 0x011b, 0x0213, 0x017d, 0x0011,
- 0x01ab, 0x00d4, 0x00d0, 0x00cd, 0x00c9, 0x00c1, 0x00ba, 0x00b1,
- 0x00a9, 0x0140, 0x012f, 0x011e, 0x010c, 0x0202, 0x0179, 0x0010,
- 0x014f, 0x00c7, 0x00c5, 0x00bf, 0x00bd, 0x00b5, 0x00ae, 0x014d,
- 0x0141, 0x0131, 0x0121, 0x0113, 0x0209, 0x017b, 0x0173, 0x000b,
- 0x029c, 0x00b8, 0x00b7, 0x00b3, 0x00af, 0x0158, 0x014b, 0x013a,
- 0x0130, 0x0122, 0x0115, 0x0212, 0x017f, 0x0175, 0x016e, 0x000a,
- 0x028c, 0x015a, 0x00ab, 0x00a8, 0x00a4, 0x013e, 0x0135, 0x012b,
- 0x011f, 0x0114, 0x0107, 0x0201, 0x0177, 0x0170, 0x016a, 0x0006,
- 0x0288, 0x0142, 0x013c, 0x0138, 0x0133, 0x012e, 0x0124, 0x011c,
- 0x010d, 0x0105, 0x0200, 0x0178, 0x0172, 0x016c, 0x0167, 0x0004,
- 0x026c, 0x012c, 0x0128, 0x0126, 0x0120, 0x011a, 0x0111, 0x010a,
- 0x0203, 0x017c, 0x0176, 0x0171, 0x016d, 0x0169, 0x0165, 0x0002,
- 0x0409, 0x0118, 0x0116, 0x0112, 0x010b, 0x0108, 0x0103, 0x017e,
- 0x017a, 0x0174, 0x016f, 0x016b, 0x0168, 0x0166, 0x0164, 0x0000,
- 0x002b, 0x0014, 0x0013, 0x0011, 0x000f, 0x000d, 0x000b, 0x0009,
- 0x0007, 0x0006, 0x0004, 0x0007, 0x0005, 0x0003, 0x0001, 0x0003,
-};
-
-static const uint8_t mpa_huffbits_24[256] = {
- 4, 4, 6, 7, 8, 9, 9, 10,
- 10, 11, 11, 11, 11, 11, 12, 9,
- 4, 4, 5, 6, 7, 8, 8, 9,
- 9, 9, 10, 10, 10, 10, 10, 8,
- 6, 5, 6, 7, 7, 8, 8, 9,
- 9, 9, 9, 10, 10, 10, 11, 7,
- 7, 6, 7, 7, 8, 8, 8, 9,
- 9, 9, 9, 10, 10, 10, 10, 7,
- 8, 7, 7, 8, 8, 8, 8, 9,
- 9, 9, 10, 10, 10, 10, 11, 7,
- 9, 7, 8, 8, 8, 8, 9, 9,
- 9, 9, 10, 10, 10, 10, 10, 7,
- 9, 8, 8, 8, 8, 9, 9, 9,
- 9, 10, 10, 10, 10, 10, 11, 7,
- 10, 8, 8, 8, 9, 9, 9, 9,
- 10, 10, 10, 10, 10, 11, 11, 8,
- 10, 9, 9, 9, 9, 9, 9, 9,
- 9, 10, 10, 10, 10, 11, 11, 8,
- 10, 9, 9, 9, 9, 9, 9, 10,
- 10, 10, 10, 10, 11, 11, 11, 8,
- 11, 9, 9, 9, 9, 10, 10, 10,
- 10, 10, 10, 11, 11, 11, 11, 8,
- 11, 10, 9, 9, 9, 10, 10, 10,
- 10, 10, 10, 11, 11, 11, 11, 8,
- 11, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 11, 11, 11, 11, 11, 8,
- 11, 10, 10, 10, 10, 10, 10, 10,
- 11, 11, 11, 11, 11, 11, 11, 8,
- 12, 10, 10, 10, 10, 10, 10, 11,
- 11, 11, 11, 11, 11, 11, 11, 8,
- 8, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 8, 8, 8, 8, 4,
-};
-
-static const HuffTable mpa_huff_tables[16] = {
-{ 1, NULL, NULL },
-{ 2, mpa_huffbits_1, mpa_huffcodes_1 },
-{ 3, mpa_huffbits_2, mpa_huffcodes_2 },
-{ 3, mpa_huffbits_3, mpa_huffcodes_3 },
-{ 4, mpa_huffbits_5, mpa_huffcodes_5 },
-{ 4, mpa_huffbits_6, mpa_huffcodes_6 },
-{ 6, mpa_huffbits_7, mpa_huffcodes_7 },
-{ 6, mpa_huffbits_8, mpa_huffcodes_8 },
-{ 6, mpa_huffbits_9, mpa_huffcodes_9 },
-{ 8, mpa_huffbits_10, mpa_huffcodes_10 },
-{ 8, mpa_huffbits_11, mpa_huffcodes_11 },
-{ 8, mpa_huffbits_12, mpa_huffcodes_12 },
-{ 16, mpa_huffbits_13, mpa_huffcodes_13 },
-{ 16, mpa_huffbits_15, mpa_huffcodes_15 },
-{ 16, mpa_huffbits_16, mpa_huffcodes_16 },
-{ 16, mpa_huffbits_24, mpa_huffcodes_24 },
-};
-
-static const uint8_t mpa_huff_data[32][2] = {
-{ 0, 0 },
-{ 1, 0 },
-{ 2, 0 },
-{ 3, 0 },
-{ 0, 0 },
-{ 4, 0 },
-{ 5, 0 },
-{ 6, 0 },
-{ 7, 0 },
-{ 8, 0 },
-{ 9, 0 },
-{ 10, 0 },
-{ 11, 0 },
-{ 12, 0 },
-{ 0, 0 },
-{ 13, 0 },
-{ 14, 1 },
-{ 14, 2 },
-{ 14, 3 },
-{ 14, 4 },
-{ 14, 6 },
-{ 14, 8 },
-{ 14, 10 },
-{ 14, 13 },
-{ 15, 4 },
-{ 15, 5 },
-{ 15, 6 },
-{ 15, 7 },
-{ 15, 8 },
-{ 15, 9 },
-{ 15, 11 },
-{ 15, 13 },
-};
-
-
-/* huffman tables for quadrules */
-static const uint8_t mpa_quad_codes[2][16] = {
- { 1, 5, 4, 5, 6, 5, 4, 4, 7, 3, 6, 0, 7, 2, 3, 1, },
- { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, },
-};
-
-static const uint8_t mpa_quad_bits[2][16] = {
- { 1, 4, 4, 5, 4, 6, 5, 6, 4, 5, 5, 6, 5, 6, 6, 6, },
- { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, },
-};
-
-/* band size tables */
-static const uint8_t band_size_long[9][22] = {
-{ 4, 4, 4, 4, 4, 4, 6, 6, 8, 8, 10,
- 12, 16, 20, 24, 28, 34, 42, 50, 54, 76, 158, }, /* 44100 */
-{ 4, 4, 4, 4, 4, 4, 6, 6, 6, 8, 10,
- 12, 16, 18, 22, 28, 34, 40, 46, 54, 54, 192, }, /* 48000 */
-{ 4, 4, 4, 4, 4, 4, 6, 6, 8, 10, 12,
- 16, 20, 24, 30, 38, 46, 56, 68, 84, 102, 26, }, /* 32000 */
-{ 6, 6, 6, 6, 6, 6, 8, 10, 12, 14, 16,
- 20, 24, 28, 32, 38, 46, 52, 60, 68, 58, 54, }, /* 22050 */
-{ 6, 6, 6, 6, 6, 6, 8, 10, 12, 14, 16,
- 18, 22, 26, 32, 38, 46, 52, 64, 70, 76, 36, }, /* 24000 */
-{ 6, 6, 6, 6, 6, 6, 8, 10, 12, 14, 16,
- 20, 24, 28, 32, 38, 46, 52, 60, 68, 58, 54, }, /* 16000 */
-{ 6, 6, 6, 6, 6, 6, 8, 10, 12, 14, 16,
- 20, 24, 28, 32, 38, 46, 52, 60, 68, 58, 54, }, /* 11025 */
-{ 6, 6, 6, 6, 6, 6, 8, 10, 12, 14, 16,
- 20, 24, 28, 32, 38, 46, 52, 60, 68, 58, 54, }, /* 12000 */
-{ 12, 12, 12, 12, 12, 12, 16, 20, 24, 28, 32,
- 40, 48, 56, 64, 76, 90, 2, 2, 2, 2, 2, }, /* 8000 */
-};
-
-static const uint8_t band_size_short[9][13] = {
-{ 4, 4, 4, 4, 6, 8, 10, 12, 14, 18, 22, 30, 56, }, /* 44100 */
-{ 4, 4, 4, 4, 6, 6, 10, 12, 14, 16, 20, 26, 66, }, /* 48000 */
-{ 4, 4, 4, 4, 6, 8, 12, 16, 20, 26, 34, 42, 12, }, /* 32000 */
-{ 4, 4, 4, 6, 6, 8, 10, 14, 18, 26, 32, 42, 18, }, /* 22050 */
-{ 4, 4, 4, 6, 8, 10, 12, 14, 18, 24, 32, 44, 12, }, /* 24000 */
-{ 4, 4, 4, 6, 8, 10, 12, 14, 18, 24, 30, 40, 18, }, /* 16000 */
-{ 4, 4, 4, 6, 8, 10, 12, 14, 18, 24, 30, 40, 18, }, /* 11025 */
-{ 4, 4, 4, 6, 8, 10, 12, 14, 18, 24, 30, 40, 18, }, /* 12000 */
-{ 8, 8, 8, 12, 16, 20, 24, 28, 36, 2, 2, 2, 26, }, /* 8000 */
-};
-
-static const uint8_t mpa_pretab[2][22] = {
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 3, 2, 0 },
-};
-
-/* table for alias reduction (XXX: store it as integer !) */
-static const float ci_table[8] = {
- -0.6, -0.535, -0.33, -0.185, -0.095, -0.041, -0.0142, -0.0037,
-};
diff --git a/src/libffmpeg/libavcodec/mpegaudiotab.h b/src/libffmpeg/libavcodec/mpegaudiotab.h
deleted file mode 100644
index 8fb37ddff..000000000
--- a/src/libffmpeg/libavcodec/mpegaudiotab.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * mpeg audio layer 2 tables. Most of them come from the mpeg audio
- * specification.
- *
- * Copyright (c) 2000, 2001 Fabrice Bellard.
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file mpegaudiotab.h
- * mpeg audio layer 2 tables.
- * Most of them come from the mpeg audio specification.
- */
-
-#define SQRT2 1.41421356237309514547
-
-static const int costab32[30] = {
- FIX(0.54119610014619701222),
- FIX(1.3065629648763763537),
-
- FIX(0.50979557910415917998),
- FIX(2.5629154477415054814),
- FIX(0.89997622313641556513),
- FIX(0.60134488693504528634),
-
- FIX(0.5024192861881556782),
- FIX(5.1011486186891552563),
- FIX(0.78815462345125020249),
- FIX(0.64682178335999007679),
- FIX(0.56694403481635768927),
- FIX(1.0606776859903470633),
- FIX(1.7224470982383341955),
- FIX(0.52249861493968885462),
-
- FIX(10.19000812354803287),
- FIX(0.674808341455005678),
- FIX(1.1694399334328846596),
- FIX(0.53104259108978413284),
- FIX(2.0577810099534108446),
- FIX(0.58293496820613388554),
- FIX(0.83934964541552681272),
- FIX(0.50547095989754364798),
- FIX(3.4076084184687189804),
- FIX(0.62250412303566482475),
- FIX(0.97256823786196078263),
- FIX(0.51544730992262455249),
- FIX(1.4841646163141661852),
- FIX(0.5531038960344445421),
- FIX(0.74453627100229857749),
- FIX(0.5006029982351962726),
-};
-
-static const int bitinv32[32] = {
- 0, 16, 8, 24, 4, 20, 12, 28,
- 2, 18, 10, 26, 6, 22, 14, 30,
- 1, 17, 9, 25, 5, 21, 13, 29,
- 3, 19, 11, 27, 7, 23, 15, 31
-};
-
-
-static int16_t filter_bank[512];
-
-static int scale_factor_table[64];
-#ifdef USE_FLOATS
-static float scale_factor_inv_table[64];
-#else
-static int8_t scale_factor_shift[64];
-static unsigned short scale_factor_mult[64];
-#endif
-static unsigned char scale_diff_table[128];
-
-/* total number of bits per allocation group */
-static unsigned short total_quant_bits[17];
-
-/* signal to noise ratio of each quantification step (could be
- computed from quant_steps[]). The values are dB multiplied by 10
-*/
-static const unsigned short quant_snr[17] = {
- 70, 110, 160, 208,
- 253, 316, 378, 439,
- 499, 559, 620, 680,
- 740, 800, 861, 920,
- 980
-};
-
-/* fixed psycho acoustic model. Values of SNR taken from the 'toolame'
- project */
-static const float fixed_smr[SBLIMIT] = {
- 30, 17, 16, 10, 3, 12, 8, 2.5,
- 5, 5, 6, 6, 5, 6, 10, 6,
- -4, -10, -21, -30, -42, -55, -68, -75,
- -75, -75, -75, -75, -91, -107, -110, -108
-};
-
-static const unsigned char nb_scale_factors[4] = { 3, 2, 1, 2 };
-
diff --git a/src/libffmpeg/libavcodec/mpegvideo.c b/src/libffmpeg/libavcodec/mpegvideo.c
deleted file mode 100644
index 76c300600..000000000
--- a/src/libffmpeg/libavcodec/mpegvideo.c
+++ /dev/null
@@ -1,7008 +0,0 @@
-/*
- * The simplest mpeg encoder (well, it was the simplest!)
- * Copyright (c) 2000,2001 Fabrice Bellard.
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * 4MV & hq & b-frame encoding stuff by Michael Niedermayer <michaelni@gmx.at>
- */
-
-/**
- * @file mpegvideo.c
- * The simplest mpeg encoder (well, it was the simplest!).
- */
-
-#include "avcodec.h"
-#include "dsputil.h"
-#include "mpegvideo.h"
-#include "faandct.h"
-#include <limits.h>
-
-#ifdef USE_FASTMEMCPY
-#include "libvo/fastmemcpy.h"
-#endif
-
-//#undef NDEBUG
-//#include <assert.h>
-
-
-/* if xine's MPEG encoder is enabled, enable the encoding features in
- * this particular module */
-#if defined(XINE_MPEG_ENCODER) && !defined(CONFIG_ENCODERS)
-#define CONFIG_ENCODERS
-#endif
-
-
-#ifdef CONFIG_ENCODERS
-static int encode_picture(MpegEncContext *s, int picture_number);
-#endif //CONFIG_ENCODERS
-static void dct_unquantize_mpeg1_intra_c(MpegEncContext *s,
- DCTELEM *block, int n, int qscale);
-static void dct_unquantize_mpeg1_inter_c(MpegEncContext *s,
- DCTELEM *block, int n, int qscale);
-static void dct_unquantize_mpeg2_intra_c(MpegEncContext *s,
- DCTELEM *block, int n, int qscale);
-static void dct_unquantize_mpeg2_intra_bitexact(MpegEncContext *s,
- DCTELEM *block, int n, int qscale);
-static void dct_unquantize_mpeg2_inter_c(MpegEncContext *s,
- DCTELEM *block, int n, int qscale);
-static void dct_unquantize_h263_intra_c(MpegEncContext *s,
- DCTELEM *block, int n, int qscale);
-static void dct_unquantize_h263_inter_c(MpegEncContext *s,
- DCTELEM *block, int n, int qscale);
-static void draw_edges_c(uint8_t *buf, int wrap, int width, int height, int w);
-#ifdef CONFIG_ENCODERS
-static int dct_quantize_c(MpegEncContext *s, DCTELEM *block, int n, int qscale, int *overflow);
-static int dct_quantize_trellis_c(MpegEncContext *s, DCTELEM *block, int n, int qscale, int *overflow);
-static int dct_quantize_refine(MpegEncContext *s, DCTELEM *block, int16_t *weight, DCTELEM *orig, int n, int qscale);
-static int sse_mb(MpegEncContext *s);
-static void denoise_dct_c(MpegEncContext *s, DCTELEM *block);
-#endif //CONFIG_ENCODERS
-
-#ifdef HAVE_XVMC
-extern int XVMC_field_start(MpegEncContext*s, AVCodecContext *avctx);
-extern void XVMC_field_end(MpegEncContext *s);
-extern void XVMC_decode_mb(MpegEncContext *s);
-#endif
-
-void (*draw_edges)(uint8_t *buf, int wrap, int width, int height, int w)= draw_edges_c;
-
-
-/* enable all paranoid tests for rounding, overflows, etc... */
-//#define PARANOID
-
-//#define DEBUG
-
-
-/* for jpeg fast DCT */
-#define CONST_BITS 14
-
-static const uint16_t aanscales[64] = {
- /* precomputed values scaled up by 14 bits */
- 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520,
- 22725, 31521, 29692, 26722, 22725, 17855, 12299, 6270,
- 21407, 29692, 27969, 25172, 21407, 16819, 11585, 5906,
- 19266, 26722, 25172, 22654, 19266, 15137, 10426, 5315,
- 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520,
- 12873, 17855, 16819, 15137, 12873, 10114, 6967, 3552,
- 8867 , 12299, 11585, 10426, 8867, 6967, 4799, 2446,
- 4520 , 6270, 5906, 5315, 4520, 3552, 2446, 1247
-};
-
-static const uint8_t h263_chroma_roundtab[16] = {
-// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
- 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
-};
-
-static const uint8_t ff_default_chroma_qscale_table[32]={
-// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
-};
-
-#ifdef CONFIG_ENCODERS
-static uint8_t (*default_mv_penalty)[MAX_MV*2+1]=NULL;
-static uint8_t default_fcode_tab[MAX_MV*2+1];
-
-enum PixelFormat ff_yuv420p_list[2]= {PIX_FMT_YUV420P, -1};
-
-static void convert_matrix(DSPContext *dsp, int (*qmat)[64], uint16_t (*qmat16)[2][64],
- const uint16_t *quant_matrix, int bias, int qmin, int qmax, int intra)
-{
- int qscale;
- int shift=0;
-
- for(qscale=qmin; qscale<=qmax; qscale++){
- int i;
- if (dsp->fdct == ff_jpeg_fdct_islow
-#ifdef FAAN_POSTSCALE
- || dsp->fdct == ff_faandct
-#endif
- ) {
- for(i=0;i<64;i++) {
- const int j= dsp->idct_permutation[i];
- /* 16 <= qscale * quant_matrix[i] <= 7905 */
- /* 19952 <= aanscales[i] * qscale * quant_matrix[i] <= 249205026 */
- /* (1<<36)/19952 >= (1<<36)/(aanscales[i] * qscale * quant_matrix[i]) >= (1<<36)/249205026 */
- /* 3444240 >= (1<<36)/(aanscales[i] * qscale * quant_matrix[i]) >= 275 */
-
- qmat[qscale][i] = (int)((UINT64_C(1) << QMAT_SHIFT) /
- (qscale * quant_matrix[j]));
- }
- } else if (dsp->fdct == fdct_ifast
-#ifndef FAAN_POSTSCALE
- || dsp->fdct == ff_faandct
-#endif
- ) {
- for(i=0;i<64;i++) {
- const int j= dsp->idct_permutation[i];
- /* 16 <= qscale * quant_matrix[i] <= 7905 */
- /* 19952 <= aanscales[i] * qscale * quant_matrix[i] <= 249205026 */
- /* (1<<36)/19952 >= (1<<36)/(aanscales[i] * qscale * quant_matrix[i]) >= (1<<36)/249205026 */
- /* 3444240 >= (1<<36)/(aanscales[i] * qscale * quant_matrix[i]) >= 275 */
-
- qmat[qscale][i] = (int)((UINT64_C(1) << (QMAT_SHIFT + 14)) /
- (aanscales[i] * qscale * quant_matrix[j]));
- }
- } else {
- for(i=0;i<64;i++) {
- const int j= dsp->idct_permutation[i];
- /* We can safely suppose that 16 <= quant_matrix[i] <= 255
- So 16 <= qscale * quant_matrix[i] <= 7905
- so (1<<19) / 16 >= (1<<19) / (qscale * quant_matrix[i]) >= (1<<19) / 7905
- so 32768 >= (1<<19) / (qscale * quant_matrix[i]) >= 67
- */
- qmat[qscale][i] = (int)((UINT64_C(1) << QMAT_SHIFT) / (qscale * quant_matrix[j]));
-// qmat [qscale][i] = (1 << QMAT_SHIFT_MMX) / (qscale * quant_matrix[i]);
- qmat16[qscale][0][i] = (1 << QMAT_SHIFT_MMX) / (qscale * quant_matrix[j]);
-
- if(qmat16[qscale][0][i]==0 || qmat16[qscale][0][i]==128*256) qmat16[qscale][0][i]=128*256-1;
- qmat16[qscale][1][i]= ROUNDED_DIV(bias<<(16-QUANT_BIAS_SHIFT), qmat16[qscale][0][i]);
- }
- }
-
- for(i=intra; i<64; i++){
- int64_t max= 8191;
- if (dsp->fdct == fdct_ifast
-#ifndef FAAN_POSTSCALE
- || dsp->fdct == ff_faandct
-#endif
- ) {
- max= (8191LL*aanscales[i]) >> 14;
- }
- while(((max * qmat[qscale][i]) >> shift) > INT_MAX){
- shift++;
- }
- }
- }
- if(shift){
- av_log(NULL, AV_LOG_INFO, "Warning, QMAT_SHIFT is larger then %d, overflows possible\n", QMAT_SHIFT - shift);
- }
-}
-
-static inline void update_qscale(MpegEncContext *s){
- s->qscale= (s->lambda*139 + FF_LAMBDA_SCALE*64) >> (FF_LAMBDA_SHIFT + 7);
- s->qscale= clip(s->qscale, s->avctx->qmin, s->avctx->qmax);
-
- s->lambda2= (s->lambda*s->lambda + FF_LAMBDA_SCALE/2) >> FF_LAMBDA_SHIFT;
-}
-#endif //CONFIG_ENCODERS
-
-void ff_init_scantable(uint8_t *permutation, ScanTable *st, const uint8_t *src_scantable){
- int i;
- int end;
-
- st->scantable= src_scantable;
-
- for(i=0; i<64; i++){
- int j;
- j = src_scantable[i];
- st->permutated[i] = permutation[j];
-#ifdef ARCH_POWERPC
- st->inverse[j] = i;
-#endif
- }
-
- end=-1;
- for(i=0; i<64; i++){
- int j;
- j = st->permutated[i];
- if(j>end) end=j;
- st->raster_end[i]= end;
- }
-}
-
-#ifdef CONFIG_ENCODERS
-void ff_write_quant_matrix(PutBitContext *pb, uint16_t *matrix){
- int i;
-
- if(matrix){
- put_bits(pb, 1, 1);
- for(i=0;i<64;i++) {
- put_bits(pb, 8, matrix[ ff_zigzag_direct[i] ]);
- }
- }else
- put_bits(pb, 1, 0);
-}
-#endif //CONFIG_ENCODERS
-
-const uint8_t *ff_find_start_code(const uint8_t * restrict p, const uint8_t *end, uint32_t * restrict state){
- int i;
-
- assert(p<=end);
- if(p>=end)
- return end;
-
- for(i=0; i<3; i++){
- uint32_t tmp= *state << 8;
- *state= tmp + *(p++);
- if(tmp == 0x100 || p==end)
- return p;
- }
-
- while(p<end){
- if (p[-1] > 1 ) p+= 3;
- else if(p[-2] ) p+= 2;
- else if(p[-3]|(p[-1]-1)) p++;
- else{
- p++;
- break;
- }
- }
-
- p= FFMIN(p, end)-4;
- *state= be2me_32(unaligned32(p));
-
- return p+4;
-}
-
-/* init common dct for both encoder and decoder */
-int DCT_common_init(MpegEncContext *s)
-{
- s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_c;
- s->dct_unquantize_h263_inter = dct_unquantize_h263_inter_c;
- s->dct_unquantize_mpeg1_intra = dct_unquantize_mpeg1_intra_c;
- s->dct_unquantize_mpeg1_inter = dct_unquantize_mpeg1_inter_c;
- s->dct_unquantize_mpeg2_intra = dct_unquantize_mpeg2_intra_c;
- if(s->flags & CODEC_FLAG_BITEXACT)
- s->dct_unquantize_mpeg2_intra = dct_unquantize_mpeg2_intra_bitexact;
- s->dct_unquantize_mpeg2_inter = dct_unquantize_mpeg2_inter_c;
-
-#ifdef CONFIG_ENCODERS
- s->dct_quantize= dct_quantize_c;
- s->denoise_dct= denoise_dct_c;
-#endif //CONFIG_ENCODERS
-
-#if defined(HAVE_MMX)
- MPV_common_init_mmx(s);
-#elif defined(ARCH_ALPHA)
- MPV_common_init_axp(s);
-#elif defined(HAVE_MLIB)
- MPV_common_init_mlib(s);
-#elif defined(HAVE_MMI)
- MPV_common_init_mmi(s);
-#elif defined(ARCH_ARMV4L)
- MPV_common_init_armv4l(s);
-#elif defined(ARCH_POWERPC)
- MPV_common_init_ppc(s);
-#endif
-
-#ifdef CONFIG_ENCODERS
- s->fast_dct_quantize= s->dct_quantize;
-
- if(s->flags&CODEC_FLAG_TRELLIS_QUANT){
- s->dct_quantize= dct_quantize_trellis_c; //move before MPV_common_init_*
- }
-
-#endif //CONFIG_ENCODERS
-
- /* load & permutate scantables
- note: only wmv uses different ones
- */
- if(s->alternate_scan){
- ff_init_scantable(s->dsp.idct_permutation, &s->inter_scantable , ff_alternate_vertical_scan);
- ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable , ff_alternate_vertical_scan);
- }else{
- ff_init_scantable(s->dsp.idct_permutation, &s->inter_scantable , ff_zigzag_direct);
- ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable , ff_zigzag_direct);
- }
- ff_init_scantable(s->dsp.idct_permutation, &s->intra_h_scantable, ff_alternate_horizontal_scan);
- ff_init_scantable(s->dsp.idct_permutation, &s->intra_v_scantable, ff_alternate_vertical_scan);
-
- return 0;
-}
-
-static void copy_picture(Picture *dst, Picture *src){
- *dst = *src;
- dst->type= FF_BUFFER_TYPE_COPY;
-}
-
-#ifdef CONFIG_ENCODERS
-static void copy_picture_attributes(MpegEncContext *s, AVFrame *dst, AVFrame *src){
- int i;
-
- dst->pict_type = src->pict_type;
- dst->quality = src->quality;
- dst->coded_picture_number = src->coded_picture_number;
- dst->display_picture_number = src->display_picture_number;
-// dst->reference = src->reference;
- dst->pts = src->pts;
- dst->interlaced_frame = src->interlaced_frame;
- dst->top_field_first = src->top_field_first;
-
- if(s->avctx->me_threshold){
- if(!src->motion_val[0])
- av_log(s->avctx, AV_LOG_ERROR, "AVFrame.motion_val not set!\n");
- if(!src->mb_type)
- av_log(s->avctx, AV_LOG_ERROR, "AVFrame.mb_type not set!\n");
- if(!src->ref_index[0])
- av_log(s->avctx, AV_LOG_ERROR, "AVFrame.ref_index not set!\n");
- if(src->motion_subsample_log2 != dst->motion_subsample_log2)
- av_log(s->avctx, AV_LOG_ERROR, "AVFrame.motion_subsample_log2 doesn't match! (%d!=%d)\n",
- src->motion_subsample_log2, dst->motion_subsample_log2);
-
- memcpy(dst->mb_type, src->mb_type, s->mb_stride * s->mb_height * sizeof(dst->mb_type[0]));
-
- for(i=0; i<2; i++){
- int stride= ((16*s->mb_width )>>src->motion_subsample_log2) + 1;
- int height= ((16*s->mb_height)>>src->motion_subsample_log2);
-
- if(src->motion_val[i] && src->motion_val[i] != dst->motion_val[i]){
- memcpy(dst->motion_val[i], src->motion_val[i], 2*stride*height*sizeof(int16_t));
- }
- if(src->ref_index[i] && src->ref_index[i] != dst->ref_index[i]){
- memcpy(dst->ref_index[i], src->ref_index[i], s->b8_stride*2*s->mb_height*sizeof(int8_t));
- }
- }
- }
-}
-#endif
-
-/**
- * allocates a Picture
- * The pixels are allocated/set by calling get_buffer() if shared=0
- */
-static int alloc_picture(MpegEncContext *s, Picture *pic, int shared){
- const int big_mb_num= s->mb_stride*(s->mb_height+1) + 1; //the +1 is needed so memset(,,stride*height) doesnt sig11
- const int mb_array_size= s->mb_stride*s->mb_height;
- const int b8_array_size= s->b8_stride*s->mb_height*2;
- const int b4_array_size= s->b4_stride*s->mb_height*4;
- int i;
-
- if(shared){
- assert(pic->data[0]);
- assert(pic->type == 0 || pic->type == FF_BUFFER_TYPE_SHARED);
- pic->type= FF_BUFFER_TYPE_SHARED;
- }else{
- int r;
-
- assert(!pic->data[0]);
-
- r= s->avctx->get_buffer(s->avctx, (AVFrame*)pic);
-
- if(r<0 || !pic->age || !pic->type || !pic->data[0]){
- av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed (%d %d %d %p)\n", r, pic->age, pic->type, pic->data[0]);
- return -1;
- }
-
- if(s->linesize && (s->linesize != pic->linesize[0] || s->uvlinesize != pic->linesize[1])){
- av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed (stride changed)\n");
- return -1;
- }
-
- if(pic->linesize[1] != pic->linesize[2]){
- av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed (uv stride mismatch)\n");
- return -1;
- }
-
- s->linesize = pic->linesize[0];
- s->uvlinesize= pic->linesize[1];
- }
-
- if(pic->qscale_table==NULL){
- if (s->encoding) {
- CHECKED_ALLOCZ(pic->mb_var , mb_array_size * sizeof(int16_t))
- CHECKED_ALLOCZ(pic->mc_mb_var, mb_array_size * sizeof(int16_t))
- CHECKED_ALLOCZ(pic->mb_mean , mb_array_size * sizeof(int8_t))
- }
-
- CHECKED_ALLOCZ(pic->mbskip_table , mb_array_size * sizeof(uint8_t)+2) //the +2 is for the slice end check
- CHECKED_ALLOCZ(pic->qscale_table , mb_array_size * sizeof(uint8_t))
- CHECKED_ALLOCZ(pic->mb_type_base , big_mb_num * sizeof(uint32_t))
- pic->mb_type= pic->mb_type_base + s->mb_stride+1;
- if(s->out_format == FMT_H264){
- for(i=0; i<2; i++){
- CHECKED_ALLOCZ(pic->motion_val_base[i], 2 * (b4_array_size+4) * sizeof(int16_t))
- pic->motion_val[i]= pic->motion_val_base[i]+4;
- CHECKED_ALLOCZ(pic->ref_index[i], b8_array_size * sizeof(uint8_t))
- }
- pic->motion_subsample_log2= 2;
- }else if(s->out_format == FMT_H263 || s->encoding || (s->avctx->debug&FF_DEBUG_MV) || (s->avctx->debug_mv)){
- for(i=0; i<2; i++){
- CHECKED_ALLOCZ(pic->motion_val_base[i], 2 * (b8_array_size+4) * sizeof(int16_t))
- pic->motion_val[i]= pic->motion_val_base[i]+4;
- CHECKED_ALLOCZ(pic->ref_index[i], b8_array_size * sizeof(uint8_t))
- }
- pic->motion_subsample_log2= 3;
- }
- if(s->avctx->debug&FF_DEBUG_DCT_COEFF) {
- CHECKED_ALLOCZ(pic->dct_coeff, 64 * mb_array_size * sizeof(DCTELEM)*6)
- }
- pic->qstride= s->mb_stride;
- CHECKED_ALLOCZ(pic->pan_scan , 1 * sizeof(AVPanScan))
- }
-
- //it might be nicer if the application would keep track of these but it would require a API change
- memmove(s->prev_pict_types+1, s->prev_pict_types, PREV_PICT_TYPES_BUFFER_SIZE-1);
- s->prev_pict_types[0]= s->pict_type;
- if(pic->age < PREV_PICT_TYPES_BUFFER_SIZE && s->prev_pict_types[pic->age] == B_TYPE)
- pic->age= INT_MAX; // skipped MBs in b frames are quite rare in mpeg1/2 and its a bit tricky to skip them anyway
-
- return 0;
-fail: //for the CHECKED_ALLOCZ macro
- return -1;
-}
-
-/**
- * deallocates a picture
- */
-static void free_picture(MpegEncContext *s, Picture *pic){
- int i;
-
- if(pic->data[0] && pic->type!=FF_BUFFER_TYPE_SHARED){
- s->avctx->release_buffer(s->avctx, (AVFrame*)pic);
- }
-
- av_freep(&pic->mb_var);
- av_freep(&pic->mc_mb_var);
- av_freep(&pic->mb_mean);
- av_freep(&pic->mbskip_table);
- av_freep(&pic->qscale_table);
- av_freep(&pic->mb_type_base);
- av_freep(&pic->dct_coeff);
- av_freep(&pic->pan_scan);
- pic->mb_type= NULL;
- for(i=0; i<2; i++){
- av_freep(&pic->motion_val_base[i]);
- av_freep(&pic->ref_index[i]);
- }
-
- if(pic->type == FF_BUFFER_TYPE_SHARED){
- for(i=0; i<4; i++){
- pic->base[i]=
- pic->data[i]= NULL;
- }
- pic->type= 0;
- }
-}
-
-static int init_duplicate_context(MpegEncContext *s, MpegEncContext *base){
- int i;
-
- // edge emu needs blocksize + filter length - 1 (=17x17 for halfpel / 21x21 for h264)
- CHECKED_ALLOCZ(s->allocated_edge_emu_buffer, (s->width+64)*2*21*2); //(width + edge + align)*interlaced*MBsize*tolerance
- s->edge_emu_buffer= s->allocated_edge_emu_buffer + (s->width+64)*2*21;
-
- //FIXME should be linesize instead of s->width*2 but that isnt known before get_buffer()
- CHECKED_ALLOCZ(s->me.scratchpad, (s->width+64)*4*16*2*sizeof(uint8_t))
- s->rd_scratchpad= s->me.scratchpad;
- s->b_scratchpad= s->me.scratchpad;
- s->obmc_scratchpad= s->me.scratchpad + 16;
- if (s->encoding) {
- CHECKED_ALLOCZ(s->me.map , ME_MAP_SIZE*sizeof(uint32_t))
- CHECKED_ALLOCZ(s->me.score_map, ME_MAP_SIZE*sizeof(uint32_t))
- if(s->avctx->noise_reduction){
- CHECKED_ALLOCZ(s->dct_error_sum, 2 * 64 * sizeof(int))
- }
- }
- CHECKED_ALLOCZ(s->blocks, 64*12*2 * sizeof(DCTELEM))
- s->block= s->blocks[0];
-
- for(i=0;i<12;i++){
- s->pblocks[i] = (short *)(&s->block[i]);
- }
- return 0;
-fail:
- return -1; //free() through MPV_common_end()
-}
-
-static void free_duplicate_context(MpegEncContext *s){
- if(s==NULL) return;
-
- av_freep(&s->allocated_edge_emu_buffer); s->edge_emu_buffer= NULL;
- av_freep(&s->me.scratchpad);
- s->rd_scratchpad=
- s->b_scratchpad=
- s->obmc_scratchpad= NULL;
-
- av_freep(&s->dct_error_sum);
- av_freep(&s->me.map);
- av_freep(&s->me.score_map);
- av_freep(&s->blocks);
- s->block= NULL;
-}
-
-static void backup_duplicate_context(MpegEncContext *bak, MpegEncContext *src){
-#define COPY(a) bak->a= src->a
- COPY(allocated_edge_emu_buffer);
- COPY(edge_emu_buffer);
- COPY(me.scratchpad);
- COPY(rd_scratchpad);
- COPY(b_scratchpad);
- COPY(obmc_scratchpad);
- COPY(me.map);
- COPY(me.score_map);
- COPY(blocks);
- COPY(block);
- COPY(start_mb_y);
- COPY(end_mb_y);
- COPY(me.map_generation);
- COPY(pb);
- COPY(dct_error_sum);
- COPY(dct_count[0]);
- COPY(dct_count[1]);
-#undef COPY
-}
-
-void ff_update_duplicate_context(MpegEncContext *dst, MpegEncContext *src){
- MpegEncContext bak;
- int i;
- //FIXME copy only needed parts
-//START_TIMER
- backup_duplicate_context(&bak, dst);
- memcpy(dst, src, sizeof(MpegEncContext));
- backup_duplicate_context(dst, &bak);
- for(i=0;i<12;i++){
- dst->pblocks[i] = (short *)(&dst->block[i]);
- }
-//STOP_TIMER("update_duplicate_context") //about 10k cycles / 0.01 sec for 1000frames on 1ghz with 2 threads
-}
-
-#ifdef CONFIG_ENCODERS
-static void update_duplicate_context_after_me(MpegEncContext *dst, MpegEncContext *src){
-#define COPY(a) dst->a= src->a
- COPY(pict_type);
- COPY(current_picture);
- COPY(f_code);
- COPY(b_code);
- COPY(qscale);
- COPY(lambda);
- COPY(lambda2);
- COPY(picture_in_gop_number);
- COPY(gop_picture_number);
- COPY(frame_pred_frame_dct); //FIXME don't set in encode_header
- COPY(progressive_frame); //FIXME don't set in encode_header
- COPY(partitioned_frame); //FIXME don't set in encode_header
-#undef COPY
-}
-#endif
-
-/**
- * sets the given MpegEncContext to common defaults (same for encoding and decoding).
- * the changed fields will not depend upon the prior state of the MpegEncContext.
- */
-static void MPV_common_defaults(MpegEncContext *s){
- s->y_dc_scale_table=
- s->c_dc_scale_table= ff_mpeg1_dc_scale_table;
- s->chroma_qscale_table= ff_default_chroma_qscale_table;
- s->progressive_frame= 1;
- s->progressive_sequence= 1;
- s->picture_structure= PICT_FRAME;
-
- s->coded_picture_number = 0;
- s->picture_number = 0;
- s->input_picture_number = 0;
-
- s->picture_in_gop_number = 0;
-
- s->f_code = 1;
- s->b_code = 1;
-}
-
-/**
- * sets the given MpegEncContext to defaults for decoding.
- * the changed fields will not depend upon the prior state of the MpegEncContext.
- */
-void MPV_decode_defaults(MpegEncContext *s){
- MPV_common_defaults(s);
-}
-
-/**
- * sets the given MpegEncContext to defaults for encoding.
- * the changed fields will not depend upon the prior state of the MpegEncContext.
- */
-
-#ifdef CONFIG_ENCODERS
-static void MPV_encode_defaults(MpegEncContext *s){
- static int done=0;
-
- MPV_common_defaults(s);
-
- if(!done){
- int i;
- done=1;
-
- default_mv_penalty= av_mallocz( sizeof(uint8_t)*(MAX_FCODE+1)*(2*MAX_MV+1) );
- memset(default_fcode_tab , 0, sizeof(uint8_t)*(2*MAX_MV+1));
-
- for(i=-16; i<16; i++){
- default_fcode_tab[i + MAX_MV]= 1;
- }
- }
- s->me.mv_penalty= default_mv_penalty;
- s->fcode_tab= default_fcode_tab;
-}
-#endif //CONFIG_ENCODERS
-
-/**
- * init common structure for both encoder and decoder.
- * this assumes that some variables like width/height are already set
- */
-int MPV_common_init(MpegEncContext *s)
-{
- int y_size, c_size, yc_size, i, mb_array_size, mv_table_size, x, y;
-
- s->mb_height = (s->height + 15) / 16;
-
- if(s->avctx->thread_count > MAX_THREADS || (s->avctx->thread_count > s->mb_height && s->mb_height)){
- av_log(s->avctx, AV_LOG_ERROR, "too many threads\n");
- return -1;
- }
-
- if((s->width || s->height) && avcodec_check_dimensions(s->avctx, s->width, s->height))
- return -1;
-
- dsputil_init(&s->dsp, s->avctx);
- DCT_common_init(s);
-
- s->flags= s->avctx->flags;
- s->flags2= s->avctx->flags2;
-
- s->mb_width = (s->width + 15) / 16;
- s->mb_stride = s->mb_width + 1;
- s->b8_stride = s->mb_width*2 + 1;
- s->b4_stride = s->mb_width*4 + 1;
- mb_array_size= s->mb_height * s->mb_stride;
- mv_table_size= (s->mb_height+2) * s->mb_stride + 1;
-
- /* set chroma shifts */
- avcodec_get_chroma_sub_sample(s->avctx->pix_fmt,&(s->chroma_x_shift),
- &(s->chroma_y_shift) );
-
- /* set default edge pos, will be overriden in decode_header if needed */
- s->h_edge_pos= s->mb_width*16;
- s->v_edge_pos= s->mb_height*16;
-
- s->mb_num = s->mb_width * s->mb_height;
-
- s->block_wrap[0]=
- s->block_wrap[1]=
- s->block_wrap[2]=
- s->block_wrap[3]= s->b8_stride;
- s->block_wrap[4]=
- s->block_wrap[5]= s->mb_stride;
-
- y_size = s->b8_stride * (2 * s->mb_height + 1);
- c_size = s->mb_stride * (s->mb_height + 1);
- yc_size = y_size + 2 * c_size;
-
- /* convert fourcc to upper case */
- s->codec_tag= toupper( s->avctx->codec_tag &0xFF)
- + (toupper((s->avctx->codec_tag>>8 )&0xFF)<<8 )
- + (toupper((s->avctx->codec_tag>>16)&0xFF)<<16)
- + (toupper((s->avctx->codec_tag>>24)&0xFF)<<24);
-
- s->stream_codec_tag= toupper( s->avctx->stream_codec_tag &0xFF)
- + (toupper((s->avctx->stream_codec_tag>>8 )&0xFF)<<8 )
- + (toupper((s->avctx->stream_codec_tag>>16)&0xFF)<<16)
- + (toupper((s->avctx->stream_codec_tag>>24)&0xFF)<<24);
-
- s->avctx->coded_frame= (AVFrame*)&s->current_picture;
-
- CHECKED_ALLOCZ(s->mb_index2xy, (s->mb_num+1)*sizeof(int)) //error ressilience code looks cleaner with this
- for(y=0; y<s->mb_height; y++){
- for(x=0; x<s->mb_width; x++){
- s->mb_index2xy[ x + y*s->mb_width ] = x + y*s->mb_stride;
- }
- }
- s->mb_index2xy[ s->mb_height*s->mb_width ] = (s->mb_height-1)*s->mb_stride + s->mb_width; //FIXME really needed?
-
- if (s->encoding) {
- /* Allocate MV tables */
- CHECKED_ALLOCZ(s->p_mv_table_base , mv_table_size * 2 * sizeof(int16_t))
- CHECKED_ALLOCZ(s->b_forw_mv_table_base , mv_table_size * 2 * sizeof(int16_t))
- CHECKED_ALLOCZ(s->b_back_mv_table_base , mv_table_size * 2 * sizeof(int16_t))
- CHECKED_ALLOCZ(s->b_bidir_forw_mv_table_base , mv_table_size * 2 * sizeof(int16_t))
- CHECKED_ALLOCZ(s->b_bidir_back_mv_table_base , mv_table_size * 2 * sizeof(int16_t))
- CHECKED_ALLOCZ(s->b_direct_mv_table_base , mv_table_size * 2 * sizeof(int16_t))
- s->p_mv_table = s->p_mv_table_base + s->mb_stride + 1;
- s->b_forw_mv_table = s->b_forw_mv_table_base + s->mb_stride + 1;
- s->b_back_mv_table = s->b_back_mv_table_base + s->mb_stride + 1;
- s->b_bidir_forw_mv_table= s->b_bidir_forw_mv_table_base + s->mb_stride + 1;
- s->b_bidir_back_mv_table= s->b_bidir_back_mv_table_base + s->mb_stride + 1;
- s->b_direct_mv_table = s->b_direct_mv_table_base + s->mb_stride + 1;
-
- if(s->msmpeg4_version){
- CHECKED_ALLOCZ(s->ac_stats, 2*2*(MAX_LEVEL+1)*(MAX_RUN+1)*2*sizeof(int));
- }
- CHECKED_ALLOCZ(s->avctx->stats_out, 256);
-
- /* Allocate MB type table */
- CHECKED_ALLOCZ(s->mb_type , mb_array_size * sizeof(uint16_t)) //needed for encoding
-
- CHECKED_ALLOCZ(s->lambda_table, mb_array_size * sizeof(int))
-
- CHECKED_ALLOCZ(s->q_intra_matrix, 64*32 * sizeof(int))
- CHECKED_ALLOCZ(s->q_inter_matrix, 64*32 * sizeof(int))
- CHECKED_ALLOCZ(s->q_intra_matrix16, 64*32*2 * sizeof(uint16_t))
- CHECKED_ALLOCZ(s->q_inter_matrix16, 64*32*2 * sizeof(uint16_t))
- CHECKED_ALLOCZ(s->input_picture, MAX_PICTURE_COUNT * sizeof(Picture*))
- CHECKED_ALLOCZ(s->reordered_input_picture, MAX_PICTURE_COUNT * sizeof(Picture*))
-
- if(s->avctx->noise_reduction){
- CHECKED_ALLOCZ(s->dct_offset, 2 * 64 * sizeof(uint16_t))
- }
- }
- CHECKED_ALLOCZ(s->picture, MAX_PICTURE_COUNT * sizeof(Picture))
-
- CHECKED_ALLOCZ(s->error_status_table, mb_array_size*sizeof(uint8_t))
-
- if(s->codec_id==CODEC_ID_MPEG4 || (s->flags & CODEC_FLAG_INTERLACED_ME)){
- /* interlaced direct mode decoding tables */
- for(i=0; i<2; i++){
- int j, k;
- for(j=0; j<2; j++){
- for(k=0; k<2; k++){
- CHECKED_ALLOCZ(s->b_field_mv_table_base[i][j][k] , mv_table_size * 2 * sizeof(int16_t))
- s->b_field_mv_table[i][j][k] = s->b_field_mv_table_base[i][j][k] + s->mb_stride + 1;
- }
- CHECKED_ALLOCZ(s->b_field_select_table[i][j] , mb_array_size * 2 * sizeof(uint8_t))
- CHECKED_ALLOCZ(s->p_field_mv_table_base[i][j] , mv_table_size * 2 * sizeof(int16_t))
- s->p_field_mv_table[i][j] = s->p_field_mv_table_base[i][j] + s->mb_stride + 1;
- }
- CHECKED_ALLOCZ(s->p_field_select_table[i] , mb_array_size * 2 * sizeof(uint8_t))
- }
- }
- if (s->out_format == FMT_H263) {
- /* ac values */
- CHECKED_ALLOCZ(s->ac_val_base, yc_size * sizeof(int16_t) * 16);
- s->ac_val[0] = s->ac_val_base + s->b8_stride + 1;
- s->ac_val[1] = s->ac_val_base + y_size + s->mb_stride + 1;
- s->ac_val[2] = s->ac_val[1] + c_size;
-
- /* cbp values */
- CHECKED_ALLOCZ(s->coded_block_base, y_size);
- s->coded_block= s->coded_block_base + s->b8_stride + 1;
-
- /* cbp, ac_pred, pred_dir */
- CHECKED_ALLOCZ(s->cbp_table , mb_array_size * sizeof(uint8_t))
- CHECKED_ALLOCZ(s->pred_dir_table, mb_array_size * sizeof(uint8_t))
- }
-
- if (s->h263_pred || s->h263_plus || !s->encoding) {
- /* dc values */
- //MN: we need these for error resilience of intra-frames
- CHECKED_ALLOCZ(s->dc_val_base, yc_size * sizeof(int16_t));
- s->dc_val[0] = s->dc_val_base + s->b8_stride + 1;
- s->dc_val[1] = s->dc_val_base + y_size + s->mb_stride + 1;
- s->dc_val[2] = s->dc_val[1] + c_size;
- for(i=0;i<yc_size;i++)
- s->dc_val_base[i] = 1024;
- }
-
- /* which mb is a intra block */
- CHECKED_ALLOCZ(s->mbintra_table, mb_array_size);
- memset(s->mbintra_table, 1, mb_array_size);
-
- /* init macroblock skip table */
- CHECKED_ALLOCZ(s->mbskip_table, mb_array_size+2);
- //Note the +1 is for a quicker mpeg4 slice_end detection
- CHECKED_ALLOCZ(s->prev_pict_types, PREV_PICT_TYPES_BUFFER_SIZE);
-
- s->parse_context.state= -1;
- if((s->avctx->debug&(FF_DEBUG_VIS_QP|FF_DEBUG_VIS_MB_TYPE)) || (s->avctx->debug_mv)){
- s->visualization_buffer[0] = av_malloc((s->mb_width*16 + 2*EDGE_WIDTH) * s->mb_height*16 + 2*EDGE_WIDTH);
- s->visualization_buffer[1] = av_malloc((s->mb_width*8 + EDGE_WIDTH) * s->mb_height*8 + EDGE_WIDTH);
- s->visualization_buffer[2] = av_malloc((s->mb_width*8 + EDGE_WIDTH) * s->mb_height*8 + EDGE_WIDTH);
- }
-
- s->context_initialized = 1;
-
- s->thread_context[0]= s;
- for(i=1; i<s->avctx->thread_count; i++){
- s->thread_context[i]= av_malloc(sizeof(MpegEncContext));
- memcpy(s->thread_context[i], s, sizeof(MpegEncContext));
- }
-
- for(i=0; i<s->avctx->thread_count; i++){
- if(init_duplicate_context(s->thread_context[i], s) < 0)
- goto fail;
- s->thread_context[i]->start_mb_y= (s->mb_height*(i ) + s->avctx->thread_count/2) / s->avctx->thread_count;
- s->thread_context[i]->end_mb_y = (s->mb_height*(i+1) + s->avctx->thread_count/2) / s->avctx->thread_count;
- }
-
- return 0;
- fail:
- MPV_common_end(s);
- return -1;
-}
-
-/* init common structure for both encoder and decoder */
-void MPV_common_end(MpegEncContext *s)
-{
- int i, j, k;
-
- for(i=0; i<s->avctx->thread_count; i++){
- free_duplicate_context(s->thread_context[i]);
- }
- for(i=1; i<s->avctx->thread_count; i++){
- av_freep(&s->thread_context[i]);
- }
-
- av_freep(&s->parse_context.buffer);
- s->parse_context.buffer_size=0;
-
- av_freep(&s->mb_type);
- av_freep(&s->p_mv_table_base);
- av_freep(&s->b_forw_mv_table_base);
- av_freep(&s->b_back_mv_table_base);
- av_freep(&s->b_bidir_forw_mv_table_base);
- av_freep(&s->b_bidir_back_mv_table_base);
- av_freep(&s->b_direct_mv_table_base);
- s->p_mv_table= NULL;
- s->b_forw_mv_table= NULL;
- s->b_back_mv_table= NULL;
- s->b_bidir_forw_mv_table= NULL;
- s->b_bidir_back_mv_table= NULL;
- s->b_direct_mv_table= NULL;
- for(i=0; i<2; i++){
- for(j=0; j<2; j++){
- for(k=0; k<2; k++){
- av_freep(&s->b_field_mv_table_base[i][j][k]);
- s->b_field_mv_table[i][j][k]=NULL;
- }
- av_freep(&s->b_field_select_table[i][j]);
- av_freep(&s->p_field_mv_table_base[i][j]);
- s->p_field_mv_table[i][j]=NULL;
- }
- av_freep(&s->p_field_select_table[i]);
- }
-
- av_freep(&s->dc_val_base);
- av_freep(&s->ac_val_base);
- av_freep(&s->coded_block_base);
- av_freep(&s->mbintra_table);
- av_freep(&s->cbp_table);
- av_freep(&s->pred_dir_table);
-
- av_freep(&s->mbskip_table);
- av_freep(&s->prev_pict_types);
- av_freep(&s->bitstream_buffer);
- s->allocated_bitstream_buffer_size=0;
-
- av_freep(&s->avctx->stats_out);
- av_freep(&s->ac_stats);
- av_freep(&s->error_status_table);
- av_freep(&s->mb_index2xy);
- av_freep(&s->lambda_table);
- av_freep(&s->q_intra_matrix);
- av_freep(&s->q_inter_matrix);
- av_freep(&s->q_intra_matrix16);
- av_freep(&s->q_inter_matrix16);
- av_freep(&s->input_picture);
- av_freep(&s->reordered_input_picture);
- av_freep(&s->dct_offset);
-
- if(s->picture){
- for(i=0; i<MAX_PICTURE_COUNT; i++){
- free_picture(s, &s->picture[i]);
- }
- }
- av_freep(&s->picture);
- s->context_initialized = 0;
- s->last_picture_ptr=
- s->next_picture_ptr=
- s->current_picture_ptr= NULL;
- s->linesize= s->uvlinesize= 0;
-
- for(i=0; i<3; i++)
- av_freep(&s->visualization_buffer[i]);
-
- avcodec_default_free_buffers(s->avctx);
-}
-
-#ifdef CONFIG_ENCODERS
-
-/* init video encoder */
-int MPV_encode_init(AVCodecContext *avctx)
-{
- MpegEncContext *s = avctx->priv_data;
- int i;
- int chroma_h_shift, chroma_v_shift;
-
- MPV_encode_defaults(s);
-
- switch (avctx->codec_id) {
- case CODEC_ID_MPEG2VIDEO:
- if(avctx->pix_fmt != PIX_FMT_YUV420P && avctx->pix_fmt != PIX_FMT_YUV422P){
- av_log(avctx, AV_LOG_ERROR, "only YUV420 and YUV422 are supported\n");
- return -1;
- }
- break;
- case CODEC_ID_LJPEG:
- case CODEC_ID_MJPEG:
- if(avctx->pix_fmt != PIX_FMT_YUVJ420P && avctx->pix_fmt != PIX_FMT_YUVJ422P &&
- ((avctx->pix_fmt != PIX_FMT_YUV420P && avctx->pix_fmt != PIX_FMT_YUV422P) || avctx->strict_std_compliance>FF_COMPLIANCE_INOFFICIAL)){
- av_log(avctx, AV_LOG_ERROR, "colorspace not supported in jpeg\n");
- return -1;
- }
- break;
- default:
- if(avctx->pix_fmt != PIX_FMT_YUV420P){
- av_log(avctx, AV_LOG_ERROR, "only YUV420 is supported\n");
- return -1;
- }
- }
-
- switch (avctx->pix_fmt) {
- case PIX_FMT_YUVJ422P:
- case PIX_FMT_YUV422P:
- s->chroma_format = CHROMA_422;
- break;
- case PIX_FMT_YUVJ420P:
- case PIX_FMT_YUV420P:
- default:
- s->chroma_format = CHROMA_420;
- break;
- }
-
- s->bit_rate = avctx->bit_rate;
- s->width = avctx->width;
- s->height = avctx->height;
- if(avctx->gop_size > 600 && avctx->strict_std_compliance>FF_COMPLIANCE_EXPERIMENTAL){
- av_log(avctx, AV_LOG_ERROR, "Warning keyframe interval too large! reducing it ...\n");
- avctx->gop_size=600;
- }
- s->gop_size = avctx->gop_size;
- s->avctx = avctx;
- s->flags= avctx->flags;
- s->flags2= avctx->flags2;
- s->max_b_frames= avctx->max_b_frames;
- s->codec_id= avctx->codec->id;
- s->luma_elim_threshold = avctx->luma_elim_threshold;
- s->chroma_elim_threshold= avctx->chroma_elim_threshold;
- s->strict_std_compliance= avctx->strict_std_compliance;
- s->data_partitioning= avctx->flags & CODEC_FLAG_PART;
- s->quarter_sample= (avctx->flags & CODEC_FLAG_QPEL)!=0;
- s->mpeg_quant= avctx->mpeg_quant;
- s->rtp_mode= !!avctx->rtp_payload_size;
- s->intra_dc_precision= avctx->intra_dc_precision;
- s->user_specified_pts = AV_NOPTS_VALUE;
-
- if (s->gop_size <= 1) {
- s->intra_only = 1;
- s->gop_size = 12;
- } else {
- s->intra_only = 0;
- }
-
- s->me_method = avctx->me_method;
-
- /* Fixed QSCALE */
- s->fixed_qscale = !!(avctx->flags & CODEC_FLAG_QSCALE);
-
- s->adaptive_quant= ( s->avctx->lumi_masking
- || s->avctx->dark_masking
- || s->avctx->temporal_cplx_masking
- || s->avctx->spatial_cplx_masking
- || s->avctx->p_masking
- || s->avctx->border_masking
- || (s->flags&CODEC_FLAG_QP_RD))
- && !s->fixed_qscale;
-
- s->obmc= !!(s->flags & CODEC_FLAG_OBMC);
- s->loop_filter= !!(s->flags & CODEC_FLAG_LOOP_FILTER);
- s->alternate_scan= !!(s->flags & CODEC_FLAG_ALT_SCAN);
- s->intra_vlc_format= !!(s->flags2 & CODEC_FLAG2_INTRA_VLC);
-
- if(avctx->rc_max_rate && !avctx->rc_buffer_size){
- av_log(avctx, AV_LOG_ERROR, "a vbv buffer size is needed, for encoding with a maximum bitrate\n");
- return -1;
- }
-
- if(avctx->rc_min_rate && avctx->rc_max_rate != avctx->rc_min_rate){
- av_log(avctx, AV_LOG_INFO, "Warning min_rate > 0 but min_rate != max_rate isn't recommended!\n");
- }
-
- if(avctx->rc_min_rate && avctx->rc_min_rate > avctx->bit_rate){
- av_log(avctx, AV_LOG_INFO, "bitrate below min bitrate\n");
- return -1;
- }
-
- if(avctx->rc_max_rate && avctx->rc_max_rate < avctx->bit_rate){
- av_log(avctx, AV_LOG_INFO, "bitrate above max bitrate\n");
- return -1;
- }
-
- if( s->avctx->rc_max_rate && s->avctx->rc_min_rate == s->avctx->rc_max_rate
- && (s->codec_id == CODEC_ID_MPEG1VIDEO || s->codec_id == CODEC_ID_MPEG2VIDEO)
- && 90000LL * (avctx->rc_buffer_size-1) > s->avctx->rc_max_rate*0xFFFFLL){
-
- av_log(avctx, AV_LOG_INFO, "Warning vbv_delay will be set to 0xFFFF (=VBR) as the specified vbv buffer is too large for the given bitrate!\n");
- }
-
- if((s->flags & CODEC_FLAG_4MV) && s->codec_id != CODEC_ID_MPEG4
- && s->codec_id != CODEC_ID_H263 && s->codec_id != CODEC_ID_H263P && s->codec_id != CODEC_ID_FLV1){
- av_log(avctx, AV_LOG_ERROR, "4MV not supported by codec\n");
- return -1;
- }
-
- if(s->obmc && s->avctx->mb_decision != FF_MB_DECISION_SIMPLE){
- av_log(avctx, AV_LOG_ERROR, "OBMC is only supported with simple mb decision\n");
- return -1;
- }
-
- if(s->obmc && s->codec_id != CODEC_ID_H263 && s->codec_id != CODEC_ID_H263P){
- av_log(avctx, AV_LOG_ERROR, "OBMC is only supported with H263(+)\n");
- return -1;
- }
-
- if(s->quarter_sample && s->codec_id != CODEC_ID_MPEG4){
- av_log(avctx, AV_LOG_ERROR, "qpel not supported by codec\n");
- return -1;
- }
-
- if(s->data_partitioning && s->codec_id != CODEC_ID_MPEG4){
- av_log(avctx, AV_LOG_ERROR, "data partitioning not supported by codec\n");
- return -1;
- }
-
- if(s->max_b_frames && s->codec_id != CODEC_ID_MPEG4 && s->codec_id != CODEC_ID_MPEG1VIDEO && s->codec_id != CODEC_ID_MPEG2VIDEO){
- av_log(avctx, AV_LOG_ERROR, "b frames not supported by codec\n");
- return -1;
- }
-
- if((s->flags & (CODEC_FLAG_INTERLACED_DCT|CODEC_FLAG_INTERLACED_ME|CODEC_FLAG_ALT_SCAN))
- && s->codec_id != CODEC_ID_MPEG4 && s->codec_id != CODEC_ID_MPEG2VIDEO){
- av_log(avctx, AV_LOG_ERROR, "interlacing not supported by codec\n");
- return -1;
- }
-
- if(s->mpeg_quant && s->codec_id != CODEC_ID_MPEG4){ //FIXME mpeg2 uses that too
- av_log(avctx, AV_LOG_ERROR, "mpeg2 style quantization not supported by codec\n");
- return -1;
- }
-
- if((s->flags & CODEC_FLAG_CBP_RD) && !(s->flags & CODEC_FLAG_TRELLIS_QUANT)){
- av_log(avctx, AV_LOG_ERROR, "CBP RD needs trellis quant\n");
- return -1;
- }
-
- if((s->flags & CODEC_FLAG_QP_RD) && s->avctx->mb_decision != FF_MB_DECISION_RD){
- av_log(avctx, AV_LOG_ERROR, "QP RD needs mbd=2\n");
- return -1;
- }
-
- if(s->avctx->scenechange_threshold < 1000000000 && (s->flags & CODEC_FLAG_CLOSED_GOP)){
- av_log(avctx, AV_LOG_ERROR, "closed gop with scene change detection arent supported yet, set threshold to 1000000000\n");
- return -1;
- }
-
- if((s->flags2 & CODEC_FLAG2_INTRA_VLC) && s->codec_id != CODEC_ID_MPEG2VIDEO){
- av_log(avctx, AV_LOG_ERROR, "intra vlc table not supported by codec\n");
- return -1;
- }
-
- if(s->flags & CODEC_FLAG_LOW_DELAY){
- if (s->codec_id != CODEC_ID_MPEG2VIDEO && s->codec_id != CODEC_ID_MPEG1VIDEO){
- av_log(avctx, AV_LOG_ERROR, "low delay forcing is only available for mpeg1/2\n");
- return -1;
- }
- if (s->max_b_frames != 0){
- av_log(avctx, AV_LOG_ERROR, "b frames cannot be used with low delay\n");
- return -1;
- }
- }
-
- if(s->avctx->thread_count > 1 && s->codec_id != CODEC_ID_MPEG4
- && s->codec_id != CODEC_ID_MPEG1VIDEO && s->codec_id != CODEC_ID_MPEG2VIDEO
- && (s->codec_id != CODEC_ID_H263P || !(s->flags & CODEC_FLAG_H263P_SLICE_STRUCT))){
- av_log(avctx, AV_LOG_ERROR, "multi threaded encoding not supported by codec\n");
- return -1;
- }
-
- if(s->avctx->thread_count > 1)
- s->rtp_mode= 1;
-
- if(!avctx->time_base.den || !avctx->time_base.num){
- av_log(avctx, AV_LOG_ERROR, "framerate not set\n");
- return -1;
- }
-
- i= (INT_MAX/2+128)>>8;
- if(avctx->me_threshold >= i){
- av_log(avctx, AV_LOG_ERROR, "me_threshold too large, max is %d\n", i - 1);
- return -1;
- }
- if(avctx->mb_threshold >= i){
- av_log(avctx, AV_LOG_ERROR, "mb_threshold too large, max is %d\n", i - 1);
- return -1;
- }
-
- if(avctx->b_frame_strategy && (avctx->flags&CODEC_FLAG_PASS2)){
- av_log(avctx, AV_LOG_INFO, "notice: b_frame_strategy only affects the first pass\n");
- avctx->b_frame_strategy = 0;
- }
-
- i= ff_gcd(avctx->time_base.den, avctx->time_base.num);
- if(i > 1){
- av_log(avctx, AV_LOG_INFO, "removing common factors from framerate\n");
- avctx->time_base.den /= i;
- avctx->time_base.num /= i;
-// return -1;
- }
-
- if(s->codec_id==CODEC_ID_MJPEG){
- s->intra_quant_bias= 1<<(QUANT_BIAS_SHIFT-1); //(a + x/2)/x
- s->inter_quant_bias= 0;
- }else if(s->mpeg_quant || s->codec_id==CODEC_ID_MPEG1VIDEO || s->codec_id==CODEC_ID_MPEG2VIDEO){
- s->intra_quant_bias= 3<<(QUANT_BIAS_SHIFT-3); //(a + x*3/8)/x
- s->inter_quant_bias= 0;
- }else{
- s->intra_quant_bias=0;
- s->inter_quant_bias=-(1<<(QUANT_BIAS_SHIFT-2)); //(a - x/4)/x
- }
-
- if(avctx->intra_quant_bias != FF_DEFAULT_QUANT_BIAS)
- s->intra_quant_bias= avctx->intra_quant_bias;
- if(avctx->inter_quant_bias != FF_DEFAULT_QUANT_BIAS)
- s->inter_quant_bias= avctx->inter_quant_bias;
-
- avcodec_get_chroma_sub_sample(avctx->pix_fmt, &chroma_h_shift, &chroma_v_shift);
-
- if(avctx->codec_id == CODEC_ID_MPEG4 && s->avctx->time_base.den > (1<<16)-1){
- av_log(avctx, AV_LOG_ERROR, "timebase not supported by mpeg 4 standard\n");
- return -1;
- }
- s->time_increment_bits = av_log2(s->avctx->time_base.den - 1) + 1;
-
- switch(avctx->codec->id) {
- case CODEC_ID_MPEG1VIDEO:
- s->out_format = FMT_MPEG1;
- s->low_delay= !!(s->flags & CODEC_FLAG_LOW_DELAY);
- avctx->delay= s->low_delay ? 0 : (s->max_b_frames + 1);
- break;
- case CODEC_ID_MPEG2VIDEO:
- s->out_format = FMT_MPEG1;
- s->low_delay= !!(s->flags & CODEC_FLAG_LOW_DELAY);
- avctx->delay= s->low_delay ? 0 : (s->max_b_frames + 1);
- s->rtp_mode= 1;
- break;
- case CODEC_ID_LJPEG:
- case CODEC_ID_JPEGLS:
- case CODEC_ID_MJPEG:
- s->out_format = FMT_MJPEG;
- s->intra_only = 1; /* force intra only for jpeg */
- s->mjpeg_write_tables = avctx->codec->id != CODEC_ID_JPEGLS;
- s->mjpeg_data_only_frames = 0; /* write all the needed headers */
- s->mjpeg_vsample[0] = 2;
- s->mjpeg_vsample[1] = 2>>chroma_v_shift;
- s->mjpeg_vsample[2] = 2>>chroma_v_shift;
- s->mjpeg_hsample[0] = 2;
- s->mjpeg_hsample[1] = 2>>chroma_h_shift;
- s->mjpeg_hsample[2] = 2>>chroma_h_shift;
- if (mjpeg_init(s) < 0)
- return -1;
- avctx->delay=0;
- s->low_delay=1;
- break;
-#ifdef CONFIG_H261_ENCODER
- case CODEC_ID_H261:
- if (ff_h261_get_picture_format(s->width, s->height) < 0) {
- av_log(avctx, AV_LOG_ERROR, "The specified picture size of %dx%d is not valid for the H.261 codec.\nValid sizes are 176x144, 352x288\n", s->width, s->height);
- return -1;
- }
- s->out_format = FMT_H261;
- avctx->delay=0;
- s->low_delay=1;
- break;
-#endif
- case CODEC_ID_H263:
- if (h263_get_picture_format(s->width, s->height) == 7) {
- av_log(avctx, AV_LOG_INFO, "The specified picture size of %dx%d is not valid for the H.263 codec.\nValid sizes are 128x96, 176x144, 352x288, 704x576, and 1408x1152. Try H.263+.\n", s->width, s->height);
- return -1;
- }
- s->out_format = FMT_H263;
- s->obmc= (avctx->flags & CODEC_FLAG_OBMC) ? 1:0;
- avctx->delay=0;
- s->low_delay=1;
- break;
- case CODEC_ID_H263P:
- s->out_format = FMT_H263;
- s->h263_plus = 1;
- /* Fx */
- s->umvplus = (avctx->flags & CODEC_FLAG_H263P_UMV) ? 1:0;
- s->h263_aic= (avctx->flags & CODEC_FLAG_H263P_AIC) ? 1:0;
- s->modified_quant= s->h263_aic;
- s->alt_inter_vlc= (avctx->flags & CODEC_FLAG_H263P_AIV) ? 1:0;
- s->obmc= (avctx->flags & CODEC_FLAG_OBMC) ? 1:0;
- s->loop_filter= (avctx->flags & CODEC_FLAG_LOOP_FILTER) ? 1:0;
- s->unrestricted_mv= s->obmc || s->loop_filter || s->umvplus;
- s->h263_slice_structured= (s->flags & CODEC_FLAG_H263P_SLICE_STRUCT) ? 1:0;
-
- /* /Fx */
- /* These are just to be sure */
- avctx->delay=0;
- s->low_delay=1;
- break;
- case CODEC_ID_FLV1:
- s->out_format = FMT_H263;
- s->h263_flv = 2; /* format = 1; 11-bit codes */
- s->unrestricted_mv = 1;
- s->rtp_mode=0; /* don't allow GOB */
- avctx->delay=0;
- s->low_delay=1;
- break;
- case CODEC_ID_RV10:
- s->out_format = FMT_H263;
- avctx->delay=0;
- s->low_delay=1;
- break;
- case CODEC_ID_RV20:
- s->out_format = FMT_H263;
- avctx->delay=0;
- s->low_delay=1;
- s->modified_quant=1;
- s->h263_aic=1;
- s->h263_plus=1;
- s->loop_filter=1;
- s->unrestricted_mv= s->obmc || s->loop_filter || s->umvplus;
- break;
- case CODEC_ID_MPEG4:
- s->out_format = FMT_H263;
- s->h263_pred = 1;
- s->unrestricted_mv = 1;
- s->low_delay= s->max_b_frames ? 0 : 1;
- avctx->delay= s->low_delay ? 0 : (s->max_b_frames + 1);
- break;
- case CODEC_ID_MSMPEG4V1:
- s->out_format = FMT_H263;
- s->h263_msmpeg4 = 1;
- s->h263_pred = 1;
- s->unrestricted_mv = 1;
- s->msmpeg4_version= 1;
- avctx->delay=0;
- s->low_delay=1;
- break;
- case CODEC_ID_MSMPEG4V2:
- s->out_format = FMT_H263;
- s->h263_msmpeg4 = 1;
- s->h263_pred = 1;
- s->unrestricted_mv = 1;
- s->msmpeg4_version= 2;
- avctx->delay=0;
- s->low_delay=1;
- break;
- case CODEC_ID_MSMPEG4V3:
- s->out_format = FMT_H263;
- s->h263_msmpeg4 = 1;
- s->h263_pred = 1;
- s->unrestricted_mv = 1;
- s->msmpeg4_version= 3;
- s->flipflop_rounding=1;
- avctx->delay=0;
- s->low_delay=1;
- break;
- case CODEC_ID_WMV1:
- s->out_format = FMT_H263;
- s->h263_msmpeg4 = 1;
- s->h263_pred = 1;
- s->unrestricted_mv = 1;
- s->msmpeg4_version= 4;
- s->flipflop_rounding=1;
- avctx->delay=0;
- s->low_delay=1;
- break;
- case CODEC_ID_WMV2:
- s->out_format = FMT_H263;
- s->h263_msmpeg4 = 1;
- s->h263_pred = 1;
- s->unrestricted_mv = 1;
- s->msmpeg4_version= 5;
- s->flipflop_rounding=1;
- avctx->delay=0;
- s->low_delay=1;
- break;
- default:
- return -1;
- }
-
- avctx->has_b_frames= !s->low_delay;
-
- s->encoding = 1;
-
- /* init */
- if (MPV_common_init(s) < 0)
- return -1;
-
- if(s->modified_quant)
- s->chroma_qscale_table= ff_h263_chroma_qscale_table;
- s->progressive_frame=
- s->progressive_sequence= !(avctx->flags & (CODEC_FLAG_INTERLACED_DCT|CODEC_FLAG_INTERLACED_ME|CODEC_FLAG_ALT_SCAN));
- s->quant_precision=5;
-
- ff_set_cmp(&s->dsp, s->dsp.ildct_cmp, s->avctx->ildct_cmp);
- ff_set_cmp(&s->dsp, s->dsp.frame_skip_cmp, s->avctx->frame_skip_cmp);
-
-/* xine: do not need this for decode or MPEG-1 encoding modes */
-#if 0
-#ifdef CONFIG_H261_ENCODER
- if (s->out_format == FMT_H261)
- ff_h261_encode_init(s);
-#endif
- if (s->out_format == FMT_H263)
- h263_encode_init(s);
- if(s->msmpeg4_version)
- ff_msmpeg4_encode_init(s);
-#endif /* #if 0 */
-/* xine: we DO want this for MPEG-1 encoding */
- if (s->out_format == FMT_MPEG1)
- ff_mpeg1_encode_init(s);
-
- /* init q matrix */
- for(i=0;i<64;i++) {
- int j= s->dsp.idct_permutation[i];
- if(s->codec_id==CODEC_ID_MPEG4 && s->mpeg_quant){
- s->intra_matrix[j] = ff_mpeg4_default_intra_matrix[i];
- s->inter_matrix[j] = ff_mpeg4_default_non_intra_matrix[i];
- }else if(s->out_format == FMT_H263 || s->out_format == FMT_H261){
- s->intra_matrix[j] =
- s->inter_matrix[j] = ff_mpeg1_default_non_intra_matrix[i];
- }else
- { /* mpeg1/2 */
- s->intra_matrix[j] = ff_mpeg1_default_intra_matrix[i];
- s->inter_matrix[j] = ff_mpeg1_default_non_intra_matrix[i];
- }
- if(s->avctx->intra_matrix)
- s->intra_matrix[j] = s->avctx->intra_matrix[i];
- if(s->avctx->inter_matrix)
- s->inter_matrix[j] = s->avctx->inter_matrix[i];
- }
-
- /* precompute matrix */
- /* for mjpeg, we do include qscale in the matrix */
- if (s->out_format != FMT_MJPEG) {
- convert_matrix(&s->dsp, s->q_intra_matrix, s->q_intra_matrix16,
- s->intra_matrix, s->intra_quant_bias, avctx->qmin, 31, 1);
- convert_matrix(&s->dsp, s->q_inter_matrix, s->q_inter_matrix16,
- s->inter_matrix, s->inter_quant_bias, avctx->qmin, 31, 0);
- }
-
- if(ff_rate_control_init(s) < 0)
- return -1;
-
- return 0;
-}
-
-int MPV_encode_end(AVCodecContext *avctx)
-{
- MpegEncContext *s = avctx->priv_data;
-
- ff_rate_control_uninit(s);
-
-/* xine: do not need this for decode or MPEG-1 encoding modes */
-#if 0
- MPV_common_end(s);
- if (s->out_format == FMT_MJPEG)
- mjpeg_close(s);
-#endif /* #if 0 */
-
- av_freep(&avctx->extradata);
-
- return 0;
-}
-
-#endif //CONFIG_ENCODERS
-
-void init_rl(RLTable *rl, int use_static)
-{
- int8_t max_level[MAX_RUN+1], max_run[MAX_LEVEL+1];
- uint8_t index_run[MAX_RUN+1];
- int last, run, level, start, end, i;
-
- /* If table is static, we can quit if rl->max_level[0] is not NULL */
- if(use_static && rl->max_level[0])
- return;
-
- /* compute max_level[], max_run[] and index_run[] */
- for(last=0;last<2;last++) {
- if (last == 0) {
- start = 0;
- end = rl->last;
- } else {
- start = rl->last;
- end = rl->n;
- }
-
- memset(max_level, 0, MAX_RUN + 1);
- memset(max_run, 0, MAX_LEVEL + 1);
- memset(index_run, rl->n, MAX_RUN + 1);
- for(i=start;i<end;i++) {
- run = rl->table_run[i];
- level = rl->table_level[i];
- if (index_run[run] == rl->n)
- index_run[run] = i;
- if (level > max_level[run])
- max_level[run] = level;
- if (run > max_run[level])
- max_run[level] = run;
- }
- if(use_static)
- rl->max_level[last] = av_mallocz_static(MAX_RUN + 1);
- else
- rl->max_level[last] = av_malloc(MAX_RUN + 1);
- memcpy(rl->max_level[last], max_level, MAX_RUN + 1);
- if(use_static)
- rl->max_run[last] = av_mallocz_static(MAX_LEVEL + 1);
- else
- rl->max_run[last] = av_malloc(MAX_LEVEL + 1);
- memcpy(rl->max_run[last], max_run, MAX_LEVEL + 1);
- if(use_static)
- rl->index_run[last] = av_mallocz_static(MAX_RUN + 1);
- else
- rl->index_run[last] = av_malloc(MAX_RUN + 1);
- memcpy(rl->index_run[last], index_run, MAX_RUN + 1);
- }
-}
-
-/* draw the edges of width 'w' of an image of size width, height */
-//FIXME check that this is ok for mpeg4 interlaced
-static void draw_edges_c(uint8_t *buf, int wrap, int width, int height, int w)
-{
- uint8_t *ptr, *last_line;
- int i;
-
- last_line = buf + (height - 1) * wrap;
- for(i=0;i<w;i++) {
- /* top and bottom */
- memcpy(buf - (i + 1) * wrap, buf, width);
- memcpy(last_line + (i + 1) * wrap, last_line, width);
- }
- /* left and right */
- ptr = buf;
- for(i=0;i<height;i++) {
- memset(ptr - w, ptr[0], w);
- memset(ptr + width, ptr[width-1], w);
- ptr += wrap;
- }
- /* corners */
- for(i=0;i<w;i++) {
- memset(buf - (i + 1) * wrap - w, buf[0], w); /* top left */
- memset(buf - (i + 1) * wrap + width, buf[width-1], w); /* top right */
- memset(last_line + (i + 1) * wrap - w, last_line[0], w); /* top left */
- memset(last_line + (i + 1) * wrap + width, last_line[width-1], w); /* top right */
- }
-}
-
-int ff_find_unused_picture(MpegEncContext *s, int shared){
- int i;
-
- if(shared){
- for(i=0; i<MAX_PICTURE_COUNT; i++){
- if(s->picture[i].data[0]==NULL && s->picture[i].type==0) return i;
- }
- }else{
- for(i=0; i<MAX_PICTURE_COUNT; i++){
- if(s->picture[i].data[0]==NULL && s->picture[i].type!=0) return i; //FIXME
- }
- for(i=0; i<MAX_PICTURE_COUNT; i++){
- if(s->picture[i].data[0]==NULL) return i;
- }
- }
-
- assert(0);
- return -1;
-}
-
-static void update_noise_reduction(MpegEncContext *s){
- int intra, i;
-
- for(intra=0; intra<2; intra++){
- if(s->dct_count[intra] > (1<<16)){
- for(i=0; i<64; i++){
- s->dct_error_sum[intra][i] >>=1;
- }
- s->dct_count[intra] >>= 1;
- }
-
- for(i=0; i<64; i++){
- s->dct_offset[intra][i]= (s->avctx->noise_reduction * s->dct_count[intra] + s->dct_error_sum[intra][i]/2) / (s->dct_error_sum[intra][i]+1);
- }
- }
-}
-
-/**
- * generic function for encode/decode called after coding/decoding the header and before a frame is coded/decoded
- */
-int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
-{
- int i;
- AVFrame *pic;
- s->mb_skipped = 0;
-
- assert(s->last_picture_ptr==NULL || s->out_format != FMT_H264 || s->codec_id == CODEC_ID_SVQ3);
-
- /* mark&release old frames */
- if (s->pict_type != B_TYPE && s->last_picture_ptr && s->last_picture_ptr != s->next_picture_ptr && s->last_picture_ptr->data[0]) {
- if(s->out_format != FMT_H264 || s->codec_id == CODEC_ID_SVQ3){
- avctx->release_buffer(avctx, (AVFrame*)s->last_picture_ptr);
-
- /* release forgotten pictures */
- /* if(mpeg124/h263) */
- if(!s->encoding){
- for(i=0; i<MAX_PICTURE_COUNT; i++){
- if(s->picture[i].data[0] && &s->picture[i] != s->next_picture_ptr && s->picture[i].reference){
- av_log(avctx, AV_LOG_ERROR, "releasing zombie picture\n");
- avctx->release_buffer(avctx, (AVFrame*)&s->picture[i]);
- }
- }
- }
- }
- }
-alloc:
- if(!s->encoding){
- /* release non reference frames */
- for(i=0; i<MAX_PICTURE_COUNT; i++){
- if(s->picture[i].data[0] && !s->picture[i].reference /*&& s->picture[i].type!=FF_BUFFER_TYPE_SHARED*/){
- s->avctx->release_buffer(s->avctx, (AVFrame*)&s->picture[i]);
- }
- }
-
- if(s->current_picture_ptr && s->current_picture_ptr->data[0]==NULL)
- pic= (AVFrame*)s->current_picture_ptr; //we allready have a unused image (maybe it was set before reading the header)
- else{
- i= ff_find_unused_picture(s, 0);
- pic= (AVFrame*)&s->picture[i];
- }
-
- pic->reference= (s->pict_type != B_TYPE || s->codec_id == CODEC_ID_H264)
- && !s->dropable ? 3 : 0;
-
- pic->coded_picture_number= s->coded_picture_number++;
-
- if( alloc_picture(s, (Picture*)pic, 0) < 0)
- return -1;
-
- s->current_picture_ptr= (Picture*)pic;
- s->current_picture_ptr->top_field_first= s->top_field_first; //FIXME use only the vars from current_pic
- s->current_picture_ptr->interlaced_frame= !s->progressive_frame && !s->progressive_sequence;
- }
-
- s->current_picture_ptr->pict_type= s->pict_type;
-// if(s->flags && CODEC_FLAG_QSCALE)
- // s->current_picture_ptr->quality= s->new_picture_ptr->quality;
- s->current_picture_ptr->key_frame= s->pict_type == I_TYPE;
-
- copy_picture(&s->current_picture, s->current_picture_ptr);
-
- if (s->pict_type != B_TYPE) {
- s->last_picture_ptr= s->next_picture_ptr;
- if(!s->dropable)
- s->next_picture_ptr= s->current_picture_ptr;
- }
-/* av_log(s->avctx, AV_LOG_DEBUG, "L%p N%p C%p L%p N%p C%p type:%d drop:%d\n", s->last_picture_ptr, s->next_picture_ptr,s->current_picture_ptr,
- s->last_picture_ptr ? s->last_picture_ptr->data[0] : NULL,
- s->next_picture_ptr ? s->next_picture_ptr->data[0] : NULL,
- s->current_picture_ptr ? s->current_picture_ptr->data[0] : NULL,
- s->pict_type, s->dropable);*/
-
- if(s->last_picture_ptr) copy_picture(&s->last_picture, s->last_picture_ptr);
- if(s->next_picture_ptr) copy_picture(&s->next_picture, s->next_picture_ptr);
-
- if(s->pict_type != I_TYPE && (s->last_picture_ptr==NULL || s->last_picture_ptr->data[0]==NULL) && !s->dropable){
- av_log(avctx, AV_LOG_ERROR, "warning: first frame is no keyframe\n");
- assert(s->pict_type != B_TYPE); //these should have been dropped if we don't have a reference
- goto alloc;
- }
-
- assert(s->pict_type == I_TYPE || (s->last_picture_ptr && s->last_picture_ptr->data[0]));
-
- if(s->picture_structure!=PICT_FRAME){
- int i;
- for(i=0; i<4; i++){
- if(s->picture_structure == PICT_BOTTOM_FIELD){
- s->current_picture.data[i] += s->current_picture.linesize[i];
- }
- s->current_picture.linesize[i] *= 2;
- s->last_picture.linesize[i] *=2;
- s->next_picture.linesize[i] *=2;
- }
- }
-
- s->hurry_up= s->avctx->hurry_up;
- s->error_resilience= avctx->error_resilience;
-
- /* set dequantizer, we can't do it during init as it might change for mpeg4
- and we can't do it in the header decode as init isnt called for mpeg4 there yet */
- if(s->mpeg_quant || s->codec_id == CODEC_ID_MPEG2VIDEO){
- s->dct_unquantize_intra = s->dct_unquantize_mpeg2_intra;
- s->dct_unquantize_inter = s->dct_unquantize_mpeg2_inter;
- }else if(s->out_format == FMT_H263 || s->out_format == FMT_H261){
- s->dct_unquantize_intra = s->dct_unquantize_h263_intra;
- s->dct_unquantize_inter = s->dct_unquantize_h263_inter;
- }else{
- s->dct_unquantize_intra = s->dct_unquantize_mpeg1_intra;
- s->dct_unquantize_inter = s->dct_unquantize_mpeg1_inter;
- }
-
- if(s->dct_error_sum){
- assert(s->avctx->noise_reduction && s->encoding);
-
- update_noise_reduction(s);
- }
-
-#ifdef HAVE_XVMC
- if(s->avctx->xvmc_acceleration)
- return XVMC_field_start(s, avctx);
-#endif
- return 0;
-}
-
-/* generic function for encode/decode called after a frame has been coded/decoded */
-void MPV_frame_end(MpegEncContext *s)
-{
- int i;
- /* draw edge for correct motion prediction if outside */
-#ifdef HAVE_XVMC
-//just to make sure that all data is rendered.
- if(s->avctx->xvmc_acceleration){
- XVMC_field_end(s);
- }else
-#endif
- if(s->unrestricted_mv && s->current_picture.reference && !s->intra_only && !(s->flags&CODEC_FLAG_EMU_EDGE)) {
- draw_edges(s->current_picture.data[0], s->linesize , s->h_edge_pos , s->v_edge_pos , EDGE_WIDTH );
- draw_edges(s->current_picture.data[1], s->uvlinesize, s->h_edge_pos>>1, s->v_edge_pos>>1, EDGE_WIDTH/2);
- draw_edges(s->current_picture.data[2], s->uvlinesize, s->h_edge_pos>>1, s->v_edge_pos>>1, EDGE_WIDTH/2);
- }
- emms_c();
-
- s->last_pict_type = s->pict_type;
- s->last_lambda_for[s->pict_type]= s->current_picture_ptr->quality;
- if(s->pict_type!=B_TYPE){
- s->last_non_b_pict_type= s->pict_type;
- }
-#if 0
- /* copy back current_picture variables */
- for(i=0; i<MAX_PICTURE_COUNT; i++){
- if(s->picture[i].data[0] == s->current_picture.data[0]){
- s->picture[i]= s->current_picture;
- break;
- }
- }
- assert(i<MAX_PICTURE_COUNT);
-#endif
-
- if(s->encoding){
- /* release non-reference frames */
- for(i=0; i<MAX_PICTURE_COUNT; i++){
- if(s->picture[i].data[0] && !s->picture[i].reference /*&& s->picture[i].type!=FF_BUFFER_TYPE_SHARED*/){
- s->avctx->release_buffer(s->avctx, (AVFrame*)&s->picture[i]);
- }
- }
- }
- // clear copies, to avoid confusion
-#if 0
- memset(&s->last_picture, 0, sizeof(Picture));
- memset(&s->next_picture, 0, sizeof(Picture));
- memset(&s->current_picture, 0, sizeof(Picture));
-#endif
- s->avctx->coded_frame= (AVFrame*)s->current_picture_ptr;
-}
-
-/**
- * draws an line from (ex, ey) -> (sx, sy).
- * @param w width of the image
- * @param h height of the image
- * @param stride stride/linesize of the image
- * @param color color of the arrow
- */
-static void draw_line(uint8_t *buf, int sx, int sy, int ex, int ey, int w, int h, int stride, int color){
- int x, y, fr, f;
-
- sx= clip(sx, 0, w-1);
- sy= clip(sy, 0, h-1);
- ex= clip(ex, 0, w-1);
- ey= clip(ey, 0, h-1);
-
- buf[sy*stride + sx]+= color;
-
- if(FFABS(ex - sx) > FFABS(ey - sy)){
- if(sx > ex){
- FFSWAP(int, sx, ex);
- FFSWAP(int, sy, ey);
- }
- buf+= sx + sy*stride;
- ex-= sx;
- f= ((ey-sy)<<16)/ex;
- for(x= 0; x <= ex; x++){
- y = (x*f)>>16;
- fr= (x*f)&0xFFFF;
- buf[ y *stride + x]+= (color*(0x10000-fr))>>16;
- buf[(y+1)*stride + x]+= (color* fr )>>16;
- }
- }else{
- if(sy > ey){
- FFSWAP(int, sx, ex);
- FFSWAP(int, sy, ey);
- }
- buf+= sx + sy*stride;
- ey-= sy;
- if(ey) f= ((ex-sx)<<16)/ey;
- else f= 0;
- for(y= 0; y <= ey; y++){
- x = (y*f)>>16;
- fr= (y*f)&0xFFFF;
- buf[y*stride + x ]+= (color*(0x10000-fr))>>16;;
- buf[y*stride + x+1]+= (color* fr )>>16;;
- }
- }
-}
-
-/**
- * draws an arrow from (ex, ey) -> (sx, sy).
- * @param w width of the image
- * @param h height of the image
- * @param stride stride/linesize of the image
- * @param color color of the arrow
- */
-static void draw_arrow(uint8_t *buf, int sx, int sy, int ex, int ey, int w, int h, int stride, int color){
- int dx,dy;
-
- sx= clip(sx, -100, w+100);
- sy= clip(sy, -100, h+100);
- ex= clip(ex, -100, w+100);
- ey= clip(ey, -100, h+100);
-
- dx= ex - sx;
- dy= ey - sy;
-
- if(dx*dx + dy*dy > 3*3){
- int rx= dx + dy;
- int ry= -dx + dy;
- int length= ff_sqrt((rx*rx + ry*ry)<<8);
-
- //FIXME subpixel accuracy
- rx= ROUNDED_DIV(rx*3<<4, length);
- ry= ROUNDED_DIV(ry*3<<4, length);
-
- draw_line(buf, sx, sy, sx + rx, sy + ry, w, h, stride, color);
- draw_line(buf, sx, sy, sx - ry, sy + rx, w, h, stride, color);
- }
- draw_line(buf, sx, sy, ex, ey, w, h, stride, color);
-}
-
-/**
- * prints debuging info for the given picture.
- */
-void ff_print_debug_info(MpegEncContext *s, AVFrame *pict){
-
- if(!pict || !pict->mb_type) return;
-
- if(s->avctx->debug&(FF_DEBUG_SKIP | FF_DEBUG_QP | FF_DEBUG_MB_TYPE)){
- int x,y;
-
- av_log(s->avctx,AV_LOG_DEBUG,"New frame, type: ");
- switch (pict->pict_type) {
- case FF_I_TYPE: av_log(s->avctx,AV_LOG_DEBUG,"I\n"); break;
- case FF_P_TYPE: av_log(s->avctx,AV_LOG_DEBUG,"P\n"); break;
- case FF_B_TYPE: av_log(s->avctx,AV_LOG_DEBUG,"B\n"); break;
- case FF_S_TYPE: av_log(s->avctx,AV_LOG_DEBUG,"S\n"); break;
- case FF_SI_TYPE: av_log(s->avctx,AV_LOG_DEBUG,"SI\n"); break;
- case FF_SP_TYPE: av_log(s->avctx,AV_LOG_DEBUG,"SP\n"); break;
- }
- for(y=0; y<s->mb_height; y++){
- for(x=0; x<s->mb_width; x++){
- if(s->avctx->debug&FF_DEBUG_SKIP){
- int count= s->mbskip_table[x + y*s->mb_stride];
- if(count>9) count=9;
- av_log(s->avctx, AV_LOG_DEBUG, "%1d", count);
- }
- if(s->avctx->debug&FF_DEBUG_QP){
- av_log(s->avctx, AV_LOG_DEBUG, "%2d", pict->qscale_table[x + y*s->mb_stride]);
- }
- if(s->avctx->debug&FF_DEBUG_MB_TYPE){
- int mb_type= pict->mb_type[x + y*s->mb_stride];
- //Type & MV direction
- if(IS_PCM(mb_type))
- av_log(s->avctx, AV_LOG_DEBUG, "P");
- else if(IS_INTRA(mb_type) && IS_ACPRED(mb_type))
- av_log(s->avctx, AV_LOG_DEBUG, "A");
- else if(IS_INTRA4x4(mb_type))
- av_log(s->avctx, AV_LOG_DEBUG, "i");
- else if(IS_INTRA16x16(mb_type))
- av_log(s->avctx, AV_LOG_DEBUG, "I");
- else if(IS_DIRECT(mb_type) && IS_SKIP(mb_type))
- av_log(s->avctx, AV_LOG_DEBUG, "d");
- else if(IS_DIRECT(mb_type))
- av_log(s->avctx, AV_LOG_DEBUG, "D");
- else if(IS_GMC(mb_type) && IS_SKIP(mb_type))
- av_log(s->avctx, AV_LOG_DEBUG, "g");
- else if(IS_GMC(mb_type))
- av_log(s->avctx, AV_LOG_DEBUG, "G");
- else if(IS_SKIP(mb_type))
- av_log(s->avctx, AV_LOG_DEBUG, "S");
- else if(!USES_LIST(mb_type, 1))
- av_log(s->avctx, AV_LOG_DEBUG, ">");
- else if(!USES_LIST(mb_type, 0))
- av_log(s->avctx, AV_LOG_DEBUG, "<");
- else{
- assert(USES_LIST(mb_type, 0) && USES_LIST(mb_type, 1));
- av_log(s->avctx, AV_LOG_DEBUG, "X");
- }
-
- //segmentation
- if(IS_8X8(mb_type))
- av_log(s->avctx, AV_LOG_DEBUG, "+");
- else if(IS_16X8(mb_type))
- av_log(s->avctx, AV_LOG_DEBUG, "-");
- else if(IS_8X16(mb_type))
- av_log(s->avctx, AV_LOG_DEBUG, "|");
- else if(IS_INTRA(mb_type) || IS_16X16(mb_type))
- av_log(s->avctx, AV_LOG_DEBUG, " ");
- else
- av_log(s->avctx, AV_LOG_DEBUG, "?");
-
-
- if(IS_INTERLACED(mb_type) && s->codec_id == CODEC_ID_H264)
- av_log(s->avctx, AV_LOG_DEBUG, "=");
- else
- av_log(s->avctx, AV_LOG_DEBUG, " ");
- }
-// av_log(s->avctx, AV_LOG_DEBUG, " ");
- }
- av_log(s->avctx, AV_LOG_DEBUG, "\n");
- }
- }
-
- if((s->avctx->debug&(FF_DEBUG_VIS_QP|FF_DEBUG_VIS_MB_TYPE)) || (s->avctx->debug_mv)){
- const int shift= 1 + s->quarter_sample;
- int mb_y;
- uint8_t *ptr;
- int i;
- int h_chroma_shift, v_chroma_shift;
- const int width = s->avctx->width;
- const int height= s->avctx->height;
- const int mv_sample_log2= 4 - pict->motion_subsample_log2;
- const int mv_stride= (s->mb_width << mv_sample_log2) + (s->codec_id == CODEC_ID_H264 ? 0 : 1);
- s->low_delay=0; //needed to see the vectors without trashing the buffers
-
- avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &h_chroma_shift, &v_chroma_shift);
- for(i=0; i<3; i++){
- memcpy(s->visualization_buffer[i], pict->data[i], (i==0) ? pict->linesize[i]*height:pict->linesize[i]*height >> v_chroma_shift);
- pict->data[i]= s->visualization_buffer[i];
- }
- pict->type= FF_BUFFER_TYPE_COPY;
- ptr= pict->data[0];
-
- for(mb_y=0; mb_y<s->mb_height; mb_y++){
- int mb_x;
- for(mb_x=0; mb_x<s->mb_width; mb_x++){
- const int mb_index= mb_x + mb_y*s->mb_stride;
- if((s->avctx->debug_mv) && pict->motion_val){
- int type;
- for(type=0; type<3; type++){
- int direction = 0;
- switch (type) {
- case 0: if ((!(s->avctx->debug_mv&FF_DEBUG_VIS_MV_P_FOR)) || (pict->pict_type!=FF_P_TYPE))
- continue;
- direction = 0;
- break;
- case 1: if ((!(s->avctx->debug_mv&FF_DEBUG_VIS_MV_B_FOR)) || (pict->pict_type!=FF_B_TYPE))
- continue;
- direction = 0;
- break;
- case 2: if ((!(s->avctx->debug_mv&FF_DEBUG_VIS_MV_B_BACK)) || (pict->pict_type!=FF_B_TYPE))
- continue;
- direction = 1;
- break;
- }
- if(!USES_LIST(pict->mb_type[mb_index], direction))
- continue;
-
- if(IS_8X8(pict->mb_type[mb_index])){
- int i;
- for(i=0; i<4; i++){
- int sx= mb_x*16 + 4 + 8*(i&1);
- int sy= mb_y*16 + 4 + 8*(i>>1);
- int xy= (mb_x*2 + (i&1) + (mb_y*2 + (i>>1))*mv_stride) << (mv_sample_log2-1);
- int mx= (pict->motion_val[direction][xy][0]>>shift) + sx;
- int my= (pict->motion_val[direction][xy][1]>>shift) + sy;
- draw_arrow(ptr, sx, sy, mx, my, width, height, s->linesize, 100);
- }
- }else if(IS_16X8(pict->mb_type[mb_index])){
- int i;
- for(i=0; i<2; i++){
- int sx=mb_x*16 + 8;
- int sy=mb_y*16 + 4 + 8*i;
- int xy= (mb_x*2 + (mb_y*2 + i)*mv_stride) << (mv_sample_log2-1);
- int mx=(pict->motion_val[direction][xy][0]>>shift);
- int my=(pict->motion_val[direction][xy][1]>>shift);
-
- if(IS_INTERLACED(pict->mb_type[mb_index]))
- my*=2;
-
- draw_arrow(ptr, sx, sy, mx+sx, my+sy, width, height, s->linesize, 100);
- }
- }else if(IS_8X16(pict->mb_type[mb_index])){
- int i;
- for(i=0; i<2; i++){
- int sx=mb_x*16 + 4 + 8*i;
- int sy=mb_y*16 + 8;
- int xy= (mb_x*2 + i + mb_y*2*mv_stride) << (mv_sample_log2-1);
- int mx=(pict->motion_val[direction][xy][0]>>shift);
- int my=(pict->motion_val[direction][xy][1]>>shift);
-
- if(IS_INTERLACED(pict->mb_type[mb_index]))
- my*=2;
-
- draw_arrow(ptr, sx, sy, mx+sx, my+sy, width, height, s->linesize, 100);
- }
- }else{
- int sx= mb_x*16 + 8;
- int sy= mb_y*16 + 8;
- int xy= (mb_x + mb_y*mv_stride) << mv_sample_log2;
- int mx= (pict->motion_val[direction][xy][0]>>shift) + sx;
- int my= (pict->motion_val[direction][xy][1]>>shift) + sy;
- draw_arrow(ptr, sx, sy, mx, my, width, height, s->linesize, 100);
- }
- }
- }
- if((s->avctx->debug&FF_DEBUG_VIS_QP) && pict->motion_val){
- uint64_t c= (pict->qscale_table[mb_index]*128/31) * 0x0101010101010101ULL;
- int y;
- for(y=0; y<8; y++){
- *(uint64_t*)(pict->data[1] + 8*mb_x + (8*mb_y + y)*pict->linesize[1])= c;
- *(uint64_t*)(pict->data[2] + 8*mb_x + (8*mb_y + y)*pict->linesize[2])= c;
- }
- }
- if((s->avctx->debug&FF_DEBUG_VIS_MB_TYPE) && pict->motion_val){
- int mb_type= pict->mb_type[mb_index];
- uint64_t u,v;
- int y;
-#define COLOR(theta, r)\
-u= (int)(128 + r*cos(theta*3.141592/180));\
-v= (int)(128 + r*sin(theta*3.141592/180));
-
-
- u=v=128;
- if(IS_PCM(mb_type)){
- COLOR(120,48)
- }else if((IS_INTRA(mb_type) && IS_ACPRED(mb_type)) || IS_INTRA16x16(mb_type)){
- COLOR(30,48)
- }else if(IS_INTRA4x4(mb_type)){
- COLOR(90,48)
- }else if(IS_DIRECT(mb_type) && IS_SKIP(mb_type)){
-// COLOR(120,48)
- }else if(IS_DIRECT(mb_type)){
- COLOR(150,48)
- }else if(IS_GMC(mb_type) && IS_SKIP(mb_type)){
- COLOR(170,48)
- }else if(IS_GMC(mb_type)){
- COLOR(190,48)
- }else if(IS_SKIP(mb_type)){
-// COLOR(180,48)
- }else if(!USES_LIST(mb_type, 1)){
- COLOR(240,48)
- }else if(!USES_LIST(mb_type, 0)){
- COLOR(0,48)
- }else{
- assert(USES_LIST(mb_type, 0) && USES_LIST(mb_type, 1));
- COLOR(300,48)
- }
-
- u*= 0x0101010101010101ULL;
- v*= 0x0101010101010101ULL;
- for(y=0; y<8; y++){
- *(uint64_t*)(pict->data[1] + 8*mb_x + (8*mb_y + y)*pict->linesize[1])= u;
- *(uint64_t*)(pict->data[2] + 8*mb_x + (8*mb_y + y)*pict->linesize[2])= v;
- }
-
- //segmentation
- if(IS_8X8(mb_type) || IS_16X8(mb_type)){
- *(uint64_t*)(pict->data[0] + 16*mb_x + 0 + (16*mb_y + 8)*pict->linesize[0])^= 0x8080808080808080ULL;
- *(uint64_t*)(pict->data[0] + 16*mb_x + 8 + (16*mb_y + 8)*pict->linesize[0])^= 0x8080808080808080ULL;
- }
- if(IS_8X8(mb_type) || IS_8X16(mb_type)){
- for(y=0; y<16; y++)
- pict->data[0][16*mb_x + 8 + (16*mb_y + y)*pict->linesize[0]]^= 0x80;
- }
- if(IS_8X8(mb_type) && mv_sample_log2 >= 2){
- int dm= 1 << (mv_sample_log2-2);
- for(i=0; i<4; i++){
- int sx= mb_x*16 + 8*(i&1);
- int sy= mb_y*16 + 8*(i>>1);
- int xy= (mb_x*2 + (i&1) + (mb_y*2 + (i>>1))*mv_stride) << (mv_sample_log2-1);
- //FIXME bidir
- int32_t *mv = (int32_t*)&pict->motion_val[0][xy];
- if(mv[0] != mv[dm] || mv[dm*mv_stride] != mv[dm*(mv_stride+1)])
- for(y=0; y<8; y++)
- pict->data[0][sx + 4 + (sy + y)*pict->linesize[0]]^= 0x80;
- if(mv[0] != mv[dm*mv_stride] || mv[dm] != mv[dm*(mv_stride+1)])
- *(uint64_t*)(pict->data[0] + sx + (sy + 4)*pict->linesize[0])^= 0x8080808080808080ULL;
- }
- }
-
- if(IS_INTERLACED(mb_type) && s->codec_id == CODEC_ID_H264){
- // hmm
- }
- }
- s->mbskip_table[mb_index]=0;
- }
- }
- }
-}
-
-#ifdef CONFIG_ENCODERS
-
-static int get_sae(uint8_t *src, int ref, int stride){
- int x,y;
- int acc=0;
-
- for(y=0; y<16; y++){
- for(x=0; x<16; x++){
- acc+= FFABS(src[x+y*stride] - ref);
- }
- }
-
- return acc;
-}
-
-static int get_intra_count(MpegEncContext *s, uint8_t *src, uint8_t *ref, int stride){
- int x, y, w, h;
- int acc=0;
-
- w= s->width &~15;
- h= s->height&~15;
-
- for(y=0; y<h; y+=16){
- for(x=0; x<w; x+=16){
- int offset= x + y*stride;
- int sad = s->dsp.sad[0](NULL, src + offset, ref + offset, stride, 16);
- int mean= (s->dsp.pix_sum(src + offset, stride) + 128)>>8;
- int sae = get_sae(src + offset, mean, stride);
-
- acc+= sae + 500 < sad;
- }
- }
- return acc;
-}
-
-
-static int load_input_picture(MpegEncContext *s, AVFrame *pic_arg){
- AVFrame *pic=NULL;
- int64_t pts;
- int i;
- const int encoding_delay= s->max_b_frames;
- int direct=1;
-
- if(pic_arg){
- pts= pic_arg->pts;
- pic_arg->display_picture_number= s->input_picture_number++;
-
- if(pts != AV_NOPTS_VALUE){
- if(s->user_specified_pts != AV_NOPTS_VALUE){
- int64_t time= pts;
- int64_t last= s->user_specified_pts;
-
- if(time <= last){
- av_log(s->avctx, AV_LOG_ERROR, "Error, Invalid timestamp=%"PRId64", last=%"PRId64"\n", pts, s->user_specified_pts);
- return -1;
- }
- }
- s->user_specified_pts= pts;
- }else{
- if(s->user_specified_pts != AV_NOPTS_VALUE){
- s->user_specified_pts=
- pts= s->user_specified_pts + 1;
- av_log(s->avctx, AV_LOG_INFO, "Warning: AVFrame.pts=? trying to guess (%"PRId64")\n", pts);
- }else{
- pts= pic_arg->display_picture_number;
- }
- }
- }
-
- if(pic_arg){
- if(encoding_delay && !(s->flags&CODEC_FLAG_INPUT_PRESERVED)) direct=0;
- if(pic_arg->linesize[0] != s->linesize) direct=0;
- if(pic_arg->linesize[1] != s->uvlinesize) direct=0;
- if(pic_arg->linesize[2] != s->uvlinesize) direct=0;
-
-// av_log(AV_LOG_DEBUG, "%d %d %d %d\n",pic_arg->linesize[0], pic_arg->linesize[1], s->linesize, s->uvlinesize);
-
- if(direct){
- i= ff_find_unused_picture(s, 1);
-
- pic= (AVFrame*)&s->picture[i];
- pic->reference= 3;
-
- for(i=0; i<4; i++){
- pic->data[i]= pic_arg->data[i];
- pic->linesize[i]= pic_arg->linesize[i];
- }
- alloc_picture(s, (Picture*)pic, 1);
- }else{
- i= ff_find_unused_picture(s, 0);
-
- pic= (AVFrame*)&s->picture[i];
- pic->reference= 3;
-
- alloc_picture(s, (Picture*)pic, 0);
-
- if( pic->data[0] + INPLACE_OFFSET == pic_arg->data[0]
- && pic->data[1] + INPLACE_OFFSET == pic_arg->data[1]
- && pic->data[2] + INPLACE_OFFSET == pic_arg->data[2]){
- // empty
- }else{
- int h_chroma_shift, v_chroma_shift;
- avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &h_chroma_shift, &v_chroma_shift);
-
- for(i=0; i<3; i++){
- int src_stride= pic_arg->linesize[i];
- int dst_stride= i ? s->uvlinesize : s->linesize;
- int h_shift= i ? h_chroma_shift : 0;
- int v_shift= i ? v_chroma_shift : 0;
- int w= s->width >>h_shift;
- int h= s->height>>v_shift;
- uint8_t *src= pic_arg->data[i];
- uint8_t *dst= pic->data[i];
-
- if(!s->avctx->rc_buffer_size)
- dst +=INPLACE_OFFSET;
-
- if(src_stride==dst_stride)
- memcpy(dst, src, src_stride*h);
- else{
- while(h--){
- memcpy(dst, src, w);
- dst += dst_stride;
- src += src_stride;
- }
- }
- }
- }
- }
- copy_picture_attributes(s, pic, pic_arg);
- pic->pts= pts; //we set this here to avoid modifiying pic_arg
- }
-
- /* shift buffer entries */
- for(i=1; i<MAX_PICTURE_COUNT /*s->encoding_delay+1*/; i++)
- s->input_picture[i-1]= s->input_picture[i];
-
- s->input_picture[encoding_delay]= (Picture*)pic;
-
- return 0;
-}
-
-static int skip_check(MpegEncContext *s, Picture *p, Picture *ref){
- int x, y, plane;
- int score=0;
- int64_t score64=0;
-
- for(plane=0; plane<3; plane++){
- const int stride= p->linesize[plane];
- const int bw= plane ? 1 : 2;
- for(y=0; y<s->mb_height*bw; y++){
- for(x=0; x<s->mb_width*bw; x++){
- int off= p->type == FF_BUFFER_TYPE_SHARED ? 0: 16;
- int v= s->dsp.frame_skip_cmp[1](s, p->data[plane] + 8*(x + y*stride)+off, ref->data[plane] + 8*(x + y*stride), stride, 8);
-
- switch(s->avctx->frame_skip_exp){
- case 0: score= FFMAX(score, v); break;
- case 1: score+= FFABS(v);break;
- case 2: score+= v*v;break;
- case 3: score64+= FFABS(v*v*(int64_t)v);break;
- case 4: score64+= v*v*(int64_t)(v*v);break;
- }
- }
- }
- }
-
- if(score) score64= score;
-
- if(score64 < s->avctx->frame_skip_threshold)
- return 1;
- if(score64 < ((s->avctx->frame_skip_factor * (int64_t)s->lambda)>>8))
- return 1;
- return 0;
-}
-
-static int estimate_best_b_count(MpegEncContext *s){
- AVCodec *codec= avcodec_find_encoder(s->avctx->codec_id);
- AVCodecContext *c= avcodec_alloc_context();
- AVFrame input[FF_MAX_B_FRAMES+2];
- const int scale= s->avctx->brd_scale;
- int i, j, out_size, p_lambda, b_lambda, lambda2;
- int outbuf_size= s->width * s->height; //FIXME
- uint8_t *outbuf= av_malloc(outbuf_size);
- int64_t best_rd= INT64_MAX;
- int best_b_count= -1;
-
- assert(scale>=0 && scale <=3);
-
-// emms_c();
- p_lambda= s->last_lambda_for[P_TYPE]; //s->next_picture_ptr->quality;
- b_lambda= s->last_lambda_for[B_TYPE]; //p_lambda *FFABS(s->avctx->b_quant_factor) + s->avctx->b_quant_offset;
- if(!b_lambda) b_lambda= p_lambda; //FIXME we should do this somewhere else
- lambda2= (b_lambda*b_lambda + (1<<FF_LAMBDA_SHIFT)/2 ) >> FF_LAMBDA_SHIFT;
-
- c->width = s->width >> scale;
- c->height= s->height>> scale;
- c->flags= CODEC_FLAG_QSCALE | CODEC_FLAG_PSNR | CODEC_FLAG_INPUT_PRESERVED /*| CODEC_FLAG_EMU_EDGE*/;
- c->flags|= s->avctx->flags & CODEC_FLAG_QPEL;
- c->mb_decision= s->avctx->mb_decision;
- c->me_cmp= s->avctx->me_cmp;
- c->mb_cmp= s->avctx->mb_cmp;
- c->me_sub_cmp= s->avctx->me_sub_cmp;
- c->pix_fmt = PIX_FMT_YUV420P;
- c->time_base= s->avctx->time_base;
- c->max_b_frames= s->max_b_frames;
-
- if (avcodec_open(c, codec) < 0)
- return -1;
-
- for(i=0; i<s->max_b_frames+2; i++){
- int ysize= c->width*c->height;
- int csize= (c->width/2)*(c->height/2);
- Picture pre_input, *pre_input_ptr= i ? s->input_picture[i-1] : s->next_picture_ptr;
-
- avcodec_get_frame_defaults(&input[i]);
- input[i].data[0]= av_malloc(ysize + 2*csize);
- input[i].data[1]= input[i].data[0] + ysize;
- input[i].data[2]= input[i].data[1] + csize;
- input[i].linesize[0]= c->width;
- input[i].linesize[1]=
- input[i].linesize[2]= c->width/2;
-
- if(pre_input_ptr && (!i || s->input_picture[i-1])) {
- pre_input= *pre_input_ptr;
-
- if(pre_input.type != FF_BUFFER_TYPE_SHARED && i) {
- pre_input.data[0]+=INPLACE_OFFSET;
- pre_input.data[1]+=INPLACE_OFFSET;
- pre_input.data[2]+=INPLACE_OFFSET;
- }
-
- s->dsp.shrink[scale](input[i].data[0], input[i].linesize[0], pre_input.data[0], pre_input.linesize[0], c->width, c->height);
- s->dsp.shrink[scale](input[i].data[1], input[i].linesize[1], pre_input.data[1], pre_input.linesize[1], c->width>>1, c->height>>1);
- s->dsp.shrink[scale](input[i].data[2], input[i].linesize[2], pre_input.data[2], pre_input.linesize[2], c->width>>1, c->height>>1);
- }
- }
-
- for(j=0; j<s->max_b_frames+1; j++){
- int64_t rd=0;
-
- if(!s->input_picture[j])
- break;
-
- c->error[0]= c->error[1]= c->error[2]= 0;
-
- input[0].pict_type= I_TYPE;
- input[0].quality= 1 * FF_QP2LAMBDA;
- out_size = avcodec_encode_video(c, outbuf, outbuf_size, &input[0]);
-// rd += (out_size * lambda2) >> FF_LAMBDA_SHIFT;
-
- for(i=0; i<s->max_b_frames+1; i++){
- int is_p= i % (j+1) == j || i==s->max_b_frames;
-
- input[i+1].pict_type= is_p ? P_TYPE : B_TYPE;
- input[i+1].quality= is_p ? p_lambda : b_lambda;
- out_size = avcodec_encode_video(c, outbuf, outbuf_size, &input[i+1]);
- rd += (out_size * lambda2) >> (FF_LAMBDA_SHIFT - 3);
- }
-
- /* get the delayed frames */
- while(out_size){
- out_size = avcodec_encode_video(c, outbuf, outbuf_size, NULL);
- rd += (out_size * lambda2) >> (FF_LAMBDA_SHIFT - 3);
- }
-
- rd += c->error[0] + c->error[1] + c->error[2];
-
- if(rd < best_rd){
- best_rd= rd;
- best_b_count= j;
- }
- }
-
- av_freep(&outbuf);
- avcodec_close(c);
- av_freep(&c);
-
- for(i=0; i<s->max_b_frames+2; i++){
- av_freep(&input[i].data[0]);
- }
-
- return best_b_count;
-}
-
-static void select_input_picture(MpegEncContext *s){
- int i;
-
- for(i=1; i<MAX_PICTURE_COUNT; i++)
- s->reordered_input_picture[i-1]= s->reordered_input_picture[i];
- s->reordered_input_picture[MAX_PICTURE_COUNT-1]= NULL;
-
- /* set next picture type & ordering */
- if(s->reordered_input_picture[0]==NULL && s->input_picture[0]){
- if(/*s->picture_in_gop_number >= s->gop_size ||*/ s->next_picture_ptr==NULL || s->intra_only){
- s->reordered_input_picture[0]= s->input_picture[0];
- s->reordered_input_picture[0]->pict_type= I_TYPE;
- s->reordered_input_picture[0]->coded_picture_number= s->coded_picture_number++;
- }else{
- int b_frames;
-
- if(s->avctx->frame_skip_threshold || s->avctx->frame_skip_factor){
- if(s->picture_in_gop_number < s->gop_size && skip_check(s, s->input_picture[0], s->next_picture_ptr)){
- //FIXME check that te gop check above is +-1 correct
-//av_log(NULL, AV_LOG_DEBUG, "skip %p %"PRId64"\n", s->input_picture[0]->data[0], s->input_picture[0]->pts);
-
- if(s->input_picture[0]->type == FF_BUFFER_TYPE_SHARED){
- for(i=0; i<4; i++)
- s->input_picture[0]->data[i]= NULL;
- s->input_picture[0]->type= 0;
- }else{
- assert( s->input_picture[0]->type==FF_BUFFER_TYPE_USER
- || s->input_picture[0]->type==FF_BUFFER_TYPE_INTERNAL);
-
- s->avctx->release_buffer(s->avctx, (AVFrame*)s->input_picture[0]);
- }
-
- emms_c();
- ff_vbv_update(s, 0);
-
- goto no_output_pic;
- }
- }
-
- if(s->flags&CODEC_FLAG_PASS2){
- for(i=0; i<s->max_b_frames+1; i++){
- int pict_num= s->input_picture[0]->display_picture_number + i;
-
- if(pict_num >= s->rc_context.num_entries)
- break;
- if(!s->input_picture[i]){
- s->rc_context.entry[pict_num-1].new_pict_type = P_TYPE;
- break;
- }
-
- s->input_picture[i]->pict_type=
- s->rc_context.entry[pict_num].new_pict_type;
- }
- }
-
- if(s->avctx->b_frame_strategy==0){
- b_frames= s->max_b_frames;
- while(b_frames && !s->input_picture[b_frames]) b_frames--;
- }else if(s->avctx->b_frame_strategy==1){
- for(i=1; i<s->max_b_frames+1; i++){
- if(s->input_picture[i] && s->input_picture[i]->b_frame_score==0){
- s->input_picture[i]->b_frame_score=
- get_intra_count(s, s->input_picture[i ]->data[0],
- s->input_picture[i-1]->data[0], s->linesize) + 1;
- }
- }
- for(i=0; i<s->max_b_frames+1; i++){
- if(s->input_picture[i]==NULL || s->input_picture[i]->b_frame_score - 1 > s->mb_num/s->avctx->b_sensitivity) break;
- }
-
- b_frames= FFMAX(0, i-1);
-
- /* reset scores */
- for(i=0; i<b_frames+1; i++){
- s->input_picture[i]->b_frame_score=0;
- }
- }else if(s->avctx->b_frame_strategy==2){
- b_frames= estimate_best_b_count(s);
- }else{
- av_log(s->avctx, AV_LOG_ERROR, "illegal b frame strategy\n");
- b_frames=0;
- }
-
- emms_c();
-//static int b_count=0;
-//b_count+= b_frames;
-//av_log(s->avctx, AV_LOG_DEBUG, "b_frames: %d\n", b_count);
-
- for(i= b_frames - 1; i>=0; i--){
- int type= s->input_picture[i]->pict_type;
- if(type && type != B_TYPE)
- b_frames= i;
- }
- if(s->input_picture[b_frames]->pict_type == B_TYPE && b_frames == s->max_b_frames){
- av_log(s->avctx, AV_LOG_ERROR, "warning, too many b frames in a row\n");
- }
-
- if(s->picture_in_gop_number + b_frames >= s->gop_size){
- if((s->flags2 & CODEC_FLAG2_STRICT_GOP) && s->gop_size > s->picture_in_gop_number){
- b_frames= s->gop_size - s->picture_in_gop_number - 1;
- }else{
- if(s->flags & CODEC_FLAG_CLOSED_GOP)
- b_frames=0;
- s->input_picture[b_frames]->pict_type= I_TYPE;
- }
- }
-
- if( (s->flags & CODEC_FLAG_CLOSED_GOP)
- && b_frames
- && s->input_picture[b_frames]->pict_type== I_TYPE)
- b_frames--;
-
- s->reordered_input_picture[0]= s->input_picture[b_frames];
- if(s->reordered_input_picture[0]->pict_type != I_TYPE)
- s->reordered_input_picture[0]->pict_type= P_TYPE;
- s->reordered_input_picture[0]->coded_picture_number= s->coded_picture_number++;
- for(i=0; i<b_frames; i++){
- s->reordered_input_picture[i+1]= s->input_picture[i];
- s->reordered_input_picture[i+1]->pict_type= B_TYPE;
- s->reordered_input_picture[i+1]->coded_picture_number= s->coded_picture_number++;
- }
- }
- }
-no_output_pic:
- if(s->reordered_input_picture[0]){
- s->reordered_input_picture[0]->reference= s->reordered_input_picture[0]->pict_type!=B_TYPE ? 3 : 0;
-
- copy_picture(&s->new_picture, s->reordered_input_picture[0]);
-
- if(s->reordered_input_picture[0]->type == FF_BUFFER_TYPE_SHARED || s->avctx->rc_buffer_size){
- // input is a shared pix, so we can't modifiy it -> alloc a new one & ensure that the shared one is reuseable
-
- int i= ff_find_unused_picture(s, 0);
- Picture *pic= &s->picture[i];
-
- pic->reference = s->reordered_input_picture[0]->reference;
- alloc_picture(s, pic, 0);
-
- /* mark us unused / free shared pic */
- if(s->reordered_input_picture[0]->type == FF_BUFFER_TYPE_INTERNAL)
- s->avctx->release_buffer(s->avctx, (AVFrame*)s->reordered_input_picture[0]);
- for(i=0; i<4; i++)
- s->reordered_input_picture[0]->data[i]= NULL;
- s->reordered_input_picture[0]->type= 0;
-
- copy_picture_attributes(s, (AVFrame*)pic, (AVFrame*)s->reordered_input_picture[0]);
-
- s->current_picture_ptr= pic;
- }else{
- // input is not a shared pix -> reuse buffer for current_pix
-
- assert( s->reordered_input_picture[0]->type==FF_BUFFER_TYPE_USER
- || s->reordered_input_picture[0]->type==FF_BUFFER_TYPE_INTERNAL);
-
- s->current_picture_ptr= s->reordered_input_picture[0];
- for(i=0; i<4; i++){
- s->new_picture.data[i]+= INPLACE_OFFSET;
- }
- }
- copy_picture(&s->current_picture, s->current_picture_ptr);
-
- s->picture_number= s->new_picture.display_picture_number;
-//printf("dpn:%d\n", s->picture_number);
- }else{
- memset(&s->new_picture, 0, sizeof(Picture));
- }
-}
-
-int MPV_encode_picture(AVCodecContext *avctx,
- unsigned char *buf, int buf_size, void *data)
-{
- MpegEncContext *s = avctx->priv_data;
- AVFrame *pic_arg = data;
- int i, stuffing_count;
-
- for(i=0; i<avctx->thread_count; i++){
- int start_y= s->thread_context[i]->start_mb_y;
- int end_y= s->thread_context[i]-> end_mb_y;
- int h= s->mb_height;
- uint8_t *start= buf + (size_t)(((int64_t) buf_size)*start_y/h);
- uint8_t *end = buf + (size_t)(((int64_t) buf_size)* end_y/h);
-
- init_put_bits(&s->thread_context[i]->pb, start, end - start);
- }
-
- s->picture_in_gop_number++;
-
- if(load_input_picture(s, pic_arg) < 0)
- return -1;
-
- select_input_picture(s);
-
- /* output? */
- if(s->new_picture.data[0]){
- s->pict_type= s->new_picture.pict_type;
-//emms_c();
-//printf("qs:%f %f %d\n", s->new_picture.quality, s->current_picture.quality, s->qscale);
- MPV_frame_start(s, avctx);
-vbv_retry:
- if (encode_picture(s, s->picture_number) < 0)
- return -1;
-
- avctx->real_pict_num = s->picture_number;
- avctx->header_bits = s->header_bits;
- avctx->mv_bits = s->mv_bits;
- avctx->misc_bits = s->misc_bits;
- avctx->i_tex_bits = s->i_tex_bits;
- avctx->p_tex_bits = s->p_tex_bits;
- avctx->i_count = s->i_count;
- avctx->p_count = s->mb_num - s->i_count - s->skip_count; //FIXME f/b_count in avctx
- avctx->skip_count = s->skip_count;
-
- MPV_frame_end(s);
-
-/* xine: do not need this for decode or MPEG-1 encoding modes */
-#if 0
- if (s->out_format == FMT_MJPEG)
- mjpeg_picture_trailer(s);
-#endif /* #if 0 */
-
- if(avctx->rc_buffer_size){
- RateControlContext *rcc= &s->rc_context;
- int max_size= rcc->buffer_index/3;
-
- if(put_bits_count(&s->pb) > max_size && s->lambda < s->avctx->lmax){
- s->next_lambda= FFMAX(s->lambda+1, s->lambda*(s->qscale+1) / s->qscale);
- if(s->adaptive_quant){
- int i;
- for(i=0; i<s->mb_height*s->mb_stride; i++)
- s->lambda_table[i]= FFMAX(s->lambda_table[i]+1, s->lambda_table[i]*(s->qscale+1) / s->qscale);
- }
- s->mb_skipped = 0; //done in MPV_frame_start()
- if(s->pict_type==P_TYPE){ //done in encode_picture() so we must undo it
- if(s->flipflop_rounding || s->codec_id == CODEC_ID_H263P || s->codec_id == CODEC_ID_MPEG4)
- s->no_rounding ^= 1;
- }
- if(s->pict_type!=B_TYPE){
- s->time_base= s->last_time_base;
- s->last_non_b_time= s->time - s->pp_time;
- }
-// av_log(NULL, AV_LOG_ERROR, "R:%d ", s->next_lambda);
- for(i=0; i<avctx->thread_count; i++){
- PutBitContext *pb= &s->thread_context[i]->pb;
- init_put_bits(pb, pb->buf, pb->buf_end - pb->buf);
- }
- goto vbv_retry;
- }
-
- assert(s->avctx->rc_max_rate);
- }
-
- if(s->flags&CODEC_FLAG_PASS1)
- ff_write_pass1_stats(s);
-
- for(i=0; i<4; i++){
- s->current_picture_ptr->error[i]= s->current_picture.error[i];
- avctx->error[i] += s->current_picture_ptr->error[i];
- }
-
- if(s->flags&CODEC_FLAG_PASS1)
- assert(avctx->header_bits + avctx->mv_bits + avctx->misc_bits + avctx->i_tex_bits + avctx->p_tex_bits == put_bits_count(&s->pb));
- flush_put_bits(&s->pb);
- s->frame_bits = put_bits_count(&s->pb);
-
- stuffing_count= ff_vbv_update(s, s->frame_bits);
- if(stuffing_count){
- if(s->pb.buf_end - s->pb.buf - (put_bits_count(&s->pb)>>3) < stuffing_count + 50){
- av_log(s->avctx, AV_LOG_ERROR, "stuffing too large\n");
- return -1;
- }
-
- switch(s->codec_id){
- case CODEC_ID_MPEG1VIDEO:
- case CODEC_ID_MPEG2VIDEO:
- while(stuffing_count--){
- put_bits(&s->pb, 8, 0);
- }
- break;
- case CODEC_ID_MPEG4:
- put_bits(&s->pb, 16, 0);
- put_bits(&s->pb, 16, 0x1C3);
- stuffing_count -= 4;
- while(stuffing_count--){
- put_bits(&s->pb, 8, 0xFF);
- }
- break;
- default:
- av_log(s->avctx, AV_LOG_ERROR, "vbv buffer overflow\n");
- }
- flush_put_bits(&s->pb);
- s->frame_bits = put_bits_count(&s->pb);
- }
-
- /* update mpeg1/2 vbv_delay for CBR */
- if(s->avctx->rc_max_rate && s->avctx->rc_min_rate == s->avctx->rc_max_rate && s->out_format == FMT_MPEG1
- && 90000LL * (avctx->rc_buffer_size-1) <= s->avctx->rc_max_rate*0xFFFFLL){
- int vbv_delay;
-
- assert(s->repeat_first_field==0);
-
- vbv_delay= lrintf(90000 * s->rc_context.buffer_index / s->avctx->rc_max_rate);
- assert(vbv_delay < 0xFFFF);
-
- s->vbv_delay_ptr[0] &= 0xF8;
- s->vbv_delay_ptr[0] |= vbv_delay>>13;
- s->vbv_delay_ptr[1] = vbv_delay>>5;
- s->vbv_delay_ptr[2] &= 0x07;
- s->vbv_delay_ptr[2] |= vbv_delay<<3;
- }
- s->total_bits += s->frame_bits;
- avctx->frame_bits = s->frame_bits;
- }else{
- assert((pbBufPtr(&s->pb) == s->pb.buf));
- s->frame_bits=0;
- }
- assert((s->frame_bits&7)==0);
-
- return s->frame_bits/8;
-}
-
-#endif //CONFIG_ENCODERS
-
-static inline void gmc1_motion(MpegEncContext *s,
- uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
- uint8_t **ref_picture)
-{
- uint8_t *ptr;
- int offset, src_x, src_y, linesize, uvlinesize;
- int motion_x, motion_y;
- int emu=0;
-
- motion_x= s->sprite_offset[0][0];
- motion_y= s->sprite_offset[0][1];
- src_x = s->mb_x * 16 + (motion_x >> (s->sprite_warping_accuracy+1));
- src_y = s->mb_y * 16 + (motion_y >> (s->sprite_warping_accuracy+1));
- motion_x<<=(3-s->sprite_warping_accuracy);
- motion_y<<=(3-s->sprite_warping_accuracy);
- src_x = clip(src_x, -16, s->width);
- if (src_x == s->width)
- motion_x =0;
- src_y = clip(src_y, -16, s->height);
- if (src_y == s->height)
- motion_y =0;
-
- linesize = s->linesize;
- uvlinesize = s->uvlinesize;
-
- ptr = ref_picture[0] + (src_y * linesize) + src_x;
-
- if(s->flags&CODEC_FLAG_EMU_EDGE){
- if( (unsigned)src_x >= s->h_edge_pos - 17
- || (unsigned)src_y >= s->v_edge_pos - 17){
- ff_emulated_edge_mc(s->edge_emu_buffer, ptr, linesize, 17, 17, src_x, src_y, s->h_edge_pos, s->v_edge_pos);
- ptr= s->edge_emu_buffer;
- }
- }
-
- if((motion_x|motion_y)&7){
- s->dsp.gmc1(dest_y , ptr , linesize, 16, motion_x&15, motion_y&15, 128 - s->no_rounding);
- s->dsp.gmc1(dest_y+8, ptr+8, linesize, 16, motion_x&15, motion_y&15, 128 - s->no_rounding);
- }else{
- int dxy;
-
- dxy= ((motion_x>>3)&1) | ((motion_y>>2)&2);
- if (s->no_rounding){
- s->dsp.put_no_rnd_pixels_tab[0][dxy](dest_y, ptr, linesize, 16);
- }else{
- s->dsp.put_pixels_tab [0][dxy](dest_y, ptr, linesize, 16);
- }
- }
-
- if(s->flags&CODEC_FLAG_GRAY) return;
-
- motion_x= s->sprite_offset[1][0];
- motion_y= s->sprite_offset[1][1];
- src_x = s->mb_x * 8 + (motion_x >> (s->sprite_warping_accuracy+1));
- src_y = s->mb_y * 8 + (motion_y >> (s->sprite_warping_accuracy+1));
- motion_x<<=(3-s->sprite_warping_accuracy);
- motion_y<<=(3-s->sprite_warping_accuracy);
- src_x = clip(src_x, -8, s->width>>1);
- if (src_x == s->width>>1)
- motion_x =0;
- src_y = clip(src_y, -8, s->height>>1);
- if (src_y == s->height>>1)
- motion_y =0;
-
- offset = (src_y * uvlinesize) + src_x;
- ptr = ref_picture[1] + offset;
- if(s->flags&CODEC_FLAG_EMU_EDGE){
- if( (unsigned)src_x >= (s->h_edge_pos>>1) - 9
- || (unsigned)src_y >= (s->v_edge_pos>>1) - 9){
- ff_emulated_edge_mc(s->edge_emu_buffer, ptr, uvlinesize, 9, 9, src_x, src_y, s->h_edge_pos>>1, s->v_edge_pos>>1);
- ptr= s->edge_emu_buffer;
- emu=1;
- }
- }
- s->dsp.gmc1(dest_cb, ptr, uvlinesize, 8, motion_x&15, motion_y&15, 128 - s->no_rounding);
-
- ptr = ref_picture[2] + offset;
- if(emu){
- ff_emulated_edge_mc(s->edge_emu_buffer, ptr, uvlinesize, 9, 9, src_x, src_y, s->h_edge_pos>>1, s->v_edge_pos>>1);
- ptr= s->edge_emu_buffer;
- }
- s->dsp.gmc1(dest_cr, ptr, uvlinesize, 8, motion_x&15, motion_y&15, 128 - s->no_rounding);
-
- return;
-}
-
-static inline void gmc_motion(MpegEncContext *s,
- uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
- uint8_t **ref_picture)
-{
- uint8_t *ptr;
- int linesize, uvlinesize;
- const int a= s->sprite_warping_accuracy;
- int ox, oy;
-
- linesize = s->linesize;
- uvlinesize = s->uvlinesize;
-
- ptr = ref_picture[0];
-
- ox= s->sprite_offset[0][0] + s->sprite_delta[0][0]*s->mb_x*16 + s->sprite_delta[0][1]*s->mb_y*16;
- oy= s->sprite_offset[0][1] + s->sprite_delta[1][0]*s->mb_x*16 + s->sprite_delta[1][1]*s->mb_y*16;
-
- s->dsp.gmc(dest_y, ptr, linesize, 16,
- ox,
- oy,
- s->sprite_delta[0][0], s->sprite_delta[0][1],
- s->sprite_delta[1][0], s->sprite_delta[1][1],
- a+1, (1<<(2*a+1)) - s->no_rounding,
- s->h_edge_pos, s->v_edge_pos);
- s->dsp.gmc(dest_y+8, ptr, linesize, 16,
- ox + s->sprite_delta[0][0]*8,
- oy + s->sprite_delta[1][0]*8,
- s->sprite_delta[0][0], s->sprite_delta[0][1],
- s->sprite_delta[1][0], s->sprite_delta[1][1],
- a+1, (1<<(2*a+1)) - s->no_rounding,
- s->h_edge_pos, s->v_edge_pos);
-
- if(s->flags&CODEC_FLAG_GRAY) return;
-
- ox= s->sprite_offset[1][0] + s->sprite_delta[0][0]*s->mb_x*8 + s->sprite_delta[0][1]*s->mb_y*8;
- oy= s->sprite_offset[1][1] + s->sprite_delta[1][0]*s->mb_x*8 + s->sprite_delta[1][1]*s->mb_y*8;
-
- ptr = ref_picture[1];
- s->dsp.gmc(dest_cb, ptr, uvlinesize, 8,
- ox,
- oy,
- s->sprite_delta[0][0], s->sprite_delta[0][1],
- s->sprite_delta[1][0], s->sprite_delta[1][1],
- a+1, (1<<(2*a+1)) - s->no_rounding,
- s->h_edge_pos>>1, s->v_edge_pos>>1);
-
- ptr = ref_picture[2];
- s->dsp.gmc(dest_cr, ptr, uvlinesize, 8,
- ox,
- oy,
- s->sprite_delta[0][0], s->sprite_delta[0][1],
- s->sprite_delta[1][0], s->sprite_delta[1][1],
- a+1, (1<<(2*a+1)) - s->no_rounding,
- s->h_edge_pos>>1, s->v_edge_pos>>1);
-}
-
-/**
- * Copies a rectangular area of samples to a temporary buffer and replicates the boarder samples.
- * @param buf destination buffer
- * @param src source buffer
- * @param linesize number of bytes between 2 vertically adjacent samples in both the source and destination buffers
- * @param block_w width of block
- * @param block_h height of block
- * @param src_x x coordinate of the top left sample of the block in the source buffer
- * @param src_y y coordinate of the top left sample of the block in the source buffer
- * @param w width of the source buffer
- * @param h height of the source buffer
- */
-void ff_emulated_edge_mc(uint8_t *buf, uint8_t *src, int linesize, int block_w, int block_h,
- int src_x, int src_y, int w, int h){
- int x, y;
- int start_y, start_x, end_y, end_x;
-
- if(src_y>= h){
- src+= (h-1-src_y)*linesize;
- src_y=h-1;
- }else if(src_y<=-block_h){
- src+= (1-block_h-src_y)*linesize;
- src_y=1-block_h;
- }
- if(src_x>= w){
- src+= (w-1-src_x);
- src_x=w-1;
- }else if(src_x<=-block_w){
- src+= (1-block_w-src_x);
- src_x=1-block_w;
- }
-
- start_y= FFMAX(0, -src_y);
- start_x= FFMAX(0, -src_x);
- end_y= FFMIN(block_h, h-src_y);
- end_x= FFMIN(block_w, w-src_x);
-
- // copy existing part
- for(y=start_y; y<end_y; y++){
- for(x=start_x; x<end_x; x++){
- buf[x + y*linesize]= src[x + y*linesize];
- }
- }
-
- //top
- for(y=0; y<start_y; y++){
- for(x=start_x; x<end_x; x++){
- buf[x + y*linesize]= buf[x + start_y*linesize];
- }
- }
-
- //bottom
- for(y=end_y; y<block_h; y++){
- for(x=start_x; x<end_x; x++){
- buf[x + y*linesize]= buf[x + (end_y-1)*linesize];
- }
- }
-
- for(y=0; y<block_h; y++){
- //left
- for(x=0; x<start_x; x++){
- buf[x + y*linesize]= buf[start_x + y*linesize];
- }
-
- //right
- for(x=end_x; x<block_w; x++){
- buf[x + y*linesize]= buf[end_x - 1 + y*linesize];
- }
- }
-}
-
-static inline int hpel_motion(MpegEncContext *s,
- uint8_t *dest, uint8_t *src,
- int field_based, int field_select,
- int src_x, int src_y,
- int width, int height, int stride,
- int h_edge_pos, int v_edge_pos,
- int w, int h, op_pixels_func *pix_op,
- int motion_x, int motion_y)
-{
- int dxy;
- int emu=0;
-
- dxy = ((motion_y & 1) << 1) | (motion_x & 1);
- src_x += motion_x >> 1;
- src_y += motion_y >> 1;
-
- /* WARNING: do no forget half pels */
- src_x = clip(src_x, -16, width); //FIXME unneeded for emu?
- if (src_x == width)
- dxy &= ~1;
- src_y = clip(src_y, -16, height);
- if (src_y == height)
- dxy &= ~2;
- src += src_y * stride + src_x;
-
- if(s->unrestricted_mv && (s->flags&CODEC_FLAG_EMU_EDGE)){
- if( (unsigned)src_x > h_edge_pos - (motion_x&1) - w
- || (unsigned)src_y > v_edge_pos - (motion_y&1) - h){
- ff_emulated_edge_mc(s->edge_emu_buffer, src, s->linesize, w+1, (h+1)<<field_based,
- src_x, src_y<<field_based, h_edge_pos, s->v_edge_pos);
- src= s->edge_emu_buffer;
- emu=1;
- }
- }
- if(field_select)
- src += s->linesize;
- pix_op[dxy](dest, src, stride, h);
- return emu;
-}
-
-static inline int hpel_motion_lowres(MpegEncContext *s,
- uint8_t *dest, uint8_t *src,
- int field_based, int field_select,
- int src_x, int src_y,
- int width, int height, int stride,
- int h_edge_pos, int v_edge_pos,
- int w, int h, h264_chroma_mc_func *pix_op,
- int motion_x, int motion_y)
-{
- const int lowres= s->avctx->lowres;
- const int s_mask= (2<<lowres)-1;
- int emu=0;
- int sx, sy;
-
- if(s->quarter_sample){
- motion_x/=2;
- motion_y/=2;
- }
-
- sx= motion_x & s_mask;
- sy= motion_y & s_mask;
- src_x += motion_x >> (lowres+1);
- src_y += motion_y >> (lowres+1);
-
- src += src_y * stride + src_x;
-
- if( (unsigned)src_x > h_edge_pos - (!!sx) - w
- || (unsigned)src_y >(v_edge_pos >> field_based) - (!!sy) - h){
- ff_emulated_edge_mc(s->edge_emu_buffer, src, s->linesize, w+1, (h+1)<<field_based,
- src_x, src_y<<field_based, h_edge_pos, v_edge_pos);
- src= s->edge_emu_buffer;
- emu=1;
- }
-
- sx <<= 2 - lowres;
- sy <<= 2 - lowres;
- if(field_select)
- src += s->linesize;
- pix_op[lowres](dest, src, stride, h, sx, sy);
- return emu;
-}
-
-/* apply one mpeg motion vector to the three components */
-static av_always_inline void mpeg_motion(MpegEncContext *s,
- uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
- int field_based, int bottom_field, int field_select,
- uint8_t **ref_picture, op_pixels_func (*pix_op)[4],
- int motion_x, int motion_y, int h)
-{
- uint8_t *ptr_y, *ptr_cb, *ptr_cr;
- int dxy, uvdxy, mx, my, src_x, src_y, uvsrc_x, uvsrc_y, v_edge_pos, uvlinesize, linesize;
-
-#if 0
-if(s->quarter_sample)
-{
- motion_x>>=1;
- motion_y>>=1;
-}
-#endif
-
- v_edge_pos = s->v_edge_pos >> field_based;
- linesize = s->current_picture.linesize[0] << field_based;
- uvlinesize = s->current_picture.linesize[1] << field_based;
-
- dxy = ((motion_y & 1) << 1) | (motion_x & 1);
- src_x = s->mb_x* 16 + (motion_x >> 1);
- src_y =(s->mb_y<<(4-field_based)) + (motion_y >> 1);
-
- if (s->out_format == FMT_H263) {
- if((s->workaround_bugs & FF_BUG_HPEL_CHROMA) && field_based){
- mx = (motion_x>>1)|(motion_x&1);
- my = motion_y >>1;
- uvdxy = ((my & 1) << 1) | (mx & 1);
- uvsrc_x = s->mb_x* 8 + (mx >> 1);
- uvsrc_y = (s->mb_y<<(3-field_based)) + (my >> 1);
- }else{
- uvdxy = dxy | (motion_y & 2) | ((motion_x & 2) >> 1);
- uvsrc_x = src_x>>1;
- uvsrc_y = src_y>>1;
- }
- }else if(s->out_format == FMT_H261){//even chroma mv's are full pel in H261
- mx = motion_x / 4;
- my = motion_y / 4;
- uvdxy = 0;
- uvsrc_x = s->mb_x*8 + mx;
- uvsrc_y = s->mb_y*8 + my;
- } else {
- if(s->chroma_y_shift){
- mx = motion_x / 2;
- my = motion_y / 2;
- uvdxy = ((my & 1) << 1) | (mx & 1);
- uvsrc_x = s->mb_x* 8 + (mx >> 1);
- uvsrc_y = (s->mb_y<<(3-field_based)) + (my >> 1);
- } else {
- if(s->chroma_x_shift){
- //Chroma422
- mx = motion_x / 2;
- uvdxy = ((motion_y & 1) << 1) | (mx & 1);
- uvsrc_x = s->mb_x* 8 + (mx >> 1);
- uvsrc_y = src_y;
- } else {
- //Chroma444
- uvdxy = dxy;
- uvsrc_x = src_x;
- uvsrc_y = src_y;
- }
- }
- }
-
- ptr_y = ref_picture[0] + src_y * linesize + src_x;
- ptr_cb = ref_picture[1] + uvsrc_y * uvlinesize + uvsrc_x;
- ptr_cr = ref_picture[2] + uvsrc_y * uvlinesize + uvsrc_x;
-
- if( (unsigned)src_x > s->h_edge_pos - (motion_x&1) - 16
- || (unsigned)src_y > v_edge_pos - (motion_y&1) - h){
- if(s->codec_id == CODEC_ID_MPEG2VIDEO ||
- s->codec_id == CODEC_ID_MPEG1VIDEO){
- av_log(s->avctx,AV_LOG_DEBUG,"MPEG motion vector out of boundary\n");
- return ;
- }
- ff_emulated_edge_mc(s->edge_emu_buffer, ptr_y, s->linesize, 17, 17+field_based,
- src_x, src_y<<field_based, s->h_edge_pos, s->v_edge_pos);
- ptr_y = s->edge_emu_buffer;
- if(!(s->flags&CODEC_FLAG_GRAY)){
- uint8_t *uvbuf= s->edge_emu_buffer+18*s->linesize;
- ff_emulated_edge_mc(uvbuf , ptr_cb, s->uvlinesize, 9, 9+field_based,
- uvsrc_x, uvsrc_y<<field_based, s->h_edge_pos>>1, s->v_edge_pos>>1);
- ff_emulated_edge_mc(uvbuf+16, ptr_cr, s->uvlinesize, 9, 9+field_based,
- uvsrc_x, uvsrc_y<<field_based, s->h_edge_pos>>1, s->v_edge_pos>>1);
- ptr_cb= uvbuf;
- ptr_cr= uvbuf+16;
- }
- }
-
- if(bottom_field){ //FIXME use this for field pix too instead of the obnoxious hack which changes picture.data
- dest_y += s->linesize;
- dest_cb+= s->uvlinesize;
- dest_cr+= s->uvlinesize;
- }
-
- if(field_select){
- ptr_y += s->linesize;
- ptr_cb+= s->uvlinesize;
- ptr_cr+= s->uvlinesize;
- }
-
- pix_op[0][dxy](dest_y, ptr_y, linesize, h);
-
- if(!(s->flags&CODEC_FLAG_GRAY)){
- pix_op[s->chroma_x_shift][uvdxy](dest_cb, ptr_cb, uvlinesize, h >> s->chroma_y_shift);
- pix_op[s->chroma_x_shift][uvdxy](dest_cr, ptr_cr, uvlinesize, h >> s->chroma_y_shift);
- }
-#if defined(CONFIG_H261_ENCODER) || defined(CONFIG_H261_DECODER)
- if(s->out_format == FMT_H261){
- ff_h261_loop_filter(s);
- }
-#endif
-}
-
-/* apply one mpeg motion vector to the three components */
-static av_always_inline void mpeg_motion_lowres(MpegEncContext *s,
- uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
- int field_based, int bottom_field, int field_select,
- uint8_t **ref_picture, h264_chroma_mc_func *pix_op,
- int motion_x, int motion_y, int h)
-{
- uint8_t *ptr_y, *ptr_cb, *ptr_cr;
- int mx, my, src_x, src_y, uvsrc_x, uvsrc_y, uvlinesize, linesize, sx, sy, uvsx, uvsy;
- const int lowres= s->avctx->lowres;
- const int block_s= 8>>lowres;
- const int s_mask= (2<<lowres)-1;
- const int h_edge_pos = s->h_edge_pos >> lowres;
- const int v_edge_pos = s->v_edge_pos >> lowres;
- linesize = s->current_picture.linesize[0] << field_based;
- uvlinesize = s->current_picture.linesize[1] << field_based;
-
- if(s->quarter_sample){ //FIXME obviously not perfect but qpel wont work in lowres anyway
- motion_x/=2;
- motion_y/=2;
- }
-
- if(field_based){
- motion_y += (bottom_field - field_select)*((1<<lowres)-1);
- }
-
- sx= motion_x & s_mask;
- sy= motion_y & s_mask;
- src_x = s->mb_x*2*block_s + (motion_x >> (lowres+1));
- src_y =(s->mb_y*2*block_s>>field_based) + (motion_y >> (lowres+1));
-
- if (s->out_format == FMT_H263) {
- uvsx = ((motion_x>>1) & s_mask) | (sx&1);
- uvsy = ((motion_y>>1) & s_mask) | (sy&1);
- uvsrc_x = src_x>>1;
- uvsrc_y = src_y>>1;
- }else if(s->out_format == FMT_H261){//even chroma mv's are full pel in H261
- mx = motion_x / 4;
- my = motion_y / 4;
- uvsx = (2*mx) & s_mask;
- uvsy = (2*my) & s_mask;
- uvsrc_x = s->mb_x*block_s + (mx >> lowres);
- uvsrc_y = s->mb_y*block_s + (my >> lowres);
- } else {
- mx = motion_x / 2;
- my = motion_y / 2;
- uvsx = mx & s_mask;
- uvsy = my & s_mask;
- uvsrc_x = s->mb_x*block_s + (mx >> (lowres+1));
- uvsrc_y =(s->mb_y*block_s>>field_based) + (my >> (lowres+1));
- }
-
- ptr_y = ref_picture[0] + src_y * linesize + src_x;
- ptr_cb = ref_picture[1] + uvsrc_y * uvlinesize + uvsrc_x;
- ptr_cr = ref_picture[2] + uvsrc_y * uvlinesize + uvsrc_x;
-
- if( (unsigned)src_x > h_edge_pos - (!!sx) - 2*block_s
- || (unsigned)src_y >(v_edge_pos >> field_based) - (!!sy) - h){
- ff_emulated_edge_mc(s->edge_emu_buffer, ptr_y, s->linesize, 17, 17+field_based,
- src_x, src_y<<field_based, h_edge_pos, v_edge_pos);
- ptr_y = s->edge_emu_buffer;
- if(!(s->flags&CODEC_FLAG_GRAY)){
- uint8_t *uvbuf= s->edge_emu_buffer+18*s->linesize;
- ff_emulated_edge_mc(uvbuf , ptr_cb, s->uvlinesize, 9, 9+field_based,
- uvsrc_x, uvsrc_y<<field_based, h_edge_pos>>1, v_edge_pos>>1);
- ff_emulated_edge_mc(uvbuf+16, ptr_cr, s->uvlinesize, 9, 9+field_based,
- uvsrc_x, uvsrc_y<<field_based, h_edge_pos>>1, v_edge_pos>>1);
- ptr_cb= uvbuf;
- ptr_cr= uvbuf+16;
- }
- }
-
- if(bottom_field){ //FIXME use this for field pix too instead of the obnoxious hack which changes picture.data
- dest_y += s->linesize;
- dest_cb+= s->uvlinesize;
- dest_cr+= s->uvlinesize;
- }
-
- if(field_select){
- ptr_y += s->linesize;
- ptr_cb+= s->uvlinesize;
- ptr_cr+= s->uvlinesize;
- }
-
- sx <<= 2 - lowres;
- sy <<= 2 - lowres;
- pix_op[lowres-1](dest_y, ptr_y, linesize, h, sx, sy);
-
- if(!(s->flags&CODEC_FLAG_GRAY)){
- uvsx <<= 2 - lowres;
- uvsy <<= 2 - lowres;
- pix_op[lowres](dest_cb, ptr_cb, uvlinesize, h >> s->chroma_y_shift, uvsx, uvsy);
- pix_op[lowres](dest_cr, ptr_cr, uvlinesize, h >> s->chroma_y_shift, uvsx, uvsy);
- }
- //FIXME h261 lowres loop filter
-}
-
-//FIXME move to dsputil, avg variant, 16x16 version
-static inline void put_obmc(uint8_t *dst, uint8_t *src[5], int stride){
- int x;
- uint8_t * const top = src[1];
- uint8_t * const left = src[2];
- uint8_t * const mid = src[0];
- uint8_t * const right = src[3];
- uint8_t * const bottom= src[4];
-#define OBMC_FILTER(x, t, l, m, r, b)\
- dst[x]= (t*top[x] + l*left[x] + m*mid[x] + r*right[x] + b*bottom[x] + 4)>>3
-#define OBMC_FILTER4(x, t, l, m, r, b)\
- OBMC_FILTER(x , t, l, m, r, b);\
- OBMC_FILTER(x+1 , t, l, m, r, b);\
- OBMC_FILTER(x +stride, t, l, m, r, b);\
- OBMC_FILTER(x+1+stride, t, l, m, r, b);
-
- x=0;
- OBMC_FILTER (x , 2, 2, 4, 0, 0);
- OBMC_FILTER (x+1, 2, 1, 5, 0, 0);
- OBMC_FILTER4(x+2, 2, 1, 5, 0, 0);
- OBMC_FILTER4(x+4, 2, 0, 5, 1, 0);
- OBMC_FILTER (x+6, 2, 0, 5, 1, 0);
- OBMC_FILTER (x+7, 2, 0, 4, 2, 0);
- x+= stride;
- OBMC_FILTER (x , 1, 2, 5, 0, 0);
- OBMC_FILTER (x+1, 1, 2, 5, 0, 0);
- OBMC_FILTER (x+6, 1, 0, 5, 2, 0);
- OBMC_FILTER (x+7, 1, 0, 5, 2, 0);
- x+= stride;
- OBMC_FILTER4(x , 1, 2, 5, 0, 0);
- OBMC_FILTER4(x+2, 1, 1, 6, 0, 0);
- OBMC_FILTER4(x+4, 1, 0, 6, 1, 0);
- OBMC_FILTER4(x+6, 1, 0, 5, 2, 0);
- x+= 2*stride;
- OBMC_FILTER4(x , 0, 2, 5, 0, 1);
- OBMC_FILTER4(x+2, 0, 1, 6, 0, 1);
- OBMC_FILTER4(x+4, 0, 0, 6, 1, 1);
- OBMC_FILTER4(x+6, 0, 0, 5, 2, 1);
- x+= 2*stride;
- OBMC_FILTER (x , 0, 2, 5, 0, 1);
- OBMC_FILTER (x+1, 0, 2, 5, 0, 1);
- OBMC_FILTER4(x+2, 0, 1, 5, 0, 2);
- OBMC_FILTER4(x+4, 0, 0, 5, 1, 2);
- OBMC_FILTER (x+6, 0, 0, 5, 2, 1);
- OBMC_FILTER (x+7, 0, 0, 5, 2, 1);
- x+= stride;
- OBMC_FILTER (x , 0, 2, 4, 0, 2);
- OBMC_FILTER (x+1, 0, 1, 5, 0, 2);
- OBMC_FILTER (x+6, 0, 0, 5, 1, 2);
- OBMC_FILTER (x+7, 0, 0, 4, 2, 2);
-}
-
-/* obmc for 1 8x8 luma block */
-static inline void obmc_motion(MpegEncContext *s,
- uint8_t *dest, uint8_t *src,
- int src_x, int src_y,
- op_pixels_func *pix_op,
- int16_t mv[5][2]/* mid top left right bottom*/)
-#define MID 0
-{
- int i;
- uint8_t *ptr[5];
-
- assert(s->quarter_sample==0);
-
- for(i=0; i<5; i++){
- if(i && mv[i][0]==mv[MID][0] && mv[i][1]==mv[MID][1]){
- ptr[i]= ptr[MID];
- }else{
- ptr[i]= s->obmc_scratchpad + 8*(i&1) + s->linesize*8*(i>>1);
- hpel_motion(s, ptr[i], src, 0, 0,
- src_x, src_y,
- s->width, s->height, s->linesize,
- s->h_edge_pos, s->v_edge_pos,
- 8, 8, pix_op,
- mv[i][0], mv[i][1]);
- }
- }
-
- put_obmc(dest, ptr, s->linesize);
-}
-
-static inline void qpel_motion(MpegEncContext *s,
- uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
- int field_based, int bottom_field, int field_select,
- uint8_t **ref_picture, op_pixels_func (*pix_op)[4],
- qpel_mc_func (*qpix_op)[16],
- int motion_x, int motion_y, int h)
-{
- uint8_t *ptr_y, *ptr_cb, *ptr_cr;
- int dxy, uvdxy, mx, my, src_x, src_y, uvsrc_x, uvsrc_y, v_edge_pos, linesize, uvlinesize;
-
- dxy = ((motion_y & 3) << 2) | (motion_x & 3);
- src_x = s->mb_x * 16 + (motion_x >> 2);
- src_y = s->mb_y * (16 >> field_based) + (motion_y >> 2);
-
- v_edge_pos = s->v_edge_pos >> field_based;
- linesize = s->linesize << field_based;
- uvlinesize = s->uvlinesize << field_based;
-
- if(field_based){
- mx= motion_x/2;
- my= motion_y>>1;
- }else if(s->workaround_bugs&FF_BUG_QPEL_CHROMA2){
- static const int rtab[8]= {0,0,1,1,0,0,0,1};
- mx= (motion_x>>1) + rtab[motion_x&7];
- my= (motion_y>>1) + rtab[motion_y&7];
- }else if(s->workaround_bugs&FF_BUG_QPEL_CHROMA){
- mx= (motion_x>>1)|(motion_x&1);
- my= (motion_y>>1)|(motion_y&1);
- }else{
- mx= motion_x/2;
- my= motion_y/2;
- }
- mx= (mx>>1)|(mx&1);
- my= (my>>1)|(my&1);
-
- uvdxy= (mx&1) | ((my&1)<<1);
- mx>>=1;
- my>>=1;
-
- uvsrc_x = s->mb_x * 8 + mx;
- uvsrc_y = s->mb_y * (8 >> field_based) + my;
-
- ptr_y = ref_picture[0] + src_y * linesize + src_x;
- ptr_cb = ref_picture[1] + uvsrc_y * uvlinesize + uvsrc_x;
- ptr_cr = ref_picture[2] + uvsrc_y * uvlinesize + uvsrc_x;
-
- if( (unsigned)src_x > s->h_edge_pos - (motion_x&3) - 16
- || (unsigned)src_y > v_edge_pos - (motion_y&3) - h ){
- ff_emulated_edge_mc(s->edge_emu_buffer, ptr_y, s->linesize, 17, 17+field_based,
- src_x, src_y<<field_based, s->h_edge_pos, s->v_edge_pos);
- ptr_y= s->edge_emu_buffer;
- if(!(s->flags&CODEC_FLAG_GRAY)){
- uint8_t *uvbuf= s->edge_emu_buffer + 18*s->linesize;
- ff_emulated_edge_mc(uvbuf, ptr_cb, s->uvlinesize, 9, 9 + field_based,
- uvsrc_x, uvsrc_y<<field_based, s->h_edge_pos>>1, s->v_edge_pos>>1);
- ff_emulated_edge_mc(uvbuf + 16, ptr_cr, s->uvlinesize, 9, 9 + field_based,
- uvsrc_x, uvsrc_y<<field_based, s->h_edge_pos>>1, s->v_edge_pos>>1);
- ptr_cb= uvbuf;
- ptr_cr= uvbuf + 16;
- }
- }
-
- if(!field_based)
- qpix_op[0][dxy](dest_y, ptr_y, linesize);
- else{
- if(bottom_field){
- dest_y += s->linesize;
- dest_cb+= s->uvlinesize;
- dest_cr+= s->uvlinesize;
- }
-
- if(field_select){
- ptr_y += s->linesize;
- ptr_cb += s->uvlinesize;
- ptr_cr += s->uvlinesize;
- }
- //damn interlaced mode
- //FIXME boundary mirroring is not exactly correct here
- qpix_op[1][dxy](dest_y , ptr_y , linesize);
- qpix_op[1][dxy](dest_y+8, ptr_y+8, linesize);
- }
- if(!(s->flags&CODEC_FLAG_GRAY)){
- pix_op[1][uvdxy](dest_cr, ptr_cr, uvlinesize, h >> 1);
- pix_op[1][uvdxy](dest_cb, ptr_cb, uvlinesize, h >> 1);
- }
-}
-
-inline int ff_h263_round_chroma(int x){
- if (x >= 0)
- return (h263_chroma_roundtab[x & 0xf] + ((x >> 3) & ~1));
- else {
- x = -x;
- return -(h263_chroma_roundtab[x & 0xf] + ((x >> 3) & ~1));
- }
-}
-
-/**
- * h263 chorma 4mv motion compensation.
- */
-static inline void chroma_4mv_motion(MpegEncContext *s,
- uint8_t *dest_cb, uint8_t *dest_cr,
- uint8_t **ref_picture,
- op_pixels_func *pix_op,
- int mx, int my){
- int dxy, emu=0, src_x, src_y, offset;
- uint8_t *ptr;
-
- /* In case of 8X8, we construct a single chroma motion vector
- with a special rounding */
- mx= ff_h263_round_chroma(mx);
- my= ff_h263_round_chroma(my);
-
- dxy = ((my & 1) << 1) | (mx & 1);
- mx >>= 1;
- my >>= 1;
-
- src_x = s->mb_x * 8 + mx;
- src_y = s->mb_y * 8 + my;
- src_x = clip(src_x, -8, s->width/2);
- if (src_x == s->width/2)
- dxy &= ~1;
- src_y = clip(src_y, -8, s->height/2);
- if (src_y == s->height/2)
- dxy &= ~2;
-
- offset = (src_y * (s->uvlinesize)) + src_x;
- ptr = ref_picture[1] + offset;
- if(s->flags&CODEC_FLAG_EMU_EDGE){
- if( (unsigned)src_x > (s->h_edge_pos>>1) - (dxy &1) - 8
- || (unsigned)src_y > (s->v_edge_pos>>1) - (dxy>>1) - 8){
- ff_emulated_edge_mc(s->edge_emu_buffer, ptr, s->uvlinesize, 9, 9, src_x, src_y, s->h_edge_pos>>1, s->v_edge_pos>>1);
- ptr= s->edge_emu_buffer;
- emu=1;
- }
- }
- pix_op[dxy](dest_cb, ptr, s->uvlinesize, 8);
-
- ptr = ref_picture[2] + offset;
- if(emu){
- ff_emulated_edge_mc(s->edge_emu_buffer, ptr, s->uvlinesize, 9, 9, src_x, src_y, s->h_edge_pos>>1, s->v_edge_pos>>1);
- ptr= s->edge_emu_buffer;
- }
- pix_op[dxy](dest_cr, ptr, s->uvlinesize, 8);
-}
-
-static inline void chroma_4mv_motion_lowres(MpegEncContext *s,
- uint8_t *dest_cb, uint8_t *dest_cr,
- uint8_t **ref_picture,
- h264_chroma_mc_func *pix_op,
- int mx, int my){
- const int lowres= s->avctx->lowres;
- const int block_s= 8>>lowres;
- const int s_mask= (2<<lowres)-1;
- const int h_edge_pos = s->h_edge_pos >> (lowres+1);
- const int v_edge_pos = s->v_edge_pos >> (lowres+1);
- int emu=0, src_x, src_y, offset, sx, sy;
- uint8_t *ptr;
-
- if(s->quarter_sample){
- mx/=2;
- my/=2;
- }
-
- /* In case of 8X8, we construct a single chroma motion vector
- with a special rounding */
- mx= ff_h263_round_chroma(mx);
- my= ff_h263_round_chroma(my);
-
- sx= mx & s_mask;
- sy= my & s_mask;
- src_x = s->mb_x*block_s + (mx >> (lowres+1));
- src_y = s->mb_y*block_s + (my >> (lowres+1));
-
- offset = src_y * s->uvlinesize + src_x;
- ptr = ref_picture[1] + offset;
- if(s->flags&CODEC_FLAG_EMU_EDGE){
- if( (unsigned)src_x > h_edge_pos - (!!sx) - block_s
- || (unsigned)src_y > v_edge_pos - (!!sy) - block_s){
- ff_emulated_edge_mc(s->edge_emu_buffer, ptr, s->uvlinesize, 9, 9, src_x, src_y, h_edge_pos, v_edge_pos);
- ptr= s->edge_emu_buffer;
- emu=1;
- }
- }
- sx <<= 2 - lowres;
- sy <<= 2 - lowres;
- pix_op[lowres](dest_cb, ptr, s->uvlinesize, block_s, sx, sy);
-
- ptr = ref_picture[2] + offset;
- if(emu){
- ff_emulated_edge_mc(s->edge_emu_buffer, ptr, s->uvlinesize, 9, 9, src_x, src_y, h_edge_pos, v_edge_pos);
- ptr= s->edge_emu_buffer;
- }
- pix_op[lowres](dest_cr, ptr, s->uvlinesize, block_s, sx, sy);
-}
-
-static inline void prefetch_motion(MpegEncContext *s, uint8_t **pix, int dir){
- /* fetch pixels for estimated mv 4 macroblocks ahead
- * optimized for 64byte cache lines */
- const int shift = s->quarter_sample ? 2 : 1;
- const int mx= (s->mv[dir][0][0]>>shift) + 16*s->mb_x + 8;
- const int my= (s->mv[dir][0][1]>>shift) + 16*s->mb_y;
- int off= mx + (my + (s->mb_x&3)*4)*s->linesize + 64;
- s->dsp.prefetch(pix[0]+off, s->linesize, 4);
- off= (mx>>1) + ((my>>1) + (s->mb_x&7))*s->uvlinesize + 64;
- s->dsp.prefetch(pix[1]+off, pix[2]-pix[1], 2);
-}
-
-/**
- * motion compensation of a single macroblock
- * @param s context
- * @param dest_y luma destination pointer
- * @param dest_cb chroma cb/u destination pointer
- * @param dest_cr chroma cr/v destination pointer
- * @param dir direction (0->forward, 1->backward)
- * @param ref_picture array[3] of pointers to the 3 planes of the reference picture
- * @param pic_op halfpel motion compensation function (average or put normally)
- * @param pic_op qpel motion compensation function (average or put normally)
- * the motion vectors are taken from s->mv and the MV type from s->mv_type
- */
-static inline void MPV_motion(MpegEncContext *s,
- uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
- int dir, uint8_t **ref_picture,
- op_pixels_func (*pix_op)[4], qpel_mc_func (*qpix_op)[16])
-{
- int dxy, mx, my, src_x, src_y, motion_x, motion_y;
- int mb_x, mb_y, i;
- uint8_t *ptr, *dest;
-
- mb_x = s->mb_x;
- mb_y = s->mb_y;
-
- prefetch_motion(s, ref_picture, dir);
-
- if(s->obmc && s->pict_type != B_TYPE){
- int16_t mv_cache[4][4][2];
- const int xy= s->mb_x + s->mb_y*s->mb_stride;
- const int mot_stride= s->b8_stride;
- const int mot_xy= mb_x*2 + mb_y*2*mot_stride;
-
- assert(!s->mb_skipped);
-
- memcpy(mv_cache[1][1], s->current_picture.motion_val[0][mot_xy ], sizeof(int16_t)*4);
- memcpy(mv_cache[2][1], s->current_picture.motion_val[0][mot_xy+mot_stride], sizeof(int16_t)*4);
- memcpy(mv_cache[3][1], s->current_picture.motion_val[0][mot_xy+mot_stride], sizeof(int16_t)*4);
-
- if(mb_y==0 || IS_INTRA(s->current_picture.mb_type[xy-s->mb_stride])){
- memcpy(mv_cache[0][1], mv_cache[1][1], sizeof(int16_t)*4);
- }else{
- memcpy(mv_cache[0][1], s->current_picture.motion_val[0][mot_xy-mot_stride], sizeof(int16_t)*4);
- }
-
- if(mb_x==0 || IS_INTRA(s->current_picture.mb_type[xy-1])){
- *(int32_t*)mv_cache[1][0]= *(int32_t*)mv_cache[1][1];
- *(int32_t*)mv_cache[2][0]= *(int32_t*)mv_cache[2][1];
- }else{
- *(int32_t*)mv_cache[1][0]= *(int32_t*)s->current_picture.motion_val[0][mot_xy-1];
- *(int32_t*)mv_cache[2][0]= *(int32_t*)s->current_picture.motion_val[0][mot_xy-1+mot_stride];
- }
-
- if(mb_x+1>=s->mb_width || IS_INTRA(s->current_picture.mb_type[xy+1])){
- *(int32_t*)mv_cache[1][3]= *(int32_t*)mv_cache[1][2];
- *(int32_t*)mv_cache[2][3]= *(int32_t*)mv_cache[2][2];
- }else{
- *(int32_t*)mv_cache[1][3]= *(int32_t*)s->current_picture.motion_val[0][mot_xy+2];
- *(int32_t*)mv_cache[2][3]= *(int32_t*)s->current_picture.motion_val[0][mot_xy+2+mot_stride];
- }
-
- mx = 0;
- my = 0;
- for(i=0;i<4;i++) {
- const int x= (i&1)+1;
- const int y= (i>>1)+1;
- int16_t mv[5][2]= {
- {mv_cache[y][x ][0], mv_cache[y][x ][1]},
- {mv_cache[y-1][x][0], mv_cache[y-1][x][1]},
- {mv_cache[y][x-1][0], mv_cache[y][x-1][1]},
- {mv_cache[y][x+1][0], mv_cache[y][x+1][1]},
- {mv_cache[y+1][x][0], mv_cache[y+1][x][1]}};
- //FIXME cleanup
- obmc_motion(s, dest_y + ((i & 1) * 8) + (i >> 1) * 8 * s->linesize,
- ref_picture[0],
- mb_x * 16 + (i & 1) * 8, mb_y * 16 + (i >>1) * 8,
- pix_op[1],
- mv);
-
- mx += mv[0][0];
- my += mv[0][1];
- }
- if(!(s->flags&CODEC_FLAG_GRAY))
- chroma_4mv_motion(s, dest_cb, dest_cr, ref_picture, pix_op[1], mx, my);
-
- return;
- }
-
- switch(s->mv_type) {
- case MV_TYPE_16X16:
- if(s->mcsel){
- if(s->real_sprite_warping_points==1){
- gmc1_motion(s, dest_y, dest_cb, dest_cr,
- ref_picture);
- }else{
- gmc_motion(s, dest_y, dest_cb, dest_cr,
- ref_picture);
- }
- }else if(s->quarter_sample){
- qpel_motion(s, dest_y, dest_cb, dest_cr,
- 0, 0, 0,
- ref_picture, pix_op, qpix_op,
- s->mv[dir][0][0], s->mv[dir][0][1], 16);
- }else if(s->mspel){
- ff_mspel_motion(s, dest_y, dest_cb, dest_cr,
- ref_picture, pix_op,
- s->mv[dir][0][0], s->mv[dir][0][1], 16);
- }else
- {
- mpeg_motion(s, dest_y, dest_cb, dest_cr,
- 0, 0, 0,
- ref_picture, pix_op,
- s->mv[dir][0][0], s->mv[dir][0][1], 16);
- }
- break;
- case MV_TYPE_8X8:
- mx = 0;
- my = 0;
- if(s->quarter_sample){
- for(i=0;i<4;i++) {
- motion_x = s->mv[dir][i][0];
- motion_y = s->mv[dir][i][1];
-
- dxy = ((motion_y & 3) << 2) | (motion_x & 3);
- src_x = mb_x * 16 + (motion_x >> 2) + (i & 1) * 8;
- src_y = mb_y * 16 + (motion_y >> 2) + (i >>1) * 8;
-
- /* WARNING: do no forget half pels */
- src_x = clip(src_x, -16, s->width);
- if (src_x == s->width)
- dxy &= ~3;
- src_y = clip(src_y, -16, s->height);
- if (src_y == s->height)
- dxy &= ~12;
-
- ptr = ref_picture[0] + (src_y * s->linesize) + (src_x);
- if(s->flags&CODEC_FLAG_EMU_EDGE){
- if( (unsigned)src_x > s->h_edge_pos - (motion_x&3) - 8
- || (unsigned)src_y > s->v_edge_pos - (motion_y&3) - 8 ){
- ff_emulated_edge_mc(s->edge_emu_buffer, ptr, s->linesize, 9, 9, src_x, src_y, s->h_edge_pos, s->v_edge_pos);
- ptr= s->edge_emu_buffer;
- }
- }
- dest = dest_y + ((i & 1) * 8) + (i >> 1) * 8 * s->linesize;
- qpix_op[1][dxy](dest, ptr, s->linesize);
-
- mx += s->mv[dir][i][0]/2;
- my += s->mv[dir][i][1]/2;
- }
- }else{
- for(i=0;i<4;i++) {
- hpel_motion(s, dest_y + ((i & 1) * 8) + (i >> 1) * 8 * s->linesize,
- ref_picture[0], 0, 0,
- mb_x * 16 + (i & 1) * 8, mb_y * 16 + (i >>1) * 8,
- s->width, s->height, s->linesize,
- s->h_edge_pos, s->v_edge_pos,
- 8, 8, pix_op[1],
- s->mv[dir][i][0], s->mv[dir][i][1]);
-
- mx += s->mv[dir][i][0];
- my += s->mv[dir][i][1];
- }
- }
-
- if(!(s->flags&CODEC_FLAG_GRAY))
- chroma_4mv_motion(s, dest_cb, dest_cr, ref_picture, pix_op[1], mx, my);
- break;
- case MV_TYPE_FIELD:
- if (s->picture_structure == PICT_FRAME) {
- if(s->quarter_sample){
- for(i=0; i<2; i++){
- qpel_motion(s, dest_y, dest_cb, dest_cr,
- 1, i, s->field_select[dir][i],
- ref_picture, pix_op, qpix_op,
- s->mv[dir][i][0], s->mv[dir][i][1], 8);
- }
- }else{
- /* top field */
- mpeg_motion(s, dest_y, dest_cb, dest_cr,
- 1, 0, s->field_select[dir][0],
- ref_picture, pix_op,
- s->mv[dir][0][0], s->mv[dir][0][1], 8);
- /* bottom field */
- mpeg_motion(s, dest_y, dest_cb, dest_cr,
- 1, 1, s->field_select[dir][1],
- ref_picture, pix_op,
- s->mv[dir][1][0], s->mv[dir][1][1], 8);
- }
- } else {
- if(s->picture_structure != s->field_select[dir][0] + 1 && s->pict_type != B_TYPE && !s->first_field){
- ref_picture= s->current_picture_ptr->data;
- }
-
- mpeg_motion(s, dest_y, dest_cb, dest_cr,
- 0, 0, s->field_select[dir][0],
- ref_picture, pix_op,
- s->mv[dir][0][0], s->mv[dir][0][1], 16);
- }
- break;
- case MV_TYPE_16X8:
- for(i=0; i<2; i++){
- uint8_t ** ref2picture;
-
- if(s->picture_structure == s->field_select[dir][i] + 1 || s->pict_type == B_TYPE || s->first_field){
- ref2picture= ref_picture;
- }else{
- ref2picture= s->current_picture_ptr->data;
- }
-
- mpeg_motion(s, dest_y, dest_cb, dest_cr,
- 0, 0, s->field_select[dir][i],
- ref2picture, pix_op,
- s->mv[dir][i][0], s->mv[dir][i][1] + 16*i, 8);
-
- dest_y += 16*s->linesize;
- dest_cb+= (16>>s->chroma_y_shift)*s->uvlinesize;
- dest_cr+= (16>>s->chroma_y_shift)*s->uvlinesize;
- }
- break;
- case MV_TYPE_DMV:
- if(s->picture_structure == PICT_FRAME){
- for(i=0; i<2; i++){
- int j;
- for(j=0; j<2; j++){
- mpeg_motion(s, dest_y, dest_cb, dest_cr,
- 1, j, j^i,
- ref_picture, pix_op,
- s->mv[dir][2*i + j][0], s->mv[dir][2*i + j][1], 8);
- }
- pix_op = s->dsp.avg_pixels_tab;
- }
- }else{
- for(i=0; i<2; i++){
- mpeg_motion(s, dest_y, dest_cb, dest_cr,
- 0, 0, s->picture_structure != i+1,
- ref_picture, pix_op,
- s->mv[dir][2*i][0],s->mv[dir][2*i][1],16);
-
- // after put we make avg of the same block
- pix_op=s->dsp.avg_pixels_tab;
-
- //opposite parity is always in the same frame if this is second field
- if(!s->first_field){
- ref_picture = s->current_picture_ptr->data;
- }
- }
- }
- break;
- default: assert(0);
- }
-}
-
-/**
- * motion compensation of a single macroblock
- * @param s context
- * @param dest_y luma destination pointer
- * @param dest_cb chroma cb/u destination pointer
- * @param dest_cr chroma cr/v destination pointer
- * @param dir direction (0->forward, 1->backward)
- * @param ref_picture array[3] of pointers to the 3 planes of the reference picture
- * @param pic_op halfpel motion compensation function (average or put normally)
- * the motion vectors are taken from s->mv and the MV type from s->mv_type
- */
-static inline void MPV_motion_lowres(MpegEncContext *s,
- uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
- int dir, uint8_t **ref_picture,
- h264_chroma_mc_func *pix_op)
-{
- int mx, my;
- int mb_x, mb_y, i;
- const int lowres= s->avctx->lowres;
- const int block_s= 8>>lowres;
-
- mb_x = s->mb_x;
- mb_y = s->mb_y;
-
- switch(s->mv_type) {
- case MV_TYPE_16X16:
- mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr,
- 0, 0, 0,
- ref_picture, pix_op,
- s->mv[dir][0][0], s->mv[dir][0][1], 2*block_s);
- break;
- case MV_TYPE_8X8:
- mx = 0;
- my = 0;
- for(i=0;i<4;i++) {
- hpel_motion_lowres(s, dest_y + ((i & 1) + (i >> 1) * s->linesize)*block_s,
- ref_picture[0], 0, 0,
- (2*mb_x + (i & 1))*block_s, (2*mb_y + (i >>1))*block_s,
- s->width, s->height, s->linesize,
- s->h_edge_pos >> lowres, s->v_edge_pos >> lowres,
- block_s, block_s, pix_op,
- s->mv[dir][i][0], s->mv[dir][i][1]);
-
- mx += s->mv[dir][i][0];
- my += s->mv[dir][i][1];
- }
-
- if(!(s->flags&CODEC_FLAG_GRAY))
- chroma_4mv_motion_lowres(s, dest_cb, dest_cr, ref_picture, pix_op, mx, my);
- break;
- case MV_TYPE_FIELD:
- if (s->picture_structure == PICT_FRAME) {
- /* top field */
- mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr,
- 1, 0, s->field_select[dir][0],
- ref_picture, pix_op,
- s->mv[dir][0][0], s->mv[dir][0][1], block_s);
- /* bottom field */
- mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr,
- 1, 1, s->field_select[dir][1],
- ref_picture, pix_op,
- s->mv[dir][1][0], s->mv[dir][1][1], block_s);
- } else {
- if(s->picture_structure != s->field_select[dir][0] + 1 && s->pict_type != B_TYPE && !s->first_field){
- ref_picture= s->current_picture_ptr->data;
- }
-
- mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr,
- 0, 0, s->field_select[dir][0],
- ref_picture, pix_op,
- s->mv[dir][0][0], s->mv[dir][0][1], 2*block_s);
- }
- break;
- case MV_TYPE_16X8:
- for(i=0; i<2; i++){
- uint8_t ** ref2picture;
-
- if(s->picture_structure == s->field_select[dir][i] + 1 || s->pict_type == B_TYPE || s->first_field){
- ref2picture= ref_picture;
- }else{
- ref2picture= s->current_picture_ptr->data;
- }
-
- mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr,
- 0, 0, s->field_select[dir][i],
- ref2picture, pix_op,
- s->mv[dir][i][0], s->mv[dir][i][1] + 2*block_s*i, block_s);
-
- dest_y += 2*block_s*s->linesize;
- dest_cb+= (2*block_s>>s->chroma_y_shift)*s->uvlinesize;
- dest_cr+= (2*block_s>>s->chroma_y_shift)*s->uvlinesize;
- }
- break;
- case MV_TYPE_DMV:
- if(s->picture_structure == PICT_FRAME){
- for(i=0; i<2; i++){
- int j;
- for(j=0; j<2; j++){
- mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr,
- 1, j, j^i,
- ref_picture, pix_op,
- s->mv[dir][2*i + j][0], s->mv[dir][2*i + j][1], block_s);
- }
- pix_op = s->dsp.avg_h264_chroma_pixels_tab;
- }
- }else{
- for(i=0; i<2; i++){
- mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr,
- 0, 0, s->picture_structure != i+1,
- ref_picture, pix_op,
- s->mv[dir][2*i][0],s->mv[dir][2*i][1],2*block_s);
-
- // after put we make avg of the same block
- pix_op = s->dsp.avg_h264_chroma_pixels_tab;
-
- //opposite parity is always in the same frame if this is second field
- if(!s->first_field){
- ref_picture = s->current_picture_ptr->data;
- }
- }
- }
- break;
- default: assert(0);
- }
-}
-
-/* put block[] to dest[] */
-static inline void put_dct(MpegEncContext *s,
- DCTELEM *block, int i, uint8_t *dest, int line_size, int qscale)
-{
- s->dct_unquantize_intra(s, block, i, qscale);
- s->dsp.idct_put (dest, line_size, block);
-}
-
-/* add block[] to dest[] */
-static inline void add_dct(MpegEncContext *s,
- DCTELEM *block, int i, uint8_t *dest, int line_size)
-{
- if (s->block_last_index[i] >= 0) {
- s->dsp.idct_add (dest, line_size, block);
- }
-}
-
-static inline void add_dequant_dct(MpegEncContext *s,
- DCTELEM *block, int i, uint8_t *dest, int line_size, int qscale)
-{
- if (s->block_last_index[i] >= 0) {
- s->dct_unquantize_inter(s, block, i, qscale);
-
- s->dsp.idct_add (dest, line_size, block);
- }
-}
-
-/**
- * cleans dc, ac, coded_block for the current non intra MB
- */
-void ff_clean_intra_table_entries(MpegEncContext *s)
-{
- int wrap = s->b8_stride;
- int xy = s->block_index[0];
-
- s->dc_val[0][xy ] =
- s->dc_val[0][xy + 1 ] =
- s->dc_val[0][xy + wrap] =
- s->dc_val[0][xy + 1 + wrap] = 1024;
- /* ac pred */
- memset(s->ac_val[0][xy ], 0, 32 * sizeof(int16_t));
- memset(s->ac_val[0][xy + wrap], 0, 32 * sizeof(int16_t));
- if (s->msmpeg4_version>=3) {
- s->coded_block[xy ] =
- s->coded_block[xy + 1 ] =
- s->coded_block[xy + wrap] =
- s->coded_block[xy + 1 + wrap] = 0;
- }
- /* chroma */
- wrap = s->mb_stride;
- xy = s->mb_x + s->mb_y * wrap;
- s->dc_val[1][xy] =
- s->dc_val[2][xy] = 1024;
- /* ac pred */
- memset(s->ac_val[1][xy], 0, 16 * sizeof(int16_t));
- memset(s->ac_val[2][xy], 0, 16 * sizeof(int16_t));
-
- s->mbintra_table[xy]= 0;
-}
-
-/* generic function called after a macroblock has been parsed by the
- decoder or after it has been encoded by the encoder.
-
- Important variables used:
- s->mb_intra : true if intra macroblock
- s->mv_dir : motion vector direction
- s->mv_type : motion vector type
- s->mv : motion vector
- s->interlaced_dct : true if interlaced dct used (mpeg2)
- */
-static av_always_inline void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64], int lowres_flag)
-{
- int mb_x, mb_y;
- const int mb_xy = s->mb_y * s->mb_stride + s->mb_x;
-#ifdef HAVE_XVMC
- if(s->avctx->xvmc_acceleration){
- XVMC_decode_mb(s);//xvmc uses pblocks
- return;
- }
-#endif
-
- mb_x = s->mb_x;
- mb_y = s->mb_y;
-
- if(s->avctx->debug&FF_DEBUG_DCT_COEFF) {
- /* save DCT coefficients */
- int i,j;
- DCTELEM *dct = &s->current_picture.dct_coeff[mb_xy*64*6];
- for(i=0; i<6; i++)
- for(j=0; j<64; j++)
- *dct++ = block[i][s->dsp.idct_permutation[j]];
- }
-
- s->current_picture.qscale_table[mb_xy]= s->qscale;
-
- /* update DC predictors for P macroblocks */
- if (!s->mb_intra) {
- if (s->h263_pred || s->h263_aic) {
- if(s->mbintra_table[mb_xy])
- ff_clean_intra_table_entries(s);
- } else {
- s->last_dc[0] =
- s->last_dc[1] =
- s->last_dc[2] = 128 << s->intra_dc_precision;
- }
- }
- else if (s->h263_pred || s->h263_aic)
- s->mbintra_table[mb_xy]=1;
-
- if ((s->flags&CODEC_FLAG_PSNR) || !(s->encoding && (s->intra_only || s->pict_type==B_TYPE) && s->avctx->mb_decision != FF_MB_DECISION_RD)) { //FIXME precalc
- uint8_t *dest_y, *dest_cb, *dest_cr;
- int dct_linesize, dct_offset;
- op_pixels_func (*op_pix)[4];
- qpel_mc_func (*op_qpix)[16];
- const int linesize= s->current_picture.linesize[0]; //not s->linesize as this would be wrong for field pics
- const int uvlinesize= s->current_picture.linesize[1];
- const int readable= s->pict_type != B_TYPE || s->encoding || s->avctx->draw_horiz_band || lowres_flag;
- const int block_size= lowres_flag ? 8>>s->avctx->lowres : 8;
-
- /* avoid copy if macroblock skipped in last frame too */
- /* skip only during decoding as we might trash the buffers during encoding a bit */
- if(!s->encoding){
- uint8_t *mbskip_ptr = &s->mbskip_table[mb_xy];
- const int age= s->current_picture.age;
-
- assert(age);
-
- if (s->mb_skipped) {
- s->mb_skipped= 0;
- assert(s->pict_type!=I_TYPE);
-
- (*mbskip_ptr) ++; /* indicate that this time we skipped it */
- if(*mbskip_ptr >99) *mbskip_ptr= 99;
-
- /* if previous was skipped too, then nothing to do ! */
- if (*mbskip_ptr >= age && s->current_picture.reference){
- return;
- }
- } else if(!s->current_picture.reference){
- (*mbskip_ptr) ++; /* increase counter so the age can be compared cleanly */
- if(*mbskip_ptr >99) *mbskip_ptr= 99;
- } else{
- *mbskip_ptr = 0; /* not skipped */
- }
- }
-
- dct_linesize = linesize << s->interlaced_dct;
- dct_offset =(s->interlaced_dct)? linesize : linesize*block_size;
-
- if(readable){
- dest_y= s->dest[0];
- dest_cb= s->dest[1];
- dest_cr= s->dest[2];
- }else{
- dest_y = s->b_scratchpad;
- dest_cb= s->b_scratchpad+16*linesize;
- dest_cr= s->b_scratchpad+32*linesize;
- }
-
- if (!s->mb_intra) {
- /* motion handling */
- /* decoding or more than one mb_type (MC was already done otherwise) */
- if(!s->encoding){
- if(lowres_flag){
- h264_chroma_mc_func *op_pix = s->dsp.put_h264_chroma_pixels_tab;
-
- if (s->mv_dir & MV_DIR_FORWARD) {
- MPV_motion_lowres(s, dest_y, dest_cb, dest_cr, 0, s->last_picture.data, op_pix);
- op_pix = s->dsp.avg_h264_chroma_pixels_tab;
- }
- if (s->mv_dir & MV_DIR_BACKWARD) {
- MPV_motion_lowres(s, dest_y, dest_cb, dest_cr, 1, s->next_picture.data, op_pix);
- }
- }else{
- op_qpix= s->me.qpel_put;
- if ((!s->no_rounding) || s->pict_type==B_TYPE){
- op_pix = s->dsp.put_pixels_tab;
- }else{
- op_pix = s->dsp.put_no_rnd_pixels_tab;
- }
- if (s->mv_dir & MV_DIR_FORWARD) {
- MPV_motion(s, dest_y, dest_cb, dest_cr, 0, s->last_picture.data, op_pix, op_qpix);
- op_pix = s->dsp.avg_pixels_tab;
- op_qpix= s->me.qpel_avg;
- }
- if (s->mv_dir & MV_DIR_BACKWARD) {
- MPV_motion(s, dest_y, dest_cb, dest_cr, 1, s->next_picture.data, op_pix, op_qpix);
- }
- }
- }
-
- /* skip dequant / idct if we are really late ;) */
- if(s->hurry_up>1) goto skip_idct;
- if(s->avctx->skip_idct){
- if( (s->avctx->skip_idct >= AVDISCARD_NONREF && s->pict_type == B_TYPE)
- ||(s->avctx->skip_idct >= AVDISCARD_NONKEY && s->pict_type != I_TYPE)
- || s->avctx->skip_idct >= AVDISCARD_ALL)
- goto skip_idct;
- }
-
- /* add dct residue */
- if(s->encoding || !( s->h263_msmpeg4 || s->codec_id==CODEC_ID_MPEG1VIDEO || s->codec_id==CODEC_ID_MPEG2VIDEO
- || (s->codec_id==CODEC_ID_MPEG4 && !s->mpeg_quant))){
- add_dequant_dct(s, block[0], 0, dest_y , dct_linesize, s->qscale);
- add_dequant_dct(s, block[1], 1, dest_y + block_size, dct_linesize, s->qscale);
- add_dequant_dct(s, block[2], 2, dest_y + dct_offset , dct_linesize, s->qscale);
- add_dequant_dct(s, block[3], 3, dest_y + dct_offset + block_size, dct_linesize, s->qscale);
-
- if(!(s->flags&CODEC_FLAG_GRAY)){
- if (s->chroma_y_shift){
- add_dequant_dct(s, block[4], 4, dest_cb, uvlinesize, s->chroma_qscale);
- add_dequant_dct(s, block[5], 5, dest_cr, uvlinesize, s->chroma_qscale);
- }else{
- dct_linesize >>= 1;
- dct_offset >>=1;
- add_dequant_dct(s, block[4], 4, dest_cb, dct_linesize, s->chroma_qscale);
- add_dequant_dct(s, block[5], 5, dest_cr, dct_linesize, s->chroma_qscale);
- add_dequant_dct(s, block[6], 6, dest_cb + dct_offset, dct_linesize, s->chroma_qscale);
- add_dequant_dct(s, block[7], 7, dest_cr + dct_offset, dct_linesize, s->chroma_qscale);
- }
- }
- } else if(s->codec_id != CODEC_ID_WMV2){
- add_dct(s, block[0], 0, dest_y , dct_linesize);
- add_dct(s, block[1], 1, dest_y + block_size, dct_linesize);
- add_dct(s, block[2], 2, dest_y + dct_offset , dct_linesize);
- add_dct(s, block[3], 3, dest_y + dct_offset + block_size, dct_linesize);
-
- if(!(s->flags&CODEC_FLAG_GRAY)){
- if(s->chroma_y_shift){//Chroma420
- add_dct(s, block[4], 4, dest_cb, uvlinesize);
- add_dct(s, block[5], 5, dest_cr, uvlinesize);
- }else{
- //chroma422
- dct_linesize = uvlinesize << s->interlaced_dct;
- dct_offset =(s->interlaced_dct)? uvlinesize : uvlinesize*8;
-
- add_dct(s, block[4], 4, dest_cb, dct_linesize);
- add_dct(s, block[5], 5, dest_cr, dct_linesize);
- add_dct(s, block[6], 6, dest_cb+dct_offset, dct_linesize);
- add_dct(s, block[7], 7, dest_cr+dct_offset, dct_linesize);
- if(!s->chroma_x_shift){//Chroma444
- add_dct(s, block[8], 8, dest_cb+8, dct_linesize);
- add_dct(s, block[9], 9, dest_cr+8, dct_linesize);
- add_dct(s, block[10], 10, dest_cb+8+dct_offset, dct_linesize);
- add_dct(s, block[11], 11, dest_cr+8+dct_offset, dct_linesize);
- }
- }
- }//fi gray
- }
- else{
- ff_wmv2_add_mb(s, block, dest_y, dest_cb, dest_cr);
- }
- } else {
- /* dct only in intra block */
- if(s->encoding || !(s->codec_id==CODEC_ID_MPEG1VIDEO || s->codec_id==CODEC_ID_MPEG2VIDEO)){
- put_dct(s, block[0], 0, dest_y , dct_linesize, s->qscale);
- put_dct(s, block[1], 1, dest_y + block_size, dct_linesize, s->qscale);
- put_dct(s, block[2], 2, dest_y + dct_offset , dct_linesize, s->qscale);
- put_dct(s, block[3], 3, dest_y + dct_offset + block_size, dct_linesize, s->qscale);
-
- if(!(s->flags&CODEC_FLAG_GRAY)){
- if(s->chroma_y_shift){
- put_dct(s, block[4], 4, dest_cb, uvlinesize, s->chroma_qscale);
- put_dct(s, block[5], 5, dest_cr, uvlinesize, s->chroma_qscale);
- }else{
- dct_offset >>=1;
- dct_linesize >>=1;
- put_dct(s, block[4], 4, dest_cb, dct_linesize, s->chroma_qscale);
- put_dct(s, block[5], 5, dest_cr, dct_linesize, s->chroma_qscale);
- put_dct(s, block[6], 6, dest_cb + dct_offset, dct_linesize, s->chroma_qscale);
- put_dct(s, block[7], 7, dest_cr + dct_offset, dct_linesize, s->chroma_qscale);
- }
- }
- }else{
- s->dsp.idct_put(dest_y , dct_linesize, block[0]);
- s->dsp.idct_put(dest_y + block_size, dct_linesize, block[1]);
- s->dsp.idct_put(dest_y + dct_offset , dct_linesize, block[2]);
- s->dsp.idct_put(dest_y + dct_offset + block_size, dct_linesize, block[3]);
-
- if(!(s->flags&CODEC_FLAG_GRAY)){
- if(s->chroma_y_shift){
- s->dsp.idct_put(dest_cb, uvlinesize, block[4]);
- s->dsp.idct_put(dest_cr, uvlinesize, block[5]);
- }else{
-
- dct_linesize = uvlinesize << s->interlaced_dct;
- dct_offset =(s->interlaced_dct)? uvlinesize : uvlinesize*8;
-
- s->dsp.idct_put(dest_cb, dct_linesize, block[4]);
- s->dsp.idct_put(dest_cr, dct_linesize, block[5]);
- s->dsp.idct_put(dest_cb + dct_offset, dct_linesize, block[6]);
- s->dsp.idct_put(dest_cr + dct_offset, dct_linesize, block[7]);
- if(!s->chroma_x_shift){//Chroma444
- s->dsp.idct_put(dest_cb + 8, dct_linesize, block[8]);
- s->dsp.idct_put(dest_cr + 8, dct_linesize, block[9]);
- s->dsp.idct_put(dest_cb + 8 + dct_offset, dct_linesize, block[10]);
- s->dsp.idct_put(dest_cr + 8 + dct_offset, dct_linesize, block[11]);
- }
- }
- }//gray
- }
- }
-skip_idct:
- if(!readable){
- s->dsp.put_pixels_tab[0][0](s->dest[0], dest_y , linesize,16);
- s->dsp.put_pixels_tab[s->chroma_x_shift][0](s->dest[1], dest_cb, uvlinesize,16 >> s->chroma_y_shift);
- s->dsp.put_pixels_tab[s->chroma_x_shift][0](s->dest[2], dest_cr, uvlinesize,16 >> s->chroma_y_shift);
- }
- }
-}
-
-void MPV_decode_mb(MpegEncContext *s, DCTELEM block[12][64]){
- if(s->avctx->lowres) MPV_decode_mb_internal(s, block, 1);
- else MPV_decode_mb_internal(s, block, 0);
-}
-
-#ifdef CONFIG_ENCODERS
-
-static inline void dct_single_coeff_elimination(MpegEncContext *s, int n, int threshold)
-{
- static const char tab[64]=
- {3,2,2,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0};
- int score=0;
- int run=0;
- int i;
- DCTELEM *block= s->block[n];
- const int last_index= s->block_last_index[n];
- int skip_dc;
-
- if(threshold<0){
- skip_dc=0;
- threshold= -threshold;
- }else
- skip_dc=1;
-
- /* are all which we could set to zero are allready zero? */
- if(last_index<=skip_dc - 1) return;
-
- for(i=0; i<=last_index; i++){
- const int j = s->intra_scantable.permutated[i];
- const int level = FFABS(block[j]);
- if(level==1){
- if(skip_dc && i==0) continue;
- score+= tab[run];
- run=0;
- }else if(level>1){
- return;
- }else{
- run++;
- }
- }
- if(score >= threshold) return;
- for(i=skip_dc; i<=last_index; i++){
- const int j = s->intra_scantable.permutated[i];
- block[j]=0;
- }
- if(block[0]) s->block_last_index[n]= 0;
- else s->block_last_index[n]= -1;
-}
-
-static inline void clip_coeffs(MpegEncContext *s, DCTELEM *block, int last_index)
-{
- int i;
- const int maxlevel= s->max_qcoeff;
- const int minlevel= s->min_qcoeff;
- int overflow=0;
-
- if(s->mb_intra){
- i=1; //skip clipping of intra dc
- }else
- i=0;
-
- for(;i<=last_index; i++){
- const int j= s->intra_scantable.permutated[i];
- int level = block[j];
-
- if (level>maxlevel){
- level=maxlevel;
- overflow++;
- }else if(level<minlevel){
- level=minlevel;
- overflow++;
- }
-
- block[j]= level;
- }
-
- if(overflow && s->avctx->mb_decision == FF_MB_DECISION_SIMPLE)
- av_log(s->avctx, AV_LOG_INFO, "warning, clipping %d dct coefficients to %d..%d\n", overflow, minlevel, maxlevel);
-}
-
-#endif //CONFIG_ENCODERS
-
-/**
- *
- * @param h is the normal height, this will be reduced automatically if needed for the last row
- */
-void ff_draw_horiz_band(MpegEncContext *s, int y, int h){
- if (s->avctx->draw_horiz_band) {
- AVFrame *src;
- int offset[4];
-
- if(s->picture_structure != PICT_FRAME){
- h <<= 1;
- y <<= 1;
- if(s->first_field && !(s->avctx->slice_flags&SLICE_FLAG_ALLOW_FIELD)) return;
- }
-
- h= FFMIN(h, s->avctx->height - y);
-
- if(s->pict_type==B_TYPE || s->low_delay || (s->avctx->slice_flags&SLICE_FLAG_CODED_ORDER))
- src= (AVFrame*)s->current_picture_ptr;
- else if(s->last_picture_ptr)
- src= (AVFrame*)s->last_picture_ptr;
- else
- return;
-
- if(s->pict_type==B_TYPE && s->picture_structure == PICT_FRAME && s->out_format != FMT_H264){
- offset[0]=
- offset[1]=
- offset[2]=
- offset[3]= 0;
- }else{
- offset[0]= y * s->linesize;;
- offset[1]=
- offset[2]= (y >> s->chroma_y_shift) * s->uvlinesize;
- offset[3]= 0;
- }
-
- emms_c();
-
- s->avctx->draw_horiz_band(s->avctx, src, offset,
- y, s->picture_structure, h);
- }
-}
-
-void ff_init_block_index(MpegEncContext *s){ //FIXME maybe rename
- const int linesize= s->current_picture.linesize[0]; //not s->linesize as this would be wrong for field pics
- const int uvlinesize= s->current_picture.linesize[1];
- const int mb_size= 4 - s->avctx->lowres;
-
- s->block_index[0]= s->b8_stride*(s->mb_y*2 ) - 2 + s->mb_x*2;
- s->block_index[1]= s->b8_stride*(s->mb_y*2 ) - 1 + s->mb_x*2;
- s->block_index[2]= s->b8_stride*(s->mb_y*2 + 1) - 2 + s->mb_x*2;
- s->block_index[3]= s->b8_stride*(s->mb_y*2 + 1) - 1 + s->mb_x*2;
- s->block_index[4]= s->mb_stride*(s->mb_y + 1) + s->b8_stride*s->mb_height*2 + s->mb_x - 1;
- s->block_index[5]= s->mb_stride*(s->mb_y + s->mb_height + 2) + s->b8_stride*s->mb_height*2 + s->mb_x - 1;
- //block_index is not used by mpeg2, so it is not affected by chroma_format
-
- s->dest[0] = s->current_picture.data[0] + ((s->mb_x - 1) << mb_size);
- s->dest[1] = s->current_picture.data[1] + ((s->mb_x - 1) << (mb_size - s->chroma_x_shift));
- s->dest[2] = s->current_picture.data[2] + ((s->mb_x - 1) << (mb_size - s->chroma_x_shift));
-
- if(!(s->pict_type==B_TYPE && s->avctx->draw_horiz_band && s->picture_structure==PICT_FRAME))
- {
- s->dest[0] += s->mb_y * linesize << mb_size;
- s->dest[1] += s->mb_y * uvlinesize << (mb_size - s->chroma_y_shift);
- s->dest[2] += s->mb_y * uvlinesize << (mb_size - s->chroma_y_shift);
- }
-}
-
-#ifdef CONFIG_ENCODERS
-
-static void get_vissual_weight(int16_t *weight, uint8_t *ptr, int stride){
- int x, y;
-//FIXME optimize
- for(y=0; y<8; y++){
- for(x=0; x<8; x++){
- int x2, y2;
- int sum=0;
- int sqr=0;
- int count=0;
-
- for(y2= FFMAX(y-1, 0); y2 < FFMIN(8, y+2); y2++){
- for(x2= FFMAX(x-1, 0); x2 < FFMIN(8, x+2); x2++){
- int v= ptr[x2 + y2*stride];
- sum += v;
- sqr += v*v;
- count++;
- }
- }
- weight[x + 8*y]= (36*ff_sqrt(count*sqr - sum*sum)) / count;
- }
- }
-}
-
-static av_always_inline void encode_mb_internal(MpegEncContext *s, int motion_x, int motion_y, int mb_block_height, int mb_block_count)
-{
- int16_t weight[8][64];
- DCTELEM orig[8][64];
- const int mb_x= s->mb_x;
- const int mb_y= s->mb_y;
- int i;
- int skip_dct[8];
- int dct_offset = s->linesize*8; //default for progressive frames
- uint8_t *ptr_y, *ptr_cb, *ptr_cr;
- int wrap_y, wrap_c;
-
- for(i=0; i<mb_block_count; i++) skip_dct[i]=s->skipdct;
-
- if(s->adaptive_quant){
- const int last_qp= s->qscale;
- const int mb_xy= mb_x + mb_y*s->mb_stride;
-
- s->lambda= s->lambda_table[mb_xy];
- update_qscale(s);
-
- if(!(s->flags&CODEC_FLAG_QP_RD)){
- s->qscale= s->current_picture_ptr->qscale_table[mb_xy];
- s->dquant= s->qscale - last_qp;
-
- if(s->out_format==FMT_H263){
- s->dquant= clip(s->dquant, -2, 2);
-
- if(s->codec_id==CODEC_ID_MPEG4){
- if(!s->mb_intra){
- if(s->pict_type == B_TYPE){
- if(s->dquant&1 || s->mv_dir&MV_DIRECT)
- s->dquant= 0;
- }
- if(s->mv_type==MV_TYPE_8X8)
- s->dquant=0;
- }
- }
- }
- }
- ff_set_qscale(s, last_qp + s->dquant);
- }else if(s->flags&CODEC_FLAG_QP_RD)
- ff_set_qscale(s, s->qscale + s->dquant);
-
- wrap_y = s->linesize;
- wrap_c = s->uvlinesize;
- ptr_y = s->new_picture.data[0] + (mb_y * 16 * wrap_y) + mb_x * 16;
- ptr_cb = s->new_picture.data[1] + (mb_y * mb_block_height * wrap_c) + mb_x * 8;
- ptr_cr = s->new_picture.data[2] + (mb_y * mb_block_height * wrap_c) + mb_x * 8;
-
- if(mb_x*16+16 > s->width || mb_y*16+16 > s->height){
- uint8_t *ebuf= s->edge_emu_buffer + 32;
- ff_emulated_edge_mc(ebuf , ptr_y , wrap_y,16,16,mb_x*16,mb_y*16, s->width , s->height);
- ptr_y= ebuf;
- ff_emulated_edge_mc(ebuf+18*wrap_y , ptr_cb, wrap_c, 8, mb_block_height, mb_x*8, mb_y*8, s->width>>1, s->height>>1);
- ptr_cb= ebuf+18*wrap_y;
- ff_emulated_edge_mc(ebuf+18*wrap_y+8, ptr_cr, wrap_c, 8, mb_block_height, mb_x*8, mb_y*8, s->width>>1, s->height>>1);
- ptr_cr= ebuf+18*wrap_y+8;
- }
-
- if (s->mb_intra) {
- if(s->flags&CODEC_FLAG_INTERLACED_DCT){
- int progressive_score, interlaced_score;
-
- s->interlaced_dct=0;
- progressive_score= s->dsp.ildct_cmp[4](s, ptr_y , NULL, wrap_y, 8)
- +s->dsp.ildct_cmp[4](s, ptr_y + wrap_y*8, NULL, wrap_y, 8) - 400;
-
- if(progressive_score > 0){
- interlaced_score = s->dsp.ildct_cmp[4](s, ptr_y , NULL, wrap_y*2, 8)
- +s->dsp.ildct_cmp[4](s, ptr_y + wrap_y , NULL, wrap_y*2, 8);
- if(progressive_score > interlaced_score){
- s->interlaced_dct=1;
-
- dct_offset= wrap_y;
- wrap_y<<=1;
- if (s->chroma_format == CHROMA_422)
- wrap_c<<=1;
- }
- }
- }
-
- s->dsp.get_pixels(s->block[0], ptr_y , wrap_y);
- s->dsp.get_pixels(s->block[1], ptr_y + 8, wrap_y);
- s->dsp.get_pixels(s->block[2], ptr_y + dct_offset , wrap_y);
- s->dsp.get_pixels(s->block[3], ptr_y + dct_offset + 8, wrap_y);
-
- if(s->flags&CODEC_FLAG_GRAY){
- skip_dct[4]= 1;
- skip_dct[5]= 1;
- }else{
- s->dsp.get_pixels(s->block[4], ptr_cb, wrap_c);
- s->dsp.get_pixels(s->block[5], ptr_cr, wrap_c);
- if(!s->chroma_y_shift){ /* 422 */
- s->dsp.get_pixels(s->block[6], ptr_cb + (dct_offset>>1), wrap_c);
- s->dsp.get_pixels(s->block[7], ptr_cr + (dct_offset>>1), wrap_c);
- }
- }
- }else{
- op_pixels_func (*op_pix)[4];
- qpel_mc_func (*op_qpix)[16];
- uint8_t *dest_y, *dest_cb, *dest_cr;
-
- dest_y = s->dest[0];
- dest_cb = s->dest[1];
- dest_cr = s->dest[2];
-
- if ((!s->no_rounding) || s->pict_type==B_TYPE){
- op_pix = s->dsp.put_pixels_tab;
- op_qpix= s->dsp.put_qpel_pixels_tab;
- }else{
- op_pix = s->dsp.put_no_rnd_pixels_tab;
- op_qpix= s->dsp.put_no_rnd_qpel_pixels_tab;
- }
-
- if (s->mv_dir & MV_DIR_FORWARD) {
- MPV_motion(s, dest_y, dest_cb, dest_cr, 0, s->last_picture.data, op_pix, op_qpix);
- op_pix = s->dsp.avg_pixels_tab;
- op_qpix= s->dsp.avg_qpel_pixels_tab;
- }
- if (s->mv_dir & MV_DIR_BACKWARD) {
- MPV_motion(s, dest_y, dest_cb, dest_cr, 1, s->next_picture.data, op_pix, op_qpix);
- }
-
- if(s->flags&CODEC_FLAG_INTERLACED_DCT){
- int progressive_score, interlaced_score;
-
- s->interlaced_dct=0;
- progressive_score= s->dsp.ildct_cmp[0](s, dest_y , ptr_y , wrap_y, 8)
- +s->dsp.ildct_cmp[0](s, dest_y + wrap_y*8, ptr_y + wrap_y*8, wrap_y, 8) - 400;
-
- if(s->avctx->ildct_cmp == FF_CMP_VSSE) progressive_score -= 400;
-
- if(progressive_score>0){
- interlaced_score = s->dsp.ildct_cmp[0](s, dest_y , ptr_y , wrap_y*2, 8)
- +s->dsp.ildct_cmp[0](s, dest_y + wrap_y , ptr_y + wrap_y , wrap_y*2, 8);
-
- if(progressive_score > interlaced_score){
- s->interlaced_dct=1;
-
- dct_offset= wrap_y;
- wrap_y<<=1;
- if (s->chroma_format == CHROMA_422)
- wrap_c<<=1;
- }
- }
- }
-
- s->dsp.diff_pixels(s->block[0], ptr_y , dest_y , wrap_y);
- s->dsp.diff_pixels(s->block[1], ptr_y + 8, dest_y + 8, wrap_y);
- s->dsp.diff_pixels(s->block[2], ptr_y + dct_offset , dest_y + dct_offset , wrap_y);
- s->dsp.diff_pixels(s->block[3], ptr_y + dct_offset + 8, dest_y + dct_offset + 8, wrap_y);
-
- if(s->flags&CODEC_FLAG_GRAY){
- skip_dct[4]= 1;
- skip_dct[5]= 1;
- }else{
- s->dsp.diff_pixels(s->block[4], ptr_cb, dest_cb, wrap_c);
- s->dsp.diff_pixels(s->block[5], ptr_cr, dest_cr, wrap_c);
- if(!s->chroma_y_shift){ /* 422 */
- s->dsp.diff_pixels(s->block[6], ptr_cb + (dct_offset>>1), dest_cb + (dct_offset>>1), wrap_c);
- s->dsp.diff_pixels(s->block[7], ptr_cr + (dct_offset>>1), dest_cr + (dct_offset>>1), wrap_c);
- }
- }
- /* pre quantization */
- if(s->current_picture.mc_mb_var[s->mb_stride*mb_y+ mb_x]<2*s->qscale*s->qscale){
- //FIXME optimize
- if(s->dsp.sad[1](NULL, ptr_y , dest_y , wrap_y, 8) < 20*s->qscale) skip_dct[0]= 1;
- if(s->dsp.sad[1](NULL, ptr_y + 8, dest_y + 8, wrap_y, 8) < 20*s->qscale) skip_dct[1]= 1;
- if(s->dsp.sad[1](NULL, ptr_y +dct_offset , dest_y +dct_offset , wrap_y, 8) < 20*s->qscale) skip_dct[2]= 1;
- if(s->dsp.sad[1](NULL, ptr_y +dct_offset+ 8, dest_y +dct_offset+ 8, wrap_y, 8) < 20*s->qscale) skip_dct[3]= 1;
- if(s->dsp.sad[1](NULL, ptr_cb , dest_cb , wrap_c, 8) < 20*s->qscale) skip_dct[4]= 1;
- if(s->dsp.sad[1](NULL, ptr_cr , dest_cr , wrap_c, 8) < 20*s->qscale) skip_dct[5]= 1;
- if(!s->chroma_y_shift){ /* 422 */
- if(s->dsp.sad[1](NULL, ptr_cb +(dct_offset>>1), dest_cb +(dct_offset>>1), wrap_c, 8) < 20*s->qscale) skip_dct[6]= 1;
- if(s->dsp.sad[1](NULL, ptr_cr +(dct_offset>>1), dest_cr +(dct_offset>>1), wrap_c, 8) < 20*s->qscale) skip_dct[7]= 1;
- }
- }
- }
-
- if(s->avctx->quantizer_noise_shaping){
- if(!skip_dct[0]) get_vissual_weight(weight[0], ptr_y , wrap_y);
- if(!skip_dct[1]) get_vissual_weight(weight[1], ptr_y + 8, wrap_y);
- if(!skip_dct[2]) get_vissual_weight(weight[2], ptr_y + dct_offset , wrap_y);
- if(!skip_dct[3]) get_vissual_weight(weight[3], ptr_y + dct_offset + 8, wrap_y);
- if(!skip_dct[4]) get_vissual_weight(weight[4], ptr_cb , wrap_c);
- if(!skip_dct[5]) get_vissual_weight(weight[5], ptr_cr , wrap_c);
- if(!s->chroma_y_shift){ /* 422 */
- if(!skip_dct[6]) get_vissual_weight(weight[6], ptr_cb + (dct_offset>>1), wrap_c);
- if(!skip_dct[7]) get_vissual_weight(weight[7], ptr_cr + (dct_offset>>1), wrap_c);
- }
- memcpy(orig[0], s->block[0], sizeof(DCTELEM)*64*mb_block_count);
- }
-
- /* DCT & quantize */
- assert(s->out_format!=FMT_MJPEG || s->qscale==8);
- {
- for(i=0;i<mb_block_count;i++) {
- if(!skip_dct[i]){
- int overflow;
- s->block_last_index[i] = s->dct_quantize(s, s->block[i], i, s->qscale, &overflow);
- // FIXME we could decide to change to quantizer instead of clipping
- // JS: I don't think that would be a good idea it could lower quality instead
- // of improve it. Just INTRADC clipping deserves changes in quantizer
- if (overflow) clip_coeffs(s, s->block[i], s->block_last_index[i]);
- }else
- s->block_last_index[i]= -1;
- }
- if(s->avctx->quantizer_noise_shaping){
- for(i=0;i<mb_block_count;i++) {
- if(!skip_dct[i]){
- s->block_last_index[i] = dct_quantize_refine(s, s->block[i], weight[i], orig[i], i, s->qscale);
- }
- }
- }
-
- if(s->luma_elim_threshold && !s->mb_intra)
- for(i=0; i<4; i++)
- dct_single_coeff_elimination(s, i, s->luma_elim_threshold);
- if(s->chroma_elim_threshold && !s->mb_intra)
- for(i=4; i<mb_block_count; i++)
- dct_single_coeff_elimination(s, i, s->chroma_elim_threshold);
-
- if(s->flags & CODEC_FLAG_CBP_RD){
- for(i=0;i<mb_block_count;i++) {
- if(s->block_last_index[i] == -1)
- s->coded_score[i]= INT_MAX/256;
- }
- }
- }
-
- if((s->flags&CODEC_FLAG_GRAY) && s->mb_intra){
- s->block_last_index[4]=
- s->block_last_index[5]= 0;
- s->block[4][0]=
- s->block[5][0]= (1024 + s->c_dc_scale/2)/ s->c_dc_scale;
- }
-
- //non c quantize code returns incorrect block_last_index FIXME
- if(s->alternate_scan && s->dct_quantize != dct_quantize_c){
- for(i=0; i<mb_block_count; i++){
- int j;
- if(s->block_last_index[i]>0){
- for(j=63; j>0; j--){
- if(s->block[i][ s->intra_scantable.permutated[j] ]) break;
- }
- s->block_last_index[i]= j;
- }
- }
- }
-
- /* huffman encode */
- switch(s->codec_id){ //FIXME funct ptr could be slightly faster
- case CODEC_ID_MPEG1VIDEO:
- case CODEC_ID_MPEG2VIDEO:
- mpeg1_encode_mb(s, s->block, motion_x, motion_y); break;
-/* xine: do not need this for decode or MPEG-1 encoding modes */
-#if 0
- case CODEC_ID_MPEG4:
- mpeg4_encode_mb(s, s->block, motion_x, motion_y); break;
- case CODEC_ID_MSMPEG4V2:
- case CODEC_ID_MSMPEG4V3:
- case CODEC_ID_WMV1:
- msmpeg4_encode_mb(s, s->block, motion_x, motion_y); break;
- case CODEC_ID_WMV2:
- ff_wmv2_encode_mb(s, s->block, motion_x, motion_y); break;
-#ifdef CONFIG_H261_ENCODER
- case CODEC_ID_H261:
- ff_h261_encode_mb(s, s->block, motion_x, motion_y); break;
-#endif
- case CODEC_ID_H263:
- case CODEC_ID_H263P:
- case CODEC_ID_FLV1:
- case CODEC_ID_RV10:
- case CODEC_ID_RV20:
- h263_encode_mb(s, s->block, motion_x, motion_y); break;
- case CODEC_ID_MJPEG:
- mjpeg_encode_mb(s, s->block); break;
-#endif /* #if 0 */
- default:
- assert(0);
- }
-}
-
-static av_always_inline void encode_mb(MpegEncContext *s, int motion_x, int motion_y)
-{
- if (s->chroma_format == CHROMA_420) encode_mb_internal(s, motion_x, motion_y, 8, 6);
- else encode_mb_internal(s, motion_x, motion_y, 16, 8);
-}
-
-#endif //CONFIG_ENCODERS
-
-void ff_mpeg_flush(AVCodecContext *avctx){
- int i;
- MpegEncContext *s = avctx->priv_data;
-
- if(s==NULL || s->picture==NULL)
- return;
-
- for(i=0; i<MAX_PICTURE_COUNT; i++){
- if(s->picture[i].data[0] && ( s->picture[i].type == FF_BUFFER_TYPE_INTERNAL
- || s->picture[i].type == FF_BUFFER_TYPE_USER))
- avctx->release_buffer(avctx, (AVFrame*)&s->picture[i]);
- }
- s->current_picture_ptr = s->last_picture_ptr = s->next_picture_ptr = NULL;
-
- s->mb_x= s->mb_y= 0;
-
- s->parse_context.state= -1;
- s->parse_context.frame_start_found= 0;
- s->parse_context.overread= 0;
- s->parse_context.overread_index= 0;
- s->parse_context.index= 0;
- s->parse_context.last_index= 0;
- s->bitstream_buffer_size=0;
- s->pp_time=0;
-}
-
-#ifdef CONFIG_ENCODERS
-void ff_copy_bits(PutBitContext *pb, uint8_t *src, int length)
-{
- const uint16_t *srcw= (uint16_t*)src;
- int words= length>>4;
- int bits= length&15;
- int i;
-
- if(length==0) return;
-
- if(words < 16){
- for(i=0; i<words; i++) put_bits(pb, 16, be2me_16(srcw[i]));
- }else if(put_bits_count(pb)&7){
- for(i=0; i<words; i++) put_bits(pb, 16, be2me_16(srcw[i]));
- }else{
- for(i=0; put_bits_count(pb)&31; i++)
- put_bits(pb, 8, src[i]);
- flush_put_bits(pb);
- memcpy(pbBufPtr(pb), src+i, 2*words-i);
- skip_put_bytes(pb, 2*words-i);
- }
-
- put_bits(pb, bits, be2me_16(srcw[words])>>(16-bits));
-}
-
-static inline void copy_context_before_encode(MpegEncContext *d, MpegEncContext *s, int type){
- int i;
-
- memcpy(d->last_mv, s->last_mv, 2*2*2*sizeof(int)); //FIXME is memcpy faster then a loop?
-
- /* mpeg1 */
- d->mb_skip_run= s->mb_skip_run;
- for(i=0; i<3; i++)
- d->last_dc[i]= s->last_dc[i];
-
- /* statistics */
- d->mv_bits= s->mv_bits;
- d->i_tex_bits= s->i_tex_bits;
- d->p_tex_bits= s->p_tex_bits;
- d->i_count= s->i_count;
- d->f_count= s->f_count;
- d->b_count= s->b_count;
- d->skip_count= s->skip_count;
- d->misc_bits= s->misc_bits;
- d->last_bits= 0;
-
- d->mb_skipped= 0;
- d->qscale= s->qscale;
- d->dquant= s->dquant;
-}
-
-static inline void copy_context_after_encode(MpegEncContext *d, MpegEncContext *s, int type){
- int i;
-
- memcpy(d->mv, s->mv, 2*4*2*sizeof(int));
- memcpy(d->last_mv, s->last_mv, 2*2*2*sizeof(int)); //FIXME is memcpy faster then a loop?
-
- /* mpeg1 */
- d->mb_skip_run= s->mb_skip_run;
- for(i=0; i<3; i++)
- d->last_dc[i]= s->last_dc[i];
-
- /* statistics */
- d->mv_bits= s->mv_bits;
- d->i_tex_bits= s->i_tex_bits;
- d->p_tex_bits= s->p_tex_bits;
- d->i_count= s->i_count;
- d->f_count= s->f_count;
- d->b_count= s->b_count;
- d->skip_count= s->skip_count;
- d->misc_bits= s->misc_bits;
-
- d->mb_intra= s->mb_intra;
- d->mb_skipped= s->mb_skipped;
- d->mv_type= s->mv_type;
- d->mv_dir= s->mv_dir;
- d->pb= s->pb;
- if(s->data_partitioning){
- d->pb2= s->pb2;
- d->tex_pb= s->tex_pb;
- }
- d->block= s->block;
- for(i=0; i<8; i++)
- d->block_last_index[i]= s->block_last_index[i];
- d->interlaced_dct= s->interlaced_dct;
- d->qscale= s->qscale;
-}
-
-static inline void encode_mb_hq(MpegEncContext *s, MpegEncContext *backup, MpegEncContext *best, int type,
- PutBitContext pb[2], PutBitContext pb2[2], PutBitContext tex_pb[2],
- int *dmin, int *next_block, int motion_x, int motion_y)
-{
- int score;
- uint8_t *dest_backup[3];
-
- copy_context_before_encode(s, backup, type);
-
- s->block= s->blocks[*next_block];
- s->pb= pb[*next_block];
- if(s->data_partitioning){
- s->pb2 = pb2 [*next_block];
- s->tex_pb= tex_pb[*next_block];
- }
-
- if(*next_block){
- memcpy(dest_backup, s->dest, sizeof(s->dest));
- s->dest[0] = s->rd_scratchpad;
- s->dest[1] = s->rd_scratchpad + 16*s->linesize;
- s->dest[2] = s->rd_scratchpad + 16*s->linesize + 8;
- assert(s->linesize >= 32); //FIXME
- }
-
- encode_mb(s, motion_x, motion_y);
-
- score= put_bits_count(&s->pb);
- if(s->data_partitioning){
- score+= put_bits_count(&s->pb2);
- score+= put_bits_count(&s->tex_pb);
- }
-
- if(s->avctx->mb_decision == FF_MB_DECISION_RD){
- MPV_decode_mb(s, s->block);
-
- score *= s->lambda2;
- score += sse_mb(s) << FF_LAMBDA_SHIFT;
- }
-
- if(*next_block){
- memcpy(s->dest, dest_backup, sizeof(s->dest));
- }
-
- if(score<*dmin){
- *dmin= score;
- *next_block^=1;
-
- copy_context_after_encode(best, s, type);
- }
-}
-
-static int sse(MpegEncContext *s, uint8_t *src1, uint8_t *src2, int w, int h, int stride){
- uint32_t *sq = ff_squareTbl + 256;
- int acc=0;
- int x,y;
-
- if(w==16 && h==16)
- return s->dsp.sse[0](NULL, src1, src2, stride, 16);
- else if(w==8 && h==8)
- return s->dsp.sse[1](NULL, src1, src2, stride, 8);
-
- for(y=0; y<h; y++){
- for(x=0; x<w; x++){
- acc+= sq[src1[x + y*stride] - src2[x + y*stride]];
- }
- }
-
- assert(acc>=0);
-
- return acc;
-}
-
-static int sse_mb(MpegEncContext *s){
- int w= 16;
- int h= 16;
-
- if(s->mb_x*16 + 16 > s->width ) w= s->width - s->mb_x*16;
- if(s->mb_y*16 + 16 > s->height) h= s->height- s->mb_y*16;
-
- if(w==16 && h==16)
- if(s->avctx->mb_cmp == FF_CMP_NSSE){
- return s->dsp.nsse[0](s, s->new_picture.data[0] + s->mb_x*16 + s->mb_y*s->linesize*16, s->dest[0], s->linesize, 16)
- +s->dsp.nsse[1](s, s->new_picture.data[1] + s->mb_x*8 + s->mb_y*s->uvlinesize*8,s->dest[1], s->uvlinesize, 8)
- +s->dsp.nsse[1](s, s->new_picture.data[2] + s->mb_x*8 + s->mb_y*s->uvlinesize*8,s->dest[2], s->uvlinesize, 8);
- }else{
- return s->dsp.sse[0](NULL, s->new_picture.data[0] + s->mb_x*16 + s->mb_y*s->linesize*16, s->dest[0], s->linesize, 16)
- +s->dsp.sse[1](NULL, s->new_picture.data[1] + s->mb_x*8 + s->mb_y*s->uvlinesize*8,s->dest[1], s->uvlinesize, 8)
- +s->dsp.sse[1](NULL, s->new_picture.data[2] + s->mb_x*8 + s->mb_y*s->uvlinesize*8,s->dest[2], s->uvlinesize, 8);
- }
- else
- return sse(s, s->new_picture.data[0] + s->mb_x*16 + s->mb_y*s->linesize*16, s->dest[0], w, h, s->linesize)
- +sse(s, s->new_picture.data[1] + s->mb_x*8 + s->mb_y*s->uvlinesize*8,s->dest[1], w>>1, h>>1, s->uvlinesize)
- +sse(s, s->new_picture.data[2] + s->mb_x*8 + s->mb_y*s->uvlinesize*8,s->dest[2], w>>1, h>>1, s->uvlinesize);
-}
-
-/* xine: do not need this for decode or MPEG-1 encoding modes */
-#if 0
-static int pre_estimate_motion_thread(AVCodecContext *c, void *arg){
- MpegEncContext *s= arg;
-
-
- s->me.pre_pass=1;
- s->me.dia_size= s->avctx->pre_dia_size;
- s->first_slice_line=1;
- for(s->mb_y= s->end_mb_y-1; s->mb_y >= s->start_mb_y; s->mb_y--) {
- for(s->mb_x=s->mb_width-1; s->mb_x >=0 ;s->mb_x--) {
- ff_pre_estimate_p_frame_motion(s, s->mb_x, s->mb_y);
- }
- s->first_slice_line=0;
- }
-
- s->me.pre_pass=0;
-
- return 0;
-}
-
-static int estimate_motion_thread(AVCodecContext *c, void *arg){
- MpegEncContext *s= arg;
-
- ff_check_alignment();
-
- s->me.dia_size= s->avctx->dia_size;
- s->first_slice_line=1;
- for(s->mb_y= s->start_mb_y; s->mb_y < s->end_mb_y; s->mb_y++) {
- s->mb_x=0; //for block init below
- ff_init_block_index(s);
- for(s->mb_x=0; s->mb_x < s->mb_width; s->mb_x++) {
- s->block_index[0]+=2;
- s->block_index[1]+=2;
- s->block_index[2]+=2;
- s->block_index[3]+=2;
-
- /* compute motion vector & mb_type and store in context */
- if(s->pict_type==B_TYPE)
- ff_estimate_b_frame_motion(s, s->mb_x, s->mb_y);
- else
- ff_estimate_p_frame_motion(s, s->mb_x, s->mb_y);
- }
- s->first_slice_line=0;
- }
- return 0;
-}
-#endif /* #if 0 */
-
-static int mb_var_thread(AVCodecContext *c, void *arg){
- MpegEncContext *s= arg;
- int mb_x, mb_y;
-
- ff_check_alignment();
-
- for(mb_y=s->start_mb_y; mb_y < s->end_mb_y; mb_y++) {
- for(mb_x=0; mb_x < s->mb_width; mb_x++) {
- int xx = mb_x * 16;
- int yy = mb_y * 16;
- uint8_t *pix = s->new_picture.data[0] + (yy * s->linesize) + xx;
- int varc;
- int sum = s->dsp.pix_sum(pix, s->linesize);
-
- varc = (s->dsp.pix_norm1(pix, s->linesize) - (((unsigned)(sum*sum))>>8) + 500 + 128)>>8;
-
- s->current_picture.mb_var [s->mb_stride * mb_y + mb_x] = varc;
- s->current_picture.mb_mean[s->mb_stride * mb_y + mb_x] = (sum+128)>>8;
- s->me.mb_var_sum_temp += varc;
- }
- }
- return 0;
-}
-
-static void write_slice_end(MpegEncContext *s){
-/* xine: do not need this for decode or MPEG-1 encoding modes */
-#if 0
- if(s->codec_id==CODEC_ID_MPEG4){
- if(s->partitioned_frame){
- ff_mpeg4_merge_partitions(s);
- }
-
- ff_mpeg4_stuffing(&s->pb);
- }else if(s->out_format == FMT_MJPEG){
- ff_mjpeg_stuffing(&s->pb);
- }
-#endif /* #if 0 */
-
- align_put_bits(&s->pb);
- flush_put_bits(&s->pb);
-
- if((s->flags&CODEC_FLAG_PASS1) && !s->partitioned_frame)
- s->misc_bits+= get_bits_diff(s);
-}
-
-static int encode_thread(AVCodecContext *c, void *arg){
- MpegEncContext *s= arg;
- int mb_x, mb_y, pdif = 0;
- int i, j;
- MpegEncContext best_s, backup_s;
- uint8_t bit_buf[2][MAX_MB_BYTES];
- uint8_t bit_buf2[2][MAX_MB_BYTES];
- uint8_t bit_buf_tex[2][MAX_MB_BYTES];
- PutBitContext pb[2], pb2[2], tex_pb[2];
-//printf("%d->%d\n", s->resync_mb_y, s->end_mb_y);
-
- ff_check_alignment();
-
- for(i=0; i<2; i++){
- init_put_bits(&pb [i], bit_buf [i], MAX_MB_BYTES);
- init_put_bits(&pb2 [i], bit_buf2 [i], MAX_MB_BYTES);
- init_put_bits(&tex_pb[i], bit_buf_tex[i], MAX_MB_BYTES);
- }
-
- s->last_bits= put_bits_count(&s->pb);
- s->mv_bits=0;
- s->misc_bits=0;
- s->i_tex_bits=0;
- s->p_tex_bits=0;
- s->i_count=0;
- s->f_count=0;
- s->b_count=0;
- s->skip_count=0;
-
- for(i=0; i<3; i++){
- /* init last dc values */
- /* note: quant matrix value (8) is implied here */
- s->last_dc[i] = 128 << s->intra_dc_precision;
-
- s->current_picture.error[i] = 0;
- }
- s->mb_skip_run = 0;
- memset(s->last_mv, 0, sizeof(s->last_mv));
-
- s->last_mv_dir = 0;
-
- switch(s->codec_id){
- case CODEC_ID_H263:
- case CODEC_ID_H263P:
- case CODEC_ID_FLV1:
- s->gob_index = ff_h263_get_gob_height(s);
- break;
-/* xine: do not need this for decode or MPEG-1 encoding modes */
-#if 0
- case CODEC_ID_MPEG4:
- if(s->partitioned_frame)
- ff_mpeg4_init_partitions(s);
- break;
-#endif /* #if 0 */
- }
-
- s->resync_mb_x=0;
- s->resync_mb_y=0;
- s->first_slice_line = 1;
- s->ptr_lastgob = s->pb.buf;
- for(mb_y= s->start_mb_y; mb_y < s->end_mb_y; mb_y++) {
-// printf("row %d at %X\n", s->mb_y, (int)s);
- s->mb_x=0;
- s->mb_y= mb_y;
-
- ff_set_qscale(s, s->qscale);
- ff_init_block_index(s);
-
- for(mb_x=0; mb_x < s->mb_width; mb_x++) {
- int xy= mb_y*s->mb_stride + mb_x; // removed const, H261 needs to adjust this
- int mb_type= s->mb_type[xy];
-// int d;
- int dmin= INT_MAX;
- int dir;
-
- if(s->pb.buf_end - s->pb.buf - (put_bits_count(&s->pb)>>3) < MAX_MB_BYTES){
- av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n");
- return -1;
- }
- if(s->data_partitioning){
- if( s->pb2 .buf_end - s->pb2 .buf - (put_bits_count(&s-> pb2)>>3) < MAX_MB_BYTES
- || s->tex_pb.buf_end - s->tex_pb.buf - (put_bits_count(&s->tex_pb )>>3) < MAX_MB_BYTES){
- av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n");
- return -1;
- }
- }
-
- s->mb_x = mb_x;
- s->mb_y = mb_y; // moved into loop, can get changed by H.261
- ff_update_block_index(s);
-
-#ifdef CONFIG_H261_ENCODER
- if(s->codec_id == CODEC_ID_H261){
- ff_h261_reorder_mb_index(s);
- xy= s->mb_y*s->mb_stride + s->mb_x;
- mb_type= s->mb_type[xy];
- }
-#endif
-
- /* write gob / video packet header */
- if(s->rtp_mode){
- int current_packet_size, is_gob_start;
-
- current_packet_size= ((put_bits_count(&s->pb)+7)>>3) - (s->ptr_lastgob - s->pb.buf);
-
- is_gob_start= s->avctx->rtp_payload_size && current_packet_size >= s->avctx->rtp_payload_size && mb_y + mb_x>0;
-
- if(s->start_mb_y == mb_y && mb_y > 0 && mb_x==0) is_gob_start=1;
-
- switch(s->codec_id){
- case CODEC_ID_H263:
- case CODEC_ID_H263P:
- if(!s->h263_slice_structured)
- if(s->mb_x || s->mb_y%s->gob_index) is_gob_start=0;
- break;
- case CODEC_ID_MPEG2VIDEO:
- if(s->mb_x==0 && s->mb_y!=0) is_gob_start=1;
- case CODEC_ID_MPEG1VIDEO:
- if(s->mb_skip_run) is_gob_start=0;
- break;
- }
-
- if(is_gob_start){
- if(s->start_mb_y != mb_y || mb_x!=0){
- write_slice_end(s);
-
-/* xine: do not need this for decode or MPEG-1 encoding modes */
-#if 0
- if(s->codec_id==CODEC_ID_MPEG4 && s->partitioned_frame){
- ff_mpeg4_init_partitions(s);
- }
-#endif /* #if 0 */
- }
-
- assert((put_bits_count(&s->pb)&7) == 0);
- current_packet_size= pbBufPtr(&s->pb) - s->ptr_lastgob;
-
- if(s->avctx->error_rate && s->resync_mb_x + s->resync_mb_y > 0){
- int r= put_bits_count(&s->pb)/8 + s->picture_number + 16 + s->mb_x + s->mb_y;
- int d= 100 / s->avctx->error_rate;
- if(r % d == 0){
- current_packet_size=0;
-#ifndef ALT_BITSTREAM_WRITER
- s->pb.buf_ptr= s->ptr_lastgob;
-#endif
- assert(pbBufPtr(&s->pb) == s->ptr_lastgob);
- }
- }
-
- if (s->avctx->rtp_callback){
- int number_mb = (mb_y - s->resync_mb_y)*s->mb_width + mb_x - s->resync_mb_x;
- s->avctx->rtp_callback(s->avctx, s->ptr_lastgob, current_packet_size, number_mb);
- }
-
- switch(s->codec_id){
-/* xine: do not need this for decode or MPEG-1 encoding modes */
-#if 0
- case CODEC_ID_MPEG4:
- ff_mpeg4_encode_video_packet_header(s);
- ff_mpeg4_clean_buffers(s);
- break;
-#endif /* #if 0 */
- case CODEC_ID_MPEG1VIDEO:
- case CODEC_ID_MPEG2VIDEO:
- ff_mpeg1_encode_slice_header(s);
- ff_mpeg1_clean_buffers(s);
- break;
-/* xine: do not need this for decode or MPEG-1 encoding modes */
-#if 0
- case CODEC_ID_H263:
- case CODEC_ID_H263P:
- h263_encode_gob_header(s, mb_y);
- break;
-#endif /* #if 0 */
- }
-
- if(s->flags&CODEC_FLAG_PASS1){
- int bits= put_bits_count(&s->pb);
- s->misc_bits+= bits - s->last_bits;
- s->last_bits= bits;
- }
-
- s->ptr_lastgob += current_packet_size;
- s->first_slice_line=1;
- s->resync_mb_x=mb_x;
- s->resync_mb_y=mb_y;
- }
- }
-
- if( (s->resync_mb_x == s->mb_x)
- && s->resync_mb_y+1 == s->mb_y){
- s->first_slice_line=0;
- }
-
- s->mb_skipped=0;
- s->dquant=0; //only for QP_RD
-
- if(mb_type & (mb_type-1) || (s->flags & CODEC_FLAG_QP_RD)){ // more than 1 MB type possible or CODEC_FLAG_QP_RD
- int next_block=0;
- int pb_bits_count, pb2_bits_count, tex_pb_bits_count;
-
- copy_context_before_encode(&backup_s, s, -1);
- backup_s.pb= s->pb;
- best_s.data_partitioning= s->data_partitioning;
- best_s.partitioned_frame= s->partitioned_frame;
- if(s->data_partitioning){
- backup_s.pb2= s->pb2;
- backup_s.tex_pb= s->tex_pb;
- }
-
- if(mb_type&CANDIDATE_MB_TYPE_INTER){
- s->mv_dir = MV_DIR_FORWARD;
- s->mv_type = MV_TYPE_16X16;
- s->mb_intra= 0;
- s->mv[0][0][0] = s->p_mv_table[xy][0];
- s->mv[0][0][1] = s->p_mv_table[xy][1];
- encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_INTER, pb, pb2, tex_pb,
- &dmin, &next_block, s->mv[0][0][0], s->mv[0][0][1]);
- }
- if(mb_type&CANDIDATE_MB_TYPE_INTER_I){
- s->mv_dir = MV_DIR_FORWARD;
- s->mv_type = MV_TYPE_FIELD;
- s->mb_intra= 0;
- for(i=0; i<2; i++){
- j= s->field_select[0][i] = s->p_field_select_table[i][xy];
- s->mv[0][i][0] = s->p_field_mv_table[i][j][xy][0];
- s->mv[0][i][1] = s->p_field_mv_table[i][j][xy][1];
- }
- encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_INTER_I, pb, pb2, tex_pb,
- &dmin, &next_block, 0, 0);
- }
- if(mb_type&CANDIDATE_MB_TYPE_SKIPPED){
- s->mv_dir = MV_DIR_FORWARD;
- s->mv_type = MV_TYPE_16X16;
- s->mb_intra= 0;
- s->mv[0][0][0] = 0;
- s->mv[0][0][1] = 0;
- encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_SKIPPED, pb, pb2, tex_pb,
- &dmin, &next_block, s->mv[0][0][0], s->mv[0][0][1]);
- }
- if(mb_type&CANDIDATE_MB_TYPE_INTER4V){
- s->mv_dir = MV_DIR_FORWARD;
- s->mv_type = MV_TYPE_8X8;
- s->mb_intra= 0;
- for(i=0; i<4; i++){
- s->mv[0][i][0] = s->current_picture.motion_val[0][s->block_index[i]][0];
- s->mv[0][i][1] = s->current_picture.motion_val[0][s->block_index[i]][1];
- }
- encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_INTER4V, pb, pb2, tex_pb,
- &dmin, &next_block, 0, 0);
- }
- if(mb_type&CANDIDATE_MB_TYPE_FORWARD){
- s->mv_dir = MV_DIR_FORWARD;
- s->mv_type = MV_TYPE_16X16;
- s->mb_intra= 0;
- s->mv[0][0][0] = s->b_forw_mv_table[xy][0];
- s->mv[0][0][1] = s->b_forw_mv_table[xy][1];
- encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_FORWARD, pb, pb2, tex_pb,
- &dmin, &next_block, s->mv[0][0][0], s->mv[0][0][1]);
- }
- if(mb_type&CANDIDATE_MB_TYPE_BACKWARD){
- s->mv_dir = MV_DIR_BACKWARD;
- s->mv_type = MV_TYPE_16X16;
- s->mb_intra= 0;
- s->mv[1][0][0] = s->b_back_mv_table[xy][0];
- s->mv[1][0][1] = s->b_back_mv_table[xy][1];
- encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_BACKWARD, pb, pb2, tex_pb,
- &dmin, &next_block, s->mv[1][0][0], s->mv[1][0][1]);
- }
- if(mb_type&CANDIDATE_MB_TYPE_BIDIR){
- s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD;
- s->mv_type = MV_TYPE_16X16;
- s->mb_intra= 0;
- s->mv[0][0][0] = s->b_bidir_forw_mv_table[xy][0];
- s->mv[0][0][1] = s->b_bidir_forw_mv_table[xy][1];
- s->mv[1][0][0] = s->b_bidir_back_mv_table[xy][0];
- s->mv[1][0][1] = s->b_bidir_back_mv_table[xy][1];
- encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_BIDIR, pb, pb2, tex_pb,
- &dmin, &next_block, 0, 0);
- }
- if(mb_type&CANDIDATE_MB_TYPE_FORWARD_I){
- s->mv_dir = MV_DIR_FORWARD;
- s->mv_type = MV_TYPE_FIELD;
- s->mb_intra= 0;
- for(i=0; i<2; i++){
- j= s->field_select[0][i] = s->b_field_select_table[0][i][xy];
- s->mv[0][i][0] = s->b_field_mv_table[0][i][j][xy][0];
- s->mv[0][i][1] = s->b_field_mv_table[0][i][j][xy][1];
- }
- encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_FORWARD_I, pb, pb2, tex_pb,
- &dmin, &next_block, 0, 0);
- }
- if(mb_type&CANDIDATE_MB_TYPE_BACKWARD_I){
- s->mv_dir = MV_DIR_BACKWARD;
- s->mv_type = MV_TYPE_FIELD;
- s->mb_intra= 0;
- for(i=0; i<2; i++){
- j= s->field_select[1][i] = s->b_field_select_table[1][i][xy];
- s->mv[1][i][0] = s->b_field_mv_table[1][i][j][xy][0];
- s->mv[1][i][1] = s->b_field_mv_table[1][i][j][xy][1];
- }
- encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_BACKWARD_I, pb, pb2, tex_pb,
- &dmin, &next_block, 0, 0);
- }
- if(mb_type&CANDIDATE_MB_TYPE_BIDIR_I){
- s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD;
- s->mv_type = MV_TYPE_FIELD;
- s->mb_intra= 0;
- for(dir=0; dir<2; dir++){
- for(i=0; i<2; i++){
- j= s->field_select[dir][i] = s->b_field_select_table[dir][i][xy];
- s->mv[dir][i][0] = s->b_field_mv_table[dir][i][j][xy][0];
- s->mv[dir][i][1] = s->b_field_mv_table[dir][i][j][xy][1];
- }
- }
- encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_BIDIR_I, pb, pb2, tex_pb,
- &dmin, &next_block, 0, 0);
- }
- if(mb_type&CANDIDATE_MB_TYPE_INTRA){
- s->mv_dir = 0;
- s->mv_type = MV_TYPE_16X16;
- s->mb_intra= 1;
- s->mv[0][0][0] = 0;
- s->mv[0][0][1] = 0;
- encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_INTRA, pb, pb2, tex_pb,
- &dmin, &next_block, 0, 0);
- if(s->h263_pred || s->h263_aic){
- if(best_s.mb_intra)
- s->mbintra_table[mb_x + mb_y*s->mb_stride]=1;
- else
- ff_clean_intra_table_entries(s); //old mode?
- }
- }
-
- if((s->flags & CODEC_FLAG_QP_RD) && dmin < INT_MAX){
- if(best_s.mv_type==MV_TYPE_16X16){ //FIXME move 4mv after QPRD
- const int last_qp= backup_s.qscale;
- int qpi, qp, dc[6];
- DCTELEM ac[6][16];
- const int mvdir= (best_s.mv_dir&MV_DIR_BACKWARD) ? 1 : 0;
- static const int dquant_tab[4]={-1,1,-2,2};
-
- assert(backup_s.dquant == 0);
-
- //FIXME intra
- s->mv_dir= best_s.mv_dir;
- s->mv_type = MV_TYPE_16X16;
- s->mb_intra= best_s.mb_intra;
- s->mv[0][0][0] = best_s.mv[0][0][0];
- s->mv[0][0][1] = best_s.mv[0][0][1];
- s->mv[1][0][0] = best_s.mv[1][0][0];
- s->mv[1][0][1] = best_s.mv[1][0][1];
-
- qpi = s->pict_type == B_TYPE ? 2 : 0;
- for(; qpi<4; qpi++){
- int dquant= dquant_tab[qpi];
- qp= last_qp + dquant;
- if(qp < s->avctx->qmin || qp > s->avctx->qmax)
- continue;
- backup_s.dquant= dquant;
- if(s->mb_intra && s->dc_val[0]){
- for(i=0; i<6; i++){
- dc[i]= s->dc_val[0][ s->block_index[i] ];
- memcpy(ac[i], s->ac_val[0][s->block_index[i]], sizeof(DCTELEM)*16);
- }
- }
-
- encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_INTER /* wrong but unused */, pb, pb2, tex_pb,
- &dmin, &next_block, s->mv[mvdir][0][0], s->mv[mvdir][0][1]);
- if(best_s.qscale != qp){
- if(s->mb_intra && s->dc_val[0]){
- for(i=0; i<6; i++){
- s->dc_val[0][ s->block_index[i] ]= dc[i];
- memcpy(s->ac_val[0][s->block_index[i]], ac[i], sizeof(DCTELEM)*16);
- }
- }
- }
- }
- }
- }
- if(mb_type&CANDIDATE_MB_TYPE_DIRECT){
- int mx= s->b_direct_mv_table[xy][0];
- int my= s->b_direct_mv_table[xy][1];
-
- backup_s.dquant = 0;
- s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD | MV_DIRECT;
- s->mb_intra= 0;
- ff_mpeg4_set_direct_mv(s, mx, my);
- encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_DIRECT, pb, pb2, tex_pb,
- &dmin, &next_block, mx, my);
- }
- if(mb_type&CANDIDATE_MB_TYPE_DIRECT0){
- backup_s.dquant = 0;
- s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD | MV_DIRECT;
- s->mb_intra= 0;
-/* xine: do not need this for decode or MPEG-1 encoding modes */
-#if 0
- ff_mpeg4_set_direct_mv(s, 0, 0);
-#endif /* #if 0 */
- encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_DIRECT, pb, pb2, tex_pb,
- &dmin, &next_block, 0, 0);
- }
- if(!best_s.mb_intra && s->flags2&CODEC_FLAG2_SKIP_RD){
- int coded=0;
- for(i=0; i<6; i++)
- coded |= s->block_last_index[i];
- if(coded){
- int mx,my;
- memcpy(s->mv, best_s.mv, sizeof(s->mv));
- if(best_s.mv_dir & MV_DIRECT){
- mx=my=0; //FIXME find the one we actually used
- ff_mpeg4_set_direct_mv(s, mx, my);
- }else if(best_s.mv_dir&MV_DIR_BACKWARD){
- mx= s->mv[1][0][0];
- my= s->mv[1][0][1];
- }else{
- mx= s->mv[0][0][0];
- my= s->mv[0][0][1];
- }
-
- s->mv_dir= best_s.mv_dir;
- s->mv_type = best_s.mv_type;
- s->mb_intra= 0;
-/* s->mv[0][0][0] = best_s.mv[0][0][0];
- s->mv[0][0][1] = best_s.mv[0][0][1];
- s->mv[1][0][0] = best_s.mv[1][0][0];
- s->mv[1][0][1] = best_s.mv[1][0][1];*/
- backup_s.dquant= 0;
- s->skipdct=1;
- encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_INTER /* wrong but unused */, pb, pb2, tex_pb,
- &dmin, &next_block, mx, my);
- s->skipdct=0;
- }
- }
-
- s->current_picture.qscale_table[xy]= best_s.qscale;
-
- copy_context_after_encode(s, &best_s, -1);
-
- pb_bits_count= put_bits_count(&s->pb);
- flush_put_bits(&s->pb);
- ff_copy_bits(&backup_s.pb, bit_buf[next_block^1], pb_bits_count);
- s->pb= backup_s.pb;
-
- if(s->data_partitioning){
- pb2_bits_count= put_bits_count(&s->pb2);
- flush_put_bits(&s->pb2);
- ff_copy_bits(&backup_s.pb2, bit_buf2[next_block^1], pb2_bits_count);
- s->pb2= backup_s.pb2;
-
- tex_pb_bits_count= put_bits_count(&s->tex_pb);
- flush_put_bits(&s->tex_pb);
- ff_copy_bits(&backup_s.tex_pb, bit_buf_tex[next_block^1], tex_pb_bits_count);
- s->tex_pb= backup_s.tex_pb;
- }
- s->last_bits= put_bits_count(&s->pb);
-
- if (s->out_format == FMT_H263 && s->pict_type!=B_TYPE)
- ff_h263_update_motion_val(s);
-
- if(next_block==0){ //FIXME 16 vs linesize16
- s->dsp.put_pixels_tab[0][0](s->dest[0], s->rd_scratchpad , s->linesize ,16);
- s->dsp.put_pixels_tab[1][0](s->dest[1], s->rd_scratchpad + 16*s->linesize , s->uvlinesize, 8);
- s->dsp.put_pixels_tab[1][0](s->dest[2], s->rd_scratchpad + 16*s->linesize + 8, s->uvlinesize, 8);
- }
-
- if(s->avctx->mb_decision == FF_MB_DECISION_BITS)
- MPV_decode_mb(s, s->block);
- } else {
- int motion_x = 0, motion_y = 0;
- s->mv_type=MV_TYPE_16X16;
- // only one MB-Type possible
-
- switch(mb_type){
- case CANDIDATE_MB_TYPE_INTRA:
- s->mv_dir = 0;
- s->mb_intra= 1;
- motion_x= s->mv[0][0][0] = 0;
- motion_y= s->mv[0][0][1] = 0;
- break;
- case CANDIDATE_MB_TYPE_INTER:
- s->mv_dir = MV_DIR_FORWARD;
- s->mb_intra= 0;
- motion_x= s->mv[0][0][0] = s->p_mv_table[xy][0];
- motion_y= s->mv[0][0][1] = s->p_mv_table[xy][1];
- break;
- case CANDIDATE_MB_TYPE_INTER_I:
- s->mv_dir = MV_DIR_FORWARD;
- s->mv_type = MV_TYPE_FIELD;
- s->mb_intra= 0;
- for(i=0; i<2; i++){
- j= s->field_select[0][i] = s->p_field_select_table[i][xy];
- s->mv[0][i][0] = s->p_field_mv_table[i][j][xy][0];
- s->mv[0][i][1] = s->p_field_mv_table[i][j][xy][1];
- }
- break;
- case CANDIDATE_MB_TYPE_INTER4V:
- s->mv_dir = MV_DIR_FORWARD;
- s->mv_type = MV_TYPE_8X8;
- s->mb_intra= 0;
- for(i=0; i<4; i++){
- s->mv[0][i][0] = s->current_picture.motion_val[0][s->block_index[i]][0];
- s->mv[0][i][1] = s->current_picture.motion_val[0][s->block_index[i]][1];
- }
- break;
- case CANDIDATE_MB_TYPE_DIRECT:
- s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD | MV_DIRECT;
- s->mb_intra= 0;
- motion_x=s->b_direct_mv_table[xy][0];
- motion_y=s->b_direct_mv_table[xy][1];
-/* xine: do not need this for decode or MPEG-1 encoding modes */
-#if 0
- ff_mpeg4_set_direct_mv(s, motion_x, motion_y);
-#endif /* #if 0 */
- break;
- case CANDIDATE_MB_TYPE_DIRECT0:
- s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD | MV_DIRECT;
- s->mb_intra= 0;
- ff_mpeg4_set_direct_mv(s, 0, 0);
- break;
- case CANDIDATE_MB_TYPE_BIDIR:
- s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD;
- s->mb_intra= 0;
- s->mv[0][0][0] = s->b_bidir_forw_mv_table[xy][0];
- s->mv[0][0][1] = s->b_bidir_forw_mv_table[xy][1];
- s->mv[1][0][0] = s->b_bidir_back_mv_table[xy][0];
- s->mv[1][0][1] = s->b_bidir_back_mv_table[xy][1];
- break;
- case CANDIDATE_MB_TYPE_BACKWARD:
- s->mv_dir = MV_DIR_BACKWARD;
- s->mb_intra= 0;
- motion_x= s->mv[1][0][0] = s->b_back_mv_table[xy][0];
- motion_y= s->mv[1][0][1] = s->b_back_mv_table[xy][1];
- break;
- case CANDIDATE_MB_TYPE_FORWARD:
- s->mv_dir = MV_DIR_FORWARD;
- s->mb_intra= 0;
- motion_x= s->mv[0][0][0] = s->b_forw_mv_table[xy][0];
- motion_y= s->mv[0][0][1] = s->b_forw_mv_table[xy][1];
-// printf(" %d %d ", motion_x, motion_y);
- break;
- case CANDIDATE_MB_TYPE_FORWARD_I:
- s->mv_dir = MV_DIR_FORWARD;
- s->mv_type = MV_TYPE_FIELD;
- s->mb_intra= 0;
- for(i=0; i<2; i++){
- j= s->field_select[0][i] = s->b_field_select_table[0][i][xy];
- s->mv[0][i][0] = s->b_field_mv_table[0][i][j][xy][0];
- s->mv[0][i][1] = s->b_field_mv_table[0][i][j][xy][1];
- }
- break;
- case CANDIDATE_MB_TYPE_BACKWARD_I:
- s->mv_dir = MV_DIR_BACKWARD;
- s->mv_type = MV_TYPE_FIELD;
- s->mb_intra= 0;
- for(i=0; i<2; i++){
- j= s->field_select[1][i] = s->b_field_select_table[1][i][xy];
- s->mv[1][i][0] = s->b_field_mv_table[1][i][j][xy][0];
- s->mv[1][i][1] = s->b_field_mv_table[1][i][j][xy][1];
- }
- break;
- case CANDIDATE_MB_TYPE_BIDIR_I:
- s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD;
- s->mv_type = MV_TYPE_FIELD;
- s->mb_intra= 0;
- for(dir=0; dir<2; dir++){
- for(i=0; i<2; i++){
- j= s->field_select[dir][i] = s->b_field_select_table[dir][i][xy];
- s->mv[dir][i][0] = s->b_field_mv_table[dir][i][j][xy][0];
- s->mv[dir][i][1] = s->b_field_mv_table[dir][i][j][xy][1];
- }
- }
- break;
- default:
- av_log(s->avctx, AV_LOG_ERROR, "illegal MB type\n");
- }
-
- encode_mb(s, motion_x, motion_y);
-
- // RAL: Update last macroblock type
- s->last_mv_dir = s->mv_dir;
-
- if (s->out_format == FMT_H263 && s->pict_type!=B_TYPE)
- ff_h263_update_motion_val(s);
-
- MPV_decode_mb(s, s->block);
- }
-
- /* clean the MV table in IPS frames for direct mode in B frames */
- if(s->mb_intra /* && I,P,S_TYPE */){
- s->p_mv_table[xy][0]=0;
- s->p_mv_table[xy][1]=0;
- }
-
- if(s->flags&CODEC_FLAG_PSNR){
- int w= 16;
- int h= 16;
-
- if(s->mb_x*16 + 16 > s->width ) w= s->width - s->mb_x*16;
- if(s->mb_y*16 + 16 > s->height) h= s->height- s->mb_y*16;
-
- s->current_picture.error[0] += sse(
- s, s->new_picture.data[0] + s->mb_x*16 + s->mb_y*s->linesize*16,
- s->dest[0], w, h, s->linesize);
- s->current_picture.error[1] += sse(
- s, s->new_picture.data[1] + s->mb_x*8 + s->mb_y*s->uvlinesize*8,
- s->dest[1], w>>1, h>>1, s->uvlinesize);
- s->current_picture.error[2] += sse(
- s, s->new_picture .data[2] + s->mb_x*8 + s->mb_y*s->uvlinesize*8,
- s->dest[2], w>>1, h>>1, s->uvlinesize);
- }
- if(s->loop_filter){
- if(s->out_format == FMT_H263)
- ff_h263_loop_filter(s);
- }
-//printf("MB %d %d bits\n", s->mb_x+s->mb_y*s->mb_stride, put_bits_count(&s->pb));
- }
- }
-
- //not beautiful here but we must write it before flushing so it has to be here
-/* xine: do not need this for decode or MPEG-1 encoding modes */
-#if 0
- if (s->msmpeg4_version && s->msmpeg4_version<4 && s->pict_type == I_TYPE)
- msmpeg4_encode_ext_header(s);
-#endif /* #if 0 */
-
- write_slice_end(s);
-
- /* Send the last GOB if RTP */
- if (s->avctx->rtp_callback) {
- int number_mb = (mb_y - s->resync_mb_y)*s->mb_width - s->resync_mb_x;
- pdif = pbBufPtr(&s->pb) - s->ptr_lastgob;
- /* Call the RTP callback to send the last GOB */
- emms_c();
- s->avctx->rtp_callback(s->avctx, s->ptr_lastgob, pdif, number_mb);
- }
-
- return 0;
-}
-
-#define MERGE(field) dst->field += src->field; src->field=0
-static void merge_context_after_me(MpegEncContext *dst, MpegEncContext *src){
- MERGE(me.scene_change_score);
- MERGE(me.mc_mb_var_sum_temp);
- MERGE(me.mb_var_sum_temp);
-}
-
-static void merge_context_after_encode(MpegEncContext *dst, MpegEncContext *src){
- int i;
-
- MERGE(dct_count[0]); //note, the other dct vars are not part of the context
- MERGE(dct_count[1]);
- MERGE(mv_bits);
- MERGE(i_tex_bits);
- MERGE(p_tex_bits);
- MERGE(i_count);
- MERGE(f_count);
- MERGE(b_count);
- MERGE(skip_count);
- MERGE(misc_bits);
- MERGE(error_count);
- MERGE(padding_bug_score);
- MERGE(current_picture.error[0]);
- MERGE(current_picture.error[1]);
- MERGE(current_picture.error[2]);
-
- if(dst->avctx->noise_reduction){
- for(i=0; i<64; i++){
- MERGE(dct_error_sum[0][i]);
- MERGE(dct_error_sum[1][i]);
- }
- }
-
- assert(put_bits_count(&src->pb) % 8 ==0);
- assert(put_bits_count(&dst->pb) % 8 ==0);
- ff_copy_bits(&dst->pb, src->pb.buf, put_bits_count(&src->pb));
- flush_put_bits(&dst->pb);
-}
-
-static int estimate_qp(MpegEncContext *s, int dry_run){
- if (s->next_lambda){
- s->current_picture_ptr->quality=
- s->current_picture.quality = s->next_lambda;
- if(!dry_run) s->next_lambda= 0;
- } else if (!s->fixed_qscale) {
- s->current_picture_ptr->quality=
- s->current_picture.quality = ff_rate_estimate_qscale(s, dry_run);
- if (s->current_picture.quality < 0)
- return -1;
- }
-
- if(s->adaptive_quant){
-/* xine: do not need this for decode or MPEG-1 encoding modes */
-#if 0
- switch(s->codec_id){
- case CODEC_ID_MPEG4:
- ff_clean_mpeg4_qscales(s);
- break;
- case CODEC_ID_H263:
- case CODEC_ID_H263P:
- case CODEC_ID_FLV1:
- ff_clean_h263_qscales(s);
- break;
- }
-#endif /* #if 0 */
-
- s->lambda= s->lambda_table[0];
- //FIXME broken
- }else
- s->lambda= s->current_picture.quality;
-//printf("%d %d\n", s->avctx->global_quality, s->current_picture.quality);
- update_qscale(s);
- return 0;
-}
-
-static int encode_picture(MpegEncContext *s, int picture_number)
-{
- int i;
- int bits;
-
- s->picture_number = picture_number;
-
- /* Reset the average MB variance */
- s->me.mb_var_sum_temp =
- s->me.mc_mb_var_sum_temp = 0;
-
-/* xine: do not need this for decode or MPEG-1 encoding modes */
-#if 0
- /* we need to initialize some time vars before we can encode b-frames */
- // RAL: Condition added for MPEG1VIDEO
- if (s->codec_id == CODEC_ID_MPEG1VIDEO || s->codec_id == CODEC_ID_MPEG2VIDEO || (s->h263_pred && !s->h263_msmpeg4))
- ff_set_mpeg4_time(s, s->picture_number); //FIXME rename and use has_b_frames or similar
-#endif /* #if 0 */
-
- s->me.scene_change_score=0;
-
-// s->lambda= s->current_picture_ptr->quality; //FIXME qscale / ... stuff for ME ratedistoration
-
- if(s->pict_type==I_TYPE){
- if(s->msmpeg4_version >= 3) s->no_rounding=1;
- else s->no_rounding=0;
- }else if(s->pict_type!=B_TYPE){
- if(s->flipflop_rounding || s->codec_id == CODEC_ID_H263P || s->codec_id == CODEC_ID_MPEG4)
- s->no_rounding ^= 1;
- }
-
- if(s->flags & CODEC_FLAG_PASS2){
- if (estimate_qp(s,1) < 0)
- return -1;
- ff_get_2pass_fcode(s);
- }else if(!(s->flags & CODEC_FLAG_QSCALE)){
- if(s->pict_type==B_TYPE)
- s->lambda= s->last_lambda_for[s->pict_type];
- else
- s->lambda= s->last_lambda_for[s->last_non_b_pict_type];
- update_qscale(s);
- }
-
- s->mb_intra=0; //for the rate distortion & bit compare functions
- for(i=1; i<s->avctx->thread_count; i++){
- ff_update_duplicate_context(s->thread_context[i], s);
- }
-
-/* xine: do not need this for decode or MPEG-1 encoding modes */
-#if 0
- ff_init_me(s);
-
- /* Estimate motion for every MB */
- if(s->pict_type != I_TYPE){
- s->lambda = (s->lambda * s->avctx->me_penalty_compensation + 128)>>8;
- s->lambda2= (s->lambda2* (int64_t)s->avctx->me_penalty_compensation + 128)>>8;
- if(s->pict_type != B_TYPE && s->avctx->me_threshold==0){
- if((s->avctx->pre_me && s->last_non_b_pict_type==I_TYPE) || s->avctx->pre_me==2){
- s->avctx->execute(s->avctx, pre_estimate_motion_thread, (void**)&(s->thread_context[0]), NULL, s->avctx->thread_count);
- }
- }
-
- s->avctx->execute(s->avctx, estimate_motion_thread, (void**)&(s->thread_context[0]), NULL, s->avctx->thread_count);
- }else /* if(s->pict_type == I_TYPE) */{
-#endif /* #if 0 */
- {
- /* I-Frame */
- for(i=0; i<s->mb_stride*s->mb_height; i++)
- s->mb_type[i]= CANDIDATE_MB_TYPE_INTRA;
-
- if(!s->fixed_qscale){
- /* finding spatial complexity for I-frame rate control */
- s->avctx->execute(s->avctx, mb_var_thread, (void**)&(s->thread_context[0]), NULL, s->avctx->thread_count);
- }
- }
- for(i=1; i<s->avctx->thread_count; i++){
- merge_context_after_me(s, s->thread_context[i]);
- }
- s->current_picture.mc_mb_var_sum= s->current_picture_ptr->mc_mb_var_sum= s->me.mc_mb_var_sum_temp;
- s->current_picture. mb_var_sum= s->current_picture_ptr-> mb_var_sum= s->me. mb_var_sum_temp;
- emms_c();
-
- if(s->me.scene_change_score > s->avctx->scenechange_threshold && s->pict_type == P_TYPE){
- s->pict_type= I_TYPE;
- for(i=0; i<s->mb_stride*s->mb_height; i++)
- s->mb_type[i]= CANDIDATE_MB_TYPE_INTRA;
-//printf("Scene change detected, encoding as I Frame %d %d\n", s->current_picture.mb_var_sum, s->current_picture.mc_mb_var_sum);
- }
-
-/* xine: do not need this for decode or MPEG-1 encoding modes */
-#if 0
- if(!s->umvplus){
- if(s->pict_type==P_TYPE || s->pict_type==S_TYPE) {
- s->f_code= ff_get_best_fcode(s, s->p_mv_table, CANDIDATE_MB_TYPE_INTER);
-
- if(s->flags & CODEC_FLAG_INTERLACED_ME){
- int a,b;
- a= ff_get_best_fcode(s, s->p_field_mv_table[0][0], CANDIDATE_MB_TYPE_INTER_I); //FIXME field_select
- b= ff_get_best_fcode(s, s->p_field_mv_table[1][1], CANDIDATE_MB_TYPE_INTER_I);
- s->f_code= FFMAX(s->f_code, FFMAX(a,b));
- }
-
- ff_fix_long_p_mvs(s);
- ff_fix_long_mvs(s, NULL, 0, s->p_mv_table, s->f_code, CANDIDATE_MB_TYPE_INTER, 0);
- if(s->flags & CODEC_FLAG_INTERLACED_ME){
- int j;
- for(i=0; i<2; i++){
- for(j=0; j<2; j++)
- ff_fix_long_mvs(s, s->p_field_select_table[i], j,
- s->p_field_mv_table[i][j], s->f_code, CANDIDATE_MB_TYPE_INTER_I, 0);
- }
- }
- }
-
- if(s->pict_type==B_TYPE){
- int a, b;
-
- a = ff_get_best_fcode(s, s->b_forw_mv_table, CANDIDATE_MB_TYPE_FORWARD);
- b = ff_get_best_fcode(s, s->b_bidir_forw_mv_table, CANDIDATE_MB_TYPE_BIDIR);
- s->f_code = FFMAX(a, b);
-
- a = ff_get_best_fcode(s, s->b_back_mv_table, CANDIDATE_MB_TYPE_BACKWARD);
- b = ff_get_best_fcode(s, s->b_bidir_back_mv_table, CANDIDATE_MB_TYPE_BIDIR);
- s->b_code = FFMAX(a, b);
-
- ff_fix_long_mvs(s, NULL, 0, s->b_forw_mv_table, s->f_code, CANDIDATE_MB_TYPE_FORWARD, 1);
- ff_fix_long_mvs(s, NULL, 0, s->b_back_mv_table, s->b_code, CANDIDATE_MB_TYPE_BACKWARD, 1);
- ff_fix_long_mvs(s, NULL, 0, s->b_bidir_forw_mv_table, s->f_code, CANDIDATE_MB_TYPE_BIDIR, 1);
- ff_fix_long_mvs(s, NULL, 0, s->b_bidir_back_mv_table, s->b_code, CANDIDATE_MB_TYPE_BIDIR, 1);
- if(s->flags & CODEC_FLAG_INTERLACED_ME){
- int dir, j;
- for(dir=0; dir<2; dir++){
- for(i=0; i<2; i++){
- for(j=0; j<2; j++){
- int type= dir ? (CANDIDATE_MB_TYPE_BACKWARD_I|CANDIDATE_MB_TYPE_BIDIR_I)
- : (CANDIDATE_MB_TYPE_FORWARD_I |CANDIDATE_MB_TYPE_BIDIR_I);
- ff_fix_long_mvs(s, s->b_field_select_table[dir][i], j,
- s->b_field_mv_table[dir][i][j], dir ? s->b_code : s->f_code, type, 1);
- }
- }
- }
- }
- }
- }
-#endif /* #if 0 */
-
- if (estimate_qp(s, 0) < 0)
- return -1;
-
- if(s->qscale < 3 && s->max_qcoeff<=128 && s->pict_type==I_TYPE && !(s->flags & CODEC_FLAG_QSCALE))
- s->qscale= 3; //reduce clipping problems
-
- if (s->out_format == FMT_MJPEG) {
- /* for mjpeg, we do include qscale in the matrix */
- s->intra_matrix[0] = ff_mpeg1_default_intra_matrix[0];
- for(i=1;i<64;i++){
- int j= s->dsp.idct_permutation[i];
-
- s->intra_matrix[j] = clip_uint8((ff_mpeg1_default_intra_matrix[i] * s->qscale) >> 3);
- }
- convert_matrix(&s->dsp, s->q_intra_matrix, s->q_intra_matrix16,
- s->intra_matrix, s->intra_quant_bias, 8, 8, 1);
- s->qscale= 8;
- }
-
- //FIXME var duplication
- s->current_picture_ptr->key_frame=
- s->current_picture.key_frame= s->pict_type == I_TYPE; //FIXME pic_ptr
- s->current_picture_ptr->pict_type=
- s->current_picture.pict_type= s->pict_type;
-
- if(s->current_picture.key_frame)
- s->picture_in_gop_number=0;
-
- s->last_bits= put_bits_count(&s->pb);
- switch(s->out_format) {
-/* xine: do not need this for decode or MPEG-1 encoding modes */
-#if 0
- case FMT_MJPEG:
- mjpeg_picture_header(s);
- break;
-#ifdef CONFIG_H261_ENCODER
- case FMT_H261:
- ff_h261_encode_picture_header(s, picture_number);
- break;
-#endif
- case FMT_H263:
- if (s->codec_id == CODEC_ID_WMV2)
- ff_wmv2_encode_picture_header(s, picture_number);
- else if (s->h263_msmpeg4)
- msmpeg4_encode_picture_header(s, picture_number);
- else if (s->h263_pred)
- mpeg4_encode_picture_header(s, picture_number);
-#ifdef CONFIG_RV10_ENCODER
- else if (s->codec_id == CODEC_ID_RV10)
- rv10_encode_picture_header(s, picture_number);
-#endif
-#ifdef CONFIG_RV20_ENCODER
- else if (s->codec_id == CODEC_ID_RV20)
- rv20_encode_picture_header(s, picture_number);
-#endif
- else if (s->codec_id == CODEC_ID_FLV1)
- ff_flv_encode_picture_header(s, picture_number);
- else
- h263_encode_picture_header(s, picture_number);
- break;
-#endif /* #if 0 */
- case FMT_MPEG1:
- mpeg1_encode_picture_header(s, picture_number);
- break;
-/* xine: do not need this for decode or MPEG-1 encoding modes */
-#if 0
- case FMT_H264:
- break;
-#endif /* #if 0 */
- default:
- assert(0);
- }
- bits= put_bits_count(&s->pb);
- s->header_bits= bits - s->last_bits;
-
- for(i=1; i<s->avctx->thread_count; i++){
- update_duplicate_context_after_me(s->thread_context[i], s);
- }
- s->avctx->execute(s->avctx, encode_thread, (void**)&(s->thread_context[0]), NULL, s->avctx->thread_count);
- for(i=1; i<s->avctx->thread_count; i++){
- merge_context_after_encode(s, s->thread_context[i]);
- }
- emms_c();
- return 0;
-}
-
-static void denoise_dct_c(MpegEncContext *s, DCTELEM *block){
- const int intra= s->mb_intra;
- int i;
-
- s->dct_count[intra]++;
-
- for(i=0; i<64; i++){
- int level= block[i];
-
- if(level){
- if(level>0){
- s->dct_error_sum[intra][i] += level;
- level -= s->dct_offset[intra][i];
- if(level<0) level=0;
- }else{
- s->dct_error_sum[intra][i] -= level;
- level += s->dct_offset[intra][i];
- if(level>0) level=0;
- }
- block[i]= level;
- }
- }
-}
-
-static int dct_quantize_trellis_c(MpegEncContext *s,
- DCTELEM *block, int n,
- int qscale, int *overflow){
- const int *qmat;
- const uint8_t *scantable= s->intra_scantable.scantable;
- const uint8_t *perm_scantable= s->intra_scantable.permutated;
- int max=0;
- unsigned int threshold1, threshold2;
- int bias=0;
- int run_tab[65];
- int level_tab[65];
- int score_tab[65];
- int survivor[65];
- int survivor_count;
- int last_run=0;
- int last_level=0;
- int last_score= 0;
- int last_i;
- int coeff[2][64];
- int coeff_count[64];
- int qmul, qadd, start_i, last_non_zero, i, dc;
- const int esc_length= s->ac_esc_length;
- uint8_t * length;
- uint8_t * last_length;
- const int lambda= s->lambda2 >> (FF_LAMBDA_SHIFT - 6);
-
- s->dsp.fdct (block);
-
- if(s->dct_error_sum)
- s->denoise_dct(s, block);
- qmul= qscale*16;
- qadd= ((qscale-1)|1)*8;
-
- if (s->mb_intra) {
- int q;
- if (!s->h263_aic) {
- if (n < 4)
- q = s->y_dc_scale;
- else
- q = s->c_dc_scale;
- q = q << 3;
- } else{
- /* For AIC we skip quant/dequant of INTRADC */
- q = 1 << 3;
- qadd=0;
- }
-
- /* note: block[0] is assumed to be positive */
- block[0] = (block[0] + (q >> 1)) / q;
- start_i = 1;
- last_non_zero = 0;
- qmat = s->q_intra_matrix[qscale];
- if(s->mpeg_quant || s->out_format == FMT_MPEG1)
- bias= 1<<(QMAT_SHIFT-1);
- length = s->intra_ac_vlc_length;
- last_length= s->intra_ac_vlc_last_length;
- } else {
- start_i = 0;
- last_non_zero = -1;
- qmat = s->q_inter_matrix[qscale];
- length = s->inter_ac_vlc_length;
- last_length= s->inter_ac_vlc_last_length;
- }
- last_i= start_i;
-
- threshold1= (1<<QMAT_SHIFT) - bias - 1;
- threshold2= (threshold1<<1);
-
- for(i=63; i>=start_i; i--) {
- const int j = scantable[i];
- int level = block[j] * qmat[j];
-
- if(((unsigned)(level+threshold1))>threshold2){
- last_non_zero = i;
- break;
- }
- }
-
- for(i=start_i; i<=last_non_zero; i++) {
- const int j = scantable[i];
- int level = block[j] * qmat[j];
-
-// if( bias+level >= (1<<(QMAT_SHIFT - 3))
-// || bias-level >= (1<<(QMAT_SHIFT - 3))){
- if(((unsigned)(level+threshold1))>threshold2){
- if(level>0){
- level= (bias + level)>>QMAT_SHIFT;
- coeff[0][i]= level;
- coeff[1][i]= level-1;
-// coeff[2][k]= level-2;
- }else{
- level= (bias - level)>>QMAT_SHIFT;
- coeff[0][i]= -level;
- coeff[1][i]= -level+1;
-// coeff[2][k]= -level+2;
- }
- coeff_count[i]= FFMIN(level, 2);
- assert(coeff_count[i]);
- max |=level;
- }else{
- coeff[0][i]= (level>>31)|1;
- coeff_count[i]= 1;
- }
- }
-
- *overflow= s->max_qcoeff < max; //overflow might have happened
-
- if(last_non_zero < start_i){
- memset(block + start_i, 0, (64-start_i)*sizeof(DCTELEM));
- return last_non_zero;
- }
-
- score_tab[start_i]= 0;
- survivor[0]= start_i;
- survivor_count= 1;
-
- for(i=start_i; i<=last_non_zero; i++){
- int level_index, j;
- const int dct_coeff= FFABS(block[ scantable[i] ]);
- const int zero_distoration= dct_coeff*dct_coeff;
- int best_score=256*256*256*120;
- for(level_index=0; level_index < coeff_count[i]; level_index++){
- int distoration;
- int level= coeff[level_index][i];
- const int alevel= FFABS(level);
- int unquant_coeff;
-
- assert(level);
-
- if(s->out_format == FMT_H263){
- unquant_coeff= alevel*qmul + qadd;
- }else{ //MPEG1
- j= s->dsp.idct_permutation[ scantable[i] ]; //FIXME optimize
- if(s->mb_intra){
- unquant_coeff = (int)( alevel * qscale * s->intra_matrix[j]) >> 3;
- unquant_coeff = (unquant_coeff - 1) | 1;
- }else{
- unquant_coeff = ((( alevel << 1) + 1) * qscale * ((int) s->inter_matrix[j])) >> 4;
- unquant_coeff = (unquant_coeff - 1) | 1;
- }
- unquant_coeff<<= 3;
- }
-
- distoration= (unquant_coeff - dct_coeff) * (unquant_coeff - dct_coeff) - zero_distoration;
- level+=64;
- if((level&(~127)) == 0){
- for(j=survivor_count-1; j>=0; j--){
- int run= i - survivor[j];
- int score= distoration + length[UNI_AC_ENC_INDEX(run, level)]*lambda;
- score += score_tab[i-run];
-
- if(score < best_score){
- best_score= score;
- run_tab[i+1]= run;
- level_tab[i+1]= level-64;
- }
- }
-
- if(s->out_format == FMT_H263){
- for(j=survivor_count-1; j>=0; j--){
- int run= i - survivor[j];
- int score= distoration + last_length[UNI_AC_ENC_INDEX(run, level)]*lambda;
- score += score_tab[i-run];
- if(score < last_score){
- last_score= score;
- last_run= run;
- last_level= level-64;
- last_i= i+1;
- }
- }
- }
- }else{
- distoration += esc_length*lambda;
- for(j=survivor_count-1; j>=0; j--){
- int run= i - survivor[j];
- int score= distoration + score_tab[i-run];
-
- if(score < best_score){
- best_score= score;
- run_tab[i+1]= run;
- level_tab[i+1]= level-64;
- }
- }
-
- if(s->out_format == FMT_H263){
- for(j=survivor_count-1; j>=0; j--){
- int run= i - survivor[j];
- int score= distoration + score_tab[i-run];
- if(score < last_score){
- last_score= score;
- last_run= run;
- last_level= level-64;
- last_i= i+1;
- }
- }
- }
- }
- }
-
- score_tab[i+1]= best_score;
-
- //Note: there is a vlc code in mpeg4 which is 1 bit shorter then another one with a shorter run and the same level
- if(last_non_zero <= 27){
- for(; survivor_count; survivor_count--){
- if(score_tab[ survivor[survivor_count-1] ] <= best_score)
- break;
- }
- }else{
- for(; survivor_count; survivor_count--){
- if(score_tab[ survivor[survivor_count-1] ] <= best_score + lambda)
- break;
- }
- }
-
- survivor[ survivor_count++ ]= i+1;
- }
-
- if(s->out_format != FMT_H263){
- last_score= 256*256*256*120;
- for(i= survivor[0]; i<=last_non_zero + 1; i++){
- int score= score_tab[i];
- if(i) score += lambda*2; //FIXME exacter?
-
- if(score < last_score){
- last_score= score;
- last_i= i;
- last_level= level_tab[i];
- last_run= run_tab[i];
- }
- }
- }
-
- s->coded_score[n] = last_score;
-
- dc= FFABS(block[0]);
- last_non_zero= last_i - 1;
- memset(block + start_i, 0, (64-start_i)*sizeof(DCTELEM));
-
- if(last_non_zero < start_i)
- return last_non_zero;
-
- if(last_non_zero == 0 && start_i == 0){
- int best_level= 0;
- int best_score= dc * dc;
-
- for(i=0; i<coeff_count[0]; i++){
- int level= coeff[i][0];
- int alevel= FFABS(level);
- int unquant_coeff, score, distortion;
-
- if(s->out_format == FMT_H263){
- unquant_coeff= (alevel*qmul + qadd)>>3;
- }else{ //MPEG1
- unquant_coeff = ((( alevel << 1) + 1) * qscale * ((int) s->inter_matrix[0])) >> 4;
- unquant_coeff = (unquant_coeff - 1) | 1;
- }
- unquant_coeff = (unquant_coeff + 4) >> 3;
- unquant_coeff<<= 3 + 3;
-
- distortion= (unquant_coeff - dc) * (unquant_coeff - dc);
- level+=64;
- if((level&(~127)) == 0) score= distortion + last_length[UNI_AC_ENC_INDEX(0, level)]*lambda;
- else score= distortion + esc_length*lambda;
-
- if(score < best_score){
- best_score= score;
- best_level= level - 64;
- }
- }
- block[0]= best_level;
- s->coded_score[n] = best_score - dc*dc;
- if(best_level == 0) return -1;
- else return last_non_zero;
- }
-
- i= last_i;
- assert(last_level);
-
- block[ perm_scantable[last_non_zero] ]= last_level;
- i -= last_run + 1;
-
- for(; i>start_i; i -= run_tab[i] + 1){
- block[ perm_scantable[i-1] ]= level_tab[i];
- }
-
- return last_non_zero;
-}
-
-//#define REFINE_STATS 1
-static int16_t basis[64][64];
-
-static void build_basis(uint8_t *perm){
- int i, j, x, y;
- emms_c();
- for(i=0; i<8; i++){
- for(j=0; j<8; j++){
- for(y=0; y<8; y++){
- for(x=0; x<8; x++){
- double s= 0.25*(1<<BASIS_SHIFT);
- int index= 8*i + j;
- int perm_index= perm[index];
- if(i==0) s*= sqrt(0.5);
- if(j==0) s*= sqrt(0.5);
- basis[perm_index][8*x + y]= lrintf(s * cos((M_PI/8.0)*i*(x+0.5)) * cos((M_PI/8.0)*j*(y+0.5)));
- }
- }
- }
- }
-}
-
-static int dct_quantize_refine(MpegEncContext *s, //FIXME breaks denoise?
- DCTELEM *block, int16_t *weight, DCTELEM *orig,
- int n, int qscale){
- int16_t rem[64];
- DECLARE_ALIGNED_16(DCTELEM, d1[64]);
- const int *qmat;
- const uint8_t *scantable= s->intra_scantable.scantable;
- const uint8_t *perm_scantable= s->intra_scantable.permutated;
-// unsigned int threshold1, threshold2;
-// int bias=0;
- int run_tab[65];
- int prev_run=0;
- int prev_level=0;
- int qmul, qadd, start_i, last_non_zero, i, dc;
- uint8_t * length;
- uint8_t * last_length;
- int lambda;
- int rle_index, run, q = 1, sum; //q is only used when s->mb_intra is true
-#ifdef REFINE_STATS
-static int count=0;
-static int after_last=0;
-static int to_zero=0;
-static int from_zero=0;
-static int raise=0;
-static int lower=0;
-static int messed_sign=0;
-#endif
-
- if(basis[0][0] == 0)
- build_basis(s->dsp.idct_permutation);
-
- qmul= qscale*2;
- qadd= (qscale-1)|1;
- if (s->mb_intra) {
- if (!s->h263_aic) {
- if (n < 4)
- q = s->y_dc_scale;
- else
- q = s->c_dc_scale;
- } else{
- /* For AIC we skip quant/dequant of INTRADC */
- q = 1;
- qadd=0;
- }
- q <<= RECON_SHIFT-3;
- /* note: block[0] is assumed to be positive */
- dc= block[0]*q;
-// block[0] = (block[0] + (q >> 1)) / q;
- start_i = 1;
- qmat = s->q_intra_matrix[qscale];
-// if(s->mpeg_quant || s->out_format == FMT_MPEG1)
-// bias= 1<<(QMAT_SHIFT-1);
- length = s->intra_ac_vlc_length;
- last_length= s->intra_ac_vlc_last_length;
- } else {
- dc= 0;
- start_i = 0;
- qmat = s->q_inter_matrix[qscale];
- length = s->inter_ac_vlc_length;
- last_length= s->inter_ac_vlc_last_length;
- }
- last_non_zero = s->block_last_index[n];
-
-#ifdef REFINE_STATS
-{START_TIMER
-#endif
- dc += (1<<(RECON_SHIFT-1));
- for(i=0; i<64; i++){
- rem[i]= dc - (orig[i]<<RECON_SHIFT); //FIXME use orig dirrectly instead of copying to rem[]
- }
-#ifdef REFINE_STATS
-STOP_TIMER("memset rem[]")}
-#endif
- sum=0;
- for(i=0; i<64; i++){
- int one= 36;
- int qns=4;
- int w;
-
- w= FFABS(weight[i]) + qns*one;
- w= 15 + (48*qns*one + w/2)/w; // 16 .. 63
-
- weight[i] = w;
-// w=weight[i] = (63*qns + (w/2)) / w;
-
- assert(w>0);
- assert(w<(1<<6));
- sum += w*w;
- }
- lambda= sum*(uint64_t)s->lambda2 >> (FF_LAMBDA_SHIFT - 6 + 6 + 6 + 6);
-#ifdef REFINE_STATS
-{START_TIMER
-#endif
- run=0;
- rle_index=0;
- for(i=start_i; i<=last_non_zero; i++){
- int j= perm_scantable[i];
- const int level= block[j];
- int coeff;
-
- if(level){
- if(level<0) coeff= qmul*level - qadd;
- else coeff= qmul*level + qadd;
- run_tab[rle_index++]=run;
- run=0;
-
- s->dsp.add_8x8basis(rem, basis[j], coeff);
- }else{
- run++;
- }
- }
-#ifdef REFINE_STATS
-if(last_non_zero>0){
-STOP_TIMER("init rem[]")
-}
-}
-
-{START_TIMER
-#endif
- for(;;){
- int best_score=s->dsp.try_8x8basis(rem, weight, basis[0], 0);
- int best_coeff=0;
- int best_change=0;
- int run2, best_unquant_change=0, analyze_gradient;
-#ifdef REFINE_STATS
-{START_TIMER
-#endif
- analyze_gradient = last_non_zero > 2 || s->avctx->quantizer_noise_shaping >= 3;
-
- if(analyze_gradient){
-#ifdef REFINE_STATS
-{START_TIMER
-#endif
- for(i=0; i<64; i++){
- int w= weight[i];
-
- d1[i] = (rem[i]*w*w + (1<<(RECON_SHIFT+12-1)))>>(RECON_SHIFT+12);
- }
-#ifdef REFINE_STATS
-STOP_TIMER("rem*w*w")}
-{START_TIMER
-#endif
- s->dsp.fdct(d1);
-#ifdef REFINE_STATS
-STOP_TIMER("dct")}
-#endif
- }
-
- if(start_i){
- const int level= block[0];
- int change, old_coeff;
-
- assert(s->mb_intra);
-
- old_coeff= q*level;
-
- for(change=-1; change<=1; change+=2){
- int new_level= level + change;
- int score, new_coeff;
-
- new_coeff= q*new_level;
- if(new_coeff >= 2048 || new_coeff < 0)
- continue;
-
- score= s->dsp.try_8x8basis(rem, weight, basis[0], new_coeff - old_coeff);
- if(score<best_score){
- best_score= score;
- best_coeff= 0;
- best_change= change;
- best_unquant_change= new_coeff - old_coeff;
- }
- }
- }
-
- run=0;
- rle_index=0;
- run2= run_tab[rle_index++];
- prev_level=0;
- prev_run=0;
-
- for(i=start_i; i<64; i++){
- int j= perm_scantable[i];
- const int level= block[j];
- int change, old_coeff;
-
- if(s->avctx->quantizer_noise_shaping < 3 && i > last_non_zero + 1)
- break;
-
- if(level){
- if(level<0) old_coeff= qmul*level - qadd;
- else old_coeff= qmul*level + qadd;
- run2= run_tab[rle_index++]; //FIXME ! maybe after last
- }else{
- old_coeff=0;
- run2--;
- assert(run2>=0 || i >= last_non_zero );
- }
-
- for(change=-1; change<=1; change+=2){
- int new_level= level + change;
- int score, new_coeff, unquant_change;
-
- score=0;
- if(s->avctx->quantizer_noise_shaping < 2 && FFABS(new_level) > FFABS(level))
- continue;
-
- if(new_level){
- if(new_level<0) new_coeff= qmul*new_level - qadd;
- else new_coeff= qmul*new_level + qadd;
- if(new_coeff >= 2048 || new_coeff <= -2048)
- continue;
- //FIXME check for overflow
-
- if(level){
- if(level < 63 && level > -63){
- if(i < last_non_zero)
- score += length[UNI_AC_ENC_INDEX(run, new_level+64)]
- - length[UNI_AC_ENC_INDEX(run, level+64)];
- else
- score += last_length[UNI_AC_ENC_INDEX(run, new_level+64)]
- - last_length[UNI_AC_ENC_INDEX(run, level+64)];
- }
- }else{
- assert(FFABS(new_level)==1);
-
- if(analyze_gradient){
- int g= d1[ scantable[i] ];
- if(g && (g^new_level) >= 0)
- continue;
- }
-
- if(i < last_non_zero){
- int next_i= i + run2 + 1;
- int next_level= block[ perm_scantable[next_i] ] + 64;
-
- if(next_level&(~127))
- next_level= 0;
-
- if(next_i < last_non_zero)
- score += length[UNI_AC_ENC_INDEX(run, 65)]
- + length[UNI_AC_ENC_INDEX(run2, next_level)]
- - length[UNI_AC_ENC_INDEX(run + run2 + 1, next_level)];
- else
- score += length[UNI_AC_ENC_INDEX(run, 65)]
- + last_length[UNI_AC_ENC_INDEX(run2, next_level)]
- - last_length[UNI_AC_ENC_INDEX(run + run2 + 1, next_level)];
- }else{
- score += last_length[UNI_AC_ENC_INDEX(run, 65)];
- if(prev_level){
- score += length[UNI_AC_ENC_INDEX(prev_run, prev_level)]
- - last_length[UNI_AC_ENC_INDEX(prev_run, prev_level)];
- }
- }
- }
- }else{
- new_coeff=0;
- assert(FFABS(level)==1);
-
- if(i < last_non_zero){
- int next_i= i + run2 + 1;
- int next_level= block[ perm_scantable[next_i] ] + 64;
-
- if(next_level&(~127))
- next_level= 0;
-
- if(next_i < last_non_zero)
- score += length[UNI_AC_ENC_INDEX(run + run2 + 1, next_level)]
- - length[UNI_AC_ENC_INDEX(run2, next_level)]
- - length[UNI_AC_ENC_INDEX(run, 65)];
- else
- score += last_length[UNI_AC_ENC_INDEX(run + run2 + 1, next_level)]
- - last_length[UNI_AC_ENC_INDEX(run2, next_level)]
- - length[UNI_AC_ENC_INDEX(run, 65)];
- }else{
- score += -last_length[UNI_AC_ENC_INDEX(run, 65)];
- if(prev_level){
- score += last_length[UNI_AC_ENC_INDEX(prev_run, prev_level)]
- - length[UNI_AC_ENC_INDEX(prev_run, prev_level)];
- }
- }
- }
-
- score *= lambda;
-
- unquant_change= new_coeff - old_coeff;
- assert((score < 100*lambda && score > -100*lambda) || lambda==0);
-
- score+= s->dsp.try_8x8basis(rem, weight, basis[j], unquant_change);
- if(score<best_score){
- best_score= score;
- best_coeff= i;
- best_change= change;
- best_unquant_change= unquant_change;
- }
- }
- if(level){
- prev_level= level + 64;
- if(prev_level&(~127))
- prev_level= 0;
- prev_run= run;
- run=0;
- }else{
- run++;
- }
- }
-#ifdef REFINE_STATS
-STOP_TIMER("iterative step")}
-#endif
-
- if(best_change){
- int j= perm_scantable[ best_coeff ];
-
- block[j] += best_change;
-
- if(best_coeff > last_non_zero){
- last_non_zero= best_coeff;
- assert(block[j]);
-#ifdef REFINE_STATS
-after_last++;
-#endif
- }else{
-#ifdef REFINE_STATS
-if(block[j]){
- if(block[j] - best_change){
- if(FFABS(block[j]) > FFABS(block[j] - best_change)){
- raise++;
- }else{
- lower++;
- }
- }else{
- from_zero++;
- }
-}else{
- to_zero++;
-}
-#endif
- for(; last_non_zero>=start_i; last_non_zero--){
- if(block[perm_scantable[last_non_zero]])
- break;
- }
- }
-#ifdef REFINE_STATS
-count++;
-if(256*256*256*64 % count == 0){
- printf("after_last:%d to_zero:%d from_zero:%d raise:%d lower:%d sign:%d xyp:%d/%d/%d\n", after_last, to_zero, from_zero, raise, lower, messed_sign, s->mb_x, s->mb_y, s->picture_number);
-}
-#endif
- run=0;
- rle_index=0;
- for(i=start_i; i<=last_non_zero; i++){
- int j= perm_scantable[i];
- const int level= block[j];
-
- if(level){
- run_tab[rle_index++]=run;
- run=0;
- }else{
- run++;
- }
- }
-
- s->dsp.add_8x8basis(rem, basis[j], best_unquant_change);
- }else{
- break;
- }
- }
-#ifdef REFINE_STATS
-if(last_non_zero>0){
-STOP_TIMER("iterative search")
-}
-}
-#endif
-
- return last_non_zero;
-}
-
-static int dct_quantize_c(MpegEncContext *s,
- DCTELEM *block, int n,
- int qscale, int *overflow)
-{
- int i, j, level, last_non_zero, q, start_i;
- const int *qmat;
- const uint8_t *scantable= s->intra_scantable.scantable;
- int bias;
- int max=0;
- unsigned int threshold1, threshold2;
-
- s->dsp.fdct (block);
-
- if(s->dct_error_sum)
- s->denoise_dct(s, block);
-
- if (s->mb_intra) {
- if (!s->h263_aic) {
- if (n < 4)
- q = s->y_dc_scale;
- else
- q = s->c_dc_scale;
- q = q << 3;
- } else
- /* For AIC we skip quant/dequant of INTRADC */
- q = 1 << 3;
-
- /* note: block[0] is assumed to be positive */
- block[0] = (block[0] + (q >> 1)) / q;
- start_i = 1;
- last_non_zero = 0;
- qmat = s->q_intra_matrix[qscale];
- bias= s->intra_quant_bias<<(QMAT_SHIFT - QUANT_BIAS_SHIFT);
- } else {
- start_i = 0;
- last_non_zero = -1;
- qmat = s->q_inter_matrix[qscale];
- bias= s->inter_quant_bias<<(QMAT_SHIFT - QUANT_BIAS_SHIFT);
- }
- threshold1= (1<<QMAT_SHIFT) - bias - 1;
- threshold2= (threshold1<<1);
- for(i=63;i>=start_i;i--) {
- j = scantable[i];
- level = block[j] * qmat[j];
-
- if(((unsigned)(level+threshold1))>threshold2){
- last_non_zero = i;
- break;
- }else{
- block[j]=0;
- }
- }
- for(i=start_i; i<=last_non_zero; i++) {
- j = scantable[i];
- level = block[j] * qmat[j];
-
-// if( bias+level >= (1<<QMAT_SHIFT)
-// || bias-level >= (1<<QMAT_SHIFT)){
- if(((unsigned)(level+threshold1))>threshold2){
- if(level>0){
- level= (bias + level)>>QMAT_SHIFT;
- block[j]= level;
- }else{
- level= (bias - level)>>QMAT_SHIFT;
- block[j]= -level;
- }
- max |=level;
- }else{
- block[j]=0;
- }
- }
- *overflow= s->max_qcoeff < max; //overflow might have happened
-
- /* we need this permutation so that we correct the IDCT, we only permute the !=0 elements */
- if (s->dsp.idct_permutation_type != FF_NO_IDCT_PERM)
- ff_block_permute(block, s->dsp.idct_permutation, scantable, last_non_zero);
-
- return last_non_zero;
-}
-
-#endif //CONFIG_ENCODERS
-
-static void dct_unquantize_mpeg1_intra_c(MpegEncContext *s,
- DCTELEM *block, int n, int qscale)
-{
- int i, level, nCoeffs;
- const uint16_t *quant_matrix;
-
- nCoeffs= s->block_last_index[n];
-
- if (n < 4)
- block[0] = block[0] * s->y_dc_scale;
- else
- block[0] = block[0] * s->c_dc_scale;
- /* XXX: only mpeg1 */
- quant_matrix = s->intra_matrix;
- for(i=1;i<=nCoeffs;i++) {
- int j= s->intra_scantable.permutated[i];
- level = block[j];
- if (level) {
- if (level < 0) {
- level = -level;
- level = (int)(level * qscale * quant_matrix[j]) >> 3;
- level = (level - 1) | 1;
- level = -level;
- } else {
- level = (int)(level * qscale * quant_matrix[j]) >> 3;
- level = (level - 1) | 1;
- }
- block[j] = level;
- }
- }
-}
-
-static void dct_unquantize_mpeg1_inter_c(MpegEncContext *s,
- DCTELEM *block, int n, int qscale)
-{
- int i, level, nCoeffs;
- const uint16_t *quant_matrix;
-
- nCoeffs= s->block_last_index[n];
-
- quant_matrix = s->inter_matrix;
- for(i=0; i<=nCoeffs; i++) {
- int j= s->intra_scantable.permutated[i];
- level = block[j];
- if (level) {
- if (level < 0) {
- level = -level;
- level = (((level << 1) + 1) * qscale *
- ((int) (quant_matrix[j]))) >> 4;
- level = (level - 1) | 1;
- level = -level;
- } else {
- level = (((level << 1) + 1) * qscale *
- ((int) (quant_matrix[j]))) >> 4;
- level = (level - 1) | 1;
- }
- block[j] = level;
- }
- }
-}
-
-static void dct_unquantize_mpeg2_intra_c(MpegEncContext *s,
- DCTELEM *block, int n, int qscale)
-{
- int i, level, nCoeffs;
- const uint16_t *quant_matrix;
-
- if(s->alternate_scan) nCoeffs= 63;
- else nCoeffs= s->block_last_index[n];
-
- if (n < 4)
- block[0] = block[0] * s->y_dc_scale;
- else
- block[0] = block[0] * s->c_dc_scale;
- quant_matrix = s->intra_matrix;
- for(i=1;i<=nCoeffs;i++) {
- int j= s->intra_scantable.permutated[i];
- level = block[j];
- if (level) {
- if (level < 0) {
- level = -level;
- level = (int)(level * qscale * quant_matrix[j]) >> 3;
- level = -level;
- } else {
- level = (int)(level * qscale * quant_matrix[j]) >> 3;
- }
- block[j] = level;
- }
- }
-}
-
-static void dct_unquantize_mpeg2_intra_bitexact(MpegEncContext *s,
- DCTELEM *block, int n, int qscale)
-{
- int i, level, nCoeffs;
- const uint16_t *quant_matrix;
- int sum=-1;
-
- if(s->alternate_scan) nCoeffs= 63;
- else nCoeffs= s->block_last_index[n];
-
- if (n < 4)
- block[0] = block[0] * s->y_dc_scale;
- else
- block[0] = block[0] * s->c_dc_scale;
- quant_matrix = s->intra_matrix;
- for(i=1;i<=nCoeffs;i++) {
- int j= s->intra_scantable.permutated[i];
- level = block[j];
- if (level) {
- if (level < 0) {
- level = -level;
- level = (int)(level * qscale * quant_matrix[j]) >> 3;
- level = -level;
- } else {
- level = (int)(level * qscale * quant_matrix[j]) >> 3;
- }
- block[j] = level;
- sum+=level;
- }
- }
- block[63]^=sum&1;
-}
-
-static void dct_unquantize_mpeg2_inter_c(MpegEncContext *s,
- DCTELEM *block, int n, int qscale)
-{
- int i, level, nCoeffs;
- const uint16_t *quant_matrix;
- int sum=-1;
-
- if(s->alternate_scan) nCoeffs= 63;
- else nCoeffs= s->block_last_index[n];
-
- quant_matrix = s->inter_matrix;
- for(i=0; i<=nCoeffs; i++) {
- int j= s->intra_scantable.permutated[i];
- level = block[j];
- if (level) {
- if (level < 0) {
- level = -level;
- level = (((level << 1) + 1) * qscale *
- ((int) (quant_matrix[j]))) >> 4;
- level = -level;
- } else {
- level = (((level << 1) + 1) * qscale *
- ((int) (quant_matrix[j]))) >> 4;
- }
- block[j] = level;
- sum+=level;
- }
- }
- block[63]^=sum&1;
-}
-
-static void dct_unquantize_h263_intra_c(MpegEncContext *s,
- DCTELEM *block, int n, int qscale)
-{
- int i, level, qmul, qadd;
- int nCoeffs;
-
- assert(s->block_last_index[n]>=0);
-
- qmul = qscale << 1;
-
- if (!s->h263_aic) {
- if (n < 4)
- block[0] = block[0] * s->y_dc_scale;
- else
- block[0] = block[0] * s->c_dc_scale;
- qadd = (qscale - 1) | 1;
- }else{
- qadd = 0;
- }
- if(s->ac_pred)
- nCoeffs=63;
- else
- nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
-
- for(i=1; i<=nCoeffs; i++) {
- level = block[i];
- if (level) {
- if (level < 0) {
- level = level * qmul - qadd;
- } else {
- level = level * qmul + qadd;
- }
- block[i] = level;
- }
- }
-}
-
-static void dct_unquantize_h263_inter_c(MpegEncContext *s,
- DCTELEM *block, int n, int qscale)
-{
- int i, level, qmul, qadd;
- int nCoeffs;
-
- assert(s->block_last_index[n]>=0);
-
- qadd = (qscale - 1) | 1;
- qmul = qscale << 1;
-
- nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
-
- for(i=0; i<=nCoeffs; i++) {
- level = block[i];
- if (level) {
- if (level < 0) {
- level = level * qmul - qadd;
- } else {
- level = level * qmul + qadd;
- }
- block[i] = level;
- }
- }
-}
-
-#ifdef CONFIG_ENCODERS
-AVCodec h263_encoder = {
- "h263",
- CODEC_TYPE_VIDEO,
- CODEC_ID_H263,
- sizeof(MpegEncContext),
- MPV_encode_init,
- MPV_encode_picture,
- MPV_encode_end,
- .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV420P, -1},
-};
-
-AVCodec h263p_encoder = {
- "h263p",
- CODEC_TYPE_VIDEO,
- CODEC_ID_H263P,
- sizeof(MpegEncContext),
- MPV_encode_init,
- MPV_encode_picture,
- MPV_encode_end,
- .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV420P, -1},
-};
-
-AVCodec flv_encoder = {
- "flv",
- CODEC_TYPE_VIDEO,
- CODEC_ID_FLV1,
- sizeof(MpegEncContext),
- MPV_encode_init,
- MPV_encode_picture,
- MPV_encode_end,
- .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV420P, -1},
-};
-
-AVCodec rv10_encoder = {
- "rv10",
- CODEC_TYPE_VIDEO,
- CODEC_ID_RV10,
- sizeof(MpegEncContext),
- MPV_encode_init,
- MPV_encode_picture,
- MPV_encode_end,
- .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV420P, -1},
-};
-
-AVCodec rv20_encoder = {
- "rv20",
- CODEC_TYPE_VIDEO,
- CODEC_ID_RV20,
- sizeof(MpegEncContext),
- MPV_encode_init,
- MPV_encode_picture,
- MPV_encode_end,
- .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV420P, -1},
-};
-
-AVCodec mpeg4_encoder = {
- "mpeg4",
- CODEC_TYPE_VIDEO,
- CODEC_ID_MPEG4,
- sizeof(MpegEncContext),
- MPV_encode_init,
- MPV_encode_picture,
- MPV_encode_end,
- .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV420P, -1},
- .capabilities= CODEC_CAP_DELAY,
-};
-
-AVCodec msmpeg4v1_encoder = {
- "msmpeg4v1",
- CODEC_TYPE_VIDEO,
- CODEC_ID_MSMPEG4V1,
- sizeof(MpegEncContext),
- MPV_encode_init,
- MPV_encode_picture,
- MPV_encode_end,
- .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV420P, -1},
-};
-
-AVCodec msmpeg4v2_encoder = {
- "msmpeg4v2",
- CODEC_TYPE_VIDEO,
- CODEC_ID_MSMPEG4V2,
- sizeof(MpegEncContext),
- MPV_encode_init,
- MPV_encode_picture,
- MPV_encode_end,
- .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV420P, -1},
-};
-
-AVCodec msmpeg4v3_encoder = {
- "msmpeg4",
- CODEC_TYPE_VIDEO,
- CODEC_ID_MSMPEG4V3,
- sizeof(MpegEncContext),
- MPV_encode_init,
- MPV_encode_picture,
- MPV_encode_end,
- .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV420P, -1},
-};
-
-AVCodec wmv1_encoder = {
- "wmv1",
- CODEC_TYPE_VIDEO,
- CODEC_ID_WMV1,
- sizeof(MpegEncContext),
- MPV_encode_init,
- MPV_encode_picture,
- MPV_encode_end,
- .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV420P, -1},
-};
-
-AVCodec mjpeg_encoder = {
- "mjpeg",
- CODEC_TYPE_VIDEO,
- CODEC_ID_MJPEG,
- sizeof(MpegEncContext),
- MPV_encode_init,
- MPV_encode_picture,
- MPV_encode_end,
- .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, -1},
-};
-
-#endif //CONFIG_ENCODERS
diff --git a/src/libffmpeg/libavcodec/mpegvideo.h b/src/libffmpeg/libavcodec/mpegvideo.h
deleted file mode 100644
index ed02759ae..000000000
--- a/src/libffmpeg/libavcodec/mpegvideo.h
+++ /dev/null
@@ -1,931 +0,0 @@
-/*
- * Generic DCT based hybrid video encoder
- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard.
- * Copyright (c) 2002-2004 Michael Niedermayer
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file mpegvideo.h
- * mpegvideo header.
- */
-
-#ifndef AVCODEC_MPEGVIDEO_H
-#define AVCODEC_MPEGVIDEO_H
-
-#include "dsputil.h"
-#include "bitstream.h"
-#include "ratecontrol.h"
-#include "parser.h"
-
-#define FRAME_SKIPPED 100 ///< return value for header parsers if frame is not coded
-
-enum OutputFormat {
- FMT_MPEG1,
- FMT_H261,
- FMT_H263,
- FMT_MJPEG,
- FMT_H264,
-};
-
-#define EDGE_WIDTH 16
-
-#define MPEG_BUF_SIZE (16 * 1024)
-
-#define QMAT_SHIFT_MMX 16
-#define QMAT_SHIFT 22
-
-#define MAX_FCODE 7
-#define MAX_MV 2048
-
-#define MAX_THREADS 8
-
-#define MAX_PICTURE_COUNT 32
-
-#define ME_MAP_SIZE 64
-#define ME_MAP_SHIFT 3
-#define ME_MAP_MV_BITS 11
-
-/* run length table */
-#define MAX_RUN 64
-#define MAX_LEVEL 64
-
-#define I_TYPE FF_I_TYPE ///< Intra
-#define P_TYPE FF_P_TYPE ///< Predicted
-#define B_TYPE FF_B_TYPE ///< Bi-dir predicted
-#define S_TYPE FF_S_TYPE ///< S(GMC)-VOP MPEG4
-#define SI_TYPE FF_SI_TYPE ///< Switching Intra
-#define SP_TYPE FF_SP_TYPE ///< Switching Predicted
-
-#define MAX_MB_BYTES (30*16*16*3/8 + 120)
-
-#define INPLACE_OFFSET 16
-
-/**
- * Scantable.
- */
-typedef struct ScanTable{
- const uint8_t *scantable;
- uint8_t permutated[64];
- uint8_t raster_end[64];
-#ifdef ARCH_POWERPC
- /** Used by dct_quantise_alitvec to find last-non-zero */
- DECLARE_ALIGNED_8(uint8_t, inverse[64]);
-#endif
-} ScanTable;
-
-/**
- * Picture.
- */
-typedef struct Picture{
- FF_COMMON_FRAME
-
- /**
- * halfpel luma planes.
- */
- uint8_t *interpolated[3];
- int16_t (*motion_val_base[2])[2];
- uint32_t *mb_type_base;
-#define MB_TYPE_INTRA MB_TYPE_INTRA4x4 //default mb_type if theres just one type
-#define IS_INTRA4x4(a) ((a)&MB_TYPE_INTRA4x4)
-#define IS_INTRA16x16(a) ((a)&MB_TYPE_INTRA16x16)
-#define IS_PCM(a) ((a)&MB_TYPE_INTRA_PCM)
-#define IS_INTRA(a) ((a)&7)
-#define IS_INTER(a) ((a)&(MB_TYPE_16x16|MB_TYPE_16x8|MB_TYPE_8x16|MB_TYPE_8x8))
-#define IS_SKIP(a) ((a)&MB_TYPE_SKIP)
-#define IS_INTRA_PCM(a) ((a)&MB_TYPE_INTRA_PCM)
-#define IS_INTERLACED(a) ((a)&MB_TYPE_INTERLACED)
-#define IS_DIRECT(a) ((a)&MB_TYPE_DIRECT2)
-#define IS_GMC(a) ((a)&MB_TYPE_GMC)
-#define IS_16X16(a) ((a)&MB_TYPE_16x16)
-#define IS_16X8(a) ((a)&MB_TYPE_16x8)
-#define IS_8X16(a) ((a)&MB_TYPE_8x16)
-#define IS_8X8(a) ((a)&MB_TYPE_8x8)
-#define IS_SUB_8X8(a) ((a)&MB_TYPE_16x16) //note reused
-#define IS_SUB_8X4(a) ((a)&MB_TYPE_16x8) //note reused
-#define IS_SUB_4X8(a) ((a)&MB_TYPE_8x16) //note reused
-#define IS_SUB_4X4(a) ((a)&MB_TYPE_8x8) //note reused
-#define IS_ACPRED(a) ((a)&MB_TYPE_ACPRED)
-#define IS_QUANT(a) ((a)&MB_TYPE_QUANT)
-#define IS_DIR(a, part, list) ((a) & (MB_TYPE_P0L0<<((part)+2*(list))))
-#define USES_LIST(a, list) ((a) & ((MB_TYPE_P0L0|MB_TYPE_P1L0)<<(2*(list)))) ///< does this mb use listX, note doesnt work if subMBs
-#define HAS_CBP(a) ((a)&MB_TYPE_CBP)
-
- int field_poc[2]; ///< h264 top/bottom POC
- int poc; ///< h264 frame POC
- int frame_num; ///< h264 frame_num
- int pic_id; ///< h264 pic_num or long_term_pic_idx
- int long_ref; ///< 1->long term reference 0->short term reference
- int ref_poc[2][16]; ///< h264 POCs of the frames used as reference
- int ref_count[2]; ///< number of entries in ref_poc
-
- int mb_var_sum; ///< sum of MB variance for current frame
- int mc_mb_var_sum; ///< motion compensated MB variance for current frame
- uint16_t *mb_var; ///< Table for MB variances
- uint16_t *mc_mb_var; ///< Table for motion compensated MB variances
- uint8_t *mb_mean; ///< Table for MB luminance
- int32_t *mb_cmp_score; ///< Table for MB cmp scores, for mb decision FIXME remove
- int b_frame_score; /* */
-} Picture;
-
-struct MpegEncContext;
-
-/**
- * Motion estimation context.
- */
-typedef struct MotionEstContext{
- AVCodecContext *avctx;
- int skip; ///< set if ME is skipped for the current MB
- int co_located_mv[4][2]; ///< mv from last p frame for direct mode ME
- int direct_basis_mv[4][2];
- uint8_t *scratchpad; ///< data area for the me algo, so that the ME doesnt need to malloc/free
- uint8_t *best_mb;
- uint8_t *temp_mb[2];
- uint8_t *temp;
- int best_bits;
- uint32_t *map; ///< map to avoid duplicate evaluations
- uint32_t *score_map; ///< map to store the scores
- int map_generation;
- int pre_penalty_factor;
- int penalty_factor;
- int sub_penalty_factor;
- int mb_penalty_factor;
- int flags;
- int sub_flags;
- int mb_flags;
- int pre_pass; ///< = 1 for the pre pass
- int dia_size;
- int xmin;
- int xmax;
- int ymin;
- int ymax;
- int pred_x;
- int pred_y;
- uint8_t *src[4][4];
- uint8_t *ref[4][4];
- int stride;
- int uvstride;
- /* temp variables for picture complexity calculation */
- int mc_mb_var_sum_temp;
- int mb_var_sum_temp;
- int scene_change_score;
-/* cmp, chroma_cmp;*/
- op_pixels_func (*hpel_put)[4];
- op_pixels_func (*hpel_avg)[4];
- qpel_mc_func (*qpel_put)[16];
- qpel_mc_func (*qpel_avg)[16];
- uint8_t (*mv_penalty)[MAX_MV*2+1]; ///< amount of bits needed to encode a MV
- uint8_t *current_mv_penalty;
- int (*sub_motion_search)(struct MpegEncContext * s,
- int *mx_ptr, int *my_ptr, int dmin,
- int src_index, int ref_index,
- int size, int h);
-}MotionEstContext;
-
-/**
- * MpegEncContext.
- */
-typedef struct MpegEncContext {
- struct AVCodecContext *avctx;
- /* the following parameters must be initialized before encoding */
- int width, height;///< picture size. must be a multiple of 16
- int gop_size;
- int intra_only; ///< if true, only intra pictures are generated
- int bit_rate; ///< wanted bit rate
- enum OutputFormat out_format; ///< output format
- int h263_pred; ///< use mpeg4/h263 ac/dc predictions
-
-/* the following codec id fields are deprecated in favor of codec_id */
- int h263_plus; ///< h263 plus headers
- int h263_msmpeg4; ///< generate MSMPEG4 compatible stream (deprecated, use msmpeg4_version instead)
- int h263_flv; ///< use flv h263 header
-
- enum CodecID codec_id; /* see CODEC_ID_xxx */
- int fixed_qscale; ///< fixed qscale if non zero
- int encoding; ///< true if we are encoding (vs decoding)
- int flags; ///< AVCodecContext.flags (HQ, MV4, ...)
- int flags2; ///< AVCodecContext.flags2
- int max_b_frames; ///< max number of b-frames for encoding
- int luma_elim_threshold;
- int chroma_elim_threshold;
- int strict_std_compliance; ///< strictly follow the std (MPEG4, ...)
- int workaround_bugs; ///< workaround bugs in encoders which cannot be detected automatically
- int codec_tag; ///< internal codec_tag upper case converted from avctx codec_tag
- int stream_codec_tag; ///< internal stream_codec_tag upper case converted from avctx stream_codec_tag
- /* the following fields are managed internally by the encoder */
-
- /** bit output */
- PutBitContext pb;
-
- /* sequence parameters */
- int context_initialized;
- int input_picture_number; ///< used to set pic->display_picture_number, shouldnt be used for/by anything else
- int coded_picture_number; ///< used to set pic->coded_picture_number, shouldnt be used for/by anything else
- int picture_number; //FIXME remove, unclear definition
- int picture_in_gop_number; ///< 0-> first pic in gop, ...
- int b_frames_since_non_b; ///< used for encoding, relative to not yet reordered input
- int64_t user_specified_pts;///< last non zero pts from AVFrame which was passed into avcodec_encode_video()
- int mb_width, mb_height; ///< number of MBs horizontally & vertically
- int mb_stride; ///< mb_width+1 used for some arrays to allow simple addressing of left & top MBs without sig11
- int b8_stride; ///< 2*mb_width+1 used for some 8x8 block arrays to allow simple addressing
- int b4_stride; ///< 4*mb_width+1 used for some 4x4 block arrays to allow simple addressing
- int h_edge_pos, v_edge_pos;///< horizontal / vertical position of the right/bottom edge (pixel replication)
- int mb_num; ///< number of MBs of a picture
- int linesize; ///< line size, in bytes, may be different from width
- int uvlinesize; ///< line size, for chroma in bytes, may be different from width
- Picture *picture; ///< main picture buffer
- Picture **input_picture; ///< next pictures on display order for encoding
- Picture **reordered_input_picture; ///< pointer to the next pictures in codedorder for encoding
-
- int start_mb_y; ///< start mb_y of this thread (so current thread should process start_mb_y <= row < end_mb_y)
- int end_mb_y; ///< end mb_y of this thread (so current thread should process start_mb_y <= row < end_mb_y)
- struct MpegEncContext *thread_context[MAX_THREADS];
-
- /**
- * copy of the previous picture structure.
- * note, linesize & data, might not match the previous picture (for field pictures)
- */
- Picture last_picture;
-
- /**
- * copy of the next picture structure.
- * note, linesize & data, might not match the next picture (for field pictures)
- */
- Picture next_picture;
-
- /**
- * copy of the source picture structure for encoding.
- * note, linesize & data, might not match the source picture (for field pictures)
- */
- Picture new_picture;
-
- /**
- * copy of the current picture structure.
- * note, linesize & data, might not match the current picture (for field pictures)
- */
- Picture current_picture; ///< buffer to store the decompressed current picture
-
- Picture *last_picture_ptr; ///< pointer to the previous picture.
- Picture *next_picture_ptr; ///< pointer to the next picture (for bidir pred)
- Picture *current_picture_ptr; ///< pointer to the current picture
- uint8_t *visualization_buffer[3]; //< temporary buffer vor MV visualization
- int last_dc[3]; ///< last DC values for MPEG1
- int16_t *dc_val_base;
- int16_t *dc_val[3]; ///< used for mpeg4 DC prediction, all 3 arrays must be continuous
- int16_t dc_cache[4*5];
- int y_dc_scale, c_dc_scale;
- const uint8_t *y_dc_scale_table; ///< qscale -> y_dc_scale table
- const uint8_t *c_dc_scale_table; ///< qscale -> c_dc_scale table
- const uint8_t *chroma_qscale_table; ///< qscale -> chroma_qscale (h263)
- uint8_t *coded_block_base;
- uint8_t *coded_block; ///< used for coded block pattern prediction (msmpeg4v3, wmv1)
- int16_t (*ac_val_base)[16];
- int16_t (*ac_val[3])[16]; ///< used for for mpeg4 AC prediction, all 3 arrays must be continuous
- int ac_pred;
- uint8_t *prev_pict_types; ///< previous picture types in bitstream order, used for mb skip
-#define PREV_PICT_TYPES_BUFFER_SIZE 256
- int mb_skipped; ///< MUST BE SET only during DECODING
- uint8_t *mbskip_table; /**< used to avoid copy if macroblock skipped (for black regions for example)
- and used for b-frame encoding & decoding (contains skip table of next P Frame) */
- uint8_t *mbintra_table; ///< used to avoid setting {ac, dc, cbp}-pred stuff to zero on inter MB decoding
- uint8_t *cbp_table; ///< used to store cbp, ac_pred for partitioned decoding
- uint8_t *pred_dir_table; ///< used to store pred_dir for partitioned decoding
- uint8_t *allocated_edge_emu_buffer;
- uint8_t *edge_emu_buffer; ///< points into the middle of allocated_edge_emu_buffer
- uint8_t *rd_scratchpad; ///< scratchpad for rate distortion mb decision
- uint8_t *obmc_scratchpad;
- uint8_t *b_scratchpad; ///< scratchpad used for writing into write only buffers
-
- int qscale; ///< QP
- int chroma_qscale; ///< chroma QP
- unsigned int lambda; ///< lagrange multipler used in rate distortion
- unsigned int lambda2; ///< (lambda*lambda) >> FF_LAMBDA_SHIFT
- int *lambda_table;
- int adaptive_quant; ///< use adaptive quantization
- int dquant; ///< qscale difference to prev qscale
- int pict_type; ///< I_TYPE, P_TYPE, B_TYPE, ...
- int last_pict_type; //FIXME removes
- int last_non_b_pict_type; ///< used for mpeg4 gmc b-frames & ratecontrol
- int dropable;
- int frame_rate_index;
- int last_lambda_for[5]; ///< last lambda for a specific pict type
- int skipdct; ///< skip dct and code zero residual
-
- /* motion compensation */
- int unrestricted_mv; ///< mv can point outside of the coded picture
- int h263_long_vectors; ///< use horrible h263v1 long vector mode
- int decode; ///< if 0 then decoding will be skipped (for encoding b frames for example)
-
- DSPContext dsp; ///< pointers for accelerated dsp functions
- int f_code; ///< forward MV resolution
- int b_code; ///< backward MV resolution for B Frames (mpeg4)
- int16_t (*p_mv_table_base)[2];
- int16_t (*b_forw_mv_table_base)[2];
- int16_t (*b_back_mv_table_base)[2];
- int16_t (*b_bidir_forw_mv_table_base)[2];
- int16_t (*b_bidir_back_mv_table_base)[2];
- int16_t (*b_direct_mv_table_base)[2];
- int16_t (*p_field_mv_table_base[2][2])[2];
- int16_t (*b_field_mv_table_base[2][2][2])[2];
- int16_t (*p_mv_table)[2]; ///< MV table (1MV per MB) p-frame encoding
- int16_t (*b_forw_mv_table)[2]; ///< MV table (1MV per MB) forward mode b-frame encoding
- int16_t (*b_back_mv_table)[2]; ///< MV table (1MV per MB) backward mode b-frame encoding
- int16_t (*b_bidir_forw_mv_table)[2]; ///< MV table (1MV per MB) bidir mode b-frame encoding
- int16_t (*b_bidir_back_mv_table)[2]; ///< MV table (1MV per MB) bidir mode b-frame encoding
- int16_t (*b_direct_mv_table)[2]; ///< MV table (1MV per MB) direct mode b-frame encoding
- int16_t (*p_field_mv_table[2][2])[2]; ///< MV table (2MV per MB) interlaced p-frame encoding
- int16_t (*b_field_mv_table[2][2][2])[2];///< MV table (4MV per MB) interlaced b-frame encoding
- uint8_t (*p_field_select_table[2]);
- uint8_t (*b_field_select_table[2][2]);
- int me_method; ///< ME algorithm
- int mv_dir;
-#define MV_DIR_BACKWARD 1
-#define MV_DIR_FORWARD 2
-#define MV_DIRECT 4 ///< bidirectional mode where the difference equals the MV of the last P/S/I-Frame (mpeg4)
- int mv_type;
-#define MV_TYPE_16X16 0 ///< 1 vector for the whole mb
-#define MV_TYPE_8X8 1 ///< 4 vectors (h263, mpeg4 4MV)
-#define MV_TYPE_16X8 2 ///< 2 vectors, one per 16x8 block
-#define MV_TYPE_FIELD 3 ///< 2 vectors, one per field
-#define MV_TYPE_DMV 4 ///< 2 vectors, special mpeg2 Dual Prime Vectors
- /**motion vectors for a macroblock
- first coordinate : 0 = forward 1 = backward
- second " : depend on type
- third " : 0 = x, 1 = y
- */
- int mv[2][4][2];
- int field_select[2][2];
- int last_mv[2][2][2]; ///< last MV, used for MV prediction in MPEG1 & B-frame MPEG4
- uint8_t *fcode_tab; ///< smallest fcode needed for each MV
- int16_t direct_scale_mv[2][64]; ///< precomputed to avoid divisions in ff_mpeg4_set_direct_mv
-
- MotionEstContext me;
-
- int no_rounding; /**< apply no rounding to motion compensation (MPEG4, msmpeg4, ...)
- for b-frames rounding mode is allways 0 */
-
- int hurry_up; /**< when set to 1 during decoding, b frames will be skipped
- when set to 2 idct/dequant will be skipped too */
-
- /* macroblock layer */
- int mb_x, mb_y;
- int mb_skip_run;
- int mb_intra;
- uint16_t *mb_type; ///< Table for candidate MB types for encoding
-#define CANDIDATE_MB_TYPE_INTRA 0x01
-#define CANDIDATE_MB_TYPE_INTER 0x02
-#define CANDIDATE_MB_TYPE_INTER4V 0x04
-#define CANDIDATE_MB_TYPE_SKIPPED 0x08
-//#define MB_TYPE_GMC 0x10
-
-#define CANDIDATE_MB_TYPE_DIRECT 0x10
-#define CANDIDATE_MB_TYPE_FORWARD 0x20
-#define CANDIDATE_MB_TYPE_BACKWARD 0x40
-#define CANDIDATE_MB_TYPE_BIDIR 0x80
-
-#define CANDIDATE_MB_TYPE_INTER_I 0x100
-#define CANDIDATE_MB_TYPE_FORWARD_I 0x200
-#define CANDIDATE_MB_TYPE_BACKWARD_I 0x400
-#define CANDIDATE_MB_TYPE_BIDIR_I 0x800
-
-#define CANDIDATE_MB_TYPE_DIRECT0 0x1000
-
- int block_index[6]; ///< index to current MB in block based arrays with edges
- int block_wrap[6];
- uint8_t *dest[3];
-
- int *mb_index2xy; ///< mb_index -> mb_x + mb_y*mb_stride
-
- /** matrix transmitted in the bitstream */
- uint16_t intra_matrix[64];
- uint16_t chroma_intra_matrix[64];
- uint16_t inter_matrix[64];
- uint16_t chroma_inter_matrix[64];
-#define QUANT_BIAS_SHIFT 8
- int intra_quant_bias; ///< bias for the quantizer
- int inter_quant_bias; ///< bias for the quantizer
- int min_qcoeff; ///< minimum encodable coefficient
- int max_qcoeff; ///< maximum encodable coefficient
- int ac_esc_length; ///< num of bits needed to encode the longest esc
- uint8_t *intra_ac_vlc_length;
- uint8_t *intra_ac_vlc_last_length;
- uint8_t *inter_ac_vlc_length;
- uint8_t *inter_ac_vlc_last_length;
- uint8_t *luma_dc_vlc_length;
- uint8_t *chroma_dc_vlc_length;
-#define UNI_AC_ENC_INDEX(run,level) ((run)*128 + (level))
-
- int coded_score[8];
-
- /** precomputed matrix (combine qscale and DCT renorm) */
- int (*q_intra_matrix)[64];
- int (*q_inter_matrix)[64];
- /** identical to the above but for MMX & these are not permutated, second 64 entries are bias*/
- uint16_t (*q_intra_matrix16)[2][64];
- uint16_t (*q_inter_matrix16)[2][64];
- int block_last_index[12]; ///< last non zero coefficient in block
- /* scantables */
- DECLARE_ALIGNED_8(ScanTable, intra_scantable);
- ScanTable intra_h_scantable;
- ScanTable intra_v_scantable;
- ScanTable inter_scantable; ///< if inter == intra then intra should be used to reduce tha cache usage
-
- /* noise reduction */
- int (*dct_error_sum)[64];
- int dct_count[2];
- uint16_t (*dct_offset)[64];
-
- void *opaque; ///< private data for the user
-
- /* bit rate control */
- int64_t wanted_bits;
- int64_t total_bits;
- int frame_bits; ///< bits used for the current frame
- int next_lambda; ///< next lambda used for retrying to encode a frame
- RateControlContext rc_context; ///< contains stuff only accessed in ratecontrol.c
-
- /* statistics, used for 2-pass encoding */
- int mv_bits;
- int header_bits;
- int i_tex_bits;
- int p_tex_bits;
- int i_count;
- int f_count;
- int b_count;
- int skip_count;
- int misc_bits; ///< cbp, mb_type
- int last_bits; ///< temp var used for calculating the above vars
-
- /* error concealment / resync */
- int error_count;
- uint8_t *error_status_table; ///< table of the error status of each MB
-#define VP_START 1 ///< current MB is the first after a resync marker
-#define AC_ERROR 2
-#define DC_ERROR 4
-#define MV_ERROR 8
-#define AC_END 16
-#define DC_END 32
-#define MV_END 64
-//FIXME some prefix?
-
- int resync_mb_x; ///< x position of last resync marker
- int resync_mb_y; ///< y position of last resync marker
- GetBitContext last_resync_gb; ///< used to search for the next resync marker
- int mb_num_left; ///< number of MBs left in this video packet (for partitioned Slices only)
- int next_p_frame_damaged; ///< set if the next p frame is damaged, to avoid showing trashed b frames
- int error_resilience;
-
- ParseContext parse_context;
-
- /* H.263 specific */
- int gob_index;
- int obmc; ///< overlapped block motion compensation
-
- /* H.263+ specific */
- int umvplus; ///< == H263+ && unrestricted_mv
- int h263_aic; ///< Advanded INTRA Coding (AIC)
- int h263_aic_dir; ///< AIC direction: 0 = left, 1 = top
- int h263_slice_structured;
- int alt_inter_vlc; ///< alternative inter vlc
- int modified_quant;
- int loop_filter;
- int custom_pcf;
-
- /* mpeg4 specific */
- int time_increment_bits; ///< number of bits to represent the fractional part of time
- int last_time_base;
- int time_base; ///< time in seconds of last I,P,S Frame
- int64_t time; ///< time of current frame
- int64_t last_non_b_time;
- uint16_t pp_time; ///< time distance between the last 2 p,s,i frames
- uint16_t pb_time; ///< time distance between the last b and p,s,i frame
- uint16_t pp_field_time;
- uint16_t pb_field_time; ///< like above, just for interlaced
- int shape;
- int vol_sprite_usage;
- int sprite_width;
- int sprite_height;
- int sprite_left;
- int sprite_top;
- int sprite_brightness_change;
- int num_sprite_warping_points;
- int real_sprite_warping_points;
- int sprite_offset[2][2]; ///< sprite offset[isChroma][isMVY]
- int sprite_delta[2][2]; ///< sprite_delta [isY][isMVY]
- int sprite_shift[2]; ///< sprite shift [isChroma]
- int mcsel;
- int quant_precision;
- int quarter_sample; ///< 1->qpel, 0->half pel ME/MC
- int scalability;
- int hierachy_type;
- int enhancement_type;
- int new_pred;
- int reduced_res_vop;
- int aspect_ratio_info; //FIXME remove
- int sprite_warping_accuracy;
- int low_latency_sprite;
- int data_partitioning; ///< data partitioning flag from header
- int partitioned_frame; ///< is current frame partitioned
- int rvlc; ///< reversible vlc
- int resync_marker; ///< could this stream contain resync markers
- int low_delay; ///< no reordering needed / has no b-frames
- int vo_type;
- int vol_control_parameters; ///< does the stream contain the low_delay flag, used to workaround buggy encoders
- int intra_dc_threshold; ///< QP above whch the ac VLC should be used for intra dc
- int use_intra_dc_vlc;
- PutBitContext tex_pb; ///< used for data partitioned VOPs
- PutBitContext pb2; ///< used for data partitioned VOPs
- int mpeg_quant;
- int t_frame; ///< time distance of first I -> B, used for interlaced b frames
- int padding_bug_score; ///< used to detect the VERY common padding bug in MPEG4
-
- /* divx specific, used to workaround (many) bugs in divx5 */
- int divx_version;
- int divx_build;
- int divx_packed;
- uint8_t *bitstream_buffer; //Divx 5.01 puts several frames in a single one, this is used to reorder them
- int bitstream_buffer_size;
- unsigned int allocated_bitstream_buffer_size;
-
- int xvid_build;
-
- /* lavc specific stuff, used to workaround bugs in libavcodec */
- int lavc_build;
-
- /* RV10 specific */
- int rv10_version; ///< RV10 version: 0 or 3
- int rv10_first_dc_coded[3];
-
- /* MJPEG specific */
- struct MJpegContext *mjpeg_ctx;
- int mjpeg_vsample[3]; ///< vertical sampling factors, default = {2, 1, 1}
- int mjpeg_hsample[3]; ///< horizontal sampling factors, default = {2, 1, 1}
- int mjpeg_write_tables; ///< do we want to have quantisation- and huffmantables in the jpeg file ?
- int mjpeg_data_only_frames; ///< frames only with SOI, SOS and EOI markers
-
- /* MSMPEG4 specific */
- int mv_table_index;
- int rl_table_index;
- int rl_chroma_table_index;
- int dc_table_index;
- int use_skip_mb_code;
- int slice_height; ///< in macroblocks
- int first_slice_line; ///< used in mpeg4 too to handle resync markers
- int flipflop_rounding;
- int msmpeg4_version; ///< 0=not msmpeg4, 1=mp41, 2=mp42, 3=mp43/divx3 4=wmv1/7 5=wmv2/8
- int per_mb_rl_table;
- int esc3_level_length;
- int esc3_run_length;
- /** [mb_intra][isChroma][level][run][last] */
- int (*ac_stats)[2][MAX_LEVEL+1][MAX_RUN+1][2];
- int inter_intra_pred;
- int mspel;
-
- /* decompression specific */
- GetBitContext gb;
-
- /* Mpeg1 specific */
- int gop_picture_number; ///< index of the first picture of a GOP based on fake_pic_num & mpeg1 specific
- int last_mv_dir; ///< last mv_dir, used for b frame encoding
- int broken_link; ///< no_output_of_prior_pics_flag
- uint8_t *vbv_delay_ptr; ///< pointer to vbv_delay in the bitstream
-
- /* MPEG2 specific - I wish I had not to support this mess. */
- int progressive_sequence;
- int mpeg_f_code[2][2];
- int picture_structure;
-/* picture type */
-#define PICT_TOP_FIELD 1
-#define PICT_BOTTOM_FIELD 2
-#define PICT_FRAME 3
-
- int intra_dc_precision;
- int frame_pred_frame_dct;
- int top_field_first;
- int concealment_motion_vectors;
- int q_scale_type;
- int intra_vlc_format;
- int alternate_scan;
- int repeat_first_field;
- int chroma_420_type;
- int chroma_format;
-#define CHROMA_420 1
-#define CHROMA_422 2
-#define CHROMA_444 3
- int chroma_x_shift;//depend on pix_format, that depend on chroma_format
- int chroma_y_shift;
-
- int progressive_frame;
- int full_pel[2];
- int interlaced_dct;
- int first_slice;
- int first_field; ///< is 1 for the first field of a field picture 0 otherwise
-
- /* RTP specific */
- int rtp_mode;
-
- uint8_t *ptr_lastgob;
- int swap_uv;//vcr2 codec is mpeg2 varint with UV swaped
- short * pblocks[12];
-
- DCTELEM (*block)[64]; ///< points to one of the following blocks
- DCTELEM (*blocks)[8][64]; // for HQ mode we need to keep the best block
- int (*decode_mb)(struct MpegEncContext *s, DCTELEM block[6][64]); // used by some codecs to avoid a switch()
-#define SLICE_OK 0
-#define SLICE_ERROR -1
-#define SLICE_END -2 ///<end marker found
-#define SLICE_NOEND -3 ///<no end marker or error found but mb count exceeded
-
- void (*dct_unquantize_mpeg1_intra)(struct MpegEncContext *s,
- DCTELEM *block/*align 16*/, int n, int qscale);
- void (*dct_unquantize_mpeg1_inter)(struct MpegEncContext *s,
- DCTELEM *block/*align 16*/, int n, int qscale);
- void (*dct_unquantize_mpeg2_intra)(struct MpegEncContext *s,
- DCTELEM *block/*align 16*/, int n, int qscale);
- void (*dct_unquantize_mpeg2_inter)(struct MpegEncContext *s,
- DCTELEM *block/*align 16*/, int n, int qscale);
- void (*dct_unquantize_h263_intra)(struct MpegEncContext *s,
- DCTELEM *block/*align 16*/, int n, int qscale);
- void (*dct_unquantize_h263_inter)(struct MpegEncContext *s,
- DCTELEM *block/*align 16*/, int n, int qscale);
- void (*dct_unquantize_h261_intra)(struct MpegEncContext *s,
- DCTELEM *block/*align 16*/, int n, int qscale);
- void (*dct_unquantize_h261_inter)(struct MpegEncContext *s,
- DCTELEM *block/*align 16*/, int n, int qscale);
- void (*dct_unquantize_intra)(struct MpegEncContext *s, // unquantizer to use (mpeg4 can use both)
- DCTELEM *block/*align 16*/, int n, int qscale);
- void (*dct_unquantize_inter)(struct MpegEncContext *s, // unquantizer to use (mpeg4 can use both)
- DCTELEM *block/*align 16*/, int n, int qscale);
- int (*dct_quantize)(struct MpegEncContext *s, DCTELEM *block/*align 16*/, int n, int qscale, int *overflow);
- int (*fast_dct_quantize)(struct MpegEncContext *s, DCTELEM *block/*align 16*/, int n, int qscale, int *overflow);
- void (*denoise_dct)(struct MpegEncContext *s, DCTELEM *block);
-} MpegEncContext;
-
-
-int DCT_common_init(MpegEncContext *s);
-void MPV_decode_defaults(MpegEncContext *s);
-int MPV_common_init(MpegEncContext *s);
-void MPV_common_end(MpegEncContext *s);
-void MPV_decode_mb(MpegEncContext *s, DCTELEM block[12][64]);
-int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx);
-void MPV_frame_end(MpegEncContext *s);
-int MPV_encode_init(AVCodecContext *avctx);
-int MPV_encode_end(AVCodecContext *avctx);
-int MPV_encode_picture(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data);
-#ifdef HAVE_MMX
-void MPV_common_init_mmx(MpegEncContext *s);
-#endif
-#ifdef ARCH_ALPHA
-void MPV_common_init_axp(MpegEncContext *s);
-#endif
-#ifdef HAVE_MLIB
-void MPV_common_init_mlib(MpegEncContext *s);
-#endif
-#ifdef HAVE_MMI
-void MPV_common_init_mmi(MpegEncContext *s);
-#endif
-#ifdef ARCH_ARMV4L
-void MPV_common_init_armv4l(MpegEncContext *s);
-#endif
-#ifdef ARCH_POWERPC
-void MPV_common_init_ppc(MpegEncContext *s);
-#endif
-extern void (*draw_edges)(uint8_t *buf, int wrap, int width, int height, int w);
-void ff_copy_bits(PutBitContext *pb, uint8_t *src, int length);
-void ff_clean_intra_table_entries(MpegEncContext *s);
-void ff_init_scantable(uint8_t *, ScanTable *st, const uint8_t *src_scantable);
-void ff_draw_horiz_band(MpegEncContext *s, int y, int h);
-void ff_emulated_edge_mc(uint8_t *buf, uint8_t *src, int linesize, int block_w, int block_h,
- int src_x, int src_y, int w, int h);
-void ff_mpeg_flush(AVCodecContext *avctx);
-void ff_print_debug_info(MpegEncContext *s, AVFrame *pict);
-void ff_write_quant_matrix(PutBitContext *pb, uint16_t *matrix);
-int ff_find_unused_picture(MpegEncContext *s, int shared);
-void ff_denoise_dct(MpegEncContext *s, DCTELEM *block);
-void ff_update_duplicate_context(MpegEncContext *dst, MpegEncContext *src);
-const uint8_t *ff_find_start_code(const uint8_t *p, const uint8_t *end, uint32_t *state);
-
-void ff_er_frame_start(MpegEncContext *s);
-void ff_er_frame_end(MpegEncContext *s);
-void ff_er_add_slice(MpegEncContext *s, int startx, int starty, int endx, int endy, int status);
-
-
-extern enum PixelFormat ff_yuv420p_list[2];
-
-void ff_init_block_index(MpegEncContext *s);
-
-static inline void ff_update_block_index(MpegEncContext *s){
- const int block_size= 8>>s->avctx->lowres;
-
- s->block_index[0]+=2;
- s->block_index[1]+=2;
- s->block_index[2]+=2;
- s->block_index[3]+=2;
- s->block_index[4]++;
- s->block_index[5]++;
- s->dest[0]+= 2*block_size;
- s->dest[1]+= block_size;
- s->dest[2]+= block_size;
-}
-
-static inline int get_bits_diff(MpegEncContext *s){
- const int bits= put_bits_count(&s->pb);
- const int last= s->last_bits;
-
- s->last_bits = bits;
-
- return bits - last;
-}
-
-/* motion_est.c */
-void ff_estimate_p_frame_motion(MpegEncContext * s,
- int mb_x, int mb_y);
-void ff_estimate_b_frame_motion(MpegEncContext * s,
- int mb_x, int mb_y);
-int ff_get_best_fcode(MpegEncContext * s, int16_t (*mv_table)[2], int type);
-void ff_fix_long_p_mvs(MpegEncContext * s);
-void ff_fix_long_mvs(MpegEncContext * s, uint8_t *field_select_table, int field_select,
- int16_t (*mv_table)[2], int f_code, int type, int truncate);
-void ff_init_me(MpegEncContext *s);
-int ff_pre_estimate_p_frame_motion(MpegEncContext * s, int mb_x, int mb_y);
-inline int ff_epzs_motion_search(MpegEncContext * s, int *mx_ptr, int *my_ptr,
- int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2],
- int ref_mv_scale, int size, int h);
-inline int ff_get_mb_score(MpegEncContext * s, int mx, int my, int src_index,
- int ref_index, int size, int h, int add_rate);
-
-/* mpeg12.c */
-extern const uint16_t ff_mpeg1_default_intra_matrix[64];
-extern const uint16_t ff_mpeg1_default_non_intra_matrix[64];
-extern const uint8_t ff_mpeg1_dc_scale_table[128];
-
-void mpeg1_encode_picture_header(MpegEncContext *s, int picture_number);
-void mpeg1_encode_mb(MpegEncContext *s,
- DCTELEM block[6][64],
- int motion_x, int motion_y);
-void ff_mpeg1_encode_init(MpegEncContext *s);
-void ff_mpeg1_encode_slice_header(MpegEncContext *s);
-void ff_mpeg1_clean_buffers(MpegEncContext *s);
-
-
-/** RLTable. */
-typedef struct RLTable {
- int n; ///< number of entries of table_vlc minus 1
- int last; ///< number of values for last = 0
- const uint16_t (*table_vlc)[2];
- const int8_t *table_run;
- const int8_t *table_level;
- uint8_t *index_run[2]; ///< encoding only
- int8_t *max_level[2]; ///< encoding & decoding
- int8_t *max_run[2]; ///< encoding & decoding
- VLC vlc; ///< decoding only deprected FIXME remove
- RL_VLC_ELEM *rl_vlc[32]; ///< decoding only
-} RLTable;
-
-void init_rl(RLTable *rl, int use_static);
-void init_vlc_rl(RLTable *rl, int use_static);
-
-static inline int get_rl_index(const RLTable *rl, int last, int run, int level)
-{
- int index;
- index = rl->index_run[last][run];
- if (index >= rl->n)
- return rl->n;
- if (level > rl->max_level[last][run])
- return rl->n;
- return index + level - 1;
-}
-
-extern const uint8_t ff_mpeg4_y_dc_scale_table[32];
-extern const uint8_t ff_mpeg4_c_dc_scale_table[32];
-extern const uint8_t ff_aic_dc_scale_table[32];
-extern const int16_t ff_mpeg4_default_intra_matrix[64];
-extern const int16_t ff_mpeg4_default_non_intra_matrix[64];
-extern const uint8_t ff_h263_chroma_qscale_table[32];
-extern const uint8_t ff_h263_loop_filter_strength[32];
-
-/* h261.c */
-void ff_h261_loop_filter(MpegEncContext *s);
-void ff_h261_reorder_mb_index(MpegEncContext* s);
-void ff_h261_encode_mb(MpegEncContext *s,
- DCTELEM block[6][64],
- int motion_x, int motion_y);
-void ff_h261_encode_picture_header(MpegEncContext * s, int picture_number);
-void ff_h261_encode_init(MpegEncContext *s);
-int ff_h261_get_picture_format(int width, int height);
-
-
-/* h263.c, h263dec.c */
-int ff_h263_decode_init(AVCodecContext *avctx);
-int ff_h263_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size);
-int ff_h263_decode_end(AVCodecContext *avctx);
-void h263_encode_mb(MpegEncContext *s,
- DCTELEM block[6][64],
- int motion_x, int motion_y);
-void mpeg4_encode_mb(MpegEncContext *s,
- DCTELEM block[6][64],
- int motion_x, int motion_y);
-void h263_encode_picture_header(MpegEncContext *s, int picture_number);
-void ff_flv_encode_picture_header(MpegEncContext *s, int picture_number);
-void h263_encode_gob_header(MpegEncContext * s, int mb_line);
-int16_t *h263_pred_motion(MpegEncContext * s, int block, int dir,
- int *px, int *py);
-void mpeg4_pred_ac(MpegEncContext * s, DCTELEM *block, int n,
- int dir);
-void ff_set_mpeg4_time(MpegEncContext * s, int picture_number);
-void mpeg4_encode_picture_header(MpegEncContext *s, int picture_number);
-#ifdef CONFIG_ENCODERS
-void h263_encode_init(MpegEncContext *s);
-#else
-static void h263_encode_init(MpegEncContext *s) {assert(0);}
-#endif
-void h263_decode_init_vlc(MpegEncContext *s);
-int h263_decode_picture_header(MpegEncContext *s);
-int ff_h263_decode_gob_header(MpegEncContext *s);
-int ff_mpeg4_decode_picture_header(MpegEncContext * s, GetBitContext *gb);
-void ff_h263_update_motion_val(MpegEncContext * s);
-void ff_h263_loop_filter(MpegEncContext * s);
-void ff_set_qscale(MpegEncContext * s, int qscale);
-int ff_h263_decode_mba(MpegEncContext *s);
-void ff_h263_encode_mba(MpegEncContext *s);
-
-int intel_h263_decode_picture_header(MpegEncContext *s);
-int flv_h263_decode_picture_header(MpegEncContext *s);
-int ff_h263_decode_mb(MpegEncContext *s,
- DCTELEM block[6][64]);
-int ff_mpeg4_decode_mb(MpegEncContext *s,
- DCTELEM block[6][64]);
-int h263_get_picture_format(int width, int height);
-void ff_mpeg4_encode_video_packet_header(MpegEncContext *s);
-void ff_mpeg4_clean_buffers(MpegEncContext *s);
-void ff_mpeg4_stuffing(PutBitContext * pbc);
-void ff_mpeg4_init_partitions(MpegEncContext *s);
-void ff_mpeg4_merge_partitions(MpegEncContext *s);
-void ff_clean_mpeg4_qscales(MpegEncContext *s);
-void ff_clean_h263_qscales(MpegEncContext *s);
-int ff_mpeg4_decode_partitions(MpegEncContext *s);
-int ff_mpeg4_get_video_packet_prefix_length(MpegEncContext *s);
-int ff_h263_resync(MpegEncContext *s);
-int ff_h263_get_gob_height(MpegEncContext *s);
-void ff_mpeg4_init_direct_mv(MpegEncContext *s);
-int ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int my);
-int ff_h263_round_chroma(int x);
-void ff_h263_encode_motion(MpegEncContext * s, int val, int f_code);
-
-
-/* rv10.c */
-void rv10_encode_picture_header(MpegEncContext *s, int picture_number);
-int rv_decode_dc(MpegEncContext *s, int n);
-void rv20_encode_picture_header(MpegEncContext *s, int picture_number);
-
-
-/* msmpeg4.c */
-void msmpeg4_encode_picture_header(MpegEncContext * s, int picture_number);
-void msmpeg4_encode_ext_header(MpegEncContext * s);
-void msmpeg4_encode_mb(MpegEncContext * s,
- DCTELEM block[6][64],
- int motion_x, int motion_y);
-int msmpeg4_decode_picture_header(MpegEncContext * s);
-int msmpeg4_decode_ext_header(MpegEncContext * s, int buf_size);
-int ff_msmpeg4_decode_init(MpegEncContext *s);
-void ff_msmpeg4_encode_init(MpegEncContext *s);
-int ff_wmv2_decode_picture_header(MpegEncContext * s);
-int ff_wmv2_decode_secondary_picture_header(MpegEncContext * s);
-void ff_wmv2_add_mb(MpegEncContext *s, DCTELEM block[6][64], uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr);
-void ff_mspel_motion(MpegEncContext *s,
- uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
- uint8_t **ref_picture, op_pixels_func (*pix_op)[4],
- int motion_x, int motion_y, int h);
-int ff_wmv2_encode_picture_header(MpegEncContext * s, int picture_number);
-void ff_wmv2_encode_mb(MpegEncContext * s,
- DCTELEM block[6][64],
- int motion_x, int motion_y);
-
-/* mjpeg.c */
-int mjpeg_init(MpegEncContext *s);
-void mjpeg_close(MpegEncContext *s);
-void mjpeg_encode_mb(MpegEncContext *s,
- DCTELEM block[6][64]);
-void mjpeg_picture_header(MpegEncContext *s);
-void mjpeg_picture_trailer(MpegEncContext *s);
-void ff_mjpeg_stuffing(PutBitContext * pbc);
-
-#endif /* AVCODEC_MPEGVIDEO_H */
-
diff --git a/src/libffmpeg/libavcodec/msmpeg4.c b/src/libffmpeg/libavcodec/msmpeg4.c
deleted file mode 100644
index a8124172b..000000000
--- a/src/libffmpeg/libavcodec/msmpeg4.c
+++ /dev/null
@@ -1,1938 +0,0 @@
-/*
- * MSMPEG4 backend for ffmpeg encoder and decoder
- * Copyright (c) 2001 Fabrice Bellard.
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * msmpeg4v1 & v2 stuff by Michael Niedermayer <michaelni@gmx.at>
- */
-
-/**
- * @file msmpeg4.c
- * MSMPEG4 backend for ffmpeg encoder and decoder.
- */
-
-#include "avcodec.h"
-#include "dsputil.h"
-#include "mpegvideo.h"
-
-/*
- * You can also call this codec : MPEG4 with a twist !
- *
- * TODO:
- * - (encoding) select best mv table (two choices)
- * - (encoding) select best vlc/dc table
- */
-//#define DEBUG
-
-#define DC_VLC_BITS 9
-#define CBPY_VLC_BITS 6
-#define INTER_INTRA_VLC_BITS 3
-#define V1_INTRA_CBPC_VLC_BITS 6
-#define V1_INTER_CBPC_VLC_BITS 6
-#define V2_INTRA_CBPC_VLC_BITS 3
-#define V2_MB_TYPE_VLC_BITS 7
-#define MV_VLC_BITS 9
-#define V2_MV_VLC_BITS 9
-#define TEX_VLC_BITS 9
-#define MB_NON_INTRA_VLC_BITS 9
-#define MB_INTRA_VLC_BITS 9
-
-#define II_BITRATE 128*1024
-#define MBAC_BITRATE 50*1024
-
-#define DEFAULT_INTER_INDEX 3
-
-static uint32_t v2_dc_lum_table[512][2];
-static uint32_t v2_dc_chroma_table[512][2];
-
-static inline void msmpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n);
-static inline int msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
- int n, int coded, const uint8_t *scantable);
-static int msmpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr);
-static int msmpeg4_decode_motion(MpegEncContext * s,
- int *mx_ptr, int *my_ptr);
-static void init_h263_dc_for_msmpeg4(void);
-static inline void msmpeg4_memsetw(short *tab, int val, int n);
-#ifdef CONFIG_ENCODERS
-static void msmpeg4v2_encode_motion(MpegEncContext * s, int val);
-static int get_size_of_code(MpegEncContext * s, RLTable *rl, int last, int run, int level, int intra);
-#endif //CONFIG_ENCODERS
-static int msmpeg4v12_decode_mb(MpegEncContext *s, DCTELEM block[6][64]);
-static int msmpeg4v34_decode_mb(MpegEncContext *s, DCTELEM block[6][64]);
-static int wmv2_decode_mb(MpegEncContext *s, DCTELEM block[6][64]);
-
-/* vc1 externs */
-extern uint8_t wmv3_dc_scale_table[32];
-
-#ifdef DEBUG
-int intra_count = 0;
-int frame_count = 0;
-#endif
-
-#include "msmpeg4data.h"
-
-#ifdef CONFIG_ENCODERS //strangely gcc includes this even if its not references
-static uint8_t rl_length[NB_RL_TABLES][MAX_LEVEL+1][MAX_RUN+1][2];
-#endif //CONFIG_ENCODERS
-
-static void common_init(MpegEncContext * s)
-{
- static int inited=0;
-
- switch(s->msmpeg4_version){
- case 1:
- case 2:
- s->y_dc_scale_table=
- s->c_dc_scale_table= ff_mpeg1_dc_scale_table;
- break;
- case 3:
- if(s->workaround_bugs){
- s->y_dc_scale_table= old_ff_y_dc_scale_table;
- s->c_dc_scale_table= old_ff_c_dc_scale_table;
- } else{
- s->y_dc_scale_table= ff_mpeg4_y_dc_scale_table;
- s->c_dc_scale_table= ff_mpeg4_c_dc_scale_table;
- }
- break;
- case 4:
- case 5:
- s->y_dc_scale_table= wmv1_y_dc_scale_table;
- s->c_dc_scale_table= wmv1_c_dc_scale_table;
- break;
-#if defined(CONFIG_WMV3_DECODER)||defined(CONFIG_VC1_DECODER)
- case 6:
- s->y_dc_scale_table= wmv3_dc_scale_table;
- s->c_dc_scale_table= wmv3_dc_scale_table;
- break;
-#endif
-
- }
-
-
- if(s->msmpeg4_version>=4){
- ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable , wmv1_scantable[1]);
- ff_init_scantable(s->dsp.idct_permutation, &s->intra_h_scantable, wmv1_scantable[2]);
- ff_init_scantable(s->dsp.idct_permutation, &s->intra_v_scantable, wmv1_scantable[3]);
- ff_init_scantable(s->dsp.idct_permutation, &s->inter_scantable , wmv1_scantable[0]);
- }
- //Note the default tables are set in common_init in mpegvideo.c
-
- if(!inited){
- inited=1;
-
- init_h263_dc_for_msmpeg4();
- }
-}
-
-#ifdef CONFIG_ENCODERS
-
-/* build the table which associate a (x,y) motion vector to a vlc */
-static void init_mv_table(MVTable *tab)
-{
- int i, x, y;
-
- tab->table_mv_index = av_malloc(sizeof(uint16_t) * 4096);
- /* mark all entries as not used */
- for(i=0;i<4096;i++)
- tab->table_mv_index[i] = tab->n;
-
- for(i=0;i<tab->n;i++) {
- x = tab->table_mvx[i];
- y = tab->table_mvy[i];
- tab->table_mv_index[(x << 6) | y] = i;
- }
-}
-
-static void code012(PutBitContext *pb, int n)
-{
- if (n == 0) {
- put_bits(pb, 1, 0);
- } else {
- put_bits(pb, 1, 1);
- put_bits(pb, 1, (n >= 2));
- }
-}
-
-void ff_msmpeg4_encode_init(MpegEncContext *s)
-{
- static int init_done=0;
- int i;
-
- common_init(s);
- if(s->msmpeg4_version>=4){
- s->min_qcoeff= -255;
- s->max_qcoeff= 255;
- }
-
- if (!init_done) {
- /* init various encoding tables */
- init_done = 1;
- init_mv_table(&mv_tables[0]);
- init_mv_table(&mv_tables[1]);
- for(i=0;i<NB_RL_TABLES;i++)
- init_rl(&rl_table[i], 1);
-
- for(i=0; i<NB_RL_TABLES; i++){
- int level;
- for(level=0; level<=MAX_LEVEL; level++){
- int run;
- for(run=0; run<=MAX_RUN; run++){
- int last;
- for(last=0; last<2; last++){
- rl_length[i][level][run][last]= get_size_of_code(s, &rl_table[ i], last, run, level, 0);
- }
- }
- }
- }
- }
-}
-
-static int get_size_of_code(MpegEncContext * s, RLTable *rl, int last, int run, int level, int intra){
- int size=0;
- int code;
- int run_diff= intra ? 0 : 1;
-
- code = get_rl_index(rl, last, run, level);
- size+= rl->table_vlc[code][1];
- if (code == rl->n) {
- int level1, run1;
-
- level1 = level - rl->max_level[last][run];
- if (level1 < 1)
- goto esc2;
- code = get_rl_index(rl, last, run, level1);
- if (code == rl->n) {
- esc2:
- size++;
- if (level > MAX_LEVEL)
- goto esc3;
- run1 = run - rl->max_run[last][level] - run_diff;
- if (run1 < 0)
- goto esc3;
- code = get_rl_index(rl, last, run1, level);
- if (code == rl->n) {
- esc3:
- /* third escape */
- size+=1+1+6+8;
- } else {
- /* second escape */
- size+= 1+1+ rl->table_vlc[code][1];
- }
- } else {
- /* first escape */
- size+= 1+1+ rl->table_vlc[code][1];
- }
- } else {
- size++;
- }
- return size;
-}
-
-static void find_best_tables(MpegEncContext * s)
-{
- int i;
- int best =-1, best_size =9999999;
- int chroma_best=-1, best_chroma_size=9999999;
-
- for(i=0; i<3; i++){
- int level;
- int chroma_size=0;
- int size=0;
-
- if(i>0){// ;)
- size++;
- chroma_size++;
- }
- for(level=0; level<=MAX_LEVEL; level++){
- int run;
- for(run=0; run<=MAX_RUN; run++){
- int last;
- const int last_size= size + chroma_size;
- for(last=0; last<2; last++){
- int inter_count = s->ac_stats[0][0][level][run][last] + s->ac_stats[0][1][level][run][last];
- int intra_luma_count = s->ac_stats[1][0][level][run][last];
- int intra_chroma_count= s->ac_stats[1][1][level][run][last];
-
- if(s->pict_type==I_TYPE){
- size += intra_luma_count *rl_length[i ][level][run][last];
- chroma_size+= intra_chroma_count*rl_length[i+3][level][run][last];
- }else{
- size+= intra_luma_count *rl_length[i ][level][run][last]
- +intra_chroma_count*rl_length[i+3][level][run][last]
- +inter_count *rl_length[i+3][level][run][last];
- }
- }
- if(last_size == size+chroma_size) break;
- }
- }
- if(size<best_size){
- best_size= size;
- best= i;
- }
- if(chroma_size<best_chroma_size){
- best_chroma_size= chroma_size;
- chroma_best= i;
- }
- }
-
-// printf("type:%d, best:%d, qp:%d, var:%d, mcvar:%d, size:%d //\n",
-// s->pict_type, best, s->qscale, s->mb_var_sum, s->mc_mb_var_sum, best_size);
-
- if(s->pict_type==P_TYPE) chroma_best= best;
-
- memset(s->ac_stats, 0, sizeof(int)*(MAX_LEVEL+1)*(MAX_RUN+1)*2*2*2);
-
- s->rl_table_index = best;
- s->rl_chroma_table_index= chroma_best;
-
- if(s->pict_type != s->last_non_b_pict_type){
- s->rl_table_index= 2;
- if(s->pict_type==I_TYPE)
- s->rl_chroma_table_index= 1;
- else
- s->rl_chroma_table_index= 2;
- }
-
-}
-
-/* write MSMPEG4 compatible frame header */
-void msmpeg4_encode_picture_header(MpegEncContext * s, int picture_number)
-{
- find_best_tables(s);
-
- align_put_bits(&s->pb);
- put_bits(&s->pb, 2, s->pict_type - 1);
-
- put_bits(&s->pb, 5, s->qscale);
- if(s->msmpeg4_version<=2){
- s->rl_table_index = 2;
- s->rl_chroma_table_index = 2;
- }
-
- s->dc_table_index = 1;
- s->mv_table_index = 1; /* only if P frame */
- s->use_skip_mb_code = 1; /* only if P frame */
- s->per_mb_rl_table = 0;
- if(s->msmpeg4_version==4)
- s->inter_intra_pred= (s->width*s->height < 320*240 && s->bit_rate<=II_BITRATE && s->pict_type==P_TYPE);
-//printf("%d %d %d %d %d\n", s->pict_type, s->bit_rate, s->inter_intra_pred, s->width, s->height);
-
- if (s->pict_type == I_TYPE) {
- s->slice_height= s->mb_height/1;
- put_bits(&s->pb, 5, 0x16 + s->mb_height/s->slice_height);
-
- if(s->msmpeg4_version==4){
- msmpeg4_encode_ext_header(s);
- if(s->bit_rate>MBAC_BITRATE)
- put_bits(&s->pb, 1, s->per_mb_rl_table);
- }
-
- if(s->msmpeg4_version>2){
- if(!s->per_mb_rl_table){
- code012(&s->pb, s->rl_chroma_table_index);
- code012(&s->pb, s->rl_table_index);
- }
-
- put_bits(&s->pb, 1, s->dc_table_index);
- }
- } else {
- put_bits(&s->pb, 1, s->use_skip_mb_code);
-
- if(s->msmpeg4_version==4 && s->bit_rate>MBAC_BITRATE)
- put_bits(&s->pb, 1, s->per_mb_rl_table);
-
- if(s->msmpeg4_version>2){
- if(!s->per_mb_rl_table)
- code012(&s->pb, s->rl_table_index);
-
- put_bits(&s->pb, 1, s->dc_table_index);
-
- put_bits(&s->pb, 1, s->mv_table_index);
- }
- }
-
- s->esc3_level_length= 0;
- s->esc3_run_length= 0;
-
-#ifdef DEBUG
- intra_count = 0;
- av_log(s->avctx, AV_LOG_DEBUG, "*****frame %d:\n", frame_count++);
-#endif
-}
-
-void msmpeg4_encode_ext_header(MpegEncContext * s)
-{
- put_bits(&s->pb, 5, s->avctx->time_base.den / s->avctx->time_base.num); //yes 29.97 -> 29
-
- put_bits(&s->pb, 11, FFMIN(s->bit_rate/1024, 2047));
-
- if(s->msmpeg4_version>=3)
- put_bits(&s->pb, 1, s->flipflop_rounding);
- else
- assert(s->flipflop_rounding==0);
-}
-
-#endif //CONFIG_ENCODERS
-
-/* predict coded block */
-static inline int coded_block_pred(MpegEncContext * s, int n, uint8_t **coded_block_ptr)
-{
- int xy, wrap, pred, a, b, c;
-
- xy = s->block_index[n];
- wrap = s->b8_stride;
-
- /* B C
- * A X
- */
- a = s->coded_block[xy - 1 ];
- b = s->coded_block[xy - 1 - wrap];
- c = s->coded_block[xy - wrap];
-
- if (b == c) {
- pred = a;
- } else {
- pred = c;
- }
-
- /* store value */
- *coded_block_ptr = &s->coded_block[xy];
-
- return pred;
-}
-
-#ifdef CONFIG_ENCODERS
-
-static void msmpeg4_encode_motion(MpegEncContext * s,
- int mx, int my)
-{
- int code;
- MVTable *mv;
-
- /* modulo encoding */
- /* WARNING : you cannot reach all the MVs even with the modulo
- encoding. This is a somewhat strange compromise they took !!! */
- if (mx <= -64)
- mx += 64;
- else if (mx >= 64)
- mx -= 64;
- if (my <= -64)
- my += 64;
- else if (my >= 64)
- my -= 64;
-
- mx += 32;
- my += 32;
-#if 0
- if ((unsigned)mx >= 64 ||
- (unsigned)my >= 64)
- av_log(s->avctx, AV_LOG_ERROR, "error mx=%d my=%d\n", mx, my);
-#endif
- mv = &mv_tables[s->mv_table_index];
-
- code = mv->table_mv_index[(mx << 6) | my];
- put_bits(&s->pb,
- mv->table_mv_bits[code],
- mv->table_mv_code[code]);
- if (code == mv->n) {
- /* escape : code litterally */
- put_bits(&s->pb, 6, mx);
- put_bits(&s->pb, 6, my);
- }
-}
-
-static inline void handle_slices(MpegEncContext *s){
- if (s->mb_x == 0) {
- if (s->slice_height && (s->mb_y % s->slice_height) == 0) {
- if(s->msmpeg4_version < 4){
- ff_mpeg4_clean_buffers(s);
- }
- s->first_slice_line = 1;
- } else {
- s->first_slice_line = 0;
- }
- }
-}
-
-void msmpeg4_encode_mb(MpegEncContext * s,
- DCTELEM block[6][64],
- int motion_x, int motion_y)
-{
- int cbp, coded_cbp, i;
- int pred_x, pred_y;
- uint8_t *coded_block;
-
- handle_slices(s);
-
- if (!s->mb_intra) {
- /* compute cbp */
- cbp = 0;
- for (i = 0; i < 6; i++) {
- if (s->block_last_index[i] >= 0)
- cbp |= 1 << (5 - i);
- }
- if (s->use_skip_mb_code && (cbp | motion_x | motion_y) == 0) {
- /* skip macroblock */
- put_bits(&s->pb, 1, 1);
- s->last_bits++;
- s->misc_bits++;
- s->skip_count++;
-
- return;
- }
- if (s->use_skip_mb_code)
- put_bits(&s->pb, 1, 0); /* mb coded */
-
- if(s->msmpeg4_version<=2){
- put_bits(&s->pb,
- v2_mb_type[cbp&3][1],
- v2_mb_type[cbp&3][0]);
- if((cbp&3) != 3) coded_cbp= cbp ^ 0x3C;
- else coded_cbp= cbp;
-
- put_bits(&s->pb,
- cbpy_tab[coded_cbp>>2][1],
- cbpy_tab[coded_cbp>>2][0]);
-
- s->misc_bits += get_bits_diff(s);
-
- h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
- msmpeg4v2_encode_motion(s, motion_x - pred_x);
- msmpeg4v2_encode_motion(s, motion_y - pred_y);
- }else{
- put_bits(&s->pb,
- table_mb_non_intra[cbp + 64][1],
- table_mb_non_intra[cbp + 64][0]);
-
- s->misc_bits += get_bits_diff(s);
-
- /* motion vector */
- h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
- msmpeg4_encode_motion(s, motion_x - pred_x,
- motion_y - pred_y);
- }
-
- s->mv_bits += get_bits_diff(s);
-
- for (i = 0; i < 6; i++) {
- msmpeg4_encode_block(s, block[i], i);
- }
- s->p_tex_bits += get_bits_diff(s);
- } else {
- /* compute cbp */
- cbp = 0;
- coded_cbp = 0;
- for (i = 0; i < 6; i++) {
- int val, pred;
- val = (s->block_last_index[i] >= 1);
- cbp |= val << (5 - i);
- if (i < 4) {
- /* predict value for close blocks only for luma */
- pred = coded_block_pred(s, i, &coded_block);
- *coded_block = val;
- val = val ^ pred;
- }
- coded_cbp |= val << (5 - i);
- }
-#if 0
- if (coded_cbp)
- printf("cbp=%x %x\n", cbp, coded_cbp);
-#endif
-
- if(s->msmpeg4_version<=2){
- if (s->pict_type == I_TYPE) {
- put_bits(&s->pb,
- v2_intra_cbpc[cbp&3][1], v2_intra_cbpc[cbp&3][0]);
- } else {
- if (s->use_skip_mb_code)
- put_bits(&s->pb, 1, 0); /* mb coded */
- put_bits(&s->pb,
- v2_mb_type[(cbp&3) + 4][1],
- v2_mb_type[(cbp&3) + 4][0]);
- }
- put_bits(&s->pb, 1, 0); /* no AC prediction yet */
- put_bits(&s->pb,
- cbpy_tab[cbp>>2][1],
- cbpy_tab[cbp>>2][0]);
- }else{
- if (s->pict_type == I_TYPE) {
- put_bits(&s->pb,
- ff_msmp4_mb_i_table[coded_cbp][1], ff_msmp4_mb_i_table[coded_cbp][0]);
- } else {
- if (s->use_skip_mb_code)
- put_bits(&s->pb, 1, 0); /* mb coded */
- put_bits(&s->pb,
- table_mb_non_intra[cbp][1],
- table_mb_non_intra[cbp][0]);
- }
- put_bits(&s->pb, 1, 0); /* no AC prediction yet */
- if(s->inter_intra_pred){
- s->h263_aic_dir=0;
- put_bits(&s->pb, table_inter_intra[s->h263_aic_dir][1], table_inter_intra[s->h263_aic_dir][0]);
- }
- }
- s->misc_bits += get_bits_diff(s);
-
- for (i = 0; i < 6; i++) {
- msmpeg4_encode_block(s, block[i], i);
- }
- s->i_tex_bits += get_bits_diff(s);
- s->i_count++;
- }
-}
-
-#endif //CONFIG_ENCODERS
-
-static inline int msmpeg4v1_pred_dc(MpegEncContext * s, int n,
- int32_t **dc_val_ptr)
-{
- int i;
-
- if (n < 4) {
- i= 0;
- } else {
- i= n-3;
- }
-
- *dc_val_ptr= &s->last_dc[i];
- return s->last_dc[i];
-}
-
-static int get_dc(uint8_t *src, int stride, int scale)
-{
- int y;
- int sum=0;
- for(y=0; y<8; y++){
- int x;
- for(x=0; x<8; x++){
- sum+=src[x + y*stride];
- }
- }
- return FASTDIV((sum + (scale>>1)), scale);
-}
-
-/* dir = 0: left, dir = 1: top prediction */
-static inline int msmpeg4_pred_dc(MpegEncContext * s, int n,
- int16_t **dc_val_ptr, int *dir_ptr)
-{
- int a, b, c, wrap, pred, scale;
- int16_t *dc_val;
-
- /* find prediction */
- if (n < 4) {
- scale = s->y_dc_scale;
- } else {
- scale = s->c_dc_scale;
- }
-
- wrap = s->block_wrap[n];
- dc_val= s->dc_val[0] + s->block_index[n];
-
- /* B C
- * A X
- */
- a = dc_val[ - 1];
- b = dc_val[ - 1 - wrap];
- c = dc_val[ - wrap];
-
- if(s->first_slice_line && (n&2)==0 && s->msmpeg4_version<4){
- b=c=1024;
- }
-
- /* XXX: the following solution consumes divisions, but it does not
- necessitate to modify mpegvideo.c. The problem comes from the
- fact they decided to store the quantized DC (which would lead
- to problems if Q could vary !) */
-#if (defined(ARCH_X86)) && !defined PIC
- asm volatile(
- "movl %3, %%eax \n\t"
- "shrl $1, %%eax \n\t"
- "addl %%eax, %2 \n\t"
- "addl %%eax, %1 \n\t"
- "addl %0, %%eax \n\t"
- "mull %4 \n\t"
- "movl %%edx, %0 \n\t"
- "movl %1, %%eax \n\t"
- "mull %4 \n\t"
- "movl %%edx, %1 \n\t"
- "movl %2, %%eax \n\t"
- "mull %4 \n\t"
- "movl %%edx, %2 \n\t"
- : "+b" (a), "+c" (b), "+D" (c)
- : "g" (scale), "S" (ff_inverse[scale])
- : "%eax", "%edx"
- );
-#else
- /* #elif defined (ARCH_ALPHA) */
- /* Divisions are extremely costly on Alpha; optimize the most
- common case. But they are costly everywhere...
- */
- if (scale == 8) {
- a = (a + (8 >> 1)) / 8;
- b = (b + (8 >> 1)) / 8;
- c = (c + (8 >> 1)) / 8;
- } else {
- a = FASTDIV((a + (scale >> 1)), scale);
- b = FASTDIV((b + (scale >> 1)), scale);
- c = FASTDIV((c + (scale >> 1)), scale);
- }
-#endif
- /* XXX: WARNING: they did not choose the same test as MPEG4. This
- is very important ! */
- if(s->msmpeg4_version>3){
- if(s->inter_intra_pred){
- uint8_t *dest;
- int wrap;
-
- if(n==1){
- pred=a;
- *dir_ptr = 0;
- }else if(n==2){
- pred=c;
- *dir_ptr = 1;
- }else if(n==3){
- if (abs(a - b) < abs(b - c)) {
- pred = c;
- *dir_ptr = 1;
- } else {
- pred = a;
- *dir_ptr = 0;
- }
- }else{
- if(n<4){
- wrap= s->linesize;
- dest= s->current_picture.data[0] + (((n>>1) + 2*s->mb_y) * 8* wrap ) + ((n&1) + 2*s->mb_x) * 8;
- }else{
- wrap= s->uvlinesize;
- dest= s->current_picture.data[n-3] + (s->mb_y * 8 * wrap) + s->mb_x * 8;
- }
- if(s->mb_x==0) a= (1024 + (scale>>1))/scale;
- else a= get_dc(dest-8, wrap, scale*8);
- if(s->mb_y==0) c= (1024 + (scale>>1))/scale;
- else c= get_dc(dest-8*wrap, wrap, scale*8);
-
- if (s->h263_aic_dir==0) {
- pred= a;
- *dir_ptr = 0;
- }else if (s->h263_aic_dir==1) {
- if(n==0){
- pred= c;
- *dir_ptr = 1;
- }else{
- pred= a;
- *dir_ptr = 0;
- }
- }else if (s->h263_aic_dir==2) {
- if(n==0){
- pred= a;
- *dir_ptr = 0;
- }else{
- pred= c;
- *dir_ptr = 1;
- }
- } else {
- pred= c;
- *dir_ptr = 1;
- }
- }
- }else{
- if (abs(a - b) < abs(b - c)) {
- pred = c;
- *dir_ptr = 1;
- } else {
- pred = a;
- *dir_ptr = 0;
- }
- }
- }else{
- if (abs(a - b) <= abs(b - c)) {
- pred = c;
- *dir_ptr = 1;
- } else {
- pred = a;
- *dir_ptr = 0;
- }
- }
-
- /* update predictor */
- *dc_val_ptr = &dc_val[0];
- return pred;
-}
-
-#define DC_MAX 119
-
-static void msmpeg4_encode_dc(MpegEncContext * s, int level, int n, int *dir_ptr)
-{
- int sign, code;
- int pred;
-
- if(s->msmpeg4_version==1){
- int32_t *dc_val;
- pred = msmpeg4v1_pred_dc(s, n, &dc_val);
-
- /* update predictor */
- *dc_val= level;
- }else{
- int16_t *dc_val;
- pred = msmpeg4_pred_dc(s, n, &dc_val, dir_ptr);
-
- /* update predictor */
- if (n < 4) {
- *dc_val = level * s->y_dc_scale;
- } else {
- *dc_val = level * s->c_dc_scale;
- }
- }
-
- /* do the prediction */
- level -= pred;
-
- if(s->msmpeg4_version<=2){
- if (n < 4) {
- put_bits(&s->pb,
- v2_dc_lum_table[level+256][1],
- v2_dc_lum_table[level+256][0]);
- }else{
- put_bits(&s->pb,
- v2_dc_chroma_table[level+256][1],
- v2_dc_chroma_table[level+256][0]);
- }
- }else{
- sign = 0;
- if (level < 0) {
- level = -level;
- sign = 1;
- }
- code = level;
- if (code > DC_MAX)
- code = DC_MAX;
-
- if (s->dc_table_index == 0) {
- if (n < 4) {
- put_bits(&s->pb, ff_table0_dc_lum[code][1], ff_table0_dc_lum[code][0]);
- } else {
- put_bits(&s->pb, ff_table0_dc_chroma[code][1], ff_table0_dc_chroma[code][0]);
- }
- } else {
- if (n < 4) {
- put_bits(&s->pb, ff_table1_dc_lum[code][1], ff_table1_dc_lum[code][0]);
- } else {
- put_bits(&s->pb, ff_table1_dc_chroma[code][1], ff_table1_dc_chroma[code][0]);
- }
- }
-
- if (code == DC_MAX)
- put_bits(&s->pb, 8, level);
-
- if (level != 0) {
- put_bits(&s->pb, 1, sign);
- }
- }
-}
-
-/* Encoding of a block. Very similar to MPEG4 except for a different
- escape coding (same as H263) and more vlc tables.
- */
-static inline void msmpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n)
-{
- int level, run, last, i, j, last_index;
- int last_non_zero, sign, slevel;
- int code, run_diff, dc_pred_dir;
- const RLTable *rl;
- const uint8_t *scantable;
-
- if (s->mb_intra) {
- msmpeg4_encode_dc(s, block[0], n, &dc_pred_dir);
- i = 1;
- if (n < 4) {
- rl = &rl_table[s->rl_table_index];
- } else {
- rl = &rl_table[3 + s->rl_chroma_table_index];
- }
- run_diff = 0;
- scantable= s->intra_scantable.permutated;
- } else {
- i = 0;
- rl = &rl_table[3 + s->rl_table_index];
- if(s->msmpeg4_version<=2)
- run_diff = 0;
- else
- run_diff = 1;
- scantable= s->inter_scantable.permutated;
- }
-
- /* recalculate block_last_index for M$ wmv1 */
- if(s->msmpeg4_version>=4 && s->block_last_index[n]>0){
- for(last_index=63; last_index>=0; last_index--){
- if(block[scantable[last_index]]) break;
- }
- s->block_last_index[n]= last_index;
- }else
- last_index = s->block_last_index[n];
- /* AC coefs */
- last_non_zero = i - 1;
- for (; i <= last_index; i++) {
- j = scantable[i];
- level = block[j];
- if (level) {
- run = i - last_non_zero - 1;
- last = (i == last_index);
- sign = 0;
- slevel = level;
- if (level < 0) {
- sign = 1;
- level = -level;
- }
-
- if(level<=MAX_LEVEL && run<=MAX_RUN){
- s->ac_stats[s->mb_intra][n>3][level][run][last]++;
- }
-#if 0
-else
- s->ac_stats[s->mb_intra][n>3][40][63][0]++; //esc3 like
-#endif
- code = get_rl_index(rl, last, run, level);
- put_bits(&s->pb, rl->table_vlc[code][1], rl->table_vlc[code][0]);
- if (code == rl->n) {
- int level1, run1;
-
- level1 = level - rl->max_level[last][run];
- if (level1 < 1)
- goto esc2;
- code = get_rl_index(rl, last, run, level1);
- if (code == rl->n) {
- esc2:
- put_bits(&s->pb, 1, 0);
- if (level > MAX_LEVEL)
- goto esc3;
- run1 = run - rl->max_run[last][level] - run_diff;
- if (run1 < 0)
- goto esc3;
- code = get_rl_index(rl, last, run1, level);
- if (code == rl->n) {
- esc3:
- /* third escape */
- put_bits(&s->pb, 1, 0);
- put_bits(&s->pb, 1, last);
- if(s->msmpeg4_version>=4){
- if(s->esc3_level_length==0){
- s->esc3_level_length=8;
- s->esc3_run_length= 6;
- if(s->qscale<8)
- put_bits(&s->pb, 6, 3);
- else
- put_bits(&s->pb, 8, 3);
- }
- put_bits(&s->pb, s->esc3_run_length, run);
- put_bits(&s->pb, 1, sign);
- put_bits(&s->pb, s->esc3_level_length, level);
- }else{
- put_bits(&s->pb, 6, run);
- put_bits(&s->pb, 8, slevel & 0xff);
- }
- } else {
- /* second escape */
- put_bits(&s->pb, 1, 1);
- put_bits(&s->pb, rl->table_vlc[code][1], rl->table_vlc[code][0]);
- put_bits(&s->pb, 1, sign);
- }
- } else {
- /* first escape */
- put_bits(&s->pb, 1, 1);
- put_bits(&s->pb, rl->table_vlc[code][1], rl->table_vlc[code][0]);
- put_bits(&s->pb, 1, sign);
- }
- } else {
- put_bits(&s->pb, 1, sign);
- }
- last_non_zero = i;
- }
- }
-}
-
-/****************************************/
-/* decoding stuff */
-
-static VLC mb_non_intra_vlc[4];
-VLC ff_msmp4_mb_i_vlc;
-VLC ff_msmp4_dc_luma_vlc[2];
-VLC ff_msmp4_dc_chroma_vlc[2];
-static VLC v2_dc_lum_vlc;
-static VLC v2_dc_chroma_vlc;
-static VLC cbpy_vlc;
-static VLC v2_intra_cbpc_vlc;
-static VLC v2_mb_type_vlc;
-static VLC v2_mv_vlc;
-static VLC v1_intra_cbpc_vlc;
-static VLC v1_inter_cbpc_vlc;
-static VLC inter_intra_vlc;
-
-/* this table is practically identical to the one from h263 except that its inverted */
-static void init_h263_dc_for_msmpeg4(void)
-{
- int level, uni_code, uni_len;
-
- for(level=-256; level<256; level++){
- int size, v, l;
- /* find number of bits */
- size = 0;
- v = abs(level);
- while (v) {
- v >>= 1;
- size++;
- }
-
- if (level < 0)
- l= (-level) ^ ((1 << size) - 1);
- else
- l= level;
-
- /* luminance h263 */
- uni_code= DCtab_lum[size][0];
- uni_len = DCtab_lum[size][1];
- uni_code ^= (1<<uni_len)-1; //M$ doesnt like compatibility
-
- if (size > 0) {
- uni_code<<=size; uni_code|=l;
- uni_len+=size;
- if (size > 8){
- uni_code<<=1; uni_code|=1;
- uni_len++;
- }
- }
- v2_dc_lum_table[level+256][0]= uni_code;
- v2_dc_lum_table[level+256][1]= uni_len;
-
- /* chrominance h263 */
- uni_code= DCtab_chrom[size][0];
- uni_len = DCtab_chrom[size][1];
- uni_code ^= (1<<uni_len)-1; //M$ doesnt like compatibility
-
- if (size > 0) {
- uni_code<<=size; uni_code|=l;
- uni_len+=size;
- if (size > 8){
- uni_code<<=1; uni_code|=1;
- uni_len++;
- }
- }
- v2_dc_chroma_table[level+256][0]= uni_code;
- v2_dc_chroma_table[level+256][1]= uni_len;
-
- }
-}
-
-/* init all vlc decoding tables */
-int ff_msmpeg4_decode_init(MpegEncContext *s)
-{
- static int done = 0;
- int i;
- MVTable *mv;
-
- common_init(s);
-
- if (!done) {
- done = 1;
-
- for(i=0;i<NB_RL_TABLES;i++) {
- init_rl(&rl_table[i], 1);
- init_vlc_rl(&rl_table[i], 1);
- }
- for(i=0;i<2;i++) {
- mv = &mv_tables[i];
- init_vlc(&mv->vlc, MV_VLC_BITS, mv->n + 1,
- mv->table_mv_bits, 1, 1,
- mv->table_mv_code, 2, 2, 1);
- }
-
- init_vlc(&ff_msmp4_dc_luma_vlc[0], DC_VLC_BITS, 120,
- &ff_table0_dc_lum[0][1], 8, 4,
- &ff_table0_dc_lum[0][0], 8, 4, 1);
- init_vlc(&ff_msmp4_dc_chroma_vlc[0], DC_VLC_BITS, 120,
- &ff_table0_dc_chroma[0][1], 8, 4,
- &ff_table0_dc_chroma[0][0], 8, 4, 1);
- init_vlc(&ff_msmp4_dc_luma_vlc[1], DC_VLC_BITS, 120,
- &ff_table1_dc_lum[0][1], 8, 4,
- &ff_table1_dc_lum[0][0], 8, 4, 1);
- init_vlc(&ff_msmp4_dc_chroma_vlc[1], DC_VLC_BITS, 120,
- &ff_table1_dc_chroma[0][1], 8, 4,
- &ff_table1_dc_chroma[0][0], 8, 4, 1);
-
- init_vlc(&v2_dc_lum_vlc, DC_VLC_BITS, 512,
- &v2_dc_lum_table[0][1], 8, 4,
- &v2_dc_lum_table[0][0], 8, 4, 1);
- init_vlc(&v2_dc_chroma_vlc, DC_VLC_BITS, 512,
- &v2_dc_chroma_table[0][1], 8, 4,
- &v2_dc_chroma_table[0][0], 8, 4, 1);
-
- init_vlc(&cbpy_vlc, CBPY_VLC_BITS, 16,
- &cbpy_tab[0][1], 2, 1,
- &cbpy_tab[0][0], 2, 1, 1);
- init_vlc(&v2_intra_cbpc_vlc, V2_INTRA_CBPC_VLC_BITS, 4,
- &v2_intra_cbpc[0][1], 2, 1,
- &v2_intra_cbpc[0][0], 2, 1, 1);
- init_vlc(&v2_mb_type_vlc, V2_MB_TYPE_VLC_BITS, 8,
- &v2_mb_type[0][1], 2, 1,
- &v2_mb_type[0][0], 2, 1, 1);
- init_vlc(&v2_mv_vlc, V2_MV_VLC_BITS, 33,
- &mvtab[0][1], 2, 1,
- &mvtab[0][0], 2, 1, 1);
-
- for(i=0; i<4; i++){
- init_vlc(&mb_non_intra_vlc[i], MB_NON_INTRA_VLC_BITS, 128,
- &wmv2_inter_table[i][0][1], 8, 4,
- &wmv2_inter_table[i][0][0], 8, 4, 1); //FIXME name?
- }
-
- init_vlc(&ff_msmp4_mb_i_vlc, MB_INTRA_VLC_BITS, 64,
- &ff_msmp4_mb_i_table[0][1], 4, 2,
- &ff_msmp4_mb_i_table[0][0], 4, 2, 1);
-
- init_vlc(&v1_intra_cbpc_vlc, V1_INTRA_CBPC_VLC_BITS, 8,
- intra_MCBPC_bits, 1, 1,
- intra_MCBPC_code, 1, 1, 1);
- init_vlc(&v1_inter_cbpc_vlc, V1_INTER_CBPC_VLC_BITS, 25,
- inter_MCBPC_bits, 1, 1,
- inter_MCBPC_code, 1, 1, 1);
-
- init_vlc(&inter_intra_vlc, INTER_INTRA_VLC_BITS, 4,
- &table_inter_intra[0][1], 2, 1,
- &table_inter_intra[0][0], 2, 1, 1);
- }
-
- switch(s->msmpeg4_version){
- case 1:
- case 2:
- s->decode_mb= msmpeg4v12_decode_mb;
- break;
- case 3:
- case 4:
- s->decode_mb= msmpeg4v34_decode_mb;
- break;
- case 5:
- s->decode_mb= wmv2_decode_mb;
- case 6:
- //FIXME + TODO VC1 decode mb
- break;
- }
-
- s->slice_height= s->mb_height; //to avoid 1/0 if the first frame isnt a keyframe
-
- return 0;
-}
-
-int msmpeg4_decode_picture_header(MpegEncContext * s)
-{
- int code;
-
-#if 0
-{
-int i;
-for(i=0; i<s->gb.size_in_bits; i++)
- av_log(s->avctx, AV_LOG_DEBUG, "%d", get_bits1(&s->gb));
-// get_bits1(&s->gb);
-av_log(s->avctx, AV_LOG_DEBUG, "END\n");
-return -1;
-}
-#endif
-
- if(s->msmpeg4_version==1){
- int start_code, num;
- start_code = (get_bits(&s->gb, 16)<<16) | get_bits(&s->gb, 16);
- if(start_code!=0x00000100){
- av_log(s->avctx, AV_LOG_ERROR, "invalid startcode\n");
- return -1;
- }
-
- num= get_bits(&s->gb, 5); // frame number */
- }
-
- s->pict_type = get_bits(&s->gb, 2) + 1;
- if (s->pict_type != I_TYPE &&
- s->pict_type != P_TYPE){
- av_log(s->avctx, AV_LOG_ERROR, "invalid picture type\n");
- return -1;
- }
-#if 0
-{
- static int had_i=0;
- if(s->pict_type == I_TYPE) had_i=1;
- if(!had_i) return -1;
-}
-#endif
- s->chroma_qscale= s->qscale = get_bits(&s->gb, 5);
- if(s->qscale==0){
- av_log(s->avctx, AV_LOG_ERROR, "invalid qscale\n");
- return -1;
- }
-
- if (s->pict_type == I_TYPE) {
- code = get_bits(&s->gb, 5);
- if(s->msmpeg4_version==1){
- if(code==0 || code>s->mb_height){
- av_log(s->avctx, AV_LOG_ERROR, "invalid slice height %d\n", code);
- return -1;
- }
-
- s->slice_height = code;
- }else{
- /* 0x17: one slice, 0x18: two slices, ... */
- if (code < 0x17){
- av_log(s->avctx, AV_LOG_ERROR, "error, slice code was %X\n", code);
- return -1;
- }
-
- s->slice_height = s->mb_height / (code - 0x16);
- }
-
- switch(s->msmpeg4_version){
- case 1:
- case 2:
- s->rl_chroma_table_index = 2;
- s->rl_table_index = 2;
-
- s->dc_table_index = 0; //not used
- break;
- case 3:
- s->rl_chroma_table_index = decode012(&s->gb);
- s->rl_table_index = decode012(&s->gb);
-
- s->dc_table_index = get_bits1(&s->gb);
- break;
- case 4:
- msmpeg4_decode_ext_header(s, (2+5+5+17+7)/8);
-
- if(s->bit_rate > MBAC_BITRATE) s->per_mb_rl_table= get_bits1(&s->gb);
- else s->per_mb_rl_table= 0;
-
- if(!s->per_mb_rl_table){
- s->rl_chroma_table_index = decode012(&s->gb);
- s->rl_table_index = decode012(&s->gb);
- }
-
- s->dc_table_index = get_bits1(&s->gb);
- s->inter_intra_pred= 0;
- break;
- }
- s->no_rounding = 1;
- if(s->avctx->debug&FF_DEBUG_PICT_INFO)
- av_log(s->avctx, AV_LOG_DEBUG, "qscale:%d rlc:%d rl:%d dc:%d mbrl:%d slice:%d \n",
- s->qscale,
- s->rl_chroma_table_index,
- s->rl_table_index,
- s->dc_table_index,
- s->per_mb_rl_table,
- s->slice_height);
- } else {
- switch(s->msmpeg4_version){
- case 1:
- case 2:
- if(s->msmpeg4_version==1)
- s->use_skip_mb_code = 1;
- else
- s->use_skip_mb_code = get_bits1(&s->gb);
- s->rl_table_index = 2;
- s->rl_chroma_table_index = s->rl_table_index;
- s->dc_table_index = 0; //not used
- s->mv_table_index = 0;
- break;
- case 3:
- s->use_skip_mb_code = get_bits1(&s->gb);
- s->rl_table_index = decode012(&s->gb);
- s->rl_chroma_table_index = s->rl_table_index;
-
- s->dc_table_index = get_bits1(&s->gb);
-
- s->mv_table_index = get_bits1(&s->gb);
- break;
- case 4:
- s->use_skip_mb_code = get_bits1(&s->gb);
-
- if(s->bit_rate > MBAC_BITRATE) s->per_mb_rl_table= get_bits1(&s->gb);
- else s->per_mb_rl_table= 0;
-
- if(!s->per_mb_rl_table){
- s->rl_table_index = decode012(&s->gb);
- s->rl_chroma_table_index = s->rl_table_index;
- }
-
- s->dc_table_index = get_bits1(&s->gb);
-
- s->mv_table_index = get_bits1(&s->gb);
- s->inter_intra_pred= (s->width*s->height < 320*240 && s->bit_rate<=II_BITRATE);
- break;
- }
-
- if(s->avctx->debug&FF_DEBUG_PICT_INFO)
- av_log(s->avctx, AV_LOG_DEBUG, "skip:%d rl:%d rlc:%d dc:%d mv:%d mbrl:%d qp:%d \n",
- s->use_skip_mb_code,
- s->rl_table_index,
- s->rl_chroma_table_index,
- s->dc_table_index,
- s->mv_table_index,
- s->per_mb_rl_table,
- s->qscale);
-
- if(s->flipflop_rounding){
- s->no_rounding ^= 1;
- }else{
- s->no_rounding = 0;
- }
- }
-//printf("%d %d %d %d %d\n", s->pict_type, s->bit_rate, s->inter_intra_pred, s->width, s->height);
-
- s->esc3_level_length= 0;
- s->esc3_run_length= 0;
-
-#ifdef DEBUG
- av_log(s->avctx, AV_LOG_DEBUG, "*****frame %d:\n", frame_count++);
-#endif
- return 0;
-}
-
-int msmpeg4_decode_ext_header(MpegEncContext * s, int buf_size)
-{
- int left= buf_size*8 - get_bits_count(&s->gb);
- int length= s->msmpeg4_version>=3 ? 17 : 16;
- /* the alt_bitstream reader could read over the end so we need to check it */
- if(left>=length && left<length+8)
- {
- int fps;
-
- fps= get_bits(&s->gb, 5);
- s->bit_rate= get_bits(&s->gb, 11)*1024;
- if(s->msmpeg4_version>=3)
- s->flipflop_rounding= get_bits1(&s->gb);
- else
- s->flipflop_rounding= 0;
-
-// printf("fps:%2d bps:%2d roundingType:%1d\n", fps, s->bit_rate/1024, s->flipflop_rounding);
- }
- else if(left<length+8)
- {
- s->flipflop_rounding= 0;
- if(s->msmpeg4_version != 2)
- av_log(s->avctx, AV_LOG_ERROR, "ext header missing, %d left\n", left);
- }
- else
- {
- av_log(s->avctx, AV_LOG_ERROR, "I frame too long, ignoring ext header\n");
- }
-
- return 0;
-}
-
-static inline void msmpeg4_memsetw(short *tab, int val, int n)
-{
- int i;
- for(i=0;i<n;i++)
- tab[i] = val;
-}
-
-#ifdef CONFIG_ENCODERS
-static void msmpeg4v2_encode_motion(MpegEncContext * s, int val)
-{
- int range, bit_size, sign, code, bits;
-
- if (val == 0) {
- /* zero vector */
- code = 0;
- put_bits(&s->pb, mvtab[code][1], mvtab[code][0]);
- } else {
- bit_size = s->f_code - 1;
- range = 1 << bit_size;
- if (val <= -64)
- val += 64;
- else if (val >= 64)
- val -= 64;
-
- if (val >= 0) {
- sign = 0;
- } else {
- val = -val;
- sign = 1;
- }
- val--;
- code = (val >> bit_size) + 1;
- bits = val & (range - 1);
-
- put_bits(&s->pb, mvtab[code][1] + 1, (mvtab[code][0] << 1) | sign);
- if (bit_size > 0) {
- put_bits(&s->pb, bit_size, bits);
- }
- }
-}
-#endif
-
-/* this is identical to h263 except that its range is multiplied by 2 */
-static int msmpeg4v2_decode_motion(MpegEncContext * s, int pred, int f_code)
-{
- int code, val, sign, shift;
-
- code = get_vlc2(&s->gb, v2_mv_vlc.table, V2_MV_VLC_BITS, 2);
-// printf("MV code %d at %d %d pred: %d\n", code, s->mb_x,s->mb_y, pred);
- if (code < 0)
- return 0xffff;
-
- if (code == 0)
- return pred;
- sign = get_bits1(&s->gb);
- shift = f_code - 1;
- val = code;
- if (shift) {
- val = (val - 1) << shift;
- val |= get_bits(&s->gb, shift);
- val++;
- }
- if (sign)
- val = -val;
-
- val += pred;
- if (val <= -64)
- val += 64;
- else if (val >= 64)
- val -= 64;
-
- return val;
-}
-
-static int msmpeg4v12_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
-{
- int cbp, code, i;
-
- if (s->pict_type == P_TYPE) {
- if (s->use_skip_mb_code) {
- if (get_bits1(&s->gb)) {
- /* skip mb */
- s->mb_intra = 0;
- for(i=0;i<6;i++)
- s->block_last_index[i] = -1;
- s->mv_dir = MV_DIR_FORWARD;
- s->mv_type = MV_TYPE_16X16;
- s->mv[0][0][0] = 0;
- s->mv[0][0][1] = 0;
- s->mb_skipped = 1;
- return 0;
- }
- }
-
- if(s->msmpeg4_version==2)
- code = get_vlc2(&s->gb, v2_mb_type_vlc.table, V2_MB_TYPE_VLC_BITS, 1);
- else
- code = get_vlc2(&s->gb, v1_inter_cbpc_vlc.table, V1_INTER_CBPC_VLC_BITS, 3);
- if(code<0 || code>7){
- av_log(s->avctx, AV_LOG_ERROR, "cbpc %d invalid at %d %d\n", code, s->mb_x, s->mb_y);
- return -1;
- }
-
- s->mb_intra = code >>2;
-
- cbp = code & 0x3;
- } else {
- s->mb_intra = 1;
- if(s->msmpeg4_version==2)
- cbp= get_vlc2(&s->gb, v2_intra_cbpc_vlc.table, V2_INTRA_CBPC_VLC_BITS, 1);
- else
- cbp= get_vlc2(&s->gb, v1_intra_cbpc_vlc.table, V1_INTRA_CBPC_VLC_BITS, 1);
- if(cbp<0 || cbp>3){
- av_log(s->avctx, AV_LOG_ERROR, "cbpc %d invalid at %d %d\n", cbp, s->mb_x, s->mb_y);
- return -1;
- }
- }
-
- if (!s->mb_intra) {
- int mx, my, cbpy;
-
- cbpy= get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1);
- if(cbpy<0){
- av_log(s->avctx, AV_LOG_ERROR, "cbpy %d invalid at %d %d\n", cbp, s->mb_x, s->mb_y);
- return -1;
- }
-
- cbp|= cbpy<<2;
- if(s->msmpeg4_version==1 || (cbp&3) != 3) cbp^= 0x3C;
-
- h263_pred_motion(s, 0, 0, &mx, &my);
- mx= msmpeg4v2_decode_motion(s, mx, 1);
- my= msmpeg4v2_decode_motion(s, my, 1);
-
- s->mv_dir = MV_DIR_FORWARD;
- s->mv_type = MV_TYPE_16X16;
- s->mv[0][0][0] = mx;
- s->mv[0][0][1] = my;
- } else {
- if(s->msmpeg4_version==2){
- s->ac_pred = get_bits1(&s->gb);
- cbp|= get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1)<<2; //FIXME check errors
- } else{
- s->ac_pred = 0;
- cbp|= get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1)<<2; //FIXME check errors
- if(s->pict_type==P_TYPE) cbp^=0x3C;
- }
- }
-
- s->dsp.clear_blocks(s->block[0]);
- for (i = 0; i < 6; i++) {
- if (msmpeg4_decode_block(s, block[i], i, (cbp >> (5 - i)) & 1, NULL) < 0)
- {
- av_log(s->avctx, AV_LOG_ERROR, "\nerror while decoding block: %d x %d (%d)\n", s->mb_x, s->mb_y, i);
- return -1;
- }
- }
- return 0;
-}
-
-static int msmpeg4v34_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
-{
- int cbp, code, i;
- uint8_t *coded_val;
- uint32_t * const mb_type_ptr= &s->current_picture.mb_type[ s->mb_x + s->mb_y*s->mb_stride ];
-
- if (s->pict_type == P_TYPE) {
- if (s->use_skip_mb_code) {
- if (get_bits1(&s->gb)) {
- /* skip mb */
- s->mb_intra = 0;
- for(i=0;i<6;i++)
- s->block_last_index[i] = -1;
- s->mv_dir = MV_DIR_FORWARD;
- s->mv_type = MV_TYPE_16X16;
- s->mv[0][0][0] = 0;
- s->mv[0][0][1] = 0;
- s->mb_skipped = 1;
- *mb_type_ptr = MB_TYPE_SKIP | MB_TYPE_L0 | MB_TYPE_16x16;
-
- return 0;
- }
- }
-
- code = get_vlc2(&s->gb, mb_non_intra_vlc[DEFAULT_INTER_INDEX].table, MB_NON_INTRA_VLC_BITS, 3);
- if (code < 0)
- return -1;
- //s->mb_intra = (code & 0x40) ? 0 : 1;
- s->mb_intra = (~code & 0x40) >> 6;
-
- cbp = code & 0x3f;
- } else {
- s->mb_intra = 1;
- code = get_vlc2(&s->gb, ff_msmp4_mb_i_vlc.table, MB_INTRA_VLC_BITS, 2);
- if (code < 0)
- return -1;
- /* predict coded block pattern */
- cbp = 0;
- for(i=0;i<6;i++) {
- int val = ((code >> (5 - i)) & 1);
- if (i < 4) {
- int pred = coded_block_pred(s, i, &coded_val);
- val = val ^ pred;
- *coded_val = val;
- }
- cbp |= val << (5 - i);
- }
- }
-
- if (!s->mb_intra) {
- int mx, my;
-//printf("P at %d %d\n", s->mb_x, s->mb_y);
- if(s->per_mb_rl_table && cbp){
- s->rl_table_index = decode012(&s->gb);
- s->rl_chroma_table_index = s->rl_table_index;
- }
- h263_pred_motion(s, 0, 0, &mx, &my);
- if (msmpeg4_decode_motion(s, &mx, &my) < 0)
- return -1;
- s->mv_dir = MV_DIR_FORWARD;
- s->mv_type = MV_TYPE_16X16;
- s->mv[0][0][0] = mx;
- s->mv[0][0][1] = my;
- *mb_type_ptr = MB_TYPE_L0 | MB_TYPE_16x16;
- } else {
-//printf("I at %d %d %d %06X\n", s->mb_x, s->mb_y, ((cbp&3)? 1 : 0) +((cbp&0x3C)? 2 : 0), show_bits(&s->gb, 24));
- s->ac_pred = get_bits1(&s->gb);
- *mb_type_ptr = MB_TYPE_INTRA;
- if(s->inter_intra_pred){
- s->h263_aic_dir= get_vlc2(&s->gb, inter_intra_vlc.table, INTER_INTRA_VLC_BITS, 1);
-// printf("%d%d %d %d/", s->ac_pred, s->h263_aic_dir, s->mb_x, s->mb_y);
- }
- if(s->per_mb_rl_table && cbp){
- s->rl_table_index = decode012(&s->gb);
- s->rl_chroma_table_index = s->rl_table_index;
- }
- }
-
- s->dsp.clear_blocks(s->block[0]);
- for (i = 0; i < 6; i++) {
- if (msmpeg4_decode_block(s, block[i], i, (cbp >> (5 - i)) & 1, NULL) < 0)
- {
- av_log(s->avctx, AV_LOG_ERROR, "\nerror while decoding block: %d x %d (%d)\n", s->mb_x, s->mb_y, i);
- return -1;
- }
- }
-
- return 0;
-}
-//#define ERROR_DETAILS
-static inline int msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
- int n, int coded, const uint8_t *scan_table)
-{
- int level, i, last, run, run_diff;
- int dc_pred_dir;
- RLTable *rl;
- RL_VLC_ELEM *rl_vlc;
- int qmul, qadd;
-
- if (s->mb_intra) {
- qmul=1;
- qadd=0;
-
- /* DC coef */
- level = msmpeg4_decode_dc(s, n, &dc_pred_dir);
-
- if (level < 0){
- av_log(s->avctx, AV_LOG_ERROR, "dc overflow- block: %d qscale: %d//\n", n, s->qscale);
- if(s->inter_intra_pred) level=0;
- else return -1;
- }
- if (n < 4) {
- rl = &rl_table[s->rl_table_index];
- if(level > 256*s->y_dc_scale){
- av_log(s->avctx, AV_LOG_ERROR, "dc overflow+ L qscale: %d//\n", s->qscale);
- if(!s->inter_intra_pred) return -1;
- }
- } else {
- rl = &rl_table[3 + s->rl_chroma_table_index];
- if(level > 256*s->c_dc_scale){
- av_log(s->avctx, AV_LOG_ERROR, "dc overflow+ C qscale: %d//\n", s->qscale);
- if(!s->inter_intra_pred) return -1;
- }
- }
- block[0] = level;
-
- run_diff = 0;
- i = 0;
- if (!coded) {
- goto not_coded;
- }
- if (s->ac_pred) {
- if (dc_pred_dir == 0)
- scan_table = s->intra_v_scantable.permutated; /* left */
- else
- scan_table = s->intra_h_scantable.permutated; /* top */
- } else {
- scan_table = s->intra_scantable.permutated;
- }
- rl_vlc= rl->rl_vlc[0];
- } else {
- qmul = s->qscale << 1;
- qadd = (s->qscale - 1) | 1;
- i = -1;
- rl = &rl_table[3 + s->rl_table_index];
-
- if(s->msmpeg4_version==2)
- run_diff = 0;
- else
- run_diff = 1;
-
- if (!coded) {
- s->block_last_index[n] = i;
- return 0;
- }
- if(!scan_table)
- scan_table = s->inter_scantable.permutated;
- rl_vlc= rl->rl_vlc[s->qscale];
- }
- {
- OPEN_READER(re, &s->gb);
- for(;;) {
- UPDATE_CACHE(re, &s->gb);
- GET_RL_VLC(level, run, re, &s->gb, rl_vlc, TEX_VLC_BITS, 2, 0);
- if (level==0) {
- int cache;
- cache= GET_CACHE(re, &s->gb);
- /* escape */
- if (s->msmpeg4_version==1 || (cache&0x80000000)==0) {
- if (s->msmpeg4_version==1 || (cache&0x40000000)==0) {
- /* third escape */
- if(s->msmpeg4_version!=1) LAST_SKIP_BITS(re, &s->gb, 2);
- UPDATE_CACHE(re, &s->gb);
- if(s->msmpeg4_version<=3){
- last= SHOW_UBITS(re, &s->gb, 1); SKIP_CACHE(re, &s->gb, 1);
- run= SHOW_UBITS(re, &s->gb, 6); SKIP_CACHE(re, &s->gb, 6);
- level= SHOW_SBITS(re, &s->gb, 8); LAST_SKIP_CACHE(re, &s->gb, 8);
- SKIP_COUNTER(re, &s->gb, 1+6+8);
- }else{
- int sign;
- last= SHOW_UBITS(re, &s->gb, 1); SKIP_BITS(re, &s->gb, 1);
- if(!s->esc3_level_length){
- int ll;
- //printf("ESC-3 %X at %d %d\n", show_bits(&s->gb, 24), s->mb_x, s->mb_y);
- if(s->qscale<8){
- ll= SHOW_UBITS(re, &s->gb, 3); SKIP_BITS(re, &s->gb, 3);
- if(ll==0){
- if(SHOW_UBITS(re, &s->gb, 1)) av_log(s->avctx, AV_LOG_ERROR, "cool a new vlc code ,contact the ffmpeg developers and upload the file\n");
- SKIP_BITS(re, &s->gb, 1);
- ll=8;
- }
- }else{
- ll=2;
- while(ll<8 && SHOW_UBITS(re, &s->gb, 1)==0){
- ll++;
- SKIP_BITS(re, &s->gb, 1);
- }
- if(ll<8) SKIP_BITS(re, &s->gb, 1);
- }
-
- s->esc3_level_length= ll;
- s->esc3_run_length= SHOW_UBITS(re, &s->gb, 2) + 3; SKIP_BITS(re, &s->gb, 2);
-//printf("level length:%d, run length: %d\n", ll, s->esc3_run_length);
- UPDATE_CACHE(re, &s->gb);
- }
- run= SHOW_UBITS(re, &s->gb, s->esc3_run_length);
- SKIP_BITS(re, &s->gb, s->esc3_run_length);
-
- sign= SHOW_UBITS(re, &s->gb, 1);
- SKIP_BITS(re, &s->gb, 1);
-
- level= SHOW_UBITS(re, &s->gb, s->esc3_level_length);
- SKIP_BITS(re, &s->gb, s->esc3_level_length);
- if(sign) level= -level;
- }
-//printf("level: %d, run: %d at %d %d\n", level, run, s->mb_x, s->mb_y);
-#if 0 // waste of time / this will detect very few errors
- {
- const int abs_level= FFABS(level);
- const int run1= run - rl->max_run[last][abs_level] - run_diff;
- if(abs_level<=MAX_LEVEL && run<=MAX_RUN){
- if(abs_level <= rl->max_level[last][run]){
- av_log(s->avctx, AV_LOG_ERROR, "illegal 3. esc, vlc encoding possible\n");
- return DECODING_AC_LOST;
- }
- if(abs_level <= rl->max_level[last][run]*2){
- av_log(s->avctx, AV_LOG_ERROR, "illegal 3. esc, esc 1 encoding possible\n");
- return DECODING_AC_LOST;
- }
- if(run1>=0 && abs_level <= rl->max_level[last][run1]){
- av_log(s->avctx, AV_LOG_ERROR, "illegal 3. esc, esc 2 encoding possible\n");
- return DECODING_AC_LOST;
- }
- }
- }
-#endif
- //level = level * qmul + (level>0) * qadd - (level<=0) * qadd ;
- if (level>0) level= level * qmul + qadd;
- else level= level * qmul - qadd;
-#if 0 // waste of time too :(
- if(level>2048 || level<-2048){
- av_log(s->avctx, AV_LOG_ERROR, "|level| overflow in 3. esc\n");
- return DECODING_AC_LOST;
- }
-#endif
- i+= run + 1;
- if(last) i+=192;
-#ifdef ERROR_DETAILS
- if(run==66)
- av_log(s->avctx, AV_LOG_ERROR, "illegal vlc code in ESC3 level=%d\n", level);
- else if((i>62 && i<192) || i>192+63)
- av_log(s->avctx, AV_LOG_ERROR, "run overflow in ESC3 i=%d run=%d level=%d\n", i, run, level);
-#endif
- } else {
- /* second escape */
-#if MIN_CACHE_BITS < 23
- LAST_SKIP_BITS(re, &s->gb, 2);
- UPDATE_CACHE(re, &s->gb);
-#else
- SKIP_BITS(re, &s->gb, 2);
-#endif
- GET_RL_VLC(level, run, re, &s->gb, rl_vlc, TEX_VLC_BITS, 2, 1);
- i+= run + rl->max_run[run>>7][level/qmul] + run_diff; //FIXME opt indexing
- level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1);
- LAST_SKIP_BITS(re, &s->gb, 1);
-#ifdef ERROR_DETAILS
- if(run==66)
- av_log(s->avctx, AV_LOG_ERROR, "illegal vlc code in ESC2 level=%d\n", level);
- else if((i>62 && i<192) || i>192+63)
- av_log(s->avctx, AV_LOG_ERROR, "run overflow in ESC2 i=%d run=%d level=%d\n", i, run, level);
-#endif
- }
- } else {
- /* first escape */
-#if MIN_CACHE_BITS < 22
- LAST_SKIP_BITS(re, &s->gb, 1);
- UPDATE_CACHE(re, &s->gb);
-#else
- SKIP_BITS(re, &s->gb, 1);
-#endif
- GET_RL_VLC(level, run, re, &s->gb, rl_vlc, TEX_VLC_BITS, 2, 1);
- i+= run;
- level = level + rl->max_level[run>>7][(run-1)&63] * qmul;//FIXME opt indexing
- level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1);
- LAST_SKIP_BITS(re, &s->gb, 1);
-#ifdef ERROR_DETAILS
- if(run==66)
- av_log(s->avctx, AV_LOG_ERROR, "illegal vlc code in ESC1 level=%d\n", level);
- else if((i>62 && i<192) || i>192+63)
- av_log(s->avctx, AV_LOG_ERROR, "run overflow in ESC1 i=%d run=%d level=%d\n", i, run, level);
-#endif
- }
- } else {
- i+= run;
- level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1);
- LAST_SKIP_BITS(re, &s->gb, 1);
-#ifdef ERROR_DETAILS
- if(run==66)
- av_log(s->avctx, AV_LOG_ERROR, "illegal vlc code level=%d\n", level);
- else if((i>62 && i<192) || i>192+63)
- av_log(s->avctx, AV_LOG_ERROR, "run overflow i=%d run=%d level=%d\n", i, run, level);
-#endif
- }
- if (i > 62){
- i-= 192;
- if(i&(~63)){
- const int left= s->gb.size_in_bits - get_bits_count(&s->gb);
- if(((i+192 == 64 && level/qmul==-1) || s->error_resilience<=1) && left>=0){
- av_log(s->avctx, AV_LOG_ERROR, "ignoring overflow at %d %d\n", s->mb_x, s->mb_y);
- break;
- }else{
- av_log(s->avctx, AV_LOG_ERROR, "ac-tex damaged at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
- }
-
- block[scan_table[i]] = level;
- break;
- }
-
- block[scan_table[i]] = level;
- }
- CLOSE_READER(re, &s->gb);
- }
- not_coded:
- if (s->mb_intra) {
- mpeg4_pred_ac(s, block, n, dc_pred_dir);
- if (s->ac_pred) {
- i = 63; /* XXX: not optimal */
- }
- }
- if(s->msmpeg4_version>=4 && i>0) i=63; //FIXME/XXX optimize
- s->block_last_index[n] = i;
-
- return 0;
-}
-
-static int msmpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr)
-{
- int level, pred;
-
- if(s->msmpeg4_version<=2){
- if (n < 4) {
- level = get_vlc2(&s->gb, v2_dc_lum_vlc.table, DC_VLC_BITS, 3);
- } else {
- level = get_vlc2(&s->gb, v2_dc_chroma_vlc.table, DC_VLC_BITS, 3);
- }
- if (level < 0)
- return -1;
- level-=256;
- }else{ //FIXME optimize use unified tables & index
- if (n < 4) {
- level = get_vlc2(&s->gb, ff_msmp4_dc_luma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3);
- } else {
- level = get_vlc2(&s->gb, ff_msmp4_dc_chroma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3);
- }
- if (level < 0){
- av_log(s->avctx, AV_LOG_ERROR, "illegal dc vlc\n");
- return -1;
- }
-
- if (level == DC_MAX) {
- level = get_bits(&s->gb, 8);
- if (get_bits1(&s->gb))
- level = -level;
- } else if (level != 0) {
- if (get_bits1(&s->gb))
- level = -level;
- }
- }
-
- if(s->msmpeg4_version==1){
- int32_t *dc_val;
- pred = msmpeg4v1_pred_dc(s, n, &dc_val);
- level += pred;
-
- /* update predictor */
- *dc_val= level;
- }else{
- int16_t *dc_val;
- pred = msmpeg4_pred_dc(s, n, &dc_val, dir_ptr);
- level += pred;
-
- /* update predictor */
- if (n < 4) {
- *dc_val = level * s->y_dc_scale;
- } else {
- *dc_val = level * s->c_dc_scale;
- }
- }
-
- return level;
-}
-
-static int msmpeg4_decode_motion(MpegEncContext * s,
- int *mx_ptr, int *my_ptr)
-{
- MVTable *mv;
- int code, mx, my;
-
- mv = &mv_tables[s->mv_table_index];
-
- code = get_vlc2(&s->gb, mv->vlc.table, MV_VLC_BITS, 2);
- if (code < 0){
- av_log(s->avctx, AV_LOG_ERROR, "illegal MV code at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
- if (code == mv->n) {
-//printf("MV ESC %X at %d %d\n", show_bits(&s->gb, 24), s->mb_x, s->mb_y);
- mx = get_bits(&s->gb, 6);
- my = get_bits(&s->gb, 6);
- } else {
- mx = mv->table_mvx[code];
- my = mv->table_mvy[code];
- }
-
- mx += *mx_ptr - 32;
- my += *my_ptr - 32;
- /* WARNING : they do not do exactly modulo encoding */
- if (mx <= -64)
- mx += 64;
- else if (mx >= 64)
- mx -= 64;
-
- if (my <= -64)
- my += 64;
- else if (my >= 64)
- my -= 64;
- *mx_ptr = mx;
- *my_ptr = my;
- return 0;
-}
-
-/* cleanest way to support it
- * there is too much shared between versions so that we cant have 1 file per version & 1 common
- * as allmost everything would be in the common file
- */
-#include "wmv2.c"
diff --git a/src/libffmpeg/libavcodec/msmpeg4data.h b/src/libffmpeg/libavcodec/msmpeg4data.h
deleted file mode 100644
index d1ff70371..000000000
--- a/src/libffmpeg/libavcodec/msmpeg4data.h
+++ /dev/null
@@ -1,2028 +0,0 @@
-/*
- * MSMPEG4 backend for ffmpeg encoder and decoder
- * copyright (c) 2001 Fabrice Bellard
- * copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * msmpeg4v1 & v2 stuff by Michael Niedermayer <michaelni@gmx.at>
- */
-
-/**
- * @file msmpeg4data.h
- * MSMPEG4 data tables.
- */
-
-/* intra picture macro block coded block pattern */
-const uint16_t ff_msmp4_mb_i_table[64][2] = {
-{ 0x1, 1 },{ 0x17, 6 },{ 0x9, 5 },{ 0x5, 5 },
-{ 0x6, 5 },{ 0x47, 9 },{ 0x20, 7 },{ 0x10, 7 },
-{ 0x2, 5 },{ 0x7c, 9 },{ 0x3a, 7 },{ 0x1d, 7 },
-{ 0x2, 6 },{ 0xec, 9 },{ 0x77, 8 },{ 0x0, 8 },
-{ 0x3, 5 },{ 0xb7, 9 },{ 0x2c, 7 },{ 0x13, 7 },
-{ 0x1, 6 },{ 0x168, 10 },{ 0x46, 8 },{ 0x3f, 8 },
-{ 0x1e, 6 },{ 0x712, 13 },{ 0xb5, 9 },{ 0x42, 8 },
-{ 0x22, 7 },{ 0x1c5, 11 },{ 0x11e, 10 },{ 0x87, 9 },
-{ 0x6, 4 },{ 0x3, 9 },{ 0x1e, 7 },{ 0x1c, 6 },
-{ 0x12, 7 },{ 0x388, 12 },{ 0x44, 9 },{ 0x70, 9 },
-{ 0x1f, 6 },{ 0x23e, 11 },{ 0x39, 8 },{ 0x8e, 9 },
-{ 0x1, 7 },{ 0x1c6, 11 },{ 0xb6, 9 },{ 0x45, 9 },
-{ 0x14, 6 },{ 0x23f, 11 },{ 0x7d, 9 },{ 0x18, 9 },
-{ 0x7, 7 },{ 0x1c7, 11 },{ 0x86, 9 },{ 0x19, 9 },
-{ 0x15, 6 },{ 0x1db, 10 },{ 0x2, 9 },{ 0x46, 9 },
-{ 0xd, 8 },{ 0x713, 13 },{ 0x1da, 10 },{ 0x169, 10 },
-};
-
-/* non intra picture macro block coded block pattern + mb type */
-static const uint32_t table_mb_non_intra[128][2] = {
-{ 0x40, 7 },{ 0x13c9, 13 },{ 0x9fd, 12 },{ 0x1fc, 15 },
-{ 0x9fc, 12 },{ 0xa83, 18 },{ 0x12d34, 17 },{ 0x83bc, 16 },
-{ 0x83a, 12 },{ 0x7f8, 17 },{ 0x3fd, 16 },{ 0x3ff, 16 },
-{ 0x79, 13 },{ 0xa82, 18 },{ 0x969d, 16 },{ 0x2a4, 16 },
-{ 0x978, 12 },{ 0x543, 17 },{ 0x41df, 15 },{ 0x7f9, 17 },
-{ 0x12f3, 13 },{ 0x25a6b, 18 },{ 0x25ef9, 18 },{ 0x3fa, 16 },
-{ 0x20ee, 14 },{ 0x969ab, 20 },{ 0x969c, 16 },{ 0x25ef8, 18 },
-{ 0x12d2, 13 },{ 0xa85, 18 },{ 0x969e, 16 },{ 0x4bc8, 15 },
-{ 0x3d, 12 },{ 0x12f7f, 17 },{ 0x2a2, 16 },{ 0x969f, 16 },
-{ 0x25ee, 14 },{ 0x12d355, 21 },{ 0x12f7d, 17 },{ 0x12f7e, 17 },
-{ 0x9e5, 12 },{ 0xa81, 18 },{ 0x4b4d4, 19 },{ 0x83bd, 16 },
-{ 0x78, 13 },{ 0x969b, 16 },{ 0x3fe, 16 },{ 0x2a5, 16 },
-{ 0x7e, 13 },{ 0xa80, 18 },{ 0x2a3, 16 },{ 0x3fb, 16 },
-{ 0x1076, 13 },{ 0xa84, 18 },{ 0x153, 15 },{ 0x4bc9, 15 },
-{ 0x55, 13 },{ 0x12d354, 21 },{ 0x4bde, 15 },{ 0x25e5, 14 },
-{ 0x25b, 10 },{ 0x4b4c, 15 },{ 0x96b, 12 },{ 0x96a, 12 },
-{ 0x1, 2 },{ 0x0, 7 },{ 0x26, 6 },{ 0x12b, 9 },
-{ 0x7, 3 },{ 0x20f, 10 },{ 0x4, 9 },{ 0x28, 12 },
-{ 0x6, 3 },{ 0x20a, 10 },{ 0x128, 9 },{ 0x2b, 12 },
-{ 0x11, 5 },{ 0x1b, 11 },{ 0x13a, 9 },{ 0x4ff, 11 },
-{ 0x3, 4 },{ 0x277, 10 },{ 0x106, 9 },{ 0x839, 12 },
-{ 0xb, 4 },{ 0x27b, 10 },{ 0x12c, 9 },{ 0x4bf, 11 },
-{ 0x9, 6 },{ 0x35, 12 },{ 0x27e, 10 },{ 0x13c8, 13 },
-{ 0x1, 6 },{ 0x4aa, 11 },{ 0x208, 10 },{ 0x29, 12 },
-{ 0x1, 4 },{ 0x254, 10 },{ 0x12e, 9 },{ 0x838, 12 },
-{ 0x24, 6 },{ 0x4f3, 11 },{ 0x276, 10 },{ 0x12f6, 13 },
-{ 0x1, 5 },{ 0x27a, 10 },{ 0x13e, 9 },{ 0x3e, 12 },
-{ 0x8, 6 },{ 0x413, 11 },{ 0xc, 10 },{ 0x4be, 11 },
-{ 0x14, 5 },{ 0x412, 11 },{ 0x253, 10 },{ 0x97a, 12 },
-{ 0x21, 6 },{ 0x4ab, 11 },{ 0x20b, 10 },{ 0x34, 12 },
-{ 0x15, 5 },{ 0x278, 10 },{ 0x252, 10 },{ 0x968, 12 },
-{ 0x5, 5 },{ 0xb, 10 },{ 0x9c, 8 },{ 0xe, 10 },
-};
-
-/* dc table 0 */
-
-const uint32_t ff_table0_dc_lum[120][2] = {
-{ 0x1, 1 },{ 0x1, 2 },{ 0x1, 4 },{ 0x1, 5 },
-{ 0x5, 5 },{ 0x7, 5 },{ 0x8, 6 },{ 0xc, 6 },
-{ 0x0, 7 },{ 0x2, 7 },{ 0x12, 7 },{ 0x1a, 7 },
-{ 0x3, 8 },{ 0x7, 8 },{ 0x27, 8 },{ 0x37, 8 },
-{ 0x5, 9 },{ 0x4c, 9 },{ 0x6c, 9 },{ 0x6d, 9 },
-{ 0x8, 10 },{ 0x19, 10 },{ 0x9b, 10 },{ 0x1b, 10 },
-{ 0x9a, 10 },{ 0x13, 11 },{ 0x34, 11 },{ 0x35, 11 },
-{ 0x61, 12 },{ 0x48, 13 },{ 0xc4, 13 },{ 0x4a, 13 },
-{ 0xc6, 13 },{ 0xc7, 13 },{ 0x92, 14 },{ 0x18b, 14 },
-{ 0x93, 14 },{ 0x183, 14 },{ 0x182, 14 },{ 0x96, 14 },
-{ 0x97, 14 },{ 0x180, 14 },{ 0x314, 15 },{ 0x315, 15 },
-{ 0x605, 16 },{ 0x604, 16 },{ 0x606, 16 },{ 0xc0e, 17 },
-{ 0x303cd, 23 },{ 0x303c9, 23 },{ 0x303c8, 23 },{ 0x303ca, 23 },
-{ 0x303cb, 23 },{ 0x303cc, 23 },{ 0x303ce, 23 },{ 0x303cf, 23 },
-{ 0x303d0, 23 },{ 0x303d1, 23 },{ 0x303d2, 23 },{ 0x303d3, 23 },
-{ 0x303d4, 23 },{ 0x303d5, 23 },{ 0x303d6, 23 },{ 0x303d7, 23 },
-{ 0x303d8, 23 },{ 0x303d9, 23 },{ 0x303da, 23 },{ 0x303db, 23 },
-{ 0x303dc, 23 },{ 0x303dd, 23 },{ 0x303de, 23 },{ 0x303df, 23 },
-{ 0x303e0, 23 },{ 0x303e1, 23 },{ 0x303e2, 23 },{ 0x303e3, 23 },
-{ 0x303e4, 23 },{ 0x303e5, 23 },{ 0x303e6, 23 },{ 0x303e7, 23 },
-{ 0x303e8, 23 },{ 0x303e9, 23 },{ 0x303ea, 23 },{ 0x303eb, 23 },
-{ 0x303ec, 23 },{ 0x303ed, 23 },{ 0x303ee, 23 },{ 0x303ef, 23 },
-{ 0x303f0, 23 },{ 0x303f1, 23 },{ 0x303f2, 23 },{ 0x303f3, 23 },
-{ 0x303f4, 23 },{ 0x303f5, 23 },{ 0x303f6, 23 },{ 0x303f7, 23 },
-{ 0x303f8, 23 },{ 0x303f9, 23 },{ 0x303fa, 23 },{ 0x303fb, 23 },
-{ 0x303fc, 23 },{ 0x303fd, 23 },{ 0x303fe, 23 },{ 0x303ff, 23 },
-{ 0x60780, 24 },{ 0x60781, 24 },{ 0x60782, 24 },{ 0x60783, 24 },
-{ 0x60784, 24 },{ 0x60785, 24 },{ 0x60786, 24 },{ 0x60787, 24 },
-{ 0x60788, 24 },{ 0x60789, 24 },{ 0x6078a, 24 },{ 0x6078b, 24 },
-{ 0x6078c, 24 },{ 0x6078d, 24 },{ 0x6078e, 24 },{ 0x6078f, 24 },
-};
-
-const uint32_t ff_table0_dc_chroma[120][2] = {
-{ 0x0, 2 },{ 0x1, 2 },{ 0x5, 3 },{ 0x9, 4 },
-{ 0xd, 4 },{ 0x11, 5 },{ 0x1d, 5 },{ 0x1f, 5 },
-{ 0x21, 6 },{ 0x31, 6 },{ 0x38, 6 },{ 0x33, 6 },
-{ 0x39, 6 },{ 0x3d, 6 },{ 0x61, 7 },{ 0x79, 7 },
-{ 0x80, 8 },{ 0xc8, 8 },{ 0xca, 8 },{ 0xf0, 8 },
-{ 0x81, 8 },{ 0xc0, 8 },{ 0xc9, 8 },{ 0x107, 9 },
-{ 0x106, 9 },{ 0x196, 9 },{ 0x183, 9 },{ 0x1e3, 9 },
-{ 0x1e2, 9 },{ 0x20a, 10 },{ 0x20b, 10 },{ 0x609, 11 },
-{ 0x412, 11 },{ 0x413, 11 },{ 0x60b, 11 },{ 0x411, 11 },
-{ 0x60a, 11 },{ 0x65f, 11 },{ 0x410, 11 },{ 0x65d, 11 },
-{ 0x65e, 11 },{ 0xcb8, 12 },{ 0xc10, 12 },{ 0xcb9, 12 },
-{ 0x1823, 13 },{ 0x3045, 14 },{ 0x6089, 15 },{ 0xc110, 16 },
-{ 0x304448, 22 },{ 0x304449, 22 },{ 0x30444a, 22 },{ 0x30444b, 22 },
-{ 0x30444c, 22 },{ 0x30444d, 22 },{ 0x30444e, 22 },{ 0x30444f, 22 },
-{ 0x304450, 22 },{ 0x304451, 22 },{ 0x304452, 22 },{ 0x304453, 22 },
-{ 0x304454, 22 },{ 0x304455, 22 },{ 0x304456, 22 },{ 0x304457, 22 },
-{ 0x304458, 22 },{ 0x304459, 22 },{ 0x30445a, 22 },{ 0x30445b, 22 },
-{ 0x30445c, 22 },{ 0x30445d, 22 },{ 0x30445e, 22 },{ 0x30445f, 22 },
-{ 0x304460, 22 },{ 0x304461, 22 },{ 0x304462, 22 },{ 0x304463, 22 },
-{ 0x304464, 22 },{ 0x304465, 22 },{ 0x304466, 22 },{ 0x304467, 22 },
-{ 0x304468, 22 },{ 0x304469, 22 },{ 0x30446a, 22 },{ 0x30446b, 22 },
-{ 0x30446c, 22 },{ 0x30446d, 22 },{ 0x30446e, 22 },{ 0x30446f, 22 },
-{ 0x304470, 22 },{ 0x304471, 22 },{ 0x304472, 22 },{ 0x304473, 22 },
-{ 0x304474, 22 },{ 0x304475, 22 },{ 0x304476, 22 },{ 0x304477, 22 },
-{ 0x304478, 22 },{ 0x304479, 22 },{ 0x30447a, 22 },{ 0x30447b, 22 },
-{ 0x30447c, 22 },{ 0x30447d, 22 },{ 0x30447e, 22 },{ 0x30447f, 22 },
-{ 0x608880, 23 },{ 0x608881, 23 },{ 0x608882, 23 },{ 0x608883, 23 },
-{ 0x608884, 23 },{ 0x608885, 23 },{ 0x608886, 23 },{ 0x608887, 23 },
-{ 0x608888, 23 },{ 0x608889, 23 },{ 0x60888a, 23 },{ 0x60888b, 23 },
-{ 0x60888c, 23 },{ 0x60888d, 23 },{ 0x60888e, 23 },{ 0x60888f, 23 },
-};
-
-/* dc table 1 */
-
-const uint32_t ff_table1_dc_lum[120][2] = {
-{ 0x2, 2 },{ 0x3, 2 },{ 0x3, 3 },{ 0x2, 4 },
-{ 0x5, 4 },{ 0x1, 5 },{ 0x3, 5 },{ 0x8, 5 },
-{ 0x0, 6 },{ 0x5, 6 },{ 0xd, 6 },{ 0xf, 6 },
-{ 0x13, 6 },{ 0x8, 7 },{ 0x18, 7 },{ 0x1c, 7 },
-{ 0x24, 7 },{ 0x4, 8 },{ 0x6, 8 },{ 0x12, 8 },
-{ 0x32, 8 },{ 0x3b, 8 },{ 0x4a, 8 },{ 0x4b, 8 },
-{ 0xb, 9 },{ 0x26, 9 },{ 0x27, 9 },{ 0x66, 9 },
-{ 0x74, 9 },{ 0x75, 9 },{ 0x14, 10 },{ 0x1c, 10 },
-{ 0x1f, 10 },{ 0x1d, 10 },{ 0x2b, 11 },{ 0x3d, 11 },
-{ 0x19d, 11 },{ 0x19f, 11 },{ 0x54, 12 },{ 0x339, 12 },
-{ 0x338, 12 },{ 0x33d, 12 },{ 0xab, 13 },{ 0xf1, 13 },
-{ 0x678, 13 },{ 0xf2, 13 },{ 0x1e0, 14 },{ 0x1e1, 14 },
-{ 0x154, 14 },{ 0xcf2, 14 },{ 0x3cc, 15 },{ 0x2ab, 15 },
-{ 0x19e7, 15 },{ 0x3ce, 15 },{ 0x19e6, 15 },{ 0x554, 16 },
-{ 0x79f, 16 },{ 0x555, 16 },{ 0xf3d, 17 },{ 0xf37, 17 },
-{ 0xf3c, 17 },{ 0xf35, 17 },{ 0x1e6d, 18 },{ 0x1e68, 18 },
-{ 0x3cd8, 19 },{ 0x3cd3, 19 },{ 0x3cd9, 19 },{ 0x79a4, 20 },
-{ 0xf34ba, 25 },{ 0xf34b4, 25 },{ 0xf34b5, 25 },{ 0xf34b6, 25 },
-{ 0xf34b7, 25 },{ 0xf34b8, 25 },{ 0xf34b9, 25 },{ 0xf34bb, 25 },
-{ 0xf34bc, 25 },{ 0xf34bd, 25 },{ 0xf34be, 25 },{ 0xf34bf, 25 },
-{ 0x1e6940, 26 },{ 0x1e6941, 26 },{ 0x1e6942, 26 },{ 0x1e6943, 26 },
-{ 0x1e6944, 26 },{ 0x1e6945, 26 },{ 0x1e6946, 26 },{ 0x1e6947, 26 },
-{ 0x1e6948, 26 },{ 0x1e6949, 26 },{ 0x1e694a, 26 },{ 0x1e694b, 26 },
-{ 0x1e694c, 26 },{ 0x1e694d, 26 },{ 0x1e694e, 26 },{ 0x1e694f, 26 },
-{ 0x1e6950, 26 },{ 0x1e6951, 26 },{ 0x1e6952, 26 },{ 0x1e6953, 26 },
-{ 0x1e6954, 26 },{ 0x1e6955, 26 },{ 0x1e6956, 26 },{ 0x1e6957, 26 },
-{ 0x1e6958, 26 },{ 0x1e6959, 26 },{ 0x1e695a, 26 },{ 0x1e695b, 26 },
-{ 0x1e695c, 26 },{ 0x1e695d, 26 },{ 0x1e695e, 26 },{ 0x1e695f, 26 },
-{ 0x1e6960, 26 },{ 0x1e6961, 26 },{ 0x1e6962, 26 },{ 0x1e6963, 26 },
-{ 0x1e6964, 26 },{ 0x1e6965, 26 },{ 0x1e6966, 26 },{ 0x1e6967, 26 },
-};
-
-const uint32_t ff_table1_dc_chroma[120][2] = {
-{ 0x0, 2 },{ 0x1, 2 },{ 0x4, 3 },{ 0x7, 3 },
-{ 0xb, 4 },{ 0xd, 4 },{ 0x15, 5 },{ 0x28, 6 },
-{ 0x30, 6 },{ 0x32, 6 },{ 0x52, 7 },{ 0x62, 7 },
-{ 0x66, 7 },{ 0xa6, 8 },{ 0xc6, 8 },{ 0xcf, 8 },
-{ 0x14f, 9 },{ 0x18e, 9 },{ 0x19c, 9 },{ 0x29d, 10 },
-{ 0x33a, 10 },{ 0x538, 11 },{ 0x63c, 11 },{ 0x63e, 11 },
-{ 0x63f, 11 },{ 0x676, 11 },{ 0xa73, 12 },{ 0xc7a, 12 },
-{ 0xcef, 12 },{ 0x14e5, 13 },{ 0x19dd, 13 },{ 0x29c8, 14 },
-{ 0x29c9, 14 },{ 0x63dd, 15 },{ 0x33b8, 14 },{ 0x33b9, 14 },
-{ 0xc7b6, 16 },{ 0x63d8, 15 },{ 0x63df, 15 },{ 0xc7b3, 16 },
-{ 0xc7b4, 16 },{ 0xc7b5, 16 },{ 0x63de, 15 },{ 0xc7b7, 16 },
-{ 0xc7b8, 16 },{ 0xc7b9, 16 },{ 0x18f65, 17 },{ 0x31ec8, 18 },
-{ 0xc7b248, 24 },{ 0xc7b249, 24 },{ 0xc7b24a, 24 },{ 0xc7b24b, 24 },
-{ 0xc7b24c, 24 },{ 0xc7b24d, 24 },{ 0xc7b24e, 24 },{ 0xc7b24f, 24 },
-{ 0xc7b250, 24 },{ 0xc7b251, 24 },{ 0xc7b252, 24 },{ 0xc7b253, 24 },
-{ 0xc7b254, 24 },{ 0xc7b255, 24 },{ 0xc7b256, 24 },{ 0xc7b257, 24 },
-{ 0xc7b258, 24 },{ 0xc7b259, 24 },{ 0xc7b25a, 24 },{ 0xc7b25b, 24 },
-{ 0xc7b25c, 24 },{ 0xc7b25d, 24 },{ 0xc7b25e, 24 },{ 0xc7b25f, 24 },
-{ 0xc7b260, 24 },{ 0xc7b261, 24 },{ 0xc7b262, 24 },{ 0xc7b263, 24 },
-{ 0xc7b264, 24 },{ 0xc7b265, 24 },{ 0xc7b266, 24 },{ 0xc7b267, 24 },
-{ 0xc7b268, 24 },{ 0xc7b269, 24 },{ 0xc7b26a, 24 },{ 0xc7b26b, 24 },
-{ 0xc7b26c, 24 },{ 0xc7b26d, 24 },{ 0xc7b26e, 24 },{ 0xc7b26f, 24 },
-{ 0xc7b270, 24 },{ 0xc7b271, 24 },{ 0xc7b272, 24 },{ 0xc7b273, 24 },
-{ 0xc7b274, 24 },{ 0xc7b275, 24 },{ 0xc7b276, 24 },{ 0xc7b277, 24 },
-{ 0xc7b278, 24 },{ 0xc7b279, 24 },{ 0xc7b27a, 24 },{ 0xc7b27b, 24 },
-{ 0xc7b27c, 24 },{ 0xc7b27d, 24 },{ 0xc7b27e, 24 },{ 0xc7b27f, 24 },
-{ 0x18f6480, 25 },{ 0x18f6481, 25 },{ 0x18f6482, 25 },{ 0x18f6483, 25 },
-{ 0x18f6484, 25 },{ 0x18f6485, 25 },{ 0x18f6486, 25 },{ 0x18f6487, 25 },
-{ 0x18f6488, 25 },{ 0x18f6489, 25 },{ 0x18f648a, 25 },{ 0x18f648b, 25 },
-{ 0x18f648c, 25 },{ 0x18f648d, 25 },{ 0x18f648e, 25 },{ 0x18f648f, 25 },
-};
-
-/* vlc table 0, for intra luma */
-
-static const uint16_t table0_vlc[133][2] = {
-{ 0x1, 2 },{ 0x6, 3 },{ 0xf, 4 },{ 0x16, 5 },
-{ 0x20, 6 },{ 0x18, 7 },{ 0x8, 8 },{ 0x9a, 8 },
-{ 0x56, 9 },{ 0x13e, 9 },{ 0xf0, 10 },{ 0x3a5, 10 },
-{ 0x77, 11 },{ 0x1ef, 11 },{ 0x9a, 12 },{ 0x5d, 13 },
-{ 0x1, 4 },{ 0x11, 5 },{ 0x2, 7 },{ 0xb, 8 },
-{ 0x12, 9 },{ 0x1d6, 9 },{ 0x27e, 10 },{ 0x191, 11 },
-{ 0xea, 12 },{ 0x3dc, 12 },{ 0x13b, 13 },{ 0x4, 5 },
-{ 0x14, 7 },{ 0x9e, 8 },{ 0x9, 10 },{ 0x1ac, 11 },
-{ 0x1e2, 11 },{ 0x3ca, 12 },{ 0x5f, 13 },{ 0x17, 5 },
-{ 0x4e, 7 },{ 0x5e, 9 },{ 0xf3, 10 },{ 0x1ad, 11 },
-{ 0xec, 12 },{ 0x5f0, 13 },{ 0xe, 6 },{ 0xe1, 8 },
-{ 0x3a4, 10 },{ 0x9c, 12 },{ 0x13d, 13 },{ 0x3b, 6 },
-{ 0x1c, 9 },{ 0x14, 11 },{ 0x9be, 12 },{ 0x6, 7 },
-{ 0x7a, 9 },{ 0x190, 11 },{ 0x137, 13 },{ 0x1b, 7 },
-{ 0x8, 10 },{ 0x75c, 11 },{ 0x71, 7 },{ 0xd7, 10 },
-{ 0x9bf, 12 },{ 0x7, 8 },{ 0xaf, 10 },{ 0x4cc, 11 },
-{ 0x34, 8 },{ 0x265, 10 },{ 0x9f, 12 },{ 0xe0, 8 },
-{ 0x16, 11 },{ 0x327, 12 },{ 0x15, 9 },{ 0x17d, 11 },
-{ 0xebb, 12 },{ 0x14, 9 },{ 0xf6, 10 },{ 0x1e4, 11 },
-{ 0xcb, 10 },{ 0x99d, 12 },{ 0xca, 10 },{ 0x2fc, 12 },
-{ 0x17f, 11 },{ 0x4cd, 11 },{ 0x2fd, 12 },{ 0x4fe, 11 },
-{ 0x13a, 13 },{ 0xa, 4 },{ 0x42, 7 },{ 0x1d3, 9 },
-{ 0x4dd, 11 },{ 0x12, 5 },{ 0xe8, 8 },{ 0x4c, 11 },
-{ 0x136, 13 },{ 0x39, 6 },{ 0x264, 10 },{ 0xeba, 12 },
-{ 0x0, 7 },{ 0xae, 10 },{ 0x99c, 12 },{ 0x1f, 7 },
-{ 0x4de, 11 },{ 0x43, 7 },{ 0x4dc, 11 },{ 0x3, 8 },
-{ 0x3cb, 12 },{ 0x6, 8 },{ 0x99e, 12 },{ 0x2a, 8 },
-{ 0x5f1, 13 },{ 0xf, 8 },{ 0x9fe, 12 },{ 0x33, 8 },
-{ 0x9ff, 12 },{ 0x98, 8 },{ 0x99f, 12 },{ 0xea, 8 },
-{ 0x13c, 13 },{ 0x2e, 8 },{ 0x192, 11 },{ 0x136, 9 },
-{ 0x6a, 9 },{ 0x15, 11 },{ 0x3af, 10 },{ 0x1e3, 11 },
-{ 0x74, 11 },{ 0xeb, 12 },{ 0x2f9, 12 },{ 0x5c, 13 },
-{ 0xed, 12 },{ 0x3dd, 12 },{ 0x326, 12 },{ 0x5e, 13 },
-{ 0x16, 7 },
-};
-
-static const int8_t table0_level[132] = {
- 1, 2, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 16,
- 1, 2, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 1, 2, 3, 4, 5,
- 6, 7, 8, 1, 2, 3, 4, 5,
- 6, 7, 1, 2, 3, 4, 5, 1,
- 2, 3, 4, 1, 2, 3, 4, 1,
- 2, 3, 1, 2, 3, 1, 2, 3,
- 1, 2, 3, 1, 2, 3, 1, 2,
- 3, 1, 2, 3, 1, 2, 1, 2,
- 1, 1, 1, 1, 1, 1, 2, 3,
- 4, 1, 2, 3, 4, 1, 2, 3,
- 1, 2, 3, 1, 2, 1, 2, 1,
- 2, 1, 2, 1, 2, 1, 2, 1,
- 2, 1, 2, 1, 2, 1, 2, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1,
-};
-
-static const int8_t table0_run[132] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 2, 2, 2, 2, 2,
- 2, 2, 2, 3, 3, 3, 3, 3,
- 3, 3, 4, 4, 4, 4, 4, 5,
- 5, 5, 5, 6, 6, 6, 6, 7,
- 7, 7, 8, 8, 8, 9, 9, 9,
- 10, 10, 10, 11, 11, 11, 12, 12,
- 12, 13, 13, 13, 14, 14, 15, 15,
- 16, 17, 18, 19, 20, 0, 0, 0,
- 0, 1, 1, 1, 1, 2, 2, 2,
- 3, 3, 3, 4, 4, 5, 5, 6,
- 6, 7, 7, 8, 8, 9, 9, 10,
- 10, 11, 11, 12, 12, 13, 13, 14,
- 15, 16, 17, 18, 19, 20, 21, 22,
- 23, 24, 25, 26,
-};
-
-/* vlc table 1, for intra chroma and P macro blocks */
-
-static const uint16_t table1_vlc[149][2] = {
-{ 0x4, 3 },{ 0x14, 5 },{ 0x17, 7 },{ 0x7f, 8 },
-{ 0x154, 9 },{ 0x1f2, 10 },{ 0xbf, 11 },{ 0x65, 12 },
-{ 0xaaa, 12 },{ 0x630, 13 },{ 0x1597, 13 },{ 0x3b7, 14 },
-{ 0x2b22, 14 },{ 0xbe6, 15 },{ 0xb, 4 },{ 0x37, 7 },
-{ 0x62, 9 },{ 0x7, 11 },{ 0x166, 12 },{ 0xce, 13 },
-{ 0x1590, 13 },{ 0x5f6, 14 },{ 0xbe7, 15 },{ 0x7, 5 },
-{ 0x6d, 8 },{ 0x3, 11 },{ 0x31f, 12 },{ 0x5f2, 14 },
-{ 0x2, 6 },{ 0x61, 9 },{ 0x55, 12 },{ 0x1df, 14 },
-{ 0x1a, 6 },{ 0x1e, 10 },{ 0xac9, 12 },{ 0x2b23, 14 },
-{ 0x1e, 6 },{ 0x1f, 10 },{ 0xac3, 12 },{ 0x2b2b, 14 },
-{ 0x6, 7 },{ 0x4, 11 },{ 0x2f8, 13 },{ 0x19, 7 },
-{ 0x6, 11 },{ 0x63d, 13 },{ 0x57, 7 },{ 0x182, 11 },
-{ 0x2aa2, 14 },{ 0x4, 8 },{ 0x180, 11 },{ 0x59c, 14 },
-{ 0x7d, 8 },{ 0x164, 12 },{ 0x76d, 15 },{ 0x2, 9 },
-{ 0x18d, 11 },{ 0x1581, 13 },{ 0xad, 8 },{ 0x60, 12 },
-{ 0xc67, 14 },{ 0x1c, 9 },{ 0xee, 13 },{ 0x3, 9 },
-{ 0x2cf, 13 },{ 0xd9, 9 },{ 0x1580, 13 },{ 0x2, 11 },
-{ 0x183, 11 },{ 0x57, 12 },{ 0x61, 12 },{ 0x31, 11 },
-{ 0x66, 12 },{ 0x631, 13 },{ 0x632, 13 },{ 0xac, 13 },
-{ 0x31d, 12 },{ 0x76, 12 },{ 0x3a, 11 },{ 0x165, 12 },
-{ 0xc66, 14 },{ 0x3, 2 },{ 0x54, 7 },{ 0x2ab, 10 },
-{ 0x16, 13 },{ 0x5f7, 14 },{ 0x5, 4 },{ 0xf8, 9 },
-{ 0xaa9, 12 },{ 0x5f, 15 },{ 0x4, 4 },{ 0x1c, 10 },
-{ 0x1550, 13 },{ 0x4, 5 },{ 0x77, 11 },{ 0x76c, 15 },
-{ 0xe, 5 },{ 0xa, 12 },{ 0xc, 5 },{ 0x562, 11 },
-{ 0x4, 6 },{ 0x31c, 12 },{ 0x6, 6 },{ 0xc8, 13 },
-{ 0xd, 6 },{ 0x1da, 13 },{ 0x7, 6 },{ 0xc9, 13 },
-{ 0x1, 7 },{ 0x2e, 14 },{ 0x14, 7 },{ 0x1596, 13 },
-{ 0xa, 7 },{ 0xac2, 12 },{ 0x16, 7 },{ 0x15b, 14 },
-{ 0x15, 7 },{ 0x15a, 14 },{ 0xf, 8 },{ 0x5e, 15 },
-{ 0x7e, 8 },{ 0xab, 8 },{ 0x2d, 9 },{ 0xd8, 9 },
-{ 0xb, 9 },{ 0x14, 10 },{ 0x2b3, 10 },{ 0x1f3, 10 },
-{ 0x3a, 10 },{ 0x0, 10 },{ 0x58, 10 },{ 0x2e, 9 },
-{ 0x5e, 10 },{ 0x563, 11 },{ 0xec, 12 },{ 0x54, 12 },
-{ 0xac1, 12 },{ 0x1556, 13 },{ 0x2fa, 13 },{ 0x181, 11 },
-{ 0x1557, 13 },{ 0x59d, 14 },{ 0x2aa3, 14 },{ 0x2b2a, 14 },
-{ 0x1de, 14 },{ 0x63c, 13 },{ 0xcf, 13 },{ 0x1594, 13 },
-{ 0xd, 9 },
-};
-
-static const int8_t table1_level[148] = {
- 1, 2, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 1, 2,
- 3, 4, 5, 6, 7, 8, 9, 1,
- 2, 3, 4, 5, 1, 2, 3, 4,
- 1, 2, 3, 4, 1, 2, 3, 4,
- 1, 2, 3, 1, 2, 3, 1, 2,
- 3, 1, 2, 3, 1, 2, 3, 1,
- 2, 3, 1, 2, 3, 1, 2, 1,
- 2, 1, 2, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 2, 3, 4, 5, 1, 2,
- 3, 4, 1, 2, 3, 1, 2, 3,
- 1, 2, 1, 2, 1, 2, 1, 2,
- 1, 2, 1, 2, 1, 2, 1, 2,
- 1, 2, 1, 2, 1, 2, 1, 2,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1,
-};
-
-static const int8_t table1_run[148] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 2,
- 2, 2, 2, 2, 3, 3, 3, 3,
- 4, 4, 4, 4, 5, 5, 5, 5,
- 6, 6, 6, 7, 7, 7, 8, 8,
- 8, 9, 9, 9, 10, 10, 10, 11,
- 11, 11, 12, 12, 12, 13, 13, 14,
- 14, 15, 15, 16, 17, 18, 19, 20,
- 21, 22, 23, 24, 25, 26, 27, 28,
- 29, 0, 0, 0, 0, 0, 1, 1,
- 1, 1, 2, 2, 2, 3, 3, 3,
- 4, 4, 5, 5, 6, 6, 7, 7,
- 8, 8, 9, 9, 10, 10, 11, 11,
- 12, 12, 13, 13, 14, 14, 15, 15,
- 16, 17, 18, 19, 20, 21, 22, 23,
- 24, 25, 26, 27, 28, 29, 30, 31,
- 32, 33, 34, 35, 36, 37, 38, 39,
- 40, 41, 42, 43,
-};
-
-/* third vlc table */
-
-static const uint16_t table2_vlc[186][2] = {
-{ 0x1, 2 },{ 0x5, 3 },{ 0xd, 4 },{ 0x12, 5 },
-{ 0xe, 6 },{ 0x15, 7 },{ 0x13, 8 },{ 0x3f, 8 },
-{ 0x4b, 9 },{ 0x11f, 9 },{ 0xb8, 10 },{ 0x3e3, 10 },
-{ 0x172, 11 },{ 0x24d, 12 },{ 0x3da, 12 },{ 0x2dd, 13 },
-{ 0x1f55, 13 },{ 0x5b9, 14 },{ 0x3eae, 14 },{ 0x0, 4 },
-{ 0x10, 5 },{ 0x8, 7 },{ 0x20, 8 },{ 0x29, 9 },
-{ 0x1f4, 9 },{ 0x233, 10 },{ 0x1e0, 11 },{ 0x12a, 12 },
-{ 0x3dd, 12 },{ 0x50a, 13 },{ 0x1f29, 13 },{ 0xa42, 14 },
-{ 0x1272, 15 },{ 0x1737, 15 },{ 0x3, 5 },{ 0x11, 7 },
-{ 0xc4, 8 },{ 0x4b, 10 },{ 0xb4, 11 },{ 0x7d4, 11 },
-{ 0x345, 12 },{ 0x2d7, 13 },{ 0x7bf, 13 },{ 0x938, 14 },
-{ 0xbbb, 14 },{ 0x95e, 15 },{ 0x13, 5 },{ 0x78, 7 },
-{ 0x69, 9 },{ 0x232, 10 },{ 0x461, 11 },{ 0x3ec, 12 },
-{ 0x520, 13 },{ 0x1f2a, 13 },{ 0x3e50, 14 },{ 0x3e51, 14 },
-{ 0x1486, 15 },{ 0xc, 6 },{ 0x24, 9 },{ 0x94, 11 },
-{ 0x8c0, 12 },{ 0xf09, 14 },{ 0x1ef0, 15 },{ 0x3d, 6 },
-{ 0x53, 9 },{ 0x1a0, 11 },{ 0x2d6, 13 },{ 0xf08, 14 },
-{ 0x13, 7 },{ 0x7c, 9 },{ 0x7c1, 11 },{ 0x4ac, 14 },
-{ 0x1b, 7 },{ 0xa0, 10 },{ 0x344, 12 },{ 0xf79, 14 },
-{ 0x79, 7 },{ 0x3e1, 10 },{ 0x2d4, 13 },{ 0x2306, 14 },
-{ 0x21, 8 },{ 0x23c, 10 },{ 0xfae, 12 },{ 0x23de, 14 },
-{ 0x35, 8 },{ 0x175, 11 },{ 0x7b3, 13 },{ 0xc5, 8 },
-{ 0x174, 11 },{ 0x785, 13 },{ 0x48, 9 },{ 0x1a3, 11 },
-{ 0x49e, 13 },{ 0x2c, 9 },{ 0xfa, 10 },{ 0x7d6, 11 },
-{ 0x92, 10 },{ 0x5cc, 13 },{ 0x1ef1, 15 },{ 0xa3, 10 },
-{ 0x3ed, 12 },{ 0x93e, 14 },{ 0x1e2, 11 },{ 0x1273, 15 },
-{ 0x7c4, 11 },{ 0x1487, 15 },{ 0x291, 12 },{ 0x293, 12 },
-{ 0xf8a, 12 },{ 0x509, 13 },{ 0x508, 13 },{ 0x78d, 13 },
-{ 0x7be, 13 },{ 0x78c, 13 },{ 0x4ae, 14 },{ 0xbba, 14 },
-{ 0x2307, 14 },{ 0xb9a, 14 },{ 0x1736, 15 },{ 0xe, 4 },
-{ 0x45, 7 },{ 0x1f3, 9 },{ 0x47a, 11 },{ 0x5dc, 13 },
-{ 0x23df, 14 },{ 0x19, 5 },{ 0x28, 9 },{ 0x176, 11 },
-{ 0x49d, 13 },{ 0x23dd, 14 },{ 0x30, 6 },{ 0xa2, 10 },
-{ 0x2ef, 12 },{ 0x5b8, 14 },{ 0x3f, 6 },{ 0xa5, 10 },
-{ 0x3db, 12 },{ 0x93f, 14 },{ 0x44, 7 },{ 0x7cb, 11 },
-{ 0x95f, 15 },{ 0x63, 7 },{ 0x3c3, 12 },{ 0x15, 8 },
-{ 0x8f6, 12 },{ 0x17, 8 },{ 0x498, 13 },{ 0x2c, 8 },
-{ 0x7b2, 13 },{ 0x2f, 8 },{ 0x1f54, 13 },{ 0x8d, 8 },
-{ 0x7bd, 13 },{ 0x8e, 8 },{ 0x1182, 13 },{ 0xfb, 8 },
-{ 0x50b, 13 },{ 0x2d, 8 },{ 0x7c0, 11 },{ 0x79, 9 },
-{ 0x1f5f, 13 },{ 0x7a, 9 },{ 0x1f56, 13 },{ 0x231, 10 },
-{ 0x3e4, 10 },{ 0x1a1, 11 },{ 0x143, 11 },{ 0x1f7, 11 },
-{ 0x16f, 12 },{ 0x292, 12 },{ 0x2e7, 12 },{ 0x16c, 12 },
-{ 0x16d, 12 },{ 0x3dc, 12 },{ 0xf8b, 12 },{ 0x499, 13 },
-{ 0x3d8, 12 },{ 0x78e, 13 },{ 0x2d5, 13 },{ 0x1f5e, 13 },
-{ 0x1f2b, 13 },{ 0x78f, 13 },{ 0x4ad, 14 },{ 0x3eaf, 14 },
-{ 0x23dc, 14 },{ 0x4a, 9 },
-};
-
-static const int8_t table2_level[185] = {
- 1, 2, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 1, 2, 3, 4, 5,
- 6, 7, 8, 9, 10, 11, 12, 13,
- 14, 15, 1, 2, 3, 4, 5, 6,
- 7, 8, 9, 10, 11, 12, 1, 2,
- 3, 4, 5, 6, 7, 8, 9, 10,
- 11, 1, 2, 3, 4, 5, 6, 1,
- 2, 3, 4, 5, 1, 2, 3, 4,
- 1, 2, 3, 4, 1, 2, 3, 4,
- 1, 2, 3, 4, 1, 2, 3, 1,
- 2, 3, 1, 2, 3, 1, 2, 3,
- 1, 2, 3, 1, 2, 3, 1, 2,
- 1, 2, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 2, 3, 4, 5, 6, 1, 2, 3,
- 4, 5, 1, 2, 3, 4, 1, 2,
- 3, 4, 1, 2, 3, 1, 2, 1,
- 2, 1, 2, 1, 2, 1, 2, 1,
- 2, 1, 2, 1, 2, 1, 2, 1,
- 2, 1, 2, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1,
-};
-
-static const int8_t table2_run[185] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 4, 4, 4, 4, 4, 4, 5,
- 5, 5, 5, 5, 6, 6, 6, 6,
- 7, 7, 7, 7, 8, 8, 8, 8,
- 9, 9, 9, 9, 10, 10, 10, 11,
- 11, 11, 12, 12, 12, 13, 13, 13,
- 14, 14, 14, 15, 15, 15, 16, 16,
- 17, 17, 18, 19, 20, 21, 22, 23,
- 24, 25, 26, 27, 28, 29, 30, 0,
- 0, 0, 0, 0, 0, 1, 1, 1,
- 1, 1, 2, 2, 2, 2, 3, 3,
- 3, 3, 4, 4, 4, 5, 5, 6,
- 6, 7, 7, 8, 8, 9, 9, 10,
- 10, 11, 11, 12, 12, 13, 13, 14,
- 14, 15, 15, 16, 17, 18, 19, 20,
- 21, 22, 23, 24, 25, 26, 27, 28,
- 29, 30, 31, 32, 33, 34, 35, 36,
- 37,
-};
-
-/* second non intra vlc table */
-static const uint16_t table4_vlc[169][2] = {
-{ 0x0, 3 },{ 0x3, 4 },{ 0xb, 5 },{ 0x14, 6 },
-{ 0x3f, 6 },{ 0x5d, 7 },{ 0xa2, 8 },{ 0xac, 9 },
-{ 0x16e, 9 },{ 0x20a, 10 },{ 0x2e2, 10 },{ 0x432, 11 },
-{ 0x5c9, 11 },{ 0x827, 12 },{ 0xb54, 12 },{ 0x4e6, 13 },
-{ 0x105f, 13 },{ 0x172a, 13 },{ 0x20b2, 14 },{ 0x2d4e, 14 },
-{ 0x39f0, 14 },{ 0x4175, 15 },{ 0x5a9e, 15 },{ 0x4, 4 },
-{ 0x1e, 5 },{ 0x42, 7 },{ 0xb6, 8 },{ 0x173, 9 },
-{ 0x395, 10 },{ 0x72e, 11 },{ 0xb94, 12 },{ 0x16a4, 13 },
-{ 0x20b3, 14 },{ 0x2e45, 14 },{ 0x5, 5 },{ 0x40, 7 },
-{ 0x49, 9 },{ 0x28f, 10 },{ 0x5cb, 11 },{ 0x48a, 13 },
-{ 0x9dd, 14 },{ 0x73e2, 15 },{ 0x18, 5 },{ 0x25, 8 },
-{ 0x8a, 10 },{ 0x51b, 11 },{ 0xe5f, 12 },{ 0x9c9, 14 },
-{ 0x139c, 15 },{ 0x29, 6 },{ 0x4f, 9 },{ 0x412, 11 },
-{ 0x48d, 13 },{ 0x2e41, 14 },{ 0x38, 6 },{ 0x10e, 9 },
-{ 0x5a8, 11 },{ 0x105c, 13 },{ 0x39f2, 14 },{ 0x58, 7 },
-{ 0x21f, 10 },{ 0xe7e, 12 },{ 0x39ff, 14 },{ 0x23, 8 },
-{ 0x2e3, 10 },{ 0x4e5, 13 },{ 0x2e40, 14 },{ 0xa1, 8 },
-{ 0x5be, 11 },{ 0x9c8, 14 },{ 0x83, 8 },{ 0x13a, 11 },
-{ 0x1721, 13 },{ 0x44, 9 },{ 0x276, 12 },{ 0x39f6, 14 },
-{ 0x8b, 10 },{ 0x4ef, 13 },{ 0x5a9b, 15 },{ 0x208, 10 },
-{ 0x1cfe, 13 },{ 0x399, 10 },{ 0x1cb4, 13 },{ 0x39e, 10 },
-{ 0x39f3, 14 },{ 0x5ab, 11 },{ 0x73e3, 15 },{ 0x737, 11 },
-{ 0x5a9f, 15 },{ 0x82d, 12 },{ 0xe69, 12 },{ 0xe68, 12 },
-{ 0x433, 11 },{ 0xb7b, 12 },{ 0x2df8, 14 },{ 0x2e56, 14 },
-{ 0x2e57, 14 },{ 0x39f7, 14 },{ 0x51a5, 15 },{ 0x3, 3 },
-{ 0x2a, 6 },{ 0xe4, 8 },{ 0x28e, 10 },{ 0x735, 11 },
-{ 0x1058, 13 },{ 0x1cfa, 13 },{ 0x2df9, 14 },{ 0x4174, 15 },
-{ 0x9, 4 },{ 0x54, 8 },{ 0x398, 10 },{ 0x48b, 13 },
-{ 0x139d, 15 },{ 0xd, 4 },{ 0xad, 9 },{ 0x826, 12 },
-{ 0x2d4c, 14 },{ 0x11, 5 },{ 0x16b, 9 },{ 0xb7f, 12 },
-{ 0x51a4, 15 },{ 0x19, 5 },{ 0x21b, 10 },{ 0x16fd, 13 },
-{ 0x1d, 5 },{ 0x394, 10 },{ 0x28d3, 14 },{ 0x2b, 6 },
-{ 0x5bc, 11 },{ 0x5a9a, 15 },{ 0x2f, 6 },{ 0x247, 12 },
-{ 0x10, 7 },{ 0xa35, 12 },{ 0x3e, 6 },{ 0xb7a, 12 },
-{ 0x59, 7 },{ 0x105e, 13 },{ 0x26, 8 },{ 0x9cf, 14 },
-{ 0x55, 8 },{ 0x1cb5, 13 },{ 0x57, 8 },{ 0xe5b, 12 },
-{ 0xa0, 8 },{ 0x1468, 13 },{ 0x170, 9 },{ 0x90, 10 },
-{ 0x1ce, 9 },{ 0x21a, 10 },{ 0x218, 10 },{ 0x168, 9 },
-{ 0x21e, 10 },{ 0x244, 12 },{ 0x736, 11 },{ 0x138, 11 },
-{ 0x519, 11 },{ 0xe5e, 12 },{ 0x72c, 11 },{ 0xb55, 12 },
-{ 0x9dc, 14 },{ 0x20bb, 14 },{ 0x48c, 13 },{ 0x1723, 13 },
-{ 0x2e44, 14 },{ 0x16a5, 13 },{ 0x518, 11 },{ 0x39fe, 14 },
-{ 0x169, 9 },
-};
-
-static const int8_t table4_level[168] = {
- 1, 2, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, 1,
- 2, 3, 4, 5, 6, 7, 8, 9,
- 10, 11, 1, 2, 3, 4, 5, 6,
- 7, 8, 1, 2, 3, 4, 5, 6,
- 7, 1, 2, 3, 4, 5, 1, 2,
- 3, 4, 5, 1, 2, 3, 4, 1,
- 2, 3, 4, 1, 2, 3, 1, 2,
- 3, 1, 2, 3, 1, 2, 3, 1,
- 2, 1, 2, 1, 2, 1, 2, 1,
- 2, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 2, 3, 4, 5,
- 6, 7, 8, 9, 1, 2, 3, 4,
- 5, 1, 2, 3, 4, 1, 2, 3,
- 4, 1, 2, 3, 1, 2, 3, 1,
- 2, 3, 1, 2, 1, 2, 1, 2,
- 1, 2, 1, 2, 1, 2, 1, 2,
- 1, 2, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
-};
-
-static const int8_t table4_run[168] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 2, 2, 2, 2, 2, 2,
- 2, 2, 3, 3, 3, 3, 3, 3,
- 3, 4, 4, 4, 4, 4, 5, 5,
- 5, 5, 5, 6, 6, 6, 6, 7,
- 7, 7, 7, 8, 8, 8, 9, 9,
- 9, 10, 10, 10, 11, 11, 11, 12,
- 12, 13, 13, 14, 14, 15, 15, 16,
- 16, 17, 18, 19, 20, 21, 22, 23,
- 24, 25, 26, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 1, 1, 1,
- 1, 2, 2, 2, 2, 3, 3, 3,
- 3, 4, 4, 4, 5, 5, 5, 6,
- 6, 6, 7, 7, 8, 8, 9, 9,
- 10, 10, 11, 11, 12, 12, 13, 13,
- 14, 14, 15, 16, 17, 18, 19, 20,
- 21, 22, 23, 24, 25, 26, 27, 28,
- 29, 30, 31, 32, 33, 34, 35, 36,
-};
-
-extern const uint16_t inter_vlc[103][2];
-extern const int8_t inter_level[102];
-extern const int8_t inter_run[102];
-
-extern const uint16_t intra_vlc[103][2];
-extern const int8_t intra_level[102];
-extern const int8_t intra_run[102];
-
-extern const uint8_t DCtab_lum[13][2];
-extern const uint8_t DCtab_chrom[13][2];
-
-extern const uint8_t cbpy_tab[16][2];
-extern const uint8_t mvtab[33][2];
-
-extern const uint8_t intra_MCBPC_code[9];
-extern const uint8_t intra_MCBPC_bits[9];
-
-extern const uint8_t inter_MCBPC_code[28];
-extern const uint8_t inter_MCBPC_bits[28];
-
-#define NB_RL_TABLES 6
-
-static RLTable rl_table[NB_RL_TABLES] = {
- /* intra luminance tables */
- {
- 132,
- 85,
- table0_vlc,
- table0_run,
- table0_level,
- },
- {
- 185,
- 119,
- table2_vlc,
- table2_run,
- table2_level,
- },
- {
- 102,
- 67,
- intra_vlc,
- intra_run,
- intra_level,
- },
- /* intra chrominance / non intra tables */
- {
- 148,
- 81,
- table1_vlc,
- table1_run,
- table1_level,
- },
- {
- 168,
- 99,
- table4_vlc,
- table4_run,
- table4_level,
- },
- {
- 102,
- 58,
- inter_vlc,
- inter_run,
- inter_level,
- },
-};
-
-/* motion vector table 0 */
-
-static const uint16_t table0_mv_code[1100] = {
- 0x0001, 0x0003, 0x0005, 0x0007, 0x0003, 0x0008, 0x000c, 0x0001,
- 0x0002, 0x001b, 0x0006, 0x000b, 0x0015, 0x0002, 0x000e, 0x000f,
- 0x0014, 0x0020, 0x0022, 0x0025, 0x0027, 0x0029, 0x002d, 0x004b,
- 0x004d, 0x0003, 0x0022, 0x0023, 0x0025, 0x0027, 0x0042, 0x0048,
- 0x0049, 0x0050, 0x005c, 0x0091, 0x009f, 0x000e, 0x0043, 0x004c,
- 0x0054, 0x0056, 0x008c, 0x0098, 0x009a, 0x009b, 0x00b1, 0x00b2,
- 0x0120, 0x0121, 0x0126, 0x0133, 0x0139, 0x01a1, 0x01a4, 0x01a5,
- 0x01a6, 0x01a7, 0x01ae, 0x01af, 0x000b, 0x0019, 0x0085, 0x0090,
- 0x009b, 0x00aa, 0x00af, 0x010c, 0x010e, 0x011c, 0x011e, 0x0133,
- 0x0144, 0x0160, 0x0174, 0x0175, 0x0177, 0x0178, 0x0249, 0x024b,
- 0x0252, 0x0261, 0x0265, 0x0270, 0x0352, 0x0353, 0x0355, 0x0359,
- 0x0010, 0x0011, 0x0013, 0x0034, 0x0035, 0x0036, 0x0037, 0x003d,
- 0x003e, 0x0109, 0x0126, 0x0156, 0x021a, 0x021e, 0x023a, 0x023e,
- 0x028e, 0x028f, 0x02cf, 0x0491, 0x0494, 0x049f, 0x04a0, 0x04a3,
- 0x04a6, 0x04a7, 0x04ad, 0x04ae, 0x04c0, 0x04c4, 0x04c6, 0x04c8,
- 0x04c9, 0x04f5, 0x04f6, 0x04f7, 0x0680, 0x0682, 0x0683, 0x0688,
- 0x0689, 0x068d, 0x068e, 0x068f, 0x06a2, 0x06a3, 0x06a9, 0x06b0,
- 0x06b1, 0x06b4, 0x06b5, 0x0024, 0x0060, 0x0063, 0x0078, 0x0079,
- 0x0211, 0x0244, 0x0245, 0x0247, 0x0248, 0x0249, 0x024a, 0x024b,
- 0x026b, 0x02af, 0x02b8, 0x02bb, 0x0436, 0x0476, 0x0477, 0x047e,
- 0x04c8, 0x04c9, 0x04ca, 0x0514, 0x0586, 0x0587, 0x0598, 0x059d,
- 0x05d9, 0x05da, 0x0920, 0x0921, 0x093b, 0x093c, 0x093d, 0x0942,
- 0x0943, 0x0944, 0x0945, 0x0959, 0x095e, 0x095f, 0x0982, 0x0983,
- 0x098e, 0x098f, 0x09c4, 0x09e7, 0x09e8, 0x09e9, 0x0d02, 0x0d17,
- 0x0d18, 0x0d19, 0x0d41, 0x0d42, 0x0d43, 0x0d50, 0x0d5f, 0x0d6d,
- 0x0d6e, 0x0d6f, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057,
- 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x041e, 0x041f, 0x0420, 0x0421,
- 0x048c, 0x048d, 0x04d3, 0x04d4, 0x04d5, 0x055c, 0x055d, 0x0572,
- 0x0573, 0x0574, 0x0575, 0x08de, 0x08df, 0x08fe, 0x08ff, 0x0996,
- 0x0a36, 0x0a37, 0x0b08, 0x0b09, 0x0b0a, 0x0b0b, 0x0b32, 0x0b33,
- 0x0b34, 0x0b35, 0x0b36, 0x0b37, 0x0b38, 0x0b39, 0x0bb0, 0x0bf7,
- 0x0bf8, 0x0bf9, 0x0bfa, 0x0bfb, 0x0bfc, 0x0bfd, 0x0bfe, 0x0bff,
- 0x1254, 0x1255, 0x1256, 0x1257, 0x1270, 0x1271, 0x1272, 0x1273,
- 0x1274, 0x1275, 0x12ab, 0x12ac, 0x12ad, 0x12ae, 0x12af, 0x12b0,
- 0x12b1, 0x1315, 0x1316, 0x1317, 0x13bf, 0x13c0, 0x13c1, 0x13c2,
- 0x13c3, 0x13c4, 0x13c5, 0x13c6, 0x13c7, 0x13c8, 0x13c9, 0x13ca,
- 0x13cb, 0x13cc, 0x13cd, 0x1a06, 0x1a07, 0x1a28, 0x1a29, 0x1a2a,
- 0x1a2b, 0x1a2c, 0x1a2d, 0x1a80, 0x1abb, 0x1abc, 0x1abd, 0x1ad8,
- 0x1ad9, 0x0094, 0x0095, 0x0096, 0x0097, 0x00a0, 0x00a1, 0x00a2,
- 0x00a3, 0x0831, 0x0832, 0x0833, 0x0834, 0x0835, 0x0836, 0x0837,
- 0x0838, 0x0839, 0x083a, 0x083b, 0x0939, 0x093a, 0x093b, 0x093c,
- 0x093d, 0x093e, 0x093f, 0x09a0, 0x09a1, 0x09a2, 0x09a3, 0x09a4,
- 0x09a5, 0x11ac, 0x11ad, 0x11ae, 0x11af, 0x11b0, 0x11b1, 0x11b2,
- 0x11b3, 0x11b4, 0x11b5, 0x11b6, 0x11b7, 0x11b8, 0x11b9, 0x11ba,
- 0x11bb, 0x132f, 0x1454, 0x1455, 0x1456, 0x1457, 0x1458, 0x1459,
- 0x145a, 0x145b, 0x145c, 0x145d, 0x145e, 0x145f, 0x1460, 0x1461,
- 0x1462, 0x1463, 0x1464, 0x1465, 0x1466, 0x1467, 0x1468, 0x1469,
- 0x146a, 0x146b, 0x17de, 0x17df, 0x17e0, 0x17e1, 0x17e2, 0x17e3,
- 0x17e4, 0x17e5, 0x17e6, 0x17e7, 0x17e8, 0x17e9, 0x17ea, 0x17eb,
- 0x17ec, 0x17ed, 0x2540, 0x2541, 0x2542, 0x2543, 0x2544, 0x2545,
- 0x2546, 0x2547, 0x2548, 0x2549, 0x254a, 0x254b, 0x254c, 0x254d,
- 0x254e, 0x254f, 0x2550, 0x2551, 0x2552, 0x2553, 0x2554, 0x2555,
- 0x2628, 0x2766, 0x2767, 0x2768, 0x2769, 0x276a, 0x276b, 0x276c,
- 0x276d, 0x276e, 0x276f, 0x2770, 0x2771, 0x2772, 0x2773, 0x2774,
- 0x2775, 0x2776, 0x2777, 0x2778, 0x2779, 0x277a, 0x277b, 0x277c,
- 0x277d, 0x3503, 0x3544, 0x3545, 0x3546, 0x3547, 0x3560, 0x3561,
- 0x3562, 0x3563, 0x3564, 0x3565, 0x3566, 0x3567, 0x3568, 0x3569,
- 0x356a, 0x356b, 0x356c, 0x356d, 0x356e, 0x356f, 0x3570, 0x3571,
- 0x3572, 0x3573, 0x3574, 0x3575, 0x03f0, 0x103d, 0x103e, 0x103f,
- 0x1040, 0x1041, 0x1042, 0x1043, 0x1044, 0x1045, 0x1046, 0x1047,
- 0x1048, 0x1049, 0x104a, 0x104b, 0x104c, 0x104d, 0x104e, 0x104f,
- 0x1050, 0x1051, 0x1052, 0x1053, 0x1054, 0x1055, 0x1056, 0x1057,
- 0x1058, 0x1059, 0x105a, 0x105b, 0x105c, 0x105d, 0x105e, 0x105f,
- 0x1060, 0x1061, 0x1270, 0x1271, 0x21b8, 0x21b9, 0x21ba, 0x21bb,
- 0x21bc, 0x21bd, 0x21be, 0x21bf, 0x21f0, 0x21f1, 0x21f2, 0x21f3,
- 0x21f4, 0x21f5, 0x21f6, 0x21f7, 0x21f8, 0x21f9, 0x21fa, 0x21fb,
- 0x21fc, 0x21fd, 0x21fe, 0x21ff, 0x2340, 0x2341, 0x2342, 0x2343,
- 0x2344, 0x2345, 0x2346, 0x2347, 0x2348, 0x2349, 0x234a, 0x234b,
- 0x234c, 0x234d, 0x234e, 0x234f, 0x2350, 0x2351, 0x2352, 0x2353,
- 0x2354, 0x2355, 0x2356, 0x2357, 0x265c, 0x2f88, 0x2f89, 0x2f8a,
- 0x2f8b, 0x2f8c, 0x2f8d, 0x2f8e, 0x2f8f, 0x2f90, 0x2f91, 0x2f92,
- 0x2f93, 0x2f94, 0x2f95, 0x2f96, 0x2f97, 0x2f98, 0x2f99, 0x2f9a,
- 0x2f9b, 0x2f9c, 0x2f9d, 0x2f9e, 0x2f9f, 0x2fa0, 0x2fa1, 0x2fa2,
- 0x2fa3, 0x2fa4, 0x2fa5, 0x2fa6, 0x2fa7, 0x2fa8, 0x2fa9, 0x2faa,
- 0x2fab, 0x2fac, 0x2fad, 0x2fae, 0x2faf, 0x2fb0, 0x2fb1, 0x2fb2,
- 0x2fb3, 0x2fb4, 0x2fb5, 0x2fb6, 0x2fb7, 0x2fb8, 0x2fb9, 0x2fba,
- 0x2fbb, 0x4c52, 0x4c53, 0x4e28, 0x4e29, 0x4e2a, 0x4e2b, 0x4e2c,
- 0x4e2d, 0x4e2e, 0x4e2f, 0x4e30, 0x4e31, 0x4e32, 0x4e33, 0x4e34,
- 0x4e35, 0x4e36, 0x4e37, 0x4e38, 0x4e39, 0x4e3a, 0x4e3b, 0x4e3c,
- 0x4e3d, 0x4e3e, 0x4e3f, 0x4e80, 0x4e81, 0x4e82, 0x4e83, 0x4e84,
- 0x4e85, 0x4e86, 0x4e87, 0x4e88, 0x4e89, 0x4e8a, 0x4e8b, 0x4e8c,
- 0x4e8d, 0x4e8e, 0x4e8f, 0x4e90, 0x4e91, 0x4e92, 0x4e93, 0x4e94,
- 0x4e95, 0x4e96, 0x4e97, 0x4e98, 0x4e99, 0x4e9a, 0x4e9b, 0x4e9c,
- 0x4e9d, 0x4e9e, 0x4e9f, 0x4ea0, 0x4ea1, 0x4ea2, 0x4ea3, 0x4ea4,
- 0x4ea5, 0x4ea6, 0x4ea7, 0x4ea8, 0x4ea9, 0x4eaa, 0x4eab, 0x4eac,
- 0x4ead, 0x4eae, 0x4eaf, 0x4eb0, 0x4eb1, 0x4eb2, 0x4eb3, 0x4eb4,
- 0x4eb5, 0x4eb6, 0x4eb7, 0x4eb8, 0x4eb9, 0x4eba, 0x4ebb, 0x4ebc,
- 0x4ebd, 0x4ebe, 0x4ebf, 0x4ec0, 0x4ec1, 0x4ec2, 0x4ec3, 0x4ec4,
- 0x4ec5, 0x4ec6, 0x4ec7, 0x4ec8, 0x4ec9, 0x4eca, 0x4ecb, 0x6a04,
- 0x6a05, 0x07e2, 0x07e3, 0x07e4, 0x07e5, 0x07e6, 0x07e7, 0x07e8,
- 0x07e9, 0x07ea, 0x07eb, 0x07ec, 0x07ed, 0x07ee, 0x07ef, 0x07f0,
- 0x07f1, 0x07f2, 0x07f3, 0x07f4, 0x07f5, 0x07f6, 0x07f7, 0x07f8,
- 0x07f9, 0x07fa, 0x07fb, 0x07fc, 0x07fd, 0x07fe, 0x07ff, 0x2000,
- 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008,
- 0x2009, 0x200a, 0x200b, 0x200c, 0x200d, 0x200e, 0x200f, 0x2010,
- 0x2011, 0x2012, 0x2013, 0x2014, 0x2015, 0x2016, 0x2017, 0x2018,
- 0x2019, 0x201a, 0x201b, 0x201c, 0x201d, 0x201e, 0x201f, 0x2020,
- 0x2021, 0x2022, 0x2023, 0x2024, 0x2025, 0x2026, 0x2027, 0x2028,
- 0x2029, 0x202a, 0x202b, 0x202c, 0x202d, 0x202e, 0x202f, 0x2030,
- 0x2031, 0x2032, 0x2033, 0x2034, 0x2035, 0x2036, 0x2037, 0x2038,
- 0x2039, 0x203a, 0x203b, 0x203c, 0x203d, 0x203e, 0x203f, 0x2040,
- 0x2041, 0x2042, 0x2043, 0x2044, 0x2045, 0x2046, 0x2047, 0x2048,
- 0x2049, 0x204a, 0x204b, 0x204c, 0x204d, 0x204e, 0x204f, 0x2050,
- 0x2051, 0x2052, 0x2053, 0x2054, 0x2055, 0x2056, 0x2057, 0x2058,
- 0x2059, 0x205a, 0x205b, 0x205c, 0x205d, 0x205e, 0x205f, 0x2060,
- 0x2061, 0x2062, 0x2063, 0x2064, 0x2065, 0x2066, 0x2067, 0x2068,
- 0x2069, 0x206a, 0x206b, 0x206c, 0x206d, 0x206e, 0x206f, 0x2070,
- 0x2071, 0x2072, 0x2073, 0x2074, 0x2075, 0x2076, 0x2077, 0x2078,
- 0x2079, 0x4cba, 0x4cbb, 0x5d88, 0x5d89, 0x5d8a, 0x5d8b, 0x5d8c,
- 0x5d8d, 0x5d8e, 0x5d8f, 0x5db0, 0x5db1, 0x5db2, 0x5db3, 0x5db4,
- 0x5db5, 0x5db6, 0x5db7, 0x5db8, 0x5db9, 0x5dba, 0x5dbb, 0x5dbc,
- 0x5dbd, 0x5dbe, 0x5dbf, 0x5e40, 0x5e41, 0x5e42, 0x5e43, 0x5e44,
- 0x5e45, 0x5e46, 0x5e47, 0x5e48, 0x5e49, 0x5e4a, 0x5e4b, 0x5e4c,
- 0x5e4d, 0x5e4e, 0x5e4f, 0x5e50, 0x5e51, 0x5e52, 0x5e53, 0x5e54,
- 0x5e55, 0x5e56, 0x5e57, 0x5e58, 0x5e59, 0x5e5a, 0x5e5b, 0x5e5c,
- 0x5e5d, 0x5e5e, 0x5e5f, 0x5e60, 0x5e61, 0x5e62, 0x5e63, 0x5e64,
- 0x5e65, 0x5e66, 0x5e67, 0x5e68, 0x5e69, 0x5e6a, 0x5e6b, 0x5e6c,
- 0x5e6d, 0x5e6e, 0x5e6f, 0x5e70, 0x5e71, 0x5e72, 0x5e73, 0x5e74,
- 0x5e75, 0x5e76, 0x5e77, 0x5e78, 0x5e79, 0x5e7a, 0x5e7b, 0x5e7c,
- 0x5e7d, 0x5e7e, 0x5e7f, 0x5e80, 0x5e81, 0x5e82, 0x5e83, 0x5e84,
- 0x5e85, 0x5e86, 0x5e87, 0x5e88, 0x5e89, 0x5e8a, 0x5e8b, 0x5e8c,
- 0x5e8d, 0x5e8e, 0x5e8f, 0x5e90, 0x5e91, 0x5e92, 0x5e93, 0x5e94,
- 0x5e95, 0x5e96, 0x5e97, 0x5e98, 0x5e99, 0x5e9a, 0x5e9b, 0x5e9c,
- 0x5e9d, 0x5e9e, 0x5e9f, 0x5ea0, 0x5ea1, 0x5ea2, 0x5ea3, 0x5ea4,
- 0x5ea5, 0x5ea6, 0x5ea7, 0x5ea8, 0x5ea9, 0x5eaa, 0x5eab, 0x5eac,
- 0x5ead, 0x5eae, 0x5eaf, 0x5eb0, 0x5eb1, 0x5eb2, 0x5eb3, 0x5eb4,
- 0x5eb5, 0x5eb6, 0x5eb7, 0x5eb8, 0x5eb9, 0x5eba, 0x5ebb, 0x5ebc,
- 0x5ebd, 0x5ebe, 0x5ebf, 0x5ec0, 0x5ec1, 0x5ec2, 0x5ec3, 0x5ec4,
- 0x5ec5, 0x5ec6, 0x5ec7, 0x5ec8, 0x5ec9, 0x5eca, 0x5ecb, 0x5ecc,
- 0x5ecd, 0x5ece, 0x5ecf, 0x5ed0, 0x5ed1, 0x5ed2, 0x5ed3, 0x5ed4,
- 0x5ed5, 0x5ed6, 0x5ed7, 0x5ed8, 0x5ed9, 0x5eda, 0x5edb, 0x5edc,
- 0x5edd, 0x5ede, 0x5edf, 0x5ee0, 0x5ee1, 0x5ee2, 0x5ee3, 0x5ee4,
- 0x5ee5, 0x5ee6, 0x5ee7, 0x5ee8, 0x5ee9, 0x5eea, 0x5eeb, 0x5eec,
- 0x5eed, 0x5eee, 0x5eef, 0x5ef0, 0x5ef1, 0x5ef2, 0x5ef3, 0x5ef4,
- 0x5ef5, 0x5ef6, 0x5ef7, 0x5ef8, 0x5ef9, 0x5efa, 0x5efb, 0x5efc,
- 0x5efd, 0x5efe, 0x5eff, 0x5f00, 0x5f01, 0x5f02, 0x5f03, 0x5f04,
- 0x5f05, 0x5f06, 0x5f07, 0x5f08, 0x5f09, 0x5f0a, 0x5f0b, 0x5f0c,
- 0x5f0d, 0x5f0e, 0x5f0f, 0x0000,
-};
-
-static const uint8_t table0_mv_bits[1100] = {
- 1, 4, 4, 4, 5, 5, 5, 6,
- 6, 6, 7, 7, 7, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 8,
-};
-
-static const uint8_t table0_mvx[1099] = {
- 32, 32, 31, 32, 33, 31, 33, 31,
- 33, 32, 34, 32, 30, 32, 31, 34,
- 35, 32, 34, 33, 29, 33, 30, 30,
- 31, 31, 35, 29, 33, 35, 33, 34,
- 31, 29, 30, 34, 30, 36, 28, 32,
- 34, 37, 30, 27, 32, 25, 39, 32,
- 34, 32, 35, 35, 35, 31, 35, 29,
- 32, 29, 30, 29, 37, 27, 36, 38,
- 37, 33, 32, 31, 29, 31, 28, 36,
- 33, 30, 34, 33, 33, 28, 27, 25,
- 31, 26, 39, 32, 32, 31, 33, 39,
- 31, 38, 28, 36, 21, 23, 43, 36,
- 34, 41, 30, 25, 28, 31, 30, 34,
- 38, 35, 61, 34, 28, 30, 37, 37,
- 35, 27, 36, 3, 59, 38, 37, 32,
- 31, 29, 26, 33, 37, 33, 27, 27,
- 35, 34, 34, 40, 42, 33, 32, 29,
- 4, 5, 28, 24, 25, 35, 39, 38,
- 32, 23, 27, 32, 30, 35, 26, 34,
- 60, 36, 29, 22, 26, 41, 7, 30,
- 38, 30, 36, 29, 30, 41, 26, 25,
- 32, 34, 24, 39, 1, 25, 39, 32,
- 28, 29, 32, 38, 26, 36, 28, 63,
- 28, 39, 23, 21, 26, 35, 31, 35,
- 57, 31, 29, 29, 28, 30, 27, 35,
- 2, 38, 40, 34, 37, 29, 38, 43,
- 26, 32, 33, 42, 24, 40, 28, 32,
- 32, 32, 36, 32, 43, 25, 21, 31,
- 30, 31, 41, 29, 33, 37, 26, 37,
- 27, 59, 23, 33, 35, 31, 31, 37,
- 38, 39, 32, 23, 32, 27, 37, 36,
- 31, 40, 25, 27, 38, 31, 36, 28,
- 31, 36, 25, 45, 3, 34, 38, 39,
- 40, 38, 30, 32, 19, 24, 25, 26,
- 45, 20, 24, 33, 33, 31, 41, 34,
- 39, 47, 40, 58, 59, 41, 33, 3,
- 17, 61, 42, 30, 26, 29, 36, 61,
- 33, 37, 62, 28, 25, 38, 25, 38,
- 17, 23, 34, 33, 21, 33, 49, 27,
- 32, 23, 27, 22, 24, 22, 39, 43,
- 27, 37, 6, 42, 47, 26, 30, 31,
- 41, 39, 33, 22, 45, 36, 32, 45,
- 19, 22, 30, 5, 5, 17, 29, 22,
- 31, 31, 43, 37, 27, 32, 32, 32,
- 33, 34, 43, 35, 29, 26, 22, 32,
- 19, 32, 25, 31, 41, 49, 28, 34,
- 28, 39, 34, 19, 37, 38, 29, 21,
- 36, 42, 24, 48, 16, 28, 49, 22,
- 34, 31, 38, 39, 44, 11, 35, 30,
- 33, 33, 23, 28, 33, 46, 15, 13,
- 24, 41, 24, 34, 34, 30, 26, 24,
- 14, 60, 21, 29, 39, 23, 35, 37,
- 63, 45, 33, 34, 47, 41, 22, 42,
- 35, 35, 23, 32, 35, 43, 32, 7,
- 31, 41, 20, 31, 16, 13, 63, 25,
- 30, 32, 35, 30, 30, 31, 42, 47,
- 39, 38, 40, 40, 51, 55, 56, 18,
- 21, 39, 39, 33, 17, 41, 23, 24,
- 43, 25, 31, 20, 19, 45, 1, 34,
- 31, 22, 35, 15, 46, 46, 35, 31,
- 28, 29, 29, 23, 41, 27, 14, 53,
- 53, 27, 24, 32, 57, 32, 17, 42,
- 37, 29, 33, 1, 25, 32, 32, 63,
- 26, 40, 44, 36, 31, 39, 20, 20,
- 44, 23, 33, 34, 35, 33, 33, 28,
- 41, 23, 41, 41, 29, 25, 26, 49,
- 29, 24, 37, 49, 50, 51, 51, 26,
- 39, 25, 26, 15, 39, 18, 42, 17,
- 4, 31, 32, 32, 60, 1, 42, 32,
- 0, 12, 19, 35, 21, 41, 17, 26,
- 20, 45, 46, 32, 37, 22, 47, 29,
- 31, 27, 29, 30, 21, 33, 35, 18,
- 25, 33, 50, 51, 42, 2, 15, 51,
- 53, 33, 25, 29, 55, 37, 38, 33,
- 38, 59, 38, 33, 39, 13, 32, 40,
- 61, 61, 32, 9, 44, 3, 31, 29,
- 25, 31, 27, 23, 9, 25, 9, 29,
- 20, 30, 30, 42, 18, 28, 25, 28,
- 28, 21, 29, 43, 29, 43, 26, 44,
- 44, 21, 38, 21, 24, 45, 45, 35,
- 39, 22, 35, 36, 34, 34, 45, 34,
- 29, 31, 46, 25, 46, 16, 17, 31,
- 20, 32, 47, 47, 47, 32, 49, 49,
- 49, 31, 1, 27, 28, 39, 39, 21,
- 36, 23, 51, 2, 40, 51, 32, 53,
- 24, 30, 24, 30, 21, 40, 57, 57,
- 31, 41, 58, 32, 12, 4, 32, 34,
- 59, 31, 32, 13, 9, 35, 26, 35,
- 37, 61, 37, 63, 26, 29, 41, 38,
- 23, 20, 41, 26, 41, 42, 42, 42,
- 26, 26, 26, 26, 1, 26, 37, 37,
- 37, 23, 34, 42, 27, 43, 34, 27,
- 31, 24, 33, 16, 3, 31, 24, 33,
- 24, 4, 44, 44, 11, 44, 31, 13,
- 13, 44, 45, 13, 25, 22, 38, 26,
- 38, 38, 39, 32, 30, 39, 30, 22,
- 32, 26, 30, 47, 47, 47, 19, 47,
- 30, 31, 35, 8, 23, 47, 47, 27,
- 35, 47, 31, 48, 35, 19, 36, 49,
- 49, 33, 31, 39, 27, 39, 49, 49,
- 50, 50, 50, 39, 31, 51, 51, 39,
- 28, 33, 33, 21, 40, 31, 52, 53,
- 40, 53, 9, 33, 31, 53, 54, 54,
- 54, 55, 55, 34, 15, 56, 25, 56,
- 21, 21, 40, 40, 25, 40, 58, 36,
- 5, 41, 41, 12, 60, 41, 41, 37,
- 22, 61, 18, 29, 29, 30, 61, 30,
- 61, 62, 62, 30, 30, 63, 18, 13,
- 30, 23, 19, 20, 20, 41, 13, 2,
- 5, 5, 1, 5, 32, 6, 32, 35,
- 20, 35, 27, 35, 35, 36, 36, 13,
- 36, 41, 41, 41, 3, 30, 42, 27,
- 20, 30, 27, 28, 30, 21, 33, 33,
- 14, 24, 30, 42, 24, 33, 25, 42,
- 43, 14, 43, 43, 14, 43, 7, 36,
- 37, 37, 37, 37, 7, 14, 25, 43,
- 43, 44, 15, 37, 7, 7, 3, 1,
- 8, 15, 15, 8, 44, 44, 44, 45,
- 45, 45, 45, 8, 8, 45, 21, 45,
- 28, 28, 28, 21, 28, 28, 22, 37,
- 46, 46, 37, 8, 29, 37, 29, 22,
- 46, 37, 22, 29, 47, 47, 38, 38,
- 16, 38, 38, 33, 38, 22, 47, 47,
- 29, 25, 16, 0, 48, 1, 34, 48,
- 48, 34, 25, 26, 26, 49, 49, 26,
- 1, 49, 4, 26, 4, 49, 1, 9,
- 49, 49, 49, 10, 49, 17, 38, 17,
- 17, 50, 38, 50, 50, 22, 38, 51,
- 38, 38, 51, 39, 39, 18, 22, 39,
- 51, 22, 52, 52, 52, 39, 53, 53,
- 10, 23, 18, 29, 10, 53, 29, 54,
- 11, 54, 11, 11, 55, 1, 18, 55,
- 55, 55, 55, 55, 55, 29, 34, 18,
- 29, 56, 56, 34, 57, 34, 34, 29,
- 29, 57, 57, 35, 35, 35, 35, 35,
- 39, 35, 59, 59, 18, 59, 39, 30,
- 18, 40, 60, 60, 61, 30, 18, 61,
- 61, 19, 19,
-};
-
-static const uint8_t table0_mvy[1099] = {
- 32, 31, 32, 33, 32, 31, 31, 33,
- 33, 34, 32, 30, 32, 35, 34, 31,
- 32, 29, 33, 30, 32, 34, 33, 31,
- 30, 35, 31, 31, 29, 33, 35, 30,
- 29, 33, 34, 34, 30, 32, 32, 36,
- 29, 32, 35, 32, 28, 32, 32, 27,
- 35, 37, 34, 29, 30, 36, 35, 34,
- 25, 30, 29, 35, 33, 31, 31, 32,
- 31, 28, 39, 28, 29, 37, 31, 33,
- 27, 36, 28, 36, 37, 33, 33, 31,
- 27, 32, 31, 38, 26, 25, 25, 33,
- 39, 31, 34, 30, 32, 32, 32, 34,
- 36, 32, 28, 33, 30, 38, 37, 27,
- 33, 28, 32, 37, 35, 38, 29, 34,
- 27, 29, 29, 32, 32, 34, 35, 3,
- 26, 36, 31, 38, 30, 26, 35, 34,
- 37, 26, 25, 32, 32, 39, 23, 37,
- 32, 32, 29, 32, 29, 36, 29, 30,
- 41, 31, 30, 21, 39, 25, 34, 38,
- 32, 35, 39, 32, 33, 33, 32, 27,
- 29, 25, 28, 27, 26, 31, 30, 35,
- 24, 24, 31, 34, 32, 30, 35, 40,
- 28, 38, 5, 35, 29, 36, 36, 32,
- 38, 30, 33, 31, 35, 26, 23, 38,
- 32, 41, 28, 25, 37, 40, 37, 39,
- 32, 36, 33, 39, 25, 26, 28, 31,
- 28, 42, 23, 31, 33, 31, 39, 1,
- 59, 22, 27, 4, 33, 34, 33, 24,
- 41, 3, 35, 41, 41, 28, 36, 36,
- 28, 33, 35, 21, 23, 21, 22, 37,
- 27, 27, 43, 29, 60, 39, 27, 25,
- 59, 34, 27, 27, 26, 40, 37, 27,
- 61, 26, 39, 33, 31, 22, 37, 25,
- 30, 25, 24, 61, 31, 34, 25, 38,
- 32, 32, 30, 3, 61, 43, 29, 23,
- 28, 32, 28, 32, 31, 34, 5, 33,
- 32, 33, 33, 42, 37, 23, 38, 31,
- 40, 26, 32, 26, 37, 38, 36, 24,
- 29, 30, 20, 22, 29, 24, 32, 41,
- 2, 34, 25, 33, 29, 31, 39, 35,
- 36, 24, 32, 30, 33, 27, 44, 60,
- 30, 36, 19, 34, 31, 24, 16, 35,
- 32, 38, 21, 33, 31, 31, 21, 35,
- 5, 17, 29, 38, 38, 18, 58, 19,
- 43, 41, 30, 41, 43, 39, 29, 7,
- 29, 17, 28, 19, 28, 31, 25, 19,
- 40, 26, 21, 33, 39, 23, 40, 30,
- 39, 34, 35, 32, 32, 24, 33, 30,
- 40, 47, 39, 37, 32, 33, 24, 23,
- 45, 47, 27, 23, 42, 32, 32, 33,
- 36, 37, 37, 17, 18, 22, 40, 38,
- 32, 31, 35, 24, 17, 25, 17, 23,
- 33, 34, 51, 42, 31, 36, 36, 29,
- 21, 22, 37, 44, 43, 25, 47, 33,
- 45, 27, 31, 58, 31, 32, 31, 38,
- 43, 20, 47, 45, 54, 1, 26, 34,
- 38, 14, 22, 24, 33, 34, 32, 32,
- 37, 21, 23, 49, 35, 23, 28, 39,
- 39, 23, 55, 33, 30, 30, 63, 16,
- 42, 28, 13, 33, 33, 35, 19, 46,
- 43, 17, 19, 36, 39, 24, 31, 32,
- 33, 26, 28, 62, 33, 63, 33, 39,
- 19, 49, 17, 31, 43, 13, 15, 29,
- 25, 35, 33, 23, 49, 41, 28, 29,
- 34, 38, 7, 61, 11, 50, 13, 41,
- 19, 47, 25, 26, 15, 42, 41, 29,
- 45, 27, 17, 35, 32, 29, 32, 24,
- 13, 26, 26, 31, 24, 33, 28, 30,
- 31, 11, 45, 46, 33, 33, 35, 57,
- 32, 32, 35, 45, 34, 11, 37, 42,
- 39, 37, 31, 49, 21, 27, 29, 47,
- 53, 40, 51, 16, 26, 1, 40, 30,
- 41, 44, 34, 25, 27, 31, 35, 35,
- 31, 15, 49, 1, 35, 40, 5, 58,
- 21, 29, 22, 59, 45, 31, 9, 26,
- 9, 29, 11, 32, 30, 3, 13, 20,
- 18, 20, 11, 3, 29, 40, 31, 53,
- 30, 17, 20, 37, 31, 42, 47, 47,
- 54, 38, 9, 34, 13, 37, 21, 25,
- 27, 43, 42, 45, 40, 25, 27, 46,
- 22, 25, 53, 20, 2, 14, 39, 15,
- 22, 44, 34, 21, 38, 33, 27, 48,
- 34, 52, 35, 47, 49, 54, 2, 13,
- 23, 52, 29, 45, 22, 49, 54, 21,
- 40, 42, 31, 30, 29, 34, 0, 25,
- 23, 51, 24, 59, 28, 38, 29, 31,
- 2, 13, 31, 8, 31, 33, 12, 45,
- 41, 7, 14, 30, 25, 18, 43, 20,
- 43, 35, 44, 1, 49, 42, 42, 18,
- 41, 38, 41, 44, 53, 11, 20, 25,
- 45, 46, 47, 48, 39, 52, 46, 49,
- 63, 55, 44, 38, 13, 13, 57, 22,
- 51, 16, 12, 28, 35, 57, 25, 20,
- 26, 28, 28, 29, 32, 31, 62, 34,
- 35, 35, 19, 49, 48, 39, 40, 18,
- 43, 46, 11, 6, 48, 19, 49, 41,
- 10, 23, 58, 17, 21, 23, 34, 30,
- 60, 0, 44, 34, 26, 37, 46, 43,
- 49, 59, 4, 34, 59, 37, 22, 25,
- 28, 46, 6, 40, 59, 42, 36, 61,
- 28, 30, 31, 43, 10, 22, 23, 47,
- 20, 52, 55, 36, 25, 16, 1, 11,
- 27, 29, 5, 63, 18, 41, 31, 34,
- 38, 1, 5, 13, 28, 31, 17, 38,
- 39, 41, 36, 37, 22, 39, 33, 43,
- 43, 15, 17, 49, 30, 21, 22, 20,
- 10, 17, 25, 54, 57, 3, 34, 8,
- 36, 25, 31, 14, 15, 19, 29, 25,
- 18, 39, 53, 22, 27, 20, 29, 33,
- 41, 42, 35, 62, 50, 29, 53, 50,
- 35, 55, 42, 61, 63, 4, 7, 42,
- 21, 46, 47, 49, 27, 46, 17, 55,
- 41, 50, 63, 4, 56, 18, 8, 10,
- 18, 51, 63, 36, 55, 18, 5, 55,
- 9, 29, 17, 21, 30, 27, 1, 59,
- 7, 11, 12, 15, 5, 42, 24, 41,
- 43, 7, 27, 22, 25, 31, 30, 37,
- 22, 39, 53, 29, 36, 37, 48, 0,
- 5, 13, 17, 31, 32, 26, 46, 28,
- 44, 45, 46, 53, 49, 51, 3, 41,
- 3, 22, 42, 33, 5, 45, 7, 22,
- 40, 53, 24, 14, 25, 27, 10, 12,
- 34, 16, 17, 53, 20, 26, 39, 45,
- 18, 45, 35, 33, 31, 49, 4, 39,
- 42, 11, 51, 5, 13, 26, 27, 17,
- 52, 30, 0, 22, 12, 34, 62, 36,
- 38, 41, 47, 30, 63, 38, 41, 43,
- 59, 33, 45, 37, 38, 40, 47, 24,
- 48, 49, 30, 1, 10, 22, 49, 15,
- 39, 59, 31, 32, 33, 18, 13, 15,
- 31, 21, 27, 44, 42, 39, 46, 17,
- 26, 32, 30, 31, 0, 30, 34, 9,
- 12, 13, 25, 31, 32, 55, 43, 35,
- 61, 33, 35, 46, 25, 47, 48, 62,
- 63, 38, 61, 1, 2, 5, 7, 9,
- 46, 10, 34, 35, 36, 55, 51, 7,
- 40, 23, 34, 37, 5, 13, 42, 18,
- 25, 27, 28,
-};
-
-/* motion vector table 1 */
-static const uint16_t table1_mv_code[1100] = {
- 0x0000, 0x0007, 0x0009, 0x000f, 0x000a, 0x0011, 0x001a, 0x001c,
- 0x0011, 0x0031, 0x0025, 0x002d, 0x002f, 0x006f, 0x0075, 0x0041,
- 0x004c, 0x004e, 0x005c, 0x0060, 0x0062, 0x0066, 0x0068, 0x0069,
- 0x006b, 0x00a6, 0x00c1, 0x00cb, 0x00cc, 0x00ce, 0x00da, 0x00e8,
- 0x00ee, 0x0087, 0x0090, 0x009e, 0x009f, 0x00ba, 0x00ca, 0x00d8,
- 0x00db, 0x00df, 0x0104, 0x0109, 0x010c, 0x0143, 0x0145, 0x014a,
- 0x0156, 0x015c, 0x01b3, 0x01d3, 0x01da, 0x0103, 0x0109, 0x010b,
- 0x0122, 0x0127, 0x0134, 0x0161, 0x0164, 0x0176, 0x0184, 0x018d,
- 0x018e, 0x018f, 0x0190, 0x0193, 0x0196, 0x019d, 0x019e, 0x019f,
- 0x01a9, 0x01b2, 0x01b4, 0x01ba, 0x01bb, 0x01bc, 0x0201, 0x0202,
- 0x0205, 0x0207, 0x020d, 0x0210, 0x0211, 0x0215, 0x021b, 0x021f,
- 0x0281, 0x0285, 0x0290, 0x029c, 0x029d, 0x02a2, 0x02a7, 0x02a8,
- 0x02aa, 0x02b0, 0x02b1, 0x02b4, 0x02bc, 0x02bf, 0x0320, 0x0326,
- 0x0327, 0x0329, 0x032a, 0x0336, 0x0360, 0x0362, 0x0363, 0x0372,
- 0x03b2, 0x03bc, 0x03bd, 0x0203, 0x0205, 0x021a, 0x0249, 0x024a,
- 0x024c, 0x02c7, 0x02ca, 0x02ce, 0x02ef, 0x030d, 0x0322, 0x0325,
- 0x0338, 0x0373, 0x037a, 0x0409, 0x0415, 0x0416, 0x0418, 0x0428,
- 0x042d, 0x042f, 0x0434, 0x0508, 0x0509, 0x0510, 0x0511, 0x051c,
- 0x051e, 0x0524, 0x0541, 0x0543, 0x0546, 0x0547, 0x054d, 0x0557,
- 0x055f, 0x056a, 0x056c, 0x056d, 0x056f, 0x0576, 0x0577, 0x057a,
- 0x057b, 0x057c, 0x057d, 0x0600, 0x0601, 0x0603, 0x0614, 0x0616,
- 0x0617, 0x061c, 0x061f, 0x0642, 0x0648, 0x0649, 0x064a, 0x064b,
- 0x0657, 0x0668, 0x0669, 0x066b, 0x066e, 0x067f, 0x06c2, 0x06c8,
- 0x06cb, 0x06de, 0x06df, 0x06e2, 0x06e3, 0x06ef, 0x0748, 0x074b,
- 0x076e, 0x076f, 0x077c, 0x0409, 0x0423, 0x0428, 0x0429, 0x042a,
- 0x042b, 0x0432, 0x0433, 0x0496, 0x049a, 0x04d5, 0x04db, 0x0581,
- 0x0582, 0x058b, 0x058c, 0x058d, 0x0598, 0x0599, 0x059a, 0x059e,
- 0x05dd, 0x0619, 0x0632, 0x0633, 0x0648, 0x0672, 0x06a1, 0x06a2,
- 0x06a3, 0x06af, 0x06e2, 0x06e3, 0x06e4, 0x0800, 0x0801, 0x0802,
- 0x0803, 0x081a, 0x081b, 0x0829, 0x082f, 0x0832, 0x083e, 0x083f,
- 0x0852, 0x0853, 0x0858, 0x086b, 0x0877, 0x0878, 0x0879, 0x087a,
- 0x087b, 0x0a00, 0x0a01, 0x0a0d, 0x0a0e, 0x0a0f, 0x0a24, 0x0a37,
- 0x0a3a, 0x0a3b, 0x0a3e, 0x0a46, 0x0a47, 0x0a4a, 0x0a4b, 0x0a5f,
- 0x0a79, 0x0a7a, 0x0a7b, 0x0a80, 0x0a81, 0x0a84, 0x0a85, 0x0a99,
- 0x0aa5, 0x0aa6, 0x0ab8, 0x0aba, 0x0abb, 0x0abc, 0x0abd, 0x0ac8,
- 0x0ace, 0x0acf, 0x0ad7, 0x0adc, 0x0aeb, 0x0c04, 0x0c25, 0x0c26,
- 0x0c27, 0x0c2a, 0x0c2b, 0x0c3a, 0x0c3b, 0x0c3c, 0x0c3d, 0x0ca0,
- 0x0cad, 0x0cd4, 0x0cd5, 0x0cfc, 0x0cfd, 0x0d86, 0x0d92, 0x0d93,
- 0x0d94, 0x0d95, 0x0db0, 0x0db8, 0x0db9, 0x0dba, 0x0dbb, 0x0dc0,
- 0x0dc2, 0x0dc3, 0x0dda, 0x0ddb, 0x0ddc, 0x0ddd, 0x0e92, 0x0e93,
- 0x0e94, 0x0e95, 0x0ec7, 0x0ecc, 0x0ece, 0x0ecf, 0x0ed8, 0x0ed9,
- 0x0eda, 0x0edb, 0x0808, 0x0809, 0x080a, 0x0810, 0x0811, 0x0844,
- 0x0845, 0x0861, 0x0862, 0x0863, 0x086c, 0x0922, 0x0923, 0x092e,
- 0x092f, 0x0936, 0x0937, 0x09b1, 0x09b2, 0x09b3, 0x09b4, 0x09b5,
- 0x09b8, 0x09b9, 0x09ba, 0x09bb, 0x09bc, 0x09bd, 0x09be, 0x09bf,
- 0x0b00, 0x0b15, 0x0b2c, 0x0b2d, 0x0b2e, 0x0b2f, 0x0b36, 0x0bb9,
- 0x0c28, 0x0c2a, 0x0c2b, 0x0c2c, 0x0c2d, 0x0c2e, 0x0c2f, 0x0c30,
- 0x0c31, 0x0c38, 0x0c60, 0x0c61, 0x0c62, 0x0c63, 0x0c8d, 0x0c8e,
- 0x0c8f, 0x0c92, 0x0cbe, 0x0cbf, 0x0ce6, 0x0ce7, 0x0d40, 0x0d41,
- 0x0d57, 0x0d58, 0x0d59, 0x0d5a, 0x0d5b, 0x0d5c, 0x0d5d, 0x0d98,
- 0x0d99, 0x0d9a, 0x0d9b, 0x0d9c, 0x0d9d, 0x0dad, 0x0dae, 0x0daf,
- 0x0dc0, 0x0dc1, 0x0dc2, 0x0dc3, 0x0dca, 0x0dcb, 0x0dec, 0x0ded,
- 0x0dee, 0x0def, 0x1018, 0x1022, 0x1023, 0x1030, 0x1031, 0x1032,
- 0x1033, 0x1050, 0x1051, 0x105c, 0x1074, 0x1075, 0x1076, 0x1077,
- 0x1078, 0x1079, 0x107a, 0x107b, 0x10b2, 0x10b3, 0x10b8, 0x10b9,
- 0x10ba, 0x10bb, 0x10d4, 0x10ea, 0x10eb, 0x10ec, 0x10ed, 0x1404,
- 0x1405, 0x1406, 0x1407, 0x1410, 0x1411, 0x1412, 0x1413, 0x1414,
- 0x1415, 0x1416, 0x1417, 0x1418, 0x1419, 0x1466, 0x1467, 0x1468,
- 0x1469, 0x146a, 0x146b, 0x146c, 0x146d, 0x147e, 0x147f, 0x1488,
- 0x1489, 0x148a, 0x148b, 0x14b6, 0x14b7, 0x14b8, 0x14b9, 0x14ba,
- 0x14bb, 0x14bc, 0x14bd, 0x14f0, 0x14f1, 0x14f8, 0x14f9, 0x14fa,
- 0x14fb, 0x14fc, 0x14fd, 0x14fe, 0x14ff, 0x152a, 0x152b, 0x152c,
- 0x152d, 0x152e, 0x152f, 0x1530, 0x1531, 0x1548, 0x1549, 0x154e,
- 0x154f, 0x1558, 0x1559, 0x155a, 0x155b, 0x1572, 0x159a, 0x159b,
- 0x15ac, 0x15ba, 0x15bb, 0x15d0, 0x15d1, 0x15d2, 0x15d3, 0x15d4,
- 0x15d5, 0x181d, 0x181e, 0x181f, 0x1840, 0x1841, 0x1842, 0x1843,
- 0x1844, 0x1845, 0x1846, 0x1847, 0x1848, 0x1849, 0x1861, 0x1862,
- 0x1863, 0x1864, 0x1865, 0x1866, 0x1867, 0x1868, 0x1869, 0x186a,
- 0x186b, 0x186c, 0x186d, 0x186e, 0x191b, 0x191c, 0x191d, 0x191e,
- 0x191f, 0x1942, 0x1943, 0x1944, 0x1945, 0x1946, 0x1947, 0x1958,
- 0x1959, 0x19ed, 0x19ee, 0x19ef, 0x19f0, 0x19f1, 0x19f2, 0x19f3,
- 0x19f4, 0x19f5, 0x19f6, 0x19f7, 0x1b0e, 0x1b0f, 0x1b62, 0x1b63,
- 0x1b64, 0x1b65, 0x1b66, 0x1b67, 0x1b68, 0x1b69, 0x1b6a, 0x1b6b,
- 0x1b6c, 0x1b6d, 0x1b6e, 0x1b6f, 0x1b82, 0x1ba8, 0x1ba9, 0x1baa,
- 0x1bab, 0x1bac, 0x1bad, 0x1bae, 0x1baf, 0x1bb0, 0x1bb1, 0x1bb2,
- 0x1bb3, 0x1d80, 0x1d81, 0x1d82, 0x1d83, 0x1d84, 0x1d85, 0x1d86,
- 0x1d87, 0x1d88, 0x1d89, 0x1d8a, 0x1d8b, 0x1d8c, 0x1d8d, 0x1007,
- 0x1008, 0x1009, 0x100a, 0x100b, 0x100c, 0x100d, 0x100e, 0x100f,
- 0x1016, 0x1080, 0x1081, 0x1082, 0x1083, 0x1084, 0x1085, 0x1086,
- 0x1087, 0x10c0, 0x123a, 0x123b, 0x123c, 0x123d, 0x123e, 0x123f,
- 0x1240, 0x1241, 0x1242, 0x1243, 0x1350, 0x1352, 0x1353, 0x1358,
- 0x1359, 0x135a, 0x135b, 0x135c, 0x135d, 0x135e, 0x135f, 0x1360,
- 0x1361, 0x1602, 0x1603, 0x160c, 0x160d, 0x160e, 0x160f, 0x1620,
- 0x1621, 0x1622, 0x1623, 0x1624, 0x1625, 0x1626, 0x1627, 0x1628,
- 0x1629, 0x166e, 0x166f, 0x167c, 0x167d, 0x167e, 0x167f, 0x1770,
- 0x1771, 0x1852, 0x1853, 0x1872, 0x1873, 0x1874, 0x1875, 0x1876,
- 0x1877, 0x1878, 0x1879, 0x187a, 0x187b, 0x187c, 0x187d, 0x187e,
- 0x187f, 0x1918, 0x1919, 0x1926, 0x1927, 0x1970, 0x1971, 0x1972,
- 0x1973, 0x1974, 0x1975, 0x1976, 0x1977, 0x1978, 0x1979, 0x197a,
- 0x197b, 0x1aa0, 0x1aa1, 0x1aa2, 0x1aa3, 0x1aa4, 0x1aa5, 0x1aa6,
- 0x1aa7, 0x1aa8, 0x1aa9, 0x1aaa, 0x1aab, 0x1aac, 0x1aad, 0x1b3c,
- 0x1b3d, 0x1b3e, 0x1b3f, 0x1b50, 0x1b51, 0x1b52, 0x1b53, 0x1b54,
- 0x1b55, 0x1b56, 0x1b57, 0x1b58, 0x1b59, 0x2032, 0x2033, 0x2034,
- 0x2035, 0x2036, 0x2037, 0x2038, 0x2039, 0x203a, 0x203b, 0x203c,
- 0x203d, 0x203e, 0x203f, 0x2040, 0x2041, 0x2042, 0x2043, 0x20ba,
- 0x20bb, 0x20cc, 0x20cd, 0x20ce, 0x20cf, 0x20e0, 0x20e1, 0x20e2,
- 0x20e3, 0x20e4, 0x20e5, 0x20e6, 0x20e7, 0x21aa, 0x21ab, 0x21c0,
- 0x21c1, 0x21c2, 0x21c3, 0x21c4, 0x21c5, 0x21c6, 0x21c7, 0x21c8,
- 0x21c9, 0x21ca, 0x21cb, 0x21cc, 0x21cd, 0x21ce, 0x21cf, 0x21d0,
- 0x21d1, 0x21d2, 0x21d3, 0x2894, 0x2895, 0x2896, 0x2897, 0x2898,
- 0x2899, 0x289a, 0x289b, 0x289c, 0x289d, 0x289e, 0x289f, 0x28c0,
- 0x28c1, 0x28c2, 0x28c3, 0x28c4, 0x28c5, 0x28c6, 0x28c7, 0x28c8,
- 0x28c9, 0x28ca, 0x28cb, 0x2930, 0x2931, 0x2932, 0x2933, 0x2934,
- 0x2935, 0x2936, 0x2937, 0x2938, 0x2939, 0x293a, 0x293b, 0x293c,
- 0x293d, 0x293e, 0x293f, 0x2960, 0x2961, 0x2962, 0x2963, 0x2964,
- 0x2965, 0x2966, 0x2967, 0x2968, 0x2969, 0x296a, 0x296b, 0x2a40,
- 0x2a41, 0x2a42, 0x2a43, 0x2a44, 0x2a45, 0x2a46, 0x2a47, 0x2a48,
- 0x2a49, 0x2a4a, 0x2a4b, 0x2a4c, 0x2a4d, 0x2a4e, 0x2a4f, 0x2a50,
- 0x2a51, 0x2a52, 0x2a53, 0x2ae6, 0x2ae7, 0x2b24, 0x2b25, 0x2b26,
- 0x2b27, 0x2b28, 0x2b29, 0x2b2a, 0x2b2b, 0x2b2c, 0x2b2d, 0x2b2e,
- 0x2b2f, 0x2b30, 0x2b31, 0x2b32, 0x2b33, 0x2b5a, 0x2b5b, 0x3014,
- 0x3015, 0x3016, 0x3017, 0x3020, 0x3021, 0x3022, 0x3023, 0x3024,
- 0x3025, 0x3026, 0x3027, 0x3028, 0x3029, 0x302a, 0x302b, 0x302c,
- 0x302d, 0x302e, 0x302f, 0x3030, 0x3031, 0x3032, 0x3033, 0x3034,
- 0x3035, 0x3036, 0x3037, 0x3038, 0x3039, 0x30c0, 0x30c1, 0x30de,
- 0x30df, 0x3218, 0x3219, 0x321a, 0x321b, 0x321c, 0x321d, 0x321e,
- 0x321f, 0x3220, 0x3221, 0x3222, 0x3223, 0x3224, 0x3225, 0x3226,
- 0x3227, 0x3228, 0x3229, 0x322a, 0x322b, 0x322c, 0x322d, 0x322e,
- 0x322f, 0x3230, 0x3231, 0x3232, 0x3233, 0x3234, 0x3235, 0x3378,
- 0x3379, 0x337a, 0x337b, 0x337c, 0x337d, 0x337e, 0x337f, 0x33c0,
- 0x33c1, 0x33c2, 0x33c3, 0x33c4, 0x33c5, 0x33c6, 0x33c7, 0x33c8,
- 0x33c9, 0x33ca, 0x33cb, 0x33cc, 0x33cd, 0x33ce, 0x33cf, 0x33d0,
- 0x33d1, 0x33d2, 0x33d3, 0x33d4, 0x33d5, 0x33d6, 0x33d7, 0x33d8,
- 0x33d9, 0x3706, 0x3707, 0x3730, 0x3731, 0x3732, 0x3733, 0x3734,
- 0x3735, 0x3736, 0x3737, 0x3738, 0x3739, 0x373a, 0x373b, 0x373c,
- 0x373d, 0x373e, 0x373f, 0x3740, 0x3741, 0x3742, 0x3743, 0x3744,
- 0x3745, 0x3746, 0x3747, 0x3748, 0x3749, 0x374a, 0x374b, 0x374c,
- 0x374d, 0x374e, 0x374f, 0x3b34, 0x3b35, 0x3b36, 0x3b37, 0x3be8,
- 0x3be9, 0x3bea, 0x3beb, 0x3bec, 0x3bed, 0x3bee, 0x3bef, 0x3bf0,
- 0x3bf1, 0x3bf2, 0x3bf3, 0x3bf4, 0x3bf5, 0x3bf6, 0x3bf7, 0x3bf8,
- 0x3bf9, 0x3bfa, 0x3bfb, 0x3bfc, 0x3bfd, 0x3bfe, 0x3bff, 0x2000,
- 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008,
- 0x2009, 0x200a, 0x200b, 0x200c, 0x200d, 0x202e, 0x202f, 0x2182,
- 0x2183, 0x21b4, 0x21b5, 0x21b6, 0x21b7, 0x21b8, 0x21b9, 0x21ba,
- 0x21bb, 0x21bc, 0x21bd, 0x21be, 0x21bf, 0x2460, 0x2461, 0x2462,
- 0x2463, 0x2464, 0x2465, 0x2466, 0x2467, 0x2468, 0x2469, 0x246a,
- 0x246b, 0x246c, 0x246d, 0x246e, 0x246f, 0x2470, 0x2471, 0x2472,
- 0x2473, 0x26a2, 0x26a3, 0x000b,
-};
-
-static const uint8_t table1_mv_bits[1100] = {
- 2, 4, 4, 4, 5, 5, 5, 5,
- 6, 6, 7, 7, 7, 7, 7, 8,
- 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 4,
-};
-
-static const uint8_t table1_mvx[1099] = {
- 32, 31, 32, 31, 33, 32, 33, 33,
- 31, 34, 30, 32, 32, 34, 35, 32,
- 34, 33, 29, 30, 30, 32, 31, 31,
- 33, 35, 35, 33, 31, 29, 29, 33,
- 34, 30, 31, 28, 36, 30, 34, 32,
- 32, 37, 32, 32, 25, 27, 39, 32,
- 32, 32, 38, 35, 36, 32, 37, 61,
- 26, 32, 34, 35, 3, 35, 27, 28,
- 29, 34, 28, 37, 31, 36, 32, 27,
- 31, 30, 29, 39, 33, 29, 33, 35,
- 25, 25, 29, 33, 31, 31, 31, 33,
- 32, 30, 32, 32, 41, 39, 33, 36,
- 32, 28, 34, 36, 38, 24, 60, 31,
- 23, 28, 32, 33, 59, 32, 40, 30,
- 5, 34, 32, 38, 32, 30, 43, 4,
- 32, 32, 42, 31, 31, 32, 26, 38,
- 26, 22, 21, 37, 61, 63, 37, 31,
- 32, 33, 2, 1, 23, 33, 41, 27,
- 35, 30, 38, 23, 33, 3, 28, 34,
- 34, 27, 41, 29, 39, 35, 36, 29,
- 32, 27, 30, 32, 24, 61, 37, 26,
- 59, 25, 35, 27, 36, 37, 30, 31,
- 34, 40, 3, 28, 34, 39, 32, 31,
- 32, 30, 24, 28, 35, 36, 26, 32,
- 31, 33, 29, 33, 39, 25, 30, 24,
- 35, 59, 29, 34, 25, 30, 21, 35,
- 43, 40, 32, 29, 5, 28, 31, 62,
- 33, 33, 25, 31, 21, 31, 43, 31,
- 34, 33, 20, 40, 39, 31, 31, 57,
- 38, 32, 42, 33, 32, 31, 32, 29,
- 30, 44, 5, 31, 22, 34, 36, 17,
- 38, 58, 38, 35, 32, 60, 35, 24,
- 32, 38, 16, 45, 42, 32, 31, 29,
- 4, 30, 17, 40, 46, 48, 63, 32,
- 42, 19, 41, 22, 28, 36, 45, 33,
- 33, 32, 29, 7, 41, 42, 18, 33,
- 33, 32, 22, 37, 1, 26, 22, 23,
- 49, 28, 26, 27, 32, 33, 27, 23,
- 28, 36, 15, 6, 34, 27, 31, 26,
- 23, 2, 33, 32, 34, 41, 28, 32,
- 41, 0, 36, 38, 34, 31, 47, 32,
- 17, 31, 39, 33, 37, 51, 30, 47,
- 32, 50, 32, 19, 63, 30, 25, 27,
- 33, 62, 24, 31, 27, 30, 37, 31,
- 45, 32, 39, 20, 46, 47, 35, 19,
- 34, 1, 49, 21, 21, 14, 51, 26,
- 23, 31, 36, 35, 58, 29, 29, 21,
- 20, 42, 13, 28, 12, 40, 31, 33,
- 39, 60, 32, 44, 33, 31, 28, 37,
- 29, 32, 30, 49, 43, 28, 39, 25,
- 32, 48, 2, 15, 20, 25, 31, 28,
- 21, 24, 25, 15, 31, 17, 37, 43,
- 18, 32, 33, 24, 33, 36, 13, 33,
- 31, 39, 11, 31, 33, 32, 39, 37,
- 32, 32, 29, 17, 44, 46, 36, 35,
- 26, 37, 58, 32, 34, 38, 8, 38,
- 38, 22, 29, 25, 16, 35, 32, 35,
- 33, 43, 18, 46, 38, 50, 33, 18,
- 53, 60, 13, 32, 36, 33, 51, 36,
- 43, 45, 27, 42, 29, 24, 30, 25,
- 31, 52, 31, 35, 38, 9, 22, 34,
- 4, 17, 28, 55, 42, 25, 17, 20,
- 47, 34, 33, 16, 40, 25, 16, 30,
- 53, 29, 10, 11, 14, 26, 33, 4,
- 35, 44, 26, 16, 31, 26, 34, 38,
- 29, 31, 30, 24, 22, 61, 32, 9,
- 45, 34, 31, 19, 9, 31, 46, 31,
- 35, 54, 29, 57, 30, 50, 3, 31,
- 63, 34, 47, 41, 51, 18, 31, 14,
- 37, 38, 31, 24, 32, 31, 50, 33,
- 31, 54, 27, 9, 33, 23, 19, 32,
- 29, 29, 33, 28, 47, 49, 30, 47,
- 33, 27, 25, 54, 44, 45, 50, 58,
- 51, 48, 33, 59, 33, 34, 57, 13,
- 26, 33, 13, 48, 30, 11, 7, 56,
- 34, 55, 26, 0, 26, 35, 1, 51,
- 33, 53, 31, 45, 12, 29, 29, 51,
- 31, 48, 2, 6, 34, 30, 28, 33,
- 60, 40, 27, 46, 31, 9, 35, 29,
- 31, 39, 55, 46, 19, 37, 62, 34,
- 30, 16, 19, 49, 41, 41, 39, 37,
- 14, 5, 13, 35, 55, 30, 40, 40,
- 42, 8, 20, 25, 45, 35, 33, 36,
- 54, 38, 27, 37, 62, 40, 15, 59,
- 49, 31, 29, 34, 34, 39, 24, 29,
- 25, 29, 21, 29, 10, 61, 33, 49,
- 35, 34, 3, 38, 39, 29, 7, 41,
- 1, 35, 4, 23, 15, 23, 11, 37,
- 28, 35, 30, 30, 24, 1, 43, 56,
- 8, 34, 42, 24, 45, 30, 20, 23,
- 8, 38, 22, 33, 17, 52, 34, 22,
- 53, 43, 44, 1, 27, 31, 41, 43,
- 41, 30, 31, 36, 30, 5, 55, 31,
- 33, 30, 40, 23, 15, 29, 34, 34,
- 59, 34, 30, 11, 13, 38, 5, 0,
- 30, 42, 5, 30, 29, 34, 10, 44,
- 30, 63, 35, 12, 3, 26, 15, 17,
- 25, 34, 43, 39, 34, 56, 29, 23,
- 30, 12, 30, 10, 35, 9, 24, 58,
- 10, 12, 54, 33, 37, 20, 41, 35,
- 29, 18, 61, 30, 40, 24, 39, 53,
- 62, 26, 29, 33, 34, 53, 49, 21,
- 27, 11, 63, 20, 26, 23, 7, 13,
- 6, 47, 29, 30, 9, 51, 22, 34,
- 21, 25, 33, 56, 57, 30, 38, 51,
- 51, 38, 63, 28, 40, 35, 33, 18,
- 33, 33, 24, 58, 58, 34, 49, 29,
- 43, 4, 1, 4, 42, 35, 35, 30,
- 17, 5, 56, 61, 25, 37, 36, 55,
- 28, 35, 29, 50, 48, 52, 2, 42,
- 34, 40, 46, 46, 43, 35, 29, 48,
- 20, 29, 31, 41, 7, 30, 35, 19,
- 14, 21, 8, 39, 39, 40, 46, 55,
- 34, 6, 30, 34, 37, 25, 37, 33,
- 22, 44, 52, 17, 35, 29, 36, 35,
- 40, 37, 28, 30, 50, 14, 28, 55,
- 6, 23, 19, 14, 30, 3, 30, 28,
- 28, 61, 61, 47, 45, 48, 40, 40,
- 34, 34, 25, 30, 29, 35, 4, 26,
- 53, 50, 26, 41, 27, 59, 27, 38,
- 39, 3, 50, 43, 47, 23, 33, 55,
- 35, 21, 23, 35, 61, 33, 46, 52,
- 35, 34, 24, 30, 43, 16, 37, 21,
- 2, 24, 45, 34, 30, 55, 55, 1,
- 29, 29, 26, 28, 25, 31, 36, 22,
- 17, 30, 52, 2, 44, 44, 57, 26,
- 62, 41, 39, 57, 26, 46, 49, 11,
- 16, 19, 5, 59, 38, 39, 58, 38,
- 25, 49, 50, 22, 28, 59, 9, 59,
- 7, 28, 55, 17, 4, 35, 50, 21,
- 29, 44, 47, 18, 24, 19, 25, 42,
- 35, 3, 51, 35, 16, 35, 30, 63,
- 57, 39, 39, 25, 35, 38, 9, 16,
- 36, 45, 31, 60, 14, 34, 42, 24,
- 0, 37, 18, 61, 57, 37, 28, 53,
- 20, 46, 14, 47, 38, 38, 38, 9,
- 34, 39, 43, 17, 39, 59, 5, 27,
- 0, 12, 27,
-};
-
-static const uint8_t table1_mvy[1099] = {
- 32, 32, 31, 31, 32, 33, 31, 33,
- 33, 32, 32, 30, 34, 31, 32, 29,
- 33, 30, 32, 33, 31, 35, 34, 30,
- 34, 31, 33, 29, 29, 31, 33, 35,
- 30, 30, 35, 32, 32, 34, 34, 28,
- 25, 32, 36, 27, 32, 32, 32, 37,
- 39, 3, 32, 30, 31, 26, 31, 32,
- 32, 38, 29, 29, 32, 34, 31, 31,
- 34, 35, 33, 33, 28, 33, 1, 33,
- 27, 29, 30, 31, 28, 29, 37, 35,
- 31, 33, 35, 27, 36, 37, 25, 25,
- 61, 35, 4, 5, 32, 33, 36, 30,
- 23, 30, 28, 34, 31, 32, 32, 39,
- 32, 34, 21, 39, 32, 59, 32, 28,
- 32, 36, 60, 33, 24, 36, 32, 32,
- 41, 2, 32, 38, 26, 22, 33, 30,
- 31, 32, 32, 30, 31, 32, 29, 3,
- 40, 38, 32, 32, 33, 26, 31, 34,
- 28, 38, 34, 31, 3, 31, 35, 38,
- 27, 35, 33, 28, 29, 27, 29, 27,
- 43, 29, 37, 63, 31, 33, 34, 30,
- 31, 30, 37, 30, 35, 35, 26, 41,
- 37, 31, 33, 28, 26, 30, 42, 24,
- 7, 27, 33, 29, 36, 28, 34, 57,
- 23, 41, 36, 23, 35, 34, 25, 30,
- 25, 33, 25, 25, 29, 24, 33, 39,
- 33, 33, 0, 37, 31, 36, 21, 32,
- 61, 24, 35, 61, 31, 5, 31, 59,
- 39, 21, 32, 30, 34, 22, 40, 32,
- 29, 16, 31, 5, 62, 2, 20, 39,
- 39, 32, 33, 1, 31, 24, 36, 32,
- 36, 32, 28, 26, 6, 31, 38, 34,
- 58, 35, 32, 33, 33, 17, 43, 26,
- 31, 40, 31, 34, 32, 32, 31, 19,
- 30, 32, 29, 33, 38, 38, 32, 59,
- 40, 18, 38, 32, 35, 34, 32, 17,
- 1, 15, 30, 28, 31, 28, 34, 29,
- 32, 27, 35, 27, 49, 22, 37, 34,
- 37, 26, 32, 32, 22, 28, 45, 29,
- 30, 31, 43, 46, 41, 30, 26, 13,
- 34, 32, 27, 38, 42, 42, 33, 47,
- 33, 60, 27, 42, 25, 32, 22, 32,
- 48, 32, 45, 33, 33, 41, 27, 25,
- 19, 31, 35, 19, 36, 42, 27, 17,
- 31, 44, 28, 33, 33, 31, 23, 31,
- 40, 33, 31, 34, 30, 32, 33, 36,
- 35, 47, 37, 41, 31, 23, 41, 29,
- 30, 35, 32, 25, 32, 28, 58, 2,
- 37, 33, 14, 33, 49, 20, 39, 36,
- 21, 9, 23, 33, 35, 24, 39, 37,
- 11, 33, 30, 31, 31, 28, 51, 40,
- 35, 29, 25, 33, 46, 35, 37, 30,
- 30, 8, 63, 28, 15, 40, 33, 45,
- 49, 25, 32, 4, 47, 51, 36, 39,
- 53, 10, 24, 29, 30, 31, 25, 40,
- 38, 38, 33, 56, 23, 27, 32, 37,
- 26, 29, 43, 36, 33, 24, 55, 43,
- 9, 29, 34, 34, 24, 33, 18, 33,
- 33, 30, 31, 50, 24, 60, 30, 39,
- 34, 30, 39, 28, 22, 38, 2, 26,
- 63, 32, 57, 21, 39, 33, 28, 18,
- 30, 34, 22, 33, 29, 41, 30, 34,
- 35, 21, 13, 34, 35, 39, 30, 46,
- 32, 42, 32, 31, 33, 26, 11, 33,
- 22, 31, 25, 31, 53, 27, 43, 25,
- 40, 50, 21, 36, 38, 30, 12, 31,
- 34, 20, 15, 29, 32, 62, 30, 13,
- 17, 32, 19, 31, 20, 31, 30, 7,
- 1, 17, 34, 37, 31, 31, 44, 34,
- 26, 40, 16, 37, 52, 48, 30, 20,
- 18, 33, 38, 29, 7, 25, 30, 54,
- 45, 47, 46, 41, 29, 29, 16, 30,
- 14, 26, 38, 34, 34, 29, 34, 30,
- 29, 30, 57, 30, 4, 46, 33, 29,
- 39, 44, 30, 31, 50, 33, 31, 32,
- 19, 32, 40, 31, 37, 47, 1, 35,
- 16, 31, 0, 35, 33, 1, 17, 34,
- 9, 34, 33, 31, 49, 43, 42, 51,
- 34, 29, 23, 29, 14, 30, 45, 49,
- 11, 24, 31, 28, 35, 41, 30, 44,
- 18, 29, 34, 35, 36, 25, 26, 21,
- 31, 30, 34, 19, 34, 44, 36, 38,
- 25, 31, 28, 23, 37, 3, 55, 41,
- 30, 22, 41, 24, 33, 26, 35, 35,
- 30, 55, 51, 47, 48, 38, 24, 15,
- 21, 50, 25, 46, 30, 29, 10, 34,
- 42, 45, 29, 42, 22, 3, 33, 27,
- 34, 1, 34, 28, 34, 36, 35, 23,
- 23, 13, 58, 3, 26, 63, 25, 31,
- 34, 61, 38, 39, 25, 61, 29, 37,
- 30, 41, 26, 48, 28, 33, 50, 35,
- 30, 37, 29, 29, 40, 6, 39, 28,
- 28, 19, 8, 22, 45, 34, 35, 10,
- 58, 17, 37, 39, 30, 18, 54, 14,
- 29, 16, 59, 30, 35, 23, 35, 30,
- 47, 36, 29, 55, 20, 12, 31, 35,
- 14, 29, 18, 34, 34, 24, 29, 26,
- 22, 2, 27, 23, 8, 30, 55, 38,
- 60, 31, 4, 34, 49, 34, 27, 34,
- 33, 30, 31, 54, 42, 35, 38, 46,
- 44, 26, 27, 9, 39, 25, 21, 29,
- 28, 42, 13, 0, 5, 34, 37, 28,
- 24, 29, 63, 26, 22, 27, 29, 25,
- 33, 25, 61, 0, 35, 25, 36, 15,
- 27, 40, 53, 33, 3, 10, 16, 37,
- 38, 18, 30, 46, 27, 9, 6, 29,
- 62, 8, 42, 28, 29, 3, 25, 16,
- 26, 29, 35, 28, 27, 51, 61, 48,
- 37, 9, 34, 7, 49, 45, 20, 29,
- 21, 5, 5, 29, 28, 34, 29, 24,
- 10, 24, 35, 36, 38, 55, 11, 36,
- 38, 53, 54, 26, 30, 49, 20, 27,
- 30, 39, 33, 41, 49, 22, 38, 38,
- 4, 30, 8, 9, 3, 24, 22, 50,
- 37, 36, 31, 27, 2, 9, 42, 63,
- 25, 19, 44, 1, 28, 28, 48, 30,
- 34, 41, 41, 38, 12, 27, 15, 0,
- 16, 34, 35, 38, 28, 29, 40, 42,
- 51, 52, 45, 54, 59, 59, 42, 44,
- 37, 26, 46, 24, 15, 39, 22, 46,
- 19, 35, 38, 17, 37, 23, 52, 55,
- 50, 37, 26, 11, 37, 12, 24, 30,
- 16, 13, 22, 13, 36, 35, 40, 41,
- 34, 41, 26, 53, 51, 5, 21, 30,
- 2, 63, 41, 20, 1, 56, 21, 24,
- 25, 5, 28, 35, 26, 28, 30, 18,
- 29, 23, 40, 34, 20, 42, 39, 34,
- 28, 61, 38, 27, 62, 9, 36, 17,
- 9, 49, 24, 25, 54, 34, 39, 37,
- 3, 1, 25, 38, 38, 44, 35, 36,
- 12, 60, 36, 38, 40, 25, 43, 39,
- 53, 28, 39, 57, 46, 10, 52, 27,
- 35, 42, 45, 59, 15, 60, 38, 24,
- 23, 39, 12, 29, 24, 0, 20, 16,
- 28, 43, 35, 28, 1, 49, 4, 21,
- 42, 39, 29, 3, 44, 21, 53, 55,
- 11, 5, 3, 39, 53, 28, 25, 19,
- 34, 28, 21,
-};
-
-/* motion vector table */
-typedef struct MVTable {
- int n;
- const uint16_t *table_mv_code;
- const uint8_t *table_mv_bits;
- const uint8_t *table_mvx;
- const uint8_t *table_mvy;
- uint16_t *table_mv_index; /* encoding: convert mv to index in table_mv */
- VLC vlc; /* decoding: vlc */
-} MVTable;
-
-static MVTable mv_tables[2] = {
- {
- 1099,
- table0_mv_code,
- table0_mv_bits,
- table0_mvx,
- table0_mvy,
- },
- {
- 1099,
- table1_mv_code,
- table1_mv_bits,
- table1_mvx,
- table1_mvy,
- }
-};
-
-static const uint8_t v2_mb_type[8][2] = {
- {1, 1}, {0 , 2}, {3 , 3}, {9 , 5},
- {5, 4}, {0x21, 7}, {0x20, 7}, {0x11, 6},
-};
-
-static const uint8_t v2_intra_cbpc[4][2] = {
- {1, 1}, {0, 3}, {1, 3}, {1, 2},
-};
-
-static const uint8_t wmv1_y_dc_scale_table[32]={
-// 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
- 0, 8, 8, 8, 8, 8, 9, 9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21
-};
-static const uint8_t wmv1_c_dc_scale_table[32]={
-// 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
- 0, 8, 8, 8, 8, 9, 9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22
-};
-
-static const uint8_t old_ff_y_dc_scale_table[32]={
-// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
- 0, 8, 8, 8, 8,10,12,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39
-};
-static const uint8_t old_ff_c_dc_scale_table[32]={
-// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
- 0, 8, 8, 8, 8, 9, 9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22
-};
-
-
-#define WMV1_SCANTABLE_COUNT 4
-
-static const uint8_t wmv1_scantable00[64]= {
-0x00, 0x08, 0x01, 0x02, 0x09, 0x10, 0x18, 0x11,
-0x0A, 0x03, 0x04, 0x0B, 0x12, 0x19, 0x20, 0x28,
-0x30, 0x38, 0x29, 0x21, 0x1A, 0x13, 0x0C, 0x05,
-0x06, 0x0D, 0x14, 0x1B, 0x22, 0x31, 0x39, 0x3A,
-0x32, 0x2A, 0x23, 0x1C, 0x15, 0x0E, 0x07, 0x0F,
-0x16, 0x1D, 0x24, 0x2B, 0x33, 0x3B, 0x3C, 0x34,
-0x2C, 0x25, 0x1E, 0x17, 0x1F, 0x26, 0x2D, 0x35,
-0x3D, 0x3E, 0x36, 0x2E, 0x27, 0x2F, 0x37, 0x3F,
-};
-static const uint8_t wmv1_scantable01[64]= {
-0x00, 0x08, 0x01, 0x02, 0x09, 0x10, 0x18, 0x11,
-0x0A, 0x03, 0x04, 0x0B, 0x12, 0x19, 0x20, 0x28,
-0x21, 0x30, 0x1A, 0x13, 0x0C, 0x05, 0x06, 0x0D,
-0x14, 0x1B, 0x22, 0x29, 0x38, 0x31, 0x39, 0x2A,
-0x23, 0x1C, 0x15, 0x0E, 0x07, 0x0F, 0x16, 0x1D,
-0x24, 0x2B, 0x32, 0x3A, 0x33, 0x3B, 0x2C, 0x25,
-0x1E, 0x17, 0x1F, 0x26, 0x2D, 0x34, 0x3C, 0x35,
-0x3D, 0x2E, 0x27, 0x2F, 0x36, 0x3E, 0x37, 0x3F,
-};
-static const uint8_t wmv1_scantable02[64]= {
-0x00, 0x01, 0x08, 0x02, 0x03, 0x09, 0x10, 0x18,
-0x11, 0x0A, 0x04, 0x05, 0x0B, 0x12, 0x19, 0x20,
-0x28, 0x30, 0x21, 0x1A, 0x13, 0x0C, 0x06, 0x07,
-0x0D, 0x14, 0x1B, 0x22, 0x29, 0x38, 0x31, 0x39,
-0x2A, 0x23, 0x1C, 0x15, 0x0E, 0x0F, 0x16, 0x1D,
-0x24, 0x2B, 0x32, 0x3A, 0x33, 0x2C, 0x25, 0x1E,
-0x17, 0x1F, 0x26, 0x2D, 0x34, 0x3B, 0x3C, 0x35,
-0x2E, 0x27, 0x2F, 0x36, 0x3D, 0x3E, 0x37, 0x3F,
-};
-static const uint8_t wmv1_scantable03[64]= {
-0x00, 0x08, 0x10, 0x01, 0x18, 0x20, 0x28, 0x09,
-0x02, 0x03, 0x0A, 0x11, 0x19, 0x30, 0x38, 0x29,
-0x21, 0x1A, 0x12, 0x0B, 0x04, 0x05, 0x0C, 0x13,
-0x1B, 0x22, 0x31, 0x39, 0x32, 0x2A, 0x23, 0x1C,
-0x14, 0x0D, 0x06, 0x07, 0x0E, 0x15, 0x1D, 0x24,
-0x2B, 0x33, 0x3A, 0x3B, 0x34, 0x2C, 0x25, 0x1E,
-0x16, 0x0F, 0x17, 0x1F, 0x26, 0x2D, 0x3C, 0x35,
-0x2E, 0x27, 0x2F, 0x36, 0x3D, 0x3E, 0x37, 0x3F,
-};
-
-static const uint8_t *wmv1_scantable[WMV1_SCANTABLE_COUNT+1]={
- wmv1_scantable00,
- wmv1_scantable01,
- wmv1_scantable02,
- wmv1_scantable03,
-};
-
-static const uint8_t table_inter_intra[4][2]={
- {0,1} /*Luma-Left Chroma-Left*/,
- {2,2} /*Luma-Top Chroma-Left*/,
- {6,3} /*luma-Left Chroma-Top */,
- {7,3} /*luma-Top Chroma-Top */
-};
-
-#define WMV2_INTER_CBP_TABLE_COUNT 4
-
-static const uint32_t table_mb_non_intra2[128][2] = {
-{0x0000A7, 14}, {0x01B2B8, 18}, {0x01B28E, 18}, {0x036575, 19},
-{0x006CAC, 16}, {0x000A69, 18}, {0x002934, 20}, {0x00526B, 21},
-{0x006CA1, 16}, {0x01B2B9, 18}, {0x0029AD, 20}, {0x029353, 24},
-{0x006CA7, 16}, {0x006CAB, 16}, {0x01B2BB, 18}, {0x00029B, 16},
-{0x00D944, 17}, {0x000A6A, 18}, {0x0149A8, 23}, {0x03651F, 19},
-{0x006CAF, 16}, {0x000A4C, 18}, {0x03651E, 19}, {0x000A48, 18},
-{0x00299C, 20}, {0x00299F, 20}, {0x029352, 24}, {0x0029AC, 20},
-{0x000296, 16}, {0x00D946, 17}, {0x000A68, 18}, {0x000298, 16},
-{0x000527, 17}, {0x00D94D, 17}, {0x0014D7, 19}, {0x036574, 19},
-{0x000A5C, 18}, {0x01B299, 18}, {0x00299D, 20}, {0x00299E, 20},
-{0x000525, 17}, {0x000A66, 18}, {0x00A4D5, 22}, {0x00149B, 19},
-{0x000295, 16}, {0x006CAD, 16}, {0x000A49, 18}, {0x000521, 17},
-{0x006CAA, 16}, {0x00D945, 17}, {0x01B298, 18}, {0x00052F, 17},
-{0x003654, 15}, {0x006CA0, 16}, {0x000532, 17}, {0x000291, 16},
-{0x003652, 15}, {0x000520, 17}, {0x000A5D, 18}, {0x000294, 16},
-{0x00009B, 11}, {0x0006E2, 12}, {0x000028, 12}, {0x0001B0, 10},
-{0x000001, 3}, {0x000010, 8}, {0x00002F, 6}, {0x00004C, 10},
-{0x00000D, 4}, {0x000000, 10}, {0x000006, 9}, {0x000134, 12},
-{0x00000C, 4}, {0x000007, 10}, {0x000007, 9}, {0x0006E1, 12},
-{0x00000E, 5}, {0x0000DA, 9}, {0x000022, 9}, {0x000364, 11},
-{0x00000F, 4}, {0x000006, 10}, {0x00000F, 9}, {0x000135, 12},
-{0x000014, 5}, {0x0000DD, 9}, {0x000004, 9}, {0x000015, 11},
-{0x00001A, 6}, {0x0001B3, 10}, {0x000005, 10}, {0x0006E3, 12},
-{0x00000C, 5}, {0x0000B9, 8}, {0x000004, 8}, {0x0000DB, 9},
-{0x00000E, 4}, {0x00000B, 10}, {0x000023, 9}, {0x0006CB, 12},
-{0x000005, 6}, {0x0001B1, 10}, {0x000001, 10}, {0x0006E0, 12},
-{0x000011, 5}, {0x0000DF, 9}, {0x00000E, 9}, {0x000373, 11},
-{0x000003, 5}, {0x0000B8, 8}, {0x000006, 8}, {0x000175, 9},
-{0x000015, 5}, {0x000174, 9}, {0x000027, 9}, {0x000372, 11},
-{0x000010, 5}, {0x0000BB, 8}, {0x000005, 8}, {0x0000DE, 9},
-{0x00000F, 5}, {0x000001, 9}, {0x000012, 8}, {0x000004, 10},
-{0x000002, 3}, {0x000016, 5}, {0x000009, 4}, {0x000001, 5},
-};
-
-static const uint32_t table_mb_non_intra3[128][2] = {
-{0x0002A1, 10}, {0x005740, 15}, {0x01A0BF, 18}, {0x015D19, 17},
-{0x001514, 13}, {0x00461E, 15}, {0x015176, 17}, {0x015177, 17},
-{0x0011AD, 13}, {0x00682E, 16}, {0x0682F9, 20}, {0x03417D, 19},
-{0x001A36, 14}, {0x002A2D, 14}, {0x00D05E, 17}, {0x006824, 16},
-{0x001515, 13}, {0x00545C, 15}, {0x0230E9, 18}, {0x011AFA, 17},
-{0x0015D7, 13}, {0x005747, 15}, {0x008D79, 16}, {0x006825, 16},
-{0x002BA2, 14}, {0x00A8BA, 16}, {0x0235F6, 18}, {0x015D18, 17},
-{0x0011AE, 13}, {0x00346F, 15}, {0x008C3B, 16}, {0x00346E, 15},
-{0x000D1A, 13}, {0x00461F, 15}, {0x0682F8, 20}, {0x011875, 17},
-{0x002BA1, 14}, {0x008D61, 16}, {0x0235F7, 18}, {0x0230E8, 18},
-{0x001513, 13}, {0x008D7B, 16}, {0x011AF4, 17}, {0x011AF5, 17},
-{0x001185, 13}, {0x0046BF, 15}, {0x008D60, 16}, {0x008D7C, 16},
-{0x001512, 13}, {0x00461C, 15}, {0x00AE8D, 16}, {0x008D78, 16},
-{0x000D0E, 13}, {0x003413, 15}, {0x0046B1, 15}, {0x003416, 15},
-{0x000AEA, 12}, {0x002A2C, 14}, {0x005741, 15}, {0x002A2F, 14},
-{0x000158, 9}, {0x0008D2, 12}, {0x00054C, 11}, {0x000686, 12},
-{0x000000, 2}, {0x000069, 8}, {0x00006B, 8}, {0x00068C, 12},
-{0x000007, 3}, {0x00015E, 9}, {0x0002A3, 10}, {0x000AE9, 12},
-{0x000006, 3}, {0x000231, 10}, {0x0002B8, 10}, {0x001A08, 14},
-{0x000010, 5}, {0x0001A9, 10}, {0x000342, 11}, {0x000A88, 12},
-{0x000004, 4}, {0x0001A2, 10}, {0x0002A4, 10}, {0x001184, 13},
-{0x000012, 5}, {0x000232, 10}, {0x0002B2, 10}, {0x000680, 12},
-{0x00001B, 6}, {0x00046A, 11}, {0x00068E, 12}, {0x002359, 14},
-{0x000016, 5}, {0x00015F, 9}, {0x0002A0, 10}, {0x00054D, 11},
-{0x000005, 4}, {0x000233, 10}, {0x0002B9, 10}, {0x0015D6, 13},
-{0x000022, 6}, {0x000468, 11}, {0x000683, 12}, {0x001A0A, 14},
-{0x000013, 5}, {0x000236, 10}, {0x0002BB, 10}, {0x001186, 13},
-{0x000017, 5}, {0x0001AB, 10}, {0x0002A7, 10}, {0x0008D3, 12},
-{0x000014, 5}, {0x000237, 10}, {0x000460, 11}, {0x000D0F, 13},
-{0x000019, 6}, {0x0001AA, 10}, {0x0002B3, 10}, {0x000681, 12},
-{0x000018, 6}, {0x0001A8, 10}, {0x0002A5, 10}, {0x00068F, 12},
-{0x000007, 4}, {0x000055, 7}, {0x000047, 7}, {0x0000AD, 8},
-};
-
-static const uint32_t table_mb_non_intra4[128][2] = {
-{0x0000D4, 8}, {0x0021C5, 14}, {0x00F18A, 16}, {0x00D5BC, 16},
-{0x000879, 12}, {0x00354D, 14}, {0x010E3F, 17}, {0x010F54, 17},
-{0x000866, 12}, {0x00356E, 14}, {0x010F55, 17}, {0x010E3E, 17},
-{0x0010CE, 13}, {0x003C84, 14}, {0x00D5BD, 16}, {0x00F18B, 16},
-{0x000868, 12}, {0x00438C, 15}, {0x0087AB, 16}, {0x00790B, 15},
-{0x000F10, 12}, {0x00433D, 15}, {0x006AD3, 15}, {0x00790A, 15},
-{0x001AA7, 13}, {0x0043D4, 15}, {0x00871E, 16}, {0x006ADF, 15},
-{0x000D7C, 12}, {0x003C94, 14}, {0x00438D, 15}, {0x006AD2, 15},
-{0x0006BC, 11}, {0x0021E9, 14}, {0x006ADA, 15}, {0x006A99, 15},
-{0x0010F7, 13}, {0x004389, 15}, {0x006ADB, 15}, {0x0078C4, 15},
-{0x000D56, 12}, {0x0035F7, 14}, {0x00438E, 15}, {0x006A98, 15},
-{0x000D52, 12}, {0x003C95, 14}, {0x004388, 15}, {0x00433C, 15},
-{0x000D54, 12}, {0x001E4B, 13}, {0x003C63, 14}, {0x003C83, 14},
-{0x000861, 12}, {0x0021EB, 14}, {0x00356C, 14}, {0x0035F6, 14},
-{0x000863, 12}, {0x00219F, 14}, {0x003568, 14}, {0x003C82, 14},
-{0x0001AE, 9}, {0x0010C0, 13}, {0x000F11, 12}, {0x001AFA, 13},
-{0x000000, 1}, {0x0000F0, 8}, {0x0001AD, 9}, {0x0010C1, 13},
-{0x00000A, 4}, {0x0003C5, 10}, {0x000789, 11}, {0x001AB5, 13},
-{0x000009, 4}, {0x000435, 11}, {0x000793, 11}, {0x001E40, 13},
-{0x00001D, 5}, {0x0003CB, 10}, {0x000878, 12}, {0x001AAF, 13},
-{0x00000B, 4}, {0x0003C7, 10}, {0x000791, 11}, {0x001AAB, 13},
-{0x00001F, 5}, {0x000436, 11}, {0x0006BF, 11}, {0x000F19, 12},
-{0x00003D, 6}, {0x000D51, 12}, {0x0010C4, 13}, {0x0021E8, 14},
-{0x000036, 6}, {0x000437, 11}, {0x0006AF, 11}, {0x0010C5, 13},
-{0x00000C, 4}, {0x000432, 11}, {0x000794, 11}, {0x001E30, 13},
-{0x000042, 7}, {0x000870, 12}, {0x000F24, 12}, {0x001E43, 13},
-{0x000020, 6}, {0x00043E, 11}, {0x000795, 11}, {0x001AAA, 13},
-{0x000037, 6}, {0x0006AC, 11}, {0x0006AE, 11}, {0x0010F6, 13},
-{0x000034, 6}, {0x00043A, 11}, {0x000D50, 12}, {0x001AAE, 13},
-{0x000039, 6}, {0x00043F, 11}, {0x00078D, 11}, {0x0010D2, 13},
-{0x000038, 6}, {0x00043B, 11}, {0x0006BD, 11}, {0x0010D3, 13},
-{0x000011, 5}, {0x0001AC, 9}, {0x0000F3, 8}, {0x000439, 11},
-};
-
-static const uint32_t (*wmv2_inter_table[WMV2_INTER_CBP_TABLE_COUNT])[2]={
- table_mb_non_intra2,
- table_mb_non_intra3,
- table_mb_non_intra4,
- table_mb_non_intra,
-};
-
-static const uint8_t wmv2_scantableA[64]={
-0x00, 0x01, 0x02, 0x08, 0x03, 0x09, 0x0A, 0x10,
-0x04, 0x0B, 0x11, 0x18, 0x12, 0x0C, 0x05, 0x13,
-0x19, 0x0D, 0x14, 0x1A, 0x1B, 0x06, 0x15, 0x1C,
-0x0E, 0x16, 0x1D, 0x07, 0x1E, 0x0F, 0x17, 0x1F,
-};
-
-static const uint8_t wmv2_scantableB[64]={
-0x00, 0x08, 0x01, 0x10, 0x09, 0x18, 0x11, 0x02,
-0x20, 0x0A, 0x19, 0x28, 0x12, 0x30, 0x21, 0x1A,
-0x38, 0x29, 0x22, 0x03, 0x31, 0x39, 0x0B, 0x2A,
-0x13, 0x32, 0x1B, 0x3A, 0x23, 0x2B, 0x33, 0x3B,
-};
diff --git a/src/libffmpeg/libavcodec/msrle.c b/src/libffmpeg/libavcodec/msrle.c
deleted file mode 100644
index fae5616e5..000000000
--- a/src/libffmpeg/libavcodec/msrle.c
+++ /dev/null
@@ -1,309 +0,0 @@
-/*
- * Micrsoft RLE Video Decoder
- * Copyright (C) 2003 the ffmpeg project
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file msrle.c
- * MS RLE Video Decoder by Mike Melanson (melanson@pcisys.net)
- * For more information about the MS RLE format, visit:
- * http://www.pcisys.net/~melanson/codecs/
- *
- * The MS RLE decoder outputs PAL8 colorspace data.
- *
- * Note that this decoder expects the palette colors from the end of the
- * BITMAPINFO header passed through palctrl.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "common.h"
-#include "avcodec.h"
-#include "dsputil.h"
-
-typedef struct MsrleContext {
- AVCodecContext *avctx;
- AVFrame frame;
-
- unsigned char *buf;
- int size;
-
-} MsrleContext;
-
-#define FETCH_NEXT_STREAM_BYTE() \
- if (stream_ptr >= s->size) \
- { \
- av_log(s->avctx, AV_LOG_ERROR, " MS RLE: stream ptr just went out of bounds (1)\n"); \
- return; \
- } \
- stream_byte = s->buf[stream_ptr++];
-
-static void msrle_decode_pal4(MsrleContext *s)
-{
- int stream_ptr = 0;
- unsigned char rle_code;
- unsigned char extra_byte, odd_pixel;
- unsigned char stream_byte;
- int pixel_ptr = 0;
- int row_dec = s->frame.linesize[0];
- int row_ptr = (s->avctx->height - 1) * row_dec;
- int frame_size = row_dec * s->avctx->height;
- int i;
-
- /* make the palette available */
- memcpy(s->frame.data[1], s->avctx->palctrl->palette, AVPALETTE_SIZE);
- if (s->avctx->palctrl->palette_changed) {
- s->frame.palette_has_changed = 1;
- s->avctx->palctrl->palette_changed = 0;
- }
-
- while (row_ptr >= 0) {
- FETCH_NEXT_STREAM_BYTE();
- rle_code = stream_byte;
- if (rle_code == 0) {
- /* fetch the next byte to see how to handle escape code */
- FETCH_NEXT_STREAM_BYTE();
- if (stream_byte == 0) {
- /* line is done, goto the next one */
- row_ptr -= row_dec;
- pixel_ptr = 0;
- } else if (stream_byte == 1) {
- /* decode is done */
- return;
- } else if (stream_byte == 2) {
- /* reposition frame decode coordinates */
- FETCH_NEXT_STREAM_BYTE();
- pixel_ptr += stream_byte;
- FETCH_NEXT_STREAM_BYTE();
- row_ptr -= stream_byte * row_dec;
- } else {
- // copy pixels from encoded stream
- odd_pixel = stream_byte & 1;
- rle_code = (stream_byte + 1) / 2;
- extra_byte = rle_code & 0x01;
- if ((row_ptr + pixel_ptr + stream_byte > frame_size) ||
- (row_ptr < 0)) {
- av_log(s->avctx, AV_LOG_ERROR, " MS RLE: frame ptr just went out of bounds (1)\n");
- return;
- }
-
- for (i = 0; i < rle_code; i++) {
- if (pixel_ptr >= s->avctx->width)
- break;
- FETCH_NEXT_STREAM_BYTE();
- s->frame.data[0][row_ptr + pixel_ptr] = stream_byte >> 4;
- pixel_ptr++;
- if (i + 1 == rle_code && odd_pixel)
- break;
- if (pixel_ptr >= s->avctx->width)
- break;
- s->frame.data[0][row_ptr + pixel_ptr] = stream_byte & 0x0F;
- pixel_ptr++;
- }
-
- // if the RLE code is odd, skip a byte in the stream
- if (extra_byte)
- stream_ptr++;
- }
- } else {
- // decode a run of data
- if ((row_ptr + pixel_ptr + stream_byte > frame_size) ||
- (row_ptr < 0)) {
- av_log(s->avctx, AV_LOG_ERROR, " MS RLE: frame ptr just went out of bounds (1)\n");
- return;
- }
- FETCH_NEXT_STREAM_BYTE();
- for (i = 0; i < rle_code; i++) {
- if (pixel_ptr >= s->avctx->width)
- break;
- if ((i & 1) == 0)
- s->frame.data[0][row_ptr + pixel_ptr] = stream_byte >> 4;
- else
- s->frame.data[0][row_ptr + pixel_ptr] = stream_byte & 0x0F;
- pixel_ptr++;
- }
- }
- }
-
- /* one last sanity check on the way out */
- if (stream_ptr < s->size)
- av_log(s->avctx, AV_LOG_ERROR, " MS RLE: ended frame decode with bytes left over (%d < %d)\n",
- stream_ptr, s->size);
-}
-
-
-
-static void msrle_decode_pal8(MsrleContext *s)
-{
- int stream_ptr = 0;
- unsigned char rle_code;
- unsigned char extra_byte;
- unsigned char stream_byte;
- int pixel_ptr = 0;
- int row_dec = s->frame.linesize[0];
- int row_ptr = (s->avctx->height - 1) * row_dec;
- int frame_size = row_dec * s->avctx->height;
-
- /* make the palette available */
- memcpy(s->frame.data[1], s->avctx->palctrl->palette, AVPALETTE_SIZE);
- if (s->avctx->palctrl->palette_changed) {
- s->frame.palette_has_changed = 1;
- s->avctx->palctrl->palette_changed = 0;
- }
-
- while (row_ptr >= 0) {
- FETCH_NEXT_STREAM_BYTE();
- rle_code = stream_byte;
- if (rle_code == 0) {
- /* fetch the next byte to see how to handle escape code */
- FETCH_NEXT_STREAM_BYTE();
- if (stream_byte == 0) {
- /* line is done, goto the next one */
- row_ptr -= row_dec;
- pixel_ptr = 0;
- } else if (stream_byte == 1) {
- /* decode is done */
- return;
- } else if (stream_byte == 2) {
- /* reposition frame decode coordinates */
- FETCH_NEXT_STREAM_BYTE();
- pixel_ptr += stream_byte;
- FETCH_NEXT_STREAM_BYTE();
- row_ptr -= stream_byte * row_dec;
- } else {
- /* copy pixels from encoded stream */
- if ((row_ptr + pixel_ptr + stream_byte > frame_size) ||
- (row_ptr < 0)) {
- av_log(s->avctx, AV_LOG_ERROR, " MS RLE: frame ptr just went out of bounds (1)\n");
- return;
- }
-
- rle_code = stream_byte;
- extra_byte = stream_byte & 0x01;
- if (stream_ptr + rle_code + extra_byte > s->size) {
- av_log(s->avctx, AV_LOG_ERROR, " MS RLE: stream ptr just went out of bounds (2)\n");
- return;
- }
-
- while (rle_code--) {
- FETCH_NEXT_STREAM_BYTE();
- s->frame.data[0][row_ptr + pixel_ptr] = stream_byte;
- pixel_ptr++;
- }
-
- /* if the RLE code is odd, skip a byte in the stream */
- if (extra_byte)
- stream_ptr++;
- }
- } else {
- /* decode a run of data */
- if ((row_ptr + pixel_ptr + stream_byte > frame_size) ||
- (row_ptr < 0)) {
- av_log(s->avctx, AV_LOG_ERROR, " MS RLE: frame ptr just went out of bounds (2)\n");
- return;
- }
-
- FETCH_NEXT_STREAM_BYTE();
-
- while(rle_code--) {
- s->frame.data[0][row_ptr + pixel_ptr] = stream_byte;
- pixel_ptr++;
- }
- }
- }
-
- /* one last sanity check on the way out */
- if (stream_ptr < s->size)
- av_log(s->avctx, AV_LOG_ERROR, " MS RLE: ended frame decode with bytes left over (%d < %d)\n",
- stream_ptr, s->size);
-}
-
-static int msrle_decode_init(AVCodecContext *avctx)
-{
- MsrleContext *s = (MsrleContext *)avctx->priv_data;
-
- s->avctx = avctx;
-
- avctx->pix_fmt = PIX_FMT_PAL8;
- avctx->has_b_frames = 0;
- s->frame.data[0] = NULL;
-
- return 0;
-}
-
-static int msrle_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- MsrleContext *s = (MsrleContext *)avctx->priv_data;
-
- s->buf = buf;
- s->size = buf_size;
-
- s->frame.reference = 1;
- s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
- if (avctx->reget_buffer(avctx, &s->frame)) {
- av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
- return -1;
- }
-
- switch (avctx->bits_per_sample) {
- case 8:
- msrle_decode_pal8(s);
- break;
- case 4:
- msrle_decode_pal4(s);
- break;
- default:
- av_log(avctx, AV_LOG_ERROR, "Don't know how to decode depth %u.\n",
- avctx->bits_per_sample);
- }
-
- *data_size = sizeof(AVFrame);
- *(AVFrame*)data = s->frame;
-
- /* report that the buffer was completely consumed */
- return buf_size;
-}
-
-static int msrle_decode_end(AVCodecContext *avctx)
-{
- MsrleContext *s = (MsrleContext *)avctx->priv_data;
-
- /* release the last frame */
- if (s->frame.data[0])
- avctx->release_buffer(avctx, &s->frame);
-
- return 0;
-}
-
-AVCodec msrle_decoder = {
- "msrle",
- CODEC_TYPE_VIDEO,
- CODEC_ID_MSRLE,
- sizeof(MsrleContext),
- msrle_decode_init,
- NULL,
- msrle_decode_end,
- msrle_decode_frame,
- CODEC_CAP_DR1,
-};
diff --git a/src/libffmpeg/libavcodec/msvideo1.c b/src/libffmpeg/libavcodec/msvideo1.c
deleted file mode 100644
index 1e3f6cce2..000000000
--- a/src/libffmpeg/libavcodec/msvideo1.c
+++ /dev/null
@@ -1,349 +0,0 @@
-/*
- * Microsoft Video-1 Decoder
- * Copyright (C) 2003 the ffmpeg project
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file msvideo1.c
- * Microsoft Video-1 Decoder by Mike Melanson (melanson@pcisys.net)
- * For more information about the MS Video-1 format, visit:
- * http://www.pcisys.net/~melanson/codecs/
- *
- * This decoder outputs either PAL8 or RGB555 data, depending on the
- * whether a RGB palette was passed through palctrl;
- * if it's present, then the data is PAL8; RGB555 otherwise.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "common.h"
-#include "avcodec.h"
-#include "dsputil.h"
-
-#define PALETTE_COUNT 256
-#define CHECK_STREAM_PTR(n) \
- if ((stream_ptr + n) > s->size ) { \
- av_log(s->avctx, AV_LOG_ERROR, " MS Video-1 warning: stream_ptr out of bounds (%d >= %d)\n", \
- stream_ptr + n, s->size); \
- return; \
- }
-
-typedef struct Msvideo1Context {
-
- AVCodecContext *avctx;
- DSPContext dsp;
- AVFrame frame;
-
- unsigned char *buf;
- int size;
-
- int mode_8bit; /* if it's not 8-bit, it's 16-bit */
-
-} Msvideo1Context;
-
-static int msvideo1_decode_init(AVCodecContext *avctx)
-{
- Msvideo1Context *s = (Msvideo1Context *)avctx->priv_data;
-
- s->avctx = avctx;
-
- /* figure out the colorspace based on the presence of a palette */
- if (s->avctx->palctrl) {
- s->mode_8bit = 1;
- avctx->pix_fmt = PIX_FMT_PAL8;
- } else {
- s->mode_8bit = 0;
- avctx->pix_fmt = PIX_FMT_RGB555;
- }
-
- avctx->has_b_frames = 0;
- dsputil_init(&s->dsp, avctx);
-
- s->frame.data[0] = NULL;
-
- return 0;
-}
-
-static void msvideo1_decode_8bit(Msvideo1Context *s)
-{
- int block_ptr, pixel_ptr;
- int total_blocks;
- int pixel_x, pixel_y; /* pixel width and height iterators */
- int block_x, block_y; /* block width and height iterators */
- int blocks_wide, blocks_high; /* width and height in 4x4 blocks */
- int block_inc;
- int row_dec;
-
- /* decoding parameters */
- int stream_ptr;
- unsigned char byte_a, byte_b;
- unsigned short flags;
- int skip_blocks;
- unsigned char colors[8];
- unsigned char *pixels = s->frame.data[0];
- int stride = s->frame.linesize[0];
-
- stream_ptr = 0;
- skip_blocks = 0;
- blocks_wide = s->avctx->width / 4;
- blocks_high = s->avctx->height / 4;
- total_blocks = blocks_wide * blocks_high;
- block_inc = 4;
- row_dec = stride + 4;
-
- for (block_y = blocks_high; block_y > 0; block_y--) {
- block_ptr = ((block_y * 4) - 1) * stride;
- for (block_x = blocks_wide; block_x > 0; block_x--) {
- /* check if this block should be skipped */
- if (skip_blocks) {
- block_ptr += block_inc;
- skip_blocks--;
- total_blocks--;
- continue;
- }
-
- pixel_ptr = block_ptr;
-
- /* get the next two bytes in the encoded data stream */
- CHECK_STREAM_PTR(2);
- byte_a = s->buf[stream_ptr++];
- byte_b = s->buf[stream_ptr++];
-
- /* check if the decode is finished */
- if ((byte_a == 0) && (byte_b == 0) && (total_blocks == 0))
- return;
- else if ((byte_b & 0xFC) == 0x84) {
- /* skip code, but don't count the current block */
- skip_blocks = ((byte_b - 0x84) << 8) + byte_a - 1;
- } else if (byte_b < 0x80) {
- /* 2-color encoding */
- flags = (byte_b << 8) | byte_a;
-
- CHECK_STREAM_PTR(2);
- colors[0] = s->buf[stream_ptr++];
- colors[1] = s->buf[stream_ptr++];
-
- for (pixel_y = 0; pixel_y < 4; pixel_y++) {
- for (pixel_x = 0; pixel_x < 4; pixel_x++, flags >>= 1)
- pixels[pixel_ptr++] = colors[(flags & 0x1) ^ 1];
- pixel_ptr -= row_dec;
- }
- } else if (byte_b >= 0x90) {
- /* 8-color encoding */
- flags = (byte_b << 8) | byte_a;
-
- CHECK_STREAM_PTR(8);
- memcpy(colors, &s->buf[stream_ptr], 8);
- stream_ptr += 8;
-
- for (pixel_y = 0; pixel_y < 4; pixel_y++) {
- for (pixel_x = 0; pixel_x < 4; pixel_x++, flags >>= 1)
- pixels[pixel_ptr++] =
- colors[((pixel_y & 0x2) << 1) +
- (pixel_x & 0x2) + ((flags & 0x1) ^ 1)];
- pixel_ptr -= row_dec;
- }
- } else {
- /* 1-color encoding */
- colors[0] = byte_a;
-
- for (pixel_y = 0; pixel_y < 4; pixel_y++) {
- for (pixel_x = 0; pixel_x < 4; pixel_x++)
- pixels[pixel_ptr++] = colors[0];
- pixel_ptr -= row_dec;
- }
- }
-
- block_ptr += block_inc;
- total_blocks--;
- }
- }
-
- /* make the palette available on the way out */
- if (s->avctx->pix_fmt == PIX_FMT_PAL8) {
- memcpy(s->frame.data[1], s->avctx->palctrl->palette, AVPALETTE_SIZE);
- if (s->avctx->palctrl->palette_changed) {
- s->frame.palette_has_changed = 1;
- s->avctx->palctrl->palette_changed = 0;
- }
- }
-}
-
-static void msvideo1_decode_16bit(Msvideo1Context *s)
-{
- int block_ptr, pixel_ptr;
- int total_blocks;
- int pixel_x, pixel_y; /* pixel width and height iterators */
- int block_x, block_y; /* block width and height iterators */
- int blocks_wide, blocks_high; /* width and height in 4x4 blocks */
- int block_inc;
- int row_dec;
-
- /* decoding parameters */
- int stream_ptr;
- unsigned char byte_a, byte_b;
- unsigned short flags;
- int skip_blocks;
- unsigned short colors[8];
- unsigned short *pixels = (unsigned short *)s->frame.data[0];
- int stride = s->frame.linesize[0] / 2;
-
- stream_ptr = 0;
- skip_blocks = 0;
- blocks_wide = s->avctx->width / 4;
- blocks_high = s->avctx->height / 4;
- total_blocks = blocks_wide * blocks_high;
- block_inc = 4;
- row_dec = stride + 4;
-
- for (block_y = blocks_high; block_y > 0; block_y--) {
- block_ptr = ((block_y * 4) - 1) * stride;
- for (block_x = blocks_wide; block_x > 0; block_x--) {
- /* check if this block should be skipped */
- if (skip_blocks) {
- block_ptr += block_inc;
- skip_blocks--;
- total_blocks--;
- continue;
- }
-
- pixel_ptr = block_ptr;
-
- /* get the next two bytes in the encoded data stream */
- CHECK_STREAM_PTR(2);
- byte_a = s->buf[stream_ptr++];
- byte_b = s->buf[stream_ptr++];
-
- /* check if the decode is finished */
- if ((byte_a == 0) && (byte_b == 0) && (total_blocks == 0)) {
- return;
- } else if ((byte_b & 0xFC) == 0x84) {
- /* skip code, but don't count the current block */
- skip_blocks = ((byte_b - 0x84) << 8) + byte_a - 1;
- } else if (byte_b < 0x80) {
- /* 2- or 8-color encoding modes */
- flags = (byte_b << 8) | byte_a;
-
- CHECK_STREAM_PTR(4);
- colors[0] = AV_RL16(&s->buf[stream_ptr]);
- stream_ptr += 2;
- colors[1] = AV_RL16(&s->buf[stream_ptr]);
- stream_ptr += 2;
-
- if (colors[0] & 0x8000) {
- /* 8-color encoding */
- CHECK_STREAM_PTR(12);
- colors[2] = AV_RL16(&s->buf[stream_ptr]);
- stream_ptr += 2;
- colors[3] = AV_RL16(&s->buf[stream_ptr]);
- stream_ptr += 2;
- colors[4] = AV_RL16(&s->buf[stream_ptr]);
- stream_ptr += 2;
- colors[5] = AV_RL16(&s->buf[stream_ptr]);
- stream_ptr += 2;
- colors[6] = AV_RL16(&s->buf[stream_ptr]);
- stream_ptr += 2;
- colors[7] = AV_RL16(&s->buf[stream_ptr]);
- stream_ptr += 2;
-
- for (pixel_y = 0; pixel_y < 4; pixel_y++) {
- for (pixel_x = 0; pixel_x < 4; pixel_x++, flags >>= 1)
- pixels[pixel_ptr++] =
- colors[((pixel_y & 0x2) << 1) +
- (pixel_x & 0x2) + ((flags & 0x1) ^ 1)];
- pixel_ptr -= row_dec;
- }
- } else {
- /* 2-color encoding */
- for (pixel_y = 0; pixel_y < 4; pixel_y++) {
- for (pixel_x = 0; pixel_x < 4; pixel_x++, flags >>= 1)
- pixels[pixel_ptr++] = colors[(flags & 0x1) ^ 1];
- pixel_ptr -= row_dec;
- }
- }
- } else {
- /* otherwise, it's a 1-color block */
- colors[0] = (byte_b << 8) | byte_a;
-
- for (pixel_y = 0; pixel_y < 4; pixel_y++) {
- for (pixel_x = 0; pixel_x < 4; pixel_x++)
- pixels[pixel_ptr++] = colors[0];
- pixel_ptr -= row_dec;
- }
- }
-
- block_ptr += block_inc;
- total_blocks--;
- }
- }
-}
-
-static int msvideo1_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- Msvideo1Context *s = (Msvideo1Context *)avctx->priv_data;
-
- s->buf = buf;
- s->size = buf_size;
-
- s->frame.reference = 1;
- s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
- if (avctx->reget_buffer(avctx, &s->frame)) {
- av_log(s->avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
- return -1;
- }
-
- if (s->mode_8bit)
- msvideo1_decode_8bit(s);
- else
- msvideo1_decode_16bit(s);
-
- *data_size = sizeof(AVFrame);
- *(AVFrame*)data = s->frame;
-
- /* report that the buffer was completely consumed */
- return buf_size;
-}
-
-static int msvideo1_decode_end(AVCodecContext *avctx)
-{
- Msvideo1Context *s = (Msvideo1Context *)avctx->priv_data;
-
- if (s->frame.data[0])
- avctx->release_buffer(avctx, &s->frame);
-
- return 0;
-}
-
-AVCodec msvideo1_decoder = {
- "msvideo1",
- CODEC_TYPE_VIDEO,
- CODEC_ID_MSVIDEO1,
- sizeof(Msvideo1Context),
- msvideo1_decode_init,
- NULL,
- msvideo1_decode_end,
- msvideo1_decode_frame,
- CODEC_CAP_DR1,
-};
diff --git a/src/libffmpeg/libavcodec/nuv.c b/src/libffmpeg/libavcodec/nuv.c
deleted file mode 100644
index 19e343056..000000000
--- a/src/libffmpeg/libavcodec/nuv.c
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * NuppelVideo decoder
- * Copyright (c) 2006 Reimar Doeffinger
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "common.h"
-#include "avcodec.h"
-
-#include "bswap.h"
-#include "dsputil.h"
-#include "lzo.h"
-#include "rtjpeg.h"
-
-typedef struct {
- AVFrame pic;
- int width, height;
- unsigned int decomp_size;
- unsigned char* decomp_buf;
- uint32_t lq[64], cq[64];
- RTJpegContext rtj;
- DSPContext dsp;
-} NuvContext;
-
-/**
- * \brief copy frame data from buffer to AVFrame, handling stride.
- * \param f destination AVFrame
- * \param src source buffer, does not use any line-stride
- * \param width width of the video frame
- * \param height height of the video frame
- */
-static void copy_frame(AVFrame *f, uint8_t *src,
- int width, int height) {
- AVPicture pic;
- avpicture_fill(&pic, src, PIX_FMT_YUV420P, width, height);
- img_copy((AVPicture *)f, &pic, PIX_FMT_YUV420P, width, height);
-}
-
-/**
- * \brief extract quantization tables from codec data into our context
- */
-static int get_quant(AVCodecContext *avctx, NuvContext *c,
- uint8_t *buf, int size) {
- int i;
- if (size < 2 * 64 * 4) {
- av_log(avctx, AV_LOG_ERROR, "insufficient rtjpeg quant data\n");
- return -1;
- }
- for (i = 0; i < 64; i++, buf += 4)
- c->lq[i] = AV_RL32(buf);
- for (i = 0; i < 64; i++, buf += 4)
- c->cq[i] = AV_RL32(buf);
- return 0;
-}
-
-static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
- uint8_t *buf, int buf_size) {
- NuvContext *c = (NuvContext *)avctx->priv_data;
- AVFrame *picture = data;
- int orig_size = buf_size;
- enum {NUV_UNCOMPRESSED = '0', NUV_RTJPEG = '1',
- NUV_RTJPEG_IN_LZO = '2', NUV_LZO = '3',
- NUV_BLACK = 'N', NUV_COPY_LAST = 'L'} comptype;
-
- if (buf_size < 12) {
- av_log(avctx, AV_LOG_ERROR, "coded frame too small\n");
- return -1;
- }
-
- if (c->pic.data[0])
- avctx->release_buffer(avctx, &c->pic);
- c->pic.reference = 1;
- c->pic.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_READABLE |
- FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
- if (avctx->get_buffer(avctx, &c->pic) < 0) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
-
- // codec data (rtjpeg quant tables)
- if (buf[0] == 'D' && buf[1] == 'R') {
- int ret;
- // skip rest of the frameheader.
- buf = &buf[12];
- buf_size -= 12;
- ret = get_quant(avctx, c, buf, buf_size);
- if (ret < 0)
- return ret;
- rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height, c->lq, c->cq);
- return orig_size;
- }
-
- if (buf[0] != 'V' || buf_size < 12) {
- av_log(avctx, AV_LOG_ERROR, "not a nuv video frame\n");
- return -1;
- }
- comptype = buf[1];
- // skip rest of the frameheader.
- buf = &buf[12];
- buf_size -= 12;
-
- c->pic.pict_type = FF_I_TYPE;
- c->pic.key_frame = 1;
- // decompress/copy/whatever data
- switch (comptype) {
- case NUV_UNCOMPRESSED: {
- int height = c->height;
- if (buf_size < c->width * height * 3 / 2) {
- av_log(avctx, AV_LOG_ERROR, "uncompressed frame too short\n");
- height = buf_size / c->width / 3 * 2;
- }
- copy_frame(&c->pic, buf, c->width, height);
- break;
- }
- case NUV_RTJPEG: {
- rtjpeg_decode_frame_yuv420(&c->rtj, &c->pic, buf, buf_size);
- break;
- }
- case NUV_RTJPEG_IN_LZO: {
- int outlen = c->decomp_size, inlen = buf_size;
- if (lzo1x_decode(c->decomp_buf, &outlen, buf, &inlen))
- av_log(avctx, AV_LOG_ERROR, "error during lzo decompression\n");
- rtjpeg_decode_frame_yuv420(&c->rtj, &c->pic, c->decomp_buf, c->decomp_size);
- break;
- }
- case NUV_LZO: {
- int outlen = c->decomp_size, inlen = buf_size;
- if (lzo1x_decode(c->decomp_buf, &outlen, buf, &inlen))
- av_log(avctx, AV_LOG_ERROR, "error during lzo decompression\n");
- copy_frame(&c->pic, c->decomp_buf, c->width, c->height);
- break;
- }
- case NUV_BLACK: {
- memset(c->pic.data[0], 0, c->width * c->height);
- memset(c->pic.data[1], 128, c->width * c->height / 4);
- memset(c->pic.data[2], 128, c->width * c->height / 4);
- break;
- }
- case NUV_COPY_LAST: {
- c->pic.pict_type = FF_P_TYPE;
- c->pic.key_frame = 0;
- /* nothing more to do here */
- break;
- }
- default:
- av_log(avctx, AV_LOG_ERROR, "unknown compression\n");
- return -1;
- }
-
- *picture = c->pic;
- *data_size = sizeof(AVFrame);
- return orig_size;
-}
-
-static int decode_init(AVCodecContext *avctx) {
- NuvContext *c = (NuvContext *)avctx->priv_data;
- avctx->width = (avctx->width + 1) & ~1;
- avctx->height = (avctx->height + 1) & ~1;
- if (avcodec_check_dimensions(avctx, avctx->height, avctx->width) < 0) {
- return 1;
- }
- avctx->has_b_frames = 0;
- avctx->pix_fmt = PIX_FMT_YUV420P;
- c->pic.data[0] = NULL;
- c->width = avctx->width;
- c->height = avctx->height;
- c->decomp_size = c->height * c->width * 3 / 2;
- c->decomp_buf = av_malloc(c->decomp_size + LZO_OUTPUT_PADDING);
- if (!c->decomp_buf) {
- av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n");
- return 1;
- }
- dsputil_init(&c->dsp, avctx);
- if (avctx->extradata_size)
- get_quant(avctx, c, avctx->extradata, avctx->extradata_size);
- rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height, c->lq, c->cq);
- return 0;
-}
-
-static int decode_end(AVCodecContext *avctx) {
- NuvContext *c = (NuvContext *)avctx->priv_data;
- av_freep(&c->decomp_buf);
- if (c->pic.data[0])
- avctx->release_buffer(avctx, &c->pic);
- return 0;
-}
-
-AVCodec nuv_decoder = {
- "nuv",
- CODEC_TYPE_VIDEO,
- CODEC_ID_NUV,
- sizeof(NuvContext),
- decode_init,
- NULL,
- decode_end,
- decode_frame,
- CODEC_CAP_DR1,
-};
-
diff --git a/src/libffmpeg/libavcodec/opt.c b/src/libffmpeg/libavcodec/opt.c
deleted file mode 100644
index 70babd587..000000000
--- a/src/libffmpeg/libavcodec/opt.c
+++ /dev/null
@@ -1,381 +0,0 @@
-/*
- * AVOptions
- * Copyright (c) 2005 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file opt.c
- * AVOptions
- * @author Michael Niedermayer <michaelni@gmx.at>
- */
-
-#include "avcodec.h"
-#include "opt.h"
-#include "eval.h"
-
-//FIXME order them and do a bin search
-static const AVOption *find_opt(void *v, const char *name, const char *unit){
- AVClass *c= *(AVClass**)v; //FIXME silly way of storing AVClass
- const AVOption *o= c->option;
-
- for(;o && o->name; o++){
- if(!strcmp(o->name, name) && (!unit || !strcmp(o->unit, unit)) )
- return o;
- }
- return NULL;
-}
-
-const AVOption *av_next_option(void *obj, const AVOption *last){
- if(last && last[1].name) return ++last;
- else if(last) return NULL;
- else return (*(AVClass**)obj)->option;
-}
-
-static const AVOption *av_set_number(void *obj, const char *name, double num, int den, int64_t intnum){
- const AVOption *o= find_opt(obj, name, NULL);
- void *dst;
- if(!o || o->offset<=0)
- return NULL;
-
- if(o->max*den < num*intnum || o->min*den > num*intnum) {
- av_log(NULL, AV_LOG_ERROR, "Value %lf for parameter '%s' out of range.\n", num, name);
- return NULL;
- }
-
- dst= ((uint8_t*)obj) + o->offset;
-
- switch(o->type){
- case FF_OPT_TYPE_FLAGS:
- case FF_OPT_TYPE_INT: *(int *)dst= lrintf(num/den)*intnum; break;
- case FF_OPT_TYPE_INT64: *(int64_t *)dst= lrintf(num/den)*intnum; break;
- case FF_OPT_TYPE_FLOAT: *(float *)dst= num*intnum/den; break;
- case FF_OPT_TYPE_DOUBLE:*(double *)dst= num*intnum/den; break;
- case FF_OPT_TYPE_RATIONAL:
- if((int)num == num) *(AVRational*)dst= (AVRational){num*intnum, den};
- else *(AVRational*)dst= av_d2q(num*intnum/den, 1<<24);
- default:
- return NULL;
- }
- return o;
-}
-
-static const AVOption *set_all_opt(void *v, const char *unit, double d){
- AVClass *c= *(AVClass**)v; //FIXME silly way of storing AVClass
- const AVOption *o= c->option;
- const AVOption *ret=NULL;
-
- for(;o && o->name; o++){
- if(o->type != FF_OPT_TYPE_CONST && o->unit && !strcmp(o->unit, unit)){
- double tmp= d;
- if(o->type == FF_OPT_TYPE_FLAGS)
- tmp= av_get_int(v, o->name, NULL) | (int64_t)d;
-
- av_set_number(v, o->name, tmp, 1, 1);
- ret= o;
- }
- }
- return ret;
-}
-
-static double const_values[]={
- M_PI,
- M_E,
- FF_QP2LAMBDA,
- 0
-};
-
-static const char *const_names[]={
- "PI",
- "E",
- "QP2LAMBDA",
- 0
-};
-
-const AVOption *av_set_string(void *obj, const char *name, const char *val){
- const AVOption *o= find_opt(obj, name, NULL);
- if(o && o->offset==0 && o->type == FF_OPT_TYPE_CONST && o->unit){
- return set_all_opt(obj, o->unit, o->default_val);
- }
- if(!o || !val || o->offset<=0)
- return NULL;
- if(o->type != FF_OPT_TYPE_STRING){
- for(;;){
- int i;
- char buf[256];
- int cmd=0;
- double d;
- char *error = NULL;
-
- if(*val == '+' || *val == '-')
- cmd= *(val++);
-
- for(i=0; i<sizeof(buf)-1 && val[i] && val[i]!='+' && val[i]!='-'; i++)
- buf[i]= val[i];
- buf[i]=0;
- val+= i;
-
- d = ff_eval2(buf, const_values, const_names, NULL, NULL, NULL, NULL, NULL, &error);
- if(isnan(d)) {
- const AVOption *o_named= find_opt(obj, buf, o->unit);
- if(o_named && o_named->type == FF_OPT_TYPE_CONST)
- d= o_named->default_val;
- else if(!strcmp(buf, "default")) d= o->default_val;
- else if(!strcmp(buf, "max" )) d= o->max;
- else if(!strcmp(buf, "min" )) d= o->min;
- else {
- if (!error)
- av_log(NULL, AV_LOG_ERROR, "Unable to parse option value \"%s\": %s\n", val, error);
- return NULL;
- }
- }
- if(o->type == FF_OPT_TYPE_FLAGS){
- if (cmd=='+') d= av_get_int(obj, name, NULL) | (int64_t)d;
- else if(cmd=='-') d= av_get_int(obj, name, NULL) &~(int64_t)d;
- }else if(cmd=='-')
- d= -d;
-
- av_set_number(obj, name, d, 1, 1);
- if(!*val)
- return o;
- }
- return NULL;
- }
-
- memcpy(((uint8_t*)obj) + o->offset, val, sizeof(val));
- return o;
-}
-
-const AVOption *av_set_double(void *obj, const char *name, double n){
- return av_set_number(obj, name, n, 1, 1);
-}
-
-const AVOption *av_set_q(void *obj, const char *name, AVRational n){
- return av_set_number(obj, name, n.num, n.den, 1);
-}
-
-const AVOption *av_set_int(void *obj, const char *name, int64_t n){
- return av_set_number(obj, name, 1, 1, n);
-}
-
-/**
- *
- * @param buf a buffer which is used for returning non string values as strings, can be NULL
- * @param buf_len allocated length in bytes of buf
- */
-const char *av_get_string(void *obj, const char *name, const AVOption **o_out, char *buf, int buf_len){
- const AVOption *o= find_opt(obj, name, NULL);
- void *dst;
- if(!o || o->offset<=0)
- return NULL;
- if(o->type != FF_OPT_TYPE_STRING && (!buf || !buf_len))
- return NULL;
-
- dst= ((uint8_t*)obj) + o->offset;
- if(o_out) *o_out= o;
-
- if(o->type == FF_OPT_TYPE_STRING)
- return dst;
-
- switch(o->type){
- case FF_OPT_TYPE_FLAGS: snprintf(buf, buf_len, "0x%08X",*(int *)dst);break;
- case FF_OPT_TYPE_INT: snprintf(buf, buf_len, "%d" , *(int *)dst);break;
- case FF_OPT_TYPE_INT64: snprintf(buf, buf_len, "%"PRId64, *(int64_t*)dst);break;
- case FF_OPT_TYPE_FLOAT: snprintf(buf, buf_len, "%f" , *(float *)dst);break;
- case FF_OPT_TYPE_DOUBLE: snprintf(buf, buf_len, "%f" , *(double *)dst);break;
- case FF_OPT_TYPE_RATIONAL: snprintf(buf, buf_len, "%d/%d", ((AVRational*)dst)->num, ((AVRational*)dst)->den);break;
- default: return NULL;
- }
- return buf;
-}
-
-static int av_get_number(void *obj, const char *name, const AVOption **o_out, double *num, int *den, int64_t *intnum){
- const AVOption *o= find_opt(obj, name, NULL);
- void *dst;
- if(!o || o->offset<=0)
- goto error;
-
- dst= ((uint8_t*)obj) + o->offset;
-
- if(o_out) *o_out= o;
-
- switch(o->type){
- case FF_OPT_TYPE_FLAGS:
- case FF_OPT_TYPE_INT: *intnum= *(int *)dst;return 0;
- case FF_OPT_TYPE_INT64: *intnum= *(int64_t*)dst;return 0;
- case FF_OPT_TYPE_FLOAT: *num= *(float *)dst;return 0;
- case FF_OPT_TYPE_DOUBLE: *num= *(double *)dst;return 0;
- case FF_OPT_TYPE_RATIONAL: *intnum= ((AVRational*)dst)->num;
- *den = ((AVRational*)dst)->den;
- return 0;
- }
-error:
- *den=*intnum=0;
- return -1;
-}
-
-double av_get_double(void *obj, const char *name, const AVOption **o_out){
- int64_t intnum=1;
- double num=1;
- int den=1;
-
- av_get_number(obj, name, o_out, &num, &den, &intnum);
- return num*intnum/den;
-}
-
-AVRational av_get_q(void *obj, const char *name, const AVOption **o_out){
- int64_t intnum=1;
- double num=1;
- int den=1;
-
- av_get_number(obj, name, o_out, &num, &den, &intnum);
- if(num == 1.0 && (int)intnum == intnum)
- return (AVRational){intnum, den};
- else
- return av_d2q(num*intnum/den, 1<<24);
-}
-
-int64_t av_get_int(void *obj, const char *name, const AVOption **o_out){
- int64_t intnum=1;
- double num=1;
- int den=1;
-
- av_get_number(obj, name, o_out, &num, &den, &intnum);
- return num*intnum/den;
-}
-
-static void opt_list(void *obj, void *av_log_obj, const char *unit)
-{
- const AVOption *opt=NULL;
-
- while((opt= av_next_option(obj, opt))){
- if(!(opt->flags & (AV_OPT_FLAG_ENCODING_PARAM|AV_OPT_FLAG_DECODING_PARAM)))
- continue;
-
- /* Don't print CONST's on level one.
- * Don't print anything but CONST's on level two.
- * Only print items from the requested unit.
- */
- if (!unit && opt->type==FF_OPT_TYPE_CONST)
- continue;
- else if (unit && opt->type!=FF_OPT_TYPE_CONST)
- continue;
- else if (unit && opt->type==FF_OPT_TYPE_CONST && strcmp(unit, opt->unit))
- continue;
- else if (unit && opt->type == FF_OPT_TYPE_CONST)
- av_log(av_log_obj, AV_LOG_INFO, " %-15s ", opt->name);
- else
- av_log(av_log_obj, AV_LOG_INFO, "-%-17s ", opt->name);
-
- switch( opt->type )
- {
- case FF_OPT_TYPE_FLAGS:
- av_log( av_log_obj, AV_LOG_INFO, "%-7s ", "<flags>" );
- break;
- case FF_OPT_TYPE_INT:
- av_log( av_log_obj, AV_LOG_INFO, "%-7s ", "<int>" );
- break;
- case FF_OPT_TYPE_INT64:
- av_log( av_log_obj, AV_LOG_INFO, "%-7s ", "<int64>" );
- break;
- case FF_OPT_TYPE_DOUBLE:
- av_log( av_log_obj, AV_LOG_INFO, "%-7s ", "<double>" );
- break;
- case FF_OPT_TYPE_FLOAT:
- av_log( av_log_obj, AV_LOG_INFO, "%-7s ", "<float>" );
- break;
- case FF_OPT_TYPE_STRING:
- av_log( av_log_obj, AV_LOG_INFO, "%-7s ", "<string>" );
- break;
- case FF_OPT_TYPE_RATIONAL:
- av_log( av_log_obj, AV_LOG_INFO, "%-7s ", "<rational>" );
- break;
- case FF_OPT_TYPE_CONST:
- default:
- av_log( av_log_obj, AV_LOG_INFO, "%-7s ", "" );
- break;
- }
- av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_ENCODING_PARAM) ? 'E' : '.');
- av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_DECODING_PARAM) ? 'D' : '.');
- av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_VIDEO_PARAM ) ? 'V' : '.');
- av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_AUDIO_PARAM ) ? 'A' : '.');
- av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_SUBTITLE_PARAM) ? 'S' : '.');
-
- if(opt->help)
- av_log(av_log_obj, AV_LOG_INFO, " %s", opt->help);
- av_log(av_log_obj, AV_LOG_INFO, "\n");
- if (opt->unit && opt->type != FF_OPT_TYPE_CONST) {
- opt_list(obj, av_log_obj, opt->unit);
- }
- }
-}
-
-int av_opt_show(void *obj, void *av_log_obj){
- if(!obj)
- return -1;
-
- av_log(av_log_obj, AV_LOG_INFO, "%s AVOptions:\n", (*(AVClass**)obj)->class_name);
-
- opt_list(obj, av_log_obj, NULL);
-
- return 0;
-}
-
-/** Set the values of the AVCodecContext or AVFormatContext structure.
- * They are set to the defaults specified in the according AVOption options
- * array default_val field.
- *
- * @param s AVCodecContext or AVFormatContext for which the defaults will be set
- */
-void av_opt_set_defaults(void *s)
-{
- const AVOption *opt = NULL;
- while ((opt = av_next_option(s, opt)) != NULL) {
- switch(opt->type) {
- case FF_OPT_TYPE_CONST:
- /* Nothing to be done here */
- break;
- case FF_OPT_TYPE_FLAGS:
- case FF_OPT_TYPE_INT: {
- int val;
- val = opt->default_val;
- av_set_int(s, opt->name, val);
- }
- break;
- case FF_OPT_TYPE_FLOAT: {
- double val;
- val = opt->default_val;
- av_set_double(s, opt->name, val);
- }
- break;
- case FF_OPT_TYPE_RATIONAL: {
- AVRational val;
- val = av_d2q(opt->default_val, INT_MAX);
- av_set_q(s, opt->name, val);
- }
- break;
- case FF_OPT_TYPE_STRING:
- /* Cannot set default for string as default_val is of type * double */
- break;
- default:
- av_log(s, AV_LOG_DEBUG, "AVOption type %d of option %s not implemented yet\n", opt->type, opt->name);
- }
- }
-}
-
diff --git a/src/libffmpeg/libavcodec/opt.h b/src/libffmpeg/libavcodec/opt.h
deleted file mode 100644
index ff65456d8..000000000
--- a/src/libffmpeg/libavcodec/opt.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * AVOptions
- * copyright (c) 2005 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVOPT_H
-#define AVOPT_H
-
-/**
- * @file opt.h
- * AVOptions
- */
-
-enum AVOptionType{
- FF_OPT_TYPE_FLAGS,
- FF_OPT_TYPE_INT,
- FF_OPT_TYPE_INT64,
- FF_OPT_TYPE_DOUBLE,
- FF_OPT_TYPE_FLOAT,
- FF_OPT_TYPE_STRING,
- FF_OPT_TYPE_RATIONAL,
- FF_OPT_TYPE_CONST=128,
-};
-
-/**
- * AVOption.
- */
-typedef struct AVOption {
- const char *name;
-
- /**
- * short English text help.
- * @fixme what about other languages
- */
- const char *help;
- int offset; ///< offset to context structure where the parsed value should be stored
- enum AVOptionType type;
-
- double default_val;
- double min;
- double max;
-
- int flags;
-#define AV_OPT_FLAG_ENCODING_PARAM 1 ///< a generic parameter which can be set by the user for muxing or encoding
-#define AV_OPT_FLAG_DECODING_PARAM 2 ///< a generic parameter which can be set by the user for demuxing or decoding
-#define AV_OPT_FLAG_METADATA 4 ///< some data extracted or inserted into the file like title, comment, ...
-#define AV_OPT_FLAG_AUDIO_PARAM 8
-#define AV_OPT_FLAG_VIDEO_PARAM 16
-#define AV_OPT_FLAG_SUBTITLE_PARAM 32
-//FIXME think about enc-audio, ... style flags
- const char *unit;
-} AVOption;
-
-
-const AVOption *av_set_string(void *obj, const char *name, const char *val);
-const AVOption *av_set_double(void *obj, const char *name, double n);
-const AVOption *av_set_q(void *obj, const char *name, AVRational n);
-const AVOption *av_set_int(void *obj, const char *name, int64_t n);
-double av_get_double(void *obj, const char *name, const AVOption **o_out);
-AVRational av_get_q(void *obj, const char *name, const AVOption **o_out);
-int64_t av_get_int(void *obj, const char *name, const AVOption **o_out);
-const char *av_get_string(void *obj, const char *name, const AVOption **o_out, char *buf, int buf_len);
-const AVOption *av_next_option(void *obj, const AVOption *last);
-int av_opt_show(void *obj, void *av_log_obj);
-void av_opt_set_defaults(void *s);
-
-#endif
diff --git a/src/libffmpeg/libavcodec/parser.c b/src/libffmpeg/libavcodec/parser.c
deleted file mode 100644
index 62a95c1a4..000000000
--- a/src/libffmpeg/libavcodec/parser.c
+++ /dev/null
@@ -1,902 +0,0 @@
-/*
- * Audio and Video frame extraction
- * Copyright (c) 2003 Fabrice Bellard.
- * Copyright (c) 2003 Michael Niedermayer.
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "avcodec.h"
-#include "mpegvideo.h"
-#include "mpegaudio.h"
-#include "parser.h"
-
-AVCodecParser *av_first_parser = NULL;
-
-void av_register_codec_parser(AVCodecParser *parser)
-{
- parser->next = av_first_parser;
- av_first_parser = parser;
-}
-
-AVCodecParserContext *av_parser_init(int codec_id)
-{
- AVCodecParserContext *s;
- AVCodecParser *parser;
- int ret;
-
- if(codec_id == CODEC_ID_NONE)
- return NULL;
-
- for(parser = av_first_parser; parser != NULL; parser = parser->next) {
- if (parser->codec_ids[0] == codec_id ||
- parser->codec_ids[1] == codec_id ||
- parser->codec_ids[2] == codec_id ||
- parser->codec_ids[3] == codec_id ||
- parser->codec_ids[4] == codec_id)
- goto found;
- }
- return NULL;
- found:
- s = av_mallocz(sizeof(AVCodecParserContext));
- if (!s)
- return NULL;
- s->parser = parser;
- s->priv_data = av_mallocz(parser->priv_data_size);
- if (!s->priv_data) {
- av_free(s);
- return NULL;
- }
- if (parser->parser_init) {
- ret = parser->parser_init(s);
- if (ret != 0) {
- av_free(s->priv_data);
- av_free(s);
- return NULL;
- }
- }
- s->fetch_timestamp=1;
- return s;
-}
-
-/**
- *
- * @param buf input
- * @param buf_size input length, to signal EOF, this should be 0 (so that the last frame can be output)
- * @param pts input presentation timestamp
- * @param dts input decoding timestamp
- * @param poutbuf will contain a pointer to the first byte of the output frame
- * @param poutbuf_size will contain the length of the output frame
- * @return the number of bytes of the input bitstream used
- *
- * Example:
- * @code
- * while(in_len){
- * len = av_parser_parse(myparser, AVCodecContext, &data, &size,
- * in_data, in_len,
- * pts, dts);
- * in_data += len;
- * in_len -= len;
- *
- * if(size)
- * decode_frame(data, size);
- * }
- * @endcode
- */
-int av_parser_parse(AVCodecParserContext *s,
- AVCodecContext *avctx,
- uint8_t **poutbuf, int *poutbuf_size,
- const uint8_t *buf, int buf_size,
- int64_t pts, int64_t dts)
-{
- int index, i, k;
- uint8_t dummy_buf[FF_INPUT_BUFFER_PADDING_SIZE];
-
- if (buf_size == 0) {
- /* padding is always necessary even if EOF, so we add it here */
- memset(dummy_buf, 0, sizeof(dummy_buf));
- buf = dummy_buf;
- } else {
- /* add a new packet descriptor */
- k = (s->cur_frame_start_index + 1) & (AV_PARSER_PTS_NB - 1);
- s->cur_frame_start_index = k;
- s->cur_frame_offset[k] = s->cur_offset;
- s->cur_frame_pts[k] = pts;
- s->cur_frame_dts[k] = dts;
-
- /* fill first PTS/DTS */
- if (s->fetch_timestamp){
- s->fetch_timestamp=0;
- s->last_pts = pts;
- s->last_dts = dts;
- s->cur_frame_pts[k] =
- s->cur_frame_dts[k] = AV_NOPTS_VALUE;
- }
- }
-
- /* WARNING: the returned index can be negative */
- index = s->parser->parser_parse(s, avctx, poutbuf, poutbuf_size, buf, buf_size);
-//av_log(NULL, AV_LOG_DEBUG, "parser: in:%"PRId64", %"PRId64", out:%"PRId64", %"PRId64", in:%d out:%d id:%d\n", pts, dts, s->last_pts, s->last_dts, buf_size, *poutbuf_size, avctx->codec_id);
- /* update the file pointer */
- if (*poutbuf_size) {
- /* fill the data for the current frame */
- s->frame_offset = s->last_frame_offset;
- s->pts = s->last_pts;
- s->dts = s->last_dts;
-
- /* offset of the next frame */
- s->last_frame_offset = s->cur_offset + index;
- /* find the packet in which the new frame starts. It
- is tricky because of MPEG video start codes
- which can begin in one packet and finish in
- another packet. In the worst case, an MPEG
- video start code could be in 4 different
- packets. */
- k = s->cur_frame_start_index;
- for(i = 0; i < AV_PARSER_PTS_NB; i++) {
- if (s->last_frame_offset >= s->cur_frame_offset[k])
- break;
- k = (k - 1) & (AV_PARSER_PTS_NB - 1);
- }
-
- s->last_pts = s->cur_frame_pts[k];
- s->last_dts = s->cur_frame_dts[k];
-
- /* some parsers tell us the packet size even before seeing the first byte of the next packet,
- so the next pts/dts is in the next chunk */
- if(index == buf_size){
- s->fetch_timestamp=1;
- }
- }
- if (index < 0)
- index = 0;
- s->cur_offset += index;
- return index;
-}
-
-/**
- *
- * @return 0 if the output buffer is a subset of the input, 1 if it is allocated and must be freed
- * @deprecated use AVBitstreamFilter
- */
-int av_parser_change(AVCodecParserContext *s,
- AVCodecContext *avctx,
- uint8_t **poutbuf, int *poutbuf_size,
- const uint8_t *buf, int buf_size, int keyframe){
-
- if(s && s->parser->split){
- if((avctx->flags & CODEC_FLAG_GLOBAL_HEADER) || (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER)){
- int i= s->parser->split(avctx, buf, buf_size);
- buf += i;
- buf_size -= i;
- }
- }
-
- /* cast to avoid warning about discarding qualifiers */
- *poutbuf= (uint8_t *) buf;
- *poutbuf_size= buf_size;
- if(avctx->extradata){
- if( (keyframe && (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER))
- /*||(s->pict_type != I_TYPE && (s->flags & PARSER_FLAG_DUMP_EXTRADATA_AT_NOKEY))*/
- /*||(? && (s->flags & PARSER_FLAG_DUMP_EXTRADATA_AT_BEGIN)*/){
- int size= buf_size + avctx->extradata_size;
- *poutbuf_size= size;
- *poutbuf= av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
-
- memcpy(*poutbuf, avctx->extradata, avctx->extradata_size);
- memcpy((*poutbuf) + avctx->extradata_size, buf, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
- return 1;
- }
- }
-
- return 0;
-}
-
-void av_parser_close(AVCodecParserContext *s)
-{
- if (s->parser->parser_close)
- s->parser->parser_close(s);
- av_free(s->priv_data);
- av_free(s);
-}
-
-/*****************************************************/
-
-/**
- * combines the (truncated) bitstream to a complete frame
- * @returns -1 if no complete frame could be created
- */
-int ff_combine_frame(ParseContext *pc, int next, uint8_t **buf, int *buf_size)
-{
-#if 0
- if(pc->overread){
- printf("overread %d, state:%X next:%d index:%d o_index:%d\n", pc->overread, pc->state, next, pc->index, pc->overread_index);
- printf("%X %X %X %X\n", (*buf)[0], (*buf)[1],(*buf)[2],(*buf)[3]);
- }
-#endif
-
- /* copy overreaded bytes from last frame into buffer */
- for(; pc->overread>0; pc->overread--){
- pc->buffer[pc->index++]= pc->buffer[pc->overread_index++];
- }
-
- /* flush remaining if EOF */
- if(!*buf_size && next == END_NOT_FOUND){
- next= 0;
- }
-
- pc->last_index= pc->index;
-
- /* copy into buffer end return */
- if(next == END_NOT_FOUND){
- pc->buffer= av_fast_realloc(pc->buffer, &pc->buffer_size, (*buf_size) + pc->index + FF_INPUT_BUFFER_PADDING_SIZE);
-
- memcpy(&pc->buffer[pc->index], *buf, *buf_size);
- pc->index += *buf_size;
- return -1;
- }
-
- *buf_size=
- pc->overread_index= pc->index + next;
-
- /* append to buffer */
- if(pc->index){
- pc->buffer= av_fast_realloc(pc->buffer, &pc->buffer_size, next + pc->index + FF_INPUT_BUFFER_PADDING_SIZE);
-
- memcpy(&pc->buffer[pc->index], *buf, next + FF_INPUT_BUFFER_PADDING_SIZE );
- pc->index = 0;
- *buf= pc->buffer;
- }
-
- /* store overread bytes */
- for(;next < 0; next++){
- pc->state = (pc->state<<8) | pc->buffer[pc->last_index + next];
- pc->overread++;
- }
-
-#if 0
- if(pc->overread){
- printf("overread %d, state:%X next:%d index:%d o_index:%d\n", pc->overread, pc->state, next, pc->index, pc->overread_index);
- printf("%X %X %X %X\n", (*buf)[0], (*buf)[1],(*buf)[2],(*buf)[3]);
- }
-#endif
-
- return 0;
-}
-
-void ff_parse_close(AVCodecParserContext *s)
-{
- ParseContext *pc = s->priv_data;
-
- av_free(pc->buffer);
-}
-
-void ff_parse1_close(AVCodecParserContext *s)
-{
- ParseContext1 *pc1 = s->priv_data;
-
- av_free(pc1->pc.buffer);
- av_free(pc1->enc);
-}
-
-/*************************/
-
-#ifdef CONFIG_MPEG4VIDEO_PARSER
-/* used by parser */
-/* XXX: make it use less memory */
-static int av_mpeg4_decode_header(AVCodecParserContext *s1,
- AVCodecContext *avctx,
- const uint8_t *buf, int buf_size)
-{
- ParseContext1 *pc = s1->priv_data;
- MpegEncContext *s = pc->enc;
- GetBitContext gb1, *gb = &gb1;
- int ret;
-
- s->avctx = avctx;
- s->current_picture_ptr = &s->current_picture;
-
- if (avctx->extradata_size && pc->first_picture){
- init_get_bits(gb, avctx->extradata, avctx->extradata_size*8);
- ret = ff_mpeg4_decode_picture_header(s, gb);
- }
-
- init_get_bits(gb, buf, 8 * buf_size);
- ret = ff_mpeg4_decode_picture_header(s, gb);
- if (s->width) {
- avcodec_set_dimensions(avctx, s->width, s->height);
- }
- s1->pict_type= s->pict_type;
- pc->first_picture = 0;
- return ret;
-}
-
-static int mpeg4video_parse_init(AVCodecParserContext *s)
-{
- ParseContext1 *pc = s->priv_data;
-
- pc->enc = av_mallocz(sizeof(MpegEncContext));
- if (!pc->enc)
- return -1;
- pc->first_picture = 1;
- return 0;
-}
-
-static int mpeg4video_parse(AVCodecParserContext *s,
- AVCodecContext *avctx,
- uint8_t **poutbuf, int *poutbuf_size,
- const uint8_t *buf, int buf_size)
-{
- ParseContext *pc = s->priv_data;
- int next;
-
- if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){
- next= buf_size;
- }else{
- next= ff_mpeg4_find_frame_end(pc, buf, buf_size);
-
- if (ff_combine_frame(pc, next, (uint8_t **)&buf, &buf_size) < 0) {
- *poutbuf = NULL;
- *poutbuf_size = 0;
- return buf_size;
- }
- }
- av_mpeg4_decode_header(s, avctx, buf, buf_size);
-
- *poutbuf = (uint8_t *)buf;
- *poutbuf_size = buf_size;
- return next;
-}
-#endif
-
-int ff_mpeg4video_split(AVCodecContext *avctx,
- const uint8_t *buf, int buf_size)
-{
- int i;
- uint32_t state= -1;
-
- for(i=0; i<buf_size; i++){
- state= (state<<8) | buf[i];
- if(state == 0x1B3 || state == 0x1B6)
- return i-3;
- }
- return 0;
-}
-
-/*************************/
-
-#ifdef CONFIG_MPEGAUDIO_PARSER
-typedef struct MpegAudioParseContext {
- uint8_t inbuf[MPA_MAX_CODED_FRAME_SIZE]; /* input buffer */
- uint8_t *inbuf_ptr;
- int frame_size;
- int free_format_frame_size;
- int free_format_next_header;
- uint32_t header;
- int header_count;
-} MpegAudioParseContext;
-
-#define MPA_HEADER_SIZE 4
-
-/* header + layer + bitrate + freq + lsf/mpeg25 */
-#undef SAME_HEADER_MASK /* mpegaudio.h defines different version */
-#define SAME_HEADER_MASK \
- (0xffe00000 | (3 << 17) | (3 << 10) | (3 << 19))
-
-static int mpegaudio_parse_init(AVCodecParserContext *s1)
-{
- MpegAudioParseContext *s = s1->priv_data;
- s->inbuf_ptr = s->inbuf;
- return 0;
-}
-
-static int mpegaudio_parse(AVCodecParserContext *s1,
- AVCodecContext *avctx,
- uint8_t **poutbuf, int *poutbuf_size,
- const uint8_t *buf, int buf_size)
-{
- MpegAudioParseContext *s = s1->priv_data;
- int len, ret, sr;
- uint32_t header;
- const uint8_t *buf_ptr;
-
- *poutbuf = NULL;
- *poutbuf_size = 0;
- buf_ptr = buf;
- while (buf_size > 0) {
- len = s->inbuf_ptr - s->inbuf;
- if (s->frame_size == 0) {
- /* special case for next header for first frame in free
- format case (XXX: find a simpler method) */
- if (s->free_format_next_header != 0) {
- s->inbuf[0] = s->free_format_next_header >> 24;
- s->inbuf[1] = s->free_format_next_header >> 16;
- s->inbuf[2] = s->free_format_next_header >> 8;
- s->inbuf[3] = s->free_format_next_header;
- s->inbuf_ptr = s->inbuf + 4;
- s->free_format_next_header = 0;
- goto got_header;
- }
- /* no header seen : find one. We need at least MPA_HEADER_SIZE
- bytes to parse it */
- len = FFMIN(MPA_HEADER_SIZE - len, buf_size);
- if (len > 0) {
- memcpy(s->inbuf_ptr, buf_ptr, len);
- buf_ptr += len;
- buf_size -= len;
- s->inbuf_ptr += len;
- }
- if ((s->inbuf_ptr - s->inbuf) >= MPA_HEADER_SIZE) {
- got_header:
- header = (s->inbuf[0] << 24) | (s->inbuf[1] << 16) |
- (s->inbuf[2] << 8) | s->inbuf[3];
-
- ret = mpa_decode_header(avctx, header, &sr);
- if (ret < 0) {
- s->header_count= -2;
- /* no sync found : move by one byte (inefficient, but simple!) */
- memmove(s->inbuf, s->inbuf + 1, s->inbuf_ptr - s->inbuf - 1);
- s->inbuf_ptr--;
- dprintf("skip %x\n", header);
- /* reset free format frame size to give a chance
- to get a new bitrate */
- s->free_format_frame_size = 0;
- } else {
- if((header&SAME_HEADER_MASK) != (s->header&SAME_HEADER_MASK) && s->header)
- s->header_count= -3;
- s->header= header;
- s->header_count++;
- s->frame_size = ret;
-
-#if 0
- /* free format: prepare to compute frame size */
- if (decode_header(s, header) == 1) {
- s->frame_size = -1;
- }
-#endif
- }
- if(s->header_count > 1)
- avctx->sample_rate= sr;
- }
- } else
-#if 0
- if (s->frame_size == -1) {
- /* free format : find next sync to compute frame size */
- len = MPA_MAX_CODED_FRAME_SIZE - len;
- if (len > buf_size)
- len = buf_size;
- if (len == 0) {
- /* frame too long: resync */
- s->frame_size = 0;
- memmove(s->inbuf, s->inbuf + 1, s->inbuf_ptr - s->inbuf - 1);
- s->inbuf_ptr--;
- } else {
- uint8_t *p, *pend;
- uint32_t header1;
- int padding;
-
- memcpy(s->inbuf_ptr, buf_ptr, len);
- /* check for header */
- p = s->inbuf_ptr - 3;
- pend = s->inbuf_ptr + len - 4;
- while (p <= pend) {
- header = (p[0] << 24) | (p[1] << 16) |
- (p[2] << 8) | p[3];
- header1 = (s->inbuf[0] << 24) | (s->inbuf[1] << 16) |
- (s->inbuf[2] << 8) | s->inbuf[3];
- /* check with high probability that we have a
- valid header */
- if ((header & SAME_HEADER_MASK) ==
- (header1 & SAME_HEADER_MASK)) {
- /* header found: update pointers */
- len = (p + 4) - s->inbuf_ptr;
- buf_ptr += len;
- buf_size -= len;
- s->inbuf_ptr = p;
- /* compute frame size */
- s->free_format_next_header = header;
- s->free_format_frame_size = s->inbuf_ptr - s->inbuf;
- padding = (header1 >> 9) & 1;
- if (s->layer == 1)
- s->free_format_frame_size -= padding * 4;
- else
- s->free_format_frame_size -= padding;
- dprintf("free frame size=%d padding=%d\n",
- s->free_format_frame_size, padding);
- decode_header(s, header1);
- goto next_data;
- }
- p++;
- }
- /* not found: simply increase pointers */
- buf_ptr += len;
- s->inbuf_ptr += len;
- buf_size -= len;
- }
- } else
-#endif
- if (len < s->frame_size) {
- if (s->frame_size > MPA_MAX_CODED_FRAME_SIZE)
- s->frame_size = MPA_MAX_CODED_FRAME_SIZE;
- len = FFMIN(s->frame_size - len, buf_size);
- memcpy(s->inbuf_ptr, buf_ptr, len);
- buf_ptr += len;
- s->inbuf_ptr += len;
- buf_size -= len;
- }
-
- if(s->frame_size > 0 && buf_ptr - buf == s->inbuf_ptr - s->inbuf
- && buf_size + buf_ptr - buf >= s->frame_size){
- if(s->header_count > 0){
- *poutbuf = buf;
- *poutbuf_size = s->frame_size;
- }
- buf_ptr = buf + s->frame_size;
- s->inbuf_ptr = s->inbuf;
- s->frame_size = 0;
- break;
- }
-
- // next_data:
- if (s->frame_size > 0 &&
- (s->inbuf_ptr - s->inbuf) >= s->frame_size) {
- if(s->header_count > 0){
- *poutbuf = s->inbuf;
- *poutbuf_size = s->inbuf_ptr - s->inbuf;
- }
- s->inbuf_ptr = s->inbuf;
- s->frame_size = 0;
- break;
- }
- }
- return buf_ptr - buf;
-}
-#endif /* CONFIG_MPEGAUDIO_PARSER */
-
-#if defined(CONFIG_AC3_PARSER) || defined(CONFIG_AAC_PARSER)
-/* also used for ADTS AAC */
-typedef struct AC3ParseContext {
- uint8_t *inbuf_ptr;
- int frame_size;
- int header_size;
- int (*sync)(const uint8_t *buf, int *channels, int *sample_rate,
- int *bit_rate, int *samples);
- uint8_t inbuf[8192]; /* input buffer */
-} AC3ParseContext;
-
-#define AC3_HEADER_SIZE 7
-#define AAC_HEADER_SIZE 7
-
-#ifdef CONFIG_AC3_PARSER
-static const int ac3_sample_rates[4] = {
- 48000, 44100, 32000, 0
-};
-
-static const int ac3_frame_sizes[64][3] = {
- { 64, 69, 96 },
- { 64, 70, 96 },
- { 80, 87, 120 },
- { 80, 88, 120 },
- { 96, 104, 144 },
- { 96, 105, 144 },
- { 112, 121, 168 },
- { 112, 122, 168 },
- { 128, 139, 192 },
- { 128, 140, 192 },
- { 160, 174, 240 },
- { 160, 175, 240 },
- { 192, 208, 288 },
- { 192, 209, 288 },
- { 224, 243, 336 },
- { 224, 244, 336 },
- { 256, 278, 384 },
- { 256, 279, 384 },
- { 320, 348, 480 },
- { 320, 349, 480 },
- { 384, 417, 576 },
- { 384, 418, 576 },
- { 448, 487, 672 },
- { 448, 488, 672 },
- { 512, 557, 768 },
- { 512, 558, 768 },
- { 640, 696, 960 },
- { 640, 697, 960 },
- { 768, 835, 1152 },
- { 768, 836, 1152 },
- { 896, 975, 1344 },
- { 896, 976, 1344 },
- { 1024, 1114, 1536 },
- { 1024, 1115, 1536 },
- { 1152, 1253, 1728 },
- { 1152, 1254, 1728 },
- { 1280, 1393, 1920 },
- { 1280, 1394, 1920 },
-};
-
-static const int ac3_bitrates[64] = {
- 32, 32, 40, 40, 48, 48, 56, 56, 64, 64, 80, 80, 96, 96, 112, 112,
- 128, 128, 160, 160, 192, 192, 224, 224, 256, 256, 320, 320, 384,
- 384, 448, 448, 512, 512, 576, 576, 640, 640,
-};
-
-static const uint8_t ac3_channels[8] = {
- 2, 1, 2, 3, 3, 4, 4, 5
-};
-
-static const uint8_t eac3_blocks[4] = {
- 1, 2, 3, 6
-};
-
-#endif /* CONFIG_AC3_PARSER */
-
-#ifdef CONFIG_AAC_PARSER
-static const int aac_sample_rates[16] = {
- 96000, 88200, 64000, 48000, 44100, 32000,
- 24000, 22050, 16000, 12000, 11025, 8000, 7350
-};
-
-static const int aac_channels[8] = {
- 0, 1, 2, 3, 4, 5, 6, 8
-};
-#endif
-
-#ifdef CONFIG_AC3_PARSER
-static int ac3_sync(const uint8_t *buf, int *channels, int *sample_rate,
- int *bit_rate, int *samples)
-{
- unsigned int fscod, frmsizecod, acmod, bsid, lfeon;
- unsigned int strmtyp, substreamid, frmsiz, fscod2, numblkscod;
- GetBitContext bits;
-
- init_get_bits(&bits, buf, AC3_HEADER_SIZE * 8);
-
- if(get_bits(&bits, 16) != 0x0b77)
- return 0;
-
- bsid = show_bits_long(&bits, 29) & 0x1f;
- if(bsid <= 8) { /* Normal AC-3 */
- skip_bits(&bits, 16); /* crc */
- fscod = get_bits(&bits, 2);
- frmsizecod = get_bits(&bits, 6);
-
- if(fscod == 3)
- return 0;
-
- skip_bits(&bits, 5); /* bsid */
- skip_bits(&bits, 3); /* bsmod */
- acmod = get_bits(&bits, 3);
- if(acmod & 1 && acmod != 1)
- skip_bits(&bits, 2); /* cmixlev */
- if(acmod & 4)
- skip_bits(&bits, 2); /* surmixlev */
- if(acmod & 2)
- skip_bits(&bits, 2); /* dsurmod */
- lfeon = get_bits1(&bits);
-
- *sample_rate = ac3_sample_rates[fscod];
- *bit_rate = ac3_bitrates[frmsizecod] * 1000;
- *channels = ac3_channels[acmod] + lfeon;
- *samples = 6 * 256;
-
- return ac3_frame_sizes[frmsizecod][fscod] * 2;
- } else if (bsid >= 10 && bsid <= 16) { /* Enhanced AC-3 */
- strmtyp = get_bits(&bits, 2);
- substreamid = get_bits(&bits, 3);
-
- if (strmtyp != 0 || substreamid != 0)
- return 0; /* Currently don't support additional streams */
-
- frmsiz = get_bits(&bits, 11) + 1;
- fscod = get_bits(&bits, 2);
- if (fscod == 3) {
- fscod2 = get_bits(&bits, 2);
- numblkscod = 3;
-
- if(fscod2 == 3)
- return 0;
-
- *sample_rate = ac3_sample_rates[fscod2] / 2;
- } else {
- numblkscod = get_bits(&bits, 2);
-
- *sample_rate = ac3_sample_rates[fscod];
- }
-
- acmod = get_bits(&bits, 3);
- lfeon = get_bits1(&bits);
-
- *samples = eac3_blocks[numblkscod] * 256;
- *bit_rate = frmsiz * (*sample_rate) * 16 / (*samples);
- *channels = ac3_channels[acmod] + lfeon;
-
- return frmsiz * 2;
- }
-
- /* Unsupported bitstream version */
- return 0;
-}
-#endif /* CONFIG_AC3_PARSER */
-
-#ifdef CONFIG_AAC_PARSER
-static int aac_sync(const uint8_t *buf, int *channels, int *sample_rate,
- int *bit_rate, int *samples)
-{
- GetBitContext bits;
- int size, rdb, ch, sr;
-
- init_get_bits(&bits, buf, AAC_HEADER_SIZE * 8);
-
- if(get_bits(&bits, 12) != 0xfff)
- return 0;
-
- skip_bits1(&bits); /* id */
- skip_bits(&bits, 2); /* layer */
- skip_bits1(&bits); /* protection_absent */
- skip_bits(&bits, 2); /* profile_objecttype */
- sr = get_bits(&bits, 4); /* sample_frequency_index */
- if(!aac_sample_rates[sr])
- return 0;
- skip_bits1(&bits); /* private_bit */
- ch = get_bits(&bits, 3); /* channel_configuration */
- if(!aac_channels[ch])
- return 0;
- skip_bits1(&bits); /* original/copy */
- skip_bits1(&bits); /* home */
-
- /* adts_variable_header */
- skip_bits1(&bits); /* copyright_identification_bit */
- skip_bits1(&bits); /* copyright_identification_start */
- size = get_bits(&bits, 13); /* aac_frame_length */
- skip_bits(&bits, 11); /* adts_buffer_fullness */
- rdb = get_bits(&bits, 2); /* number_of_raw_data_blocks_in_frame */
-
- *channels = aac_channels[ch];
- *sample_rate = aac_sample_rates[sr];
- *samples = (rdb + 1) * 1024;
- *bit_rate = size * 8 * *sample_rate / *samples;
-
- return size;
-}
-#endif /* CONFIG_AAC_PARSER */
-
-#ifdef CONFIG_AC3_PARSER
-static int ac3_parse_init(AVCodecParserContext *s1)
-{
- AC3ParseContext *s = s1->priv_data;
- s->inbuf_ptr = s->inbuf;
- s->header_size = AC3_HEADER_SIZE;
- s->sync = ac3_sync;
- return 0;
-}
-#endif
-
-#ifdef CONFIG_AAC_PARSER
-static int aac_parse_init(AVCodecParserContext *s1)
-{
- AC3ParseContext *s = s1->priv_data;
- s->inbuf_ptr = s->inbuf;
- s->header_size = AAC_HEADER_SIZE;
- s->sync = aac_sync;
- return 0;
-}
-#endif
-
-/* also used for ADTS AAC */
-static int ac3_parse(AVCodecParserContext *s1,
- AVCodecContext *avctx,
- uint8_t **poutbuf, int *poutbuf_size,
- const uint8_t *buf, int buf_size)
-{
- AC3ParseContext *s = s1->priv_data;
- const uint8_t *buf_ptr;
- int len, sample_rate, bit_rate, channels, samples;
-
- *poutbuf = NULL;
- *poutbuf_size = 0;
-
- buf_ptr = buf;
- while (buf_size > 0) {
- len = s->inbuf_ptr - s->inbuf;
- if (s->frame_size == 0) {
- /* no header seen : find one. We need at least s->header_size
- bytes to parse it */
- len = FFMIN(s->header_size - len, buf_size);
-
- memcpy(s->inbuf_ptr, buf_ptr, len);
- buf_ptr += len;
- s->inbuf_ptr += len;
- buf_size -= len;
- if ((s->inbuf_ptr - s->inbuf) == s->header_size) {
- len = s->sync(s->inbuf, &channels, &sample_rate, &bit_rate,
- &samples);
- if (len == 0) {
- /* no sync found : move by one byte (inefficient, but simple!) */
- memmove(s->inbuf, s->inbuf + 1, s->header_size - 1);
- s->inbuf_ptr--;
- } else {
- s->frame_size = len;
- /* update codec info */
- avctx->sample_rate = sample_rate;
- /* set channels,except if the user explicitly requests 1 or 2 channels, XXX/FIXME this is a bit ugly */
- if(avctx->codec_id == CODEC_ID_AC3){
- if(avctx->channels!=1 && avctx->channels!=2){
- avctx->channels = channels;
- }
- } else {
- avctx->channels = channels;
- }
- avctx->bit_rate = bit_rate;
- avctx->frame_size = samples;
- }
- }
- } else {
- len = FFMIN(s->frame_size - len, buf_size);
-
- memcpy(s->inbuf_ptr, buf_ptr, len);
- buf_ptr += len;
- s->inbuf_ptr += len;
- buf_size -= len;
-
- if(s->inbuf_ptr - s->inbuf == s->frame_size){
- *poutbuf = s->inbuf;
- *poutbuf_size = s->frame_size;
- s->inbuf_ptr = s->inbuf;
- s->frame_size = 0;
- break;
- }
- }
- }
- return buf_ptr - buf;
-}
-#endif /* CONFIG_AC3_PARSER || CONFIG_AAC_PARSER */
-
-#ifdef CONFIG_MPEG4VIDEO_PARSER
-AVCodecParser mpeg4video_parser = {
- { CODEC_ID_MPEG4 },
- sizeof(ParseContext1),
- mpeg4video_parse_init,
- mpeg4video_parse,
- ff_parse1_close,
- ff_mpeg4video_split,
-};
-#endif
-#ifdef CONFIG_MPEGAUDIO_PARSER
-AVCodecParser mpegaudio_parser = {
- { CODEC_ID_MP2, CODEC_ID_MP3 },
- sizeof(MpegAudioParseContext),
- mpegaudio_parse_init,
- mpegaudio_parse,
- NULL,
-};
-#endif
-#ifdef CONFIG_AC3_PARSER
-AVCodecParser ac3_parser = {
- { CODEC_ID_AC3 },
- sizeof(AC3ParseContext),
- ac3_parse_init,
- ac3_parse,
- NULL,
-};
-#endif
-#ifdef CONFIG_AAC_PARSER
-AVCodecParser aac_parser = {
- { CODEC_ID_AAC },
- sizeof(AC3ParseContext),
- aac_parse_init,
- ac3_parse,
- NULL,
-};
-#endif
diff --git a/src/libffmpeg/libavcodec/parser.h b/src/libffmpeg/libavcodec/parser.h
deleted file mode 100644
index 3496b341f..000000000
--- a/src/libffmpeg/libavcodec/parser.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * AVCodecParser prototypes and definitions
- * Copyright (c) 2003 Fabrice Bellard.
- * Copyright (c) 2003 Michael Niedermayer.
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef FFMPEG_PARSER_H
-#define FFMPEG_PARSER_H
-
-typedef struct ParseContext{
- uint8_t *buffer;
- int index;
- int last_index;
- unsigned int buffer_size;
- uint32_t state; ///< contains the last few bytes in MSB order
- int frame_start_found;
- int overread; ///< the number of bytes which where irreversibly read from the next frame
- int overread_index; ///< the index into ParseContext.buffer of the overreaded bytes
-} ParseContext;
-
-struct MpegEncContext;
-
-typedef struct ParseContext1{
- ParseContext pc;
-/* XXX/FIXME PC1 vs. PC */
- /* MPEG2 specific */
- AVRational frame_rate;
- int progressive_sequence;
- int width, height;
-
- /* XXX: suppress that, needed by MPEG4 */
- struct MpegEncContext *enc;
- int first_picture;
-} ParseContext1;
-
-#define END_NOT_FOUND (-100)
-
-int ff_combine_frame(ParseContext *pc, int next, uint8_t **buf, int *buf_size);
-int ff_mpeg4video_split(AVCodecContext *avctx, const uint8_t *buf,
- int buf_size);
-void ff_parse_close(AVCodecParserContext *s);
-void ff_parse1_close(AVCodecParserContext *s);
-
-/* h263dec.c */
-int ff_mpeg4_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size);
-
-#endif /* !FFMPEG_PARSER_H */
diff --git a/src/libffmpeg/libavcodec/pcm.c b/src/libffmpeg/libavcodec/pcm.c
deleted file mode 100644
index 4011ed3b5..000000000
--- a/src/libffmpeg/libavcodec/pcm.c
+++ /dev/null
@@ -1,548 +0,0 @@
-/*
- * PCM codecs
- * Copyright (c) 2001 Fabrice Bellard.
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file pcm.c
- * PCM codecs
- */
-
-#include "avcodec.h"
-#include "bitstream.h" // for ff_reverse
-
-/* from g711.c by SUN microsystems (unrestricted use) */
-
-#define SIGN_BIT (0x80) /* Sign bit for a A-law byte. */
-#define QUANT_MASK (0xf) /* Quantization field mask. */
-#define NSEGS (8) /* Number of A-law segments. */
-#define SEG_SHIFT (4) /* Left shift for segment number. */
-#define SEG_MASK (0x70) /* Segment field mask. */
-
-#define BIAS (0x84) /* Bias for linear code. */
-
-/*
- * alaw2linear() - Convert an A-law value to 16-bit linear PCM
- *
- */
-static int alaw2linear(unsigned char a_val)
-{
- int t;
- int seg;
-
- a_val ^= 0x55;
-
- t = a_val & QUANT_MASK;
- seg = ((unsigned)a_val & SEG_MASK) >> SEG_SHIFT;
- if(seg) t= (t + t + 1 + 32) << (seg + 2);
- else t= (t + t + 1 ) << 3;
-
- return ((a_val & SIGN_BIT) ? t : -t);
-}
-
-static int ulaw2linear(unsigned char u_val)
-{
- int t;
-
- /* Complement to obtain normal u-law value. */
- u_val = ~u_val;
-
- /*
- * Extract and bias the quantization bits. Then
- * shift up by the segment number and subtract out the bias.
- */
- t = ((u_val & QUANT_MASK) << 3) + BIAS;
- t <<= ((unsigned)u_val & SEG_MASK) >> SEG_SHIFT;
-
- return ((u_val & SIGN_BIT) ? (BIAS - t) : (t - BIAS));
-}
-
-/* 16384 entries per table */
-static uint8_t *linear_to_alaw = NULL;
-static int linear_to_alaw_ref = 0;
-
-static uint8_t *linear_to_ulaw = NULL;
-static int linear_to_ulaw_ref = 0;
-
-static void build_xlaw_table(uint8_t *linear_to_xlaw,
- int (*xlaw2linear)(unsigned char),
- int mask)
-{
- int i, j, v, v1, v2;
-
- j = 0;
- for(i=0;i<128;i++) {
- if (i != 127) {
- v1 = xlaw2linear(i ^ mask);
- v2 = xlaw2linear((i + 1) ^ mask);
- v = (v1 + v2 + 4) >> 3;
- } else {
- v = 8192;
- }
- for(;j<v;j++) {
- linear_to_xlaw[8192 + j] = (i ^ mask);
- if (j > 0)
- linear_to_xlaw[8192 - j] = (i ^ (mask ^ 0x80));
- }
- }
- linear_to_xlaw[0] = linear_to_xlaw[1];
-}
-
-static int pcm_encode_init(AVCodecContext *avctx)
-{
- avctx->frame_size = 1;
- switch(avctx->codec->id) {
- case CODEC_ID_PCM_ALAW:
- if (linear_to_alaw_ref == 0) {
- linear_to_alaw = av_malloc(16384);
- if (!linear_to_alaw)
- return -1;
- build_xlaw_table(linear_to_alaw, alaw2linear, 0xd5);
- }
- linear_to_alaw_ref++;
- break;
- case CODEC_ID_PCM_MULAW:
- if (linear_to_ulaw_ref == 0) {
- linear_to_ulaw = av_malloc(16384);
- if (!linear_to_ulaw)
- return -1;
- build_xlaw_table(linear_to_ulaw, ulaw2linear, 0xff);
- }
- linear_to_ulaw_ref++;
- break;
- default:
- break;
- }
-
- switch(avctx->codec->id) {
- case CODEC_ID_PCM_S32LE:
- case CODEC_ID_PCM_S32BE:
- case CODEC_ID_PCM_U32LE:
- case CODEC_ID_PCM_U32BE:
- avctx->block_align = 4 * avctx->channels;
- break;
- case CODEC_ID_PCM_S24LE:
- case CODEC_ID_PCM_S24BE:
- case CODEC_ID_PCM_U24LE:
- case CODEC_ID_PCM_U24BE:
- case CODEC_ID_PCM_S24DAUD:
- avctx->block_align = 3 * avctx->channels;
- break;
- case CODEC_ID_PCM_S16LE:
- case CODEC_ID_PCM_S16BE:
- case CODEC_ID_PCM_U16LE:
- case CODEC_ID_PCM_U16BE:
- avctx->block_align = 2 * avctx->channels;
- break;
- case CODEC_ID_PCM_S8:
- case CODEC_ID_PCM_U8:
- case CODEC_ID_PCM_MULAW:
- case CODEC_ID_PCM_ALAW:
- avctx->block_align = avctx->channels;
- break;
- default:
- break;
- }
-
- avctx->coded_frame= avcodec_alloc_frame();
- avctx->coded_frame->key_frame= 1;
-
- return 0;
-}
-
-static int pcm_encode_close(AVCodecContext *avctx)
-{
- av_freep(&avctx->coded_frame);
-
- switch(avctx->codec->id) {
- case CODEC_ID_PCM_ALAW:
- if (--linear_to_alaw_ref == 0)
- av_free(linear_to_alaw);
- break;
- case CODEC_ID_PCM_MULAW:
- if (--linear_to_ulaw_ref == 0)
- av_free(linear_to_ulaw);
- break;
- default:
- /* nothing to free */
- break;
- }
- return 0;
-}
-
-/**
- * \brief convert samples from 16 bit
- * \param bps byte per sample for the destination format, must be >= 2
- * \param le 0 for big-, 1 for little-endian
- * \param us 0 for signed, 1 for unsigned output
- * \param samples input samples
- * \param dst output samples
- * \param n number of samples in samples buffer.
- */
-static inline void encode_from16(int bps, int le, int us,
- short **samples, uint8_t **dst, int n) {
- if (bps > 2)
- memset(*dst, 0, n * bps);
- if (le) *dst += bps - 2;
- for(;n>0;n--) {
- register int v = *(*samples)++;
- if (us) v += 0x8000;
- (*dst)[le] = v >> 8;
- (*dst)[1 - le] = v;
- *dst += bps;
- }
- if (le) *dst -= bps - 2;
-}
-
-static int pcm_encode_frame(AVCodecContext *avctx,
- unsigned char *frame, int buf_size, void *data)
-{
- int n, sample_size, v;
- short *samples;
- unsigned char *dst;
-
- switch(avctx->codec->id) {
- case CODEC_ID_PCM_S32LE:
- case CODEC_ID_PCM_S32BE:
- case CODEC_ID_PCM_U32LE:
- case CODEC_ID_PCM_U32BE:
- sample_size = 4;
- break;
- case CODEC_ID_PCM_S24LE:
- case CODEC_ID_PCM_S24BE:
- case CODEC_ID_PCM_U24LE:
- case CODEC_ID_PCM_U24BE:
- case CODEC_ID_PCM_S24DAUD:
- sample_size = 3;
- break;
- case CODEC_ID_PCM_S16LE:
- case CODEC_ID_PCM_S16BE:
- case CODEC_ID_PCM_U16LE:
- case CODEC_ID_PCM_U16BE:
- sample_size = 2;
- break;
- default:
- sample_size = 1;
- break;
- }
- n = buf_size / sample_size;
- samples = data;
- dst = frame;
-
- switch(avctx->codec->id) {
- case CODEC_ID_PCM_S32LE:
- encode_from16(4, 1, 0, &samples, &dst, n);
- break;
- case CODEC_ID_PCM_S32BE:
- encode_from16(4, 0, 0, &samples, &dst, n);
- break;
- case CODEC_ID_PCM_U32LE:
- encode_from16(4, 1, 1, &samples, &dst, n);
- break;
- case CODEC_ID_PCM_U32BE:
- encode_from16(4, 0, 1, &samples, &dst, n);
- break;
- case CODEC_ID_PCM_S24LE:
- encode_from16(3, 1, 0, &samples, &dst, n);
- break;
- case CODEC_ID_PCM_S24BE:
- encode_from16(3, 0, 0, &samples, &dst, n);
- break;
- case CODEC_ID_PCM_U24LE:
- encode_from16(3, 1, 1, &samples, &dst, n);
- break;
- case CODEC_ID_PCM_U24BE:
- encode_from16(3, 0, 1, &samples, &dst, n);
- break;
- case CODEC_ID_PCM_S24DAUD:
- for(;n>0;n--) {
- uint32_t tmp = ff_reverse[*samples >> 8] +
- (ff_reverse[*samples & 0xff] << 8);
- tmp <<= 4; // sync flags would go here
- dst[2] = tmp & 0xff;
- tmp >>= 8;
- dst[1] = tmp & 0xff;
- dst[0] = tmp >> 8;
- samples++;
- dst += 3;
- }
- break;
- case CODEC_ID_PCM_S16LE:
- for(;n>0;n--) {
- v = *samples++;
- dst[0] = v & 0xff;
- dst[1] = v >> 8;
- dst += 2;
- }
- break;
- case CODEC_ID_PCM_S16BE:
- for(;n>0;n--) {
- v = *samples++;
- dst[0] = v >> 8;
- dst[1] = v;
- dst += 2;
- }
- break;
- case CODEC_ID_PCM_U16LE:
- for(;n>0;n--) {
- v = *samples++;
- v += 0x8000;
- dst[0] = v & 0xff;
- dst[1] = v >> 8;
- dst += 2;
- }
- break;
- case CODEC_ID_PCM_U16BE:
- for(;n>0;n--) {
- v = *samples++;
- v += 0x8000;
- dst[0] = v >> 8;
- dst[1] = v;
- dst += 2;
- }
- break;
- case CODEC_ID_PCM_S8:
- for(;n>0;n--) {
- v = *samples++;
- dst[0] = v >> 8;
- dst++;
- }
- break;
- case CODEC_ID_PCM_U8:
- for(;n>0;n--) {
- v = *samples++;
- dst[0] = (v >> 8) + 128;
- dst++;
- }
- break;
- case CODEC_ID_PCM_ALAW:
- for(;n>0;n--) {
- v = *samples++;
- dst[0] = linear_to_alaw[(v + 32768) >> 2];
- dst++;
- }
- break;
- case CODEC_ID_PCM_MULAW:
- for(;n>0;n--) {
- v = *samples++;
- dst[0] = linear_to_ulaw[(v + 32768) >> 2];
- dst++;
- }
- break;
- default:
- return -1;
- }
- //avctx->frame_size = (dst - frame) / (sample_size * avctx->channels);
-
- return dst - frame;
-}
-
-typedef struct PCMDecode {
- short table[256];
-} PCMDecode;
-
-static int pcm_decode_init(AVCodecContext * avctx)
-{
- PCMDecode *s = avctx->priv_data;
- int i;
-
- switch(avctx->codec->id) {
- case CODEC_ID_PCM_ALAW:
- for(i=0;i<256;i++)
- s->table[i] = alaw2linear(i);
- break;
- case CODEC_ID_PCM_MULAW:
- for(i=0;i<256;i++)
- s->table[i] = ulaw2linear(i);
- break;
- default:
- break;
- }
- return 0;
-}
-
-/**
- * \brief convert samples to 16 bit
- * \param bps byte per sample for the source format, must be >= 2
- * \param le 0 for big-, 1 for little-endian
- * \param us 0 for signed, 1 for unsigned input
- * \param src input samples
- * \param samples output samples
- * \param src_len number of bytes in src
- */
-static inline void decode_to16(int bps, int le, int us,
- uint8_t **src, short **samples, int src_len)
-{
- register int n = src_len / bps;
- if (le) *src += bps - 2;
- for(;n>0;n--) {
- *(*samples)++ = ((*src)[le] << 8 | (*src)[1 - le]) - (us?0x8000:0);
- *src += bps;
- }
- if (le) *src -= bps - 2;
-}
-
-static int pcm_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- PCMDecode *s = avctx->priv_data;
- int n;
- short *samples;
- uint8_t *src;
-
- samples = data;
- src = buf;
-
- buf_size= FFMIN(buf_size, *data_size/2);
- *data_size=0;
-
- switch(avctx->codec->id) {
- case CODEC_ID_PCM_S32LE:
- decode_to16(4, 1, 0, &src, &samples, buf_size);
- break;
- case CODEC_ID_PCM_S32BE:
- decode_to16(4, 0, 0, &src, &samples, buf_size);
- break;
- case CODEC_ID_PCM_U32LE:
- decode_to16(4, 1, 1, &src, &samples, buf_size);
- break;
- case CODEC_ID_PCM_U32BE:
- decode_to16(4, 0, 1, &src, &samples, buf_size);
- break;
- case CODEC_ID_PCM_S24LE:
- decode_to16(3, 1, 0, &src, &samples, buf_size);
- break;
- case CODEC_ID_PCM_S24BE:
- decode_to16(3, 0, 0, &src, &samples, buf_size);
- break;
- case CODEC_ID_PCM_U24LE:
- decode_to16(3, 1, 1, &src, &samples, buf_size);
- break;
- case CODEC_ID_PCM_U24BE:
- decode_to16(3, 0, 1, &src, &samples, buf_size);
- break;
- case CODEC_ID_PCM_S24DAUD:
- n = buf_size / 3;
- for(;n>0;n--) {
- uint32_t v = src[0] << 16 | src[1] << 8 | src[2];
- v >>= 4; // sync flags are here
- *samples++ = ff_reverse[(v >> 8) & 0xff] +
- (ff_reverse[v & 0xff] << 8);
- src += 3;
- }
- break;
- case CODEC_ID_PCM_S16LE:
- n = buf_size >> 1;
- for(;n>0;n--) {
- *samples++ = src[0] | (src[1] << 8);
- src += 2;
- }
- break;
- case CODEC_ID_PCM_S16BE:
- n = buf_size >> 1;
- for(;n>0;n--) {
- *samples++ = (src[0] << 8) | src[1];
- src += 2;
- }
- break;
- case CODEC_ID_PCM_U16LE:
- n = buf_size >> 1;
- for(;n>0;n--) {
- *samples++ = (src[0] | (src[1] << 8)) - 0x8000;
- src += 2;
- }
- break;
- case CODEC_ID_PCM_U16BE:
- n = buf_size >> 1;
- for(;n>0;n--) {
- *samples++ = ((src[0] << 8) | src[1]) - 0x8000;
- src += 2;
- }
- break;
- case CODEC_ID_PCM_S8:
- n = buf_size;
- for(;n>0;n--) {
- *samples++ = src[0] << 8;
- src++;
- }
- break;
- case CODEC_ID_PCM_U8:
- n = buf_size;
- for(;n>0;n--) {
- *samples++ = ((int)src[0] - 128) << 8;
- src++;
- }
- break;
- case CODEC_ID_PCM_ALAW:
- case CODEC_ID_PCM_MULAW:
- n = buf_size;
- for(;n>0;n--) {
- *samples++ = s->table[src[0]];
- src++;
- }
- break;
- default:
- return -1;
- }
- *data_size = (uint8_t *)samples - (uint8_t *)data;
- return src - buf;
-}
-
-#define PCM_CODEC(id, name) \
-AVCodec name ## _encoder = { \
- #name, \
- CODEC_TYPE_AUDIO, \
- id, \
- 0, \
- pcm_encode_init, \
- pcm_encode_frame, \
- pcm_encode_close, \
- NULL, \
-}; \
-AVCodec name ## _decoder = { \
- #name, \
- CODEC_TYPE_AUDIO, \
- id, \
- sizeof(PCMDecode), \
- pcm_decode_init, \
- NULL, \
- NULL, \
- pcm_decode_frame, \
-}
-
-PCM_CODEC(CODEC_ID_PCM_S32LE, pcm_s32le);
-PCM_CODEC(CODEC_ID_PCM_S32BE, pcm_s32be);
-PCM_CODEC(CODEC_ID_PCM_U32LE, pcm_u32le);
-PCM_CODEC(CODEC_ID_PCM_U32BE, pcm_u32be);
-PCM_CODEC(CODEC_ID_PCM_S24LE, pcm_s24le);
-PCM_CODEC(CODEC_ID_PCM_S24BE, pcm_s24be);
-PCM_CODEC(CODEC_ID_PCM_U24LE, pcm_u24le);
-PCM_CODEC(CODEC_ID_PCM_U24BE, pcm_u24be);
-PCM_CODEC(CODEC_ID_PCM_S24DAUD, pcm_s24daud);
-PCM_CODEC(CODEC_ID_PCM_S16LE, pcm_s16le);
-PCM_CODEC(CODEC_ID_PCM_S16BE, pcm_s16be);
-PCM_CODEC(CODEC_ID_PCM_U16LE, pcm_u16le);
-PCM_CODEC(CODEC_ID_PCM_U16BE, pcm_u16be);
-PCM_CODEC(CODEC_ID_PCM_S8, pcm_s8);
-PCM_CODEC(CODEC_ID_PCM_U8, pcm_u8);
-PCM_CODEC(CODEC_ID_PCM_ALAW, pcm_alaw);
-PCM_CODEC(CODEC_ID_PCM_MULAW, pcm_mulaw);
-
-#undef PCM_CODEC
diff --git a/src/libffmpeg/libavcodec/ppc/Makefile.am b/src/libffmpeg/libavcodec/ppc/Makefile.am
deleted file mode 100644
index d52cc481e..000000000
--- a/src/libffmpeg/libavcodec/ppc/Makefile.am
+++ /dev/null
@@ -1,36 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-AM_CPPFLAGS = $(LIBFFMPEG_CPPFLAGS)
-AM_CFLAGS = -fno-strict-aliasing
-# CFLAGS is here to filter out -funroll-loops because it causes bad
-# behavior of libavcodec
-CFLAGS = `echo @CFLAGS@ | sed -e 's/-funroll-loops//g'`
-
-ASFLAGS =
-
-noinst_LTLIBRARIES = libavcodec_ppc.la
-
-libavcodec_ppc_src = dsputil_altivec.c \
- dsputil_ppc.c \
- h264_altivec.c \
- h264_template_altivec.c \
- fdct_altivec.c \
- fft_altivec.c \
- float_altivec.c \
- idct_altivec.c \
- gmc_altivec.c \
- mpegvideo_altivec.c \
- mpegvideo_ppc.c \
- snow_altivec.c \
- vc1dsp_altivec.c
-libavcodec_ppc_dummy = libavcodec_ppc_dummy.c
-
-EXTRA_DIST = $(libavcodec_ppc_src) $(libavcodec_ppc_dummy)
-
-#if PPC_ARCH
-#ppc_modules = $(libavcodec_ppc_src)
-#endif
-
-libavcodec_ppc_la_SOURCES = $(ppc_modules) $(libavcodec_ppc_dummy)
-
-noinst_HEADERS = dsputil_altivec.h dsputil_ppc.h gcc_fixes.h mathops.h types_altivec.h
diff --git a/src/libffmpeg/libavcodec/ppc/dsputil_altivec.c b/src/libffmpeg/libavcodec/ppc/dsputil_altivec.c
deleted file mode 100644
index bbc53d761..000000000
--- a/src/libffmpeg/libavcodec/ppc/dsputil_altivec.c
+++ /dev/null
@@ -1,1589 +0,0 @@
-/*
- * Copyright (c) 2002 Brian Foley
- * Copyright (c) 2002 Dieter Shirley
- * Copyright (c) 2003-2004 Romain Dolbeau <romain@dolbeau.org>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "../dsputil.h"
-
-#include "gcc_fixes.h"
-
-#include "dsputil_altivec.h"
-
-#ifdef CONFIG_DARWIN
-#include <sys/sysctl.h>
-#else /* CONFIG_DARWIN */
-#ifdef __AMIGAOS4__
-#include <exec/exec.h>
-#include <interfaces/exec.h>
-#include <proto/exec.h>
-#else /* __AMIGAOS4__ */
-#include <signal.h>
-#include <setjmp.h>
-
-static sigjmp_buf jmpbuf;
-static volatile sig_atomic_t canjump = 0;
-
-static void sigill_handler (int sig)
-{
- if (!canjump) {
- signal (sig, SIG_DFL);
- raise (sig);
- }
-
- canjump = 0;
- siglongjmp (jmpbuf, 1);
-}
-#endif /* CONFIG_DARWIN */
-#endif /* __AMIGAOS4__ */
-
-int sad16_x2_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
- int i;
- int s __attribute__((aligned(16)));
- const_vector unsigned char zero = (const_vector unsigned char)vec_splat_u8(0);
- vector unsigned char *tv;
- vector unsigned char pix1v, pix2v, pix2iv, avgv, t5;
- vector unsigned int sad;
- vector signed int sumdiffs;
-
- s = 0;
- sad = (vector unsigned int)vec_splat_u32(0);
- for(i=0;i<h;i++) {
- /*
- Read unaligned pixels into our vectors. The vectors are as follows:
- pix1v: pix1[0]-pix1[15]
- pix2v: pix2[0]-pix2[15] pix2iv: pix2[1]-pix2[16]
- */
- tv = (vector unsigned char *) pix1;
- pix1v = vec_perm(tv[0], tv[1], vec_lvsl(0, pix1));
-
- tv = (vector unsigned char *) &pix2[0];
- pix2v = vec_perm(tv[0], tv[1], vec_lvsl(0, &pix2[0]));
-
- tv = (vector unsigned char *) &pix2[1];
- pix2iv = vec_perm(tv[0], tv[1], vec_lvsl(0, &pix2[1]));
-
- /* Calculate the average vector */
- avgv = vec_avg(pix2v, pix2iv);
-
- /* Calculate a sum of abs differences vector */
- t5 = vec_sub(vec_max(pix1v, avgv), vec_min(pix1v, avgv));
-
- /* Add each 4 pixel group together and put 4 results into sad */
- sad = vec_sum4s(t5, sad);
-
- pix1 += line_size;
- pix2 += line_size;
- }
- /* Sum up the four partial sums, and put the result into s */
- sumdiffs = vec_sums((vector signed int) sad, (vector signed int) zero);
- sumdiffs = vec_splat(sumdiffs, 3);
- vec_ste(sumdiffs, 0, &s);
-
- return s;
-}
-
-int sad16_y2_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
- int i;
- int s __attribute__((aligned(16)));
- const_vector unsigned char zero = (const_vector unsigned char)vec_splat_u8(0);
- vector unsigned char *tv;
- vector unsigned char pix1v, pix2v, pix3v, avgv, t5;
- vector unsigned int sad;
- vector signed int sumdiffs;
- uint8_t *pix3 = pix2 + line_size;
-
- s = 0;
- sad = (vector unsigned int)vec_splat_u32(0);
-
- /*
- Due to the fact that pix3 = pix2 + line_size, the pix3 of one
- iteration becomes pix2 in the next iteration. We can use this
- fact to avoid a potentially expensive unaligned read, each
- time around the loop.
- Read unaligned pixels into our vectors. The vectors are as follows:
- pix2v: pix2[0]-pix2[15]
- Split the pixel vectors into shorts
- */
- tv = (vector unsigned char *) &pix2[0];
- pix2v = vec_perm(tv[0], tv[1], vec_lvsl(0, &pix2[0]));
-
- for(i=0;i<h;i++) {
- /*
- Read unaligned pixels into our vectors. The vectors are as follows:
- pix1v: pix1[0]-pix1[15]
- pix3v: pix3[0]-pix3[15]
- */
- tv = (vector unsigned char *) pix1;
- pix1v = vec_perm(tv[0], tv[1], vec_lvsl(0, pix1));
-
- tv = (vector unsigned char *) &pix3[0];
- pix3v = vec_perm(tv[0], tv[1], vec_lvsl(0, &pix3[0]));
-
- /* Calculate the average vector */
- avgv = vec_avg(pix2v, pix3v);
-
- /* Calculate a sum of abs differences vector */
- t5 = vec_sub(vec_max(pix1v, avgv), vec_min(pix1v, avgv));
-
- /* Add each 4 pixel group together and put 4 results into sad */
- sad = vec_sum4s(t5, sad);
-
- pix1 += line_size;
- pix2v = pix3v;
- pix3 += line_size;
-
- }
-
- /* Sum up the four partial sums, and put the result into s */
- sumdiffs = vec_sums((vector signed int) sad, (vector signed int) zero);
- sumdiffs = vec_splat(sumdiffs, 3);
- vec_ste(sumdiffs, 0, &s);
- return s;
-}
-
-int sad16_xy2_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
- int i;
- int s __attribute__((aligned(16)));
- uint8_t *pix3 = pix2 + line_size;
- const_vector unsigned char zero = (const_vector unsigned char)vec_splat_u8(0);
- const_vector unsigned short two = (const_vector unsigned short)vec_splat_u16(2);
- vector unsigned char *tv, avgv, t5;
- vector unsigned char pix1v, pix2v, pix3v, pix2iv, pix3iv;
- vector unsigned short pix2lv, pix2hv, pix2ilv, pix2ihv;
- vector unsigned short pix3lv, pix3hv, pix3ilv, pix3ihv;
- vector unsigned short avghv, avglv;
- vector unsigned short t1, t2, t3, t4;
- vector unsigned int sad;
- vector signed int sumdiffs;
-
- sad = (vector unsigned int)vec_splat_u32(0);
-
- s = 0;
-
- /*
- Due to the fact that pix3 = pix2 + line_size, the pix3 of one
- iteration becomes pix2 in the next iteration. We can use this
- fact to avoid a potentially expensive unaligned read, as well
- as some splitting, and vector addition each time around the loop.
- Read unaligned pixels into our vectors. The vectors are as follows:
- pix2v: pix2[0]-pix2[15] pix2iv: pix2[1]-pix2[16]
- Split the pixel vectors into shorts
- */
- tv = (vector unsigned char *) &pix2[0];
- pix2v = vec_perm(tv[0], tv[1], vec_lvsl(0, &pix2[0]));
-
- tv = (vector unsigned char *) &pix2[1];
- pix2iv = vec_perm(tv[0], tv[1], vec_lvsl(0, &pix2[1]));
-
- pix2hv = (vector unsigned short) vec_mergeh(zero, pix2v);
- pix2lv = (vector unsigned short) vec_mergel(zero, pix2v);
- pix2ihv = (vector unsigned short) vec_mergeh(zero, pix2iv);
- pix2ilv = (vector unsigned short) vec_mergel(zero, pix2iv);
- t1 = vec_add(pix2hv, pix2ihv);
- t2 = vec_add(pix2lv, pix2ilv);
-
- for(i=0;i<h;i++) {
- /*
- Read unaligned pixels into our vectors. The vectors are as follows:
- pix1v: pix1[0]-pix1[15]
- pix3v: pix3[0]-pix3[15] pix3iv: pix3[1]-pix3[16]
- */
- tv = (vector unsigned char *) pix1;
- pix1v = vec_perm(tv[0], tv[1], vec_lvsl(0, pix1));
-
- tv = (vector unsigned char *) &pix3[0];
- pix3v = vec_perm(tv[0], tv[1], vec_lvsl(0, &pix3[0]));
-
- tv = (vector unsigned char *) &pix3[1];
- pix3iv = vec_perm(tv[0], tv[1], vec_lvsl(0, &pix3[1]));
-
- /*
- Note that Altivec does have vec_avg, but this works on vector pairs
- and rounds up. We could do avg(avg(a,b),avg(c,d)), but the rounding
- would mean that, for example, avg(3,0,0,1) = 2, when it should be 1.
- Instead, we have to split the pixel vectors into vectors of shorts,
- and do the averaging by hand.
- */
-
- /* Split the pixel vectors into shorts */
- pix3hv = (vector unsigned short) vec_mergeh(zero, pix3v);
- pix3lv = (vector unsigned short) vec_mergel(zero, pix3v);
- pix3ihv = (vector unsigned short) vec_mergeh(zero, pix3iv);
- pix3ilv = (vector unsigned short) vec_mergel(zero, pix3iv);
-
- /* Do the averaging on them */
- t3 = vec_add(pix3hv, pix3ihv);
- t4 = vec_add(pix3lv, pix3ilv);
-
- avghv = vec_sr(vec_add(vec_add(t1, t3), two), two);
- avglv = vec_sr(vec_add(vec_add(t2, t4), two), two);
-
- /* Pack the shorts back into a result */
- avgv = vec_pack(avghv, avglv);
-
- /* Calculate a sum of abs differences vector */
- t5 = vec_sub(vec_max(pix1v, avgv), vec_min(pix1v, avgv));
-
- /* Add each 4 pixel group together and put 4 results into sad */
- sad = vec_sum4s(t5, sad);
-
- pix1 += line_size;
- pix3 += line_size;
- /* Transfer the calculated values for pix3 into pix2 */
- t1 = t3;
- t2 = t4;
- }
- /* Sum up the four partial sums, and put the result into s */
- sumdiffs = vec_sums((vector signed int) sad, (vector signed int) zero);
- sumdiffs = vec_splat(sumdiffs, 3);
- vec_ste(sumdiffs, 0, &s);
-
- return s;
-}
-
-int sad16_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
- int i;
- int s __attribute__((aligned(16)));
- const_vector unsigned int zero = (const_vector unsigned int)vec_splat_u32(0);
- vector unsigned char perm1, perm2, *pix1v, *pix2v;
- vector unsigned char t1, t2, t3,t4, t5;
- vector unsigned int sad;
- vector signed int sumdiffs;
-
- sad = (vector unsigned int)vec_splat_u32(0);
-
-
- for(i=0;i<h;i++) {
- /* Read potentially unaligned pixels into t1 and t2 */
- perm1 = vec_lvsl(0, pix1);
- pix1v = (vector unsigned char *) pix1;
- perm2 = vec_lvsl(0, pix2);
- pix2v = (vector unsigned char *) pix2;
- t1 = vec_perm(pix1v[0], pix1v[1], perm1);
- t2 = vec_perm(pix2v[0], pix2v[1], perm2);
-
- /* Calculate a sum of abs differences vector */
- t3 = vec_max(t1, t2);
- t4 = vec_min(t1, t2);
- t5 = vec_sub(t3, t4);
-
- /* Add each 4 pixel group together and put 4 results into sad */
- sad = vec_sum4s(t5, sad);
-
- pix1 += line_size;
- pix2 += line_size;
- }
-
- /* Sum up the four partial sums, and put the result into s */
- sumdiffs = vec_sums((vector signed int) sad, (vector signed int) zero);
- sumdiffs = vec_splat(sumdiffs, 3);
- vec_ste(sumdiffs, 0, &s);
-
- return s;
-}
-
-int sad8_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
- int i;
- int s __attribute__((aligned(16)));
- const_vector unsigned int zero = (const_vector unsigned int)vec_splat_u32(0);
- vector unsigned char perm1, perm2, permclear, *pix1v, *pix2v;
- vector unsigned char t1, t2, t3,t4, t5;
- vector unsigned int sad;
- vector signed int sumdiffs;
-
- sad = (vector unsigned int)vec_splat_u32(0);
-
- permclear = (vector unsigned char)AVV(255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0);
-
- for(i=0;i<h;i++) {
- /* Read potentially unaligned pixels into t1 and t2
- Since we're reading 16 pixels, and actually only want 8,
- mask out the last 8 pixels. The 0s don't change the sum. */
- perm1 = vec_lvsl(0, pix1);
- pix1v = (vector unsigned char *) pix1;
- perm2 = vec_lvsl(0, pix2);
- pix2v = (vector unsigned char *) pix2;
- t1 = vec_and(vec_perm(pix1v[0], pix1v[1], perm1), permclear);
- t2 = vec_and(vec_perm(pix2v[0], pix2v[1], perm2), permclear);
-
- /* Calculate a sum of abs differences vector */
- t3 = vec_max(t1, t2);
- t4 = vec_min(t1, t2);
- t5 = vec_sub(t3, t4);
-
- /* Add each 4 pixel group together and put 4 results into sad */
- sad = vec_sum4s(t5, sad);
-
- pix1 += line_size;
- pix2 += line_size;
- }
-
- /* Sum up the four partial sums, and put the result into s */
- sumdiffs = vec_sums((vector signed int) sad, (vector signed int) zero);
- sumdiffs = vec_splat(sumdiffs, 3);
- vec_ste(sumdiffs, 0, &s);
-
- return s;
-}
-
-int pix_norm1_altivec(uint8_t *pix, int line_size)
-{
- int i;
- int s __attribute__((aligned(16)));
- const_vector unsigned int zero = (const_vector unsigned int)vec_splat_u32(0);
- vector unsigned char *tv;
- vector unsigned char pixv;
- vector unsigned int sv;
- vector signed int sum;
-
- sv = (vector unsigned int)vec_splat_u32(0);
-
- s = 0;
- for (i = 0; i < 16; i++) {
- /* Read in the potentially unaligned pixels */
- tv = (vector unsigned char *) pix;
- pixv = vec_perm(tv[0], tv[1], vec_lvsl(0, pix));
-
- /* Square the values, and add them to our sum */
- sv = vec_msum(pixv, pixv, sv);
-
- pix += line_size;
- }
- /* Sum up the four partial sums, and put the result into s */
- sum = vec_sums((vector signed int) sv, (vector signed int) zero);
- sum = vec_splat(sum, 3);
- vec_ste(sum, 0, &s);
-
- return s;
-}
-
-/**
- * Sum of Squared Errors for a 8x8 block.
- * AltiVec-enhanced.
- * It's the sad8_altivec code above w/ squaring added.
- */
-int sse8_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
- int i;
- int s __attribute__((aligned(16)));
- const_vector unsigned int zero = (const_vector unsigned int)vec_splat_u32(0);
- vector unsigned char perm1, perm2, permclear, *pix1v, *pix2v;
- vector unsigned char t1, t2, t3,t4, t5;
- vector unsigned int sum;
- vector signed int sumsqr;
-
- sum = (vector unsigned int)vec_splat_u32(0);
-
- permclear = (vector unsigned char)AVV(255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0);
-
-
- for(i=0;i<h;i++) {
- /* Read potentially unaligned pixels into t1 and t2
- Since we're reading 16 pixels, and actually only want 8,
- mask out the last 8 pixels. The 0s don't change the sum. */
- perm1 = vec_lvsl(0, pix1);
- pix1v = (vector unsigned char *) pix1;
- perm2 = vec_lvsl(0, pix2);
- pix2v = (vector unsigned char *) pix2;
- t1 = vec_and(vec_perm(pix1v[0], pix1v[1], perm1), permclear);
- t2 = vec_and(vec_perm(pix2v[0], pix2v[1], perm2), permclear);
-
- /*
- Since we want to use unsigned chars, we can take advantage
- of the fact that abs(a-b)^2 = (a-b)^2.
- */
-
- /* Calculate abs differences vector */
- t3 = vec_max(t1, t2);
- t4 = vec_min(t1, t2);
- t5 = vec_sub(t3, t4);
-
- /* Square the values and add them to our sum */
- sum = vec_msum(t5, t5, sum);
-
- pix1 += line_size;
- pix2 += line_size;
- }
-
- /* Sum up the four partial sums, and put the result into s */
- sumsqr = vec_sums((vector signed int) sum, (vector signed int) zero);
- sumsqr = vec_splat(sumsqr, 3);
- vec_ste(sumsqr, 0, &s);
-
- return s;
-}
-
-/**
- * Sum of Squared Errors for a 16x16 block.
- * AltiVec-enhanced.
- * It's the sad16_altivec code above w/ squaring added.
- */
-int sse16_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
-{
- int i;
- int s __attribute__((aligned(16)));
- const_vector unsigned int zero = (const_vector unsigned int)vec_splat_u32(0);
- vector unsigned char perm1, perm2, *pix1v, *pix2v;
- vector unsigned char t1, t2, t3,t4, t5;
- vector unsigned int sum;
- vector signed int sumsqr;
-
- sum = (vector unsigned int)vec_splat_u32(0);
-
- for(i=0;i<h;i++) {
- /* Read potentially unaligned pixels into t1 and t2 */
- perm1 = vec_lvsl(0, pix1);
- pix1v = (vector unsigned char *) pix1;
- perm2 = vec_lvsl(0, pix2);
- pix2v = (vector unsigned char *) pix2;
- t1 = vec_perm(pix1v[0], pix1v[1], perm1);
- t2 = vec_perm(pix2v[0], pix2v[1], perm2);
-
- /*
- Since we want to use unsigned chars, we can take advantage
- of the fact that abs(a-b)^2 = (a-b)^2.
- */
-
- /* Calculate abs differences vector */
- t3 = vec_max(t1, t2);
- t4 = vec_min(t1, t2);
- t5 = vec_sub(t3, t4);
-
- /* Square the values and add them to our sum */
- sum = vec_msum(t5, t5, sum);
-
- pix1 += line_size;
- pix2 += line_size;
- }
-
- /* Sum up the four partial sums, and put the result into s */
- sumsqr = vec_sums((vector signed int) sum, (vector signed int) zero);
- sumsqr = vec_splat(sumsqr, 3);
- vec_ste(sumsqr, 0, &s);
-
- return s;
-}
-
-int pix_sum_altivec(uint8_t * pix, int line_size)
-{
- const_vector unsigned int zero = (const_vector unsigned int)vec_splat_u32(0);
- vector unsigned char perm, *pixv;
- vector unsigned char t1;
- vector unsigned int sad;
- vector signed int sumdiffs;
-
- int i;
- int s __attribute__((aligned(16)));
-
- sad = (vector unsigned int)vec_splat_u32(0);
-
- for (i = 0; i < 16; i++) {
- /* Read the potentially unaligned 16 pixels into t1 */
- perm = vec_lvsl(0, pix);
- pixv = (vector unsigned char *) pix;
- t1 = vec_perm(pixv[0], pixv[1], perm);
-
- /* Add each 4 pixel group together and put 4 results into sad */
- sad = vec_sum4s(t1, sad);
-
- pix += line_size;
- }
-
- /* Sum up the four partial sums, and put the result into s */
- sumdiffs = vec_sums((vector signed int) sad, (vector signed int) zero);
- sumdiffs = vec_splat(sumdiffs, 3);
- vec_ste(sumdiffs, 0, &s);
-
- return s;
-}
-
-void get_pixels_altivec(DCTELEM *restrict block, const uint8_t *pixels, int line_size)
-{
- int i;
- vector unsigned char perm, bytes, *pixv;
- const_vector unsigned char zero = (const_vector unsigned char)vec_splat_u8(0);
- vector signed short shorts;
-
- for(i=0;i<8;i++)
- {
- // Read potentially unaligned pixels.
- // We're reading 16 pixels, and actually only want 8,
- // but we simply ignore the extras.
- perm = vec_lvsl(0, pixels);
- pixv = (vector unsigned char *) pixels;
- bytes = vec_perm(pixv[0], pixv[1], perm);
-
- // convert the bytes into shorts
- shorts = (vector signed short)vec_mergeh(zero, bytes);
-
- // save the data to the block, we assume the block is 16-byte aligned
- vec_st(shorts, i*16, (vector signed short*)block);
-
- pixels += line_size;
- }
-}
-
-void diff_pixels_altivec(DCTELEM *restrict block, const uint8_t *s1,
- const uint8_t *s2, int stride)
-{
- int i;
- vector unsigned char perm, bytes, *pixv;
- const_vector unsigned char zero = (const_vector unsigned char)vec_splat_u8(0);
- vector signed short shorts1, shorts2;
-
- for(i=0;i<4;i++)
- {
- // Read potentially unaligned pixels
- // We're reading 16 pixels, and actually only want 8,
- // but we simply ignore the extras.
- perm = vec_lvsl(0, s1);
- pixv = (vector unsigned char *) s1;
- bytes = vec_perm(pixv[0], pixv[1], perm);
-
- // convert the bytes into shorts
- shorts1 = (vector signed short)vec_mergeh(zero, bytes);
-
- // Do the same for the second block of pixels
- perm = vec_lvsl(0, s2);
- pixv = (vector unsigned char *) s2;
- bytes = vec_perm(pixv[0], pixv[1], perm);
-
- // convert the bytes into shorts
- shorts2 = (vector signed short)vec_mergeh(zero, bytes);
-
- // Do the subtraction
- shorts1 = vec_sub(shorts1, shorts2);
-
- // save the data to the block, we assume the block is 16-byte aligned
- vec_st(shorts1, 0, (vector signed short*)block);
-
- s1 += stride;
- s2 += stride;
- block += 8;
-
-
- // The code below is a copy of the code above... This is a manual
- // unroll.
-
- // Read potentially unaligned pixels
- // We're reading 16 pixels, and actually only want 8,
- // but we simply ignore the extras.
- perm = vec_lvsl(0, s1);
- pixv = (vector unsigned char *) s1;
- bytes = vec_perm(pixv[0], pixv[1], perm);
-
- // convert the bytes into shorts
- shorts1 = (vector signed short)vec_mergeh(zero, bytes);
-
- // Do the same for the second block of pixels
- perm = vec_lvsl(0, s2);
- pixv = (vector unsigned char *) s2;
- bytes = vec_perm(pixv[0], pixv[1], perm);
-
- // convert the bytes into shorts
- shorts2 = (vector signed short)vec_mergeh(zero, bytes);
-
- // Do the subtraction
- shorts1 = vec_sub(shorts1, shorts2);
-
- // save the data to the block, we assume the block is 16-byte aligned
- vec_st(shorts1, 0, (vector signed short*)block);
-
- s1 += stride;
- s2 += stride;
- block += 8;
- }
-}
-
-void add_bytes_altivec(uint8_t *dst, uint8_t *src, int w) {
- register int i;
- register vector unsigned char vdst, vsrc;
-
- /* dst and src are 16 bytes-aligned (guaranteed) */
- for(i = 0 ; (i + 15) < w ; i+=16)
- {
- vdst = vec_ld(i, (unsigned char*)dst);
- vsrc = vec_ld(i, (unsigned char*)src);
- vdst = vec_add(vsrc, vdst);
- vec_st(vdst, i, (unsigned char*)dst);
- }
- /* if w is not a multiple of 16 */
- for (; (i < w) ; i++)
- {
- dst[i] = src[i];
- }
-}
-
-/* next one assumes that ((line_size % 16) == 0) */
-void put_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-{
-POWERPC_PERF_DECLARE(altivec_put_pixels16_num, 1);
- register vector unsigned char pixelsv1, pixelsv2;
- register vector unsigned char pixelsv1B, pixelsv2B;
- register vector unsigned char pixelsv1C, pixelsv2C;
- register vector unsigned char pixelsv1D, pixelsv2D;
-
- register vector unsigned char perm = vec_lvsl(0, pixels);
- int i;
- register int line_size_2 = line_size << 1;
- register int line_size_3 = line_size + line_size_2;
- register int line_size_4 = line_size << 2;
-
-POWERPC_PERF_START_COUNT(altivec_put_pixels16_num, 1);
-// hand-unrolling the loop by 4 gains about 15%
-// mininum execution time goes from 74 to 60 cycles
-// it's faster than -funroll-loops, but using
-// -funroll-loops w/ this is bad - 74 cycles again.
-// all this is on a 7450, tuning for the 7450
-#if 0
- for(i=0; i<h; i++) {
- pixelsv1 = vec_ld(0, (unsigned char*)pixels);
- pixelsv2 = vec_ld(16, (unsigned char*)pixels);
- vec_st(vec_perm(pixelsv1, pixelsv2, perm),
- 0, (unsigned char*)block);
- pixels+=line_size;
- block +=line_size;
- }
-#else
- for(i=0; i<h; i+=4) {
- pixelsv1 = vec_ld(0, (unsigned char*)pixels);
- pixelsv2 = vec_ld(15, (unsigned char*)pixels);
- pixelsv1B = vec_ld(line_size, (unsigned char*)pixels);
- pixelsv2B = vec_ld(15 + line_size, (unsigned char*)pixels);
- pixelsv1C = vec_ld(line_size_2, (unsigned char*)pixels);
- pixelsv2C = vec_ld(15 + line_size_2, (unsigned char*)pixels);
- pixelsv1D = vec_ld(line_size_3, (unsigned char*)pixels);
- pixelsv2D = vec_ld(15 + line_size_3, (unsigned char*)pixels);
- vec_st(vec_perm(pixelsv1, pixelsv2, perm),
- 0, (unsigned char*)block);
- vec_st(vec_perm(pixelsv1B, pixelsv2B, perm),
- line_size, (unsigned char*)block);
- vec_st(vec_perm(pixelsv1C, pixelsv2C, perm),
- line_size_2, (unsigned char*)block);
- vec_st(vec_perm(pixelsv1D, pixelsv2D, perm),
- line_size_3, (unsigned char*)block);
- pixels+=line_size_4;
- block +=line_size_4;
- }
-#endif
-POWERPC_PERF_STOP_COUNT(altivec_put_pixels16_num, 1);
-}
-
-/* next one assumes that ((line_size % 16) == 0) */
-#define op_avg(a,b) a = ( ((a)|(b)) - ((((a)^(b))&0xFEFEFEFEUL)>>1) )
-void avg_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-{
-POWERPC_PERF_DECLARE(altivec_avg_pixels16_num, 1);
- register vector unsigned char pixelsv1, pixelsv2, pixelsv, blockv;
- register vector unsigned char perm = vec_lvsl(0, pixels);
- int i;
-
-POWERPC_PERF_START_COUNT(altivec_avg_pixels16_num, 1);
-
- for(i=0; i<h; i++) {
- pixelsv1 = vec_ld(0, (unsigned char*)pixels);
- pixelsv2 = vec_ld(16, (unsigned char*)pixels);
- blockv = vec_ld(0, block);
- pixelsv = vec_perm(pixelsv1, pixelsv2, perm);
- blockv = vec_avg(blockv,pixelsv);
- vec_st(blockv, 0, (unsigned char*)block);
- pixels+=line_size;
- block +=line_size;
- }
-
-POWERPC_PERF_STOP_COUNT(altivec_avg_pixels16_num, 1);
-}
-
-/* next one assumes that ((line_size % 8) == 0) */
-void avg_pixels8_altivec(uint8_t * block, const uint8_t * pixels, int line_size, int h)
-{
-POWERPC_PERF_DECLARE(altivec_avg_pixels8_num, 1);
- register vector unsigned char pixelsv1, pixelsv2, pixelsv, blockv;
- int i;
-
-POWERPC_PERF_START_COUNT(altivec_avg_pixels8_num, 1);
-
- for (i = 0; i < h; i++) {
- /*
- block is 8 bytes-aligned, so we're either in the
- left block (16 bytes-aligned) or in the right block (not)
- */
- int rightside = ((unsigned long)block & 0x0000000F);
-
- blockv = vec_ld(0, block);
- pixelsv1 = vec_ld(0, (unsigned char*)pixels);
- pixelsv2 = vec_ld(16, (unsigned char*)pixels);
- pixelsv = vec_perm(pixelsv1, pixelsv2, vec_lvsl(0, pixels));
-
- if (rightside)
- {
- pixelsv = vec_perm(blockv, pixelsv, vcprm(0,1,s0,s1));
- }
- else
- {
- pixelsv = vec_perm(blockv, pixelsv, vcprm(s0,s1,2,3));
- }
-
- blockv = vec_avg(blockv, pixelsv);
-
- vec_st(blockv, 0, block);
-
- pixels += line_size;
- block += line_size;
- }
-
-POWERPC_PERF_STOP_COUNT(altivec_avg_pixels8_num, 1);
-}
-
-/* next one assumes that ((line_size % 8) == 0) */
-void put_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-{
-POWERPC_PERF_DECLARE(altivec_put_pixels8_xy2_num, 1);
- register int i;
- register vector unsigned char
- pixelsv1, pixelsv2,
- pixelsavg;
- register vector unsigned char
- blockv, temp1, temp2;
- register vector unsigned short
- pixelssum1, pixelssum2, temp3;
- register const_vector unsigned char vczero = (const_vector unsigned char)vec_splat_u8(0);
- register const_vector unsigned short vctwo = (const_vector unsigned short)vec_splat_u16(2);
-
- temp1 = vec_ld(0, pixels);
- temp2 = vec_ld(16, pixels);
- pixelsv1 = vec_perm(temp1, temp2, vec_lvsl(0, pixels));
- if ((((unsigned long)pixels) & 0x0000000F) == 0x0000000F)
- {
- pixelsv2 = temp2;
- }
- else
- {
- pixelsv2 = vec_perm(temp1, temp2, vec_lvsl(1, pixels));
- }
- pixelsv1 = vec_mergeh(vczero, pixelsv1);
- pixelsv2 = vec_mergeh(vczero, pixelsv2);
- pixelssum1 = vec_add((vector unsigned short)pixelsv1,
- (vector unsigned short)pixelsv2);
- pixelssum1 = vec_add(pixelssum1, vctwo);
-
-POWERPC_PERF_START_COUNT(altivec_put_pixels8_xy2_num, 1);
- for (i = 0; i < h ; i++) {
- int rightside = ((unsigned long)block & 0x0000000F);
- blockv = vec_ld(0, block);
-
- temp1 = vec_ld(line_size, pixels);
- temp2 = vec_ld(line_size + 16, pixels);
- pixelsv1 = vec_perm(temp1, temp2, vec_lvsl(line_size, pixels));
- if (((((unsigned long)pixels) + line_size) & 0x0000000F) == 0x0000000F)
- {
- pixelsv2 = temp2;
- }
- else
- {
- pixelsv2 = vec_perm(temp1, temp2, vec_lvsl(line_size + 1, pixels));
- }
-
- pixelsv1 = vec_mergeh(vczero, pixelsv1);
- pixelsv2 = vec_mergeh(vczero, pixelsv2);
- pixelssum2 = vec_add((vector unsigned short)pixelsv1,
- (vector unsigned short)pixelsv2);
- temp3 = vec_add(pixelssum1, pixelssum2);
- temp3 = vec_sra(temp3, vctwo);
- pixelssum1 = vec_add(pixelssum2, vctwo);
- pixelsavg = vec_packsu(temp3, (vector unsigned short) vczero);
-
- if (rightside)
- {
- blockv = vec_perm(blockv, pixelsavg, vcprm(0, 1, s0, s1));
- }
- else
- {
- blockv = vec_perm(blockv, pixelsavg, vcprm(s0, s1, 2, 3));
- }
-
- vec_st(blockv, 0, block);
-
- block += line_size;
- pixels += line_size;
- }
-
-POWERPC_PERF_STOP_COUNT(altivec_put_pixels8_xy2_num, 1);
-}
-
-/* next one assumes that ((line_size % 8) == 0) */
-void put_no_rnd_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-{
-POWERPC_PERF_DECLARE(altivec_put_no_rnd_pixels8_xy2_num, 1);
- register int i;
- register vector unsigned char
- pixelsv1, pixelsv2,
- pixelsavg;
- register vector unsigned char
- blockv, temp1, temp2;
- register vector unsigned short
- pixelssum1, pixelssum2, temp3;
- register const_vector unsigned char vczero = (const_vector unsigned char)vec_splat_u8(0);
- register const_vector unsigned short vcone = (const_vector unsigned short)vec_splat_u16(1);
- register const_vector unsigned short vctwo = (const_vector unsigned short)vec_splat_u16(2);
-
- temp1 = vec_ld(0, pixels);
- temp2 = vec_ld(16, pixels);
- pixelsv1 = vec_perm(temp1, temp2, vec_lvsl(0, pixels));
- if ((((unsigned long)pixels) & 0x0000000F) == 0x0000000F)
- {
- pixelsv2 = temp2;
- }
- else
- {
- pixelsv2 = vec_perm(temp1, temp2, vec_lvsl(1, pixels));
- }
- pixelsv1 = vec_mergeh(vczero, pixelsv1);
- pixelsv2 = vec_mergeh(vczero, pixelsv2);
- pixelssum1 = vec_add((vector unsigned short)pixelsv1,
- (vector unsigned short)pixelsv2);
- pixelssum1 = vec_add(pixelssum1, vcone);
-
-POWERPC_PERF_START_COUNT(altivec_put_no_rnd_pixels8_xy2_num, 1);
- for (i = 0; i < h ; i++) {
- int rightside = ((unsigned long)block & 0x0000000F);
- blockv = vec_ld(0, block);
-
- temp1 = vec_ld(line_size, pixels);
- temp2 = vec_ld(line_size + 16, pixels);
- pixelsv1 = vec_perm(temp1, temp2, vec_lvsl(line_size, pixels));
- if (((((unsigned long)pixels) + line_size) & 0x0000000F) == 0x0000000F)
- {
- pixelsv2 = temp2;
- }
- else
- {
- pixelsv2 = vec_perm(temp1, temp2, vec_lvsl(line_size + 1, pixels));
- }
-
- pixelsv1 = vec_mergeh(vczero, pixelsv1);
- pixelsv2 = vec_mergeh(vczero, pixelsv2);
- pixelssum2 = vec_add((vector unsigned short)pixelsv1,
- (vector unsigned short)pixelsv2);
- temp3 = vec_add(pixelssum1, pixelssum2);
- temp3 = vec_sra(temp3, vctwo);
- pixelssum1 = vec_add(pixelssum2, vcone);
- pixelsavg = vec_packsu(temp3, (vector unsigned short) vczero);
-
- if (rightside)
- {
- blockv = vec_perm(blockv, pixelsavg, vcprm(0, 1, s0, s1));
- }
- else
- {
- blockv = vec_perm(blockv, pixelsavg, vcprm(s0, s1, 2, 3));
- }
-
- vec_st(blockv, 0, block);
-
- block += line_size;
- pixels += line_size;
- }
-
-POWERPC_PERF_STOP_COUNT(altivec_put_no_rnd_pixels8_xy2_num, 1);
-}
-
-/* next one assumes that ((line_size % 16) == 0) */
-void put_pixels16_xy2_altivec(uint8_t * block, const uint8_t * pixels, int line_size, int h)
-{
-POWERPC_PERF_DECLARE(altivec_put_pixels16_xy2_num, 1);
- register int i;
- register vector unsigned char
- pixelsv1, pixelsv2, pixelsv3, pixelsv4;
- register vector unsigned char
- blockv, temp1, temp2;
- register vector unsigned short
- pixelssum1, pixelssum2, temp3,
- pixelssum3, pixelssum4, temp4;
- register const_vector unsigned char vczero = (const_vector unsigned char)vec_splat_u8(0);
- register const_vector unsigned short vctwo = (const_vector unsigned short)vec_splat_u16(2);
-
-POWERPC_PERF_START_COUNT(altivec_put_pixels16_xy2_num, 1);
-
- temp1 = vec_ld(0, pixels);
- temp2 = vec_ld(16, pixels);
- pixelsv1 = vec_perm(temp1, temp2, vec_lvsl(0, pixels));
- if ((((unsigned long)pixels) & 0x0000000F) == 0x0000000F)
- {
- pixelsv2 = temp2;
- }
- else
- {
- pixelsv2 = vec_perm(temp1, temp2, vec_lvsl(1, pixels));
- }
- pixelsv3 = vec_mergel(vczero, pixelsv1);
- pixelsv4 = vec_mergel(vczero, pixelsv2);
- pixelsv1 = vec_mergeh(vczero, pixelsv1);
- pixelsv2 = vec_mergeh(vczero, pixelsv2);
- pixelssum3 = vec_add((vector unsigned short)pixelsv3,
- (vector unsigned short)pixelsv4);
- pixelssum3 = vec_add(pixelssum3, vctwo);
- pixelssum1 = vec_add((vector unsigned short)pixelsv1,
- (vector unsigned short)pixelsv2);
- pixelssum1 = vec_add(pixelssum1, vctwo);
-
- for (i = 0; i < h ; i++) {
- blockv = vec_ld(0, block);
-
- temp1 = vec_ld(line_size, pixels);
- temp2 = vec_ld(line_size + 16, pixels);
- pixelsv1 = vec_perm(temp1, temp2, vec_lvsl(line_size, pixels));
- if (((((unsigned long)pixels) + line_size) & 0x0000000F) == 0x0000000F)
- {
- pixelsv2 = temp2;
- }
- else
- {
- pixelsv2 = vec_perm(temp1, temp2, vec_lvsl(line_size + 1, pixels));
- }
-
- pixelsv3 = vec_mergel(vczero, pixelsv1);
- pixelsv4 = vec_mergel(vczero, pixelsv2);
- pixelsv1 = vec_mergeh(vczero, pixelsv1);
- pixelsv2 = vec_mergeh(vczero, pixelsv2);
-
- pixelssum4 = vec_add((vector unsigned short)pixelsv3,
- (vector unsigned short)pixelsv4);
- pixelssum2 = vec_add((vector unsigned short)pixelsv1,
- (vector unsigned short)pixelsv2);
- temp4 = vec_add(pixelssum3, pixelssum4);
- temp4 = vec_sra(temp4, vctwo);
- temp3 = vec_add(pixelssum1, pixelssum2);
- temp3 = vec_sra(temp3, vctwo);
-
- pixelssum3 = vec_add(pixelssum4, vctwo);
- pixelssum1 = vec_add(pixelssum2, vctwo);
-
- blockv = vec_packsu(temp3, temp4);
-
- vec_st(blockv, 0, block);
-
- block += line_size;
- pixels += line_size;
- }
-
-POWERPC_PERF_STOP_COUNT(altivec_put_pixels16_xy2_num, 1);
-}
-
-/* next one assumes that ((line_size % 16) == 0) */
-void put_no_rnd_pixels16_xy2_altivec(uint8_t * block, const uint8_t * pixels, int line_size, int h)
-{
-POWERPC_PERF_DECLARE(altivec_put_no_rnd_pixels16_xy2_num, 1);
- register int i;
- register vector unsigned char
- pixelsv1, pixelsv2, pixelsv3, pixelsv4;
- register vector unsigned char
- blockv, temp1, temp2;
- register vector unsigned short
- pixelssum1, pixelssum2, temp3,
- pixelssum3, pixelssum4, temp4;
- register const_vector unsigned char vczero = (const_vector unsigned char)vec_splat_u8(0);
- register const_vector unsigned short vcone = (const_vector unsigned short)vec_splat_u16(1);
- register const_vector unsigned short vctwo = (const_vector unsigned short)vec_splat_u16(2);
-
-POWERPC_PERF_START_COUNT(altivec_put_no_rnd_pixels16_xy2_num, 1);
-
- temp1 = vec_ld(0, pixels);
- temp2 = vec_ld(16, pixels);
- pixelsv1 = vec_perm(temp1, temp2, vec_lvsl(0, pixels));
- if ((((unsigned long)pixels) & 0x0000000F) == 0x0000000F)
- {
- pixelsv2 = temp2;
- }
- else
- {
- pixelsv2 = vec_perm(temp1, temp2, vec_lvsl(1, pixels));
- }
- pixelsv3 = vec_mergel(vczero, pixelsv1);
- pixelsv4 = vec_mergel(vczero, pixelsv2);
- pixelsv1 = vec_mergeh(vczero, pixelsv1);
- pixelsv2 = vec_mergeh(vczero, pixelsv2);
- pixelssum3 = vec_add((vector unsigned short)pixelsv3,
- (vector unsigned short)pixelsv4);
- pixelssum3 = vec_add(pixelssum3, vcone);
- pixelssum1 = vec_add((vector unsigned short)pixelsv1,
- (vector unsigned short)pixelsv2);
- pixelssum1 = vec_add(pixelssum1, vcone);
-
- for (i = 0; i < h ; i++) {
- blockv = vec_ld(0, block);
-
- temp1 = vec_ld(line_size, pixels);
- temp2 = vec_ld(line_size + 16, pixels);
- pixelsv1 = vec_perm(temp1, temp2, vec_lvsl(line_size, pixels));
- if (((((unsigned long)pixels) + line_size) & 0x0000000F) == 0x0000000F)
- {
- pixelsv2 = temp2;
- }
- else
- {
- pixelsv2 = vec_perm(temp1, temp2, vec_lvsl(line_size + 1, pixels));
- }
-
- pixelsv3 = vec_mergel(vczero, pixelsv1);
- pixelsv4 = vec_mergel(vczero, pixelsv2);
- pixelsv1 = vec_mergeh(vczero, pixelsv1);
- pixelsv2 = vec_mergeh(vczero, pixelsv2);
-
- pixelssum4 = vec_add((vector unsigned short)pixelsv3,
- (vector unsigned short)pixelsv4);
- pixelssum2 = vec_add((vector unsigned short)pixelsv1,
- (vector unsigned short)pixelsv2);
- temp4 = vec_add(pixelssum3, pixelssum4);
- temp4 = vec_sra(temp4, vctwo);
- temp3 = vec_add(pixelssum1, pixelssum2);
- temp3 = vec_sra(temp3, vctwo);
-
- pixelssum3 = vec_add(pixelssum4, vcone);
- pixelssum1 = vec_add(pixelssum2, vcone);
-
- blockv = vec_packsu(temp3, temp4);
-
- vec_st(blockv, 0, block);
-
- block += line_size;
- pixels += line_size;
- }
-
-POWERPC_PERF_STOP_COUNT(altivec_put_no_rnd_pixels16_xy2_num, 1);
-}
-
-int hadamard8_diff8x8_altivec(/*MpegEncContext*/ void *s, uint8_t *dst, uint8_t *src, int stride, int h){
-POWERPC_PERF_DECLARE(altivec_hadamard8_diff8x8_num, 1);
- int sum;
- register const_vector unsigned char vzero =
- (const_vector unsigned char)vec_splat_u8(0);
- register vector signed short temp0, temp1, temp2, temp3, temp4,
- temp5, temp6, temp7;
-POWERPC_PERF_START_COUNT(altivec_hadamard8_diff8x8_num, 1);
- {
- register const_vector signed short vprod1 =(const_vector signed short)
- AVV( 1,-1, 1,-1, 1,-1, 1,-1);
- register const_vector signed short vprod2 =(const_vector signed short)
- AVV( 1, 1,-1,-1, 1, 1,-1,-1);
- register const_vector signed short vprod3 =(const_vector signed short)
- AVV( 1, 1, 1, 1,-1,-1,-1,-1);
- register const_vector unsigned char perm1 = (const_vector unsigned char)
- AVV(0x02, 0x03, 0x00, 0x01, 0x06, 0x07, 0x04, 0x05,
- 0x0A, 0x0B, 0x08, 0x09, 0x0E, 0x0F, 0x0C, 0x0D);
- register const_vector unsigned char perm2 = (const_vector unsigned char)
- AVV(0x04, 0x05, 0x06, 0x07, 0x00, 0x01, 0x02, 0x03,
- 0x0C, 0x0D, 0x0E, 0x0F, 0x08, 0x09, 0x0A, 0x0B);
- register const_vector unsigned char perm3 = (const_vector unsigned char)
- AVV(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
-
-#define ONEITERBUTTERFLY(i, res) \
- { \
- register vector unsigned char src1, src2, srcO; \
- register vector unsigned char dst1, dst2, dstO; \
- register vector signed short srcV, dstV; \
- register vector signed short but0, but1, but2, op1, op2, op3; \
- src1 = vec_ld(stride * i, src); \
- src2 = vec_ld((stride * i) + 15, src); \
- srcO = vec_perm(src1, src2, vec_lvsl(stride * i, src)); \
- dst1 = vec_ld(stride * i, dst); \
- dst2 = vec_ld((stride * i) + 15, dst); \
- dstO = vec_perm(dst1, dst2, vec_lvsl(stride * i, dst)); \
- /* promote the unsigned chars to signed shorts */ \
- /* we're in the 8x8 function, we only care for the first 8 */ \
- srcV = \
- (vector signed short)vec_mergeh((vector signed char)vzero, \
- (vector signed char)srcO); \
- dstV = \
- (vector signed short)vec_mergeh((vector signed char)vzero, \
- (vector signed char)dstO); \
- /* substractions inside the first butterfly */ \
- but0 = vec_sub(srcV, dstV); \
- op1 = vec_perm(but0, but0, perm1); \
- but1 = vec_mladd(but0, vprod1, op1); \
- op2 = vec_perm(but1, but1, perm2); \
- but2 = vec_mladd(but1, vprod2, op2); \
- op3 = vec_perm(but2, but2, perm3); \
- res = vec_mladd(but2, vprod3, op3); \
- }
- ONEITERBUTTERFLY(0, temp0);
- ONEITERBUTTERFLY(1, temp1);
- ONEITERBUTTERFLY(2, temp2);
- ONEITERBUTTERFLY(3, temp3);
- ONEITERBUTTERFLY(4, temp4);
- ONEITERBUTTERFLY(5, temp5);
- ONEITERBUTTERFLY(6, temp6);
- ONEITERBUTTERFLY(7, temp7);
- }
-#undef ONEITERBUTTERFLY
- {
- register vector signed int vsum;
- register vector signed short line0 = vec_add(temp0, temp1);
- register vector signed short line1 = vec_sub(temp0, temp1);
- register vector signed short line2 = vec_add(temp2, temp3);
- register vector signed short line3 = vec_sub(temp2, temp3);
- register vector signed short line4 = vec_add(temp4, temp5);
- register vector signed short line5 = vec_sub(temp4, temp5);
- register vector signed short line6 = vec_add(temp6, temp7);
- register vector signed short line7 = vec_sub(temp6, temp7);
-
- register vector signed short line0B = vec_add(line0, line2);
- register vector signed short line2B = vec_sub(line0, line2);
- register vector signed short line1B = vec_add(line1, line3);
- register vector signed short line3B = vec_sub(line1, line3);
- register vector signed short line4B = vec_add(line4, line6);
- register vector signed short line6B = vec_sub(line4, line6);
- register vector signed short line5B = vec_add(line5, line7);
- register vector signed short line7B = vec_sub(line5, line7);
-
- register vector signed short line0C = vec_add(line0B, line4B);
- register vector signed short line4C = vec_sub(line0B, line4B);
- register vector signed short line1C = vec_add(line1B, line5B);
- register vector signed short line5C = vec_sub(line1B, line5B);
- register vector signed short line2C = vec_add(line2B, line6B);
- register vector signed short line6C = vec_sub(line2B, line6B);
- register vector signed short line3C = vec_add(line3B, line7B);
- register vector signed short line7C = vec_sub(line3B, line7B);
-
- vsum = vec_sum4s(vec_abs(line0C), vec_splat_s32(0));
- vsum = vec_sum4s(vec_abs(line1C), vsum);
- vsum = vec_sum4s(vec_abs(line2C), vsum);
- vsum = vec_sum4s(vec_abs(line3C), vsum);
- vsum = vec_sum4s(vec_abs(line4C), vsum);
- vsum = vec_sum4s(vec_abs(line5C), vsum);
- vsum = vec_sum4s(vec_abs(line6C), vsum);
- vsum = vec_sum4s(vec_abs(line7C), vsum);
- vsum = vec_sums(vsum, (vector signed int)vzero);
- vsum = vec_splat(vsum, 3);
- vec_ste(vsum, 0, &sum);
- }
-POWERPC_PERF_STOP_COUNT(altivec_hadamard8_diff8x8_num, 1);
- return sum;
-}
-
-/*
- 16x8 works with 16 elements ; it allows to avoid replicating
- loads, and give the compiler more rooms for scheduling.
- It's only used from inside hadamard8_diff16_altivec.
-
- Unfortunately, it seems gcc-3.3 is a bit dumb, and
- the compiled code has a LOT of spill code, it seems
- gcc (unlike xlc) cannot keep everything in registers
- by itself. The following code include hand-made
- registers allocation. It's not clean, but on
- a 7450 the resulting code is much faster (best case
- fall from 700+ cycles to 550).
-
- xlc doesn't add spill code, but it doesn't know how to
- schedule for the 7450, and its code isn't much faster than
- gcc-3.3 on the 7450 (but uses 25% less instructions...)
-
- On the 970, the hand-made RA is still a win (arount 690
- vs. around 780), but xlc goes to around 660 on the
- regular C code...
-*/
-
-static int hadamard8_diff16x8_altivec(/*MpegEncContext*/ void *s, uint8_t *dst, uint8_t *src, int stride, int h) {
- int sum;
- register vector signed short
- temp0 REG_v(v0),
- temp1 REG_v(v1),
- temp2 REG_v(v2),
- temp3 REG_v(v3),
- temp4 REG_v(v4),
- temp5 REG_v(v5),
- temp6 REG_v(v6),
- temp7 REG_v(v7);
- register vector signed short
- temp0S REG_v(v8),
- temp1S REG_v(v9),
- temp2S REG_v(v10),
- temp3S REG_v(v11),
- temp4S REG_v(v12),
- temp5S REG_v(v13),
- temp6S REG_v(v14),
- temp7S REG_v(v15);
- register const_vector unsigned char vzero REG_v(v31)=
- (const_vector unsigned char)vec_splat_u8(0);
- {
- register const_vector signed short vprod1 REG_v(v16)=
- (const_vector signed short)AVV( 1,-1, 1,-1, 1,-1, 1,-1);
- register const_vector signed short vprod2 REG_v(v17)=
- (const_vector signed short)AVV( 1, 1,-1,-1, 1, 1,-1,-1);
- register const_vector signed short vprod3 REG_v(v18)=
- (const_vector signed short)AVV( 1, 1, 1, 1,-1,-1,-1,-1);
- register const_vector unsigned char perm1 REG_v(v19)=
- (const_vector unsigned char)
- AVV(0x02, 0x03, 0x00, 0x01, 0x06, 0x07, 0x04, 0x05,
- 0x0A, 0x0B, 0x08, 0x09, 0x0E, 0x0F, 0x0C, 0x0D);
- register const_vector unsigned char perm2 REG_v(v20)=
- (const_vector unsigned char)
- AVV(0x04, 0x05, 0x06, 0x07, 0x00, 0x01, 0x02, 0x03,
- 0x0C, 0x0D, 0x0E, 0x0F, 0x08, 0x09, 0x0A, 0x0B);
- register const_vector unsigned char perm3 REG_v(v21)=
- (const_vector unsigned char)
- AVV(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
-
-#define ONEITERBUTTERFLY(i, res1, res2) \
- { \
- register vector unsigned char src1 REG_v(v22), \
- src2 REG_v(v23), \
- dst1 REG_v(v24), \
- dst2 REG_v(v25), \
- srcO REG_v(v22), \
- dstO REG_v(v23); \
- \
- register vector signed short srcV REG_v(v24), \
- dstV REG_v(v25), \
- srcW REG_v(v26), \
- dstW REG_v(v27), \
- but0 REG_v(v28), \
- but0S REG_v(v29), \
- op1 REG_v(v30), \
- but1 REG_v(v22), \
- op1S REG_v(v23), \
- but1S REG_v(v24), \
- op2 REG_v(v25), \
- but2 REG_v(v26), \
- op2S REG_v(v27), \
- but2S REG_v(v28), \
- op3 REG_v(v29), \
- op3S REG_v(v30); \
- \
- src1 = vec_ld(stride * i, src); \
- src2 = vec_ld((stride * i) + 16, src); \
- srcO = vec_perm(src1, src2, vec_lvsl(stride * i, src)); \
- dst1 = vec_ld(stride * i, dst); \
- dst2 = vec_ld((stride * i) + 16, dst); \
- dstO = vec_perm(dst1, dst2, vec_lvsl(stride * i, dst)); \
- /* promote the unsigned chars to signed shorts */ \
- srcV = \
- (vector signed short)vec_mergeh((vector signed char)vzero, \
- (vector signed char)srcO); \
- dstV = \
- (vector signed short)vec_mergeh((vector signed char)vzero, \
- (vector signed char)dstO); \
- srcW = \
- (vector signed short)vec_mergel((vector signed char)vzero, \
- (vector signed char)srcO); \
- dstW = \
- (vector signed short)vec_mergel((vector signed char)vzero, \
- (vector signed char)dstO); \
- /* substractions inside the first butterfly */ \
- but0 = vec_sub(srcV, dstV); \
- but0S = vec_sub(srcW, dstW); \
- op1 = vec_perm(but0, but0, perm1); \
- but1 = vec_mladd(but0, vprod1, op1); \
- op1S = vec_perm(but0S, but0S, perm1); \
- but1S = vec_mladd(but0S, vprod1, op1S); \
- op2 = vec_perm(but1, but1, perm2); \
- but2 = vec_mladd(but1, vprod2, op2); \
- op2S = vec_perm(but1S, but1S, perm2); \
- but2S = vec_mladd(but1S, vprod2, op2S); \
- op3 = vec_perm(but2, but2, perm3); \
- res1 = vec_mladd(but2, vprod3, op3); \
- op3S = vec_perm(but2S, but2S, perm3); \
- res2 = vec_mladd(but2S, vprod3, op3S); \
- }
- ONEITERBUTTERFLY(0, temp0, temp0S);
- ONEITERBUTTERFLY(1, temp1, temp1S);
- ONEITERBUTTERFLY(2, temp2, temp2S);
- ONEITERBUTTERFLY(3, temp3, temp3S);
- ONEITERBUTTERFLY(4, temp4, temp4S);
- ONEITERBUTTERFLY(5, temp5, temp5S);
- ONEITERBUTTERFLY(6, temp6, temp6S);
- ONEITERBUTTERFLY(7, temp7, temp7S);
- }
-#undef ONEITERBUTTERFLY
- {
- register vector signed int vsum;
- register vector signed short line0S, line1S, line2S, line3S, line4S,
- line5S, line6S, line7S, line0BS,line2BS,
- line1BS,line3BS,line4BS,line6BS,line5BS,
- line7BS,line0CS,line4CS,line1CS,line5CS,
- line2CS,line6CS,line3CS,line7CS;
-
- register vector signed short line0 = vec_add(temp0, temp1);
- register vector signed short line1 = vec_sub(temp0, temp1);
- register vector signed short line2 = vec_add(temp2, temp3);
- register vector signed short line3 = vec_sub(temp2, temp3);
- register vector signed short line4 = vec_add(temp4, temp5);
- register vector signed short line5 = vec_sub(temp4, temp5);
- register vector signed short line6 = vec_add(temp6, temp7);
- register vector signed short line7 = vec_sub(temp6, temp7);
-
- register vector signed short line0B = vec_add(line0, line2);
- register vector signed short line2B = vec_sub(line0, line2);
- register vector signed short line1B = vec_add(line1, line3);
- register vector signed short line3B = vec_sub(line1, line3);
- register vector signed short line4B = vec_add(line4, line6);
- register vector signed short line6B = vec_sub(line4, line6);
- register vector signed short line5B = vec_add(line5, line7);
- register vector signed short line7B = vec_sub(line5, line7);
-
- register vector signed short line0C = vec_add(line0B, line4B);
- register vector signed short line4C = vec_sub(line0B, line4B);
- register vector signed short line1C = vec_add(line1B, line5B);
- register vector signed short line5C = vec_sub(line1B, line5B);
- register vector signed short line2C = vec_add(line2B, line6B);
- register vector signed short line6C = vec_sub(line2B, line6B);
- register vector signed short line3C = vec_add(line3B, line7B);
- register vector signed short line7C = vec_sub(line3B, line7B);
-
- vsum = vec_sum4s(vec_abs(line0C), vec_splat_s32(0));
- vsum = vec_sum4s(vec_abs(line1C), vsum);
- vsum = vec_sum4s(vec_abs(line2C), vsum);
- vsum = vec_sum4s(vec_abs(line3C), vsum);
- vsum = vec_sum4s(vec_abs(line4C), vsum);
- vsum = vec_sum4s(vec_abs(line5C), vsum);
- vsum = vec_sum4s(vec_abs(line6C), vsum);
- vsum = vec_sum4s(vec_abs(line7C), vsum);
-
- line0S = vec_add(temp0S, temp1S);
- line1S = vec_sub(temp0S, temp1S);
- line2S = vec_add(temp2S, temp3S);
- line3S = vec_sub(temp2S, temp3S);
- line4S = vec_add(temp4S, temp5S);
- line5S = vec_sub(temp4S, temp5S);
- line6S = vec_add(temp6S, temp7S);
- line7S = vec_sub(temp6S, temp7S);
-
- line0BS = vec_add(line0S, line2S);
- line2BS = vec_sub(line0S, line2S);
- line1BS = vec_add(line1S, line3S);
- line3BS = vec_sub(line1S, line3S);
- line4BS = vec_add(line4S, line6S);
- line6BS = vec_sub(line4S, line6S);
- line5BS = vec_add(line5S, line7S);
- line7BS = vec_sub(line5S, line7S);
-
- line0CS = vec_add(line0BS, line4BS);
- line4CS = vec_sub(line0BS, line4BS);
- line1CS = vec_add(line1BS, line5BS);
- line5CS = vec_sub(line1BS, line5BS);
- line2CS = vec_add(line2BS, line6BS);
- line6CS = vec_sub(line2BS, line6BS);
- line3CS = vec_add(line3BS, line7BS);
- line7CS = vec_sub(line3BS, line7BS);
-
- vsum = vec_sum4s(vec_abs(line0CS), vsum);
- vsum = vec_sum4s(vec_abs(line1CS), vsum);
- vsum = vec_sum4s(vec_abs(line2CS), vsum);
- vsum = vec_sum4s(vec_abs(line3CS), vsum);
- vsum = vec_sum4s(vec_abs(line4CS), vsum);
- vsum = vec_sum4s(vec_abs(line5CS), vsum);
- vsum = vec_sum4s(vec_abs(line6CS), vsum);
- vsum = vec_sum4s(vec_abs(line7CS), vsum);
- vsum = vec_sums(vsum, (vector signed int)vzero);
- vsum = vec_splat(vsum, 3);
- vec_ste(vsum, 0, &sum);
- }
- return sum;
-}
-
-int hadamard8_diff16_altivec(/*MpegEncContext*/ void *s, uint8_t *dst, uint8_t *src, int stride, int h){
-POWERPC_PERF_DECLARE(altivec_hadamard8_diff16_num, 1);
- int score;
-POWERPC_PERF_START_COUNT(altivec_hadamard8_diff16_num, 1);
- score = hadamard8_diff16x8_altivec(s, dst, src, stride, 8);
- if (h==16) {
- dst += 8*stride;
- src += 8*stride;
- score += hadamard8_diff16x8_altivec(s, dst, src, stride, 8);
- }
-POWERPC_PERF_STOP_COUNT(altivec_hadamard8_diff16_num, 1);
- return score;
-}
-
-int has_altivec(void)
-{
-#ifdef __AMIGAOS4__
- ULONG result = 0;
- extern struct ExecIFace *IExec;
-
- IExec->GetCPUInfoTags(GCIT_VectorUnit, &result, TAG_DONE);
- if (result == VECTORTYPE_ALTIVEC) return 1;
- return 0;
-#else /* __AMIGAOS4__ */
-
-#ifdef CONFIG_DARWIN
- int sels[2] = {CTL_HW, HW_VECTORUNIT};
- int has_vu = 0;
- size_t len = sizeof(has_vu);
- int err;
-
- err = sysctl(sels, 2, &has_vu, &len, NULL, 0);
-
- if (err == 0) return (has_vu != 0);
-#else /* CONFIG_DARWIN */
-/* no Darwin, do it the brute-force way */
-/* this is borrowed from the libmpeg2 library */
- {
- signal (SIGILL, sigill_handler);
- if (sigsetjmp (jmpbuf, 1)) {
- signal (SIGILL, SIG_DFL);
- } else {
- canjump = 1;
-
- asm volatile ("mtspr 256, %0\n\t"
- "vand %%v0, %%v0, %%v0"
- :
- : "r" (-1));
-
- signal (SIGILL, SIG_DFL);
- return 1;
- }
- }
-#endif /* CONFIG_DARWIN */
- return 0;
-#endif /* __AMIGAOS4__ */
-}
-
-static void vorbis_inverse_coupling_altivec(float *mag, float *ang,
- int blocksize)
-{
- int i;
- vector float m, a;
- vector bool int t0, t1;
- const vector unsigned int v_31 = //XXX
- vec_add(vec_add(vec_splat_u32(15),vec_splat_u32(15)),vec_splat_u32(1));
- for(i=0; i<blocksize; i+=4) {
- m = vec_ld(0, mag+i);
- a = vec_ld(0, ang+i);
- t0 = vec_cmple(m, (vector float)vec_splat_u32(0));
- t1 = vec_cmple(a, (vector float)vec_splat_u32(0));
- a = vec_xor(a, (vector float) vec_sl((vector unsigned int)t0, v_31));
- t0 = (vector bool int)vec_and(a, t1);
- t1 = (vector bool int)vec_andc(a, t1);
- a = vec_sub(m, (vector float)t1);
- m = vec_add(m, (vector float)t0);
- vec_stl(a, 0, ang+i);
- vec_stl(m, 0, mag+i);
- }
-}
-
-/* next one assumes that ((line_size % 8) == 0) */
-void avg_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h)
-{
-POWERPC_PERF_DECLARE(altivec_avg_pixels8_xy2_num, 1);
- register int i;
- register vector unsigned char pixelsv1, pixelsv2, pixelsavg;
- register vector unsigned char blockv, temp1, temp2, blocktemp;
- register vector unsigned short pixelssum1, pixelssum2, temp3;
-
- register const_vector unsigned char vczero = (const_vector unsigned char)
- vec_splat_u8(0);
- register const_vector unsigned short vctwo = (const_vector unsigned short)
- vec_splat_u16(2);
-
- temp1 = vec_ld(0, pixels);
- temp2 = vec_ld(16, pixels);
- pixelsv1 = vec_perm(temp1, temp2, vec_lvsl(0, pixels));
- if ((((unsigned long)pixels) & 0x0000000F) == 0x0000000F) {
- pixelsv2 = temp2;
- } else {
- pixelsv2 = vec_perm(temp1, temp2, vec_lvsl(1, pixels));
- }
- pixelsv1 = vec_mergeh(vczero, pixelsv1);
- pixelsv2 = vec_mergeh(vczero, pixelsv2);
- pixelssum1 = vec_add((vector unsigned short)pixelsv1,
- (vector unsigned short)pixelsv2);
- pixelssum1 = vec_add(pixelssum1, vctwo);
-
-POWERPC_PERF_START_COUNT(altivec_avg_pixels8_xy2_num, 1);
- for (i = 0; i < h ; i++) {
- int rightside = ((unsigned long)block & 0x0000000F);
- blockv = vec_ld(0, block);
-
- temp1 = vec_ld(line_size, pixels);
- temp2 = vec_ld(line_size + 16, pixels);
- pixelsv1 = vec_perm(temp1, temp2, vec_lvsl(line_size, pixels));
- if (((((unsigned long)pixels) + line_size) & 0x0000000F) == 0x0000000F)
- {
- pixelsv2 = temp2;
- } else {
- pixelsv2 = vec_perm(temp1, temp2, vec_lvsl(line_size + 1, pixels));
- }
-
- pixelsv1 = vec_mergeh(vczero, pixelsv1);
- pixelsv2 = vec_mergeh(vczero, pixelsv2);
- pixelssum2 = vec_add((vector unsigned short)pixelsv1,
- (vector unsigned short)pixelsv2);
- temp3 = vec_add(pixelssum1, pixelssum2);
- temp3 = vec_sra(temp3, vctwo);
- pixelssum1 = vec_add(pixelssum2, vctwo);
- pixelsavg = vec_packsu(temp3, (vector unsigned short) vczero);
-
- if (rightside) {
- blocktemp = vec_perm(blockv, pixelsavg, vcprm(0, 1, s0, s1));
- } else {
- blocktemp = vec_perm(blockv, pixelsavg, vcprm(s0, s1, 2, 3));
- }
-
- blockv = vec_avg(blocktemp, blockv);
- vec_st(blockv, 0, block);
-
- block += line_size;
- pixels += line_size;
- }
-
-POWERPC_PERF_STOP_COUNT(altivec_avg_pixels8_xy2_num, 1);
-}
-
-void dsputil_init_altivec(DSPContext* c, AVCodecContext *avctx)
-{
- c->pix_abs[0][1] = sad16_x2_altivec;
- c->pix_abs[0][2] = sad16_y2_altivec;
- c->pix_abs[0][3] = sad16_xy2_altivec;
- c->pix_abs[0][0] = sad16_altivec;
- c->pix_abs[1][0] = sad8_altivec;
- c->sad[0]= sad16_altivec;
- c->sad[1]= sad8_altivec;
- c->pix_norm1 = pix_norm1_altivec;
- c->sse[1]= sse8_altivec;
- c->sse[0]= sse16_altivec;
- c->pix_sum = pix_sum_altivec;
- c->diff_pixels = diff_pixels_altivec;
- c->get_pixels = get_pixels_altivec;
- c->add_bytes= add_bytes_altivec;
- c->put_pixels_tab[0][0] = put_pixels16_altivec;
- /* the two functions do the same thing, so use the same code */
- c->put_no_rnd_pixels_tab[0][0] = put_pixels16_altivec;
- c->avg_pixels_tab[0][0] = avg_pixels16_altivec;
- c->avg_pixels_tab[1][0] = avg_pixels8_altivec;
- c->avg_pixels_tab[1][3] = avg_pixels8_xy2_altivec;
- c->put_pixels_tab[1][3] = put_pixels8_xy2_altivec;
- c->put_no_rnd_pixels_tab[1][3] = put_no_rnd_pixels8_xy2_altivec;
- c->put_pixels_tab[0][3] = put_pixels16_xy2_altivec;
- c->put_no_rnd_pixels_tab[0][3] = put_no_rnd_pixels16_xy2_altivec;
-
- c->hadamard8_diff[0] = hadamard8_diff16_altivec;
- c->hadamard8_diff[1] = hadamard8_diff8x8_altivec;
-#ifdef CONFIG_VORBIS_DECODER
- c->vorbis_inverse_coupling = vorbis_inverse_coupling_altivec;
-#endif
-}
diff --git a/src/libffmpeg/libavcodec/ppc/dsputil_altivec.h b/src/libffmpeg/libavcodec/ppc/dsputil_altivec.h
deleted file mode 100644
index 560d778bb..000000000
--- a/src/libffmpeg/libavcodec/ppc/dsputil_altivec.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 2002 Brian Foley
- * Copyright (c) 2002 Dieter Shirley
- * Copyright (c) 2003-2004 Romain Dolbeau <romain@dolbeau.org>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _DSPUTIL_ALTIVEC_
-#define _DSPUTIL_ALTIVEC_
-
-#include "dsputil_ppc.h"
-
-#ifdef HAVE_ALTIVEC
-
-extern int has_altivec(void);
-
-void put_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h);
-
-void avg_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h);
-
-// used to build registers permutation vectors (vcprm)
-// the 's' are for words in the _s_econd vector
-#define WORD_0 0x00,0x01,0x02,0x03
-#define WORD_1 0x04,0x05,0x06,0x07
-#define WORD_2 0x08,0x09,0x0a,0x0b
-#define WORD_3 0x0c,0x0d,0x0e,0x0f
-#define WORD_s0 0x10,0x11,0x12,0x13
-#define WORD_s1 0x14,0x15,0x16,0x17
-#define WORD_s2 0x18,0x19,0x1a,0x1b
-#define WORD_s3 0x1c,0x1d,0x1e,0x1f
-
-#ifdef CONFIG_DARWIN
-#define vcprm(a,b,c,d) (const vector unsigned char)(WORD_ ## a, WORD_ ## b, WORD_ ## c, WORD_ ## d)
-#else
-#define vcprm(a,b,c,d) (const vector unsigned char){WORD_ ## a, WORD_ ## b, WORD_ ## c, WORD_ ## d}
-#endif
-
-// vcprmle is used to keep the same index as in the SSE version.
-// it's the same as vcprm, with the index inversed
-// ('le' is Little Endian)
-#define vcprmle(a,b,c,d) vcprm(d,c,b,a)
-
-// used to build inverse/identity vectors (vcii)
-// n is _n_egative, p is _p_ositive
-#define FLOAT_n -1.
-#define FLOAT_p 1.
-
-
-#ifdef CONFIG_DARWIN
-#define vcii(a,b,c,d) (const vector float)(FLOAT_ ## a, FLOAT_ ## b, FLOAT_ ## c, FLOAT_ ## d)
-#else
-#define vcii(a,b,c,d) (const vector float){FLOAT_ ## a, FLOAT_ ## b, FLOAT_ ## c, FLOAT_ ## d}
-#endif
-
-// Transpose 8x8 matrix of 16-bit elements (in-place)
-#define TRANSPOSE8(a,b,c,d,e,f,g,h) \
-do { \
- vector signed short A1, B1, C1, D1, E1, F1, G1, H1; \
- vector signed short A2, B2, C2, D2, E2, F2, G2, H2; \
- \
- A1 = vec_mergeh (a, e); \
- B1 = vec_mergel (a, e); \
- C1 = vec_mergeh (b, f); \
- D1 = vec_mergel (b, f); \
- E1 = vec_mergeh (c, g); \
- F1 = vec_mergel (c, g); \
- G1 = vec_mergeh (d, h); \
- H1 = vec_mergel (d, h); \
- \
- A2 = vec_mergeh (A1, E1); \
- B2 = vec_mergel (A1, E1); \
- C2 = vec_mergeh (B1, F1); \
- D2 = vec_mergel (B1, F1); \
- E2 = vec_mergeh (C1, G1); \
- F2 = vec_mergel (C1, G1); \
- G2 = vec_mergeh (D1, H1); \
- H2 = vec_mergel (D1, H1); \
- \
- a = vec_mergeh (A2, E2); \
- b = vec_mergel (A2, E2); \
- c = vec_mergeh (B2, F2); \
- d = vec_mergel (B2, F2); \
- e = vec_mergeh (C2, G2); \
- f = vec_mergel (C2, G2); \
- g = vec_mergeh (D2, H2); \
- h = vec_mergel (D2, H2); \
-} while (0)
-
-#endif /* HAVE_ALTIVEC */
-
-#endif /* _DSPUTIL_ALTIVEC_ */
diff --git a/src/libffmpeg/libavcodec/ppc/dsputil_h264_altivec.c b/src/libffmpeg/libavcodec/ppc/dsputil_h264_altivec.c
deleted file mode 100644
index 14391e60c..000000000
--- a/src/libffmpeg/libavcodec/ppc/dsputil_h264_altivec.c
+++ /dev/null
@@ -1,319 +0,0 @@
-/*
- * Copyright (c) 2004 Romain Dolbeau <romain@dolbeau.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "../dsputil.h"
-
-#include "gcc_fixes.h"
-
-#include "dsputil_altivec.h"
-
-#define PUT_OP_U8_ALTIVEC(d, s, dst) d = s
-#define AVG_OP_U8_ALTIVEC(d, s, dst) d = vec_avg(dst, s)
-
-#define OP_U8_ALTIVEC PUT_OP_U8_ALTIVEC
-#define PREFIX_h264_chroma_mc8_altivec put_h264_chroma_mc8_altivec
-#define PREFIX_h264_chroma_mc8_num altivec_put_h264_chroma_mc8_num
-#define PREFIX_h264_qpel16_h_lowpass_altivec put_h264_qpel16_h_lowpass_altivec
-#define PREFIX_h264_qpel16_h_lowpass_num altivec_put_h264_qpel16_h_lowpass_num
-#define PREFIX_h264_qpel16_v_lowpass_altivec put_h264_qpel16_v_lowpass_altivec
-#define PREFIX_h264_qpel16_v_lowpass_num altivec_put_h264_qpel16_v_lowpass_num
-#define PREFIX_h264_qpel16_hv_lowpass_altivec put_h264_qpel16_hv_lowpass_altivec
-#define PREFIX_h264_qpel16_hv_lowpass_num altivec_put_h264_qpel16_hv_lowpass_num
-#include "dsputil_h264_template_altivec.c"
-#undef OP_U8_ALTIVEC
-#undef PREFIX_h264_chroma_mc8_altivec
-#undef PREFIX_h264_chroma_mc8_num
-#undef PREFIX_h264_qpel16_h_lowpass_altivec
-#undef PREFIX_h264_qpel16_h_lowpass_num
-#undef PREFIX_h264_qpel16_v_lowpass_altivec
-#undef PREFIX_h264_qpel16_v_lowpass_num
-#undef PREFIX_h264_qpel16_hv_lowpass_altivec
-#undef PREFIX_h264_qpel16_hv_lowpass_num
-
-#define OP_U8_ALTIVEC AVG_OP_U8_ALTIVEC
-#define PREFIX_h264_chroma_mc8_altivec avg_h264_chroma_mc8_altivec
-#define PREFIX_h264_chroma_mc8_num altivec_avg_h264_chroma_mc8_num
-#define PREFIX_h264_qpel16_h_lowpass_altivec avg_h264_qpel16_h_lowpass_altivec
-#define PREFIX_h264_qpel16_h_lowpass_num altivec_avg_h264_qpel16_h_lowpass_num
-#define PREFIX_h264_qpel16_v_lowpass_altivec avg_h264_qpel16_v_lowpass_altivec
-#define PREFIX_h264_qpel16_v_lowpass_num altivec_avg_h264_qpel16_v_lowpass_num
-#define PREFIX_h264_qpel16_hv_lowpass_altivec avg_h264_qpel16_hv_lowpass_altivec
-#define PREFIX_h264_qpel16_hv_lowpass_num altivec_avg_h264_qpel16_hv_lowpass_num
-#include "dsputil_h264_template_altivec.c"
-#undef OP_U8_ALTIVEC
-#undef PREFIX_h264_chroma_mc8_altivec
-#undef PREFIX_h264_chroma_mc8_num
-#undef PREFIX_h264_qpel16_h_lowpass_altivec
-#undef PREFIX_h264_qpel16_h_lowpass_num
-#undef PREFIX_h264_qpel16_v_lowpass_altivec
-#undef PREFIX_h264_qpel16_v_lowpass_num
-#undef PREFIX_h264_qpel16_hv_lowpass_altivec
-#undef PREFIX_h264_qpel16_hv_lowpass_num
-
-#define H264_MC(OPNAME, SIZE, CODETYPE) \
-static void OPNAME ## h264_qpel ## SIZE ## _mc00_ ## CODETYPE (uint8_t *dst, uint8_t *src, int stride){\
- OPNAME ## pixels ## SIZE ## _ ## CODETYPE(dst, src, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc10_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){ \
- DECLARE_ALIGNED_16(uint64_t, temp[SIZE*SIZE/8]);\
- uint8_t * const half= (uint8_t*)temp;\
- put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(half, src, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src, half, stride, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc20_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- OPNAME ## h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(dst, src, stride, stride);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc30_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- DECLARE_ALIGNED_16(uint64_t, temp[SIZE*SIZE/8]);\
- uint8_t * const half= (uint8_t*)temp;\
- put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(half, src, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src+1, half, stride, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc01_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- DECLARE_ALIGNED_16(uint64_t, temp[SIZE*SIZE/8]);\
- uint8_t * const half= (uint8_t*)temp;\
- put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(half, src, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src, half, stride, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc02_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- OPNAME ## h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(dst, src, stride, stride);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc03_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- DECLARE_ALIGNED_16(uint64_t, temp[SIZE*SIZE/8]);\
- uint8_t * const half= (uint8_t*)temp;\
- put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(half, src, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src+stride, half, stride, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc11_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- DECLARE_ALIGNED_16(uint64_t, temp[SIZE*SIZE/4]);\
- uint8_t * const halfH= (uint8_t*)temp;\
- uint8_t * const halfV= ((uint8_t*)temp) + SIZE*SIZE;\
- put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src, SIZE, stride);\
- put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfV, stride, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc31_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- DECLARE_ALIGNED_16(uint64_t, temp[SIZE*SIZE/4]);\
- uint8_t * const halfH= (uint8_t*)temp;\
- uint8_t * const halfV= ((uint8_t*)temp) + SIZE*SIZE;\
- put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src, SIZE, stride);\
- put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src+1, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfV, stride, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc13_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- DECLARE_ALIGNED_16(uint64_t, temp[SIZE*SIZE/4]);\
- uint8_t * const halfH= (uint8_t*)temp;\
- uint8_t * const halfV= ((uint8_t*)temp) + SIZE*SIZE;\
- put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src + stride, SIZE, stride);\
- put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfV, stride, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc33_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- DECLARE_ALIGNED_16(uint64_t, temp[SIZE*SIZE/4]);\
- uint8_t * const halfH= (uint8_t*)temp;\
- uint8_t * const halfV= ((uint8_t*)temp) + SIZE*SIZE;\
- put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src + stride, SIZE, stride);\
- put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src+1, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfV, stride, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc22_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- DECLARE_ALIGNED_16(uint64_t, temp[SIZE*(SIZE+8)/4]);\
- int16_t * const tmp= (int16_t*)temp;\
- OPNAME ## h264_qpel ## SIZE ## _hv_lowpass_ ## CODETYPE(dst, tmp, src, stride, SIZE, stride);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc21_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- DECLARE_ALIGNED_16(uint64_t, temp[SIZE*(SIZE+8)/4 + SIZE*SIZE/4]);\
- uint8_t * const halfH= (uint8_t*)temp;\
- uint8_t * const halfHV= ((uint8_t*)temp) + SIZE*SIZE;\
- int16_t * const tmp= ((int16_t*)temp) + SIZE*SIZE;\
- put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src, SIZE, stride);\
- put_h264_qpel ## SIZE ## _hv_lowpass_ ## CODETYPE(halfHV, tmp, src, SIZE, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfHV, stride, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc23_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- DECLARE_ALIGNED_16(uint64_t, temp[SIZE*(SIZE+8)/4 + SIZE*SIZE/4]);\
- uint8_t * const halfH= (uint8_t*)temp;\
- uint8_t * const halfHV= ((uint8_t*)temp) + SIZE*SIZE;\
- int16_t * const tmp= ((int16_t*)temp) + SIZE*SIZE;\
- put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src + stride, SIZE, stride);\
- put_h264_qpel ## SIZE ## _hv_lowpass_ ## CODETYPE(halfHV, tmp, src, SIZE, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfHV, stride, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc12_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- DECLARE_ALIGNED_16(uint64_t, temp[SIZE*(SIZE+8)/4 + SIZE*SIZE/4]);\
- uint8_t * const halfV= (uint8_t*)temp;\
- uint8_t * const halfHV= ((uint8_t*)temp) + SIZE*SIZE;\
- int16_t * const tmp= ((int16_t*)temp) + SIZE*SIZE;\
- put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src, SIZE, stride);\
- put_h264_qpel ## SIZE ## _hv_lowpass_ ## CODETYPE(halfHV, tmp, src, SIZE, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfV, halfHV, stride, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc32_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- DECLARE_ALIGNED_16(uint64_t, temp[SIZE*(SIZE+8)/4 + SIZE*SIZE/4]);\
- uint8_t * const halfV= (uint8_t*)temp;\
- uint8_t * const halfHV= ((uint8_t*)temp) + SIZE*SIZE;\
- int16_t * const tmp= ((int16_t*)temp) + SIZE*SIZE;\
- put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src+1, SIZE, stride);\
- put_h264_qpel ## SIZE ## _hv_lowpass_ ## CODETYPE(halfHV, tmp, src, SIZE, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfV, halfHV, stride, SIZE, SIZE);\
-}\
-
-static inline void put_pixels16_l2_altivec( uint8_t * dst, const uint8_t * src1,
- const uint8_t * src2, int dst_stride,
- int src_stride1, int h)
-{
- int i;
- vector unsigned char a, b, d, tmp1, tmp2, mask, mask_, edges, align;
-
- mask_ = vec_lvsl(0, src2);
-
- for (i = 0; i < h; i++) {
-
- tmp1 = vec_ld(i * src_stride1, src1);
- mask = vec_lvsl(i * src_stride1, src1);
- tmp2 = vec_ld(i * src_stride1 + 15, src1);
-
- a = vec_perm(tmp1, tmp2, mask);
-
- tmp1 = vec_ld(i * 16, src2);
- tmp2 = vec_ld(i * 16 + 15, src2);
-
- b = vec_perm(tmp1, tmp2, mask_);
-
- tmp1 = vec_ld(0, dst);
- mask = vec_lvsl(0, dst);
- tmp2 = vec_ld(15, dst);
-
- d = vec_avg(a, b);
-
- edges = vec_perm(tmp2, tmp1, mask);
-
- align = vec_lvsr(0, dst);
-
- tmp1 = vec_perm(edges, d, align);
- tmp2 = vec_perm(d, edges, align);
-
- vec_st(tmp2, 15, dst);
- vec_st(tmp1, 0 , dst);
-
- dst += dst_stride;
- }
-}
-
-static inline void avg_pixels16_l2_altivec( uint8_t * dst, const uint8_t * src1,
- const uint8_t * src2, int dst_stride,
- int src_stride1, int h)
-{
- int i;
- vector unsigned char a, b, d, tmp1, tmp2, mask, mask_, edges, align;
-
- mask_ = vec_lvsl(0, src2);
-
- for (i = 0; i < h; i++) {
-
- tmp1 = vec_ld(i * src_stride1, src1);
- mask = vec_lvsl(i * src_stride1, src1);
- tmp2 = vec_ld(i * src_stride1 + 15, src1);
-
- a = vec_perm(tmp1, tmp2, mask);
-
- tmp1 = vec_ld(i * 16, src2);
- tmp2 = vec_ld(i * 16 + 15, src2);
-
- b = vec_perm(tmp1, tmp2, mask_);
-
- tmp1 = vec_ld(0, dst);
- mask = vec_lvsl(0, dst);
- tmp2 = vec_ld(15, dst);
-
- d = vec_avg(vec_perm(tmp1, tmp2, mask), vec_avg(a, b));
-
- edges = vec_perm(tmp2, tmp1, mask);
-
- align = vec_lvsr(0, dst);
-
- tmp1 = vec_perm(edges, d, align);
- tmp2 = vec_perm(d, edges, align);
-
- vec_st(tmp2, 15, dst);
- vec_st(tmp1, 0 , dst);
-
- dst += dst_stride;
- }
-}
-
-/* Implemented but could be faster
-#define put_pixels16_l2_altivec(d,s1,s2,ds,s1s,h) put_pixels16_l2(d,s1,s2,ds,s1s,16,h)
-#define avg_pixels16_l2_altivec(d,s1,s2,ds,s1s,h) avg_pixels16_l2(d,s1,s2,ds,s1s,16,h)
- */
-
- H264_MC(put_, 16, altivec)
- H264_MC(avg_, 16, altivec)
-
-void dsputil_h264_init_ppc(DSPContext* c, AVCodecContext *avctx) {
-
-#ifdef HAVE_ALTIVEC
- if (has_altivec()) {
- c->put_h264_chroma_pixels_tab[0] = put_h264_chroma_mc8_altivec;
- c->avg_h264_chroma_pixels_tab[0] = avg_h264_chroma_mc8_altivec;
-
-#define dspfunc(PFX, IDX, NUM) \
- c->PFX ## _pixels_tab[IDX][ 0] = PFX ## NUM ## _mc00_altivec; \
- c->PFX ## _pixels_tab[IDX][ 1] = PFX ## NUM ## _mc10_altivec; \
- c->PFX ## _pixels_tab[IDX][ 2] = PFX ## NUM ## _mc20_altivec; \
- c->PFX ## _pixels_tab[IDX][ 3] = PFX ## NUM ## _mc30_altivec; \
- c->PFX ## _pixels_tab[IDX][ 4] = PFX ## NUM ## _mc01_altivec; \
- c->PFX ## _pixels_tab[IDX][ 5] = PFX ## NUM ## _mc11_altivec; \
- c->PFX ## _pixels_tab[IDX][ 6] = PFX ## NUM ## _mc21_altivec; \
- c->PFX ## _pixels_tab[IDX][ 7] = PFX ## NUM ## _mc31_altivec; \
- c->PFX ## _pixels_tab[IDX][ 8] = PFX ## NUM ## _mc02_altivec; \
- c->PFX ## _pixels_tab[IDX][ 9] = PFX ## NUM ## _mc12_altivec; \
- c->PFX ## _pixels_tab[IDX][10] = PFX ## NUM ## _mc22_altivec; \
- c->PFX ## _pixels_tab[IDX][11] = PFX ## NUM ## _mc32_altivec; \
- c->PFX ## _pixels_tab[IDX][12] = PFX ## NUM ## _mc03_altivec; \
- c->PFX ## _pixels_tab[IDX][13] = PFX ## NUM ## _mc13_altivec; \
- c->PFX ## _pixels_tab[IDX][14] = PFX ## NUM ## _mc23_altivec; \
- c->PFX ## _pixels_tab[IDX][15] = PFX ## NUM ## _mc33_altivec
-
- dspfunc(put_h264_qpel, 0, 16);
- dspfunc(avg_h264_qpel, 0, 16);
-#undef dspfunc
-
- } else
-#endif /* HAVE_ALTIVEC */
- {
- // Non-AltiVec PPC optimisations
-
- // ... pending ...
- }
-}
diff --git a/src/libffmpeg/libavcodec/ppc/dsputil_h264_template_altivec.c b/src/libffmpeg/libavcodec/ppc/dsputil_h264_template_altivec.c
deleted file mode 100644
index 37f4de58f..000000000
--- a/src/libffmpeg/libavcodec/ppc/dsputil_h264_template_altivec.c
+++ /dev/null
@@ -1,717 +0,0 @@
-/*
- * Copyright (c) 2004 Romain Dolbeau <romain@dolbeau.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/* this code assume that stride % 16 == 0 */
-void PREFIX_h264_chroma_mc8_altivec(uint8_t * dst, uint8_t * src, int stride, int h, int x, int y) {
- POWERPC_PERF_DECLARE(PREFIX_h264_chroma_mc8_num, 1);
- signed int ABCD[4] __attribute__((aligned(16))) =
- {((8 - x) * (8 - y)),
- ((x) * (8 - y)),
- ((8 - x) * (y)),
- ((x) * (y))};
- register int i;
- vector unsigned char fperm;
- const vector signed int vABCD = vec_ld(0, ABCD);
- const vector signed short vA = vec_splat((vector signed short)vABCD, 1);
- const vector signed short vB = vec_splat((vector signed short)vABCD, 3);
- const vector signed short vC = vec_splat((vector signed short)vABCD, 5);
- const vector signed short vD = vec_splat((vector signed short)vABCD, 7);
- const vector signed int vzero = vec_splat_s32(0);
- const vector signed short v32ss = vec_sl(vec_splat_s16(1),vec_splat_u16(5));
- const vector unsigned short v6us = vec_splat_u16(6);
- register int loadSecond = (((unsigned long)src) % 16) <= 7 ? 0 : 1;
- register int reallyBadAlign = (((unsigned long)src) % 16) == 15 ? 1 : 0;
-
- vector unsigned char vsrcAuc, vsrcBuc, vsrcperm0, vsrcperm1;
- vector unsigned char vsrc0uc, vsrc1uc;
- vector signed short vsrc0ssH, vsrc1ssH;
- vector unsigned char vsrcCuc, vsrc2uc, vsrc3uc;
- vector signed short vsrc2ssH, vsrc3ssH, psum;
- vector unsigned char vdst, ppsum, vfdst, fsum;
-
- POWERPC_PERF_START_COUNT(PREFIX_h264_chroma_mc8_num, 1);
-
- if (((unsigned long)dst) % 16 == 0) {
- fperm = (vector unsigned char)AVV(0x10, 0x11, 0x12, 0x13,
- 0x14, 0x15, 0x16, 0x17,
- 0x08, 0x09, 0x0A, 0x0B,
- 0x0C, 0x0D, 0x0E, 0x0F);
- } else {
- fperm = (vector unsigned char)AVV(0x00, 0x01, 0x02, 0x03,
- 0x04, 0x05, 0x06, 0x07,
- 0x18, 0x19, 0x1A, 0x1B,
- 0x1C, 0x1D, 0x1E, 0x1F);
- }
-
- vsrcAuc = vec_ld(0, src);
-
- if (loadSecond)
- vsrcBuc = vec_ld(16, src);
- vsrcperm0 = vec_lvsl(0, src);
- vsrcperm1 = vec_lvsl(1, src);
-
- vsrc0uc = vec_perm(vsrcAuc, vsrcBuc, vsrcperm0);
- if (reallyBadAlign)
- vsrc1uc = vsrcBuc;
- else
- vsrc1uc = vec_perm(vsrcAuc, vsrcBuc, vsrcperm1);
-
- vsrc0ssH = (vector signed short)vec_mergeh((vector unsigned char)vzero,
- (vector unsigned char)vsrc0uc);
- vsrc1ssH = (vector signed short)vec_mergeh((vector unsigned char)vzero,
- (vector unsigned char)vsrc1uc);
-
- if (!loadSecond) {// -> !reallyBadAlign
- for (i = 0 ; i < h ; i++) {
-
-
- vsrcCuc = vec_ld(stride + 0, src);
-
- vsrc2uc = vec_perm(vsrcCuc, vsrcCuc, vsrcperm0);
- vsrc3uc = vec_perm(vsrcCuc, vsrcCuc, vsrcperm1);
-
- vsrc2ssH = (vector signed short)vec_mergeh((vector unsigned char)vzero,
- (vector unsigned char)vsrc2uc);
- vsrc3ssH = (vector signed short)vec_mergeh((vector unsigned char)vzero,
- (vector unsigned char)vsrc3uc);
-
- psum = vec_mladd(vA, vsrc0ssH, vec_splat_s16(0));
- psum = vec_mladd(vB, vsrc1ssH, psum);
- psum = vec_mladd(vC, vsrc2ssH, psum);
- psum = vec_mladd(vD, vsrc3ssH, psum);
- psum = vec_add(v32ss, psum);
- psum = vec_sra(psum, v6us);
-
- vdst = vec_ld(0, dst);
- ppsum = (vector unsigned char)vec_packsu(psum, psum);
- vfdst = vec_perm(vdst, ppsum, fperm);
-
- OP_U8_ALTIVEC(fsum, vfdst, vdst);
-
- vec_st(fsum, 0, dst);
-
- vsrc0ssH = vsrc2ssH;
- vsrc1ssH = vsrc3ssH;
-
- dst += stride;
- src += stride;
- }
- } else {
- vector unsigned char vsrcDuc;
- for (i = 0 ; i < h ; i++) {
- vsrcCuc = vec_ld(stride + 0, src);
- vsrcDuc = vec_ld(stride + 16, src);
-
- vsrc2uc = vec_perm(vsrcCuc, vsrcDuc, vsrcperm0);
- if (reallyBadAlign)
- vsrc3uc = vsrcDuc;
- else
- vsrc3uc = vec_perm(vsrcCuc, vsrcDuc, vsrcperm1);
-
- vsrc2ssH = (vector signed short)vec_mergeh((vector unsigned char)vzero,
- (vector unsigned char)vsrc2uc);
- vsrc3ssH = (vector signed short)vec_mergeh((vector unsigned char)vzero,
- (vector unsigned char)vsrc3uc);
-
- psum = vec_mladd(vA, vsrc0ssH, vec_splat_s16(0));
- psum = vec_mladd(vB, vsrc1ssH, psum);
- psum = vec_mladd(vC, vsrc2ssH, psum);
- psum = vec_mladd(vD, vsrc3ssH, psum);
- psum = vec_add(v32ss, psum);
- psum = vec_sr(psum, v6us);
-
- vdst = vec_ld(0, dst);
- ppsum = (vector unsigned char)vec_pack(psum, psum);
- vfdst = vec_perm(vdst, ppsum, fperm);
-
- OP_U8_ALTIVEC(fsum, vfdst, vdst);
-
- vec_st(fsum, 0, dst);
-
- vsrc0ssH = vsrc2ssH;
- vsrc1ssH = vsrc3ssH;
-
- dst += stride;
- src += stride;
- }
- }
- POWERPC_PERF_STOP_COUNT(PREFIX_h264_chroma_mc8_num, 1);
-}
-
-/* this code assume stride % 16 == 0 */
-static void PREFIX_h264_qpel16_h_lowpass_altivec(uint8_t * dst, uint8_t * src, int dstStride, int srcStride) {
- POWERPC_PERF_DECLARE(PREFIX_h264_qpel16_h_lowpass_num, 1);
- register int i;
-
- const vector signed int vzero = vec_splat_s32(0);
- const vector unsigned char permM2 = vec_lvsl(-2, src);
- const vector unsigned char permM1 = vec_lvsl(-1, src);
- const vector unsigned char permP0 = vec_lvsl(+0, src);
- const vector unsigned char permP1 = vec_lvsl(+1, src);
- const vector unsigned char permP2 = vec_lvsl(+2, src);
- const vector unsigned char permP3 = vec_lvsl(+3, src);
- const vector signed short v5ss = vec_splat_s16(5);
- const vector unsigned short v5us = vec_splat_u16(5);
- const vector signed short v20ss = vec_sl(vec_splat_s16(5),vec_splat_u16(2));
- const vector signed short v16ss = vec_sl(vec_splat_s16(1),vec_splat_u16(4));
- const vector unsigned char dstperm = vec_lvsr(0, dst);
- const vector unsigned char neg1 =
- (const vector unsigned char) vec_splat_s8(-1);
-
- const vector unsigned char dstmask =
- vec_perm((const vector unsigned char)vzero,
- neg1, dstperm);
-
- vector unsigned char srcM2, srcM1, srcP0, srcP1, srcP2, srcP3;
-
- register int align = ((((unsigned long)src) - 2) % 16);
-
- vector signed short srcP0A, srcP0B, srcP1A, srcP1B,
- srcP2A, srcP2B, srcP3A, srcP3B,
- srcM1A, srcM1B, srcM2A, srcM2B,
- sum1A, sum1B, sum2A, sum2B, sum3A, sum3B,
- pp1A, pp1B, pp2A, pp2B, pp3A, pp3B,
- psumA, psumB, sumA, sumB;
-
- vector unsigned char sum, dst1, dst2, vdst, fsum,
- rsum, fdst1, fdst2;
-
- POWERPC_PERF_START_COUNT(PREFIX_h264_qpel16_h_lowpass_num, 1);
-
- for (i = 0 ; i < 16 ; i ++) {
- vector unsigned char srcR1 = vec_ld(-2, src);
- vector unsigned char srcR2 = vec_ld(14, src);
-
- switch (align) {
- default: {
- srcM2 = vec_perm(srcR1, srcR2, permM2);
- srcM1 = vec_perm(srcR1, srcR2, permM1);
- srcP0 = vec_perm(srcR1, srcR2, permP0);
- srcP1 = vec_perm(srcR1, srcR2, permP1);
- srcP2 = vec_perm(srcR1, srcR2, permP2);
- srcP3 = vec_perm(srcR1, srcR2, permP3);
- } break;
- case 11: {
- srcM2 = vec_perm(srcR1, srcR2, permM2);
- srcM1 = vec_perm(srcR1, srcR2, permM1);
- srcP0 = vec_perm(srcR1, srcR2, permP0);
- srcP1 = vec_perm(srcR1, srcR2, permP1);
- srcP2 = vec_perm(srcR1, srcR2, permP2);
- srcP3 = srcR2;
- } break;
- case 12: {
- vector unsigned char srcR3 = vec_ld(30, src);
- srcM2 = vec_perm(srcR1, srcR2, permM2);
- srcM1 = vec_perm(srcR1, srcR2, permM1);
- srcP0 = vec_perm(srcR1, srcR2, permP0);
- srcP1 = vec_perm(srcR1, srcR2, permP1);
- srcP2 = srcR2;
- srcP3 = vec_perm(srcR2, srcR3, permP3);
- } break;
- case 13: {
- vector unsigned char srcR3 = vec_ld(30, src);
- srcM2 = vec_perm(srcR1, srcR2, permM2);
- srcM1 = vec_perm(srcR1, srcR2, permM1);
- srcP0 = vec_perm(srcR1, srcR2, permP0);
- srcP1 = srcR2;
- srcP2 = vec_perm(srcR2, srcR3, permP2);
- srcP3 = vec_perm(srcR2, srcR3, permP3);
- } break;
- case 14: {
- vector unsigned char srcR3 = vec_ld(30, src);
- srcM2 = vec_perm(srcR1, srcR2, permM2);
- srcM1 = vec_perm(srcR1, srcR2, permM1);
- srcP0 = srcR2;
- srcP1 = vec_perm(srcR2, srcR3, permP1);
- srcP2 = vec_perm(srcR2, srcR3, permP2);
- srcP3 = vec_perm(srcR2, srcR3, permP3);
- } break;
- case 15: {
- vector unsigned char srcR3 = vec_ld(30, src);
- srcM2 = vec_perm(srcR1, srcR2, permM2);
- srcM1 = srcR2;
- srcP0 = vec_perm(srcR2, srcR3, permP0);
- srcP1 = vec_perm(srcR2, srcR3, permP1);
- srcP2 = vec_perm(srcR2, srcR3, permP2);
- srcP3 = vec_perm(srcR2, srcR3, permP3);
- } break;
- }
-
- srcP0A = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcP0);
- srcP0B = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcP0);
- srcP1A = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcP1);
- srcP1B = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcP1);
-
- srcP2A = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcP2);
- srcP2B = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcP2);
- srcP3A = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcP3);
- srcP3B = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcP3);
-
- srcM1A = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcM1);
- srcM1B = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcM1);
- srcM2A = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcM2);
- srcM2B = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcM2);
-
- sum1A = vec_adds(srcP0A, srcP1A);
- sum1B = vec_adds(srcP0B, srcP1B);
- sum2A = vec_adds(srcM1A, srcP2A);
- sum2B = vec_adds(srcM1B, srcP2B);
- sum3A = vec_adds(srcM2A, srcP3A);
- sum3B = vec_adds(srcM2B, srcP3B);
-
- pp1A = vec_mladd(sum1A, v20ss, v16ss);
- pp1B = vec_mladd(sum1B, v20ss, v16ss);
-
- pp2A = vec_mladd(sum2A, v5ss, (vector signed short)vzero);
- pp2B = vec_mladd(sum2B, v5ss, (vector signed short)vzero);
-
- pp3A = vec_add(sum3A, pp1A);
- pp3B = vec_add(sum3B, pp1B);
-
- psumA = vec_sub(pp3A, pp2A);
- psumB = vec_sub(pp3B, pp2B);
-
- sumA = vec_sra(psumA, v5us);
- sumB = vec_sra(psumB, v5us);
-
- sum = vec_packsu(sumA, sumB);
-
- dst1 = vec_ld(0, dst);
- dst2 = vec_ld(16, dst);
- vdst = vec_perm(dst1, dst2, vec_lvsl(0, dst));
-
- OP_U8_ALTIVEC(fsum, sum, vdst);
-
- rsum = vec_perm(fsum, fsum, dstperm);
- fdst1 = vec_sel(dst1, rsum, dstmask);
- fdst2 = vec_sel(rsum, dst2, dstmask);
-
- vec_st(fdst1, 0, dst);
- vec_st(fdst2, 16, dst);
-
- src += srcStride;
- dst += dstStride;
- }
-POWERPC_PERF_STOP_COUNT(PREFIX_h264_qpel16_h_lowpass_num, 1);
-}
-
-/* this code assume stride % 16 == 0 */
-static void PREFIX_h264_qpel16_v_lowpass_altivec(uint8_t * dst, uint8_t * src, int dstStride, int srcStride) {
- POWERPC_PERF_DECLARE(PREFIX_h264_qpel16_v_lowpass_num, 1);
-
- register int i;
-
- const vector signed int vzero = vec_splat_s32(0);
- const vector unsigned char perm = vec_lvsl(0, src);
- const vector signed short v20ss = vec_sl(vec_splat_s16(5),vec_splat_u16(2));
- const vector unsigned short v5us = vec_splat_u16(5);
- const vector signed short v5ss = vec_splat_s16(5);
- const vector signed short v16ss = vec_sl(vec_splat_s16(1),vec_splat_u16(4));
- const vector unsigned char dstperm = vec_lvsr(0, dst);
- const vector unsigned char neg1 = (const vector unsigned char)vec_splat_s8(-1);
- const vector unsigned char dstmask = vec_perm((const vector unsigned char)vzero, neg1, dstperm);
-
- uint8_t *srcbis = src - (srcStride * 2);
-
- const vector unsigned char srcM2a = vec_ld(0, srcbis);
- const vector unsigned char srcM2b = vec_ld(16, srcbis);
- const vector unsigned char srcM2 = vec_perm(srcM2a, srcM2b, perm);
-// srcbis += srcStride;
- const vector unsigned char srcM1a = vec_ld(0, srcbis += srcStride);
- const vector unsigned char srcM1b = vec_ld(16, srcbis);
- const vector unsigned char srcM1 = vec_perm(srcM1a, srcM1b, perm);
-// srcbis += srcStride;
- const vector unsigned char srcP0a = vec_ld(0, srcbis += srcStride);
- const vector unsigned char srcP0b = vec_ld(16, srcbis);
- const vector unsigned char srcP0 = vec_perm(srcP0a, srcP0b, perm);
-// srcbis += srcStride;
- const vector unsigned char srcP1a = vec_ld(0, srcbis += srcStride);
- const vector unsigned char srcP1b = vec_ld(16, srcbis);
- const vector unsigned char srcP1 = vec_perm(srcP1a, srcP1b, perm);
-// srcbis += srcStride;
- const vector unsigned char srcP2a = vec_ld(0, srcbis += srcStride);
- const vector unsigned char srcP2b = vec_ld(16, srcbis);
- const vector unsigned char srcP2 = vec_perm(srcP2a, srcP2b, perm);
-// srcbis += srcStride;
-
- vector signed short srcM2ssA = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcM2);
- vector signed short srcM2ssB = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcM2);
- vector signed short srcM1ssA = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcM1);
- vector signed short srcM1ssB = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcM1);
- vector signed short srcP0ssA = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcP0);
- vector signed short srcP0ssB = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcP0);
- vector signed short srcP1ssA = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcP1);
- vector signed short srcP1ssB = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcP1);
- vector signed short srcP2ssA = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcP2);
- vector signed short srcP2ssB = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcP2);
-
- vector signed short pp1A, pp1B, pp2A, pp2B, pp3A, pp3B,
- psumA, psumB, sumA, sumB,
- srcP3ssA, srcP3ssB,
- sum1A, sum1B, sum2A, sum2B, sum3A, sum3B;
-
- vector unsigned char sum, dst1, dst2, vdst, fsum, rsum, fdst1, fdst2,
- srcP3a, srcP3b, srcP3;
-
- POWERPC_PERF_START_COUNT(PREFIX_h264_qpel16_v_lowpass_num, 1);
-
- for (i = 0 ; i < 16 ; i++) {
- srcP3a = vec_ld(0, srcbis += srcStride);
- srcP3b = vec_ld(16, srcbis);
- srcP3 = vec_perm(srcP3a, srcP3b, perm);
- srcP3ssA = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcP3);
- srcP3ssB = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcP3);
-// srcbis += srcStride;
-
- sum1A = vec_adds(srcP0ssA, srcP1ssA);
- sum1B = vec_adds(srcP0ssB, srcP1ssB);
- sum2A = vec_adds(srcM1ssA, srcP2ssA);
- sum2B = vec_adds(srcM1ssB, srcP2ssB);
- sum3A = vec_adds(srcM2ssA, srcP3ssA);
- sum3B = vec_adds(srcM2ssB, srcP3ssB);
-
- srcM2ssA = srcM1ssA;
- srcM2ssB = srcM1ssB;
- srcM1ssA = srcP0ssA;
- srcM1ssB = srcP0ssB;
- srcP0ssA = srcP1ssA;
- srcP0ssB = srcP1ssB;
- srcP1ssA = srcP2ssA;
- srcP1ssB = srcP2ssB;
- srcP2ssA = srcP3ssA;
- srcP2ssB = srcP3ssB;
-
- pp1A = vec_mladd(sum1A, v20ss, v16ss);
- pp1B = vec_mladd(sum1B, v20ss, v16ss);
-
- pp2A = vec_mladd(sum2A, v5ss, (vector signed short)vzero);
- pp2B = vec_mladd(sum2B, v5ss, (vector signed short)vzero);
-
- pp3A = vec_add(sum3A, pp1A);
- pp3B = vec_add(sum3B, pp1B);
-
- psumA = vec_sub(pp3A, pp2A);
- psumB = vec_sub(pp3B, pp2B);
-
- sumA = vec_sra(psumA, v5us);
- sumB = vec_sra(psumB, v5us);
-
- sum = vec_packsu(sumA, sumB);
-
- dst1 = vec_ld(0, dst);
- dst2 = vec_ld(16, dst);
- vdst = vec_perm(dst1, dst2, vec_lvsl(0, dst));
-
- OP_U8_ALTIVEC(fsum, sum, vdst);
-
- rsum = vec_perm(fsum, fsum, dstperm);
- fdst1 = vec_sel(dst1, rsum, dstmask);
- fdst2 = vec_sel(rsum, dst2, dstmask);
-
- vec_st(fdst1, 0, dst);
- vec_st(fdst2, 16, dst);
-
- dst += dstStride;
- }
- POWERPC_PERF_STOP_COUNT(PREFIX_h264_qpel16_v_lowpass_num, 1);
-}
-
-/* this code assume stride % 16 == 0 *and* tmp is properly aligned */
-static void PREFIX_h264_qpel16_hv_lowpass_altivec(uint8_t * dst, int16_t * tmp, uint8_t * src, int dstStride, int tmpStride, int srcStride) {
- POWERPC_PERF_DECLARE(PREFIX_h264_qpel16_hv_lowpass_num, 1);
- register int i;
- const vector signed int vzero = vec_splat_s32(0);
- const vector unsigned char permM2 = vec_lvsl(-2, src);
- const vector unsigned char permM1 = vec_lvsl(-1, src);
- const vector unsigned char permP0 = vec_lvsl(+0, src);
- const vector unsigned char permP1 = vec_lvsl(+1, src);
- const vector unsigned char permP2 = vec_lvsl(+2, src);
- const vector unsigned char permP3 = vec_lvsl(+3, src);
- const vector signed short v20ss = vec_sl(vec_splat_s16(5),vec_splat_u16(2));
- const vector unsigned int v10ui = vec_splat_u32(10);
- const vector signed short v5ss = vec_splat_s16(5);
- const vector signed short v1ss = vec_splat_s16(1);
- const vector signed int v512si = vec_sl(vec_splat_s32(1),vec_splat_u32(9));
- const vector unsigned int v16ui = vec_sl(vec_splat_u32(1),vec_splat_u32(4));
-
- register int align = ((((unsigned long)src) - 2) % 16);
-
- const vector unsigned char neg1 = (const vector unsigned char)
- vec_splat_s8(-1);
-
- vector signed short srcP0A, srcP0B, srcP1A, srcP1B,
- srcP2A, srcP2B, srcP3A, srcP3B,
- srcM1A, srcM1B, srcM2A, srcM2B,
- sum1A, sum1B, sum2A, sum2B, sum3A, sum3B,
- pp1A, pp1B, pp2A, pp2B, psumA, psumB;
-
- const vector unsigned char dstperm = vec_lvsr(0, dst);
-
- const vector unsigned char dstmask = vec_perm((const vector unsigned char)vzero, neg1, dstperm);
-
- const vector unsigned char mperm = (const vector unsigned char)
- AVV(0x00, 0x08, 0x01, 0x09, 0x02, 0x0A, 0x03, 0x0B,
- 0x04, 0x0C, 0x05, 0x0D, 0x06, 0x0E, 0x07, 0x0F);
- int16_t *tmpbis = tmp;
-
- vector signed short tmpM1ssA, tmpM1ssB, tmpM2ssA, tmpM2ssB,
- tmpP0ssA, tmpP0ssB, tmpP1ssA, tmpP1ssB,
- tmpP2ssA, tmpP2ssB;
-
- vector signed int pp1Ae, pp1Ao, pp1Be, pp1Bo, pp2Ae, pp2Ao, pp2Be, pp2Bo,
- pp3Ae, pp3Ao, pp3Be, pp3Bo, pp1cAe, pp1cAo, pp1cBe, pp1cBo,
- pp32Ae, pp32Ao, pp32Be, pp32Bo, sumAe, sumAo, sumBe, sumBo,
- ssumAe, ssumAo, ssumBe, ssumBo;
- vector unsigned char fsum, sumv, sum, dst1, dst2, vdst,
- rsum, fdst1, fdst2;
- vector signed short ssume, ssumo;
-
- POWERPC_PERF_START_COUNT(PREFIX_h264_qpel16_hv_lowpass_num, 1);
- src -= (2 * srcStride);
- for (i = 0 ; i < 21 ; i ++) {
- vector unsigned char srcM2, srcM1, srcP0, srcP1, srcP2, srcP3;
- vector unsigned char srcR1 = vec_ld(-2, src);
- vector unsigned char srcR2 = vec_ld(14, src);
-
- switch (align) {
- default: {
- srcM2 = vec_perm(srcR1, srcR2, permM2);
- srcM1 = vec_perm(srcR1, srcR2, permM1);
- srcP0 = vec_perm(srcR1, srcR2, permP0);
- srcP1 = vec_perm(srcR1, srcR2, permP1);
- srcP2 = vec_perm(srcR1, srcR2, permP2);
- srcP3 = vec_perm(srcR1, srcR2, permP3);
- } break;
- case 11: {
- srcM2 = vec_perm(srcR1, srcR2, permM2);
- srcM1 = vec_perm(srcR1, srcR2, permM1);
- srcP0 = vec_perm(srcR1, srcR2, permP0);
- srcP1 = vec_perm(srcR1, srcR2, permP1);
- srcP2 = vec_perm(srcR1, srcR2, permP2);
- srcP3 = srcR2;
- } break;
- case 12: {
- vector unsigned char srcR3 = vec_ld(30, src);
- srcM2 = vec_perm(srcR1, srcR2, permM2);
- srcM1 = vec_perm(srcR1, srcR2, permM1);
- srcP0 = vec_perm(srcR1, srcR2, permP0);
- srcP1 = vec_perm(srcR1, srcR2, permP1);
- srcP2 = srcR2;
- srcP3 = vec_perm(srcR2, srcR3, permP3);
- } break;
- case 13: {
- vector unsigned char srcR3 = vec_ld(30, src);
- srcM2 = vec_perm(srcR1, srcR2, permM2);
- srcM1 = vec_perm(srcR1, srcR2, permM1);
- srcP0 = vec_perm(srcR1, srcR2, permP0);
- srcP1 = srcR2;
- srcP2 = vec_perm(srcR2, srcR3, permP2);
- srcP3 = vec_perm(srcR2, srcR3, permP3);
- } break;
- case 14: {
- vector unsigned char srcR3 = vec_ld(30, src);
- srcM2 = vec_perm(srcR1, srcR2, permM2);
- srcM1 = vec_perm(srcR1, srcR2, permM1);
- srcP0 = srcR2;
- srcP1 = vec_perm(srcR2, srcR3, permP1);
- srcP2 = vec_perm(srcR2, srcR3, permP2);
- srcP3 = vec_perm(srcR2, srcR3, permP3);
- } break;
- case 15: {
- vector unsigned char srcR3 = vec_ld(30, src);
- srcM2 = vec_perm(srcR1, srcR2, permM2);
- srcM1 = srcR2;
- srcP0 = vec_perm(srcR2, srcR3, permP0);
- srcP1 = vec_perm(srcR2, srcR3, permP1);
- srcP2 = vec_perm(srcR2, srcR3, permP2);
- srcP3 = vec_perm(srcR2, srcR3, permP3);
- } break;
- }
-
- srcP0A = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcP0);
- srcP0B = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcP0);
- srcP1A = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcP1);
- srcP1B = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcP1);
-
- srcP2A = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcP2);
- srcP2B = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcP2);
- srcP3A = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcP3);
- srcP3B = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcP3);
-
- srcM1A = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcM1);
- srcM1B = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcM1);
- srcM2A = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcM2);
- srcM2B = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcM2);
-
- sum1A = vec_adds(srcP0A, srcP1A);
- sum1B = vec_adds(srcP0B, srcP1B);
- sum2A = vec_adds(srcM1A, srcP2A);
- sum2B = vec_adds(srcM1B, srcP2B);
- sum3A = vec_adds(srcM2A, srcP3A);
- sum3B = vec_adds(srcM2B, srcP3B);
-
- pp1A = vec_mladd(sum1A, v20ss, sum3A);
- pp1B = vec_mladd(sum1B, v20ss, sum3B);
-
- pp2A = vec_mladd(sum2A, v5ss, (vector signed short)vzero);
- pp2B = vec_mladd(sum2B, v5ss, (vector signed short)vzero);
-
- psumA = vec_sub(pp1A, pp2A);
- psumB = vec_sub(pp1B, pp2B);
-
- vec_st(psumA, 0, tmp);
- vec_st(psumB, 16, tmp);
-
- src += srcStride;
- tmp += tmpStride; /* int16_t*, and stride is 16, so it's OK here */
- }
-
- tmpM2ssA = vec_ld(0, tmpbis);
- tmpM2ssB = vec_ld(16, tmpbis);
- tmpbis += tmpStride;
- tmpM1ssA = vec_ld(0, tmpbis);
- tmpM1ssB = vec_ld(16, tmpbis);
- tmpbis += tmpStride;
- tmpP0ssA = vec_ld(0, tmpbis);
- tmpP0ssB = vec_ld(16, tmpbis);
- tmpbis += tmpStride;
- tmpP1ssA = vec_ld(0, tmpbis);
- tmpP1ssB = vec_ld(16, tmpbis);
- tmpbis += tmpStride;
- tmpP2ssA = vec_ld(0, tmpbis);
- tmpP2ssB = vec_ld(16, tmpbis);
- tmpbis += tmpStride;
-
- for (i = 0 ; i < 16 ; i++) {
- const vector signed short tmpP3ssA = vec_ld(0, tmpbis);
- const vector signed short tmpP3ssB = vec_ld(16, tmpbis);
-
- const vector signed short sum1A = vec_adds(tmpP0ssA, tmpP1ssA);
- const vector signed short sum1B = vec_adds(tmpP0ssB, tmpP1ssB);
- const vector signed short sum2A = vec_adds(tmpM1ssA, tmpP2ssA);
- const vector signed short sum2B = vec_adds(tmpM1ssB, tmpP2ssB);
- const vector signed short sum3A = vec_adds(tmpM2ssA, tmpP3ssA);
- const vector signed short sum3B = vec_adds(tmpM2ssB, tmpP3ssB);
-
- tmpbis += tmpStride;
-
- tmpM2ssA = tmpM1ssA;
- tmpM2ssB = tmpM1ssB;
- tmpM1ssA = tmpP0ssA;
- tmpM1ssB = tmpP0ssB;
- tmpP0ssA = tmpP1ssA;
- tmpP0ssB = tmpP1ssB;
- tmpP1ssA = tmpP2ssA;
- tmpP1ssB = tmpP2ssB;
- tmpP2ssA = tmpP3ssA;
- tmpP2ssB = tmpP3ssB;
-
- pp1Ae = vec_mule(sum1A, v20ss);
- pp1Ao = vec_mulo(sum1A, v20ss);
- pp1Be = vec_mule(sum1B, v20ss);
- pp1Bo = vec_mulo(sum1B, v20ss);
-
- pp2Ae = vec_mule(sum2A, v5ss);
- pp2Ao = vec_mulo(sum2A, v5ss);
- pp2Be = vec_mule(sum2B, v5ss);
- pp2Bo = vec_mulo(sum2B, v5ss);
-
- pp3Ae = vec_sra((vector signed int)sum3A, v16ui);
- pp3Ao = vec_mulo(sum3A, v1ss);
- pp3Be = vec_sra((vector signed int)sum3B, v16ui);
- pp3Bo = vec_mulo(sum3B, v1ss);
-
- pp1cAe = vec_add(pp1Ae, v512si);
- pp1cAo = vec_add(pp1Ao, v512si);
- pp1cBe = vec_add(pp1Be, v512si);
- pp1cBo = vec_add(pp1Bo, v512si);
-
- pp32Ae = vec_sub(pp3Ae, pp2Ae);
- pp32Ao = vec_sub(pp3Ao, pp2Ao);
- pp32Be = vec_sub(pp3Be, pp2Be);
- pp32Bo = vec_sub(pp3Bo, pp2Bo);
-
- sumAe = vec_add(pp1cAe, pp32Ae);
- sumAo = vec_add(pp1cAo, pp32Ao);
- sumBe = vec_add(pp1cBe, pp32Be);
- sumBo = vec_add(pp1cBo, pp32Bo);
-
- ssumAe = vec_sra(sumAe, v10ui);
- ssumAo = vec_sra(sumAo, v10ui);
- ssumBe = vec_sra(sumBe, v10ui);
- ssumBo = vec_sra(sumBo, v10ui);
-
- ssume = vec_packs(ssumAe, ssumBe);
- ssumo = vec_packs(ssumAo, ssumBo);
-
- sumv = vec_packsu(ssume, ssumo);
- sum = vec_perm(sumv, sumv, mperm);
-
- dst1 = vec_ld(0, dst);
- dst2 = vec_ld(16, dst);
- vdst = vec_perm(dst1, dst2, vec_lvsl(0, dst));
-
- OP_U8_ALTIVEC(fsum, sum, vdst);
-
- rsum = vec_perm(fsum, fsum, dstperm);
- fdst1 = vec_sel(dst1, rsum, dstmask);
- fdst2 = vec_sel(rsum, dst2, dstmask);
-
- vec_st(fdst1, 0, dst);
- vec_st(fdst2, 16, dst);
-
- dst += dstStride;
- }
- POWERPC_PERF_STOP_COUNT(PREFIX_h264_qpel16_hv_lowpass_num, 1);
-}
diff --git a/src/libffmpeg/libavcodec/ppc/dsputil_ppc.c b/src/libffmpeg/libavcodec/ppc/dsputil_ppc.c
deleted file mode 100644
index 9169eaef0..000000000
--- a/src/libffmpeg/libavcodec/ppc/dsputil_ppc.c
+++ /dev/null
@@ -1,325 +0,0 @@
-/*
- * Copyright (c) 2002 Brian Foley
- * Copyright (c) 2002 Dieter Shirley
- * Copyright (c) 2003-2004 Romain Dolbeau <romain@dolbeau.org>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "../dsputil.h"
-
-#include "dsputil_ppc.h"
-
-#ifdef HAVE_ALTIVEC
-#include "dsputil_altivec.h"
-
-extern void fdct_altivec(int16_t *block);
-extern void gmc1_altivec(uint8_t *dst, uint8_t *src, int stride, int h,
- int x16, int y16, int rounder);
-extern void idct_put_altivec(uint8_t *dest, int line_size, int16_t *block);
-extern void idct_add_altivec(uint8_t *dest, int line_size, int16_t *block);
-
-void dsputil_h264_init_ppc(DSPContext* c, AVCodecContext *avctx);
-
-void dsputil_init_altivec(DSPContext* c, AVCodecContext *avctx);
-void vc1dsp_init_altivec(DSPContext* c, AVCodecContext *avctx);
-void snow_init_altivec(DSPContext* c, AVCodecContext *avctx);
-void float_init_altivec(DSPContext* c, AVCodecContext *avctx);
-
-#endif
-
-int mm_flags = 0;
-
-int mm_support(void)
-{
- int result = 0;
-#ifdef HAVE_ALTIVEC
- if (has_altivec()) {
- result |= MM_ALTIVEC;
- }
-#endif /* result */
- return result;
-}
-
-#ifdef POWERPC_PERFORMANCE_REPORT
-unsigned long long perfdata[POWERPC_NUM_PMC_ENABLED][powerpc_perf_total][powerpc_data_total];
-/* list below must match enum in dsputil_ppc.h */
-static unsigned char* perfname[] = {
- "ff_fft_calc_altivec",
- "gmc1_altivec",
- "dct_unquantize_h263_altivec",
- "fdct_altivec",
- "idct_add_altivec",
- "idct_put_altivec",
- "put_pixels16_altivec",
- "avg_pixels16_altivec",
- "avg_pixels8_altivec",
- "put_pixels8_xy2_altivec",
- "put_no_rnd_pixels8_xy2_altivec",
- "put_pixels16_xy2_altivec",
- "put_no_rnd_pixels16_xy2_altivec",
- "hadamard8_diff8x8_altivec",
- "hadamard8_diff16_altivec",
- "avg_pixels8_xy2_altivec",
- "clear_blocks_dcbz32_ppc",
- "clear_blocks_dcbz128_ppc",
- "put_h264_chroma_mc8_altivec",
- "avg_h264_chroma_mc8_altivec",
- "put_h264_qpel16_h_lowpass_altivec",
- "avg_h264_qpel16_h_lowpass_altivec",
- "put_h264_qpel16_v_lowpass_altivec",
- "avg_h264_qpel16_v_lowpass_altivec",
- "put_h264_qpel16_hv_lowpass_altivec",
- "avg_h264_qpel16_hv_lowpass_altivec",
- ""
-};
-#include <stdio.h>
-#endif
-
-#ifdef POWERPC_PERFORMANCE_REPORT
-void powerpc_display_perf_report(void)
-{
- int i, j;
- av_log(NULL, AV_LOG_INFO, "PowerPC performance report\n Values are from the PMC registers, and represent whatever the registers are set to record.\n");
- for(i = 0 ; i < powerpc_perf_total ; i++)
- {
- for (j = 0; j < POWERPC_NUM_PMC_ENABLED ; j++)
- {
- if (perfdata[j][i][powerpc_data_num] != (unsigned long long)0)
- av_log(NULL, AV_LOG_INFO,
- " Function \"%s\" (pmc%d):\n\tmin: %"PRIu64"\n\tmax: %"PRIu64"\n\tavg: %1.2lf (%"PRIu64")\n",
- perfname[i],
- j+1,
- perfdata[j][i][powerpc_data_min],
- perfdata[j][i][powerpc_data_max],
- (double)perfdata[j][i][powerpc_data_sum] /
- (double)perfdata[j][i][powerpc_data_num],
- perfdata[j][i][powerpc_data_num]);
- }
- }
-}
-#endif /* POWERPC_PERFORMANCE_REPORT */
-
-/* ***** WARNING ***** WARNING ***** WARNING ***** */
-/*
- clear_blocks_dcbz32_ppc will not work properly
- on PowerPC processors with a cache line size
- not equal to 32 bytes.
- Fortunately all processor used by Apple up to
- at least the 7450 (aka second generation G4)
- use 32 bytes cache line.
- This is due to the use of the 'dcbz' instruction.
- It simply clear to zero a single cache line,
- so you need to know the cache line size to use it !
- It's absurd, but it's fast...
-
- update 24/06/2003 : Apple released yesterday the G5,
- with a PPC970. cache line size : 128 bytes. Oups.
- The semantic of dcbz was changed, it always clear
- 32 bytes. so the function below will work, but will
- be slow. So I fixed check_dcbz_effect to use dcbzl,
- which is defined to clear a cache line (as dcbz before).
- So we still can distinguish, and use dcbz (32 bytes)
- or dcbzl (one cache line) as required.
-
- see <http://developer.apple.com/technotes/tn/tn2087.html>
- and <http://developer.apple.com/technotes/tn/tn2086.html>
-*/
-void clear_blocks_dcbz32_ppc(DCTELEM *blocks)
-{
-POWERPC_PERF_DECLARE(powerpc_clear_blocks_dcbz32, 1);
- register int misal = ((unsigned long)blocks & 0x00000010);
- register int i = 0;
-POWERPC_PERF_START_COUNT(powerpc_clear_blocks_dcbz32, 1);
-#if 1
- if (misal) {
- ((unsigned long*)blocks)[0] = 0L;
- ((unsigned long*)blocks)[1] = 0L;
- ((unsigned long*)blocks)[2] = 0L;
- ((unsigned long*)blocks)[3] = 0L;
- i += 16;
- }
- for ( ; i < sizeof(DCTELEM)*6*64-31 ; i += 32) {
-#ifndef __MWERKS__
- asm volatile("dcbz %0,%1" : : "b" (blocks), "r" (i) : "memory");
-#else
- __dcbz( blocks, i );
-#endif
- }
- if (misal) {
- ((unsigned long*)blocks)[188] = 0L;
- ((unsigned long*)blocks)[189] = 0L;
- ((unsigned long*)blocks)[190] = 0L;
- ((unsigned long*)blocks)[191] = 0L;
- i += 16;
- }
-#else
- memset(blocks, 0, sizeof(DCTELEM)*6*64);
-#endif
-POWERPC_PERF_STOP_COUNT(powerpc_clear_blocks_dcbz32, 1);
-}
-
-/* same as above, when dcbzl clear a whole 128B cache line
- i.e. the PPC970 aka G5 */
-#ifdef HAVE_DCBZL
-void clear_blocks_dcbz128_ppc(DCTELEM *blocks)
-{
-POWERPC_PERF_DECLARE(powerpc_clear_blocks_dcbz128, 1);
- register int misal = ((unsigned long)blocks & 0x0000007f);
- register int i = 0;
-POWERPC_PERF_START_COUNT(powerpc_clear_blocks_dcbz128, 1);
-#if 1
- if (misal) {
- // we could probably also optimize this case,
- // but there's not much point as the machines
- // aren't available yet (2003-06-26)
- memset(blocks, 0, sizeof(DCTELEM)*6*64);
- }
- else
- for ( ; i < sizeof(DCTELEM)*6*64 ; i += 128) {
- asm volatile("dcbzl %0,%1" : : "b" (blocks), "r" (i) : "memory");
- }
-#else
- memset(blocks, 0, sizeof(DCTELEM)*6*64);
-#endif
-POWERPC_PERF_STOP_COUNT(powerpc_clear_blocks_dcbz128, 1);
-}
-#else
-void clear_blocks_dcbz128_ppc(DCTELEM *blocks)
-{
- memset(blocks, 0, sizeof(DCTELEM)*6*64);
-}
-#endif
-
-#ifdef HAVE_DCBZL
-/* check dcbz report how many bytes are set to 0 by dcbz */
-/* update 24/06/2003 : replace dcbz by dcbzl to get
- the intended effect (Apple "fixed" dcbz)
- unfortunately this cannot be used unless the assembler
- knows about dcbzl ... */
-long check_dcbzl_effect(void)
-{
- register char *fakedata = (char*)av_malloc(1024);
- register char *fakedata_middle;
- register long zero = 0;
- register long i = 0;
- long count = 0;
-
- if (!fakedata)
- {
- return 0L;
- }
-
- fakedata_middle = (fakedata + 512);
-
- memset(fakedata, 0xFF, 1024);
-
- /* below the constraint "b" seems to mean "Address base register"
- in gcc-3.3 / RS/6000 speaks. seems to avoid using r0, so.... */
- asm volatile("dcbzl %0, %1" : : "b" (fakedata_middle), "r" (zero));
-
- for (i = 0; i < 1024 ; i ++)
- {
- if (fakedata[i] == (char)0)
- count++;
- }
-
- av_free(fakedata);
-
- return count;
-}
-#else
-long check_dcbzl_effect(void)
-{
- return 0;
-}
-#endif
-
-static void prefetch_ppc(void *mem, int stride, int h)
-{
- register const uint8_t *p = mem;
- do {
- asm volatile ("dcbt 0,%0" : : "r" (p));
- p+= stride;
- } while(--h);
-}
-
-void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx)
-{
- // Common optimizations whether Altivec is available or not
- c->prefetch = prefetch_ppc;
- switch (check_dcbzl_effect()) {
- case 32:
- c->clear_blocks = clear_blocks_dcbz32_ppc;
- break;
- case 128:
- c->clear_blocks = clear_blocks_dcbz128_ppc;
- break;
- default:
- break;
- }
-
-#ifdef HAVE_ALTIVEC
- if(ENABLE_H264_DECODER) dsputil_h264_init_ppc(c, avctx);
-
- if (has_altivec()) {
- mm_flags |= MM_ALTIVEC;
-
- dsputil_init_altivec(c, avctx);
- if(ENABLE_SNOW_DECODER) snow_init_altivec(c, avctx);
- if(ENABLE_VC1_DECODER || ENABLE_WMV3_DECODER)
- vc1dsp_init_altivec(c, avctx);
- float_init_altivec(c, avctx);
- c->gmc1 = gmc1_altivec;
-
-#ifdef CONFIG_ENCODERS
- if (avctx->dct_algo == FF_DCT_AUTO ||
- avctx->dct_algo == FF_DCT_ALTIVEC)
- {
- c->fdct = fdct_altivec;
- }
-#endif //CONFIG_ENCODERS
-
- if (avctx->lowres==0)
- {
- if ((avctx->idct_algo == FF_IDCT_AUTO) ||
- (avctx->idct_algo == FF_IDCT_ALTIVEC))
- {
- c->idct_put = idct_put_altivec;
- c->idct_add = idct_add_altivec;
- c->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;
- }
- }
-
-#ifdef POWERPC_PERFORMANCE_REPORT
- {
- int i, j;
- for (i = 0 ; i < powerpc_perf_total ; i++)
- {
- for (j = 0; j < POWERPC_NUM_PMC_ENABLED ; j++)
- {
- perfdata[j][i][powerpc_data_min] = 0xFFFFFFFFFFFFFFFFULL;
- perfdata[j][i][powerpc_data_max] = 0x0000000000000000ULL;
- perfdata[j][i][powerpc_data_sum] = 0x0000000000000000ULL;
- perfdata[j][i][powerpc_data_num] = 0x0000000000000000ULL;
- }
- }
- }
-#endif /* POWERPC_PERFORMANCE_REPORT */
- }
-#endif /* HAVE_ALTIVEC */
-}
diff --git a/src/libffmpeg/libavcodec/ppc/dsputil_ppc.h b/src/libffmpeg/libavcodec/ppc/dsputil_ppc.h
deleted file mode 100644
index ab2b05780..000000000
--- a/src/libffmpeg/libavcodec/ppc/dsputil_ppc.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Copyright (c) 2003-2004 Romain Dolbeau <romain@dolbeau.org>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _DSPUTIL_PPC_
-#define _DSPUTIL_PPC_
-
-#ifdef POWERPC_PERFORMANCE_REPORT
-void powerpc_display_perf_report(void);
-/* the 604* have 2, the G3* have 4, the G4s have 6,
- and the G5 are completely different (they MUST use
- POWERPC_MODE_64BITS, and let's hope all future 64 bis PPC
- will use the same PMCs... */
-#define POWERPC_NUM_PMC_ENABLED 6
-/* if you add to the enum below, also add to the perfname array
- in dsputil_ppc.c */
-enum powerpc_perf_index {
- altivec_fft_num = 0,
- altivec_gmc1_num,
- altivec_dct_unquantize_h263_num,
- altivec_fdct,
- altivec_idct_add_num,
- altivec_idct_put_num,
- altivec_put_pixels16_num,
- altivec_avg_pixels16_num,
- altivec_avg_pixels8_num,
- altivec_put_pixels8_xy2_num,
- altivec_put_no_rnd_pixels8_xy2_num,
- altivec_put_pixels16_xy2_num,
- altivec_put_no_rnd_pixels16_xy2_num,
- altivec_hadamard8_diff8x8_num,
- altivec_hadamard8_diff16_num,
- altivec_avg_pixels8_xy2_num,
- powerpc_clear_blocks_dcbz32,
- powerpc_clear_blocks_dcbz128,
- altivec_put_h264_chroma_mc8_num,
- altivec_avg_h264_chroma_mc8_num,
- altivec_put_h264_qpel16_h_lowpass_num,
- altivec_avg_h264_qpel16_h_lowpass_num,
- altivec_put_h264_qpel16_v_lowpass_num,
- altivec_avg_h264_qpel16_v_lowpass_num,
- altivec_put_h264_qpel16_hv_lowpass_num,
- altivec_avg_h264_qpel16_hv_lowpass_num,
- powerpc_perf_total
-};
-enum powerpc_data_index {
- powerpc_data_min = 0,
- powerpc_data_max,
- powerpc_data_sum,
- powerpc_data_num,
- powerpc_data_total
-};
-extern unsigned long long perfdata[POWERPC_NUM_PMC_ENABLED][powerpc_perf_total][powerpc_data_total];
-
-#ifndef POWERPC_MODE_64BITS
-#define POWERP_PMC_DATATYPE unsigned long
-#define POWERPC_GET_PMC1(a) asm volatile("mfspr %0, 937" : "=r" (a))
-#define POWERPC_GET_PMC2(a) asm volatile("mfspr %0, 938" : "=r" (a))
-#if (POWERPC_NUM_PMC_ENABLED > 2)
-#define POWERPC_GET_PMC3(a) asm volatile("mfspr %0, 941" : "=r" (a))
-#define POWERPC_GET_PMC4(a) asm volatile("mfspr %0, 942" : "=r" (a))
-#else
-#define POWERPC_GET_PMC3(a) do {} while (0)
-#define POWERPC_GET_PMC4(a) do {} while (0)
-#endif
-#if (POWERPC_NUM_PMC_ENABLED > 4)
-#define POWERPC_GET_PMC5(a) asm volatile("mfspr %0, 929" : "=r" (a))
-#define POWERPC_GET_PMC6(a) asm volatile("mfspr %0, 930" : "=r" (a))
-#else
-#define POWERPC_GET_PMC5(a) do {} while (0)
-#define POWERPC_GET_PMC6(a) do {} while (0)
-#endif
-#else /* POWERPC_MODE_64BITS */
-#define POWERP_PMC_DATATYPE unsigned long long
-#define POWERPC_GET_PMC1(a) asm volatile("mfspr %0, 771" : "=r" (a))
-#define POWERPC_GET_PMC2(a) asm volatile("mfspr %0, 772" : "=r" (a))
-#if (POWERPC_NUM_PMC_ENABLED > 2)
-#define POWERPC_GET_PMC3(a) asm volatile("mfspr %0, 773" : "=r" (a))
-#define POWERPC_GET_PMC4(a) asm volatile("mfspr %0, 774" : "=r" (a))
-#else
-#define POWERPC_GET_PMC3(a) do {} while (0)
-#define POWERPC_GET_PMC4(a) do {} while (0)
-#endif
-#if (POWERPC_NUM_PMC_ENABLED > 4)
-#define POWERPC_GET_PMC5(a) asm volatile("mfspr %0, 775" : "=r" (a))
-#define POWERPC_GET_PMC6(a) asm volatile("mfspr %0, 776" : "=r" (a))
-#else
-#define POWERPC_GET_PMC5(a) do {} while (0)
-#define POWERPC_GET_PMC6(a) do {} while (0)
-#endif
-#endif /* POWERPC_MODE_64BITS */
-#define POWERPC_PERF_DECLARE(a, cond) \
- POWERP_PMC_DATATYPE \
- pmc_start[POWERPC_NUM_PMC_ENABLED], \
- pmc_stop[POWERPC_NUM_PMC_ENABLED], \
- pmc_loop_index;
-#define POWERPC_PERF_START_COUNT(a, cond) do { \
- POWERPC_GET_PMC6(pmc_start[5]); \
- POWERPC_GET_PMC5(pmc_start[4]); \
- POWERPC_GET_PMC4(pmc_start[3]); \
- POWERPC_GET_PMC3(pmc_start[2]); \
- POWERPC_GET_PMC2(pmc_start[1]); \
- POWERPC_GET_PMC1(pmc_start[0]); \
- } while (0)
-#define POWERPC_PERF_STOP_COUNT(a, cond) do { \
- POWERPC_GET_PMC1(pmc_stop[0]); \
- POWERPC_GET_PMC2(pmc_stop[1]); \
- POWERPC_GET_PMC3(pmc_stop[2]); \
- POWERPC_GET_PMC4(pmc_stop[3]); \
- POWERPC_GET_PMC5(pmc_stop[4]); \
- POWERPC_GET_PMC6(pmc_stop[5]); \
- if (cond) \
- { \
- for(pmc_loop_index = 0; \
- pmc_loop_index < POWERPC_NUM_PMC_ENABLED; \
- pmc_loop_index++) \
- { \
- if (pmc_stop[pmc_loop_index] >= pmc_start[pmc_loop_index]) \
- { \
- POWERP_PMC_DATATYPE diff = \
- pmc_stop[pmc_loop_index] - pmc_start[pmc_loop_index]; \
- if (diff < perfdata[pmc_loop_index][a][powerpc_data_min]) \
- perfdata[pmc_loop_index][a][powerpc_data_min] = diff; \
- if (diff > perfdata[pmc_loop_index][a][powerpc_data_max]) \
- perfdata[pmc_loop_index][a][powerpc_data_max] = diff; \
- perfdata[pmc_loop_index][a][powerpc_data_sum] += diff; \
- perfdata[pmc_loop_index][a][powerpc_data_num] ++; \
- } \
- } \
- } \
-} while (0)
-#else /* POWERPC_PERFORMANCE_REPORT */
-// those are needed to avoid empty statements.
-#define POWERPC_PERF_DECLARE(a, cond) int altivec_placeholder __attribute__ ((unused))
-#define POWERPC_PERF_START_COUNT(a, cond) do {} while (0)
-#define POWERPC_PERF_STOP_COUNT(a, cond) do {} while (0)
-#endif /* POWERPC_PERFORMANCE_REPORT */
-
-#endif /* _DSPUTIL_PPC_ */
diff --git a/src/libffmpeg/libavcodec/ppc/fdct_altivec.c b/src/libffmpeg/libavcodec/ppc/fdct_altivec.c
deleted file mode 100644
index 2418c32bb..000000000
--- a/src/libffmpeg/libavcodec/ppc/fdct_altivec.c
+++ /dev/null
@@ -1,493 +0,0 @@
-/* ffmpeg/libavcodec/ppc/fdct_altivec.c, this file is part of the
- * AltiVec optimized library for the FFMPEG Multimedia System
- * Copyright (C) 2003 James Klicman <james@klicman.org>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-
-#include "common.h"
-#include "../dsputil.h"
-#include "dsputil_altivec.h"
-#include "gcc_fixes.h"
-
-
-#define vs16(v) ((vector signed short)(v))
-#define vs32(v) ((vector signed int)(v))
-#define vu8(v) ((vector unsigned char)(v))
-#define vu16(v) ((vector unsigned short)(v))
-#define vu32(v) ((vector unsigned int)(v))
-
-
-#define C1 0.98078525066375732421875000 /* cos(1*PI/16) */
-#define C2 0.92387950420379638671875000 /* cos(2*PI/16) */
-#define C3 0.83146959543228149414062500 /* cos(3*PI/16) */
-#define C4 0.70710676908493041992187500 /* cos(4*PI/16) */
-#define C5 0.55557024478912353515625000 /* cos(5*PI/16) */
-#define C6 0.38268342614173889160156250 /* cos(6*PI/16) */
-#define C7 0.19509032368659973144531250 /* cos(7*PI/16) */
-#define SQRT_2 1.41421353816986083984375000 /* sqrt(2) */
-
-
-#define W0 -(2 * C2)
-#define W1 (2 * C6)
-#define W2 (SQRT_2 * C6)
-#define W3 (SQRT_2 * C3)
-#define W4 (SQRT_2 * (-C1 + C3 + C5 - C7))
-#define W5 (SQRT_2 * ( C1 + C3 - C5 + C7))
-#define W6 (SQRT_2 * ( C1 + C3 + C5 - C7))
-#define W7 (SQRT_2 * ( C1 + C3 - C5 - C7))
-#define W8 (SQRT_2 * ( C7 - C3))
-#define W9 (SQRT_2 * (-C1 - C3))
-#define WA (SQRT_2 * (-C3 - C5))
-#define WB (SQRT_2 * ( C5 - C3))
-
-
-static vector float fdctconsts[3] = {
- (vector float)AVV( W0, W1, W2, W3 ),
- (vector float)AVV( W4, W5, W6, W7 ),
- (vector float)AVV( W8, W9, WA, WB )
-};
-
-#define LD_W0 vec_splat(cnsts0, 0)
-#define LD_W1 vec_splat(cnsts0, 1)
-#define LD_W2 vec_splat(cnsts0, 2)
-#define LD_W3 vec_splat(cnsts0, 3)
-#define LD_W4 vec_splat(cnsts1, 0)
-#define LD_W5 vec_splat(cnsts1, 1)
-#define LD_W6 vec_splat(cnsts1, 2)
-#define LD_W7 vec_splat(cnsts1, 3)
-#define LD_W8 vec_splat(cnsts2, 0)
-#define LD_W9 vec_splat(cnsts2, 1)
-#define LD_WA vec_splat(cnsts2, 2)
-#define LD_WB vec_splat(cnsts2, 3)
-
-
-#define FDCTROW(b0,b1,b2,b3,b4,b5,b6,b7) /* {{{ */ \
- x0 = vec_add(b0, b7); /* x0 = b0 + b7; */ \
- x7 = vec_sub(b0, b7); /* x7 = b0 - b7; */ \
- x1 = vec_add(b1, b6); /* x1 = b1 + b6; */ \
- x6 = vec_sub(b1, b6); /* x6 = b1 - b6; */ \
- x2 = vec_add(b2, b5); /* x2 = b2 + b5; */ \
- x5 = vec_sub(b2, b5); /* x5 = b2 - b5; */ \
- x3 = vec_add(b3, b4); /* x3 = b3 + b4; */ \
- x4 = vec_sub(b3, b4); /* x4 = b3 - b4; */ \
- \
- b7 = vec_add(x0, x3); /* b7 = x0 + x3; */ \
- b1 = vec_add(x1, x2); /* b1 = x1 + x2; */ \
- b0 = vec_add(b7, b1); /* b0 = b7 + b1; */ \
- b4 = vec_sub(b7, b1); /* b4 = b7 - b1; */ \
- \
- b2 = vec_sub(x0, x3); /* b2 = x0 - x3; */ \
- b6 = vec_sub(x1, x2); /* b6 = x1 - x2; */ \
- b5 = vec_add(b6, b2); /* b5 = b6 + b2; */ \
- cnst = LD_W2; \
- b5 = vec_madd(cnst, b5, mzero); /* b5 = b5 * W2; */ \
- cnst = LD_W1; \
- b2 = vec_madd(cnst, b2, b5); /* b2 = b5 + b2 * W1; */ \
- cnst = LD_W0; \
- b6 = vec_madd(cnst, b6, b5); /* b6 = b5 + b6 * W0; */ \
- \
- x0 = vec_add(x4, x7); /* x0 = x4 + x7; */ \
- x1 = vec_add(x5, x6); /* x1 = x5 + x6; */ \
- x2 = vec_add(x4, x6); /* x2 = x4 + x6; */ \
- x3 = vec_add(x5, x7); /* x3 = x5 + x7; */ \
- x8 = vec_add(x2, x3); /* x8 = x2 + x3; */ \
- cnst = LD_W3; \
- x8 = vec_madd(cnst, x8, mzero); /* x8 = x8 * W3; */ \
- \
- cnst = LD_W8; \
- x0 = vec_madd(cnst, x0, mzero); /* x0 *= W8; */ \
- cnst = LD_W9; \
- x1 = vec_madd(cnst, x1, mzero); /* x1 *= W9; */ \
- cnst = LD_WA; \
- x2 = vec_madd(cnst, x2, x8); /* x2 = x2 * WA + x8; */ \
- cnst = LD_WB; \
- x3 = vec_madd(cnst, x3, x8); /* x3 = x3 * WB + x8; */ \
- \
- cnst = LD_W4; \
- b7 = vec_madd(cnst, x4, x0); /* b7 = x4 * W4 + x0; */ \
- cnst = LD_W5; \
- b5 = vec_madd(cnst, x5, x1); /* b5 = x5 * W5 + x1; */ \
- cnst = LD_W6; \
- b3 = vec_madd(cnst, x6, x1); /* b3 = x6 * W6 + x1; */ \
- cnst = LD_W7; \
- b1 = vec_madd(cnst, x7, x0); /* b1 = x7 * W7 + x0; */ \
- \
- b7 = vec_add(b7, x2); /* b7 = b7 + x2; */ \
- b5 = vec_add(b5, x3); /* b5 = b5 + x3; */ \
- b3 = vec_add(b3, x2); /* b3 = b3 + x2; */ \
- b1 = vec_add(b1, x3); /* b1 = b1 + x3; */ \
- /* }}} */
-
-#define FDCTCOL(b0,b1,b2,b3,b4,b5,b6,b7) /* {{{ */ \
- x0 = vec_add(b0, b7); /* x0 = b0 + b7; */ \
- x7 = vec_sub(b0, b7); /* x7 = b0 - b7; */ \
- x1 = vec_add(b1, b6); /* x1 = b1 + b6; */ \
- x6 = vec_sub(b1, b6); /* x6 = b1 - b6; */ \
- x2 = vec_add(b2, b5); /* x2 = b2 + b5; */ \
- x5 = vec_sub(b2, b5); /* x5 = b2 - b5; */ \
- x3 = vec_add(b3, b4); /* x3 = b3 + b4; */ \
- x4 = vec_sub(b3, b4); /* x4 = b3 - b4; */ \
- \
- b7 = vec_add(x0, x3); /* b7 = x0 + x3; */ \
- b1 = vec_add(x1, x2); /* b1 = x1 + x2; */ \
- b0 = vec_add(b7, b1); /* b0 = b7 + b1; */ \
- b4 = vec_sub(b7, b1); /* b4 = b7 - b1; */ \
- \
- b2 = vec_sub(x0, x3); /* b2 = x0 - x3; */ \
- b6 = vec_sub(x1, x2); /* b6 = x1 - x2; */ \
- b5 = vec_add(b6, b2); /* b5 = b6 + b2; */ \
- cnst = LD_W2; \
- b5 = vec_madd(cnst, b5, mzero); /* b5 = b5 * W2; */ \
- cnst = LD_W1; \
- b2 = vec_madd(cnst, b2, b5); /* b2 = b5 + b2 * W1; */ \
- cnst = LD_W0; \
- b6 = vec_madd(cnst, b6, b5); /* b6 = b5 + b6 * W0; */ \
- \
- x0 = vec_add(x4, x7); /* x0 = x4 + x7; */ \
- x1 = vec_add(x5, x6); /* x1 = x5 + x6; */ \
- x2 = vec_add(x4, x6); /* x2 = x4 + x6; */ \
- x3 = vec_add(x5, x7); /* x3 = x5 + x7; */ \
- x8 = vec_add(x2, x3); /* x8 = x2 + x3; */ \
- cnst = LD_W3; \
- x8 = vec_madd(cnst, x8, mzero); /* x8 = x8 * W3; */ \
- \
- cnst = LD_W8; \
- x0 = vec_madd(cnst, x0, mzero); /* x0 *= W8; */ \
- cnst = LD_W9; \
- x1 = vec_madd(cnst, x1, mzero); /* x1 *= W9; */ \
- cnst = LD_WA; \
- x2 = vec_madd(cnst, x2, x8); /* x2 = x2 * WA + x8; */ \
- cnst = LD_WB; \
- x3 = vec_madd(cnst, x3, x8); /* x3 = x3 * WB + x8; */ \
- \
- cnst = LD_W4; \
- b7 = vec_madd(cnst, x4, x0); /* b7 = x4 * W4 + x0; */ \
- cnst = LD_W5; \
- b5 = vec_madd(cnst, x5, x1); /* b5 = x5 * W5 + x1; */ \
- cnst = LD_W6; \
- b3 = vec_madd(cnst, x6, x1); /* b3 = x6 * W6 + x1; */ \
- cnst = LD_W7; \
- b1 = vec_madd(cnst, x7, x0); /* b1 = x7 * W7 + x0; */ \
- \
- b7 = vec_add(b7, x2); /* b7 += x2; */ \
- b5 = vec_add(b5, x3); /* b5 += x3; */ \
- b3 = vec_add(b3, x2); /* b3 += x2; */ \
- b1 = vec_add(b1, x3); /* b1 += x3; */ \
- /* }}} */
-
-
-
-/* two dimensional discrete cosine transform */
-
-void fdct_altivec(int16_t *block)
-{
-POWERPC_PERF_DECLARE(altivec_fdct, 1);
- vector signed short *bp;
- vector float *cp;
- vector float b00, b10, b20, b30, b40, b50, b60, b70;
- vector float b01, b11, b21, b31, b41, b51, b61, b71;
- vector float mzero, cnst, cnsts0, cnsts1, cnsts2;
- vector float x0, x1, x2, x3, x4, x5, x6, x7, x8;
-
- POWERPC_PERF_START_COUNT(altivec_fdct, 1);
-
-
- /* setup constants {{{ */
- /* mzero = -0.0 */
- mzero = ((vector float)vec_splat_u32(-1));
- mzero = ((vector float)vec_sl(vu32(mzero), vu32(mzero)));
- cp = fdctconsts;
- cnsts0 = vec_ld(0, cp); cp++;
- cnsts1 = vec_ld(0, cp); cp++;
- cnsts2 = vec_ld(0, cp);
- /* }}} */
-
-
- /* 8x8 matrix transpose (vector short[8]) {{{ */
-#define MERGE_S16(hl,a,b) vec_merge##hl(vs16(a), vs16(b))
-
- bp = (vector signed short*)block;
- b00 = ((vector float)vec_ld(0, bp));
- b40 = ((vector float)vec_ld(16*4, bp));
- b01 = ((vector float)MERGE_S16(h, b00, b40));
- b11 = ((vector float)MERGE_S16(l, b00, b40));
- bp++;
- b10 = ((vector float)vec_ld(0, bp));
- b50 = ((vector float)vec_ld(16*4, bp));
- b21 = ((vector float)MERGE_S16(h, b10, b50));
- b31 = ((vector float)MERGE_S16(l, b10, b50));
- bp++;
- b20 = ((vector float)vec_ld(0, bp));
- b60 = ((vector float)vec_ld(16*4, bp));
- b41 = ((vector float)MERGE_S16(h, b20, b60));
- b51 = ((vector float)MERGE_S16(l, b20, b60));
- bp++;
- b30 = ((vector float)vec_ld(0, bp));
- b70 = ((vector float)vec_ld(16*4, bp));
- b61 = ((vector float)MERGE_S16(h, b30, b70));
- b71 = ((vector float)MERGE_S16(l, b30, b70));
-
- x0 = ((vector float)MERGE_S16(h, b01, b41));
- x1 = ((vector float)MERGE_S16(l, b01, b41));
- x2 = ((vector float)MERGE_S16(h, b11, b51));
- x3 = ((vector float)MERGE_S16(l, b11, b51));
- x4 = ((vector float)MERGE_S16(h, b21, b61));
- x5 = ((vector float)MERGE_S16(l, b21, b61));
- x6 = ((vector float)MERGE_S16(h, b31, b71));
- x7 = ((vector float)MERGE_S16(l, b31, b71));
-
- b00 = ((vector float)MERGE_S16(h, x0, x4));
- b10 = ((vector float)MERGE_S16(l, x0, x4));
- b20 = ((vector float)MERGE_S16(h, x1, x5));
- b30 = ((vector float)MERGE_S16(l, x1, x5));
- b40 = ((vector float)MERGE_S16(h, x2, x6));
- b50 = ((vector float)MERGE_S16(l, x2, x6));
- b60 = ((vector float)MERGE_S16(h, x3, x7));
- b70 = ((vector float)MERGE_S16(l, x3, x7));
-
-#undef MERGE_S16
- /* }}} */
-
-
-/* Some of the initial calculations can be done as vector short before
- * conversion to vector float. The following code section takes advantage
- * of this.
- */
-#if 1
- /* fdct rows {{{ */
- x0 = ((vector float)vec_add(vs16(b00), vs16(b70)));
- x7 = ((vector float)vec_sub(vs16(b00), vs16(b70)));
- x1 = ((vector float)vec_add(vs16(b10), vs16(b60)));
- x6 = ((vector float)vec_sub(vs16(b10), vs16(b60)));
- x2 = ((vector float)vec_add(vs16(b20), vs16(b50)));
- x5 = ((vector float)vec_sub(vs16(b20), vs16(b50)));
- x3 = ((vector float)vec_add(vs16(b30), vs16(b40)));
- x4 = ((vector float)vec_sub(vs16(b30), vs16(b40)));
-
- b70 = ((vector float)vec_add(vs16(x0), vs16(x3)));
- b10 = ((vector float)vec_add(vs16(x1), vs16(x2)));
-
- b00 = ((vector float)vec_add(vs16(b70), vs16(b10)));
- b40 = ((vector float)vec_sub(vs16(b70), vs16(b10)));
-
-#define CTF0(n) \
- b##n##1 = ((vector float)vec_unpackl(vs16(b##n##0))); \
- b##n##0 = ((vector float)vec_unpackh(vs16(b##n##0))); \
- b##n##1 = vec_ctf(vs32(b##n##1), 0); \
- b##n##0 = vec_ctf(vs32(b##n##0), 0);
-
- CTF0(0);
- CTF0(4);
-
- b20 = ((vector float)vec_sub(vs16(x0), vs16(x3)));
- b60 = ((vector float)vec_sub(vs16(x1), vs16(x2)));
-
- CTF0(2);
- CTF0(6);
-
-#undef CTF0
-
- x0 = vec_add(b60, b20);
- x1 = vec_add(b61, b21);
-
- cnst = LD_W2;
- x0 = vec_madd(cnst, x0, mzero);
- x1 = vec_madd(cnst, x1, mzero);
- cnst = LD_W1;
- b20 = vec_madd(cnst, b20, x0);
- b21 = vec_madd(cnst, b21, x1);
- cnst = LD_W0;
- b60 = vec_madd(cnst, b60, x0);
- b61 = vec_madd(cnst, b61, x1);
-
-#define CTFX(x,b) \
- b##0 = ((vector float)vec_unpackh(vs16(x))); \
- b##1 = ((vector float)vec_unpackl(vs16(x))); \
- b##0 = vec_ctf(vs32(b##0), 0); \
- b##1 = vec_ctf(vs32(b##1), 0); \
-
- CTFX(x4, b7);
- CTFX(x5, b5);
- CTFX(x6, b3);
- CTFX(x7, b1);
-
-#undef CTFX
-
-
- x0 = vec_add(b70, b10);
- x1 = vec_add(b50, b30);
- x2 = vec_add(b70, b30);
- x3 = vec_add(b50, b10);
- x8 = vec_add(x2, x3);
- cnst = LD_W3;
- x8 = vec_madd(cnst, x8, mzero);
-
- cnst = LD_W8;
- x0 = vec_madd(cnst, x0, mzero);
- cnst = LD_W9;
- x1 = vec_madd(cnst, x1, mzero);
- cnst = LD_WA;
- x2 = vec_madd(cnst, x2, x8);
- cnst = LD_WB;
- x3 = vec_madd(cnst, x3, x8);
-
- cnst = LD_W4;
- b70 = vec_madd(cnst, b70, x0);
- cnst = LD_W5;
- b50 = vec_madd(cnst, b50, x1);
- cnst = LD_W6;
- b30 = vec_madd(cnst, b30, x1);
- cnst = LD_W7;
- b10 = vec_madd(cnst, b10, x0);
-
- b70 = vec_add(b70, x2);
- b50 = vec_add(b50, x3);
- b30 = vec_add(b30, x2);
- b10 = vec_add(b10, x3);
-
-
- x0 = vec_add(b71, b11);
- x1 = vec_add(b51, b31);
- x2 = vec_add(b71, b31);
- x3 = vec_add(b51, b11);
- x8 = vec_add(x2, x3);
- cnst = LD_W3;
- x8 = vec_madd(cnst, x8, mzero);
-
- cnst = LD_W8;
- x0 = vec_madd(cnst, x0, mzero);
- cnst = LD_W9;
- x1 = vec_madd(cnst, x1, mzero);
- cnst = LD_WA;
- x2 = vec_madd(cnst, x2, x8);
- cnst = LD_WB;
- x3 = vec_madd(cnst, x3, x8);
-
- cnst = LD_W4;
- b71 = vec_madd(cnst, b71, x0);
- cnst = LD_W5;
- b51 = vec_madd(cnst, b51, x1);
- cnst = LD_W6;
- b31 = vec_madd(cnst, b31, x1);
- cnst = LD_W7;
- b11 = vec_madd(cnst, b11, x0);
-
- b71 = vec_add(b71, x2);
- b51 = vec_add(b51, x3);
- b31 = vec_add(b31, x2);
- b11 = vec_add(b11, x3);
- /* }}} */
-#else
- /* convert to float {{{ */
-#define CTF(n) \
- vs32(b##n##1) = vec_unpackl(vs16(b##n##0)); \
- vs32(b##n##0) = vec_unpackh(vs16(b##n##0)); \
- b##n##1 = vec_ctf(vs32(b##n##1), 0); \
- b##n##0 = vec_ctf(vs32(b##n##0), 0); \
-
- CTF(0);
- CTF(1);
- CTF(2);
- CTF(3);
- CTF(4);
- CTF(5);
- CTF(6);
- CTF(7);
-
-#undef CTF
- /* }}} */
-
- FDCTROW(b00, b10, b20, b30, b40, b50, b60, b70);
- FDCTROW(b01, b11, b21, b31, b41, b51, b61, b71);
-#endif
-
-
- /* 8x8 matrix transpose (vector float[8][2]) {{{ */
- x0 = vec_mergel(b00, b20);
- x1 = vec_mergeh(b00, b20);
- x2 = vec_mergel(b10, b30);
- x3 = vec_mergeh(b10, b30);
-
- b00 = vec_mergeh(x1, x3);
- b10 = vec_mergel(x1, x3);
- b20 = vec_mergeh(x0, x2);
- b30 = vec_mergel(x0, x2);
-
- x4 = vec_mergel(b41, b61);
- x5 = vec_mergeh(b41, b61);
- x6 = vec_mergel(b51, b71);
- x7 = vec_mergeh(b51, b71);
-
- b41 = vec_mergeh(x5, x7);
- b51 = vec_mergel(x5, x7);
- b61 = vec_mergeh(x4, x6);
- b71 = vec_mergel(x4, x6);
-
- x0 = vec_mergel(b01, b21);
- x1 = vec_mergeh(b01, b21);
- x2 = vec_mergel(b11, b31);
- x3 = vec_mergeh(b11, b31);
-
- x4 = vec_mergel(b40, b60);
- x5 = vec_mergeh(b40, b60);
- x6 = vec_mergel(b50, b70);
- x7 = vec_mergeh(b50, b70);
-
- b40 = vec_mergeh(x1, x3);
- b50 = vec_mergel(x1, x3);
- b60 = vec_mergeh(x0, x2);
- b70 = vec_mergel(x0, x2);
-
- b01 = vec_mergeh(x5, x7);
- b11 = vec_mergel(x5, x7);
- b21 = vec_mergeh(x4, x6);
- b31 = vec_mergel(x4, x6);
- /* }}} */
-
-
- FDCTCOL(b00, b10, b20, b30, b40, b50, b60, b70);
- FDCTCOL(b01, b11, b21, b31, b41, b51, b61, b71);
-
-
- /* round, convert back to short {{{ */
-#define CTS(n) \
- b##n##0 = vec_round(b##n##0); \
- b##n##1 = vec_round(b##n##1); \
- b##n##0 = ((vector float)vec_cts(b##n##0, 0)); \
- b##n##1 = ((vector float)vec_cts(b##n##1, 0)); \
- b##n##0 = ((vector float)vec_pack(vs32(b##n##0), vs32(b##n##1))); \
- vec_st(vs16(b##n##0), 0, bp);
-
- bp = (vector signed short*)block;
- CTS(0); bp++;
- CTS(1); bp++;
- CTS(2); bp++;
- CTS(3); bp++;
- CTS(4); bp++;
- CTS(5); bp++;
- CTS(6); bp++;
- CTS(7);
-
-#undef CTS
- /* }}} */
-
-POWERPC_PERF_STOP_COUNT(altivec_fdct, 1);
-}
-
-/* vim:set foldmethod=marker foldlevel=0: */
diff --git a/src/libffmpeg/libavcodec/ppc/fft_altivec.c b/src/libffmpeg/libavcodec/ppc/fft_altivec.c
deleted file mode 100644
index 384a774ff..000000000
--- a/src/libffmpeg/libavcodec/ppc/fft_altivec.c
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * FFT/IFFT transforms
- * AltiVec-enabled
- * Copyright (c) 2003 Romain Dolbeau <romain@dolbeau.org>
- * Based on code Copyright (c) 2002 Fabrice Bellard.
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "../dsputil.h"
-
-#include "gcc_fixes.h"
-
-#include "dsputil_altivec.h"
-
-/*
- those three macros are from libavcodec/fft.c
- and are required for the reference C code
-*/
-/* butter fly op */
-#define BF(pre, pim, qre, qim, pre1, pim1, qre1, qim1) \
-{\
- FFTSample ax, ay, bx, by;\
- bx=pre1;\
- by=pim1;\
- ax=qre1;\
- ay=qim1;\
- pre = (bx + ax);\
- pim = (by + ay);\
- qre = (bx - ax);\
- qim = (by - ay);\
-}
-#define MUL16(a,b) ((a) * (b))
-#define CMUL(pre, pim, are, aim, bre, bim) \
-{\
- pre = (MUL16(are, bre) - MUL16(aim, bim));\
- pim = (MUL16(are, bim) + MUL16(bre, aim));\
-}
-
-
-/**
- * Do a complex FFT with the parameters defined in ff_fft_init(). The
- * input data must be permuted before with s->revtab table. No
- * 1.0/sqrt(n) normalization is done.
- * AltiVec-enabled
- * This code assumes that the 'z' pointer is 16 bytes-aligned
- * It also assumes all FFTComplex are 8 bytes-aligned pair of float
- * The code is exactly the same as the SSE version, except
- * that successive MUL + ADD/SUB have been merged into
- * fused multiply-add ('vec_madd' in altivec)
- */
-void ff_fft_calc_altivec(FFTContext *s, FFTComplex *z)
-{
-POWERPC_PERF_DECLARE(altivec_fft_num, s->nbits >= 6);
- register const vector float vczero = (const vector float)vec_splat_u32(0.);
-
- int ln = s->nbits;
- int j, np, np2;
- int nblocks, nloops;
- register FFTComplex *p, *q;
- FFTComplex *cptr, *cptr1;
- int k;
-
-POWERPC_PERF_START_COUNT(altivec_fft_num, s->nbits >= 6);
-
- np = 1 << ln;
-
- {
- vector float *r, a, b, a1, c1, c2;
-
- r = (vector float *)&z[0];
-
- c1 = vcii(p,p,n,n);
-
- if (s->inverse)
- {
- c2 = vcii(p,p,n,p);
- }
- else
- {
- c2 = vcii(p,p,p,n);
- }
-
- j = (np >> 2);
- do {
- a = vec_ld(0, r);
- a1 = vec_ld(sizeof(vector float), r);
-
- b = vec_perm(a,a,vcprmle(1,0,3,2));
- a = vec_madd(a,c1,b);
- /* do the pass 0 butterfly */
-
- b = vec_perm(a1,a1,vcprmle(1,0,3,2));
- b = vec_madd(a1,c1,b);
- /* do the pass 0 butterfly */
-
- /* multiply third by -i */
- b = vec_perm(b,b,vcprmle(2,3,1,0));
-
- /* do the pass 1 butterfly */
- vec_st(vec_madd(b,c2,a), 0, r);
- vec_st(vec_nmsub(b,c2,a), sizeof(vector float), r);
-
- r += 2;
- } while (--j != 0);
- }
- /* pass 2 .. ln-1 */
-
- nblocks = np >> 3;
- nloops = 1 << 2;
- np2 = np >> 1;
-
- cptr1 = s->exptab1;
- do {
- p = z;
- q = z + nloops;
- j = nblocks;
- do {
- cptr = cptr1;
- k = nloops >> 1;
- do {
- vector float a,b,c,t1;
-
- a = vec_ld(0, (float*)p);
- b = vec_ld(0, (float*)q);
-
- /* complex mul */
- c = vec_ld(0, (float*)cptr);
- /* cre*re cim*re */
- t1 = vec_madd(c, vec_perm(b,b,vcprmle(2,2,0,0)),vczero);
- c = vec_ld(sizeof(vector float), (float*)cptr);
- /* -cim*im cre*im */
- b = vec_madd(c, vec_perm(b,b,vcprmle(3,3,1,1)),t1);
-
- /* butterfly */
- vec_st(vec_add(a,b), 0, (float*)p);
- vec_st(vec_sub(a,b), 0, (float*)q);
-
- p += 2;
- q += 2;
- cptr += 4;
- } while (--k);
-
- p += nloops;
- q += nloops;
- } while (--j);
- cptr1 += nloops * 2;
- nblocks = nblocks >> 1;
- nloops = nloops << 1;
- } while (nblocks != 0);
-
-POWERPC_PERF_STOP_COUNT(altivec_fft_num, s->nbits >= 6);
-}
diff --git a/src/libffmpeg/libavcodec/ppc/float_altivec.c b/src/libffmpeg/libavcodec/ppc/float_altivec.c
deleted file mode 100644
index 22c2de61a..000000000
--- a/src/libffmpeg/libavcodec/ppc/float_altivec.c
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Copyright (c) 2006 Luca Barbato <lu_zero@gentoo.org>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "../dsputil.h"
-
-#include "gcc_fixes.h"
-
-#include "dsputil_altivec.h"
-
-static void vector_fmul_altivec(float *dst, const float *src, int len)
-{
- int i;
- vector float d0, d1, s, zero = (vector float)vec_splat_u32(0);
- for(i=0; i<len-7; i+=8) {
- d0 = vec_ld(0, dst+i);
- s = vec_ld(0, src+i);
- d1 = vec_ld(16, dst+i);
- d0 = vec_madd(d0, s, zero);
- d1 = vec_madd(d1, vec_ld(16,src+i), zero);
- vec_st(d0, 0, dst+i);
- vec_st(d1, 16, dst+i);
- }
-}
-
-static void vector_fmul_reverse_altivec(float *dst, const float *src0,
- const float *src1, int len)
-{
- int i;
- vector float d, s0, s1, h0, l0,
- s2, s3, zero = (vector float)vec_splat_u32(0);
- src1 += len-4;
- for(i=0; i<len-7; i+=8) {
- s1 = vec_ld(0, src1-i); // [a,b,c,d]
- s0 = vec_ld(0, src0+i);
- l0 = vec_mergel(s1, s1); // [c,c,d,d]
- s3 = vec_ld(-16, src1-i);
- h0 = vec_mergeh(s1, s1); // [a,a,b,b]
- s2 = vec_ld(16, src0+i);
- s1 = vec_mergeh(vec_mergel(l0,h0), // [d,b,d,b]
- vec_mergeh(l0,h0)); // [c,a,c,a]
- // [d,c,b,a]
- l0 = vec_mergel(s3, s3);
- d = vec_madd(s0, s1, zero);
- h0 = vec_mergeh(s3, s3);
- vec_st(d, 0, dst+i);
- s3 = vec_mergeh(vec_mergel(l0,h0),
- vec_mergeh(l0,h0));
- d = vec_madd(s2, s3, zero);
- vec_st(d, 16, dst+i);
- }
-}
-
-static void vector_fmul_add_add_altivec(float *dst, const float *src0,
- const float *src1, const float *src2,
- int src3, int len, int step)
-{
- int i;
- vector float d, s0, s1, s2, t0, t1, edges;
- vector unsigned char align = vec_lvsr(0,dst),
- mask = vec_lvsl(0, dst);
-
-#if 0 //FIXME: there is still something wrong
- if (step == 2) {
- int y;
- vector float d0, d1, s3, t2;
- vector unsigned int sel =
- vec_mergeh(vec_splat_u32(-1), vec_splat_u32(0));
- t1 = vec_ld(16, dst);
- for (i=0,y=0; i<len-3; i+=4,y+=8) {
-
- s0 = vec_ld(0,src0+i);
- s1 = vec_ld(0,src1+i);
- s2 = vec_ld(0,src2+i);
-
-// t0 = vec_ld(0, dst+y); //[x x x|a]
-// t1 = vec_ld(16, dst+y); //[b c d|e]
- t2 = vec_ld(31, dst+y); //[f g h|x]
-
- d = vec_madd(s0,s1,s2); // [A B C D]
-
- // [A A B B]
-
- // [C C D D]
-
- d0 = vec_perm(t0, t1, mask); // [a b c d]
-
- d0 = vec_sel(vec_mergeh(d, d), d0, sel); // [A b B d]
-
- edges = vec_perm(t1, t0, mask);
-
- t0 = vec_perm(edges, d0, align); // [x x x|A]
-
- t1 = vec_perm(d0, edges, align); // [b B d|e]
-
- vec_stl(t0, 0, dst+y);
-
- d1 = vec_perm(t1, t2, mask); // [e f g h]
-
- d1 = vec_sel(vec_mergel(d, d), d1, sel); // [C f D h]
-
- edges = vec_perm(t2, t1, mask);
-
- t1 = vec_perm(edges, d1, align); // [b B d|C]
-
- t2 = vec_perm(d1, edges, align); // [f D h|x]
-
- vec_stl(t1, 16, dst+y);
-
- t0 = t1;
-
- vec_stl(t2, 31, dst+y);
-
- t1 = t2;
- }
- } else
- #endif
- if (step == 1 && src3 == 0)
- for (i=0; i<len-3; i+=4) {
- t0 = vec_ld(0, dst+i);
- t1 = vec_ld(15, dst+i);
- s0 = vec_ld(0, src0+i);
- s1 = vec_ld(0, src1+i);
- s2 = vec_ld(0, src2+i);
- edges = vec_perm(t1 ,t0, mask);
- d = vec_madd(s0,s1,s2);
- t1 = vec_perm(d, edges, align);
- t0 = vec_perm(edges, d, align);
- vec_st(t1, 15, dst+i);
- vec_st(t0, 0, dst+i);
- }
- else
- ff_vector_fmul_add_add_c(dst, src0, src1, src2, src3, len, step);
-}
-
-void float_to_int16_altivec(int16_t *dst, const float *src, int len)
-{
- int i;
- vector float s0, s1;
- vector signed int t0, t1;
- vector signed short d0, d1, d;
- vector unsigned char align;
- if(((long)dst)&15) //FIXME
- for(i=0; i<len-7; i+=8) {
- s0 = vec_ld(0, src+i);
- s1 = vec_ld(16, src+i);
- t0 = vec_cts(s0, 0);
- d0 = vec_ld(0, dst+i);
- t1 = vec_cts(s1, 0);
- d1 = vec_ld(15, dst+i);
- d = vec_packs(t0,t1);
- d1 = vec_perm(d1, d0, vec_lvsl(0,dst+i));
- align = vec_lvsr(0, dst+i);
- d0 = vec_perm(d1, d, align);
- d1 = vec_perm(d, d1, align);
- vec_st(d0, 0, dst+i);
- vec_st(d1,15, dst+i);
- }
- else
- for(i=0; i<len-7; i+=8) {
- s0 = vec_ld(0, src+i);
- s1 = vec_ld(16, src+i);
- t0 = vec_cts(s0, 0);
- t1 = vec_cts(s1, 0);
- d = vec_packs(t0,t1);
- vec_st(d, 0, dst+i);
- }
-}
-
-void float_init_altivec(DSPContext* c, AVCodecContext *avctx)
-{
- c->vector_fmul = vector_fmul_altivec;
- c->vector_fmul_reverse = vector_fmul_reverse_altivec;
- c->vector_fmul_add_add = vector_fmul_add_add_altivec;
- if(!(avctx->flags & CODEC_FLAG_BITEXACT))
- c->float_to_int16 = float_to_int16_altivec;
-}
diff --git a/src/libffmpeg/libavcodec/ppc/gcc_fixes.h b/src/libffmpeg/libavcodec/ppc/gcc_fixes.h
deleted file mode 100644
index 5a4a55188..000000000
--- a/src/libffmpeg/libavcodec/ppc/gcc_fixes.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * gcc fixes for altivec.
- * Used to workaround broken gcc (FSF gcc-3 pre gcc-3.3)
- * and to stay somewhat compatible with Darwin.
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _GCC_FIXES_
-#define _GCC_FIXES_
-
-#ifdef HAVE_ALTIVEC_H
-#include <altivec.h>
-#endif
-
-#ifdef CONFIG_DARWIN
-# ifndef __MWERKS__
-# define AVV(x...) (x)
-# else
-# define AVV
-# endif
-#define REG_v(a) asm ( #a )
-#else
-
-#define AVV(x...) {x}
-
-#if (__GNUC__ < 4)
-# define REG_v(a)
-#else
-# define REG_v(a) asm ( #a )
-#endif
-
-#if (__GNUC__ * 100 + __GNUC_MINOR__ < 303)
-
-/* This code was provided to me by Bartosch Pixa
- * as a separate header file (broken_mergel.h).
- * thanks to lu_zero for the workaround.
- *
- * See this mail for more information:
- * http://gcc.gnu.org/ml/gcc/2003-04/msg00967.html
- */
-
-static inline vector signed char ff_vmrglb (vector signed char const A,
- vector signed char const B)
-{
- static const vector unsigned char lowbyte = {
- 0x08, 0x18, 0x09, 0x19, 0x0a, 0x1a, 0x0b, 0x1b,
- 0x0c, 0x1c, 0x0d, 0x1d, 0x0e, 0x1e, 0x0f, 0x1f
- };
- return vec_perm (A, B, lowbyte);
-}
-
-static inline vector signed short ff_vmrglh (vector signed short const A,
- vector signed short const B)
-{
- static const vector unsigned char lowhalf = {
- 0x08, 0x09, 0x18, 0x19, 0x0a, 0x0b, 0x1a, 0x1b,
- 0x0c, 0x0d, 0x1c, 0x1d, 0x0e, 0x0f, 0x1e, 0x1f
- };
- return vec_perm (A, B, lowhalf);
-}
-
-static inline vector signed int ff_vmrglw (vector signed int const A,
- vector signed int const B)
-{
- static const vector unsigned char lowword = {
- 0x08, 0x09, 0x0a, 0x0b, 0x18, 0x19, 0x1a, 0x1b,
- 0x0c, 0x0d, 0x0e, 0x0f, 0x1c, 0x1d, 0x1e, 0x1f
- };
- return vec_perm (A, B, lowword);
-}
-/*#define ff_vmrglb ff_vmrglb
-#define ff_vmrglh ff_vmrglh
-#define ff_vmrglw ff_vmrglw
-*/
-#undef vec_mergel
-
-#define vec_mergel(a1, a2) \
-__ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \
- ((vector signed char) ff_vmrglb ((vector signed char) (a1), (vector signed char) (a2))), \
-__ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
- ((vector unsigned char) ff_vmrglb ((vector signed char) (a1), (vector signed char) (a2))), \
-__ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \
- ((vector signed short) ff_vmrglh ((vector signed short) (a1), (vector signed short) (a2))), \
-__ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \
- ((vector unsigned short) ff_vmrglh ((vector signed short) (a1), (vector signed short) (a2))), \
-__ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
- ((vector float) ff_vmrglw ((vector signed int) (a1), (vector signed int) (a2))), \
-__ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \
- ((vector signed int) ff_vmrglw ((vector signed int) (a1), (vector signed int) (a2))), \
-__ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \
- ((vector unsigned int) ff_vmrglw ((vector signed int) (a1), (vector signed int) (a2))), \
- __altivec_link_error_invalid_argument ())))))))
-
-#endif
-
-#endif /* CONFIG_DARWIN */
-
-#ifndef __MWERKS__
-#define const_vector const vector
-#else
-#define const_vector vector
-#endif
-
-#endif /* _GCC_FIXES_ */
diff --git a/src/libffmpeg/libavcodec/ppc/gmc_altivec.c b/src/libffmpeg/libavcodec/ppc/gmc_altivec.c
deleted file mode 100644
index 42c936bb3..000000000
--- a/src/libffmpeg/libavcodec/ppc/gmc_altivec.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * GMC (Global Motion Compensation)
- * AltiVec-enabled
- * Copyright (c) 2003 Romain Dolbeau <romain@dolbeau.org>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "../dsputil.h"
-
-#include "gcc_fixes.h"
-
-#include "dsputil_altivec.h"
-
-/*
- altivec-enhanced gmc1. ATM this code assume stride is a multiple of 8,
- to preserve proper dst alignement.
-*/
-#define GMC1_PERF_COND (h==8)
-void gmc1_altivec(uint8_t *dst /* align 8 */, uint8_t *src /* align1 */, int stride, int h, int x16, int y16, int rounder)
-{
-POWERPC_PERF_DECLARE(altivec_gmc1_num, GMC1_PERF_COND);
- const unsigned short __attribute__ ((aligned(16))) rounder_a[8] =
- {rounder, rounder, rounder, rounder,
- rounder, rounder, rounder, rounder};
- const unsigned short __attribute__ ((aligned(16))) ABCD[8] =
- {
- (16-x16)*(16-y16), /* A */
- ( x16)*(16-y16), /* B */
- (16-x16)*( y16), /* C */
- ( x16)*( y16), /* D */
- 0, 0, 0, 0 /* padding */
- };
- register const_vector unsigned char vczero = (const_vector unsigned char)vec_splat_u8(0);
- register const_vector unsigned short vcsr8 = (const_vector unsigned short)vec_splat_u16(8);
- register vector unsigned char dstv, dstv2, src_0, src_1, srcvA, srcvB, srcvC, srcvD;
- register vector unsigned short Av, Bv, Cv, Dv, rounderV, tempA, tempB, tempC, tempD;
- int i;
- unsigned long dst_odd = (unsigned long)dst & 0x0000000F;
- unsigned long src_really_odd = (unsigned long)src & 0x0000000F;
-
-
-POWERPC_PERF_START_COUNT(altivec_gmc1_num, GMC1_PERF_COND);
-
- tempA = vec_ld(0, (unsigned short*)ABCD);
- Av = vec_splat(tempA, 0);
- Bv = vec_splat(tempA, 1);
- Cv = vec_splat(tempA, 2);
- Dv = vec_splat(tempA, 3);
-
- rounderV = vec_ld(0, (unsigned short*)rounder_a);
-
- // we'll be able to pick-up our 9 char elements
- // at src from those 32 bytes
- // we load the first batch here, as inside the loop
- // we can re-use 'src+stride' from one iteration
- // as the 'src' of the next.
- src_0 = vec_ld(0, src);
- src_1 = vec_ld(16, src);
- srcvA = vec_perm(src_0, src_1, vec_lvsl(0, src));
-
- if (src_really_odd != 0x0000000F)
- { // if src & 0xF == 0xF, then (src+1) is properly aligned on the second vector.
- srcvB = vec_perm(src_0, src_1, vec_lvsl(1, src));
- }
- else
- {
- srcvB = src_1;
- }
- srcvA = vec_mergeh(vczero, srcvA);
- srcvB = vec_mergeh(vczero, srcvB);
-
- for(i=0; i<h; i++)
- {
- dst_odd = (unsigned long)dst & 0x0000000F;
- src_really_odd = (((unsigned long)src) + stride) & 0x0000000F;
-
- dstv = vec_ld(0, dst);
-
- // we we'll be able to pick-up our 9 char elements
- // at src + stride from those 32 bytes
- // then reuse the resulting 2 vectors srvcC and srcvD
- // as the next srcvA and srcvB
- src_0 = vec_ld(stride + 0, src);
- src_1 = vec_ld(stride + 16, src);
- srcvC = vec_perm(src_0, src_1, vec_lvsl(stride + 0, src));
-
- if (src_really_odd != 0x0000000F)
- { // if src & 0xF == 0xF, then (src+1) is properly aligned on the second vector.
- srcvD = vec_perm(src_0, src_1, vec_lvsl(stride + 1, src));
- }
- else
- {
- srcvD = src_1;
- }
-
- srcvC = vec_mergeh(vczero, srcvC);
- srcvD = vec_mergeh(vczero, srcvD);
-
-
- // OK, now we (finally) do the math :-)
- // those four instructions replaces 32 int muls & 32 int adds.
- // isn't AltiVec nice ?
- tempA = vec_mladd((vector unsigned short)srcvA, Av, rounderV);
- tempB = vec_mladd((vector unsigned short)srcvB, Bv, tempA);
- tempC = vec_mladd((vector unsigned short)srcvC, Cv, tempB);
- tempD = vec_mladd((vector unsigned short)srcvD, Dv, tempC);
-
- srcvA = srcvC;
- srcvB = srcvD;
-
- tempD = vec_sr(tempD, vcsr8);
-
- dstv2 = vec_pack(tempD, (vector unsigned short)vczero);
-
- if (dst_odd)
- {
- dstv2 = vec_perm(dstv, dstv2, vcprm(0,1,s0,s1));
- }
- else
- {
- dstv2 = vec_perm(dstv, dstv2, vcprm(s0,s1,2,3));
- }
-
- vec_st(dstv2, 0, dst);
-
- dst += stride;
- src += stride;
- }
-
-POWERPC_PERF_STOP_COUNT(altivec_gmc1_num, GMC1_PERF_COND);
-}
diff --git a/src/libffmpeg/libavcodec/ppc/h264_altivec.c b/src/libffmpeg/libavcodec/ppc/h264_altivec.c
deleted file mode 100644
index bac620e82..000000000
--- a/src/libffmpeg/libavcodec/ppc/h264_altivec.c
+++ /dev/null
@@ -1,565 +0,0 @@
-/*
- * Copyright (c) 2004 Romain Dolbeau <romain@dolbeau.org>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "../dsputil.h"
-
-#include "gcc_fixes.h"
-
-#include "dsputil_altivec.h"
-#include "types_altivec.h"
-
-#define PUT_OP_U8_ALTIVEC(d, s, dst) d = s
-#define AVG_OP_U8_ALTIVEC(d, s, dst) d = vec_avg(dst, s)
-
-#define OP_U8_ALTIVEC PUT_OP_U8_ALTIVEC
-#define PREFIX_h264_chroma_mc8_altivec put_h264_chroma_mc8_altivec
-#define PREFIX_h264_chroma_mc8_num altivec_put_h264_chroma_mc8_num
-#define PREFIX_h264_qpel16_h_lowpass_altivec put_h264_qpel16_h_lowpass_altivec
-#define PREFIX_h264_qpel16_h_lowpass_num altivec_put_h264_qpel16_h_lowpass_num
-#define PREFIX_h264_qpel16_v_lowpass_altivec put_h264_qpel16_v_lowpass_altivec
-#define PREFIX_h264_qpel16_v_lowpass_num altivec_put_h264_qpel16_v_lowpass_num
-#define PREFIX_h264_qpel16_hv_lowpass_altivec put_h264_qpel16_hv_lowpass_altivec
-#define PREFIX_h264_qpel16_hv_lowpass_num altivec_put_h264_qpel16_hv_lowpass_num
-#include "h264_template_altivec.c"
-#undef OP_U8_ALTIVEC
-#undef PREFIX_h264_chroma_mc8_altivec
-#undef PREFIX_h264_chroma_mc8_num
-#undef PREFIX_h264_qpel16_h_lowpass_altivec
-#undef PREFIX_h264_qpel16_h_lowpass_num
-#undef PREFIX_h264_qpel16_v_lowpass_altivec
-#undef PREFIX_h264_qpel16_v_lowpass_num
-#undef PREFIX_h264_qpel16_hv_lowpass_altivec
-#undef PREFIX_h264_qpel16_hv_lowpass_num
-
-#define OP_U8_ALTIVEC AVG_OP_U8_ALTIVEC
-#define PREFIX_h264_chroma_mc8_altivec avg_h264_chroma_mc8_altivec
-#define PREFIX_h264_chroma_mc8_num altivec_avg_h264_chroma_mc8_num
-#define PREFIX_h264_qpel16_h_lowpass_altivec avg_h264_qpel16_h_lowpass_altivec
-#define PREFIX_h264_qpel16_h_lowpass_num altivec_avg_h264_qpel16_h_lowpass_num
-#define PREFIX_h264_qpel16_v_lowpass_altivec avg_h264_qpel16_v_lowpass_altivec
-#define PREFIX_h264_qpel16_v_lowpass_num altivec_avg_h264_qpel16_v_lowpass_num
-#define PREFIX_h264_qpel16_hv_lowpass_altivec avg_h264_qpel16_hv_lowpass_altivec
-#define PREFIX_h264_qpel16_hv_lowpass_num altivec_avg_h264_qpel16_hv_lowpass_num
-#include "h264_template_altivec.c"
-#undef OP_U8_ALTIVEC
-#undef PREFIX_h264_chroma_mc8_altivec
-#undef PREFIX_h264_chroma_mc8_num
-#undef PREFIX_h264_qpel16_h_lowpass_altivec
-#undef PREFIX_h264_qpel16_h_lowpass_num
-#undef PREFIX_h264_qpel16_v_lowpass_altivec
-#undef PREFIX_h264_qpel16_v_lowpass_num
-#undef PREFIX_h264_qpel16_hv_lowpass_altivec
-#undef PREFIX_h264_qpel16_hv_lowpass_num
-
-#define H264_MC(OPNAME, SIZE, CODETYPE) \
-static void OPNAME ## h264_qpel ## SIZE ## _mc00_ ## CODETYPE (uint8_t *dst, uint8_t *src, int stride){\
- OPNAME ## pixels ## SIZE ## _ ## CODETYPE(dst, src, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc10_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){ \
- DECLARE_ALIGNED_16(uint8_t, half[SIZE*SIZE]);\
- put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(half, src, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src, half, stride, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc20_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- OPNAME ## h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(dst, src, stride, stride);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc30_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- DECLARE_ALIGNED_16(uint8_t, half[SIZE*SIZE]);\
- put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(half, src, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src+1, half, stride, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc01_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- DECLARE_ALIGNED_16(uint8_t, half[SIZE*SIZE]);\
- put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(half, src, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src, half, stride, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc02_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- OPNAME ## h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(dst, src, stride, stride);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc03_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- DECLARE_ALIGNED_16(uint8_t, half[SIZE*SIZE]);\
- put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(half, src, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src+stride, half, stride, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc11_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- DECLARE_ALIGNED_16(uint8_t, halfH[SIZE*SIZE]);\
- DECLARE_ALIGNED_16(uint8_t, halfV[SIZE*SIZE]);\
- put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src, SIZE, stride);\
- put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfV, stride, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc31_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- DECLARE_ALIGNED_16(uint8_t, halfH[SIZE*SIZE]);\
- DECLARE_ALIGNED_16(uint8_t, halfV[SIZE*SIZE]);\
- put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src, SIZE, stride);\
- put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src+1, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfV, stride, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc13_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- DECLARE_ALIGNED_16(uint8_t, halfH[SIZE*SIZE]);\
- DECLARE_ALIGNED_16(uint8_t, halfV[SIZE*SIZE]);\
- put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src + stride, SIZE, stride);\
- put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfV, stride, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc33_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- DECLARE_ALIGNED_16(uint8_t, halfH[SIZE*SIZE]);\
- DECLARE_ALIGNED_16(uint8_t, halfV[SIZE*SIZE]);\
- put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src + stride, SIZE, stride);\
- put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src+1, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfV, stride, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc22_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- DECLARE_ALIGNED_16(int16_t, tmp[SIZE*(SIZE+8)]);\
- OPNAME ## h264_qpel ## SIZE ## _hv_lowpass_ ## CODETYPE(dst, tmp, src, stride, SIZE, stride);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc21_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- DECLARE_ALIGNED_16(uint8_t, halfH[SIZE*SIZE]);\
- DECLARE_ALIGNED_16(uint8_t, halfHV[SIZE*SIZE]);\
- DECLARE_ALIGNED_16(int16_t, tmp[SIZE*(SIZE+8)]);\
- put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src, SIZE, stride);\
- put_h264_qpel ## SIZE ## _hv_lowpass_ ## CODETYPE(halfHV, tmp, src, SIZE, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfHV, stride, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc23_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- DECLARE_ALIGNED_16(uint8_t, halfH[SIZE*SIZE]);\
- DECLARE_ALIGNED_16(uint8_t, halfHV[SIZE*SIZE]);\
- DECLARE_ALIGNED_16(int16_t, tmp[SIZE*(SIZE+8)]);\
- put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src + stride, SIZE, stride);\
- put_h264_qpel ## SIZE ## _hv_lowpass_ ## CODETYPE(halfHV, tmp, src, SIZE, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfHV, stride, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc12_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- DECLARE_ALIGNED_16(uint8_t, halfV[SIZE*SIZE]);\
- DECLARE_ALIGNED_16(uint8_t, halfHV[SIZE*SIZE]);\
- DECLARE_ALIGNED_16(int16_t, tmp[SIZE*(SIZE+8)]);\
- put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src, SIZE, stride);\
- put_h264_qpel ## SIZE ## _hv_lowpass_ ## CODETYPE(halfHV, tmp, src, SIZE, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfV, halfHV, stride, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc32_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- DECLARE_ALIGNED_16(uint8_t, halfV[SIZE*SIZE]);\
- DECLARE_ALIGNED_16(uint8_t, halfHV[SIZE*SIZE]);\
- DECLARE_ALIGNED_16(int16_t, tmp[SIZE*(SIZE+8)]);\
- put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src+1, SIZE, stride);\
- put_h264_qpel ## SIZE ## _hv_lowpass_ ## CODETYPE(halfHV, tmp, src, SIZE, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfV, halfHV, stride, SIZE, SIZE);\
-}\
-
-/* this code assume that stride % 16 == 0 */
-void put_no_rnd_h264_chroma_mc8_altivec(uint8_t * dst, uint8_t * src, int stride, int h, int x, int y) {
- signed int ABCD[4] __attribute__((aligned(16))) =
- {((8 - x) * (8 - y)),
- ((x) * (8 - y)),
- ((8 - x) * (y)),
- ((x) * (y))};
- register int i;
- vector unsigned char fperm;
- const vector signed int vABCD = vec_ld(0, ABCD);
- const vector signed short vA = vec_splat((vector signed short)vABCD, 1);
- const vector signed short vB = vec_splat((vector signed short)vABCD, 3);
- const vector signed short vC = vec_splat((vector signed short)vABCD, 5);
- const vector signed short vD = vec_splat((vector signed short)vABCD, 7);
- const vector signed int vzero = vec_splat_s32(0);
- const vector signed short v28ss = vec_sub(vec_sl(vec_splat_s16(1),vec_splat_u16(5)),vec_splat_s16(4));
- const vector unsigned short v6us = vec_splat_u16(6);
- register int loadSecond = (((unsigned long)src) % 16) <= 7 ? 0 : 1;
- register int reallyBadAlign = (((unsigned long)src) % 16) == 15 ? 1 : 0;
-
- vector unsigned char vsrcAuc, vsrcBuc, vsrcperm0, vsrcperm1;
- vector unsigned char vsrc0uc, vsrc1uc;
- vector signed short vsrc0ssH, vsrc1ssH;
- vector unsigned char vsrcCuc, vsrc2uc, vsrc3uc;
- vector signed short vsrc2ssH, vsrc3ssH, psum;
- vector unsigned char vdst, ppsum, fsum;
-
- if (((unsigned long)dst) % 16 == 0) {
- fperm = (vector unsigned char)AVV(0x10, 0x11, 0x12, 0x13,
- 0x14, 0x15, 0x16, 0x17,
- 0x08, 0x09, 0x0A, 0x0B,
- 0x0C, 0x0D, 0x0E, 0x0F);
- } else {
- fperm = (vector unsigned char)AVV(0x00, 0x01, 0x02, 0x03,
- 0x04, 0x05, 0x06, 0x07,
- 0x18, 0x19, 0x1A, 0x1B,
- 0x1C, 0x1D, 0x1E, 0x1F);
- }
-
- vsrcAuc = vec_ld(0, src);
-
- if (loadSecond)
- vsrcBuc = vec_ld(16, src);
- vsrcperm0 = vec_lvsl(0, src);
- vsrcperm1 = vec_lvsl(1, src);
-
- vsrc0uc = vec_perm(vsrcAuc, vsrcBuc, vsrcperm0);
- if (reallyBadAlign)
- vsrc1uc = vsrcBuc;
- else
- vsrc1uc = vec_perm(vsrcAuc, vsrcBuc, vsrcperm1);
-
- vsrc0ssH = (vector signed short)vec_mergeh((vector unsigned char)vzero,
- (vector unsigned char)vsrc0uc);
- vsrc1ssH = (vector signed short)vec_mergeh((vector unsigned char)vzero,
- (vector unsigned char)vsrc1uc);
-
- if (!loadSecond) {// -> !reallyBadAlign
- for (i = 0 ; i < h ; i++) {
-
-
- vsrcCuc = vec_ld(stride + 0, src);
-
- vsrc2uc = vec_perm(vsrcCuc, vsrcCuc, vsrcperm0);
- vsrc3uc = vec_perm(vsrcCuc, vsrcCuc, vsrcperm1);
-
- vsrc2ssH = (vector signed short)vec_mergeh((vector unsigned char)vzero,
- (vector unsigned char)vsrc2uc);
- vsrc3ssH = (vector signed short)vec_mergeh((vector unsigned char)vzero,
- (vector unsigned char)vsrc3uc);
-
- psum = vec_mladd(vA, vsrc0ssH, vec_splat_s16(0));
- psum = vec_mladd(vB, vsrc1ssH, psum);
- psum = vec_mladd(vC, vsrc2ssH, psum);
- psum = vec_mladd(vD, vsrc3ssH, psum);
- psum = vec_add(v28ss, psum);
- psum = vec_sra(psum, v6us);
-
- vdst = vec_ld(0, dst);
- ppsum = (vector unsigned char)vec_packsu(psum, psum);
- fsum = vec_perm(vdst, ppsum, fperm);
-
- vec_st(fsum, 0, dst);
-
- vsrc0ssH = vsrc2ssH;
- vsrc1ssH = vsrc3ssH;
-
- dst += stride;
- src += stride;
- }
- } else {
- vector unsigned char vsrcDuc;
- for (i = 0 ; i < h ; i++) {
- vsrcCuc = vec_ld(stride + 0, src);
- vsrcDuc = vec_ld(stride + 16, src);
-
- vsrc2uc = vec_perm(vsrcCuc, vsrcDuc, vsrcperm0);
- if (reallyBadAlign)
- vsrc3uc = vsrcDuc;
- else
- vsrc3uc = vec_perm(vsrcCuc, vsrcDuc, vsrcperm1);
-
- vsrc2ssH = (vector signed short)vec_mergeh((vector unsigned char)vzero,
- (vector unsigned char)vsrc2uc);
- vsrc3ssH = (vector signed short)vec_mergeh((vector unsigned char)vzero,
- (vector unsigned char)vsrc3uc);
-
- psum = vec_mladd(vA, vsrc0ssH, vec_splat_s16(0));
- psum = vec_mladd(vB, vsrc1ssH, psum);
- psum = vec_mladd(vC, vsrc2ssH, psum);
- psum = vec_mladd(vD, vsrc3ssH, psum);
- psum = vec_add(v28ss, psum);
- psum = vec_sr(psum, v6us);
-
- vdst = vec_ld(0, dst);
- ppsum = (vector unsigned char)vec_pack(psum, psum);
- fsum = vec_perm(vdst, ppsum, fperm);
-
- vec_st(fsum, 0, dst);
-
- vsrc0ssH = vsrc2ssH;
- vsrc1ssH = vsrc3ssH;
-
- dst += stride;
- src += stride;
- }
- }
-}
-
-static inline void put_pixels16_l2_altivec( uint8_t * dst, const uint8_t * src1,
- const uint8_t * src2, int dst_stride,
- int src_stride1, int h)
-{
- int i;
- vector unsigned char a, b, d, tmp1, tmp2, mask, mask_, edges, align;
-
- mask_ = vec_lvsl(0, src2);
-
- for (i = 0; i < h; i++) {
-
- tmp1 = vec_ld(i * src_stride1, src1);
- mask = vec_lvsl(i * src_stride1, src1);
- tmp2 = vec_ld(i * src_stride1 + 15, src1);
-
- a = vec_perm(tmp1, tmp2, mask);
-
- tmp1 = vec_ld(i * 16, src2);
- tmp2 = vec_ld(i * 16 + 15, src2);
-
- b = vec_perm(tmp1, tmp2, mask_);
-
- tmp1 = vec_ld(0, dst);
- mask = vec_lvsl(0, dst);
- tmp2 = vec_ld(15, dst);
-
- d = vec_avg(a, b);
-
- edges = vec_perm(tmp2, tmp1, mask);
-
- align = vec_lvsr(0, dst);
-
- tmp2 = vec_perm(d, edges, align);
- tmp1 = vec_perm(edges, d, align);
-
- vec_st(tmp2, 15, dst);
- vec_st(tmp1, 0 , dst);
-
- dst += dst_stride;
- }
-}
-
-static inline void avg_pixels16_l2_altivec( uint8_t * dst, const uint8_t * src1,
- const uint8_t * src2, int dst_stride,
- int src_stride1, int h)
-{
- int i;
- vector unsigned char a, b, d, tmp1, tmp2, mask, mask_, edges, align;
-
- mask_ = vec_lvsl(0, src2);
-
- for (i = 0; i < h; i++) {
-
- tmp1 = vec_ld(i * src_stride1, src1);
- mask = vec_lvsl(i * src_stride1, src1);
- tmp2 = vec_ld(i * src_stride1 + 15, src1);
-
- a = vec_perm(tmp1, tmp2, mask);
-
- tmp1 = vec_ld(i * 16, src2);
- tmp2 = vec_ld(i * 16 + 15, src2);
-
- b = vec_perm(tmp1, tmp2, mask_);
-
- tmp1 = vec_ld(0, dst);
- mask = vec_lvsl(0, dst);
- tmp2 = vec_ld(15, dst);
-
- d = vec_avg(vec_perm(tmp1, tmp2, mask), vec_avg(a, b));
-
- edges = vec_perm(tmp2, tmp1, mask);
-
- align = vec_lvsr(0, dst);
-
- tmp2 = vec_perm(d, edges, align);
- tmp1 = vec_perm(edges, d, align);
-
- vec_st(tmp2, 15, dst);
- vec_st(tmp1, 0 , dst);
-
- dst += dst_stride;
- }
-}
-
-/* Implemented but could be faster
-#define put_pixels16_l2_altivec(d,s1,s2,ds,s1s,h) put_pixels16_l2(d,s1,s2,ds,s1s,16,h)
-#define avg_pixels16_l2_altivec(d,s1,s2,ds,s1s,h) avg_pixels16_l2(d,s1,s2,ds,s1s,16,h)
- */
-
- H264_MC(put_, 16, altivec)
- H264_MC(avg_, 16, altivec)
-
-
-/****************************************************************************
- * IDCT transform:
- ****************************************************************************/
-
-#define IDCT8_1D_ALTIVEC(s0, s1, s2, s3, s4, s5, s6, s7, d0, d1, d2, d3, d4, d5, d6, d7) {\
- /* a0 = SRC(0) + SRC(4); */ \
- vec_s16_t a0v = vec_add(s0, s4); \
- /* a2 = SRC(0) - SRC(4); */ \
- vec_s16_t a2v = vec_sub(s0, s4); \
- /* a4 = (SRC(2)>>1) - SRC(6); */ \
- vec_s16_t a4v = vec_sub(vec_sra(s2, onev), s6); \
- /* a6 = (SRC(6)>>1) + SRC(2); */ \
- vec_s16_t a6v = vec_add(vec_sra(s6, onev), s2); \
- /* b0 = a0 + a6; */ \
- vec_s16_t b0v = vec_add(a0v, a6v); \
- /* b2 = a2 + a4; */ \
- vec_s16_t b2v = vec_add(a2v, a4v); \
- /* b4 = a2 - a4; */ \
- vec_s16_t b4v = vec_sub(a2v, a4v); \
- /* b6 = a0 - a6; */ \
- vec_s16_t b6v = vec_sub(a0v, a6v); \
- /* a1 = SRC(5) - SRC(3) - SRC(7) - (SRC(7)>>1); */ \
- /* a1 = (SRC(5)-SRC(3)) - (SRC(7) + (SRC(7)>>1)); */ \
- vec_s16_t a1v = vec_sub( vec_sub(s5, s3), vec_add(s7, vec_sra(s7, onev)) ); \
- /* a3 = SRC(7) + SRC(1) - SRC(3) - (SRC(3)>>1); */ \
- /* a3 = (SRC(7)+SRC(1)) - (SRC(3) + (SRC(3)>>1)); */ \
- vec_s16_t a3v = vec_sub( vec_add(s7, s1), vec_add(s3, vec_sra(s3, onev)) );\
- /* a5 = SRC(7) - SRC(1) + SRC(5) + (SRC(5)>>1); */ \
- /* a5 = (SRC(7)-SRC(1)) + SRC(5) + (SRC(5)>>1); */ \
- vec_s16_t a5v = vec_add( vec_sub(s7, s1), vec_add(s5, vec_sra(s5, onev)) );\
- /* a7 = SRC(5)+SRC(3) + SRC(1) + (SRC(1)>>1); */ \
- vec_s16_t a7v = vec_add( vec_add(s5, s3), vec_add(s1, vec_sra(s1, onev)) );\
- /* b1 = (a7>>2) + a1; */ \
- vec_s16_t b1v = vec_add( vec_sra(a7v, twov), a1v); \
- /* b3 = a3 + (a5>>2); */ \
- vec_s16_t b3v = vec_add(a3v, vec_sra(a5v, twov)); \
- /* b5 = (a3>>2) - a5; */ \
- vec_s16_t b5v = vec_sub( vec_sra(a3v, twov), a5v); \
- /* b7 = a7 - (a1>>2); */ \
- vec_s16_t b7v = vec_sub( a7v, vec_sra(a1v, twov)); \
- /* DST(0, b0 + b7); */ \
- d0 = vec_add(b0v, b7v); \
- /* DST(1, b2 + b5); */ \
- d1 = vec_add(b2v, b5v); \
- /* DST(2, b4 + b3); */ \
- d2 = vec_add(b4v, b3v); \
- /* DST(3, b6 + b1); */ \
- d3 = vec_add(b6v, b1v); \
- /* DST(4, b6 - b1); */ \
- d4 = vec_sub(b6v, b1v); \
- /* DST(5, b4 - b3); */ \
- d5 = vec_sub(b4v, b3v); \
- /* DST(6, b2 - b5); */ \
- d6 = vec_sub(b2v, b5v); \
- /* DST(7, b0 - b7); */ \
- d7 = vec_sub(b0v, b7v); \
-}
-
-#define ALTIVEC_STORE_SUM_CLIP(dest, idctv, perm_ldv, perm_stv, sel) { \
- /* unaligned load */ \
- vec_u8_t hv = vec_ld( 0, dest ); \
- vec_u8_t lv = vec_ld( 7, dest ); \
- vec_u8_t dstv = vec_perm( hv, lv, (vec_u8_t)perm_ldv ); \
- vec_s16_t idct_sh6 = vec_sra(idctv, sixv); \
- vec_u16_t dst16 = (vec_u16_t)vec_mergeh(zero_u8v, dstv); \
- vec_s16_t idstsum = vec_adds(idct_sh6, (vec_s16_t)dst16); \
- vec_u8_t idstsum8 = vec_packsu(zero_s16v, idstsum); \
- vec_u8_t edgehv; \
- /* unaligned store */ \
- vec_u8_t bodyv = vec_perm( idstsum8, idstsum8, perm_stv );\
- vec_u8_t edgelv = vec_perm( sel, zero_u8v, perm_stv ); \
- lv = vec_sel( lv, bodyv, edgelv ); \
- vec_st( lv, 7, dest ); \
- hv = vec_ld( 0, dest ); \
- edgehv = vec_perm( zero_u8v, sel, perm_stv ); \
- hv = vec_sel( hv, bodyv, edgehv ); \
- vec_st( hv, 0, dest ); \
- }
-
-void ff_h264_idct8_add_altivec( uint8_t *dst, DCTELEM *dct, int stride ) {
- vec_s16_t s0, s1, s2, s3, s4, s5, s6, s7;
- vec_s16_t d0, d1, d2, d3, d4, d5, d6, d7;
- vec_s16_t idct0, idct1, idct2, idct3, idct4, idct5, idct6, idct7;
-
- vec_u8_t perm_ldv = vec_lvsl(0, dst);
- vec_u8_t perm_stv = vec_lvsr(8, dst);
-
- const vec_u16_t onev = vec_splat_u16(1);
- const vec_u16_t twov = vec_splat_u16(2);
- const vec_u16_t sixv = vec_splat_u16(6);
-
- const vec_u8_t sel = (vec_u8_t) AVV(0,0,0,0,0,0,0,0,
- -1,-1,-1,-1,-1,-1,-1,-1);
- LOAD_ZERO;
-
- dct[0] += 32; // rounding for the >>6 at the end
-
- s0 = vec_ld(0x00, (int16_t*)dct);
- s1 = vec_ld(0x10, (int16_t*)dct);
- s2 = vec_ld(0x20, (int16_t*)dct);
- s3 = vec_ld(0x30, (int16_t*)dct);
- s4 = vec_ld(0x40, (int16_t*)dct);
- s5 = vec_ld(0x50, (int16_t*)dct);
- s6 = vec_ld(0x60, (int16_t*)dct);
- s7 = vec_ld(0x70, (int16_t*)dct);
-
- IDCT8_1D_ALTIVEC(s0, s1, s2, s3, s4, s5, s6, s7,
- d0, d1, d2, d3, d4, d5, d6, d7);
-
- TRANSPOSE8( d0, d1, d2, d3, d4, d5, d6, d7 );
-
- IDCT8_1D_ALTIVEC(d0, d1, d2, d3, d4, d5, d6, d7,
- idct0, idct1, idct2, idct3, idct4, idct5, idct6, idct7);
-
- ALTIVEC_STORE_SUM_CLIP(&dst[0*stride], idct0, perm_ldv, perm_stv, sel);
- ALTIVEC_STORE_SUM_CLIP(&dst[1*stride], idct1, perm_ldv, perm_stv, sel);
- ALTIVEC_STORE_SUM_CLIP(&dst[2*stride], idct2, perm_ldv, perm_stv, sel);
- ALTIVEC_STORE_SUM_CLIP(&dst[3*stride], idct3, perm_ldv, perm_stv, sel);
- ALTIVEC_STORE_SUM_CLIP(&dst[4*stride], idct4, perm_ldv, perm_stv, sel);
- ALTIVEC_STORE_SUM_CLIP(&dst[5*stride], idct5, perm_ldv, perm_stv, sel);
- ALTIVEC_STORE_SUM_CLIP(&dst[6*stride], idct6, perm_ldv, perm_stv, sel);
- ALTIVEC_STORE_SUM_CLIP(&dst[7*stride], idct7, perm_ldv, perm_stv, sel);
-}
-
-void dsputil_h264_init_ppc(DSPContext* c, AVCodecContext *avctx) {
-
-#ifdef HAVE_ALTIVEC
- if (has_altivec()) {
- c->put_h264_chroma_pixels_tab[0] = put_h264_chroma_mc8_altivec;
- c->put_no_rnd_h264_chroma_pixels_tab[0] = put_no_rnd_h264_chroma_mc8_altivec;
- c->avg_h264_chroma_pixels_tab[0] = avg_h264_chroma_mc8_altivec;
- c->h264_idct8_add = ff_h264_idct8_add_altivec;
-
-#define dspfunc(PFX, IDX, NUM) \
- c->PFX ## _pixels_tab[IDX][ 0] = PFX ## NUM ## _mc00_altivec; \
- c->PFX ## _pixels_tab[IDX][ 1] = PFX ## NUM ## _mc10_altivec; \
- c->PFX ## _pixels_tab[IDX][ 2] = PFX ## NUM ## _mc20_altivec; \
- c->PFX ## _pixels_tab[IDX][ 3] = PFX ## NUM ## _mc30_altivec; \
- c->PFX ## _pixels_tab[IDX][ 4] = PFX ## NUM ## _mc01_altivec; \
- c->PFX ## _pixels_tab[IDX][ 5] = PFX ## NUM ## _mc11_altivec; \
- c->PFX ## _pixels_tab[IDX][ 6] = PFX ## NUM ## _mc21_altivec; \
- c->PFX ## _pixels_tab[IDX][ 7] = PFX ## NUM ## _mc31_altivec; \
- c->PFX ## _pixels_tab[IDX][ 8] = PFX ## NUM ## _mc02_altivec; \
- c->PFX ## _pixels_tab[IDX][ 9] = PFX ## NUM ## _mc12_altivec; \
- c->PFX ## _pixels_tab[IDX][10] = PFX ## NUM ## _mc22_altivec; \
- c->PFX ## _pixels_tab[IDX][11] = PFX ## NUM ## _mc32_altivec; \
- c->PFX ## _pixels_tab[IDX][12] = PFX ## NUM ## _mc03_altivec; \
- c->PFX ## _pixels_tab[IDX][13] = PFX ## NUM ## _mc13_altivec; \
- c->PFX ## _pixels_tab[IDX][14] = PFX ## NUM ## _mc23_altivec; \
- c->PFX ## _pixels_tab[IDX][15] = PFX ## NUM ## _mc33_altivec
-
- dspfunc(put_h264_qpel, 0, 16);
- dspfunc(avg_h264_qpel, 0, 16);
-#undef dspfunc
-
- } else
-#endif /* HAVE_ALTIVEC */
- {
- // Non-AltiVec PPC optimisations
-
- // ... pending ...
- }
-}
diff --git a/src/libffmpeg/libavcodec/ppc/h264_template_altivec.c b/src/libffmpeg/libavcodec/ppc/h264_template_altivec.c
deleted file mode 100644
index e8ad67f2f..000000000
--- a/src/libffmpeg/libavcodec/ppc/h264_template_altivec.c
+++ /dev/null
@@ -1,719 +0,0 @@
-/*
- * Copyright (c) 2004 Romain Dolbeau <romain@dolbeau.org>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/* this code assume that stride % 16 == 0 */
-void PREFIX_h264_chroma_mc8_altivec(uint8_t * dst, uint8_t * src, int stride, int h, int x, int y) {
- POWERPC_PERF_DECLARE(PREFIX_h264_chroma_mc8_num, 1);
- signed int ABCD[4] __attribute__((aligned(16))) =
- {((8 - x) * (8 - y)),
- ((x) * (8 - y)),
- ((8 - x) * (y)),
- ((x) * (y))};
- register int i;
- vector unsigned char fperm;
- const vector signed int vABCD = vec_ld(0, ABCD);
- const vector signed short vA = vec_splat((vector signed short)vABCD, 1);
- const vector signed short vB = vec_splat((vector signed short)vABCD, 3);
- const vector signed short vC = vec_splat((vector signed short)vABCD, 5);
- const vector signed short vD = vec_splat((vector signed short)vABCD, 7);
- const vector signed int vzero = vec_splat_s32(0);
- const vector signed short v32ss = vec_sl(vec_splat_s16(1),vec_splat_u16(5));
- const vector unsigned short v6us = vec_splat_u16(6);
- register int loadSecond = (((unsigned long)src) % 16) <= 7 ? 0 : 1;
- register int reallyBadAlign = (((unsigned long)src) % 16) == 15 ? 1 : 0;
-
- vector unsigned char vsrcAuc, vsrcBuc, vsrcperm0, vsrcperm1;
- vector unsigned char vsrc0uc, vsrc1uc;
- vector signed short vsrc0ssH, vsrc1ssH;
- vector unsigned char vsrcCuc, vsrc2uc, vsrc3uc;
- vector signed short vsrc2ssH, vsrc3ssH, psum;
- vector unsigned char vdst, ppsum, vfdst, fsum;
-
- POWERPC_PERF_START_COUNT(PREFIX_h264_chroma_mc8_num, 1);
-
- if (((unsigned long)dst) % 16 == 0) {
- fperm = (vector unsigned char)AVV(0x10, 0x11, 0x12, 0x13,
- 0x14, 0x15, 0x16, 0x17,
- 0x08, 0x09, 0x0A, 0x0B,
- 0x0C, 0x0D, 0x0E, 0x0F);
- } else {
- fperm = (vector unsigned char)AVV(0x00, 0x01, 0x02, 0x03,
- 0x04, 0x05, 0x06, 0x07,
- 0x18, 0x19, 0x1A, 0x1B,
- 0x1C, 0x1D, 0x1E, 0x1F);
- }
-
- vsrcAuc = vec_ld(0, src);
-
- if (loadSecond)
- vsrcBuc = vec_ld(16, src);
- vsrcperm0 = vec_lvsl(0, src);
- vsrcperm1 = vec_lvsl(1, src);
-
- vsrc0uc = vec_perm(vsrcAuc, vsrcBuc, vsrcperm0);
- if (reallyBadAlign)
- vsrc1uc = vsrcBuc;
- else
- vsrc1uc = vec_perm(vsrcAuc, vsrcBuc, vsrcperm1);
-
- vsrc0ssH = (vector signed short)vec_mergeh((vector unsigned char)vzero,
- (vector unsigned char)vsrc0uc);
- vsrc1ssH = (vector signed short)vec_mergeh((vector unsigned char)vzero,
- (vector unsigned char)vsrc1uc);
-
- if (!loadSecond) {// -> !reallyBadAlign
- for (i = 0 ; i < h ; i++) {
-
-
- vsrcCuc = vec_ld(stride + 0, src);
-
- vsrc2uc = vec_perm(vsrcCuc, vsrcCuc, vsrcperm0);
- vsrc3uc = vec_perm(vsrcCuc, vsrcCuc, vsrcperm1);
-
- vsrc2ssH = (vector signed short)vec_mergeh((vector unsigned char)vzero,
- (vector unsigned char)vsrc2uc);
- vsrc3ssH = (vector signed short)vec_mergeh((vector unsigned char)vzero,
- (vector unsigned char)vsrc3uc);
-
- psum = vec_mladd(vA, vsrc0ssH, vec_splat_s16(0));
- psum = vec_mladd(vB, vsrc1ssH, psum);
- psum = vec_mladd(vC, vsrc2ssH, psum);
- psum = vec_mladd(vD, vsrc3ssH, psum);
- psum = vec_add(v32ss, psum);
- psum = vec_sra(psum, v6us);
-
- vdst = vec_ld(0, dst);
- ppsum = (vector unsigned char)vec_packsu(psum, psum);
- vfdst = vec_perm(vdst, ppsum, fperm);
-
- OP_U8_ALTIVEC(fsum, vfdst, vdst);
-
- vec_st(fsum, 0, dst);
-
- vsrc0ssH = vsrc2ssH;
- vsrc1ssH = vsrc3ssH;
-
- dst += stride;
- src += stride;
- }
- } else {
- vector unsigned char vsrcDuc;
- for (i = 0 ; i < h ; i++) {
- vsrcCuc = vec_ld(stride + 0, src);
- vsrcDuc = vec_ld(stride + 16, src);
-
- vsrc2uc = vec_perm(vsrcCuc, vsrcDuc, vsrcperm0);
- if (reallyBadAlign)
- vsrc3uc = vsrcDuc;
- else
- vsrc3uc = vec_perm(vsrcCuc, vsrcDuc, vsrcperm1);
-
- vsrc2ssH = (vector signed short)vec_mergeh((vector unsigned char)vzero,
- (vector unsigned char)vsrc2uc);
- vsrc3ssH = (vector signed short)vec_mergeh((vector unsigned char)vzero,
- (vector unsigned char)vsrc3uc);
-
- psum = vec_mladd(vA, vsrc0ssH, vec_splat_s16(0));
- psum = vec_mladd(vB, vsrc1ssH, psum);
- psum = vec_mladd(vC, vsrc2ssH, psum);
- psum = vec_mladd(vD, vsrc3ssH, psum);
- psum = vec_add(v32ss, psum);
- psum = vec_sr(psum, v6us);
-
- vdst = vec_ld(0, dst);
- ppsum = (vector unsigned char)vec_pack(psum, psum);
- vfdst = vec_perm(vdst, ppsum, fperm);
-
- OP_U8_ALTIVEC(fsum, vfdst, vdst);
-
- vec_st(fsum, 0, dst);
-
- vsrc0ssH = vsrc2ssH;
- vsrc1ssH = vsrc3ssH;
-
- dst += stride;
- src += stride;
- }
- }
- POWERPC_PERF_STOP_COUNT(PREFIX_h264_chroma_mc8_num, 1);
-}
-
-/* this code assume stride % 16 == 0 */
-static void PREFIX_h264_qpel16_h_lowpass_altivec(uint8_t * dst, uint8_t * src, int dstStride, int srcStride) {
- POWERPC_PERF_DECLARE(PREFIX_h264_qpel16_h_lowpass_num, 1);
- register int i;
-
- const vector signed int vzero = vec_splat_s32(0);
- const vector unsigned char permM2 = vec_lvsl(-2, src);
- const vector unsigned char permM1 = vec_lvsl(-1, src);
- const vector unsigned char permP0 = vec_lvsl(+0, src);
- const vector unsigned char permP1 = vec_lvsl(+1, src);
- const vector unsigned char permP2 = vec_lvsl(+2, src);
- const vector unsigned char permP3 = vec_lvsl(+3, src);
- const vector signed short v5ss = vec_splat_s16(5);
- const vector unsigned short v5us = vec_splat_u16(5);
- const vector signed short v20ss = vec_sl(vec_splat_s16(5),vec_splat_u16(2));
- const vector signed short v16ss = vec_sl(vec_splat_s16(1),vec_splat_u16(4));
- const vector unsigned char dstperm = vec_lvsr(0, dst);
- const vector unsigned char neg1 =
- (const vector unsigned char) vec_splat_s8(-1);
-
- const vector unsigned char dstmask =
- vec_perm((const vector unsigned char)vzero,
- neg1, dstperm);
-
- vector unsigned char srcM2, srcM1, srcP0, srcP1, srcP2, srcP3;
-
- register int align = ((((unsigned long)src) - 2) % 16);
-
- vector signed short srcP0A, srcP0B, srcP1A, srcP1B,
- srcP2A, srcP2B, srcP3A, srcP3B,
- srcM1A, srcM1B, srcM2A, srcM2B,
- sum1A, sum1B, sum2A, sum2B, sum3A, sum3B,
- pp1A, pp1B, pp2A, pp2B, pp3A, pp3B,
- psumA, psumB, sumA, sumB;
-
- vector unsigned char sum, dst1, dst2, vdst, fsum,
- rsum, fdst1, fdst2;
-
- POWERPC_PERF_START_COUNT(PREFIX_h264_qpel16_h_lowpass_num, 1);
-
- for (i = 0 ; i < 16 ; i ++) {
- vector unsigned char srcR1 = vec_ld(-2, src);
- vector unsigned char srcR2 = vec_ld(14, src);
-
- switch (align) {
- default: {
- srcM2 = vec_perm(srcR1, srcR2, permM2);
- srcM1 = vec_perm(srcR1, srcR2, permM1);
- srcP0 = vec_perm(srcR1, srcR2, permP0);
- srcP1 = vec_perm(srcR1, srcR2, permP1);
- srcP2 = vec_perm(srcR1, srcR2, permP2);
- srcP3 = vec_perm(srcR1, srcR2, permP3);
- } break;
- case 11: {
- srcM2 = vec_perm(srcR1, srcR2, permM2);
- srcM1 = vec_perm(srcR1, srcR2, permM1);
- srcP0 = vec_perm(srcR1, srcR2, permP0);
- srcP1 = vec_perm(srcR1, srcR2, permP1);
- srcP2 = vec_perm(srcR1, srcR2, permP2);
- srcP3 = srcR2;
- } break;
- case 12: {
- vector unsigned char srcR3 = vec_ld(30, src);
- srcM2 = vec_perm(srcR1, srcR2, permM2);
- srcM1 = vec_perm(srcR1, srcR2, permM1);
- srcP0 = vec_perm(srcR1, srcR2, permP0);
- srcP1 = vec_perm(srcR1, srcR2, permP1);
- srcP2 = srcR2;
- srcP3 = vec_perm(srcR2, srcR3, permP3);
- } break;
- case 13: {
- vector unsigned char srcR3 = vec_ld(30, src);
- srcM2 = vec_perm(srcR1, srcR2, permM2);
- srcM1 = vec_perm(srcR1, srcR2, permM1);
- srcP0 = vec_perm(srcR1, srcR2, permP0);
- srcP1 = srcR2;
- srcP2 = vec_perm(srcR2, srcR3, permP2);
- srcP3 = vec_perm(srcR2, srcR3, permP3);
- } break;
- case 14: {
- vector unsigned char srcR3 = vec_ld(30, src);
- srcM2 = vec_perm(srcR1, srcR2, permM2);
- srcM1 = vec_perm(srcR1, srcR2, permM1);
- srcP0 = srcR2;
- srcP1 = vec_perm(srcR2, srcR3, permP1);
- srcP2 = vec_perm(srcR2, srcR3, permP2);
- srcP3 = vec_perm(srcR2, srcR3, permP3);
- } break;
- case 15: {
- vector unsigned char srcR3 = vec_ld(30, src);
- srcM2 = vec_perm(srcR1, srcR2, permM2);
- srcM1 = srcR2;
- srcP0 = vec_perm(srcR2, srcR3, permP0);
- srcP1 = vec_perm(srcR2, srcR3, permP1);
- srcP2 = vec_perm(srcR2, srcR3, permP2);
- srcP3 = vec_perm(srcR2, srcR3, permP3);
- } break;
- }
-
- srcP0A = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcP0);
- srcP0B = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcP0);
- srcP1A = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcP1);
- srcP1B = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcP1);
-
- srcP2A = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcP2);
- srcP2B = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcP2);
- srcP3A = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcP3);
- srcP3B = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcP3);
-
- srcM1A = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcM1);
- srcM1B = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcM1);
- srcM2A = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcM2);
- srcM2B = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcM2);
-
- sum1A = vec_adds(srcP0A, srcP1A);
- sum1B = vec_adds(srcP0B, srcP1B);
- sum2A = vec_adds(srcM1A, srcP2A);
- sum2B = vec_adds(srcM1B, srcP2B);
- sum3A = vec_adds(srcM2A, srcP3A);
- sum3B = vec_adds(srcM2B, srcP3B);
-
- pp1A = vec_mladd(sum1A, v20ss, v16ss);
- pp1B = vec_mladd(sum1B, v20ss, v16ss);
-
- pp2A = vec_mladd(sum2A, v5ss, (vector signed short)vzero);
- pp2B = vec_mladd(sum2B, v5ss, (vector signed short)vzero);
-
- pp3A = vec_add(sum3A, pp1A);
- pp3B = vec_add(sum3B, pp1B);
-
- psumA = vec_sub(pp3A, pp2A);
- psumB = vec_sub(pp3B, pp2B);
-
- sumA = vec_sra(psumA, v5us);
- sumB = vec_sra(psumB, v5us);
-
- sum = vec_packsu(sumA, sumB);
-
- dst1 = vec_ld(0, dst);
- dst2 = vec_ld(16, dst);
- vdst = vec_perm(dst1, dst2, vec_lvsl(0, dst));
-
- OP_U8_ALTIVEC(fsum, sum, vdst);
-
- rsum = vec_perm(fsum, fsum, dstperm);
- fdst1 = vec_sel(dst1, rsum, dstmask);
- fdst2 = vec_sel(rsum, dst2, dstmask);
-
- vec_st(fdst1, 0, dst);
- vec_st(fdst2, 16, dst);
-
- src += srcStride;
- dst += dstStride;
- }
-POWERPC_PERF_STOP_COUNT(PREFIX_h264_qpel16_h_lowpass_num, 1);
-}
-
-/* this code assume stride % 16 == 0 */
-static void PREFIX_h264_qpel16_v_lowpass_altivec(uint8_t * dst, uint8_t * src, int dstStride, int srcStride) {
- POWERPC_PERF_DECLARE(PREFIX_h264_qpel16_v_lowpass_num, 1);
-
- register int i;
-
- const vector signed int vzero = vec_splat_s32(0);
- const vector unsigned char perm = vec_lvsl(0, src);
- const vector signed short v20ss = vec_sl(vec_splat_s16(5),vec_splat_u16(2));
- const vector unsigned short v5us = vec_splat_u16(5);
- const vector signed short v5ss = vec_splat_s16(5);
- const vector signed short v16ss = vec_sl(vec_splat_s16(1),vec_splat_u16(4));
- const vector unsigned char dstperm = vec_lvsr(0, dst);
- const vector unsigned char neg1 = (const vector unsigned char)vec_splat_s8(-1);
- const vector unsigned char dstmask = vec_perm((const vector unsigned char)vzero, neg1, dstperm);
-
- uint8_t *srcbis = src - (srcStride * 2);
-
- const vector unsigned char srcM2a = vec_ld(0, srcbis);
- const vector unsigned char srcM2b = vec_ld(16, srcbis);
- const vector unsigned char srcM2 = vec_perm(srcM2a, srcM2b, perm);
-// srcbis += srcStride;
- const vector unsigned char srcM1a = vec_ld(0, srcbis += srcStride);
- const vector unsigned char srcM1b = vec_ld(16, srcbis);
- const vector unsigned char srcM1 = vec_perm(srcM1a, srcM1b, perm);
-// srcbis += srcStride;
- const vector unsigned char srcP0a = vec_ld(0, srcbis += srcStride);
- const vector unsigned char srcP0b = vec_ld(16, srcbis);
- const vector unsigned char srcP0 = vec_perm(srcP0a, srcP0b, perm);
-// srcbis += srcStride;
- const vector unsigned char srcP1a = vec_ld(0, srcbis += srcStride);
- const vector unsigned char srcP1b = vec_ld(16, srcbis);
- const vector unsigned char srcP1 = vec_perm(srcP1a, srcP1b, perm);
-// srcbis += srcStride;
- const vector unsigned char srcP2a = vec_ld(0, srcbis += srcStride);
- const vector unsigned char srcP2b = vec_ld(16, srcbis);
- const vector unsigned char srcP2 = vec_perm(srcP2a, srcP2b, perm);
-// srcbis += srcStride;
-
- vector signed short srcM2ssA = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcM2);
- vector signed short srcM2ssB = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcM2);
- vector signed short srcM1ssA = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcM1);
- vector signed short srcM1ssB = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcM1);
- vector signed short srcP0ssA = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcP0);
- vector signed short srcP0ssB = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcP0);
- vector signed short srcP1ssA = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcP1);
- vector signed short srcP1ssB = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcP1);
- vector signed short srcP2ssA = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcP2);
- vector signed short srcP2ssB = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcP2);
-
- vector signed short pp1A, pp1B, pp2A, pp2B, pp3A, pp3B,
- psumA, psumB, sumA, sumB,
- srcP3ssA, srcP3ssB,
- sum1A, sum1B, sum2A, sum2B, sum3A, sum3B;
-
- vector unsigned char sum, dst1, dst2, vdst, fsum, rsum, fdst1, fdst2,
- srcP3a, srcP3b, srcP3;
-
- POWERPC_PERF_START_COUNT(PREFIX_h264_qpel16_v_lowpass_num, 1);
-
- for (i = 0 ; i < 16 ; i++) {
- srcP3a = vec_ld(0, srcbis += srcStride);
- srcP3b = vec_ld(16, srcbis);
- srcP3 = vec_perm(srcP3a, srcP3b, perm);
- srcP3ssA = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcP3);
- srcP3ssB = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcP3);
-// srcbis += srcStride;
-
- sum1A = vec_adds(srcP0ssA, srcP1ssA);
- sum1B = vec_adds(srcP0ssB, srcP1ssB);
- sum2A = vec_adds(srcM1ssA, srcP2ssA);
- sum2B = vec_adds(srcM1ssB, srcP2ssB);
- sum3A = vec_adds(srcM2ssA, srcP3ssA);
- sum3B = vec_adds(srcM2ssB, srcP3ssB);
-
- srcM2ssA = srcM1ssA;
- srcM2ssB = srcM1ssB;
- srcM1ssA = srcP0ssA;
- srcM1ssB = srcP0ssB;
- srcP0ssA = srcP1ssA;
- srcP0ssB = srcP1ssB;
- srcP1ssA = srcP2ssA;
- srcP1ssB = srcP2ssB;
- srcP2ssA = srcP3ssA;
- srcP2ssB = srcP3ssB;
-
- pp1A = vec_mladd(sum1A, v20ss, v16ss);
- pp1B = vec_mladd(sum1B, v20ss, v16ss);
-
- pp2A = vec_mladd(sum2A, v5ss, (vector signed short)vzero);
- pp2B = vec_mladd(sum2B, v5ss, (vector signed short)vzero);
-
- pp3A = vec_add(sum3A, pp1A);
- pp3B = vec_add(sum3B, pp1B);
-
- psumA = vec_sub(pp3A, pp2A);
- psumB = vec_sub(pp3B, pp2B);
-
- sumA = vec_sra(psumA, v5us);
- sumB = vec_sra(psumB, v5us);
-
- sum = vec_packsu(sumA, sumB);
-
- dst1 = vec_ld(0, dst);
- dst2 = vec_ld(16, dst);
- vdst = vec_perm(dst1, dst2, vec_lvsl(0, dst));
-
- OP_U8_ALTIVEC(fsum, sum, vdst);
-
- rsum = vec_perm(fsum, fsum, dstperm);
- fdst1 = vec_sel(dst1, rsum, dstmask);
- fdst2 = vec_sel(rsum, dst2, dstmask);
-
- vec_st(fdst1, 0, dst);
- vec_st(fdst2, 16, dst);
-
- dst += dstStride;
- }
- POWERPC_PERF_STOP_COUNT(PREFIX_h264_qpel16_v_lowpass_num, 1);
-}
-
-/* this code assume stride % 16 == 0 *and* tmp is properly aligned */
-static void PREFIX_h264_qpel16_hv_lowpass_altivec(uint8_t * dst, int16_t * tmp, uint8_t * src, int dstStride, int tmpStride, int srcStride) {
- POWERPC_PERF_DECLARE(PREFIX_h264_qpel16_hv_lowpass_num, 1);
- register int i;
- const vector signed int vzero = vec_splat_s32(0);
- const vector unsigned char permM2 = vec_lvsl(-2, src);
- const vector unsigned char permM1 = vec_lvsl(-1, src);
- const vector unsigned char permP0 = vec_lvsl(+0, src);
- const vector unsigned char permP1 = vec_lvsl(+1, src);
- const vector unsigned char permP2 = vec_lvsl(+2, src);
- const vector unsigned char permP3 = vec_lvsl(+3, src);
- const vector signed short v20ss = vec_sl(vec_splat_s16(5),vec_splat_u16(2));
- const vector unsigned int v10ui = vec_splat_u32(10);
- const vector signed short v5ss = vec_splat_s16(5);
- const vector signed short v1ss = vec_splat_s16(1);
- const vector signed int v512si = vec_sl(vec_splat_s32(1),vec_splat_u32(9));
- const vector unsigned int v16ui = vec_sl(vec_splat_u32(1),vec_splat_u32(4));
-
- register int align = ((((unsigned long)src) - 2) % 16);
-
- const vector unsigned char neg1 = (const vector unsigned char)
- vec_splat_s8(-1);
-
- vector signed short srcP0A, srcP0B, srcP1A, srcP1B,
- srcP2A, srcP2B, srcP3A, srcP3B,
- srcM1A, srcM1B, srcM2A, srcM2B,
- sum1A, sum1B, sum2A, sum2B, sum3A, sum3B,
- pp1A, pp1B, pp2A, pp2B, psumA, psumB;
-
- const vector unsigned char dstperm = vec_lvsr(0, dst);
-
- const vector unsigned char dstmask = vec_perm((const vector unsigned char)vzero, neg1, dstperm);
-
- const vector unsigned char mperm = (const vector unsigned char)
- AVV(0x00, 0x08, 0x01, 0x09, 0x02, 0x0A, 0x03, 0x0B,
- 0x04, 0x0C, 0x05, 0x0D, 0x06, 0x0E, 0x07, 0x0F);
- int16_t *tmpbis = tmp;
-
- vector signed short tmpM1ssA, tmpM1ssB, tmpM2ssA, tmpM2ssB,
- tmpP0ssA, tmpP0ssB, tmpP1ssA, tmpP1ssB,
- tmpP2ssA, tmpP2ssB;
-
- vector signed int pp1Ae, pp1Ao, pp1Be, pp1Bo, pp2Ae, pp2Ao, pp2Be, pp2Bo,
- pp3Ae, pp3Ao, pp3Be, pp3Bo, pp1cAe, pp1cAo, pp1cBe, pp1cBo,
- pp32Ae, pp32Ao, pp32Be, pp32Bo, sumAe, sumAo, sumBe, sumBo,
- ssumAe, ssumAo, ssumBe, ssumBo;
- vector unsigned char fsum, sumv, sum, dst1, dst2, vdst,
- rsum, fdst1, fdst2;
- vector signed short ssume, ssumo;
-
- POWERPC_PERF_START_COUNT(PREFIX_h264_qpel16_hv_lowpass_num, 1);
- src -= (2 * srcStride);
- for (i = 0 ; i < 21 ; i ++) {
- vector unsigned char srcM2, srcM1, srcP0, srcP1, srcP2, srcP3;
- vector unsigned char srcR1 = vec_ld(-2, src);
- vector unsigned char srcR2 = vec_ld(14, src);
-
- switch (align) {
- default: {
- srcM2 = vec_perm(srcR1, srcR2, permM2);
- srcM1 = vec_perm(srcR1, srcR2, permM1);
- srcP0 = vec_perm(srcR1, srcR2, permP0);
- srcP1 = vec_perm(srcR1, srcR2, permP1);
- srcP2 = vec_perm(srcR1, srcR2, permP2);
- srcP3 = vec_perm(srcR1, srcR2, permP3);
- } break;
- case 11: {
- srcM2 = vec_perm(srcR1, srcR2, permM2);
- srcM1 = vec_perm(srcR1, srcR2, permM1);
- srcP0 = vec_perm(srcR1, srcR2, permP0);
- srcP1 = vec_perm(srcR1, srcR2, permP1);
- srcP2 = vec_perm(srcR1, srcR2, permP2);
- srcP3 = srcR2;
- } break;
- case 12: {
- vector unsigned char srcR3 = vec_ld(30, src);
- srcM2 = vec_perm(srcR1, srcR2, permM2);
- srcM1 = vec_perm(srcR1, srcR2, permM1);
- srcP0 = vec_perm(srcR1, srcR2, permP0);
- srcP1 = vec_perm(srcR1, srcR2, permP1);
- srcP2 = srcR2;
- srcP3 = vec_perm(srcR2, srcR3, permP3);
- } break;
- case 13: {
- vector unsigned char srcR3 = vec_ld(30, src);
- srcM2 = vec_perm(srcR1, srcR2, permM2);
- srcM1 = vec_perm(srcR1, srcR2, permM1);
- srcP0 = vec_perm(srcR1, srcR2, permP0);
- srcP1 = srcR2;
- srcP2 = vec_perm(srcR2, srcR3, permP2);
- srcP3 = vec_perm(srcR2, srcR3, permP3);
- } break;
- case 14: {
- vector unsigned char srcR3 = vec_ld(30, src);
- srcM2 = vec_perm(srcR1, srcR2, permM2);
- srcM1 = vec_perm(srcR1, srcR2, permM1);
- srcP0 = srcR2;
- srcP1 = vec_perm(srcR2, srcR3, permP1);
- srcP2 = vec_perm(srcR2, srcR3, permP2);
- srcP3 = vec_perm(srcR2, srcR3, permP3);
- } break;
- case 15: {
- vector unsigned char srcR3 = vec_ld(30, src);
- srcM2 = vec_perm(srcR1, srcR2, permM2);
- srcM1 = srcR2;
- srcP0 = vec_perm(srcR2, srcR3, permP0);
- srcP1 = vec_perm(srcR2, srcR3, permP1);
- srcP2 = vec_perm(srcR2, srcR3, permP2);
- srcP3 = vec_perm(srcR2, srcR3, permP3);
- } break;
- }
-
- srcP0A = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcP0);
- srcP0B = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcP0);
- srcP1A = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcP1);
- srcP1B = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcP1);
-
- srcP2A = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcP2);
- srcP2B = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcP2);
- srcP3A = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcP3);
- srcP3B = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcP3);
-
- srcM1A = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcM1);
- srcM1B = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcM1);
- srcM2A = (vector signed short)
- vec_mergeh((vector unsigned char)vzero, srcM2);
- srcM2B = (vector signed short)
- vec_mergel((vector unsigned char)vzero, srcM2);
-
- sum1A = vec_adds(srcP0A, srcP1A);
- sum1B = vec_adds(srcP0B, srcP1B);
- sum2A = vec_adds(srcM1A, srcP2A);
- sum2B = vec_adds(srcM1B, srcP2B);
- sum3A = vec_adds(srcM2A, srcP3A);
- sum3B = vec_adds(srcM2B, srcP3B);
-
- pp1A = vec_mladd(sum1A, v20ss, sum3A);
- pp1B = vec_mladd(sum1B, v20ss, sum3B);
-
- pp2A = vec_mladd(sum2A, v5ss, (vector signed short)vzero);
- pp2B = vec_mladd(sum2B, v5ss, (vector signed short)vzero);
-
- psumA = vec_sub(pp1A, pp2A);
- psumB = vec_sub(pp1B, pp2B);
-
- vec_st(psumA, 0, tmp);
- vec_st(psumB, 16, tmp);
-
- src += srcStride;
- tmp += tmpStride; /* int16_t*, and stride is 16, so it's OK here */
- }
-
- tmpM2ssA = vec_ld(0, tmpbis);
- tmpM2ssB = vec_ld(16, tmpbis);
- tmpbis += tmpStride;
- tmpM1ssA = vec_ld(0, tmpbis);
- tmpM1ssB = vec_ld(16, tmpbis);
- tmpbis += tmpStride;
- tmpP0ssA = vec_ld(0, tmpbis);
- tmpP0ssB = vec_ld(16, tmpbis);
- tmpbis += tmpStride;
- tmpP1ssA = vec_ld(0, tmpbis);
- tmpP1ssB = vec_ld(16, tmpbis);
- tmpbis += tmpStride;
- tmpP2ssA = vec_ld(0, tmpbis);
- tmpP2ssB = vec_ld(16, tmpbis);
- tmpbis += tmpStride;
-
- for (i = 0 ; i < 16 ; i++) {
- const vector signed short tmpP3ssA = vec_ld(0, tmpbis);
- const vector signed short tmpP3ssB = vec_ld(16, tmpbis);
-
- const vector signed short sum1A = vec_adds(tmpP0ssA, tmpP1ssA);
- const vector signed short sum1B = vec_adds(tmpP0ssB, tmpP1ssB);
- const vector signed short sum2A = vec_adds(tmpM1ssA, tmpP2ssA);
- const vector signed short sum2B = vec_adds(tmpM1ssB, tmpP2ssB);
- const vector signed short sum3A = vec_adds(tmpM2ssA, tmpP3ssA);
- const vector signed short sum3B = vec_adds(tmpM2ssB, tmpP3ssB);
-
- tmpbis += tmpStride;
-
- tmpM2ssA = tmpM1ssA;
- tmpM2ssB = tmpM1ssB;
- tmpM1ssA = tmpP0ssA;
- tmpM1ssB = tmpP0ssB;
- tmpP0ssA = tmpP1ssA;
- tmpP0ssB = tmpP1ssB;
- tmpP1ssA = tmpP2ssA;
- tmpP1ssB = tmpP2ssB;
- tmpP2ssA = tmpP3ssA;
- tmpP2ssB = tmpP3ssB;
-
- pp1Ae = vec_mule(sum1A, v20ss);
- pp1Ao = vec_mulo(sum1A, v20ss);
- pp1Be = vec_mule(sum1B, v20ss);
- pp1Bo = vec_mulo(sum1B, v20ss);
-
- pp2Ae = vec_mule(sum2A, v5ss);
- pp2Ao = vec_mulo(sum2A, v5ss);
- pp2Be = vec_mule(sum2B, v5ss);
- pp2Bo = vec_mulo(sum2B, v5ss);
-
- pp3Ae = vec_sra((vector signed int)sum3A, v16ui);
- pp3Ao = vec_mulo(sum3A, v1ss);
- pp3Be = vec_sra((vector signed int)sum3B, v16ui);
- pp3Bo = vec_mulo(sum3B, v1ss);
-
- pp1cAe = vec_add(pp1Ae, v512si);
- pp1cAo = vec_add(pp1Ao, v512si);
- pp1cBe = vec_add(pp1Be, v512si);
- pp1cBo = vec_add(pp1Bo, v512si);
-
- pp32Ae = vec_sub(pp3Ae, pp2Ae);
- pp32Ao = vec_sub(pp3Ao, pp2Ao);
- pp32Be = vec_sub(pp3Be, pp2Be);
- pp32Bo = vec_sub(pp3Bo, pp2Bo);
-
- sumAe = vec_add(pp1cAe, pp32Ae);
- sumAo = vec_add(pp1cAo, pp32Ao);
- sumBe = vec_add(pp1cBe, pp32Be);
- sumBo = vec_add(pp1cBo, pp32Bo);
-
- ssumAe = vec_sra(sumAe, v10ui);
- ssumAo = vec_sra(sumAo, v10ui);
- ssumBe = vec_sra(sumBe, v10ui);
- ssumBo = vec_sra(sumBo, v10ui);
-
- ssume = vec_packs(ssumAe, ssumBe);
- ssumo = vec_packs(ssumAo, ssumBo);
-
- sumv = vec_packsu(ssume, ssumo);
- sum = vec_perm(sumv, sumv, mperm);
-
- dst1 = vec_ld(0, dst);
- dst2 = vec_ld(16, dst);
- vdst = vec_perm(dst1, dst2, vec_lvsl(0, dst));
-
- OP_U8_ALTIVEC(fsum, sum, vdst);
-
- rsum = vec_perm(fsum, fsum, dstperm);
- fdst1 = vec_sel(dst1, rsum, dstmask);
- fdst2 = vec_sel(rsum, dst2, dstmask);
-
- vec_st(fdst1, 0, dst);
- vec_st(fdst2, 16, dst);
-
- dst += dstStride;
- }
- POWERPC_PERF_STOP_COUNT(PREFIX_h264_qpel16_hv_lowpass_num, 1);
-}
diff --git a/src/libffmpeg/libavcodec/ppc/idct_altivec.c b/src/libffmpeg/libavcodec/ppc/idct_altivec.c
deleted file mode 100644
index cee46fc25..000000000
--- a/src/libffmpeg/libavcodec/ppc/idct_altivec.c
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * Copyright (c) 2001 Michel Lespinasse
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/*
- * NOTE: This code is based on GPL code from the libmpeg2 project. The
- * author, Michel Lespinasses, has given explicit permission to release
- * under LGPL as part of ffmpeg.
- *
- */
-
-/*
- * FFMpeg integration by Dieter Shirley
- *
- * This file is a direct copy of the altivec idct module from the libmpeg2
- * project. I've deleted all of the libmpeg2 specific code, renamed the functions and
- * re-ordered the function parameters. The only change to the IDCT function
- * itself was to factor out the partial transposition, and to perform a full
- * transpose at the end of the function.
- */
-
-
-#include <stdlib.h> /* malloc(), free() */
-#include <string.h>
-#include "../dsputil.h"
-
-#include "gcc_fixes.h"
-
-#include "dsputil_altivec.h"
-
-#define vector_s16_t vector signed short
-#define const_vector_s16_t const_vector signed short
-#define vector_u16_t vector unsigned short
-#define vector_s8_t vector signed char
-#define vector_u8_t vector unsigned char
-#define vector_s32_t vector signed int
-#define vector_u32_t vector unsigned int
-
-#define IDCT_HALF \
- /* 1st stage */ \
- t1 = vec_mradds (a1, vx7, vx1 ); \
- t8 = vec_mradds (a1, vx1, vec_subs (zero, vx7)); \
- t7 = vec_mradds (a2, vx5, vx3); \
- t3 = vec_mradds (ma2, vx3, vx5); \
- \
- /* 2nd stage */ \
- t5 = vec_adds (vx0, vx4); \
- t0 = vec_subs (vx0, vx4); \
- t2 = vec_mradds (a0, vx6, vx2); \
- t4 = vec_mradds (a0, vx2, vec_subs (zero, vx6)); \
- t6 = vec_adds (t8, t3); \
- t3 = vec_subs (t8, t3); \
- t8 = vec_subs (t1, t7); \
- t1 = vec_adds (t1, t7); \
- \
- /* 3rd stage */ \
- t7 = vec_adds (t5, t2); \
- t2 = vec_subs (t5, t2); \
- t5 = vec_adds (t0, t4); \
- t0 = vec_subs (t0, t4); \
- t4 = vec_subs (t8, t3); \
- t3 = vec_adds (t8, t3); \
- \
- /* 4th stage */ \
- vy0 = vec_adds (t7, t1); \
- vy7 = vec_subs (t7, t1); \
- vy1 = vec_mradds (c4, t3, t5); \
- vy6 = vec_mradds (mc4, t3, t5); \
- vy2 = vec_mradds (c4, t4, t0); \
- vy5 = vec_mradds (mc4, t4, t0); \
- vy3 = vec_adds (t2, t6); \
- vy4 = vec_subs (t2, t6);
-
-
-#define IDCT \
- vector_s16_t vx0, vx1, vx2, vx3, vx4, vx5, vx6, vx7; \
- vector_s16_t vy0, vy1, vy2, vy3, vy4, vy5, vy6, vy7; \
- vector_s16_t a0, a1, a2, ma2, c4, mc4, zero, bias; \
- vector_s16_t t0, t1, t2, t3, t4, t5, t6, t7, t8; \
- vector_u16_t shift; \
- \
- c4 = vec_splat (constants[0], 0); \
- a0 = vec_splat (constants[0], 1); \
- a1 = vec_splat (constants[0], 2); \
- a2 = vec_splat (constants[0], 3); \
- mc4 = vec_splat (constants[0], 4); \
- ma2 = vec_splat (constants[0], 5); \
- bias = (vector_s16_t)vec_splat ((vector_s32_t)constants[0], 3); \
- \
- zero = vec_splat_s16 (0); \
- shift = vec_splat_u16 (4); \
- \
- vx0 = vec_mradds (vec_sl (block[0], shift), constants[1], zero); \
- vx1 = vec_mradds (vec_sl (block[1], shift), constants[2], zero); \
- vx2 = vec_mradds (vec_sl (block[2], shift), constants[3], zero); \
- vx3 = vec_mradds (vec_sl (block[3], shift), constants[4], zero); \
- vx4 = vec_mradds (vec_sl (block[4], shift), constants[1], zero); \
- vx5 = vec_mradds (vec_sl (block[5], shift), constants[4], zero); \
- vx6 = vec_mradds (vec_sl (block[6], shift), constants[3], zero); \
- vx7 = vec_mradds (vec_sl (block[7], shift), constants[2], zero); \
- \
- IDCT_HALF \
- \
- vx0 = vec_mergeh (vy0, vy4); \
- vx1 = vec_mergel (vy0, vy4); \
- vx2 = vec_mergeh (vy1, vy5); \
- vx3 = vec_mergel (vy1, vy5); \
- vx4 = vec_mergeh (vy2, vy6); \
- vx5 = vec_mergel (vy2, vy6); \
- vx6 = vec_mergeh (vy3, vy7); \
- vx7 = vec_mergel (vy3, vy7); \
- \
- vy0 = vec_mergeh (vx0, vx4); \
- vy1 = vec_mergel (vx0, vx4); \
- vy2 = vec_mergeh (vx1, vx5); \
- vy3 = vec_mergel (vx1, vx5); \
- vy4 = vec_mergeh (vx2, vx6); \
- vy5 = vec_mergel (vx2, vx6); \
- vy6 = vec_mergeh (vx3, vx7); \
- vy7 = vec_mergel (vx3, vx7); \
- \
- vx0 = vec_adds (vec_mergeh (vy0, vy4), bias); \
- vx1 = vec_mergel (vy0, vy4); \
- vx2 = vec_mergeh (vy1, vy5); \
- vx3 = vec_mergel (vy1, vy5); \
- vx4 = vec_mergeh (vy2, vy6); \
- vx5 = vec_mergel (vy2, vy6); \
- vx6 = vec_mergeh (vy3, vy7); \
- vx7 = vec_mergel (vy3, vy7); \
- \
- IDCT_HALF \
- \
- shift = vec_splat_u16 (6); \
- vx0 = vec_sra (vy0, shift); \
- vx1 = vec_sra (vy1, shift); \
- vx2 = vec_sra (vy2, shift); \
- vx3 = vec_sra (vy3, shift); \
- vx4 = vec_sra (vy4, shift); \
- vx5 = vec_sra (vy5, shift); \
- vx6 = vec_sra (vy6, shift); \
- vx7 = vec_sra (vy7, shift);
-
-
-static const_vector_s16_t constants[5] = {
- (vector_s16_t) AVV(23170, 13573, 6518, 21895, -23170, -21895, 32, 31),
- (vector_s16_t) AVV(16384, 22725, 21407, 19266, 16384, 19266, 21407, 22725),
- (vector_s16_t) AVV(22725, 31521, 29692, 26722, 22725, 26722, 29692, 31521),
- (vector_s16_t) AVV(21407, 29692, 27969, 25172, 21407, 25172, 27969, 29692),
- (vector_s16_t) AVV(19266, 26722, 25172, 22654, 19266, 22654, 25172, 26722)
-};
-
-void idct_put_altivec(uint8_t* dest, int stride, vector_s16_t* block)
-{
-POWERPC_PERF_DECLARE(altivec_idct_put_num, 1);
- vector_u8_t tmp;
-
-#ifdef POWERPC_PERFORMANCE_REPORT
-POWERPC_PERF_START_COUNT(altivec_idct_put_num, 1);
-#endif
- IDCT
-
-#define COPY(dest,src) \
- tmp = vec_packsu (src, src); \
- vec_ste ((vector_u32_t)tmp, 0, (unsigned int *)dest); \
- vec_ste ((vector_u32_t)tmp, 4, (unsigned int *)dest);
-
- COPY (dest, vx0) dest += stride;
- COPY (dest, vx1) dest += stride;
- COPY (dest, vx2) dest += stride;
- COPY (dest, vx3) dest += stride;
- COPY (dest, vx4) dest += stride;
- COPY (dest, vx5) dest += stride;
- COPY (dest, vx6) dest += stride;
- COPY (dest, vx7)
-
-POWERPC_PERF_STOP_COUNT(altivec_idct_put_num, 1);
-}
-
-void idct_add_altivec(uint8_t* dest, int stride, vector_s16_t* block)
-{
-POWERPC_PERF_DECLARE(altivec_idct_add_num, 1);
- vector_u8_t tmp;
- vector_s16_t tmp2, tmp3;
- vector_u8_t perm0;
- vector_u8_t perm1;
- vector_u8_t p0, p1, p;
-
-#ifdef POWERPC_PERFORMANCE_REPORT
-POWERPC_PERF_START_COUNT(altivec_idct_add_num, 1);
-#endif
-
- IDCT
-
- p0 = vec_lvsl (0, dest);
- p1 = vec_lvsl (stride, dest);
- p = vec_splat_u8 (-1);
- perm0 = vec_mergeh (p, p0);
- perm1 = vec_mergeh (p, p1);
-
-#define ADD(dest,src,perm) \
- /* *(uint64_t *)&tmp = *(uint64_t *)dest; */ \
- tmp = vec_ld (0, dest); \
- tmp2 = (vector_s16_t)vec_perm (tmp, (vector_u8_t)zero, perm); \
- tmp3 = vec_adds (tmp2, src); \
- tmp = vec_packsu (tmp3, tmp3); \
- vec_ste ((vector_u32_t)tmp, 0, (unsigned int *)dest); \
- vec_ste ((vector_u32_t)tmp, 4, (unsigned int *)dest);
-
- ADD (dest, vx0, perm0) dest += stride;
- ADD (dest, vx1, perm1) dest += stride;
- ADD (dest, vx2, perm0) dest += stride;
- ADD (dest, vx3, perm1) dest += stride;
- ADD (dest, vx4, perm0) dest += stride;
- ADD (dest, vx5, perm1) dest += stride;
- ADD (dest, vx6, perm0) dest += stride;
- ADD (dest, vx7, perm1)
-
-POWERPC_PERF_STOP_COUNT(altivec_idct_add_num, 1);
-}
-
diff --git a/src/libffmpeg/libavcodec/ppc/libavcodec_ppc_dummy.c b/src/libffmpeg/libavcodec/ppc/libavcodec_ppc_dummy.c
deleted file mode 100644
index 506a55beb..000000000
--- a/src/libffmpeg/libavcodec/ppc/libavcodec_ppc_dummy.c
+++ /dev/null
@@ -1,2 +0,0 @@
-
-char libavcodec_ppc_dummy;
diff --git a/src/libffmpeg/libavcodec/ppc/mathops.h b/src/libffmpeg/libavcodec/ppc/mathops.h
deleted file mode 100644
index 6af23f246..000000000
--- a/src/libffmpeg/libavcodec/ppc/mathops.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * simple math operations
- * Copyright (c) 2001, 2002 Fabrice Bellard.
- * Copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at> et al
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#if defined(ARCH_POWERPC_405)
-/* signed 16x16 -> 32 multiply add accumulate */
-# define MAC16(rt, ra, rb) \
- asm ("maclhw %0, %2, %3" : "=r" (rt) : "0" (rt), "r" (ra), "r" (rb));
-
-/* signed 16x16 -> 32 multiply */
-# define MUL16(ra, rb) \
- ({ int __rt;
- asm ("mullhw %0, %1, %2" : "=r" (__rt) : "r" (ra), "r" (rb));
- __rt; })
-#endif
diff --git a/src/libffmpeg/libavcodec/ppc/mpegvideo_altivec.c b/src/libffmpeg/libavcodec/ppc/mpegvideo_altivec.c
deleted file mode 100644
index 3822cb20e..000000000
--- a/src/libffmpeg/libavcodec/ppc/mpegvideo_altivec.c
+++ /dev/null
@@ -1,603 +0,0 @@
-/*
- * Copyright (c) 2002 Dieter Shirley
- *
- * dct_unquantize_h263_altivec:
- * Copyright (c) 2003 Romain Dolbeau <romain@dolbeau.org>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include "../dsputil.h"
-#include "../mpegvideo.h"
-
-#include "gcc_fixes.h"
-
-#include "dsputil_altivec.h"
-
-// Swaps two variables (used for altivec registers)
-#define SWAP(a,b) \
-do { \
- __typeof__(a) swap_temp=a; \
- a=b; \
- b=swap_temp; \
-} while (0)
-
-// transposes a matrix consisting of four vectors with four elements each
-#define TRANSPOSE4(a,b,c,d) \
-do { \
- __typeof__(a) _trans_ach = vec_mergeh(a, c); \
- __typeof__(a) _trans_acl = vec_mergel(a, c); \
- __typeof__(a) _trans_bdh = vec_mergeh(b, d); \
- __typeof__(a) _trans_bdl = vec_mergel(b, d); \
- \
- a = vec_mergeh(_trans_ach, _trans_bdh); \
- b = vec_mergel(_trans_ach, _trans_bdh); \
- c = vec_mergeh(_trans_acl, _trans_bdl); \
- d = vec_mergel(_trans_acl, _trans_bdl); \
-} while (0)
-
-
-// Loads a four-byte value (int or float) from the target address
-// into every element in the target vector. Only works if the
-// target address is four-byte aligned (which should be always).
-#define LOAD4(vec, address) \
-{ \
- __typeof__(vec)* _load_addr = (__typeof__(vec)*)(address); \
- vector unsigned char _perm_vec = vec_lvsl(0,(address)); \
- vec = vec_ld(0, _load_addr); \
- vec = vec_perm(vec, vec, _perm_vec); \
- vec = vec_splat(vec, 0); \
-}
-
-
-#ifdef CONFIG_DARWIN
-#define FOUROF(a) (a)
-#else
-// slower, for dumb non-apple GCC
-#define FOUROF(a) {a,a,a,a}
-#endif
-int dct_quantize_altivec(MpegEncContext* s,
- DCTELEM* data, int n,
- int qscale, int* overflow)
-{
- int lastNonZero;
- vector float row0, row1, row2, row3, row4, row5, row6, row7;
- vector float alt0, alt1, alt2, alt3, alt4, alt5, alt6, alt7;
- const_vector float zero = (const_vector float)FOUROF(0.);
- // used after quantise step
- int oldBaseValue = 0;
-
- // Load the data into the row/alt vectors
- {
- vector signed short data0, data1, data2, data3, data4, data5, data6, data7;
-
- data0 = vec_ld(0, data);
- data1 = vec_ld(16, data);
- data2 = vec_ld(32, data);
- data3 = vec_ld(48, data);
- data4 = vec_ld(64, data);
- data5 = vec_ld(80, data);
- data6 = vec_ld(96, data);
- data7 = vec_ld(112, data);
-
- // Transpose the data before we start
- TRANSPOSE8(data0, data1, data2, data3, data4, data5, data6, data7);
-
- // load the data into floating point vectors. We load
- // the high half of each row into the main row vectors
- // and the low half into the alt vectors.
- row0 = vec_ctf(vec_unpackh(data0), 0);
- alt0 = vec_ctf(vec_unpackl(data0), 0);
- row1 = vec_ctf(vec_unpackh(data1), 0);
- alt1 = vec_ctf(vec_unpackl(data1), 0);
- row2 = vec_ctf(vec_unpackh(data2), 0);
- alt2 = vec_ctf(vec_unpackl(data2), 0);
- row3 = vec_ctf(vec_unpackh(data3), 0);
- alt3 = vec_ctf(vec_unpackl(data3), 0);
- row4 = vec_ctf(vec_unpackh(data4), 0);
- alt4 = vec_ctf(vec_unpackl(data4), 0);
- row5 = vec_ctf(vec_unpackh(data5), 0);
- alt5 = vec_ctf(vec_unpackl(data5), 0);
- row6 = vec_ctf(vec_unpackh(data6), 0);
- alt6 = vec_ctf(vec_unpackl(data6), 0);
- row7 = vec_ctf(vec_unpackh(data7), 0);
- alt7 = vec_ctf(vec_unpackl(data7), 0);
- }
-
- // The following block could exist as a separate an altivec dct
- // function. However, if we put it inline, the DCT data can remain
- // in the vector local variables, as floats, which we'll use during the
- // quantize step...
- {
- const vector float vec_0_298631336 = (vector float)FOUROF(0.298631336f);
- const vector float vec_0_390180644 = (vector float)FOUROF(-0.390180644f);
- const vector float vec_0_541196100 = (vector float)FOUROF(0.541196100f);
- const vector float vec_0_765366865 = (vector float)FOUROF(0.765366865f);
- const vector float vec_0_899976223 = (vector float)FOUROF(-0.899976223f);
- const vector float vec_1_175875602 = (vector float)FOUROF(1.175875602f);
- const vector float vec_1_501321110 = (vector float)FOUROF(1.501321110f);
- const vector float vec_1_847759065 = (vector float)FOUROF(-1.847759065f);
- const vector float vec_1_961570560 = (vector float)FOUROF(-1.961570560f);
- const vector float vec_2_053119869 = (vector float)FOUROF(2.053119869f);
- const vector float vec_2_562915447 = (vector float)FOUROF(-2.562915447f);
- const vector float vec_3_072711026 = (vector float)FOUROF(3.072711026f);
-
-
- int whichPass, whichHalf;
-
- for(whichPass = 1; whichPass<=2; whichPass++)
- {
- for(whichHalf = 1; whichHalf<=2; whichHalf++)
- {
- vector float tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
- vector float tmp10, tmp11, tmp12, tmp13;
- vector float z1, z2, z3, z4, z5;
-
- tmp0 = vec_add(row0, row7); // tmp0 = dataptr[0] + dataptr[7];
- tmp7 = vec_sub(row0, row7); // tmp7 = dataptr[0] - dataptr[7];
- tmp3 = vec_add(row3, row4); // tmp3 = dataptr[3] + dataptr[4];
- tmp4 = vec_sub(row3, row4); // tmp4 = dataptr[3] - dataptr[4];
- tmp1 = vec_add(row1, row6); // tmp1 = dataptr[1] + dataptr[6];
- tmp6 = vec_sub(row1, row6); // tmp6 = dataptr[1] - dataptr[6];
- tmp2 = vec_add(row2, row5); // tmp2 = dataptr[2] + dataptr[5];
- tmp5 = vec_sub(row2, row5); // tmp5 = dataptr[2] - dataptr[5];
-
- tmp10 = vec_add(tmp0, tmp3); // tmp10 = tmp0 + tmp3;
- tmp13 = vec_sub(tmp0, tmp3); // tmp13 = tmp0 - tmp3;
- tmp11 = vec_add(tmp1, tmp2); // tmp11 = tmp1 + tmp2;
- tmp12 = vec_sub(tmp1, tmp2); // tmp12 = tmp1 - tmp2;
-
-
- // dataptr[0] = (DCTELEM) ((tmp10 + tmp11) << PASS1_BITS);
- row0 = vec_add(tmp10, tmp11);
-
- // dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS);
- row4 = vec_sub(tmp10, tmp11);
-
-
- // z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);
- z1 = vec_madd(vec_add(tmp12, tmp13), vec_0_541196100, (vector float)zero);
-
- // dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865),
- // CONST_BITS-PASS1_BITS);
- row2 = vec_madd(tmp13, vec_0_765366865, z1);
-
- // dataptr[6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065),
- // CONST_BITS-PASS1_BITS);
- row6 = vec_madd(tmp12, vec_1_847759065, z1);
-
- z1 = vec_add(tmp4, tmp7); // z1 = tmp4 + tmp7;
- z2 = vec_add(tmp5, tmp6); // z2 = tmp5 + tmp6;
- z3 = vec_add(tmp4, tmp6); // z3 = tmp4 + tmp6;
- z4 = vec_add(tmp5, tmp7); // z4 = tmp5 + tmp7;
-
- // z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */
- z5 = vec_madd(vec_add(z3, z4), vec_1_175875602, (vector float)zero);
-
- // z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
- z3 = vec_madd(z3, vec_1_961570560, z5);
-
- // z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */
- z4 = vec_madd(z4, vec_0_390180644, z5);
-
- // The following adds are rolled into the multiplies above
- // z3 = vec_add(z3, z5); // z3 += z5;
- // z4 = vec_add(z4, z5); // z4 += z5;
-
- // z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
- // Wow! It's actually more effecient to roll this multiply
- // into the adds below, even thought the multiply gets done twice!
- // z2 = vec_madd(z2, vec_2_562915447, (vector float)zero);
-
- // z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */
- // Same with this one...
- // z1 = vec_madd(z1, vec_0_899976223, (vector float)zero);
-
- // tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */
- // dataptr[7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS);
- row7 = vec_madd(tmp4, vec_0_298631336, vec_madd(z1, vec_0_899976223, z3));
-
- // tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
- // dataptr[5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS);
- row5 = vec_madd(tmp5, vec_2_053119869, vec_madd(z2, vec_2_562915447, z4));
-
- // tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
- // dataptr[3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS);
- row3 = vec_madd(tmp6, vec_3_072711026, vec_madd(z2, vec_2_562915447, z3));
-
- // tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */
- // dataptr[1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS);
- row1 = vec_madd(z1, vec_0_899976223, vec_madd(tmp7, vec_1_501321110, z4));
-
- // Swap the row values with the alts. If this is the first half,
- // this sets up the low values to be acted on in the second half.
- // If this is the second half, it puts the high values back in
- // the row values where they are expected to be when we're done.
- SWAP(row0, alt0);
- SWAP(row1, alt1);
- SWAP(row2, alt2);
- SWAP(row3, alt3);
- SWAP(row4, alt4);
- SWAP(row5, alt5);
- SWAP(row6, alt6);
- SWAP(row7, alt7);
- }
-
- if (whichPass == 1)
- {
- // transpose the data for the second pass
-
- // First, block transpose the upper right with lower left.
- SWAP(row4, alt0);
- SWAP(row5, alt1);
- SWAP(row6, alt2);
- SWAP(row7, alt3);
-
- // Now, transpose each block of four
- TRANSPOSE4(row0, row1, row2, row3);
- TRANSPOSE4(row4, row5, row6, row7);
- TRANSPOSE4(alt0, alt1, alt2, alt3);
- TRANSPOSE4(alt4, alt5, alt6, alt7);
- }
- }
- }
-
- // perform the quantise step, using the floating point data
- // still in the row/alt registers
- {
- const int* biasAddr;
- const vector signed int* qmat;
- vector float bias, negBias;
-
- if (s->mb_intra)
- {
- vector signed int baseVector;
-
- // We must cache element 0 in the intra case
- // (it needs special handling).
- baseVector = vec_cts(vec_splat(row0, 0), 0);
- vec_ste(baseVector, 0, &oldBaseValue);
-
- qmat = (vector signed int*)s->q_intra_matrix[qscale];
- biasAddr = &(s->intra_quant_bias);
- }
- else
- {
- qmat = (vector signed int*)s->q_inter_matrix[qscale];
- biasAddr = &(s->inter_quant_bias);
- }
-
- // Load the bias vector (We add 0.5 to the bias so that we're
- // rounding when we convert to int, instead of flooring.)
- {
- vector signed int biasInt;
- const vector float negOneFloat = (vector float)FOUROF(-1.0f);
- LOAD4(biasInt, biasAddr);
- bias = vec_ctf(biasInt, QUANT_BIAS_SHIFT);
- negBias = vec_madd(bias, negOneFloat, zero);
- }
-
- {
- vector float q0, q1, q2, q3, q4, q5, q6, q7;
-
- q0 = vec_ctf(qmat[0], QMAT_SHIFT);
- q1 = vec_ctf(qmat[2], QMAT_SHIFT);
- q2 = vec_ctf(qmat[4], QMAT_SHIFT);
- q3 = vec_ctf(qmat[6], QMAT_SHIFT);
- q4 = vec_ctf(qmat[8], QMAT_SHIFT);
- q5 = vec_ctf(qmat[10], QMAT_SHIFT);
- q6 = vec_ctf(qmat[12], QMAT_SHIFT);
- q7 = vec_ctf(qmat[14], QMAT_SHIFT);
-
- row0 = vec_sel(vec_madd(row0, q0, negBias), vec_madd(row0, q0, bias),
- vec_cmpgt(row0, zero));
- row1 = vec_sel(vec_madd(row1, q1, negBias), vec_madd(row1, q1, bias),
- vec_cmpgt(row1, zero));
- row2 = vec_sel(vec_madd(row2, q2, negBias), vec_madd(row2, q2, bias),
- vec_cmpgt(row2, zero));
- row3 = vec_sel(vec_madd(row3, q3, negBias), vec_madd(row3, q3, bias),
- vec_cmpgt(row3, zero));
- row4 = vec_sel(vec_madd(row4, q4, negBias), vec_madd(row4, q4, bias),
- vec_cmpgt(row4, zero));
- row5 = vec_sel(vec_madd(row5, q5, negBias), vec_madd(row5, q5, bias),
- vec_cmpgt(row5, zero));
- row6 = vec_sel(vec_madd(row6, q6, negBias), vec_madd(row6, q6, bias),
- vec_cmpgt(row6, zero));
- row7 = vec_sel(vec_madd(row7, q7, negBias), vec_madd(row7, q7, bias),
- vec_cmpgt(row7, zero));
-
- q0 = vec_ctf(qmat[1], QMAT_SHIFT);
- q1 = vec_ctf(qmat[3], QMAT_SHIFT);
- q2 = vec_ctf(qmat[5], QMAT_SHIFT);
- q3 = vec_ctf(qmat[7], QMAT_SHIFT);
- q4 = vec_ctf(qmat[9], QMAT_SHIFT);
- q5 = vec_ctf(qmat[11], QMAT_SHIFT);
- q6 = vec_ctf(qmat[13], QMAT_SHIFT);
- q7 = vec_ctf(qmat[15], QMAT_SHIFT);
-
- alt0 = vec_sel(vec_madd(alt0, q0, negBias), vec_madd(alt0, q0, bias),
- vec_cmpgt(alt0, zero));
- alt1 = vec_sel(vec_madd(alt1, q1, negBias), vec_madd(alt1, q1, bias),
- vec_cmpgt(alt1, zero));
- alt2 = vec_sel(vec_madd(alt2, q2, negBias), vec_madd(alt2, q2, bias),
- vec_cmpgt(alt2, zero));
- alt3 = vec_sel(vec_madd(alt3, q3, negBias), vec_madd(alt3, q3, bias),
- vec_cmpgt(alt3, zero));
- alt4 = vec_sel(vec_madd(alt4, q4, negBias), vec_madd(alt4, q4, bias),
- vec_cmpgt(alt4, zero));
- alt5 = vec_sel(vec_madd(alt5, q5, negBias), vec_madd(alt5, q5, bias),
- vec_cmpgt(alt5, zero));
- alt6 = vec_sel(vec_madd(alt6, q6, negBias), vec_madd(alt6, q6, bias),
- vec_cmpgt(alt6, zero));
- alt7 = vec_sel(vec_madd(alt7, q7, negBias), vec_madd(alt7, q7, bias),
- vec_cmpgt(alt7, zero));
- }
-
-
- }
-
- // Store the data back into the original block
- {
- vector signed short data0, data1, data2, data3, data4, data5, data6, data7;
-
- data0 = vec_pack(vec_cts(row0, 0), vec_cts(alt0, 0));
- data1 = vec_pack(vec_cts(row1, 0), vec_cts(alt1, 0));
- data2 = vec_pack(vec_cts(row2, 0), vec_cts(alt2, 0));
- data3 = vec_pack(vec_cts(row3, 0), vec_cts(alt3, 0));
- data4 = vec_pack(vec_cts(row4, 0), vec_cts(alt4, 0));
- data5 = vec_pack(vec_cts(row5, 0), vec_cts(alt5, 0));
- data6 = vec_pack(vec_cts(row6, 0), vec_cts(alt6, 0));
- data7 = vec_pack(vec_cts(row7, 0), vec_cts(alt7, 0));
-
- {
- // Clamp for overflow
- vector signed int max_q_int, min_q_int;
- vector signed short max_q, min_q;
-
- LOAD4(max_q_int, &(s->max_qcoeff));
- LOAD4(min_q_int, &(s->min_qcoeff));
-
- max_q = vec_pack(max_q_int, max_q_int);
- min_q = vec_pack(min_q_int, min_q_int);
-
- data0 = vec_max(vec_min(data0, max_q), min_q);
- data1 = vec_max(vec_min(data1, max_q), min_q);
- data2 = vec_max(vec_min(data2, max_q), min_q);
- data4 = vec_max(vec_min(data4, max_q), min_q);
- data5 = vec_max(vec_min(data5, max_q), min_q);
- data6 = vec_max(vec_min(data6, max_q), min_q);
- data7 = vec_max(vec_min(data7, max_q), min_q);
- }
-
- {
- vector bool char zero_01, zero_23, zero_45, zero_67;
- vector signed char scanIndices_01, scanIndices_23, scanIndices_45, scanIndices_67;
- vector signed char negOne = vec_splat_s8(-1);
- vector signed char* scanPtr =
- (vector signed char*)(s->intra_scantable.inverse);
- signed char lastNonZeroChar;
-
- // Determine the largest non-zero index.
- zero_01 = vec_pack(vec_cmpeq(data0, (vector signed short)zero),
- vec_cmpeq(data1, (vector signed short)zero));
- zero_23 = vec_pack(vec_cmpeq(data2, (vector signed short)zero),
- vec_cmpeq(data3, (vector signed short)zero));
- zero_45 = vec_pack(vec_cmpeq(data4, (vector signed short)zero),
- vec_cmpeq(data5, (vector signed short)zero));
- zero_67 = vec_pack(vec_cmpeq(data6, (vector signed short)zero),
- vec_cmpeq(data7, (vector signed short)zero));
-
- // 64 biggest values
- scanIndices_01 = vec_sel(scanPtr[0], negOne, zero_01);
- scanIndices_23 = vec_sel(scanPtr[1], negOne, zero_23);
- scanIndices_45 = vec_sel(scanPtr[2], negOne, zero_45);
- scanIndices_67 = vec_sel(scanPtr[3], negOne, zero_67);
-
- // 32 largest values
- scanIndices_01 = vec_max(scanIndices_01, scanIndices_23);
- scanIndices_45 = vec_max(scanIndices_45, scanIndices_67);
-
- // 16 largest values
- scanIndices_01 = vec_max(scanIndices_01, scanIndices_45);
-
- // 8 largest values
- scanIndices_01 = vec_max(vec_mergeh(scanIndices_01, negOne),
- vec_mergel(scanIndices_01, negOne));
-
- // 4 largest values
- scanIndices_01 = vec_max(vec_mergeh(scanIndices_01, negOne),
- vec_mergel(scanIndices_01, negOne));
-
- // 2 largest values
- scanIndices_01 = vec_max(vec_mergeh(scanIndices_01, negOne),
- vec_mergel(scanIndices_01, negOne));
-
- // largest value
- scanIndices_01 = vec_max(vec_mergeh(scanIndices_01, negOne),
- vec_mergel(scanIndices_01, negOne));
-
- scanIndices_01 = vec_splat(scanIndices_01, 0);
-
-
- vec_ste(scanIndices_01, 0, &lastNonZeroChar);
-
- lastNonZero = lastNonZeroChar;
-
- // While the data is still in vectors we check for the transpose IDCT permute
- // and handle it using the vector unit if we can. This is the permute used
- // by the altivec idct, so it is common when using the altivec dct.
-
- if ((lastNonZero > 0) && (s->dsp.idct_permutation_type == FF_TRANSPOSE_IDCT_PERM))
- {
- TRANSPOSE8(data0, data1, data2, data3, data4, data5, data6, data7);
- }
-
- vec_st(data0, 0, data);
- vec_st(data1, 16, data);
- vec_st(data2, 32, data);
- vec_st(data3, 48, data);
- vec_st(data4, 64, data);
- vec_st(data5, 80, data);
- vec_st(data6, 96, data);
- vec_st(data7, 112, data);
- }
- }
-
- // special handling of block[0]
- if (s->mb_intra)
- {
- if (!s->h263_aic)
- {
- if (n < 4)
- oldBaseValue /= s->y_dc_scale;
- else
- oldBaseValue /= s->c_dc_scale;
- }
-
- // Divide by 8, rounding the result
- data[0] = (oldBaseValue + 4) >> 3;
- }
-
- // We handled the tranpose permutation above and we don't
- // need to permute the "no" permutation case.
- if ((lastNonZero > 0) &&
- (s->dsp.idct_permutation_type != FF_TRANSPOSE_IDCT_PERM) &&
- (s->dsp.idct_permutation_type != FF_NO_IDCT_PERM))
- {
- ff_block_permute(data, s->dsp.idct_permutation,
- s->intra_scantable.scantable, lastNonZero);
- }
-
- return lastNonZero;
-}
-#undef FOUROF
-
-/*
- AltiVec version of dct_unquantize_h263
- this code assumes `block' is 16 bytes-aligned
-*/
-void dct_unquantize_h263_altivec(MpegEncContext *s,
- DCTELEM *block, int n, int qscale)
-{
-POWERPC_PERF_DECLARE(altivec_dct_unquantize_h263_num, 1);
- int i, level, qmul, qadd;
- int nCoeffs;
-
- assert(s->block_last_index[n]>=0);
-
-POWERPC_PERF_START_COUNT(altivec_dct_unquantize_h263_num, 1);
-
- qadd = (qscale - 1) | 1;
- qmul = qscale << 1;
-
- if (s->mb_intra) {
- if (!s->h263_aic) {
- if (n < 4)
- block[0] = block[0] * s->y_dc_scale;
- else
- block[0] = block[0] * s->c_dc_scale;
- }else
- qadd = 0;
- i = 1;
- nCoeffs= 63; //does not allways use zigzag table
- } else {
- i = 0;
- nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ];
- }
-
- {
- register const_vector signed short vczero = (const_vector signed short)vec_splat_s16(0);
- short __attribute__ ((aligned(16))) qmul8[] =
- {
- qmul, qmul, qmul, qmul,
- qmul, qmul, qmul, qmul
- };
- short __attribute__ ((aligned(16))) qadd8[] =
- {
- qadd, qadd, qadd, qadd,
- qadd, qadd, qadd, qadd
- };
- short __attribute__ ((aligned(16))) nqadd8[] =
- {
- -qadd, -qadd, -qadd, -qadd,
- -qadd, -qadd, -qadd, -qadd
- };
- register vector signed short blockv, qmulv, qaddv, nqaddv, temp1;
- register vector bool short blockv_null, blockv_neg;
- register short backup_0 = block[0];
- register int j = 0;
-
- qmulv = vec_ld(0, qmul8);
- qaddv = vec_ld(0, qadd8);
- nqaddv = vec_ld(0, nqadd8);
-
-#if 0 // block *is* 16 bytes-aligned, it seems.
- // first make sure block[j] is 16 bytes-aligned
- for(j = 0; (j <= nCoeffs) && ((((unsigned long)block) + (j << 1)) & 0x0000000F) ; j++) {
- level = block[j];
- if (level) {
- if (level < 0) {
- level = level * qmul - qadd;
- } else {
- level = level * qmul + qadd;
- }
- block[j] = level;
- }
- }
-#endif
-
- // vectorize all the 16 bytes-aligned blocks
- // of 8 elements
- for(; (j + 7) <= nCoeffs ; j+=8)
- {
- blockv = vec_ld(j << 1, block);
- blockv_neg = vec_cmplt(blockv, vczero);
- blockv_null = vec_cmpeq(blockv, vczero);
- // choose between +qadd or -qadd as the third operand
- temp1 = vec_sel(qaddv, nqaddv, blockv_neg);
- // multiply & add (block{i,i+7} * qmul [+-] qadd)
- temp1 = vec_mladd(blockv, qmulv, temp1);
- // put 0 where block[{i,i+7} used to have 0
- blockv = vec_sel(temp1, blockv, blockv_null);
- vec_st(blockv, j << 1, block);
- }
-
- // if nCoeffs isn't a multiple of 8, finish the job
- // using good old scalar units.
- // (we could do it using a truncated vector,
- // but I'm not sure it's worth the hassle)
- for(; j <= nCoeffs ; j++) {
- level = block[j];
- if (level) {
- if (level < 0) {
- level = level * qmul - qadd;
- } else {
- level = level * qmul + qadd;
- }
- block[j] = level;
- }
- }
-
- if (i == 1)
- { // cheat. this avoid special-casing the first iteration
- block[0] = backup_0;
- }
- }
-POWERPC_PERF_STOP_COUNT(altivec_dct_unquantize_h263_num, nCoeffs == 63);
-}
diff --git a/src/libffmpeg/libavcodec/ppc/mpegvideo_ppc.c b/src/libffmpeg/libavcodec/ppc/mpegvideo_ppc.c
deleted file mode 100644
index c5e822f77..000000000
--- a/src/libffmpeg/libavcodec/ppc/mpegvideo_ppc.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2002 Dieter Shirley
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "../dsputil.h"
-#include "../mpegvideo.h"
-#include <time.h>
-
-#ifdef HAVE_ALTIVEC
-#include "dsputil_altivec.h"
-#endif
-
-extern int dct_quantize_altivec(MpegEncContext *s,
- DCTELEM *block, int n,
- int qscale, int *overflow);
-extern void dct_unquantize_h263_altivec(MpegEncContext *s,
- DCTELEM *block, int n, int qscale);
-
-extern void idct_put_altivec(uint8_t *dest, int line_size, int16_t *block);
-extern void idct_add_altivec(uint8_t *dest, int line_size, int16_t *block);
-
-
-void MPV_common_init_ppc(MpegEncContext *s)
-{
-#ifdef HAVE_ALTIVEC
- if (has_altivec())
- {
- if (s->avctx->lowres==0)
- {
- if ((s->avctx->idct_algo == FF_IDCT_AUTO) ||
- (s->avctx->idct_algo == FF_IDCT_ALTIVEC))
- {
- s->dsp.idct_put = idct_put_altivec;
- s->dsp.idct_add = idct_add_altivec;
- s->dsp.idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;
- }
- }
-
- // Test to make sure that the dct required alignments are met.
- if ((((long)(s->q_intra_matrix) & 0x0f) != 0) ||
- (((long)(s->q_inter_matrix) & 0x0f) != 0))
- {
- av_log(s->avctx, AV_LOG_INFO, "Internal Error: q-matrix blocks must be 16-byte aligned "
- "to use Altivec DCT. Reverting to non-altivec version.\n");
- return;
- }
-
- if (((long)(s->intra_scantable.inverse) & 0x0f) != 0)
- {
- av_log(s->avctx, AV_LOG_INFO, "Internal Error: scan table blocks must be 16-byte aligned "
- "to use Altivec DCT. Reverting to non-altivec version.\n");
- return;
- }
-
-
- if ((s->avctx->dct_algo == FF_DCT_AUTO) ||
- (s->avctx->dct_algo == FF_DCT_ALTIVEC))
- {
-#if 0 /* seems to cause trouble under some circumstances */
- s->dct_quantize = dct_quantize_altivec;
-#endif
- s->dct_unquantize_h263_intra = dct_unquantize_h263_altivec;
- s->dct_unquantize_h263_inter = dct_unquantize_h263_altivec;
- }
- } else
-#endif
- {
- /* Non-AltiVec PPC optimisations here */
- }
-}
-
diff --git a/src/libffmpeg/libavcodec/ppc/snow_altivec.c b/src/libffmpeg/libavcodec/ppc/snow_altivec.c
deleted file mode 100644
index b15672ffe..000000000
--- a/src/libffmpeg/libavcodec/ppc/snow_altivec.c
+++ /dev/null
@@ -1,788 +0,0 @@
-/*
- * Altivec optimized snow DSP utils
- * Copyright (c) 2006 Luca Barbato <lu_zero@gentoo.org>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- *
- */
-
-#include "../dsputil.h"
-
-#include "gcc_fixes.h"
-#include "dsputil_altivec.h"
-#include "../snow.h"
-
-#undef NDEBUG
-#include <assert.h>
-
-
-
-//FIXME remove this replication
-#define slice_buffer_get_line(slice_buf, line_num) ((slice_buf)->line[line_num] ? (slice_buf)->line[line_num] : slice_buffer_load_line((slice_buf), (line_num)))
-
-static DWTELEM * slice_buffer_load_line(slice_buffer * buf, int line)
-{
- int offset;
- DWTELEM * buffer;
-
-// av_log(NULL, AV_LOG_DEBUG, "Cache hit: %d\n", line);
-
- assert(buf->data_stack_top >= 0);
-// assert(!buf->line[line]);
- if (buf->line[line])
- return buf->line[line];
-
- offset = buf->line_width * line;
- buffer = buf->data_stack[buf->data_stack_top];
- buf->data_stack_top--;
- buf->line[line] = buffer;
-
-// av_log(NULL, AV_LOG_DEBUG, "slice_buffer_load_line: line: %d remaining: %d\n", line, buf->data_stack_top + 1);
-
- return buffer;
-}
-
-
-//altivec code
-
-void ff_snow_horizontal_compose97i_altivec(DWTELEM *b, int width)
-{
- const int w2= (width+1)>>1;
- DECLARE_ALIGNED_16(DWTELEM, temp[(width>>1)]);
- const int w_l= (width>>1);
- const int w_r= w2 - 1;
- int i;
- vector signed int t1, t2, x, y, tmp1, tmp2;
- vector signed int *vbuf, *vtmp;
- vector unsigned char align;
-
-
-
- { // Lift 0
- DWTELEM * const ref = b + w2 - 1;
- DWTELEM b_0 = b[0];
- vbuf = (vector signed int *)b;
-
- tmp1 = vec_ld (0, ref);
- align = vec_lvsl (0, ref);
- tmp2 = vec_ld (15, ref);
- t1= vec_perm(tmp1, tmp2, align);
-
- i = 0;
-
- for (i=0; i<w_l-15; i+=16) {
-#if 0
- b[i+0] = b[i+0] - ((3 * (ref[i+0] + ref[i+1]) + 4) >> 3);
- b[i+1] = b[i+1] - ((3 * (ref[i+1] + ref[i+2]) + 4) >> 3);
- b[i+2] = b[i+2] - ((3 * (ref[i+2] + ref[i+3]) + 4) >> 3);
- b[i+3] = b[i+3] - ((3 * (ref[i+3] + ref[i+4]) + 4) >> 3);
-#else
-
- tmp1 = vec_ld (0, ref+4+i);
- tmp2 = vec_ld (15, ref+4+i);
-
- t2 = vec_perm(tmp1, tmp2, align);
-
- y = vec_add(t1,vec_sld(t1,t2,4));
- y = vec_add(vec_add(y,y),y);
-
- tmp1 = vec_ld (0, ref+8+i);
-
- y = vec_add(y, vec_splat_s32(4));
- y = vec_sra(y, vec_splat_u32(3));
-
- tmp2 = vec_ld (15, ref+8+i);
-
- *vbuf = vec_sub(*vbuf, y);
-
- t1=t2;
-
- vbuf++;
-
- t2 = vec_perm(tmp1, tmp2, align);
-
- y = vec_add(t1,vec_sld(t1,t2,4));
- y = vec_add(vec_add(y,y),y);
-
- tmp1 = vec_ld (0, ref+12+i);
-
- y = vec_add(y, vec_splat_s32(4));
- y = vec_sra(y, vec_splat_u32(3));
-
- tmp2 = vec_ld (15, ref+12+i);
-
- *vbuf = vec_sub(*vbuf, y);
-
- t1=t2;
-
- vbuf++;
-
- t2 = vec_perm(tmp1, tmp2, align);
-
- y = vec_add(t1,vec_sld(t1,t2,4));
- y = vec_add(vec_add(y,y),y);
-
- tmp1 = vec_ld (0, ref+16+i);
-
- y = vec_add(y, vec_splat_s32(4));
- y = vec_sra(y, vec_splat_u32(3));
-
- tmp2 = vec_ld (15, ref+16+i);
-
- *vbuf = vec_sub(*vbuf, y);
-
- t1=t2;
-
- t2 = vec_perm(tmp1, tmp2, align);
-
- y = vec_add(t1,vec_sld(t1,t2,4));
- y = vec_add(vec_add(y,y),y);
-
- vbuf++;
-
- y = vec_add(y, vec_splat_s32(4));
- y = vec_sra(y, vec_splat_u32(3));
- *vbuf = vec_sub(*vbuf, y);
-
- t1=t2;
-
- vbuf++;
-
-#endif
- }
-
- snow_horizontal_compose_lift_lead_out(i, b, b, ref, width, w_l, 0, W_DM, W_DO, W_DS);
- b[0] = b_0 - ((W_DM * 2 * ref[1]+W_DO)>>W_DS);
- }
-
- { // Lift 1
- DWTELEM * const dst = b+w2;
-
- i = 0;
- for(; (((long)&dst[i]) & 0xF) && i<w_r; i++){
- dst[i] = dst[i] - (b[i] + b[i + 1]);
- }
-
- align = vec_lvsl(0, b+i);
- tmp1 = vec_ld(0, b+i);
- vbuf = (vector signed int*) (dst + i);
- tmp2 = vec_ld(15, b+i);
-
- t1 = vec_perm(tmp1, tmp2, align);
-
- for (; i<w_r-3; i+=4) {
-
-#if 0
- dst[i] = dst[i] - (b[i] + b[i + 1]);
- dst[i+1] = dst[i+1] - (b[i+1] + b[i + 2]);
- dst[i+2] = dst[i+2] - (b[i+2] + b[i + 3]);
- dst[i+3] = dst[i+3] - (b[i+3] + b[i + 4]);
-#else
-
- tmp1 = vec_ld(0, b+4+i);
- tmp2 = vec_ld(15, b+4+i);
-
- t2 = vec_perm(tmp1, tmp2, align);
-
- y = vec_add(t1, vec_sld(t1,t2,4));
- *vbuf = vec_sub (*vbuf, y);
-
- vbuf++;
-
- t1 = t2;
-
-#endif
-
- }
-
- snow_horizontal_compose_lift_lead_out(i, dst, dst, b, width, w_r, 1, W_CM, W_CO, W_CS);
- }
-
- { // Lift 2
- DWTELEM * const ref = b+w2 - 1;
- DWTELEM b_0 = b[0];
- vbuf= (vector signed int *) b;
-
- tmp1 = vec_ld (0, ref);
- align = vec_lvsl (0, ref);
- tmp2 = vec_ld (15, ref);
- t1= vec_perm(tmp1, tmp2, align);
-
- i = 0;
- for (; i<w_l-15; i+=16) {
-#if 0
- b[i] = b[i] - (((8 -(ref[i] + ref[i+1])) - (b[i] <<2)) >> 4);
- b[i+1] = b[i+1] - (((8 -(ref[i+1] + ref[i+2])) - (b[i+1]<<2)) >> 4);
- b[i+2] = b[i+2] - (((8 -(ref[i+2] + ref[i+3])) - (b[i+2]<<2)) >> 4);
- b[i+3] = b[i+3] - (((8 -(ref[i+3] + ref[i+4])) - (b[i+3]<<2)) >> 4);
-#else
- tmp1 = vec_ld (0, ref+4+i);
- tmp2 = vec_ld (15, ref+4+i);
-
- t2 = vec_perm(tmp1, tmp2, align);
-
- y = vec_add(t1,vec_sld(t1,t2,4));
- y = vec_sub(vec_splat_s32(8),y);
-
- tmp1 = vec_ld (0, ref+8+i);
-
- x = vec_sl(*vbuf,vec_splat_u32(2));
- y = vec_sra(vec_sub(y,x),vec_splat_u32(4));
-
- tmp2 = vec_ld (15, ref+8+i);
-
- *vbuf = vec_sub( *vbuf, y);
-
- t1 = t2;
-
- vbuf++;
-
- t2 = vec_perm(tmp1, tmp2, align);
-
- y = vec_add(t1,vec_sld(t1,t2,4));
- y = vec_sub(vec_splat_s32(8),y);
-
- tmp1 = vec_ld (0, ref+12+i);
-
- x = vec_sl(*vbuf,vec_splat_u32(2));
- y = vec_sra(vec_sub(y,x),vec_splat_u32(4));
-
- tmp2 = vec_ld (15, ref+12+i);
-
- *vbuf = vec_sub( *vbuf, y);
-
- t1 = t2;
-
- vbuf++;
-
- t2 = vec_perm(tmp1, tmp2, align);
-
- y = vec_add(t1,vec_sld(t1,t2,4));
- y = vec_sub(vec_splat_s32(8),y);
-
- tmp1 = vec_ld (0, ref+16+i);
-
- x = vec_sl(*vbuf,vec_splat_u32(2));
- y = vec_sra(vec_sub(y,x),vec_splat_u32(4));
-
- tmp2 = vec_ld (15, ref+16+i);
-
- *vbuf = vec_sub( *vbuf, y);
-
- t1 = t2;
-
- vbuf++;
-
- t2 = vec_perm(tmp1, tmp2, align);
-
- y = vec_add(t1,vec_sld(t1,t2,4));
- y = vec_sub(vec_splat_s32(8),y);
-
- t1 = t2;
-
- x = vec_sl(*vbuf,vec_splat_u32(2));
- y = vec_sra(vec_sub(y,x),vec_splat_u32(4));
- *vbuf = vec_sub( *vbuf, y);
-
- vbuf++;
-
-#endif
- }
-
- snow_horizontal_compose_liftS_lead_out(i, b, b, ref, width, w_l);
- b[0] = b_0 - (((-2 * ref[1] + W_BO) - 4 * b_0) >> W_BS);
- }
-
- { // Lift 3
- DWTELEM * const src = b+w2;
-
- vbuf = (vector signed int *)b;
- vtmp = (vector signed int *)temp;
-
- i = 0;
- align = vec_lvsl(0, src);
-
- for (; i<w_r-3; i+=4) {
-#if 0
- temp[i] = src[i] - ((-3*(b[i] + b[i+1]))>>1);
- temp[i+1] = src[i+1] - ((-3*(b[i+1] + b[i+2]))>>1);
- temp[i+2] = src[i+2] - ((-3*(b[i+2] + b[i+3]))>>1);
- temp[i+3] = src[i+3] - ((-3*(b[i+3] + b[i+4]))>>1);
-#else
- tmp1 = vec_ld(0,src+i);
- t1 = vec_add(vbuf[0],vec_sld(vbuf[0],vbuf[1],4));
- tmp2 = vec_ld(15,src+i);
- t1 = vec_sub(vec_splat_s32(0),t1); //bad!
- t1 = vec_add(t1,vec_add(t1,t1));
- t2 = vec_perm(tmp1 ,tmp2 ,align);
- t1 = vec_sra(t1,vec_splat_u32(1));
- vbuf++;
- *vtmp = vec_sub(t2,t1);
- vtmp++;
-
-#endif
-
- }
-
- snow_horizontal_compose_lift_lead_out(i, temp, src, b, width, w_r, 1, -3, 0, 1);
- }
-
- {
- //Interleave
- int a;
- vector signed int *t = (vector signed int *)temp,
- *v = (vector signed int *)b;
-
- snow_interleave_line_header(&i, width, b, temp);
-
- for (; (i & 0xE) != 0xE; i-=2){
- b[i+1] = temp[i>>1];
- b[i] = b[i>>1];
- }
- for (i-=14; i>=0; i-=16){
- a=i/4;
-
- v[a+3]=vec_mergel(v[(a>>1)+1],t[(a>>1)+1]);
- v[a+2]=vec_mergeh(v[(a>>1)+1],t[(a>>1)+1]);
- v[a+1]=vec_mergel(v[a>>1],t[a>>1]);
- v[a]=vec_mergeh(v[a>>1],t[a>>1]);
-
- }
-
- }
-}
-
-void ff_snow_vertical_compose97i_altivec(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, DWTELEM *b3, DWTELEM *b4, DWTELEM *b5, int width)
-{
- int i, w4 = width/4;
- vector signed int *v0, *v1,*v2,*v3,*v4,*v5;
- vector signed int t1, t2;
-
- v0=(vector signed int *)b0;
- v1=(vector signed int *)b1;
- v2=(vector signed int *)b2;
- v3=(vector signed int *)b3;
- v4=(vector signed int *)b4;
- v5=(vector signed int *)b5;
-
- for (i=0; i< w4;i++)
- {
-
- #if 0
- b4[i] -= (3*(b3[i] + b5[i])+4)>>3;
- b3[i] -= ((b2[i] + b4[i]));
- b2[i] += ((b1[i] + b3[i])+4*b2[i]+8)>>4;
- b1[i] += (3*(b0[i] + b2[i]))>>1;
- #else
- t1 = vec_add(v3[i], v5[i]);
- t2 = vec_add(t1, vec_add(t1,t1));
- t1 = vec_add(t2, vec_splat_s32(4));
- v4[i] = vec_sub(v4[i], vec_sra(t1,vec_splat_u32(3)));
-
- v3[i] = vec_sub(v3[i], vec_add(v2[i], v4[i]));
-
- t1 = vec_add(vec_splat_s32(8), vec_add(v1[i], v3[i]));
- t2 = vec_sl(v2[i], vec_splat_u32(2));
- v2[i] = vec_add(v2[i], vec_sra(vec_add(t1,t2),vec_splat_u32(4)));
- t1 = vec_add(v0[i], v2[i]);
- t2 = vec_add(t1, vec_add(t1,t1));
- v1[i] = vec_add(v1[i], vec_sra(t2,vec_splat_u32(1)));
-
- #endif
- }
-
- for(i*=4; i < width; i++)
- {
- b4[i] -= (W_DM*(b3[i] + b5[i])+W_DO)>>W_DS;
- b3[i] -= (W_CM*(b2[i] + b4[i])+W_CO)>>W_CS;
- b2[i] += (W_BM*(b1[i] + b3[i])+4*b2[i]+W_BO)>>W_BS;
- b1[i] += (W_AM*(b0[i] + b2[i])+W_AO)>>W_AS;
- }
-}
-
-#define LOAD_BLOCKS \
- tmp1 = vec_ld(0, &block[3][y*src_stride]);\
- align = vec_lvsl(0, &block[3][y*src_stride]);\
- tmp2 = vec_ld(15, &block[3][y*src_stride]);\
-\
- b3 = vec_perm(tmp1,tmp2,align);\
-\
- tmp1 = vec_ld(0, &block[2][y*src_stride]);\
- align = vec_lvsl(0, &block[2][y*src_stride]);\
- tmp2 = vec_ld(15, &block[2][y*src_stride]);\
-\
- b2 = vec_perm(tmp1,tmp2,align);\
-\
- tmp1 = vec_ld(0, &block[1][y*src_stride]);\
- align = vec_lvsl(0, &block[1][y*src_stride]);\
- tmp2 = vec_ld(15, &block[1][y*src_stride]);\
-\
- b1 = vec_perm(tmp1,tmp2,align);\
-\
- tmp1 = vec_ld(0, &block[0][y*src_stride]);\
- align = vec_lvsl(0, &block[0][y*src_stride]);\
- tmp2 = vec_ld(15, &block[0][y*src_stride]);\
-\
- b0 = vec_perm(tmp1,tmp2,align);
-
-#define LOAD_OBMCS \
- tmp1 = vec_ld(0, obmc1);\
- align = vec_lvsl(0, obmc1);\
- tmp2 = vec_ld(15, obmc1);\
-\
- ob1 = vec_perm(tmp1,tmp2,align);\
-\
- tmp1 = vec_ld(0, obmc2);\
- align = vec_lvsl(0, obmc2);\
- tmp2 = vec_ld(15, obmc2);\
-\
- ob2 = vec_perm(tmp1,tmp2,align);\
-\
- tmp1 = vec_ld(0, obmc3);\
- align = vec_lvsl(0, obmc3);\
- tmp2 = vec_ld(15, obmc3);\
-\
- ob3 = vec_perm(tmp1,tmp2,align);\
-\
- tmp1 = vec_ld(0, obmc4);\
- align = vec_lvsl(0, obmc4);\
- tmp2 = vec_ld(15, obmc4);\
-\
- ob4 = vec_perm(tmp1,tmp2,align);
-
-/* interleave logic
- * h1 <- [ a,b,a,b, a,b,a,b, a,b,a,b, a,b,a,b ]
- * h2 <- [ c,d,c,d, c,d,c,d, c,d,c,d, c,d,c,d ]
- * h <- [ a,b,c,d, a,b,c,d, a,b,c,d, a,b,c,d ]
- */
-
-#define STEPS_0_1\
- h1 = (vector unsigned short)\
- vec_mergeh(ob1, ob2);\
-\
- h2 = (vector unsigned short)\
- vec_mergeh(ob3, ob4);\
-\
- ih = (vector unsigned char)\
- vec_mergeh(h1,h2);\
-\
- l1 = (vector unsigned short) vec_mergeh(b3, b2);\
-\
- ih1 = (vector unsigned char) vec_mergel(h1, h2);\
-\
- l2 = (vector unsigned short) vec_mergeh(b1, b0);\
-\
- il = (vector unsigned char) vec_mergeh(l1, l2);\
-\
- v[0] = (vector signed int) vec_msum(ih, il, vec_splat_u32(0));\
-\
- il1 = (vector unsigned char) vec_mergel(l1, l2);\
-\
- v[1] = (vector signed int) vec_msum(ih1, il1, vec_splat_u32(0));
-
-#define FINAL_STEP_SCALAR\
- for(x=0; x<b_w; x++)\
- if(add){\
- vbuf[x] += dst[x + src_x];\
- vbuf[x] = (vbuf[x] + (1<<(FRAC_BITS-1))) >> FRAC_BITS;\
- if(vbuf[x]&(~255)) vbuf[x]= ~(vbuf[x]>>31);\
- dst8[x + y*src_stride] = vbuf[x];\
- }else{\
- dst[x + src_x] -= vbuf[x];\
- }
-
-static void inner_add_yblock_bw_8_obmc_16_altivec(uint8_t *obmc,
- const int obmc_stride,
- uint8_t * * block, int b_w,
- int b_h, int src_x, int src_y,
- int src_stride, slice_buffer * sb,
- int add, uint8_t * dst8)
-{
- int y, x;
- DWTELEM * dst;
- vector unsigned short h1, h2, l1, l2;
- vector unsigned char ih, il, ih1, il1, tmp1, tmp2, align;
- vector unsigned char b0,b1,b2,b3;
- vector unsigned char ob1,ob2,ob3,ob4;
-
- DECLARE_ALIGNED_16(int, vbuf[16]);
- vector signed int *v = (vector signed int *)vbuf, *d;
-
- for(y=0; y<b_h; y++){
- //FIXME ugly missue of obmc_stride
-
- uint8_t *obmc1= obmc + y*obmc_stride;
- uint8_t *obmc2= obmc1+ (obmc_stride>>1);
- uint8_t *obmc3= obmc1+ obmc_stride*(obmc_stride>>1);
- uint8_t *obmc4= obmc3+ (obmc_stride>>1);
-
- dst = slice_buffer_get_line(sb, src_y + y);
- d = (vector signed int *)(dst + src_x);
-
-//FIXME i could avoid some loads!
-
- // load blocks
- LOAD_BLOCKS
-
- // load obmcs
- LOAD_OBMCS
-
- // steps 0 1
- STEPS_0_1
-
- FINAL_STEP_SCALAR
-
- }
-
-}
-
-#define STEPS_2_3\
- h1 = (vector unsigned short) vec_mergel(ob1, ob2);\
-\
- h2 = (vector unsigned short) vec_mergel(ob3, ob4);\
-\
- ih = (vector unsigned char) vec_mergeh(h1,h2);\
-\
- l1 = (vector unsigned short) vec_mergel(b3, b2);\
-\
- l2 = (vector unsigned short) vec_mergel(b1, b0);\
-\
- ih1 = (vector unsigned char) vec_mergel(h1,h2);\
-\
- il = (vector unsigned char) vec_mergeh(l1,l2);\
-\
- v[2] = (vector signed int) vec_msum(ih, il, vec_splat_u32(0));\
-\
- il1 = (vector unsigned char) vec_mergel(l1,l2);\
-\
- v[3] = (vector signed int) vec_msum(ih1, il1, vec_splat_u32(0));
-
-
-static void inner_add_yblock_bw_16_obmc_32_altivec(uint8_t *obmc,
- const int obmc_stride,
- uint8_t * * block, int b_w,
- int b_h, int src_x, int src_y,
- int src_stride, slice_buffer * sb,
- int add, uint8_t * dst8)
-{
- int y, x;
- DWTELEM * dst;
- vector unsigned short h1, h2, l1, l2;
- vector unsigned char ih, il, ih1, il1, tmp1, tmp2, align;
- vector unsigned char b0,b1,b2,b3;
- vector unsigned char ob1,ob2,ob3,ob4;
- DECLARE_ALIGNED_16(int, vbuf[b_w]);
- vector signed int *v = (vector signed int *)vbuf, *d;
-
- for(y=0; y<b_h; y++){
- //FIXME ugly missue of obmc_stride
-
- uint8_t *obmc1= obmc + y*obmc_stride;
- uint8_t *obmc2= obmc1+ (obmc_stride>>1);
- uint8_t *obmc3= obmc1+ obmc_stride*(obmc_stride>>1);
- uint8_t *obmc4= obmc3+ (obmc_stride>>1);
-
- dst = slice_buffer_get_line(sb, src_y + y);
- d = (vector signed int *)(dst + src_x);
-
- // load blocks
- LOAD_BLOCKS
-
- // load obmcs
- LOAD_OBMCS
-
- // steps 0 1 2 3
- STEPS_0_1
-
- STEPS_2_3
-
- FINAL_STEP_SCALAR
-
- }
-}
-
-#define FINAL_STEP_VEC \
-\
- if(add)\
- {\
- for(x=0; x<b_w/4; x++)\
- {\
- v[x] = vec_add(v[x], d[x]);\
- v[x] = vec_sra(vec_add(v[x],\
- vec_sl( vec_splat_s32(1),\
- vec_splat_u32(7))),\
- vec_splat_u32(8));\
-\
- mask = (vector bool int) vec_sl((vector signed int)\
- vec_cmpeq(v[x],v[x]),vec_splat_u32(8));\
- mask = (vector bool int) vec_and(v[x],vec_nor(mask,mask));\
-\
- mask = (vector bool int)\
- vec_cmpeq((vector signed int)mask,\
- (vector signed int)vec_splat_u32(0));\
-\
- vs = vec_sra(v[x],vec_splat_u32(8));\
- vs = vec_sra(v[x],vec_splat_u32(8));\
- vs = vec_sra(v[x],vec_splat_u32(15));\
-\
- vs = vec_nor(vs,vs);\
-\
- v[x]= vec_sel(v[x],vs,mask);\
- }\
-\
- for(x=0; x<b_w; x++)\
- dst8[x + y*src_stride] = vbuf[x];\
-\
- }\
- else\
- for(x=0; x<b_w/4; x++)\
- d[x] = vec_sub(d[x], v[x]);
-
-static void inner_add_yblock_a_bw_8_obmc_16_altivec(uint8_t *obmc,
- const int obmc_stride,
- uint8_t * * block, int b_w,
- int b_h, int src_x, int src_y,
- int src_stride, slice_buffer * sb,
- int add, uint8_t * dst8)
-{
- int y, x;
- DWTELEM * dst;
- vector bool int mask;
- vector signed int vs;
- vector unsigned short h1, h2, l1, l2;
- vector unsigned char ih, il, ih1, il1, tmp1, tmp2, align;
- vector unsigned char b0,b1,b2,b3;
- vector unsigned char ob1,ob2,ob3,ob4;
-
- DECLARE_ALIGNED_16(int, vbuf[16]);
- vector signed int *v = (vector signed int *)vbuf, *d;
-
- for(y=0; y<b_h; y++){
- //FIXME ugly missue of obmc_stride
-
- uint8_t *obmc1= obmc + y*obmc_stride;
- uint8_t *obmc2= obmc1+ (obmc_stride>>1);
- uint8_t *obmc3= obmc1+ obmc_stride*(obmc_stride>>1);
- uint8_t *obmc4= obmc3+ (obmc_stride>>1);
-
- dst = slice_buffer_get_line(sb, src_y + y);
- d = (vector signed int *)(dst + src_x);
-
-//FIXME i could avoid some loads!
-
- // load blocks
- LOAD_BLOCKS
-
- // load obmcs
- LOAD_OBMCS
-
- // steps 0 1
- STEPS_0_1
-
- FINAL_STEP_VEC
-
- }
-
-}
-
-static void inner_add_yblock_a_bw_16_obmc_32_altivec(uint8_t *obmc,
- const int obmc_stride,
- uint8_t * * block, int b_w,
- int b_h, int src_x, int src_y,
- int src_stride, slice_buffer * sb,
- int add, uint8_t * dst8)
-{
- int y, x;
- DWTELEM * dst;
- vector bool int mask;
- vector signed int vs;
- vector unsigned short h1, h2, l1, l2;
- vector unsigned char ih, il, ih1, il1, tmp1, tmp2, align;
- vector unsigned char b0,b1,b2,b3;
- vector unsigned char ob1,ob2,ob3,ob4;
- DECLARE_ALIGNED_16(int, vbuf[b_w]);
- vector signed int *v = (vector signed int *)vbuf, *d;
-
- for(y=0; y<b_h; y++){
- //FIXME ugly missue of obmc_stride
-
- uint8_t *obmc1= obmc + y*obmc_stride;
- uint8_t *obmc2= obmc1+ (obmc_stride>>1);
- uint8_t *obmc3= obmc1+ obmc_stride*(obmc_stride>>1);
- uint8_t *obmc4= obmc3+ (obmc_stride>>1);
-
- dst = slice_buffer_get_line(sb, src_y + y);
- d = (vector signed int *)(dst + src_x);
-
- // load blocks
- LOAD_BLOCKS
-
- // load obmcs
- LOAD_OBMCS
-
- // steps 0 1 2 3
- STEPS_0_1
-
- STEPS_2_3
-
- FINAL_STEP_VEC
-
- }
-}
-
-
-void ff_snow_inner_add_yblock_altivec(uint8_t *obmc, const int obmc_stride,
- uint8_t * * block, int b_w, int b_h,
- int src_x, int src_y, int src_stride,
- slice_buffer * sb, int add,
- uint8_t * dst8)
-{
- if (src_x&15) {
- if (b_w == 16)
- inner_add_yblock_bw_16_obmc_32_altivec(obmc, obmc_stride, block,
- b_w, b_h, src_x, src_y,
- src_stride, sb, add, dst8);
- else if (b_w == 8)
- inner_add_yblock_bw_8_obmc_16_altivec(obmc, obmc_stride, block,
- b_w, b_h, src_x, src_y,
- src_stride, sb, add, dst8);
- else
- ff_snow_inner_add_yblock(obmc, obmc_stride, block, b_w, b_h, src_x,
- src_y, src_stride, sb, add, dst8);
- } else {
- if (b_w == 16)
- inner_add_yblock_a_bw_16_obmc_32_altivec(obmc, obmc_stride, block,
- b_w, b_h, src_x, src_y,
- src_stride, sb, add, dst8);
- else if (b_w == 8)
- inner_add_yblock_a_bw_8_obmc_16_altivec(obmc, obmc_stride, block,
- b_w, b_h, src_x, src_y,
- src_stride, sb, add, dst8);
- else
- ff_snow_inner_add_yblock(obmc, obmc_stride, block, b_w, b_h, src_x,
- src_y, src_stride, sb, add, dst8);
- }
-}
-
-
-void snow_init_altivec(DSPContext* c, AVCodecContext *avctx)
-{
- c->horizontal_compose97i = ff_snow_horizontal_compose97i_altivec;
- c->vertical_compose97i = ff_snow_vertical_compose97i_altivec;
- c->inner_add_yblock = ff_snow_inner_add_yblock_altivec;
-}
diff --git a/src/libffmpeg/libavcodec/ppc/types_altivec.h b/src/libffmpeg/libavcodec/ppc/types_altivec.h
deleted file mode 100644
index f29026e04..000000000
--- a/src/libffmpeg/libavcodec/ppc/types_altivec.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2006 Guillaume Poirier <gpoirier@mplayerhq.hu>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/***********************************************************************
- * Vector types
- **********************************************************************/
-#define vec_u8_t vector unsigned char
-#define vec_s8_t vector signed char
-#define vec_u16_t vector unsigned short
-#define vec_s16_t vector signed short
-#define vec_u32_t vector unsigned int
-#define vec_s32_t vector signed int
-
-/***********************************************************************
- * Null vector
- **********************************************************************/
-#define LOAD_ZERO const vec_u8_t zerov = vec_splat_u8( 0 )
-
-#define zero_u8v (vec_u8_t) zerov
-#define zero_s8v (vec_s8_t) zerov
-#define zero_u16v (vec_u16_t) zerov
-#define zero_s16v (vec_s16_t) zerov
-#define zero_u32v (vec_u32_t) zerov
-#define zero_s32v (vec_s32_t) zerov
diff --git a/src/libffmpeg/libavcodec/ppc/vc1dsp_altivec.c b/src/libffmpeg/libavcodec/ppc/vc1dsp_altivec.c
deleted file mode 100644
index 114c9d41f..000000000
--- a/src/libffmpeg/libavcodec/ppc/vc1dsp_altivec.c
+++ /dev/null
@@ -1,338 +0,0 @@
-/*
- * VC-1 and WMV3 decoder - DSP functions AltiVec-optimized
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include "../dsputil.h"
-
-#include "gcc_fixes.h"
-
-#include "dsputil_altivec.h"
-
-// main steps of 8x8 transform
-#define STEP8(s0, s1, s2, s3, s4, s5, s6, s7, vec_rnd) \
-do { \
- t0 = vec_sl(vec_add(s0, s4), vec_2); \
- t0 = vec_add(vec_sl(t0, vec_1), t0); \
- t0 = vec_add(t0, vec_rnd); \
- t1 = vec_sl(vec_sub(s0, s4), vec_2); \
- t1 = vec_add(vec_sl(t1, vec_1), t1); \
- t1 = vec_add(t1, vec_rnd); \
- t2 = vec_add(vec_sl(s6, vec_2), vec_sl(s6, vec_1)); \
- t2 = vec_add(t2, vec_sl(s2, vec_4)); \
- t3 = vec_add(vec_sl(s2, vec_2), vec_sl(s2, vec_1)); \
- t3 = vec_sub(t3, vec_sl(s6, vec_4)); \
- t4 = vec_add(t0, t2); \
- t5 = vec_add(t1, t3); \
- t6 = vec_sub(t1, t3); \
- t7 = vec_sub(t0, t2); \
-\
- t0 = vec_sl(vec_add(s1, s3), vec_4); \
- t0 = vec_add(t0, vec_sl(s5, vec_3)); \
- t0 = vec_add(t0, vec_sl(s7, vec_2)); \
- t0 = vec_add(t0, vec_sub(s5, s3)); \
-\
- t1 = vec_sl(vec_sub(s1, s5), vec_4); \
- t1 = vec_sub(t1, vec_sl(s7, vec_3)); \
- t1 = vec_sub(t1, vec_sl(s3, vec_2)); \
- t1 = vec_sub(t1, vec_add(s1, s7)); \
-\
- t2 = vec_sl(vec_sub(s7, s3), vec_4); \
- t2 = vec_add(t2, vec_sl(s1, vec_3)); \
- t2 = vec_add(t2, vec_sl(s5, vec_2)); \
- t2 = vec_add(t2, vec_sub(s1, s7)); \
-\
- t3 = vec_sl(vec_sub(s5, s7), vec_4); \
- t3 = vec_sub(t3, vec_sl(s3, vec_3)); \
- t3 = vec_add(t3, vec_sl(s1, vec_2)); \
- t3 = vec_sub(t3, vec_add(s3, s5)); \
-\
- s0 = vec_add(t4, t0); \
- s1 = vec_add(t5, t1); \
- s2 = vec_add(t6, t2); \
- s3 = vec_add(t7, t3); \
- s4 = vec_sub(t7, t3); \
- s5 = vec_sub(t6, t2); \
- s6 = vec_sub(t5, t1); \
- s7 = vec_sub(t4, t0); \
-}while(0)
-
-#define SHIFT_HOR8(s0, s1, s2, s3, s4, s5, s6, s7) \
-do { \
- s0 = vec_sra(s0, vec_3); \
- s1 = vec_sra(s1, vec_3); \
- s2 = vec_sra(s2, vec_3); \
- s3 = vec_sra(s3, vec_3); \
- s4 = vec_sra(s4, vec_3); \
- s5 = vec_sra(s5, vec_3); \
- s6 = vec_sra(s6, vec_3); \
- s7 = vec_sra(s7, vec_3); \
-}while(0)
-
-#define SHIFT_VERT8(s0, s1, s2, s3, s4, s5, s6, s7) \
-do { \
- s0 = vec_sra(s0, vec_7); \
- s1 = vec_sra(s1, vec_7); \
- s2 = vec_sra(s2, vec_7); \
- s3 = vec_sra(s3, vec_7); \
- s4 = vec_sra(vec_add(s4, vec_1s), vec_7); \
- s5 = vec_sra(vec_add(s5, vec_1s), vec_7); \
- s6 = vec_sra(vec_add(s6, vec_1s), vec_7); \
- s7 = vec_sra(vec_add(s7, vec_1s), vec_7); \
-}while(0)
-
-/* main steps of 4x4 transform */
-#define STEP4(s0, s1, s2, s3, vec_rnd) \
-do { \
- t1 = vec_add(vec_sl(s0, vec_4), s0); \
- t1 = vec_add(t1, vec_rnd); \
- t2 = vec_add(vec_sl(s2, vec_4), s2); \
- t0 = vec_add(t1, t2); \
- t1 = vec_sub(t1, t2); \
- t3 = vec_sl(vec_sub(s3, s1), vec_1); \
- t3 = vec_add(t3, vec_sl(t3, vec_2)); \
- t2 = vec_add(t3, vec_sl(s1, vec_5)); \
- t3 = vec_add(t3, vec_sl(s3, vec_3)); \
- t3 = vec_add(t3, vec_sl(s3, vec_2)); \
- s0 = vec_add(t0, t2); \
- s1 = vec_sub(t1, t3); \
- s2 = vec_add(t1, t3); \
- s3 = vec_sub(t0, t2); \
-}while (0)
-
-#define SHIFT_HOR4(s0, s1, s2, s3) \
- s0 = vec_sra(s0, vec_3); \
- s1 = vec_sra(s1, vec_3); \
- s2 = vec_sra(s2, vec_3); \
- s3 = vec_sra(s3, vec_3);
-
-#define SHIFT_VERT4(s0, s1, s2, s3) \
- s0 = vec_sra(s0, vec_7); \
- s1 = vec_sra(s1, vec_7); \
- s2 = vec_sra(s2, vec_7); \
- s3 = vec_sra(s3, vec_7);
-
-/** Do inverse transform on 8x8 block
-*/
-static void vc1_inv_trans_8x8_altivec(DCTELEM block[64])
-{
- vector signed short src0, src1, src2, src3, src4, src5, src6, src7;
- vector signed int s0, s1, s2, s3, s4, s5, s6, s7;
- vector signed int s8, s9, sA, sB, sC, sD, sE, sF;
- vector signed int t0, t1, t2, t3, t4, t5, t6, t7;
- const vector signed int vec_64 = vec_sl(vec_splat_s32(4), vec_splat_u32(4));
- const vector unsigned int vec_7 = vec_splat_u32(7);
- const vector unsigned int vec_5 = vec_splat_u32(5);
- const vector unsigned int vec_4 = vec_splat_u32(4);
- const vector signed int vec_4s = vec_splat_s32(4);
- const vector unsigned int vec_3 = vec_splat_u32(3);
- const vector unsigned int vec_2 = vec_splat_u32(2);
- const vector signed int vec_1s = vec_splat_s32(1);
- const vector unsigned int vec_1 = vec_splat_u32(1);
-
-
- src0 = vec_ld( 0, block);
- src1 = vec_ld( 16, block);
- src2 = vec_ld( 32, block);
- src3 = vec_ld( 48, block);
- src4 = vec_ld( 64, block);
- src5 = vec_ld( 80, block);
- src6 = vec_ld( 96, block);
- src7 = vec_ld(112, block);
-
- TRANSPOSE8(src0, src1, src2, src3, src4, src5, src6, src7);
- s0 = vec_unpackl(src0);
- s1 = vec_unpackl(src1);
- s2 = vec_unpackl(src2);
- s3 = vec_unpackl(src3);
- s4 = vec_unpackl(src4);
- s5 = vec_unpackl(src5);
- s6 = vec_unpackl(src6);
- s7 = vec_unpackl(src7);
- s8 = vec_unpackh(src0);
- s9 = vec_unpackh(src1);
- sA = vec_unpackh(src2);
- sB = vec_unpackh(src3);
- sC = vec_unpackh(src4);
- sD = vec_unpackh(src5);
- sE = vec_unpackh(src6);
- sF = vec_unpackh(src7);
- STEP8(s0, s1, s2, s3, s4, s5, s6, s7, vec_4s);
- SHIFT_HOR8(s0, s1, s2, s3, s4, s5, s6, s7);
- STEP8(s8, s9, sA, sB, sC, sD, sE, sF, vec_4s);
- SHIFT_HOR8(s8, s9, sA, sB, sC, sD, sE, sF);
- src0 = vec_pack(s8, s0);
- src1 = vec_pack(s9, s1);
- src2 = vec_pack(sA, s2);
- src3 = vec_pack(sB, s3);
- src4 = vec_pack(sC, s4);
- src5 = vec_pack(sD, s5);
- src6 = vec_pack(sE, s6);
- src7 = vec_pack(sF, s7);
- TRANSPOSE8(src0, src1, src2, src3, src4, src5, src6, src7);
-
- s0 = vec_unpackl(src0);
- s1 = vec_unpackl(src1);
- s2 = vec_unpackl(src2);
- s3 = vec_unpackl(src3);
- s4 = vec_unpackl(src4);
- s5 = vec_unpackl(src5);
- s6 = vec_unpackl(src6);
- s7 = vec_unpackl(src7);
- s8 = vec_unpackh(src0);
- s9 = vec_unpackh(src1);
- sA = vec_unpackh(src2);
- sB = vec_unpackh(src3);
- sC = vec_unpackh(src4);
- sD = vec_unpackh(src5);
- sE = vec_unpackh(src6);
- sF = vec_unpackh(src7);
- STEP8(s0, s1, s2, s3, s4, s5, s6, s7, vec_64);
- SHIFT_VERT8(s0, s1, s2, s3, s4, s5, s6, s7);
- STEP8(s8, s9, sA, sB, sC, sD, sE, sF, vec_64);
- SHIFT_VERT8(s8, s9, sA, sB, sC, sD, sE, sF);
- src0 = vec_pack(s8, s0);
- src1 = vec_pack(s9, s1);
- src2 = vec_pack(sA, s2);
- src3 = vec_pack(sB, s3);
- src4 = vec_pack(sC, s4);
- src5 = vec_pack(sD, s5);
- src6 = vec_pack(sE, s6);
- src7 = vec_pack(sF, s7);
-
- vec_st(src0, 0, block);
- vec_st(src1, 16, block);
- vec_st(src2, 32, block);
- vec_st(src3, 48, block);
- vec_st(src4, 64, block);
- vec_st(src5, 80, block);
- vec_st(src6, 96, block);
- vec_st(src7,112, block);
-}
-
-/** Do inverse transform on 8x4 part of block
-*/
-static void vc1_inv_trans_8x4_altivec(DCTELEM block[64], int n)
-{
- vector signed short src0, src1, src2, src3, src4, src5, src6, src7;
- vector signed int s0, s1, s2, s3, s4, s5, s6, s7;
- vector signed int s8, s9, sA, sB, sC, sD, sE, sF;
- vector signed int t0, t1, t2, t3, t4, t5, t6, t7;
- const vector signed int vec_64 = vec_sl(vec_splat_s32(4), vec_splat_u32(4));
- const vector unsigned int vec_7 = vec_splat_u32(7);
- const vector unsigned int vec_5 = vec_splat_u32(5);
- const vector unsigned int vec_4 = vec_splat_u32(4);
- const vector signed int vec_4s = vec_splat_s32(4);
- const vector unsigned int vec_3 = vec_splat_u32(3);
- const vector unsigned int vec_2 = vec_splat_u32(2);
- const vector unsigned int vec_1 = vec_splat_u32(1);
-
- src0 = vec_ld( 0, block);
- src1 = vec_ld( 16, block);
- src2 = vec_ld( 32, block);
- src3 = vec_ld( 48, block);
- src4 = vec_ld( 64, block);
- src5 = vec_ld( 80, block);
- src6 = vec_ld( 96, block);
- src7 = vec_ld(112, block);
-
- TRANSPOSE8(src0, src1, src2, src3, src4, src5, src6, src7);
- s0 = vec_unpackl(src0);
- s1 = vec_unpackl(src1);
- s2 = vec_unpackl(src2);
- s3 = vec_unpackl(src3);
- s4 = vec_unpackl(src4);
- s5 = vec_unpackl(src5);
- s6 = vec_unpackl(src6);
- s7 = vec_unpackl(src7);
- s8 = vec_unpackh(src0);
- s9 = vec_unpackh(src1);
- sA = vec_unpackh(src2);
- sB = vec_unpackh(src3);
- sC = vec_unpackh(src4);
- sD = vec_unpackh(src5);
- sE = vec_unpackh(src6);
- sF = vec_unpackh(src7);
- STEP8(s0, s1, s2, s3, s4, s5, s6, s7, vec_4s);
- SHIFT_HOR8(s0, s1, s2, s3, s4, s5, s6, s7);
- STEP8(s8, s9, sA, sB, sC, sD, sE, sF, vec_4s);
- SHIFT_HOR8(s8, s9, sA, sB, sC, sD, sE, sF);
- src0 = vec_pack(s8, s0);
- src1 = vec_pack(s9, s1);
- src2 = vec_pack(sA, s2);
- src3 = vec_pack(sB, s3);
- src4 = vec_pack(sC, s4);
- src5 = vec_pack(sD, s5);
- src6 = vec_pack(sE, s6);
- src7 = vec_pack(sF, s7);
- TRANSPOSE8(src0, src1, src2, src3, src4, src5, src6, src7);
-
- if(!n){ // upper half of block
- s0 = vec_unpackh(src0);
- s1 = vec_unpackh(src1);
- s2 = vec_unpackh(src2);
- s3 = vec_unpackh(src3);
- s8 = vec_unpackl(src0);
- s9 = vec_unpackl(src1);
- sA = vec_unpackl(src2);
- sB = vec_unpackl(src3);
- STEP4(s0, s1, s2, s3, vec_64);
- SHIFT_VERT4(s0, s1, s2, s3);
- STEP4(s8, s9, sA, sB, vec_64);
- SHIFT_VERT4(s8, s9, sA, sB);
- src0 = vec_pack(s0, s8);
- src1 = vec_pack(s1, s9);
- src2 = vec_pack(s2, sA);
- src3 = vec_pack(s3, sB);
-
- vec_st(src0, 0, block);
- vec_st(src1, 16, block);
- vec_st(src2, 32, block);
- vec_st(src3, 48, block);
- } else { //lower half of block
- s0 = vec_unpackh(src4);
- s1 = vec_unpackh(src5);
- s2 = vec_unpackh(src6);
- s3 = vec_unpackh(src7);
- s8 = vec_unpackl(src4);
- s9 = vec_unpackl(src5);
- sA = vec_unpackl(src6);
- sB = vec_unpackl(src7);
- STEP4(s0, s1, s2, s3, vec_64);
- SHIFT_VERT4(s0, s1, s2, s3);
- STEP4(s8, s9, sA, sB, vec_64);
- SHIFT_VERT4(s8, s9, sA, sB);
- src4 = vec_pack(s0, s8);
- src5 = vec_pack(s1, s9);
- src6 = vec_pack(s2, sA);
- src7 = vec_pack(s3, sB);
-
- vec_st(src4, 64, block);
- vec_st(src5, 80, block);
- vec_st(src6, 96, block);
- vec_st(src7,112, block);
- }
-}
-
-
-void vc1dsp_init_altivec(DSPContext* dsp, AVCodecContext *avctx) {
- dsp->vc1_inv_trans_8x8 = vc1_inv_trans_8x8_altivec;
- dsp->vc1_inv_trans_8x4 = vc1_inv_trans_8x4_altivec;
-}
diff --git a/src/libffmpeg/libavcodec/qdm2.c b/src/libffmpeg/libavcodec/qdm2.c
deleted file mode 100644
index a2630fe7f..000000000
--- a/src/libffmpeg/libavcodec/qdm2.c
+++ /dev/null
@@ -1,2042 +0,0 @@
-/*
- * QDM2 compatible decoder
- * Copyright (c) 2003 Ewald Snel
- * Copyright (c) 2005 Benjamin Larsson
- * Copyright (c) 2005 Alex Beregszaszi
- * Copyright (c) 2005 Roberto Togni
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file qdm2.c
- * QDM2 decoder
- * @author Ewald Snel, Benjamin Larsson, Alex Beregszaszi, Roberto Togni
- * The decoder is not perfect yet, there are still some distortions
- * especially on files encoded with 16 or 8 subbands.
- */
-
-#include <math.h>
-#include <stddef.h>
-#include <stdio.h>
-
-#define ALT_BITSTREAM_READER_LE
-#include "avcodec.h"
-#include "bitstream.h"
-#include "dsputil.h"
-
-#ifdef CONFIG_MPEGAUDIO_HP
-#define USE_HIGHPRECISION
-#endif
-
-#include "mpegaudio.h"
-
-#include "qdm2data.h"
-
-#undef NDEBUG
-#include <assert.h>
-
-
-#define SOFTCLIP_THRESHOLD 27600
-#define HARDCLIP_THRESHOLD 35716
-
-
-#define QDM2_LIST_ADD(list, size, packet) \
-do { \
- if (size > 0) { \
- list[size - 1].next = &list[size]; \
- } \
- list[size].packet = packet; \
- list[size].next = NULL; \
- size++; \
-} while(0)
-
-// Result is 8, 16 or 30
-#define QDM2_SB_USED(sub_sampling) (((sub_sampling) >= 2) ? 30 : 8 << (sub_sampling))
-
-#define FIX_NOISE_IDX(noise_idx) \
- if ((noise_idx) >= 3840) \
- (noise_idx) -= 3840; \
-
-#define SB_DITHERING_NOISE(sb,noise_idx) (noise_table[(noise_idx)++] * sb_noise_attenuation[(sb)])
-
-#define BITS_LEFT(length,gb) ((length) - get_bits_count ((gb)))
-
-#define SAMPLES_NEEDED \
- av_log (NULL,AV_LOG_INFO,"This file triggers some untested code. Please contact the developers.\n");
-
-#define SAMPLES_NEEDED_2(why) \
- av_log (NULL,AV_LOG_INFO,"This file triggers some missing code. Please contact the developers.\nPosition: %s\n",why);
-
-
-typedef int8_t sb_int8_array[2][30][64];
-
-/**
- * Subpacket
- */
-typedef struct {
- int type; ///< subpacket type
- unsigned int size; ///< subpacket size
- const uint8_t *data; ///< pointer to subpacket data (points to input data buffer, it's not a private copy)
-} QDM2SubPacket;
-
-/**
- * A node in the subpacket list
- */
-typedef struct _QDM2SubPNode {
- QDM2SubPacket *packet; ///< packet
- struct _QDM2SubPNode *next; ///< pointer to next packet in the list, NULL if leaf node
-} QDM2SubPNode;
-
-typedef struct {
- float level;
- float *samples_im;
- float *samples_re;
- float *table;
- int phase;
- int phase_shift;
- int duration;
- short time_index;
- short cutoff;
-} FFTTone;
-
-typedef struct {
- int16_t sub_packet;
- uint8_t channel;
- int16_t offset;
- int16_t exp;
- uint8_t phase;
-} FFTCoefficient;
-
-typedef struct {
- float re;
- float im;
-} QDM2Complex;
-
-typedef struct {
- QDM2Complex complex[256 + 1] __attribute__((aligned(16)));
- float samples_im[MPA_MAX_CHANNELS][256];
- float samples_re[MPA_MAX_CHANNELS][256];
-} QDM2FFT;
-
-/**
- * QDM2 decoder context
- */
-typedef struct {
- /// Parameters from codec header, do not change during playback
- int nb_channels; ///< number of channels
- int channels; ///< number of channels
- int group_size; ///< size of frame group (16 frames per group)
- int fft_size; ///< size of FFT, in complex numbers
- int checksum_size; ///< size of data block, used also for checksum
-
- /// Parameters built from header parameters, do not change during playback
- int group_order; ///< order of frame group
- int fft_order; ///< order of FFT (actually fftorder+1)
- int fft_frame_size; ///< size of fft frame, in components (1 comples = re + im)
- int frame_size; ///< size of data frame
- int frequency_range;
- int sub_sampling; ///< subsampling: 0=25%, 1=50%, 2=100% */
- int coeff_per_sb_select; ///< selector for "num. of coeffs. per subband" tables. Can be 0, 1, 2
- int cm_table_select; ///< selector for "coding method" tables. Can be 0, 1 (from init: 0-4)
-
- /// Packets and packet lists
- QDM2SubPacket sub_packets[16]; ///< the packets themselves
- QDM2SubPNode sub_packet_list_A[16]; ///< list of all packets
- QDM2SubPNode sub_packet_list_B[16]; ///< FFT packets B are on list
- int sub_packets_B; ///< number of packets on 'B' list
- QDM2SubPNode sub_packet_list_C[16]; ///< packets with errors?
- QDM2SubPNode sub_packet_list_D[16]; ///< DCT packets
-
- /// FFT and tones
- FFTTone fft_tones[1000];
- int fft_tone_start;
- int fft_tone_end;
- FFTCoefficient fft_coefs[1000];
- int fft_coefs_index;
- int fft_coefs_min_index[5];
- int fft_coefs_max_index[5];
- int fft_level_exp[6];
- FFTContext fft_ctx;
- FFTComplex exptab[128];
- QDM2FFT fft;
-
- /// I/O data
- uint8_t *compressed_data;
- int compressed_size;
- float output_buffer[1024];
-
- /// Synthesis filter
- MPA_INT synth_buf[MPA_MAX_CHANNELS][512*2] __attribute__((aligned(16)));
- int synth_buf_offset[MPA_MAX_CHANNELS];
- int32_t sb_samples[MPA_MAX_CHANNELS][128][SBLIMIT] __attribute__((aligned(16)));
-
- /// Mixed temporary data used in decoding
- float tone_level[MPA_MAX_CHANNELS][30][64];
- int8_t coding_method[MPA_MAX_CHANNELS][30][64];
- int8_t quantized_coeffs[MPA_MAX_CHANNELS][10][8];
- int8_t tone_level_idx_base[MPA_MAX_CHANNELS][30][8];
- int8_t tone_level_idx_hi1[MPA_MAX_CHANNELS][3][8][8];
- int8_t tone_level_idx_mid[MPA_MAX_CHANNELS][26][8];
- int8_t tone_level_idx_hi2[MPA_MAX_CHANNELS][26];
- int8_t tone_level_idx[MPA_MAX_CHANNELS][30][64];
- int8_t tone_level_idx_temp[MPA_MAX_CHANNELS][30][64];
-
- // Flags
- int has_errors; ///< packet has errors
- int superblocktype_2_3; ///< select fft tables and some algorithm based on superblock type
- int do_synth_filter; ///< used to perform or skip synthesis filter
-
- int sub_packet;
- int noise_idx; ///< index for dithering noise table
-} QDM2Context;
-
-
-static uint8_t empty_buffer[FF_INPUT_BUFFER_PADDING_SIZE];
-
-static VLC vlc_tab_level;
-static VLC vlc_tab_diff;
-static VLC vlc_tab_run;
-static VLC fft_level_exp_alt_vlc;
-static VLC fft_level_exp_vlc;
-static VLC fft_stereo_exp_vlc;
-static VLC fft_stereo_phase_vlc;
-static VLC vlc_tab_tone_level_idx_hi1;
-static VLC vlc_tab_tone_level_idx_mid;
-static VLC vlc_tab_tone_level_idx_hi2;
-static VLC vlc_tab_type30;
-static VLC vlc_tab_type34;
-static VLC vlc_tab_fft_tone_offset[5];
-
-static uint16_t softclip_table[HARDCLIP_THRESHOLD - SOFTCLIP_THRESHOLD + 1];
-static float noise_table[4096];
-static uint8_t random_dequant_index[256][5];
-static uint8_t random_dequant_type24[128][3];
-static float noise_samples[128];
-
-static MPA_INT mpa_window[512] __attribute__((aligned(16)));
-
-
-static void softclip_table_init(void) {
- int i;
- double dfl = SOFTCLIP_THRESHOLD - 32767;
- float delta = 1.0 / -dfl;
- for (i = 0; i < HARDCLIP_THRESHOLD - SOFTCLIP_THRESHOLD + 1; i++)
- softclip_table[i] = SOFTCLIP_THRESHOLD - ((int)(sin((float)i * delta) * dfl) & 0x0000FFFF);
-}
-
-
-// random generated table
-static void rnd_table_init(void) {
- int i,j;
- uint32_t ldw,hdw;
- uint64_t tmp64_1;
- uint64_t random_seed = 0;
- float delta = 1.0 / 16384.0;
- for(i = 0; i < 4096 ;i++) {
- random_seed = random_seed * 214013 + 2531011;
- noise_table[i] = (delta * (float)(((int32_t)random_seed >> 16) & 0x00007FFF)- 1.0) * 1.3;
- }
-
- for (i = 0; i < 256 ;i++) {
- random_seed = 81;
- ldw = i;
- for (j = 0; j < 5 ;j++) {
- random_dequant_index[i][j] = (uint8_t)((ldw / random_seed) & 0xFF);
- ldw = (uint32_t)ldw % (uint32_t)random_seed;
- tmp64_1 = (random_seed * 0x55555556);
- hdw = (uint32_t)(tmp64_1 >> 32);
- random_seed = (uint64_t)(hdw + (ldw >> 31));
- }
- }
- for (i = 0; i < 128 ;i++) {
- random_seed = 25;
- ldw = i;
- for (j = 0; j < 3 ;j++) {
- random_dequant_type24[i][j] = (uint8_t)((ldw / random_seed) & 0xFF);
- ldw = (uint32_t)ldw % (uint32_t)random_seed;
- tmp64_1 = (random_seed * 0x66666667);
- hdw = (uint32_t)(tmp64_1 >> 33);
- random_seed = hdw + (ldw >> 31);
- }
- }
-}
-
-
-static void init_noise_samples(void) {
- int i;
- int random_seed = 0;
- float delta = 1.0 / 16384.0;
- for (i = 0; i < 128;i++) {
- random_seed = random_seed * 214013 + 2531011;
- noise_samples[i] = (delta * (float)((random_seed >> 16) & 0x00007fff) - 1.0);
- }
-}
-
-
-static void qdm2_init_vlc(void)
-{
- init_vlc (&vlc_tab_level, 8, 24,
- vlc_tab_level_huffbits, 1, 1,
- vlc_tab_level_huffcodes, 2, 2, INIT_VLC_USE_STATIC | INIT_VLC_LE);
-
- init_vlc (&vlc_tab_diff, 8, 37,
- vlc_tab_diff_huffbits, 1, 1,
- vlc_tab_diff_huffcodes, 2, 2, INIT_VLC_USE_STATIC | INIT_VLC_LE);
-
- init_vlc (&vlc_tab_run, 5, 6,
- vlc_tab_run_huffbits, 1, 1,
- vlc_tab_run_huffcodes, 1, 1, INIT_VLC_USE_STATIC | INIT_VLC_LE);
-
- init_vlc (&fft_level_exp_alt_vlc, 8, 28,
- fft_level_exp_alt_huffbits, 1, 1,
- fft_level_exp_alt_huffcodes, 2, 2, INIT_VLC_USE_STATIC | INIT_VLC_LE);
-
- init_vlc (&fft_level_exp_vlc, 8, 20,
- fft_level_exp_huffbits, 1, 1,
- fft_level_exp_huffcodes, 2, 2, INIT_VLC_USE_STATIC | INIT_VLC_LE);
-
- init_vlc (&fft_stereo_exp_vlc, 6, 7,
- fft_stereo_exp_huffbits, 1, 1,
- fft_stereo_exp_huffcodes, 1, 1, INIT_VLC_USE_STATIC | INIT_VLC_LE);
-
- init_vlc (&fft_stereo_phase_vlc, 6, 9,
- fft_stereo_phase_huffbits, 1, 1,
- fft_stereo_phase_huffcodes, 1, 1, INIT_VLC_USE_STATIC | INIT_VLC_LE);
-
- init_vlc (&vlc_tab_tone_level_idx_hi1, 8, 20,
- vlc_tab_tone_level_idx_hi1_huffbits, 1, 1,
- vlc_tab_tone_level_idx_hi1_huffcodes, 2, 2, INIT_VLC_USE_STATIC | INIT_VLC_LE);
-
- init_vlc (&vlc_tab_tone_level_idx_mid, 8, 24,
- vlc_tab_tone_level_idx_mid_huffbits, 1, 1,
- vlc_tab_tone_level_idx_mid_huffcodes, 2, 2, INIT_VLC_USE_STATIC | INIT_VLC_LE);
-
- init_vlc (&vlc_tab_tone_level_idx_hi2, 8, 24,
- vlc_tab_tone_level_idx_hi2_huffbits, 1, 1,
- vlc_tab_tone_level_idx_hi2_huffcodes, 2, 2, INIT_VLC_USE_STATIC | INIT_VLC_LE);
-
- init_vlc (&vlc_tab_type30, 6, 9,
- vlc_tab_type30_huffbits, 1, 1,
- vlc_tab_type30_huffcodes, 1, 1, INIT_VLC_USE_STATIC | INIT_VLC_LE);
-
- init_vlc (&vlc_tab_type34, 5, 10,
- vlc_tab_type34_huffbits, 1, 1,
- vlc_tab_type34_huffcodes, 1, 1, INIT_VLC_USE_STATIC | INIT_VLC_LE);
-
- init_vlc (&vlc_tab_fft_tone_offset[0], 8, 23,
- vlc_tab_fft_tone_offset_0_huffbits, 1, 1,
- vlc_tab_fft_tone_offset_0_huffcodes, 2, 2, INIT_VLC_USE_STATIC | INIT_VLC_LE);
-
- init_vlc (&vlc_tab_fft_tone_offset[1], 8, 28,
- vlc_tab_fft_tone_offset_1_huffbits, 1, 1,
- vlc_tab_fft_tone_offset_1_huffcodes, 2, 2, INIT_VLC_USE_STATIC | INIT_VLC_LE);
-
- init_vlc (&vlc_tab_fft_tone_offset[2], 8, 32,
- vlc_tab_fft_tone_offset_2_huffbits, 1, 1,
- vlc_tab_fft_tone_offset_2_huffcodes, 2, 2, INIT_VLC_USE_STATIC | INIT_VLC_LE);
-
- init_vlc (&vlc_tab_fft_tone_offset[3], 8, 35,
- vlc_tab_fft_tone_offset_3_huffbits, 1, 1,
- vlc_tab_fft_tone_offset_3_huffcodes, 2, 2, INIT_VLC_USE_STATIC | INIT_VLC_LE);
-
- init_vlc (&vlc_tab_fft_tone_offset[4], 8, 38,
- vlc_tab_fft_tone_offset_4_huffbits, 1, 1,
- vlc_tab_fft_tone_offset_4_huffcodes, 2, 2, INIT_VLC_USE_STATIC | INIT_VLC_LE);
-}
-
-
-/* for floating point to fixed point conversion */
-static float f2i_scale = (float) (1 << (FRAC_BITS - 15));
-
-
-static int qdm2_get_vlc (GetBitContext *gb, VLC *vlc, int flag, int depth)
-{
- int value;
-
- value = get_vlc2(gb, vlc->table, vlc->bits, depth);
-
- /* stage-2, 3 bits exponent escape sequence */
- if (value-- == 0)
- value = get_bits (gb, get_bits (gb, 3) + 1);
-
- /* stage-3, optional */
- if (flag) {
- int tmp = vlc_stage3_values[value];
-
- if ((value & ~3) > 0)
- tmp += get_bits (gb, (value >> 2));
- value = tmp;
- }
-
- return value;
-}
-
-
-static int qdm2_get_se_vlc (VLC *vlc, GetBitContext *gb, int depth)
-{
- int value = qdm2_get_vlc (gb, vlc, 0, depth);
-
- return (value & 1) ? ((value + 1) >> 1) : -(value >> 1);
-}
-
-
-/**
- * QDM2 checksum
- *
- * @param data pointer to data to be checksum'ed
- * @param length data length
- * @param value checksum value
- *
- * @return 0 if checksum is OK
- */
-static uint16_t qdm2_packet_checksum (uint8_t *data, int length, int value) {
- int i;
-
- for (i=0; i < length; i++)
- value -= data[i];
-
- return (uint16_t)(value & 0xffff);
-}
-
-
-/**
- * Fills a QDM2SubPacket structure with packet type, size, and data pointer.
- *
- * @param gb bitreader context
- * @param sub_packet packet under analysis
- */
-static void qdm2_decode_sub_packet_header (GetBitContext *gb, QDM2SubPacket *sub_packet)
-{
- sub_packet->type = get_bits (gb, 8);
-
- if (sub_packet->type == 0) {
- sub_packet->size = 0;
- sub_packet->data = NULL;
- } else {
- sub_packet->size = get_bits (gb, 8);
-
- if (sub_packet->type & 0x80) {
- sub_packet->size <<= 8;
- sub_packet->size |= get_bits (gb, 8);
- sub_packet->type &= 0x7f;
- }
-
- if (sub_packet->type == 0x7f)
- sub_packet->type |= (get_bits (gb, 8) << 8);
-
- sub_packet->data = &gb->buffer[get_bits_count(gb) / 8]; // FIXME: this depends on bitreader internal data
- }
-
- av_log(NULL,AV_LOG_DEBUG,"Subpacket: type=%d size=%d start_offs=%x\n",
- sub_packet->type, sub_packet->size, get_bits_count(gb) / 8);
-}
-
-
-/**
- * Return node pointer to first packet of requested type in list.
- *
- * @param list list of subpackets to be scanned
- * @param type type of searched subpacket
- * @return node pointer for subpacket if found, else NULL
- */
-static QDM2SubPNode* qdm2_search_subpacket_type_in_list (QDM2SubPNode *list, int type)
-{
- while (list != NULL && list->packet != NULL) {
- if (list->packet->type == type)
- return list;
- list = list->next;
- }
- return NULL;
-}
-
-
-/**
- * Replaces 8 elements with their average value.
- * Called by qdm2_decode_superblock before starting subblock decoding.
- *
- * @param q context
- */
-static void average_quantized_coeffs (QDM2Context *q)
-{
- int i, j, n, ch, sum;
-
- n = coeff_per_sb_for_avg[q->coeff_per_sb_select][QDM2_SB_USED(q->sub_sampling) - 1] + 1;
-
- for (ch = 0; ch < q->nb_channels; ch++)
- for (i = 0; i < n; i++) {
- sum = 0;
-
- for (j = 0; j < 8; j++)
- sum += q->quantized_coeffs[ch][i][j];
-
- sum /= 8;
- if (sum > 0)
- sum--;
-
- for (j=0; j < 8; j++)
- q->quantized_coeffs[ch][i][j] = sum;
- }
-}
-
-
-/**
- * Build subband samples with noise weighted by q->tone_level.
- * Called by synthfilt_build_sb_samples.
- *
- * @param q context
- * @param sb subband index
- */
-static void build_sb_samples_from_noise (QDM2Context *q, int sb)
-{
- int ch, j;
-
- FIX_NOISE_IDX(q->noise_idx);
-
- if (!q->nb_channels)
- return;
-
- for (ch = 0; ch < q->nb_channels; ch++)
- for (j = 0; j < 64; j++) {
- q->sb_samples[ch][j * 2][sb] = (int32_t)(f2i_scale * SB_DITHERING_NOISE(sb,q->noise_idx) * q->tone_level[ch][sb][j] + .5);
- q->sb_samples[ch][j * 2 + 1][sb] = (int32_t)(f2i_scale * SB_DITHERING_NOISE(sb,q->noise_idx) * q->tone_level[ch][sb][j] + .5);
- }
-}
-
-
-/**
- * Called while processing data from subpackets 11 and 12.
- * Used after making changes to coding_method array.
- *
- * @param sb subband index
- * @param channels number of channels
- * @param coding_method q->coding_method[0][0][0]
- */
-static void fix_coding_method_array (int sb, int channels, sb_int8_array coding_method)
-{
- int j,k;
- int ch;
- int run, case_val;
- int switchtable[23] = {0,5,1,5,5,5,5,5,2,5,5,5,5,5,5,5,3,5,5,5,5,5,4};
-
- for (ch = 0; ch < channels; ch++) {
- for (j = 0; j < 64; ) {
- if((coding_method[ch][sb][j] - 8) > 22) {
- run = 1;
- case_val = 8;
- } else {
- switch (switchtable[coding_method[ch][sb][j]-8]) {
- case 0: run = 10; case_val = 10; break;
- case 1: run = 1; case_val = 16; break;
- case 2: run = 5; case_val = 24; break;
- case 3: run = 3; case_val = 30; break;
- case 4: run = 1; case_val = 30; break;
- case 5: run = 1; case_val = 8; break;
- default: run = 1; case_val = 8; break;
- }
- }
- for (k = 0; k < run; k++)
- if (j + k < 128)
- if (coding_method[ch][sb + (j + k) / 64][(j + k) % 64] > coding_method[ch][sb][j])
- if (k > 0) {
- SAMPLES_NEEDED
- //not debugged, almost never used
- memset(&coding_method[ch][sb][j + k], case_val, k * sizeof(int8_t));
- memset(&coding_method[ch][sb][j + k], case_val, 3 * sizeof(int8_t));
- }
- j += run;
- }
- }
-}
-
-
-/**
- * Related to synthesis filter
- * Called by process_subpacket_10
- *
- * @param q context
- * @param flag 1 if called after getting data from subpacket 10, 0 if no subpacket 10
- */
-static void fill_tone_level_array (QDM2Context *q, int flag)
-{
- int i, sb, ch, sb_used;
- int tmp, tab;
-
- // This should never happen
- if (q->nb_channels <= 0)
- return;
-
- for (ch = 0; ch < q->nb_channels; ch++)
- for (sb = 0; sb < 30; sb++)
- for (i = 0; i < 8; i++) {
- if ((tab=coeff_per_sb_for_dequant[q->coeff_per_sb_select][sb]) < (last_coeff[q->coeff_per_sb_select] - 1))
- tmp = q->quantized_coeffs[ch][tab + 1][i] * dequant_table[q->coeff_per_sb_select][tab + 1][sb]+
- q->quantized_coeffs[ch][tab][i] * dequant_table[q->coeff_per_sb_select][tab][sb];
- else
- tmp = q->quantized_coeffs[ch][tab][i] * dequant_table[q->coeff_per_sb_select][tab][sb];
- if(tmp < 0)
- tmp += 0xff;
- q->tone_level_idx_base[ch][sb][i] = (tmp / 256) & 0xff;
- }
-
- sb_used = QDM2_SB_USED(q->sub_sampling);
-
- if ((q->superblocktype_2_3 != 0) && !flag) {
- for (sb = 0; sb < sb_used; sb++)
- for (ch = 0; ch < q->nb_channels; ch++)
- for (i = 0; i < 64; i++) {
- q->tone_level_idx[ch][sb][i] = q->tone_level_idx_base[ch][sb][i / 8];
- if (q->tone_level_idx[ch][sb][i] < 0)
- q->tone_level[ch][sb][i] = 0;
- else
- q->tone_level[ch][sb][i] = fft_tone_level_table[0][q->tone_level_idx[ch][sb][i] & 0x3f];
- }
- } else {
- tab = q->superblocktype_2_3 ? 0 : 1;
- for (sb = 0; sb < sb_used; sb++) {
- if ((sb >= 4) && (sb <= 23)) {
- for (ch = 0; ch < q->nb_channels; ch++)
- for (i = 0; i < 64; i++) {
- tmp = q->tone_level_idx_base[ch][sb][i / 8] -
- q->tone_level_idx_hi1[ch][sb / 8][i / 8][i % 8] -
- q->tone_level_idx_mid[ch][sb - 4][i / 8] -
- q->tone_level_idx_hi2[ch][sb - 4];
- q->tone_level_idx[ch][sb][i] = tmp & 0xff;
- if ((tmp < 0) || (!q->superblocktype_2_3 && !tmp))
- q->tone_level[ch][sb][i] = 0;
- else
- q->tone_level[ch][sb][i] = fft_tone_level_table[tab][tmp & 0x3f];
- }
- } else {
- if (sb > 4) {
- for (ch = 0; ch < q->nb_channels; ch++)
- for (i = 0; i < 64; i++) {
- tmp = q->tone_level_idx_base[ch][sb][i / 8] -
- q->tone_level_idx_hi1[ch][2][i / 8][i % 8] -
- q->tone_level_idx_hi2[ch][sb - 4];
- q->tone_level_idx[ch][sb][i] = tmp & 0xff;
- if ((tmp < 0) || (!q->superblocktype_2_3 && !tmp))
- q->tone_level[ch][sb][i] = 0;
- else
- q->tone_level[ch][sb][i] = fft_tone_level_table[tab][tmp & 0x3f];
- }
- } else {
- for (ch = 0; ch < q->nb_channels; ch++)
- for (i = 0; i < 64; i++) {
- tmp = q->tone_level_idx[ch][sb][i] = q->tone_level_idx_base[ch][sb][i / 8];
- if ((tmp < 0) || (!q->superblocktype_2_3 && !tmp))
- q->tone_level[ch][sb][i] = 0;
- else
- q->tone_level[ch][sb][i] = fft_tone_level_table[tab][tmp & 0x3f];
- }
- }
- }
- }
- }
-
- return;
-}
-
-
-/**
- * Related to synthesis filter
- * Called by process_subpacket_11
- * c is built with data from subpacket 11
- * Most of this function is used only if superblock_type_2_3 == 0, never seen it in samples
- *
- * @param tone_level_idx
- * @param tone_level_idx_temp
- * @param coding_method q->coding_method[0][0][0]
- * @param nb_channels number of channels
- * @param c coming from subpacket 11, passed as 8*c
- * @param superblocktype_2_3 flag based on superblock packet type
- * @param cm_table_select q->cm_table_select
- */
-static void fill_coding_method_array (sb_int8_array tone_level_idx, sb_int8_array tone_level_idx_temp,
- sb_int8_array coding_method, int nb_channels,
- int c, int superblocktype_2_3, int cm_table_select)
-{
- int ch, sb, j;
- int tmp, acc, esp_40, comp;
- int add1, add2, add3, add4;
- int64_t multres;
-
- // This should never happen
- if (nb_channels <= 0)
- return;
-
- if (!superblocktype_2_3) {
- /* This case is untested, no samples available */
- SAMPLES_NEEDED
- for (ch = 0; ch < nb_channels; ch++)
- for (sb = 0; sb < 30; sb++) {
- for (j = 1; j < 64; j++) {
- add1 = tone_level_idx[ch][sb][j] - 10;
- if (add1 < 0)
- add1 = 0;
- add2 = add3 = add4 = 0;
- if (sb > 1) {
- add2 = tone_level_idx[ch][sb - 2][j] + tone_level_idx_offset_table[sb][0] - 6;
- if (add2 < 0)
- add2 = 0;
- }
- if (sb > 0) {
- add3 = tone_level_idx[ch][sb - 1][j] + tone_level_idx_offset_table[sb][1] - 6;
- if (add3 < 0)
- add3 = 0;
- }
- if (sb < 29) {
- add4 = tone_level_idx[ch][sb + 1][j] + tone_level_idx_offset_table[sb][3] - 6;
- if (add4 < 0)
- add4 = 0;
- }
- tmp = tone_level_idx[ch][sb][j + 1] * 2 - add4 - add3 - add2 - add1;
- if (tmp < 0)
- tmp = 0;
- tone_level_idx_temp[ch][sb][j + 1] = tmp & 0xff;
- }
- tone_level_idx_temp[ch][sb][0] = tone_level_idx_temp[ch][sb][1];
- }
- acc = 0;
- for (ch = 0; ch < nb_channels; ch++)
- for (sb = 0; sb < 30; sb++)
- for (j = 0; j < 64; j++)
- acc += tone_level_idx_temp[ch][sb][j];
- if (acc)
- tmp = c * 256 / (acc & 0xffff);
- multres = 0x66666667 * (acc * 10);
- esp_40 = (multres >> 32) / 8 + ((multres & 0xffffffff) >> 31);
- for (ch = 0; ch < nb_channels; ch++)
- for (sb = 0; sb < 30; sb++)
- for (j = 0; j < 64; j++) {
- comp = tone_level_idx_temp[ch][sb][j]* esp_40 * 10;
- if (comp < 0)
- comp += 0xff;
- comp /= 256; // signed shift
- switch(sb) {
- case 0:
- if (comp < 30)
- comp = 30;
- comp += 15;
- break;
- case 1:
- if (comp < 24)
- comp = 24;
- comp += 10;
- break;
- case 2:
- case 3:
- case 4:
- if (comp < 16)
- comp = 16;
- }
- if (comp <= 5)
- tmp = 0;
- else if (comp <= 10)
- tmp = 10;
- else if (comp <= 16)
- tmp = 16;
- else if (comp <= 24)
- tmp = -1;
- else
- tmp = 0;
- coding_method[ch][sb][j] = ((tmp & 0xfffa) + 30 )& 0xff;
- }
- for (sb = 0; sb < 30; sb++)
- fix_coding_method_array(sb, nb_channels, coding_method);
- for (ch = 0; ch < nb_channels; ch++)
- for (sb = 0; sb < 30; sb++)
- for (j = 0; j < 64; j++)
- if (sb >= 10) {
- if (coding_method[ch][sb][j] < 10)
- coding_method[ch][sb][j] = 10;
- } else {
- if (sb >= 2) {
- if (coding_method[ch][sb][j] < 16)
- coding_method[ch][sb][j] = 16;
- } else {
- if (coding_method[ch][sb][j] < 30)
- coding_method[ch][sb][j] = 30;
- }
- }
- } else { // superblocktype_2_3 != 0
- for (ch = 0; ch < nb_channels; ch++)
- for (sb = 0; sb < 30; sb++)
- for (j = 0; j < 64; j++)
- coding_method[ch][sb][j] = coding_method_table[cm_table_select][sb];
- }
-
- return;
-}
-
-
-/**
- *
- * Called by process_subpacket_11 to process more data from subpacket 11 with sb 0-8
- * Called by process_subpacket_12 to process data from subpacket 12 with sb 8-sb_used
- *
- * @param q context
- * @param gb bitreader context
- * @param length packet length in bits
- * @param sb_min lower subband processed (sb_min included)
- * @param sb_max higher subband processed (sb_max excluded)
- */
-static void synthfilt_build_sb_samples (QDM2Context *q, GetBitContext *gb, int length, int sb_min, int sb_max)
-{
- int sb, j, k, n, ch, run, channels;
- int joined_stereo, zero_encoding, chs;
- int type34_first;
- float type34_div = 0;
- float type34_predictor;
- float samples[10], sign_bits[16];
-
- if (length == 0) {
- // If no data use noise
- for (sb=sb_min; sb < sb_max; sb++)
- build_sb_samples_from_noise (q, sb);
-
- return;
- }
-
- for (sb = sb_min; sb < sb_max; sb++) {
- FIX_NOISE_IDX(q->noise_idx);
-
- channels = q->nb_channels;
-
- if (q->nb_channels <= 1 || sb < 12)
- joined_stereo = 0;
- else if (sb >= 24)
- joined_stereo = 1;
- else
- joined_stereo = (BITS_LEFT(length,gb) >= 1) ? get_bits1 (gb) : 0;
-
- if (joined_stereo) {
- if (BITS_LEFT(length,gb) >= 16)
- for (j = 0; j < 16; j++)
- sign_bits[j] = get_bits1 (gb);
-
- for (j = 0; j < 64; j++)
- if (q->coding_method[1][sb][j] > q->coding_method[0][sb][j])
- q->coding_method[0][sb][j] = q->coding_method[1][sb][j];
-
- fix_coding_method_array(sb, q->nb_channels, q->coding_method);
- channels = 1;
- }
-
- for (ch = 0; ch < channels; ch++) {
- zero_encoding = (BITS_LEFT(length,gb) >= 1) ? get_bits1(gb) : 0;
- type34_predictor = 0.0;
- type34_first = 1;
-
- for (j = 0; j < 128; ) {
- switch (q->coding_method[ch][sb][j / 2]) {
- case 8:
- if (BITS_LEFT(length,gb) >= 10) {
- if (zero_encoding) {
- for (k = 0; k < 5; k++) {
- if ((j + 2 * k) >= 128)
- break;
- samples[2 * k] = get_bits1(gb) ? dequant_1bit[joined_stereo][2 * get_bits1(gb)] : 0;
- }
- } else {
- n = get_bits(gb, 8);
- for (k = 0; k < 5; k++)
- samples[2 * k] = dequant_1bit[joined_stereo][random_dequant_index[n][k]];
- }
- for (k = 0; k < 5; k++)
- samples[2 * k + 1] = SB_DITHERING_NOISE(sb,q->noise_idx);
- } else {
- for (k = 0; k < 10; k++)
- samples[k] = SB_DITHERING_NOISE(sb,q->noise_idx);
- }
- run = 10;
- break;
-
- case 10:
- if (BITS_LEFT(length,gb) >= 1) {
- float f = 0.81;
-
- if (get_bits1(gb))
- f = -f;
- f -= noise_samples[((sb + 1) * (j +5 * ch + 1)) & 127] * 9.0 / 40.0;
- samples[0] = f;
- } else {
- samples[0] = SB_DITHERING_NOISE(sb,q->noise_idx);
- }
- run = 1;
- break;
-
- case 16:
- if (BITS_LEFT(length,gb) >= 10) {
- if (zero_encoding) {
- for (k = 0; k < 5; k++) {
- if ((j + k) >= 128)
- break;
- samples[k] = (get_bits1(gb) == 0) ? 0 : dequant_1bit[joined_stereo][2 * get_bits1(gb)];
- }
- } else {
- n = get_bits (gb, 8);
- for (k = 0; k < 5; k++)
- samples[k] = dequant_1bit[joined_stereo][random_dequant_index[n][k]];
- }
- } else {
- for (k = 0; k < 5; k++)
- samples[k] = SB_DITHERING_NOISE(sb,q->noise_idx);
- }
- run = 5;
- break;
-
- case 24:
- if (BITS_LEFT(length,gb) >= 7) {
- n = get_bits(gb, 7);
- for (k = 0; k < 3; k++)
- samples[k] = (random_dequant_type24[n][k] - 2.0) * 0.5;
- } else {
- for (k = 0; k < 3; k++)
- samples[k] = SB_DITHERING_NOISE(sb,q->noise_idx);
- }
- run = 3;
- break;
-
- case 30:
- if (BITS_LEFT(length,gb) >= 4)
- samples[0] = type30_dequant[qdm2_get_vlc(gb, &vlc_tab_type30, 0, 1)];
- else
- samples[0] = SB_DITHERING_NOISE(sb,q->noise_idx);
-
- run = 1;
- break;
-
- case 34:
- if (BITS_LEFT(length,gb) >= 7) {
- if (type34_first) {
- type34_div = (float)(1 << get_bits(gb, 2));
- samples[0] = ((float)get_bits(gb, 5) - 16.0) / 15.0;
- type34_predictor = samples[0];
- type34_first = 0;
- } else {
- samples[0] = type34_delta[qdm2_get_vlc(gb, &vlc_tab_type34, 0, 1)] / type34_div + type34_predictor;
- type34_predictor = samples[0];
- }
- } else {
- samples[0] = SB_DITHERING_NOISE(sb,q->noise_idx);
- }
- run = 1;
- break;
-
- default:
- samples[0] = SB_DITHERING_NOISE(sb,q->noise_idx);
- run = 1;
- break;
- }
-
- if (joined_stereo) {
- float tmp[10][MPA_MAX_CHANNELS];
-
- for (k = 0; k < run; k++) {
- tmp[k][0] = samples[k];
- tmp[k][1] = (sign_bits[(j + k) / 8]) ? -samples[k] : samples[k];
- }
- for (chs = 0; chs < q->nb_channels; chs++)
- for (k = 0; k < run; k++)
- if ((j + k) < 128)
- q->sb_samples[chs][j + k][sb] = (int32_t)(f2i_scale * q->tone_level[chs][sb][((j + k)/2)] * tmp[k][chs] + .5);
- } else {
- for (k = 0; k < run; k++)
- if ((j + k) < 128)
- q->sb_samples[ch][j + k][sb] = (int32_t)(f2i_scale * q->tone_level[ch][sb][(j + k)/2] * samples[k] + .5);
- }
-
- j += run;
- } // j loop
- } // channel loop
- } // subband loop
-}
-
-
-/**
- * Init the first element of a channel in quantized_coeffs with data from packet 10 (quantized_coeffs[ch][0]).
- * This is similar to process_subpacket_9, but for a single channel and for element [0]
- * same VLC tables as process_subpacket_9 are used.
- *
- * @param q context
- * @param quantized_coeffs pointer to quantized_coeffs[ch][0]
- * @param gb bitreader context
- * @param length packet length in bits
- */
-static void init_quantized_coeffs_elem0 (int8_t *quantized_coeffs, GetBitContext *gb, int length)
-{
- int i, k, run, level, diff;
-
- if (BITS_LEFT(length,gb) < 16)
- return;
- level = qdm2_get_vlc(gb, &vlc_tab_level, 0, 2);
-
- quantized_coeffs[0] = level;
-
- for (i = 0; i < 7; ) {
- if (BITS_LEFT(length,gb) < 16)
- break;
- run = qdm2_get_vlc(gb, &vlc_tab_run, 0, 1) + 1;
-
- if (BITS_LEFT(length,gb) < 16)
- break;
- diff = qdm2_get_se_vlc(&vlc_tab_diff, gb, 2);
-
- for (k = 1; k <= run; k++)
- quantized_coeffs[i + k] = (level + ((k * diff) / run));
-
- level += diff;
- i += run;
- }
-}
-
-
-/**
- * Related to synthesis filter, process data from packet 10
- * Init part of quantized_coeffs via function init_quantized_coeffs_elem0
- * Init tone_level_idx_hi1, tone_level_idx_hi2, tone_level_idx_mid with data from packet 10
- *
- * @param q context
- * @param gb bitreader context
- * @param length packet length in bits
- */
-static void init_tone_level_dequantization (QDM2Context *q, GetBitContext *gb, int length)
-{
- int sb, j, k, n, ch;
-
- for (ch = 0; ch < q->nb_channels; ch++) {
- init_quantized_coeffs_elem0(q->quantized_coeffs[ch][0], gb, length);
-
- if (BITS_LEFT(length,gb) < 16) {
- memset(q->quantized_coeffs[ch][0], 0, 8);
- break;
- }
- }
-
- n = q->sub_sampling + 1;
-
- for (sb = 0; sb < n; sb++)
- for (ch = 0; ch < q->nb_channels; ch++)
- for (j = 0; j < 8; j++) {
- if (BITS_LEFT(length,gb) < 1)
- break;
- if (get_bits1(gb)) {
- for (k=0; k < 8; k++) {
- if (BITS_LEFT(length,gb) < 16)
- break;
- q->tone_level_idx_hi1[ch][sb][j][k] = qdm2_get_vlc(gb, &vlc_tab_tone_level_idx_hi1, 0, 2);
- }
- } else {
- for (k=0; k < 8; k++)
- q->tone_level_idx_hi1[ch][sb][j][k] = 0;
- }
- }
-
- n = QDM2_SB_USED(q->sub_sampling) - 4;
-
- for (sb = 0; sb < n; sb++)
- for (ch = 0; ch < q->nb_channels; ch++) {
- if (BITS_LEFT(length,gb) < 16)
- break;
- q->tone_level_idx_hi2[ch][sb] = qdm2_get_vlc(gb, &vlc_tab_tone_level_idx_hi2, 0, 2);
- if (sb > 19)
- q->tone_level_idx_hi2[ch][sb] -= 16;
- else
- for (j = 0; j < 8; j++)
- q->tone_level_idx_mid[ch][sb][j] = -16;
- }
-
- n = QDM2_SB_USED(q->sub_sampling) - 5;
-
- for (sb = 0; sb < n; sb++)
- for (ch = 0; ch < q->nb_channels; ch++)
- for (j = 0; j < 8; j++) {
- if (BITS_LEFT(length,gb) < 16)
- break;
- q->tone_level_idx_mid[ch][sb][j] = qdm2_get_vlc(gb, &vlc_tab_tone_level_idx_mid, 0, 2) - 32;
- }
-}
-
-/**
- * Process subpacket 9, init quantized_coeffs with data from it
- *
- * @param q context
- * @param node pointer to node with packet
- */
-static void process_subpacket_9 (QDM2Context *q, QDM2SubPNode *node)
-{
- GetBitContext gb;
- int i, j, k, n, ch, run, level, diff;
-
- init_get_bits(&gb, node->packet->data, node->packet->size*8);
-
- n = coeff_per_sb_for_avg[q->coeff_per_sb_select][QDM2_SB_USED(q->sub_sampling) - 1] + 1; // same as averagesomething function
-
- for (i = 1; i < n; i++)
- for (ch=0; ch < q->nb_channels; ch++) {
- level = qdm2_get_vlc(&gb, &vlc_tab_level, 0, 2);
- q->quantized_coeffs[ch][i][0] = level;
-
- for (j = 0; j < (8 - 1); ) {
- run = qdm2_get_vlc(&gb, &vlc_tab_run, 0, 1) + 1;
- diff = qdm2_get_se_vlc(&vlc_tab_diff, &gb, 2);
-
- for (k = 1; k <= run; k++)
- q->quantized_coeffs[ch][i][j + k] = (level + ((k*diff) / run));
-
- level += diff;
- j += run;
- }
- }
-
- for (ch = 0; ch < q->nb_channels; ch++)
- for (i = 0; i < 8; i++)
- q->quantized_coeffs[ch][0][i] = 0;
-}
-
-
-/**
- * Process subpacket 10 if not null, else
- *
- * @param q context
- * @param node pointer to node with packet
- * @param length packet length in bits
- */
-static void process_subpacket_10 (QDM2Context *q, QDM2SubPNode *node, int length)
-{
- GetBitContext gb;
-
- init_get_bits(&gb, ((node == NULL) ? empty_buffer : node->packet->data), ((node == NULL) ? 0 : node->packet->size*8));
-
- if (length != 0) {
- init_tone_level_dequantization(q, &gb, length);
- fill_tone_level_array(q, 1);
- } else {
- fill_tone_level_array(q, 0);
- }
-}
-
-
-/**
- * Process subpacket 11
- *
- * @param q context
- * @param node pointer to node with packet
- * @param length packet length in bit
- */
-static void process_subpacket_11 (QDM2Context *q, QDM2SubPNode *node, int length)
-{
- GetBitContext gb;
-
- init_get_bits(&gb, ((node == NULL) ? empty_buffer : node->packet->data), ((node == NULL) ? 0 : node->packet->size*8));
- if (length >= 32) {
- int c = get_bits (&gb, 13);
-
- if (c > 3)
- fill_coding_method_array (q->tone_level_idx, q->tone_level_idx_temp, q->coding_method,
- q->nb_channels, 8*c, q->superblocktype_2_3, q->cm_table_select);
- }
-
- synthfilt_build_sb_samples(q, &gb, length, 0, 8);
-}
-
-
-/**
- * Process subpacket 12
- *
- * @param q context
- * @param node pointer to node with packet
- * @param length packet length in bits
- */
-static void process_subpacket_12 (QDM2Context *q, QDM2SubPNode *node, int length)
-{
- GetBitContext gb;
-
- init_get_bits(&gb, ((node == NULL) ? empty_buffer : node->packet->data), ((node == NULL) ? 0 : node->packet->size*8));
- synthfilt_build_sb_samples(q, &gb, length, 8, QDM2_SB_USED(q->sub_sampling));
-}
-
-/*
- * Process new subpackets for synthesis filter
- *
- * @param q context
- * @param list list with synthesis filter packets (list D)
- */
-static void process_synthesis_subpackets (QDM2Context *q, QDM2SubPNode *list)
-{
- QDM2SubPNode *nodes[4];
-
- nodes[0] = qdm2_search_subpacket_type_in_list(list, 9);
- if (nodes[0] != NULL)
- process_subpacket_9(q, nodes[0]);
-
- nodes[1] = qdm2_search_subpacket_type_in_list(list, 10);
- if (nodes[1] != NULL)
- process_subpacket_10(q, nodes[1], nodes[1]->packet->size << 3);
- else
- process_subpacket_10(q, NULL, 0);
-
- nodes[2] = qdm2_search_subpacket_type_in_list(list, 11);
- if (nodes[0] != NULL && nodes[1] != NULL && nodes[2] != NULL)
- process_subpacket_11(q, nodes[2], (nodes[2]->packet->size << 3));
- else
- process_subpacket_11(q, NULL, 0);
-
- nodes[3] = qdm2_search_subpacket_type_in_list(list, 12);
- if (nodes[0] != NULL && nodes[1] != NULL && nodes[3] != NULL)
- process_subpacket_12(q, nodes[3], (nodes[3]->packet->size << 3));
- else
- process_subpacket_12(q, NULL, 0);
-}
-
-
-/*
- * Decode superblock, fill packet lists.
- *
- * @param q context
- */
-static void qdm2_decode_super_block (QDM2Context *q)
-{
- GetBitContext gb;
- QDM2SubPacket header, *packet;
- int i, packet_bytes, sub_packet_size, sub_packets_D;
- unsigned int next_index = 0;
-
- memset(q->tone_level_idx_hi1, 0, sizeof(q->tone_level_idx_hi1));
- memset(q->tone_level_idx_mid, 0, sizeof(q->tone_level_idx_mid));
- memset(q->tone_level_idx_hi2, 0, sizeof(q->tone_level_idx_hi2));
-
- q->sub_packets_B = 0;
- sub_packets_D = 0;
-
- average_quantized_coeffs(q); // average elements in quantized_coeffs[max_ch][10][8]
-
- init_get_bits(&gb, q->compressed_data, q->compressed_size*8);
- qdm2_decode_sub_packet_header(&gb, &header);
-
- if (header.type < 2 || header.type >= 8) {
- q->has_errors = 1;
- av_log(NULL,AV_LOG_ERROR,"bad superblock type\n");
- return;
- }
-
- q->superblocktype_2_3 = (header.type == 2 || header.type == 3);
- packet_bytes = (q->compressed_size - get_bits_count(&gb) / 8);
-
- init_get_bits(&gb, header.data, header.size*8);
-
- if (header.type == 2 || header.type == 4 || header.type == 5) {
- int csum = 257 * get_bits(&gb, 8) + 2 * get_bits(&gb, 8);
-
- csum = qdm2_packet_checksum(q->compressed_data, q->checksum_size, csum);
-
- if (csum != 0) {
- q->has_errors = 1;
- av_log(NULL,AV_LOG_ERROR,"bad packet checksum\n");
- return;
- }
- }
-
- q->sub_packet_list_B[0].packet = NULL;
- q->sub_packet_list_D[0].packet = NULL;
-
- for (i = 0; i < 6; i++)
- if (--q->fft_level_exp[i] < 0)
- q->fft_level_exp[i] = 0;
-
- for (i = 0; packet_bytes > 0; i++) {
- int j;
-
- q->sub_packet_list_A[i].next = NULL;
-
- if (i > 0) {
- q->sub_packet_list_A[i - 1].next = &q->sub_packet_list_A[i];
-
- /* seek to next block */
- init_get_bits(&gb, header.data, header.size*8);
- skip_bits(&gb, next_index*8);
-
- if (next_index >= header.size)
- break;
- }
-
- /* decode subpacket */
- packet = &q->sub_packets[i];
- qdm2_decode_sub_packet_header(&gb, packet);
- next_index = packet->size + get_bits_count(&gb) / 8;
- sub_packet_size = ((packet->size > 0xff) ? 1 : 0) + packet->size + 2;
-
- if (packet->type == 0)
- break;
-
- if (sub_packet_size > packet_bytes) {
- if (packet->type != 10 && packet->type != 11 && packet->type != 12)
- break;
- packet->size += packet_bytes - sub_packet_size;
- }
-
- packet_bytes -= sub_packet_size;
-
- /* add subpacket to 'all subpackets' list */
- q->sub_packet_list_A[i].packet = packet;
-
- /* add subpacket to related list */
- if (packet->type == 8) {
- SAMPLES_NEEDED_2("packet type 8");
- return;
- } else if (packet->type >= 9 && packet->type <= 12) {
- /* packets for MPEG Audio like Synthesis Filter */
- QDM2_LIST_ADD(q->sub_packet_list_D, sub_packets_D, packet);
- } else if (packet->type == 13) {
- for (j = 0; j < 6; j++)
- q->fft_level_exp[j] = get_bits(&gb, 6);
- } else if (packet->type == 14) {
- for (j = 0; j < 6; j++)
- q->fft_level_exp[j] = qdm2_get_vlc(&gb, &fft_level_exp_vlc, 0, 2);
- } else if (packet->type == 15) {
- SAMPLES_NEEDED_2("packet type 15")
- return;
- } else if (packet->type >= 16 && packet->type < 48 && !fft_subpackets[packet->type - 16]) {
- /* packets for FFT */
- QDM2_LIST_ADD(q->sub_packet_list_B, q->sub_packets_B, packet);
- }
- } // Packet bytes loop
-
-/* **************************************************************** */
- if (q->sub_packet_list_D[0].packet != NULL) {
- process_synthesis_subpackets(q, q->sub_packet_list_D);
- q->do_synth_filter = 1;
- } else if (q->do_synth_filter) {
- process_subpacket_10(q, NULL, 0);
- process_subpacket_11(q, NULL, 0);
- process_subpacket_12(q, NULL, 0);
- }
-/* **************************************************************** */
-}
-
-
-static void qdm2_fft_init_coefficient (QDM2Context *q, int sub_packet,
- int offset, int duration, int channel,
- int exp, int phase)
-{
- if (q->fft_coefs_min_index[duration] < 0)
- q->fft_coefs_min_index[duration] = q->fft_coefs_index;
-
- q->fft_coefs[q->fft_coefs_index].sub_packet = ((sub_packet >= 16) ? (sub_packet - 16) : sub_packet);
- q->fft_coefs[q->fft_coefs_index].channel = channel;
- q->fft_coefs[q->fft_coefs_index].offset = offset;
- q->fft_coefs[q->fft_coefs_index].exp = exp;
- q->fft_coefs[q->fft_coefs_index].phase = phase;
- q->fft_coefs_index++;
-}
-
-
-static void qdm2_fft_decode_tones (QDM2Context *q, int duration, GetBitContext *gb, int b)
-{
- int channel, stereo, phase, exp;
- int local_int_4, local_int_8, stereo_phase, local_int_10;
- int local_int_14, stereo_exp, local_int_20, local_int_28;
- int n, offset;
-
- local_int_4 = 0;
- local_int_28 = 0;
- local_int_20 = 2;
- local_int_8 = (4 - duration);
- local_int_10 = 1 << (q->group_order - duration - 1);
- offset = 1;
-
- while (1) {
- if (q->superblocktype_2_3) {
- while ((n = qdm2_get_vlc(gb, &vlc_tab_fft_tone_offset[local_int_8], 1, 2)) < 2) {
- offset = 1;
- if (n == 0) {
- local_int_4 += local_int_10;
- local_int_28 += (1 << local_int_8);
- } else {
- local_int_4 += 8*local_int_10;
- local_int_28 += (8 << local_int_8);
- }
- }
- offset += (n - 2);
- } else {
- offset += qdm2_get_vlc(gb, &vlc_tab_fft_tone_offset[local_int_8], 1, 2);
- while (offset >= (local_int_10 - 1)) {
- offset += (1 - (local_int_10 - 1));
- local_int_4 += local_int_10;
- local_int_28 += (1 << local_int_8);
- }
- }
-
- if (local_int_4 >= q->group_size)
- return;
-
- local_int_14 = (offset >> local_int_8);
-
- if (q->nb_channels > 1) {
- channel = get_bits1(gb);
- stereo = get_bits1(gb);
- } else {
- channel = 0;
- stereo = 0;
- }
-
- exp = qdm2_get_vlc(gb, (b ? &fft_level_exp_vlc : &fft_level_exp_alt_vlc), 0, 2);
- exp += q->fft_level_exp[fft_level_index_table[local_int_14]];
- exp = (exp < 0) ? 0 : exp;
-
- phase = get_bits(gb, 3);
- stereo_exp = 0;
- stereo_phase = 0;
-
- if (stereo) {
- stereo_exp = (exp - qdm2_get_vlc(gb, &fft_stereo_exp_vlc, 0, 1));
- stereo_phase = (phase - qdm2_get_vlc(gb, &fft_stereo_phase_vlc, 0, 1));
- if (stereo_phase < 0)
- stereo_phase += 8;
- }
-
- if (q->frequency_range > (local_int_14 + 1)) {
- int sub_packet = (local_int_20 + local_int_28);
-
- qdm2_fft_init_coefficient(q, sub_packet, offset, duration, channel, exp, phase);
- if (stereo)
- qdm2_fft_init_coefficient(q, sub_packet, offset, duration, (1 - channel), stereo_exp, stereo_phase);
- }
-
- offset++;
- }
-}
-
-
-static void qdm2_decode_fft_packets (QDM2Context *q)
-{
- int i, j, min, max, value, type, unknown_flag;
- GetBitContext gb;
-
- if (q->sub_packet_list_B[0].packet == NULL)
- return;
-
- /* reset minimum indices for FFT coefficients */
- q->fft_coefs_index = 0;
- for (i=0; i < 5; i++)
- q->fft_coefs_min_index[i] = -1;
-
- /* process subpackets ordered by type, largest type first */
- for (i = 0, max = 256; i < q->sub_packets_B; i++) {
- QDM2SubPacket *packet;
-
- /* find subpacket with largest type less than max */
- for (j = 0, min = 0, packet = NULL; j < q->sub_packets_B; j++) {
- value = q->sub_packet_list_B[j].packet->type;
- if (value > min && value < max) {
- min = value;
- packet = q->sub_packet_list_B[j].packet;
- }
- }
-
- max = min;
-
- /* check for errors (?) */
- if (i == 0 && (packet->type < 16 || packet->type >= 48 || fft_subpackets[packet->type - 16]))
- return;
-
- /* decode FFT tones */
- init_get_bits (&gb, packet->data, packet->size*8);
-
- if (packet->type >= 32 && packet->type < 48 && !fft_subpackets[packet->type - 16])
- unknown_flag = 1;
- else
- unknown_flag = 0;
-
- type = packet->type;
-
- if ((type >= 17 && type < 24) || (type >= 33 && type < 40)) {
- int duration = q->sub_sampling + 5 - (type & 15);
-
- if (duration >= 0 && duration < 4)
- qdm2_fft_decode_tones(q, duration, &gb, unknown_flag);
- } else if (type == 31) {
- for (j=0; j < 4; j++)
- qdm2_fft_decode_tones(q, j, &gb, unknown_flag);
- } else if (type == 46) {
- for (j=0; j < 6; j++)
- q->fft_level_exp[j] = get_bits(&gb, 6);
- for (j=0; j < 4; j++)
- qdm2_fft_decode_tones(q, j, &gb, unknown_flag);
- }
- } // Loop on B packets
-
- /* calculate maximum indices for FFT coefficients */
- for (i = 0, j = -1; i < 5; i++)
- if (q->fft_coefs_min_index[i] >= 0) {
- if (j >= 0)
- q->fft_coefs_max_index[j] = q->fft_coefs_min_index[i];
- j = i;
- }
- if (j >= 0)
- q->fft_coefs_max_index[j] = q->fft_coefs_index;
-}
-
-
-static void qdm2_fft_generate_tone (QDM2Context *q, FFTTone *tone)
-{
- float level, f[6];
- int i;
- QDM2Complex c;
- const double iscale = 2.0*M_PI / 512.0;
-
- tone->phase += tone->phase_shift;
-
- /* calculate current level (maximum amplitude) of tone */
- level = fft_tone_envelope_table[tone->duration][tone->time_index] * tone->level;
- c.im = level * sin(tone->phase*iscale);
- c.re = level * cos(tone->phase*iscale);
-
- /* generate FFT coefficients for tone */
- if (tone->duration >= 3 || tone->cutoff >= 3) {
- tone->samples_im[0] += c.im;
- tone->samples_re[0] += c.re;
- tone->samples_im[1] -= c.im;
- tone->samples_re[1] -= c.re;
- } else {
- f[1] = -tone->table[4];
- f[0] = tone->table[3] - tone->table[0];
- f[2] = 1.0 - tone->table[2] - tone->table[3];
- f[3] = tone->table[1] + tone->table[4] - 1.0;
- f[4] = tone->table[0] - tone->table[1];
- f[5] = tone->table[2];
- for (i = 0; i < 2; i++) {
- tone->samples_re[fft_cutoff_index_table[tone->cutoff][i]] += c.re * f[i];
- tone->samples_im[fft_cutoff_index_table[tone->cutoff][i]] += c.im *((tone->cutoff <= i) ? -f[i] : f[i]);
- }
- for (i = 0; i < 4; i++) {
- tone->samples_re[i] += c.re * f[i+2];
- tone->samples_im[i] += c.im * f[i+2];
- }
- }
-
- /* copy the tone if it has not yet died out */
- if (++tone->time_index < ((1 << (5 - tone->duration)) - 1)) {
- memcpy(&q->fft_tones[q->fft_tone_end], tone, sizeof(FFTTone));
- q->fft_tone_end = (q->fft_tone_end + 1) % 1000;
- }
-}
-
-
-static void qdm2_fft_tone_synthesizer (QDM2Context *q, int sub_packet)
-{
- int i, j, ch;
- const double iscale = 0.25 * M_PI;
-
- for (ch = 0; ch < q->channels; ch++) {
- memset(q->fft.samples_im[ch], 0, q->fft_size * sizeof(float));
- memset(q->fft.samples_re[ch], 0, q->fft_size * sizeof(float));
- }
-
-
- /* apply FFT tones with duration 4 (1 FFT period) */
- if (q->fft_coefs_min_index[4] >= 0)
- for (i = q->fft_coefs_min_index[4]; i < q->fft_coefs_max_index[4]; i++) {
- float level;
- QDM2Complex c;
-
- if (q->fft_coefs[i].sub_packet != sub_packet)
- break;
-
- ch = (q->channels == 1) ? 0 : q->fft_coefs[i].channel;
- level = (q->fft_coefs[i].exp < 0) ? 0.0 : fft_tone_level_table[q->superblocktype_2_3 ? 0 : 1][q->fft_coefs[i].exp & 63];
-
- c.re = level * cos(q->fft_coefs[i].phase * iscale);
- c.im = level * sin(q->fft_coefs[i].phase * iscale);
- q->fft.samples_re[ch][q->fft_coefs[i].offset + 0] += c.re;
- q->fft.samples_im[ch][q->fft_coefs[i].offset + 0] += c.im;
- q->fft.samples_re[ch][q->fft_coefs[i].offset + 1] -= c.re;
- q->fft.samples_im[ch][q->fft_coefs[i].offset + 1] -= c.im;
- }
-
- /* generate existing FFT tones */
- for (i = q->fft_tone_end; i != q->fft_tone_start; ) {
- qdm2_fft_generate_tone(q, &q->fft_tones[q->fft_tone_start]);
- q->fft_tone_start = (q->fft_tone_start + 1) % 1000;
- }
-
- /* create and generate new FFT tones with duration 0 (long) to 3 (short) */
- for (i = 0; i < 4; i++)
- if (q->fft_coefs_min_index[i] >= 0) {
- for (j = q->fft_coefs_min_index[i]; j < q->fft_coefs_max_index[i]; j++) {
- int offset, four_i;
- FFTTone tone;
-
- if (q->fft_coefs[j].sub_packet != sub_packet)
- break;
-
- four_i = (4 - i);
- offset = q->fft_coefs[j].offset >> four_i;
- ch = (q->channels == 1) ? 0 : q->fft_coefs[j].channel;
-
- if (offset < q->frequency_range) {
- if (offset < 2)
- tone.cutoff = offset;
- else
- tone.cutoff = (offset >= 60) ? 3 : 2;
-
- tone.level = (q->fft_coefs[j].exp < 0) ? 0.0 : fft_tone_level_table[q->superblocktype_2_3 ? 0 : 1][q->fft_coefs[j].exp & 63];
- tone.samples_im = &q->fft.samples_im[ch][offset];
- tone.samples_re = &q->fft.samples_re[ch][offset];
- tone.table = (float*)fft_tone_sample_table[i][q->fft_coefs[j].offset - (offset << four_i)];
- tone.phase = 64 * q->fft_coefs[j].phase - (offset << 8) - 128;
- tone.phase_shift = (2 * q->fft_coefs[j].offset + 1) << (7 - four_i);
- tone.duration = i;
- tone.time_index = 0;
-
- qdm2_fft_generate_tone(q, &tone);
- }
- }
- q->fft_coefs_min_index[i] = j;
- }
-}
-
-
-static void qdm2_calculate_fft (QDM2Context *q, int channel, int sub_packet)
-{
- const int n = 1 << (q->fft_order - 1);
- const int n2 = n >> 1;
- const float gain = (q->channels == 1 && q->nb_channels == 2) ? 0.25f : 0.50f;
- float c, s, f0, f1, f2, f3;
- int i, j;
-
- /* prerotation (or something like that) */
- for (i=1; i < n2; i++) {
- j = (n - i);
- c = q->exptab[i].re;
- s = -q->exptab[i].im;
- f0 = (q->fft.samples_re[channel][i] - q->fft.samples_re[channel][j]) * gain;
- f1 = (q->fft.samples_im[channel][i] + q->fft.samples_im[channel][j]) * gain;
- f2 = (q->fft.samples_re[channel][i] + q->fft.samples_re[channel][j]) * gain;
- f3 = (q->fft.samples_im[channel][i] - q->fft.samples_im[channel][j]) * gain;
- q->fft.complex[i].re = s * f0 - c * f1 + f2;
- q->fft.complex[i].im = c * f0 + s * f1 + f3;
- q->fft.complex[j].re = -s * f0 + c * f1 + f2;
- q->fft.complex[j].im = c * f0 + s * f1 - f3;
- }
-
- q->fft.complex[ 0].re = q->fft.samples_re[channel][ 0] * gain * 2.0;
- q->fft.complex[ 0].im = q->fft.samples_re[channel][ 0] * gain * 2.0;
- q->fft.complex[n2].re = q->fft.samples_re[channel][n2] * gain * 2.0;
- q->fft.complex[n2].im = -q->fft.samples_im[channel][n2] * gain * 2.0;
-
- ff_fft_permute(&q->fft_ctx, (FFTComplex *) q->fft.complex);
- ff_fft_calc (&q->fft_ctx, (FFTComplex *) q->fft.complex);
- /* add samples to output buffer */
- for (i = 0; i < ((q->fft_frame_size + 15) & ~15); i++)
- q->output_buffer[q->channels * i + channel] += ((float *) q->fft.complex)[i];
-}
-
-
-/**
- * @param q context
- * @param index subpacket number
- */
-static void qdm2_synthesis_filter (QDM2Context *q, int index)
-{
- OUT_INT samples[MPA_MAX_CHANNELS * MPA_FRAME_SIZE];
- int i, k, ch, sb_used, sub_sampling, dither_state = 0;
-
- /* copy sb_samples */
- sb_used = QDM2_SB_USED(q->sub_sampling);
-
- for (ch = 0; ch < q->channels; ch++)
- for (i = 0; i < 8; i++)
- for (k=sb_used; k < SBLIMIT; k++)
- q->sb_samples[ch][(8 * index) + i][k] = 0;
-
- for (ch = 0; ch < q->nb_channels; ch++) {
- OUT_INT *samples_ptr = samples + ch;
-
- for (i = 0; i < 8; i++) {
- ff_mpa_synth_filter(q->synth_buf[ch], &(q->synth_buf_offset[ch]),
- mpa_window, &dither_state,
- samples_ptr, q->nb_channels,
- q->sb_samples[ch][(8 * index) + i]);
- samples_ptr += 32 * q->nb_channels;
- }
- }
-
- /* add samples to output buffer */
- sub_sampling = (4 >> q->sub_sampling);
-
- for (ch = 0; ch < q->channels; ch++)
- for (i = 0; i < q->frame_size; i++)
- q->output_buffer[q->channels * i + ch] += (float)(samples[q->nb_channels * sub_sampling * i + ch] >> (sizeof(OUT_INT)*8-16));
-}
-
-
-/**
- * Init static data (does not depend on specific file)
- *
- * @param q context
- */
-static void qdm2_init(QDM2Context *q) {
- static int inited = 0;
-
- if (inited != 0)
- return;
- inited = 1;
-
- qdm2_init_vlc();
- ff_mpa_synth_init(mpa_window);
- softclip_table_init();
- rnd_table_init();
- init_noise_samples();
-
- av_log(NULL, AV_LOG_DEBUG, "init done\n");
-}
-
-
-#if 0
-static void dump_context(QDM2Context *q)
-{
- int i;
-#define PRINT(a,b) av_log(NULL,AV_LOG_DEBUG," %s = %d\n", a, b);
- PRINT("compressed_data",q->compressed_data);
- PRINT("compressed_size",q->compressed_size);
- PRINT("frame_size",q->frame_size);
- PRINT("checksum_size",q->checksum_size);
- PRINT("channels",q->channels);
- PRINT("nb_channels",q->nb_channels);
- PRINT("fft_frame_size",q->fft_frame_size);
- PRINT("fft_size",q->fft_size);
- PRINT("sub_sampling",q->sub_sampling);
- PRINT("fft_order",q->fft_order);
- PRINT("group_order",q->group_order);
- PRINT("group_size",q->group_size);
- PRINT("sub_packet",q->sub_packet);
- PRINT("frequency_range",q->frequency_range);
- PRINT("has_errors",q->has_errors);
- PRINT("fft_tone_end",q->fft_tone_end);
- PRINT("fft_tone_start",q->fft_tone_start);
- PRINT("fft_coefs_index",q->fft_coefs_index);
- PRINT("coeff_per_sb_select",q->coeff_per_sb_select);
- PRINT("cm_table_select",q->cm_table_select);
- PRINT("noise_idx",q->noise_idx);
-
- for (i = q->fft_tone_start; i < q->fft_tone_end; i++)
- {
- FFTTone *t = &q->fft_tones[i];
-
- av_log(NULL,AV_LOG_DEBUG,"Tone (%d) dump:\n", i);
- av_log(NULL,AV_LOG_DEBUG," level = %f\n", t->level);
-// PRINT(" level", t->level);
- PRINT(" phase", t->phase);
- PRINT(" phase_shift", t->phase_shift);
- PRINT(" duration", t->duration);
- PRINT(" samples_im", t->samples_im);
- PRINT(" samples_re", t->samples_re);
- PRINT(" table", t->table);
- }
-
-}
-#endif
-
-
-/**
- * Init parameters from codec extradata
- */
-static int qdm2_decode_init(AVCodecContext *avctx)
-{
- QDM2Context *s = avctx->priv_data;
- uint8_t *extradata;
- int extradata_size;
- int tmp_val, tmp, size;
- int i;
- float alpha;
-
- /* extradata parsing
-
- Structure:
- wave {
- frma (QDM2)
- QDCA
- QDCP
- }
-
- 32 size (including this field)
- 32 tag (=frma)
- 32 type (=QDM2 or QDMC)
-
- 32 size (including this field, in bytes)
- 32 tag (=QDCA) // maybe mandatory parameters
- 32 unknown (=1)
- 32 channels (=2)
- 32 samplerate (=44100)
- 32 bitrate (=96000)
- 32 block size (=4096)
- 32 frame size (=256) (for one channel)
- 32 packet size (=1300)
-
- 32 size (including this field, in bytes)
- 32 tag (=QDCP) // maybe some tuneable parameters
- 32 float1 (=1.0)
- 32 zero ?
- 32 float2 (=1.0)
- 32 float3 (=1.0)
- 32 unknown (27)
- 32 unknown (8)
- 32 zero ?
- */
-
- if (!avctx->extradata || (avctx->extradata_size < 48)) {
- av_log(avctx, AV_LOG_ERROR, "extradata missing or truncated\n");
- return -1;
- }
-
- extradata = avctx->extradata;
- extradata_size = avctx->extradata_size;
-
- while (extradata_size > 7) {
- if (!memcmp(extradata, "frmaQDM", 7))
- break;
- extradata++;
- extradata_size--;
- }
-
- if (extradata_size < 12) {
- av_log(avctx, AV_LOG_ERROR, "not enough extradata (%i)\n",
- extradata_size);
- return -1;
- }
-
- if (memcmp(extradata, "frmaQDM", 7)) {
- av_log(avctx, AV_LOG_ERROR, "invalid headers, QDM? not found\n");
- return -1;
- }
-
- if (extradata[7] == 'C') {
-// s->is_qdmc = 1;
- av_log(avctx, AV_LOG_ERROR, "stream is QDMC version 1, which is not supported\n");
- return -1;
- }
-
- extradata += 8;
- extradata_size -= 8;
-
- size = AV_RB32(extradata);
-
- if(size > extradata_size){
- av_log(avctx, AV_LOG_ERROR, "extradata size too small, %i < %i\n",
- extradata_size, size);
- return -1;
- }
-
- extradata += 4;
- av_log(avctx, AV_LOG_DEBUG, "size: %d\n", size);
- if (AV_RB32(extradata) != MKBETAG('Q','D','C','A')) {
- av_log(avctx, AV_LOG_ERROR, "invalid extradata, expecting QDCA\n");
- return -1;
- }
-
- extradata += 8;
-
- avctx->channels = s->nb_channels = s->channels = AV_RB32(extradata);
- extradata += 4;
-
- avctx->sample_rate = AV_RB32(extradata);
- extradata += 4;
-
- avctx->bit_rate = AV_RB32(extradata);
- extradata += 4;
-
- s->group_size = AV_RB32(extradata);
- extradata += 4;
-
- s->fft_size = AV_RB32(extradata);
- extradata += 4;
-
- s->checksum_size = AV_RB32(extradata);
- extradata += 4;
-
- s->fft_order = av_log2(s->fft_size) + 1;
- s->fft_frame_size = 2 * s->fft_size; // complex has two floats
-
- // something like max decodable tones
- s->group_order = av_log2(s->group_size) + 1;
- s->frame_size = s->group_size / 16; // 16 iterations per super block
-
- s->sub_sampling = s->fft_order - 7;
- s->frequency_range = 255 / (1 << (2 - s->sub_sampling));
-
- switch ((s->sub_sampling * 2 + s->channels - 1)) {
- case 0: tmp = 40; break;
- case 1: tmp = 48; break;
- case 2: tmp = 56; break;
- case 3: tmp = 72; break;
- case 4: tmp = 80; break;
- case 5: tmp = 100;break;
- default: tmp=s->sub_sampling; break;
- }
- tmp_val = 0;
- if ((tmp * 1000) < avctx->bit_rate) tmp_val = 1;
- if ((tmp * 1440) < avctx->bit_rate) tmp_val = 2;
- if ((tmp * 1760) < avctx->bit_rate) tmp_val = 3;
- if ((tmp * 2240) < avctx->bit_rate) tmp_val = 4;
- s->cm_table_select = tmp_val;
-
- if (s->sub_sampling == 0)
- tmp = 7999;
- else
- tmp = ((-(s->sub_sampling -1)) & 8000) + 20000;
- /*
- 0: 7999 -> 0
- 1: 20000 -> 2
- 2: 28000 -> 2
- */
- if (tmp < 8000)
- s->coeff_per_sb_select = 0;
- else if (tmp <= 16000)
- s->coeff_per_sb_select = 1;
- else
- s->coeff_per_sb_select = 2;
-
- // Fail on unknown fft order, if it's > 9 it can overflow s->exptab[]
- if ((s->fft_order < 7) || (s->fft_order > 9)) {
- av_log(avctx, AV_LOG_ERROR, "Unknown FFT order (%d), contact the developers!\n", s->fft_order);
- return -1;
- }
-
- ff_fft_init(&s->fft_ctx, s->fft_order - 1, 1);
-
- for (i = 1; i < (1 << (s->fft_order - 2)); i++) {
- alpha = 2 * M_PI * (float)i / (float)(1 << (s->fft_order - 1));
- s->exptab[i].re = cos(alpha);
- s->exptab[i].im = sin(alpha);
- }
-
- qdm2_init(s);
-
-// dump_context(s);
- return 0;
-}
-
-
-static int qdm2_decode_close(AVCodecContext *avctx)
-{
- QDM2Context *s = avctx->priv_data;
-
- ff_fft_end(&s->fft_ctx);
-
- return 0;
-}
-
-
-static void qdm2_decode (QDM2Context *q, uint8_t *in, int16_t *out)
-{
- int ch, i;
- const int frame_size = (q->frame_size * q->channels);
-
- /* select input buffer */
- q->compressed_data = in;
- q->compressed_size = q->checksum_size;
-
-// dump_context(q);
-
- /* copy old block, clear new block of output samples */
- memmove(q->output_buffer, &q->output_buffer[frame_size], frame_size * sizeof(float));
- memset(&q->output_buffer[frame_size], 0, frame_size * sizeof(float));
-
- /* decode block of QDM2 compressed data */
- if (q->sub_packet == 0) {
- q->has_errors = 0; // zero it for a new super block
- av_log(NULL,AV_LOG_DEBUG,"Superblock follows\n");
- qdm2_decode_super_block(q);
- }
-
- /* parse subpackets */
- if (!q->has_errors) {
- if (q->sub_packet == 2)
- qdm2_decode_fft_packets(q);
-
- qdm2_fft_tone_synthesizer(q, q->sub_packet);
- }
-
- /* sound synthesis stage 1 (FFT) */
- for (ch = 0; ch < q->channels; ch++) {
- qdm2_calculate_fft(q, ch, q->sub_packet);
-
- if (!q->has_errors && q->sub_packet_list_C[0].packet != NULL) {
- SAMPLES_NEEDED_2("has errors, and C list is not empty")
- return;
- }
- }
-
- /* sound synthesis stage 2 (MPEG audio like synthesis filter) */
- if (!q->has_errors && q->do_synth_filter)
- qdm2_synthesis_filter(q, q->sub_packet);
-
- q->sub_packet = (q->sub_packet + 1) % 16;
-
- /* clip and convert output float[] to 16bit signed samples */
- for (i = 0; i < frame_size; i++) {
- int value = (int)q->output_buffer[i];
-
- if (value > SOFTCLIP_THRESHOLD)
- value = (value > HARDCLIP_THRESHOLD) ? 32767 : softclip_table[ value - SOFTCLIP_THRESHOLD];
- else if (value < -SOFTCLIP_THRESHOLD)
- value = (value < -HARDCLIP_THRESHOLD) ? -32767 : -softclip_table[-value - SOFTCLIP_THRESHOLD];
-
- out[i] = value;
- }
-}
-
-
-static int qdm2_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- QDM2Context *s = avctx->priv_data;
-
- if(!buf)
- return 0;
- if(buf_size < s->checksum_size)
- return -1;
-
- *data_size = s->channels * s->frame_size * sizeof(int16_t);
-
- av_log(avctx, AV_LOG_DEBUG, "decode(%d): %p[%d] -> %p[%d]\n",
- buf_size, buf, s->checksum_size, data, *data_size);
-
- qdm2_decode(s, buf, data);
-
- // reading only when next superblock found
- if (s->sub_packet == 0) {
- return s->checksum_size;
- }
-
- return 0;
-}
-
-AVCodec qdm2_decoder =
-{
- .name = "qdm2",
- .type = CODEC_TYPE_AUDIO,
- .id = CODEC_ID_QDM2,
- .priv_data_size = sizeof(QDM2Context),
- .init = qdm2_decode_init,
- .close = qdm2_decode_close,
- .decode = qdm2_decode_frame,
-};
diff --git a/src/libffmpeg/libavcodec/qdm2data.h b/src/libffmpeg/libavcodec/qdm2data.h
deleted file mode 100644
index 6d7d07463..000000000
--- a/src/libffmpeg/libavcodec/qdm2data.h
+++ /dev/null
@@ -1,530 +0,0 @@
-/*
- * QDM2 compatible decoder
- * Copyright (c) 2003 Ewald Snel
- * Copyright (c) 2005 Benjamin Larsson
- * Copyright (c) 2005 Alex Beregszaszi
- * Copyright (c) 2005 Roberto Togni
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
- /**
- * @file qdm2data.h
- * Various QDM2 tables.
- */
-
-#ifndef QDM2DATA_H
-#define QDM2DATA_H
-
-/** VLC TABLES **/
-
-/* values in this table range from -1..23; adjust retrieved value by -1 */
-static const uint16_t vlc_tab_level_huffcodes[24] = {
- 0x037c, 0x0004, 0x003c, 0x004c, 0x003a, 0x002c, 0x001c, 0x001a,
- 0x0024, 0x0014, 0x0001, 0x0002, 0x0000, 0x0003, 0x0007, 0x0005,
- 0x0006, 0x0008, 0x0009, 0x000a, 0x000c, 0x00fc, 0x007c, 0x017c
-};
-
-static const uint8_t vlc_tab_level_huffbits[24] = {
- 10, 6, 7, 7, 6, 6, 6, 6, 6, 5, 4, 4, 4, 3, 3, 3, 3, 4, 4, 5, 7, 8, 9, 10
-};
-
-/* values in this table range from -1..36; adjust retrieved value by -1 */
-static const uint16_t vlc_tab_diff_huffcodes[37] = {
- 0x1c57, 0x0004, 0x0000, 0x0001, 0x0003, 0x0002, 0x000f, 0x000e,
- 0x0007, 0x0016, 0x0037, 0x0027, 0x0026, 0x0066, 0x0006, 0x0097,
- 0x0046, 0x01c6, 0x0017, 0x0786, 0x0086, 0x0257, 0x00d7, 0x0357,
- 0x00c6, 0x0386, 0x0186, 0x0000, 0x0157, 0x0c57, 0x0057, 0x0000,
- 0x0b86, 0x0000, 0x1457, 0x0000, 0x0457
-};
-
-static const uint8_t vlc_tab_diff_huffbits[37] = {
- 13, 3, 3, 2, 3, 3, 4, 4, 6, 5, 6, 6, 7, 7, 8, 8,
- 8, 9, 8, 11, 9, 10, 8, 10, 9, 12, 10, 0, 10, 13, 11, 0,
- 12, 0, 13, 0, 13
-};
-
-/* values in this table range from -1..5; adjust retrieved value by -1 */
-static const uint8_t vlc_tab_run_huffcodes[6] = {
- 0x1f, 0x00, 0x01, 0x03, 0x07, 0x0f
-};
-
-static const uint8_t vlc_tab_run_huffbits[6] = {
- 5, 1, 2, 3, 4, 5
-};
-
-/* values in this table range from -1..19; adjust retrieved value by -1 */
-static const uint16_t vlc_tab_tone_level_idx_hi1_huffcodes[20] = {
- 0x5714, 0x000c, 0x0002, 0x0001, 0x0000, 0x0004, 0x0034, 0x0054,
- 0x0094, 0x0014, 0x0114, 0x0214, 0x0314, 0x0614, 0x0e14, 0x0f14,
- 0x2714, 0x0714, 0x1714, 0x3714
-};
-
-static const uint8_t vlc_tab_tone_level_idx_hi1_huffbits[20] = {
- 15, 4, 2, 1, 3, 5, 6, 7, 8, 10, 10, 11, 11, 12, 12, 12, 14, 14, 15, 14
-};
-
-/* values in this table range from -1..23; adjust retrieved value by -1 */
-static const uint16_t vlc_tab_tone_level_idx_mid_huffcodes[24] = {
- 0x0fea, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x03ea, 0x00ea, 0x002a, 0x001a,
- 0x0006, 0x0001, 0x0000, 0x0002, 0x000a, 0x006a, 0x01ea, 0x07ea
-};
-
-static const uint8_t vlc_tab_tone_level_idx_mid_huffbits[24] = {
- 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 9, 7, 5, 3, 1, 2, 4, 6, 8, 10, 12
-};
-
-/* values in this table range from -1..23; adjust retrieved value by -1 */
-static const uint16_t vlc_tab_tone_level_idx_hi2_huffcodes[24] = {
- 0x0664, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0064, 0x00e4,
- 0x00a4, 0x0068, 0x0004, 0x0008, 0x0014, 0x0018, 0x0000, 0x0001,
- 0x0002, 0x0003, 0x000c, 0x0028, 0x0024, 0x0164, 0x0000, 0x0264
-};
-
-static const uint8_t vlc_tab_tone_level_idx_hi2_huffbits[24] = {
- 11, 0, 0, 0, 0, 0, 10, 8, 8, 7, 6, 6, 5, 5, 4, 2, 2, 2, 4, 7, 8, 9, 0, 11
-};
-
-/* values in this table range from -1..8; adjust retrieved value by -1 */
-static const uint8_t vlc_tab_type30_huffcodes[9] = {
- 0x3c, 0x06, 0x00, 0x01, 0x03, 0x02, 0x04, 0x0c, 0x1c
-};
-
-static const uint8_t vlc_tab_type30_huffbits[9] = {
- 6, 3, 3, 2, 2, 3, 4, 5, 6
-};
-
-/* values in this table range from -1..9; adjust retrieved value by -1 */
-static const uint8_t vlc_tab_type34_huffcodes[10] = {
- 0x18, 0x00, 0x01, 0x04, 0x05, 0x07, 0x03, 0x02, 0x06, 0x08
-};
-
-static const uint8_t vlc_tab_type34_huffbits[10] = {
- 5, 4, 3, 3, 3, 3, 3, 3, 3, 5
-};
-
-/* values in this table range from -1..22; adjust retrieved value by -1 */
-static const uint16_t vlc_tab_fft_tone_offset_0_huffcodes[23] = {
- 0x038e, 0x0001, 0x0000, 0x0022, 0x000a, 0x0006, 0x0012, 0x0002,
- 0x001e, 0x003e, 0x0056, 0x0016, 0x000e, 0x0032, 0x0072, 0x0042,
- 0x008e, 0x004e, 0x00f2, 0x002e, 0x0036, 0x00c2, 0x018e
-};
-
-static const uint8_t vlc_tab_fft_tone_offset_0_huffbits[23] = {
- 10, 1, 2, 6, 4, 5, 6, 7, 6, 6, 7, 7, 8, 7, 8, 8, 9, 7, 8, 6, 6, 8, 10
-};
-
-/* values in this table range from -1..27; adjust retrieved value by -1 */
-static const uint16_t vlc_tab_fft_tone_offset_1_huffcodes[28] = {
- 0x07a4, 0x0001, 0x0020, 0x0012, 0x001c, 0x0008, 0x0006, 0x0010,
- 0x0000, 0x0014, 0x0004, 0x0032, 0x0070, 0x000c, 0x0002, 0x003a,
- 0x001a, 0x002c, 0x002a, 0x0022, 0x0024, 0x000a, 0x0064, 0x0030,
- 0x0062, 0x00a4, 0x01a4, 0x03a4
-};
-
-static const uint8_t vlc_tab_fft_tone_offset_1_huffbits[28] = {
- 11, 1, 6, 6, 5, 4, 3, 6, 6, 5, 6, 6, 7, 6, 6, 6,
- 6, 6, 6, 7, 8, 6, 7, 7, 7, 9, 10, 11
-};
-
-/* values in this table range from -1..31; adjust retrieved value by -1 */
-static const uint16_t vlc_tab_fft_tone_offset_2_huffcodes[32] = {
- 0x1760, 0x0001, 0x0000, 0x0082, 0x000c, 0x0006, 0x0003, 0x0007,
- 0x0008, 0x0004, 0x0010, 0x0012, 0x0022, 0x001a, 0x0000, 0x0020,
- 0x000a, 0x0040, 0x004a, 0x006a, 0x002a, 0x0042, 0x0002, 0x0060,
- 0x00aa, 0x00e0, 0x00c2, 0x01c2, 0x0160, 0x0360, 0x0760, 0x0f60
-};
-
-static const uint8_t vlc_tab_fft_tone_offset_2_huffbits[32] = {
- 13, 2, 0, 8, 4, 3, 3, 3, 4, 4, 5, 5, 6, 5, 7, 7,
- 7, 7, 7, 7, 8, 8, 8, 9, 8, 8, 9, 9, 10, 11, 13, 12
-};
-
-/* values in this table range from -1..34; adjust retrieved value by -1 */
-static const uint16_t vlc_tab_fft_tone_offset_3_huffcodes[35] = {
- 0x33ea, 0x0005, 0x0000, 0x000c, 0x0000, 0x0006, 0x0003, 0x0008,
- 0x0002, 0x0001, 0x0004, 0x0007, 0x001a, 0x000f, 0x001c, 0x002c,
- 0x000a, 0x001d, 0x002d, 0x002a, 0x000d, 0x004c, 0x008c, 0x006a,
- 0x00cd, 0x004d, 0x00ea, 0x020c, 0x030c, 0x010c, 0x01ea, 0x07ea,
- 0x0bea, 0x03ea, 0x13ea
-};
-
-static const uint8_t vlc_tab_fft_tone_offset_3_huffbits[35] = {
- 14, 4, 0, 10, 4, 3, 3, 4, 4, 3, 4, 4, 5, 4, 5, 6,
- 6, 5, 6, 7, 7, 7, 8, 8, 8, 8, 9, 10, 10, 10, 10, 11,
- 12, 13, 14
-};
-
-/* values in this table range from -1..37; adjust retrieved value by -1 */
-static const uint16_t vlc_tab_fft_tone_offset_4_huffcodes[38] = {
- 0x5282, 0x0016, 0x0000, 0x0136, 0x0004, 0x0000, 0x0007, 0x000a,
- 0x000e, 0x0003, 0x0001, 0x000d, 0x0006, 0x0009, 0x0012, 0x0005,
- 0x0025, 0x0022, 0x0015, 0x0002, 0x0076, 0x0035, 0x0042, 0x00c2,
- 0x0182, 0x00b6, 0x0036, 0x03c2, 0x0482, 0x01c2, 0x0682, 0x0882,
- 0x0a82, 0x0082, 0x0282, 0x1282, 0x3282, 0x2282
-};
-
-static const uint8_t vlc_tab_fft_tone_offset_4_huffbits[38] = {
- 15, 6, 0, 9, 3, 3, 3, 4, 4, 3, 4, 4, 5, 4, 5, 6,
- 6, 6, 6, 8, 7, 6, 8, 9, 9, 8, 9, 10, 11, 10, 11, 12,
- 12, 12, 14, 15, 14, 14
-};
-
-/** FFT TABLES **/
-
-/* values in this table range from -1..27; adjust retrieved value by -1 */
-static const uint16_t fft_level_exp_alt_huffcodes[28] = {
- 0x1ec6, 0x0006, 0x00c2, 0x0142, 0x0242, 0x0246, 0x00c6, 0x0046,
- 0x0042, 0x0146, 0x00a2, 0x0062, 0x0026, 0x0016, 0x000e, 0x0005,
- 0x0004, 0x0003, 0x0000, 0x0001, 0x000a, 0x0012, 0x0002, 0x0022,
- 0x01c6, 0x02c6, 0x06c6, 0x0ec6
-};
-
-static const uint8_t fft_level_exp_alt_huffbits[28] = {
- 13, 7, 8, 9, 10, 10, 10, 10, 10, 9, 8, 7, 6, 5, 4, 3,
- 3, 2, 3, 3, 4, 5, 7, 8, 9, 11, 12, 13
-};
-
-/* values in this table range from -1..19; adjust retrieved value by -1 */
-static const uint16_t fft_level_exp_huffcodes[20] = {
- 0x0f24, 0x0001, 0x0002, 0x0000, 0x0006, 0x0005, 0x0007, 0x000c,
- 0x000b, 0x0014, 0x0013, 0x0004, 0x0003, 0x0023, 0x0064, 0x00a4,
- 0x0024, 0x0124, 0x0324, 0x0724
-};
-
-static const uint8_t fft_level_exp_huffbits[20] = {
- 12, 3, 3, 3, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 8, 9, 10, 11, 12
-};
-
-/* values in this table range from -1..6; adjust retrieved value by -1 */
-static const uint8_t fft_stereo_exp_huffcodes[7] = {
- 0x3e, 0x01, 0x00, 0x02, 0x06, 0x0e, 0x1e
-};
-
-static const uint8_t fft_stereo_exp_huffbits[7] = {
- 6, 1, 2, 3, 4, 5, 6
-};
-
-/* values in this table range from -1..8; adjust retrieved value by -1 */
-static const uint8_t fft_stereo_phase_huffcodes[9] = {
- 0x35, 0x02, 0x00, 0x01, 0x0d, 0x15, 0x05, 0x09, 0x03
-};
-
-static const uint8_t fft_stereo_phase_huffbits[9] = {
- 6, 2, 2, 4, 4, 6, 5, 4, 2
-};
-
-static const int fft_cutoff_index_table[4][2] = {
- { 1, 2 }, {-1, 0 }, {-1,-2 }, { 0, 0 }
-};
-
-static const int16_t fft_level_index_table[256] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-};
-
-static uint8_t last_coeff[3] = {
- 4, 7, 10
-};
-
-static uint8_t coeff_per_sb_for_avg[3][30] = {
- { 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
- { 0, 1, 2, 2, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 },
- { 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9 }
-};
-
-static uint32_t dequant_table[3][10][30] = {
- { { 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 0, 256, 256, 205, 154, 102, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 0, 0, 0, 51, 102, 154, 205, 256, 238, 219, 201, 183, 165, 146, 128, 110, 91, 73, 55, 37, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 18, 37, 55, 73, 91, 110, 128, 146, 165, 183, 201, 219, 238, 256, 228, 199, 171, 142, 114, 85, 57, 28 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
- { { 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 0, 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 0, 0, 256, 171, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 0, 0, 0, 85, 171, 256, 171, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 0, 0, 0, 0, 0, 0, 85, 171, 256, 219, 183, 146, 110, 73, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 73, 110, 146, 183, 219, 256, 228, 199, 171, 142, 114, 85, 57, 28, 0, 0, 0, 0, 0, 0 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 57, 85, 114, 142, 171, 199, 228, 256, 213, 171, 128, 85, 43 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
- { { 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 0, 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 0, 0, 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 0, 0, 0, 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 0, 0, 0, 0, 256, 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 0, 0, 0, 0, 0, 0, 256, 171, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 0, 0, 0, 0, 0, 0, 0, 85, 171, 256, 192, 128, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 128, 192, 256, 205, 154, 102, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, 102, 154, 205, 256, 213, 171, 128, 85, 43, 0, 0, 0, 0, 0, 0 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 85, 128, 171, 213, 256, 213, 171, 128, 85, 43 } }
-};
-
-static uint8_t coeff_per_sb_for_dequant[3][30] = {
- { 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
- { 0, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6 },
- { 0, 1, 2, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9 }
-};
-
-/* first index is subband, 2nd index is 0, 1 or 3 (2 is unused) */
-static int8_t tone_level_idx_offset_table[30][4] = {
- { -50, -50, 0, -50 },
- { -50, -50, 0, -50 },
- { -50, -9, 0, -19 },
- { -16, -6, 0, -12 },
- { -11, -4, 0, -8 },
- { -8, -3, 0, -6 },
- { -7, -3, 0, -5 },
- { -6, -2, 0, -4 },
- { -5, -2, 0, -3 },
- { -4, -1, 0, -3 },
- { -4, -1, 0, -2 },
- { -3, -1, 0, -2 },
- { -3, -1, 0, -2 },
- { -3, -1, 0, -2 },
- { -2, -1, 0, -1 },
- { -2, -1, 0, -1 },
- { -2, -1, 0, -1 },
- { -2, 0, 0, -1 },
- { -2, 0, 0, -1 },
- { -1, 0, 0, -1 },
- { -1, 0, 0, -1 },
- { -1, 0, 0, -1 },
- { -1, 0, 0, -1 },
- { -1, 0, 0, -1 },
- { -1, 0, 0, -1 },
- { -1, 0, 0, -1 },
- { -1, 0, 0, 0 },
- { -1, 0, 0, 0 },
- { -1, 0, 0, 0 },
- { -1, 0, 0, 0 }
-};
-
-/* all my samples have 1st index 0 or 1 */
-/* second index is subband, only indexes 0-29 seem to be used */
-static int8_t coding_method_table[5][30] = {
- { 34, 30, 24, 24, 16, 16, 16, 16, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10
- },
- { 34, 30, 24, 24, 16, 16, 16, 16, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10
- },
- { 34, 30, 30, 30, 24, 24, 16, 16, 16, 16, 16, 16, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10
- },
- { 34, 34, 30, 30, 24, 24, 24, 24, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 10, 10, 10, 10, 10, 10, 10, 10
- },
- { 34, 34, 30, 30, 30, 30, 30, 30, 24, 24, 24, 24, 24, 24, 24,
- 24, 24, 24, 24, 24, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16
- },
-};
-
-static const int vlc_stage3_values[60] = {
- 0, 1, 2, 3, 4, 6, 8, 10, 12, 16, 20, 24,
- 28, 36, 44, 52, 60, 76, 92, 108, 124, 156, 188, 220,
- 252, 316, 380, 444, 508, 636, 764, 892, 1020, 1276, 1532, 1788,
- 2044, 2556, 3068, 3580, 4092, 5116, 6140, 7164, 8188, 10236, 12284, 14332,
- 16380, 20476, 24572, 28668, 32764, 40956, 49148, 57340, 65532, 81916, 98300,114684
-};
-
-static const float fft_tone_sample_table[4][16][5] = {
- { { .0100000000f,-.0037037037f,-.0020000000f,-.0069444444f,-.0018416207f },
- { .0416666667f, .0000000000f, .0000000000f,-.0208333333f,-.0123456791f },
- { .1250000000f, .0558035709f, .0330687836f,-.0164473690f,-.0097465888f },
- { .1562500000f, .0625000000f, .0370370370f,-.0062500000f,-.0037037037f },
- { .1996007860f, .0781250000f, .0462962948f, .0022727272f, .0013468013f },
- { .2000000000f, .0625000000f, .0370370373f, .0208333333f, .0074074073f },
- { .2127659619f, .0555555556f, .0329218097f, .0208333333f, .0123456791f },
- { .2173913121f, .0473484844f, .0280583613f, .0347222239f, .0205761325f },
- { .2173913121f, .0347222239f, .0205761325f, .0473484844f, .0280583613f },
- { .2127659619f, .0208333333f, .0123456791f, .0555555556f, .0329218097f },
- { .2000000000f, .0208333333f, .0074074073f, .0625000000f, .0370370370f },
- { .1996007860f, .0022727272f, .0013468013f, .0781250000f, .0462962948f },
- { .1562500000f,-.0062500000f,-.0037037037f, .0625000000f, .0370370370f },
- { .1250000000f,-.0164473690f,-.0097465888f, .0558035709f, .0330687836f },
- { .0416666667f,-.0208333333f,-.0123456791f, .0000000000f, .0000000000f },
- { .0100000000f,-.0069444444f,-.0018416207f,-.0037037037f,-.0020000000f } },
-
- { { .0050000000f,-.0200000000f, .0125000000f,-.3030303030f, .0020000000f },
- { .1041666642f, .0400000000f,-.0250000000f, .0333333333f,-.0200000000f },
- { .1250000000f, .0100000000f, .0142857144f,-.0500000007f,-.0200000000f },
- { .1562500000f,-.0006250000f,-.00049382716f,-.000625000f,-.00049382716f },
- { .1562500000f,-.0006250000f,-.00049382716f,-.000625000f,-.00049382716f },
- { .1250000000f,-.0500000000f,-.0200000000f, .0100000000f, .0142857144f },
- { .1041666667f, .0333333333f,-.0200000000f, .0400000000f,-.0250000000f },
- { .0050000000f,-.3030303030f, .0020000001f,-.0200000000f, .0125000000f },
- { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
- { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
- { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
- { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
- { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
- { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
- { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
- { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f } },
-
- { { .1428571492f, .1250000000f,-.0285714287f,-.0357142873f, .0208333333f },
- { .1818181818f, .0588235296f, .0333333333f, .0212765951f, .0100000000f },
- { .1818181818f, .0212765951f, .0100000000f, .0588235296f, .0333333333f },
- { .1428571492f,-.0357142873f, .0208333333f, .1250000000f,-.0285714287f },
- { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
- { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
- { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
- { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
- { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
- { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
- { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
- { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
- { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
- { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
- { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
- { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f } },
-
- { { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
- { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
- { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
- { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
- { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
- { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
- { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
- { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
- { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
- { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
- { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
- { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
- { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
- { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
- { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
- { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f } }
-};
-
-static const float fft_tone_level_table[2][64] = { {
-/* pow ~ (i > 46) ? 0 : (((((i & 1) ? 431 : 304) << (i >> 1))) / 1024.0); */
- 0.17677669f, 0.42677650f, 0.60355347f, 0.85355347f,
- 1.20710683f, 1.68359375f, 2.37500000f, 3.36718750f,
- 4.75000000f, 6.73437500f, 9.50000000f, 13.4687500f,
- 19.0000000f, 26.9375000f, 38.0000000f, 53.8750000f,
- 76.0000000f, 107.750000f, 152.000000f, 215.500000f,
- 304.000000f, 431.000000f, 608.000000f, 862.000000f,
- 1216.00000f, 1724.00000f, 2432.00000f, 3448.00000f,
- 4864.00000f, 6896.00000f, 9728.00000f, 13792.0000f,
- 19456.0000f, 27584.0000f, 38912.0000f, 55168.0000f,
- 77824.0000f, 110336.000f, 155648.000f, 220672.000f,
- 311296.000f, 441344.000f, 622592.000f, 882688.000f,
- 1245184.00f, 1765376.00f, 2490368.00f, 0.00000000f,
- 0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f,
- 0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f,
- 0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f,
- 0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f,
- }, {
-/* pow = (i > 45) ? 0 : ((((i & 1) ? 431 : 304) << (i >> 1)) / 512.0); */
- 0.59375000f, 0.84179688f, 1.18750000f, 1.68359375f,
- 2.37500000f, 3.36718750f, 4.75000000f, 6.73437500f,
- 9.50000000f, 13.4687500f, 19.0000000f, 26.9375000f,
- 38.0000000f, 53.8750000f, 76.0000000f, 107.750000f,
- 152.000000f, 215.500000f, 304.000000f, 431.000000f,
- 608.000000f, 862.000000f, 1216.00000f, 1724.00000f,
- 2432.00000f, 3448.00000f, 4864.00000f, 6896.00000f,
- 9728.00000f, 13792.0000f, 19456.0000f, 27584.0000f,
- 38912.0000f, 55168.0000f, 77824.0000f, 110336.000f,
- 155648.000f, 220672.000f, 311296.000f, 441344.000f,
- 622592.000f, 882688.000f, 1245184.00f, 1765376.00f,
- 2490368.00f, 3530752.00f, 0.00000000f, 0.00000000f,
- 0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f,
- 0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f,
- 0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f,
- 0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f
-} };
-
-static const float fft_tone_envelope_table[4][31] = {
- { .009607375f, .038060248f, .084265202f, .146446645f, .222214907f, .308658302f,
- .402454883f, .500000060f, .597545207f, .691341758f, .777785182f, .853553414f,
- .915734828f, .961939812f, .990392685f, 1.00000000f, .990392625f, .961939752f,
- .915734768f, .853553295f, .777785063f, .691341639f, .597545087f, .500000000f,
- .402454853f, .308658272f, .222214878f, .146446615f, .084265172f, .038060218f,
- .009607345f },
- { .038060248f, .146446645f, .308658302f, .500000060f, .691341758f, .853553414f,
- .961939812f, 1.00000000f, .961939752f, .853553295f, .691341639f, .500000000f,
- .308658272f, .146446615f, .038060218f, .000000000f, .000000000f, .000000000f,
- .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f,
- .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f,
- .000000000f },
- { .146446645f, .500000060f, .853553414f, 1.00000000f, .853553295f, .500000000f,
- .146446615f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f,
- .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f,
- .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f,
- .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f,
- .000000000f },
- { .500000060f, 1.00000000f, .500000000f, .000000000f, .000000000f, .000000000f,
- .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f,
- .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f,
- .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f,
- .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f,
- .000000000f }
-};
-
-static const float sb_noise_attenuation[32] = {
- 0.0f, 0.0f, 0.3f, 0.4f, 0.5f, 0.7f, 1.0f, 1.0f,
- 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,
- 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,
- 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,
-};
-
-static const uint8_t fft_subpackets[32] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0
-};
-
-/* first index is joined_stereo, second index is 0 or 2 (1 is unused) */
-static float dequant_1bit[2][3] = {
- {-0.920000f, 0.000000f, 0.920000f },
- {-0.890000f, 0.000000f, 0.890000f }
-};
-
-static const float type30_dequant[8] = {
- -1.0f,-0.625f,-0.291666656732559f,0.0f,
- 0.25f,0.5f,0.75f,1.0f,
-};
-
-static const float type34_delta[10] = { // FIXME: covers 8 entries..
- -1.0f,-0.60947573184967f,-0.333333343267441f,-0.138071194291115f,0.0f,
- 0.138071194291115f,0.333333343267441f,0.60947573184967f,1.0f,0.0f,
-};
-
-#endif /* QDM2DATA_H */
diff --git a/src/libffmpeg/libavcodec/qdrw.c b/src/libffmpeg/libavcodec/qdrw.c
deleted file mode 100644
index 664be2f4f..000000000
--- a/src/libffmpeg/libavcodec/qdrw.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * QuickDraw (qdrw) codec
- * Copyright (c) 2004 Konstantin Shishkov
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file qdrw.c
- * Apple QuickDraw codec.
- */
-
-#include "avcodec.h"
-#include "mpegvideo.h"
-
-typedef struct QdrawContext{
- AVCodecContext *avctx;
- AVFrame pic;
- uint8_t palette[256*3];
-} QdrawContext;
-
-static int decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- QdrawContext * const a = avctx->priv_data;
- AVFrame * const p= (AVFrame*)&a->pic;
- uint8_t* outdata;
- int colors;
- int i;
-
- if(p->data[0])
- avctx->release_buffer(avctx, p);
-
- p->reference= 0;
- if(avctx->get_buffer(avctx, p) < 0){
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
- p->pict_type= I_TYPE;
- p->key_frame= 1;
-
- outdata = a->pic.data[0];
-
- buf += 0x68; /* jump to palette */
- colors = AV_RB32(buf);
- buf += 4;
-
- if(colors < 0 || colors > 256) {
- av_log(avctx, AV_LOG_ERROR, "Error color count - %i(0x%X)\n", colors, colors);
- return -1;
- }
-
- for (i = 0; i <= colors; i++) {
- unsigned int idx;
- idx = AV_RB16(buf); /* color index */
- buf += 2;
-
- if (idx > 255) {
- av_log(avctx, AV_LOG_ERROR, "Palette index out of range: %u\n", idx);
- buf += 6;
- continue;
- }
- a->palette[idx * 3 + 0] = *buf++;
- buf++;
- a->palette[idx * 3 + 1] = *buf++;
- buf++;
- a->palette[idx * 3 + 2] = *buf++;
- buf++;
- }
-
- buf += 18; /* skip unneeded data */
- for (i = 0; i < avctx->height; i++) {
- int size, left, code, pix;
- uint8_t *next;
- uint8_t *out;
- int tsize = 0;
-
- /* decode line */
- out = outdata;
- size = AV_RB16(buf); /* size of packed line */
- buf += 2;
- left = size;
- next = buf + size;
- while (left > 0) {
- code = *buf++;
- if (code & 0x80 ) { /* run */
- int i;
- pix = *buf++;
- if ((out + (257 - code) * 3) > (outdata + a->pic.linesize[0]))
- break;
- for (i = 0; i < 257 - code; i++) {
- *out++ = a->palette[pix * 3 + 0];
- *out++ = a->palette[pix * 3 + 1];
- *out++ = a->palette[pix * 3 + 2];
- }
- tsize += 257 - code;
- left -= 2;
- } else { /* copy */
- int i, pix;
- if ((out + code * 3) > (outdata + a->pic.linesize[0]))
- break;
- for (i = 0; i <= code; i++) {
- pix = *buf++;
- *out++ = a->palette[pix * 3 + 0];
- *out++ = a->palette[pix * 3 + 1];
- *out++ = a->palette[pix * 3 + 2];
- }
- left -= 2 + code;
- tsize += code + 1;
- }
- }
- buf = next;
- outdata += a->pic.linesize[0];
- }
-
- *data_size = sizeof(AVFrame);
- *(AVFrame*)data = a->pic;
-
- return buf_size;
-}
-
-static int decode_init(AVCodecContext *avctx){
-// QdrawContext * const a = avctx->priv_data;
-
- if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
- return 1;
- }
-
- avctx->pix_fmt= PIX_FMT_RGB24;
-
- return 0;
-}
-
-AVCodec qdraw_decoder = {
- "qdraw",
- CODEC_TYPE_VIDEO,
- CODEC_ID_QDRAW,
- sizeof(QdrawContext),
- decode_init,
- NULL,
- NULL,
- decode_frame,
- CODEC_CAP_DR1,
-};
diff --git a/src/libffmpeg/libavcodec/qpeg.c b/src/libffmpeg/libavcodec/qpeg.c
deleted file mode 100644
index 3c597e8df..000000000
--- a/src/libffmpeg/libavcodec/qpeg.c
+++ /dev/null
@@ -1,324 +0,0 @@
-/*
- * QPEG codec
- * Copyright (c) 2004 Konstantin Shishkov
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file qpeg.c
- * QPEG codec.
- */
-
-#include "avcodec.h"
-#include "mpegvideo.h"
-
-typedef struct QpegContext{
- AVCodecContext *avctx;
- AVFrame pic;
- uint8_t *refdata;
-} QpegContext;
-
-static void qpeg_decode_intra(uint8_t *src, uint8_t *dst, int size,
- int stride, int width, int height)
-{
- int i;
- int code;
- int c0, c1;
- int run, copy;
- int filled = 0;
- int rows_to_go;
-
- rows_to_go = height;
- height--;
- dst = dst + height * stride;
-
- while((size > 0) && (rows_to_go > 0)) {
- code = *src++;
- size--;
- run = copy = 0;
- if(code == 0xFC) /* end-of-picture code */
- break;
- if(code >= 0xF8) { /* very long run */
- c0 = *src++;
- c1 = *src++;
- size -= 2;
- run = ((code & 0x7) << 16) + (c0 << 8) + c1 + 2;
- } else if (code >= 0xF0) { /* long run */
- c0 = *src++;
- size--;
- run = ((code & 0xF) << 8) + c0 + 2;
- } else if (code >= 0xE0) { /* short run */
- run = (code & 0x1F) + 2;
- } else if (code >= 0xC0) { /* very long copy */
- c0 = *src++;
- c1 = *src++;
- size -= 2;
- copy = ((code & 0x3F) << 16) + (c0 << 8) + c1 + 1;
- } else if (code >= 0x80) { /* long copy */
- c0 = *src++;
- size--;
- copy = ((code & 0x7F) << 8) + c0 + 1;
- } else { /* short copy */
- copy = code + 1;
- }
-
- /* perform actual run or copy */
- if(run) {
- int p;
-
- p = *src++;
- size--;
- for(i = 0; i < run; i++) {
- dst[filled++] = p;
- if (filled >= width) {
- filled = 0;
- dst -= stride;
- rows_to_go--;
- if(rows_to_go <= 0)
- break;
- }
- }
- } else {
- size -= copy;
- for(i = 0; i < copy; i++) {
- dst[filled++] = *src++;
- if (filled >= width) {
- filled = 0;
- dst -= stride;
- rows_to_go--;
- if(rows_to_go <= 0)
- break;
- }
- }
- }
- }
-}
-
-static int qpeg_table_h[16] =
- { 0x00, 0x20, 0x20, 0x20, 0x18, 0x10, 0x10, 0x20, 0x10, 0x08, 0x18, 0x08, 0x08, 0x18, 0x10, 0x04};
-static int qpeg_table_w[16] =
- { 0x00, 0x20, 0x18, 0x08, 0x18, 0x10, 0x20, 0x10, 0x08, 0x10, 0x20, 0x20, 0x08, 0x10, 0x18, 0x04};
-
-/* Decodes delta frames */
-static void qpeg_decode_inter(uint8_t *src, uint8_t *dst, int size,
- int stride, int width, int height,
- int delta, uint8_t *ctable, uint8_t *refdata)
-{
- int i, j;
- int code;
- int filled = 0;
- int orig_height;
- uint8_t *blkdata;
-
- /* copy prev frame */
- for(i = 0; i < height; i++)
- memcpy(refdata + (i * width), dst + (i * stride), width);
-
- orig_height = height;
- blkdata = src - 0x86;
- height--;
- dst = dst + height * stride;
-
- while((size > 0) && (height >= 0)) {
- code = *src++;
- size--;
-
- if(delta) {
- /* motion compensation */
- while((code & 0xF0) == 0xF0) {
- if(delta == 1) {
- int me_idx;
- int me_w, me_h, me_x, me_y;
- uint8_t *me_plane;
- int corr, val;
-
- /* get block size by index */
- me_idx = code & 0xF;
- me_w = qpeg_table_w[me_idx];
- me_h = qpeg_table_h[me_idx];
-
- /* extract motion vector */
- corr = *src++;
- size--;
-
- val = corr >> 4;
- if(val > 7)
- val -= 16;
- me_x = val;
-
- val = corr & 0xF;
- if(val > 7)
- val -= 16;
- me_y = val;
-
- /* check motion vector */
- if ((me_x + filled < 0) || (me_x + me_w + filled > width) ||
- (height - me_y - me_h < 0) || (height - me_y > orig_height) ||
- (filled + me_w > width) || (height - me_h < 0))
- av_log(NULL, AV_LOG_ERROR, "Bogus motion vector (%i,%i), block size %ix%i at %i,%i\n",
- me_x, me_y, me_w, me_h, filled, height);
- else {
- /* do motion compensation */
- me_plane = refdata + (filled + me_x) + (height - me_y) * width;
- for(j = 0; j < me_h; j++) {
- for(i = 0; i < me_w; i++)
- dst[filled + i - (j * stride)] = me_plane[i - (j * width)];
- }
- }
- }
- code = *src++;
- size--;
- }
- }
-
- if(code == 0xE0) /* end-of-picture code */
- break;
- if(code > 0xE0) { /* run code: 0xE1..0xFF */
- int p;
-
- code &= 0x1F;
- p = *src++;
- size--;
- for(i = 0; i <= code; i++) {
- dst[filled++] = p;
- if(filled >= width) {
- filled = 0;
- dst -= stride;
- height--;
- }
- }
- } else if(code >= 0xC0) { /* copy code: 0xC0..0xDF */
- code &= 0x1F;
-
- for(i = 0; i <= code; i++) {
- dst[filled++] = *src++;
- if(filled >= width) {
- filled = 0;
- dst -= stride;
- height--;
- }
- }
- size -= code + 1;
- } else if(code >= 0x80) { /* skip code: 0x80..0xBF */
- int skip;
-
- code &= 0x3F;
- /* codes 0x80 and 0x81 are actually escape codes,
- skip value minus constant is in the next byte */
- if(!code)
- skip = (*src++) + 64;
- else if(code == 1)
- skip = (*src++) + 320;
- else
- skip = code;
- filled += skip;
- while( filled >= width) {
- filled -= width;
- dst -= stride;
- height--;
- if(height < 0)
- break;
- }
- } else {
- /* zero code treated as one-pixel skip */
- if(code)
- dst[filled++] = ctable[code & 0x7F];
- else
- filled++;
- if(filled >= width) {
- filled = 0;
- dst -= stride;
- height--;
- }
- }
- }
-}
-
-static int decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- QpegContext * const a = avctx->priv_data;
- AVFrame * const p= (AVFrame*)&a->pic;
- uint8_t* outdata;
- int delta;
-
- if(p->data[0])
- avctx->release_buffer(avctx, p);
-
- p->reference= 0;
- if(avctx->get_buffer(avctx, p) < 0){
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
- outdata = a->pic.data[0];
- if(buf[0x85] == 0x10) {
- qpeg_decode_intra(buf+0x86, outdata, buf_size - 0x86, a->pic.linesize[0], avctx->width, avctx->height);
- } else {
- delta = buf[0x85];
- qpeg_decode_inter(buf+0x86, outdata, buf_size - 0x86, a->pic.linesize[0], avctx->width, avctx->height, delta, buf + 4, a->refdata);
- }
-
- /* make the palette available on the way out */
- memcpy(a->pic.data[1], a->avctx->palctrl->palette, AVPALETTE_SIZE);
- if (a->avctx->palctrl->palette_changed) {
- a->pic.palette_has_changed = 1;
- a->avctx->palctrl->palette_changed = 0;
- }
-
- *data_size = sizeof(AVFrame);
- *(AVFrame*)data = a->pic;
-
- return buf_size;
-}
-
-static int decode_init(AVCodecContext *avctx){
- QpegContext * const a = avctx->priv_data;
-
- a->avctx = avctx;
- avctx->pix_fmt= PIX_FMT_PAL8;
- avctx->has_b_frames = 0;
- a->pic.data[0] = NULL;
- a->refdata = av_malloc(avctx->width * avctx->height);
-
- return 0;
-}
-
-static int decode_end(AVCodecContext *avctx){
- QpegContext * const a = avctx->priv_data;
- AVFrame * const p= (AVFrame*)&a->pic;
-
- if(p->data[0])
- avctx->release_buffer(avctx, p);
-
- av_free(a->refdata);
- return 0;
-}
-
-AVCodec qpeg_decoder = {
- "qpeg",
- CODEC_TYPE_VIDEO,
- CODEC_ID_QPEG,
- sizeof(QpegContext),
- decode_init,
- NULL,
- decode_end,
- decode_frame,
- CODEC_CAP_DR1,
-};
diff --git a/src/libffmpeg/libavcodec/qtrle.c b/src/libffmpeg/libavcodec/qtrle.c
deleted file mode 100644
index 0ccca28c6..000000000
--- a/src/libffmpeg/libavcodec/qtrle.c
+++ /dev/null
@@ -1,630 +0,0 @@
-/*
- * Quicktime Animation (RLE) Video Decoder
- * Copyright (C) 2004 the ffmpeg project
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file qtrle.c
- * QT RLE Video Decoder by Mike Melanson (melanson@pcisys.net)
- * For more information about the QT RLE format, visit:
- * http://www.pcisys.net/~melanson/codecs/
- *
- * The QT RLE decoder has seven modes of operation:
- * 1, 2, 4, 8, 16, 24, and 32 bits per pixel. For modes 1, 2, 4, and 8
- * the decoder outputs PAL8 colorspace data. 16-bit data yields RGB555
- * data. 24-bit data is RGB24 and 32-bit data is RGBA32.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "common.h"
-#include "avcodec.h"
-#include "dsputil.h"
-
-typedef struct QtrleContext {
-
- AVCodecContext *avctx;
- DSPContext dsp;
- AVFrame frame;
-
- unsigned char *buf;
- int size;
-
-} QtrleContext;
-
-#define CHECK_STREAM_PTR(n) \
- if ((stream_ptr + n) > s->size) { \
- av_log (s->avctx, AV_LOG_INFO, "Problem: stream_ptr out of bounds (%d >= %d)\n", \
- stream_ptr + n, s->size); \
- return; \
- }
-
-#define CHECK_PIXEL_PTR(n) \
- if ((pixel_ptr + n > pixel_limit) || (pixel_ptr + n < 0)) { \
- av_log (s->avctx, AV_LOG_INFO, "Problem: pixel_ptr = %d, pixel_limit = %d\n", \
- pixel_ptr + n, pixel_limit); \
- return; \
- } \
-
-static void qtrle_decode_1bpp(QtrleContext *s)
-{
-}
-
-static void qtrle_decode_2bpp(QtrleContext *s)
-{
-}
-
-static void qtrle_decode_4bpp(QtrleContext *s)
-{
- int stream_ptr;
- int header;
- int start_line;
- int lines_to_change;
- int rle_code;
- int row_ptr, pixel_ptr;
- int row_inc = s->frame.linesize[0];
- unsigned char pi1, pi2, pi3, pi4, pi5, pi6, pi7, pi8; /* 8 palette indices */
- unsigned char *rgb = s->frame.data[0];
- int pixel_limit = s->frame.linesize[0] * s->avctx->height;
-
- /* check if this frame is even supposed to change */
- if (s->size < 8)
- return;
-
- /* start after the chunk size */
- stream_ptr = 4;
-
- /* fetch the header */
- CHECK_STREAM_PTR(2);
- header = AV_RB16(&s->buf[stream_ptr]);
- stream_ptr += 2;
-
- /* if a header is present, fetch additional decoding parameters */
- if (header & 0x0008) {
- CHECK_STREAM_PTR(8);
- start_line = AV_RB16(&s->buf[stream_ptr]);
- stream_ptr += 4;
- lines_to_change = AV_RB16(&s->buf[stream_ptr]);
- stream_ptr += 4;
- } else {
- start_line = 0;
- lines_to_change = s->avctx->height;
- }
-
- row_ptr = row_inc * start_line;
- while (lines_to_change--) {
- CHECK_STREAM_PTR(2);
- pixel_ptr = row_ptr + (8 * (s->buf[stream_ptr++] - 1));
-
- while ((rle_code = (signed char)s->buf[stream_ptr++]) != -1) {
- if (rle_code == 0) {
- /* there's another skip code in the stream */
- CHECK_STREAM_PTR(1);
- pixel_ptr += (8 * (s->buf[stream_ptr++] - 1));
- CHECK_PIXEL_PTR(0); /* make sure pixel_ptr is positive */
- } else if (rle_code < 0) {
- /* decode the run length code */
- rle_code = -rle_code;
- /* get the next 4 bytes from the stream, treat them as palette
- * indices, and output them rle_code times */
- CHECK_STREAM_PTR(4);
- pi1 = ((s->buf[stream_ptr]) >> 4) & 0x0f;
- pi2 = (s->buf[stream_ptr++]) & 0x0f;
- pi3 = ((s->buf[stream_ptr]) >> 4) & 0x0f;
- pi4 = (s->buf[stream_ptr++]) & 0x0f;
- pi5 = ((s->buf[stream_ptr]) >> 4) & 0x0f;
- pi6 = (s->buf[stream_ptr++]) & 0x0f;
- pi7 = ((s->buf[stream_ptr]) >> 4) & 0x0f;
- pi8 = (s->buf[stream_ptr++]) & 0x0f;
-
- CHECK_PIXEL_PTR(rle_code * 8);
-
- while (rle_code--) {
- rgb[pixel_ptr++] = pi1;
- rgb[pixel_ptr++] = pi2;
- rgb[pixel_ptr++] = pi3;
- rgb[pixel_ptr++] = pi4;
- rgb[pixel_ptr++] = pi5;
- rgb[pixel_ptr++] = pi6;
- rgb[pixel_ptr++] = pi7;
- rgb[pixel_ptr++] = pi8;
- }
- } else {
- /* copy the same pixel directly to output 4 times */
- rle_code *= 4;
- CHECK_STREAM_PTR(rle_code);
- CHECK_PIXEL_PTR(rle_code*2);
-
- while (rle_code--) {
- rgb[pixel_ptr++] = ((s->buf[stream_ptr]) >> 4) & 0x0f;
- rgb[pixel_ptr++] = (s->buf[stream_ptr++]) & 0x0f;
- }
- }
- }
- row_ptr += row_inc;
- }
-}
-
-static void qtrle_decode_8bpp(QtrleContext *s)
-{
- int stream_ptr;
- int header;
- int start_line;
- int lines_to_change;
- int rle_code;
- int row_ptr, pixel_ptr;
- int row_inc = s->frame.linesize[0];
- unsigned char pi1, pi2, pi3, pi4; /* 4 palette indices */
- unsigned char *rgb = s->frame.data[0];
- int pixel_limit = s->frame.linesize[0] * s->avctx->height;
-
- /* check if this frame is even supposed to change */
- if (s->size < 8)
- return;
-
- /* start after the chunk size */
- stream_ptr = 4;
-
- /* fetch the header */
- CHECK_STREAM_PTR(2);
- header = AV_RB16(&s->buf[stream_ptr]);
- stream_ptr += 2;
-
- /* if a header is present, fetch additional decoding parameters */
- if (header & 0x0008) {
- CHECK_STREAM_PTR(8);
- start_line = AV_RB16(&s->buf[stream_ptr]);
- stream_ptr += 4;
- lines_to_change = AV_RB16(&s->buf[stream_ptr]);
- stream_ptr += 4;
- } else {
- start_line = 0;
- lines_to_change = s->avctx->height;
- }
-
- row_ptr = row_inc * start_line;
- while (lines_to_change--) {
- CHECK_STREAM_PTR(2);
- pixel_ptr = row_ptr + (4 * (s->buf[stream_ptr++] - 1));
-
- while ((rle_code = (signed char)s->buf[stream_ptr++]) != -1) {
- if (rle_code == 0) {
- /* there's another skip code in the stream */
- CHECK_STREAM_PTR(1);
- pixel_ptr += (4 * (s->buf[stream_ptr++] - 1));
- CHECK_PIXEL_PTR(0); /* make sure pixel_ptr is positive */
- } else if (rle_code < 0) {
- /* decode the run length code */
- rle_code = -rle_code;
- /* get the next 4 bytes from the stream, treat them as palette
- * indices, and output them rle_code times */
- CHECK_STREAM_PTR(4);
- pi1 = s->buf[stream_ptr++];
- pi2 = s->buf[stream_ptr++];
- pi3 = s->buf[stream_ptr++];
- pi4 = s->buf[stream_ptr++];
-
- CHECK_PIXEL_PTR(rle_code * 4);
-
- while (rle_code--) {
- rgb[pixel_ptr++] = pi1;
- rgb[pixel_ptr++] = pi2;
- rgb[pixel_ptr++] = pi3;
- rgb[pixel_ptr++] = pi4;
- }
- } else {
- /* copy the same pixel directly to output 4 times */
- rle_code *= 4;
- CHECK_STREAM_PTR(rle_code);
- CHECK_PIXEL_PTR(rle_code);
-
- while (rle_code--) {
- rgb[pixel_ptr++] = s->buf[stream_ptr++];
- }
- }
- }
- row_ptr += row_inc;
- }
-}
-
-static void qtrle_decode_16bpp(QtrleContext *s)
-{
- int stream_ptr;
- int header;
- int start_line;
- int lines_to_change;
- int rle_code;
- int row_ptr, pixel_ptr;
- int row_inc = s->frame.linesize[0];
- unsigned short rgb16;
- unsigned char *rgb = s->frame.data[0];
- int pixel_limit = s->frame.linesize[0] * s->avctx->height;
-
- /* check if this frame is even supposed to change */
- if (s->size < 8)
- return;
-
- /* start after the chunk size */
- stream_ptr = 4;
-
- /* fetch the header */
- CHECK_STREAM_PTR(2);
- header = AV_RB16(&s->buf[stream_ptr]);
- stream_ptr += 2;
-
- /* if a header is present, fetch additional decoding parameters */
- if (header & 0x0008) {
- CHECK_STREAM_PTR(8);
- start_line = AV_RB16(&s->buf[stream_ptr]);
- stream_ptr += 4;
- lines_to_change = AV_RB16(&s->buf[stream_ptr]);
- stream_ptr += 4;
- } else {
- start_line = 0;
- lines_to_change = s->avctx->height;
- }
-
- row_ptr = row_inc * start_line;
- while (lines_to_change--) {
- CHECK_STREAM_PTR(2);
- pixel_ptr = row_ptr + (s->buf[stream_ptr++] - 1) * 2;
-
- while ((rle_code = (signed char)s->buf[stream_ptr++]) != -1) {
- if (rle_code == 0) {
- /* there's another skip code in the stream */
- CHECK_STREAM_PTR(1);
- pixel_ptr += (s->buf[stream_ptr++] - 1) * 2;
- CHECK_PIXEL_PTR(0); /* make sure pixel_ptr is positive */
- } else if (rle_code < 0) {
- /* decode the run length code */
- rle_code = -rle_code;
- CHECK_STREAM_PTR(2);
- rgb16 = AV_RB16(&s->buf[stream_ptr]);
- stream_ptr += 2;
-
- CHECK_PIXEL_PTR(rle_code * 2);
-
- while (rle_code--) {
- *(unsigned short *)(&rgb[pixel_ptr]) = rgb16;
- pixel_ptr += 2;
- }
- } else {
- CHECK_STREAM_PTR(rle_code * 2);
- CHECK_PIXEL_PTR(rle_code * 2);
-
- /* copy pixels directly to output */
- while (rle_code--) {
- rgb16 = AV_RB16(&s->buf[stream_ptr]);
- stream_ptr += 2;
- *(unsigned short *)(&rgb[pixel_ptr]) = rgb16;
- pixel_ptr += 2;
- }
- }
- }
- row_ptr += row_inc;
- }
-}
-
-static void qtrle_decode_24bpp(QtrleContext *s)
-{
- int stream_ptr;
- int header;
- int start_line;
- int lines_to_change;
- int rle_code;
- int row_ptr, pixel_ptr;
- int row_inc = s->frame.linesize[0];
- unsigned char r, g, b;
- unsigned char *rgb = s->frame.data[0];
- int pixel_limit = s->frame.linesize[0] * s->avctx->height;
-
- /* check if this frame is even supposed to change */
- if (s->size < 8)
- return;
-
- /* start after the chunk size */
- stream_ptr = 4;
-
- /* fetch the header */
- CHECK_STREAM_PTR(2);
- header = AV_RB16(&s->buf[stream_ptr]);
- stream_ptr += 2;
-
- /* if a header is present, fetch additional decoding parameters */
- if (header & 0x0008) {
- CHECK_STREAM_PTR(8);
- start_line = AV_RB16(&s->buf[stream_ptr]);
- stream_ptr += 4;
- lines_to_change = AV_RB16(&s->buf[stream_ptr]);
- stream_ptr += 4;
- } else {
- start_line = 0;
- lines_to_change = s->avctx->height;
- }
-
- row_ptr = row_inc * start_line;
- while (lines_to_change--) {
- CHECK_STREAM_PTR(2);
- pixel_ptr = row_ptr + (s->buf[stream_ptr++] - 1) * 3;
-
- while ((rle_code = (signed char)s->buf[stream_ptr++]) != -1) {
- if (rle_code == 0) {
- /* there's another skip code in the stream */
- CHECK_STREAM_PTR(1);
- pixel_ptr += (s->buf[stream_ptr++] - 1) * 3;
- CHECK_PIXEL_PTR(0); /* make sure pixel_ptr is positive */
- } else if (rle_code < 0) {
- /* decode the run length code */
- rle_code = -rle_code;
- CHECK_STREAM_PTR(3);
- r = s->buf[stream_ptr++];
- g = s->buf[stream_ptr++];
- b = s->buf[stream_ptr++];
-
- CHECK_PIXEL_PTR(rle_code * 3);
-
- while (rle_code--) {
- rgb[pixel_ptr++] = r;
- rgb[pixel_ptr++] = g;
- rgb[pixel_ptr++] = b;
- }
- } else {
- CHECK_STREAM_PTR(rle_code * 3);
- CHECK_PIXEL_PTR(rle_code * 3);
-
- /* copy pixels directly to output */
- while (rle_code--) {
- rgb[pixel_ptr++] = s->buf[stream_ptr++];
- rgb[pixel_ptr++] = s->buf[stream_ptr++];
- rgb[pixel_ptr++] = s->buf[stream_ptr++];
- }
- }
- }
- row_ptr += row_inc;
- }
-}
-
-static void qtrle_decode_32bpp(QtrleContext *s)
-{
- int stream_ptr;
- int header;
- int start_line;
- int lines_to_change;
- int rle_code;
- int row_ptr, pixel_ptr;
- int row_inc = s->frame.linesize[0];
- unsigned char a, r, g, b;
- unsigned int argb;
- unsigned char *rgb = s->frame.data[0];
- int pixel_limit = s->frame.linesize[0] * s->avctx->height;
-
- /* check if this frame is even supposed to change */
- if (s->size < 8)
- return;
-
- /* start after the chunk size */
- stream_ptr = 4;
-
- /* fetch the header */
- CHECK_STREAM_PTR(2);
- header = AV_RB16(&s->buf[stream_ptr]);
- stream_ptr += 2;
-
- /* if a header is present, fetch additional decoding parameters */
- if (header & 0x0008) {
- CHECK_STREAM_PTR(8);
- start_line = AV_RB16(&s->buf[stream_ptr]);
- stream_ptr += 4;
- lines_to_change = AV_RB16(&s->buf[stream_ptr]);
- stream_ptr += 4;
- } else {
- start_line = 0;
- lines_to_change = s->avctx->height;
- }
-
- row_ptr = row_inc * start_line;
- while (lines_to_change--) {
- CHECK_STREAM_PTR(2);
- pixel_ptr = row_ptr + (s->buf[stream_ptr++] - 1) * 4;
-
- while ((rle_code = (signed char)s->buf[stream_ptr++]) != -1) {
- if (rle_code == 0) {
- /* there's another skip code in the stream */
- CHECK_STREAM_PTR(1);
- pixel_ptr += (s->buf[stream_ptr++] - 1) * 4;
- CHECK_PIXEL_PTR(0); /* make sure pixel_ptr is positive */
- } else if (rle_code < 0) {
- /* decode the run length code */
- rle_code = -rle_code;
- CHECK_STREAM_PTR(4);
- a = s->buf[stream_ptr++];
- r = s->buf[stream_ptr++];
- g = s->buf[stream_ptr++];
- b = s->buf[stream_ptr++];
- argb = (a << 24) | (r << 16) | (g << 8) | (b << 0);
-
- CHECK_PIXEL_PTR(rle_code * 4);
-
- while (rle_code--) {
- *(unsigned int *)(&rgb[pixel_ptr]) = argb;
- pixel_ptr += 4;
- }
- } else {
- CHECK_STREAM_PTR(rle_code * 4);
- CHECK_PIXEL_PTR(rle_code * 4);
-
- /* copy pixels directly to output */
- while (rle_code--) {
- a = s->buf[stream_ptr++];
- r = s->buf[stream_ptr++];
- g = s->buf[stream_ptr++];
- b = s->buf[stream_ptr++];
- argb = (a << 24) | (r << 16) | (g << 8) | (b << 0);
- *(unsigned int *)(&rgb[pixel_ptr]) = argb;
- pixel_ptr += 4;
- }
- }
- }
- row_ptr += row_inc;
- }
-}
-
-static int qtrle_decode_init(AVCodecContext *avctx)
-{
- QtrleContext *s = (QtrleContext *)avctx->priv_data;
-
- s->avctx = avctx;
- switch (avctx->bits_per_sample) {
- case 1:
- case 2:
- case 4:
- case 8:
- case 33:
- case 34:
- case 36:
- case 40:
- avctx->pix_fmt = PIX_FMT_PAL8;
- break;
-
- case 16:
- avctx->pix_fmt = PIX_FMT_RGB555;
- break;
-
- case 24:
- avctx->pix_fmt = PIX_FMT_RGB24;
- break;
-
- case 32:
- avctx->pix_fmt = PIX_FMT_RGBA32;
- break;
-
- default:
- av_log (avctx, AV_LOG_ERROR, "Unsupported colorspace: %d bits/sample?\n",
- avctx->bits_per_sample);
- break;
- }
- avctx->has_b_frames = 0;
- dsputil_init(&s->dsp, avctx);
-
- s->frame.data[0] = NULL;
-
- return 0;
-}
-
-static int qtrle_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- QtrleContext *s = (QtrleContext *)avctx->priv_data;
-
- s->buf = buf;
- s->size = buf_size;
-
- s->frame.reference = 1;
- s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE |
- FF_BUFFER_HINTS_REUSABLE | FF_BUFFER_HINTS_READABLE;
- if (avctx->reget_buffer(avctx, &s->frame)) {
- av_log (s->avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
- return -1;
- }
-
- switch (avctx->bits_per_sample) {
- case 1:
- case 33:
- qtrle_decode_1bpp(s);
- break;
-
- case 2:
- case 34:
- qtrle_decode_2bpp(s);
- break;
-
- case 4:
- case 36:
- qtrle_decode_4bpp(s);
- /* make the palette available on the way out */
- memcpy(s->frame.data[1], s->avctx->palctrl->palette, AVPALETTE_SIZE);
- if (s->avctx->palctrl->palette_changed) {
- s->frame.palette_has_changed = 1;
- s->avctx->palctrl->palette_changed = 0;
- }
- break;
-
- case 8:
- case 40:
- qtrle_decode_8bpp(s);
- /* make the palette available on the way out */
- memcpy(s->frame.data[1], s->avctx->palctrl->palette, AVPALETTE_SIZE);
- if (s->avctx->palctrl->palette_changed) {
- s->frame.palette_has_changed = 1;
- s->avctx->palctrl->palette_changed = 0;
- }
- break;
-
- case 16:
- qtrle_decode_16bpp(s);
- break;
-
- case 24:
- qtrle_decode_24bpp(s);
- break;
-
- case 32:
- qtrle_decode_32bpp(s);
- break;
-
- default:
- av_log (s->avctx, AV_LOG_ERROR, "Unsupported colorspace: %d bits/sample?\n",
- avctx->bits_per_sample);
- break;
- }
-
- *data_size = sizeof(AVFrame);
- *(AVFrame*)data = s->frame;
-
- /* always report that the buffer was completely consumed */
- return buf_size;
-}
-
-static int qtrle_decode_end(AVCodecContext *avctx)
-{
- QtrleContext *s = (QtrleContext *)avctx->priv_data;
-
- if (s->frame.data[0])
- avctx->release_buffer(avctx, &s->frame);
-
- return 0;
-}
-
-AVCodec qtrle_decoder = {
- "qtrle",
- CODEC_TYPE_VIDEO,
- CODEC_ID_QTRLE,
- sizeof(QtrleContext),
- qtrle_decode_init,
- NULL,
- qtrle_decode_end,
- qtrle_decode_frame,
- CODEC_CAP_DR1,
-};
-
diff --git a/src/libffmpeg/libavcodec/ra144.c b/src/libffmpeg/libavcodec/ra144.c
deleted file mode 100644
index c4f4b813b..000000000
--- a/src/libffmpeg/libavcodec/ra144.c
+++ /dev/null
@@ -1,519 +0,0 @@
-/*
- * Real Audio 1.0 (14.4K)
- * Copyright (c) 2003 the ffmpeg project
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "ra144.h"
-
-#define DATABLOCK1 20 /* size of 14.4 input block in bytes */
-#define DATACHUNK1 1440 /* size of 14.4 input chunk in bytes */
-#define AUDIOBLOCK 160 /* size of output block in 16-bit words (320 bytes) */
-#define AUDIOBUFFER 12288 /* size of output buffer in 16-bit words (24576 bytes) */
-/* consts */
-#define NBLOCKS 4 /* number of segments within a block */
-#define BLOCKSIZE 40 /* (quarter) block size in 16-bit words (80 bytes) */
-#define HALFBLOCK 20 /* BLOCKSIZE/2 */
-#define BUFFERSIZE 146 /* for do_output */
-
-
-/* internal globals */
-typedef struct {
- unsigned int resetflag, val, oldval;
- unsigned int unpacked[28]; /* buffer for unpacked input */
- unsigned int *iptr; /* pointer to current input (from unpacked) */
- unsigned int gval;
- unsigned short *gsp;
- unsigned int gbuf1[8];
- unsigned short gbuf2[120];
- signed short output_buffer[40];
- unsigned int *decptr; /* decoder ptr */
- signed short *decsp;
-
- /* the swapped buffers */
- unsigned int swapb1a[10];
- unsigned int swapb2a[10];
- unsigned int swapb1b[10];
- unsigned int swapb2b[10];
- unsigned int *swapbuf1;
- unsigned int *swapbuf2;
- unsigned int *swapbuf1alt;
- unsigned int *swapbuf2alt;
-
- unsigned int buffer[5];
- unsigned short int buffer_2[148];
- unsigned short int buffer_a[40];
- unsigned short int buffer_b[40];
- unsigned short int buffer_c[40];
- unsigned short int buffer_d[40];
-
- unsigned short int work[50];
- unsigned short *sptr;
-
- int buffer1[10];
- int buffer2[10];
-
- signed short wavtable1[2304];
- unsigned short wavtable2[2304];
-} Real144_internal;
-
-static int ra144_decode_init(AVCodecContext * avctx)
-{
- Real144_internal *glob=avctx->priv_data;
-
- memset(glob,0,sizeof(Real144_internal));
- glob->resetflag=1;
- glob->swapbuf1=glob->swapb1a;
- glob->swapbuf2=glob->swapb2a;
- glob->swapbuf1alt=glob->swapb1b;
- glob->swapbuf2alt=glob->swapb2b;
-
- memcpy(glob->wavtable1,wavtable1,sizeof(wavtable1));
- memcpy(glob->wavtable2,wavtable2,sizeof(wavtable2));
-
- return 0;
-}
-
-static void final(Real144_internal *glob, short *i1, short *i2, void *out, int *statbuf, int len);
-static void add_wav(Real144_internal *glob, int n, int f, int m1, int m2, int m3, short *s1, short *s2, short *s3, short *dest);
-static int irms(short *data, int factor);
-static void rotate_block(short *source, short *target, int offset);
-/* lookup square roots in table */
-static int t_sqrt(unsigned int x)
-{
- int s=0;
- while (x>0xfff) { s++; x=x>>2; }
- return (sqrt_table[x]<<s)<<2;
-}
-
-/* do 'voice' */
-static void do_voice(int *a1, int *a2)
-{
- int buffer[10];
- int *b1,*b2;
- int x,y;
- int *ptr,*tmp;
-
- b1=buffer;
- b2=a2;
-
- for (x=0;x<10;x++) {
- b1[x]=(*a1)<<4;
-
- if(x>0) {
- ptr=b2+x;
- for (y=0;y<=x-1;y++)
- b1[y]=(((*a1)*(*(--ptr)))>>12)+b2[y];
- }
- tmp=b1;
- b1=b2;
- b2=tmp;
- a1++;
- }
- ptr=a2+10;
- while (ptr>a2) (*a2++)>>=4;
-}
-
-
-/* do quarter-block output */
-static void do_output_subblock(Real144_internal *glob, unsigned int x)
-{
- int a,b,c,d,e,f,g;
-
- if (x==1) memset(glob->buffer,0,20);
- if ((*glob->iptr)==0) a=0;
- else a=(*glob->iptr)+HALFBLOCK-1;
- glob->iptr++;
- b=*(glob->iptr++);
- c=*(glob->iptr++);
- d=*(glob->iptr++);
- if (a) rotate_block(glob->buffer_2,glob->buffer_a,a);
- memcpy(glob->buffer_b,etable1+b*BLOCKSIZE,BLOCKSIZE*2);
- e=((ftable1[b]>>4)*glob->gval)>>8;
- memcpy(glob->buffer_c,etable2+c*BLOCKSIZE,BLOCKSIZE*2);
- f=((ftable2[c]>>4)*glob->gval)>>8;
- if (a) g=irms(glob->buffer_a,glob->gval)>>12;
- else g=0;
- add_wav(glob,d,a,g,e,f,glob->buffer_a,glob->buffer_b,glob->buffer_c,glob->buffer_d);
- memmove(glob->buffer_2,glob->buffer_2+BLOCKSIZE,(BUFFERSIZE-BLOCKSIZE)*2);
- memcpy(glob->buffer_2+BUFFERSIZE-BLOCKSIZE,glob->buffer_d,BLOCKSIZE*2);
- final(glob,glob->gsp,glob->buffer_d,glob->output_buffer,glob->buffer,BLOCKSIZE);
-}
-
-/* rotate block */
-static void rotate_block(short *source, short *target, int offset)
-{
- short *end;
- short *ptr1;
- short *ptr2;
- short *ptr3;
- ptr2=source+BUFFERSIZE;
- ptr3=ptr1=ptr2-offset;
- end=target+BLOCKSIZE;
- while (target<end) {
- *(target++)=*(ptr3++);
- if (ptr3==ptr2) ptr3=ptr1;
- }
-}
-
-/* inverse root mean square */
-static int irms(short *data, int factor)
-{
- short *p1,*p2;
- unsigned int sum;
- p2=(p1=data)+BLOCKSIZE;
- for (sum=0;p2>p1;p1++) sum+=(*p1)*(*p1);
- if (sum==0) return 0; /* OOPS - division by zero */
- return (0x20000000/(t_sqrt(sum)>>8))*factor;
-}
-
-/* multiply/add wavetable */
-static void add_wav(Real144_internal *glob, int n, int f, int m1, int m2, int m3, short *s1, short *s2, short *s3, short *dest)
-{
- int a,b,c;
- short *ptr,*ptr2;
-
- ptr=glob->wavtable1+n*9;
- ptr2=glob->wavtable2+n*9;
- if (f!=0) {
- a=((*ptr)*m1)>>((*ptr2)+1);
- } else {
- a=0;
- }
- ptr++;ptr2++;
- b=((*ptr)*m2)>>((*ptr2)+1);
- ptr++;ptr2++;
- c=((*ptr)*m3)>>((*ptr2)+1);
- ptr2=(ptr=dest)+BLOCKSIZE;
- if (f!=0)
- while (ptr<ptr2)
- *(ptr++)=((*(s1++))*a+(*(s2++))*b+(*(s3++))*c)>>12;
- else
- while (ptr<ptr2)
- *(ptr++)=((*(s2++))*b+(*(s3++))*c)>>12;
-}
-
-
-static void final(Real144_internal *glob, short *i1, short *i2, void *out, int *statbuf, int len)
-{
- int x,sum;
- int buffer[10];
- short *ptr;
- short *ptr2;
-
- memcpy(glob->work,statbuf,20);
- memcpy(glob->work+10,i2,len*2);
-
- buffer[9]=i1[0];
- buffer[8]=i1[1];
- buffer[7]=i1[2];
- buffer[6]=i1[3];
- buffer[5]=i1[4];
- buffer[4]=i1[5];
- buffer[3]=i1[6];
- buffer[2]=i1[7];
- buffer[1]=i1[8];
- buffer[0]=i1[9];
-
- ptr2=(ptr=glob->work)+len;
- while (ptr<ptr2) {
- for(sum=0,x=0;x<=9;x++)
- sum+=buffer[x]*(ptr[x]);
- sum=sum>>12;
- x=ptr[10]-sum;
- if (x<-32768 || x>32767)
- {
- memset(out,0,len*2);
- memset(statbuf,0,20);
- return;
- }
- ptr[10]=x;
- ptr++;
- }
- memcpy(out,ptr+10-len,len*2);
- memcpy(statbuf,ptr,20);
-}
-
-/* Decode 20-byte input */
-static void unpack_input(unsigned char *input, unsigned int *output)
-{
- unsigned int outbuffer[28];
- unsigned short inbuffer[10];
- unsigned int x;
- unsigned int *ptr;
-
- /* fix endianness */
- for (x=0;x<20;x+=2)
- inbuffer[x/2]=(input[x]<<8)+input[x+1];
-
- /* unpack */
- ptr=outbuffer;
- *(ptr++)=27;
- *(ptr++)=(inbuffer[0]>>10)&0x3f;
- *(ptr++)=(inbuffer[0]>>5)&0x1f;
- *(ptr++)=inbuffer[0]&0x1f;
- *(ptr++)=(inbuffer[1]>>12)&0xf;
- *(ptr++)=(inbuffer[1]>>8)&0xf;
- *(ptr++)=(inbuffer[1]>>5)&7;
- *(ptr++)=(inbuffer[1]>>2)&7;
- *(ptr++)=((inbuffer[1]<<1)&6)|((inbuffer[2]>>15)&1);
- *(ptr++)=(inbuffer[2]>>12)&7;
- *(ptr++)=(inbuffer[2]>>10)&3;
- *(ptr++)=(inbuffer[2]>>5)&0x1f;
- *(ptr++)=((inbuffer[2]<<2)&0x7c)|((inbuffer[3]>>14)&3);
- *(ptr++)=(inbuffer[3]>>6)&0xff;
- *(ptr++)=((inbuffer[3]<<1)&0x7e)|((inbuffer[4]>>15)&1);
- *(ptr++)=(inbuffer[4]>>8)&0x7f;
- *(ptr++)=(inbuffer[4]>>1)&0x7f;
- *(ptr++)=((inbuffer[4]<<7)&0x80)|((inbuffer[5]>>9)&0x7f);
- *(ptr++)=(inbuffer[5]>>2)&0x7f;
- *(ptr++)=((inbuffer[5]<<5)&0x60)|((inbuffer[6]>>11)&0x1f);
- *(ptr++)=(inbuffer[6]>>4)&0x7f;
- *(ptr++)=((inbuffer[6]<<4)&0xf0)|((inbuffer[7]>>12)&0xf);
- *(ptr++)=(inbuffer[7]>>5)&0x7f;
- *(ptr++)=((inbuffer[7]<<2)&0x7c)|((inbuffer[8]>>14)&3);
- *(ptr++)=(inbuffer[8]>>7)&0x7f;
- *(ptr++)=((inbuffer[8]<<1)&0xfe)|((inbuffer[9]>>15)&1);
- *(ptr++)=(inbuffer[9]>>8)&0x7f;
- *(ptr++)=(inbuffer[9]>>1)&0x7f;
-
- *(output++)=outbuffer[11];
- for (x=1;x<11;*(output++)=outbuffer[x++]);
- ptr=outbuffer+12;
- for (x=0;x<16;x+=4)
- {
- *(output++)=ptr[x];
- *(output++)=ptr[x+2];
- *(output++)=ptr[x+3];
- *(output++)=ptr[x+1];
- }
-}
-
-static unsigned int rms(int *data, int f)
-{
- int *c;
- int x;
- unsigned int res;
- int b;
-
- c=data;
- b=0;
- res=0x10000;
- for (x=0;x<10;x++)
- {
- res=(((0x1000000-(*c)*(*c))>>12)*res)>>12;
- if (res==0) return 0;
- if (res<=0x3fff)
- {
- while (res<=0x3fff)
- {
- b++;
- res<<=2;
- }
- } else {
- if (res>0x10000)
- return 0; /* We're screwed, might as well go out with a bang. :P */
- }
- c++;
- }
- if (res>0) res=t_sqrt(res);
-
- res>>=(b+10);
- res=(res*f)>>10;
- return res;
-}
-
-static void dec1(Real144_internal *glob, int *data, int *inp, int n, int f)
-{
- short *ptr,*end;
-
- *(glob->decptr++)=rms(data,f);
- glob->decptr++;
- end=(ptr=glob->decsp)+(n*10);
- while (ptr<end) *(ptr++)=*(inp++);
-}
-
-static int eq(Real144_internal *glob, short *in, int *target)
-{
- int retval;
- int a;
- int b;
- int c;
- unsigned int u;
- short *sptr;
- int *ptr1,*ptr2,*ptr3;
- int *bp1,*bp2,*temp;
-
- retval=0;
- bp1=glob->buffer1;
- bp2=glob->buffer2;
- ptr2=(ptr3=glob->buffer2)+9;
- sptr=in;
- while (ptr2>=ptr3)
- *(ptr3++)=*(sptr++);
-
- target+=9;
- a=bp2[9];
- *target=a;
- if (a+0x1000>0x1fff)
- return 0; /* We're screwed, might as well go out with a bang. :P */
- c=8;u=a;
- while (c>=0)
- {
- if (u==0x1000) u++;
- if (u==0xfffff000) u--;
- b=0x1000-((u*u)>>12);
- if (b==0) b++;
- ptr2=bp1;
- ptr1=(ptr3=bp2)+c;
- for (u=0;u<=c;u++)
- *(ptr2++)=((*(ptr3++)-(((*target)*(*(ptr1--)))>>12))*(0x1000000/b))>>12;
- *(--target)=u=bp1[(c--)];
- if ((u+0x1000)>0x1fff) retval=1;
- temp=bp2;
- bp2=bp1;
- bp1=temp;
- }
- return retval;
-}
-
-static void dec2(Real144_internal *glob, int *data, int *inp, int n, int f, int *inp2, int l)
-{
- unsigned int *ptr1,*ptr2;
- int work[10];
- int a,b;
- int x;
- int result;
-
- if(l+1<NBLOCKS/2) a=NBLOCKS-(l+1);
- else a=l+1;
- b=NBLOCKS-a;
- if (l==0)
- {
- glob->decsp=glob->sptr=glob->gbuf2;
- glob->decptr=glob->gbuf1;
- }
- ptr1=inp;
- ptr2=inp2;
- for (x=0;x<10*n;x++)
- *(glob->sptr++)=(a*(*ptr1++)+b*(*ptr2++))>>2;
- result=eq(glob,glob->decsp,work);
- if (result==1)
- {
- dec1(glob,data,inp,n,f);
- } else {
- *(glob->decptr++)=rms(work,f);
- glob->decptr++;
- }
- glob->decsp+=n*10;
-}
-
-/* Uncompress one block (20 bytes -> 160*2 bytes) */
-static int ra144_decode_frame(AVCodecContext * avctx,
- void *vdata, int *data_size,
- uint8_t * buf, int buf_size)
-{
- unsigned int a,b,c;
- long s;
- signed short *shptr;
- unsigned int *lptr,*temp;
- const short **dptr;
- int16_t *datao;
- int16_t *data = vdata;
- Real144_internal *glob=avctx->priv_data;
-
- if(buf_size==0)
- return 0;
-
- datao = data;
- unpack_input(buf,glob->unpacked);
-
- glob->iptr=glob->unpacked;
- glob->val=decodetable[0][(*(glob->iptr++))<<1];
-
- dptr=decodetable+1;
- lptr=glob->swapbuf1;
- while (lptr<glob->swapbuf1+10)
- *(lptr++)=(*(dptr++))[(*(glob->iptr++))<<1];
-
- do_voice(glob->swapbuf1,glob->swapbuf2);
-
- a=t_sqrt(glob->val*glob->oldval)>>12;
-
- for (c=0;c<NBLOCKS;c++) {
- if (c==(NBLOCKS-1)) {
- dec1(glob,glob->swapbuf1,glob->swapbuf2,3,glob->val);
- } else {
- if (c*2==(NBLOCKS-2)) {
- if (glob->oldval<glob->val) {
- dec2(glob,glob->swapbuf1,glob->swapbuf2,3,a,glob->swapbuf2alt,c);
- } else {
- dec2(glob,glob->swapbuf1alt,glob->swapbuf2alt,3,a,glob->swapbuf2,c);
- }
- } else {
- if (c*2<(NBLOCKS-2)) {
- dec2(glob,glob->swapbuf1alt,glob->swapbuf2alt,3,glob->oldval,glob->swapbuf2,c);
- } else {
- dec2(glob,glob->swapbuf1,glob->swapbuf2,3,glob->val,glob->swapbuf2alt,c);
- }
- }
- }
- }
-
- /* do output */
- for (b=0,c=0;c<4;c++) {
- glob->gval=glob->gbuf1[c*2];
- glob->gsp=glob->gbuf2+b;
- do_output_subblock(glob,glob->resetflag);
- glob->resetflag=0;
-
- shptr=glob->output_buffer;
- while (shptr<glob->output_buffer+BLOCKSIZE) {
- s=*(shptr++)<<2;
- *data=s;
- if (s>32767) *data=32767;
- if (s<-32767) *data=-32768;
- data++;
- }
- b+=30;
- }
-
- glob->oldval=glob->val;
- temp=glob->swapbuf1alt;
- glob->swapbuf1alt=glob->swapbuf1;
- glob->swapbuf1=temp;
- temp=glob->swapbuf2alt;
- glob->swapbuf2alt=glob->swapbuf2;
- glob->swapbuf2=temp;
- *data_size=(data-datao)*sizeof(*data);
- return 20;
-}
-
-
-AVCodec ra_144_decoder =
-{
- "real_144",
- CODEC_TYPE_AUDIO,
- CODEC_ID_RA_144,
- sizeof(Real144_internal),
- ra144_decode_init,
- NULL,
- NULL,
- ra144_decode_frame,
-};
diff --git a/src/libffmpeg/libavcodec/ra144.h b/src/libffmpeg/libavcodec/ra144.h
deleted file mode 100644
index 6d477b2f8..000000000
--- a/src/libffmpeg/libavcodec/ra144.h
+++ /dev/null
@@ -1,2428 +0,0 @@
-/*
- * Real Audio 1.0 (14.4K)
- * Copyright (c) 2003 the ffmpeg project
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef RA144TABLES_H
-#define RA144TABLES_H
-
-/* 14.4 data tables */
-static const unsigned short sqrt_table[4096]={
-0x0000,0x0400,0x05a8,0x06ed,0x0800,0x08f1,0x09cc,0x0a95,
-0x0b50,0x0c00,0x0ca6,0x0d44,0x0ddb,0x0e6c,0x0ef7,0x0f7d,
-0x1000,0x107e,0x10f8,0x116f,0x11e3,0x1254,0x12c2,0x132e,
-0x1398,0x1400,0x1465,0x14c8,0x152a,0x158a,0x15e8,0x1645,
-0x16a0,0x16fa,0x1752,0x17aa,0x1800,0x1854,0x18a8,0x18fa,
-0x194c,0x199c,0x19ec,0x1a3a,0x1a88,0x1ad5,0x1b21,0x1b6c,
-0x1bb6,0x1c00,0x1c48,0x1c90,0x1cd8,0x1d1e,0x1d64,0x1daa,
-0x1dee,0x1e33,0x1e76,0x1eb9,0x1efb,0x1f3d,0x1f7e,0x1fbf,
-0x2000,0x203f,0x207f,0x20bd,0x20fc,0x2139,0x2177,0x21b4,
-0x21f0,0x222d,0x2268,0x22a4,0x22df,0x2319,0x2353,0x238d,
-0x23c6,0x2400,0x2438,0x2471,0x24a9,0x24e0,0x2518,0x254f,
-0x2585,0x25bc,0x25f2,0x2628,0x265d,0x2693,0x26c8,0x26fc,
-0x2731,0x2765,0x2799,0x27cc,0x2800,0x2833,0x2865,0x2898,
-0x28ca,0x28fc,0x292e,0x2960,0x2991,0x29c2,0x29f3,0x2a24,
-0x2a54,0x2a85,0x2ab5,0x2ae5,0x2b14,0x2b44,0x2b73,0x2ba2,
-0x2bd1,0x2c00,0x2c2e,0x2c5c,0x2c8a,0x2cb8,0x2ce6,0x2d13,
-0x2d41,0x2d6e,0x2d9b,0x2dc8,0x2df4,0x2e21,0x2e4d,0x2e79,
-0x2ea5,0x2ed1,0x2efd,0x2f28,0x2f54,0x2f7f,0x2faa,0x2fd5,
-0x3000,0x302a,0x3055,0x307f,0x30a9,0x30d3,0x30fd,0x3127,
-0x3150,0x317a,0x31a3,0x31cc,0x31f5,0x321e,0x3247,0x3270,
-0x3298,0x32c1,0x32e9,0x3311,0x3339,0x3361,0x3389,0x33b0,
-0x33d8,0x3400,0x3427,0x344e,0x3475,0x349c,0x34c3,0x34ea,
-0x3510,0x3537,0x355d,0x3584,0x35aa,0x35d0,0x35f6,0x361c,
-0x3642,0x3667,0x368d,0x36b2,0x36d8,0x36fd,0x3722,0x3747,
-0x376c,0x3791,0x37b6,0x37db,0x3800,0x3824,0x3848,0x386d,
-0x3891,0x38b5,0x38d9,0x38fd,0x3921,0x3945,0x3969,0x398c,
-0x39b0,0x39d3,0x39f7,0x3a1a,0x3a3d,0x3a60,0x3a83,0x3aa6,
-0x3ac9,0x3aec,0x3b0f,0x3b31,0x3b54,0x3b76,0x3b99,0x3bbb,
-0x3bdd,0x3c00,0x3c22,0x3c44,0x3c66,0x3c87,0x3ca9,0x3ccb,
-0x3ced,0x3d0e,0x3d30,0x3d51,0x3d72,0x3d94,0x3db5,0x3dd6,
-0x3df7,0x3e18,0x3e39,0x3e5a,0x3e7b,0x3e9c,0x3ebc,0x3edd,
-0x3efd,0x3f1e,0x3f3e,0x3f5f,0x3f7f,0x3f9f,0x3fbf,0x3fdf,
-0x4000,0x401f,0x403f,0x405f,0x407f,0x409f,0x40be,0x40de,
-0x40fe,0x411d,0x413c,0x415c,0x417b,0x419a,0x41ba,0x41d9,
-0x41f8,0x4217,0x4236,0x4255,0x4273,0x4292,0x42b1,0x42d0,
-0x42ee,0x430d,0x432b,0x434a,0x4368,0x4387,0x43a5,0x43c3,
-0x43e1,0x4400,0x441e,0x443c,0x445a,0x4478,0x4495,0x44b3,
-0x44d1,0x44ef,0x450c,0x452a,0x4548,0x4565,0x4583,0x45a0,
-0x45be,0x45db,0x45f8,0x4615,0x4633,0x4650,0x466d,0x468a,
-0x46a7,0x46c4,0x46e1,0x46fe,0x471b,0x4737,0x4754,0x4771,
-0x478d,0x47aa,0x47c7,0x47e3,0x4800,0x481c,0x4838,0x4855,
-0x4871,0x488d,0x48a9,0x48c6,0x48e2,0x48fe,0x491a,0x4936,
-0x4952,0x496e,0x498a,0x49a5,0x49c1,0x49dd,0x49f9,0x4a14,
-0x4a30,0x4a4b,0x4a67,0x4a83,0x4a9e,0x4ab9,0x4ad5,0x4af0,
-0x4b0b,0x4b27,0x4b42,0x4b5d,0x4b78,0x4b93,0x4bae,0x4bca,
-0x4be5,0x4c00,0x4c1a,0x4c35,0x4c50,0x4c6b,0x4c86,0x4ca1,
-0x4cbb,0x4cd6,0x4cf1,0x4d0b,0x4d26,0x4d40,0x4d5b,0x4d75,
-0x4d90,0x4daa,0x4dc4,0x4ddf,0x4df9,0x4e13,0x4e2d,0x4e48,
-0x4e62,0x4e7c,0x4e96,0x4eb0,0x4eca,0x4ee4,0x4efe,0x4f18,
-0x4f32,0x4f4c,0x4f65,0x4f7f,0x4f99,0x4fb3,0x4fcc,0x4fe6,
-0x5000,0x5019,0x5033,0x504c,0x5066,0x507f,0x5099,0x50b2,
-0x50cb,0x50e5,0x50fe,0x5117,0x5130,0x514a,0x5163,0x517c,
-0x5195,0x51ae,0x51c7,0x51e0,0x51f9,0x5212,0x522b,0x5244,
-0x525d,0x5276,0x528f,0x52a7,0x52c0,0x52d9,0x52f2,0x530a,
-0x5323,0x533c,0x5354,0x536d,0x5385,0x539e,0x53b6,0x53cf,
-0x53e7,0x5400,0x5418,0x5430,0x5449,0x5461,0x5479,0x5491,
-0x54a9,0x54c2,0x54da,0x54f2,0x550a,0x5522,0x553a,0x5552,
-0x556a,0x5582,0x559a,0x55b2,0x55ca,0x55e2,0x55fa,0x5611,
-0x5629,0x5641,0x5659,0x5670,0x5688,0x56a0,0x56b7,0x56cf,
-0x56e6,0x56fe,0x5716,0x572d,0x5745,0x575c,0x5773,0x578b,
-0x57a2,0x57ba,0x57d1,0x57e8,0x5800,0x5817,0x582e,0x5845,
-0x585c,0x5874,0x588b,0x58a2,0x58b9,0x58d0,0x58e7,0x58fe,
-0x5915,0x592c,0x5943,0x595a,0x5971,0x5988,0x599f,0x59b5,
-0x59cc,0x59e3,0x59fa,0x5a11,0x5a27,0x5a3e,0x5a55,0x5a6b,
-0x5a82,0x5a99,0x5aaf,0x5ac6,0x5adc,0x5af3,0x5b09,0x5b20,
-0x5b36,0x5b4d,0x5b63,0x5b7a,0x5b90,0x5ba6,0x5bbd,0x5bd3,
-0x5be9,0x5c00,0x5c16,0x5c2c,0x5c42,0x5c58,0x5c6f,0x5c85,
-0x5c9b,0x5cb1,0x5cc7,0x5cdd,0x5cf3,0x5d09,0x5d1f,0x5d35,
-0x5d4b,0x5d61,0x5d77,0x5d8d,0x5da3,0x5db9,0x5dce,0x5de4,
-0x5dfa,0x5e10,0x5e26,0x5e3b,0x5e51,0x5e67,0x5e7c,0x5e92,
-0x5ea8,0x5ebd,0x5ed3,0x5ee9,0x5efe,0x5f14,0x5f29,0x5f3f,
-0x5f54,0x5f6a,0x5f7f,0x5f95,0x5faa,0x5fbf,0x5fd5,0x5fea,
-0x6000,0x6015,0x602a,0x603f,0x6055,0x606a,0x607f,0x6094,
-0x60aa,0x60bf,0x60d4,0x60e9,0x60fe,0x6113,0x6128,0x613d,
-0x6152,0x6168,0x617d,0x6192,0x61a7,0x61bb,0x61d0,0x61e5,
-0x61fa,0x620f,0x6224,0x6239,0x624e,0x6263,0x6277,0x628c,
-0x62a1,0x62b6,0x62ca,0x62df,0x62f4,0x6309,0x631d,0x6332,
-0x6347,0x635b,0x6370,0x6384,0x6399,0x63ad,0x63c2,0x63d7,
-0x63eb,0x6400,0x6414,0x6428,0x643d,0x6451,0x6466,0x647a,
-0x648e,0x64a3,0x64b7,0x64cb,0x64e0,0x64f4,0x6508,0x651d,
-0x6531,0x6545,0x6559,0x656e,0x6582,0x6596,0x65aa,0x65be,
-0x65d2,0x65e6,0x65fa,0x660f,0x6623,0x6637,0x664b,0x665f,
-0x6673,0x6687,0x669b,0x66af,0x66c3,0x66d6,0x66ea,0x66fe,
-0x6712,0x6726,0x673a,0x674e,0x6761,0x6775,0x6789,0x679d,
-0x67b1,0x67c4,0x67d8,0x67ec,0x6800,0x6813,0x6827,0x683b,
-0x684e,0x6862,0x6875,0x6889,0x689d,0x68b0,0x68c4,0x68d7,
-0x68eb,0x68fe,0x6912,0x6925,0x6939,0x694c,0x6960,0x6973,
-0x6986,0x699a,0x69ad,0x69c1,0x69d4,0x69e7,0x69fb,0x6a0e,
-0x6a21,0x6a35,0x6a48,0x6a5b,0x6a6e,0x6a82,0x6a95,0x6aa8,
-0x6abb,0x6ace,0x6ae2,0x6af5,0x6b08,0x6b1b,0x6b2e,0x6b41,
-0x6b54,0x6b67,0x6b7a,0x6b8d,0x6ba1,0x6bb4,0x6bc7,0x6bda,
-0x6bed,0x6c00,0x6c12,0x6c25,0x6c38,0x6c4b,0x6c5e,0x6c71,
-0x6c84,0x6c97,0x6caa,0x6cbc,0x6ccf,0x6ce2,0x6cf5,0x6d08,
-0x6d1a,0x6d2d,0x6d40,0x6d53,0x6d65,0x6d78,0x6d8b,0x6d9e,
-0x6db0,0x6dc3,0x6dd6,0x6de8,0x6dfb,0x6e0d,0x6e20,0x6e33,
-0x6e45,0x6e58,0x6e6a,0x6e7d,0x6e8f,0x6ea2,0x6eb4,0x6ec7,
-0x6ed9,0x6eec,0x6efe,0x6f11,0x6f23,0x6f36,0x6f48,0x6f5a,
-0x6f6d,0x6f7f,0x6f92,0x6fa4,0x6fb6,0x6fc9,0x6fdb,0x6fed,
-0x7000,0x7012,0x7024,0x7036,0x7049,0x705b,0x706d,0x707f,
-0x7091,0x70a4,0x70b6,0x70c8,0x70da,0x70ec,0x70fe,0x7110,
-0x7123,0x7135,0x7147,0x7159,0x716b,0x717d,0x718f,0x71a1,
-0x71b3,0x71c5,0x71d7,0x71e9,0x71fb,0x720d,0x721f,0x7231,
-0x7243,0x7255,0x7267,0x7279,0x728a,0x729c,0x72ae,0x72c0,
-0x72d2,0x72e4,0x72f5,0x7307,0x7319,0x732b,0x733d,0x734e,
-0x7360,0x7372,0x7384,0x7395,0x73a7,0x73b9,0x73ca,0x73dc,
-0x73ee,0x7400,0x7411,0x7423,0x7434,0x7446,0x7458,0x7469,
-0x747b,0x748c,0x749e,0x74b0,0x74c1,0x74d3,0x74e4,0x74f6,
-0x7507,0x7519,0x752a,0x753c,0x754d,0x755f,0x7570,0x7581,
-0x7593,0x75a4,0x75b6,0x75c7,0x75d8,0x75ea,0x75fb,0x760d,
-0x761e,0x762f,0x7641,0x7652,0x7663,0x7674,0x7686,0x7697,
-0x76a8,0x76ba,0x76cb,0x76dc,0x76ed,0x76fe,0x7710,0x7721,
-0x7732,0x7743,0x7754,0x7766,0x7777,0x7788,0x7799,0x77aa,
-0x77bb,0x77cc,0x77dd,0x77ee,0x7800,0x7811,0x7822,0x7833,
-0x7844,0x7855,0x7866,0x7877,0x7888,0x7899,0x78aa,0x78bb,
-0x78cc,0x78dd,0x78ee,0x78fe,0x790f,0x7920,0x7931,0x7942,
-0x7953,0x7964,0x7975,0x7986,0x7996,0x79a7,0x79b8,0x79c9,
-0x79da,0x79eb,0x79fb,0x7a0c,0x7a1d,0x7a2e,0x7a3e,0x7a4f,
-0x7a60,0x7a71,0x7a81,0x7a92,0x7aa3,0x7ab3,0x7ac4,0x7ad5,
-0x7ae5,0x7af6,0x7b07,0x7b17,0x7b28,0x7b39,0x7b49,0x7b5a,
-0x7b6b,0x7b7b,0x7b8c,0x7b9c,0x7bad,0x7bbd,0x7bce,0x7bde,
-0x7bef,0x7c00,0x7c10,0x7c21,0x7c31,0x7c41,0x7c52,0x7c62,
-0x7c73,0x7c83,0x7c94,0x7ca4,0x7cb5,0x7cc5,0x7cd5,0x7ce6,
-0x7cf6,0x7d07,0x7d17,0x7d27,0x7d38,0x7d48,0x7d58,0x7d69,
-0x7d79,0x7d89,0x7d9a,0x7daa,0x7dba,0x7dcb,0x7ddb,0x7deb,
-0x7dfb,0x7e0c,0x7e1c,0x7e2c,0x7e3c,0x7e4d,0x7e5d,0x7e6d,
-0x7e7d,0x7e8d,0x7e9e,0x7eae,0x7ebe,0x7ece,0x7ede,0x7eee,
-0x7efe,0x7f0f,0x7f1f,0x7f2f,0x7f3f,0x7f4f,0x7f5f,0x7f6f,
-0x7f7f,0x7f8f,0x7f9f,0x7faf,0x7fbf,0x7fcf,0x7fdf,0x7fef,
-0x8000,0x800f,0x801f,0x802f,0x803f,0x804f,0x805f,0x806f,
-0x807f,0x808f,0x809f,0x80af,0x80bf,0x80cf,0x80df,0x80ef,
-0x80ff,0x810e,0x811e,0x812e,0x813e,0x814e,0x815e,0x816d,
-0x817d,0x818d,0x819d,0x81ad,0x81bc,0x81cc,0x81dc,0x81ec,
-0x81fc,0x820b,0x821b,0x822b,0x823b,0x824a,0x825a,0x826a,
-0x8279,0x8289,0x8299,0x82a8,0x82b8,0x82c8,0x82d7,0x82e7,
-0x82f7,0x8306,0x8316,0x8326,0x8335,0x8345,0x8354,0x8364,
-0x8374,0x8383,0x8393,0x83a2,0x83b2,0x83c1,0x83d1,0x83e0,
-0x83f0,0x8400,0x840f,0x841f,0x842e,0x843e,0x844d,0x845c,
-0x846c,0x847b,0x848b,0x849a,0x84aa,0x84b9,0x84c9,0x84d8,
-0x84e7,0x84f7,0x8506,0x8516,0x8525,0x8534,0x8544,0x8553,
-0x8562,0x8572,0x8581,0x8591,0x85a0,0x85af,0x85be,0x85ce,
-0x85dd,0x85ec,0x85fc,0x860b,0x861a,0x862a,0x8639,0x8648,
-0x8657,0x8667,0x8676,0x8685,0x8694,0x86a3,0x86b3,0x86c2,
-0x86d1,0x86e0,0x86ef,0x86ff,0x870e,0x871d,0x872c,0x873b,
-0x874a,0x8759,0x8769,0x8778,0x8787,0x8796,0x87a5,0x87b4,
-0x87c3,0x87d2,0x87e1,0x87f0,0x8800,0x880f,0x881e,0x882d,
-0x883c,0x884b,0x885a,0x8869,0x8878,0x8887,0x8896,0x88a5,
-0x88b4,0x88c3,0x88d2,0x88e1,0x88f0,0x88ff,0x890e,0x891c,
-0x892b,0x893a,0x8949,0x8958,0x8967,0x8976,0x8985,0x8994,
-0x89a3,0x89b2,0x89c0,0x89cf,0x89de,0x89ed,0x89fc,0x8a0b,
-0x8a19,0x8a28,0x8a37,0x8a46,0x8a55,0x8a64,0x8a72,0x8a81,
-0x8a90,0x8a9f,0x8aad,0x8abc,0x8acb,0x8ada,0x8ae8,0x8af7,
-0x8b06,0x8b15,0x8b23,0x8b32,0x8b41,0x8b50,0x8b5e,0x8b6d,
-0x8b7c,0x8b8a,0x8b99,0x8ba8,0x8bb6,0x8bc5,0x8bd4,0x8be2,
-0x8bf1,0x8c00,0x8c0e,0x8c1d,0x8c2b,0x8c3a,0x8c49,0x8c57,
-0x8c66,0x8c74,0x8c83,0x8c91,0x8ca0,0x8caf,0x8cbd,0x8ccc,
-0x8cda,0x8ce9,0x8cf7,0x8d06,0x8d14,0x8d23,0x8d31,0x8d40,
-0x8d4e,0x8d5d,0x8d6b,0x8d7a,0x8d88,0x8d97,0x8da5,0x8db4,
-0x8dc2,0x8dd1,0x8ddf,0x8ded,0x8dfc,0x8e0a,0x8e19,0x8e27,
-0x8e36,0x8e44,0x8e52,0x8e61,0x8e6f,0x8e7d,0x8e8c,0x8e9a,
-0x8ea9,0x8eb7,0x8ec5,0x8ed4,0x8ee2,0x8ef0,0x8eff,0x8f0d,
-0x8f1b,0x8f2a,0x8f38,0x8f46,0x8f54,0x8f63,0x8f71,0x8f7f,
-0x8f8e,0x8f9c,0x8faa,0x8fb8,0x8fc7,0x8fd5,0x8fe3,0x8ff1,
-0x9000,0x900e,0x901c,0x902a,0x9038,0x9047,0x9055,0x9063,
-0x9071,0x907f,0x908d,0x909c,0x90aa,0x90b8,0x90c6,0x90d4,
-0x90e2,0x90f0,0x90ff,0x910d,0x911b,0x9129,0x9137,0x9145,
-0x9153,0x9161,0x916f,0x917e,0x918c,0x919a,0x91a8,0x91b6,
-0x91c4,0x91d2,0x91e0,0x91ee,0x91fc,0x920a,0x9218,0x9226,
-0x9234,0x9242,0x9250,0x925e,0x926c,0x927a,0x9288,0x9296,
-0x92a4,0x92b2,0x92c0,0x92ce,0x92dc,0x92ea,0x92f8,0x9306,
-0x9314,0x9321,0x932f,0x933d,0x934b,0x9359,0x9367,0x9375,
-0x9383,0x9391,0x939f,0x93ac,0x93ba,0x93c8,0x93d6,0x93e4,
-0x93f2,0x9400,0x940d,0x941b,0x9429,0x9437,0x9445,0x9452,
-0x9460,0x946e,0x947c,0x948a,0x9497,0x94a5,0x94b3,0x94c1,
-0x94cf,0x94dc,0x94ea,0x94f8,0x9506,0x9513,0x9521,0x952f,
-0x953c,0x954a,0x9558,0x9566,0x9573,0x9581,0x958f,0x959c,
-0x95aa,0x95b8,0x95c5,0x95d3,0x95e1,0x95ee,0x95fc,0x960a,
-0x9617,0x9625,0x9633,0x9640,0x964e,0x965c,0x9669,0x9677,
-0x9684,0x9692,0x96a0,0x96ad,0x96bb,0x96c8,0x96d6,0x96e4,
-0x96f1,0x96ff,0x970c,0x971a,0x9727,0x9735,0x9742,0x9750,
-0x975d,0x976b,0x9779,0x9786,0x9794,0x97a1,0x97af,0x97bc,
-0x97ca,0x97d7,0x97e5,0x97f2,0x9800,0x980d,0x981a,0x9828,
-0x9835,0x9843,0x9850,0x985e,0x986b,0x9879,0x9886,0x9893,
-0x98a1,0x98ae,0x98bc,0x98c9,0x98d6,0x98e4,0x98f1,0x98ff,
-0x990c,0x9919,0x9927,0x9934,0x9942,0x994f,0x995c,0x996a,
-0x9977,0x9984,0x9992,0x999f,0x99ac,0x99ba,0x99c7,0x99d4,
-0x99e2,0x99ef,0x99fc,0x9a09,0x9a17,0x9a24,0x9a31,0x9a3f,
-0x9a4c,0x9a59,0x9a66,0x9a74,0x9a81,0x9a8e,0x9a9b,0x9aa9,
-0x9ab6,0x9ac3,0x9ad0,0x9ade,0x9aeb,0x9af8,0x9b05,0x9b12,
-0x9b20,0x9b2d,0x9b3a,0x9b47,0x9b54,0x9b62,0x9b6f,0x9b7c,
-0x9b89,0x9b96,0x9ba3,0x9bb1,0x9bbe,0x9bcb,0x9bd8,0x9be5,
-0x9bf2,0x9c00,0x9c0d,0x9c1a,0x9c27,0x9c34,0x9c41,0x9c4e,
-0x9c5b,0x9c68,0x9c75,0x9c83,0x9c90,0x9c9d,0x9caa,0x9cb7,
-0x9cc4,0x9cd1,0x9cde,0x9ceb,0x9cf8,0x9d05,0x9d12,0x9d1f,
-0x9d2c,0x9d39,0x9d46,0x9d53,0x9d60,0x9d6d,0x9d7a,0x9d87,
-0x9d94,0x9da1,0x9dae,0x9dbb,0x9dc8,0x9dd5,0x9de2,0x9def,
-0x9dfc,0x9e09,0x9e16,0x9e23,0x9e30,0x9e3d,0x9e4a,0x9e57,
-0x9e64,0x9e71,0x9e7e,0x9e8b,0x9e98,0x9ea4,0x9eb1,0x9ebe,
-0x9ecb,0x9ed8,0x9ee5,0x9ef2,0x9eff,0x9f0c,0x9f18,0x9f25,
-0x9f32,0x9f3f,0x9f4c,0x9f59,0x9f66,0x9f72,0x9f7f,0x9f8c,
-0x9f99,0x9fa6,0x9fb3,0x9fbf,0x9fcc,0x9fd9,0x9fe6,0x9ff3,
-0xa000,0xa00c,0xa019,0xa026,0xa033,0xa03f,0xa04c,0xa059,
-0xa066,0xa073,0xa07f,0xa08c,0xa099,0xa0a6,0xa0b2,0xa0bf,
-0xa0cc,0xa0d9,0xa0e5,0xa0f2,0xa0ff,0xa10b,0xa118,0xa125,
-0xa132,0xa13e,0xa14b,0xa158,0xa164,0xa171,0xa17e,0xa18a,
-0xa197,0xa1a4,0xa1b0,0xa1bd,0xa1ca,0xa1d6,0xa1e3,0xa1f0,
-0xa1fc,0xa209,0xa216,0xa222,0xa22f,0xa23c,0xa248,0xa255,
-0xa261,0xa26e,0xa27b,0xa287,0xa294,0xa2a0,0xa2ad,0xa2ba,
-0xa2c6,0xa2d3,0xa2df,0xa2ec,0xa2f8,0xa305,0xa312,0xa31e,
-0xa32b,0xa337,0xa344,0xa350,0xa35d,0xa369,0xa376,0xa382,
-0xa38f,0xa39b,0xa3a8,0xa3b5,0xa3c1,0xa3ce,0xa3da,0xa3e7,
-0xa3f3,0xa400,0xa40c,0xa418,0xa425,0xa431,0xa43e,0xa44a,
-0xa457,0xa463,0xa470,0xa47c,0xa489,0xa495,0xa4a2,0xa4ae,
-0xa4ba,0xa4c7,0xa4d3,0xa4e0,0xa4ec,0xa4f9,0xa505,0xa511,
-0xa51e,0xa52a,0xa537,0xa543,0xa54f,0xa55c,0xa568,0xa574,
-0xa581,0xa58d,0xa59a,0xa5a6,0xa5b2,0xa5bf,0xa5cb,0xa5d7,
-0xa5e4,0xa5f0,0xa5fc,0xa609,0xa615,0xa621,0xa62e,0xa63a,
-0xa646,0xa653,0xa65f,0xa66b,0xa678,0xa684,0xa690,0xa69d,
-0xa6a9,0xa6b5,0xa6c1,0xa6ce,0xa6da,0xa6e6,0xa6f2,0xa6ff,
-0xa70b,0xa717,0xa724,0xa730,0xa73c,0xa748,0xa754,0xa761,
-0xa76d,0xa779,0xa785,0xa792,0xa79e,0xa7aa,0xa7b6,0xa7c3,
-0xa7cf,0xa7db,0xa7e7,0xa7f3,0xa800,0xa80c,0xa818,0xa824,
-0xa830,0xa83c,0xa849,0xa855,0xa861,0xa86d,0xa879,0xa885,
-0xa892,0xa89e,0xa8aa,0xa8b6,0xa8c2,0xa8ce,0xa8da,0xa8e6,
-0xa8f3,0xa8ff,0xa90b,0xa917,0xa923,0xa92f,0xa93b,0xa947,
-0xa953,0xa960,0xa96c,0xa978,0xa984,0xa990,0xa99c,0xa9a8,
-0xa9b4,0xa9c0,0xa9cc,0xa9d8,0xa9e4,0xa9f0,0xa9fc,0xaa09,
-0xaa15,0xaa21,0xaa2d,0xaa39,0xaa45,0xaa51,0xaa5d,0xaa69,
-0xaa75,0xaa81,0xaa8d,0xaa99,0xaaa5,0xaab1,0xaabd,0xaac9,
-0xaad5,0xaae1,0xaaed,0xaaf9,0xab05,0xab11,0xab1d,0xab29,
-0xab35,0xab41,0xab4d,0xab58,0xab64,0xab70,0xab7c,0xab88,
-0xab94,0xaba0,0xabac,0xabb8,0xabc4,0xabd0,0xabdc,0xabe8,
-0xabf4,0xac00,0xac0b,0xac17,0xac23,0xac2f,0xac3b,0xac47,
-0xac53,0xac5f,0xac6b,0xac76,0xac82,0xac8e,0xac9a,0xaca6,
-0xacb2,0xacbe,0xacc9,0xacd5,0xace1,0xaced,0xacf9,0xad05,
-0xad11,0xad1c,0xad28,0xad34,0xad40,0xad4c,0xad57,0xad63,
-0xad6f,0xad7b,0xad87,0xad92,0xad9e,0xadaa,0xadb6,0xadc2,
-0xadcd,0xadd9,0xade5,0xadf1,0xadfd,0xae08,0xae14,0xae20,
-0xae2c,0xae37,0xae43,0xae4f,0xae5b,0xae66,0xae72,0xae7e,
-0xae8a,0xae95,0xaea1,0xaead,0xaeb8,0xaec4,0xaed0,0xaedc,
-0xaee7,0xaef3,0xaeff,0xaf0a,0xaf16,0xaf22,0xaf2e,0xaf39,
-0xaf45,0xaf51,0xaf5c,0xaf68,0xaf74,0xaf7f,0xaf8b,0xaf97,
-0xafa2,0xafae,0xafba,0xafc5,0xafd1,0xafdd,0xafe8,0xaff4,
-0xb000,0xb00b,0xb017,0xb022,0xb02e,0xb03a,0xb045,0xb051,
-0xb05c,0xb068,0xb074,0xb07f,0xb08b,0xb097,0xb0a2,0xb0ae,
-0xb0b9,0xb0c5,0xb0d0,0xb0dc,0xb0e8,0xb0f3,0xb0ff,0xb10a,
-0xb116,0xb121,0xb12d,0xb139,0xb144,0xb150,0xb15b,0xb167,
-0xb172,0xb17e,0xb189,0xb195,0xb1a0,0xb1ac,0xb1b8,0xb1c3,
-0xb1cf,0xb1da,0xb1e6,0xb1f1,0xb1fd,0xb208,0xb214,0xb21f,
-0xb22b,0xb236,0xb242,0xb24d,0xb259,0xb264,0xb270,0xb27b,
-0xb286,0xb292,0xb29d,0xb2a9,0xb2b4,0xb2c0,0xb2cb,0xb2d7,
-0xb2e2,0xb2ee,0xb2f9,0xb305,0xb310,0xb31b,0xb327,0xb332,
-0xb33e,0xb349,0xb355,0xb360,0xb36b,0xb377,0xb382,0xb38e,
-0xb399,0xb3a4,0xb3b0,0xb3bb,0xb3c7,0xb3d2,0xb3dd,0xb3e9,
-0xb3f4,0xb400,0xb40b,0xb416,0xb422,0xb42d,0xb438,0xb444,
-0xb44f,0xb45a,0xb466,0xb471,0xb47c,0xb488,0xb493,0xb49f,
-0xb4aa,0xb4b5,0xb4c1,0xb4cc,0xb4d7,0xb4e2,0xb4ee,0xb4f9,
-0xb504,0xb510,0xb51b,0xb526,0xb532,0xb53d,0xb548,0xb554,
-0xb55f,0xb56a,0xb575,0xb581,0xb58c,0xb597,0xb5a3,0xb5ae,
-0xb5b9,0xb5c4,0xb5d0,0xb5db,0xb5e6,0xb5f1,0xb5fd,0xb608,
-0xb613,0xb61e,0xb62a,0xb635,0xb640,0xb64b,0xb657,0xb662,
-0xb66d,0xb678,0xb684,0xb68f,0xb69a,0xb6a5,0xb6b0,0xb6bc,
-0xb6c7,0xb6d2,0xb6dd,0xb6e8,0xb6f4,0xb6ff,0xb70a,0xb715,
-0xb720,0xb72c,0xb737,0xb742,0xb74d,0xb758,0xb763,0xb76f,
-0xb77a,0xb785,0xb790,0xb79b,0xb7a6,0xb7b2,0xb7bd,0xb7c8,
-0xb7d3,0xb7de,0xb7e9,0xb7f4,0xb800,0xb80b,0xb816,0xb821,
-0xb82c,0xb837,0xb842,0xb84d,0xb858,0xb864,0xb86f,0xb87a,
-0xb885,0xb890,0xb89b,0xb8a6,0xb8b1,0xb8bc,0xb8c7,0xb8d3,
-0xb8de,0xb8e9,0xb8f4,0xb8ff,0xb90a,0xb915,0xb920,0xb92b,
-0xb936,0xb941,0xb94c,0xb957,0xb962,0xb96d,0xb978,0xb983,
-0xb98f,0xb99a,0xb9a5,0xb9b0,0xb9bb,0xb9c6,0xb9d1,0xb9dc,
-0xb9e7,0xb9f2,0xb9fd,0xba08,0xba13,0xba1e,0xba29,0xba34,
-0xba3f,0xba4a,0xba55,0xba60,0xba6b,0xba76,0xba81,0xba8c,
-0xba97,0xbaa2,0xbaad,0xbab8,0xbac3,0xbace,0xbad8,0xbae3,
-0xbaee,0xbaf9,0xbb04,0xbb0f,0xbb1a,0xbb25,0xbb30,0xbb3b,
-0xbb46,0xbb51,0xbb5c,0xbb67,0xbb72,0xbb7d,0xbb88,0xbb92,
-0xbb9d,0xbba8,0xbbb3,0xbbbe,0xbbc9,0xbbd4,0xbbdf,0xbbea,
-0xbbf5,0xbc00,0xbc0a,0xbc15,0xbc20,0xbc2b,0xbc36,0xbc41,
-0xbc4c,0xbc57,0xbc61,0xbc6c,0xbc77,0xbc82,0xbc8d,0xbc98,
-0xbca3,0xbcad,0xbcb8,0xbcc3,0xbcce,0xbcd9,0xbce4,0xbcef,
-0xbcf9,0xbd04,0xbd0f,0xbd1a,0xbd25,0xbd30,0xbd3a,0xbd45,
-0xbd50,0xbd5b,0xbd66,0xbd70,0xbd7b,0xbd86,0xbd91,0xbd9c,
-0xbda6,0xbdb1,0xbdbc,0xbdc7,0xbdd2,0xbddc,0xbde7,0xbdf2,
-0xbdfd,0xbe08,0xbe12,0xbe1d,0xbe28,0xbe33,0xbe3d,0xbe48,
-0xbe53,0xbe5e,0xbe68,0xbe73,0xbe7e,0xbe89,0xbe93,0xbe9e,
-0xbea9,0xbeb4,0xbebe,0xbec9,0xbed4,0xbedf,0xbee9,0xbef4,
-0xbeff,0xbf0a,0xbf14,0xbf1f,0xbf2a,0xbf34,0xbf3f,0xbf4a,
-0xbf55,0xbf5f,0xbf6a,0xbf75,0xbf7f,0xbf8a,0xbf95,0xbf9f,
-0xbfaa,0xbfb5,0xbfbf,0xbfca,0xbfd5,0xbfdf,0xbfea,0xbff5,
-0xc000,0xc00a,0xc015,0xc01f,0xc02a,0xc035,0xc03f,0xc04a,
-0xc055,0xc05f,0xc06a,0xc075,0xc07f,0xc08a,0xc095,0xc09f,
-0xc0aa,0xc0b5,0xc0bf,0xc0ca,0xc0d4,0xc0df,0xc0ea,0xc0f4,
-0xc0ff,0xc109,0xc114,0xc11f,0xc129,0xc134,0xc13e,0xc149,
-0xc154,0xc15e,0xc169,0xc173,0xc17e,0xc189,0xc193,0xc19e,
-0xc1a8,0xc1b3,0xc1bd,0xc1c8,0xc1d3,0xc1dd,0xc1e8,0xc1f2,
-0xc1fd,0xc207,0xc212,0xc21d,0xc227,0xc232,0xc23c,0xc247,
-0xc251,0xc25c,0xc266,0xc271,0xc27b,0xc286,0xc290,0xc29b,
-0xc2a5,0xc2b0,0xc2bb,0xc2c5,0xc2d0,0xc2da,0xc2e5,0xc2ef,
-0xc2fa,0xc304,0xc30f,0xc319,0xc324,0xc32e,0xc339,0xc343,
-0xc34e,0xc358,0xc363,0xc36d,0xc377,0xc382,0xc38c,0xc397,
-0xc3a1,0xc3ac,0xc3b6,0xc3c1,0xc3cb,0xc3d6,0xc3e0,0xc3eb,
-0xc3f5,0xc400,0xc40a,0xc414,0xc41f,0xc429,0xc434,0xc43e,
-0xc449,0xc453,0xc45d,0xc468,0xc472,0xc47d,0xc487,0xc492,
-0xc49c,0xc4a6,0xc4b1,0xc4bb,0xc4c6,0xc4d0,0xc4da,0xc4e5,
-0xc4ef,0xc4fa,0xc504,0xc50e,0xc519,0xc523,0xc52e,0xc538,
-0xc542,0xc54d,0xc557,0xc562,0xc56c,0xc576,0xc581,0xc58b,
-0xc595,0xc5a0,0xc5aa,0xc5b4,0xc5bf,0xc5c9,0xc5d4,0xc5de,
-0xc5e8,0xc5f3,0xc5fd,0xc607,0xc612,0xc61c,0xc626,0xc631,
-0xc63b,0xc645,0xc650,0xc65a,0xc664,0xc66f,0xc679,0xc683,
-0xc68e,0xc698,0xc6a2,0xc6ac,0xc6b7,0xc6c1,0xc6cb,0xc6d6,
-0xc6e0,0xc6ea,0xc6f5,0xc6ff,0xc709,0xc713,0xc71e,0xc728,
-0xc732,0xc73d,0xc747,0xc751,0xc75b,0xc766,0xc770,0xc77a,
-0xc784,0xc78f,0xc799,0xc7a3,0xc7ae,0xc7b8,0xc7c2,0xc7cc,
-0xc7d7,0xc7e1,0xc7eb,0xc7f5,0xc800,0xc80a,0xc814,0xc81e,
-0xc828,0xc833,0xc83d,0xc847,0xc851,0xc85c,0xc866,0xc870,
-0xc87a,0xc884,0xc88f,0xc899,0xc8a3,0xc8ad,0xc8b7,0xc8c2,
-0xc8cc,0xc8d6,0xc8e0,0xc8ea,0xc8f5,0xc8ff,0xc909,0xc913,
-0xc91d,0xc928,0xc932,0xc93c,0xc946,0xc950,0xc95a,0xc965,
-0xc96f,0xc979,0xc983,0xc98d,0xc997,0xc9a2,0xc9ac,0xc9b6,
-0xc9c0,0xc9ca,0xc9d4,0xc9df,0xc9e9,0xc9f3,0xc9fd,0xca07,
-0xca11,0xca1b,0xca26,0xca30,0xca3a,0xca44,0xca4e,0xca58,
-0xca62,0xca6c,0xca76,0xca81,0xca8b,0xca95,0xca9f,0xcaa9,
-0xcab3,0xcabd,0xcac7,0xcad1,0xcadc,0xcae6,0xcaf0,0xcafa,
-0xcb04,0xcb0e,0xcb18,0xcb22,0xcb2c,0xcb36,0xcb40,0xcb4a,
-0xcb55,0xcb5f,0xcb69,0xcb73,0xcb7d,0xcb87,0xcb91,0xcb9b,
-0xcba5,0xcbaf,0xcbb9,0xcbc3,0xcbcd,0xcbd7,0xcbe1,0xcbeb,
-0xcbf5,0xcc00,0xcc0a,0xcc14,0xcc1e,0xcc28,0xcc32,0xcc3c,
-0xcc46,0xcc50,0xcc5a,0xcc64,0xcc6e,0xcc78,0xcc82,0xcc8c,
-0xcc96,0xcca0,0xccaa,0xccb4,0xccbe,0xccc8,0xccd2,0xccdc,
-0xcce6,0xccf0,0xccfa,0xcd04,0xcd0e,0xcd18,0xcd22,0xcd2c,
-0xcd36,0xcd40,0xcd4a,0xcd54,0xcd5e,0xcd68,0xcd72,0xcd7c,
-0xcd86,0xcd90,0xcd99,0xcda3,0xcdad,0xcdb7,0xcdc1,0xcdcb,
-0xcdd5,0xcddf,0xcde9,0xcdf3,0xcdfd,0xce07,0xce11,0xce1b,
-0xce25,0xce2f,0xce39,0xce43,0xce4c,0xce56,0xce60,0xce6a,
-0xce74,0xce7e,0xce88,0xce92,0xce9c,0xcea6,0xceb0,0xceba,
-0xcec3,0xcecd,0xced7,0xcee1,0xceeb,0xcef5,0xceff,0xcf09,
-0xcf13,0xcf1d,0xcf26,0xcf30,0xcf3a,0xcf44,0xcf4e,0xcf58,
-0xcf62,0xcf6c,0xcf75,0xcf7f,0xcf89,0xcf93,0xcf9d,0xcfa7,
-0xcfb1,0xcfbb,0xcfc4,0xcfce,0xcfd8,0xcfe2,0xcfec,0xcff6,
-0xd000,0xd009,0xd013,0xd01d,0xd027,0xd031,0xd03b,0xd044,
-0xd04e,0xd058,0xd062,0xd06c,0xd076,0xd07f,0xd089,0xd093,
-0xd09d,0xd0a7,0xd0b0,0xd0ba,0xd0c4,0xd0ce,0xd0d8,0xd0e1,
-0xd0eb,0xd0f5,0xd0ff,0xd109,0xd112,0xd11c,0xd126,0xd130,
-0xd13a,0xd143,0xd14d,0xd157,0xd161,0xd16b,0xd174,0xd17e,
-0xd188,0xd192,0xd19b,0xd1a5,0xd1af,0xd1b9,0xd1c3,0xd1cc,
-0xd1d6,0xd1e0,0xd1ea,0xd1f3,0xd1fd,0xd207,0xd211,0xd21a,
-0xd224,0xd22e,0xd238,0xd241,0xd24b,0xd255,0xd25f,0xd268,
-0xd272,0xd27c,0xd285,0xd28f,0xd299,0xd2a3,0xd2ac,0xd2b6,
-0xd2c0,0xd2c9,0xd2d3,0xd2dd,0xd2e7,0xd2f0,0xd2fa,0xd304,
-0xd30d,0xd317,0xd321,0xd32b,0xd334,0xd33e,0xd348,0xd351,
-0xd35b,0xd365,0xd36e,0xd378,0xd382,0xd38b,0xd395,0xd39f,
-0xd3a8,0xd3b2,0xd3bc,0xd3c6,0xd3cf,0xd3d9,0xd3e3,0xd3ec,
-0xd3f6,0xd400,0xd409,0xd413,0xd41c,0xd426,0xd430,0xd439,
-0xd443,0xd44d,0xd456,0xd460,0xd46a,0xd473,0xd47d,0xd487,
-0xd490,0xd49a,0xd4a3,0xd4ad,0xd4b7,0xd4c0,0xd4ca,0xd4d4,
-0xd4dd,0xd4e7,0xd4f0,0xd4fa,0xd504,0xd50d,0xd517,0xd521,
-0xd52a,0xd534,0xd53d,0xd547,0xd551,0xd55a,0xd564,0xd56d,
-0xd577,0xd581,0xd58a,0xd594,0xd59d,0xd5a7,0xd5b0,0xd5ba,
-0xd5c4,0xd5cd,0xd5d7,0xd5e0,0xd5ea,0xd5f4,0xd5fd,0xd607,
-0xd610,0xd61a,0xd623,0xd62d,0xd637,0xd640,0xd64a,0xd653,
-0xd65d,0xd666,0xd670,0xd679,0xd683,0xd68c,0xd696,0xd6a0,
-0xd6a9,0xd6b3,0xd6bc,0xd6c6,0xd6cf,0xd6d9,0xd6e2,0xd6ec,
-0xd6f5,0xd6ff,0xd708,0xd712,0xd71b,0xd725,0xd72f,0xd738,
-0xd742,0xd74b,0xd755,0xd75e,0xd768,0xd771,0xd77b,0xd784,
-0xd78e,0xd797,0xd7a1,0xd7aa,0xd7b4,0xd7bd,0xd7c7,0xd7d0,
-0xd7da,0xd7e3,0xd7ed,0xd7f6,0xd800,0xd809,0xd812,0xd81c,
-0xd825,0xd82f,0xd838,0xd842,0xd84b,0xd855,0xd85e,0xd868,
-0xd871,0xd87b,0xd884,0xd88e,0xd897,0xd8a0,0xd8aa,0xd8b3,
-0xd8bd,0xd8c6,0xd8d0,0xd8d9,0xd8e3,0xd8ec,0xd8f5,0xd8ff,
-0xd908,0xd912,0xd91b,0xd925,0xd92e,0xd938,0xd941,0xd94a,
-0xd954,0xd95d,0xd967,0xd970,0xd979,0xd983,0xd98c,0xd996,
-0xd99f,0xd9a9,0xd9b2,0xd9bb,0xd9c5,0xd9ce,0xd9d8,0xd9e1,
-0xd9ea,0xd9f4,0xd9fd,0xda07,0xda10,0xda19,0xda23,0xda2c,
-0xda35,0xda3f,0xda48,0xda52,0xda5b,0xda64,0xda6e,0xda77,
-0xda81,0xda8a,0xda93,0xda9d,0xdaa6,0xdaaf,0xdab9,0xdac2,
-0xdacb,0xdad5,0xdade,0xdae8,0xdaf1,0xdafa,0xdb04,0xdb0d,
-0xdb16,0xdb20,0xdb29,0xdb32,0xdb3c,0xdb45,0xdb4e,0xdb58,
-0xdb61,0xdb6a,0xdb74,0xdb7d,0xdb86,0xdb90,0xdb99,0xdba2,
-0xdbac,0xdbb5,0xdbbe,0xdbc8,0xdbd1,0xdbda,0xdbe4,0xdbed,
-0xdbf6,0xdc00,0xdc09,0xdc12,0xdc1b,0xdc25,0xdc2e,0xdc37,
-0xdc41,0xdc4a,0xdc53,0xdc5d,0xdc66,0xdc6f,0xdc78,0xdc82,
-0xdc8b,0xdc94,0xdc9e,0xdca7,0xdcb0,0xdcb9,0xdcc3,0xdccc,
-0xdcd5,0xdcde,0xdce8,0xdcf1,0xdcfa,0xdd04,0xdd0d,0xdd16,
-0xdd1f,0xdd29,0xdd32,0xdd3b,0xdd44,0xdd4e,0xdd57,0xdd60,
-0xdd69,0xdd73,0xdd7c,0xdd85,0xdd8e,0xdd98,0xdda1,0xddaa,
-0xddb3,0xddbd,0xddc6,0xddcf,0xddd8,0xdde2,0xddeb,0xddf4,
-0xddfd,0xde06,0xde10,0xde19,0xde22,0xde2b,0xde35,0xde3e,
-0xde47,0xde50,0xde59,0xde63,0xde6c,0xde75,0xde7e,0xde87,
-0xde91,0xde9a,0xdea3,0xdeac,0xdeb5,0xdebf,0xdec8,0xded1,
-0xdeda,0xdee3,0xdeed,0xdef6,0xdeff,0xdf08,0xdf11,0xdf1a,
-0xdf24,0xdf2d,0xdf36,0xdf3f,0xdf48,0xdf52,0xdf5b,0xdf64,
-0xdf6d,0xdf76,0xdf7f,0xdf89,0xdf92,0xdf9b,0xdfa4,0xdfad,
-0xdfb6,0xdfbf,0xdfc9,0xdfd2,0xdfdb,0xdfe4,0xdfed,0xdff6,
-0xe000,0xe009,0xe012,0xe01b,0xe024,0xe02d,0xe036,0xe03f,
-0xe049,0xe052,0xe05b,0xe064,0xe06d,0xe076,0xe07f,0xe088,
-0xe092,0xe09b,0xe0a4,0xe0ad,0xe0b6,0xe0bf,0xe0c8,0xe0d1,
-0xe0db,0xe0e4,0xe0ed,0xe0f6,0xe0ff,0xe108,0xe111,0xe11a,
-0xe123,0xe12c,0xe136,0xe13f,0xe148,0xe151,0xe15a,0xe163,
-0xe16c,0xe175,0xe17e,0xe187,0xe190,0xe199,0xe1a3,0xe1ac,
-0xe1b5,0xe1be,0xe1c7,0xe1d0,0xe1d9,0xe1e2,0xe1eb,0xe1f4,
-0xe1fd,0xe206,0xe20f,0xe218,0xe221,0xe22b,0xe234,0xe23d,
-0xe246,0xe24f,0xe258,0xe261,0xe26a,0xe273,0xe27c,0xe285,
-0xe28e,0xe297,0xe2a0,0xe2a9,0xe2b2,0xe2bb,0xe2c4,0xe2cd,
-0xe2d6,0xe2df,0xe2e8,0xe2f1,0xe2fa,0xe303,0xe30c,0xe315,
-0xe31f,0xe328,0xe331,0xe33a,0xe343,0xe34c,0xe355,0xe35e,
-0xe367,0xe370,0xe379,0xe382,0xe38b,0xe394,0xe39d,0xe3a6,
-0xe3af,0xe3b8,0xe3c1,0xe3ca,0xe3d3,0xe3dc,0xe3e5,0xe3ee,
-0xe3f7,0xe400,0xe408,0xe411,0xe41a,0xe423,0xe42c,0xe435,
-0xe43e,0xe447,0xe450,0xe459,0xe462,0xe46b,0xe474,0xe47d,
-0xe486,0xe48f,0xe498,0xe4a1,0xe4aa,0xe4b3,0xe4bc,0xe4c5,
-0xe4ce,0xe4d7,0xe4e0,0xe4e9,0xe4f2,0xe4fa,0xe503,0xe50c,
-0xe515,0xe51e,0xe527,0xe530,0xe539,0xe542,0xe54b,0xe554,
-0xe55d,0xe566,0xe56f,0xe578,0xe580,0xe589,0xe592,0xe59b,
-0xe5a4,0xe5ad,0xe5b6,0xe5bf,0xe5c8,0xe5d1,0xe5da,0xe5e3,
-0xe5eb,0xe5f4,0xe5fd,0xe606,0xe60f,0xe618,0xe621,0xe62a,
-0xe633,0xe63c,0xe644,0xe64d,0xe656,0xe65f,0xe668,0xe671,
-0xe67a,0xe683,0xe68c,0xe694,0xe69d,0xe6a6,0xe6af,0xe6b8,
-0xe6c1,0xe6ca,0xe6d3,0xe6db,0xe6e4,0xe6ed,0xe6f6,0xe6ff,
-0xe708,0xe711,0xe71a,0xe722,0xe72b,0xe734,0xe73d,0xe746,
-0xe74f,0xe758,0xe760,0xe769,0xe772,0xe77b,0xe784,0xe78d,
-0xe795,0xe79e,0xe7a7,0xe7b0,0xe7b9,0xe7c2,0xe7cb,0xe7d3,
-0xe7dc,0xe7e5,0xe7ee,0xe7f7,0xe800,0xe808,0xe811,0xe81a,
-0xe823,0xe82c,0xe834,0xe83d,0xe846,0xe84f,0xe858,0xe861,
-0xe869,0xe872,0xe87b,0xe884,0xe88d,0xe895,0xe89e,0xe8a7,
-0xe8b0,0xe8b9,0xe8c1,0xe8ca,0xe8d3,0xe8dc,0xe8e5,0xe8ed,
-0xe8f6,0xe8ff,0xe908,0xe911,0xe919,0xe922,0xe92b,0xe934,
-0xe93c,0xe945,0xe94e,0xe957,0xe960,0xe968,0xe971,0xe97a,
-0xe983,0xe98b,0xe994,0xe99d,0xe9a6,0xe9ae,0xe9b7,0xe9c0,
-0xe9c9,0xe9d2,0xe9da,0xe9e3,0xe9ec,0xe9f5,0xe9fd,0xea06,
-0xea0f,0xea18,0xea20,0xea29,0xea32,0xea3b,0xea43,0xea4c,
-0xea55,0xea5e,0xea66,0xea6f,0xea78,0xea80,0xea89,0xea92,
-0xea9b,0xeaa3,0xeaac,0xeab5,0xeabe,0xeac6,0xeacf,0xead8,
-0xeae0,0xeae9,0xeaf2,0xeafb,0xeb03,0xeb0c,0xeb15,0xeb1d,
-0xeb26,0xeb2f,0xeb38,0xeb40,0xeb49,0xeb52,0xeb5a,0xeb63,
-0xeb6c,0xeb74,0xeb7d,0xeb86,0xeb8f,0xeb97,0xeba0,0xeba9,
-0xebb1,0xebba,0xebc3,0xebcb,0xebd4,0xebdd,0xebe5,0xebee,
-0xebf7,0xec00,0xec08,0xec11,0xec1a,0xec22,0xec2b,0xec34,
-0xec3c,0xec45,0xec4e,0xec56,0xec5f,0xec68,0xec70,0xec79,
-0xec82,0xec8a,0xec93,0xec9c,0xeca4,0xecad,0xecb5,0xecbe,
-0xecc7,0xeccf,0xecd8,0xece1,0xece9,0xecf2,0xecfb,0xed03,
-0xed0c,0xed15,0xed1d,0xed26,0xed2e,0xed37,0xed40,0xed48,
-0xed51,0xed5a,0xed62,0xed6b,0xed74,0xed7c,0xed85,0xed8d,
-0xed96,0xed9f,0xeda7,0xedb0,0xedb8,0xedc1,0xedca,0xedd2,
-0xeddb,0xede4,0xedec,0xedf5,0xedfd,0xee06,0xee0f,0xee17,
-0xee20,0xee28,0xee31,0xee3a,0xee42,0xee4b,0xee53,0xee5c,
-0xee65,0xee6d,0xee76,0xee7e,0xee87,0xee8f,0xee98,0xeea1,
-0xeea9,0xeeb2,0xeeba,0xeec3,0xeecc,0xeed4,0xeedd,0xeee5,
-0xeeee,0xeef6,0xeeff,0xef08,0xef10,0xef19,0xef21,0xef2a,
-0xef32,0xef3b,0xef43,0xef4c,0xef55,0xef5d,0xef66,0xef6e,
-0xef77,0xef7f,0xef88,0xef90,0xef99,0xefa2,0xefaa,0xefb3,
-0xefbb,0xefc4,0xefcc,0xefd5,0xefdd,0xefe6,0xefee,0xeff7,
-0xf000,0xf008,0xf011,0xf019,0xf022,0xf02a,0xf033,0xf03b,
-0xf044,0xf04c,0xf055,0xf05d,0xf066,0xf06e,0xf077,0xf07f,
-0xf088,0xf090,0xf099,0xf0a1,0xf0aa,0xf0b2,0xf0bb,0xf0c3,
-0xf0cc,0xf0d4,0xf0dd,0xf0e5,0xf0ee,0xf0f6,0xf0ff,0xf107,
-0xf110,0xf118,0xf121,0xf129,0xf132,0xf13a,0xf143,0xf14b,
-0xf154,0xf15c,0xf165,0xf16d,0xf176,0xf17e,0xf187,0xf18f,
-0xf198,0xf1a0,0xf1a9,0xf1b1,0xf1ba,0xf1c2,0xf1cb,0xf1d3,
-0xf1dc,0xf1e4,0xf1ec,0xf1f5,0xf1fd,0xf206,0xf20e,0xf217,
-0xf21f,0xf228,0xf230,0xf239,0xf241,0xf24a,0xf252,0xf25a,
-0xf263,0xf26b,0xf274,0xf27c,0xf285,0xf28d,0xf296,0xf29e,
-0xf2a6,0xf2af,0xf2b7,0xf2c0,0xf2c8,0xf2d1,0xf2d9,0xf2e1,
-0xf2ea,0xf2f2,0xf2fb,0xf303,0xf30c,0xf314,0xf31c,0xf325,
-0xf32d,0xf336,0xf33e,0xf347,0xf34f,0xf357,0xf360,0xf368,
-0xf371,0xf379,0xf381,0xf38a,0xf392,0xf39b,0xf3a3,0xf3ac,
-0xf3b4,0xf3bc,0xf3c5,0xf3cd,0xf3d6,0xf3de,0xf3e6,0xf3ef,
-0xf3f7,0xf400,0xf408,0xf410,0xf419,0xf421,0xf429,0xf432,
-0xf43a,0xf443,0xf44b,0xf453,0xf45c,0xf464,0xf46d,0xf475,
-0xf47d,0xf486,0xf48e,0xf496,0xf49f,0xf4a7,0xf4b0,0xf4b8,
-0xf4c0,0xf4c9,0xf4d1,0xf4d9,0xf4e2,0xf4ea,0xf4f2,0xf4fb,
-0xf503,0xf50c,0xf514,0xf51c,0xf525,0xf52d,0xf535,0xf53e,
-0xf546,0xf54e,0xf557,0xf55f,0xf567,0xf570,0xf578,0xf580,
-0xf589,0xf591,0xf599,0xf5a2,0xf5aa,0xf5b2,0xf5bb,0xf5c3,
-0xf5cb,0xf5d4,0xf5dc,0xf5e4,0xf5ed,0xf5f5,0xf5fd,0xf606,
-0xf60e,0xf616,0xf61f,0xf627,0xf62f,0xf638,0xf640,0xf648,
-0xf651,0xf659,0xf661,0xf66a,0xf672,0xf67a,0xf682,0xf68b,
-0xf693,0xf69b,0xf6a4,0xf6ac,0xf6b4,0xf6bd,0xf6c5,0xf6cd,
-0xf6d6,0xf6de,0xf6e6,0xf6ee,0xf6f7,0xf6ff,0xf707,0xf710,
-0xf718,0xf720,0xf728,0xf731,0xf739,0xf741,0xf74a,0xf752,
-0xf75a,0xf762,0xf76b,0xf773,0xf77b,0xf784,0xf78c,0xf794,
-0xf79c,0xf7a5,0xf7ad,0xf7b5,0xf7bd,0xf7c6,0xf7ce,0xf7d6,
-0xf7de,0xf7e7,0xf7ef,0xf7f7,0xf800,0xf808,0xf810,0xf818,
-0xf821,0xf829,0xf831,0xf839,0xf842,0xf84a,0xf852,0xf85a,
-0xf863,0xf86b,0xf873,0xf87b,0xf883,0xf88c,0xf894,0xf89c,
-0xf8a4,0xf8ad,0xf8b5,0xf8bd,0xf8c5,0xf8ce,0xf8d6,0xf8de,
-0xf8e6,0xf8ef,0xf8f7,0xf8ff,0xf907,0xf90f,0xf918,0xf920,
-0xf928,0xf930,0xf939,0xf941,0xf949,0xf951,0xf959,0xf962,
-0xf96a,0xf972,0xf97a,0xf982,0xf98b,0xf993,0xf99b,0xf9a3,
-0xf9ab,0xf9b4,0xf9bc,0xf9c4,0xf9cc,0xf9d4,0xf9dd,0xf9e5,
-0xf9ed,0xf9f5,0xf9fd,0xfa06,0xfa0e,0xfa16,0xfa1e,0xfa26,
-0xfa2f,0xfa37,0xfa3f,0xfa47,0xfa4f,0xfa58,0xfa60,0xfa68,
-0xfa70,0xfa78,0xfa80,0xfa89,0xfa91,0xfa99,0xfaa1,0xfaa9,
-0xfab1,0xfaba,0xfac2,0xfaca,0xfad2,0xfada,0xfae2,0xfaeb,
-0xfaf3,0xfafb,0xfb03,0xfb0b,0xfb13,0xfb1c,0xfb24,0xfb2c,
-0xfb34,0xfb3c,0xfb44,0xfb4c,0xfb55,0xfb5d,0xfb65,0xfb6d,
-0xfb75,0xfb7d,0xfb85,0xfb8e,0xfb96,0xfb9e,0xfba6,0xfbae,
-0xfbb6,0xfbbe,0xfbc7,0xfbcf,0xfbd7,0xfbdf,0xfbe7,0xfbef,
-0xfbf7,0xfc00,0xfc08,0xfc10,0xfc18,0xfc20,0xfc28,0xfc30,
-0xfc38,0xfc40,0xfc49,0xfc51,0xfc59,0xfc61,0xfc69,0xfc71,
-0xfc79,0xfc81,0xfc8a,0xfc92,0xfc9a,0xfca2,0xfcaa,0xfcb2,
-0xfcba,0xfcc2,0xfcca,0xfcd2,0xfcdb,0xfce3,0xfceb,0xfcf3,
-0xfcfb,0xfd03,0xfd0b,0xfd13,0xfd1b,0xfd23,0xfd2c,0xfd34,
-0xfd3c,0xfd44,0xfd4c,0xfd54,0xfd5c,0xfd64,0xfd6c,0xfd74,
-0xfd7c,0xfd84,0xfd8d,0xfd95,0xfd9d,0xfda5,0xfdad,0xfdb5,
-0xfdbd,0xfdc5,0xfdcd,0xfdd5,0xfddd,0xfde5,0xfded,0xfdf5,
-0xfdfd,0xfe06,0xfe0e,0xfe16,0xfe1e,0xfe26,0xfe2e,0xfe36,
-0xfe3e,0xfe46,0xfe4e,0xfe56,0xfe5e,0xfe66,0xfe6e,0xfe76,
-0xfe7e,0xfe86,0xfe8e,0xfe97,0xfe9f,0xfea7,0xfeaf,0xfeb7,
-0xfebf,0xfec7,0xfecf,0xfed7,0xfedf,0xfee7,0xfeef,0xfef7,
-0xfeff,0xff07,0xff0f,0xff17,0xff1f,0xff27,0xff2f,0xff37,
-0xff3f,0xff47,0xff4f,0xff57,0xff5f,0xff67,0xff6f,0xff77,
-0xff7f,0xff87,0xff8f,0xff97,0xff9f,0xffa7,0xffaf,0xffb7,
-0xffbf,0xffc7,0xffcf,0xffd7,0xffdf,0xffe7,0xffef,0xfff7};
-
-static const signed short wavtable1[2304]={
-0x021d,0x03bc,0x0300,0xfc0d,0xfcd5,0xfd33,0xfdc5,0xfc83,
-0xfdc0,0x036d,0x0245,0x0238,0xfc1b,0xfc31,0xfd7a,0xfd10,
-0xfd6b,0xfd88,0x02a3,0x0313,0x027b,0xfdf9,0xfcba,0xfc2f,
-0xfc86,0xfda3,0xfceb,0x0270,0x02dc,0x029c,0xfc83,0xfcd1,
-0xfc44,0xfd06,0xfdf5,0xfc97,0x026f,0x0347,0x02b9,0xfc02,
-0xfcaf,0xfdc5,0xfd09,0xfd50,0xfc4b,0x0280,0x02b5,0x03df,
-0xfc9d,0xfd95,0xfd61,0xfce0,0xfc54,0xfc41,0x039d,0x02af,
-0x0260,0xfd93,0xfddb,0xfccf,0xfcbb,0xfc64,0xfd2e,0x0228,
-0x031d,0x023c,0xfca3,0xfd97,0xfc84,0xfdac,0xfd93,0xfd80,
-0x0217,0x0340,0x031f,0xfc99,0xfcbc,0xfd77,0xfdd0,0xfd5c,
-0xfd90,0x02fa,0x025d,0x0241,0xfc7a,0xfca5,0xfd56,0xfdc8,
-0xfd34,0xfd76,0x0340,0x0231,0x03eb,0xfc6f,0xfcd1,0xfdda,
-0xfd5c,0xfd98,0xfc2a,0x024e,0x02af,0x024c,0xfce7,0xfd59,
-0xfcea,0xfd57,0xfc65,0xfd5b,0x0286,0x0385,0x02dc,0xfdc7,
-0xfc64,0xfd7b,0xfcd0,0xfce6,0xfdf4,0x033c,0x02b1,0x0380,
-0xfdd3,0xfd2b,0xfda5,0xfd62,0xfc61,0xfcf0,0x036b,0x0270,
-0x0350,0xfdeb,0xfd2b,0xfdfc,0xfd14,0xfd08,0xfd42,0x023b,
-0x03ae,0x03fe,0xfdf2,0xfdc6,0xfc53,0xfd82,0xfc9c,0xfc04,
-0x0338,0x02e0,0x0283,0xfdaf,0xfdfb,0xfc63,0xfd69,0xfdee,
-0xfcd8,0x0205,0x02fd,0x0200,0xfcfa,0xfdfa,0xfd01,0xfdf5,
-0xfdc4,0xfdff,0x0232,0x038c,0x02f9,0xfc1b,0xfcbc,0xfd5d,
-0xfd97,0xfcdb,0xfdca,0x02b6,0x0391,0x02a3,0xfd95,0xfc6c,
-0xfda5,0xfc53,0xfcd1,0xfc85,0x02c0,0x020c,0x02a0,0xfd2e,
-0xfc63,0xfd4f,0xfc37,0xfde6,0xfc8d,0x02d1,0x02f5,0x022e,
-0xfdea,0xfcee,0xfcc6,0xfc06,0xfdcf,0xfda0,0x0374,0x0227,
-0x0279,0xfc49,0xfdde,0xfd57,0xfd05,0xfdb0,0xfcf0,0x022e,
-0x03ef,0x034e,0xfddb,0xfc65,0xfcc0,0xfda0,0xfc21,0xfd45,
-0x03a4,0x02ea,0x0309,0xfd59,0xfd3d,0xfdca,0xfcaf,0xfde0,
-0xfdb3,0x0236,0x0336,0x039e,0xfc72,0xfdff,0xfd18,0xfd8d,
-0xfd6d,0xfcb9,0x0265,0x0303,0x0263,0xfc64,0xfd25,0xfc67,
-0xfd23,0xfdbb,0xfd27,0x02e1,0x029f,0x03f0,0xfc39,0xfd2a,
-0xfd6b,0xfded,0xfc90,0xfc1f,0x028b,0x0252,0x0243,0xfd0b,
-0xfd1f,0xfd5f,0xfcc2,0xfd4d,0xfd71,0x0321,0x027c,0x0234,
-0xfc1c,0xfc8d,0xfd42,0xfd8e,0xfce8,0xfd92,0x0354,0x038e,
-0x02cf,0xfd0b,0xfda9,0xfd81,0xfd3b,0xfcd7,0xfc0c,0x03e6,
-0x0266,0x023f,0xfda9,0xfdcf,0xfd4d,0xfc32,0xfd1f,0xfd79,
-0x0299,0x03a7,0x0274,0xfda1,0xfcd0,0xfdc2,0xfca1,0xfcaa,
-0xfcfd,0x0277,0x0254,0x033d,0xfd21,0xfc01,0xfc3a,0xfcf6,
-0xfd4a,0xfd60,0x0284,0x039e,0x020e,0xfdb9,0xfd69,0xfc47,
-0xfcd5,0xfcba,0xfde2,0x036f,0x03dc,0x0265,0xfcb0,0xfdf2,
-0xfdb0,0xfd0d,0xfc47,0xfd22,0x03ad,0x02b4,0x02b5,0xfd83,
-0xfd82,0xfc55,0xfc9e,0xfc57,0xfc54,0x0235,0x02a0,0x0240,
-0xfd1a,0xfd83,0xfd0b,0xfd8f,0xfc8e,0xfd77,0x0223,0x0274,
-0x02e4,0xfd61,0xfce9,0xfc73,0xfdb7,0xfcfd,0xfde9,0x027f,
-0x0214,0x0219,0xfd67,0xfd61,0xfdd1,0xfce2,0xfdd6,0xfdcc,
-0x03bb,0x025c,0x0256,0xfdcc,0xfdd2,0xfd3e,0xfc85,0xfd36,
-0xfd45,0x0232,0x0244,0x0384,0xfd83,0xfc23,0xfc03,0xfd97,
-0xfd6e,0xfce9,0x025b,0x0383,0x026d,0xfdee,0xfd23,0xfddf,
-0xfd38,0xfceb,0xfd0d,0x02ea,0x0215,0x0270,0xfcf8,0xfc73,
-0xfd76,0xfde1,0xfdd5,0xfd07,0x02d9,0x0202,0x02df,0xfd23,
-0xfdf5,0xfd1d,0xfdf9,0xfdfb,0xfdf0,0x0355,0x0227,0x02b4,
-0xfc69,0xfdbf,0xfd17,0xfd39,0xfdaf,0xfc58,0x03b5,0x03fa,
-0x03ec,0xfc50,0xfc5d,0xfc19,0xfc90,0xfc0b,0xfc27,0x0220,
-0x03dc,0x02df,0xfdf3,0xfcf3,0xfd3a,0xfdbe,0xfc46,0xfdf0,
-0x0315,0x030e,0x0335,0xfda5,0xfd87,0xfd8c,0xfda0,0xfdaa,
-0xfd6d,0x0381,0x0204,0x02f2,0xfc76,0xfd6b,0xfd07,0xfcee,
-0xfdf7,0xfdd4,0x0205,0x02be,0x033c,0xfd3a,0xfcbb,0xfdc8,
-0xfdf5,0xfc3d,0xfd62,0x024a,0x0332,0x02fb,0xfc57,0xfc96,
-0xfd9f,0xfd60,0xfd72,0xfdc8,0x038b,0x028c,0x0250,0xfdbe,
-0xfdf3,0xfd0e,0xfcdc,0xfcc2,0xfd52,0x0210,0x028c,0x0282,
-0xfd5f,0xfd69,0xfcce,0xfdde,0xfcc2,0xfcda,0x0213,0x02c4,
-0x030c,0xfd20,0xfcd5,0xfde4,0xfdd8,0xfc2b,0xfdad,0x029a,
-0x0271,0x02d7,0xfcd3,0xfc4e,0xfc88,0xfc9d,0xfd05,0xfdfc,
-0x03b3,0x02d7,0x022a,0xfd5f,0xfe00,0xfced,0xfc95,0xfdfb,
-0xfda9,0x0225,0x0291,0x03d5,0xfd3f,0xfdf2,0xfd8a,0xfdb3,
-0xfcb5,0xfc53,0x025d,0x0398,0x0354,0xfde0,0xfc10,0xfd02,
-0xfd34,0xfcc5,0xfd3b,0x0270,0x026b,0x03d7,0xfd0d,0xfda9,
-0xfdad,0xfd07,0xfd12,0xfc50,0x025d,0x038d,0x0223,0xfde7,
-0xfd7a,0xfc35,0xfd35,0xfcd9,0xfdb8,0x02b2,0x03a7,0x0204,
-0xfd89,0xfd47,0xfc50,0xfc5c,0xfca9,0xfdf7,0x02bc,0x0264,
-0x0355,0xfcba,0xfdb8,0xfc03,0xfc41,0xfd24,0xfd39,0x02ff,
-0x0340,0x023e,0xfd91,0xfca3,0xfc5b,0xfdc1,0xfd5c,0xfd7d,
-0x020b,0x0382,0x039b,0xfc69,0xfc4f,0xfcd6,0xfde8,0xfceb,
-0xfcbf,0x02d2,0x03be,0x02b3,0xfd5c,0xfc30,0xfd79,0xfc04,
-0xfc80,0xfc59,0x0265,0x0303,0x03a0,0xfc64,0xfdd4,0xfd44,
-0xfd22,0xfdbb,0xfcb6,0x02f6,0x02f5,0x0248,0xfdcf,0xfc9e,
-0xfc9f,0xfdce,0xfdd0,0xfd65,0x0200,0x0237,0x0241,0xfdc9,
-0xfdbf,0xfd81,0xfe00,0xfd8c,0xfd76,0x0267,0x027e,0x02ba,
-0xfd02,0xfcb9,0xfc99,0xfd1d,0xfce5,0xfc46,0x023e,0x0282,
-0x024d,0xfd30,0xfd6c,0xfd1d,0xfd7c,0xfcda,0xfd5b,0x03e1,
-0x02aa,0x036e,0xfd6a,0xfcac,0xfdb7,0xfc3d,0xfc72,0xfd0f,
-0x021b,0x037a,0x0391,0xfc55,0xfc3d,0xfce5,0xfdc7,0xfcf9,
-0xfcd1,0x02b6,0x03a0,0x0220,0xfd8b,0xfd1e,0xfc25,0xfc53,
-0xfcb6,0xfdbe,0x0325,0x0258,0x02a8,0xfc50,0xfde9,0xfce2,
-0xfd87,0xfd40,0xfc77,0x021c,0x03b7,0x030e,0xfc14,0xfcc7,
-0xfd29,0xfdc6,0xfc8c,0xfdab,0x0330,0x03b6,0x024e,0xfd0b,
-0xfc53,0xfddc,0xfd76,0xfc8f,0xfd57,0x03bb,0x034f,0x032b,
-0xfcea,0xfd0b,0xfd61,0xfc85,0xfd44,0xfd7d,0x0223,0x0373,
-0x022c,0xfc4f,0xfdad,0xfc40,0xfdb6,0xfd06,0xfda3,0x028c,
-0x0378,0x025c,0xfdcb,0xfcfe,0xfdf4,0xfcc1,0xfcfe,0xfd37,
-0x035f,0x0249,0x0357,0xfc26,0xfd2f,0xfc2e,0xfd29,0xfd64,
-0xfd35,0x03ff,0x03e5,0x0204,0xfc1b,0xfdfc,0xfc12,0xfc01,
-0xfc34,0xfdf8,0x03a4,0x0266,0x0280,0xfdd0,0xfdb9,0xfcff,
-0xfcae,0xfd1e,0xfce0,0x0273,0x0234,0x023d,0xfd4d,0xfd42,
-0xfd89,0xfcff,0xfd93,0xfd7f,0x036c,0x0384,0x02d4,0xfcfe,
-0xfd94,0xfd83,0xfd12,0xfce8,0xfe00,0x0203,0x0359,0x0380,
-0xfca1,0xfc7a,0xfd12,0xfdf9,0xfd32,0xfcf0,0x0287,0x03b9,
-0x036f,0xfda6,0xfdd5,0xfcce,0xfccf,0xfc88,0xfd0d,0x0326,
-0x0356,0x0359,0xfd60,0xfd5d,0xfd35,0xfd86,0xfd38,0xfd32,
-0x0221,0x0247,0x0277,0xfd93,0xfd60,0xfd31,0xfdbb,0xfd68,
-0xfcf6,0x0291,0x0259,0x02ef,0xfcfc,0xfc3d,0xfc8e,0xfcb5,
-0xfd3d,0xfdda,0x02e4,0x0389,0x031b,0xfd72,0xfdc1,0xfd40,
-0xfde9,0xfcdf,0xfd96,0x0349,0x03f8,0x0238,0xfcbd,0xfc5a,
-0xfdcc,0xfd4d,0xfc0f,0xfd89,0x02eb,0x024d,0x03d7,0xfca3,
-0xfd32,0xfdca,0xfddf,0xfd59,0xfc4f,0x036e,0x0265,0x020e,
-0xfdf2,0xfc7a,0xfd8a,0xfd0f,0xfd20,0xfde4,0x0360,0x02d3,
-0x030b,0xfd9e,0xfd6f,0xfdda,0xfd27,0xfc02,0xfdb0,0x0216,
-0x02a2,0x0306,0xfd41,0xfcd8,0xfc05,0xfdd3,0xfc89,0xfdb6,
-0x03b6,0x0289,0x03ab,0xfda6,0xfc99,0xfdad,0xfc8f,0xfcc8,
-0xfca3,0x024e,0x02bf,0x0383,0xfcd5,0xfdfa,0xfd96,0xfd58,
-0xfc3a,0xfcea,0x026a,0x020f,0x0243,0xfd83,0xfd44,0xfdab,
-0xfd16,0xfde1,0xfd6f,0x02d5,0x0287,0x03cc,0xfc6b,0xfd4f,
-0xfd99,0xfdff,0xfcce,0xfc64,0x0281,0x0287,0x02c3,0xfcd6,
-0xfc8b,0xfc83,0xfcdd,0xfccf,0xfc30,0x02da,0x0297,0x0284,
-0xfc4e,0xfc68,0xfcbd,0xfdf7,0xfca4,0xfcd4,0x0327,0x023c,
-0x0242,0xfc7a,0xfc70,0xfd7a,0xfd83,0xfd81,0xfd73,0x036f,
-0x0263,0x0335,0xfdf4,0xfd3f,0xfc2d,0xfd0d,0xfd27,0xfd6e,
-0x029b,0x02d9,0x0349,0xfc49,0xfddb,0xfda9,0xfc99,0xfdf9,
-0xfd4c,0x030e,0x0249,0x02ef,0xfc81,0xfdc2,0xfca5,0xfdaa,
-0xfd62,0xfdd9,0x0322,0x02dd,0x03d0,0xfdc2,0xfd03,0xfd45,
-0xfd8c,0xfdf3,0xfc5d,0x0352,0x0367,0x02c4,0xfd2c,0xfdb4,
-0xfda6,0xfd3e,0xfd1a,0xfc2d,0x0366,0x02e7,0x02c0,0xfd88,
-0xfdaa,0xfc01,0xfd1d,0xfde4,0xfc36,0x03ad,0x0383,0x0249,
-0xfcc5,0xfde6,0xfdfe,0xfc9e,0xfcea,0xfd63,0x03af,0x0278,
-0x036b,0xfdba,0xfcda,0xfde3,0xfc9b,0xfcf3,0xfd13,0x03ff,
-0x02dc,0x027e,0xfd25,0xfd83,0xfc70,0xfc02,0xfdf5,0xfce5,
-0x030a,0x02f1,0x028f,0xfdc3,0xfc1b,0xfc3b,0xfdb0,0xfdd6,
-0xfcb9,0x034b,0x03b1,0x03b1,0xfcf5,0xfcf5,0xfc97,0xfd4a,
-0xfc97,0xfc97,0x03ae,0x03c9,0x023c,0xfc84,0xfdf1,0xfde2,
-0xfc9d,0xfc6a,0xfd80,0x03f0,0x022f,0x0356,0xfdd9,0xfcb7,
-0xfc5a,0xfc1f,0xfd9c,0xfd38,0x0364,0x02d9,0x0313,0xfd96,
-0xfd64,0xfdd0,0xfd1f,0xfdf9,0xfda3,0x03ca,0x02ae,0x0223,
-0xfd76,0xfdfa,0xfd23,0xfc69,0xfc69,0xfdb7,0x0217,0x027b,
-0x02a2,0xfd68,0xfd3f,0xfcbc,0xfdd0,0xfcec,0xfc89,0x0230,
-0x027c,0x033c,0xfd48,0xfc75,0xfdfe,0xfd9b,0xfcea,0xfd62,
-0x03e2,0x0250,0x0341,0xfdc1,0xfcd7,0xfc3c,0xfc3a,0xfd52,
-0xfd5b,0x0224,0x026d,0x02b6,0xfd67,0xfd19,0xfcb5,0xfdb5,
-0xfd0d,0xfc52,0x0226,0x0321,0x03bb,0xfca3,0xfdff,0xfd14,
-0xfdb1,0xfd8d,0xfc84,0x0246,0x020a,0x0286,0xfdae,0xfd21,
-0xfd6d,0xfd69,0xfdeb,0xfcd1,0x025e,0x0271,0x0332,0xfd1d,
-0xfc37,0xfc19,0xfd33,0xfd05,0xfd71,0x026f,0x024f,0x036a,
-0xfd30,0xfded,0xfc0e,0xfd0a,0xfd55,0xfd16,0x029d,0x0217,
-0x03e9,0xfd44,0xfd72,0xfdf5,0xfc94,0xfdd1,0xfc2d,0x02bd,
-0x03aa,0x0250,0xfd7e,0xfcd6,0xfde2,0xfc40,0xfca4,0xfd54,
-0x039d,0x0334,0x02e2,0xfd1b,0xfd65,0xfdb0,0xfcbd,0xfd6f,
-0xfdeb,0x02df,0x0316,0x0220,0xfdc9,0xfcf3,0xfcb8,0xfdf1,
-0xfd9e,0xfdbe,0x023f,0x0314,0x02a2,0xfc8a,0xfd0a,0xfdf9,
-0xfd79,0xfda1,0xfc88,0x028f,0x030f,0x0210,0xfc15,0xfd5b,
-0xfcd7,0xfcb8,0xfda9,0xfddf,0x020f,0x0201,0x02a5,0xfdef,
-0xfd45,0xfd59,0xfde0,0xfdfe,0xfc7f,0x030e,0x0354,0x03ac,
-0xfd75,0xfd32,0xfcf1,0xfdab,0xfd3b,0xfca1,0x0242,0x038e,
-0x0201,0xfdfe,0xfdbb,0xfc6e,0xfd72,0xfcd7,0xfdfd,0x02b4,
-0x0372,0x02de,0xfdac,0xfc1f,0xfd88,0xfc57,0xfd09,0xfdf2,
-0x024a,0x02ab,0x02cb,0xfcf2,0xfcce,0xfc46,0xfd62,0xfc71,
-0xfc19,0x02e3,0x0261,0x02cd,0xfc90,0xfdfa,0xfcaa,0xfdea,
-0xfd2b,0xfc12,0x030a,0x0305,0x02b9,0xfdb4,0xfdee,0xfdf1,
-0xfdb0,0xfdb8,0xfc49,0x039a,0x0311,0x032d,0xfd3d,0xfd24,
-0xfd90,0xfcc2,0xfda6,0xfd7a,0x02fe,0x028b,0x03d8,0xfc32,
-0xfd20,0xfd8e,0xfdc3,0xfcc5,0xfc4e,0x03d2,0x0254,0x0203,
-0xfdc7,0xfc28,0xfda8,0xfc5a,0xfd4a,0xfdfa,0x0217,0x02f5,
-0x021c,0xfce8,0xfdcb,0xfce1,0xfdd0,0xfdd1,0xfdc5,0x0296,
-0x02af,0x024d,0xfc86,0xfd06,0xfce9,0xfca7,0xfc64,0xfd5a,
-0x022a,0x0218,0x03d3,0xfdbc,0xfdee,0xfe00,0xfda7,0xfdcf,
-0xfc58,0x02d3,0x03d6,0x02b2,0xfd4a,0xfc30,0xfd6a,0xfc02,
-0xfc51,0xfc5c,0x03a8,0x03bc,0x020f,0xfc95,0xfc3b,0xfc26,
-0xfca8,0xfc82,0xfde1,0x024e,0x03ea,0x0223,0xfdbf,0xfd89,
-0xfde8,0xfd58,0xfc2c,0xfdb6,0x0205,0x028d,0x0339,0xfd6c,
-0xfcbf,0xfdf2,0xfdf6,0xfcbe,0xfd68,0x0340,0x0250,0x03ce,
-0xfc3c,0xfce8,0xfdcc,0xfd5b,0xfd52,0xfc60,0x0200,0x03bd,
-0x0387,0xfc43,0xfc79,0xfcb4,0xfe00,0xfc82,0xfce4,0x0277,
-0x0221,0x038a,0xfd60,0xfdd2,0xfc3b,0xfcf7,0xfdbb,0xfcde,
-0x0202,0x02d0,0x0289,0xfd2d,0xfd74,0xfc6f,0xfdfc,0xfc0c,
-0xfcc8,0x0254,0x02a7,0x02b6,0xfcea,0xfcd9,0xfc68,0xfd4b,
-0xfc7c,0xfc54,0x0269,0x02e4,0x03d3,0xfc84,0xfdb2,0xfd3c,
-0xfd19,0xfde9,0xfc58,0x02c7,0x02ad,0x036d,0xfc48,0xfd9f,
-0xfdb5,0xfc25,0xfc6b,0xfd10,0x028f,0x0343,0x0350,0xfdea,
-0xfde2,0xfd4d,0xfcba,0xfd57,0xfd42,0x02f2,0x0347,0x02ba,
-0xfd96,0xfdfd,0xfdc3,0xfdd4,0xfd50,0xfc46,0x0367,0x0203,
-0x0301,0xfc93,0xfd71,0xfcfa,0xfd1a,0xfdfa,0xfdbe,0x03bb,
-0x0354,0x023d,0xfce5,0xfde9,0xfc45,0xfc84,0xfd3b,0xfd7d,
-0x0280,0x035b,0x024b,0xfde7,0xfd21,0xfc26,0xfcdf,0xfd2f,
-0xfd5e,0x0318,0x035f,0x022a,0xfd65,0xfca6,0xfc59,0xfd9c,
-0xfd29,0xfda7,0x034b,0x02c4,0x02aa,0xfdb9,0xfdce,0xfc50,
-0xfd4a,0xfc2d,0xfc72,0x03cb,0x0300,0x0228,0xfd28,0xfdf4,
-0xfcc3,0xfc67,0xfdc0,0xfdac,0x037b,0x0218,0x02b2,0xfc59,
-0xfda7,0xfd2c,0xfcf8,0xfdcd,0xfc5d,0x03f8,0x0230,0x0297,
-0xfdd4,0xfd6d,0xfd29,0xfc0f,0xfd9a,0xfca4,0x021f,0x0366,
-0x02a2,0xfc64,0xfd34,0xfdc3,0xfdbf,0xfd1d,0xfc87,0x0259,
-0x03e7,0x0249,0xfdb6,0xfd52,0xfdc5,0xfd3f,0xfc31,0xfd64,
-0x03b1,0x03c6,0x0379,0xfc84,0xfccb,0xfcb8,0xfc98,0xfc70,
-0xfcfb,0x0211,0x0390,0x0309,0xfc51,0xfcdc,0xfd4c,0xfddd,
-0xfcd4,0xfdb2,0x023e,0x03fc,0x02ca,0xfdc4,0xfcdf,0xfd39,
-0xfd7d,0xfc08,0xfc1b,0x0261,0x039a,0x03a4,0xfddb,0xfdd5,
-0xfcb8,0xfd2b,0xfcc1,0xfcb0,0x0256,0x030a,0x03a1,0xfc73,
-0xfde1,0xfd3d,0xfd46,0xfdb0,0xfcb4,0x028b,0x0304,0x02e8,
-0xfc2a,0xfc4d,0xfdcf,0xfcc5,0xfdba,0xfde3,0x02b3,0x03bd,
-0x02d2,0xfd7a,0xfc30,0xfd5d,0xfc5a,0xfc82,0xfc04,0x02d9,
-0x02fe,0x03d8,0xfdde,0xfd43,0xfd20,0xfdf8,0xfdc3,0xfc4f,
-0x0223,0x0207,0x0278,0xfdd5,0xfd5d,0xfd80,0xfdb7,0xfdf2,
-0xfcf4,0x0247,0x0214,0x039a,0xfda1,0xfdf3,0xfc40,0xfd68,
-0xfdd6,0xfcc1,0x0279,0x03e3,0x025b,0xfd99,0xfd17,0xfdb6,
-0xfcf1,0xfc38,0xfd3a,0x02a5,0x023b,0x036a,0xfd0b,0xfdbe,
-0xfc2f,0xfc80,0xfd82,0xfd15,0x025a,0x0221,0x029a,0xfd7f,
-0xfcf1,0xfd3b,0xfd3c,0xfdbc,0xfc9e,0x0273,0x021e,0x036b,
-0xfd67,0xfde8,0xfc60,0xfcff,0xfdc1,0xfd14,0x02a0,0x03d7,
-0x0256,0xfd7b,0xfcee,0xfdc1,0xfc8e,0xfc50,0xfd44,0x02b4,
-0x03d3,0x02da,0xfd6a,0xfc24,0xfd46,0xfc57,0xfc57,0xfdf7,
-0x029c,0x027a,0x0368,0xfcc5,0xfdc7,0xfde4,0xfc99,0xfcef,
-0xfd1a,0x02c7,0x02c2,0x02a2,0xfc2a,0xfc57,0xfc5d,0xfc24,
-0xfc31,0xfc87,0x02e3,0x03d1,0x0253,0xfd3e,0xfca4,0xfdc8,
-0xfdea,0xfc5c,0xfd4d,0x02f7,0x0389,0x02fb,0xfd61,0xfdca,
-0xfd5d,0xfdcd,0xfce1,0xfdc7,0x02f4,0x0246,0x02fb,0xfca4,
-0xfdcd,0xfc9c,0xfdd2,0xfd69,0xfdc8,0x02ec,0x03f5,0x038c,
-0xfd1b,0xfd68,0xfc7e,0xfddd,0xfc16,0xfcdb,0x0324,0x03a9,
-0x03b6,0xfd20,0xfd16,0xfc9b,0xfd89,0xfca6,0xfc8e,0x0311,
-0x021f,0x03e6,0xfcbf,0xfd02,0xfdef,0xfda6,0xfdc0,0xfc33,
-0x03e7,0x02ac,0x03ae,0xfd64,0xfc68,0xfd8a,0xfc31,0xfc6d,
-0xfc9c,0x0272,0x0279,0x03e4,0xfcfa,0xfd9f,0xfd98,0xfd03,
-0xfcf1,0xfc36,0x0272,0x0237,0x0343,0xfd4b,0xfc03,0xfc63,
-0xfd03,0xfd8c,0xfd57,0x02e3,0x023b,0x03cd,0xfcc7,0xfd42,
-0xfde1,0xfdeb,0xfd83,0xfc63,0x028f,0x0301,0x02c3,0xfc28,
-0xfc76,0xfded,0xfcb9,0xfdbf,0xfc2e,0x02be,0x03b8,0x023b,
-0xfd73,0xfcef,0xfdec,0xfc3c,0xfc8a,0xfd82,0x02d7,0x02c8,
-0x0202,0xfc0c,0xfd26,0xfd35,0xfdfc,0xfc22,0xfdfc,0x02e8,
-0x02ae,0x02e5,0xfc1a,0xfde5,0xfc1e,0xfde3,0xfc67,0xfde8,
-0x02db,0x0228,0x02ca,0xfceb,0xfc03,0xfcfc,0xfdf6,0xfdac,
-0xfc1a,0x0338,0x03df,0x02d6,0xfce2,0xfdb7,0xfd41,0xfd68,
-0xfc41,0xfdfd,0x031b,0x0267,0x0220,0xfc45,0xfcb4,0xfd73,
-0xfd97,0xfd1e,0xfdbe,0x0366,0x023f,0x0338,0xfc2e,0xfd44,
-0xfc62,0xfd1d,0xfd7a,0xfd68,0x0323,0x0340,0x039b,0xfd73,
-0xfd2c,0xfd12,0xfd8a,0xfd5b,0xfcc0,0x0333,0x0347,0x0213,
-0xfd61,0xfcaf,0xfc99,0xfd71,0xfd50,0xfdda,0x0377,0x0312,
-0x0354,0xfd57,0xfd1e,0xfd72,0xfcff,0xfda5,0xfd3b,0x03a5,
-0x02fc,0x023a,0xfd48,0xfdf9,0xfcad,0xfcae,0xfdc6,0xfd86,
-0x02cc,0x038a,0x028e,0xfd86,0xfc6c,0xfdbd,0xfc15,0xfcde,
-0xfcbb,0x0310,0x0324,0x0233,0xfd98,0xfca0,0xfc8b,0xfda7,
-0xfd89,0xfd94,0x0306,0x0217,0x036c,0xfcd7,0xfd6a,0xfc6d,
-0xfdb7,0xfdd1,0xfd13,0x0327,0x0256,0x0289,0xfc51,0xfc01,
-0xfd0a,0xfd84,0xfd45,0xfcca,0x0331,0x02f7,0x02ce,0xfda2,
-0xfdc3,0xfdeb,0xfd74,0xfdcd,0xfc10,0x033f,0x03e1,0x034e,
-0xfcda,0xfd51,0xfccb,0xfd5d,0xfc3d,0xfd45,0x035a,0x0237,
-0x025d,0xfc49,0xfc09,0xfd62,0xfd30,0xfd8c,0xfd34,0x036c,
-0x03f4,0x028b,0xfc9e,0xfdd3,0xfd7d,0xfd12,0xfc17,0xfcc5,
-0x0354,0x0224,0x0225,0xfc6f,0xfc6e,0xfdb4,0xfd3a,0xfdb5,
-0xfdb3,0x037f,0x03f0,0x0367,0xfc8f,0xfd07,0xfca6,0xfcf2,
-0xfc1f,0xfd1b,0x037c,0x03e8,0x024f,0xfc98,0xfdfd,0xfdbe,
-0xfcf7,0xfc2f,0xfd55,0x03a7,0x0204,0x0344,0xfc50,0xfd04,
-0xfcb4,0xfca9,0xfdf7,0xfd56,0x03a3,0x0264,0x0308,0xfdd3,
-0xfd3e,0xfc5f,0xfcb1,0xfd23,0xfdb3,0x03c8,0x0266,0x0330,
-0xfdbb,0xfcfd,0xfc2c,0xfc6d,0xfd1e,0xfd75,0x020c,0x0309,
-0x02cf,0xfce4,0xfd1f,0xfdde,0xfde7,0xfdb2,0xfc0c,0x0225,
-0x02b6,0x0312,0xfd18,0xfcb5,0xfdeb,0xfdb3,0xfc53,0xfda5,
-0x0372,0x02f2,0x0216,0xfd77,0xfc68,0xfced,0xfd09,0xfdd5,
-0xfdd3,0x0255,0x0345,0x02fe,0xfc2f,0xfc81,0xfd8d,0xfd47,
-0xfd54,0xfdc2,0x027b,0x03ba,0x02c0,0xfdb0,0xfc97,0xfd70,
-0xfcec,0xfc86,0xfc37,0x0323,0x0226,0x031e,0xfca1,0xfd8e,
-0xfca6,0xfd8a,0xfdb1,0xfd92,0x02bb,0x028e,0x031e,0xfc82,
-0xfddf,0xfc03,0xfc46,0xfcbb,0xfd92,0x039c,0x02ff,0x02e2,
-0xfd4b,0xfd66,0xfdd7,0xfcbe,0xfdc1,0xfded,0x03ca,0x02a3,
-0x0260,0xfd81,0xfdc0,0xfcdf,0xfc69,0xfc86,0xfd2e,0x0278,
-0x02c2,0x02ac,0xfc97,0xfcb4,0xfc50,0xfcf4,0xfc30,0xfc6e,
-0x035a,0x02ff,0x0233,0xfd7d,0xfc4f,0xfcb4,0xfd31,0xfdc2,
-0xfd94,0x020f,0x02fd,0x02be,0xfcec,0xfd2c,0xfdf3,0xfde1,
-0xfdc4,0xfc3c,0x022f,0x039c,0x03eb,0xfc0f,0xfddd,0xfc77,
-0xfd9e,0xfcbf,0xfc29,0x026a,0x020c,0x0263,0xfd87,0xfd1e,
-0xfd8f,0xfd15,0xfde8,0xfd27,0x03e7,0x03ae,0x03c3,0xfc68,
-0xfc54,0xfc8a,0xfc30,0xfc9d,0xfc77,0x0223,0x0359,0x03a7,
-0xfc6c,0xfc19,0xfcf1,0xfdb8,0xfd32,0xfcaa,0x02de,0x039e,
-0x0239,0xfd67,0xfcce,0xfdfd,0xfdf1,0xfcba,0xfd86,0x03c7,
-0x02ea,0x0227,0xfd3f,0xfdf8,0xfcdc,0xfc6f,0xfde0,0xfdaf,
-0x0342,0x0279,0x0371,0xfdfd,0xfd32,0xfddf,0xfd59,0xfcf1,
-0xfd0a,0x03ad,0x02bd,0x02d7,0xfd7b,0xfd64,0xfc1b,0xfc9f,
-0xfc3f,0xfdfc,0x03b1,0x0234,0x027c,0xfdf7,0xfdb5,0xfd43,
-0xfc97,0xfd91,0xfcea,0x0200,0x0233,0x0319,0xfdcd,0xfce6,
-0xfc97,0xfe00,0xfd95,0xfd99,0x03d8,0x022c,0x023a,0xfdea,
-0xfddc,0xfd94,0xfc4f,0xfda4,0xfd84,0x03d8,0x021c,0x02e4,
-0xfdf9,0xfd38,0xfcf2,0xfc4e,0xfdc6,0xfde8,0x020f,0x02fc,
-0x036a,0xfced,0xfc7b,0xfd74,0xfde1,0xfdc6,0xfd15,0x0212,
-0x0298,0x03f6,0xfd50,0xfdf3,0xfd6e,0xfddb,0xfca2,0xfc13,
-0x0222,0x0203,0x0209,0xfdda,0xfdd4,0xfdf3,0xfdb8,0xfdf9,
-0xfded,0x022a,0x03a6,0x02a0,0xfc0d,0xfd28,0xfd9b,0xfda8,
-0xfcac,0xfc8e,0x0256,0x03b1,0x022c,0xfdd8,0xfd76,0xfdff,
-0xfd44,0xfc98,0xfda5,0x0273,0x0213,0x02dd,0xfd75,0xfc7d,
-0xfd08,0xfcff,0xfdd9,0xfdf3,0x0240,0x03fc,0x03f6,0xfdc2,
-0xfdc5,0xfc0d,0xfd76,0xfc08,0xfc13,0x026f,0x039c,0x0252,
-0xfdcd,0xfd2c,0xfde7,0xfd09,0xfcbd,0xfd4d,0x02a6,0x038d,
-0x025b,0xfda6,0xfce0,0xfde8,0xfc7d,0xfcd9,0xfd38,0x032e,
-0x02e8,0x021f,0xfdb0,0xfc9f,0xfcea,0xfd78,0xfde3,0xfdbf};
-
-static const unsigned short wavtable2[2304]={
-0x0e,0x0e,0x0e,0x14,0x14,0x13,0x15,0x14,0x14,0x0e,0x0e,0x0e,
-0x14,0x14,0x14,0x14,0x15,0x15,0x0e,0x0d,0x0e,0x12,0x14,0x13,
-0x15,0x12,0x15,0x0d,0x0d,0x0e,0x12,0x13,0x13,0x13,0x12,0x15,
-0x0d,0x0e,0x0d,0x13,0x12,0x12,0x13,0x14,0x13,0x0d,0x0e,0x0f,
-0x13,0x13,0x14,0x13,0x15,0x16,0x0d,0x0d,0x0d,0x11,0x11,0x12,
-0x12,0x13,0x13,0x0c,0x0e,0x0d,0x12,0x11,0x13,0x11,0x14,0x13,
-0x0d,0x0d,0x0d,0x12,0x12,0x11,0x13,0x12,0x12,0x0d,0x0d,0x0c,
-0x12,0x11,0x11,0x12,0x13,0x11,0x0d,0x0c,0x0d,0x11,0x11,0x10,
-0x12,0x11,0x12,0x0c,0x0d,0x0c,0x11,0x10,0x11,0x11,0x13,0x11,
-0x0c,0x0d,0x0d,0x10,0x11,0x11,0x11,0x12,0x12,0x0c,0x0d,0x0d,
-0x10,0x10,0x11,0x10,0x13,0x12,0x0c,0x0c,0x0d,0x0f,0x10,0x10,
-0x10,0x11,0x12,0x0b,0x0d,0x0d,0x0f,0x0f,0x11,0x0f,0x12,0x12,
-0x0d,0x0c,0x0d,0x10,0x11,0x11,0x12,0x10,0x13,0x0c,0x0c,0x0c,
-0x10,0x10,0x10,0x11,0x10,0x11,0x0d,0x0c,0x0c,0x11,0x11,0x0f,
-0x13,0x10,0x10,0x0d,0x0c,0x0b,0x10,0x10,0x0e,0x13,0x10,0x0f,
-0x0c,0x0c,0x0c,0x10,0x10,0x10,0x11,0x11,0x11,0x0c,0x0d,0x0b,
-0x10,0x0f,0x10,0x11,0x12,0x0f,0x0c,0x0c,0x0b,0x10,0x0e,0x0f,
-0x10,0x11,0x0f,0x0b,0x0d,0x0c,0x0f,0x0f,0x10,0x0f,0x12,0x10,
-0x0c,0x0c,0x0c,0x0f,0x0f,0x0f,0x10,0x10,0x10,0x0b,0x0c,0x0c,
-0x0f,0x0e,0x0f,0x0f,0x10,0x10,0x0b,0x0c,0x0c,0x0f,0x0f,0x10,
-0x0f,0x10,0x11,0x0b,0x0c,0x0d,0x0f,0x0f,0x10,0x0e,0x11,0x12,
-0x0b,0x0c,0x0b,0x0f,0x0e,0x0f,0x0f,0x11,0x0f,0x0b,0x0c,0x0b,
-0x0f,0x0e,0x0f,0x0e,0x11,0x0f,0x0b,0x0d,0x0c,0x0f,0x0e,0x10,
-0x0e,0x12,0x11,0x0b,0x0c,0x0c,0x0e,0x0e,0x10,0x0e,0x11,0x11,
-0x0c,0x0c,0x0c,0x0f,0x10,0x0f,0x11,0x10,0x11,0x0c,0x0b,0x0c,
-0x0f,0x10,0x0f,0x11,0x0f,0x10,0x0c,0x0c,0x0b,0x0f,0x0f,0x0f,
-0x11,0x10,0x0f,0x0c,0x0c,0x0b,0x0f,0x0e,0x0e,0x10,0x10,0x0f,
-0x0d,0x0b,0x0b,0x0f,0x0f,0x0e,0x12,0x0f,0x0f,0x0c,0x0b,0x0a,
-0x0f,0x0e,0x0d,0x11,0x0f,0x0d,0x0b,0x0b,0x0b,0x0e,0x0e,0x0e,
-0x0f,0x0f,0x0e,0x0b,0x0b,0x0a,0x0e,0x0d,0x0d,0x0f,0x0f,0x0d,
-0x0c,0x0b,0x0c,0x0e,0x0f,0x0f,0x10,0x0f,0x11,0x0b,0x0b,0x0c,
-0x0e,0x0f,0x0f,0x0f,0x0f,0x10,0x0b,0x0c,0x0b,0x0e,0x0e,0x0e,
-0x0f,0x10,0x0f,0x0b,0x0b,0x0b,0x0e,0x0e,0x0e,0x0e,0x0f,0x0f,
-0x0b,0x0b,0x0c,0x0e,0x0e,0x0f,0x0e,0x0f,0x10,0x0b,0x0b,0x0c,
-0x0e,0x0e,0x0f,0x0e,0x0f,0x11,0x0b,0x0c,0x0c,0x0e,0x0e,0x0f,
-0x0e,0x10,0x10,0x0a,0x0c,0x0c,0x0d,0x0e,0x0f,0x0d,0x10,0x10,
-0x0b,0x0c,0x0b,0x0e,0x0d,0x0e,0x0e,0x10,0x0e,0x0b,0x0b,0x0b,
-0x0e,0x0d,0x0e,0x0e,0x0f,0x0e,0x0a,0x0c,0x0b,0x0e,0x0d,0x0e,
-0x0d,0x11,0x0e,0x0a,0x0c,0x0b,0x0e,0x0d,0x0e,0x0d,0x10,0x0e,
-0x0b,0x0b,0x0b,0x0d,0x0d,0x0e,0x0e,0x0f,0x0f,0x0a,0x0b,0x0b,
-0x0d,0x0d,0x0e,0x0d,0x0f,0x0f,0x0a,0x0b,0x0c,0x0d,0x0e,0x0e,
-0x0d,0x0f,0x10,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x0d,0x0f,0x10,
-0x0b,0x0c,0x0b,0x0e,0x0d,0x0f,0x0e,0x10,0x0f,0x0a,0x0c,0x0c,
-0x0e,0x0d,0x0f,0x0d,0x11,0x10,0x0a,0x0d,0x0c,0x0e,0x0e,0x10,
-0x0d,0x12,0x10,0x0a,0x0c,0x0d,0x0e,0x0e,0x10,0x0d,0x11,0x12,
-0x0a,0x0c,0x0b,0x0d,0x0d,0x0f,0x0d,0x10,0x0f,0x0a,0x0c,0x0b,
-0x0d,0x0d,0x0f,0x0d,0x10,0x0f,0x0a,0x0c,0x0c,0x0e,0x0d,0x10,
-0x0d,0x11,0x10,0x0a,0x0c,0x0c,0x0d,0x0e,0x10,0x0c,0x10,0x11,
-0x0c,0x0b,0x0c,0x0f,0x10,0x0e,0x11,0x0e,0x10,0x0c,0x0b,0x0b,
-0x0e,0x0f,0x0d,0x11,0x0e,0x0f,0x0b,0x0b,0x0c,0x0e,0x0e,0x0e,
-0x0f,0x0e,0x10,0x0b,0x0b,0x0b,0x0d,0x0e,0x0e,0x0e,0x0e,0x0f,
-0x0b,0x0a,0x0b,0x0d,0x0e,0x0d,0x0f,0x0d,0x0f,0x0b,0x0a,0x0b,
-0x0d,0x0e,0x0d,0x0f,0x0d,0x0f,0x0c,0x0a,0x0a,0x0e,0x0e,0x0c,
-0x11,0x0d,0x0d,0x0c,0x0a,0x0a,0x0d,0x0d,0x0b,0x10,0x0d,0x0c,
-0x0b,0x0b,0x0b,0x0e,0x0e,0x0d,0x0f,0x0e,0x0e,0x0b,0x0b,0x0a,
-0x0d,0x0d,0x0d,0x0f,0x0e,0x0d,0x0b,0x0b,0x0a,0x0e,0x0c,0x0d,
-0x0e,0x0f,0x0d,0x0a,0x0c,0x0a,0x0e,0x0c,0x0d,0x0d,0x10,0x0c,
-0x0b,0x0b,0x0b,0x0d,0x0e,0x0d,0x0e,0x0e,0x0f,0x0b,0x0b,0x0b,
-0x0d,0x0d,0x0d,0x0e,0x0e,0x0e,0x0a,0x0b,0x0b,0x0d,0x0d,0x0e,
-0x0d,0x0e,0x0f,0x0a,0x0b,0x0b,0x0c,0x0d,0x0d,0x0d,0x0e,0x0f,
-0x0b,0x0a,0x0b,0x0d,0x0d,0x0d,0x0e,0x0d,0x0e,0x0b,0x0b,0x0a,
-0x0d,0x0c,0x0d,0x0e,0x0e,0x0d,0x0b,0x0a,0x0a,0x0c,0x0c,0x0c,
-0x0e,0x0d,0x0d,0x0a,0x0a,0x0a,0x0c,0x0c,0x0c,0x0d,0x0d,0x0d,
-0x0b,0x0b,0x0a,0x0d,0x0c,0x0c,0x0e,0x0e,0x0c,0x0a,0x0b,0x0a,
-0x0d,0x0c,0x0c,0x0d,0x0e,0x0c,0x0a,0x0b,0x0a,0x0c,0x0b,0x0c,
-0x0d,0x0e,0x0c,0x0a,0x0b,0x0a,0x0c,0x0b,0x0c,0x0c,0x0e,0x0c,
-0x0a,0x0a,0x0b,0x0c,0x0d,0x0d,0x0d,0x0d,0x0f,0x0a,0x0a,0x0b,
-0x0c,0x0d,0x0d,0x0d,0x0d,0x0e,0x0a,0x0b,0x0b,0x0c,0x0c,0x0d,
-0x0c,0x0e,0x0e,0x0a,0x0b,0x0b,0x0c,0x0d,0x0d,0x0c,0x0e,0x0f,
-0x0a,0x0a,0x0b,0x0c,0x0c,0x0c,0x0c,0x0d,0x0e,0x0a,0x0a,0x0a,
-0x0b,0x0c,0x0c,0x0c,0x0d,0x0d,0x0a,0x0a,0x0b,0x0b,0x0c,0x0c,
-0x0c,0x0d,0x0e,0x09,0x0a,0x0b,0x0b,0x0c,0x0d,0x0b,0x0d,0x0e,
-0x0b,0x0b,0x0b,0x0d,0x0d,0x0d,0x0e,0x0f,0x0e,0x0a,0x0b,0x0b,
-0x0d,0x0c,0x0d,0x0d,0x0f,0x0e,0x0a,0x0b,0x0a,0x0d,0x0c,0x0d,
-0x0d,0x0f,0x0d,0x0a,0x0b,0x0b,0x0d,0x0c,0x0d,0x0c,0x0f,0x0e,
-0x0a,0x0b,0x0b,0x0d,0x0d,0x0e,0x0d,0x0f,0x0f,0x0a,0x0b,0x0b,
-0x0d,0x0d,0x0e,0x0c,0x0f,0x0f,0x0a,0x0b,0x0b,0x0d,0x0d,0x0e,
-0x0c,0x0f,0x0f,0x0a,0x0b,0x0c,0x0c,0x0d,0x0f,0x0c,0x0f,0x10,
-0x0a,0x0c,0x0b,0x0e,0x0c,0x0e,0x0d,0x10,0x0e,0x0a,0x0c,0x0b,
-0x0e,0x0c,0x0f,0x0c,0x11,0x0e,0x0a,0x0c,0x0c,0x0d,0x0d,0x0f,
-0x0c,0x10,0x10,0x0a,0x0d,0x0c,0x0e,0x0d,0x10,0x0c,0x12,0x11,
-0x0a,0x0c,0x0b,0x0d,0x0c,0x0f,0x0c,0x10,0x0f,0x0a,0x0c,0x0b,
-0x0d,0x0c,0x0e,0x0c,0x10,0x0f,0x0a,0x0c,0x0c,0x0d,0x0d,0x0f,
-0x0c,0x11,0x10,0x0a,0x0c,0x0c,0x0d,0x0d,0x10,0x0c,0x10,0x11,
-0x0a,0x0c,0x0a,0x0d,0x0c,0x0e,0x0c,0x10,0x0d,0x0a,0x0c,0x0b,
-0x0d,0x0c,0x0e,0x0c,0x10,0x0e,0x0a,0x0c,0x0a,0x0d,0x0b,0x0d,
-0x0c,0x10,0x0d,0x0a,0x0b,0x0b,0x0c,0x0c,0x0e,0x0c,0x0f,0x0e,
-0x0a,0x0b,0x0b,0x0c,0x0c,0x0d,0x0c,0x0e,0x0e,0x0a,0x0b,0x0b,
-0x0c,0x0c,0x0e,0x0c,0x0f,0x0f,0x09,0x0b,0x0b,0x0c,0x0c,0x0e,
-0x0b,0x0f,0x0f,0x09,0x0b,0x0c,0x0c,0x0d,0x0e,0x0b,0x0f,0x10,
-0x0a,0x0c,0x0b,0x0d,0x0c,0x0f,0x0c,0x11,0x0e,0x09,0x0c,0x0b,
-0x0d,0x0c,0x0f,0x0b,0x11,0x0f,0x09,0x0c,0x0c,0x0d,0x0c,0x0f,
-0x0b,0x10,0x10,0x09,0x0c,0x0c,0x0d,0x0d,0x10,0x0b,0x11,0x11,
-0x09,0x0c,0x0b,0x0d,0x0c,0x0f,0x0b,0x11,0x0e,0x09,0x0c,0x0c,
-0x0d,0x0c,0x10,0x0b,0x11,0x10,0x09,0x0c,0x0c,0x0d,0x0c,0x0f,
-0x0b,0x11,0x10,0x09,0x0d,0x0c,0x0d,0x0d,0x10,0x0b,0x12,0x11,
-0x0c,0x0a,0x0b,0x0d,0x0e,0x0c,0x10,0x0c,0x0e,0x0b,0x0a,0x0a,
-0x0c,0x0d,0x0c,0x0e,0x0c,0x0d,0x0a,0x0a,0x0b,0x0c,0x0d,0x0c,
-0x0d,0x0c,0x0f,0x0a,0x0a,0x0a,0x0c,0x0c,0x0c,0x0d,0x0c,0x0d,
-0x0b,0x09,0x0a,0x0c,0x0d,0x0b,0x0f,0x0b,0x0d,0x0b,0x0a,0x0a,
-0x0c,0x0c,0x0b,0x0e,0x0c,0x0c,0x0a,0x0a,0x09,0x0b,0x0b,0x0b,
-0x0d,0x0c,0x0b,0x0a,0x0a,0x09,0x0b,0x0b,0x0a,0x0d,0x0c,0x0a,
-0x0a,0x0a,0x0a,0x0c,0x0c,0x0c,0x0d,0x0d,0x0d,0x0a,0x0a,0x0a,
-0x0c,0x0b,0x0c,0x0c,0x0d,0x0d,0x0a,0x0a,0x0a,0x0b,0x0b,0x0b,
-0x0c,0x0c,0x0d,0x0a,0x0a,0x0a,0x0b,0x0b,0x0b,0x0c,0x0c,0x0c,
-0x0a,0x0a,0x0a,0x0c,0x0b,0x0b,0x0c,0x0d,0x0c,0x0a,0x0a,0x09,
-0x0b,0x0b,0x0b,0x0c,0x0d,0x0b,0x09,0x0a,0x09,0x0b,0x0a,0x0b,
-0x0b,0x0c,0x0b,0x09,0x0a,0x09,0x0b,0x0a,0x0b,0x0b,0x0d,0x0b,
-0x0a,0x09,0x0b,0x0b,0x0c,0x0b,0x0d,0x0b,0x0e,0x0a,0x0a,0x0a,
-0x0b,0x0c,0x0b,0x0d,0x0c,0x0d,0x0a,0x0a,0x0a,0x0b,0x0c,0x0c,
-0x0c,0x0c,0x0d,0x09,0x0a,0x0a,0x0a,0x0b,0x0b,0x0b,0x0c,0x0d,
-0x0a,0x09,0x0a,0x0b,0x0c,0x0a,0x0d,0x0b,0x0c,0x0a,0x09,0x0a,
-0x0b,0x0b,0x0a,0x0c,0x0b,0x0c,0x09,0x0a,0x0a,0x0b,0x0b,0x0b,
-0x0b,0x0c,0x0c,0x09,0x09,0x0a,0x0a,0x0a,0x0b,0x0b,0x0b,0x0c,
-0x09,0x0a,0x0a,0x0b,0x0b,0x0c,0x0b,0x0d,0x0d,0x09,0x0a,0x0a,
-0x0b,0x0b,0x0c,0x0b,0x0d,0x0d,0x09,0x0a,0x0b,0x0b,0x0b,0x0c,
-0x0b,0x0c,0x0e,0x09,0x0a,0x0b,0x0b,0x0b,0x0c,0x0b,0x0d,0x0e,
-0x09,0x0a,0x0a,0x0a,0x0a,0x0b,0x0b,0x0c,0x0c,0x09,0x0a,0x0a,
-0x0a,0x0a,0x0b,0x0a,0x0c,0x0d,0x09,0x09,0x0a,0x0a,0x0a,0x0b,
-0x0a,0x0b,0x0c,0x09,0x0a,0x0a,0x0a,0x0a,0x0c,0x0a,0x0c,0x0d,
-0x0a,0x0b,0x0a,0x0c,0x0c,0x0d,0x0d,0x0e,0x0d,0x0a,0x0b,0x0a,
-0x0c,0x0c,0x0d,0x0c,0x0e,0x0d,0x0a,0x0b,0x0a,0x0c,0x0b,0x0d,
-0x0c,0x0f,0x0d,0x0a,0x0b,0x0a,0x0c,0x0b,0x0d,0x0c,0x0e,0x0d,
-0x0a,0x0a,0x0a,0x0c,0x0b,0x0c,0x0c,0x0d,0x0d,0x0a,0x0a,0x0a,
-0x0b,0x0b,0x0c,0x0c,0x0d,0x0d,0x09,0x0b,0x0a,0x0c,0x0b,0x0c,
-0x0b,0x0e,0x0d,0x09,0x0b,0x0a,0x0b,0x0b,0x0c,0x0b,0x0e,0x0d,
-0x0a,0x0b,0x0b,0x0c,0x0c,0x0d,0x0c,0x0e,0x0e,0x09,0x0b,0x0b,
-0x0c,0x0c,0x0d,0x0b,0x0e,0x0e,0x09,0x0b,0x0b,0x0b,0x0c,0x0d,
-0x0b,0x0e,0x0f,0x09,0x0b,0x0c,0x0b,0x0c,0x0e,0x0b,0x0e,0x10,
-0x09,0x0b,0x0b,0x0c,0x0b,0x0d,0x0b,0x0e,0x0e,0x09,0x0b,0x0b,
-0x0c,0x0c,0x0d,0x0b,0x0e,0x0e,0x09,0x0b,0x0b,0x0b,0x0c,0x0d,
-0x0b,0x0e,0x0f,0x09,0x0b,0x0c,0x0b,0x0c,0x0e,0x0a,0x0e,0x10,
-0x09,0x0b,0x0a,0x0c,0x0b,0x0d,0x0b,0x0f,0x0d,0x09,0x0b,0x0b,
-0x0c,0x0b,0x0e,0x0b,0x0f,0x0e,0x09,0x0c,0x0a,0x0c,0x0b,0x0d,
-0x0b,0x10,0x0d,0x09,0x0b,0x0b,0x0c,0x0b,0x0e,0x0b,0x0f,0x0e,
-0x09,0x0b,0x0b,0x0c,0x0c,0x0e,0x0b,0x0f,0x0f,0x09,0x0b,0x0c,
-0x0c,0x0c,0x0f,0x0b,0x0f,0x10,0x09,0x0c,0x0b,0x0c,0x0c,0x0e,
-0x0b,0x10,0x0f,0x09,0x0c,0x0c,0x0c,0x0d,0x0f,0x0b,0x10,0x10,
-0x09,0x0c,0x0b,0x0d,0x0b,0x0e,0x0b,0x11,0x0e,0x09,0x0c,0x0b,
-0x0d,0x0c,0x0f,0x0b,0x11,0x0f,0x09,0x0c,0x0b,0x0c,0x0c,0x0e,
-0x0a,0x10,0x0f,0x09,0x0c,0x0c,0x0c,0x0c,0x0f,0x0a,0x10,0x10,
-0x09,0x0c,0x0b,0x0d,0x0b,0x0f,0x0a,0x11,0x0e,0x09,0x0d,0x0c,
-0x0d,0x0c,0x10,0x0a,0x12,0x10,0x09,0x0d,0x0c,0x0d,0x0c,0x10,
-0x0a,0x12,0x10,0x09,0x0c,0x0d,0x0d,0x0d,0x10,0x0a,0x11,0x12,
-0x0a,0x0b,0x0a,0x0c,0x0b,0x0c,0x0c,0x0f,0x0c,0x09,0x0b,0x0a,
-0x0c,0x0a,0x0c,0x0b,0x0f,0x0c,0x09,0x0a,0x0a,0x0b,0x0b,0x0c,
-0x0b,0x0d,0x0c,0x09,0x0a,0x0a,0x0b,0x0a,0x0b,0x0a,0x0d,0x0c,
-0x09,0x0b,0x0a,0x0c,0x0b,0x0c,0x0b,0x0e,0x0d,0x09,0x0b,0x0a,
-0x0b,0x0b,0x0c,0x0b,0x0e,0x0d,0x09,0x0b,0x0a,0x0c,0x0b,0x0d,
-0x0a,0x0f,0x0d,0x09,0x0b,0x0b,0x0c,0x0b,0x0e,0x0a,0x0f,0x0e,
-0x09,0x0a,0x0a,0x0b,0x0b,0x0c,0x0a,0x0d,0x0d,0x09,0x0b,0x0a,
-0x0b,0x0a,0x0c,0x0a,0x0e,0x0c,0x09,0x0a,0x0a,0x0b,0x0b,0x0c,
-0x0a,0x0d,0x0d,0x09,0x0a,0x0b,0x0b,0x0b,0x0d,0x0a,0x0d,0x0e,
-0x09,0x0b,0x0b,0x0b,0x0b,0x0d,0x0a,0x0e,0x0e,0x09,0x0b,0x0b,
-0x0b,0x0c,0x0e,0x0a,0x0e,0x0f,0x09,0x0b,0x0b,0x0b,0x0b,0x0d,
-0x0a,0x0e,0x0e,0x09,0x0b,0x0b,0x0b,0x0b,0x0e,0x0a,0x0e,0x0f,
-0x09,0x0c,0x0a,0x0c,0x0b,0x0d,0x0b,0x10,0x0d,0x09,0x0c,0x0a,
-0x0c,0x0b,0x0e,0x0a,0x10,0x0d,0x09,0x0b,0x0b,0x0c,0x0b,0x0e,
-0x0a,0x0f,0x0e,0x09,0x0b,0x0b,0x0c,0x0c,0x0e,0x0a,0x0f,0x0f,
-0x09,0x0c,0x0b,0x0c,0x0b,0x0e,0x0a,0x10,0x0f,0x09,0x0c,0x0c,
-0x0c,0x0c,0x0f,0x0a,0x10,0x10,0x09,0x0c,0x0b,0x0d,0x0c,0x0f,
-0x0a,0x11,0x0f,0x09,0x0d,0x0c,0x0d,0x0c,0x10,0x0a,0x12,0x11,
-0x09,0x0b,0x0a,0x0c,0x0b,0x0d,0x0a,0x0f,0x0d,0x09,0x0c,0x0b,
-0x0c,0x0b,0x0e,0x0a,0x10,0x0e,0x09,0x0c,0x0b,0x0c,0x0b,0x0e,
-0x0a,0x10,0x0f,0x09,0x0b,0x0c,0x0c,0x0c,0x0f,0x0a,0x0f,0x10,
-0x09,0x0c,0x0b,0x0c,0x0b,0x0f,0x0a,0x11,0x0e,0x09,0x0c,0x0c,
-0x0c,0x0c,0x10,0x0a,0x11,0x10,0x08,0x0c,0x0b,0x0c,0x0b,0x0e,
-0x09,0x10,0x0f,0x08,0x0c,0x0c,0x0c,0x0c,0x0f,0x09,0x11,0x10,
-0x0a,0x09,0x09,0x0a,0x0b,0x0a,0x0c,0x0a,0x0b,0x09,0x09,0x09,
-0x0a,0x0a,0x09,0x0b,0x0a,0x0a,0x09,0x0a,0x09,0x0a,0x0a,0x0a,
-0x0b,0x0c,0x0b,0x09,0x09,0x09,0x0a,0x09,0x0a,0x0a,0x0b,0x0a,
-0x09,0x09,0x0a,0x0a,0x0a,0x0b,0x0b,0x0b,0x0c,0x09,0x09,0x0a,
-0x09,0x0a,0x0a,0x0a,0x0a,0x0c,0x09,0x09,0x09,0x09,0x09,0x0a,
-0x0a,0x0b,0x0b,0x08,0x09,0x09,0x09,0x09,0x0a,0x09,0x0b,0x0b,
-0x09,0x0a,0x09,0x0a,0x0a,0x0b,0x0a,0x0c,0x0b,0x08,0x0a,0x09,
-0x0a,0x09,0x0a,0x09,0x0c,0x0b,0x08,0x0a,0x0a,0x0a,0x09,0x0b,
-0x09,0x0c,0x0c,0x08,0x09,0x0a,0x09,0x0a,0x0b,0x09,0x0b,0x0d,
-0x09,0x09,0x09,0x09,0x09,0x09,0x0a,0x0a,0x0a,0x07,0x08,0x08,
-0x07,0x07,0x07,0x07,0x08,0x08,0x08,0x0a,0x09,0x09,0x09,0x0a,
-0x08,0x0c,0x0b,0x08,0x09,0x09,0x08,0x08,0x0a,0x08,0x0a,0x0b,
-0x09,0x0b,0x0a,0x0b,0x0a,0x0c,0x0a,0x0f,0x0c,0x09,0x0b,0x0a,
-0x0b,0x0a,0x0d,0x0a,0x0f,0x0c,0x09,0x0a,0x0a,0x0a,0x0a,0x0c,
-0x0a,0x0d,0x0d,0x08,0x0a,0x0b,0x0a,0x0b,0x0d,0x09,0x0d,0x0e,
-0x09,0x0b,0x0a,0x0b,0x0a,0x0d,0x0a,0x0f,0x0d,0x09,0x0b,0x0b,
-0x0b,0x0b,0x0e,0x0a,0x0f,0x0e,0x08,0x0b,0x0b,0x0b,0x0b,0x0d,
-0x09,0x0e,0x0e,0x08,0x0b,0x0c,0x0b,0x0b,0x0e,0x09,0x0f,0x10,
-0x08,0x0a,0x09,0x0a,0x09,0x0b,0x09,0x0d,0x0b,0x08,0x0b,0x0a,
-0x0b,0x0a,0x0c,0x09,0x0e,0x0d,0x08,0x0b,0x0a,0x0a,0x0a,0x0c,
-0x09,0x0e,0x0d,0x08,0x0a,0x0b,0x0a,0x0b,0x0d,0x09,0x0d,0x0e,
-0x08,0x0c,0x0b,0x0b,0x0a,0x0e,0x09,0x10,0x0e,0x08,0x0c,0x0b,
-0x0b,0x0b,0x0e,0x09,0x10,0x0f,0x08,0x0b,0x0a,0x0a,0x0a,0x0c,
-0x09,0x0e,0x0d,0x08,0x0b,0x0a,0x0a,0x0a,0x0d,0x08,0x0e,0x0d};
-
-static const signed short etable1[5120]={
-0x0026,0xfffc,0x000f,0xfffc,0x000e,0xfff3,0x000c,0xfff5,
-0xfffe,0xfffa,0xfffa,0xfff5,0xffd3,0xfff0,0xfff5,0xfff3,
-0xfff9,0x0006,0xfff4,0x0004,0xffec,0x0003,0xfff0,0x000c,
-0xffff,0x000c,0x002e,0x0018,0x0000,0x0021,0xfffd,0x0009,
-0xfff4,0xfff4,0xfff8,0xfff9,0x0011,0xfffa,0x0000,0xfffe,
-0x003c,0xfff0,0x0003,0xffea,0x000a,0xffe0,0x0000,0xffe4,
-0xffef,0xffee,0xfffd,0xffe7,0xffdb,0xffe9,0xfff6,0x0003,
-0x0002,0x0003,0x0000,0x0003,0xfff2,0x0000,0xfff2,0xffff,
-0x0000,0x0002,0x0020,0x0009,0xffff,0x0019,0x0007,0x000d,
-0xfffb,0x000d,0x0008,0x0001,0x0002,0x0008,0xfff6,0x0006,
-0x001b,0xfff4,0x001c,0xfffe,0x0006,0xfff9,0x000f,0x0009,
-0xfff5,0x0001,0xfff3,0xfff5,0xffd8,0x0004,0xffe3,0xfff2,
-0xffed,0xfffb,0xffe9,0xfff8,0xffe2,0xfff3,0xffef,0x0000,
-0xfff2,0x000c,0x0022,0x0014,0xfffe,0x0019,0x0002,0xfff0,
-0xfffc,0xfff4,0x000f,0x0010,0x001d,0x0007,0x0018,0x000a,
-0x0031,0xffe8,0x0010,0xffec,0x0002,0xffe6,0x0002,0xfff9,
-0xffe7,0xfff6,0xfff5,0xffe7,0xffe0,0xfffd,0xffe5,0x0002,
-0xfff8,0xfff8,0xfff5,0xfff7,0xffe8,0xffef,0xfff0,0xfff2,
-0xfff3,0x0002,0x0014,0x0005,0xfffc,0x0011,0x000e,0xfff4,
-0x0003,0x000d,0x0021,0x0019,0x000e,0x0017,0x000f,0x0013,
-0x002e,0xfffa,0x0015,0x0008,0xfffe,0xfff0,0xfffb,0xfff8,
-0xfff5,0x0004,0x0008,0x000f,0xffe8,0x0004,0xfffe,0xffe6,
-0xfffd,0xfff0,0xfff0,0xfff2,0xfff7,0xfffe,0xffff,0x0004,
-0x0013,0x0007,0x0024,0x0011,0x0009,0x000d,0x0000,0x001f,
-0xfffb,0xfff4,0x0007,0xfff8,0x000b,0xfff1,0xfff3,0xfffc,
-0x0044,0xffee,0x0009,0xfff7,0xfffa,0xffdd,0xffee,0xffe7,
-0xffe6,0xfff9,0x000a,0x0001,0xfff0,0xfffd,0xffff,0xfff7,
-0x0006,0xffed,0xfffc,0xfff1,0xfffc,0xfffa,0x0000,0xfff8,
-0x0014,0xfffe,0x0017,0x0002,0x0007,0x0005,0x000c,0x0023,
-0x0001,0x000d,0x0018,0x0000,0xfffd,0x0000,0xffea,0x0004,
-0x0023,0xfff2,0x0022,0x000a,0xfff6,0xfff6,0xffff,0x000c,
-0xffec,0x000c,0x0000,0x000f,0xffee,0x0018,0xffec,0xffe5,
-0xfff2,0xffe4,0xffe5,0xffe5,0xffec,0xffed,0xfffe,0xfff8,
-0x0005,0x0007,0x0019,0x000d,0x0005,0x0005,0x0006,0x0005,
-0x0002,0xfff4,0x001f,0x000f,0x0017,0xffff,0x000c,0x0008,
-0x0039,0xffe6,0x0016,0xfff9,0xfff2,0xffe4,0xfff2,0xfffd,
-0xffdd,0x0000,0x0003,0x0001,0xfff5,0x0010,0xffee,0xfff6,
-0xfffc,0xffe1,0xfff1,0xffe4,0xfff2,0xffe9,0xffff,0xffeb,
-0x0007,0xfffe,0x000b,0xffff,0x0003,0xffff,0x0012,0x0009,
-0x000a,0x000d,0x0031,0x0018,0x0008,0x000e,0x0002,0x0010,
-0x0019,0x000f,0x0016,0x000b,0x0012,0x0004,0x000f,0xffea,
-0x0008,0xfffe,0xffef,0xfff7,0xffd0,0xffec,0xffe2,0xffef,
-0xfff0,0x000b,0xffff,0x0010,0x0002,0x000a,0xfffb,0x001a,
-0xfffe,0xfffc,0x0016,0x0000,0x0002,0x000a,0xfffa,0x000d,
-0xfff2,0x000a,0xffe9,0x0000,0x000a,0xfffe,0x0001,0x0000,
-0x002f,0x0003,0x000b,0xfffa,0x000f,0xfff3,0x0002,0xffda,
-0xfffa,0xfff3,0xfff1,0xffea,0xffd8,0xffe4,0xffe4,0x0000,
-0xfffb,0x0008,0x000a,0x000f,0x0007,0x0007,0xfffc,0x000d,
-0xffff,0xfff2,0x0009,0xfff2,0x0000,0x0002,0x0004,0x0012,
-0xfff9,0x0024,0xfffa,0x0008,0xfffd,0x000d,0xfff9,0x0008,
-0x000e,0x0007,0x0024,0x000d,0x000a,0x000a,0x0012,0x0000,
-0x0000,0x0005,0xffe7,0xfff8,0xffd5,0x0000,0xffd0,0xffee,
-0xffe5,0x0000,0xfff4,0x0003,0xfff9,0xfffa,0xfff9,0x000d,
-0xfff1,0xfffb,0x000b,0xfffd,0x0000,0x0002,0x0000,0xfff4,
-0xfffa,0x000a,0x0000,0x0017,0x0016,0x000b,0x001a,0x000c,
-0x0024,0xfffb,0x0018,0xfffc,0x0007,0xfff9,0x0006,0xffef,
-0xfff2,0xfffb,0xffea,0xffea,0xffdd,0xfff8,0xffd2,0xffff,
-0xffef,0xfffd,0x0000,0x0002,0xfffe,0xfff6,0xfffb,0x0000,
-0xfff2,0xfff1,0xfffe,0xffee,0xfffe,0xfffc,0x000b,0xfff9,
-0x0001,0x0024,0x0012,0x0020,0x0007,0x001b,0x0011,0x0014,
-0x0021,0x000d,0x001d,0x0018,0x0001,0x0001,0xfffe,0xffee,
-0x0000,0x0009,0xfffd,0x0011,0xffe5,0x0000,0xffeb,0xffe2,
-0xfff4,0xfff5,0xfffb,0xfffe,0x000c,0x0004,0x0009,0x0013,
-0x0012,0xfff7,0x000d,0xfffa,0x000b,0xfff8,0xfffe,0x0023,
-0xfff8,0x000a,0xfff9,0xffff,0x0004,0xfff5,0xfff6,0xfffe,
-0x0037,0x0001,0x0011,0x0006,0xffff,0xfff0,0xfff1,0xffdd,
-0xfff1,0xfffe,0x0000,0x0004,0xffed,0xfff8,0xffec,0xfff3,
-0xffff,0xfff2,0x0007,0xfffd,0x0012,0x0000,0x000a,0x0005,
-0x0013,0xffed,0x0000,0xffeb,0x0008,0xfff0,0x0009,0x0027,
-0x0000,0x0024,0x000a,0x0007,0xfff7,0x0004,0xffec,0x0005,
-0x0016,0x0005,0x002a,0x001a,0xfffa,0x0008,0x0001,0x0002,
-0xfff7,0x0011,0xfff6,0x0012,0xffeb,0x0013,0xffd9,0xffe1,
-0xffe9,0xffe9,0xfff0,0xfff1,0x0002,0xfff4,0x0007,0x0006,
-0x0005,0xfff7,0x0001,0xfff6,0x0007,0xfff0,0x0004,0x0009,
-0x0000,0x000a,0x0011,0x0016,0x0010,0x0002,0x000e,0x0009,
-0x002c,0xfffa,0x001e,0x0008,0xfff7,0xfff6,0xfff5,0xfff2,
-0xffe9,0x0005,0xfff8,0x0004,0xfff2,0x000c,0xffdb,0xfff2,
-0xfff4,0xffe6,0xfffc,0xfff0,0x0008,0xfff0,0x0009,0xfff9,
-0x0006,0xffed,0xfff4,0xffe7,0x0005,0xffe8,0x000f,0x000d,
-0x0008,0x0024,0x0022,0x001f,0x0001,0x0012,0x0004,0x0012,
-0xfffd,0xfffb,0xfff7,0xfff9,0x000f,0xffff,0x0005,0x000d,
-0x0002,0x000c,0x0005,0x0002,0xffeb,0xffe9,0xfffe,0xfff0,
-0x0000,0x0005,0xfffa,0x000d,0xffe9,0x0003,0xffe0,0x000a,
-0xfff1,0x0008,0x002c,0x001c,0x0009,0x0025,0xfffe,0x000d,
-0xfff7,0xfff1,0xfff4,0xffe5,0xfff9,0xfff4,0x0000,0xfff5,
-0x0012,0xffef,0xffeb,0xffe7,0x000b,0xffed,0xfffa,0xfffd,
-0xfff5,0x0000,0x0007,0xfff5,0xfff3,0xffe1,0xffff,0x0000,
-0x0009,0x0001,0x0005,0x000c,0xffee,0x0000,0xffe1,0xfffe,
-0xfff3,0xffff,0x001e,0x000e,0x0007,0x001d,0x0009,0x0012,
-0xffff,0x000a,0x0004,0xffee,0xffea,0x0003,0xfff6,0xfffe,
-0xfff3,0xfff3,0x0003,0xfffb,0x0007,0x0004,0x0009,0x0022,
-0xfffb,0x0014,0xfffe,0x0003,0xfff0,0xfffd,0xffec,0xffef,
-0xfff5,0xfff9,0xffef,0x0000,0xffde,0xfff3,0xffdf,0xfffe,
-0xffe4,0x0008,0x0020,0x0018,0x0005,0x001d,0x0003,0xfff4,
-0x0000,0xfff1,0x000b,0xfffd,0x0003,0x0002,0x0018,0x0001,
-0x0008,0xffe7,0xfff8,0xffe9,0x0003,0xfff3,0xfffd,0x0011,
-0xffec,0x0008,0x0000,0xfff6,0xfff8,0xfff5,0xffee,0x0000,
-0xffff,0xfff6,0xfffb,0x0000,0xffe4,0xffef,0xffe0,0xfff1,
-0xffe6,0xffff,0x0013,0x0009,0x0003,0x0015,0x000f,0xfff9,
-0x0006,0x0009,0x001d,0x0005,0xfff6,0x0011,0x000f,0x0009,
-0x0004,0xfffa,0xfffd,0x0005,0xffff,0xfffc,0xfff5,0x0010,
-0xfffa,0x0017,0x0013,0x001d,0x0000,0xfffd,0x0006,0xffe2,
-0x0003,0xffef,0xfff6,0xfffb,0xfff3,0xfffe,0xffef,0x0003,
-0x0005,0x0003,0x0023,0x0015,0x0011,0x0011,0x0002,0x0023,
-0xfffe,0xfff1,0x0003,0xffe4,0xfff3,0xffeb,0xfff3,0xfff3,
-0x001a,0xffed,0xfff1,0xfff4,0xfffb,0xffea,0xffe8,0x0000,
-0xffeb,0x000c,0x0015,0x000f,0x0008,0xfff5,0x0007,0xfff4,
-0x000e,0xffec,0x0002,0xfffa,0xfff9,0xfffa,0xfff0,0xfff7,
-0x0006,0xfffb,0x0015,0x0007,0x000f,0x000a,0x000d,0x0027,
-0x0005,0x000a,0x0014,0xffed,0xffe4,0xfffb,0xffea,0xfffb,
-0xfffb,0xfff1,0x0009,0x0007,0xfff7,0x0002,0xfff8,0x0025,
-0xfff2,0x001f,0x000b,0x001d,0x0005,0x0010,0xfff5,0xffe2,
-0xfff9,0xffe3,0xffeb,0xffee,0xffe9,0xffed,0xffee,0xfff7,
-0xfff9,0x0003,0x0017,0x0011,0x000e,0x0009,0x0008,0x0009,
-0x0006,0xfff1,0x001b,0xfffc,0xfffe,0xfffa,0x000c,0xffff,
-0x0010,0xffe5,0xfffe,0xfff6,0xfff3,0xfff0,0xffec,0x0014,
-0xffe3,0x0014,0x000e,0x0010,0x000d,0x0008,0xfff7,0xfff3,
-0x0002,0xffdf,0xfff7,0xffed,0xffef,0xffe9,0xffef,0xffea,
-0xfffa,0xfffa,0x0009,0x0002,0x000c,0x0002,0x0014,0x000d,
-0x000d,0x000a,0x002d,0x0004,0xfff0,0x0008,0x0002,0x0007,
-0xfff0,0x000e,0xfffe,0x0008,0x0014,0x0011,0x0009,0x0002,
-0x000e,0x0010,0xfffa,0x0005,0xffe8,0xffe4,0xffeb,0xffec,
-0xfff8,0x0009,0x0004,0x0019,0xffff,0x000b,0xffea,0x0018,
-0xfff1,0xfff8,0x0015,0x0005,0x000b,0x000e,0xfffb,0x0012,
-0xfff5,0x0007,0xffe5,0xffec,0xfff2,0xfff9,0x0001,0xfff7,
-0x0006,0x0002,0xfff2,0xfff7,0x0010,0xffff,0xfffd,0xfff2,
-0x0000,0x0005,0xfffd,0xfff8,0xfff0,0xffdc,0xffed,0xfffd,
-0x0001,0x0006,0x0011,0x0018,0x0004,0x0007,0xffeb,0x000b,
-0xfff2,0xffee,0x0007,0xfff7,0x0009,0x0007,0x0006,0x0016,
-0xfffd,0x0021,0xfff6,0xfff5,0xffe4,0x0007,0xfff9,0x0000,
-0xffe6,0x0006,0x000b,0x000a,0x000c,0x0017,0x000c,0x0017,
-0x0005,0x0018,0xfff3,0x0005,0xffed,0xfff8,0xffda,0xffeb,
-0xffec,0xfffe,0xfffa,0x000c,0xfff5,0xfffb,0xffe9,0x000b,
-0xffe3,0xfff7,0x0009,0x0000,0x0007,0x0006,0x0001,0xfff9,
-0xfffe,0x0007,0xfffd,0x0003,0xfffe,0x0006,0x001b,0x0003,
-0xfffc,0xfffa,0x0000,0xfff9,0x0008,0x0004,0x0000,0x0006,
-0xfff7,0x000d,0xfff5,0xfff9,0xfff5,0xfff1,0xffdb,0xfffc,
-0xfff7,0xfffb,0x0005,0x000b,0xfffb,0xfff7,0xffea,0xffff,
-0xffe5,0xffee,0xfffc,0xfff2,0x0005,0x0000,0x000c,0xfffd,
-0x0004,0x0020,0x000e,0x000c,0xffef,0x0016,0x0011,0x000b,
-0xfff8,0x000c,0x0003,0x0015,0x0003,0x000e,0xfff8,0x0005,
-0x0004,0x001c,0x0007,0x0020,0xfffe,0xfff8,0xfff4,0xffde,
-0xfffc,0xfff4,0x0001,0x0006,0x0009,0x0004,0xfff9,0x0011,
-0x0004,0xfff3,0x000b,0xffff,0x0013,0xfffc,0x0000,0x0027,
-0xfffc,0x0007,0xfff5,0xffeb,0xffec,0xfff0,0xfff6,0xfff5,
-0x000d,0x0000,0xfff8,0x0003,0x0000,0xfffc,0xffeb,0xfff5,
-0xfff7,0x0010,0x000a,0x0012,0x0005,0xfff0,0xfff6,0xfff0,
-0x0005,0xfff1,0x000d,0x0005,0x000f,0x0001,0xfffa,0x0004,
-0x0006,0xffe9,0xfffe,0xfff0,0x0011,0xfff4,0x000a,0x002c,
-0x0003,0x0021,0x0006,0xfff4,0xffde,0xffff,0xffec,0xfffd,
-0xffee,0x0004,0x0011,0x0017,0xfffc,0x0014,0xfffc,0x001a,
-0xfffd,0x0024,0x0000,0x0020,0x0002,0x000c,0xffe3,0xffde,
-0xfff0,0xffe8,0xfff6,0xfffa,0x0000,0xfff4,0xfff8,0x0004,
-0xfff8,0xfff3,0x0000,0xfffa,0x0010,0xfff4,0x0005,0x000d,
-0x0003,0x0007,0x000d,0x0003,0xfff8,0xfffe,0x000e,0x0000,
-0x0003,0xfff9,0x0005,0x0005,0xfff8,0x0002,0xffef,0x0009,
-0xffee,0x0018,0x0002,0x0013,0x000a,0x0004,0xffe4,0xffef,
-0xfffb,0xffe4,0x0002,0xfff9,0x0004,0xfff1,0xfff9,0xfff8,
-0xfffa,0xffe9,0xfff3,0xffeb,0x000e,0xffec,0x0011,0x0012,
-0x000b,0x0021,0x001e,0x000b,0xffe9,0x000d,0x0005,0x0009,
-0x003c,0x000a,0x0007,0xffff,0x0009,0xfff8,0x0006,0xfff3,
-0x0002,0xfff1,0xffff,0xfff6,0xfff3,0xfff5,0x000f,0x0000,
-0x0006,0x0009,0xffff,0x0000,0xfff3,0x0001,0xfff5,0xfffd,
-0xfff3,0x0015,0x000d,0x001a,0xfff9,0x001f,0xfff6,0xfff9,
-0xfff0,0xffdf,0xffe1,0xfff6,0x0016,0xfff8,0x0001,0xfffe,
-0x0052,0xffff,0xfffc,0xffed,0x0006,0xffe5,0xfffa,0xffe3,
-0xfff4,0xffe6,0x0001,0xffe8,0xfffb,0xffee,0x0011,0x0011,
-0x0011,0x0006,0x000a,0x0000,0xfff9,0xfffe,0xfff7,0xfff0,
-0xfff4,0x000b,0x0000,0x000b,0xfff7,0x0017,0x0000,0xfffd,
-0xfff8,0xfff8,0xfff3,0xffff,0x0008,0x0007,0xfff9,0x0006,
-0x0031,0x0002,0x0015,0x0000,0x0001,0xfffe,0x0009,0x0008,
-0xfffa,0xfffa,0xfff8,0xfff6,0xfff8,0x0009,0xfffe,0x0000,
-0xfffc,0xfffe,0xfff3,0xfff4,0xffe9,0xfff1,0xfff4,0xfff0,
-0xffe6,0x0015,0x0002,0x0015,0xfff5,0x0017,0xfffc,0xffdf,
-0xfff9,0xffdf,0xfffa,0x000d,0x0022,0x0005,0x001b,0x000a,
-0x0047,0xfff6,0x0009,0xffef,0xffff,0xffec,0xfffd,0xfff8,
-0xffeb,0xffee,0xfffa,0xffe8,0x0000,0x0001,0x0000,0x0010,
-0x0006,0xfffb,0x0000,0xfff3,0xffef,0xffed,0xfff5,0xffe3,
-0xffe7,0x000b,0xfff5,0x0006,0xfff3,0x000f,0x0007,0xffe3,
-0x0000,0xfff8,0x000b,0x0016,0x0014,0x0015,0x0011,0x0012,
-0x0043,0x0008,0x000e,0x000b,0xfff9,0xfff5,0xfff5,0xfff7,
-0xfff9,0xfffd,0x000d,0x0010,0x0008,0x0009,0x0018,0xfff4,
-0x000a,0xfff3,0xfffb,0xffef,0xfffe,0xfffc,0x0003,0xfff6,
-0x0006,0x0011,0x0004,0x0013,0x0000,0x000b,0xfffa,0x000d,
-0xfff7,0xffdf,0xfff2,0xfff6,0x0010,0xffef,0xfff6,0xfffc,
-0x005a,0xfffd,0x0002,0xfffa,0xfff6,0xffe3,0xffe8,0xffe6,
-0xffeb,0xfff1,0x000f,0x0002,0x0010,0x0001,0x0019,0x0004,
-0x0015,0xfff0,0x0006,0xffee,0x0003,0xfff8,0x0005,0xffe8,
-0x0008,0x0007,0xfff7,0x0004,0xffff,0x0003,0x0005,0x0012,
-0xffff,0xfff9,0x0002,0xffff,0x0002,0xffff,0xffed,0x0003,
-0x0039,0x0000,0x001b,0x000d,0xfff2,0xfffb,0xfff9,0x000b,
-0xfff1,0x0004,0x0005,0x0010,0x000d,0x001d,0x0006,0xfff3,
-0x0000,0xffe7,0xfff0,0xffe1,0xfff4,0xffea,0x0002,0xffe9,
-0xfffa,0x0010,0xfff9,0x000e,0xfffe,0x0003,0x0000,0xfff4,
-0x0000,0xffdf,0x0009,0x000d,0x001c,0xfffd,0x000e,0x0007,
-0x004f,0xfff5,0x000f,0xfffc,0xffee,0xffe9,0xffec,0xfffb,
-0xffe2,0xfff9,0x0007,0x0002,0x0015,0x0015,0x0008,0x0003,
-0x000a,0xffe4,0xfffc,0xffe1,0xfffa,0xffe7,0x0003,0xffdb,
-0xfffc,0x0007,0xffec,0x0000,0xfffc,0xfffc,0x000b,0xfff9,
-0x0006,0xfff8,0x001b,0x0016,0x000e,0x000c,0x0005,0x0010,
-0x002f,0x001e,0x000f,0x000e,0x000e,0x0009,0x0009,0xffe9,
-0x000d,0xfff6,0xfff4,0xfff9,0xfff0,0xfff1,0xfffd,0xfffd,
-0xffff,0x000e,0x0009,0x000c,0x0009,0x0008,0x0000,0x000a,
-0xfff2,0x0004,0xfff7,0x0002,0xfffb,0x0008,0xfff3,0xfffd,
-0xffee,0xfff6,0xffd3,0xfffd,0x0010,0xfffc,0x0004,0x0000,
-0x0045,0x0011,0x0003,0xfffd,0x000a,0xfff8,0xfffd,0xffd8,
-0xffff,0xffeb,0xfff6,0xffeb,0xfff8,0xffe9,0xffff,0x000d,
-0x0008,0x000b,0x0015,0x000b,0x000f,0x0004,0x0000,0xfffe,
-0xfff3,0xfffb,0xffe9,0xfff4,0xfff9,0x0000,0xffff,0x0000,
-0xfff6,0x000e,0xffe4,0x0005,0x0001,0x000b,0xfffb,0x0007,
-0x0024,0x0015,0x001c,0x0010,0x0006,0x0010,0x000c,0xfffe,
-0x0004,0xfffe,0xffec,0xfff9,0xfff5,0x0004,0xffec,0xfffc,
-0xfff4,0x0002,0xffff,0x0000,0x0000,0xfff8,0xfffe,0xfffe,
-0xffe5,0x0004,0xffeb,0xfffe,0xfff7,0x0000,0xfffa,0xffe3,
-0xfff7,0xfff6,0xffeb,0x0015,0x001c,0x000a,0x001d,0x000b,
-0x003a,0x0009,0x0010,0xffff,0x0002,0xfffe,0x0000,0xffed,
-0xfff6,0xfff3,0xffef,0xffeb,0xfffd,0xfffd,0xffed,0x000c,
-0xfffe,0x0000,0x000a,0xffff,0x0005,0xfff4,0x0000,0xfff1,
-0xffe6,0xfffb,0xffde,0xfff0,0xfff5,0xfff9,0x0004,0xffe7,
-0xfffe,0x000e,0xfffd,0x001d,0x000d,0x0019,0x0014,0x0014,
-0x0037,0x001c,0x0015,0x001b,0xfffe,0x0007,0xfff8,0xffec,
-0x0004,0x0001,0x0001,0x0012,0x0005,0x0004,0x0005,0xfff0,
-0x0002,0xfff8,0x0005,0xfffb,0x0013,0x0002,0x000e,0x0003,
-0x0006,0x0000,0xffee,0xfffc,0x0002,0xfff5,0xfff8,0x0012,
-0xfff5,0xfff6,0xffe3,0xfffd,0x000a,0xfff3,0xfff8,0xfffd,
-0x004d,0x0010,0x0009,0x0009,0xfffa,0xfff5,0xffeb,0xffdb,
-0xfff6,0xfff6,0x0004,0x0005,0x000d,0xfffd,0x0007,0x0000,
-0x000d,0xfff5,0x0011,0xfffa,0x0019,0xffff,0x000f,0xfff7,
-0x0007,0xfff7,0xffe0,0xffed,0x0000,0xffee,0x0002,0x0016,
-0xfffd,0x000f,0xfff4,0x0005,0xfffc,0x0002,0xffef,0x0005,
-0x002c,0x0014,0x0022,0x001d,0xfff6,0x000d,0xfffc,0x0000,
-0xfffc,0x0009,0xfffb,0x0013,0x000a,0x0018,0xfff5,0xffef,
-0xfff8,0xffec,0xfffb,0xffed,0x0009,0xfff2,0x000c,0xfff7,
-0xfffa,0x0000,0xffe2,0xfff7,0x0000,0xffed,0xfffe,0xfff9,
-0xfffe,0xfff6,0xfffb,0x0014,0x0015,0x0001,0x0011,0x0009,
-0x0042,0x0008,0x0017,0x000b,0xfff2,0xfffb,0xffef,0xfff0,
-0xffed,0xfffe,0xfffd,0x0005,0x0012,0x0011,0xfff6,0x0000,
-0x0001,0xffe9,0x0006,0xffec,0x000f,0xffee,0x000e,0xffea,
-0xfffb,0xfff6,0xffd4,0xffe9,0xfffe,0xffe6,0x0009,0xfffd,
-0x0004,0x000e,0x000c,0x001d,0x0007,0x0010,0x0007,0x0012,
-0x0012,0x0009,0xffef,0xfffc,0x000b,0x0003,0x0000,0x000b,
-0x0007,0x0004,0x000a,0x0003,0x000a,0xffee,0x0018,0xfffd,
-0x000e,0x0007,0x0004,0x000a,0xfff0,0x0001,0xffe5,0xfffc,
-0xffe5,0x0011,0x000c,0x001e,0x0000,0x0023,0xfff7,0xfffd,
-0xfff4,0xffdc,0xffdd,0xffe2,0xfffe,0xfff3,0x0002,0xfff5,
-0x0028,0xfffe,0xffe3,0xffea,0x0007,0xfff2,0xfff4,0xfffb,
-0xfff9,0xfff9,0x000c,0xfff7,0x0012,0xffe6,0x001a,0x000e,
-0x0018,0x0004,0x0010,0x0009,0xfff6,0xfffe,0xffe6,0xffee,
-0xffe6,0x0007,0xffff,0x000f,0xffff,0x001b,0x0002,0x0000,
-0xfffc,0xfff5,0xffef,0xffeb,0xfff0,0x0001,0xfff9,0xfffd,
-0x0008,0x0001,0xfffd,0xfffe,0x0003,0x000a,0x0003,0x0020,
-0xffff,0x000c,0x0002,0x0004,0x000f,0x0001,0x0007,0xfffd,
-0x0002,0xfffc,0xfffa,0xfffd,0xffe6,0xfff1,0xffe3,0xffef,
-0xffd8,0x0011,0x0000,0x001a,0xfffe,0x001b,0xfffe,0xffe3,
-0xfffc,0xffdc,0xfff6,0xfffa,0x0009,0x0000,0x001b,0x0000,
-0x001e,0xfff5,0xfff1,0xffec,0x0000,0xfff8,0xfff7,0x000f,
-0xfff1,0x0000,0x0005,0xfff7,0x0017,0xfffa,0x0008,0x000d,
-0x000d,0xfff9,0x0005,0xfffd,0xffec,0xffed,0xffe5,0xffe1,
-0xffd9,0x0007,0xfff3,0x000b,0xfffc,0x0013,0x0008,0xffe7,
-0x0003,0xfff5,0x0007,0x0002,0xfffc,0x0010,0x0012,0x0009,
-0x001a,0x0007,0xfff5,0x0008,0xfffb,0x0001,0xffef,0x000e,
-0xffff,0x000f,0x0018,0x001e,0x0020,0x0001,0x0021,0xfff0,
-0x0012,0xfff2,0x0000,0xfff8,0xfffa,0xfffc,0xfff4,0xfff4,
-0xfffa,0x000d,0x0002,0x0017,0x0008,0x000f,0xfffc,0x0011,
-0xfffb,0xffdc,0xffee,0xffe2,0xfff8,0xffea,0xfff6,0xfff2,
-0x0030,0xfffc,0xffe9,0xfff7,0xfff7,0xffef,0xffe2,0xfffe,
-0xfff0,0x0003,0x001a,0x0010,0x0028,0xfffa,0x0023,0x0001,
-0x001c,0xffef,0x000c,0xfff7,0x0000,0xfff8,0xfff5,0xffe7,
-0xfffb,0x0003,0xfff6,0x0008,0x0006,0x0007,0x0006,0x0016,
-0x0001,0xfff5,0xffff,0xffeb,0xffea,0xfff9,0xffed,0xfffb,
-0x000f,0x0000,0x0002,0x000a,0xfff3,0x0007,0xfff2,0x0023,
-0xfff6,0x0017,0x0010,0x001f,0x0025,0x0015,0x0010,0xffef,
-0x0006,0xffe6,0xfff6,0xffeb,0xfff0,0xffeb,0xfff3,0xffe7,
-0xffed,0x000d,0xfff8,0x0013,0x0005,0x0007,0x0001,0xfff8,
-0x0002,0xffdc,0x0005,0xfffa,0x0003,0xfff8,0x000f,0xffff,
-0x0025,0xfff4,0xfff7,0xfff9,0xffef,0xfff5,0xffe6,0x0012,
-0xffe7,0x000c,0x0013,0x0011,0x002d,0x000e,0x0011,0x0000,
-0x0011,0xffe2,0x0001,0xffea,0xfff6,0xffe7,0xfff4,0xffda,
-0xffee,0x0003,0xffea,0x0004,0x0003,0x0000,0x000d,0xfffd,
-0x000a,0xfff5,0x0017,0x0002,0xfff6,0x0007,0x0005,0x0007,
-0x0005,0x001d,0xfff7,0x000b,0x000f,0x0016,0x0003,0x0000,
-0x0012,0x0008,0xffff,0x0006,0x0007,0xffe9,0x0006,0xfffa,
-0x0005,0x000c,0x000f,0x0015,0x0005,0x0008,0xffef,0x0009,
-0xffe4,0x0000,0xfff5,0x0006,0x0002,0x000c,0xfff5,0x0000,
-0xfff2,0xfff3,0xffcf,0xffea,0xfff8,0xfff7,0x0004,0xfff7,
-0x001b,0x0010,0xffeb,0xfffa,0x000c,0x0003,0xfff7,0xfff0,
-0x0003,0xfffe,0x0001,0xfff9,0x000f,0xffe1,0x0007,0x000a,
-0x0010,0x0009,0x001b,0x0015,0x000b,0x0005,0xfff0,0xfffd,
-0xffe6,0xfff7,0xffe8,0xfff9,0x0000,0x0004,0x0000,0x0004,
-0xfffa,0x000b,0xffe0,0xfff2,0xffe9,0x0006,0xfffb,0xffff,
-0xfffc,0x0014,0x0003,0x000d,0x0008,0x001c,0x0006,0x0015,
-0x000a,0x0010,0xfff8,0x0007,0x000c,0xfffd,0xfff5,0xfff9,
-0xfffb,0x0000,0x0004,0x0008,0xfffc,0xfff8,0xffee,0xfffd,
-0xffd7,0x0000,0xffea,0x0002,0x0000,0x0004,0xfffb,0xffe7,
-0xfffa,0xfff2,0xffe7,0x0001,0x0002,0x0004,0x001d,0x0002,
-0x0011,0x0008,0xfff8,0xfffc,0x0004,0x000a,0xfffa,0x0005,
-0xfffc,0x0005,0xfffa,0xfffa,0x0014,0xfff6,0xfff7,0x0009,
-0x0004,0xfffe,0x0010,0x0007,0x0001,0xfff4,0xffef,0xfff0,
-0xffd9,0xfff7,0xffdc,0xfff4,0xfffe,0xfffd,0x0006,0xffeb,
-0x0001,0x000b,0xfff9,0x000a,0xfff5,0x0014,0x0014,0x000b,
-0x000d,0x001b,0xfffd,0x0018,0xffff,0x0013,0xfff2,0x0003,
-0x0009,0x0014,0x000c,0x0021,0x001d,0xfffd,0x000f,0xffec,
-0x0009,0xfff7,0x000b,0x0003,0x0010,0x0002,0xfffe,0x0002,
-0xfff9,0xfffd,0xffec,0x0000,0x000a,0xfff9,0xfff9,0x0016,
-0xfff9,0xfff3,0xffdf,0xffe9,0xfff2,0xffee,0xfff9,0xfff4,
-0x0023,0x000f,0xfff1,0x0006,0xfffc,0x0001,0xffe5,0xfff4,
-0xfffb,0x0008,0x000f,0x0013,0x0025,0xfff5,0x0010,0xfffe,
-0x0014,0xfff4,0x0017,0x0002,0x0016,0xffff,0xffff,0xfff5,
-0xfffb,0xfff3,0xffde,0xfff2,0x0008,0xfff2,0x0004,0x001a,
-0x0000,0x000b,0xfff0,0xfff2,0xffe3,0xfffe,0xffef,0xfffd,
-0x0003,0x0013,0x0009,0x001a,0xfff8,0x001a,0xfff6,0x0018,
-0x0000,0x001c,0x0005,0x0021,0x0022,0x0011,0xfffe,0xffec,
-0xffff,0xffea,0x0000,0xfff6,0x0006,0xfff2,0xfffd,0xfff6,
-0xffec,0xfffc,0xffe0,0xfffc,0x0007,0xfff1,0x0000,0xfffd,
-0x0000,0xfff3,0xfff7,0x0000,0xfffd,0xfffc,0x0011,0x0000,
-0x0019,0x0007,0xfffe,0x0008,0xfff4,0x0007,0xffe9,0x0008,
-0xfff3,0x0010,0x0007,0x0014,0x002a,0x0009,0x0000,0xfffd,
-0x0009,0xffe7,0x000c,0xfff6,0x000c,0xffee,0xfffe,0xffe8,
-0xffed,0xfff3,0xffd2,0xffed,0x0005,0xffea,0x000a,0x0000,
-0x0008,0x000b,0x0008,0x0009,0xffef,0x000b,0x0007,0x0008,
-0xffe7,0xfff9,0x0002,0xfff8,0x000c,0xfff9,0x0017,0xfff8,
-0x000d,0xfff0,0xfff9,0xffec,0xffd6,0xfff7,0x0000,0x0003,
-0xfff7,0x0019,0xfff4,0x000a,0xfff4,0x0012,0x0002,0x0018,
-0x0013,0x000d,0x002e,0x0013,0xfffb,0x0016,0xfff6,0x0000,
-0xfff8,0xfff5,0xfff8,0xfff7,0x0011,0xfff5,0xfff9,0xfff8,
-0xfffd,0xffed,0xfff7,0xffe6,0x0008,0xffe6,0x000a,0xffe8,
-0x0000,0xffe4,0xfffb,0xffdf,0xffde,0xffef,0x0002,0x0014,
-0x0001,0x0016,0x0000,0x000a,0xfffa,0x000e,0x0003,0x000a,
-0x0014,0x0004,0x0020,0x0004,0xfff9,0x000f,0x0000,0x0003,
-0x0000,0x000d,0x0009,0x0000,0x0003,0x0004,0xffef,0x0000,
-0xffdd,0xfff1,0x000f,0xfffa,0x0004,0xffff,0x001b,0x000c,
-0x0005,0xfff8,0xfff1,0xffed,0xffdb,0x000b,0xfff0,0x0002,
-0xffec,0x000c,0xffe9,0xfffe,0xffea,0x0001,0x0001,0x000b,
-0x0005,0x000d,0x0022,0x000e,0xfff8,0x000e,0xfffc,0xffe6,
-0x0000,0xfff5,0x0010,0x000e,0x001d,0x0002,0x0011,0x0003,
-0xfff3,0xffe5,0x0003,0xffe8,0x0001,0xffed,0x000e,0xfffd,
-0xfff7,0xffec,0xfff4,0xffdf,0xffe3,0x0003,0xfff1,0x0014,
-0xfff7,0x0009,0xfff5,0xfffd,0xfff0,0xfffe,0x0002,0xfffe,
-0x0007,0x0003,0x0014,0x0000,0xfff6,0x0007,0x0007,0xffea,
-0x0007,0x000d,0x0021,0x0017,0x000e,0x0012,0x0007,0x000c,
-0xffef,0xfff8,0x0008,0x0004,0xfffc,0xfff6,0x0006,0xfffb,
-0x0004,0xfffb,0x0006,0x0006,0xffec,0x000a,0x0009,0xfff7,
-0xfffc,0x0002,0xfff0,0xfff9,0xffff,0x000c,0x0011,0x0010,
-0x0027,0x0009,0x0024,0x000c,0x0002,0x0003,0xfffa,0x0015,
-0xffff,0xfff5,0x0007,0xfff6,0x000b,0xffec,0xffec,0xfff5,
-0x0004,0xffec,0xfffd,0xfff3,0xfff8,0xffe4,0xfffa,0xffeb,
-0xfff6,0xfff0,0x0008,0xfff9,0xfff4,0x0003,0x000b,0x0007,
-0x0005,0x0000,0xfffc,0xfff8,0x0004,0x0008,0x0012,0x0003,
-0x0029,0x0000,0x0016,0xfffe,0x0000,0xfffc,0x0005,0x0019,
-0x0006,0x000e,0x0019,0xffff,0xfffe,0xfffc,0xffe3,0xfffe,
-0xffe5,0xfff0,0x0015,0x0006,0xfff4,0xfffd,0x0009,0x0010,
-0xfffd,0x0002,0xffff,0x0007,0xfff1,0x001f,0xfff9,0xfff6,
-0xfff0,0xfff7,0xffe5,0xffeb,0xfff5,0xfffb,0x0010,0x0003,
-0x001a,0x0009,0x0018,0x0007,0x0000,0xfffc,0x0000,0xfffc,
-0x0006,0xfff5,0x0020,0x000e,0x0017,0xfffa,0x0005,0x0001,
-0xfffb,0xffe3,0x0009,0xfff5,0xfff1,0xffea,0xfffd,0x0000,
-0xffee,0xfff8,0x0001,0xfffa,0xfff9,0x0017,0xfffa,0x0006,
-0xfffb,0xfff4,0xfff1,0xffeb,0xfffb,0xfff8,0x0011,0xfff7,
-0x001c,0x0000,0x000b,0xfffa,0xfffe,0xfff4,0x000b,0x0000,
-0x000e,0x000d,0x0031,0x0016,0x0008,0x0009,0xfffc,0x0009,
-0xffdb,0x000c,0x0009,0x0007,0x0011,0x000b,0x001a,0xffee,
-0x0019,0xfff4,0xffed,0xffef,0xffd3,0xfff2,0xffef,0x0000,
-0xffef,0x001e,0xffff,0x0016,0x000a,0x0019,0x000c,0x0026,
-0x0012,0xfffd,0x0016,0xfffc,0xfffd,0x0000,0xfff3,0x0003,
-0xfff6,0x000b,0xffe9,0xfffe,0x000a,0xfff9,0xfffb,0xfff9,
-0xfff1,0x0000,0xfffe,0xfff6,0x000d,0xfff9,0x000e,0xffdd,
-0x000a,0xffe9,0xfff0,0xffe1,0xffdb,0xffeb,0xfff0,0x0011,
-0xfffa,0x001a,0x000a,0x0015,0x0010,0x0015,0x000d,0x0019,
-0x0013,0xfff3,0x0008,0xffed,0xfffb,0xfff9,0xffff,0x0008,
-0xfffe,0x0024,0xfffb,0x0006,0xfffd,0x0008,0xfff1,0x0001,
-0xffd0,0x0004,0x0017,0x0009,0x0009,0x0011,0x001e,0x0002,
-0x0010,0xfffd,0xffe6,0xfff0,0xffd8,0x0006,0xffdd,0xffff,
-0xffe4,0x0011,0xfff4,0x0009,0x0000,0x0008,0x000b,0x0019,
-0x0005,0xfffd,0x000a,0xfff8,0xfffa,0xfff9,0xfffa,0xffea,
-0xffff,0x000b,0x0001,0x0015,0x0016,0x0007,0x0013,0x0005,
-0xffe6,0xfff9,0x000b,0xfff8,0x0005,0xffff,0x0011,0xfff2,
-0x0001,0xfff1,0xffe8,0xffe2,0xffe0,0xffff,0xffdf,0x0010,
-0xffee,0x000e,0x0000,0x0008,0x0006,0x0004,0x000c,0x000c,
-0x0006,0xfff3,0xfffe,0xffe9,0xfff8,0xfff1,0x0004,0xffef,
-0x0005,0x0024,0x0012,0x001e,0x0008,0x0016,0x000a,0x000e,
-0xffe2,0x000b,0x000f,0x0014,0x0000,0x0008,0x0009,0xfff1,
-0x000f,0x0000,0xfffb,0x0009,0xffe9,0x0006,0xfff8,0xfff3,
-0xfff3,0x0007,0xfffb,0x0003,0x0014,0x0013,0x001b,0x001f,
-0x0027,0xfff9,0x000d,0xfff5,0x0004,0xffed,0xfff8,0x0019,
-0xfffd,0x000b,0xfff9,0xfffe,0x0004,0xfff0,0xffee,0xfff7,
-0xfff8,0xffff,0x0003,0x0002,0xfffd,0xfff6,0xfffd,0xffe0,
-0x0001,0xfff4,0xfffe,0xfffc,0xfff1,0xffff,0xfff9,0x0003,
-0xfffe,0x0004,0x0006,0x0003,0x001a,0x000f,0x001d,0x0011,
-0x0028,0xffef,0x0000,0xffe6,0x0002,0xffe5,0x0002,0x001d,
-0x0004,0x0024,0x000a,0x0006,0xfff7,0x0000,0xffe5,0x0000,
-0xffd8,0x0002,0x001d,0x0016,0xfff9,0x000e,0x000c,0x0005,
-0x0007,0x0007,0xfff4,0x0009,0xffee,0x001a,0xffe6,0xfff2,
-0xffe8,0xfffc,0xfff0,0xfff7,0x000a,0x0002,0x001a,0x0012,
-0x001a,0xfff9,0x0001,0xfff1,0x0001,0xffe5,0xfffe,0x0000,
-0x0004,0x000b,0x0011,0x0015,0x0010,0xffff,0x0007,0x0003,
-0xffee,0xfff7,0x0011,0x0004,0xfff5,0xfffd,0x0000,0xfff5,
-0xfff9,0xfffc,0xfff6,0xfffd,0xfff6,0x0012,0xffe8,0x0003,
-0xfff2,0xfff9,0xfffc,0xfff6,0x0010,0xffff,0x001b,0x0004,
-0x001b,0xffef,0xfff4,0xffe2,0x0000,0xffdd,0x0009,0x0003,
-0x000c,0x0024,0x0023,0x001e,0x0002,0x000d,0xfffe,0x000b,
-0xffbe,0xfff8,0xffe9,0xfff5,0x000e,0x0005,0x0011,0x0010,
-0x0013,0x0002,0x0003,0xfffb,0xffee,0xffef,0x000a,0x0000,
-0xffff,0x0017,0xfffa,0x0014,0xfff1,0x0012,0xfff2,0x0016,
-0x0005,0x000a,0x002c,0x0017,0x0002,0x001a,0xfff7,0x0003,
-0xfffc,0xfff2,0xfff4,0xffe3,0xfff9,0xfff0,0xfff9,0xffee,
-0xffd4,0xffec,0xffde,0xffe3,0x000a,0xfff3,0x0004,0x0000,
-0x0004,0xfff7,0x0005,0xffed,0xfff6,0xffe8,0x000b,0x0011,
-0x0008,0x0014,0x0005,0x0013,0xfff7,0x000e,0xfff4,0x0009,
-0x0006,0x0000,0x001e,0x0009,0x0000,0x0013,0x0002,0x0007,
-0x0002,0x000a,0x0005,0xffec,0xffeb,0xffff,0xffef,0xfff7,
-0xffb3,0xfff0,0xfff7,0xfff7,0x0006,0x000b,0x0015,0x0025,
-0x000a,0x000a,0xfffc,0xfffb,0xfff3,0x0003,0xfff9,0x0000,
-0xfff3,0x000b,0xffef,0x0006,0xffe7,0x0001,0xfff1,0x0009,
-0xfff9,0x0009,0x0020,0x0013,0x0000,0x0012,0xfffe,0xffea,
-0x0003,0xfff1,0x000c,0xfffb,0x0004,0xfffe,0x0011,0xfffb,
-0xffc9,0xffe4,0xffeb,0xffe5,0x0002,0xfff9,0x0008,0x0014,
-0xfffc,0xffff,0xffff,0xffee,0xfffb,0xfffc,0xfffb,0x0010,
-0xfffe,0x0008,0xfffb,0x0005,0xffed,0xfffe,0xfff2,0xfffd,
-0xfffa,0x0000,0x0012,0x0004,0xfffe,0x000b,0x0008,0xffee,
-0x000b,0x000a,0x001d,0x0003,0xfff6,0x000d,0x0008,0x0003,
-0xffc6,0xfff7,0xfff0,0x0001,0xfffe,0x0002,0x0000,0x0013,
-0x000a,0x000d,0x0011,0x0015,0x0003,0x0003,0x0013,0xfff4,
-0x0002,0x0000,0xfff6,0x0001,0xfffb,0x000c,0x0000,0x000f,
-0x001a,0x0005,0x0022,0x0010,0x000b,0x0007,0xfffc,0x0019,
-0x0002,0xfff2,0x0003,0xffe3,0xfff3,0xffe7,0xffec,0xffec,
-0xffdc,0xffeb,0xffe4,0xfff0,0xfffa,0xfff0,0xfff4,0x0002,
-0xfffc,0x0002,0x0014,0x0007,0x000b,0xfffc,0x0014,0x0004,
-0x000c,0xfffe,0x0001,0x0000,0x0000,0x0008,0x0002,0x0002,
-0x001b,0xfffc,0x0015,0x0002,0x0009,0x0000,0x0006,0x001d,
-0x0009,0x000a,0x0015,0xffeb,0xffe4,0xfff6,0xffe3,0xfff5,
-0xffbb,0xffef,0xfffd,0x0003,0xfff6,0x0008,0x0003,0x0028,
-0x0001,0x0015,0x000a,0x0015,0x0008,0x0017,0x0001,0xfff3,
-0xfff8,0xfff5,0xffeb,0xfff5,0xfff1,0xfffc,0x0000,0x0002,
-0x000d,0x0005,0x0017,0x000c,0x0007,0x0000,0x0001,0x0000,
-0x000a,0xfff2,0x001c,0xfffb,0xffff,0xfff5,0x0005,0xfff9,
-0xffd1,0xffe2,0xfff1,0xfff2,0xfff2,0xfff7,0xfff7,0x0017,
-0xfff3,0x000a,0x000c,0x0007,0x0010,0x000f,0x0003,0x0003,
-0x0001,0xfff2,0xfff7,0xfff4,0xfff7,0xfff8,0x0000,0xfff6,
-0x000e,0xfffc,0x0009,0xfffe,0x0005,0xfff8,0x000d,0x0003,
-0x0012,0x000a,0x002d,0x0003,0xfff0,0x0004,0xfffc,0x0000,
-0xffb1,0x000b,0xfff1,0x0004,0x0012,0x0017,0x0014,0x0005,
-0x001e,0x0007,0xfff9,0xfffe,0xffeb,0xffeb,0xfff8,0xfffd,
-0xfff6,0x001c,0x0004,0x001f,0x0006,0x0019,0xfffd,0x0025,
-0x0004,0xfff9,0x0014,0x0000,0x0004,0x0004,0xfff5,0x0007,
-0xfffa,0x0008,0xffe5,0xffea,0xfff2,0xfff4,0xfffb,0xfff0,
-0xffc7,0x0000,0xffe5,0xfff3,0x000e,0x0005,0x0007,0xfff5,
-0x000f,0xfffc,0xfffb,0xfff0,0xfff3,0xffe3,0xfffa,0x000d,
-0x0000,0x0019,0x0010,0x001f,0x000c,0x0016,0xfffe,0x0017,
-0x0006,0xfff0,0x0007,0xfff2,0x0002,0xfffd,0x0000,0x000c,
-0x0000,0x0021,0xfff7,0xfff3,0xffe4,0x0003,0xfff2,0xfff9,
-0xffa6,0x0003,0xfffe,0x0006,0x000a,0x001d,0x0018,0x001a,
-0x0015,0x000f,0xfff1,0xfffe,0xfff0,0xffff,0xffe7,0xfffc,
-0xffeb,0x0010,0xfffa,0x0012,0xfffd,0x0008,0xfffb,0x0018,
-0xfff8,0xfff9,0x0009,0xfffc,0x0001,0xfffd,0xfffb,0xffee,
-0x0001,0x0007,0xfffe,0x0001,0xfffe,0x0001,0x0013,0xfffd,
-0xffbd,0xfff8,0xfff2,0xfff5,0x0007,0x000b,0x000b,0x0009,
-0x0007,0x0003,0xfff3,0xfff0,0xfff8,0xfff7,0xffe8,0x000c,
-0xfff6,0x000d,0x0005,0x0011,0x0002,0x0004,0xfffd,0x000a,
-0xfffa,0xffef,0xfffc,0xffed,0x0000,0xfff5,0x0006,0xfff3,
-0x0009,0x0021,0x000e,0x000a,0xfff0,0x0011,0x000a,0x0004,
-0xffb9,0x000a,0xfff7,0x0011,0x0001,0x0014,0x0003,0x0008,
-0x0015,0x0012,0x0006,0x0018,0x0000,0xffff,0x0000,0xfff0,
-0xfffa,0x0005,0x0000,0x000d,0x0011,0x0013,0x000b,0x001d,
-0x0019,0xfff5,0x000b,0xfffa,0x000d,0xfff1,0xfff9,0x001d,
-0x0000,0x0008,0xfff5,0xffea,0xffec,0xffeb,0xffef,0xffee,
-0xffcf,0xfffe,0xffeb,0x0000,0xffff,0x0002,0xfff7,0xfff8,
-0x0006,0x0006,0x0008,0x000a,0x0008,0xfff7,0x0002,0x0000,
-0x0004,0x0002,0x000d,0x000c,0x0017,0x000f,0x000c,0x0010,
-0x001a,0xffeb,0xfffe,0xffeb,0x000b,0xffe9,0x0004,0x0021,
-0x0007,0x0021,0x0006,0xfff3,0xffde,0xfffb,0xffe5,0xfff6,
-0xffae,0x0001,0x0004,0x0013,0xfffa,0x001b,0x0006,0x001d,
-0x000c,0x001a,0xffff,0x0018,0x0005,0x0012,0xffef,0xffef,
-0xffef,0xfffa,0xfff6,0x0000,0x0007,0x0002,0x0009,0x0010,
-0x000c,0xfff5,0x0000,0xfff5,0x0009,0xffe9,0x0000,0x0003,
-0x0008,0x0008,0x000d,0x0001,0xfff8,0xfff9,0x0007,0xfffa,
-0xffc4,0xfff6,0xfff9,0x0001,0xfff7,0x0008,0xfffa,0x000d,
-0xfffe,0x000f,0x0001,0x000a,0x000d,0x000b,0xfff1,0x0000,
-0xfffa,0xfff7,0x0001,0x0000,0x000d,0xffff,0x000b,0x0003,
-0x000d,0xffeb,0xfff3,0xffe6,0x0007,0xffe1,0x000a,0x0007,
-0x0010,0x0021,0x001f,0x000a,0xffea,0x0008,0xffff,0x0002,
-0xfffd,0x0007,0xfffb,0xfffb,0x0008,0xfffe,0x0011,0xfff7,
-0x0012,0xffe8,0xfffe,0xffed,0xfff6,0xfffc,0x001c,0x0011,
-0x0005,0x001c,0xfffe,0x0007,0xfffc,0x000f,0x0007,0x0008,
-0x0006,0x0017,0x000d,0x0015,0xfff2,0x0014,0xffef,0xffee,
-0xfff5,0xffdf,0xffe2,0xfff5,0x0017,0xfff3,0xfffb,0xfff7,
-0x0012,0xfffc,0xffef,0xffe9,0x0004,0xffec,0x0004,0xffe6,
-0x0003,0xffdc,0x0000,0xffe0,0xfffe,0xfff4,0x001d,0x0022,
-0x0010,0x0018,0x000a,0x0006,0x0000,0x000c,0x0008,0xfffc,
-0x0008,0x000d,0x0000,0x0006,0xfff0,0x000c,0xfffb,0xfff3,
-0xfffd,0xfff9,0xfff3,0xfffd,0x0008,0x0002,0xfff2,0x0000,
-0xfff3,0x0000,0x0008,0xfffd,0x0000,0x0004,0x0015,0x000b,
-0x0009,0xfff0,0xfff6,0xffee,0xfffb,0x0010,0x000a,0x0010,
-0xfffb,0x000f,0xfff3,0xfffb,0xfff1,0xffff,0x0006,0xfffc,
-0xfffa,0x0017,0x0002,0x0010,0xffef,0x000c,0xfff6,0xffd4,
-0xfffd,0xffdf,0xfffa,0x000c,0x0022,0x0001,0x0014,0x0003,
-0x0008,0xfff4,0xfffd,0xffeb,0xfffd,0xfff2,0x0008,0xfffb,
-0xfffc,0xffe4,0xfff9,0xffe0,0x0002,0x0008,0x000c,0x0022,
-0x0004,0x000c,0xffff,0xfffa,0xfff7,0xfffc,0x0007,0xffef,
-0xfffc,0x000d,0xfff5,0x0001,0xffed,0x0004,0x0000,0xffd9,
-0x0004,0xfff9,0x000b,0x0015,0x0014,0x0010,0x000a,0x000b,
-0x0004,0x0006,0x0000,0x0007,0xfff8,0xfffc,0x0000,0xfffa,
-0x0009,0xfff3,0x000b,0x0007,0x000b,0x000f,0x0025,0x0004,
-0x0009,0x0005,0xfffb,0xfff5,0x0005,0x0009,0x0016,0x0001,
-0x001b,0x0012,0x0004,0x000e,0xfffb,0x0000,0xfff4,0x0003,
-0xfffc,0xffe0,0xfff2,0xfff4,0x0011,0xffea,0xffef,0xfff5,
-0x001a,0xfffa,0xfff5,0xfff6,0xfff4,0xffe9,0xfff4,0xffe9,
-0xfffb,0xffe8,0x000d,0xfffb,0x0013,0x0008,0x0026,0x0015,
-0x0014,0x0002,0x0006,0xfff4,0x000b,0x0005,0x0017,0xfff5,
-0x001d,0x0009,0xfff7,0x0000,0xfff9,0xfffa,0xffff,0x0007,
-0x0002,0xfff9,0x0003,0xfffd,0x0002,0xfffa,0xffe5,0xfffd,
-0xfffa,0xfffe,0x000e,0x0009,0xfff0,0x0001,0x0003,0x000e,
-0x0000,0xfffb,0x0003,0x0008,0x0010,0x0024,0x0013,0x0003,
-0xffff,0xfffa,0xffef,0xffe8,0xfffc,0xfff9,0x0015,0xfff5,
-0x000e,0x0012,0xfff9,0x0009,0xfff7,0xfff9,0xfffa,0xffea,
-0x0003,0xffdf,0x000a,0x000b,0x001c,0xfff9,0x0007,0x0000,
-0x0010,0xfff2,0x0002,0xfff8,0xffec,0xffef,0xfff7,0xfffe,
-0xfff2,0xfff0,0x0006,0xfffb,0x0018,0x001c,0x0015,0x0014,
-0x0008,0xfff7,0xfffc,0xffe7,0x0001,0xfff5,0x0016,0xffe8,
-0x000f,0x0008,0xffeb,0xfffb,0xfff5,0xfff2,0x0005,0xffee,
-0x000b,0xfff9,0x001b,0x0014,0x000e,0x0007,0xffff,0x0009,
-0xfff0,0x001b,0x0002,0x000a,0x000d,0x0010,0x0014,0xffec,
-0x001d,0xffec,0xfff2,0xfff0,0xfff3,0xfff8,0x0009,0x000d,
-0xfffe,0x0021,0x0009,0x0013,0x0011,0x0017,0x0011,0x0016,
-0x0006,0x0006,0xfff7,0xfffe,0xfff4,0xfffe,0xffec,0xfff3,
-0xfff3,0xfff6,0xffd3,0xfffc,0x0010,0xfff8,0xfffe,0xfff9,
-0x0005,0x000f,0xfff7,0xfff9,0x0009,0xfffe,0x0008,0xffdb,
-0x000e,0xffe1,0xfff5,0xffe3,0xfffb,0xfff0,0x000b,0x001e,
-0x0007,0x001d,0x0015,0x0012,0x0017,0x0013,0x0012,0x0009,
-0x0007,0xfffd,0xffe9,0xffef,0xfff2,0xfff7,0xfff8,0xfff7,
-0xfffa,0x000f,0xffe5,0x0004,0x0002,0x0006,0xfff4,0x0001,
-0xffe6,0x0013,0x000f,0x000c,0x0005,0x0016,0x0018,0x0000,
-0x0015,0xfff4,0xffeb,0xfff1,0xfff8,0x000b,0xfff9,0x000c,
-0xfff2,0x0014,0xfffe,0x0006,0x0007,0x0006,0x0010,0x0009,
-0xfffa,0x0005,0xffeb,0xfff9,0xfff1,0xfff6,0xfff3,0xffd9,
-0xfffb,0xfff6,0xffec,0x0013,0x001c,0x0005,0x0016,0x0005,
-0xfffc,0x0006,0x0003,0xfffb,0x0001,0x0004,0x000b,0xfff0,
-0x0006,0xffe9,0xffed,0xffe3,0x0000,0x0003,0xfffa,0x001e,
-0xfffd,0x0011,0x000a,0x0005,0x000d,0x0002,0x0011,0xfffd,
-0xfffb,0xfffd,0xffdd,0xffeb,0xffef,0xffef,0xfffe,0xffdd,
-0x0002,0x000f,0xfffd,0x001c,0x000d,0x0015,0x000d,0x000d,
-0xfff8,0x0019,0x0008,0x0017,0xfffd,0x000d,0x0003,0xffef,
-0x0014,0xfff8,0x0000,0x000a,0x0008,0x000b,0x0012,0x0000,
-0x0001,0x000a,0x0005,0x0000,0x001c,0x0011,0x0020,0x000f,
-0x001a,0x0001,0xffed,0xfff7,0xfffd,0xffeb,0xfff1,0x0007,
-0xfffa,0xfff7,0xffe3,0xfffb,0x000a,0xffef,0xfff1,0xfff7,
-0x000d,0x000d,0xfffd,0x0005,0xfff9,0xfffc,0xfff7,0xffde,
-0x0005,0xffec,0x0002,0xfffd,0x0010,0x0003,0x0014,0x0011,
-0x000b,0x0007,0x0011,0x0000,0x0022,0x000d,0x0021,0x0002,
-0x001c,0xfff8,0xffe0,0xffe8,0xfffb,0xffe3,0xfffd,0x000c,
-0x0000,0x000f,0xfff5,0x0003,0xfffd,0xfffe,0xffe8,0xffff,
-0xffee,0x0011,0x0015,0x0019,0xfff5,0x0013,0x0006,0x0003,
-0x000b,0x0000,0xfff9,0x000b,0x000d,0x001f,0x0001,0x0000,
-0xfff7,0xffff,0xfffb,0xfff4,0x0012,0x0000,0x001f,0x0002,
-0x000d,0x0001,0xffe2,0xfff2,0xfff9,0xffe3,0xfff7,0xffee,
-0x0001,0xfff6,0xfffc,0x0012,0x0016,0xfffd,0x000a,0x0002,
-0x0003,0x0005,0x0009,0x0007,0xfff1,0x0001,0xfffb,0xfff3,
-0xfffe,0xfff4,0xfffb,0xfffe,0x0015,0x0017,0x0002,0x0010,
-0x0000,0xfffb,0x0006,0xfff3,0x0017,0xfffd,0x0020,0xfff6,
-0x000f,0xfff8,0xffd4,0xffe4,0xfff7,0xffdb,0x0002,0xfff3,
-0x0009,0x000f,0x000c,0x001b,0x0007,0x000c,0x0000,0x000b,
-0xffd4,0x0006,0xffe2,0xfff8,0x0009,0x000a,0x000b,0x000e,
-0x0017,0xfffb,0x0008,0xfffc,0x000e,0xfff4,0x0025,0x000e,
-0x000c,0x001a,0x0004,0x0010,0xfff8,0x0010,0xfff7,0x0007,
-0xfffa,0x0013,0x000c,0x0019,0xfffb,0x0018,0xfff1,0xfff3,
-0xfff8,0xffdc,0xffde,0xffe1,0xffff,0xffee,0xfffc,0xffee,
-0xffea,0xfffb,0xffd6,0xffe6,0x0006,0xfff8,0xffff,0xfffe,
-0x0009,0xffef,0x000a,0xffee,0x0015,0xffed,0x0027,0x001f,
-0x0017,0x0017,0x0010,0x000f,0xfffe,0x000c,0xfff9,0xfffa,
-0xfffb,0x0009,0xffff,0x000a,0xfff9,0x0010,0xfffc,0xfff7,
-0x0000,0xfff6,0xffef,0xffea,0xfff0,0xfffe,0xfff2,0xfff7,
-0xffc9,0xffff,0xffef,0xfffa,0x0001,0x0010,0x000f,0x0023,
-0x000f,0x0002,0x0000,0xfffc,0x0013,0x0008,0x0014,0x000d,
-0x0001,0x000e,0xfff9,0x0003,0xffee,0x0000,0xfff6,0xfffb,
-0xffed,0x0013,0x0000,0x0015,0xfff8,0x0010,0xfff7,0xffd9,
-0x0000,0xffdc,0xfff6,0xfff9,0x0009,0xfffc,0x0014,0xfffb,
-0xffdf,0xfff3,0xffe3,0xffe8,0xffff,0xffff,0x0002,0x0012,
-0x0000,0xfff7,0x0003,0xffef,0x001b,0x0000,0x0015,0x001e,
-0x000c,0x000b,0x0005,0x0002,0xfff4,0xfffc,0xfff7,0xffed,
-0xffee,0x0009,0xfff3,0x0006,0xfff5,0x0008,0x0002,0xffdd,
-0x0008,0xfff6,0x0007,0x0001,0xfffc,0x000b,0x000a,0x0002,
-0xffdc,0x0005,0xffe8,0x0004,0xfff9,0x0007,0xfffa,0x0011,
-0x000e,0x0005,0x0016,0x0016,0x0023,0x0008,0x002e,0x0001,
-0x0011,0x0003,0x0000,0xfffe,0x0002,0x000a,0x0005,0x0000,
-0x000e,0x000f,0x0002,0x0012,0x0002,0x0004,0xfff5,0x0007,
-0xffff,0xffdc,0xffee,0xffe0,0xfff9,0xffe5,0xffef,0xffec,
-0xfff2,0xfff9,0xffdc,0xfff3,0xfff6,0xfff6,0xffee,0x0000,
-0x0000,0xfffb,0x0019,0x0008,0x002b,0x0000,0x0030,0x0012,
-0x001b,0x0000,0x000c,0xfffd,0x0007,0x0006,0x0007,0xfff3,
-0x000f,0x0005,0xfff5,0x0003,0x0000,0xfffe,0x0000,0x000c,
-0x0006,0xfff6,0x0000,0xffe9,0xffea,0xfff5,0xffe6,0xfff4,
-0xffd1,0xfffd,0xfff5,0x0006,0xfff1,0x000d,0xfffe,0x0026,
-0x0006,0x000d,0x000f,0x0016,0x0028,0x001c,0x001c,0x0000,
-0x0005,0xfff8,0xfff6,0xfff1,0xfff9,0xfff9,0x0004,0xfff3,
-0x0001,0x000e,0xfff7,0x000e,0x0000,0xfffe,0xfffc,0xffee,
-0x0007,0xffdc,0x0006,0xfff8,0x0003,0xfff3,0x0007,0xfff8,
-0xffe7,0xfff1,0xffea,0xfff5,0xffee,0xfffc,0xfff1,0x0016,
-0xfff8,0x0002,0x0011,0x0009,0x0030,0x0014,0x001e,0x0011,
-0x0010,0xfff5,0x0001,0xfff0,0xfffe,0xfff6,0x0005,0xffe6,
-0x0002,0x0004,0xffea,0x0000,0xfffe,0xfff6,0x0006,0xfff3,
-0x000e,0xfff6,0x0017,0x0000,0xfff6,0x0002,0xffff,0x0000,
-0xffc7,0x001a,0xffea,0x0007,0x000e,0x001c,0x000e,0x0003,
-0x0023,0x0000,0xfffd,0xffff,0x000b,0xfff0,0x0012,0x000a,
-0x0004,0x001f,0x000f,0x001c,0x000e,0x0017,0x0001,0x0015,
-0xfff9,0x0002,0xfff5,0x0001,0xfffd,0x0001,0xffee,0xfff7,
-0xfff6,0xfff3,0xffcf,0xffe8,0xfff8,0xfff2,0xfffe,0xfff0,
-0xffdd,0x000e,0xffde,0xfff6,0x000a,0x000a,0x0001,0xfff4,
-0x0014,0xfff4,0x0000,0xfff1,0x0012,0xffe8,0x0014,0x001b,
-0x000e,0x001c,0x001b,0x001b,0x0014,0x0013,0x0002,0x0008,
-0xfffb,0xfff9,0xffe7,0xfff3,0xfffb,0xfffb,0xfffa,0xfffb,
-0xfffe,0x000c,0xffe1,0xfff1,0xffe9,0x0001,0xfff4,0xfff8,
-0xffbc,0x0012,0xfff7,0x0009,0x0006,0x0023,0x0012,0x0019,
-0x001a,0x0007,0xfff6,0xffff,0x0010,0x0003,0x0001,0x0009,
-0xfffa,0x0013,0x0004,0x000f,0x0004,0x0006,0x0000,0x0008,
-0xffec,0x0002,0xffe9,0xfffe,0xfff9,0xfffb,0xfff4,0xffdd,
-0xffff,0xfff3,0xffe8,0x0000,0x0003,0x0000,0x0016,0xfffc,
-0xffd2,0x0006,0xffeb,0xfff8,0x0002,0x0010,0x0005,0x0008,
-0x000b,0xfffc,0xfff8,0xfff1,0x0018,0xfffc,0x0002,0x001a,
-0x0003,0x0010,0x0010,0x000e,0x0009,0x0002,0x0001,0xfffc,
-0xffed,0xfff9,0xffdc,0xffef,0xfff7,0xfff3,0x0000,0xffe1,
-0x0005,0x000c,0xfff9,0x0008,0xfff5,0x000f,0x000d,0x0004,
-0xffcf,0x0018,0xfff0,0x0014,0xfffe,0x001a,0xfffe,0x0007,
-0x0019,0x000a,0x000b,0x0019,0x0020,0x0003,0x001b,0xfffe,
-0x0008,0x0008,0x000b,0x0009,0x0018,0x0011,0x0010,0x000e,
-0x000d,0xfffe,0xffec,0xfffb,0x0004,0xffef,0xfff2,0x000c,
-0xfffd,0xfff3,0xffdf,0xffe7,0xfff2,0xffe9,0xfff1,0xffed,
-0xffe5,0x000c,0xffe4,0x0002,0xfffa,0x0007,0xfff1,0xfff7,
-0x000b,0xffff,0x000d,0x000b,0x0028,0xfffc,0x001d,0x000e,
-0x0013,0x0005,0x0017,0x0008,0x001e,0x000d,0x0011,0x0000,
-0x000e,0xfff4,0xffde,0xffec,0x0002,0xffe7,0xfffe,0x0010,
-0x0004,0x000c,0xfff1,0xfff0,0xffe3,0xfff9,0xffe8,0xfff6,
-0xffc4,0x0010,0xfffd,0x0016,0xfff6,0x0020,0x0000,0x001c,
-0x0011,0x0012,0x0003,0x0019,0x0025,0x0017,0x000a,0xfffd,
-0xfffe,0xfffd,0x0000,0xfffd,0x000e,0x0000,0x000e,0x0001,
-0x0000,0xfffe,0xffe0,0xfff7,0x0001,0xffe7,0xfff9,0xfff3,
-0x0005,0xfff3,0xfff8,0xffff,0xfffe,0xfff8,0x000a,0xfffa,
-0xffda,0x0004,0xfff1,0x0004,0xfff2,0x000d,0xfff4,0x000b,
-0x0002,0x0006,0x0006,0x000b,0x002d,0x0010,0x000b,0x000d,
-0x0007,0xfffa,0x000c,0xfffc,0x0014,0xfffd,0x0010,0xfff4,
-0x0001,0xfff4,0xffd2,0xffe8,0x0000,0xffdf,0x0003,0xfff7,
-0x000c,0x000c,0x0008,0x0007,0xffef,0x0006,0x0000,0x0002};
-
-static const signed short etable2[5120]={
-0x0049,0xffe0,0xffc4,0xfff1,0xffe6,0x003b,0x0002,0xffdf,
-0x001e,0xfff6,0xfffd,0xffef,0x0008,0x001e,0xffff,0xffe6,
-0xfffc,0xffea,0x000a,0x0010,0xffdc,0xfffb,0xfff5,0x0038,
-0x0025,0x0006,0xfff6,0xfffb,0xfff3,0xfffd,0x0006,0xfffb,
-0x000b,0x0004,0xffed,0xfffb,0xfff0,0x0029,0x0018,0x000d,
-0x0004,0xfff5,0xffdb,0x0017,0xfffb,0x002e,0xfffe,0xffe3,
-0xfffb,0xffd9,0xffeb,0xfff7,0x0000,0x0031,0x000c,0xfff7,
-0xfff0,0xffe6,0x0016,0x000f,0xffd3,0xffec,0xfffb,0x0028,
-0x0016,0x0011,0xffe6,0x001f,0xfff2,0x0002,0xfff2,0x000a,
-0x001e,0x0014,0xffe5,0xfff7,0xffd9,0x0027,0x0012,0x0005,
-0x0022,0xffe7,0xffd0,0xffe4,0xfff5,0x0022,0xfffe,0xffd7,
-0x0009,0xfff9,0xffef,0x0015,0x0014,0x0018,0xffef,0xffdf,
-0x0000,0xffe8,0x000a,0x002a,0x0003,0xfffb,0x000a,0x002a,
-0x000b,0x0008,0xfffd,0x0003,0x0010,0x0009,0x0016,0xfffe,
-0x0000,0xffdf,0xfff6,0x0012,0x0007,0x003a,0x000a,0x001c,
-0xffde,0xfffc,0xffe7,0x000a,0x0009,0x0015,0xfff9,0xffdc,
-0xffe6,0xffdc,0xffdd,0x001c,0x000c,0x002a,0xfffd,0xfff0,
-0xfff4,0xffe4,0x0015,0x002a,0xfffb,0xffeb,0x0010,0x001a,
-0xfffc,0x0013,0xffed,0x0027,0x000f,0x000f,0x0001,0x000d,
-0x0013,0xffef,0xffef,0x000e,0xfff1,0x0037,0x0004,0x0013,
-0x001c,0xffec,0xffcd,0xfff2,0xfffa,0x0007,0x0000,0xffe6,
-0x001b,0xfffc,0x0012,0xffd8,0xfffa,0x0010,0xffff,0xfff1,
-0x0000,0xffc9,0xfffb,0xfff0,0xffed,0x000e,0xfffd,0x0031,
-0x000e,0x0001,0xffea,0xffe2,0xfff4,0x0000,0x0018,0x000f,
-0x0009,0xffef,0xffd3,0xffe3,0x0004,0x001c,0x0033,0x0023,
-0xffd8,0x0000,0xffe4,0x0018,0x000e,0xfffb,0xfffc,0xffeb,
-0xfff9,0xffdf,0x0000,0xffe0,0xfff1,0x0023,0x000c,0x0001,
-0xfff5,0xffc6,0x0005,0xfff0,0xffe4,0x0000,0x0001,0x0021,
-0x0000,0x000b,0xffd9,0x0005,0xfff2,0x0006,0x0003,0x001f,
-0x001c,0xffff,0xffcb,0xffdf,0xffed,0x0019,0x002e,0x001a,
-0xfff5,0xfff2,0xffd9,0xffe5,0x0009,0xffef,0xfffc,0xffdf,
-0x0006,0x0000,0x0004,0xffff,0x0005,0x000a,0xffef,0xffea,
-0x0005,0xffc7,0xfffb,0x0009,0x0014,0x000d,0x0012,0x0023,
-0xfff5,0x0003,0xfff0,0xffea,0x0011,0x000d,0x0028,0x0013,
-0xffff,0xffc9,0xffdd,0xfffb,0x001b,0x002c,0x0025,0x0031,
-0xffb0,0x0006,0xfff0,0x000b,0x001e,0xffe2,0xfff7,0xffe4,
-0xffe4,0xffe3,0xfff3,0x0006,0xfffe,0x001c,0xfffd,0xfffb,
-0xfff9,0xffc4,0x0005,0x0009,0x000b,0xffff,0x0018,0x0013,
-0xffe5,0x000d,0xffe0,0x000d,0x000f,0x0013,0x0013,0x0023,
-0x0011,0xffd9,0xffd5,0xfff7,0x0004,0x002a,0x0020,0x0029,
-0x004e,0xffeb,0xffd5,0x0004,0xffda,0x0011,0x0011,0xfffb,
-0x0037,0x0018,0xfff1,0xffdc,0x000e,0x0004,0x0018,0xffe8,
-0x000c,0x0005,0x0011,0x001f,0xffca,0xfffb,0xfffe,0x001b,
-0x002b,0xfff4,0x0002,0x0009,0xfff7,0xfff1,0x0016,0xfffd,
-0x001c,0x0015,0xffec,0x0003,0x0014,0x001c,0x0009,0xfffb,
-0x0009,0xffff,0xffec,0x002b,0xffef,0x0003,0x000c,0x0000,
-0x0014,0xfffc,0xffdf,0xffe3,0x0006,0x0016,0x0026,0xfff9,
-0x0000,0x0001,0x001d,0x001e,0xffc1,0xffeb,0x0003,0x000b,
-0x001b,0xffff,0xfff2,0x002d,0xfff6,0xfff7,0x0001,0x000c,
-0x002f,0x0025,0xffe4,0x0000,0xfffe,0x001a,0x0004,0xfff3,
-0x0027,0xfff2,0xffe2,0xfff8,0xffea,0xfff8,0x000c,0xfff4,
-0x0022,0x001b,0xffe3,0x0002,0x001a,0xfffe,0x0008,0xffe1,
-0x0010,0x0003,0x0011,0x0039,0xfff2,0xfffa,0x0013,0x000d,
-0x0010,0xfff6,0x0008,0x0011,0x0014,0xfffe,0x0026,0x0000,
-0x0011,0xfff0,0xfff5,0x001b,0x002c,0x002d,0xfffc,0x0008,
-0xffe3,0x0005,0xfff9,0x001e,0xffff,0xffeb,0x0007,0xfff9,
-0x0000,0x0000,0xffd1,0x0009,0x0012,0x000f,0x0016,0xfff2,
-0x0004,0x0000,0x001c,0x0039,0xffe9,0xffeb,0x0019,0xfffe,
-0x0001,0x0000,0xfff9,0x0035,0x0013,0x0003,0x0011,0x000f,
-0x0024,0x0000,0xffed,0x0018,0x0015,0x002b,0xfff7,0x0000,
-0x0021,0xfff6,0xffde,0x0005,0xffef,0xffdd,0x000f,0x0001,
-0x0035,0x001e,0x0006,0xffc5,0x0000,0xfff6,0x0018,0xfff3,
-0x0011,0xffe5,0x0001,0xffff,0xffdb,0x000d,0x0004,0x0014,
-0x0014,0xffee,0xfff6,0xfff0,0xfff8,0xfff5,0x0027,0x0012,
-0x001a,0x0000,0xffd2,0xffec,0x0029,0x000f,0x0025,0x000f,
-0xffdd,0x000a,0xfff5,0x002c,0x0003,0xffd0,0x000a,0x0006,
-0x0011,0x0002,0xfff5,0xffcd,0xfff8,0x0008,0x0026,0x0003,
-0x0004,0xffe1,0x000c,0xfffe,0xffd2,0xffff,0x000a,0x0004,
-0x0005,0xfff9,0xffe6,0x0013,0xfff6,0xfffb,0x0012,0x0022,
-0x002d,0x000f,0xffca,0xffe8,0x0012,0x000d,0x001f,0x0007,
-0xfffb,0xfffd,0xffeb,0xfff9,0xfffe,0xffc4,0x000a,0xfffb,
-0x0020,0x0022,0xfff9,0xffec,0x000b,0xfff0,0x0008,0xffec,
-0x0015,0xffe3,0x0001,0x0018,0x0002,0x000d,0x001b,0x0006,
-0xfffb,0xfff1,0xfffd,0xfff8,0x0015,0x0001,0x0037,0x0015,
-0x000f,0xffda,0xffdb,0x0003,0x0041,0x0020,0x0017,0x001e,
-0xffb6,0x0011,0x0000,0x001f,0x0012,0xffb7,0x0005,0x0000,
-0xfffd,0x0005,0xffe7,0xfff4,0x0003,0x0001,0x0016,0xfffd,
-0x0009,0xffdf,0x000c,0x0018,0xfffa,0xfffe,0x0021,0xfff7,
-0xffeb,0xfffb,0xffec,0x001b,0x0013,0x0007,0x0022,0x0025,
-0x0022,0xffea,0xffd4,0x0000,0x0029,0x001d,0x0011,0x0015,
-0x004c,0xffdd,0xffe1,0xffe4,0xffcf,0x002b,0xffd8,0x0000,
-0x001d,0xfff2,0x0008,0x0005,0x000a,0x0012,0xffe6,0xffd2,
-0x0000,0x0007,0x0006,0x0003,0xffe7,0xfff9,0xfffe,0x0028,
-0x001c,0x000e,0x0012,0xfffd,0xffe5,0xffe4,0xfff8,0xffd3,
-0xfff3,0x0022,0xfff3,0xffe5,0xfff1,0x001f,0x000c,0x0003,
-0x0007,0xfff1,0xfff7,0x0009,0xffe4,0x001d,0xffd3,0x0005,
-0xfffa,0xffd5,0xfff7,0x000c,0x0002,0x0024,0xfff4,0xffe2,
-0xfff5,0x0003,0x0011,0x0003,0xffde,0xffea,0x0003,0x0018,
-0x000c,0x0018,0x0002,0x0020,0xffe4,0xffea,0xffe3,0xffe3,
-0x0005,0x0032,0xffeb,0xffe1,0xffda,0x001d,0x0007,0xfffb,
-0x0024,0xffe3,0xffed,0xffd7,0xffde,0x0012,0xffd3,0xfffa,
-0x0008,0xfff6,0xfffb,0x002b,0x0017,0x000b,0xffd6,0xffcb,
-0x0005,0x0005,0x0006,0x001e,0x000e,0xfff8,0x0014,0x001a,
-0x0001,0x0010,0x0019,0x0004,0x0003,0xfff1,0x0007,0xffd7,
-0xffe9,0xfffd,0xfffc,0xfffd,0x0008,0x0030,0xffff,0x0011,
-0xffe0,0xfff8,0x0003,0xfffe,0xfff3,0x0004,0xffce,0xffff,
-0xffe5,0xffd9,0xffe9,0x0033,0x000f,0x001e,0xffe5,0xffdb,
-0xfff9,0x0001,0x0011,0x001d,0x0005,0xffe9,0x0019,0x000a,
-0xfff2,0x001a,0x0008,0x0029,0x0001,0xfff7,0xfff3,0xffe6,
-0xfffb,0x000c,0xfff4,0xfff9,0xfff2,0x002d,0xfffa,0x0009,
-0x001f,0xffe8,0xffe9,0xffe5,0xffe3,0xfff7,0xffd5,0x0008,
-0x001a,0xfff9,0x001e,0xffef,0xfffc,0x0003,0xffe6,0xffdd,
-0x0005,0xffe8,0xfff6,0xffe4,0xfff7,0x000c,0x0005,0x0021,
-0x0005,0x0008,0x0005,0xffe3,0xffe6,0xffe8,0x0009,0xffe9,
-0xfff2,0x000c,0xffd9,0xffcc,0x0005,0x0012,0x0027,0x0018,
-0xffdb,0xfffd,0x0000,0x000a,0xfff9,0xffea,0xffd0,0x000c,
-0xfff8,0xffdc,0x000c,0xfff7,0xfff4,0x0016,0xfff4,0xffed,
-0xfffa,0xffe4,0x0000,0xffe3,0xffee,0xfffd,0x000b,0x0011,
-0xfff6,0x0012,0xfff6,0x0007,0xffe5,0xffee,0xfff5,0xfff9,
-0x0003,0x001c,0xffd1,0xffc9,0xffee,0x000f,0x0022,0x0010,
-0xfff8,0xffef,0xfff6,0xffd8,0xfff3,0xffde,0xffd1,0x0000,
-0x0005,0xfffc,0x0010,0x0015,0x0008,0xfffe,0xffd6,0xffd5,
-0x000a,0xffe6,0xfff6,0xfffe,0x001f,0x000b,0x001b,0x0013,
-0xffeb,0x000a,0x000c,0xffec,0x0003,0xfff5,0x0019,0xffec,
-0xffe7,0xffe7,0xffe3,0xffe4,0x001c,0x0022,0x0019,0x0026,
-0xffb3,0x0002,0x000b,0xffff,0x0007,0xffd1,0xffcc,0x0005,
-0xffe3,0xffdf,0xffff,0x001c,0x0000,0x000f,0xffe4,0xffe6,
-0xfffe,0xffe2,0x0000,0xfffe,0x0016,0xfffc,0x0021,0x0003,
-0xffdc,0x0015,0xfffd,0x000f,0x0002,0xfffb,0x0004,0xfffc,
-0xfffa,0xfff7,0xffdb,0xffe1,0x0005,0x0020,0x0014,0x001e,
-0x0051,0xffe7,0xfff2,0xfff8,0xffc3,0x0000,0xffe7,0x001c,
-0x0036,0x0014,0xfffd,0xfff2,0x0011,0xfff8,0x0000,0xffd4,
-0x0010,0x0023,0x000d,0x0012,0xffd5,0xfff9,0x0006,0x000b,
-0x0021,0xfffc,0x001e,0x000b,0xffea,0xffd8,0x0006,0xffd5,
-0x0003,0x0032,0xfff2,0xffee,0x0016,0x0012,0xffff,0xfff0,
-0x000c,0xfffc,0x0008,0x001d,0xffd9,0xfff4,0xffe2,0x0021,
-0x0013,0xfff8,0xffeb,0xfffa,0x0008,0x0009,0x000d,0xffe4,
-0x0004,0x001f,0x0018,0x0012,0xffcc,0xffe9,0x000c,0xfffc,
-0x0012,0x0005,0x000e,0x002f,0xffe8,0xffde,0xfff2,0xffe5,
-0x0016,0x0042,0xffea,0xffea,0xffff,0x0010,0xfffa,0xffe8,
-0x0029,0xffee,0xfffe,0xffeb,0xffd3,0xffe8,0xffe2,0x0015,
-0x0021,0x0018,0xffef,0x0018,0x001d,0xfff1,0xfff0,0xffcd,
-0x0015,0x0021,0x000d,0x002d,0xfffd,0xfff8,0x001c,0xfffe,
-0x0007,0xfffe,0x0025,0x0013,0x0007,0xffe5,0x0016,0xffd9,
-0xfff9,0x000c,0xfffb,0x0005,0x002d,0x0023,0xfff1,0xffff,
-0xffe5,0x0001,0x0014,0x0011,0xffe8,0xffda,0xffdd,0x001a,
-0xffff,0xfffc,0xffdd,0x0020,0x0015,0x0003,0xfffe,0xffdd,
-0x0008,0x001d,0x0018,0x002c,0xfff4,0xffe8,0x0022,0xffee,
-0xfff8,0x0007,0x0015,0x0037,0x0005,0xffeb,0x0002,0xffe9,
-0x000b,0x001c,0xfff3,0x0001,0x0016,0x0021,0xffeb,0xfff6,
-0x0024,0xfff3,0xfffb,0xfff9,0xffd8,0xffcd,0xffe4,0x0024,
-0x0034,0x001b,0x0012,0xffdc,0x0002,0xffea,0x0000,0xffdf,
-0x0015,0x0002,0xfffd,0xfff3,0xffe6,0x000b,0x000e,0x0004,
-0x000a,0xfff6,0x0012,0xfff2,0xffea,0xffdc,0x0018,0xffeb,
-0x0001,0x001c,0xffd8,0xffd6,0x002a,0x0005,0x0019,0x0005,
-0xffe0,0x0006,0x0011,0x001f,0xffed,0xffbf,0xffdf,0x0029,
-0x0010,0xffff,0x0000,0xffe3,0xfffa,0xfffc,0x000d,0xffef,
-0x0009,0xffff,0x0008,0xfff2,0xffdd,0xfffd,0x0013,0xfff5,
-0xfffc,0x0000,0x0001,0x0015,0xffe9,0xffe2,0x0003,0xfffb,
-0x0014,0x002c,0xffd0,0xffd2,0x0013,0x0003,0x0014,0xfffd,
-0xfffd,0xfff9,0x0006,0xffec,0xffe7,0xffb3,0xffe0,0x001d,
-0x001f,0x001e,0x0004,0x0002,0x000e,0xffe3,0xfff0,0xffd8,
-0x001a,0x0000,0xfffd,0x000c,0x000d,0x000a,0x0024,0xfff7,
-0xfff1,0xfff8,0x0018,0xfffa,0x0007,0xffea,0x0028,0xffef,
-0xfff8,0xfff7,0xffe1,0xffee,0x0042,0x0016,0x000b,0x0013,
-0xffb8,0x000d,0x001d,0x0012,0xfffc,0xffa6,0xffdb,0x0022,
-0xfffc,0x0001,0xfff3,0x0009,0x0006,0xfff5,0xfffe,0xffe8,
-0x000d,0xfffd,0x0007,0x000b,0x0004,0xfffc,0x002a,0xffe7,
-0xffe1,0x0001,0x0008,0x001d,0x0006,0xffef,0x0013,0xfffe,
-0x000a,0x0006,0xffda,0xffea,0x002a,0x0013,0x0006,0x000b,
-0x0074,0xffec,0xffbc,0xffe2,0xffe4,0x0053,0x001c,0xffee,
-0x0020,0xffea,0xfff3,0xffeb,0x0005,0x001c,0x0005,0xfff9,
-0xffe8,0xfff8,0xffea,0x0011,0xffe9,0x001e,0xffe7,0x002d,
-0x000f,0xfff7,0xfff5,0xffee,0x0016,0xfff6,0x0004,0xfffe,
-0x0013,0xfff4,0x0017,0x0003,0xffd5,0x0002,0x000c,0xfffc,
-0x002f,0x0000,0xffd3,0x0007,0xfff9,0x0045,0x0017,0xfff3,
-0xfffe,0xffcd,0xffe0,0xfff2,0xfffd,0x002f,0x0013,0x0008,
-0xffdb,0xfff5,0xfff6,0x0010,0xffe0,0x000f,0xffed,0x001d,
-0x0000,0x0001,0xffe4,0x0012,0x0014,0xfffc,0xfff0,0x000d,
-0x0026,0x0003,0x000f,0x0000,0xffbe,0x0000,0x0007,0xfff3,
-0x004d,0xfff3,0xffc8,0xffd5,0xfff3,0x0039,0x0017,0xffe6,
-0x000b,0xffed,0xffe5,0x0010,0x0011,0x0016,0xfff6,0xfff1,
-0xffed,0xfff6,0xffea,0x002b,0x0010,0x001e,0xfffe,0x001f,
-0xfff5,0xfffa,0xfffb,0xfff7,0x0034,0x0002,0x0014,0x0000,
-0x0008,0xffce,0x0021,0x001b,0xffed,0x0013,0xffff,0x0009,
-0x0008,0x0006,0xffdf,0xfffc,0x0007,0x002c,0x0012,0xffeb,
-0xffe9,0xffd0,0xffd2,0x0018,0x0009,0x0028,0x0003,0x0001,
-0xffe0,0xfff3,0xfff5,0x002b,0x0007,0x000e,0x0003,0x000f,
-0xffe6,0x0003,0xffeb,0x001a,0x0032,0x0008,0x0000,0x0010,
-0x001b,0xffde,0x0019,0x0017,0xffd5,0x0011,0xfffa,0x0001,
-0x0047,0xfff7,0xffc5,0xffe3,0xfff8,0x001e,0x001a,0xfff5,
-0x001e,0xfff0,0x0008,0xffd4,0xfff7,0x000e,0x0005,0x0002,
-0xffed,0xffd8,0xffda,0xfff1,0xfff9,0x0032,0xffef,0x0026,
-0xfff9,0xfff2,0xffe8,0xffd5,0x0016,0xfffa,0x0016,0x0013,
-0x0011,0xffde,0xfffe,0xffec,0xffe9,0xfff6,0x0027,0x0010,
-0x0002,0x000b,0xffdc,0x0009,0x000d,0x0011,0x0015,0xfffa,
-0xfffb,0xffd3,0xfff6,0xffdc,0xffee,0x0021,0x0013,0x0013,
-0xffe1,0xffd4,0xffe5,0xfff1,0xfff0,0x0022,0xfff5,0x0016,
-0xffea,0xfffc,0xffd8,0xfff9,0x0015,0x0000,0x0001,0x0023,
-0x0024,0xffee,0xfff6,0xffe8,0xffd2,0xfff4,0x0022,0x0008,
-0x0020,0xfffe,0xffd1,0xffd6,0x0007,0x0005,0x0015,0xffee,
-0x0009,0xfff4,0xfffb,0xfffb,0x0002,0x0008,0xfff6,0xfffc,
-0xfff2,0xffd6,0xffda,0x000a,0x0021,0x0031,0x0005,0x0018,
-0xffdf,0xfff4,0xffef,0xffdd,0x0034,0x0006,0x0026,0x0016,
-0x0007,0xffb8,0x0007,0x0003,0x0000,0x0006,0x0019,0x001e,
-0xffdc,0x0012,0xffe8,0xfffd,0x001c,0xfff9,0x0010,0xfff3,
-0xffe6,0xffd7,0xffe8,0x0001,0xfffb,0x001a,0x0003,0x000c,
-0xffe5,0xffd2,0xffe5,0x000a,0x0018,0x0022,0x000a,0x0008,
-0xffcf,0xfffe,0xffde,0x0000,0x0033,0x000c,0x0011,0x0026,
-0x0019,0xffc8,0x0000,0x0000,0xffea,0x0003,0x0014,0x0016,
-0x0079,0xfff7,0xffce,0xfff6,0xffd8,0x0028,0x002b,0x0009,
-0x003a,0x000c,0xffe7,0xffd7,0x000b,0x0002,0x001f,0xfffb,
-0xfff8,0x0013,0xfff1,0x0020,0xffd7,0x001e,0xfff0,0x0010,
-0x0014,0xffe4,0x0000,0xfffd,0x001a,0xffea,0x0013,0x0000,
-0x0024,0x0004,0x0016,0x000c,0xfffa,0xfff7,0xffff,0xffe8,
-0x0034,0x000a,0xffe5,0x001b,0xffee,0x001a,0x0026,0x000e,
-0x0017,0xfff0,0xffd4,0xffdf,0x0003,0x0014,0x002d,0x000a,
-0xffec,0x000f,0xfffd,0x001f,0xffce,0x000e,0xfff6,0x0000,
-0x0005,0xffef,0xfff1,0x0020,0x0018,0xfff0,0xffff,0x000f,
-0x0037,0x0014,0x000e,0x0008,0xffe3,0xfff4,0xfff9,0xffe0,
-0x0052,0xfffd,0xffda,0xffe9,0xffe8,0x000f,0x0026,0x0002,
-0x0025,0x000f,0xffd9,0xfffe,0x0017,0xfffc,0x000f,0xfff4,
-0xfffd,0x0011,0xfff1,0x003a,0xffff,0x001d,0x0006,0x0002,
-0xfffb,0xffe6,0x0007,0x0004,0x0038,0xfff7,0x0023,0x0003,
-0x0019,0xffdf,0x0020,0x0024,0x0011,0x0007,0xfff1,0xfff7,
-0x000d,0x0011,0xfff1,0x000f,0xfffd,0x0001,0x0021,0x0007,
-0x0001,0xfff4,0xffc6,0x0005,0x000f,0x000d,0x001d,0x0003,
-0xfff0,0x000d,0xfffc,0x0039,0xfff6,0x000d,0x000b,0xfff3,
-0xffeb,0xfff1,0xfff7,0x0028,0x0037,0xfffd,0x000e,0x0013,
-0x002c,0xffef,0x0018,0x0020,0xfffb,0x0004,0xffeb,0xffee,
-0x004c,0x0001,0xffd7,0xfff7,0xffed,0xfff4,0x0029,0x0011,
-0x0037,0x0012,0xfffd,0xffc1,0xfffd,0xfff4,0x001e,0x0005,
-0xfffd,0xfff4,0xffe1,0x0000,0xffe8,0x0031,0xfff8,0x0009,
-0xffff,0xffdf,0xfff4,0xffe3,0x001b,0xffee,0x0025,0x0015,
-0x0022,0xffef,0xfffd,0xfff5,0x000e,0xffe9,0x0019,0xfffe,
-0x0007,0x0016,0xffee,0x001d,0x0001,0xffe7,0x0024,0x0015,
-0x0014,0xfff7,0xffea,0xffc8,0xfff5,0x0006,0x002d,0x0015,
-0xfff1,0xfff0,0xffec,0xffff,0xffdf,0x0022,0xfffe,0xfffa,
-0xffef,0xffe9,0xffe4,0x0006,0x0019,0xfff4,0x0010,0x0025,
-0x0035,0xffff,0xfff5,0xfff1,0xfff8,0xffe7,0x0014,0xfff5,
-0x0025,0x0008,0xffe3,0xffea,0xfffc,0xffdb,0x0024,0x0009,
-0x0022,0x0016,0xffef,0xffe8,0x0008,0xffee,0x000f,0xfffe,
-0x0001,0xfff2,0xffe1,0x0019,0x000f,0x0030,0x000d,0xfffc,
-0xffe4,0xffe1,0xfffb,0xffeb,0x0039,0xfffc,0x0035,0x0018,
-0x0017,0xffc9,0x0006,0x000c,0x0025,0xfffa,0x000b,0x000b,
-0xffe1,0x001c,0xfffa,0x0010,0x0010,0xffce,0x001f,0x000e,
-0x0000,0xfffa,0xffdc,0xffef,0x0000,0x0000,0x001d,0x000e,
-0xfff5,0xffee,0xffec,0x0019,0x0006,0x0021,0x0013,0xffec,
-0xffd5,0xffeb,0xffeb,0x000e,0x0037,0x0000,0x0020,0x0028,
-0x002a,0xffd9,0xffff,0x0008,0x000e,0xfff8,0x0006,0x0003,
-0x0077,0xffe8,0xffd9,0xffd4,0xffcd,0x0042,0xfff2,0x000f,
-0x001f,0xffe6,0xffff,0x0000,0x0007,0x0010,0xffed,0xffe4,
-0xffed,0x0016,0xffe6,0x0004,0xfff3,0x001c,0xfff0,0x001d,
-0x0005,0xffff,0x0010,0xfff0,0x0008,0xffdd,0xfff6,0xffd6,
-0xfffc,0x0011,0x001d,0xffed,0xffd6,0xfff9,0x0000,0xfff1,
-0x0032,0xfffd,0xfff0,0xfffb,0xffe2,0x0035,0xffed,0x0014,
-0xfffd,0xffc9,0xffed,0x0008,0x0000,0x0022,0xfffb,0xfff5,
-0xffe0,0x0012,0xfff1,0x0004,0xffea,0x000d,0xfff6,0x000d,
-0xfff7,0x0008,0x0000,0x0013,0x0007,0xffe3,0xffe1,0xffe6,
-0x000d,0x0021,0x0015,0xffea,0xffbf,0xfff7,0xfffc,0xffe9,
-0x004f,0xffef,0xffe5,0xffc8,0xffdc,0x0029,0xffed,0x0008,
-0x000a,0xffea,0xfff1,0x0027,0x0014,0x0009,0xffdd,0xffdd,
-0xfff1,0x0014,0xffe6,0x001f,0x001a,0x001b,0x0006,0x000f,
-0xffec,0x0000,0x0017,0xfff8,0x0026,0xffea,0x0005,0xffda,
-0xfff1,0xffec,0x0027,0x0004,0xffee,0x0009,0xfff3,0xffff,
-0x000a,0x0003,0xfffc,0xffee,0xfff1,0x001b,0xffe8,0x000d,
-0xffe8,0xffcd,0xffde,0x002f,0x000c,0x001c,0xffeb,0xffed,
-0xffe5,0x0010,0xfff1,0x001e,0x0011,0x000c,0x000c,0x0000,
-0xffdc,0x000a,0x0007,0x001b,0x0025,0xfff0,0xfff1,0xffea,
-0x0003,0xfffc,0x001f,0x0001,0xffd6,0x0007,0xffee,0xfff7,
-0x004a,0xfff4,0xffe2,0xffd6,0xffe2,0x000e,0xfff0,0x0017,
-0x001d,0xffed,0x0014,0xffeb,0xfff9,0x0001,0xffed,0xffef,
-0xfff2,0xfff6,0xffd5,0xffe5,0x0003,0x0030,0xfff8,0x0016,
-0xfff0,0xfff9,0x0004,0xffd6,0x0009,0xffe1,0x0006,0xffec,
-0xfffa,0xfffc,0x0003,0xffd5,0xffea,0xffec,0x001c,0x0005,
-0x0005,0x0007,0xfff9,0xfffc,0xfff7,0x0000,0xffeb,0x001c,
-0xfffa,0xffd0,0x0002,0xfff2,0xfff1,0x0014,0xfffb,0x0000,
-0xffe5,0xfff2,0xffe0,0xffe4,0xfffb,0x0020,0xfffe,0x0006,
-0xffe0,0x0003,0xfff4,0xfffb,0x0008,0xffe7,0xfff2,0xfffc,
-0x000c,0x000b,0xfffc,0xffd1,0xffd3,0xffea,0x0016,0xfffe,
-0x0022,0xfffa,0xffee,0xffc9,0xfff1,0xfff5,0xffeb,0x0010,
-0x0008,0xfff0,0x0006,0x0010,0x0005,0xfffc,0xffdd,0xffe8,
-0xfff6,0xfff4,0xffd5,0xffff,0x002b,0x002f,0x000e,0x0008,
-0xffd5,0xfffb,0x000a,0xffde,0x0027,0xffee,0x0016,0xfff0,
-0xffef,0xffd6,0x000d,0xffed,0x0001,0xfffd,0x000e,0x0014,
-0xffde,0x000e,0x0004,0xffef,0x0005,0xffe8,0xffe6,0x0014,
-0xffe5,0xffd3,0xfff4,0x0018,0xfffe,0x000d,0xffeb,0xfff8,
-0xffea,0xfff0,0xffe0,0xfffe,0x0022,0x001f,0x0014,0xfff9,
-0xffc6,0x0005,0xfffb,0x0002,0x0026,0xfff4,0x0002,0xffff,
-0x0001,0xffe6,0x0005,0xffe9,0xffeb,0xfffa,0x0008,0x000b,
-0x007c,0xfff3,0xffeb,0xffe9,0xffc2,0x0017,0x0000,0x002b,
-0x0039,0x0008,0xfff3,0xffee,0x000e,0xfff6,0x0006,0xffe6,
-0xfffd,0x0031,0xffed,0x0013,0xffe1,0x001b,0xfff9,0x0000,
-0x000b,0xffec,0x001d,0xffff,0x000c,0xffd1,0x0004,0xffd9,
-0x000b,0x0022,0x001c,0xfff7,0xfffb,0xffed,0xfff3,0xffde,
-0x0037,0x0006,0x0001,0x000e,0xffd7,0x000a,0xfffc,0x0030,
-0x0016,0xffec,0xffe1,0xfff6,0x0005,0x0007,0x0014,0xfff7,
-0xfff0,0x002d,0xfff8,0x0013,0xffd8,0x000c,0xffff,0xfff1,
-0xfffc,0xfff6,0x000c,0x0022,0x000b,0xffd7,0xfff0,0xffe8,
-0x001e,0x0031,0x0014,0xfff3,0xffe4,0xffea,0xffee,0xffd5,
-0x0054,0xfffa,0xfff7,0xffdc,0xffd1,0xffff,0xfffc,0x0024,
-0x0024,0x000c,0xffe5,0x0014,0x001a,0xffef,0xfff7,0xffdf,
-0x0001,0x002f,0xffed,0x002e,0x0009,0x001b,0x000f,0xfff3,
-0xfff1,0xffee,0x0023,0x0006,0x002a,0xffdf,0x0014,0xffdc,
-0x0001,0xfffc,0x0026,0x000e,0x0012,0xfffe,0xffe5,0xffec,
-0x000f,0x000d,0x000d,0x0001,0xffe6,0xfff2,0xfff7,0x0029,
-0x0001,0xfff0,0xffd2,0x001b,0x0012,0x0001,0x0004,0xfff0,
-0xfff5,0x002b,0xfff8,0x002d,0x0000,0x000b,0x0015,0xffe3,
-0xffe2,0xfff8,0x0013,0x002a,0x0029,0xffe4,0x0000,0xffec,
-0x0014,0x000b,0x001e,0x000a,0xfffc,0xfffb,0xffe0,0xffe4,
-0x004f,0xfffe,0xfff4,0xffea,0xffd6,0xffe4,0xffff,0x0033,
-0x0036,0x000f,0x0008,0xffd7,0x0000,0xffe8,0x0006,0xfff1,
-0x0001,0x0011,0xffdc,0xfff4,0xfff2,0x002f,0x0000,0xfffa,
-0xfff5,0xffe6,0x0010,0xffe5,0x000d,0xffd5,0x0016,0xffee,
-0x000a,0x000c,0x0002,0xffde,0x000f,0xffdf,0x000d,0xfff3,
-0x000a,0x0012,0x000a,0x000f,0xffeb,0xffd7,0xfffa,0x0038,
-0x0013,0xfff3,0xfff7,0xffdf,0xfff7,0xfffa,0x0014,0x0001,
-0xfff5,0x000d,0xffe8,0xfff3,0xffe9,0x0020,0x0006,0xffea,
-0xffe6,0xfff1,0x0000,0x0008,0x000c,0xffdb,0x0001,0xfffe,
-0x001c,0x001b,0xfffb,0xffdb,0xfff9,0xffdd,0x0008,0xffeb,
-0x0027,0x0004,0x0000,0xffdd,0xffe5,0xffcb,0xfffa,0x002c,
-0x0021,0x0012,0xfffb,0xfffe,0x000b,0xffe1,0xfff7,0xffea,
-0x0006,0x000f,0xffdc,0x000d,0x0019,0x002e,0x0017,0xffec,
-0xffdb,0xffe8,0x0017,0xffed,0x002b,0xffe3,0x0026,0xfff2,
-0x0000,0xffe6,0x000c,0xfff6,0x0026,0xfff0,0x0000,0x0000,
-0xffe3,0x0019,0x0016,0x0002,0xfffa,0xffbd,0xfff5,0x0031,
-0xffff,0xfff6,0xffe8,0x0005,0x0003,0xfff3,0x0004,0xfffb,
-0xfffa,0x000b,0xffe7,0x000c,0x0010,0x001f,0x001c,0xffdc,
-0xffcb,0xfff3,0x0006,0x0010,0x002a,0xffe8,0x0011,0x0001,
-0x0012,0xfff6,0x0004,0xfff3,0x000f,0xffee,0xfffb,0xfff9,
-0x001d,0xffe7,0xffea,0xfffe,0x0006,0x0043,0x000b,0xffcf,
-0x0001,0x000a,0x0018,0xfffb,0xfffd,0x000d,0xfffc,0x0005,
-0x0006,0xfff5,0x0019,0xfff4,0xfff0,0xffe1,0xffe4,0x0024,
-0x0035,0x000d,0xfffa,0xfff0,0xffd6,0x0018,0xffef,0xffff,
-0xffee,0x000a,0xfffc,0x000d,0xfff1,0x0012,0x0005,0x0007,
-0xffd9,0xfffc,0x0000,0x0023,0x001b,0x0035,0x0006,0xffd4,
-0xffdf,0xffee,0x0005,0x0002,0xfff5,0x001f,0x0009,0x0016,
-0xfffa,0xfff1,0x0024,0xfff3,0xffe7,0xffd2,0xffe9,0x0014,
-0x0025,0x0018,0xffe9,0x0013,0xffd5,0x001d,0xffda,0x000e,
-0x0000,0x001a,0xfff4,0x000a,0xffda,0x0010,0x0000,0x0000,
-0xfff6,0xffee,0xfff6,0xfff1,0x0015,0x0029,0x0006,0xffc8,
-0xffed,0x000d,0x0009,0x0021,0x0009,0x0006,0xffec,0xffff,
-0x000b,0xfff3,0x0018,0x000d,0x0017,0xffe0,0xfffa,0x0016,
-0x001a,0x000f,0x0000,0xfff8,0xfff4,0x0025,0xffff,0x0002,
-0xffe4,0xffe5,0x0005,0x0025,0x0007,0x0023,0xfff8,0x0015,
-0xffb1,0x0002,0x000c,0x0016,0x002a,0x001c,0x0001,0xffcd,
-0xffca,0xfff1,0xfff8,0x0029,0x0000,0x0018,0xfffa,0x000f,
-0xffff,0xffef,0x0024,0x000c,0x000e,0xffd1,0x0000,0x0006,
-0x000b,0x001a,0xfff0,0x001b,0xfff3,0x002b,0xffea,0x0012,
-0xfff6,0xfff4,0xfffe,0x0022,0xfff1,0x0021,0xfff3,0x000d,
-0xfff1,0xfff3,0xfff3,0xffff,0x001a,0x000e,0x0009,0xffd7,
-0xffff,0x0010,0x002e,0xffe5,0xffee,0xffff,0xfffc,0x0010,
-0x000b,0xffd5,0x0008,0xffd3,0x0000,0xfff5,0xffeb,0x001d,
-0x001e,0x0008,0xffed,0xffd6,0xffd7,0x001c,0x0000,0x0014,
-0xffec,0xfff5,0xffe2,0xfff6,0x0004,0x0005,0x0020,0x001c,
-0xffac,0x0006,0x0009,0x0024,0x002f,0x0001,0x0004,0xffdc,
-0xffdc,0xfff4,0x001b,0xffec,0xffe6,0x0011,0x0009,0x0021,
-0xffff,0xffd1,0x0013,0xffd2,0xfff7,0xffe5,0xfff1,0x000d,
-0x000f,0x0012,0xffdd,0xfffa,0xffd6,0x0021,0xffec,0x0024,
-0xffff,0x0004,0xffda,0xfff2,0xffee,0x0002,0x001b,0x0014,
-0xffc9,0xfffa,0xffff,0xfff2,0x0029,0xfff6,0x0004,0xffd0,
-0xffea,0x0014,0x001f,0x000a,0xfffb,0xfff9,0xffec,0x0009,
-0x0010,0xffd3,0x0008,0xffed,0x0028,0xfff4,0x0001,0x000f,
-0x0004,0x000a,0xfff4,0xffde,0xfff5,0x0029,0x0010,0x0018,
-0xffe2,0xffcf,0xffec,0x000d,0x001c,0x0016,0x0012,0x002b,
-0xff84,0x000d,0x0015,0x0017,0x003e,0xffe9,0x0000,0xffd5,
-0xffc7,0xfff8,0x000d,0x0012,0xfff2,0x000a,0xfffa,0x001a,
-0x0003,0xffcf,0x0013,0xffed,0x001f,0xffe5,0x0007,0x0000,
-0xfff5,0x0014,0xffe3,0x0001,0xfff4,0x002f,0xfffc,0x0027,
-0xfff5,0xffde,0xffe4,0x0009,0x0005,0x0013,0x000d,0x0022,
-0x0022,0xfff2,0xfffc,0x0011,0xfffb,0x0018,0x001a,0xffec,
-0x001b,0x002d,0x000c,0xffe8,0x0002,0xfff3,0x0015,0x0008,
-0x0016,0x0010,0x0020,0x0002,0xffde,0xffe1,0xffec,0x0007,
-0x003a,0xfffb,0x0005,0xfffe,0xffda,0x000c,0xfffe,0x0001,
-0xffff,0x001a,0xfffb,0x0017,0x0015,0x0006,0xfff8,0xfff5,
-0xffde,0x0006,0x0012,0x0037,0x000f,0x000b,0x0015,0xfff0,
-0xfff8,0x0010,0xfffa,0xfff0,0xfffb,0x0004,0x0023,0x0018,
-0x000a,0x000c,0x002b,0x0001,0xffd5,0xffd1,0xfff2,0xfff8,
-0x002b,0x0005,0xfff6,0x0022,0xffd9,0x0012,0xffea,0x0010,
-0x0011,0x002a,0xfff3,0x0013,0xffff,0x0003,0xfff2,0xffec,
-0xfffb,0xfff9,0x0007,0x0004,0x0009,0x0000,0x0015,0xffe4,
-0x0006,0x0030,0xfffe,0x000e,0x000f,0xffec,0x0005,0x0000,
-0x001b,0x000e,0x0020,0x001c,0x0005,0xffe0,0x0002,0xfffa,
-0x0020,0xfffd,0x000c,0x0005,0xfff8,0x0019,0x000e,0x0004,
-0xfff4,0xfff5,0x0004,0x002f,0x002d,0x0016,0xffea,0x0002,
-0xffb6,0x000c,0x001e,0x002a,0x001e,0xfff2,0x0010,0xffe9,
-0xffe3,0x0013,0xffec,0x0015,0x0007,0xffff,0x0013,0x0011,
-0x000e,0x000a,0x002b,0x001b,0xfffd,0xffd0,0x0008,0xffea,
-0x0010,0x0007,0xfffc,0x002a,0xfff7,0x001f,0xfffa,0x0014,
-0x0006,0x0004,0xfffd,0x002b,0x0016,0x0014,0xffe4,0xfffb,
-0xfff6,0xfffd,0x0004,0x0012,0x000f,0xffe5,0x0018,0xfff3,
-0x0018,0x0033,0x0022,0xffd1,0xfff4,0xffe4,0x0015,0x0013,
-0x001b,0xfff0,0x000f,0xffe2,0xffef,0xfff4,0xfff4,0x0000,
-0x0024,0xfff6,0xfff9,0xffe5,0xffdb,0x0010,0x000f,0x0016,
-0xfffd,0x0004,0xffe1,0xffff,0x002a,0xfff9,0x0012,0x0009,
-0xffb1,0x0011,0x001b,0x0038,0x0024,0xffd7,0x0013,0xfff8,
-0xfff6,0x0016,0x000f,0xffd9,0xffec,0xfff7,0x0023,0x0023,
-0x000f,0xffec,0x001a,0xffe1,0xffe6,0xffe5,0xfffa,0xfff1,
-0x0014,0x0000,0xffe9,0x0008,0xffda,0x0016,0xfffb,0x0026,
-0x000f,0x0014,0xffd9,0xfffc,0x0012,0xfff7,0x000d,0x0001,
-0xffce,0x0003,0x0010,0x0005,0x001e,0xffcb,0x0013,0xffec,
-0x0003,0x0037,0x0013,0xfff8,0x0000,0xffde,0x0005,0x000b,
-0x0020,0xffee,0x000f,0xfffc,0x0016,0xfff3,0x000a,0xfff3,
-0x0009,0xfff8,0x0000,0xffed,0xfff9,0x001d,0x001f,0x001a,
-0xfff3,0xffdf,0xffeb,0x0016,0x0041,0x0009,0x0004,0x0017,
-0xff89,0x0018,0x0027,0x002c,0x0033,0xffbe,0x000e,0xfff1,
-0xffe1,0x001a,0x0001,0x0000,0xfff9,0xfff0,0x0013,0x001c,
-0x0013,0xffea,0x001a,0xfffc,0x000d,0xffe4,0x0010,0xffe3,
-0xfffb,0x0001,0xfff0,0x0010,0xfff8,0x0023,0x000a,0x002a,
-0x0004,0xffef,0xffe3,0x0013,0x002a,0x0007,0x0000,0x000f,
-0x001f,0xffe4,0x0006,0xfff0,0xfff0,0x0032,0xffe1,0xfff2,
-0x0000,0x0006,0x0024,0x0011,0x0000,0x0000,0xffe3,0xfff2,
-0x000b,0x0012,0x0014,0xffe7,0xfffa,0xffdf,0xffed,0x0014,
-0x002b,0x0015,0x0015,0xfff2,0xffc9,0x0000,0xffe0,0xffd8,
-0xffd6,0x0027,0x0001,0xfff8,0xfff2,0x0008,0xfffa,0xfffd,
-0xffdb,0xfff8,0x001d,0x0016,0x0004,0x0025,0xffdc,0xfff7,
-0xffde,0xffea,0x0011,0x0018,0xfff8,0x0012,0xfff1,0x0002,
-0xffff,0x000e,0x001f,0xffe7,0xfff1,0xffd0,0xfff3,0x0004,
-0x001c,0x001f,0x0005,0x0015,0xffc7,0x0004,0xffcb,0xffe8,
-0xffe9,0x0037,0xfffa,0xfff4,0xffdb,0x0006,0xfff5,0xfff5,
-0xfff9,0xffea,0x0012,0xffe3,0xffff,0x0019,0xffdc,0xffeb,
-0xffec,0x0009,0x0016,0x0038,0x000b,0xfffa,0xffd3,0xffeb,
-0x000f,0x0010,0x0014,0x0001,0x0021,0xffde,0x0002,0x0006,
-0x0011,0x0017,0x001c,0xfffa,0xffe7,0x000c,0xfff0,0xffdb,
-0xffcb,0x0001,0x000b,0x000f,0x0008,0x0019,0xffec,0x000b,
-0xffb4,0xffff,0x0029,0x0009,0x0013,0x000c,0xffd7,0xffef,
-0xffc9,0xffee,0x0003,0x003f,0x0003,0x000c,0xffe2,0xfffb,
-0x0003,0x000c,0x001f,0x0000,0x0018,0xffcf,0x0008,0xfff7,
-0x0001,0x0021,0x000c,0x001d,0xffe5,0x0012,0xffdb,0xffeb,
-0xffde,0x0011,0x0003,0x000b,0xfff2,0x0017,0xffe7,0x0002,
-0xfff3,0xffef,0x000f,0xfff1,0x0003,0xffff,0xffdf,0xfff9,
-0xffff,0x000c,0x003a,0xfffb,0xfff1,0xfff3,0xffe3,0xfffd,
-0x0010,0xfff3,0x0004,0xffc7,0x000a,0xfff3,0xfff5,0x000d,
-0x0015,0x000f,0x0009,0xffd8,0xffc9,0x0003,0xfff2,0xffed,
-0xffd4,0x0011,0xffe8,0xffe0,0x0005,0xfffc,0x0015,0x0012,
-0xffae,0x0003,0x0026,0x0017,0x0018,0xfff1,0xffda,0xfffe,
-0xffdb,0xfff1,0x0027,0x0002,0xffe9,0x0004,0xfff1,0x000c,
-0x0003,0xffef,0x000f,0xffc6,0x0001,0xffe3,0xfffa,0xfffe,
-0x0005,0x001a,0xfff9,0xfffc,0xffc8,0x0009,0xffdd,0xfffd,
-0xffe7,0x0021,0xffe0,0xffdc,0xffef,0xfff9,0x000f,0x0009,
-0xffcc,0xfff6,0x001b,0xffe5,0x0012,0xffe6,0xffda,0xfff2,
-0xffe9,0x0010,0x002c,0x0021,0xfffd,0xffec,0xffd3,0xfff6,
-0x0014,0xfff1,0x0003,0xffe1,0x0032,0xfff2,0x000a,0x0000,
-0xfffb,0x0011,0x000f,0xffe0,0xffe8,0x0010,0x0001,0xfff1,
-0xffc9,0xffec,0xfff2,0xfff8,0x001d,0x000c,0x0007,0x0020,
-0xff87,0x0009,0x0032,0x000a,0x0028,0xffd8,0xffd5,0xfff7,
-0xffc6,0xfff4,0x0019,0x0029,0xfff5,0xfffe,0xffe1,0x0005,
-0x0008,0xffed,0x000f,0xffe0,0x0029,0xffe2,0x0010,0xfff0,
-0xffec,0x001c,0x0000,0x0003,0xffe6,0x0016,0xffed,0x0000,
-0xffdc,0xfffc,0xffea,0xfff4,0x0006,0x0009,0x0001,0x0018,
-0x0024,0xffee,0x0018,0x0003,0xffe4,0x0007,0xfff0,0x000d,
-0x001a,0x0029,0x0018,0xffff,0x0005,0xffe6,0xfffd,0xfff4,
-0x001b,0x002e,0x001b,0xfff6,0xffe8,0xffde,0xfff6,0xfff8,
-0x0031,0x0002,0x0022,0x0000,0xffcd,0xfff4,0xffef,0xffda,
-0xffe7,0x0038,0x0000,0x0000,0x0016,0xfffd,0xffec,0xffea,
-0xffe0,0x0002,0x002f,0x002a,0xfff9,0xfffb,0xffeb,0x0012,
-0xfff7,0x000c,0x0005,0x0005,0xfffe,0xfff8,0x000a,0x0004,
-0x000e,0x002a,0x0026,0xfff6,0xffdf,0xffcf,0xfffb,0xffe8,
-0x0021,0x000c,0x0011,0x0023,0xffcc,0xfffa,0xffda,0xffea,
-0xfff9,0x0048,0xfff9,0xfffd,0x0000,0xfffa,0xffe7,0xffe2,
-0xfffe,0xfff5,0x0024,0xfff7,0xfff3,0xffef,0xffeb,0x0006,
-0x0005,0x002d,0x000a,0x0024,0x0012,0xffdf,0xffed,0xffed,
-0x001f,0x002c,0x001b,0x000f,0x0010,0xffde,0x000b,0xffea,
-0x0016,0x0004,0x0028,0x0007,0xffeb,0x0000,0xffff,0xffdd,
-0xffdc,0x0012,0x000a,0x0018,0x002e,0x000c,0xffde,0xfff8,
-0xffb9,0x0009,0x003b,0x001d,0x0008,0xffe2,0xffe6,0x000b,
-0xffe2,0x0010,0xfff8,0x002c,0x0009,0xfff2,0xfffb,0xfffe,
-0x0013,0x0028,0x0026,0x000f,0x0007,0xffce,0x0011,0xffda,
-0x0007,0x000e,0x0018,0x002b,0xffea,0x0006,0xffea,0xffed,
-0xffef,0x0022,0x0002,0x0014,0x0017,0x000a,0xffd9,0xfff0,
-0xfff8,0xfffa,0x0021,0x0004,0xfff9,0xffd4,0xffee,0x0015,
-0x0017,0x0030,0x002e,0xffe8,0xfff7,0xffd8,0xfffd,0xffff,
-0x0020,0x000d,0x000b,0xffd5,0xfff9,0xfff2,0xfffd,0xfff1,
-0x001a,0xfffd,0x0015,0xffe6,0xffce,0xfff8,0x0000,0xfff0,
-0xffe5,0x0022,0xffe7,0xffe9,0x002b,0xffef,0x0006,0xffff,
-0xffb3,0x000d,0x0038,0x002b,0x000d,0xffc7,0xffe9,0x001a,
-0xfff5,0x0013,0x001b,0xfff0,0xffef,0xffea,0x000a,0x000f,
-0x0013,0x000a,0x0016,0xffd5,0xfff0,0xffe2,0x0002,0xffe1,
-0x000b,0x0006,0x0005,0x0009,0xffcc,0xfffe,0xffec,0x0000,
-0xfff8,0x0032,0xffdf,0xffe5,0x0013,0xffed,0x0001,0xfff7,
-0xffd1,0x0000,0x002d,0xfff9,0x0007,0xffbb,0xffe9,0x000d,
-0x0002,0x0033,0x0020,0x000e,0x0003,0xffd1,0xffed,0xfff8,
-0x0025,0x000b,0x000a,0xfff0,0x0020,0xfff1,0x0013,0xffe3,
-0x0000,0xffff,0x001c,0xffee,0xffec,0x0004,0x0010,0xfff3,
-0xffda,0xfffd,0xfff1,0x0000,0x0042,0x0000,0xfff9,0x000d,
-0xff8c,0x0014,0x0044,0x001e,0x001c,0xffad,0xffe4,0x0012,
-0xffe0,0x0016,0x000d,0x0015,0xfffb,0xffe4,0xfffb,0x0007,
-0x0018,0x0008,0x0016,0xffef,0x0017,0xffe2,0x0019,0xffd3,
-0xfff1,0x0009,0x000b,0x0012,0xffea,0x000a,0xfffc,0x0002,
-0xffed,0x000c,0xffe9,0xfffd,0x002b,0xfffe,0xfff4,0x0004,
-0x0048,0xfff3,0xffe3,0xffee,0x0004,0x005a,0x0025,0xffde,
-0x0004,0xffff,0x000d,0xfff7,0xfffa,0x000b,0x0002,0x0018,
-0xfff3,0x0003,0xfff9,0xfff5,0xfffc,0x0004,0xffd6,0x0019,
-0x001f,0xffff,0xfff8,0xffe3,0xfffa,0x0011,0xffed,0x0002,
-0xfff6,0xfffa,0x0026,0x0016,0xffd6,0xffed,0xfffa,0xfff5,
-0x0003,0x0007,0xfffa,0x0014,0x0019,0x004d,0x0020,0xffe3,
-0xffe1,0xffe2,0xfffc,0xfffe,0xfff2,0x001d,0x0010,0x0028,
-0xffe6,0x0000,0x0003,0xfff4,0xfff3,0xfff6,0xffdc,0x0009,
-0x000f,0x0008,0xffe8,0x0006,0xfff9,0x0016,0xffd8,0x0011,
-0x0008,0x0009,0x001f,0x0012,0xffbe,0xffea,0xfff5,0xffed,
-0x0020,0xfffa,0xffef,0xffe1,0x0013,0x0041,0x0021,0xffd7,
-0xfff0,0x0001,0x0000,0x001d,0x0006,0x0004,0xfff3,0x0011,
-0xfff7,0x0001,0xfff8,0x000e,0x0023,0x0003,0xffed,0x000b,
-0x0004,0x0000,0xffff,0xffeb,0x0017,0x001e,0xfffd,0x0005,
-0xffec,0xffd4,0x0030,0x002e,0xffed,0xfffd,0xffec,0x0003,
-0xffdc,0x000d,0x0005,0x0007,0x0028,0x0033,0x001c,0xffdc,
-0xffcc,0xffe5,0xffee,0x0024,0xfffe,0x0016,0x0000,0x0021,
-0xffeb,0xfffe,0x0003,0x000d,0x001a,0xfff5,0xfff2,0xfffc,
-0xfff6,0x000a,0xffee,0x000e,0x0016,0x0024,0xffe8,0x0015,
-0xffff,0xffe4,0x0028,0x002a,0xffd6,0xfffb,0xffe7,0xfffb,
-0x001b,0xffff,0xffec,0xffef,0x0018,0x0026,0x0023,0xffe6,
-0x0001,0x0004,0x0023,0xffe0,0xffeb,0xfffd,0x0002,0x0023,
-0xfff8,0xffe3,0xffe8,0xffd4,0x000c,0x0018,0xffde,0x0012,
-0x0008,0xfff9,0xffeb,0xffc9,0xfffb,0x0015,0xfffe,0x0017,
-0xfff5,0xffe4,0x000d,0xffff,0xffea,0xffdf,0x0015,0x000a,
-0xffd7,0x0012,0x0002,0x0015,0x002d,0x0018,0x001e,0xffeb,
-0xffdf,0xffe8,0x0011,0xffe8,0xffe3,0x000f,0x0010,0x0033,
-0xffeb,0xffdf,0xfff3,0xffd3,0x0003,0x0008,0xffe4,0x0002,
-0xfff9,0x0002,0xffdb,0xffed,0xfff9,0x001b,0xffea,0x0027,
-0x0007,0xfff4,0x0005,0xfffb,0xffd3,0xffdd,0x000f,0x0001,
-0xfff4,0x0004,0xfff8,0xffe3,0x0027,0x000c,0x001e,0xffdf,
-0xffed,0x0008,0x0015,0x0006,0xfff8,0xfff7,0xfff3,0x001c,
-0xfffc,0xffe1,0xffe8,0xffee,0x0034,0x0017,0xfff4,0x0004,
-0xffee,0xfffb,0xfff2,0xffd1,0x0018,0x0022,0x000e,0x001b,
-0xffea,0xffbe,0x0016,0x0016,0x0001,0xfff0,0x0006,0x0018,
-0xffaf,0x0019,0x000e,0x0008,0x003d,0x0000,0x0019,0xffe4,
-0xffca,0xffec,0x0003,0x000e,0xffef,0x0008,0x0000,0x002c,
-0xfff0,0xffdd,0xfff3,0xffee,0x002b,0x0007,0xfffa,0xfff5,
-0xffdf,0x0004,0xffe2,0xfff5,0x0016,0x0028,0xfffa,0x002b,
-0xfffd,0xffce,0x000e,0x0012,0xffea,0xffee,0x0001,0x0010,
-0x004d,0xfffe,0xfff5,0x0001,0xfff9,0x002f,0x0034,0xfffb,
-0x001d,0x0021,0x0001,0xffe4,0x0000,0xfff1,0x001c,0x001a,
-0x0002,0x001e,0x0000,0x0002,0xffea,0x0004,0xffdf,0xfffd,
-0x0024,0xffeb,0x0003,0xfff1,0xfffe,0x0005,0xfffc,0x0004,
-0x0006,0x0009,0x0025,0x001f,0xfffb,0xffe0,0xffec,0xffe2,
-0x0008,0x0011,0x000a,0x0028,0x000d,0x0022,0x002f,0x0000,
-0xfffb,0x0004,0xfff0,0xffeb,0xfff8,0x0002,0x002a,0x002b,
-0xfff6,0x001a,0x000a,0x0002,0xffe1,0xfff5,0xffe5,0xffed,
-0x0015,0xfff6,0xfff4,0x0014,0xfffd,0x000b,0xffe7,0x0014,
-0x0019,0x0019,0x001d,0x001c,0xffe4,0xffde,0xffe7,0xffda,
-0x0025,0x0003,0x0000,0xfff6,0x0007,0x0016,0x0030,0xfff4,
-0x0008,0x0024,0xfff4,0x0009,0x000c,0xffea,0x000c,0x0013,
-0x0006,0x001c,0x0000,0x001d,0x0012,0x0003,0xfff5,0xffef,
-0x000a,0xffee,0x000a,0xfff9,0x001b,0x0012,0x000b,0x0007,
-0xfffd,0xffe4,0x002f,0x0037,0x0012,0xfff1,0xffde,0xfff0,
-0xffe1,0x0018,0x0017,0x001b,0x001d,0x0009,0x002b,0xfff8,
-0xffe6,0x0007,0xffe2,0x0011,0x0004,0xfffd,0x001a,0x0023,
-0xfffb,0x0018,0x000a,0x001c,0x0009,0xfff4,0xfffb,0xffdf,
-0xfffb,0xfff8,0xfffb,0x001d,0x001a,0x0018,0xfff7,0x0017,
-0x000e,0xfff4,0x0027,0x0034,0xfffb,0xffee,0xffd9,0xffe8,
-0x0020,0x0008,0xfffd,0x0002,0x000d,0xfffc,0x0032,0x0001,
-0x001b,0x0027,0x0017,0xffcd,0xfff1,0xffe2,0x001b,0x0025,
-0x0007,0xffff,0xffef,0xffe3,0xfffb,0x0017,0xffe7,0xfff6,
-0x000e,0xffe6,0xfff8,0xffd7,0xffff,0x0009,0x000d,0x001a,
-0x0005,0xfff4,0x000c,0x0007,0x000e,0xffd3,0x0006,0xfff7,
-0xffdc,0x001d,0x0013,0x0029,0x0022,0xffee,0x002d,0x0006,
-0xfff8,0x000a,0x0005,0xffd5,0xffe9,0xfff5,0x002a,0x0035,
-0xfffb,0xfffb,0xfffa,0xffe2,0xfff2,0x0008,0xffec,0xffe6,
-0xffff,0xfff0,0xffe7,0xfffc,0xfffd,0x000f,0xfff9,0x0029,
-0x0017,0x0003,0x0004,0x0003,0xfff8,0xffd0,0x0001,0xffef,
-0xfff9,0x000f,0x0009,0xfff7,0x001c,0xffe3,0x002d,0xfffb,
-0x0006,0x002b,0x0009,0xfff4,0xfffe,0xffdc,0x000c,0x001e,
-0x000b,0xfffd,0xffef,0xfffd,0x0022,0x0016,0xfffd,0xffe8,
-0xfff4,0xffe8,0xfffe,0xffe0,0x001c,0x0016,0x001d,0x001d,
-0xfffb,0xffce,0x0015,0x001f,0x0026,0xffe3,0xfff9,0x0005,
-0xffb4,0x0023,0x001f,0x001c,0x0031,0xffd5,0x0028,0x0000,
-0xffe3,0x000e,0xfff8,0xfffb,0xfff6,0xffee,0x001a,0x002e,
-0x0000,0xfff9,0xfffa,0xfffd,0x0019,0x0007,0x0002,0xffd8,
-0xffe4,0xfff2,0xffee,0x0003,0x001b,0x001c,0x0008,0x002d,
-0x000d,0xffde,0x000d,0x001b,0x000f,0xffe1,0xfff4,0xfffd,
-0x004a,0xffef,0x0000,0xffe1,0xffee,0x0049,0xfffb,0x0000,
-0x0003,0xfffb,0x0019,0x000c,0xfffd,0xffff,0xffea,0x0003,
-0xfff7,0x0021,0xfff4,0xffe8,0x0006,0x0002,0xffdf,0x0009,
-0x0015,0x0005,0x0014,0xffe5,0xffed,0xfff9,0xffde,0xffdb,
-0xffde,0x0016,0x002c,0x0000,0xffd7,0xffe3,0xffef,0xffeb,
-0x0005,0x0003,0x0015,0x0007,0x0002,0x003c,0xfff6,0x0005,
-0xffe0,0xffde,0x0007,0x0014,0xfff5,0x0010,0xfff8,0x0014,
-0xffeb,0x001d,0xffff,0xffe8,0xfffe,0xfff3,0xffe5,0xfffa,
-0x0005,0x000f,0x0003,0x0008,0xffeb,0xffff,0xffc9,0xffeb,
-0xfff1,0x0026,0x0025,0xfffd,0xffbf,0xffe0,0xffe9,0xffe2,
-0x0023,0xfff6,0x000b,0xffd4,0xfffd,0x0030,0xfff6,0xfffa,
-0xffef,0xfffe,0x000b,0x0033,0x0008,0xfff8,0xffda,0xfffd,
-0xfffc,0x001f,0xfff4,0x0002,0x002e,0x0001,0xfff6,0xfffc,
-0xfffb,0x0007,0x001a,0xffed,0x000a,0x0005,0xffee,0xffde,
-0xffd3,0xfff1,0x0036,0x0018,0xffee,0xfff3,0xffe1,0xfff9,
-0xffdf,0x000a,0x0022,0xfffb,0x0011,0x0023,0xfff1,0xffff,
-0xffcb,0xffe2,0xfffa,0x003b,0x0000,0x000a,0xffe8,0x000d,
-0xffef,0x001b,0xffff,0x0001,0x0025,0xfff3,0xfffc,0xffec,
-0xffec,0x0012,0x000a,0x0010,0x0008,0x000b,0xffd9,0xffee,
-0xffe6,0x0000,0x002e,0x0014,0xffd7,0xfff1,0xffdb,0xfff1,
-0x001d,0xfffb,0x0007,0xffe2,0x0001,0x0015,0xfff9,0x0007,
-0x0000,0x0000,0x002f,0xfff7,0xffee,0xfff1,0xffea,0x000e,
-0xfffc,0x0000,0xffe4,0xffc7,0x0017,0x0015,0xffe7,0x0002,
-0xffff,0x0000,0x0007,0xffcb,0xffed,0xfffd,0xffef,0xfff1,
-0xffdc,0x0000,0x0013,0xffe8,0xffeb,0xffd5,0x0009,0x0000,
-0xffd9,0x000e,0x001e,0x0008,0x0016,0x0008,0xfff4,0x000c,
-0xffde,0xffe5,0x001d,0xfffe,0xffe6,0x0002,0xfff8,0x001f,
-0xfff0,0xfffd,0xffef,0xffc7,0x000e,0x0006,0xffed,0xfff3,
-0xfff0,0x000a,0xfff8,0xffef,0xffec,0x0002,0xffda,0x0000,
-0xffef,0x0010,0x000b,0xffe5,0xffd4,0xffd3,0x0004,0xfff8,
-0xfff7,0x0001,0x0014,0xffd5,0x0011,0xfffd,0xfff4,0x0000,
-0xffec,0x0004,0x0021,0x001d,0xfffa,0xffea,0xffda,0x0007,
-0x0000,0xffff,0xffe3,0xffe2,0x003f,0x0015,0xfffd,0xfff5,
-0xffe5,0x0001,0x000e,0xffd3,0x000a,0x0009,0xffff,0xfff4,
-0xffd1,0xffdb,0x001c,0x0000,0x0002,0xffe6,0xfffc,0x000d,
-0xffb2,0x0015,0x002b,0xfffc,0x0026,0xffef,0xffef,0x0005,
-0xffc9,0xffe8,0x000f,0x0024,0xfff2,0xfffc,0xffe8,0x0018,
-0xfff4,0xfffb,0xffef,0xffe1,0x0036,0x0005,0x0002,0xffe5,
-0xffd5,0x000c,0xfffe,0xfff7,0x0009,0x000f,0xffea,0x0003,
-0xffe4,0xffeb,0x0014,0xfffd,0xffec,0xffe4,0xfff7,0x0005,
-0x0050,0xfffa,0x0010,0xfff5,0xffe2,0x001e,0x0009,0x001c,
-0x001c,0x001d,0x000d,0xfffa,0x0002,0xffe4,0x0003,0x0005,
-0x0007,0x003c,0xfffb,0xfff7,0xfff5,0x0001,0xffe8,0xffed,
-0x001b,0xfff3,0x0020,0xfff3,0xfff1,0xffed,0xffed,0xffdd,
-0xffef,0x0027,0x002b,0x0009,0xfffc,0xffd6,0xffe0,0xffd7,
-0x000b,0x000e,0x0027,0x001b,0xfff7,0x0011,0x0004,0x0021,
-0xfffa,0x0000,0xfffc,0x0001,0xfffb,0xfff6,0x0011,0x0016,
-0xfffb,0x0039,0x0005,0xfff7,0xffec,0xfff3,0xffee,0xffdd,
-0x000b,0xfffd,0x0010,0x0016,0xffef,0xfff3,0xffd8,0xffed,
-0x0001,0x0037,0x0023,0x0005,0xffe5,0xffd4,0xffdb,0xffcf,
-0x0028,0x0000,0x001c,0xffe8,0xfff2,0x0005,0x0004,0x0015,
-0x0007,0x0021,0x0000,0x0020,0x000f,0xffdd,0xfff4,0xffff,
-0x000b,0x003a,0xfffb,0x0010,0x001c,0x0000,0xffff,0xffdf,
-0x0000,0xfff5,0x0027,0xfffb,0x000e,0xfffa,0xfffd,0xffe1,
-0xffe4,0x0001,0x0035,0x0021,0x0013,0xffe7,0xffd2,0xffe6,
-0xffe4,0x0014,0x0033,0x000e,0x0006,0xfff9,0x0000,0x001a,
-0xffe5,0x0004,0xffee,0x0028,0x0006,0xfff0,0x0001,0x000f,
-0x0000,0x0037,0x0005,0x0010,0x0013,0xfff2,0x0003,0xffcf,
-0xfff2,0xffff,0x0016,0x001e,0x000c,0x0000,0xffe8,0xfff1,
-0xfff7,0x0011,0x002d,0x001d,0xfffc,0xffe4,0xffcd,0xffdd,
-0x0022,0x0004,0x0019,0xfff6,0xfff7,0xffeb,0x0007,0x0024,
-0x001a,0x0024,0x0023,0xffe4,0xfff4,0xffd6,0x0003,0x0010,
-0x000c,0x001c,0xffeb,0xffd6,0x0005,0x0015,0xfff0,0xffe6,
-0x0004,0xffed,0x0013,0xffd9,0xfff1,0xfff1,0xffff,0xfff3,
-0xffed,0x0011,0x0011,0xfff2,0x000f,0xffc9,0xfffc,0xffed,
-0xffde,0x0019,0x0030,0x001c,0x000b,0xffde,0x0002,0x0029,
-0xfff7,0x0007,0x0011,0xffeb,0xffec,0xffe8,0x0011,0x0021,
-0x0000,0x0018,0xfff6,0xffd6,0xfffd,0x0005,0xfff6,0xffd6,
-0xfff5,0xfff8,0x0003,0xfffd,0xfff0,0xfff7,0xffea,0x0002,
-0x0000,0x0021,0x000a,0xffee,0xfff9,0xffc6,0xfff6,0xffe4,
-0xfffc,0x000b,0x0025,0xffe9,0x0005,0xffd2,0x0002,0x001d,
-0x0005,0x0027,0x0015,0x0009,0x0000,0xffcf,0xfff4,0x0009,
-0x0010,0x001a,0xffea,0xfff1,0x002d,0x0014,0x0005,0xffd8,
-0xffea,0xffef,0x001a,0xffe1,0x000e,0xfffe,0x000e,0xfff6,
-0xffe2,0xffec,0x001b,0x0009,0x0027,0xffd9,0xffee,0xfffb,
-0xffb7,0x0020,0x003c,0x000f,0x001a,0xffc5,0xfffe,0x0021,
-0xffe2,0x000a,0x0003,0x0011,0xfff8,0xffe2,0x0001,0x001a,
-0x0004,0x0016,0xfff6,0xfff0,0x0024,0x0005,0x000b,0xffc8,
-0xffdb,0xfffa,0x000a,0x0005,0x000d,0x0003,0xfffa,0x0005,
-0xfff5,0xfffc,0x0013,0x0005,0x0010,0xffd7,0xffe8,0xfff3};
-
-static const unsigned long ftable1[128]={
-0x4cc9f,0x482af,0x47bd8,0x44700,0x5238b,0x47377,0x4898a,0x411fd,
-0x4f8b7,0x4a7d5,0x4bd1b,0x47feb,0x5554b,0x49414,0x4c9d4,0x4403c,
-0x4fa57,0x550c5,0x4ea1c,0x54c6e,0x51f27,0x4ff8f,0x4cab5,0x4bbb6,
-0x53e58,0x5a5e8,0x5551f,0x5d6ff,0x56499,0x540f7,0x528e8,0x51740,
-0x4cdba,0x459db,0x4a644,0x4445b,0x4e123,0x423bc,0x480ed,0x3ed60,
-0x5292b,0x49d33,0x51d8c,0x49f1d,0x53cc4,0x45a9d,0x4e88c,0x43073,
-0x4d3a1,0x4e583,0x4f702,0x5182e,0x4b81f,0x47291,0x49dc4,0x46541,
-0x5434b,0x55bc1,0x5a27e,0x5d510,0x51ba0,0x4c587,0x51f83,0x4d45f,
-0x4d45f,0x51f83,0x4c587,0x51ba0,0x5d510,0x5a27e,0x55bc1,0x5434b,
-0x46541,0x49dc4,0x47291,0x4b81f,0x5182e,0x4f702,0x4e583,0x4d3a1,
-0x43073,0x4e88c,0x45a9d,0x53cc4,0x49f1d,0x51d8c,0x49d33,0x5292b,
-0x3ed60,0x480ed,0x423bc,0x4e123,0x4445b,0x4a644,0x459db,0x4cdba,
-0x51740,0x528e8,0x540f7,0x56499,0x5d6ff,0x5551f,0x5a5e8,0x53e58,
-0x4bbb6,0x4cab5,0x4ff8f,0x51f27,0x54c6e,0x4ea1c,0x550c5,0x4fa57,
-0x4403c,0x4c9d4,0x49414,0x5554b,0x47feb,0x4bd1b,0x4a7d5,0x4f8b7,
-0x411fd,0x4898a,0x47377,0x5238b,0x44700,0x47bd8,0x482af,0x4cc9f};
-
-static const unsigned long ftable2[128]={
-0x2f8e9,0x3444d,0x3637b,0x3608d,0x3372e,0x33ab9,0x33946,0x2f157,
-0x307a1,0x36a4d,0x380c9,0x39279,0x332c0,0x34673,0x33a8a,0x2fec4,
-0x2ecea,0x36011,0x34bb0,0x37829,0x36353,0x39c4a,0x35f32,0x33352,
-0x2cb99,0x33db5,0x3221f,0x3595c,0x31b84,0x35804,0x31d79,0x3075f,
-0x27f6f,0x2f99d,0x2d6c9,0x3369b,0x2df25,0x34928,0x3018c,0x32129,
-0x28cb2,0x31e5c,0x2eebd,0x36c4e,0x2e2a3,0x3601f,0x30a58,0x33aa8,
-0x28cee,0x336a2,0x2e69d,0x37dcd,0x323b6,0x3fa08,0x34b2d,0x3acd3,
-0x27abc,0x3214b,0x2cff6,0x3695f,0x2f09d,0x3ae92,0x315ba,0x37761,
-0x37761,0x315ba,0x3ae92,0x2f09d,0x3695f,0x2cff6,0x3214b,0x27abc,
-0x3acd3,0x34b2d,0x3fa08,0x323b6,0x37dcd,0x2e69d,0x336a2,0x28cee,
-0x33aa8,0x30a58,0x3601f,0x2e2a3,0x36c4e,0x2eebd,0x31e5c,0x28cb2,
-0x32129,0x3018c,0x34928,0x2df25,0x3369b,0x2d6c9,0x2f99d,0x27f6f,
-0x3075f,0x31d79,0x35804,0x31b84,0x3595c,0x3221f,0x33db5,0x2cb99,
-0x33352,0x35f32,0x39c4a,0x36353,0x37829,0x34bb0,0x36011,0x2ecea,
-0x2fec4,0x33a8a,0x34673,0x332c0,0x39279,0x380c9,0x36a4d,0x307a1,
-0x2f157,0x33946,0x33ab9,0x3372e,0x3608d,0x3637b,0x3444d,0x2f8e9};
-
-static const short decodetable1[63]={
-0x0000,0x0006,0x0010,0x0012,0x0014,0x0017,0x0019,0x001d,
-0x0020,0x0024,0x0029,0x002e,0x0033,0x0039,0x0041,0x0049,
-0x0051,0x005b,0x0067,0x0073,0x0081,0x0091,0x00a3,0x00b7,
-0x00cd,0x00e6,0x0103,0x0122,0x0146,0x016d,0x019a,0x01cc,
-0x0204,0x0243,0x028a,0x02da,0x0333,0x0397,0x0407,0x0485,
-0x0512,0x05b0,0x0662,0x0729,0x0809,0x0904,0x0a1e,0x0b5a,
-0x0cbd,0x0e4b,0x1009,0x11fe,0x1430,0x16a7,0x196b,0x1c85,
-0x2000,0x23e7,0x2849,0x2d33,0x32b7,0x38e7,0x3fd9};
-
-static const short decodetable2[127]={
-0xf037,0xf043,0xf04e,0xf058,0xf062,0xf06c,0xf077,0xf082,
-0xf08e,0xf09a,0xf0a6,0xf0b2,0xf0be,0xf0cc,0xf0d9,0xf0e6,
-0xf0f4,0xf101,0xf10f,0xf11e,0xf12d,0xf13d,0xf14c,0xf15c,
-0xf16d,0xf17d,0xf18d,0xf19d,0xf1ae,0xf1bf,0xf1d1,0xf1e3,
-0xf1f6,0xf20a,0xf21d,0xf232,0xf247,0xf25d,0xf274,0xf28c,
-0xf2a4,0xf2bc,0xf2d4,0xf2ee,0xf307,0xf321,0xf33c,0xf358,
-0xf374,0xf391,0xf3af,0xf3ce,0xf3ee,0xf410,0xf433,0xf459,
-0xf480,0xf4a9,0xf4d1,0xf4ff,0xf52c,0xf55c,0xf58c,0xf5c4,
-0xf5fb,0xf637,0xf673,0xf6ad,0xf6e8,0xf727,0xf766,0xf7a7,
-0xf7e8,0xf82a,0xf86b,0xf8ae,0xf8f0,0xf93a,0xf984,0xf9d0,
-0xfa1c,0xfa6c,0xfabc,0xfb0d,0xfb5f,0xfbbe,0xfc1e,0xfc80,
-0xfce2,0xfd45,0xfda8,0xfe19,0xfe8a,0xff0e,0xff92,0x0015,
-0x0098,0x012c,0x01bf,0x0248,0x02d0,0x0353,0x03d6,0x0451,
-0x04cd,0x053e,0x05b0,0x0621,0x0692,0x0707,0x077c,0x07e7,
-0x0852,0x08c2,0x0931,0x09aa,0x0a23,0x0aa4,0x0b25,0x0baa,
-0x0c2e,0x0ca8,0x0d23,0x0d93,0x0e04,0x0e75,0x0ee6};
-
-static const short decodetable3[63]={
-0xf3ed,0xf54d,0xf6ae,0xf7af,0xf8b1,0xf990,0xfa6f,0xfb39,
-0xfc03,0xfcbd,0xfd77,0xfe1d,0xfec4,0xff58,0xffec,0x007b,
-0x010b,0x0196,0x0220,0x02a5,0x032a,0x03a9,0x0429,0x04a1,
-0x0519,0x058c,0x05fe,0x066d,0x06dc,0x0747,0x07b2,0x0817,
-0x087b,0x08d9,0x0937,0x0990,0x09e8,0x0a3a,0x0a8c,0x0ad9,
-0x0b26,0x0b6d,0x0bb4,0x0bf8,0x0c3d,0x0c7e,0x0cbf,0x0cfc,
-0x0d3a,0x0d72,0x0dab,0x0ddf,0x0e13,0x0e44,0x0e75,0x0ea1,
-0x0ecd,0x0ef5,0x0f1e,0x0f44,0x0f6b,0x0f8f,0x0fb4};
-
-static const short decodetable4[63]={
-0xf23b,0xf2ae,0xf321,0xf38c,0xf3f7,0xf457,0xf4b6,0xf517,
-0xf578,0xf5d5,0xf631,0xf68d,0xf6e8,0xf742,0xf79b,0xf7f0,
-0xf845,0xf896,0xf8e7,0xf937,0xf986,0xf9d6,0xfa26,0xfa74,
-0xfac3,0xfb0f,0xfb5c,0xfbaa,0xfbf8,0xfc46,0xfc94,0xfce2,
-0xfd2f,0xfd7f,0xfdcf,0xfe22,0xfe76,0xfec9,0xff1c,0xff73,
-0xffca,0x0020,0x0077,0x00d0,0x0128,0x0186,0x01e4,0x0248,
-0x02ab,0x0315,0x037f,0x03f1,0x0463,0x04e0,0x055d,0x05e8,
-0x0673,0x0710,0x07ad,0x0872,0x0938,0x0a2f,0x0b26};
-
-static const short decodetable5[31]={
-0xf8cb,0xfa55,0xfbdf,0xfcea,0xfdf6,0xfed4,0xffb3,0x006f,
-0x012d,0x01da,0x0287,0x032b,0x03cf,0x046a,0x0505,0x059a,
-0x062e,0x06bf,0x0751,0x07e2,0x0873,0x0904,0x0994,0x0a22,
-0x0aaf,0x0b3c,0x0bc9,0x0c56,0x0ce3,0x0d6a,0x0df1};
-
-static const short decodetable6[31]={
-0xf57d,0xf679,0xf775,0xf83d,0xf904,0xf9b5,0xfa65,0xfb04,
-0xfba2,0xfc2f,0xfcbb,0xfd40,0xfdc5,0xfe44,0xfec4,0xff44,
-0xffc5,0x0047,0x00c9,0x0150,0x01d6,0x0266,0x02f7,0x0396,
-0x0435,0x04f3,0x05b1,0x0692,0x0774,0x0899,0x09bf};
-
-static const short decodetable7[15]={
-0xfaa4,0xfc65,0xfe26,0xff56,0x0085,0x017f,0x0278,0x0362,
-0x044c,0x0537,0x0623,0x071f,0x081b,0x0946,0x0a70};
-
-static const short decodetable8[15]={
-0xf6ab,0xf7d8,0xf905,0xfa1b,0xfb31,0xfc32,0xfd33,0xfe22,
-0xff11,0xfffe,0x00ea,0x01f6,0x0302,0x0462,0x05c2};
-
-static const short decodetable9[15]={
-0xf9df,0xfb3f,0xfca0,0xfdbc,0xfed8,0xffd1,0x00c8,0x01b3,
-0x029e,0x038f,0x047f,0x0596,0x06ad,0x07ff,0x0951};
-
-static const short decodetable10[15]={
-0xf768,0xf890,0xf9b8,0xfac9,0xfbda,0xfcd0,0xfdc7,0xfea8,
-0xff88,0x006c,0x0152,0x0258,0x035f,0x04da,0x0655};
-
-static const short decodetable11[7]={
-0xfd97,0xff2b,0x00be,0x01f0,0x0322,0x0476,0x05cb};
-
-static const short *decodetable[11]={
-decodetable1,decodetable2,decodetable3,decodetable4,decodetable5,
-decodetable6,decodetable7,decodetable8,decodetable9,decodetable10,
-decodetable11};
-
-#endif /* RA144TABLES_H */
diff --git a/src/libffmpeg/libavcodec/ra288.c b/src/libffmpeg/libavcodec/ra288.c
deleted file mode 100644
index 9ba5209ab..000000000
--- a/src/libffmpeg/libavcodec/ra288.c
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * RealAudio 2.0 (28.8K)
- * Copyright (c) 2003 the ffmpeg project
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "ra288.h"
-
-typedef struct {
- float history[8];
- float output[40];
- float pr1[36];
- float pr2[10];
- int phase, phasep;
-
- float st1a[111],st1b[37],st1[37];
- float st2a[38],st2b[11],st2[11];
- float sb[41];
- float lhist[10];
-} Real288_internal;
-
-static int ra288_decode_init(AVCodecContext * avctx)
-{
- Real288_internal *glob=avctx->priv_data;
- memset(glob,0,sizeof(Real288_internal));
- return 0;
-}
-
-static void prodsum(float *tgt, float *src, int len, int n);
-static void co(int n, int i, int j, float *in, float *out, float *st1, float *st2, const float *table);
-static int pred(float *in, float *tgt, int n);
-static void colmult(float *tgt, float *m1, const float *m2, int n);
-
-
-/* initial decode */
-static void unpack(unsigned short *tgt, unsigned char *src, unsigned int len)
-{
- int x,y,z;
- int n,temp;
- int buffer[len];
-
- for (x=0;x<len;tgt[x++]=0)
- buffer[x]=9+(x&1);
-
- for (x=y=z=0;x<len/*was 38*/;x++) {
- n=buffer[y]-z;
- temp=src[x];
- if (n<8) temp&=255>>(8-n);
- tgt[y]+=temp<<z;
- if (n<=8) {
- tgt[++y]+=src[x]>>n;
- z=8-n;
- } else z+=8;
- }
-}
-
-static void update(Real288_internal *glob)
-{
- int x,y;
- float buffer1[40],temp1[37];
- float buffer2[8],temp2[11];
-
- for (x=0,y=glob->phasep+5;x<40;buffer1[x++]=glob->output[(y++)%40]);
- co(36,40,35,buffer1,temp1,glob->st1a,glob->st1b,table1);
- if (pred(temp1,glob->st1,36))
- colmult(glob->pr1,glob->st1,table1a,36);
-
- for (x=0,y=glob->phase+1;x<8;buffer2[x++]=glob->history[(y++)%8]);
- co(10,8,20,buffer2,temp2,glob->st2a,glob->st2b,table2);
- if (pred(temp2,glob->st2,10))
- colmult(glob->pr2,glob->st2,table2a,10);
-}
-
-/* Decode and produce output */
-static void decode(Real288_internal *glob, unsigned int input)
-{
- unsigned int x,y;
- float f;
- double sum,sumsum;
- float *p1,*p2;
- float buffer[5];
- const float *table;
-
- for (x=36;x--;glob->sb[x+5]=glob->sb[x]);
- for (x=5;x--;) {
- p1=glob->sb+x;p2=glob->pr1;
- for (sum=0,y=36;y--;sum-=(*(++p1))*(*(p2++)));
- glob->sb[x]=sum;
- }
-
- f=amptable[input&7];
- table=codetable+(input>>3)*5;
-
- /* convert log and do rms */
- for (sum=32,x=10;x--;sum-=glob->pr2[x]*glob->lhist[x]);
- if (sum<0) sum=0; else if (sum>60) sum=60;
-
- sumsum=exp(sum*0.1151292546497)*f; /* pow(10.0,sum/20)*f */
- for (sum=0,x=5;x--;) { buffer[x]=table[x]*sumsum; sum+=buffer[x]*buffer[x]; }
- if ((sum/=5)<1) sum=1;
-
- /* shift and store */
- for (x=10;--x;glob->lhist[x]=glob->lhist[x-1]);
- *glob->lhist=glob->history[glob->phase]=10*log10(sum)-32;
-
- for (x=1;x<5;x++) for (y=x;y--;buffer[x]-=glob->pr1[x-y-1]*buffer[y]);
-
- /* output */
- for (x=0;x<5;x++) {
- f=glob->sb[4-x]+buffer[x];
- if (f>4095) f=4095; else if (f<-4095) f=-4095;
- glob->output[glob->phasep+x]=glob->sb[4-x]=f;
- }
-}
-
-/* column multiply */
-static void colmult(float *tgt, float *m1, const float *m2, int n)
-{
- while (n--)
- *(tgt++)=(*(m1++))*(*(m2++));
-}
-
-static int pred(float *in, float *tgt, int n)
-{
- int x,y;
- float *p1,*p2;
- double f0,f1,f2;
- float temp;
-
- if (in[n]==0) return 0;
- if ((f0=*in)<=0) return 0;
-
- for (x=1;;x++) {
- if (n<x) return 1;
-
- p1=in+x;
- p2=tgt;
- f1=*(p1--);
- for (y=x;--y;f1+=(*(p1--))*(*(p2++)));
-
- p1=tgt+x-1;
- p2=tgt;
- *(p1--)=f2=-f1/f0;
- for (y=x>>1;y--;) {
- temp=*p2+*p1*f2;
- *(p1--)+=*p2*f2;
- *(p2++)=temp;
- }
- if ((f0+=f1*f2)<0) return 0;
- }
-}
-
-static void co(int n, int i, int j, float *in, float *out, float *st1, float *st2, const float *table)
-{
- int a,b,c;
- unsigned int x;
- float *fp;
- float buffer1[37];
- float buffer2[37];
- float work[111];
-
- /* rotate and multiply */
- c=(b=(a=n+i)+j)-i;
- fp=st1+i;
- for (x=0;x<b;x++) {
- if (x==c) fp=in;
- work[x]=*(table++)*(*(st1++)=*(fp++));
- }
-
- prodsum(buffer1,work+n,i,n);
- prodsum(buffer2,work+a,j,n);
-
- for (x=0;x<=n;x++) {
- *st2=*st2*(0.5625)+buffer1[x];
- out[x]=*(st2++)+buffer2[x];
- }
- *out*=1.00390625; /* to prevent clipping */
-}
-
-/* product sum (lsf) */
-static void prodsum(float *tgt, float *src, int len, int n)
-{
- unsigned int x;
- float *p1,*p2;
- double sum;
-
- while (n>=0)
- {
- p1=(p2=src)-n;
- for (sum=0,x=len;x--;sum+=(*p1++)*(*p2++));
- tgt[n--]=sum;
- }
-}
-
-static void * decode_block(AVCodecContext * avctx, unsigned char *in, signed short int *out,unsigned len)
-{
- int x,y;
- Real288_internal *glob=avctx->priv_data;
- unsigned short int buffer[len];
-
- unpack(buffer,in,len);
- for (x=0;x<32;x++)
- {
- glob->phasep=(glob->phase=x&7)*5;
- decode(glob,buffer[x]);
- for (y=0;y<5;*(out++)=8*glob->output[glob->phasep+(y++)]);
- if (glob->phase==3) update(glob);
- }
- return out;
-}
-
-/* Decode a block (celp) */
-static int ra288_decode_frame(AVCodecContext * avctx,
- void *data, int *data_size,
- uint8_t * buf, int buf_size)
-{
- void *datao;
-
- if (buf_size < avctx->block_align)
- {
- av_log(avctx, AV_LOG_ERROR, "ffra288: Error! Input buffer is too small [%d<%d]\n",buf_size,avctx->block_align);
- return 0;
- }
-
- datao = data;
- data = decode_block(avctx, buf, (signed short *)data, avctx->block_align);
-
- *data_size = (char *)data - (char *)datao;
- return avctx->block_align;
-}
-
-AVCodec ra_288_decoder =
-{
- "real_288",
- CODEC_TYPE_AUDIO,
- CODEC_ID_RA_288,
- sizeof(Real288_internal),
- ra288_decode_init,
- NULL,
- NULL,
- ra288_decode_frame,
-};
diff --git a/src/libffmpeg/libavcodec/ra288.h b/src/libffmpeg/libavcodec/ra288.h
deleted file mode 100644
index 8cc290397..000000000
--- a/src/libffmpeg/libavcodec/ra288.h
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * RealAudio 2.0 (28.8K)
- * Copyright (c) 2003 the ffmpeg project
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef RA288TABLES_H
-#define RA288TABLES_H
-
-static const float amptable[8]={ 0.515625, 0.90234375, 1.57910156, 2.76342773,
- -0.515625,-0.90234375,-1.57910156,-2.76342773 };
-
-static const float codetable[640]={
- 0.326171875, -1.4404296875, -0.6123046875, -0.8740234375, -1.24658203125,
- -2.45703125, -2.23486328125, -0.51025390625, 1.419921875, 1.6201171875,
- -1.37646484375, -1.30712890625, -0.462890625, -1.37939453125, -2.1728515625,
- -3.26123046875, -0.166015625, 0.7236328125, -0.623046875, 0.6162109375,
- -0.2744140625, -3.29931640625, 0.62548828125, 0.08740234375, -0.6220703125,
- -1.2265625, -3.4814453125, -2.40478515625, 3.37548828125, 1.17724609375,
- -1.2099609375, -0.076171875, 2.28662109375, -1.89111328125, 0,
- -4.0078125, 1.044921875, -0.2333984375, -1.35986328125, 0.26025390625,
- 0.92236328125, 1.34716796875, 0.67431640625, -3.39599609375, -2.88720703125,
- 2.4814453125, -1.201171875, -2.8212890625, 0.87744140625, 0.27734375,
- -1.078125, -1.61572265625, -2.20849609375, -3.044921875, -3.66455078125,
- -1.32763671875, 2.1279296875, -1.458984375, -0.56103515625, 1.30078125,
- 0.61474609375, 0.48583984375, 1.32373046875, -1.203125, -5.0732421875,
- 0.8408203125, -3.69580078125, -1.3388671875, 1.06005859375, -1.13720703125,
- 0.50390625, 0.36474609375, -0.4189453125, -3.8798828125, -6.27099609375,
- 1.5166015625, 2.37109375, -2.04736328125, -1.24072265625, 0.50537109375,
- 0.9091796875, -0.46875, -3.236328125, 0.2001953125, 2.8720703125,
- -1.21728515625, -1.283203125, -1.953125, -0.029296875, 3.5166015625,
- -1.3046875, 0.7060546875, 0.75, -1.87060546875, 0.60205078125,
- -2.5888671875, 3.375, 0.77587890625, -2.04443359375, 1.78955078125,
- -1.6875, -3.9892578125, -3.76416015625, 0.67578125, 2.2939453125,
- -2.29443359375, -3.03173828125, -5.45703125, 3.95703125, 8.2177734375,
- 0.4541015625, 3.419921875, 0.61962890625, -4.38330078125, 1.25341796875,
- 2.27001953125, 5.763671875, 1.68017578125, -2.76220703125, 0.58544921875,
- 1.2412109375, -0.08935546875, -4.32568359375, -3.89453125, 1.5771484375,
- -1.40234375, -0.98193359375, -4.74267578125, -4.09423828125, 6.33935546875,
- 1.5068359375, 1.044921875, -1.796875, -4.70849609375, -1.4140625,
- -3.71533203125, 3.18115234375, -1.11474609375, -1.2314453125, 3.091796875,
- -1.62744140625, -2.744140625, -4.4580078125, -5.43505859375, 2.70654296875,
- -0.19873046875, -3.28173828125, -8.5283203125, -1.41064453125, 5.6484375,
- 1.802734375, 3.318359375, -0.1279296875, -5.2958984375, -0.90625,
- 3.55224609375, 6.544921875, -1.45947265625, -5.17333984375, 2.41015625,
- 0.119140625, -1.08349609375, 1.296875, 1.84375, -2.642578125,
- -1.97412109375, -2.8974609375, 1.04052734375, 0.42138671875, -1.3994140625,
- -1.6123046875, 0.85107421875, -0.9794921875, -0.0625, -1.001953125,
- -3.10595703125, 1.6318359375, -0.77294921875, -0.01025390625, 0.5576171875,
- -1.87353515625, -0.89404296875, 3.12353515625, 1.24267578125, -1.390625,
- -4.556640625, -3.1875, 2.59228515625, 0.9697265625, -1.09619140625,
- -2.1923828125, 0.365234375, 0.94482421875, -1.47802734375, -0.24072265625,
- -4.51904296875, 2.6201171875, 1.55908203125, -2.19384765625, 0.87109375,
- 2.3359375, -0.1806640625, 0.9111328125, 0.51611328125, -0.92236328125,
- 3.5849609375, -1.3134765625, -1.25830078125, 0.330078125, -0.29833984375,
- -0.2451171875, 1.09130859375, -0.9033203125, -0.86767578125, -1.00048828125,
- 0.49365234375, 1.89453125, -1.20361328125, 1.07861328125, -0.07421875,
- 1.265625, 1.38134765625, 2.728515625, 1.38623046875, -3.5673828125,
- -1.48876953125, -2.4013671875, 2.90771484375, 4.49267578125, -2.17138671875,
- 0.34033203125, 1.908203125, 2.8310546875, -2.17333984375, -2.267578125,
- -1.03564453125, 2.658203125, -1.2548828125, 0.15673828125, -0.5869140625,
- 1.3896484375, -1.0185546875, 1.724609375, 0.2763671875, -0.345703125,
- -2.08935546875, 0.4638671875, 2.431640625, 1.83056640625, 0.220703125,
- -1.212890625, 1.7099609375, 0.83935546875, -0.0830078125, 0.1162109375,
- -1.67724609375, 0.12841796875, 1.0322265625, -0.97900390625, 1.15283203125,
- -3.5830078125, -0.58984375, 4.56396484375, -0.59375, -1.95947265625,
- -6.5908203125, -0.21435546875, 3.919921875, -2.06640625, 0.17626953125,
- -1.82080078125, 2.65283203125, 0.978515625, -2.30810546875, -0.61474609375,
- -1.9462890625, 3.78076171875, 4.11572265625, -1.80224609375, -0.48193359375,
- 2.5380859375, -0.20654296875, 0.5615234375, -0.62548828125, 0.3984375,
- 3.61767578125, 2.00634765625, -1.92822265625, 1.3134765625, 0.0146484384313,
- 0.6083984375, 1.49169921875, -0.01708984375, -0.6689453125, -0.1201171875,
- -0.72705078125, 2.75146484375, -0.3310546875, -1.28271484375, 1.5478515625,
- 2.3583984375, -2.23876953125, 0.98046875, -0.5185546875, 0.39013671875,
- -0.06298828125, 0.35009765625, 2.2431640625, 7.29345703125, 5.2275390625,
- 0.20361328125, 1.34716796875, 0.9033203125, -2.46923828125, -0.56298828125,
- -1.89794921875, 3.59423828125, -2.81640625, 2.09228515625, 0.3251953125,
- 0.70458984375, -0.4580078125, 0.009765625, -1.03466796875, -0.82861328125,
- -1.8125, -1.6611328125, -1.080078125, 0.0537109375, 1.04296875,
- -1.44140625, 0.005859375, -0.765625, -1.708984375, -0.90576171875,
- -0.64208984375, -0.84521484375, 0.56640625, -0.2724609375, 0.83447265625,
- 0.04296875, -2.23095703125, 0.0947265625, -0.2216796875, -1.44384765625,
- -1.38623046875, -0.8134765625, -0.13330078125, 1.017578125, -0.07568359375,
- -0.09228515625, -1.16015625, 0.81201171875, -0.5078125, -1.19580078125,
- -1.3876953125, -0.66845703125, 0.310546875, -0.12109375, -1.30712890625,
- 0.74072265625, 0.03857421875, -1.47119140625, -1.79150390625, -0.47509765625,
- 0.93408203125, -1.21728515625, -2.59375, -0.36572265625, 0.62060546875,
- -1.41748046875, -1.623046875, -1.833984375, -1.8017578125, -0.89306640625,
- -1.42236328125, -0.75537109375, -1.34765625, -0.6865234375, 0.548828125,
- 0.900390625, -0.8955078125, 0.22265625, 0.3447265625, -2.0859375,
- 0.22802734375, -2.078125, -0.93212890625, 0.74267578125, 0.5537109375,
- -0.06201171875, -0.4853515625, -0.31103515625, -0.72802734375, -3.1708984375,
- 0.42626953125, -0.99853515625, -1.869140625, -1.36328125, -0.2822265625,
- 1.12841796875, -0.88720703125, 1.28515625, -1.490234375, 0.9609375,
- 0.31298828125, 0.5830078125, 0.92431640625, 2.00537109375, 3.0966796875,
- -0.02197265625, 0.5849609375, 1.0546875, -0.70751953125, 1.07568359375,
- -0.978515625, 0.83642578125, 1.7177734375, 1.294921875, 2.07568359375,
- 1.43359375, -1.9375, 0.625, 0.06396484375, -0.720703125,
- 1.38037109375, 0.00390625, -0.94140625, 1.2978515625, 1.71533203125,
- 1.56201171875, -0.3984375, 1.31201171875, -0.85009765625, -0.68701171875,
- 1.439453125, 1.96728515625, 0.1923828125, -0.12353515625, 0.6337890625,
- 2.0927734375, 0.02490234375, -2.20068359375, -0.015625, -0.32177734375,
- 1.90576171875, 2.7568359375, -2.728515625, -1.265625, 2.78662109375,
- -0.2958984375, 0.6025390625, -0.78466796875, -2.53271484375, 0.32421875,
- -0.25634765625, 1.767578125, -1.0703125, -1.23388671875, 0.83349609375,
- 2.09814453125, -1.58740234375, -1.11474609375, 0.396484375, -1.10546875,
- 2.81494140625, 0.2578125, -1.60498046875, 0.66015625, 0.81640625,
- 1.33544921875, 0.60595703125, -0.53857421875, -1.59814453125, -1.66357421875,
- 1.96923828125, 0.8046875, -1.44775390625, -0.5732421875, 0.705078125,
- 0.0361328125, 0.4482421875, 0.97607421875, 0.44677734375, -0.5009765625,
- -1.21875, -0.78369140625, 0.9931640625, 1.4404296875, 0.11181640625,
- -1.05859375, 0.99462890625, 0.00732421921566,-0.6171875, -0.1015625,
- -1.734375, 0.7470703125, 0.28369140625, 0.72802734375, 0.4697265625,
- -1.27587890625, -1.1416015625, 1.76806640625, -0.7265625, -1.06689453125,
- -0.85302734375, 0.03955078125, 2.7041015625, 0.69921875, -1.10205078125,
- -0.49755859375, 0.42333984375, 0.1044921875, -1.115234375, -0.7373046875,
- -0.822265625, 1.375, -0.11181640625, 1.24560546875, -0.67822265625,
- 1.32177734375, 0.24609375, 0.23388671875, 1.35888671875, -0.49267578125,
- 1.22900390625, -0.72607421875, -0.779296875, 0.30322265625, 0.94189453125,
- -0.072265625, 1.0771484375, -2.09375, 0.630859375, -0.68408203125,
- -0.25732421875, 0.60693359375, -1.33349609375, 0.93212890625, 0.625,
- 1.04931640625, -0.73291015625, 1.80078125, 0.2978515625, -2.24169921875,
- 1.6142578125, -1.64501953125, 0.91552734375, 1.775390625, -0.59423828125,
- 1.2568359375, 1.22705078125, 0.70751953125, -1.5009765625, -2.43115234375,
- 0.3974609375, 0.8916015625, -1.21923828125, 2.0673828125, -1.99072265625,
- 0.8125, -0.107421875, 1.6689453125, 0.4892578125, 0.54443359375,
- 0.38134765625, 0.8095703125, 1.91357421875, 2.9931640625, 1.533203125,
- 0.560546875, 1.98486328125, 0.740234375, 0.39794921875, 0.09716796875,
- 0.58154296875, 1.21533203125, 1.25048828125, 1.18212890625, 1.19287109375,
- 0.3759765625, -2.88818359375, 2.69287109375, -0.1796875, -1.56201171875,
- 0.5810546875, 0.51123046875, 1.8271484375, 3.38232421875, -1.02001953125,
- 0.142578125, 1.51318359375, 2.103515625, -0.3701171875, -1.19873046875,
- 0.25537109375, 1.91455078125, 1.974609375, 0.6767578125, 0.04150390625,
- 2.13232421875, 0.4912109375, -0.611328125, -0.7158203125, -0.67529296875,
- 1.880859375, 0.77099609375, -0.03759765625, 1.0078125, 0.423828125,
- 2.49462890625, 1.42529296875, -0.0986328125, 0.17529296875, -0.24853515625,
- 1.7822265625, 1.5654296875, 1.12451171875, 0.82666015625, 0.6328125,
- 1.41845703125, -1.90771484375, 0.11181640625, -0.583984375, -1.138671875,
- 2.91845703125, -1.75048828125, 0.39306640625, 1.86767578125, -1.5322265625,
- 1.8291015625, -0.2958984375, 0.02587890625, -0.13134765625, -1.61181640625,
- 0.2958984375, 0.9853515625, -0.642578125, 1.984375, 0.1943359375
-};
-
-static const float table1[111]={
- 0.576690972, 0.580838025, 0.585013986, 0.589219987, 0.59345597, 0.597723007,
- 0.602020264, 0.606384277, 0.610748291, 0.615142822, 0.619598389, 0.624084473,
- 0.628570557, 0.633117676, 0.637695313, 0.642272949, 0.646911621, 0.651580811,
- 0.656280518, 0.66104126, 0.665802002, 0.670593262, 0.675445557, 0.680328369,
- 0.685241699, 0.690185547, 0.695159912, 0.700164795, 0.705230713, 0.710327148,
- 0.715454102, 0.720611572, 0.725830078, 0.731048584, 0.736328125, 0.741638184,
- 0.747009277, 0.752380371, 0.7578125, 0.763305664, 0.768798828, 0.774353027,
- 0.779937744, 0.785583496, 0.791229248, 0.796936035, 0.802703857, 0.808502197,
- 0.814331055, 0.820220947, 0.826141357, 0.832092285, 0.838104248, 0.844146729,
- 0.850250244, 0.856384277, 0.862548828, 0.868774414, 0.875061035, 0.881378174,
- 0.88772583, 0.894134521, 0.900604248, 0.907104492, 0.913635254, 0.920227051,
- 0.926879883, 0.933563232, 0.940307617, 0.94708252, 0.953918457, 0.96081543,
- 0.96774292, 0.974731445, 0.981781006, 0.988861084, 0.994842529, 0.998565674,
- 0.999969482, 0.99911499, 0.996002197, 0.990600586, 0.982910156, 0.973022461,
- 0.960876465, 0.946533203, 0.930053711, 0.911437988, 0.89074707, 0.868041992,
- 0.843322754, 0.816680908, 0.788208008, 0.757904053, 0.725891113, 0.692199707,
- 0.656921387, 0.620178223, 0.582000732, 0.542480469, 0.501739502, 0.459838867,
- 0.416900635, 0.373016357, 0.328277588, 0.282775879, 0.236663818, 0.189971924,
- 0.142852783, 0.0954284668, 0.0477600098
-};
-
-static const float table2[38]={
- 0.505699992, 0.524200022, 0.54339999, 0.563300014, 0.583953857, 0.60534668,
- 0.627502441, 0.650482178, 0.674316406, 0.699005127, 0.724578857, 0.75112915,
- 0.778625488, 0.807128906, 0.836669922, 0.86730957, 0.899078369, 0.932006836,
- 0.961486816, 0.982757568, 0.995635986, 1, 0.995819092, 0.983154297,
- 0.96206665, 0.932769775, 0.895507813, 0.850585938, 0.798400879, 0.739379883,
- 0.674072266, 0.602996826, 0.526763916, 0.446014404, 0.361480713, 0.273834229,
- 0.183868408, 0.0923461914
-};
-
-static const float table1a[36]={
- 0.98828125, 0.976699829, 0.965254128, 0.953942537, 0.942763507, 0.931715488,
- 0.920796931, 0.910006344, 0.899342179, 0.888803005, 0.878387332, 0.868093729,
- 0.857920766, 0.847867012, 0.837931097, 0.828111589, 0.818407178, 0.808816493,
- 0.799338162, 0.789970934, 0.780713439, 0.771564424, 0.762522638, 0.753586829,
- 0.744755745, 0.736028135, 0.727402806, 0.718878567, 0.710454226, 0.702128589,
- 0.693900526, 0.685768902, 0.677732527, 0.669790328, 0.66194123, 0.654184103
-};
-
-static const float table2a[10]={
- 0.90625, 0.821289063, 0.74432373, 0.674499512, 0.61126709,
- 0.553955078, 0.50201416, 0.454956055, 0.41229248, 0.373657227
-};
-
-#endif /* RA288TABLES_H */
diff --git a/src/libffmpeg/libavcodec/rangecoder.c b/src/libffmpeg/libavcodec/rangecoder.c
deleted file mode 100644
index fcd564ace..000000000
--- a/src/libffmpeg/libavcodec/rangecoder.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Range coder
- * Copyright (c) 2004 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file rangecoder.c
- * Range coder.
- * based upon
- * "Range encoding: an algorithm for removing redundancy from a digitised
- * message.
- * G. N. N. Martin Presented in March 1979 to the Video &
- * Data Recording Conference,
- * IBM UK Scientific Center held in Southampton July 24-27 1979."
- *
- */
-
-#include <string.h>
-
-#include "avcodec.h"
-#include "common.h"
-#include "rangecoder.h"
-
-
-void ff_init_range_encoder(RangeCoder *c, uint8_t *buf, int buf_size){
- c->bytestream_start=
- c->bytestream= buf;
- c->bytestream_end= buf + buf_size;
-
- c->low= 0;
- c->range= 0xFF00;
- c->outstanding_count= 0;
- c->outstanding_byte= -1;
-}
-
-void ff_init_range_decoder(RangeCoder *c, const uint8_t *buf, int buf_size){
- /* cast to avoid compiler warning */
- ff_init_range_encoder(c, (uint8_t *) buf, buf_size);
-
- c->low =(*c->bytestream++)<<8;
- c->low+= *c->bytestream++;
-}
-
-void ff_build_rac_states(RangeCoder *c, int factor, int max_p){
- const int64_t one= 1LL<<32;
- int64_t p;
- int last_p8, p8, i;
-
- memset(c->zero_state, 0, sizeof(c->zero_state));
- memset(c-> one_state, 0, sizeof(c-> one_state));
-
- last_p8= 0;
- p= one/2;
- for(i=0; i<128; i++){
- p8= (256*p + one/2) >> 32; //FIXME try without the one
- if(p8 <= last_p8) p8= last_p8+1;
- if(last_p8 && last_p8<256 && p8<=max_p)
- c->one_state[last_p8]= p8;
-
- p+= ((one-p)*factor + one/2) >> 32;
- last_p8= p8;
- }
-
- for(i=256-max_p; i<=max_p; i++){
- if(c->one_state[i])
- continue;
-
- p= (i*one + 128) >> 8;
- p+= ((one-p)*factor + one/2) >> 32;
- p8= (256*p + one/2) >> 32; //FIXME try without the one
- if(p8 <= i) p8= i+1;
- if(p8 > max_p) p8= max_p;
- c->one_state[ i]= p8;
- }
-
- for(i=1; i<255; i++)
- c->zero_state[i]= 256-c->one_state[256-i];
-}
-
-/**
- *
- * @return the number of bytes written
- */
-int ff_rac_terminate(RangeCoder *c){
- c->range=0xFF;
- c->low +=0xFF;
- renorm_encoder(c);
- c->range=0xFF;
- renorm_encoder(c);
-
- assert(c->low == 0);
- assert(c->range >= 0x100);
-
- return c->bytestream - c->bytestream_start;
-}
-
-#if 0 //selftest
-#define SIZE 10240
-int main(){
- RangeCoder c;
- uint8_t b[9*SIZE];
- uint8_t r[9*SIZE];
- int i;
- uint8_t state[10]= {0};
-
- ff_init_range_encoder(&c, b, SIZE);
- ff_build_rac_states(&c, 0.05*(1LL<<32), 128+64+32+16);
-
- memset(state, 128, sizeof(state));
-
- for(i=0; i<SIZE; i++){
- r[i]= random()%7;
- }
-
- for(i=0; i<SIZE; i++){
-START_TIMER
- put_rac(&c, state, r[i]&1);
-STOP_TIMER("put_rac")
- }
-
- ff_put_rac_terminate(&c);
-
- ff_init_range_decoder(&c, b, SIZE);
-
- memset(state, 128, sizeof(state));
-
- for(i=0; i<SIZE; i++){
-START_TIMER
- if( (r[i]&1) != get_rac(&c, state) )
- av_log(NULL, AV_LOG_DEBUG, "rac failure at %d\n", i);
-STOP_TIMER("get_rac")
- }
-
- return 0;
-}
-#endif
diff --git a/src/libffmpeg/libavcodec/rangecoder.h b/src/libffmpeg/libavcodec/rangecoder.h
deleted file mode 100644
index 68bd3b60e..000000000
--- a/src/libffmpeg/libavcodec/rangecoder.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Range coder
- * Copyright (c) 2004 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file rangecoder.h
- * Range coder.
- */
-
-typedef struct RangeCoder{
- int low;
- int range;
- int outstanding_count;
- int outstanding_byte;
- uint8_t zero_state[256];
- uint8_t one_state[256];
- uint8_t *bytestream_start;
- uint8_t *bytestream;
- uint8_t *bytestream_end;
-}RangeCoder;
-
-void ff_init_range_encoder(RangeCoder *c, uint8_t *buf, int buf_size);
-void ff_init_range_decoder(RangeCoder *c, const uint8_t *buf, int buf_size);
-int ff_rac_terminate(RangeCoder *c);
-void ff_build_rac_states(RangeCoder *c, int factor, int max_p);
-
-static inline void renorm_encoder(RangeCoder *c){
- //FIXME optimize
- while(c->range < 0x100){
- if(c->outstanding_byte < 0){
- c->outstanding_byte= c->low>>8;
- }else if(c->low <= 0xFF00){
- *c->bytestream++ = c->outstanding_byte;
- for(;c->outstanding_count; c->outstanding_count--)
- *c->bytestream++ = 0xFF;
- c->outstanding_byte= c->low>>8;
- }else if(c->low >= 0x10000){
- *c->bytestream++ = c->outstanding_byte + 1;
- for(;c->outstanding_count; c->outstanding_count--)
- *c->bytestream++ = 0x00;
- c->outstanding_byte= (c->low>>8) & 0xFF;
- }else{
- c->outstanding_count++;
- }
-
- c->low = (c->low & 0xFF)<<8;
- c->range <<= 8;
- }
-}
-
-static inline void put_rac(RangeCoder *c, uint8_t * const state, int bit){
- int range1= (c->range * (*state)) >> 8;
-
- assert(*state);
- assert(range1 < c->range);
- assert(range1 > 0);
- if(!bit){
- c->range -= range1;
- *state= c->zero_state[*state];
- }else{
- c->low += c->range - range1;
- c->range = range1;
- *state= c->one_state[*state];
- }
-
- renorm_encoder(c);
-}
-
-static inline void refill(RangeCoder *c){
- if(c->range < 0x100){
- c->range <<= 8;
- c->low <<= 8;
- if(c->bytestream < c->bytestream_end)
- c->low+= c->bytestream[0];
- c->bytestream++;
- }
-}
-
-static inline int get_rac(RangeCoder *c, uint8_t * const state){
- int range1= (c->range * (*state)) >> 8;
- int attribute_unused one_mask;
-
- c->range -= range1;
-#if 1
- if(c->low < c->range){
- *state= c->zero_state[*state];
- refill(c);
- return 0;
- }else{
- c->low -= c->range;
- *state= c->one_state[*state];
- c->range = range1;
- refill(c);
- return 1;
- }
-#else
- one_mask= (c->range - c->low-1)>>31;
-
- c->low -= c->range & one_mask;
- c->range += (range1 - c->range) & one_mask;
-
- *state= c->zero_state[(*state) + (256&one_mask)];
-
- refill(c);
-
- return one_mask&1;
-#endif
-}
-
diff --git a/src/libffmpeg/libavcodec/ratecontrol.c b/src/libffmpeg/libavcodec/ratecontrol.c
deleted file mode 100644
index d96c837e6..000000000
--- a/src/libffmpeg/libavcodec/ratecontrol.c
+++ /dev/null
@@ -1,944 +0,0 @@
-/*
- * Rate control for video encoders
- *
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file ratecontrol.c
- * Rate control for video encoders.
- */
-
-#include "avcodec.h"
-#include "dsputil.h"
-#include "ratecontrol.h"
-#include "mpegvideo.h"
-#include "eval.h"
-
-#undef NDEBUG // allways check asserts, the speed effect is far too small to disable them
-#include <assert.h>
-
-#ifndef M_E
-#define M_E 2.718281828
-#endif
-
-static int init_pass2(MpegEncContext *s);
-static double get_qscale(MpegEncContext *s, RateControlEntry *rce, double rate_factor, int frame_num);
-
-void ff_write_pass1_stats(MpegEncContext *s){
- snprintf(s->avctx->stats_out, 256, "in:%d out:%d type:%d q:%d itex:%d ptex:%d mv:%d misc:%d fcode:%d bcode:%d mc-var:%d var:%d icount:%d skipcount:%d hbits:%d;\n",
- s->current_picture_ptr->display_picture_number, s->current_picture_ptr->coded_picture_number, s->pict_type,
- s->current_picture.quality, s->i_tex_bits, s->p_tex_bits, s->mv_bits, s->misc_bits,
- s->f_code, s->b_code, s->current_picture.mc_mb_var_sum, s->current_picture.mb_var_sum, s->i_count, s->skip_count, s->header_bits);
-}
-
-static inline double qp2bits(RateControlEntry *rce, double qp){
- if(qp<=0.0){
- av_log(NULL, AV_LOG_ERROR, "qp<=0.0\n");
- }
- return rce->qscale * (double)(rce->i_tex_bits + rce->p_tex_bits+1)/ qp;
-}
-
-static inline double bits2qp(RateControlEntry *rce, double bits){
- if(bits<0.9){
- av_log(NULL, AV_LOG_ERROR, "bits<0.9\n");
- }
- return rce->qscale * (double)(rce->i_tex_bits + rce->p_tex_bits+1)/ bits;
-}
-
-int ff_rate_control_init(MpegEncContext *s)
-{
- RateControlContext *rcc= &s->rc_context;
- int i;
- char *error = NULL;
- static const char *const_names[]={
- "PI",
- "E",
- "iTex",
- "pTex",
- "tex",
- "mv",
- "fCode",
- "iCount",
- "mcVar",
- "var",
- "isI",
- "isP",
- "isB",
- "avgQP",
- "qComp",
-/* "lastIQP",
- "lastPQP",
- "lastBQP",
- "nextNonBQP",*/
- "avgIITex",
- "avgPITex",
- "avgPPTex",
- "avgBPTex",
- "avgTex",
- NULL
- };
- static double (*func1[])(void *, double)={
- (void *)bits2qp,
- (void *)qp2bits,
- NULL
- };
- static const char *func1_names[]={
- "bits2qp",
- "qp2bits",
- NULL
- };
- emms_c();
-
- rcc->rc_eq_eval = ff_parse(s->avctx->rc_eq, const_names, func1, func1_names, NULL, NULL, &error);
- if (!rcc->rc_eq_eval) {
- av_log(s->avctx, AV_LOG_ERROR, "Error parsing rc_eq \"%s\": %s\n", s->avctx->rc_eq, error? error : "");
- return -1;
- }
-
- for(i=0; i<5; i++){
- rcc->pred[i].coeff= FF_QP2LAMBDA * 7.0;
- rcc->pred[i].count= 1.0;
-
- rcc->pred[i].decay= 0.4;
- rcc->i_cplx_sum [i]=
- rcc->p_cplx_sum [i]=
- rcc->mv_bits_sum[i]=
- rcc->qscale_sum [i]=
- rcc->frame_count[i]= 1; // 1 is better cuz of 1/0 and such
- rcc->last_qscale_for[i]=FF_QP2LAMBDA * 5;
- }
- rcc->buffer_index= s->avctx->rc_initial_buffer_occupancy;
-
- if(s->flags&CODEC_FLAG_PASS2){
- int i;
- char *p;
-
- /* find number of pics */
- p= s->avctx->stats_in;
- for(i=-1; p; i++){
- p= strchr(p+1, ';');
- }
- i+= s->max_b_frames;
- if(i<=0 || i>=INT_MAX / sizeof(RateControlEntry))
- return -1;
- rcc->entry = (RateControlEntry*)av_mallocz(i*sizeof(RateControlEntry));
- rcc->num_entries= i;
-
- /* init all to skipped p frames (with b frames we might have a not encoded frame at the end FIXME) */
- for(i=0; i<rcc->num_entries; i++){
- RateControlEntry *rce= &rcc->entry[i];
- rce->pict_type= rce->new_pict_type=P_TYPE;
- rce->qscale= rce->new_qscale=FF_QP2LAMBDA * 2;
- rce->misc_bits= s->mb_num + 10;
- rce->mb_var_sum= s->mb_num*100;
- }
-
- /* read stats */
- p= s->avctx->stats_in;
- for(i=0; i<rcc->num_entries - s->max_b_frames; i++){
- RateControlEntry *rce;
- int picture_number;
- int e;
- char *next;
-
- next= strchr(p, ';');
- if(next){
- (*next)=0; //sscanf in unbelieavle slow on looong strings //FIXME copy / dont write
- next++;
- }
- e= sscanf(p, " in:%d ", &picture_number);
-
- assert(picture_number >= 0);
- assert(picture_number < rcc->num_entries);
- rce= &rcc->entry[picture_number];
-
- e+=sscanf(p, " in:%*d out:%*d type:%d q:%f itex:%d ptex:%d mv:%d misc:%d fcode:%d bcode:%d mc-var:%d var:%d icount:%d skipcount:%d hbits:%d",
- &rce->pict_type, &rce->qscale, &rce->i_tex_bits, &rce->p_tex_bits, &rce->mv_bits, &rce->misc_bits,
- &rce->f_code, &rce->b_code, &rce->mc_mb_var_sum, &rce->mb_var_sum, &rce->i_count, &rce->skip_count, &rce->header_bits);
- if(e!=14){
- av_log(s->avctx, AV_LOG_ERROR, "statistics are damaged at line %d, parser out=%d\n", i, e);
- return -1;
- }
-
- p= next;
- }
-
- if(init_pass2(s) < 0) return -1;
-
- //FIXME maybe move to end
- if((s->flags&CODEC_FLAG_PASS2) && s->avctx->rc_strategy == FF_RC_STRATEGY_XVID) {
-#ifdef CONFIG_XVID
- return ff_xvid_rate_control_init(s);
-#else
- av_log(s->avctx, AV_LOG_ERROR, "XviD ratecontrol requires libavcodec compiled with XviD support\n");
- return -1;
-#endif
- }
- }
-
- if(!(s->flags&CODEC_FLAG_PASS2)){
-
- rcc->short_term_qsum=0.001;
- rcc->short_term_qcount=0.001;
-
- rcc->pass1_rc_eq_output_sum= 0.001;
- rcc->pass1_wanted_bits=0.001;
-
- /* init stuff with the user specified complexity */
- if(s->avctx->rc_initial_cplx){
- for(i=0; i<60*30; i++){
- double bits= s->avctx->rc_initial_cplx * (i/10000.0 + 1.0)*s->mb_num;
- RateControlEntry rce;
- double q;
-
- if (i%((s->gop_size+3)/4)==0) rce.pict_type= I_TYPE;
- else if(i%(s->max_b_frames+1)) rce.pict_type= B_TYPE;
- else rce.pict_type= P_TYPE;
-
- rce.new_pict_type= rce.pict_type;
- rce.mc_mb_var_sum= bits*s->mb_num/100000;
- rce.mb_var_sum = s->mb_num;
- rce.qscale = FF_QP2LAMBDA * 2;
- rce.f_code = 2;
- rce.b_code = 1;
- rce.misc_bits= 1;
-
- if(s->pict_type== I_TYPE){
- rce.i_count = s->mb_num;
- rce.i_tex_bits= bits;
- rce.p_tex_bits= 0;
- rce.mv_bits= 0;
- }else{
- rce.i_count = 0; //FIXME we do know this approx
- rce.i_tex_bits= 0;
- rce.p_tex_bits= bits*0.9;
- rce.mv_bits= bits*0.1;
- }
- rcc->i_cplx_sum [rce.pict_type] += rce.i_tex_bits*rce.qscale;
- rcc->p_cplx_sum [rce.pict_type] += rce.p_tex_bits*rce.qscale;
- rcc->mv_bits_sum[rce.pict_type] += rce.mv_bits;
- rcc->frame_count[rce.pict_type] ++;
-
- bits= rce.i_tex_bits + rce.p_tex_bits;
-
- q= get_qscale(s, &rce, rcc->pass1_wanted_bits/rcc->pass1_rc_eq_output_sum, i);
- rcc->pass1_wanted_bits+= s->bit_rate/(1/av_q2d(s->avctx->time_base)); //FIXME missbehaves a little for variable fps
- }
- }
-
- }
-
- return 0;
-}
-
-void ff_rate_control_uninit(MpegEncContext *s)
-{
- RateControlContext *rcc= &s->rc_context;
- emms_c();
-
- ff_eval_free(rcc->rc_eq_eval);
- av_freep(&rcc->entry);
-
-#ifdef CONFIG_XVID
- if((s->flags&CODEC_FLAG_PASS2) && s->avctx->rc_strategy == FF_RC_STRATEGY_XVID)
- ff_xvid_rate_control_uninit(s);
-#endif
-}
-
-int ff_vbv_update(MpegEncContext *s, int frame_size){
- RateControlContext *rcc= &s->rc_context;
- const double fps= 1/av_q2d(s->avctx->time_base);
- const int buffer_size= s->avctx->rc_buffer_size;
- const double min_rate= s->avctx->rc_min_rate/fps;
- const double max_rate= s->avctx->rc_max_rate/fps;
-
-//printf("%d %f %d %f %f\n", buffer_size, rcc->buffer_index, frame_size, min_rate, max_rate);
- if(buffer_size){
- int left;
-
- rcc->buffer_index-= frame_size;
- if(rcc->buffer_index < 0){
- av_log(s->avctx, AV_LOG_ERROR, "rc buffer underflow\n");
- rcc->buffer_index= 0;
- }
-
- left= buffer_size - rcc->buffer_index - 1;
- rcc->buffer_index += clip(left, min_rate, max_rate);
-
- if(rcc->buffer_index > buffer_size){
- int stuffing= ceil((rcc->buffer_index - buffer_size)/8);
-
- if(stuffing < 4 && s->codec_id == CODEC_ID_MPEG4)
- stuffing=4;
- rcc->buffer_index -= 8*stuffing;
-
- if(s->avctx->debug & FF_DEBUG_RC)
- av_log(s->avctx, AV_LOG_DEBUG, "stuffing %d bytes\n", stuffing);
-
- return stuffing;
- }
- }
- return 0;
-}
-
-/**
- * modifies the bitrate curve from pass1 for one frame
- */
-static double get_qscale(MpegEncContext *s, RateControlEntry *rce, double rate_factor, int frame_num){
- RateControlContext *rcc= &s->rc_context;
- AVCodecContext *a= s->avctx;
- double q, bits;
- const int pict_type= rce->new_pict_type;
- const double mb_num= s->mb_num;
- int i;
-
- double const_values[]={
- M_PI,
- M_E,
- rce->i_tex_bits*rce->qscale,
- rce->p_tex_bits*rce->qscale,
- (rce->i_tex_bits + rce->p_tex_bits)*(double)rce->qscale,
- rce->mv_bits/mb_num,
- rce->pict_type == B_TYPE ? (rce->f_code + rce->b_code)*0.5 : rce->f_code,
- rce->i_count/mb_num,
- rce->mc_mb_var_sum/mb_num,
- rce->mb_var_sum/mb_num,
- rce->pict_type == I_TYPE,
- rce->pict_type == P_TYPE,
- rce->pict_type == B_TYPE,
- rcc->qscale_sum[pict_type] / (double)rcc->frame_count[pict_type],
- a->qcompress,
-/* rcc->last_qscale_for[I_TYPE],
- rcc->last_qscale_for[P_TYPE],
- rcc->last_qscale_for[B_TYPE],
- rcc->next_non_b_qscale,*/
- rcc->i_cplx_sum[I_TYPE] / (double)rcc->frame_count[I_TYPE],
- rcc->i_cplx_sum[P_TYPE] / (double)rcc->frame_count[P_TYPE],
- rcc->p_cplx_sum[P_TYPE] / (double)rcc->frame_count[P_TYPE],
- rcc->p_cplx_sum[B_TYPE] / (double)rcc->frame_count[B_TYPE],
- (rcc->i_cplx_sum[pict_type] + rcc->p_cplx_sum[pict_type]) / (double)rcc->frame_count[pict_type],
- 0
- };
-
- bits= ff_parse_eval(rcc->rc_eq_eval, const_values, rce);
- if (isnan(bits)) {
- av_log(s->avctx, AV_LOG_ERROR, "Error evaluating rc_eq \"%s\"\n", s->avctx->rc_eq);
- return -1;
- }
-
- rcc->pass1_rc_eq_output_sum+= bits;
- bits*=rate_factor;
- if(bits<0.0) bits=0.0;
- bits+= 1.0; //avoid 1/0 issues
-
- /* user override */
- for(i=0; i<s->avctx->rc_override_count; i++){
- RcOverride *rco= s->avctx->rc_override;
- if(rco[i].start_frame > frame_num) continue;
- if(rco[i].end_frame < frame_num) continue;
-
- if(rco[i].qscale)
- bits= qp2bits(rce, rco[i].qscale); //FIXME move at end to really force it?
- else
- bits*= rco[i].quality_factor;
- }
-
- q= bits2qp(rce, bits);
-
- /* I/B difference */
- if (pict_type==I_TYPE && s->avctx->i_quant_factor<0.0)
- q= -q*s->avctx->i_quant_factor + s->avctx->i_quant_offset;
- else if(pict_type==B_TYPE && s->avctx->b_quant_factor<0.0)
- q= -q*s->avctx->b_quant_factor + s->avctx->b_quant_offset;
-
- return q;
-}
-
-static double get_diff_limited_q(MpegEncContext *s, RateControlEntry *rce, double q){
- RateControlContext *rcc= &s->rc_context;
- AVCodecContext *a= s->avctx;
- const int pict_type= rce->new_pict_type;
- const double last_p_q = rcc->last_qscale_for[P_TYPE];
- const double last_non_b_q= rcc->last_qscale_for[rcc->last_non_b_pict_type];
-
- if (pict_type==I_TYPE && (a->i_quant_factor>0.0 || rcc->last_non_b_pict_type==P_TYPE))
- q= last_p_q *FFABS(a->i_quant_factor) + a->i_quant_offset;
- else if(pict_type==B_TYPE && a->b_quant_factor>0.0)
- q= last_non_b_q* a->b_quant_factor + a->b_quant_offset;
-
- /* last qscale / qdiff stuff */
- if(rcc->last_non_b_pict_type==pict_type || pict_type!=I_TYPE){
- double last_q= rcc->last_qscale_for[pict_type];
- const int maxdiff= FF_QP2LAMBDA * a->max_qdiff;
-
- if (q > last_q + maxdiff) q= last_q + maxdiff;
- else if(q < last_q - maxdiff) q= last_q - maxdiff;
- }
-
- rcc->last_qscale_for[pict_type]= q; //Note we cant do that after blurring
-
- if(pict_type!=B_TYPE)
- rcc->last_non_b_pict_type= pict_type;
-
- return q;
-}
-
-/**
- * gets the qmin & qmax for pict_type
- */
-static void get_qminmax(int *qmin_ret, int *qmax_ret, MpegEncContext *s, int pict_type){
- int qmin= s->avctx->lmin;
- int qmax= s->avctx->lmax;
-
- assert(qmin <= qmax);
-
- if(pict_type==B_TYPE){
- qmin= (int)(qmin*FFABS(s->avctx->b_quant_factor)+s->avctx->b_quant_offset + 0.5);
- qmax= (int)(qmax*FFABS(s->avctx->b_quant_factor)+s->avctx->b_quant_offset + 0.5);
- }else if(pict_type==I_TYPE){
- qmin= (int)(qmin*FFABS(s->avctx->i_quant_factor)+s->avctx->i_quant_offset + 0.5);
- qmax= (int)(qmax*FFABS(s->avctx->i_quant_factor)+s->avctx->i_quant_offset + 0.5);
- }
-
- qmin= clip(qmin, 1, FF_LAMBDA_MAX);
- qmax= clip(qmax, 1, FF_LAMBDA_MAX);
-
- if(qmax<qmin) qmax= qmin;
-
- *qmin_ret= qmin;
- *qmax_ret= qmax;
-}
-
-static double modify_qscale(MpegEncContext *s, RateControlEntry *rce, double q, int frame_num){
- RateControlContext *rcc= &s->rc_context;
- int qmin, qmax;
- double bits;
- const int pict_type= rce->new_pict_type;
- const double buffer_size= s->avctx->rc_buffer_size;
- const double fps= 1/av_q2d(s->avctx->time_base);
- const double min_rate= s->avctx->rc_min_rate / fps;
- const double max_rate= s->avctx->rc_max_rate / fps;
-
- get_qminmax(&qmin, &qmax, s, pict_type);
-
- /* modulation */
- if(s->avctx->rc_qmod_freq && frame_num%s->avctx->rc_qmod_freq==0 && pict_type==P_TYPE)
- q*= s->avctx->rc_qmod_amp;
-
- bits= qp2bits(rce, q);
-//printf("q:%f\n", q);
- /* buffer overflow/underflow protection */
- if(buffer_size){
- double expected_size= rcc->buffer_index;
- double q_limit;
-
- if(min_rate){
- double d= 2*(buffer_size - expected_size)/buffer_size;
- if(d>1.0) d=1.0;
- else if(d<0.0001) d=0.0001;
- q*= pow(d, 1.0/s->avctx->rc_buffer_aggressivity);
-
- q_limit= bits2qp(rce, FFMAX((min_rate - buffer_size + rcc->buffer_index)*3, 1));
- if(q > q_limit){
- if(s->avctx->debug&FF_DEBUG_RC){
- av_log(s->avctx, AV_LOG_DEBUG, "limiting QP %f -> %f\n", q, q_limit);
- }
- q= q_limit;
- }
- }
-
- if(max_rate){
- double d= 2*expected_size/buffer_size;
- if(d>1.0) d=1.0;
- else if(d<0.0001) d=0.0001;
- q/= pow(d, 1.0/s->avctx->rc_buffer_aggressivity);
-
- q_limit= bits2qp(rce, FFMAX(rcc->buffer_index/3, 1));
- if(q < q_limit){
- if(s->avctx->debug&FF_DEBUG_RC){
- av_log(s->avctx, AV_LOG_DEBUG, "limiting QP %f -> %f\n", q, q_limit);
- }
- q= q_limit;
- }
- }
- }
-//printf("q:%f max:%f min:%f size:%f index:%d bits:%f agr:%f\n", q,max_rate, min_rate, buffer_size, rcc->buffer_index, bits, s->avctx->rc_buffer_aggressivity);
- if(s->avctx->rc_qsquish==0.0 || qmin==qmax){
- if (q<qmin) q=qmin;
- else if(q>qmax) q=qmax;
- }else{
- double min2= log(qmin);
- double max2= log(qmax);
-
- q= log(q);
- q= (q - min2)/(max2-min2) - 0.5;
- q*= -4.0;
- q= 1.0/(1.0 + exp(q));
- q= q*(max2-min2) + min2;
-
- q= exp(q);
- }
-
- return q;
-}
-
-//----------------------------------
-// 1 Pass Code
-
-static double predict_size(Predictor *p, double q, double var)
-{
- return p->coeff*var / (q*p->count);
-}
-
-/*
-static double predict_qp(Predictor *p, double size, double var)
-{
-//printf("coeff:%f, count:%f, var:%f, size:%f//\n", p->coeff, p->count, var, size);
- return p->coeff*var / (size*p->count);
-}
-*/
-
-static void update_predictor(Predictor *p, double q, double var, double size)
-{
- double new_coeff= size*q / (var + 1);
- if(var<10) return;
-
- p->count*= p->decay;
- p->coeff*= p->decay;
- p->count++;
- p->coeff+= new_coeff;
-}
-
-static void adaptive_quantization(MpegEncContext *s, double q){
- int i;
- const float lumi_masking= s->avctx->lumi_masking / (128.0*128.0);
- const float dark_masking= s->avctx->dark_masking / (128.0*128.0);
- const float temp_cplx_masking= s->avctx->temporal_cplx_masking;
- const float spatial_cplx_masking = s->avctx->spatial_cplx_masking;
- const float p_masking = s->avctx->p_masking;
- const float border_masking = s->avctx->border_masking;
- float bits_sum= 0.0;
- float cplx_sum= 0.0;
- float cplx_tab[s->mb_num];
- float bits_tab[s->mb_num];
- const int qmin= s->avctx->mb_lmin;
- const int qmax= s->avctx->mb_lmax;
- Picture * const pic= &s->current_picture;
- const int mb_width = s->mb_width;
- const int mb_height = s->mb_height;
-
- for(i=0; i<s->mb_num; i++){
- const int mb_xy= s->mb_index2xy[i];
- float temp_cplx= sqrt(pic->mc_mb_var[mb_xy]); //FIXME merge in pow()
- float spat_cplx= sqrt(pic->mb_var[mb_xy]);
- const int lumi= pic->mb_mean[mb_xy];
- float bits, cplx, factor;
- int mb_x = mb_xy % s->mb_stride;
- int mb_y = mb_xy / s->mb_stride;
- int mb_distance;
- float mb_factor = 0.0;
-#if 0
- if(spat_cplx < q/3) spat_cplx= q/3; //FIXME finetune
- if(temp_cplx < q/3) temp_cplx= q/3; //FIXME finetune
-#endif
- if(spat_cplx < 4) spat_cplx= 4; //FIXME finetune
- if(temp_cplx < 4) temp_cplx= 4; //FIXME finetune
-
- if((s->mb_type[mb_xy]&CANDIDATE_MB_TYPE_INTRA)){//FIXME hq mode
- cplx= spat_cplx;
- factor= 1.0 + p_masking;
- }else{
- cplx= temp_cplx;
- factor= pow(temp_cplx, - temp_cplx_masking);
- }
- factor*=pow(spat_cplx, - spatial_cplx_masking);
-
- if(lumi>127)
- factor*= (1.0 - (lumi-128)*(lumi-128)*lumi_masking);
- else
- factor*= (1.0 - (lumi-128)*(lumi-128)*dark_masking);
-
- if(mb_x < mb_width/5){
- mb_distance = mb_width/5 - mb_x;
- mb_factor = (float)mb_distance / (float)(mb_width/5);
- }else if(mb_x > 4*mb_width/5){
- mb_distance = mb_x - 4*mb_width/5;
- mb_factor = (float)mb_distance / (float)(mb_width/5);
- }
- if(mb_y < mb_height/5){
- mb_distance = mb_height/5 - mb_y;
- mb_factor = FFMAX(mb_factor, (float)mb_distance / (float)(mb_height/5));
- }else if(mb_y > 4*mb_height/5){
- mb_distance = mb_y - 4*mb_height/5;
- mb_factor = FFMAX(mb_factor, (float)mb_distance / (float)(mb_height/5));
- }
-
- factor*= 1.0 - border_masking*mb_factor;
-
- if(factor<0.00001) factor= 0.00001;
-
- bits= cplx*factor;
- cplx_sum+= cplx;
- bits_sum+= bits;
- cplx_tab[i]= cplx;
- bits_tab[i]= bits;
- }
-
- /* handle qmin/qmax cliping */
- if(s->flags&CODEC_FLAG_NORMALIZE_AQP){
- float factor= bits_sum/cplx_sum;
- for(i=0; i<s->mb_num; i++){
- float newq= q*cplx_tab[i]/bits_tab[i];
- newq*= factor;
-
- if (newq > qmax){
- bits_sum -= bits_tab[i];
- cplx_sum -= cplx_tab[i]*q/qmax;
- }
- else if(newq < qmin){
- bits_sum -= bits_tab[i];
- cplx_sum -= cplx_tab[i]*q/qmin;
- }
- }
- if(bits_sum < 0.001) bits_sum= 0.001;
- if(cplx_sum < 0.001) cplx_sum= 0.001;
- }
-
- for(i=0; i<s->mb_num; i++){
- const int mb_xy= s->mb_index2xy[i];
- float newq= q*cplx_tab[i]/bits_tab[i];
- int intq;
-
- if(s->flags&CODEC_FLAG_NORMALIZE_AQP){
- newq*= bits_sum/cplx_sum;
- }
-
- intq= (int)(newq + 0.5);
-
- if (intq > qmax) intq= qmax;
- else if(intq < qmin) intq= qmin;
-//if(i%s->mb_width==0) printf("\n");
-//printf("%2d%3d ", intq, ff_sqrt(s->mc_mb_var[i]));
- s->lambda_table[mb_xy]= intq;
- }
-}
-
-void ff_get_2pass_fcode(MpegEncContext *s){
- RateControlContext *rcc= &s->rc_context;
- int picture_number= s->picture_number;
- RateControlEntry *rce;
-
- rce= &rcc->entry[picture_number];
- s->f_code= rce->f_code;
- s->b_code= rce->b_code;
-}
-
-//FIXME rd or at least approx for dquant
-
-float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run)
-{
- float q;
- int qmin, qmax;
- float br_compensation;
- double diff;
- double short_term_q;
- double fps;
- int picture_number= s->picture_number;
- int64_t wanted_bits;
- RateControlContext *rcc= &s->rc_context;
- AVCodecContext *a= s->avctx;
- RateControlEntry local_rce, *rce;
- double bits;
- double rate_factor;
- int var;
- const int pict_type= s->pict_type;
- Picture * const pic= &s->current_picture;
- emms_c();
-
-#ifdef CONFIG_XVID
- if((s->flags&CODEC_FLAG_PASS2) && s->avctx->rc_strategy == FF_RC_STRATEGY_XVID)
- return ff_xvid_rate_estimate_qscale(s, dry_run);
-#endif
-
- get_qminmax(&qmin, &qmax, s, pict_type);
-
- fps= 1/av_q2d(s->avctx->time_base);
-//printf("input_pic_num:%d pic_num:%d frame_rate:%d\n", s->input_picture_number, s->picture_number, s->frame_rate);
- /* update predictors */
- if(picture_number>2 && !dry_run){
- const int last_var= s->last_pict_type == I_TYPE ? rcc->last_mb_var_sum : rcc->last_mc_mb_var_sum;
- update_predictor(&rcc->pred[s->last_pict_type], rcc->last_qscale, sqrt(last_var), s->frame_bits);
- }
-
- if(s->flags&CODEC_FLAG_PASS2){
- assert(picture_number>=0);
- assert(picture_number<rcc->num_entries);
- rce= &rcc->entry[picture_number];
- wanted_bits= rce->expected_bits;
- }else{
- rce= &local_rce;
- wanted_bits= (uint64_t)(s->bit_rate*(double)picture_number/fps);
- }
-
- diff= s->total_bits - wanted_bits;
- br_compensation= (a->bit_rate_tolerance - diff)/a->bit_rate_tolerance;
- if(br_compensation<=0.0) br_compensation=0.001;
-
- var= pict_type == I_TYPE ? pic->mb_var_sum : pic->mc_mb_var_sum;
-
- short_term_q = 0; /* avoid warning */
- if(s->flags&CODEC_FLAG_PASS2){
- if(pict_type!=I_TYPE)
- assert(pict_type == rce->new_pict_type);
-
- q= rce->new_qscale / br_compensation;
-//printf("%f %f %f last:%d var:%d type:%d//\n", q, rce->new_qscale, br_compensation, s->frame_bits, var, pict_type);
- }else{
- rce->pict_type=
- rce->new_pict_type= pict_type;
- rce->mc_mb_var_sum= pic->mc_mb_var_sum;
- rce->mb_var_sum = pic-> mb_var_sum;
- rce->qscale = FF_QP2LAMBDA * 2;
- rce->f_code = s->f_code;
- rce->b_code = s->b_code;
- rce->misc_bits= 1;
-
- bits= predict_size(&rcc->pred[pict_type], rce->qscale, sqrt(var));
- if(pict_type== I_TYPE){
- rce->i_count = s->mb_num;
- rce->i_tex_bits= bits;
- rce->p_tex_bits= 0;
- rce->mv_bits= 0;
- }else{
- rce->i_count = 0; //FIXME we do know this approx
- rce->i_tex_bits= 0;
- rce->p_tex_bits= bits*0.9;
-
- rce->mv_bits= bits*0.1;
- }
- rcc->i_cplx_sum [pict_type] += rce->i_tex_bits*rce->qscale;
- rcc->p_cplx_sum [pict_type] += rce->p_tex_bits*rce->qscale;
- rcc->mv_bits_sum[pict_type] += rce->mv_bits;
- rcc->frame_count[pict_type] ++;
-
- bits= rce->i_tex_bits + rce->p_tex_bits;
- rate_factor= rcc->pass1_wanted_bits/rcc->pass1_rc_eq_output_sum * br_compensation;
-
- q= get_qscale(s, rce, rate_factor, picture_number);
- if (q < 0)
- return -1;
-
- assert(q>0.0);
-//printf("%f ", q);
- q= get_diff_limited_q(s, rce, q);
-//printf("%f ", q);
- assert(q>0.0);
-
- if(pict_type==P_TYPE || s->intra_only){ //FIXME type dependant blur like in 2-pass
- rcc->short_term_qsum*=a->qblur;
- rcc->short_term_qcount*=a->qblur;
-
- rcc->short_term_qsum+= q;
- rcc->short_term_qcount++;
-//printf("%f ", q);
- q= short_term_q= rcc->short_term_qsum/rcc->short_term_qcount;
-//printf("%f ", q);
- }
- assert(q>0.0);
-
- q= modify_qscale(s, rce, q, picture_number);
-
- rcc->pass1_wanted_bits+= s->bit_rate/fps;
-
- assert(q>0.0);
- }
-
- if(s->avctx->debug&FF_DEBUG_RC){
- av_log(s->avctx, AV_LOG_DEBUG, "%c qp:%d<%2.1f<%d %d want:%d total:%d comp:%f st_q:%2.2f size:%d var:%d/%d br:%d fps:%d\n",
- av_get_pict_type_char(pict_type), qmin, q, qmax, picture_number, (int)wanted_bits/1000, (int)s->total_bits/1000,
- br_compensation, short_term_q, s->frame_bits, pic->mb_var_sum, pic->mc_mb_var_sum, s->bit_rate/1000, (int)fps
- );
- }
-
- if (q<qmin) q=qmin;
- else if(q>qmax) q=qmax;
-
- if(s->adaptive_quant)
- adaptive_quantization(s, q);
- else
- q= (int)(q + 0.5);
-
- if(!dry_run){
- rcc->last_qscale= q;
- rcc->last_mc_mb_var_sum= pic->mc_mb_var_sum;
- rcc->last_mb_var_sum= pic->mb_var_sum;
- }
-#if 0
-{
- static int mvsum=0, texsum=0;
- mvsum += s->mv_bits;
- texsum += s->i_tex_bits + s->p_tex_bits;
- printf("%d %d//\n\n", mvsum, texsum);
-}
-#endif
- return q;
-}
-
-//----------------------------------------------
-// 2-Pass code
-
-static int init_pass2(MpegEncContext *s)
-{
- RateControlContext *rcc= &s->rc_context;
- AVCodecContext *a= s->avctx;
- int i, toobig;
- double fps= 1/av_q2d(s->avctx->time_base);
- double complexity[5]={0,0,0,0,0}; // aproximate bits at quant=1
- uint64_t const_bits[5]={0,0,0,0,0}; // quantizer idependant bits
- uint64_t all_const_bits;
- uint64_t all_available_bits= (uint64_t)(s->bit_rate*(double)rcc->num_entries/fps);
- double rate_factor=0;
- double step;
- //int last_i_frame=-10000000;
- const int filter_size= (int)(a->qblur*4) | 1;
- double expected_bits;
- double *qscale, *blured_qscale, qscale_sum;
-
- /* find complexity & const_bits & decide the pict_types */
- for(i=0; i<rcc->num_entries; i++){
- RateControlEntry *rce= &rcc->entry[i];
-
- rce->new_pict_type= rce->pict_type;
- rcc->i_cplx_sum [rce->pict_type] += rce->i_tex_bits*rce->qscale;
- rcc->p_cplx_sum [rce->pict_type] += rce->p_tex_bits*rce->qscale;
- rcc->mv_bits_sum[rce->pict_type] += rce->mv_bits;
- rcc->frame_count[rce->pict_type] ++;
-
- complexity[rce->new_pict_type]+= (rce->i_tex_bits+ rce->p_tex_bits)*(double)rce->qscale;
- const_bits[rce->new_pict_type]+= rce->mv_bits + rce->misc_bits;
- }
- all_const_bits= const_bits[I_TYPE] + const_bits[P_TYPE] + const_bits[B_TYPE];
-
- if(all_available_bits < all_const_bits){
- av_log(s->avctx, AV_LOG_ERROR, "requested bitrate is too low\n");
- return -1;
- }
-
- qscale= av_malloc(sizeof(double)*rcc->num_entries);
- blured_qscale= av_malloc(sizeof(double)*rcc->num_entries);
- toobig = 0;
-
- for(step=256*256; step>0.0000001; step*=0.5){
- expected_bits=0;
- rate_factor+= step;
-
- rcc->buffer_index= s->avctx->rc_buffer_size/2;
-
- /* find qscale */
- for(i=0; i<rcc->num_entries; i++){
- qscale[i]= get_qscale(s, &rcc->entry[i], rate_factor, i);
- }
- assert(filter_size%2==1);
-
- /* fixed I/B QP relative to P mode */
- for(i=rcc->num_entries-1; i>=0; i--){
- RateControlEntry *rce= &rcc->entry[i];
-
- qscale[i]= get_diff_limited_q(s, rce, qscale[i]);
- }
-
- /* smooth curve */
- for(i=0; i<rcc->num_entries; i++){
- RateControlEntry *rce= &rcc->entry[i];
- const int pict_type= rce->new_pict_type;
- int j;
- double q=0.0, sum=0.0;
-
- for(j=0; j<filter_size; j++){
- int index= i+j-filter_size/2;
- double d= index-i;
- double coeff= a->qblur==0 ? 1.0 : exp(-d*d/(a->qblur * a->qblur));
-
- if(index < 0 || index >= rcc->num_entries) continue;
- if(pict_type != rcc->entry[index].new_pict_type) continue;
- q+= qscale[index] * coeff;
- sum+= coeff;
- }
- blured_qscale[i]= q/sum;
- }
-
- /* find expected bits */
- for(i=0; i<rcc->num_entries; i++){
- RateControlEntry *rce= &rcc->entry[i];
- double bits;
- rce->new_qscale= modify_qscale(s, rce, blured_qscale[i], i);
- bits= qp2bits(rce, rce->new_qscale) + rce->mv_bits + rce->misc_bits;
-//printf("%d %f\n", rce->new_bits, blured_qscale[i]);
- bits += 8*ff_vbv_update(s, bits);
-
- rce->expected_bits= expected_bits;
- expected_bits += bits;
- }
-
- /*
- av_log(s->avctx, AV_LOG_INFO,
- "expected_bits: %f all_available_bits: %d rate_factor: %f\n",
- expected_bits, (int)all_available_bits, rate_factor);
- */
- if(expected_bits > all_available_bits) {
- rate_factor-= step;
- ++toobig;
- }
- }
- av_free(qscale);
- av_free(blured_qscale);
-
- /* check bitrate calculations and print info */
- qscale_sum = 0.0;
- for(i=0; i<rcc->num_entries; i++){
- /* av_log(s->avctx, AV_LOG_DEBUG, "[lavc rc] entry[%d].new_qscale = %.3f qp = %.3f\n",
- i, rcc->entry[i].new_qscale, rcc->entry[i].new_qscale / FF_QP2LAMBDA); */
- qscale_sum += clip(rcc->entry[i].new_qscale / FF_QP2LAMBDA, s->avctx->qmin, s->avctx->qmax);
- }
- assert(toobig <= 40);
- av_log(s->avctx, AV_LOG_DEBUG,
- "[lavc rc] requested bitrate: %d bps expected bitrate: %d bps\n",
- s->bit_rate,
- (int)(expected_bits / ((double)all_available_bits/s->bit_rate)));
- av_log(s->avctx, AV_LOG_DEBUG,
- "[lavc rc] estimated target average qp: %.3f\n",
- (float)qscale_sum / rcc->num_entries);
- if (toobig == 0) {
- av_log(s->avctx, AV_LOG_INFO,
- "[lavc rc] Using all of requested bitrate is not "
- "necessary for this video with these parameters.\n");
- } else if (toobig == 40) {
- av_log(s->avctx, AV_LOG_ERROR,
- "[lavc rc] Error: bitrate too low for this video "
- "with these parameters.\n");
- return -1;
- } else if (fabs(expected_bits/all_available_bits - 1.0) > 0.01) {
- av_log(s->avctx, AV_LOG_ERROR,
- "[lavc rc] Error: 2pass curve failed to converge\n");
- return -1;
- }
-
- return 0;
-}
diff --git a/src/libffmpeg/libavcodec/ratecontrol.h b/src/libffmpeg/libavcodec/ratecontrol.h
deleted file mode 100644
index c428923a5..000000000
--- a/src/libffmpeg/libavcodec/ratecontrol.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Ratecontrol
- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard.
- * Copyright (c) 2002-2004 Michael Niedermayer
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_RATECONTROL_H
-#define AVCODEC_RATECONTROL_H
-
-/**
- * @file ratecontrol.h
- * ratecontrol header.
- */
-
-#include "eval.h"
-
-typedef struct Predictor{
- double coeff;
- double count;
- double decay;
-} Predictor;
-
-typedef struct RateControlEntry{
- int pict_type;
- float qscale;
- int mv_bits;
- int i_tex_bits;
- int p_tex_bits;
- int misc_bits;
- int header_bits;
- uint64_t expected_bits;
- int new_pict_type;
- float new_qscale;
- int mc_mb_var_sum;
- int mb_var_sum;
- int i_count;
- int skip_count;
- int f_code;
- int b_code;
-}RateControlEntry;
-
-/**
- * rate control context.
- */
-typedef struct RateControlContext{
- FILE *stats_file;
- int num_entries; ///< number of RateControlEntries
- RateControlEntry *entry;
- double buffer_index; ///< amount of bits in the video/audio buffer
- Predictor pred[5];
- double short_term_qsum; ///< sum of recent qscales
- double short_term_qcount; ///< count of recent qscales
- double pass1_rc_eq_output_sum;///< sum of the output of the rc equation, this is used for normalization
- double pass1_wanted_bits; ///< bits which should have been outputed by the pass1 code (including complexity init)
- double last_qscale;
- double last_qscale_for[5]; ///< last qscale for a specific pict type, used for max_diff & ipb factor stuff
- int last_mc_mb_var_sum;
- int last_mb_var_sum;
- uint64_t i_cplx_sum[5];
- uint64_t p_cplx_sum[5];
- uint64_t mv_bits_sum[5];
- uint64_t qscale_sum[5];
- int frame_count[5];
- int last_non_b_pict_type;
-
- void *non_lavc_opaque; ///< context for non lavc rc code (for example xvid)
- float dry_run_qscale; ///< for xvid rc
- int last_picture_number; ///< for xvid rc
- AVEvalExpr * rc_eq_eval;
-}RateControlContext;
-
-struct MpegEncContext;
-
-/* rate control */
-int ff_rate_control_init(struct MpegEncContext *s);
-float ff_rate_estimate_qscale(struct MpegEncContext *s, int dry_run);
-void ff_write_pass1_stats(struct MpegEncContext *s);
-void ff_rate_control_uninit(struct MpegEncContext *s);
-int ff_vbv_update(struct MpegEncContext *s, int frame_size);
-void ff_get_2pass_fcode(struct MpegEncContext *s);
-
-int ff_xvid_rate_control_init(struct MpegEncContext *s);
-void ff_xvid_rate_control_uninit(struct MpegEncContext *s);
-float ff_xvid_rate_estimate_qscale(struct MpegEncContext *s, int dry_run);
-
-#endif /* AVCODEC_RATECONTROL_H */
-
diff --git a/src/libffmpeg/libavcodec/raw.c b/src/libffmpeg/libavcodec/raw.c
deleted file mode 100644
index f4fddf73c..000000000
--- a/src/libffmpeg/libavcodec/raw.c
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * Raw Video Codec
- * Copyright (c) 2001 Fabrice Bellard.
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file raw.c
- * Raw Video Codec
- */
-
-#include "avcodec.h"
-
-typedef struct RawVideoContext {
- unsigned char * buffer; /* block of memory for holding one frame */
- int length; /* number of bytes in buffer */
- AVFrame pic; ///< AVCodecContext.coded_frame
-} RawVideoContext;
-
-typedef struct PixelFormatTag {
- int pix_fmt;
- unsigned int fourcc;
-} PixelFormatTag;
-
-static const PixelFormatTag pixelFormatTags[] = {
- { PIX_FMT_YUV420P, MKTAG('I', '4', '2', '0') }, /* Planar formats */
- { PIX_FMT_YUV420P, MKTAG('I', 'Y', 'U', 'V') },
- { PIX_FMT_YUV420P, MKTAG('Y', 'V', '1', '2') },
- { PIX_FMT_YUV410P, MKTAG('Y', 'U', 'V', '9') },
- { PIX_FMT_YUV411P, MKTAG('Y', '4', '1', 'B') },
- { PIX_FMT_YUV422P, MKTAG('Y', '4', '2', 'B') },
- { PIX_FMT_GRAY8, MKTAG('Y', '8', '0', '0') },
- { PIX_FMT_GRAY8, MKTAG(' ', ' ', 'Y', '8') },
-
-
- { PIX_FMT_YUV422, MKTAG('Y', 'U', 'Y', '2') }, /* Packed formats */
- { PIX_FMT_YUV422, MKTAG('Y', '4', '2', '2') },
- { PIX_FMT_UYVY422, MKTAG('U', 'Y', 'V', 'Y') },
- { PIX_FMT_GRAY8, MKTAG('G', 'R', 'E', 'Y') },
- { PIX_FMT_RGB555, MKTAG('R', 'G', 'B', 15) },
- { PIX_FMT_BGR555, MKTAG('B', 'G', 'R', 15) },
- { PIX_FMT_RGB565, MKTAG('R', 'G', 'B', 16) },
- { PIX_FMT_BGR565, MKTAG('B', 'G', 'R', 16) },
-
- /* quicktime */
- { PIX_FMT_UYVY422, MKTAG('2', 'v', 'u', 'y') },
-
- { -1, 0 },
-};
-
-static int findPixelFormat(unsigned int fourcc)
-{
- const PixelFormatTag * tags = pixelFormatTags;
- while (tags->pix_fmt >= 0) {
- if (tags->fourcc == fourcc)
- return tags->pix_fmt;
- tags++;
- }
- return PIX_FMT_YUV420P;
-}
-
-unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat fmt)
-{
- const PixelFormatTag * tags = pixelFormatTags;
- while (tags->pix_fmt >= 0) {
- if (tags->pix_fmt == fmt)
- return tags->fourcc;
- tags++;
- }
- return 0;
-}
-
-/* RAW Decoder Implementation */
-
-static int raw_init_decoder(AVCodecContext *avctx)
-{
- RawVideoContext *context = avctx->priv_data;
-
- if (avctx->codec_tag)
- avctx->pix_fmt = findPixelFormat(avctx->codec_tag);
- else if (avctx->bits_per_sample){
- switch(avctx->bits_per_sample){
- case 8: avctx->pix_fmt= PIX_FMT_PAL8 ; break;
- case 15: avctx->pix_fmt= PIX_FMT_RGB555; break;
- case 16: avctx->pix_fmt= PIX_FMT_RGB555; break;
- case 24: avctx->pix_fmt= PIX_FMT_BGR24 ; break;
- case 32: avctx->pix_fmt= PIX_FMT_RGBA32; break;
- }
- }
-
- context->length = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height);
- context->buffer = av_malloc(context->length);
- context->pic.pict_type = FF_I_TYPE;
- context->pic.key_frame = 1;
-
- avctx->coded_frame= &context->pic;
-
- if (!context->buffer)
- return -1;
-
- return 0;
-}
-
-static void flip(AVCodecContext *avctx, AVPicture * picture){
- if(!avctx->codec_tag && avctx->bits_per_sample && picture->linesize[2]==0){
- picture->data[0] += picture->linesize[0] * (avctx->height-1);
- picture->linesize[0] *= -1;
- }
-}
-
-static int raw_decode(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- RawVideoContext *context = avctx->priv_data;
-
- AVFrame * frame = (AVFrame *) data;
- AVPicture * picture = (AVPicture *) data;
-
- frame->interlaced_frame = avctx->coded_frame->interlaced_frame;
- frame->top_field_first = avctx->coded_frame->top_field_first;
-
- if(buf_size < context->length - (avctx->pix_fmt==PIX_FMT_PAL8 ? 256*4 : 0))
- return -1;
-
- avpicture_fill(picture, buf, avctx->pix_fmt, avctx->width, avctx->height);
- if(avctx->pix_fmt==PIX_FMT_PAL8 && buf_size < context->length){
- frame->data[1]= context->buffer;
- }
- if (avctx->palctrl && avctx->palctrl->palette_changed) {
- memcpy(frame->data[1], avctx->palctrl->palette, AVPALETTE_SIZE);
- avctx->palctrl->palette_changed = 0;
- }
-
- flip(avctx, picture);
-
- if (avctx->codec_tag == MKTAG('Y', 'V', '1', '2'))
- {
- // swap fields
- unsigned char *tmp = picture->data[1];
- picture->data[1] = picture->data[2];
- picture->data[2] = tmp;
- }
-
- *data_size = sizeof(AVPicture);
- return buf_size;
-}
-
-static int raw_close_decoder(AVCodecContext *avctx)
-{
- RawVideoContext *context = avctx->priv_data;
-
- av_freep(&context->buffer);
- return 0;
-}
-
-/* RAW Encoder Implementation */
-#ifdef CONFIG_RAWVIDEO_ENCODER
-static int raw_init_encoder(AVCodecContext *avctx)
-{
- avctx->coded_frame = (AVFrame *)avctx->priv_data;
- avctx->coded_frame->pict_type = FF_I_TYPE;
- avctx->coded_frame->key_frame = 1;
- if(!avctx->codec_tag)
- avctx->codec_tag = avcodec_pix_fmt_to_codec_tag(avctx->pix_fmt);
- return 0;
-}
-
-static int raw_encode(AVCodecContext *avctx,
- unsigned char *frame, int buf_size, void *data)
-{
- return avpicture_layout((AVPicture *)data, avctx->pix_fmt, avctx->width,
- avctx->height, frame, buf_size);
-}
-
-AVCodec rawvideo_encoder = {
- "rawvideo",
- CODEC_TYPE_VIDEO,
- CODEC_ID_RAWVIDEO,
- sizeof(AVFrame),
- raw_init_encoder,
- raw_encode,
-};
-#endif // CONFIG_RAWVIDEO_ENCODER
-
-AVCodec rawvideo_decoder = {
- "rawvideo",
- CODEC_TYPE_VIDEO,
- CODEC_ID_RAWVIDEO,
- sizeof(RawVideoContext),
- raw_init_decoder,
- NULL,
- raw_close_decoder,
- raw_decode,
-};
diff --git a/src/libffmpeg/libavcodec/resample2.c b/src/libffmpeg/libavcodec/resample2.c
deleted file mode 100644
index 3ae0ba855..000000000
--- a/src/libffmpeg/libavcodec/resample2.c
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
- * audio resampling
- * Copyright (c) 2004 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file resample2.c
- * audio resampling
- * @author Michael Niedermayer <michaelni@gmx.at>
- */
-
-#include "avcodec.h"
-#include "common.h"
-#include "dsputil.h"
-
-#if 1
-#define FILTER_SHIFT 15
-
-#define FELEM int16_t
-#define FELEM2 int32_t
-#define FELEM_MAX INT16_MAX
-#define FELEM_MIN INT16_MIN
-#else
-#define FILTER_SHIFT 22
-
-#define FELEM int32_t
-#define FELEM2 int64_t
-#define FELEM_MAX INT32_MAX
-#define FELEM_MIN INT32_MIN
-#endif
-
-
-typedef struct AVResampleContext{
- FELEM *filter_bank;
- int filter_length;
- int ideal_dst_incr;
- int dst_incr;
- int index;
- int frac;
- int src_incr;
- int compensation_distance;
- int phase_shift;
- int phase_mask;
- int linear;
-}AVResampleContext;
-
-/**
- * 0th order modified bessel function of the first kind.
- */
-static double bessel(double x){
- double v=1;
- double t=1;
- int i;
-
- for(i=1; i<50; i++){
- t *= i;
- v += pow(x*x/4, i)/(t*t);
- }
- return v;
-}
-
-/**
- * builds a polyphase filterbank.
- * @param factor resampling factor
- * @param scale wanted sum of coefficients for each filter
- * @param type 0->cubic, 1->blackman nuttall windowed sinc, 2->kaiser windowed sinc beta=16
- */
-void av_build_filter(FELEM *filter, double factor, int tap_count, int phase_count, int scale, int type){
- int ph, i, v;
- double x, y, w, tab[tap_count];
- const int center= (tap_count-1)/2;
-
- /* if upsampling, only need to interpolate, no filter */
- if (factor > 1.0)
- factor = 1.0;
-
- for(ph=0;ph<phase_count;ph++) {
- double norm = 0;
- double e= 0;
- for(i=0;i<tap_count;i++) {
- x = M_PI * ((double)(i - center) - (double)ph / phase_count) * factor;
- if (x == 0) y = 1.0;
- else y = sin(x) / x;
- switch(type){
- case 0:{
- const float d= -0.5; //first order derivative = -0.5
- x = fabs(((double)(i - center) - (double)ph / phase_count) * factor);
- if(x<1.0) y= 1 - 3*x*x + 2*x*x*x + d*( -x*x + x*x*x);
- else y= d*(-4 + 8*x - 5*x*x + x*x*x);
- break;}
- case 1:
- w = 2.0*x / (factor*tap_count) + M_PI;
- y *= 0.3635819 - 0.4891775 * cos(w) + 0.1365995 * cos(2*w) - 0.0106411 * cos(3*w);
- break;
- case 2:
- w = 2.0*x / (factor*tap_count*M_PI);
- y *= bessel(16*sqrt(FFMAX(1-w*w, 0)));
- break;
- }
-
- tab[i] = y;
- norm += y;
- }
-
- /* normalize so that an uniform color remains the same */
- for(i=0;i<tap_count;i++) {
- v = clip(lrintf(tab[i] * scale / norm + e), FELEM_MIN, FELEM_MAX);
- filter[ph * tap_count + i] = v;
- e += tab[i] * scale / norm - v;
- }
- }
-}
-
-/**
- * initalizes a audio resampler.
- * note, if either rate is not a integer then simply scale both rates up so they are
- */
-AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_size, int phase_shift, int linear, double cutoff){
- AVResampleContext *c= av_mallocz(sizeof(AVResampleContext));
- double factor= FFMIN(out_rate * cutoff / in_rate, 1.0);
- int phase_count= 1<<phase_shift;
-
- c->phase_shift= phase_shift;
- c->phase_mask= phase_count-1;
- c->linear= linear;
-
- c->filter_length= FFMAX((int)ceil(filter_size/factor), 1);
- c->filter_bank= av_mallocz(c->filter_length*(phase_count+1)*sizeof(FELEM));
- av_build_filter(c->filter_bank, factor, c->filter_length, phase_count, 1<<FILTER_SHIFT, 1);
- memcpy(&c->filter_bank[c->filter_length*phase_count+1], c->filter_bank, (c->filter_length-1)*sizeof(FELEM));
- c->filter_bank[c->filter_length*phase_count]= c->filter_bank[c->filter_length - 1];
-
- c->src_incr= out_rate;
- c->ideal_dst_incr= c->dst_incr= in_rate * phase_count;
- c->index= -phase_count*((c->filter_length-1)/2);
-
- return c;
-}
-
-void av_resample_close(AVResampleContext *c){
- av_freep(&c->filter_bank);
- av_freep(&c);
-}
-
-/**
- * Compensates samplerate/timestamp drift. The compensation is done by changing
- * the resampler parameters, so no audible clicks or similar distortions ocur
- * @param compensation_distance distance in output samples over which the compensation should be performed
- * @param sample_delta number of output samples which should be output less
- *
- * example: av_resample_compensate(c, 10, 500)
- * here instead of 510 samples only 500 samples would be output
- *
- * note, due to rounding the actual compensation might be slightly different,
- * especially if the compensation_distance is large and the in_rate used during init is small
- */
-void av_resample_compensate(AVResampleContext *c, int sample_delta, int compensation_distance){
-// sample_delta += (c->ideal_dst_incr - c->dst_incr)*(int64_t)c->compensation_distance / c->ideal_dst_incr;
- c->compensation_distance= compensation_distance;
- c->dst_incr = c->ideal_dst_incr - c->ideal_dst_incr * (int64_t)sample_delta / compensation_distance;
-}
-
-/**
- * resamples.
- * @param src an array of unconsumed samples
- * @param consumed the number of samples of src which have been consumed are returned here
- * @param src_size the number of unconsumed samples available
- * @param dst_size the amount of space in samples available in dst
- * @param update_ctx if this is 0 then the context wont be modified, that way several channels can be resampled with the same context
- * @return the number of samples written in dst or -1 if an error occured
- */
-int av_resample(AVResampleContext *c, short *dst, short *src, int *consumed, int src_size, int dst_size, int update_ctx){
- int dst_index, i;
- int index= c->index;
- int frac= c->frac;
- int dst_incr_frac= c->dst_incr % c->src_incr;
- int dst_incr= c->dst_incr / c->src_incr;
- int compensation_distance= c->compensation_distance;
-
- if(compensation_distance == 0 && c->filter_length == 1 && c->phase_shift==0){
- int64_t index2= ((int64_t)index)<<32;
- int64_t incr= (1LL<<32) * c->dst_incr / c->src_incr;
- dst_size= FFMIN(dst_size, (src_size-1-index) * (int64_t)c->src_incr / c->dst_incr);
-
- for(dst_index=0; dst_index < dst_size; dst_index++){
- dst[dst_index] = src[index2>>32];
- index2 += incr;
- }
- frac += dst_index * dst_incr_frac;
- index += dst_index * dst_incr;
- index += frac / c->src_incr;
- frac %= c->src_incr;
- }else{
- for(dst_index=0; dst_index < dst_size; dst_index++){
- FELEM *filter= c->filter_bank + c->filter_length*(index & c->phase_mask);
- int sample_index= index >> c->phase_shift;
- FELEM2 val=0;
-
- if(sample_index < 0){
- for(i=0; i<c->filter_length; i++)
- val += src[FFABS(sample_index + i) % src_size] * filter[i];
- }else if(sample_index + c->filter_length > src_size){
- break;
- }else if(c->linear){
- int64_t v=0;
- int sub_phase= (frac<<8) / c->src_incr;
- for(i=0; i<c->filter_length; i++){
- int64_t coeff= filter[i]*(256 - sub_phase) + filter[i + c->filter_length]*sub_phase;
- v += src[sample_index + i] * coeff;
- }
- val= v>>8;
- }else{
- for(i=0; i<c->filter_length; i++){
- val += src[sample_index + i] * (FELEM2)filter[i];
- }
- }
-
- val = (val + (1<<(FILTER_SHIFT-1)))>>FILTER_SHIFT;
- dst[dst_index] = (unsigned)(val + 32768) > 65535 ? (val>>31) ^ 32767 : val;
-
- frac += dst_incr_frac;
- index += dst_incr;
- if(frac >= c->src_incr){
- frac -= c->src_incr;
- index++;
- }
-
- if(dst_index + 1 == compensation_distance){
- compensation_distance= 0;
- dst_incr_frac= c->ideal_dst_incr % c->src_incr;
- dst_incr= c->ideal_dst_incr / c->src_incr;
- }
- }
- }
- *consumed= FFMAX(index, 0) >> c->phase_shift;
- if(index>=0) index &= c->phase_mask;
-
- if(compensation_distance){
- compensation_distance -= dst_index;
- assert(compensation_distance > 0);
- }
- if(update_ctx){
- c->frac= frac;
- c->index= index;
- c->dst_incr= dst_incr_frac + c->src_incr*dst_incr;
- c->compensation_distance= compensation_distance;
- }
-#if 0
- if(update_ctx && !c->compensation_distance){
-#undef rand
- av_resample_compensate(c, rand() % (8000*2) - 8000, 8000*2);
-av_log(NULL, AV_LOG_DEBUG, "%d %d %d\n", c->dst_incr, c->ideal_dst_incr, c->compensation_distance);
- }
-#endif
-
- return dst_index;
-}
diff --git a/src/libffmpeg/libavcodec/roqvideo.c b/src/libffmpeg/libavcodec/roqvideo.c
deleted file mode 100644
index 4595b047c..000000000
--- a/src/libffmpeg/libavcodec/roqvideo.c
+++ /dev/null
@@ -1,474 +0,0 @@
-/*
- * Copyright (C) 2003 the ffmpeg project
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file roqvideo.c
- * Id RoQ Video Decoder by Dr. Tim Ferguson
- * For more information about the Id RoQ format, visit:
- * http://www.csse.monash.edu.au/~timf/
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "common.h"
-#include "avcodec.h"
-#include "dsputil.h"
-
-typedef struct {
- unsigned char y0, y1, y2, y3, u, v;
-} roq_cell;
-
-typedef struct {
- int idx[4];
-} roq_qcell;
-
-static int uiclip[1024], *uiclp; /* clipping table */
-#define avg2(a,b) uiclp[(((int)(a)+(int)(b)+1)>>1)]
-#define avg4(a,b,c,d) uiclp[(((int)(a)+(int)(b)+(int)(c)+(int)(d)+2)>>2)]
-
-typedef struct RoqContext {
-
- AVCodecContext *avctx;
- DSPContext dsp;
- AVFrame last_frame;
- AVFrame current_frame;
- int first_frame;
- int y_stride;
- int c_stride;
-
- roq_cell cells[256];
- roq_qcell qcells[256];
-
- unsigned char *buf;
- int size;
-
-} RoqContext;
-
-#define RoQ_INFO 0x1001
-#define RoQ_QUAD_CODEBOOK 0x1002
-#define RoQ_QUAD_VQ 0x1011
-#define RoQ_SOUND_MONO 0x1020
-#define RoQ_SOUND_STEREO 0x1021
-
-#define RoQ_ID_MOT 0x00
-#define RoQ_ID_FCC 0x01
-#define RoQ_ID_SLD 0x02
-#define RoQ_ID_CCC 0x03
-
-#define get_byte(in_buffer) *(in_buffer++)
-#define get_word(in_buffer) ((unsigned short)(in_buffer += 2, \
- (in_buffer[-1] << 8 | in_buffer[-2])))
-#define get_long(in_buffer) ((unsigned long)(in_buffer += 4, \
- (in_buffer[-1] << 24 | in_buffer[-2] << 16 | in_buffer[-3] << 8 | in_buffer[-4])))
-
-
-static void apply_vector_2x2(RoqContext *ri, int x, int y, roq_cell *cell)
-{
- unsigned char *yptr;
-
- yptr = ri->current_frame.data[0] + (y * ri->y_stride) + x;
- *yptr++ = cell->y0;
- *yptr++ = cell->y1;
- yptr += (ri->y_stride - 2);
- *yptr++ = cell->y2;
- *yptr++ = cell->y3;
- ri->current_frame.data[1][(y/2) * (ri->c_stride) + x/2] = cell->u;
- ri->current_frame.data[2][(y/2) * (ri->c_stride) + x/2] = cell->v;
-}
-
-static void apply_vector_4x4(RoqContext *ri, int x, int y, roq_cell *cell)
-{
- unsigned long row_inc, c_row_inc;
- register unsigned char y0, y1, u, v;
- unsigned char *yptr, *uptr, *vptr;
-
- yptr = ri->current_frame.data[0] + (y * ri->y_stride) + x;
- uptr = ri->current_frame.data[1] + (y/2) * (ri->c_stride) + x/2;
- vptr = ri->current_frame.data[2] + (y/2) * (ri->c_stride) + x/2;
-
- row_inc = ri->y_stride - 4;
- c_row_inc = (ri->c_stride) - 2;
- *yptr++ = y0 = cell->y0; *uptr++ = u = cell->u; *vptr++ = v = cell->v;
- *yptr++ = y0;
- *yptr++ = y1 = cell->y1; *uptr++ = u; *vptr++ = v;
- *yptr++ = y1;
-
- yptr += row_inc;
-
- *yptr++ = y0;
- *yptr++ = y0;
- *yptr++ = y1;
- *yptr++ = y1;
-
- yptr += row_inc; uptr += c_row_inc; vptr += c_row_inc;
-
- *yptr++ = y0 = cell->y2; *uptr++ = u; *vptr++ = v;
- *yptr++ = y0;
- *yptr++ = y1 = cell->y3; *uptr++ = u; *vptr++ = v;
- *yptr++ = y1;
-
- yptr += row_inc;
-
- *yptr++ = y0;
- *yptr++ = y0;
- *yptr++ = y1;
- *yptr++ = y1;
-}
-
-static void apply_motion_4x4(RoqContext *ri, int x, int y, unsigned char mv,
- signed char mean_x, signed char mean_y)
-{
- int i, hw, mx, my;
- unsigned char *pa, *pb;
-
- mx = x + 8 - (mv >> 4) - mean_x;
- my = y + 8 - (mv & 0xf) - mean_y;
-
- /* check MV against frame boundaries */
- if ((mx < 0) || (mx > ri->avctx->width - 4) ||
- (my < 0) || (my > ri->avctx->height - 4)) {
- av_log(ri->avctx, AV_LOG_ERROR, "motion vector out of bounds: MV = (%d, %d), boundaries = (0, 0, %d, %d)\n",
- mx, my, ri->avctx->width, ri->avctx->height);
- return;
- }
-
- pa = ri->current_frame.data[0] + (y * ri->y_stride) + x;
- pb = ri->last_frame.data[0] + (my * ri->y_stride) + mx;
- for(i = 0; i < 4; i++) {
- pa[0] = pb[0];
- pa[1] = pb[1];
- pa[2] = pb[2];
- pa[3] = pb[3];
- pa += ri->y_stride;
- pb += ri->y_stride;
- }
-
- hw = ri->y_stride/2;
- pa = ri->current_frame.data[1] + (y * ri->y_stride)/4 + x/2;
- pb = ri->last_frame.data[1] + (my/2) * (ri->y_stride/2) + (mx + 1)/2;
-
- for(i = 0; i < 2; i++) {
- switch(((my & 0x01) << 1) | (mx & 0x01)) {
-
- case 0:
- pa[0] = pb[0];
- pa[1] = pb[1];
- pa[hw] = pb[hw];
- pa[hw+1] = pb[hw+1];
- break;
-
- case 1:
- pa[0] = avg2(pb[0], pb[1]);
- pa[1] = avg2(pb[1], pb[2]);
- pa[hw] = avg2(pb[hw], pb[hw+1]);
- pa[hw+1] = avg2(pb[hw+1], pb[hw+2]);
- break;
-
- case 2:
- pa[0] = avg2(pb[0], pb[hw]);
- pa[1] = avg2(pb[1], pb[hw+1]);
- pa[hw] = avg2(pb[hw], pb[hw*2]);
- pa[hw+1] = avg2(pb[hw+1], pb[(hw*2)+1]);
- break;
-
- case 3:
- pa[0] = avg4(pb[0], pb[1], pb[hw], pb[hw+1]);
- pa[1] = avg4(pb[1], pb[2], pb[hw+1], pb[hw+2]);
- pa[hw] = avg4(pb[hw], pb[hw+1], pb[hw*2], pb[(hw*2)+1]);
- pa[hw+1] = avg4(pb[hw+1], pb[hw+2], pb[(hw*2)+1], pb[(hw*2)+1]);
- break;
- }
-
- pa = ri->current_frame.data[2] + (y * ri->y_stride)/4 + x/2;
- pb = ri->last_frame.data[2] + (my/2) * (ri->y_stride/2) + (mx + 1)/2;
- }
-}
-
-static void apply_motion_8x8(RoqContext *ri, int x, int y,
- unsigned char mv, signed char mean_x, signed char mean_y)
-{
- int mx, my, i, j, hw;
- unsigned char *pa, *pb;
-
- mx = x + 8 - (mv >> 4) - mean_x;
- my = y + 8 - (mv & 0xf) - mean_y;
-
- /* check MV against frame boundaries */
- if ((mx < 0) || (mx > ri->avctx->width - 8) ||
- (my < 0) || (my > ri->avctx->height - 8)) {
- av_log(ri->avctx, AV_LOG_ERROR, "motion vector out of bounds: MV = (%d, %d), boundaries = (0, 0, %d, %d)\n",
- mx, my, ri->avctx->width, ri->avctx->height);
- return;
- }
-
- pa = ri->current_frame.data[0] + (y * ri->y_stride) + x;
- pb = ri->last_frame.data[0] + (my * ri->y_stride) + mx;
- for(i = 0; i < 8; i++) {
- pa[0] = pb[0];
- pa[1] = pb[1];
- pa[2] = pb[2];
- pa[3] = pb[3];
- pa[4] = pb[4];
- pa[5] = pb[5];
- pa[6] = pb[6];
- pa[7] = pb[7];
- pa += ri->y_stride;
- pb += ri->y_stride;
- }
-
- hw = ri->c_stride;
- pa = ri->current_frame.data[1] + (y * ri->y_stride)/4 + x/2;
- pb = ri->last_frame.data[1] + (my/2) * (ri->y_stride/2) + (mx + 1)/2;
- for(j = 0; j < 2; j++) {
- for(i = 0; i < 4; i++) {
- switch(((my & 0x01) << 1) | (mx & 0x01)) {
-
- case 0:
- pa[0] = pb[0];
- pa[1] = pb[1];
- pa[2] = pb[2];
- pa[3] = pb[3];
- break;
-
- case 1:
- pa[0] = avg2(pb[0], pb[1]);
- pa[1] = avg2(pb[1], pb[2]);
- pa[2] = avg2(pb[2], pb[3]);
- pa[3] = avg2(pb[3], pb[4]);
- break;
-
- case 2:
- pa[0] = avg2(pb[0], pb[hw]);
- pa[1] = avg2(pb[1], pb[hw+1]);
- pa[2] = avg2(pb[2], pb[hw+2]);
- pa[3] = avg2(pb[3], pb[hw+3]);
- break;
-
- case 3:
- pa[0] = avg4(pb[0], pb[1], pb[hw], pb[hw+1]);
- pa[1] = avg4(pb[1], pb[2], pb[hw+1], pb[hw+2]);
- pa[2] = avg4(pb[2], pb[3], pb[hw+2], pb[hw+3]);
- pa[3] = avg4(pb[3], pb[4], pb[hw+3], pb[hw+4]);
- break;
- }
- pa += ri->c_stride;
- pb += ri->c_stride;
- }
-
- pa = ri->current_frame.data[2] + (y * ri->y_stride)/4 + x/2;
- pb = ri->last_frame.data[2] + (my/2) * (ri->y_stride/2) + (mx + 1)/2;
- }
-}
-
-static void roqvideo_decode_frame(RoqContext *ri)
-{
- unsigned int chunk_id = 0, chunk_arg = 0;
- unsigned long chunk_size = 0;
- int i, j, k, nv1, nv2, vqflg = 0, vqflg_pos = -1;
- int vqid, bpos, xpos, ypos, xp, yp, x, y;
- int frame_stats[2][4] = {{0},{0}};
- roq_qcell *qcell;
- unsigned char *buf = ri->buf;
- unsigned char *buf_end = ri->buf + ri->size;
-
- while (buf < buf_end) {
- chunk_id = get_word(buf);
- chunk_size = get_long(buf);
- chunk_arg = get_word(buf);
-
- if(chunk_id == RoQ_QUAD_VQ)
- break;
- if(chunk_id == RoQ_QUAD_CODEBOOK) {
- if((nv1 = chunk_arg >> 8) == 0)
- nv1 = 256;
- if((nv2 = chunk_arg & 0xff) == 0 && nv1 * 6 < chunk_size)
- nv2 = 256;
- for(i = 0; i < nv1; i++) {
- ri->cells[i].y0 = get_byte(buf);
- ri->cells[i].y1 = get_byte(buf);
- ri->cells[i].y2 = get_byte(buf);
- ri->cells[i].y3 = get_byte(buf);
- ri->cells[i].u = get_byte(buf);
- ri->cells[i].v = get_byte(buf);
- }
- for(i = 0; i < nv2; i++)
- for(j = 0; j < 4; j++)
- ri->qcells[i].idx[j] = get_byte(buf);
- }
- }
-
- bpos = xpos = ypos = 0;
- while(bpos < chunk_size) {
- for (yp = ypos; yp < ypos + 16; yp += 8)
- for (xp = xpos; xp < xpos + 16; xp += 8) {
- if (vqflg_pos < 0) {
- vqflg = buf[bpos++]; vqflg |= (buf[bpos++] << 8);
- vqflg_pos = 7;
- }
- vqid = (vqflg >> (vqflg_pos * 2)) & 0x3;
- frame_stats[0][vqid]++;
- vqflg_pos--;
-
- switch(vqid) {
- case RoQ_ID_MOT:
- apply_motion_8x8(ri, xp, yp, 0, 8, 8);
- break;
- case RoQ_ID_FCC:
- apply_motion_8x8(ri, xp, yp, buf[bpos++], chunk_arg >> 8,
- chunk_arg & 0xff);
- break;
- case RoQ_ID_SLD:
- qcell = ri->qcells + buf[bpos++];
- apply_vector_4x4(ri, xp, yp, ri->cells + qcell->idx[0]);
- apply_vector_4x4(ri, xp+4, yp, ri->cells + qcell->idx[1]);
- apply_vector_4x4(ri, xp, yp+4, ri->cells + qcell->idx[2]);
- apply_vector_4x4(ri, xp+4, yp+4, ri->cells + qcell->idx[3]);
- break;
- case RoQ_ID_CCC:
- for (k = 0; k < 4; k++) {
- x = xp; y = yp;
- if(k & 0x01) x += 4;
- if(k & 0x02) y += 4;
-
- if (vqflg_pos < 0) {
- vqflg = buf[bpos++];
- vqflg |= (buf[bpos++] << 8);
- vqflg_pos = 7;
- }
- vqid = (vqflg >> (vqflg_pos * 2)) & 0x3;
- frame_stats[1][vqid]++;
- vqflg_pos--;
- switch(vqid) {
- case RoQ_ID_MOT:
- apply_motion_4x4(ri, x, y, 0, 8, 8);
- break;
- case RoQ_ID_FCC:
- apply_motion_4x4(ri, x, y, buf[bpos++],
- chunk_arg >> 8, chunk_arg & 0xff);
- break;
- case RoQ_ID_SLD:
- qcell = ri->qcells + buf[bpos++];
- apply_vector_2x2(ri, x, y, ri->cells + qcell->idx[0]);
- apply_vector_2x2(ri, x+2, y, ri->cells + qcell->idx[1]);
- apply_vector_2x2(ri, x, y+2, ri->cells + qcell->idx[2]);
- apply_vector_2x2(ri, x+2, y+2, ri->cells + qcell->idx[3]);
- break;
- case RoQ_ID_CCC:
- apply_vector_2x2(ri, x, y, ri->cells + buf[bpos]);
- apply_vector_2x2(ri, x+2, y, ri->cells + buf[bpos+1]);
- apply_vector_2x2(ri, x, y+2, ri->cells + buf[bpos+2]);
- apply_vector_2x2(ri, x+2, y+2, ri->cells + buf[bpos+3]);
- bpos += 4;
- break;
- }
- }
- break;
- default:
- av_log(ri->avctx, AV_LOG_ERROR, "Unknown vq code: %d\n", vqid);
- }
- }
-
- xpos += 16;
- if (xpos >= ri->avctx->width) {
- xpos -= ri->avctx->width;
- ypos += 16;
- }
- if(ypos >= ri->avctx->height)
- break;
- }
-}
-
-
-static int roq_decode_init(AVCodecContext *avctx)
-{
- RoqContext *s = avctx->priv_data;
- int i;
-
- s->avctx = avctx;
- s->first_frame = 1;
- avctx->pix_fmt = PIX_FMT_YUV420P;
- avctx->has_b_frames = 0;
- dsputil_init(&s->dsp, avctx);
-
- uiclp = uiclip+512;
- for(i = -512; i < 512; i++)
- uiclp[i] = (i < 0 ? 0 : (i > 255 ? 255 : i));
-
- return 0;
-}
-
-static int roq_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- RoqContext *s = avctx->priv_data;
-
- if (avctx->get_buffer(avctx, &s->current_frame)) {
- av_log(avctx, AV_LOG_ERROR, " RoQ: get_buffer() failed\n");
- return -1;
- }
- s->y_stride = s->current_frame.linesize[0];
- s->c_stride = s->current_frame.linesize[1];
-
- s->buf = buf;
- s->size = buf_size;
- roqvideo_decode_frame(s);
-
- /* release the last frame if it is allocated */
- if (s->first_frame)
- s->first_frame = 0;
- else
- avctx->release_buffer(avctx, &s->last_frame);
-
- /* shuffle frames */
- s->last_frame = s->current_frame;
-
- *data_size = sizeof(AVFrame);
- *(AVFrame*)data = s->current_frame;
-
- return buf_size;
-}
-
-static int roq_decode_end(AVCodecContext *avctx)
-{
- RoqContext *s = avctx->priv_data;
-
- /* release the last frame */
- if (s->last_frame.data[0])
- avctx->release_buffer(avctx, &s->last_frame);
-
- return 0;
-}
-
-AVCodec roq_decoder = {
- "roqvideo",
- CODEC_TYPE_VIDEO,
- CODEC_ID_ROQ,
- sizeof(RoqContext),
- roq_decode_init,
- NULL,
- roq_decode_end,
- roq_decode_frame,
- CODEC_CAP_DR1,
-};
diff --git a/src/libffmpeg/libavcodec/rpza.c b/src/libffmpeg/libavcodec/rpza.c
deleted file mode 100644
index 8ab5dbb92..000000000
--- a/src/libffmpeg/libavcodec/rpza.c
+++ /dev/null
@@ -1,292 +0,0 @@
-/*
- * Quicktime Video (RPZA) Video Decoder
- * Copyright (C) 2003 the ffmpeg project
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file rpza.c
- * QT RPZA Video Decoder by Roberto Togni <rtogni@bresciaonline.it>
- * For more information about the RPZA format, visit:
- * http://www.pcisys.net/~melanson/codecs/
- *
- * The RPZA decoder outputs RGB555 colorspace data.
- *
- * Note that this decoder reads big endian RGB555 pixel values from the
- * bytestream, arranges them in the host's endian order, and outputs
- * them to the final rendered map in the same host endian order. This is
- * intended behavior as the ffmpeg documentation states that RGB555 pixels
- * shall be stored in native CPU endianness.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "common.h"
-#include "avcodec.h"
-#include "dsputil.h"
-
-typedef struct RpzaContext {
-
- AVCodecContext *avctx;
- DSPContext dsp;
- AVFrame frame;
-
- unsigned char *buf;
- int size;
-
-} RpzaContext;
-
-#define ADVANCE_BLOCK() \
-{ \
- pixel_ptr += 4; \
- if (pixel_ptr >= width) \
- { \
- pixel_ptr = 0; \
- row_ptr += stride * 4; \
- } \
- total_blocks--; \
- if (total_blocks < 0) \
- { \
- av_log(s->avctx, AV_LOG_ERROR, "warning: block counter just went negative (this should not happen)\n"); \
- return; \
- } \
-}
-
-static void rpza_decode_stream(RpzaContext *s)
-{
- int width = s->avctx->width;
- int stride = s->frame.linesize[0] / 2;
- int row_inc = stride - 4;
- int stream_ptr = 0;
- int chunk_size;
- unsigned char opcode;
- int n_blocks;
- unsigned short colorA = 0, colorB;
- unsigned short color4[4];
- unsigned char index, idx;
- unsigned short ta, tb;
- unsigned short *pixels = (unsigned short *)s->frame.data[0];
-
- int row_ptr = 0;
- int pixel_ptr = 0;
- int block_ptr;
- int pixel_x, pixel_y;
- int total_blocks;
-
- /* First byte is always 0xe1. Warn if it's different */
- if (s->buf[stream_ptr] != 0xe1)
- av_log(s->avctx, AV_LOG_ERROR, "First chunk byte is 0x%02x instead of 0xe1\n",
- s->buf[stream_ptr]);
-
- /* Get chunk size, ingnoring first byte */
- chunk_size = AV_RB32(&s->buf[stream_ptr]) & 0x00FFFFFF;
- stream_ptr += 4;
-
- /* If length mismatch use size from MOV file and try to decode anyway */
- if (chunk_size != s->size)
- av_log(s->avctx, AV_LOG_ERROR, "MOV chunk size != encoded chunk size; using MOV chunk size\n");
-
- chunk_size = s->size;
-
- /* Number of 4x4 blocks in frame. */
- total_blocks = ((s->avctx->width + 3) / 4) * ((s->avctx->height + 3) / 4);
-
- /* Process chunk data */
- while (stream_ptr < chunk_size) {
- opcode = s->buf[stream_ptr++]; /* Get opcode */
-
- n_blocks = (opcode & 0x1f) + 1; /* Extract block counter from opcode */
-
- /* If opcode MSbit is 0, we need more data to decide what to do */
- if ((opcode & 0x80) == 0) {
- colorA = (opcode << 8) | (s->buf[stream_ptr++]);
- opcode = 0;
- if ((s->buf[stream_ptr] & 0x80) != 0) {
- /* Must behave as opcode 110xxxxx, using colorA computed
- * above. Use fake opcode 0x20 to enter switch block at
- * the right place */
- opcode = 0x20;
- n_blocks = 1;
- }
- }
-
- switch (opcode & 0xe0) {
-
- /* Skip blocks */
- case 0x80:
- while (n_blocks--) {
- ADVANCE_BLOCK();
- }
- break;
-
- /* Fill blocks with one color */
- case 0xa0:
- colorA = AV_RB16 (&s->buf[stream_ptr]);
- stream_ptr += 2;
- while (n_blocks--) {
- block_ptr = row_ptr + pixel_ptr;
- for (pixel_y = 0; pixel_y < 4; pixel_y++) {
- for (pixel_x = 0; pixel_x < 4; pixel_x++){
- pixels[block_ptr] = colorA;
- block_ptr++;
- }
- block_ptr += row_inc;
- }
- ADVANCE_BLOCK();
- }
- break;
-
- /* Fill blocks with 4 colors */
- case 0xc0:
- colorA = AV_RB16 (&s->buf[stream_ptr]);
- stream_ptr += 2;
- case 0x20:
- colorB = AV_RB16 (&s->buf[stream_ptr]);
- stream_ptr += 2;
-
- /* sort out the colors */
- color4[0] = colorB;
- color4[1] = 0;
- color4[2] = 0;
- color4[3] = colorA;
-
- /* red components */
- ta = (colorA >> 10) & 0x1F;
- tb = (colorB >> 10) & 0x1F;
- color4[1] |= ((11 * ta + 21 * tb) >> 5) << 10;
- color4[2] |= ((21 * ta + 11 * tb) >> 5) << 10;
-
- /* green components */
- ta = (colorA >> 5) & 0x1F;
- tb = (colorB >> 5) & 0x1F;
- color4[1] |= ((11 * ta + 21 * tb) >> 5) << 5;
- color4[2] |= ((21 * ta + 11 * tb) >> 5) << 5;
-
- /* blue components */
- ta = colorA & 0x1F;
- tb = colorB & 0x1F;
- color4[1] |= ((11 * ta + 21 * tb) >> 5);
- color4[2] |= ((21 * ta + 11 * tb) >> 5);
-
- while (n_blocks--) {
- block_ptr = row_ptr + pixel_ptr;
- for (pixel_y = 0; pixel_y < 4; pixel_y++) {
- index = s->buf[stream_ptr++];
- for (pixel_x = 0; pixel_x < 4; pixel_x++){
- idx = (index >> (2 * (3 - pixel_x))) & 0x03;
- pixels[block_ptr] = color4[idx];
- block_ptr++;
- }
- block_ptr += row_inc;
- }
- ADVANCE_BLOCK();
- }
- break;
-
- /* Fill block with 16 colors */
- case 0x00:
- block_ptr = row_ptr + pixel_ptr;
- for (pixel_y = 0; pixel_y < 4; pixel_y++) {
- for (pixel_x = 0; pixel_x < 4; pixel_x++){
- /* We already have color of upper left pixel */
- if ((pixel_y != 0) || (pixel_x !=0)) {
- colorA = AV_RB16 (&s->buf[stream_ptr]);
- stream_ptr += 2;
- }
- pixels[block_ptr] = colorA;
- block_ptr++;
- }
- block_ptr += row_inc;
- }
- ADVANCE_BLOCK();
- break;
-
- /* Unknown opcode */
- default:
- av_log(s->avctx, AV_LOG_ERROR, "Unknown opcode %d in rpza chunk."
- " Skip remaining %d bytes of chunk data.\n", opcode,
- chunk_size - stream_ptr);
- return;
- } /* Opcode switch */
- }
-}
-
-static int rpza_decode_init(AVCodecContext *avctx)
-{
- RpzaContext *s = (RpzaContext *)avctx->priv_data;
-
- s->avctx = avctx;
- avctx->pix_fmt = PIX_FMT_RGB555;
- avctx->has_b_frames = 0;
- dsputil_init(&s->dsp, avctx);
-
- s->frame.data[0] = NULL;
-
- return 0;
-}
-
-static int rpza_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- RpzaContext *s = (RpzaContext *)avctx->priv_data;
-
- s->buf = buf;
- s->size = buf_size;
-
- s->frame.reference = 1;
- s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
- if (avctx->reget_buffer(avctx, &s->frame)) {
- av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
- return -1;
- }
-
- rpza_decode_stream(s);
-
- *data_size = sizeof(AVFrame);
- *(AVFrame*)data = s->frame;
-
- /* always report that the buffer was completely consumed */
- return buf_size;
-}
-
-static int rpza_decode_end(AVCodecContext *avctx)
-{
- RpzaContext *s = (RpzaContext *)avctx->priv_data;
-
- if (s->frame.data[0])
- avctx->release_buffer(avctx, &s->frame);
-
- return 0;
-}
-
-AVCodec rpza_decoder = {
- "rpza",
- CODEC_TYPE_VIDEO,
- CODEC_ID_RPZA,
- sizeof(RpzaContext),
- rpza_decode_init,
- NULL,
- rpza_decode_end,
- rpza_decode_frame,
- CODEC_CAP_DR1,
-};
diff --git a/src/libffmpeg/libavcodec/rtjpeg.c b/src/libffmpeg/libavcodec/rtjpeg.c
deleted file mode 100644
index dbc6cfd88..000000000
--- a/src/libffmpeg/libavcodec/rtjpeg.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * RTJpeg decoding functions
- * Copyright (c) 2006 Reimar Doeffinger
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "common.h"
-#include "bitstream.h"
-#include "dsputil.h"
-#include "rtjpeg.h"
-
-#define PUT_COEFF(c) \
- i = scan[coeff--]; \
- block[i] = (c) * quant[i];
-
-//! aligns the bitstream to the give power of two
-#define ALIGN(a) \
- n = (-get_bits_count(gb)) & (a - 1); \
- if (n) {skip_bits(gb, n);}
-
-/**
- * \brief read one block from stream
- * \param gb contains stream data
- * \param block where data is written to
- * \param scan array containing the mapping stream address -> block position
- * \param quant quantization factors
- *
- * Note: GetBitContext is used to make the code simpler, since all data is
- * aligned this could be done faster in a different way, e.g. as it is done
- * in MPlayer libmpcodecs/native/RTjpegN.c
- */
-static inline int get_block(GetBitContext *gb, DCTELEM *block, uint8_t *scan,
- uint32_t *quant) {
- int coeff, i, n;
- int8_t ac;
- uint8_t dc = get_bits(gb, 8);
-
- // block not coded
- if (dc == 255)
- return 0;
-
- // number of non-zero coefficients
- coeff = get_bits(gb, 6);
- // normally we would only need to clear the (63 - coeff) last values,
- // but since we do not know where they are we just clear the whole block
- memset(block, 0, 64 * sizeof(DCTELEM));
-
- // 2 bits per coefficient
- while (coeff) {
- ac = get_sbits(gb, 2);
- if (ac == -2)
- break; // continue with more bits
- PUT_COEFF(ac);
- }
-
- // 4 bits per coefficient
- ALIGN(4);
- while (coeff) {
- ac = get_sbits(gb, 4);
- if (ac == -8)
- break; // continue with more bits
- PUT_COEFF(ac);
- }
-
- // 8 bits per coefficient
- ALIGN(8);
- while (coeff) {
- ac = get_sbits(gb, 8);
- PUT_COEFF(ac);
- }
-
- PUT_COEFF(dc);
- return 1;
-}
-
-/**
- * \brief decode one rtjpeg YUV420 frame
- * \param c context, must be initialized via rtjpeg_decode_init
- * \param f AVFrame to place decoded frame into. If parts of the frame
- * are not coded they are left unchanged, so consider initializing it
- * \param buf buffer containing input data
- * \param buf_size length of input data in bytes
- * \return number of bytes consumed from the input buffer
- */
-int rtjpeg_decode_frame_yuv420(RTJpegContext *c, AVFrame *f,
- uint8_t *buf, int buf_size) {
- DECLARE_ALIGNED_16(DCTELEM, block[64]);
- GetBitContext gb;
- int w = c->w / 16, h = c->h / 16;
- int x, y;
- uint8_t *y1 = f->data[0], *y2 = f->data[0] + 8 * f->linesize[0];
- uint8_t *u = f->data[1], *v = f->data[2];
- init_get_bits(&gb, buf, buf_size * 8);
- for (y = 0; y < h; y++) {
- for (x = 0; x < w; x++) {
- if (get_block(&gb, block, c->scan, c->lquant))
- c->dsp->idct_put(y1, f->linesize[0], block);
- y1 += 8;
- if (get_block(&gb, block, c->scan, c->lquant))
- c->dsp->idct_put(y1, f->linesize[0], block);
- y1 += 8;
- if (get_block(&gb, block, c->scan, c->lquant))
- c->dsp->idct_put(y2, f->linesize[0], block);
- y2 += 8;
- if (get_block(&gb, block, c->scan, c->lquant))
- c->dsp->idct_put(y2, f->linesize[0], block);
- y2 += 8;
- if (get_block(&gb, block, c->scan, c->cquant))
- c->dsp->idct_put(u, f->linesize[1], block);
- u += 8;
- if (get_block(&gb, block, c->scan, c->cquant))
- c->dsp->idct_put(v, f->linesize[2], block);
- v += 8;
- }
- y1 += 2 * 8 * (f->linesize[0] - w);
- y2 += 2 * 8 * (f->linesize[0] - w);
- u += 8 * (f->linesize[1] - w);
- v += 8 * (f->linesize[2] - w);
- }
- return get_bits_count(&gb) / 8;
-}
-
-/**
- * \brief initialize an RTJpegContext, may be called multiple times
- * \param c context to initialize
- * \param dsp specifies the idct to use for decoding
- * \param width width of image, will be rounded down to the nearest multiple
- * of 16 for decoding
- * \param height height of image, will be rounded down to the nearest multiple
- * of 16 for decoding
- * \param lquant luma quantization table to use
- * \param cquant chroma quantization table to use
- */
-void rtjpeg_decode_init(RTJpegContext *c, DSPContext *dsp,
- int width, int height,
- uint32_t *lquant, uint32_t *cquant) {
- int i;
- c->dsp = dsp;
- for (i = 0; i < 64; i++) {
- int z = ff_zigzag_direct[i];
- int p = c->dsp->idct_permutation[i];
- z = ((z << 3) | (z >> 3)) & 63; // rtjpeg uses a transposed variant
-
- // permute the scan and quantization tables for the chosen idct
- c->scan[i] = c->dsp->idct_permutation[z];
- c->lquant[p] = lquant[i];
- c->cquant[p] = cquant[i];
- }
- c->w = width;
- c->h = height;
-}
diff --git a/src/libffmpeg/libavcodec/rtjpeg.h b/src/libffmpeg/libavcodec/rtjpeg.h
deleted file mode 100644
index daecc8a75..000000000
--- a/src/libffmpeg/libavcodec/rtjpeg.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * RTJpeg decoding functions
- * copyright (c) 2006 Reimar Doeffinger
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef RTJPEG_H
-#define RTJPEG_H
-
-typedef struct {
- int w, h;
- DSPContext *dsp;
- uint8_t scan[64];
- uint32_t lquant[64];
- uint32_t cquant[64];
-} RTJpegContext;
-
-void rtjpeg_decode_init(RTJpegContext *c, DSPContext *dsp,
- int width, int height,
- uint32_t *lquant, uint32_t *cquant);
-
-int rtjpeg_decode_frame_yuv420(RTJpegContext *c, AVFrame *f,
- uint8_t *buf, int buf_size);
-#endif
diff --git a/src/libffmpeg/libavcodec/rv10.c b/src/libffmpeg/libavcodec/rv10.c
deleted file mode 100644
index af438a34b..000000000
--- a/src/libffmpeg/libavcodec/rv10.c
+++ /dev/null
@@ -1,803 +0,0 @@
-/*
- * RV10 codec
- * Copyright (c) 2000,2001 Fabrice Bellard.
- * Copyright (c) 2002-2004 Michael Niedermayer
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file rv10.c
- * RV10 codec.
- */
-
-#include "avcodec.h"
-#include "dsputil.h"
-#include "mpegvideo.h"
-
-//#define DEBUG
-
-#define DC_VLC_BITS 14 //FIXME find a better solution
-
-static const uint16_t rv_lum_code[256] =
-{
- 0x3e7f, 0x0f00, 0x0f01, 0x0f02, 0x0f03, 0x0f04, 0x0f05, 0x0f06,
- 0x0f07, 0x0f08, 0x0f09, 0x0f0a, 0x0f0b, 0x0f0c, 0x0f0d, 0x0f0e,
- 0x0f0f, 0x0f10, 0x0f11, 0x0f12, 0x0f13, 0x0f14, 0x0f15, 0x0f16,
- 0x0f17, 0x0f18, 0x0f19, 0x0f1a, 0x0f1b, 0x0f1c, 0x0f1d, 0x0f1e,
- 0x0f1f, 0x0f20, 0x0f21, 0x0f22, 0x0f23, 0x0f24, 0x0f25, 0x0f26,
- 0x0f27, 0x0f28, 0x0f29, 0x0f2a, 0x0f2b, 0x0f2c, 0x0f2d, 0x0f2e,
- 0x0f2f, 0x0f30, 0x0f31, 0x0f32, 0x0f33, 0x0f34, 0x0f35, 0x0f36,
- 0x0f37, 0x0f38, 0x0f39, 0x0f3a, 0x0f3b, 0x0f3c, 0x0f3d, 0x0f3e,
- 0x0f3f, 0x0380, 0x0381, 0x0382, 0x0383, 0x0384, 0x0385, 0x0386,
- 0x0387, 0x0388, 0x0389, 0x038a, 0x038b, 0x038c, 0x038d, 0x038e,
- 0x038f, 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396,
- 0x0397, 0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d, 0x039e,
- 0x039f, 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6,
- 0x00c7, 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce,
- 0x00cf, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056,
- 0x0057, 0x0020, 0x0021, 0x0022, 0x0023, 0x000c, 0x000d, 0x0004,
- 0x0000, 0x0005, 0x000e, 0x000f, 0x0024, 0x0025, 0x0026, 0x0027,
- 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f,
- 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7,
- 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df,
- 0x03a0, 0x03a1, 0x03a2, 0x03a3, 0x03a4, 0x03a5, 0x03a6, 0x03a7,
- 0x03a8, 0x03a9, 0x03aa, 0x03ab, 0x03ac, 0x03ad, 0x03ae, 0x03af,
- 0x03b0, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7,
- 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf,
- 0x0f40, 0x0f41, 0x0f42, 0x0f43, 0x0f44, 0x0f45, 0x0f46, 0x0f47,
- 0x0f48, 0x0f49, 0x0f4a, 0x0f4b, 0x0f4c, 0x0f4d, 0x0f4e, 0x0f4f,
- 0x0f50, 0x0f51, 0x0f52, 0x0f53, 0x0f54, 0x0f55, 0x0f56, 0x0f57,
- 0x0f58, 0x0f59, 0x0f5a, 0x0f5b, 0x0f5c, 0x0f5d, 0x0f5e, 0x0f5f,
- 0x0f60, 0x0f61, 0x0f62, 0x0f63, 0x0f64, 0x0f65, 0x0f66, 0x0f67,
- 0x0f68, 0x0f69, 0x0f6a, 0x0f6b, 0x0f6c, 0x0f6d, 0x0f6e, 0x0f6f,
- 0x0f70, 0x0f71, 0x0f72, 0x0f73, 0x0f74, 0x0f75, 0x0f76, 0x0f77,
- 0x0f78, 0x0f79, 0x0f7a, 0x0f7b, 0x0f7c, 0x0f7d, 0x0f7e, 0x0f7f,
-};
-
-static const uint8_t rv_lum_bits[256] =
-{
- 14, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 7, 7, 7, 7, 7, 7, 7,
- 7, 6, 6, 6, 6, 5, 5, 4,
- 2, 4, 5, 5, 6, 6, 6, 6,
- 7, 7, 7, 7, 7, 7, 7, 7,
- 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
-};
-
-static const uint16_t rv_chrom_code[256] =
-{
- 0xfe7f, 0x3f00, 0x3f01, 0x3f02, 0x3f03, 0x3f04, 0x3f05, 0x3f06,
- 0x3f07, 0x3f08, 0x3f09, 0x3f0a, 0x3f0b, 0x3f0c, 0x3f0d, 0x3f0e,
- 0x3f0f, 0x3f10, 0x3f11, 0x3f12, 0x3f13, 0x3f14, 0x3f15, 0x3f16,
- 0x3f17, 0x3f18, 0x3f19, 0x3f1a, 0x3f1b, 0x3f1c, 0x3f1d, 0x3f1e,
- 0x3f1f, 0x3f20, 0x3f21, 0x3f22, 0x3f23, 0x3f24, 0x3f25, 0x3f26,
- 0x3f27, 0x3f28, 0x3f29, 0x3f2a, 0x3f2b, 0x3f2c, 0x3f2d, 0x3f2e,
- 0x3f2f, 0x3f30, 0x3f31, 0x3f32, 0x3f33, 0x3f34, 0x3f35, 0x3f36,
- 0x3f37, 0x3f38, 0x3f39, 0x3f3a, 0x3f3b, 0x3f3c, 0x3f3d, 0x3f3e,
- 0x3f3f, 0x0f80, 0x0f81, 0x0f82, 0x0f83, 0x0f84, 0x0f85, 0x0f86,
- 0x0f87, 0x0f88, 0x0f89, 0x0f8a, 0x0f8b, 0x0f8c, 0x0f8d, 0x0f8e,
- 0x0f8f, 0x0f90, 0x0f91, 0x0f92, 0x0f93, 0x0f94, 0x0f95, 0x0f96,
- 0x0f97, 0x0f98, 0x0f99, 0x0f9a, 0x0f9b, 0x0f9c, 0x0f9d, 0x0f9e,
- 0x0f9f, 0x03c0, 0x03c1, 0x03c2, 0x03c3, 0x03c4, 0x03c5, 0x03c6,
- 0x03c7, 0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03cc, 0x03cd, 0x03ce,
- 0x03cf, 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6,
- 0x00e7, 0x0030, 0x0031, 0x0032, 0x0033, 0x0008, 0x0009, 0x0002,
- 0x0000, 0x0003, 0x000a, 0x000b, 0x0034, 0x0035, 0x0036, 0x0037,
- 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
- 0x03d0, 0x03d1, 0x03d2, 0x03d3, 0x03d4, 0x03d5, 0x03d6, 0x03d7,
- 0x03d8, 0x03d9, 0x03da, 0x03db, 0x03dc, 0x03dd, 0x03de, 0x03df,
- 0x0fa0, 0x0fa1, 0x0fa2, 0x0fa3, 0x0fa4, 0x0fa5, 0x0fa6, 0x0fa7,
- 0x0fa8, 0x0fa9, 0x0faa, 0x0fab, 0x0fac, 0x0fad, 0x0fae, 0x0faf,
- 0x0fb0, 0x0fb1, 0x0fb2, 0x0fb3, 0x0fb4, 0x0fb5, 0x0fb6, 0x0fb7,
- 0x0fb8, 0x0fb9, 0x0fba, 0x0fbb, 0x0fbc, 0x0fbd, 0x0fbe, 0x0fbf,
- 0x3f40, 0x3f41, 0x3f42, 0x3f43, 0x3f44, 0x3f45, 0x3f46, 0x3f47,
- 0x3f48, 0x3f49, 0x3f4a, 0x3f4b, 0x3f4c, 0x3f4d, 0x3f4e, 0x3f4f,
- 0x3f50, 0x3f51, 0x3f52, 0x3f53, 0x3f54, 0x3f55, 0x3f56, 0x3f57,
- 0x3f58, 0x3f59, 0x3f5a, 0x3f5b, 0x3f5c, 0x3f5d, 0x3f5e, 0x3f5f,
- 0x3f60, 0x3f61, 0x3f62, 0x3f63, 0x3f64, 0x3f65, 0x3f66, 0x3f67,
- 0x3f68, 0x3f69, 0x3f6a, 0x3f6b, 0x3f6c, 0x3f6d, 0x3f6e, 0x3f6f,
- 0x3f70, 0x3f71, 0x3f72, 0x3f73, 0x3f74, 0x3f75, 0x3f76, 0x3f77,
- 0x3f78, 0x3f79, 0x3f7a, 0x3f7b, 0x3f7c, 0x3f7d, 0x3f7e, 0x3f7f,
-};
-
-static const uint8_t rv_chrom_bits[256] =
-{
- 16, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 8, 8, 8, 8, 8, 8, 8,
- 8, 6, 6, 6, 6, 4, 4, 3,
- 2, 3, 4, 4, 6, 6, 6, 6,
- 8, 8, 8, 8, 8, 8, 8, 8,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
-};
-
-static VLC rv_dc_lum, rv_dc_chrom;
-
-int rv_decode_dc(MpegEncContext *s, int n)
-{
- int code;
-
- if (n < 4) {
- code = get_vlc2(&s->gb, rv_dc_lum.table, DC_VLC_BITS, 2);
- if (code < 0) {
- /* XXX: I don't understand why they use LONGER codes than
- necessary. The following code would be completely useless
- if they had thought about it !!! */
- code = get_bits(&s->gb, 7);
- if (code == 0x7c) {
- code = (int8_t)(get_bits(&s->gb, 7) + 1);
- } else if (code == 0x7d) {
- code = -128 + get_bits(&s->gb, 7);
- } else if (code == 0x7e) {
- if (get_bits(&s->gb, 1) == 0)
- code = (int8_t)(get_bits(&s->gb, 8) + 1);
- else
- code = (int8_t)(get_bits(&s->gb, 8));
- } else if (code == 0x7f) {
- get_bits(&s->gb, 11);
- code = 1;
- }
- } else {
- code -= 128;
- }
- } else {
- code = get_vlc2(&s->gb, rv_dc_chrom.table, DC_VLC_BITS, 2);
- /* same remark */
- if (code < 0) {
- code = get_bits(&s->gb, 9);
- if (code == 0x1fc) {
- code = (int8_t)(get_bits(&s->gb, 7) + 1);
- } else if (code == 0x1fd) {
- code = -128 + get_bits(&s->gb, 7);
- } else if (code == 0x1fe) {
- get_bits(&s->gb, 9);
- code = 1;
- } else {
- av_log(s->avctx, AV_LOG_ERROR, "chroma dc error\n");
- return 0xffff;
- }
- } else {
- code -= 128;
- }
- }
- return -code;
-}
-
-#ifdef CONFIG_ENCODERS
-
-/* write RV 1.0 compatible frame header */
-void rv10_encode_picture_header(MpegEncContext *s, int picture_number)
-{
- int full_frame= 0;
-
- align_put_bits(&s->pb);
-
- put_bits(&s->pb, 1, 1); /* marker */
-
- put_bits(&s->pb, 1, (s->pict_type == P_TYPE));
-
- put_bits(&s->pb, 1, 0); /* not PB frame */
-
- put_bits(&s->pb, 5, s->qscale);
-
- if (s->pict_type == I_TYPE) {
- /* specific MPEG like DC coding not used */
- }
- /* if multiple packets per frame are sent, the position at which
- to display the macro blocks is coded here */
- if(!full_frame){
- put_bits(&s->pb, 6, 0); /* mb_x */
- put_bits(&s->pb, 6, 0); /* mb_y */
- put_bits(&s->pb, 12, s->mb_width * s->mb_height);
- }
-
- put_bits(&s->pb, 3, 0); /* ignored */
-}
-
-void rv20_encode_picture_header(MpegEncContext *s, int picture_number){
- put_bits(&s->pb, 2, s->pict_type); //I 0 vs. 1 ?
- put_bits(&s->pb, 1, 0); /* unknown bit */
- put_bits(&s->pb, 5, s->qscale);
-
- put_bits(&s->pb, 8, picture_number&0xFF); //FIXME wrong, but correct is not known
- s->mb_x= s->mb_y= 0;
- ff_h263_encode_mba(s);
-
- put_bits(&s->pb, 1, s->no_rounding);
-
- assert(s->f_code == 1);
- assert(s->unrestricted_mv == 1);
-// assert(s->h263_aic== (s->pict_type == I_TYPE));
- assert(s->alt_inter_vlc == 0);
- assert(s->umvplus == 0);
- assert(s->modified_quant==1);
- assert(s->loop_filter==1);
-
- s->h263_aic= s->pict_type == I_TYPE;
- if(s->h263_aic){
- s->y_dc_scale_table=
- s->c_dc_scale_table= ff_aic_dc_scale_table;
- }else{
- s->y_dc_scale_table=
- s->c_dc_scale_table= ff_mpeg1_dc_scale_table;
- }
-}
-
-#if 0 /* unused, remove? */
-static int get_num(GetBitContext *gb)
-{
- int n, n1;
-
- n = get_bits(gb, 16);
- if (n >= 0x4000) {
- return n - 0x4000;
- } else {
- n1 = get_bits(gb, 16);
- return (n << 16) | n1;
- }
-}
-#endif
-
-#endif //CONFIG_ENCODERS
-
-/* read RV 1.0 compatible frame header */
-static int rv10_decode_picture_header(MpegEncContext *s)
-{
- int mb_count, pb_frame, marker, unk, mb_xy;
-
-//printf("ff:%d\n", full_frame);
- marker = get_bits(&s->gb, 1);
-
- if (get_bits(&s->gb, 1))
- s->pict_type = P_TYPE;
- else
- s->pict_type = I_TYPE;
-//printf("h:%X ver:%d\n",h,s->rv10_version);
- if(!marker) av_log(s->avctx, AV_LOG_ERROR, "marker missing\n");
- pb_frame = get_bits(&s->gb, 1);
-
-#ifdef DEBUG
- av_log(s->avctx, AV_LOG_DEBUG, "pict_type=%d pb_frame=%d\n", s->pict_type, pb_frame);
-#endif
-
- if (pb_frame){
- av_log(s->avctx, AV_LOG_ERROR, "pb frame not supported\n");
- return -1;
- }
-
- s->qscale = get_bits(&s->gb, 5);
- if(s->qscale==0){
- av_log(s->avctx, AV_LOG_ERROR, "error, qscale:0\n");
- return -1;
- }
-
- if (s->pict_type == I_TYPE) {
- if (s->rv10_version == 3) {
- /* specific MPEG like DC coding not used */
- s->last_dc[0] = get_bits(&s->gb, 8);
- s->last_dc[1] = get_bits(&s->gb, 8);
- s->last_dc[2] = get_bits(&s->gb, 8);
-#ifdef DEBUG
- av_log(s->avctx, AV_LOG_DEBUG, "DC:%d %d %d\n",
- s->last_dc[0],
- s->last_dc[1],
- s->last_dc[2]);
-#endif
- }
- }
- /* if multiple packets per frame are sent, the position at which
- to display the macro blocks is coded here */
-
- mb_xy= s->mb_x + s->mb_y*s->mb_width;
- if(show_bits(&s->gb, 12)==0 || (mb_xy && mb_xy < s->mb_num)){
- s->mb_x = get_bits(&s->gb, 6); /* mb_x */
- s->mb_y = get_bits(&s->gb, 6); /* mb_y */
- mb_count = get_bits(&s->gb, 12);
- } else {
- s->mb_x = 0;
- s->mb_y = 0;
- mb_count = s->mb_width * s->mb_height;
- }
- unk= get_bits(&s->gb, 3); /* ignored */
-//printf("%d\n", unk);
- s->f_code = 1;
- s->unrestricted_mv = 1;
-
- return mb_count;
-}
-
-static int rv20_decode_picture_header(MpegEncContext *s)
-{
- int seq, mb_pos, i;
-
-#if 0
- GetBitContext gb= s->gb;
- for(i=0; i<64; i++){
- av_log(s->avctx, AV_LOG_DEBUG, "%d", get_bits1(&gb));
- if(i%4==3) av_log(s->avctx, AV_LOG_DEBUG, " ");
- }
- av_log(s->avctx, AV_LOG_DEBUG, "\n");
-#endif
-#if 0
- av_log(s->avctx, AV_LOG_DEBUG, "%3dx%03d/%02Xx%02X ", s->width, s->height, s->width/4, s->height/4);
- for(i=0; i<s->avctx->extradata_size; i++){
- av_log(s->avctx, AV_LOG_DEBUG, "%02X ", ((uint8_t*)s->avctx->extradata)[i]);
- if(i%4==3) av_log(s->avctx, AV_LOG_DEBUG, " ");
- }
- av_log(s->avctx, AV_LOG_DEBUG, "\n");
-#endif
-
- if(s->avctx->sub_id == 0x30202002 || s->avctx->sub_id == 0x30203002){
- if (get_bits(&s->gb, 3)){
- av_log(s->avctx, AV_LOG_ERROR, "unknown triplet set\n");
- return -1;
- }
- }
-
- i= get_bits(&s->gb, 2);
- switch(i){
- case 0: s->pict_type= I_TYPE; break;
- case 1: s->pict_type= I_TYPE; break; //hmm ...
- case 2: s->pict_type= P_TYPE; break;
- case 3: s->pict_type= B_TYPE; break;
- default:
- av_log(s->avctx, AV_LOG_ERROR, "unknown frame type\n");
- return -1;
- }
-
- if(s->last_picture_ptr==NULL && s->pict_type==B_TYPE){
- av_log(s->avctx, AV_LOG_ERROR, "early B pix\n");
- return -1;
- }
-
- if (get_bits(&s->gb, 1)){
- av_log(s->avctx, AV_LOG_ERROR, "unknown bit set\n");
- return -1;
- }
-
- s->qscale = get_bits(&s->gb, 5);
- if(s->qscale==0){
- av_log(s->avctx, AV_LOG_ERROR, "error, qscale:0\n");
- return -1;
- }
- if(s->avctx->sub_id == 0x30203002){
- if (get_bits(&s->gb, 1)){
- av_log(s->avctx, AV_LOG_ERROR, "unknown bit2 set\n");
- return -1;
- }
- }
-
- if(s->avctx->has_b_frames){
- int f, new_w, new_h;
- int v= s->avctx->extradata_size >= 4 ? 7&((uint8_t*)s->avctx->extradata)[1] : 0;
-
- if (get_bits(&s->gb, 1)){
- av_log(s->avctx, AV_LOG_ERROR, "unknown bit3 set\n");
-// return -1;
- }
- seq= get_bits(&s->gb, 13)<<2;
-
- f= get_bits(&s->gb, av_log2(v)+1);
-
- if(f){
- new_w= 4*((uint8_t*)s->avctx->extradata)[6+2*f];
- new_h= 4*((uint8_t*)s->avctx->extradata)[7+2*f];
- }else{
- new_w= s->width; //FIXME wrong we of course must save the original in the context
- new_h= s->height;
- }
- if(new_w != s->width || new_h != s->height){
- av_log(s->avctx, AV_LOG_DEBUG, "attempting to change resolution to %dx%d\n", new_w, new_h);
- MPV_common_end(s);
- s->width = s->avctx->width = new_w;
- s->height = s->avctx->height= new_h;
- if (MPV_common_init(s) < 0)
- return -1;
- }
-
- if(s->avctx->debug & FF_DEBUG_PICT_INFO){
- av_log(s->avctx, AV_LOG_DEBUG, "F %d/%d\n", f, v);
- }
- }else{
- seq= get_bits(&s->gb, 8)*128;
- }
-
-// if(s->avctx->sub_id <= 0x20201002){ //0x20201002 definitely needs this
- mb_pos= ff_h263_decode_mba(s);
-/* }else{
- mb_pos= get_bits(&s->gb, av_log2(s->mb_num-1)+1);
- s->mb_x= mb_pos % s->mb_width;
- s->mb_y= mb_pos / s->mb_width;
- }*/
-//av_log(s->avctx, AV_LOG_DEBUG, "%d\n", seq);
- seq |= s->time &~0x7FFF;
- if(seq - s->time > 0x4000) seq -= 0x8000;
- if(seq - s->time < -0x4000) seq += 0x8000;
- if(seq != s->time){
- if(s->pict_type!=B_TYPE){
- s->time= seq;
- s->pp_time= s->time - s->last_non_b_time;
- s->last_non_b_time= s->time;
- }else{
- s->time= seq;
- s->pb_time= s->pp_time - (s->last_non_b_time - s->time);
- if(s->pp_time <=s->pb_time || s->pp_time <= s->pp_time - s->pb_time || s->pp_time<=0){
- av_log(s->avctx, AV_LOG_DEBUG, "messed up order, possible from seeking? skipping current b frame\n");
- return FRAME_SKIPPED;
- }
- ff_mpeg4_init_direct_mv(s);
- }
- }
-// printf("%d %d %d %d %d\n", seq, (int)s->time, (int)s->last_non_b_time, s->pp_time, s->pb_time);
-/*for(i=0; i<32; i++){
- av_log(s->avctx, AV_LOG_DEBUG, "%d", get_bits1(&s->gb));
-}
-av_log(s->avctx, AV_LOG_DEBUG, "\n");*/
- s->no_rounding= get_bits1(&s->gb);
-
- s->f_code = 1;
- s->unrestricted_mv = 1;
- s->h263_aic= s->pict_type == I_TYPE;
-// s->alt_inter_vlc=1;
-// s->obmc=1;
-// s->umvplus=1;
- s->modified_quant=1;
- s->loop_filter=1;
-
- if(s->avctx->debug & FF_DEBUG_PICT_INFO){
- av_log(s->avctx, AV_LOG_INFO, "num:%5d x:%2d y:%2d type:%d qscale:%2d rnd:%d\n",
- seq, s->mb_x, s->mb_y, s->pict_type, s->qscale, s->no_rounding);
- }
-
- assert(s->pict_type != B_TYPE || !s->low_delay);
-
- return s->mb_width*s->mb_height - mb_pos;
-}
-
-static int rv10_decode_init(AVCodecContext *avctx)
-{
- MpegEncContext *s = avctx->priv_data;
- static int done=0;
-
- MPV_decode_defaults(s);
-
- s->avctx= avctx;
- s->out_format = FMT_H263;
- s->codec_id= avctx->codec_id;
-
- s->width = avctx->width;
- s->height = avctx->height;
-
- s->h263_long_vectors= ((uint8_t*)avctx->extradata)[3] & 1;
- avctx->sub_id= AV_RB32((uint8_t*)avctx->extradata + 4);
-
- switch(avctx->sub_id){
- case 0x10000000:
- s->rv10_version= 0;
- s->low_delay=1;
- break;
- case 0x10002000:
- s->rv10_version= 3;
- s->low_delay=1;
- s->obmc=1;
- break;
- case 0x10003000:
- s->rv10_version= 3;
- s->low_delay=1;
- break;
- case 0x10003001:
- s->rv10_version= 3;
- s->low_delay=1;
- break;
- case 0x20001000: /* real rv20 decoder fail on this id */
- /*case 0x20100001:
- case 0x20101001:
- case 0x20103001:*/
- case 0x20100000 ... 0x2019ffff:
- s->low_delay=1;
- break;
- /*case 0x20200002:
- case 0x20201002:
- case 0x20203002:*/
- case 0x20200002 ... 0x202fffff:
- case 0x30202002:
- case 0x30203002:
- s->low_delay=0;
- s->avctx->has_b_frames=1;
- break;
- default:
- av_log(s->avctx, AV_LOG_ERROR, "unknown header %X\n", avctx->sub_id);
- }
-
- if(avctx->debug & FF_DEBUG_PICT_INFO){
- av_log(avctx, AV_LOG_DEBUG, "ver:%X ver0:%X\n", avctx->sub_id, avctx->extradata_size >= 4 ? ((uint32_t*)avctx->extradata)[0] : -1);
- }
-
- avctx->pix_fmt = PIX_FMT_YUV420P;
-
- if (MPV_common_init(s) < 0)
- return -1;
-
- h263_decode_init_vlc(s);
-
- /* init rv vlc */
- if (!done) {
- init_vlc(&rv_dc_lum, DC_VLC_BITS, 256,
- rv_lum_bits, 1, 1,
- rv_lum_code, 2, 2, 1);
- init_vlc(&rv_dc_chrom, DC_VLC_BITS, 256,
- rv_chrom_bits, 1, 1,
- rv_chrom_code, 2, 2, 1);
- done = 1;
- }
-
- return 0;
-}
-
-static int rv10_decode_end(AVCodecContext *avctx)
-{
- MpegEncContext *s = avctx->priv_data;
-
- MPV_common_end(s);
- return 0;
-}
-
-static int rv10_decode_packet(AVCodecContext *avctx,
- uint8_t *buf, int buf_size)
-{
- MpegEncContext *s = avctx->priv_data;
- int mb_count, mb_pos, left, start_mb_x;
-
- init_get_bits(&s->gb, buf, buf_size*8);
- if(s->codec_id ==CODEC_ID_RV10)
- mb_count = rv10_decode_picture_header(s);
- else
- mb_count = rv20_decode_picture_header(s);
- if (mb_count < 0) {
- av_log(s->avctx, AV_LOG_ERROR, "HEADER ERROR\n");
- return -1;
- }
-
- if (s->mb_x >= s->mb_width ||
- s->mb_y >= s->mb_height) {
- av_log(s->avctx, AV_LOG_ERROR, "POS ERROR %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
- mb_pos = s->mb_y * s->mb_width + s->mb_x;
- left = s->mb_width * s->mb_height - mb_pos;
- if (mb_count > left) {
- av_log(s->avctx, AV_LOG_ERROR, "COUNT ERROR\n");
- return -1;
- }
-//if(s->pict_type == P_TYPE) return 0;
-
- if ((s->mb_x == 0 && s->mb_y == 0) || s->current_picture_ptr==NULL) {
- if(s->current_picture_ptr){ //FIXME write parser so we always have complete frames?
- ff_er_frame_end(s);
- MPV_frame_end(s);
- s->mb_x= s->mb_y = s->resync_mb_x = s->resync_mb_y= 0;
- }
- if(MPV_frame_start(s, avctx) < 0)
- return -1;
- ff_er_frame_start(s);
- }
-
-#ifdef DEBUG
- av_log(avctx, AV_LOG_DEBUG, "qscale=%d\n", s->qscale);
-#endif
-
- /* default quantization values */
- if(s->codec_id== CODEC_ID_RV10){
- if(s->mb_y==0) s->first_slice_line=1;
- }else{
- s->first_slice_line=1;
- s->resync_mb_x= s->mb_x;
- }
- start_mb_x= s->mb_x;
- s->resync_mb_y= s->mb_y;
- if(s->h263_aic){
- s->y_dc_scale_table=
- s->c_dc_scale_table= ff_aic_dc_scale_table;
- }else{
- s->y_dc_scale_table=
- s->c_dc_scale_table= ff_mpeg1_dc_scale_table;
- }
-
- if(s->modified_quant)
- s->chroma_qscale_table= ff_h263_chroma_qscale_table;
-
- ff_set_qscale(s, s->qscale);
-
- s->rv10_first_dc_coded[0] = 0;
- s->rv10_first_dc_coded[1] = 0;
- s->rv10_first_dc_coded[2] = 0;
-//printf("%d %X %X\n", s->pict_type, s->current_picture.motion_val[0], s->current_picture.motion_val[1]);
- s->block_wrap[0]=
- s->block_wrap[1]=
- s->block_wrap[2]=
- s->block_wrap[3]= s->b8_stride;
- s->block_wrap[4]=
- s->block_wrap[5]= s->mb_stride;
- ff_init_block_index(s);
- /* decode each macroblock */
-
- for(s->mb_num_left= mb_count; s->mb_num_left>0; s->mb_num_left--) {
- int ret;
- ff_update_block_index(s);
-#ifdef DEBUG
- av_log(avctx, AV_LOG_DEBUG, "**mb x=%d y=%d\n", s->mb_x, s->mb_y);
-#endif
-
- s->mv_dir = MV_DIR_FORWARD;
- s->mv_type = MV_TYPE_16X16;
- ret=ff_h263_decode_mb(s, s->block);
-
- if (ret == SLICE_ERROR || s->gb.size_in_bits < get_bits_count(&s->gb)) {
- av_log(s->avctx, AV_LOG_ERROR, "ERROR at MB %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
- if(s->pict_type != B_TYPE)
- ff_h263_update_motion_val(s);
- MPV_decode_mb(s, s->block);
- if(s->loop_filter)
- ff_h263_loop_filter(s);
-
- if (++s->mb_x == s->mb_width) {
- s->mb_x = 0;
- s->mb_y++;
- ff_init_block_index(s);
- }
- if(s->mb_x == s->resync_mb_x)
- s->first_slice_line=0;
- if(ret == SLICE_END) break;
- }
-
- ff_er_add_slice(s, start_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, AC_END|DC_END|MV_END);
-
- return buf_size;
-}
-
-static int rv10_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- MpegEncContext *s = avctx->priv_data;
- int i;
- AVFrame *pict = data;
-
-#ifdef DEBUG
- av_log(avctx, AV_LOG_DEBUG, "*****frame %d size=%d\n", avctx->frame_number, buf_size);
-#endif
-
- /* no supplementary picture */
- if (buf_size == 0) {
- return 0;
- }
-
- if(avctx->slice_count){
- for(i=0; i<avctx->slice_count; i++){
- int offset= avctx->slice_offset[i];
- int size;
-
- if(i+1 == avctx->slice_count)
- size= buf_size - offset;
- else
- size= avctx->slice_offset[i+1] - offset;
-
- rv10_decode_packet(avctx, buf+offset, size);
- }
- }else{
- rv10_decode_packet(avctx, buf, buf_size);
- }
-
- if(s->current_picture_ptr != NULL && s->mb_y>=s->mb_height){
- ff_er_frame_end(s);
- MPV_frame_end(s);
-
- if (s->pict_type == B_TYPE || s->low_delay) {
- *pict= *(AVFrame*)s->current_picture_ptr;
- } else if (s->last_picture_ptr != NULL) {
- *pict= *(AVFrame*)s->last_picture_ptr;
- }
-
- if(s->last_picture_ptr || s->low_delay){
- *data_size = sizeof(AVFrame);
- ff_print_debug_info(s, pict);
- }
- s->current_picture_ptr= NULL; //so we can detect if frame_end wasnt called (find some nicer solution...)
- }
-
- return buf_size;
-}
-
-AVCodec rv10_decoder = {
- "rv10",
- CODEC_TYPE_VIDEO,
- CODEC_ID_RV10,
- sizeof(MpegEncContext),
- rv10_decode_init,
- NULL,
- rv10_decode_end,
- rv10_decode_frame,
- CODEC_CAP_DR1
-};
-
-AVCodec rv20_decoder = {
- "rv20",
- CODEC_TYPE_VIDEO,
- CODEC_ID_RV20,
- sizeof(MpegEncContext),
- rv10_decode_init,
- NULL,
- rv10_decode_end,
- rv10_decode_frame,
- CODEC_CAP_DR1 | CODEC_CAP_DELAY,
- .flush= ff_mpeg_flush,
-};
-
diff --git a/src/libffmpeg/libavcodec/shorten.c b/src/libffmpeg/libavcodec/shorten.c
deleted file mode 100644
index 358ecf23f..000000000
--- a/src/libffmpeg/libavcodec/shorten.c
+++ /dev/null
@@ -1,533 +0,0 @@
-/*
- * Shorten decoder
- * Copyright (c) 2005 Jeff Muizelaar
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file shorten.c
- * Shorten decoder
- * @author Jeff Muizelaar
- *
- */
-
-#define DEBUG
-#include <limits.h>
-#include "avcodec.h"
-#include "bitstream.h"
-#include "golomb.h"
-
-#define MAX_CHANNELS 8
-#define MAX_BLOCKSIZE 65535
-
-#define OUT_BUFFER_SIZE 16384
-
-#define ULONGSIZE 2
-
-#define WAVE_FORMAT_PCM 0x0001
-
-#define DEFAULT_BLOCK_SIZE 256
-
-#define TYPESIZE 4
-#define CHANSIZE 0
-#define LPCQSIZE 2
-#define ENERGYSIZE 3
-#define BITSHIFTSIZE 2
-
-#define TYPE_S16HL 3
-#define TYPE_S16LH 5
-
-#define NWRAP 3
-#define NSKIPSIZE 1
-
-#define LPCQUANT 5
-#define V2LPCQOFFSET (1 << LPCQUANT)
-
-#define FNSIZE 2
-#define FN_DIFF0 0
-#define FN_DIFF1 1
-#define FN_DIFF2 2
-#define FN_DIFF3 3
-#define FN_QUIT 4
-#define FN_BLOCKSIZE 5
-#define FN_BITSHIFT 6
-#define FN_QLPC 7
-#define FN_ZERO 8
-#define FN_VERBATIM 9
-
-#define VERBATIM_CKSIZE_SIZE 5
-#define VERBATIM_BYTE_SIZE 8
-#define CANONICAL_HEADER_SIZE 44
-
-typedef struct ShortenContext {
- AVCodecContext *avctx;
- GetBitContext gb;
-
- int min_framesize, max_framesize;
- int channels;
-
- int32_t *decoded[MAX_CHANNELS];
- int32_t *offset[MAX_CHANNELS];
- uint8_t *bitstream;
- int bitstream_size;
- int bitstream_index;
- unsigned int allocated_bitstream_size;
- int header_size;
- uint8_t header[OUT_BUFFER_SIZE];
- int version;
- int cur_chan;
- int bitshift;
- int nmean;
- int internal_ftype;
- int nwrap;
- int blocksize;
- int bitindex;
- int32_t lpcqoffset;
-} ShortenContext;
-
-static int shorten_decode_init(AVCodecContext * avctx)
-{
- ShortenContext *s = avctx->priv_data;
- s->avctx = avctx;
-
- return 0;
-}
-
-static int allocate_buffers(ShortenContext *s)
-{
- int i, chan;
- for (chan=0; chan<s->channels; chan++) {
- if(FFMAX(1, s->nmean) >= UINT_MAX/sizeof(int32_t)){
- av_log(s->avctx, AV_LOG_ERROR, "nmean too large\n");
- return -1;
- }
- if(s->blocksize + s->nwrap >= UINT_MAX/sizeof(int32_t) || s->blocksize + s->nwrap <= (unsigned)s->nwrap){
- av_log(s->avctx, AV_LOG_ERROR, "s->blocksize + s->nwrap too large\n");
- return -1;
- }
-
- s->offset[chan] = av_realloc(s->offset[chan], sizeof(int32_t)*FFMAX(1, s->nmean));
-
- s->decoded[chan] = av_realloc(s->decoded[chan], sizeof(int32_t)*(s->blocksize + s->nwrap));
- for (i=0; i<s->nwrap; i++)
- s->decoded[chan][i] = 0;
- s->decoded[chan] += s->nwrap;
- }
- return 0;
-}
-
-
-static inline unsigned int get_uint(ShortenContext *s, int k)
-{
- if (s->version != 0)
- k = get_ur_golomb_shorten(&s->gb, ULONGSIZE);
- return get_ur_golomb_shorten(&s->gb, k);
-}
-
-
-static void fix_bitshift(ShortenContext *s, int32_t *buffer)
-{
- int i;
-
- if (s->bitshift != 0)
- for (i = 0; i < s->blocksize; i++)
- buffer[s->nwrap + i] <<= s->bitshift;
-}
-
-
-static void init_offset(ShortenContext *s)
-{
- int32_t mean = 0;
- int chan, i;
- int nblock = FFMAX(1, s->nmean);
- /* initialise offset */
- switch (s->internal_ftype)
- {
- case TYPE_S16HL:
- case TYPE_S16LH:
- mean = 0;
- break;
- default:
- av_log(s->avctx, AV_LOG_ERROR, "unknown audio type");
- abort();
- }
-
- for (chan = 0; chan < s->channels; chan++)
- for (i = 0; i < nblock; i++)
- s->offset[chan][i] = mean;
-}
-
-static int inline get_le32(GetBitContext *gb)
-{
- return bswap_32(get_bits_long(gb, 32));
-}
-
-static short inline get_le16(GetBitContext *gb)
-{
- return bswap_16(get_bits_long(gb, 16));
-}
-
-static int decode_wave_header(AVCodecContext *avctx, uint8_t *header, int header_size)
-{
- GetBitContext hb;
- int len;
- int chunk_size;
- short wave_format;
-
- init_get_bits(&hb, header, header_size*8);
- if (get_le32(&hb) != MKTAG('R','I','F','F')) {
- av_log(avctx, AV_LOG_ERROR, "missing RIFF tag\n");
- return -1;
- }
-
- chunk_size = get_le32(&hb);
-
- if (get_le32(&hb) != MKTAG('W','A','V','E')) {
- av_log(avctx, AV_LOG_ERROR, "missing WAVE tag\n");
- return -1;
- }
-
- while (get_le32(&hb) != MKTAG('f','m','t',' ')) {
- len = get_le32(&hb);
- skip_bits(&hb, 8*len);
- }
- len = get_le32(&hb);
-
- if (len < 16) {
- av_log(avctx, AV_LOG_ERROR, "fmt chunk was too short\n");
- return -1;
- }
-
- wave_format = get_le16(&hb);
-
- switch (wave_format) {
- case WAVE_FORMAT_PCM:
- break;
- default:
- av_log(avctx, AV_LOG_ERROR, "unsupported wave format\n");
- return -1;
- }
-
- avctx->channels = get_le16(&hb);
- avctx->sample_rate = get_le32(&hb);
- avctx->bit_rate = get_le32(&hb) * 8;
- avctx->block_align = get_le16(&hb);
- avctx->bits_per_sample = get_le16(&hb);
-
- if (avctx->bits_per_sample != 16) {
- av_log(avctx, AV_LOG_ERROR, "unsupported number of bits per sample\n");
- return -1;
- }
-
- len -= 16;
- if (len > 0)
- av_log(avctx, AV_LOG_INFO, "%d header bytes unparsed\n", len);
-
- return 0;
-}
-
-static int16_t * interleave_buffer(int16_t *samples, int nchan, int blocksize, int32_t **buffer) {
- int i, chan;
- for (i=0; i<blocksize; i++)
- for (chan=0; chan < nchan; chan++)
- *samples++ = FFMIN(buffer[chan][i], 32768);
- return samples;
-}
-
-static void decode_subframe_lpc(ShortenContext *s, int channel, int residual_size, int pred_order)
-{
- int sum, i, j;
- int coeffs[pred_order];
-
- for (i=0; i<pred_order; i++)
- coeffs[i] = get_sr_golomb_shorten(&s->gb, LPCQUANT);
-
- for (i=0; i < s->blocksize; i++) {
- sum = s->lpcqoffset;
- for (j=0; j<pred_order; j++)
- sum += coeffs[j] * s->decoded[channel][i-j-1];
- s->decoded[channel][i] = get_sr_golomb_shorten(&s->gb, residual_size) + (sum >> LPCQUANT);
- }
-}
-
-
-static int shorten_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- ShortenContext *s = avctx->priv_data;
- int i, input_buf_size = 0;
- int16_t *samples = data;
- if(s->max_framesize == 0){
- s->max_framesize= 1024; // should hopefully be enough for the first header
- s->bitstream= av_fast_realloc(s->bitstream, &s->allocated_bitstream_size, s->max_framesize);
- }
-
- if(1 && s->max_framesize){//FIXME truncated
- buf_size= FFMIN(buf_size, s->max_framesize - s->bitstream_size);
- input_buf_size= buf_size;
-
- if(s->bitstream_index + s->bitstream_size + buf_size > s->allocated_bitstream_size){
- // printf("memmove\n");
- memmove(s->bitstream, &s->bitstream[s->bitstream_index], s->bitstream_size);
- s->bitstream_index=0;
- }
- memcpy(&s->bitstream[s->bitstream_index + s->bitstream_size], buf, buf_size);
- buf= &s->bitstream[s->bitstream_index];
- buf_size += s->bitstream_size;
- s->bitstream_size= buf_size;
-
- if(buf_size < s->max_framesize){
- //dprintf("wanna more data ... %d\n", buf_size);
- return input_buf_size;
- }
- }
- init_get_bits(&s->gb, buf, buf_size*8);
- get_bits(&s->gb, s->bitindex);
- if (!s->blocksize)
- {
- int maxnlpc = 0;
- /* shorten signature */
- if (get_bits_long(&s->gb, 32) != bswap_32(ff_get_fourcc("ajkg"))) {
- av_log(s->avctx, AV_LOG_ERROR, "missing shorten magic 'ajkg'\n");
- return -1;
- }
-
- s->lpcqoffset = 0;
- s->blocksize = DEFAULT_BLOCK_SIZE;
- s->channels = 1;
- s->nmean = -1;
- s->version = get_bits(&s->gb, 8);
- s->internal_ftype = get_uint(s, TYPESIZE);
-
- s->channels = get_uint(s, CHANSIZE);
- if (s->channels > MAX_CHANNELS) {
- av_log(s->avctx, AV_LOG_ERROR, "too many channels: %d\n", s->channels);
- return -1;
- }
-
- /* get blocksize if version > 0 */
- if (s->version > 0) {
- int skip_bytes;
- s->blocksize = get_uint(s, av_log2(DEFAULT_BLOCK_SIZE));
- maxnlpc = get_uint(s, LPCQSIZE);
- s->nmean = get_uint(s, 0);
-
- skip_bytes = get_uint(s, NSKIPSIZE);
- for (i=0; i<skip_bytes; i++) {
- skip_bits(&s->gb, 8);
- }
- }
- s->nwrap = FFMAX(NWRAP, maxnlpc);
-
- if (allocate_buffers(s))
- return -1;
-
- init_offset(s);
-
- if (s->version > 1)
- s->lpcqoffset = V2LPCQOFFSET;
-
- if (get_ur_golomb_shorten(&s->gb, FNSIZE) != FN_VERBATIM) {
- av_log(s->avctx, AV_LOG_ERROR, "missing verbatim section at begining of stream\n");
- return -1;
- }
-
- s->header_size = get_ur_golomb_shorten(&s->gb, VERBATIM_CKSIZE_SIZE);
- if (s->header_size >= OUT_BUFFER_SIZE || s->header_size < CANONICAL_HEADER_SIZE) {
- av_log(s->avctx, AV_LOG_ERROR, "header is wrong size: %d\n", s->header_size);
- return -1;
- }
-
- for (i=0; i<s->header_size; i++)
- s->header[i] = (char)get_ur_golomb_shorten(&s->gb, VERBATIM_BYTE_SIZE);
-
- if (decode_wave_header(avctx, s->header, s->header_size) < 0)
- return -1;
-
- s->cur_chan = 0;
- s->bitshift = 0;
- }
- else
- {
- int cmd;
- int len;
- cmd = get_ur_golomb_shorten(&s->gb, FNSIZE);
- switch (cmd) {
- case FN_ZERO:
- case FN_DIFF0:
- case FN_DIFF1:
- case FN_DIFF2:
- case FN_DIFF3:
- case FN_QLPC:
- {
- int residual_size = 0;
- int channel = s->cur_chan;
- int32_t coffset;
- if (cmd != FN_ZERO) {
- residual_size = get_ur_golomb_shorten(&s->gb, ENERGYSIZE);
- /* this is a hack as version 0 differed in defintion of get_sr_golomb_shorten */
- if (s->version == 0)
- residual_size--;
- }
-
- if (s->nmean == 0)
- coffset = s->offset[channel][0];
- else {
- int32_t sum = (s->version < 2) ? 0 : s->nmean / 2;
- for (i=0; i<s->nmean; i++)
- sum += s->offset[channel][i];
- coffset = sum / s->nmean;
- if (s->version >= 2)
- coffset >>= FFMIN(1, s->bitshift);
- }
- switch (cmd) {
- case FN_ZERO:
- for (i=0; i<s->blocksize; i++)
- s->decoded[channel][i] = 0;
- break;
- case FN_DIFF0:
- for (i=0; i<s->blocksize; i++)
- s->decoded[channel][i] = get_sr_golomb_shorten(&s->gb, residual_size) + coffset;
- break;
- case FN_DIFF1:
- for (i=0; i<s->blocksize; i++)
- s->decoded[channel][i] = get_sr_golomb_shorten(&s->gb, residual_size) + s->decoded[channel][i - 1];
- break;
- case FN_DIFF2:
- for (i=0; i<s->blocksize; i++)
- s->decoded[channel][i] = get_sr_golomb_shorten(&s->gb, residual_size) + 2*s->decoded[channel][i-1]
- - s->decoded[channel][i-2];
- break;
- case FN_DIFF3:
- for (i=0; i<s->blocksize; i++)
- s->decoded[channel][i] = get_sr_golomb_shorten(&s->gb, residual_size) + 3*s->decoded[channel][i-1]
- - 3*s->decoded[channel][i-2]
- + s->decoded[channel][i-3];
- break;
- case FN_QLPC:
- {
- int pred_order = get_ur_golomb_shorten(&s->gb, LPCQSIZE);
- for (i=0; i<pred_order; i++)
- s->decoded[channel][i - pred_order] -= coffset;
- decode_subframe_lpc(s, channel, residual_size, pred_order);
- if (coffset != 0)
- for (i=0; i < s->blocksize; i++)
- s->decoded[channel][i] += coffset;
- }
- }
- if (s->nmean > 0) {
- int32_t sum = (s->version < 2) ? 0 : s->blocksize / 2;
- for (i=0; i<s->blocksize; i++)
- sum += s->decoded[channel][i];
-
- for (i=1; i<s->nmean; i++)
- s->offset[channel][i-1] = s->offset[channel][i];
-
- if (s->version < 2)
- s->offset[channel][s->nmean - 1] = sum / s->blocksize;
- else
- s->offset[channel][s->nmean - 1] = (sum / s->blocksize) << s->bitshift;
- }
- for (i=-s->nwrap; i<0; i++)
- s->decoded[channel][i] = s->decoded[channel][i + s->blocksize];
-
- fix_bitshift(s, s->decoded[channel]);
-
- s->cur_chan++;
- if (s->cur_chan == s->channels) {
- samples = interleave_buffer(samples, s->channels, s->blocksize, s->decoded);
- s->cur_chan = 0;
- goto frame_done;
- }
- break;
- }
- break;
- case FN_VERBATIM:
- len = get_ur_golomb_shorten(&s->gb, VERBATIM_CKSIZE_SIZE);
- while (len--) {
- get_ur_golomb_shorten(&s->gb, VERBATIM_BYTE_SIZE);
- }
- break;
- case FN_BITSHIFT:
- s->bitshift = get_ur_golomb_shorten(&s->gb, BITSHIFTSIZE);
- break;
- case FN_BLOCKSIZE:
- s->blocksize = get_uint(s, av_log2(s->blocksize));
- break;
- case FN_QUIT:
- return buf_size;
- break;
- default:
- av_log(avctx, AV_LOG_ERROR, "unknown shorten function %d\n", cmd);
- return -1;
- break;
- }
- }
-frame_done:
- *data_size = (int8_t *)samples - (int8_t *)data;
-
- // s->last_blocksize = s->blocksize;
- s->bitindex = get_bits_count(&s->gb) - 8*((get_bits_count(&s->gb))/8);
- i= (get_bits_count(&s->gb))/8;
- if (i > buf_size) {
- av_log(s->avctx, AV_LOG_ERROR, "overread: %d\n", i - buf_size);
- s->bitstream_size=0;
- s->bitstream_index=0;
- return -1;
- }
- if (s->bitstream_size) {
- s->bitstream_index += i;
- s->bitstream_size -= i;
- return input_buf_size;
- } else
- return i;
-}
-
-static int shorten_decode_close(AVCodecContext *avctx)
-{
- ShortenContext *s = avctx->priv_data;
- int i;
-
- for (i = 0; i < s->channels; i++) {
- s->decoded[i] -= s->nwrap;
- av_freep(&s->decoded[i]);
- av_freep(&s->offset[i]);
- }
- av_freep(&s->bitstream);
- return 0;
-}
-
-static void shorten_flush(AVCodecContext *avctx){
- ShortenContext *s = avctx->priv_data;
-
- s->bitstream_size=
- s->bitstream_index= 0;
-}
-
-AVCodec shorten_decoder = {
- "shorten",
- CODEC_TYPE_AUDIO,
- CODEC_ID_SHORTEN,
- sizeof(ShortenContext),
- shorten_decode_init,
- NULL,
- shorten_decode_close,
- shorten_decode_frame,
- .flush= shorten_flush,
-};
diff --git a/src/libffmpeg/libavcodec/simple_idct.c b/src/libffmpeg/libavcodec/simple_idct.c
deleted file mode 100644
index 2c026f08f..000000000
--- a/src/libffmpeg/libavcodec/simple_idct.c
+++ /dev/null
@@ -1,587 +0,0 @@
-/*
- * Simple IDCT
- *
- * Copyright (c) 2001 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file simple_idct.c
- * simpleidct in C.
- */
-
-/*
- based upon some outcommented c code from mpeg2dec (idct_mmx.c
- written by Aaron Holtzman <aholtzma@ess.engr.uvic.ca>)
- */
-#include "avcodec.h"
-#include "dsputil.h"
-#include "simple_idct.h"
-
-#if 0
-#define W1 2841 /* 2048*sqrt (2)*cos (1*pi/16) */
-#define W2 2676 /* 2048*sqrt (2)*cos (2*pi/16) */
-#define W3 2408 /* 2048*sqrt (2)*cos (3*pi/16) */
-#define W4 2048 /* 2048*sqrt (2)*cos (4*pi/16) */
-#define W5 1609 /* 2048*sqrt (2)*cos (5*pi/16) */
-#define W6 1108 /* 2048*sqrt (2)*cos (6*pi/16) */
-#define W7 565 /* 2048*sqrt (2)*cos (7*pi/16) */
-#define ROW_SHIFT 8
-#define COL_SHIFT 17
-#else
-#define W1 22725 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-#define W2 21407 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-#define W3 19266 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-#define W4 16383 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-#define W5 12873 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-#define W6 8867 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-#define W7 4520 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
-#define ROW_SHIFT 11
-#define COL_SHIFT 20 // 6
-#endif
-
-#if defined(ARCH_POWERPC_405)
-
-/* signed 16x16 -> 32 multiply add accumulate */
-#define MAC16(rt, ra, rb) \
- asm ("maclhw %0, %2, %3" : "=r" (rt) : "0" (rt), "r" (ra), "r" (rb));
-
-/* signed 16x16 -> 32 multiply */
-#define MUL16(rt, ra, rb) \
- asm ("mullhw %0, %1, %2" : "=r" (rt) : "r" (ra), "r" (rb));
-
-#else
-
-/* signed 16x16 -> 32 multiply add accumulate */
-#define MAC16(rt, ra, rb) rt += (ra) * (rb)
-
-/* signed 16x16 -> 32 multiply */
-#define MUL16(rt, ra, rb) rt = (ra) * (rb)
-
-#endif
-
-static inline void idctRowCondDC (DCTELEM * row)
-{
- int a0, a1, a2, a3, b0, b1, b2, b3;
-#ifdef FAST_64BIT
- uint64_t temp;
-#else
- uint32_t temp;
-#endif
-
-#ifdef FAST_64BIT
-#ifdef WORDS_BIGENDIAN
-#define ROW0_MASK 0xffff000000000000LL
-#else
-#define ROW0_MASK 0xffffLL
-#endif
- if(sizeof(DCTELEM)==2){
- if ( ((((uint64_t *)row)[0] & ~ROW0_MASK) |
- ((uint64_t *)row)[1]) == 0) {
- temp = (row[0] << 3) & 0xffff;
- temp += temp << 16;
- temp += temp << 32;
- ((uint64_t *)row)[0] = temp;
- ((uint64_t *)row)[1] = temp;
- return;
- }
- }else{
- if (!(row[1]|row[2]|row[3]|row[4]|row[5]|row[6]|row[7])) {
- row[0]=row[1]=row[2]=row[3]=row[4]=row[5]=row[6]=row[7]= row[0] << 3;
- return;
- }
- }
-#else
- if(sizeof(DCTELEM)==2){
- if (!(((uint32_t*)row)[1] |
- ((uint32_t*)row)[2] |
- ((uint32_t*)row)[3] |
- row[1])) {
- temp = (row[0] << 3) & 0xffff;
- temp += temp << 16;
- ((uint32_t*)row)[0]=((uint32_t*)row)[1] =
- ((uint32_t*)row)[2]=((uint32_t*)row)[3] = temp;
- return;
- }
- }else{
- if (!(row[1]|row[2]|row[3]|row[4]|row[5]|row[6]|row[7])) {
- row[0]=row[1]=row[2]=row[3]=row[4]=row[5]=row[6]=row[7]= row[0] << 3;
- return;
- }
- }
-#endif
-
- a0 = (W4 * row[0]) + (1 << (ROW_SHIFT - 1));
- a1 = a0;
- a2 = a0;
- a3 = a0;
-
- /* no need to optimize : gcc does it */
- a0 += W2 * row[2];
- a1 += W6 * row[2];
- a2 -= W6 * row[2];
- a3 -= W2 * row[2];
-
- MUL16(b0, W1, row[1]);
- MAC16(b0, W3, row[3]);
- MUL16(b1, W3, row[1]);
- MAC16(b1, -W7, row[3]);
- MUL16(b2, W5, row[1]);
- MAC16(b2, -W1, row[3]);
- MUL16(b3, W7, row[1]);
- MAC16(b3, -W5, row[3]);
-
-#ifdef FAST_64BIT
- temp = ((uint64_t*)row)[1];
-#else
- temp = ((uint32_t*)row)[2] | ((uint32_t*)row)[3];
-#endif
- if (temp != 0) {
- a0 += W4*row[4] + W6*row[6];
- a1 += - W4*row[4] - W2*row[6];
- a2 += - W4*row[4] + W2*row[6];
- a3 += W4*row[4] - W6*row[6];
-
- MAC16(b0, W5, row[5]);
- MAC16(b0, W7, row[7]);
-
- MAC16(b1, -W1, row[5]);
- MAC16(b1, -W5, row[7]);
-
- MAC16(b2, W7, row[5]);
- MAC16(b2, W3, row[7]);
-
- MAC16(b3, W3, row[5]);
- MAC16(b3, -W1, row[7]);
- }
-
- row[0] = (a0 + b0) >> ROW_SHIFT;
- row[7] = (a0 - b0) >> ROW_SHIFT;
- row[1] = (a1 + b1) >> ROW_SHIFT;
- row[6] = (a1 - b1) >> ROW_SHIFT;
- row[2] = (a2 + b2) >> ROW_SHIFT;
- row[5] = (a2 - b2) >> ROW_SHIFT;
- row[3] = (a3 + b3) >> ROW_SHIFT;
- row[4] = (a3 - b3) >> ROW_SHIFT;
-}
-
-static inline void idctSparseColPut (uint8_t *dest, int line_size,
- DCTELEM * col)
-{
- int a0, a1, a2, a3, b0, b1, b2, b3;
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-
- /* XXX: I did that only to give same values as previous code */
- a0 = W4 * (col[8*0] + ((1<<(COL_SHIFT-1))/W4));
- a1 = a0;
- a2 = a0;
- a3 = a0;
-
- a0 += + W2*col[8*2];
- a1 += + W6*col[8*2];
- a2 += - W6*col[8*2];
- a3 += - W2*col[8*2];
-
- MUL16(b0, W1, col[8*1]);
- MUL16(b1, W3, col[8*1]);
- MUL16(b2, W5, col[8*1]);
- MUL16(b3, W7, col[8*1]);
-
- MAC16(b0, + W3, col[8*3]);
- MAC16(b1, - W7, col[8*3]);
- MAC16(b2, - W1, col[8*3]);
- MAC16(b3, - W5, col[8*3]);
-
- if(col[8*4]){
- a0 += + W4*col[8*4];
- a1 += - W4*col[8*4];
- a2 += - W4*col[8*4];
- a3 += + W4*col[8*4];
- }
-
- if (col[8*5]) {
- MAC16(b0, + W5, col[8*5]);
- MAC16(b1, - W1, col[8*5]);
- MAC16(b2, + W7, col[8*5]);
- MAC16(b3, + W3, col[8*5]);
- }
-
- if(col[8*6]){
- a0 += + W6*col[8*6];
- a1 += - W2*col[8*6];
- a2 += + W2*col[8*6];
- a3 += - W6*col[8*6];
- }
-
- if (col[8*7]) {
- MAC16(b0, + W7, col[8*7]);
- MAC16(b1, - W5, col[8*7]);
- MAC16(b2, + W3, col[8*7]);
- MAC16(b3, - W1, col[8*7]);
- }
-
- dest[0] = cm[(a0 + b0) >> COL_SHIFT];
- dest += line_size;
- dest[0] = cm[(a1 + b1) >> COL_SHIFT];
- dest += line_size;
- dest[0] = cm[(a2 + b2) >> COL_SHIFT];
- dest += line_size;
- dest[0] = cm[(a3 + b3) >> COL_SHIFT];
- dest += line_size;
- dest[0] = cm[(a3 - b3) >> COL_SHIFT];
- dest += line_size;
- dest[0] = cm[(a2 - b2) >> COL_SHIFT];
- dest += line_size;
- dest[0] = cm[(a1 - b1) >> COL_SHIFT];
- dest += line_size;
- dest[0] = cm[(a0 - b0) >> COL_SHIFT];
-}
-
-static inline void idctSparseColAdd (uint8_t *dest, int line_size,
- DCTELEM * col)
-{
- int a0, a1, a2, a3, b0, b1, b2, b3;
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-
- /* XXX: I did that only to give same values as previous code */
- a0 = W4 * (col[8*0] + ((1<<(COL_SHIFT-1))/W4));
- a1 = a0;
- a2 = a0;
- a3 = a0;
-
- a0 += + W2*col[8*2];
- a1 += + W6*col[8*2];
- a2 += - W6*col[8*2];
- a3 += - W2*col[8*2];
-
- MUL16(b0, W1, col[8*1]);
- MUL16(b1, W3, col[8*1]);
- MUL16(b2, W5, col[8*1]);
- MUL16(b3, W7, col[8*1]);
-
- MAC16(b0, + W3, col[8*3]);
- MAC16(b1, - W7, col[8*3]);
- MAC16(b2, - W1, col[8*3]);
- MAC16(b3, - W5, col[8*3]);
-
- if(col[8*4]){
- a0 += + W4*col[8*4];
- a1 += - W4*col[8*4];
- a2 += - W4*col[8*4];
- a3 += + W4*col[8*4];
- }
-
- if (col[8*5]) {
- MAC16(b0, + W5, col[8*5]);
- MAC16(b1, - W1, col[8*5]);
- MAC16(b2, + W7, col[8*5]);
- MAC16(b3, + W3, col[8*5]);
- }
-
- if(col[8*6]){
- a0 += + W6*col[8*6];
- a1 += - W2*col[8*6];
- a2 += + W2*col[8*6];
- a3 += - W6*col[8*6];
- }
-
- if (col[8*7]) {
- MAC16(b0, + W7, col[8*7]);
- MAC16(b1, - W5, col[8*7]);
- MAC16(b2, + W3, col[8*7]);
- MAC16(b3, - W1, col[8*7]);
- }
-
- dest[0] = cm[dest[0] + ((a0 + b0) >> COL_SHIFT)];
- dest += line_size;
- dest[0] = cm[dest[0] + ((a1 + b1) >> COL_SHIFT)];
- dest += line_size;
- dest[0] = cm[dest[0] + ((a2 + b2) >> COL_SHIFT)];
- dest += line_size;
- dest[0] = cm[dest[0] + ((a3 + b3) >> COL_SHIFT)];
- dest += line_size;
- dest[0] = cm[dest[0] + ((a3 - b3) >> COL_SHIFT)];
- dest += line_size;
- dest[0] = cm[dest[0] + ((a2 - b2) >> COL_SHIFT)];
- dest += line_size;
- dest[0] = cm[dest[0] + ((a1 - b1) >> COL_SHIFT)];
- dest += line_size;
- dest[0] = cm[dest[0] + ((a0 - b0) >> COL_SHIFT)];
-}
-
-static inline void idctSparseCol (DCTELEM * col)
-{
- int a0, a1, a2, a3, b0, b1, b2, b3;
-
- /* XXX: I did that only to give same values as previous code */
- a0 = W4 * (col[8*0] + ((1<<(COL_SHIFT-1))/W4));
- a1 = a0;
- a2 = a0;
- a3 = a0;
-
- a0 += + W2*col[8*2];
- a1 += + W6*col[8*2];
- a2 += - W6*col[8*2];
- a3 += - W2*col[8*2];
-
- MUL16(b0, W1, col[8*1]);
- MUL16(b1, W3, col[8*1]);
- MUL16(b2, W5, col[8*1]);
- MUL16(b3, W7, col[8*1]);
-
- MAC16(b0, + W3, col[8*3]);
- MAC16(b1, - W7, col[8*3]);
- MAC16(b2, - W1, col[8*3]);
- MAC16(b3, - W5, col[8*3]);
-
- if(col[8*4]){
- a0 += + W4*col[8*4];
- a1 += - W4*col[8*4];
- a2 += - W4*col[8*4];
- a3 += + W4*col[8*4];
- }
-
- if (col[8*5]) {
- MAC16(b0, + W5, col[8*5]);
- MAC16(b1, - W1, col[8*5]);
- MAC16(b2, + W7, col[8*5]);
- MAC16(b3, + W3, col[8*5]);
- }
-
- if(col[8*6]){
- a0 += + W6*col[8*6];
- a1 += - W2*col[8*6];
- a2 += + W2*col[8*6];
- a3 += - W6*col[8*6];
- }
-
- if (col[8*7]) {
- MAC16(b0, + W7, col[8*7]);
- MAC16(b1, - W5, col[8*7]);
- MAC16(b2, + W3, col[8*7]);
- MAC16(b3, - W1, col[8*7]);
- }
-
- col[0 ] = ((a0 + b0) >> COL_SHIFT);
- col[8 ] = ((a1 + b1) >> COL_SHIFT);
- col[16] = ((a2 + b2) >> COL_SHIFT);
- col[24] = ((a3 + b3) >> COL_SHIFT);
- col[32] = ((a3 - b3) >> COL_SHIFT);
- col[40] = ((a2 - b2) >> COL_SHIFT);
- col[48] = ((a1 - b1) >> COL_SHIFT);
- col[56] = ((a0 - b0) >> COL_SHIFT);
-}
-
-void simple_idct_put(uint8_t *dest, int line_size, DCTELEM *block)
-{
- int i;
- for(i=0; i<8; i++)
- idctRowCondDC(block + i*8);
-
- for(i=0; i<8; i++)
- idctSparseColPut(dest + i, line_size, block + i);
-}
-
-void simple_idct_add(uint8_t *dest, int line_size, DCTELEM *block)
-{
- int i;
- for(i=0; i<8; i++)
- idctRowCondDC(block + i*8);
-
- for(i=0; i<8; i++)
- idctSparseColAdd(dest + i, line_size, block + i);
-}
-
-void simple_idct(DCTELEM *block)
-{
- int i;
- for(i=0; i<8; i++)
- idctRowCondDC(block + i*8);
-
- for(i=0; i<8; i++)
- idctSparseCol(block + i);
-}
-
-/* 2x4x8 idct */
-
-#define CN_SHIFT 12
-#define C_FIX(x) ((int)((x) * (1 << CN_SHIFT) + 0.5))
-#define C1 C_FIX(0.6532814824)
-#define C2 C_FIX(0.2705980501)
-
-/* row idct is multiple by 16 * sqrt(2.0), col idct4 is normalized,
- and the butterfly must be multiplied by 0.5 * sqrt(2.0) */
-#define C_SHIFT (4+1+12)
-
-static inline void idct4col(uint8_t *dest, int line_size, const DCTELEM *col)
-{
- int c0, c1, c2, c3, a0, a1, a2, a3;
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-
- a0 = col[8*0];
- a1 = col[8*2];
- a2 = col[8*4];
- a3 = col[8*6];
- c0 = ((a0 + a2) << (CN_SHIFT - 1)) + (1 << (C_SHIFT - 1));
- c2 = ((a0 - a2) << (CN_SHIFT - 1)) + (1 << (C_SHIFT - 1));
- c1 = a1 * C1 + a3 * C2;
- c3 = a1 * C2 - a3 * C1;
- dest[0] = cm[(c0 + c1) >> C_SHIFT];
- dest += line_size;
- dest[0] = cm[(c2 + c3) >> C_SHIFT];
- dest += line_size;
- dest[0] = cm[(c2 - c3) >> C_SHIFT];
- dest += line_size;
- dest[0] = cm[(c0 - c1) >> C_SHIFT];
-}
-
-#define BF(k) \
-{\
- int a0, a1;\
- a0 = ptr[k];\
- a1 = ptr[8 + k];\
- ptr[k] = a0 + a1;\
- ptr[8 + k] = a0 - a1;\
-}
-
-/* only used by DV codec. The input must be interlaced. 128 is added
- to the pixels before clamping to avoid systematic error
- (1024*sqrt(2)) offset would be needed otherwise. */
-/* XXX: I think a 1.0/sqrt(2) normalization should be needed to
- compensate the extra butterfly stage - I don't have the full DV
- specification */
-void simple_idct248_put(uint8_t *dest, int line_size, DCTELEM *block)
-{
- int i;
- DCTELEM *ptr;
-
- /* butterfly */
- ptr = block;
- for(i=0;i<4;i++) {
- BF(0);
- BF(1);
- BF(2);
- BF(3);
- BF(4);
- BF(5);
- BF(6);
- BF(7);
- ptr += 2 * 8;
- }
-
- /* IDCT8 on each line */
- for(i=0; i<8; i++) {
- idctRowCondDC(block + i*8);
- }
-
- /* IDCT4 and store */
- for(i=0;i<8;i++) {
- idct4col(dest + i, 2 * line_size, block + i);
- idct4col(dest + line_size + i, 2 * line_size, block + 8 + i);
- }
-}
-
-/* 8x4 & 4x8 WMV2 IDCT */
-#undef CN_SHIFT
-#undef C_SHIFT
-#undef C_FIX
-#undef C1
-#undef C2
-#define CN_SHIFT 12
-#define C_FIX(x) ((int)((x) * 1.414213562 * (1 << CN_SHIFT) + 0.5))
-#define C1 C_FIX(0.6532814824)
-#define C2 C_FIX(0.2705980501)
-#define C3 C_FIX(0.5)
-#define C_SHIFT (4+1+12)
-static inline void idct4col_add(uint8_t *dest, int line_size, const DCTELEM *col)
-{
- int c0, c1, c2, c3, a0, a1, a2, a3;
- const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-
- a0 = col[8*0];
- a1 = col[8*1];
- a2 = col[8*2];
- a3 = col[8*3];
- c0 = (a0 + a2)*C3 + (1 << (C_SHIFT - 1));
- c2 = (a0 - a2)*C3 + (1 << (C_SHIFT - 1));
- c1 = a1 * C1 + a3 * C2;
- c3 = a1 * C2 - a3 * C1;
- dest[0] = cm[dest[0] + ((c0 + c1) >> C_SHIFT)];
- dest += line_size;
- dest[0] = cm[dest[0] + ((c2 + c3) >> C_SHIFT)];
- dest += line_size;
- dest[0] = cm[dest[0] + ((c2 - c3) >> C_SHIFT)];
- dest += line_size;
- dest[0] = cm[dest[0] + ((c0 - c1) >> C_SHIFT)];
-}
-
-#define RN_SHIFT 15
-#define R_FIX(x) ((int)((x) * 1.414213562 * (1 << RN_SHIFT) + 0.5))
-#define R1 R_FIX(0.6532814824)
-#define R2 R_FIX(0.2705980501)
-#define R3 R_FIX(0.5)
-#define R_SHIFT 11
-static inline void idct4row(DCTELEM *row)
-{
- int c0, c1, c2, c3, a0, a1, a2, a3;
- //const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-
- a0 = row[0];
- a1 = row[1];
- a2 = row[2];
- a3 = row[3];
- c0 = (a0 + a2)*R3 + (1 << (R_SHIFT - 1));
- c2 = (a0 - a2)*R3 + (1 << (R_SHIFT - 1));
- c1 = a1 * R1 + a3 * R2;
- c3 = a1 * R2 - a3 * R1;
- row[0]= (c0 + c1) >> R_SHIFT;
- row[1]= (c2 + c3) >> R_SHIFT;
- row[2]= (c2 - c3) >> R_SHIFT;
- row[3]= (c0 - c1) >> R_SHIFT;
-}
-
-void simple_idct84_add(uint8_t *dest, int line_size, DCTELEM *block)
-{
- int i;
-
- /* IDCT8 on each line */
- for(i=0; i<4; i++) {
- idctRowCondDC(block + i*8);
- }
-
- /* IDCT4 and store */
- for(i=0;i<8;i++) {
- idct4col_add(dest + i, line_size, block + i);
- }
-}
-
-void simple_idct48_add(uint8_t *dest, int line_size, DCTELEM *block)
-{
- int i;
-
- /* IDCT4 on each line */
- for(i=0; i<8; i++) {
- idct4row(block + i*8);
- }
-
- /* IDCT8 and store */
- for(i=0; i<4; i++){
- idctSparseColAdd(dest + i, line_size, block + i);
- }
-}
-
diff --git a/src/libffmpeg/libavcodec/simple_idct.h b/src/libffmpeg/libavcodec/simple_idct.h
deleted file mode 100644
index c4b453329..000000000
--- a/src/libffmpeg/libavcodec/simple_idct.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Simple IDCT
- *
- * Copyright (c) 2001 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file simple_idct.h
- * simple idct header.
- */
-
-void simple_idct_put(uint8_t *dest, int line_size, DCTELEM *block);
-void simple_idct_add(uint8_t *dest, int line_size, DCTELEM *block);
-void ff_simple_idct_mmx(int16_t *block);
-void ff_simple_idct_add_mmx(uint8_t *dest, int line_size, int16_t *block);
-void ff_simple_idct_put_mmx(uint8_t *dest, int line_size, int16_t *block);
-void simple_idct(DCTELEM *block);
-
-void simple_idct248_put(uint8_t *dest, int line_size, DCTELEM *block);
-
-void simple_idct84_add(uint8_t *dest, int line_size, DCTELEM *block);
-void simple_idct48_add(uint8_t *dest, int line_size, DCTELEM *block);
diff --git a/src/libffmpeg/libavcodec/smacker.c b/src/libffmpeg/libavcodec/smacker.c
deleted file mode 100644
index 0bdbc7977..000000000
--- a/src/libffmpeg/libavcodec/smacker.c
+++ /dev/null
@@ -1,723 +0,0 @@
-/*
- * Smacker decoder
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file smacker.c
- * Smacker decoder
- */
-
-/*
- * Based on http://wiki.multimedia.cx/index.php?title=Smacker
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "common.h"
-#include "avcodec.h"
-
-#define ALT_BITSTREAM_READER_LE
-#include "bitstream.h"
-
-#define SMKTREE_BITS 9
-#define SMK_NODE 0x80000000
-
-/*
- * Decoder context
- */
-typedef struct SmackVContext {
- AVCodecContext *avctx;
- AVFrame pic;
-
- int *mmap_tbl, *mclr_tbl, *full_tbl, *type_tbl;
- int mmap_last[3], mclr_last[3], full_last[3], type_last[3];
-} SmackVContext;
-
-/**
- * Context used for code reconstructing
- */
-typedef struct HuffContext {
- int length;
- int maxlength;
- int current;
- uint32_t *bits;
- int *lengths;
- int *values;
-} HuffContext;
-
-/* common parameters used for decode_bigtree */
-typedef struct DBCtx {
- VLC *v1, *v2;
- int *recode1, *recode2;
- int escapes[3];
- int *last;
- int lcur;
-} DBCtx;
-
-/* possible runs of blocks */
-static const int block_runs[64] = {
- 1, 2, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, 24,
- 25, 26, 27, 28, 29, 30, 31, 32,
- 33, 34, 35, 36, 37, 38, 39, 40,
- 41, 42, 43, 44, 45, 46, 47, 48,
- 49, 50, 51, 52, 53, 54, 55, 56,
- 57, 58, 59, 128, 256, 512, 1024, 2048 };
-
-enum SmkBlockTypes {
- SMK_BLK_MONO = 0,
- SMK_BLK_FULL = 1,
- SMK_BLK_SKIP = 2,
- SMK_BLK_FILL = 3 };
-
-/**
- * Decode local frame tree
- */
-static int smacker_decode_tree(GetBitContext *gb, HuffContext *hc, uint32_t prefix, int length)
-{
- if(!get_bits1(gb)){ //Leaf
- if(hc->current >= 256){
- av_log(NULL, AV_LOG_ERROR, "Tree size exceeded!\n");
- return -1;
- }
- if(length){
- hc->bits[hc->current] = prefix;
- hc->lengths[hc->current] = length;
- } else {
- hc->bits[hc->current] = 0;
- hc->lengths[hc->current] = 0;
- }
- hc->values[hc->current] = get_bits(gb, 8);
- hc->current++;
- if(hc->maxlength < length)
- hc->maxlength = length;
- return 0;
- } else { //Node
- int r;
- length++;
- r = smacker_decode_tree(gb, hc, prefix, length);
- if(r)
- return r;
- return smacker_decode_tree(gb, hc, prefix | (1 << (length - 1)), length);
- }
-}
-
-/**
- * Decode header tree
- */
-static int smacker_decode_bigtree(GetBitContext *gb, HuffContext *hc, DBCtx *ctx)
-{
- if(!get_bits1(gb)){ //Leaf
- int val, i1, i2, b1, b2;
- if(hc->current >= hc->length){
- av_log(NULL, AV_LOG_ERROR, "Tree size exceeded!\n");
- return -1;
- }
- b1 = get_bits_count(gb);
- i1 = get_vlc2(gb, ctx->v1->table, SMKTREE_BITS, 3);
- b1 = get_bits_count(gb) - b1;
- b2 = get_bits_count(gb);
- i2 = get_vlc2(gb, ctx->v2->table, SMKTREE_BITS, 3);
- b2 = get_bits_count(gb) - b2;
- val = ctx->recode1[i1] | (ctx->recode2[i2] << 8);
- if(val == ctx->escapes[0]) {
- ctx->last[0] = hc->current;
- val = 0;
- } else if(val == ctx->escapes[1]) {
- ctx->last[1] = hc->current;
- val = 0;
- } else if(val == ctx->escapes[2]) {
- ctx->last[2] = hc->current;
- val = 0;
- }
-
- hc->values[hc->current++] = val;
- return 1;
- } else { //Node
- int r = 0, t;
-
- t = hc->current++;
- r = smacker_decode_bigtree(gb, hc, ctx);
- if(r < 0)
- return r;
- hc->values[t] = SMK_NODE | r;
- r++;
- r += smacker_decode_bigtree(gb, hc, ctx);
- return r;
- }
-}
-
-/**
- * Store large tree as FFmpeg's vlc codes
- */
-static int smacker_decode_header_tree(SmackVContext *smk, GetBitContext *gb, int **recodes, int *last, int size)
-{
- int res;
- HuffContext huff;
- HuffContext tmp1, tmp2;
- VLC vlc[2];
- int escapes[3];
- DBCtx ctx;
-
- if(size >= UINT_MAX>>4){ // (((size + 3) >> 2) + 3) << 2 must not overflow
- av_log(smk->avctx, AV_LOG_ERROR, "size too large\n");
- return -1;
- }
-
- tmp1.length = 256;
- tmp1.maxlength = 0;
- tmp1.current = 0;
- tmp1.bits = av_mallocz(256 * 4);
- tmp1.lengths = av_mallocz(256 * sizeof(int));
- tmp1.values = av_mallocz(256 * sizeof(int));
-
- tmp2.length = 256;
- tmp2.maxlength = 0;
- tmp2.current = 0;
- tmp2.bits = av_mallocz(256 * 4);
- tmp2.lengths = av_mallocz(256 * sizeof(int));
- tmp2.values = av_mallocz(256 * sizeof(int));
-
- memset(&vlc[0], 0, sizeof(VLC));
- memset(&vlc[1], 0, sizeof(VLC));
-
- if(get_bits1(gb)) {
- smacker_decode_tree(gb, &tmp1, 0, 0);
- get_bits1(gb);
- res = init_vlc(&vlc[0], SMKTREE_BITS, tmp1.length,
- tmp1.lengths, sizeof(int), sizeof(int),
- tmp1.bits, sizeof(uint32_t), sizeof(uint32_t), INIT_VLC_LE);
- if(res < 0) {
- av_log(smk->avctx, AV_LOG_ERROR, "Cannot build VLC table\n");
- return -1;
- }
- } else {
- av_log(smk->avctx, AV_LOG_ERROR, "Skipping low bytes tree\n");
- }
- if(get_bits1(gb)){
- smacker_decode_tree(gb, &tmp2, 0, 0);
- get_bits1(gb);
- res = init_vlc(&vlc[1], SMKTREE_BITS, tmp2.length,
- tmp2.lengths, sizeof(int), sizeof(int),
- tmp2.bits, sizeof(uint32_t), sizeof(uint32_t), INIT_VLC_LE);
- if(res < 0) {
- av_log(smk->avctx, AV_LOG_ERROR, "Cannot build VLC table\n");
- return -1;
- }
- } else {
- av_log(smk->avctx, AV_LOG_ERROR, "Skipping high bytes tree\n");
- }
-
- escapes[0] = get_bits(gb, 8);
- escapes[0] |= get_bits(gb, 8) << 8;
- escapes[1] = get_bits(gb, 8);
- escapes[1] |= get_bits(gb, 8) << 8;
- escapes[2] = get_bits(gb, 8);
- escapes[2] |= get_bits(gb, 8) << 8;
-
- last[0] = last[1] = last[2] = -1;
-
- ctx.escapes[0] = escapes[0];
- ctx.escapes[1] = escapes[1];
- ctx.escapes[2] = escapes[2];
- ctx.v1 = &vlc[0];
- ctx.v2 = &vlc[1];
- ctx.recode1 = tmp1.values;
- ctx.recode2 = tmp2.values;
- ctx.last = last;
-
- huff.length = ((size + 3) >> 2) + 3;
- huff.maxlength = 0;
- huff.current = 0;
- huff.values = av_mallocz(huff.length * sizeof(int));
-
- smacker_decode_bigtree(gb, &huff, &ctx);
- get_bits1(gb);
- if(ctx.last[0] == -1) ctx.last[0] = huff.current++;
- if(ctx.last[1] == -1) ctx.last[1] = huff.current++;
- if(ctx.last[2] == -1) ctx.last[2] = huff.current++;
-
- *recodes = huff.values;
-
- if(vlc[0].table)
- free_vlc(&vlc[0]);
- if(vlc[1].table)
- free_vlc(&vlc[1]);
- av_free(tmp1.bits);
- av_free(tmp1.lengths);
- av_free(tmp1.values);
- av_free(tmp2.bits);
- av_free(tmp2.lengths);
- av_free(tmp2.values);
-
- return 0;
-}
-
-static int decode_header_trees(SmackVContext *smk) {
- GetBitContext gb;
- int mmap_size, mclr_size, full_size, type_size;
-
- mmap_size = AV_RL32(smk->avctx->extradata);
- mclr_size = AV_RL32(smk->avctx->extradata + 4);
- full_size = AV_RL32(smk->avctx->extradata + 8);
- type_size = AV_RL32(smk->avctx->extradata + 12);
-
- init_get_bits(&gb, smk->avctx->extradata + 16, (smk->avctx->extradata_size - 16) * 8);
-
- if(!get_bits1(&gb)) {
- av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n");
- smk->mmap_tbl = av_malloc(sizeof(int) * 2);
- smk->mmap_tbl[0] = 0;
- smk->mmap_last[0] = smk->mmap_last[1] = smk->mmap_last[2] = 1;
- } else {
- smacker_decode_header_tree(smk, &gb, &smk->mmap_tbl, smk->mmap_last, mmap_size);
- }
- if(!get_bits(&gb, 1)) {
- av_log(smk->avctx, AV_LOG_INFO, "Skipping MCLR tree\n");
- smk->mclr_tbl = av_malloc(sizeof(int) * 2);
- smk->mclr_tbl[0] = 0;
- smk->mclr_last[0] = smk->mclr_last[1] = smk->mclr_last[2] = 1;
- } else {
- smacker_decode_header_tree(smk, &gb, &smk->mclr_tbl, smk->mclr_last, mclr_size);
- }
- if(!get_bits(&gb, 1)) {
- av_log(smk->avctx, AV_LOG_INFO, "Skipping FULL tree\n");
- smk->full_tbl = av_malloc(sizeof(int) * 2);
- smk->full_tbl[0] = 0;
- smk->full_last[0] = smk->full_last[1] = smk->full_last[2] = 1;
- } else {
- smacker_decode_header_tree(smk, &gb, &smk->full_tbl, smk->full_last, full_size);
- }
- if(!get_bits(&gb, 1)) {
- av_log(smk->avctx, AV_LOG_INFO, "Skipping TYPE tree\n");
- smk->type_tbl = av_malloc(sizeof(int) * 2);
- smk->type_tbl[0] = 0;
- smk->type_last[0] = smk->type_last[1] = smk->type_last[2] = 1;
- } else {
- smacker_decode_header_tree(smk, &gb, &smk->type_tbl, smk->type_last, type_size);
- }
-
- return 0;
-}
-
-static av_always_inline void last_reset(int *recode, int *last) {
- recode[last[0]] = recode[last[1]] = recode[last[2]] = 0;
-}
-
-/* get code and update history */
-static av_always_inline int smk_get_code(GetBitContext *gb, int *recode, int *last) {
- register int *table = recode;
- int v, b;
-
- b = get_bits_count(gb);
- while(*table & SMK_NODE) {
- if(get_bits1(gb))
- table += (*table) & (~SMK_NODE);
- table++;
- }
- v = *table;
- b = get_bits_count(gb) - b;
-
- if(v != recode[last[0]]) {
- recode[last[2]] = recode[last[1]];
- recode[last[1]] = recode[last[0]];
- recode[last[0]] = v;
- }
- return v;
-}
-
-static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size)
-{
- SmackVContext * const smk = (SmackVContext *)avctx->priv_data;
- uint8_t *out;
- uint32_t *pal;
- GetBitContext gb;
- int blocks, blk, bw, bh;
- int i;
- int stride;
-
- if(buf_size == 769)
- return 0;
- if(smk->pic.data[0])
- avctx->release_buffer(avctx, &smk->pic);
-
- smk->pic.reference = 1;
- smk->pic.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
- if(avctx->reget_buffer(avctx, &smk->pic) < 0){
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
-
- /* make the palette available on the way out */
- out = buf + 1;
- pal = (uint32_t*)smk->pic.data[1];
- smk->pic.palette_has_changed = buf[0] & 1;
- smk->pic.key_frame = !!(buf[0] & 2);
- if(smk->pic.key_frame)
- smk->pic.pict_type = FF_I_TYPE;
- else
- smk->pic.pict_type = FF_P_TYPE;
-
- for(i = 0; i < 256; i++) {
- int r, g, b;
- r = *out++;
- g = *out++;
- b = *out++;
- *pal++ = (r << 16) | (g << 8) | b;
- }
-
- last_reset(smk->mmap_tbl, smk->mmap_last);
- last_reset(smk->mclr_tbl, smk->mclr_last);
- last_reset(smk->full_tbl, smk->full_last);
- last_reset(smk->type_tbl, smk->type_last);
- init_get_bits(&gb, buf + 769, (buf_size - 769) * 8);
-
- blk = 0;
- bw = avctx->width >> 2;
- bh = avctx->height >> 2;
- blocks = bw * bh;
- out = smk->pic.data[0];
- stride = smk->pic.linesize[0];
- while(blk < blocks) {
- int type, run, mode;
- uint16_t pix;
-
- type = smk_get_code(&gb, smk->type_tbl, smk->type_last);
- run = block_runs[(type >> 2) & 0x3F];
- switch(type & 3){
- case SMK_BLK_MONO:
- while(run-- && blk < blocks){
- int clr, map;
- int hi, lo;
- clr = smk_get_code(&gb, smk->mclr_tbl, smk->mclr_last);
- map = smk_get_code(&gb, smk->mmap_tbl, smk->mmap_last);
- out = smk->pic.data[0] + (blk / bw) * (stride * 4) + (blk % bw) * 4;
- hi = clr >> 8;
- lo = clr & 0xFF;
- for(i = 0; i < 4; i++) {
- if(map & 1) out[0] = hi; else out[0] = lo;
- if(map & 2) out[1] = hi; else out[1] = lo;
- if(map & 4) out[2] = hi; else out[2] = lo;
- if(map & 8) out[3] = hi; else out[3] = lo;
- map >>= 4;
- out += stride;
- }
- blk++;
- }
- break;
- case SMK_BLK_FULL:
- mode = 0;
- if(avctx->codec_tag == MKTAG('S', 'M', 'K', '4')) { // In case of Smacker v4 we have three modes
- if(get_bits1(&gb)) mode = 1;
- else if(get_bits1(&gb)) mode = 2;
- }
- while(run-- && blk < blocks){
- out = smk->pic.data[0] + (blk / bw) * (stride * 4) + (blk % bw) * 4;
- switch(mode){
- case 0:
- for(i = 0; i < 4; i++) {
- pix = smk_get_code(&gb, smk->full_tbl, smk->full_last);
- out[2] = pix & 0xFF;
- out[3] = pix >> 8;
- pix = smk_get_code(&gb, smk->full_tbl, smk->full_last);
- out[0] = pix & 0xFF;
- out[1] = pix >> 8;
- out += stride;
- }
- break;
- case 1:
- pix = smk_get_code(&gb, smk->full_tbl, smk->full_last);
- out[0] = out[1] = pix & 0xFF;
- out[2] = out[3] = pix >> 8;
- out += stride;
- out[0] = out[1] = pix & 0xFF;
- out[2] = out[3] = pix >> 8;
- out += stride;
- pix = smk_get_code(&gb, smk->full_tbl, smk->full_last);
- out[0] = out[1] = pix & 0xFF;
- out[2] = out[3] = pix >> 8;
- out += stride;
- out[0] = out[1] = pix & 0xFF;
- out[2] = out[3] = pix >> 8;
- out += stride;
- break;
- case 2:
- for(i = 0; i < 2; i++) {
- uint16_t pix1, pix2;
- pix1 = smk_get_code(&gb, smk->full_tbl, smk->full_last);
- pix2 = smk_get_code(&gb, smk->full_tbl, smk->full_last);
- out[0] = pix1 & 0xFF; out[1] = pix1 >> 8;
- out[2] = pix2 & 0xFF; out[3] = pix2 >> 8;
- out += stride;
- out[0] = pix1 & 0xFF; out[1] = pix1 >> 8;
- out[2] = pix2 & 0xFF; out[3] = pix2 >> 8;
- out += stride;
- }
- break;
- }
- blk++;
- }
- break;
- case SMK_BLK_SKIP:
- while(run-- && blk < blocks)
- blk++;
- break;
- case SMK_BLK_FILL:
- mode = type >> 8;
- while(run-- && blk < blocks){
- uint32_t col;
- out = smk->pic.data[0] + (blk / bw) * (stride * 4) + (blk % bw) * 4;
- col = mode * 0x01010101;
- for(i = 0; i < 4; i++) {
- *((uint32_t*)out) = col;
- out += stride;
- }
- blk++;
- }
- break;
- }
-
- }
-
- *data_size = sizeof(AVFrame);
- *(AVFrame*)data = smk->pic;
-
- /* always report that the buffer was completely consumed */
- return buf_size;
-}
-
-
-
-/*
- *
- * Init smacker decoder
- *
- */
-static int decode_init(AVCodecContext *avctx)
-{
- SmackVContext * const c = (SmackVContext *)avctx->priv_data;
-
- c->avctx = avctx;
- avctx->has_b_frames = 0;
-
- c->pic.data[0] = NULL;
-
- if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
- return 1;
- }
-
- avctx->pix_fmt = PIX_FMT_PAL8;
-
-
- /* decode huffman trees from extradata */
- if(avctx->extradata_size < 16){
- av_log(avctx, AV_LOG_ERROR, "Extradata missing!\n");
- return -1;
- }
-
- decode_header_trees(c);
-
-
- return 0;
-}
-
-
-
-/*
- *
- * Uninit smacker decoder
- *
- */
-static int decode_end(AVCodecContext *avctx)
-{
- SmackVContext * const smk = (SmackVContext *)avctx->priv_data;
-
- av_freep(&smk->mmap_tbl);
- av_freep(&smk->mclr_tbl);
- av_freep(&smk->full_tbl);
- av_freep(&smk->type_tbl);
-
- if (smk->pic.data[0])
- avctx->release_buffer(avctx, &smk->pic);
-
- return 0;
-}
-
-
-static int smka_decode_init(AVCodecContext *avctx)
-{
- return 0;
-}
-
-/**
- * Decode Smacker audio data
- */
-static int smka_decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size)
-{
- GetBitContext gb;
- HuffContext h[4];
- VLC vlc[4];
- int16_t *samples = data;
- int val;
- int i, res;
- int unp_size;
- int bits, stereo;
- int pred[2] = {0, 0};
-
- unp_size = AV_RL32(buf);
-
- init_get_bits(&gb, buf + 4, (buf_size - 4) * 8);
-
- if(!get_bits1(&gb)){
- av_log(avctx, AV_LOG_INFO, "Sound: no data\n");
- *data_size = 0;
- return 1;
- }
- stereo = get_bits1(&gb);
- bits = get_bits1(&gb);
-
- memset(vlc, 0, sizeof(VLC) * 4);
- memset(h, 0, sizeof(HuffContext) * 4);
- // Initialize
- for(i = 0; i < (1 << (bits + stereo)); i++) {
- h[i].length = 256;
- h[i].maxlength = 0;
- h[i].current = 0;
- h[i].bits = av_mallocz(256 * 4);
- h[i].lengths = av_mallocz(256 * sizeof(int));
- h[i].values = av_mallocz(256 * sizeof(int));
- get_bits1(&gb);
- smacker_decode_tree(&gb, &h[i], 0, 0);
- get_bits1(&gb);
- if(h[i].current > 1) {
- res = init_vlc(&vlc[i], SMKTREE_BITS, h[i].length,
- h[i].lengths, sizeof(int), sizeof(int),
- h[i].bits, sizeof(uint32_t), sizeof(uint32_t), INIT_VLC_LE);
- if(res < 0) {
- av_log(avctx, AV_LOG_ERROR, "Cannot build VLC table\n");
- return -1;
- }
- }
- }
- if(bits) { //decode 16-bit data
- pred[0] = get_bits(&gb, 8);
- pred[0] |= get_bits(&gb, 8);
- *samples++ = pred[0];
- if(stereo) {
- pred[1] = get_bits(&gb, 8);
- pred[1] |= get_bits(&gb, 8);
- *samples++ = pred[1];
- }
- for(i = 0; i < unp_size / 2; i++) {
- if(i & stereo) {
- if(vlc[2].table)
- res = get_vlc2(&gb, vlc[2].table, SMKTREE_BITS, 3);
- else
- res = 0;
- val = h[2].values[res];
- if(vlc[3].table)
- res = get_vlc2(&gb, vlc[3].table, SMKTREE_BITS, 3);
- else
- res = 0;
- val |= h[3].values[res] << 8;
- pred[1] += (int16_t)val;
- *samples++ = pred[1];
- } else {
- if(vlc[0].table)
- res = get_vlc2(&gb, vlc[0].table, SMKTREE_BITS, 3);
- else
- res = 0;
- val = h[0].values[res];
- if(vlc[1].table)
- res = get_vlc2(&gb, vlc[1].table, SMKTREE_BITS, 3);
- else
- res = 0;
- val |= h[1].values[res] << 8;
- pred[0] += val;
- *samples++ = pred[0];
- }
- }
- } else { //8-bit data
- pred[0] = get_bits(&gb, 8);
- *samples++ = (pred[0] - 0x80) << 8;
- if(stereo) {
- pred[1] = get_bits(&gb, 8);
- *samples++ = (pred[1] - 0x80) << 8;
- }
- for(i = 0; i < unp_size; i++) {
- if(i & stereo){
- if(vlc[1].table)
- res = get_vlc2(&gb, vlc[1].table, SMKTREE_BITS, 3);
- else
- res = 0;
- pred[1] += (int8_t)h[1].values[res];
- *samples++ = (pred[1] - 0x80) << 8;
- } else {
- if(vlc[0].table)
- res = get_vlc2(&gb, vlc[0].table, SMKTREE_BITS, 3);
- else
- res = 0;
- pred[0] += (int8_t)h[0].values[res];
- *samples++ = (pred[0] - 0x80) << 8;
- }
- }
- unp_size *= 2;
- }
-
- for(i = 0; i < 4; i++) {
- if(vlc[i].table)
- free_vlc(&vlc[i]);
- if(h[i].bits)
- av_free(h[i].bits);
- if(h[i].lengths)
- av_free(h[i].lengths);
- if(h[i].values)
- av_free(h[i].values);
- }
-
- *data_size = unp_size;
- return buf_size;
-}
-
-AVCodec smacker_decoder = {
- "smackvid",
- CODEC_TYPE_VIDEO,
- CODEC_ID_SMACKVIDEO,
- sizeof(SmackVContext),
- decode_init,
- NULL,
- decode_end,
- decode_frame
-};
-
-AVCodec smackaud_decoder = {
- "smackaud",
- CODEC_TYPE_AUDIO,
- CODEC_ID_SMACKAUDIO,
- 0,
- smka_decode_init,
- NULL,
- NULL,
- smka_decode_frame
-};
-
diff --git a/src/libffmpeg/libavcodec/smc.c b/src/libffmpeg/libavcodec/smc.c
deleted file mode 100644
index 349e5f81c..000000000
--- a/src/libffmpeg/libavcodec/smc.c
+++ /dev/null
@@ -1,493 +0,0 @@
-/*
- * Quicktime Graphics (SMC) Video Decoder
- * Copyright (C) 2003 the ffmpeg project
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file smc.c
- * QT SMC Video Decoder by Mike Melanson (melanson@pcisys.net)
- * For more information about the SMC format, visit:
- * http://www.pcisys.net/~melanson/codecs/
- *
- * The SMC decoder outputs PAL8 colorspace data.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "common.h"
-#include "avcodec.h"
-#include "dsputil.h"
-
-#define CPAIR 2
-#define CQUAD 4
-#define COCTET 8
-
-#define COLORS_PER_TABLE 256
-
-typedef struct SmcContext {
-
- AVCodecContext *avctx;
- DSPContext dsp;
- AVFrame frame;
-
- unsigned char *buf;
- int size;
-
- /* SMC color tables */
- unsigned char color_pairs[COLORS_PER_TABLE * CPAIR];
- unsigned char color_quads[COLORS_PER_TABLE * CQUAD];
- unsigned char color_octets[COLORS_PER_TABLE * COCTET];
-
-} SmcContext;
-
-#define GET_BLOCK_COUNT() \
- (opcode & 0x10) ? (1 + s->buf[stream_ptr++]) : 1 + (opcode & 0x0F);
-
-#define ADVANCE_BLOCK() \
-{ \
- pixel_ptr += 4; \
- if (pixel_ptr >= width) \
- { \
- pixel_ptr = 0; \
- row_ptr += stride * 4; \
- } \
- total_blocks--; \
- if (total_blocks < 0) \
- { \
- av_log(s->avctx, AV_LOG_INFO, "warning: block counter just went negative (this should not happen)\n"); \
- return; \
- } \
-}
-
-static void smc_decode_stream(SmcContext *s)
-{
- int width = s->avctx->width;
- int height = s->avctx->height;
- int stride = s->frame.linesize[0];
- int i;
- int stream_ptr = 0;
- int chunk_size;
- unsigned char opcode;
- int n_blocks;
- unsigned int color_flags;
- unsigned int color_flags_a;
- unsigned int color_flags_b;
- unsigned int flag_mask;
-
- unsigned char *pixels = s->frame.data[0];
-
- int image_size = height * s->frame.linesize[0];
- int row_ptr = 0;
- int pixel_ptr = 0;
- int pixel_x, pixel_y;
- int row_inc = stride - 4;
- int block_ptr;
- int prev_block_ptr;
- int prev_block_ptr1, prev_block_ptr2;
- int prev_block_flag;
- int total_blocks;
- int color_table_index; /* indexes to color pair, quad, or octet tables */
- int pixel;
-
- int color_pair_index = 0;
- int color_quad_index = 0;
- int color_octet_index = 0;
-
- /* make the palette available */
- memcpy(s->frame.data[1], s->avctx->palctrl->palette, AVPALETTE_SIZE);
- if (s->avctx->palctrl->palette_changed) {
- s->frame.palette_has_changed = 1;
- s->avctx->palctrl->palette_changed = 0;
- }
-
- chunk_size = AV_RB32(&s->buf[stream_ptr]) & 0x00FFFFFF;
- stream_ptr += 4;
- if (chunk_size != s->size)
- av_log(s->avctx, AV_LOG_INFO, "warning: MOV chunk size != encoded chunk size (%d != %d); using MOV chunk size\n",
- chunk_size, s->size);
-
- chunk_size = s->size;
- total_blocks = ((s->avctx->width + 3) / 4) * ((s->avctx->height + 3) / 4);
-
- /* traverse through the blocks */
- while (total_blocks) {
- /* sanity checks */
- /* make sure stream ptr hasn't gone out of bounds */
- if (stream_ptr > chunk_size) {
- av_log(s->avctx, AV_LOG_INFO, "SMC decoder just went out of bounds (stream ptr = %d, chunk size = %d)\n",
- stream_ptr, chunk_size);
- return;
- }
- /* make sure the row pointer hasn't gone wild */
- if (row_ptr >= image_size) {
- av_log(s->avctx, AV_LOG_INFO, "SMC decoder just went out of bounds (row ptr = %d, height = %d)\n",
- row_ptr, image_size);
- return;
- }
-
- opcode = s->buf[stream_ptr++];
- switch (opcode & 0xF0) {
- /* skip n blocks */
- case 0x00:
- case 0x10:
- n_blocks = GET_BLOCK_COUNT();
- while (n_blocks--) {
- ADVANCE_BLOCK();
- }
- break;
-
- /* repeat last block n times */
- case 0x20:
- case 0x30:
- n_blocks = GET_BLOCK_COUNT();
-
- /* sanity check */
- if ((row_ptr == 0) && (pixel_ptr == 0)) {
- av_log(s->avctx, AV_LOG_INFO, "encountered repeat block opcode (%02X) but no blocks rendered yet\n",
- opcode & 0xF0);
- break;
- }
-
- /* figure out where the previous block started */
- if (pixel_ptr == 0)
- prev_block_ptr1 =
- (row_ptr - s->avctx->width * 4) + s->avctx->width - 4;
- else
- prev_block_ptr1 = row_ptr + pixel_ptr - 4;
-
- while (n_blocks--) {
- block_ptr = row_ptr + pixel_ptr;
- prev_block_ptr = prev_block_ptr1;
- for (pixel_y = 0; pixel_y < 4; pixel_y++) {
- for (pixel_x = 0; pixel_x < 4; pixel_x++) {
- pixels[block_ptr++] = pixels[prev_block_ptr++];
- }
- block_ptr += row_inc;
- prev_block_ptr += row_inc;
- }
- ADVANCE_BLOCK();
- }
- break;
-
- /* repeat previous pair of blocks n times */
- case 0x40:
- case 0x50:
- n_blocks = GET_BLOCK_COUNT();
- n_blocks *= 2;
-
- /* sanity check */
- if ((row_ptr == 0) && (pixel_ptr < 2 * 4)) {
- av_log(s->avctx, AV_LOG_INFO, "encountered repeat block opcode (%02X) but not enough blocks rendered yet\n",
- opcode & 0xF0);
- break;
- }
-
- /* figure out where the previous 2 blocks started */
- if (pixel_ptr == 0)
- prev_block_ptr1 = (row_ptr - s->avctx->width * 4) +
- s->avctx->width - 4 * 2;
- else if (pixel_ptr == 4)
- prev_block_ptr1 = (row_ptr - s->avctx->width * 4) + row_inc;
- else
- prev_block_ptr1 = row_ptr + pixel_ptr - 4 * 2;
-
- if (pixel_ptr == 0)
- prev_block_ptr2 = (row_ptr - s->avctx->width * 4) + row_inc;
- else
- prev_block_ptr2 = row_ptr + pixel_ptr - 4;
-
- prev_block_flag = 0;
- while (n_blocks--) {
- block_ptr = row_ptr + pixel_ptr;
- if (prev_block_flag)
- prev_block_ptr = prev_block_ptr2;
- else
- prev_block_ptr = prev_block_ptr1;
- prev_block_flag = !prev_block_flag;
-
- for (pixel_y = 0; pixel_y < 4; pixel_y++) {
- for (pixel_x = 0; pixel_x < 4; pixel_x++) {
- pixels[block_ptr++] = pixels[prev_block_ptr++];
- }
- block_ptr += row_inc;
- prev_block_ptr += row_inc;
- }
- ADVANCE_BLOCK();
- }
- break;
-
- /* 1-color block encoding */
- case 0x60:
- case 0x70:
- n_blocks = GET_BLOCK_COUNT();
- pixel = s->buf[stream_ptr++];
-
- while (n_blocks--) {
- block_ptr = row_ptr + pixel_ptr;
- for (pixel_y = 0; pixel_y < 4; pixel_y++) {
- for (pixel_x = 0; pixel_x < 4; pixel_x++) {
- pixels[block_ptr++] = pixel;
- }
- block_ptr += row_inc;
- }
- ADVANCE_BLOCK();
- }
- break;
-
- /* 2-color block encoding */
- case 0x80:
- case 0x90:
- n_blocks = (opcode & 0x0F) + 1;
-
- /* figure out which color pair to use to paint the 2-color block */
- if ((opcode & 0xF0) == 0x80) {
- /* fetch the next 2 colors from bytestream and store in next
- * available entry in the color pair table */
- for (i = 0; i < CPAIR; i++) {
- pixel = s->buf[stream_ptr++];
- color_table_index = CPAIR * color_pair_index + i;
- s->color_pairs[color_table_index] = pixel;
- }
- /* this is the base index to use for this block */
- color_table_index = CPAIR * color_pair_index;
- color_pair_index++;
- /* wraparound */
- if (color_pair_index == COLORS_PER_TABLE)
- color_pair_index = 0;
- } else
- color_table_index = CPAIR * s->buf[stream_ptr++];
-
- while (n_blocks--) {
- color_flags = AV_RB16(&s->buf[stream_ptr]);
- stream_ptr += 2;
- flag_mask = 0x8000;
- block_ptr = row_ptr + pixel_ptr;
- for (pixel_y = 0; pixel_y < 4; pixel_y++) {
- for (pixel_x = 0; pixel_x < 4; pixel_x++) {
- if (color_flags & flag_mask)
- pixel = color_table_index + 1;
- else
- pixel = color_table_index;
- flag_mask >>= 1;
- pixels[block_ptr++] = s->color_pairs[pixel];
- }
- block_ptr += row_inc;
- }
- ADVANCE_BLOCK();
- }
- break;
-
- /* 4-color block encoding */
- case 0xA0:
- case 0xB0:
- n_blocks = (opcode & 0x0F) + 1;
-
- /* figure out which color quad to use to paint the 4-color block */
- if ((opcode & 0xF0) == 0xA0) {
- /* fetch the next 4 colors from bytestream and store in next
- * available entry in the color quad table */
- for (i = 0; i < CQUAD; i++) {
- pixel = s->buf[stream_ptr++];
- color_table_index = CQUAD * color_quad_index + i;
- s->color_quads[color_table_index] = pixel;
- }
- /* this is the base index to use for this block */
- color_table_index = CQUAD * color_quad_index;
- color_quad_index++;
- /* wraparound */
- if (color_quad_index == COLORS_PER_TABLE)
- color_quad_index = 0;
- } else
- color_table_index = CQUAD * s->buf[stream_ptr++];
-
- while (n_blocks--) {
- color_flags = AV_RB32(&s->buf[stream_ptr]);
- stream_ptr += 4;
- /* flag mask actually acts as a bit shift count here */
- flag_mask = 30;
- block_ptr = row_ptr + pixel_ptr;
- for (pixel_y = 0; pixel_y < 4; pixel_y++) {
- for (pixel_x = 0; pixel_x < 4; pixel_x++) {
- pixel = color_table_index +
- ((color_flags >> flag_mask) & 0x03);
- flag_mask -= 2;
- pixels[block_ptr++] = s->color_quads[pixel];
- }
- block_ptr += row_inc;
- }
- ADVANCE_BLOCK();
- }
- break;
-
- /* 8-color block encoding */
- case 0xC0:
- case 0xD0:
- n_blocks = (opcode & 0x0F) + 1;
-
- /* figure out which color octet to use to paint the 8-color block */
- if ((opcode & 0xF0) == 0xC0) {
- /* fetch the next 8 colors from bytestream and store in next
- * available entry in the color octet table */
- for (i = 0; i < COCTET; i++) {
- pixel = s->buf[stream_ptr++];
- color_table_index = COCTET * color_octet_index + i;
- s->color_octets[color_table_index] = pixel;
- }
- /* this is the base index to use for this block */
- color_table_index = COCTET * color_octet_index;
- color_octet_index++;
- /* wraparound */
- if (color_octet_index == COLORS_PER_TABLE)
- color_octet_index = 0;
- } else
- color_table_index = COCTET * s->buf[stream_ptr++];
-
- while (n_blocks--) {
- /*
- For this input of 6 hex bytes:
- 01 23 45 67 89 AB
- Mangle it to this output:
- flags_a = xx012456, flags_b = xx89A37B
- */
- /* build the color flags */
- color_flags_a = color_flags_b = 0;
- color_flags_a =
- (s->buf[stream_ptr + 0] << 16) |
- ((s->buf[stream_ptr + 1] & 0xF0) << 8) |
- ((s->buf[stream_ptr + 2] & 0xF0) << 4) |
- ((s->buf[stream_ptr + 2] & 0x0F) << 4) |
- ((s->buf[stream_ptr + 3] & 0xF0) >> 4);
- color_flags_b =
- (s->buf[stream_ptr + 4] << 16) |
- ((s->buf[stream_ptr + 5] & 0xF0) << 8) |
- ((s->buf[stream_ptr + 1] & 0x0F) << 8) |
- ((s->buf[stream_ptr + 3] & 0x0F) << 4) |
- (s->buf[stream_ptr + 5] & 0x0F);
- stream_ptr += 6;
-
- color_flags = color_flags_a;
- /* flag mask actually acts as a bit shift count here */
- flag_mask = 21;
- block_ptr = row_ptr + pixel_ptr;
- for (pixel_y = 0; pixel_y < 4; pixel_y++) {
- /* reload flags at third row (iteration pixel_y == 2) */
- if (pixel_y == 2) {
- color_flags = color_flags_b;
- flag_mask = 21;
- }
- for (pixel_x = 0; pixel_x < 4; pixel_x++) {
- pixel = color_table_index +
- ((color_flags >> flag_mask) & 0x07);
- flag_mask -= 3;
- pixels[block_ptr++] = s->color_octets[pixel];
- }
- block_ptr += row_inc;
- }
- ADVANCE_BLOCK();
- }
- break;
-
- /* 16-color block encoding (every pixel is a different color) */
- case 0xE0:
- n_blocks = (opcode & 0x0F) + 1;
-
- while (n_blocks--) {
- block_ptr = row_ptr + pixel_ptr;
- for (pixel_y = 0; pixel_y < 4; pixel_y++) {
- for (pixel_x = 0; pixel_x < 4; pixel_x++) {
- pixels[block_ptr++] = s->buf[stream_ptr++];
- }
- block_ptr += row_inc;
- }
- ADVANCE_BLOCK();
- }
- break;
-
- case 0xF0:
- av_log(s->avctx, AV_LOG_INFO, "0xF0 opcode seen in SMC chunk (contact the developers)\n");
- break;
- }
- }
-}
-
-static int smc_decode_init(AVCodecContext *avctx)
-{
- SmcContext *s = (SmcContext *)avctx->priv_data;
-
- s->avctx = avctx;
- avctx->pix_fmt = PIX_FMT_PAL8;
- avctx->has_b_frames = 0;
- dsputil_init(&s->dsp, avctx);
-
- s->frame.data[0] = NULL;
-
- return 0;
-}
-
-static int smc_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- SmcContext *s = (SmcContext *)avctx->priv_data;
-
- s->buf = buf;
- s->size = buf_size;
-
- s->frame.reference = 1;
- s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE |
- FF_BUFFER_HINTS_REUSABLE | FF_BUFFER_HINTS_READABLE;
- if (avctx->reget_buffer(avctx, &s->frame)) {
- av_log(s->avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
- return -1;
- }
-
- smc_decode_stream(s);
-
- *data_size = sizeof(AVFrame);
- *(AVFrame*)data = s->frame;
-
- /* always report that the buffer was completely consumed */
- return buf_size;
-}
-
-static int smc_decode_end(AVCodecContext *avctx)
-{
- SmcContext *s = (SmcContext *)avctx->priv_data;
-
- if (s->frame.data[0])
- avctx->release_buffer(avctx, &s->frame);
-
- return 0;
-}
-
-AVCodec smc_decoder = {
- "smc",
- CODEC_TYPE_VIDEO,
- CODEC_ID_SMC,
- sizeof(SmcContext),
- smc_decode_init,
- NULL,
- smc_decode_end,
- smc_decode_frame,
- CODEC_CAP_DR1,
-};
diff --git a/src/libffmpeg/libavcodec/snow.c b/src/libffmpeg/libavcodec/snow.c
deleted file mode 100644
index 03e634bf1..000000000
--- a/src/libffmpeg/libavcodec/snow.c
+++ /dev/null
@@ -1,4720 +0,0 @@
-/*
- * Copyright (C) 2004 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-#include "common.h"
-#include "dsputil.h"
-#include "snow.h"
-
-#include "rangecoder.h"
-
-#include "mpegvideo.h"
-
-#undef NDEBUG
-#include <assert.h>
-
-static const int8_t quant3[256]={
- 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
--1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
--1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
--1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
--1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
--1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
--1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
--1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
--1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0,
-};
-static const int8_t quant3b[256]={
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
--1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
--1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
--1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
--1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
--1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
--1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
--1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
--1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-};
-static const int8_t quant3bA[256]={
- 0, 0, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1,
- 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1,
- 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1,
- 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1,
- 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1,
- 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1,
- 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1,
- 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1,
- 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1,
- 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1,
- 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1,
- 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1,
- 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1,
- 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1,
- 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1,
- 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1,
-};
-static const int8_t quant5[256]={
- 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
--2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,
--2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,
--2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,
--2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,
--2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,
--2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,
--2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,
--2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,
-};
-static const int8_t quant7[256]={
- 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
--3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,
--3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,
--3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,
--3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,
--3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,
--3,-3,-3,-3,-3,-3,-3,-3,-3,-2,-2,-2,-2,-2,-2,-2,
--2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,
--2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,
-};
-static const int8_t quant9[256]={
- 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
--4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,
--4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,
--4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,
--4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,
--4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,
--4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,
--4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-3,-3,-3,-3,
--3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-2,-2,-2,-2,-1,-1,
-};
-static const int8_t quant11[256]={
- 0, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
--5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,
--5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,
--5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,
--5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,
--5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,
--5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-4,-4,
--4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,
--4,-4,-4,-4,-4,-3,-3,-3,-3,-3,-3,-3,-2,-2,-2,-1,
-};
-static const int8_t quant13[256]={
- 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
--6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,
--6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,
--6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,
--6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,
--6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-5,
--5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,
--5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,
--4,-4,-4,-4,-4,-4,-4,-4,-4,-3,-3,-3,-3,-2,-2,-1,
-};
-
-#if 0 //64*cubic
-static const uint8_t obmc32[1024]={
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
- 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0,
- 0, 0, 1, 1, 2, 2, 3, 4, 4, 5, 6, 6, 7, 7, 8, 8, 8, 8, 7, 7, 6, 6, 5, 4, 4, 3, 2, 2, 1, 1, 0, 0,
- 0, 0, 1, 2, 2, 3, 4, 6, 7, 8, 9,10,11,12,12,12,12,12,12,11,10, 9, 8, 7, 6, 4, 3, 2, 2, 1, 0, 0,
- 0, 1, 1, 2, 3, 5, 6, 8,10,11,13,14,15,16,17,18,18,17,16,15,14,13,11,10, 8, 6, 5, 3, 2, 1, 1, 0,
- 0, 1, 1, 3, 4, 6, 8,10,13,15,17,19,20,22,22,23,23,22,22,20,19,17,15,13,10, 8, 6, 4, 3, 1, 1, 0,
- 0, 1, 2, 4, 6, 8,10,13,16,19,21,23,25,27,28,29,29,28,27,25,23,21,19,16,13,10, 8, 6, 4, 2, 1, 0,
- 0, 1, 2, 4, 7,10,13,16,19,22,25,28,31,33,34,35,35,34,33,31,28,25,22,19,16,13,10, 7, 4, 2, 1, 0,
- 0, 1, 3, 5, 8,11,15,19,22,26,30,33,36,38,40,41,41,40,38,36,33,30,26,22,19,15,11, 8, 5, 3, 1, 0,
- 0, 1, 3, 6, 9,12,17,21,25,30,34,38,41,44,45,46,46,45,44,41,38,34,30,25,21,17,12, 9, 6, 3, 1, 0,
- 0, 1, 3, 6,10,14,19,23,28,33,38,42,45,48,51,52,52,51,48,45,42,38,33,28,23,19,14,10, 6, 3, 1, 0,
- 0, 1, 4, 7,11,15,20,25,31,36,41,45,49,52,55,56,56,55,52,49,45,41,36,31,25,20,15,11, 7, 4, 1, 0,
- 0, 2, 4, 7,12,16,22,27,33,38,44,48,52,56,58,60,60,58,56,52,48,44,38,33,27,22,16,12, 7, 4, 2, 0,
- 0, 1, 4, 8,12,17,22,28,34,40,45,51,55,58,61,62,62,61,58,55,51,45,40,34,28,22,17,12, 8, 4, 1, 0,
- 0, 2, 4, 8,12,18,23,29,35,41,46,52,56,60,62,64,64,62,60,56,52,46,41,35,29,23,18,12, 8, 4, 2, 0,
- 0, 2, 4, 8,12,18,23,29,35,41,46,52,56,60,62,64,64,62,60,56,52,46,41,35,29,23,18,12, 8, 4, 2, 0,
- 0, 1, 4, 8,12,17,22,28,34,40,45,51,55,58,61,62,62,61,58,55,51,45,40,34,28,22,17,12, 8, 4, 1, 0,
- 0, 2, 4, 7,12,16,22,27,33,38,44,48,52,56,58,60,60,58,56,52,48,44,38,33,27,22,16,12, 7, 4, 2, 0,
- 0, 1, 4, 7,11,15,20,25,31,36,41,45,49,52,55,56,56,55,52,49,45,41,36,31,25,20,15,11, 7, 4, 1, 0,
- 0, 1, 3, 6,10,14,19,23,28,33,38,42,45,48,51,52,52,51,48,45,42,38,33,28,23,19,14,10, 6, 3, 1, 0,
- 0, 1, 3, 6, 9,12,17,21,25,30,34,38,41,44,45,46,46,45,44,41,38,34,30,25,21,17,12, 9, 6, 3, 1, 0,
- 0, 1, 3, 5, 8,11,15,19,22,26,30,33,36,38,40,41,41,40,38,36,33,30,26,22,19,15,11, 8, 5, 3, 1, 0,
- 0, 1, 2, 4, 7,10,13,16,19,22,25,28,31,33,34,35,35,34,33,31,28,25,22,19,16,13,10, 7, 4, 2, 1, 0,
- 0, 1, 2, 4, 6, 8,10,13,16,19,21,23,25,27,28,29,29,28,27,25,23,21,19,16,13,10, 8, 6, 4, 2, 1, 0,
- 0, 1, 1, 3, 4, 6, 8,10,13,15,17,19,20,22,22,23,23,22,22,20,19,17,15,13,10, 8, 6, 4, 3, 1, 1, 0,
- 0, 1, 1, 2, 3, 5, 6, 8,10,11,13,14,15,16,17,18,18,17,16,15,14,13,11,10, 8, 6, 5, 3, 2, 1, 1, 0,
- 0, 0, 1, 2, 2, 3, 4, 6, 7, 8, 9,10,11,12,12,12,12,12,12,11,10, 9, 8, 7, 6, 4, 3, 2, 2, 1, 0, 0,
- 0, 0, 1, 1, 2, 2, 3, 4, 4, 5, 6, 6, 7, 7, 8, 8, 8, 8, 7, 7, 6, 6, 5, 4, 4, 3, 2, 2, 1, 1, 0, 0,
- 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-//error:0.000022
-};
-static const uint8_t obmc16[256]={
- 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
- 0, 1, 1, 2, 4, 5, 5, 6, 6, 5, 5, 4, 2, 1, 1, 0,
- 0, 1, 4, 6, 9,11,13,15,15,13,11, 9, 6, 4, 1, 0,
- 0, 2, 6,11,15,20,24,26,26,24,20,15,11, 6, 2, 0,
- 0, 4, 9,15,23,29,34,38,38,34,29,23,15, 9, 4, 0,
- 0, 5,11,20,29,38,45,49,49,45,38,29,20,11, 5, 0,
- 1, 5,13,24,34,45,53,57,57,53,45,34,24,13, 5, 1,
- 1, 6,15,26,38,49,57,62,62,57,49,38,26,15, 6, 1,
- 1, 6,15,26,38,49,57,62,62,57,49,38,26,15, 6, 1,
- 1, 5,13,24,34,45,53,57,57,53,45,34,24,13, 5, 1,
- 0, 5,11,20,29,38,45,49,49,45,38,29,20,11, 5, 0,
- 0, 4, 9,15,23,29,34,38,38,34,29,23,15, 9, 4, 0,
- 0, 2, 6,11,15,20,24,26,26,24,20,15,11, 6, 2, 0,
- 0, 1, 4, 6, 9,11,13,15,15,13,11, 9, 6, 4, 1, 0,
- 0, 1, 1, 2, 4, 5, 5, 6, 6, 5, 5, 4, 2, 1, 1, 0,
- 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
-//error:0.000033
-};
-#elif 1 // 64*linear
-static const uint8_t obmc32[1024]={
- 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0,
- 0, 4, 4, 4, 8, 8, 8, 12, 12, 16, 16, 16, 20, 20, 20, 24, 24, 20, 20, 20, 16, 16, 16, 12, 12, 8, 8, 8, 4, 4, 4, 0,
- 0, 4, 8, 8, 12, 12, 16, 20, 20, 24, 28, 28, 32, 32, 36, 40, 40, 36, 32, 32, 28, 28, 24, 20, 20, 16, 12, 12, 8, 8, 4, 0,
- 0, 4, 8, 12, 16, 20, 24, 28, 28, 32, 36, 40, 44, 48, 52, 56, 56, 52, 48, 44, 40, 36, 32, 28, 28, 24, 20, 16, 12, 8, 4, 0,
- 4, 8, 12, 16, 20, 24, 28, 32, 40, 44, 48, 52, 56, 60, 64, 68, 68, 64, 60, 56, 52, 48, 44, 40, 32, 28, 24, 20, 16, 12, 8, 4,
- 4, 8, 12, 20, 24, 32, 36, 40, 48, 52, 56, 64, 68, 76, 80, 84, 84, 80, 76, 68, 64, 56, 52, 48, 40, 36, 32, 24, 20, 12, 8, 4,
- 4, 8, 16, 24, 28, 36, 44, 48, 56, 60, 68, 76, 80, 88, 96,100,100, 96, 88, 80, 76, 68, 60, 56, 48, 44, 36, 28, 24, 16, 8, 4,
- 4, 12, 20, 28, 32, 40, 48, 56, 64, 72, 80, 88, 92,100,108,116,116,108,100, 92, 88, 80, 72, 64, 56, 48, 40, 32, 28, 20, 12, 4,
- 4, 12, 20, 28, 40, 48, 56, 64, 72, 80, 88, 96,108,116,124,132,132,124,116,108, 96, 88, 80, 72, 64, 56, 48, 40, 28, 20, 12, 4,
- 4, 16, 24, 32, 44, 52, 60, 72, 80, 92,100,108,120,128,136,148,148,136,128,120,108,100, 92, 80, 72, 60, 52, 44, 32, 24, 16, 4,
- 4, 16, 28, 36, 48, 56, 68, 80, 88,100,112,120,132,140,152,164,164,152,140,132,120,112,100, 88, 80, 68, 56, 48, 36, 28, 16, 4,
- 4, 16, 28, 40, 52, 64, 76, 88, 96,108,120,132,144,156,168,180,180,168,156,144,132,120,108, 96, 88, 76, 64, 52, 40, 28, 16, 4,
- 8, 20, 32, 44, 56, 68, 80, 92,108,120,132,144,156,168,180,192,192,180,168,156,144,132,120,108, 92, 80, 68, 56, 44, 32, 20, 8,
- 8, 20, 32, 48, 60, 76, 88,100,116,128,140,156,168,184,196,208,208,196,184,168,156,140,128,116,100, 88, 76, 60, 48, 32, 20, 8,
- 8, 20, 36, 52, 64, 80, 96,108,124,136,152,168,180,196,212,224,224,212,196,180,168,152,136,124,108, 96, 80, 64, 52, 36, 20, 8,
- 8, 24, 40, 56, 68, 84,100,116,132,148,164,180,192,208,224,240,240,224,208,192,180,164,148,132,116,100, 84, 68, 56, 40, 24, 8,
- 8, 24, 40, 56, 68, 84,100,116,132,148,164,180,192,208,224,240,240,224,208,192,180,164,148,132,116,100, 84, 68, 56, 40, 24, 8,
- 8, 20, 36, 52, 64, 80, 96,108,124,136,152,168,180,196,212,224,224,212,196,180,168,152,136,124,108, 96, 80, 64, 52, 36, 20, 8,
- 8, 20, 32, 48, 60, 76, 88,100,116,128,140,156,168,184,196,208,208,196,184,168,156,140,128,116,100, 88, 76, 60, 48, 32, 20, 8,
- 8, 20, 32, 44, 56, 68, 80, 92,108,120,132,144,156,168,180,192,192,180,168,156,144,132,120,108, 92, 80, 68, 56, 44, 32, 20, 8,
- 4, 16, 28, 40, 52, 64, 76, 88, 96,108,120,132,144,156,168,180,180,168,156,144,132,120,108, 96, 88, 76, 64, 52, 40, 28, 16, 4,
- 4, 16, 28, 36, 48, 56, 68, 80, 88,100,112,120,132,140,152,164,164,152,140,132,120,112,100, 88, 80, 68, 56, 48, 36, 28, 16, 4,
- 4, 16, 24, 32, 44, 52, 60, 72, 80, 92,100,108,120,128,136,148,148,136,128,120,108,100, 92, 80, 72, 60, 52, 44, 32, 24, 16, 4,
- 4, 12, 20, 28, 40, 48, 56, 64, 72, 80, 88, 96,108,116,124,132,132,124,116,108, 96, 88, 80, 72, 64, 56, 48, 40, 28, 20, 12, 4,
- 4, 12, 20, 28, 32, 40, 48, 56, 64, 72, 80, 88, 92,100,108,116,116,108,100, 92, 88, 80, 72, 64, 56, 48, 40, 32, 28, 20, 12, 4,
- 4, 8, 16, 24, 28, 36, 44, 48, 56, 60, 68, 76, 80, 88, 96,100,100, 96, 88, 80, 76, 68, 60, 56, 48, 44, 36, 28, 24, 16, 8, 4,
- 4, 8, 12, 20, 24, 32, 36, 40, 48, 52, 56, 64, 68, 76, 80, 84, 84, 80, 76, 68, 64, 56, 52, 48, 40, 36, 32, 24, 20, 12, 8, 4,
- 4, 8, 12, 16, 20, 24, 28, 32, 40, 44, 48, 52, 56, 60, 64, 68, 68, 64, 60, 56, 52, 48, 44, 40, 32, 28, 24, 20, 16, 12, 8, 4,
- 0, 4, 8, 12, 16, 20, 24, 28, 28, 32, 36, 40, 44, 48, 52, 56, 56, 52, 48, 44, 40, 36, 32, 28, 28, 24, 20, 16, 12, 8, 4, 0,
- 0, 4, 8, 8, 12, 12, 16, 20, 20, 24, 28, 28, 32, 32, 36, 40, 40, 36, 32, 32, 28, 28, 24, 20, 20, 16, 12, 12, 8, 8, 4, 0,
- 0, 4, 4, 4, 8, 8, 8, 12, 12, 16, 16, 16, 20, 20, 20, 24, 24, 20, 20, 20, 16, 16, 16, 12, 12, 8, 8, 8, 4, 4, 4, 0,
- 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0,
- //error:0.000020
-};
-static const uint8_t obmc16[256]={
- 0, 4, 4, 8, 8, 12, 12, 16, 16, 12, 12, 8, 8, 4, 4, 0,
- 4, 8, 16, 20, 28, 32, 40, 44, 44, 40, 32, 28, 20, 16, 8, 4,
- 4, 16, 24, 36, 44, 56, 64, 76, 76, 64, 56, 44, 36, 24, 16, 4,
- 8, 20, 36, 48, 64, 76, 92,104,104, 92, 76, 64, 48, 36, 20, 8,
- 8, 28, 44, 64, 80,100,116,136,136,116,100, 80, 64, 44, 28, 8,
- 12, 32, 56, 76,100,120,144,164,164,144,120,100, 76, 56, 32, 12,
- 12, 40, 64, 92,116,144,168,196,196,168,144,116, 92, 64, 40, 12,
- 16, 44, 76,104,136,164,196,224,224,196,164,136,104, 76, 44, 16,
- 16, 44, 76,104,136,164,196,224,224,196,164,136,104, 76, 44, 16,
- 12, 40, 64, 92,116,144,168,196,196,168,144,116, 92, 64, 40, 12,
- 12, 32, 56, 76,100,120,144,164,164,144,120,100, 76, 56, 32, 12,
- 8, 28, 44, 64, 80,100,116,136,136,116,100, 80, 64, 44, 28, 8,
- 8, 20, 36, 48, 64, 76, 92,104,104, 92, 76, 64, 48, 36, 20, 8,
- 4, 16, 24, 36, 44, 56, 64, 76, 76, 64, 56, 44, 36, 24, 16, 4,
- 4, 8, 16, 20, 28, 32, 40, 44, 44, 40, 32, 28, 20, 16, 8, 4,
- 0, 4, 4, 8, 8, 12, 12, 16, 16, 12, 12, 8, 8, 4, 4, 0,
-//error:0.000015
-};
-#else //64*cos
-static const uint8_t obmc32[1024]={
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0,
- 0, 0, 1, 1, 1, 2, 2, 3, 4, 5, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 6, 5, 5, 4, 3, 2, 2, 1, 1, 1, 0, 0,
- 0, 0, 1, 1, 2, 3, 4, 5, 6, 7, 9,10,11,11,12,12,12,12,11,11,10, 9, 7, 6, 5, 4, 3, 2, 1, 1, 0, 0,
- 0, 0, 1, 2, 3, 5, 6, 8, 9,11,12,14,15,16,17,17,17,17,16,15,14,12,11, 9, 8, 6, 5, 3, 2, 1, 0, 0,
- 0, 1, 1, 2, 4, 6, 8,10,12,15,17,19,20,21,22,23,23,22,21,20,19,17,15,12,10, 8, 6, 4, 2, 1, 1, 0,
- 0, 1, 2, 3, 5, 8,10,13,16,19,21,24,26,27,28,29,29,28,27,26,24,21,19,16,13,10, 8, 5, 3, 2, 1, 0,
- 0, 1, 2, 4, 6, 9,12,16,19,23,26,29,31,33,34,35,35,34,33,31,29,26,23,19,16,12, 9, 6, 4, 2, 1, 0,
- 0, 1, 3, 5, 7,11,15,19,23,26,30,34,37,39,40,41,41,40,39,37,34,30,26,23,19,15,11, 7, 5, 3, 1, 0,
- 0, 1, 3, 5, 9,12,17,21,26,30,35,38,42,44,46,47,47,46,44,42,38,35,30,26,21,17,12, 9, 5, 3, 1, 0,
- 0, 1, 3, 6, 9,14,19,24,29,34,38,43,46,49,51,52,52,51,49,46,43,38,34,29,24,19,14, 9, 6, 3, 1, 0,
- 0, 1, 3, 6,11,15,20,26,31,37,42,46,50,53,56,57,57,56,53,50,46,42,37,31,26,20,15,11, 6, 3, 1, 0,
- 0, 1, 3, 7,11,16,21,27,33,39,44,49,53,57,59,60,60,59,57,53,49,44,39,33,27,21,16,11, 7, 3, 1, 0,
- 0, 1, 4, 7,12,17,22,28,34,40,46,51,56,59,61,63,63,61,59,56,51,46,40,34,28,22,17,12, 7, 4, 1, 0,
- 0, 1, 4, 7,12,17,23,29,35,41,47,52,57,60,63,64,64,63,60,57,52,47,41,35,29,23,17,12, 7, 4, 1, 0,
- 0, 1, 4, 7,12,17,23,29,35,41,47,52,57,60,63,64,64,63,60,57,52,47,41,35,29,23,17,12, 7, 4, 1, 0,
- 0, 1, 4, 7,12,17,22,28,34,40,46,51,56,59,61,63,63,61,59,56,51,46,40,34,28,22,17,12, 7, 4, 1, 0,
- 0, 1, 3, 7,11,16,21,27,33,39,44,49,53,57,59,60,60,59,57,53,49,44,39,33,27,21,16,11, 7, 3, 1, 0,
- 0, 1, 3, 6,11,15,20,26,31,37,42,46,50,53,56,57,57,56,53,50,46,42,37,31,26,20,15,11, 6, 3, 1, 0,
- 0, 1, 3, 6, 9,14,19,24,29,34,38,43,46,49,51,52,52,51,49,46,43,38,34,29,24,19,14, 9, 6, 3, 1, 0,
- 0, 1, 3, 5, 9,12,17,21,26,30,35,38,42,44,46,47,47,46,44,42,38,35,30,26,21,17,12, 9, 5, 3, 1, 0,
- 0, 1, 3, 5, 7,11,15,19,23,26,30,34,37,39,40,41,41,40,39,37,34,30,26,23,19,15,11, 7, 5, 3, 1, 0,
- 0, 1, 2, 4, 6, 9,12,16,19,23,26,29,31,33,34,35,35,34,33,31,29,26,23,19,16,12, 9, 6, 4, 2, 1, 0,
- 0, 1, 2, 3, 5, 8,10,13,16,19,21,24,26,27,28,29,29,28,27,26,24,21,19,16,13,10, 8, 5, 3, 2, 1, 0,
- 0, 1, 1, 2, 4, 6, 8,10,12,15,17,19,20,21,22,23,23,22,21,20,19,17,15,12,10, 8, 6, 4, 2, 1, 1, 0,
- 0, 0, 1, 2, 3, 5, 6, 8, 9,11,12,14,15,16,17,17,17,17,16,15,14,12,11, 9, 8, 6, 5, 3, 2, 1, 0, 0,
- 0, 0, 1, 1, 2, 3, 4, 5, 6, 7, 9,10,11,11,12,12,12,12,11,11,10, 9, 7, 6, 5, 4, 3, 2, 1, 1, 0, 0,
- 0, 0, 1, 1, 1, 2, 2, 3, 4, 5, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 6, 5, 5, 4, 3, 2, 2, 1, 1, 1, 0, 0,
- 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-//error:0.000022
-};
-static const uint8_t obmc16[256]={
- 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
- 0, 0, 1, 2, 3, 4, 5, 5, 5, 5, 4, 3, 2, 1, 0, 0,
- 0, 1, 3, 6, 8,11,13,14,14,13,11, 8, 6, 3, 1, 0,
- 0, 2, 6,10,15,20,24,26,26,24,20,15,10, 6, 2, 0,
- 0, 3, 8,16,23,30,35,38,38,35,30,23,16, 8, 3, 0,
- 1, 4,11,20,30,39,46,49,49,46,39,30,20,11, 4, 1,
- 1, 5,13,24,35,46,54,58,58,54,46,35,24,13, 5, 1,
- 0, 5,14,26,38,49,58,63,63,58,49,38,26,14, 5, 0,
- 0, 5,14,26,38,49,58,63,63,58,49,38,26,14, 5, 0,
- 1, 5,13,24,35,46,54,58,58,54,46,35,24,13, 5, 1,
- 1, 4,11,20,30,39,46,49,49,46,39,30,20,11, 4, 1,
- 0, 3, 8,16,23,30,35,38,38,35,30,23,16, 8, 3, 0,
- 0, 2, 6,10,15,20,24,26,26,24,20,15,10, 6, 2, 0,
- 0, 1, 3, 6, 8,11,13,14,14,13,11, 8, 6, 3, 1, 0,
- 0, 0, 1, 2, 3, 4, 5, 5, 5, 5, 4, 3, 2, 1, 0, 0,
- 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
-//error:0.000022
-};
-#endif
-
-//linear *64
-static const uint8_t obmc8[64]={
- 4, 12, 20, 28, 28, 20, 12, 4,
- 12, 36, 60, 84, 84, 60, 36, 12,
- 20, 60,100,140,140,100, 60, 20,
- 28, 84,140,196,196,140, 84, 28,
- 28, 84,140,196,196,140, 84, 28,
- 20, 60,100,140,140,100, 60, 20,
- 12, 36, 60, 84, 84, 60, 36, 12,
- 4, 12, 20, 28, 28, 20, 12, 4,
-//error:0.000000
-};
-
-//linear *64
-static const uint8_t obmc4[16]={
- 16, 48, 48, 16,
- 48,144,144, 48,
- 48,144,144, 48,
- 16, 48, 48, 16,
-//error:0.000000
-};
-
-static const uint8_t *obmc_tab[4]={
- obmc32, obmc16, obmc8, obmc4
-};
-
-static int scale_mv_ref[MAX_REF_FRAMES][MAX_REF_FRAMES];
-
-typedef struct BlockNode{
- int16_t mx;
- int16_t my;
- uint8_t ref;
- uint8_t color[3];
- uint8_t type;
-//#define TYPE_SPLIT 1
-#define BLOCK_INTRA 1
-#define BLOCK_OPT 2
-//#define TYPE_NOCOLOR 4
- uint8_t level; //FIXME merge into type?
-}BlockNode;
-
-static const BlockNode null_block= { //FIXME add border maybe
- .color= {128,128,128},
- .mx= 0,
- .my= 0,
- .ref= 0,
- .type= 0,
- .level= 0,
-};
-
-#define LOG2_MB_SIZE 4
-#define MB_SIZE (1<<LOG2_MB_SIZE)
-
-typedef struct x_and_coeff{
- int16_t x;
- uint16_t coeff;
-} x_and_coeff;
-
-typedef struct SubBand{
- int level;
- int stride;
- int width;
- int height;
- int qlog; ///< log(qscale)/log[2^(1/6)]
- DWTELEM *buf;
- int buf_x_offset;
- int buf_y_offset;
- int stride_line; ///< Stride measured in lines, not pixels.
- x_and_coeff * x_coeff;
- struct SubBand *parent;
- uint8_t state[/*7*2*/ 7 + 512][32];
-}SubBand;
-
-typedef struct Plane{
- int width;
- int height;
- SubBand band[MAX_DECOMPOSITIONS][4];
-}Plane;
-
-typedef struct SnowContext{
-// MpegEncContext m; // needed for motion estimation, should not be used for anything else, the idea is to make the motion estimation eventually independant of MpegEncContext, so this will be removed then (FIXME/XXX)
-
- AVCodecContext *avctx;
- RangeCoder c;
- DSPContext dsp;
- AVFrame new_picture;
- AVFrame input_picture; ///< new_picture with the internal linesizes
- AVFrame current_picture;
- AVFrame last_picture[MAX_REF_FRAMES];
- AVFrame mconly_picture;
-// uint8_t q_context[16];
- uint8_t header_state[32];
- uint8_t block_state[128 + 32*128];
- int keyframe;
- int always_reset;
- int version;
- int spatial_decomposition_type;
- int last_spatial_decomposition_type;
- int temporal_decomposition_type;
- int spatial_decomposition_count;
- int temporal_decomposition_count;
- int max_ref_frames;
- int ref_frames;
- int16_t (*ref_mvs[MAX_REF_FRAMES])[2];
- uint32_t *ref_scores[MAX_REF_FRAMES];
- DWTELEM *spatial_dwt_buffer;
- int colorspace_type;
- int chroma_h_shift;
- int chroma_v_shift;
- int spatial_scalability;
- int qlog;
- int last_qlog;
- int lambda;
- int lambda2;
- int pass1_rc;
- int mv_scale;
- int last_mv_scale;
- int qbias;
- int last_qbias;
-#define QBIAS_SHIFT 3
- int b_width;
- int b_height;
- int block_max_depth;
- int last_block_max_depth;
- Plane plane[MAX_PLANES];
- BlockNode *block;
-#define ME_CACHE_SIZE 1024
- int me_cache[ME_CACHE_SIZE];
- int me_cache_generation;
- slice_buffer sb;
-
- MpegEncContext m; // needed for motion estimation, should not be used for anything else, the idea is to make the motion estimation eventually independant of MpegEncContext, so this will be removed then (FIXME/XXX)
-}SnowContext;
-
-typedef struct {
- DWTELEM *b0;
- DWTELEM *b1;
- DWTELEM *b2;
- DWTELEM *b3;
- int y;
-} dwt_compose_t;
-
-#define slice_buffer_get_line(slice_buf, line_num) ((slice_buf)->line[line_num] ? (slice_buf)->line[line_num] : slice_buffer_load_line((slice_buf), (line_num)))
-//#define slice_buffer_get_line(slice_buf, line_num) (slice_buffer_load_line((slice_buf), (line_num)))
-
-#ifdef CONFIG_ENCODERS
-static void iterative_me(SnowContext *s);
-#endif
-
-static void slice_buffer_init(slice_buffer * buf, int line_count, int max_allocated_lines, int line_width, DWTELEM * base_buffer)
-{
- int i;
-
- buf->base_buffer = base_buffer;
- buf->line_count = line_count;
- buf->line_width = line_width;
- buf->data_count = max_allocated_lines;
- buf->line = (DWTELEM * *) av_mallocz (sizeof(DWTELEM *) * line_count);
- buf->data_stack = (DWTELEM * *) av_malloc (sizeof(DWTELEM *) * max_allocated_lines);
-
- for (i = 0; i < max_allocated_lines; i++)
- {
- buf->data_stack[i] = (DWTELEM *) av_malloc (sizeof(DWTELEM) * line_width);
- }
-
- buf->data_stack_top = max_allocated_lines - 1;
-}
-
-static DWTELEM * slice_buffer_load_line(slice_buffer * buf, int line)
-{
- int offset;
- DWTELEM * buffer;
-
-// av_log(NULL, AV_LOG_DEBUG, "Cache hit: %d\n", line);
-
- assert(buf->data_stack_top >= 0);
-// assert(!buf->line[line]);
- if (buf->line[line])
- return buf->line[line];
-
- offset = buf->line_width * line;
- buffer = buf->data_stack[buf->data_stack_top];
- buf->data_stack_top--;
- buf->line[line] = buffer;
-
-// av_log(NULL, AV_LOG_DEBUG, "slice_buffer_load_line: line: %d remaining: %d\n", line, buf->data_stack_top + 1);
-
- return buffer;
-}
-
-static void slice_buffer_release(slice_buffer * buf, int line)
-{
- int offset;
- DWTELEM * buffer;
-
- assert(line >= 0 && line < buf->line_count);
- assert(buf->line[line]);
-
- offset = buf->line_width * line;
- buffer = buf->line[line];
- buf->data_stack_top++;
- buf->data_stack[buf->data_stack_top] = buffer;
- buf->line[line] = NULL;
-
-// av_log(NULL, AV_LOG_DEBUG, "slice_buffer_release: line: %d remaining: %d\n", line, buf->data_stack_top + 1);
-}
-
-static void slice_buffer_flush(slice_buffer * buf)
-{
- int i;
- for (i = 0; i < buf->line_count; i++)
- {
- if (buf->line[i])
- {
-// av_log(NULL, AV_LOG_DEBUG, "slice_buffer_flush: line: %d \n", i);
- slice_buffer_release(buf, i);
- }
- }
-}
-
-static void slice_buffer_destroy(slice_buffer * buf)
-{
- int i;
- slice_buffer_flush(buf);
-
- for (i = buf->data_count - 1; i >= 0; i--)
- {
- assert(buf->data_stack[i]);
- av_freep(&buf->data_stack[i]);
- }
- assert(buf->data_stack);
- av_freep(&buf->data_stack);
- assert(buf->line);
- av_freep(&buf->line);
-}
-
-#ifdef __sgi
-// Avoid a name clash on SGI IRIX
-#undef qexp
-#endif
-#define QEXPSHIFT (7-FRAC_BITS+8) //FIXME try to change this to 0
-static uint8_t qexp[QROOT];
-
-static inline int mirror(int v, int m){
- while((unsigned)v > (unsigned)m){
- v=-v;
- if(v<0) v+= 2*m;
- }
- return v;
-}
-
-static inline void put_symbol(RangeCoder *c, uint8_t *state, int v, int is_signed){
- int i;
-
- if(v){
- const int a= FFABS(v);
- const int e= av_log2(a);
-#if 1
- const int el= FFMIN(e, 10);
- put_rac(c, state+0, 0);
-
- for(i=0; i<el; i++){
- put_rac(c, state+1+i, 1); //1..10
- }
- for(; i<e; i++){
- put_rac(c, state+1+9, 1); //1..10
- }
- put_rac(c, state+1+FFMIN(i,9), 0);
-
- for(i=e-1; i>=el; i--){
- put_rac(c, state+22+9, (a>>i)&1); //22..31
- }
- for(; i>=0; i--){
- put_rac(c, state+22+i, (a>>i)&1); //22..31
- }
-
- if(is_signed)
- put_rac(c, state+11 + el, v < 0); //11..21
-#else
-
- put_rac(c, state+0, 0);
- if(e<=9){
- for(i=0; i<e; i++){
- put_rac(c, state+1+i, 1); //1..10
- }
- put_rac(c, state+1+i, 0);
-
- for(i=e-1; i>=0; i--){
- put_rac(c, state+22+i, (a>>i)&1); //22..31
- }
-
- if(is_signed)
- put_rac(c, state+11 + e, v < 0); //11..21
- }else{
- for(i=0; i<e; i++){
- put_rac(c, state+1+FFMIN(i,9), 1); //1..10
- }
- put_rac(c, state+1+FFMIN(i,9), 0);
-
- for(i=e-1; i>=0; i--){
- put_rac(c, state+22+FFMIN(i,9), (a>>i)&1); //22..31
- }
-
- if(is_signed)
- put_rac(c, state+11 + FFMIN(e,10), v < 0); //11..21
- }
-#endif
- }else{
- put_rac(c, state+0, 1);
- }
-}
-
-static inline int get_symbol(RangeCoder *c, uint8_t *state, int is_signed){
- if(get_rac(c, state+0))
- return 0;
- else{
- int i, e, a;
- e= 0;
- while(get_rac(c, state+1 + FFMIN(e,9))){ //1..10
- e++;
- }
-
- a= 1;
- for(i=e-1; i>=0; i--){
- a += a + get_rac(c, state+22 + FFMIN(i,9)); //22..31
- }
-
- if(is_signed && get_rac(c, state+11 + FFMIN(e,10))) //11..21
- return -a;
- else
- return a;
- }
-}
-
-static inline void put_symbol2(RangeCoder *c, uint8_t *state, int v, int log2){
- int i;
- int r= log2>=0 ? 1<<log2 : 1;
-
- assert(v>=0);
- assert(log2>=-4);
-
- while(v >= r){
- put_rac(c, state+4+log2, 1);
- v -= r;
- log2++;
- if(log2>0) r+=r;
- }
- put_rac(c, state+4+log2, 0);
-
- for(i=log2-1; i>=0; i--){
- put_rac(c, state+31-i, (v>>i)&1);
- }
-}
-
-static inline int get_symbol2(RangeCoder *c, uint8_t *state, int log2){
- int i;
- int r= log2>=0 ? 1<<log2 : 1;
- int v=0;
-
- assert(log2>=-4);
-
- while(get_rac(c, state+4+log2)){
- v+= r;
- log2++;
- if(log2>0) r+=r;
- }
-
- for(i=log2-1; i>=0; i--){
- v+= get_rac(c, state+31-i)<<i;
- }
-
- return v;
-}
-
-static av_always_inline void lift(DWTELEM *dst, DWTELEM *src, DWTELEM *ref, int dst_step, int src_step, int ref_step, int width, int mul, int add, int shift, int highpass, int inverse){
- const int mirror_left= !highpass;
- const int mirror_right= (width&1) ^ highpass;
- const int w= (width>>1) - 1 + (highpass & width);
- int i;
-
-#define LIFT(src, ref, inv) ((src) + ((inv) ? - (ref) : + (ref)))
- if(mirror_left){
- dst[0] = LIFT(src[0], ((mul*2*ref[0]+add)>>shift), inverse);
- dst += dst_step;
- src += src_step;
- }
-
- for(i=0; i<w; i++){
- dst[i*dst_step] = LIFT(src[i*src_step], ((mul*(ref[i*ref_step] + ref[(i+1)*ref_step])+add)>>shift), inverse);
- }
-
- if(mirror_right){
- dst[w*dst_step] = LIFT(src[w*src_step], ((mul*2*ref[w*ref_step]+add)>>shift), inverse);
- }
-}
-
-#ifndef lift5
-static av_always_inline void lift5(DWTELEM *dst, DWTELEM *src, DWTELEM *ref, int dst_step, int src_step, int ref_step, int width, int mul, int add, int shift, int highpass, int inverse){
- const int mirror_left= !highpass;
- const int mirror_right= (width&1) ^ highpass;
- const int w= (width>>1) - 1 + (highpass & width);
- int i;
-
- if(mirror_left){
- int r= 3*2*ref[0];
- r += r>>4;
- r += r>>8;
- dst[0] = LIFT(src[0], ((r+add)>>shift), inverse);
- dst += dst_step;
- src += src_step;
- }
-
- for(i=0; i<w; i++){
- int r= 3*(ref[i*ref_step] + ref[(i+1)*ref_step]);
- r += r>>4;
- r += r>>8;
- dst[i*dst_step] = LIFT(src[i*src_step], ((r+add)>>shift), inverse);
- }
-
- if(mirror_right){
- int r= 3*2*ref[w*ref_step];
- r += r>>4;
- r += r>>8;
- dst[w*dst_step] = LIFT(src[w*src_step], ((r+add)>>shift), inverse);
- }
-}
-#endif
-
-#ifndef liftS
-static av_always_inline void liftS(DWTELEM *dst, DWTELEM *src, DWTELEM *ref, int dst_step, int src_step, int ref_step, int width, int mul, int add, int shift, int highpass, int inverse){
- const int mirror_left= !highpass;
- const int mirror_right= (width&1) ^ highpass;
- const int w= (width>>1) - 1 + (highpass & width);
- int i;
-
- assert(shift == 4);
-#define LIFTS(src, ref, inv) ((inv) ? (src) - (((ref) - 4*(src))>>shift): (16*4*(src) + 4*(ref) + 8 + (5<<27))/(5*16) - (1<<23))
- if(mirror_left){
- dst[0] = LIFTS(src[0], mul*2*ref[0]+add, inverse);
- dst += dst_step;
- src += src_step;
- }
-
- for(i=0; i<w; i++){
- dst[i*dst_step] = LIFTS(src[i*src_step], mul*(ref[i*ref_step] + ref[(i+1)*ref_step])+add, inverse);
- }
-
- if(mirror_right){
- dst[w*dst_step] = LIFTS(src[w*src_step], mul*2*ref[w*ref_step]+add, inverse);
- }
-}
-#endif
-
-
-static void inplace_lift(DWTELEM *dst, int width, int *coeffs, int n, int shift, int start, int inverse){
- int x, i;
-
- for(x=start; x<width; x+=2){
- int64_t sum=0;
-
- for(i=0; i<n; i++){
- int x2= x + 2*i - n + 1;
- if (x2< 0) x2= -x2;
- else if(x2>=width) x2= 2*width-x2-2;
- sum += coeffs[i]*(int64_t)dst[x2];
- }
- if(inverse) dst[x] -= (sum + (1<<shift)/2)>>shift;
- else dst[x] += (sum + (1<<shift)/2)>>shift;
- }
-}
-
-static void inplace_liftV(DWTELEM *dst, int width, int height, int stride, int *coeffs, int n, int shift, int start, int inverse){
- int x, y, i;
- for(y=start; y<height; y+=2){
- for(x=0; x<width; x++){
- int64_t sum=0;
-
- for(i=0; i<n; i++){
- int y2= y + 2*i - n + 1;
- if (y2< 0) y2= -y2;
- else if(y2>=height) y2= 2*height-y2-2;
- sum += coeffs[i]*(int64_t)dst[x + y2*stride];
- }
- if(inverse) dst[x + y*stride] -= (sum + (1<<shift)/2)>>shift;
- else dst[x + y*stride] += (sum + (1<<shift)/2)>>shift;
- }
- }
-}
-
-#define SCALEX 1
-#define LX0 0
-#define LX1 1
-
-#if 0 // more accurate 9/7
-#define N1 2
-#define SHIFT1 14
-#define COEFFS1 (int[]){-25987,-25987}
-#define N2 2
-#define SHIFT2 19
-#define COEFFS2 (int[]){-27777,-27777}
-#define N3 2
-#define SHIFT3 15
-#define COEFFS3 (int[]){28931,28931}
-#define N4 2
-#define SHIFT4 15
-#define COEFFS4 (int[]){14533,14533}
-#elif 1 // 13/7 CRF
-#define N1 4
-#define SHIFT1 4
-#define COEFFS1 (int[]){1,-9,-9,1}
-#define N2 4
-#define SHIFT2 4
-#define COEFFS2 (int[]){-1,5,5,-1}
-#define N3 0
-#define SHIFT3 1
-#define COEFFS3 NULL
-#define N4 0
-#define SHIFT4 1
-#define COEFFS4 NULL
-#elif 1 // 3/5
-#define LX0 1
-#define LX1 0
-#define SCALEX 0.5
-#define N1 2
-#define SHIFT1 1
-#define COEFFS1 (int[]){1,1}
-#define N2 2
-#define SHIFT2 2
-#define COEFFS2 (int[]){-1,-1}
-#define N3 0
-#define SHIFT3 0
-#define COEFFS3 NULL
-#define N4 0
-#define SHIFT4 0
-#define COEFFS4 NULL
-#elif 1 // 11/5
-#define N1 0
-#define SHIFT1 1
-#define COEFFS1 NULL
-#define N2 2
-#define SHIFT2 2
-#define COEFFS2 (int[]){-1,-1}
-#define N3 2
-#define SHIFT3 0
-#define COEFFS3 (int[]){-1,-1}
-#define N4 4
-#define SHIFT4 7
-#define COEFFS4 (int[]){-5,29,29,-5}
-#define SCALEX 4
-#elif 1 // 9/7 CDF
-#define N1 2
-#define SHIFT1 7
-#define COEFFS1 (int[]){-203,-203}
-#define N2 2
-#define SHIFT2 12
-#define COEFFS2 (int[]){-217,-217}
-#define N3 2
-#define SHIFT3 7
-#define COEFFS3 (int[]){113,113}
-#define N4 2
-#define SHIFT4 9
-#define COEFFS4 (int[]){227,227}
-#define SCALEX 1
-#elif 1 // 7/5 CDF
-#define N1 0
-#define SHIFT1 1
-#define COEFFS1 NULL
-#define N2 2
-#define SHIFT2 2
-#define COEFFS2 (int[]){-1,-1}
-#define N3 2
-#define SHIFT3 0
-#define COEFFS3 (int[]){-1,-1}
-#define N4 2
-#define SHIFT4 4
-#define COEFFS4 (int[]){3,3}
-#elif 1 // 9/7 MN
-#define N1 4
-#define SHIFT1 4
-#define COEFFS1 (int[]){1,-9,-9,1}
-#define N2 2
-#define SHIFT2 2
-#define COEFFS2 (int[]){1,1}
-#define N3 0
-#define SHIFT3 1
-#define COEFFS3 NULL
-#define N4 0
-#define SHIFT4 1
-#define COEFFS4 NULL
-#else // 13/7 CRF
-#define N1 4
-#define SHIFT1 4
-#define COEFFS1 (int[]){1,-9,-9,1}
-#define N2 4
-#define SHIFT2 4
-#define COEFFS2 (int[]){-1,5,5,-1}
-#define N3 0
-#define SHIFT3 1
-#define COEFFS3 NULL
-#define N4 0
-#define SHIFT4 1
-#define COEFFS4 NULL
-#endif
-static void horizontal_decomposeX(DWTELEM *b, int width){
- DWTELEM temp[width];
- const int width2= width>>1;
- const int w2= (width+1)>>1;
- int x;
-
- inplace_lift(b, width, COEFFS1, N1, SHIFT1, LX1, 0);
- inplace_lift(b, width, COEFFS2, N2, SHIFT2, LX0, 0);
- inplace_lift(b, width, COEFFS3, N3, SHIFT3, LX1, 0);
- inplace_lift(b, width, COEFFS4, N4, SHIFT4, LX0, 0);
-
- for(x=0; x<width2; x++){
- temp[x ]= b[2*x ];
- temp[x+w2]= b[2*x + 1];
- }
- if(width&1)
- temp[x ]= b[2*x ];
- memcpy(b, temp, width*sizeof(int));
-}
-
-static void horizontal_composeX(DWTELEM *b, int width){
- DWTELEM temp[width];
- const int width2= width>>1;
- int x;
- const int w2= (width+1)>>1;
-
- memcpy(temp, b, width*sizeof(int));
- for(x=0; x<width2; x++){
- b[2*x ]= temp[x ];
- b[2*x + 1]= temp[x+w2];
- }
- if(width&1)
- b[2*x ]= temp[x ];
-
- inplace_lift(b, width, COEFFS4, N4, SHIFT4, LX0, 1);
- inplace_lift(b, width, COEFFS3, N3, SHIFT3, LX1, 1);
- inplace_lift(b, width, COEFFS2, N2, SHIFT2, LX0, 1);
- inplace_lift(b, width, COEFFS1, N1, SHIFT1, LX1, 1);
-}
-
-static void spatial_decomposeX(DWTELEM *buffer, int width, int height, int stride){
- int x, y;
-
- for(y=0; y<height; y++){
- for(x=0; x<width; x++){
- buffer[y*stride + x] *= SCALEX;
- }
- }
-
- for(y=0; y<height; y++){
- horizontal_decomposeX(buffer + y*stride, width);
- }
-
- inplace_liftV(buffer, width, height, stride, COEFFS1, N1, SHIFT1, LX1, 0);
- inplace_liftV(buffer, width, height, stride, COEFFS2, N2, SHIFT2, LX0, 0);
- inplace_liftV(buffer, width, height, stride, COEFFS3, N3, SHIFT3, LX1, 0);
- inplace_liftV(buffer, width, height, stride, COEFFS4, N4, SHIFT4, LX0, 0);
-}
-
-static void spatial_composeX(DWTELEM *buffer, int width, int height, int stride){
- int x, y;
-
- inplace_liftV(buffer, width, height, stride, COEFFS4, N4, SHIFT4, LX0, 1);
- inplace_liftV(buffer, width, height, stride, COEFFS3, N3, SHIFT3, LX1, 1);
- inplace_liftV(buffer, width, height, stride, COEFFS2, N2, SHIFT2, LX0, 1);
- inplace_liftV(buffer, width, height, stride, COEFFS1, N1, SHIFT1, LX1, 1);
-
- for(y=0; y<height; y++){
- horizontal_composeX(buffer + y*stride, width);
- }
-
- for(y=0; y<height; y++){
- for(x=0; x<width; x++){
- buffer[y*stride + x] /= SCALEX;
- }
- }
-}
-
-static void horizontal_decompose53i(DWTELEM *b, int width){
- DWTELEM temp[width];
- const int width2= width>>1;
- int x;
- const int w2= (width+1)>>1;
-
- for(x=0; x<width2; x++){
- temp[x ]= b[2*x ];
- temp[x+w2]= b[2*x + 1];
- }
- if(width&1)
- temp[x ]= b[2*x ];
-#if 0
- {
- int A1,A2,A3,A4;
- A2= temp[1 ];
- A4= temp[0 ];
- A1= temp[0+width2];
- A1 -= (A2 + A4)>>1;
- A4 += (A1 + 1)>>1;
- b[0+width2] = A1;
- b[0 ] = A4;
- for(x=1; x+1<width2; x+=2){
- A3= temp[x+width2];
- A4= temp[x+1 ];
- A3 -= (A2 + A4)>>1;
- A2 += (A1 + A3 + 2)>>2;
- b[x+width2] = A3;
- b[x ] = A2;
-
- A1= temp[x+1+width2];
- A2= temp[x+2 ];
- A1 -= (A2 + A4)>>1;
- A4 += (A1 + A3 + 2)>>2;
- b[x+1+width2] = A1;
- b[x+1 ] = A4;
- }
- A3= temp[width-1];
- A3 -= A2;
- A2 += (A1 + A3 + 2)>>2;
- b[width -1] = A3;
- b[width2-1] = A2;
- }
-#else
- lift(b+w2, temp+w2, temp, 1, 1, 1, width, -1, 0, 1, 1, 0);
- lift(b , temp , b+w2, 1, 1, 1, width, 1, 2, 2, 0, 0);
-#endif
-}
-
-static void vertical_decompose53iH0(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width){
- int i;
-
- for(i=0; i<width; i++){
- b1[i] -= (b0[i] + b2[i])>>1;
- }
-}
-
-static void vertical_decompose53iL0(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width){
- int i;
-
- for(i=0; i<width; i++){
- b1[i] += (b0[i] + b2[i] + 2)>>2;
- }
-}
-
-static void spatial_decompose53i(DWTELEM *buffer, int width, int height, int stride){
- int y;
- DWTELEM *b0= buffer + mirror(-2-1, height-1)*stride;
- DWTELEM *b1= buffer + mirror(-2 , height-1)*stride;
-
- for(y=-2; y<height; y+=2){
- DWTELEM *b2= buffer + mirror(y+1, height-1)*stride;
- DWTELEM *b3= buffer + mirror(y+2, height-1)*stride;
-
-{START_TIMER
- if(y+1<(unsigned)height) horizontal_decompose53i(b2, width);
- if(y+2<(unsigned)height) horizontal_decompose53i(b3, width);
-STOP_TIMER("horizontal_decompose53i")}
-
-{START_TIMER
- if(y+1<(unsigned)height) vertical_decompose53iH0(b1, b2, b3, width);
- if(y+0<(unsigned)height) vertical_decompose53iL0(b0, b1, b2, width);
-STOP_TIMER("vertical_decompose53i*")}
-
- b0=b2;
- b1=b3;
- }
-}
-
-static void horizontal_decompose97i(DWTELEM *b, int width){
- DWTELEM temp[width];
- const int w2= (width+1)>>1;
-
- lift (temp+w2, b +1, b , 1, 2, 2, width, -W_AM, W_AO, W_AS, 1, 0);
- liftS(temp , b , temp+w2, 1, 2, 1, width, -W_BM, W_BO, W_BS, 0, 0);
- lift5(b +w2, temp+w2, temp , 1, 1, 1, width, W_CM, W_CO, W_CS, 1, 0);
- lift (b , temp , b +w2, 1, 1, 1, width, W_DM, W_DO, W_DS, 0, 0);
-}
-
-
-static void vertical_decompose97iH0(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width){
- int i;
-
- for(i=0; i<width; i++){
- b1[i] -= (W_AM*(b0[i] + b2[i])+W_AO)>>W_AS;
- }
-}
-
-static void vertical_decompose97iH1(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width){
- int i;
-
- for(i=0; i<width; i++){
-#ifdef lift5
- b1[i] += (W_CM*(b0[i] + b2[i])+W_CO)>>W_CS;
-#else
- int r= 3*(b0[i] + b2[i]);
- r+= r>>4;
- r+= r>>8;
- b1[i] += (r+W_CO)>>W_CS;
-#endif
- }
-}
-
-static void vertical_decompose97iL0(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width){
- int i;
-
- for(i=0; i<width; i++){
-#ifdef liftS
- b1[i] -= (W_BM*(b0[i] + b2[i])+W_BO)>>W_BS;
-#else
- b1[i] = (16*4*b1[i] - 4*(b0[i] + b2[i]) + 8*5 + (5<<27)) / (5*16) - (1<<23);
-#endif
- }
-}
-
-static void vertical_decompose97iL1(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width){
- int i;
-
- for(i=0; i<width; i++){
- b1[i] += (W_DM*(b0[i] + b2[i])+W_DO)>>W_DS;
- }
-}
-
-static void spatial_decompose97i(DWTELEM *buffer, int width, int height, int stride){
- int y;
- DWTELEM *b0= buffer + mirror(-4-1, height-1)*stride;
- DWTELEM *b1= buffer + mirror(-4 , height-1)*stride;
- DWTELEM *b2= buffer + mirror(-4+1, height-1)*stride;
- DWTELEM *b3= buffer + mirror(-4+2, height-1)*stride;
-
- for(y=-4; y<height; y+=2){
- DWTELEM *b4= buffer + mirror(y+3, height-1)*stride;
- DWTELEM *b5= buffer + mirror(y+4, height-1)*stride;
-
-{START_TIMER
- if(y+3<(unsigned)height) horizontal_decompose97i(b4, width);
- if(y+4<(unsigned)height) horizontal_decompose97i(b5, width);
-if(width>400){
-STOP_TIMER("horizontal_decompose97i")
-}}
-
-{START_TIMER
- if(y+3<(unsigned)height) vertical_decompose97iH0(b3, b4, b5, width);
- if(y+2<(unsigned)height) vertical_decompose97iL0(b2, b3, b4, width);
- if(y+1<(unsigned)height) vertical_decompose97iH1(b1, b2, b3, width);
- if(y+0<(unsigned)height) vertical_decompose97iL1(b0, b1, b2, width);
-
-if(width>400){
-STOP_TIMER("vertical_decompose97i")
-}}
-
- b0=b2;
- b1=b3;
- b2=b4;
- b3=b5;
- }
-}
-
-void ff_spatial_dwt(DWTELEM *buffer, int width, int height, int stride, int type, int decomposition_count){
- int level;
-
- for(level=0; level<decomposition_count; level++){
- switch(type){
- case DWT_97: spatial_decompose97i(buffer, width>>level, height>>level, stride<<level); break;
- case DWT_53: spatial_decompose53i(buffer, width>>level, height>>level, stride<<level); break;
- case DWT_X: spatial_decomposeX (buffer, width>>level, height>>level, stride<<level); break;
- }
- }
-}
-
-static void horizontal_compose53i(DWTELEM *b, int width){
- DWTELEM temp[width];
- const int width2= width>>1;
- const int w2= (width+1)>>1;
- int x;
-
-#if 0
- int A1,A2,A3,A4;
- A2= temp[1 ];
- A4= temp[0 ];
- A1= temp[0+width2];
- A1 -= (A2 + A4)>>1;
- A4 += (A1 + 1)>>1;
- b[0+width2] = A1;
- b[0 ] = A4;
- for(x=1; x+1<width2; x+=2){
- A3= temp[x+width2];
- A4= temp[x+1 ];
- A3 -= (A2 + A4)>>1;
- A2 += (A1 + A3 + 2)>>2;
- b[x+width2] = A3;
- b[x ] = A2;
-
- A1= temp[x+1+width2];
- A2= temp[x+2 ];
- A1 -= (A2 + A4)>>1;
- A4 += (A1 + A3 + 2)>>2;
- b[x+1+width2] = A1;
- b[x+1 ] = A4;
- }
- A3= temp[width-1];
- A3 -= A2;
- A2 += (A1 + A3 + 2)>>2;
- b[width -1] = A3;
- b[width2-1] = A2;
-#else
- lift(temp , b , b+w2, 1, 1, 1, width, 1, 2, 2, 0, 1);
- lift(temp+w2, b+w2, temp, 1, 1, 1, width, -1, 0, 1, 1, 1);
-#endif
- for(x=0; x<width2; x++){
- b[2*x ]= temp[x ];
- b[2*x + 1]= temp[x+w2];
- }
- if(width&1)
- b[2*x ]= temp[x ];
-}
-
-static void vertical_compose53iH0(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width){
- int i;
-
- for(i=0; i<width; i++){
- b1[i] += (b0[i] + b2[i])>>1;
- }
-}
-
-static void vertical_compose53iL0(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width){
- int i;
-
- for(i=0; i<width; i++){
- b1[i] -= (b0[i] + b2[i] + 2)>>2;
- }
-}
-
-static void spatial_compose53i_buffered_init(dwt_compose_t *cs, slice_buffer * sb, int height, int stride_line){
- cs->b0 = slice_buffer_get_line(sb, mirror(-1-1, height-1) * stride_line);
- cs->b1 = slice_buffer_get_line(sb, mirror(-1 , height-1) * stride_line);
- cs->y = -1;
-}
-
-static void spatial_compose53i_init(dwt_compose_t *cs, DWTELEM *buffer, int height, int stride){
- cs->b0 = buffer + mirror(-1-1, height-1)*stride;
- cs->b1 = buffer + mirror(-1 , height-1)*stride;
- cs->y = -1;
-}
-
-static void spatial_compose53i_dy_buffered(dwt_compose_t *cs, slice_buffer * sb, int width, int height, int stride_line){
- int y= cs->y;
-
- DWTELEM *b0= cs->b0;
- DWTELEM *b1= cs->b1;
- DWTELEM *b2= slice_buffer_get_line(sb, mirror(y+1, height-1) * stride_line);
- DWTELEM *b3= slice_buffer_get_line(sb, mirror(y+2, height-1) * stride_line);
-
-{START_TIMER
- if(y+1<(unsigned)height) vertical_compose53iL0(b1, b2, b3, width);
- if(y+0<(unsigned)height) vertical_compose53iH0(b0, b1, b2, width);
-STOP_TIMER("vertical_compose53i*")}
-
-{START_TIMER
- if(y-1<(unsigned)height) horizontal_compose53i(b0, width);
- if(y+0<(unsigned)height) horizontal_compose53i(b1, width);
-STOP_TIMER("horizontal_compose53i")}
-
- cs->b0 = b2;
- cs->b1 = b3;
- cs->y += 2;
-}
-
-static void spatial_compose53i_dy(dwt_compose_t *cs, DWTELEM *buffer, int width, int height, int stride){
- int y= cs->y;
- DWTELEM *b0= cs->b0;
- DWTELEM *b1= cs->b1;
- DWTELEM *b2= buffer + mirror(y+1, height-1)*stride;
- DWTELEM *b3= buffer + mirror(y+2, height-1)*stride;
-
-{START_TIMER
- if(y+1<(unsigned)height) vertical_compose53iL0(b1, b2, b3, width);
- if(y+0<(unsigned)height) vertical_compose53iH0(b0, b1, b2, width);
-STOP_TIMER("vertical_compose53i*")}
-
-{START_TIMER
- if(y-1<(unsigned)height) horizontal_compose53i(b0, width);
- if(y+0<(unsigned)height) horizontal_compose53i(b1, width);
-STOP_TIMER("horizontal_compose53i")}
-
- cs->b0 = b2;
- cs->b1 = b3;
- cs->y += 2;
-}
-
-static void spatial_compose53i(DWTELEM *buffer, int width, int height, int stride){
- dwt_compose_t cs;
- spatial_compose53i_init(&cs, buffer, height, stride);
- while(cs.y <= height)
- spatial_compose53i_dy(&cs, buffer, width, height, stride);
-}
-
-
-void ff_snow_horizontal_compose97i(DWTELEM *b, int width){
- DWTELEM temp[width];
- const int w2= (width+1)>>1;
-
- lift (temp , b , b +w2, 1, 1, 1, width, W_DM, W_DO, W_DS, 0, 1);
- lift5(temp+w2, b +w2, temp , 1, 1, 1, width, W_CM, W_CO, W_CS, 1, 1);
- liftS(b , temp , temp+w2, 2, 1, 1, width, -W_BM, W_BO, W_BS, 0, 1);
- lift (b+1 , temp+w2, b , 2, 1, 2, width, -W_AM, W_AO, W_AS, 1, 1);
-}
-
-static void vertical_compose97iH0(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width){
- int i;
-
- for(i=0; i<width; i++){
- b1[i] += (W_AM*(b0[i] + b2[i])+W_AO)>>W_AS;
- }
-}
-
-static void vertical_compose97iH1(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width){
- int i;
-
- for(i=0; i<width; i++){
-#ifdef lift5
- b1[i] -= (W_CM*(b0[i] + b2[i])+W_CO)>>W_CS;
-#else
- int r= 3*(b0[i] + b2[i]);
- r+= r>>4;
- r+= r>>8;
- b1[i] -= (r+W_CO)>>W_CS;
-#endif
- }
-}
-
-static void vertical_compose97iL0(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width){
- int i;
-
- for(i=0; i<width; i++){
-#ifdef liftS
- b1[i] += (W_BM*(b0[i] + b2[i])+W_BO)>>W_BS;
-#else
- b1[i] += (W_BM*(b0[i] + b2[i])+4*b1[i]+W_BO)>>W_BS;
-#endif
- }
-}
-
-static void vertical_compose97iL1(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width){
- int i;
-
- for(i=0; i<width; i++){
- b1[i] -= (W_DM*(b0[i] + b2[i])+W_DO)>>W_DS;
- }
-}
-
-void ff_snow_vertical_compose97i(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, DWTELEM *b3, DWTELEM *b4, DWTELEM *b5, int width){
- int i;
-
- for(i=0; i<width; i++){
-#ifndef lift5
- int r;
-#endif
- b4[i] -= (W_DM*(b3[i] + b5[i])+W_DO)>>W_DS;
-#ifdef lift5
- b3[i] -= (W_CM*(b2[i] + b4[i])+W_CO)>>W_CS;
-#else
- r= 3*(b2[i] + b4[i]);
- r+= r>>4;
- r+= r>>8;
- b3[i] -= (r+W_CO)>>W_CS;
-#endif
-#ifdef liftS
- b2[i] += (W_BM*(b1[i] + b3[i])+W_BO)>>W_BS;
-#else
- b2[i] += (W_BM*(b1[i] + b3[i])+4*b2[i]+W_BO)>>W_BS;
-#endif
- b1[i] += (W_AM*(b0[i] + b2[i])+W_AO)>>W_AS;
- }
-}
-
-static void spatial_compose97i_buffered_init(dwt_compose_t *cs, slice_buffer * sb, int height, int stride_line){
- cs->b0 = slice_buffer_get_line(sb, mirror(-3-1, height-1) * stride_line);
- cs->b1 = slice_buffer_get_line(sb, mirror(-3 , height-1) * stride_line);
- cs->b2 = slice_buffer_get_line(sb, mirror(-3+1, height-1) * stride_line);
- cs->b3 = slice_buffer_get_line(sb, mirror(-3+2, height-1) * stride_line);
- cs->y = -3;
-}
-
-static void spatial_compose97i_init(dwt_compose_t *cs, DWTELEM *buffer, int height, int stride){
- cs->b0 = buffer + mirror(-3-1, height-1)*stride;
- cs->b1 = buffer + mirror(-3 , height-1)*stride;
- cs->b2 = buffer + mirror(-3+1, height-1)*stride;
- cs->b3 = buffer + mirror(-3+2, height-1)*stride;
- cs->y = -3;
-}
-
-static void spatial_compose97i_dy_buffered(DSPContext *dsp, dwt_compose_t *cs, slice_buffer * sb, int width, int height, int stride_line){
- int y = cs->y;
-
- DWTELEM *b0= cs->b0;
- DWTELEM *b1= cs->b1;
- DWTELEM *b2= cs->b2;
- DWTELEM *b3= cs->b3;
- DWTELEM *b4= slice_buffer_get_line(sb, mirror(y + 3, height - 1) * stride_line);
- DWTELEM *b5= slice_buffer_get_line(sb, mirror(y + 4, height - 1) * stride_line);
-
-{START_TIMER
- if(y>0 && y+4<height){
- dsp->vertical_compose97i(b0, b1, b2, b3, b4, b5, width);
- }else{
- if(y+3<(unsigned)height) vertical_compose97iL1(b3, b4, b5, width);
- if(y+2<(unsigned)height) vertical_compose97iH1(b2, b3, b4, width);
- if(y+1<(unsigned)height) vertical_compose97iL0(b1, b2, b3, width);
- if(y+0<(unsigned)height) vertical_compose97iH0(b0, b1, b2, width);
- }
-if(width>400){
-STOP_TIMER("vertical_compose97i")}}
-
-{START_TIMER
- if(y-1<(unsigned)height) dsp->horizontal_compose97i(b0, width);
- if(y+0<(unsigned)height) dsp->horizontal_compose97i(b1, width);
-if(width>400 && y+0<(unsigned)height){
-STOP_TIMER("horizontal_compose97i")}}
-
- cs->b0=b2;
- cs->b1=b3;
- cs->b2=b4;
- cs->b3=b5;
- cs->y += 2;
-}
-
-static void spatial_compose97i_dy(dwt_compose_t *cs, DWTELEM *buffer, int width, int height, int stride){
- int y = cs->y;
- DWTELEM *b0= cs->b0;
- DWTELEM *b1= cs->b1;
- DWTELEM *b2= cs->b2;
- DWTELEM *b3= cs->b3;
- DWTELEM *b4= buffer + mirror(y+3, height-1)*stride;
- DWTELEM *b5= buffer + mirror(y+4, height-1)*stride;
-
-{START_TIMER
- if(y+3<(unsigned)height) vertical_compose97iL1(b3, b4, b5, width);
- if(y+2<(unsigned)height) vertical_compose97iH1(b2, b3, b4, width);
- if(y+1<(unsigned)height) vertical_compose97iL0(b1, b2, b3, width);
- if(y+0<(unsigned)height) vertical_compose97iH0(b0, b1, b2, width);
-if(width>400){
-STOP_TIMER("vertical_compose97i")}}
-
-{START_TIMER
- if(y-1<(unsigned)height) ff_snow_horizontal_compose97i(b0, width);
- if(y+0<(unsigned)height) ff_snow_horizontal_compose97i(b1, width);
-if(width>400 && b0 <= b2){
-STOP_TIMER("horizontal_compose97i")}}
-
- cs->b0=b2;
- cs->b1=b3;
- cs->b2=b4;
- cs->b3=b5;
- cs->y += 2;
-}
-
-static void spatial_compose97i(DWTELEM *buffer, int width, int height, int stride){
- dwt_compose_t cs;
- spatial_compose97i_init(&cs, buffer, height, stride);
- while(cs.y <= height)
- spatial_compose97i_dy(&cs, buffer, width, height, stride);
-}
-
-static void ff_spatial_idwt_buffered_init(dwt_compose_t *cs, slice_buffer * sb, int width, int height, int stride_line, int type, int decomposition_count){
- int level;
- for(level=decomposition_count-1; level>=0; level--){
- switch(type){
- case DWT_97: spatial_compose97i_buffered_init(cs+level, sb, height>>level, stride_line<<level); break;
- case DWT_53: spatial_compose53i_buffered_init(cs+level, sb, height>>level, stride_line<<level); break;
- /* not slicified yet */
- case DWT_X: /*spatial_composeX(buffer, width>>level, height>>level, stride<<level); break;*/
- av_log(NULL, AV_LOG_ERROR, "spatial_composeX neither buffered nor slicified yet.\n"); break;
- }
- }
-}
-
-static void ff_spatial_idwt_init(dwt_compose_t *cs, DWTELEM *buffer, int width, int height, int stride, int type, int decomposition_count){
- int level;
- for(level=decomposition_count-1; level>=0; level--){
- switch(type){
- case DWT_97: spatial_compose97i_init(cs+level, buffer, height>>level, stride<<level); break;
- case DWT_53: spatial_compose53i_init(cs+level, buffer, height>>level, stride<<level); break;
- /* not slicified yet */
- case DWT_X: spatial_composeX(buffer, width>>level, height>>level, stride<<level); break;
- }
- }
-}
-
-static void ff_spatial_idwt_slice(dwt_compose_t *cs, DWTELEM *buffer, int width, int height, int stride, int type, int decomposition_count, int y){
- const int support = type==1 ? 3 : 5;
- int level;
- if(type==2) return;
-
- for(level=decomposition_count-1; level>=0; level--){
- while(cs[level].y <= FFMIN((y>>level)+support, height>>level)){
- switch(type){
- case DWT_97: spatial_compose97i_dy(cs+level, buffer, width>>level, height>>level, stride<<level);
- break;
- case DWT_53: spatial_compose53i_dy(cs+level, buffer, width>>level, height>>level, stride<<level);
- break;
- case DWT_X: break;
- }
- }
- }
-}
-
-static void ff_spatial_idwt_buffered_slice(DSPContext *dsp, dwt_compose_t *cs, slice_buffer * slice_buf, int width, int height, int stride_line, int type, int decomposition_count, int y){
- const int support = type==1 ? 3 : 5;
- int level;
- if(type==2) return;
-
- for(level=decomposition_count-1; level>=0; level--){
- while(cs[level].y <= FFMIN((y>>level)+support, height>>level)){
- switch(type){
- case DWT_97: spatial_compose97i_dy_buffered(dsp, cs+level, slice_buf, width>>level, height>>level, stride_line<<level);
- break;
- case DWT_53: spatial_compose53i_dy_buffered(cs+level, slice_buf, width>>level, height>>level, stride_line<<level);
- break;
- case DWT_X: break;
- }
- }
- }
-}
-
-static void ff_spatial_idwt(DWTELEM *buffer, int width, int height, int stride, int type, int decomposition_count){
- if(type==2){
- int level;
- for(level=decomposition_count-1; level>=0; level--)
- spatial_composeX (buffer, width>>level, height>>level, stride<<level);
- }else{
- dwt_compose_t cs[MAX_DECOMPOSITIONS];
- int y;
- ff_spatial_idwt_init(cs, buffer, width, height, stride, type, decomposition_count);
- for(y=0; y<height; y+=4)
- ff_spatial_idwt_slice(cs, buffer, width, height, stride, type, decomposition_count, y);
- }
-}
-
-static int encode_subband_c0run(SnowContext *s, SubBand *b, DWTELEM *src, DWTELEM *parent, int stride, int orientation){
- const int w= b->width;
- const int h= b->height;
- int x, y;
-
- if(1){
- int run=0;
- int runs[w*h];
- int run_index=0;
- int max_index;
-
- for(y=0; y<h; y++){
- for(x=0; x<w; x++){
- int v, p=0;
- int /*ll=0, */l=0, lt=0, t=0, rt=0;
- v= src[x + y*stride];
-
- if(y){
- t= src[x + (y-1)*stride];
- if(x){
- lt= src[x - 1 + (y-1)*stride];
- }
- if(x + 1 < w){
- rt= src[x + 1 + (y-1)*stride];
- }
- }
- if(x){
- l= src[x - 1 + y*stride];
- /*if(x > 1){
- if(orientation==1) ll= src[y + (x-2)*stride];
- else ll= src[x - 2 + y*stride];
- }*/
- }
- if(parent){
- int px= x>>1;
- int py= y>>1;
- if(px<b->parent->width && py<b->parent->height)
- p= parent[px + py*2*stride];
- }
- if(!(/*ll|*/l|lt|t|rt|p)){
- if(v){
- runs[run_index++]= run;
- run=0;
- }else{
- run++;
- }
- }
- }
- }
- max_index= run_index;
- runs[run_index++]= run;
- run_index=0;
- run= runs[run_index++];
-
- put_symbol2(&s->c, b->state[30], max_index, 0);
- if(run_index <= max_index)
- put_symbol2(&s->c, b->state[1], run, 3);
-
- for(y=0; y<h; y++){
- if(s->c.bytestream_end - s->c.bytestream < w*40){
- av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n");
- return -1;
- }
- for(x=0; x<w; x++){
- int v, p=0;
- int /*ll=0, */l=0, lt=0, t=0, rt=0;
- v= src[x + y*stride];
-
- if(y){
- t= src[x + (y-1)*stride];
- if(x){
- lt= src[x - 1 + (y-1)*stride];
- }
- if(x + 1 < w){
- rt= src[x + 1 + (y-1)*stride];
- }
- }
- if(x){
- l= src[x - 1 + y*stride];
- /*if(x > 1){
- if(orientation==1) ll= src[y + (x-2)*stride];
- else ll= src[x - 2 + y*stride];
- }*/
- }
- if(parent){
- int px= x>>1;
- int py= y>>1;
- if(px<b->parent->width && py<b->parent->height)
- p= parent[px + py*2*stride];
- }
- if(/*ll|*/l|lt|t|rt|p){
- int context= av_log2(/*FFABS(ll) + */3*FFABS(l) + FFABS(lt) + 2*FFABS(t) + FFABS(rt) + FFABS(p));
-
- put_rac(&s->c, &b->state[0][context], !!v);
- }else{
- if(!run){
- run= runs[run_index++];
-
- if(run_index <= max_index)
- put_symbol2(&s->c, b->state[1], run, 3);
- assert(v);
- }else{
- run--;
- assert(!v);
- }
- }
- if(v){
- int context= av_log2(/*FFABS(ll) + */3*FFABS(l) + FFABS(lt) + 2*FFABS(t) + FFABS(rt) + FFABS(p));
- int l2= 2*FFABS(l) + (l<0);
- int t2= 2*FFABS(t) + (t<0);
-
- put_symbol2(&s->c, b->state[context + 2], FFABS(v)-1, context-4);
- put_rac(&s->c, &b->state[0][16 + 1 + 3 + quant3bA[l2&0xFF] + 3*quant3bA[t2&0xFF]], v<0);
- }
- }
- }
- }
- return 0;
-}
-
-static int encode_subband(SnowContext *s, SubBand *b, DWTELEM *src, DWTELEM *parent, int stride, int orientation){
-// encode_subband_qtree(s, b, src, parent, stride, orientation);
-// encode_subband_z0run(s, b, src, parent, stride, orientation);
- return encode_subband_c0run(s, b, src, parent, stride, orientation);
-// encode_subband_dzr(s, b, src, parent, stride, orientation);
-}
-
-static inline void unpack_coeffs(SnowContext *s, SubBand *b, SubBand * parent, int orientation){
- const int w= b->width;
- const int h= b->height;
- int x,y;
-
- if(1){
- int run, runs;
- x_and_coeff *xc= b->x_coeff;
- x_and_coeff *prev_xc= NULL;
- x_and_coeff *prev2_xc= xc;
- x_and_coeff *parent_xc= parent ? parent->x_coeff : NULL;
- x_and_coeff *prev_parent_xc= parent_xc;
-
- runs= get_symbol2(&s->c, b->state[30], 0);
- if(runs-- > 0) run= get_symbol2(&s->c, b->state[1], 3);
- else run= INT_MAX;
-
- for(y=0; y<h; y++){
- int v=0;
- int lt=0, t=0, rt=0;
-
- if(y && prev_xc->x == 0){
- rt= prev_xc->coeff;
- }
- for(x=0; x<w; x++){
- int p=0;
- const int l= v;
-
- lt= t; t= rt;
-
- if(y){
- if(prev_xc->x <= x)
- prev_xc++;
- if(prev_xc->x == x + 1)
- rt= prev_xc->coeff;
- else
- rt=0;
- }
- if(parent_xc){
- if(x>>1 > parent_xc->x){
- parent_xc++;
- }
- if(x>>1 == parent_xc->x){
- p= parent_xc->coeff;
- }
- }
- if(/*ll|*/l|lt|t|rt|p){
- int context= av_log2(/*FFABS(ll) + */3*(l>>1) + (lt>>1) + (t&~1) + (rt>>1) + (p>>1));
-
- v=get_rac(&s->c, &b->state[0][context]);
- if(v){
- v= 2*(get_symbol2(&s->c, b->state[context + 2], context-4) + 1);
- v+=get_rac(&s->c, &b->state[0][16 + 1 + 3 + quant3bA[l&0xFF] + 3*quant3bA[t&0xFF]]);
-
- xc->x=x;
- (xc++)->coeff= v;
- }
- }else{
- if(!run){
- if(runs-- > 0) run= get_symbol2(&s->c, b->state[1], 3);
- else run= INT_MAX;
- v= 2*(get_symbol2(&s->c, b->state[0 + 2], 0-4) + 1);
- v+=get_rac(&s->c, &b->state[0][16 + 1 + 3]);
-
- xc->x=x;
- (xc++)->coeff= v;
- }else{
- int max_run;
- run--;
- v=0;
-
- if(y) max_run= FFMIN(run, prev_xc->x - x - 2);
- else max_run= FFMIN(run, w-x-1);
- if(parent_xc)
- max_run= FFMIN(max_run, 2*parent_xc->x - x - 1);
- x+= max_run;
- run-= max_run;
- }
- }
- }
- (xc++)->x= w+1; //end marker
- prev_xc= prev2_xc;
- prev2_xc= xc;
-
- if(parent_xc){
- if(y&1){
- while(parent_xc->x != parent->width+1)
- parent_xc++;
- parent_xc++;
- prev_parent_xc= parent_xc;
- }else{
- parent_xc= prev_parent_xc;
- }
- }
- }
-
- (xc++)->x= w+1; //end marker
- }
-}
-
-static inline void decode_subband_slice_buffered(SnowContext *s, SubBand *b, slice_buffer * sb, int start_y, int h, int save_state[1]){
- const int w= b->width;
- int y;
- const int qlog= clip(s->qlog + b->qlog, 0, QROOT*16);
- int qmul= qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT);
- int qadd= (s->qbias*qmul)>>QBIAS_SHIFT;
- int new_index = 0;
-
- START_TIMER
-
- if(b->buf == s->spatial_dwt_buffer || s->qlog == LOSSLESS_QLOG){
- qadd= 0;
- qmul= 1<<QEXPSHIFT;
- }
-
- /* If we are on the second or later slice, restore our index. */
- if (start_y != 0)
- new_index = save_state[0];
-
-
- for(y=start_y; y<h; y++){
- int x = 0;
- int v;
- DWTELEM * line = slice_buffer_get_line(sb, y * b->stride_line + b->buf_y_offset) + b->buf_x_offset;
- memset(line, 0, b->width*sizeof(DWTELEM));
- v = b->x_coeff[new_index].coeff;
- x = b->x_coeff[new_index++].x;
- while(x < w)
- {
- register int t= ( (v>>1)*qmul + qadd)>>QEXPSHIFT;
- register int u= -(v&1);
- line[x] = (t^u) - u;
-
- v = b->x_coeff[new_index].coeff;
- x = b->x_coeff[new_index++].x;
- }
- }
- if(w > 200 && start_y != 0/*level+1 == s->spatial_decomposition_count*/){
- STOP_TIMER("decode_subband")
- }
-
- /* Save our variables for the next slice. */
- save_state[0] = new_index;
-
- return;
-}
-
-static void reset_contexts(SnowContext *s){ //FIXME better initial contexts
- int plane_index, level, orientation;
-
- for(plane_index=0; plane_index<3; plane_index++){
- for(level=0; level<s->spatial_decomposition_count; level++){
- for(orientation=level ? 1:0; orientation<4; orientation++){
- memset(s->plane[plane_index].band[level][orientation].state, MID_STATE, sizeof(s->plane[plane_index].band[level][orientation].state));
- }
- }
- }
- memset(s->header_state, MID_STATE, sizeof(s->header_state));
- memset(s->block_state, MID_STATE, sizeof(s->block_state));
-}
-
-static int alloc_blocks(SnowContext *s){
- int w= -((-s->avctx->width )>>LOG2_MB_SIZE);
- int h= -((-s->avctx->height)>>LOG2_MB_SIZE);
-
- s->b_width = w;
- s->b_height= h;
-
- s->block= av_mallocz(w * h * sizeof(BlockNode) << (s->block_max_depth*2));
- return 0;
-}
-
-static inline void copy_rac_state(RangeCoder *d, RangeCoder *s){
- uint8_t *bytestream= d->bytestream;
- uint8_t *bytestream_start= d->bytestream_start;
- *d= *s;
- d->bytestream= bytestream;
- d->bytestream_start= bytestream_start;
-}
-
-//near copy & paste from dsputil, FIXME
-static int pix_sum(uint8_t * pix, int line_size, int w)
-{
- int s, i, j;
-
- s = 0;
- for (i = 0; i < w; i++) {
- for (j = 0; j < w; j++) {
- s += pix[0];
- pix ++;
- }
- pix += line_size - w;
- }
- return s;
-}
-
-//near copy & paste from dsputil, FIXME
-static int pix_norm1(uint8_t * pix, int line_size, int w)
-{
- int s, i, j;
- uint32_t *sq = ff_squareTbl + 256;
-
- s = 0;
- for (i = 0; i < w; i++) {
- for (j = 0; j < w; j ++) {
- s += sq[pix[0]];
- pix ++;
- }
- pix += line_size - w;
- }
- return s;
-}
-
-static inline void set_blocks(SnowContext *s, int level, int x, int y, int l, int cb, int cr, int mx, int my, int ref, int type){
- const int w= s->b_width << s->block_max_depth;
- const int rem_depth= s->block_max_depth - level;
- const int index= (x + y*w) << rem_depth;
- const int block_w= 1<<rem_depth;
- BlockNode block;
- int i,j;
-
- block.color[0]= l;
- block.color[1]= cb;
- block.color[2]= cr;
- block.mx= mx;
- block.my= my;
- block.ref= ref;
- block.type= type;
- block.level= level;
-
- for(j=0; j<block_w; j++){
- for(i=0; i<block_w; i++){
- s->block[index + i + j*w]= block;
- }
- }
-}
-
-static inline void init_ref(MotionEstContext *c, uint8_t *src[3], uint8_t *ref[3], uint8_t *ref2[3], int x, int y, int ref_index){
- const int offset[3]= {
- y*c-> stride + x,
- ((y*c->uvstride + x)>>1),
- ((y*c->uvstride + x)>>1),
- };
- int i;
- for(i=0; i<3; i++){
- c->src[0][i]= src [i];
- c->ref[0][i]= ref [i] + offset[i];
- }
- assert(!ref_index);
-}
-
-static inline void pred_mv(SnowContext *s, int *mx, int *my, int ref,
- const BlockNode *left, const BlockNode *top, const BlockNode *tr){
- if(s->ref_frames == 1){
- *mx = mid_pred(left->mx, top->mx, tr->mx);
- *my = mid_pred(left->my, top->my, tr->my);
- }else{
- const int *scale = scale_mv_ref[ref];
- *mx = mid_pred((left->mx * scale[left->ref] + 128) >>8,
- (top ->mx * scale[top ->ref] + 128) >>8,
- (tr ->mx * scale[tr ->ref] + 128) >>8);
- *my = mid_pred((left->my * scale[left->ref] + 128) >>8,
- (top ->my * scale[top ->ref] + 128) >>8,
- (tr ->my * scale[tr ->ref] + 128) >>8);
- }
-}
-
-//FIXME copy&paste
-#define P_LEFT P[1]
-#define P_TOP P[2]
-#define P_TOPRIGHT P[3]
-#define P_MEDIAN P[4]
-#define P_MV1 P[9]
-#define FLAG_QPEL 1 //must be 1
-
-#ifdef CONFIG_ENCODERS
-static int encode_q_branch(SnowContext *s, int level, int x, int y){
- uint8_t p_buffer[1024];
- uint8_t i_buffer[1024];
- uint8_t p_state[sizeof(s->block_state)];
- uint8_t i_state[sizeof(s->block_state)];
- RangeCoder pc, ic;
- uint8_t *pbbak= s->c.bytestream;
- uint8_t *pbbak_start= s->c.bytestream_start;
- int score, score2, iscore, i_len, p_len, block_s, sum;
- const int w= s->b_width << s->block_max_depth;
- const int h= s->b_height << s->block_max_depth;
- const int rem_depth= s->block_max_depth - level;
- const int index= (x + y*w) << rem_depth;
- const int block_w= 1<<(LOG2_MB_SIZE - level);
- int trx= (x+1)<<rem_depth;
- int try= (y+1)<<rem_depth;
- const BlockNode *left = x ? &s->block[index-1] : &null_block;
- const BlockNode *top = y ? &s->block[index-w] : &null_block;
- const BlockNode *right = trx<w ? &s->block[index+1] : &null_block;
- const BlockNode *bottom= try<h ? &s->block[index+w] : &null_block;
- const BlockNode *tl = y && x ? &s->block[index-w-1] : left;
- const BlockNode *tr = y && trx<w && ((x&1)==0 || level==0) ? &s->block[index-w+(1<<rem_depth)] : tl; //FIXME use lt
- int pl = left->color[0];
- int pcb= left->color[1];
- int pcr= left->color[2];
- int pmx, pmy;
- int mx=0, my=0;
- int l,cr,cb;
- const int stride= s->current_picture.linesize[0];
- const int uvstride= s->current_picture.linesize[1];
- uint8_t *current_data[3]= { s->input_picture.data[0] + (x + y* stride)*block_w,
- s->input_picture.data[1] + (x + y*uvstride)*block_w/2,
- s->input_picture.data[2] + (x + y*uvstride)*block_w/2};
- int P[10][2];
- int16_t last_mv[3][2];
- int qpel= !!(s->avctx->flags & CODEC_FLAG_QPEL); //unused
- const int shift= 1+qpel;
- MotionEstContext *c= &s->m.me;
- int ref_context= av_log2(2*left->ref) + av_log2(2*top->ref);
- int mx_context= av_log2(2*FFABS(left->mx - top->mx));
- int my_context= av_log2(2*FFABS(left->my - top->my));
- int s_context= 2*left->level + 2*top->level + tl->level + tr->level;
- int ref, best_ref, ref_score, ref_mx, ref_my;
-
- assert(sizeof(s->block_state) >= 256);
- if(s->keyframe){
- set_blocks(s, level, x, y, pl, pcb, pcr, 0, 0, 0, BLOCK_INTRA);
- return 0;
- }
-
-// clip predictors / edge ?
-
- P_LEFT[0]= left->mx;
- P_LEFT[1]= left->my;
- P_TOP [0]= top->mx;
- P_TOP [1]= top->my;
- P_TOPRIGHT[0]= tr->mx;
- P_TOPRIGHT[1]= tr->my;
-
- last_mv[0][0]= s->block[index].mx;
- last_mv[0][1]= s->block[index].my;
- last_mv[1][0]= right->mx;
- last_mv[1][1]= right->my;
- last_mv[2][0]= bottom->mx;
- last_mv[2][1]= bottom->my;
-
- s->m.mb_stride=2;
- s->m.mb_x=
- s->m.mb_y= 0;
- c->skip= 0;
-
- assert(c-> stride == stride);
- assert(c->uvstride == uvstride);
-
- c->penalty_factor = get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_cmp);
- c->sub_penalty_factor= get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_sub_cmp);
- c->mb_penalty_factor = get_penalty_factor(s->lambda, s->lambda2, c->avctx->mb_cmp);
- c->current_mv_penalty= c->mv_penalty[s->m.f_code=1] + MAX_MV;
-
- c->xmin = - x*block_w - 16+2;
- c->ymin = - y*block_w - 16+2;
- c->xmax = - (x+1)*block_w + (w<<(LOG2_MB_SIZE - s->block_max_depth)) + 16-2;
- c->ymax = - (y+1)*block_w + (h<<(LOG2_MB_SIZE - s->block_max_depth)) + 16-2;
-
- if(P_LEFT[0] > (c->xmax<<shift)) P_LEFT[0] = (c->xmax<<shift);
- if(P_LEFT[1] > (c->ymax<<shift)) P_LEFT[1] = (c->ymax<<shift);
- if(P_TOP[0] > (c->xmax<<shift)) P_TOP[0] = (c->xmax<<shift);
- if(P_TOP[1] > (c->ymax<<shift)) P_TOP[1] = (c->ymax<<shift);
- if(P_TOPRIGHT[0] < (c->xmin<<shift)) P_TOPRIGHT[0]= (c->xmin<<shift);
- if(P_TOPRIGHT[0] > (c->xmax<<shift)) P_TOPRIGHT[0]= (c->xmax<<shift); //due to pmx no clip
- if(P_TOPRIGHT[1] > (c->ymax<<shift)) P_TOPRIGHT[1]= (c->ymax<<shift);
-
- P_MEDIAN[0]= mid_pred(P_LEFT[0], P_TOP[0], P_TOPRIGHT[0]);
- P_MEDIAN[1]= mid_pred(P_LEFT[1], P_TOP[1], P_TOPRIGHT[1]);
-
- if (!y) {
- c->pred_x= P_LEFT[0];
- c->pred_y= P_LEFT[1];
- } else {
- c->pred_x = P_MEDIAN[0];
- c->pred_y = P_MEDIAN[1];
- }
-
- score= INT_MAX;
- best_ref= 0;
- for(ref=0; ref<s->ref_frames; ref++){
- init_ref(c, current_data, s->last_picture[ref].data, NULL, block_w*x, block_w*y, 0);
-
- ref_score= ff_epzs_motion_search(&s->m, &ref_mx, &ref_my, P, 0, /*ref_index*/ 0, last_mv,
- (1<<16)>>shift, level-LOG2_MB_SIZE+4, block_w);
-
- assert(ref_mx >= c->xmin);
- assert(ref_mx <= c->xmax);
- assert(ref_my >= c->ymin);
- assert(ref_my <= c->ymax);
-
- ref_score= c->sub_motion_search(&s->m, &ref_mx, &ref_my, ref_score, 0, 0, level-LOG2_MB_SIZE+4, block_w);
- ref_score= ff_get_mb_score(&s->m, ref_mx, ref_my, 0, 0, level-LOG2_MB_SIZE+4, block_w, 0);
- ref_score+= 2*av_log2(2*ref)*c->penalty_factor;
- if(s->ref_mvs[ref]){
- s->ref_mvs[ref][index][0]= ref_mx;
- s->ref_mvs[ref][index][1]= ref_my;
- s->ref_scores[ref][index]= ref_score;
- }
- if(score > ref_score){
- score= ref_score;
- best_ref= ref;
- mx= ref_mx;
- my= ref_my;
- }
- }
- //FIXME if mb_cmp != SSE then intra cant be compared currently and mb_penalty vs. lambda2
-
- // subpel search
- pc= s->c;
- pc.bytestream_start=
- pc.bytestream= p_buffer; //FIXME end/start? and at the other stoo
- memcpy(p_state, s->block_state, sizeof(s->block_state));
-
- if(level!=s->block_max_depth)
- put_rac(&pc, &p_state[4 + s_context], 1);
- put_rac(&pc, &p_state[1 + left->type + top->type], 0);
- if(s->ref_frames > 1)
- put_symbol(&pc, &p_state[128 + 1024 + 32*ref_context], best_ref, 0);
- pred_mv(s, &pmx, &pmy, best_ref, left, top, tr);
- put_symbol(&pc, &p_state[128 + 32*(mx_context + 16*!!best_ref)], mx - pmx, 1);
- put_symbol(&pc, &p_state[128 + 32*(my_context + 16*!!best_ref)], my - pmy, 1);
- p_len= pc.bytestream - pc.bytestream_start;
- score += (s->lambda2*(p_len*8
- + (pc.outstanding_count - s->c.outstanding_count)*8
- + (-av_log2(pc.range) + av_log2(s->c.range))
- ))>>FF_LAMBDA_SHIFT;
-
- block_s= block_w*block_w;
- sum = pix_sum(current_data[0], stride, block_w);
- l= (sum + block_s/2)/block_s;
- iscore = pix_norm1(current_data[0], stride, block_w) - 2*l*sum + l*l*block_s;
-
- block_s= block_w*block_w>>2;
- sum = pix_sum(current_data[1], uvstride, block_w>>1);
- cb= (sum + block_s/2)/block_s;
-// iscore += pix_norm1(&current_mb[1][0], uvstride, block_w>>1) - 2*cb*sum + cb*cb*block_s;
- sum = pix_sum(current_data[2], uvstride, block_w>>1);
- cr= (sum + block_s/2)/block_s;
-// iscore += pix_norm1(&current_mb[2][0], uvstride, block_w>>1) - 2*cr*sum + cr*cr*block_s;
-
- ic= s->c;
- ic.bytestream_start=
- ic.bytestream= i_buffer; //FIXME end/start? and at the other stoo
- memcpy(i_state, s->block_state, sizeof(s->block_state));
- if(level!=s->block_max_depth)
- put_rac(&ic, &i_state[4 + s_context], 1);
- put_rac(&ic, &i_state[1 + left->type + top->type], 1);
- put_symbol(&ic, &i_state[32], l-pl , 1);
- put_symbol(&ic, &i_state[64], cb-pcb, 1);
- put_symbol(&ic, &i_state[96], cr-pcr, 1);
- i_len= ic.bytestream - ic.bytestream_start;
- iscore += (s->lambda2*(i_len*8
- + (ic.outstanding_count - s->c.outstanding_count)*8
- + (-av_log2(ic.range) + av_log2(s->c.range))
- ))>>FF_LAMBDA_SHIFT;
-
-// assert(score==256*256*256*64-1);
- assert(iscore < 255*255*256 + s->lambda2*10);
- assert(iscore >= 0);
- assert(l>=0 && l<=255);
- assert(pl>=0 && pl<=255);
-
- if(level==0){
- int varc= iscore >> 8;
- int vard= score >> 8;
- if (vard <= 64 || vard < varc)
- c->scene_change_score+= ff_sqrt(vard) - ff_sqrt(varc);
- else
- c->scene_change_score+= s->m.qscale;
- }
-
- if(level!=s->block_max_depth){
- put_rac(&s->c, &s->block_state[4 + s_context], 0);
- score2 = encode_q_branch(s, level+1, 2*x+0, 2*y+0);
- score2+= encode_q_branch(s, level+1, 2*x+1, 2*y+0);
- score2+= encode_q_branch(s, level+1, 2*x+0, 2*y+1);
- score2+= encode_q_branch(s, level+1, 2*x+1, 2*y+1);
- score2+= s->lambda2>>FF_LAMBDA_SHIFT; //FIXME exact split overhead
-
- if(score2 < score && score2 < iscore)
- return score2;
- }
-
- if(iscore < score){
- pred_mv(s, &pmx, &pmy, 0, left, top, tr);
- memcpy(pbbak, i_buffer, i_len);
- s->c= ic;
- s->c.bytestream_start= pbbak_start;
- s->c.bytestream= pbbak + i_len;
- set_blocks(s, level, x, y, l, cb, cr, pmx, pmy, 0, BLOCK_INTRA);
- memcpy(s->block_state, i_state, sizeof(s->block_state));
- return iscore;
- }else{
- memcpy(pbbak, p_buffer, p_len);
- s->c= pc;
- s->c.bytestream_start= pbbak_start;
- s->c.bytestream= pbbak + p_len;
- set_blocks(s, level, x, y, pl, pcb, pcr, mx, my, best_ref, 0);
- memcpy(s->block_state, p_state, sizeof(s->block_state));
- return score;
- }
-}
-#endif
-
-static av_always_inline int same_block(BlockNode *a, BlockNode *b){
- if((a->type&BLOCK_INTRA) && (b->type&BLOCK_INTRA)){
- return !((a->color[0] - b->color[0]) | (a->color[1] - b->color[1]) | (a->color[2] - b->color[2]));
- }else{
- return !((a->mx - b->mx) | (a->my - b->my) | (a->ref - b->ref) | ((a->type ^ b->type)&BLOCK_INTRA));
- }
-}
-
-static void encode_q_branch2(SnowContext *s, int level, int x, int y){
- const int w= s->b_width << s->block_max_depth;
- const int rem_depth= s->block_max_depth - level;
- const int index= (x + y*w) << rem_depth;
- int trx= (x+1)<<rem_depth;
- BlockNode *b= &s->block[index];
- const BlockNode *left = x ? &s->block[index-1] : &null_block;
- const BlockNode *top = y ? &s->block[index-w] : &null_block;
- const BlockNode *tl = y && x ? &s->block[index-w-1] : left;
- const BlockNode *tr = y && trx<w && ((x&1)==0 || level==0) ? &s->block[index-w+(1<<rem_depth)] : tl; //FIXME use lt
- int pl = left->color[0];
- int pcb= left->color[1];
- int pcr= left->color[2];
- int pmx, pmy;
- int ref_context= av_log2(2*left->ref) + av_log2(2*top->ref);
- int mx_context= av_log2(2*FFABS(left->mx - top->mx)) + 16*!!b->ref;
- int my_context= av_log2(2*FFABS(left->my - top->my)) + 16*!!b->ref;
- int s_context= 2*left->level + 2*top->level + tl->level + tr->level;
-
- if(s->keyframe){
- set_blocks(s, level, x, y, pl, pcb, pcr, 0, 0, 0, BLOCK_INTRA);
- return;
- }
-
- if(level!=s->block_max_depth){
- if(same_block(b,b+1) && same_block(b,b+w) && same_block(b,b+w+1)){
- put_rac(&s->c, &s->block_state[4 + s_context], 1);
- }else{
- put_rac(&s->c, &s->block_state[4 + s_context], 0);
- encode_q_branch2(s, level+1, 2*x+0, 2*y+0);
- encode_q_branch2(s, level+1, 2*x+1, 2*y+0);
- encode_q_branch2(s, level+1, 2*x+0, 2*y+1);
- encode_q_branch2(s, level+1, 2*x+1, 2*y+1);
- return;
- }
- }
- if(b->type & BLOCK_INTRA){
- pred_mv(s, &pmx, &pmy, 0, left, top, tr);
- put_rac(&s->c, &s->block_state[1 + (left->type&1) + (top->type&1)], 1);
- put_symbol(&s->c, &s->block_state[32], b->color[0]-pl , 1);
- put_symbol(&s->c, &s->block_state[64], b->color[1]-pcb, 1);
- put_symbol(&s->c, &s->block_state[96], b->color[2]-pcr, 1);
- set_blocks(s, level, x, y, b->color[0], b->color[1], b->color[2], pmx, pmy, 0, BLOCK_INTRA);
- }else{
- pred_mv(s, &pmx, &pmy, b->ref, left, top, tr);
- put_rac(&s->c, &s->block_state[1 + (left->type&1) + (top->type&1)], 0);
- if(s->ref_frames > 1)
- put_symbol(&s->c, &s->block_state[128 + 1024 + 32*ref_context], b->ref, 0);
- put_symbol(&s->c, &s->block_state[128 + 32*mx_context], b->mx - pmx, 1);
- put_symbol(&s->c, &s->block_state[128 + 32*my_context], b->my - pmy, 1);
- set_blocks(s, level, x, y, pl, pcb, pcr, b->mx, b->my, b->ref, 0);
- }
-}
-
-static void decode_q_branch(SnowContext *s, int level, int x, int y){
- const int w= s->b_width << s->block_max_depth;
- const int rem_depth= s->block_max_depth - level;
- const int index= (x + y*w) << rem_depth;
- int trx= (x+1)<<rem_depth;
- const BlockNode *left = x ? &s->block[index-1] : &null_block;
- const BlockNode *top = y ? &s->block[index-w] : &null_block;
- const BlockNode *tl = y && x ? &s->block[index-w-1] : left;
- const BlockNode *tr = y && trx<w && ((x&1)==0 || level==0) ? &s->block[index-w+(1<<rem_depth)] : tl; //FIXME use lt
- int s_context= 2*left->level + 2*top->level + tl->level + tr->level;
-
- if(s->keyframe){
- set_blocks(s, level, x, y, null_block.color[0], null_block.color[1], null_block.color[2], null_block.mx, null_block.my, null_block.ref, BLOCK_INTRA);
- return;
- }
-
- if(level==s->block_max_depth || get_rac(&s->c, &s->block_state[4 + s_context])){
- int type, mx, my;
- int l = left->color[0];
- int cb= left->color[1];
- int cr= left->color[2];
- int ref = 0;
- int ref_context= av_log2(2*left->ref) + av_log2(2*top->ref);
- int mx_context= av_log2(2*FFABS(left->mx - top->mx)) + 0*av_log2(2*FFABS(tr->mx - top->mx));
- int my_context= av_log2(2*FFABS(left->my - top->my)) + 0*av_log2(2*FFABS(tr->my - top->my));
-
- type= get_rac(&s->c, &s->block_state[1 + left->type + top->type]) ? BLOCK_INTRA : 0;
-
- if(type){
- pred_mv(s, &mx, &my, 0, left, top, tr);
- l += get_symbol(&s->c, &s->block_state[32], 1);
- cb+= get_symbol(&s->c, &s->block_state[64], 1);
- cr+= get_symbol(&s->c, &s->block_state[96], 1);
- }else{
- if(s->ref_frames > 1)
- ref= get_symbol(&s->c, &s->block_state[128 + 1024 + 32*ref_context], 0);
- pred_mv(s, &mx, &my, ref, left, top, tr);
- mx+= get_symbol(&s->c, &s->block_state[128 + 32*(mx_context + 16*!!ref)], 1);
- my+= get_symbol(&s->c, &s->block_state[128 + 32*(my_context + 16*!!ref)], 1);
- }
- set_blocks(s, level, x, y, l, cb, cr, mx, my, ref, type);
- }else{
- decode_q_branch(s, level+1, 2*x+0, 2*y+0);
- decode_q_branch(s, level+1, 2*x+1, 2*y+0);
- decode_q_branch(s, level+1, 2*x+0, 2*y+1);
- decode_q_branch(s, level+1, 2*x+1, 2*y+1);
- }
-}
-
-#ifdef CONFIG_ENCODERS
-static void encode_blocks(SnowContext *s, int search){
- int x, y;
- int w= s->b_width;
- int h= s->b_height;
-
- if(s->avctx->me_method == ME_ITER && !s->keyframe && search)
- iterative_me(s);
-
- for(y=0; y<h; y++){
- if(s->c.bytestream_end - s->c.bytestream < w*MB_SIZE*MB_SIZE*3){ //FIXME nicer limit
- av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n");
- return;
- }
- for(x=0; x<w; x++){
- if(s->avctx->me_method == ME_ITER || !search)
- encode_q_branch2(s, 0, x, y);
- else
- encode_q_branch (s, 0, x, y);
- }
- }
-}
-#endif
-
-static void decode_blocks(SnowContext *s){
- int x, y;
- int w= s->b_width;
- int h= s->b_height;
-
- for(y=0; y<h; y++){
- for(x=0; x<w; x++){
- decode_q_branch(s, 0, x, y);
- }
- }
-}
-
-static void mc_block(uint8_t *dst, uint8_t *src, uint8_t *tmp, int stride, int b_w, int b_h, int dx, int dy){
- int x, y;
-START_TIMER
- for(y=0; y < b_h+5; y++){
- for(x=0; x < b_w; x++){
- int a0= src[x ];
- int a1= src[x + 1];
- int a2= src[x + 2];
- int a3= src[x + 3];
- int a4= src[x + 4];
- int a5= src[x + 5];
-// int am= 9*(a1+a2) - (a0+a3);
- int am= 20*(a2+a3) - 5*(a1+a4) + (a0+a5);
-// int am= 18*(a2+a3) - 2*(a1+a4);
-// int aL= (-7*a0 + 105*a1 + 35*a2 - 5*a3)>>3;
-// int aR= (-7*a3 + 105*a2 + 35*a1 - 5*a0)>>3;
-
-// if(b_w==16) am= 8*(a1+a2);
-
- if(dx<8) am = (32*a2*( 8-dx) + am* dx + 128)>>8;
- else am = ( am*(16-dx) + 32*a3*(dx-8) + 128)>>8;
-
- /* FIXME Try increasing tmp buffer to 16 bits and not clipping here. Should give marginally better results. - Robert*/
- if(am&(~255)) am= ~(am>>31);
-
- tmp[x] = am;
-
-/* if (dx< 4) tmp[x + y*stride]= (16*a1*( 4-dx) + aL* dx + 32)>>6;
- else if(dx< 8) tmp[x + y*stride]= ( aL*( 8-dx) + am*(dx- 4) + 32)>>6;
- else if(dx<12) tmp[x + y*stride]= ( am*(12-dx) + aR*(dx- 8) + 32)>>6;
- else tmp[x + y*stride]= ( aR*(16-dx) + 16*a2*(dx-12) + 32)>>6;*/
- }
- tmp += stride;
- src += stride;
- }
- tmp -= (b_h+5)*stride;
-
- for(y=0; y < b_h; y++){
- for(x=0; x < b_w; x++){
- int a0= tmp[x + 0*stride];
- int a1= tmp[x + 1*stride];
- int a2= tmp[x + 2*stride];
- int a3= tmp[x + 3*stride];
- int a4= tmp[x + 4*stride];
- int a5= tmp[x + 5*stride];
- int am= 20*(a2+a3) - 5*(a1+a4) + (a0+a5);
-// int am= 18*(a2+a3) - 2*(a1+a4);
-/* int aL= (-7*a0 + 105*a1 + 35*a2 - 5*a3)>>3;
- int aR= (-7*a3 + 105*a2 + 35*a1 - 5*a0)>>3;*/
-
-// if(b_w==16) am= 8*(a1+a2);
-
- if(dy<8) am = (32*a2*( 8-dy) + am* dy + 128)>>8;
- else am = ( am*(16-dy) + 32*a3*(dy-8) + 128)>>8;
-
- if(am&(~255)) am= ~(am>>31);
-
- dst[x] = am;
-/* if (dy< 4) tmp[x + y*stride]= (16*a1*( 4-dy) + aL* dy + 32)>>6;
- else if(dy< 8) tmp[x + y*stride]= ( aL*( 8-dy) + am*(dy- 4) + 32)>>6;
- else if(dy<12) tmp[x + y*stride]= ( am*(12-dy) + aR*(dy- 8) + 32)>>6;
- else tmp[x + y*stride]= ( aR*(16-dy) + 16*a2*(dy-12) + 32)>>6;*/
- }
- dst += stride;
- tmp += stride;
- }
-STOP_TIMER("mc_block")
-}
-
-#define mca(dx,dy,b_w)\
-static void mc_block_hpel ## dx ## dy ## b_w(uint8_t *dst, uint8_t *src, int stride, int h){\
- uint8_t tmp[stride*(b_w+5)];\
- assert(h==b_w);\
- mc_block(dst, src-2-2*stride, tmp, stride, b_w, b_w, dx, dy);\
-}
-
-mca( 0, 0,16)
-mca( 8, 0,16)
-mca( 0, 8,16)
-mca( 8, 8,16)
-mca( 0, 0,8)
-mca( 8, 0,8)
-mca( 0, 8,8)
-mca( 8, 8,8)
-
-static void pred_block(SnowContext *s, uint8_t *dst, uint8_t *tmp, int stride, int sx, int sy, int b_w, int b_h, BlockNode *block, int plane_index, int w, int h){
- if(block->type & BLOCK_INTRA){
- int x, y;
- const int color = block->color[plane_index];
- const int color4= color*0x01010101;
- if(b_w==32){
- for(y=0; y < b_h; y++){
- *(uint32_t*)&dst[0 + y*stride]= color4;
- *(uint32_t*)&dst[4 + y*stride]= color4;
- *(uint32_t*)&dst[8 + y*stride]= color4;
- *(uint32_t*)&dst[12+ y*stride]= color4;
- *(uint32_t*)&dst[16+ y*stride]= color4;
- *(uint32_t*)&dst[20+ y*stride]= color4;
- *(uint32_t*)&dst[24+ y*stride]= color4;
- *(uint32_t*)&dst[28+ y*stride]= color4;
- }
- }else if(b_w==16){
- for(y=0; y < b_h; y++){
- *(uint32_t*)&dst[0 + y*stride]= color4;
- *(uint32_t*)&dst[4 + y*stride]= color4;
- *(uint32_t*)&dst[8 + y*stride]= color4;
- *(uint32_t*)&dst[12+ y*stride]= color4;
- }
- }else if(b_w==8){
- for(y=0; y < b_h; y++){
- *(uint32_t*)&dst[0 + y*stride]= color4;
- *(uint32_t*)&dst[4 + y*stride]= color4;
- }
- }else if(b_w==4){
- for(y=0; y < b_h; y++){
- *(uint32_t*)&dst[0 + y*stride]= color4;
- }
- }else{
- for(y=0; y < b_h; y++){
- for(x=0; x < b_w; x++){
- dst[x + y*stride]= color;
- }
- }
- }
- }else{
- uint8_t *src= s->last_picture[block->ref].data[plane_index];
- const int scale= plane_index ? s->mv_scale : 2*s->mv_scale;
- int mx= block->mx*scale;
- int my= block->my*scale;
- const int dx= mx&15;
- const int dy= my&15;
- const int tab_index= 3 - (b_w>>2) + (b_w>>4);
- sx += (mx>>4) - 2;
- sy += (my>>4) - 2;
- src += sx + sy*stride;
- if( (unsigned)sx >= w - b_w - 4
- || (unsigned)sy >= h - b_h - 4){
- ff_emulated_edge_mc(tmp + MB_SIZE, src, stride, b_w+5, b_h+5, sx, sy, w, h);
- src= tmp + MB_SIZE;
- }
-// assert(b_w == b_h || 2*b_w == b_h || b_w == 2*b_h);
-// assert(!(b_w&(b_w-1)));
- assert(b_w>1 && b_h>1);
- assert(tab_index>=0 && tab_index<4 || b_w==32);
- if((dx&3) || (dy&3) || !(b_w == b_h || 2*b_w == b_h || b_w == 2*b_h) || (b_w&(b_w-1)))
- mc_block(dst, src, tmp, stride, b_w, b_h, dx, dy);
- else if(b_w==32){
- int y;
- for(y=0; y<b_h; y+=16){
- s->dsp.put_h264_qpel_pixels_tab[0][dy+(dx>>2)](dst + y*stride, src + 2 + (y+2)*stride,stride);
- s->dsp.put_h264_qpel_pixels_tab[0][dy+(dx>>2)](dst + 16 + y*stride, src + 18 + (y+2)*stride,stride);
- }
- }else if(b_w==b_h)
- s->dsp.put_h264_qpel_pixels_tab[tab_index ][dy+(dx>>2)](dst,src + 2 + 2*stride,stride);
- else if(b_w==2*b_h){
- s->dsp.put_h264_qpel_pixels_tab[tab_index+1][dy+(dx>>2)](dst ,src + 2 + 2*stride,stride);
- s->dsp.put_h264_qpel_pixels_tab[tab_index+1][dy+(dx>>2)](dst+b_h,src + 2 + b_h + 2*stride,stride);
- }else{
- assert(2*b_w==b_h);
- s->dsp.put_h264_qpel_pixels_tab[tab_index ][dy+(dx>>2)](dst ,src + 2 + 2*stride ,stride);
- s->dsp.put_h264_qpel_pixels_tab[tab_index ][dy+(dx>>2)](dst+b_w*stride,src + 2 + 2*stride+b_w*stride,stride);
- }
- }
-}
-
-void ff_snow_inner_add_yblock(uint8_t *obmc, const int obmc_stride, uint8_t * * block, int b_w, int b_h,
- int src_x, int src_y, int src_stride, slice_buffer * sb, int add, uint8_t * dst8){
- int y, x;
- DWTELEM * dst;
- for(y=0; y<b_h; y++){
- //FIXME ugly missue of obmc_stride
- uint8_t *obmc1= obmc + y*obmc_stride;
- uint8_t *obmc2= obmc1+ (obmc_stride>>1);
- uint8_t *obmc3= obmc1+ obmc_stride*(obmc_stride>>1);
- uint8_t *obmc4= obmc3+ (obmc_stride>>1);
- dst = slice_buffer_get_line(sb, src_y + y);
- for(x=0; x<b_w; x++){
- int v= obmc1[x] * block[3][x + y*src_stride]
- +obmc2[x] * block[2][x + y*src_stride]
- +obmc3[x] * block[1][x + y*src_stride]
- +obmc4[x] * block[0][x + y*src_stride];
-
- v <<= 8 - LOG2_OBMC_MAX;
- if(FRAC_BITS != 8){
- v += 1<<(7 - FRAC_BITS);
- v >>= 8 - FRAC_BITS;
- }
- if(add){
- v += dst[x + src_x];
- v = (v + (1<<(FRAC_BITS-1))) >> FRAC_BITS;
- if(v&(~255)) v= ~(v>>31);
- dst8[x + y*src_stride] = v;
- }else{
- dst[x + src_x] -= v;
- }
- }
- }
-}
-
-//FIXME name clenup (b_w, block_w, b_width stuff)
-static av_always_inline void add_yblock(SnowContext *s, int sliced, slice_buffer *sb, DWTELEM *dst, uint8_t *dst8, const uint8_t *obmc, int src_x, int src_y, int b_w, int b_h, int w, int h, int dst_stride, int src_stride, int obmc_stride, int b_x, int b_y, int add, int offset_dst, int plane_index){
- const int b_width = s->b_width << s->block_max_depth;
- const int b_height= s->b_height << s->block_max_depth;
- const int b_stride= b_width;
- BlockNode *lt= &s->block[b_x + b_y*b_stride];
- BlockNode *rt= lt+1;
- BlockNode *lb= lt+b_stride;
- BlockNode *rb= lb+1;
- uint8_t *block[4];
- int tmp_step= src_stride >= 7*MB_SIZE ? MB_SIZE : MB_SIZE*src_stride;
- uint8_t tmp[src_stride*7*MB_SIZE]; //FIXME align
- uint8_t *ptmp;
- int x,y;
-
- if(b_x<0){
- lt= rt;
- lb= rb;
- }else if(b_x + 1 >= b_width){
- rt= lt;
- rb= lb;
- }
- if(b_y<0){
- lt= lb;
- rt= rb;
- }else if(b_y + 1 >= b_height){
- lb= lt;
- rb= rt;
- }
-
- if(src_x<0){ //FIXME merge with prev & always round internal width upto *16
- obmc -= src_x;
- b_w += src_x;
- if(!sliced && !offset_dst)
- dst -= src_x;
- src_x=0;
- }else if(src_x + b_w > w){
- b_w = w - src_x;
- }
- if(src_y<0){
- obmc -= src_y*obmc_stride;
- b_h += src_y;
- if(!sliced && !offset_dst)
- dst -= src_y*dst_stride;
- src_y=0;
- }else if(src_y + b_h> h){
- b_h = h - src_y;
- }
-
- if(b_w<=0 || b_h<=0) return;
-
-assert(src_stride > 2*MB_SIZE + 5);
- if(!sliced && offset_dst)
- dst += src_x + src_y*dst_stride;
- dst8+= src_x + src_y*src_stride;
-// src += src_x + src_y*src_stride;
-
- ptmp= tmp + 3*tmp_step;
- block[0]= ptmp;
- ptmp+=tmp_step;
- pred_block(s, block[0], tmp, src_stride, src_x, src_y, b_w, b_h, lt, plane_index, w, h);
-
- if(same_block(lt, rt)){
- block[1]= block[0];
- }else{
- block[1]= ptmp;
- ptmp+=tmp_step;
- pred_block(s, block[1], tmp, src_stride, src_x, src_y, b_w, b_h, rt, plane_index, w, h);
- }
-
- if(same_block(lt, lb)){
- block[2]= block[0];
- }else if(same_block(rt, lb)){
- block[2]= block[1];
- }else{
- block[2]= ptmp;
- ptmp+=tmp_step;
- pred_block(s, block[2], tmp, src_stride, src_x, src_y, b_w, b_h, lb, plane_index, w, h);
- }
-
- if(same_block(lt, rb) ){
- block[3]= block[0];
- }else if(same_block(rt, rb)){
- block[3]= block[1];
- }else if(same_block(lb, rb)){
- block[3]= block[2];
- }else{
- block[3]= ptmp;
- pred_block(s, block[3], tmp, src_stride, src_x, src_y, b_w, b_h, rb, plane_index, w, h);
- }
-#if 0
- for(y=0; y<b_h; y++){
- for(x=0; x<b_w; x++){
- int v= obmc [x + y*obmc_stride] * block[3][x + y*src_stride] * (256/OBMC_MAX);
- if(add) dst[x + y*dst_stride] += v;
- else dst[x + y*dst_stride] -= v;
- }
- }
- for(y=0; y<b_h; y++){
- uint8_t *obmc2= obmc + (obmc_stride>>1);
- for(x=0; x<b_w; x++){
- int v= obmc2[x + y*obmc_stride] * block[2][x + y*src_stride] * (256/OBMC_MAX);
- if(add) dst[x + y*dst_stride] += v;
- else dst[x + y*dst_stride] -= v;
- }
- }
- for(y=0; y<b_h; y++){
- uint8_t *obmc3= obmc + obmc_stride*(obmc_stride>>1);
- for(x=0; x<b_w; x++){
- int v= obmc3[x + y*obmc_stride] * block[1][x + y*src_stride] * (256/OBMC_MAX);
- if(add) dst[x + y*dst_stride] += v;
- else dst[x + y*dst_stride] -= v;
- }
- }
- for(y=0; y<b_h; y++){
- uint8_t *obmc3= obmc + obmc_stride*(obmc_stride>>1);
- uint8_t *obmc4= obmc3+ (obmc_stride>>1);
- for(x=0; x<b_w; x++){
- int v= obmc4[x + y*obmc_stride] * block[0][x + y*src_stride] * (256/OBMC_MAX);
- if(add) dst[x + y*dst_stride] += v;
- else dst[x + y*dst_stride] -= v;
- }
- }
-#else
- if(sliced){
- START_TIMER
-
- s->dsp.inner_add_yblock(obmc, obmc_stride, block, b_w, b_h, src_x,src_y, src_stride, sb, add, dst8);
- STOP_TIMER("inner_add_yblock")
- }else
- for(y=0; y<b_h; y++){
- //FIXME ugly missue of obmc_stride
- uint8_t *obmc1= obmc + y*obmc_stride;
- uint8_t *obmc2= obmc1+ (obmc_stride>>1);
- uint8_t *obmc3= obmc1+ obmc_stride*(obmc_stride>>1);
- uint8_t *obmc4= obmc3+ (obmc_stride>>1);
- for(x=0; x<b_w; x++){
- int v= obmc1[x] * block[3][x + y*src_stride]
- +obmc2[x] * block[2][x + y*src_stride]
- +obmc3[x] * block[1][x + y*src_stride]
- +obmc4[x] * block[0][x + y*src_stride];
-
- v <<= 8 - LOG2_OBMC_MAX;
- if(FRAC_BITS != 8){
- v += 1<<(7 - FRAC_BITS);
- v >>= 8 - FRAC_BITS;
- }
- if(add){
- v += dst[x + y*dst_stride];
- v = (v + (1<<(FRAC_BITS-1))) >> FRAC_BITS;
- if(v&(~255)) v= ~(v>>31);
- dst8[x + y*src_stride] = v;
- }else{
- dst[x + y*dst_stride] -= v;
- }
- }
- }
-#endif
-}
-
-static av_always_inline void predict_slice_buffered(SnowContext *s, slice_buffer * sb, DWTELEM * old_buffer, int plane_index, int add, int mb_y){
- Plane *p= &s->plane[plane_index];
- const int mb_w= s->b_width << s->block_max_depth;
- const int mb_h= s->b_height << s->block_max_depth;
- int x, y, mb_x;
- int block_size = MB_SIZE >> s->block_max_depth;
- int block_w = plane_index ? block_size/2 : block_size;
- const uint8_t *obmc = plane_index ? obmc_tab[s->block_max_depth+1] : obmc_tab[s->block_max_depth];
- int obmc_stride= plane_index ? block_size : 2*block_size;
- int ref_stride= s->current_picture.linesize[plane_index];
- uint8_t *dst8= s->current_picture.data[plane_index];
- int w= p->width;
- int h= p->height;
- START_TIMER
-
- if(s->keyframe || (s->avctx->debug&512)){
- if(mb_y==mb_h)
- return;
-
- if(add){
- for(y=block_w*mb_y; y<FFMIN(h,block_w*(mb_y+1)); y++)
- {
-// DWTELEM * line = slice_buffer_get_line(sb, y);
- DWTELEM * line = sb->line[y];
- for(x=0; x<w; x++)
- {
-// int v= buf[x + y*w] + (128<<FRAC_BITS) + (1<<(FRAC_BITS-1));
- int v= line[x] + (128<<FRAC_BITS) + (1<<(FRAC_BITS-1));
- v >>= FRAC_BITS;
- if(v&(~255)) v= ~(v>>31);
- dst8[x + y*ref_stride]= v;
- }
- }
- }else{
- for(y=block_w*mb_y; y<FFMIN(h,block_w*(mb_y+1)); y++)
- {
-// DWTELEM * line = slice_buffer_get_line(sb, y);
- DWTELEM * line = sb->line[y];
- for(x=0; x<w; x++)
- {
- line[x] -= 128 << FRAC_BITS;
-// buf[x + y*w]-= 128<<FRAC_BITS;
- }
- }
- }
-
- return;
- }
-
- for(mb_x=0; mb_x<=mb_w; mb_x++){
- START_TIMER
-
- add_yblock(s, 1, sb, old_buffer, dst8, obmc,
- block_w*mb_x - block_w/2,
- block_w*mb_y - block_w/2,
- block_w, block_w,
- w, h,
- w, ref_stride, obmc_stride,
- mb_x - 1, mb_y - 1,
- add, 0, plane_index);
-
- STOP_TIMER("add_yblock")
- }
-
- STOP_TIMER("predict_slice")
-}
-
-static av_always_inline void predict_slice(SnowContext *s, DWTELEM *buf, int plane_index, int add, int mb_y){
- Plane *p= &s->plane[plane_index];
- const int mb_w= s->b_width << s->block_max_depth;
- const int mb_h= s->b_height << s->block_max_depth;
- int x, y, mb_x;
- int block_size = MB_SIZE >> s->block_max_depth;
- int block_w = plane_index ? block_size/2 : block_size;
- const uint8_t *obmc = plane_index ? obmc_tab[s->block_max_depth+1] : obmc_tab[s->block_max_depth];
- const int obmc_stride= plane_index ? block_size : 2*block_size;
- int ref_stride= s->current_picture.linesize[plane_index];
- uint8_t *dst8= s->current_picture.data[plane_index];
- int w= p->width;
- int h= p->height;
- START_TIMER
-
- if(s->keyframe || (s->avctx->debug&512)){
- if(mb_y==mb_h)
- return;
-
- if(add){
- for(y=block_w*mb_y; y<FFMIN(h,block_w*(mb_y+1)); y++){
- for(x=0; x<w; x++){
- int v= buf[x + y*w] + (128<<FRAC_BITS) + (1<<(FRAC_BITS-1));
- v >>= FRAC_BITS;
- if(v&(~255)) v= ~(v>>31);
- dst8[x + y*ref_stride]= v;
- }
- }
- }else{
- for(y=block_w*mb_y; y<FFMIN(h,block_w*(mb_y+1)); y++){
- for(x=0; x<w; x++){
- buf[x + y*w]-= 128<<FRAC_BITS;
- }
- }
- }
-
- return;
- }
-
- for(mb_x=0; mb_x<=mb_w; mb_x++){
- START_TIMER
-
- add_yblock(s, 0, NULL, buf, dst8, obmc,
- block_w*mb_x - block_w/2,
- block_w*mb_y - block_w/2,
- block_w, block_w,
- w, h,
- w, ref_stride, obmc_stride,
- mb_x - 1, mb_y - 1,
- add, 1, plane_index);
-
- STOP_TIMER("add_yblock")
- }
-
- STOP_TIMER("predict_slice")
-}
-
-static av_always_inline void predict_plane(SnowContext *s, DWTELEM *buf, int plane_index, int add){
- const int mb_h= s->b_height << s->block_max_depth;
- int mb_y;
- for(mb_y=0; mb_y<=mb_h; mb_y++)
- predict_slice(s, buf, plane_index, add, mb_y);
-}
-
-static int get_dc(SnowContext *s, int mb_x, int mb_y, int plane_index){
- int i, x2, y2;
- Plane *p= &s->plane[plane_index];
- const int block_size = MB_SIZE >> s->block_max_depth;
- const int block_w = plane_index ? block_size/2 : block_size;
- const uint8_t *obmc = plane_index ? obmc_tab[s->block_max_depth+1] : obmc_tab[s->block_max_depth];
- const int obmc_stride= plane_index ? block_size : 2*block_size;
- const int ref_stride= s->current_picture.linesize[plane_index];
- uint8_t *src= s-> input_picture.data[plane_index];
- DWTELEM *dst= (DWTELEM*)s->m.obmc_scratchpad + plane_index*block_size*block_size*4;
- const int b_stride = s->b_width << s->block_max_depth;
- const int w= p->width;
- const int h= p->height;
- int index= mb_x + mb_y*b_stride;
- BlockNode *b= &s->block[index];
- BlockNode backup= *b;
- int ab=0;
- int aa=0;
-
- b->type|= BLOCK_INTRA;
- b->color[plane_index]= 0;
- memset(dst, 0, obmc_stride*obmc_stride*sizeof(DWTELEM));
-
- for(i=0; i<4; i++){
- int mb_x2= mb_x + (i &1) - 1;
- int mb_y2= mb_y + (i>>1) - 1;
- int x= block_w*mb_x2 + block_w/2;
- int y= block_w*mb_y2 + block_w/2;
-
- add_yblock(s, 0, NULL, dst + ((i&1)+(i>>1)*obmc_stride)*block_w, NULL, obmc,
- x, y, block_w, block_w, w, h, obmc_stride, ref_stride, obmc_stride, mb_x2, mb_y2, 0, 0, plane_index);
-
- for(y2= FFMAX(y, 0); y2<FFMIN(h, y+block_w); y2++){
- for(x2= FFMAX(x, 0); x2<FFMIN(w, x+block_w); x2++){
- int index= x2-(block_w*mb_x - block_w/2) + (y2-(block_w*mb_y - block_w/2))*obmc_stride;
- int obmc_v= obmc[index];
- int d;
- if(y<0) obmc_v += obmc[index + block_w*obmc_stride];
- if(x<0) obmc_v += obmc[index + block_w];
- if(y+block_w>h) obmc_v += obmc[index - block_w*obmc_stride];
- if(x+block_w>w) obmc_v += obmc[index - block_w];
- //FIXME precalc this or simplify it somehow else
-
- d = -dst[index] + (1<<(FRAC_BITS-1));
- dst[index] = d;
- ab += (src[x2 + y2*ref_stride] - (d>>FRAC_BITS)) * obmc_v;
- aa += obmc_v * obmc_v; //FIXME precalclate this
- }
- }
- }
- *b= backup;
-
- return clip(((ab<<LOG2_OBMC_MAX) + aa/2)/aa, 0, 255); //FIXME we shouldnt need cliping
-}
-
-static inline int get_block_bits(SnowContext *s, int x, int y, int w){
- const int b_stride = s->b_width << s->block_max_depth;
- const int b_height = s->b_height<< s->block_max_depth;
- int index= x + y*b_stride;
- const BlockNode *b = &s->block[index];
- const BlockNode *left = x ? &s->block[index-1] : &null_block;
- const BlockNode *top = y ? &s->block[index-b_stride] : &null_block;
- const BlockNode *tl = y && x ? &s->block[index-b_stride-1] : left;
- const BlockNode *tr = y && x+w<b_stride ? &s->block[index-b_stride+w] : tl;
- int dmx, dmy;
-// int mx_context= av_log2(2*FFABS(left->mx - top->mx));
-// int my_context= av_log2(2*FFABS(left->my - top->my));
-
- if(x<0 || x>=b_stride || y>=b_height)
- return 0;
-/*
-1 0 0
-01X 1-2 1
-001XX 3-6 2-3
-0001XXX 7-14 4-7
-00001XXXX 15-30 8-15
-*/
-//FIXME try accurate rate
-//FIXME intra and inter predictors if surrounding blocks arent the same type
- if(b->type & BLOCK_INTRA){
- return 3+2*( av_log2(2*FFABS(left->color[0] - b->color[0]))
- + av_log2(2*FFABS(left->color[1] - b->color[1]))
- + av_log2(2*FFABS(left->color[2] - b->color[2])));
- }else{
- pred_mv(s, &dmx, &dmy, b->ref, left, top, tr);
- dmx-= b->mx;
- dmy-= b->my;
- return 2*(1 + av_log2(2*FFABS(dmx)) //FIXME kill the 2* can be merged in lambda
- + av_log2(2*FFABS(dmy))
- + av_log2(2*b->ref));
- }
-}
-
-static int get_block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index, const uint8_t *obmc_edged){
- Plane *p= &s->plane[plane_index];
- const int block_size = MB_SIZE >> s->block_max_depth;
- const int block_w = plane_index ? block_size/2 : block_size;
- const int obmc_stride= plane_index ? block_size : 2*block_size;
- const int ref_stride= s->current_picture.linesize[plane_index];
- uint8_t *dst= s->current_picture.data[plane_index];
- uint8_t *src= s-> input_picture.data[plane_index];
- DWTELEM *pred= (DWTELEM*)s->m.obmc_scratchpad + plane_index*block_size*block_size*4;
- uint8_t cur[ref_stride*2*MB_SIZE]; //FIXME alignment
- uint8_t tmp[ref_stride*(2*MB_SIZE+5)];
- const int b_stride = s->b_width << s->block_max_depth;
- const int b_height = s->b_height<< s->block_max_depth;
- const int w= p->width;
- const int h= p->height;
- int distortion;
- int rate= 0;
- const int penalty_factor= get_penalty_factor(s->lambda, s->lambda2, s->avctx->me_cmp);
- int sx= block_w*mb_x - block_w/2;
- int sy= block_w*mb_y - block_w/2;
- int x0= FFMAX(0,-sx);
- int y0= FFMAX(0,-sy);
- int x1= FFMIN(block_w*2, w-sx);
- int y1= FFMIN(block_w*2, h-sy);
- int i,x,y;
-
- pred_block(s, cur, tmp, ref_stride, sx, sy, block_w*2, block_w*2, &s->block[mb_x + mb_y*b_stride], plane_index, w, h);
-
- for(y=y0; y<y1; y++){
- const uint8_t *obmc1= obmc_edged + y*obmc_stride;
- const DWTELEM *pred1 = pred + y*obmc_stride;
- uint8_t *cur1 = cur + y*ref_stride;
- uint8_t *dst1 = dst + sx + (sy+y)*ref_stride;
- for(x=x0; x<x1; x++){
- int v = (cur1[x] * obmc1[x]) << (FRAC_BITS - LOG2_OBMC_MAX);
- v = (v + pred1[x]) >> FRAC_BITS;
- if(v&(~255)) v= ~(v>>31);
- dst1[x] = v;
- }
- }
-
- /* copy the regions where obmc[] = (uint8_t)256 */
- if(LOG2_OBMC_MAX == 8
- && (mb_x == 0 || mb_x == b_stride-1)
- && (mb_y == 0 || mb_y == b_height-1)){
- if(mb_x == 0)
- x1 = block_w;
- else
- x0 = block_w;
- if(mb_y == 0)
- y1 = block_w;
- else
- y0 = block_w;
- for(y=y0; y<y1; y++)
- memcpy(dst + sx+x0 + (sy+y)*ref_stride, cur + x0 + y*ref_stride, x1-x0);
- }
-
- if(block_w==16){
- /* FIXME rearrange dsputil to fit 32x32 cmp functions */
- /* FIXME check alignment of the cmp wavelet vs the encoding wavelet */
- /* FIXME cmps overlap but don't cover the wavelet's whole support,
- * so improving the score of one block is not strictly guaranteed to
- * improve the score of the whole frame, so iterative motion est
- * doesn't always converge. */
- if(s->avctx->me_cmp == FF_CMP_W97)
- distortion = w97_32_c(&s->m, src + sx + sy*ref_stride, dst + sx + sy*ref_stride, ref_stride, 32);
- else if(s->avctx->me_cmp == FF_CMP_W53)
- distortion = w53_32_c(&s->m, src + sx + sy*ref_stride, dst + sx + sy*ref_stride, ref_stride, 32);
- else{
- distortion = 0;
- for(i=0; i<4; i++){
- int off = sx+16*(i&1) + (sy+16*(i>>1))*ref_stride;
- distortion += s->dsp.me_cmp[0](&s->m, src + off, dst + off, ref_stride, 16);
- }
- }
- }else{
- assert(block_w==8);
- distortion = s->dsp.me_cmp[0](&s->m, src + sx + sy*ref_stride, dst + sx + sy*ref_stride, ref_stride, block_w*2);
- }
-
- if(plane_index==0){
- for(i=0; i<4; i++){
-/* ..RRr
- * .RXx.
- * rxx..
- */
- rate += get_block_bits(s, mb_x + (i&1) - (i>>1), mb_y + (i>>1), 1);
- }
- if(mb_x == b_stride-2)
- rate += get_block_bits(s, mb_x + 1, mb_y + 1, 1);
- }
- return distortion + rate*penalty_factor;
-}
-
-static int get_4block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index){
- int i, y2;
- Plane *p= &s->plane[plane_index];
- const int block_size = MB_SIZE >> s->block_max_depth;
- const int block_w = plane_index ? block_size/2 : block_size;
- const uint8_t *obmc = plane_index ? obmc_tab[s->block_max_depth+1] : obmc_tab[s->block_max_depth];
- const int obmc_stride= plane_index ? block_size : 2*block_size;
- const int ref_stride= s->current_picture.linesize[plane_index];
- uint8_t *dst= s->current_picture.data[plane_index];
- uint8_t *src= s-> input_picture.data[plane_index];
- static const DWTELEM zero_dst[4096]; //FIXME
- const int b_stride = s->b_width << s->block_max_depth;
- const int w= p->width;
- const int h= p->height;
- int distortion= 0;
- int rate= 0;
- const int penalty_factor= get_penalty_factor(s->lambda, s->lambda2, s->avctx->me_cmp);
-
- for(i=0; i<9; i++){
- int mb_x2= mb_x + (i%3) - 1;
- int mb_y2= mb_y + (i/3) - 1;
- int x= block_w*mb_x2 + block_w/2;
- int y= block_w*mb_y2 + block_w/2;
-
- add_yblock(s, 0, NULL, zero_dst, dst, obmc,
- x, y, block_w, block_w, w, h, /*dst_stride*/0, ref_stride, obmc_stride, mb_x2, mb_y2, 1, 1, plane_index);
-
- //FIXME find a cleaner/simpler way to skip the outside stuff
- for(y2= y; y2<0; y2++)
- memcpy(dst + x + y2*ref_stride, src + x + y2*ref_stride, block_w);
- for(y2= h; y2<y+block_w; y2++)
- memcpy(dst + x + y2*ref_stride, src + x + y2*ref_stride, block_w);
- if(x<0){
- for(y2= y; y2<y+block_w; y2++)
- memcpy(dst + x + y2*ref_stride, src + x + y2*ref_stride, -x);
- }
- if(x+block_w > w){
- for(y2= y; y2<y+block_w; y2++)
- memcpy(dst + w + y2*ref_stride, src + w + y2*ref_stride, x+block_w - w);
- }
-
- assert(block_w== 8 || block_w==16);
- distortion += s->dsp.me_cmp[block_w==8](&s->m, src + x + y*ref_stride, dst + x + y*ref_stride, ref_stride, block_w);
- }
-
- if(plane_index==0){
- BlockNode *b= &s->block[mb_x+mb_y*b_stride];
- int merged= same_block(b,b+1) && same_block(b,b+b_stride) && same_block(b,b+b_stride+1);
-
-/* ..RRRr
- * .RXXx.
- * .RXXx.
- * rxxx.
- */
- if(merged)
- rate = get_block_bits(s, mb_x, mb_y, 2);
- for(i=merged?4:0; i<9; i++){
- static const int dxy[9][2] = {{0,0},{1,0},{0,1},{1,1},{2,0},{2,1},{-1,2},{0,2},{1,2}};
- rate += get_block_bits(s, mb_x + dxy[i][0], mb_y + dxy[i][1], 1);
- }
- }
- return distortion + rate*penalty_factor;
-}
-
-static av_always_inline int check_block(SnowContext *s, int mb_x, int mb_y, int p[3], int intra, const uint8_t *obmc_edged, int *best_rd){
- const int b_stride= s->b_width << s->block_max_depth;
- BlockNode *block= &s->block[mb_x + mb_y * b_stride];
- BlockNode backup= *block;
- int rd, index, value;
-
- assert(mb_x>=0 && mb_y>=0);
- assert(mb_x<b_stride);
-
- if(intra){
- block->color[0] = p[0];
- block->color[1] = p[1];
- block->color[2] = p[2];
- block->type |= BLOCK_INTRA;
- }else{
- index= (p[0] + 31*p[1]) & (ME_CACHE_SIZE-1);
- value= s->me_cache_generation + (p[0]>>10) + (p[1]<<6) + (block->ref<<12);
- if(s->me_cache[index] == value)
- return 0;
- s->me_cache[index]= value;
-
- block->mx= p[0];
- block->my= p[1];
- block->type &= ~BLOCK_INTRA;
- }
-
- rd= get_block_rd(s, mb_x, mb_y, 0, obmc_edged);
-
-//FIXME chroma
- if(rd < *best_rd){
- *best_rd= rd;
- return 1;
- }else{
- *block= backup;
- return 0;
- }
-}
-
-/* special case for int[2] args we discard afterward, fixes compilation prob with gcc 2.95 */
-static av_always_inline int check_block_inter(SnowContext *s, int mb_x, int mb_y, int p0, int p1, const uint8_t *obmc_edged, int *best_rd){
- int p[2] = {p0, p1};
- return check_block(s, mb_x, mb_y, p, 0, obmc_edged, best_rd);
-}
-
-static av_always_inline int check_4block_inter(SnowContext *s, int mb_x, int mb_y, int p0, int p1, int ref, int *best_rd){
- const int b_stride= s->b_width << s->block_max_depth;
- BlockNode *block= &s->block[mb_x + mb_y * b_stride];
- BlockNode backup[4]= {block[0], block[1], block[b_stride], block[b_stride+1]};
- int rd, index, value;
-
- assert(mb_x>=0 && mb_y>=0);
- assert(mb_x<b_stride);
- assert(((mb_x|mb_y)&1) == 0);
-
- index= (p0 + 31*p1) & (ME_CACHE_SIZE-1);
- value= s->me_cache_generation + (p0>>10) + (p1<<6) + (block->ref<<12);
- if(s->me_cache[index] == value)
- return 0;
- s->me_cache[index]= value;
-
- block->mx= p0;
- block->my= p1;
- block->ref= ref;
- block->type &= ~BLOCK_INTRA;
- block[1]= block[b_stride]= block[b_stride+1]= *block;
-
- rd= get_4block_rd(s, mb_x, mb_y, 0);
-
-//FIXME chroma
- if(rd < *best_rd){
- *best_rd= rd;
- return 1;
- }else{
- block[0]= backup[0];
- block[1]= backup[1];
- block[b_stride]= backup[2];
- block[b_stride+1]= backup[3];
- return 0;
- }
-}
-
-#ifdef CONFIG_ENCODERS
-static void iterative_me(SnowContext *s){
- int pass, mb_x, mb_y;
- const int b_width = s->b_width << s->block_max_depth;
- const int b_height= s->b_height << s->block_max_depth;
- const int b_stride= b_width;
- int color[3];
-
- {
- RangeCoder r = s->c;
- uint8_t state[sizeof(s->block_state)];
- memcpy(state, s->block_state, sizeof(s->block_state));
- for(mb_y= 0; mb_y<s->b_height; mb_y++)
- for(mb_x= 0; mb_x<s->b_width; mb_x++)
- encode_q_branch(s, 0, mb_x, mb_y);
- s->c = r;
- memcpy(s->block_state, state, sizeof(s->block_state));
- }
-
- for(pass=0; pass<25; pass++){
- int change= 0;
-
- for(mb_y= 0; mb_y<b_height; mb_y++){
- for(mb_x= 0; mb_x<b_width; mb_x++){
- int dia_change, i, j, ref;
- int best_rd= INT_MAX, ref_rd;
- BlockNode backup, ref_b;
- const int index= mb_x + mb_y * b_stride;
- BlockNode *block= &s->block[index];
- BlockNode *tb = mb_y ? &s->block[index-b_stride ] : NULL;
- BlockNode *lb = mb_x ? &s->block[index -1] : NULL;
- BlockNode *rb = mb_x+1<b_width ? &s->block[index +1] : NULL;
- BlockNode *bb = mb_y+1<b_height ? &s->block[index+b_stride ] : NULL;
- BlockNode *tlb= mb_x && mb_y ? &s->block[index-b_stride-1] : NULL;
- BlockNode *trb= mb_x+1<b_width && mb_y ? &s->block[index-b_stride+1] : NULL;
- BlockNode *blb= mb_x && mb_y+1<b_height ? &s->block[index+b_stride-1] : NULL;
- BlockNode *brb= mb_x+1<b_width && mb_y+1<b_height ? &s->block[index+b_stride+1] : NULL;
- const int b_w= (MB_SIZE >> s->block_max_depth);
- uint8_t obmc_edged[b_w*2][b_w*2];
-
- if(pass && (block->type & BLOCK_OPT))
- continue;
- block->type |= BLOCK_OPT;
-
- backup= *block;
-
- if(!s->me_cache_generation)
- memset(s->me_cache, 0, sizeof(s->me_cache));
- s->me_cache_generation += 1<<22;
-
- //FIXME precalc
- {
- int x, y;
- memcpy(obmc_edged, obmc_tab[s->block_max_depth], b_w*b_w*4);
- if(mb_x==0)
- for(y=0; y<b_w*2; y++)
- memset(obmc_edged[y], obmc_edged[y][0] + obmc_edged[y][b_w-1], b_w);
- if(mb_x==b_stride-1)
- for(y=0; y<b_w*2; y++)
- memset(obmc_edged[y]+b_w, obmc_edged[y][b_w] + obmc_edged[y][b_w*2-1], b_w);
- if(mb_y==0){
- for(x=0; x<b_w*2; x++)
- obmc_edged[0][x] += obmc_edged[b_w-1][x];
- for(y=1; y<b_w; y++)
- memcpy(obmc_edged[y], obmc_edged[0], b_w*2);
- }
- if(mb_y==b_height-1){
- for(x=0; x<b_w*2; x++)
- obmc_edged[b_w*2-1][x] += obmc_edged[b_w][x];
- for(y=b_w; y<b_w*2-1; y++)
- memcpy(obmc_edged[y], obmc_edged[b_w*2-1], b_w*2);
- }
- }
-
- //skip stuff outside the picture
- if(mb_x==0 || mb_y==0 || mb_x==b_width-1 || mb_y==b_height-1)
- {
- uint8_t *src= s-> input_picture.data[0];
- uint8_t *dst= s->current_picture.data[0];
- const int stride= s->current_picture.linesize[0];
- const int block_w= MB_SIZE >> s->block_max_depth;
- const int sx= block_w*mb_x - block_w/2;
- const int sy= block_w*mb_y - block_w/2;
- const int w= s->plane[0].width;
- const int h= s->plane[0].height;
- int y;
-
- for(y=sy; y<0; y++)
- memcpy(dst + sx + y*stride, src + sx + y*stride, block_w*2);
- for(y=h; y<sy+block_w*2; y++)
- memcpy(dst + sx + y*stride, src + sx + y*stride, block_w*2);
- if(sx<0){
- for(y=sy; y<sy+block_w*2; y++)
- memcpy(dst + sx + y*stride, src + sx + y*stride, -sx);
- }
- if(sx+block_w*2 > w){
- for(y=sy; y<sy+block_w*2; y++)
- memcpy(dst + w + y*stride, src + w + y*stride, sx+block_w*2 - w);
- }
- }
-
- // intra(black) = neighbors' contribution to the current block
- for(i=0; i<3; i++)
- color[i]= get_dc(s, mb_x, mb_y, i);
-
- // get previous score (cant be cached due to OBMC)
- if(pass > 0 && (block->type&BLOCK_INTRA)){
- int color0[3]= {block->color[0], block->color[1], block->color[2]};
- check_block(s, mb_x, mb_y, color0, 1, *obmc_edged, &best_rd);
- }else
- check_block_inter(s, mb_x, mb_y, block->mx, block->my, *obmc_edged, &best_rd);
-
- ref_b= *block;
- ref_rd= best_rd;
- for(ref=0; ref < s->ref_frames; ref++){
- int16_t (*mvr)[2]= &s->ref_mvs[ref][index];
- if(s->ref_scores[ref][index] > s->ref_scores[ref_b.ref][index]*3/2) //FIXME tune threshold
- continue;
- block->ref= ref;
- best_rd= INT_MAX;
-
- check_block_inter(s, mb_x, mb_y, mvr[0][0], mvr[0][1], *obmc_edged, &best_rd);
- check_block_inter(s, mb_x, mb_y, 0, 0, *obmc_edged, &best_rd);
- if(tb)
- check_block_inter(s, mb_x, mb_y, mvr[-b_stride][0], mvr[-b_stride][1], *obmc_edged, &best_rd);
- if(lb)
- check_block_inter(s, mb_x, mb_y, mvr[-1][0], mvr[-1][1], *obmc_edged, &best_rd);
- if(rb)
- check_block_inter(s, mb_x, mb_y, mvr[1][0], mvr[1][1], *obmc_edged, &best_rd);
- if(bb)
- check_block_inter(s, mb_x, mb_y, mvr[b_stride][0], mvr[b_stride][1], *obmc_edged, &best_rd);
-
- /* fullpel ME */
- //FIXME avoid subpel interpol / round to nearest integer
- do{
- dia_change=0;
- for(i=0; i<FFMAX(s->avctx->dia_size, 1); i++){
- for(j=0; j<i; j++){
- dia_change |= check_block_inter(s, mb_x, mb_y, block->mx+4*(i-j), block->my+(4*j), *obmc_edged, &best_rd);
- dia_change |= check_block_inter(s, mb_x, mb_y, block->mx-4*(i-j), block->my-(4*j), *obmc_edged, &best_rd);
- dia_change |= check_block_inter(s, mb_x, mb_y, block->mx+4*(i-j), block->my-(4*j), *obmc_edged, &best_rd);
- dia_change |= check_block_inter(s, mb_x, mb_y, block->mx-4*(i-j), block->my+(4*j), *obmc_edged, &best_rd);
- }
- }
- }while(dia_change);
- /* subpel ME */
- do{
- static const int square[8][2]= {{+1, 0},{-1, 0},{ 0,+1},{ 0,-1},{+1,+1},{-1,-1},{+1,-1},{-1,+1},};
- dia_change=0;
- for(i=0; i<8; i++)
- dia_change |= check_block_inter(s, mb_x, mb_y, block->mx+square[i][0], block->my+square[i][1], *obmc_edged, &best_rd);
- }while(dia_change);
- //FIXME or try the standard 2 pass qpel or similar
-
- mvr[0][0]= block->mx;
- mvr[0][1]= block->my;
- if(ref_rd > best_rd){
- ref_rd= best_rd;
- ref_b= *block;
- }
- }
- best_rd= ref_rd;
- *block= ref_b;
-#if 1
- check_block(s, mb_x, mb_y, color, 1, *obmc_edged, &best_rd);
- //FIXME RD style color selection
-#endif
- if(!same_block(block, &backup)){
- if(tb ) tb ->type &= ~BLOCK_OPT;
- if(lb ) lb ->type &= ~BLOCK_OPT;
- if(rb ) rb ->type &= ~BLOCK_OPT;
- if(bb ) bb ->type &= ~BLOCK_OPT;
- if(tlb) tlb->type &= ~BLOCK_OPT;
- if(trb) trb->type &= ~BLOCK_OPT;
- if(blb) blb->type &= ~BLOCK_OPT;
- if(brb) brb->type &= ~BLOCK_OPT;
- change ++;
- }
- }
- }
- av_log(NULL, AV_LOG_ERROR, "pass:%d changed:%d\n", pass, change);
- if(!change)
- break;
- }
-
- if(s->block_max_depth == 1){
- int change= 0;
- for(mb_y= 0; mb_y<b_height; mb_y+=2){
- for(mb_x= 0; mb_x<b_width; mb_x+=2){
- int i;
- int best_rd, init_rd;
- const int index= mb_x + mb_y * b_stride;
- BlockNode *b[4];
-
- b[0]= &s->block[index];
- b[1]= b[0]+1;
- b[2]= b[0]+b_stride;
- b[3]= b[2]+1;
- if(same_block(b[0], b[1]) &&
- same_block(b[0], b[2]) &&
- same_block(b[0], b[3]))
- continue;
-
- if(!s->me_cache_generation)
- memset(s->me_cache, 0, sizeof(s->me_cache));
- s->me_cache_generation += 1<<22;
-
- init_rd= best_rd= get_4block_rd(s, mb_x, mb_y, 0);
-
- //FIXME more multiref search?
- check_4block_inter(s, mb_x, mb_y,
- (b[0]->mx + b[1]->mx + b[2]->mx + b[3]->mx + 2) >> 2,
- (b[0]->my + b[1]->my + b[2]->my + b[3]->my + 2) >> 2, 0, &best_rd);
-
- for(i=0; i<4; i++)
- if(!(b[i]->type&BLOCK_INTRA))
- check_4block_inter(s, mb_x, mb_y, b[i]->mx, b[i]->my, b[i]->ref, &best_rd);
-
- if(init_rd != best_rd)
- change++;
- }
- }
- av_log(NULL, AV_LOG_ERROR, "pass:4mv changed:%d\n", change*4);
- }
-}
-#endif
-
-static void quantize(SnowContext *s, SubBand *b, DWTELEM *src, int stride, int bias){
- const int level= b->level;
- const int w= b->width;
- const int h= b->height;
- const int qlog= clip(s->qlog + b->qlog, 0, QROOT*16);
- const int qmul= qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT);
- int x,y, thres1, thres2;
-// START_TIMER
-
- if(s->qlog == LOSSLESS_QLOG) return;
-
- bias= bias ? 0 : (3*qmul)>>3;
- thres1= ((qmul - bias)>>QEXPSHIFT) - 1;
- thres2= 2*thres1;
-
- if(!bias){
- for(y=0; y<h; y++){
- for(x=0; x<w; x++){
- int i= src[x + y*stride];
-
- if((unsigned)(i+thres1) > thres2){
- if(i>=0){
- i<<= QEXPSHIFT;
- i/= qmul; //FIXME optimize
- src[x + y*stride]= i;
- }else{
- i= -i;
- i<<= QEXPSHIFT;
- i/= qmul; //FIXME optimize
- src[x + y*stride]= -i;
- }
- }else
- src[x + y*stride]= 0;
- }
- }
- }else{
- for(y=0; y<h; y++){
- for(x=0; x<w; x++){
- int i= src[x + y*stride];
-
- if((unsigned)(i+thres1) > thres2){
- if(i>=0){
- i<<= QEXPSHIFT;
- i= (i + bias) / qmul; //FIXME optimize
- src[x + y*stride]= i;
- }else{
- i= -i;
- i<<= QEXPSHIFT;
- i= (i + bias) / qmul; //FIXME optimize
- src[x + y*stride]= -i;
- }
- }else
- src[x + y*stride]= 0;
- }
- }
- }
- if(level+1 == s->spatial_decomposition_count){
-// STOP_TIMER("quantize")
- }
-}
-
-static void dequantize_slice_buffered(SnowContext *s, slice_buffer * sb, SubBand *b, DWTELEM *src, int stride, int start_y, int end_y){
- const int w= b->width;
- const int qlog= clip(s->qlog + b->qlog, 0, QROOT*16);
- const int qmul= qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT);
- const int qadd= (s->qbias*qmul)>>QBIAS_SHIFT;
- int x,y;
- START_TIMER
-
- if(s->qlog == LOSSLESS_QLOG) return;
-
- for(y=start_y; y<end_y; y++){
-// DWTELEM * line = slice_buffer_get_line_from_address(sb, src + (y * stride));
- DWTELEM * line = slice_buffer_get_line(sb, (y * b->stride_line) + b->buf_y_offset) + b->buf_x_offset;
- for(x=0; x<w; x++){
- int i= line[x];
- if(i<0){
- line[x]= -((-i*qmul + qadd)>>(QEXPSHIFT)); //FIXME try different bias
- }else if(i>0){
- line[x]= (( i*qmul + qadd)>>(QEXPSHIFT));
- }
- }
- }
- if(w > 200 /*level+1 == s->spatial_decomposition_count*/){
- STOP_TIMER("dquant")
- }
-}
-
-static void dequantize(SnowContext *s, SubBand *b, DWTELEM *src, int stride){
- const int w= b->width;
- const int h= b->height;
- const int qlog= clip(s->qlog + b->qlog, 0, QROOT*16);
- const int qmul= qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT);
- const int qadd= (s->qbias*qmul)>>QBIAS_SHIFT;
- int x,y;
- START_TIMER
-
- if(s->qlog == LOSSLESS_QLOG) return;
-
- for(y=0; y<h; y++){
- for(x=0; x<w; x++){
- int i= src[x + y*stride];
- if(i<0){
- src[x + y*stride]= -((-i*qmul + qadd)>>(QEXPSHIFT)); //FIXME try different bias
- }else if(i>0){
- src[x + y*stride]= (( i*qmul + qadd)>>(QEXPSHIFT));
- }
- }
- }
- if(w > 200 /*level+1 == s->spatial_decomposition_count*/){
- STOP_TIMER("dquant")
- }
-}
-
-static void decorrelate(SnowContext *s, SubBand *b, DWTELEM *src, int stride, int inverse, int use_median){
- const int w= b->width;
- const int h= b->height;
- int x,y;
-
- for(y=h-1; y>=0; y--){
- for(x=w-1; x>=0; x--){
- int i= x + y*stride;
-
- if(x){
- if(use_median){
- if(y && x+1<w) src[i] -= mid_pred(src[i - 1], src[i - stride], src[i - stride + 1]);
- else src[i] -= src[i - 1];
- }else{
- if(y) src[i] -= mid_pred(src[i - 1], src[i - stride], src[i - 1] + src[i - stride] - src[i - 1 - stride]);
- else src[i] -= src[i - 1];
- }
- }else{
- if(y) src[i] -= src[i - stride];
- }
- }
- }
-}
-
-static void correlate_slice_buffered(SnowContext *s, slice_buffer * sb, SubBand *b, DWTELEM *src, int stride, int inverse, int use_median, int start_y, int end_y){
- const int w= b->width;
- int x,y;
-
-// START_TIMER
-
- DWTELEM * line=0; // silence silly "could be used without having been initialized" warning
- DWTELEM * prev;
-
- if (start_y != 0)
- line = slice_buffer_get_line(sb, ((start_y - 1) * b->stride_line) + b->buf_y_offset) + b->buf_x_offset;
-
- for(y=start_y; y<end_y; y++){
- prev = line;
-// line = slice_buffer_get_line_from_address(sb, src + (y * stride));
- line = slice_buffer_get_line(sb, (y * b->stride_line) + b->buf_y_offset) + b->buf_x_offset;
- for(x=0; x<w; x++){
- if(x){
- if(use_median){
- if(y && x+1<w) line[x] += mid_pred(line[x - 1], prev[x], prev[x + 1]);
- else line[x] += line[x - 1];
- }else{
- if(y) line[x] += mid_pred(line[x - 1], prev[x], line[x - 1] + prev[x] - prev[x - 1]);
- else line[x] += line[x - 1];
- }
- }else{
- if(y) line[x] += prev[x];
- }
- }
- }
-
-// STOP_TIMER("correlate")
-}
-
-static void correlate(SnowContext *s, SubBand *b, DWTELEM *src, int stride, int inverse, int use_median){
- const int w= b->width;
- const int h= b->height;
- int x,y;
-
- for(y=0; y<h; y++){
- for(x=0; x<w; x++){
- int i= x + y*stride;
-
- if(x){
- if(use_median){
- if(y && x+1<w) src[i] += mid_pred(src[i - 1], src[i - stride], src[i - stride + 1]);
- else src[i] += src[i - 1];
- }else{
- if(y) src[i] += mid_pred(src[i - 1], src[i - stride], src[i - 1] + src[i - stride] - src[i - 1 - stride]);
- else src[i] += src[i - 1];
- }
- }else{
- if(y) src[i] += src[i - stride];
- }
- }
- }
-}
-
-static void encode_header(SnowContext *s){
- int plane_index, level, orientation;
- uint8_t kstate[32];
-
- memset(kstate, MID_STATE, sizeof(kstate));
-
- put_rac(&s->c, kstate, s->keyframe);
- if(s->keyframe || s->always_reset){
- reset_contexts(s);
- s->last_spatial_decomposition_type=
- s->last_qlog=
- s->last_qbias=
- s->last_mv_scale=
- s->last_block_max_depth= 0;
- }
- if(s->keyframe){
- put_symbol(&s->c, s->header_state, s->version, 0);
- put_rac(&s->c, s->header_state, s->always_reset);
- put_symbol(&s->c, s->header_state, s->temporal_decomposition_type, 0);
- put_symbol(&s->c, s->header_state, s->temporal_decomposition_count, 0);
- put_symbol(&s->c, s->header_state, s->spatial_decomposition_count, 0);
- put_symbol(&s->c, s->header_state, s->colorspace_type, 0);
- put_symbol(&s->c, s->header_state, s->chroma_h_shift, 0);
- put_symbol(&s->c, s->header_state, s->chroma_v_shift, 0);
- put_rac(&s->c, s->header_state, s->spatial_scalability);
-// put_rac(&s->c, s->header_state, s->rate_scalability);
- put_symbol(&s->c, s->header_state, s->max_ref_frames-1, 0);
-
- for(plane_index=0; plane_index<2; plane_index++){
- for(level=0; level<s->spatial_decomposition_count; level++){
- for(orientation=level ? 1:0; orientation<4; orientation++){
- if(orientation==2) continue;
- put_symbol(&s->c, s->header_state, s->plane[plane_index].band[level][orientation].qlog, 1);
- }
- }
- }
- }
- put_symbol(&s->c, s->header_state, s->spatial_decomposition_type - s->last_spatial_decomposition_type, 1);
- put_symbol(&s->c, s->header_state, s->qlog - s->last_qlog , 1);
- put_symbol(&s->c, s->header_state, s->mv_scale - s->last_mv_scale, 1);
- put_symbol(&s->c, s->header_state, s->qbias - s->last_qbias , 1);
- put_symbol(&s->c, s->header_state, s->block_max_depth - s->last_block_max_depth, 1);
-
- s->last_spatial_decomposition_type= s->spatial_decomposition_type;
- s->last_qlog = s->qlog;
- s->last_qbias = s->qbias;
- s->last_mv_scale = s->mv_scale;
- s->last_block_max_depth = s->block_max_depth;
-}
-
-static int decode_header(SnowContext *s){
- int plane_index, level, orientation;
- uint8_t kstate[32];
-
- memset(kstate, MID_STATE, sizeof(kstate));
-
- s->keyframe= get_rac(&s->c, kstate);
- if(s->keyframe || s->always_reset){
- reset_contexts(s);
- s->spatial_decomposition_type=
- s->qlog=
- s->qbias=
- s->mv_scale=
- s->block_max_depth= 0;
- }
- if(s->keyframe){
- s->version= get_symbol(&s->c, s->header_state, 0);
- if(s->version>0){
- av_log(s->avctx, AV_LOG_ERROR, "version %d not supported", s->version);
- return -1;
- }
- s->always_reset= get_rac(&s->c, s->header_state);
- s->temporal_decomposition_type= get_symbol(&s->c, s->header_state, 0);
- s->temporal_decomposition_count= get_symbol(&s->c, s->header_state, 0);
- s->spatial_decomposition_count= get_symbol(&s->c, s->header_state, 0);
- s->colorspace_type= get_symbol(&s->c, s->header_state, 0);
- s->chroma_h_shift= get_symbol(&s->c, s->header_state, 0);
- s->chroma_v_shift= get_symbol(&s->c, s->header_state, 0);
- s->spatial_scalability= get_rac(&s->c, s->header_state);
-// s->rate_scalability= get_rac(&s->c, s->header_state);
- s->max_ref_frames= get_symbol(&s->c, s->header_state, 0)+1;
-
- for(plane_index=0; plane_index<3; plane_index++){
- for(level=0; level<s->spatial_decomposition_count; level++){
- for(orientation=level ? 1:0; orientation<4; orientation++){
- int q;
- if (plane_index==2) q= s->plane[1].band[level][orientation].qlog;
- else if(orientation==2) q= s->plane[plane_index].band[level][1].qlog;
- else q= get_symbol(&s->c, s->header_state, 1);
- s->plane[plane_index].band[level][orientation].qlog= q;
- }
- }
- }
- }
-
- s->spatial_decomposition_type+= get_symbol(&s->c, s->header_state, 1);
- if(s->spatial_decomposition_type > 2){
- av_log(s->avctx, AV_LOG_ERROR, "spatial_decomposition_type %d not supported", s->spatial_decomposition_type);
- return -1;
- }
-
- s->qlog += get_symbol(&s->c, s->header_state, 1);
- s->mv_scale += get_symbol(&s->c, s->header_state, 1);
- s->qbias += get_symbol(&s->c, s->header_state, 1);
- s->block_max_depth+= get_symbol(&s->c, s->header_state, 1);
- if(s->block_max_depth > 1 || s->block_max_depth < 0){
- av_log(s->avctx, AV_LOG_ERROR, "block_max_depth= %d is too large", s->block_max_depth);
- s->block_max_depth= 0;
- return -1;
- }
-
- return 0;
-}
-
-static void init_qexp(void){
- int i;
- double v=128;
-
- for(i=0; i<QROOT; i++){
- qexp[i]= lrintf(v);
- v *= pow(2, 1.0 / QROOT);
- }
-}
-
-static int common_init(AVCodecContext *avctx){
- SnowContext *s = avctx->priv_data;
- int width, height;
- int level, orientation, plane_index, dec;
- int i, j;
-
- s->avctx= avctx;
-
- dsputil_init(&s->dsp, avctx);
-
-#define mcf(dx,dy)\
- s->dsp.put_qpel_pixels_tab [0][dy+dx/4]=\
- s->dsp.put_no_rnd_qpel_pixels_tab[0][dy+dx/4]=\
- s->dsp.put_h264_qpel_pixels_tab[0][dy+dx/4];\
- s->dsp.put_qpel_pixels_tab [1][dy+dx/4]=\
- s->dsp.put_no_rnd_qpel_pixels_tab[1][dy+dx/4]=\
- s->dsp.put_h264_qpel_pixels_tab[1][dy+dx/4];
-
- mcf( 0, 0)
- mcf( 4, 0)
- mcf( 8, 0)
- mcf(12, 0)
- mcf( 0, 4)
- mcf( 4, 4)
- mcf( 8, 4)
- mcf(12, 4)
- mcf( 0, 8)
- mcf( 4, 8)
- mcf( 8, 8)
- mcf(12, 8)
- mcf( 0,12)
- mcf( 4,12)
- mcf( 8,12)
- mcf(12,12)
-
-#define mcfh(dx,dy)\
- s->dsp.put_pixels_tab [0][dy/4+dx/8]=\
- s->dsp.put_no_rnd_pixels_tab[0][dy/4+dx/8]=\
- mc_block_hpel ## dx ## dy ## 16;\
- s->dsp.put_pixels_tab [1][dy/4+dx/8]=\
- s->dsp.put_no_rnd_pixels_tab[1][dy/4+dx/8]=\
- mc_block_hpel ## dx ## dy ## 8;
-
- mcfh(0, 0)
- mcfh(8, 0)
- mcfh(0, 8)
- mcfh(8, 8)
-
- if(!qexp[0])
- init_qexp();
-
- dec= s->spatial_decomposition_count= 5;
- s->spatial_decomposition_type= avctx->prediction_method; //FIXME add decorrelator type r transform_type
-
- s->chroma_h_shift= 1; //FIXME XXX
- s->chroma_v_shift= 1;
-
-// dec += FFMAX(s->chroma_h_shift, s->chroma_v_shift);
-
- width= s->avctx->width;
- height= s->avctx->height;
-
- s->spatial_dwt_buffer= av_mallocz(width*height*sizeof(DWTELEM));
-
- s->mv_scale= (s->avctx->flags & CODEC_FLAG_QPEL) ? 2 : 4;
- s->block_max_depth= (s->avctx->flags & CODEC_FLAG_4MV) ? 1 : 0;
-
- for(plane_index=0; plane_index<3; plane_index++){
- int w= s->avctx->width;
- int h= s->avctx->height;
-
- if(plane_index){
- w>>= s->chroma_h_shift;
- h>>= s->chroma_v_shift;
- }
- s->plane[plane_index].width = w;
- s->plane[plane_index].height= h;
-//av_log(NULL, AV_LOG_DEBUG, "%d %d\n", w, h);
- for(level=s->spatial_decomposition_count-1; level>=0; level--){
- for(orientation=level ? 1 : 0; orientation<4; orientation++){
- SubBand *b= &s->plane[plane_index].band[level][orientation];
-
- b->buf= s->spatial_dwt_buffer;
- b->level= level;
- b->stride= s->plane[plane_index].width << (s->spatial_decomposition_count - level);
- b->width = (w + !(orientation&1))>>1;
- b->height= (h + !(orientation>1))>>1;
-
- b->stride_line = 1 << (s->spatial_decomposition_count - level);
- b->buf_x_offset = 0;
- b->buf_y_offset = 0;
-
- if(orientation&1){
- b->buf += (w+1)>>1;
- b->buf_x_offset = (w+1)>>1;
- }
- if(orientation>1){
- b->buf += b->stride>>1;
- b->buf_y_offset = b->stride_line >> 1;
- }
-
- if(level)
- b->parent= &s->plane[plane_index].band[level-1][orientation];
- b->x_coeff=av_mallocz(((b->width+1) * b->height+1)*sizeof(x_and_coeff));
- }
- w= (w+1)>>1;
- h= (h+1)>>1;
- }
- }
-
- for(i=0; i<MAX_REF_FRAMES; i++)
- for(j=0; j<MAX_REF_FRAMES; j++)
- scale_mv_ref[i][j] = 256*(i+1)/(j+1);
-
- reset_contexts(s);
-/*
- width= s->width= avctx->width;
- height= s->height= avctx->height;
-
- assert(width && height);
-*/
- s->avctx->get_buffer(s->avctx, &s->mconly_picture);
-
- return 0;
-}
-
-static int qscale2qlog(int qscale){
- return rint(QROOT*log(qscale / (float)FF_QP2LAMBDA)/log(2))
- + 61*QROOT/8; //<64 >60
-}
-
-static int ratecontrol_1pass(SnowContext *s, AVFrame *pict)
-{
- /* estimate the frame's complexity as a sum of weighted dwt coefs.
- * FIXME we know exact mv bits at this point,
- * but ratecontrol isn't set up to include them. */
- uint32_t coef_sum= 0;
- int level, orientation, delta_qlog;
-
- for(level=0; level<s->spatial_decomposition_count; level++){
- for(orientation=level ? 1 : 0; orientation<4; orientation++){
- SubBand *b= &s->plane[0].band[level][orientation];
- DWTELEM *buf= b->buf;
- const int w= b->width;
- const int h= b->height;
- const int stride= b->stride;
- const int qlog= clip(2*QROOT + b->qlog, 0, QROOT*16);
- const int qmul= qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT);
- const int qdiv= (1<<16)/qmul;
- int x, y;
- if(orientation==0)
- decorrelate(s, b, buf, stride, 1, 0);
- for(y=0; y<h; y++)
- for(x=0; x<w; x++)
- coef_sum+= abs(buf[x+y*stride]) * qdiv >> 16;
- if(orientation==0)
- correlate(s, b, buf, stride, 1, 0);
- }
- }
-
- /* ugly, ratecontrol just takes a sqrt again */
- coef_sum = (uint64_t)coef_sum * coef_sum >> 16;
- assert(coef_sum < INT_MAX);
-
- if(pict->pict_type == I_TYPE){
- s->m.current_picture.mb_var_sum= coef_sum;
- s->m.current_picture.mc_mb_var_sum= 0;
- }else{
- s->m.current_picture.mc_mb_var_sum= coef_sum;
- s->m.current_picture.mb_var_sum= 0;
- }
-
- pict->quality= ff_rate_estimate_qscale(&s->m, 1);
- if (pict->quality < 0)
- return INT_MIN;
- s->lambda= pict->quality * 3/2;
- delta_qlog= qscale2qlog(pict->quality) - s->qlog;
- s->qlog+= delta_qlog;
- return delta_qlog;
-}
-
-static void calculate_vissual_weight(SnowContext *s, Plane *p){
- int width = p->width;
- int height= p->height;
- int level, orientation, x, y;
-
- for(level=0; level<s->spatial_decomposition_count; level++){
- for(orientation=level ? 1 : 0; orientation<4; orientation++){
- SubBand *b= &p->band[level][orientation];
- DWTELEM *buf= b->buf;
- int64_t error=0;
-
- memset(s->spatial_dwt_buffer, 0, sizeof(int)*width*height);
- buf[b->width/2 + b->height/2*b->stride]= 256*256;
- ff_spatial_idwt(s->spatial_dwt_buffer, width, height, width, s->spatial_decomposition_type, s->spatial_decomposition_count);
- for(y=0; y<height; y++){
- for(x=0; x<width; x++){
- int64_t d= s->spatial_dwt_buffer[x + y*width];
- error += d*d;
- }
- }
-
- b->qlog= (int)(log(352256.0/sqrt(error)) / log(pow(2.0, 1.0/QROOT))+0.5);
-// av_log(NULL, AV_LOG_DEBUG, "%d %d %d\n", level, orientation, b->qlog/*, sqrt(error)*/);
- }
- }
-}
-
-#ifdef CONFIG_ENCODERS
-static int encode_init(AVCodecContext *avctx)
-{
- SnowContext *s = avctx->priv_data;
- int plane_index;
-
- if(avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL){
- av_log(avctx, AV_LOG_ERROR, "this codec is under development, files encoded with it may not be decodable with future versions!!!\n"
- "use vstrict=-2 / -strict -2 to use it anyway\n");
- return -1;
- }
-
- if(avctx->prediction_method == DWT_97
- && (avctx->flags & CODEC_FLAG_QSCALE)
- && avctx->global_quality == 0){
- av_log(avctx, AV_LOG_ERROR, "the 9/7 wavelet is incompatible with lossless mode\n");
- return -1;
- }
-
- common_init(avctx);
- alloc_blocks(s);
-
- s->version=0;
-
- s->m.avctx = avctx;
- s->m.flags = avctx->flags;
- s->m.bit_rate= avctx->bit_rate;
-
- s->m.me.scratchpad= av_mallocz((avctx->width+64)*2*16*2*sizeof(uint8_t));
- s->m.me.map = av_mallocz(ME_MAP_SIZE*sizeof(uint32_t));
- s->m.me.score_map = av_mallocz(ME_MAP_SIZE*sizeof(uint32_t));
- s->m.obmc_scratchpad= av_mallocz(MB_SIZE*MB_SIZE*12*sizeof(uint32_t));
- h263_encode_init(&s->m); //mv_penalty
-
- s->max_ref_frames = FFMAX(FFMIN(avctx->refs, MAX_REF_FRAMES), 1);
-
- if(avctx->flags&CODEC_FLAG_PASS1){
- if(!avctx->stats_out)
- avctx->stats_out = av_mallocz(256);
- }
- if((avctx->flags&CODEC_FLAG_PASS2) || !(avctx->flags&CODEC_FLAG_QSCALE)){
- if(ff_rate_control_init(&s->m) < 0)
- return -1;
- }
- s->pass1_rc= !(avctx->flags & (CODEC_FLAG_QSCALE|CODEC_FLAG_PASS2));
-
- for(plane_index=0; plane_index<3; plane_index++){
- calculate_vissual_weight(s, &s->plane[plane_index]);
- }
-
-
- avctx->coded_frame= &s->current_picture;
- switch(avctx->pix_fmt){
-// case PIX_FMT_YUV444P:
-// case PIX_FMT_YUV422P:
- case PIX_FMT_YUV420P:
- case PIX_FMT_GRAY8:
-// case PIX_FMT_YUV411P:
-// case PIX_FMT_YUV410P:
- s->colorspace_type= 0;
- break;
-/* case PIX_FMT_RGBA32:
- s->colorspace= 1;
- break;*/
- default:
- av_log(avctx, AV_LOG_ERROR, "format not supported\n");
- return -1;
- }
-// avcodec_get_chroma_sub_sample(avctx->pix_fmt, &s->chroma_h_shift, &s->chroma_v_shift);
- s->chroma_h_shift= 1;
- s->chroma_v_shift= 1;
-
- ff_set_cmp(&s->dsp, s->dsp.me_cmp, s->avctx->me_cmp);
- ff_set_cmp(&s->dsp, s->dsp.me_sub_cmp, s->avctx->me_sub_cmp);
-
- s->avctx->get_buffer(s->avctx, &s->input_picture);
-
- if(s->avctx->me_method == ME_ITER){
- int i;
- int size= s->b_width * s->b_height << 2*s->block_max_depth;
- for(i=0; i<s->max_ref_frames; i++){
- s->ref_mvs[i]= av_mallocz(size*sizeof(int16_t[2]));
- s->ref_scores[i]= av_mallocz(size*sizeof(uint32_t));
- }
- }
-
- return 0;
-}
-#endif
-
-static int frame_start(SnowContext *s){
- AVFrame tmp;
- int w= s->avctx->width; //FIXME round up to x16 ?
- int h= s->avctx->height;
-
- if(s->current_picture.data[0]){
- draw_edges(s->current_picture.data[0], s->current_picture.linesize[0], w , h , EDGE_WIDTH );
- draw_edges(s->current_picture.data[1], s->current_picture.linesize[1], w>>1, h>>1, EDGE_WIDTH/2);
- draw_edges(s->current_picture.data[2], s->current_picture.linesize[2], w>>1, h>>1, EDGE_WIDTH/2);
- }
-
- tmp= s->last_picture[s->max_ref_frames-1];
- memmove(s->last_picture+1, s->last_picture, (s->max_ref_frames-1)*sizeof(AVFrame));
- s->last_picture[0]= s->current_picture;
- s->current_picture= tmp;
-
- if(s->keyframe){
- s->ref_frames= 0;
- }else{
- int i;
- for(i=0; i<s->max_ref_frames && s->last_picture[i].data[0]; i++)
- if(i && s->last_picture[i-1].key_frame)
- break;
- s->ref_frames= i;
- }
-
- s->current_picture.reference= 1;
- if(s->avctx->get_buffer(s->avctx, &s->current_picture) < 0){
- av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
-
- s->current_picture.key_frame= s->keyframe;
-
- return 0;
-}
-
-#ifdef CONFIG_ENCODERS
-static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){
- SnowContext *s = avctx->priv_data;
- RangeCoder * const c= &s->c;
- AVFrame *pict = data;
- const int width= s->avctx->width;
- const int height= s->avctx->height;
- int level, orientation, plane_index, i, y;
- uint8_t rc_header_bak[sizeof(s->header_state)];
- uint8_t rc_block_bak[sizeof(s->block_state)];
-
- ff_init_range_encoder(c, buf, buf_size);
- ff_build_rac_states(c, 0.05*(1LL<<32), 256-8);
-
- for(i=0; i<3; i++){
- int shift= !!i;
- for(y=0; y<(height>>shift); y++)
- memcpy(&s->input_picture.data[i][y * s->input_picture.linesize[i]],
- &pict->data[i][y * pict->linesize[i]],
- width>>shift);
- }
- s->new_picture = *pict;
-
- s->m.picture_number= avctx->frame_number;
- if(avctx->flags&CODEC_FLAG_PASS2){
- s->m.pict_type =
- pict->pict_type= s->m.rc_context.entry[avctx->frame_number].new_pict_type;
- s->keyframe= pict->pict_type==FF_I_TYPE;
- if(!(avctx->flags&CODEC_FLAG_QSCALE)) {
- pict->quality= ff_rate_estimate_qscale(&s->m, 0);
- if (pict->quality < 0)
- return -1;
- }
- }else{
- s->keyframe= avctx->gop_size==0 || avctx->frame_number % avctx->gop_size == 0;
- s->m.pict_type=
- pict->pict_type= s->keyframe ? FF_I_TYPE : FF_P_TYPE;
- }
-
- if(s->pass1_rc && avctx->frame_number == 0)
- pict->quality= 2*FF_QP2LAMBDA;
- if(pict->quality){
- s->qlog= qscale2qlog(pict->quality);
- s->lambda = pict->quality * 3/2;
- }
- if(s->qlog < 0 || (!pict->quality && (avctx->flags & CODEC_FLAG_QSCALE))){
- s->qlog= LOSSLESS_QLOG;
- s->lambda = 0;
- }//else keep previous frame's qlog until after motion est
-
- frame_start(s);
-
- s->m.current_picture_ptr= &s->m.current_picture;
- if(pict->pict_type == P_TYPE){
- int block_width = (width +15)>>4;
- int block_height= (height+15)>>4;
- int stride= s->current_picture.linesize[0];
-
- assert(s->current_picture.data[0]);
- assert(s->last_picture[0].data[0]);
-
- s->m.avctx= s->avctx;
- s->m.current_picture.data[0]= s->current_picture.data[0];
- s->m. last_picture.data[0]= s->last_picture[0].data[0];
- s->m. new_picture.data[0]= s-> input_picture.data[0];
- s->m. last_picture_ptr= &s->m. last_picture;
- s->m.linesize=
- s->m. last_picture.linesize[0]=
- s->m. new_picture.linesize[0]=
- s->m.current_picture.linesize[0]= stride;
- s->m.uvlinesize= s->current_picture.linesize[1];
- s->m.width = width;
- s->m.height= height;
- s->m.mb_width = block_width;
- s->m.mb_height= block_height;
- s->m.mb_stride= s->m.mb_width+1;
- s->m.b8_stride= 2*s->m.mb_width+1;
- s->m.f_code=1;
- s->m.pict_type= pict->pict_type;
- s->m.me_method= s->avctx->me_method;
- s->m.me.scene_change_score=0;
- s->m.flags= s->avctx->flags;
- s->m.quarter_sample= (s->avctx->flags & CODEC_FLAG_QPEL)!=0;
- s->m.out_format= FMT_H263;
- s->m.unrestricted_mv= 1;
-
- s->m.lambda = s->lambda;
- s->m.qscale= (s->m.lambda*139 + FF_LAMBDA_SCALE*64) >> (FF_LAMBDA_SHIFT + 7);
- s->lambda2= s->m.lambda2= (s->m.lambda*s->m.lambda + FF_LAMBDA_SCALE/2) >> FF_LAMBDA_SHIFT;
-
- s->m.dsp= s->dsp; //move
- ff_init_me(&s->m);
- s->dsp= s->m.dsp;
- }
-
- if(s->pass1_rc){
- memcpy(rc_header_bak, s->header_state, sizeof(s->header_state));
- memcpy(rc_block_bak, s->block_state, sizeof(s->block_state));
- }
-
-redo_frame:
-
- s->m.pict_type = pict->pict_type;
- s->qbias= pict->pict_type == P_TYPE ? 2 : 0;
-
- encode_header(s);
- s->m.misc_bits = 8*(s->c.bytestream - s->c.bytestream_start);
- encode_blocks(s, 1);
- s->m.mv_bits = 8*(s->c.bytestream - s->c.bytestream_start) - s->m.misc_bits;
-
- for(plane_index=0; plane_index<3; plane_index++){
- Plane *p= &s->plane[plane_index];
- int w= p->width;
- int h= p->height;
- int x, y;
-// int bits= put_bits_count(&s->c.pb);
-
- if(!(avctx->flags2 & CODEC_FLAG2_MEMC_ONLY)){
- //FIXME optimize
- if(pict->data[plane_index]) //FIXME gray hack
- for(y=0; y<h; y++){
- for(x=0; x<w; x++){
- s->spatial_dwt_buffer[y*w + x]= pict->data[plane_index][y*pict->linesize[plane_index] + x]<<FRAC_BITS;
- }
- }
- predict_plane(s, s->spatial_dwt_buffer, plane_index, 0);
-
- if( plane_index==0
- && pict->pict_type == P_TYPE
- && !(avctx->flags&CODEC_FLAG_PASS2)
- && s->m.me.scene_change_score > s->avctx->scenechange_threshold){
- ff_init_range_encoder(c, buf, buf_size);
- ff_build_rac_states(c, 0.05*(1LL<<32), 256-8);
- pict->pict_type= FF_I_TYPE;
- s->keyframe=1;
- s->current_picture.key_frame=1;
- goto redo_frame;
- }
-
- if(s->qlog == LOSSLESS_QLOG){
- for(y=0; y<h; y++){
- for(x=0; x<w; x++){
- s->spatial_dwt_buffer[y*w + x]= (s->spatial_dwt_buffer[y*w + x] + (1<<(FRAC_BITS-1))-1)>>FRAC_BITS;
- }
- }
- }
-
- ff_spatial_dwt(s->spatial_dwt_buffer, w, h, w, s->spatial_decomposition_type, s->spatial_decomposition_count);
-
- if(s->pass1_rc && plane_index==0){
- int delta_qlog = ratecontrol_1pass(s, pict);
- if (delta_qlog <= INT_MIN)
- return -1;
- if(delta_qlog){
- //reordering qlog in the bitstream would eliminate this reset
- ff_init_range_encoder(c, buf, buf_size);
- memcpy(s->header_state, rc_header_bak, sizeof(s->header_state));
- memcpy(s->block_state, rc_block_bak, sizeof(s->block_state));
- encode_header(s);
- encode_blocks(s, 0);
- }
- }
-
- for(level=0; level<s->spatial_decomposition_count; level++){
- for(orientation=level ? 1 : 0; orientation<4; orientation++){
- SubBand *b= &p->band[level][orientation];
-
- quantize(s, b, b->buf, b->stride, s->qbias);
- if(orientation==0)
- decorrelate(s, b, b->buf, b->stride, pict->pict_type == P_TYPE, 0);
- encode_subband(s, b, b->buf, b->parent ? b->parent->buf : NULL, b->stride, orientation);
- assert(b->parent==NULL || b->parent->stride == b->stride*2);
- if(orientation==0)
- correlate(s, b, b->buf, b->stride, 1, 0);
- }
- }
-// av_log(NULL, AV_LOG_DEBUG, "plane:%d bits:%d\n", plane_index, put_bits_count(&s->c.pb) - bits);
-
- for(level=0; level<s->spatial_decomposition_count; level++){
- for(orientation=level ? 1 : 0; orientation<4; orientation++){
- SubBand *b= &p->band[level][orientation];
-
- dequantize(s, b, b->buf, b->stride);
- }
- }
-
- ff_spatial_idwt(s->spatial_dwt_buffer, w, h, w, s->spatial_decomposition_type, s->spatial_decomposition_count);
- if(s->qlog == LOSSLESS_QLOG){
- for(y=0; y<h; y++){
- for(x=0; x<w; x++){
- s->spatial_dwt_buffer[y*w + x]<<=FRAC_BITS;
- }
- }
- }
-{START_TIMER
- predict_plane(s, s->spatial_dwt_buffer, plane_index, 1);
-STOP_TIMER("pred-conv")}
- }else{
- //ME/MC only
- if(pict->pict_type == I_TYPE){
- for(y=0; y<h; y++){
- for(x=0; x<w; x++){
- s->current_picture.data[plane_index][y*s->current_picture.linesize[plane_index] + x]=
- pict->data[plane_index][y*pict->linesize[plane_index] + x];
- }
- }
- }else{
- memset(s->spatial_dwt_buffer, 0, sizeof(DWTELEM)*w*h);
- predict_plane(s, s->spatial_dwt_buffer, plane_index, 1);
- }
- }
- if(s->avctx->flags&CODEC_FLAG_PSNR){
- int64_t error= 0;
-
- if(pict->data[plane_index]) //FIXME gray hack
- for(y=0; y<h; y++){
- for(x=0; x<w; x++){
- int d= s->current_picture.data[plane_index][y*s->current_picture.linesize[plane_index] + x] - pict->data[plane_index][y*pict->linesize[plane_index] + x];
- error += d*d;
- }
- }
- s->avctx->error[plane_index] += error;
- s->current_picture.error[plane_index] = error;
- }
- }
-
- if(s->last_picture[s->max_ref_frames-1].data[0])
- avctx->release_buffer(avctx, &s->last_picture[s->max_ref_frames-1]);
-
- s->current_picture.coded_picture_number = avctx->frame_number;
- s->current_picture.pict_type = pict->pict_type;
- s->current_picture.quality = pict->quality;
- s->m.frame_bits = 8*(s->c.bytestream - s->c.bytestream_start);
- s->m.p_tex_bits = s->m.frame_bits - s->m.misc_bits - s->m.mv_bits;
- s->m.current_picture.display_picture_number =
- s->m.current_picture.coded_picture_number = avctx->frame_number;
- s->m.current_picture.quality = pict->quality;
- s->m.total_bits += 8*(s->c.bytestream - s->c.bytestream_start);
- if(s->pass1_rc)
- if (ff_rate_estimate_qscale(&s->m, 0) < 0)
- return -1;
- if(avctx->flags&CODEC_FLAG_PASS1)
- ff_write_pass1_stats(&s->m);
- s->m.last_pict_type = s->m.pict_type;
- avctx->frame_bits = s->m.frame_bits;
- avctx->mv_bits = s->m.mv_bits;
- avctx->misc_bits = s->m.misc_bits;
- avctx->p_tex_bits = s->m.p_tex_bits;
-
- emms_c();
-
- return ff_rac_terminate(c);
-}
-#endif
-
-static void common_end(SnowContext *s){
- int plane_index, level, orientation, i;
-
- av_freep(&s->spatial_dwt_buffer);
-
- av_freep(&s->m.me.scratchpad);
- av_freep(&s->m.me.map);
- av_freep(&s->m.me.score_map);
- av_freep(&s->m.obmc_scratchpad);
-
- av_freep(&s->block);
-
- for(i=0; i<MAX_REF_FRAMES; i++){
- av_freep(&s->ref_mvs[i]);
- av_freep(&s->ref_scores[i]);
- if(s->last_picture[i].data[0])
- s->avctx->release_buffer(s->avctx, &s->last_picture[i]);
- }
-
- for(plane_index=0; plane_index<3; plane_index++){
- for(level=s->spatial_decomposition_count-1; level>=0; level--){
- for(orientation=level ? 1 : 0; orientation<4; orientation++){
- SubBand *b= &s->plane[plane_index].band[level][orientation];
-
- av_freep(&b->x_coeff);
- }
- }
- }
-}
-
-#ifdef CONFIG_ENCODERS
-static int encode_end(AVCodecContext *avctx)
-{
- SnowContext *s = avctx->priv_data;
-
- common_end(s);
- av_free(avctx->stats_out);
-
- return 0;
-}
-#endif
-
-static int decode_init(AVCodecContext *avctx)
-{
- SnowContext *s = avctx->priv_data;
- int block_size;
-
- avctx->pix_fmt= PIX_FMT_YUV420P;
-
- common_init(avctx);
-
- block_size = MB_SIZE >> s->block_max_depth;
- slice_buffer_init(&s->sb, s->plane[0].height, (block_size) + (s->spatial_decomposition_count * (s->spatial_decomposition_count + 3)) + 1, s->plane[0].width, s->spatial_dwt_buffer);
-
- return 0;
-}
-
-static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size){
- SnowContext *s = avctx->priv_data;
- RangeCoder * const c= &s->c;
- int bytes_read;
- AVFrame *picture = data;
- int level, orientation, plane_index;
-
- ff_init_range_decoder(c, buf, buf_size);
- ff_build_rac_states(c, 0.05*(1LL<<32), 256-8);
-
- s->current_picture.pict_type= FF_I_TYPE; //FIXME I vs. P
- decode_header(s);
- if(!s->block) alloc_blocks(s);
-
- frame_start(s);
- //keyframe flag dupliaction mess FIXME
- if(avctx->debug&FF_DEBUG_PICT_INFO)
- av_log(avctx, AV_LOG_ERROR, "keyframe:%d qlog:%d\n", s->keyframe, s->qlog);
-
- decode_blocks(s);
-
- for(plane_index=0; plane_index<3; plane_index++){
- Plane *p= &s->plane[plane_index];
- int w= p->width;
- int h= p->height;
- int x, y;
- int decode_state[MAX_DECOMPOSITIONS][4][1]; /* Stored state info for unpack_coeffs. 1 variable per instance. */
-
-if(s->avctx->debug&2048){
- memset(s->spatial_dwt_buffer, 0, sizeof(DWTELEM)*w*h);
- predict_plane(s, s->spatial_dwt_buffer, plane_index, 1);
-
- for(y=0; y<h; y++){
- for(x=0; x<w; x++){
- int v= s->current_picture.data[plane_index][y*s->current_picture.linesize[plane_index] + x];
- s->mconly_picture.data[plane_index][y*s->mconly_picture.linesize[plane_index] + x]= v;
- }
- }
-}
-
-{ START_TIMER
- for(level=0; level<s->spatial_decomposition_count; level++){
- for(orientation=level ? 1 : 0; orientation<4; orientation++){
- SubBand *b= &p->band[level][orientation];
- unpack_coeffs(s, b, b->parent, orientation);
- }
- }
- STOP_TIMER("unpack coeffs");
-}
-
-{START_TIMER
- const int mb_h= s->b_height << s->block_max_depth;
- const int block_size = MB_SIZE >> s->block_max_depth;
- const int block_w = plane_index ? block_size/2 : block_size;
- int mb_y;
- dwt_compose_t cs[MAX_DECOMPOSITIONS];
- int yd=0, yq=0;
- int y;
- int end_y;
-
- ff_spatial_idwt_buffered_init(cs, &s->sb, w, h, 1, s->spatial_decomposition_type, s->spatial_decomposition_count);
- for(mb_y=0; mb_y<=mb_h; mb_y++){
-
- int slice_starty = block_w*mb_y;
- int slice_h = block_w*(mb_y+1);
- if (!(s->keyframe || s->avctx->debug&512)){
- slice_starty = FFMAX(0, slice_starty - (block_w >> 1));
- slice_h -= (block_w >> 1);
- }
-
- {
- START_TIMER
- for(level=0; level<s->spatial_decomposition_count; level++){
- for(orientation=level ? 1 : 0; orientation<4; orientation++){
- SubBand *b= &p->band[level][orientation];
- int start_y;
- int end_y;
- int our_mb_start = mb_y;
- int our_mb_end = (mb_y + 1);
- const int extra= 3;
- start_y = (mb_y ? ((block_w * our_mb_start) >> (s->spatial_decomposition_count - level)) + s->spatial_decomposition_count - level + extra: 0);
- end_y = (((block_w * our_mb_end) >> (s->spatial_decomposition_count - level)) + s->spatial_decomposition_count - level + extra);
- if (!(s->keyframe || s->avctx->debug&512)){
- start_y = FFMAX(0, start_y - (block_w >> (1+s->spatial_decomposition_count - level)));
- end_y = FFMAX(0, end_y - (block_w >> (1+s->spatial_decomposition_count - level)));
- }
- start_y = FFMIN(b->height, start_y);
- end_y = FFMIN(b->height, end_y);
-
- if (start_y != end_y){
- if (orientation == 0){
- SubBand * correlate_band = &p->band[0][0];
- int correlate_end_y = FFMIN(b->height, end_y + 1);
- int correlate_start_y = FFMIN(b->height, (start_y ? start_y + 1 : 0));
- decode_subband_slice_buffered(s, correlate_band, &s->sb, correlate_start_y, correlate_end_y, decode_state[0][0]);
- correlate_slice_buffered(s, &s->sb, correlate_band, correlate_band->buf, correlate_band->stride, 1, 0, correlate_start_y, correlate_end_y);
- dequantize_slice_buffered(s, &s->sb, correlate_band, correlate_band->buf, correlate_band->stride, start_y, end_y);
- }
- else
- decode_subband_slice_buffered(s, b, &s->sb, start_y, end_y, decode_state[level][orientation]);
- }
- }
- }
- STOP_TIMER("decode_subband_slice");
- }
-
-{ START_TIMER
- for(; yd<slice_h; yd+=4){
- ff_spatial_idwt_buffered_slice(&s->dsp, cs, &s->sb, w, h, 1, s->spatial_decomposition_type, s->spatial_decomposition_count, yd);
- }
- STOP_TIMER("idwt slice");}
-
-
- if(s->qlog == LOSSLESS_QLOG){
- for(; yq<slice_h && yq<h; yq++){
- DWTELEM * line = slice_buffer_get_line(&s->sb, yq);
- for(x=0; x<w; x++){
- line[x] <<= FRAC_BITS;
- }
- }
- }
-
- predict_slice_buffered(s, &s->sb, s->spatial_dwt_buffer, plane_index, 1, mb_y);
-
- y = FFMIN(p->height, slice_starty);
- end_y = FFMIN(p->height, slice_h);
- while(y < end_y)
- slice_buffer_release(&s->sb, y++);
- }
-
- slice_buffer_flush(&s->sb);
-
-STOP_TIMER("idwt + predict_slices")}
- }
-
- emms_c();
-
- if(s->last_picture[s->max_ref_frames-1].data[0])
- avctx->release_buffer(avctx, &s->last_picture[s->max_ref_frames-1]);
-
-if(!(s->avctx->debug&2048))
- *picture= s->current_picture;
-else
- *picture= s->mconly_picture;
-
- *data_size = sizeof(AVFrame);
-
- bytes_read= c->bytestream - c->bytestream_start;
- if(bytes_read ==0) av_log(s->avctx, AV_LOG_ERROR, "error at end of frame\n"); //FIXME
-
- return bytes_read;
-}
-
-static int decode_end(AVCodecContext *avctx)
-{
- SnowContext *s = avctx->priv_data;
-
- slice_buffer_destroy(&s->sb);
-
- common_end(s);
-
- return 0;
-}
-
-AVCodec snow_decoder = {
- "snow",
- CODEC_TYPE_VIDEO,
- CODEC_ID_SNOW,
- sizeof(SnowContext),
- decode_init,
- NULL,
- decode_end,
- decode_frame,
- 0 /*CODEC_CAP_DR1*/ /*| CODEC_CAP_DRAW_HORIZ_BAND*/,
- NULL
-};
-
-#ifdef CONFIG_ENCODERS
-AVCodec snow_encoder = {
- "snow",
- CODEC_TYPE_VIDEO,
- CODEC_ID_SNOW,
- sizeof(SnowContext),
- encode_init,
- encode_frame,
- encode_end,
-};
-#endif
-
-
-#if 0
-#undef malloc
-#undef free
-#undef printf
-
-int main(){
- int width=256;
- int height=256;
- int buffer[2][width*height];
- SnowContext s;
- int i;
- s.spatial_decomposition_count=6;
- s.spatial_decomposition_type=1;
-
- printf("testing 5/3 DWT\n");
- for(i=0; i<width*height; i++)
- buffer[0][i]= buffer[1][i]= random()%54321 - 12345;
-
- ff_spatial_dwt(buffer[0], width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count);
- ff_spatial_idwt(buffer[0], width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count);
-
- for(i=0; i<width*height; i++)
- if(buffer[0][i]!= buffer[1][i]) printf("fsck: %d %d %d\n",i, buffer[0][i], buffer[1][i]);
-
- printf("testing 9/7 DWT\n");
- s.spatial_decomposition_type=0;
- for(i=0; i<width*height; i++)
- buffer[0][i]= buffer[1][i]= random()%54321 - 12345;
-
- ff_spatial_dwt(buffer[0], width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count);
- ff_spatial_idwt(buffer[0], width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count);
-
- for(i=0; i<width*height; i++)
- if(FFABS(buffer[0][i] - buffer[1][i])>20) printf("fsck: %d %d %d\n",i, buffer[0][i], buffer[1][i]);
-
-#if 0
- printf("testing AC coder\n");
- memset(s.header_state, 0, sizeof(s.header_state));
- ff_init_range_encoder(&s.c, buffer[0], 256*256);
- ff_init_cabac_states(&s.c, ff_h264_lps_range, ff_h264_mps_state, ff_h264_lps_state, 64);
-
- for(i=-256; i<256; i++){
-START_TIMER
- put_symbol(&s.c, s.header_state, i*i*i/3*FFABS(i), 1);
-STOP_TIMER("put_symbol")
- }
- ff_rac_terminate(&s.c);
-
- memset(s.header_state, 0, sizeof(s.header_state));
- ff_init_range_decoder(&s.c, buffer[0], 256*256);
- ff_init_cabac_states(&s.c, ff_h264_lps_range, ff_h264_mps_state, ff_h264_lps_state, 64);
-
- for(i=-256; i<256; i++){
- int j;
-START_TIMER
- j= get_symbol(&s.c, s.header_state, 1);
-STOP_TIMER("get_symbol")
- if(j!=i*i*i/3*FFABS(i)) printf("fsck: %d != %d\n", i, j);
- }
-#endif
-{
-int level, orientation, x, y;
-int64_t errors[8][4];
-int64_t g=0;
-
- memset(errors, 0, sizeof(errors));
- s.spatial_decomposition_count=3;
- s.spatial_decomposition_type=0;
- for(level=0; level<s.spatial_decomposition_count; level++){
- for(orientation=level ? 1 : 0; orientation<4; orientation++){
- int w= width >> (s.spatial_decomposition_count-level);
- int h= height >> (s.spatial_decomposition_count-level);
- int stride= width << (s.spatial_decomposition_count-level);
- DWTELEM *buf= buffer[0];
- int64_t error=0;
-
- if(orientation&1) buf+=w;
- if(orientation>1) buf+=stride>>1;
-
- memset(buffer[0], 0, sizeof(int)*width*height);
- buf[w/2 + h/2*stride]= 256*256;
- ff_spatial_idwt(buffer[0], width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count);
- for(y=0; y<height; y++){
- for(x=0; x<width; x++){
- int64_t d= buffer[0][x + y*width];
- error += d*d;
- if(FFABS(width/2-x)<9 && FFABS(height/2-y)<9 && level==2) printf("%8"PRId64" ", d);
- }
- if(FFABS(height/2-y)<9 && level==2) printf("\n");
- }
- error= (int)(sqrt(error)+0.5);
- errors[level][orientation]= error;
- if(g) g=ff_gcd(g, error);
- else g= error;
- }
- }
- printf("static int const visual_weight[][4]={\n");
- for(level=0; level<s.spatial_decomposition_count; level++){
- printf(" {");
- for(orientation=0; orientation<4; orientation++){
- printf("%8"PRId64",", errors[level][orientation]/g);
- }
- printf("},\n");
- }
- printf("};\n");
- {
- int level=2;
- int orientation=3;
- int w= width >> (s.spatial_decomposition_count-level);
- int h= height >> (s.spatial_decomposition_count-level);
- int stride= width << (s.spatial_decomposition_count-level);
- DWTELEM *buf= buffer[0];
- int64_t error=0;
-
- buf+=w;
- buf+=stride>>1;
-
- memset(buffer[0], 0, sizeof(int)*width*height);
-#if 1
- for(y=0; y<height; y++){
- for(x=0; x<width; x++){
- int tab[4]={0,2,3,1};
- buffer[0][x+width*y]= 256*256*tab[(x&1) + 2*(y&1)];
- }
- }
- ff_spatial_dwt(buffer[0], width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count);
-#else
- for(y=0; y<h; y++){
- for(x=0; x<w; x++){
- buf[x + y*stride ]=169;
- buf[x + y*stride-w]=64;
- }
- }
- ff_spatial_idwt(buffer[0], width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count);
-#endif
- for(y=0; y<height; y++){
- for(x=0; x<width; x++){
- int64_t d= buffer[0][x + y*width];
- error += d*d;
- if(FFABS(width/2-x)<9 && FFABS(height/2-y)<9) printf("%8"PRId64" ", d);
- }
- if(FFABS(height/2-y)<9) printf("\n");
- }
- }
-
-}
- return 0;
-}
-#endif
-
diff --git a/src/libffmpeg/libavcodec/snow.h b/src/libffmpeg/libavcodec/snow.h
deleted file mode 100644
index 6794d2c5a..000000000
--- a/src/libffmpeg/libavcodec/snow.h
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Copyright (C) 2004 Michael Niedermayer <michaelni@gmx.at>
- * Copyright (C) 2006 Robert Edele <yartrebo@earthlink.net>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _SNOW_H
-#define _SNOW_H
-
-#include "dsputil.h"
-
-#define MID_STATE 128
-
-#define MAX_DECOMPOSITIONS 8
-#define MAX_PLANES 4
-#define QSHIFT 5
-#define QROOT (1<<QSHIFT)
-#define LOSSLESS_QLOG -128
-#define FRAC_BITS 8
-#define MAX_REF_FRAMES 8
-
-#define LOG2_OBMC_MAX 8
-#define OBMC_MAX (1<<(LOG2_OBMC_MAX))
-
-#define DWT_97 0
-#define DWT_53 1
-#define DWT_X 2
-
-/** Used to minimize the amount of memory used in order to optimize cache performance. **/
-struct slice_buffer_s {
- DWTELEM * * line; ///< For use by idwt and predict_slices.
- DWTELEM * * data_stack; ///< Used for internal purposes.
- int data_stack_top;
- int line_count;
- int line_width;
- int data_count;
- DWTELEM * base_buffer; ///< Buffer that this structure is caching.
-};
-
-#define liftS lift
-#define lift5 lift
-#if 1
-#define W_AM 3
-#define W_AO 0
-#define W_AS 1
-
-#undef liftS
-#define W_BM 1
-#define W_BO 8
-#define W_BS 4
-
-#define W_CM 1
-#define W_CO 0
-#define W_CS 0
-
-#define W_DM 3
-#define W_DO 4
-#define W_DS 3
-#elif 0
-#define W_AM 55
-#define W_AO 16
-#define W_AS 5
-
-#define W_BM 3
-#define W_BO 32
-#define W_BS 6
-
-#define W_CM 127
-#define W_CO 64
-#define W_CS 7
-
-#define W_DM 7
-#define W_DO 8
-#define W_DS 4
-#elif 0
-#define W_AM 97
-#define W_AO 32
-#define W_AS 6
-
-#define W_BM 63
-#define W_BO 512
-#define W_BS 10
-
-#define W_CM 13
-#define W_CO 8
-#define W_CS 4
-
-#define W_DM 15
-#define W_DO 16
-#define W_DS 5
-
-#else
-
-#define W_AM 203
-#define W_AO 64
-#define W_AS 7
-
-#define W_BM 217
-#define W_BO 2048
-#define W_BS 12
-
-#define W_CM 113
-#define W_CO 64
-#define W_CS 7
-
-#define W_DM 227
-#define W_DO 128
-#define W_DS 9
-#endif
-
-extern void ff_snow_vertical_compose97i(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, DWTELEM *b3, DWTELEM *b4, DWTELEM *b5, int width);
-extern void ff_snow_horizontal_compose97i(DWTELEM *b, int width);
-extern void ff_snow_inner_add_yblock(uint8_t *obmc, const int obmc_stride, uint8_t * * block, int b_w, int b_h, int src_x, int src_y, int src_stride, slice_buffer * sb, int add, uint8_t * dst8);
-
-#ifdef CONFIG_SNOW_ENCODER
-int w53_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h);
-int w97_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h);
-#else
-static int w53_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h) {assert (0);}
-static int w97_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h) {assert (0);}
-#endif
-
-/* C bits used by mmx/sse2/altivec */
-
-static av_always_inline void snow_interleave_line_header(int * i, int width, DWTELEM * low, DWTELEM * high){
- (*i) = (width) - 2;
-
- if (width & 1){
- low[(*i)+1] = low[((*i)+1)>>1];
- (*i)--;
- }
-}
-
-static av_always_inline void snow_interleave_line_footer(int * i, DWTELEM * low, DWTELEM * high){
- for (; (*i)>=0; (*i)-=2){
- low[(*i)+1] = high[(*i)>>1];
- low[*i] = low[(*i)>>1];
- }
-}
-
-static av_always_inline void snow_horizontal_compose_lift_lead_out(int i, DWTELEM * dst, DWTELEM * src, DWTELEM * ref, int width, int w, int lift_high, int mul, int add, int shift){
- for(; i<w; i++){
- dst[i] = src[i] - ((mul * (ref[i] + ref[i + 1]) + add) >> shift);
- }
-
- if((width^lift_high)&1){
- dst[w] = src[w] - ((mul * 2 * ref[w] + add) >> shift);
- }
-}
-
-static av_always_inline void snow_horizontal_compose_liftS_lead_out(int i, DWTELEM * dst, DWTELEM * src, DWTELEM * ref, int width, int w){
- for(; i<w; i++){
- dst[i] = src[i] - (((-(ref[i] + ref[(i+1)])+W_BO) - 4 * src[i]) >> W_BS);
- }
-
- if(width&1){
- dst[w] = src[w] - (((-2 * ref[w] + W_BO) - 4 * src[w]) >> W_BS);
- }
-}
-
-#endif
diff --git a/src/libffmpeg/libavcodec/sp5x.h b/src/libffmpeg/libavcodec/sp5x.h
deleted file mode 100644
index 0d0d3551f..000000000
--- a/src/libffmpeg/libavcodec/sp5x.h
+++ /dev/null
@@ -1,332 +0,0 @@
-/*
- * Sunplus JPEG tables
- * Copyright (c) 2003 the ffmpeg project
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef SP5X_H
-#define SP5X_H
-
-static const uint8_t sp5x_data_sof[] =
-{
- 0xFF, 0xC0, /* SOF */
- 0x00, 0x11, /* len */
- 0x08, /* bits */
- 0x00, 0xf0, /* height (default: 240) */
- 0x01, 0x40, /* width (default: 240) */
- 0x03, /* nb components */
- 0x01, 0x22, 0x00, /* 21 vs 22 ? */
- 0x02, 0x11, 0x01,
- 0x03, 0x11, 0x01
-};
-
-static const uint8_t sp5x_data_sos[] =
-{
- 0xFF, 0xDA, /* SOS */
- 0x00, 0x0C, /* len */
- 0x03, /* nb components */
- 0x01, 0x00,
- 0x02, 0x11,
- 0x03, 0x11,
- 0x00, /* Ss */
- 0x3F, /* Se */
- 0x00 /* Ah/Al */
-};
-
-static const uint8_t sp5x_data_dqt[] =
-{
- 0xFF, 0xDB, /* DQT */
- 0x00, 0x84, /* len */
- 0x00,
- 0x05, 0x03, 0x04, 0x04, 0x04, 0x03, 0x05, 0x04,
- 0x04, 0x04, 0x06, 0x05, 0x05, 0x06, 0x08, 0x0D,
- 0x08, 0x08, 0x07, 0x07, 0x08, 0x10, 0x0C, 0x0C,
- 0x0A, 0x0D, 0x14, 0x11, 0x15, 0x14, 0x13, 0x11,
- 0x13, 0x13, 0x16, 0x18, 0x1F, 0x1A, 0x16, 0x17,
- 0x1E, 0x17, 0x13, 0x13, 0x1B, 0x25, 0x1C, 0x1E,
- 0x20, 0x21, 0x23, 0x23, 0x23, 0x15, 0x1A, 0x27,
- 0x29, 0x26, 0x22, 0x29, 0x1F, 0x22, 0x23, 0x22,
- 0x01,
- 0x05, 0x06, 0x06, 0x08, 0x07, 0x08, 0x10, 0x08,
- 0x08, 0x10, 0x22, 0x16, 0x13, 0x16, 0x22, 0x22,
- 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
- 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
- 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
- 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
- 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
- 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22
-};
-
-static const uint8_t sp5x_data_dht[] = {
- 0xFF, 0xC4, /* DHT */
- 0x01, 0xA2, /* len */
- 0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
- 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x01, 0x00, 0x03,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
- 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
- 0x0A, 0x0B, 0x10, 0x00, 0x02, 0x01, 0x03, 0x03,
- 0x02, 0x04, 0x03, 0x05, 0x05, 0x04, 0x04, 0x00,
- 0x00, 0x01, 0x7D, 0x01, 0x02, 0x03, 0x00, 0x04,
- 0x11, 0x05, 0x12, 0x21, 0x31, 0x41, 0x06, 0x13,
- 0x51, 0x61, 0x07, 0x22, 0x71, 0x14, 0x32, 0x81,
- 0x91, 0xA1, 0x08, 0x23, 0x42, 0xB1, 0xC1, 0x15,
- 0x52, 0xD1, 0xF0, 0x24, 0x33, 0x62, 0x72, 0x82,
- 0x09, 0x0A, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x25,
- 0x26, 0x27, 0x28, 0x29, 0x2A, 0x34, 0x35, 0x36,
- 0x37, 0x38, 0x39, 0x3A, 0x43, 0x44, 0x45, 0x46,
- 0x47, 0x48, 0x49, 0x4A, 0x53, 0x54, 0x55, 0x56,
- 0x57, 0x58, 0x59, 0x5A, 0x63, 0x64, 0x65, 0x66,
- 0x67, 0x68, 0x69, 0x6A, 0x73, 0x74, 0x75, 0x76,
- 0x77, 0x78, 0x79, 0x7A, 0x83, 0x84, 0x85, 0x86,
- 0x87, 0x88, 0x89, 0x8A, 0x92, 0x93, 0x94, 0x95,
- 0x96, 0x97, 0x98, 0x99, 0x9A, 0xA2, 0xA3, 0xA4,
- 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xB2, 0xB3,
- 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xC2,
- 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA,
- 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9,
- 0xDA, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
- 0xE8, 0xE9, 0xEA, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5,
- 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0x11, 0x00, 0x02,
- 0x01, 0x02, 0x04, 0x04, 0x03, 0x04, 0x07, 0x05,
- 0x04, 0x04, 0x00, 0x01, 0x02, 0x77, 0x00, 0x01,
- 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, 0x31, 0x06,
- 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, 0x13, 0x22,
- 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, 0xA1, 0xB1,
- 0xC1, 0x09, 0x23, 0x33, 0x52, 0xF0, 0x15, 0x62,
- 0x72, 0xD1, 0x0A, 0x16, 0x24, 0x34, 0xE1, 0x25,
- 0xF1, 0x17, 0x18, 0x19, 0x1A, 0x26, 0x27, 0x28,
- 0x29, 0x2A, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A,
- 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A,
- 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A,
- 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A,
- 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A,
- 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
- 0x8A, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
- 0x99, 0x9A, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7,
- 0xA8, 0xA9, 0xAA, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6,
- 0xB7, 0xB8, 0xB9, 0xBA, 0xC2, 0xC3, 0xC4, 0xC5,
- 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD2, 0xD3, 0xD4,
- 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xE2, 0xE3,
- 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xF2,
- 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA
-};
-
-
-static const uint8_t sp5x_quant_table[20][64]=
-{
- /* index 0, Q50 */
- { 16, 11, 12, 14, 12, 10, 16, 14, 13, 14, 18, 17, 16, 19, 24, 40,
- 26, 24, 22, 22, 24, 49, 35, 37, 29, 40, 58, 51, 61, 60, 57, 51,
- 56, 55, 64, 72, 92, 78, 64, 68, 87, 69, 55, 56, 80,109, 81, 87,
- 95, 98,103,104,103, 62, 77,113,121,112,100,120, 92,101,103, 99 },
- { 17, 18, 18, 24, 21, 24, 47, 26, 26, 47, 99, 66, 56, 66, 99, 99,
- 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
- 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
- 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99 },
-
- /* index 1, Q70 */
- { 10, 7, 7, 8, 7, 6, 10, 8, 8, 8, 11, 10, 10, 11, 14, 24,
- 16, 14, 13, 13, 14, 29, 21, 22, 17, 24, 35, 31, 37, 36, 34, 31,
- 34, 33, 38, 43, 55, 47, 38, 41, 52, 41, 33, 34, 48, 65, 49, 52,
- 57, 59, 62, 62, 62, 37, 46, 68, 73, 67, 60, 72, 55, 61, 62, 59 },
- { 10, 11, 11, 14, 13, 14, 28, 16, 16, 28, 59, 40, 34, 40, 59, 59,
- 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
- 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
- 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59 },
-
- /* index 2, Q80 */
- { 6, 4, 5, 6, 5, 4, 6, 6, 5, 6, 7, 7, 6, 8, 10, 16,
- 10, 10, 9, 9, 10, 20, 14, 15, 12, 16, 23, 20, 24, 24, 23, 20,
- 22, 22, 26, 29, 37, 31, 26, 27, 35, 28, 22, 22, 32, 44, 32, 35,
- 38, 39, 41, 42, 41, 25, 31, 45, 48, 45, 40, 48, 37, 40, 41, 40 },
- { 7, 7, 7, 10, 8, 10, 19, 10, 10, 19, 40, 26, 22, 26, 40, 40,
- 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
- 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
- 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40 },
-
- /* index 3, Q85 */
- { 5, 3, 4, 4, 4, 3, 5, 4, 4, 4, 5, 5, 5, 6, 7, 12,
- 8, 7, 7, 7, 7, 15, 11, 11, 9, 12, 17, 15, 18, 18, 17, 15,
- 17, 17, 19, 22, 28, 23, 19, 20, 26, 21, 17, 17, 24, 33, 24, 26,
- 29, 29, 31, 31, 31, 19, 23, 34, 36, 34, 30, 36, 28, 30, 31, 30 },
- { 5, 5, 5, 7, 6, 7, 14, 8, 8, 14, 30, 20, 17, 20, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30 },
-
- /* index 4, Q90 */
- { 3, 2, 2, 3, 2, 2, 3, 3, 3, 3, 4, 3, 3, 4, 5, 8,
- 5, 5, 4, 4, 5, 10, 7, 7, 6, 8, 12, 10, 12, 12, 11, 10,
- 11, 11, 13, 14, 18, 16, 13, 14, 17, 14, 11, 11, 16, 22, 16, 17,
- 19, 20, 21, 21, 21, 12, 15, 23, 24, 22, 20, 24, 18, 20, 21, 20 },
- { 3, 4, 4, 5, 4, 5, 9, 5, 5, 9, 20, 13, 11, 13, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 },
-
- /* index 5, Q60 */
- { 13, 9, 10, 11, 10, 8, 13, 11, 10, 11, 14, 14, 13, 15, 19, 32,
- 21, 19, 18, 18, 19, 39, 28, 30, 23, 32, 46, 41, 49, 48, 46, 41,
- 45, 44, 51, 58, 74, 62, 51, 54, 70, 55, 44, 45, 64, 87, 65, 70,
- 76, 78, 82, 83, 82, 50, 62, 90, 97, 90, 80, 96, 74, 81, 82, 79 },
- { 14, 14, 14, 19, 17, 19, 38, 21, 21, 38, 79, 53, 45, 53, 79, 79,
- 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
- 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
- 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79 },
-
- /* index 6, Q25 */
- { 32, 22, 24, 28, 24, 20, 32, 28, 26, 28, 36, 34, 32, 38, 48, 80,
- 52, 48, 44, 44, 48, 98, 70, 74, 58, 80,116,102,122,120,114,102,
- 112,110,128,144,184,156,128,136,174,138,110,112,160,218,162,174,
- 190,196,206,208,206,124,154,226,242,224,200,240,184,202,206,198 },
- { 34, 36, 36, 48, 42, 48, 94, 52, 52, 94,198,132,112,132,198,198,
- 198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,
- 198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,
- 198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198 },
-
- /* index 7, Q95 */
- { 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 2, 2, 2, 4,
- 3, 2, 2, 2, 2, 5, 4, 4, 3, 4, 6, 5, 6, 6, 6, 5,
- 6, 6, 6, 7, 9, 8, 6, 7, 9, 7, 6, 6, 8, 11, 8, 9,
- 10, 10, 10, 10, 10, 6, 8, 11, 12, 11, 10, 12, 9, 10, 10, 10 },
- { 2, 2, 2, 2, 2, 2, 5, 3, 3, 5, 10, 7, 6, 7, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10 },
-
- /* index 8, Q93 */
- { 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 3, 2, 2, 3, 3, 6,
- 4, 3, 3, 3, 3, 7, 5, 5, 4, 6, 8, 7, 9, 8, 8, 7,
- 8, 8, 9, 10, 13, 11, 9, 10, 12, 10, 8, 8, 11, 15, 11, 12,
- 13, 14, 14, 15, 14, 9, 11, 16, 17, 16, 14, 17, 13, 14, 14, 14 },
- { 2, 3, 3, 3, 3, 3, 7, 4, 4, 7, 14, 9, 8, 9, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14 },
-
- /* index 9, Q40 */
- { 20, 14, 15, 18, 15, 13, 20, 18, 16, 18, 23, 21, 20, 24, 30, 50,
- 33, 30, 28, 28, 30, 61, 44, 46, 36, 50, 73, 64, 76, 75, 71, 64,
- 70, 69, 80, 90,115, 98, 80, 85,109, 86, 69, 70,100,136,101,109,
- 119,123,129,130,129, 78, 96,141,151,140,125,150,115,126,129,124 },
- { 21, 23, 23, 30, 26, 30, 59, 33, 33, 59,124, 83, 70, 83,124,124,
- 124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,
- 124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,
- 124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124 }
-};
-
-#if 0
-/* 4NF-M, not ZigZag */
-static const uint8_t sp5x_quant_table_orig[18][64] =
-{
- /* index 0, Q50 */
- { 16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55,
- 14, 13, 16, 24, 40, 57, 69, 56, 14, 17, 22, 29, 51, 87, 80, 62,
- 18, 22, 37, 56, 68,109,103, 77, 24, 35, 55, 64, 81,104,113, 92,
- 49, 64, 78, 87,103,121,120,101, 72, 92, 95, 98,112,100,103, 99 },
- { 17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99, 99,
- 24, 26, 56, 99, 99, 99, 99, 99, 47, 66, 99, 99, 99, 99, 99, 99,
- 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
- 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99 },
-
- /* index 1, Q70 */
- { 10, 7, 6, 10, 14, 24, 31, 37, 7, 7, 8, 11, 16, 35, 36, 33,
- 8, 8, 10, 14, 24, 34, 41, 34, 8, 10, 13, 17, 31, 52, 48, 37,
- 11, 13, 22, 34, 41, 65, 62, 46, 14, 21, 33, 38, 49, 62, 68, 55,
- 29, 38, 47, 52, 62, 73, 72, 61, 43, 55, 57, 59, 67, 60, 62, 59 },
- { 10, 11, 14, 28, 59, 59, 59, 59, 11, 13, 16, 40, 59, 59, 59, 59,
- 14, 16, 34, 59, 59, 59, 59, 59, 28, 40, 59, 59, 59, 59, 59, 59,
- 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
- 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59 },
-
- /* index 2, Q80 */
- { 6, 4, 4, 6, 10, 16, 20, 24, 5, 5, 6, 8, 10, 23, 24, 22,
- 6, 5, 6, 10, 16, 23, 28, 22, 6, 7, 9, 12, 20, 35, 32, 25,
- 7, 9, 15, 22, 27, 44, 41, 31, 10, 14, 22, 26, 32, 42, 45, 37,
- 20, 26, 31, 35, 41, 48, 48, 40, 29, 37, 38, 39, 45, 40, 41, 40 },
- { 7, 7, 10, 19, 40, 40, 40, 40, 7, 8, 10, 26, 40, 40, 40, 40,
- 10, 10, 22, 40, 40, 40, 40, 40, 19, 26, 40, 40, 40, 40, 40, 40,
- 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
- 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40 },
-
- /* index 3, Q85 */
- { 5, 3, 3, 5, 7, 12, 15, 18, 4, 4, 4, 6, 8, 17, 18, 17,
- 4, 4, 5, 7, 12, 17, 21, 17, 4, 5, 7, 9, 15, 26, 24, 19,
- 5, 7, 11, 17, 20, 33, 31, 23, 7, 11, 17, 19, 24, 31, 34, 28,
- 15, 19, 23, 26, 31, 36, 36, 30, 22, 28, 29, 29, 34, 30, 31, 30 },
- { 5, 5, 7, 14, 30, 30, 30, 30, 5, 6, 8, 20, 30, 30, 30, 30,
- 7, 8, 17, 30, 30, 30, 30, 30, 14, 20, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30 },
-
- /* index 4, Q90 */
- { 3, 2, 2, 3, 5, 8, 10, 12, 2, 2, 3, 4, 5, 12, 12, 11,
- 3, 3, 3, 5, 8, 11, 14, 11, 3, 3, 4, 6, 10, 17, 16, 12,
- 4, 4, 7, 11, 14, 22, 21, 15, 5, 7, 11, 13, 16, 21, 23, 18,
- 10, 13, 16, 17, 21, 24, 24, 20, 14, 18, 19, 20, 22, 20, 21, 20 },
- { 3, 4, 5, 9, 20, 20, 20, 20, 4, 4, 5, 13, 20, 20, 20, 20,
- 5, 5, 11, 20, 20, 20, 20, 20, 9, 13, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 },
-
- /* index 5, Q60 */
- { 13, 9, 8, 13, 19, 32, 41, 49, 10, 10, 11, 15, 21, 46, 48, 44,
- 11, 10, 13, 19, 32, 46, 55, 45, 11, 14, 18, 23, 41, 70, 64, 50,
- 14, 18, 30, 45, 54, 87, 82, 62, 19, 28, 44, 51, 65, 83, 90, 74,
- 39, 51, 62, 70, 82, 97, 96, 81, 58, 74, 76, 78, 90, 80, 82, 79 },
- { 14, 14, 19, 38, 79, 79, 79, 79, 14, 17, 21, 53, 79, 79, 79, 79,
- 19, 21, 45, 79, 79, 79, 79, 79, 38, 53, 79, 79, 79, 79, 79, 79,
- 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
- 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79 },
-
- /* index 6, Q25 */
- { 32, 22, 20, 32, 48, 80,102,122, 24, 24, 28, 38, 52,116,120,110,
- 28, 26, 32, 48, 80,114,138,112, 28, 34, 44, 58,102,174,160,124,
- 36, 44, 74,112,136,218,206,154, 48, 70,110,128,162,208,226,184,
- 98,128,156,174,206,242,240,202,144,184,190,196,224,200,206,198 },
- { 34, 36, 48, 94,198,198,198,198, 36, 42, 52,132,198,198,198,198,
- 48, 52,112,198,198,198,198,198, 94,132,198,198,198,198,198,198,
- 198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,
- 198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198 },
-
- /* index 7, Q95 */
- { 2, 1, 1, 2, 2, 4, 5, 6, 1, 1, 1, 2, 3, 6, 6, 6,
- 1, 1, 2, 2, 4, 6, 7, 6, 1, 2, 2, 3, 5, 9, 8, 6,
- 2, 2, 4, 6, 7, 11, 10, 8, 2, 4, 6, 6, 8, 10, 11, 9,
- 5, 6, 8, 9, 10, 12, 12, 10, 7, 9, 10, 10, 11, 10, 10, 10 },
- { 2, 2, 2, 5, 10, 10, 10, 10, 2, 2, 3, 7, 10, 10, 10, 10,
- 2, 3, 6, 10, 10, 10, 10, 10, 5, 7, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10 },
-
- /* index 8, Q93 */
- { 2, 2, 1, 2, 3, 6, 7, 9, 2, 2, 2, 3, 4, 8, 8, 8,
- 2, 2, 2, 3, 6, 8, 10, 8, 2, 2, 3, 4, 7, 12, 11, 9,
- 3, 3, 5, 8, 10, 15, 14, 11, 3, 5, 8, 9, 11, 15, 16, 13,
- 7, 9, 11, 12, 14, 17, 17, 14, 10, 13, 13, 14, 16, 14, 14, 14 },
- { 2, 3, 3, 7, 14, 14, 14, 14, 3, 3, 4, 9, 14, 14, 14, 14,
- 3, 4, 8, 14, 14, 14, 14, 14, 7, 9, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14 }
-};
-#endif
-
-#endif /* SP5X_H */
diff --git a/src/libffmpeg/libavcodec/sparc/Makefile.am b/src/libffmpeg/libavcodec/sparc/Makefile.am
deleted file mode 100644
index c3973f2ea..000000000
--- a/src/libffmpeg/libavcodec/sparc/Makefile.am
+++ /dev/null
@@ -1,18 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-AM_CPPFLAGS = $(LIBFFMPEG_CPPFLAGS) -I$(top_srcdir)/src/libffmpeg/libavutil -I$(top_srcdir)/src/libffmpeg
-AM_CFLAGS = -fno-strict-aliasing
-ASFLAGS =
-
-noinst_LTLIBRARIES = libavcodec_sparc.la
-
-libavcodec_sparc_src = dsputil_vis.c
-libavcodec_sparc_dummy = libavcodec_sparc_dummy.c
-
-EXTRA_DIST = $(libavcodec_sparc_src) $(libavcodec_sparc_dummy) vis.h
-
-if ENABLE_VIS
-sparc_modules = $(libavcodec_sparc_src)
-endif
-
-libavcodec_sparc_la_SOURCES = $(sparc_modules) $(libavcodec_sparc_dummy)
diff --git a/src/libffmpeg/libavcodec/sparc/dsputil_vis.c b/src/libffmpeg/libavcodec/sparc/dsputil_vis.c
deleted file mode 100644
index 5e59ce776..000000000
--- a/src/libffmpeg/libavcodec/sparc/dsputil_vis.c
+++ /dev/null
@@ -1,4090 +0,0 @@
-/*
- * dsputil_vis.c
- * Copyright (C) 2003 David S. Miller <davem@redhat.com>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/* The *no_round* functions have been added by James A. Morrison, 2003,2004.
- The vis code from libmpeg2 was adapted for ffmpeg by James A. Morrison.
- */
-
-#include "config.h"
-
-#ifdef ARCH_SPARC
-
-#include <inttypes.h>
-#include <signal.h>
-#include <setjmp.h>
-
-#include "../dsputil.h"
-
-#include "vis.h"
-
-/* The trick used in some of this file is the formula from the MMX
- * motion comp code, which is:
- *
- * (x+y+1)>>1 == (x|y)-((x^y)>>1)
- *
- * This allows us to average 8 bytes at a time in a 64-bit FPU reg.
- * We avoid overflows by masking before we do the shift, and we
- * implement the shift by multiplying by 1/2 using mul8x16. So in
- * VIS this is (assume 'x' is in f0, 'y' is in f2, a repeating mask
- * of '0xfe' is in f4, a repeating mask of '0x7f' is in f6, and
- * the value 0x80808080 is in f8):
- *
- * fxor f0, f2, f10
- * fand f10, f4, f10
- * fmul8x16 f8, f10, f10
- * fand f10, f6, f10
- * for f0, f2, f12
- * fpsub16 f12, f10, f10
- */
-
-#define ATTR_ALIGN(alignd) __attribute__ ((aligned(alignd)))
-
-#define DUP4(x) {x, x, x, x}
-#define DUP8(x) {x, x, x, x, x, x, x, x}
-static const int16_t constants1[] ATTR_ALIGN(8) = DUP4 (1);
-static const int16_t constants2[] ATTR_ALIGN(8) = DUP4 (2);
-static const int16_t constants3[] ATTR_ALIGN(8) = DUP4 (3);
-static const int16_t constants6[] ATTR_ALIGN(8) = DUP4 (6);
-static const int8_t constants_fe[] ATTR_ALIGN(8) = DUP8 (0xfe);
-static const int8_t constants_7f[] ATTR_ALIGN(8) = DUP8 (0x7f);
-static const int8_t constants128[] ATTR_ALIGN(8) = DUP8 (128);
-static const int16_t constants256_512[] ATTR_ALIGN(8) =
- {256, 512, 256, 512};
-static const int16_t constants256_1024[] ATTR_ALIGN(8) =
- {256, 1024, 256, 1024};
-
-#define REF_0 0
-#define REF_0_1 1
-#define REF_2 2
-#define REF_2_1 3
-#define REF_4 4
-#define REF_4_1 5
-#define REF_6 6
-#define REF_6_1 7
-#define REF_S0 8
-#define REF_S0_1 9
-#define REF_S2 10
-#define REF_S2_1 11
-#define REF_S4 12
-#define REF_S4_1 13
-#define REF_S6 14
-#define REF_S6_1 15
-#define DST_0 16
-#define DST_1 17
-#define DST_2 18
-#define DST_3 19
-#define CONST_1 20
-#define CONST_2 20
-#define CONST_3 20
-#define CONST_6 20
-#define MASK_fe 20
-#define CONST_128 22
-#define CONST_256 22
-#define CONST_512 22
-#define CONST_1024 22
-#define TMP0 24
-#define TMP1 25
-#define TMP2 26
-#define TMP3 27
-#define TMP4 28
-#define TMP5 29
-#define ZERO 30
-#define MASK_7f 30
-
-#define TMP6 32
-#define TMP8 34
-#define TMP10 36
-#define TMP12 38
-#define TMP14 40
-#define TMP16 42
-#define TMP18 44
-#define TMP20 46
-#define TMP22 48
-#define TMP24 50
-#define TMP26 52
-#define TMP28 54
-#define TMP30 56
-#define TMP32 58
-
-static void MC_put_o_16_vis (uint8_t * dest, const uint8_t * _ref,
- const int stride, int height)
-{
- uint8_t *ref = (uint8_t *) _ref;
-
- ref = vis_alignaddr(ref);
- do { /* 5 cycles */
- vis_ld64(ref[0], TMP0);
-
- vis_ld64_2(ref, 8, TMP2);
-
- vis_ld64_2(ref, 16, TMP4);
- ref += stride;
-
- vis_faligndata(TMP0, TMP2, REF_0);
- vis_st64(REF_0, dest[0]);
-
- vis_faligndata(TMP2, TMP4, REF_2);
- vis_st64_2(REF_2, dest, 8);
- dest += stride;
- } while (--height);
-}
-
-static void MC_put_o_8_vis (uint8_t * dest, const uint8_t * _ref,
- const int stride, int height)
-{
- uint8_t *ref = (uint8_t *) _ref;
-
- ref = vis_alignaddr(ref);
- do { /* 4 cycles */
- vis_ld64(ref[0], TMP0);
-
- vis_ld64(ref[8], TMP2);
- ref += stride;
-
- /* stall */
-
- vis_faligndata(TMP0, TMP2, REF_0);
- vis_st64(REF_0, dest[0]);
- dest += stride;
- } while (--height);
-}
-
-
-static void MC_avg_o_16_vis (uint8_t * dest, const uint8_t * _ref,
- const int stride, int height)
-{
- uint8_t *ref = (uint8_t *) _ref;
- int stride_8 = stride + 8;
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[0], TMP0);
-
- vis_ld64(ref[8], TMP2);
-
- vis_ld64(ref[16], TMP4);
-
- vis_ld64(dest[0], DST_0);
-
- vis_ld64(dest[8], DST_2);
-
- vis_ld64(constants_fe[0], MASK_fe);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64(constants_7f[0], MASK_7f);
- vis_faligndata(TMP2, TMP4, REF_2);
-
- vis_ld64(constants128[0], CONST_128);
-
- ref += stride;
- height = (height >> 1) - 1;
-
- do { /* 24 cycles */
- vis_ld64(ref[0], TMP0);
- vis_xor(DST_0, REF_0, TMP6);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_and(TMP6, MASK_fe, TMP6);
-
- vis_ld64_2(ref, 16, TMP4);
- ref += stride;
- vis_mul8x16(CONST_128, TMP6, TMP6);
- vis_xor(DST_2, REF_2, TMP8);
-
- vis_and(TMP8, MASK_fe, TMP8);
-
- vis_or(DST_0, REF_0, TMP10);
- vis_ld64_2(dest, stride, DST_0);
- vis_mul8x16(CONST_128, TMP8, TMP8);
-
- vis_or(DST_2, REF_2, TMP12);
- vis_ld64_2(dest, stride_8, DST_2);
-
- vis_ld64(ref[0], TMP14);
- vis_and(TMP6, MASK_7f, TMP6);
-
- vis_and(TMP8, MASK_7f, TMP8);
-
- vis_psub16(TMP10, TMP6, TMP6);
- vis_st64(TMP6, dest[0]);
-
- vis_psub16(TMP12, TMP8, TMP8);
- vis_st64_2(TMP8, dest, 8);
-
- dest += stride;
- vis_ld64_2(ref, 8, TMP16);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64_2(ref, 16, TMP18);
- vis_faligndata(TMP2, TMP4, REF_2);
- ref += stride;
-
- vis_xor(DST_0, REF_0, TMP20);
-
- vis_and(TMP20, MASK_fe, TMP20);
-
- vis_xor(DST_2, REF_2, TMP22);
- vis_mul8x16(CONST_128, TMP20, TMP20);
-
- vis_and(TMP22, MASK_fe, TMP22);
-
- vis_or(DST_0, REF_0, TMP24);
- vis_mul8x16(CONST_128, TMP22, TMP22);
-
- vis_or(DST_2, REF_2, TMP26);
-
- vis_ld64_2(dest, stride, DST_0);
- vis_faligndata(TMP14, TMP16, REF_0);
-
- vis_ld64_2(dest, stride_8, DST_2);
- vis_faligndata(TMP16, TMP18, REF_2);
-
- vis_and(TMP20, MASK_7f, TMP20);
-
- vis_and(TMP22, MASK_7f, TMP22);
-
- vis_psub16(TMP24, TMP20, TMP20);
- vis_st64(TMP20, dest[0]);
-
- vis_psub16(TMP26, TMP22, TMP22);
- vis_st64_2(TMP22, dest, 8);
- dest += stride;
- } while (--height);
-
- vis_ld64(ref[0], TMP0);
- vis_xor(DST_0, REF_0, TMP6);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_and(TMP6, MASK_fe, TMP6);
-
- vis_ld64_2(ref, 16, TMP4);
- vis_mul8x16(CONST_128, TMP6, TMP6);
- vis_xor(DST_2, REF_2, TMP8);
-
- vis_and(TMP8, MASK_fe, TMP8);
-
- vis_or(DST_0, REF_0, TMP10);
- vis_ld64_2(dest, stride, DST_0);
- vis_mul8x16(CONST_128, TMP8, TMP8);
-
- vis_or(DST_2, REF_2, TMP12);
- vis_ld64_2(dest, stride_8, DST_2);
-
- vis_ld64(ref[0], TMP14);
- vis_and(TMP6, MASK_7f, TMP6);
-
- vis_and(TMP8, MASK_7f, TMP8);
-
- vis_psub16(TMP10, TMP6, TMP6);
- vis_st64(TMP6, dest[0]);
-
- vis_psub16(TMP12, TMP8, TMP8);
- vis_st64_2(TMP8, dest, 8);
-
- dest += stride;
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_faligndata(TMP2, TMP4, REF_2);
-
- vis_xor(DST_0, REF_0, TMP20);
-
- vis_and(TMP20, MASK_fe, TMP20);
-
- vis_xor(DST_2, REF_2, TMP22);
- vis_mul8x16(CONST_128, TMP20, TMP20);
-
- vis_and(TMP22, MASK_fe, TMP22);
-
- vis_or(DST_0, REF_0, TMP24);
- vis_mul8x16(CONST_128, TMP22, TMP22);
-
- vis_or(DST_2, REF_2, TMP26);
-
- vis_and(TMP20, MASK_7f, TMP20);
-
- vis_and(TMP22, MASK_7f, TMP22);
-
- vis_psub16(TMP24, TMP20, TMP20);
- vis_st64(TMP20, dest[0]);
-
- vis_psub16(TMP26, TMP22, TMP22);
- vis_st64_2(TMP22, dest, 8);
-}
-
-static void MC_avg_o_8_vis (uint8_t * dest, const uint8_t * _ref,
- const int stride, int height)
-{
- uint8_t *ref = (uint8_t *) _ref;
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[0], TMP0);
-
- vis_ld64(ref[8], TMP2);
-
- vis_ld64(dest[0], DST_0);
-
- vis_ld64(constants_fe[0], MASK_fe);
-
- vis_ld64(constants_7f[0], MASK_7f);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64(constants128[0], CONST_128);
-
- ref += stride;
- height = (height >> 1) - 1;
-
- do { /* 12 cycles */
- vis_ld64(ref[0], TMP0);
- vis_xor(DST_0, REF_0, TMP4);
-
- vis_ld64(ref[8], TMP2);
- vis_and(TMP4, MASK_fe, TMP4);
-
- vis_or(DST_0, REF_0, TMP6);
- vis_ld64_2(dest, stride, DST_0);
- ref += stride;
- vis_mul8x16(CONST_128, TMP4, TMP4);
-
- vis_ld64(ref[0], TMP12);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64(ref[8], TMP2);
- vis_xor(DST_0, REF_0, TMP0);
- ref += stride;
-
- vis_and(TMP0, MASK_fe, TMP0);
-
- vis_and(TMP4, MASK_7f, TMP4);
-
- vis_psub16(TMP6, TMP4, TMP4);
- vis_st64(TMP4, dest[0]);
- dest += stride;
- vis_mul8x16(CONST_128, TMP0, TMP0);
-
- vis_or(DST_0, REF_0, TMP6);
- vis_ld64_2(dest, stride, DST_0);
-
- vis_faligndata(TMP12, TMP2, REF_0);
-
- vis_and(TMP0, MASK_7f, TMP0);
-
- vis_psub16(TMP6, TMP0, TMP4);
- vis_st64(TMP4, dest[0]);
- dest += stride;
- } while (--height);
-
- vis_ld64(ref[0], TMP0);
- vis_xor(DST_0, REF_0, TMP4);
-
- vis_ld64(ref[8], TMP2);
- vis_and(TMP4, MASK_fe, TMP4);
-
- vis_or(DST_0, REF_0, TMP6);
- vis_ld64_2(dest, stride, DST_0);
- vis_mul8x16(CONST_128, TMP4, TMP4);
-
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_xor(DST_0, REF_0, TMP0);
-
- vis_and(TMP0, MASK_fe, TMP0);
-
- vis_and(TMP4, MASK_7f, TMP4);
-
- vis_psub16(TMP6, TMP4, TMP4);
- vis_st64(TMP4, dest[0]);
- dest += stride;
- vis_mul8x16(CONST_128, TMP0, TMP0);
-
- vis_or(DST_0, REF_0, TMP6);
-
- vis_and(TMP0, MASK_7f, TMP0);
-
- vis_psub16(TMP6, TMP0, TMP4);
- vis_st64(TMP4, dest[0]);
-}
-
-static void MC_put_x_16_vis (uint8_t * dest, const uint8_t * _ref,
- const int stride, int height)
-{
- uint8_t *ref = (uint8_t *) _ref;
- unsigned long off = (unsigned long) ref & 0x7;
- unsigned long off_plus_1 = off + 1;
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[0], TMP0);
-
- vis_ld64_2(ref, 8, TMP2);
-
- vis_ld64_2(ref, 16, TMP4);
-
- vis_ld64(constants_fe[0], MASK_fe);
-
- vis_ld64(constants_7f[0], MASK_7f);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64(constants128[0], CONST_128);
- vis_faligndata(TMP2, TMP4, REF_4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- vis_faligndata(TMP2, TMP4, REF_6);
- } else {
- vis_src1(TMP2, REF_2);
- vis_src1(TMP4, REF_6);
- }
-
- ref += stride;
- height = (height >> 1) - 1;
-
- do { /* 34 cycles */
- vis_ld64(ref[0], TMP0);
- vis_xor(REF_0, REF_2, TMP6);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_xor(REF_4, REF_6, TMP8);
-
- vis_ld64_2(ref, 16, TMP4);
- vis_and(TMP6, MASK_fe, TMP6);
- ref += stride;
-
- vis_ld64(ref[0], TMP14);
- vis_mul8x16(CONST_128, TMP6, TMP6);
- vis_and(TMP8, MASK_fe, TMP8);
-
- vis_ld64_2(ref, 8, TMP16);
- vis_mul8x16(CONST_128, TMP8, TMP8);
- vis_or(REF_0, REF_2, TMP10);
-
- vis_ld64_2(ref, 16, TMP18);
- ref += stride;
- vis_or(REF_4, REF_6, TMP12);
-
- vis_alignaddr_g0((void *)off);
-
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_faligndata(TMP2, TMP4, REF_4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- vis_faligndata(TMP2, TMP4, REF_6);
- } else {
- vis_src1(TMP2, REF_2);
- vis_src1(TMP4, REF_6);
- }
-
- vis_and(TMP6, MASK_7f, TMP6);
-
- vis_and(TMP8, MASK_7f, TMP8);
-
- vis_psub16(TMP10, TMP6, TMP6);
- vis_st64(TMP6, dest[0]);
-
- vis_psub16(TMP12, TMP8, TMP8);
- vis_st64_2(TMP8, dest, 8);
- dest += stride;
-
- vis_xor(REF_0, REF_2, TMP6);
-
- vis_xor(REF_4, REF_6, TMP8);
-
- vis_and(TMP6, MASK_fe, TMP6);
-
- vis_mul8x16(CONST_128, TMP6, TMP6);
- vis_and(TMP8, MASK_fe, TMP8);
-
- vis_mul8x16(CONST_128, TMP8, TMP8);
- vis_or(REF_0, REF_2, TMP10);
-
- vis_or(REF_4, REF_6, TMP12);
-
- vis_alignaddr_g0((void *)off);
-
- vis_faligndata(TMP14, TMP16, REF_0);
-
- vis_faligndata(TMP16, TMP18, REF_4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP14, TMP16, REF_2);
- vis_faligndata(TMP16, TMP18, REF_6);
- } else {
- vis_src1(TMP16, REF_2);
- vis_src1(TMP18, REF_6);
- }
-
- vis_and(TMP6, MASK_7f, TMP6);
-
- vis_and(TMP8, MASK_7f, TMP8);
-
- vis_psub16(TMP10, TMP6, TMP6);
- vis_st64(TMP6, dest[0]);
-
- vis_psub16(TMP12, TMP8, TMP8);
- vis_st64_2(TMP8, dest, 8);
- dest += stride;
- } while (--height);
-
- vis_ld64(ref[0], TMP0);
- vis_xor(REF_0, REF_2, TMP6);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_xor(REF_4, REF_6, TMP8);
-
- vis_ld64_2(ref, 16, TMP4);
- vis_and(TMP6, MASK_fe, TMP6);
-
- vis_mul8x16(CONST_128, TMP6, TMP6);
- vis_and(TMP8, MASK_fe, TMP8);
-
- vis_mul8x16(CONST_128, TMP8, TMP8);
- vis_or(REF_0, REF_2, TMP10);
-
- vis_or(REF_4, REF_6, TMP12);
-
- vis_alignaddr_g0((void *)off);
-
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_faligndata(TMP2, TMP4, REF_4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- vis_faligndata(TMP2, TMP4, REF_6);
- } else {
- vis_src1(TMP2, REF_2);
- vis_src1(TMP4, REF_6);
- }
-
- vis_and(TMP6, MASK_7f, TMP6);
-
- vis_and(TMP8, MASK_7f, TMP8);
-
- vis_psub16(TMP10, TMP6, TMP6);
- vis_st64(TMP6, dest[0]);
-
- vis_psub16(TMP12, TMP8, TMP8);
- vis_st64_2(TMP8, dest, 8);
- dest += stride;
-
- vis_xor(REF_0, REF_2, TMP6);
-
- vis_xor(REF_4, REF_6, TMP8);
-
- vis_and(TMP6, MASK_fe, TMP6);
-
- vis_mul8x16(CONST_128, TMP6, TMP6);
- vis_and(TMP8, MASK_fe, TMP8);
-
- vis_mul8x16(CONST_128, TMP8, TMP8);
- vis_or(REF_0, REF_2, TMP10);
-
- vis_or(REF_4, REF_6, TMP12);
-
- vis_and(TMP6, MASK_7f, TMP6);
-
- vis_and(TMP8, MASK_7f, TMP8);
-
- vis_psub16(TMP10, TMP6, TMP6);
- vis_st64(TMP6, dest[0]);
-
- vis_psub16(TMP12, TMP8, TMP8);
- vis_st64_2(TMP8, dest, 8);
-}
-
-static void MC_put_x_8_vis (uint8_t * dest, const uint8_t * _ref,
- const int stride, int height)
-{
- uint8_t *ref = (uint8_t *) _ref;
- unsigned long off = (unsigned long) ref & 0x7;
- unsigned long off_plus_1 = off + 1;
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[0], TMP0);
-
- vis_ld64(ref[8], TMP2);
-
- vis_ld64(constants_fe[0], MASK_fe);
-
- vis_ld64(constants_7f[0], MASK_7f);
-
- vis_ld64(constants128[0], CONST_128);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- } else {
- vis_src1(TMP2, REF_2);
- }
-
- ref += stride;
- height = (height >> 1) - 1;
-
- do { /* 20 cycles */
- vis_ld64(ref[0], TMP0);
- vis_xor(REF_0, REF_2, TMP4);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_and(TMP4, MASK_fe, TMP4);
- ref += stride;
-
- vis_ld64(ref[0], TMP8);
- vis_or(REF_0, REF_2, TMP6);
- vis_mul8x16(CONST_128, TMP4, TMP4);
-
- vis_alignaddr_g0((void *)off);
-
- vis_ld64_2(ref, 8, TMP10);
- ref += stride;
- vis_faligndata(TMP0, TMP2, REF_0);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- } else {
- vis_src1(TMP2, REF_2);
- }
-
- vis_and(TMP4, MASK_7f, TMP4);
-
- vis_psub16(TMP6, TMP4, DST_0);
- vis_st64(DST_0, dest[0]);
- dest += stride;
-
- vis_xor(REF_0, REF_2, TMP12);
-
- vis_and(TMP12, MASK_fe, TMP12);
-
- vis_or(REF_0, REF_2, TMP14);
- vis_mul8x16(CONST_128, TMP12, TMP12);
-
- vis_alignaddr_g0((void *)off);
- vis_faligndata(TMP8, TMP10, REF_0);
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP8, TMP10, REF_2);
- } else {
- vis_src1(TMP10, REF_2);
- }
-
- vis_and(TMP12, MASK_7f, TMP12);
-
- vis_psub16(TMP14, TMP12, DST_0);
- vis_st64(DST_0, dest[0]);
- dest += stride;
- } while (--height);
-
- vis_ld64(ref[0], TMP0);
- vis_xor(REF_0, REF_2, TMP4);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_and(TMP4, MASK_fe, TMP4);
-
- vis_or(REF_0, REF_2, TMP6);
- vis_mul8x16(CONST_128, TMP4, TMP4);
-
- vis_alignaddr_g0((void *)off);
-
- vis_faligndata(TMP0, TMP2, REF_0);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- } else {
- vis_src1(TMP2, REF_2);
- }
-
- vis_and(TMP4, MASK_7f, TMP4);
-
- vis_psub16(TMP6, TMP4, DST_0);
- vis_st64(DST_0, dest[0]);
- dest += stride;
-
- vis_xor(REF_0, REF_2, TMP12);
-
- vis_and(TMP12, MASK_fe, TMP12);
-
- vis_or(REF_0, REF_2, TMP14);
- vis_mul8x16(CONST_128, TMP12, TMP12);
-
- vis_and(TMP12, MASK_7f, TMP12);
-
- vis_psub16(TMP14, TMP12, DST_0);
- vis_st64(DST_0, dest[0]);
- dest += stride;
-}
-
-static void MC_avg_x_16_vis (uint8_t * dest, const uint8_t * _ref,
- const int stride, int height)
-{
- uint8_t *ref = (uint8_t *) _ref;
- unsigned long off = (unsigned long) ref & 0x7;
- unsigned long off_plus_1 = off + 1;
-
- vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
-
- vis_ld64(constants3[0], CONST_3);
- vis_fzero(ZERO);
- vis_ld64(constants256_512[0], CONST_256);
-
- ref = vis_alignaddr(ref);
- do { /* 26 cycles */
- vis_ld64(ref[0], TMP0);
-
- vis_ld64(ref[8], TMP2);
-
- vis_alignaddr_g0((void *)off);
-
- vis_ld64(ref[16], TMP4);
-
- vis_ld64(dest[0], DST_0);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64(dest[8], DST_2);
- vis_faligndata(TMP2, TMP4, REF_4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- vis_faligndata(TMP2, TMP4, REF_6);
- } else {
- vis_src1(TMP2, REF_2);
- vis_src1(TMP4, REF_6);
- }
-
- vis_mul8x16au(REF_0, CONST_256, TMP0);
-
- vis_pmerge(ZERO, REF_2, TMP4);
- vis_mul8x16au(REF_0_1, CONST_256, TMP2);
-
- vis_pmerge(ZERO, REF_2_1, TMP6);
-
- vis_padd16(TMP0, TMP4, TMP0);
-
- vis_mul8x16al(DST_0, CONST_512, TMP4);
- vis_padd16(TMP2, TMP6, TMP2);
-
- vis_mul8x16al(DST_1, CONST_512, TMP6);
-
- vis_mul8x16au(REF_6, CONST_256, TMP12);
-
- vis_padd16(TMP0, TMP4, TMP0);
- vis_mul8x16au(REF_6_1, CONST_256, TMP14);
-
- vis_padd16(TMP2, TMP6, TMP2);
- vis_mul8x16au(REF_4, CONST_256, TMP16);
-
- vis_padd16(TMP0, CONST_3, TMP8);
- vis_mul8x16au(REF_4_1, CONST_256, TMP18);
-
- vis_padd16(TMP2, CONST_3, TMP10);
- vis_pack16(TMP8, DST_0);
-
- vis_pack16(TMP10, DST_1);
- vis_padd16(TMP16, TMP12, TMP0);
-
- vis_st64(DST_0, dest[0]);
- vis_mul8x16al(DST_2, CONST_512, TMP4);
- vis_padd16(TMP18, TMP14, TMP2);
-
- vis_mul8x16al(DST_3, CONST_512, TMP6);
- vis_padd16(TMP0, CONST_3, TMP0);
-
- vis_padd16(TMP2, CONST_3, TMP2);
-
- vis_padd16(TMP0, TMP4, TMP0);
-
- vis_padd16(TMP2, TMP6, TMP2);
- vis_pack16(TMP0, DST_2);
-
- vis_pack16(TMP2, DST_3);
- vis_st64(DST_2, dest[8]);
-
- ref += stride;
- dest += stride;
- } while (--height);
-}
-
-static void MC_avg_x_8_vis (uint8_t * dest, const uint8_t * _ref,
- const int stride, int height)
-{
- uint8_t *ref = (uint8_t *) _ref;
- unsigned long off = (unsigned long) ref & 0x7;
- unsigned long off_plus_1 = off + 1;
- int stride_times_2 = stride << 1;
-
- vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
-
- vis_ld64(constants3[0], CONST_3);
- vis_fzero(ZERO);
- vis_ld64(constants256_512[0], CONST_256);
-
- ref = vis_alignaddr(ref);
- height >>= 2;
- do { /* 47 cycles */
- vis_ld64(ref[0], TMP0);
-
- vis_ld64_2(ref, 8, TMP2);
- ref += stride;
-
- vis_alignaddr_g0((void *)off);
-
- vis_ld64(ref[0], TMP4);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64_2(ref, 8, TMP6);
- ref += stride;
-
- vis_ld64(ref[0], TMP8);
-
- vis_ld64_2(ref, 8, TMP10);
- ref += stride;
- vis_faligndata(TMP4, TMP6, REF_4);
-
- vis_ld64(ref[0], TMP12);
-
- vis_ld64_2(ref, 8, TMP14);
- ref += stride;
- vis_faligndata(TMP8, TMP10, REF_S0);
-
- vis_faligndata(TMP12, TMP14, REF_S4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
-
- vis_ld64(dest[0], DST_0);
- vis_faligndata(TMP0, TMP2, REF_2);
-
- vis_ld64_2(dest, stride, DST_2);
- vis_faligndata(TMP4, TMP6, REF_6);
-
- vis_faligndata(TMP8, TMP10, REF_S2);
-
- vis_faligndata(TMP12, TMP14, REF_S6);
- } else {
- vis_ld64(dest[0], DST_0);
- vis_src1(TMP2, REF_2);
-
- vis_ld64_2(dest, stride, DST_2);
- vis_src1(TMP6, REF_6);
-
- vis_src1(TMP10, REF_S2);
-
- vis_src1(TMP14, REF_S6);
- }
-
- vis_pmerge(ZERO, REF_0, TMP0);
- vis_mul8x16au(REF_0_1, CONST_256, TMP2);
-
- vis_pmerge(ZERO, REF_2, TMP4);
- vis_mul8x16au(REF_2_1, CONST_256, TMP6);
-
- vis_padd16(TMP0, CONST_3, TMP0);
- vis_mul8x16al(DST_0, CONST_512, TMP16);
-
- vis_padd16(TMP2, CONST_3, TMP2);
- vis_mul8x16al(DST_1, CONST_512, TMP18);
-
- vis_padd16(TMP0, TMP4, TMP0);
- vis_mul8x16au(REF_4, CONST_256, TMP8);
-
- vis_padd16(TMP2, TMP6, TMP2);
- vis_mul8x16au(REF_4_1, CONST_256, TMP10);
-
- vis_padd16(TMP0, TMP16, TMP0);
- vis_mul8x16au(REF_6, CONST_256, TMP12);
-
- vis_padd16(TMP2, TMP18, TMP2);
- vis_mul8x16au(REF_6_1, CONST_256, TMP14);
-
- vis_padd16(TMP8, CONST_3, TMP8);
- vis_mul8x16al(DST_2, CONST_512, TMP16);
-
- vis_padd16(TMP8, TMP12, TMP8);
- vis_mul8x16al(DST_3, CONST_512, TMP18);
-
- vis_padd16(TMP10, TMP14, TMP10);
- vis_pack16(TMP0, DST_0);
-
- vis_pack16(TMP2, DST_1);
- vis_st64(DST_0, dest[0]);
- dest += stride;
- vis_padd16(TMP10, CONST_3, TMP10);
-
- vis_ld64_2(dest, stride, DST_0);
- vis_padd16(TMP8, TMP16, TMP8);
-
- vis_ld64_2(dest, stride_times_2, TMP4/*DST_2*/);
- vis_padd16(TMP10, TMP18, TMP10);
- vis_pack16(TMP8, DST_2);
-
- vis_pack16(TMP10, DST_3);
- vis_st64(DST_2, dest[0]);
- dest += stride;
-
- vis_mul8x16au(REF_S0_1, CONST_256, TMP2);
- vis_pmerge(ZERO, REF_S0, TMP0);
-
- vis_pmerge(ZERO, REF_S2, TMP24);
- vis_mul8x16au(REF_S2_1, CONST_256, TMP6);
-
- vis_padd16(TMP0, CONST_3, TMP0);
- vis_mul8x16au(REF_S4, CONST_256, TMP8);
-
- vis_padd16(TMP2, CONST_3, TMP2);
- vis_mul8x16au(REF_S4_1, CONST_256, TMP10);
-
- vis_padd16(TMP0, TMP24, TMP0);
- vis_mul8x16au(REF_S6, CONST_256, TMP12);
-
- vis_padd16(TMP2, TMP6, TMP2);
- vis_mul8x16au(REF_S6_1, CONST_256, TMP14);
-
- vis_padd16(TMP8, CONST_3, TMP8);
- vis_mul8x16al(DST_0, CONST_512, TMP16);
-
- vis_padd16(TMP10, CONST_3, TMP10);
- vis_mul8x16al(DST_1, CONST_512, TMP18);
-
- vis_padd16(TMP8, TMP12, TMP8);
- vis_mul8x16al(TMP4/*DST_2*/, CONST_512, TMP20);
-
- vis_mul8x16al(TMP5/*DST_3*/, CONST_512, TMP22);
- vis_padd16(TMP0, TMP16, TMP0);
-
- vis_padd16(TMP2, TMP18, TMP2);
- vis_pack16(TMP0, DST_0);
-
- vis_padd16(TMP10, TMP14, TMP10);
- vis_pack16(TMP2, DST_1);
- vis_st64(DST_0, dest[0]);
- dest += stride;
-
- vis_padd16(TMP8, TMP20, TMP8);
-
- vis_padd16(TMP10, TMP22, TMP10);
- vis_pack16(TMP8, DST_2);
-
- vis_pack16(TMP10, DST_3);
- vis_st64(DST_2, dest[0]);
- dest += stride;
- } while (--height);
-}
-
-static void MC_put_y_16_vis (uint8_t * dest, const uint8_t * _ref,
- const int stride, int height)
-{
- uint8_t *ref = (uint8_t *) _ref;
-
- ref = vis_alignaddr(ref);
- vis_ld64(ref[0], TMP0);
-
- vis_ld64_2(ref, 8, TMP2);
-
- vis_ld64_2(ref, 16, TMP4);
- ref += stride;
-
- vis_ld64(ref[0], TMP6);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64_2(ref, 8, TMP8);
- vis_faligndata(TMP2, TMP4, REF_4);
-
- vis_ld64_2(ref, 16, TMP10);
- ref += stride;
-
- vis_ld64(constants_fe[0], MASK_fe);
- vis_faligndata(TMP6, TMP8, REF_2);
-
- vis_ld64(constants_7f[0], MASK_7f);
- vis_faligndata(TMP8, TMP10, REF_6);
-
- vis_ld64(constants128[0], CONST_128);
- height = (height >> 1) - 1;
- do { /* 24 cycles */
- vis_ld64(ref[0], TMP0);
- vis_xor(REF_0, REF_2, TMP12);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_xor(REF_4, REF_6, TMP16);
-
- vis_ld64_2(ref, 16, TMP4);
- ref += stride;
- vis_or(REF_0, REF_2, TMP14);
-
- vis_ld64(ref[0], TMP6);
- vis_or(REF_4, REF_6, TMP18);
-
- vis_ld64_2(ref, 8, TMP8);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64_2(ref, 16, TMP10);
- ref += stride;
- vis_faligndata(TMP2, TMP4, REF_4);
-
- vis_and(TMP12, MASK_fe, TMP12);
-
- vis_and(TMP16, MASK_fe, TMP16);
- vis_mul8x16(CONST_128, TMP12, TMP12);
-
- vis_mul8x16(CONST_128, TMP16, TMP16);
- vis_xor(REF_0, REF_2, TMP0);
-
- vis_xor(REF_4, REF_6, TMP2);
-
- vis_or(REF_0, REF_2, TMP20);
-
- vis_and(TMP12, MASK_7f, TMP12);
-
- vis_and(TMP16, MASK_7f, TMP16);
-
- vis_psub16(TMP14, TMP12, TMP12);
- vis_st64(TMP12, dest[0]);
-
- vis_psub16(TMP18, TMP16, TMP16);
- vis_st64_2(TMP16, dest, 8);
- dest += stride;
-
- vis_or(REF_4, REF_6, TMP18);
-
- vis_and(TMP0, MASK_fe, TMP0);
-
- vis_and(TMP2, MASK_fe, TMP2);
- vis_mul8x16(CONST_128, TMP0, TMP0);
-
- vis_faligndata(TMP6, TMP8, REF_2);
- vis_mul8x16(CONST_128, TMP2, TMP2);
-
- vis_faligndata(TMP8, TMP10, REF_6);
-
- vis_and(TMP0, MASK_7f, TMP0);
-
- vis_and(TMP2, MASK_7f, TMP2);
-
- vis_psub16(TMP20, TMP0, TMP0);
- vis_st64(TMP0, dest[0]);
-
- vis_psub16(TMP18, TMP2, TMP2);
- vis_st64_2(TMP2, dest, 8);
- dest += stride;
- } while (--height);
-
- vis_ld64(ref[0], TMP0);
- vis_xor(REF_0, REF_2, TMP12);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_xor(REF_4, REF_6, TMP16);
-
- vis_ld64_2(ref, 16, TMP4);
- vis_or(REF_0, REF_2, TMP14);
-
- vis_or(REF_4, REF_6, TMP18);
-
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_faligndata(TMP2, TMP4, REF_4);
-
- vis_and(TMP12, MASK_fe, TMP12);
-
- vis_and(TMP16, MASK_fe, TMP16);
- vis_mul8x16(CONST_128, TMP12, TMP12);
-
- vis_mul8x16(CONST_128, TMP16, TMP16);
- vis_xor(REF_0, REF_2, TMP0);
-
- vis_xor(REF_4, REF_6, TMP2);
-
- vis_or(REF_0, REF_2, TMP20);
-
- vis_and(TMP12, MASK_7f, TMP12);
-
- vis_and(TMP16, MASK_7f, TMP16);
-
- vis_psub16(TMP14, TMP12, TMP12);
- vis_st64(TMP12, dest[0]);
-
- vis_psub16(TMP18, TMP16, TMP16);
- vis_st64_2(TMP16, dest, 8);
- dest += stride;
-
- vis_or(REF_4, REF_6, TMP18);
-
- vis_and(TMP0, MASK_fe, TMP0);
-
- vis_and(TMP2, MASK_fe, TMP2);
- vis_mul8x16(CONST_128, TMP0, TMP0);
-
- vis_mul8x16(CONST_128, TMP2, TMP2);
-
- vis_and(TMP0, MASK_7f, TMP0);
-
- vis_and(TMP2, MASK_7f, TMP2);
-
- vis_psub16(TMP20, TMP0, TMP0);
- vis_st64(TMP0, dest[0]);
-
- vis_psub16(TMP18, TMP2, TMP2);
- vis_st64_2(TMP2, dest, 8);
-}
-
-static void MC_put_y_8_vis (uint8_t * dest, const uint8_t * _ref,
- const int stride, int height)
-{
- uint8_t *ref = (uint8_t *) _ref;
-
- ref = vis_alignaddr(ref);
- vis_ld64(ref[0], TMP0);
-
- vis_ld64_2(ref, 8, TMP2);
- ref += stride;
-
- vis_ld64(ref[0], TMP4);
-
- vis_ld64_2(ref, 8, TMP6);
- ref += stride;
-
- vis_ld64(constants_fe[0], MASK_fe);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64(constants_7f[0], MASK_7f);
- vis_faligndata(TMP4, TMP6, REF_2);
-
- vis_ld64(constants128[0], CONST_128);
- height = (height >> 1) - 1;
- do { /* 12 cycles */
- vis_ld64(ref[0], TMP0);
- vis_xor(REF_0, REF_2, TMP4);
-
- vis_ld64_2(ref, 8, TMP2);
- ref += stride;
- vis_and(TMP4, MASK_fe, TMP4);
-
- vis_or(REF_0, REF_2, TMP6);
- vis_mul8x16(CONST_128, TMP4, TMP4);
-
- vis_faligndata(TMP0, TMP2, REF_0);
- vis_ld64(ref[0], TMP0);
-
- vis_ld64_2(ref, 8, TMP2);
- ref += stride;
- vis_xor(REF_0, REF_2, TMP12);
-
- vis_and(TMP4, MASK_7f, TMP4);
-
- vis_and(TMP12, MASK_fe, TMP12);
-
- vis_mul8x16(CONST_128, TMP12, TMP12);
- vis_or(REF_0, REF_2, TMP14);
-
- vis_psub16(TMP6, TMP4, DST_0);
- vis_st64(DST_0, dest[0]);
- dest += stride;
-
- vis_faligndata(TMP0, TMP2, REF_2);
-
- vis_and(TMP12, MASK_7f, TMP12);
-
- vis_psub16(TMP14, TMP12, DST_0);
- vis_st64(DST_0, dest[0]);
- dest += stride;
- } while (--height);
-
- vis_ld64(ref[0], TMP0);
- vis_xor(REF_0, REF_2, TMP4);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_and(TMP4, MASK_fe, TMP4);
-
- vis_or(REF_0, REF_2, TMP6);
- vis_mul8x16(CONST_128, TMP4, TMP4);
-
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_xor(REF_0, REF_2, TMP12);
-
- vis_and(TMP4, MASK_7f, TMP4);
-
- vis_and(TMP12, MASK_fe, TMP12);
-
- vis_mul8x16(CONST_128, TMP12, TMP12);
- vis_or(REF_0, REF_2, TMP14);
-
- vis_psub16(TMP6, TMP4, DST_0);
- vis_st64(DST_0, dest[0]);
- dest += stride;
-
- vis_and(TMP12, MASK_7f, TMP12);
-
- vis_psub16(TMP14, TMP12, DST_0);
- vis_st64(DST_0, dest[0]);
-}
-
-static void MC_avg_y_16_vis (uint8_t * dest, const uint8_t * _ref,
- const int stride, int height)
-{
- uint8_t *ref = (uint8_t *) _ref;
- int stride_8 = stride + 8;
- int stride_16 = stride + 16;
-
- vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[ 0], TMP0);
- vis_fzero(ZERO);
-
- vis_ld64(ref[ 8], TMP2);
-
- vis_ld64(ref[16], TMP4);
-
- vis_ld64(constants3[0], CONST_3);
- vis_faligndata(TMP0, TMP2, REF_2);
-
- vis_ld64(constants256_512[0], CONST_256);
- vis_faligndata(TMP2, TMP4, REF_6);
- height >>= 1;
-
- do { /* 31 cycles */
- vis_ld64_2(ref, stride, TMP0);
- vis_pmerge(ZERO, REF_2, TMP12);
- vis_mul8x16au(REF_2_1, CONST_256, TMP14);
-
- vis_ld64_2(ref, stride_8, TMP2);
- vis_pmerge(ZERO, REF_6, TMP16);
- vis_mul8x16au(REF_6_1, CONST_256, TMP18);
-
- vis_ld64_2(ref, stride_16, TMP4);
- ref += stride;
-
- vis_ld64(dest[0], DST_0);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64_2(dest, 8, DST_2);
- vis_faligndata(TMP2, TMP4, REF_4);
-
- vis_ld64_2(ref, stride, TMP6);
- vis_pmerge(ZERO, REF_0, TMP0);
- vis_mul8x16au(REF_0_1, CONST_256, TMP2);
-
- vis_ld64_2(ref, stride_8, TMP8);
- vis_pmerge(ZERO, REF_4, TMP4);
-
- vis_ld64_2(ref, stride_16, TMP10);
- ref += stride;
-
- vis_ld64_2(dest, stride, REF_S0/*DST_4*/);
- vis_faligndata(TMP6, TMP8, REF_2);
- vis_mul8x16au(REF_4_1, CONST_256, TMP6);
-
- vis_ld64_2(dest, stride_8, REF_S2/*DST_6*/);
- vis_faligndata(TMP8, TMP10, REF_6);
- vis_mul8x16al(DST_0, CONST_512, TMP20);
-
- vis_padd16(TMP0, CONST_3, TMP0);
- vis_mul8x16al(DST_1, CONST_512, TMP22);
-
- vis_padd16(TMP2, CONST_3, TMP2);
- vis_mul8x16al(DST_2, CONST_512, TMP24);
-
- vis_padd16(TMP4, CONST_3, TMP4);
- vis_mul8x16al(DST_3, CONST_512, TMP26);
-
- vis_padd16(TMP6, CONST_3, TMP6);
-
- vis_padd16(TMP12, TMP20, TMP12);
- vis_mul8x16al(REF_S0, CONST_512, TMP20);
-
- vis_padd16(TMP14, TMP22, TMP14);
- vis_mul8x16al(REF_S0_1, CONST_512, TMP22);
-
- vis_padd16(TMP16, TMP24, TMP16);
- vis_mul8x16al(REF_S2, CONST_512, TMP24);
-
- vis_padd16(TMP18, TMP26, TMP18);
- vis_mul8x16al(REF_S2_1, CONST_512, TMP26);
-
- vis_padd16(TMP12, TMP0, TMP12);
- vis_mul8x16au(REF_2, CONST_256, TMP28);
-
- vis_padd16(TMP14, TMP2, TMP14);
- vis_mul8x16au(REF_2_1, CONST_256, TMP30);
-
- vis_padd16(TMP16, TMP4, TMP16);
- vis_mul8x16au(REF_6, CONST_256, REF_S4);
-
- vis_padd16(TMP18, TMP6, TMP18);
- vis_mul8x16au(REF_6_1, CONST_256, REF_S6);
-
- vis_pack16(TMP12, DST_0);
- vis_padd16(TMP28, TMP0, TMP12);
-
- vis_pack16(TMP14, DST_1);
- vis_st64(DST_0, dest[0]);
- vis_padd16(TMP30, TMP2, TMP14);
-
- vis_pack16(TMP16, DST_2);
- vis_padd16(REF_S4, TMP4, TMP16);
-
- vis_pack16(TMP18, DST_3);
- vis_st64_2(DST_2, dest, 8);
- dest += stride;
- vis_padd16(REF_S6, TMP6, TMP18);
-
- vis_padd16(TMP12, TMP20, TMP12);
-
- vis_padd16(TMP14, TMP22, TMP14);
- vis_pack16(TMP12, DST_0);
-
- vis_padd16(TMP16, TMP24, TMP16);
- vis_pack16(TMP14, DST_1);
- vis_st64(DST_0, dest[0]);
-
- vis_padd16(TMP18, TMP26, TMP18);
- vis_pack16(TMP16, DST_2);
-
- vis_pack16(TMP18, DST_3);
- vis_st64_2(DST_2, dest, 8);
- dest += stride;
- } while (--height);
-}
-
-static void MC_avg_y_8_vis (uint8_t * dest, const uint8_t * _ref,
- const int stride, int height)
-{
- uint8_t *ref = (uint8_t *) _ref;
- int stride_8 = stride + 8;
-
- vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[ 0], TMP0);
- vis_fzero(ZERO);
-
- vis_ld64(ref[ 8], TMP2);
-
- vis_ld64(constants3[0], CONST_3);
- vis_faligndata(TMP0, TMP2, REF_2);
-
- vis_ld64(constants256_512[0], CONST_256);
-
- height >>= 1;
- do { /* 20 cycles */
- vis_ld64_2(ref, stride, TMP0);
- vis_pmerge(ZERO, REF_2, TMP8);
- vis_mul8x16au(REF_2_1, CONST_256, TMP10);
-
- vis_ld64_2(ref, stride_8, TMP2);
- ref += stride;
-
- vis_ld64(dest[0], DST_0);
-
- vis_ld64_2(dest, stride, DST_2);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64_2(ref, stride, TMP4);
- vis_mul8x16al(DST_0, CONST_512, TMP16);
- vis_pmerge(ZERO, REF_0, TMP12);
-
- vis_ld64_2(ref, stride_8, TMP6);
- ref += stride;
- vis_mul8x16al(DST_1, CONST_512, TMP18);
- vis_pmerge(ZERO, REF_0_1, TMP14);
-
- vis_padd16(TMP12, CONST_3, TMP12);
- vis_mul8x16al(DST_2, CONST_512, TMP24);
-
- vis_padd16(TMP14, CONST_3, TMP14);
- vis_mul8x16al(DST_3, CONST_512, TMP26);
-
- vis_faligndata(TMP4, TMP6, REF_2);
-
- vis_padd16(TMP8, TMP12, TMP8);
-
- vis_padd16(TMP10, TMP14, TMP10);
- vis_mul8x16au(REF_2, CONST_256, TMP20);
-
- vis_padd16(TMP8, TMP16, TMP0);
- vis_mul8x16au(REF_2_1, CONST_256, TMP22);
-
- vis_padd16(TMP10, TMP18, TMP2);
- vis_pack16(TMP0, DST_0);
-
- vis_pack16(TMP2, DST_1);
- vis_st64(DST_0, dest[0]);
- dest += stride;
- vis_padd16(TMP12, TMP20, TMP12);
-
- vis_padd16(TMP14, TMP22, TMP14);
-
- vis_padd16(TMP12, TMP24, TMP0);
-
- vis_padd16(TMP14, TMP26, TMP2);
- vis_pack16(TMP0, DST_2);
-
- vis_pack16(TMP2, DST_3);
- vis_st64(DST_2, dest[0]);
- dest += stride;
- } while (--height);
-}
-
-static void MC_put_xy_16_vis (uint8_t * dest, const uint8_t * _ref,
- const int stride, int height)
-{
- uint8_t *ref = (uint8_t *) _ref;
- unsigned long off = (unsigned long) ref & 0x7;
- unsigned long off_plus_1 = off + 1;
- int stride_8 = stride + 8;
- int stride_16 = stride + 16;
-
- vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[ 0], TMP0);
- vis_fzero(ZERO);
-
- vis_ld64(ref[ 8], TMP2);
-
- vis_ld64(ref[16], TMP4);
-
- vis_ld64(constants2[0], CONST_2);
- vis_faligndata(TMP0, TMP2, REF_S0);
-
- vis_ld64(constants256_512[0], CONST_256);
- vis_faligndata(TMP2, TMP4, REF_S4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_S2);
- vis_faligndata(TMP2, TMP4, REF_S6);
- } else {
- vis_src1(TMP2, REF_S2);
- vis_src1(TMP4, REF_S6);
- }
-
- height >>= 1;
- do {
- vis_ld64_2(ref, stride, TMP0);
- vis_mul8x16au(REF_S0, CONST_256, TMP12);
- vis_pmerge(ZERO, REF_S0_1, TMP14);
-
- vis_alignaddr_g0((void *)off);
-
- vis_ld64_2(ref, stride_8, TMP2);
- vis_mul8x16au(REF_S2, CONST_256, TMP16);
- vis_pmerge(ZERO, REF_S2_1, TMP18);
-
- vis_ld64_2(ref, stride_16, TMP4);
- ref += stride;
- vis_mul8x16au(REF_S4, CONST_256, TMP20);
- vis_pmerge(ZERO, REF_S4_1, TMP22);
-
- vis_ld64_2(ref, stride, TMP6);
- vis_mul8x16au(REF_S6, CONST_256, TMP24);
- vis_pmerge(ZERO, REF_S6_1, TMP26);
-
- vis_ld64_2(ref, stride_8, TMP8);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64_2(ref, stride_16, TMP10);
- ref += stride;
- vis_faligndata(TMP2, TMP4, REF_4);
-
- vis_faligndata(TMP6, TMP8, REF_S0);
-
- vis_faligndata(TMP8, TMP10, REF_S4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- vis_faligndata(TMP2, TMP4, REF_6);
- vis_faligndata(TMP6, TMP8, REF_S2);
- vis_faligndata(TMP8, TMP10, REF_S6);
- } else {
- vis_src1(TMP2, REF_2);
- vis_src1(TMP4, REF_6);
- vis_src1(TMP8, REF_S2);
- vis_src1(TMP10, REF_S6);
- }
-
- vis_mul8x16au(REF_0, CONST_256, TMP0);
- vis_pmerge(ZERO, REF_0_1, TMP2);
-
- vis_mul8x16au(REF_2, CONST_256, TMP4);
- vis_pmerge(ZERO, REF_2_1, TMP6);
-
- vis_padd16(TMP0, CONST_2, TMP8);
- vis_mul8x16au(REF_4, CONST_256, TMP0);
-
- vis_padd16(TMP2, CONST_2, TMP10);
- vis_mul8x16au(REF_4_1, CONST_256, TMP2);
-
- vis_padd16(TMP8, TMP4, TMP8);
- vis_mul8x16au(REF_6, CONST_256, TMP4);
-
- vis_padd16(TMP10, TMP6, TMP10);
- vis_mul8x16au(REF_6_1, CONST_256, TMP6);
-
- vis_padd16(TMP12, TMP8, TMP12);
-
- vis_padd16(TMP14, TMP10, TMP14);
-
- vis_padd16(TMP12, TMP16, TMP12);
-
- vis_padd16(TMP14, TMP18, TMP14);
- vis_pack16(TMP12, DST_0);
-
- vis_pack16(TMP14, DST_1);
- vis_st64(DST_0, dest[0]);
- vis_padd16(TMP0, CONST_2, TMP12);
-
- vis_mul8x16au(REF_S0, CONST_256, TMP0);
- vis_padd16(TMP2, CONST_2, TMP14);
-
- vis_mul8x16au(REF_S0_1, CONST_256, TMP2);
- vis_padd16(TMP12, TMP4, TMP12);
-
- vis_mul8x16au(REF_S2, CONST_256, TMP4);
- vis_padd16(TMP14, TMP6, TMP14);
-
- vis_mul8x16au(REF_S2_1, CONST_256, TMP6);
- vis_padd16(TMP20, TMP12, TMP20);
-
- vis_padd16(TMP22, TMP14, TMP22);
-
- vis_padd16(TMP20, TMP24, TMP20);
-
- vis_padd16(TMP22, TMP26, TMP22);
- vis_pack16(TMP20, DST_2);
-
- vis_pack16(TMP22, DST_3);
- vis_st64_2(DST_2, dest, 8);
- dest += stride;
- vis_padd16(TMP0, TMP4, TMP24);
-
- vis_mul8x16au(REF_S4, CONST_256, TMP0);
- vis_padd16(TMP2, TMP6, TMP26);
-
- vis_mul8x16au(REF_S4_1, CONST_256, TMP2);
- vis_padd16(TMP24, TMP8, TMP24);
-
- vis_padd16(TMP26, TMP10, TMP26);
- vis_pack16(TMP24, DST_0);
-
- vis_pack16(TMP26, DST_1);
- vis_st64(DST_0, dest[0]);
- vis_pmerge(ZERO, REF_S6, TMP4);
-
- vis_pmerge(ZERO, REF_S6_1, TMP6);
-
- vis_padd16(TMP0, TMP4, TMP0);
-
- vis_padd16(TMP2, TMP6, TMP2);
-
- vis_padd16(TMP0, TMP12, TMP0);
-
- vis_padd16(TMP2, TMP14, TMP2);
- vis_pack16(TMP0, DST_2);
-
- vis_pack16(TMP2, DST_3);
- vis_st64_2(DST_2, dest, 8);
- dest += stride;
- } while (--height);
-}
-
-static void MC_put_xy_8_vis (uint8_t * dest, const uint8_t * _ref,
- const int stride, int height)
-{
- uint8_t *ref = (uint8_t *) _ref;
- unsigned long off = (unsigned long) ref & 0x7;
- unsigned long off_plus_1 = off + 1;
- int stride_8 = stride + 8;
-
- vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[ 0], TMP0);
- vis_fzero(ZERO);
-
- vis_ld64(ref[ 8], TMP2);
-
- vis_ld64(constants2[0], CONST_2);
-
- vis_ld64(constants256_512[0], CONST_256);
- vis_faligndata(TMP0, TMP2, REF_S0);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_S2);
- } else {
- vis_src1(TMP2, REF_S2);
- }
-
- height >>= 1;
- do { /* 26 cycles */
- vis_ld64_2(ref, stride, TMP0);
- vis_mul8x16au(REF_S0, CONST_256, TMP8);
- vis_pmerge(ZERO, REF_S2, TMP12);
-
- vis_alignaddr_g0((void *)off);
-
- vis_ld64_2(ref, stride_8, TMP2);
- ref += stride;
- vis_mul8x16au(REF_S0_1, CONST_256, TMP10);
- vis_pmerge(ZERO, REF_S2_1, TMP14);
-
- vis_ld64_2(ref, stride, TMP4);
-
- vis_ld64_2(ref, stride_8, TMP6);
- ref += stride;
- vis_faligndata(TMP0, TMP2, REF_S4);
-
- vis_pmerge(ZERO, REF_S4, TMP18);
-
- vis_pmerge(ZERO, REF_S4_1, TMP20);
-
- vis_faligndata(TMP4, TMP6, REF_S0);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_S6);
- vis_faligndata(TMP4, TMP6, REF_S2);
- } else {
- vis_src1(TMP2, REF_S6);
- vis_src1(TMP6, REF_S2);
- }
-
- vis_padd16(TMP18, CONST_2, TMP18);
- vis_mul8x16au(REF_S6, CONST_256, TMP22);
-
- vis_padd16(TMP20, CONST_2, TMP20);
- vis_mul8x16au(REF_S6_1, CONST_256, TMP24);
-
- vis_mul8x16au(REF_S0, CONST_256, TMP26);
- vis_pmerge(ZERO, REF_S0_1, TMP28);
-
- vis_mul8x16au(REF_S2, CONST_256, TMP30);
- vis_padd16(TMP18, TMP22, TMP18);
-
- vis_mul8x16au(REF_S2_1, CONST_256, TMP32);
- vis_padd16(TMP20, TMP24, TMP20);
-
- vis_padd16(TMP8, TMP18, TMP8);
-
- vis_padd16(TMP10, TMP20, TMP10);
-
- vis_padd16(TMP8, TMP12, TMP8);
-
- vis_padd16(TMP10, TMP14, TMP10);
- vis_pack16(TMP8, DST_0);
-
- vis_pack16(TMP10, DST_1);
- vis_st64(DST_0, dest[0]);
- dest += stride;
- vis_padd16(TMP18, TMP26, TMP18);
-
- vis_padd16(TMP20, TMP28, TMP20);
-
- vis_padd16(TMP18, TMP30, TMP18);
-
- vis_padd16(TMP20, TMP32, TMP20);
- vis_pack16(TMP18, DST_2);
-
- vis_pack16(TMP20, DST_3);
- vis_st64(DST_2, dest[0]);
- dest += stride;
- } while (--height);
-}
-
-static void MC_avg_xy_16_vis (uint8_t * dest, const uint8_t * _ref,
- const int stride, int height)
-{
- uint8_t *ref = (uint8_t *) _ref;
- unsigned long off = (unsigned long) ref & 0x7;
- unsigned long off_plus_1 = off + 1;
- int stride_8 = stride + 8;
- int stride_16 = stride + 16;
-
- vis_set_gsr(4 << VIS_GSR_SCALEFACT_SHIFT);
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[ 0], TMP0);
- vis_fzero(ZERO);
-
- vis_ld64(ref[ 8], TMP2);
-
- vis_ld64(ref[16], TMP4);
-
- vis_ld64(constants6[0], CONST_6);
- vis_faligndata(TMP0, TMP2, REF_S0);
-
- vis_ld64(constants256_1024[0], CONST_256);
- vis_faligndata(TMP2, TMP4, REF_S4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_S2);
- vis_faligndata(TMP2, TMP4, REF_S6);
- } else {
- vis_src1(TMP2, REF_S2);
- vis_src1(TMP4, REF_S6);
- }
-
- height >>= 1;
- do { /* 55 cycles */
- vis_ld64_2(ref, stride, TMP0);
- vis_mul8x16au(REF_S0, CONST_256, TMP12);
- vis_pmerge(ZERO, REF_S0_1, TMP14);
-
- vis_alignaddr_g0((void *)off);
-
- vis_ld64_2(ref, stride_8, TMP2);
- vis_mul8x16au(REF_S2, CONST_256, TMP16);
- vis_pmerge(ZERO, REF_S2_1, TMP18);
-
- vis_ld64_2(ref, stride_16, TMP4);
- ref += stride;
- vis_mul8x16au(REF_S4, CONST_256, TMP20);
- vis_pmerge(ZERO, REF_S4_1, TMP22);
-
- vis_ld64_2(ref, stride, TMP6);
- vis_mul8x16au(REF_S6, CONST_256, TMP24);
- vis_pmerge(ZERO, REF_S6_1, TMP26);
-
- vis_ld64_2(ref, stride_8, TMP8);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64_2(ref, stride_16, TMP10);
- ref += stride;
- vis_faligndata(TMP2, TMP4, REF_4);
-
- vis_ld64(dest[0], DST_0);
- vis_faligndata(TMP6, TMP8, REF_S0);
-
- vis_ld64_2(dest, 8, DST_2);
- vis_faligndata(TMP8, TMP10, REF_S4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- vis_faligndata(TMP2, TMP4, REF_6);
- vis_faligndata(TMP6, TMP8, REF_S2);
- vis_faligndata(TMP8, TMP10, REF_S6);
- } else {
- vis_src1(TMP2, REF_2);
- vis_src1(TMP4, REF_6);
- vis_src1(TMP8, REF_S2);
- vis_src1(TMP10, REF_S6);
- }
-
- vis_mul8x16al(DST_0, CONST_1024, TMP30);
- vis_pmerge(ZERO, REF_0, TMP0);
-
- vis_mul8x16al(DST_1, CONST_1024, TMP32);
- vis_pmerge(ZERO, REF_0_1, TMP2);
-
- vis_mul8x16au(REF_2, CONST_256, TMP4);
- vis_pmerge(ZERO, REF_2_1, TMP6);
-
- vis_mul8x16al(DST_2, CONST_1024, REF_0);
- vis_padd16(TMP0, CONST_6, TMP0);
-
- vis_mul8x16al(DST_3, CONST_1024, REF_2);
- vis_padd16(TMP2, CONST_6, TMP2);
-
- vis_padd16(TMP0, TMP4, TMP0);
- vis_mul8x16au(REF_4, CONST_256, TMP4);
-
- vis_padd16(TMP2, TMP6, TMP2);
- vis_mul8x16au(REF_4_1, CONST_256, TMP6);
-
- vis_padd16(TMP12, TMP0, TMP12);
- vis_mul8x16au(REF_6, CONST_256, TMP8);
-
- vis_padd16(TMP14, TMP2, TMP14);
- vis_mul8x16au(REF_6_1, CONST_256, TMP10);
-
- vis_padd16(TMP12, TMP16, TMP12);
- vis_mul8x16au(REF_S0, CONST_256, REF_4);
-
- vis_padd16(TMP14, TMP18, TMP14);
- vis_mul8x16au(REF_S0_1, CONST_256, REF_6);
-
- vis_padd16(TMP12, TMP30, TMP12);
-
- vis_padd16(TMP14, TMP32, TMP14);
- vis_pack16(TMP12, DST_0);
-
- vis_pack16(TMP14, DST_1);
- vis_st64(DST_0, dest[0]);
- vis_padd16(TMP4, CONST_6, TMP4);
-
- vis_ld64_2(dest, stride, DST_0);
- vis_padd16(TMP6, CONST_6, TMP6);
- vis_mul8x16au(REF_S2, CONST_256, TMP12);
-
- vis_padd16(TMP4, TMP8, TMP4);
- vis_mul8x16au(REF_S2_1, CONST_256, TMP14);
-
- vis_padd16(TMP6, TMP10, TMP6);
-
- vis_padd16(TMP20, TMP4, TMP20);
-
- vis_padd16(TMP22, TMP6, TMP22);
-
- vis_padd16(TMP20, TMP24, TMP20);
-
- vis_padd16(TMP22, TMP26, TMP22);
-
- vis_padd16(TMP20, REF_0, TMP20);
- vis_mul8x16au(REF_S4, CONST_256, REF_0);
-
- vis_padd16(TMP22, REF_2, TMP22);
- vis_pack16(TMP20, DST_2);
-
- vis_pack16(TMP22, DST_3);
- vis_st64_2(DST_2, dest, 8);
- dest += stride;
-
- vis_ld64_2(dest, 8, DST_2);
- vis_mul8x16al(DST_0, CONST_1024, TMP30);
- vis_pmerge(ZERO, REF_S4_1, REF_2);
-
- vis_mul8x16al(DST_1, CONST_1024, TMP32);
- vis_padd16(REF_4, TMP0, TMP8);
-
- vis_mul8x16au(REF_S6, CONST_256, REF_4);
- vis_padd16(REF_6, TMP2, TMP10);
-
- vis_mul8x16au(REF_S6_1, CONST_256, REF_6);
- vis_padd16(TMP8, TMP12, TMP8);
-
- vis_padd16(TMP10, TMP14, TMP10);
-
- vis_padd16(TMP8, TMP30, TMP8);
-
- vis_padd16(TMP10, TMP32, TMP10);
- vis_pack16(TMP8, DST_0);
-
- vis_pack16(TMP10, DST_1);
- vis_st64(DST_0, dest[0]);
-
- vis_padd16(REF_0, TMP4, REF_0);
-
- vis_mul8x16al(DST_2, CONST_1024, TMP30);
- vis_padd16(REF_2, TMP6, REF_2);
-
- vis_mul8x16al(DST_3, CONST_1024, TMP32);
- vis_padd16(REF_0, REF_4, REF_0);
-
- vis_padd16(REF_2, REF_6, REF_2);
-
- vis_padd16(REF_0, TMP30, REF_0);
-
- /* stall */
-
- vis_padd16(REF_2, TMP32, REF_2);
- vis_pack16(REF_0, DST_2);
-
- vis_pack16(REF_2, DST_3);
- vis_st64_2(DST_2, dest, 8);
- dest += stride;
- } while (--height);
-}
-
-static void MC_avg_xy_8_vis (uint8_t * dest, const uint8_t * _ref,
- const int stride, int height)
-{
- uint8_t *ref = (uint8_t *) _ref;
- unsigned long off = (unsigned long) ref & 0x7;
- unsigned long off_plus_1 = off + 1;
- int stride_8 = stride + 8;
-
- vis_set_gsr(4 << VIS_GSR_SCALEFACT_SHIFT);
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[0], TMP0);
- vis_fzero(ZERO);
-
- vis_ld64_2(ref, 8, TMP2);
-
- vis_ld64(constants6[0], CONST_6);
-
- vis_ld64(constants256_1024[0], CONST_256);
- vis_faligndata(TMP0, TMP2, REF_S0);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_S2);
- } else {
- vis_src1(TMP2, REF_S2);
- }
-
- height >>= 1;
- do { /* 31 cycles */
- vis_ld64_2(ref, stride, TMP0);
- vis_mul8x16au(REF_S0, CONST_256, TMP8);
- vis_pmerge(ZERO, REF_S0_1, TMP10);
-
- vis_ld64_2(ref, stride_8, TMP2);
- ref += stride;
- vis_mul8x16au(REF_S2, CONST_256, TMP12);
- vis_pmerge(ZERO, REF_S2_1, TMP14);
-
- vis_alignaddr_g0((void *)off);
-
- vis_ld64_2(ref, stride, TMP4);
- vis_faligndata(TMP0, TMP2, REF_S4);
-
- vis_ld64_2(ref, stride_8, TMP6);
- ref += stride;
-
- vis_ld64(dest[0], DST_0);
- vis_faligndata(TMP4, TMP6, REF_S0);
-
- vis_ld64_2(dest, stride, DST_2);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_S6);
- vis_faligndata(TMP4, TMP6, REF_S2);
- } else {
- vis_src1(TMP2, REF_S6);
- vis_src1(TMP6, REF_S2);
- }
-
- vis_mul8x16al(DST_0, CONST_1024, TMP30);
- vis_pmerge(ZERO, REF_S4, TMP22);
-
- vis_mul8x16al(DST_1, CONST_1024, TMP32);
- vis_pmerge(ZERO, REF_S4_1, TMP24);
-
- vis_mul8x16au(REF_S6, CONST_256, TMP26);
- vis_pmerge(ZERO, REF_S6_1, TMP28);
-
- vis_mul8x16au(REF_S0, CONST_256, REF_S4);
- vis_padd16(TMP22, CONST_6, TMP22);
-
- vis_mul8x16au(REF_S0_1, CONST_256, REF_S6);
- vis_padd16(TMP24, CONST_6, TMP24);
-
- vis_mul8x16al(DST_2, CONST_1024, REF_0);
- vis_padd16(TMP22, TMP26, TMP22);
-
- vis_mul8x16al(DST_3, CONST_1024, REF_2);
- vis_padd16(TMP24, TMP28, TMP24);
-
- vis_mul8x16au(REF_S2, CONST_256, TMP26);
- vis_padd16(TMP8, TMP22, TMP8);
-
- vis_mul8x16au(REF_S2_1, CONST_256, TMP28);
- vis_padd16(TMP10, TMP24, TMP10);
-
- vis_padd16(TMP8, TMP12, TMP8);
-
- vis_padd16(TMP10, TMP14, TMP10);
-
- vis_padd16(TMP8, TMP30, TMP8);
-
- vis_padd16(TMP10, TMP32, TMP10);
- vis_pack16(TMP8, DST_0);
-
- vis_pack16(TMP10, DST_1);
- vis_st64(DST_0, dest[0]);
- dest += stride;
-
- vis_padd16(REF_S4, TMP22, TMP12);
-
- vis_padd16(REF_S6, TMP24, TMP14);
-
- vis_padd16(TMP12, TMP26, TMP12);
-
- vis_padd16(TMP14, TMP28, TMP14);
-
- vis_padd16(TMP12, REF_0, TMP12);
-
- vis_padd16(TMP14, REF_2, TMP14);
- vis_pack16(TMP12, DST_2);
-
- vis_pack16(TMP14, DST_3);
- vis_st64(DST_2, dest[0]);
- dest += stride;
- } while (--height);
-}
-
-/* End of rounding code */
-
-/* Start of no rounding code */
-/* The trick used in some of this file is the formula from the MMX
- * motion comp code, which is:
- *
- * (x+y)>>1 == (x&y)+((x^y)>>1)
- *
- * This allows us to average 8 bytes at a time in a 64-bit FPU reg.
- * We avoid overflows by masking before we do the shift, and we
- * implement the shift by multiplying by 1/2 using mul8x16. So in
- * VIS this is (assume 'x' is in f0, 'y' is in f2, a repeating mask
- * of '0xfe' is in f4, a repeating mask of '0x7f' is in f6, and
- * the value 0x80808080 is in f8):
- *
- * fxor f0, f2, f10
- * fand f10, f4, f10
- * fmul8x16 f8, f10, f10
- * fand f10, f6, f10
- * fand f0, f2, f12
- * fpadd16 f12, f10, f10
- */
-
-static void MC_put_no_round_o_16_vis (uint8_t * dest, const uint8_t * _ref,
- const int stride, int height)
-{
- uint8_t *ref = (uint8_t *) _ref;
-
- ref = vis_alignaddr(ref);
- do { /* 5 cycles */
- vis_ld64(ref[0], TMP0);
-
- vis_ld64_2(ref, 8, TMP2);
-
- vis_ld64_2(ref, 16, TMP4);
- ref += stride;
-
- vis_faligndata(TMP0, TMP2, REF_0);
- vis_st64(REF_0, dest[0]);
-
- vis_faligndata(TMP2, TMP4, REF_2);
- vis_st64_2(REF_2, dest, 8);
- dest += stride;
- } while (--height);
-}
-
-static void MC_put_no_round_o_8_vis (uint8_t * dest, const uint8_t * _ref,
- const int stride, int height)
-{
- uint8_t *ref = (uint8_t *) _ref;
-
- ref = vis_alignaddr(ref);
- do { /* 4 cycles */
- vis_ld64(ref[0], TMP0);
-
- vis_ld64(ref[8], TMP2);
- ref += stride;
-
- /* stall */
-
- vis_faligndata(TMP0, TMP2, REF_0);
- vis_st64(REF_0, dest[0]);
- dest += stride;
- } while (--height);
-}
-
-
-static void MC_avg_no_round_o_16_vis (uint8_t * dest, const uint8_t * _ref,
- const int stride, int height)
-{
- uint8_t *ref = (uint8_t *) _ref;
- int stride_8 = stride + 8;
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[0], TMP0);
-
- vis_ld64(ref[8], TMP2);
-
- vis_ld64(ref[16], TMP4);
-
- vis_ld64(dest[0], DST_0);
-
- vis_ld64(dest[8], DST_2);
-
- vis_ld64(constants_fe[0], MASK_fe);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64(constants_7f[0], MASK_7f);
- vis_faligndata(TMP2, TMP4, REF_2);
-
- vis_ld64(constants128[0], CONST_128);
-
- ref += stride;
- height = (height >> 1) - 1;
-
- do { /* 24 cycles */
- vis_ld64(ref[0], TMP0);
- vis_xor(DST_0, REF_0, TMP6);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_and(TMP6, MASK_fe, TMP6);
-
- vis_ld64_2(ref, 16, TMP4);
- ref += stride;
- vis_mul8x16(CONST_128, TMP6, TMP6);
- vis_xor(DST_2, REF_2, TMP8);
-
- vis_and(TMP8, MASK_fe, TMP8);
-
- vis_and(DST_0, REF_0, TMP10);
- vis_ld64_2(dest, stride, DST_0);
- vis_mul8x16(CONST_128, TMP8, TMP8);
-
- vis_and(DST_2, REF_2, TMP12);
- vis_ld64_2(dest, stride_8, DST_2);
-
- vis_ld64(ref[0], TMP14);
- vis_and(TMP6, MASK_7f, TMP6);
-
- vis_and(TMP8, MASK_7f, TMP8);
-
- vis_padd16(TMP10, TMP6, TMP6);
- vis_st64(TMP6, dest[0]);
-
- vis_padd16(TMP12, TMP8, TMP8);
- vis_st64_2(TMP8, dest, 8);
-
- dest += stride;
- vis_ld64_2(ref, 8, TMP16);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64_2(ref, 16, TMP18);
- vis_faligndata(TMP2, TMP4, REF_2);
- ref += stride;
-
- vis_xor(DST_0, REF_0, TMP20);
-
- vis_and(TMP20, MASK_fe, TMP20);
-
- vis_xor(DST_2, REF_2, TMP22);
- vis_mul8x16(CONST_128, TMP20, TMP20);
-
- vis_and(TMP22, MASK_fe, TMP22);
-
- vis_and(DST_0, REF_0, TMP24);
- vis_mul8x16(CONST_128, TMP22, TMP22);
-
- vis_and(DST_2, REF_2, TMP26);
-
- vis_ld64_2(dest, stride, DST_0);
- vis_faligndata(TMP14, TMP16, REF_0);
-
- vis_ld64_2(dest, stride_8, DST_2);
- vis_faligndata(TMP16, TMP18, REF_2);
-
- vis_and(TMP20, MASK_7f, TMP20);
-
- vis_and(TMP22, MASK_7f, TMP22);
-
- vis_padd16(TMP24, TMP20, TMP20);
- vis_st64(TMP20, dest[0]);
-
- vis_padd16(TMP26, TMP22, TMP22);
- vis_st64_2(TMP22, dest, 8);
- dest += stride;
- } while (--height);
-
- vis_ld64(ref[0], TMP0);
- vis_xor(DST_0, REF_0, TMP6);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_and(TMP6, MASK_fe, TMP6);
-
- vis_ld64_2(ref, 16, TMP4);
- vis_mul8x16(CONST_128, TMP6, TMP6);
- vis_xor(DST_2, REF_2, TMP8);
-
- vis_and(TMP8, MASK_fe, TMP8);
-
- vis_and(DST_0, REF_0, TMP10);
- vis_ld64_2(dest, stride, DST_0);
- vis_mul8x16(CONST_128, TMP8, TMP8);
-
- vis_and(DST_2, REF_2, TMP12);
- vis_ld64_2(dest, stride_8, DST_2);
-
- vis_ld64(ref[0], TMP14);
- vis_and(TMP6, MASK_7f, TMP6);
-
- vis_and(TMP8, MASK_7f, TMP8);
-
- vis_padd16(TMP10, TMP6, TMP6);
- vis_st64(TMP6, dest[0]);
-
- vis_padd16(TMP12, TMP8, TMP8);
- vis_st64_2(TMP8, dest, 8);
-
- dest += stride;
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_faligndata(TMP2, TMP4, REF_2);
-
- vis_xor(DST_0, REF_0, TMP20);
-
- vis_and(TMP20, MASK_fe, TMP20);
-
- vis_xor(DST_2, REF_2, TMP22);
- vis_mul8x16(CONST_128, TMP20, TMP20);
-
- vis_and(TMP22, MASK_fe, TMP22);
-
- vis_and(DST_0, REF_0, TMP24);
- vis_mul8x16(CONST_128, TMP22, TMP22);
-
- vis_and(DST_2, REF_2, TMP26);
-
- vis_and(TMP20, MASK_7f, TMP20);
-
- vis_and(TMP22, MASK_7f, TMP22);
-
- vis_padd16(TMP24, TMP20, TMP20);
- vis_st64(TMP20, dest[0]);
-
- vis_padd16(TMP26, TMP22, TMP22);
- vis_st64_2(TMP22, dest, 8);
-}
-
-static void MC_avg_no_round_o_8_vis (uint8_t * dest, const uint8_t * _ref,
- const int stride, int height)
-{
- uint8_t *ref = (uint8_t *) _ref;
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[0], TMP0);
-
- vis_ld64(ref[8], TMP2);
-
- vis_ld64(dest[0], DST_0);
-
- vis_ld64(constants_fe[0], MASK_fe);
-
- vis_ld64(constants_7f[0], MASK_7f);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64(constants128[0], CONST_128);
-
- ref += stride;
- height = (height >> 1) - 1;
-
- do { /* 12 cycles */
- vis_ld64(ref[0], TMP0);
- vis_xor(DST_0, REF_0, TMP4);
-
- vis_ld64(ref[8], TMP2);
- vis_and(TMP4, MASK_fe, TMP4);
-
- vis_and(DST_0, REF_0, TMP6);
- vis_ld64_2(dest, stride, DST_0);
- ref += stride;
- vis_mul8x16(CONST_128, TMP4, TMP4);
-
- vis_ld64(ref[0], TMP12);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64(ref[8], TMP2);
- vis_xor(DST_0, REF_0, TMP0);
- ref += stride;
-
- vis_and(TMP0, MASK_fe, TMP0);
-
- vis_and(TMP4, MASK_7f, TMP4);
-
- vis_padd16(TMP6, TMP4, TMP4);
- vis_st64(TMP4, dest[0]);
- dest += stride;
- vis_mul8x16(CONST_128, TMP0, TMP0);
-
- vis_and(DST_0, REF_0, TMP6);
- vis_ld64_2(dest, stride, DST_0);
-
- vis_faligndata(TMP12, TMP2, REF_0);
-
- vis_and(TMP0, MASK_7f, TMP0);
-
- vis_padd16(TMP6, TMP0, TMP4);
- vis_st64(TMP4, dest[0]);
- dest += stride;
- } while (--height);
-
- vis_ld64(ref[0], TMP0);
- vis_xor(DST_0, REF_0, TMP4);
-
- vis_ld64(ref[8], TMP2);
- vis_and(TMP4, MASK_fe, TMP4);
-
- vis_and(DST_0, REF_0, TMP6);
- vis_ld64_2(dest, stride, DST_0);
- vis_mul8x16(CONST_128, TMP4, TMP4);
-
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_xor(DST_0, REF_0, TMP0);
-
- vis_and(TMP0, MASK_fe, TMP0);
-
- vis_and(TMP4, MASK_7f, TMP4);
-
- vis_padd16(TMP6, TMP4, TMP4);
- vis_st64(TMP4, dest[0]);
- dest += stride;
- vis_mul8x16(CONST_128, TMP0, TMP0);
-
- vis_and(DST_0, REF_0, TMP6);
-
- vis_and(TMP0, MASK_7f, TMP0);
-
- vis_padd16(TMP6, TMP0, TMP4);
- vis_st64(TMP4, dest[0]);
-}
-
-static void MC_put_no_round_x_16_vis (uint8_t * dest, const uint8_t * _ref,
- const int stride, int height)
-{
- uint8_t *ref = (uint8_t *) _ref;
- unsigned long off = (unsigned long) ref & 0x7;
- unsigned long off_plus_1 = off + 1;
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[0], TMP0);
-
- vis_ld64_2(ref, 8, TMP2);
-
- vis_ld64_2(ref, 16, TMP4);
-
- vis_ld64(constants_fe[0], MASK_fe);
-
- vis_ld64(constants_7f[0], MASK_7f);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64(constants128[0], CONST_128);
- vis_faligndata(TMP2, TMP4, REF_4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- vis_faligndata(TMP2, TMP4, REF_6);
- } else {
- vis_src1(TMP2, REF_2);
- vis_src1(TMP4, REF_6);
- }
-
- ref += stride;
- height = (height >> 1) - 1;
-
- do { /* 34 cycles */
- vis_ld64(ref[0], TMP0);
- vis_xor(REF_0, REF_2, TMP6);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_xor(REF_4, REF_6, TMP8);
-
- vis_ld64_2(ref, 16, TMP4);
- vis_and(TMP6, MASK_fe, TMP6);
- ref += stride;
-
- vis_ld64(ref[0], TMP14);
- vis_mul8x16(CONST_128, TMP6, TMP6);
- vis_and(TMP8, MASK_fe, TMP8);
-
- vis_ld64_2(ref, 8, TMP16);
- vis_mul8x16(CONST_128, TMP8, TMP8);
- vis_and(REF_0, REF_2, TMP10);
-
- vis_ld64_2(ref, 16, TMP18);
- ref += stride;
- vis_and(REF_4, REF_6, TMP12);
-
- vis_alignaddr_g0((void *)off);
-
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_faligndata(TMP2, TMP4, REF_4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- vis_faligndata(TMP2, TMP4, REF_6);
- } else {
- vis_src1(TMP2, REF_2);
- vis_src1(TMP4, REF_6);
- }
-
- vis_and(TMP6, MASK_7f, TMP6);
-
- vis_and(TMP8, MASK_7f, TMP8);
-
- vis_padd16(TMP10, TMP6, TMP6);
- vis_st64(TMP6, dest[0]);
-
- vis_padd16(TMP12, TMP8, TMP8);
- vis_st64_2(TMP8, dest, 8);
- dest += stride;
-
- vis_xor(REF_0, REF_2, TMP6);
-
- vis_xor(REF_4, REF_6, TMP8);
-
- vis_and(TMP6, MASK_fe, TMP6);
-
- vis_mul8x16(CONST_128, TMP6, TMP6);
- vis_and(TMP8, MASK_fe, TMP8);
-
- vis_mul8x16(CONST_128, TMP8, TMP8);
- vis_and(REF_0, REF_2, TMP10);
-
- vis_and(REF_4, REF_6, TMP12);
-
- vis_alignaddr_g0((void *)off);
-
- vis_faligndata(TMP14, TMP16, REF_0);
-
- vis_faligndata(TMP16, TMP18, REF_4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP14, TMP16, REF_2);
- vis_faligndata(TMP16, TMP18, REF_6);
- } else {
- vis_src1(TMP16, REF_2);
- vis_src1(TMP18, REF_6);
- }
-
- vis_and(TMP6, MASK_7f, TMP6);
-
- vis_and(TMP8, MASK_7f, TMP8);
-
- vis_padd16(TMP10, TMP6, TMP6);
- vis_st64(TMP6, dest[0]);
-
- vis_padd16(TMP12, TMP8, TMP8);
- vis_st64_2(TMP8, dest, 8);
- dest += stride;
- } while (--height);
-
- vis_ld64(ref[0], TMP0);
- vis_xor(REF_0, REF_2, TMP6);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_xor(REF_4, REF_6, TMP8);
-
- vis_ld64_2(ref, 16, TMP4);
- vis_and(TMP6, MASK_fe, TMP6);
-
- vis_mul8x16(CONST_128, TMP6, TMP6);
- vis_and(TMP8, MASK_fe, TMP8);
-
- vis_mul8x16(CONST_128, TMP8, TMP8);
- vis_and(REF_0, REF_2, TMP10);
-
- vis_and(REF_4, REF_6, TMP12);
-
- vis_alignaddr_g0((void *)off);
-
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_faligndata(TMP2, TMP4, REF_4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- vis_faligndata(TMP2, TMP4, REF_6);
- } else {
- vis_src1(TMP2, REF_2);
- vis_src1(TMP4, REF_6);
- }
-
- vis_and(TMP6, MASK_7f, TMP6);
-
- vis_and(TMP8, MASK_7f, TMP8);
-
- vis_padd16(TMP10, TMP6, TMP6);
- vis_st64(TMP6, dest[0]);
-
- vis_padd16(TMP12, TMP8, TMP8);
- vis_st64_2(TMP8, dest, 8);
- dest += stride;
-
- vis_xor(REF_0, REF_2, TMP6);
-
- vis_xor(REF_4, REF_6, TMP8);
-
- vis_and(TMP6, MASK_fe, TMP6);
-
- vis_mul8x16(CONST_128, TMP6, TMP6);
- vis_and(TMP8, MASK_fe, TMP8);
-
- vis_mul8x16(CONST_128, TMP8, TMP8);
- vis_and(REF_0, REF_2, TMP10);
-
- vis_and(REF_4, REF_6, TMP12);
-
- vis_and(TMP6, MASK_7f, TMP6);
-
- vis_and(TMP8, MASK_7f, TMP8);
-
- vis_padd16(TMP10, TMP6, TMP6);
- vis_st64(TMP6, dest[0]);
-
- vis_padd16(TMP12, TMP8, TMP8);
- vis_st64_2(TMP8, dest, 8);
-}
-
-static void MC_put_no_round_x_8_vis (uint8_t * dest, const uint8_t * _ref,
- const int stride, int height)
-{
- uint8_t *ref = (uint8_t *) _ref;
- unsigned long off = (unsigned long) ref & 0x7;
- unsigned long off_plus_1 = off + 1;
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[0], TMP0);
-
- vis_ld64(ref[8], TMP2);
-
- vis_ld64(constants_fe[0], MASK_fe);
-
- vis_ld64(constants_7f[0], MASK_7f);
-
- vis_ld64(constants128[0], CONST_128);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- } else {
- vis_src1(TMP2, REF_2);
- }
-
- ref += stride;
- height = (height >> 1) - 1;
-
- do { /* 20 cycles */
- vis_ld64(ref[0], TMP0);
- vis_xor(REF_0, REF_2, TMP4);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_and(TMP4, MASK_fe, TMP4);
- ref += stride;
-
- vis_ld64(ref[0], TMP8);
- vis_and(REF_0, REF_2, TMP6);
- vis_mul8x16(CONST_128, TMP4, TMP4);
-
- vis_alignaddr_g0((void *)off);
-
- vis_ld64_2(ref, 8, TMP10);
- ref += stride;
- vis_faligndata(TMP0, TMP2, REF_0);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- } else {
- vis_src1(TMP2, REF_2);
- }
-
- vis_and(TMP4, MASK_7f, TMP4);
-
- vis_padd16(TMP6, TMP4, DST_0);
- vis_st64(DST_0, dest[0]);
- dest += stride;
-
- vis_xor(REF_0, REF_2, TMP12);
-
- vis_and(TMP12, MASK_fe, TMP12);
-
- vis_and(REF_0, REF_2, TMP14);
- vis_mul8x16(CONST_128, TMP12, TMP12);
-
- vis_alignaddr_g0((void *)off);
- vis_faligndata(TMP8, TMP10, REF_0);
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP8, TMP10, REF_2);
- } else {
- vis_src1(TMP10, REF_2);
- }
-
- vis_and(TMP12, MASK_7f, TMP12);
-
- vis_padd16(TMP14, TMP12, DST_0);
- vis_st64(DST_0, dest[0]);
- dest += stride;
- } while (--height);
-
- vis_ld64(ref[0], TMP0);
- vis_xor(REF_0, REF_2, TMP4);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_and(TMP4, MASK_fe, TMP4);
-
- vis_and(REF_0, REF_2, TMP6);
- vis_mul8x16(CONST_128, TMP4, TMP4);
-
- vis_alignaddr_g0((void *)off);
-
- vis_faligndata(TMP0, TMP2, REF_0);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- } else {
- vis_src1(TMP2, REF_2);
- }
-
- vis_and(TMP4, MASK_7f, TMP4);
-
- vis_padd16(TMP6, TMP4, DST_0);
- vis_st64(DST_0, dest[0]);
- dest += stride;
-
- vis_xor(REF_0, REF_2, TMP12);
-
- vis_and(TMP12, MASK_fe, TMP12);
-
- vis_and(REF_0, REF_2, TMP14);
- vis_mul8x16(CONST_128, TMP12, TMP12);
-
- vis_and(TMP12, MASK_7f, TMP12);
-
- vis_padd16(TMP14, TMP12, DST_0);
- vis_st64(DST_0, dest[0]);
- dest += stride;
-}
-
-static void MC_avg_no_round_x_16_vis (uint8_t * dest, const uint8_t * _ref,
- const int stride, int height)
-{
- uint8_t *ref = (uint8_t *) _ref;
- unsigned long off = (unsigned long) ref & 0x7;
- unsigned long off_plus_1 = off + 1;
-
- vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
-
- vis_ld64(constants3[0], CONST_3);
- vis_fzero(ZERO);
- vis_ld64(constants256_512[0], CONST_256);
-
- ref = vis_alignaddr(ref);
- do { /* 26 cycles */
- vis_ld64(ref[0], TMP0);
-
- vis_ld64(ref[8], TMP2);
-
- vis_alignaddr_g0((void *)off);
-
- vis_ld64(ref[16], TMP4);
-
- vis_ld64(dest[0], DST_0);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64(dest[8], DST_2);
- vis_faligndata(TMP2, TMP4, REF_4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- vis_faligndata(TMP2, TMP4, REF_6);
- } else {
- vis_src1(TMP2, REF_2);
- vis_src1(TMP4, REF_6);
- }
-
- vis_mul8x16au(REF_0, CONST_256, TMP0);
-
- vis_pmerge(ZERO, REF_2, TMP4);
- vis_mul8x16au(REF_0_1, CONST_256, TMP2);
-
- vis_pmerge(ZERO, REF_2_1, TMP6);
-
- vis_padd16(TMP0, TMP4, TMP0);
-
- vis_mul8x16al(DST_0, CONST_512, TMP4);
- vis_padd16(TMP2, TMP6, TMP2);
-
- vis_mul8x16al(DST_1, CONST_512, TMP6);
-
- vis_mul8x16au(REF_6, CONST_256, TMP12);
-
- vis_padd16(TMP0, TMP4, TMP0);
- vis_mul8x16au(REF_6_1, CONST_256, TMP14);
-
- vis_padd16(TMP2, TMP6, TMP2);
- vis_mul8x16au(REF_4, CONST_256, TMP16);
-
- vis_padd16(TMP0, CONST_3, TMP8);
- vis_mul8x16au(REF_4_1, CONST_256, TMP18);
-
- vis_padd16(TMP2, CONST_3, TMP10);
- vis_pack16(TMP8, DST_0);
-
- vis_pack16(TMP10, DST_1);
- vis_padd16(TMP16, TMP12, TMP0);
-
- vis_st64(DST_0, dest[0]);
- vis_mul8x16al(DST_2, CONST_512, TMP4);
- vis_padd16(TMP18, TMP14, TMP2);
-
- vis_mul8x16al(DST_3, CONST_512, TMP6);
- vis_padd16(TMP0, CONST_3, TMP0);
-
- vis_padd16(TMP2, CONST_3, TMP2);
-
- vis_padd16(TMP0, TMP4, TMP0);
-
- vis_padd16(TMP2, TMP6, TMP2);
- vis_pack16(TMP0, DST_2);
-
- vis_pack16(TMP2, DST_3);
- vis_st64(DST_2, dest[8]);
-
- ref += stride;
- dest += stride;
- } while (--height);
-}
-
-static void MC_avg_no_round_x_8_vis (uint8_t * dest, const uint8_t * _ref,
- const int stride, int height)
-{
- uint8_t *ref = (uint8_t *) _ref;
- unsigned long off = (unsigned long) ref & 0x7;
- unsigned long off_plus_1 = off + 1;
- int stride_times_2 = stride << 1;
-
- vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
-
- vis_ld64(constants3[0], CONST_3);
- vis_fzero(ZERO);
- vis_ld64(constants256_512[0], CONST_256);
-
- ref = vis_alignaddr(ref);
- height >>= 2;
- do { /* 47 cycles */
- vis_ld64(ref[0], TMP0);
-
- vis_ld64_2(ref, 8, TMP2);
- ref += stride;
-
- vis_alignaddr_g0((void *)off);
-
- vis_ld64(ref[0], TMP4);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64_2(ref, 8, TMP6);
- ref += stride;
-
- vis_ld64(ref[0], TMP8);
-
- vis_ld64_2(ref, 8, TMP10);
- ref += stride;
- vis_faligndata(TMP4, TMP6, REF_4);
-
- vis_ld64(ref[0], TMP12);
-
- vis_ld64_2(ref, 8, TMP14);
- ref += stride;
- vis_faligndata(TMP8, TMP10, REF_S0);
-
- vis_faligndata(TMP12, TMP14, REF_S4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
-
- vis_ld64(dest[0], DST_0);
- vis_faligndata(TMP0, TMP2, REF_2);
-
- vis_ld64_2(dest, stride, DST_2);
- vis_faligndata(TMP4, TMP6, REF_6);
-
- vis_faligndata(TMP8, TMP10, REF_S2);
-
- vis_faligndata(TMP12, TMP14, REF_S6);
- } else {
- vis_ld64(dest[0], DST_0);
- vis_src1(TMP2, REF_2);
-
- vis_ld64_2(dest, stride, DST_2);
- vis_src1(TMP6, REF_6);
-
- vis_src1(TMP10, REF_S2);
-
- vis_src1(TMP14, REF_S6);
- }
-
- vis_pmerge(ZERO, REF_0, TMP0);
- vis_mul8x16au(REF_0_1, CONST_256, TMP2);
-
- vis_pmerge(ZERO, REF_2, TMP4);
- vis_mul8x16au(REF_2_1, CONST_256, TMP6);
-
- vis_padd16(TMP0, CONST_3, TMP0);
- vis_mul8x16al(DST_0, CONST_512, TMP16);
-
- vis_padd16(TMP2, CONST_3, TMP2);
- vis_mul8x16al(DST_1, CONST_512, TMP18);
-
- vis_padd16(TMP0, TMP4, TMP0);
- vis_mul8x16au(REF_4, CONST_256, TMP8);
-
- vis_padd16(TMP2, TMP6, TMP2);
- vis_mul8x16au(REF_4_1, CONST_256, TMP10);
-
- vis_padd16(TMP0, TMP16, TMP0);
- vis_mul8x16au(REF_6, CONST_256, TMP12);
-
- vis_padd16(TMP2, TMP18, TMP2);
- vis_mul8x16au(REF_6_1, CONST_256, TMP14);
-
- vis_padd16(TMP8, CONST_3, TMP8);
- vis_mul8x16al(DST_2, CONST_512, TMP16);
-
- vis_padd16(TMP8, TMP12, TMP8);
- vis_mul8x16al(DST_3, CONST_512, TMP18);
-
- vis_padd16(TMP10, TMP14, TMP10);
- vis_pack16(TMP0, DST_0);
-
- vis_pack16(TMP2, DST_1);
- vis_st64(DST_0, dest[0]);
- dest += stride;
- vis_padd16(TMP10, CONST_3, TMP10);
-
- vis_ld64_2(dest, stride, DST_0);
- vis_padd16(TMP8, TMP16, TMP8);
-
- vis_ld64_2(dest, stride_times_2, TMP4/*DST_2*/);
- vis_padd16(TMP10, TMP18, TMP10);
- vis_pack16(TMP8, DST_2);
-
- vis_pack16(TMP10, DST_3);
- vis_st64(DST_2, dest[0]);
- dest += stride;
-
- vis_mul8x16au(REF_S0_1, CONST_256, TMP2);
- vis_pmerge(ZERO, REF_S0, TMP0);
-
- vis_pmerge(ZERO, REF_S2, TMP24);
- vis_mul8x16au(REF_S2_1, CONST_256, TMP6);
-
- vis_padd16(TMP0, CONST_3, TMP0);
- vis_mul8x16au(REF_S4, CONST_256, TMP8);
-
- vis_padd16(TMP2, CONST_3, TMP2);
- vis_mul8x16au(REF_S4_1, CONST_256, TMP10);
-
- vis_padd16(TMP0, TMP24, TMP0);
- vis_mul8x16au(REF_S6, CONST_256, TMP12);
-
- vis_padd16(TMP2, TMP6, TMP2);
- vis_mul8x16au(REF_S6_1, CONST_256, TMP14);
-
- vis_padd16(TMP8, CONST_3, TMP8);
- vis_mul8x16al(DST_0, CONST_512, TMP16);
-
- vis_padd16(TMP10, CONST_3, TMP10);
- vis_mul8x16al(DST_1, CONST_512, TMP18);
-
- vis_padd16(TMP8, TMP12, TMP8);
- vis_mul8x16al(TMP4/*DST_2*/, CONST_512, TMP20);
-
- vis_mul8x16al(TMP5/*DST_3*/, CONST_512, TMP22);
- vis_padd16(TMP0, TMP16, TMP0);
-
- vis_padd16(TMP2, TMP18, TMP2);
- vis_pack16(TMP0, DST_0);
-
- vis_padd16(TMP10, TMP14, TMP10);
- vis_pack16(TMP2, DST_1);
- vis_st64(DST_0, dest[0]);
- dest += stride;
-
- vis_padd16(TMP8, TMP20, TMP8);
-
- vis_padd16(TMP10, TMP22, TMP10);
- vis_pack16(TMP8, DST_2);
-
- vis_pack16(TMP10, DST_3);
- vis_st64(DST_2, dest[0]);
- dest += stride;
- } while (--height);
-}
-
-static void MC_put_no_round_y_16_vis (uint8_t * dest, const uint8_t * _ref,
- const int stride, int height)
-{
- uint8_t *ref = (uint8_t *) _ref;
-
- ref = vis_alignaddr(ref);
- vis_ld64(ref[0], TMP0);
-
- vis_ld64_2(ref, 8, TMP2);
-
- vis_ld64_2(ref, 16, TMP4);
- ref += stride;
-
- vis_ld64(ref[0], TMP6);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64_2(ref, 8, TMP8);
- vis_faligndata(TMP2, TMP4, REF_4);
-
- vis_ld64_2(ref, 16, TMP10);
- ref += stride;
-
- vis_ld64(constants_fe[0], MASK_fe);
- vis_faligndata(TMP6, TMP8, REF_2);
-
- vis_ld64(constants_7f[0], MASK_7f);
- vis_faligndata(TMP8, TMP10, REF_6);
-
- vis_ld64(constants128[0], CONST_128);
- height = (height >> 1) - 1;
- do { /* 24 cycles */
- vis_ld64(ref[0], TMP0);
- vis_xor(REF_0, REF_2, TMP12);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_xor(REF_4, REF_6, TMP16);
-
- vis_ld64_2(ref, 16, TMP4);
- ref += stride;
- vis_and(REF_0, REF_2, TMP14);
-
- vis_ld64(ref[0], TMP6);
- vis_and(REF_4, REF_6, TMP18);
-
- vis_ld64_2(ref, 8, TMP8);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64_2(ref, 16, TMP10);
- ref += stride;
- vis_faligndata(TMP2, TMP4, REF_4);
-
- vis_and(TMP12, MASK_fe, TMP12);
-
- vis_and(TMP16, MASK_fe, TMP16);
- vis_mul8x16(CONST_128, TMP12, TMP12);
-
- vis_mul8x16(CONST_128, TMP16, TMP16);
- vis_xor(REF_0, REF_2, TMP0);
-
- vis_xor(REF_4, REF_6, TMP2);
-
- vis_and(REF_0, REF_2, TMP20);
-
- vis_and(TMP12, MASK_7f, TMP12);
-
- vis_and(TMP16, MASK_7f, TMP16);
-
- vis_padd16(TMP14, TMP12, TMP12);
- vis_st64(TMP12, dest[0]);
-
- vis_padd16(TMP18, TMP16, TMP16);
- vis_st64_2(TMP16, dest, 8);
- dest += stride;
-
- vis_and(REF_4, REF_6, TMP18);
-
- vis_and(TMP0, MASK_fe, TMP0);
-
- vis_and(TMP2, MASK_fe, TMP2);
- vis_mul8x16(CONST_128, TMP0, TMP0);
-
- vis_faligndata(TMP6, TMP8, REF_2);
- vis_mul8x16(CONST_128, TMP2, TMP2);
-
- vis_faligndata(TMP8, TMP10, REF_6);
-
- vis_and(TMP0, MASK_7f, TMP0);
-
- vis_and(TMP2, MASK_7f, TMP2);
-
- vis_padd16(TMP20, TMP0, TMP0);
- vis_st64(TMP0, dest[0]);
-
- vis_padd16(TMP18, TMP2, TMP2);
- vis_st64_2(TMP2, dest, 8);
- dest += stride;
- } while (--height);
-
- vis_ld64(ref[0], TMP0);
- vis_xor(REF_0, REF_2, TMP12);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_xor(REF_4, REF_6, TMP16);
-
- vis_ld64_2(ref, 16, TMP4);
- vis_and(REF_0, REF_2, TMP14);
-
- vis_and(REF_4, REF_6, TMP18);
-
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_faligndata(TMP2, TMP4, REF_4);
-
- vis_and(TMP12, MASK_fe, TMP12);
-
- vis_and(TMP16, MASK_fe, TMP16);
- vis_mul8x16(CONST_128, TMP12, TMP12);
-
- vis_mul8x16(CONST_128, TMP16, TMP16);
- vis_xor(REF_0, REF_2, TMP0);
-
- vis_xor(REF_4, REF_6, TMP2);
-
- vis_and(REF_0, REF_2, TMP20);
-
- vis_and(TMP12, MASK_7f, TMP12);
-
- vis_and(TMP16, MASK_7f, TMP16);
-
- vis_padd16(TMP14, TMP12, TMP12);
- vis_st64(TMP12, dest[0]);
-
- vis_padd16(TMP18, TMP16, TMP16);
- vis_st64_2(TMP16, dest, 8);
- dest += stride;
-
- vis_and(REF_4, REF_6, TMP18);
-
- vis_and(TMP0, MASK_fe, TMP0);
-
- vis_and(TMP2, MASK_fe, TMP2);
- vis_mul8x16(CONST_128, TMP0, TMP0);
-
- vis_mul8x16(CONST_128, TMP2, TMP2);
-
- vis_and(TMP0, MASK_7f, TMP0);
-
- vis_and(TMP2, MASK_7f, TMP2);
-
- vis_padd16(TMP20, TMP0, TMP0);
- vis_st64(TMP0, dest[0]);
-
- vis_padd16(TMP18, TMP2, TMP2);
- vis_st64_2(TMP2, dest, 8);
-}
-
-static void MC_put_no_round_y_8_vis (uint8_t * dest, const uint8_t * _ref,
- const int stride, int height)
-{
- uint8_t *ref = (uint8_t *) _ref;
-
- ref = vis_alignaddr(ref);
- vis_ld64(ref[0], TMP0);
-
- vis_ld64_2(ref, 8, TMP2);
- ref += stride;
-
- vis_ld64(ref[0], TMP4);
-
- vis_ld64_2(ref, 8, TMP6);
- ref += stride;
-
- vis_ld64(constants_fe[0], MASK_fe);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64(constants_7f[0], MASK_7f);
- vis_faligndata(TMP4, TMP6, REF_2);
-
- vis_ld64(constants128[0], CONST_128);
- height = (height >> 1) - 1;
- do { /* 12 cycles */
- vis_ld64(ref[0], TMP0);
- vis_xor(REF_0, REF_2, TMP4);
-
- vis_ld64_2(ref, 8, TMP2);
- ref += stride;
- vis_and(TMP4, MASK_fe, TMP4);
-
- vis_and(REF_0, REF_2, TMP6);
- vis_mul8x16(CONST_128, TMP4, TMP4);
-
- vis_faligndata(TMP0, TMP2, REF_0);
- vis_ld64(ref[0], TMP0);
-
- vis_ld64_2(ref, 8, TMP2);
- ref += stride;
- vis_xor(REF_0, REF_2, TMP12);
-
- vis_and(TMP4, MASK_7f, TMP4);
-
- vis_and(TMP12, MASK_fe, TMP12);
-
- vis_mul8x16(CONST_128, TMP12, TMP12);
- vis_and(REF_0, REF_2, TMP14);
-
- vis_padd16(TMP6, TMP4, DST_0);
- vis_st64(DST_0, dest[0]);
- dest += stride;
-
- vis_faligndata(TMP0, TMP2, REF_2);
-
- vis_and(TMP12, MASK_7f, TMP12);
-
- vis_padd16(TMP14, TMP12, DST_0);
- vis_st64(DST_0, dest[0]);
- dest += stride;
- } while (--height);
-
- vis_ld64(ref[0], TMP0);
- vis_xor(REF_0, REF_2, TMP4);
-
- vis_ld64_2(ref, 8, TMP2);
- vis_and(TMP4, MASK_fe, TMP4);
-
- vis_and(REF_0, REF_2, TMP6);
- vis_mul8x16(CONST_128, TMP4, TMP4);
-
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_xor(REF_0, REF_2, TMP12);
-
- vis_and(TMP4, MASK_7f, TMP4);
-
- vis_and(TMP12, MASK_fe, TMP12);
-
- vis_mul8x16(CONST_128, TMP12, TMP12);
- vis_and(REF_0, REF_2, TMP14);
-
- vis_padd16(TMP6, TMP4, DST_0);
- vis_st64(DST_0, dest[0]);
- dest += stride;
-
- vis_and(TMP12, MASK_7f, TMP12);
-
- vis_padd16(TMP14, TMP12, DST_0);
- vis_st64(DST_0, dest[0]);
-}
-
-static void MC_avg_no_round_y_16_vis (uint8_t * dest, const uint8_t * _ref,
- const int stride, int height)
-{
- uint8_t *ref = (uint8_t *) _ref;
- int stride_8 = stride + 8;
- int stride_16 = stride + 16;
-
- vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[ 0], TMP0);
- vis_fzero(ZERO);
-
- vis_ld64(ref[ 8], TMP2);
-
- vis_ld64(ref[16], TMP4);
-
- vis_ld64(constants3[0], CONST_3);
- vis_faligndata(TMP0, TMP2, REF_2);
-
- vis_ld64(constants256_512[0], CONST_256);
- vis_faligndata(TMP2, TMP4, REF_6);
- height >>= 1;
-
- do { /* 31 cycles */
- vis_ld64_2(ref, stride, TMP0);
- vis_pmerge(ZERO, REF_2, TMP12);
- vis_mul8x16au(REF_2_1, CONST_256, TMP14);
-
- vis_ld64_2(ref, stride_8, TMP2);
- vis_pmerge(ZERO, REF_6, TMP16);
- vis_mul8x16au(REF_6_1, CONST_256, TMP18);
-
- vis_ld64_2(ref, stride_16, TMP4);
- ref += stride;
-
- vis_ld64(dest[0], DST_0);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64_2(dest, 8, DST_2);
- vis_faligndata(TMP2, TMP4, REF_4);
-
- vis_ld64_2(ref, stride, TMP6);
- vis_pmerge(ZERO, REF_0, TMP0);
- vis_mul8x16au(REF_0_1, CONST_256, TMP2);
-
- vis_ld64_2(ref, stride_8, TMP8);
- vis_pmerge(ZERO, REF_4, TMP4);
-
- vis_ld64_2(ref, stride_16, TMP10);
- ref += stride;
-
- vis_ld64_2(dest, stride, REF_S0/*DST_4*/);
- vis_faligndata(TMP6, TMP8, REF_2);
- vis_mul8x16au(REF_4_1, CONST_256, TMP6);
-
- vis_ld64_2(dest, stride_8, REF_S2/*DST_6*/);
- vis_faligndata(TMP8, TMP10, REF_6);
- vis_mul8x16al(DST_0, CONST_512, TMP20);
-
- vis_padd16(TMP0, CONST_3, TMP0);
- vis_mul8x16al(DST_1, CONST_512, TMP22);
-
- vis_padd16(TMP2, CONST_3, TMP2);
- vis_mul8x16al(DST_2, CONST_512, TMP24);
-
- vis_padd16(TMP4, CONST_3, TMP4);
- vis_mul8x16al(DST_3, CONST_512, TMP26);
-
- vis_padd16(TMP6, CONST_3, TMP6);
-
- vis_padd16(TMP12, TMP20, TMP12);
- vis_mul8x16al(REF_S0, CONST_512, TMP20);
-
- vis_padd16(TMP14, TMP22, TMP14);
- vis_mul8x16al(REF_S0_1, CONST_512, TMP22);
-
- vis_padd16(TMP16, TMP24, TMP16);
- vis_mul8x16al(REF_S2, CONST_512, TMP24);
-
- vis_padd16(TMP18, TMP26, TMP18);
- vis_mul8x16al(REF_S2_1, CONST_512, TMP26);
-
- vis_padd16(TMP12, TMP0, TMP12);
- vis_mul8x16au(REF_2, CONST_256, TMP28);
-
- vis_padd16(TMP14, TMP2, TMP14);
- vis_mul8x16au(REF_2_1, CONST_256, TMP30);
-
- vis_padd16(TMP16, TMP4, TMP16);
- vis_mul8x16au(REF_6, CONST_256, REF_S4);
-
- vis_padd16(TMP18, TMP6, TMP18);
- vis_mul8x16au(REF_6_1, CONST_256, REF_S6);
-
- vis_pack16(TMP12, DST_0);
- vis_padd16(TMP28, TMP0, TMP12);
-
- vis_pack16(TMP14, DST_1);
- vis_st64(DST_0, dest[0]);
- vis_padd16(TMP30, TMP2, TMP14);
-
- vis_pack16(TMP16, DST_2);
- vis_padd16(REF_S4, TMP4, TMP16);
-
- vis_pack16(TMP18, DST_3);
- vis_st64_2(DST_2, dest, 8);
- dest += stride;
- vis_padd16(REF_S6, TMP6, TMP18);
-
- vis_padd16(TMP12, TMP20, TMP12);
-
- vis_padd16(TMP14, TMP22, TMP14);
- vis_pack16(TMP12, DST_0);
-
- vis_padd16(TMP16, TMP24, TMP16);
- vis_pack16(TMP14, DST_1);
- vis_st64(DST_0, dest[0]);
-
- vis_padd16(TMP18, TMP26, TMP18);
- vis_pack16(TMP16, DST_2);
-
- vis_pack16(TMP18, DST_3);
- vis_st64_2(DST_2, dest, 8);
- dest += stride;
- } while (--height);
-}
-
-static void MC_avg_no_round_y_8_vis (uint8_t * dest, const uint8_t * _ref,
- const int stride, int height)
-{
- uint8_t *ref = (uint8_t *) _ref;
- int stride_8 = stride + 8;
-
- vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[ 0], TMP0);
- vis_fzero(ZERO);
-
- vis_ld64(ref[ 8], TMP2);
-
- vis_ld64(constants3[0], CONST_3);
- vis_faligndata(TMP0, TMP2, REF_2);
-
- vis_ld64(constants256_512[0], CONST_256);
-
- height >>= 1;
- do { /* 20 cycles */
- vis_ld64_2(ref, stride, TMP0);
- vis_pmerge(ZERO, REF_2, TMP8);
- vis_mul8x16au(REF_2_1, CONST_256, TMP10);
-
- vis_ld64_2(ref, stride_8, TMP2);
- ref += stride;
-
- vis_ld64(dest[0], DST_0);
-
- vis_ld64_2(dest, stride, DST_2);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64_2(ref, stride, TMP4);
- vis_mul8x16al(DST_0, CONST_512, TMP16);
- vis_pmerge(ZERO, REF_0, TMP12);
-
- vis_ld64_2(ref, stride_8, TMP6);
- ref += stride;
- vis_mul8x16al(DST_1, CONST_512, TMP18);
- vis_pmerge(ZERO, REF_0_1, TMP14);
-
- vis_padd16(TMP12, CONST_3, TMP12);
- vis_mul8x16al(DST_2, CONST_512, TMP24);
-
- vis_padd16(TMP14, CONST_3, TMP14);
- vis_mul8x16al(DST_3, CONST_512, TMP26);
-
- vis_faligndata(TMP4, TMP6, REF_2);
-
- vis_padd16(TMP8, TMP12, TMP8);
-
- vis_padd16(TMP10, TMP14, TMP10);
- vis_mul8x16au(REF_2, CONST_256, TMP20);
-
- vis_padd16(TMP8, TMP16, TMP0);
- vis_mul8x16au(REF_2_1, CONST_256, TMP22);
-
- vis_padd16(TMP10, TMP18, TMP2);
- vis_pack16(TMP0, DST_0);
-
- vis_pack16(TMP2, DST_1);
- vis_st64(DST_0, dest[0]);
- dest += stride;
- vis_padd16(TMP12, TMP20, TMP12);
-
- vis_padd16(TMP14, TMP22, TMP14);
-
- vis_padd16(TMP12, TMP24, TMP0);
-
- vis_padd16(TMP14, TMP26, TMP2);
- vis_pack16(TMP0, DST_2);
-
- vis_pack16(TMP2, DST_3);
- vis_st64(DST_2, dest[0]);
- dest += stride;
- } while (--height);
-}
-
-static void MC_put_no_round_xy_16_vis (uint8_t * dest, const uint8_t * _ref,
- const int stride, int height)
-{
- uint8_t *ref = (uint8_t *) _ref;
- unsigned long off = (unsigned long) ref & 0x7;
- unsigned long off_plus_1 = off + 1;
- int stride_8 = stride + 8;
- int stride_16 = stride + 16;
-
- vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[ 0], TMP0);
- vis_fzero(ZERO);
-
- vis_ld64(ref[ 8], TMP2);
-
- vis_ld64(ref[16], TMP4);
-
- vis_ld64(constants1[0], CONST_1);
- vis_faligndata(TMP0, TMP2, REF_S0);
-
- vis_ld64(constants256_512[0], CONST_256);
- vis_faligndata(TMP2, TMP4, REF_S4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_S2);
- vis_faligndata(TMP2, TMP4, REF_S6);
- } else {
- vis_src1(TMP2, REF_S2);
- vis_src1(TMP4, REF_S6);
- }
-
- height >>= 1;
- do {
- vis_ld64_2(ref, stride, TMP0);
- vis_mul8x16au(REF_S0, CONST_256, TMP12);
- vis_pmerge(ZERO, REF_S0_1, TMP14);
-
- vis_alignaddr_g0((void *)off);
-
- vis_ld64_2(ref, stride_8, TMP2);
- vis_mul8x16au(REF_S2, CONST_256, TMP16);
- vis_pmerge(ZERO, REF_S2_1, TMP18);
-
- vis_ld64_2(ref, stride_16, TMP4);
- ref += stride;
- vis_mul8x16au(REF_S4, CONST_256, TMP20);
- vis_pmerge(ZERO, REF_S4_1, TMP22);
-
- vis_ld64_2(ref, stride, TMP6);
- vis_mul8x16au(REF_S6, CONST_256, TMP24);
- vis_pmerge(ZERO, REF_S6_1, TMP26);
-
- vis_ld64_2(ref, stride_8, TMP8);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64_2(ref, stride_16, TMP10);
- ref += stride;
- vis_faligndata(TMP2, TMP4, REF_4);
-
- vis_faligndata(TMP6, TMP8, REF_S0);
-
- vis_faligndata(TMP8, TMP10, REF_S4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- vis_faligndata(TMP2, TMP4, REF_6);
- vis_faligndata(TMP6, TMP8, REF_S2);
- vis_faligndata(TMP8, TMP10, REF_S6);
- } else {
- vis_src1(TMP2, REF_2);
- vis_src1(TMP4, REF_6);
- vis_src1(TMP8, REF_S2);
- vis_src1(TMP10, REF_S6);
- }
-
- vis_mul8x16au(REF_0, CONST_256, TMP0);
- vis_pmerge(ZERO, REF_0_1, TMP2);
-
- vis_mul8x16au(REF_2, CONST_256, TMP4);
- vis_pmerge(ZERO, REF_2_1, TMP6);
-
- vis_padd16(TMP0, CONST_2, TMP8);
- vis_mul8x16au(REF_4, CONST_256, TMP0);
-
- vis_padd16(TMP2, CONST_1, TMP10);
- vis_mul8x16au(REF_4_1, CONST_256, TMP2);
-
- vis_padd16(TMP8, TMP4, TMP8);
- vis_mul8x16au(REF_6, CONST_256, TMP4);
-
- vis_padd16(TMP10, TMP6, TMP10);
- vis_mul8x16au(REF_6_1, CONST_256, TMP6);
-
- vis_padd16(TMP12, TMP8, TMP12);
-
- vis_padd16(TMP14, TMP10, TMP14);
-
- vis_padd16(TMP12, TMP16, TMP12);
-
- vis_padd16(TMP14, TMP18, TMP14);
- vis_pack16(TMP12, DST_0);
-
- vis_pack16(TMP14, DST_1);
- vis_st64(DST_0, dest[0]);
- vis_padd16(TMP0, CONST_1, TMP12);
-
- vis_mul8x16au(REF_S0, CONST_256, TMP0);
- vis_padd16(TMP2, CONST_1, TMP14);
-
- vis_mul8x16au(REF_S0_1, CONST_256, TMP2);
- vis_padd16(TMP12, TMP4, TMP12);
-
- vis_mul8x16au(REF_S2, CONST_256, TMP4);
- vis_padd16(TMP14, TMP6, TMP14);
-
- vis_mul8x16au(REF_S2_1, CONST_256, TMP6);
- vis_padd16(TMP20, TMP12, TMP20);
-
- vis_padd16(TMP22, TMP14, TMP22);
-
- vis_padd16(TMP20, TMP24, TMP20);
-
- vis_padd16(TMP22, TMP26, TMP22);
- vis_pack16(TMP20, DST_2);
-
- vis_pack16(TMP22, DST_3);
- vis_st64_2(DST_2, dest, 8);
- dest += stride;
- vis_padd16(TMP0, TMP4, TMP24);
-
- vis_mul8x16au(REF_S4, CONST_256, TMP0);
- vis_padd16(TMP2, TMP6, TMP26);
-
- vis_mul8x16au(REF_S4_1, CONST_256, TMP2);
- vis_padd16(TMP24, TMP8, TMP24);
-
- vis_padd16(TMP26, TMP10, TMP26);
- vis_pack16(TMP24, DST_0);
-
- vis_pack16(TMP26, DST_1);
- vis_st64(DST_0, dest[0]);
- vis_pmerge(ZERO, REF_S6, TMP4);
-
- vis_pmerge(ZERO, REF_S6_1, TMP6);
-
- vis_padd16(TMP0, TMP4, TMP0);
-
- vis_padd16(TMP2, TMP6, TMP2);
-
- vis_padd16(TMP0, TMP12, TMP0);
-
- vis_padd16(TMP2, TMP14, TMP2);
- vis_pack16(TMP0, DST_2);
-
- vis_pack16(TMP2, DST_3);
- vis_st64_2(DST_2, dest, 8);
- dest += stride;
- } while (--height);
-}
-
-static void MC_put_no_round_xy_8_vis (uint8_t * dest, const uint8_t * _ref,
- const int stride, int height)
-{
- uint8_t *ref = (uint8_t *) _ref;
- unsigned long off = (unsigned long) ref & 0x7;
- unsigned long off_plus_1 = off + 1;
- int stride_8 = stride + 8;
-
- vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT);
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[ 0], TMP0);
- vis_fzero(ZERO);
-
- vis_ld64(ref[ 8], TMP2);
-
- vis_ld64(constants1[0], CONST_1);
-
- vis_ld64(constants256_512[0], CONST_256);
- vis_faligndata(TMP0, TMP2, REF_S0);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_S2);
- } else {
- vis_src1(TMP2, REF_S2);
- }
-
- height >>= 1;
- do { /* 26 cycles */
- vis_ld64_2(ref, stride, TMP0);
- vis_mul8x16au(REF_S0, CONST_256, TMP8);
- vis_pmerge(ZERO, REF_S2, TMP12);
-
- vis_alignaddr_g0((void *)off);
-
- vis_ld64_2(ref, stride_8, TMP2);
- ref += stride;
- vis_mul8x16au(REF_S0_1, CONST_256, TMP10);
- vis_pmerge(ZERO, REF_S2_1, TMP14);
-
- vis_ld64_2(ref, stride, TMP4);
-
- vis_ld64_2(ref, stride_8, TMP6);
- ref += stride;
- vis_faligndata(TMP0, TMP2, REF_S4);
-
- vis_pmerge(ZERO, REF_S4, TMP18);
-
- vis_pmerge(ZERO, REF_S4_1, TMP20);
-
- vis_faligndata(TMP4, TMP6, REF_S0);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_S6);
- vis_faligndata(TMP4, TMP6, REF_S2);
- } else {
- vis_src1(TMP2, REF_S6);
- vis_src1(TMP6, REF_S2);
- }
-
- vis_padd16(TMP18, CONST_1, TMP18);
- vis_mul8x16au(REF_S6, CONST_256, TMP22);
-
- vis_padd16(TMP20, CONST_1, TMP20);
- vis_mul8x16au(REF_S6_1, CONST_256, TMP24);
-
- vis_mul8x16au(REF_S0, CONST_256, TMP26);
- vis_pmerge(ZERO, REF_S0_1, TMP28);
-
- vis_mul8x16au(REF_S2, CONST_256, TMP30);
- vis_padd16(TMP18, TMP22, TMP18);
-
- vis_mul8x16au(REF_S2_1, CONST_256, TMP32);
- vis_padd16(TMP20, TMP24, TMP20);
-
- vis_padd16(TMP8, TMP18, TMP8);
-
- vis_padd16(TMP10, TMP20, TMP10);
-
- vis_padd16(TMP8, TMP12, TMP8);
-
- vis_padd16(TMP10, TMP14, TMP10);
- vis_pack16(TMP8, DST_0);
-
- vis_pack16(TMP10, DST_1);
- vis_st64(DST_0, dest[0]);
- dest += stride;
- vis_padd16(TMP18, TMP26, TMP18);
-
- vis_padd16(TMP20, TMP28, TMP20);
-
- vis_padd16(TMP18, TMP30, TMP18);
-
- vis_padd16(TMP20, TMP32, TMP20);
- vis_pack16(TMP18, DST_2);
-
- vis_pack16(TMP20, DST_3);
- vis_st64(DST_2, dest[0]);
- dest += stride;
- } while (--height);
-}
-
-static void MC_avg_no_round_xy_16_vis (uint8_t * dest, const uint8_t * _ref,
- const int stride, int height)
-{
- uint8_t *ref = (uint8_t *) _ref;
- unsigned long off = (unsigned long) ref & 0x7;
- unsigned long off_plus_1 = off + 1;
- int stride_8 = stride + 8;
- int stride_16 = stride + 16;
-
- vis_set_gsr(4 << VIS_GSR_SCALEFACT_SHIFT);
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[ 0], TMP0);
- vis_fzero(ZERO);
-
- vis_ld64(ref[ 8], TMP2);
-
- vis_ld64(ref[16], TMP4);
-
- vis_ld64(constants6[0], CONST_6);
- vis_faligndata(TMP0, TMP2, REF_S0);
-
- vis_ld64(constants256_1024[0], CONST_256);
- vis_faligndata(TMP2, TMP4, REF_S4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_S2);
- vis_faligndata(TMP2, TMP4, REF_S6);
- } else {
- vis_src1(TMP2, REF_S2);
- vis_src1(TMP4, REF_S6);
- }
-
- height >>= 1;
- do { /* 55 cycles */
- vis_ld64_2(ref, stride, TMP0);
- vis_mul8x16au(REF_S0, CONST_256, TMP12);
- vis_pmerge(ZERO, REF_S0_1, TMP14);
-
- vis_alignaddr_g0((void *)off);
-
- vis_ld64_2(ref, stride_8, TMP2);
- vis_mul8x16au(REF_S2, CONST_256, TMP16);
- vis_pmerge(ZERO, REF_S2_1, TMP18);
-
- vis_ld64_2(ref, stride_16, TMP4);
- ref += stride;
- vis_mul8x16au(REF_S4, CONST_256, TMP20);
- vis_pmerge(ZERO, REF_S4_1, TMP22);
-
- vis_ld64_2(ref, stride, TMP6);
- vis_mul8x16au(REF_S6, CONST_256, TMP24);
- vis_pmerge(ZERO, REF_S6_1, TMP26);
-
- vis_ld64_2(ref, stride_8, TMP8);
- vis_faligndata(TMP0, TMP2, REF_0);
-
- vis_ld64_2(ref, stride_16, TMP10);
- ref += stride;
- vis_faligndata(TMP2, TMP4, REF_4);
-
- vis_ld64(dest[0], DST_0);
- vis_faligndata(TMP6, TMP8, REF_S0);
-
- vis_ld64_2(dest, 8, DST_2);
- vis_faligndata(TMP8, TMP10, REF_S4);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_2);
- vis_faligndata(TMP2, TMP4, REF_6);
- vis_faligndata(TMP6, TMP8, REF_S2);
- vis_faligndata(TMP8, TMP10, REF_S6);
- } else {
- vis_src1(TMP2, REF_2);
- vis_src1(TMP4, REF_6);
- vis_src1(TMP8, REF_S2);
- vis_src1(TMP10, REF_S6);
- }
-
- vis_mul8x16al(DST_0, CONST_1024, TMP30);
- vis_pmerge(ZERO, REF_0, TMP0);
-
- vis_mul8x16al(DST_1, CONST_1024, TMP32);
- vis_pmerge(ZERO, REF_0_1, TMP2);
-
- vis_mul8x16au(REF_2, CONST_256, TMP4);
- vis_pmerge(ZERO, REF_2_1, TMP6);
-
- vis_mul8x16al(DST_2, CONST_1024, REF_0);
- vis_padd16(TMP0, CONST_6, TMP0);
-
- vis_mul8x16al(DST_3, CONST_1024, REF_2);
- vis_padd16(TMP2, CONST_6, TMP2);
-
- vis_padd16(TMP0, TMP4, TMP0);
- vis_mul8x16au(REF_4, CONST_256, TMP4);
-
- vis_padd16(TMP2, TMP6, TMP2);
- vis_mul8x16au(REF_4_1, CONST_256, TMP6);
-
- vis_padd16(TMP12, TMP0, TMP12);
- vis_mul8x16au(REF_6, CONST_256, TMP8);
-
- vis_padd16(TMP14, TMP2, TMP14);
- vis_mul8x16au(REF_6_1, CONST_256, TMP10);
-
- vis_padd16(TMP12, TMP16, TMP12);
- vis_mul8x16au(REF_S0, CONST_256, REF_4);
-
- vis_padd16(TMP14, TMP18, TMP14);
- vis_mul8x16au(REF_S0_1, CONST_256, REF_6);
-
- vis_padd16(TMP12, TMP30, TMP12);
-
- vis_padd16(TMP14, TMP32, TMP14);
- vis_pack16(TMP12, DST_0);
-
- vis_pack16(TMP14, DST_1);
- vis_st64(DST_0, dest[0]);
- vis_padd16(TMP4, CONST_6, TMP4);
-
- vis_ld64_2(dest, stride, DST_0);
- vis_padd16(TMP6, CONST_6, TMP6);
- vis_mul8x16au(REF_S2, CONST_256, TMP12);
-
- vis_padd16(TMP4, TMP8, TMP4);
- vis_mul8x16au(REF_S2_1, CONST_256, TMP14);
-
- vis_padd16(TMP6, TMP10, TMP6);
-
- vis_padd16(TMP20, TMP4, TMP20);
-
- vis_padd16(TMP22, TMP6, TMP22);
-
- vis_padd16(TMP20, TMP24, TMP20);
-
- vis_padd16(TMP22, TMP26, TMP22);
-
- vis_padd16(TMP20, REF_0, TMP20);
- vis_mul8x16au(REF_S4, CONST_256, REF_0);
-
- vis_padd16(TMP22, REF_2, TMP22);
- vis_pack16(TMP20, DST_2);
-
- vis_pack16(TMP22, DST_3);
- vis_st64_2(DST_2, dest, 8);
- dest += stride;
-
- vis_ld64_2(dest, 8, DST_2);
- vis_mul8x16al(DST_0, CONST_1024, TMP30);
- vis_pmerge(ZERO, REF_S4_1, REF_2);
-
- vis_mul8x16al(DST_1, CONST_1024, TMP32);
- vis_padd16(REF_4, TMP0, TMP8);
-
- vis_mul8x16au(REF_S6, CONST_256, REF_4);
- vis_padd16(REF_6, TMP2, TMP10);
-
- vis_mul8x16au(REF_S6_1, CONST_256, REF_6);
- vis_padd16(TMP8, TMP12, TMP8);
-
- vis_padd16(TMP10, TMP14, TMP10);
-
- vis_padd16(TMP8, TMP30, TMP8);
-
- vis_padd16(TMP10, TMP32, TMP10);
- vis_pack16(TMP8, DST_0);
-
- vis_pack16(TMP10, DST_1);
- vis_st64(DST_0, dest[0]);
-
- vis_padd16(REF_0, TMP4, REF_0);
-
- vis_mul8x16al(DST_2, CONST_1024, TMP30);
- vis_padd16(REF_2, TMP6, REF_2);
-
- vis_mul8x16al(DST_3, CONST_1024, TMP32);
- vis_padd16(REF_0, REF_4, REF_0);
-
- vis_padd16(REF_2, REF_6, REF_2);
-
- vis_padd16(REF_0, TMP30, REF_0);
-
- /* stall */
-
- vis_padd16(REF_2, TMP32, REF_2);
- vis_pack16(REF_0, DST_2);
-
- vis_pack16(REF_2, DST_3);
- vis_st64_2(DST_2, dest, 8);
- dest += stride;
- } while (--height);
-}
-
-static void MC_avg_no_round_xy_8_vis (uint8_t * dest, const uint8_t * _ref,
- const int stride, int height)
-{
- uint8_t *ref = (uint8_t *) _ref;
- unsigned long off = (unsigned long) ref & 0x7;
- unsigned long off_plus_1 = off + 1;
- int stride_8 = stride + 8;
-
- vis_set_gsr(4 << VIS_GSR_SCALEFACT_SHIFT);
-
- ref = vis_alignaddr(ref);
-
- vis_ld64(ref[0], TMP0);
- vis_fzero(ZERO);
-
- vis_ld64_2(ref, 8, TMP2);
-
- vis_ld64(constants6[0], CONST_6);
-
- vis_ld64(constants256_1024[0], CONST_256);
- vis_faligndata(TMP0, TMP2, REF_S0);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_S2);
- } else {
- vis_src1(TMP2, REF_S2);
- }
-
- height >>= 1;
- do { /* 31 cycles */
- vis_ld64_2(ref, stride, TMP0);
- vis_mul8x16au(REF_S0, CONST_256, TMP8);
- vis_pmerge(ZERO, REF_S0_1, TMP10);
-
- vis_ld64_2(ref, stride_8, TMP2);
- ref += stride;
- vis_mul8x16au(REF_S2, CONST_256, TMP12);
- vis_pmerge(ZERO, REF_S2_1, TMP14);
-
- vis_alignaddr_g0((void *)off);
-
- vis_ld64_2(ref, stride, TMP4);
- vis_faligndata(TMP0, TMP2, REF_S4);
-
- vis_ld64_2(ref, stride_8, TMP6);
- ref += stride;
-
- vis_ld64(dest[0], DST_0);
- vis_faligndata(TMP4, TMP6, REF_S0);
-
- vis_ld64_2(dest, stride, DST_2);
-
- if (off != 0x7) {
- vis_alignaddr_g0((void *)off_plus_1);
- vis_faligndata(TMP0, TMP2, REF_S6);
- vis_faligndata(TMP4, TMP6, REF_S2);
- } else {
- vis_src1(TMP2, REF_S6);
- vis_src1(TMP6, REF_S2);
- }
-
- vis_mul8x16al(DST_0, CONST_1024, TMP30);
- vis_pmerge(ZERO, REF_S4, TMP22);
-
- vis_mul8x16al(DST_1, CONST_1024, TMP32);
- vis_pmerge(ZERO, REF_S4_1, TMP24);
-
- vis_mul8x16au(REF_S6, CONST_256, TMP26);
- vis_pmerge(ZERO, REF_S6_1, TMP28);
-
- vis_mul8x16au(REF_S0, CONST_256, REF_S4);
- vis_padd16(TMP22, CONST_6, TMP22);
-
- vis_mul8x16au(REF_S0_1, CONST_256, REF_S6);
- vis_padd16(TMP24, CONST_6, TMP24);
-
- vis_mul8x16al(DST_2, CONST_1024, REF_0);
- vis_padd16(TMP22, TMP26, TMP22);
-
- vis_mul8x16al(DST_3, CONST_1024, REF_2);
- vis_padd16(TMP24, TMP28, TMP24);
-
- vis_mul8x16au(REF_S2, CONST_256, TMP26);
- vis_padd16(TMP8, TMP22, TMP8);
-
- vis_mul8x16au(REF_S2_1, CONST_256, TMP28);
- vis_padd16(TMP10, TMP24, TMP10);
-
- vis_padd16(TMP8, TMP12, TMP8);
-
- vis_padd16(TMP10, TMP14, TMP10);
-
- vis_padd16(TMP8, TMP30, TMP8);
-
- vis_padd16(TMP10, TMP32, TMP10);
- vis_pack16(TMP8, DST_0);
-
- vis_pack16(TMP10, DST_1);
- vis_st64(DST_0, dest[0]);
- dest += stride;
-
- vis_padd16(REF_S4, TMP22, TMP12);
-
- vis_padd16(REF_S6, TMP24, TMP14);
-
- vis_padd16(TMP12, TMP26, TMP12);
-
- vis_padd16(TMP14, TMP28, TMP14);
-
- vis_padd16(TMP12, REF_0, TMP12);
-
- vis_padd16(TMP14, REF_2, TMP14);
- vis_pack16(TMP12, DST_2);
-
- vis_pack16(TMP14, DST_3);
- vis_st64(DST_2, dest[0]);
- dest += stride;
- } while (--height);
-}
-
-/* End of no rounding code */
-
-static sigjmp_buf jmpbuf;
-static volatile sig_atomic_t canjump = 0;
-
-static void sigill_handler (int sig)
-{
- if (!canjump) {
- signal (sig, SIG_DFL);
- raise (sig);
- }
-
- canjump = 0;
- siglongjmp (jmpbuf, 1);
-}
-
-#define ACCEL_SPARC_VIS 1
-#define ACCEL_SPARC_VIS2 2
-
-static int vis_level ()
-{
- int accel = 0;
-
- signal (SIGILL, sigill_handler);
- if (sigsetjmp (jmpbuf, 1)) {
- signal (SIGILL, SIG_DFL);
- return accel;
- }
-
- canjump = 1;
-
- /* pdist %f0, %f0, %f0 */
- __asm__ __volatile__(".word\t0x81b007c0");
-
- canjump = 0;
- accel |= ACCEL_SPARC_VIS;
-
- if (sigsetjmp (jmpbuf, 1)) {
- signal (SIGILL, SIG_DFL);
- return accel;
- }
-
- canjump = 1;
-
- /* edge8n %g0, %g0, %g0 */
- __asm__ __volatile__(".word\t0x81b00020");
-
- canjump = 0;
- accel |= ACCEL_SPARC_VIS2;
-
- signal (SIGILL, SIG_DFL);
-
- return accel;
-}
-
-/* libavcodec initialization code */
-void dsputil_init_vis(DSPContext* c, AVCodecContext *avctx)
-{
- /* VIS specific optimisations */
- int accel = vis_level ();
-
- if (accel & ACCEL_SPARC_VIS) {
- c->put_pixels_tab[0][0] = MC_put_o_16_vis;
- c->put_pixels_tab[0][1] = MC_put_x_16_vis;
- c->put_pixels_tab[0][2] = MC_put_y_16_vis;
- c->put_pixels_tab[0][3] = MC_put_xy_16_vis;
-
- c->put_pixels_tab[1][0] = MC_put_o_8_vis;
- c->put_pixels_tab[1][1] = MC_put_x_8_vis;
- c->put_pixels_tab[1][2] = MC_put_y_8_vis;
- c->put_pixels_tab[1][3] = MC_put_xy_8_vis;
-
- c->avg_pixels_tab[0][0] = MC_avg_o_16_vis;
- c->avg_pixels_tab[0][1] = MC_avg_x_16_vis;
- c->avg_pixels_tab[0][2] = MC_avg_y_16_vis;
- c->avg_pixels_tab[0][3] = MC_avg_xy_16_vis;
-
- c->avg_pixels_tab[1][0] = MC_avg_o_8_vis;
- c->avg_pixels_tab[1][1] = MC_avg_x_8_vis;
- c->avg_pixels_tab[1][2] = MC_avg_y_8_vis;
- c->avg_pixels_tab[1][3] = MC_avg_xy_8_vis;
-
- c->put_no_rnd_pixels_tab[0][0] = MC_put_no_round_o_16_vis;
- c->put_no_rnd_pixels_tab[0][1] = MC_put_no_round_x_16_vis;
- c->put_no_rnd_pixels_tab[0][2] = MC_put_no_round_y_16_vis;
- c->put_no_rnd_pixels_tab[0][3] = MC_put_no_round_xy_16_vis;
-
- c->put_no_rnd_pixels_tab[1][0] = MC_put_no_round_o_8_vis;
- c->put_no_rnd_pixels_tab[1][1] = MC_put_no_round_x_8_vis;
- c->put_no_rnd_pixels_tab[1][2] = MC_put_no_round_y_8_vis;
- c->put_no_rnd_pixels_tab[1][3] = MC_put_no_round_xy_8_vis;
-
- c->avg_no_rnd_pixels_tab[0][0] = MC_avg_no_round_o_16_vis;
- c->avg_no_rnd_pixels_tab[0][1] = MC_avg_no_round_x_16_vis;
- c->avg_no_rnd_pixels_tab[0][2] = MC_avg_no_round_y_16_vis;
- c->avg_no_rnd_pixels_tab[0][3] = MC_avg_no_round_xy_16_vis;
-
- c->avg_no_rnd_pixels_tab[1][0] = MC_avg_no_round_o_8_vis;
- c->avg_no_rnd_pixels_tab[1][1] = MC_avg_no_round_x_8_vis;
- c->avg_no_rnd_pixels_tab[1][2] = MC_avg_no_round_y_8_vis;
- c->avg_no_rnd_pixels_tab[1][3] = MC_avg_no_round_xy_8_vis;
- }
-}
-
-#endif /* !(ARCH_SPARC) */
diff --git a/src/libffmpeg/libavcodec/sparc/libavcodec_sparc_dummy.c b/src/libffmpeg/libavcodec/sparc/libavcodec_sparc_dummy.c
deleted file mode 100644
index 5efeac422..000000000
--- a/src/libffmpeg/libavcodec/sparc/libavcodec_sparc_dummy.c
+++ /dev/null
@@ -1,2 +0,0 @@
-
-char libavcodec_sparc_dummy;
diff --git a/src/libffmpeg/libavcodec/sparc/vis.h b/src/libffmpeg/libavcodec/sparc/vis.h
deleted file mode 100644
index d4a8ce092..000000000
--- a/src/libffmpeg/libavcodec/sparc/vis.h
+++ /dev/null
@@ -1,327 +0,0 @@
-/*
- * vis.h
- * Copyright (C) 2003 David S. Miller <davem@redhat.com>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/* You may be asking why I hard-code the instruction opcodes and don't
- * use the normal VIS assembler mnenomics for the VIS instructions.
- *
- * The reason is that Sun, in their infinite wisdom, decided that a binary
- * using a VIS instruction will cause it to be marked (in the ELF headers)
- * as doing so, and this prevents the OS from loading such binaries if the
- * current cpu doesn't have VIS. There is no way to easily override this
- * behavior of the assembler that I am aware of.
- *
- * This totally defeats what libmpeg2 is trying to do which is allow a
- * single binary to be created, and then detect the availability of VIS
- * at runtime.
- *
- * I'm not saying that tainting the binary by default is bad, rather I'm
- * saying that not providing a way to override this easily unnecessarily
- * ties people's hands.
- *
- * Thus, we do the opcode encoding by hand and output 32-bit words in
- * the assembler to keep the binary from becoming tainted.
- */
-
-#define vis_opc_base ((0x1 << 31) | (0x36 << 19))
-#define vis_opf(X) ((X) << 5)
-#define vis_sreg(X) (X)
-#define vis_dreg(X) (((X)&0x1f)|((X)>>5))
-#define vis_rs1_s(X) (vis_sreg(X) << 14)
-#define vis_rs1_d(X) (vis_dreg(X) << 14)
-#define vis_rs2_s(X) (vis_sreg(X) << 0)
-#define vis_rs2_d(X) (vis_dreg(X) << 0)
-#define vis_rd_s(X) (vis_sreg(X) << 25)
-#define vis_rd_d(X) (vis_dreg(X) << 25)
-
-#define vis_ss2s(opf,rs1,rs2,rd) \
- __asm__ __volatile__ (".word %0" \
- : : "i" (vis_opc_base | vis_opf(opf) | \
- vis_rs1_s(rs1) | \
- vis_rs2_s(rs2) | \
- vis_rd_s(rd)))
-
-#define vis_dd2d(opf,rs1,rs2,rd) \
- __asm__ __volatile__ (".word %0" \
- : : "i" (vis_opc_base | vis_opf(opf) | \
- vis_rs1_d(rs1) | \
- vis_rs2_d(rs2) | \
- vis_rd_d(rd)))
-
-#define vis_ss2d(opf,rs1,rs2,rd) \
- __asm__ __volatile__ (".word %0" \
- : : "i" (vis_opc_base | vis_opf(opf) | \
- vis_rs1_s(rs1) | \
- vis_rs2_s(rs2) | \
- vis_rd_d(rd)))
-
-#define vis_sd2d(opf,rs1,rs2,rd) \
- __asm__ __volatile__ (".word %0" \
- : : "i" (vis_opc_base | vis_opf(opf) | \
- vis_rs1_s(rs1) | \
- vis_rs2_d(rs2) | \
- vis_rd_d(rd)))
-
-#define vis_d2s(opf,rs2,rd) \
- __asm__ __volatile__ (".word %0" \
- : : "i" (vis_opc_base | vis_opf(opf) | \
- vis_rs2_d(rs2) | \
- vis_rd_s(rd)))
-
-#define vis_s2d(opf,rs2,rd) \
- __asm__ __volatile__ (".word %0" \
- : : "i" (vis_opc_base | vis_opf(opf) | \
- vis_rs2_s(rs2) | \
- vis_rd_d(rd)))
-
-#define vis_d12d(opf,rs1,rd) \
- __asm__ __volatile__ (".word %0" \
- : : "i" (vis_opc_base | vis_opf(opf) | \
- vis_rs1_d(rs1) | \
- vis_rd_d(rd)))
-
-#define vis_d22d(opf,rs2,rd) \
- __asm__ __volatile__ (".word %0" \
- : : "i" (vis_opc_base | vis_opf(opf) | \
- vis_rs2_d(rs2) | \
- vis_rd_d(rd)))
-
-#define vis_s12s(opf,rs1,rd) \
- __asm__ __volatile__ (".word %0" \
- : : "i" (vis_opc_base | vis_opf(opf) | \
- vis_rs1_s(rs1) | \
- vis_rd_s(rd)))
-
-#define vis_s22s(opf,rs2,rd) \
- __asm__ __volatile__ (".word %0" \
- : : "i" (vis_opc_base | vis_opf(opf) | \
- vis_rs2_s(rs2) | \
- vis_rd_s(rd)))
-
-#define vis_s(opf,rd) \
- __asm__ __volatile__ (".word %0" \
- : : "i" (vis_opc_base | vis_opf(opf) | \
- vis_rd_s(rd)))
-
-#define vis_d(opf,rd) \
- __asm__ __volatile__ (".word %0" \
- : : "i" (vis_opc_base | vis_opf(opf) | \
- vis_rd_d(rd)))
-
-#define vis_r2m(op,rd,mem) \
- __asm__ __volatile__ (#op "\t%%f" #rd ", [%0]" : : "r" (&(mem)) )
-
-#define vis_r2m_2(op,rd,mem1,mem2) \
- __asm__ __volatile__ (#op "\t%%f" #rd ", [%0 + %1]" : : "r" (mem1), "r" (mem2) )
-
-#define vis_m2r(op,mem,rd) \
- __asm__ __volatile__ (#op "\t[%0], %%f" #rd : : "r" (&(mem)) )
-
-#define vis_m2r_2(op,mem1,mem2,rd) \
- __asm__ __volatile__ (#op "\t[%0 + %1], %%f" #rd : : "r" (mem1), "r" (mem2) )
-
-static inline void vis_set_gsr(unsigned int _val)
-{
- register unsigned int val asm("g1");
-
- val = _val;
- __asm__ __volatile__(".word 0xa7804000"
- : : "r" (val));
-}
-
-#define VIS_GSR_ALIGNADDR_MASK 0x0000007
-#define VIS_GSR_ALIGNADDR_SHIFT 0
-#define VIS_GSR_SCALEFACT_MASK 0x0000078
-#define VIS_GSR_SCALEFACT_SHIFT 3
-
-#define vis_ld32(mem,rs1) vis_m2r(ld, mem, rs1)
-#define vis_ld32_2(mem1,mem2,rs1) vis_m2r_2(ld, mem1, mem2, rs1)
-#define vis_st32(rs1,mem) vis_r2m(st, rs1, mem)
-#define vis_st32_2(rs1,mem1,mem2) vis_r2m_2(st, rs1, mem1, mem2)
-#define vis_ld64(mem,rs1) vis_m2r(ldd, mem, rs1)
-#define vis_ld64_2(mem1,mem2,rs1) vis_m2r_2(ldd, mem1, mem2, rs1)
-#define vis_st64(rs1,mem) vis_r2m(std, rs1, mem)
-#define vis_st64_2(rs1,mem1,mem2) vis_r2m_2(std, rs1, mem1, mem2)
-
-#define vis_ldblk(mem, rd) \
-do { register void *__mem asm("g1"); \
- __mem = &(mem); \
- __asm__ __volatile__(".word 0xc1985e00 | %1" \
- : \
- : "r" (__mem), \
- "i" (vis_rd_d(rd)) \
- : "memory"); \
-} while (0)
-
-#define vis_stblk(rd, mem) \
-do { register void *__mem asm("g1"); \
- __mem = &(mem); \
- __asm__ __volatile__(".word 0xc1b85e00 | %1" \
- : \
- : "r" (__mem), \
- "i" (vis_rd_d(rd)) \
- : "memory"); \
-} while (0)
-
-#define vis_membar_storestore() \
- __asm__ __volatile__(".word 0x8143e008" : : : "memory")
-
-#define vis_membar_sync() \
- __asm__ __volatile__(".word 0x8143e040" : : : "memory")
-
-/* 16 and 32 bit partitioned addition and subtraction. The normal
- * versions perform 4 16-bit or 2 32-bit additions or subtractions.
- * The 's' versions perform 2 16-bit or 1 32-bit additions or
- * subtractions.
- */
-
-#define vis_padd16(rs1,rs2,rd) vis_dd2d(0x50, rs1, rs2, rd)
-#define vis_padd16s(rs1,rs2,rd) vis_ss2s(0x51, rs1, rs2, rd)
-#define vis_padd32(rs1,rs2,rd) vis_dd2d(0x52, rs1, rs2, rd)
-#define vis_padd32s(rs1,rs2,rd) vis_ss2s(0x53, rs1, rs2, rd)
-#define vis_psub16(rs1,rs2,rd) vis_dd2d(0x54, rs1, rs2, rd)
-#define vis_psub16s(rs1,rs2,rd) vis_ss2s(0x55, rs1, rs2, rd)
-#define vis_psub32(rs1,rs2,rd) vis_dd2d(0x56, rs1, rs2, rd)
-#define vis_psub32s(rs1,rs2,rd) vis_ss2s(0x57, rs1, rs2, rd)
-
-/* Pixel formatting instructions. */
-
-#define vis_pack16(rs2,rd) vis_d2s( 0x3b, rs2, rd)
-#define vis_pack32(rs1,rs2,rd) vis_dd2d(0x3a, rs1, rs2, rd)
-#define vis_packfix(rs2,rd) vis_d2s( 0x3d, rs2, rd)
-#define vis_expand(rs2,rd) vis_s2d( 0x4d, rs2, rd)
-#define vis_pmerge(rs1,rs2,rd) vis_ss2d(0x4b, rs1, rs2, rd)
-
-/* Partitioned multiply instructions. */
-
-#define vis_mul8x16(rs1,rs2,rd) vis_sd2d(0x31, rs1, rs2, rd)
-#define vis_mul8x16au(rs1,rs2,rd) vis_ss2d(0x33, rs1, rs2, rd)
-#define vis_mul8x16al(rs1,rs2,rd) vis_ss2d(0x35, rs1, rs2, rd)
-#define vis_mul8sux16(rs1,rs2,rd) vis_dd2d(0x36, rs1, rs2, rd)
-#define vis_mul8ulx16(rs1,rs2,rd) vis_dd2d(0x37, rs1, rs2, rd)
-#define vis_muld8sux16(rs1,rs2,rd) vis_ss2d(0x38, rs1, rs2, rd)
-#define vis_muld8ulx16(rs1,rs2,rd) vis_ss2d(0x39, rs1, rs2, rd)
-
-/* Alignment instructions. */
-
-static inline void *vis_alignaddr(void *_ptr)
-{
- register void *ptr asm("g1");
-
- ptr = _ptr;
-
- __asm__ __volatile__(".word %2"
- : "=&r" (ptr)
- : "0" (ptr),
- "i" (vis_opc_base | vis_opf(0x18) |
- vis_rs1_s(1) |
- vis_rs2_s(0) |
- vis_rd_s(1)));
-
- return ptr;
-}
-
-static inline void vis_alignaddr_g0(void *_ptr)
-{
- register void *ptr asm("g1");
-
- ptr = _ptr;
-
- __asm__ __volatile__(".word %2"
- : "=&r" (ptr)
- : "0" (ptr),
- "i" (vis_opc_base | vis_opf(0x18) |
- vis_rs1_s(1) |
- vis_rs2_s(0) |
- vis_rd_s(0)));
-}
-
-static inline void *vis_alignaddrl(void *_ptr)
-{
- register void *ptr asm("g1");
-
- ptr = _ptr;
-
- __asm__ __volatile__(".word %2"
- : "=&r" (ptr)
- : "0" (ptr),
- "i" (vis_opc_base | vis_opf(0x19) |
- vis_rs1_s(1) |
- vis_rs2_s(0) |
- vis_rd_s(1)));
-
- return ptr;
-}
-
-static inline void vis_alignaddrl_g0(void *_ptr)
-{
- register void *ptr asm("g1");
-
- ptr = _ptr;
-
- __asm__ __volatile__(".word %2"
- : "=&r" (ptr)
- : "0" (ptr),
- "i" (vis_opc_base | vis_opf(0x19) |
- vis_rs1_s(1) |
- vis_rs2_s(0) |
- vis_rd_s(0)));
-}
-
-#define vis_faligndata(rs1,rs2,rd) vis_dd2d(0x48, rs1, rs2, rd)
-
-/* Logical operate instructions. */
-
-#define vis_fzero(rd) vis_d( 0x60, rd)
-#define vis_fzeros(rd) vis_s( 0x61, rd)
-#define vis_fone(rd) vis_d( 0x7e, rd)
-#define vis_fones(rd) vis_s( 0x7f, rd)
-#define vis_src1(rs1,rd) vis_d12d(0x74, rs1, rd)
-#define vis_src1s(rs1,rd) vis_s12s(0x75, rs1, rd)
-#define vis_src2(rs2,rd) vis_d22d(0x78, rs2, rd)
-#define vis_src2s(rs2,rd) vis_s22s(0x79, rs2, rd)
-#define vis_not1(rs1,rd) vis_d12d(0x6a, rs1, rd)
-#define vis_not1s(rs1,rd) vis_s12s(0x6b, rs1, rd)
-#define vis_not2(rs2,rd) vis_d22d(0x66, rs2, rd)
-#define vis_not2s(rs2,rd) vis_s22s(0x67, rs2, rd)
-#define vis_or(rs1,rs2,rd) vis_dd2d(0x7c, rs1, rs2, rd)
-#define vis_ors(rs1,rs2,rd) vis_ss2s(0x7d, rs1, rs2, rd)
-#define vis_nor(rs1,rs2,rd) vis_dd2d(0x62, rs1, rs2, rd)
-#define vis_nors(rs1,rs2,rd) vis_ss2s(0x63, rs1, rs2, rd)
-#define vis_and(rs1,rs2,rd) vis_dd2d(0x70, rs1, rs2, rd)
-#define vis_ands(rs1,rs2,rd) vis_ss2s(0x71, rs1, rs2, rd)
-#define vis_nand(rs1,rs2,rd) vis_dd2d(0x6e, rs1, rs2, rd)
-#define vis_nands(rs1,rs2,rd) vis_ss2s(0x6f, rs1, rs2, rd)
-#define vis_xor(rs1,rs2,rd) vis_dd2d(0x6c, rs1, rs2, rd)
-#define vis_xors(rs1,rs2,rd) vis_ss2s(0x6d, rs1, rs2, rd)
-#define vis_xnor(rs1,rs2,rd) vis_dd2d(0x72, rs1, rs2, rd)
-#define vis_xnors(rs1,rs2,rd) vis_ss2s(0x73, rs1, rs2, rd)
-#define vis_ornot1(rs1,rs2,rd) vis_dd2d(0x7a, rs1, rs2, rd)
-#define vis_ornot1s(rs1,rs2,rd) vis_ss2s(0x7b, rs1, rs2, rd)
-#define vis_ornot2(rs1,rs2,rd) vis_dd2d(0x76, rs1, rs2, rd)
-#define vis_ornot2s(rs1,rs2,rd) vis_ss2s(0x77, rs1, rs2, rd)
-#define vis_andnot1(rs1,rs2,rd) vis_dd2d(0x68, rs1, rs2, rd)
-#define vis_andnot1s(rs1,rs2,rd) vis_ss2s(0x69, rs1, rs2, rd)
-#define vis_andnot2(rs1,rs2,rd) vis_dd2d(0x64, rs1, rs2, rd)
-#define vis_andnot2s(rs1,rs2,rd) vis_ss2s(0x65, rs1, rs2, rd)
-
-/* Pixel component distance. */
-
-#define vis_pdist(rs1,rs2,rd) vis_dd2d(0x3e, rs1, rs2, rd)
diff --git a/src/libffmpeg/libavcodec/svq1.c b/src/libffmpeg/libavcodec/svq1.c
deleted file mode 100644
index 5e8616269..000000000
--- a/src/libffmpeg/libavcodec/svq1.c
+++ /dev/null
@@ -1,1431 +0,0 @@
-/*
- *
- * Copyright (C) 2002 the xine project
- * Copyright (C) 2002 the ffmpeg project
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * (SVQ1 Decoder)
- * Ported to mplayer by Arpi <arpi@thot.banki.hu>
- * Ported to libavcodec by Nick Kurshev <nickols_k@mail.ru>
- *
- * SVQ1 Encoder (c) 2004 Mike Melanson <melanson@pcisys.net>
- */
-
-/**
- * @file svq1.c
- * Sorenson Vector Quantizer #1 (SVQ1) video codec.
- * For more information of the SVQ1 algorithm, visit:
- * http://www.pcisys.net/~melanson/codecs/
- */
-
-
-//#define DEBUG_SVQ1
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <limits.h>
-
-#include "common.h"
-#include "avcodec.h"
-#include "dsputil.h"
-#include "mpegvideo.h"
-#include "bswap.h"
-
-#undef NDEBUG
-#include <assert.h>
-
-extern const uint8_t mvtab[33][2];
-
-static VLC svq1_block_type;
-static VLC svq1_motion_component;
-static VLC svq1_intra_multistage[6];
-static VLC svq1_inter_multistage[6];
-static VLC svq1_intra_mean;
-static VLC svq1_inter_mean;
-
-#define SVQ1_BLOCK_SKIP 0
-#define SVQ1_BLOCK_INTER 1
-#define SVQ1_BLOCK_INTER_4V 2
-#define SVQ1_BLOCK_INTRA 3
-
-typedef struct SVQ1Context {
- MpegEncContext m; // needed for motion estimation, should not be used for anything else, the idea is to make the motion estimation eventually independant of MpegEncContext, so this will be removed then (FIXME/XXX)
- AVCodecContext *avctx;
- DSPContext dsp;
- AVFrame picture;
- AVFrame current_picture;
- AVFrame last_picture;
- PutBitContext pb;
- GetBitContext gb;
-
- PutBitContext reorder_pb[6]; //why ooh why this sick breadth first order, everything is slower and more complex
-
- int frame_width;
- int frame_height;
-
- /* Y plane block dimensions */
- int y_block_width;
- int y_block_height;
-
- /* U & V plane (C planes) block dimensions */
- int c_block_width;
- int c_block_height;
-
- uint16_t *mb_type;
- uint32_t *dummy;
- int16_t (*motion_val8[3])[2];
- int16_t (*motion_val16[3])[2];
-
- int64_t rd_total;
-} SVQ1Context;
-
-/* motion vector (prediction) */
-typedef struct svq1_pmv_s {
- int x;
- int y;
-} svq1_pmv_t;
-
-#include "svq1_cb.h"
-#include "svq1_vlc.h"
-
-static const uint16_t checksum_table[256] = {
- 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7,
- 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF,
- 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6,
- 0x9339, 0x8318, 0xB37B, 0xA35A, 0xD3BD, 0xC39C, 0xF3FF, 0xE3DE,
- 0x2462, 0x3443, 0x0420, 0x1401, 0x64E6, 0x74C7, 0x44A4, 0x5485,
- 0xA56A, 0xB54B, 0x8528, 0x9509, 0xE5EE, 0xF5CF, 0xC5AC, 0xD58D,
- 0x3653, 0x2672, 0x1611, 0x0630, 0x76D7, 0x66F6, 0x5695, 0x46B4,
- 0xB75B, 0xA77A, 0x9719, 0x8738, 0xF7DF, 0xE7FE, 0xD79D, 0xC7BC,
- 0x48C4, 0x58E5, 0x6886, 0x78A7, 0x0840, 0x1861, 0x2802, 0x3823,
- 0xC9CC, 0xD9ED, 0xE98E, 0xF9AF, 0x8948, 0x9969, 0xA90A, 0xB92B,
- 0x5AF5, 0x4AD4, 0x7AB7, 0x6A96, 0x1A71, 0x0A50, 0x3A33, 0x2A12,
- 0xDBFD, 0xCBDC, 0xFBBF, 0xEB9E, 0x9B79, 0x8B58, 0xBB3B, 0xAB1A,
- 0x6CA6, 0x7C87, 0x4CE4, 0x5CC5, 0x2C22, 0x3C03, 0x0C60, 0x1C41,
- 0xEDAE, 0xFD8F, 0xCDEC, 0xDDCD, 0xAD2A, 0xBD0B, 0x8D68, 0x9D49,
- 0x7E97, 0x6EB6, 0x5ED5, 0x4EF4, 0x3E13, 0x2E32, 0x1E51, 0x0E70,
- 0xFF9F, 0xEFBE, 0xDFDD, 0xCFFC, 0xBF1B, 0xAF3A, 0x9F59, 0x8F78,
- 0x9188, 0x81A9, 0xB1CA, 0xA1EB, 0xD10C, 0xC12D, 0xF14E, 0xE16F,
- 0x1080, 0x00A1, 0x30C2, 0x20E3, 0x5004, 0x4025, 0x7046, 0x6067,
- 0x83B9, 0x9398, 0xA3FB, 0xB3DA, 0xC33D, 0xD31C, 0xE37F, 0xF35E,
- 0x02B1, 0x1290, 0x22F3, 0x32D2, 0x4235, 0x5214, 0x6277, 0x7256,
- 0xB5EA, 0xA5CB, 0x95A8, 0x8589, 0xF56E, 0xE54F, 0xD52C, 0xC50D,
- 0x34E2, 0x24C3, 0x14A0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405,
- 0xA7DB, 0xB7FA, 0x8799, 0x97B8, 0xE75F, 0xF77E, 0xC71D, 0xD73C,
- 0x26D3, 0x36F2, 0x0691, 0x16B0, 0x6657, 0x7676, 0x4615, 0x5634,
- 0xD94C, 0xC96D, 0xF90E, 0xE92F, 0x99C8, 0x89E9, 0xB98A, 0xA9AB,
- 0x5844, 0x4865, 0x7806, 0x6827, 0x18C0, 0x08E1, 0x3882, 0x28A3,
- 0xCB7D, 0xDB5C, 0xEB3F, 0xFB1E, 0x8BF9, 0x9BD8, 0xABBB, 0xBB9A,
- 0x4A75, 0x5A54, 0x6A37, 0x7A16, 0x0AF1, 0x1AD0, 0x2AB3, 0x3A92,
- 0xFD2E, 0xED0F, 0xDD6C, 0xCD4D, 0xBDAA, 0xAD8B, 0x9DE8, 0x8DC9,
- 0x7C26, 0x6C07, 0x5C64, 0x4C45, 0x3CA2, 0x2C83, 0x1CE0, 0x0CC1,
- 0xEF1F, 0xFF3E, 0xCF5D, 0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8,
- 0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0
-};
-
-static const uint8_t string_table[256] = {
- 0x00, 0xD5, 0x7F, 0xAA, 0xFE, 0x2B, 0x81, 0x54,
- 0x29, 0xFC, 0x56, 0x83, 0xD7, 0x02, 0xA8, 0x7D,
- 0x52, 0x87, 0x2D, 0xF8, 0xAC, 0x79, 0xD3, 0x06,
- 0x7B, 0xAE, 0x04, 0xD1, 0x85, 0x50, 0xFA, 0x2F,
- 0xA4, 0x71, 0xDB, 0x0E, 0x5A, 0x8F, 0x25, 0xF0,
- 0x8D, 0x58, 0xF2, 0x27, 0x73, 0xA6, 0x0C, 0xD9,
- 0xF6, 0x23, 0x89, 0x5C, 0x08, 0xDD, 0x77, 0xA2,
- 0xDF, 0x0A, 0xA0, 0x75, 0x21, 0xF4, 0x5E, 0x8B,
- 0x9D, 0x48, 0xE2, 0x37, 0x63, 0xB6, 0x1C, 0xC9,
- 0xB4, 0x61, 0xCB, 0x1E, 0x4A, 0x9F, 0x35, 0xE0,
- 0xCF, 0x1A, 0xB0, 0x65, 0x31, 0xE4, 0x4E, 0x9B,
- 0xE6, 0x33, 0x99, 0x4C, 0x18, 0xCD, 0x67, 0xB2,
- 0x39, 0xEC, 0x46, 0x93, 0xC7, 0x12, 0xB8, 0x6D,
- 0x10, 0xC5, 0x6F, 0xBA, 0xEE, 0x3B, 0x91, 0x44,
- 0x6B, 0xBE, 0x14, 0xC1, 0x95, 0x40, 0xEA, 0x3F,
- 0x42, 0x97, 0x3D, 0xE8, 0xBC, 0x69, 0xC3, 0x16,
- 0xEF, 0x3A, 0x90, 0x45, 0x11, 0xC4, 0x6E, 0xBB,
- 0xC6, 0x13, 0xB9, 0x6C, 0x38, 0xED, 0x47, 0x92,
- 0xBD, 0x68, 0xC2, 0x17, 0x43, 0x96, 0x3C, 0xE9,
- 0x94, 0x41, 0xEB, 0x3E, 0x6A, 0xBF, 0x15, 0xC0,
- 0x4B, 0x9E, 0x34, 0xE1, 0xB5, 0x60, 0xCA, 0x1F,
- 0x62, 0xB7, 0x1D, 0xC8, 0x9C, 0x49, 0xE3, 0x36,
- 0x19, 0xCC, 0x66, 0xB3, 0xE7, 0x32, 0x98, 0x4D,
- 0x30, 0xE5, 0x4F, 0x9A, 0xCE, 0x1B, 0xB1, 0x64,
- 0x72, 0xA7, 0x0D, 0xD8, 0x8C, 0x59, 0xF3, 0x26,
- 0x5B, 0x8E, 0x24, 0xF1, 0xA5, 0x70, 0xDA, 0x0F,
- 0x20, 0xF5, 0x5F, 0x8A, 0xDE, 0x0B, 0xA1, 0x74,
- 0x09, 0xDC, 0x76, 0xA3, 0xF7, 0x22, 0x88, 0x5D,
- 0xD6, 0x03, 0xA9, 0x7C, 0x28, 0xFD, 0x57, 0x82,
- 0xFF, 0x2A, 0x80, 0x55, 0x01, 0xD4, 0x7E, 0xAB,
- 0x84, 0x51, 0xFB, 0x2E, 0x7A, 0xAF, 0x05, 0xD0,
- 0xAD, 0x78, 0xD2, 0x07, 0x53, 0x86, 0x2C, 0xF9
-};
-
-#define SVQ1_PROCESS_VECTOR()\
- for (; level > 0; i++) {\
- /* process next depth */\
- if (i == m) {\
- m = n;\
- if (--level == 0)\
- break;\
- }\
- /* divide block if next bit set */\
- if (get_bits (bitbuf, 1) == 0)\
- break;\
- /* add child nodes */\
- list[n++] = list[i];\
- list[n++] = list[i] + (((level & 1) ? pitch : 1) << ((level / 2) + 1));\
- }
-
-#define SVQ1_ADD_CODEBOOK()\
- /* add codebook entries to vector */\
- for (j=0; j < stages; j++) {\
- n3 = codebook[entries[j]] ^ 0x80808080;\
- n1 += ((n3 & 0xFF00FF00) >> 8);\
- n2 += (n3 & 0x00FF00FF);\
- }\
-\
- /* clip to [0..255] */\
- if (n1 & 0xFF00FF00) {\
- n3 = ((( n1 >> 15) & 0x00010001) | 0x01000100) - 0x00010001;\
- n1 += 0x7F007F00;\
- n1 |= (((~n1 >> 15) & 0x00010001) | 0x01000100) - 0x00010001;\
- n1 &= (n3 & 0x00FF00FF);\
- }\
-\
- if (n2 & 0xFF00FF00) {\
- n3 = ((( n2 >> 15) & 0x00010001) | 0x01000100) - 0x00010001;\
- n2 += 0x7F007F00;\
- n2 |= (((~n2 >> 15) & 0x00010001) | 0x01000100) - 0x00010001;\
- n2 &= (n3 & 0x00FF00FF);\
- }
-
-#define SVQ1_DO_CODEBOOK_INTRA()\
- for (y=0; y < height; y++) {\
- for (x=0; x < (width / 4); x++, codebook++) {\
- n1 = n4;\
- n2 = n4;\
- SVQ1_ADD_CODEBOOK()\
- /* store result */\
- dst[x] = (n1 << 8) | n2;\
- }\
- dst += (pitch / 4);\
- }
-
-#define SVQ1_DO_CODEBOOK_NONINTRA()\
- for (y=0; y < height; y++) {\
- for (x=0; x < (width / 4); x++, codebook++) {\
- n3 = dst[x];\
- /* add mean value to vector */\
- n1 = ((n3 & 0xFF00FF00) >> 8) + n4;\
- n2 = (n3 & 0x00FF00FF) + n4;\
- SVQ1_ADD_CODEBOOK()\
- /* store result */\
- dst[x] = (n1 << 8) | n2;\
- }\
- dst += (pitch / 4);\
- }
-
-#define SVQ1_CALC_CODEBOOK_ENTRIES(cbook)\
- codebook = (const uint32_t *) cbook[level];\
- bit_cache = get_bits (bitbuf, 4*stages);\
- /* calculate codebook entries for this vector */\
- for (j=0; j < stages; j++) {\
- entries[j] = (((bit_cache >> (4*(stages - j - 1))) & 0xF) + 16*j) << (level + 1);\
- }\
- mean -= (stages * 128);\
- n4 = ((mean + (mean >> 31)) << 16) | (mean & 0xFFFF);
-
-static int svq1_decode_block_intra (GetBitContext *bitbuf, uint8_t *pixels, int pitch ) {
- uint32_t bit_cache;
- uint8_t *list[63];
- uint32_t *dst;
- const uint32_t *codebook;
- int entries[6];
- int i, j, m, n;
- int mean, stages;
- unsigned x, y, width, height, level;
- uint32_t n1, n2, n3, n4;
-
- /* initialize list for breadth first processing of vectors */
- list[0] = pixels;
-
- /* recursively process vector */
- for (i=0, m=1, n=1, level=5; i < n; i++) {
- SVQ1_PROCESS_VECTOR();
-
- /* destination address and vector size */
- dst = (uint32_t *) list[i];
- width = 1 << ((4 + level) /2);
- height = 1 << ((3 + level) /2);
-
- /* get number of stages (-1 skips vector, 0 for mean only) */
- stages = get_vlc2(bitbuf, svq1_intra_multistage[level].table, 3, 3) - 1;
-
- if (stages == -1) {
- for (y=0; y < height; y++) {
- memset (&dst[y*(pitch / 4)], 0, width);
- }
- continue; /* skip vector */
- }
-
- if ((stages > 0) && (level >= 4)) {
-#ifdef DEBUG_SVQ1
- av_log(s->avctx, AV_LOG_INFO, "Error (svq1_decode_block_intra): invalid vector: stages=%i level=%i\n",stages,level);
-#endif
- return -1; /* invalid vector */
- }
-
- mean = get_vlc2(bitbuf, svq1_intra_mean.table, 8, 3);
-
- if (stages == 0) {
- for (y=0; y < height; y++) {
- memset (&dst[y*(pitch / 4)], mean, width);
- }
- } else {
- SVQ1_CALC_CODEBOOK_ENTRIES(svq1_intra_codebooks);
- SVQ1_DO_CODEBOOK_INTRA()
- }
- }
-
- return 0;
-}
-
-static int svq1_decode_block_non_intra (GetBitContext *bitbuf, uint8_t *pixels, int pitch ) {
- uint32_t bit_cache;
- uint8_t *list[63];
- uint32_t *dst;
- const uint32_t *codebook;
- int entries[6];
- int i, j, m, n;
- int mean, stages;
- int x, y, width, height, level;
- uint32_t n1, n2, n3, n4;
-
- /* initialize list for breadth first processing of vectors */
- list[0] = pixels;
-
- /* recursively process vector */
- for (i=0, m=1, n=1, level=5; i < n; i++) {
- SVQ1_PROCESS_VECTOR();
-
- /* destination address and vector size */
- dst = (uint32_t *) list[i];
- width = 1 << ((4 + level) /2);
- height = 1 << ((3 + level) /2);
-
- /* get number of stages (-1 skips vector, 0 for mean only) */
- stages = get_vlc2(bitbuf, svq1_inter_multistage[level].table, 3, 2) - 1;
-
- if (stages == -1) continue; /* skip vector */
-
- if ((stages > 0) && (level >= 4)) {
-#ifdef DEBUG_SVQ1
- av_log(s->avctx, AV_LOG_INFO, "Error (svq1_decode_block_non_intra): invalid vector: stages=%i level=%i\n",stages,level);
-#endif
- return -1; /* invalid vector */
- }
-
- mean = get_vlc2(bitbuf, svq1_inter_mean.table, 9, 3) - 256;
-
- SVQ1_CALC_CODEBOOK_ENTRIES(svq1_inter_codebooks);
- SVQ1_DO_CODEBOOK_NONINTRA()
- }
- return 0;
-}
-
-static int svq1_decode_motion_vector (GetBitContext *bitbuf, svq1_pmv_t *mv, svq1_pmv_t **pmv) {
- int diff;
- int i;
-
- for (i=0; i < 2; i++) {
-
- /* get motion code */
- diff = get_vlc2(bitbuf, svq1_motion_component.table, 7, 2);
- if(diff<0)
- return -1;
- else if(diff){
- if(get_bits1(bitbuf)) diff= -diff;
- }
-
- /* add median of motion vector predictors and clip result */
- if (i == 1)
- mv->y = ((diff + mid_pred(pmv[0]->y, pmv[1]->y, pmv[2]->y)) << 26) >> 26;
- else
- mv->x = ((diff + mid_pred(pmv[0]->x, pmv[1]->x, pmv[2]->x)) << 26) >> 26;
- }
-
- return 0;
-}
-
-static void svq1_skip_block (uint8_t *current, uint8_t *previous, int pitch, int x, int y) {
- uint8_t *src;
- uint8_t *dst;
- int i;
-
- src = &previous[x + y*pitch];
- dst = current;
-
- for (i=0; i < 16; i++) {
- memcpy (dst, src, 16);
- src += pitch;
- dst += pitch;
- }
-}
-
-static int svq1_motion_inter_block (MpegEncContext *s, GetBitContext *bitbuf,
- uint8_t *current, uint8_t *previous, int pitch,
- svq1_pmv_t *motion, int x, int y) {
- uint8_t *src;
- uint8_t *dst;
- svq1_pmv_t mv;
- svq1_pmv_t *pmv[3];
- int result;
-
- /* predict and decode motion vector */
- pmv[0] = &motion[0];
- if (y == 0) {
- pmv[1] =
- pmv[2] = pmv[0];
- }
- else {
- pmv[1] = &motion[(x / 8) + 2];
- pmv[2] = &motion[(x / 8) + 4];
- }
-
- result = svq1_decode_motion_vector (bitbuf, &mv, pmv);
-
- if (result != 0)
- return result;
-
- motion[0].x =
- motion[(x / 8) + 2].x =
- motion[(x / 8) + 3].x = mv.x;
- motion[0].y =
- motion[(x / 8) + 2].y =
- motion[(x / 8) + 3].y = mv.y;
-
- if(y + (mv.y >> 1)<0)
- mv.y= 0;
- if(x + (mv.x >> 1)<0)
- mv.x= 0;
-
-#if 0
- int w= (s->width+15)&~15;
- int h= (s->height+15)&~15;
- if(x + (mv.x >> 1)<0 || y + (mv.y >> 1)<0 || x + (mv.x >> 1) + 16 > w || y + (mv.y >> 1) + 16> h)
- av_log(s->avctx, AV_LOG_INFO, "%d %d %d %d\n", x, y, x + (mv.x >> 1), y + (mv.y >> 1));
-#endif
-
- src = &previous[(x + (mv.x >> 1)) + (y + (mv.y >> 1))*pitch];
- dst = current;
-
- s->dsp.put_pixels_tab[0][((mv.y & 1) << 1) | (mv.x & 1)](dst,src,pitch,16);
-
- return 0;
-}
-
-static int svq1_motion_inter_4v_block (MpegEncContext *s, GetBitContext *bitbuf,
- uint8_t *current, uint8_t *previous, int pitch,
- svq1_pmv_t *motion,int x, int y) {
- uint8_t *src;
- uint8_t *dst;
- svq1_pmv_t mv;
- svq1_pmv_t *pmv[4];
- int i, result;
-
- /* predict and decode motion vector (0) */
- pmv[0] = &motion[0];
- if (y == 0) {
- pmv[1] =
- pmv[2] = pmv[0];
- }
- else {
- pmv[1] = &motion[(x / 8) + 2];
- pmv[2] = &motion[(x / 8) + 4];
- }
-
- result = svq1_decode_motion_vector (bitbuf, &mv, pmv);
-
- if (result != 0)
- return result;
-
- /* predict and decode motion vector (1) */
- pmv[0] = &mv;
- if (y == 0) {
- pmv[1] =
- pmv[2] = pmv[0];
- }
- else {
- pmv[1] = &motion[(x / 8) + 3];
- }
- result = svq1_decode_motion_vector (bitbuf, &motion[0], pmv);
-
- if (result != 0)
- return result;
-
- /* predict and decode motion vector (2) */
- pmv[1] = &motion[0];
- pmv[2] = &motion[(x / 8) + 1];
-
- result = svq1_decode_motion_vector (bitbuf, &motion[(x / 8) + 2], pmv);
-
- if (result != 0)
- return result;
-
- /* predict and decode motion vector (3) */
- pmv[2] = &motion[(x / 8) + 2];
- pmv[3] = &motion[(x / 8) + 3];
-
- result = svq1_decode_motion_vector (bitbuf, pmv[3], pmv);
-
- if (result != 0)
- return result;
-
- /* form predictions */
- for (i=0; i < 4; i++) {
- int mvx= pmv[i]->x + (i&1)*16;
- int mvy= pmv[i]->y + (i>>1)*16;
-
- ///XXX /FIXME cliping or padding?
- if(y + (mvy >> 1)<0)
- mvy= 0;
- if(x + (mvx >> 1)<0)
- mvx= 0;
-
-#if 0
- int w= (s->width+15)&~15;
- int h= (s->height+15)&~15;
- if(x + (mvx >> 1)<0 || y + (mvy >> 1)<0 || x + (mvx >> 1) + 8 > w || y + (mvy >> 1) + 8> h)
- av_log(s->avctx, AV_LOG_INFO, "%d %d %d %d\n", x, y, x + (mvx >> 1), y + (mvy >> 1));
-#endif
- src = &previous[(x + (mvx >> 1)) + (y + (mvy >> 1))*pitch];
- dst = current;
-
- s->dsp.put_pixels_tab[1][((mvy & 1) << 1) | (mvx & 1)](dst,src,pitch,8);
-
- /* select next block */
- if (i & 1) {
- current += 8*(pitch - 1);
- } else {
- current += 8;
- }
- }
-
- return 0;
-}
-
-static int svq1_decode_delta_block (MpegEncContext *s, GetBitContext *bitbuf,
- uint8_t *current, uint8_t *previous, int pitch,
- svq1_pmv_t *motion, int x, int y) {
- uint32_t block_type;
- int result = 0;
-
- /* get block type */
- block_type = get_vlc2(bitbuf, svq1_block_type.table, 2, 2);
-
- /* reset motion vectors */
- if (block_type == SVQ1_BLOCK_SKIP || block_type == SVQ1_BLOCK_INTRA) {
- motion[0].x =
- motion[0].y =
- motion[(x / 8) + 2].x =
- motion[(x / 8) + 2].y =
- motion[(x / 8) + 3].x =
- motion[(x / 8) + 3].y = 0;
- }
-
- switch (block_type) {
- case SVQ1_BLOCK_SKIP:
- svq1_skip_block (current, previous, pitch, x, y);
- break;
-
- case SVQ1_BLOCK_INTER:
- result = svq1_motion_inter_block (s, bitbuf, current, previous, pitch, motion, x, y);
-
- if (result != 0)
- {
-#ifdef DEBUG_SVQ1
- av_log(s->avctx, AV_LOG_INFO, "Error in svq1_motion_inter_block %i\n",result);
-#endif
- break;
- }
- result = svq1_decode_block_non_intra (bitbuf, current, pitch);
- break;
-
- case SVQ1_BLOCK_INTER_4V:
- result = svq1_motion_inter_4v_block (s, bitbuf, current, previous, pitch, motion, x, y);
-
- if (result != 0)
- {
-#ifdef DEBUG_SVQ1
- av_log(s->avctx, AV_LOG_INFO, "Error in svq1_motion_inter_4v_block %i\n",result);
-#endif
- break;
- }
- result = svq1_decode_block_non_intra (bitbuf, current, pitch);
- break;
-
- case SVQ1_BLOCK_INTRA:
- result = svq1_decode_block_intra (bitbuf, current, pitch);
- break;
- }
-
- return result;
-}
-
-/* standard video sizes */
-static struct { int width; int height; } svq1_frame_size_table[8] = {
- { 160, 120 }, { 128, 96 }, { 176, 144 }, { 352, 288 },
- { 704, 576 }, { 240, 180 }, { 320, 240 }, { -1, -1 }
-};
-
-static uint16_t svq1_packet_checksum (uint8_t *data, int length, int value) {
- int i;
-
- for (i=0; i < length; i++) {
- value = checksum_table[data[i] ^ (value >> 8)] ^ ((value & 0xFF) << 8);
- }
-
- return value;
-}
-
-#if 0 /* unused, remove? */
-static uint16_t svq1_component_checksum (uint16_t *pixels, int pitch,
- int width, int height, int value) {
- int x, y;
-
- for (y=0; y < height; y++) {
- for (x=0; x < width; x++) {
- value = checksum_table[pixels[x] ^ (value >> 8)] ^ ((value & 0xFF) << 8);
- }
-
- pixels += pitch;
- }
-
- return value;
-}
-#endif
-
-#ifdef CONFIG_DECODERS
-static void svq1_parse_string (GetBitContext *bitbuf, uint8_t *out) {
- uint8_t seed;
- int i;
-
- out[0] = get_bits (bitbuf, 8);
-
- seed = string_table[out[0]];
-
- for (i=1; i <= out[0]; i++) {
- out[i] = get_bits (bitbuf, 8) ^ seed;
- seed = string_table[out[i] ^ seed];
- }
-}
-
-static int svq1_decode_frame_header (GetBitContext *bitbuf,MpegEncContext *s) {
- int frame_size_code;
- int temporal_reference;
-
- temporal_reference = get_bits (bitbuf, 8);
-
- /* frame type */
- s->pict_type= get_bits (bitbuf, 2)+1;
- if(s->pict_type==4)
- return -1;
-
- if (s->pict_type == I_TYPE) {
-
- /* unknown fields */
- if (s->f_code == 0x50 || s->f_code == 0x60) {
- int csum = get_bits (bitbuf, 16);
-
- csum = svq1_packet_checksum ((uint8_t *)bitbuf->buffer, bitbuf->size_in_bits>>3, csum);
-
-// av_log(s->avctx, AV_LOG_INFO, "%s checksum (%02x) for packet data\n",
-// (csum == 0) ? "correct" : "incorrect", csum);
- }
-
- if ((s->f_code ^ 0x10) >= 0x50) {
- uint8_t msg[256];
-
- svq1_parse_string (bitbuf, msg);
-
- av_log(s->avctx, AV_LOG_INFO, "embedded message: \"%s\"\n", (char *) msg);
- }
-
- skip_bits (bitbuf, 2);
- skip_bits (bitbuf, 2);
- skip_bits1 (bitbuf);
-
- /* load frame size */
- frame_size_code = get_bits (bitbuf, 3);
-
- if (frame_size_code == 7) {
- /* load width, height (12 bits each) */
- s->width = get_bits (bitbuf, 12);
- s->height = get_bits (bitbuf, 12);
-
- if (!s->width || !s->height)
- return -1;
- } else {
- /* get width, height from table */
- s->width = svq1_frame_size_table[frame_size_code].width;
- s->height = svq1_frame_size_table[frame_size_code].height;
- }
- }
-
- /* unknown fields */
- if (get_bits (bitbuf, 1) == 1) {
- skip_bits1 (bitbuf); /* use packet checksum if (1) */
- skip_bits1 (bitbuf); /* component checksums after image data if (1) */
-
- if (get_bits (bitbuf, 2) != 0)
- return -1;
- }
-
- if (get_bits (bitbuf, 1) == 1) {
- skip_bits1 (bitbuf);
- skip_bits (bitbuf, 4);
- skip_bits1 (bitbuf);
- skip_bits (bitbuf, 2);
-
- while (get_bits (bitbuf, 1) == 1) {
- skip_bits (bitbuf, 8);
- }
- }
-
- return 0;
-}
-
-static int svq1_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- MpegEncContext *s=avctx->priv_data;
- uint8_t *current, *previous;
- int result, i, x, y, width, height;
- AVFrame *pict = data;
-
- /* initialize bit buffer */
- init_get_bits(&s->gb,buf,buf_size*8);
-
- /* decode frame header */
- s->f_code = get_bits (&s->gb, 22);
-
- if ((s->f_code & ~0x70) || !(s->f_code & 0x60))
- return -1;
-
- /* swap some header bytes (why?) */
- if (s->f_code != 0x20) {
- uint32_t *src = (uint32_t *) (buf + 4);
-
- for (i=0; i < 4; i++) {
- src[i] = ((src[i] << 16) | (src[i] >> 16)) ^ src[7 - i];
- }
- }
-
- result = svq1_decode_frame_header (&s->gb, s);
-
- if (result != 0)
- {
-#ifdef DEBUG_SVQ1
- av_log(s->avctx, AV_LOG_INFO, "Error in svq1_decode_frame_header %i\n",result);
-#endif
- return result;
- }
-
- //FIXME this avoids some confusion for "B frames" without 2 references
- //this should be removed after libavcodec can handle more flexible picture types & ordering
- if(s->pict_type==B_TYPE && s->last_picture_ptr==NULL) return buf_size;
-
- if(avctx->hurry_up && s->pict_type==B_TYPE) return buf_size;
- if( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==B_TYPE)
- ||(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=I_TYPE)
- || avctx->skip_frame >= AVDISCARD_ALL)
- return buf_size;
-
- if(MPV_frame_start(s, avctx) < 0)
- return -1;
-
- /* decode y, u and v components */
- for (i=0; i < 3; i++) {
- int linesize;
- if (i == 0) {
- width = (s->width+15)&~15;
- height = (s->height+15)&~15;
- linesize= s->linesize;
- } else {
- if(s->flags&CODEC_FLAG_GRAY) break;
- width = (s->width/4+15)&~15;
- height = (s->height/4+15)&~15;
- linesize= s->uvlinesize;
- }
-
- current = s->current_picture.data[i];
-
- if(s->pict_type==B_TYPE){
- previous = s->next_picture.data[i];
- }else{
- previous = s->last_picture.data[i];
- }
-
- if (s->pict_type == I_TYPE) {
- /* keyframe */
- for (y=0; y < height; y+=16) {
- for (x=0; x < width; x+=16) {
- result = svq1_decode_block_intra (&s->gb, &current[x], linesize);
- if (result != 0)
- {
-//#ifdef DEBUG_SVQ1
- av_log(s->avctx, AV_LOG_INFO, "Error in svq1_decode_block %i (keyframe)\n",result);
-//#endif
- return result;
- }
- }
- current += 16*linesize;
- }
- } else {
- svq1_pmv_t pmv[width/8+3];
- /* delta frame */
- memset (pmv, 0, ((width / 8) + 3) * sizeof(svq1_pmv_t));
-
- for (y=0; y < height; y+=16) {
- for (x=0; x < width; x+=16) {
- result = svq1_decode_delta_block (s, &s->gb, &current[x], previous,
- linesize, pmv, x, y);
- if (result != 0)
- {
-#ifdef DEBUG_SVQ1
- av_log(s->avctx, AV_LOG_INFO, "Error in svq1_decode_delta_block %i\n",result);
-#endif
- return result;
- }
- }
-
- pmv[0].x =
- pmv[0].y = 0;
-
- current += 16*linesize;
- }
- }
- }
-
- *pict = *(AVFrame*)&s->current_picture;
-
-
- MPV_frame_end(s);
-
- *data_size=sizeof(AVFrame);
- return buf_size;
-}
-
-static int svq1_decode_init(AVCodecContext *avctx)
-{
- MpegEncContext *s = avctx->priv_data;
- int i;
-
- MPV_decode_defaults(s);
-
- s->avctx = avctx;
- s->width = (avctx->width+3)&~3;
- s->height = (avctx->height+3)&~3;
- s->codec_id= avctx->codec->id;
- avctx->pix_fmt = PIX_FMT_YUV410P;
- avctx->has_b_frames= 1; // not true, but DP frames and these behave like unidirectional b frames
- s->flags= avctx->flags;
- if (MPV_common_init(s) < 0) return -1;
-
- init_vlc(&svq1_block_type, 2, 4,
- &svq1_block_type_vlc[0][1], 2, 1,
- &svq1_block_type_vlc[0][0], 2, 1, 1);
-
- init_vlc(&svq1_motion_component, 7, 33,
- &mvtab[0][1], 2, 1,
- &mvtab[0][0], 2, 1, 1);
-
- for (i = 0; i < 6; i++) {
- init_vlc(&svq1_intra_multistage[i], 3, 8,
- &svq1_intra_multistage_vlc[i][0][1], 2, 1,
- &svq1_intra_multistage_vlc[i][0][0], 2, 1, 1);
- init_vlc(&svq1_inter_multistage[i], 3, 8,
- &svq1_inter_multistage_vlc[i][0][1], 2, 1,
- &svq1_inter_multistage_vlc[i][0][0], 2, 1, 1);
- }
-
- init_vlc(&svq1_intra_mean, 8, 256,
- &svq1_intra_mean_vlc[0][1], 4, 2,
- &svq1_intra_mean_vlc[0][0], 4, 2, 1);
-
- init_vlc(&svq1_inter_mean, 9, 512,
- &svq1_inter_mean_vlc[0][1], 4, 2,
- &svq1_inter_mean_vlc[0][0], 4, 2, 1);
-
- return 0;
-}
-
-static int svq1_decode_end(AVCodecContext *avctx)
-{
- MpegEncContext *s = avctx->priv_data;
-
- MPV_common_end(s);
- return 0;
-}
-#endif /* CONFIG_DECODERS */
-
-#ifdef CONFIG_ENCODERS
-static void svq1_write_header(SVQ1Context *s, int frame_type)
-{
- int i;
-
- /* frame code */
- put_bits(&s->pb, 22, 0x20);
-
- /* temporal reference (sure hope this is a "don't care") */
- put_bits(&s->pb, 8, 0x00);
-
- /* frame type */
- put_bits(&s->pb, 2, frame_type - 1);
-
- if (frame_type == I_TYPE) {
-
- /* no checksum since frame code is 0x20 */
-
- /* no embedded string either */
-
- /* output 5 unknown bits (2 + 2 + 1) */
- put_bits(&s->pb, 5, 2); /* 2 needed by quicktime decoder */
-
- for (i = 0; i < 7; i++)
- {
- if ((svq1_frame_size_table[i].width == s->frame_width) &&
- (svq1_frame_size_table[i].height == s->frame_height))
- {
- put_bits(&s->pb, 3, i);
- break;
- }
- }
-
- if (i == 7)
- {
- put_bits(&s->pb, 3, 7);
- put_bits(&s->pb, 12, s->frame_width);
- put_bits(&s->pb, 12, s->frame_height);
- }
- }
-
- /* no checksum or extra data (next 2 bits get 0) */
- put_bits(&s->pb, 2, 0);
-}
-
-
-#define QUALITY_THRESHOLD 100
-#define THRESHOLD_MULTIPLIER 0.6
-
-#if defined(HAVE_ALTIVEC)
-#undef vector
-#endif
-
-static int encode_block(SVQ1Context *s, uint8_t *src, uint8_t *ref, uint8_t *decoded, int stride, int level, int threshold, int lambda, int intra){
- int count, y, x, i, j, split, best_mean, best_score, best_count;
- int best_vector[6];
- int block_sum[7]= {0, 0, 0, 0, 0, 0};
- int w= 2<<((level+2)>>1);
- int h= 2<<((level+1)>>1);
- int size=w*h;
- int16_t block[7][256];
- const int8_t *codebook_sum, *codebook;
- const uint16_t (*mean_vlc)[2];
- const uint8_t (*multistage_vlc)[2];
-
- best_score=0;
- //FIXME optimize, this doenst need to be done multiple times
- if(intra){
- codebook_sum= svq1_intra_codebook_sum[level];
- codebook= svq1_intra_codebooks[level];
- mean_vlc= svq1_intra_mean_vlc;
- multistage_vlc= svq1_intra_multistage_vlc[level];
- for(y=0; y<h; y++){
- for(x=0; x<w; x++){
- int v= src[x + y*stride];
- block[0][x + w*y]= v;
- best_score += v*v;
- block_sum[0] += v;
- }
- }
- }else{
- codebook_sum= svq1_inter_codebook_sum[level];
- codebook= svq1_inter_codebooks[level];
- mean_vlc= svq1_inter_mean_vlc + 256;
- multistage_vlc= svq1_inter_multistage_vlc[level];
- for(y=0; y<h; y++){
- for(x=0; x<w; x++){
- int v= src[x + y*stride] - ref[x + y*stride];
- block[0][x + w*y]= v;
- best_score += v*v;
- block_sum[0] += v;
- }
- }
- }
-
- best_count=0;
- best_score -= ((block_sum[0]*block_sum[0])>>(level+3));
- best_mean= (block_sum[0] + (size>>1)) >> (level+3);
-
- if(level<4){
- for(count=1; count<7; count++){
- int best_vector_score= INT_MAX;
- int best_vector_sum=-999, best_vector_mean=-999;
- const int stage= count-1;
- const int8_t *vector;
-
- for(i=0; i<16; i++){
- int sum= codebook_sum[stage*16 + i];
- int sqr=0;
- int diff, mean, score;
-
- vector = codebook + stage*size*16 + i*size;
-
- for(j=0; j<size; j++){
- int v= vector[j];
- sqr += (v - block[stage][j])*(v - block[stage][j]);
- }
- diff= block_sum[stage] - sum;
- mean= (diff + (size>>1)) >> (level+3);
- assert(mean >-300 && mean<300);
- if(intra) mean= clip(mean, 0, 255);
- else mean= clip(mean, -256, 255);
- score= sqr - ((diff*(int64_t)diff)>>(level+3)); //FIXME 64bit slooow
- if(score < best_vector_score){
- best_vector_score= score;
- best_vector[stage]= i;
- best_vector_sum= sum;
- best_vector_mean= mean;
- }
- }
- assert(best_vector_mean != -999);
- vector= codebook + stage*size*16 + best_vector[stage]*size;
- for(j=0; j<size; j++){
- block[stage+1][j] = block[stage][j] - vector[j];
- }
- block_sum[stage+1]= block_sum[stage] - best_vector_sum;
- best_vector_score +=
- lambda*(+ 1 + 4*count
- + multistage_vlc[1+count][1]
- + mean_vlc[best_vector_mean][1]);
-
- if(best_vector_score < best_score){
- best_score= best_vector_score;
- best_count= count;
- best_mean= best_vector_mean;
- }
- }
- }
-
- split=0;
- if(best_score > threshold && level){
- int score=0;
- int offset= (level&1) ? stride*h/2 : w/2;
- PutBitContext backup[6];
-
- for(i=level-1; i>=0; i--){
- backup[i]= s->reorder_pb[i];
- }
- score += encode_block(s, src , ref , decoded , stride, level-1, threshold>>1, lambda, intra);
- score += encode_block(s, src + offset, ref + offset, decoded + offset, stride, level-1, threshold>>1, lambda, intra);
- score += lambda;
-
- if(score < best_score){
- best_score= score;
- split=1;
- }else{
- for(i=level-1; i>=0; i--){
- s->reorder_pb[i]= backup[i];
- }
- }
- }
- if (level > 0)
- put_bits(&s->reorder_pb[level], 1, split);
-
- if(!split){
- assert((best_mean >= 0 && best_mean<256) || !intra);
- assert(best_mean >= -256 && best_mean<256);
- assert(best_count >=0 && best_count<7);
- assert(level<4 || best_count==0);
-
- /* output the encoding */
- put_bits(&s->reorder_pb[level],
- multistage_vlc[1 + best_count][1],
- multistage_vlc[1 + best_count][0]);
- put_bits(&s->reorder_pb[level], mean_vlc[best_mean][1],
- mean_vlc[best_mean][0]);
-
- for (i = 0; i < best_count; i++){
- assert(best_vector[i]>=0 && best_vector[i]<16);
- put_bits(&s->reorder_pb[level], 4, best_vector[i]);
- }
-
- for(y=0; y<h; y++){
- for(x=0; x<w; x++){
- decoded[x + y*stride]= src[x + y*stride] - block[best_count][x + w*y] + best_mean;
- }
- }
- }
-
- return best_score;
-}
-
-
-static int svq1_encode_plane(SVQ1Context *s, int plane, unsigned char *src_plane, unsigned char *ref_plane, unsigned char *decoded_plane,
- int width, int height, int src_stride, int stride)
-{
- int x, y;
- int i;
- int block_width, block_height;
- int level;
- int threshold[6];
- const int lambda= (s->picture.quality*s->picture.quality) >> (2*FF_LAMBDA_SHIFT);
-
- /* figure out the acceptable level thresholds in advance */
- threshold[5] = QUALITY_THRESHOLD;
- for (level = 4; level >= 0; level--)
- threshold[level] = threshold[level + 1] * THRESHOLD_MULTIPLIER;
-
- block_width = (width + 15) / 16;
- block_height = (height + 15) / 16;
-
- if(s->picture.pict_type == P_TYPE){
- s->m.avctx= s->avctx;
- s->m.current_picture_ptr= &s->m.current_picture;
- s->m.last_picture_ptr = &s->m.last_picture;
- s->m.last_picture.data[0]= ref_plane;
- s->m.linesize=
- s->m.last_picture.linesize[0]=
- s->m.new_picture.linesize[0]=
- s->m.current_picture.linesize[0]= stride;
- s->m.width= width;
- s->m.height= height;
- s->m.mb_width= block_width;
- s->m.mb_height= block_height;
- s->m.mb_stride= s->m.mb_width+1;
- s->m.b8_stride= 2*s->m.mb_width+1;
- s->m.f_code=1;
- s->m.pict_type= s->picture.pict_type;
- s->m.me_method= s->avctx->me_method;
- s->m.me.scene_change_score=0;
- s->m.flags= s->avctx->flags;
-// s->m.out_format = FMT_H263;
-// s->m.unrestricted_mv= 1;
-
- s->m.lambda= s->picture.quality;
- s->m.qscale= (s->m.lambda*139 + FF_LAMBDA_SCALE*64) >> (FF_LAMBDA_SHIFT + 7);
- s->m.lambda2= (s->m.lambda*s->m.lambda + FF_LAMBDA_SCALE/2) >> FF_LAMBDA_SHIFT;
-
- if(!s->motion_val8[plane]){
- s->motion_val8 [plane]= av_mallocz((s->m.b8_stride*block_height*2 + 2)*2*sizeof(int16_t));
- s->motion_val16[plane]= av_mallocz((s->m.mb_stride*(block_height + 2) + 1)*2*sizeof(int16_t));
- }
-
- s->m.mb_type= s->mb_type;
-
- //dummies, to avoid segfaults
- s->m.current_picture.mb_mean= (uint8_t *)s->dummy;
- s->m.current_picture.mb_var= (uint16_t*)s->dummy;
- s->m.current_picture.mc_mb_var= (uint16_t*)s->dummy;
- s->m.current_picture.mb_type= s->dummy;
-
- s->m.current_picture.motion_val[0]= s->motion_val8[plane] + 2;
- s->m.p_mv_table= s->motion_val16[plane] + s->m.mb_stride + 1;
- s->m.dsp= s->dsp; //move
- ff_init_me(&s->m);
-
- s->m.me.dia_size= s->avctx->dia_size;
- s->m.first_slice_line=1;
- for (y = 0; y < block_height; y++) {
- uint8_t src[stride*16];
-
- s->m.new_picture.data[0]= src - y*16*stride; //ugly
- s->m.mb_y= y;
-
- for(i=0; i<16 && i + 16*y<height; i++){
- memcpy(&src[i*stride], &src_plane[(i+16*y)*src_stride], width);
- for(x=width; x<16*block_width; x++)
- src[i*stride+x]= src[i*stride+x-1];
- }
- for(; i<16 && i + 16*y<16*block_height; i++)
- memcpy(&src[i*stride], &src[(i-1)*stride], 16*block_width);
-
- for (x = 0; x < block_width; x++) {
- s->m.mb_x= x;
- ff_init_block_index(&s->m);
- ff_update_block_index(&s->m);
-
- ff_estimate_p_frame_motion(&s->m, x, y);
- }
- s->m.first_slice_line=0;
- }
-
- ff_fix_long_p_mvs(&s->m);
- ff_fix_long_mvs(&s->m, NULL, 0, s->m.p_mv_table, s->m.f_code, CANDIDATE_MB_TYPE_INTER, 0);
- }
-
- s->m.first_slice_line=1;
- for (y = 0; y < block_height; y++) {
- uint8_t src[stride*16];
-
- for(i=0; i<16 && i + 16*y<height; i++){
- memcpy(&src[i*stride], &src_plane[(i+16*y)*src_stride], width);
- for(x=width; x<16*block_width; x++)
- src[i*stride+x]= src[i*stride+x-1];
- }
- for(; i<16 && i + 16*y<16*block_height; i++)
- memcpy(&src[i*stride], &src[(i-1)*stride], 16*block_width);
-
- s->m.mb_y= y;
- for (x = 0; x < block_width; x++) {
- uint8_t reorder_buffer[3][6][7*32];
- int count[3][6];
- int offset = y * 16 * stride + x * 16;
- uint8_t *decoded= decoded_plane + offset;
- uint8_t *ref= ref_plane + offset;
- int score[4]={0,0,0,0}, best;
- uint8_t temp[16*stride];
-
- if(s->pb.buf_end - s->pb.buf - (put_bits_count(&s->pb)>>3) < 3000){ //FIXME check size
- av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n");
- return -1;
- }
-
- s->m.mb_x= x;
- ff_init_block_index(&s->m);
- ff_update_block_index(&s->m);
-
- if(s->picture.pict_type == I_TYPE || (s->m.mb_type[x + y*s->m.mb_stride]&CANDIDATE_MB_TYPE_INTRA)){
- for(i=0; i<6; i++){
- init_put_bits(&s->reorder_pb[i], reorder_buffer[0][i], 7*32);
- }
- if(s->picture.pict_type == P_TYPE){
- const uint8_t *vlc= svq1_block_type_vlc[SVQ1_BLOCK_INTRA];
- put_bits(&s->reorder_pb[5], vlc[1], vlc[0]);
- score[0]= vlc[1]*lambda;
- }
- score[0]+= encode_block(s, src+16*x, NULL, temp, stride, 5, 64, lambda, 1);
- for(i=0; i<6; i++){
- count[0][i]= put_bits_count(&s->reorder_pb[i]);
- flush_put_bits(&s->reorder_pb[i]);
- }
- }else
- score[0]= INT_MAX;
-
- best=0;
-
- if(s->picture.pict_type == P_TYPE){
- const uint8_t *vlc= svq1_block_type_vlc[SVQ1_BLOCK_INTER];
- int mx, my, pred_x, pred_y, dxy;
- int16_t *motion_ptr;
-
- motion_ptr= h263_pred_motion(&s->m, 0, 0, &pred_x, &pred_y);
- if(s->m.mb_type[x + y*s->m.mb_stride]&CANDIDATE_MB_TYPE_INTER){
- for(i=0; i<6; i++)
- init_put_bits(&s->reorder_pb[i], reorder_buffer[1][i], 7*32);
-
- put_bits(&s->reorder_pb[5], vlc[1], vlc[0]);
-
- s->m.pb= s->reorder_pb[5];
- mx= motion_ptr[0];
- my= motion_ptr[1];
- assert(mx>=-32 && mx<=31);
- assert(my>=-32 && my<=31);
- assert(pred_x>=-32 && pred_x<=31);
- assert(pred_y>=-32 && pred_y<=31);
- ff_h263_encode_motion(&s->m, mx - pred_x, 1);
- ff_h263_encode_motion(&s->m, my - pred_y, 1);
- s->reorder_pb[5]= s->m.pb;
- score[1] += lambda*put_bits_count(&s->reorder_pb[5]);
-
- dxy= (mx&1) + 2*(my&1);
-
- s->dsp.put_pixels_tab[0][dxy](temp+16, ref + (mx>>1) + stride*(my>>1), stride, 16);
-
- score[1]+= encode_block(s, src+16*x, temp+16, decoded, stride, 5, 64, lambda, 0);
- best= score[1] <= score[0];
-
- vlc= svq1_block_type_vlc[SVQ1_BLOCK_SKIP];
- score[2]= s->dsp.sse[0](NULL, src+16*x, ref, stride, 16);
- score[2]+= vlc[1]*lambda;
- if(score[2] < score[best] && mx==0 && my==0){
- best=2;
- s->dsp.put_pixels_tab[0][0](decoded, ref, stride, 16);
- for(i=0; i<6; i++){
- count[2][i]=0;
- }
- put_bits(&s->pb, vlc[1], vlc[0]);
- }
- }
-
- if(best==1){
- for(i=0; i<6; i++){
- count[1][i]= put_bits_count(&s->reorder_pb[i]);
- flush_put_bits(&s->reorder_pb[i]);
- }
- }else{
- motion_ptr[0 ] = motion_ptr[1 ]=
- motion_ptr[2 ] = motion_ptr[3 ]=
- motion_ptr[0+2*s->m.b8_stride] = motion_ptr[1+2*s->m.b8_stride]=
- motion_ptr[2+2*s->m.b8_stride] = motion_ptr[3+2*s->m.b8_stride]=0;
- }
- }
-
- s->rd_total += score[best];
-
- for(i=5; i>=0; i--){
- ff_copy_bits(&s->pb, reorder_buffer[best][i], count[best][i]);
- }
- if(best==0){
- s->dsp.put_pixels_tab[0][0](decoded, temp, stride, 16);
- }
- }
- s->m.first_slice_line=0;
- }
- return 0;
-}
-
-static int svq1_encode_init(AVCodecContext *avctx)
-{
- SVQ1Context * const s = avctx->priv_data;
-
- dsputil_init(&s->dsp, avctx);
- avctx->coded_frame= (AVFrame*)&s->picture;
-
- s->frame_width = avctx->width;
- s->frame_height = avctx->height;
-
- s->y_block_width = (s->frame_width + 15) / 16;
- s->y_block_height = (s->frame_height + 15) / 16;
-
- s->c_block_width = (s->frame_width / 4 + 15) / 16;
- s->c_block_height = (s->frame_height / 4 + 15) / 16;
-
- s->avctx= avctx;
- s->m.avctx= avctx;
- s->m.me.scratchpad= av_mallocz((avctx->width+64)*2*16*2*sizeof(uint8_t));
- s->m.me.map = av_mallocz(ME_MAP_SIZE*sizeof(uint32_t));
- s->m.me.score_map = av_mallocz(ME_MAP_SIZE*sizeof(uint32_t));
- s->mb_type = av_mallocz((s->y_block_width+1)*s->y_block_height*sizeof(int16_t));
- s->dummy = av_mallocz((s->y_block_width+1)*s->y_block_height*sizeof(int32_t));
- h263_encode_init(&s->m); //mv_penalty
-
- return 0;
-}
-
-static int svq1_encode_frame(AVCodecContext *avctx, unsigned char *buf,
- int buf_size, void *data)
-{
- SVQ1Context * const s = avctx->priv_data;
- AVFrame *pict = data;
- AVFrame * const p= (AVFrame*)&s->picture;
- AVFrame temp;
- int i;
-
- if(avctx->pix_fmt != PIX_FMT_YUV410P){
- av_log(avctx, AV_LOG_ERROR, "unsupported pixel format\n");
- return -1;
- }
-
- if(!s->current_picture.data[0]){
- avctx->get_buffer(avctx, &s->current_picture);
- avctx->get_buffer(avctx, &s->last_picture);
- }
-
- temp= s->current_picture;
- s->current_picture= s->last_picture;
- s->last_picture= temp;
-
- init_put_bits(&s->pb, buf, buf_size);
-
- *p = *pict;
- p->pict_type = avctx->gop_size && avctx->frame_number % avctx->gop_size ? P_TYPE : I_TYPE;
- p->key_frame = p->pict_type == I_TYPE;
-
- svq1_write_header(s, p->pict_type);
- for(i=0; i<3; i++){
- if(svq1_encode_plane(s, i,
- s->picture.data[i], s->last_picture.data[i], s->current_picture.data[i],
- s->frame_width / (i?4:1), s->frame_height / (i?4:1),
- s->picture.linesize[i], s->current_picture.linesize[i]) < 0)
- return -1;
- }
-
-// align_put_bits(&s->pb);
- while(put_bits_count(&s->pb) & 31)
- put_bits(&s->pb, 1, 0);
-
- flush_put_bits(&s->pb);
-
- return (put_bits_count(&s->pb) / 8);
-}
-
-static int svq1_encode_end(AVCodecContext *avctx)
-{
- SVQ1Context * const s = avctx->priv_data;
- int i;
-
- av_log(avctx, AV_LOG_DEBUG, "RD: %f\n", s->rd_total/(double)(avctx->width*avctx->height*avctx->frame_number));
-
- av_freep(&s->m.me.scratchpad);
- av_freep(&s->m.me.map);
- av_freep(&s->m.me.score_map);
- av_freep(&s->mb_type);
- av_freep(&s->dummy);
-
- for(i=0; i<3; i++){
- av_freep(&s->motion_val8[i]);
- av_freep(&s->motion_val16[i]);
- }
-
- return 0;
-}
-
-#endif //CONFIG_ENCODERS
-
-#ifdef CONFIG_DECODERS
-AVCodec svq1_decoder = {
- "svq1",
- CODEC_TYPE_VIDEO,
- CODEC_ID_SVQ1,
- sizeof(MpegEncContext),
- svq1_decode_init,
- NULL,
- svq1_decode_end,
- svq1_decode_frame,
- CODEC_CAP_DR1,
- .flush= ff_mpeg_flush,
- .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV410P, -1},
-};
-#endif
-
-#ifdef CONFIG_ENCODERS
-
-AVCodec svq1_encoder = {
- "svq1",
- CODEC_TYPE_VIDEO,
- CODEC_ID_SVQ1,
- sizeof(SVQ1Context),
- svq1_encode_init,
- svq1_encode_frame,
- svq1_encode_end,
- .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV410P, -1},
-};
-
-#endif //CONFIG_ENCODERS
diff --git a/src/libffmpeg/libavcodec/svq1_cb.h b/src/libffmpeg/libavcodec/svq1_cb.h
deleted file mode 100644
index a0748bd44..000000000
--- a/src/libffmpeg/libavcodec/svq1_cb.h
+++ /dev/null
@@ -1,1580 +0,0 @@
-/*
- *
- * Copyright (C) 2002 the xine project
- * Copyright (C) 2002 the ffmpeg project
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Ported to mplayer by Arpi <arpi@thot.banki.hu>
- * Ported to libavcodec by Nick Kurshev <nickols_k@mail.ru>
- *
- */
-
-/**
- * @file svq1_cb.h
- * svq1 code books.
- */
-
-/* 6x16-entry codebook for inter-coded 4x2 vectors */
-static const int8_t svq1_inter_codebook_4x2[768] = {
- 7, 2, -6, -7, 7, 3, -3, -4, -7, -2, 7, 8, -8, -4, 3, 4,
- 19, 17, 9, 3,-14,-16,-12, -8,-18,-16, -8, -3, 11, 14, 12, 8,
- 7,-16,-10, 20, 7,-17,-10, 20, -6, 18, 8,-21, -7, 18, 9,-20,
- 25, 3,-20,-14, 29, 7,-18,-13,-29, -4, 21, 14,-31, -6, 20, 14,
- -19,-26,-28,-24, 31, 32, 22, 10, 15, 24, 31, 28,-32,-32,-22,-13,
- 2, -8,-23,-26, -9, 3, 27, 35, 3, 11, 21, 21, 8, -4,-27,-34,
- -30,-31, 12, 47,-29,-30, 13, 47, 38, 30,-17,-46, 34, 26,-19,-46,
- -42,-50,-51,-43, 34, 48, 55, 48, 48, 54, 51, 42,-44,-52,-53,-47,
- 4, 5, 0, -6, -2, -2, 0, 1,-11, -6, -1, -2, 1, 8, 9, 1,
- 0, 1, -6, 5, 8, 1,-12, 2, 7,-14, -7, 8, 5, -8, 0, 8,
- 1, 4, 11, 8,-12, -8, 0, -5, -1, 1, 0, 4,-15, -8, 3, 16,
- 17, 8, -4, -6, 9, -4,-13, -8, 2, 6, 1,-18, -1, 11, 11,-12,
- 6, 0, 2, 0, 14, 6, -7,-21, 1, -1,-13,-20, 1, 1, 10, 21,
- -22, -5, 7, 13,-11, -1, 4, 12, -7, 0, 14, 19, -4, 3, -5,-19,
- -26,-14, 10, 15, 18, 4, -6, -2, 25, 19, -5,-18,-20, -7, 4, 2,
- -13, -6, -1, -4, 25, 37, -2,-35, 5, 4, 1, 1,-21,-36, 2, 43,
- 2, -2, -1, 3, 8, -2, -6, -1, -2, -3, 2, 12, -5, -2, -2, -1,
- -3, -1, -1, -5, -1, 7, 8, -2, 2, 7, 5, -3, 1, 1, -3, -8,
- -3, -1, -3, -2, -2, -3, 2, 13, 15, 0,-11, -6, 3, 0, 0, 0,
- -6, -9, -5, -4, 18, 4, 1, 3, 12, 3, 0, 4,-16, -3, 3, -3,
- -17, 3, 18, 2, -1, -3, -1, -1, -6, 16, -8, 0, -9, 14, -7, 0,
- 3,-13, 14, -5, 3,-13, 14, -4, -7, 20, 14,-23, 8, -7, -8, 4,
- 8,-15,-19, 16,-10, 13, 11, -3, 9, -1, 1, 26, 5,-15,-27, 2,
- -20, 7, 16, -4,-40, 9, 31, 1, 26,-12,-30, -7, 40, -2,-19, 4,
- 6, 0, 0, 0, -6, -2, 1, 2, 0, -1, 0, -6, 9, 0, -2, -1,
- -7, 8, 2, -3, -1, 2, -3, 2, 7, -4, -2, 4, 2, 0, 0, -6,
- -3, -2, 9, 2, -2, -1, 0, -4, -3, -3, 0, -3, -6, 2, 10, 4,
- 3, 0,-10, 8, 0, 0, -4, 4, -1, 1, 4, 2, 3, -7, -9, 7,
- 2, 1, -9, -4, -1, 12, 0, 0, 3, -1, 7, -4, 3,-14, 4, 2,
- -12, -9, 1, 11, 2, 5, 1, 0, 3, 1, 0, 2, 0, 8, 6,-19,
- -6,-10, -7, -4, 9, 7, 5, 7, 6, 21, 3, -3,-11, -9, -5, -2,
- -4, -9,-16, -1, -2, -5, 1, 36, 8, 11, 19, 0, 2, 5, -4,-41,
- -1, -1, -2, -1, -2, -2, 1, 6, 0, 4, 1, -8, 1, 1, 1, 0,
- -2, -3, 4, 0, 2, -1, 3, -3, 1, 3, -4, 1, -1, 3, 0, -5,
- 3, 4, 2, 3, -2, -3, -6, -1, -2, -3, -2, 2, -4, 8, 1, 0,
- -7, 4, 2, 6, -7, -1, 1, 0, -2, 2, -4, 1, 8, -6, 2, -1,
- -6, 2, 0, 2, 5, 4, -8, -1, -1,-11, 0, 9, 0, -2, 2, 2,
- 17, -5, -4, -1, -1, -4, -2, -2, 0,-13, 9, -3, -1, 12, -7, 2,
- 0, -2, -5, 2, -7, -5, 20, -3, 7, 7, -1,-30, 3, 5, 8, 1,
- -6, 3, -1, -4, 2, -2,-11, 18, 0, -7, 3, 14, 20, -3,-18, -9,
- 7, -2, 0, -1, -2, 0, 0, -1, -4, -1, 1, 0, -2, 2, 0, 4,
- 1, -3, 2, 1, 3, 1, -5, 1, -3, 0, -1, -2, 7, 1, 0, -3,
- 2, 5, 0, -2, 2, -5, -1, 1, -1, -2, 4, -1, 0, -3, 5, 0,
- 0, 3, -1, -2, -4, 1, 5, -1, -1, 0, -1, 9, -1, -2, -1, -1,
- -2, 5, 5, -1, -2, 2, -3, -2, 1, 2,-11, 1, 2, 1, 3, 2,
- 2,-10, -1, -2, 4, 2, 4, 1, 4, 5, -5, 1, 0, 6,-11, 1,
- 1, 0, 6, 6, 0, 2, 1,-15, 7, 3, 5, 9,-30, 2, 2, 2,
- -34, 1, 9, 2, 5, 8, 8, 2, 7, 2, 6, 6, 2,-27, 1, 4
-};
-
-/* 6x16-entry codebook for inter-coded 4x4 vectors */
-static const int8_t svq1_inter_codebook_4x4[1536] = {
- 4, 0, -6, -7, -4, -8,-13, -9, -8, -8, -1, 6, -2, 5, 22, 27,
- -16, -7, 11, 10,-18, -7, 13, 10,-15, -4, 12, 8, -9, -1, 9, 5,
- -2, 2, 15,-16, -3, 2, 19,-19, -3, 2, 19,-19, -2, 3, 15,-14,
- 17, 22, 22, 16, -6, -7, -5, -2,-12,-16,-16,-12, 1, 1, -1, -3,
- 11,-17, 0, 8, 14,-21, -1, 9, 14,-21, -2, 8, 11,-16, -2, 6,
- 7, -2,-16, 11, 9, -2,-21, 14, 10, -1,-22, 14, 8, -1,-18, 10,
- -10, 16, 3, -9,-13, 20, 4,-11,-14, 21, 4,-10,-11, 16, 3, -8,
- 11, 4, -9, -9, 15, 6,-12,-14, 17, 8,-12,-14, 16, 10, -7,-11,
- 4, 10, 14, 13, -1, 7, 15, 16,-12, -7, 3, 8,-20,-23,-18,-10,
- -10,-18,-26,-25, 4, 1, -6,-11, 13, 15, 11, 3, 12, 15, 13, 8,
- -16,-19,-16,-11, 7, 12, 15, 11, 11, 16, 16, 11, -6, -9,-11,-10,
- 18, 19, 12, 5, 18, 16, 5, -4, 6, 0,-10,-15, -9,-17,-23,-22,
- -10,-14, -1, 21,-11,-17, 0, 29,-11,-16, 1, 30,-10,-14, 0, 23,
- -16,-17,-12, -6,-19,-19,-14, -7, -3, -1, 1, 2, 27, 35, 29, 19,
- -37, -8, 23, 23,-42, -9, 28, 29,-43,-10, 26, 28,-38,-11, 19, 22,
- 32, 16,-16,-33, 39, 20,-18,-37, 38, 19,-19,-38, 32, 15,-17,-34,
- 24, 9, -6, -4, -1,-10, -6, 3, -8, -9, -1, 3, 3, 7, 2, -6,
- -1, -3, -1, 0, -1, 4, 2, -7, -3, 11, 3,-16, 1, 20, 9,-18,
- -3, -8, 6, 12, -5,-10, 7, 13, -6, -9, 5, 7, -5, -5, 2, -1,
- -8, 12, -3, -1,-10, 15, -3, 1,-11, 13, -4, 1,-11, 8, -3, 2,
- 9, 6, -5,-12, 3, 0, -8,-13, -4, -4, -1, -1, -4, 1, 15, 18,
- 9, 13, 14, 12, 4, 3, -1, -2, -2, -5, -8, -5, -7,-11, -9, -4,
- 7, -5, -7, -4, 14, -2, -7, -4, 17, 0, -8, -5, 15, 1, -7, -5,
- -10, -1, 6, 4,-15, -9, 2, 4, 2, -1, -3, 0, 25, 13, -8,-10,
- 7, 11, -3,-16, 7, 11, -3,-15, 6, 7, -2, -9, 4, 2, -3, -5,
- -7, -1, -1, 0, -9, -2, 2, 6,-12, -4, 6, 14,-13, -6, 8, 19,
- -18,-18,-11, -5, -3, 0, 3, 4, 6, 8, 6, 6, 6, 6, 6, 6,
- -5, 3, 13,-10, -6, 1, 15, -9, -6, -3, 15, -6, -6, -6, 10, -3,
- 9, 1, -9, -9, 11, 9, 6, 5, 0, 3, 8, 7,-15,-14, -6, -5,
- -11, -6, 11, 19, -2, -5, -9, -8, 6, 2, -9,-10, 6, 5, 4, 5,
- -7, -3, 8, 15, -1, 3, 10, 15, 5, 5, -1, -2, 4, -2,-21,-25,
- 6, -6, -6, 5, 8, -9, -7, 9, 8,-12, -7, 13, 4,-14, -7, 14,
- -4, -3, 1, 1, -3, -5, -2, -3, 7, 0, -2, -4, 20, 7, -4, -4,
- -3,-20, -6, 10, 6, 0, 0, 1, 5, 8, 5, -1, -3, 0, 0, -2,
- 13, 6, -1, 2, 5, 3, 2, 3, -3, 0, 3, 0,-16, -8, -2, -5,
- -2, -7, -6, 0, -3, -6, -3, 1, -5, -1, 2, -1, -1, 12, 16, 5,
- -7, 1, 9, 8,-10, -2, 5, 3, -6, 2, 7, 3, -4, 0, -1, -7,
- 3, 4, -9,-24, 0, 2, 6, 3, -1, -1, 4, 7, 5, 3, -1, -2,
- 3, 6, -9, 2, 1, 6,-13, 1, 1, 8,-10, 2, 1, 8, -7, 1,
- -3, -3, 2, 22, -2, -3, -5, 12, -2, -3,-10, 2, -3, -1, -4, 2,
- 11, 12, 8, 2, -5, -5, -5, -8, -6, -4, 0, -3, -2, -1, 3, 3,
- 12, -6, -2, -1, 12, -8, -2, -2, 9, -7, 0, -3, 4, -6, 2, -2,
- -19, 1, 12, -3, -4, 4, 5, -4, 6, 1, -2, -1, 4, -4, -2, 7,
- -3, -4, -7, -8, -4, -4, -2, 0, -1, 2, 14, 16, -4, -2, 4, 4,
- -1, 7, 2, -5, -2, 0, -1, 1, 4, -3, -1, 13, 6,-12,-14, 8,
- -1, 5, 4, -5, -2, 5, 3, -9, -2, 7, 4,-12, -1, 7, 4, -9,
- -6, -3, 1, 1, 11, 11, 0, -6, 6, 4, -2, -7,-12,-10, 3, 10,
- -2, -3, -3, -2, 6, 11, 14, 10, -9,-11,-10,-10, 2, 2, 3, 2,
- -7, -5, -7, -1, -1, 2, 0, 7, -1, 1, 0, 9, 3, 4, -5, -1,
- 10, -1,-15, -1, 4, 1, -5, 2, -3, 1, -1, 1, -3, 1, 4, 4,
- 2, -1, 4, 10, 6, 2, -1, 0, 2, 2, -7,-12, -4, 2, 0, -3,
- -1, -4, -1, -8, 3, -1, 2, -9, 4, 0, 5, -5, 2, 0, 8, 3,
- 3, 2, 1, 1, 4, -2, 0, 3, 2, -1, 4, 1, 0, 6, -1,-25,
- -1, -2, -2, -4, -3, 0, -1, -4, -1, -1, -4, 2, 0, -6, 2, 25,
- -11, -1, 5, 0, 7, 0, -2, 2, 10, -1, -3, 4, -5, -5, -2, -1,
- 0, 6, 3, -1, -2, -1, -1, 1, -1, -7,-12, -5, 8, 6, 2, 4,
- 2, 6, -1, -6, 9, 10, -1, -4, 1, 0, -4, 0, 3, -2, -9, -5,
- -4, 3, 4, 0, -4, 3, 3, 0,-11, 0, 3, 2,-11, 3, 7, 2,
- 2, -4, 7, 3, 1, -8, 7, 1, -1,-12, 4, 1, 3, -9, 2, 2,
- 2, -2, -2, 9,-17, -3, 3, 1, -4, 7, 1, -6, 5, 4, -1, 3,
- -1, 2, 0, -4, -7, 8, 12, -1, -2, 5, 4, -5, 3, -5, -8, -2,
- 0, 0, -5, -2, -2, -8, 3, 27, -1, -4, -3, 6, -3, 1, -2, -7,
- 4, 4, 1, -1, -7,-10, -7, -3, 10, 10, 5, 3, -2, -2, -4, -3,
- 0, 1, 5, 7, 4, -2,-16,-20, 0, 4, 7, 8, 2, 0, -2, -1,
- -2, 1, 3, 17, -3, 1, -2, -1, -1, -2, -1, -2, -1, -5, -1, 0,
- 5, -3, 1, 0, 6, -2, 0, 0, -1, -2, 0, -3,-11, 1, 8, -1,
- 3, 0, 0, 0, 0, 2, 4, 1, 2, 0, 6, 1, -2,-18, -3, 2,
- -14, 0, 6, 1, -5, -2, -1, 1, -1, 1, 0, 1, 1, 7, 4, 0,
- -1, 0, 1, -4, 1, 8, 3, -4, -3, 4, 1, 3, -6, 1, -4, 1,
- 1,-12, 3, 3, -1,-10, 0, -1, 2, 0, 2, 1, 3, 2, 2, 4,
- 3, 0, 0, 3, 2, 0, -2, 1, 5, 2, -5, 0, 6, -1,-14, -1,
- -2, -6, -3, -3, 2, -1, 4, 5, 6, -1, -2, 0, 4, 4, -1, -5,
- -4, 1,-11, 0, -1, 2, -4, 1, 2, -3, 3, -1, 1, -2, 15, 0,
- 1, -1, 0, -2, 1, -4, -7, 1, -2, -6, -1, 21, -2, 2, -1, 1,
- 21, -1, -2, 0, -1, -3, 1, -2, -9, -2, 2, -1, 2, 1, -4, -1,
- 1, 8, 2, -6,-10, -1, 4, 0, -4, -3, 3, 3, 5, 0, -1, -1,
- 3, 2, 1, -2, -2, -2, 4, 3, 5, 2, -4,-17, 0, -2, 4, 3,
- -7, -4, 0, 3, 9, 9, 2, -1,-11, -6, 0, -1, 5, 1, 0, 1,
- 0, 17, 5,-11, 3, -2, -6, 0, 2, -2, -4, 1, -4, 1, 2, -1,
- -5, -1, -5, -3, -3, 5, -3, -2, 4, 16, 2, -5, -2, 5, -1, -1,
- 0, 0, -4, 1, -1, 2, 5, 11, -1, -1, -2, 1, -4, -2, -3, -1,
- -5, -1, 10, 0, 6, 1, 0, -3, 0, -4, 1, 0, -2, -4, 3, -1,
- 6, 9, 3, 0, -2, 1, -2, 0, -2, -3, -2, -2, 1, 0, 1, -6,
- 1, 0, 2, 1, -1, 3, -2, 1, 0, -1,-15, 0, -1, 5, 2, 6,
- 2, 0, 2, 2, 0,-12, -4, 6, 0, 1, 4, -1, 1, 2, 1, -4,
- 1, -2, -7, 0, 0, 0, 0, -1, -5, 2, 11, 3, 1, 3, 0, -6,
- 0, -3, -9, -4, 1, 3, -1, 0, 4, 1, -2, 0, 7, -3, -1, 6,
- 1, -2, 6, 2, 0, -1, 3, -2, -2, 4, 0, 2, -1, 2,-14, 2,
- 2, 2, 0, -1, -2, 3, -3,-14, 0, 2, 3, -3, 5, 1, 3, 2,
- 1, -3, 4,-14, 1, -2, 11, -1, 0, -1, 3, 0, -1, 1, 0, 2,
- -2, 3, -3, 2, -4, -1, -4, 3, -1, 2, 1, 3, -6, -2, 2, 7,
- -2, 1, 2, 0, -2, 0, 0, -1, 12, 5, -1, 2, -8, -1, 1, -7,
- 2, -2, -4, 2, 11, 0,-11, -2, 3, 1, -3, -1, 0, 3, 1, -1,
- 0, 3, 0, -2, 0, -6, -1, -3, 12, -7, -2, 0, 7, -2, 1, 1,
- 1, 2, 2, 2, -1, 2, 0, 2,-23, 0, 4, 0, 3, 2, 1, 3,
- -4, -5, -1, 5, -3, 5, 10, -1, 0, 0, 3, -4, 1, -1, 2, -5
-};
-
-/* 6x16-entry codebook for inter-coded 8x4 vectors */
-static const int8_t svq1_inter_codebook_8x4[3072] = {
- 9, 8, 4, 0, -3, -4, -4, -3, 9, 8, 4, -1, -4, -5, -5, -3,
- 8, 7, 3, -2, -5, -5, -5, -4, 6, 4, 1, -2, -4, -5, -4, -3,
- -12,-14,-11, -4, 1, 5, 6, 6, -8,-10, -7, -5, -2, 1, 1, 1,
- 5, 4, 3, 1, 0, 0, -1, -1, 13, 13, 9, 6, 3, 0, -1, -2,
- -4, -4, -3, -1, 1, 4, 8, 11, -5, -6, -4, -2, 0, 3, 8, 12,
- -7, -7, -6, -4, -2, 2, 7, 10, -7, -7, -5, -4, -2, 1, 5, 8,
- -3, -2, -1, 1, 3, 6, 7, 6, 2, 3, 5, 7, 8, 8, 6, 4,
- 4, 5, 4, 3, 1, -2, -6, -7, 1, 0, -2, -7,-10,-14,-17,-16,
- -5, -4, 1, 8, 9, 3, -3, -7, -7, -6, 1, 11, 12, 5, -3, -8,
- -8, -7, 0, 9, 11, 5, -3, -7, -8, -6, -1, 5, 8, 4, -2, -6,
- -4, -5, -7, -8, -9, -9, -8, -6, -4, -5, -6, -7, -7, -6, -4, -2,
- 0, 1, 2, 3, 5, 8, 10, 9, 1, 2, 3, 6, 9, 12, 14, 13,
- 5, 6, 6, 5, 4, 3, 2, 1, 5, 6, 7, 7, 6, 6, 6, 4,
- -1, 0, 1, 1, 3, 5, 5, 5,-13,-16,-17,-17,-14,-10, -6, -4,
- 9, 11, 13, 16, 15, 13, 12, 10, -4, -5, -6, -7, -7, -7, -6, -5,
- -6, -6, -7, -7, -7, -7, -6, -5, -2, -1, 0, 0, 0, 0, 0, -1,
- -11,-13,-15,-16,-16,-14,-12,-10, 2, 3, 4, 5, 4, 3, 3, 3,
- 6, 7, 8, 8, 8, 7, 6, 5, 3, 4, 3, 3, 3, 3, 3, 3,
- 3, 4, 4, 1, -2, -7,-13,-17, 5, 7, 7, 5, 1, -5,-13,-19,
- 6, 8, 9, 8, 5, -1, -9,-16, 6, 8, 10, 10, 7, 2, -4,-11,
- 18, 9, -1,-10,-13, -9, -4, 0, 22, 12, -1,-12,-15,-10, -4, 2,
- 23, 13, 0,-10,-13, -9, -3, 2, 20, 12, 2, -6, -9, -6, -2, 2,
- -6, -6, -6, -7, -7, -7, -7, -6, -6, -7, -8, -8, -9, -9, -9, -8,
- -3, -3, -3, -3, -3, -3, -3, -3, 12, 15, 18, 21, 21, 19, 17, 14,
- 14, 16, 18, 18, 18, 16, 15, 13, 5, 6, 6, 5, 5, 4, 4, 3,
- -6, -7, -9,-10,-10,-10, -9, -7,-10,-11,-13,-14,-14,-13,-12,-10,
- -27,-17, -4, 5, 9, 10, 10, 7,-32,-19, -3, 7, 11, 12, 11, 8,
- -30,-16, -2, 8, 12, 12, 10, 7,-23,-12, 0, 7, 10, 11, 9, 6,
- 16, 17, 16, 12, 6, -1, -8,-12, 17, 18, 15, 10, 1, -8,-15,-18,
- 15, 14, 10, 4, -5,-14,-20,-23, 10, 8, 4, -1, -9,-16,-21,-22,
- -10,-12,-12,-11, -5, 4, 14, 20,-11,-13,-15,-12, -4, 7, 19, 27,
- -11,-13,-14,-11, -3, 8, 21, 28,-10,-11,-12, -9, -2, 8, 18, 25,
- -1, -1, -1, 1, 4, 6, 6, 5, 0, 0, 0, 2, 4, 3, 1, -2,
- 0, 0, 2, 4, 4, -1, -7,-10, 0, 0, 3, 5, 3, -3,-11,-15,
- -14,-13, -8, -1, 3, 3, -1, -4, -5, -4, -1, 4, 8, 8, 3, 0,
- 3, 2, 2, 3, 4, 5, 3, 1, 5, 3, 0, -2, -2, -1, -1, -1,
- 9, 1, -6, -6, -5, -3, -2, -1, 12, 1, -6, -6, -4, -2, -1, 0,
- 14, 4, -4, -4, -2, -2, -1, -1, 14, 6, -1, -1, -1, -1, -1, -1,
- 4, 6, 8, 10, 11, 9, 7, 5, -1, -1, -1, 0, 0, -1, -1, -2,
- -2, -4, -4, -5, -5, -5, -5, -4, -2, -3, -3, -4, -4, -3, -2, -1,
- 2, 3, 4, 4, 3, 1, 0, 0, -1, 1, 4, 5, 6, 5, 4, 3,
- -8, -6, -2, 2, 3, 4, 4, 3,-14,-13, -9, -5, -2, -1, 0, 0,
- -3, -4, -5, -4, 0, 7, 12, 13, -3, -4, -5, -5, -2, 4, 9, 10,
- -2, -3, -4, -5, -4, -1, 3, 4, -1, -1, -2, -3, -3, -2, 0, 1,
- 9, 5, -2, -8,-11,-10, -7, -4, 12, 10, 6, 2, 0, -1, 0, 0,
- 2, 2, 3, 4, 3, 1, 1, 1, -9, -8, -4, 0, 1, 2, 1, 0,
- 6, 8, 8, 5, 1, -5,-11,-13, 0, 1, 2, 2, -1, -4, -8,-11,
- -3, -2, 1, 3, 3, 1, -1, -4, -2, -1, 2, 5, 6, 6, 4, 1,
- 3, 4, 5, 5, 4, 1, -3, -6, 5, 6, 4, 2, 2, 2, 0, -3,
- 6, 5, 0, -5, -5, -2, -1, -2, 7, 4, -3,-11,-12, -7, -3, -2,
- 1, 0, -1, -1, -1, 0, 0, 0, 2, 3, 4, 4, 5, 5, 4, 3,
- -7, -9, -9,-10,-10, -9, -7, -6, 3, 4, 5, 6, 5, 5, 5, 5,
- -7, -7, -7, -7, -6, -6, -5, -4, -5, -4, -3, -1, -1, -1, 0, 0,
- -3, -2, 1, 4, 5, 5, 5, 5, -2, -1, 3, 6, 9, 10, 10, 9,
- -14, 1, 10, 3, -2, 0, 1, 1,-16, 2, 13, 3, -3, -1, 1, 0,
- -15, 2, 12, 3, -4, -2, 1, 1,-10, 3, 10, 2, -3, -1, 1, 1,
- 0, 1, 4, 2, -5,-10, -3, 11, -1, 1, 4, 2, -6,-13, -2, 15,
- -1, 0, 3, 1, -6,-12, -1, 15, -1, 1, 2, 1, -4, -8, 0, 11,
- 10, 5, -2, -2, 2, 5, 1, -4, 7, 0, -8, -6, 1, 5, 2, -4,
- 2, -5,-12, -7, 2, 7, 4, -1, -1, -7,-10, -4, 4, 9, 7, 2,
- -5, -5, -4, -6, -6, -5, -5, -3, -1, -2, -2, -4, -5, -6, -5, -4,
- 6, 7, 7, 4, 0, -2, -3, -3, 13, 14, 13, 10, 5, 1, -1, -2,
- 1, 1, 2, 2, 2, 2, 2, 2, -5, -6, -8, -9, -9, -8, -7, -6,
- 7, 9, 10, 11, 11, 9, 7, 5, -1, -2, -3, -3, -4, -4, -4, -3,
- -1, -1, 0, 0, 0, 0, -1, -1, -3, -3, -4, -5, -4, -3, -3, -2,
- 2, 1, -1, -3, -3, -2, -1, 0, 12, 12, 8, 3, 1, 0, 0, 1,
- -6, -8, -8, -6, -2, 2, 6, 8, 1, 1, -1, -2, 0, 3, 5, 7,
- 3, 3, 1, -1, -1, 0, 0, 2, 0, 1, 0, -1, -1, -1, -2, -1,
- 1, 0, 0, 0, 0, 0, 2, 4, 2, 1, 3, 4, 3, 1, 0, 2,
- 2, 1, 0, 0, -1, -1, 0, 3, 5, 1, -6,-12,-13, -8, -1, 4,
- -2, 0, -1, -2, -1, 0, 2, 3, -6, -3, -2, 0, 1, 1, 1, 1,
- -9, -5, 0, 4, 5, 3, 1, 0, -8, -3, 3, 7, 8, 4, 1, 0,
- 1, 2, 2, 3, 3, 1, -1, -3, 4, 5, 5, 6, 6, 5, 2, 0,
- 0, 0, 0, 0, 1, 0, -2, -4, -3, -3, -4, -3, -3, -4, -7, -8,
- 14, 12, 6, -1, -3, -3, 0, 0, 7, 5, 1, -3, -5, -4, -2, -1,
- -2, -2, -2, -2, -2, -2, -1, -1, -6, -4, -1, 1, 1, 1, 0, -1,
- 2, 2, 1, -3, -6, -7, -6, -3, 1, 0, -1, -3, -2, 1, 4, 6,
- 0, 0, 1, 2, 4, 7, 8, 7, 0, 0, 0, 0, -1, -4, -7, -8,
- 0, 2, 1, -2, -3, -3, -2, -1, -1, 1, 0, -3, -5, -2, 0, 2,
- -2, -1, -2, -5, -4, 1, 6, 9, -3, -2, -3, -4, -2, 5, 11, 13,
- -4, -2, 2, 6, 4, -3,-10,-14, -2, -1, 1, 4, 4, 1, -1, -2,
- 0, 0, -1, -2, -2, 0, 4, 6, 2, 2, 0, -3, -3, 0, 5, 9,
- -4, -4, -2, 1, 6, 9, 3, -7, -2, -2, -2, -1, 4, 8, 0,-11,
- 1, 1, 0, 0, 2, 6, -1,-10, 2, 2, 1, 0, 2, 4, 0, -7,
- -1, -2, -3, -6, -7, -8, -8, -8, 2, 3, 3, 1, -1, -2, -3, -4,
- 5, 5, 5, 4, 3, 2, 0, -1, 3, 3, 3, 3, 2, 2, 1, 1,
- 3, 3, 2, -2, -3, 0, 7, 10, 1, 2, 2, -2, -5, -4, 0, 3,
- 0, 3, 4, 2, -3, -5, -6, -4, 0, 2, 4, 4, 1, -4, -7, -7,
- 2, 4, 5, 5, 5, 5, 6, 6, -4, -4, -3, -5, -5, -3, -3, -2,
- -3, -4, -4, -5, -4, -2, -2, -2, 1, 1, 0, 0, 2, 4, 5, 4,
- -2, 0, 3, 4, 4, 3, 2, 2, -9, -7, -4, 0, 3, 6, 6, 6,
- -5, -5, -3, -2, 0, 1, 3, 4, 5, 5, 2, -2, -4, -6, -5, -3,
- 1, -6, -4, 7, 5, -2, -2, 1, 5, -5, -4, 6, 4, -5, -4, 1,
- 5, -5, -4, 6, 4, -5, -3, 1, 1, -7, -3, 8, 7, -1, -3, 1,
- -8, -7, -4, 0, 2, 4, 5, 5, 5, 6, 5, 2, -1, -5, -7, -7,
- 5, 6, 4, 1, -3, -5, -6, -5, -7, -7, -5, -2, 1, 6, 9, 10,
- 6, 3, 0, 1, 3, 0, -8,-14, 3, 0, -1, 1, 4, 3, 0, -4,
- 1, 0, 0, 1, 2, 1, 1, 1, -1, -1, 1, 2, 1, -1, -1, 0,
- 1, 1, 1, 1, 0, -2, -3, 0, 1, 2, 1, 0, -2, -8, -9, -4,
- 1, 3, 3, 2, 1, -3, -3, 1, 0, 1, 1, 1, 1, 1, 4, 8,
- 2, 5, 9, 7, 2, -1, -1, 1, -4, -1, 1, 0, -3, -4, -1, 2,
- -3, 0, 3, 3, 0, -1, 0, 2, -4, -1, 1, 1, -2, -4, -5, -4,
- 1, -1, -2, -2, -1, 2, 4, 5, 2, 1, 1, 0, -1, -1, 0, 0,
- 2, 3, 4, 5, 4, 2, 1, 0, -9, -9, -6, -3, -1, -1, -1, -1,
- -6, -6, 4, 7, 0, -2, -1, -2, -1, -2, 5, 6, -1, -2, 0, -1,
- 4, -1, 1, 0, -4, -2, 0, -2, 7, 1, -1, -2, -3, 1, 3, 1,
- 4, 2, 1, 3, 3, 1, 1, 2, 2, -2, -4, 0, 3, 1, 0, 0,
- 1, -4, -8, -4, 1, 2, 1, 0, 2, -3, -9, -6, 0, 3, 3, 2,
- -1, -1, 0, -1, -1, 0, 1, 2, 3, 1, -4, -8, -7, -3, 1, 2,
- 2, -1, -3, -2, -1, 0, 1, 0, -1, 0, 5, 11, 9, 3, -1, -3,
- -1, -2, -2, -1, 1, 1, 1, 1, 0, -1, 0, 3, 6, 6, 5, 5,
- 2, 1, -1, -1, -2, -5, -6, -4, 2, 2, 2, 1, -1, -4, -5, -5,
- -1, -3, -6, -7, -6, -4, -1, 1, 5, 5, 3, 4, 4, 3, 4, 5,
- -1, -2, -3, -2, -2, -2, 0, 1, 0, 0, 0, 0, 0, 1, 2, 3,
- -6, -6, -4, -1, 2, 2, 2, 2, -6, -7, -5, -2, 0, -1, -1, 0,
- 2, 2, 2, 4, 4, 3, 3, 4, 2, 1, 0, -1, 0, 0, 2, 4,
- 12, 5, -5, -8, -5, 0, 2, 2, 2, -3, -6, -3, 0, 0, -1, -2,
- -2, -3, -1, 3, 4, 1, -2, -3, 2, 2, 3, 4, 3, 1, -1, -1,
- 3, 2, 1, 0, 1, 4, 3, 0, 4, 3, 0, -5, -6, 0, 3, 3,
- 2, 3, 1, -7,-12, -6, 1, 3, 1, 3, 4, -1, -6, -4, 0, 1,
- -9, -4, 2, 6, 7, 4, 1, 0, -7, -1, 4, 6, 4, 0, -3, -3,
- -6, 0, 4, 4, 1, -2, -3, -2, -4, 1, 3, 2, 0, -2, -1, 0,
- 0, 5, 2, -5, -3, 3, 1, -4, -2, 4, 2, -6, -3, 6, 4, -3,
- -1, 5, 3, -5, -1, 7, 3, -4, -1, 2, 0, -6, -3, 5, 3, -3,
- -8, -3, 3, 5, 3, 1, -2, -2, 2, 4, 4, -2, -4, -3, 1, 3,
- 2, 1, -3, -5, -3, 3, 4, 3, -5, -6, -5, 3, 10, 8, -1, -5,
- 0, 3, 2, -4, -9, -7, 0, 6, -5, -1, 5, 7, 4, -1, -3, -3,
- -5, -5, -2, 3, 6, 5, -1, -4, 9, 6, 0, -4, -2, 1, 1, -1,
- -1, -1, -1, 1, 1, 0, -1, 0, -1, 0, 0, 0, 0, -1, -1, 0,
- 2, 1, -2, -1, 1, 1, 0, 0, 12, 8, 2, -1, -1, -4, -7, -7,
- 2, 1, 3, 6, 7, 4, 2, 0, 1, 0, -1, 0, -1, -4, -7, -8,
- 0, 0, -1, 0, 0, 0, -1, -3, 0, 0, 0, 0, 1, 1, 0, -2,
- -1, 0, 1, 1, 0, 0, -1, -2, 0, 0, -1, -3, -4, -3, -1, 1,
- -1, 0, 0, 0, 1, 4, 10, 12, -1, 0, -2, -2, -3, -3, -1, 1,
- -3, -1, -2, -4, 2, 9, 9, 7, -3, 0, -1, -3, 0, 2, -1, 1,
- -1, 1, -2, -3, 0, -1, -3, 0, 0, 0, -3, -2, 0, -1, -1, 1,
- -1, -2, -1, -1, -2, -1, -1, -2, 2, -1, -2, -1, 0, 1, 0, -2,
- 3, -1, -2, 2, 5, 3, -1, -3, 1, -5, -5, 1, 6, 6, 2, 0,
- 1, 2, 0, -1, 0, 1, 0, -2, -5, -3, -1, 0, 1, 2, 1, -2,
- -7, -5, -2, -2, -2, -2, 0, 1, -1, 0, 1, 1, 0, 3, 9, 12,
- 0, 6, 5, 1, -2, -3, 0, 3, 0, 6, 5, 1, 1, 1, 2, 3,
- -5, -2, -2, -3, 0, 0, 0, 0, -6, -3, -3, -2, 0, 0, -1, -2,
- 4, 4, 2, 1, 0, -1, -1, 0, -2, -2, 0, 1, 2, 1, 1, 0,
- 2, 2, 1, -1, -3, -5, -9,-10, 2, 1, -1, -1, 1, 4, 4, 1,
- 4, 0, -2, -2, -2, -2, -1, 0, 7, 1, -4, -3, -2, 0, 1, 1,
- 10, 5, -1, -2, 0, 1, 1, 0, 5, 1, -3, -4, -3, -1, -1, -2,
- 2, 1, -1, -3, -3, 1, 1, -1, -2, -1, 3, 0, -1, 1, 1, 0,
- -3, 1, 7, 2, -3, -2, -1, 0, -2, 4, 8, -1, -8, -5, 0, 2,
- -4, -1, 1, 2, 1, -3, -4, -2, -5, -3, -2, 1, 4, 4, 4, 6,
- -3, -2, -4, -3, 0, 1, 1, 2, 2, 2, 2, 1, 2, 1, -1, -1,
- -4, -1, 0, -1, -3, -3, -1, -1, 1, 4, 4, 2, 0, -1, -2, -3,
- 4, 6, 5, 3, 2, 1, -2, -4, 0, 1, 1, 1, 1, -1, -4, -6,
- 1, 2, 2, -1, -6, -5, -1, 2, -3, -2, 1, 1, -4, -3, 2, 5,
- -2, -1, 2, 2, -3, -4, 0, 3, -2, -2, 2, 6, 5, 2, 1, 2,
- 2, -3, -3, 0, 0, 2, 3, 1, 3, -1, 1, 3, 1, 2, -1, -5,
- -5, -7, -4, -2, 1, 8, 8, 1, -1, 0, 2, 0, -3, 0, 1, -3,
- -2, -5, -5, -2, -3, -1, 0, -2, -1, -4, 0, 4, 0, 2, 4, 0,
- 0, 0, 8, 10, 2, 1, 3, -1, -4, -3, 2, 3, -3, -3, 1, -1,
- 1, -2, -4, 2, 7, 3, -2, -1, 6, 4, -2, -1, 2, 0, -1, 3,
- 1, 1, -2, -2, -2, -5, -3, 4, -6, -2, 1, 1, -1, -4, -2, 4,
- -2, -1, -2, -2, 0, 1, 0, -2, -1, 1, 0, -1, 0, 0, -1, -3,
- 0, 1, -2, -4, -3, -1, 0, 0, 6, 8, 5, 0, 0, 1, 2, 3,
- -2, -2, 2, 5, 2, 0, 0, 1, 2, -2, -2, -1, -1, 1, 2, 4,
- 2, -1, 0, 1, 0, 0, 0, 1, -8, -7, -1, 1, -1, -1, 1, 3,
- 0, 3, 6, 2, -2, 1, 2, 0,-10, -7, -1, 0, -3, -1, 2, 1,
- 0, 0, 2, 2, 1, 1, 1, -1, 3, 0, -2, -2, 0, 2, 1, 0,
- 8, 1, 0, 0, -2, -3, -1, 0, 2, -2, 2, 5, 1, -2, -1, 1,
- -3, -6, -3, -1, -3, -3, -1, 2, 2, 0, 1, 2, 2, 1, 0, 0,
- 1, -1, -1, -2, -1, 0, 1, 0, 15, 9, 2, -1, -2, -3, -3, -3,
- 0, -3, -2, 0, 0, -1, -1, -1, 1, 0, 1, 0, 0, -1, -1, -1,
- 0, 2, 2, -2, -3, -3, -7, -8, 0, 2, 2, 0, 1, 2, 1, 1,
- 1, 2, 2, 2, 3, 1, 0, 3, 1, 0, -1, -2, -1, -2, 0, 5,
- -11, -6, -1, 1, 2, 3, 1, -3, 1, 4, 3, -1, -2, 1, 2, -1,
- 2, 2, 1, -1, -2, 0, 1, -1, 0, 0, -1, -1, 0, 2, 3, 2,
- 1, 1, 2, 1, -1, 1, 0, -4, 0, 0, 0, -2, -2, 2, 4, -2,
- -2, -3, 0, 0, -1, 2, 1, -6, 0, 2, 5, 5, 3, 2, -1, -7,
- 4, 2, 0, 0, 3, 3, 1, -1, 0, -1, -1, 3, 6, 4, 1, -1,
- -2, -2, 0, 2, 2, 0, -2, -2, -1, 0, -1, -5, -7, -5, -1, 1,
- 5, -1, -2, 0, 2, 4, 2, -5, 0, -5, -2, 2, 1, 2, 0, -6,
- 6, 1, 0, 1, -2, -1, 4, 2, 2, -3, -3, 0, -1, -2, 0, 0,
- 1, -1, 0, 2, 0, 0, 6, 11, 2, -1, -1, 0, -3, -2, 3, 5,
- 0, -2, -1, 0, -1, 0, 0, -3, 1, -1, -1, -1, -2, -1, -3, -7,
- 1, 1, -2, -2, 1, 3, 1, -2, -1, 2, 0, -1, -1, 1, 0, 0,
- -4, 2, 3, -1, -2, -2, 0, 1,-11, -2, 4, 5, 6, 2, -1, -2,
- -6, -2, 1, -1, -3, -4, 1, 9, -3, 0, 3, 3, 2, -3, -3, 3,
- 1, 1, 0, 0, 1, -1, -2, 3, 2, 0, -3, -3, 0, -1, -1, 3,
- 1, -1, -3, 1, 2, -6, -4, 6, 0, -2, -5, -2, 0, -3, -2, 3,
- 2, 2, 1, -2, -2, 1, 2, -1, -1, 1, 1, -2, -1, 6, 7, -1,
- 1, 0, -4, -2, 1, -2, -3, 1, -4, 0, -3, -2, 2, 0, -3, 0,
- -3, 4, 3, 1, 8, 7, 0, -1, -3, 4, 1, -4, 2, 3, -2, -3,
- -3, 6, 1, -4, 1, 1, -1, -1, -2, 4, -3, -3, 3, 0, -1, -1,
- 1, 2, -4, 2, 4, -3, -1, 2, 3, -1, -4, 5, 4, -6, -3, 2
-};
-
-/* 6x16-entry codebook for inter-coded 8x8 vectors */
-static const int8_t svq1_inter_codebook_8x8[6144] = {
- -4, -3, 4, 5, 2, 1, 1, 0, -5, -3, 5, 5, 2, 1, 0, 0,
- -6, -4, 5, 5, 2, 1, 0, 0, -7, -4, 4, 5, 2, 1, 0, 0,
- -8, -5, 3, 4, 2, 1, 0, 0, -8, -6, 3, 4, 1, 1, 1, 0,
- -8, -6, 2, 4, 2, 1, 1, 0, -8, -6, 2, 4, 1, 1, 1, 1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -2, -2, -2, -2, -2, -2,
- -2, -3, -3, -3, -3, -3, -3, -3, -2, -3, -3, -3, -3, -3, -4, -3,
- -2, -2, -2, -2, -2, -3, -3, -2, 1, 1, 1, 1, 1, 0, -1, -1,
- 4, 5, 5, 5, 4, 3, 3, 2, 7, 7, 8, 8, 8, 7, 6, 5,
- 2, 1, 2, 4, 4, 0, -4, -6, 1, 1, 2, 5, 5, 1, -5, -7,
- 1, 2, 1, 4, 5, 1, -5, -8, 1, 1, 1, 5, 5, 0, -6, -8,
- 0, 1, 1, 5, 6, 1, -6, -9, 0, 0, 1, 4, 5, 0, -5, -8,
- 0, 0, 1, 4, 5, 0, -5, -7, 0, 0, 1, 4, 4, 1, -4, -7,
- 1, 2, 3, 0, -3, -4, -3, -1, 1, 3, 4, 0, -3, -4, -3, -1,
- 2, 4, 5, 1, -3, -4, -3, -2, 2, 5, 6, 1, -3, -5, -4, -2,
- 3, 6, 6, 1, -3, -5, -4, -2, 3, 6, 6, 1, -3, -5, -4, -2,
- 3, 6, 6, 1, -3, -5, -4, -2, 3, 5, 5, 1, -3, -4, -4, -2,
- 2, 2, 2, 2, 1, 0, 0, -1, 4, 4, 4, 3, 2, 1, 1, 0,
- 4, 5, 4, 4, 3, 3, 2, 1, 4, 4, 4, 4, 4, 3, 2, 2,
- 2, 3, 3, 3, 3, 3, 2, 1, -1, -1, -1, -1, 0, 0, 0, 0,
- -5, -6, -6, -5, -5, -4, -3, -3, -7, -9, -9, -8, -7, -6, -6, -5,
- 6, 6, 6, 6, 6, 5, 5, 4, 4, 4, 4, 3, 3, 3, 3, 2,
- 0, -1, -1, -1, -2, -2, -1, -1, -3, -5, -6, -6, -6, -6, -5, -4,
- -3, -5, -6, -7, -6, -6, -5, -4, -1, -2, -2, -2, -2, -2, -1, -1,
- 0, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3,
- 2, 1, -2, -5, -4, 0, 2, 5, 2, 1, -2, -6, -5, 0, 3, 5,
- 2, 1, -2, -6, -6, -1, 3, 6, 3, 2, -2, -7, -6, 0, 4, 7,
- 2, 1, -2, -7, -5, 0, 5, 7, 2, 1, -2, -6, -5, 0, 4, 7,
- 2, 1, -2, -6, -4, 0, 4, 6, 1, 1, -2, -5, -4, 0, 3, 6,
- -10, -9, -6, -4, -1, 2, 3, 2,-10, -9, -5, -3, 0, 4, 4, 3,
- -9, -7, -3, -1, 2, 5, 5, 3, -7, -5, -2, 0, 3, 5, 5, 3,
- -6, -3, 0, 1, 4, 6, 5, 3, -4, -2, 1, 2, 3, 5, 4, 2,
- -2, 0, 1, 2, 2, 4, 3, 1, -1, 1, 2, 2, 2, 3, 3, 1,
- -4, -5, -5, -6, -6, -6, -6, -5, -3, -3, -4, -4, -4, -4, -4, -4,
- 0, 0, 0, 0, -1, -1, -1, -1, 5, 5, 6, 5, 5, 4, 3, 2,
- 5, 6, 7, 7, 7, 6, 5, 4, 3, 3, 4, 4, 4, 4, 3, 2,
- 0, -1, 0, 0, -1, -1, 0, -1, -3, -3, -4, -4, -4, -4, -3, -3,
- 1, -2, -5, 1, 5, 4, 2, 0, 1, -3, -6, 1, 6, 5, 2, 0,
- 0, -4, -7, 0, 6, 6, 2, 1, -1, -5, -9, -1, 6, 6, 3, 1,
- -1, -6,-10, -2, 6, 6, 3, 1, -1, -6, -9, -2, 5, 6, 3, 1,
- -2, -6, -9, -2, 5, 5, 3, 1, -2, -6, -7, -2, 4, 4, 2, 1,
- -5, -7, -8, -9, -9, -8, -7, -6, -5, -6, -6, -7, -7, -6, -6, -5,
- -3, -3, -3, -4, -5, -5, -4, -4, -1, 0, 0, -1, -1, -1, -1, -1,
- 0, 1, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 5, 5, 5, 4,
- 3, 4, 5, 6, 8, 8, 8, 7, 3, 4, 5, 6, 7, 7, 7, 6,
- 5, 6, 7, 8, 9, 10, 10, 9, 3, 4, 6, 7, 8, 9, 9, 8,
- 0, 1, 2, 3, 4, 5, 5, 5, -1, -2, -1, -1, 0, 1, 2, 2,
- -2, -3, -3, -3, -3, -2, -1, 0, -3, -4, -5, -5, -5, -5, -5, -4,
- -4, -5, -5, -6, -7, -7, -6, -5, -3, -4, -5, -6, -7, -7, -6, -6,
- 13, 7, 0, -3, -3, -4, -4, -5, 14, 7, 0, -3, -3, -4, -4, -4,
- 15, 8, -1, -4, -4, -4, -5, -4, 15, 8, -1, -4, -4, -5, -4, -3,
- 15, 7, -1, -4, -5, -5, -5, -4, 14, 7, -1, -4, -4, -4, -4, -3,
- 12, 6, -1, -4, -4, -4, -4, -3, 11, 5, -1, -4, -4, -4, -4, -3,
- -17, -4, 5, 4, 4, 4, 3, 3,-18, -5, 5, 4, 4, 4, 3, 3,
- -19, -5, 6, 4, 4, 4, 3, 2,-20, -5, 6, 4, 4, 4, 3, 3,
- -20, -4, 6, 4, 4, 5, 3, 3,-19, -5, 6, 4, 4, 5, 3, 3,
- -18, -4, 5, 4, 4, 4, 3, 2,-17, -5, 4, 3, 4, 4, 3, 3,
- -6, -6, -6, -4, -2, 1, 6, 11, -6, -7, -7, -4, -2, 2, 8, 13,
- -8, -8, -7, -4, -2, 3, 9, 14, -8, -8, -7, -5, -1, 4, 10, 16,
- -8, -8, -7, -5, -1, 4, 10, 17, -8, -8, -7, -4, 0, 5, 10, 16,
- -8, -8, -6, -3, 0, 4, 9, 15, -7, -7, -5, -3, 0, 4, 8, 12,
- 8, 7, 7, 5, 2, -2, -8,-14, 8, 8, 7, 5, 2, -2, -8,-15,
- 8, 8, 7, 5, 1, -3, -9,-16, 8, 8, 7, 5, 1, -3,-10,-17,
- 8, 9, 8, 5, 1, -3,-10,-17, 8, 8, 7, 4, 1, -4,-10,-16,
- 7, 7, 7, 4, 1, -3, -9,-14, 6, 7, 6, 3, 0, -3, -9,-13,
- 5, 1, -4, -4, -3, -1, 0, 0, 7, 2, -3, -3, -2, -1, 1, 0,
- 7, 1, -3, -3, -1, 0, 1, 1, 6, 1, -3, -2, -1, 1, 1, 0,
- 6, 0, -4, -2, -1, 0, 1, 0, 5, 0, -4, -3, -1, 0, 0, -1,
- 5, 0, -3, -1, 0, 0, 0, -2, 4, 1, -2, -1, 0, 1, 0, -1,
- 2, 2, 1, 1, -2, -6, -8, -8, 1, 1, 1, 1, -2, -5, -8, -8,
- 1, 1, 1, 0, -1, -3, -5, -5, 0, 0, 0, 0, -1, -1, -1, -2,
- 0, -1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 2, 3, 2,
- 2, 1, 1, 1, 2, 3, 4, 3, 3, 3, 3, 3, 4, 4, 5, 4,
- -4, -4, -3, -2, 0, 0, 1, 1, -4, -4, -3, -2, -1, 0, 0, 1,
- -2, -2, -2, -1, -1, -1, 0, 0, 0, 1, 0, 0, 0, 0, 0, -1,
- 2, 2, 2, 2, 2, 2, 1, 1, 3, 4, 4, 4, 4, 4, 4, 3,
- 1, 1, 1, 3, 3, 4, 3, 3, -5, -6, -5, -4, -3, -3, -2, -2,
- -4, -2, -1, -1, -1, -1, 0, 1, -4, -2, -1, -1, -1, -1, 0, 1,
- -3, -2, -1, -1, -1, 0, 1, 2, -4, -3, -2, -1, -1, 1, 3, 3,
- -4, -3, -3, -1, -1, 1, 4, 5, -4, -3, -2, -2, -1, 1, 4, 7,
- -2, -2, -1, -1, 0, 2, 6, 8, -1, 0, 0, 1, 1, 4, 7, 8,
- -3, -3, -3, -2, -2, -1, -1, 0, -1, -1, 0, 1, 2, 2, 3, 3,
- 0, 1, 2, 4, 5, 6, 6, 5, -1, 0, 2, 3, 5, 6, 5, 3,
- -1, -1, 0, 2, 3, 3, 2, 1, -2, -2, -1, 0, -1, -3, -4, -4,
- 0, 0, -1, -1, -2, -4, -8, -7, 1, 2, 1, 0, -1, -4, -6, -7,
- -2, 4, 1, -6, 0, 3, 0, 0, -2, 5, 1, -7, 0, 3, 0, 0,
- -3, 5, 1, -8, 0, 3, -1, -1, -2, 6, 1, -9, 0, 3, 0, -1,
- -2, 6, 2, -8, 0, 4, 0, -1, -3, 5, 1, -7, 1, 4, 0, 0,
- -2, 4, 1, -7, 0, 4, 1, 0, -1, 4, 1, -6, 0, 3, 1, 0,
- 0, 0, 0, 3, 4, 5, 4, 1, 1, 1, 1, 2, 3, 3, 2, 0,
- 2, 2, 1, 2, 2, 1, -1, -2, 4, 3, 1, 1, 0, -1, -3, -5,
- 5, 3, 1, -1, -2, -3, -4, -6, 5, 3, 0, -2, -3, -5, -6, -7,
- 4, 3, 0, -2, -3, -4, -5, -5, 4, 3, 0, -1, -2, -2, -3, -3,
- 0, 0, 0, 0, -1, -5, -2, 6, 0, 0, 0, 1, -1, -6, -2, 8,
- 0, 0, 0, 2, 0, -6, -3, 9, 0, -1, 0, 2, 0, -7, -2, 10,
- 0, -1, 0, 2, -1, -8, -3, 10, 0, -1, -1, 2, -1, -7, -3, 9,
- 0, -1, 0, 1, -1, -6, -3, 8, 0, 0, 0, 1, 0, -5, -2, 7,
- 2, 3, 3, 2, 1, 0, -1, -1, 3, 4, 3, 2, 1, 0, -1, -2,
- 3, 4, 4, 2, 1, -1, -2, -3, 2, 3, 3, 2, 0, -1, -2, -3,
- -1, 0, 1, 1, 0, -1, -2, -2, -5, -4, -3, -1, 0, 1, 1, 1,
- -8, -8, -5, -1, 1, 3, 4, 3,-10, -9, -5, 0, 3, 5, 6, 5,
- -5, -1, 4, 5, 3, 1, 0, 0, -6, -1, 4, 5, 2, 0, -1, -2,
- -6, -1, 5, 4, 2, -1, -2, -2, -7, -1, 4, 4, 1, -2, -3, -3,
- -6, -1, 5, 4, 1, -2, -3, -3, -5, 0, 4, 4, 1, -1, -2, -2,
- -4, 0, 5, 4, 1, -1, -1, -2, -3, 1, 4, 3, 1, -1, -1, -2,
- -2, -3, -2, 1, 4, 6, 5, 3, -3, -4, -4, 0, 3, 5, 4, 2,
- -3, -5, -5, -1, 2, 4, 3, 1, -4, -6, -4, -1, 2, 4, 2, -1,
- -2, -4, -3, 1, 2, 4, 2, -1, -2, -4, -2, 1, 3, 3, 1, -2,
- -2, -3, -2, 1, 3, 3, 1, -2, -2, -2, -1, 1, 3, 3, 0, -2,
- -4, -4, -3, -2, -1, 2, 5, 7, -4, -4, -3, -3, -2, 1, 5, 7,
- -2, -3, -2, -3, -3, -1, 3, 5, -1, -1, 0, -2, -3, -2, 2, 4,
- 1, 1, 1, -1, -4, -3, 1, 3, 4, 3, 2, -1, -4, -3, -1, 1,
- 6, 4, 3, 0, -3, -3, -2, 0, 6, 5, 3, 1, -2, -3, -2, -1,
- 12, 11, 8, 4, 0, -2, -2, -1, 10, 9, 6, 2, -1, -2, -1, 0,
- 4, 3, 2, 0, -1, -1, 0, 1, -1, -1, -1, -1, -2, 0, 1, 2,
- -3, -5, -4, -2, -2, 0, 2, 3, -5, -5, -4, -2, -1, 0, 1, 2,
- -5, -5, -4, -2, -1, 0, 1, 1, -4, -4, -3, -2, -2, -1, 0, 0,
- 3, 3, 2, -1, -3, -4, -3, -2, 3, 2, 0, -2, -4, -4, -3, -2,
- 2, 2, 1, -1, -3, -5, -4, -3, 3, 3, 3, 1, -2, -3, -3, -3,
- 4, 4, 4, 3, 0, -2, -2, -2, 5, 5, 5, 3, 0, -1, -2, -2,
- 5, 5, 4, 2, -1, -2, -3, -2, 3, 3, 3, 0, -2, -4, -4, -4,
- -1, -1, 4, -2, -2, 6, 2, -5, -1, 0, 4, -2, -3, 6, 2, -6,
- -1, 0, 4, -2, -3, 7, 3, -7, -1, -1, 4, -3, -4, 8, 3, -7,
- 0, -1, 4, -3, -4, 7, 3, -6, -1, -1, 4, -3, -4, 7, 3, -6,
- -1, -1, 3, -3, -4, 6, 3, -6, -1, 0, 3, -2, -3, 6, 3, -5,
- 1, -2, -7, 2, 5, -2, -1, 1, 1, -2, -8, 3, 6, -3, -1, 2,
- 2, -2, -9, 4, 7, -4, -2, 2, 3, -1, -9, 5, 7, -4, -1, 3,
- 3, -1, -9, 4, 7, -4, -2, 2, 3, -1, -7, 4, 6, -4, -2, 1,
- 2, 0, -6, 4, 6, -4, -1, 1, 2, 0, -5, 3, 4, -3, -1, 1,
- -2, 2, 2, 0, 0, -1, -3, -4, -2, 2, 2, 1, 1, 0, -2, -4,
- -2, 2, 2, 2, 2, 1, -1, -2, -3, 2, 3, 3, 4, 2, 0, -2,
- -3, 2, 3, 2, 4, 2, 0, -3, -4, 1, 2, 1, 2, 1, -1, -3,
- -5, 0, 1, 0, 1, 1, -2, -3, -4, 0, 0, 0, 1, 0, -2, -3,
- 0, 0, -1, -2, -2, 2, 7, 8, 0, 0, -1, -3, -2, 1, 6, 7,
- 0, 1, -1, -3, -3, 0, 4, 5, 0, 1, 0, -1, -1, 0, 1, 3,
- 0, 2, 1, 1, 0, -1, 0, 1, -2, 0, 1, 2, 1, 0, -1, -1,
- -5, -2, 0, 1, 1, 0, -3, -3, -6, -4, -1, 1, 1, -1, -3, -4,
- -4, -2, 2, 5, 6, 4, 3, 2, -5, -3, 1, 4, 4, 2, 0, 0,
- -4, -2, 0, 2, 1, -1, -2, -2, -2, -1, 0, 1, 0, -2, -3, -2,
- -2, 0, 0, 0, -1, -1, -2, -1, -2, -1, -1, 0, 0, 0, 1, 2,
- -2, -2, -1, -1, 0, 1, 3, 4, -2, -3, -2, -1, 0, 2, 4, 5,
- 2, 1, -2, -2, -1, 0, 1, 0, 1, 0, -3, -3, -1, 0, 1, 0,
- 0, -1, -3, -3, -1, 1, 1, 1, 0, 0, -3, -1, 1, 2, 3, 3,
- 0, -1, -3, -1, 1, 3, 3, 3, -2, -2, -4, -2, 1, 3, 4, 4,
- -3, -3, -4, -2, 1, 3, 3, 4, -2, -3, -5, -2, 1, 2, 3, 3,
- 4, 5, 3, 4, 4, 4, 4, 5, 3, 3, 1, 0, 0, 0, 0, 1,
- 1, 1, -1, -2, -3, -4, -3, -2, 2, 2, 0, -2, -2, -4, -3, -2,
- 2, 3, 1, -1, -1, -3, -3, -2, 1, 2, 0, 0, -1, -2, -2, -1,
- 0, 1, 0, -1, -1, -3, -2, -1, 1, 1, 0, -1, -1, -2, -2, -2,
- -2, -1, -1, 0, 1, 2, 1, 0, 1, 2, 3, 5, 6, 5, 5, 3,
- 1, 2, 3, 4, 5, 5, 4, 3, -2, -2, -3, -3, -2, -1, 0, 0,
- -3, -3, -4, -5, -4, -3, -2, -1, -1, -1, -2, -2, -2, -1, 0, 0,
- 0, 1, 0, -1, -1, 0, 0, 1, -1, 0, -1, -2, -3, -2, -2, -1,
- 7, 7, 6, 5, 4, 2, -1, -2, 3, 3, 2, 2, 1, 0, -2, -3,
- 0, -1, -1, -1, 0, -1, -2, -2, -1, -3, -2, -1, 0, 0, 0, 1,
- 0, -2, -2, -1, -1, 1, 2, 2, 3, 1, -1, -1, -1, 1, 2, 2,
- 3, 1, -2, -3, -2, -1, 1, 2, 1, -2, -5, -6, -5, -3, -2, 0,
- 0, -1, -2, -3, -1, 0, -2, -2, 0, 0, -1, -1, 0, 1, -1, -2,
- 0, 0, -2, -1, 0, 0, 0, -2, -1, -2, -3, -3, -2, -1, -3, -3,
- -1, -2, -3, -3, -2, -2, -3, -4, 2, 2, 0, 0, 0, 0, -1, -2,
- 5, 5, 3, 2, 2, 2, 0, -1, 8, 8, 6, 5, 4, 4, 2, 1,
- -7, -8, -6, -3, -1, -1, -2, -1, -5, -5, -3, 0, 2, 1, 0, 0,
- -1, -1, 0, 3, 4, 3, 1, 1, 2, 1, 1, 3, 4, 3, 2, 2,
- 3, 2, 0, 2, 3, 2, 1, 2, 4, 2, -1, -1, 0, 1, 1, 1,
- 3, 2, -2, -3, -2, -1, 0, 1, 3, 1, -3, -4, -3, -2, 0, 1,
- -4, -2, -1, 2, 3, 3, 1, 0, -7, -5, -4, -2, 0, 0, -1, -2,
- -6, -5, -5, -4, -2, -2, -2, -3, -1, 0, -1, -1, 0, 0, 0, -1,
- 2, 3, 2, 2, 2, 2, 1, 0, 3, 5, 4, 3, 1, 0, 1, 0,
- 3, 4, 3, 2, 0, -1, -1, -1, 5, 5, 3, 1, 0, -1, -1, -1,
- 1, 1, 0, -1, -3, -5, -6, -4, 1, 1, 0, 0, 0, -3, -3, -1,
- 0, -1, -1, 0, 1, 0, 1, 3, -2, -2, -3, -1, 2, 2, 4, 7,
- -2, -2, -2, 0, 2, 2, 3, 6, -1, 0, 0, 1, 1, 0, 0, 3,
- 0, 3, 3, 3, 1, -2, -3, -1, 1, 3, 4, 3, 0, -3, -5, -4,
- 0, 2, 0, -1, -3, -4, -2, -2, 1, 4, 2, 0, -2, -3, -2, -1,
- 3, 6, 3, 1, -2, -2, 0, -1, 4, 7, 4, 1, -2, -3, -1, 0,
- 3, 6, 3, 0, -3, -3, -1, 0, 1, 3, 0, -1, -3, -2, 1, 1,
- 0, 1, -1, -2, -3, -1, 2, 2, -2, -1, -3, -3, -3, -1, 1, 2,
- 3, 1, -1, 0, 1, 0, 0, 0, 2, -1, -2, -1, 1, 0, -1, -1,
- 1, -1, -2, 0, 1, 0, -2, -3, 0, -2, -1, 1, 3, 1, -3, -5,
- 0, -2, -1, 2, 5, 2, -3, -5, 0, -2, -1, 4, 6, 3, -2, -5,
- 0, -2, 0, 4, 7, 4, -2, -4, 0, -2, 0, 4, 6, 4, -2, -4,
- -2, -2, -3, -4, -3, -2, -1, 0, 1, 1, 0, -1, -1, -1, 0, 1,
- 3, 3, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 1, 0, 0, 1,
- 0, 0, 0, 0, -1, -1, -1, -1, -4, -4, -4, -4, -4, -4, -4, -3,
- -3, -3, -2, -3, -2, -1, -1, 0, 3, 4, 4, 5, 5, 6, 6, 7,
- -1, -2, 7, -2, -4, -1, -1, 0, -1, -2, 9, -1, -4, -1, -1, 0,
- -1, -3, 10, -1, -4, -1, -1, 1, -1, -3, 10, -2, -3, -1, -1, 2,
- -1, -2, 10, -2, -4, -1, -1, 2, -1, -2, 9, -2, -4, -1, -1, 2,
- -1, -2, 8, -2, -4, 0, -1, 1, 0, -2, 7, -2, -3, -1, 0, 2,
- 3, -4, 1, 3, -3, -2, 1, 0, 3, -5, 1, 4, -3, -2, 1, 0,
- 3, -6, 2, 5, -3, -1, 3, 0, 3, -6, 2, 5, -3, -1, 2, 0,
- 3, -6, 1, 5, -4, -2, 3, 0, 3, -6, 1, 5, -3, -2, 2, 0,
- 2, -6, 1, 4, -3, -1, 1, 0, 2, -6, 1, 4, -2, -1, 1, 0,
- 0, 0, 1, 1, 1, 0, 0, 2, 0, -1, 1, 1, 1, 0, 0, 2,
- 0, -1, 0, 0, 0, 0, 0, 2, 0, -1, 0, 0, 0, 0, -1, 0,
- 1, 0, 1, 0, 0, -1, -2, -1, 3, 1, 1, 0, 0, -2, -4, -3,
- 5, 3, 2, 1, 0, -3, -5, -4, 5, 4, 2, 0, -1, -4, -5, -5,
- 1, 0, -1, -2, -2, -3, -6, -9, 2, 0, -1, -1, 0, 0, -3, -6,
- 1, 0, 0, -1, 0, 0, -2, -5, 2, 1, 1, 1, 1, 2, -1, -3,
- 1, 1, 2, 1, 2, 2, 1, -1, 1, 1, 2, 1, 1, 1, 1, 1,
- 0, 0, 2, 1, 0, 0, 2, 2, 0, 1, 2, 2, 0, 0, 2, 2,
- -4, -3, 0, 1, 4, 6, 4, 3, -3, -2, 0, 0, 2, 4, 1, 0,
- -1, -1, 0, 0, 1, 1, -2, -3, 1, 1, 1, 0, 1, 1, -3, -5,
- 1, 1, 1, 0, 1, 1, -3, -5, -1, 0, 0, -1, 1, 1, -2, -4,
- -1, 0, 0, -1, 1, 2, 0, -2, -1, 0, 0, 0, 2, 3, 1, 0,
- -1, 0, 3, 4, 0, -4, -5, -5, 0, 0, 4, 5, 2, -2, -3, -2,
- 0, -1, 2, 4, 2, -1, -1, 0, 0, -2, -1, 1, 0, -2, 0, 1,
- 1, -2, -2, 0, 0, -1, -1, 1, 1, -2, -3, 0, 1, 0, -1, 0,
- 1, -2, -2, 1, 3, 1, 0, 0, 1, -2, -1, 2, 4, 2, 0, 0,
- 1, 2, 3, 2, 0, 2, 2, 1, -1, 0, 1, 0, -3, 1, 1, 1,
- -1, 0, 0, -2, -4, 0, 2, 1, -1, 2, 2, -1, -5, 0, 2, 1,
- -1, 3, 4, -1, -5, 0, 2, 1, -2, 2, 4, 0, -4, -1, 0, 0,
- -4, 0, 2, 0, -4, -2, 0, 0, -5, -1, 2, 1, -2, 1, 3, 2,
- 1, 0, 1, 0, 1, 2, -1, -2, 2, 0, -1, -2, 1, 3, 0, -1,
- 3, 0, -2, -4, 0, 3, 1, 0, 5, 1, -3, -5, -2, 2, 1, 1,
- 6, 1, -2, -5, -2, 1, 0, 1, 5, 1, -1, -5, -2, 0, -1, 0,
- 3, 0, -2, -4, -2, 0, -1, 0, 1, -1, 0, -2, 0, 1, 0, 1,
- 1, 1, 2, 3, 2, 1, 1, 2, -1, -1, 0, 1, 1, 0, 1, 1,
- -4, -3, 0, 0, 1, 1, 1, 2, -4, -3, 0, 2, 2, 2, 3, 2,
- -5, -4, 0, 1, 1, 1, 1, 2, -5, -4, -1, -1, -2, -2, -1, 0,
- -3, -2, 0, 0, -2, -3, -2, -1, 2, 3, 4, 4, 2, 0, 0, 0,
- -4, -2, 0, 1, 0, 0, 0, 0, -3, -1, 1, 1, 0, 0, 0, 0,
- -2, 0, 2, 2, 0, 0, 0, 2, -1, 1, 2, 1, -1, 0, 3, 5,
- 0, 2, 1, -1, -2, 0, 5, 6, 0, 1, 0, -3, -3, 0, 4, 6,
- 1, 1, -2, -4, -4, -3, 1, 2, 1, 0, -2, -4, -5, -4, -2, 0,
- -1, -3, -3, -3, -3, -2, -1, -1, 3, 2, 1, 0, 0, 1, 1, 1,
- 5, 4, 3, 2, 1, 1, 2, 2, 2, 1, 0, -2, -2, -2, -1, -1,
- 0, 0, 0, -1, -2, -2, -2, -2, 0, 1, 3, 3, 2, 1, -1, -1,
- 0, 1, 3, 4, 3, 2, 1, -1, -4, -3, -1, 1, 0, -2, -3, -3,
- -3, -4, -7, -8, -7, -4, -1, 2, 0, -1, -3, -4, -4, -2, 0, 2,
- 1, 0, 0, -1, -3, -2, 0, 2, 2, 1, 1, 0, -1, -1, 0, 2,
- 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 0, 0, 1, 2, 3, 3, 2, 2, 0, 0, 1, 3, 4, 4, 3, 2,
- 3, 3, 3, 0, -1, 0, 1, 2, 1, 1, 1, -1, -2, -1, -1, 1,
- -2, -2, -1, -3, -3, -2, -2, 0, -4, -4, -2, -2, -2, -2, -3, 0,
- -4, -4, -1, 1, 1, 0, -1, 2, -3, -1, 2, 3, 4, 3, 3, 5,
- -2, 0, 2, 3, 3, 3, 3, 3, -2, -2, 0, 0, 0, 0, 0, 1,
- 0, 2, 1, -1, -3, -1, 3, -2, -1, 0, -1, -1, -3, 0, 4, -2,
- -2, -2, -2, -2, -2, 1, 5, -2, -3, -2, -3, -1, -2, 1, 4, -3,
- -2, 0, -1, 0, -1, 0, 3, -5, 1, 2, 1, 2, 0, 0, 2, -5,
- 2, 4, 2, 3, 1, 1, 3, -3, 1, 2, 1, 1, 0, 1, 4, -2,
- 4, -3, -4, -1, 3, 3, 1, 3, 4, -4, -4, -1, 3, 2, 0, 2,
- 4, -3, -4, 0, 2, 2, -1, 1, 4, -3, -2, 1, 2, 1, -2, 0,
- 2, -4, -2, 1, 2, 0, -3, 0, 2, -3, -2, 0, 1, 0, -2, 2,
- 3, -1, -1, 0, 0, 0, 0, 3, 2, -2, -2, -2, -1, -1, -1, 2,
- 2, 2, 3, 4, 3, 1, 0, -1, 1, 0, 1, 2, 1, -1, -2, -2,
- 2, 1, 2, 1, 1, 0, -1, -1, 4, 3, 4, 3, 2, 1, 1, 1,
- 3, 2, 2, 2, 1, 1, 1, 1, -1, -2, -1, 0, -1, -1, -1, -1,
- -3, -3, -2, -1, -2, -2, -2, -2, -4, -4, -3, -3, -4, -4, -3, -3,
- 2, 1, -1, -3, -4, -2, 3, 4, 2, 2, 1, -1, -3, -2, 1, 2,
- 1, 2, 3, 3, 0, -2, -1, -2, -1, 0, 2, 4, 2, 0, -1, -3,
- -2, -2, 0, 3, 3, 2, 0, -3, 0, -2, -3, -1, 1, 2, 2, -1,
- 3, -1, -4, -5, -3, 0, 2, 0, 6, 3, -2, -6, -5, 0, 3, 1,
- -2, 3, -2, 0, 3, -2, -2, 1, -3, 4, -3, 0, 3, -2, -1, 2,
- -3, 5, -3, 0, 4, -2, -1, 2, -2, 4, -4, -1, 3, -3, -2, 2,
- -3, 4, -3, 0, 3, -3, -1, 2, -2, 5, -2, 0, 3, -3, -1, 2,
- -2, 4, -3, 1, 3, -2, -1, 2, -2, 3, -2, 1, 3, -2, 0, 2,
- 1, 0, 0, -1, 1, 2, -4, -1, 2, 0, 0, -1, 1, 2, -4, -2,
- 1, 1, 1, -1, 2, 4, -2, 0, 0, -1, 1, -1, 2, 5, -1, 1,
- 0, -1, 0, -2, 1, 5, -1, 1, 0, -1, -1, -2, 0, 3, -3, -1,
- 1, 1, 0, -2, 0, 3, -3, -1, 1, 1, 0, -3, 0, 3, -2, 0,
- 1, 0, -1, 1, 1, 2, 4, 5, 1, 0, -1, 1, 1, 1, 5, 7,
- 0, 0, -2, -1, -1, 0, 3, 5, 0, -1, -2, -1, -1, -1, 2, 3,
- 0, -1, -3, -1, -1, -1, 1, 2, -1, -2, -4, -2, -2, -2, 0, 0,
- -1, -2, -2, -1, -2, -2, 0, 0, 0, -1, -1, 0, -1, -1, 0, 0,
- 3, 3, 0, -1, -1, 1, 4, 4, 2, 3, 0, -2, -2, 0, 1, 1,
- 2, 3, 1, -1, -1, 0, 1, 0, 1, 2, 0, -1, -1, -1, 0, -2,
- 0, 1, 0, -1, -2, -1, 0, -2, 0, 1, 0, -1, -2, -1, 1, 0,
- 1, 1, -1, -3, -4, -3, 1, 3, 1, 2, -1, -3, -5, -4, 1, 3,
- -3, -2, 0, 1, 1, 1, 0, -2, 0, 1, 1, 1, 0, 0, -1, -3,
- 1, 2, 1, 1, 0, -1, -1, -2, 0, -1, -3, -1, -1, -1, 0, -1,
- 0, -3, -6, -3, -2, -1, 1, 1, 2, -1, -4, -3, -2, 0, 2, 2,
- 5, 4, 1, 1, 0, 1, 3, 2, 5, 4, 2, 1, 0, -1, 0, 1,
- -2, 0, -2, -5, -6, -3, 0, 0, -2, 0, 1, 0, -1, 1, 2, 2,
- -2, 0, 1, 3, 2, 2, 2, 1, -2, 0, 2, 4, 3, 2, 1, 1,
- -2, 0, 2, 3, 2, 0, -1, 0, -3, -1, 1, 1, 0, -1, -1, 1,
- -4, -1, 1, 0, -1, -2, 0, 2, -4, -1, 0, -1, -1, -2, 1, 4,
- -3, 0, 0, -1, 1, 1, 1, 0, -3, 1, 0, -1, 0, 0, -1, -1,
- -1, 3, 3, 0, 1, 0, 0, 1, -3, 2, 2, -2, -1, 0, 0, 1,
- -5, 0, 0, -2, -1, 1, 0, 2, -7, -2, 1, 0, 1, 2, 2, 2,
- -5, 0, 3, 2, 3, 3, 2, 2, -3, 2, 4, 1, 0, 0, -2, -3,
- 5, 2, -2, -2, 0, -1, -1, -1, 2, -1, -4, -3, -1, -2, -1, -1,
- 0, -2, -2, 1, 2, -1, 0, 1, -1, -2, -1, 3, 3, -1, 0, 2,
- 1, 0, 0, 3, 3, -2, -1, 2, 2, 1, 1, 3, 2, -2, -2, 0,
- 1, 0, -1, 1, 1, -3, -3, -2, 1, 0, 1, 2, 3, 0, 0, 0,
- -4, -5, -3, 0, 1, -1, -2, -1, -2, -3, -1, 1, 2, 0, 0, 0,
- 1, 1, 2, 1, 2, 1, 1, 1, 3, 4, 3, 1, 0, -2, -1, -1,
- 3, 3, 2, 0, -2, -3, -3, -2, 1, 1, 0, -1, -2, -4, -2, -2,
- 2, 1, 0, 0, 0, -1, 0, 1, 2, 1, 1, 1, 1, 1, 1, 3,
- 0, 0, 0, -1, -2, -1, 1, 0, -2, -1, -1, -2, -3, -2, 0, 0,
- -1, 0, 0, -1, -2, 0, 1, 1, 1, 1, 0, -1, -1, 1, 3, 1,
- 2, 2, 0, -2, -1, 2, 3, 0, 3, 1, -1, -1, 1, 4, 2, -2,
- 2, 0, -3, -1, 3, 5, 0, -5, 1, -1, -2, 0, 3, 3, -1, -6,
- -1, 0, 3, 4, 2, 0, 1, 2, -2, -1, 0, 1, -1, -2, 0, 1,
- -2, -3, -2, -3, -6, -7, -6, -3, 2, 2, 3, 1, -1, -2, -3, -2,
- 2, 2, 3, 1, 0, 0, 0, 0, 2, 1, 1, 0, 1, 1, 0, 1,
- 1, 0, 0, 0, 0, 1, 1, 2, 1, 0, -1, 0, 0, 2, 2, 1,
- 1, 1, 3, 1, -1, -1, -1, 1, -2, -1, 0, 0, -2, -2, -1, 2,
- -2, -2, 1, 1, 1, 0, 1, 3, -2, -2, 0, -1, 0, -1, 0, 2,
- 0, 0, 1, 0, -1, -1, -2, 1, 3, 2, 2, 1, 0, -2, -2, 1,
- 5, 3, 3, 2, 1, 1, 1, 4, 0, -3, -4, -5, -4, -3, -1, 1,
- -6, -4, -1, 2, 2, 0, 0, -1, -4, -2, 1, 3, 3, 2, 2, 0,
- -3, -2, -1, 2, 3, 3, 2, 0, -3, -2, -2, 1, 2, 1, 1, -1,
- -2, -2, -2, 0, 2, 2, 1, -1, -1, -1, -1, 1, 2, 3, 2, 0,
- -1, -1, -2, 1, 2, 2, 2, -1, 0, -1, -2, 0, 2, 1, 0, -1,
- 6, 4, 2, 1, 0, 0, 0, 1, 4, 2, -1, -2, -2, -2, -1, -1,
- 2, 1, -1, -2, -2, -2, -2, -1, 2, 2, 0, -2, -2, -2, -1, 0,
- 0, 0, -1, -2, -2, -1, 0, 1, -3, -3, -2, -1, -1, -2, -1, 0,
- -3, -2, 2, 3, 2, 0, -1, -2, -2, 0, 4, 5, 5, 2, 0, -1,
- 5, 4, 2, 0, -1, -2, -1, -1, 4, 3, 2, 1, 0, -1, 0, -1,
- 1, 1, 0, 1, 1, 0, 1, -1, -2, -1, -1, 0, 0, -2, -2, -3,
- -1, 0, 0, 0, -1, -3, -3, -5, 0, 1, 1, -1, -1, -2, -2, -3,
- -1, -1, -1, -2, -1, 1, 3, 1, -1, -2, -2, -1, 2, 5, 6, 5,
- -3, -3, -2, 1, 1, -2, -1, -1, 1, 2, 3, 4, 1, -3, -1, -3,
- 3, 2, 0, 1, -1, -3, -1, -3, 1, 0, -1, 0, -1, -1, 1, 0,
- 1, 1, 0, 1, 2, 2, 5, 3, 1, 1, 1, 2, 2, 2, 3, 0,
- -3, -1, -2, -2, -3, -3, -1, -3, -1, 1, 1, 0, -1, -1, 0, -2,
- 2, 0, -2, -2, 2, 4, 1, -2, 1, 0, -2, -1, 3, 5, 2, -1,
- -1, -2, -3, -2, 1, 3, 1, -2, -1, -2, -1, -1, 0, 2, 1, -1,
- 0, 0, 1, 1, 1, 2, 2, 0, 0, 1, 4, 4, 2, 2, 3, 1,
- -2, -1, 2, 1, -2, -3, -2, -3, -1, 0, 1, 0, -3, -4, -4, -5,
- 4, 0, -3, -4, -4, -4, -2, -1, 5, 0, -1, 0, -1, -3, -2, -1,
- 4, 0, 0, 1, 1, 0, 0, 0, 0, -3, -2, -1, 0, 0, 1, 0,
- 0, -2, 0, 0, 1, 1, 2, 1, 2, 0, 0, 0, 1, 1, 1, 0,
- 2, 0, -1, -1, 1, 1, 1, 0, 1, -1, -2, -2, 0, 2, 2, 2,
- -3, -5, -2, 0, -1, -3, -3, 0, 0, -2, 0, 2, 2, 0, 0, 3,
- 2, -1, -2, 0, 0, -1, -1, 2, 5, 2, -1, -1, -1, -1, -1, 2,
- 5, 2, 0, -1, -1, 0, -1, 2, 2, 1, 0, 0, 0, 1, 0, 2,
- -1, -1, 1, 1, 2, 2, 1, 2, -3, -2, 0, 0, 0, 0, -2, -1,
- 0, 3, 2, 0, -2, -3, -3, -3, 0, 3, 3, 1, 0, 0, 1, 2,
- -1, 0, -1, -2, -1, -1, 1, 3, -1, 0, -1, -2, -1, -1, 0, 2,
- -1, 0, -1, -2, 0, 0, -1, 2, -1, 0, -1, -2, -1, -1, -2, 1,
- 0, 1, 0, -3, -1, -1, -1, 2, 5, 5, 2, -1, -1, -1, 1, 3,
- 0, 0, 1, -1, -3, -2, 0, 2, 1, 1, 3, 0, -2, -2, 0, 1,
- 1, 1, 3, 1, 0, 0, -1, -1, 0, -1, 2, 1, 1, 0, -1, -3,
- -1, -2, 1, 1, 1, 0, -2, -4, -1, 0, 2, 1, 1, 0, -1, -3,
- 1, 1, 3, 2, 1, 0, -2, -3, 2, 2, 4, 2, 1, -1, -2, -4,
- 1, 2, 2, 2, 0, -2, 0, 2, -1, -1, -2, -3, -4, -5, -3, 1,
- 0, 1, 1, 0, -1, -1, -1, 1, 0, 1, 1, 1, 0, 0, 0, 2,
- 0, 1, 1, 2, 1, 1, 1, 2, -1, -1, 0, 2, 2, 2, 2, 3,
- -2, -4, -4, -1, -2, -2, -2, 0, 1, 0, 0, 1, 0, 0, 0, 1,
- 0, -1, -3, -2, 0, 2, 2, 1, 0, -1, -2, -3, 0, 1, 1, 2,
- 1, 0, -2, -3, -1, 0, 0, 1, -1, 0, -1, -2, 0, 0, -1, 0,
- -1, 1, 1, 0, 2, 2, 0, 0, 0, 2, 3, 1, 3, 5, 3, 2,
- -1, 1, 1, -2, 0, 3, 1, 1, -1, 0, 0, -4, -4, -1, -1, -1,
- -1, 1, 1, 0, 1, 2, 1, 2, -3, 0, 1, 0, 1, 1, 0, 2,
- -5, -3, -1, -1, 0, 1, 0, 1, -4, -3, -2, -3, -2, -1, -1, 0,
- 0, 0, -1, -2, -2, -2, -2, 0, 3, 4, 2, 0, 0, 0, 0, 1,
- 2, 1, 0, 0, 0, 0, -1, 0, 0, 1, 2, 3, 4, 4, 3, 2,
- -1, 4, 7, 4, 0, 0, 0, 0, -1, 4, 6, 3, 0, 1, 1, 1,
- 0, 3, 4, 0, -1, 0, 0, 1, 0, 1, 1, -2, -1, 0, -1, -1,
- -1, 0, -1, -1, -1, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0,
- -1, -3, -3, 0, 1, -1, -2, -1, -3, -4, -4, -2, -1, -2, -2, -1,
- 2, 2, 1, 0, 1, 1, 0, -3, -2, -1, 0, 0, 1, 1, 0, -3,
- -2, -1, 0, 1, 2, 1, 1, -2, 1, 2, 2, 2, 3, 3, 2, -1,
- 1, 2, 1, 0, 1, 1, 2, -1, 0, 1, -2, -4, -2, 0, 1, -1,
- 1, 1, -1, -3, -2, 0, -1, -3, 1, 2, 0, -1, 0, 1, -1, -4,
- -1, -1, -2, -2, 0, 3, 4, 3, 1, 1, -1, -3, -2, 0, 0, 0,
- 2, 2, 2, 2, 2, 1, -1, -1, 1, 1, 1, 3, 3, 0, -2, -2,
- 0, -1, -1, -1, 0, -2, -1, -1, -1, -3, -4, -3, -2, -2, 0, 2,
- -1, -1, 0, 1, 2, 2, 3, 5, -2, -1, -1, 0, 0, 0, 0, 1,
- -2, -3, 2, 0, 0, 1, 1, -1, -1, -4, 1, -2, -1, 2, 2, 0,
- 1, -4, 0, -2, -2, 1, 1, -1, 2, -3, 1, -1, -1, 1, 1, -1,
- 3, -2, 3, 1, 0, 1, 1, -1, 1, -3, 2, 1, 0, 1, 0, -1,
- -1, -5, 1, 0, -1, 0, 1, 1, 0, -3, 3, 3, 1, 2, 3, 3,
- 0, -1, -2, 1, 5, 5, 2, -1, 1, -1, -2, -1, 1, 1, -2, -5,
- 1, 1, -1, -2, -1, -1, -1, -3, 1, 1, -1, -1, -1, 2, 4, 3,
- -1, -1, -1, -1, -1, 0, 4, 3, -1, -1, 0, 1, -1, -3, -1, -1,
- 0, 0, 0, 2, 2, 0, 0, -1, 0, -2, -3, 0, 1, 1, 3, 2,
- 2, 3, 2, 1, 0, 0, -2, -2, 2, 3, 0, 1, 1, 3, 3, 2,
- 0, 0, -3, -1, -1, 2, 2, 3, -2, -2, -3, 1, 1, 2, 1, 1,
- -2, -1, -2, 2, 1, 1, -1, -2, 0, 1, 0, 2, 0, 0, -2, -2,
- 0, 1, 0, 2, 0, 0, -2, -2, -3, -2, -2, 0, -1, -2, -2, -3,
- 0, 1, -1, 3, -1, 1, 3, -1, 0, 1, -1, 3, -1, -1, 2, -3,
- 1, 1, -2, 3, -1, -3, 0, -3, 2, 2, -2, 3, 0, -2, 1, -2,
- 1, 1, -3, 3, -1, -2, 1, -3, 1, 1, -3, 3, 0, -1, 1, -2,
- 1, 2, -1, 4, 0, -1, 1, -2, 0, 1, -1, 3, -1, -3, 0, -3,
- -3, -3, -1, 1, 2, 1, -1, -2, -2, -2, 0, 2, 1, 0, -2, -2,
- -3, -2, 1, 2, 1, -1, -2, -1, -3, -2, 2, 4, 0, -2, -2, 1,
- -3, -1, 2, 4, 0, -2, -2, 2, -1, 1, 4, 3, -1, -3, -2, 2,
- 0, 2, 4, 2, -1, -2, -1, 2, 0, 1, 2, 0, -1, 0, 1, 3,
- 3, 0, -5, 1, 4, 0, 0, 1, 1, -2, -5, 2, 5, -1, -2, 1,
- -1, 0, 0, 3, 3, 1, 0, -1, -2, 3, 4, -2, -3, -1, 0, -2,
- -3, 3, 5, -3, -3, 0, 0, -2, -1, 3, 2, -2, -2, 2, 2, -1,
- 2, 0, 0, -1, 0, 0, 0, 0, 0, -3, -2, 1, 3, 0, -2, -2
-};
-
-/* list of codebooks for inter-coded vectors */
-static const int8_t* const svq1_inter_codebooks[6] = {
- svq1_inter_codebook_4x2, svq1_inter_codebook_4x4,
- svq1_inter_codebook_8x4, svq1_inter_codebook_8x8,
- NULL, NULL,
-};
-
-static const int8_t svq1_inter_codebook_sum[4][16*6] = {
- {
- -1, 1, -2, 0, 1, -1, -1, -1, -2, -1, 1, -1, -1, 0, -1, -1,
- 0, -1, -1, -1, -1, 0, -1, 0, 0, 0, -3, 1, -1, 0, 1, -1,
- 1, -1, 2, 2, 1, 1, 2, 0, 0, 0, -1, 1, 1, 0, 0, 0,
- 1, -1, 0, 1, -1, 1, 1, 0, 1, 0, -1, 1, 1, 0, 0, 0,
- -2, 0, 0, -2, 0, 0, -2, 0, -2, -1, -2, -1, 0, 0, -1, 0,
- 1, 0, 1, -1, 2, 2, 1, 2, 2, 1, 0, 1, 1, 0, 1, 1,
- },{
- -2, 1, -1, -1, 1, 0, 1, -1, -1, -1, 1, -1, 0, -1, 0, -1,
- 0, 0, 0, -2, 0, 1, 0, -1, -1, 0, 2, -3, 1, -2, 3, -1,
- 2, 0, 2, 1, 1, -1, 1, 1, 0, 0, 1, 1, 2, -2, 1, 0,
- -2, -1, 2, -2, -2, 0, -3, 0, -1, 0, -1, 0, -1, 0, -2, -3,
- 1, -2, -2, -1, 1, -1, -1, 1, -1, 1, 1, 0, -2, 0, 1, 1,
- 1, 1, 2, 1, 0, 0, -1, 0, 0, 1, 0, 1, -1, 1, 0, 2,
- },{
- 0, 0, 0, -3, 1, 1, 1, -3, 0, -1, 0, -3, 1, -3, 0, -2,
- 1, 2, -1, -3, 0, -3, 1, -1, 0, -1, 0, 0, 1, 2, 1, 1,
- -1, 2, -3, 3, 1, 0, -5, 1, 0, -1, -3, 1, 0, 2, 0, -3,
- 4, 2, 0, -2, 1, -2, 3, -2, 1, 1, 0, -1, 2, 5, 3, 1,
- -1, 0, 2, -3, -2, 0, 0, -2, 2, -3, -1, -1, 2, 1, 0, -2,
- 3, -1, 1, -1, 2, 4, 0, 1, 0, 1, 0, -1, -3, -2, -1, 0,
- },{
- 0, 2, -1, -1, 2, -4, -2, 3, 0, -1, -5, 1, 0, 1, 0, 6,
- -2, 2, 0, 1, 1, -1, -1, -2, 1, -2, -1, 0, 2, -2, -2, -1,
- -4, 2, -1, -3, -1, -2, 2, -1, 2, -1, 2, 0, 3, -3, -3, 0,
- -3, 0, 0, -2, 4, -4, 0, -1, 4, 0, -2, -2, 3, -2, 0, 4,
- 5, 0, 1, 0, -3, 3, 3, 2, 0, 0, 1, 2, -5, -2, -3, 0,
- -3, 2, -2, 2, -2, 4, 7, -3, 4, 2, 3, 2, -1, 0, -3, 1,
- }
-};
-
-/* 6x16-entry codebook for intra-coded 4x2 vectors */
-static const int8_t svq1_intra_codebook_4x2[768] = {
- 12, 13, 13, 11, -7,-10,-15,-17,-16,-15,-12,-10, 11, 15, 15, 12,
- 2, 17, 20, 15,-45,-24, 2, 13, 21, 20, -6,-36, 12, 16, -1,-27,
- -18,-21, 10, 45,-11,-20, -7, 21, 43, -8,-28, 0, 33,-16,-28, 3,
- -12,-18,-18, -6,-20,-10, 28, 55, -5,-18,-21,-18, 56, 30, -6,-20,
- -34, 27, 29,-22,-30, 29, 26,-25, 30, 34, 33, 26,-25,-31,-35,-33,
- -31,-35,-36,-32, 29, 36, 37, 31,-71,-12, 38, 34,-63, -1, 42, 33,
- 58, 37,-31,-60, 55, 34,-33,-61,-57,-57, 22, 93,-57,-58, 21, 93,
- 59, 69, 70, 62,-63,-68,-68,-60,-64,-71,-71,-64, 63, 73, 72, 62,
- -2, 0, 7, 15,-11,-10, -3, 5, -5, -8,-10,-10, 1, 9, 14, 9,
- 15, 8, -4,-11, 12, 2,-11,-12, -8, 0, 19, 28, 4, -1,-15,-26,
- -15, 27, 2,-14,-14, 22, 1, -9, -4, -6,-13,-10, -6,-14, 6, 47,
- -35,-20, 6, 23, 6, 9, 6, 4, -6, 2, 23,-22, -7, 4, 28,-21,
- 20,-22, -2, 6, 22,-28, -5, 8,-10,-18,-16,-12, 36, 19, 2, -1,
- -3, 0, 4, 8,-45,-10, 23, 23, 40, 15,-20,-35, -4, -1, 4, 1,
- 9, -5,-33, 24, 8, 3,-26, 19, -1, 4, 6, -3, 32, 25,-13,-49,
- 24, 24, 15, 7,-17,-27,-19, -7,-47, 0, 39, 24,-21, -6, 7, 4,
- -1, 0,-10,-13, 1, 1, 5, 16, 20, 5, -3, -9, -1, -4, -2, -6,
- -17, -7, 1, 4, 12, 7, 0, 0, 3, 0, 12, 11, -3, 1, 0,-23,
- 4, 17, -6, 0, 6, 3,-25, 0,-17, 10, 8, 5,-14, 4, 1, 4,
- 13, 10, 4, 2,-23, -9, 1, 2, 3, -3, 1, 7, 1,-23, -7, 20,
- -7,-18, 2, 12, -5, -4, 10, 9, 4, 10, 7,-24, 6, 3, 4,-10,
- 22,-14,-22, 6, 0, 5, 5, -1, -4, 3,-11, -4, -7, 31, 7,-14,
- -5,-16, -1, 42, -4, -2, -9, -5, 5, -8, -6, -3, 42, -4,-21, -5,
- -18, 12, 20,-12, 13,-13,-10, 7, -8, -9, -2,-18,-16, 6, 40, 8,
- 10, -1, 0, 4, -3, 4, -1,-13, -2, 6, 1,-15, 5, 3, 1, 2,
- -4, -2, 1, 3, 15, 0, -9, -4, -3, -4, -4, -4, -3, 5, 16, -3,
- 2, 13, 3, 4, -3, -8,-10, 0, -6, -2, -4, -1, -2, -3, -6, 23,
- 6, -6, 7, 1, 4,-18, 5, 1, -1, 1,-15, 14, -5, 6, -4, 4,
- 2, 2, 2, 6,-24, 2, 7, 3,-26, 0, 3, 3, 5, 7, 1, 6,
- 14, -2,-18, -3, 7, 5, -4, 2, -6, 3, 32, 1, -6, -6, -6,-12,
- 5,-36, 7, 6, 9, -1, 11, 0, 4, 4, 5, 3, 4, 15, 3,-38,
- 10, 23, -5,-42, 0, 4, 4, 4, 23, 17, -6,-13,-13,-37, 1, 29,
- 5,-14, -1, 1, 5, 0, 3, 1, 0, 4, -5, 2, 8, 0, 0,-10,
- 4, 7, -2, -3,-10, 3, 1, 1,-12, -1, 13, 3, 0, -1, 1, -3,
- 0, -1, 3, 1, -6, -9, 3, 9, -6, 1, -4, -6, 8, -1, 0, 8,
- -3, -3, 0, 18, -5, -1, -4, -1, -8, -2, 3, -4, 0, 17, -1, -5,
- 5, -2, 9,-10, 1, -5, 6, -5, 4, 2, 2, 3, 10,-14, -8, 1,
- -1, -2,-18, -1, -1, 20, 1, 2, -1, 1, -9, 1, -1, -9, 22, -4,
- 6, -4, 8, -3, -1, 7,-19, 5, -7, 31, -4, -4, -6, 0, -5, -5,
- -7, -8,-19, -4, 1, 1, 4, 32, 38, -1, -8, 4, -7, -8, -6,-12,
- -1, 0, -7, 1, -1, 9, -1, 0, 9, -1, -1, 0, 2, -6, 1, -3,
- -12, 0, 2, 1, 1, 1, 8, 0, 9, 1, 0, 2, -2, 1,-11, 0,
- 0, 8, 2,-10, -1, 2, -1, 0, -2, -4, 0, -5, -2, -1, -1, 14,
- -3, 7, -1, 5, 0,-10, 1, 1, -1, -5, 14, -1, -2, 1, -3, -2,
- -6, 0, 0, 6, 2, 3, -9, 4, 4, -5, -1, -1, -7, 3, 8, -1,
- 2, -4, -1,-11, 11, 2, 1, 0, -1, 2, 3, 9, 0, 2, 0,-15,
- 3, 5,-20, 3, 3, -1, 3, 3, 1, -1, 16, 1, 2,-29, 9, 2,
- -13, -6, -1, -3, 36, -1, -8, -3, 2, 5, 4, 2,-37, 9, 11, 3
-};
-
-/* 6x16-entry codebook for intra-coded 4x4 vectors */
-static const int8_t svq1_intra_codebook_4x4[1536] = {
- -11, -3, 3, 6,-10, -1, 5, 7, -9, -1, 6, 7, -9, -1, 4, 6,
- 5, 7, 0,-14, 6, 9, 2,-15, 6, 9, 2,-15, 4, 6, 0,-14,
- 16, 3, -5, -6, 16, 1, -8, -8, 14, -1, -9, -9, 12, 0, -8, -8,
- 8, 12, 16, 17, -2, 2, 6, 9,-10, -8, -4, 0,-15,-14,-11, -7,
- -7,-10, -2, 16, -7,-11, -3, 18, -7,-11, -1, 20, -6, -8, 1, 19,
- -9,-13,-16,-17, 2, -2, -7, -9, 11, 8, 4, -1, 16, 15, 11, 7,
- -22, -2, 13, 15,-24, -2, 14, 16,-25, -4, 13, 15,-25, -6, 10, 13,
- 26, 26, 22, 16, 17, 15, 9, 3, -2, -6,-11,-14,-20,-25,-28,-28,
- -27,-27,-25,-21,-16,-15,-11, -7, 3, 8, 12, 13, 23, 28, 31, 30,
- 20, 16, -7,-33, 22, 19, -6,-35, 22, 19, -6,-34, 20, 17, -6,-32,
- -20,-20, 2, 38,-21,-22, 2, 40,-21,-22, 2, 40,-20,-20, 3, 38,
- -47, -4, 24, 26,-50, -3, 26, 27,-50, -3, 26, 27,-47, -4, 24, 26,
- 45, 6,-23,-27, 48, 5,-25,-28, 48, 5,-26,-28, 44, 6,-24,-27,
- -30,-36,-10, 76,-31,-37,-11, 78,-31,-37,-11, 78,-31,-36,-10, 77,
- -53,-32, 35, 52,-54,-34, 36, 52,-54,-34, 36, 52,-53,-33, 34, 51,
- -93,-34, 62, 65,-93,-34, 62, 66,-93,-34, 62, 65,-93,-34, 60, 64,
- -7, 0, 2, 2, -8, -1, 3, 3, -8, 0, 4, 5, -6, 1, 5, 5,
- 3, 7, 11, 11, 2, 2, 3, 3, 1, -2, -6, -7, 1, -5,-11,-13,
- 3, -2, -4, -3, 7, 0, -5, -5, 12, 4, -5, -7, 14, 6, -4, -7,
- 18, 14, 3, -2, 6, 4, 0, -3, -8, -5, -2, 0,-16,-11, -2, 2,
- -8, -6, 7, 18, -7, -8, 2, 13, -4, -6, -2, 6, 0, -4, -3, 1,
- 1, -3,-13,-18, 0, -1, -5, -7, -1, 1, 6, 7, -2, 4, 15, 17,
- -15,-14, -7, -2, -6, -5, -1, 0, 6, 6, 3, 1, 15, 13, 6, 1,
- 2, -2,-11, 10, 2, -1,-12, 11, 3, -1,-12, 11, 2, -2,-11, 11,
- -9, 14, -1, -5, -9, 15, -2, -5, -8, 16, -2, -5, -7, 15, -1, -4,
- 2, 6, 8, 8, -2, 3, 9, 12,-11, -5, 4, 10,-19,-16, -8, 0,
- 14, 8, -7,-15, 12, 7, -7,-14, 8, 5, -4, -9, 5, 3, -1, -4,
- 12,-14, -2, 2, 13,-15, -1, 3, 14,-15, -1, 3, 13,-14, -1, 3,
- 0, 6, 10,-13, 0, 6, 10,-15, 0, 7, 9,-17, 1, 6, 8,-16,
- -8, -5, 15, -2, -8, -6, 17, -2, -8, -6, 16, -3, -8, -5, 15, -2,
- -9,-11,-11,-10, 9, 10, 9, 8, 8, 10, 10, 9, -8, -9, -8, -7,
- 9, 10, 9, 7, -8,-10,-10,-10, -7,-10,-11,-11, 11, 12, 11, 8,
- 0, 10, 7, 0, 0, 7, 0, -6, 0, 2, -5, -6, -2, -1, -4, -1,
- 5, 0, -6, -9, 2, 2, 2, 1, -2, 0, 5, 7, -6, -5, 1, 4,
- 3, -8, 2, -1, 4, -9, 3, 0, 5, -7, 3, 0, 7, -5, 3, 0,
- -5, -3, 2, 9, -6, -3, 1, 8, -6, -3, 1, 7, -5, -2, 0, 4,
- 13, 8, 3, 1, -3, -5, -4, -1, -8, -7, -3, 0, -1, 1, 3, 2,
- 3, 2, -5,-12, 4, 3, -2, -9, 3, 4, 1, -4, 3, 5, 4, -1,
- -9, -8, -4, 0, 8, 6, 2, 0, 10, 8, 3, 0, -6, -5, -3, -1,
- -3, -9,-12, -5, 0, -3, -5, 0, 2, 3, 2, 4, 5, 8, 7, 6,
- -1, -2, 5, 12, -1, -1, 5, 9, 2, 1, -1, -2, 2, -1,-11,-17,
- -7, 3, 3, -1, -9, 3, 4, -1,-10, 4, 6, -1, -9, 5, 7, 0,
- -18, -7, 2, 2, -8, 1, 5, 3, 3, 4, 1, 0, 9, 5, -2, -3,
- -2, 0, 6, 8, -4, -5, -5, -3, 1, -2, -6, -8, 10, 9, 3, -1,
- 0, -2, -2, 0, 0, -4, -5, 0, -2, -8, -4, 8, -5, -7, 6, 24,
- 9, 1, -7, 1, 9, 1, -8, 1, 8, 0,-10, 1, 8, -1,-11, -1,
- 8, 8, 6, 3, 5, 4, 3, 2, -2, -3, -1, 0,-10,-13, -8, -4,
- 0, 4, 2, -3, 0, 6, 3, -5, 3, 10, 2,-12, 5, 10, -4,-22,
- 0, -4, -1, 3, 1, -4, -1, 5, 1, -5, 0, 8, -1, -6, -2, 7,
- -1, -1, -2, -4, -1, -2, -4, -6, -1, -1, -1, -2, 1, 5, 10, 9,
- 10, 3, 0, -2, 6, -1, -2, -5, 3, -1, -2, -6, 2, 0, 0, -5,
- 6, 3, 0, 0, 6, 3, 1, 1, 4, -2, -2, 1, 0, -9, -9, -2,
- -11, -3, 1, 2, -6, 2, 4, 5, -3, 2, 3, 4, -2, 1, 1, 2,
- -6, -4, -1, -2, 2, -1, -1, -2, 10, 2, -2, -2, 11, 2, -4, -1,
- 6, 0, -2, 2, 3, 3, 0, 0, -6, 3, 3, 0,-17, -1, 5, 0,
- -1, 4, 10, 11, -3, -2, 0, 1, -3, -4, -5, -3, -1, -2, -2, -1,
- 2, -3, -9,-12, 3, 3, 3, 2, 2, 2, 4, 4, 2, 1, -1, -2,
- -2, 9, 5,-10, -3, 5, 5, -5, -2, 1, 2, 0, -1, -2, -2, 1,
- -2, -3, 7, -2, -1, -3, 7, -3, -1, -2, 8, -4, -2, -2, 7, -3,
- 1, -8, -3, 12, 2, -2, -2, 4, 1, 3, 0, -5, -1, 5, 2, -7,
- -1, 3, 1, -5, -7, -2, 3, 1, -2, -7, -2, 2, 20, 3, -5, -1,
- 5, 0, -3, -2, -7, -7, 0, 6, -6, 0, 7, 6, 2, 6, 0, -7,
- -2, 6, -7, 1, -2, 7, -8, 3, -2, 7, -7, 3, -1, 7, -6, 2,
- -5, -2, 5, 7, 4, 1, -4, -8, 6, 3, -2, -5, -7, -5, 3, 7,
- -1, -1, 6, 5, 0, -1, 1, -4, 2, 1, 0, -7, 1, 0, 0, -4,
- -8, 0, 3, 1, -2, 1, -1, -1, 1, -1, -3, 1, 1, -2, 1, 9,
- 5, 2, -3, -4, -1, 0, -1, -3, -3, 1, 3, 1, -4, 0, 4, 2,
- 2, -2, -2, 12, 0, -2, -5, 3, -1, 0, -3, 1, -3, -1, -2, 1,
- 1, 5, 3, 0, -6, -4, -2, 1, 0, -2, -2, 2, 6, 1, -4, -1,
- -3, -5, -5, -1, 3, 5, 5, 4, 0, 3, 1, -1, -2, 1, -2, -3,
- 2, -4, -5, -3, 4, -2, -3, -2, 6, 0, -1, -1, 7, 1, 0, 0,
- -3, -2, -2, 0, -2, -3, -5, -1, -2, 2, 0, -1, -1, 11, 9, -1,
- 0, 1, -1,-10, -1, 1, 0, -6, 1, 0, 1, 4, 2, -5, -1, 13,
- -2, 4, 5, 0, -5, 1, 6, 3, -6, -2, 3, 2, -5, -2, 0, -2,
- -1, 1, 1, -2, -1, -2, 0, 2, 5, 5, 5, 7, 0, -4, -8, -7,
- 0, 2, -1, -5, -1, 2, 2, -3, 0, 5, 3, -5, 3, 8, 2,-12,
- 8, 4, 0, -2, 10, -1, -4, -1, 3, -6, -3, 0, -4, -5, 0, 0,
- 0,-10, -4, 2, -1, -6, 3, 5, -1, -3, 6, 4, 0, -2, 4, 2,
- 0, 8, 1, -1, 0, 11, 1, -3, -1, 6, -2, -4, -3, -2, -7, -4,
- 0, -1, -1, -1, 4, 5, 6, 5, -5, -9, -8, -5, 2, 2, 3, 2,
- 0, 2, 6, 1, 2, 0, 3, 0, 1, -2, -1, -2, 0, -1, -3, -6,
- 0, 0, 2, 0, 4, 0, 2, 1, 5, -2, 0, 0, -2, -9, -1, 2,
- 0, 1, 0,-10, -1, 1, 8, 0, -1, -2, 4, 0, 1, -1, 2, -1,
- -3, -2, 2, -1, -3, -1, 2, -3, 0, -1, 1, 0, 8, 1, -1, 3,
- 0, 1, 1, 2, 0, -4, -2, 0, -1, -5, 1, -1, -2, -1, 11, 2,
- 1, 5, -2, -2, 0, 2, -4, 0, -2, 1, -5, 1, 0, 5, 0, 1,
- -5, -3, 0, 6, -4, 2, 0, 0, -3, 5, 1, 0, -3, 3, 0, 0,
- 3, -2, -3, 1, 1, -4, 0, 8, -2, -3, -2, 3, 1, 2, -1, -1,
- 1, 1, 0, 2, 2, 0, 1, 6, 1, -1, 2, 1, 0, 3, 0,-19,
- 1, -3, -2, 2, 6, 5, -2, -7, -3, 1, 3, 1, -1, -1, 0, 2,
- -8, -1, -1, -4, 1, 1, -1, 2, 4, 3, 2, 3, -5, 1, 3, 0,
- 0, 2, -1, 1, -3, 0, 0, 5, -5, -2, 0, 8, -4, -4, -4, 6,
- 1, 2, 1, 2, 2, 2, -3, 2, 4, 0, -9, 0, 7, 0,-11, 1,
- 0, 0, 0, -2, 3, 3, -1, -6, 4, 3, -3,-10, -1, 2, 6, 2,
- 7, -2, -3, 5, -4, 0, 3, -1, -4, 2, 1, -7, 2, -1, -1, 3,
- 3, 2, 2, 2, -5, -7, -7, -5, 5, 6, 4, 2, -2, -1, 0, 1
-};
-
-/* 6x16-entry codebook for intra-coded 8x4 vectors */
-static const int8_t svq1_intra_codebook_8x4[3072] = {
- 5, 6, 6, 6, 7, 7, 8, 8, 0, 0, 0, 0, 0, 1, 2, 3,
- -3, -4, -4, -5, -5, -4, -3, -2, -4, -4, -4, -5, -4, -4, -3, -3,
- 1, 2, 2, 2, 2, 3, 3, 3, 2, 3, 3, 4, 4, 5, 5, 5,
- -1, 0, 1, 1, 2, 3, 4, 4, -9,-10, -9, -9, -8, -7, -6, -5,
- -4, -4, -5, -6, -6, -7, -7, -7, 0, -1, -2, -2, -3, -3, -4, -4,
- 4, 4, 3, 3, 2, 1, 1, 0, 7, 7, 7, 6, 6, 5, 4, 4,
- 2, 4, 5, 6, 4, 1, -3, -6, 3, 4, 5, 5, 4, 0, -5, -8,
- 2, 3, 4, 4, 2, -2, -7,-10, 2, 2, 2, 1, 0, -4, -9,-12,
- -9, -7, -3, 1, 4, 4, 3, 3,-10, -7, -2, 3, 5, 5, 3, 3,
- -9, -6, -2, 3, 6, 5, 4, 3, -8, -6, -1, 3, 4, 4, 3, 2,
- -5, -5, -5, -5, -3, 1, 4, 7, -5, -5, -5, -4, -2, 1, 6, 8,
- -4, -5, -4, -3, -1, 3, 8, 10, -3, -4, -3, -2, 1, 5, 9, 11,
- -2, -2, -2, -2, -2, -2, -2, -2, -4, -5, -5, -5, -5, -5, -5, -4,
- -3, -4, -4, -4, -4, -4, -4, -3, 9, 10, 10, 11, 11, 11, 10, 10,
- 7, 4, 1, -2, -4, -6, -9,-10, 9, 7, 3, 0, -2, -4, -8, -9,
- 11, 8, 4, 2, 0, -3, -6, -8, 11, 9, 5, 3, 1, -2, -5, -7,
- -13,-13,-13,-12,-11,-10, -8, -8, 0, 1, 2, 3, 4, 4, 4, 3,
- 3, 4, 5, 6, 6, 6, 5, 4, 3, 4, 4, 4, 3, 3, 3, 2,
- 10, 10, 11, 10, 9, 9, 8, 7, 6, 6, 6, 6, 5, 4, 3, 2,
- 0, 0, 0, -1, -2, -3, -4, -4,-10,-10,-11,-12,-13,-14,-14,-14,
- 16, 16, 17, 16, 15, 13, 12, 11, -1, -2, -3, -4, -4, -4, -4, -3,
- -4, -5, -6, -6, -6, -6, -6, -6, -5, -6, -6, -6, -6, -6, -5, -5,
- -13,-13,-13,-12,-11,-10, -8, -6, -9, -8, -7, -6, -4, -2, 0, 1,
- -2, -1, 1, 3, 5, 7, 8, 9, 5, 7, 9, 11, 13, 14, 15, 15,
- 16, 14, 11, 7, 2, -3, -7, -9, 14, 12, 8, 3, -1, -6, -9,-11,
- 11, 9, 4, 0, -4, -8,-11,-13, 8, 5, 1, -3, -6,-10,-12,-14,
- -18,-15, -9, -3, 1, 6, 9, 11,-17,-13, -7, -1, 3, 7, 11, 12,
- -15,-11, -5, 1, 5, 9, 12, 13,-13, -9, -3, 2, 5, 9, 11, 13,
- 22, 21, 19, 15, 10, 3, -4, -9, 20, 18, 15, 9, 2, -5,-12,-17,
- 16, 13, 8, 1, -7,-14,-20,-24, 10, 6, -1, -8,-15,-21,-25,-27,
- -25,-23,-20,-14, -7, 1, 9, 14,-23,-21,-16, -9, 0, 9, 16, 21,
- -20,-16,-10, -1, 8, 16, 22, 25,-15,-11, -3, 6, 14, 20, 25, 27,
- -4, -2, 0, 1, 2, 2, 2, 2, -5, -2, 0, 2, 3, 3, 3, 3,
- -6, -4, -1, 1, 2, 3, 3, 3, -7, -5, -2, 0, 1, 1, 2, 2,
- 2, 1, 1, 1, 1, 0, -2, -3, 3, 3, 2, 1, 0, -1, -3, -4,
- 4, 3, 2, 1, 0, -2, -4, -6, 5, 4, 3, 1, -1, -3, -5, -6,
- 5, 6, 6, 4, 2, 0, -2, -3, 3, 4, 4, 4, 3, 1, 0, -1,
- -2, -2, -1, -1, -1, -1, -2, -2, -5, -4, -3, -2, -2, -2, -3, -3,
- -1, -1, -1, -1, -1, -1, -1, -1, -3, -4, -4, -4, -3, -3, -3, -3,
- -1, -1, -1, -1, -1, -1, -1, -2, 5, 6, 6, 6, 6, 5, 4, 3,
- 4, 4, 4, 4, 4, 5, 6, 7, 0, -1, -1, -1, -1, 0, 1, 2,
- -2, -3, -3, -3, -3, -2, -1, 0, -3, -3, -4, -4, -4, -3, -2, -1,
- 0, -2, -4, -4, -2, 0, 2, 3, 0, -2, -3, -3, -1, 2, 4, 5,
- -1, -2, -4, -3, 0, 3, 5, 6, -2, -3, -4, -3, -1, 2, 4, 5,
- 9, 4, 0, -3, -3, -1, 0, 1, 8, 4, -1, -4, -3, -1, 1, 2,
- 6, 2, -3, -5, -4, -2, 0, 1, 5, 1, -3, -4, -4, -2, 0, 1,
- 5, 3, 1, -1, -4, -8,-10,-10, 3, 3, 2, 1, 0, -2, -3, -4,
- 1, 1, 1, 2, 3, 2, 1, 0, -1, 0, 1, 2, 3, 4, 3, 2,
- 0, 1, 2, 2, 1, -1, -3, -3, 0, 1, 1, 1, -1, -2, -4, -3,
- -3, -3, -3, -3, -3, -3, -1, 2, -4, -4, -3, 0, 3, 7, 12, 14,
- -5, -5, -6, -6, -6, -6, -6, -5, 2, 2, 2, 1, 0, 0, 0, 0,
- 4, 4, 3, 2, 1, 0, 0, 0, 6, 6, 5, 4, 2, 2, 1, 1,
- -7, -7, -6, -3, 0, 4, 7, 8, -1, -2, -3, -3, -2, -1, 1, 2,
- 3, 3, 1, -1, -2, -2, -2, -1, 6, 6, 4, 2, 0, -2, -2, -2,
- -6, -5, -2, 2, 5, 9, 11, 12, -4, -4, -2, 0, 2, 4, 5, 6,
- -3, -2, -2, -2, -2, -1, 0, 1, -2, -2, -2, -3, -3, -3, -3, -2,
- -7, -3, 1, 3, 3, 0, -3, -5, -6, -2, 3, 5, 4, 1, -3, -5,
- -5, -1, 4, 6, 5, 2, -3, -4, -4, 0, 5, 7, 6, 3, -1, -3,
- 0, 0, 0, 0, 0, 0, 0, 0, -2, -2, -3, -3, -3, -3, -2, -1,
- 6, 7, 8, 9, 9, 8, 7, 6, -4, -4, -5, -5, -6, -6, -5, -4,
- -9, -8, -6, -4, 0, 3, 6, 6, -5, -4, -1, 3, 5, 6, 5, 3,
- 1, 3, 6, 6, 4, 1, -2, -5, 6, 7, 5, 1, -3, -7,-10,-11,
- 10, 9, 5, 1, -3, -6, -6, -4, 5, 3, -1, -5, -6, -5, -2, 2,
- -2, -4, -6, -6, -4, 1, 6, 10, -6, -7, -7, -4, 1, 7, 11, 12,
- 6, 5, 3, 2, 0, 0, 0, 0, 2, 1, -1, -2, -3, -2, -1, -1,
- 0, -1, -2, -4, -4, -2, -1, 1, 0, 0, -1, -2, -1, 0, 2, 3,
- 0, -1, -2, -2, -2, -2, -1, -1, 5, 4, 2, 1, 0, 0, 0, 0,
- 6, 5, 3, 1, 0, 0, 0, 0, 2, 0, -2, -4, -4, -3, -2, -2,
- -7, -4, 0, 2, 2, 2, 2, 1, -7, -3, 0, 0, 0, 0, 0, 0,
- -4, -1, 1, 1, 0, 0, 0, 1, -1, 1, 2, 2, 2, 2, 3, 3,
- -2, 0, 2, 2, 1, 1, 1, 1, -1, 1, 2, 2, 1, 0, 0, -1,
- 0, 2, 4, 2, 0, -1, -2, -3, 1, 2, 3, 1, -2, -4, -6, -6,
- 1, 2, 2, 4, 5, 6, 4, 1, 0, -1, -1, -1, 0, 0, -2, -4,
- 0, 0, -1, -2, -2, -2, -4, -6, 2, 1, 0, 0, 1, 1, -1, -3,
- 1, 1, 1, 1, 1, 2, 3, 3, 0, 0, 1, 0, 1, 2, 4, 4,
- -1, -1, -1, -1, 0, 1, 2, 3, -4, -4, -5, -5, -5, -3, -1, 0,
- -6, -5, -5, -4, -3, -2, -1, -1, -1, 0, 0, 1, 1, 2, 3, 3,
- 0, 1, 1, 1, 2, 2, 3, 4, 0, 0, -1, -1, 0, 1, 2, 3,
- 0, 1, 1, 1, 0, 0, -1, -1, 1, 3, 3, 2, 1, -1, -2, -2,
- -2, 0, 2, 2, 2, 2, 1, 1, -9, -8, -4, -2, 1, 3, 3, 3,
- -1, -1, -1, -2, -3, -3, -3, -4, 0, 0, 0, -1, -2, -2, -3, -3,
- 2, 2, 2, 0, -1, -1, -1, -1, 5, 5, 4, 3, 2, 2, 2, 2,
- 6, 3, -1, -4, -3, -1, 1, 1, 2, -1, -3, -4, -1, 2, 2, 0,
- -1, -2, -2, 1, 4, 4, 1, -3, -2, -1, 1, 4, 6, 3, -3, -8,
- 3, 3, 2, 1, -1, -2, -2, -2, -4, -4, -2, -1, 1, 3, 4, 4,
- -4, -5, -5, -4, -2, 0, 2, 2, 7, 7, 4, 1, -1, -2, -3, -2,
- -1, 1, 3, 0, -4, -6, 0, 6, -2, 1, 4, 1, -4, -6, -1, 7,
- -3, 1, 4, 2, -3, -6, -1, 6, -2, 0, 3, 2, -2, -5, -1, 4,
- 1, -1, -2, 1, 4, 4, -1, -7, 1, -1, -4, -1, 5, 6, 0, -6,
- 3, 0, -4, -3, 3, 6, 2, -4, 3, 0, -5, -4, 1, 4, 1, -3,
- 2, 2, 3, 3, 3, 3, 2, 2, -4, -5, -6, -7, -7, -7, -7, -6,
- 1, 2, 3, 3, 3, 3, 2, 2, 0, 0, 1, 1, 1, 2, 2, 1,
- 3, -3, -3, 3, 4, -2, -2, 2, 3, -4, -4, 4, 4, -4, -4, 2,
- 4, -4, -4, 4, 4, -4, -3, 3, 3, -3, -4, 3, 3, -3, -3, 3,
- -2, -2, -2, -2, -2, -2, -1, -1, 6, 7, 8, 8, 8, 7, 6, 5,
- -5, -6, -7, -7, -8, -7, -6, -5, 1, 1, 2, 2, 2, 2, 1, 1,
- 0, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0,
- -2, -3, -2, -2, -2, -3, -3, -3, 2, 3, 5, 6, 4, 2, 1, 0,
- 8, 6, 2, 0, 0, 0, 0, 0, 4, 1, 0, 0, 0, -1, -1, -1,
- 1, -1, 0, 0, 0, -1, -2, -3, -2, -2, -1, 0, 0, -2, -4, -5,
- 3, 1, -1, -2, -3, -4, -5, -5, 2, 1, 0, 0, 1, 1, 0, 0,
- 0, -1, -1, 0, 2, 2, 2, 2, -1, -2, -1, 1, 2, 2, 2, 2,
- 0, -1, -2, -1, -1, -1, -1, 0, -1, -2, -2, -1, -1, 0, 0, 1,
- 2, 1, 1, 2, 2, 1, 1, 0, 6, 5, 3, 1, 0, -2, -4, -4,
- -3, -2, -1, 0, 1, 1, 0, -1, 0, 1, 3, 4, 5, 5, 3, 1,
- -1, -1, -1, 0, 1, 0, -1, -2, -2, -2, -2, -1, 0, -1, -2, -3,
- 0, -1, -2, -2, -1, -1, 0, 2, 1, -1, -2, -1, -1, -1, 0, 2,
- 1, 0, -2, -2, -2, -2, 1, 5, 1, -1, -2, -2, -2, 0, 5, 10,
- 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 1, 2,
- 1, 2, 2, 3, 4, 4, 6, 5, -3, -3, -3, -2, -2, -3, -3, -3,
- 1, -1, -2, -2, 0, 3, 5, 7, 2, 0, -2, -3, -2, 0, 2, 3,
- 3, 1, -2, -3, -3, -2, -1, -1, 3, 1, 0, -1, -1, -1, -1, -1,
- 1, 3, 5, 4, 2, -1, -3, -4, -3, -2, 1, 2, 1, 0, -1, -2,
- -5, -3, 0, 2, 2, 1, 0, 0, -3, -1, 1, 2, 2, 1, 0, 0,
- 0, -1, -1, -1, 1, 2, 3, 4, -3, -4, -4, -3, -1, 0, 0, 1,
- -2, -3, -2, -1, 1, 1, 1, 1, -2, -2, 0, 3, 4, 4, 3, 2,
- -4, -4, -3, -2, -1, 1, 2, 3, 0, 1, 1, 1, -1, -2, -3, -3,
- 3, 4, 5, 4, 2, -1, -3, -3, -2, -2, 0, 2, 2, 2, 1, 0,
- -4, 0, 5, 7, 4, -1, -4, -4, -1, 2, 4, 3, 0, -3, -3, -2,
- 2, 1, 0, -1, -2, -2, 0, 1, 0, 0, -1, -2, -2, -1, 1, 2,
- -4, -3, -2, -1, 0, 1, 2, 2, 10, 9, 5, 0, -3, -4, -3, -2,
- 1, -1, -2, -2, -1, 0, 0, 0, -2, -2, -1, 1, 1, 1, 0, -1,
- -5, -3, 0, 3, 4, 2, 0, -2, -2, -1, 0, 1, 1, 0, -1, -1,
- 3, 2, -1, -2, -2, -1, 1, 1, 7, 5, -1, -5, -6, -2, 2, 4,
- -2, 3, 3, -3, -4, 1, 2, -2, -3, 3, 4, -3, -4, 2, 3, -2,
- -3, 3, 4, -3, -4, 2, 3, -2, -4, 2, 4, -2, -3, 1, 2, -1,
- 4, 3, -1, -3, -3, -1, 1, 2, -4, -6, -4, 0, 4, 5, 4, 1,
- 0, 2, 5, 6, 2, -3, -5, -4, 1, 1, -1, -3, -5, -2, 2, 4,
- -1, 0, 1, 2, 2, 3, 3, 4, -1, 0, 1, 1, 0, -1, -1, -1,
- -1, 0, 1, 2, 2, 1, -1, -2, -3, -2, -1, 0, 0, -1, -2, -3,
- 1, 1, 1, 1, 0, 0, 1, 2, 1, 0, -1, 0, 0, 1, 1, 0,
- 1, -2, -4, -1, 1, 2, 1, 0, 1, -4, -7, -3, 1, 3, 2, 1,
- 1, 1, 1, 1, 1, 1, 0, -1, 1, 1, 1, 0, 1, 2, 2, 0,
- 1, 1, 0, 0, 0, 2, 0, -3, 3, 2, 0, -1, -1, -2, -6, -9,
- 0, 0, 0, 1, 0, 0, 1, 2, 1, 0, 0, 0, -1, -1, 0, 2,
- 0, 1, 1, 1, -1, -3, -2, 0, -7, -5, 1, 6, 6, 2, -1, -1,
- 3, 1, -1, -3, -4, -2, 1, 4, 2, 0, -2, -3, -4, -3, -1, 2,
- 2, 2, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1,
- -1, 1, 1, -2, -5, -6, -4, -1, -1, 1, 4, 3, 2, 0, 1, 2,
- -1, 0, 2, 3, 1, 0, 0, 1, -1, 0, 1, 0, 0, -1, -1, 0,
- 0, 1, 2, 2, 0, -2, -1, 1, -2, -1, -1, -2, -1, 2, 6, 8,
- -1, -1, -2, -3, -2, 0, 1, 2, -1, 0, 0, -1, -1, 0, -1, -1,
- 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, -1, -1, 1,
- -1, 0, 2, 2, -1, -3, -2, 3, 0, 2, 3, 0, -5, -7, -2, 4,
- -1, 0, 0, 0, -1, -2, -3, -3, -1, 0, -1, -2, -2, -2, -2, -2,
- 1, 1, 0, 0, 1, 2, 0, -1, 1, 2, 1, 2, 5, 6, 2, 0,
- -2, -4, -3, 0, 2, 2, 0, -3, 3, 1, 0, 1, 2, 1, -2, -3,
- 3, 1, 0, 0, 0, 0, 0, -1, 1, -1, -2, -2, -1, 1, 3, 3,
- 3, 2, 1, 2, 4, 3, 1, -2, -2, -4, -4, -3, -1, 0, -2, -3,
- 1, 0, -1, -1, 0, 1, 0, -1, 3, 2, 0, 0, 0, 1, 1, 0,
- 1, 1, 0, 0, 0, 0, 0, 0, 2, 3, 3, 2, 2, 2, 1, 1,
- 0, -1, -2, -3, -5, -5, -5, -4, 1, 1, 0, -1, 0, 1, 3, 3,
- -9, -6, -2, 0, 1, 1, 2, 2, -6, -2, 1, 2, 1, 1, 0, 1,
- -2, 1, 2, 2, 1, 1, 1, 1, 0, 2, 2, 1, 0, 1, 1, 1,
- 1, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, -1, -3, -2, 0,
- -3, -3, -3, -2, -1, 3, 7, 9, 1, 2, 2, 2, 0, -2, -4, -3,
- 2, 0, -2, -1, 3, 4, -1, -6, 1, 0, -2, -3, -1, 3, 3, 0,
- 0, 3, 3, 0, -2, -1, 1, 1, -6, -1, 3, 2, -1, -2, 0, 1,
- 5, 3, 0, -2, -3, 0, 2, 1, 1, 1, 2, 2, 0, -2, -4, -7,
- -3, -2, 1, 2, 2, 1, -1, -4, 2, 2, 0, -2, -2, 0, 2, 2,
- 0, 0, -2, -3, -2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2,
- -2, -1, 0, 1, 0, 1, 2, 3, -4, -2, 0, 0, -1, 0, 2, 3,
- -2, -2, -2, -1, -1, 0, 2, 4, 0, 0, 0, 0, -1, -1, 0, 1,
- 0, -1, -1, -1, -1, -1, 0, 0, 6, 4, 2, 0, -1, -2, -1, -1,
- 0, 1, 1, 1, 1, -1, -5,-10, 1, 1, 1, 1, 1, 1, 0, -4,
- 1, 0, 1, 1, 1, 1, 1, -1, 2, 1, 1, 1, 0, 0, 0, 0,
- -3, 1, 4, 3, 3, 1, -1, 0, -4, 0, 1, 0, -1, 0, 0, 0,
- -5, 0, 2, 1, 1, 1, 0, -1, -1, 2, 1, -2, -2, -1, 0, -1,
- 2, 4, 5, 3, 0, -1, 1, 2, 0, 0, 1, 0, -2, -2, -1, -1,
- -2, -2, -2, -2, -3, -2, -1, 0, 0, 0, 1, 0, 0, 0, 1, 2,
- 0, -2, -2, -3, -1, 2, 2, -1, 1, 0, 0, 0, 1, 5, 3, -2,
- -1, -1, 0, -1, 0, 2, 0, -5, -1, 0, 1, 0, 0, 2, 2, -2,
- 3, 1, -1, -1, 0, 1, 1, 2, 1, 0, 0, 1, 1, 1, 1, 1,
- -10, -8, -2, 1, 2, 1, 1, 1, -1, 1, 2, 1, 0, 0, 0, 0,
- -1, -1, 0, 1, 2, 2, 2, 1, -1, -1, -1, 0, -1, -3, -5, -4,
- 1, 1, 2, 1, 1, 0, 0, 2, -1, -2, -1, -1, -1, 0, 2, 4,
- -3, -7, -5, 0, 2, 0, 0, 0, 3, -1, -2, 1, 2, 1, 1, 2,
- 1, -2, -1, 1, 2, 1, 0, 1, 0, -1, 0, 3, 2, -1, -1, -1,
- 2, 1, 1, 0, 0, 0, 0, 0, -9, -7, -2, 3, 3, 2, 1, 1,
- 3, 2, 0, -2, -2, -1, 1, 1, 0, -1, 0, 0, 1, 1, 0, 0,
- -2, -1, 1, 1, 1, 0, 0, 0, 1, 2, 1, -2, -4, -3, 1, 2,
- 1, 2, 1, -2, -3, 0, 3, 1, -1, -1, 0, 0, 1, 3, 0, -4,
- 2, 0, -1, 1, 2, -2, -2, 3, 2, 0, -1, 2, 3, -2, -4, 1,
- 0, 1, 1, 1, 2, -2, -6, -2, -1, 0, 0, 0, 2, 0, -2, -1,
- -1, -1, 1, 2, 1, -2, -3, -2, 3, -1, -2, -1, -1, 0, 1, 2,
- 10, 4, 0, 0, -1, -2, -2, -1, 3, -1, -2, -1, 0, -1, -1, 0,
- -5, 2, 7, 1, -4, -2, 1, 0, -2, 2, 3, -1, -3, 0, 2, 0,
- 2, 1, 0, 0, 1, 1, -1, -2, 1, -2, -2, -1, -1, -2, 0, 0,
- 0, 3, -2, -7, -1, 3, 0, 0, 1, 3, -3, -5, 2, 3, -1, 0,
- 0, 2, -2, -2, 4, 2, -2, 0, -1, 1, -1, 0, 2, -1, -2, 1,
- 4, 0, -3, -4, -2, 1, 2, 1, 0, 0, 3, 5, 3, 1, -1, -2,
- 1, 1, 1, -1, -3, -1, 1, 1, 1, -1, -2, -2, 0, 0, -1, -2
-};
-
-/* 6x16-entry codebook for intra-coded 8x8 vectors */
-static const int8_t svq1_intra_codebook_8x8[6144] = {
- 4, 4, 3, 2, 2, 1, 0, -1, 4, 3, 3, 2, 1, 0, -1, -1,
- 3, 3, 2, 2, 1, 0, -1, -2, 3, 2, 2, 1, 0, -1, -2, -3,
- 2, 2, 1, 0, -1, -1, -2, -3, 2, 1, 0, 0, -1, -2, -3, -4,
- 1, 0, 0, -1, -2, -3, -4, -4, 0, 0, -1, -2, -2, -3, -4, -4,
- 2, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 3, 3,
- 1, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1,
- -1, 0, 0, 0, 0, 0, 1, 1, -2, -2, -1, -1, -1, -1, -1, -1,
- -3, -3, -3, -3, -3, -3, -2, -2, -5, -4, -4, -4, -4, -4, -4, -3,
- -4, -2, -1, 0, 1, 2, 2, 3, -4, -2, -1, 0, 1, 2, 3, 3,
- -4, -3, -1, 0, 1, 2, 3, 3, -4, -3, -1, 0, 1, 2, 3, 3,
- -5, -3, -1, 0, 1, 2, 3, 3, -5, -3, -1, 0, 1, 2, 3, 3,
- -5, -3, -1, 0, 1, 1, 2, 3, -5, -3, -2, -1, 0, 1, 2, 3,
- 4, 4, 5, 5, 6, 6, 7, 7, 2, 2, 2, 3, 3, 4, 4, 4,
- 0, 0, 0, 0, 1, 1, 1, 2, -2, -2, -2, -2, -1, -1, -1, 0,
- -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
- -1, -2, -2, -2, -2, -2, -2, -2, -1, -1, -1, -1, -2, -2, -2, -2,
- 5, 3, 1, -1, -2, -3, -3, -3, 5, 3, 1, -1, -2, -3, -3, -3,
- 5, 3, 1, -1, -2, -3, -3, -3, 5, 3, 1, -1, -2, -3, -3, -3,
- 5, 4, 1, 0, -2, -3, -3, -3, 6, 4, 2, 0, -2, -2, -3, -3,
- 6, 4, 2, 0, -1, -2, -2, -3, 6, 4, 2, 1, -1, -2, -2, -2,
- -1, 1, 3, 3, 2, 0, -3, -6, -1, 1, 3, 4, 3, 0, -3, -6,
- -1, 1, 4, 4, 3, 1, -3, -6, -1, 1, 3, 4, 3, 1, -3, -6,
- -2, 1, 3, 4, 3, 1, -3, -6, -2, 1, 3, 4, 3, 1, -3, -7,
- -2, 1, 3, 3, 2, 0, -3, -7, -2, 0, 2, 3, 2, 0, -3, -6,
- 10, 9, 8, 6, 6, 5, 4, 4, 6, 5, 4, 3, 2, 2, 2, 1,
- 2, 1, 0, -1, -2, -2, -2, -1, -1, -2, -3, -4, -4, -4, -4, -3,
- -2, -3, -4, -4, -5, -4, -4, -3, -2, -2, -3, -3, -3, -3, -2, -2,
- -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 1, 1, 1, 1, 1, 2,
- -2, -1, 1, 2, 4, 5, 7, 8, -3, -2, 0, 1, 3, 5, 7, 8,
- -4, -3, -1, 0, 2, 4, 6, 7, -5, -4, -2, -1, 1, 3, 5, 7,
- -6, -5, -3, -2, 0, 2, 4, 6, -6, -5, -4, -2, -1, 1, 3, 5,
- -7, -6, -5, -3, -2, 0, 2, 3, -8, -7, -5, -4, -3, -1, 1, 2,
- 11, 9, 7, 5, 3, 1, -1, -1, 10, 8, 6, 3, 1, 0, -2, -2,
- 9, 7, 5, 2, 0, -2, -3, -4, 8, 6, 3, 1, -1, -3, -4, -4,
- 6, 4, 2, -1, -3, -4, -5, -5, 5, 3, 0, -2, -4, -5, -6, -6,
- 3, 1, -1, -3, -5, -6, -7, -7, 2, 0, -2, -4, -6, -6, -7, -7,
- 5, 6, 7, 7, 7, 8, 8, 8, 3, 4, 5, 5, 6, 6, 6, 6,
- 0, 2, 2, 3, 4, 4, 4, 5, -2, -1, 0, 1, 2, 2, 3, 3,
- -4, -3, -2, -1, 0, 1, 1, 2, -6, -5, -4, -3, -2, -2, -1, 0,
- -8, -7, -6, -6, -5, -4, -3, -3,-10, -9, -8, -8, -7, -6, -6, -5,
- 6, 5, 3, 1, -1, -3, -6, -8, 6, 5, 4, 2, -1, -3, -6, -8,
- 6, 5, 4, 2, 0, -3, -6, -8, 6, 5, 4, 2, 0, -3, -6, -8,
- 6, 6, 4, 2, 0, -3, -6, -8, 6, 5, 4, 2, 0, -3, -6, -8,
- 6, 5, 4, 2, 0, -3, -6, -8, 6, 5, 4, 2, -1, -3, -5, -8,
- 11, 10, 9, 8, 7, 6, 5, 4, 8, 8, 7, 6, 5, 4, 3, 2,
- 6, 5, 4, 4, 2, 2, 1, 0, 3, 3, 2, 1, 0, 0, -1, -2,
- 1, 1, 0, -1, -2, -2, -3, -3, -1, -1, -2, -3, -4, -4, -5, -5,
- -3, -4, -4, -5, -6, -6, -7, -7, -5, -5, -6, -7, -8, -8, -8, -8,
- -14,-13,-12,-11, -9, -7, -6, -4,-12,-11,-10, -9, -7, -5, -3, -1,
- -10, -9, -7, -6, -3, -2, 0, 2, -8, -6, -4, -2, 0, 2, 4, 5,
- -5, -3, 0, 2, 4, 5, 7, 8, -2, 0, 2, 4, 6, 8, 9, 10,
- 0, 3, 5, 7, 8, 10, 11, 12, 3, 5, 7, 8, 10, 11, 12, 12,
- -19,-19,-18,-18,-17,-16,-15,-14,-15,-15,-14,-13,-12,-11,-10, -9,
- -11,-10, -9, -8, -6, -5, -4, -3, -6, -5, -3, -2, -1, 0, 1, 2,
- -1, 0, 2, 3, 4, 5, 6, 6, 4, 6, 7, 8, 9, 10, 10, 10,
- 9, 10, 11, 12, 13, 14, 14, 14, 12, 14, 14, 15, 16, 16, 16, 16,
- 22, 21, 19, 17, 14, 11, 9, 5, 20, 19, 17, 14, 11, 8, 4, 1,
- 17, 15, 13, 10, 6, 3, 0, -4, 13, 11, 8, 5, 1, -2, -5, -9,
- 9, 6, 3, -1, -4, -7,-11,-13, 4, 0, -3, -6, -9,-12,-15,-17,
- -2, -5, -8,-11,-14,-16,-18,-20, -8,-10,-13,-16,-17,-19,-21,-22,
- 17, 18, 18, 18, 17, 16, 16, 14, 16, 16, 15, 15, 14, 13, 12, 11,
- 12, 12, 11, 10, 9, 8, 7, 5, 7, 6, 6, 4, 3, 2, 1, -1,
- 1, 0, -1, -2, -3, -4, -5, -6, -5, -6, -7, -8, -9,-10,-11,-12,
- -11,-12,-13,-14,-15,-16,-16,-17,-16,-17,-17,-18,-19,-20,-20,-20,
- 0, 0, 0, 0, -1, -1, -2, -3, 1, 0, 0, 0, 0, -1, -2, -3,
- 1, 1, 0, 0, -1, -1, -2, -2, 1, 1, 1, 0, 0, -1, -1, -2,
- 2, 1, 1, 1, 0, -1, -1, -2, 2, 2, 1, 1, 0, 0, -1, -2,
- 2, 2, 1, 1, 1, 0, -1, -1, 2, 2, 1, 1, 1, 0, 0, -2,
- 0, -1, -1, 0, 0, 1, 2, 3, 0, -1, -1, 0, 1, 1, 2, 2,
- -1, -1, -1, -1, 0, 1, 2, 2, -1, -1, -2, -1, 0, 1, 1, 2,
- -1, -2, -2, -1, 0, 0, 1, 2, -1, -2, -2, -2, -1, 0, 1, 2,
- -1, -1, -2, -1, 0, 0, 1, 2, -1, -1, -1, -1, 0, 1, 1, 2,
- 3, 2, 2, 2, 1, 1, 0, 0, 3, 2, 2, 2, 2, 1, 0, 0,
- 2, 2, 2, 1, 1, 1, 0, 0, 2, 2, 1, 1, 1, 0, 0, -1,
- 1, 1, 1, 0, 0, 0, -1, -1, 0, 0, -1, -1, -1, -1, -1, -1,
- -2, -2, -2, -2, -2, -2, -2, -2, -2, -3, -3, -3, -2, -2, -2, -2,
- 5, 2, 0, 0, -1, 0, 0, 0, 4, 2, 0, -1, -1, -1, 0, -1,
- 4, 1, -1, -1, -2, -1, -1, -1, 4, 1, -1, -1, -2, -1, -1, -1,
- 4, 1, -1, -2, -2, -1, -1, -1, 4, 1, -1, -2, -2, -1, -1, -1,
- 4, 1, -1, -1, -1, -1, -1, -1, 4, 2, 0, -1, 0, 0, 0, -1,
- -2, -1, 0, 1, 1, 1, 1, 1, -3, -1, 0, 1, 1, 1, 1, 1,
- -3, -1, 0, 1, 1, 1, 1, 1, -3, -1, 0, 1, 1, 1, 1, 1,
- -3, -2, 0, 1, 2, 2, 1, 1, -4, -2, 0, 1, 2, 2, 2, 2,
- -5, -3, -1, 1, 1, 2, 1, 2, -5, -3, -2, 0, 1, 1, 1, 1,
- 3, 3, 1, 0, -2, -4, -4, -5, 3, 3, 2, 0, -1, -2, -3, -4,
- 2, 2, 1, 1, 0, -1, -2, -2, 1, 1, 1, 1, 1, 0, 0, 0,
- 0, 0, 0, 1, 1, 1, 1, 1, -2, -1, -1, 0, 0, 1, 2, 2,
- -3, -2, -2, -1, 0, 1, 2, 3, -3, -3, -2, -1, 0, 1, 2, 3,
- -3, -3, -3, -3, -3, -2, -2, -2, -3, -3, -2, -2, -2, -1, -1, -1,
- -2, -2, -2, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 2, 2, 2, 2,
- 1, 1, 1, 2, 2, 3, 3, 3, 2, 2, 2, 2, 3, 3, 3, 3,
- -8, -7, -5, -3, -2, -1, 0, -1, -4, -3, -1, 0, 1, 2, 1, 1,
- -1, 1, 2, 3, 3, 2, 2, 1, 1, 2, 3, 3, 2, 2, 1, 0,
- 2, 3, 3, 2, 1, 0, 0, -1, 1, 2, 1, 0, -1, -1, -1, -1,
- 1, 1, 0, -1, -1, -2, -2, -1, 1, 1, 0, 0, -1, -1, 0, -1,
- -4, -3, -2, 0, 1, 2, 3, 3, -4, -3, -2, 0, 1, 2, 2, 2,
- -3, -3, -2, -1, 0, 1, 1, 1, -2, -2, -2, -1, -1, 0, 0, 0,
- 0, -1, -1, -1, -1, -1, -1, -1, 2, 1, 1, 0, 0, -1, -1, -2,
- 3, 3, 3, 1, 0, -1, -2, -2, 5, 4, 4, 2, 1, 0, -1, -2,
- 0, 0, 0, 0, 1, 2, 3, 3, 0, -1, 0, 0, 1, 2, 3, 3,
- 0, -1, 0, 0, 1, 2, 3, 2, 0, 0, 0, 1, 1, 2, 2, 2,
- 2, 1, 1, 1, 1, 1, 1, 0, 2, 2, 2, 1, 0, 0, -1, -2,
- 2, 1, 0, 0, -2, -3, -5, -6, 0, -1, -1, -3, -5, -6, -8, -9,
- -2, 0, 1, 2, 2, 1, -1, -4, -2, 0, 2, 2, 2, 1, -1, -4,
- -2, 0, 2, 2, 2, 1, -1, -3, -2, 0, 2, 2, 2, 1, -1, -3,
- -2, -1, 2, 2, 2, 1, -1, -3, -2, -1, 1, 2, 2, 1, -1, -3,
- -3, -1, 1, 2, 2, 1, -1, -3, -2, -1, 1, 2, 2, 1, -1, -3,
- -1, 1, 1, -1, -3, -3, 0, 4, -1, 1, 1, -1, -3, -3, 0, 4,
- -1, 1, 1, 0, -3, -3, 0, 4, -1, 1, 2, 0, -3, -3, 0, 5,
- 0, 1, 2, 0, -3, -4, 0, 4, 0, 1, 2, 0, -3, -4, 0, 5,
- 0, 1, 2, 0, -3, -3, 0, 4, 0, 1, 2, -1, -2, -2, 0, 4,
- 6, 6, 5, 6, 5, 5, 5, 5, 2, 2, 2, 2, 2, 2, 2, 2,
- 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -2, -2, -2, -2,
- -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
- -1, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 0, 0, 0, 0, 0,
- -1, -2, -2, -2, -2, -2, -2, -1, -3, -3, -3, -3, -3, -3, -3, -2,
- -3, -4, -4, -3, -3, -3, -2, -2, -2, -2, -2, -2, -1, -1, 0, 0,
- 0, 1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6,
- 4, 1, -2, -3, -3, -1, 1, 3, 4, 1, -2, -4, -3, -1, 1, 3,
- 5, 1, -2, -4, -3, -1, 1, 4, 5, 1, -2, -3, -3, -1, 2, 4,
- 5, 1, -2, -3, -3, -1, 2, 4, 4, 0, -3, -4, -3, -1, 2, 4,
- 4, 0, -3, -3, -3, -1, 1, 3, 3, 0, -2, -3, -2, -1, 1, 3,
- -3, -4, -4, -4, -4, -4, -4, -4, -1, -1, -1, -1, -1, -1, -2, -2,
- 2, 1, 1, 2, 2, 1, 1, 1, 3, 3, 3, 4, 4, 3, 3, 3,
- 3, 3, 3, 4, 4, 4, 3, 3, 1, 2, 1, 2, 2, 2, 2, 2,
- -2, -2, -2, -1, -1, -1, 0, 0, -4, -4, -4, -4, -3, -3, -3, -3,
- -1, -2, -3, -3, -2, -2, -1, 0, 0, -1, -2, -2, -2, -1, 0, 1,
- 2, 1, -1, -1, -1, -1, 0, 1, 3, 1, 0, -1, -1, 0, 0, 1,
- 3, 2, 0, -1, 0, 0, 0, 1, 3, 1, 0, -1, 0, 0, 0, 1,
- 3, 1, 0, -1, 0, 0, 0, 1, 2, 1, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 1, 1, 2, 3, 4, 0, 0, -1, 0, 0, 0, 2, 3,
- 0, -1, -1, -1, -1, -1, 0, 1, 0, -1, -1, -1, -1, -1, -1, 0,
- 0, 0, -1, -1, -1, -2, -2, -1, 1, 0, 0, -1, -1, -2, -2, -1,
- 2, 2, 1, 0, -1, -1, -1, -1, 3, 3, 2, 1, 0, -1, -1, 0,
- 1, 0, 1, 0, 0, -1, -2, -1, 0, 0, 0, 0, -1, -1, -2, -1,
- 0, -1, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0,
- -1, -1, -1, 0, 0, 0, 1, 1, -1, -1, -1, 0, 1, 1, 2, 3,
- -2, -2, -1, 0, 1, 2, 3, 4, -2, -2, -1, 0, 1, 2, 4, 5,
- -3, -1, 1, 0, 0, -1, 0, 1, -3, 0, 1, 0, -1, -1, 0, 2,
- -3, 0, 1, 0, -1, -1, 0, 2, -2, 1, 2, 0, -1, -1, 0, 2,
- -2, 1, 2, 0, -1, -1, 0, 2, -2, 1, 2, 0, -1, -1, 0, 2,
- -1, 2, 2, 0, -1, -1, 0, 2, -1, 1, 1, 0, -1, -1, -1, 1,
- -2, -2, -1, 1, 3, 4, 3, 1, -2, -2, -1, 0, 2, 3, 2, 0,
- -2, -2, -1, 0, 1, 2, 1, -1, -1, -1, -1, 0, 1, 2, 1, -1,
- -1, -1, -1, 0, 1, 1, 0, -2, 0, -1, -1, 0, 1, 1, 0, -1,
- 0, -1, -1, 0, 1, 1, 1, -1, 0, -1, -1, 0, 0, 1, 0, -1,
- -2, -1, 0, 1, 1, 1, 1, 1, -2, -1, 0, 0, 0, 0, 0, 0,
- -2, -1, -1, 0, -1, -1, -2, -2, -2, -1, -1, -1, -1, -2, -2, -3,
- -1, 0, 1, 1, 0, -1, -2, -2, 1, 2, 3, 3, 2, 1, 0, 0,
- 1, 2, 3, 3, 3, 2, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0,
- 0, -1, -1, -1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, -1, 0, 0, 1, 1, 0, 0, 0,
- -3, -2, -1, -1, -1, -1, 0, -1, -5, -5, -4, -3, -2, -2, -2, -1,
- 1, 1, 1, 1, 2, 1, 0, -1, 1, 1, 1, 2, 1, 1, 0, -1,
- 1, 1, 1, 1, 1, 1, 0, -2, 2, 1, 1, 1, 1, 1, 0, -2,
- 1, 1, 0, 0, 0, 0, -1, -3, 1, 1, 0, 0, 0, -1, -2, -3,
- 1, 1, 0, 0, -1, -1, -2, -4, 1, 0, 0, -1, -2, -2, -3, -4,
- 8, 7, 5, 3, 2, 1, 1, 1, 2, 1, 0, 0, -1, -1, -2, -1,
- -1, -1, -1, -2, -2, -2, -2, -1, -1, -1, -1, -1, 0, -1, -1, 0,
- 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0,
- -1, 0, 0, 0, 0, 0, -1, -1, -2, -2, -1, -1, -1, -2, -2, -1,
- 9, 4, 0, -2, -2, -2, -1, -1, 7, 2, -1, -2, -2, -1, 0, 0,
- 4, 0, -2, -2, -1, 0, 1, 1, 1, -2, -2, -2, -1, 0, 1, 1,
- -1, -2, -2, -1, 0, 1, 1, 1, -1, -2, -1, 0, 1, 1, 1, 0,
- -1, -1, 0, 1, 1, 1, 0, -1, 0, -1, 0, 1, 0, 0, -1, -1,
- 0, 1, 1, 1, 1, 1, 0, 0, 1, 2, 2, 2, 1, 0, 0, 0,
- 2, 2, 2, 2, 1, 0, -1, -1, 1, 1, 1, 0, -1, -2, -2, -2,
- 0, 0, 0, -1, -2, -3, -2, -2, -1, -1, -1, -2, -2, -2, -1, 0,
- -1, -1, -1, -1, 0, 0, 1, 2, -1, -1, -1, 0, 1, 2, 3, 4,
- -1, -1, 0, 0, -1, -2, -3, -3, -1, -1, 0, 0, 0, -1, -1, -1,
- -2, -2, -1, 0, 1, 1, 1, 1, -2, -2, -2, 0, 1, 2, 3, 3,
- -1, -1, -1, 0, 1, 3, 3, 3, 1, 0, 0, 0, 1, 1, 2, 2,
- 2, 2, 1, 0, 0, -1, -1, -1, 3, 2, 1, 0, -1, -2, -3, -3,
- -1, -1, -1, -2, -2, -3, -4, -5, 0, 0, 0, -1, -1, -3, -3, -4,
- 1, 1, 1, 0, 0, -1, -2, -3, 2, 2, 2, 1, 1, 0, -1, -1,
- 2, 2, 2, 2, 1, 1, 0, -1, 2, 2, 2, 2, 2, 1, 0, 0,
- 1, 1, 2, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, -1,
- -2, 2, 3, 1, -1, 1, 1, -1, -3, 2, 3, 0, -1, 1, 1, -1,
- -3, 2, 3, 0, -1, 1, 1, -1, -4, 2, 3, 0, -1, 1, 1, -2,
- -4, 1, 3, 0, -1, 1, 1, -2, -4, 1, 3, -1, -2, 1, 1, -2,
- -3, 1, 2, 0, -1, 1, 1, -2, -3, 1, 2, 0, -1, 1, 1, -1,
- -1, -1, -1, -2, -2, -2, -2, -2, 1, 1, 1, 1, 0, 0, 0, 0,
- 1, 2, 2, 2, 2, 2, 2, 2, 0, 0, 1, 1, 1, 2, 2, 2,
- -2, -2, -1, -1, -1, 0, 0, 0, -3, -3, -3, -3, -3, -3, -3, -2,
- -1, -1, -1, -1, -2, -2, -2, -2, 4, 4, 4, 4, 4, 3, 3, 2,
- -3, -3, -2, -1, 0, 1, 2, 5, -3, -3, -3, -2, -1, 1, 3, 6,
- -3, -3, -2, -2, 0, 2, 3, 5, -3, -2, -2, -2, 0, 1, 3, 5,
- -2, -2, -2, -1, -1, 1, 3, 5, -2, -2, -1, -1, 0, 1, 2, 4,
- -1, -1, -1, -1, 0, 1, 1, 4, -1, -1, -1, -1, 0, 1, 2, 3,
- 0, -1, 0, 1, 1, 0, -1, -1, 0, 0, 0, 1, 2, 0, -1, -1,
- 1, 0, -1, 0, 1, 0, 0, 0, 1, -1, -2, -1, 0, 0, 0, 0,
- 1, -2, -3, -1, 0, 0, 0, 1, 1, -1, -3, -2, 0, 1, 1, 2,
- 1, -1, -2, -1, 0, 1, 1, 2, 2, 0, -1, 0, 1, 1, 2, 2,
- 1, 1, 1, 1, 0, 0, 1, 2, -1, 0, 0, -1, 0, 0, 0, 1,
- -3, -2, -1, -1, -1, 0, 1, 1, -4, -2, -1, 0, 0, 1, 1, 1,
- -3, -2, 0, 0, 1, 1, 1, 1, -3, -1, 0, 1, 1, 1, 0, 0,
- -1, 0, 1, 1, 1, 0, 0, -1, 0, 1, 2, 2, 1, 0, 0, -1,
- -4, -4, -4, -3, -2, -1, -1, -1, -2, -2, -2, -1, 0, 0, 0, 0,
- -1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1,
- 0, 0, 1, 1, 2, 2, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0,
- 0, 0, 0, 1, 1, 1, 1, 0, -1, 0, 0, 1, 1, 1, 0, 0,
- 1, 2, 2, 2, 1, -1, -2, -4, 1, 1, 2, 2, 1, 0, -2, -4,
- 0, 1, 1, 1, 1, 0, -1, -3, -1, 0, 1, 1, 0, 0, -1, -2,
- -1, 0, 1, 1, 1, 0, 0, -1, -2, -1, 0, 0, 0, 0, 0, -1,
- -1, -1, 0, 1, 1, 0, 0, 0, -1, 0, 1, 1, 1, 1, 1, 0,
- 2, 2, 0, -1, -2, -1, -1, -2, 1, 1, -1, -2, -2, -1, -1, -2,
- 1, 1, -1, -2, -2, 0, 0, -1, 1, 1, 0, -2, -1, 1, 1, 0,
- 1, 1, 0, -1, -1, 1, 2, 1, 1, 1, 0, -1, -1, 1, 2, 1,
- 1, 1, 0, -1, -1, 1, 1, 1, 1, 1, 0, -1, 0, 1, 1, 1,
- 0, 0, -1, -2, -4, -4, -4, -4, 3, 3, 3, 2, 1, 0, 0, 0,
- 3, 3, 3, 3, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 1,
- -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0,
- -1, -1, 0, -1, -1, 1, 2, -1, 1, 1, 0, 0, 0, 2, 3, -1,
- 1, 1, 0, -1, -1, 1, 3, -1, 1, 1, 0, -2, -2, 0, 1, -2,
- 1, 0, 0, -2, -2, 0, 1, -3, 0, 0, 0, 0, -1, 1, 1, -3,
- 0, 1, 1, 0, 1, 2, 1, -3, -1, 0, 1, 1, 1, 2, 1, -4,
- -4, -3, 0, 1, 1, 1, 0, 0, -4, -2, 0, 1, 1, 1, 0, -1,
- -3, -1, 1, 1, 1, 0, -1, -1, -1, 1, 1, 1, 1, 0, -1, 0,
- 1, 2, 2, 1, 0, -1, 0, 0, 2, 2, 1, 0, -1, -1, 0, 1,
- 2, 1, 0, -1, -2, -1, 0, 1, 2, 2, 0, -1, -2, -1, 1, 1,
- 1, 1, 0, 0, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, -1, -1, -1, -1, -1,
- 1, 0, 0, -1, -1, -1, -1, -1, 2, 1, 0, 0, -1, -1, -1, -1,
- 5, 3, 2, 1, 0, 0, 0, 0, 6, 5, 3, 2, 1, 0, 0, 0,
- 4, 4, 3, 1, 0, 0, 0, 1, 3, 3, 2, 1, 0, 0, 0, 1,
- 2, 2, 1, 0, -1, -1, 0, 1, 0, 0, 0, -1, -1, -1, 0, 1,
- 0, 0, -1, -1, -2, -1, 0, 2, 0, -1, -1, -2, -2, -2, 0, 1,
- 0, -1, -1, -2, -2, -2, -1, 0, 0, 0, -1, -2, -2, -2, -1, 0,
- 0, 0, -1, -1, -1, 0, 2, 3, 0, -1, -2, -2, -1, -1, 1, 2,
- 1, 0, -1, -1, -1, 0, 0, 0, 1, 1, 1, 0, 0, 0, -1, -1,
- 1, 2, 1, 0, 0, -1, -1, -1, -1, 0, 0, 0, -1, -1, -1, -1,
- -3, -2, -1, -1, 0, 1, 1, 2, -4, -3, -1, 1, 2, 3, 5, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
- 0, 0, 0, -1, 0, 0, 0, 1, -1, -1, -2, -2, -2, -1, -1, 0,
- 0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3,
- 1, 1, 1, 1, 2, 2, 1, 1, -4, -3, -4, -4, -4, -4, -3, -3,
- -1, 0, 1, 2, 2, 3, 3, 3, -1, -1, -1, -1, 0, 0, 0, 0,
- 0, 0, -1, -2, -2, -3, -3, -2, 3, 2, 1, 0, -1, -2, -2, -2,
- 4, 3, 2, 1, 1, 0, 0, 0, 2, 2, 1, 1, 0, 1, 1, 1,
- 0, -1, -1, -1, -1, 0, 0, 1, -2, -2, -2, -2, -2, -1, 0, 0,
- 1, -1, 0, 2, 1, -2, -1, 1, 1, -1, 0, 2, 1, -2, -2, 1,
- 1, -1, 0, 3, 2, -2, -1, 1, 0, -2, 0, 3, 2, -2, -2, 1,
- 0, -2, 0, 3, 2, -2, -2, 1, 0, -2, 0, 3, 1, -2, -1, 1,
- 0, -2, 0, 2, 1, -2, -2, 1, 0, -1, 0, 2, 1, -2, -1, 1,
- 0, 1, 2, 2, 3, 3, 2, 2, 0, 1, 1, 2, 3, 3, 2, 1,
- 0, 0, 1, 2, 2, 2, 2, 1, -1, 0, 0, 1, 1, 1, 1, 1,
- -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1,
- -2, -2, -2, -2, -2, -2, -2, -1, -2, -2, -2, -2, -2, -2, -2, -1,
- 0, 0, -1, -2, -1, 0, 3, 5, 0, 0, -1, -1, -1, 0, 2, 4,
- 1, 1, 0, 0, -1, -1, 1, 2, 1, 2, 1, 1, 0, -1, -1, 0,
- 0, 1, 2, 1, 0, -1, -2, -2, -1, 0, 1, 2, 1, 0, -3, -3,
- -2, -1, 1, 2, 2, 0, -2, -4, -2, -1, 0, 2, 2, 1, -1, -3,
- 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, -1, 0, 0, 0, 0, 0,
- -1, -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0,
- -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, 0, 0, 0, -1, -1, 0,
- 0, 0, 1, 1, 0, 0, 0, 1, 3, 3, 3, 4, 3, 3, 3, 3,
- 5, 1, -2, -2, 0, 0, 0, -1, 4, -1, -3, -1, 0, 0, 0, -1,
- 3, -1, -1, 0, 1, 1, 0, -1, 2, 0, 0, 1, 1, 1, 0, -2,
- 1, 0, 0, 1, 1, 1, 0, -2, 0, -1, -1, -1, 0, 0, 0, -1,
- 0, -1, -1, -1, -1, 0, 0, -1, 2, 1, 0, 0, 0, 1, 0, 0,
- 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0,
- 1, -1, -1, 0, 0, 0, 0, 0, 2, 0, -1, -1, -1, -1, -1, 0,
- 3, 1, -1, -1, -2, -2, -2, -1, 4, 2, 1, 0, -1, -2, -2, -1,
- 2, 1, 0, 0, -1, -1, 0, 0, 0, -1, -1, -1, -1, 0, 1, 1,
- 0, 1, 2, 2, 2, 1, -1, -3, 0, 0, 1, 1, 1, 0, -1, -2,
- 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, -1, 0, 0, 1, 1, 0,
- 0, 0, -1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0,
- 0, 0, 1, 1, 2, 1, -1, -3, 0, 0, 0, 1, 1, -1, -4, -5,
- -2, -2, -2, -1, 0, 2, 2, 2, 0, 0, 0, 0, 1, 1, 1, 0,
- 1, 1, 1, 1, 1, 0, -2, -3, 0, 0, 1, 1, 0, -1, -3, -4,
- -1, -1, 0, 1, 0, 0, -2, -3, -1, -1, 0, 1, 1, 1, 0, -1,
- 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0,
- 0, 1, 0, 0, 1, 1, 1, 2, 1, 2, 0, 0, 0, 0, -1, 1,
- 0, 2, 0, -1, 1, 0, -1, 0, 0, 1, 0, 0, 2, 1, 0, 1,
- 0, 1, -1, 0, 2, 2, 0, 1, -1, 0, -1, -1, 2, 1, 1, 2,
- -2, -2, -3, -2, 0, 1, 1, 1, -2, -2, -3, -3, -1, -1, -1, 0,
- -3, -1, 0, 1, 2, 1, 1, 0, -3, -1, 0, 1, 2, 1, 1, 1,
- -2, 0, 0, 1, 1, 1, 1, 1, -1, 0, 0, 0, 0, 0, 0, 0,
- -2, 0, 0, 0, 0, -1, -1, 0, -2, 0, 0, 0, 0, 0, -1, -1,
- -3, 0, 1, 1, 1, 1, 0, 1, -5, -2, 0, 1, 2, 2, 1, 2,
- -2, -1, -1, 0, 0, 1, 2, 3, 0, 0, 1, 1, 0, 0, 1, 2,
- 0, 0, 1, 0, -1, -1, 0, 1, -1, -1, -1, -1, -2, -2, -1, 0,
- -2, -2, -2, -2, -2, -1, 0, 1, 0, 0, 0, -1, 0, 1, 2, 2,
- 2, 1, 0, 0, 0, 1, 2, 2, 2, 1, 0, -1, -1, -1, 0, 0,
- 0, 1, 1, 1, 1, 1, -1, -4, -1, -1, 0, 1, 1, 1, 0, -3,
- -2, -1, 0, 0, 1, 2, 2, -2, -1, 0, 0, 0, 0, 2, 3, -1,
- -1, 0, 0, 0, 0, 1, 2, 0, 0, 0, -1, -2, -1, 1, 1, 0,
- 0, 0, -1, -2, -2, 0, 2, 1, 0, 0, -1, -2, -1, 1, 2, 2,
- 1, 0, 0, 0, -2, -3, -2, -3, 0, 0, 1, 0, -2, -2, -1, -1,
- 0, -1, 1, 1, -1, -1, 0, 0, 0, -1, 1, 1, -1, -1, 0, 0,
- 0, 1, 2, 1, -1, -1, 0, 1, 1, 2, 3, 2, 0, 0, 1, 2,
- -1, 0, 2, 1, 0, 0, 2, 3, -2, -1, 0, 0, -1, 0, 1, 2,
- 1, 1, 0, -1, -2, -2, -1, 1, 1, 1, 1, -1, -2, -2, 0, 2,
- 1, 1, 1, -1, -1, -1, 0, 2, 0, 0, 0, 0, 0, 0, 1, 2,
- -1, -1, -1, 0, 0, 0, 1, 2, -1, -2, -1, 1, 1, 1, 0, 0,
- -1, -2, -1, 1, 2, 2, 0, -1, -1, -2, -1, 2, 2, 2, 0, -1,
- -1, -1, -1, -2, -1, -1, 0, 1, 0, 0, -1, -1, -1, 0, 1, 2,
- 1, 0, 0, 0, 0, 1, 1, 2, 1, 1, 0, 0, 1, 1, 1, 1,
- 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, -1, -1, -1,
- 1, 2, 1, 0, -1, -2, -2, -3, 2, 2, 1, 0, -2, -3, -4, -4,
- -4, -2, 1, 1, 1, 1, 0, 0, -2, 0, 1, 0, 0, 0, 0, 0,
- 0, 1, 1, -2, -2, -1, 0, 1, 2, 2, 1, -2, -2, -1, 1, 2,
- 1, 2, 1, -2, -2, -1, 1, 2, -1, 1, 1, -1, -1, -1, 0, 1,
- -2, 0, 1, 1, 0, -1, -1, 0, -2, 0, 2, 2, 1, -1, -1, 0,
- 1, 1, 0, 0, 0, 1, 0, 0, -2, -3, -3, -2, -2, -1, 0, 0,
- -3, -4, -3, -2, -1, 0, 0, 0, -1, -1, 0, 1, 2, 3, 2, 1,
- 0, 1, 2, 3, 3, 3, 2, 1, 1, 1, 1, 2, 1, 0, 0, -1,
- 0, 0, 0, 0, -1, -1, -1, -1, 0, -1, -1, 0, 0, 0, 0, 0,
- 1, 1, 0, 0, -1, -1, 0, 2, 0, 0, 1, 0, -1, -1, 1, 1,
- -2, -1, 0, 1, 1, 1, 1, 1, -3, -3, 0, 2, 2, 1, 1, 0,
- -2, -2, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, -1, -1,
- 3, 1, -1, -3, -2, -1, 0, 1, 4, 2, -1, -3, -3, -1, 1, 2,
- 0, 0, 0, -1, -1, -1, -1, -1, 1, 2, 1, 0, 0, 0, -1, -1,
- 2, 3, 3, 2, 1, 0, -1, -1, 3, 4, 4, 2, 1, 0, -1, -2,
- 3, 3, 2, 1, 0, -1, -2, -2, 1, 1, 0, -1, -1, -2, -2, -3,
- 0, 0, 0, -1, -1, -2, -2, -2, -1, -1, -1, -1, -1, -2, -2, -1,
- 1, 2, 2, 2, 2, 1, 2, 2, 0, 1, 1, 1, 1, 0, 0, 0,
- 0, 0, 0, 1, 1, 0, -1, -2, 0, 0, 0, 0, 1, 0, -1, -4,
- 1, 0, 0, 0, 0, 0, -2, -5, 1, 0, 0, 0, 0, 0, -1, -4,
- 1, 0, -1, 0, 0, 0, -1, -3, 0, -1, -1, 0, 1, 1, 1, -1,
- -2, -1, 0, 0, -1, -1, -1, -2, -1, 0, 0, 0, -1, -1, -2, -2,
- 0, 1, 1, 0, -1, -1, -1, -2, 0, 1, 1, 0, 0, 0, -1, -1,
- 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 2, 2, 1,
- 1, 1, 0, 0, 1, 2, 2, 1, 1, 1, 0, -1, 0, 1, 1, 0,
- 4, 2, 1, 0, 0, 1, 1, 1, 4, 2, 1, 0, 0, 0, 0, 1,
- 3, 1, 0, 0, -1, -1, -1, 0, 1, 0, 0, -1, -1, -2, -1, 0,
- 0, 0, 0, 0, -1, -1, -1, 0, -1, -1, 0, 0, -1, -1, 0, 1,
- -2, -1, 0, -1, -1, 0, 0, 1, -2, -2, -1, -2, -1, 0, 0, 1,
- 0, 1, 1, 1, 2, 1, 0, -1, -1, -1, -1, 0, 0, -1, -2, -2,
- -1, 0, -1, 0, 0, -1, -2, -1, 0, 0, 0, 0, 0, 0, 1, 2,
- 0, 0, 0, 0, 0, 0, 2, 3, -1, 0, -1, -1, -1, -1, 0, 3,
- -1, 0, 0, -1, -1, -2, 0, 3, 0, 0, 0, 0, -1, -1, 1, 4,
- 2, 2, 0, 0, 0, 0, 0, 1, 1, 1, -1, -2, -1, -2, -1, 1,
- -1, -1, -2, -2, -2, -3, -2, 0, -1, 0, -1, -1, -1, -2, -1, 1,
- 1, 1, 0, 0, 1, 0, 0, 1, 2, 2, 0, 0, 1, 0, 0, 1,
- 2, 2, 0, 0, 0, 0, -1, -1, 2, 2, 0, 0, 1, 0, -1, -1,
- -1, 0, 1, 1, 0, -1, -1, -1, 1, 2, 3, 2, 1, 0, 0, 0,
- 0, 1, 1, 1, 0, -1, 0, 0, -2, -2, -1, 0, 1, 0, 0, 0,
- -2, -2, -1, 2, 2, 2, 1, 0, -2, -1, 0, 1, 1, 0, 0, -1,
- -1, -1, 0, 0, -1, -2, -1, -2, 0, 1, 1, 1, 0, 0, 1, 1,
- -3, -3, -3, -2, -1, -1, -2, -2, -1, -1, 0, 1, 2, 1, 0, 0,
- 1, 1, 1, 2, 2, 1, 0, 0, 1, 1, 1, 1, 1, 0, -1, 1,
- 1, 0, -1, -1, 0, 0, -1, 1, 0, -1, -1, -1, 0, -1, -1, 1,
- 1, 0, -1, 0, 0, -1, 0, 2, 2, 0, -1, 0, 0, 0, 0, 2,
- 1, 0, -2, -1, 0, 1, 1, 0, 2, 0, -1, -1, 0, 1, 1, 0,
- 1, 0, -2, -1, 0, 1, 0, -1, 1, 0, -1, -1, 0, 1, 0, -1,
- 0, 1, 1, 0, 1, 1, 0, 0, -2, 1, 2, 1, 0, 0, 0, 1,
- -5, 0, 2, 1, 0, -1, 0, 1, -6, -1, 2, 1, 0, -1, 0, 0,
- 5, 3, 0, -1, -2, -1, -1, -1, 1, 1, 0, -1, -1, 0, -1, -1,
- -1, 0, 1, 1, 2, 2, 1, 0, -2, -1, 0, 1, 2, 1, 1, 1,
- -2, -1, -1, -1, 0, -1, 0, 1, 0, 1, 0, 0, -1, -1, 0, 0,
- 0, 1, 1, 1, 1, 0, 0, 0, -3, -2, 0, 1, 1, 0, 0, -1,
- -1, 0, 1, 0, -1, 0, 2, 3, -1, 0, 0, -2, -4, -2, -1, 0,
- 0, 1, 1, 0, -2, -1, 0, -1, 1, 2, 3, 1, 0, 1, 1, 0,
- -1, 0, 1, 1, 1, 1, 1, 0, -2, -3, -2, 0, 0, 0, 1, 0,
- -1, -2, -2, 0, 1, 0, 0, -1, 3, 1, 0, 0, 1, 0, -1, -1,
- -2, -1, 0, 0, -1, -1, 0, 0, -1, 0, 0, 0, 0, 1, 1, 1,
- -1, -1, -1, 0, 1, 1, 1, 1, 0, -2, -3, -1, 1, 0, 0, 0,
- 1, -1, -3, -1, 1, 1, 0, -1, 3, 1, -1, 1, 2, 2, 0, -1,
- 3, 1, 0, 1, 2, 1, 1, 0, 0, -2, -2, -1, -1, 0, 0, 0,
- 1, 0, -1, -1, 1, 2, 1, 0, 0, -1, -2, -1, 1, 2, 2, 1,
- -1, -1, -1, 0, 0, 1, 2, 0, -2, 0, 0, 0, 0, 0, 1, -1,
- -1, 0, 1, 0, -1, -1, -1, -1, 0, 1, 1, 2, 0, -2, -1, 0,
- 1, 2, 2, 2, 1, -1, -1, 0, 0, 1, 1, 1, 0, -2, -2, -1,
- 0, 0, -1, -1, -1, -1, -2, -2, 0, 0, -1, 0, 1, 2, 2, 1,
- 0, 0, -1, -1, 0, 1, 2, 2, 1, 1, -1, -2, -1, -1, -1, -1,
- 2, 2, 1, 0, 0, -1, -2, -2, 1, 2, 2, 1, 0, 0, -2, -2,
- 0, 0, 0, 0, 1, 1, 0, -1, 0, -1, -1, -1, 2, 3, 2, 1,
- 0, -2, 1, 2, -1, 0, 0, 1, -1, -2, 2, 3, -1, 0, 0, 0,
- 0, -2, 2, 3, -1, -1, 0, 0, 0, -1, 3, 2, -2, 0, 1, 0,
- 0, -1, 3, 1, -2, 0, 1, 0, 0, -1, 2, 1, -1, 1, 0, -1,
- 0, 0, 1, -1, -2, 0, 0, -1, 1, 0, 0, -2, -2, -1, -1, -1,
- 1, 1, 1, 1, 1, -1, -1, -2, 0, 0, 0, 1, 1, 1, 1, 1,
- 0, 0, 0, 1, 1, 1, 2, 3, 1, 0, 0, -1, 0, 0, 1, 2,
- 0, -1, -1, -2, -1, 0, 1, 2, -2, -2, -2, -2, -1, 0, 1, 1,
- -1, -1, -1, -1, 0, 0, 0, -1, 2, 2, 2, 0, -1, -1, -2, -4,
- -1, -2, -1, -1, 0, 1, 2, 3, -1, -1, -1, -1, 0, 1, 2, 3,
- 1, 0, -1, 0, -1, 0, 1, 2, 1, 0, 0, 0, -1, 0, 2, 2,
- 1, 0, -1, -1, -2, 0, 1, 2, 0, -2, -2, -2, -3, -1, 0, 1,
- 0, -2, -2, -2, -2, -1, 1, 1, 0, 0, 0, 0, 0, 1, 2, 2
-};
-
-/* list of codebooks for intra-coded vectors */
-static const int8_t* const svq1_intra_codebooks[6] = {
- svq1_intra_codebook_4x2, svq1_intra_codebook_4x4,
- svq1_intra_codebook_8x4, svq1_intra_codebook_8x8,
- NULL, NULL,
-};
-
-static const int8_t svq1_intra_codebook_sum[4][16*6] = {
- {
- 0, 0, 0, -1, -1, -1, -1, -2, 0, -1, -1, 0, -1, 0, 1, 0,
- 1, 0, -1, 1, 0, 0, -1, 1, -1, 0, 0, 0, -1, 1, 0, 0,
- -1, 0, 0, 1, -1, 1, 0, -1, -1, 0, 1, 1, 0, 0, -1, 1,
- 0, 1, 0, 0, 1, -1, 0, 0, 0, -1, 1, 0, 1, 0, -2, 1,
- 0, -1, 1, 0, 0, 0, 1, 0, -1, 0, 0, 0, -1, 0, 0, 0,
- 0, 1, 1, 0, 0, -1, 0, 1, 0, 0, 0, 0, -1, 1, 1, -1,
- },{
- -1, -2, 0, -1, 1, 0, -1, 0, -1, -4, -1, -2, -1, -2, 1, -2,
- 0, 0, 4, -2, -1, 1, 1, 0, 2, 1, 1, 0, 2, 0, 0, 0,
- 1, 1, 0, -1, -1, -1, 1, 0, -1, -3, -3, 1, -1, 1, -2, -1,
- 1, -1, 0, 1, 2, 1, -1, -1, 1, 1, 1, 2, 1, 0, 1, -2,
- -2, 0, -1, -2, -2, 0, -1, -1, -1, 0, 1, 0, -1, -1, 0, -1,
- 0, 2, 1, 2, 2, 1, -1, 1, 0, 2, 0, -1, 1, 0, 0, 0,
- },{
- -2, 0, -1, -1, 1, 1, -2, 0, -2, 0, 1, -2, -2, 1, -1, -1,
- 3, -2, 0, -3, -4, -3, 2, 1, 0, 3, -2, 2, 3, 2, 2, -1,
- -3, 1, 0, 1, 0, 0, 0, 1, -2, 1, -2, -2, -1, -2, -2, 2,
- 0, -4, 0, 2, -1, 0, 2, 2, 2, 1, 0, -1, -1, 1, -3, 2,
- 2, 1, 0, 3, 1, -1, 1, 3, 1, 0, 1, 1, 2, -1, 1, -1,
- -2, -1, 0, -1, 1, -1, 1, -2, -2, -1, -1, -3, 1, -4, -3, 1,
- },{
- -2, 0, -2, 3, -1, -1, 0, 2, 2, -1, -3, 2, 1, 0, -2, -1,
- -3, -2, -2, 1, 2, -3, 0, 1, -5, -2, -3, 0, -2, -1, 2, 0,
- -1, -1, 0, -2, 1, 3, -7, -2, -2, -1, 2, -1, 0, 3, 1, 3,
- 1, 0, 0, 1, 2, 3, 1, 2, 0, -2, -2, 1, 1, 2, 2, 3,
- 4, 1, -1, 2, -2, 4, 0, 0, 0, 4, 2, 0, -2, -2, 2, -4,
- -1, 5, -2, -2, -3, 2, -3, -1, 3, -3, 0, 4, 3, 0, 1, -2,
- }
-};
diff --git a/src/libffmpeg/libavcodec/svq1_vlc.h b/src/libffmpeg/libavcodec/svq1_vlc.h
deleted file mode 100644
index 56463700f..000000000
--- a/src/libffmpeg/libavcodec/svq1_vlc.h
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * copyright (C) 2003 the ffmpeg project
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef SVQ1_VLC_H
-#define SVQ1_VLC_H
-
-/* values in this table range from 0..3; adjust retrieved value by +0 */
-static const uint8_t svq1_block_type_vlc[4][2] = {
- /* { code, length } */
- { 0x1, 1 }, { 0x1, 2 }, { 0x1, 3 }, { 0x0, 3 }
-
-};
-
-/* values in this table range from -1..6; adjust retrieved value by -1 */
-static const uint8_t svq1_intra_multistage_vlc[6][8][2] = {
- /* { code, length } */
-{
- { 0x1, 5 }, { 0x1, 1 }, { 0x3, 3 }, { 0x2, 3 },
- { 0x3, 4 }, { 0x2, 4 }, { 0x0, 5 }, { 0x1, 4 }
-},{
- { 0x1, 4 }, { 0x3, 2 }, { 0x5, 3 }, { 0x4, 3 },
- { 0x3, 3 }, { 0x2, 3 }, { 0x0, 4 }, { 0x1, 3 }
-},{
- { 0x1, 5 }, { 0x1, 1 }, { 0x3, 3 }, { 0x0, 5 },
- { 0x3, 4 }, { 0x2, 3 }, { 0x2, 4 }, { 0x1, 4 }
-},{
- { 0x1, 6 }, { 0x1, 1 }, { 0x1, 2 }, { 0x0, 6 },
- { 0x3, 4 }, { 0x2, 4 }, { 0x1, 5 }, { 0x1, 4 }
-},{
- { 0x1, 6 }, { 0x1, 1 }, { 0x1, 2 }, { 0x3, 5 },
- { 0x2, 5 }, { 0x0, 6 }, { 0x1, 5 }, { 0x1, 3 }
-},{
- { 0x1, 7 }, { 0x1, 1 }, { 0x1, 2 }, { 0x1, 3 },
- { 0x1, 4 }, { 0x1, 6 }, { 0x0, 7 }, { 0x1, 5 }
-}
-};
-
-/* values in this table range from -1..6; adjust retrieved value by -1 */
-static const uint8_t svq1_inter_multistage_vlc[6][8][2] = {
- /* { code, length } */
-{
- { 0x3, 2 }, { 0x5, 3 }, { 0x4, 3 }, { 0x3, 3 },
- { 0x2, 3 }, { 0x1, 3 }, { 0x1, 4 }, { 0x0, 4 }
-},{
- { 0x3, 2 }, { 0x5, 3 }, { 0x4, 3 }, { 0x3, 3 },
- { 0x2, 3 }, { 0x1, 3 }, { 0x1, 4 }, { 0x0, 4 }
-},{
- { 0x1, 1 }, { 0x3, 3 }, { 0x2, 3 }, { 0x3, 4 },
- { 0x2, 4 }, { 0x1, 4 }, { 0x1, 5 }, { 0x0, 5 }
-},{
- { 0x1, 1 }, { 0x3, 3 }, { 0x2, 3 }, { 0x3, 4 },
- { 0x2, 4 }, { 0x1, 4 }, { 0x1, 5 }, { 0x0, 5 }
-},{
- { 0x1, 1 }, { 0x3, 3 }, { 0x2, 3 }, { 0x3, 4 },
- { 0x2, 4 }, { 0x1, 4 }, { 0x1, 5 }, { 0x0, 5 }
-},{
- { 0x1, 1 }, { 0x1, 2 }, { 0x1, 3 }, { 0x3, 5 },
- { 0x2, 5 }, { 0x1, 5 }, { 0x1, 6 }, { 0x0, 6 }
-}
-};
-
-/* values in this table range from 0..255; adjust retrieved value by +0 */
-static const uint16_t svq1_intra_mean_vlc[256][2] = {
- /* { code, length } */
- { 0x37, 6 }, { 0x56, 7 }, { 0x1, 17 }, { 0x1, 20 },
- { 0x2, 20 }, { 0x3, 20 }, { 0x0, 20 }, { 0x4, 20 },
- { 0x5, 20 }, { 0x3, 19 }, { 0x15, 11 }, { 0x42, 9 },
- { 0x14, 11 }, { 0x3, 14 }, { 0x2, 14 }, { 0x1, 15 },
- { 0x1, 16 }, { 0x1, 12 }, { 0x2B, 10 }, { 0x18, 11 },
- { 0xC, 11 }, { 0x41, 9 }, { 0x78, 8 }, { 0x6C, 8 },
- { 0x55, 7 }, { 0xF, 4 }, { 0xE, 4 }, { 0x34, 6 },
- { 0x51, 7 }, { 0x72, 8 }, { 0x6E, 8 }, { 0x40, 9 },
- { 0x3F, 9 }, { 0x3E, 9 }, { 0x3D, 9 }, { 0x3C, 9 },
- { 0x3B, 9 }, { 0x3A, 9 }, { 0x39, 9 }, { 0x38, 9 },
- { 0x37, 9 }, { 0x43, 9 }, { 0x46, 9 }, { 0x47, 9 },
- { 0x45, 9 }, { 0x44, 9 }, { 0x49, 9 }, { 0x48, 9 },
- { 0x4A, 8 }, { 0x79, 8 }, { 0x76, 8 }, { 0x77, 8 },
- { 0x71, 8 }, { 0x75, 8 }, { 0x74, 8 }, { 0x73, 8 },
- { 0x6A, 8 }, { 0x55, 8 }, { 0x70, 8 }, { 0x6F, 8 },
- { 0x52, 8 }, { 0x6D, 8 }, { 0x4C, 8 }, { 0x6B, 8 },
- { 0x40, 7 }, { 0x69, 8 }, { 0x68, 8 }, { 0x67, 8 },
- { 0x66, 8 }, { 0x65, 8 }, { 0x64, 8 }, { 0x63, 8 },
- { 0x62, 8 }, { 0x61, 8 }, { 0x60, 8 }, { 0x5F, 8 },
- { 0x5E, 8 }, { 0x5D, 8 }, { 0x5C, 8 }, { 0x5B, 8 },
- { 0x5A, 8 }, { 0x59, 8 }, { 0x58, 8 }, { 0x57, 8 },
- { 0x56, 8 }, { 0x3D, 7 }, { 0x54, 8 }, { 0x53, 8 },
- { 0x3F, 7 }, { 0x51, 8 }, { 0x50, 8 }, { 0x4F, 8 },
- { 0x4E, 8 }, { 0x4D, 8 }, { 0x41, 7 }, { 0x4B, 8 },
- { 0x53, 7 }, { 0x3E, 7 }, { 0x48, 8 }, { 0x4F, 7 },
- { 0x52, 7 }, { 0x45, 8 }, { 0x50, 7 }, { 0x43, 8 },
- { 0x42, 8 }, { 0x41, 8 }, { 0x42, 7 }, { 0x43, 7 },
- { 0x3E, 8 }, { 0x44, 7 }, { 0x3C, 8 }, { 0x45, 7 },
- { 0x46, 7 }, { 0x47, 7 }, { 0x48, 7 }, { 0x49, 7 },
- { 0x4A, 7 }, { 0x4B, 7 }, { 0x4C, 7 }, { 0x4D, 7 },
- { 0x4E, 7 }, { 0x58, 7 }, { 0x59, 7 }, { 0x5A, 7 },
- { 0x5B, 7 }, { 0x5C, 7 }, { 0x5D, 7 }, { 0x44, 8 },
- { 0x49, 8 }, { 0x29, 8 }, { 0x3F, 8 }, { 0x3D, 8 },
- { 0x3B, 8 }, { 0x2C, 8 }, { 0x28, 8 }, { 0x25, 8 },
- { 0x26, 8 }, { 0x5E, 7 }, { 0x57, 7 }, { 0x54, 7 },
- { 0x5F, 7 }, { 0x62, 7 }, { 0x63, 7 }, { 0x64, 7 },
- { 0x61, 7 }, { 0x65, 7 }, { 0x67, 7 }, { 0x66, 7 },
- { 0x35, 6 }, { 0x36, 6 }, { 0x60, 7 }, { 0x39, 8 },
- { 0x3A, 8 }, { 0x38, 8 }, { 0x37, 8 }, { 0x36, 8 },
- { 0x35, 8 }, { 0x34, 8 }, { 0x33, 8 }, { 0x32, 8 },
- { 0x31, 8 }, { 0x30, 8 }, { 0x2D, 8 }, { 0x2B, 8 },
- { 0x2A, 8 }, { 0x27, 8 }, { 0x40, 8 }, { 0x46, 8 },
- { 0x47, 8 }, { 0x26, 9 }, { 0x25, 9 }, { 0x24, 9 },
- { 0x23, 9 }, { 0x22, 9 }, { 0x2E, 8 }, { 0x2F, 8 },
- { 0x1F, 9 }, { 0x36, 9 }, { 0x1D, 9 }, { 0x21, 9 },
- { 0x1B, 9 }, { 0x1C, 9 }, { 0x19, 9 }, { 0x1A, 9 },
- { 0x18, 9 }, { 0x17, 9 }, { 0x16, 9 }, { 0x1E, 9 },
- { 0x20, 9 }, { 0x27, 9 }, { 0x28, 9 }, { 0x29, 9 },
- { 0x2A, 9 }, { 0x2B, 9 }, { 0x2C, 9 }, { 0x2D, 9 },
- { 0x2E, 9 }, { 0x2F, 9 }, { 0x30, 9 }, { 0x35, 9 },
- { 0x31, 9 }, { 0x32, 9 }, { 0x33, 9 }, { 0x34, 9 },
- { 0x19, 10 }, { 0x2A, 10 }, { 0x17, 10 }, { 0x16, 10 },
- { 0x15, 10 }, { 0x28, 10 }, { 0x26, 10 }, { 0x25, 10 },
- { 0x22, 10 }, { 0x21, 10 }, { 0x18, 10 }, { 0x14, 10 },
- { 0x29, 10 }, { 0x12, 10 }, { 0xD, 10 }, { 0xE, 10 },
- { 0xF, 10 }, { 0x10, 10 }, { 0x11, 10 }, { 0x1A, 10 },
- { 0x1B, 10 }, { 0x1C, 10 }, { 0x1D, 10 }, { 0x1E, 10 },
- { 0x1F, 10 }, { 0x20, 10 }, { 0x13, 10 }, { 0x23, 10 },
- { 0x24, 10 }, { 0x9, 11 }, { 0x8, 11 }, { 0x7, 11 },
- { 0x27, 10 }, { 0x5, 11 }, { 0xB, 11 }, { 0x6, 11 },
- { 0x4, 11 }, { 0x3, 11 }, { 0x2, 11 }, { 0x1, 11 },
- { 0xA, 11 }, { 0x16, 11 }, { 0x19, 11 }, { 0x17, 11 },
- { 0xD, 11 }, { 0xE, 11 }, { 0xF, 11 }, { 0x10, 11 },
- { 0x11, 11 }, { 0x12, 11 }, { 0x13, 11 }, { 0x1, 14 }
-};
-
-/* values in this table range from -256..255; adjust retrieved value by -256 */
-static const uint16_t svq1_inter_mean_vlc[512][2] = {
- /* { code, length } */
- { 0x5A, 22 }, { 0xD4, 22 }, { 0xD5, 22 }, { 0xD6, 22 },
- { 0xD7, 22 }, { 0xD8, 22 }, { 0xD9, 22 }, { 0xDA, 22 },
- { 0xDB, 22 }, { 0xDC, 22 }, { 0xDD, 22 }, { 0xDE, 22 },
- { 0xDF, 22 }, { 0xE0, 22 }, { 0xE1, 22 }, { 0xE2, 22 },
- { 0xE3, 22 }, { 0xE4, 22 }, { 0xE5, 22 }, { 0xE6, 22 },
- { 0xE8, 22 }, { 0xCB, 22 }, { 0xE9, 22 }, { 0xEA, 22 },
- { 0xE7, 22 }, { 0xEC, 22 }, { 0xED, 22 }, { 0xEE, 22 },
- { 0xEF, 22 }, { 0xF0, 22 }, { 0xF1, 22 }, { 0xF2, 22 },
- { 0xF3, 22 }, { 0xF4, 22 }, { 0xF5, 22 }, { 0xF6, 22 },
- { 0xF7, 22 }, { 0xF8, 22 }, { 0x102, 22 }, { 0xEB, 22 },
- { 0xF9, 22 }, { 0xFC, 22 }, { 0xFD, 22 }, { 0xFE, 22 },
- { 0x100, 22 }, { 0x5C, 22 }, { 0x60, 22 }, { 0x101, 22 },
- { 0x71, 22 }, { 0x104, 22 }, { 0x105, 22 }, { 0xFB, 22 },
- { 0xFF, 22 }, { 0x86, 21 }, { 0xFA, 22 }, { 0x7C, 22 },
- { 0x75, 22 }, { 0x103, 22 }, { 0x78, 22 }, { 0xD3, 22 },
- { 0x7B, 22 }, { 0x82, 22 }, { 0xD2, 22 }, { 0xD1, 22 },
- { 0xD0, 22 }, { 0xCF, 22 }, { 0xCE, 22 }, { 0xCD, 22 },
- { 0xCC, 22 }, { 0xC3, 22 }, { 0xCA, 22 }, { 0xC9, 22 },
- { 0xC8, 22 }, { 0xC7, 22 }, { 0xC6, 22 }, { 0xC5, 22 },
- { 0x8B, 22 }, { 0xC4, 22 }, { 0xC2, 22 }, { 0xC1, 22 },
- { 0xC0, 22 }, { 0xBF, 22 }, { 0xBE, 22 }, { 0xBD, 22 },
- { 0xBC, 22 }, { 0xBB, 22 }, { 0xBA, 22 }, { 0xB9, 22 },
- { 0x61, 22 }, { 0x84, 22 }, { 0x85, 22 }, { 0x86, 22 },
- { 0x87, 22 }, { 0x88, 22 }, { 0x89, 22 }, { 0x8A, 22 },
- { 0x8C, 22 }, { 0x8D, 22 }, { 0x8E, 22 }, { 0x8F, 22 },
- { 0x90, 22 }, { 0x91, 22 }, { 0x92, 22 }, { 0x93, 22 },
- { 0x94, 22 }, { 0x95, 22 }, { 0x96, 22 }, { 0x97, 22 },
- { 0x98, 22 }, { 0x99, 22 }, { 0x9A, 22 }, { 0x9B, 22 },
- { 0x9C, 22 }, { 0x9D, 22 }, { 0x9E, 22 }, { 0x9F, 22 },
- { 0xA0, 22 }, { 0xA1, 22 }, { 0xA2, 22 }, { 0xA3, 22 },
- { 0xA4, 22 }, { 0xA5, 22 }, { 0xA6, 22 }, { 0xA7, 22 },
- { 0xA8, 22 }, { 0xA9, 22 }, { 0xAA, 22 }, { 0xAB, 22 },
- { 0x7F, 22 }, { 0x8F, 21 }, { 0xAC, 22 }, { 0xAD, 22 },
- { 0xAE, 22 }, { 0xAF, 22 }, { 0xB0, 22 }, { 0xB1, 22 },
- { 0x53, 20 }, { 0x90, 21 }, { 0xB2, 22 }, { 0x91, 21 },
- { 0xB3, 22 }, { 0xB4, 22 }, { 0x54, 20 }, { 0xB5, 22 },
- { 0xB6, 22 }, { 0x8C, 21 }, { 0x34, 19 }, { 0x3D, 18 },
- { 0x55, 20 }, { 0xB7, 22 }, { 0xB8, 22 }, { 0x8B, 21 },
- { 0x56, 20 }, { 0x3D, 19 }, { 0x57, 20 }, { 0x58, 20 },
- { 0x40, 19 }, { 0x43, 19 }, { 0x47, 19 }, { 0x2A, 18 },
- { 0x2E, 19 }, { 0x2C, 18 }, { 0x46, 19 }, { 0x59, 20 },
- { 0x49, 19 }, { 0x2D, 19 }, { 0x38, 18 }, { 0x36, 18 },
- { 0x39, 18 }, { 0x45, 19 }, { 0x28, 18 }, { 0x30, 18 },
- { 0x35, 18 }, { 0x20, 17 }, { 0x44, 19 }, { 0x32, 18 },
- { 0x31, 18 }, { 0x1F, 17 }, { 0x2F, 18 }, { 0x2E, 18 },
- { 0x2D, 18 }, { 0x21, 17 }, { 0x22, 17 }, { 0x23, 17 },
- { 0x24, 17 }, { 0x27, 16 }, { 0x23, 16 }, { 0x20, 16 },
- { 0x1D, 16 }, { 0x25, 16 }, { 0x1E, 16 }, { 0x24, 16 },
- { 0x2A, 16 }, { 0x26, 16 }, { 0x21, 15 }, { 0x29, 16 },
- { 0x22, 15 }, { 0x23, 15 }, { 0x24, 15 }, { 0x1B, 15 },
- { 0x1A, 15 }, { 0x1D, 15 }, { 0x1F, 15 }, { 0x27, 15 },
- { 0x17, 14 }, { 0x18, 14 }, { 0x19, 14 }, { 0x1B, 14 },
- { 0x1C, 14 }, { 0x1E, 14 }, { 0x25, 14 }, { 0x20, 14 },
- { 0x21, 14 }, { 0x13, 13 }, { 0x14, 13 }, { 0x15, 13 },
- { 0x16, 13 }, { 0x17, 13 }, { 0x18, 13 }, { 0x19, 13 },
- { 0x1A, 13 }, { 0x18, 12 }, { 0x17, 12 }, { 0x15, 12 },
- { 0x14, 12 }, { 0x13, 12 }, { 0x12, 12 }, { 0xF, 11 },
- { 0x10, 11 }, { 0x12, 11 }, { 0x13, 11 }, { 0x1B, 11 },
- { 0x1A, 11 }, { 0xE, 10 }, { 0x13, 10 }, { 0xF, 10 },
- { 0x10, 10 }, { 0x11, 10 }, { 0x12, 10 }, { 0xD, 9 },
- { 0x14, 9 }, { 0x15, 9 }, { 0xC, 9 }, { 0x13, 9 },
- { 0xF, 8 }, { 0xE, 8 }, { 0x10, 8 }, { 0x11, 8 },
- { 0xC, 7 }, { 0x9, 7 }, { 0xA, 7 }, { 0x8, 6 },
- { 0x9, 6 }, { 0x9, 5 }, { 0x8, 5 }, { 0x5, 4 },
- { 0x1, 1 }, { 0x3, 3 }, { 0x7, 5 }, { 0x6, 5 },
- { 0xB, 6 }, { 0xA, 6 }, { 0xE, 7 }, { 0xF, 7 },
- { 0xB, 7 }, { 0xD, 7 }, { 0xB, 8 }, { 0xD, 8 },
- { 0xC, 8 }, { 0xF, 9 }, { 0x10, 9 }, { 0x11, 9 },
- { 0xE, 9 }, { 0x12, 9 }, { 0x17, 10 }, { 0x14, 10 },
- { 0x16, 10 }, { 0x15, 10 }, { 0x19, 11 }, { 0x18, 11 },
- { 0x17, 11 }, { 0x16, 11 }, { 0x15, 11 }, { 0x14, 11 },
- { 0x11, 11 }, { 0x19, 12 }, { 0x1A, 12 }, { 0x16, 12 },
- { 0x1D, 12 }, { 0x1B, 12 }, { 0x1C, 12 }, { 0x20, 13 },
- { 0x1C, 13 }, { 0x23, 13 }, { 0x22, 13 }, { 0x21, 13 },
- { 0x1F, 13 }, { 0x1E, 13 }, { 0x1B, 13 }, { 0x1D, 13 },
- { 0x24, 14 }, { 0x16, 14 }, { 0x1A, 14 }, { 0x22, 14 },
- { 0x1D, 14 }, { 0x1F, 14 }, { 0x15, 14 }, { 0x23, 14 },
- { 0x18, 15 }, { 0x20, 15 }, { 0x29, 15 }, { 0x28, 15 },
- { 0x26, 15 }, { 0x25, 15 }, { 0x19, 15 }, { 0x1C, 15 },
- { 0x1E, 15 }, { 0x17, 15 }, { 0x2C, 16 }, { 0x2B, 16 },
- { 0x1C, 16 }, { 0x21, 16 }, { 0x2D, 16 }, { 0x28, 16 },
- { 0x1F, 16 }, { 0x1B, 16 }, { 0x1A, 16 }, { 0x22, 16 },
- { 0x2D, 17 }, { 0x32, 17 }, { 0x2C, 17 }, { 0x27, 17 },
- { 0x31, 17 }, { 0x33, 17 }, { 0x2F, 17 }, { 0x2B, 17 },
- { 0x37, 18 }, { 0x2A, 17 }, { 0x2E, 17 }, { 0x30, 17 },
- { 0x29, 17 }, { 0x28, 17 }, { 0x26, 17 }, { 0x25, 17 },
- { 0x2F, 19 }, { 0x33, 18 }, { 0x34, 18 }, { 0x30, 19 },
- { 0x3A, 18 }, { 0x3B, 18 }, { 0x31, 19 }, { 0x3C, 18 },
- { 0x2B, 18 }, { 0x29, 18 }, { 0x48, 19 }, { 0x27, 18 },
- { 0x42, 19 }, { 0x41, 19 }, { 0x26, 18 }, { 0x52, 20 },
- { 0x51, 20 }, { 0x3F, 19 }, { 0x3E, 19 }, { 0x39, 19 },
- { 0x3C, 19 }, { 0x3B, 19 }, { 0x3A, 19 }, { 0x25, 18 },
- { 0x38, 19 }, { 0x50, 20 }, { 0x37, 19 }, { 0x36, 19 },
- { 0x87, 21 }, { 0x4F, 20 }, { 0x35, 19 }, { 0x4E, 20 },
- { 0x33, 19 }, { 0x32, 19 }, { 0x4D, 20 }, { 0x4C, 20 },
- { 0x83, 22 }, { 0x4B, 20 }, { 0x81, 22 }, { 0x80, 22 },
- { 0x8E, 21 }, { 0x7E, 22 }, { 0x7D, 22 }, { 0x84, 21 },
- { 0x8D, 21 }, { 0x7A, 22 }, { 0x79, 22 }, { 0x4A, 20 },
- { 0x77, 22 }, { 0x76, 22 }, { 0x89, 21 }, { 0x74, 22 },
- { 0x73, 22 }, { 0x72, 22 }, { 0x49, 20 }, { 0x70, 22 },
- { 0x6F, 22 }, { 0x6E, 22 }, { 0x6D, 22 }, { 0x6C, 22 },
- { 0x6B, 22 }, { 0x6A, 22 }, { 0x69, 22 }, { 0x68, 22 },
- { 0x67, 22 }, { 0x66, 22 }, { 0x65, 22 }, { 0x64, 22 },
- { 0x63, 22 }, { 0x62, 22 }, { 0x8A, 21 }, { 0x88, 21 },
- { 0x5F, 22 }, { 0x5E, 22 }, { 0x5D, 22 }, { 0x85, 21 },
- { 0x5B, 22 }, { 0x83, 21 }, { 0x59, 22 }, { 0x58, 22 },
- { 0x57, 22 }, { 0x56, 22 }, { 0x55, 22 }, { 0x54, 22 },
- { 0x53, 22 }, { 0x52, 22 }, { 0x51, 22 }, { 0x50, 22 },
- { 0x4F, 22 }, { 0x4E, 22 }, { 0x4D, 22 }, { 0x4C, 22 },
- { 0x4B, 22 }, { 0x4A, 22 }, { 0x49, 22 }, { 0x48, 22 },
- { 0x47, 22 }, { 0x46, 22 }, { 0x45, 22 }, { 0x44, 22 },
- { 0x43, 22 }, { 0x42, 22 }, { 0x41, 22 }, { 0x40, 22 },
- { 0x3F, 22 }, { 0x3E, 22 }, { 0x3D, 22 }, { 0x3C, 22 },
- { 0x3B, 22 }, { 0x3A, 22 }, { 0x39, 22 }, { 0x38, 22 },
- { 0x37, 22 }, { 0x36, 22 }, { 0x35, 22 }, { 0x34, 22 },
- { 0x33, 22 }, { 0x32, 22 }, { 0x31, 22 }, { 0x30, 22 },
- { 0x2F, 22 }, { 0x2E, 22 }, { 0x2D, 22 }, { 0x2C, 22 },
- { 0x2B, 22 }, { 0x2A, 22 }, { 0x29, 22 }, { 0x28, 22 },
- { 0x27, 22 }, { 0x26, 22 }, { 0x25, 22 }, { 0x24, 22 },
- { 0x23, 22 }, { 0x22, 22 }, { 0x21, 22 }, { 0x20, 22 },
- { 0x1F, 22 }, { 0x1E, 22 }, { 0x1D, 22 }, { 0x1C, 22 },
- { 0x1B, 22 }, { 0x1A, 22 }, { 0x19, 22 }, { 0x18, 22 },
- { 0x17, 22 }, { 0x16, 22 }, { 0x15, 22 }, { 0x14, 22 },
- { 0x13, 22 }, { 0x12, 22 }, { 0x11, 22 }, { 0x10, 22 },
- { 0xF, 22 }, { 0xE, 22 }, { 0xD, 22 }, { 0xC, 22 },
- { 0xB, 22 }, { 0xA, 22 }, { 0x9, 22 }, { 0x8, 22 },
- { 0x7, 22 }, { 0x6, 22 }, { 0x5, 22 }, { 0x4, 22 },
- { 0x3, 22 }, { 0x2, 22 }, { 0x1, 22 }, { 0x0, 22 }
-};
-
-#endif
diff --git a/src/libffmpeg/libavcodec/svq3.c b/src/libffmpeg/libavcodec/svq3.c
deleted file mode 100644
index e02981e61..000000000
--- a/src/libffmpeg/libavcodec/svq3.c
+++ /dev/null
@@ -1,1015 +0,0 @@
-/*
- * Copyright (c) 2003 The FFmpeg Project.
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- *
- * How to use this decoder:
- * SVQ3 data is transported within Apple Quicktime files. Quicktime files
- * have stsd atoms to describe media trak properties. A stsd atom for a
- * video trak contains 1 or more ImageDescription atoms. These atoms begin
- * with the 4-byte length of the atom followed by the codec fourcc. Some
- * decoders need information in this atom to operate correctly. Such
- * is the case with SVQ3. In order to get the best use out of this decoder,
- * the calling app must make the SVQ3 ImageDescription atom available
- * via the AVCodecContext's extradata[_size] field:
- *
- * AVCodecContext.extradata = pointer to ImageDescription, first characters
- * are expected to be 'S', 'V', 'Q', and '3', NOT the 4-byte atom length
- * AVCodecContext.extradata_size = size of ImageDescription atom memory
- * buffer (which will be the same as the ImageDescription atom size field
- * from the QT file, minus 4 bytes since the length is missing)
- *
- * You will know you have these parameters passed correctly when the decoder
- * correctly decodes this file:
- * ftp://ftp.mplayerhq.hu/MPlayer/samples/V-codecs/SVQ3/Vertical400kbit.sorenson3.mov
- *
- */
-
-/**
- * @file svq3.c
- * svq3 decoder.
- */
-
-#define FULLPEL_MODE 1
-#define HALFPEL_MODE 2
-#define THIRDPEL_MODE 3
-#define PREDICT_MODE 4
-
-/* dual scan (from some older h264 draft)
- o-->o-->o o
- | /|
- o o o / o
- | / | |/ |
- o o o o
- /
- o-->o-->o-->o
-*/
-static const uint8_t svq3_scan[16]={
- 0+0*4, 1+0*4, 2+0*4, 2+1*4,
- 2+2*4, 3+0*4, 3+1*4, 3+2*4,
- 0+1*4, 0+2*4, 1+1*4, 1+2*4,
- 0+3*4, 1+3*4, 2+3*4, 3+3*4,
-};
-
-static const uint8_t svq3_pred_0[25][2] = {
- { 0, 0 },
- { 1, 0 }, { 0, 1 },
- { 0, 2 }, { 1, 1 }, { 2, 0 },
- { 3, 0 }, { 2, 1 }, { 1, 2 }, { 0, 3 },
- { 0, 4 }, { 1, 3 }, { 2, 2 }, { 3, 1 }, { 4, 0 },
- { 4, 1 }, { 3, 2 }, { 2, 3 }, { 1, 4 },
- { 2, 4 }, { 3, 3 }, { 4, 2 },
- { 4, 3 }, { 3, 4 },
- { 4, 4 }
-};
-
-static const int8_t svq3_pred_1[6][6][5] = {
- { { 2,-1,-1,-1,-1 }, { 2, 1,-1,-1,-1 }, { 1, 2,-1,-1,-1 },
- { 2, 1,-1,-1,-1 }, { 1, 2,-1,-1,-1 }, { 1, 2,-1,-1,-1 } },
- { { 0, 2,-1,-1,-1 }, { 0, 2, 1, 4, 3 }, { 0, 1, 2, 4, 3 },
- { 0, 2, 1, 4, 3 }, { 2, 0, 1, 3, 4 }, { 0, 4, 2, 1, 3 } },
- { { 2, 0,-1,-1,-1 }, { 2, 1, 0, 4, 3 }, { 1, 2, 4, 0, 3 },
- { 2, 1, 0, 4, 3 }, { 2, 1, 4, 3, 0 }, { 1, 2, 4, 0, 3 } },
- { { 2, 0,-1,-1,-1 }, { 2, 0, 1, 4, 3 }, { 1, 2, 0, 4, 3 },
- { 2, 1, 0, 4, 3 }, { 2, 1, 3, 4, 0 }, { 2, 4, 1, 0, 3 } },
- { { 0, 2,-1,-1,-1 }, { 0, 2, 1, 3, 4 }, { 1, 2, 3, 0, 4 },
- { 2, 0, 1, 3, 4 }, { 2, 1, 3, 0, 4 }, { 2, 0, 4, 3, 1 } },
- { { 0, 2,-1,-1,-1 }, { 0, 2, 4, 1, 3 }, { 1, 4, 2, 0, 3 },
- { 4, 2, 0, 1, 3 }, { 2, 0, 1, 4, 3 }, { 4, 2, 1, 0, 3 } },
-};
-
-static const struct { uint8_t run; uint8_t level; } svq3_dct_tables[2][16] = {
- { { 0, 0 }, { 0, 1 }, { 1, 1 }, { 2, 1 }, { 0, 2 }, { 3, 1 }, { 4, 1 }, { 5, 1 },
- { 0, 3 }, { 1, 2 }, { 2, 2 }, { 6, 1 }, { 7, 1 }, { 8, 1 }, { 9, 1 }, { 0, 4 } },
- { { 0, 0 }, { 0, 1 }, { 1, 1 }, { 0, 2 }, { 2, 1 }, { 0, 3 }, { 0, 4 }, { 0, 5 },
- { 3, 1 }, { 4, 1 }, { 1, 2 }, { 1, 3 }, { 0, 6 }, { 0, 7 }, { 0, 8 }, { 0, 9 } }
-};
-
-static const uint32_t svq3_dequant_coeff[32] = {
- 3881, 4351, 4890, 5481, 6154, 6914, 7761, 8718,
- 9781, 10987, 12339, 13828, 15523, 17435, 19561, 21873,
- 24552, 27656, 30847, 34870, 38807, 43747, 49103, 54683,
- 61694, 68745, 77615, 89113,100253,109366,126635,141533
-};
-
-
-static void svq3_luma_dc_dequant_idct_c(DCTELEM *block, int qp){
- const int qmul= svq3_dequant_coeff[qp];
-#define stride 16
- int i;
- int temp[16];
- static const int x_offset[4]={0, 1*stride, 4* stride, 5*stride};
- static const int y_offset[4]={0, 2*stride, 8* stride, 10*stride};
-
- for(i=0; i<4; i++){
- const int offset= y_offset[i];
- const int z0= 13*(block[offset+stride*0] + block[offset+stride*4]);
- const int z1= 13*(block[offset+stride*0] - block[offset+stride*4]);
- const int z2= 7* block[offset+stride*1] - 17*block[offset+stride*5];
- const int z3= 17* block[offset+stride*1] + 7*block[offset+stride*5];
-
- temp[4*i+0]= z0+z3;
- temp[4*i+1]= z1+z2;
- temp[4*i+2]= z1-z2;
- temp[4*i+3]= z0-z3;
- }
-
- for(i=0; i<4; i++){
- const int offset= x_offset[i];
- const int z0= 13*(temp[4*0+i] + temp[4*2+i]);
- const int z1= 13*(temp[4*0+i] - temp[4*2+i]);
- const int z2= 7* temp[4*1+i] - 17*temp[4*3+i];
- const int z3= 17* temp[4*1+i] + 7*temp[4*3+i];
-
- block[stride*0 +offset]= ((z0 + z3)*qmul + 0x80000)>>20;
- block[stride*2 +offset]= ((z1 + z2)*qmul + 0x80000)>>20;
- block[stride*8 +offset]= ((z1 - z2)*qmul + 0x80000)>>20;
- block[stride*10+offset]= ((z0 - z3)*qmul + 0x80000)>>20;
- }
-}
-#undef stride
-
-static void svq3_add_idct_c (uint8_t *dst, DCTELEM *block, int stride, int qp, int dc){
- const int qmul= svq3_dequant_coeff[qp];
- int i;
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-
- if (dc) {
- dc = 13*13*((dc == 1) ? 1538*block[0] : ((qmul*(block[0] >> 3)) / 2));
- block[0] = 0;
- }
-
- for (i=0; i < 4; i++) {
- const int z0= 13*(block[0 + 4*i] + block[2 + 4*i]);
- const int z1= 13*(block[0 + 4*i] - block[2 + 4*i]);
- const int z2= 7* block[1 + 4*i] - 17*block[3 + 4*i];
- const int z3= 17* block[1 + 4*i] + 7*block[3 + 4*i];
-
- block[0 + 4*i]= z0 + z3;
- block[1 + 4*i]= z1 + z2;
- block[2 + 4*i]= z1 - z2;
- block[3 + 4*i]= z0 - z3;
- }
-
- for (i=0; i < 4; i++) {
- const int z0= 13*(block[i + 4*0] + block[i + 4*2]);
- const int z1= 13*(block[i + 4*0] - block[i + 4*2]);
- const int z2= 7* block[i + 4*1] - 17*block[i + 4*3];
- const int z3= 17* block[i + 4*1] + 7*block[i + 4*3];
- const int rr= (dc + 0x80000);
-
- dst[i + stride*0]= cm[ dst[i + stride*0] + (((z0 + z3)*qmul + rr) >> 20) ];
- dst[i + stride*1]= cm[ dst[i + stride*1] + (((z1 + z2)*qmul + rr) >> 20) ];
- dst[i + stride*2]= cm[ dst[i + stride*2] + (((z1 - z2)*qmul + rr) >> 20) ];
- dst[i + stride*3]= cm[ dst[i + stride*3] + (((z0 - z3)*qmul + rr) >> 20) ];
- }
-}
-
-static void pred4x4_down_left_svq3_c(uint8_t *src, uint8_t *topright, int stride){
- LOAD_TOP_EDGE
- LOAD_LEFT_EDGE
- const __attribute__((unused)) int unu0= t0;
- const __attribute__((unused)) int unu1= l0;
-
- src[0+0*stride]=(l1 + t1)>>1;
- src[1+0*stride]=
- src[0+1*stride]=(l2 + t2)>>1;
- src[2+0*stride]=
- src[1+1*stride]=
- src[0+2*stride]=
- src[3+0*stride]=
- src[2+1*stride]=
- src[1+2*stride]=
- src[0+3*stride]=
- src[3+1*stride]=
- src[2+2*stride]=
- src[1+3*stride]=
- src[3+2*stride]=
- src[2+3*stride]=
- src[3+3*stride]=(l3 + t3)>>1;
-}
-
-static void pred16x16_plane_svq3_c(uint8_t *src, int stride){
- pred16x16_plane_compat_c(src, stride, 1);
-}
-
-static inline int svq3_decode_block (GetBitContext *gb, DCTELEM *block,
- int index, const int type) {
-
- static const uint8_t *const scan_patterns[4] =
- { luma_dc_zigzag_scan, zigzag_scan, svq3_scan, chroma_dc_scan };
-
- int run, level, sign, vlc, limit;
- const int intra = (3 * type) >> 2;
- const uint8_t *const scan = scan_patterns[type];
-
- for (limit=(16 >> intra); index < 16; index=limit, limit+=8) {
- for (; (vlc = svq3_get_ue_golomb (gb)) != 0; index++) {
-
- if (vlc == INVALID_VLC)
- return -1;
-
- sign = (vlc & 0x1) - 1;
- vlc = (vlc + 1) >> 1;
-
- if (type == 3) {
- if (vlc < 3) {
- run = 0;
- level = vlc;
- } else if (vlc < 4) {
- run = 1;
- level = 1;
- } else {
- run = (vlc & 0x3);
- level = ((vlc + 9) >> 2) - run;
- }
- } else {
- if (vlc < 16) {
- run = svq3_dct_tables[intra][vlc].run;
- level = svq3_dct_tables[intra][vlc].level;
- } else if (intra) {
- run = (vlc & 0x7);
- level = (vlc >> 3) + ((run == 0) ? 8 : ((run < 2) ? 2 : ((run < 5) ? 0 : -1)));
- } else {
- run = (vlc & 0xF);
- level = (vlc >> 4) + ((run == 0) ? 4 : ((run < 3) ? 2 : ((run < 10) ? 1 : 0)));
- }
- }
-
- if ((index += run) >= limit)
- return -1;
-
- block[scan[index]] = (level ^ sign) - sign;
- }
-
- if (type != 2) {
- break;
- }
- }
-
- return 0;
-}
-
-static inline void svq3_mc_dir_part (MpegEncContext *s,
- int x, int y, int width, int height,
- int mx, int my, int dxy,
- int thirdpel, int dir, int avg) {
-
- const Picture *pic = (dir == 0) ? &s->last_picture : &s->next_picture;
- uint8_t *src, *dest;
- int i, emu = 0;
- int blocksize= 2 - (width>>3); //16->0, 8->1, 4->2
-
- mx += x;
- my += y;
-
- if (mx < 0 || mx >= (s->h_edge_pos - width - 1) ||
- my < 0 || my >= (s->v_edge_pos - height - 1)) {
-
- if ((s->flags & CODEC_FLAG_EMU_EDGE)) {
- emu = 1;
- }
-
- mx = clip (mx, -16, (s->h_edge_pos - width + 15));
- my = clip (my, -16, (s->v_edge_pos - height + 15));
- }
-
- /* form component predictions */
- dest = s->current_picture.data[0] + x + y*s->linesize;
- src = pic->data[0] + mx + my*s->linesize;
-
- if (emu) {
- ff_emulated_edge_mc (s->edge_emu_buffer, src, s->linesize, (width + 1), (height + 1),
- mx, my, s->h_edge_pos, s->v_edge_pos);
- src = s->edge_emu_buffer;
- }
- if(thirdpel)
- (avg ? s->dsp.avg_tpel_pixels_tab : s->dsp.put_tpel_pixels_tab)[dxy](dest, src, s->linesize, width, height);
- else
- (avg ? s->dsp.avg_pixels_tab : s->dsp.put_pixels_tab)[blocksize][dxy](dest, src, s->linesize, height);
-
- if (!(s->flags & CODEC_FLAG_GRAY)) {
- mx = (mx + (mx < (int) x)) >> 1;
- my = (my + (my < (int) y)) >> 1;
- width = (width >> 1);
- height = (height >> 1);
- blocksize++;
-
- for (i=1; i < 3; i++) {
- dest = s->current_picture.data[i] + (x >> 1) + (y >> 1)*s->uvlinesize;
- src = pic->data[i] + mx + my*s->uvlinesize;
-
- if (emu) {
- ff_emulated_edge_mc (s->edge_emu_buffer, src, s->uvlinesize, (width + 1), (height + 1),
- mx, my, (s->h_edge_pos >> 1), (s->v_edge_pos >> 1));
- src = s->edge_emu_buffer;
- }
- if(thirdpel)
- (avg ? s->dsp.avg_tpel_pixels_tab : s->dsp.put_tpel_pixels_tab)[dxy](dest, src, s->uvlinesize, width, height);
- else
- (avg ? s->dsp.avg_pixels_tab : s->dsp.put_pixels_tab)[blocksize][dxy](dest, src, s->uvlinesize, height);
- }
- }
-}
-
-static inline int svq3_mc_dir (H264Context *h, int size, int mode, int dir, int avg) {
-
- int i, j, k, mx, my, dx, dy, x, y;
- MpegEncContext *const s = (MpegEncContext *) h;
- const int part_width = ((size & 5) == 4) ? 4 : 16 >> (size & 1);
- const int part_height = 16 >> ((unsigned) (size + 1) / 3);
- const int extra_width = (mode == PREDICT_MODE) ? -16*6 : 0;
- const int h_edge_pos = 6*(s->h_edge_pos - part_width ) - extra_width;
- const int v_edge_pos = 6*(s->v_edge_pos - part_height) - extra_width;
-
- for (i=0; i < 16; i+=part_height) {
- for (j=0; j < 16; j+=part_width) {
- const int b_xy = (4*s->mb_x+(j>>2)) + (4*s->mb_y+(i>>2))*h->b_stride;
- int dxy;
- x = 16*s->mb_x + j;
- y = 16*s->mb_y + i;
- k = ((j>>2)&1) + ((i>>1)&2) + ((j>>1)&4) + (i&8);
-
- if (mode != PREDICT_MODE) {
- pred_motion (h, k, (part_width >> 2), dir, 1, &mx, &my);
- } else {
- mx = s->next_picture.motion_val[0][b_xy][0]<<1;
- my = s->next_picture.motion_val[0][b_xy][1]<<1;
-
- if (dir == 0) {
- mx = ((mx * h->frame_num_offset) / h->prev_frame_num_offset + 1)>>1;
- my = ((my * h->frame_num_offset) / h->prev_frame_num_offset + 1)>>1;
- } else {
- mx = ((mx * (h->frame_num_offset - h->prev_frame_num_offset)) / h->prev_frame_num_offset + 1)>>1;
- my = ((my * (h->frame_num_offset - h->prev_frame_num_offset)) / h->prev_frame_num_offset + 1)>>1;
- }
- }
-
- /* clip motion vector prediction to frame border */
- mx = clip (mx, extra_width - 6*x, h_edge_pos - 6*x);
- my = clip (my, extra_width - 6*y, v_edge_pos - 6*y);
-
- /* get (optional) motion vector differential */
- if (mode == PREDICT_MODE) {
- dx = dy = 0;
- } else {
- dy = svq3_get_se_golomb (&s->gb);
- dx = svq3_get_se_golomb (&s->gb);
-
- if (dx == INVALID_VLC || dy == INVALID_VLC) {
- av_log(h->s.avctx, AV_LOG_ERROR, "invalid MV vlc\n");
- return -1;
- }
- }
-
- /* compute motion vector */
- if (mode == THIRDPEL_MODE) {
- int fx, fy;
- mx = ((mx + 1)>>1) + dx;
- my = ((my + 1)>>1) + dy;
- fx= ((unsigned)(mx + 0x3000))/3 - 0x1000;
- fy= ((unsigned)(my + 0x3000))/3 - 0x1000;
- dxy= (mx - 3*fx) + 4*(my - 3*fy);
-
- svq3_mc_dir_part (s, x, y, part_width, part_height, fx, fy, dxy, 1, dir, avg);
- mx += mx;
- my += my;
- } else if (mode == HALFPEL_MODE || mode == PREDICT_MODE) {
- mx = ((unsigned)(mx + 1 + 0x3000))/3 + dx - 0x1000;
- my = ((unsigned)(my + 1 + 0x3000))/3 + dy - 0x1000;
- dxy= (mx&1) + 2*(my&1);
-
- svq3_mc_dir_part (s, x, y, part_width, part_height, mx>>1, my>>1, dxy, 0, dir, avg);
- mx *= 3;
- my *= 3;
- } else {
- mx = ((unsigned)(mx + 3 + 0x6000))/6 + dx - 0x1000;
- my = ((unsigned)(my + 3 + 0x6000))/6 + dy - 0x1000;
-
- svq3_mc_dir_part (s, x, y, part_width, part_height, mx, my, 0, 0, dir, avg);
- mx *= 6;
- my *= 6;
- }
-
- /* update mv_cache */
- if (mode != PREDICT_MODE) {
- int32_t mv = pack16to32(mx,my);
-
- if (part_height == 8 && i < 8) {
- *(int32_t *) h->mv_cache[dir][scan8[k] + 1*8] = mv;
-
- if (part_width == 8 && j < 8) {
- *(int32_t *) h->mv_cache[dir][scan8[k] + 1 + 1*8] = mv;
- }
- }
- if (part_width == 8 && j < 8) {
- *(int32_t *) h->mv_cache[dir][scan8[k] + 1] = mv;
- }
- if (part_width == 4 || part_height == 4) {
- *(int32_t *) h->mv_cache[dir][scan8[k]] = mv;
- }
- }
-
- /* write back motion vectors */
- fill_rectangle(s->current_picture.motion_val[dir][b_xy], part_width>>2, part_height>>2, h->b_stride, pack16to32(mx,my), 4);
- }
- }
-
- return 0;
-}
-
-static int svq3_decode_mb (H264Context *h, unsigned int mb_type) {
- int i, j, k, m, dir, mode;
- int cbp = 0;
- uint32_t vlc;
- int8_t *top, *left;
- MpegEncContext *const s = (MpegEncContext *) h;
- const int mb_xy = s->mb_x + s->mb_y*s->mb_stride;
- const int b_xy = 4*s->mb_x + 4*s->mb_y*h->b_stride;
-
- h->top_samples_available = (s->mb_y == 0) ? 0x33FF : 0xFFFF;
- h->left_samples_available = (s->mb_x == 0) ? 0x5F5F : 0xFFFF;
- h->topright_samples_available = 0xFFFF;
-
- if (mb_type == 0) { /* SKIP */
- if (s->pict_type == P_TYPE || s->next_picture.mb_type[mb_xy] == -1) {
- svq3_mc_dir_part (s, 16*s->mb_x, 16*s->mb_y, 16, 16, 0, 0, 0, 0, 0, 0);
-
- if (s->pict_type == B_TYPE) {
- svq3_mc_dir_part (s, 16*s->mb_x, 16*s->mb_y, 16, 16, 0, 0, 0, 0, 1, 1);
- }
-
- mb_type = MB_TYPE_SKIP;
- } else {
- mb_type= FFMIN(s->next_picture.mb_type[mb_xy], 6);
- if(svq3_mc_dir (h, mb_type, PREDICT_MODE, 0, 0) < 0)
- return -1;
- if(svq3_mc_dir (h, mb_type, PREDICT_MODE, 1, 1) < 0)
- return -1;
-
- mb_type = MB_TYPE_16x16;
- }
- } else if (mb_type < 8) { /* INTER */
- if (h->thirdpel_flag && h->halfpel_flag == !get_bits (&s->gb, 1)) {
- mode = THIRDPEL_MODE;
- } else if (h->halfpel_flag && h->thirdpel_flag == !get_bits (&s->gb, 1)) {
- mode = HALFPEL_MODE;
- } else {
- mode = FULLPEL_MODE;
- }
-
- /* fill caches */
- /* note ref_cache should contain here:
- ????????
- ???11111
- N??11111
- N??11111
- N??11111
- N
- */
-
- for (m=0; m < 2; m++) {
- if (s->mb_x > 0 && h->intra4x4_pred_mode[mb_xy - 1][0] != -1) {
- for (i=0; i < 4; i++) {
- *(uint32_t *) h->mv_cache[m][scan8[0] - 1 + i*8] = *(uint32_t *) s->current_picture.motion_val[m][b_xy - 1 + i*h->b_stride];
- }
- } else {
- for (i=0; i < 4; i++) {
- *(uint32_t *) h->mv_cache[m][scan8[0] - 1 + i*8] = 0;
- }
- }
- if (s->mb_y > 0) {
- memcpy (h->mv_cache[m][scan8[0] - 1*8], s->current_picture.motion_val[m][b_xy - h->b_stride], 4*2*sizeof(int16_t));
- memset (&h->ref_cache[m][scan8[0] - 1*8], (h->intra4x4_pred_mode[mb_xy - s->mb_stride][4] == -1) ? PART_NOT_AVAILABLE : 1, 4);
-
- if (s->mb_x < (s->mb_width - 1)) {
- *(uint32_t *) h->mv_cache[m][scan8[0] + 4 - 1*8] = *(uint32_t *) s->current_picture.motion_val[m][b_xy - h->b_stride + 4];
- h->ref_cache[m][scan8[0] + 4 - 1*8] =
- (h->intra4x4_pred_mode[mb_xy - s->mb_stride + 1][0] == -1 ||
- h->intra4x4_pred_mode[mb_xy - s->mb_stride][4] == -1) ? PART_NOT_AVAILABLE : 1;
- }else
- h->ref_cache[m][scan8[0] + 4 - 1*8] = PART_NOT_AVAILABLE;
- if (s->mb_x > 0) {
- *(uint32_t *) h->mv_cache[m][scan8[0] - 1 - 1*8] = *(uint32_t *) s->current_picture.motion_val[m][b_xy - h->b_stride - 1];
- h->ref_cache[m][scan8[0] - 1 - 1*8] = (h->intra4x4_pred_mode[mb_xy - s->mb_stride - 1][3] == -1) ? PART_NOT_AVAILABLE : 1;
- }else
- h->ref_cache[m][scan8[0] - 1 - 1*8] = PART_NOT_AVAILABLE;
- }else
- memset (&h->ref_cache[m][scan8[0] - 1*8 - 1], PART_NOT_AVAILABLE, 8);
-
- if (s->pict_type != B_TYPE)
- break;
- }
-
- /* decode motion vector(s) and form prediction(s) */
- if (s->pict_type == P_TYPE) {
- if(svq3_mc_dir (h, (mb_type - 1), mode, 0, 0) < 0)
- return -1;
- } else { /* B_TYPE */
- if (mb_type != 2) {
- if(svq3_mc_dir (h, 0, mode, 0, 0) < 0)
- return -1;
- } else {
- for (i=0; i < 4; i++) {
- memset (s->current_picture.motion_val[0][b_xy + i*h->b_stride], 0, 4*2*sizeof(int16_t));
- }
- }
- if (mb_type != 1) {
- if(svq3_mc_dir (h, 0, mode, 1, (mb_type == 3)) < 0)
- return -1;
- } else {
- for (i=0; i < 4; i++) {
- memset (s->current_picture.motion_val[1][b_xy + i*h->b_stride], 0, 4*2*sizeof(int16_t));
- }
- }
- }
-
- mb_type = MB_TYPE_16x16;
- } else if (mb_type == 8 || mb_type == 33) { /* INTRA4x4 */
- memset (h->intra4x4_pred_mode_cache, -1, 8*5*sizeof(int8_t));
-
- if (mb_type == 8) {
- if (s->mb_x > 0) {
- for (i=0; i < 4; i++) {
- h->intra4x4_pred_mode_cache[scan8[0] - 1 + i*8] = h->intra4x4_pred_mode[mb_xy - 1][i];
- }
- if (h->intra4x4_pred_mode_cache[scan8[0] - 1] == -1) {
- h->left_samples_available = 0x5F5F;
- }
- }
- if (s->mb_y > 0) {
- h->intra4x4_pred_mode_cache[4+8*0] = h->intra4x4_pred_mode[mb_xy - s->mb_stride][4];
- h->intra4x4_pred_mode_cache[5+8*0] = h->intra4x4_pred_mode[mb_xy - s->mb_stride][5];
- h->intra4x4_pred_mode_cache[6+8*0] = h->intra4x4_pred_mode[mb_xy - s->mb_stride][6];
- h->intra4x4_pred_mode_cache[7+8*0] = h->intra4x4_pred_mode[mb_xy - s->mb_stride][3];
-
- if (h->intra4x4_pred_mode_cache[4+8*0] == -1) {
- h->top_samples_available = 0x33FF;
- }
- }
-
- /* decode prediction codes for luma blocks */
- for (i=0; i < 16; i+=2) {
- vlc = svq3_get_ue_golomb (&s->gb);
-
- if (vlc >= 25){
- av_log(h->s.avctx, AV_LOG_ERROR, "luma prediction:%d\n", vlc);
- return -1;
- }
-
- left = &h->intra4x4_pred_mode_cache[scan8[i] - 1];
- top = &h->intra4x4_pred_mode_cache[scan8[i] - 8];
-
- left[1] = svq3_pred_1[top[0] + 1][left[0] + 1][svq3_pred_0[vlc][0]];
- left[2] = svq3_pred_1[top[1] + 1][left[1] + 1][svq3_pred_0[vlc][1]];
-
- if (left[1] == -1 || left[2] == -1){
- av_log(h->s.avctx, AV_LOG_ERROR, "weird prediction\n");
- return -1;
- }
- }
- } else { /* mb_type == 33, DC_128_PRED block type */
- for (i=0; i < 4; i++) {
- memset (&h->intra4x4_pred_mode_cache[scan8[0] + 8*i], DC_PRED, 4);
- }
- }
-
- write_back_intra_pred_mode (h);
-
- if (mb_type == 8) {
- check_intra4x4_pred_mode (h);
-
- h->top_samples_available = (s->mb_y == 0) ? 0x33FF : 0xFFFF;
- h->left_samples_available = (s->mb_x == 0) ? 0x5F5F : 0xFFFF;
- } else {
- for (i=0; i < 4; i++) {
- memset (&h->intra4x4_pred_mode_cache[scan8[0] + 8*i], DC_128_PRED, 4);
- }
-
- h->top_samples_available = 0x33FF;
- h->left_samples_available = 0x5F5F;
- }
-
- mb_type = MB_TYPE_INTRA4x4;
- } else { /* INTRA16x16 */
- dir = i_mb_type_info[mb_type - 8].pred_mode;
- dir = (dir >> 1) ^ 3*(dir & 1) ^ 1;
-
- if ((h->intra16x16_pred_mode = check_intra_pred_mode (h, dir)) == -1){
- av_log(h->s.avctx, AV_LOG_ERROR, "check_intra_pred_mode = -1\n");
- return -1;
- }
-
- cbp = i_mb_type_info[mb_type - 8].cbp;
- mb_type = MB_TYPE_INTRA16x16;
- }
-
- if (!IS_INTER(mb_type) && s->pict_type != I_TYPE) {
- for (i=0; i < 4; i++) {
- memset (s->current_picture.motion_val[0][b_xy + i*h->b_stride], 0, 4*2*sizeof(int16_t));
- }
- if (s->pict_type == B_TYPE) {
- for (i=0; i < 4; i++) {
- memset (s->current_picture.motion_val[1][b_xy + i*h->b_stride], 0, 4*2*sizeof(int16_t));
- }
- }
- }
- if (!IS_INTRA4x4(mb_type)) {
- memset (h->intra4x4_pred_mode[mb_xy], DC_PRED, 8);
- }
- if (!IS_SKIP(mb_type) || s->pict_type == B_TYPE) {
- memset (h->non_zero_count_cache + 8, 0, 4*9*sizeof(uint8_t));
- s->dsp.clear_blocks(h->mb);
- }
-
- if (!IS_INTRA16x16(mb_type) && (!IS_SKIP(mb_type) || s->pict_type == B_TYPE)) {
- if ((vlc = svq3_get_ue_golomb (&s->gb)) >= 48){
- av_log(h->s.avctx, AV_LOG_ERROR, "cbp_vlc=%d\n", vlc);
- return -1;
- }
-
- cbp = IS_INTRA(mb_type) ? golomb_to_intra4x4_cbp[vlc] : golomb_to_inter_cbp[vlc];
- }
- if (IS_INTRA16x16(mb_type) || (s->pict_type != I_TYPE && s->adaptive_quant && cbp)) {
- s->qscale += svq3_get_se_golomb (&s->gb);
-
- if (s->qscale > 31){
- av_log(h->s.avctx, AV_LOG_ERROR, "qscale:%d\n", s->qscale);
- return -1;
- }
- }
- if (IS_INTRA16x16(mb_type)) {
- if (svq3_decode_block (&s->gb, h->mb, 0, 0)){
- av_log(h->s.avctx, AV_LOG_ERROR, "error while decoding intra luma dc\n");
- return -1;
- }
- }
-
- if (cbp) {
- const int index = IS_INTRA16x16(mb_type) ? 1 : 0;
- const int type = ((s->qscale < 24 && IS_INTRA4x4(mb_type)) ? 2 : 1);
-
- for (i=0; i < 4; i++) {
- if ((cbp & (1 << i))) {
- for (j=0; j < 4; j++) {
- k = index ? ((j&1) + 2*(i&1) + 2*(j&2) + 4*(i&2)) : (4*i + j);
- h->non_zero_count_cache[ scan8[k] ] = 1;
-
- if (svq3_decode_block (&s->gb, &h->mb[16*k], index, type)){
- av_log(h->s.avctx, AV_LOG_ERROR, "error while decoding block\n");
- return -1;
- }
- }
- }
- }
-
- if ((cbp & 0x30)) {
- for (i=0; i < 2; ++i) {
- if (svq3_decode_block (&s->gb, &h->mb[16*(16 + 4*i)], 0, 3)){
- av_log(h->s.avctx, AV_LOG_ERROR, "error while decoding chroma dc block\n");
- return -1;
- }
- }
-
- if ((cbp & 0x20)) {
- for (i=0; i < 8; i++) {
- h->non_zero_count_cache[ scan8[16+i] ] = 1;
-
- if (svq3_decode_block (&s->gb, &h->mb[16*(16 + i)], 1, 1)){
- av_log(h->s.avctx, AV_LOG_ERROR, "error while decoding chroma ac block\n");
- return -1;
- }
- }
- }
- }
- }
-
- s->current_picture.mb_type[mb_xy] = mb_type;
-
- if (IS_INTRA(mb_type)) {
- h->chroma_pred_mode = check_intra_pred_mode (h, DC_PRED8x8);
- }
-
- return 0;
-}
-
-static int svq3_decode_slice_header (H264Context *h) {
- MpegEncContext *const s = (MpegEncContext *) h;
- const int mb_xy = s->mb_x + s->mb_y*s->mb_stride;
- int i, header;
-
- header = get_bits (&s->gb, 8);
-
- if (((header & 0x9F) != 1 && (header & 0x9F) != 2) || (header & 0x60) == 0) {
- /* TODO: what? */
- av_log(h->s.avctx, AV_LOG_ERROR, "unsupported slice header (%02X)\n", header);
- return -1;
- } else {
- int length = (header >> 5) & 3;
-
- h->next_slice_index = get_bits_count(&s->gb) + 8*show_bits (&s->gb, 8*length) + 8*length;
-
- if (h->next_slice_index > s->gb.size_in_bits){
- av_log(h->s.avctx, AV_LOG_ERROR, "slice after bitstream end\n");
- return -1;
- }
-
- s->gb.size_in_bits = h->next_slice_index - 8*(length - 1);
- skip_bits(&s->gb, 8);
-
- if (length > 0) {
- memcpy ((uint8_t *) &s->gb.buffer[get_bits_count(&s->gb) >> 3],
- &s->gb.buffer[s->gb.size_in_bits >> 3], (length - 1));
- }
- }
-
- if ((i = svq3_get_ue_golomb (&s->gb)) == INVALID_VLC || i >= 3){
- av_log(h->s.avctx, AV_LOG_ERROR, "illegal slice type %d \n", i);
- return -1;
- }
-
- h->slice_type = golomb_to_pict_type[i];
-
- if ((header & 0x9F) == 2) {
- i = (s->mb_num < 64) ? 6 : (1 + av_log2 (s->mb_num - 1));
- s->mb_skip_run = get_bits (&s->gb, i) - (s->mb_x + (s->mb_y * s->mb_width));
- } else {
- get_bits1 (&s->gb);
- s->mb_skip_run = 0;
- }
-
- h->slice_num = get_bits (&s->gb, 8);
- s->qscale = get_bits (&s->gb, 5);
- s->adaptive_quant = get_bits1 (&s->gb);
-
- /* unknown fields */
- get_bits1 (&s->gb);
-
- if (h->unknown_svq3_flag) {
- get_bits1 (&s->gb);
- }
-
- get_bits1 (&s->gb);
- get_bits (&s->gb, 2);
-
- while (get_bits1 (&s->gb)) {
- get_bits (&s->gb, 8);
- }
-
- /* reset intra predictors and invalidate motion vector references */
- if (s->mb_x > 0) {
- memset (h->intra4x4_pred_mode[mb_xy - 1], -1, 4*sizeof(int8_t));
- memset (h->intra4x4_pred_mode[mb_xy - s->mb_x], -1, 8*sizeof(int8_t)*s->mb_x);
- }
- if (s->mb_y > 0) {
- memset (h->intra4x4_pred_mode[mb_xy - s->mb_stride], -1, 8*sizeof(int8_t)*(s->mb_width - s->mb_x));
-
- if (s->mb_x > 0) {
- h->intra4x4_pred_mode[mb_xy - s->mb_stride - 1][3] = -1;
- }
- }
-
- return 0;
-}
-
-static int svq3_decode_frame (AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size) {
- MpegEncContext *const s = avctx->priv_data;
- H264Context *const h = avctx->priv_data;
- int m, mb_type;
- unsigned char *extradata;
- unsigned int size;
-
- s->flags = avctx->flags;
- s->flags2 = avctx->flags2;
- s->unrestricted_mv = 1;
-
- if (!s->context_initialized) {
- s->width = avctx->width;
- s->height = avctx->height;
- h->pred4x4[DIAG_DOWN_LEFT_PRED] = pred4x4_down_left_svq3_c;
- h->pred16x16[PLANE_PRED8x8] = pred16x16_plane_svq3_c;
- h->halfpel_flag = 1;
- h->thirdpel_flag = 1;
- h->unknown_svq3_flag = 0;
- h->chroma_qp = 4;
-
- if (MPV_common_init (s) < 0)
- return -1;
-
- h->b_stride = 4*s->mb_width;
-
- alloc_tables (h);
-
- /* prowl for the "SEQH" marker in the extradata */
- extradata = (unsigned char *)avctx->extradata;
- for (m = 0; m < avctx->extradata_size; m++) {
- if (!memcmp (extradata, "SEQH", 4))
- break;
- extradata++;
- }
-
- /* if a match was found, parse the extra data */
- if (extradata && !memcmp (extradata, "SEQH", 4)) {
-
- GetBitContext gb;
-
- size = AV_RB32(&extradata[4]);
- init_get_bits (&gb, extradata + 8, size*8);
-
- /* 'frame size code' and optional 'width, height' */
- if (get_bits (&gb, 3) == 7) {
- get_bits (&gb, 12);
- get_bits (&gb, 12);
- }
-
- h->halfpel_flag = get_bits1 (&gb);
- h->thirdpel_flag = get_bits1 (&gb);
-
- /* unknown fields */
- get_bits1 (&gb);
- get_bits1 (&gb);
- get_bits1 (&gb);
- get_bits1 (&gb);
-
- s->low_delay = get_bits1 (&gb);
-
- /* unknown field */
- get_bits1 (&gb);
-
- while (get_bits1 (&gb)) {
- get_bits (&gb, 8);
- }
-
- h->unknown_svq3_flag = get_bits1 (&gb);
- avctx->has_b_frames = !s->low_delay;
- }
- }
-
- /* special case for last picture */
- if (buf_size == 0) {
- if (s->next_picture_ptr && !s->low_delay) {
- *(AVFrame *) data = *(AVFrame *) &s->next_picture;
- *data_size = sizeof(AVFrame);
- }
- return 0;
- }
-
- init_get_bits (&s->gb, buf, 8*buf_size);
-
- s->mb_x = s->mb_y = 0;
-
- if (svq3_decode_slice_header (h))
- return -1;
-
- s->pict_type = h->slice_type;
- s->picture_number = h->slice_num;
-
- if(avctx->debug&FF_DEBUG_PICT_INFO){
- av_log(h->s.avctx, AV_LOG_DEBUG, "%c hpel:%d, tpel:%d aqp:%d qp:%d\n",
- av_get_pict_type_char(s->pict_type), h->halfpel_flag, h->thirdpel_flag,
- s->adaptive_quant, s->qscale
- );
- }
-
- /* for hurry_up==5 */
- s->current_picture.pict_type = s->pict_type;
- s->current_picture.key_frame = (s->pict_type == I_TYPE);
-
- /* skip b frames if we dont have reference frames */
- if (s->last_picture_ptr == NULL && s->pict_type == B_TYPE) return 0;
- /* skip b frames if we are in a hurry */
- if (avctx->hurry_up && s->pict_type == B_TYPE) return 0;
- /* skip everything if we are in a hurry >= 5 */
- if (avctx->hurry_up >= 5) return 0;
- if( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==B_TYPE)
- ||(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=I_TYPE)
- || avctx->skip_frame >= AVDISCARD_ALL)
- return 0;
-
- if (s->next_p_frame_damaged) {
- if (s->pict_type == B_TYPE)
- return 0;
- else
- s->next_p_frame_damaged = 0;
- }
-
- if (frame_start (h) < 0)
- return -1;
-
- if (s->pict_type == B_TYPE) {
- h->frame_num_offset = (h->slice_num - h->prev_frame_num);
-
- if (h->frame_num_offset < 0) {
- h->frame_num_offset += 256;
- }
- if (h->frame_num_offset == 0 || h->frame_num_offset >= h->prev_frame_num_offset) {
- av_log(h->s.avctx, AV_LOG_ERROR, "error in B-frame picture id\n");
- return -1;
- }
- } else {
- h->prev_frame_num = h->frame_num;
- h->frame_num = h->slice_num;
- h->prev_frame_num_offset = (h->frame_num - h->prev_frame_num);
-
- if (h->prev_frame_num_offset < 0) {
- h->prev_frame_num_offset += 256;
- }
- }
-
- for(m=0; m<2; m++){
- int i;
- for(i=0; i<4; i++){
- int j;
- for(j=-1; j<4; j++)
- h->ref_cache[m][scan8[0] + 8*i + j]= 1;
- h->ref_cache[m][scan8[0] + 8*i + j]= PART_NOT_AVAILABLE;
- }
- }
-
- for (s->mb_y=0; s->mb_y < s->mb_height; s->mb_y++) {
- for (s->mb_x=0; s->mb_x < s->mb_width; s->mb_x++) {
-
- if ( (get_bits_count(&s->gb) + 7) >= s->gb.size_in_bits &&
- ((get_bits_count(&s->gb) & 7) == 0 || show_bits (&s->gb, (-get_bits_count(&s->gb) & 7)) == 0)) {
-
- skip_bits(&s->gb, h->next_slice_index - get_bits_count(&s->gb));
- s->gb.size_in_bits = 8*buf_size;
-
- if (svq3_decode_slice_header (h))
- return -1;
-
- /* TODO: support s->mb_skip_run */
- }
-
- mb_type = svq3_get_ue_golomb (&s->gb);
-
- if (s->pict_type == I_TYPE) {
- mb_type += 8;
- } else if (s->pict_type == B_TYPE && mb_type >= 4) {
- mb_type += 4;
- }
- if (mb_type > 33 || svq3_decode_mb (h, mb_type)) {
- av_log(h->s.avctx, AV_LOG_ERROR, "error while decoding MB %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
-
- if (mb_type != 0) {
- hl_decode_mb (h);
- }
-
- if (s->pict_type != B_TYPE && !s->low_delay) {
- s->current_picture.mb_type[s->mb_x + s->mb_y*s->mb_stride] =
- (s->pict_type == P_TYPE && mb_type < 8) ? (mb_type - 1) : -1;
- }
- }
-
- ff_draw_horiz_band(s, 16*s->mb_y, 16);
- }
-
- MPV_frame_end(s);
-
- if (s->pict_type == B_TYPE || s->low_delay) {
- *(AVFrame *) data = *(AVFrame *) &s->current_picture;
- } else {
- *(AVFrame *) data = *(AVFrame *) &s->last_picture;
- }
-
- avctx->frame_number = s->picture_number - 1;
-
- /* dont output the last pic after seeking */
- if (s->last_picture_ptr || s->low_delay) {
- *data_size = sizeof(AVFrame);
- }
-
- return buf_size;
-}
-
-
-AVCodec svq3_decoder = {
- "svq3",
- CODEC_TYPE_VIDEO,
- CODEC_ID_SVQ3,
- sizeof(H264Context),
- decode_init,
- NULL,
- decode_end,
- svq3_decode_frame,
- CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_DELAY,
-};
diff --git a/src/libffmpeg/libavcodec/swscale.h b/src/libffmpeg/libavcodec/swscale.h
deleted file mode 100644
index 06088b8e4..000000000
--- a/src/libffmpeg/libavcodec/swscale.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright (C) 2001-2003 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef SWSCALE_H
-#define SWSCALE_H
-
-/**
- * @file swscale.h
- * @brief
- * external api for the swscale stuff
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define AV_STRINGIFY(s) AV_TOSTRING(s)
-#define AV_TOSTRING(s) #s
-
-#define LIBSWSCALE_VERSION_INT ((0<<16)+(5<<8)+0)
-#define LIBSWSCALE_VERSION 0.5.0
-#define LIBSWSCALE_BUILD LIBSWSCALE_VERSION_INT
-
-#define LIBSWSCALE_IDENT "SwS" AV_STRINGIFY(LIBSWSCALE_VERSION)
-
-/* values for the flags, the stuff on the command line is different */
-#define SWS_FAST_BILINEAR 1
-#define SWS_BILINEAR 2
-#define SWS_BICUBIC 4
-#define SWS_X 8
-#define SWS_POINT 0x10
-#define SWS_AREA 0x20
-#define SWS_BICUBLIN 0x40
-#define SWS_GAUSS 0x80
-#define SWS_SINC 0x100
-#define SWS_LANCZOS 0x200
-#define SWS_SPLINE 0x400
-
-#define SWS_SRC_V_CHR_DROP_MASK 0x30000
-#define SWS_SRC_V_CHR_DROP_SHIFT 16
-
-#define SWS_PARAM_DEFAULT 123456
-
-#define SWS_PRINT_INFO 0x1000
-
-//the following 3 flags are not completly implemented
-//internal chrominace subsamling info
-#define SWS_FULL_CHR_H_INT 0x2000
-//input subsampling info
-#define SWS_FULL_CHR_H_INP 0x4000
-#define SWS_DIRECT_BGR 0x8000
-#define SWS_ACCURATE_RND 0x40000
-
-#define SWS_CPU_CAPS_MMX 0x80000000
-#define SWS_CPU_CAPS_MMX2 0x20000000
-#define SWS_CPU_CAPS_3DNOW 0x40000000
-#define SWS_CPU_CAPS_ALTIVEC 0x10000000
-
-#define SWS_MAX_REDUCE_CUTOFF 0.002
-
-#define SWS_CS_ITU709 1
-#define SWS_CS_FCC 4
-#define SWS_CS_ITU601 5
-#define SWS_CS_ITU624 5
-#define SWS_CS_SMPTE170M 5
-#define SWS_CS_SMPTE240M 7
-#define SWS_CS_DEFAULT 5
-
-
-
-// when used for filters they must have an odd number of elements
-// coeffs cannot be shared between vectors
-typedef struct {
- double *coeff;
- int length;
-} SwsVector;
-
-// vectors can be shared
-typedef struct {
- SwsVector *lumH;
- SwsVector *lumV;
- SwsVector *chrH;
- SwsVector *chrV;
-} SwsFilter;
-
-struct SwsContext;
-
-void sws_freeContext(struct SwsContext *swsContext);
-
-struct SwsContext *sws_getContext(int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat, int flags,
- SwsFilter *srcFilter, SwsFilter *dstFilter, double *param);
-int sws_scale(struct SwsContext *context, uint8_t* src[], int srcStride[], int srcSliceY,
- int srcSliceH, uint8_t* dst[], int dstStride[]);
-int sws_scale_ordered(struct SwsContext *context, uint8_t* src[], int srcStride[], int srcSliceY,
- int srcSliceH, uint8_t* dst[], int dstStride[]);
-
-
-int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4], int srcRange, const int table[4], int dstRange, int brightness, int contrast, int saturation);
-int sws_getColorspaceDetails(struct SwsContext *c, int **inv_table, int *srcRange, int **table, int *dstRange, int *brightness, int *contrast, int *saturation);
-SwsVector *sws_getGaussianVec(double variance, double quality);
-SwsVector *sws_getConstVec(double c, int length);
-SwsVector *sws_getIdentityVec(void);
-void sws_scaleVec(SwsVector *a, double scalar);
-void sws_normalizeVec(SwsVector *a, double height);
-void sws_convVec(SwsVector *a, SwsVector *b);
-void sws_addVec(SwsVector *a, SwsVector *b);
-void sws_subVec(SwsVector *a, SwsVector *b);
-void sws_shiftVec(SwsVector *a, int shift);
-SwsVector *sws_cloneVec(SwsVector *a);
-
-void sws_printVec(SwsVector *a);
-void sws_freeVec(SwsVector *a);
-
-SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,
- float lumaSarpen, float chromaSharpen,
- float chromaHShift, float chromaVShift,
- int verbose);
-void sws_freeFilter(SwsFilter *filter);
-
-struct SwsContext *sws_getCachedContext(struct SwsContext *context,
- int srcW, int srcH, int srcFormat,
- int dstW, int dstH, int dstFormat, int flags,
- SwsFilter *srcFilter, SwsFilter *dstFilter, double *param);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/src/libffmpeg/libavcodec/truemotion1.c b/src/libffmpeg/libavcodec/truemotion1.c
deleted file mode 100644
index 4b7aa976d..000000000
--- a/src/libffmpeg/libavcodec/truemotion1.c
+++ /dev/null
@@ -1,923 +0,0 @@
-/*
- * Duck TrueMotion 1.0 Decoder
- * Copyright (C) 2003 Alex Beregszaszi & Mike Melanson
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file truemotion1.c
- * Duck TrueMotion v1 Video Decoder by
- * Alex Beregszaszi (alex@fsn.hu) and
- * Mike Melanson (melanson@pcisys.net)
- *
- * The TrueMotion v1 decoder presently only decodes 16-bit TM1 data and
- * outputs RGB555 (or RGB565) data. 24-bit TM1 data is not supported yet.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "common.h"
-#include "avcodec.h"
-#include "dsputil.h"
-
-#include "truemotion1data.h"
-
-typedef struct TrueMotion1Context {
- AVCodecContext *avctx;
- AVFrame frame;
- AVFrame prev_frame;
-
- uint8_t *buf;
- int size;
-
- uint8_t *mb_change_bits;
- int mb_change_bits_row_size;
- uint8_t *index_stream;
- int index_stream_size;
-
- int flags;
- int x, y, w, h;
-
- uint32_t y_predictor_table[1024];
- uint32_t c_predictor_table[1024];
- uint32_t fat_y_predictor_table[1024];
- uint32_t fat_c_predictor_table[1024];
-
- int compression;
- int block_type;
- int block_width;
- int block_height;
-
- int16_t ydt[8];
- int16_t cdt[8];
- int16_t fat_ydt[8];
- int16_t fat_cdt[8];
-
- int last_deltaset, last_vectable;
-
- unsigned int *vert_pred;
-
-} TrueMotion1Context;
-
-#define FLAG_SPRITE 32
-#define FLAG_KEYFRAME 16
-#define FLAG_INTERFRAME 8
-#define FLAG_INTERPOLATED 4
-
-struct frame_header {
- uint8_t header_size;
- uint8_t compression;
- uint8_t deltaset;
- uint8_t vectable;
- uint16_t ysize;
- uint16_t xsize;
- uint16_t checksum;
- uint8_t version;
- uint8_t header_type;
- uint8_t flags;
- uint8_t control;
- uint16_t xoffset;
- uint16_t yoffset;
- uint16_t width;
- uint16_t height;
-};
-
-#define ALGO_NOP 0
-#define ALGO_RGB16V 1
-#define ALGO_RGB16H 2
-#define ALGO_RGB24H 3
-
-/* these are the various block sizes that can occupy a 4x4 block */
-#define BLOCK_2x2 0
-#define BLOCK_2x4 1
-#define BLOCK_4x2 2
-#define BLOCK_4x4 3
-
-typedef struct comp_types {
- int algorithm;
- int block_width; // vres
- int block_height; // hres
- int block_type;
-} comp_types;
-
-/* { valid for metatype }, algorithm, num of deltas, vert res, horiz res */
-static comp_types compression_types[17] = {
- { ALGO_NOP, 0, 0, 0 },
-
- { ALGO_RGB16V, 4, 4, BLOCK_4x4 },
- { ALGO_RGB16H, 4, 4, BLOCK_4x4 },
- { ALGO_RGB16V, 4, 2, BLOCK_4x2 },
- { ALGO_RGB16H, 4, 2, BLOCK_4x2 },
-
- { ALGO_RGB16V, 2, 4, BLOCK_2x4 },
- { ALGO_RGB16H, 2, 4, BLOCK_2x4 },
- { ALGO_RGB16V, 2, 2, BLOCK_2x2 },
- { ALGO_RGB16H, 2, 2, BLOCK_2x2 },
-
- { ALGO_NOP, 4, 4, BLOCK_4x4 },
- { ALGO_RGB24H, 4, 4, BLOCK_4x4 },
- { ALGO_NOP, 4, 2, BLOCK_4x2 },
- { ALGO_RGB24H, 4, 2, BLOCK_4x2 },
-
- { ALGO_NOP, 2, 4, BLOCK_2x4 },
- { ALGO_RGB24H, 2, 4, BLOCK_2x4 },
- { ALGO_NOP, 2, 2, BLOCK_2x2 },
- { ALGO_RGB24H, 2, 2, BLOCK_2x2 }
-};
-
-static void select_delta_tables(TrueMotion1Context *s, int delta_table_index)
-{
- int i;
-
- if (delta_table_index > 3)
- return;
-
- memcpy(s->ydt, ydts[delta_table_index], 8 * sizeof(int16_t));
- memcpy(s->cdt, cdts[delta_table_index], 8 * sizeof(int16_t));
- memcpy(s->fat_ydt, fat_ydts[delta_table_index], 8 * sizeof(int16_t));
- memcpy(s->fat_cdt, fat_cdts[delta_table_index], 8 * sizeof(int16_t));
-
- /* Y skinny deltas need to be halved for some reason; maybe the
- * skinny Y deltas should be modified */
- for (i = 0; i < 8; i++)
- {
- /* drop the lsb before dividing by 2-- net effect: round down
- * when dividing a negative number (e.g., -3/2 = -2, not -1) */
- s->ydt[i] &= 0xFFFE;
- s->ydt[i] /= 2;
- }
-}
-
-#ifdef WORDS_BIGENDIAN
-static int make_ydt15_entry(int p2, int p1, int16_t *ydt)
-#else
-static int make_ydt15_entry(int p1, int p2, int16_t *ydt)
-#endif
-{
- int lo, hi;
-
- lo = ydt[p1];
- lo += (lo << 5) + (lo << 10);
- hi = ydt[p2];
- hi += (hi << 5) + (hi << 10);
- return ((lo + (hi << 16)) << 1);
-}
-
-#ifdef WORDS_BIGENDIAN
-static int make_cdt15_entry(int p2, int p1, int16_t *cdt)
-#else
-static int make_cdt15_entry(int p1, int p2, int16_t *cdt)
-#endif
-{
- int r, b, lo;
-
- b = cdt[p2];
- r = cdt[p1] << 10;
- lo = b + r;
- return ((lo + (lo << 16)) << 1);
-}
-
-#ifdef WORDS_BIGENDIAN
-static int make_ydt16_entry(int p2, int p1, int16_t *ydt)
-#else
-static int make_ydt16_entry(int p1, int p2, int16_t *ydt)
-#endif
-{
- int lo, hi;
-
- lo = ydt[p1];
- lo += (lo << 6) + (lo << 11);
- hi = ydt[p2];
- hi += (hi << 6) + (hi << 11);
- return ((lo + (hi << 16)) << 1);
-}
-
-#ifdef WORDS_BIGENDIAN
-static int make_cdt16_entry(int p2, int p1, int16_t *cdt)
-#else
-static int make_cdt16_entry(int p1, int p2, int16_t *cdt)
-#endif
-{
- int r, b, lo;
-
- b = cdt[p2];
- r = cdt[p1] << 11;
- lo = b + r;
- return ((lo + (lo << 16)) << 1);
-}
-
-#ifdef WORDS_BIGENDIAN
-static int make_ydt24_entry(int p2, int p1, int16_t *ydt)
-#else
-static int make_ydt24_entry(int p1, int p2, int16_t *ydt)
-#endif
-{
- int lo, hi;
-
- lo = ydt[p1];
- hi = ydt[p2];
- return ((lo + (hi << 8) + (hi << 16)) << 1);
-}
-
-#ifdef WORDS_BIGENDIAN
-static int make_cdt24_entry(int p2, int p1, int16_t *cdt)
-#else
-static int make_cdt24_entry(int p1, int p2, int16_t *cdt)
-#endif
-{
- int r, b;
-
- b = cdt[p2];
- r = cdt[p1]<<16;
- return ((b+r) << 1);
-}
-
-static void gen_vector_table15(TrueMotion1Context *s, const uint8_t *sel_vector_table)
-{
- int len, i, j;
- unsigned char delta_pair;
-
- for (i = 0; i < 1024; i += 4)
- {
- len = *sel_vector_table++ / 2;
- for (j = 0; j < len; j++)
- {
- delta_pair = *sel_vector_table++;
- s->y_predictor_table[i+j] = 0xfffffffe &
- make_ydt15_entry(delta_pair >> 4, delta_pair & 0xf, s->ydt);
- s->c_predictor_table[i+j] = 0xfffffffe &
- make_cdt15_entry(delta_pair >> 4, delta_pair & 0xf, s->cdt);
- }
- s->y_predictor_table[i+(j-1)] |= 1;
- s->c_predictor_table[i+(j-1)] |= 1;
- }
-}
-
-static void gen_vector_table16(TrueMotion1Context *s, const uint8_t *sel_vector_table)
-{
- int len, i, j;
- unsigned char delta_pair;
-
- for (i = 0; i < 1024; i += 4)
- {
- len = *sel_vector_table++ / 2;
- for (j = 0; j < len; j++)
- {
- delta_pair = *sel_vector_table++;
- s->y_predictor_table[i+j] = 0xfffffffe &
- make_ydt16_entry(delta_pair >> 4, delta_pair & 0xf, s->ydt);
- s->c_predictor_table[i+j] = 0xfffffffe &
- make_cdt16_entry(delta_pair >> 4, delta_pair & 0xf, s->cdt);
- }
- s->y_predictor_table[i+(j-1)] |= 1;
- s->c_predictor_table[i+(j-1)] |= 1;
- }
-}
-
-static void gen_vector_table24(TrueMotion1Context *s, const uint8_t *sel_vector_table)
-{
- int len, i, j;
- unsigned char delta_pair;
-
- for (i = 0; i < 1024; i += 4)
- {
- len = *sel_vector_table++ / 2;
- for (j = 0; j < len; j++)
- {
- delta_pair = *sel_vector_table++;
- s->y_predictor_table[i+j] = 0xfffffffe &
- make_ydt24_entry(delta_pair >> 4, delta_pair & 0xf, s->ydt);
- s->c_predictor_table[i+j] = 0xfffffffe &
- make_cdt24_entry(delta_pair >> 4, delta_pair & 0xf, s->cdt);
- s->fat_y_predictor_table[i+j] = 0xfffffffe &
- make_ydt24_entry(delta_pair >> 4, delta_pair & 0xf, s->fat_ydt);
- s->fat_c_predictor_table[i+j] = 0xfffffffe &
- make_cdt24_entry(delta_pair >> 4, delta_pair & 0xf, s->fat_cdt);
- }
- s->y_predictor_table[i+(j-1)] |= 1;
- s->c_predictor_table[i+(j-1)] |= 1;
- s->fat_y_predictor_table[i+(j-1)] |= 1;
- s->fat_c_predictor_table[i+(j-1)] |= 1;
- }
-}
-
-/* Returns the number of bytes consumed from the bytestream. Returns -1 if
- * there was an error while decoding the header */
-static int truemotion1_decode_header(TrueMotion1Context *s)
-{
- int i;
- struct frame_header header;
- uint8_t header_buffer[128]; /* logical maximum size of the header */
- const uint8_t *sel_vector_table;
-
- /* There is 1 change bit per 4 pixels, so each change byte represents
- * 32 pixels; divide width by 4 to obtain the number of change bits and
- * then round up to the nearest byte. */
- s->mb_change_bits_row_size = ((s->avctx->width >> 2) + 7) >> 3;
-
- header.header_size = ((s->buf[0] >> 5) | (s->buf[0] << 3)) & 0x7f;
- if (s->buf[0] < 0x10)
- {
- av_log(s->avctx, AV_LOG_ERROR, "invalid header size (%d)\n", s->buf[0]);
- return -1;
- }
-
- /* unscramble the header bytes with a XOR operation */
- memset(header_buffer, 0, 128);
- for (i = 1; i < header.header_size; i++)
- header_buffer[i - 1] = s->buf[i] ^ s->buf[i + 1];
-
- header.compression = header_buffer[0];
- header.deltaset = header_buffer[1];
- header.vectable = header_buffer[2];
- header.ysize = AV_RL16(&header_buffer[3]);
- header.xsize = AV_RL16(&header_buffer[5]);
- header.checksum = AV_RL16(&header_buffer[7]);
- header.version = header_buffer[9];
- header.header_type = header_buffer[10];
- header.flags = header_buffer[11];
- header.control = header_buffer[12];
-
- /* Version 2 */
- if (header.version >= 2)
- {
- if (header.header_type > 3)
- {
- av_log(s->avctx, AV_LOG_ERROR, "invalid header type (%d)\n", header.header_type);
- return -1;
- } else if ((header.header_type == 2) || (header.header_type == 3)) {
- s->flags = header.flags;
- if (!(s->flags & FLAG_INTERFRAME))
- s->flags |= FLAG_KEYFRAME;
- } else
- s->flags = FLAG_KEYFRAME;
- } else /* Version 1 */
- s->flags = FLAG_KEYFRAME;
-
- if (s->flags & FLAG_SPRITE) {
- av_log(s->avctx, AV_LOG_INFO, "SPRITE frame found, please report the sample to the developers\n");
- s->w = header.width;
- s->h = header.height;
- s->x = header.xoffset;
- s->y = header.yoffset;
- } else {
- s->w = header.xsize;
- s->h = header.ysize;
- if (header.header_type < 2) {
- if ((s->w < 213) && (s->h >= 176))
- {
- s->flags |= FLAG_INTERPOLATED;
- av_log(s->avctx, AV_LOG_INFO, "INTERPOLATION selected, please report the sample to the developers\n");
- }
- }
- }
-
- if (header.compression > 17) {
- av_log(s->avctx, AV_LOG_ERROR, "invalid compression type (%d)\n", header.compression);
- return -1;
- }
-
- if ((header.deltaset != s->last_deltaset) ||
- (header.vectable != s->last_vectable))
- select_delta_tables(s, header.deltaset);
-
- if ((header.compression & 1) && header.header_type)
- sel_vector_table = pc_tbl2;
- else {
- if (header.vectable < 4)
- sel_vector_table = tables[header.vectable - 1];
- else {
- av_log(s->avctx, AV_LOG_ERROR, "invalid vector table id (%d)\n", header.vectable);
- return -1;
- }
- }
-
- // FIXME: where to place this ?!?!
- if (compression_types[header.compression].algorithm == ALGO_RGB24H)
- s->avctx->pix_fmt = PIX_FMT_RGBA32;
- else
- s->avctx->pix_fmt = PIX_FMT_RGB555; // RGB565 is supported aswell
-
- if ((header.deltaset != s->last_deltaset) || (header.vectable != s->last_vectable))
- {
- if (compression_types[header.compression].algorithm == ALGO_RGB24H)
- gen_vector_table24(s, sel_vector_table);
- else
- if (s->avctx->pix_fmt == PIX_FMT_RGB555)
- gen_vector_table15(s, sel_vector_table);
- else
- gen_vector_table16(s, sel_vector_table);
- }
-
- /* set up pointers to the other key data chunks */
- s->mb_change_bits = s->buf + header.header_size;
- if (s->flags & FLAG_KEYFRAME) {
- /* no change bits specified for a keyframe; only index bytes */
- s->index_stream = s->mb_change_bits;
- } else {
- /* one change bit per 4x4 block */
- s->index_stream = s->mb_change_bits +
- (s->mb_change_bits_row_size * (s->avctx->height >> 2));
- }
- s->index_stream_size = s->size - (s->index_stream - s->buf);
-
- s->last_deltaset = header.deltaset;
- s->last_vectable = header.vectable;
- s->compression = header.compression;
- s->block_width = compression_types[header.compression].block_width;
- s->block_height = compression_types[header.compression].block_height;
- s->block_type = compression_types[header.compression].block_type;
-
- if (s->avctx->debug & FF_DEBUG_PICT_INFO)
- av_log(s->avctx, AV_LOG_INFO, "tables: %d / %d c:%d %dx%d t:%d %s%s%s%s\n",
- s->last_deltaset, s->last_vectable, s->compression, s->block_width,
- s->block_height, s->block_type,
- s->flags & FLAG_KEYFRAME ? " KEY" : "",
- s->flags & FLAG_INTERFRAME ? " INTER" : "",
- s->flags & FLAG_SPRITE ? " SPRITE" : "",
- s->flags & FLAG_INTERPOLATED ? " INTERPOL" : "");
-
- return header.header_size;
-}
-
-static int truemotion1_decode_init(AVCodecContext *avctx)
-{
- TrueMotion1Context *s = (TrueMotion1Context *)avctx->priv_data;
-
- s->avctx = avctx;
-
- // FIXME: it may change ?
-// if (avctx->bits_per_sample == 24)
-// avctx->pix_fmt = PIX_FMT_RGB24;
-// else
-// avctx->pix_fmt = PIX_FMT_RGB555;
-
- avctx->has_b_frames = 0;
- s->frame.data[0] = s->prev_frame.data[0] = NULL;
-
- /* there is a vertical predictor for each pixel in a line; each vertical
- * predictor is 0 to start with */
- s->vert_pred =
- (unsigned int *)av_malloc(s->avctx->width * sizeof(unsigned int));
-
- return 0;
-}
-
-/*
-Block decoding order:
-
-dxi: Y-Y
-dxic: Y-C-Y
-dxic2: Y-C-Y-C
-
-hres,vres,i,i%vres (0 < i < 4)
-2x2 0: 0 dxic2
-2x2 1: 1 dxi
-2x2 2: 0 dxic2
-2x2 3: 1 dxi
-2x4 0: 0 dxic2
-2x4 1: 1 dxi
-2x4 2: 2 dxi
-2x4 3: 3 dxi
-4x2 0: 0 dxic
-4x2 1: 1 dxi
-4x2 2: 0 dxic
-4x2 3: 1 dxi
-4x4 0: 0 dxic
-4x4 1: 1 dxi
-4x4 2: 2 dxi
-4x4 3: 3 dxi
-*/
-
-#define GET_NEXT_INDEX() \
-{\
- if (index_stream_index >= s->index_stream_size) { \
- av_log(s->avctx, AV_LOG_INFO, " help! truemotion1 decoder went out of bounds\n"); \
- return; \
- } \
- index = s->index_stream[index_stream_index++] * 4; \
-}
-
-#define APPLY_C_PREDICTOR() \
- predictor_pair = s->c_predictor_table[index]; \
- horiz_pred += (predictor_pair >> 1); \
- if (predictor_pair & 1) { \
- GET_NEXT_INDEX() \
- if (!index) { \
- GET_NEXT_INDEX() \
- predictor_pair = s->c_predictor_table[index]; \
- horiz_pred += ((predictor_pair >> 1) * 5); \
- if (predictor_pair & 1) \
- GET_NEXT_INDEX() \
- else \
- index++; \
- } \
- } else \
- index++;
-
-#define APPLY_C_PREDICTOR_24() \
- predictor_pair = s->c_predictor_table[index]; \
- horiz_pred += (predictor_pair >> 1); \
- if (predictor_pair & 1) { \
- GET_NEXT_INDEX() \
- if (!index) { \
- GET_NEXT_INDEX() \
- predictor_pair = s->fat_c_predictor_table[index]; \
- horiz_pred += (predictor_pair >> 1); \
- if (predictor_pair & 1) \
- GET_NEXT_INDEX() \
- else \
- index++; \
- } \
- } else \
- index++;
-
-
-#define APPLY_Y_PREDICTOR() \
- predictor_pair = s->y_predictor_table[index]; \
- horiz_pred += (predictor_pair >> 1); \
- if (predictor_pair & 1) { \
- GET_NEXT_INDEX() \
- if (!index) { \
- GET_NEXT_INDEX() \
- predictor_pair = s->y_predictor_table[index]; \
- horiz_pred += ((predictor_pair >> 1) * 5); \
- if (predictor_pair & 1) \
- GET_NEXT_INDEX() \
- else \
- index++; \
- } \
- } else \
- index++;
-
-#define APPLY_Y_PREDICTOR_24() \
- predictor_pair = s->y_predictor_table[index]; \
- horiz_pred += (predictor_pair >> 1); \
- if (predictor_pair & 1) { \
- GET_NEXT_INDEX() \
- if (!index) { \
- GET_NEXT_INDEX() \
- predictor_pair = s->fat_y_predictor_table[index]; \
- horiz_pred += (predictor_pair >> 1); \
- if (predictor_pair & 1) \
- GET_NEXT_INDEX() \
- else \
- index++; \
- } \
- } else \
- index++;
-
-#define OUTPUT_PIXEL_PAIR() \
- *current_pixel_pair = *vert_pred + horiz_pred; \
- *vert_pred++ = *current_pixel_pair++; \
- prev_pixel_pair++;
-
-static void truemotion1_decode_16bit(TrueMotion1Context *s)
-{
- int y;
- int pixels_left; /* remaining pixels on this line */
- unsigned int predictor_pair;
- unsigned int horiz_pred;
- unsigned int *vert_pred;
- unsigned int *current_pixel_pair;
- unsigned int *prev_pixel_pair;
- unsigned char *current_line = s->frame.data[0];
- unsigned char *prev_line = s->prev_frame.data[0];
- int keyframe = s->flags & FLAG_KEYFRAME;
-
- /* these variables are for managing the stream of macroblock change bits */
- unsigned char *mb_change_bits = s->mb_change_bits;
- unsigned char mb_change_byte;
- unsigned char mb_change_byte_mask;
- int mb_change_index;
-
- /* these variables are for managing the main index stream */
- int index_stream_index = 0; /* yes, the index into the index stream */
- int index;
-
- /* clean out the line buffer */
- memset(s->vert_pred, 0, s->avctx->width * sizeof(unsigned int));
-
- GET_NEXT_INDEX();
-
- for (y = 0; y < s->avctx->height; y++) {
-
- /* re-init variables for the next line iteration */
- horiz_pred = 0;
- current_pixel_pair = (unsigned int *)current_line;
- prev_pixel_pair = (unsigned int *)prev_line;
- vert_pred = s->vert_pred;
- mb_change_index = 0;
- mb_change_byte = mb_change_bits[mb_change_index++];
- mb_change_byte_mask = 0x01;
- pixels_left = s->avctx->width;
-
- while (pixels_left > 0) {
-
- if (keyframe || ((mb_change_byte & mb_change_byte_mask) == 0)) {
-
- switch (y & 3) {
- case 0:
- /* if macroblock width is 2, apply C-Y-C-Y; else
- * apply C-Y-Y */
- if (s->block_width == 2) {
- APPLY_C_PREDICTOR();
- APPLY_Y_PREDICTOR();
- OUTPUT_PIXEL_PAIR();
- APPLY_C_PREDICTOR();
- APPLY_Y_PREDICTOR();
- OUTPUT_PIXEL_PAIR();
- } else {
- APPLY_C_PREDICTOR();
- APPLY_Y_PREDICTOR();
- OUTPUT_PIXEL_PAIR();
- APPLY_Y_PREDICTOR();
- OUTPUT_PIXEL_PAIR();
- }
- break;
-
- case 1:
- case 3:
- /* always apply 2 Y predictors on these iterations */
- APPLY_Y_PREDICTOR();
- OUTPUT_PIXEL_PAIR();
- APPLY_Y_PREDICTOR();
- OUTPUT_PIXEL_PAIR();
- break;
-
- case 2:
- /* this iteration might be C-Y-C-Y, Y-Y, or C-Y-Y
- * depending on the macroblock type */
- if (s->block_type == BLOCK_2x2) {
- APPLY_C_PREDICTOR();
- APPLY_Y_PREDICTOR();
- OUTPUT_PIXEL_PAIR();
- APPLY_C_PREDICTOR();
- APPLY_Y_PREDICTOR();
- OUTPUT_PIXEL_PAIR();
- } else if (s->block_type == BLOCK_4x2) {
- APPLY_C_PREDICTOR();
- APPLY_Y_PREDICTOR();
- OUTPUT_PIXEL_PAIR();
- APPLY_Y_PREDICTOR();
- OUTPUT_PIXEL_PAIR();
- } else {
- APPLY_Y_PREDICTOR();
- OUTPUT_PIXEL_PAIR();
- APPLY_Y_PREDICTOR();
- OUTPUT_PIXEL_PAIR();
- }
- break;
- }
-
- } else {
-
- /* skip (copy) four pixels, but reassign the horizontal
- * predictor */
- *current_pixel_pair = *prev_pixel_pair++;
- *vert_pred++ = *current_pixel_pair++;
- *current_pixel_pair = *prev_pixel_pair++;
- horiz_pred = *current_pixel_pair - *vert_pred;
- *vert_pred++ = *current_pixel_pair++;
-
- }
-
- if (!keyframe) {
- mb_change_byte_mask <<= 1;
-
- /* next byte */
- if (!mb_change_byte_mask) {
- mb_change_byte = mb_change_bits[mb_change_index++];
- mb_change_byte_mask = 0x01;
- }
- }
-
- pixels_left -= 4;
- }
-
- /* next change row */
- if (((y + 1) & 3) == 0)
- mb_change_bits += s->mb_change_bits_row_size;
-
- current_line += s->frame.linesize[0];
- prev_line += s->prev_frame.linesize[0];
- }
-}
-
-static void truemotion1_decode_24bit(TrueMotion1Context *s)
-{
- int y;
- int pixels_left; /* remaining pixels on this line */
- unsigned int predictor_pair;
- unsigned int horiz_pred;
- unsigned int *vert_pred;
- unsigned int *current_pixel_pair;
- unsigned int *prev_pixel_pair;
- unsigned char *current_line = s->frame.data[0];
- unsigned char *prev_line = s->prev_frame.data[0];
- int keyframe = s->flags & FLAG_KEYFRAME;
-
- /* these variables are for managing the stream of macroblock change bits */
- unsigned char *mb_change_bits = s->mb_change_bits;
- unsigned char mb_change_byte;
- unsigned char mb_change_byte_mask;
- int mb_change_index;
-
- /* these variables are for managing the main index stream */
- int index_stream_index = 0; /* yes, the index into the index stream */
- int index;
-
- /* clean out the line buffer */
- memset(s->vert_pred, 0, s->avctx->width * sizeof(unsigned int));
-
- GET_NEXT_INDEX();
-
- for (y = 0; y < s->avctx->height; y++) {
-
- /* re-init variables for the next line iteration */
- horiz_pred = 0;
- current_pixel_pair = (unsigned int *)current_line;
- prev_pixel_pair = (unsigned int *)prev_line;
- vert_pred = s->vert_pred;
- mb_change_index = 0;
- mb_change_byte = mb_change_bits[mb_change_index++];
- mb_change_byte_mask = 0x01;
- pixels_left = s->avctx->width;
-
- while (pixels_left > 0) {
-
- if (keyframe || ((mb_change_byte & mb_change_byte_mask) == 0)) {
-
- switch (y & 3) {
- case 0:
- /* if macroblock width is 2, apply C-Y-C-Y; else
- * apply C-Y-Y */
- if (s->block_width == 2) {
- APPLY_C_PREDICTOR_24();
- APPLY_Y_PREDICTOR_24();
- OUTPUT_PIXEL_PAIR();
- APPLY_C_PREDICTOR_24();
- APPLY_Y_PREDICTOR_24();
- OUTPUT_PIXEL_PAIR();
- } else {
- APPLY_C_PREDICTOR_24();
- APPLY_Y_PREDICTOR_24();
- OUTPUT_PIXEL_PAIR();
- APPLY_Y_PREDICTOR_24();
- OUTPUT_PIXEL_PAIR();
- }
- break;
-
- case 1:
- case 3:
- /* always apply 2 Y predictors on these iterations */
- APPLY_Y_PREDICTOR_24();
- OUTPUT_PIXEL_PAIR();
- APPLY_Y_PREDICTOR_24();
- OUTPUT_PIXEL_PAIR();
- break;
-
- case 2:
- /* this iteration might be C-Y-C-Y, Y-Y, or C-Y-Y
- * depending on the macroblock type */
- if (s->block_type == BLOCK_2x2) {
- APPLY_C_PREDICTOR_24();
- APPLY_Y_PREDICTOR_24();
- OUTPUT_PIXEL_PAIR();
- APPLY_C_PREDICTOR_24();
- APPLY_Y_PREDICTOR_24();
- OUTPUT_PIXEL_PAIR();
- } else if (s->block_type == BLOCK_4x2) {
- APPLY_C_PREDICTOR_24();
- APPLY_Y_PREDICTOR_24();
- OUTPUT_PIXEL_PAIR();
- APPLY_Y_PREDICTOR_24();
- OUTPUT_PIXEL_PAIR();
- } else {
- APPLY_Y_PREDICTOR_24();
- OUTPUT_PIXEL_PAIR();
- APPLY_Y_PREDICTOR_24();
- OUTPUT_PIXEL_PAIR();
- }
- break;
- }
-
- } else {
-
- /* skip (copy) four pixels, but reassign the horizontal
- * predictor */
- *current_pixel_pair = *prev_pixel_pair++;
- *vert_pred++ = *current_pixel_pair++;
- *current_pixel_pair = *prev_pixel_pair++;
- horiz_pred = *current_pixel_pair - *vert_pred;
- *vert_pred++ = *current_pixel_pair++;
-
- }
-
- if (!keyframe) {
- mb_change_byte_mask <<= 1;
-
- /* next byte */
- if (!mb_change_byte_mask) {
- mb_change_byte = mb_change_bits[mb_change_index++];
- mb_change_byte_mask = 0x01;
- }
- }
-
- pixels_left -= 4;
- }
-
- /* next change row */
- if (((y + 1) & 3) == 0)
- mb_change_bits += s->mb_change_bits_row_size;
-
- current_line += s->frame.linesize[0];
- prev_line += s->prev_frame.linesize[0];
- }
-}
-
-
-static int truemotion1_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- TrueMotion1Context *s = (TrueMotion1Context *)avctx->priv_data;
-
- s->buf = buf;
- s->size = buf_size;
-
- if (truemotion1_decode_header(s) == -1)
- return -1;
-
- s->frame.reference = 1;
- if (avctx->get_buffer(avctx, &s->frame) < 0) {
- av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
-
- /* check for a do-nothing frame and copy the previous frame */
- if (compression_types[s->compression].algorithm == ALGO_NOP)
- {
- memcpy(s->frame.data[0], s->prev_frame.data[0],
- s->frame.linesize[0] * s->avctx->height);
- } else if (compression_types[s->compression].algorithm == ALGO_RGB24H) {
- truemotion1_decode_24bit(s);
- } else {
- truemotion1_decode_16bit(s);
- }
-
- if (s->prev_frame.data[0])
- avctx->release_buffer(avctx, &s->prev_frame);
-
- /* shuffle frames */
- s->prev_frame = s->frame;
-
- *data_size = sizeof(AVFrame);
- *(AVFrame*)data = s->frame;
-
- /* report that the buffer was completely consumed */
- return buf_size;
-}
-
-static int truemotion1_decode_end(AVCodecContext *avctx)
-{
- TrueMotion1Context *s = (TrueMotion1Context *)avctx->priv_data;
-
- /* release the last frame */
- if (s->prev_frame.data[0])
- avctx->release_buffer(avctx, &s->prev_frame);
-
- av_free(s->vert_pred);
-
- return 0;
-}
-
-AVCodec truemotion1_decoder = {
- "truemotion1",
- CODEC_TYPE_VIDEO,
- CODEC_ID_TRUEMOTION1,
- sizeof(TrueMotion1Context),
- truemotion1_decode_init,
- NULL,
- truemotion1_decode_end,
- truemotion1_decode_frame,
- CODEC_CAP_DR1,
-};
diff --git a/src/libffmpeg/libavcodec/truemotion1data.h b/src/libffmpeg/libavcodec/truemotion1data.h
deleted file mode 100644
index 63d307c65..000000000
--- a/src/libffmpeg/libavcodec/truemotion1data.h
+++ /dev/null
@@ -1,829 +0,0 @@
-/*
- * Duck Truemotion v1 Decoding Tables
- *
- * Data in this file was originally part of VpVision from On2 which is
- * distributed under the GNU GPL. It is redistributed with ffmpeg under the
- * GNU LGPL using the common understanding that data tables necessary for
- * decoding algorithms are not necessarily licensable.
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#ifndef TRUEMOTION1DATA_H
-#define TRUEMOTION1DATA_H
-
-/* Y delta tables, skinny and fat */
-static const int16_t ydt1[8] = { 0, -2, 2, -6, 6, -12, 12, -12 };
-static const int16_t ydt2[8] = { 0, -2, 4, -6, 8, -12, 12, -12 };
-static const int16_t ydt3[8] = { 4, -6, 20, -20, 46, -46, 94, -94 };
-static const int16_t fat_ydt3[8] = { 0, -15, 50, -50, 115, -115, 235, -235 };
-static const int16_t ydt4[8] = { 0, -4, 4, -16, 16, -36, 36, -80 };
-static const int16_t fat_ydt4[8] = { 0, 40, 80, -76, 160, -154, 236, -236 };
-
-/* C delta tables, skinny and fat */
-static const int16_t cdt1[8] = { 0, -1, 1, -2, 3, -4, 5, -4 };
-static const int16_t cdt2[8] = { 0, -4, 3, -16, 20, -32, 36, -32 };
-static const int16_t fat_cdt2[8] = { 0, -20, 15, -80, 100, -160, 180, -160 };
-static const int16_t cdt3[8] = { 0, -2, 2, -8, 8, -18, 18, -40 };
-/* NOTE: This table breaks the [+,-] pattern that the rest of the
- * tables maintain. Is this intentional? */
-static const int16_t fat_cdt3[8] = { 0, 40, 80, -76, 160, -154, 236, -236 };
-
-/* all the delta tables to choose from, at all 4 delta levels */
-static const int16_t *ydts[] = { ydt1, ydt2, ydt3, ydt4, NULL };
-static const int16_t *fat_ydts[] = { fat_ydt3, fat_ydt3, fat_ydt3, fat_ydt4, NULL };
-static const int16_t *cdts[] = { cdt1, cdt1, cdt2, cdt3, NULL };
-static const int16_t *fat_cdts[] = { fat_cdt2, fat_cdt2, fat_cdt2, fat_cdt3, NULL };
-
-static const uint8_t pc_tbl2[] = {
-0x8,0x00,0x00,0x00,0x00,
-0x8,0x00,0x00,0x00,0x00,
-0x8,0x10,0x00,0x00,0x00,
-0x8,0x01,0x00,0x00,0x00,
-0x8,0x00,0x10,0x00,0x00,
-0x8,0x00,0x01,0x00,0x00,
-0x8,0x00,0x00,0x10,0x00,
-0x8,0x00,0x00,0x01,0x00,
-0x8,0x00,0x00,0x00,0x10,
-0x8,0x00,0x00,0x00,0x01,
-0x6,0x00,0x00,0x00,
-0x6,0x10,0x00,0x00,
-0x6,0x01,0x00,0x00,
-0x6,0x00,0x10,0x00,
-0x6,0x00,0x01,0x00,
-0x6,0x00,0x00,0x01,
-0x6,0x00,0x00,0x10,
-0x6,0x00,0x00,0x02,
-0x6,0x00,0x00,0x20,
-0x6,0x20,0x10,0x00,
-0x6,0x00,0x02,0x01,
-0x6,0x00,0x20,0x10,
-0x6,0x02,0x01,0x00,
-0x6,0x11,0x00,0x00,
-0x6,0x00,0x20,0x00,
-0x6,0x00,0x02,0x00,
-0x6,0x20,0x00,0x00,
-0x6,0x01,0x10,0x00,
-0x6,0x02,0x00,0x00,
-0x6,0x01,0x00,0x02,
-0x6,0x10,0x00,0x20,
-0x6,0x00,0x01,0x02,
-0x6,0x10,0x01,0x00,
-0x6,0x00,0x10,0x20,
-0x6,0x10,0x10,0x00,
-0x6,0x10,0x00,0x01,
-0x6,0x20,0x00,0x10,
-0x6,0x02,0x00,0x01,
-0x6,0x01,0x01,0x00,
-0x6,0x01,0x00,0x10,
-0x6,0x00,0x11,0x00,
-0x6,0x10,0x00,0x02,
-0x6,0x00,0x01,0x10,
-0x6,0x00,0x00,0x11,
-0x6,0x10,0x00,0x10,
-0x6,0x01,0x00,0x01,
-0x6,0x00,0x00,0x22,
-0x6,0x02,0x01,0x01,
-0x6,0x10,0x20,0x10,
-0x6,0x01,0x02,0x01,
-0x6,0x20,0x10,0x10,
-0x6,0x01,0x00,0x20,
-0x6,0x00,0x10,0x01,
-0x6,0x21,0x10,0x00,
-0x6,0x10,0x02,0x01,
-0x6,0x12,0x01,0x00,
-0x6,0x01,0x20,0x10,
-0x6,0x01,0x02,0x00,
-0x6,0x10,0x20,0x00,
-0x6,0x00,0x10,0x02,
-0x6,0x00,0x01,0x20,
-0x6,0x00,0x02,0x21,
-0x6,0x00,0x02,0x20,
-0x6,0x00,0x00,0x12,
-0x6,0x00,0x00,0x21,
-0x6,0x20,0x11,0x00,
-0x6,0x00,0x01,0x01,
-0x6,0x11,0x10,0x00,
-0x6,0x00,0x20,0x12,
-0x6,0x00,0x20,0x11,
-0x6,0x20,0x10,0x02,
-0x6,0x02,0x01,0x20,
-0x6,0x00,0x22,0x11,
-0x6,0x00,0x10,0x10,
-0x6,0x02,0x11,0x00,
-0x6,0x00,0x21,0x10,
-0x6,0x00,0x02,0x03,
-0x6,0x20,0x10,0x01,
-0x6,0x00,0x12,0x01,
-0x4,0x11,0x00,
-0x4,0x00,0x22,
-0x4,0x20,0x00,
-0x4,0x01,0x10,
-0x4,0x02,0x20,
-0x4,0x00,0x20,
-0x4,0x02,0x00,
-0x4,0x10,0x01,
-0x4,0x00,0x11,
-0x4,0x02,0x01,
-0x4,0x02,0x21,
-0x4,0x00,0x02,
-0x4,0x20,0x02,
-0x4,0x01,0x01,
-0x4,0x10,0x10,
-0x4,0x10,0x02,
-0x4,0x22,0x00,
-0x4,0x10,0x00,
-0x4,0x01,0x00,
-0x4,0x21,0x00,
-0x4,0x12,0x00,
-0x4,0x00,0x10,
-0x4,0x20,0x12,
-0x4,0x01,0x11,
-0x4,0x00,0x01,
-0x4,0x01,0x02,
-0x4,0x11,0x02,
-0x4,0x11,0x01,
-0x4,0x10,0x20,
-0x4,0x20,0x01,
-0x4,0x22,0x11,
-0x4,0x00,0x12,
-0x4,0x20,0x10,
-0x4,0x22,0x01,
-0x4,0x01,0x20,
-0x4,0x00,0x21,
-0x4,0x10,0x11,
-0x4,0x21,0x10,
-0x4,0x10,0x22,
-0x4,0x02,0x03,
-0x4,0x12,0x01,
-0x4,0x20,0x11,
-0x4,0x11,0x10,
-0x4,0x20,0x30,
-0x4,0x11,0x20,
-0x4,0x02,0x10,
-0x4,0x22,0x10,
-0x4,0x11,0x11,
-0x4,0x30,0x20,
-0x4,0x30,0x00,
-0x4,0x01,0x22,
-0x4,0x01,0x12,
-0x4,0x02,0x11,
-0x4,0x03,0x02,
-0x4,0x03,0x00,
-0x4,0x10,0x21,
-0x4,0x12,0x20,
-0x4,0x00,0x00,
-0x4,0x12,0x21,
-0x4,0x21,0x11,
-0x4,0x02,0x22,
-0x4,0x10,0x12,
-0x4,0x31,0x00,
-0x4,0x20,0x20,
-0x4,0x00,0x03,
-0x4,0x02,0x02,
-0x4,0x22,0x20,
-0x4,0x01,0x21,
-0x4,0x21,0x02,
-0x4,0x21,0x12,
-0x4,0x11,0x22,
-0x4,0x00,0x30,
-0x4,0x12,0x11,
-0x4,0x20,0x22,
-0x4,0x31,0x20,
-0x4,0x21,0x30,
-0x4,0x22,0x02,
-0x4,0x22,0x22,
-0x4,0x20,0x31,
-0x4,0x13,0x02,
-0x4,0x03,0x10,
-0x4,0x11,0x12,
-0x4,0x00,0x13,
-0x4,0x21,0x01,
-0x4,0x12,0x03,
-0x4,0x13,0x00,
-0x4,0x13,0x10,
-0x4,0x02,0x13,
-0x4,0x30,0x01,
-0x4,0x12,0x10,
-0x4,0x22,0x13,
-0x4,0x03,0x12,
-0x4,0x31,0x01,
-0x4,0x30,0x22,
-0x4,0x00,0x31,
-0x4,0x01,0x31,
-0x4,0x02,0x23,
-0x4,0x01,0x30,
-0x4,0x11,0x21,
-0x4,0x22,0x21,
-0x4,0x01,0x13,
-0x4,0x10,0x03,
-0x4,0x22,0x03,
-0x4,0x30,0x21,
-0x4,0x21,0x31,
-0x4,0x33,0x00,
-0x4,0x13,0x12,
-0x4,0x11,0x31,
-0x4,0x30,0x02,
-0x4,0x12,0x02,
-0x4,0x11,0x13,
-0x4,0x12,0x22,
-0x4,0x20,0x32,
-0x4,0x10,0x13,
-0x4,0x22,0x31,
-0x4,0x21,0x20,
-0x4,0x01,0x33,
-0x4,0x33,0x10,
-0x4,0x20,0x13,
-0x4,0x31,0x22,
-0x4,0x13,0x30,
-0x4,0x01,0x03,
-0x4,0x11,0x33,
-0x4,0x20,0x21,
-0x4,0x13,0x31,
-0x4,0x03,0x22,
-0x4,0x31,0x02,
-0x4,0x00,0x24,
-0x2,0x00,
-0x2,0x10,
-0x2,0x20,
-0x2,0x30,
-0x2,0x40,
-0x2,0x50,
-0x2,0x60,
-0x2,0x01,
-0x2,0x11,
-0x2,0x21,
-0x2,0x31,
-0x2,0x41,
-0x2,0x51,
-0x2,0x61,
-0x2,0x02,
-0x2,0x12,
-0x2,0x22,
-0x2,0x32,
-0x2,0x42,
-0x2,0x52,
-0x2,0x62,
-0x2,0x03,
-0x2,0x13,
-0x2,0x23,
-0x2,0x33,
-0x2,0x43,
-0x2,0x53,
-0x2,0x63,
-0x2,0x04,
-0x2,0x14,
-0x2,0x24,
-0x2,0x34,
-0x2,0x44,
-0x2,0x54,
-0x2,0x64,
-0x2,0x05,
-0x2,0x15,
-0x2,0x25,
-0x2,0x35,
-0x2,0x45,
-0x2,0x55,
-0x2,0x65,
-0x2,0x06,
-0x2,0x16,
-0x2,0x26,
-0x2,0x36,
-0x2,0x46,
-0x2,0x56,
-0x2,0x66
-};
-
-static const uint8_t pc_tbl3[] = {
-0x6,0x00,0x00,0x00,
-0x6,0x00,0x00,0x00,
-0x6,0x00,0x00,0x01,
-0x6,0x00,0x00,0x10,
-0x6,0x00,0x00,0x11,
-0x6,0x00,0x01,0x00,
-0x6,0x00,0x01,0x01,
-0x6,0x00,0x01,0x10,
-0x6,0x00,0x01,0x11,
-0x6,0x00,0x10,0x00,
-0x6,0x00,0x10,0x01,
-0x6,0x00,0x10,0x10,
-0x6,0x00,0x10,0x11,
-0x6,0x00,0x11,0x00,
-0x6,0x00,0x11,0x01,
-0x6,0x00,0x11,0x10,
-0x6,0x00,0x11,0x11,
-0x6,0x01,0x00,0x00,
-0x6,0x01,0x00,0x01,
-0x6,0x01,0x00,0x10,
-0x6,0x01,0x00,0x11,
-0x6,0x01,0x01,0x00,
-0x6,0x01,0x01,0x01,
-0x6,0x01,0x01,0x10,
-0x6,0x01,0x01,0x11,
-0x6,0x01,0x10,0x00,
-0x6,0x01,0x10,0x01,
-0x6,0x01,0x10,0x10,
-0x6,0x01,0x10,0x11,
-0x6,0x01,0x11,0x00,
-0x6,0x01,0x11,0x01,
-0x6,0x01,0x11,0x10,
-0x6,0x01,0x11,0x11,
-0x6,0x10,0x00,0x00,
-0x6,0x10,0x00,0x01,
-0x6,0x10,0x00,0x10,
-0x6,0x10,0x00,0x11,
-0x6,0x10,0x01,0x00,
-0x6,0x10,0x01,0x01,
-0x6,0x10,0x01,0x10,
-0x6,0x10,0x01,0x11,
-0x6,0x10,0x10,0x00,
-0x6,0x10,0x10,0x01,
-0x6,0x10,0x10,0x10,
-0x6,0x10,0x10,0x11,
-0x6,0x10,0x11,0x00,
-0x6,0x10,0x11,0x01,
-0x6,0x10,0x11,0x10,
-0x6,0x10,0x11,0x11,
-0x6,0x11,0x00,0x00,
-0x6,0x11,0x00,0x01,
-0x6,0x11,0x00,0x10,
-0x6,0x11,0x00,0x11,
-0x6,0x11,0x01,0x00,
-0x6,0x11,0x01,0x01,
-0x6,0x11,0x01,0x10,
-0x6,0x11,0x01,0x11,
-0x6,0x11,0x10,0x00,
-0x6,0x11,0x10,0x01,
-0x6,0x11,0x10,0x10,
-0x6,0x11,0x10,0x11,
-0x6,0x11,0x11,0x00,
-0x6,0x11,0x11,0x01,
-0x6,0x11,0x11,0x10,
-0x4,0x00,0x00,
-0x4,0x00,0x01,
-0x4,0x00,0x02,
-0x4,0x00,0x03,
-0x4,0x00,0x10,
-0x4,0x00,0x11,
-0x4,0x00,0x12,
-0x4,0x00,0x13,
-0x4,0x00,0x20,
-0x4,0x00,0x21,
-0x4,0x00,0x22,
-0x4,0x00,0x23,
-0x4,0x00,0x30,
-0x4,0x00,0x31,
-0x4,0x00,0x32,
-0x4,0x00,0x33,
-0x4,0x01,0x00,
-0x4,0x01,0x01,
-0x4,0x01,0x02,
-0x4,0x01,0x03,
-0x4,0x01,0x10,
-0x4,0x01,0x11,
-0x4,0x01,0x12,
-0x4,0x01,0x13,
-0x4,0x01,0x20,
-0x4,0x01,0x21,
-0x4,0x01,0x22,
-0x4,0x01,0x23,
-0x4,0x01,0x30,
-0x4,0x01,0x31,
-0x4,0x01,0x32,
-0x4,0x01,0x33,
-0x4,0x02,0x00,
-0x4,0x02,0x01,
-0x4,0x02,0x02,
-0x4,0x02,0x03,
-0x4,0x02,0x10,
-0x4,0x02,0x11,
-0x4,0x02,0x12,
-0x4,0x02,0x13,
-0x4,0x02,0x20,
-0x4,0x02,0x21,
-0x4,0x02,0x22,
-0x4,0x02,0x23,
-0x4,0x02,0x30,
-0x4,0x02,0x31,
-0x4,0x02,0x32,
-0x4,0x02,0x33,
-0x4,0x03,0x00,
-0x4,0x03,0x01,
-0x4,0x03,0x02,
-0x4,0x03,0x03,
-0x4,0x03,0x10,
-0x4,0x03,0x11,
-0x4,0x03,0x12,
-0x4,0x03,0x13,
-0x4,0x03,0x20,
-0x4,0x03,0x21,
-0x4,0x03,0x22,
-0x4,0x03,0x23,
-0x4,0x03,0x30,
-0x4,0x03,0x31,
-0x4,0x03,0x32,
-0x4,0x03,0x33,
-0x4,0x10,0x00,
-0x4,0x10,0x01,
-0x4,0x10,0x02,
-0x4,0x10,0x03,
-0x4,0x10,0x10,
-0x4,0x10,0x11,
-0x4,0x10,0x12,
-0x4,0x10,0x13,
-0x4,0x10,0x20,
-0x4,0x10,0x21,
-0x4,0x10,0x22,
-0x4,0x10,0x23,
-0x4,0x10,0x30,
-0x4,0x10,0x31,
-0x4,0x10,0x32,
-0x4,0x10,0x33,
-0x4,0x11,0x00,
-0x4,0x11,0x01,
-0x4,0x11,0x02,
-0x4,0x11,0x03,
-0x4,0x11,0x10,
-0x4,0x11,0x11,
-0x4,0x11,0x12,
-0x4,0x11,0x13,
-0x4,0x11,0x20,
-0x4,0x11,0x21,
-0x4,0x11,0x22,
-0x4,0x11,0x23,
-0x4,0x11,0x30,
-0x4,0x11,0x31,
-0x4,0x11,0x32,
-0x4,0x11,0x33,
-0x4,0x12,0x00,
-0x4,0x12,0x01,
-0x4,0x12,0x02,
-0x4,0x12,0x03,
-0x4,0x12,0x10,
-0x4,0x12,0x11,
-0x4,0x12,0x12,
-0x4,0x12,0x13,
-0x4,0x12,0x20,
-0x4,0x12,0x21,
-0x4,0x12,0x22,
-0x4,0x12,0x23,
-0x4,0x12,0x30,
-0x4,0x12,0x31,
-0x4,0x12,0x32,
-0x4,0x12,0x33,
-0x4,0x13,0x00,
-0x4,0x13,0x01,
-0x4,0x13,0x02,
-0x4,0x13,0x03,
-0x4,0x13,0x10,
-0x4,0x13,0x11,
-0x4,0x13,0x12,
-0x4,0x13,0x13,
-0x4,0x13,0x20,
-0x4,0x13,0x21,
-0x4,0x13,0x22,
-0x4,0x13,0x23,
-0x4,0x13,0x30,
-0x4,0x13,0x31,
-0x4,0x13,0x32,
-0x4,0x13,0x33,
-0x2,0x00,
-0x2,0x10,
-0x2,0x20,
-0x2,0x30,
-0x2,0x40,
-0x2,0x50,
-0x2,0x60,
-0x2,0x70,
-0x2,0x01,
-0x2,0x11,
-0x2,0x21,
-0x2,0x31,
-0x2,0x41,
-0x2,0x51,
-0x2,0x61,
-0x2,0x71,
-0x2,0x02,
-0x2,0x12,
-0x2,0x22,
-0x2,0x32,
-0x2,0x42,
-0x2,0x52,
-0x2,0x62,
-0x2,0x72,
-0x2,0x03,
-0x2,0x13,
-0x2,0x23,
-0x2,0x33,
-0x2,0x43,
-0x2,0x53,
-0x2,0x63,
-0x2,0x73,
-0x2,0x04,
-0x2,0x14,
-0x2,0x24,
-0x2,0x34,
-0x2,0x44,
-0x2,0x54,
-0x2,0x64,
-0x2,0x74,
-0x2,0x05,
-0x2,0x15,
-0x2,0x25,
-0x2,0x35,
-0x2,0x45,
-0x2,0x55,
-0x2,0x65,
-0x2,0x75,
-0x2,0x06,
-0x2,0x16,
-0x2,0x26,
-0x2,0x36,
-0x2,0x46,
-0x2,0x56,
-0x2,0x66,
-0x2,0x76,
-0x2,0x07,
-0x2,0x17,
-0x2,0x27,
-0x2,0x37,
-0x2,0x47,
-0x2,0x57,
-0x2,0x67,
-0x2,0x77
-};
-
-static const uint8_t pc_tbl4[] = {
-0x8,0x00,0x00,0x00,0x00,
-0x8,0x00,0x00,0x00,0x00,
-0x8,0x20,0x00,0x00,0x00,
-0x8,0x00,0x00,0x00,0x01,
-0x8,0x10,0x00,0x00,0x00,
-0x8,0x00,0x00,0x00,0x02,
-0x8,0x01,0x00,0x00,0x00,
-0x8,0x00,0x00,0x00,0x10,
-0x8,0x02,0x00,0x00,0x00,
-0x6,0x00,0x00,0x00,
-0x6,0x20,0x00,0x00,
-0x6,0x00,0x00,0x01,
-0x6,0x10,0x00,0x00,
-0x6,0x00,0x00,0x02,
-0x6,0x00,0x10,0x00,
-0x6,0x00,0x20,0x00,
-0x6,0x00,0x02,0x00,
-0x6,0x00,0x01,0x00,
-0x6,0x01,0x00,0x00,
-0x6,0x00,0x00,0x20,
-0x6,0x02,0x00,0x00,
-0x6,0x00,0x00,0x10,
-0x6,0x10,0x00,0x20,
-0x6,0x01,0x00,0x02,
-0x6,0x20,0x00,0x10,
-0x6,0x02,0x00,0x01,
-0x6,0x20,0x10,0x00,
-0x6,0x00,0x12,0x00,
-0x6,0x00,0x02,0x01,
-0x6,0x02,0x01,0x00,
-0x6,0x00,0x21,0x00,
-0x6,0x00,0x01,0x02,
-0x6,0x00,0x20,0x10,
-0x6,0x00,0x00,0x21,
-0x6,0x00,0x00,0x12,
-0x6,0x00,0x01,0x20,
-0x6,0x12,0x00,0x00,
-0x6,0x00,0x10,0x20,
-0x6,0x01,0x20,0x00,
-0x6,0x02,0x10,0x00,
-0x6,0x10,0x20,0x00,
-0x6,0x01,0x02,0x00,
-0x6,0x21,0x00,0x00,
-0x6,0x00,0x02,0x10,
-0x6,0x20,0x01,0x00,
-0x6,0x00,0x22,0x00,
-0x6,0x10,0x02,0x00,
-0x6,0x00,0x10,0x02,
-0x6,0x11,0x00,0x00,
-0x6,0x00,0x11,0x00,
-0x6,0x22,0x00,0x00,
-0x6,0x20,0x00,0x02,
-0x6,0x10,0x00,0x01,
-0x6,0x00,0x20,0x01,
-0x6,0x02,0x20,0x00,
-0x6,0x01,0x10,0x00,
-0x6,0x01,0x00,0x20,
-0x6,0x00,0x20,0x02,
-0x6,0x01,0x20,0x02,
-0x6,0x10,0x01,0x00,
-0x6,0x02,0x00,0x10,
-0x6,0x00,0x10,0x01,
-0x6,0x10,0x01,0x20,
-0x6,0x20,0x02,0x10,
-0x6,0x00,0x00,0x22,
-0x6,0x10,0x00,0x02,
-0x6,0x00,0x02,0x20,
-0x6,0x20,0x02,0x00,
-0x6,0x00,0x00,0x11,
-0x6,0x02,0x10,0x01,
-0x6,0x00,0x01,0x10,
-0x6,0x00,0x02,0x11,
-0x4,0x01,0x02,
-0x4,0x02,0x01,
-0x4,0x01,0x00,
-0x4,0x10,0x20,
-0x4,0x20,0x10,
-0x4,0x20,0x00,
-0x4,0x11,0x00,
-0x4,0x02,0x00,
-0x4,0x12,0x00,
-0x4,0x00,0x21,
-0x4,0x22,0x00,
-0x4,0x00,0x12,
-0x4,0x21,0x00,
-0x4,0x02,0x11,
-0x4,0x00,0x01,
-0x4,0x10,0x02,
-0x4,0x02,0x20,
-0x4,0x20,0x11,
-0x4,0x01,0x10,
-0x4,0x21,0x10,
-0x4,0x10,0x00,
-0x4,0x10,0x22,
-0x4,0x20,0x20,
-0x4,0x00,0x22,
-0x4,0x01,0x22,
-0x4,0x20,0x01,
-0x4,0x02,0x02,
-0x4,0x00,0x20,
-0x4,0x00,0x10,
-0x4,0x00,0x11,
-0x4,0x22,0x01,
-0x4,0x11,0x20,
-0x4,0x12,0x01,
-0x4,0x12,0x20,
-0x4,0x11,0x02,
-0x4,0x10,0x10,
-0x4,0x01,0x01,
-0x4,0x02,0x21,
-0x4,0x20,0x12,
-0x4,0x01,0x12,
-0x4,0x22,0x11,
-0x4,0x21,0x12,
-0x4,0x22,0x10,
-0x4,0x21,0x02,
-0x4,0x20,0x02,
-0x4,0x10,0x01,
-0x4,0x00,0x02,
-0x4,0x10,0x21,
-0x4,0x01,0x20,
-0x4,0x11,0x22,
-0x4,0x12,0x21,
-0x4,0x22,0x20,
-0x4,0x02,0x10,
-0x4,0x02,0x22,
-0x4,0x11,0x10,
-0x4,0x22,0x02,
-0x4,0x20,0x21,
-0x4,0x01,0x11,
-0x4,0x11,0x01,
-0x4,0x10,0x12,
-0x4,0x02,0x12,
-0x4,0x20,0x22,
-0x4,0x21,0x20,
-0x4,0x01,0x21,
-0x4,0x12,0x02,
-0x4,0x21,0x11,
-0x4,0x12,0x22,
-0x4,0x12,0x10,
-0x4,0x22,0x21,
-0x4,0x10,0x11,
-0x4,0x21,0x01,
-0x4,0x11,0x12,
-0x4,0x12,0x11,
-0x4,0x66,0x66,
-0x4,0x22,0x22,
-0x4,0x11,0x21,
-0x4,0x11,0x11,
-0x4,0x21,0x22,
-0x4,0x00,0x00,
-0x4,0x22,0x12,
-0x4,0x12,0x12,
-0x4,0x21,0x21,
-0x4,0x42,0x00,
-0x4,0x00,0x04,
-0x4,0x40,0x00,
-0x4,0x30,0x00,
-0x4,0x31,0x00,
-0x4,0x00,0x03,
-0x4,0x00,0x14,
-0x4,0x00,0x13,
-0x4,0x01,0x24,
-0x4,0x20,0x13,
-0x4,0x01,0x42,
-0x4,0x14,0x20,
-0x4,0x42,0x02,
-0x4,0x13,0x00,
-0x4,0x00,0x24,
-0x4,0x31,0x20,
-0x4,0x22,0x13,
-0x4,0x11,0x24,
-0x4,0x12,0x66,
-0x4,0x30,0x01,
-0x4,0x02,0x13,
-0x4,0x12,0x42,
-0x4,0x40,0x10,
-0x4,0x40,0x02,
-0x4,0x01,0x04,
-0x4,0x24,0x00,
-0x4,0x42,0x10,
-0x4,0x21,0x13,
-0x4,0x13,0x12,
-0x4,0x31,0x21,
-0x4,0x21,0x24,
-0x4,0x00,0x40,
-0x4,0x10,0x24,
-0x4,0x10,0x42,
-0x4,0x32,0x01,
-0x4,0x11,0x42,
-0x4,0x20,0x31,
-0x4,0x12,0x40,
-0x2,0x00,
-0x2,0x10,
-0x2,0x20,
-0x2,0x30,
-0x2,0x40,
-0x2,0x50,
-0x2,0x60,
-0x2,0x70,
-0x2,0x01,
-0x2,0x11,
-0x2,0x21,
-0x2,0x31,
-0x2,0x41,
-0x2,0x51,
-0x2,0x61,
-0x2,0x71,
-0x2,0x02,
-0x2,0x12,
-0x2,0x22,
-0x2,0x32,
-0x2,0x42,
-0x2,0x52,
-0x2,0x62,
-0x2,0x72,
-0x2,0x03,
-0x2,0x13,
-0x2,0x23,
-0x2,0x33,
-0x2,0x43,
-0x2,0x53,
-0x2,0x63,
-0x2,0x73,
-0x2,0x04,
-0x2,0x14,
-0x2,0x24,
-0x2,0x34,
-0x2,0x44,
-0x2,0x54,
-0x2,0x64,
-0x2,0x74,
-0x2,0x05,
-0x2,0x15,
-0x2,0x25,
-0x2,0x35,
-0x2,0x45,
-0x2,0x55,
-0x2,0x65,
-0x2,0x75,
-0x2,0x06,
-0x2,0x16,
-0x2,0x26,
-0x2,0x36,
-0x2,0x46,
-0x2,0x56,
-0x2,0x66,
-0x2,0x76,
-0x2,0x07,
-0x2,0x17,
-0x2,0x27,
-0x2,0x37,
-0x2,0x47,
-0x2,0x57,
-0x2,0x67,
-0x2,0x77
-};
-
-static const uint8_t *tables[] = { pc_tbl2, pc_tbl3, pc_tbl4 };
-#endif
diff --git a/src/libffmpeg/libavcodec/truemotion2.c b/src/libffmpeg/libavcodec/truemotion2.c
deleted file mode 100644
index e9bc6b7cb..000000000
--- a/src/libffmpeg/libavcodec/truemotion2.c
+++ /dev/null
@@ -1,893 +0,0 @@
-/*
- * Duck/ON2 TrueMotion 2 Decoder
- * Copyright (c) 2005 Konstantin Shishkov
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file truemotion2.c
- * Duck TrueMotion2 decoder.
- */
-
-#include "avcodec.h"
-#include "common.h"
-#include "bitstream.h"
-#include "dsputil.h"
-
-#define TM2_ESCAPE 0x80000000
-#define TM2_DELTAS 64
-/* Huffman-coded streams of different types of blocks */
-enum TM2_STREAMS{ TM2_C_HI = 0, TM2_C_LO, TM2_L_HI, TM2_L_LO,
- TM2_UPD, TM2_MOT, TM2_TYPE, TM2_NUM_STREAMS};
-/* Block types */
-enum TM2_BLOCKS{ TM2_HI_RES = 0, TM2_MED_RES, TM2_LOW_RES, TM2_NULL_RES,
- TM2_UPDATE, TM2_STILL, TM2_MOTION};
-
-typedef struct TM2Context{
- AVCodecContext *avctx;
- AVFrame pic;
-
- GetBitContext gb;
- DSPContext dsp;
-
- /* TM2 streams */
- int *tokens[TM2_NUM_STREAMS];
- int tok_lens[TM2_NUM_STREAMS];
- int tok_ptrs[TM2_NUM_STREAMS];
- int deltas[TM2_NUM_STREAMS][TM2_DELTAS];
- /* for blocks decoding */
- int D[4];
- int CD[4];
- int *last;
- int *clast;
-
- /* data for current and previous frame */
- int *Y1, *U1, *V1, *Y2, *U2, *V2;
- int cur;
-} TM2Context;
-
-/**
-* Huffman codes for each of streams
-*/
-typedef struct TM2Codes{
- VLC vlc; ///< table for FFmpeg bitstream reader
- int bits;
- int *recode; ///< table for converting from code indexes to values
- int length;
-} TM2Codes;
-
-/**
-* structure for gathering Huffman codes information
-*/
-typedef struct TM2Huff{
- int val_bits; ///< length of literal
- int max_bits; ///< maximum length of code
- int min_bits; ///< minimum length of code
- int nodes; ///< total number of nodes in tree
- int num; ///< current number filled
- int max_num; ///< total number of codes
- int *nums; ///< literals
- uint32_t *bits; ///< codes
- int *lens; ///< codelengths
-} TM2Huff;
-
-static int tm2_read_tree(TM2Context *ctx, uint32_t prefix, int length, TM2Huff *huff)
-{
- if(length > huff->max_bits) {
- av_log(ctx->avctx, AV_LOG_ERROR, "Tree exceeded its given depth (%i)\n", huff->max_bits);
- return -1;
- }
-
- if(!get_bits1(&ctx->gb)) { /* literal */
- if (length == 0) {
- length = 1;
- }
- if(huff->num >= huff->max_num) {
- av_log(ctx->avctx, AV_LOG_DEBUG, "Too many literals\n");
- return -1;
- }
- huff->nums[huff->num] = get_bits_long(&ctx->gb, huff->val_bits);
- huff->bits[huff->num] = prefix;
- huff->lens[huff->num] = length;
- huff->num++;
- return 0;
- } else { /* non-terminal node */
- if(tm2_read_tree(ctx, prefix << 1, length + 1, huff) == -1)
- return -1;
- if(tm2_read_tree(ctx, (prefix << 1) | 1, length + 1, huff) == -1)
- return -1;
- }
- return 0;
-}
-
-static int tm2_build_huff_table(TM2Context *ctx, TM2Codes *code)
-{
- TM2Huff huff;
- int res = 0;
-
- huff.val_bits = get_bits(&ctx->gb, 5);
- huff.max_bits = get_bits(&ctx->gb, 5);
- huff.min_bits = get_bits(&ctx->gb, 5);
- huff.nodes = get_bits_long(&ctx->gb, 17);
- huff.num = 0;
-
- /* check for correct codes parameters */
- if((huff.val_bits < 1) || (huff.val_bits > 32) ||
- (huff.max_bits < 0) || (huff.max_bits > 32)) {
- av_log(ctx->avctx, AV_LOG_ERROR, "Incorrect tree parameters - literal length: %i, max code length: %i\n",
- huff.val_bits, huff.max_bits);
- return -1;
- }
- if((huff.nodes < 0) || (huff.nodes > 0x10000)) {
- av_log(ctx->avctx, AV_LOG_ERROR, "Incorrect number of Huffman tree nodes: %i\n", huff.nodes);
- return -1;
- }
- /* one-node tree */
- if(huff.max_bits == 0)
- huff.max_bits = 1;
-
- /* allocate space for codes - it is exactly ceil(nodes / 2) entries */
- huff.max_num = (huff.nodes + 1) >> 1;
- huff.nums = av_mallocz(huff.max_num * sizeof(int));
- huff.bits = av_mallocz(huff.max_num * sizeof(uint32_t));
- huff.lens = av_mallocz(huff.max_num * sizeof(int));
-
- if(tm2_read_tree(ctx, 0, 0, &huff) == -1)
- res = -1;
-
- if(huff.num != huff.max_num) {
- av_log(ctx->avctx, AV_LOG_ERROR, "Got less codes than expected: %i of %i\n",
- huff.num, huff.max_num);
- res = -1;
- }
-
- /* convert codes to vlc_table */
- if(res != -1) {
- int i;
-
- res = init_vlc(&code->vlc, huff.max_bits, huff.max_num,
- huff.lens, sizeof(int), sizeof(int),
- huff.bits, sizeof(uint32_t), sizeof(uint32_t), 0);
- if(res < 0) {
- av_log(ctx->avctx, AV_LOG_ERROR, "Cannot build VLC table\n");
- res = -1;
- } else
- res = 0;
- if(res != -1) {
- code->bits = huff.max_bits;
- code->length = huff.max_num;
- code->recode = av_malloc(code->length * sizeof(int));
- for(i = 0; i < code->length; i++)
- code->recode[i] = huff.nums[i];
- }
- }
- /* free allocated memory */
- av_free(huff.nums);
- av_free(huff.bits);
- av_free(huff.lens);
-
- return res;
-}
-
-static void tm2_free_codes(TM2Codes *code)
-{
- if(code->recode)
- av_free(code->recode);
- if(code->vlc.table)
- free_vlc(&code->vlc);
-}
-
-static inline int tm2_get_token(GetBitContext *gb, TM2Codes *code)
-{
- int val;
- val = get_vlc2(gb, code->vlc.table, code->bits, 1);
- return code->recode[val];
-}
-
-static inline int tm2_read_header(TM2Context *ctx, uint8_t *buf)
-{
- uint32_t magic;
- uint8_t *obuf;
- int length;
-
- obuf = buf;
-
- magic = AV_RL32(buf);
- buf += 4;
-
- if(magic == 0x00000100) { /* old header */
-/* av_log (ctx->avctx, AV_LOG_ERROR, "TM2 old header: not implemented (yet)\n"); */
- return 40;
- } else if(magic == 0x00000101) { /* new header */
- int w, h, size, flags, xr, yr;
-
- length = AV_RL32(buf);
- buf += 4;
-
- init_get_bits(&ctx->gb, buf, 32 * 8);
- size = get_bits_long(&ctx->gb, 31);
- h = get_bits(&ctx->gb, 15);
- w = get_bits(&ctx->gb, 15);
- flags = get_bits_long(&ctx->gb, 31);
- yr = get_bits(&ctx->gb, 9);
- xr = get_bits(&ctx->gb, 9);
-
- return 40;
- } else {
- av_log (ctx->avctx, AV_LOG_ERROR, "Not a TM2 header: 0x%08X\n", magic);
- return -1;
- }
-
- return (buf - obuf);
-}
-
-static int tm2_read_deltas(TM2Context *ctx, int stream_id) {
- int d, mb;
- int i, v;
-
- d = get_bits(&ctx->gb, 9);
- mb = get_bits(&ctx->gb, 5);
-
- if((d < 1) || (d > TM2_DELTAS) || (mb < 1) || (mb > 32)) {
- av_log(ctx->avctx, AV_LOG_ERROR, "Incorrect delta table: %i deltas x %i bits\n", d, mb);
- return -1;
- }
-
- for(i = 0; i < d; i++) {
- v = get_bits_long(&ctx->gb, mb);
- if(v & (1 << (mb - 1)))
- ctx->deltas[stream_id][i] = v - (1 << mb);
- else
- ctx->deltas[stream_id][i] = v;
- }
- for(; i < TM2_DELTAS; i++)
- ctx->deltas[stream_id][i] = 0;
-
- return 0;
-}
-
-static int tm2_read_stream(TM2Context *ctx, uint8_t *buf, int stream_id) {
- int i;
- int cur = 0;
- int skip = 0;
- int len, toks;
- TM2Codes codes;
-
- /* get stream length in dwords */
- len = AV_RB32(buf); buf += 4; cur += 4;
- skip = len * 4 + 4;
-
- if(len == 0)
- return 4;
-
- toks = AV_RB32(buf); buf += 4; cur += 4;
- if(toks & 1) {
- len = AV_RB32(buf); buf += 4; cur += 4;
- if(len == TM2_ESCAPE) {
- len = AV_RB32(buf); buf += 4; cur += 4;
- }
- if(len > 0) {
- init_get_bits(&ctx->gb, buf, (skip - cur) * 8);
- if(tm2_read_deltas(ctx, stream_id) == -1)
- return -1;
- buf += ((get_bits_count(&ctx->gb) + 31) >> 5) << 2;
- cur += ((get_bits_count(&ctx->gb) + 31) >> 5) << 2;
- }
- }
- /* skip unused fields */
- if(AV_RB32(buf) == TM2_ESCAPE) {
- buf += 4; cur += 4; /* some unknown length - could be escaped too */
- }
- buf += 4; cur += 4;
- buf += 4; cur += 4; /* unused by decoder */
-
- init_get_bits(&ctx->gb, buf, (skip - cur) * 8);
- if(tm2_build_huff_table(ctx, &codes) == -1)
- return -1;
- buf += ((get_bits_count(&ctx->gb) + 31) >> 5) << 2;
- cur += ((get_bits_count(&ctx->gb) + 31) >> 5) << 2;
-
- toks >>= 1;
- /* check if we have sane number of tokens */
- if((toks < 0) || (toks > 0xFFFFFF)){
- av_log(ctx->avctx, AV_LOG_ERROR, "Incorrect number of tokens: %i\n", toks);
- tm2_free_codes(&codes);
- return -1;
- }
- ctx->tokens[stream_id] = av_realloc(ctx->tokens[stream_id], toks * sizeof(int));
- ctx->tok_lens[stream_id] = toks;
- len = AV_RB32(buf); buf += 4; cur += 4;
- if(len > 0) {
- init_get_bits(&ctx->gb, buf, (skip - cur) * 8);
- for(i = 0; i < toks; i++)
- ctx->tokens[stream_id][i] = tm2_get_token(&ctx->gb, &codes);
- } else {
- for(i = 0; i < toks; i++)
- ctx->tokens[stream_id][i] = codes.recode[0];
- }
- tm2_free_codes(&codes);
-
- return skip;
-}
-
-static inline int GET_TOK(TM2Context *ctx,int type) {
- if(ctx->tok_ptrs[type] >= ctx->tok_lens[type]) {
- av_log(ctx->avctx, AV_LOG_ERROR, "Read token from stream %i out of bounds (%i>=%i)\n", type, ctx->tok_ptrs[type], ctx->tok_lens[type]);
- return 0;
- }
- if(type <= TM2_MOT)
- return ctx->deltas[type][ctx->tokens[type][ctx->tok_ptrs[type]++]];
- return ctx->tokens[type][ctx->tok_ptrs[type]++];
-}
-
-/* blocks decoding routines */
-
-/* common Y, U, V pointers initialisation */
-#define TM2_INIT_POINTERS() \
- int *last, *clast; \
- int *Y, *U, *V;\
- int Ystride, Ustride, Vstride;\
-\
- Ystride = ctx->avctx->width;\
- Vstride = (ctx->avctx->width + 1) >> 1;\
- Ustride = (ctx->avctx->width + 1) >> 1;\
- Y = (ctx->cur?ctx->Y2:ctx->Y1) + by * 4 * Ystride + bx * 4;\
- V = (ctx->cur?ctx->V2:ctx->V1) + by * 2 * Vstride + bx * 2;\
- U = (ctx->cur?ctx->U2:ctx->U1) + by * 2 * Ustride + bx * 2;\
- last = ctx->last + bx * 4;\
- clast = ctx->clast + bx * 4;
-
-#define TM2_INIT_POINTERS_2() \
- int *Yo, *Uo, *Vo;\
- int oYstride, oUstride, oVstride;\
-\
- TM2_INIT_POINTERS();\
- oYstride = Ystride;\
- oVstride = Vstride;\
- oUstride = Ustride;\
- Yo = (ctx->cur?ctx->Y1:ctx->Y2) + by * 4 * oYstride + bx * 4;\
- Vo = (ctx->cur?ctx->V1:ctx->V2) + by * 2 * oVstride + bx * 2;\
- Uo = (ctx->cur?ctx->U1:ctx->U2) + by * 2 * oUstride + bx * 2;
-
-/* recalculate last and delta values for next blocks */
-#define TM2_RECALC_BLOCK(CHR, stride, last, CD) {\
- CD[0] = (CHR[1] - 128) - last[1];\
- CD[1] = (int)CHR[stride + 1] - (int)CHR[1];\
- last[0] = (int)CHR[stride + 0] - 128;\
- last[1] = (int)CHR[stride + 1] - 128;}
-
-/* common operations - add deltas to 4x4 block of luma or 2x2 blocks of chroma */
-static inline void tm2_apply_deltas(TM2Context *ctx, int* Y, int stride, int *deltas, int *last)
-{
- int ct, d;
- int i, j;
-
- for(j = 0; j < 4; j++){
- ct = ctx->D[j];
- for(i = 0; i < 4; i++){
- d = deltas[i + j * 4];
- ct += d;
- last[i] += ct;
- Y[i] = clip_uint8(last[i]);
- }
- Y += stride;
- ctx->D[j] = ct;
- }
-}
-
-static inline void tm2_high_chroma(int *data, int stride, int *last, int *CD, int *deltas)
-{
- int i, j;
- for(j = 0; j < 2; j++){
- for(i = 0; i < 2; i++){
- CD[j] += deltas[i + j * 2];
- last[i] += CD[j];
- data[i] = last[i] + 128;
- }
- data += stride;
- }
-}
-
-static inline void tm2_low_chroma(int *data, int stride, int *clast, int *CD, int *deltas, int bx)
-{
- int t;
- int l;
- int prev;
-
- if(bx > 0)
- prev = clast[-3];
- else
- prev = 0;
- t = (CD[0] + CD[1]) >> 1;
- l = (prev - CD[0] - CD[1] + clast[1]) >> 1;
- CD[1] = CD[0] + CD[1] - t;
- CD[0] = t;
- clast[0] = l;
-
- tm2_high_chroma(data, stride, clast, CD, deltas);
-}
-
-static inline void tm2_hi_res_block(TM2Context *ctx, AVFrame *pic, int bx, int by)
-{
- int i;
- int deltas[16];
- TM2_INIT_POINTERS();
-
- /* hi-res chroma */
- for(i = 0; i < 4; i++) {
- deltas[i] = GET_TOK(ctx, TM2_C_HI);
- deltas[i + 4] = GET_TOK(ctx, TM2_C_HI);
- }
- tm2_high_chroma(U, Ustride, clast, ctx->CD, deltas);
- tm2_high_chroma(V, Vstride, clast + 2, ctx->CD + 2, deltas + 4);
-
- /* hi-res luma */
- for(i = 0; i < 16; i++)
- deltas[i] = GET_TOK(ctx, TM2_L_HI);
-
- tm2_apply_deltas(ctx, Y, Ystride, deltas, last);
-}
-
-static inline void tm2_med_res_block(TM2Context *ctx, AVFrame *pic, int bx, int by)
-{
- int i;
- int deltas[16];
- TM2_INIT_POINTERS();
-
- /* low-res chroma */
- deltas[0] = GET_TOK(ctx, TM2_C_LO);
- deltas[1] = deltas[2] = deltas[3] = 0;
- tm2_low_chroma(U, Ustride, clast, ctx->CD, deltas, bx);
-
- deltas[0] = GET_TOK(ctx, TM2_C_LO);
- deltas[1] = deltas[2] = deltas[3] = 0;
- tm2_low_chroma(V, Vstride, clast + 2, ctx->CD + 2, deltas, bx);
-
- /* hi-res luma */
- for(i = 0; i < 16; i++)
- deltas[i] = GET_TOK(ctx, TM2_L_HI);
-
- tm2_apply_deltas(ctx, Y, Ystride, deltas, last);
-}
-
-static inline void tm2_low_res_block(TM2Context *ctx, AVFrame *pic, int bx, int by)
-{
- int i;
- int t1, t2;
- int deltas[16];
- TM2_INIT_POINTERS();
-
- /* low-res chroma */
- deltas[0] = GET_TOK(ctx, TM2_C_LO);
- deltas[1] = deltas[2] = deltas[3] = 0;
- tm2_low_chroma(U, Ustride, clast, ctx->CD, deltas, bx);
-
- deltas[0] = GET_TOK(ctx, TM2_C_LO);
- deltas[1] = deltas[2] = deltas[3] = 0;
- tm2_low_chroma(V, Vstride, clast + 2, ctx->CD + 2, deltas, bx);
-
- /* low-res luma */
- for(i = 0; i < 16; i++)
- deltas[i] = 0;
-
- deltas[ 0] = GET_TOK(ctx, TM2_L_LO);
- deltas[ 2] = GET_TOK(ctx, TM2_L_LO);
- deltas[ 8] = GET_TOK(ctx, TM2_L_LO);
- deltas[10] = GET_TOK(ctx, TM2_L_LO);
-
- if(bx > 0)
- last[0] = (last[-1] - ctx->D[0] - ctx->D[1] - ctx->D[2] - ctx->D[3] + last[1]) >> 1;
- else
- last[0] = (last[1] - ctx->D[0] - ctx->D[1] - ctx->D[2] - ctx->D[3])>> 1;
- last[2] = (last[1] + last[3]) >> 1;
-
- t1 = ctx->D[0] + ctx->D[1];
- ctx->D[0] = t1 >> 1;
- ctx->D[1] = t1 - (t1 >> 1);
- t2 = ctx->D[2] + ctx->D[3];
- ctx->D[2] = t2 >> 1;
- ctx->D[3] = t2 - (t2 >> 1);
-
- tm2_apply_deltas(ctx, Y, Ystride, deltas, last);
-}
-
-static inline void tm2_null_res_block(TM2Context *ctx, AVFrame *pic, int bx, int by)
-{
- int i;
- int ct;
- int left, right, diff;
- int deltas[16];
- TM2_INIT_POINTERS();
-
- /* null chroma */
- deltas[0] = deltas[1] = deltas[2] = deltas[3] = 0;
- tm2_low_chroma(U, Ustride, clast, ctx->CD, deltas, bx);
-
- deltas[0] = deltas[1] = deltas[2] = deltas[3] = 0;
- tm2_low_chroma(V, Vstride, clast + 2, ctx->CD + 2, deltas, bx);
-
- /* null luma */
- for(i = 0; i < 16; i++)
- deltas[i] = 0;
-
- ct = ctx->D[0] + ctx->D[1] + ctx->D[2] + ctx->D[3];
-
- if(bx > 0)
- left = last[-1] - ct;
- else
- left = 0;
-
- right = last[3];
- diff = right - left;
- last[0] = left + (diff >> 2);
- last[1] = left + (diff >> 1);
- last[2] = right - (diff >> 2);
- last[3] = right;
- {
- int tp = left;
-
- ctx->D[0] = (tp + (ct >> 2)) - left;
- left += ctx->D[0];
- ctx->D[1] = (tp + (ct >> 1)) - left;
- left += ctx->D[1];
- ctx->D[2] = ((tp + ct) - (ct >> 2)) - left;
- left += ctx->D[2];
- ctx->D[3] = (tp + ct) - left;
- }
- tm2_apply_deltas(ctx, Y, Ystride, deltas, last);
-}
-
-static inline void tm2_still_block(TM2Context *ctx, AVFrame *pic, int bx, int by)
-{
- int i, j;
- TM2_INIT_POINTERS_2();
-
- /* update chroma */
- for(j = 0; j < 2; j++){
- for(i = 0; i < 2; i++){
- U[i] = Uo[i];
- V[i] = Vo[i];
- }
- U += Ustride; V += Vstride;
- Uo += oUstride; Vo += oVstride;
- }
- U -= Ustride * 2;
- V -= Vstride * 2;
- TM2_RECALC_BLOCK(U, Ustride, clast, ctx->CD);
- TM2_RECALC_BLOCK(V, Vstride, (clast + 2), (ctx->CD + 2));
-
- /* update deltas */
- ctx->D[0] = Yo[3] - last[3];
- ctx->D[1] = Yo[3 + oYstride] - Yo[3];
- ctx->D[2] = Yo[3 + oYstride * 2] - Yo[3 + oYstride];
- ctx->D[3] = Yo[3 + oYstride * 3] - Yo[3 + oYstride * 2];
-
- for(j = 0; j < 4; j++){
- for(i = 0; i < 4; i++){
- Y[i] = Yo[i];
- last[i] = Yo[i];
- }
- Y += Ystride;
- Yo += oYstride;
- }
-}
-
-static inline void tm2_update_block(TM2Context *ctx, AVFrame *pic, int bx, int by)
-{
- int i, j;
- int d;
- TM2_INIT_POINTERS_2();
-
- /* update chroma */
- for(j = 0; j < 2; j++){
- for(i = 0; i < 2; i++){
- U[i] = Uo[i] + GET_TOK(ctx, TM2_UPD);
- V[i] = Vo[i] + GET_TOK(ctx, TM2_UPD);
- }
- U += Ustride; V += Vstride;
- Uo += oUstride; Vo += oVstride;
- }
- U -= Ustride * 2;
- V -= Vstride * 2;
- TM2_RECALC_BLOCK(U, Ustride, clast, ctx->CD);
- TM2_RECALC_BLOCK(V, Vstride, (clast + 2), (ctx->CD + 2));
-
- /* update deltas */
- ctx->D[0] = Yo[3] - last[3];
- ctx->D[1] = Yo[3 + oYstride] - Yo[3];
- ctx->D[2] = Yo[3 + oYstride * 2] - Yo[3 + oYstride];
- ctx->D[3] = Yo[3 + oYstride * 3] - Yo[3 + oYstride * 2];
-
- for(j = 0; j < 4; j++){
- d = last[3];
- for(i = 0; i < 4; i++){
- Y[i] = Yo[i] + GET_TOK(ctx, TM2_UPD);
- last[i] = Y[i];
- }
- ctx->D[j] = last[3] - d;
- Y += Ystride;
- Yo += oYstride;
- }
-}
-
-static inline void tm2_motion_block(TM2Context *ctx, AVFrame *pic, int bx, int by)
-{
- int i, j;
- int mx, my;
- TM2_INIT_POINTERS_2();
-
- mx = GET_TOK(ctx, TM2_MOT);
- my = GET_TOK(ctx, TM2_MOT);
-
- Yo += my * oYstride + mx;
- Uo += (my >> 1) * oUstride + (mx >> 1);
- Vo += (my >> 1) * oVstride + (mx >> 1);
-
- /* copy chroma */
- for(j = 0; j < 2; j++){
- for(i = 0; i < 2; i++){
- U[i] = Uo[i];
- V[i] = Vo[i];
- }
- U += Ustride; V += Vstride;
- Uo += oUstride; Vo += oVstride;
- }
- U -= Ustride * 2;
- V -= Vstride * 2;
- TM2_RECALC_BLOCK(U, Ustride, clast, ctx->CD);
- TM2_RECALC_BLOCK(V, Vstride, (clast + 2), (ctx->CD + 2));
-
- /* copy luma */
- for(j = 0; j < 4; j++){
- for(i = 0; i < 4; i++){
- Y[i] = Yo[i];
- }
- Y += Ystride;
- Yo += oYstride;
- }
- /* calculate deltas */
- Y -= Ystride * 4;
- ctx->D[0] = Y[3] - last[3];
- ctx->D[1] = Y[3 + Ystride] - Y[3];
- ctx->D[2] = Y[3 + Ystride * 2] - Y[3 + Ystride];
- ctx->D[3] = Y[3 + Ystride * 3] - Y[3 + Ystride * 2];
- for(i = 0; i < 4; i++)
- last[i] = Y[i + Ystride * 3];
-}
-
-static int tm2_decode_blocks(TM2Context *ctx, AVFrame *p)
-{
- int i, j;
- int bw, bh;
- int type;
- int keyframe = 1;
- uint8_t *Y, *U, *V;
- int *src;
-
- bw = ctx->avctx->width >> 2;
- bh = ctx->avctx->height >> 2;
-
- for(i = 0; i < TM2_NUM_STREAMS; i++)
- ctx->tok_ptrs[i] = 0;
-
- if (ctx->tok_lens[TM2_TYPE]<bw*bh){
- av_log(ctx->avctx,AV_LOG_ERROR,"Got %i tokens for %i blocks\n",ctx->tok_lens[TM2_TYPE],bw*bh);
- return -1;
- }
-
- memset(ctx->last, 0, 4 * bw * sizeof(int));
- memset(ctx->clast, 0, 4 * bw * sizeof(int));
-
- for(j = 0; j < bh; j++) {
- memset(ctx->D, 0, 4 * sizeof(int));
- memset(ctx->CD, 0, 4 * sizeof(int));
- for(i = 0; i < bw; i++) {
- type = GET_TOK(ctx, TM2_TYPE);
- switch(type) {
- case TM2_HI_RES:
- tm2_hi_res_block(ctx, p, i, j);
- break;
- case TM2_MED_RES:
- tm2_med_res_block(ctx, p, i, j);
- break;
- case TM2_LOW_RES:
- tm2_low_res_block(ctx, p, i, j);
- break;
- case TM2_NULL_RES:
- tm2_null_res_block(ctx, p, i, j);
- break;
- case TM2_UPDATE:
- tm2_update_block(ctx, p, i, j);
- keyframe = 0;
- break;
- case TM2_STILL:
- tm2_still_block(ctx, p, i, j);
- keyframe = 0;
- break;
- case TM2_MOTION:
- tm2_motion_block(ctx, p, i, j);
- keyframe = 0;
- break;
- default:
- av_log(ctx->avctx, AV_LOG_ERROR, "Skipping unknown block type %i\n", type);
- }
- }
- }
-
- /* copy data from our buffer to AVFrame */
- Y = p->data[0];
- src = (ctx->cur?ctx->Y2:ctx->Y1);
- for(j = 0; j < ctx->avctx->height; j++){
- for(i = 0; i < ctx->avctx->width; i++){
- Y[i] = clip_uint8(*src++);
- }
- Y += p->linesize[0];
- }
- U = p->data[2];
- src = (ctx->cur?ctx->U2:ctx->U1);
- for(j = 0; j < (ctx->avctx->height + 1) >> 1; j++){
- for(i = 0; i < (ctx->avctx->width + 1) >> 1; i++){
- U[i] = clip_uint8(*src++);
- }
- U += p->linesize[2];
- }
- V = p->data[1];
- src = (ctx->cur?ctx->V2:ctx->V1);
- for(j = 0; j < (ctx->avctx->height + 1) >> 1; j++){
- for(i = 0; i < (ctx->avctx->width + 1) >> 1; i++){
- V[i] = clip_uint8(*src++);
- }
- V += p->linesize[1];
- }
-
- return keyframe;
-}
-
-static int decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- TM2Context * const l = avctx->priv_data;
- AVFrame * const p= (AVFrame*)&l->pic;
- int skip, t;
-
- p->reference = 1;
- p->buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
- if(avctx->reget_buffer(avctx, p) < 0){
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
-
- l->dsp.bswap_buf((uint32_t*)buf, (uint32_t*)buf, buf_size >> 2);
- skip = tm2_read_header(l, buf);
-
- if(skip == -1)
- return -1;
-
- t = tm2_read_stream(l, buf + skip, TM2_C_HI);
- if(t == -1)
- return -1;
- skip += t;
- t = tm2_read_stream(l, buf + skip, TM2_C_LO);
- if(t == -1)
- return -1;
- skip += t;
- t = tm2_read_stream(l, buf + skip, TM2_L_HI);
- if(t == -1)
- return -1;
- skip += t;
- t = tm2_read_stream(l, buf + skip, TM2_L_LO);
- if(t == -1)
- return -1;
- skip += t;
- t = tm2_read_stream(l, buf + skip, TM2_UPD);
- if(t == -1)
- return -1;
- skip += t;
- t = tm2_read_stream(l, buf + skip, TM2_MOT);
- if(t == -1)
- return -1;
- skip += t;
- t = tm2_read_stream(l, buf + skip, TM2_TYPE);
- if(t == -1)
- return -1;
- p->key_frame = tm2_decode_blocks(l, p);
- if(p->key_frame)
- p->pict_type = FF_I_TYPE;
- else
- p->pict_type = FF_P_TYPE;
-
- l->cur = !l->cur;
- *data_size = sizeof(AVFrame);
- *(AVFrame*)data = l->pic;
-
- return buf_size;
-}
-
-static int decode_init(AVCodecContext *avctx){
- TM2Context * const l = avctx->priv_data;
- int i;
-
- if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
- return -1;
- }
- if((avctx->width & 3) || (avctx->height & 3)){
- av_log(avctx, AV_LOG_ERROR, "Width and height must be multiple of 4\n");
- return -1;
- }
-
- l->avctx = avctx;
- l->pic.data[0]=NULL;
- avctx->has_b_frames = 0;
- avctx->pix_fmt = PIX_FMT_YUV420P;
-
- dsputil_init(&l->dsp, avctx);
-
- l->last = av_malloc(4 * sizeof(int) * (avctx->width >> 2));
- l->clast = av_malloc(4 * sizeof(int) * (avctx->width >> 2));
-
- for(i = 0; i < TM2_NUM_STREAMS; i++) {
- l->tokens[i] = NULL;
- l->tok_lens[i] = 0;
- }
-
- l->Y1 = av_malloc(sizeof(int) * avctx->width * avctx->height);
- l->U1 = av_malloc(sizeof(int) * ((avctx->width + 1) >> 1) * ((avctx->height + 1) >> 1));
- l->V1 = av_malloc(sizeof(int) * ((avctx->width + 1) >> 1) * ((avctx->height + 1) >> 1));
- l->Y2 = av_malloc(sizeof(int) * avctx->width * avctx->height);
- l->U2 = av_malloc(sizeof(int) * ((avctx->width + 1) >> 1) * ((avctx->height + 1) >> 1));
- l->V2 = av_malloc(sizeof(int) * ((avctx->width + 1) >> 1) * ((avctx->height + 1) >> 1));
- l->cur = 0;
-
- return 0;
-}
-
-static int decode_end(AVCodecContext *avctx){
- TM2Context * const l = avctx->priv_data;
- int i;
-
- if(l->last)
- av_free(l->last);
- if(l->clast)
- av_free(l->clast);
- for(i = 0; i < TM2_NUM_STREAMS; i++)
- if(l->tokens[i])
- av_free(l->tokens[i]);
- if(l->Y1){
- av_free(l->Y1);
- av_free(l->U1);
- av_free(l->V1);
- av_free(l->Y2);
- av_free(l->U2);
- av_free(l->V2);
- }
- return 0;
-}
-
-AVCodec truemotion2_decoder = {
- "truemotion2",
- CODEC_TYPE_VIDEO,
- CODEC_ID_TRUEMOTION2,
- sizeof(TM2Context),
- decode_init,
- NULL,
- decode_end,
- decode_frame,
- CODEC_CAP_DR1,
-};
diff --git a/src/libffmpeg/libavcodec/truespeech.c b/src/libffmpeg/libavcodec/truespeech.c
deleted file mode 100644
index d37aa9454..000000000
--- a/src/libffmpeg/libavcodec/truespeech.c
+++ /dev/null
@@ -1,381 +0,0 @@
-/*
- * DSP Group TrueSpeech compatible decoder
- * Copyright (c) 2005 Konstantin Shishkov
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "avcodec.h"
-
-#include "truespeech_data.h"
-/**
- * @file truespeech.c
- * TrueSpeech decoder.
- */
-
-/**
- * TrueSpeech decoder context
- */
-typedef struct {
- /* input data */
- int16_t vector[8]; //< input vector: 5/5/4/4/4/3/3/3
- int offset1[2]; //< 8-bit value, used in one copying offset
- int offset2[4]; //< 7-bit value, encodes offsets for copying and for two-point filter
- int pulseoff[4]; //< 4-bit offset of pulse values block
- int pulsepos[4]; //< 27-bit variable, encodes 7 pulse positions
- int pulseval[4]; //< 7x2-bit pulse values
- int flag; //< 1-bit flag, shows how to choose filters
- /* temporary data */
- int filtbuf[146]; // some big vector used for storing filters
- int prevfilt[8]; // filter from previous frame
- int16_t tmp1[8]; // coefficients for adding to out
- int16_t tmp2[8]; // coefficients for adding to out
- int16_t tmp3[8]; // coefficients for adding to out
- int16_t cvector[8]; // correlated input vector
- int filtval; // gain value for one function
- int16_t newvec[60]; // tmp vector
- int16_t filters[32]; // filters for every subframe
-} TSContext;
-
-static int truespeech_decode_init(AVCodecContext * avctx)
-{
-// TSContext *c = avctx->priv_data;
-
- return 0;
-}
-
-static void truespeech_read_frame(TSContext *dec, uint8_t *input)
-{
- uint32_t t;
-
- /* first dword */
- t = AV_RL32(input);
- input += 4;
-
- dec->flag = t & 1;
-
- dec->vector[0] = ts_codebook[0][(t >> 1) & 0x1F];
- dec->vector[1] = ts_codebook[1][(t >> 6) & 0x1F];
- dec->vector[2] = ts_codebook[2][(t >> 11) & 0xF];
- dec->vector[3] = ts_codebook[3][(t >> 15) & 0xF];
- dec->vector[4] = ts_codebook[4][(t >> 19) & 0xF];
- dec->vector[5] = ts_codebook[5][(t >> 23) & 0x7];
- dec->vector[6] = ts_codebook[6][(t >> 26) & 0x7];
- dec->vector[7] = ts_codebook[7][(t >> 29) & 0x7];
-
- /* second dword */
- t = AV_RL32(input);
- input += 4;
-
- dec->offset2[0] = (t >> 0) & 0x7F;
- dec->offset2[1] = (t >> 7) & 0x7F;
- dec->offset2[2] = (t >> 14) & 0x7F;
- dec->offset2[3] = (t >> 21) & 0x7F;
-
- dec->offset1[0] = ((t >> 28) & 0xF) << 4;
-
- /* third dword */
- t = AV_RL32(input);
- input += 4;
-
- dec->pulseval[0] = (t >> 0) & 0x3FFF;
- dec->pulseval[1] = (t >> 14) & 0x3FFF;
-
- dec->offset1[1] = (t >> 28) & 0x0F;
-
- /* fourth dword */
- t = AV_RL32(input);
- input += 4;
-
- dec->pulseval[2] = (t >> 0) & 0x3FFF;
- dec->pulseval[3] = (t >> 14) & 0x3FFF;
-
- dec->offset1[1] |= ((t >> 28) & 0x0F) << 4;
-
- /* fifth dword */
- t = AV_RL32(input);
- input += 4;
-
- dec->pulsepos[0] = (t >> 4) & 0x7FFFFFF;
-
- dec->pulseoff[0] = (t >> 0) & 0xF;
-
- dec->offset1[0] |= (t >> 31) & 1;
-
- /* sixth dword */
- t = AV_RL32(input);
- input += 4;
-
- dec->pulsepos[1] = (t >> 4) & 0x7FFFFFF;
-
- dec->pulseoff[1] = (t >> 0) & 0xF;
-
- dec->offset1[0] |= ((t >> 31) & 1) << 1;
-
- /* seventh dword */
- t = AV_RL32(input);
- input += 4;
-
- dec->pulsepos[2] = (t >> 4) & 0x7FFFFFF;
-
- dec->pulseoff[2] = (t >> 0) & 0xF;
-
- dec->offset1[0] |= ((t >> 31) & 1) << 2;
-
- /* eighth dword */
- t = AV_RL32(input);
- input += 4;
-
- dec->pulsepos[3] = (t >> 4) & 0x7FFFFFF;
-
- dec->pulseoff[3] = (t >> 0) & 0xF;
-
- dec->offset1[0] |= ((t >> 31) & 1) << 3;
-
-}
-
-static void truespeech_correlate_filter(TSContext *dec)
-{
- int16_t tmp[8];
- int i, j;
-
- for(i = 0; i < 8; i++){
- if(i > 0){
- memcpy(tmp, dec->cvector, i * 2);
- for(j = 0; j < i; j++)
- dec->cvector[j] = ((tmp[i - j - 1] * dec->vector[i]) +
- (dec->cvector[j] << 15) + 0x4000) >> 15;
- }
- dec->cvector[i] = (8 - dec->vector[i]) >> 3;
- }
- for(i = 0; i < 8; i++)
- dec->cvector[i] = (dec->cvector[i] * ts_230[i]) >> 15;
-
- dec->filtval = dec->vector[0];
-}
-
-static void truespeech_filters_merge(TSContext *dec)
-{
- int i;
-
- if(!dec->flag){
- for(i = 0; i < 8; i++){
- dec->filters[i + 0] = dec->prevfilt[i];
- dec->filters[i + 8] = dec->prevfilt[i];
- }
- }else{
- for(i = 0; i < 8; i++){
- dec->filters[i + 0]=(dec->cvector[i] * 21846 + dec->prevfilt[i] * 10923 + 16384) >> 15;
- dec->filters[i + 8]=(dec->cvector[i] * 10923 + dec->prevfilt[i] * 21846 + 16384) >> 15;
- }
- }
- for(i = 0; i < 8; i++){
- dec->filters[i + 16] = dec->cvector[i];
- dec->filters[i + 24] = dec->cvector[i];
- }
-}
-
-static void truespeech_apply_twopoint_filter(TSContext *dec, int quart)
-{
- int16_t tmp[146 + 60], *ptr0, *ptr1;
- const int16_t *filter;
- int i, t, off;
-
- t = dec->offset2[quart];
- if(t == 127){
- memset(dec->newvec, 0, 60 * 2);
- return;
- }
- for(i = 0; i < 146; i++)
- tmp[i] = dec->filtbuf[i];
- off = (t / 25) + dec->offset1[quart >> 1] + 18;
- ptr0 = tmp + 145 - off;
- ptr1 = tmp + 146;
- filter = (const int16_t*)ts_240 + (t % 25) * 2;
- for(i = 0; i < 60; i++){
- t = (ptr0[0] * filter[0] + ptr0[1] * filter[1] + 0x2000) >> 14;
- ptr0++;
- dec->newvec[i] = t;
- ptr1[i] = t;
- }
-}
-
-static void truespeech_place_pulses(TSContext *dec, int16_t *out, int quart)
-{
- int16_t tmp[7];
- int i, j, t;
- const int16_t *ptr1;
- int16_t *ptr2;
- int coef;
-
- memset(out, 0, 60 * 2);
- for(i = 0; i < 7; i++) {
- t = dec->pulseval[quart] & 3;
- dec->pulseval[quart] >>= 2;
- tmp[6 - i] = ts_562[dec->pulseoff[quart] * 4 + t];
- }
-
- coef = dec->pulsepos[quart] >> 15;
- ptr1 = (const int16_t*)ts_140 + 30;
- ptr2 = tmp;
- for(i = 0, j = 3; (i < 30) && (j > 0); i++){
- t = *ptr1++;
- if(coef >= t)
- coef -= t;
- else{
- out[i] = *ptr2++;
- ptr1 += 30;
- j--;
- }
- }
- coef = dec->pulsepos[quart] & 0x7FFF;
- ptr1 = (const int16_t*)ts_140;
- for(i = 30, j = 4; (i < 60) && (j > 0); i++){
- t = *ptr1++;
- if(coef >= t)
- coef -= t;
- else{
- out[i] = *ptr2++;
- ptr1 += 30;
- j--;
- }
- }
-
-}
-
-static void truespeech_update_filters(TSContext *dec, int16_t *out, int quart)
-{
- int i;
-
- for(i = 0; i < 86; i++)
- dec->filtbuf[i] = dec->filtbuf[i + 60];
- for(i = 0; i < 60; i++){
- dec->filtbuf[i + 86] = out[i] + dec->newvec[i] - (dec->newvec[i] >> 3);
- out[i] += dec->newvec[i];
- }
-}
-
-static void truespeech_synth(TSContext *dec, int16_t *out, int quart)
-{
- int i,k;
- int t[8];
- int16_t *ptr0, *ptr1;
-
- ptr0 = dec->tmp1;
- ptr1 = dec->filters + quart * 8;
- for(i = 0; i < 60; i++){
- int sum = 0;
- for(k = 0; k < 8; k++)
- sum += ptr0[k] * ptr1[k];
- sum = (sum + (out[i] << 12) + 0x800) >> 12;
- out[i] = clip(sum, -0x7FFE, 0x7FFE);
- for(k = 7; k > 0; k--)
- ptr0[k] = ptr0[k - 1];
- ptr0[0] = out[i];
- }
-
- for(i = 0; i < 8; i++)
- t[i] = (ts_5E2[i] * ptr1[i]) >> 15;
-
- ptr0 = dec->tmp2;
- for(i = 0; i < 60; i++){
- int sum = 0;
- for(k = 0; k < 8; k++)
- sum += ptr0[k] * t[k];
- for(k = 7; k > 0; k--)
- ptr0[k] = ptr0[k - 1];
- ptr0[0] = out[i];
- out[i] = ((out[i] << 12) - sum) >> 12;
- }
-
- for(i = 0; i < 8; i++)
- t[i] = (ts_5F2[i] * ptr1[i]) >> 15;
-
- ptr0 = dec->tmp3;
- for(i = 0; i < 60; i++){
- int sum = out[i] << 12;
- for(k = 0; k < 8; k++)
- sum += ptr0[k] * t[k];
- for(k = 7; k > 0; k--)
- ptr0[k] = ptr0[k - 1];
- ptr0[0] = clip((sum + 0x800) >> 12, -0x7FFE, 0x7FFE);
-
- sum = ((ptr0[1] * (dec->filtval - (dec->filtval >> 2))) >> 4) + sum;
- sum = sum - (sum >> 3);
- out[i] = clip((sum + 0x800) >> 12, -0x7FFE, 0x7FFE);
- }
-}
-
-static void truespeech_save_prevvec(TSContext *c)
-{
- int i;
-
- for(i = 0; i < 8; i++)
- c->prevfilt[i] = c->cvector[i];
-}
-
-static int truespeech_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- TSContext *c = avctx->priv_data;
-
- int i;
- short *samples = data;
- int consumed = 0;
- int16_t out_buf[240];
-
- if (!buf_size)
- return 0;
-
- while (consumed < buf_size) {
- truespeech_read_frame(c, buf + consumed);
- consumed += 32;
-
- truespeech_correlate_filter(c);
- truespeech_filters_merge(c);
-
- memset(out_buf, 0, 240 * 2);
- for(i = 0; i < 4; i++) {
- truespeech_apply_twopoint_filter(c, i);
- truespeech_place_pulses(c, out_buf + i * 60, i);
- truespeech_update_filters(c, out_buf + i * 60, i);
- truespeech_synth(c, out_buf + i * 60, i);
- }
-
- truespeech_save_prevvec(c);
-
- /* finally output decoded frame */
- for(i = 0; i < 240; i++)
- *samples++ = out_buf[i];
-
- }
-
- *data_size = consumed * 15;
-
- return buf_size;
-}
-
-AVCodec truespeech_decoder = {
- "truespeech",
- CODEC_TYPE_AUDIO,
- CODEC_ID_TRUESPEECH,
- sizeof(TSContext),
- truespeech_decode_init,
- NULL,
- NULL,
- truespeech_decode_frame,
-};
diff --git a/src/libffmpeg/libavcodec/truespeech_data.h b/src/libffmpeg/libavcodec/truespeech_data.h
deleted file mode 100644
index cd8822fde..000000000
--- a/src/libffmpeg/libavcodec/truespeech_data.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * DSP Group TrueSpeech compatible decoder
- * copyright (c) 2005 Konstantin Shishkov
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef __TRUESPEECH_DATA__
-#define __TRUESPEECH_DATA__
-
-/* codebooks fo expanding input filter */
-static const int16_t ts_cb_0[32] = {
- 0x8240, 0x8364, 0x84CE, 0x865D, 0x8805, 0x89DE, 0x8BD7, 0x8DF4,
- 0x9051, 0x92E2, 0x95DE, 0x990F, 0x9C81, 0xA079, 0xA54C, 0xAAD2,
- 0xB18A, 0xB90A, 0xC124, 0xC9CC, 0xD339, 0xDDD3, 0xE9D6, 0xF893,
- 0x096F, 0x1ACA, 0x29EC, 0x381F, 0x45F9, 0x546A, 0x63C3, 0x73B5,
-};
-
-static const int16_t ts_cb_1[32] = {
- 0x9F65, 0xB56B, 0xC583, 0xD371, 0xE018, 0xEBB4, 0xF61C, 0xFF59,
- 0x085B, 0x1106, 0x1952, 0x214A, 0x28C9, 0x2FF8, 0x36E6, 0x3D92,
- 0x43DF, 0x49BB, 0x4F46, 0x5467, 0x5930, 0x5DA3, 0x61EC, 0x65F9,
- 0x69D4, 0x6D5A, 0x709E, 0x73AD, 0x766B, 0x78F0, 0x7B5A, 0x7DA5,
-};
-
-static const int16_t ts_cb_2[16] = {
- 0x96F8, 0xA3B4, 0xAF45, 0xBA53, 0xC4B1, 0xCECC, 0xD86F, 0xE21E,
- 0xEBF3, 0xF640, 0x00F7, 0x0C20, 0x1881, 0x269A, 0x376B, 0x4D60,
-};
-
-static const int16_t ts_cb_3[16] = {
- 0xC654, 0xDEF2, 0xEFAA, 0xFD94, 0x096A, 0x143F, 0x1E7B, 0x282C,
- 0x3176, 0x3A89, 0x439F, 0x4CA2, 0x557F, 0x5E50, 0x6718, 0x6F8D,
-};
-
-static const int16_t ts_cb_4[16] = {
- 0xABE7, 0xBBA8, 0xC81C, 0xD326, 0xDD0E, 0xE5D4, 0xEE22, 0xF618,
- 0xFE28, 0x064F, 0x0EB7, 0x17B8, 0x21AA, 0x2D8B, 0x3BA2, 0x4DF9,
-};
-
-static const int16_t ts_cb_5[8] = {
- 0xD51B, 0xF12E, 0x042E, 0x13C7, 0x2260, 0x311B, 0x40DE, 0x5385,
-};
-
-static const int16_t ts_cb_6[8] = {
- 0xB550, 0xC825, 0xD980, 0xE997, 0xF883, 0x0752, 0x1811, 0x2E18,
-};
-
-static const int16_t ts_cb_7[8] = {
- 0xCEF0, 0xE4F9, 0xF6BB, 0x0646, 0x14F5, 0x23FF, 0x356F, 0x4A8D,
-};
-
-static const int16_t *ts_codebook[8] = {
- ts_cb_0, ts_cb_1, ts_cb_2, ts_cb_3, ts_cb_4, ts_cb_5, ts_cb_6, ts_cb_7
-};
-
-/* table used for decoding pulse positions */
-static const int16_t ts_140[120] = {
- 0x0E46, 0x0CCC, 0x0B6D, 0x0A28, 0x08FC, 0x07E8, 0x06EB, 0x0604,
- 0x0532, 0x0474, 0x03C9, 0x0330, 0x02A8, 0x0230, 0x01C7, 0x016C,
- 0x011E, 0x00DC, 0x00A5, 0x0078, 0x0054, 0x0038, 0x0023, 0x0014,
- 0x000A, 0x0004, 0x0001, 0x0000, 0x0000, 0x0000,
-
- 0x0196, 0x017A, 0x015F, 0x0145, 0x012C, 0x0114, 0x00FD, 0x00E7,
- 0x00D2, 0x00BE, 0x00AB, 0x0099, 0x0088, 0x0078, 0x0069, 0x005B,
- 0x004E, 0x0042, 0x0037, 0x002D, 0x0024, 0x001C, 0x0015, 0x000F,
- 0x000A, 0x0006, 0x0003, 0x0001, 0x0000, 0x0000,
-
- 0x001D, 0x001C, 0x001B, 0x001A, 0x0019, 0x0018, 0x0017, 0x0016,
- 0x0015, 0x0014, 0x0013, 0x0012, 0x0011, 0x0010, 0x000F, 0x000E,
- 0x000D, 0x000C, 0x000B, 0x000A, 0x0009, 0x0008, 0x0007, 0x0006,
- 0x0005, 0x0004, 0x0003, 0x0002, 0x0001, 0x0000,
-
- 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
- 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
- 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
- 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001
-};
-
-/* filter for correlated input filter */
-static const int16_t ts_230[8] =
- { 0x7F3B, 0x7E78, 0x7DB6, 0x7CF5, 0x7C35, 0x7B76, 0x7AB8, 0x79FC };
-
-/* two-point filters table */
-static const int16_t ts_240[25 * 2] = {
- 0xED2F, 0x5239,
- 0x54F1, 0xE4A9,
- 0x2620, 0xEE3E,
- 0x09D6, 0x2C40,
- 0xEFB5, 0x2BE0,
-
- 0x3FE1, 0x3339,
- 0x442F, 0xE6FE,
- 0x4458, 0xF9DF,
- 0xF231, 0x43DB,
- 0x3DB0, 0xF705,
-
- 0x4F7B, 0xFEFB,
- 0x26AD, 0x0CDC,
- 0x33C2, 0x0739,
- 0x12BE, 0x43A2,
- 0x1BDF, 0x1F3E,
-
- 0x0211, 0x0796,
- 0x2AEB, 0x163F,
- 0x050D, 0x3A38,
- 0x0D1E, 0x0D78,
- 0x150F, 0x3346,
-
- 0x38A4, 0x0B7D,
- 0x2D5D, 0x1FDF,
- 0x19B7, 0x2822,
- 0x0D99, 0x1F12,
- 0x194C, 0x0CE6
-};
-
-/* possible pulse values */
-static const int16_t ts_562[64] = {
- 0x0002, 0x0006, 0xFFFE, 0xFFFA,
- 0x0004, 0x000C, 0xFFFC, 0xFFF4,
- 0x0006, 0x0012, 0xFFFA, 0xFFEE,
- 0x000A, 0x001E, 0xFFF6, 0xFFE2,
- 0x0010, 0x0030, 0xFFF0, 0xFFD0,
- 0x0019, 0x004B, 0xFFE7, 0xFFB5,
- 0x0028, 0x0078, 0xFFD8, 0xFF88,
- 0x0040, 0x00C0, 0xFFC0, 0xFF40,
- 0x0065, 0x012F, 0xFF9B, 0xFED1,
- 0x00A1, 0x01E3, 0xFF5F, 0xFE1D,
- 0x0100, 0x0300, 0xFF00, 0xFD00,
- 0x0196, 0x04C2, 0xFE6A, 0xFB3E,
- 0x0285, 0x078F, 0xFD7B, 0xF871,
- 0x0400, 0x0C00, 0xFC00, 0xF400,
- 0x0659, 0x130B, 0xF9A7, 0xECF5,
- 0x0A14, 0x1E3C, 0xF5EC, 0xE1C4
-};
-
-/* filters used in final output calculations */
-static const int16_t ts_5E2[8] =
- { 0x4666, 0x26B8, 0x154C, 0x0BB6, 0x0671, 0x038B, 0x01F3, 0x0112 };
-static const int16_t ts_5F2[8] =
- { 0x6000, 0x4800, 0x3600, 0x2880, 0x1E60, 0x16C8, 0x1116, 0x0CD1 };
-
-#endif
diff --git a/src/libffmpeg/libavcodec/tscc.c b/src/libffmpeg/libavcodec/tscc.c
deleted file mode 100644
index e379abbbf..000000000
--- a/src/libffmpeg/libavcodec/tscc.c
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
- * TechSmith Camtasia decoder
- * Copyright (c) 2004 Konstantin Shishkov
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file tscc.c
- * TechSmith Camtasia decoder
- *
- * Fourcc: TSCC
- *
- * Codec is very simple:
- * it codes picture (picture difference, really)
- * with algorithm almost identical to Windows RLE8,
- * only without padding and with greater pixel sizes,
- * then this coded picture is packed with ZLib
- *
- * Supports: BGR8,BGR555,BGR24 - only BGR8 and BGR555 tested
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "common.h"
-#include "avcodec.h"
-
-#ifdef CONFIG_ZLIB
-#include <zlib.h>
-#endif
-
-
-/*
- * Decoder context
- */
-typedef struct TsccContext {
-
- AVCodecContext *avctx;
- AVFrame pic;
-
- // Bits per pixel
- int bpp;
- // Decompressed data size
- unsigned int decomp_size;
- // Decompression buffer
- unsigned char* decomp_buf;
- int height;
-#ifdef CONFIG_ZLIB
- z_stream zstream;
-#endif
-} CamtasiaContext;
-
-/*
- *
- * Decode RLE - almost identical to Windows BMP RLE8
- * and enhanced to bigger color depths
- *
- */
-
-static int decode_rle(CamtasiaContext *c, unsigned int srcsize)
-{
- unsigned char *src = c->decomp_buf;
- unsigned char *output, *output_end;
- int p1, p2, line=c->height, pos=0, i;
- uint16_t pix16;
- uint32_t pix32;
-
- output = c->pic.data[0] + (c->height - 1) * c->pic.linesize[0];
- output_end = c->pic.data[0] + (c->height) * c->pic.linesize[0];
- while(src < c->decomp_buf + srcsize) {
- p1 = *src++;
- if(p1 == 0) { //Escape code
- p2 = *src++;
- if(p2 == 0) { //End-of-line
- output = c->pic.data[0] + (--line) * c->pic.linesize[0];
- if (line < 0)
- return -1;
- pos = 0;
- continue;
- } else if(p2 == 1) { //End-of-picture
- return 0;
- } else if(p2 == 2) { //Skip
- p1 = *src++;
- p2 = *src++;
- line -= p2;
- if (line < 0)
- return -1;
- pos += p1;
- output = c->pic.data[0] + line * c->pic.linesize[0] + pos * (c->bpp / 8);
- continue;
- }
- // Copy data
- if (output + p2 * (c->bpp / 8) > output_end) {
- src += p2 * (c->bpp / 8);
- continue;
- }
- if ((c->bpp == 8) || (c->bpp == 24)) {
- for(i = 0; i < p2 * (c->bpp / 8); i++) {
- *output++ = *src++;
- }
- // RLE8 copy is actually padded - and runs are not!
- if(c->bpp == 8 && (p2 & 1)) {
- src++;
- }
- } else if (c->bpp == 16) {
- for(i = 0; i < p2; i++) {
- pix16 = AV_RL16(src);
- src += 2;
- *(uint16_t*)output = pix16;
- output += 2;
- }
- } else if (c->bpp == 32) {
- for(i = 0; i < p2; i++) {
- pix32 = AV_RL32(src);
- src += 4;
- *(uint32_t*)output = pix32;
- output += 4;
- }
- }
- pos += p2;
- } else { //Run of pixels
- int pix[4]; //original pixel
- switch(c->bpp){
- case 8: pix[0] = *src++;
- break;
- case 16: pix16 = AV_RL16(src);
- src += 2;
- *(uint16_t*)pix = pix16;
- break;
- case 24: pix[0] = *src++;
- pix[1] = *src++;
- pix[2] = *src++;
- break;
- case 32: pix32 = AV_RL32(src);
- src += 4;
- *(uint32_t*)pix = pix32;
- break;
- }
- if (output + p1 * (c->bpp / 8) > output_end)
- continue;
- for(i = 0; i < p1; i++) {
- switch(c->bpp){
- case 8: *output++ = pix[0];
- break;
- case 16: *(uint16_t*)output = pix16;
- output += 2;
- break;
- case 24: *output++ = pix[0];
- *output++ = pix[1];
- *output++ = pix[2];
- break;
- case 32: *(uint32_t*)output = pix32;
- output += 4;
- break;
- }
- }
- pos += p1;
- }
- }
-
- av_log(c->avctx, AV_LOG_ERROR, "Camtasia warning: no End-of-picture code\n");
- return 1;
-}
-
-/*
- *
- * Decode a frame
- *
- */
-static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size)
-{
- CamtasiaContext * const c = (CamtasiaContext *)avctx->priv_data;
- unsigned char *encoded = (unsigned char *)buf;
- unsigned char *outptr;
-#ifdef CONFIG_ZLIB
- int zret; // Zlib return code
-#endif
- int len = buf_size;
-
- if(c->pic.data[0])
- avctx->release_buffer(avctx, &c->pic);
-
- c->pic.reference = 1;
- c->pic.buffer_hints = FF_BUFFER_HINTS_VALID;
- if(avctx->get_buffer(avctx, &c->pic) < 0){
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
-
- outptr = c->pic.data[0]; // Output image pointer
-
-#ifdef CONFIG_ZLIB
- zret = inflateReset(&(c->zstream));
- if (zret != Z_OK) {
- av_log(avctx, AV_LOG_ERROR, "Inflate reset error: %d\n", zret);
- return -1;
- }
- c->zstream.next_in = encoded;
- c->zstream.avail_in = len;
- c->zstream.next_out = c->decomp_buf;
- c->zstream.avail_out = c->decomp_size;
- zret = inflate(&(c->zstream), Z_FINISH);
- // Z_DATA_ERROR means empty picture
- if ((zret != Z_OK) && (zret != Z_STREAM_END) && (zret != Z_DATA_ERROR)) {
- av_log(avctx, AV_LOG_ERROR, "Inflate error: %d\n", zret);
- return -1;
- }
-
-
- if(zret != Z_DATA_ERROR)
- decode_rle(c, c->zstream.avail_out);
-
- /* make the palette available on the way out */
- if (c->avctx->pix_fmt == PIX_FMT_PAL8) {
- memcpy(c->pic.data[1], c->avctx->palctrl->palette, AVPALETTE_SIZE);
- if (c->avctx->palctrl->palette_changed) {
- c->pic.palette_has_changed = 1;
- c->avctx->palctrl->palette_changed = 0;
- }
- }
-
-#else
- av_log(avctx, AV_LOG_ERROR, "BUG! Zlib support not compiled in frame decoder.\n");
- return -1;
-#endif
-
- *data_size = sizeof(AVFrame);
- *(AVFrame*)data = c->pic;
-
- /* always report that the buffer was completely consumed */
- return buf_size;
-}
-
-
-
-/*
- *
- * Init tscc decoder
- *
- */
-static int decode_init(AVCodecContext *avctx)
-{
- CamtasiaContext * const c = (CamtasiaContext *)avctx->priv_data;
- int zret; // Zlib return code
-
- c->avctx = avctx;
- avctx->has_b_frames = 0;
-
- c->pic.data[0] = NULL;
- c->height = avctx->height;
-
- if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
- return 1;
- }
-
-#ifdef CONFIG_ZLIB
- // Needed if zlib unused or init aborted before inflateInit
- memset(&(c->zstream), 0, sizeof(z_stream));
-#else
- av_log(avctx, AV_LOG_ERROR, "Zlib support not compiled.\n");
- return 1;
-#endif
- switch(avctx->bits_per_sample){
- case 8: avctx->pix_fmt = PIX_FMT_PAL8; break;
- case 16: avctx->pix_fmt = PIX_FMT_RGB555; break;
- case 24:
- avctx->pix_fmt = PIX_FMT_BGR24;
- break;
- case 32: avctx->pix_fmt = PIX_FMT_RGBA32; break;
- default: av_log(avctx, AV_LOG_ERROR, "Camtasia error: unknown depth %i bpp\n", avctx->bits_per_sample);
- return -1;
- }
- c->bpp = avctx->bits_per_sample;
- c->decomp_size = (avctx->width * c->bpp + (avctx->width + 254) / 255 + 2) * avctx->height + 2;//RLE in the 'best' case
-
- /* Allocate decompression buffer */
- if (c->decomp_size) {
- if ((c->decomp_buf = av_malloc(c->decomp_size)) == NULL) {
- av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n");
- return 1;
- }
- }
-
-#ifdef CONFIG_ZLIB
- c->zstream.zalloc = Z_NULL;
- c->zstream.zfree = Z_NULL;
- c->zstream.opaque = Z_NULL;
- zret = inflateInit(&(c->zstream));
- if (zret != Z_OK) {
- av_log(avctx, AV_LOG_ERROR, "Inflate init error: %d\n", zret);
- return 1;
- }
-#endif
-
- return 0;
-}
-
-
-
-/*
- *
- * Uninit tscc decoder
- *
- */
-static int decode_end(AVCodecContext *avctx)
-{
- CamtasiaContext * const c = (CamtasiaContext *)avctx->priv_data;
-
- av_freep(&c->decomp_buf);
-
- if (c->pic.data[0])
- avctx->release_buffer(avctx, &c->pic);
-#ifdef CONFIG_ZLIB
- inflateEnd(&(c->zstream));
-#endif
-
- return 0;
-}
-
-AVCodec tscc_decoder = {
- "camtasia",
- CODEC_TYPE_VIDEO,
- CODEC_ID_TSCC,
- sizeof(CamtasiaContext),
- decode_init,
- NULL,
- decode_end,
- decode_frame,
- CODEC_CAP_DR1,
-};
-
diff --git a/src/libffmpeg/libavcodec/tta.c b/src/libffmpeg/libavcodec/tta.c
deleted file mode 100644
index 82713fb0f..000000000
--- a/src/libffmpeg/libavcodec/tta.c
+++ /dev/null
@@ -1,446 +0,0 @@
-/*
- * TTA (The Lossless True Audio) decoder
- * Copyright (c) 2006 Alex Beregszaszi
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file tta.c
- * TTA (The Lossless True Audio) decoder
- * (www.true-audio.com or tta.corecodec.org)
- * @author Alex Beregszaszi
- *
- */
-
-#define ALT_BITSTREAM_READER_LE
-//#define DEBUG
-#include <limits.h>
-#include "avcodec.h"
-#include "bitstream.h"
-
-#define FORMAT_INT 1
-#define FORMAT_FLOAT 3
-
-typedef struct TTAContext {
- AVCodecContext *avctx;
- GetBitContext gb;
-
- int flags, channels, bps, is_float, data_length;
- int frame_length, last_frame_length, total_frames;
-
- int32_t *decode_buffer;
-} TTAContext;
-
-#if 0
-static inline int shift_1(int i)
-{
- if (i < 32)
- return 1 << i;
- else
- return 0x80000000; // 16 << 31
-}
-
-static inline int shift_16(int i)
-{
- if (i < 28)
- return 16 << i;
- else
- return 0x80000000; // 16 << 27
-}
-#else
-static const uint32_t shift_1[] = {
- 0x00000001, 0x00000002, 0x00000004, 0x00000008,
- 0x00000010, 0x00000020, 0x00000040, 0x00000080,
- 0x00000100, 0x00000200, 0x00000400, 0x00000800,
- 0x00001000, 0x00002000, 0x00004000, 0x00008000,
- 0x00010000, 0x00020000, 0x00040000, 0x00080000,
- 0x00100000, 0x00200000, 0x00400000, 0x00800000,
- 0x01000000, 0x02000000, 0x04000000, 0x08000000,
- 0x10000000, 0x20000000, 0x40000000, 0x80000000,
- 0x80000000, 0x80000000, 0x80000000, 0x80000000,
- 0x80000000, 0x80000000, 0x80000000, 0x80000000
-};
-
-static const uint32_t *shift_16 = shift_1 + 4;
-#endif
-
-#define MAX_ORDER 16
-typedef struct TTAFilter {
- int32_t shift, round, error, mode;
- int32_t qm[MAX_ORDER];
- int32_t dx[MAX_ORDER];
- int32_t dl[MAX_ORDER];
-} TTAFilter;
-
-static int32_t ttafilter_configs[4][2] = {
- {10, 1},
- {9, 1},
- {10, 1},
- {12, 0}
-};
-
-static void ttafilter_init(TTAFilter *c, int32_t shift, int32_t mode) {
- memset(c, 0, sizeof(TTAFilter));
- c->shift = shift;
- c->round = shift_1[shift-1];
-// c->round = 1 << (shift - 1);
- c->mode = mode;
-}
-
-// FIXME: copy paste from original
-static inline void memshl(register int32_t *a, register int32_t *b) {
- *a++ = *b++;
- *a++ = *b++;
- *a++ = *b++;
- *a++ = *b++;
- *a++ = *b++;
- *a++ = *b++;
- *a++ = *b++;
- *a = *b;
-}
-
-// FIXME: copy paste from original
-// mode=1 encoder, mode=0 decoder
-static inline void ttafilter_process(TTAFilter *c, int32_t *in, int32_t mode) {
- register int32_t *dl = c->dl, *qm = c->qm, *dx = c->dx, sum = c->round;
-
- if (!c->error) {
- sum += *dl++ * *qm, qm++;
- sum += *dl++ * *qm, qm++;
- sum += *dl++ * *qm, qm++;
- sum += *dl++ * *qm, qm++;
- sum += *dl++ * *qm, qm++;
- sum += *dl++ * *qm, qm++;
- sum += *dl++ * *qm, qm++;
- sum += *dl++ * *qm, qm++;
- dx += 8;
- } else if(c->error < 0) {
- sum += *dl++ * (*qm -= *dx++), qm++;
- sum += *dl++ * (*qm -= *dx++), qm++;
- sum += *dl++ * (*qm -= *dx++), qm++;
- sum += *dl++ * (*qm -= *dx++), qm++;
- sum += *dl++ * (*qm -= *dx++), qm++;
- sum += *dl++ * (*qm -= *dx++), qm++;
- sum += *dl++ * (*qm -= *dx++), qm++;
- sum += *dl++ * (*qm -= *dx++), qm++;
- } else {
- sum += *dl++ * (*qm += *dx++), qm++;
- sum += *dl++ * (*qm += *dx++), qm++;
- sum += *dl++ * (*qm += *dx++), qm++;
- sum += *dl++ * (*qm += *dx++), qm++;
- sum += *dl++ * (*qm += *dx++), qm++;
- sum += *dl++ * (*qm += *dx++), qm++;
- sum += *dl++ * (*qm += *dx++), qm++;
- sum += *dl++ * (*qm += *dx++), qm++;
- }
-
- *(dx-0) = ((*(dl-1) >> 30) | 1) << 2;
- *(dx-1) = ((*(dl-2) >> 30) | 1) << 1;
- *(dx-2) = ((*(dl-3) >> 30) | 1) << 1;
- *(dx-3) = ((*(dl-4) >> 30) | 1);
-
- // compress
- if (mode) {
- *dl = *in;
- *in -= (sum >> c->shift);
- c->error = *in;
- } else {
- c->error = *in;
- *in += (sum >> c->shift);
- *dl = *in;
- }
-
- if (c->mode) {
- *(dl-1) = *dl - *(dl-1);
- *(dl-2) = *(dl-1) - *(dl-2);
- *(dl-3) = *(dl-2) - *(dl-3);
- }
-
- memshl(c->dl, c->dl + 1);
- memshl(c->dx, c->dx + 1);
-}
-
-typedef struct TTARice {
- uint32_t k0, k1, sum0, sum1;
-} TTARice;
-
-static void rice_init(TTARice *c, uint32_t k0, uint32_t k1)
-{
- c->k0 = k0;
- c->k1 = k1;
- c->sum0 = shift_16[k0];
- c->sum1 = shift_16[k1];
-}
-
-static int tta_get_unary(GetBitContext *gb)
-{
- int ret = 0;
-
- // count ones
- while(get_bits1(gb))
- ret++;
- return ret;
-}
-
-static int tta_decode_init(AVCodecContext * avctx)
-{
- TTAContext *s = avctx->priv_data;
- int i;
-
- s->avctx = avctx;
-
- // 30bytes includes a seektable with one frame
- if (avctx->extradata_size < 30)
- return -1;
-
- init_get_bits(&s->gb, avctx->extradata, avctx->extradata_size);
- if (show_bits_long(&s->gb, 32) == ff_get_fourcc("TTA1"))
- {
- /* signature */
- skip_bits(&s->gb, 32);
-// if (get_bits_long(&s->gb, 32) != bswap_32(ff_get_fourcc("TTA1"))) {
-// av_log(s->avctx, AV_LOG_ERROR, "Missing magic\n");
-// return -1;
-// }
-
- s->flags = get_bits(&s->gb, 16);
- if (s->flags != 1 && s->flags != 3)
- {
- av_log(s->avctx, AV_LOG_ERROR, "Invalid flags\n");
- return -1;
- }
- s->is_float = (s->flags == FORMAT_FLOAT);
- avctx->channels = s->channels = get_bits(&s->gb, 16);
- avctx->bits_per_sample = get_bits(&s->gb, 16);
- s->bps = (avctx->bits_per_sample + 7) / 8;
- avctx->sample_rate = get_bits_long(&s->gb, 32);
- if(avctx->sample_rate > 1000000){ //prevent FRAME_TIME * avctx->sample_rate from overflowing and sanity check
- av_log(avctx, AV_LOG_ERROR, "sample_rate too large\n");
- return -1;
- }
- s->data_length = get_bits_long(&s->gb, 32);
- skip_bits(&s->gb, 32); // CRC32 of header
-
- if (s->is_float)
- {
- avctx->sample_fmt = SAMPLE_FMT_FLT;
- av_log(s->avctx, AV_LOG_ERROR, "Unsupported sample format. Please contact the developers.\n");
- return -1;
- }
- else switch(s->bps) {
-// case 1: avctx->sample_fmt = SAMPLE_FMT_U8; break;
- case 2: avctx->sample_fmt = SAMPLE_FMT_S16; break;
-// case 3: avctx->sample_fmt = SAMPLE_FMT_S24; break;
- case 4: avctx->sample_fmt = SAMPLE_FMT_S32; break;
- default:
- av_log(s->avctx, AV_LOG_ERROR, "Invalid/unsupported sample format. Please contact the developers.\n");
- return -1;
- }
-
- // FIXME: horribly broken, but directly from reference source
-#define FRAME_TIME 1.04489795918367346939
- s->frame_length = (int)(FRAME_TIME * avctx->sample_rate);
-
- s->last_frame_length = s->data_length % s->frame_length;
- s->total_frames = s->data_length / s->frame_length +
- (s->last_frame_length ? 1 : 0);
-
- av_log(s->avctx, AV_LOG_DEBUG, "flags: %x chans: %d bps: %d rate: %d block: %d\n",
- s->flags, avctx->channels, avctx->bits_per_sample, avctx->sample_rate,
- avctx->block_align);
- av_log(s->avctx, AV_LOG_DEBUG, "data_length: %d frame_length: %d last: %d total: %d\n",
- s->data_length, s->frame_length, s->last_frame_length, s->total_frames);
-
- // FIXME: seek table
- for (i = 0; i < s->total_frames; i++)
- skip_bits(&s->gb, 32);
- skip_bits(&s->gb, 32); // CRC32 of seektable
-
- if(s->frame_length >= UINT_MAX / (s->channels * sizeof(int32_t))){
- av_log(avctx, AV_LOG_ERROR, "frame_length too large\n");
- return -1;
- }
-
- s->decode_buffer = av_mallocz(sizeof(int32_t)*s->frame_length*s->channels);
- } else {
- av_log(avctx, AV_LOG_ERROR, "Wrong extradata present\n");
- return -1;
- }
-
- return 0;
-}
-
-static int tta_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- TTAContext *s = avctx->priv_data;
- int i;
-
- init_get_bits(&s->gb, buf, buf_size*8);
- {
- int32_t predictors[s->channels];
- TTAFilter filters[s->channels];
- TTARice rices[s->channels];
- int cur_chan = 0, framelen = s->frame_length;
- int32_t *p;
-
- // FIXME: seeking
- s->total_frames--;
- if (!s->total_frames && s->last_frame_length)
- framelen = s->last_frame_length;
-
- // init per channel states
- for (i = 0; i < s->channels; i++) {
- predictors[i] = 0;
- ttafilter_init(&(filters[i]), ttafilter_configs[s->bps-1][0], ttafilter_configs[s->bps-1][1]);
- rice_init(&(rices[i]), 10, 10);
- }
-
- for (p = s->decode_buffer; p < s->decode_buffer + (framelen * s->channels); p++) {
- int32_t *predictor = &(predictors[cur_chan]);
- TTAFilter *filter = &(filters[cur_chan]);
- TTARice *rice = &(rices[cur_chan]);
- uint32_t unary, depth, k;
- int32_t value;
-
- unary = tta_get_unary(&s->gb);
-
- if (unary == 0) {
- depth = 0;
- k = rice->k0;
- } else {
- depth = 1;
- k = rice->k1;
- unary--;
- }
-
- if (k)
- value = (unary << k) + get_bits(&s->gb, k);
- else
- value = unary;
-
- // FIXME: copy paste from original
- switch (depth) {
- case 1:
- rice->sum1 += value - (rice->sum1 >> 4);
- if (rice->k1 > 0 && rice->sum1 < shift_16[rice->k1])
- rice->k1--;
- else if(rice->sum1 > shift_16[rice->k1 + 1])
- rice->k1++;
- value += shift_1[rice->k0];
- default:
- rice->sum0 += value - (rice->sum0 >> 4);
- if (rice->k0 > 0 && rice->sum0 < shift_16[rice->k0])
- rice->k0--;
- else if(rice->sum0 > shift_16[rice->k0 + 1])
- rice->k0++;
- }
-
- // extract coded value
-#define UNFOLD(x) (((x)&1) ? (++(x)>>1) : (-(x)>>1))
- *p = UNFOLD(value);
-
- // run hybrid filter
- ttafilter_process(filter, p, 0);
-
- // fixed order prediction
-#define PRED(x, k) (int32_t)((((uint64_t)x << k) - x) >> k)
- switch (s->bps) {
- case 1: *p += PRED(*predictor, 4); break;
- case 2:
- case 3: *p += PRED(*predictor, 5); break;
- case 4: *p += *predictor; break;
- }
- *predictor = *p;
-
-#if 0
- // extract 32bit float from last two int samples
- if (s->is_float && ((p - data) & 1)) {
- uint32_t neg = *p & 0x80000000;
- uint32_t hi = *(p - 1);
- uint32_t lo = abs(*p) - 1;
-
- hi += (hi || lo) ? 0x3f80 : 0;
- // SWAP16: swap all the 16 bits
- *(p - 1) = (hi << 16) | SWAP16(lo) | neg;
- }
-#endif
-
- /*if ((get_bits_count(&s->gb)+7)/8 > buf_size)
- {
- av_log(NULL, AV_LOG_INFO, "overread!!\n");
- break;
- }*/
-
- // flip channels
- if (cur_chan < (s->channels-1))
- cur_chan++;
- else {
- // decorrelate in case of stereo integer
- if (!s->is_float && (s->channels > 1)) {
- int32_t *r = p - 1;
- for (*p += *r / 2; r > p - s->channels; r--)
- *r = *(r + 1) - *r;
- }
- cur_chan = 0;
- }
- }
-
- skip_bits(&s->gb, 32); // frame crc
-
- // convert to output buffer
- switch(s->bps) {
- case 2: {
- uint16_t *samples = data;
- for (p = s->decode_buffer; p < s->decode_buffer + (framelen * s->channels); p++) {
-// *samples++ = (unsigned char)*p;
-// *samples++ = (unsigned char)(*p >> 8);
- *samples++ = *p;
- }
- *data_size = (uint8_t *)samples - (uint8_t *)data;
- break;
- }
- default:
- av_log(s->avctx, AV_LOG_ERROR, "Error, only 16bit samples supported!\n");
- }
- }
-
-// return get_bits_count(&s->gb)+7)/8;
- return buf_size;
-}
-
-static int tta_decode_close(AVCodecContext *avctx) {
- TTAContext *s = avctx->priv_data;
-
- if (s->decode_buffer)
- av_free(s->decode_buffer);
-
- return 0;
-}
-
-AVCodec tta_decoder = {
- "tta",
- CODEC_TYPE_AUDIO,
- CODEC_ID_TTA,
- sizeof(TTAContext),
- tta_decode_init,
- NULL,
- tta_decode_close,
- tta_decode_frame,
-};
diff --git a/src/libffmpeg/libavcodec/ulti.c b/src/libffmpeg/libavcodec/ulti.c
deleted file mode 100644
index b4028f439..000000000
--- a/src/libffmpeg/libavcodec/ulti.c
+++ /dev/null
@@ -1,428 +0,0 @@
-/*
- * IBM Ultimotion Video Decoder
- * Copyright (C) 2004 Konstantin Shishkov
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file ulti.c
- * IBM Ultimotion Video Decoder.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "common.h"
-#include "avcodec.h"
-
-#include "ulti_cb.h"
-
-typedef struct UltimotionDecodeContext {
- AVCodecContext *avctx;
- int width, height, blocks;
- AVFrame frame;
- const uint8_t *ulti_codebook;
-} UltimotionDecodeContext;
-
-static int ulti_decode_init(AVCodecContext *avctx)
-{
- UltimotionDecodeContext *s = avctx->priv_data;
-
- s->avctx = avctx;
- s->width = avctx->width;
- s->height = avctx->height;
- s->blocks = (s->width / 8) * (s->height / 8);
- avctx->pix_fmt = PIX_FMT_YUV410P;
- avctx->has_b_frames = 0;
- avctx->coded_frame = (AVFrame*) &s->frame;
- s->ulti_codebook = ulti_codebook;
-
- return 0;
-}
-
-static int block_coords[8] = // 4x4 block coords in 8x8 superblock
- { 0, 0, 0, 4, 4, 4, 4, 0};
-
-static int angle_by_index[4] = { 0, 2, 6, 12};
-
-/* Lookup tables for luma and chroma - used by ulti_convert_yuv() */
-static uint8_t ulti_lumas[64] =
- { 0x10, 0x13, 0x17, 0x1A, 0x1E, 0x21, 0x25, 0x28,
- 0x2C, 0x2F, 0x33, 0x36, 0x3A, 0x3D, 0x41, 0x44,
- 0x48, 0x4B, 0x4F, 0x52, 0x56, 0x59, 0x5C, 0x60,
- 0x63, 0x67, 0x6A, 0x6E, 0x71, 0x75, 0x78, 0x7C,
- 0x7F, 0x83, 0x86, 0x8A, 0x8D, 0x91, 0x94, 0x98,
- 0x9B, 0x9F, 0xA2, 0xA5, 0xA9, 0xAC, 0xB0, 0xB3,
- 0xB7, 0xBA, 0xBE, 0xC1, 0xC5, 0xC8, 0xCC, 0xCF,
- 0xD3, 0xD6, 0xDA, 0xDD, 0xE1, 0xE4, 0xE8, 0xEB};
-
-static uint8_t ulti_chromas[16] =
- { 0x60, 0x67, 0x6D, 0x73, 0x7A, 0x80, 0x86, 0x8D,
- 0x93, 0x99, 0xA0, 0xA6, 0xAC, 0xB3, 0xB9, 0xC0};
-
-/* convert Ultimotion YUV block (sixteen 6-bit Y samples and
- two 4-bit chroma samples) into standard YUV and put it into frame */
-static void ulti_convert_yuv(AVFrame *frame, int x, int y,
- uint8_t *luma,int chroma)
-{
- uint8_t *y_plane, *cr_plane, *cb_plane;
- int i;
-
- y_plane = frame->data[0] + x + y * frame->linesize[0];
- cr_plane = frame->data[1] + (x / 4) + (y / 4) * frame->linesize[1];
- cb_plane = frame->data[2] + (x / 4) + (y / 4) * frame->linesize[2];
-
- cr_plane[0] = ulti_chromas[chroma >> 4];
-
- cb_plane[0] = ulti_chromas[chroma & 0xF];
-
-
- for(i = 0; i < 16; i++){
- y_plane[i & 3] = ulti_lumas[luma[i]];
- if((i & 3) == 3) { //next row
- y_plane += frame->linesize[0];
- }
- }
-}
-
-/* generate block like in MS Video1 */
-static void ulti_pattern(AVFrame *frame, int x, int y,
- int f0, int f1, int Y0, int Y1, int chroma)
-{
- uint8_t Luma[16];
- int mask, i;
- for(mask = 0x80, i = 0; mask; mask >>= 1, i++) {
- if(f0 & mask)
- Luma[i] = Y1;
- else
- Luma[i] = Y0;
- }
-
- for(mask = 0x80, i = 8; mask; mask >>= 1, i++) {
- if(f1 & mask)
- Luma[i] = Y1;
- else
- Luma[i] = Y0;
- }
-
- ulti_convert_yuv(frame, x, y, Luma, chroma);
-}
-
-/* fill block with some gradient */
-static void ulti_grad(AVFrame *frame, int x, int y, uint8_t *Y, int chroma, int angle)
-{
- uint8_t Luma[16];
- if(angle & 8) { //reverse order
- int t;
- angle &= 0x7;
- t = Y[0];
- Y[0] = Y[3];
- Y[3] = t;
- t = Y[1];
- Y[1] = Y[2];
- Y[2] = t;
- }
- switch(angle){
- case 0:
- Luma[0] = Y[0]; Luma[1] = Y[1]; Luma[2] = Y[2]; Luma[3] = Y[3];
- Luma[4] = Y[0]; Luma[5] = Y[1]; Luma[6] = Y[2]; Luma[7] = Y[3];
- Luma[8] = Y[0]; Luma[9] = Y[1]; Luma[10] = Y[2]; Luma[11] = Y[3];
- Luma[12] = Y[0]; Luma[13] = Y[1]; Luma[14] = Y[2]; Luma[15] = Y[3];
- break;
- case 1:
- Luma[0] = Y[1]; Luma[1] = Y[2]; Luma[2] = Y[3]; Luma[3] = Y[3];
- Luma[4] = Y[0]; Luma[5] = Y[1]; Luma[6] = Y[2]; Luma[7] = Y[3];
- Luma[8] = Y[0]; Luma[9] = Y[1]; Luma[10] = Y[2]; Luma[11] = Y[3];
- Luma[12] = Y[0]; Luma[13] = Y[0]; Luma[14] = Y[1]; Luma[15] = Y[2];
- break;
- case 2:
- Luma[0] = Y[1]; Luma[1] = Y[2]; Luma[2] = Y[3]; Luma[3] = Y[3];
- Luma[4] = Y[1]; Luma[5] = Y[2]; Luma[6] = Y[2]; Luma[7] = Y[3];
- Luma[8] = Y[0]; Luma[9] = Y[1]; Luma[10] = Y[1]; Luma[11] = Y[2];
- Luma[12] = Y[0]; Luma[13] = Y[0]; Luma[14] = Y[1]; Luma[15] = Y[2];
- break;
- case 3:
- Luma[0] = Y[2]; Luma[1] = Y[3]; Luma[2] = Y[3]; Luma[3] = Y[3];
- Luma[4] = Y[1]; Luma[5] = Y[2]; Luma[6] = Y[2]; Luma[7] = Y[3];
- Luma[8] = Y[0]; Luma[9] = Y[1]; Luma[10] = Y[1]; Luma[11] = Y[2];
- Luma[12] = Y[0]; Luma[13] = Y[0]; Luma[14] = Y[0]; Luma[15] = Y[1];
- break;
- case 4:
- Luma[0] = Y[3]; Luma[1] = Y[3]; Luma[2] = Y[3]; Luma[3] = Y[3];
- Luma[4] = Y[2]; Luma[5] = Y[2]; Luma[6] = Y[2]; Luma[7] = Y[2];
- Luma[8] = Y[1]; Luma[9] = Y[1]; Luma[10] = Y[1]; Luma[11] = Y[1];
- Luma[12] = Y[0]; Luma[13] = Y[0]; Luma[14] = Y[0]; Luma[15] = Y[0];
- break;
- case 5:
- Luma[0] = Y[3]; Luma[1] = Y[3]; Luma[2] = Y[3]; Luma[3] = Y[2];
- Luma[4] = Y[3]; Luma[5] = Y[2]; Luma[6] = Y[2]; Luma[7] = Y[1];
- Luma[8] = Y[2]; Luma[9] = Y[1]; Luma[10] = Y[1]; Luma[11] = Y[0];
- Luma[12] = Y[1]; Luma[13] = Y[0]; Luma[14] = Y[0]; Luma[15] = Y[0];
- break;
- case 6:
- Luma[0] = Y[3]; Luma[1] = Y[3]; Luma[2] = Y[2]; Luma[3] = Y[2];
- Luma[4] = Y[3]; Luma[5] = Y[2]; Luma[6] = Y[1]; Luma[7] = Y[1];
- Luma[8] = Y[2]; Luma[9] = Y[2]; Luma[10] = Y[1]; Luma[11] = Y[0];
- Luma[12] = Y[1]; Luma[13] = Y[1]; Luma[14] = Y[0]; Luma[15] = Y[0];
- break;
- case 7:
- Luma[0] = Y[3]; Luma[1] = Y[3]; Luma[2] = Y[2]; Luma[3] = Y[1];
- Luma[4] = Y[3]; Luma[5] = Y[2]; Luma[6] = Y[1]; Luma[7] = Y[0];
- Luma[8] = Y[3]; Luma[9] = Y[2]; Luma[10] = Y[1]; Luma[11] = Y[0];
- Luma[12] = Y[2]; Luma[13] = Y[1]; Luma[14] = Y[0]; Luma[15] = Y[0];
- break;
- default:
- Luma[0] = Y[0]; Luma[1] = Y[0]; Luma[2] = Y[1]; Luma[3] = Y[1];
- Luma[4] = Y[0]; Luma[5] = Y[0]; Luma[6] = Y[1]; Luma[7] = Y[1];
- Luma[8] = Y[2]; Luma[9] = Y[2]; Luma[10] = Y[3]; Luma[11] = Y[3];
- Luma[12] = Y[2]; Luma[13] = Y[2]; Luma[14] = Y[3]; Luma[15] = Y[3];
- break;
- }
-
- ulti_convert_yuv(frame, x, y, Luma, chroma);
-}
-
-static int ulti_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- UltimotionDecodeContext *s=avctx->priv_data;
- int modifier = 0;
- int uniq = 0;
- int mode = 0;
- int blocks = 0;
- int done = 0;
- int x = 0, y = 0;
- int i;
- int skip;
- int tmp;
-
- if(s->frame.data[0])
- avctx->release_buffer(avctx, &s->frame);
-
- s->frame.reference = 1;
- s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
- if(avctx->get_buffer(avctx, &s->frame) < 0) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
-
- while(!done) {
- int idx;
- if(blocks >= s->blocks || y >= s->height)
- break;//all blocks decoded
-
- idx = *buf++;
- if((idx & 0xF8) == 0x70) {
- switch(idx) {
- case 0x70: //change modifier
- modifier = *buf++;
- if(modifier>1)
- av_log(avctx, AV_LOG_INFO, "warning: modifier must be 0 or 1, got %i\n", modifier);
- break;
- case 0x71: // set uniq flag
- uniq = 1;
- break;
- case 0x72: //toggle mode
- mode = !mode;
- break;
- case 0x73: //end-of-frame
- done = 1;
- break;
- case 0x74: //skip some blocks
- skip = *buf++;
- if ((blocks + skip) >= s->blocks)
- break;
- blocks += skip;
- x += skip * 8;
- while(x >= s->width) {
- x -= s->width;
- y += 8;
- }
- break;
- default:
- av_log(avctx, AV_LOG_INFO, "warning: unknown escape 0x%02X\n", idx);
- }
- } else { //handle one block
- int code;
- int cf;
- int angle = 0;
- uint8_t Y[4]; // luma samples of block
- int tx = 0, ty = 0; //coords of subblock
- int chroma = 0;
- if (mode || uniq) {
- uniq = 0;
- cf = 1;
- chroma = 0;
- } else {
- cf = 0;
- if (idx)
- chroma = *buf++;
- }
- for (i = 0; i < 4; i++) { // for every subblock
- code = (idx >> (6 - i*2)) & 3; //extract 2 bits
- if(!code) //skip subblock
- continue;
- if(cf)
- chroma = *buf++;
- tx = x + block_coords[i * 2];
- ty = y + block_coords[(i * 2) + 1];
- switch(code) {
- case 1:
- tmp = *buf++;
-
- angle = angle_by_index[(tmp >> 6) & 0x3];
-
- Y[0] = tmp & 0x3F;
- Y[1] = Y[0];
-
- if (angle) {
- Y[2] = Y[0]+1;
- if (Y[2] > 0x3F)
- Y[2] = 0x3F;
- Y[3] = Y[2];
- } else {
- Y[2] = Y[0];
- Y[3] = Y[0];
- }
- break;
-
- case 2:
- if (modifier) { // unpack four luma samples
- tmp = (*buf++) << 16;
- tmp += (*buf++) << 8;
- tmp += *buf++;
-
- Y[0] = (tmp >> 18) & 0x3F;
- Y[1] = (tmp >> 12) & 0x3F;
- Y[2] = (tmp >> 6) & 0x3F;
- Y[3] = tmp & 0x3F;
- angle = 16;
- } else { // retrieve luma samples from codebook
- tmp = (*buf++) << 8;
- tmp += (*buf++);
-
- angle = (tmp >> 12) & 0xF;
- tmp &= 0xFFF;
- tmp <<= 2;
- Y[0] = s->ulti_codebook[tmp];
- Y[1] = s->ulti_codebook[tmp + 1];
- Y[2] = s->ulti_codebook[tmp + 2];
- Y[3] = s->ulti_codebook[tmp + 3];
- }
- break;
-
- case 3:
- if (modifier) { // all 16 luma samples
- uint8_t Luma[16];
-
- tmp = (*buf++) << 16;
- tmp += (*buf++) << 8;
- tmp += *buf++;
- Luma[0] = (tmp >> 18) & 0x3F;
- Luma[1] = (tmp >> 12) & 0x3F;
- Luma[2] = (tmp >> 6) & 0x3F;
- Luma[3] = tmp & 0x3F;
-
- tmp = (*buf++) << 16;
- tmp += (*buf++) << 8;
- tmp += *buf++;
- Luma[4] = (tmp >> 18) & 0x3F;
- Luma[5] = (tmp >> 12) & 0x3F;
- Luma[6] = (tmp >> 6) & 0x3F;
- Luma[7] = tmp & 0x3F;
-
- tmp = (*buf++) << 16;
- tmp += (*buf++) << 8;
- tmp += *buf++;
- Luma[8] = (tmp >> 18) & 0x3F;
- Luma[9] = (tmp >> 12) & 0x3F;
- Luma[10] = (tmp >> 6) & 0x3F;
- Luma[11] = tmp & 0x3F;
-
- tmp = (*buf++) << 16;
- tmp += (*buf++) << 8;
- tmp += *buf++;
- Luma[12] = (tmp >> 18) & 0x3F;
- Luma[13] = (tmp >> 12) & 0x3F;
- Luma[14] = (tmp >> 6) & 0x3F;
- Luma[15] = tmp & 0x3F;
-
- ulti_convert_yuv(&s->frame, tx, ty, Luma, chroma);
- } else {
- tmp = *buf++;
- if(tmp & 0x80) {
- angle = (tmp >> 4) & 0x7;
- tmp = (tmp << 8) + *buf++;
- Y[0] = (tmp >> 6) & 0x3F;
- Y[1] = tmp & 0x3F;
- Y[2] = (*buf++) & 0x3F;
- Y[3] = (*buf++) & 0x3F;
- ulti_grad(&s->frame, tx, ty, Y, chroma, angle); //draw block
- } else { // some patterns
- int f0, f1;
- f0 = *buf++;
- f1 = tmp;
- Y[0] = (*buf++) & 0x3F;
- Y[1] = (*buf++) & 0x3F;
- ulti_pattern(&s->frame, tx, ty, f1, f0, Y[0], Y[1], chroma);
- }
- }
- break;
- }
- if(code != 3)
- ulti_grad(&s->frame, tx, ty, Y, chroma, angle); // draw block
- }
- blocks++;
- x += 8;
- if(x >= s->width) {
- x = 0;
- y += 8;
- }
- }
- }
-
- *data_size=sizeof(AVFrame);
- *(AVFrame*)data= s->frame;
-
- return buf_size;
-}
-
-static int ulti_decode_end(AVCodecContext *avctx)
-{
-/* UltimotionDecodeContext *s = avctx->priv_data;*/
-
- return 0;
-}
-
-AVCodec ulti_decoder = {
- "ultimotion",
- CODEC_TYPE_VIDEO,
- CODEC_ID_ULTI,
- sizeof(UltimotionDecodeContext),
- ulti_decode_init,
- NULL,
- ulti_decode_end,
- ulti_decode_frame,
- CODEC_CAP_DR1,
- NULL
-};
-
diff --git a/src/libffmpeg/libavcodec/ulti_cb.h b/src/libffmpeg/libavcodec/ulti_cb.h
deleted file mode 100644
index 2d8c9082c..000000000
--- a/src/libffmpeg/libavcodec/ulti_cb.h
+++ /dev/null
@@ -1,4119 +0,0 @@
-/*
- * IBM Ultimotion Video Decoder
- * copyright (C) 2004 Konstantin Shishkov
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-static const unsigned char ulti_codebook[16384]={
- 0x00, 0x01, 0x01, 0x02,
- 0x00, 0x01, 0x02, 0x03,
- 0x00, 0x02, 0x03, 0x04,
- 0x00, 0x01, 0x03, 0x04,
- 0x00, 0x01, 0x02, 0x04,
- 0x00, 0x02, 0x03, 0x05,
- 0x00, 0x02, 0x04, 0x05,
- 0x00, 0x01, 0x04, 0x05,
- 0x00, 0x01, 0x03, 0x05,
- 0x00, 0x02, 0x04, 0x06,
- 0x00, 0x03, 0x05, 0x06,
- 0x00, 0x01, 0x05, 0x06,
- 0x00, 0x01, 0x03, 0x06,
- 0x00, 0x06, 0x06, 0x06,
- 0x00, 0x00, 0x06, 0x06,
- 0x00, 0x00, 0x00, 0x06,
- 0x00, 0x03, 0x04, 0x07,
- 0x00, 0x03, 0x06, 0x07,
- 0x00, 0x01, 0x06, 0x07,
- 0x00, 0x01, 0x04, 0x07,
- 0x00, 0x03, 0x05, 0x08,
- 0x00, 0x04, 0x06, 0x08,
- 0x00, 0x02, 0x06, 0x08,
- 0x00, 0x02, 0x04, 0x08,
- 0x00, 0x08, 0x08, 0x08,
- 0x00, 0x00, 0x08, 0x08,
- 0x00, 0x00, 0x00, 0x08,
- 0x00, 0x04, 0x07, 0x0B,
- 0x00, 0x05, 0x09, 0x0B,
- 0x00, 0x02, 0x09, 0x0B,
- 0x00, 0x02, 0x06, 0x0B,
- 0x00, 0x0B, 0x0B, 0x0B,
- 0x00, 0x00, 0x0B, 0x0B,
- 0x00, 0x00, 0x00, 0x0B,
- 0x00, 0x05, 0x09, 0x0E,
- 0x00, 0x07, 0x0B, 0x0E,
- 0x00, 0x03, 0x0B, 0x0E,
- 0x00, 0x03, 0x07, 0x0E,
- 0x00, 0x0E, 0x0E, 0x0E,
- 0x00, 0x00, 0x0E, 0x0E,
- 0x00, 0x00, 0x00, 0x0E,
- 0x00, 0x06, 0x0B, 0x11,
- 0x00, 0x08, 0x0D, 0x11,
- 0x00, 0x04, 0x0D, 0x11,
- 0x00, 0x04, 0x09, 0x11,
- 0x00, 0x11, 0x11, 0x11,
- 0x00, 0x00, 0x11, 0x11,
- 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x07, 0x0D, 0x14,
- 0x00, 0x0A, 0x0F, 0x14,
- 0x00, 0x05, 0x0F, 0x14,
- 0x00, 0x05, 0x0A, 0x14,
- 0x00, 0x14, 0x14, 0x14,
- 0x00, 0x00, 0x14, 0x14,
- 0x00, 0x00, 0x00, 0x14,
- 0x00, 0x0B, 0x12, 0x17,
- 0x00, 0x05, 0x12, 0x17,
- 0x00, 0x05, 0x0C, 0x17,
- 0x00, 0x17, 0x17, 0x17,
- 0x00, 0x00, 0x17, 0x17,
- 0x00, 0x00, 0x00, 0x17,
- 0x00, 0x0D, 0x14, 0x1A,
- 0x00, 0x06, 0x14, 0x1A,
- 0x00, 0x06, 0x0D, 0x1A,
- 0x00, 0x1A, 0x1A, 0x1A,
- 0x00, 0x00, 0x1A, 0x1A,
- 0x00, 0x00, 0x00, 0x1A,
- 0x00, 0x0E, 0x16, 0x1D,
- 0x00, 0x07, 0x16, 0x1D,
- 0x00, 0x07, 0x0F, 0x1D,
- 0x00, 0x1D, 0x1D, 0x1D,
- 0x00, 0x00, 0x1D, 0x1D,
- 0x00, 0x00, 0x00, 0x1D,
- 0x00, 0x10, 0x18, 0x20,
- 0x00, 0x08, 0x18, 0x20,
- 0x00, 0x08, 0x10, 0x20,
- 0x00, 0x20, 0x20, 0x20,
- 0x00, 0x00, 0x20, 0x20,
- 0x00, 0x00, 0x00, 0x20,
- 0x00, 0x23, 0x23, 0x23,
- 0x00, 0x00, 0x23, 0x23,
- 0x00, 0x00, 0x00, 0x23,
- 0x00, 0x12, 0x1B, 0x24,
- 0x00, 0x09, 0x1B, 0x24,
- 0x00, 0x09, 0x12, 0x24,
- 0x00, 0x28, 0x28, 0x28,
- 0x00, 0x00, 0x28, 0x28,
- 0x00, 0x00, 0x00, 0x28,
- 0x00, 0x2E, 0x2E, 0x2E,
- 0x00, 0x00, 0x2E, 0x2E,
- 0x00, 0x00, 0x00, 0x2E,
- 0x01, 0x02, 0x02, 0x03,
- 0x01, 0x02, 0x03, 0x04,
- 0x01, 0x03, 0x04, 0x05,
- 0x01, 0x02, 0x04, 0x05,
- 0x01, 0x02, 0x03, 0x05,
- 0x01, 0x03, 0x04, 0x06,
- 0x01, 0x03, 0x05, 0x06,
- 0x01, 0x02, 0x05, 0x06,
- 0x01, 0x02, 0x04, 0x06,
- 0x01, 0x03, 0x05, 0x07,
- 0x01, 0x04, 0x06, 0x07,
- 0x01, 0x02, 0x06, 0x07,
- 0x01, 0x02, 0x04, 0x07,
- 0x01, 0x07, 0x07, 0x07,
- 0x01, 0x01, 0x07, 0x07,
- 0x01, 0x01, 0x01, 0x07,
- 0x01, 0x04, 0x05, 0x08,
- 0x01, 0x04, 0x07, 0x08,
- 0x01, 0x02, 0x07, 0x08,
- 0x01, 0x02, 0x05, 0x08,
- 0x01, 0x04, 0x06, 0x09,
- 0x01, 0x05, 0x07, 0x09,
- 0x01, 0x03, 0x07, 0x09,
- 0x01, 0x03, 0x05, 0x09,
- 0x01, 0x09, 0x09, 0x09,
- 0x01, 0x01, 0x09, 0x09,
- 0x01, 0x01, 0x01, 0x09,
- 0x01, 0x05, 0x08, 0x0C,
- 0x01, 0x06, 0x0A, 0x0C,
- 0x01, 0x03, 0x0A, 0x0C,
- 0x01, 0x03, 0x07, 0x0C,
- 0x01, 0x0C, 0x0C, 0x0C,
- 0x01, 0x01, 0x0C, 0x0C,
- 0x01, 0x01, 0x01, 0x0C,
- 0x01, 0x06, 0x0A, 0x0F,
- 0x01, 0x08, 0x0C, 0x0F,
- 0x01, 0x04, 0x0C, 0x0F,
- 0x01, 0x04, 0x08, 0x0F,
- 0x01, 0x0F, 0x0F, 0x0F,
- 0x01, 0x01, 0x0F, 0x0F,
- 0x01, 0x01, 0x01, 0x0F,
- 0x01, 0x07, 0x0C, 0x12,
- 0x01, 0x09, 0x0E, 0x12,
- 0x01, 0x05, 0x0E, 0x12,
- 0x01, 0x05, 0x0A, 0x12,
- 0x01, 0x12, 0x12, 0x12,
- 0x01, 0x01, 0x12, 0x12,
- 0x01, 0x01, 0x01, 0x12,
- 0x01, 0x08, 0x0E, 0x15,
- 0x01, 0x0B, 0x10, 0x15,
- 0x01, 0x06, 0x10, 0x15,
- 0x01, 0x06, 0x0B, 0x15,
- 0x01, 0x15, 0x15, 0x15,
- 0x01, 0x01, 0x15, 0x15,
- 0x01, 0x01, 0x01, 0x15,
- 0x01, 0x0C, 0x13, 0x18,
- 0x01, 0x06, 0x13, 0x18,
- 0x01, 0x06, 0x0D, 0x18,
- 0x01, 0x18, 0x18, 0x18,
- 0x01, 0x01, 0x18, 0x18,
- 0x01, 0x01, 0x01, 0x18,
- 0x01, 0x0E, 0x15, 0x1B,
- 0x01, 0x07, 0x15, 0x1B,
- 0x01, 0x07, 0x0E, 0x1B,
- 0x01, 0x1B, 0x1B, 0x1B,
- 0x01, 0x01, 0x1B, 0x1B,
- 0x01, 0x01, 0x01, 0x1B,
- 0x01, 0x0F, 0x17, 0x1E,
- 0x01, 0x08, 0x17, 0x1E,
- 0x01, 0x08, 0x10, 0x1E,
- 0x01, 0x1E, 0x1E, 0x1E,
- 0x01, 0x01, 0x1E, 0x1E,
- 0x01, 0x01, 0x01, 0x1E,
- 0x01, 0x11, 0x19, 0x21,
- 0x01, 0x09, 0x19, 0x21,
- 0x01, 0x09, 0x11, 0x21,
- 0x01, 0x21, 0x21, 0x21,
- 0x01, 0x01, 0x21, 0x21,
- 0x01, 0x01, 0x01, 0x21,
- 0x01, 0x24, 0x24, 0x24,
- 0x01, 0x01, 0x24, 0x24,
- 0x01, 0x01, 0x01, 0x24,
- 0x01, 0x13, 0x1C, 0x25,
- 0x01, 0x0A, 0x1C, 0x25,
- 0x01, 0x0A, 0x13, 0x25,
- 0x01, 0x29, 0x29, 0x29,
- 0x01, 0x01, 0x29, 0x29,
- 0x01, 0x01, 0x01, 0x29,
- 0x01, 0x2F, 0x2F, 0x2F,
- 0x01, 0x01, 0x2F, 0x2F,
- 0x01, 0x01, 0x01, 0x2F,
- 0x02, 0x03, 0x03, 0x04,
- 0x02, 0x03, 0x04, 0x05,
- 0x02, 0x04, 0x05, 0x06,
- 0x02, 0x03, 0x05, 0x06,
- 0x02, 0x03, 0x04, 0x06,
- 0x02, 0x04, 0x05, 0x07,
- 0x02, 0x04, 0x06, 0x07,
- 0x02, 0x03, 0x06, 0x07,
- 0x02, 0x03, 0x05, 0x07,
- 0x02, 0x04, 0x06, 0x08,
- 0x02, 0x05, 0x07, 0x08,
- 0x02, 0x03, 0x07, 0x08,
- 0x02, 0x03, 0x05, 0x08,
- 0x02, 0x08, 0x08, 0x08,
- 0x02, 0x02, 0x08, 0x08,
- 0x02, 0x02, 0x02, 0x08,
- 0x02, 0x05, 0x06, 0x09,
- 0x02, 0x05, 0x08, 0x09,
- 0x02, 0x03, 0x08, 0x09,
- 0x02, 0x03, 0x06, 0x09,
- 0x02, 0x05, 0x07, 0x0A,
- 0x02, 0x06, 0x08, 0x0A,
- 0x02, 0x04, 0x08, 0x0A,
- 0x02, 0x04, 0x06, 0x0A,
- 0x02, 0x0A, 0x0A, 0x0A,
- 0x02, 0x02, 0x0A, 0x0A,
- 0x02, 0x02, 0x02, 0x0A,
- 0x02, 0x06, 0x09, 0x0D,
- 0x02, 0x07, 0x0B, 0x0D,
- 0x02, 0x04, 0x0B, 0x0D,
- 0x02, 0x04, 0x08, 0x0D,
- 0x02, 0x0D, 0x0D, 0x0D,
- 0x02, 0x02, 0x0D, 0x0D,
- 0x02, 0x02, 0x02, 0x0D,
- 0x02, 0x07, 0x0B, 0x10,
- 0x02, 0x09, 0x0D, 0x10,
- 0x02, 0x05, 0x0D, 0x10,
- 0x02, 0x05, 0x09, 0x10,
- 0x02, 0x10, 0x10, 0x10,
- 0x02, 0x02, 0x10, 0x10,
- 0x02, 0x02, 0x02, 0x10,
- 0x02, 0x08, 0x0D, 0x13,
- 0x02, 0x0A, 0x0F, 0x13,
- 0x02, 0x06, 0x0F, 0x13,
- 0x02, 0x06, 0x0B, 0x13,
- 0x02, 0x13, 0x13, 0x13,
- 0x02, 0x02, 0x13, 0x13,
- 0x02, 0x02, 0x02, 0x13,
- 0x02, 0x09, 0x0F, 0x16,
- 0x02, 0x0C, 0x11, 0x16,
- 0x02, 0x07, 0x11, 0x16,
- 0x02, 0x07, 0x0C, 0x16,
- 0x02, 0x16, 0x16, 0x16,
- 0x02, 0x02, 0x16, 0x16,
- 0x02, 0x02, 0x02, 0x16,
- 0x02, 0x0D, 0x14, 0x19,
- 0x02, 0x07, 0x14, 0x19,
- 0x02, 0x07, 0x0E, 0x19,
- 0x02, 0x19, 0x19, 0x19,
- 0x02, 0x02, 0x19, 0x19,
- 0x02, 0x02, 0x02, 0x19,
- 0x02, 0x0F, 0x16, 0x1C,
- 0x02, 0x08, 0x16, 0x1C,
- 0x02, 0x08, 0x0F, 0x1C,
- 0x02, 0x1C, 0x1C, 0x1C,
- 0x02, 0x02, 0x1C, 0x1C,
- 0x02, 0x02, 0x02, 0x1C,
- 0x02, 0x10, 0x18, 0x1F,
- 0x02, 0x09, 0x18, 0x1F,
- 0x02, 0x09, 0x11, 0x1F,
- 0x02, 0x1F, 0x1F, 0x1F,
- 0x02, 0x02, 0x1F, 0x1F,
- 0x02, 0x02, 0x02, 0x1F,
- 0x02, 0x12, 0x1A, 0x22,
- 0x02, 0x0A, 0x1A, 0x22,
- 0x02, 0x0A, 0x12, 0x22,
- 0x02, 0x22, 0x22, 0x22,
- 0x02, 0x02, 0x22, 0x22,
- 0x02, 0x02, 0x02, 0x22,
- 0x02, 0x25, 0x25, 0x25,
- 0x02, 0x02, 0x25, 0x25,
- 0x02, 0x02, 0x02, 0x25,
- 0x02, 0x14, 0x1D, 0x26,
- 0x02, 0x0B, 0x1D, 0x26,
- 0x02, 0x0B, 0x14, 0x26,
- 0x02, 0x2A, 0x2A, 0x2A,
- 0x02, 0x02, 0x2A, 0x2A,
- 0x02, 0x02, 0x02, 0x2A,
- 0x02, 0x30, 0x30, 0x30,
- 0x02, 0x02, 0x30, 0x30,
- 0x02, 0x02, 0x02, 0x30,
- 0x03, 0x04, 0x04, 0x05,
- 0x03, 0x04, 0x05, 0x06,
- 0x03, 0x05, 0x06, 0x07,
- 0x03, 0x04, 0x06, 0x07,
- 0x03, 0x04, 0x05, 0x07,
- 0x03, 0x05, 0x06, 0x08,
- 0x03, 0x05, 0x07, 0x08,
- 0x03, 0x04, 0x07, 0x08,
- 0x03, 0x04, 0x06, 0x08,
- 0x03, 0x05, 0x07, 0x09,
- 0x03, 0x06, 0x08, 0x09,
- 0x03, 0x04, 0x08, 0x09,
- 0x03, 0x04, 0x06, 0x09,
- 0x03, 0x09, 0x09, 0x09,
- 0x03, 0x03, 0x09, 0x09,
- 0x03, 0x03, 0x03, 0x09,
- 0x03, 0x06, 0x07, 0x0A,
- 0x03, 0x06, 0x09, 0x0A,
- 0x03, 0x04, 0x09, 0x0A,
- 0x03, 0x04, 0x07, 0x0A,
- 0x03, 0x06, 0x08, 0x0B,
- 0x03, 0x07, 0x09, 0x0B,
- 0x03, 0x05, 0x09, 0x0B,
- 0x03, 0x05, 0x07, 0x0B,
- 0x03, 0x0B, 0x0B, 0x0B,
- 0x03, 0x03, 0x0B, 0x0B,
- 0x03, 0x03, 0x03, 0x0B,
- 0x03, 0x07, 0x0A, 0x0E,
- 0x03, 0x08, 0x0C, 0x0E,
- 0x03, 0x05, 0x0C, 0x0E,
- 0x03, 0x05, 0x09, 0x0E,
- 0x03, 0x0E, 0x0E, 0x0E,
- 0x03, 0x03, 0x0E, 0x0E,
- 0x03, 0x03, 0x03, 0x0E,
- 0x03, 0x08, 0x0C, 0x11,
- 0x03, 0x0A, 0x0E, 0x11,
- 0x03, 0x06, 0x0E, 0x11,
- 0x03, 0x06, 0x0A, 0x11,
- 0x03, 0x11, 0x11, 0x11,
- 0x03, 0x03, 0x11, 0x11,
- 0x03, 0x03, 0x03, 0x11,
- 0x03, 0x09, 0x0E, 0x14,
- 0x03, 0x0B, 0x10, 0x14,
- 0x03, 0x07, 0x10, 0x14,
- 0x03, 0x07, 0x0C, 0x14,
- 0x03, 0x14, 0x14, 0x14,
- 0x03, 0x03, 0x14, 0x14,
- 0x03, 0x03, 0x03, 0x14,
- 0x03, 0x0A, 0x10, 0x17,
- 0x03, 0x0D, 0x12, 0x17,
- 0x03, 0x08, 0x12, 0x17,
- 0x03, 0x08, 0x0D, 0x17,
- 0x03, 0x17, 0x17, 0x17,
- 0x03, 0x03, 0x17, 0x17,
- 0x03, 0x03, 0x03, 0x17,
- 0x03, 0x0E, 0x15, 0x1A,
- 0x03, 0x08, 0x15, 0x1A,
- 0x03, 0x08, 0x0F, 0x1A,
- 0x03, 0x1A, 0x1A, 0x1A,
- 0x03, 0x03, 0x1A, 0x1A,
- 0x03, 0x03, 0x03, 0x1A,
- 0x03, 0x10, 0x17, 0x1D,
- 0x03, 0x09, 0x17, 0x1D,
- 0x03, 0x09, 0x10, 0x1D,
- 0x03, 0x1D, 0x1D, 0x1D,
- 0x03, 0x03, 0x1D, 0x1D,
- 0x03, 0x03, 0x03, 0x1D,
- 0x03, 0x11, 0x19, 0x20,
- 0x03, 0x0A, 0x19, 0x20,
- 0x03, 0x0A, 0x12, 0x20,
- 0x03, 0x20, 0x20, 0x20,
- 0x03, 0x03, 0x20, 0x20,
- 0x03, 0x03, 0x03, 0x20,
- 0x03, 0x13, 0x1B, 0x23,
- 0x03, 0x0B, 0x1B, 0x23,
- 0x03, 0x0B, 0x13, 0x23,
- 0x03, 0x23, 0x23, 0x23,
- 0x03, 0x03, 0x23, 0x23,
- 0x03, 0x03, 0x03, 0x23,
- 0x03, 0x26, 0x26, 0x26,
- 0x03, 0x03, 0x26, 0x26,
- 0x03, 0x03, 0x03, 0x26,
- 0x03, 0x15, 0x1E, 0x27,
- 0x03, 0x0C, 0x1E, 0x27,
- 0x03, 0x0C, 0x15, 0x27,
- 0x03, 0x2B, 0x2B, 0x2B,
- 0x03, 0x03, 0x2B, 0x2B,
- 0x03, 0x03, 0x03, 0x2B,
- 0x03, 0x31, 0x31, 0x31,
- 0x03, 0x03, 0x31, 0x31,
- 0x03, 0x03, 0x03, 0x31,
- 0x04, 0x05, 0x05, 0x06,
- 0x04, 0x05, 0x06, 0x07,
- 0x04, 0x06, 0x07, 0x08,
- 0x04, 0x05, 0x07, 0x08,
- 0x04, 0x05, 0x06, 0x08,
- 0x04, 0x06, 0x07, 0x09,
- 0x04, 0x06, 0x08, 0x09,
- 0x04, 0x05, 0x08, 0x09,
- 0x04, 0x05, 0x07, 0x09,
- 0x04, 0x06, 0x08, 0x0A,
- 0x04, 0x07, 0x09, 0x0A,
- 0x04, 0x05, 0x09, 0x0A,
- 0x04, 0x05, 0x07, 0x0A,
- 0x04, 0x0A, 0x0A, 0x0A,
- 0x04, 0x04, 0x0A, 0x0A,
- 0x04, 0x04, 0x04, 0x0A,
- 0x04, 0x07, 0x08, 0x0B,
- 0x04, 0x07, 0x0A, 0x0B,
- 0x04, 0x05, 0x0A, 0x0B,
- 0x04, 0x05, 0x08, 0x0B,
- 0x04, 0x07, 0x09, 0x0C,
- 0x04, 0x08, 0x0A, 0x0C,
- 0x04, 0x06, 0x0A, 0x0C,
- 0x04, 0x06, 0x08, 0x0C,
- 0x04, 0x0C, 0x0C, 0x0C,
- 0x04, 0x04, 0x0C, 0x0C,
- 0x04, 0x04, 0x04, 0x0C,
- 0x04, 0x08, 0x0B, 0x0F,
- 0x04, 0x09, 0x0D, 0x0F,
- 0x04, 0x06, 0x0D, 0x0F,
- 0x04, 0x06, 0x0A, 0x0F,
- 0x04, 0x0F, 0x0F, 0x0F,
- 0x04, 0x04, 0x0F, 0x0F,
- 0x04, 0x04, 0x04, 0x0F,
- 0x04, 0x09, 0x0D, 0x12,
- 0x04, 0x0B, 0x0F, 0x12,
- 0x04, 0x07, 0x0F, 0x12,
- 0x04, 0x07, 0x0B, 0x12,
- 0x04, 0x12, 0x12, 0x12,
- 0x04, 0x04, 0x12, 0x12,
- 0x04, 0x04, 0x04, 0x12,
- 0x04, 0x0A, 0x0F, 0x15,
- 0x04, 0x0C, 0x11, 0x15,
- 0x04, 0x08, 0x11, 0x15,
- 0x04, 0x08, 0x0D, 0x15,
- 0x04, 0x15, 0x15, 0x15,
- 0x04, 0x04, 0x15, 0x15,
- 0x04, 0x04, 0x04, 0x15,
- 0x04, 0x0B, 0x11, 0x18,
- 0x04, 0x0E, 0x13, 0x18,
- 0x04, 0x09, 0x13, 0x18,
- 0x04, 0x09, 0x0E, 0x18,
- 0x04, 0x18, 0x18, 0x18,
- 0x04, 0x04, 0x18, 0x18,
- 0x04, 0x04, 0x04, 0x18,
- 0x04, 0x0F, 0x16, 0x1B,
- 0x04, 0x09, 0x16, 0x1B,
- 0x04, 0x09, 0x10, 0x1B,
- 0x04, 0x1B, 0x1B, 0x1B,
- 0x04, 0x04, 0x1B, 0x1B,
- 0x04, 0x04, 0x04, 0x1B,
- 0x04, 0x11, 0x18, 0x1E,
- 0x04, 0x0A, 0x18, 0x1E,
- 0x04, 0x0A, 0x11, 0x1E,
- 0x04, 0x1E, 0x1E, 0x1E,
- 0x04, 0x04, 0x1E, 0x1E,
- 0x04, 0x04, 0x04, 0x1E,
- 0x04, 0x12, 0x1A, 0x21,
- 0x04, 0x0B, 0x1A, 0x21,
- 0x04, 0x0B, 0x13, 0x21,
- 0x04, 0x21, 0x21, 0x21,
- 0x04, 0x04, 0x21, 0x21,
- 0x04, 0x04, 0x04, 0x21,
- 0x04, 0x14, 0x1C, 0x24,
- 0x04, 0x0C, 0x1C, 0x24,
- 0x04, 0x0C, 0x14, 0x24,
- 0x04, 0x24, 0x24, 0x24,
- 0x04, 0x04, 0x24, 0x24,
- 0x04, 0x04, 0x04, 0x24,
- 0x04, 0x27, 0x27, 0x27,
- 0x04, 0x04, 0x27, 0x27,
- 0x04, 0x04, 0x04, 0x27,
- 0x04, 0x16, 0x1F, 0x28,
- 0x04, 0x0D, 0x1F, 0x28,
- 0x04, 0x0D, 0x16, 0x28,
- 0x04, 0x2C, 0x2C, 0x2C,
- 0x04, 0x04, 0x2C, 0x2C,
- 0x04, 0x04, 0x04, 0x2C,
- 0x04, 0x32, 0x32, 0x32,
- 0x04, 0x04, 0x32, 0x32,
- 0x04, 0x04, 0x04, 0x32,
- 0x05, 0x06, 0x06, 0x07,
- 0x05, 0x06, 0x07, 0x08,
- 0x05, 0x07, 0x08, 0x09,
- 0x05, 0x06, 0x08, 0x09,
- 0x05, 0x06, 0x07, 0x09,
- 0x05, 0x07, 0x08, 0x0A,
- 0x05, 0x07, 0x09, 0x0A,
- 0x05, 0x06, 0x09, 0x0A,
- 0x05, 0x06, 0x08, 0x0A,
- 0x05, 0x07, 0x09, 0x0B,
- 0x05, 0x08, 0x0A, 0x0B,
- 0x05, 0x06, 0x0A, 0x0B,
- 0x05, 0x06, 0x08, 0x0B,
- 0x05, 0x0B, 0x0B, 0x0B,
- 0x05, 0x05, 0x0B, 0x0B,
- 0x05, 0x05, 0x05, 0x0B,
- 0x05, 0x08, 0x09, 0x0C,
- 0x05, 0x08, 0x0B, 0x0C,
- 0x05, 0x06, 0x0B, 0x0C,
- 0x05, 0x06, 0x09, 0x0C,
- 0x05, 0x08, 0x0A, 0x0D,
- 0x05, 0x09, 0x0B, 0x0D,
- 0x05, 0x07, 0x0B, 0x0D,
- 0x05, 0x07, 0x09, 0x0D,
- 0x05, 0x0D, 0x0D, 0x0D,
- 0x05, 0x05, 0x0D, 0x0D,
- 0x05, 0x05, 0x05, 0x0D,
- 0x05, 0x09, 0x0C, 0x10,
- 0x05, 0x0A, 0x0E, 0x10,
- 0x05, 0x07, 0x0E, 0x10,
- 0x05, 0x07, 0x0B, 0x10,
- 0x05, 0x10, 0x10, 0x10,
- 0x05, 0x05, 0x10, 0x10,
- 0x05, 0x05, 0x05, 0x10,
- 0x05, 0x0A, 0x0E, 0x13,
- 0x05, 0x0C, 0x10, 0x13,
- 0x05, 0x08, 0x10, 0x13,
- 0x05, 0x08, 0x0C, 0x13,
- 0x05, 0x13, 0x13, 0x13,
- 0x05, 0x05, 0x13, 0x13,
- 0x05, 0x05, 0x05, 0x13,
- 0x05, 0x0B, 0x10, 0x16,
- 0x05, 0x0D, 0x12, 0x16,
- 0x05, 0x09, 0x12, 0x16,
- 0x05, 0x09, 0x0E, 0x16,
- 0x05, 0x16, 0x16, 0x16,
- 0x05, 0x05, 0x16, 0x16,
- 0x05, 0x05, 0x05, 0x16,
- 0x05, 0x0C, 0x12, 0x19,
- 0x05, 0x0F, 0x14, 0x19,
- 0x05, 0x0A, 0x14, 0x19,
- 0x05, 0x0A, 0x0F, 0x19,
- 0x05, 0x19, 0x19, 0x19,
- 0x05, 0x05, 0x19, 0x19,
- 0x05, 0x05, 0x05, 0x19,
- 0x05, 0x10, 0x17, 0x1C,
- 0x05, 0x0A, 0x17, 0x1C,
- 0x05, 0x0A, 0x11, 0x1C,
- 0x05, 0x1C, 0x1C, 0x1C,
- 0x05, 0x05, 0x1C, 0x1C,
- 0x05, 0x05, 0x05, 0x1C,
- 0x05, 0x12, 0x19, 0x1F,
- 0x05, 0x0B, 0x19, 0x1F,
- 0x05, 0x0B, 0x12, 0x1F,
- 0x05, 0x1F, 0x1F, 0x1F,
- 0x05, 0x05, 0x1F, 0x1F,
- 0x05, 0x05, 0x05, 0x1F,
- 0x05, 0x13, 0x1B, 0x22,
- 0x05, 0x0C, 0x1B, 0x22,
- 0x05, 0x0C, 0x14, 0x22,
- 0x05, 0x22, 0x22, 0x22,
- 0x05, 0x05, 0x22, 0x22,
- 0x05, 0x05, 0x05, 0x22,
- 0x05, 0x15, 0x1D, 0x25,
- 0x05, 0x0D, 0x1D, 0x25,
- 0x05, 0x0D, 0x15, 0x25,
- 0x05, 0x25, 0x25, 0x25,
- 0x05, 0x05, 0x25, 0x25,
- 0x05, 0x05, 0x05, 0x25,
- 0x05, 0x28, 0x28, 0x28,
- 0x05, 0x05, 0x28, 0x28,
- 0x05, 0x05, 0x05, 0x28,
- 0x05, 0x17, 0x20, 0x29,
- 0x05, 0x0E, 0x20, 0x29,
- 0x05, 0x0E, 0x17, 0x29,
- 0x05, 0x2D, 0x2D, 0x2D,
- 0x05, 0x05, 0x2D, 0x2D,
- 0x05, 0x05, 0x05, 0x2D,
- 0x05, 0x33, 0x33, 0x33,
- 0x05, 0x05, 0x33, 0x33,
- 0x05, 0x05, 0x05, 0x33,
- 0x06, 0x07, 0x07, 0x08,
- 0x06, 0x07, 0x08, 0x09,
- 0x06, 0x08, 0x09, 0x0A,
- 0x06, 0x07, 0x09, 0x0A,
- 0x06, 0x07, 0x08, 0x0A,
- 0x06, 0x08, 0x09, 0x0B,
- 0x06, 0x08, 0x0A, 0x0B,
- 0x06, 0x07, 0x0A, 0x0B,
- 0x06, 0x07, 0x09, 0x0B,
- 0x06, 0x08, 0x0A, 0x0C,
- 0x06, 0x09, 0x0B, 0x0C,
- 0x06, 0x07, 0x0B, 0x0C,
- 0x06, 0x07, 0x09, 0x0C,
- 0x06, 0x0C, 0x0C, 0x0C,
- 0x06, 0x06, 0x0C, 0x0C,
- 0x06, 0x06, 0x06, 0x0C,
- 0x06, 0x09, 0x0A, 0x0D,
- 0x06, 0x09, 0x0C, 0x0D,
- 0x06, 0x07, 0x0C, 0x0D,
- 0x06, 0x07, 0x0A, 0x0D,
- 0x06, 0x09, 0x0B, 0x0E,
- 0x06, 0x0A, 0x0C, 0x0E,
- 0x06, 0x08, 0x0C, 0x0E,
- 0x06, 0x08, 0x0A, 0x0E,
- 0x06, 0x0E, 0x0E, 0x0E,
- 0x06, 0x06, 0x0E, 0x0E,
- 0x06, 0x06, 0x06, 0x0E,
- 0x06, 0x0A, 0x0D, 0x11,
- 0x06, 0x0B, 0x0F, 0x11,
- 0x06, 0x08, 0x0F, 0x11,
- 0x06, 0x08, 0x0C, 0x11,
- 0x06, 0x11, 0x11, 0x11,
- 0x06, 0x06, 0x11, 0x11,
- 0x06, 0x06, 0x06, 0x11,
- 0x06, 0x0B, 0x0F, 0x14,
- 0x06, 0x0D, 0x11, 0x14,
- 0x06, 0x09, 0x11, 0x14,
- 0x06, 0x09, 0x0D, 0x14,
- 0x06, 0x14, 0x14, 0x14,
- 0x06, 0x06, 0x14, 0x14,
- 0x06, 0x06, 0x06, 0x14,
- 0x06, 0x0C, 0x11, 0x17,
- 0x06, 0x0E, 0x13, 0x17,
- 0x06, 0x0A, 0x13, 0x17,
- 0x06, 0x0A, 0x0F, 0x17,
- 0x06, 0x17, 0x17, 0x17,
- 0x06, 0x06, 0x17, 0x17,
- 0x06, 0x06, 0x06, 0x17,
- 0x06, 0x0D, 0x13, 0x1A,
- 0x06, 0x10, 0x15, 0x1A,
- 0x06, 0x0B, 0x15, 0x1A,
- 0x06, 0x0B, 0x10, 0x1A,
- 0x06, 0x1A, 0x1A, 0x1A,
- 0x06, 0x06, 0x1A, 0x1A,
- 0x06, 0x06, 0x06, 0x1A,
- 0x06, 0x11, 0x18, 0x1D,
- 0x06, 0x0B, 0x18, 0x1D,
- 0x06, 0x0B, 0x12, 0x1D,
- 0x06, 0x1D, 0x1D, 0x1D,
- 0x06, 0x06, 0x1D, 0x1D,
- 0x06, 0x06, 0x06, 0x1D,
- 0x06, 0x13, 0x1A, 0x20,
- 0x06, 0x0C, 0x1A, 0x20,
- 0x06, 0x0C, 0x13, 0x20,
- 0x06, 0x20, 0x20, 0x20,
- 0x06, 0x06, 0x20, 0x20,
- 0x06, 0x06, 0x06, 0x20,
- 0x06, 0x14, 0x1C, 0x23,
- 0x06, 0x0D, 0x1C, 0x23,
- 0x06, 0x0D, 0x15, 0x23,
- 0x06, 0x23, 0x23, 0x23,
- 0x06, 0x06, 0x23, 0x23,
- 0x06, 0x06, 0x06, 0x23,
- 0x06, 0x16, 0x1E, 0x26,
- 0x06, 0x0E, 0x1E, 0x26,
- 0x06, 0x0E, 0x16, 0x26,
- 0x06, 0x26, 0x26, 0x26,
- 0x06, 0x06, 0x26, 0x26,
- 0x06, 0x06, 0x06, 0x26,
- 0x06, 0x29, 0x29, 0x29,
- 0x06, 0x06, 0x29, 0x29,
- 0x06, 0x06, 0x06, 0x29,
- 0x06, 0x18, 0x21, 0x2A,
- 0x06, 0x0F, 0x21, 0x2A,
- 0x06, 0x0F, 0x18, 0x2A,
- 0x06, 0x2E, 0x2E, 0x2E,
- 0x06, 0x06, 0x2E, 0x2E,
- 0x06, 0x06, 0x06, 0x2E,
- 0x06, 0x34, 0x34, 0x34,
- 0x06, 0x06, 0x34, 0x34,
- 0x06, 0x06, 0x06, 0x34,
- 0x07, 0x08, 0x08, 0x09,
- 0x07, 0x08, 0x09, 0x0A,
- 0x07, 0x09, 0x0A, 0x0B,
- 0x07, 0x08, 0x0A, 0x0B,
- 0x07, 0x08, 0x09, 0x0B,
- 0x07, 0x09, 0x0A, 0x0C,
- 0x07, 0x09, 0x0B, 0x0C,
- 0x07, 0x08, 0x0B, 0x0C,
- 0x07, 0x08, 0x0A, 0x0C,
- 0x07, 0x09, 0x0B, 0x0D,
- 0x07, 0x0A, 0x0C, 0x0D,
- 0x07, 0x08, 0x0C, 0x0D,
- 0x07, 0x08, 0x0A, 0x0D,
- 0x07, 0x0D, 0x0D, 0x0D,
- 0x07, 0x07, 0x0D, 0x0D,
- 0x07, 0x07, 0x07, 0x0D,
- 0x07, 0x0A, 0x0B, 0x0E,
- 0x07, 0x0A, 0x0D, 0x0E,
- 0x07, 0x08, 0x0D, 0x0E,
- 0x07, 0x08, 0x0B, 0x0E,
- 0x07, 0x0A, 0x0C, 0x0F,
- 0x07, 0x0B, 0x0D, 0x0F,
- 0x07, 0x09, 0x0D, 0x0F,
- 0x07, 0x09, 0x0B, 0x0F,
- 0x07, 0x0F, 0x0F, 0x0F,
- 0x07, 0x07, 0x0F, 0x0F,
- 0x07, 0x07, 0x07, 0x0F,
- 0x07, 0x0B, 0x0E, 0x12,
- 0x07, 0x0C, 0x10, 0x12,
- 0x07, 0x09, 0x10, 0x12,
- 0x07, 0x09, 0x0D, 0x12,
- 0x07, 0x12, 0x12, 0x12,
- 0x07, 0x07, 0x12, 0x12,
- 0x07, 0x07, 0x07, 0x12,
- 0x07, 0x0C, 0x10, 0x15,
- 0x07, 0x0E, 0x12, 0x15,
- 0x07, 0x0A, 0x12, 0x15,
- 0x07, 0x0A, 0x0E, 0x15,
- 0x07, 0x15, 0x15, 0x15,
- 0x07, 0x07, 0x15, 0x15,
- 0x07, 0x07, 0x07, 0x15,
- 0x07, 0x0D, 0x12, 0x18,
- 0x07, 0x0F, 0x14, 0x18,
- 0x07, 0x0B, 0x14, 0x18,
- 0x07, 0x0B, 0x10, 0x18,
- 0x07, 0x18, 0x18, 0x18,
- 0x07, 0x07, 0x18, 0x18,
- 0x07, 0x07, 0x07, 0x18,
- 0x07, 0x0E, 0x14, 0x1B,
- 0x07, 0x11, 0x16, 0x1B,
- 0x07, 0x0C, 0x16, 0x1B,
- 0x07, 0x0C, 0x11, 0x1B,
- 0x07, 0x1B, 0x1B, 0x1B,
- 0x07, 0x07, 0x1B, 0x1B,
- 0x07, 0x07, 0x07, 0x1B,
- 0x07, 0x12, 0x19, 0x1E,
- 0x07, 0x0C, 0x19, 0x1E,
- 0x07, 0x0C, 0x13, 0x1E,
- 0x07, 0x1E, 0x1E, 0x1E,
- 0x07, 0x07, 0x1E, 0x1E,
- 0x07, 0x07, 0x07, 0x1E,
- 0x07, 0x14, 0x1B, 0x21,
- 0x07, 0x0D, 0x1B, 0x21,
- 0x07, 0x0D, 0x14, 0x21,
- 0x07, 0x21, 0x21, 0x21,
- 0x07, 0x07, 0x21, 0x21,
- 0x07, 0x07, 0x07, 0x21,
- 0x07, 0x15, 0x1D, 0x24,
- 0x07, 0x0E, 0x1D, 0x24,
- 0x07, 0x0E, 0x16, 0x24,
- 0x07, 0x24, 0x24, 0x24,
- 0x07, 0x07, 0x24, 0x24,
- 0x07, 0x07, 0x07, 0x24,
- 0x07, 0x17, 0x1F, 0x27,
- 0x07, 0x0F, 0x1F, 0x27,
- 0x07, 0x0F, 0x17, 0x27,
- 0x07, 0x27, 0x27, 0x27,
- 0x07, 0x07, 0x27, 0x27,
- 0x07, 0x07, 0x07, 0x27,
- 0x07, 0x2A, 0x2A, 0x2A,
- 0x07, 0x07, 0x2A, 0x2A,
- 0x07, 0x07, 0x07, 0x2A,
- 0x07, 0x19, 0x22, 0x2B,
- 0x07, 0x10, 0x22, 0x2B,
- 0x07, 0x10, 0x19, 0x2B,
- 0x07, 0x2F, 0x2F, 0x2F,
- 0x07, 0x07, 0x2F, 0x2F,
- 0x07, 0x07, 0x07, 0x2F,
- 0x07, 0x35, 0x35, 0x35,
- 0x07, 0x07, 0x35, 0x35,
- 0x07, 0x07, 0x07, 0x35,
- 0x08, 0x09, 0x09, 0x0A,
- 0x08, 0x09, 0x0A, 0x0B,
- 0x08, 0x0A, 0x0B, 0x0C,
- 0x08, 0x09, 0x0B, 0x0C,
- 0x08, 0x09, 0x0A, 0x0C,
- 0x08, 0x0A, 0x0B, 0x0D,
- 0x08, 0x0A, 0x0C, 0x0D,
- 0x08, 0x09, 0x0C, 0x0D,
- 0x08, 0x09, 0x0B, 0x0D,
- 0x08, 0x0A, 0x0C, 0x0E,
- 0x08, 0x0B, 0x0D, 0x0E,
- 0x08, 0x09, 0x0D, 0x0E,
- 0x08, 0x09, 0x0B, 0x0E,
- 0x08, 0x0E, 0x0E, 0x0E,
- 0x08, 0x08, 0x0E, 0x0E,
- 0x08, 0x08, 0x08, 0x0E,
- 0x08, 0x0B, 0x0C, 0x0F,
- 0x08, 0x0B, 0x0E, 0x0F,
- 0x08, 0x09, 0x0E, 0x0F,
- 0x08, 0x09, 0x0C, 0x0F,
- 0x08, 0x0B, 0x0D, 0x10,
- 0x08, 0x0C, 0x0E, 0x10,
- 0x08, 0x0A, 0x0E, 0x10,
- 0x08, 0x0A, 0x0C, 0x10,
- 0x08, 0x10, 0x10, 0x10,
- 0x08, 0x08, 0x10, 0x10,
- 0x08, 0x08, 0x08, 0x10,
- 0x08, 0x0C, 0x0F, 0x13,
- 0x08, 0x0D, 0x11, 0x13,
- 0x08, 0x0A, 0x11, 0x13,
- 0x08, 0x0A, 0x0E, 0x13,
- 0x08, 0x13, 0x13, 0x13,
- 0x08, 0x08, 0x13, 0x13,
- 0x08, 0x08, 0x08, 0x13,
- 0x08, 0x0D, 0x11, 0x16,
- 0x08, 0x0F, 0x13, 0x16,
- 0x08, 0x0B, 0x13, 0x16,
- 0x08, 0x0B, 0x0F, 0x16,
- 0x08, 0x16, 0x16, 0x16,
- 0x08, 0x08, 0x16, 0x16,
- 0x08, 0x08, 0x08, 0x16,
- 0x08, 0x0E, 0x13, 0x19,
- 0x08, 0x10, 0x15, 0x19,
- 0x08, 0x0C, 0x15, 0x19,
- 0x08, 0x0C, 0x11, 0x19,
- 0x08, 0x19, 0x19, 0x19,
- 0x08, 0x08, 0x19, 0x19,
- 0x08, 0x08, 0x08, 0x19,
- 0x08, 0x0F, 0x15, 0x1C,
- 0x08, 0x12, 0x17, 0x1C,
- 0x08, 0x0D, 0x17, 0x1C,
- 0x08, 0x0D, 0x12, 0x1C,
- 0x08, 0x1C, 0x1C, 0x1C,
- 0x08, 0x08, 0x1C, 0x1C,
- 0x08, 0x08, 0x08, 0x1C,
- 0x08, 0x13, 0x1A, 0x1F,
- 0x08, 0x0D, 0x1A, 0x1F,
- 0x08, 0x0D, 0x14, 0x1F,
- 0x08, 0x1F, 0x1F, 0x1F,
- 0x08, 0x08, 0x1F, 0x1F,
- 0x08, 0x08, 0x08, 0x1F,
- 0x08, 0x15, 0x1C, 0x22,
- 0x08, 0x0E, 0x1C, 0x22,
- 0x08, 0x0E, 0x15, 0x22,
- 0x08, 0x22, 0x22, 0x22,
- 0x08, 0x08, 0x22, 0x22,
- 0x08, 0x08, 0x08, 0x22,
- 0x08, 0x16, 0x1E, 0x25,
- 0x08, 0x0F, 0x1E, 0x25,
- 0x08, 0x0F, 0x17, 0x25,
- 0x08, 0x25, 0x25, 0x25,
- 0x08, 0x08, 0x25, 0x25,
- 0x08, 0x08, 0x08, 0x25,
- 0x08, 0x18, 0x20, 0x28,
- 0x08, 0x10, 0x20, 0x28,
- 0x08, 0x10, 0x18, 0x28,
- 0x08, 0x28, 0x28, 0x28,
- 0x08, 0x08, 0x28, 0x28,
- 0x08, 0x08, 0x08, 0x28,
- 0x08, 0x2B, 0x2B, 0x2B,
- 0x08, 0x08, 0x2B, 0x2B,
- 0x08, 0x08, 0x08, 0x2B,
- 0x08, 0x1A, 0x23, 0x2C,
- 0x08, 0x11, 0x23, 0x2C,
- 0x08, 0x11, 0x1A, 0x2C,
- 0x08, 0x30, 0x30, 0x30,
- 0x08, 0x08, 0x30, 0x30,
- 0x08, 0x08, 0x08, 0x30,
- 0x08, 0x36, 0x36, 0x36,
- 0x08, 0x08, 0x36, 0x36,
- 0x08, 0x08, 0x08, 0x36,
- 0x09, 0x0A, 0x0A, 0x0B,
- 0x09, 0x0A, 0x0B, 0x0C,
- 0x09, 0x0B, 0x0C, 0x0D,
- 0x09, 0x0A, 0x0C, 0x0D,
- 0x09, 0x0A, 0x0B, 0x0D,
- 0x09, 0x0B, 0x0C, 0x0E,
- 0x09, 0x0B, 0x0D, 0x0E,
- 0x09, 0x0A, 0x0D, 0x0E,
- 0x09, 0x0A, 0x0C, 0x0E,
- 0x09, 0x0B, 0x0D, 0x0F,
- 0x09, 0x0C, 0x0E, 0x0F,
- 0x09, 0x0A, 0x0E, 0x0F,
- 0x09, 0x0A, 0x0C, 0x0F,
- 0x09, 0x0F, 0x0F, 0x0F,
- 0x09, 0x09, 0x0F, 0x0F,
- 0x09, 0x09, 0x09, 0x0F,
- 0x09, 0x0C, 0x0D, 0x10,
- 0x09, 0x0C, 0x0F, 0x10,
- 0x09, 0x0A, 0x0F, 0x10,
- 0x09, 0x0A, 0x0D, 0x10,
- 0x09, 0x0C, 0x0E, 0x11,
- 0x09, 0x0D, 0x0F, 0x11,
- 0x09, 0x0B, 0x0F, 0x11,
- 0x09, 0x0B, 0x0D, 0x11,
- 0x09, 0x11, 0x11, 0x11,
- 0x09, 0x09, 0x11, 0x11,
- 0x09, 0x09, 0x09, 0x11,
- 0x09, 0x0D, 0x10, 0x14,
- 0x09, 0x0E, 0x12, 0x14,
- 0x09, 0x0B, 0x12, 0x14,
- 0x09, 0x0B, 0x0F, 0x14,
- 0x09, 0x14, 0x14, 0x14,
- 0x09, 0x09, 0x14, 0x14,
- 0x09, 0x09, 0x09, 0x14,
- 0x09, 0x0E, 0x12, 0x17,
- 0x09, 0x10, 0x14, 0x17,
- 0x09, 0x0C, 0x14, 0x17,
- 0x09, 0x0C, 0x10, 0x17,
- 0x09, 0x17, 0x17, 0x17,
- 0x09, 0x09, 0x17, 0x17,
- 0x09, 0x09, 0x09, 0x17,
- 0x09, 0x0F, 0x14, 0x1A,
- 0x09, 0x11, 0x16, 0x1A,
- 0x09, 0x0D, 0x16, 0x1A,
- 0x09, 0x0D, 0x12, 0x1A,
- 0x09, 0x1A, 0x1A, 0x1A,
- 0x09, 0x09, 0x1A, 0x1A,
- 0x09, 0x09, 0x09, 0x1A,
- 0x09, 0x10, 0x16, 0x1D,
- 0x09, 0x13, 0x18, 0x1D,
- 0x09, 0x0E, 0x18, 0x1D,
- 0x09, 0x0E, 0x13, 0x1D,
- 0x09, 0x1D, 0x1D, 0x1D,
- 0x09, 0x09, 0x1D, 0x1D,
- 0x09, 0x09, 0x09, 0x1D,
- 0x09, 0x14, 0x1B, 0x20,
- 0x09, 0x0E, 0x1B, 0x20,
- 0x09, 0x0E, 0x15, 0x20,
- 0x09, 0x20, 0x20, 0x20,
- 0x09, 0x09, 0x20, 0x20,
- 0x09, 0x09, 0x09, 0x20,
- 0x09, 0x16, 0x1D, 0x23,
- 0x09, 0x0F, 0x1D, 0x23,
- 0x09, 0x0F, 0x16, 0x23,
- 0x09, 0x23, 0x23, 0x23,
- 0x09, 0x09, 0x23, 0x23,
- 0x09, 0x09, 0x09, 0x23,
- 0x09, 0x17, 0x1F, 0x26,
- 0x09, 0x10, 0x1F, 0x26,
- 0x09, 0x10, 0x18, 0x26,
- 0x09, 0x26, 0x26, 0x26,
- 0x09, 0x09, 0x26, 0x26,
- 0x09, 0x09, 0x09, 0x26,
- 0x09, 0x19, 0x21, 0x29,
- 0x09, 0x11, 0x21, 0x29,
- 0x09, 0x11, 0x19, 0x29,
- 0x09, 0x29, 0x29, 0x29,
- 0x09, 0x09, 0x29, 0x29,
- 0x09, 0x09, 0x09, 0x29,
- 0x09, 0x2C, 0x2C, 0x2C,
- 0x09, 0x09, 0x2C, 0x2C,
- 0x09, 0x09, 0x09, 0x2C,
- 0x09, 0x1B, 0x24, 0x2D,
- 0x09, 0x12, 0x24, 0x2D,
- 0x09, 0x12, 0x1B, 0x2D,
- 0x09, 0x31, 0x31, 0x31,
- 0x09, 0x09, 0x31, 0x31,
- 0x09, 0x09, 0x09, 0x31,
- 0x09, 0x37, 0x37, 0x37,
- 0x09, 0x09, 0x37, 0x37,
- 0x09, 0x09, 0x09, 0x37,
- 0x0A, 0x0B, 0x0B, 0x0C,
- 0x0A, 0x0B, 0x0C, 0x0D,
- 0x0A, 0x0C, 0x0D, 0x0E,
- 0x0A, 0x0B, 0x0D, 0x0E,
- 0x0A, 0x0B, 0x0C, 0x0E,
- 0x0A, 0x0C, 0x0D, 0x0F,
- 0x0A, 0x0C, 0x0E, 0x0F,
- 0x0A, 0x0B, 0x0E, 0x0F,
- 0x0A, 0x0B, 0x0D, 0x0F,
- 0x0A, 0x0C, 0x0E, 0x10,
- 0x0A, 0x0D, 0x0F, 0x10,
- 0x0A, 0x0B, 0x0F, 0x10,
- 0x0A, 0x0B, 0x0D, 0x10,
- 0x0A, 0x10, 0x10, 0x10,
- 0x0A, 0x0A, 0x10, 0x10,
- 0x0A, 0x0A, 0x0A, 0x10,
- 0x0A, 0x0D, 0x0E, 0x11,
- 0x0A, 0x0D, 0x10, 0x11,
- 0x0A, 0x0B, 0x10, 0x11,
- 0x0A, 0x0B, 0x0E, 0x11,
- 0x0A, 0x0D, 0x0F, 0x12,
- 0x0A, 0x0E, 0x10, 0x12,
- 0x0A, 0x0C, 0x10, 0x12,
- 0x0A, 0x0C, 0x0E, 0x12,
- 0x0A, 0x12, 0x12, 0x12,
- 0x0A, 0x0A, 0x12, 0x12,
- 0x0A, 0x0A, 0x0A, 0x12,
- 0x0A, 0x0E, 0x11, 0x15,
- 0x0A, 0x0F, 0x13, 0x15,
- 0x0A, 0x0C, 0x13, 0x15,
- 0x0A, 0x0C, 0x10, 0x15,
- 0x0A, 0x15, 0x15, 0x15,
- 0x0A, 0x0A, 0x15, 0x15,
- 0x0A, 0x0A, 0x0A, 0x15,
- 0x0A, 0x0F, 0x13, 0x18,
- 0x0A, 0x11, 0x15, 0x18,
- 0x0A, 0x0D, 0x15, 0x18,
- 0x0A, 0x0D, 0x11, 0x18,
- 0x0A, 0x18, 0x18, 0x18,
- 0x0A, 0x0A, 0x18, 0x18,
- 0x0A, 0x0A, 0x0A, 0x18,
- 0x0A, 0x10, 0x15, 0x1B,
- 0x0A, 0x12, 0x17, 0x1B,
- 0x0A, 0x0E, 0x17, 0x1B,
- 0x0A, 0x0E, 0x13, 0x1B,
- 0x0A, 0x1B, 0x1B, 0x1B,
- 0x0A, 0x0A, 0x1B, 0x1B,
- 0x0A, 0x0A, 0x0A, 0x1B,
- 0x0A, 0x11, 0x17, 0x1E,
- 0x0A, 0x14, 0x19, 0x1E,
- 0x0A, 0x0F, 0x19, 0x1E,
- 0x0A, 0x0F, 0x14, 0x1E,
- 0x0A, 0x1E, 0x1E, 0x1E,
- 0x0A, 0x0A, 0x1E, 0x1E,
- 0x0A, 0x0A, 0x0A, 0x1E,
- 0x0A, 0x15, 0x1C, 0x21,
- 0x0A, 0x0F, 0x1C, 0x21,
- 0x0A, 0x0F, 0x16, 0x21,
- 0x0A, 0x21, 0x21, 0x21,
- 0x0A, 0x0A, 0x21, 0x21,
- 0x0A, 0x0A, 0x0A, 0x21,
- 0x0A, 0x17, 0x1E, 0x24,
- 0x0A, 0x10, 0x1E, 0x24,
- 0x0A, 0x10, 0x17, 0x24,
- 0x0A, 0x24, 0x24, 0x24,
- 0x0A, 0x0A, 0x24, 0x24,
- 0x0A, 0x0A, 0x0A, 0x24,
- 0x0A, 0x18, 0x20, 0x27,
- 0x0A, 0x11, 0x20, 0x27,
- 0x0A, 0x11, 0x19, 0x27,
- 0x0A, 0x27, 0x27, 0x27,
- 0x0A, 0x0A, 0x27, 0x27,
- 0x0A, 0x0A, 0x0A, 0x27,
- 0x0A, 0x1A, 0x22, 0x2A,
- 0x0A, 0x12, 0x22, 0x2A,
- 0x0A, 0x12, 0x1A, 0x2A,
- 0x0A, 0x2A, 0x2A, 0x2A,
- 0x0A, 0x0A, 0x2A, 0x2A,
- 0x0A, 0x0A, 0x0A, 0x2A,
- 0x0A, 0x2D, 0x2D, 0x2D,
- 0x0A, 0x0A, 0x2D, 0x2D,
- 0x0A, 0x0A, 0x0A, 0x2D,
- 0x0A, 0x1C, 0x25, 0x2E,
- 0x0A, 0x13, 0x25, 0x2E,
- 0x0A, 0x13, 0x1C, 0x2E,
- 0x0A, 0x32, 0x32, 0x32,
- 0x0A, 0x0A, 0x32, 0x32,
- 0x0A, 0x0A, 0x0A, 0x32,
- 0x0A, 0x38, 0x38, 0x38,
- 0x0A, 0x0A, 0x38, 0x38,
- 0x0A, 0x0A, 0x0A, 0x38,
- 0x0B, 0x0C, 0x0C, 0x0D,
- 0x0B, 0x0C, 0x0D, 0x0E,
- 0x0B, 0x0D, 0x0E, 0x0F,
- 0x0B, 0x0C, 0x0E, 0x0F,
- 0x0B, 0x0C, 0x0D, 0x0F,
- 0x0B, 0x0D, 0x0E, 0x10,
- 0x0B, 0x0D, 0x0F, 0x10,
- 0x0B, 0x0C, 0x0F, 0x10,
- 0x0B, 0x0C, 0x0E, 0x10,
- 0x0B, 0x0D, 0x0F, 0x11,
- 0x0B, 0x0E, 0x10, 0x11,
- 0x0B, 0x0C, 0x10, 0x11,
- 0x0B, 0x0C, 0x0E, 0x11,
- 0x0B, 0x11, 0x11, 0x11,
- 0x0B, 0x0B, 0x11, 0x11,
- 0x0B, 0x0B, 0x0B, 0x11,
- 0x0B, 0x0E, 0x0F, 0x12,
- 0x0B, 0x0E, 0x11, 0x12,
- 0x0B, 0x0C, 0x11, 0x12,
- 0x0B, 0x0C, 0x0F, 0x12,
- 0x0B, 0x0E, 0x10, 0x13,
- 0x0B, 0x0F, 0x11, 0x13,
- 0x0B, 0x0D, 0x11, 0x13,
- 0x0B, 0x0D, 0x0F, 0x13,
- 0x0B, 0x13, 0x13, 0x13,
- 0x0B, 0x0B, 0x13, 0x13,
- 0x0B, 0x0B, 0x0B, 0x13,
- 0x0B, 0x0F, 0x12, 0x16,
- 0x0B, 0x10, 0x14, 0x16,
- 0x0B, 0x0D, 0x14, 0x16,
- 0x0B, 0x0D, 0x11, 0x16,
- 0x0B, 0x16, 0x16, 0x16,
- 0x0B, 0x0B, 0x16, 0x16,
- 0x0B, 0x0B, 0x0B, 0x16,
- 0x0B, 0x10, 0x14, 0x19,
- 0x0B, 0x12, 0x16, 0x19,
- 0x0B, 0x0E, 0x16, 0x19,
- 0x0B, 0x0E, 0x12, 0x19,
- 0x0B, 0x19, 0x19, 0x19,
- 0x0B, 0x0B, 0x19, 0x19,
- 0x0B, 0x0B, 0x0B, 0x19,
- 0x0B, 0x11, 0x16, 0x1C,
- 0x0B, 0x13, 0x18, 0x1C,
- 0x0B, 0x0F, 0x18, 0x1C,
- 0x0B, 0x0F, 0x14, 0x1C,
- 0x0B, 0x1C, 0x1C, 0x1C,
- 0x0B, 0x0B, 0x1C, 0x1C,
- 0x0B, 0x0B, 0x0B, 0x1C,
- 0x0B, 0x12, 0x18, 0x1F,
- 0x0B, 0x15, 0x1A, 0x1F,
- 0x0B, 0x10, 0x1A, 0x1F,
- 0x0B, 0x10, 0x15, 0x1F,
- 0x0B, 0x1F, 0x1F, 0x1F,
- 0x0B, 0x0B, 0x1F, 0x1F,
- 0x0B, 0x0B, 0x0B, 0x1F,
- 0x0B, 0x16, 0x1D, 0x22,
- 0x0B, 0x10, 0x1D, 0x22,
- 0x0B, 0x10, 0x17, 0x22,
- 0x0B, 0x22, 0x22, 0x22,
- 0x0B, 0x0B, 0x22, 0x22,
- 0x0B, 0x0B, 0x0B, 0x22,
- 0x0B, 0x18, 0x1F, 0x25,
- 0x0B, 0x11, 0x1F, 0x25,
- 0x0B, 0x11, 0x18, 0x25,
- 0x0B, 0x25, 0x25, 0x25,
- 0x0B, 0x0B, 0x25, 0x25,
- 0x0B, 0x0B, 0x0B, 0x25,
- 0x0B, 0x19, 0x21, 0x28,
- 0x0B, 0x12, 0x21, 0x28,
- 0x0B, 0x12, 0x1A, 0x28,
- 0x0B, 0x28, 0x28, 0x28,
- 0x0B, 0x0B, 0x28, 0x28,
- 0x0B, 0x0B, 0x0B, 0x28,
- 0x0B, 0x1B, 0x23, 0x2B,
- 0x0B, 0x13, 0x23, 0x2B,
- 0x0B, 0x13, 0x1B, 0x2B,
- 0x0B, 0x2B, 0x2B, 0x2B,
- 0x0B, 0x0B, 0x2B, 0x2B,
- 0x0B, 0x0B, 0x0B, 0x2B,
- 0x0B, 0x2E, 0x2E, 0x2E,
- 0x0B, 0x0B, 0x2E, 0x2E,
- 0x0B, 0x0B, 0x0B, 0x2E,
- 0x0B, 0x1D, 0x26, 0x2F,
- 0x0B, 0x14, 0x26, 0x2F,
- 0x0B, 0x14, 0x1D, 0x2F,
- 0x0B, 0x33, 0x33, 0x33,
- 0x0B, 0x0B, 0x33, 0x33,
- 0x0B, 0x0B, 0x0B, 0x33,
- 0x0B, 0x39, 0x39, 0x39,
- 0x0B, 0x0B, 0x39, 0x39,
- 0x0B, 0x0B, 0x0B, 0x39,
- 0x0C, 0x0D, 0x0D, 0x0E,
- 0x0C, 0x0D, 0x0E, 0x0F,
- 0x0C, 0x0E, 0x0F, 0x10,
- 0x0C, 0x0D, 0x0F, 0x10,
- 0x0C, 0x0D, 0x0E, 0x10,
- 0x0C, 0x0E, 0x0F, 0x11,
- 0x0C, 0x0E, 0x10, 0x11,
- 0x0C, 0x0D, 0x10, 0x11,
- 0x0C, 0x0D, 0x0F, 0x11,
- 0x0C, 0x0E, 0x10, 0x12,
- 0x0C, 0x0F, 0x11, 0x12,
- 0x0C, 0x0D, 0x11, 0x12,
- 0x0C, 0x0D, 0x0F, 0x12,
- 0x0C, 0x12, 0x12, 0x12,
- 0x0C, 0x0C, 0x12, 0x12,
- 0x0C, 0x0C, 0x0C, 0x12,
- 0x0C, 0x0F, 0x10, 0x13,
- 0x0C, 0x0F, 0x12, 0x13,
- 0x0C, 0x0D, 0x12, 0x13,
- 0x0C, 0x0D, 0x10, 0x13,
- 0x0C, 0x0F, 0x11, 0x14,
- 0x0C, 0x10, 0x12, 0x14,
- 0x0C, 0x0E, 0x12, 0x14,
- 0x0C, 0x0E, 0x10, 0x14,
- 0x0C, 0x14, 0x14, 0x14,
- 0x0C, 0x0C, 0x14, 0x14,
- 0x0C, 0x0C, 0x0C, 0x14,
- 0x0C, 0x10, 0x13, 0x17,
- 0x0C, 0x11, 0x15, 0x17,
- 0x0C, 0x0E, 0x15, 0x17,
- 0x0C, 0x0E, 0x12, 0x17,
- 0x0C, 0x17, 0x17, 0x17,
- 0x0C, 0x0C, 0x17, 0x17,
- 0x0C, 0x0C, 0x0C, 0x17,
- 0x0C, 0x11, 0x15, 0x1A,
- 0x0C, 0x13, 0x17, 0x1A,
- 0x0C, 0x0F, 0x17, 0x1A,
- 0x0C, 0x0F, 0x13, 0x1A,
- 0x0C, 0x1A, 0x1A, 0x1A,
- 0x0C, 0x0C, 0x1A, 0x1A,
- 0x0C, 0x0C, 0x0C, 0x1A,
- 0x0C, 0x12, 0x17, 0x1D,
- 0x0C, 0x14, 0x19, 0x1D,
- 0x0C, 0x10, 0x19, 0x1D,
- 0x0C, 0x10, 0x15, 0x1D,
- 0x0C, 0x1D, 0x1D, 0x1D,
- 0x0C, 0x0C, 0x1D, 0x1D,
- 0x0C, 0x0C, 0x0C, 0x1D,
- 0x0C, 0x13, 0x19, 0x20,
- 0x0C, 0x16, 0x1B, 0x20,
- 0x0C, 0x11, 0x1B, 0x20,
- 0x0C, 0x11, 0x16, 0x20,
- 0x0C, 0x20, 0x20, 0x20,
- 0x0C, 0x0C, 0x20, 0x20,
- 0x0C, 0x0C, 0x0C, 0x20,
- 0x0C, 0x17, 0x1E, 0x23,
- 0x0C, 0x11, 0x1E, 0x23,
- 0x0C, 0x11, 0x18, 0x23,
- 0x0C, 0x23, 0x23, 0x23,
- 0x0C, 0x0C, 0x23, 0x23,
- 0x0C, 0x0C, 0x0C, 0x23,
- 0x0C, 0x19, 0x20, 0x26,
- 0x0C, 0x12, 0x20, 0x26,
- 0x0C, 0x12, 0x19, 0x26,
- 0x0C, 0x26, 0x26, 0x26,
- 0x0C, 0x0C, 0x26, 0x26,
- 0x0C, 0x0C, 0x0C, 0x26,
- 0x0C, 0x1A, 0x22, 0x29,
- 0x0C, 0x13, 0x22, 0x29,
- 0x0C, 0x13, 0x1B, 0x29,
- 0x0C, 0x29, 0x29, 0x29,
- 0x0C, 0x0C, 0x29, 0x29,
- 0x0C, 0x0C, 0x0C, 0x29,
- 0x0C, 0x1C, 0x24, 0x2C,
- 0x0C, 0x14, 0x24, 0x2C,
- 0x0C, 0x14, 0x1C, 0x2C,
- 0x0C, 0x2C, 0x2C, 0x2C,
- 0x0C, 0x0C, 0x2C, 0x2C,
- 0x0C, 0x0C, 0x0C, 0x2C,
- 0x0C, 0x2F, 0x2F, 0x2F,
- 0x0C, 0x0C, 0x2F, 0x2F,
- 0x0C, 0x0C, 0x0C, 0x2F,
- 0x0C, 0x1E, 0x27, 0x30,
- 0x0C, 0x15, 0x27, 0x30,
- 0x0C, 0x15, 0x1E, 0x30,
- 0x0C, 0x34, 0x34, 0x34,
- 0x0C, 0x0C, 0x34, 0x34,
- 0x0C, 0x0C, 0x0C, 0x34,
- 0x0C, 0x3A, 0x3A, 0x3A,
- 0x0C, 0x0C, 0x3A, 0x3A,
- 0x0C, 0x0C, 0x0C, 0x3A,
- 0x0D, 0x0E, 0x0E, 0x0F,
- 0x0D, 0x0E, 0x0F, 0x10,
- 0x0D, 0x0F, 0x10, 0x11,
- 0x0D, 0x0E, 0x10, 0x11,
- 0x0D, 0x0E, 0x0F, 0x11,
- 0x0D, 0x0F, 0x10, 0x12,
- 0x0D, 0x0F, 0x11, 0x12,
- 0x0D, 0x0E, 0x11, 0x12,
- 0x0D, 0x0E, 0x10, 0x12,
- 0x0D, 0x0F, 0x11, 0x13,
- 0x0D, 0x10, 0x12, 0x13,
- 0x0D, 0x0E, 0x12, 0x13,
- 0x0D, 0x0E, 0x10, 0x13,
- 0x0D, 0x13, 0x13, 0x13,
- 0x0D, 0x0D, 0x13, 0x13,
- 0x0D, 0x0D, 0x0D, 0x13,
- 0x0D, 0x10, 0x11, 0x14,
- 0x0D, 0x10, 0x13, 0x14,
- 0x0D, 0x0E, 0x13, 0x14,
- 0x0D, 0x0E, 0x11, 0x14,
- 0x0D, 0x10, 0x12, 0x15,
- 0x0D, 0x11, 0x13, 0x15,
- 0x0D, 0x0F, 0x13, 0x15,
- 0x0D, 0x0F, 0x11, 0x15,
- 0x0D, 0x15, 0x15, 0x15,
- 0x0D, 0x0D, 0x15, 0x15,
- 0x0D, 0x0D, 0x0D, 0x15,
- 0x0D, 0x11, 0x14, 0x18,
- 0x0D, 0x12, 0x16, 0x18,
- 0x0D, 0x0F, 0x16, 0x18,
- 0x0D, 0x0F, 0x13, 0x18,
- 0x0D, 0x18, 0x18, 0x18,
- 0x0D, 0x0D, 0x18, 0x18,
- 0x0D, 0x0D, 0x0D, 0x18,
- 0x0D, 0x12, 0x16, 0x1B,
- 0x0D, 0x14, 0x18, 0x1B,
- 0x0D, 0x10, 0x18, 0x1B,
- 0x0D, 0x10, 0x14, 0x1B,
- 0x0D, 0x1B, 0x1B, 0x1B,
- 0x0D, 0x0D, 0x1B, 0x1B,
- 0x0D, 0x0D, 0x0D, 0x1B,
- 0x0D, 0x13, 0x18, 0x1E,
- 0x0D, 0x15, 0x1A, 0x1E,
- 0x0D, 0x11, 0x1A, 0x1E,
- 0x0D, 0x11, 0x16, 0x1E,
- 0x0D, 0x1E, 0x1E, 0x1E,
- 0x0D, 0x0D, 0x1E, 0x1E,
- 0x0D, 0x0D, 0x0D, 0x1E,
- 0x0D, 0x14, 0x1A, 0x21,
- 0x0D, 0x17, 0x1C, 0x21,
- 0x0D, 0x12, 0x1C, 0x21,
- 0x0D, 0x12, 0x17, 0x21,
- 0x0D, 0x21, 0x21, 0x21,
- 0x0D, 0x0D, 0x21, 0x21,
- 0x0D, 0x0D, 0x0D, 0x21,
- 0x0D, 0x18, 0x1F, 0x24,
- 0x0D, 0x12, 0x1F, 0x24,
- 0x0D, 0x12, 0x19, 0x24,
- 0x0D, 0x24, 0x24, 0x24,
- 0x0D, 0x0D, 0x24, 0x24,
- 0x0D, 0x0D, 0x0D, 0x24,
- 0x0D, 0x1A, 0x21, 0x27,
- 0x0D, 0x13, 0x21, 0x27,
- 0x0D, 0x13, 0x1A, 0x27,
- 0x0D, 0x27, 0x27, 0x27,
- 0x0D, 0x0D, 0x27, 0x27,
- 0x0D, 0x0D, 0x0D, 0x27,
- 0x0D, 0x1B, 0x23, 0x2A,
- 0x0D, 0x14, 0x23, 0x2A,
- 0x0D, 0x14, 0x1C, 0x2A,
- 0x0D, 0x2A, 0x2A, 0x2A,
- 0x0D, 0x0D, 0x2A, 0x2A,
- 0x0D, 0x0D, 0x0D, 0x2A,
- 0x0D, 0x1D, 0x25, 0x2D,
- 0x0D, 0x15, 0x25, 0x2D,
- 0x0D, 0x15, 0x1D, 0x2D,
- 0x0D, 0x2D, 0x2D, 0x2D,
- 0x0D, 0x0D, 0x2D, 0x2D,
- 0x0D, 0x0D, 0x0D, 0x2D,
- 0x0D, 0x30, 0x30, 0x30,
- 0x0D, 0x0D, 0x30, 0x30,
- 0x0D, 0x0D, 0x0D, 0x30,
- 0x0D, 0x1F, 0x28, 0x31,
- 0x0D, 0x16, 0x28, 0x31,
- 0x0D, 0x16, 0x1F, 0x31,
- 0x0D, 0x35, 0x35, 0x35,
- 0x0D, 0x0D, 0x35, 0x35,
- 0x0D, 0x0D, 0x0D, 0x35,
- 0x0D, 0x3B, 0x3B, 0x3B,
- 0x0D, 0x0D, 0x3B, 0x3B,
- 0x0D, 0x0D, 0x0D, 0x3B,
- 0x0E, 0x0F, 0x0F, 0x10,
- 0x0E, 0x0F, 0x10, 0x11,
- 0x0E, 0x10, 0x11, 0x12,
- 0x0E, 0x0F, 0x11, 0x12,
- 0x0E, 0x0F, 0x10, 0x12,
- 0x0E, 0x10, 0x11, 0x13,
- 0x0E, 0x10, 0x12, 0x13,
- 0x0E, 0x0F, 0x12, 0x13,
- 0x0E, 0x0F, 0x11, 0x13,
- 0x0E, 0x10, 0x12, 0x14,
- 0x0E, 0x11, 0x13, 0x14,
- 0x0E, 0x0F, 0x13, 0x14,
- 0x0E, 0x0F, 0x11, 0x14,
- 0x0E, 0x14, 0x14, 0x14,
- 0x0E, 0x0E, 0x14, 0x14,
- 0x0E, 0x0E, 0x0E, 0x14,
- 0x0E, 0x11, 0x12, 0x15,
- 0x0E, 0x11, 0x14, 0x15,
- 0x0E, 0x0F, 0x14, 0x15,
- 0x0E, 0x0F, 0x12, 0x15,
- 0x0E, 0x11, 0x13, 0x16,
- 0x0E, 0x12, 0x14, 0x16,
- 0x0E, 0x10, 0x14, 0x16,
- 0x0E, 0x10, 0x12, 0x16,
- 0x0E, 0x16, 0x16, 0x16,
- 0x0E, 0x0E, 0x16, 0x16,
- 0x0E, 0x0E, 0x0E, 0x16,
- 0x0E, 0x12, 0x15, 0x19,
- 0x0E, 0x13, 0x17, 0x19,
- 0x0E, 0x10, 0x17, 0x19,
- 0x0E, 0x10, 0x14, 0x19,
- 0x0E, 0x19, 0x19, 0x19,
- 0x0E, 0x0E, 0x19, 0x19,
- 0x0E, 0x0E, 0x0E, 0x19,
- 0x0E, 0x13, 0x17, 0x1C,
- 0x0E, 0x15, 0x19, 0x1C,
- 0x0E, 0x11, 0x19, 0x1C,
- 0x0E, 0x11, 0x15, 0x1C,
- 0x0E, 0x1C, 0x1C, 0x1C,
- 0x0E, 0x0E, 0x1C, 0x1C,
- 0x0E, 0x0E, 0x0E, 0x1C,
- 0x0E, 0x14, 0x19, 0x1F,
- 0x0E, 0x16, 0x1B, 0x1F,
- 0x0E, 0x12, 0x1B, 0x1F,
- 0x0E, 0x12, 0x17, 0x1F,
- 0x0E, 0x1F, 0x1F, 0x1F,
- 0x0E, 0x0E, 0x1F, 0x1F,
- 0x0E, 0x0E, 0x0E, 0x1F,
- 0x0E, 0x15, 0x1B, 0x22,
- 0x0E, 0x18, 0x1D, 0x22,
- 0x0E, 0x13, 0x1D, 0x22,
- 0x0E, 0x13, 0x18, 0x22,
- 0x0E, 0x22, 0x22, 0x22,
- 0x0E, 0x0E, 0x22, 0x22,
- 0x0E, 0x0E, 0x0E, 0x22,
- 0x0E, 0x19, 0x20, 0x25,
- 0x0E, 0x13, 0x20, 0x25,
- 0x0E, 0x13, 0x1A, 0x25,
- 0x0E, 0x25, 0x25, 0x25,
- 0x0E, 0x0E, 0x25, 0x25,
- 0x0E, 0x0E, 0x0E, 0x25,
- 0x0E, 0x1B, 0x22, 0x28,
- 0x0E, 0x14, 0x22, 0x28,
- 0x0E, 0x14, 0x1B, 0x28,
- 0x0E, 0x28, 0x28, 0x28,
- 0x0E, 0x0E, 0x28, 0x28,
- 0x0E, 0x0E, 0x0E, 0x28,
- 0x0E, 0x1C, 0x24, 0x2B,
- 0x0E, 0x15, 0x24, 0x2B,
- 0x0E, 0x15, 0x1D, 0x2B,
- 0x0E, 0x2B, 0x2B, 0x2B,
- 0x0E, 0x0E, 0x2B, 0x2B,
- 0x0E, 0x0E, 0x0E, 0x2B,
- 0x0E, 0x1E, 0x26, 0x2E,
- 0x0E, 0x16, 0x26, 0x2E,
- 0x0E, 0x16, 0x1E, 0x2E,
- 0x0E, 0x2E, 0x2E, 0x2E,
- 0x0E, 0x0E, 0x2E, 0x2E,
- 0x0E, 0x0E, 0x0E, 0x2E,
- 0x0E, 0x31, 0x31, 0x31,
- 0x0E, 0x0E, 0x31, 0x31,
- 0x0E, 0x0E, 0x0E, 0x31,
- 0x0E, 0x20, 0x29, 0x32,
- 0x0E, 0x17, 0x29, 0x32,
- 0x0E, 0x17, 0x20, 0x32,
- 0x0E, 0x36, 0x36, 0x36,
- 0x0E, 0x0E, 0x36, 0x36,
- 0x0E, 0x0E, 0x0E, 0x36,
- 0x0E, 0x3C, 0x3C, 0x3C,
- 0x0E, 0x0E, 0x3C, 0x3C,
- 0x0E, 0x0E, 0x0E, 0x3C,
- 0x0F, 0x10, 0x10, 0x11,
- 0x0F, 0x10, 0x11, 0x12,
- 0x0F, 0x11, 0x12, 0x13,
- 0x0F, 0x10, 0x12, 0x13,
- 0x0F, 0x10, 0x11, 0x13,
- 0x0F, 0x11, 0x12, 0x14,
- 0x0F, 0x11, 0x13, 0x14,
- 0x0F, 0x10, 0x13, 0x14,
- 0x0F, 0x10, 0x12, 0x14,
- 0x0F, 0x11, 0x13, 0x15,
- 0x0F, 0x12, 0x14, 0x15,
- 0x0F, 0x10, 0x14, 0x15,
- 0x0F, 0x10, 0x12, 0x15,
- 0x0F, 0x15, 0x15, 0x15,
- 0x0F, 0x0F, 0x15, 0x15,
- 0x0F, 0x0F, 0x0F, 0x15,
- 0x0F, 0x12, 0x13, 0x16,
- 0x0F, 0x12, 0x15, 0x16,
- 0x0F, 0x10, 0x15, 0x16,
- 0x0F, 0x10, 0x13, 0x16,
- 0x0F, 0x12, 0x14, 0x17,
- 0x0F, 0x13, 0x15, 0x17,
- 0x0F, 0x11, 0x15, 0x17,
- 0x0F, 0x11, 0x13, 0x17,
- 0x0F, 0x17, 0x17, 0x17,
- 0x0F, 0x0F, 0x17, 0x17,
- 0x0F, 0x0F, 0x0F, 0x17,
- 0x0F, 0x13, 0x16, 0x1A,
- 0x0F, 0x14, 0x18, 0x1A,
- 0x0F, 0x11, 0x18, 0x1A,
- 0x0F, 0x11, 0x15, 0x1A,
- 0x0F, 0x1A, 0x1A, 0x1A,
- 0x0F, 0x0F, 0x1A, 0x1A,
- 0x0F, 0x0F, 0x0F, 0x1A,
- 0x0F, 0x14, 0x18, 0x1D,
- 0x0F, 0x16, 0x1A, 0x1D,
- 0x0F, 0x12, 0x1A, 0x1D,
- 0x0F, 0x12, 0x16, 0x1D,
- 0x0F, 0x1D, 0x1D, 0x1D,
- 0x0F, 0x0F, 0x1D, 0x1D,
- 0x0F, 0x0F, 0x0F, 0x1D,
- 0x0F, 0x15, 0x1A, 0x20,
- 0x0F, 0x17, 0x1C, 0x20,
- 0x0F, 0x13, 0x1C, 0x20,
- 0x0F, 0x13, 0x18, 0x20,
- 0x0F, 0x20, 0x20, 0x20,
- 0x0F, 0x0F, 0x20, 0x20,
- 0x0F, 0x0F, 0x0F, 0x20,
- 0x0F, 0x16, 0x1C, 0x23,
- 0x0F, 0x19, 0x1E, 0x23,
- 0x0F, 0x14, 0x1E, 0x23,
- 0x0F, 0x14, 0x19, 0x23,
- 0x0F, 0x23, 0x23, 0x23,
- 0x0F, 0x0F, 0x23, 0x23,
- 0x0F, 0x0F, 0x0F, 0x23,
- 0x0F, 0x1A, 0x21, 0x26,
- 0x0F, 0x14, 0x21, 0x26,
- 0x0F, 0x14, 0x1B, 0x26,
- 0x0F, 0x26, 0x26, 0x26,
- 0x0F, 0x0F, 0x26, 0x26,
- 0x0F, 0x0F, 0x0F, 0x26,
- 0x0F, 0x1C, 0x23, 0x29,
- 0x0F, 0x15, 0x23, 0x29,
- 0x0F, 0x15, 0x1C, 0x29,
- 0x0F, 0x29, 0x29, 0x29,
- 0x0F, 0x0F, 0x29, 0x29,
- 0x0F, 0x0F, 0x0F, 0x29,
- 0x0F, 0x1D, 0x25, 0x2C,
- 0x0F, 0x16, 0x25, 0x2C,
- 0x0F, 0x16, 0x1E, 0x2C,
- 0x0F, 0x2C, 0x2C, 0x2C,
- 0x0F, 0x0F, 0x2C, 0x2C,
- 0x0F, 0x0F, 0x0F, 0x2C,
- 0x0F, 0x1F, 0x27, 0x2F,
- 0x0F, 0x17, 0x27, 0x2F,
- 0x0F, 0x17, 0x1F, 0x2F,
- 0x0F, 0x2F, 0x2F, 0x2F,
- 0x0F, 0x0F, 0x2F, 0x2F,
- 0x0F, 0x0F, 0x0F, 0x2F,
- 0x0F, 0x32, 0x32, 0x32,
- 0x0F, 0x0F, 0x32, 0x32,
- 0x0F, 0x0F, 0x0F, 0x32,
- 0x0F, 0x21, 0x2A, 0x33,
- 0x0F, 0x18, 0x2A, 0x33,
- 0x0F, 0x18, 0x21, 0x33,
- 0x0F, 0x37, 0x37, 0x37,
- 0x0F, 0x0F, 0x37, 0x37,
- 0x0F, 0x0F, 0x0F, 0x37,
- 0x0F, 0x3D, 0x3D, 0x3D,
- 0x0F, 0x0F, 0x3D, 0x3D,
- 0x0F, 0x0F, 0x0F, 0x3D,
- 0x10, 0x11, 0x11, 0x12,
- 0x10, 0x11, 0x12, 0x13,
- 0x10, 0x12, 0x13, 0x14,
- 0x10, 0x11, 0x13, 0x14,
- 0x10, 0x11, 0x12, 0x14,
- 0x10, 0x12, 0x13, 0x15,
- 0x10, 0x12, 0x14, 0x15,
- 0x10, 0x11, 0x14, 0x15,
- 0x10, 0x11, 0x13, 0x15,
- 0x10, 0x12, 0x14, 0x16,
- 0x10, 0x13, 0x15, 0x16,
- 0x10, 0x11, 0x15, 0x16,
- 0x10, 0x11, 0x13, 0x16,
- 0x10, 0x16, 0x16, 0x16,
- 0x10, 0x10, 0x16, 0x16,
- 0x10, 0x10, 0x10, 0x16,
- 0x10, 0x13, 0x14, 0x17,
- 0x10, 0x13, 0x16, 0x17,
- 0x10, 0x11, 0x16, 0x17,
- 0x10, 0x11, 0x14, 0x17,
- 0x10, 0x13, 0x15, 0x18,
- 0x10, 0x14, 0x16, 0x18,
- 0x10, 0x12, 0x16, 0x18,
- 0x10, 0x12, 0x14, 0x18,
- 0x10, 0x18, 0x18, 0x18,
- 0x10, 0x10, 0x18, 0x18,
- 0x10, 0x10, 0x10, 0x18,
- 0x10, 0x14, 0x17, 0x1B,
- 0x10, 0x15, 0x19, 0x1B,
- 0x10, 0x12, 0x19, 0x1B,
- 0x10, 0x12, 0x16, 0x1B,
- 0x10, 0x1B, 0x1B, 0x1B,
- 0x10, 0x10, 0x1B, 0x1B,
- 0x10, 0x10, 0x10, 0x1B,
- 0x10, 0x15, 0x19, 0x1E,
- 0x10, 0x17, 0x1B, 0x1E,
- 0x10, 0x13, 0x1B, 0x1E,
- 0x10, 0x13, 0x17, 0x1E,
- 0x10, 0x1E, 0x1E, 0x1E,
- 0x10, 0x10, 0x1E, 0x1E,
- 0x10, 0x10, 0x10, 0x1E,
- 0x10, 0x16, 0x1B, 0x21,
- 0x10, 0x18, 0x1D, 0x21,
- 0x10, 0x14, 0x1D, 0x21,
- 0x10, 0x14, 0x19, 0x21,
- 0x10, 0x21, 0x21, 0x21,
- 0x10, 0x10, 0x21, 0x21,
- 0x10, 0x10, 0x10, 0x21,
- 0x10, 0x17, 0x1D, 0x24,
- 0x10, 0x1A, 0x1F, 0x24,
- 0x10, 0x15, 0x1F, 0x24,
- 0x10, 0x15, 0x1A, 0x24,
- 0x10, 0x24, 0x24, 0x24,
- 0x10, 0x10, 0x24, 0x24,
- 0x10, 0x10, 0x10, 0x24,
- 0x10, 0x1B, 0x22, 0x27,
- 0x10, 0x15, 0x22, 0x27,
- 0x10, 0x15, 0x1C, 0x27,
- 0x10, 0x27, 0x27, 0x27,
- 0x10, 0x10, 0x27, 0x27,
- 0x10, 0x10, 0x10, 0x27,
- 0x10, 0x1D, 0x24, 0x2A,
- 0x10, 0x16, 0x24, 0x2A,
- 0x10, 0x16, 0x1D, 0x2A,
- 0x10, 0x2A, 0x2A, 0x2A,
- 0x10, 0x10, 0x2A, 0x2A,
- 0x10, 0x10, 0x10, 0x2A,
- 0x10, 0x1E, 0x26, 0x2D,
- 0x10, 0x17, 0x26, 0x2D,
- 0x10, 0x17, 0x1F, 0x2D,
- 0x10, 0x2D, 0x2D, 0x2D,
- 0x10, 0x10, 0x2D, 0x2D,
- 0x10, 0x10, 0x10, 0x2D,
- 0x10, 0x20, 0x28, 0x30,
- 0x10, 0x18, 0x28, 0x30,
- 0x10, 0x18, 0x20, 0x30,
- 0x10, 0x30, 0x30, 0x30,
- 0x10, 0x10, 0x30, 0x30,
- 0x10, 0x10, 0x10, 0x30,
- 0x10, 0x33, 0x33, 0x33,
- 0x10, 0x10, 0x33, 0x33,
- 0x10, 0x10, 0x10, 0x33,
- 0x10, 0x22, 0x2B, 0x34,
- 0x10, 0x19, 0x2B, 0x34,
- 0x10, 0x19, 0x22, 0x34,
- 0x10, 0x38, 0x38, 0x38,
- 0x10, 0x10, 0x38, 0x38,
- 0x10, 0x10, 0x10, 0x38,
- 0x10, 0x3E, 0x3E, 0x3E,
- 0x10, 0x10, 0x3E, 0x3E,
- 0x10, 0x10, 0x10, 0x3E,
- 0x11, 0x12, 0x12, 0x13,
- 0x11, 0x12, 0x13, 0x14,
- 0x11, 0x13, 0x14, 0x15,
- 0x11, 0x12, 0x14, 0x15,
- 0x11, 0x12, 0x13, 0x15,
- 0x11, 0x13, 0x14, 0x16,
- 0x11, 0x13, 0x15, 0x16,
- 0x11, 0x12, 0x15, 0x16,
- 0x11, 0x12, 0x14, 0x16,
- 0x11, 0x13, 0x15, 0x17,
- 0x11, 0x14, 0x16, 0x17,
- 0x11, 0x12, 0x16, 0x17,
- 0x11, 0x12, 0x14, 0x17,
- 0x11, 0x17, 0x17, 0x17,
- 0x11, 0x11, 0x17, 0x17,
- 0x11, 0x11, 0x11, 0x17,
- 0x11, 0x14, 0x15, 0x18,
- 0x11, 0x14, 0x17, 0x18,
- 0x11, 0x12, 0x17, 0x18,
- 0x11, 0x12, 0x15, 0x18,
- 0x11, 0x14, 0x16, 0x19,
- 0x11, 0x15, 0x17, 0x19,
- 0x11, 0x13, 0x17, 0x19,
- 0x11, 0x13, 0x15, 0x19,
- 0x11, 0x19, 0x19, 0x19,
- 0x11, 0x11, 0x19, 0x19,
- 0x11, 0x11, 0x11, 0x19,
- 0x11, 0x15, 0x18, 0x1C,
- 0x11, 0x16, 0x1A, 0x1C,
- 0x11, 0x13, 0x1A, 0x1C,
- 0x11, 0x13, 0x17, 0x1C,
- 0x11, 0x1C, 0x1C, 0x1C,
- 0x11, 0x11, 0x1C, 0x1C,
- 0x11, 0x11, 0x11, 0x1C,
- 0x11, 0x16, 0x1A, 0x1F,
- 0x11, 0x18, 0x1C, 0x1F,
- 0x11, 0x14, 0x1C, 0x1F,
- 0x11, 0x14, 0x18, 0x1F,
- 0x11, 0x1F, 0x1F, 0x1F,
- 0x11, 0x11, 0x1F, 0x1F,
- 0x11, 0x11, 0x11, 0x1F,
- 0x11, 0x17, 0x1C, 0x22,
- 0x11, 0x19, 0x1E, 0x22,
- 0x11, 0x15, 0x1E, 0x22,
- 0x11, 0x15, 0x1A, 0x22,
- 0x11, 0x22, 0x22, 0x22,
- 0x11, 0x11, 0x22, 0x22,
- 0x11, 0x11, 0x11, 0x22,
- 0x11, 0x18, 0x1E, 0x25,
- 0x11, 0x1B, 0x20, 0x25,
- 0x11, 0x16, 0x20, 0x25,
- 0x11, 0x16, 0x1B, 0x25,
- 0x11, 0x25, 0x25, 0x25,
- 0x11, 0x11, 0x25, 0x25,
- 0x11, 0x11, 0x11, 0x25,
- 0x11, 0x1C, 0x23, 0x28,
- 0x11, 0x16, 0x23, 0x28,
- 0x11, 0x16, 0x1D, 0x28,
- 0x11, 0x28, 0x28, 0x28,
- 0x11, 0x11, 0x28, 0x28,
- 0x11, 0x11, 0x11, 0x28,
- 0x11, 0x1E, 0x25, 0x2B,
- 0x11, 0x17, 0x25, 0x2B,
- 0x11, 0x17, 0x1E, 0x2B,
- 0x11, 0x2B, 0x2B, 0x2B,
- 0x11, 0x11, 0x2B, 0x2B,
- 0x11, 0x11, 0x11, 0x2B,
- 0x11, 0x1F, 0x27, 0x2E,
- 0x11, 0x18, 0x27, 0x2E,
- 0x11, 0x18, 0x20, 0x2E,
- 0x11, 0x2E, 0x2E, 0x2E,
- 0x11, 0x11, 0x2E, 0x2E,
- 0x11, 0x11, 0x11, 0x2E,
- 0x11, 0x21, 0x29, 0x31,
- 0x11, 0x19, 0x29, 0x31,
- 0x11, 0x19, 0x21, 0x31,
- 0x11, 0x31, 0x31, 0x31,
- 0x11, 0x11, 0x31, 0x31,
- 0x11, 0x11, 0x11, 0x31,
- 0x11, 0x34, 0x34, 0x34,
- 0x11, 0x11, 0x34, 0x34,
- 0x11, 0x11, 0x11, 0x34,
- 0x11, 0x23, 0x2C, 0x35,
- 0x11, 0x1A, 0x2C, 0x35,
- 0x11, 0x1A, 0x23, 0x35,
- 0x11, 0x39, 0x39, 0x39,
- 0x11, 0x11, 0x39, 0x39,
- 0x11, 0x11, 0x11, 0x39,
- 0x11, 0x3F, 0x3F, 0x3F,
- 0x11, 0x11, 0x3F, 0x3F,
- 0x11, 0x11, 0x11, 0x3F,
- 0x12, 0x13, 0x13, 0x14,
- 0x12, 0x13, 0x14, 0x15,
- 0x12, 0x14, 0x15, 0x16,
- 0x12, 0x13, 0x15, 0x16,
- 0x12, 0x13, 0x14, 0x16,
- 0x12, 0x14, 0x15, 0x17,
- 0x12, 0x14, 0x16, 0x17,
- 0x12, 0x13, 0x16, 0x17,
- 0x12, 0x13, 0x15, 0x17,
- 0x12, 0x14, 0x16, 0x18,
- 0x12, 0x15, 0x17, 0x18,
- 0x12, 0x13, 0x17, 0x18,
- 0x12, 0x13, 0x15, 0x18,
- 0x12, 0x18, 0x18, 0x18,
- 0x12, 0x12, 0x18, 0x18,
- 0x12, 0x12, 0x12, 0x18,
- 0x12, 0x15, 0x16, 0x19,
- 0x12, 0x15, 0x18, 0x19,
- 0x12, 0x13, 0x18, 0x19,
- 0x12, 0x13, 0x16, 0x19,
- 0x12, 0x15, 0x17, 0x1A,
- 0x12, 0x16, 0x18, 0x1A,
- 0x12, 0x14, 0x18, 0x1A,
- 0x12, 0x14, 0x16, 0x1A,
- 0x12, 0x1A, 0x1A, 0x1A,
- 0x12, 0x12, 0x1A, 0x1A,
- 0x12, 0x12, 0x12, 0x1A,
- 0x12, 0x16, 0x19, 0x1D,
- 0x12, 0x17, 0x1B, 0x1D,
- 0x12, 0x14, 0x1B, 0x1D,
- 0x12, 0x14, 0x18, 0x1D,
- 0x12, 0x1D, 0x1D, 0x1D,
- 0x12, 0x12, 0x1D, 0x1D,
- 0x12, 0x12, 0x12, 0x1D,
- 0x12, 0x17, 0x1B, 0x20,
- 0x12, 0x19, 0x1D, 0x20,
- 0x12, 0x15, 0x1D, 0x20,
- 0x12, 0x15, 0x19, 0x20,
- 0x12, 0x20, 0x20, 0x20,
- 0x12, 0x12, 0x20, 0x20,
- 0x12, 0x12, 0x12, 0x20,
- 0x12, 0x18, 0x1D, 0x23,
- 0x12, 0x1A, 0x1F, 0x23,
- 0x12, 0x16, 0x1F, 0x23,
- 0x12, 0x16, 0x1B, 0x23,
- 0x12, 0x23, 0x23, 0x23,
- 0x12, 0x12, 0x23, 0x23,
- 0x12, 0x12, 0x12, 0x23,
- 0x12, 0x19, 0x1F, 0x26,
- 0x12, 0x1C, 0x21, 0x26,
- 0x12, 0x17, 0x21, 0x26,
- 0x12, 0x17, 0x1C, 0x26,
- 0x12, 0x26, 0x26, 0x26,
- 0x12, 0x12, 0x26, 0x26,
- 0x12, 0x12, 0x12, 0x26,
- 0x12, 0x1D, 0x24, 0x29,
- 0x12, 0x17, 0x24, 0x29,
- 0x12, 0x17, 0x1E, 0x29,
- 0x12, 0x29, 0x29, 0x29,
- 0x12, 0x12, 0x29, 0x29,
- 0x12, 0x12, 0x12, 0x29,
- 0x12, 0x1F, 0x26, 0x2C,
- 0x12, 0x18, 0x26, 0x2C,
- 0x12, 0x18, 0x1F, 0x2C,
- 0x12, 0x2C, 0x2C, 0x2C,
- 0x12, 0x12, 0x2C, 0x2C,
- 0x12, 0x12, 0x12, 0x2C,
- 0x12, 0x20, 0x28, 0x2F,
- 0x12, 0x19, 0x28, 0x2F,
- 0x12, 0x19, 0x21, 0x2F,
- 0x12, 0x2F, 0x2F, 0x2F,
- 0x12, 0x12, 0x2F, 0x2F,
- 0x12, 0x12, 0x12, 0x2F,
- 0x12, 0x22, 0x2A, 0x32,
- 0x12, 0x1A, 0x2A, 0x32,
- 0x12, 0x1A, 0x22, 0x32,
- 0x12, 0x32, 0x32, 0x32,
- 0x12, 0x12, 0x32, 0x32,
- 0x12, 0x12, 0x12, 0x32,
- 0x12, 0x35, 0x35, 0x35,
- 0x12, 0x12, 0x35, 0x35,
- 0x12, 0x12, 0x12, 0x35,
- 0x12, 0x24, 0x2D, 0x36,
- 0x12, 0x1B, 0x2D, 0x36,
- 0x12, 0x1B, 0x24, 0x36,
- 0x12, 0x3A, 0x3A, 0x3A,
- 0x12, 0x12, 0x3A, 0x3A,
- 0x12, 0x12, 0x12, 0x3A,
- 0x13, 0x14, 0x14, 0x15,
- 0x13, 0x14, 0x15, 0x16,
- 0x13, 0x15, 0x16, 0x17,
- 0x13, 0x14, 0x16, 0x17,
- 0x13, 0x14, 0x15, 0x17,
- 0x13, 0x15, 0x16, 0x18,
- 0x13, 0x15, 0x17, 0x18,
- 0x13, 0x14, 0x17, 0x18,
- 0x13, 0x14, 0x16, 0x18,
- 0x13, 0x15, 0x17, 0x19,
- 0x13, 0x16, 0x18, 0x19,
- 0x13, 0x14, 0x18, 0x19,
- 0x13, 0x14, 0x16, 0x19,
- 0x13, 0x19, 0x19, 0x19,
- 0x13, 0x13, 0x19, 0x19,
- 0x13, 0x13, 0x13, 0x19,
- 0x13, 0x16, 0x17, 0x1A,
- 0x13, 0x16, 0x19, 0x1A,
- 0x13, 0x14, 0x19, 0x1A,
- 0x13, 0x14, 0x17, 0x1A,
- 0x13, 0x16, 0x18, 0x1B,
- 0x13, 0x17, 0x19, 0x1B,
- 0x13, 0x15, 0x19, 0x1B,
- 0x13, 0x15, 0x17, 0x1B,
- 0x13, 0x1B, 0x1B, 0x1B,
- 0x13, 0x13, 0x1B, 0x1B,
- 0x13, 0x13, 0x13, 0x1B,
- 0x13, 0x17, 0x1A, 0x1E,
- 0x13, 0x18, 0x1C, 0x1E,
- 0x13, 0x15, 0x1C, 0x1E,
- 0x13, 0x15, 0x19, 0x1E,
- 0x13, 0x1E, 0x1E, 0x1E,
- 0x13, 0x13, 0x1E, 0x1E,
- 0x13, 0x13, 0x13, 0x1E,
- 0x13, 0x18, 0x1C, 0x21,
- 0x13, 0x1A, 0x1E, 0x21,
- 0x13, 0x16, 0x1E, 0x21,
- 0x13, 0x16, 0x1A, 0x21,
- 0x13, 0x21, 0x21, 0x21,
- 0x13, 0x13, 0x21, 0x21,
- 0x13, 0x13, 0x13, 0x21,
- 0x13, 0x19, 0x1E, 0x24,
- 0x13, 0x1B, 0x20, 0x24,
- 0x13, 0x17, 0x20, 0x24,
- 0x13, 0x17, 0x1C, 0x24,
- 0x13, 0x24, 0x24, 0x24,
- 0x13, 0x13, 0x24, 0x24,
- 0x13, 0x13, 0x13, 0x24,
- 0x13, 0x1A, 0x20, 0x27,
- 0x13, 0x1D, 0x22, 0x27,
- 0x13, 0x18, 0x22, 0x27,
- 0x13, 0x18, 0x1D, 0x27,
- 0x13, 0x27, 0x27, 0x27,
- 0x13, 0x13, 0x27, 0x27,
- 0x13, 0x13, 0x13, 0x27,
- 0x13, 0x1E, 0x25, 0x2A,
- 0x13, 0x18, 0x25, 0x2A,
- 0x13, 0x18, 0x1F, 0x2A,
- 0x13, 0x2A, 0x2A, 0x2A,
- 0x13, 0x13, 0x2A, 0x2A,
- 0x13, 0x13, 0x13, 0x2A,
- 0x13, 0x20, 0x27, 0x2D,
- 0x13, 0x19, 0x27, 0x2D,
- 0x13, 0x19, 0x20, 0x2D,
- 0x13, 0x2D, 0x2D, 0x2D,
- 0x13, 0x13, 0x2D, 0x2D,
- 0x13, 0x13, 0x13, 0x2D,
- 0x13, 0x21, 0x29, 0x30,
- 0x13, 0x1A, 0x29, 0x30,
- 0x13, 0x1A, 0x22, 0x30,
- 0x13, 0x30, 0x30, 0x30,
- 0x13, 0x13, 0x30, 0x30,
- 0x13, 0x13, 0x13, 0x30,
- 0x13, 0x23, 0x2B, 0x33,
- 0x13, 0x1B, 0x2B, 0x33,
- 0x13, 0x1B, 0x23, 0x33,
- 0x13, 0x33, 0x33, 0x33,
- 0x13, 0x13, 0x33, 0x33,
- 0x13, 0x13, 0x13, 0x33,
- 0x13, 0x36, 0x36, 0x36,
- 0x13, 0x13, 0x36, 0x36,
- 0x13, 0x13, 0x13, 0x36,
- 0x13, 0x25, 0x2E, 0x37,
- 0x13, 0x1C, 0x2E, 0x37,
- 0x13, 0x1C, 0x25, 0x37,
- 0x13, 0x3B, 0x3B, 0x3B,
- 0x13, 0x13, 0x3B, 0x3B,
- 0x13, 0x13, 0x13, 0x3B,
- 0x14, 0x15, 0x15, 0x16,
- 0x14, 0x15, 0x16, 0x17,
- 0x14, 0x16, 0x17, 0x18,
- 0x14, 0x15, 0x17, 0x18,
- 0x14, 0x15, 0x16, 0x18,
- 0x14, 0x16, 0x17, 0x19,
- 0x14, 0x16, 0x18, 0x19,
- 0x14, 0x15, 0x18, 0x19,
- 0x14, 0x15, 0x17, 0x19,
- 0x14, 0x16, 0x18, 0x1A,
- 0x14, 0x17, 0x19, 0x1A,
- 0x14, 0x15, 0x19, 0x1A,
- 0x14, 0x15, 0x17, 0x1A,
- 0x14, 0x1A, 0x1A, 0x1A,
- 0x14, 0x14, 0x1A, 0x1A,
- 0x14, 0x14, 0x14, 0x1A,
- 0x14, 0x17, 0x18, 0x1B,
- 0x14, 0x17, 0x1A, 0x1B,
- 0x14, 0x15, 0x1A, 0x1B,
- 0x14, 0x15, 0x18, 0x1B,
- 0x14, 0x17, 0x19, 0x1C,
- 0x14, 0x18, 0x1A, 0x1C,
- 0x14, 0x16, 0x1A, 0x1C,
- 0x14, 0x16, 0x18, 0x1C,
- 0x14, 0x1C, 0x1C, 0x1C,
- 0x14, 0x14, 0x1C, 0x1C,
- 0x14, 0x14, 0x14, 0x1C,
- 0x14, 0x18, 0x1B, 0x1F,
- 0x14, 0x19, 0x1D, 0x1F,
- 0x14, 0x16, 0x1D, 0x1F,
- 0x14, 0x16, 0x1A, 0x1F,
- 0x14, 0x1F, 0x1F, 0x1F,
- 0x14, 0x14, 0x1F, 0x1F,
- 0x14, 0x14, 0x14, 0x1F,
- 0x14, 0x19, 0x1D, 0x22,
- 0x14, 0x1B, 0x1F, 0x22,
- 0x14, 0x17, 0x1F, 0x22,
- 0x14, 0x17, 0x1B, 0x22,
- 0x14, 0x22, 0x22, 0x22,
- 0x14, 0x14, 0x22, 0x22,
- 0x14, 0x14, 0x14, 0x22,
- 0x14, 0x1A, 0x1F, 0x25,
- 0x14, 0x1C, 0x21, 0x25,
- 0x14, 0x18, 0x21, 0x25,
- 0x14, 0x18, 0x1D, 0x25,
- 0x14, 0x25, 0x25, 0x25,
- 0x14, 0x14, 0x25, 0x25,
- 0x14, 0x14, 0x14, 0x25,
- 0x14, 0x1B, 0x21, 0x28,
- 0x14, 0x1E, 0x23, 0x28,
- 0x14, 0x19, 0x23, 0x28,
- 0x14, 0x19, 0x1E, 0x28,
- 0x14, 0x28, 0x28, 0x28,
- 0x14, 0x14, 0x28, 0x28,
- 0x14, 0x14, 0x14, 0x28,
- 0x14, 0x1F, 0x26, 0x2B,
- 0x14, 0x19, 0x26, 0x2B,
- 0x14, 0x19, 0x20, 0x2B,
- 0x14, 0x2B, 0x2B, 0x2B,
- 0x14, 0x14, 0x2B, 0x2B,
- 0x14, 0x14, 0x14, 0x2B,
- 0x14, 0x21, 0x28, 0x2E,
- 0x14, 0x1A, 0x28, 0x2E,
- 0x14, 0x1A, 0x21, 0x2E,
- 0x14, 0x2E, 0x2E, 0x2E,
- 0x14, 0x14, 0x2E, 0x2E,
- 0x14, 0x14, 0x14, 0x2E,
- 0x14, 0x22, 0x2A, 0x31,
- 0x14, 0x1B, 0x2A, 0x31,
- 0x14, 0x1B, 0x23, 0x31,
- 0x14, 0x31, 0x31, 0x31,
- 0x14, 0x14, 0x31, 0x31,
- 0x14, 0x14, 0x14, 0x31,
- 0x14, 0x24, 0x2C, 0x34,
- 0x14, 0x1C, 0x2C, 0x34,
- 0x14, 0x1C, 0x24, 0x34,
- 0x14, 0x34, 0x34, 0x34,
- 0x14, 0x14, 0x34, 0x34,
- 0x14, 0x14, 0x14, 0x34,
- 0x14, 0x37, 0x37, 0x37,
- 0x14, 0x14, 0x37, 0x37,
- 0x14, 0x14, 0x14, 0x37,
- 0x14, 0x26, 0x2F, 0x38,
- 0x14, 0x1D, 0x2F, 0x38,
- 0x14, 0x1D, 0x26, 0x38,
- 0x14, 0x3C, 0x3C, 0x3C,
- 0x14, 0x14, 0x3C, 0x3C,
- 0x14, 0x14, 0x14, 0x3C,
- 0x15, 0x16, 0x16, 0x17,
- 0x15, 0x16, 0x17, 0x18,
- 0x15, 0x17, 0x18, 0x19,
- 0x15, 0x16, 0x18, 0x19,
- 0x15, 0x16, 0x17, 0x19,
- 0x15, 0x17, 0x18, 0x1A,
- 0x15, 0x17, 0x19, 0x1A,
- 0x15, 0x16, 0x19, 0x1A,
- 0x15, 0x16, 0x18, 0x1A,
- 0x15, 0x17, 0x19, 0x1B,
- 0x15, 0x18, 0x1A, 0x1B,
- 0x15, 0x16, 0x1A, 0x1B,
- 0x15, 0x16, 0x18, 0x1B,
- 0x15, 0x1B, 0x1B, 0x1B,
- 0x15, 0x15, 0x1B, 0x1B,
- 0x15, 0x15, 0x15, 0x1B,
- 0x15, 0x18, 0x19, 0x1C,
- 0x15, 0x18, 0x1B, 0x1C,
- 0x15, 0x16, 0x1B, 0x1C,
- 0x15, 0x16, 0x19, 0x1C,
- 0x15, 0x18, 0x1A, 0x1D,
- 0x15, 0x19, 0x1B, 0x1D,
- 0x15, 0x17, 0x1B, 0x1D,
- 0x15, 0x17, 0x19, 0x1D,
- 0x15, 0x1D, 0x1D, 0x1D,
- 0x15, 0x15, 0x1D, 0x1D,
- 0x15, 0x15, 0x15, 0x1D,
- 0x15, 0x19, 0x1C, 0x20,
- 0x15, 0x1A, 0x1E, 0x20,
- 0x15, 0x17, 0x1E, 0x20,
- 0x15, 0x17, 0x1B, 0x20,
- 0x15, 0x20, 0x20, 0x20,
- 0x15, 0x15, 0x20, 0x20,
- 0x15, 0x15, 0x15, 0x20,
- 0x15, 0x1A, 0x1E, 0x23,
- 0x15, 0x1C, 0x20, 0x23,
- 0x15, 0x18, 0x20, 0x23,
- 0x15, 0x18, 0x1C, 0x23,
- 0x15, 0x23, 0x23, 0x23,
- 0x15, 0x15, 0x23, 0x23,
- 0x15, 0x15, 0x15, 0x23,
- 0x15, 0x1B, 0x20, 0x26,
- 0x15, 0x1D, 0x22, 0x26,
- 0x15, 0x19, 0x22, 0x26,
- 0x15, 0x19, 0x1E, 0x26,
- 0x15, 0x26, 0x26, 0x26,
- 0x15, 0x15, 0x26, 0x26,
- 0x15, 0x15, 0x15, 0x26,
- 0x15, 0x1C, 0x22, 0x29,
- 0x15, 0x1F, 0x24, 0x29,
- 0x15, 0x1A, 0x24, 0x29,
- 0x15, 0x1A, 0x1F, 0x29,
- 0x15, 0x29, 0x29, 0x29,
- 0x15, 0x15, 0x29, 0x29,
- 0x15, 0x15, 0x15, 0x29,
- 0x15, 0x20, 0x27, 0x2C,
- 0x15, 0x1A, 0x27, 0x2C,
- 0x15, 0x1A, 0x21, 0x2C,
- 0x15, 0x2C, 0x2C, 0x2C,
- 0x15, 0x15, 0x2C, 0x2C,
- 0x15, 0x15, 0x15, 0x2C,
- 0x15, 0x22, 0x29, 0x2F,
- 0x15, 0x1B, 0x29, 0x2F,
- 0x15, 0x1B, 0x22, 0x2F,
- 0x15, 0x2F, 0x2F, 0x2F,
- 0x15, 0x15, 0x2F, 0x2F,
- 0x15, 0x15, 0x15, 0x2F,
- 0x15, 0x23, 0x2B, 0x32,
- 0x15, 0x1C, 0x2B, 0x32,
- 0x15, 0x1C, 0x24, 0x32,
- 0x15, 0x32, 0x32, 0x32,
- 0x15, 0x15, 0x32, 0x32,
- 0x15, 0x15, 0x15, 0x32,
- 0x15, 0x25, 0x2D, 0x35,
- 0x15, 0x1D, 0x2D, 0x35,
- 0x15, 0x1D, 0x25, 0x35,
- 0x15, 0x35, 0x35, 0x35,
- 0x15, 0x15, 0x35, 0x35,
- 0x15, 0x15, 0x15, 0x35,
- 0x15, 0x38, 0x38, 0x38,
- 0x15, 0x15, 0x38, 0x38,
- 0x15, 0x15, 0x15, 0x38,
- 0x15, 0x27, 0x30, 0x39,
- 0x15, 0x1E, 0x30, 0x39,
- 0x15, 0x1E, 0x27, 0x39,
- 0x15, 0x3D, 0x3D, 0x3D,
- 0x15, 0x15, 0x3D, 0x3D,
- 0x15, 0x15, 0x15, 0x3D,
- 0x16, 0x17, 0x17, 0x18,
- 0x16, 0x17, 0x18, 0x19,
- 0x16, 0x18, 0x19, 0x1A,
- 0x16, 0x17, 0x19, 0x1A,
- 0x16, 0x17, 0x18, 0x1A,
- 0x16, 0x18, 0x19, 0x1B,
- 0x16, 0x18, 0x1A, 0x1B,
- 0x16, 0x17, 0x1A, 0x1B,
- 0x16, 0x17, 0x19, 0x1B,
- 0x16, 0x18, 0x1A, 0x1C,
- 0x16, 0x19, 0x1B, 0x1C,
- 0x16, 0x17, 0x1B, 0x1C,
- 0x16, 0x17, 0x19, 0x1C,
- 0x16, 0x1C, 0x1C, 0x1C,
- 0x16, 0x16, 0x1C, 0x1C,
- 0x16, 0x16, 0x16, 0x1C,
- 0x16, 0x19, 0x1A, 0x1D,
- 0x16, 0x19, 0x1C, 0x1D,
- 0x16, 0x17, 0x1C, 0x1D,
- 0x16, 0x17, 0x1A, 0x1D,
- 0x16, 0x19, 0x1B, 0x1E,
- 0x16, 0x1A, 0x1C, 0x1E,
- 0x16, 0x18, 0x1C, 0x1E,
- 0x16, 0x18, 0x1A, 0x1E,
- 0x16, 0x1E, 0x1E, 0x1E,
- 0x16, 0x16, 0x1E, 0x1E,
- 0x16, 0x16, 0x16, 0x1E,
- 0x16, 0x1A, 0x1D, 0x21,
- 0x16, 0x1B, 0x1F, 0x21,
- 0x16, 0x18, 0x1F, 0x21,
- 0x16, 0x18, 0x1C, 0x21,
- 0x16, 0x21, 0x21, 0x21,
- 0x16, 0x16, 0x21, 0x21,
- 0x16, 0x16, 0x16, 0x21,
- 0x16, 0x1B, 0x1F, 0x24,
- 0x16, 0x1D, 0x21, 0x24,
- 0x16, 0x19, 0x21, 0x24,
- 0x16, 0x19, 0x1D, 0x24,
- 0x16, 0x24, 0x24, 0x24,
- 0x16, 0x16, 0x24, 0x24,
- 0x16, 0x16, 0x16, 0x24,
- 0x16, 0x1C, 0x21, 0x27,
- 0x16, 0x1E, 0x23, 0x27,
- 0x16, 0x1A, 0x23, 0x27,
- 0x16, 0x1A, 0x1F, 0x27,
- 0x16, 0x27, 0x27, 0x27,
- 0x16, 0x16, 0x27, 0x27,
- 0x16, 0x16, 0x16, 0x27,
- 0x16, 0x1D, 0x23, 0x2A,
- 0x16, 0x20, 0x25, 0x2A,
- 0x16, 0x1B, 0x25, 0x2A,
- 0x16, 0x1B, 0x20, 0x2A,
- 0x16, 0x2A, 0x2A, 0x2A,
- 0x16, 0x16, 0x2A, 0x2A,
- 0x16, 0x16, 0x16, 0x2A,
- 0x16, 0x21, 0x28, 0x2D,
- 0x16, 0x1B, 0x28, 0x2D,
- 0x16, 0x1B, 0x22, 0x2D,
- 0x16, 0x2D, 0x2D, 0x2D,
- 0x16, 0x16, 0x2D, 0x2D,
- 0x16, 0x16, 0x16, 0x2D,
- 0x16, 0x23, 0x2A, 0x30,
- 0x16, 0x1C, 0x2A, 0x30,
- 0x16, 0x1C, 0x23, 0x30,
- 0x16, 0x30, 0x30, 0x30,
- 0x16, 0x16, 0x30, 0x30,
- 0x16, 0x16, 0x16, 0x30,
- 0x16, 0x24, 0x2C, 0x33,
- 0x16, 0x1D, 0x2C, 0x33,
- 0x16, 0x1D, 0x25, 0x33,
- 0x16, 0x33, 0x33, 0x33,
- 0x16, 0x16, 0x33, 0x33,
- 0x16, 0x16, 0x16, 0x33,
- 0x16, 0x26, 0x2E, 0x36,
- 0x16, 0x1E, 0x2E, 0x36,
- 0x16, 0x1E, 0x26, 0x36,
- 0x16, 0x36, 0x36, 0x36,
- 0x16, 0x16, 0x36, 0x36,
- 0x16, 0x16, 0x16, 0x36,
- 0x16, 0x39, 0x39, 0x39,
- 0x16, 0x16, 0x39, 0x39,
- 0x16, 0x16, 0x16, 0x39,
- 0x16, 0x28, 0x31, 0x3A,
- 0x16, 0x1F, 0x31, 0x3A,
- 0x16, 0x1F, 0x28, 0x3A,
- 0x16, 0x3E, 0x3E, 0x3E,
- 0x16, 0x16, 0x3E, 0x3E,
- 0x16, 0x16, 0x16, 0x3E,
- 0x17, 0x18, 0x18, 0x19,
- 0x17, 0x18, 0x19, 0x1A,
- 0x17, 0x19, 0x1A, 0x1B,
- 0x17, 0x18, 0x1A, 0x1B,
- 0x17, 0x18, 0x19, 0x1B,
- 0x17, 0x19, 0x1A, 0x1C,
- 0x17, 0x19, 0x1B, 0x1C,
- 0x17, 0x18, 0x1B, 0x1C,
- 0x17, 0x18, 0x1A, 0x1C,
- 0x17, 0x19, 0x1B, 0x1D,
- 0x17, 0x1A, 0x1C, 0x1D,
- 0x17, 0x18, 0x1C, 0x1D,
- 0x17, 0x18, 0x1A, 0x1D,
- 0x17, 0x1D, 0x1D, 0x1D,
- 0x17, 0x17, 0x1D, 0x1D,
- 0x17, 0x17, 0x17, 0x1D,
- 0x17, 0x1A, 0x1B, 0x1E,
- 0x17, 0x1A, 0x1D, 0x1E,
- 0x17, 0x18, 0x1D, 0x1E,
- 0x17, 0x18, 0x1B, 0x1E,
- 0x17, 0x1A, 0x1C, 0x1F,
- 0x17, 0x1B, 0x1D, 0x1F,
- 0x17, 0x19, 0x1D, 0x1F,
- 0x17, 0x19, 0x1B, 0x1F,
- 0x17, 0x1F, 0x1F, 0x1F,
- 0x17, 0x17, 0x1F, 0x1F,
- 0x17, 0x17, 0x17, 0x1F,
- 0x17, 0x1B, 0x1E, 0x22,
- 0x17, 0x1C, 0x20, 0x22,
- 0x17, 0x19, 0x20, 0x22,
- 0x17, 0x19, 0x1D, 0x22,
- 0x17, 0x22, 0x22, 0x22,
- 0x17, 0x17, 0x22, 0x22,
- 0x17, 0x17, 0x17, 0x22,
- 0x17, 0x1C, 0x20, 0x25,
- 0x17, 0x1E, 0x22, 0x25,
- 0x17, 0x1A, 0x22, 0x25,
- 0x17, 0x1A, 0x1E, 0x25,
- 0x17, 0x25, 0x25, 0x25,
- 0x17, 0x17, 0x25, 0x25,
- 0x17, 0x17, 0x17, 0x25,
- 0x17, 0x1D, 0x22, 0x28,
- 0x17, 0x1F, 0x24, 0x28,
- 0x17, 0x1B, 0x24, 0x28,
- 0x17, 0x1B, 0x20, 0x28,
- 0x17, 0x28, 0x28, 0x28,
- 0x17, 0x17, 0x28, 0x28,
- 0x17, 0x17, 0x17, 0x28,
- 0x17, 0x1E, 0x24, 0x2B,
- 0x17, 0x21, 0x26, 0x2B,
- 0x17, 0x1C, 0x26, 0x2B,
- 0x17, 0x1C, 0x21, 0x2B,
- 0x17, 0x2B, 0x2B, 0x2B,
- 0x17, 0x17, 0x2B, 0x2B,
- 0x17, 0x17, 0x17, 0x2B,
- 0x17, 0x22, 0x29, 0x2E,
- 0x17, 0x1C, 0x29, 0x2E,
- 0x17, 0x1C, 0x23, 0x2E,
- 0x17, 0x2E, 0x2E, 0x2E,
- 0x17, 0x17, 0x2E, 0x2E,
- 0x17, 0x17, 0x17, 0x2E,
- 0x17, 0x24, 0x2B, 0x31,
- 0x17, 0x1D, 0x2B, 0x31,
- 0x17, 0x1D, 0x24, 0x31,
- 0x17, 0x31, 0x31, 0x31,
- 0x17, 0x17, 0x31, 0x31,
- 0x17, 0x17, 0x17, 0x31,
- 0x17, 0x25, 0x2D, 0x34,
- 0x17, 0x1E, 0x2D, 0x34,
- 0x17, 0x1E, 0x26, 0x34,
- 0x17, 0x34, 0x34, 0x34,
- 0x17, 0x17, 0x34, 0x34,
- 0x17, 0x17, 0x17, 0x34,
- 0x17, 0x27, 0x2F, 0x37,
- 0x17, 0x1F, 0x2F, 0x37,
- 0x17, 0x1F, 0x27, 0x37,
- 0x17, 0x37, 0x37, 0x37,
- 0x17, 0x17, 0x37, 0x37,
- 0x17, 0x17, 0x17, 0x37,
- 0x17, 0x3A, 0x3A, 0x3A,
- 0x17, 0x17, 0x3A, 0x3A,
- 0x17, 0x17, 0x17, 0x3A,
- 0x17, 0x29, 0x32, 0x3B,
- 0x17, 0x20, 0x32, 0x3B,
- 0x17, 0x20, 0x29, 0x3B,
- 0x17, 0x3F, 0x3F, 0x3F,
- 0x17, 0x17, 0x3F, 0x3F,
- 0x17, 0x17, 0x17, 0x3F,
- 0x18, 0x19, 0x19, 0x1A,
- 0x18, 0x19, 0x1A, 0x1B,
- 0x18, 0x1A, 0x1B, 0x1C,
- 0x18, 0x19, 0x1B, 0x1C,
- 0x18, 0x19, 0x1A, 0x1C,
- 0x18, 0x1A, 0x1B, 0x1D,
- 0x18, 0x1A, 0x1C, 0x1D,
- 0x18, 0x19, 0x1C, 0x1D,
- 0x18, 0x19, 0x1B, 0x1D,
- 0x18, 0x1A, 0x1C, 0x1E,
- 0x18, 0x1B, 0x1D, 0x1E,
- 0x18, 0x19, 0x1D, 0x1E,
- 0x18, 0x19, 0x1B, 0x1E,
- 0x18, 0x1E, 0x1E, 0x1E,
- 0x18, 0x18, 0x1E, 0x1E,
- 0x18, 0x18, 0x18, 0x1E,
- 0x18, 0x1B, 0x1C, 0x1F,
- 0x18, 0x1B, 0x1E, 0x1F,
- 0x18, 0x19, 0x1E, 0x1F,
- 0x18, 0x19, 0x1C, 0x1F,
- 0x18, 0x1B, 0x1D, 0x20,
- 0x18, 0x1C, 0x1E, 0x20,
- 0x18, 0x1A, 0x1E, 0x20,
- 0x18, 0x1A, 0x1C, 0x20,
- 0x18, 0x20, 0x20, 0x20,
- 0x18, 0x18, 0x20, 0x20,
- 0x18, 0x18, 0x18, 0x20,
- 0x18, 0x1C, 0x1F, 0x23,
- 0x18, 0x1D, 0x21, 0x23,
- 0x18, 0x1A, 0x21, 0x23,
- 0x18, 0x1A, 0x1E, 0x23,
- 0x18, 0x23, 0x23, 0x23,
- 0x18, 0x18, 0x23, 0x23,
- 0x18, 0x18, 0x18, 0x23,
- 0x18, 0x1D, 0x21, 0x26,
- 0x18, 0x1F, 0x23, 0x26,
- 0x18, 0x1B, 0x23, 0x26,
- 0x18, 0x1B, 0x1F, 0x26,
- 0x18, 0x26, 0x26, 0x26,
- 0x18, 0x18, 0x26, 0x26,
- 0x18, 0x18, 0x18, 0x26,
- 0x18, 0x1E, 0x23, 0x29,
- 0x18, 0x20, 0x25, 0x29,
- 0x18, 0x1C, 0x25, 0x29,
- 0x18, 0x1C, 0x21, 0x29,
- 0x18, 0x29, 0x29, 0x29,
- 0x18, 0x18, 0x29, 0x29,
- 0x18, 0x18, 0x18, 0x29,
- 0x18, 0x1F, 0x25, 0x2C,
- 0x18, 0x22, 0x27, 0x2C,
- 0x18, 0x1D, 0x27, 0x2C,
- 0x18, 0x1D, 0x22, 0x2C,
- 0x18, 0x2C, 0x2C, 0x2C,
- 0x18, 0x18, 0x2C, 0x2C,
- 0x18, 0x18, 0x18, 0x2C,
- 0x18, 0x23, 0x2A, 0x2F,
- 0x18, 0x1D, 0x2A, 0x2F,
- 0x18, 0x1D, 0x24, 0x2F,
- 0x18, 0x2F, 0x2F, 0x2F,
- 0x18, 0x18, 0x2F, 0x2F,
- 0x18, 0x18, 0x18, 0x2F,
- 0x18, 0x25, 0x2C, 0x32,
- 0x18, 0x1E, 0x2C, 0x32,
- 0x18, 0x1E, 0x25, 0x32,
- 0x18, 0x32, 0x32, 0x32,
- 0x18, 0x18, 0x32, 0x32,
- 0x18, 0x18, 0x18, 0x32,
- 0x18, 0x26, 0x2E, 0x35,
- 0x18, 0x1F, 0x2E, 0x35,
- 0x18, 0x1F, 0x27, 0x35,
- 0x18, 0x35, 0x35, 0x35,
- 0x18, 0x18, 0x35, 0x35,
- 0x18, 0x18, 0x18, 0x35,
- 0x18, 0x28, 0x30, 0x38,
- 0x18, 0x20, 0x30, 0x38,
- 0x18, 0x20, 0x28, 0x38,
- 0x18, 0x38, 0x38, 0x38,
- 0x18, 0x18, 0x38, 0x38,
- 0x18, 0x18, 0x18, 0x38,
- 0x18, 0x3B, 0x3B, 0x3B,
- 0x18, 0x18, 0x3B, 0x3B,
- 0x18, 0x18, 0x18, 0x3B,
- 0x18, 0x2A, 0x33, 0x3C,
- 0x18, 0x21, 0x33, 0x3C,
- 0x18, 0x21, 0x2A, 0x3C,
- 0x19, 0x1A, 0x1A, 0x1B,
- 0x19, 0x1A, 0x1B, 0x1C,
- 0x19, 0x1B, 0x1C, 0x1D,
- 0x19, 0x1A, 0x1C, 0x1D,
- 0x19, 0x1A, 0x1B, 0x1D,
- 0x19, 0x1B, 0x1C, 0x1E,
- 0x19, 0x1B, 0x1D, 0x1E,
- 0x19, 0x1A, 0x1D, 0x1E,
- 0x19, 0x1A, 0x1C, 0x1E,
- 0x19, 0x1B, 0x1D, 0x1F,
- 0x19, 0x1C, 0x1E, 0x1F,
- 0x19, 0x1A, 0x1E, 0x1F,
- 0x19, 0x1A, 0x1C, 0x1F,
- 0x19, 0x1F, 0x1F, 0x1F,
- 0x19, 0x19, 0x1F, 0x1F,
- 0x19, 0x19, 0x19, 0x1F,
- 0x19, 0x1C, 0x1D, 0x20,
- 0x19, 0x1C, 0x1F, 0x20,
- 0x19, 0x1A, 0x1F, 0x20,
- 0x19, 0x1A, 0x1D, 0x20,
- 0x19, 0x1C, 0x1E, 0x21,
- 0x19, 0x1D, 0x1F, 0x21,
- 0x19, 0x1B, 0x1F, 0x21,
- 0x19, 0x1B, 0x1D, 0x21,
- 0x19, 0x21, 0x21, 0x21,
- 0x19, 0x19, 0x21, 0x21,
- 0x19, 0x19, 0x19, 0x21,
- 0x19, 0x1D, 0x20, 0x24,
- 0x19, 0x1E, 0x22, 0x24,
- 0x19, 0x1B, 0x22, 0x24,
- 0x19, 0x1B, 0x1F, 0x24,
- 0x19, 0x24, 0x24, 0x24,
- 0x19, 0x19, 0x24, 0x24,
- 0x19, 0x19, 0x19, 0x24,
- 0x19, 0x1E, 0x22, 0x27,
- 0x19, 0x20, 0x24, 0x27,
- 0x19, 0x1C, 0x24, 0x27,
- 0x19, 0x1C, 0x20, 0x27,
- 0x19, 0x27, 0x27, 0x27,
- 0x19, 0x19, 0x27, 0x27,
- 0x19, 0x19, 0x19, 0x27,
- 0x19, 0x1F, 0x24, 0x2A,
- 0x19, 0x21, 0x26, 0x2A,
- 0x19, 0x1D, 0x26, 0x2A,
- 0x19, 0x1D, 0x22, 0x2A,
- 0x19, 0x2A, 0x2A, 0x2A,
- 0x19, 0x19, 0x2A, 0x2A,
- 0x19, 0x19, 0x19, 0x2A,
- 0x19, 0x20, 0x26, 0x2D,
- 0x19, 0x23, 0x28, 0x2D,
- 0x19, 0x1E, 0x28, 0x2D,
- 0x19, 0x1E, 0x23, 0x2D,
- 0x19, 0x2D, 0x2D, 0x2D,
- 0x19, 0x19, 0x2D, 0x2D,
- 0x19, 0x19, 0x19, 0x2D,
- 0x19, 0x24, 0x2B, 0x30,
- 0x19, 0x1E, 0x2B, 0x30,
- 0x19, 0x1E, 0x25, 0x30,
- 0x19, 0x30, 0x30, 0x30,
- 0x19, 0x19, 0x30, 0x30,
- 0x19, 0x19, 0x19, 0x30,
- 0x19, 0x26, 0x2D, 0x33,
- 0x19, 0x1F, 0x2D, 0x33,
- 0x19, 0x1F, 0x26, 0x33,
- 0x19, 0x33, 0x33, 0x33,
- 0x19, 0x19, 0x33, 0x33,
- 0x19, 0x19, 0x19, 0x33,
- 0x19, 0x27, 0x2F, 0x36,
- 0x19, 0x20, 0x2F, 0x36,
- 0x19, 0x20, 0x28, 0x36,
- 0x19, 0x36, 0x36, 0x36,
- 0x19, 0x19, 0x36, 0x36,
- 0x19, 0x19, 0x19, 0x36,
- 0x19, 0x29, 0x31, 0x39,
- 0x19, 0x21, 0x31, 0x39,
- 0x19, 0x21, 0x29, 0x39,
- 0x19, 0x39, 0x39, 0x39,
- 0x19, 0x19, 0x39, 0x39,
- 0x19, 0x19, 0x19, 0x39,
- 0x19, 0x3C, 0x3C, 0x3C,
- 0x19, 0x19, 0x3C, 0x3C,
- 0x19, 0x19, 0x19, 0x3C,
- 0x19, 0x2B, 0x34, 0x3D,
- 0x19, 0x22, 0x34, 0x3D,
- 0x19, 0x22, 0x2B, 0x3D,
- 0x1A, 0x1B, 0x1B, 0x1C,
- 0x1A, 0x1B, 0x1C, 0x1D,
- 0x1A, 0x1C, 0x1D, 0x1E,
- 0x1A, 0x1B, 0x1D, 0x1E,
- 0x1A, 0x1B, 0x1C, 0x1E,
- 0x1A, 0x1C, 0x1D, 0x1F,
- 0x1A, 0x1C, 0x1E, 0x1F,
- 0x1A, 0x1B, 0x1E, 0x1F,
- 0x1A, 0x1B, 0x1D, 0x1F,
- 0x1A, 0x1C, 0x1E, 0x20,
- 0x1A, 0x1D, 0x1F, 0x20,
- 0x1A, 0x1B, 0x1F, 0x20,
- 0x1A, 0x1B, 0x1D, 0x20,
- 0x1A, 0x20, 0x20, 0x20,
- 0x1A, 0x1A, 0x20, 0x20,
- 0x1A, 0x1A, 0x1A, 0x20,
- 0x1A, 0x1D, 0x1E, 0x21,
- 0x1A, 0x1D, 0x20, 0x21,
- 0x1A, 0x1B, 0x20, 0x21,
- 0x1A, 0x1B, 0x1E, 0x21,
- 0x1A, 0x1D, 0x1F, 0x22,
- 0x1A, 0x1E, 0x20, 0x22,
- 0x1A, 0x1C, 0x20, 0x22,
- 0x1A, 0x1C, 0x1E, 0x22,
- 0x1A, 0x22, 0x22, 0x22,
- 0x1A, 0x1A, 0x22, 0x22,
- 0x1A, 0x1A, 0x1A, 0x22,
- 0x1A, 0x1E, 0x21, 0x25,
- 0x1A, 0x1F, 0x23, 0x25,
- 0x1A, 0x1C, 0x23, 0x25,
- 0x1A, 0x1C, 0x20, 0x25,
- 0x1A, 0x25, 0x25, 0x25,
- 0x1A, 0x1A, 0x25, 0x25,
- 0x1A, 0x1A, 0x1A, 0x25,
- 0x1A, 0x1F, 0x23, 0x28,
- 0x1A, 0x21, 0x25, 0x28,
- 0x1A, 0x1D, 0x25, 0x28,
- 0x1A, 0x1D, 0x21, 0x28,
- 0x1A, 0x28, 0x28, 0x28,
- 0x1A, 0x1A, 0x28, 0x28,
- 0x1A, 0x1A, 0x1A, 0x28,
- 0x1A, 0x20, 0x25, 0x2B,
- 0x1A, 0x22, 0x27, 0x2B,
- 0x1A, 0x1E, 0x27, 0x2B,
- 0x1A, 0x1E, 0x23, 0x2B,
- 0x1A, 0x2B, 0x2B, 0x2B,
- 0x1A, 0x1A, 0x2B, 0x2B,
- 0x1A, 0x1A, 0x1A, 0x2B,
- 0x1A, 0x21, 0x27, 0x2E,
- 0x1A, 0x24, 0x29, 0x2E,
- 0x1A, 0x1F, 0x29, 0x2E,
- 0x1A, 0x1F, 0x24, 0x2E,
- 0x1A, 0x2E, 0x2E, 0x2E,
- 0x1A, 0x1A, 0x2E, 0x2E,
- 0x1A, 0x1A, 0x1A, 0x2E,
- 0x1A, 0x25, 0x2C, 0x31,
- 0x1A, 0x1F, 0x2C, 0x31,
- 0x1A, 0x1F, 0x26, 0x31,
- 0x1A, 0x31, 0x31, 0x31,
- 0x1A, 0x1A, 0x31, 0x31,
- 0x1A, 0x1A, 0x1A, 0x31,
- 0x1A, 0x27, 0x2E, 0x34,
- 0x1A, 0x20, 0x2E, 0x34,
- 0x1A, 0x20, 0x27, 0x34,
- 0x1A, 0x34, 0x34, 0x34,
- 0x1A, 0x1A, 0x34, 0x34,
- 0x1A, 0x1A, 0x1A, 0x34,
- 0x1A, 0x28, 0x30, 0x37,
- 0x1A, 0x21, 0x30, 0x37,
- 0x1A, 0x21, 0x29, 0x37,
- 0x1A, 0x37, 0x37, 0x37,
- 0x1A, 0x1A, 0x37, 0x37,
- 0x1A, 0x1A, 0x1A, 0x37,
- 0x1A, 0x2A, 0x32, 0x3A,
- 0x1A, 0x22, 0x32, 0x3A,
- 0x1A, 0x22, 0x2A, 0x3A,
- 0x1A, 0x3A, 0x3A, 0x3A,
- 0x1A, 0x1A, 0x3A, 0x3A,
- 0x1A, 0x1A, 0x1A, 0x3A,
- 0x1A, 0x3D, 0x3D, 0x3D,
- 0x1A, 0x1A, 0x3D, 0x3D,
- 0x1A, 0x1A, 0x1A, 0x3D,
- 0x1A, 0x2C, 0x35, 0x3E,
- 0x1A, 0x23, 0x35, 0x3E,
- 0x1A, 0x23, 0x2C, 0x3E,
- 0x1B, 0x1C, 0x1C, 0x1D,
- 0x1B, 0x1C, 0x1D, 0x1E,
- 0x1B, 0x1D, 0x1E, 0x1F,
- 0x1B, 0x1C, 0x1E, 0x1F,
- 0x1B, 0x1C, 0x1D, 0x1F,
- 0x1B, 0x1D, 0x1E, 0x20,
- 0x1B, 0x1D, 0x1F, 0x20,
- 0x1B, 0x1C, 0x1F, 0x20,
- 0x1B, 0x1C, 0x1E, 0x20,
- 0x1B, 0x1D, 0x1F, 0x21,
- 0x1B, 0x1E, 0x20, 0x21,
- 0x1B, 0x1C, 0x20, 0x21,
- 0x1B, 0x1C, 0x1E, 0x21,
- 0x1B, 0x21, 0x21, 0x21,
- 0x1B, 0x1B, 0x21, 0x21,
- 0x1B, 0x1B, 0x1B, 0x21,
- 0x1B, 0x1E, 0x1F, 0x22,
- 0x1B, 0x1E, 0x21, 0x22,
- 0x1B, 0x1C, 0x21, 0x22,
- 0x1B, 0x1C, 0x1F, 0x22,
- 0x1B, 0x1E, 0x20, 0x23,
- 0x1B, 0x1F, 0x21, 0x23,
- 0x1B, 0x1D, 0x21, 0x23,
- 0x1B, 0x1D, 0x1F, 0x23,
- 0x1B, 0x23, 0x23, 0x23,
- 0x1B, 0x1B, 0x23, 0x23,
- 0x1B, 0x1B, 0x1B, 0x23,
- 0x1B, 0x1F, 0x22, 0x26,
- 0x1B, 0x20, 0x24, 0x26,
- 0x1B, 0x1D, 0x24, 0x26,
- 0x1B, 0x1D, 0x21, 0x26,
- 0x1B, 0x26, 0x26, 0x26,
- 0x1B, 0x1B, 0x26, 0x26,
- 0x1B, 0x1B, 0x1B, 0x26,
- 0x1B, 0x20, 0x24, 0x29,
- 0x1B, 0x22, 0x26, 0x29,
- 0x1B, 0x1E, 0x26, 0x29,
- 0x1B, 0x1E, 0x22, 0x29,
- 0x1B, 0x29, 0x29, 0x29,
- 0x1B, 0x1B, 0x29, 0x29,
- 0x1B, 0x1B, 0x1B, 0x29,
- 0x1B, 0x21, 0x26, 0x2C,
- 0x1B, 0x23, 0x28, 0x2C,
- 0x1B, 0x1F, 0x28, 0x2C,
- 0x1B, 0x1F, 0x24, 0x2C,
- 0x1B, 0x2C, 0x2C, 0x2C,
- 0x1B, 0x1B, 0x2C, 0x2C,
- 0x1B, 0x1B, 0x1B, 0x2C,
- 0x1B, 0x22, 0x28, 0x2F,
- 0x1B, 0x25, 0x2A, 0x2F,
- 0x1B, 0x20, 0x2A, 0x2F,
- 0x1B, 0x20, 0x25, 0x2F,
- 0x1B, 0x2F, 0x2F, 0x2F,
- 0x1B, 0x1B, 0x2F, 0x2F,
- 0x1B, 0x1B, 0x1B, 0x2F,
- 0x1B, 0x26, 0x2D, 0x32,
- 0x1B, 0x20, 0x2D, 0x32,
- 0x1B, 0x20, 0x27, 0x32,
- 0x1B, 0x32, 0x32, 0x32,
- 0x1B, 0x1B, 0x32, 0x32,
- 0x1B, 0x1B, 0x1B, 0x32,
- 0x1B, 0x28, 0x2F, 0x35,
- 0x1B, 0x21, 0x2F, 0x35,
- 0x1B, 0x21, 0x28, 0x35,
- 0x1B, 0x35, 0x35, 0x35,
- 0x1B, 0x1B, 0x35, 0x35,
- 0x1B, 0x1B, 0x1B, 0x35,
- 0x1B, 0x29, 0x31, 0x38,
- 0x1B, 0x22, 0x31, 0x38,
- 0x1B, 0x22, 0x2A, 0x38,
- 0x1B, 0x38, 0x38, 0x38,
- 0x1B, 0x1B, 0x38, 0x38,
- 0x1B, 0x1B, 0x1B, 0x38,
- 0x1B, 0x2B, 0x33, 0x3B,
- 0x1B, 0x23, 0x33, 0x3B,
- 0x1B, 0x23, 0x2B, 0x3B,
- 0x1B, 0x3B, 0x3B, 0x3B,
- 0x1B, 0x1B, 0x3B, 0x3B,
- 0x1B, 0x1B, 0x1B, 0x3B,
- 0x1B, 0x3E, 0x3E, 0x3E,
- 0x1B, 0x1B, 0x3E, 0x3E,
- 0x1B, 0x1B, 0x1B, 0x3E,
- 0x1B, 0x2D, 0x36, 0x3F,
- 0x1B, 0x24, 0x36, 0x3F,
- 0x1B, 0x24, 0x2D, 0x3F,
- 0x1C, 0x1D, 0x1D, 0x1E,
- 0x1C, 0x1D, 0x1E, 0x1F,
- 0x1C, 0x1E, 0x1F, 0x20,
- 0x1C, 0x1D, 0x1F, 0x20,
- 0x1C, 0x1D, 0x1E, 0x20,
- 0x1C, 0x1E, 0x1F, 0x21,
- 0x1C, 0x1E, 0x20, 0x21,
- 0x1C, 0x1D, 0x20, 0x21,
- 0x1C, 0x1D, 0x1F, 0x21,
- 0x1C, 0x1E, 0x20, 0x22,
- 0x1C, 0x1F, 0x21, 0x22,
- 0x1C, 0x1D, 0x21, 0x22,
- 0x1C, 0x1D, 0x1F, 0x22,
- 0x1C, 0x22, 0x22, 0x22,
- 0x1C, 0x1C, 0x22, 0x22,
- 0x1C, 0x1C, 0x1C, 0x22,
- 0x1C, 0x1F, 0x20, 0x23,
- 0x1C, 0x1F, 0x22, 0x23,
- 0x1C, 0x1D, 0x22, 0x23,
- 0x1C, 0x1D, 0x20, 0x23,
- 0x1C, 0x1F, 0x21, 0x24,
- 0x1C, 0x20, 0x22, 0x24,
- 0x1C, 0x1E, 0x22, 0x24,
- 0x1C, 0x1E, 0x20, 0x24,
- 0x1C, 0x24, 0x24, 0x24,
- 0x1C, 0x1C, 0x24, 0x24,
- 0x1C, 0x1C, 0x1C, 0x24,
- 0x1C, 0x20, 0x23, 0x27,
- 0x1C, 0x21, 0x25, 0x27,
- 0x1C, 0x1E, 0x25, 0x27,
- 0x1C, 0x1E, 0x22, 0x27,
- 0x1C, 0x27, 0x27, 0x27,
- 0x1C, 0x1C, 0x27, 0x27,
- 0x1C, 0x1C, 0x1C, 0x27,
- 0x1C, 0x21, 0x25, 0x2A,
- 0x1C, 0x23, 0x27, 0x2A,
- 0x1C, 0x1F, 0x27, 0x2A,
- 0x1C, 0x1F, 0x23, 0x2A,
- 0x1C, 0x2A, 0x2A, 0x2A,
- 0x1C, 0x1C, 0x2A, 0x2A,
- 0x1C, 0x1C, 0x1C, 0x2A,
- 0x1C, 0x22, 0x27, 0x2D,
- 0x1C, 0x24, 0x29, 0x2D,
- 0x1C, 0x20, 0x29, 0x2D,
- 0x1C, 0x20, 0x25, 0x2D,
- 0x1C, 0x2D, 0x2D, 0x2D,
- 0x1C, 0x1C, 0x2D, 0x2D,
- 0x1C, 0x1C, 0x1C, 0x2D,
- 0x1C, 0x23, 0x29, 0x30,
- 0x1C, 0x26, 0x2B, 0x30,
- 0x1C, 0x21, 0x2B, 0x30,
- 0x1C, 0x21, 0x26, 0x30,
- 0x1C, 0x30, 0x30, 0x30,
- 0x1C, 0x1C, 0x30, 0x30,
- 0x1C, 0x1C, 0x1C, 0x30,
- 0x1C, 0x27, 0x2E, 0x33,
- 0x1C, 0x21, 0x2E, 0x33,
- 0x1C, 0x21, 0x28, 0x33,
- 0x1C, 0x33, 0x33, 0x33,
- 0x1C, 0x1C, 0x33, 0x33,
- 0x1C, 0x1C, 0x1C, 0x33,
- 0x1C, 0x29, 0x30, 0x36,
- 0x1C, 0x22, 0x30, 0x36,
- 0x1C, 0x22, 0x29, 0x36,
- 0x1C, 0x36, 0x36, 0x36,
- 0x1C, 0x1C, 0x36, 0x36,
- 0x1C, 0x1C, 0x1C, 0x36,
- 0x1C, 0x2A, 0x32, 0x39,
- 0x1C, 0x23, 0x32, 0x39,
- 0x1C, 0x23, 0x2B, 0x39,
- 0x1C, 0x39, 0x39, 0x39,
- 0x1C, 0x1C, 0x39, 0x39,
- 0x1C, 0x1C, 0x1C, 0x39,
- 0x1C, 0x2C, 0x34, 0x3C,
- 0x1C, 0x24, 0x34, 0x3C,
- 0x1C, 0x24, 0x2C, 0x3C,
- 0x1C, 0x3C, 0x3C, 0x3C,
- 0x1C, 0x1C, 0x3C, 0x3C,
- 0x1C, 0x1C, 0x1C, 0x3C,
- 0x1C, 0x3F, 0x3F, 0x3F,
- 0x1C, 0x1C, 0x3F, 0x3F,
- 0x1C, 0x1C, 0x1C, 0x3F,
- 0x1D, 0x1E, 0x1E, 0x1F,
- 0x1D, 0x1E, 0x1F, 0x20,
- 0x1D, 0x1F, 0x20, 0x21,
- 0x1D, 0x1E, 0x20, 0x21,
- 0x1D, 0x1E, 0x1F, 0x21,
- 0x1D, 0x1F, 0x20, 0x22,
- 0x1D, 0x1F, 0x21, 0x22,
- 0x1D, 0x1E, 0x21, 0x22,
- 0x1D, 0x1E, 0x20, 0x22,
- 0x1D, 0x1F, 0x21, 0x23,
- 0x1D, 0x20, 0x22, 0x23,
- 0x1D, 0x1E, 0x22, 0x23,
- 0x1D, 0x1E, 0x20, 0x23,
- 0x1D, 0x23, 0x23, 0x23,
- 0x1D, 0x1D, 0x23, 0x23,
- 0x1D, 0x1D, 0x1D, 0x23,
- 0x1D, 0x20, 0x21, 0x24,
- 0x1D, 0x20, 0x23, 0x24,
- 0x1D, 0x1E, 0x23, 0x24,
- 0x1D, 0x1E, 0x21, 0x24,
- 0x1D, 0x20, 0x22, 0x25,
- 0x1D, 0x21, 0x23, 0x25,
- 0x1D, 0x1F, 0x23, 0x25,
- 0x1D, 0x1F, 0x21, 0x25,
- 0x1D, 0x25, 0x25, 0x25,
- 0x1D, 0x1D, 0x25, 0x25,
- 0x1D, 0x1D, 0x1D, 0x25,
- 0x1D, 0x21, 0x24, 0x28,
- 0x1D, 0x22, 0x26, 0x28,
- 0x1D, 0x1F, 0x26, 0x28,
- 0x1D, 0x1F, 0x23, 0x28,
- 0x1D, 0x28, 0x28, 0x28,
- 0x1D, 0x1D, 0x28, 0x28,
- 0x1D, 0x1D, 0x1D, 0x28,
- 0x1D, 0x22, 0x26, 0x2B,
- 0x1D, 0x24, 0x28, 0x2B,
- 0x1D, 0x20, 0x28, 0x2B,
- 0x1D, 0x20, 0x24, 0x2B,
- 0x1D, 0x2B, 0x2B, 0x2B,
- 0x1D, 0x1D, 0x2B, 0x2B,
- 0x1D, 0x1D, 0x1D, 0x2B,
- 0x1D, 0x23, 0x28, 0x2E,
- 0x1D, 0x25, 0x2A, 0x2E,
- 0x1D, 0x21, 0x2A, 0x2E,
- 0x1D, 0x21, 0x26, 0x2E,
- 0x1D, 0x2E, 0x2E, 0x2E,
- 0x1D, 0x1D, 0x2E, 0x2E,
- 0x1D, 0x1D, 0x1D, 0x2E,
- 0x1D, 0x24, 0x2A, 0x31,
- 0x1D, 0x27, 0x2C, 0x31,
- 0x1D, 0x22, 0x2C, 0x31,
- 0x1D, 0x22, 0x27, 0x31,
- 0x1D, 0x31, 0x31, 0x31,
- 0x1D, 0x1D, 0x31, 0x31,
- 0x1D, 0x1D, 0x1D, 0x31,
- 0x1D, 0x28, 0x2F, 0x34,
- 0x1D, 0x22, 0x2F, 0x34,
- 0x1D, 0x22, 0x29, 0x34,
- 0x1D, 0x34, 0x34, 0x34,
- 0x1D, 0x1D, 0x34, 0x34,
- 0x1D, 0x1D, 0x1D, 0x34,
- 0x1D, 0x2A, 0x31, 0x37,
- 0x1D, 0x23, 0x31, 0x37,
- 0x1D, 0x23, 0x2A, 0x37,
- 0x1D, 0x37, 0x37, 0x37,
- 0x1D, 0x1D, 0x37, 0x37,
- 0x1D, 0x1D, 0x1D, 0x37,
- 0x1D, 0x2B, 0x33, 0x3A,
- 0x1D, 0x24, 0x33, 0x3A,
- 0x1D, 0x24, 0x2C, 0x3A,
- 0x1D, 0x3A, 0x3A, 0x3A,
- 0x1D, 0x1D, 0x3A, 0x3A,
- 0x1D, 0x1D, 0x1D, 0x3A,
- 0x1D, 0x2D, 0x35, 0x3D,
- 0x1D, 0x25, 0x35, 0x3D,
- 0x1D, 0x25, 0x2D, 0x3D,
- 0x1D, 0x3D, 0x3D, 0x3D,
- 0x1D, 0x1D, 0x3D, 0x3D,
- 0x1D, 0x1D, 0x1D, 0x3D,
- 0x1E, 0x1F, 0x1F, 0x20,
- 0x1E, 0x1F, 0x20, 0x21,
- 0x1E, 0x20, 0x21, 0x22,
- 0x1E, 0x1F, 0x21, 0x22,
- 0x1E, 0x1F, 0x20, 0x22,
- 0x1E, 0x20, 0x21, 0x23,
- 0x1E, 0x20, 0x22, 0x23,
- 0x1E, 0x1F, 0x22, 0x23,
- 0x1E, 0x1F, 0x21, 0x23,
- 0x1E, 0x20, 0x22, 0x24,
- 0x1E, 0x21, 0x23, 0x24,
- 0x1E, 0x1F, 0x23, 0x24,
- 0x1E, 0x1F, 0x21, 0x24,
- 0x1E, 0x24, 0x24, 0x24,
- 0x1E, 0x1E, 0x24, 0x24,
- 0x1E, 0x1E, 0x1E, 0x24,
- 0x1E, 0x21, 0x22, 0x25,
- 0x1E, 0x21, 0x24, 0x25,
- 0x1E, 0x1F, 0x24, 0x25,
- 0x1E, 0x1F, 0x22, 0x25,
- 0x1E, 0x21, 0x23, 0x26,
- 0x1E, 0x22, 0x24, 0x26,
- 0x1E, 0x20, 0x24, 0x26,
- 0x1E, 0x20, 0x22, 0x26,
- 0x1E, 0x26, 0x26, 0x26,
- 0x1E, 0x1E, 0x26, 0x26,
- 0x1E, 0x1E, 0x1E, 0x26,
- 0x1E, 0x22, 0x25, 0x29,
- 0x1E, 0x23, 0x27, 0x29,
- 0x1E, 0x20, 0x27, 0x29,
- 0x1E, 0x20, 0x24, 0x29,
- 0x1E, 0x29, 0x29, 0x29,
- 0x1E, 0x1E, 0x29, 0x29,
- 0x1E, 0x1E, 0x1E, 0x29,
- 0x1E, 0x23, 0x27, 0x2C,
- 0x1E, 0x25, 0x29, 0x2C,
- 0x1E, 0x21, 0x29, 0x2C,
- 0x1E, 0x21, 0x25, 0x2C,
- 0x1E, 0x2C, 0x2C, 0x2C,
- 0x1E, 0x1E, 0x2C, 0x2C,
- 0x1E, 0x1E, 0x1E, 0x2C,
- 0x1E, 0x24, 0x29, 0x2F,
- 0x1E, 0x26, 0x2B, 0x2F,
- 0x1E, 0x22, 0x2B, 0x2F,
- 0x1E, 0x22, 0x27, 0x2F,
- 0x1E, 0x2F, 0x2F, 0x2F,
- 0x1E, 0x1E, 0x2F, 0x2F,
- 0x1E, 0x1E, 0x1E, 0x2F,
- 0x1E, 0x25, 0x2B, 0x32,
- 0x1E, 0x28, 0x2D, 0x32,
- 0x1E, 0x23, 0x2D, 0x32,
- 0x1E, 0x23, 0x28, 0x32,
- 0x1E, 0x32, 0x32, 0x32,
- 0x1E, 0x1E, 0x32, 0x32,
- 0x1E, 0x1E, 0x1E, 0x32,
- 0x1E, 0x29, 0x30, 0x35,
- 0x1E, 0x23, 0x30, 0x35,
- 0x1E, 0x23, 0x2A, 0x35,
- 0x1E, 0x35, 0x35, 0x35,
- 0x1E, 0x1E, 0x35, 0x35,
- 0x1E, 0x1E, 0x1E, 0x35,
- 0x1E, 0x2B, 0x32, 0x38,
- 0x1E, 0x24, 0x32, 0x38,
- 0x1E, 0x24, 0x2B, 0x38,
- 0x1E, 0x38, 0x38, 0x38,
- 0x1E, 0x1E, 0x38, 0x38,
- 0x1E, 0x1E, 0x1E, 0x38,
- 0x1E, 0x2C, 0x34, 0x3B,
- 0x1E, 0x25, 0x34, 0x3B,
- 0x1E, 0x25, 0x2D, 0x3B,
- 0x1E, 0x3B, 0x3B, 0x3B,
- 0x1E, 0x1E, 0x3B, 0x3B,
- 0x1E, 0x1E, 0x1E, 0x3B,
- 0x1E, 0x2E, 0x36, 0x3E,
- 0x1E, 0x26, 0x36, 0x3E,
- 0x1E, 0x26, 0x2E, 0x3E,
- 0x1E, 0x3E, 0x3E, 0x3E,
- 0x1E, 0x1E, 0x3E, 0x3E,
- 0x1E, 0x1E, 0x1E, 0x3E,
- 0x1F, 0x20, 0x20, 0x21,
- 0x1F, 0x20, 0x21, 0x22,
- 0x1F, 0x21, 0x22, 0x23,
- 0x1F, 0x20, 0x22, 0x23,
- 0x1F, 0x20, 0x21, 0x23,
- 0x1F, 0x21, 0x22, 0x24,
- 0x1F, 0x21, 0x23, 0x24,
- 0x1F, 0x20, 0x23, 0x24,
- 0x1F, 0x20, 0x22, 0x24,
- 0x1F, 0x21, 0x23, 0x25,
- 0x1F, 0x22, 0x24, 0x25,
- 0x1F, 0x20, 0x24, 0x25,
- 0x1F, 0x20, 0x22, 0x25,
- 0x1F, 0x25, 0x25, 0x25,
- 0x1F, 0x1F, 0x25, 0x25,
- 0x1F, 0x1F, 0x1F, 0x25,
- 0x1F, 0x22, 0x23, 0x26,
- 0x1F, 0x22, 0x25, 0x26,
- 0x1F, 0x20, 0x25, 0x26,
- 0x1F, 0x20, 0x23, 0x26,
- 0x1F, 0x22, 0x24, 0x27,
- 0x1F, 0x23, 0x25, 0x27,
- 0x1F, 0x21, 0x25, 0x27,
- 0x1F, 0x21, 0x23, 0x27,
- 0x1F, 0x27, 0x27, 0x27,
- 0x1F, 0x1F, 0x27, 0x27,
- 0x1F, 0x1F, 0x1F, 0x27,
- 0x1F, 0x23, 0x26, 0x2A,
- 0x1F, 0x24, 0x28, 0x2A,
- 0x1F, 0x21, 0x28, 0x2A,
- 0x1F, 0x21, 0x25, 0x2A,
- 0x1F, 0x2A, 0x2A, 0x2A,
- 0x1F, 0x1F, 0x2A, 0x2A,
- 0x1F, 0x1F, 0x1F, 0x2A,
- 0x1F, 0x24, 0x28, 0x2D,
- 0x1F, 0x26, 0x2A, 0x2D,
- 0x1F, 0x22, 0x2A, 0x2D,
- 0x1F, 0x22, 0x26, 0x2D,
- 0x1F, 0x2D, 0x2D, 0x2D,
- 0x1F, 0x1F, 0x2D, 0x2D,
- 0x1F, 0x1F, 0x1F, 0x2D,
- 0x1F, 0x25, 0x2A, 0x30,
- 0x1F, 0x27, 0x2C, 0x30,
- 0x1F, 0x23, 0x2C, 0x30,
- 0x1F, 0x23, 0x28, 0x30,
- 0x1F, 0x30, 0x30, 0x30,
- 0x1F, 0x1F, 0x30, 0x30,
- 0x1F, 0x1F, 0x1F, 0x30,
- 0x1F, 0x26, 0x2C, 0x33,
- 0x1F, 0x29, 0x2E, 0x33,
- 0x1F, 0x24, 0x2E, 0x33,
- 0x1F, 0x24, 0x29, 0x33,
- 0x1F, 0x33, 0x33, 0x33,
- 0x1F, 0x1F, 0x33, 0x33,
- 0x1F, 0x1F, 0x1F, 0x33,
- 0x1F, 0x2A, 0x31, 0x36,
- 0x1F, 0x24, 0x31, 0x36,
- 0x1F, 0x24, 0x2B, 0x36,
- 0x1F, 0x36, 0x36, 0x36,
- 0x1F, 0x1F, 0x36, 0x36,
- 0x1F, 0x1F, 0x1F, 0x36,
- 0x1F, 0x2C, 0x33, 0x39,
- 0x1F, 0x25, 0x33, 0x39,
- 0x1F, 0x25, 0x2C, 0x39,
- 0x1F, 0x39, 0x39, 0x39,
- 0x1F, 0x1F, 0x39, 0x39,
- 0x1F, 0x1F, 0x1F, 0x39,
- 0x1F, 0x2D, 0x35, 0x3C,
- 0x1F, 0x26, 0x35, 0x3C,
- 0x1F, 0x26, 0x2E, 0x3C,
- 0x1F, 0x3C, 0x3C, 0x3C,
- 0x1F, 0x1F, 0x3C, 0x3C,
- 0x1F, 0x1F, 0x1F, 0x3C,
- 0x1F, 0x2F, 0x37, 0x3F,
- 0x1F, 0x27, 0x37, 0x3F,
- 0x1F, 0x27, 0x2F, 0x3F,
- 0x1F, 0x3F, 0x3F, 0x3F,
- 0x1F, 0x1F, 0x3F, 0x3F,
- 0x1F, 0x1F, 0x1F, 0x3F,
- 0x20, 0x21, 0x21, 0x22,
- 0x20, 0x21, 0x22, 0x23,
- 0x20, 0x22, 0x23, 0x24,
- 0x20, 0x21, 0x23, 0x24,
- 0x20, 0x21, 0x22, 0x24,
- 0x20, 0x22, 0x23, 0x25,
- 0x20, 0x22, 0x24, 0x25,
- 0x20, 0x21, 0x24, 0x25,
- 0x20, 0x21, 0x23, 0x25,
- 0x20, 0x22, 0x24, 0x26,
- 0x20, 0x23, 0x25, 0x26,
- 0x20, 0x21, 0x25, 0x26,
- 0x20, 0x21, 0x23, 0x26,
- 0x20, 0x26, 0x26, 0x26,
- 0x20, 0x20, 0x26, 0x26,
- 0x20, 0x20, 0x20, 0x26,
- 0x20, 0x23, 0x24, 0x27,
- 0x20, 0x23, 0x26, 0x27,
- 0x20, 0x21, 0x26, 0x27,
- 0x20, 0x21, 0x24, 0x27,
- 0x20, 0x23, 0x25, 0x28,
- 0x20, 0x24, 0x26, 0x28,
- 0x20, 0x22, 0x26, 0x28,
- 0x20, 0x22, 0x24, 0x28,
- 0x20, 0x28, 0x28, 0x28,
- 0x20, 0x20, 0x28, 0x28,
- 0x20, 0x20, 0x20, 0x28,
- 0x20, 0x24, 0x27, 0x2B,
- 0x20, 0x25, 0x29, 0x2B,
- 0x20, 0x22, 0x29, 0x2B,
- 0x20, 0x22, 0x26, 0x2B,
- 0x20, 0x2B, 0x2B, 0x2B,
- 0x20, 0x20, 0x2B, 0x2B,
- 0x20, 0x20, 0x20, 0x2B,
- 0x20, 0x25, 0x29, 0x2E,
- 0x20, 0x27, 0x2B, 0x2E,
- 0x20, 0x23, 0x2B, 0x2E,
- 0x20, 0x23, 0x27, 0x2E,
- 0x20, 0x2E, 0x2E, 0x2E,
- 0x20, 0x20, 0x2E, 0x2E,
- 0x20, 0x20, 0x20, 0x2E,
- 0x20, 0x26, 0x2B, 0x31,
- 0x20, 0x28, 0x2D, 0x31,
- 0x20, 0x24, 0x2D, 0x31,
- 0x20, 0x24, 0x29, 0x31,
- 0x20, 0x31, 0x31, 0x31,
- 0x20, 0x20, 0x31, 0x31,
- 0x20, 0x20, 0x20, 0x31,
- 0x20, 0x27, 0x2D, 0x34,
- 0x20, 0x2A, 0x2F, 0x34,
- 0x20, 0x25, 0x2F, 0x34,
- 0x20, 0x25, 0x2A, 0x34,
- 0x20, 0x34, 0x34, 0x34,
- 0x20, 0x20, 0x34, 0x34,
- 0x20, 0x20, 0x20, 0x34,
- 0x20, 0x2B, 0x32, 0x37,
- 0x20, 0x25, 0x32, 0x37,
- 0x20, 0x25, 0x2C, 0x37,
- 0x20, 0x37, 0x37, 0x37,
- 0x20, 0x20, 0x37, 0x37,
- 0x20, 0x20, 0x20, 0x37,
- 0x20, 0x2D, 0x34, 0x3A,
- 0x20, 0x26, 0x34, 0x3A,
- 0x20, 0x26, 0x2D, 0x3A,
- 0x20, 0x3A, 0x3A, 0x3A,
- 0x20, 0x20, 0x3A, 0x3A,
- 0x20, 0x20, 0x20, 0x3A,
- 0x20, 0x2E, 0x36, 0x3D,
- 0x20, 0x27, 0x36, 0x3D,
- 0x20, 0x27, 0x2F, 0x3D,
- 0x20, 0x3D, 0x3D, 0x3D,
- 0x20, 0x20, 0x3D, 0x3D,
- 0x20, 0x20, 0x20, 0x3D,
- 0x21, 0x22, 0x22, 0x23,
- 0x21, 0x22, 0x23, 0x24,
- 0x21, 0x23, 0x24, 0x25,
- 0x21, 0x22, 0x24, 0x25,
- 0x21, 0x22, 0x23, 0x25,
- 0x21, 0x23, 0x24, 0x26,
- 0x21, 0x23, 0x25, 0x26,
- 0x21, 0x22, 0x25, 0x26,
- 0x21, 0x22, 0x24, 0x26,
- 0x21, 0x23, 0x25, 0x27,
- 0x21, 0x24, 0x26, 0x27,
- 0x21, 0x22, 0x26, 0x27,
- 0x21, 0x22, 0x24, 0x27,
- 0x21, 0x27, 0x27, 0x27,
- 0x21, 0x21, 0x27, 0x27,
- 0x21, 0x21, 0x21, 0x27,
- 0x21, 0x24, 0x25, 0x28,
- 0x21, 0x24, 0x27, 0x28,
- 0x21, 0x22, 0x27, 0x28,
- 0x21, 0x22, 0x25, 0x28,
- 0x21, 0x24, 0x26, 0x29,
- 0x21, 0x25, 0x27, 0x29,
- 0x21, 0x23, 0x27, 0x29,
- 0x21, 0x23, 0x25, 0x29,
- 0x21, 0x29, 0x29, 0x29,
- 0x21, 0x21, 0x29, 0x29,
- 0x21, 0x21, 0x21, 0x29,
- 0x21, 0x25, 0x28, 0x2C,
- 0x21, 0x26, 0x2A, 0x2C,
- 0x21, 0x23, 0x2A, 0x2C,
- 0x21, 0x23, 0x27, 0x2C,
- 0x21, 0x2C, 0x2C, 0x2C,
- 0x21, 0x21, 0x2C, 0x2C,
- 0x21, 0x21, 0x21, 0x2C,
- 0x21, 0x26, 0x2A, 0x2F,
- 0x21, 0x28, 0x2C, 0x2F,
- 0x21, 0x24, 0x2C, 0x2F,
- 0x21, 0x24, 0x28, 0x2F,
- 0x21, 0x2F, 0x2F, 0x2F,
- 0x21, 0x21, 0x2F, 0x2F,
- 0x21, 0x21, 0x21, 0x2F,
- 0x21, 0x27, 0x2C, 0x32,
- 0x21, 0x29, 0x2E, 0x32,
- 0x21, 0x25, 0x2E, 0x32,
- 0x21, 0x25, 0x2A, 0x32,
- 0x21, 0x32, 0x32, 0x32,
- 0x21, 0x21, 0x32, 0x32,
- 0x21, 0x21, 0x21, 0x32,
- 0x21, 0x28, 0x2E, 0x35,
- 0x21, 0x2B, 0x30, 0x35,
- 0x21, 0x26, 0x30, 0x35,
- 0x21, 0x26, 0x2B, 0x35,
- 0x21, 0x35, 0x35, 0x35,
- 0x21, 0x21, 0x35, 0x35,
- 0x21, 0x21, 0x21, 0x35,
- 0x21, 0x2C, 0x33, 0x38,
- 0x21, 0x26, 0x33, 0x38,
- 0x21, 0x26, 0x2D, 0x38,
- 0x21, 0x38, 0x38, 0x38,
- 0x21, 0x21, 0x38, 0x38,
- 0x21, 0x21, 0x21, 0x38,
- 0x21, 0x2E, 0x35, 0x3B,
- 0x21, 0x27, 0x35, 0x3B,
- 0x21, 0x27, 0x2E, 0x3B,
- 0x21, 0x3B, 0x3B, 0x3B,
- 0x21, 0x21, 0x3B, 0x3B,
- 0x21, 0x21, 0x21, 0x3B,
- 0x21, 0x2F, 0x37, 0x3E,
- 0x21, 0x28, 0x37, 0x3E,
- 0x21, 0x28, 0x30, 0x3E,
- 0x21, 0x3E, 0x3E, 0x3E,
- 0x21, 0x21, 0x3E, 0x3E,
- 0x21, 0x21, 0x21, 0x3E,
- 0x22, 0x23, 0x23, 0x24,
- 0x22, 0x23, 0x24, 0x25,
- 0x22, 0x24, 0x25, 0x26,
- 0x22, 0x23, 0x25, 0x26,
- 0x22, 0x23, 0x24, 0x26,
- 0x22, 0x24, 0x25, 0x27,
- 0x22, 0x24, 0x26, 0x27,
- 0x22, 0x23, 0x26, 0x27,
- 0x22, 0x23, 0x25, 0x27,
- 0x22, 0x24, 0x26, 0x28,
- 0x22, 0x25, 0x27, 0x28,
- 0x22, 0x23, 0x27, 0x28,
- 0x22, 0x23, 0x25, 0x28,
- 0x22, 0x28, 0x28, 0x28,
- 0x22, 0x22, 0x28, 0x28,
- 0x22, 0x22, 0x22, 0x28,
- 0x22, 0x25, 0x26, 0x29,
- 0x22, 0x25, 0x28, 0x29,
- 0x22, 0x23, 0x28, 0x29,
- 0x22, 0x23, 0x26, 0x29,
- 0x22, 0x25, 0x27, 0x2A,
- 0x22, 0x26, 0x28, 0x2A,
- 0x22, 0x24, 0x28, 0x2A,
- 0x22, 0x24, 0x26, 0x2A,
- 0x22, 0x2A, 0x2A, 0x2A,
- 0x22, 0x22, 0x2A, 0x2A,
- 0x22, 0x22, 0x22, 0x2A,
- 0x22, 0x26, 0x29, 0x2D,
- 0x22, 0x27, 0x2B, 0x2D,
- 0x22, 0x24, 0x2B, 0x2D,
- 0x22, 0x24, 0x28, 0x2D,
- 0x22, 0x2D, 0x2D, 0x2D,
- 0x22, 0x22, 0x2D, 0x2D,
- 0x22, 0x22, 0x22, 0x2D,
- 0x22, 0x27, 0x2B, 0x30,
- 0x22, 0x29, 0x2D, 0x30,
- 0x22, 0x25, 0x2D, 0x30,
- 0x22, 0x25, 0x29, 0x30,
- 0x22, 0x30, 0x30, 0x30,
- 0x22, 0x22, 0x30, 0x30,
- 0x22, 0x22, 0x22, 0x30,
- 0x22, 0x28, 0x2D, 0x33,
- 0x22, 0x2A, 0x2F, 0x33,
- 0x22, 0x26, 0x2F, 0x33,
- 0x22, 0x26, 0x2B, 0x33,
- 0x22, 0x33, 0x33, 0x33,
- 0x22, 0x22, 0x33, 0x33,
- 0x22, 0x22, 0x22, 0x33,
- 0x22, 0x29, 0x2F, 0x36,
- 0x22, 0x2C, 0x31, 0x36,
- 0x22, 0x27, 0x31, 0x36,
- 0x22, 0x27, 0x2C, 0x36,
- 0x22, 0x36, 0x36, 0x36,
- 0x22, 0x22, 0x36, 0x36,
- 0x22, 0x22, 0x22, 0x36,
- 0x22, 0x2D, 0x34, 0x39,
- 0x22, 0x27, 0x34, 0x39,
- 0x22, 0x27, 0x2E, 0x39,
- 0x22, 0x39, 0x39, 0x39,
- 0x22, 0x22, 0x39, 0x39,
- 0x22, 0x22, 0x22, 0x39,
- 0x22, 0x2F, 0x36, 0x3C,
- 0x22, 0x28, 0x36, 0x3C,
- 0x22, 0x28, 0x2F, 0x3C,
- 0x22, 0x3C, 0x3C, 0x3C,
- 0x22, 0x22, 0x3C, 0x3C,
- 0x22, 0x22, 0x22, 0x3C,
- 0x22, 0x30, 0x38, 0x3F,
- 0x22, 0x29, 0x38, 0x3F,
- 0x22, 0x29, 0x31, 0x3F,
- 0x22, 0x3F, 0x3F, 0x3F,
- 0x22, 0x22, 0x3F, 0x3F,
- 0x22, 0x22, 0x22, 0x3F,
- 0x23, 0x24, 0x24, 0x25,
- 0x23, 0x24, 0x25, 0x26,
- 0x23, 0x25, 0x26, 0x27,
- 0x23, 0x24, 0x26, 0x27,
- 0x23, 0x24, 0x25, 0x27,
- 0x23, 0x25, 0x26, 0x28,
- 0x23, 0x25, 0x27, 0x28,
- 0x23, 0x24, 0x27, 0x28,
- 0x23, 0x24, 0x26, 0x28,
- 0x23, 0x25, 0x27, 0x29,
- 0x23, 0x26, 0x28, 0x29,
- 0x23, 0x24, 0x28, 0x29,
- 0x23, 0x24, 0x26, 0x29,
- 0x23, 0x29, 0x29, 0x29,
- 0x23, 0x23, 0x29, 0x29,
- 0x23, 0x23, 0x23, 0x29,
- 0x23, 0x26, 0x27, 0x2A,
- 0x23, 0x26, 0x29, 0x2A,
- 0x23, 0x24, 0x29, 0x2A,
- 0x23, 0x24, 0x27, 0x2A,
- 0x23, 0x26, 0x28, 0x2B,
- 0x23, 0x27, 0x29, 0x2B,
- 0x23, 0x25, 0x29, 0x2B,
- 0x23, 0x25, 0x27, 0x2B,
- 0x23, 0x2B, 0x2B, 0x2B,
- 0x23, 0x23, 0x2B, 0x2B,
- 0x23, 0x23, 0x23, 0x2B,
- 0x23, 0x27, 0x2A, 0x2E,
- 0x23, 0x28, 0x2C, 0x2E,
- 0x23, 0x25, 0x2C, 0x2E,
- 0x23, 0x25, 0x29, 0x2E,
- 0x23, 0x2E, 0x2E, 0x2E,
- 0x23, 0x23, 0x2E, 0x2E,
- 0x23, 0x23, 0x23, 0x2E,
- 0x23, 0x28, 0x2C, 0x31,
- 0x23, 0x2A, 0x2E, 0x31,
- 0x23, 0x26, 0x2E, 0x31,
- 0x23, 0x26, 0x2A, 0x31,
- 0x23, 0x31, 0x31, 0x31,
- 0x23, 0x23, 0x31, 0x31,
- 0x23, 0x23, 0x23, 0x31,
- 0x23, 0x29, 0x2E, 0x34,
- 0x23, 0x2B, 0x30, 0x34,
- 0x23, 0x27, 0x30, 0x34,
- 0x23, 0x27, 0x2C, 0x34,
- 0x23, 0x34, 0x34, 0x34,
- 0x23, 0x23, 0x34, 0x34,
- 0x23, 0x23, 0x23, 0x34,
- 0x23, 0x2A, 0x30, 0x37,
- 0x23, 0x2D, 0x32, 0x37,
- 0x23, 0x28, 0x32, 0x37,
- 0x23, 0x28, 0x2D, 0x37,
- 0x23, 0x37, 0x37, 0x37,
- 0x23, 0x23, 0x37, 0x37,
- 0x23, 0x23, 0x23, 0x37,
- 0x23, 0x2E, 0x35, 0x3A,
- 0x23, 0x28, 0x35, 0x3A,
- 0x23, 0x28, 0x2F, 0x3A,
- 0x23, 0x3A, 0x3A, 0x3A,
- 0x23, 0x23, 0x3A, 0x3A,
- 0x23, 0x23, 0x23, 0x3A,
- 0x23, 0x30, 0x37, 0x3D,
- 0x23, 0x29, 0x37, 0x3D,
- 0x23, 0x29, 0x30, 0x3D,
- 0x23, 0x3D, 0x3D, 0x3D,
- 0x23, 0x23, 0x3D, 0x3D,
- 0x23, 0x23, 0x23, 0x3D,
- 0x24, 0x25, 0x25, 0x26,
- 0x24, 0x25, 0x26, 0x27,
- 0x24, 0x26, 0x27, 0x28,
- 0x24, 0x25, 0x27, 0x28,
- 0x24, 0x25, 0x26, 0x28,
- 0x24, 0x26, 0x27, 0x29,
- 0x24, 0x26, 0x28, 0x29,
- 0x24, 0x25, 0x28, 0x29,
- 0x24, 0x25, 0x27, 0x29,
- 0x24, 0x26, 0x28, 0x2A,
- 0x24, 0x27, 0x29, 0x2A,
- 0x24, 0x25, 0x29, 0x2A,
- 0x24, 0x25, 0x27, 0x2A,
- 0x24, 0x2A, 0x2A, 0x2A,
- 0x24, 0x24, 0x2A, 0x2A,
- 0x24, 0x24, 0x24, 0x2A,
- 0x24, 0x27, 0x28, 0x2B,
- 0x24, 0x27, 0x2A, 0x2B,
- 0x24, 0x25, 0x2A, 0x2B,
- 0x24, 0x25, 0x28, 0x2B,
- 0x24, 0x27, 0x29, 0x2C,
- 0x24, 0x28, 0x2A, 0x2C,
- 0x24, 0x26, 0x2A, 0x2C,
- 0x24, 0x26, 0x28, 0x2C,
- 0x24, 0x2C, 0x2C, 0x2C,
- 0x24, 0x24, 0x2C, 0x2C,
- 0x24, 0x24, 0x24, 0x2C,
- 0x24, 0x28, 0x2B, 0x2F,
- 0x24, 0x29, 0x2D, 0x2F,
- 0x24, 0x26, 0x2D, 0x2F,
- 0x24, 0x26, 0x2A, 0x2F,
- 0x24, 0x2F, 0x2F, 0x2F,
- 0x24, 0x24, 0x2F, 0x2F,
- 0x24, 0x24, 0x24, 0x2F,
- 0x24, 0x29, 0x2D, 0x32,
- 0x24, 0x2B, 0x2F, 0x32,
- 0x24, 0x27, 0x2F, 0x32,
- 0x24, 0x27, 0x2B, 0x32,
- 0x24, 0x32, 0x32, 0x32,
- 0x24, 0x24, 0x32, 0x32,
- 0x24, 0x24, 0x24, 0x32,
- 0x24, 0x2A, 0x2F, 0x35,
- 0x24, 0x2C, 0x31, 0x35,
- 0x24, 0x28, 0x31, 0x35,
- 0x24, 0x28, 0x2D, 0x35,
- 0x24, 0x35, 0x35, 0x35,
- 0x24, 0x24, 0x35, 0x35,
- 0x24, 0x24, 0x24, 0x35,
- 0x24, 0x2B, 0x31, 0x38,
- 0x24, 0x2E, 0x33, 0x38,
- 0x24, 0x29, 0x33, 0x38,
- 0x24, 0x29, 0x2E, 0x38,
- 0x24, 0x38, 0x38, 0x38,
- 0x24, 0x24, 0x38, 0x38,
- 0x24, 0x24, 0x24, 0x38,
- 0x24, 0x2F, 0x36, 0x3B,
- 0x24, 0x29, 0x36, 0x3B,
- 0x24, 0x29, 0x30, 0x3B,
- 0x24, 0x3B, 0x3B, 0x3B,
- 0x24, 0x24, 0x3B, 0x3B,
- 0x24, 0x24, 0x24, 0x3B,
- 0x24, 0x31, 0x38, 0x3E,
- 0x24, 0x2A, 0x38, 0x3E,
- 0x24, 0x2A, 0x31, 0x3E,
- 0x24, 0x3E, 0x3E, 0x3E,
- 0x24, 0x24, 0x3E, 0x3E,
- 0x24, 0x24, 0x24, 0x3E,
- 0x25, 0x26, 0x26, 0x27,
- 0x25, 0x26, 0x27, 0x28,
- 0x25, 0x27, 0x28, 0x29,
- 0x25, 0x26, 0x28, 0x29,
- 0x25, 0x26, 0x27, 0x29,
- 0x25, 0x27, 0x28, 0x2A,
- 0x25, 0x27, 0x29, 0x2A,
- 0x25, 0x26, 0x29, 0x2A,
- 0x25, 0x26, 0x28, 0x2A,
- 0x25, 0x27, 0x29, 0x2B,
- 0x25, 0x28, 0x2A, 0x2B,
- 0x25, 0x26, 0x2A, 0x2B,
- 0x25, 0x26, 0x28, 0x2B,
- 0x25, 0x2B, 0x2B, 0x2B,
- 0x25, 0x25, 0x2B, 0x2B,
- 0x25, 0x25, 0x25, 0x2B,
- 0x25, 0x28, 0x29, 0x2C,
- 0x25, 0x28, 0x2B, 0x2C,
- 0x25, 0x26, 0x2B, 0x2C,
- 0x25, 0x26, 0x29, 0x2C,
- 0x25, 0x28, 0x2A, 0x2D,
- 0x25, 0x29, 0x2B, 0x2D,
- 0x25, 0x27, 0x2B, 0x2D,
- 0x25, 0x27, 0x29, 0x2D,
- 0x25, 0x2D, 0x2D, 0x2D,
- 0x25, 0x25, 0x2D, 0x2D,
- 0x25, 0x25, 0x25, 0x2D,
- 0x25, 0x29, 0x2C, 0x30,
- 0x25, 0x2A, 0x2E, 0x30,
- 0x25, 0x27, 0x2E, 0x30,
- 0x25, 0x27, 0x2B, 0x30,
- 0x25, 0x30, 0x30, 0x30,
- 0x25, 0x25, 0x30, 0x30,
- 0x25, 0x25, 0x25, 0x30,
- 0x25, 0x2A, 0x2E, 0x33,
- 0x25, 0x2C, 0x30, 0x33,
- 0x25, 0x28, 0x30, 0x33,
- 0x25, 0x28, 0x2C, 0x33,
- 0x25, 0x33, 0x33, 0x33,
- 0x25, 0x25, 0x33, 0x33,
- 0x25, 0x25, 0x25, 0x33,
- 0x25, 0x2B, 0x30, 0x36,
- 0x25, 0x2D, 0x32, 0x36,
- 0x25, 0x29, 0x32, 0x36,
- 0x25, 0x29, 0x2E, 0x36,
- 0x25, 0x36, 0x36, 0x36,
- 0x25, 0x25, 0x36, 0x36,
- 0x25, 0x25, 0x25, 0x36,
- 0x25, 0x2C, 0x32, 0x39,
- 0x25, 0x2F, 0x34, 0x39,
- 0x25, 0x2A, 0x34, 0x39,
- 0x25, 0x2A, 0x2F, 0x39,
- 0x25, 0x39, 0x39, 0x39,
- 0x25, 0x25, 0x39, 0x39,
- 0x25, 0x25, 0x25, 0x39,
- 0x25, 0x30, 0x37, 0x3C,
- 0x25, 0x2A, 0x37, 0x3C,
- 0x25, 0x2A, 0x31, 0x3C,
- 0x25, 0x3C, 0x3C, 0x3C,
- 0x25, 0x25, 0x3C, 0x3C,
- 0x25, 0x25, 0x25, 0x3C,
- 0x25, 0x32, 0x39, 0x3F,
- 0x25, 0x2B, 0x39, 0x3F,
- 0x25, 0x2B, 0x32, 0x3F,
- 0x25, 0x3F, 0x3F, 0x3F,
- 0x25, 0x25, 0x3F, 0x3F,
- 0x25, 0x25, 0x25, 0x3F,
- 0x26, 0x27, 0x27, 0x28,
- 0x26, 0x27, 0x28, 0x29,
- 0x26, 0x28, 0x29, 0x2A,
- 0x26, 0x27, 0x29, 0x2A,
- 0x26, 0x27, 0x28, 0x2A,
- 0x26, 0x28, 0x29, 0x2B,
- 0x26, 0x28, 0x2A, 0x2B,
- 0x26, 0x27, 0x2A, 0x2B,
- 0x26, 0x27, 0x29, 0x2B,
- 0x26, 0x28, 0x2A, 0x2C,
- 0x26, 0x29, 0x2B, 0x2C,
- 0x26, 0x27, 0x2B, 0x2C,
- 0x26, 0x27, 0x29, 0x2C,
- 0x26, 0x2C, 0x2C, 0x2C,
- 0x26, 0x26, 0x2C, 0x2C,
- 0x26, 0x26, 0x26, 0x2C,
- 0x26, 0x29, 0x2A, 0x2D,
- 0x26, 0x29, 0x2C, 0x2D,
- 0x26, 0x27, 0x2C, 0x2D,
- 0x26, 0x27, 0x2A, 0x2D,
- 0x26, 0x29, 0x2B, 0x2E,
- 0x26, 0x2A, 0x2C, 0x2E,
- 0x26, 0x28, 0x2C, 0x2E,
- 0x26, 0x28, 0x2A, 0x2E,
- 0x26, 0x2E, 0x2E, 0x2E,
- 0x26, 0x26, 0x2E, 0x2E,
- 0x26, 0x26, 0x26, 0x2E,
- 0x26, 0x2A, 0x2D, 0x31,
- 0x26, 0x2B, 0x2F, 0x31,
- 0x26, 0x28, 0x2F, 0x31,
- 0x26, 0x28, 0x2C, 0x31,
- 0x26, 0x31, 0x31, 0x31,
- 0x26, 0x26, 0x31, 0x31,
- 0x26, 0x26, 0x26, 0x31,
- 0x26, 0x2B, 0x2F, 0x34,
- 0x26, 0x2D, 0x31, 0x34,
- 0x26, 0x29, 0x31, 0x34,
- 0x26, 0x29, 0x2D, 0x34,
- 0x26, 0x34, 0x34, 0x34,
- 0x26, 0x26, 0x34, 0x34,
- 0x26, 0x26, 0x26, 0x34,
- 0x26, 0x2C, 0x31, 0x37,
- 0x26, 0x2E, 0x33, 0x37,
- 0x26, 0x2A, 0x33, 0x37,
- 0x26, 0x2A, 0x2F, 0x37,
- 0x26, 0x37, 0x37, 0x37,
- 0x26, 0x26, 0x37, 0x37,
- 0x26, 0x26, 0x26, 0x37,
- 0x26, 0x2D, 0x33, 0x3A,
- 0x26, 0x30, 0x35, 0x3A,
- 0x26, 0x2B, 0x35, 0x3A,
- 0x26, 0x2B, 0x30, 0x3A,
- 0x26, 0x3A, 0x3A, 0x3A,
- 0x26, 0x26, 0x3A, 0x3A,
- 0x26, 0x26, 0x26, 0x3A,
- 0x26, 0x31, 0x38, 0x3D,
- 0x26, 0x2B, 0x38, 0x3D,
- 0x26, 0x2B, 0x32, 0x3D,
- 0x26, 0x3D, 0x3D, 0x3D,
- 0x26, 0x26, 0x3D, 0x3D,
- 0x26, 0x26, 0x26, 0x3D,
- 0x27, 0x28, 0x28, 0x29,
- 0x27, 0x28, 0x29, 0x2A,
- 0x27, 0x29, 0x2A, 0x2B,
- 0x27, 0x28, 0x2A, 0x2B,
- 0x27, 0x28, 0x29, 0x2B,
- 0x27, 0x29, 0x2A, 0x2C,
- 0x27, 0x29, 0x2B, 0x2C,
- 0x27, 0x28, 0x2B, 0x2C,
- 0x27, 0x28, 0x2A, 0x2C,
- 0x27, 0x29, 0x2B, 0x2D,
- 0x27, 0x2A, 0x2C, 0x2D,
- 0x27, 0x28, 0x2C, 0x2D,
- 0x27, 0x28, 0x2A, 0x2D,
- 0x27, 0x2D, 0x2D, 0x2D,
- 0x27, 0x27, 0x2D, 0x2D,
- 0x27, 0x27, 0x27, 0x2D,
- 0x27, 0x2A, 0x2B, 0x2E,
- 0x27, 0x2A, 0x2D, 0x2E,
- 0x27, 0x28, 0x2D, 0x2E,
- 0x27, 0x28, 0x2B, 0x2E,
- 0x27, 0x2A, 0x2C, 0x2F,
- 0x27, 0x2B, 0x2D, 0x2F,
- 0x27, 0x29, 0x2D, 0x2F,
- 0x27, 0x29, 0x2B, 0x2F,
- 0x27, 0x2F, 0x2F, 0x2F,
- 0x27, 0x27, 0x2F, 0x2F,
- 0x27, 0x27, 0x27, 0x2F,
- 0x27, 0x2B, 0x2E, 0x32,
- 0x27, 0x2C, 0x30, 0x32,
- 0x27, 0x29, 0x30, 0x32,
- 0x27, 0x29, 0x2D, 0x32,
- 0x27, 0x32, 0x32, 0x32,
- 0x27, 0x27, 0x32, 0x32,
- 0x27, 0x27, 0x27, 0x32,
- 0x27, 0x2C, 0x30, 0x35,
- 0x27, 0x2E, 0x32, 0x35,
- 0x27, 0x2A, 0x32, 0x35,
- 0x27, 0x2A, 0x2E, 0x35,
- 0x27, 0x35, 0x35, 0x35,
- 0x27, 0x27, 0x35, 0x35,
- 0x27, 0x27, 0x27, 0x35,
- 0x27, 0x2D, 0x32, 0x38,
- 0x27, 0x2F, 0x34, 0x38,
- 0x27, 0x2B, 0x34, 0x38,
- 0x27, 0x2B, 0x30, 0x38,
- 0x27, 0x38, 0x38, 0x38,
- 0x27, 0x27, 0x38, 0x38,
- 0x27, 0x27, 0x27, 0x38,
- 0x27, 0x2E, 0x34, 0x3B,
- 0x27, 0x31, 0x36, 0x3B,
- 0x27, 0x2C, 0x36, 0x3B,
- 0x27, 0x2C, 0x31, 0x3B,
- 0x27, 0x3B, 0x3B, 0x3B,
- 0x27, 0x27, 0x3B, 0x3B,
- 0x27, 0x27, 0x27, 0x3B,
- 0x27, 0x32, 0x39, 0x3E,
- 0x27, 0x2C, 0x39, 0x3E,
- 0x27, 0x2C, 0x33, 0x3E,
- 0x27, 0x3E, 0x3E, 0x3E,
- 0x27, 0x27, 0x3E, 0x3E,
- 0x27, 0x27, 0x27, 0x3E,
- 0x28, 0x29, 0x29, 0x2A,
- 0x28, 0x29, 0x2A, 0x2B,
- 0x28, 0x2A, 0x2B, 0x2C,
- 0x28, 0x29, 0x2B, 0x2C,
- 0x28, 0x29, 0x2A, 0x2C,
- 0x28, 0x2A, 0x2B, 0x2D,
- 0x28, 0x2A, 0x2C, 0x2D,
- 0x28, 0x29, 0x2C, 0x2D,
- 0x28, 0x29, 0x2B, 0x2D,
- 0x28, 0x2A, 0x2C, 0x2E,
- 0x28, 0x2B, 0x2D, 0x2E,
- 0x28, 0x29, 0x2D, 0x2E,
- 0x28, 0x29, 0x2B, 0x2E,
- 0x28, 0x2E, 0x2E, 0x2E,
- 0x28, 0x28, 0x2E, 0x2E,
- 0x28, 0x28, 0x28, 0x2E,
- 0x28, 0x2B, 0x2C, 0x2F,
- 0x28, 0x2B, 0x2E, 0x2F,
- 0x28, 0x29, 0x2E, 0x2F,
- 0x28, 0x29, 0x2C, 0x2F,
- 0x28, 0x2B, 0x2D, 0x30,
- 0x28, 0x2C, 0x2E, 0x30,
- 0x28, 0x2A, 0x2E, 0x30,
- 0x28, 0x2A, 0x2C, 0x30,
- 0x28, 0x30, 0x30, 0x30,
- 0x28, 0x28, 0x30, 0x30,
- 0x28, 0x28, 0x28, 0x30,
- 0x28, 0x2C, 0x2F, 0x33,
- 0x28, 0x2D, 0x31, 0x33,
- 0x28, 0x2A, 0x31, 0x33,
- 0x28, 0x2A, 0x2E, 0x33,
- 0x28, 0x33, 0x33, 0x33,
- 0x28, 0x28, 0x33, 0x33,
- 0x28, 0x28, 0x28, 0x33,
- 0x28, 0x2D, 0x31, 0x36,
- 0x28, 0x2F, 0x33, 0x36,
- 0x28, 0x2B, 0x33, 0x36,
- 0x28, 0x2B, 0x2F, 0x36,
- 0x28, 0x36, 0x36, 0x36,
- 0x28, 0x28, 0x36, 0x36,
- 0x28, 0x28, 0x28, 0x36,
- 0x28, 0x2E, 0x33, 0x39,
- 0x28, 0x30, 0x35, 0x39,
- 0x28, 0x2C, 0x35, 0x39,
- 0x28, 0x2C, 0x31, 0x39,
- 0x28, 0x39, 0x39, 0x39,
- 0x28, 0x28, 0x39, 0x39,
- 0x28, 0x28, 0x28, 0x39,
- 0x28, 0x2F, 0x35, 0x3C,
- 0x28, 0x32, 0x37, 0x3C,
- 0x28, 0x2D, 0x37, 0x3C,
- 0x28, 0x2D, 0x32, 0x3C,
- 0x28, 0x3C, 0x3C, 0x3C,
- 0x28, 0x28, 0x3C, 0x3C,
- 0x28, 0x28, 0x28, 0x3C,
- 0x28, 0x33, 0x3A, 0x3F,
- 0x28, 0x2D, 0x3A, 0x3F,
- 0x28, 0x2D, 0x34, 0x3F,
- 0x28, 0x3F, 0x3F, 0x3F,
- 0x28, 0x28, 0x3F, 0x3F,
- 0x28, 0x28, 0x28, 0x3F,
- 0x29, 0x2A, 0x2A, 0x2B,
- 0x29, 0x2A, 0x2B, 0x2C,
- 0x29, 0x2B, 0x2C, 0x2D,
- 0x29, 0x2A, 0x2C, 0x2D,
- 0x29, 0x2A, 0x2B, 0x2D,
- 0x29, 0x2B, 0x2C, 0x2E,
- 0x29, 0x2B, 0x2D, 0x2E,
- 0x29, 0x2A, 0x2D, 0x2E,
- 0x29, 0x2A, 0x2C, 0x2E,
- 0x29, 0x2B, 0x2D, 0x2F,
- 0x29, 0x2C, 0x2E, 0x2F,
- 0x29, 0x2A, 0x2E, 0x2F,
- 0x29, 0x2A, 0x2C, 0x2F,
- 0x29, 0x2F, 0x2F, 0x2F,
- 0x29, 0x29, 0x2F, 0x2F,
- 0x29, 0x29, 0x29, 0x2F,
- 0x29, 0x2C, 0x2D, 0x30,
- 0x29, 0x2C, 0x2F, 0x30,
- 0x29, 0x2A, 0x2F, 0x30,
- 0x29, 0x2A, 0x2D, 0x30,
- 0x29, 0x2C, 0x2E, 0x31,
- 0x29, 0x2D, 0x2F, 0x31,
- 0x29, 0x2B, 0x2F, 0x31,
- 0x29, 0x2B, 0x2D, 0x31,
- 0x29, 0x31, 0x31, 0x31,
- 0x29, 0x29, 0x31, 0x31,
- 0x29, 0x29, 0x29, 0x31,
- 0x29, 0x2D, 0x30, 0x34,
- 0x29, 0x2E, 0x32, 0x34,
- 0x29, 0x2B, 0x32, 0x34,
- 0x29, 0x2B, 0x2F, 0x34,
- 0x29, 0x34, 0x34, 0x34,
- 0x29, 0x29, 0x34, 0x34,
- 0x29, 0x29, 0x29, 0x34,
- 0x29, 0x2E, 0x32, 0x37,
- 0x29, 0x30, 0x34, 0x37,
- 0x29, 0x2C, 0x34, 0x37,
- 0x29, 0x2C, 0x30, 0x37,
- 0x29, 0x37, 0x37, 0x37,
- 0x29, 0x29, 0x37, 0x37,
- 0x29, 0x29, 0x29, 0x37,
- 0x29, 0x2F, 0x34, 0x3A,
- 0x29, 0x31, 0x36, 0x3A,
- 0x29, 0x2D, 0x36, 0x3A,
- 0x29, 0x2D, 0x32, 0x3A,
- 0x29, 0x3A, 0x3A, 0x3A,
- 0x29, 0x29, 0x3A, 0x3A,
- 0x29, 0x29, 0x29, 0x3A,
- 0x29, 0x30, 0x36, 0x3D,
- 0x29, 0x33, 0x38, 0x3D,
- 0x29, 0x2E, 0x38, 0x3D,
- 0x29, 0x2E, 0x33, 0x3D,
- 0x29, 0x3D, 0x3D, 0x3D,
- 0x29, 0x29, 0x3D, 0x3D,
- 0x29, 0x29, 0x29, 0x3D,
- 0x2A, 0x2B, 0x2B, 0x2C,
- 0x2A, 0x2B, 0x2C, 0x2D,
- 0x2A, 0x2C, 0x2D, 0x2E,
- 0x2A, 0x2B, 0x2D, 0x2E,
- 0x2A, 0x2B, 0x2C, 0x2E,
- 0x2A, 0x2C, 0x2D, 0x2F,
- 0x2A, 0x2C, 0x2E, 0x2F,
- 0x2A, 0x2B, 0x2E, 0x2F,
- 0x2A, 0x2B, 0x2D, 0x2F,
- 0x2A, 0x2C, 0x2E, 0x30,
- 0x2A, 0x2D, 0x2F, 0x30,
- 0x2A, 0x2B, 0x2F, 0x30,
- 0x2A, 0x2B, 0x2D, 0x30,
- 0x2A, 0x30, 0x30, 0x30,
- 0x2A, 0x2A, 0x30, 0x30,
- 0x2A, 0x2A, 0x2A, 0x30,
- 0x2A, 0x2D, 0x2E, 0x31,
- 0x2A, 0x2D, 0x30, 0x31,
- 0x2A, 0x2B, 0x30, 0x31,
- 0x2A, 0x2B, 0x2E, 0x31,
- 0x2A, 0x2D, 0x2F, 0x32,
- 0x2A, 0x2E, 0x30, 0x32,
- 0x2A, 0x2C, 0x30, 0x32,
- 0x2A, 0x2C, 0x2E, 0x32,
- 0x2A, 0x32, 0x32, 0x32,
- 0x2A, 0x2A, 0x32, 0x32,
- 0x2A, 0x2A, 0x2A, 0x32,
- 0x2A, 0x2E, 0x31, 0x35,
- 0x2A, 0x2F, 0x33, 0x35,
- 0x2A, 0x2C, 0x33, 0x35,
- 0x2A, 0x2C, 0x30, 0x35,
- 0x2A, 0x35, 0x35, 0x35,
- 0x2A, 0x2A, 0x35, 0x35,
- 0x2A, 0x2A, 0x2A, 0x35,
- 0x2A, 0x2F, 0x33, 0x38,
- 0x2A, 0x31, 0x35, 0x38,
- 0x2A, 0x2D, 0x35, 0x38,
- 0x2A, 0x2D, 0x31, 0x38,
- 0x2A, 0x38, 0x38, 0x38,
- 0x2A, 0x2A, 0x38, 0x38,
- 0x2A, 0x2A, 0x2A, 0x38,
- 0x2A, 0x30, 0x35, 0x3B,
- 0x2A, 0x32, 0x37, 0x3B,
- 0x2A, 0x2E, 0x37, 0x3B,
- 0x2A, 0x2E, 0x33, 0x3B,
- 0x2A, 0x3B, 0x3B, 0x3B,
- 0x2A, 0x2A, 0x3B, 0x3B,
- 0x2A, 0x2A, 0x2A, 0x3B,
- 0x2A, 0x31, 0x37, 0x3E,
- 0x2A, 0x34, 0x39, 0x3E,
- 0x2A, 0x2F, 0x39, 0x3E,
- 0x2A, 0x2F, 0x34, 0x3E,
- 0x2A, 0x3E, 0x3E, 0x3E,
- 0x2A, 0x2A, 0x3E, 0x3E,
- 0x2A, 0x2A, 0x2A, 0x3E,
- 0x2B, 0x2C, 0x2C, 0x2D,
- 0x2B, 0x2C, 0x2D, 0x2E,
- 0x2B, 0x2D, 0x2E, 0x2F,
- 0x2B, 0x2C, 0x2E, 0x2F,
- 0x2B, 0x2C, 0x2D, 0x2F,
- 0x2B, 0x2D, 0x2E, 0x30,
- 0x2B, 0x2D, 0x2F, 0x30,
- 0x2B, 0x2C, 0x2F, 0x30,
- 0x2B, 0x2C, 0x2E, 0x30,
- 0x2B, 0x2D, 0x2F, 0x31,
- 0x2B, 0x2E, 0x30, 0x31,
- 0x2B, 0x2C, 0x30, 0x31,
- 0x2B, 0x2C, 0x2E, 0x31,
- 0x2B, 0x31, 0x31, 0x31,
- 0x2B, 0x2B, 0x31, 0x31,
- 0x2B, 0x2B, 0x2B, 0x31,
- 0x2B, 0x2E, 0x2F, 0x32,
- 0x2B, 0x2E, 0x31, 0x32,
- 0x2B, 0x2C, 0x31, 0x32,
- 0x2B, 0x2C, 0x2F, 0x32,
- 0x2B, 0x2E, 0x30, 0x33,
- 0x2B, 0x2F, 0x31, 0x33,
- 0x2B, 0x2D, 0x31, 0x33,
- 0x2B, 0x2D, 0x2F, 0x33,
- 0x2B, 0x33, 0x33, 0x33,
- 0x2B, 0x2B, 0x33, 0x33,
- 0x2B, 0x2B, 0x2B, 0x33,
- 0x2B, 0x2F, 0x32, 0x36,
- 0x2B, 0x30, 0x34, 0x36,
- 0x2B, 0x2D, 0x34, 0x36,
- 0x2B, 0x2D, 0x31, 0x36,
- 0x2B, 0x36, 0x36, 0x36,
- 0x2B, 0x2B, 0x36, 0x36,
- 0x2B, 0x2B, 0x2B, 0x36,
- 0x2B, 0x30, 0x34, 0x39,
- 0x2B, 0x32, 0x36, 0x39,
- 0x2B, 0x2E, 0x36, 0x39,
- 0x2B, 0x2E, 0x32, 0x39,
- 0x2B, 0x39, 0x39, 0x39,
- 0x2B, 0x2B, 0x39, 0x39,
- 0x2B, 0x2B, 0x2B, 0x39,
- 0x2B, 0x31, 0x36, 0x3C,
- 0x2B, 0x33, 0x38, 0x3C,
- 0x2B, 0x2F, 0x38, 0x3C,
- 0x2B, 0x2F, 0x34, 0x3C,
- 0x2B, 0x3C, 0x3C, 0x3C,
- 0x2B, 0x2B, 0x3C, 0x3C,
- 0x2B, 0x2B, 0x2B, 0x3C,
- 0x2B, 0x32, 0x38, 0x3F,
- 0x2B, 0x35, 0x3A, 0x3F,
- 0x2B, 0x30, 0x3A, 0x3F,
- 0x2B, 0x30, 0x35, 0x3F,
- 0x2B, 0x3F, 0x3F, 0x3F,
- 0x2B, 0x2B, 0x3F, 0x3F,
- 0x2B, 0x2B, 0x2B, 0x3F,
- 0x2C, 0x2D, 0x2D, 0x2E,
- 0x2C, 0x2D, 0x2E, 0x2F,
- 0x2C, 0x2E, 0x2F, 0x30,
- 0x2C, 0x2D, 0x2F, 0x30,
- 0x2C, 0x2D, 0x2E, 0x30,
- 0x2C, 0x2E, 0x2F, 0x31,
- 0x2C, 0x2E, 0x30, 0x31,
- 0x2C, 0x2D, 0x30, 0x31,
- 0x2C, 0x2D, 0x2F, 0x31,
- 0x2C, 0x2E, 0x30, 0x32,
- 0x2C, 0x2F, 0x31, 0x32,
- 0x2C, 0x2D, 0x31, 0x32,
- 0x2C, 0x2D, 0x2F, 0x32,
- 0x2C, 0x32, 0x32, 0x32,
- 0x2C, 0x2C, 0x32, 0x32,
- 0x2C, 0x2C, 0x2C, 0x32,
- 0x2C, 0x2F, 0x30, 0x33,
- 0x2C, 0x2F, 0x32, 0x33,
- 0x2C, 0x2D, 0x32, 0x33,
- 0x2C, 0x2D, 0x30, 0x33,
- 0x2C, 0x2F, 0x31, 0x34,
- 0x2C, 0x30, 0x32, 0x34,
- 0x2C, 0x2E, 0x32, 0x34,
- 0x2C, 0x2E, 0x30, 0x34,
- 0x2C, 0x34, 0x34, 0x34,
- 0x2C, 0x2C, 0x34, 0x34,
- 0x2C, 0x2C, 0x2C, 0x34,
- 0x2C, 0x30, 0x33, 0x37,
- 0x2C, 0x31, 0x35, 0x37,
- 0x2C, 0x2E, 0x35, 0x37,
- 0x2C, 0x2E, 0x32, 0x37,
- 0x2C, 0x37, 0x37, 0x37,
- 0x2C, 0x2C, 0x37, 0x37,
- 0x2C, 0x2C, 0x2C, 0x37,
- 0x2C, 0x31, 0x35, 0x3A,
- 0x2C, 0x33, 0x37, 0x3A,
- 0x2C, 0x2F, 0x37, 0x3A,
- 0x2C, 0x2F, 0x33, 0x3A,
- 0x2C, 0x3A, 0x3A, 0x3A,
- 0x2C, 0x2C, 0x3A, 0x3A,
- 0x2C, 0x2C, 0x2C, 0x3A,
- 0x2C, 0x32, 0x37, 0x3D,
- 0x2C, 0x34, 0x39, 0x3D,
- 0x2C, 0x30, 0x39, 0x3D,
- 0x2C, 0x30, 0x35, 0x3D,
- 0x2C, 0x3D, 0x3D, 0x3D,
- 0x2C, 0x2C, 0x3D, 0x3D,
- 0x2C, 0x2C, 0x2C, 0x3D,
- 0x2D, 0x2E, 0x2E, 0x2F,
- 0x2D, 0x2E, 0x2F, 0x30,
- 0x2D, 0x2F, 0x30, 0x31,
- 0x2D, 0x2E, 0x30, 0x31,
- 0x2D, 0x2E, 0x2F, 0x31,
- 0x2D, 0x2F, 0x30, 0x32,
- 0x2D, 0x2F, 0x31, 0x32,
- 0x2D, 0x2E, 0x31, 0x32,
- 0x2D, 0x2E, 0x30, 0x32,
- 0x2D, 0x2F, 0x31, 0x33,
- 0x2D, 0x30, 0x32, 0x33,
- 0x2D, 0x2E, 0x32, 0x33,
- 0x2D, 0x2E, 0x30, 0x33,
- 0x2D, 0x33, 0x33, 0x33,
- 0x2D, 0x2D, 0x33, 0x33,
- 0x2D, 0x2D, 0x2D, 0x33,
- 0x2D, 0x30, 0x31, 0x34,
- 0x2D, 0x30, 0x33, 0x34,
- 0x2D, 0x2E, 0x33, 0x34,
- 0x2D, 0x2E, 0x31, 0x34,
- 0x2D, 0x30, 0x32, 0x35,
- 0x2D, 0x31, 0x33, 0x35,
- 0x2D, 0x2F, 0x33, 0x35,
- 0x2D, 0x2F, 0x31, 0x35,
- 0x2D, 0x35, 0x35, 0x35,
- 0x2D, 0x2D, 0x35, 0x35,
- 0x2D, 0x2D, 0x2D, 0x35,
- 0x2D, 0x31, 0x34, 0x38,
- 0x2D, 0x32, 0x36, 0x38,
- 0x2D, 0x2F, 0x36, 0x38,
- 0x2D, 0x2F, 0x33, 0x38,
- 0x2D, 0x38, 0x38, 0x38,
- 0x2D, 0x2D, 0x38, 0x38,
- 0x2D, 0x2D, 0x2D, 0x38,
- 0x2D, 0x32, 0x36, 0x3B,
- 0x2D, 0x34, 0x38, 0x3B,
- 0x2D, 0x30, 0x38, 0x3B,
- 0x2D, 0x30, 0x34, 0x3B,
- 0x2D, 0x3B, 0x3B, 0x3B,
- 0x2D, 0x2D, 0x3B, 0x3B,
- 0x2D, 0x2D, 0x2D, 0x3B,
- 0x2D, 0x33, 0x38, 0x3E,
- 0x2D, 0x35, 0x3A, 0x3E,
- 0x2D, 0x31, 0x3A, 0x3E,
- 0x2D, 0x31, 0x36, 0x3E,
- 0x2D, 0x3E, 0x3E, 0x3E,
- 0x2D, 0x2D, 0x3E, 0x3E,
- 0x2D, 0x2D, 0x2D, 0x3E,
- 0x2E, 0x2F, 0x2F, 0x30,
- 0x2E, 0x2F, 0x30, 0x31,
- 0x2E, 0x30, 0x31, 0x32,
- 0x2E, 0x2F, 0x31, 0x32,
- 0x2E, 0x2F, 0x30, 0x32,
- 0x2E, 0x30, 0x31, 0x33,
- 0x2E, 0x30, 0x32, 0x33,
- 0x2E, 0x2F, 0x32, 0x33,
- 0x2E, 0x2F, 0x31, 0x33,
- 0x2E, 0x30, 0x32, 0x34,
- 0x2E, 0x31, 0x33, 0x34,
- 0x2E, 0x2F, 0x33, 0x34,
- 0x2E, 0x2F, 0x31, 0x34,
- 0x2E, 0x34, 0x34, 0x34,
- 0x2E, 0x2E, 0x34, 0x34,
- 0x2E, 0x2E, 0x2E, 0x34,
- 0x2E, 0x31, 0x32, 0x35,
- 0x2E, 0x31, 0x34, 0x35,
- 0x2E, 0x2F, 0x34, 0x35,
- 0x2E, 0x2F, 0x32, 0x35,
- 0x2E, 0x31, 0x33, 0x36,
- 0x2E, 0x32, 0x34, 0x36,
- 0x2E, 0x30, 0x34, 0x36,
- 0x2E, 0x30, 0x32, 0x36,
- 0x2E, 0x36, 0x36, 0x36,
- 0x2E, 0x2E, 0x36, 0x36,
- 0x2E, 0x2E, 0x2E, 0x36,
- 0x2E, 0x32, 0x35, 0x39,
- 0x2E, 0x33, 0x37, 0x39,
- 0x2E, 0x30, 0x37, 0x39,
- 0x2E, 0x30, 0x34, 0x39,
- 0x2E, 0x39, 0x39, 0x39,
- 0x2E, 0x2E, 0x39, 0x39,
- 0x2E, 0x2E, 0x2E, 0x39,
- 0x2E, 0x33, 0x37, 0x3C,
- 0x2E, 0x35, 0x39, 0x3C,
- 0x2E, 0x31, 0x39, 0x3C,
- 0x2E, 0x31, 0x35, 0x3C,
- 0x2E, 0x3C, 0x3C, 0x3C,
- 0x2E, 0x2E, 0x3C, 0x3C,
- 0x2E, 0x2E, 0x2E, 0x3C,
- 0x2E, 0x34, 0x39, 0x3F,
- 0x2E, 0x36, 0x3B, 0x3F,
- 0x2E, 0x32, 0x3B, 0x3F,
- 0x2E, 0x32, 0x37, 0x3F,
- 0x2E, 0x3F, 0x3F, 0x3F,
- 0x2E, 0x2E, 0x3F, 0x3F,
- 0x2E, 0x2E, 0x2E, 0x3F,
- 0x2F, 0x30, 0x30, 0x31,
- 0x2F, 0x30, 0x31, 0x32,
- 0x2F, 0x31, 0x32, 0x33,
- 0x2F, 0x30, 0x32, 0x33,
- 0x2F, 0x30, 0x31, 0x33,
- 0x2F, 0x31, 0x32, 0x34,
- 0x2F, 0x31, 0x33, 0x34,
- 0x2F, 0x30, 0x33, 0x34,
- 0x2F, 0x30, 0x32, 0x34,
- 0x2F, 0x31, 0x33, 0x35,
- 0x2F, 0x32, 0x34, 0x35,
- 0x2F, 0x30, 0x34, 0x35,
- 0x2F, 0x30, 0x32, 0x35,
- 0x2F, 0x35, 0x35, 0x35,
- 0x2F, 0x2F, 0x35, 0x35,
- 0x2F, 0x2F, 0x2F, 0x35,
- 0x2F, 0x32, 0x33, 0x36,
- 0x2F, 0x32, 0x35, 0x36,
- 0x2F, 0x30, 0x35, 0x36,
- 0x2F, 0x30, 0x33, 0x36,
- 0x2F, 0x32, 0x34, 0x37,
- 0x2F, 0x33, 0x35, 0x37,
- 0x2F, 0x31, 0x35, 0x37,
- 0x2F, 0x31, 0x33, 0x37,
- 0x2F, 0x37, 0x37, 0x37,
- 0x2F, 0x2F, 0x37, 0x37,
- 0x2F, 0x2F, 0x2F, 0x37,
- 0x2F, 0x33, 0x36, 0x3A,
- 0x2F, 0x34, 0x38, 0x3A,
- 0x2F, 0x31, 0x38, 0x3A,
- 0x2F, 0x31, 0x35, 0x3A,
- 0x2F, 0x3A, 0x3A, 0x3A,
- 0x2F, 0x2F, 0x3A, 0x3A,
- 0x2F, 0x2F, 0x2F, 0x3A,
- 0x2F, 0x34, 0x38, 0x3D,
- 0x2F, 0x36, 0x3A, 0x3D,
- 0x2F, 0x32, 0x3A, 0x3D,
- 0x2F, 0x32, 0x36, 0x3D,
- 0x2F, 0x3D, 0x3D, 0x3D,
- 0x2F, 0x2F, 0x3D, 0x3D,
- 0x2F, 0x2F, 0x2F, 0x3D,
- 0x30, 0x31, 0x31, 0x32,
- 0x30, 0x31, 0x32, 0x33,
- 0x30, 0x32, 0x33, 0x34,
- 0x30, 0x31, 0x33, 0x34,
- 0x30, 0x31, 0x32, 0x34,
- 0x30, 0x32, 0x33, 0x35,
- 0x30, 0x32, 0x34, 0x35,
- 0x30, 0x31, 0x34, 0x35,
- 0x30, 0x31, 0x33, 0x35,
- 0x30, 0x32, 0x34, 0x36,
- 0x30, 0x33, 0x35, 0x36,
- 0x30, 0x31, 0x35, 0x36,
- 0x30, 0x31, 0x33, 0x36,
- 0x30, 0x36, 0x36, 0x36,
- 0x30, 0x30, 0x36, 0x36,
- 0x30, 0x30, 0x30, 0x36,
- 0x30, 0x33, 0x34, 0x37,
- 0x30, 0x33, 0x36, 0x37,
- 0x30, 0x31, 0x36, 0x37,
- 0x30, 0x31, 0x34, 0x37,
- 0x30, 0x33, 0x35, 0x38,
- 0x30, 0x34, 0x36, 0x38,
- 0x30, 0x32, 0x36, 0x38,
- 0x30, 0x32, 0x34, 0x38,
- 0x30, 0x38, 0x38, 0x38,
- 0x30, 0x30, 0x38, 0x38,
- 0x30, 0x30, 0x30, 0x38,
- 0x30, 0x34, 0x37, 0x3B,
- 0x30, 0x35, 0x39, 0x3B,
- 0x30, 0x32, 0x39, 0x3B,
- 0x30, 0x32, 0x36, 0x3B,
- 0x30, 0x3B, 0x3B, 0x3B,
- 0x30, 0x30, 0x3B, 0x3B,
- 0x30, 0x30, 0x30, 0x3B,
- 0x30, 0x35, 0x39, 0x3E,
- 0x30, 0x37, 0x3B, 0x3E,
- 0x30, 0x33, 0x3B, 0x3E,
- 0x30, 0x33, 0x37, 0x3E,
- 0x30, 0x3E, 0x3E, 0x3E,
- 0x30, 0x30, 0x3E, 0x3E,
- 0x30, 0x30, 0x30, 0x3E,
- 0x31, 0x32, 0x32, 0x33,
- 0x31, 0x32, 0x33, 0x34,
- 0x31, 0x33, 0x34, 0x35,
- 0x31, 0x32, 0x34, 0x35,
- 0x31, 0x32, 0x33, 0x35,
- 0x31, 0x33, 0x34, 0x36,
- 0x31, 0x33, 0x35, 0x36,
- 0x31, 0x32, 0x35, 0x36,
- 0x31, 0x32, 0x34, 0x36,
- 0x31, 0x33, 0x35, 0x37,
- 0x31, 0x34, 0x36, 0x37,
- 0x31, 0x32, 0x36, 0x37,
- 0x31, 0x32, 0x34, 0x37,
- 0x31, 0x37, 0x37, 0x37,
- 0x31, 0x31, 0x37, 0x37,
- 0x31, 0x31, 0x31, 0x37,
- 0x31, 0x34, 0x35, 0x38,
- 0x31, 0x34, 0x37, 0x38,
- 0x31, 0x32, 0x37, 0x38,
- 0x31, 0x32, 0x35, 0x38,
- 0x31, 0x34, 0x36, 0x39,
- 0x31, 0x35, 0x37, 0x39,
- 0x31, 0x33, 0x37, 0x39,
- 0x31, 0x33, 0x35, 0x39,
- 0x31, 0x39, 0x39, 0x39,
- 0x31, 0x31, 0x39, 0x39,
- 0x31, 0x31, 0x31, 0x39,
- 0x31, 0x35, 0x38, 0x3C,
- 0x31, 0x36, 0x3A, 0x3C,
- 0x31, 0x33, 0x3A, 0x3C,
- 0x31, 0x33, 0x37, 0x3C,
- 0x31, 0x3C, 0x3C, 0x3C,
- 0x31, 0x31, 0x3C, 0x3C,
- 0x31, 0x31, 0x31, 0x3C,
- 0x31, 0x36, 0x3A, 0x3F,
- 0x31, 0x38, 0x3C, 0x3F,
- 0x31, 0x34, 0x3C, 0x3F,
- 0x31, 0x34, 0x38, 0x3F,
- 0x31, 0x3F, 0x3F, 0x3F,
- 0x31, 0x31, 0x3F, 0x3F,
- 0x31, 0x31, 0x31, 0x3F,
- 0x32, 0x33, 0x33, 0x34,
- 0x32, 0x33, 0x34, 0x35,
- 0x32, 0x34, 0x35, 0x36,
- 0x32, 0x33, 0x35, 0x36,
- 0x32, 0x33, 0x34, 0x36,
- 0x32, 0x34, 0x35, 0x37,
- 0x32, 0x34, 0x36, 0x37,
- 0x32, 0x33, 0x36, 0x37,
- 0x32, 0x33, 0x35, 0x37,
- 0x32, 0x34, 0x36, 0x38,
- 0x32, 0x35, 0x37, 0x38,
- 0x32, 0x33, 0x37, 0x38,
- 0x32, 0x33, 0x35, 0x38,
- 0x32, 0x38, 0x38, 0x38,
- 0x32, 0x32, 0x38, 0x38,
- 0x32, 0x32, 0x32, 0x38,
- 0x32, 0x35, 0x36, 0x39,
- 0x32, 0x35, 0x38, 0x39,
- 0x32, 0x33, 0x38, 0x39,
- 0x32, 0x33, 0x36, 0x39,
- 0x32, 0x35, 0x37, 0x3A,
- 0x32, 0x36, 0x38, 0x3A,
- 0x32, 0x34, 0x38, 0x3A,
- 0x32, 0x34, 0x36, 0x3A,
- 0x32, 0x3A, 0x3A, 0x3A,
- 0x32, 0x32, 0x3A, 0x3A,
- 0x32, 0x32, 0x32, 0x3A,
- 0x32, 0x36, 0x39, 0x3D,
- 0x32, 0x37, 0x3B, 0x3D,
- 0x32, 0x34, 0x3B, 0x3D,
- 0x32, 0x34, 0x38, 0x3D,
- 0x32, 0x3D, 0x3D, 0x3D,
- 0x32, 0x32, 0x3D, 0x3D,
- 0x32, 0x32, 0x32, 0x3D,
- 0x33, 0x34, 0x34, 0x35,
- 0x33, 0x34, 0x35, 0x36,
- 0x33, 0x35, 0x36, 0x37,
- 0x33, 0x34, 0x36, 0x37,
- 0x33, 0x34, 0x35, 0x37,
- 0x33, 0x35, 0x36, 0x38,
- 0x33, 0x35, 0x37, 0x38,
- 0x33, 0x34, 0x37, 0x38,
- 0x33, 0x34, 0x36, 0x38,
- 0x33, 0x35, 0x37, 0x39,
- 0x33, 0x36, 0x38, 0x39,
- 0x33, 0x34, 0x38, 0x39,
- 0x33, 0x34, 0x36, 0x39,
- 0x33, 0x39, 0x39, 0x39,
- 0x33, 0x33, 0x39, 0x39,
- 0x33, 0x33, 0x33, 0x39,
- 0x33, 0x36, 0x37, 0x3A,
- 0x33, 0x36, 0x39, 0x3A,
- 0x33, 0x34, 0x39, 0x3A,
- 0x33, 0x34, 0x37, 0x3A,
- 0x33, 0x36, 0x38, 0x3B,
- 0x33, 0x37, 0x39, 0x3B,
- 0x33, 0x35, 0x39, 0x3B,
- 0x33, 0x35, 0x37, 0x3B,
- 0x33, 0x3B, 0x3B, 0x3B,
- 0x33, 0x33, 0x3B, 0x3B,
- 0x33, 0x33, 0x33, 0x3B,
- 0x33, 0x37, 0x3A, 0x3E,
- 0x33, 0x38, 0x3C, 0x3E,
- 0x33, 0x35, 0x3C, 0x3E,
- 0x33, 0x35, 0x39, 0x3E,
- 0x33, 0x3E, 0x3E, 0x3E,
- 0x33, 0x33, 0x3E, 0x3E,
- 0x33, 0x33, 0x33, 0x3E,
- 0x34, 0x35, 0x35, 0x36,
- 0x34, 0x35, 0x36, 0x37,
- 0x34, 0x36, 0x37, 0x38,
- 0x34, 0x35, 0x37, 0x38,
- 0x34, 0x35, 0x36, 0x38,
- 0x34, 0x36, 0x37, 0x39,
- 0x34, 0x36, 0x38, 0x39,
- 0x34, 0x35, 0x38, 0x39,
- 0x34, 0x35, 0x37, 0x39,
- 0x34, 0x36, 0x38, 0x3A,
- 0x34, 0x37, 0x39, 0x3A,
- 0x34, 0x35, 0x39, 0x3A,
- 0x34, 0x35, 0x37, 0x3A,
- 0x34, 0x3A, 0x3A, 0x3A,
- 0x34, 0x34, 0x3A, 0x3A,
- 0x34, 0x34, 0x34, 0x3A,
- 0x34, 0x37, 0x38, 0x3B,
- 0x34, 0x37, 0x3A, 0x3B,
- 0x34, 0x35, 0x3A, 0x3B,
- 0x34, 0x35, 0x38, 0x3B,
- 0x34, 0x37, 0x39, 0x3C,
- 0x34, 0x38, 0x3A, 0x3C,
- 0x34, 0x36, 0x3A, 0x3C,
- 0x34, 0x36, 0x38, 0x3C,
- 0x34, 0x3C, 0x3C, 0x3C,
- 0x34, 0x34, 0x3C, 0x3C,
- 0x34, 0x34, 0x34, 0x3C,
- 0x34, 0x38, 0x3B, 0x3F,
- 0x34, 0x39, 0x3D, 0x3F,
- 0x34, 0x36, 0x3D, 0x3F,
- 0x34, 0x36, 0x3A, 0x3F,
- 0x34, 0x3F, 0x3F, 0x3F,
- 0x34, 0x34, 0x3F, 0x3F,
- 0x34, 0x34, 0x34, 0x3F,
- 0x35, 0x36, 0x36, 0x37,
- 0x35, 0x36, 0x37, 0x38,
- 0x35, 0x37, 0x38, 0x39,
- 0x35, 0x36, 0x38, 0x39,
- 0x35, 0x36, 0x37, 0x39,
- 0x35, 0x37, 0x38, 0x3A,
- 0x35, 0x37, 0x39, 0x3A,
- 0x35, 0x36, 0x39, 0x3A,
- 0x35, 0x36, 0x38, 0x3A,
- 0x35, 0x37, 0x39, 0x3B,
- 0x35, 0x38, 0x3A, 0x3B,
- 0x35, 0x36, 0x3A, 0x3B,
- 0x35, 0x36, 0x38, 0x3B,
- 0x35, 0x3B, 0x3B, 0x3B,
- 0x35, 0x35, 0x3B, 0x3B,
- 0x35, 0x35, 0x35, 0x3B,
- 0x35, 0x38, 0x39, 0x3C,
- 0x35, 0x38, 0x3B, 0x3C,
- 0x35, 0x36, 0x3B, 0x3C,
- 0x35, 0x36, 0x39, 0x3C,
- 0x35, 0x38, 0x3A, 0x3D,
- 0x35, 0x39, 0x3B, 0x3D,
- 0x35, 0x37, 0x3B, 0x3D,
- 0x35, 0x37, 0x39, 0x3D,
- 0x35, 0x3D, 0x3D, 0x3D,
- 0x35, 0x35, 0x3D, 0x3D,
- 0x35, 0x35, 0x35, 0x3D,
- 0x36, 0x37, 0x37, 0x38,
- 0x36, 0x37, 0x38, 0x39,
- 0x36, 0x38, 0x39, 0x3A,
- 0x36, 0x37, 0x39, 0x3A,
- 0x36, 0x37, 0x38, 0x3A,
- 0x36, 0x38, 0x39, 0x3B,
- 0x36, 0x38, 0x3A, 0x3B,
- 0x36, 0x37, 0x3A, 0x3B,
- 0x36, 0x37, 0x39, 0x3B,
- 0x36, 0x38, 0x3A, 0x3C,
- 0x36, 0x39, 0x3B, 0x3C,
- 0x36, 0x37, 0x3B, 0x3C,
- 0x36, 0x37, 0x39, 0x3C,
- 0x36, 0x3C, 0x3C, 0x3C,
- 0x36, 0x36, 0x3C, 0x3C,
- 0x36, 0x36, 0x36, 0x3C,
- 0x36, 0x39, 0x3A, 0x3D,
- 0x36, 0x39, 0x3C, 0x3D,
- 0x36, 0x37, 0x3C, 0x3D,
- 0x36, 0x37, 0x3A, 0x3D,
- 0x36, 0x39, 0x3B, 0x3E,
- 0x36, 0x3A, 0x3C, 0x3E,
- 0x36, 0x38, 0x3C, 0x3E,
- 0x36, 0x38, 0x3A, 0x3E,
- 0x36, 0x3E, 0x3E, 0x3E,
- 0x36, 0x36, 0x3E, 0x3E,
- 0x36, 0x36, 0x36, 0x3E,
- 0x37, 0x38, 0x38, 0x39,
- 0x37, 0x38, 0x39, 0x3A,
- 0x37, 0x39, 0x3A, 0x3B,
- 0x37, 0x38, 0x3A, 0x3B,
- 0x37, 0x38, 0x39, 0x3B,
- 0x37, 0x39, 0x3A, 0x3C,
- 0x37, 0x39, 0x3B, 0x3C,
- 0x37, 0x38, 0x3B, 0x3C,
- 0x37, 0x38, 0x3A, 0x3C,
- 0x37, 0x39, 0x3B, 0x3D,
- 0x37, 0x3A, 0x3C, 0x3D,
- 0x37, 0x38, 0x3C, 0x3D,
- 0x37, 0x38, 0x3A, 0x3D,
- 0x37, 0x3D, 0x3D, 0x3D,
- 0x37, 0x37, 0x3D, 0x3D,
- 0x37, 0x37, 0x37, 0x3D,
- 0x37, 0x3A, 0x3B, 0x3E,
- 0x37, 0x3A, 0x3D, 0x3E,
- 0x37, 0x38, 0x3D, 0x3E,
- 0x37, 0x38, 0x3B, 0x3E,
- 0x37, 0x3A, 0x3C, 0x3F,
- 0x37, 0x3B, 0x3D, 0x3F,
- 0x37, 0x39, 0x3D, 0x3F,
- 0x37, 0x39, 0x3B, 0x3F,
- 0x37, 0x3F, 0x3F, 0x3F,
- 0x37, 0x37, 0x3F, 0x3F,
- 0x37, 0x37, 0x37, 0x3F,
- 0x38, 0x39, 0x39, 0x3A,
- 0x38, 0x39, 0x3A, 0x3B,
- 0x38, 0x3A, 0x3B, 0x3C,
- 0x38, 0x39, 0x3B, 0x3C,
- 0x38, 0x39, 0x3A, 0x3C,
- 0x38, 0x3A, 0x3B, 0x3D,
- 0x38, 0x3A, 0x3C, 0x3D,
- 0x38, 0x39, 0x3C, 0x3D,
- 0x38, 0x39, 0x3B, 0x3D,
- 0x38, 0x3A, 0x3C, 0x3E,
- 0x38, 0x3B, 0x3D, 0x3E,
- 0x38, 0x39, 0x3D, 0x3E,
- 0x38, 0x39, 0x3B, 0x3E,
- 0x38, 0x3E, 0x3E, 0x3E,
- 0x38, 0x38, 0x3E, 0x3E,
- 0x38, 0x38, 0x38, 0x3E,
- 0x38, 0x3B, 0x3C, 0x3F,
- 0x38, 0x3B, 0x3E, 0x3F,
- 0x38, 0x39, 0x3E, 0x3F,
- 0x38, 0x39, 0x3C, 0x3F,
- 0x39, 0x3A, 0x3A, 0x3B,
- 0x39, 0x3A, 0x3B, 0x3C,
- 0x39, 0x3B, 0x3C, 0x3D,
- 0x39, 0x3A, 0x3C, 0x3D,
- 0x39, 0x3A, 0x3B, 0x3D,
- 0x39, 0x3B, 0x3C, 0x3E,
- 0x39, 0x3B, 0x3D, 0x3E,
- 0x39, 0x3A, 0x3D, 0x3E,
- 0x39, 0x3A, 0x3C, 0x3E,
- 0x39, 0x3B, 0x3D, 0x3F,
- 0x39, 0x3C, 0x3E, 0x3F,
- 0x39, 0x3A, 0x3E, 0x3F,
- 0x39, 0x3A, 0x3C, 0x3F,
- 0x39, 0x3F, 0x3F, 0x3F,
- 0x39, 0x39, 0x3F, 0x3F,
- 0x39, 0x39, 0x39, 0x3F,
- 0x3A, 0x3B, 0x3B, 0x3C,
- 0x3A, 0x3B, 0x3C, 0x3D,
- 0x3A, 0x3C, 0x3D, 0x3E,
- 0x3A, 0x3B, 0x3D, 0x3E,
- 0x3A, 0x3B, 0x3C, 0x3E,
- 0x3A, 0x3C, 0x3D, 0x3F,
- 0x3A, 0x3C, 0x3E, 0x3F,
- 0x3A, 0x3B, 0x3E, 0x3F,
- 0x3A, 0x3B, 0x3D, 0x3F,
- 0x3B, 0x3C, 0x3C, 0x3D,
- 0x3B, 0x3C, 0x3D, 0x3E,
- 0x3B, 0x3D, 0x3E, 0x3F,
- 0x3B, 0x3C, 0x3E, 0x3F,
- 0x3B, 0x3C, 0x3D, 0x3F,
- 0x3C, 0x3D, 0x3D, 0x3E,
- 0x3C, 0x3D, 0x3E, 0x3F,
- 0x3D, 0x3E, 0x3E, 0x3F
-};
diff --git a/src/libffmpeg/libavcodec/utils.c b/src/libffmpeg/libavcodec/utils.c
deleted file mode 100644
index f6f061360..000000000
--- a/src/libffmpeg/libavcodec/utils.c
+++ /dev/null
@@ -1,1354 +0,0 @@
-/*
- * utils for libavcodec
- * Copyright (c) 2001 Fabrice Bellard.
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file utils.c
- * utils.
- */
-
-#include "avcodec.h"
-#include "dsputil.h"
-#include "mpegvideo.h"
-#include "integer.h"
-#include "opt.h"
-#include "crc.h"
-#include <stdarg.h>
-#include <limits.h>
-#include <float.h>
-#ifdef __MINGW32__
-#include <fcntl.h>
-#endif
-
-const uint8_t ff_reverse[256]={
-0x00,0x80,0x40,0xC0,0x20,0xA0,0x60,0xE0,0x10,0x90,0x50,0xD0,0x30,0xB0,0x70,0xF0,
-0x08,0x88,0x48,0xC8,0x28,0xA8,0x68,0xE8,0x18,0x98,0x58,0xD8,0x38,0xB8,0x78,0xF8,
-0x04,0x84,0x44,0xC4,0x24,0xA4,0x64,0xE4,0x14,0x94,0x54,0xD4,0x34,0xB4,0x74,0xF4,
-0x0C,0x8C,0x4C,0xCC,0x2C,0xAC,0x6C,0xEC,0x1C,0x9C,0x5C,0xDC,0x3C,0xBC,0x7C,0xFC,
-0x02,0x82,0x42,0xC2,0x22,0xA2,0x62,0xE2,0x12,0x92,0x52,0xD2,0x32,0xB2,0x72,0xF2,
-0x0A,0x8A,0x4A,0xCA,0x2A,0xAA,0x6A,0xEA,0x1A,0x9A,0x5A,0xDA,0x3A,0xBA,0x7A,0xFA,
-0x06,0x86,0x46,0xC6,0x26,0xA6,0x66,0xE6,0x16,0x96,0x56,0xD6,0x36,0xB6,0x76,0xF6,
-0x0E,0x8E,0x4E,0xCE,0x2E,0xAE,0x6E,0xEE,0x1E,0x9E,0x5E,0xDE,0x3E,0xBE,0x7E,0xFE,
-0x01,0x81,0x41,0xC1,0x21,0xA1,0x61,0xE1,0x11,0x91,0x51,0xD1,0x31,0xB1,0x71,0xF1,
-0x09,0x89,0x49,0xC9,0x29,0xA9,0x69,0xE9,0x19,0x99,0x59,0xD9,0x39,0xB9,0x79,0xF9,
-0x05,0x85,0x45,0xC5,0x25,0xA5,0x65,0xE5,0x15,0x95,0x55,0xD5,0x35,0xB5,0x75,0xF5,
-0x0D,0x8D,0x4D,0xCD,0x2D,0xAD,0x6D,0xED,0x1D,0x9D,0x5D,0xDD,0x3D,0xBD,0x7D,0xFD,
-0x03,0x83,0x43,0xC3,0x23,0xA3,0x63,0xE3,0x13,0x93,0x53,0xD3,0x33,0xB3,0x73,0xF3,
-0x0B,0x8B,0x4B,0xCB,0x2B,0xAB,0x6B,0xEB,0x1B,0x9B,0x5B,0xDB,0x3B,0xBB,0x7B,0xFB,
-0x07,0x87,0x47,0xC7,0x27,0xA7,0x67,0xE7,0x17,0x97,0x57,0xD7,0x37,0xB7,0x77,0xF7,
-0x0F,0x8F,0x4F,0xCF,0x2F,0xAF,0x6F,0xEF,0x1F,0x9F,0x5F,0xDF,0x3F,0xBF,0x7F,0xFF,
-};
-
-static int volatile entangled_thread_counter=0;
-
-/**
- * realloc which does nothing if the block is large enough
- */
-void *av_fast_realloc(void *ptr, unsigned int *size, unsigned int min_size)
-{
- if(min_size < *size)
- return ptr;
-
- *size= FFMAX(17*min_size/16 + 32, min_size);
-
- return av_realloc(ptr, *size);
-}
-
-static unsigned int last_static = 0;
-static unsigned int allocated_static = 0;
-static void** array_static = NULL;
-
-/**
- * allocation of static arrays - do not use for normal allocation.
- */
-void *av_mallocz_static(unsigned int size)
-{
- void *ptr = av_mallocz(size);
-
- if(ptr){
- array_static =av_fast_realloc(array_static, &allocated_static, sizeof(void*)*(last_static+1));
- if(!array_static)
- return NULL;
- array_static[last_static++] = ptr;
- }
-
- return ptr;
-}
-
-/**
- * same as above, but does realloc
- */
-
-void *av_realloc_static(void *ptr, unsigned int size)
-{
- int i;
- if(!ptr)
- return av_mallocz_static(size);
- /* Look for the old ptr */
- for(i = 0; i < last_static; i++) {
- if(array_static[i] == ptr) {
- array_static[i] = av_realloc(array_static[i], size);
- return array_static[i];
- }
- }
- return NULL;
-
-}
-
-/**
- * free all static arrays and reset pointers to 0.
- */
-void av_free_static(void)
-{
- while(last_static){
- av_freep(&array_static[--last_static]);
- }
- av_freep(&array_static);
-}
-
-/**
- * Call av_free_static automatically before it's too late
- */
-
-static void do_free(void) __attribute__ ((destructor));
-
-static void do_free(void)
-{
- av_free_static();
-}
-
-
-/* encoder management */
-AVCodec *first_avcodec = NULL;
-
-void register_avcodec(AVCodec *format)
-{
- AVCodec **p;
- p = &first_avcodec;
- while (*p != NULL) p = &(*p)->next;
- *p = format;
- format->next = NULL;
-}
-
-void avcodec_set_dimensions(AVCodecContext *s, int width, int height){
- s->coded_width = width;
- s->coded_height= height;
- s->width = -((-width )>>s->lowres);
- s->height= -((-height)>>s->lowres);
-}
-
-typedef struct InternalBuffer{
- int last_pic_num;
- uint8_t *base[4];
- uint8_t *data[4];
- int linesize[4];
-}InternalBuffer;
-
-#define INTERNAL_BUFFER_SIZE 32
-
-#define ALIGN(x, a) (((x)+(a)-1)&~((a)-1))
-
-void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height){
- int w_align= 1;
- int h_align= 1;
-
- switch(s->pix_fmt){
- case PIX_FMT_YUV420P:
- case PIX_FMT_YUV422:
- case PIX_FMT_UYVY422:
- case PIX_FMT_YUV422P:
- case PIX_FMT_YUV444P:
- case PIX_FMT_GRAY8:
- case PIX_FMT_GRAY16BE:
- case PIX_FMT_GRAY16LE:
- case PIX_FMT_YUVJ420P:
- case PIX_FMT_YUVJ422P:
- case PIX_FMT_YUVJ444P:
- w_align= 16; //FIXME check for non mpeg style codecs and use less alignment
- h_align= 16;
- break;
- case PIX_FMT_YUV411P:
- case PIX_FMT_UYVY411:
- w_align=32;
- h_align=8;
- break;
- case PIX_FMT_YUV410P:
- if(s->codec_id == CODEC_ID_SVQ1){
- w_align=64;
- h_align=64;
- }
- case PIX_FMT_RGB555:
- if(s->codec_id == CODEC_ID_RPZA){
- w_align=4;
- h_align=4;
- }
- case PIX_FMT_PAL8:
- if(s->codec_id == CODEC_ID_SMC){
- w_align=4;
- h_align=4;
- }
- break;
- case PIX_FMT_BGR24:
- if((s->codec_id == CODEC_ID_MSZH) || (s->codec_id == CODEC_ID_ZLIB)){
- w_align=4;
- h_align=4;
- }
- break;
- default:
- w_align= 1;
- h_align= 1;
- break;
- }
-
- *width = ALIGN(*width , w_align);
- *height= ALIGN(*height, h_align);
-}
-
-int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h){
- if((int)w>0 && (int)h>0 && (w+128)*(uint64_t)(h+128) < INT_MAX/4)
- return 0;
-
- av_log(av_log_ctx, AV_LOG_ERROR, "picture size invalid (%ux%u)\n", w, h);
- return -1;
-}
-
-int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic){
- int i;
- int w= s->width;
- int h= s->height;
- InternalBuffer *buf;
- int *picture_number;
-
- assert(pic->data[0]==NULL);
- assert(INTERNAL_BUFFER_SIZE > s->internal_buffer_count);
-
- if(avcodec_check_dimensions(s,w,h))
- return -1;
-
- if(s->internal_buffer==NULL){
- s->internal_buffer= av_mallocz(INTERNAL_BUFFER_SIZE*sizeof(InternalBuffer));
- }
-#if 0
- s->internal_buffer= av_fast_realloc(
- s->internal_buffer,
- &s->internal_buffer_size,
- sizeof(InternalBuffer)*FFMAX(99, s->internal_buffer_count+1)/*FIXME*/
- );
-#endif
-
- buf= &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];
- picture_number= &(((InternalBuffer*)s->internal_buffer)[INTERNAL_BUFFER_SIZE-1]).last_pic_num; //FIXME ugly hack
- (*picture_number)++;
-
- if(buf->base[0]){
- pic->age= *picture_number - buf->last_pic_num;
- buf->last_pic_num= *picture_number;
- }else{
- int h_chroma_shift, v_chroma_shift;
- int pixel_size, size[3];
- AVPicture picture;
-
- avcodec_get_chroma_sub_sample(s->pix_fmt, &h_chroma_shift, &v_chroma_shift);
-
- avcodec_align_dimensions(s, &w, &h);
-
- if(!(s->flags&CODEC_FLAG_EMU_EDGE)){
- w+= EDGE_WIDTH*2;
- h+= EDGE_WIDTH*2;
- }
- avpicture_fill(&picture, NULL, s->pix_fmt, w, h);
- pixel_size= picture.linesize[0]*8 / w;
-//av_log(NULL, AV_LOG_ERROR, "%d %d %d %d\n", (int)picture.data[1], w, h, s->pix_fmt);
- assert(pixel_size>=1);
- //FIXME next ensures that linesize= 2^x uvlinesize, thats needed because some MC code assumes it
- if(pixel_size == 3*8)
- w= ALIGN(w, STRIDE_ALIGN<<h_chroma_shift);
- else
- w= ALIGN(pixel_size*w, STRIDE_ALIGN<<(h_chroma_shift+3)) / pixel_size;
- size[1] = avpicture_fill(&picture, NULL, s->pix_fmt, w, h);
- size[0] = picture.linesize[0] * h;
- size[1] -= size[0];
- if(picture.data[2])
- size[1]= size[2]= size[1]/2;
- else
- size[2]= 0;
-
- buf->last_pic_num= -256*256*256*64;
- memset(buf->base, 0, sizeof(buf->base));
- memset(buf->data, 0, sizeof(buf->data));
-
- for(i=0; i<3 && size[i]; i++){
- const int h_shift= i==0 ? 0 : h_chroma_shift;
- const int v_shift= i==0 ? 0 : v_chroma_shift;
-
- buf->linesize[i]= picture.linesize[i];
-
- buf->base[i]= av_malloc(size[i]+16); //FIXME 16
- if(buf->base[i]==NULL) return -1;
- memset(buf->base[i], 128, size[i]);
-
- // no edge if EDEG EMU or not planar YUV, we check for PAL8 redundantly to protect against a exploitable bug regression ...
- if((s->flags&CODEC_FLAG_EMU_EDGE) || (s->pix_fmt == PIX_FMT_PAL8) || !size[2])
- buf->data[i] = buf->base[i];
- else
- buf->data[i] = buf->base[i] + ALIGN((buf->linesize[i]*EDGE_WIDTH>>v_shift) + (EDGE_WIDTH>>h_shift), STRIDE_ALIGN);
- }
- pic->age= 256*256*256*64;
- }
- pic->type= FF_BUFFER_TYPE_INTERNAL;
-
- for(i=0; i<4; i++){
- pic->base[i]= buf->base[i];
- pic->data[i]= buf->data[i];
- pic->linesize[i]= buf->linesize[i];
- }
- s->internal_buffer_count++;
-
- return 0;
-}
-
-void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic){
- int i;
- InternalBuffer *buf, *last, temp;
-
- assert(pic->type==FF_BUFFER_TYPE_INTERNAL);
- assert(s->internal_buffer_count);
-
- buf = NULL; /* avoids warning */
- for(i=0; i<s->internal_buffer_count; i++){ //just 3-5 checks so is not worth to optimize
- buf= &((InternalBuffer*)s->internal_buffer)[i];
- if(buf->data[0] == pic->data[0])
- break;
- }
- assert(i < s->internal_buffer_count);
- s->internal_buffer_count--;
- last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];
-
- temp= *buf;
- *buf= *last;
- *last= temp;
-
- for(i=0; i<3; i++){
- pic->data[i]=NULL;
-// pic->base[i]=NULL;
- }
-//printf("R%X\n", pic->opaque);
-}
-
-int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic){
- AVFrame temp_pic;
- int i;
-
- /* If no picture return a new buffer */
- if(pic->data[0] == NULL) {
- /* We will copy from buffer, so must be readable */
- pic->buffer_hints |= FF_BUFFER_HINTS_READABLE;
- return s->get_buffer(s, pic);
- }
-
- /* If internal buffer type return the same buffer */
- if(pic->type == FF_BUFFER_TYPE_INTERNAL)
- return 0;
-
- /*
- * Not internal type and reget_buffer not overridden, emulate cr buffer
- */
- temp_pic = *pic;
- for(i = 0; i < 4; i++)
- pic->data[i] = pic->base[i] = NULL;
- pic->opaque = NULL;
- /* Allocate new frame */
- if (s->get_buffer(s, pic))
- return -1;
- /* Copy image data from old buffer to new buffer */
- img_copy((AVPicture*)pic, (AVPicture*)&temp_pic, s->pix_fmt, s->width,
- s->height);
- s->release_buffer(s, &temp_pic); // Release old frame
- return 0;
-}
-
-int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void **arg, int *ret, int count){
- int i;
-
- for(i=0; i<count; i++){
- int r= func(c, arg[i]);
- if(ret) ret[i]= r;
- }
- return 0;
-}
-
-enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat * fmt){
- return fmt[0];
-}
-
-static const char* context_to_name(void* ptr) {
- AVCodecContext *avc= ptr;
-
- if(avc && avc->codec && avc->codec->name)
- return avc->codec->name;
- else
- return "NULL";
-}
-
-#define OFFSET(x) offsetof(AVCodecContext,x)
-#define DEFAULT 0 //should be NAN but it doesnt work as its not a constant in glibc as required by ANSI/ISO C
-//these names are too long to be readable
-#define V AV_OPT_FLAG_VIDEO_PARAM
-#define A AV_OPT_FLAG_AUDIO_PARAM
-#define S AV_OPT_FLAG_SUBTITLE_PARAM
-#define E AV_OPT_FLAG_ENCODING_PARAM
-#define D AV_OPT_FLAG_DECODING_PARAM
-
-#define AV_CODEC_DEFAULT_BITRATE 200*1000
-
-static const AVOption options[]={
-{"b", "set video bitrate (in bits/s)", OFFSET(bit_rate), FF_OPT_TYPE_INT, AV_CODEC_DEFAULT_BITRATE, INT_MIN, INT_MAX, V|A|E},
-{"bt", "set video bitrate tolerance (in bits/s)", OFFSET(bit_rate_tolerance), FF_OPT_TYPE_INT, AV_CODEC_DEFAULT_BITRATE*20, 1, INT_MAX, V|E},
-{"flags", NULL, OFFSET(flags), FF_OPT_TYPE_FLAGS, DEFAULT, INT_MIN, INT_MAX, V|A|E|D, "flags"},
-{"mv4", "use four motion vector by macroblock (mpeg4)", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_4MV, INT_MIN, INT_MAX, V|E, "flags"},
-{"obmc", "use overlapped block motion compensation (h263+)", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_OBMC, INT_MIN, INT_MAX, V|E, "flags"},
-{"qpel", "use 1/4 pel motion compensation", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_QPEL, INT_MIN, INT_MAX, V|E, "flags"},
-{"loop", "use loop filter", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_LOOP_FILTER, INT_MIN, INT_MAX, V|E, "flags"},
-{"qscale", "use fixed qscale", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_QSCALE, INT_MIN, INT_MAX, 0, "flags"},
-{"gmc", "use gmc", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_GMC, INT_MIN, INT_MAX, V|E, "flags"},
-{"mv0", "always try a mb with mv=<0,0>", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_MV0, INT_MIN, INT_MAX, V|E, "flags"},
-{"part", "use data partitioning", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_PART, INT_MIN, INT_MAX, V|E, "flags"},
-{"input_preserved", NULL, 0, FF_OPT_TYPE_CONST, CODEC_FLAG_INPUT_PRESERVED, INT_MIN, INT_MAX, 0, "flags"},
-{"pass1", "use internal 2pass ratecontrol in first pass mode", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_PASS1, INT_MIN, INT_MAX, 0, "flags"},
-{"pass2", "use internal 2pass ratecontrol in second pass mode", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_PASS2, INT_MIN, INT_MAX, 0, "flags"},
-{"extern_huff", "use external huffman table (for mjpeg)", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_EXTERN_HUFF, INT_MIN, INT_MAX, 0, "flags"},
-{"gray", "only decode/encode grayscale", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_GRAY, INT_MIN, INT_MAX, V|E|D, "flags"},
-{"emu_edge", "don't draw edges", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_EMU_EDGE, INT_MIN, INT_MAX, 0, "flags"},
-{"psnr", "error[?] variables will be set during encoding", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_PSNR, INT_MIN, INT_MAX, V|E, "flags"},
-{"truncated", NULL, 0, FF_OPT_TYPE_CONST, CODEC_FLAG_TRUNCATED, INT_MIN, INT_MAX, 0, "flags"},
-{"naq", "normalize adaptive quantization", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_NORMALIZE_AQP, INT_MIN, INT_MAX, V|E, "flags"},
-{"ildct", "use interlaced dct", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_INTERLACED_DCT, INT_MIN, INT_MAX, V|E, "flags"},
-{"low_delay", "force low delay", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_LOW_DELAY, INT_MIN, INT_MAX, V|D|E, "flags"},
-{"alt", "enable alternate scantable (mpeg2/mpeg4)", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_ALT_SCAN, INT_MIN, INT_MAX, V|E, "flags"},
-{"trell", "use trellis quantization", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_TRELLIS_QUANT, INT_MIN, INT_MAX, V|E, "flags"},
-{"global_header", "place global headers in extradata instead of every keyframe", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_GLOBAL_HEADER, INT_MIN, INT_MAX, 0, "flags"},
-{"bitexact", "use only bitexact stuff (except (i)dct)", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_BITEXACT, INT_MIN, INT_MAX, A|V|S|D|E, "flags"},
-{"aic", "h263 advanced intra coding / mpeg4 ac prediction", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_AC_PRED, INT_MIN, INT_MAX, V|E, "flags"},
-{"umv", "use unlimited motion vectors", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_H263P_UMV, INT_MIN, INT_MAX, V|E, "flags"},
-{"cbp", "use rate distortion optimization for cbp", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_CBP_RD, INT_MIN, INT_MAX, V|E, "flags"},
-{"qprd", "use rate distortion optimization for qp selection", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_QP_RD, INT_MIN, INT_MAX, V|E, "flags"},
-{"aiv", "h263 alternative inter vlc", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_H263P_AIV, INT_MIN, INT_MAX, V|E, "flags"},
-{"slice", NULL, 0, FF_OPT_TYPE_CONST, CODEC_FLAG_H263P_SLICE_STRUCT, INT_MIN, INT_MAX, V|E, "flags"},
-{"ilme", "interlaced motion estimation", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_INTERLACED_ME, INT_MIN, INT_MAX, V|E, "flags"},
-{"scan_offset", "will reserve space for svcd scan offset user data", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_SVCD_SCAN_OFFSET, INT_MIN, INT_MAX, V|E, "flags"},
-{"cgop", "closed gop", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_CLOSED_GOP, INT_MIN, INT_MAX, V|E, "flags"},
-{"fast", "allow non spec compliant speedup tricks", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_FAST, INT_MIN, INT_MAX, V|E, "flags2"},
-{"sgop", "strictly enforce gop size", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_STRICT_GOP, INT_MIN, INT_MAX, V|E, "flags2"},
-{"noout", "skip bitstream encoding", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_NO_OUTPUT, INT_MIN, INT_MAX, V|E, "flags2"},
-{"local_header", "place global headers at every keyframe instead of in extradata", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_LOCAL_HEADER, INT_MIN, INT_MAX, V|E, "flags2"},
-{"sub_id", NULL, OFFSET(sub_id), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
-{"me_method", "set motion estimation method", OFFSET(me_method), FF_OPT_TYPE_INT, ME_EPZS, INT_MIN, INT_MAX, V|E, "me_method"},
-{"extradata_size", NULL, OFFSET(extradata_size), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
-{"time_base", NULL, OFFSET(time_base), FF_OPT_TYPE_RATIONAL, DEFAULT, INT_MIN, INT_MAX},
-{"g", "set the group of picture size", OFFSET(gop_size), FF_OPT_TYPE_INT, 12, INT_MIN, INT_MAX, V|E},
-{"rate_emu", "frame rate emulation", OFFSET(rate_emu), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
-{"ar", "set audio sampling rate (in Hz)", OFFSET(sample_rate), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
-{"ac", "set number of audio channels", OFFSET(channels), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
-{"cutoff", "set cutoff bandwidth", OFFSET(cutoff), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, A|E},
-{"frame_size", NULL, OFFSET(frame_size), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, A|E},
-{"frame_number", NULL, OFFSET(frame_number), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
-{"real_pict_num", NULL, OFFSET(real_pict_num), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
-{"delay", NULL, OFFSET(delay), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
-{"qcomp", "video quantizer scale compression (VBR)", OFFSET(qcompress), FF_OPT_TYPE_FLOAT, 0.5, FLT_MIN, FLT_MAX, V|E},
-{"qblur", "video quantizer scale blur (VBR)", OFFSET(qblur), FF_OPT_TYPE_FLOAT, 0.5, FLT_MIN, FLT_MAX, V|E},
-{"qmin", "min video quantizer scale (VBR)", OFFSET(qmin), FF_OPT_TYPE_INT, 2, 1, 51, V|E},
-{"qmax", "max video quantizer scale (VBR)", OFFSET(qmax), FF_OPT_TYPE_INT, 31, 1, 51, V|E},
-{"qdiff", "max difference between the quantizer scale (VBR)", OFFSET(max_qdiff), FF_OPT_TYPE_INT, 3, INT_MIN, INT_MAX, V|E},
-{"bf", "use 'frames' B frames", OFFSET(max_b_frames), FF_OPT_TYPE_INT, DEFAULT, 0, FF_MAX_B_FRAMES, V|E},
-{"b_qfactor", "qp factor between p and b frames", OFFSET(b_quant_factor), FF_OPT_TYPE_FLOAT, 1.25, FLT_MIN, FLT_MAX, V|E},
-{"rc_strategy", "ratecontrol method", OFFSET(rc_strategy), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
-{"b_strategy", "strategy to choose between I/P/B-frames", OFFSET(b_frame_strategy), FF_OPT_TYPE_INT, 0, INT_MIN, INT_MAX, V|E},
-{"hurry_up", NULL, OFFSET(hurry_up), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|D},
-{"rtp_mode", NULL, OFFSET(rtp_mode), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
-{"rtp_payload_size", NULL, OFFSET(rtp_payload_size), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
-{"mv_bits", NULL, OFFSET(mv_bits), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
-{"header_bits", NULL, OFFSET(header_bits), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
-{"i_tex_bits", NULL, OFFSET(i_tex_bits), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
-{"p_tex_bits", NULL, OFFSET(p_tex_bits), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
-{"i_count", NULL, OFFSET(i_count), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
-{"p_count", NULL, OFFSET(p_count), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
-{"skip_count", NULL, OFFSET(skip_count), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
-{"misc_bits", NULL, OFFSET(misc_bits), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
-{"frame_bits", NULL, OFFSET(frame_bits), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
-{"codec_tag", NULL, OFFSET(codec_tag), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
-{"bug", "workaround not auto detected encoder bugs", OFFSET(workaround_bugs), FF_OPT_TYPE_FLAGS, FF_BUG_AUTODETECT, INT_MIN, INT_MAX, V|D, "bug"},
-{"autodetect", NULL, 0, FF_OPT_TYPE_CONST, FF_BUG_AUTODETECT, INT_MIN, INT_MAX, V|D, "bug"},
-{"old_msmpeg4", "some old lavc generated msmpeg4v3 files (no autodetection)", 0, FF_OPT_TYPE_CONST, FF_BUG_OLD_MSMPEG4, INT_MIN, INT_MAX, V|D, "bug"},
-{"xvid_ilace", "Xvid interlacing bug (autodetected if fourcc==XVIX)", 0, FF_OPT_TYPE_CONST, FF_BUG_XVID_ILACE, INT_MIN, INT_MAX, V|D, "bug"},
-{"ump4", "(autodetected if fourcc==UMP4)", 0, FF_OPT_TYPE_CONST, FF_BUG_UMP4, INT_MIN, INT_MAX, V|D, "bug"},
-{"no_padding", "padding bug (autodetected)", 0, FF_OPT_TYPE_CONST, FF_BUG_NO_PADDING, INT_MIN, INT_MAX, V|D, "bug"},
-{"amv", NULL, 0, FF_OPT_TYPE_CONST, FF_BUG_AMV, INT_MIN, INT_MAX, V|D, "bug"},
-{"ac_vlc", "illegal vlc bug (autodetected per fourcc)", 0, FF_OPT_TYPE_CONST, FF_BUG_AC_VLC, INT_MIN, INT_MAX, V|D, "bug"},
-{"qpel_chroma", NULL, 0, FF_OPT_TYPE_CONST, FF_BUG_QPEL_CHROMA, INT_MIN, INT_MAX, V|D, "bug"},
-{"std_qpel", "old standard qpel (autodetected per fourcc/version)", 0, FF_OPT_TYPE_CONST, FF_BUG_STD_QPEL, INT_MIN, INT_MAX, V|D, "bug"},
-{"qpel_chroma2", NULL, 0, FF_OPT_TYPE_CONST, FF_BUG_QPEL_CHROMA2, INT_MIN, INT_MAX, V|D, "bug"},
-{"direct_blocksize", "direct-qpel-blocksize bug (autodetected per fourcc/version)", 0, FF_OPT_TYPE_CONST, FF_BUG_DIRECT_BLOCKSIZE, INT_MIN, INT_MAX, V|D, "bug"},
-{"edge", "edge padding bug (autodetected per fourcc/version)", 0, FF_OPT_TYPE_CONST, FF_BUG_EDGE, INT_MIN, INT_MAX, V|D, "bug"},
-{"hpel_chroma", NULL, 0, FF_OPT_TYPE_CONST, FF_BUG_HPEL_CHROMA, INT_MIN, INT_MAX, V|D, "bug"},
-{"dc_clip", NULL, 0, FF_OPT_TYPE_CONST, FF_BUG_DC_CLIP, INT_MIN, INT_MAX, V|D, "bug"},
-{"ms", "workaround various bugs in microsofts broken decoders", 0, FF_OPT_TYPE_CONST, FF_BUG_MS, INT_MIN, INT_MAX, V|D, "bug"},
-{"lelim", "single coefficient elimination threshold for luminance (negative values also consider dc coefficient)", OFFSET(luma_elim_threshold), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
-{"celim", "single coefficient elimination threshold for chrominance (negative values also consider dc coefficient)", OFFSET(chroma_elim_threshold), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
-{"strict", "how strictly to follow the standards", OFFSET(strict_std_compliance), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, A|V|D, "strict"},
-{"very", "strictly conform to a older more strict version of the spec or reference software", 0, FF_OPT_TYPE_CONST, FF_COMPLIANCE_VERY_STRICT, INT_MIN, INT_MAX, V|E, "strict"},
-{"strict", "strictly conform to all the things in the spec no matter what consequences", 0, FF_OPT_TYPE_CONST, FF_COMPLIANCE_STRICT, INT_MIN, INT_MAX, V|E, "strict"},
-{"normal", NULL, 0, FF_OPT_TYPE_CONST, FF_COMPLIANCE_NORMAL, INT_MIN, INT_MAX, V|E, "strict"},
-{"inofficial", "allow inofficial extensions", 0, FF_OPT_TYPE_CONST, FF_COMPLIANCE_INOFFICIAL, INT_MIN, INT_MAX, V|E, "strict"},
-{"experimental", "allow non standarized experimental things", 0, FF_OPT_TYPE_CONST, FF_COMPLIANCE_EXPERIMENTAL, INT_MIN, INT_MAX, V|E, "strict"},
-{"b_qoffset", "qp offset between p and b frames", OFFSET(b_quant_offset), FF_OPT_TYPE_FLOAT, 1.25, FLT_MIN, FLT_MAX, V|E},
-{"er", "set error resilience strategy", OFFSET(error_resilience), FF_OPT_TYPE_INT, FF_ER_CAREFUL, INT_MIN, INT_MAX, A|V|D, "er"},
-{"careful", NULL, 0, FF_OPT_TYPE_CONST, FF_ER_CAREFUL, INT_MIN, INT_MAX, V|D, "er"},
-{"compliant", NULL, 0, FF_OPT_TYPE_CONST, FF_ER_COMPLIANT, INT_MIN, INT_MAX, V|D, "er"},
-{"aggressive", NULL, 0, FF_OPT_TYPE_CONST, FF_ER_AGGRESSIVE, INT_MIN, INT_MAX, V|D, "er"},
-{"very_aggressive", NULL, 0, FF_OPT_TYPE_CONST, FF_ER_VERY_AGGRESSIVE, INT_MIN, INT_MAX, V|D, "er"},
-{"has_b_frames", NULL, OFFSET(has_b_frames), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
-{"block_align", NULL, OFFSET(block_align), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
-{"parse_only", NULL, OFFSET(parse_only), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
-{"mpeg_quant", "use MPEG quantizers instead of H.263", OFFSET(mpeg_quant), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
-{"stats_out", NULL, OFFSET(stats_out), FF_OPT_TYPE_STRING, DEFAULT, CHAR_MIN, CHAR_MAX},
-{"stats_in", NULL, OFFSET(stats_in), FF_OPT_TYPE_STRING, DEFAULT, CHAR_MIN, CHAR_MAX},
-{"qsquish", "how to keep quantizer between qmin and qmax (0 = clip, 1 = use differentiable function)", OFFSET(rc_qsquish), FF_OPT_TYPE_FLOAT, DEFAULT, 0, 99, V|E},
-{"rc_qmod_amp", "experimental quantizer modulation", OFFSET(rc_qmod_amp), FF_OPT_TYPE_FLOAT, DEFAULT, -FLT_MAX, FLT_MAX, V|E},
-{"rc_qmod_freq", "experimental quantizer modulation", OFFSET(rc_qmod_freq), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
-{"rc_override_count", NULL, OFFSET(rc_override_count), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
-{"rc_eq", "set rate control equation", OFFSET(rc_eq), FF_OPT_TYPE_STRING, DEFAULT, CHAR_MIN, CHAR_MAX, V|E},
-{"maxrate", "set max video bitrate tolerance (in bits/s)", OFFSET(rc_max_rate), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
-{"minrate", "set min video bitrate tolerance (in bits/s)", OFFSET(rc_min_rate), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
-{"bufsize", "set ratecontrol buffer size (in bits)", OFFSET(rc_buffer_size), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
-{"rc_buf_aggressivity", "currently useless", OFFSET(rc_buffer_aggressivity), FF_OPT_TYPE_FLOAT, 1.0, FLT_MIN, FLT_MAX, V|E},
-{"i_qfactor", "qp factor between p and i frames", OFFSET(i_quant_factor), FF_OPT_TYPE_FLOAT, -0.8, -FLT_MAX, FLT_MAX, V|E},
-{"i_qoffset", "qp offset between p and i frames", OFFSET(i_quant_offset), FF_OPT_TYPE_FLOAT, 0.0, -FLT_MAX, FLT_MAX, V|E},
-{"rc_init_cplx", "initial complexity for 1-pass encoding", OFFSET(rc_initial_cplx), FF_OPT_TYPE_FLOAT, DEFAULT, -FLT_MAX, FLT_MAX, V|E},
-{"dct", "DCT algorithm", OFFSET(dct_algo), FF_OPT_TYPE_INT, DEFAULT, 0, INT_MAX, V|E, "dct"},
-{"auto", "autoselect a good one (default)", 0, FF_OPT_TYPE_CONST, FF_DCT_AUTO, INT_MIN, INT_MAX, V|E, "dct"},
-{"fastint", "fast integer", 0, FF_OPT_TYPE_CONST, FF_DCT_FASTINT, INT_MIN, INT_MAX, V|E, "dct"},
-{"int", "accurate integer", 0, FF_OPT_TYPE_CONST, FF_DCT_INT, INT_MIN, INT_MAX, V|E, "dct"},
-{"mmx", NULL, 0, FF_OPT_TYPE_CONST, FF_DCT_MMX, INT_MIN, INT_MAX, V|E, "dct"},
-{"mlib", NULL, 0, FF_OPT_TYPE_CONST, FF_DCT_MLIB, INT_MIN, INT_MAX, V|E, "dct"},
-{"altivec", NULL, 0, FF_OPT_TYPE_CONST, FF_DCT_ALTIVEC, INT_MIN, INT_MAX, V|E, "dct"},
-{"faan", "floating point AAN DCT", 0, FF_OPT_TYPE_CONST, FF_DCT_FAAN, INT_MIN, INT_MAX, V|E, "dct"},
-{"lumi_mask", "compresses bright areas stronger than medium ones", OFFSET(lumi_masking), FF_OPT_TYPE_FLOAT, 0, -FLT_MAX, FLT_MAX, V|E},
-{"tcplx_mask", "temporal complexity masking", OFFSET(temporal_cplx_masking), FF_OPT_TYPE_FLOAT, 0, -FLT_MAX, FLT_MAX, V|E},
-{"scplx_mask", "spatial complexity masking", OFFSET(spatial_cplx_masking), FF_OPT_TYPE_FLOAT, 0, -FLT_MAX, FLT_MAX, V|E},
-{"p_mask", "inter masking", OFFSET(p_masking), FF_OPT_TYPE_FLOAT, 0, -FLT_MAX, FLT_MAX, V|E},
-{"dark_mask", "compresses dark areas stronger than medium ones", OFFSET(dark_masking), FF_OPT_TYPE_FLOAT, 0, -FLT_MAX, FLT_MAX, V|E},
-{"unused", NULL, OFFSET(unused), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
-{"idct", "select IDCT implementation", OFFSET(idct_algo), FF_OPT_TYPE_INT, DEFAULT, 0, INT_MAX, V|E|D, "idct"},
-{"auto", NULL, 0, FF_OPT_TYPE_CONST, FF_IDCT_AUTO, INT_MIN, INT_MAX, V|E|D, "idct"},
-{"int", NULL, 0, FF_OPT_TYPE_CONST, FF_IDCT_INT, INT_MIN, INT_MAX, V|E|D, "idct"},
-{"simple", NULL, 0, FF_OPT_TYPE_CONST, FF_IDCT_SIMPLE, INT_MIN, INT_MAX, V|E|D, "idct"},
-{"simplemmx", NULL, 0, FF_OPT_TYPE_CONST, FF_IDCT_SIMPLEMMX, INT_MIN, INT_MAX, V|E|D, "idct"},
-{"libmpeg2mmx", NULL, 0, FF_OPT_TYPE_CONST, FF_IDCT_LIBMPEG2MMX, INT_MIN, INT_MAX, V|E|D, "idct"},
-{"ps2", NULL, 0, FF_OPT_TYPE_CONST, FF_IDCT_PS2, INT_MIN, INT_MAX, V|E|D, "idct"},
-{"mlib", NULL, 0, FF_OPT_TYPE_CONST, FF_IDCT_MLIB, INT_MIN, INT_MAX, V|E|D, "idct"},
-{"arm", NULL, 0, FF_OPT_TYPE_CONST, FF_IDCT_ARM, INT_MIN, INT_MAX, V|E|D, "idct"},
-{"altivec", NULL, 0, FF_OPT_TYPE_CONST, FF_IDCT_ALTIVEC, INT_MIN, INT_MAX, V|E|D, "idct"},
-{"sh4", NULL, 0, FF_OPT_TYPE_CONST, FF_IDCT_SH4, INT_MIN, INT_MAX, V|E|D, "idct"},
-{"simplearm", NULL, 0, FF_OPT_TYPE_CONST, FF_IDCT_SIMPLEARM, INT_MIN, INT_MAX, V|E|D, "idct"},
-{"simplearmv5te", NULL, 0, FF_OPT_TYPE_CONST, FF_IDCT_SIMPLEARMV5TE, INT_MIN, INT_MAX, V|E|D, "idct"},
-{"h264", NULL, 0, FF_OPT_TYPE_CONST, FF_IDCT_H264, INT_MIN, INT_MAX, V|E|D, "idct"},
-{"vp3", NULL, 0, FF_OPT_TYPE_CONST, FF_IDCT_VP3, INT_MIN, INT_MAX, V|E|D, "idct"},
-{"ipp", NULL, 0, FF_OPT_TYPE_CONST, FF_IDCT_IPP, INT_MIN, INT_MAX, V|E|D, "idct"},
-{"xvidmmx", NULL, 0, FF_OPT_TYPE_CONST, FF_IDCT_XVIDMMX, INT_MIN, INT_MAX, V|E|D, "idct"},
-{"slice_count", NULL, OFFSET(slice_count), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
-{"ec", "set error concealment strategy", OFFSET(error_concealment), FF_OPT_TYPE_FLAGS, 3, INT_MIN, INT_MAX, V|D, "ec"},
-{"guess_mvs", "iterative motion vector (MV) search (slow)", 0, FF_OPT_TYPE_CONST, FF_EC_GUESS_MVS, INT_MIN, INT_MAX, V|D, "ec"},
-{"deblock", "use strong deblock filter for damaged MBs", 0, FF_OPT_TYPE_CONST, FF_EC_DEBLOCK, INT_MIN, INT_MAX, V|D, "ec"},
-{"bits_per_sample", NULL, OFFSET(bits_per_sample), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
-{"pred", "prediction method", OFFSET(prediction_method), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E, "pred"},
-{"left", NULL, 0, FF_OPT_TYPE_CONST, FF_PRED_LEFT, INT_MIN, INT_MAX, V|E, "pred"},
-{"plane", NULL, 0, FF_OPT_TYPE_CONST, FF_PRED_PLANE, INT_MIN, INT_MAX, V|E, "pred"},
-{"median", NULL, 0, FF_OPT_TYPE_CONST, FF_PRED_MEDIAN, INT_MIN, INT_MAX, V|E, "pred"},
-{"aspect", "sample aspect ratio", OFFSET(sample_aspect_ratio), FF_OPT_TYPE_RATIONAL, DEFAULT, 0, 10, V|E},
-{"debug", "print specific debug info", OFFSET(debug), FF_OPT_TYPE_FLAGS, DEFAULT, 0, INT_MAX, V|A|S|E|D, "debug"},
-{"pict", "picture info", 0, FF_OPT_TYPE_CONST, FF_DEBUG_PICT_INFO, INT_MIN, INT_MAX, V|D, "debug"},
-{"rc", "rate control", 0, FF_OPT_TYPE_CONST, FF_DEBUG_RC, INT_MIN, INT_MAX, V|E, "debug"},
-{"bitstream", NULL, 0, FF_OPT_TYPE_CONST, FF_DEBUG_BITSTREAM, INT_MIN, INT_MAX, V|D, "debug"},
-{"mb_type", "macroblock (MB) type", 0, FF_OPT_TYPE_CONST, FF_DEBUG_MB_TYPE, INT_MIN, INT_MAX, V|D, "debug"},
-{"qp", "per-block quantization parameter (QP)", 0, FF_OPT_TYPE_CONST, FF_DEBUG_QP, INT_MIN, INT_MAX, V|D, "debug"},
-{"mv", "motion vector", 0, FF_OPT_TYPE_CONST, FF_DEBUG_MV, INT_MIN, INT_MAX, V|D, "debug"},
-{"dct_coeff", NULL, 0, FF_OPT_TYPE_CONST, FF_DEBUG_DCT_COEFF, INT_MIN, INT_MAX, V|D, "debug"},
-{"skip", NULL, 0, FF_OPT_TYPE_CONST, FF_DEBUG_SKIP, INT_MIN, INT_MAX, V|D, "debug"},
-{"startcode", NULL, 0, FF_OPT_TYPE_CONST, FF_DEBUG_STARTCODE, INT_MIN, INT_MAX, V|D, "debug"},
-{"pts", NULL, 0, FF_OPT_TYPE_CONST, FF_DEBUG_PTS, INT_MIN, INT_MAX, V|D, "debug"},
-{"er", "error resilience", 0, FF_OPT_TYPE_CONST, FF_DEBUG_ER, INT_MIN, INT_MAX, V|D, "debug"},
-{"mmco", "memory management control operations (H.264)", 0, FF_OPT_TYPE_CONST, FF_DEBUG_MMCO, INT_MIN, INT_MAX, V|D, "debug"},
-{"bugs", NULL, 0, FF_OPT_TYPE_CONST, FF_DEBUG_BUGS, INT_MIN, INT_MAX, V|D, "debug"},
-{"vis_qp", "visualize quantization parameter (QP), lower QP are tinted greener", 0, FF_OPT_TYPE_CONST, FF_DEBUG_VIS_QP, INT_MIN, INT_MAX, V|D, "debug"},
-{"vis_mb_type", "visualize block types", 0, FF_OPT_TYPE_CONST, FF_DEBUG_VIS_MB_TYPE, INT_MIN, INT_MAX, V|D, "debug"},
-{"vismv", "visualize motion vectors (MVs)", OFFSET(debug_mv), FF_OPT_TYPE_INT, DEFAULT, 0, INT_MAX, V|D, "debug_mv"},
-{"pf", "forward predicted MVs of P-frames", 0, FF_OPT_TYPE_CONST, FF_DEBUG_VIS_MV_P_FOR, INT_MIN, INT_MAX, V|D, "debug_mv"},
-{"bf", "forward predicted MVs of B-frames", 0, FF_OPT_TYPE_CONST, FF_DEBUG_VIS_MV_B_FOR, INT_MIN, INT_MAX, V|D, "debug_mv"},
-{"bb", "backward predicted MVs of B-frames", 0, FF_OPT_TYPE_CONST, FF_DEBUG_VIS_MV_B_BACK, INT_MIN, INT_MAX, V|D, "debug_mv"},
-{"mb_qmin", "obsolete, use qmin", OFFSET(mb_qmin), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
-{"mb_qmax", "obsolete, use qmax", OFFSET(mb_qmax), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
-{"cmp", "full pel me compare function", OFFSET(me_cmp), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"subcmp", "sub pel me compare function", OFFSET(me_sub_cmp), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"mbcmp", "macroblock compare function", OFFSET(mb_cmp), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"ildctcmp", "interlaced dct compare function", OFFSET(ildct_cmp), FF_OPT_TYPE_INT, FF_CMP_VSAD, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"dia_size", "diamond type & size for motion estimation", OFFSET(dia_size), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
-{"last_pred", "amount of motion predictors from the previous frame", OFFSET(last_predictor_count), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
-{"preme", "pre motion estimation", OFFSET(pre_me), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
-{"precmp", "pre motion estimation compare function", OFFSET(me_pre_cmp), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"sad", "sum of absolute differences, fast (default)", 0, FF_OPT_TYPE_CONST, FF_CMP_SAD, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"sse", "sum of squared errors", 0, FF_OPT_TYPE_CONST, FF_CMP_SSE, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"satd", "sum of absolute Hadamard transformed differences", 0, FF_OPT_TYPE_CONST, FF_CMP_SATD, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"dct", "sum of absolute DCT transformed differences", 0, FF_OPT_TYPE_CONST, FF_CMP_DCT, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"psnr", "sum of squared quantization errors (avoid, low quality)", 0, FF_OPT_TYPE_CONST, FF_CMP_PSNR, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"bit", "number of bits needed for the block", 0, FF_OPT_TYPE_CONST, FF_CMP_BIT, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"rd", "rate distortion optimal, slow", 0, FF_OPT_TYPE_CONST, FF_CMP_RD, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"zero", "0", 0, FF_OPT_TYPE_CONST, FF_CMP_ZERO, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"vsad", "sum of absolute vertical differences", 0, FF_OPT_TYPE_CONST, FF_CMP_VSAD, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"vsse","sum of squared vertical differences", 0, FF_OPT_TYPE_CONST, FF_CMP_VSSE, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"nsse", "noise preserving sum of squared differences", 0, FF_OPT_TYPE_CONST, FF_CMP_NSSE, INT_MIN, INT_MAX, V|E, "cmp_func"},
-#ifdef CONFIG_SNOW_ENCODER
-{"w53", "5/3 wavelet, only used in snow", 0, FF_OPT_TYPE_CONST, FF_CMP_W53, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"w97", "9/7 wavelet, only used in snow", 0, FF_OPT_TYPE_CONST, FF_CMP_W97, INT_MIN, INT_MAX, V|E, "cmp_func"},
-#endif
-{"dctmax", NULL, 0, FF_OPT_TYPE_CONST, FF_CMP_DCTMAX, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"chroma", NULL, 0, FF_OPT_TYPE_CONST, FF_CMP_CHROMA, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"pre_dia_size", "diamond type & size for motion estimation pre-pass", OFFSET(pre_dia_size), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
-{"subq", "sub pel motion estimation quality", OFFSET(me_subpel_quality), FF_OPT_TYPE_INT, 8, INT_MIN, INT_MAX, V|E},
-{"dtg_active_format", NULL, OFFSET(dtg_active_format), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
-{"me_range", "limit motion vectors range (1023 for DivX player)", OFFSET(me_range), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
-{"ibias", "intra quant bias", OFFSET(intra_quant_bias), FF_OPT_TYPE_INT, FF_DEFAULT_QUANT_BIAS, INT_MIN, INT_MAX, V|E},
-{"pbias", "inter quant bias", OFFSET(inter_quant_bias), FF_OPT_TYPE_INT, FF_DEFAULT_QUANT_BIAS, INT_MIN, INT_MAX, V|E},
-{"color_table_id", NULL, OFFSET(color_table_id), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
-{"internal_buffer_count", NULL, OFFSET(internal_buffer_count), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
-{"global_quality", NULL, OFFSET(global_quality), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
-{"coder", NULL, OFFSET(coder_type), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E, "coder"},
-{"vlc", "variable length coder / huffman coder", 0, FF_OPT_TYPE_CONST, FF_CODER_TYPE_VLC, INT_MIN, INT_MAX, V|E, "coder"},
-{"ac", "arithmetic coder", 0, FF_OPT_TYPE_CONST, FF_CODER_TYPE_AC, INT_MIN, INT_MAX, V|E, "coder"},
-{"context", "context model", OFFSET(context_model), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
-{"slice_flags", NULL, OFFSET(slice_flags), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
-{"xvmc_acceleration", NULL, OFFSET(xvmc_acceleration), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
-{"mbd", "macroblock decision algorithm (high quality mode)", OFFSET(mb_decision), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E, "mbd"},
-{"simple", "use mbcmp (default)", 0, FF_OPT_TYPE_CONST, FF_MB_DECISION_SIMPLE, INT_MIN, INT_MAX, V|E, "mbd"},
-{"bits", "use fewest bits", 0, FF_OPT_TYPE_CONST, FF_MB_DECISION_BITS, INT_MIN, INT_MAX, V|E, "mbd"},
-{"rd", "use best rate distortion", 0, FF_OPT_TYPE_CONST, FF_MB_DECISION_RD, INT_MIN, INT_MAX, V|E, "mbd"},
-{"stream_codec_tag", NULL, OFFSET(stream_codec_tag), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
-{"sc_threshold", "scene change threshold", OFFSET(scenechange_threshold), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
-{"lmin", "min lagrange factor (VBR)", OFFSET(lmin), FF_OPT_TYPE_INT, 2*FF_QP2LAMBDA, 0, INT_MAX, V|E},
-{"lmax", "max lagrange factor (VBR)", OFFSET(lmax), FF_OPT_TYPE_INT, 31*FF_QP2LAMBDA, 0, INT_MAX, V|E},
-{"nr", "noise reduction", OFFSET(noise_reduction), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
-{"rc_init_occupancy", "number of bits which should be loaded into the rc buffer before decoding starts", OFFSET(rc_initial_buffer_occupancy), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
-{"inter_threshold", NULL, OFFSET(inter_threshold), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
-{"flags2", NULL, OFFSET(flags2), FF_OPT_TYPE_FLAGS, CODEC_FLAG2_FASTPSKIP, INT_MIN, INT_MAX, V|A|E|D, "flags2"},
-{"error", NULL, OFFSET(error_rate), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
-{"antialias", "MP3 antialias algorithm", OFFSET(antialias_algo), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|D, "aa"},
-{"auto", NULL, 0, FF_OPT_TYPE_CONST, FF_AA_AUTO, INT_MIN, INT_MAX, V|D, "aa"},
-{"fastint", NULL, 0, FF_OPT_TYPE_CONST, FF_AA_FASTINT, INT_MIN, INT_MAX, V|D, "aa"},
-{"int", NULL, 0, FF_OPT_TYPE_CONST, FF_AA_INT, INT_MIN, INT_MAX, V|D, "aa"},
-{"float", NULL, 0, FF_OPT_TYPE_CONST, FF_AA_FLOAT, INT_MIN, INT_MAX, V|D, "aa"},
-{"qns", "quantizer noise shaping", OFFSET(quantizer_noise_shaping), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
-{"threads", NULL, OFFSET(thread_count), FF_OPT_TYPE_INT, 1, INT_MIN, INT_MAX, V|E|D},
-{"me_threshold", "motion estimaton threshold", OFFSET(me_threshold), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
-{"mb_threshold", "macroblock threshold", OFFSET(mb_threshold), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
-{"dc", "intra_dc_precision", OFFSET(intra_dc_precision), FF_OPT_TYPE_INT, 0, INT_MIN, INT_MAX, V|E},
-{"nssew", "nsse weight", OFFSET(nsse_weight), FF_OPT_TYPE_INT, 8, INT_MIN, INT_MAX, V|E},
-{"skip_top", "number of macroblock rows at the top which are skipped", OFFSET(skip_top), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|D},
-{"skip_bottom", "number of macroblock rows at the bottom which are skipped", OFFSET(skip_bottom), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|D},
-{"profile", NULL, OFFSET(profile), FF_OPT_TYPE_INT, FF_PROFILE_UNKNOWN, INT_MIN, INT_MAX, V|A|E, "profile"},
-{"unknown", NULL, 0, FF_OPT_TYPE_CONST, FF_PROFILE_UNKNOWN, INT_MIN, INT_MAX, V|A|E, "profile"},
-{"level", NULL, OFFSET(level), FF_OPT_TYPE_INT, FF_LEVEL_UNKNOWN, INT_MIN, INT_MAX, V|A|E, "level"},
-{"unknown", NULL, 0, FF_OPT_TYPE_CONST, FF_LEVEL_UNKNOWN, INT_MIN, INT_MAX, V|A|E, "level"},
-{"lowres", "decode at 1= 1/2, 2=1/4, 3=1/8 resolutions", OFFSET(lowres), FF_OPT_TYPE_INT, 0, 0, INT_MAX, V|D},
-{"skip_threshold", "frame skip threshold", OFFSET(frame_skip_threshold), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
-{"skip_factor", "frame skip factor", OFFSET(frame_skip_factor), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
-{"skip_exp", "frame skip exponent", OFFSET(frame_skip_exp), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
-{"skipcmp", "frame skip compare function", OFFSET(frame_skip_cmp), FF_OPT_TYPE_INT, FF_CMP_DCTMAX, INT_MIN, INT_MAX, V|E, "cmp_func"},
-{"border_mask", "increases the quantizer for macroblocks close to borders", OFFSET(border_masking), FF_OPT_TYPE_FLOAT, DEFAULT, -FLT_MAX, FLT_MAX, V|E},
-{"mblmin", "min macroblock lagrange factor (VBR)", OFFSET(mb_lmin), FF_OPT_TYPE_INT, FF_QP2LAMBDA * 2, 1, FF_LAMBDA_MAX, V|E},
-{"mblmax", "max macroblock lagrange factor (VBR)", OFFSET(mb_lmax), FF_OPT_TYPE_INT, FF_QP2LAMBDA * 31, 1, FF_LAMBDA_MAX, V|E},
-{"mepc", "motion estimation bitrate penalty compensation (1.0 = 256)", OFFSET(me_penalty_compensation), FF_OPT_TYPE_INT, 256, INT_MIN, INT_MAX, V|E},
-{"bidir_refine", "refine the two motion vectors used in bidirectional macroblocks", OFFSET(bidir_refine), FF_OPT_TYPE_INT, DEFAULT, 0, 4, V|E},
-{"brd_scale", "downscales frames for dynamic B-frame decision", OFFSET(brd_scale), FF_OPT_TYPE_INT, DEFAULT, 0, 10, V|E},
-{"crf", "enables constant quality mode, and selects the quality (x264)", OFFSET(crf), FF_OPT_TYPE_FLOAT, DEFAULT, 0, 51, V|E},
-{"cqp", "constant quantization parameter rate control method", OFFSET(cqp), FF_OPT_TYPE_INT, -1, INT_MIN, INT_MAX, V|E},
-{"keyint_min", "minimum interval between IDR-frames (x264)", OFFSET(keyint_min), FF_OPT_TYPE_INT, 25, INT_MIN, INT_MAX, V|E},
-{"refs", "reference frames to consider for motion compensation (Snow)", OFFSET(refs), FF_OPT_TYPE_INT, 1, INT_MIN, INT_MAX, V|E},
-{"chromaoffset", "chroma qp offset from luma", OFFSET(chromaoffset), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
-{"bframebias", "influences how often B-frames are used", OFFSET(bframebias), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E},
-{"trellis", "rate-distortion optimal quantization", OFFSET(trellis), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|A|E},
-{"directpred", "direct mv prediction mode - 0 (none), 1 (spatial), 2 (temporal)", OFFSET(directpred), FF_OPT_TYPE_INT, 2, INT_MIN, INT_MAX, V|E},
-{"bpyramid", "allows B-frames to be used as references for predicting", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_BPYRAMID, INT_MIN, INT_MAX, V|E, "flags2"},
-{"wpred", "weighted biprediction for b-frames (H.264)", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_WPRED, INT_MIN, INT_MAX, V|E, "flags2"},
-{"mixed_refs", "one reference per partition, as opposed to one reference per macroblock", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_MIXED_REFS, INT_MIN, INT_MAX, V|E, "flags2"},
-{"8x8dct", "high profile 8x8 transform (H.264)", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_8X8DCT, INT_MIN, INT_MAX, V|E, "flags2"},
-{"fastpskip", "fast pskip (H.264)", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_FASTPSKIP, INT_MIN, INT_MAX, V|E, "flags2"},
-{"aud", "access unit delimiters (H.264)", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_AUD, INT_MIN, INT_MAX, V|E, "flags2"},
-{"brdo", "b-frame rate-distortion optimization", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_BRDO, INT_MIN, INT_MAX, V|E, "flags2"},
-{"skiprd", "RD optimal MB level residual skiping", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_SKIP_RD, INT_MIN, INT_MAX, V|E, "flags2"},
-{"complexityblur", "reduce fluctuations in qp (before curve compression)", OFFSET(complexityblur), FF_OPT_TYPE_FLOAT, 20.0, FLT_MIN, FLT_MAX, V|E},
-{"deblockalpha", "in-loop deblocking filter alphac0 parameter", OFFSET(deblockalpha), FF_OPT_TYPE_INT, DEFAULT, -6, 6, V|E},
-{"deblockbeta", "in-loop deblocking filter beta parameter", OFFSET(deblockbeta), FF_OPT_TYPE_INT, DEFAULT, -6, 6, V|E},
-{"partitions", "macroblock subpartition sizes to consider", OFFSET(partitions), FF_OPT_TYPE_FLAGS, DEFAULT, INT_MIN, INT_MAX, V|E, "partitions"},
-{"parti4x4", NULL, 0, FF_OPT_TYPE_CONST, X264_PART_I4X4, INT_MIN, INT_MAX, V|E, "partitions"},
-{"parti8x8", NULL, 0, FF_OPT_TYPE_CONST, X264_PART_I8X8, INT_MIN, INT_MAX, V|E, "partitions"},
-{"partp4x4", NULL, 0, FF_OPT_TYPE_CONST, X264_PART_P4X4, INT_MIN, INT_MAX, V|E, "partitions"},
-{"partp8x8", NULL, 0, FF_OPT_TYPE_CONST, X264_PART_P8X8, INT_MIN, INT_MAX, V|E, "partitions"},
-{"partb8x8", NULL, 0, FF_OPT_TYPE_CONST, X264_PART_B8X8, INT_MIN, INT_MAX, V|E, "partitions"},
-{"sc_factor", "multiplied by qscale for each frame and added to scene_change_score", OFFSET(scenechange_factor), FF_OPT_TYPE_INT, 6, 0, INT_MAX, V|E},
-{"mv0_threshold", NULL, OFFSET(mv0_threshold), FF_OPT_TYPE_INT, 256, 0, INT_MAX, V|E},
-{"ivlc", "intra vlc table", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_INTRA_VLC, INT_MIN, INT_MAX, V|E, "flags2"},
-{"b_sensitivity", "adjusts sensitivity of b_frame_strategy 1", OFFSET(b_sensitivity), FF_OPT_TYPE_INT, 40, 1, INT_MAX, V|E},
-{"compression_level", NULL, OFFSET(compression_level), FF_OPT_TYPE_INT, FF_COMPRESSION_DEFAULT, INT_MIN, INT_MAX, V|A|E},
-{"use_lpc", "sets whether to use LPC mode (FLAC)", OFFSET(use_lpc), FF_OPT_TYPE_INT, -1, INT_MIN, INT_MAX, A|E},
-{"lpc_coeff_precision", "LPC coefficient precision (FLAC)", OFFSET(lpc_coeff_precision), FF_OPT_TYPE_INT, DEFAULT, 0, INT_MAX, A|E},
-{"min_prediction_order", NULL, OFFSET(min_prediction_order), FF_OPT_TYPE_INT, -1, INT_MIN, INT_MAX, A|E},
-{"max_prediction_order", NULL, OFFSET(max_prediction_order), FF_OPT_TYPE_INT, -1, INT_MIN, INT_MAX, A|E},
-{"prediction_order_method", "search method for selecting prediction order", OFFSET(prediction_order_method), FF_OPT_TYPE_INT, -1, INT_MIN, INT_MAX, A|E},
-{"min_partition_order", NULL, OFFSET(min_partition_order), FF_OPT_TYPE_INT, -1, INT_MIN, INT_MAX, A|E},
-{"max_partition_order", NULL, OFFSET(max_partition_order), FF_OPT_TYPE_INT, -1, INT_MIN, INT_MAX, A|E},
-{"timecode_frame_start", "GOP timecode frame start number, in non drop frame format", OFFSET(timecode_frame_start), FF_OPT_TYPE_INT, 0, 0, INT_MAX, V|E},
-{"drop_frame_timecode", NULL, 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_DROP_FRAME_TIMECODE, INT_MIN, INT_MAX, V|E, "flags2"},
-{NULL},
-};
-
-#undef A
-#undef V
-#undef S
-#undef E
-#undef D
-#undef DEFAULT
-
-static AVClass av_codec_context_class = { "AVCodecContext", context_to_name, options };
-
-void avcodec_get_context_defaults(AVCodecContext *s){
- memset(s, 0, sizeof(AVCodecContext));
-
- s->av_class= &av_codec_context_class;
-
- av_opt_set_defaults(s);
-
- s->rc_eq= "tex^qComp";
- s->time_base= (AVRational){0,1};
- s->get_buffer= avcodec_default_get_buffer;
- s->release_buffer= avcodec_default_release_buffer;
- s->get_format= avcodec_default_get_format;
- s->execute= avcodec_default_execute;
- s->sample_aspect_ratio= (AVRational){0,1};
- s->pix_fmt= PIX_FMT_NONE;
- s->sample_fmt= SAMPLE_FMT_S16; // FIXME: set to NONE
-
- s->palctrl = NULL;
- s->reget_buffer= avcodec_default_reget_buffer;
-}
-
-/**
- * allocates a AVCodecContext and set it to defaults.
- * this can be deallocated by simply calling free()
- */
-AVCodecContext *avcodec_alloc_context(void){
- AVCodecContext *avctx= av_malloc(sizeof(AVCodecContext));
-
- if(avctx==NULL) return NULL;
-
- avcodec_get_context_defaults(avctx);
-
- return avctx;
-}
-
-void avcodec_get_frame_defaults(AVFrame *pic){
- memset(pic, 0, sizeof(AVFrame));
-
- pic->pts= AV_NOPTS_VALUE;
- pic->key_frame= 1;
-}
-
-/**
- * allocates a AVPFrame and set it to defaults.
- * this can be deallocated by simply calling free()
- */
-AVFrame *avcodec_alloc_frame(void){
- AVFrame *pic= av_malloc(sizeof(AVFrame));
-
- if(pic==NULL) return NULL;
-
- avcodec_get_frame_defaults(pic);
-
- return pic;
-}
-
-int avcodec_open(AVCodecContext *avctx, AVCodec *codec)
-{
- int ret= -1;
-
- entangled_thread_counter++;
- if(entangled_thread_counter != 1){
- av_log(avctx, AV_LOG_ERROR, "insufficient thread locking around avcodec_open/close()\n");
- goto end;
- }
-
- if(avctx->codec)
- goto end;
-
- if (codec->priv_data_size > 0) {
- avctx->priv_data = av_mallocz(codec->priv_data_size);
- if (!avctx->priv_data)
- goto end;
- } else {
- avctx->priv_data = NULL;
- }
-
- if(avctx->coded_width && avctx->coded_height)
- avcodec_set_dimensions(avctx, avctx->coded_width, avctx->coded_height);
- else if(avctx->width && avctx->height)
- avcodec_set_dimensions(avctx, avctx->width, avctx->height);
-
- if((avctx->coded_width||avctx->coded_height) && avcodec_check_dimensions(avctx,avctx->coded_width,avctx->coded_height)){
- av_freep(&avctx->priv_data);
- goto end;
- }
-
- avctx->codec = codec;
- avctx->codec_id = codec->id;
- avctx->frame_number = 0;
- ret = avctx->codec->init(avctx);
- if (ret < 0) {
- av_freep(&avctx->priv_data);
- avctx->codec= NULL;
- goto end;
- }
- ret=0;
-end:
- entangled_thread_counter--;
- return ret;
-}
-
-int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size,
- const short *samples)
-{
- if(buf_size < FF_MIN_BUFFER_SIZE && 0){
- av_log(avctx, AV_LOG_ERROR, "buffer smaller then minimum size\n");
- return -1;
- }
- if((avctx->codec->capabilities & CODEC_CAP_DELAY) || samples){
- int ret = avctx->codec->encode(avctx, buf, buf_size, (void *)samples);
- avctx->frame_number++;
- return ret;
- }else
- return 0;
-}
-
-int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
- const AVFrame *pict)
-{
- if(buf_size < FF_MIN_BUFFER_SIZE){
- av_log(avctx, AV_LOG_ERROR, "buffer smaller then minimum size\n");
- return -1;
- }
- if(avcodec_check_dimensions(avctx,avctx->width,avctx->height))
- return -1;
- if((avctx->codec->capabilities & CODEC_CAP_DELAY) || pict){
- int ret = avctx->codec->encode(avctx, buf, buf_size, (void *)pict);
- avctx->frame_number++;
- emms_c(); //needed to avoid an emms_c() call before every return;
-
- return ret;
- }else
- return 0;
-}
-
-int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
- const AVSubtitle *sub)
-{
- int ret;
- ret = avctx->codec->encode(avctx, buf, buf_size, (void *)sub);
- avctx->frame_number++;
- return ret;
-}
-
-/**
- * decode a frame.
- * @param buf bitstream buffer, must be FF_INPUT_BUFFER_PADDING_SIZE larger then the actual read bytes
- * because some optimized bitstream readers read 32 or 64 bit at once and could read over the end
- * @param buf_size the size of the buffer in bytes
- * @param got_picture_ptr zero if no frame could be decompressed, Otherwise, it is non zero
- * @return -1 if error, otherwise return the number of
- * bytes used.
- */
-int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
- int *got_picture_ptr,
- uint8_t *buf, int buf_size)
-{
- int ret;
-
- *got_picture_ptr= 0;
- if((avctx->coded_width||avctx->coded_height) && avcodec_check_dimensions(avctx,avctx->coded_width,avctx->coded_height))
- return -1;
- if((avctx->codec->capabilities & CODEC_CAP_DELAY) || buf_size){
- ret = avctx->codec->decode(avctx, picture, got_picture_ptr,
- buf, buf_size);
-
- emms_c(); //needed to avoid an emms_c() call before every return;
-
- if (*got_picture_ptr)
- avctx->frame_number++;
- }else
- ret= 0;
-
- return ret;
-}
-
-/* decode an audio frame. return -1 if error, otherwise return the
- *number of bytes used. If no frame could be decompressed,
- *frame_size_ptr is zero. Otherwise, it is the decompressed frame
- *size in BYTES. */
-int avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples,
- int *frame_size_ptr,
- uint8_t *buf, int buf_size)
-{
- int ret;
-
- //FIXME remove the check below _after_ ensuring that all audio check that the available space is enough
- if(*frame_size_ptr < AVCODEC_MAX_AUDIO_FRAME_SIZE){
- av_log(avctx, AV_LOG_ERROR, "buffer smaller then AVCODEC_MAX_AUDIO_FRAME_SIZE\n");
- return -1;
- }
- if(*frame_size_ptr < FF_MIN_BUFFER_SIZE ||
- *frame_size_ptr < avctx->channels * avctx->frame_size * sizeof(int16_t) ||
- *frame_size_ptr < buf_size){
- av_log(avctx, AV_LOG_ERROR, "buffer too small\n");
- return -1;
- }
- if((avctx->codec->capabilities & CODEC_CAP_DELAY) || buf_size){
- ret = avctx->codec->decode(avctx, samples, frame_size_ptr,
- buf, buf_size);
- avctx->frame_number++;
- }else{
- ret= 0;
- *frame_size_ptr=0;
- }
- return ret;
-}
-
-#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
-int avcodec_decode_audio(AVCodecContext *avctx, int16_t *samples,
- int *frame_size_ptr,
- uint8_t *buf, int buf_size){
- *frame_size_ptr= AVCODEC_MAX_AUDIO_FRAME_SIZE;
- return avcodec_decode_audio2(avctx, samples, frame_size_ptr, buf, buf_size);
-}
-#endif
-
-
-/* decode a subtitle message. return -1 if error, otherwise return the
- *number of bytes used. If no subtitle could be decompressed,
- *got_sub_ptr is zero. Otherwise, the subtitle is stored in *sub. */
-int avcodec_decode_subtitle(AVCodecContext *avctx, AVSubtitle *sub,
- int *got_sub_ptr,
- const uint8_t *buf, int buf_size)
-{
- int ret;
-
- *got_sub_ptr = 0;
- ret = avctx->codec->decode(avctx, sub, got_sub_ptr,
- (uint8_t *)buf, buf_size);
- if (*got_sub_ptr)
- avctx->frame_number++;
- return ret;
-}
-
-int avcodec_close(AVCodecContext *avctx)
-{
- entangled_thread_counter++;
- if(entangled_thread_counter != 1){
- av_log(avctx, AV_LOG_ERROR, "insufficient thread locking around avcodec_open/close()\n");
- entangled_thread_counter--;
- return -1;
- }
-
- if (avctx->codec->close)
- avctx->codec->close(avctx);
- avcodec_default_free_buffers(avctx);
- av_freep(&avctx->priv_data);
- avctx->codec = NULL;
- entangled_thread_counter--;
- return 0;
-}
-
-AVCodec *avcodec_find_encoder(enum CodecID id)
-{
- AVCodec *p;
- p = first_avcodec;
- while (p) {
- if (p->encode != NULL && p->id == id)
- return p;
- p = p->next;
- }
- return NULL;
-}
-
-AVCodec *avcodec_find_encoder_by_name(const char *name)
-{
- AVCodec *p;
- p = first_avcodec;
- while (p) {
- if (p->encode != NULL && strcmp(name,p->name) == 0)
- return p;
- p = p->next;
- }
- return NULL;
-}
-
-AVCodec *avcodec_find_decoder(enum CodecID id)
-{
- AVCodec *p;
- p = first_avcodec;
- while (p) {
- if (p->decode != NULL && p->id == id)
- return p;
- p = p->next;
- }
- return NULL;
-}
-
-AVCodec *avcodec_find_decoder_by_name(const char *name)
-{
- AVCodec *p;
- p = first_avcodec;
- while (p) {
- if (p->decode != NULL && strcmp(name,p->name) == 0)
- return p;
- p = p->next;
- }
- return NULL;
-}
-
-void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
-{
- const char *codec_name;
- AVCodec *p;
- char buf1[32];
- char channels_str[100];
- int bitrate;
-
- if (encode)
- p = avcodec_find_encoder(enc->codec_id);
- else
- p = avcodec_find_decoder(enc->codec_id);
-
- if (p) {
- codec_name = p->name;
- if (!encode && enc->codec_id == CODEC_ID_MP3) {
- if (enc->sub_id == 2)
- codec_name = "mp2";
- else if (enc->sub_id == 1)
- codec_name = "mp1";
- }
- } else if (enc->codec_id == CODEC_ID_MPEG2TS) {
- /* fake mpeg2 transport stream codec (currently not
- registered) */
- codec_name = "mpeg2ts";
- } else if (enc->codec_name[0] != '\0') {
- codec_name = enc->codec_name;
- } else {
- /* output avi tags */
- if( isprint(enc->codec_tag&0xFF) && isprint((enc->codec_tag>>8)&0xFF)
- && isprint((enc->codec_tag>>16)&0xFF) && isprint((enc->codec_tag>>24)&0xFF)){
- snprintf(buf1, sizeof(buf1), "%c%c%c%c / 0x%04X",
- enc->codec_tag & 0xff,
- (enc->codec_tag >> 8) & 0xff,
- (enc->codec_tag >> 16) & 0xff,
- (enc->codec_tag >> 24) & 0xff,
- enc->codec_tag);
- } else {
- snprintf(buf1, sizeof(buf1), "0x%04x", enc->codec_tag);
- }
- codec_name = buf1;
- }
-
- switch(enc->codec_type) {
- case CODEC_TYPE_VIDEO:
- snprintf(buf, buf_size,
- "Video: %s%s",
- codec_name, enc->mb_decision ? " (hq)" : "");
- if (enc->pix_fmt != PIX_FMT_NONE) {
- snprintf(buf + strlen(buf), buf_size - strlen(buf),
- ", %s",
- avcodec_get_pix_fmt_name(enc->pix_fmt));
- }
- if (enc->width) {
- snprintf(buf + strlen(buf), buf_size - strlen(buf),
- ", %dx%d",
- enc->width, enc->height);
- if(av_log_get_level() >= AV_LOG_DEBUG){
- int g= ff_gcd(enc->time_base.num, enc->time_base.den);
- snprintf(buf + strlen(buf), buf_size - strlen(buf),
- ", %d/%d",
- enc->time_base.num/g, enc->time_base.den/g);
- }
- }
- if (encode) {
- snprintf(buf + strlen(buf), buf_size - strlen(buf),
- ", q=%d-%d", enc->qmin, enc->qmax);
- }
- bitrate = enc->bit_rate;
- break;
- case CODEC_TYPE_AUDIO:
- snprintf(buf, buf_size,
- "Audio: %s",
- codec_name);
- switch (enc->channels) {
- case 1:
- strcpy(channels_str, "mono");
- break;
- case 2:
- strcpy(channels_str, "stereo");
- break;
- case 6:
- strcpy(channels_str, "5:1");
- break;
- default:
- snprintf(channels_str, sizeof(channels_str), "%d channels", enc->channels);
- break;
- }
- if (enc->sample_rate) {
- snprintf(buf + strlen(buf), buf_size - strlen(buf),
- ", %d Hz, %s",
- enc->sample_rate,
- channels_str);
- }
-
- /* for PCM codecs, compute bitrate directly */
- switch(enc->codec_id) {
- case CODEC_ID_PCM_S32LE:
- case CODEC_ID_PCM_S32BE:
- case CODEC_ID_PCM_U32LE:
- case CODEC_ID_PCM_U32BE:
- bitrate = enc->sample_rate * enc->channels * 32;
- break;
- case CODEC_ID_PCM_S24LE:
- case CODEC_ID_PCM_S24BE:
- case CODEC_ID_PCM_U24LE:
- case CODEC_ID_PCM_U24BE:
- case CODEC_ID_PCM_S24DAUD:
- bitrate = enc->sample_rate * enc->channels * 24;
- break;
- case CODEC_ID_PCM_S16LE:
- case CODEC_ID_PCM_S16BE:
- case CODEC_ID_PCM_U16LE:
- case CODEC_ID_PCM_U16BE:
- bitrate = enc->sample_rate * enc->channels * 16;
- break;
- case CODEC_ID_PCM_S8:
- case CODEC_ID_PCM_U8:
- case CODEC_ID_PCM_ALAW:
- case CODEC_ID_PCM_MULAW:
- bitrate = enc->sample_rate * enc->channels * 8;
- break;
- default:
- bitrate = enc->bit_rate;
- break;
- }
- break;
- case CODEC_TYPE_DATA:
- snprintf(buf, buf_size, "Data: %s", codec_name);
- bitrate = enc->bit_rate;
- break;
- case CODEC_TYPE_SUBTITLE:
- snprintf(buf, buf_size, "Subtitle: %s", codec_name);
- bitrate = enc->bit_rate;
- break;
- default:
- snprintf(buf, buf_size, "Invalid Codec type %d", enc->codec_type);
- return;
- }
- if (encode) {
- if (enc->flags & CODEC_FLAG_PASS1)
- snprintf(buf + strlen(buf), buf_size - strlen(buf),
- ", pass 1");
- if (enc->flags & CODEC_FLAG_PASS2)
- snprintf(buf + strlen(buf), buf_size - strlen(buf),
- ", pass 2");
- }
- if (bitrate != 0) {
- snprintf(buf + strlen(buf), buf_size - strlen(buf),
- ", %d kb/s", bitrate / 1000);
- }
-}
-
-unsigned avcodec_version( void )
-{
- return LIBAVCODEC_VERSION_INT;
-}
-
-unsigned avcodec_build( void )
-{
- return LIBAVCODEC_BUILD;
-}
-
-static void init_crcs(void){
- av_crc04C11DB7= av_mallocz_static(sizeof(AVCRC) * 257);
- av_crc8005 = av_mallocz_static(sizeof(AVCRC) * 257);
- av_crc07 = av_mallocz_static(sizeof(AVCRC) * 257);
- av_crc_init(av_crc04C11DB7, 0, 32, 0x04c11db7, sizeof(AVCRC)*257);
- av_crc_init(av_crc8005 , 0, 16, 0x8005 , sizeof(AVCRC)*257);
- av_crc_init(av_crc07 , 0, 8, 0x07 , sizeof(AVCRC)*257);
-}
-
-/* must be called before any other functions */
-void avcodec_init(void)
-{
- static int inited = 0;
-
- if (inited != 0)
- return;
- inited = 1;
-
- dsputil_static_init();
- init_crcs();
-}
-
-/**
- * Flush buffers, should be called when seeking or when swicthing to a different stream.
- */
-void avcodec_flush_buffers(AVCodecContext *avctx)
-{
- if(avctx->codec->flush)
- avctx->codec->flush(avctx);
-}
-
-void avcodec_default_free_buffers(AVCodecContext *s){
- int i, j;
-
- if(s->internal_buffer==NULL) return;
-
- for(i=0; i<INTERNAL_BUFFER_SIZE; i++){
- InternalBuffer *buf= &((InternalBuffer*)s->internal_buffer)[i];
- for(j=0; j<4; j++){
- av_freep(&buf->base[j]);
- buf->data[j]= NULL;
- }
- }
- av_freep(&s->internal_buffer);
-
- s->internal_buffer_count=0;
-}
-
-char av_get_pict_type_char(int pict_type){
- switch(pict_type){
- case I_TYPE: return 'I';
- case P_TYPE: return 'P';
- case B_TYPE: return 'B';
- case S_TYPE: return 'S';
- case SI_TYPE:return 'i';
- case SP_TYPE:return 'p';
- default: return '?';
- }
-}
-
-int av_get_bits_per_sample(enum CodecID codec_id){
- switch(codec_id){
- case CODEC_ID_ADPCM_SBPRO_2:
- return 2;
- case CODEC_ID_ADPCM_SBPRO_3:
- return 3;
- case CODEC_ID_ADPCM_SBPRO_4:
- case CODEC_ID_ADPCM_CT:
- return 4;
- case CODEC_ID_PCM_ALAW:
- case CODEC_ID_PCM_MULAW:
- case CODEC_ID_PCM_S8:
- case CODEC_ID_PCM_U8:
- return 8;
- case CODEC_ID_PCM_S16BE:
- case CODEC_ID_PCM_S16LE:
- case CODEC_ID_PCM_U16BE:
- case CODEC_ID_PCM_U16LE:
- return 16;
- case CODEC_ID_PCM_S24DAUD:
- case CODEC_ID_PCM_S24BE:
- case CODEC_ID_PCM_S24LE:
- case CODEC_ID_PCM_U24BE:
- case CODEC_ID_PCM_U24LE:
- return 24;
- case CODEC_ID_PCM_S32BE:
- case CODEC_ID_PCM_S32LE:
- case CODEC_ID_PCM_U32BE:
- case CODEC_ID_PCM_U32LE:
- return 32;
- default:
- return 0;
- }
-}
-
-#if !defined(HAVE_THREADS)
-int avcodec_thread_init(AVCodecContext *s, int thread_count){
- return -1;
-}
-#endif
-
-unsigned int av_xiphlacing(unsigned char *s, unsigned int v)
-{
- unsigned int n = 0;
-
- while(v >= 0xff) {
- *s++ = 0xff;
- v -= 0xff;
- n++;
- }
- *s = v;
- n++;
- return n;
-}
-
-/* Wrapper to work around the lack of mkstemp() on mingw/cygin.
- * Also, tries to create file in /tmp first, if possible.
- * *prefix can be a character constant; *filename will be allocated internally.
- * Returns file descriptor of opened file (or -1 on error)
- * and opened file name in **filename. */
-int av_tempfile(char *prefix, char **filename) {
- int fd=-1;
-#ifdef __MINGW32__
- *filename = tempnam(".", prefix);
-#else
- size_t len = strlen(prefix) + 12; /* room for "/tmp/" and "XXXXXX\0" */
- *filename = av_malloc(len);
-#endif
- /* -----common section-----*/
- if (*filename == NULL) {
- av_log(NULL, AV_LOG_ERROR, "ff_tempfile: Cannot allocate file name\n");
- return -1;
- }
-#ifdef __MINGW32__
- fd = open(*filename, _O_RDWR | _O_BINARY | _O_CREAT, 0444);
-#else
- snprintf(*filename, len, "/tmp/%sXXXXXX", prefix);
- fd = mkstemp(*filename);
- if (fd < 0) {
- snprintf(*filename, len, "./%sXXXXXX", prefix);
- fd = mkstemp(*filename);
- }
-#endif
- /* -----common section-----*/
- if (fd < 0) {
- av_log(NULL, AV_LOG_ERROR, "ff_tempfile: Cannot open temporary file %s\n", *filename);
- return -1;
- }
- return fd; /* success */
-}
diff --git a/src/libffmpeg/libavcodec/vc1.c b/src/libffmpeg/libavcodec/vc1.c
deleted file mode 100644
index 40b79b326..000000000
--- a/src/libffmpeg/libavcodec/vc1.c
+++ /dev/null
@@ -1,4390 +0,0 @@
-/*
- * VC-1 and WMV3 decoder
- * Copyright (c) 2006 Konstantin Shishkov
- * Partly based on vc9.c (c) 2005 Anonymous, Alex Beregszaszi, Michael Niedermayer
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file vc1.c
- * VC-1 and WMV3 decoder
- *
- */
-#include "common.h"
-#include "dsputil.h"
-#include "avcodec.h"
-#include "mpegvideo.h"
-#include "vc1data.h"
-#include "vc1acdata.h"
-
-#undef NDEBUG
-#include <assert.h>
-
-extern const uint32_t ff_table0_dc_lum[120][2], ff_table1_dc_lum[120][2];
-extern const uint32_t ff_table0_dc_chroma[120][2], ff_table1_dc_chroma[120][2];
-extern VLC ff_msmp4_dc_luma_vlc[2], ff_msmp4_dc_chroma_vlc[2];
-#define MB_INTRA_VLC_BITS 9
-extern VLC ff_msmp4_mb_i_vlc;
-extern const uint16_t ff_msmp4_mb_i_table[64][2];
-#define DC_VLC_BITS 9
-#define AC_VLC_BITS 9
-static const uint16_t table_mb_intra[64][2];
-
-
-/** Available Profiles */
-//@{
-enum Profile {
- PROFILE_SIMPLE,
- PROFILE_MAIN,
- PROFILE_COMPLEX, ///< TODO: WMV9 specific
- PROFILE_ADVANCED
-};
-//@}
-
-/** Sequence quantizer mode */
-//@{
-enum QuantMode {
- QUANT_FRAME_IMPLICIT, ///< Implicitly specified at frame level
- QUANT_FRAME_EXPLICIT, ///< Explicitly specified at frame level
- QUANT_NON_UNIFORM, ///< Non-uniform quant used for all frames
- QUANT_UNIFORM ///< Uniform quant used for all frames
-};
-//@}
-
-/** Where quant can be changed */
-//@{
-enum DQProfile {
- DQPROFILE_FOUR_EDGES,
- DQPROFILE_DOUBLE_EDGES,
- DQPROFILE_SINGLE_EDGE,
- DQPROFILE_ALL_MBS
-};
-//@}
-
-/** @name Where quant can be changed
- */
-//@{
-enum DQSingleEdge {
- DQSINGLE_BEDGE_LEFT,
- DQSINGLE_BEDGE_TOP,
- DQSINGLE_BEDGE_RIGHT,
- DQSINGLE_BEDGE_BOTTOM
-};
-//@}
-
-/** Which pair of edges is quantized with ALTPQUANT */
-//@{
-enum DQDoubleEdge {
- DQDOUBLE_BEDGE_TOPLEFT,
- DQDOUBLE_BEDGE_TOPRIGHT,
- DQDOUBLE_BEDGE_BOTTOMRIGHT,
- DQDOUBLE_BEDGE_BOTTOMLEFT
-};
-//@}
-
-/** MV modes for P frames */
-//@{
-enum MVModes {
- MV_PMODE_1MV_HPEL_BILIN,
- MV_PMODE_1MV,
- MV_PMODE_1MV_HPEL,
- MV_PMODE_MIXED_MV,
- MV_PMODE_INTENSITY_COMP
-};
-//@}
-
-/** @name MV types for B frames */
-//@{
-enum BMVTypes {
- BMV_TYPE_BACKWARD,
- BMV_TYPE_FORWARD,
- BMV_TYPE_INTERPOLATED
-};
-//@}
-
-/** @name Block types for P/B frames */
-//@{
-enum TransformTypes {
- TT_8X8,
- TT_8X4_BOTTOM,
- TT_8X4_TOP,
- TT_8X4, //Both halves
- TT_4X8_RIGHT,
- TT_4X8_LEFT,
- TT_4X8, //Both halves
- TT_4X4
-};
-//@}
-
-/** Table for conversion between TTBLK and TTMB */
-static const int ttblk_to_tt[3][8] = {
- { TT_8X4, TT_4X8, TT_8X8, TT_4X4, TT_8X4_TOP, TT_8X4_BOTTOM, TT_4X8_RIGHT, TT_4X8_LEFT },
- { TT_8X8, TT_4X8_RIGHT, TT_4X8_LEFT, TT_4X4, TT_8X4, TT_4X8, TT_8X4_BOTTOM, TT_8X4_TOP },
- { TT_8X8, TT_4X8, TT_4X4, TT_8X4_BOTTOM, TT_4X8_RIGHT, TT_4X8_LEFT, TT_8X4, TT_8X4_TOP }
-};
-
-static const int ttfrm_to_tt[4] = { TT_8X8, TT_8X4, TT_4X8, TT_4X4 };
-
-/** MV P mode - the 5th element is only used for mode 1 */
-static const uint8_t mv_pmode_table[2][5] = {
- { MV_PMODE_1MV_HPEL_BILIN, MV_PMODE_1MV, MV_PMODE_1MV_HPEL, MV_PMODE_INTENSITY_COMP, MV_PMODE_MIXED_MV },
- { MV_PMODE_1MV, MV_PMODE_MIXED_MV, MV_PMODE_1MV_HPEL, MV_PMODE_INTENSITY_COMP, MV_PMODE_1MV_HPEL_BILIN }
-};
-static const uint8_t mv_pmode_table2[2][4] = {
- { MV_PMODE_1MV_HPEL_BILIN, MV_PMODE_1MV, MV_PMODE_1MV_HPEL, MV_PMODE_MIXED_MV },
- { MV_PMODE_1MV, MV_PMODE_MIXED_MV, MV_PMODE_1MV_HPEL, MV_PMODE_1MV_HPEL_BILIN }
-};
-
-/** One more frame type */
-#define BI_TYPE 7
-
-static const int fps_nr[5] = { 24, 25, 30, 50, 60 },
- fps_dr[2] = { 1000, 1001 };
-static const uint8_t pquant_table[3][32] = {
- { /* Implicit quantizer */
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 6, 7, 8, 9, 10, 11, 12,
- 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 27, 29, 31
- },
- { /* Explicit quantizer, pquantizer uniform */
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
- },
- { /* Explicit quantizer, pquantizer non-uniform */
- 0, 1, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
- 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 31
- }
-};
-
-/** @name VC-1 VLC tables and defines
- * @todo TODO move this into the context
- */
-//@{
-#define VC1_BFRACTION_VLC_BITS 7
-static VLC vc1_bfraction_vlc;
-#define VC1_IMODE_VLC_BITS 4
-static VLC vc1_imode_vlc;
-#define VC1_NORM2_VLC_BITS 3
-static VLC vc1_norm2_vlc;
-#define VC1_NORM6_VLC_BITS 9
-static VLC vc1_norm6_vlc;
-/* Could be optimized, one table only needs 8 bits */
-#define VC1_TTMB_VLC_BITS 9 //12
-static VLC vc1_ttmb_vlc[3];
-#define VC1_MV_DIFF_VLC_BITS 9 //15
-static VLC vc1_mv_diff_vlc[4];
-#define VC1_CBPCY_P_VLC_BITS 9 //14
-static VLC vc1_cbpcy_p_vlc[4];
-#define VC1_4MV_BLOCK_PATTERN_VLC_BITS 6
-static VLC vc1_4mv_block_pattern_vlc[4];
-#define VC1_TTBLK_VLC_BITS 5
-static VLC vc1_ttblk_vlc[3];
-#define VC1_SUBBLKPAT_VLC_BITS 6
-static VLC vc1_subblkpat_vlc[3];
-
-static VLC vc1_ac_coeff_table[8];
-//@}
-
-enum CodingSet {
- CS_HIGH_MOT_INTRA = 0,
- CS_HIGH_MOT_INTER,
- CS_LOW_MOT_INTRA,
- CS_LOW_MOT_INTER,
- CS_MID_RATE_INTRA,
- CS_MID_RATE_INTER,
- CS_HIGH_RATE_INTRA,
- CS_HIGH_RATE_INTER
-};
-
-/** @name Overlap conditions for Advanced Profile */
-//@{
-enum COTypes {
- CONDOVER_NONE = 0,
- CONDOVER_ALL,
- CONDOVER_SELECT
-};
-//@}
-
-
-/** The VC1 Context
- * @fixme Change size wherever another size is more efficient
- * Many members are only used for Advanced Profile
- */
-typedef struct VC1Context{
- MpegEncContext s;
-
- int bits;
-
- /** Simple/Main Profile sequence header */
- //@{
- int res_sm; ///< reserved, 2b
- int res_x8; ///< reserved
- int multires; ///< frame-level RESPIC syntax element present
- int res_fasttx; ///< reserved, always 1
- int res_transtab; ///< reserved, always 0
- int rangered; ///< RANGEREDFRM (range reduction) syntax element present
- ///< at frame level
- int res_rtm_flag; ///< reserved, set to 1
- int reserved; ///< reserved
- //@}
-
- /** Advanced Profile */
- //@{
- int level; ///< 3bits, for Advanced/Simple Profile, provided by TS layer
- int chromaformat; ///< 2bits, 2=4:2:0, only defined
- int postprocflag; ///< Per-frame processing suggestion flag present
- int broadcast; ///< TFF/RFF present
- int interlace; ///< Progressive/interlaced (RPTFTM syntax element)
- int tfcntrflag; ///< TFCNTR present
- int panscanflag; ///< NUMPANSCANWIN, TOPLEFT{X,Y}, BOTRIGHT{X,Y} present
- int extended_dmv; ///< Additional extended dmv range at P/B frame-level
- int color_prim; ///< 8bits, chroma coordinates of the color primaries
- int transfer_char; ///< 8bits, Opto-electronic transfer characteristics
- int matrix_coef; ///< 8bits, Color primaries->YCbCr transform matrix
- int hrd_param_flag; ///< Presence of Hypothetical Reference
- ///< Decoder parameters
- int psf; ///< Progressive Segmented Frame
- //@}
-
- /** Sequence header data for all Profiles
- * TODO: choose between ints, uint8_ts and monobit flags
- */
- //@{
- int profile; ///< 2bits, Profile
- int frmrtq_postproc; ///< 3bits,
- int bitrtq_postproc; ///< 5bits, quantized framerate-based postprocessing strength
- int fastuvmc; ///< Rounding of qpel vector to hpel ? (not in Simple)
- int extended_mv; ///< Ext MV in P/B (not in Simple)
- int dquant; ///< How qscale varies with MBs, 2bits (not in Simple)
- int vstransform; ///< variable-size [48]x[48] transform type + info
- int overlap; ///< overlapped transforms in use
- int quantizer_mode; ///< 2bits, quantizer mode used for sequence, see QUANT_*
- int finterpflag; ///< INTERPFRM present
- //@}
-
- /** Frame decoding info for all profiles */
- //@{
- uint8_t mv_mode; ///< MV coding monde
- uint8_t mv_mode2; ///< Secondary MV coding mode (B frames)
- int k_x; ///< Number of bits for MVs (depends on MV range)
- int k_y; ///< Number of bits for MVs (depends on MV range)
- int range_x, range_y; ///< MV range
- uint8_t pq, altpq; ///< Current/alternate frame quantizer scale
- /** pquant parameters */
- //@{
- uint8_t dquantfrm;
- uint8_t dqprofile;
- uint8_t dqsbedge;
- uint8_t dqbilevel;
- //@}
- /** AC coding set indexes
- * @see 8.1.1.10, p(1)10
- */
- //@{
- int c_ac_table_index; ///< Chroma index from ACFRM element
- int y_ac_table_index; ///< Luma index from AC2FRM element
- //@}
- int ttfrm; ///< Transform type info present at frame level
- uint8_t ttmbf; ///< Transform type flag
- uint8_t ttblk4x4; ///< Value of ttblk which indicates a 4x4 transform
- int codingset; ///< index of current table set from 11.8 to use for luma block decoding
- int codingset2; ///< index of current table set from 11.8 to use for chroma block decoding
- int pqindex; ///< raw pqindex used in coding set selection
- int a_avail, c_avail;
- uint8_t *mb_type_base, *mb_type[3];
-
-
- /** Luma compensation parameters */
- //@{
- uint8_t lumscale;
- uint8_t lumshift;
- //@}
- int16_t bfraction; ///< Relative position % anchors=> how to scale MVs
- uint8_t halfpq; ///< Uniform quant over image and qp+.5
- uint8_t respic; ///< Frame-level flag for resized images
- int buffer_fullness; ///< HRD info
- /** Ranges:
- * -# 0 -> [-64n 63.f] x [-32, 31.f]
- * -# 1 -> [-128, 127.f] x [-64, 63.f]
- * -# 2 -> [-512, 511.f] x [-128, 127.f]
- * -# 3 -> [-1024, 1023.f] x [-256, 255.f]
- */
- uint8_t mvrange;
- uint8_t pquantizer; ///< Uniform (over sequence) quantizer in use
- VLC *cbpcy_vlc; ///< CBPCY VLC table
- int tt_index; ///< Index for Transform Type tables
- uint8_t* mv_type_mb_plane; ///< bitplane for mv_type == (4MV)
- uint8_t* direct_mb_plane; ///< bitplane for "direct" MBs
- int mv_type_is_raw; ///< mv type mb plane is not coded
- int dmb_is_raw; ///< direct mb plane is raw
- int skip_is_raw; ///< skip mb plane is not coded
- uint8_t luty[256], lutuv[256]; // lookup tables used for intensity compensation
- int use_ic; ///< use intensity compensation in B-frames
- int rnd; ///< rounding control
-
- /** Frame decoding info for S/M profiles only */
- //@{
- uint8_t rangeredfrm; ///< out_sample = CLIP((in_sample-128)*2+128)
- uint8_t interpfrm;
- //@}
-
- /** Frame decoding info for Advanced profile */
- //@{
- uint8_t fcm; ///< 0->Progressive, 2->Frame-Interlace, 3->Field-Interlace
- uint8_t numpanscanwin;
- uint8_t tfcntr;
- uint8_t rptfrm, tff, rff;
- uint16_t topleftx;
- uint16_t toplefty;
- uint16_t bottomrightx;
- uint16_t bottomrighty;
- uint8_t uvsamp;
- uint8_t postproc;
- int hrd_num_leaky_buckets;
- uint8_t bit_rate_exponent;
- uint8_t buffer_size_exponent;
- uint8_t* acpred_plane; ///< AC prediction flags bitplane
- int acpred_is_raw;
- uint8_t* over_flags_plane; ///< Overflags bitplane
- int overflg_is_raw;
- uint8_t condover;
- uint16_t *hrd_rate, *hrd_buffer;
- uint8_t *hrd_fullness;
- uint8_t range_mapy_flag;
- uint8_t range_mapuv_flag;
- uint8_t range_mapy;
- uint8_t range_mapuv;
- //@}
-
- int p_frame_skipped;
- int bi_type;
-} VC1Context;
-
-/**
- * Get unary code of limited length
- * @fixme FIXME Slow and ugly
- * @param gb GetBitContext
- * @param[in] stop The bitstop value (unary code of 1's or 0's)
- * @param[in] len Maximum length
- * @return Unary length/index
- */
-static int get_prefix(GetBitContext *gb, int stop, int len)
-{
-#if 1
- int i;
-
- for(i = 0; i < len && get_bits1(gb) != stop; i++);
- return i;
-/* int i = 0, tmp = !stop;
-
- while (i != len && tmp != stop)
- {
- tmp = get_bits(gb, 1);
- i++;
- }
- if (i == len && tmp != stop) return len+1;
- return i;*/
-#else
- unsigned int buf;
- int log;
-
- OPEN_READER(re, gb);
- UPDATE_CACHE(re, gb);
- buf=GET_CACHE(re, gb); //Still not sure
- if (stop) buf = ~buf;
-
- log= av_log2(-buf); //FIXME: -?
- if (log < limit){
- LAST_SKIP_BITS(re, gb, log+1);
- CLOSE_READER(re, gb);
- return log;
- }
-
- LAST_SKIP_BITS(re, gb, limit);
- CLOSE_READER(re, gb);
- return limit;
-#endif
-}
-
-static inline int decode210(GetBitContext *gb){
- int n;
- n = get_bits1(gb);
- if (n == 1)
- return 0;
- else
- return 2 - get_bits1(gb);
-}
-
-/**
- * Init VC-1 specific tables and VC1Context members
- * @param v The VC1Context to initialize
- * @return Status
- */
-static int vc1_init_common(VC1Context *v)
-{
- static int done = 0;
- int i = 0;
-
- v->hrd_rate = v->hrd_buffer = NULL;
-
- /* VLC tables */
- if(!done)
- {
- done = 1;
- init_vlc(&vc1_bfraction_vlc, VC1_BFRACTION_VLC_BITS, 23,
- vc1_bfraction_bits, 1, 1,
- vc1_bfraction_codes, 1, 1, 1);
- init_vlc(&vc1_norm2_vlc, VC1_NORM2_VLC_BITS, 4,
- vc1_norm2_bits, 1, 1,
- vc1_norm2_codes, 1, 1, 1);
- init_vlc(&vc1_norm6_vlc, VC1_NORM6_VLC_BITS, 64,
- vc1_norm6_bits, 1, 1,
- vc1_norm6_codes, 2, 2, 1);
- init_vlc(&vc1_imode_vlc, VC1_IMODE_VLC_BITS, 7,
- vc1_imode_bits, 1, 1,
- vc1_imode_codes, 1, 1, 1);
- for (i=0; i<3; i++)
- {
- init_vlc(&vc1_ttmb_vlc[i], VC1_TTMB_VLC_BITS, 16,
- vc1_ttmb_bits[i], 1, 1,
- vc1_ttmb_codes[i], 2, 2, 1);
- init_vlc(&vc1_ttblk_vlc[i], VC1_TTBLK_VLC_BITS, 8,
- vc1_ttblk_bits[i], 1, 1,
- vc1_ttblk_codes[i], 1, 1, 1);
- init_vlc(&vc1_subblkpat_vlc[i], VC1_SUBBLKPAT_VLC_BITS, 15,
- vc1_subblkpat_bits[i], 1, 1,
- vc1_subblkpat_codes[i], 1, 1, 1);
- }
- for(i=0; i<4; i++)
- {
- init_vlc(&vc1_4mv_block_pattern_vlc[i], VC1_4MV_BLOCK_PATTERN_VLC_BITS, 16,
- vc1_4mv_block_pattern_bits[i], 1, 1,
- vc1_4mv_block_pattern_codes[i], 1, 1, 1);
- init_vlc(&vc1_cbpcy_p_vlc[i], VC1_CBPCY_P_VLC_BITS, 64,
- vc1_cbpcy_p_bits[i], 1, 1,
- vc1_cbpcy_p_codes[i], 2, 2, 1);
- init_vlc(&vc1_mv_diff_vlc[i], VC1_MV_DIFF_VLC_BITS, 73,
- vc1_mv_diff_bits[i], 1, 1,
- vc1_mv_diff_codes[i], 2, 2, 1);
- }
- for(i=0; i<8; i++)
- init_vlc(&vc1_ac_coeff_table[i], AC_VLC_BITS, vc1_ac_sizes[i],
- &vc1_ac_tables[i][0][1], 8, 4,
- &vc1_ac_tables[i][0][0], 8, 4, 1);
- init_vlc(&ff_msmp4_mb_i_vlc, MB_INTRA_VLC_BITS, 64,
- &ff_msmp4_mb_i_table[0][1], 4, 2,
- &ff_msmp4_mb_i_table[0][0], 4, 2, 1);
- }
-
- /* Other defaults */
- v->pq = -1;
- v->mvrange = 0; /* 7.1.1.18, p80 */
-
- return 0;
-}
-
-/***********************************************************************/
-/**
- * @defgroup bitplane VC9 Bitplane decoding
- * @see 8.7, p56
- * @{
- */
-
-/** @addtogroup bitplane
- * Imode types
- * @{
- */
-enum Imode {
- IMODE_RAW,
- IMODE_NORM2,
- IMODE_DIFF2,
- IMODE_NORM6,
- IMODE_DIFF6,
- IMODE_ROWSKIP,
- IMODE_COLSKIP
-};
-/** @} */ //imode defines
-
-/** Decode rows by checking if they are skipped
- * @param plane Buffer to store decoded bits
- * @param[in] width Width of this buffer
- * @param[in] height Height of this buffer
- * @param[in] stride of this buffer
- */
-static void decode_rowskip(uint8_t* plane, int width, int height, int stride, GetBitContext *gb){
- int x, y;
-
- for (y=0; y<height; y++){
- if (!get_bits(gb, 1)) //rowskip
- memset(plane, 0, width);
- else
- for (x=0; x<width; x++)
- plane[x] = get_bits(gb, 1);
- plane += stride;
- }
-}
-
-/** Decode columns by checking if they are skipped
- * @param plane Buffer to store decoded bits
- * @param[in] width Width of this buffer
- * @param[in] height Height of this buffer
- * @param[in] stride of this buffer
- * @fixme FIXME: Optimize
- */
-static void decode_colskip(uint8_t* plane, int width, int height, int stride, GetBitContext *gb){
- int x, y;
-
- for (x=0; x<width; x++){
- if (!get_bits(gb, 1)) //colskip
- for (y=0; y<height; y++)
- plane[y*stride] = 0;
- else
- for (y=0; y<height; y++)
- plane[y*stride] = get_bits(gb, 1);
- plane ++;
- }
-}
-
-/** Decode a bitplane's bits
- * @param bp Bitplane where to store the decode bits
- * @param v VC-1 context for bit reading and logging
- * @return Status
- * @fixme FIXME: Optimize
- */
-static int bitplane_decoding(uint8_t* data, int *raw_flag, VC1Context *v)
-{
- GetBitContext *gb = &v->s.gb;
-
- int imode, x, y, code, offset;
- uint8_t invert, *planep = data;
- int width, height, stride;
-
- width = v->s.mb_width;
- height = v->s.mb_height;
- stride = v->s.mb_stride;
- invert = get_bits(gb, 1);
- imode = get_vlc2(gb, vc1_imode_vlc.table, VC1_IMODE_VLC_BITS, 1);
-
- *raw_flag = 0;
- switch (imode)
- {
- case IMODE_RAW:
- //Data is actually read in the MB layer (same for all tests == "raw")
- *raw_flag = 1; //invert ignored
- return invert;
- case IMODE_DIFF2:
- case IMODE_NORM2:
- if ((height * width) & 1)
- {
- *planep++ = get_bits(gb, 1);
- offset = 1;
- }
- else offset = 0;
- // decode bitplane as one long line
- for (y = offset; y < height * width; y += 2) {
- code = get_vlc2(gb, vc1_norm2_vlc.table, VC1_NORM2_VLC_BITS, 1);
- *planep++ = code & 1;
- offset++;
- if(offset == width) {
- offset = 0;
- planep += stride - width;
- }
- *planep++ = code >> 1;
- offset++;
- if(offset == width) {
- offset = 0;
- planep += stride - width;
- }
- }
- break;
- case IMODE_DIFF6:
- case IMODE_NORM6:
- if(!(height % 3) && (width % 3)) { // use 2x3 decoding
- for(y = 0; y < height; y+= 3) {
- for(x = width & 1; x < width; x += 2) {
- code = get_vlc2(gb, vc1_norm6_vlc.table, VC1_NORM6_VLC_BITS, 2);
- if(code < 0){
- av_log(v->s.avctx, AV_LOG_DEBUG, "invalid NORM-6 VLC\n");
- return -1;
- }
- planep[x + 0] = (code >> 0) & 1;
- planep[x + 1] = (code >> 1) & 1;
- planep[x + 0 + stride] = (code >> 2) & 1;
- planep[x + 1 + stride] = (code >> 3) & 1;
- planep[x + 0 + stride * 2] = (code >> 4) & 1;
- planep[x + 1 + stride * 2] = (code >> 5) & 1;
- }
- planep += stride * 3;
- }
- if(width & 1) decode_colskip(data, 1, height, stride, &v->s.gb);
- } else { // 3x2
- planep += (height & 1) * stride;
- for(y = height & 1; y < height; y += 2) {
- for(x = width % 3; x < width; x += 3) {
- code = get_vlc2(gb, vc1_norm6_vlc.table, VC1_NORM6_VLC_BITS, 2);
- if(code < 0){
- av_log(v->s.avctx, AV_LOG_DEBUG, "invalid NORM-6 VLC\n");
- return -1;
- }
- planep[x + 0] = (code >> 0) & 1;
- planep[x + 1] = (code >> 1) & 1;
- planep[x + 2] = (code >> 2) & 1;
- planep[x + 0 + stride] = (code >> 3) & 1;
- planep[x + 1 + stride] = (code >> 4) & 1;
- planep[x + 2 + stride] = (code >> 5) & 1;
- }
- planep += stride * 2;
- }
- x = width % 3;
- if(x) decode_colskip(data , x, height , stride, &v->s.gb);
- if(height & 1) decode_rowskip(data+x, width - x, 1, stride, &v->s.gb);
- }
- break;
- case IMODE_ROWSKIP:
- decode_rowskip(data, width, height, stride, &v->s.gb);
- break;
- case IMODE_COLSKIP:
- decode_colskip(data, width, height, stride, &v->s.gb);
- break;
- default: break;
- }
-
- /* Applying diff operator */
- if (imode == IMODE_DIFF2 || imode == IMODE_DIFF6)
- {
- planep = data;
- planep[0] ^= invert;
- for (x=1; x<width; x++)
- planep[x] ^= planep[x-1];
- for (y=1; y<height; y++)
- {
- planep += stride;
- planep[0] ^= planep[-stride];
- for (x=1; x<width; x++)
- {
- if (planep[x-1] != planep[x-stride]) planep[x] ^= invert;
- else planep[x] ^= planep[x-1];
- }
- }
- }
- else if (invert)
- {
- planep = data;
- for (x=0; x<stride*height; x++) planep[x] = !planep[x]; //FIXME stride
- }
- return (imode<<1) + invert;
-}
-
-/** @} */ //Bitplane group
-
-/***********************************************************************/
-/** VOP Dquant decoding
- * @param v VC-1 Context
- */
-static int vop_dquant_decoding(VC1Context *v)
-{
- GetBitContext *gb = &v->s.gb;
- int pqdiff;
-
- //variable size
- if (v->dquant == 2)
- {
- pqdiff = get_bits(gb, 3);
- if (pqdiff == 7) v->altpq = get_bits(gb, 5);
- else v->altpq = v->pq + pqdiff + 1;
- }
- else
- {
- v->dquantfrm = get_bits(gb, 1);
- if ( v->dquantfrm )
- {
- v->dqprofile = get_bits(gb, 2);
- switch (v->dqprofile)
- {
- case DQPROFILE_SINGLE_EDGE:
- case DQPROFILE_DOUBLE_EDGES:
- v->dqsbedge = get_bits(gb, 2);
- break;
- case DQPROFILE_ALL_MBS:
- v->dqbilevel = get_bits(gb, 1);
- default: break; //Forbidden ?
- }
- if (v->dqbilevel || v->dqprofile != DQPROFILE_ALL_MBS)
- {
- pqdiff = get_bits(gb, 3);
- if (pqdiff == 7) v->altpq = get_bits(gb, 5);
- else v->altpq = v->pq + pqdiff + 1;
- }
- }
- }
- return 0;
-}
-
-/** Put block onto picture
- */
-static void vc1_put_block(VC1Context *v, DCTELEM block[6][64])
-{
- uint8_t *Y;
- int ys, us, vs;
- DSPContext *dsp = &v->s.dsp;
-
- if(v->rangeredfrm) {
- int i, j, k;
- for(k = 0; k < 6; k++)
- for(j = 0; j < 8; j++)
- for(i = 0; i < 8; i++)
- block[k][i + j*8] = ((block[k][i + j*8] - 128) << 1) + 128;
-
- }
- ys = v->s.current_picture.linesize[0];
- us = v->s.current_picture.linesize[1];
- vs = v->s.current_picture.linesize[2];
- Y = v->s.dest[0];
-
- dsp->put_pixels_clamped(block[0], Y, ys);
- dsp->put_pixels_clamped(block[1], Y + 8, ys);
- Y += ys * 8;
- dsp->put_pixels_clamped(block[2], Y, ys);
- dsp->put_pixels_clamped(block[3], Y + 8, ys);
-
- if(!(v->s.flags & CODEC_FLAG_GRAY)) {
- dsp->put_pixels_clamped(block[4], v->s.dest[1], us);
- dsp->put_pixels_clamped(block[5], v->s.dest[2], vs);
- }
-}
-
-/** Do motion compensation over 1 macroblock
- * Mostly adapted hpel_motion and qpel_motion from mpegvideo.c
- */
-static void vc1_mc_1mv(VC1Context *v, int dir)
-{
- MpegEncContext *s = &v->s;
- DSPContext *dsp = &v->s.dsp;
- uint8_t *srcY, *srcU, *srcV;
- int dxy, uvdxy, mx, my, uvmx, uvmy, src_x, src_y, uvsrc_x, uvsrc_y;
-
- if(!v->s.last_picture.data[0])return;
-
- mx = s->mv[dir][0][0];
- my = s->mv[dir][0][1];
-
- // store motion vectors for further use in B frames
- if(s->pict_type == P_TYPE) {
- s->current_picture.motion_val[1][s->block_index[0]][0] = mx;
- s->current_picture.motion_val[1][s->block_index[0]][1] = my;
- }
- uvmx = (mx + ((mx & 3) == 3)) >> 1;
- uvmy = (my + ((my & 3) == 3)) >> 1;
- if(v->fastuvmc) {
- uvmx = uvmx + ((uvmx<0)?(uvmx&1):-(uvmx&1));
- uvmy = uvmy + ((uvmy<0)?(uvmy&1):-(uvmy&1));
- }
- if(!dir) {
- srcY = s->last_picture.data[0];
- srcU = s->last_picture.data[1];
- srcV = s->last_picture.data[2];
- } else {
- srcY = s->next_picture.data[0];
- srcU = s->next_picture.data[1];
- srcV = s->next_picture.data[2];
- }
-
- src_x = s->mb_x * 16 + (mx >> 2);
- src_y = s->mb_y * 16 + (my >> 2);
- uvsrc_x = s->mb_x * 8 + (uvmx >> 2);
- uvsrc_y = s->mb_y * 8 + (uvmy >> 2);
-
- src_x = clip( src_x, -16, s->mb_width * 16);
- src_y = clip( src_y, -16, s->mb_height * 16);
- uvsrc_x = clip(uvsrc_x, -8, s->mb_width * 8);
- uvsrc_y = clip(uvsrc_y, -8, s->mb_height * 8);
-
- srcY += src_y * s->linesize + src_x;
- srcU += uvsrc_y * s->uvlinesize + uvsrc_x;
- srcV += uvsrc_y * s->uvlinesize + uvsrc_x;
-
- /* for grayscale we should not try to read from unknown area */
- if(s->flags & CODEC_FLAG_GRAY) {
- srcU = s->edge_emu_buffer + 18 * s->linesize;
- srcV = s->edge_emu_buffer + 18 * s->linesize;
- }
-
- if(v->rangeredfrm || (v->mv_mode == MV_PMODE_INTENSITY_COMP)
- || (unsigned)(src_x - s->mspel) > s->h_edge_pos - (mx&3) - 16 - s->mspel*3
- || (unsigned)(src_y - s->mspel) > s->v_edge_pos - (my&3) - 16 - s->mspel*3){
- uint8_t *uvbuf= s->edge_emu_buffer + 19 * s->linesize;
-
- srcY -= s->mspel * (1 + s->linesize);
- ff_emulated_edge_mc(s->edge_emu_buffer, srcY, s->linesize, 17+s->mspel*2, 17+s->mspel*2,
- src_x - s->mspel, src_y - s->mspel, s->h_edge_pos, s->v_edge_pos);
- srcY = s->edge_emu_buffer;
- ff_emulated_edge_mc(uvbuf , srcU, s->uvlinesize, 8+1, 8+1,
- uvsrc_x, uvsrc_y, s->h_edge_pos >> 1, s->v_edge_pos >> 1);
- ff_emulated_edge_mc(uvbuf + 16, srcV, s->uvlinesize, 8+1, 8+1,
- uvsrc_x, uvsrc_y, s->h_edge_pos >> 1, s->v_edge_pos >> 1);
- srcU = uvbuf;
- srcV = uvbuf + 16;
- /* if we deal with range reduction we need to scale source blocks */
- if(v->rangeredfrm) {
- int i, j;
- uint8_t *src, *src2;
-
- src = srcY;
- for(j = 0; j < 17 + s->mspel*2; j++) {
- for(i = 0; i < 17 + s->mspel*2; i++) src[i] = ((src[i] - 128) >> 1) + 128;
- src += s->linesize;
- }
- src = srcU; src2 = srcV;
- for(j = 0; j < 9; j++) {
- for(i = 0; i < 9; i++) {
- src[i] = ((src[i] - 128) >> 1) + 128;
- src2[i] = ((src2[i] - 128) >> 1) + 128;
- }
- src += s->uvlinesize;
- src2 += s->uvlinesize;
- }
- }
- /* if we deal with intensity compensation we need to scale source blocks */
- if(v->mv_mode == MV_PMODE_INTENSITY_COMP) {
- int i, j;
- uint8_t *src, *src2;
-
- src = srcY;
- for(j = 0; j < 17 + s->mspel*2; j++) {
- for(i = 0; i < 17 + s->mspel*2; i++) src[i] = v->luty[src[i]];
- src += s->linesize;
- }
- src = srcU; src2 = srcV;
- for(j = 0; j < 9; j++) {
- for(i = 0; i < 9; i++) {
- src[i] = v->lutuv[src[i]];
- src2[i] = v->lutuv[src2[i]];
- }
- src += s->uvlinesize;
- src2 += s->uvlinesize;
- }
- }
- srcY += s->mspel * (1 + s->linesize);
- }
-
- if(s->mspel) {
- dxy = ((my & 3) << 2) | (mx & 3);
- dsp->put_vc1_mspel_pixels_tab[dxy](s->dest[0] , srcY , s->linesize, v->rnd);
- dsp->put_vc1_mspel_pixels_tab[dxy](s->dest[0] + 8, srcY + 8, s->linesize, v->rnd);
- srcY += s->linesize * 8;
- dsp->put_vc1_mspel_pixels_tab[dxy](s->dest[0] + 8 * s->linesize , srcY , s->linesize, v->rnd);
- dsp->put_vc1_mspel_pixels_tab[dxy](s->dest[0] + 8 * s->linesize + 8, srcY + 8, s->linesize, v->rnd);
- } else { // hpel mc - always used for luma
- dxy = (my & 2) | ((mx & 2) >> 1);
-
- if(!v->rnd)
- dsp->put_pixels_tab[0][dxy](s->dest[0], srcY, s->linesize, 16);
- else
- dsp->put_no_rnd_pixels_tab[0][dxy](s->dest[0], srcY, s->linesize, 16);
- }
-
- if(s->flags & CODEC_FLAG_GRAY) return;
- /* Chroma MC always uses qpel bilinear */
- uvdxy = ((uvmy & 3) << 2) | (uvmx & 3);
- uvmx = (uvmx&3)<<1;
- uvmy = (uvmy&3)<<1;
- if(!v->rnd){
- dsp->put_h264_chroma_pixels_tab[0](s->dest[1], srcU, s->uvlinesize, 8, uvmx, uvmy);
- dsp->put_h264_chroma_pixels_tab[0](s->dest[2], srcV, s->uvlinesize, 8, uvmx, uvmy);
- }else{
- dsp->put_no_rnd_h264_chroma_pixels_tab[0](s->dest[1], srcU, s->uvlinesize, 8, uvmx, uvmy);
- dsp->put_no_rnd_h264_chroma_pixels_tab[0](s->dest[2], srcV, s->uvlinesize, 8, uvmx, uvmy);
- }
-}
-
-/** Do motion compensation for 4-MV macroblock - luminance block
- */
-static void vc1_mc_4mv_luma(VC1Context *v, int n)
-{
- MpegEncContext *s = &v->s;
- DSPContext *dsp = &v->s.dsp;
- uint8_t *srcY;
- int dxy, mx, my, src_x, src_y;
- int off;
-
- if(!v->s.last_picture.data[0])return;
- mx = s->mv[0][n][0];
- my = s->mv[0][n][1];
- srcY = s->last_picture.data[0];
-
- off = s->linesize * 4 * (n&2) + (n&1) * 8;
-
- src_x = s->mb_x * 16 + (n&1) * 8 + (mx >> 2);
- src_y = s->mb_y * 16 + (n&2) * 4 + (my >> 2);
-
- src_x = clip( src_x, -16, s->mb_width * 16);
- src_y = clip( src_y, -16, s->mb_height * 16);
-
- srcY += src_y * s->linesize + src_x;
-
- if(v->rangeredfrm || (v->mv_mode == MV_PMODE_INTENSITY_COMP)
- || (unsigned)(src_x - s->mspel) > s->h_edge_pos - (mx&3) - 8 - s->mspel*2
- || (unsigned)(src_y - s->mspel) > s->v_edge_pos - (my&3) - 8 - s->mspel*2){
- srcY -= s->mspel * (1 + s->linesize);
- ff_emulated_edge_mc(s->edge_emu_buffer, srcY, s->linesize, 9+s->mspel*2, 9+s->mspel*2,
- src_x - s->mspel, src_y - s->mspel, s->h_edge_pos, s->v_edge_pos);
- srcY = s->edge_emu_buffer;
- /* if we deal with range reduction we need to scale source blocks */
- if(v->rangeredfrm) {
- int i, j;
- uint8_t *src;
-
- src = srcY;
- for(j = 0; j < 9 + s->mspel*2; j++) {
- for(i = 0; i < 9 + s->mspel*2; i++) src[i] = ((src[i] - 128) >> 1) + 128;
- src += s->linesize;
- }
- }
- /* if we deal with intensity compensation we need to scale source blocks */
- if(v->mv_mode == MV_PMODE_INTENSITY_COMP) {
- int i, j;
- uint8_t *src;
-
- src = srcY;
- for(j = 0; j < 9 + s->mspel*2; j++) {
- for(i = 0; i < 9 + s->mspel*2; i++) src[i] = v->luty[src[i]];
- src += s->linesize;
- }
- }
- srcY += s->mspel * (1 + s->linesize);
- }
-
- if(s->mspel) {
- dxy = ((my & 3) << 2) | (mx & 3);
- dsp->put_vc1_mspel_pixels_tab[dxy](s->dest[0] + off, srcY, s->linesize, v->rnd);
- } else { // hpel mc - always used for luma
- dxy = (my & 2) | ((mx & 2) >> 1);
- if(!v->rnd)
- dsp->put_pixels_tab[1][dxy](s->dest[0] + off, srcY, s->linesize, 8);
- else
- dsp->put_no_rnd_pixels_tab[1][dxy](s->dest[0] + off, srcY, s->linesize, 8);
- }
-}
-
-static inline int median4(int a, int b, int c, int d)
-{
- if(a < b) {
- if(c < d) return (FFMIN(b, d) + FFMAX(a, c)) / 2;
- else return (FFMIN(b, c) + FFMAX(a, d)) / 2;
- } else {
- if(c < d) return (FFMIN(a, d) + FFMAX(b, c)) / 2;
- else return (FFMIN(a, c) + FFMAX(b, d)) / 2;
- }
-}
-
-
-/** Do motion compensation for 4-MV macroblock - both chroma blocks
- */
-static void vc1_mc_4mv_chroma(VC1Context *v)
-{
- MpegEncContext *s = &v->s;
- DSPContext *dsp = &v->s.dsp;
- uint8_t *srcU, *srcV;
- int uvdxy, uvmx, uvmy, uvsrc_x, uvsrc_y;
- int i, idx, tx = 0, ty = 0;
- int mvx[4], mvy[4], intra[4];
- static const int count[16] = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4};
-
- if(!v->s.last_picture.data[0])return;
- if(s->flags & CODEC_FLAG_GRAY) return;
-
- for(i = 0; i < 4; i++) {
- mvx[i] = s->mv[0][i][0];
- mvy[i] = s->mv[0][i][1];
- intra[i] = v->mb_type[0][s->block_index[i]];
- }
-
- /* calculate chroma MV vector from four luma MVs */
- idx = (intra[3] << 3) | (intra[2] << 2) | (intra[1] << 1) | intra[0];
- if(!idx) { // all blocks are inter
- tx = median4(mvx[0], mvx[1], mvx[2], mvx[3]);
- ty = median4(mvy[0], mvy[1], mvy[2], mvy[3]);
- } else if(count[idx] == 1) { // 3 inter blocks
- switch(idx) {
- case 0x1:
- tx = mid_pred(mvx[1], mvx[2], mvx[3]);
- ty = mid_pred(mvy[1], mvy[2], mvy[3]);
- break;
- case 0x2:
- tx = mid_pred(mvx[0], mvx[2], mvx[3]);
- ty = mid_pred(mvy[0], mvy[2], mvy[3]);
- break;
- case 0x4:
- tx = mid_pred(mvx[0], mvx[1], mvx[3]);
- ty = mid_pred(mvy[0], mvy[1], mvy[3]);
- break;
- case 0x8:
- tx = mid_pred(mvx[0], mvx[1], mvx[2]);
- ty = mid_pred(mvy[0], mvy[1], mvy[2]);
- break;
- }
- } else if(count[idx] == 2) {
- int t1 = 0, t2 = 0;
- for(i=0; i<3;i++) if(!intra[i]) {t1 = i; break;}
- for(i= t1+1; i<4; i++)if(!intra[i]) {t2 = i; break;}
- tx = (mvx[t1] + mvx[t2]) / 2;
- ty = (mvy[t1] + mvy[t2]) / 2;
- } else
- return; //no need to do MC for inter blocks
-
- s->current_picture.motion_val[1][s->block_index[0]][0] = tx;
- s->current_picture.motion_val[1][s->block_index[0]][1] = ty;
- uvmx = (tx + ((tx&3) == 3)) >> 1;
- uvmy = (ty + ((ty&3) == 3)) >> 1;
- if(v->fastuvmc) {
- uvmx = uvmx + ((uvmx<0)?(uvmx&1):-(uvmx&1));
- uvmy = uvmy + ((uvmy<0)?(uvmy&1):-(uvmy&1));
- }
-
- uvsrc_x = s->mb_x * 8 + (uvmx >> 2);
- uvsrc_y = s->mb_y * 8 + (uvmy >> 2);
-
- uvsrc_x = clip(uvsrc_x, -8, s->mb_width * 8);
- uvsrc_y = clip(uvsrc_y, -8, s->mb_height * 8);
- srcU = s->last_picture.data[1] + uvsrc_y * s->uvlinesize + uvsrc_x;
- srcV = s->last_picture.data[2] + uvsrc_y * s->uvlinesize + uvsrc_x;
- if(v->rangeredfrm || (v->mv_mode == MV_PMODE_INTENSITY_COMP)
- || (unsigned)uvsrc_x > (s->h_edge_pos >> 1) - 9
- || (unsigned)uvsrc_y > (s->v_edge_pos >> 1) - 9){
- ff_emulated_edge_mc(s->edge_emu_buffer , srcU, s->uvlinesize, 8+1, 8+1,
- uvsrc_x, uvsrc_y, s->h_edge_pos >> 1, s->v_edge_pos >> 1);
- ff_emulated_edge_mc(s->edge_emu_buffer + 16, srcV, s->uvlinesize, 8+1, 8+1,
- uvsrc_x, uvsrc_y, s->h_edge_pos >> 1, s->v_edge_pos >> 1);
- srcU = s->edge_emu_buffer;
- srcV = s->edge_emu_buffer + 16;
-
- /* if we deal with range reduction we need to scale source blocks */
- if(v->rangeredfrm) {
- int i, j;
- uint8_t *src, *src2;
-
- src = srcU; src2 = srcV;
- for(j = 0; j < 9; j++) {
- for(i = 0; i < 9; i++) {
- src[i] = ((src[i] - 128) >> 1) + 128;
- src2[i] = ((src2[i] - 128) >> 1) + 128;
- }
- src += s->uvlinesize;
- src2 += s->uvlinesize;
- }
- }
- /* if we deal with intensity compensation we need to scale source blocks */
- if(v->mv_mode == MV_PMODE_INTENSITY_COMP) {
- int i, j;
- uint8_t *src, *src2;
-
- src = srcU; src2 = srcV;
- for(j = 0; j < 9; j++) {
- for(i = 0; i < 9; i++) {
- src[i] = v->lutuv[src[i]];
- src2[i] = v->lutuv[src2[i]];
- }
- src += s->uvlinesize;
- src2 += s->uvlinesize;
- }
- }
- }
-
- /* Chroma MC always uses qpel bilinear */
- uvdxy = ((uvmy & 3) << 2) | (uvmx & 3);
- uvmx = (uvmx&3)<<1;
- uvmy = (uvmy&3)<<1;
- if(!v->rnd){
- dsp->put_h264_chroma_pixels_tab[0](s->dest[1], srcU, s->uvlinesize, 8, uvmx, uvmy);
- dsp->put_h264_chroma_pixels_tab[0](s->dest[2], srcV, s->uvlinesize, 8, uvmx, uvmy);
- }else{
- dsp->put_no_rnd_h264_chroma_pixels_tab[0](s->dest[1], srcU, s->uvlinesize, 8, uvmx, uvmy);
- dsp->put_no_rnd_h264_chroma_pixels_tab[0](s->dest[2], srcV, s->uvlinesize, 8, uvmx, uvmy);
- }
-}
-
-static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb);
-
-/**
- * Decode Simple/Main Profiles sequence header
- * @see Figure 7-8, p16-17
- * @param avctx Codec context
- * @param gb GetBit context initialized from Codec context extra_data
- * @return Status
- */
-static int decode_sequence_header(AVCodecContext *avctx, GetBitContext *gb)
-{
- VC1Context *v = avctx->priv_data;
-
- av_log(avctx, AV_LOG_DEBUG, "Header: %0X\n", show_bits(gb, 32));
- v->profile = get_bits(gb, 2);
- if (v->profile == 2)
- {
- av_log(avctx, AV_LOG_ERROR, "Profile value 2 is forbidden (and WMV3 Complex Profile is unsupported)\n");
- return -1;
- }
-
- if (v->profile == PROFILE_ADVANCED)
- {
- return decode_sequence_header_adv(v, gb);
- }
- else
- {
- v->res_sm = get_bits(gb, 2); //reserved
- if (v->res_sm)
- {
- av_log(avctx, AV_LOG_ERROR,
- "Reserved RES_SM=%i is forbidden\n", v->res_sm);
- return -1;
- }
- }
-
- // (fps-2)/4 (->30)
- v->frmrtq_postproc = get_bits(gb, 3); //common
- // (bitrate-32kbps)/64kbps
- v->bitrtq_postproc = get_bits(gb, 5); //common
- v->s.loop_filter = get_bits(gb, 1); //common
- if(v->s.loop_filter == 1 && v->profile == PROFILE_SIMPLE)
- {
- av_log(avctx, AV_LOG_ERROR,
- "LOOPFILTER shell not be enabled in simple profile\n");
- }
-
- v->res_x8 = get_bits(gb, 1); //reserved
- if (v->res_x8)
- {
- av_log(avctx, AV_LOG_ERROR,
- "1 for reserved RES_X8 is forbidden\n");
- //return -1;
- }
- v->multires = get_bits(gb, 1);
- v->res_fasttx = get_bits(gb, 1);
- if (!v->res_fasttx)
- {
- av_log(avctx, AV_LOG_ERROR,
- "0 for reserved RES_FASTTX is forbidden\n");
- //return -1;
- }
-
- v->fastuvmc = get_bits(gb, 1); //common
- if (!v->profile && !v->fastuvmc)
- {
- av_log(avctx, AV_LOG_ERROR,
- "FASTUVMC unavailable in Simple Profile\n");
- return -1;
- }
- v->extended_mv = get_bits(gb, 1); //common
- if (!v->profile && v->extended_mv)
- {
- av_log(avctx, AV_LOG_ERROR,
- "Extended MVs unavailable in Simple Profile\n");
- return -1;
- }
- v->dquant = get_bits(gb, 2); //common
- v->vstransform = get_bits(gb, 1); //common
-
- v->res_transtab = get_bits(gb, 1);
- if (v->res_transtab)
- {
- av_log(avctx, AV_LOG_ERROR,
- "1 for reserved RES_TRANSTAB is forbidden\n");
- return -1;
- }
-
- v->overlap = get_bits(gb, 1); //common
-
- v->s.resync_marker = get_bits(gb, 1);
- v->rangered = get_bits(gb, 1);
- if (v->rangered && v->profile == PROFILE_SIMPLE)
- {
- av_log(avctx, AV_LOG_INFO,
- "RANGERED should be set to 0 in simple profile\n");
- }
-
- v->s.max_b_frames = avctx->max_b_frames = get_bits(gb, 3); //common
- v->quantizer_mode = get_bits(gb, 2); //common
-
- v->finterpflag = get_bits(gb, 1); //common
- v->res_rtm_flag = get_bits(gb, 1); //reserved
- if (!v->res_rtm_flag)
- {
-// av_log(avctx, AV_LOG_ERROR,
-// "0 for reserved RES_RTM_FLAG is forbidden\n");
- av_log(avctx, AV_LOG_ERROR,
- "Old WMV3 version detected, only I-frames will be decoded\n");
- //return -1;
- }
- av_log(avctx, AV_LOG_DEBUG,
- "Profile %i:\nfrmrtq_postproc=%i, bitrtq_postproc=%i\n"
- "LoopFilter=%i, MultiRes=%i, FastUVMC=%i, Extended MV=%i\n"
- "Rangered=%i, VSTransform=%i, Overlap=%i, SyncMarker=%i\n"
- "DQuant=%i, Quantizer mode=%i, Max B frames=%i\n",
- v->profile, v->frmrtq_postproc, v->bitrtq_postproc,
- v->s.loop_filter, v->multires, v->fastuvmc, v->extended_mv,
- v->rangered, v->vstransform, v->overlap, v->s.resync_marker,
- v->dquant, v->quantizer_mode, avctx->max_b_frames
- );
- return 0;
-}
-
-static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb)
-{
- v->res_rtm_flag = 1;
- v->level = get_bits(gb, 3);
- if(v->level >= 5)
- {
- av_log(v->s.avctx, AV_LOG_ERROR, "Reserved LEVEL %i\n",v->level);
- }
- v->chromaformat = get_bits(gb, 2);
- if (v->chromaformat != 1)
- {
- av_log(v->s.avctx, AV_LOG_ERROR,
- "Only 4:2:0 chroma format supported\n");
- return -1;
- }
-
- // (fps-2)/4 (->30)
- v->frmrtq_postproc = get_bits(gb, 3); //common
- // (bitrate-32kbps)/64kbps
- v->bitrtq_postproc = get_bits(gb, 5); //common
- v->postprocflag = get_bits(gb, 1); //common
-
- v->s.avctx->coded_width = (get_bits(gb, 12) + 1) << 1;
- v->s.avctx->coded_height = (get_bits(gb, 12) + 1) << 1;
- v->broadcast = get_bits1(gb);
- v->interlace = get_bits1(gb);
- if(v->interlace){
- av_log(v->s.avctx, AV_LOG_ERROR, "Interlaced mode not supported (yet)\n");
- return -1;
- }
- v->tfcntrflag = get_bits1(gb);
- v->finterpflag = get_bits1(gb);
- get_bits1(gb); // reserved
-
- av_log(v->s.avctx, AV_LOG_DEBUG,
- "Advanced Profile level %i:\nfrmrtq_postproc=%i, bitrtq_postproc=%i\n"
- "LoopFilter=%i, ChromaFormat=%i, Pulldown=%i, Interlace: %i\n"
- "TFCTRflag=%i, FINTERPflag=%i\n",
- v->level, v->frmrtq_postproc, v->bitrtq_postproc,
- v->s.loop_filter, v->chromaformat, v->broadcast, v->interlace,
- v->tfcntrflag, v->finterpflag
- );
-
- v->psf = get_bits1(gb);
- if(v->psf) { //PsF, 6.1.13
- av_log(v->s.avctx, AV_LOG_ERROR, "Progressive Segmented Frame mode: not supported (yet)\n");
- return -1;
- }
- if(get_bits1(gb)) { //Display Info - decoding is not affected by it
- int w, h, ar = 0;
- av_log(v->s.avctx, AV_LOG_INFO, "Display extended info:\n");
- w = get_bits(gb, 14) + 1;
- h = get_bits(gb, 14) + 1;
- av_log(v->s.avctx, AV_LOG_INFO, "Display dimensions: %ix%i\n", w, h);
- if(get_bits1(gb))
- ar = get_bits(gb, 4);
- if(ar && ar < 14){
- v->s.avctx->sample_aspect_ratio = vc1_pixel_aspect[ar];
- }else if(ar == 15){
- w = get_bits(gb, 8);
- h = get_bits(gb, 8);
- v->s.avctx->sample_aspect_ratio = (AVRational){w, h};
- }
-
- if(get_bits1(gb)){ //framerate stuff
- if(get_bits1(gb)) {
- get_bits(gb, 16);
- } else {
- get_bits(gb, 8);
- get_bits(gb, 4);
- }
- }
-
- if(get_bits1(gb)){
- v->color_prim = get_bits(gb, 8);
- v->transfer_char = get_bits(gb, 8);
- v->matrix_coef = get_bits(gb, 8);
- }
- }
-
- v->hrd_param_flag = get_bits1(gb);
- if(v->hrd_param_flag) {
- int i;
- v->hrd_num_leaky_buckets = get_bits(gb, 5);
- get_bits(gb, 4); //bitrate exponent
- get_bits(gb, 4); //buffer size exponent
- for(i = 0; i < v->hrd_num_leaky_buckets; i++) {
- get_bits(gb, 16); //hrd_rate[n]
- get_bits(gb, 16); //hrd_buffer[n]
- }
- }
- return 0;
-}
-
-static int decode_entry_point(AVCodecContext *avctx, GetBitContext *gb)
-{
- VC1Context *v = avctx->priv_data;
- int i, blink, refdist;
-
- av_log(avctx, AV_LOG_DEBUG, "Entry point: %08X\n", show_bits_long(gb, 32));
- blink = get_bits1(gb); // broken link
- avctx->max_b_frames = 1 - get_bits1(gb); // 'closed entry' also signalize possible B-frames
- v->panscanflag = get_bits1(gb);
- refdist = get_bits1(gb); // refdist flag
- v->s.loop_filter = get_bits1(gb);
- v->fastuvmc = get_bits1(gb);
- v->extended_mv = get_bits1(gb);
- v->dquant = get_bits(gb, 2);
- v->vstransform = get_bits1(gb);
- v->overlap = get_bits1(gb);
- v->quantizer_mode = get_bits(gb, 2);
-
- if(v->hrd_param_flag){
- for(i = 0; i < v->hrd_num_leaky_buckets; i++) {
- get_bits(gb, 8); //hrd_full[n]
- }
- }
-
- if(get_bits1(gb)){
- avctx->coded_width = (get_bits(gb, 12)+1)<<1;
- avctx->coded_height = (get_bits(gb, 12)+1)<<1;
- }
- if(v->extended_mv)
- v->extended_dmv = get_bits1(gb);
- if(get_bits1(gb)) {
- av_log(avctx, AV_LOG_ERROR, "Luma scaling is not supported, expect wrong picture\n");
- skip_bits(gb, 3); // Y range, ignored for now
- }
- if(get_bits1(gb)) {
- av_log(avctx, AV_LOG_ERROR, "Chroma scaling is not supported, expect wrong picture\n");
- skip_bits(gb, 3); // UV range, ignored for now
- }
-
- av_log(avctx, AV_LOG_DEBUG, "Entry point info:\n"
- "BrokenLink=%i, ClosedEntry=%i, PanscanFlag=%i\n"
- "RefDist=%i, Postproc=%i, FastUVMC=%i, ExtMV=%i\n"
- "DQuant=%i, VSTransform=%i, Overlap=%i, Qmode=%i\n",
- blink, 1 - avctx->max_b_frames, v->panscanflag, refdist, v->s.loop_filter,
- v->fastuvmc, v->extended_mv, v->dquant, v->vstransform, v->overlap, v->quantizer_mode);
-
- return 0;
-}
-
-static int vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)
-{
- int pqindex, lowquant, status;
-
- if(v->finterpflag) v->interpfrm = get_bits(gb, 1);
- skip_bits(gb, 2); //framecnt unused
- v->rangeredfrm = 0;
- if (v->rangered) v->rangeredfrm = get_bits(gb, 1);
- v->s.pict_type = get_bits(gb, 1);
- if (v->s.avctx->max_b_frames) {
- if (!v->s.pict_type) {
- if (get_bits(gb, 1)) v->s.pict_type = I_TYPE;
- else v->s.pict_type = B_TYPE;
- } else v->s.pict_type = P_TYPE;
- } else v->s.pict_type = v->s.pict_type ? P_TYPE : I_TYPE;
-
- v->bi_type = 0;
- if(v->s.pict_type == B_TYPE) {
- v->bfraction = get_vlc2(gb, vc1_bfraction_vlc.table, VC1_BFRACTION_VLC_BITS, 1);
- v->bfraction = vc1_bfraction_lut[v->bfraction];
- if(v->bfraction == 0) {
- v->s.pict_type = BI_TYPE;
- }
- }
- if(v->s.pict_type == I_TYPE || v->s.pict_type == BI_TYPE)
- get_bits(gb, 7); // skip buffer fullness
-
- /* calculate RND */
- if(v->s.pict_type == I_TYPE || v->s.pict_type == BI_TYPE)
- v->rnd = 1;
- if(v->s.pict_type == P_TYPE)
- v->rnd ^= 1;
-
- /* Quantizer stuff */
- pqindex = get_bits(gb, 5);
- if (v->quantizer_mode == QUANT_FRAME_IMPLICIT)
- v->pq = pquant_table[0][pqindex];
- else
- v->pq = pquant_table[1][pqindex];
-
- v->pquantizer = 1;
- if (v->quantizer_mode == QUANT_FRAME_IMPLICIT)
- v->pquantizer = pqindex < 9;
- if (v->quantizer_mode == QUANT_NON_UNIFORM)
- v->pquantizer = 0;
- v->pqindex = pqindex;
- if (pqindex < 9) v->halfpq = get_bits(gb, 1);
- else v->halfpq = 0;
- if (v->quantizer_mode == QUANT_FRAME_EXPLICIT)
- v->pquantizer = get_bits(gb, 1);
- v->dquantfrm = 0;
- if (v->extended_mv == 1) v->mvrange = get_prefix(gb, 0, 3);
- v->k_x = v->mvrange + 9 + (v->mvrange >> 1); //k_x can be 9 10 12 13
- v->k_y = v->mvrange + 8; //k_y can be 8 9 10 11
- v->range_x = 1 << (v->k_x - 1);
- v->range_y = 1 << (v->k_y - 1);
- if (v->profile == PROFILE_ADVANCED)
- {
- if (v->postprocflag) v->postproc = get_bits(gb, 1);
- }
- else
- if (v->multires && v->s.pict_type != B_TYPE) v->respic = get_bits(gb, 2);
-
-//av_log(v->s.avctx, AV_LOG_INFO, "%c Frame: QP=[%i]%i (+%i/2) %i\n",
-// (v->s.pict_type == P_TYPE) ? 'P' : ((v->s.pict_type == I_TYPE) ? 'I' : 'B'), pqindex, v->pq, v->halfpq, v->rangeredfrm);
-
- if(v->s.pict_type == I_TYPE || v->s.pict_type == P_TYPE) v->use_ic = 0;
-
- switch(v->s.pict_type) {
- case P_TYPE:
- if (v->pq < 5) v->tt_index = 0;
- else if(v->pq < 13) v->tt_index = 1;
- else v->tt_index = 2;
-
- lowquant = (v->pq > 12) ? 0 : 1;
- v->mv_mode = mv_pmode_table[lowquant][get_prefix(gb, 1, 4)];
- if (v->mv_mode == MV_PMODE_INTENSITY_COMP)
- {
- int scale, shift, i;
- v->mv_mode2 = mv_pmode_table2[lowquant][get_prefix(gb, 1, 3)];
- v->lumscale = get_bits(gb, 6);
- v->lumshift = get_bits(gb, 6);
- v->use_ic = 1;
- /* fill lookup tables for intensity compensation */
- if(!v->lumscale) {
- scale = -64;
- shift = (255 - v->lumshift * 2) << 6;
- if(v->lumshift > 31)
- shift += 128 << 6;
- } else {
- scale = v->lumscale + 32;
- if(v->lumshift > 31)
- shift = (v->lumshift - 64) << 6;
- else
- shift = v->lumshift << 6;
- }
- for(i = 0; i < 256; i++) {
- v->luty[i] = clip_uint8((scale * i + shift + 32) >> 6);
- v->lutuv[i] = clip_uint8((scale * (i - 128) + 128*64 + 32) >> 6);
- }
- }
- if(v->mv_mode == MV_PMODE_1MV_HPEL || v->mv_mode == MV_PMODE_1MV_HPEL_BILIN)
- v->s.quarter_sample = 0;
- else if(v->mv_mode == MV_PMODE_INTENSITY_COMP) {
- if(v->mv_mode2 == MV_PMODE_1MV_HPEL || v->mv_mode2 == MV_PMODE_1MV_HPEL_BILIN)
- v->s.quarter_sample = 0;
- else
- v->s.quarter_sample = 1;
- } else
- v->s.quarter_sample = 1;
- v->s.mspel = !(v->mv_mode == MV_PMODE_1MV_HPEL_BILIN || (v->mv_mode == MV_PMODE_INTENSITY_COMP && v->mv_mode2 == MV_PMODE_1MV_HPEL_BILIN));
-
- if ((v->mv_mode == MV_PMODE_INTENSITY_COMP &&
- v->mv_mode2 == MV_PMODE_MIXED_MV)
- || v->mv_mode == MV_PMODE_MIXED_MV)
- {
- status = bitplane_decoding(v->mv_type_mb_plane, &v->mv_type_is_raw, v);
- if (status < 0) return -1;
- av_log(v->s.avctx, AV_LOG_DEBUG, "MB MV Type plane encoding: "
- "Imode: %i, Invert: %i\n", status>>1, status&1);
- } else {
- v->mv_type_is_raw = 0;
- memset(v->mv_type_mb_plane, 0, v->s.mb_stride * v->s.mb_height);
- }
- status = bitplane_decoding(v->s.mbskip_table, &v->skip_is_raw, v);
- if (status < 0) return -1;
- av_log(v->s.avctx, AV_LOG_DEBUG, "MB Skip plane encoding: "
- "Imode: %i, Invert: %i\n", status>>1, status&1);
-
- /* Hopefully this is correct for P frames */
- v->s.mv_table_index = get_bits(gb, 2); //but using vc1_ tables
- v->cbpcy_vlc = &vc1_cbpcy_p_vlc[get_bits(gb, 2)];
-
- if (v->dquant)
- {
- av_log(v->s.avctx, AV_LOG_DEBUG, "VOP DQuant info\n");
- vop_dquant_decoding(v);
- }
-
- v->ttfrm = 0; //FIXME Is that so ?
- if (v->vstransform)
- {
- v->ttmbf = get_bits(gb, 1);
- if (v->ttmbf)
- {
- v->ttfrm = ttfrm_to_tt[get_bits(gb, 2)];
- }
- } else {
- v->ttmbf = 1;
- v->ttfrm = TT_8X8;
- }
- break;
- case B_TYPE:
- if (v->pq < 5) v->tt_index = 0;
- else if(v->pq < 13) v->tt_index = 1;
- else v->tt_index = 2;
-
- lowquant = (v->pq > 12) ? 0 : 1;
- v->mv_mode = get_bits1(gb) ? MV_PMODE_1MV : MV_PMODE_1MV_HPEL_BILIN;
- v->s.quarter_sample = (v->mv_mode == MV_PMODE_1MV);
- v->s.mspel = v->s.quarter_sample;
-
- status = bitplane_decoding(v->direct_mb_plane, &v->dmb_is_raw, v);
- if (status < 0) return -1;
- av_log(v->s.avctx, AV_LOG_DEBUG, "MB Direct Type plane encoding: "
- "Imode: %i, Invert: %i\n", status>>1, status&1);
- status = bitplane_decoding(v->s.mbskip_table, &v->skip_is_raw, v);
- if (status < 0) return -1;
- av_log(v->s.avctx, AV_LOG_DEBUG, "MB Skip plane encoding: "
- "Imode: %i, Invert: %i\n", status>>1, status&1);
-
- v->s.mv_table_index = get_bits(gb, 2);
- v->cbpcy_vlc = &vc1_cbpcy_p_vlc[get_bits(gb, 2)];
-
- if (v->dquant)
- {
- av_log(v->s.avctx, AV_LOG_DEBUG, "VOP DQuant info\n");
- vop_dquant_decoding(v);
- }
-
- v->ttfrm = 0;
- if (v->vstransform)
- {
- v->ttmbf = get_bits(gb, 1);
- if (v->ttmbf)
- {
- v->ttfrm = ttfrm_to_tt[get_bits(gb, 2)];
- }
- } else {
- v->ttmbf = 1;
- v->ttfrm = TT_8X8;
- }
- break;
- }
-
- /* AC Syntax */
- v->c_ac_table_index = decode012(gb);
- if (v->s.pict_type == I_TYPE || v->s.pict_type == BI_TYPE)
- {
- v->y_ac_table_index = decode012(gb);
- }
- /* DC Syntax */
- v->s.dc_table_index = get_bits(gb, 1);
-
- if(v->s.pict_type == BI_TYPE) {
- v->s.pict_type = B_TYPE;
- v->bi_type = 1;
- }
- return 0;
-}
-
-static int vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
-{
- int fcm;
- int pqindex, lowquant;
- int status;
-
- v->p_frame_skipped = 0;
-
- if(v->interlace)
- fcm = decode012(gb);
- switch(get_prefix(gb, 0, 4)) {
- case 0:
- v->s.pict_type = P_TYPE;
- break;
- case 1:
- v->s.pict_type = B_TYPE;
- break;
- case 2:
- v->s.pict_type = I_TYPE;
- break;
- case 3:
- v->s.pict_type = BI_TYPE;
- break;
- case 4:
- v->s.pict_type = P_TYPE; // skipped pic
- v->p_frame_skipped = 1;
- return 0;
- }
- if(v->tfcntrflag)
- get_bits(gb, 8);
- if(v->broadcast) {
- if(!v->interlace || v->panscanflag) {
- get_bits(gb, 2);
- } else {
- get_bits1(gb);
- get_bits1(gb);
- }
- }
- if(v->panscanflag) {
- //...
- }
- v->rnd = get_bits1(gb);
- if(v->interlace)
- v->uvsamp = get_bits1(gb);
- if(v->finterpflag) v->interpfrm = get_bits(gb, 1);
- if(v->s.pict_type == B_TYPE) {
- v->bfraction = get_vlc2(gb, vc1_bfraction_vlc.table, VC1_BFRACTION_VLC_BITS, 1);
- v->bfraction = vc1_bfraction_lut[v->bfraction];
- if(v->bfraction == 0) {
- v->s.pict_type = BI_TYPE; /* XXX: should not happen here */
- }
- }
- pqindex = get_bits(gb, 5);
- v->pqindex = pqindex;
- if (v->quantizer_mode == QUANT_FRAME_IMPLICIT)
- v->pq = pquant_table[0][pqindex];
- else
- v->pq = pquant_table[1][pqindex];
-
- v->pquantizer = 1;
- if (v->quantizer_mode == QUANT_FRAME_IMPLICIT)
- v->pquantizer = pqindex < 9;
- if (v->quantizer_mode == QUANT_NON_UNIFORM)
- v->pquantizer = 0;
- v->pqindex = pqindex;
- if (pqindex < 9) v->halfpq = get_bits(gb, 1);
- else v->halfpq = 0;
- if (v->quantizer_mode == QUANT_FRAME_EXPLICIT)
- v->pquantizer = get_bits(gb, 1);
-
- switch(v->s.pict_type) {
- case I_TYPE:
- case BI_TYPE:
- status = bitplane_decoding(v->acpred_plane, &v->acpred_is_raw, v);
- if (status < 0) return -1;
- av_log(v->s.avctx, AV_LOG_DEBUG, "ACPRED plane encoding: "
- "Imode: %i, Invert: %i\n", status>>1, status&1);
- v->condover = CONDOVER_NONE;
- if(v->overlap && v->pq <= 8) {
- v->condover = decode012(gb);
- if(v->condover == CONDOVER_SELECT) {
- status = bitplane_decoding(v->over_flags_plane, &v->overflg_is_raw, v);
- if (status < 0) return -1;
- av_log(v->s.avctx, AV_LOG_DEBUG, "CONDOVER plane encoding: "
- "Imode: %i, Invert: %i\n", status>>1, status&1);
- }
- }
- break;
- case P_TYPE:
- if(v->postprocflag)
- v->postproc = get_bits1(gb);
- if (v->extended_mv) v->mvrange = get_prefix(gb, 0, 3);
- else v->mvrange = 0;
- v->k_x = v->mvrange + 9 + (v->mvrange >> 1); //k_x can be 9 10 12 13
- v->k_y = v->mvrange + 8; //k_y can be 8 9 10 11
- v->range_x = 1 << (v->k_x - 1);
- v->range_y = 1 << (v->k_y - 1);
-
- if (v->pq < 5) v->tt_index = 0;
- else if(v->pq < 13) v->tt_index = 1;
- else v->tt_index = 2;
-
- lowquant = (v->pq > 12) ? 0 : 1;
- v->mv_mode = mv_pmode_table[lowquant][get_prefix(gb, 1, 4)];
- if (v->mv_mode == MV_PMODE_INTENSITY_COMP)
- {
- int scale, shift, i;
- v->mv_mode2 = mv_pmode_table2[lowquant][get_prefix(gb, 1, 3)];
- v->lumscale = get_bits(gb, 6);
- v->lumshift = get_bits(gb, 6);
- /* fill lookup tables for intensity compensation */
- if(!v->lumscale) {
- scale = -64;
- shift = (255 - v->lumshift * 2) << 6;
- if(v->lumshift > 31)
- shift += 128 << 6;
- } else {
- scale = v->lumscale + 32;
- if(v->lumshift > 31)
- shift = (v->lumshift - 64) << 6;
- else
- shift = v->lumshift << 6;
- }
- for(i = 0; i < 256; i++) {
- v->luty[i] = clip_uint8((scale * i + shift + 32) >> 6);
- v->lutuv[i] = clip_uint8((scale * (i - 128) + 128*64 + 32) >> 6);
- }
- }
- if(v->mv_mode == MV_PMODE_1MV_HPEL || v->mv_mode == MV_PMODE_1MV_HPEL_BILIN)
- v->s.quarter_sample = 0;
- else if(v->mv_mode == MV_PMODE_INTENSITY_COMP) {
- if(v->mv_mode2 == MV_PMODE_1MV_HPEL || v->mv_mode2 == MV_PMODE_1MV_HPEL_BILIN)
- v->s.quarter_sample = 0;
- else
- v->s.quarter_sample = 1;
- } else
- v->s.quarter_sample = 1;
- v->s.mspel = !(v->mv_mode == MV_PMODE_1MV_HPEL_BILIN || (v->mv_mode == MV_PMODE_INTENSITY_COMP && v->mv_mode2 == MV_PMODE_1MV_HPEL_BILIN));
-
- if ((v->mv_mode == MV_PMODE_INTENSITY_COMP &&
- v->mv_mode2 == MV_PMODE_MIXED_MV)
- || v->mv_mode == MV_PMODE_MIXED_MV)
- {
- status = bitplane_decoding(v->mv_type_mb_plane, &v->mv_type_is_raw, v);
- if (status < 0) return -1;
- av_log(v->s.avctx, AV_LOG_DEBUG, "MB MV Type plane encoding: "
- "Imode: %i, Invert: %i\n", status>>1, status&1);
- } else {
- v->mv_type_is_raw = 0;
- memset(v->mv_type_mb_plane, 0, v->s.mb_stride * v->s.mb_height);
- }
- status = bitplane_decoding(v->s.mbskip_table, &v->skip_is_raw, v);
- if (status < 0) return -1;
- av_log(v->s.avctx, AV_LOG_DEBUG, "MB Skip plane encoding: "
- "Imode: %i, Invert: %i\n", status>>1, status&1);
-
- /* Hopefully this is correct for P frames */
- v->s.mv_table_index = get_bits(gb, 2); //but using vc1_ tables
- v->cbpcy_vlc = &vc1_cbpcy_p_vlc[get_bits(gb, 2)];
- if (v->dquant)
- {
- av_log(v->s.avctx, AV_LOG_DEBUG, "VOP DQuant info\n");
- vop_dquant_decoding(v);
- }
-
- v->ttfrm = 0; //FIXME Is that so ?
- if (v->vstransform)
- {
- v->ttmbf = get_bits(gb, 1);
- if (v->ttmbf)
- {
- v->ttfrm = ttfrm_to_tt[get_bits(gb, 2)];
- }
- } else {
- v->ttmbf = 1;
- v->ttfrm = TT_8X8;
- }
- break;
- case B_TYPE:
- if(v->postprocflag)
- v->postproc = get_bits1(gb);
- if (v->extended_mv) v->mvrange = get_prefix(gb, 0, 3);
- else v->mvrange = 0;
- v->k_x = v->mvrange + 9 + (v->mvrange >> 1); //k_x can be 9 10 12 13
- v->k_y = v->mvrange + 8; //k_y can be 8 9 10 11
- v->range_x = 1 << (v->k_x - 1);
- v->range_y = 1 << (v->k_y - 1);
-
- if (v->pq < 5) v->tt_index = 0;
- else if(v->pq < 13) v->tt_index = 1;
- else v->tt_index = 2;
-
- lowquant = (v->pq > 12) ? 0 : 1;
- v->mv_mode = get_bits1(gb) ? MV_PMODE_1MV : MV_PMODE_1MV_HPEL_BILIN;
- v->s.quarter_sample = (v->mv_mode == MV_PMODE_1MV);
- v->s.mspel = v->s.quarter_sample;
-
- status = bitplane_decoding(v->direct_mb_plane, &v->dmb_is_raw, v);
- if (status < 0) return -1;
- av_log(v->s.avctx, AV_LOG_DEBUG, "MB Direct Type plane encoding: "
- "Imode: %i, Invert: %i\n", status>>1, status&1);
- status = bitplane_decoding(v->s.mbskip_table, &v->skip_is_raw, v);
- if (status < 0) return -1;
- av_log(v->s.avctx, AV_LOG_DEBUG, "MB Skip plane encoding: "
- "Imode: %i, Invert: %i\n", status>>1, status&1);
-
- v->s.mv_table_index = get_bits(gb, 2);
- v->cbpcy_vlc = &vc1_cbpcy_p_vlc[get_bits(gb, 2)];
-
- if (v->dquant)
- {
- av_log(v->s.avctx, AV_LOG_DEBUG, "VOP DQuant info\n");
- vop_dquant_decoding(v);
- }
-
- v->ttfrm = 0;
- if (v->vstransform)
- {
- v->ttmbf = get_bits(gb, 1);
- if (v->ttmbf)
- {
- v->ttfrm = ttfrm_to_tt[get_bits(gb, 2)];
- }
- } else {
- v->ttmbf = 1;
- v->ttfrm = TT_8X8;
- }
- break;
- }
-
- /* AC Syntax */
- v->c_ac_table_index = decode012(gb);
- if (v->s.pict_type == I_TYPE || v->s.pict_type == BI_TYPE)
- {
- v->y_ac_table_index = decode012(gb);
- }
- /* DC Syntax */
- v->s.dc_table_index = get_bits(gb, 1);
- if (v->s.pict_type == I_TYPE && v->dquant) {
- av_log(v->s.avctx, AV_LOG_DEBUG, "VOP DQuant info\n");
- vop_dquant_decoding(v);
- }
-
- v->bi_type = 0;
- if(v->s.pict_type == BI_TYPE) {
- v->s.pict_type = B_TYPE;
- v->bi_type = 1;
- }
- return 0;
-}
-
-/***********************************************************************/
-/**
- * @defgroup block VC-1 Block-level functions
- * @see 7.1.4, p91 and 8.1.1.7, p(1)04
- * @{
- */
-
-/**
- * @def GET_MQUANT
- * @brief Get macroblock-level quantizer scale
- */
-#define GET_MQUANT() \
- if (v->dquantfrm) \
- { \
- int edges = 0; \
- if (v->dqprofile == DQPROFILE_ALL_MBS) \
- { \
- if (v->dqbilevel) \
- { \
- mquant = (get_bits(gb, 1)) ? v->altpq : v->pq; \
- } \
- else \
- { \
- mqdiff = get_bits(gb, 3); \
- if (mqdiff != 7) mquant = v->pq + mqdiff; \
- else mquant = get_bits(gb, 5); \
- } \
- } \
- if(v->dqprofile == DQPROFILE_SINGLE_EDGE) \
- edges = 1 << v->dqsbedge; \
- else if(v->dqprofile == DQPROFILE_DOUBLE_EDGES) \
- edges = (3 << v->dqsbedge) % 15; \
- else if(v->dqprofile == DQPROFILE_FOUR_EDGES) \
- edges = 15; \
- if((edges&1) && !s->mb_x) \
- mquant = v->altpq; \
- if((edges&2) && s->first_slice_line) \
- mquant = v->altpq; \
- if((edges&4) && s->mb_x == (s->mb_width - 1)) \
- mquant = v->altpq; \
- if((edges&8) && s->mb_y == (s->mb_height - 1)) \
- mquant = v->altpq; \
- }
-
-/**
- * @def GET_MVDATA(_dmv_x, _dmv_y)
- * @brief Get MV differentials
- * @see MVDATA decoding from 8.3.5.2, p(1)20
- * @param _dmv_x Horizontal differential for decoded MV
- * @param _dmv_y Vertical differential for decoded MV
- */
-#define GET_MVDATA(_dmv_x, _dmv_y) \
- index = 1 + get_vlc2(gb, vc1_mv_diff_vlc[s->mv_table_index].table,\
- VC1_MV_DIFF_VLC_BITS, 2); \
- if (index > 36) \
- { \
- mb_has_coeffs = 1; \
- index -= 37; \
- } \
- else mb_has_coeffs = 0; \
- s->mb_intra = 0; \
- if (!index) { _dmv_x = _dmv_y = 0; } \
- else if (index == 35) \
- { \
- _dmv_x = get_bits(gb, v->k_x - 1 + s->quarter_sample); \
- _dmv_y = get_bits(gb, v->k_y - 1 + s->quarter_sample); \
- } \
- else if (index == 36) \
- { \
- _dmv_x = 0; \
- _dmv_y = 0; \
- s->mb_intra = 1; \
- } \
- else \
- { \
- index1 = index%6; \
- if (!s->quarter_sample && index1 == 5) val = 1; \
- else val = 0; \
- if(size_table[index1] - val > 0) \
- val = get_bits(gb, size_table[index1] - val); \
- else val = 0; \
- sign = 0 - (val&1); \
- _dmv_x = (sign ^ ((val>>1) + offset_table[index1])) - sign; \
- \
- index1 = index/6; \
- if (!s->quarter_sample && index1 == 5) val = 1; \
- else val = 0; \
- if(size_table[index1] - val > 0) \
- val = get_bits(gb, size_table[index1] - val); \
- else val = 0; \
- sign = 0 - (val&1); \
- _dmv_y = (sign ^ ((val>>1) + offset_table[index1])) - sign; \
- }
-
-/** Predict and set motion vector
- */
-static inline void vc1_pred_mv(MpegEncContext *s, int n, int dmv_x, int dmv_y, int mv1, int r_x, int r_y, uint8_t* is_intra)
-{
- int xy, wrap, off = 0;
- int16_t *A, *B, *C;
- int px, py;
- int sum;
-
- /* scale MV difference to be quad-pel */
- dmv_x <<= 1 - s->quarter_sample;
- dmv_y <<= 1 - s->quarter_sample;
-
- wrap = s->b8_stride;
- xy = s->block_index[n];
-
- if(s->mb_intra){
- s->mv[0][n][0] = s->current_picture.motion_val[0][xy][0] = 0;
- s->mv[0][n][1] = s->current_picture.motion_val[0][xy][1] = 0;
- if(mv1) { /* duplicate motion data for 1-MV block */
- s->current_picture.motion_val[0][xy + 1][0] = 0;
- s->current_picture.motion_val[0][xy + 1][1] = 0;
- s->current_picture.motion_val[0][xy + wrap][0] = 0;
- s->current_picture.motion_val[0][xy + wrap][1] = 0;
- s->current_picture.motion_val[0][xy + wrap + 1][0] = 0;
- s->current_picture.motion_val[0][xy + wrap + 1][1] = 0;
- }
- return;
- }
-
- C = s->current_picture.motion_val[0][xy - 1];
- A = s->current_picture.motion_val[0][xy - wrap];
- if(mv1)
- off = (s->mb_x == (s->mb_width - 1)) ? -1 : 2;
- else {
- //in 4-MV mode different blocks have different B predictor position
- switch(n){
- case 0:
- off = (s->mb_x > 0) ? -1 : 1;
- break;
- case 1:
- off = (s->mb_x == (s->mb_width - 1)) ? -1 : 1;
- break;
- case 2:
- off = 1;
- break;
- case 3:
- off = -1;
- }
- }
- B = s->current_picture.motion_val[0][xy - wrap + off];
-
- if(!s->first_slice_line || (n==2 || n==3)) { // predictor A is not out of bounds
- if(s->mb_width == 1) {
- px = A[0];
- py = A[1];
- } else {
- px = mid_pred(A[0], B[0], C[0]);
- py = mid_pred(A[1], B[1], C[1]);
- }
- } else if(s->mb_x || (n==1 || n==3)) { // predictor C is not out of bounds
- px = C[0];
- py = C[1];
- } else {
- px = py = 0;
- }
- /* Pullback MV as specified in 8.3.5.3.4 */
- {
- int qx, qy, X, Y;
- qx = (s->mb_x << 6) + ((n==1 || n==3) ? 32 : 0);
- qy = (s->mb_y << 6) + ((n==2 || n==3) ? 32 : 0);
- X = (s->mb_width << 6) - 4;
- Y = (s->mb_height << 6) - 4;
- if(mv1) {
- if(qx + px < -60) px = -60 - qx;
- if(qy + py < -60) py = -60 - qy;
- } else {
- if(qx + px < -28) px = -28 - qx;
- if(qy + py < -28) py = -28 - qy;
- }
- if(qx + px > X) px = X - qx;
- if(qy + py > Y) py = Y - qy;
- }
- /* Calculate hybrid prediction as specified in 8.3.5.3.5 */
- if((!s->first_slice_line || (n==2 || n==3)) && (s->mb_x || (n==1 || n==3))) {
- if(is_intra[xy - wrap])
- sum = FFABS(px) + FFABS(py);
- else
- sum = FFABS(px - A[0]) + FFABS(py - A[1]);
- if(sum > 32) {
- if(get_bits1(&s->gb)) {
- px = A[0];
- py = A[1];
- } else {
- px = C[0];
- py = C[1];
- }
- } else {
- if(is_intra[xy - 1])
- sum = FFABS(px) + FFABS(py);
- else
- sum = FFABS(px - C[0]) + FFABS(py - C[1]);
- if(sum > 32) {
- if(get_bits1(&s->gb)) {
- px = A[0];
- py = A[1];
- } else {
- px = C[0];
- py = C[1];
- }
- }
- }
- }
- /* store MV using signed modulus of MV range defined in 4.11 */
- s->mv[0][n][0] = s->current_picture.motion_val[0][xy][0] = ((px + dmv_x + r_x) & ((r_x << 1) - 1)) - r_x;
- s->mv[0][n][1] = s->current_picture.motion_val[0][xy][1] = ((py + dmv_y + r_y) & ((r_y << 1) - 1)) - r_y;
- if(mv1) { /* duplicate motion data for 1-MV block */
- s->current_picture.motion_val[0][xy + 1][0] = s->current_picture.motion_val[0][xy][0];
- s->current_picture.motion_val[0][xy + 1][1] = s->current_picture.motion_val[0][xy][1];
- s->current_picture.motion_val[0][xy + wrap][0] = s->current_picture.motion_val[0][xy][0];
- s->current_picture.motion_val[0][xy + wrap][1] = s->current_picture.motion_val[0][xy][1];
- s->current_picture.motion_val[0][xy + wrap + 1][0] = s->current_picture.motion_val[0][xy][0];
- s->current_picture.motion_val[0][xy + wrap + 1][1] = s->current_picture.motion_val[0][xy][1];
- }
-}
-
-/** Motion compensation for direct or interpolated blocks in B-frames
- */
-static void vc1_interp_mc(VC1Context *v)
-{
- MpegEncContext *s = &v->s;
- DSPContext *dsp = &v->s.dsp;
- uint8_t *srcY, *srcU, *srcV;
- int dxy, uvdxy, mx, my, uvmx, uvmy, src_x, src_y, uvsrc_x, uvsrc_y;
-
- if(!v->s.next_picture.data[0])return;
-
- mx = s->mv[1][0][0];
- my = s->mv[1][0][1];
- uvmx = (mx + ((mx & 3) == 3)) >> 1;
- uvmy = (my + ((my & 3) == 3)) >> 1;
- if(v->fastuvmc) {
- uvmx = uvmx + ((uvmx<0)?-(uvmx&1):(uvmx&1));
- uvmy = uvmy + ((uvmy<0)?-(uvmy&1):(uvmy&1));
- }
- srcY = s->next_picture.data[0];
- srcU = s->next_picture.data[1];
- srcV = s->next_picture.data[2];
-
- src_x = s->mb_x * 16 + (mx >> 2);
- src_y = s->mb_y * 16 + (my >> 2);
- uvsrc_x = s->mb_x * 8 + (uvmx >> 2);
- uvsrc_y = s->mb_y * 8 + (uvmy >> 2);
-
- src_x = clip( src_x, -16, s->mb_width * 16);
- src_y = clip( src_y, -16, s->mb_height * 16);
- uvsrc_x = clip(uvsrc_x, -8, s->mb_width * 8);
- uvsrc_y = clip(uvsrc_y, -8, s->mb_height * 8);
-
- srcY += src_y * s->linesize + src_x;
- srcU += uvsrc_y * s->uvlinesize + uvsrc_x;
- srcV += uvsrc_y * s->uvlinesize + uvsrc_x;
-
- /* for grayscale we should not try to read from unknown area */
- if(s->flags & CODEC_FLAG_GRAY) {
- srcU = s->edge_emu_buffer + 18 * s->linesize;
- srcV = s->edge_emu_buffer + 18 * s->linesize;
- }
-
- if(v->rangeredfrm
- || (unsigned)src_x > s->h_edge_pos - (mx&3) - 16
- || (unsigned)src_y > s->v_edge_pos - (my&3) - 16){
- uint8_t *uvbuf= s->edge_emu_buffer + 19 * s->linesize;
-
- srcY -= s->mspel * (1 + s->linesize);
- ff_emulated_edge_mc(s->edge_emu_buffer, srcY, s->linesize, 17+s->mspel*2, 17+s->mspel*2,
- src_x - s->mspel, src_y - s->mspel, s->h_edge_pos, s->v_edge_pos);
- srcY = s->edge_emu_buffer;
- ff_emulated_edge_mc(uvbuf , srcU, s->uvlinesize, 8+1, 8+1,
- uvsrc_x, uvsrc_y, s->h_edge_pos >> 1, s->v_edge_pos >> 1);
- ff_emulated_edge_mc(uvbuf + 16, srcV, s->uvlinesize, 8+1, 8+1,
- uvsrc_x, uvsrc_y, s->h_edge_pos >> 1, s->v_edge_pos >> 1);
- srcU = uvbuf;
- srcV = uvbuf + 16;
- /* if we deal with range reduction we need to scale source blocks */
- if(v->rangeredfrm) {
- int i, j;
- uint8_t *src, *src2;
-
- src = srcY;
- for(j = 0; j < 17 + s->mspel*2; j++) {
- for(i = 0; i < 17 + s->mspel*2; i++) src[i] = ((src[i] - 128) >> 1) + 128;
- src += s->linesize;
- }
- src = srcU; src2 = srcV;
- for(j = 0; j < 9; j++) {
- for(i = 0; i < 9; i++) {
- src[i] = ((src[i] - 128) >> 1) + 128;
- src2[i] = ((src2[i] - 128) >> 1) + 128;
- }
- src += s->uvlinesize;
- src2 += s->uvlinesize;
- }
- }
- srcY += s->mspel * (1 + s->linesize);
- }
-
- mx >>= 1;
- my >>= 1;
- dxy = ((my & 1) << 1) | (mx & 1);
-
- dsp->avg_pixels_tab[0][dxy](s->dest[0], srcY, s->linesize, 16);
-
- if(s->flags & CODEC_FLAG_GRAY) return;
- /* Chroma MC always uses qpel blilinear */
- uvdxy = ((uvmy & 3) << 2) | (uvmx & 3);
- uvmx = (uvmx&3)<<1;
- uvmy = (uvmy&3)<<1;
- dsp->avg_h264_chroma_pixels_tab[0](s->dest[1], srcU, s->uvlinesize, 8, uvmx, uvmy);
- dsp->avg_h264_chroma_pixels_tab[0](s->dest[2], srcV, s->uvlinesize, 8, uvmx, uvmy);
-}
-
-static av_always_inline int scale_mv(int value, int bfrac, int inv, int qs)
-{
- int n = bfrac;
-
-#if B_FRACTION_DEN==256
- if(inv)
- n -= 256;
- if(!qs)
- return 2 * ((value * n + 255) >> 9);
- return (value * n + 128) >> 8;
-#else
- if(inv)
- n -= B_FRACTION_DEN;
- if(!qs)
- return 2 * ((value * n + B_FRACTION_DEN - 1) / (2 * B_FRACTION_DEN));
- return (value * n + B_FRACTION_DEN/2) / B_FRACTION_DEN;
-#endif
-}
-
-/** Reconstruct motion vector for B-frame and do motion compensation
- */
-static inline void vc1_b_mc(VC1Context *v, int dmv_x[2], int dmv_y[2], int direct, int mode)
-{
- if(v->use_ic) {
- v->mv_mode2 = v->mv_mode;
- v->mv_mode = MV_PMODE_INTENSITY_COMP;
- }
- if(direct) {
- vc1_mc_1mv(v, 0);
- vc1_interp_mc(v);
- if(v->use_ic) v->mv_mode = v->mv_mode2;
- return;
- }
- if(mode == BMV_TYPE_INTERPOLATED) {
- vc1_mc_1mv(v, 0);
- vc1_interp_mc(v);
- if(v->use_ic) v->mv_mode = v->mv_mode2;
- return;
- }
-
- if(v->use_ic && (mode == BMV_TYPE_BACKWARD)) v->mv_mode = v->mv_mode2;
- vc1_mc_1mv(v, (mode == BMV_TYPE_BACKWARD));
- if(v->use_ic) v->mv_mode = v->mv_mode2;
-}
-
-static inline void vc1_pred_b_mv(VC1Context *v, int dmv_x[2], int dmv_y[2], int direct, int mvtype)
-{
- MpegEncContext *s = &v->s;
- int xy, wrap, off = 0;
- int16_t *A, *B, *C;
- int px, py;
- int sum;
- int r_x, r_y;
- const uint8_t *is_intra = v->mb_type[0];
-
- r_x = v->range_x;
- r_y = v->range_y;
- /* scale MV difference to be quad-pel */
- dmv_x[0] <<= 1 - s->quarter_sample;
- dmv_y[0] <<= 1 - s->quarter_sample;
- dmv_x[1] <<= 1 - s->quarter_sample;
- dmv_y[1] <<= 1 - s->quarter_sample;
-
- wrap = s->b8_stride;
- xy = s->block_index[0];
-
- if(s->mb_intra) {
- s->current_picture.motion_val[0][xy][0] =
- s->current_picture.motion_val[0][xy][1] =
- s->current_picture.motion_val[1][xy][0] =
- s->current_picture.motion_val[1][xy][1] = 0;
- return;
- }
- s->mv[0][0][0] = scale_mv(s->next_picture.motion_val[1][xy][0], v->bfraction, 0, s->quarter_sample);
- s->mv[0][0][1] = scale_mv(s->next_picture.motion_val[1][xy][1], v->bfraction, 0, s->quarter_sample);
- s->mv[1][0][0] = scale_mv(s->next_picture.motion_val[1][xy][0], v->bfraction, 1, s->quarter_sample);
- s->mv[1][0][1] = scale_mv(s->next_picture.motion_val[1][xy][1], v->bfraction, 1, s->quarter_sample);
- if(direct) {
- s->current_picture.motion_val[0][xy][0] = s->mv[0][0][0];
- s->current_picture.motion_val[0][xy][1] = s->mv[0][0][1];
- s->current_picture.motion_val[1][xy][0] = s->mv[1][0][0];
- s->current_picture.motion_val[1][xy][1] = s->mv[1][0][1];
- return;
- }
-
- if((mvtype == BMV_TYPE_FORWARD) || (mvtype == BMV_TYPE_INTERPOLATED)) {
- C = s->current_picture.motion_val[0][xy - 2];
- A = s->current_picture.motion_val[0][xy - wrap*2];
- off = (s->mb_x == (s->mb_width - 1)) ? -2 : 2;
- B = s->current_picture.motion_val[0][xy - wrap*2 + off];
-
- if(!s->first_slice_line) { // predictor A is not out of bounds
- if(s->mb_width == 1) {
- px = A[0];
- py = A[1];
- } else {
- px = mid_pred(A[0], B[0], C[0]);
- py = mid_pred(A[1], B[1], C[1]);
- }
- } else if(s->mb_x) { // predictor C is not out of bounds
- px = C[0];
- py = C[1];
- } else {
- px = py = 0;
- }
- /* Pullback MV as specified in 8.3.5.3.4 */
- {
- int qx, qy, X, Y;
- if(v->profile < PROFILE_ADVANCED) {
- qx = (s->mb_x << 5);
- qy = (s->mb_y << 5);
- X = (s->mb_width << 5) - 4;
- Y = (s->mb_height << 5) - 4;
- if(qx + px < -28) px = -28 - qx;
- if(qy + py < -28) py = -28 - qy;
- if(qx + px > X) px = X - qx;
- if(qy + py > Y) py = Y - qy;
- } else {
- qx = (s->mb_x << 6);
- qy = (s->mb_y << 6);
- X = (s->mb_width << 6) - 4;
- Y = (s->mb_height << 6) - 4;
- if(qx + px < -60) px = -60 - qx;
- if(qy + py < -60) py = -60 - qy;
- if(qx + px > X) px = X - qx;
- if(qy + py > Y) py = Y - qy;
- }
- }
- /* Calculate hybrid prediction as specified in 8.3.5.3.5 */
- if(0 && !s->first_slice_line && s->mb_x) {
- if(is_intra[xy - wrap])
- sum = FFABS(px) + FFABS(py);
- else
- sum = FFABS(px - A[0]) + FFABS(py - A[1]);
- if(sum > 32) {
- if(get_bits1(&s->gb)) {
- px = A[0];
- py = A[1];
- } else {
- px = C[0];
- py = C[1];
- }
- } else {
- if(is_intra[xy - 2])
- sum = FFABS(px) + FFABS(py);
- else
- sum = FFABS(px - C[0]) + FFABS(py - C[1]);
- if(sum > 32) {
- if(get_bits1(&s->gb)) {
- px = A[0];
- py = A[1];
- } else {
- px = C[0];
- py = C[1];
- }
- }
- }
- }
- /* store MV using signed modulus of MV range defined in 4.11 */
- s->mv[0][0][0] = ((px + dmv_x[0] + r_x) & ((r_x << 1) - 1)) - r_x;
- s->mv[0][0][1] = ((py + dmv_y[0] + r_y) & ((r_y << 1) - 1)) - r_y;
- }
- if((mvtype == BMV_TYPE_BACKWARD) || (mvtype == BMV_TYPE_INTERPOLATED)) {
- C = s->current_picture.motion_val[1][xy - 2];
- A = s->current_picture.motion_val[1][xy - wrap*2];
- off = (s->mb_x == (s->mb_width - 1)) ? -2 : 2;
- B = s->current_picture.motion_val[1][xy - wrap*2 + off];
-
- if(!s->first_slice_line) { // predictor A is not out of bounds
- if(s->mb_width == 1) {
- px = A[0];
- py = A[1];
- } else {
- px = mid_pred(A[0], B[0], C[0]);
- py = mid_pred(A[1], B[1], C[1]);
- }
- } else if(s->mb_x) { // predictor C is not out of bounds
- px = C[0];
- py = C[1];
- } else {
- px = py = 0;
- }
- /* Pullback MV as specified in 8.3.5.3.4 */
- {
- int qx, qy, X, Y;
- if(v->profile < PROFILE_ADVANCED) {
- qx = (s->mb_x << 5);
- qy = (s->mb_y << 5);
- X = (s->mb_width << 5) - 4;
- Y = (s->mb_height << 5) - 4;
- if(qx + px < -28) px = -28 - qx;
- if(qy + py < -28) py = -28 - qy;
- if(qx + px > X) px = X - qx;
- if(qy + py > Y) py = Y - qy;
- } else {
- qx = (s->mb_x << 6);
- qy = (s->mb_y << 6);
- X = (s->mb_width << 6) - 4;
- Y = (s->mb_height << 6) - 4;
- if(qx + px < -60) px = -60 - qx;
- if(qy + py < -60) py = -60 - qy;
- if(qx + px > X) px = X - qx;
- if(qy + py > Y) py = Y - qy;
- }
- }
- /* Calculate hybrid prediction as specified in 8.3.5.3.5 */
- if(0 && !s->first_slice_line && s->mb_x) {
- if(is_intra[xy - wrap])
- sum = FFABS(px) + FFABS(py);
- else
- sum = FFABS(px - A[0]) + FFABS(py - A[1]);
- if(sum > 32) {
- if(get_bits1(&s->gb)) {
- px = A[0];
- py = A[1];
- } else {
- px = C[0];
- py = C[1];
- }
- } else {
- if(is_intra[xy - 2])
- sum = FFABS(px) + FFABS(py);
- else
- sum = FFABS(px - C[0]) + FFABS(py - C[1]);
- if(sum > 32) {
- if(get_bits1(&s->gb)) {
- px = A[0];
- py = A[1];
- } else {
- px = C[0];
- py = C[1];
- }
- }
- }
- }
- /* store MV using signed modulus of MV range defined in 4.11 */
-
- s->mv[1][0][0] = ((px + dmv_x[1] + r_x) & ((r_x << 1) - 1)) - r_x;
- s->mv[1][0][1] = ((py + dmv_y[1] + r_y) & ((r_y << 1) - 1)) - r_y;
- }
- s->current_picture.motion_val[0][xy][0] = s->mv[0][0][0];
- s->current_picture.motion_val[0][xy][1] = s->mv[0][0][1];
- s->current_picture.motion_val[1][xy][0] = s->mv[1][0][0];
- s->current_picture.motion_val[1][xy][1] = s->mv[1][0][1];
-}
-
-/** Get predicted DC value for I-frames only
- * prediction dir: left=0, top=1
- * @param s MpegEncContext
- * @param[in] n block index in the current MB
- * @param dc_val_ptr Pointer to DC predictor
- * @param dir_ptr Prediction direction for use in AC prediction
- */
-static inline int vc1_i_pred_dc(MpegEncContext *s, int overlap, int pq, int n,
- int16_t **dc_val_ptr, int *dir_ptr)
-{
- int a, b, c, wrap, pred, scale;
- int16_t *dc_val;
- static const uint16_t dcpred[32] = {
- -1, 1024, 512, 341, 256, 205, 171, 146, 128,
- 114, 102, 93, 85, 79, 73, 68, 64,
- 60, 57, 54, 51, 49, 47, 45, 43,
- 41, 39, 38, 37, 35, 34, 33
- };
-
- /* find prediction - wmv3_dc_scale always used here in fact */
- if (n < 4) scale = s->y_dc_scale;
- else scale = s->c_dc_scale;
-
- wrap = s->block_wrap[n];
- dc_val= s->dc_val[0] + s->block_index[n];
-
- /* B A
- * C X
- */
- c = dc_val[ - 1];
- b = dc_val[ - 1 - wrap];
- a = dc_val[ - wrap];
-
- if (pq < 9 || !overlap)
- {
- /* Set outer values */
- if (s->first_slice_line && (n!=2 && n!=3)) b=a=dcpred[scale];
- if (s->mb_x == 0 && (n!=1 && n!=3)) b=c=dcpred[scale];
- }
- else
- {
- /* Set outer values */
- if (s->first_slice_line && (n!=2 && n!=3)) b=a=0;
- if (s->mb_x == 0 && (n!=1 && n!=3)) b=c=0;
- }
-
- if (abs(a - b) <= abs(b - c)) {
- pred = c;
- *dir_ptr = 1;//left
- } else {
- pred = a;
- *dir_ptr = 0;//top
- }
-
- /* update predictor */
- *dc_val_ptr = &dc_val[0];
- return pred;
-}
-
-
-/** Get predicted DC value
- * prediction dir: left=0, top=1
- * @param s MpegEncContext
- * @param[in] n block index in the current MB
- * @param dc_val_ptr Pointer to DC predictor
- * @param dir_ptr Prediction direction for use in AC prediction
- */
-static inline int vc1_pred_dc(MpegEncContext *s, int overlap, int pq, int n,
- int a_avail, int c_avail,
- int16_t **dc_val_ptr, int *dir_ptr)
-{
- int a, b, c, wrap, pred, scale;
- int16_t *dc_val;
- int mb_pos = s->mb_x + s->mb_y * s->mb_stride;
- int q1, q2 = 0;
-
- /* find prediction - wmv3_dc_scale always used here in fact */
- if (n < 4) scale = s->y_dc_scale;
- else scale = s->c_dc_scale;
-
- wrap = s->block_wrap[n];
- dc_val= s->dc_val[0] + s->block_index[n];
-
- /* B A
- * C X
- */
- c = dc_val[ - 1];
- b = dc_val[ - 1 - wrap];
- a = dc_val[ - wrap];
- /* scale predictors if needed */
- q1 = s->current_picture.qscale_table[mb_pos];
- if(c_avail && (n!= 1 && n!=3)) {
- q2 = s->current_picture.qscale_table[mb_pos - 1];
- if(q2 && q2 != q1)
- c = (c * s->y_dc_scale_table[q2] * vc1_dqscale[s->y_dc_scale_table[q1] - 1] + 0x20000) >> 18;
- }
- if(a_avail && (n!= 2 && n!=3)) {
- q2 = s->current_picture.qscale_table[mb_pos - s->mb_stride];
- if(q2 && q2 != q1)
- a = (a * s->y_dc_scale_table[q2] * vc1_dqscale[s->y_dc_scale_table[q1] - 1] + 0x20000) >> 18;
- }
- if(a_avail && c_avail && (n!=3)) {
- int off = mb_pos;
- if(n != 1) off--;
- if(n != 2) off -= s->mb_stride;
- q2 = s->current_picture.qscale_table[off];
- if(q2 && q2 != q1)
- b = (b * s->y_dc_scale_table[q2] * vc1_dqscale[s->y_dc_scale_table[q1] - 1] + 0x20000) >> 18;
- }
-
- if(a_avail && c_avail) {
- if(abs(a - b) <= abs(b - c)) {
- pred = c;
- *dir_ptr = 1;//left
- } else {
- pred = a;
- *dir_ptr = 0;//top
- }
- } else if(a_avail) {
- pred = a;
- *dir_ptr = 0;//top
- } else if(c_avail) {
- pred = c;
- *dir_ptr = 1;//left
- } else {
- pred = 0;
- *dir_ptr = 1;//left
- }
-
- /* update predictor */
- *dc_val_ptr = &dc_val[0];
- return pred;
-}
-
-
-/**
- * @defgroup std_mb VC1 Macroblock-level functions in Simple/Main Profiles
- * @see 7.1.4, p91 and 8.1.1.7, p(1)04
- * @{
- */
-
-static inline int vc1_coded_block_pred(MpegEncContext * s, int n, uint8_t **coded_block_ptr)
-{
- int xy, wrap, pred, a, b, c;
-
- xy = s->block_index[n];
- wrap = s->b8_stride;
-
- /* B C
- * A X
- */
- a = s->coded_block[xy - 1 ];
- b = s->coded_block[xy - 1 - wrap];
- c = s->coded_block[xy - wrap];
-
- if (b == c) {
- pred = a;
- } else {
- pred = c;
- }
-
- /* store value */
- *coded_block_ptr = &s->coded_block[xy];
-
- return pred;
-}
-
-/**
- * Decode one AC coefficient
- * @param v The VC1 context
- * @param last Last coefficient
- * @param skip How much zero coefficients to skip
- * @param value Decoded AC coefficient value
- * @see 8.1.3.4
- */
-static void vc1_decode_ac_coeff(VC1Context *v, int *last, int *skip, int *value, int codingset)
-{
- GetBitContext *gb = &v->s.gb;
- int index, escape, run = 0, level = 0, lst = 0;
-
- index = get_vlc2(gb, vc1_ac_coeff_table[codingset].table, AC_VLC_BITS, 3);
- if (index != vc1_ac_sizes[codingset] - 1) {
- run = vc1_index_decode_table[codingset][index][0];
- level = vc1_index_decode_table[codingset][index][1];
- lst = index >= vc1_last_decode_table[codingset];
- if(get_bits(gb, 1))
- level = -level;
- } else {
- escape = decode210(gb);
- if (escape != 2) {
- index = get_vlc2(gb, vc1_ac_coeff_table[codingset].table, AC_VLC_BITS, 3);
- run = vc1_index_decode_table[codingset][index][0];
- level = vc1_index_decode_table[codingset][index][1];
- lst = index >= vc1_last_decode_table[codingset];
- if(escape == 0) {
- if(lst)
- level += vc1_last_delta_level_table[codingset][run];
- else
- level += vc1_delta_level_table[codingset][run];
- } else {
- if(lst)
- run += vc1_last_delta_run_table[codingset][level] + 1;
- else
- run += vc1_delta_run_table[codingset][level] + 1;
- }
- if(get_bits(gb, 1))
- level = -level;
- } else {
- int sign;
- lst = get_bits(gb, 1);
- if(v->s.esc3_level_length == 0) {
- if(v->pq < 8 || v->dquantfrm) { // table 59
- v->s.esc3_level_length = get_bits(gb, 3);
- if(!v->s.esc3_level_length)
- v->s.esc3_level_length = get_bits(gb, 2) + 8;
- } else { //table 60
- v->s.esc3_level_length = get_prefix(gb, 1, 6) + 2;
- }
- v->s.esc3_run_length = 3 + get_bits(gb, 2);
- }
- run = get_bits(gb, v->s.esc3_run_length);
- sign = get_bits(gb, 1);
- level = get_bits(gb, v->s.esc3_level_length);
- if(sign)
- level = -level;
- }
- }
-
- *last = lst;
- *skip = run;
- *value = level;
-}
-
-/** Decode intra block in intra frames - should be faster than decode_intra_block
- * @param v VC1Context
- * @param block block to decode
- * @param coded are AC coeffs present or not
- * @param codingset set of VLC to decode data
- */
-static int vc1_decode_i_block(VC1Context *v, DCTELEM block[64], int n, int coded, int codingset)
-{
- GetBitContext *gb = &v->s.gb;
- MpegEncContext *s = &v->s;
- int dc_pred_dir = 0; /* Direction of the DC prediction used */
- int run_diff, i;
- int16_t *dc_val;
- int16_t *ac_val, *ac_val2;
- int dcdiff;
-
- /* Get DC differential */
- if (n < 4) {
- dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_luma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3);
- } else {
- dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_chroma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3);
- }
- if (dcdiff < 0){
- av_log(s->avctx, AV_LOG_ERROR, "Illegal DC VLC\n");
- return -1;
- }
- if (dcdiff)
- {
- if (dcdiff == 119 /* ESC index value */)
- {
- /* TODO: Optimize */
- if (v->pq == 1) dcdiff = get_bits(gb, 10);
- else if (v->pq == 2) dcdiff = get_bits(gb, 9);
- else dcdiff = get_bits(gb, 8);
- }
- else
- {
- if (v->pq == 1)
- dcdiff = (dcdiff<<2) + get_bits(gb, 2) - 3;
- else if (v->pq == 2)
- dcdiff = (dcdiff<<1) + get_bits(gb, 1) - 1;
- }
- if (get_bits(gb, 1))
- dcdiff = -dcdiff;
- }
-
- /* Prediction */
- dcdiff += vc1_i_pred_dc(&v->s, v->overlap, v->pq, n, &dc_val, &dc_pred_dir);
- *dc_val = dcdiff;
-
- /* Store the quantized DC coeff, used for prediction */
- if (n < 4) {
- block[0] = dcdiff * s->y_dc_scale;
- } else {
- block[0] = dcdiff * s->c_dc_scale;
- }
- /* Skip ? */
- run_diff = 0;
- i = 0;
- if (!coded) {
- goto not_coded;
- }
-
- //AC Decoding
- i = 1;
-
- {
- int last = 0, skip, value;
- const int8_t *zz_table;
- int scale;
- int k;
-
- scale = v->pq * 2 + v->halfpq;
-
- if(v->s.ac_pred) {
- if(!dc_pred_dir)
- zz_table = vc1_horizontal_zz;
- else
- zz_table = vc1_vertical_zz;
- } else
- zz_table = vc1_normal_zz;
-
- ac_val = s->ac_val[0][0] + s->block_index[n] * 16;
- ac_val2 = ac_val;
- if(dc_pred_dir) //left
- ac_val -= 16;
- else //top
- ac_val -= 16 * s->block_wrap[n];
-
- while (!last) {
- vc1_decode_ac_coeff(v, &last, &skip, &value, codingset);
- i += skip;
- if(i > 63)
- break;
- block[zz_table[i++]] = value;
- }
-
- /* apply AC prediction if needed */
- if(s->ac_pred) {
- if(dc_pred_dir) { //left
- for(k = 1; k < 8; k++)
- block[k << 3] += ac_val[k];
- } else { //top
- for(k = 1; k < 8; k++)
- block[k] += ac_val[k + 8];
- }
- }
- /* save AC coeffs for further prediction */
- for(k = 1; k < 8; k++) {
- ac_val2[k] = block[k << 3];
- ac_val2[k + 8] = block[k];
- }
-
- /* scale AC coeffs */
- for(k = 1; k < 64; k++)
- if(block[k]) {
- block[k] *= scale;
- if(!v->pquantizer)
- block[k] += (block[k] < 0) ? -v->pq : v->pq;
- }
-
- if(s->ac_pred) i = 63;
- }
-
-not_coded:
- if(!coded) {
- int k, scale;
- ac_val = s->ac_val[0][0] + s->block_index[n] * 16;
- ac_val2 = ac_val;
-
- scale = v->pq * 2 + v->halfpq;
- memset(ac_val2, 0, 16 * 2);
- if(dc_pred_dir) {//left
- ac_val -= 16;
- if(s->ac_pred)
- memcpy(ac_val2, ac_val, 8 * 2);
- } else {//top
- ac_val -= 16 * s->block_wrap[n];
- if(s->ac_pred)
- memcpy(ac_val2 + 8, ac_val + 8, 8 * 2);
- }
-
- /* apply AC prediction if needed */
- if(s->ac_pred) {
- if(dc_pred_dir) { //left
- for(k = 1; k < 8; k++) {
- block[k << 3] = ac_val[k] * scale;
- if(!v->pquantizer && block[k << 3])
- block[k << 3] += (block[k << 3] < 0) ? -v->pq : v->pq;
- }
- } else { //top
- for(k = 1; k < 8; k++) {
- block[k] = ac_val[k + 8] * scale;
- if(!v->pquantizer && block[k])
- block[k] += (block[k] < 0) ? -v->pq : v->pq;
- }
- }
- i = 63;
- }
- }
- s->block_last_index[n] = i;
-
- return 0;
-}
-
-/** Decode intra block in intra frames - should be faster than decode_intra_block
- * @param v VC1Context
- * @param block block to decode
- * @param coded are AC coeffs present or not
- * @param codingset set of VLC to decode data
- */
-static int vc1_decode_i_block_adv(VC1Context *v, DCTELEM block[64], int n, int coded, int codingset, int mquant)
-{
- GetBitContext *gb = &v->s.gb;
- MpegEncContext *s = &v->s;
- int dc_pred_dir = 0; /* Direction of the DC prediction used */
- int run_diff, i;
- int16_t *dc_val;
- int16_t *ac_val, *ac_val2;
- int dcdiff;
- int a_avail = v->a_avail, c_avail = v->c_avail;
- int use_pred = s->ac_pred;
- int scale;
- int q1, q2 = 0;
- int mb_pos = s->mb_x + s->mb_y * s->mb_stride;
-
- /* Get DC differential */
- if (n < 4) {
- dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_luma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3);
- } else {
- dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_chroma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3);
- }
- if (dcdiff < 0){
- av_log(s->avctx, AV_LOG_ERROR, "Illegal DC VLC\n");
- return -1;
- }
- if (dcdiff)
- {
- if (dcdiff == 119 /* ESC index value */)
- {
- /* TODO: Optimize */
- if (mquant == 1) dcdiff = get_bits(gb, 10);
- else if (mquant == 2) dcdiff = get_bits(gb, 9);
- else dcdiff = get_bits(gb, 8);
- }
- else
- {
- if (mquant == 1)
- dcdiff = (dcdiff<<2) + get_bits(gb, 2) - 3;
- else if (mquant == 2)
- dcdiff = (dcdiff<<1) + get_bits(gb, 1) - 1;
- }
- if (get_bits(gb, 1))
- dcdiff = -dcdiff;
- }
-
- /* Prediction */
- dcdiff += vc1_pred_dc(&v->s, v->overlap, mquant, n, v->a_avail, v->c_avail, &dc_val, &dc_pred_dir);
- *dc_val = dcdiff;
-
- /* Store the quantized DC coeff, used for prediction */
- if (n < 4) {
- block[0] = dcdiff * s->y_dc_scale;
- } else {
- block[0] = dcdiff * s->c_dc_scale;
- }
- /* Skip ? */
- run_diff = 0;
- i = 0;
-
- //AC Decoding
- i = 1;
-
- /* check if AC is needed at all and adjust direction if needed */
- if(!a_avail) dc_pred_dir = 1;
- if(!c_avail) dc_pred_dir = 0;
- if(!a_avail && !c_avail) use_pred = 0;
- ac_val = s->ac_val[0][0] + s->block_index[n] * 16;
- ac_val2 = ac_val;
-
- scale = mquant * 2 + v->halfpq;
-
- if(dc_pred_dir) //left
- ac_val -= 16;
- else //top
- ac_val -= 16 * s->block_wrap[n];
-
- q1 = s->current_picture.qscale_table[mb_pos];
- if(dc_pred_dir && c_avail) q2 = s->current_picture.qscale_table[mb_pos - 1];
- if(!dc_pred_dir && a_avail) q2 = s->current_picture.qscale_table[mb_pos - s->mb_stride];
- if(n && n<4) q2 = q1;
-
- if(coded) {
- int last = 0, skip, value;
- const int8_t *zz_table;
- int k;
-
- if(v->s.ac_pred) {
- if(!dc_pred_dir)
- zz_table = vc1_horizontal_zz;
- else
- zz_table = vc1_vertical_zz;
- } else
- zz_table = vc1_normal_zz;
-
- while (!last) {
- vc1_decode_ac_coeff(v, &last, &skip, &value, codingset);
- i += skip;
- if(i > 63)
- break;
- block[zz_table[i++]] = value;
- }
-
- /* apply AC prediction if needed */
- if(use_pred) {
- /* scale predictors if needed*/
- if(q2 && q1!=q2) {
- q1 = q1 * 2 + ((q1 == v->pq) ? v->halfpq : 0) - 1;
- q2 = q2 * 2 + ((q2 == v->pq) ? v->halfpq : 0) - 1;
-
- if(dc_pred_dir) { //left
- for(k = 1; k < 8; k++)
- block[k << 3] += (ac_val[k] * q2 * vc1_dqscale[q1 - 1] + 0x20000) >> 18;
- } else { //top
- for(k = 1; k < 8; k++)
- block[k] += (ac_val[k + 8] * q2 * vc1_dqscale[q1 - 1] + 0x20000) >> 18;
- }
- } else {
- if(dc_pred_dir) { //left
- for(k = 1; k < 8; k++)
- block[k << 3] += ac_val[k];
- } else { //top
- for(k = 1; k < 8; k++)
- block[k] += ac_val[k + 8];
- }
- }
- }
- /* save AC coeffs for further prediction */
- for(k = 1; k < 8; k++) {
- ac_val2[k] = block[k << 3];
- ac_val2[k + 8] = block[k];
- }
-
- /* scale AC coeffs */
- for(k = 1; k < 64; k++)
- if(block[k]) {
- block[k] *= scale;
- if(!v->pquantizer)
- block[k] += (block[k] < 0) ? -mquant : mquant;
- }
-
- if(use_pred) i = 63;
- } else { // no AC coeffs
- int k;
-
- memset(ac_val2, 0, 16 * 2);
- if(dc_pred_dir) {//left
- if(use_pred) {
- memcpy(ac_val2, ac_val, 8 * 2);
- if(q2 && q1!=q2) {
- q1 = q1 * 2 + ((q1 == v->pq) ? v->halfpq : 0) - 1;
- q2 = q2 * 2 + ((q2 == v->pq) ? v->halfpq : 0) - 1;
- for(k = 1; k < 8; k++)
- ac_val2[k] = (ac_val2[k] * q2 * vc1_dqscale[q1 - 1] + 0x20000) >> 18;
- }
- }
- } else {//top
- if(use_pred) {
- memcpy(ac_val2 + 8, ac_val + 8, 8 * 2);
- if(q2 && q1!=q2) {
- q1 = q1 * 2 + ((q1 == v->pq) ? v->halfpq : 0) - 1;
- q2 = q2 * 2 + ((q2 == v->pq) ? v->halfpq : 0) - 1;
- for(k = 1; k < 8; k++)
- ac_val2[k + 8] = (ac_val2[k + 8] * q2 * vc1_dqscale[q1 - 1] + 0x20000) >> 18;
- }
- }
- }
-
- /* apply AC prediction if needed */
- if(use_pred) {
- if(dc_pred_dir) { //left
- for(k = 1; k < 8; k++) {
- block[k << 3] = ac_val2[k] * scale;
- if(!v->pquantizer && block[k << 3])
- block[k << 3] += (block[k << 3] < 0) ? -mquant : mquant;
- }
- } else { //top
- for(k = 1; k < 8; k++) {
- block[k] = ac_val2[k + 8] * scale;
- if(!v->pquantizer && block[k])
- block[k] += (block[k] < 0) ? -mquant : mquant;
- }
- }
- i = 63;
- }
- }
- s->block_last_index[n] = i;
-
- return 0;
-}
-
-/** Decode intra block in inter frames - more generic version than vc1_decode_i_block
- * @param v VC1Context
- * @param block block to decode
- * @param coded are AC coeffs present or not
- * @param mquant block quantizer
- * @param codingset set of VLC to decode data
- */
-static int vc1_decode_intra_block(VC1Context *v, DCTELEM block[64], int n, int coded, int mquant, int codingset)
-{
- GetBitContext *gb = &v->s.gb;
- MpegEncContext *s = &v->s;
- int dc_pred_dir = 0; /* Direction of the DC prediction used */
- int run_diff, i;
- int16_t *dc_val;
- int16_t *ac_val, *ac_val2;
- int dcdiff;
- int mb_pos = s->mb_x + s->mb_y * s->mb_stride;
- int a_avail = v->a_avail, c_avail = v->c_avail;
- int use_pred = s->ac_pred;
- int scale;
- int q1, q2 = 0;
-
- /* XXX: Guard against dumb values of mquant */
- mquant = (mquant < 1) ? 0 : ( (mquant>31) ? 31 : mquant );
-
- /* Set DC scale - y and c use the same */
- s->y_dc_scale = s->y_dc_scale_table[mquant];
- s->c_dc_scale = s->c_dc_scale_table[mquant];
-
- /* Get DC differential */
- if (n < 4) {
- dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_luma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3);
- } else {
- dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_chroma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3);
- }
- if (dcdiff < 0){
- av_log(s->avctx, AV_LOG_ERROR, "Illegal DC VLC\n");
- return -1;
- }
- if (dcdiff)
- {
- if (dcdiff == 119 /* ESC index value */)
- {
- /* TODO: Optimize */
- if (mquant == 1) dcdiff = get_bits(gb, 10);
- else if (mquant == 2) dcdiff = get_bits(gb, 9);
- else dcdiff = get_bits(gb, 8);
- }
- else
- {
- if (mquant == 1)
- dcdiff = (dcdiff<<2) + get_bits(gb, 2) - 3;
- else if (mquant == 2)
- dcdiff = (dcdiff<<1) + get_bits(gb, 1) - 1;
- }
- if (get_bits(gb, 1))
- dcdiff = -dcdiff;
- }
-
- /* Prediction */
- dcdiff += vc1_pred_dc(&v->s, v->overlap, mquant, n, a_avail, c_avail, &dc_val, &dc_pred_dir);
- *dc_val = dcdiff;
-
- /* Store the quantized DC coeff, used for prediction */
-
- if (n < 4) {
- block[0] = dcdiff * s->y_dc_scale;
- } else {
- block[0] = dcdiff * s->c_dc_scale;
- }
- /* Skip ? */
- run_diff = 0;
- i = 0;
-
- //AC Decoding
- i = 1;
-
- /* check if AC is needed at all and adjust direction if needed */
- if(!a_avail) dc_pred_dir = 1;
- if(!c_avail) dc_pred_dir = 0;
- if(!a_avail && !c_avail) use_pred = 0;
- ac_val = s->ac_val[0][0] + s->block_index[n] * 16;
- ac_val2 = ac_val;
-
- scale = mquant * 2 + v->halfpq;
-
- if(dc_pred_dir) //left
- ac_val -= 16;
- else //top
- ac_val -= 16 * s->block_wrap[n];
-
- q1 = s->current_picture.qscale_table[mb_pos];
- if(dc_pred_dir && c_avail && mb_pos) q2 = s->current_picture.qscale_table[mb_pos - 1];
- if(!dc_pred_dir && a_avail && mb_pos >= s->mb_stride) q2 = s->current_picture.qscale_table[mb_pos - s->mb_stride];
- if(n && n<4) q2 = q1;
-
- if(coded) {
- int last = 0, skip, value;
- const int8_t *zz_table;
- int k;
-
- zz_table = vc1_simple_progressive_8x8_zz;
-
- while (!last) {
- vc1_decode_ac_coeff(v, &last, &skip, &value, codingset);
- i += skip;
- if(i > 63)
- break;
- block[zz_table[i++]] = value;
- }
-
- /* apply AC prediction if needed */
- if(use_pred) {
- /* scale predictors if needed*/
- if(q2 && q1!=q2) {
- q1 = q1 * 2 + ((q1 == v->pq) ? v->halfpq : 0) - 1;
- q2 = q2 * 2 + ((q2 == v->pq) ? v->halfpq : 0) - 1;
-
- if(dc_pred_dir) { //left
- for(k = 1; k < 8; k++)
- block[k << 3] += (ac_val[k] * q2 * vc1_dqscale[q1 - 1] + 0x20000) >> 18;
- } else { //top
- for(k = 1; k < 8; k++)
- block[k] += (ac_val[k + 8] * q2 * vc1_dqscale[q1 - 1] + 0x20000) >> 18;
- }
- } else {
- if(dc_pred_dir) { //left
- for(k = 1; k < 8; k++)
- block[k << 3] += ac_val[k];
- } else { //top
- for(k = 1; k < 8; k++)
- block[k] += ac_val[k + 8];
- }
- }
- }
- /* save AC coeffs for further prediction */
- for(k = 1; k < 8; k++) {
- ac_val2[k] = block[k << 3];
- ac_val2[k + 8] = block[k];
- }
-
- /* scale AC coeffs */
- for(k = 1; k < 64; k++)
- if(block[k]) {
- block[k] *= scale;
- if(!v->pquantizer)
- block[k] += (block[k] < 0) ? -mquant : mquant;
- }
-
- if(use_pred) i = 63;
- } else { // no AC coeffs
- int k;
-
- memset(ac_val2, 0, 16 * 2);
- if(dc_pred_dir) {//left
- if(use_pred) {
- memcpy(ac_val2, ac_val, 8 * 2);
- if(q2 && q1!=q2) {
- q1 = q1 * 2 + ((q1 == v->pq) ? v->halfpq : 0) - 1;
- q2 = q2 * 2 + ((q2 == v->pq) ? v->halfpq : 0) - 1;
- for(k = 1; k < 8; k++)
- ac_val2[k] = (ac_val2[k] * q2 * vc1_dqscale[q1 - 1] + 0x20000) >> 18;
- }
- }
- } else {//top
- if(use_pred) {
- memcpy(ac_val2 + 8, ac_val + 8, 8 * 2);
- if(q2 && q1!=q2) {
- q1 = q1 * 2 + ((q1 == v->pq) ? v->halfpq : 0) - 1;
- q2 = q2 * 2 + ((q2 == v->pq) ? v->halfpq : 0) - 1;
- for(k = 1; k < 8; k++)
- ac_val2[k + 8] = (ac_val2[k + 8] * q2 * vc1_dqscale[q1 - 1] + 0x20000) >> 18;
- }
- }
- }
-
- /* apply AC prediction if needed */
- if(use_pred) {
- if(dc_pred_dir) { //left
- for(k = 1; k < 8; k++) {
- block[k << 3] = ac_val2[k] * scale;
- if(!v->pquantizer && block[k << 3])
- block[k << 3] += (block[k << 3] < 0) ? -mquant : mquant;
- }
- } else { //top
- for(k = 1; k < 8; k++) {
- block[k] = ac_val2[k + 8] * scale;
- if(!v->pquantizer && block[k])
- block[k] += (block[k] < 0) ? -mquant : mquant;
- }
- }
- i = 63;
- }
- }
- s->block_last_index[n] = i;
-
- return 0;
-}
-
-/** Decode P block
- */
-static int vc1_decode_p_block(VC1Context *v, DCTELEM block[64], int n, int mquant, int ttmb, int first_block)
-{
- MpegEncContext *s = &v->s;
- GetBitContext *gb = &s->gb;
- int i, j;
- int subblkpat = 0;
- int scale, off, idx, last, skip, value;
- int ttblk = ttmb & 7;
-
- if(ttmb == -1) {
- ttblk = ttblk_to_tt[v->tt_index][get_vlc2(gb, vc1_ttblk_vlc[v->tt_index].table, VC1_TTBLK_VLC_BITS, 1)];
- }
- if(ttblk == TT_4X4) {
- subblkpat = ~(get_vlc2(gb, vc1_subblkpat_vlc[v->tt_index].table, VC1_SUBBLKPAT_VLC_BITS, 1) + 1);
- }
- if((ttblk != TT_8X8 && ttblk != TT_4X4) && (v->ttmbf || (ttmb != -1 && (ttmb & 8) && !first_block))) {
- subblkpat = decode012(gb);
- if(subblkpat) subblkpat ^= 3; //swap decoded pattern bits
- if(ttblk == TT_8X4_TOP || ttblk == TT_8X4_BOTTOM) ttblk = TT_8X4;
- if(ttblk == TT_4X8_RIGHT || ttblk == TT_4X8_LEFT) ttblk = TT_4X8;
- }
- scale = 2 * mquant + v->halfpq;
-
- // convert transforms like 8X4_TOP to generic TT and SUBBLKPAT
- if(ttblk == TT_8X4_TOP || ttblk == TT_8X4_BOTTOM) {
- subblkpat = 2 - (ttblk == TT_8X4_TOP);
- ttblk = TT_8X4;
- }
- if(ttblk == TT_4X8_RIGHT || ttblk == TT_4X8_LEFT) {
- subblkpat = 2 - (ttblk == TT_4X8_LEFT);
- ttblk = TT_4X8;
- }
- switch(ttblk) {
- case TT_8X8:
- i = 0;
- last = 0;
- while (!last) {
- vc1_decode_ac_coeff(v, &last, &skip, &value, v->codingset2);
- i += skip;
- if(i > 63)
- break;
- idx = vc1_simple_progressive_8x8_zz[i++];
- block[idx] = value * scale;
- if(!v->pquantizer)
- block[idx] += (block[idx] < 0) ? -mquant : mquant;
- }
- s->dsp.vc1_inv_trans_8x8(block);
- break;
- case TT_4X4:
- for(j = 0; j < 4; j++) {
- last = subblkpat & (1 << (3 - j));
- i = 0;
- off = (j & 1) * 4 + (j & 2) * 16;
- while (!last) {
- vc1_decode_ac_coeff(v, &last, &skip, &value, v->codingset2);
- i += skip;
- if(i > 15)
- break;
- idx = vc1_simple_progressive_4x4_zz[i++];
- block[idx + off] = value * scale;
- if(!v->pquantizer)
- block[idx + off] += (block[idx + off] < 0) ? -mquant : mquant;
- }
- if(!(subblkpat & (1 << (3 - j))))
- s->dsp.vc1_inv_trans_4x4(block, j);
- }
- break;
- case TT_8X4:
- for(j = 0; j < 2; j++) {
- last = subblkpat & (1 << (1 - j));
- i = 0;
- off = j * 32;
- while (!last) {
- vc1_decode_ac_coeff(v, &last, &skip, &value, v->codingset2);
- i += skip;
- if(i > 31)
- break;
- if(v->profile < PROFILE_ADVANCED)
- idx = vc1_simple_progressive_8x4_zz[i++];
- else
- idx = vc1_adv_progressive_8x4_zz[i++];
- block[idx + off] = value * scale;
- if(!v->pquantizer)
- block[idx + off] += (block[idx + off] < 0) ? -mquant : mquant;
- }
- if(!(subblkpat & (1 << (1 - j))))
- s->dsp.vc1_inv_trans_8x4(block, j);
- }
- break;
- case TT_4X8:
- for(j = 0; j < 2; j++) {
- last = subblkpat & (1 << (1 - j));
- i = 0;
- off = j * 4;
- while (!last) {
- vc1_decode_ac_coeff(v, &last, &skip, &value, v->codingset2);
- i += skip;
- if(i > 31)
- break;
- if(v->profile < PROFILE_ADVANCED)
- idx = vc1_simple_progressive_4x8_zz[i++];
- else
- idx = vc1_adv_progressive_4x8_zz[i++];
- block[idx + off] = value * scale;
- if(!v->pquantizer)
- block[idx + off] += (block[idx + off] < 0) ? -mquant : mquant;
- }
- if(!(subblkpat & (1 << (1 - j))))
- s->dsp.vc1_inv_trans_4x8(block, j);
- }
- break;
- }
- return 0;
-}
-
-
-/** Decode one P-frame MB (in Simple/Main profile)
- */
-static int vc1_decode_p_mb(VC1Context *v)
-{
- MpegEncContext *s = &v->s;
- GetBitContext *gb = &s->gb;
- int i, j;
- int mb_pos = s->mb_x + s->mb_y * s->mb_stride;
- int cbp; /* cbp decoding stuff */
- int mqdiff, mquant; /* MB quantization */
- int ttmb = v->ttfrm; /* MB Transform type */
- int status;
-
- static const int size_table[6] = { 0, 2, 3, 4, 5, 8 },
- offset_table[6] = { 0, 1, 3, 7, 15, 31 };
- int mb_has_coeffs = 1; /* last_flag */
- int dmv_x, dmv_y; /* Differential MV components */
- int index, index1; /* LUT indices */
- int val, sign; /* temp values */
- int first_block = 1;
- int dst_idx, off;
- int skipped, fourmv;
-
- mquant = v->pq; /* Loosy initialization */
-
- if (v->mv_type_is_raw)
- fourmv = get_bits1(gb);
- else
- fourmv = v->mv_type_mb_plane[mb_pos];
- if (v->skip_is_raw)
- skipped = get_bits1(gb);
- else
- skipped = v->s.mbskip_table[mb_pos];
-
- s->dsp.clear_blocks(s->block[0]);
-
- if (!fourmv) /* 1MV mode */
- {
- if (!skipped)
- {
- GET_MVDATA(dmv_x, dmv_y);
-
- if (s->mb_intra) {
- s->current_picture.motion_val[1][s->block_index[0]][0] = 0;
- s->current_picture.motion_val[1][s->block_index[0]][1] = 0;
- }
- s->current_picture.mb_type[mb_pos] = s->mb_intra ? MB_TYPE_INTRA : MB_TYPE_16x16;
- vc1_pred_mv(s, 0, dmv_x, dmv_y, 1, v->range_x, v->range_y, v->mb_type[0]);
-
- /* FIXME Set DC val for inter block ? */
- if (s->mb_intra && !mb_has_coeffs)
- {
- GET_MQUANT();
- s->ac_pred = get_bits(gb, 1);
- cbp = 0;
- }
- else if (mb_has_coeffs)
- {
- if (s->mb_intra) s->ac_pred = get_bits(gb, 1);
- cbp = get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2);
- GET_MQUANT();
- }
- else
- {
- mquant = v->pq;
- cbp = 0;
- }
- s->current_picture.qscale_table[mb_pos] = mquant;
-
- if (!v->ttmbf && !s->mb_intra && mb_has_coeffs)
- ttmb = get_vlc2(gb, vc1_ttmb_vlc[v->tt_index].table,
- VC1_TTMB_VLC_BITS, 2);
- if(!s->mb_intra) vc1_mc_1mv(v, 0);
- dst_idx = 0;
- for (i=0; i<6; i++)
- {
- s->dc_val[0][s->block_index[i]] = 0;
- dst_idx += i >> 2;
- val = ((cbp >> (5 - i)) & 1);
- off = (i & 4) ? 0 : ((i & 1) * 8 + (i & 2) * 4 * s->linesize);
- v->mb_type[0][s->block_index[i]] = s->mb_intra;
- if(s->mb_intra) {
- /* check if prediction blocks A and C are available */
- v->a_avail = v->c_avail = 0;
- if(i == 2 || i == 3 || !s->first_slice_line)
- v->a_avail = v->mb_type[0][s->block_index[i] - s->block_wrap[i]];
- if(i == 1 || i == 3 || s->mb_x)
- v->c_avail = v->mb_type[0][s->block_index[i] - 1];
-
- vc1_decode_intra_block(v, s->block[i], i, val, mquant, (i&4)?v->codingset2:v->codingset);
- if((i>3) && (s->flags & CODEC_FLAG_GRAY)) continue;
- s->dsp.vc1_inv_trans_8x8(s->block[i]);
- if(v->rangeredfrm) for(j = 0; j < 64; j++) s->block[i][j] <<= 1;
- for(j = 0; j < 64; j++) s->block[i][j] += 128;
- s->dsp.put_pixels_clamped(s->block[i], s->dest[dst_idx] + off, s->linesize >> ((i & 4) >> 2));
- if(v->pq >= 9 && v->overlap) {
- if(v->c_avail)
- s->dsp.vc1_h_overlap(s->dest[dst_idx] + off, s->linesize >> ((i & 4) >> 2));
- if(v->a_avail)
- s->dsp.vc1_v_overlap(s->dest[dst_idx] + off, s->linesize >> ((i & 4) >> 2));
- }
- } else if(val) {
- vc1_decode_p_block(v, s->block[i], i, mquant, ttmb, first_block);
- if(!v->ttmbf && ttmb < 8) ttmb = -1;
- first_block = 0;
- if((i<4) || !(s->flags & CODEC_FLAG_GRAY))
- s->dsp.add_pixels_clamped(s->block[i], s->dest[dst_idx] + off, (i&4)?s->uvlinesize:s->linesize);
- }
- }
- }
- else //Skipped
- {
- s->mb_intra = 0;
- for(i = 0; i < 6; i++) {
- v->mb_type[0][s->block_index[i]] = 0;
- s->dc_val[0][s->block_index[i]] = 0;
- }
- s->current_picture.mb_type[mb_pos] = MB_TYPE_SKIP;
- s->current_picture.qscale_table[mb_pos] = 0;
- vc1_pred_mv(s, 0, 0, 0, 1, v->range_x, v->range_y, v->mb_type[0]);
- vc1_mc_1mv(v, 0);
- return 0;
- }
- } //1MV mode
- else //4MV mode
- {
- if (!skipped /* unskipped MB */)
- {
- int intra_count = 0, coded_inter = 0;
- int is_intra[6], is_coded[6];
- /* Get CBPCY */
- cbp = get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2);
- for (i=0; i<6; i++)
- {
- val = ((cbp >> (5 - i)) & 1);
- s->dc_val[0][s->block_index[i]] = 0;
- s->mb_intra = 0;
- if(i < 4) {
- dmv_x = dmv_y = 0;
- s->mb_intra = 0;
- mb_has_coeffs = 0;
- if(val) {
- GET_MVDATA(dmv_x, dmv_y);
- }
- vc1_pred_mv(s, i, dmv_x, dmv_y, 0, v->range_x, v->range_y, v->mb_type[0]);
- if(!s->mb_intra) vc1_mc_4mv_luma(v, i);
- intra_count += s->mb_intra;
- is_intra[i] = s->mb_intra;
- is_coded[i] = mb_has_coeffs;
- }
- if(i&4){
- is_intra[i] = (intra_count >= 3);
- is_coded[i] = val;
- }
- if(i == 4) vc1_mc_4mv_chroma(v);
- v->mb_type[0][s->block_index[i]] = is_intra[i];
- if(!coded_inter) coded_inter = !is_intra[i] & is_coded[i];
- }
- // if there are no coded blocks then don't do anything more
- if(!intra_count && !coded_inter) return 0;
- dst_idx = 0;
- GET_MQUANT();
- s->current_picture.qscale_table[mb_pos] = mquant;
- /* test if block is intra and has pred */
- {
- int intrapred = 0;
- for(i=0; i<6; i++)
- if(is_intra[i]) {
- if(((!s->first_slice_line || (i==2 || i==3)) && v->mb_type[0][s->block_index[i] - s->block_wrap[i]])
- || ((s->mb_x || (i==1 || i==3)) && v->mb_type[0][s->block_index[i] - 1])) {
- intrapred = 1;
- break;
- }
- }
- if(intrapred)s->ac_pred = get_bits(gb, 1);
- else s->ac_pred = 0;
- }
- if (!v->ttmbf && coded_inter)
- ttmb = get_vlc2(gb, vc1_ttmb_vlc[v->tt_index].table, VC1_TTMB_VLC_BITS, 2);
- for (i=0; i<6; i++)
- {
- dst_idx += i >> 2;
- off = (i & 4) ? 0 : ((i & 1) * 8 + (i & 2) * 4 * s->linesize);
- s->mb_intra = is_intra[i];
- if (is_intra[i]) {
- /* check if prediction blocks A and C are available */
- v->a_avail = v->c_avail = 0;
- if(i == 2 || i == 3 || !s->first_slice_line)
- v->a_avail = v->mb_type[0][s->block_index[i] - s->block_wrap[i]];
- if(i == 1 || i == 3 || s->mb_x)
- v->c_avail = v->mb_type[0][s->block_index[i] - 1];
-
- vc1_decode_intra_block(v, s->block[i], i, is_coded[i], mquant, (i&4)?v->codingset2:v->codingset);
- if((i>3) && (s->flags & CODEC_FLAG_GRAY)) continue;
- s->dsp.vc1_inv_trans_8x8(s->block[i]);
- if(v->rangeredfrm) for(j = 0; j < 64; j++) s->block[i][j] <<= 1;
- for(j = 0; j < 64; j++) s->block[i][j] += 128;
- s->dsp.put_pixels_clamped(s->block[i], s->dest[dst_idx] + off, (i&4)?s->uvlinesize:s->linesize);
- if(v->pq >= 9 && v->overlap) {
- if(v->c_avail)
- s->dsp.vc1_h_overlap(s->dest[dst_idx] + off, s->linesize >> ((i & 4) >> 2));
- if(v->a_avail)
- s->dsp.vc1_v_overlap(s->dest[dst_idx] + off, s->linesize >> ((i & 4) >> 2));
- }
- } else if(is_coded[i]) {
- status = vc1_decode_p_block(v, s->block[i], i, mquant, ttmb, first_block);
- if(!v->ttmbf && ttmb < 8) ttmb = -1;
- first_block = 0;
- if((i<4) || !(s->flags & CODEC_FLAG_GRAY))
- s->dsp.add_pixels_clamped(s->block[i], s->dest[dst_idx] + off, (i&4)?s->uvlinesize:s->linesize);
- }
- }
- return status;
- }
- else //Skipped MB
- {
- s->mb_intra = 0;
- s->current_picture.qscale_table[mb_pos] = 0;
- for (i=0; i<6; i++) {
- v->mb_type[0][s->block_index[i]] = 0;
- s->dc_val[0][s->block_index[i]] = 0;
- }
- for (i=0; i<4; i++)
- {
- vc1_pred_mv(s, i, 0, 0, 0, v->range_x, v->range_y, v->mb_type[0]);
- vc1_mc_4mv_luma(v, i);
- }
- vc1_mc_4mv_chroma(v);
- s->current_picture.qscale_table[mb_pos] = 0;
- return 0;
- }
- }
-
- /* Should never happen */
- return -1;
-}
-
-/** Decode one B-frame MB (in Main profile)
- */
-static void vc1_decode_b_mb(VC1Context *v)
-{
- MpegEncContext *s = &v->s;
- GetBitContext *gb = &s->gb;
- int i, j;
- int mb_pos = s->mb_x + s->mb_y * s->mb_stride;
- int cbp = 0; /* cbp decoding stuff */
- int mqdiff, mquant; /* MB quantization */
- int ttmb = v->ttfrm; /* MB Transform type */
-
- static const int size_table[6] = { 0, 2, 3, 4, 5, 8 },
- offset_table[6] = { 0, 1, 3, 7, 15, 31 };
- int mb_has_coeffs = 0; /* last_flag */
- int index, index1; /* LUT indices */
- int val, sign; /* temp values */
- int first_block = 1;
- int dst_idx, off;
- int skipped, direct;
- int dmv_x[2], dmv_y[2];
- int bmvtype = BMV_TYPE_BACKWARD;
-
- mquant = v->pq; /* Loosy initialization */
- s->mb_intra = 0;
-
- if (v->dmb_is_raw)
- direct = get_bits1(gb);
- else
- direct = v->direct_mb_plane[mb_pos];
- if (v->skip_is_raw)
- skipped = get_bits1(gb);
- else
- skipped = v->s.mbskip_table[mb_pos];
-
- s->dsp.clear_blocks(s->block[0]);
- dmv_x[0] = dmv_x[1] = dmv_y[0] = dmv_y[1] = 0;
- for(i = 0; i < 6; i++) {
- v->mb_type[0][s->block_index[i]] = 0;
- s->dc_val[0][s->block_index[i]] = 0;
- }
- s->current_picture.qscale_table[mb_pos] = 0;
-
- if (!direct) {
- if (!skipped) {
- GET_MVDATA(dmv_x[0], dmv_y[0]);
- dmv_x[1] = dmv_x[0];
- dmv_y[1] = dmv_y[0];
- }
- if(skipped || !s->mb_intra) {
- bmvtype = decode012(gb);
- switch(bmvtype) {
- case 0:
- bmvtype = (v->bfraction >= (B_FRACTION_DEN/2)) ? BMV_TYPE_BACKWARD : BMV_TYPE_FORWARD;
- break;
- case 1:
- bmvtype = (v->bfraction >= (B_FRACTION_DEN/2)) ? BMV_TYPE_FORWARD : BMV_TYPE_BACKWARD;
- break;
- case 2:
- bmvtype = BMV_TYPE_INTERPOLATED;
- dmv_x[0] = dmv_y[0] = 0;
- }
- }
- }
- for(i = 0; i < 6; i++)
- v->mb_type[0][s->block_index[i]] = s->mb_intra;
-
- if (skipped) {
- if(direct) bmvtype = BMV_TYPE_INTERPOLATED;
- vc1_pred_b_mv(v, dmv_x, dmv_y, direct, bmvtype);
- vc1_b_mc(v, dmv_x, dmv_y, direct, bmvtype);
- return;
- }
- if (direct) {
- cbp = get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2);
- GET_MQUANT();
- s->mb_intra = 0;
- mb_has_coeffs = 0;
- s->current_picture.qscale_table[mb_pos] = mquant;
- if(!v->ttmbf)
- ttmb = get_vlc2(gb, vc1_ttmb_vlc[v->tt_index].table, VC1_TTMB_VLC_BITS, 2);
- dmv_x[0] = dmv_y[0] = dmv_x[1] = dmv_y[1] = 0;
- vc1_pred_b_mv(v, dmv_x, dmv_y, direct, bmvtype);
- vc1_b_mc(v, dmv_x, dmv_y, direct, bmvtype);
- } else {
- if(!mb_has_coeffs && !s->mb_intra) {
- /* no coded blocks - effectively skipped */
- vc1_pred_b_mv(v, dmv_x, dmv_y, direct, bmvtype);
- vc1_b_mc(v, dmv_x, dmv_y, direct, bmvtype);
- return;
- }
- if(s->mb_intra && !mb_has_coeffs) {
- GET_MQUANT();
- s->current_picture.qscale_table[mb_pos] = mquant;
- s->ac_pred = get_bits1(gb);
- cbp = 0;
- vc1_pred_b_mv(v, dmv_x, dmv_y, direct, bmvtype);
- } else {
- if(bmvtype == BMV_TYPE_INTERPOLATED) {
- GET_MVDATA(dmv_x[0], dmv_y[0]);
- if(!mb_has_coeffs) {
- /* interpolated skipped block */
- vc1_pred_b_mv(v, dmv_x, dmv_y, direct, bmvtype);
- vc1_b_mc(v, dmv_x, dmv_y, direct, bmvtype);
- return;
- }
- }
- vc1_pred_b_mv(v, dmv_x, dmv_y, direct, bmvtype);
- if(!s->mb_intra) {
- vc1_b_mc(v, dmv_x, dmv_y, direct, bmvtype);
- }
- if(s->mb_intra)
- s->ac_pred = get_bits1(gb);
- cbp = get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2);
- GET_MQUANT();
- s->current_picture.qscale_table[mb_pos] = mquant;
- if(!v->ttmbf && !s->mb_intra && mb_has_coeffs)
- ttmb = get_vlc2(gb, vc1_ttmb_vlc[v->tt_index].table, VC1_TTMB_VLC_BITS, 2);
- }
- }
- dst_idx = 0;
- for (i=0; i<6; i++)
- {
- s->dc_val[0][s->block_index[i]] = 0;
- dst_idx += i >> 2;
- val = ((cbp >> (5 - i)) & 1);
- off = (i & 4) ? 0 : ((i & 1) * 8 + (i & 2) * 4 * s->linesize);
- v->mb_type[0][s->block_index[i]] = s->mb_intra;
- if(s->mb_intra) {
- /* check if prediction blocks A and C are available */
- v->a_avail = v->c_avail = 0;
- if(i == 2 || i == 3 || !s->first_slice_line)
- v->a_avail = v->mb_type[0][s->block_index[i] - s->block_wrap[i]];
- if(i == 1 || i == 3 || s->mb_x)
- v->c_avail = v->mb_type[0][s->block_index[i] - 1];
-
- vc1_decode_intra_block(v, s->block[i], i, val, mquant, (i&4)?v->codingset2:v->codingset);
- if((i>3) && (s->flags & CODEC_FLAG_GRAY)) continue;
- s->dsp.vc1_inv_trans_8x8(s->block[i]);
- if(v->rangeredfrm) for(j = 0; j < 64; j++) s->block[i][j] <<= 1;
- for(j = 0; j < 64; j++) s->block[i][j] += 128;
- s->dsp.put_pixels_clamped(s->block[i], s->dest[dst_idx] + off, s->linesize >> ((i & 4) >> 2));
- } else if(val) {
- vc1_decode_p_block(v, s->block[i], i, mquant, ttmb, first_block);
- if(!v->ttmbf && ttmb < 8) ttmb = -1;
- first_block = 0;
- if((i<4) || !(s->flags & CODEC_FLAG_GRAY))
- s->dsp.add_pixels_clamped(s->block[i], s->dest[dst_idx] + off, (i&4)?s->uvlinesize:s->linesize);
- }
- }
-}
-
-/** Decode blocks of I-frame
- */
-static void vc1_decode_i_blocks(VC1Context *v)
-{
- int k, j;
- MpegEncContext *s = &v->s;
- int cbp, val;
- uint8_t *coded_val;
- int mb_pos;
-
- /* select codingmode used for VLC tables selection */
- switch(v->y_ac_table_index){
- case 0:
- v->codingset = (v->pqindex <= 8) ? CS_HIGH_RATE_INTRA : CS_LOW_MOT_INTRA;
- break;
- case 1:
- v->codingset = CS_HIGH_MOT_INTRA;
- break;
- case 2:
- v->codingset = CS_MID_RATE_INTRA;
- break;
- }
-
- switch(v->c_ac_table_index){
- case 0:
- v->codingset2 = (v->pqindex <= 8) ? CS_HIGH_RATE_INTER : CS_LOW_MOT_INTER;
- break;
- case 1:
- v->codingset2 = CS_HIGH_MOT_INTER;
- break;
- case 2:
- v->codingset2 = CS_MID_RATE_INTER;
- break;
- }
-
- /* Set DC scale - y and c use the same */
- s->y_dc_scale = s->y_dc_scale_table[v->pq];
- s->c_dc_scale = s->c_dc_scale_table[v->pq];
-
- //do frame decode
- s->mb_x = s->mb_y = 0;
- s->mb_intra = 1;
- s->first_slice_line = 1;
- ff_er_add_slice(s, 0, 0, s->mb_width - 1, s->mb_height - 1, (AC_END|DC_END|MV_END));
- for(s->mb_y = 0; s->mb_y < s->mb_height; s->mb_y++) {
- for(s->mb_x = 0; s->mb_x < s->mb_width; s->mb_x++) {
- ff_init_block_index(s);
- ff_update_block_index(s);
- s->dsp.clear_blocks(s->block[0]);
- mb_pos = s->mb_x + s->mb_y * s->mb_width;
- s->current_picture.mb_type[mb_pos] = MB_TYPE_INTRA;
- s->current_picture.qscale_table[mb_pos] = v->pq;
- s->current_picture.motion_val[1][s->block_index[0]][0] = 0;
- s->current_picture.motion_val[1][s->block_index[0]][1] = 0;
-
- // do actual MB decoding and displaying
- cbp = get_vlc2(&v->s.gb, ff_msmp4_mb_i_vlc.table, MB_INTRA_VLC_BITS, 2);
- v->s.ac_pred = get_bits(&v->s.gb, 1);
-
- for(k = 0; k < 6; k++) {
- val = ((cbp >> (5 - k)) & 1);
-
- if (k < 4) {
- int pred = vc1_coded_block_pred(&v->s, k, &coded_val);
- val = val ^ pred;
- *coded_val = val;
- }
- cbp |= val << (5 - k);
-
- vc1_decode_i_block(v, s->block[k], k, val, (k<4)? v->codingset : v->codingset2);
-
- s->dsp.vc1_inv_trans_8x8(s->block[k]);
- if(v->pq >= 9 && v->overlap) {
- for(j = 0; j < 64; j++) s->block[k][j] += 128;
- }
- }
-
- vc1_put_block(v, s->block);
- if(v->pq >= 9 && v->overlap) {
- if(s->mb_x) {
- s->dsp.vc1_h_overlap(s->dest[0], s->linesize);
- s->dsp.vc1_h_overlap(s->dest[0] + 8 * s->linesize, s->linesize);
- if(!(s->flags & CODEC_FLAG_GRAY)) {
- s->dsp.vc1_h_overlap(s->dest[1], s->uvlinesize);
- s->dsp.vc1_h_overlap(s->dest[2], s->uvlinesize);
- }
- }
- s->dsp.vc1_h_overlap(s->dest[0] + 8, s->linesize);
- s->dsp.vc1_h_overlap(s->dest[0] + 8 * s->linesize + 8, s->linesize);
- if(!s->first_slice_line) {
- s->dsp.vc1_v_overlap(s->dest[0], s->linesize);
- s->dsp.vc1_v_overlap(s->dest[0] + 8, s->linesize);
- if(!(s->flags & CODEC_FLAG_GRAY)) {
- s->dsp.vc1_v_overlap(s->dest[1], s->uvlinesize);
- s->dsp.vc1_v_overlap(s->dest[2], s->uvlinesize);
- }
- }
- s->dsp.vc1_v_overlap(s->dest[0] + 8 * s->linesize, s->linesize);
- s->dsp.vc1_v_overlap(s->dest[0] + 8 * s->linesize + 8, s->linesize);
- }
-
- if(get_bits_count(&s->gb) > v->bits) {
- av_log(s->avctx, AV_LOG_ERROR, "Bits overconsumption: %i > %i\n", get_bits_count(&s->gb), v->bits);
- return;
- }
- }
- ff_draw_horiz_band(s, s->mb_y * 16, 16);
- s->first_slice_line = 0;
- }
-}
-
-/** Decode blocks of I-frame for advanced profile
- */
-static void vc1_decode_i_blocks_adv(VC1Context *v)
-{
- int k, j;
- MpegEncContext *s = &v->s;
- int cbp, val;
- uint8_t *coded_val;
- int mb_pos;
- int mquant = v->pq;
- int mqdiff;
- int overlap;
- GetBitContext *gb = &s->gb;
-
- /* select codingmode used for VLC tables selection */
- switch(v->y_ac_table_index){
- case 0:
- v->codingset = (v->pqindex <= 8) ? CS_HIGH_RATE_INTRA : CS_LOW_MOT_INTRA;
- break;
- case 1:
- v->codingset = CS_HIGH_MOT_INTRA;
- break;
- case 2:
- v->codingset = CS_MID_RATE_INTRA;
- break;
- }
-
- switch(v->c_ac_table_index){
- case 0:
- v->codingset2 = (v->pqindex <= 8) ? CS_HIGH_RATE_INTER : CS_LOW_MOT_INTER;
- break;
- case 1:
- v->codingset2 = CS_HIGH_MOT_INTER;
- break;
- case 2:
- v->codingset2 = CS_MID_RATE_INTER;
- break;
- }
-
- //do frame decode
- s->mb_x = s->mb_y = 0;
- s->mb_intra = 1;
- s->first_slice_line = 1;
- ff_er_add_slice(s, 0, 0, s->mb_width - 1, s->mb_height - 1, (AC_END|DC_END|MV_END));
- for(s->mb_y = 0; s->mb_y < s->mb_height; s->mb_y++) {
- for(s->mb_x = 0; s->mb_x < s->mb_width; s->mb_x++) {
- ff_init_block_index(s);
- ff_update_block_index(s);
- s->dsp.clear_blocks(s->block[0]);
- mb_pos = s->mb_x + s->mb_y * s->mb_stride;
- s->current_picture.mb_type[mb_pos] = MB_TYPE_INTRA;
- s->current_picture.motion_val[1][s->block_index[0]][0] = 0;
- s->current_picture.motion_val[1][s->block_index[0]][1] = 0;
-
- // do actual MB decoding and displaying
- cbp = get_vlc2(&v->s.gb, ff_msmp4_mb_i_vlc.table, MB_INTRA_VLC_BITS, 2);
- if(v->acpred_is_raw)
- v->s.ac_pred = get_bits(&v->s.gb, 1);
- else
- v->s.ac_pred = v->acpred_plane[mb_pos];
-
- if(v->condover == CONDOVER_SELECT) {
- if(v->overflg_is_raw)
- overlap = get_bits(&v->s.gb, 1);
- else
- overlap = v->over_flags_plane[mb_pos];
- } else
- overlap = (v->condover == CONDOVER_ALL);
-
- GET_MQUANT();
-
- s->current_picture.qscale_table[mb_pos] = mquant;
- /* Set DC scale - y and c use the same */
- s->y_dc_scale = s->y_dc_scale_table[mquant];
- s->c_dc_scale = s->c_dc_scale_table[mquant];
-
- for(k = 0; k < 6; k++) {
- val = ((cbp >> (5 - k)) & 1);
-
- if (k < 4) {
- int pred = vc1_coded_block_pred(&v->s, k, &coded_val);
- val = val ^ pred;
- *coded_val = val;
- }
- cbp |= val << (5 - k);
-
- v->a_avail = !s->first_slice_line || (k==2 || k==3);
- v->c_avail = !!s->mb_x || (k==1 || k==3);
-
- vc1_decode_i_block_adv(v, s->block[k], k, val, (k<4)? v->codingset : v->codingset2, mquant);
-
- s->dsp.vc1_inv_trans_8x8(s->block[k]);
- for(j = 0; j < 64; j++) s->block[k][j] += 128;
- }
-
- vc1_put_block(v, s->block);
- if(overlap) {
- if(s->mb_x) {
- s->dsp.vc1_h_overlap(s->dest[0], s->linesize);
- s->dsp.vc1_h_overlap(s->dest[0] + 8 * s->linesize, s->linesize);
- if(!(s->flags & CODEC_FLAG_GRAY)) {
- s->dsp.vc1_h_overlap(s->dest[1], s->uvlinesize);
- s->dsp.vc1_h_overlap(s->dest[2], s->uvlinesize);
- }
- }
- s->dsp.vc1_h_overlap(s->dest[0] + 8, s->linesize);
- s->dsp.vc1_h_overlap(s->dest[0] + 8 * s->linesize + 8, s->linesize);
- if(!s->first_slice_line) {
- s->dsp.vc1_v_overlap(s->dest[0], s->linesize);
- s->dsp.vc1_v_overlap(s->dest[0] + 8, s->linesize);
- if(!(s->flags & CODEC_FLAG_GRAY)) {
- s->dsp.vc1_v_overlap(s->dest[1], s->uvlinesize);
- s->dsp.vc1_v_overlap(s->dest[2], s->uvlinesize);
- }
- }
- s->dsp.vc1_v_overlap(s->dest[0] + 8 * s->linesize, s->linesize);
- s->dsp.vc1_v_overlap(s->dest[0] + 8 * s->linesize + 8, s->linesize);
- }
-
- if(get_bits_count(&s->gb) > v->bits) {
- av_log(s->avctx, AV_LOG_ERROR, "Bits overconsumption: %i > %i\n", get_bits_count(&s->gb), v->bits);
- return;
- }
- }
- ff_draw_horiz_band(s, s->mb_y * 16, 16);
- s->first_slice_line = 0;
- }
-}
-
-static void vc1_decode_p_blocks(VC1Context *v)
-{
- MpegEncContext *s = &v->s;
-
- /* select codingmode used for VLC tables selection */
- switch(v->c_ac_table_index){
- case 0:
- v->codingset = (v->pqindex <= 8) ? CS_HIGH_RATE_INTRA : CS_LOW_MOT_INTRA;
- break;
- case 1:
- v->codingset = CS_HIGH_MOT_INTRA;
- break;
- case 2:
- v->codingset = CS_MID_RATE_INTRA;
- break;
- }
-
- switch(v->c_ac_table_index){
- case 0:
- v->codingset2 = (v->pqindex <= 8) ? CS_HIGH_RATE_INTER : CS_LOW_MOT_INTER;
- break;
- case 1:
- v->codingset2 = CS_HIGH_MOT_INTER;
- break;
- case 2:
- v->codingset2 = CS_MID_RATE_INTER;
- break;
- }
-
- ff_er_add_slice(s, 0, 0, s->mb_width - 1, s->mb_height - 1, (AC_END|DC_END|MV_END));
- s->first_slice_line = 1;
- for(s->mb_y = 0; s->mb_y < s->mb_height; s->mb_y++) {
- for(s->mb_x = 0; s->mb_x < s->mb_width; s->mb_x++) {
- ff_init_block_index(s);
- ff_update_block_index(s);
- s->dsp.clear_blocks(s->block[0]);
-
- vc1_decode_p_mb(v);
- if(get_bits_count(&s->gb) > v->bits || get_bits_count(&s->gb) < 0) {
- av_log(s->avctx, AV_LOG_ERROR, "Bits overconsumption: %i > %i at %ix%i\n", get_bits_count(&s->gb), v->bits,s->mb_x,s->mb_y);
- return;
- }
- }
- ff_draw_horiz_band(s, s->mb_y * 16, 16);
- s->first_slice_line = 0;
- }
-}
-
-static void vc1_decode_b_blocks(VC1Context *v)
-{
- MpegEncContext *s = &v->s;
-
- /* select codingmode used for VLC tables selection */
- switch(v->c_ac_table_index){
- case 0:
- v->codingset = (v->pqindex <= 8) ? CS_HIGH_RATE_INTRA : CS_LOW_MOT_INTRA;
- break;
- case 1:
- v->codingset = CS_HIGH_MOT_INTRA;
- break;
- case 2:
- v->codingset = CS_MID_RATE_INTRA;
- break;
- }
-
- switch(v->c_ac_table_index){
- case 0:
- v->codingset2 = (v->pqindex <= 8) ? CS_HIGH_RATE_INTER : CS_LOW_MOT_INTER;
- break;
- case 1:
- v->codingset2 = CS_HIGH_MOT_INTER;
- break;
- case 2:
- v->codingset2 = CS_MID_RATE_INTER;
- break;
- }
-
- ff_er_add_slice(s, 0, 0, s->mb_width - 1, s->mb_height - 1, (AC_END|DC_END|MV_END));
- s->first_slice_line = 1;
- for(s->mb_y = 0; s->mb_y < s->mb_height; s->mb_y++) {
- for(s->mb_x = 0; s->mb_x < s->mb_width; s->mb_x++) {
- ff_init_block_index(s);
- ff_update_block_index(s);
- s->dsp.clear_blocks(s->block[0]);
-
- vc1_decode_b_mb(v);
- if(get_bits_count(&s->gb) > v->bits || get_bits_count(&s->gb) < 0) {
- av_log(s->avctx, AV_LOG_ERROR, "Bits overconsumption: %i > %i at %ix%i\n", get_bits_count(&s->gb), v->bits,s->mb_x,s->mb_y);
- return;
- }
- }
- ff_draw_horiz_band(s, s->mb_y * 16, 16);
- s->first_slice_line = 0;
- }
-}
-
-static void vc1_decode_skip_blocks(VC1Context *v)
-{
- MpegEncContext *s = &v->s;
-
- ff_er_add_slice(s, 0, 0, s->mb_width - 1, s->mb_height - 1, (AC_END|DC_END|MV_END));
- s->first_slice_line = 1;
- for(s->mb_y = 0; s->mb_y < s->mb_height; s->mb_y++) {
- s->mb_x = 0;
- ff_init_block_index(s);
- ff_update_block_index(s);
- memcpy(s->dest[0], s->last_picture.data[0] + s->mb_y * 16 * s->linesize, s->linesize * 16);
- memcpy(s->dest[1], s->last_picture.data[1] + s->mb_y * 8 * s->uvlinesize, s->uvlinesize * 8);
- memcpy(s->dest[2], s->last_picture.data[2] + s->mb_y * 8 * s->uvlinesize, s->uvlinesize * 8);
- ff_draw_horiz_band(s, s->mb_y * 16, 16);
- s->first_slice_line = 0;
- }
- s->pict_type = P_TYPE;
-}
-
-static void vc1_decode_blocks(VC1Context *v)
-{
-
- v->s.esc3_level_length = 0;
-
- switch(v->s.pict_type) {
- case I_TYPE:
- if(v->profile == PROFILE_ADVANCED)
- vc1_decode_i_blocks_adv(v);
- else
- vc1_decode_i_blocks(v);
- break;
- case P_TYPE:
- if(v->p_frame_skipped)
- vc1_decode_skip_blocks(v);
- else
- vc1_decode_p_blocks(v);
- break;
- case B_TYPE:
- if(v->bi_type)
- vc1_decode_i_blocks(v);
- else
- vc1_decode_b_blocks(v);
- break;
- }
-}
-
-
-/** Initialize a VC1/WMV3 decoder
- * @todo TODO: Handle VC-1 IDUs (Transport level?)
- * @todo TODO: Decypher remaining bits in extra_data
- */
-static int vc1_decode_init(AVCodecContext *avctx)
-{
- VC1Context *v = avctx->priv_data;
- MpegEncContext *s = &v->s;
- GetBitContext gb;
-
- if (!avctx->extradata_size || !avctx->extradata) return -1;
- if (!(avctx->flags & CODEC_FLAG_GRAY))
- avctx->pix_fmt = PIX_FMT_YUV420P;
- else
- avctx->pix_fmt = PIX_FMT_GRAY8;
- v->s.avctx = avctx;
- avctx->flags |= CODEC_FLAG_EMU_EDGE;
- v->s.flags |= CODEC_FLAG_EMU_EDGE;
-
- if(ff_h263_decode_init(avctx) < 0)
- return -1;
- if (vc1_init_common(v) < 0) return -1;
-
- avctx->coded_width = avctx->width;
- avctx->coded_height = avctx->height;
- if (avctx->codec_id == CODEC_ID_WMV3)
- {
- int count = 0;
-
- // looks like WMV3 has a sequence header stored in the extradata
- // advanced sequence header may be before the first frame
- // the last byte of the extradata is a version number, 1 for the
- // samples we can decode
-
- init_get_bits(&gb, avctx->extradata, avctx->extradata_size*8);
-
- if (decode_sequence_header(avctx, &gb) < 0)
- return -1;
-
- count = avctx->extradata_size*8 - get_bits_count(&gb);
- if (count>0)
- {
- av_log(avctx, AV_LOG_INFO, "Extra data: %i bits left, value: %X\n",
- count, get_bits(&gb, count));
- }
- else if (count < 0)
- {
- av_log(avctx, AV_LOG_INFO, "Read %i bits in overflow\n", -count);
- }
- } else { // VC1/WVC1
- int edata_size = avctx->extradata_size;
- uint8_t *edata = avctx->extradata;
-
- if(avctx->extradata_size < 16) {
- av_log(avctx, AV_LOG_ERROR, "Extradata size too small: %i\n", edata_size);
- return -1;
- }
- while(edata_size > 8) {
- // test if we've found header
- if(AV_RB32(edata) == 0x0000010F) {
- edata += 4;
- edata_size -= 4;
- break;
- }
- edata_size--;
- edata++;
- }
-
- init_get_bits(&gb, edata, edata_size*8);
-
- if (decode_sequence_header(avctx, &gb) < 0)
- return -1;
-
- while(edata_size > 8) {
- // test if we've found entry point
- if(AV_RB32(edata) == 0x0000010E) {
- edata += 4;
- edata_size -= 4;
- break;
- }
- edata_size--;
- edata++;
- }
-
- init_get_bits(&gb, edata, edata_size*8);
-
- if (decode_entry_point(avctx, &gb) < 0)
- return -1;
- }
- avctx->has_b_frames= !!(avctx->max_b_frames);
- s->low_delay = !avctx->has_b_frames;
-
- s->mb_width = (avctx->coded_width+15)>>4;
- s->mb_height = (avctx->coded_height+15)>>4;
-
- /* Allocate mb bitplanes */
- v->mv_type_mb_plane = av_malloc(s->mb_stride * s->mb_height);
- v->direct_mb_plane = av_malloc(s->mb_stride * s->mb_height);
- v->acpred_plane = av_malloc(s->mb_stride * s->mb_height);
- v->over_flags_plane = av_malloc(s->mb_stride * s->mb_height);
-
- /* allocate block type info in that way so it could be used with s->block_index[] */
- v->mb_type_base = av_malloc(s->b8_stride * (s->mb_height * 2 + 1) + s->mb_stride * (s->mb_height + 1) * 2);
- v->mb_type[0] = v->mb_type_base + s->b8_stride + 1;
- v->mb_type[1] = v->mb_type_base + s->b8_stride * (s->mb_height * 2 + 1) + s->mb_stride + 1;
- v->mb_type[2] = v->mb_type[1] + s->mb_stride * (s->mb_height + 1);
-
- /* Init coded blocks info */
- if (v->profile == PROFILE_ADVANCED)
- {
-// if (alloc_bitplane(&v->over_flags_plane, s->mb_width, s->mb_height) < 0)
-// return -1;
-// if (alloc_bitplane(&v->ac_pred_plane, s->mb_width, s->mb_height) < 0)
-// return -1;
- }
-
- return 0;
-}
-
-
-/** Decode a VC1/WMV3 frame
- * @todo TODO: Handle VC-1 IDUs (Transport level?)
- */
-static int vc1_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- VC1Context *v = avctx->priv_data;
- MpegEncContext *s = &v->s;
- AVFrame *pict = data;
- uint8_t *buf2 = NULL;
-
- /* no supplementary picture */
- if (buf_size == 0) {
- /* special case for last picture */
- if (s->low_delay==0 && s->next_picture_ptr) {
- *pict= *(AVFrame*)s->next_picture_ptr;
- s->next_picture_ptr= NULL;
-
- *data_size = sizeof(AVFrame);
- }
-
- return 0;
- }
-
- //we need to set current_picture_ptr before reading the header, otherwise we cant store anyting im there
- if(s->current_picture_ptr==NULL || s->current_picture_ptr->data[0]){
- int i= ff_find_unused_picture(s, 0);
- s->current_picture_ptr= &s->picture[i];
- }
-
- //for advanced profile we need to unescape buffer
- if (avctx->codec_id == CODEC_ID_VC1) {
- int i, buf_size2;
- buf2 = av_malloc(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
- buf_size2 = 0;
- for(i = 0; i < buf_size; i++) {
- if(buf[i] == 3 && i >= 2 && !buf[i-1] && !buf[i-2] && i < buf_size-1 && buf[i+1] < 4) {
- buf2[buf_size2++] = buf[i+1];
- i++;
- } else
- buf2[buf_size2++] = buf[i];
- }
- init_get_bits(&s->gb, buf2, buf_size2*8);
- } else
- init_get_bits(&s->gb, buf, buf_size*8);
- // do parse frame header
- if(v->profile < PROFILE_ADVANCED) {
- if(vc1_parse_frame_header(v, &s->gb) == -1) {
- av_free(buf2);
- return -1;
- }
- } else {
- if(vc1_parse_frame_header_adv(v, &s->gb) == -1) {
- av_free(buf2);
- return -1;
- }
- }
-
- if(s->pict_type != I_TYPE && !v->res_rtm_flag){
- av_free(buf2);
- return -1;
- }
-
- // for hurry_up==5
- s->current_picture.pict_type= s->pict_type;
- s->current_picture.key_frame= s->pict_type == I_TYPE;
-
- /* skip B-frames if we don't have reference frames */
- if(s->last_picture_ptr==NULL && (s->pict_type==B_TYPE || s->dropable)){
- av_free(buf2);
- return -1;//buf_size;
- }
- /* skip b frames if we are in a hurry */
- if(avctx->hurry_up && s->pict_type==B_TYPE) return -1;//buf_size;
- if( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==B_TYPE)
- || (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=I_TYPE)
- || avctx->skip_frame >= AVDISCARD_ALL) {
- av_free(buf2);
- return buf_size;
- }
- /* skip everything if we are in a hurry>=5 */
- if(avctx->hurry_up>=5) {
- av_free(buf2);
- return -1;//buf_size;
- }
-
- if(s->next_p_frame_damaged){
- if(s->pict_type==B_TYPE)
- return buf_size;
- else
- s->next_p_frame_damaged=0;
- }
-
- if(MPV_frame_start(s, avctx) < 0) {
- av_free(buf2);
- return -1;
- }
-
- ff_er_frame_start(s);
-
- v->bits = buf_size * 8;
- vc1_decode_blocks(v);
-//av_log(s->avctx, AV_LOG_INFO, "Consumed %i/%i bits\n", get_bits_count(&s->gb), buf_size*8);
-// if(get_bits_count(&s->gb) > buf_size * 8)
-// return -1;
- ff_er_frame_end(s);
-
- MPV_frame_end(s);
-
-assert(s->current_picture.pict_type == s->current_picture_ptr->pict_type);
-assert(s->current_picture.pict_type == s->pict_type);
- if (s->pict_type == B_TYPE || s->low_delay) {
- *pict= *(AVFrame*)s->current_picture_ptr;
- } else if (s->last_picture_ptr != NULL) {
- *pict= *(AVFrame*)s->last_picture_ptr;
- }
-
- if(s->last_picture_ptr || s->low_delay){
- *data_size = sizeof(AVFrame);
- ff_print_debug_info(s, pict);
- }
-
- /* Return the Picture timestamp as the frame number */
- /* we substract 1 because it is added on utils.c */
- avctx->frame_number = s->picture_number - 1;
-
- av_free(buf2);
- return buf_size;
-}
-
-
-/** Close a VC1/WMV3 decoder
- * @warning Initial try at using MpegEncContext stuff
- */
-static int vc1_decode_end(AVCodecContext *avctx)
-{
- VC1Context *v = avctx->priv_data;
-
- av_freep(&v->hrd_rate);
- av_freep(&v->hrd_buffer);
- MPV_common_end(&v->s);
- av_freep(&v->mv_type_mb_plane);
- av_freep(&v->direct_mb_plane);
- av_freep(&v->acpred_plane);
- av_freep(&v->over_flags_plane);
- av_freep(&v->mb_type_base);
- return 0;
-}
-
-
-AVCodec vc1_decoder = {
- "vc1",
- CODEC_TYPE_VIDEO,
- CODEC_ID_VC1,
- sizeof(VC1Context),
- vc1_decode_init,
- NULL,
- vc1_decode_end,
- vc1_decode_frame,
- CODEC_CAP_DELAY,
- NULL
-};
-
-AVCodec wmv3_decoder = {
- "wmv3",
- CODEC_TYPE_VIDEO,
- CODEC_ID_WMV3,
- sizeof(VC1Context),
- vc1_decode_init,
- NULL,
- vc1_decode_end,
- vc1_decode_frame,
- CODEC_CAP_DELAY,
- NULL
-};
diff --git a/src/libffmpeg/libavcodec/vc1acdata.h b/src/libffmpeg/libavcodec/vc1acdata.h
deleted file mode 100644
index a6acecd78..000000000
--- a/src/libffmpeg/libavcodec/vc1acdata.h
+++ /dev/null
@@ -1,585 +0,0 @@
-/*
- * VC-1 and WMV3 decoder
- * copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#define AC_MODES 8
-
-static const int vc1_ac_sizes[AC_MODES] = {
- 186, 169, 133, 149, 103, 103, 163, 175
-};
-
-static const uint32_t vc1_ac_tables[AC_MODES][186][2] = {
-{
-{ 0x0001, 2}, { 0x0005, 3}, { 0x000D, 4}, { 0x0012, 5}, { 0x000E, 6}, { 0x0015, 7},
-{ 0x0013, 8}, { 0x003F, 8}, { 0x004B, 9}, { 0x011F, 9}, { 0x00B8, 10}, { 0x03E3, 10},
-{ 0x0172, 11}, { 0x024D, 12}, { 0x03DA, 12}, { 0x02DD, 13}, { 0x1F55, 13}, { 0x05B9, 14},
-{ 0x3EAE, 14}, { 0x0000, 4}, { 0x0010, 5}, { 0x0008, 7}, { 0x0020, 8}, { 0x0029, 9},
-{ 0x01F4, 9}, { 0x0233, 10}, { 0x01E0, 11}, { 0x012A, 12}, { 0x03DD, 12}, { 0x050A, 13},
-{ 0x1F29, 13}, { 0x0A42, 14}, { 0x1272, 15}, { 0x1737, 15}, { 0x0003, 5}, { 0x0011, 7},
-{ 0x00C4, 8}, { 0x004B, 10}, { 0x00B4, 11}, { 0x07D4, 11}, { 0x0345, 12}, { 0x02D7, 13},
-{ 0x07BF, 13}, { 0x0938, 14}, { 0x0BBB, 14}, { 0x095E, 15}, { 0x0013, 5}, { 0x0078, 7},
-{ 0x0069, 9}, { 0x0232, 10}, { 0x0461, 11}, { 0x03EC, 12}, { 0x0520, 13}, { 0x1F2A, 13},
-{ 0x3E50, 14}, { 0x3E51, 14}, { 0x1486, 15}, { 0x000C, 6}, { 0x0024, 9}, { 0x0094, 11},
-{ 0x08C0, 12}, { 0x0F09, 14}, { 0x1EF0, 15}, { 0x003D, 6}, { 0x0053, 9}, { 0x01A0, 11},
-{ 0x02D6, 13}, { 0x0F08, 14}, { 0x0013, 7}, { 0x007C, 9}, { 0x07C1, 11}, { 0x04AC, 14},
-{ 0x001B, 7}, { 0x00A0, 10}, { 0x0344, 12}, { 0x0F79, 14}, { 0x0079, 7}, { 0x03E1, 10},
-{ 0x02D4, 13}, { 0x2306, 14}, { 0x0021, 8}, { 0x023C, 10}, { 0x0FAE, 12}, { 0x23DE, 14},
-{ 0x0035, 8}, { 0x0175, 11}, { 0x07B3, 13}, { 0x00C5, 8}, { 0x0174, 11}, { 0x0785, 13},
-{ 0x0048, 9}, { 0x01A3, 11}, { 0x049E, 13}, { 0x002C, 9}, { 0x00FA, 10}, { 0x07D6, 11},
-{ 0x0092, 10}, { 0x05CC, 13}, { 0x1EF1, 15}, { 0x00A3, 10}, { 0x03ED, 12}, { 0x093E, 14},
-{ 0x01E2, 11}, { 0x1273, 15}, { 0x07C4, 11}, { 0x1487, 15}, { 0x0291, 12}, { 0x0293, 12},
-{ 0x0F8A, 12}, { 0x0509, 13}, { 0x0508, 13}, { 0x078D, 13}, { 0x07BE, 13}, { 0x078C, 13},
-{ 0x04AE, 14}, { 0x0BBA, 14}, { 0x2307, 14}, { 0x0B9A, 14}, { 0x1736, 15}, { 0x000E, 4},
-{ 0x0045, 7}, { 0x01F3, 9}, { 0x047A, 11}, { 0x05DC, 13}, { 0x23DF, 14}, { 0x0019, 5},
-{ 0x0028, 9}, { 0x0176, 11}, { 0x049D, 13}, { 0x23DD, 14}, { 0x0030, 6}, { 0x00A2, 10},
-{ 0x02EF, 12}, { 0x05B8, 14}, { 0x003F, 6}, { 0x00A5, 10}, { 0x03DB, 12}, { 0x093F, 14},
-{ 0x0044, 7}, { 0x07CB, 11}, { 0x095F, 15}, { 0x0063, 7}, { 0x03C3, 12}, { 0x0015, 8},
-{ 0x08F6, 12}, { 0x0017, 8}, { 0x0498, 13}, { 0x002C, 8}, { 0x07B2, 13}, { 0x002F, 8},
-{ 0x1F54, 13}, { 0x008D, 8}, { 0x07BD, 13}, { 0x008E, 8}, { 0x1182, 13}, { 0x00FB, 8},
-{ 0x050B, 13}, { 0x002D, 8}, { 0x07C0, 11}, { 0x0079, 9}, { 0x1F5F, 13}, { 0x007A, 9},
-{ 0x1F56, 13}, { 0x0231, 10}, { 0x03E4, 10}, { 0x01A1, 11}, { 0x0143, 11}, { 0x01F7, 11},
-{ 0x016F, 12}, { 0x0292, 12}, { 0x02E7, 12}, { 0x016C, 12}, { 0x016D, 12}, { 0x03DC, 12},
-{ 0x0F8B, 12}, { 0x0499, 13}, { 0x03D8, 12}, { 0x078E, 13}, { 0x02D5, 13}, { 0x1F5E, 13},
-{ 0x1F2B, 13}, { 0x078F, 13}, { 0x04AD, 14}, { 0x3EAF, 14}, { 0x23DC, 14}, { 0x004A, 9}
-},
-{
-{ 0x0000, 3}, { 0x0003, 4}, { 0x000B, 5}, { 0x0014, 6}, { 0x003F, 6}, { 0x005D, 7},
-{ 0x00A2, 8}, { 0x00AC, 9}, { 0x016E, 9}, { 0x020A, 10}, { 0x02E2, 10}, { 0x0432, 11},
-{ 0x05C9, 11}, { 0x0827, 12}, { 0x0B54, 12}, { 0x04E6, 13}, { 0x105F, 13}, { 0x172A, 13},
-{ 0x20B2, 14}, { 0x2D4E, 14}, { 0x39F0, 14}, { 0x4175, 15}, { 0x5A9E, 15}, { 0x0004, 4},
-{ 0x001E, 5}, { 0x0042, 7}, { 0x00B6, 8}, { 0x0173, 9}, { 0x0395, 10}, { 0x072E, 11},
-{ 0x0B94, 12}, { 0x16A4, 13}, { 0x20B3, 14}, { 0x2E45, 14}, { 0x0005, 5}, { 0x0040, 7},
-{ 0x0049, 9}, { 0x028F, 10}, { 0x05CB, 11}, { 0x048A, 13}, { 0x09DD, 14}, { 0x73E2, 15},
-{ 0x0018, 5}, { 0x0025, 8}, { 0x008A, 10}, { 0x051B, 11}, { 0x0E5F, 12}, { 0x09C9, 14},
-{ 0x139C, 15}, { 0x0029, 6}, { 0x004F, 9}, { 0x0412, 11}, { 0x048D, 13}, { 0x2E41, 14},
-{ 0x0038, 6}, { 0x010E, 9}, { 0x05A8, 11}, { 0x105C, 13}, { 0x39F2, 14}, { 0x0058, 7},
-{ 0x021F, 10}, { 0x0E7E, 12}, { 0x39FF, 14}, { 0x0023, 8}, { 0x02E3, 10}, { 0x04E5, 13},
-{ 0x2E40, 14}, { 0x00A1, 8}, { 0x05BE, 11}, { 0x09C8, 14}, { 0x0083, 8}, { 0x013A, 11},
-{ 0x1721, 13}, { 0x0044, 9}, { 0x0276, 12}, { 0x39F6, 14}, { 0x008B, 10}, { 0x04EF, 13},
-{ 0x5A9B, 15}, { 0x0208, 10}, { 0x1CFE, 13}, { 0x0399, 10}, { 0x1CB4, 13}, { 0x039E, 10},
-{ 0x39F3, 14}, { 0x05AB, 11}, { 0x73E3, 15}, { 0x0737, 11}, { 0x5A9F, 15}, { 0x082D, 12},
-{ 0x0E69, 12}, { 0x0E68, 12}, { 0x0433, 11}, { 0x0B7B, 12}, { 0x2DF8, 14}, { 0x2E56, 14},
-{ 0x2E57, 14}, { 0x39F7, 14}, { 0x51A5, 15}, { 0x0003, 3}, { 0x002A, 6}, { 0x00E4, 8},
-{ 0x028E, 10}, { 0x0735, 11}, { 0x1058, 13}, { 0x1CFA, 13}, { 0x2DF9, 14}, { 0x4174, 15},
-{ 0x0009, 4}, { 0x0054, 8}, { 0x0398, 10}, { 0x048B, 13}, { 0x139D, 15}, { 0x000D, 4},
-{ 0x00AD, 9}, { 0x0826, 12}, { 0x2D4C, 14}, { 0x0011, 5}, { 0x016B, 9}, { 0x0B7F, 12},
-{ 0x51A4, 15}, { 0x0019, 5}, { 0x021B, 10}, { 0x16FD, 13}, { 0x001D, 5}, { 0x0394, 10},
-{ 0x28D3, 14}, { 0x002B, 6}, { 0x05BC, 11}, { 0x5A9A, 15}, { 0x002F, 6}, { 0x0247, 12},
-{ 0x0010, 7}, { 0x0A35, 12}, { 0x003E, 6}, { 0x0B7A, 12}, { 0x0059, 7}, { 0x105E, 13},
-{ 0x0026, 8}, { 0x09CF, 14}, { 0x0055, 8}, { 0x1CB5, 13}, { 0x0057, 8}, { 0x0E5B, 12},
-{ 0x00A0, 8}, { 0x1468, 13}, { 0x0170, 9}, { 0x0090, 10}, { 0x01CE, 9}, { 0x021A, 10},
-{ 0x0218, 10}, { 0x0168, 9}, { 0x021E, 10}, { 0x0244, 12}, { 0x0736, 11}, { 0x0138, 11},
-{ 0x0519, 11}, { 0x0E5E, 12}, { 0x072C, 11}, { 0x0B55, 12}, { 0x09DC, 14}, { 0x20BB, 14},
-{ 0x048C, 13}, { 0x1723, 13}, { 0x2E44, 14}, { 0x16A5, 13}, { 0x0518, 11}, { 0x39FE, 14},
-{ 0x0169, 9}
-},
-{
-{ 0x0001, 2}, { 0x0006, 3}, { 0x000F, 4}, { 0x0016, 5}, { 0x0020, 6}, { 0x0018, 7},
-{ 0x0008, 8}, { 0x009A, 8}, { 0x0056, 9}, { 0x013E, 9}, { 0x00F0, 10}, { 0x03A5, 10},
-{ 0x0077, 11}, { 0x01EF, 11}, { 0x009A, 12}, { 0x005D, 13}, { 0x0001, 4}, { 0x0011, 5},
-{ 0x0002, 7}, { 0x000B, 8}, { 0x0012, 9}, { 0x01D6, 9}, { 0x027E, 10}, { 0x0191, 11},
-{ 0x00EA, 12}, { 0x03DC, 12}, { 0x013B, 13}, { 0x0004, 5}, { 0x0014, 7}, { 0x009E, 8},
-{ 0x0009, 10}, { 0x01AC, 11}, { 0x01E2, 11}, { 0x03CA, 12}, { 0x005F, 13}, { 0x0017, 5},
-{ 0x004E, 7}, { 0x005E, 9}, { 0x00F3, 10}, { 0x01AD, 11}, { 0x00EC, 12}, { 0x05F0, 13},
-{ 0x000E, 6}, { 0x00E1, 8}, { 0x03A4, 10}, { 0x009C, 12}, { 0x013D, 13}, { 0x003B, 6},
-{ 0x001C, 9}, { 0x0014, 11}, { 0x09BE, 12}, { 0x0006, 7}, { 0x007A, 9}, { 0x0190, 11},
-{ 0x0137, 13}, { 0x001B, 7}, { 0x0008, 10}, { 0x075C, 11}, { 0x0071, 7}, { 0x00D7, 10},
-{ 0x09BF, 12}, { 0x0007, 8}, { 0x00AF, 10}, { 0x04CC, 11}, { 0x0034, 8}, { 0x0265, 10},
-{ 0x009F, 12}, { 0x00E0, 8}, { 0x0016, 11}, { 0x0327, 12}, { 0x0015, 9}, { 0x017D, 11},
-{ 0x0EBB, 12}, { 0x0014, 9}, { 0x00F6, 10}, { 0x01E4, 11}, { 0x00CB, 10}, { 0x099D, 12},
-{ 0x00CA, 10}, { 0x02FC, 12}, { 0x017F, 11}, { 0x04CD, 11}, { 0x02FD, 12}, { 0x04FE, 11},
-{ 0x013A, 13}, { 0x000A, 4}, { 0x0042, 7}, { 0x01D3, 9}, { 0x04DD, 11}, { 0x0012, 5},
-{ 0x00E8, 8}, { 0x004C, 11}, { 0x0136, 13}, { 0x0039, 6}, { 0x0264, 10}, { 0x0EBA, 12},
-{ 0x0000, 7}, { 0x00AE, 10}, { 0x099C, 12}, { 0x001F, 7}, { 0x04DE, 11}, { 0x0043, 7},
-{ 0x04DC, 11}, { 0x0003, 8}, { 0x03CB, 12}, { 0x0006, 8}, { 0x099E, 12}, { 0x002A, 8},
-{ 0x05F1, 13}, { 0x000F, 8}, { 0x09FE, 12}, { 0x0033, 8}, { 0x09FF, 12}, { 0x0098, 8},
-{ 0x099F, 12}, { 0x00EA, 8}, { 0x013C, 13}, { 0x002E, 8}, { 0x0192, 11}, { 0x0136, 9},
-{ 0x006A, 9}, { 0x0015, 11}, { 0x03AF, 10}, { 0x01E3, 11}, { 0x0074, 11}, { 0x00EB, 12},
-{ 0x02F9, 12}, { 0x005C, 13}, { 0x00ED, 12}, { 0x03DD, 12}, { 0x0326, 12}, { 0x005E, 13},
-{ 0x0016, 7}
-},
-{
-{ 0x0004, 3}, { 0x0014, 5}, { 0x0017, 7}, { 0x007F, 8}, { 0x0154, 9}, { 0x01F2, 10},
-{ 0x00BF, 11}, { 0x0065, 12}, { 0x0AAA, 12}, { 0x0630, 13}, { 0x1597, 13}, { 0x03B7, 14},
-{ 0x2B22, 14}, { 0x0BE6, 15}, { 0x000B, 4}, { 0x0037, 7}, { 0x0062, 9}, { 0x0007, 11},
-{ 0x0166, 12}, { 0x00CE, 13}, { 0x1590, 13}, { 0x05F6, 14}, { 0x0BE7, 15}, { 0x0007, 5},
-{ 0x006D, 8}, { 0x0003, 11}, { 0x031F, 12}, { 0x05F2, 14}, { 0x0002, 6}, { 0x0061, 9},
-{ 0x0055, 12}, { 0x01DF, 14}, { 0x001A, 6}, { 0x001E, 10}, { 0x0AC9, 12}, { 0x2B23, 14},
-{ 0x001E, 6}, { 0x001F, 10}, { 0x0AC3, 12}, { 0x2B2B, 14}, { 0x0006, 7}, { 0x0004, 11},
-{ 0x02F8, 13}, { 0x0019, 7}, { 0x0006, 11}, { 0x063D, 13}, { 0x0057, 7}, { 0x0182, 11},
-{ 0x2AA2, 14}, { 0x0004, 8}, { 0x0180, 11}, { 0x059C, 14}, { 0x007D, 8}, { 0x0164, 12},
-{ 0x076D, 15}, { 0x0002, 9}, { 0x018D, 11}, { 0x1581, 13}, { 0x00AD, 8}, { 0x0060, 12},
-{ 0x0C67, 14}, { 0x001C, 9}, { 0x00EE, 13}, { 0x0003, 9}, { 0x02CF, 13}, { 0x00D9, 9},
-{ 0x1580, 13}, { 0x0002, 11}, { 0x0183, 11}, { 0x0057, 12}, { 0x0061, 12}, { 0x0031, 11},
-{ 0x0066, 12}, { 0x0631, 13}, { 0x0632, 13}, { 0x00AC, 13}, { 0x031D, 12}, { 0x0076, 12},
-{ 0x003A, 11}, { 0x0165, 12}, { 0x0C66, 14}, { 0x0003, 2}, { 0x0054, 7}, { 0x02AB, 10},
-{ 0x0016, 13}, { 0x05F7, 14}, { 0x0005, 4}, { 0x00F8, 9}, { 0x0AA9, 12}, { 0x005F, 15},
-{ 0x0004, 4}, { 0x001C, 10}, { 0x1550, 13}, { 0x0004, 5}, { 0x0077, 11}, { 0x076C, 15},
-{ 0x000E, 5}, { 0x000A, 12}, { 0x000C, 5}, { 0x0562, 11}, { 0x0004, 6}, { 0x031C, 12},
-{ 0x0006, 6}, { 0x00C8, 13}, { 0x000D, 6}, { 0x01DA, 13}, { 0x0007, 6}, { 0x00C9, 13},
-{ 0x0001, 7}, { 0x002E, 14}, { 0x0014, 7}, { 0x1596, 13}, { 0x000A, 7}, { 0x0AC2, 12},
-{ 0x0016, 7}, { 0x015B, 14}, { 0x0015, 7}, { 0x015A, 14}, { 0x000F, 8}, { 0x005E, 15},
-{ 0x007E, 8}, { 0x00AB, 8}, { 0x002D, 9}, { 0x00D8, 9}, { 0x000B, 9}, { 0x0014, 10},
-{ 0x02B3, 10}, { 0x01F3, 10}, { 0x003A, 10}, { 0x0000, 10}, { 0x0058, 10}, { 0x002E, 9},
-{ 0x005E, 10}, { 0x0563, 11}, { 0x00EC, 12}, { 0x0054, 12}, { 0x0AC1, 12}, { 0x1556, 13},
-{ 0x02FA, 13}, { 0x0181, 11}, { 0x1557, 13}, { 0x059D, 14}, { 0x2AA3, 14}, { 0x2B2A, 14},
-{ 0x01DE, 14}, { 0x063C, 13}, { 0x00CF, 13}, { 0x1594, 13}, { 0x000D, 9}
-},
-{
-{ 0x0002, 2}, { 0x0006, 3}, { 0x000F, 4}, { 0x000D, 5}, { 0x000C, 5}, { 0x0015, 6},
-{ 0x0013, 6}, { 0x0012, 6}, { 0x0017, 7}, { 0x001F, 8}, { 0x001E, 8}, { 0x001D, 8},
-{ 0x0025, 9}, { 0x0024, 9}, { 0x0023, 9}, { 0x0021, 9}, { 0x0021, 10}, { 0x0020, 10},
-{ 0x000F, 10}, { 0x000E, 10}, { 0x0007, 11}, { 0x0006, 11}, { 0x0020, 11}, { 0x0021, 11},
-{ 0x0050, 12}, { 0x0051, 12}, { 0x0052, 12}, { 0x000E, 4}, { 0x0014, 6}, { 0x0016, 7},
-{ 0x001C, 8}, { 0x0020, 9}, { 0x001F, 9}, { 0x000D, 10}, { 0x0022, 11}, { 0x0053, 12},
-{ 0x0055, 12}, { 0x000B, 5}, { 0x0015, 7}, { 0x001E, 9}, { 0x000C, 10}, { 0x0056, 12},
-{ 0x0011, 6}, { 0x001B, 8}, { 0x001D, 9}, { 0x000B, 10}, { 0x0010, 6}, { 0x0022, 9},
-{ 0x000A, 10}, { 0x000D, 6}, { 0x001C, 9}, { 0x0008, 10}, { 0x0012, 7}, { 0x001B, 9},
-{ 0x0054, 12}, { 0x0014, 7}, { 0x001A, 9}, { 0x0057, 12}, { 0x0019, 8}, { 0x0009, 10},
-{ 0x0018, 8}, { 0x0023, 11}, { 0x0017, 8}, { 0x0019, 9}, { 0x0018, 9}, { 0x0007, 10},
-{ 0x0058, 12}, { 0x0007, 4}, { 0x000C, 6}, { 0x0016, 8}, { 0x0017, 9}, { 0x0006, 10},
-{ 0x0005, 11}, { 0x0004, 11}, { 0x0059, 12}, { 0x000F, 6}, { 0x0016, 9}, { 0x0005, 10},
-{ 0x000E, 6}, { 0x0004, 10}, { 0x0011, 7}, { 0x0024, 11}, { 0x0010, 7}, { 0x0025, 11},
-{ 0x0013, 7}, { 0x005A, 12}, { 0x0015, 8}, { 0x005B, 12}, { 0x0014, 8}, { 0x0013, 8},
-{ 0x001A, 8}, { 0x0015, 9}, { 0x0014, 9}, { 0x0013, 9}, { 0x0012, 9}, { 0x0011, 9},
-{ 0x0026, 11}, { 0x0027, 11}, { 0x005C, 12}, { 0x005D, 12}, { 0x005E, 12}, { 0x005F, 12},
-{ 0x0003, 7}
-},
-{
-{ 0x0002, 2}, { 0x000F, 4}, { 0x0015, 6}, { 0x0017, 7}, { 0x001F, 8}, { 0x0025, 9},
-{ 0x0024, 9}, { 0x0021, 10}, { 0x0020, 10}, { 0x0007, 11}, { 0x0006, 11}, { 0x0020, 11},
-{ 0x0006, 3}, { 0x0014, 6}, { 0x001E, 8}, { 0x000F, 10}, { 0x0021, 11}, { 0x0050, 12},
-{ 0x000E, 4}, { 0x001D, 8}, { 0x000E, 10}, { 0x0051, 12}, { 0x000D, 5}, { 0x0023, 9},
-{ 0x000D, 10}, { 0x000C, 5}, { 0x0022, 9}, { 0x0052, 12}, { 0x000B, 5}, { 0x000C, 10},
-{ 0x0053, 12}, { 0x0013, 6}, { 0x000B, 10}, { 0x0054, 12}, { 0x0012, 6}, { 0x000A, 10},
-{ 0x0011, 6}, { 0x0009, 10}, { 0x0010, 6}, { 0x0008, 10}, { 0x0016, 7}, { 0x0055, 12},
-{ 0x0015, 7}, { 0x0014, 7}, { 0x001C, 8}, { 0x001B, 8}, { 0x0021, 9}, { 0x0020, 9},
-{ 0x001F, 9}, { 0x001E, 9}, { 0x001D, 9}, { 0x001C, 9}, { 0x001B, 9}, { 0x001A, 9},
-{ 0x0022, 11}, { 0x0023, 11}, { 0x0056, 12}, { 0x0057, 12}, { 0x0007, 4}, { 0x0019, 9},
-{ 0x0005, 11}, { 0x000F, 6}, { 0x0004, 11}, { 0x000E, 6}, { 0x000D, 6}, { 0x000C, 6},
-{ 0x0013, 7}, { 0x0012, 7}, { 0x0011, 7}, { 0x0010, 7}, { 0x001A, 8}, { 0x0019, 8},
-{ 0x0018, 8}, { 0x0017, 8}, { 0x0016, 8}, { 0x0015, 8}, { 0x0014, 8}, { 0x0013, 8},
-{ 0x0018, 9}, { 0x0017, 9}, { 0x0016, 9}, { 0x0015, 9}, { 0x0014, 9}, { 0x0013, 9},
-{ 0x0012, 9}, { 0x0011, 9}, { 0x0007, 10}, { 0x0006, 10}, { 0x0005, 10}, { 0x0004, 10},
-{ 0x0024, 11}, { 0x0025, 11}, { 0x0026, 11}, { 0x0027, 11}, { 0x0058, 12}, { 0x0059, 12},
-{ 0x005A, 12}, { 0x005B, 12}, { 0x005C, 12}, { 0x005D, 12}, { 0x005E, 12}, { 0x005F, 12},
-{ 0x0003, 7}
-},
-{
-{ 0x0000, 2}, { 0x0003, 3}, { 0x000D, 4}, { 0x0005, 4}, { 0x001C, 5}, { 0x0016, 5},
-{ 0x003F, 6}, { 0x003A, 6}, { 0x002E, 6}, { 0x0022, 6}, { 0x007B, 7}, { 0x0067, 7},
-{ 0x005F, 7}, { 0x0047, 7}, { 0x0026, 7}, { 0x00EF, 8}, { 0x00CD, 8}, { 0x00C1, 8},
-{ 0x00A9, 8}, { 0x004F, 8}, { 0x01F2, 9}, { 0x01DD, 9}, { 0x0199, 9}, { 0x0185, 9},
-{ 0x015D, 9}, { 0x011B, 9}, { 0x03EF, 10}, { 0x03E1, 10}, { 0x03C8, 10}, { 0x0331, 10},
-{ 0x0303, 10}, { 0x02F1, 10}, { 0x02A0, 10}, { 0x0233, 10}, { 0x0126, 10}, { 0x07C0, 11},
-{ 0x076F, 11}, { 0x076C, 11}, { 0x0661, 11}, { 0x0604, 11}, { 0x0572, 11}, { 0x0551, 11},
-{ 0x046A, 11}, { 0x0274, 11}, { 0x0F27, 12}, { 0x0F24, 12}, { 0x0EDB, 12}, { 0x0C8E, 12},
-{ 0x0C0B, 12}, { 0x0C0A, 12}, { 0x0AE3, 12}, { 0x08D6, 12}, { 0x0490, 12}, { 0x0495, 12},
-{ 0x1F19, 13}, { 0x1DB5, 13}, { 0x0009, 4}, { 0x0010, 5}, { 0x0029, 6}, { 0x0062, 7},
-{ 0x00F3, 8}, { 0x00AD, 8}, { 0x01E5, 9}, { 0x0179, 9}, { 0x009C, 9}, { 0x03B1, 10},
-{ 0x02AE, 10}, { 0x0127, 10}, { 0x076E, 11}, { 0x0570, 11}, { 0x0275, 11}, { 0x0F25, 12},
-{ 0x0EC0, 12}, { 0x0AA0, 12}, { 0x08D7, 12}, { 0x1E4C, 13}, { 0x0008, 5}, { 0x0063, 7},
-{ 0x00AF, 8}, { 0x017B, 9}, { 0x03B3, 10}, { 0x07DD, 11}, { 0x0640, 11}, { 0x0F8D, 12},
-{ 0x0BC1, 12}, { 0x0491, 12}, { 0x0028, 6}, { 0x00C3, 8}, { 0x0151, 9}, { 0x02A1, 10},
-{ 0x0573, 11}, { 0x0EC3, 12}, { 0x1F35, 13}, { 0x0065, 7}, { 0x01DA, 9}, { 0x02AF, 10},
-{ 0x0277, 11}, { 0x08C9, 12}, { 0x1781, 13}, { 0x0025, 7}, { 0x0118, 9}, { 0x0646, 11},
-{ 0x0AA6, 12}, { 0x1780, 13}, { 0x00C9, 8}, { 0x0321, 10}, { 0x0F9B, 12}, { 0x191E, 13},
-{ 0x0048, 8}, { 0x07CC, 11}, { 0x0AA1, 12}, { 0x0180, 9}, { 0x0465, 11}, { 0x1905, 13},
-{ 0x03E2, 10}, { 0x0EC1, 12}, { 0x3C9B, 14}, { 0x02F4, 10}, { 0x08C8, 12}, { 0x07C1, 11},
-{ 0x0928, 13}, { 0x05E1, 11}, { 0x320D, 14}, { 0x0EC2, 12}, { 0x6418, 15}, { 0x1F34, 13},
-{ 0x0078, 7}, { 0x0155, 9}, { 0x0552, 11}, { 0x191F, 13}, { 0x00FA, 8}, { 0x07DC, 11},
-{ 0x1907, 13}, { 0x00AC, 8}, { 0x0249, 11}, { 0x13B1, 14}, { 0x01F6, 9}, { 0x0AE2, 12},
-{ 0x01DC, 9}, { 0x04ED, 12}, { 0x0184, 9}, { 0x1904, 13}, { 0x0156, 9}, { 0x09D9, 13},
-{ 0x03E7, 10}, { 0x0929, 13}, { 0x03B2, 10}, { 0x3B68, 14}, { 0x02F5, 10}, { 0x13B0, 14},
-{ 0x0322, 10}, { 0x3B69, 14}, { 0x0234, 10}, { 0x7935, 15}, { 0x07C7, 11}, { 0xC833, 16},
-{ 0x0660, 11}, { 0x7934, 15}, { 0x024B, 11}, { 0xC832, 16}, { 0x0AA7, 12}, { 0x1F18, 13},
-{ 0x007A, 7}
-},
-{
-{ 0x0002, 2}, { 0x0000, 3}, { 0x001E, 5}, { 0x0004, 5}, { 0x0012, 6}, { 0x0070, 7},
-{ 0x001A, 7}, { 0x005F, 8}, { 0x0047, 8}, { 0x01D3, 9}, { 0x00B5, 9}, { 0x0057, 9},
-{ 0x03B5, 10}, { 0x016D, 10}, { 0x0162, 10}, { 0x07CE, 11}, { 0x0719, 11}, { 0x0691, 11},
-{ 0x02C6, 11}, { 0x0156, 11}, { 0x0F92, 12}, { 0x0D2E, 12}, { 0x0D20, 12}, { 0x059E, 12},
-{ 0x0468, 12}, { 0x02A6, 12}, { 0x1DA2, 13}, { 0x1C60, 13}, { 0x1A43, 13}, { 0x0B1D, 13},
-{ 0x08C0, 13}, { 0x055D, 13}, { 0x0003, 3}, { 0x000A, 5}, { 0x0077, 7}, { 0x00E5, 8},
-{ 0x01D9, 9}, { 0x03E5, 10}, { 0x0166, 10}, { 0x0694, 11}, { 0x0152, 11}, { 0x059F, 12},
-{ 0x1F3C, 13}, { 0x1A4B, 13}, { 0x055E, 13}, { 0x000C, 4}, { 0x007D, 7}, { 0x0044, 8},
-{ 0x03E0, 10}, { 0x0769, 11}, { 0x0E31, 12}, { 0x1F26, 13}, { 0x055C, 13}, { 0x001B, 5},
-{ 0x00E2, 8}, { 0x03A5, 10}, { 0x02C9, 11}, { 0x1F23, 13}, { 0x3B47, 14}, { 0x0007, 5},
-{ 0x01D8, 9}, { 0x02D8, 11}, { 0x1F27, 13}, { 0x3494, 14}, { 0x0035, 6}, { 0x03E1, 10},
-{ 0x059C, 12}, { 0x38C3, 14}, { 0x000C, 6}, { 0x0165, 10}, { 0x1D23, 13}, { 0x1638, 14},
-{ 0x0068, 7}, { 0x0693, 11}, { 0x3A45, 14}, { 0x0020, 7}, { 0x0F90, 12}, { 0x7CF6, 15},
-{ 0x00E8, 8}, { 0x058F, 12}, { 0x2CEF, 15}, { 0x0045, 8}, { 0x0B3A, 13}, { 0x01F1, 9},
-{ 0x3B46, 14}, { 0x01A7, 9}, { 0x1676, 14}, { 0x0056, 9}, { 0x692A, 15}, { 0x038D, 10},
-{ 0xE309, 16}, { 0x00AA, 10}, { 0x1C611, 17}, { 0x02DF, 11}, { 0xB3B9, 17}, { 0x02C8, 11},
-{ 0x38C20, 18}, { 0x01B0, 11}, { 0x16390, 18}, { 0x0F9F, 12}, { 0x16771, 18}, { 0x0ED0, 12},
-{ 0x71843, 19}, { 0x0D2A, 12}, { 0xF9E8C, 20}, { 0x0461, 12}, { 0xF9E8E, 20}, { 0x0B67, 13},
-{ 0x055F, 13}, { 0x003F, 6}, { 0x006D, 9}, { 0x0E90, 12}, { 0x054E, 13}, { 0x0013, 6},
-{ 0x0119, 10}, { 0x0B66, 13}, { 0x000B, 6}, { 0x0235, 11}, { 0x7CF5, 15}, { 0x0075, 7},
-{ 0x0D24, 12}, { 0xF9E9, 16}, { 0x002E, 7}, { 0x1F22, 13}, { 0x0021, 7}, { 0x054F, 13},
-{ 0x0014, 7}, { 0x3A44, 14}, { 0x00E4, 8}, { 0x7CF7, 15}, { 0x005E, 8}, { 0x7185, 15},
-{ 0x0037, 8}, { 0x2C73, 15}, { 0x01DB, 9}, { 0x59DD, 16}, { 0x01C7, 9}, { 0x692B, 15},
-{ 0x01A6, 9}, { 0x58E5, 16}, { 0x00B4, 9}, { 0x1F3D0, 17}, { 0x00B0, 9}, { 0xB1C9, 17},
-{ 0x03E6, 10}, { 0x16770, 18}, { 0x016E, 10}, { 0x3E7A2, 18}, { 0x011B, 10}, { 0xF9E8D, 20},
-{ 0x00D9, 10}, { 0xF9E8F, 20}, { 0x00A8, 10}, { 0x2C723, 19}, { 0x0749, 11}, { 0xE3084, 20},
-{ 0x0696, 11}, { 0x58E45, 20}, { 0x02DE, 11}, { 0xB1C88, 21}, { 0x0231, 11}, { 0x1C610A, 21},
-{ 0x01B1, 11}, { 0x71842D, 23}, { 0x0D2B, 12}, { 0x38C217, 22}, { 0x0D2F, 12}, { 0x163913, 22},
-{ 0x05B2, 12}, { 0x163912, 22}, { 0x0469, 12}, { 0x71842C, 23}, { 0x1A42, 13}, { 0x08C1, 13},
-{ 0x0073, 7}
-}
-};
-
-/* which indexes point to last=1 entries in tables */
-static const int vc1_last_decode_table[AC_MODES] = {
- 119, 99, 85, 81, 67, 58, 126, 109
-};
-
-static const uint8_t vc1_index_decode_table[AC_MODES][185][2] = {
-{
-{ 0, 1}, { 0, 2}, { 0, 3}, { 0, 4}, { 0, 5}, { 0, 6}, { 0, 7}, { 0, 8},
-{ 0, 9}, { 0, 10}, { 0, 11}, { 0, 12}, { 0, 13}, { 0, 14}, { 0, 15}, { 0, 16},
-{ 0, 17}, { 0, 18}, { 0, 19}, { 1, 1}, { 1, 2}, { 1, 3}, { 1, 4}, { 1, 5},
-{ 1, 6}, { 1, 7}, { 1, 8}, { 1, 9}, { 1, 10}, { 1, 11}, { 1, 12}, { 1, 13},
-{ 1, 14}, { 1, 15}, { 2, 1}, { 2, 2}, { 2, 3}, { 2, 4}, { 2, 5}, { 2, 6},
-{ 2, 7}, { 2, 8}, { 2, 9}, { 2, 10}, { 2, 11}, { 2, 12}, { 3, 1}, { 3, 2},
-{ 3, 3}, { 3, 4}, { 3, 5}, { 3, 6}, { 3, 7}, { 3, 8}, { 3, 9}, { 3, 10},
-{ 3, 11}, { 4, 1}, { 4, 2}, { 4, 3}, { 4, 4}, { 4, 5}, { 4, 6}, { 5, 1},
-{ 5, 2}, { 5, 3}, { 5, 4}, { 5, 5}, { 6, 1}, { 6, 2}, { 6, 3}, { 6, 4},
-{ 7, 1}, { 7, 2}, { 7, 3}, { 7, 4}, { 8, 1}, { 8, 2}, { 8, 3}, { 8, 4},
-{ 9, 1}, { 9, 2}, { 9, 3}, { 9, 4}, { 10, 1}, { 10, 2}, { 10, 3}, { 11, 1},
-{ 11, 2}, { 11, 3}, { 12, 1}, { 12, 2}, { 12, 3}, { 13, 1}, { 13, 2}, { 13, 3},
-{ 14, 1}, { 14, 2}, { 14, 3}, { 15, 1}, { 15, 2}, { 15, 3}, { 16, 1}, { 16, 2},
-{ 17, 1}, { 17, 2}, { 18, 1}, { 19, 1}, { 20, 1}, { 21, 1}, { 22, 1}, { 23, 1},
-{ 24, 1}, { 25, 1}, { 26, 1}, { 27, 1}, { 28, 1}, { 29, 1}, { 30, 1}, { 0, 1},
-{ 0, 2}, { 0, 3}, { 0, 4}, { 0, 5}, { 0, 6}, { 1, 1}, { 1, 2}, { 1, 3},
-{ 1, 4}, { 1, 5}, { 2, 1}, { 2, 2}, { 2, 3}, { 2, 4}, { 3, 1}, { 3, 2},
-{ 3, 3}, { 3, 4}, { 4, 1}, { 4, 2}, { 4, 3}, { 5, 1}, { 5, 2}, { 6, 1},
-{ 6, 2}, { 7, 1}, { 7, 2}, { 8, 1}, { 8, 2}, { 9, 1}, { 9, 2}, { 10, 1},
-{ 10, 2}, { 11, 1}, { 11, 2}, { 12, 1}, { 12, 2}, { 13, 1}, { 13, 2}, { 14, 1},
-{ 14, 2}, { 15, 1}, { 15, 2}, { 16, 1}, { 17, 1}, { 18, 1}, { 19, 1}, { 20, 1},
-{ 21, 1}, { 22, 1}, { 23, 1}, { 24, 1}, { 25, 1}, { 26, 1}, { 27, 1}, { 28, 1},
-{ 29, 1}, { 30, 1}, { 31, 1}, { 32, 1}, { 33, 1}, { 34, 1}, { 35, 1}, { 36, 1},
-{ 37, 1}
-},
-{
-{ 0, 1}, { 0, 2}, { 0, 3}, { 0, 4}, { 0, 5}, { 0, 6}, { 0, 7}, { 0, 8},
-{ 0, 9}, { 0, 10}, { 0, 11}, { 0, 12}, { 0, 13}, { 0, 14}, { 0, 15}, { 0, 16},
-{ 0, 17}, { 0, 18}, { 0, 19}, { 0, 20}, { 0, 21}, { 0, 22}, { 0, 23}, { 1, 1},
-{ 1, 2}, { 1, 3}, { 1, 4}, { 1, 5}, { 1, 6}, { 1, 7}, { 1, 8}, { 1, 9},
-{ 1, 10}, { 1, 11}, { 2, 1}, { 2, 2}, { 2, 3}, { 2, 4}, { 2, 5}, { 2, 6},
-{ 2, 7}, { 2, 8}, { 3, 1}, { 3, 2}, { 3, 3}, { 3, 4}, { 3, 5}, { 3, 6},
-{ 3, 7}, { 4, 1}, { 4, 2}, { 4, 3}, { 4, 4}, { 4, 5}, { 5, 1}, { 5, 2},
-{ 5, 3}, { 5, 4}, { 5, 5}, { 6, 1}, { 6, 2}, { 6, 3}, { 6, 4}, { 7, 1},
-{ 7, 2}, { 7, 3}, { 7, 4}, { 8, 1}, { 8, 2}, { 8, 3}, { 9, 1}, { 9, 2},
-{ 9, 3}, { 10, 1}, { 10, 2}, { 10, 3}, { 11, 1}, { 11, 2}, { 11, 3}, { 12, 1},
-{ 12, 2}, { 13, 1}, { 13, 2}, { 14, 1}, { 14, 2}, { 15, 1}, { 15, 2}, { 16, 1},
-{ 16, 2}, { 17, 1}, { 18, 1}, { 19, 1}, { 20, 1}, { 21, 1}, { 22, 1}, { 23, 1},
-{ 24, 1}, { 25, 1}, { 26, 1}, { 0, 1}, { 0, 2}, { 0, 3}, { 0, 4}, { 0, 5},
-{ 0, 6}, { 0, 7}, { 0, 8}, { 0, 9}, { 1, 1}, { 1, 2}, { 1, 3}, { 1, 4},
-{ 1, 5}, { 2, 1}, { 2, 2}, { 2, 3}, { 2, 4}, { 3, 1}, { 3, 2}, { 3, 3},
-{ 3, 4}, { 4, 1}, { 4, 2}, { 4, 3}, { 5, 1}, { 5, 2}, { 5, 3}, { 6, 1},
-{ 6, 2}, { 6, 3}, { 7, 1}, { 7, 2}, { 8, 1}, { 8, 2}, { 9, 1}, { 9, 2},
-{ 10, 1}, { 10, 2}, { 11, 1}, { 11, 2}, { 12, 1}, { 12, 2}, { 13, 1}, { 13, 2},
-{ 14, 1}, { 14, 2}, { 15, 1}, { 16, 1}, { 17, 1}, { 18, 1}, { 19, 1}, { 20, 1},
-{ 21, 1}, { 22, 1}, { 23, 1}, { 24, 1}, { 25, 1}, { 26, 1}, { 27, 1}, { 28, 1},
-{ 29, 1}, { 30, 1}, { 31, 1}, { 32, 1}, { 33, 1}, { 34, 1}, { 35, 1}, { 36, 1}
-},
-{
-{ 0, 1}, { 0, 2}, { 0, 3}, { 0, 4}, { 0, 5}, { 0, 6}, { 0, 7}, { 0, 8},
-{ 0, 9}, { 0, 10}, { 0, 11}, { 0, 12}, { 0, 13}, { 0, 14}, { 0, 15}, { 0, 16},
-{ 1, 1}, { 1, 2}, { 1, 3}, { 1, 4}, { 1, 5}, { 1, 6}, { 1, 7}, { 1, 8},
-{ 1, 9}, { 1, 10}, { 1, 11}, { 2, 1}, { 2, 2}, { 2, 3}, { 2, 4}, { 2, 5},
-{ 2, 6}, { 2, 7}, { 2, 8}, { 3, 1}, { 3, 2}, { 3, 3}, { 3, 4}, { 3, 5},
-{ 3, 6}, { 3, 7}, { 4, 1}, { 4, 2}, { 4, 3}, { 4, 4}, { 4, 5}, { 5, 1},
-{ 5, 2}, { 5, 3}, { 5, 4}, { 6, 1}, { 6, 2}, { 6, 3}, { 6, 4}, { 7, 1},
-{ 7, 2}, { 7, 3}, { 8, 1}, { 8, 2}, { 8, 3}, { 9, 1}, { 9, 2}, { 9, 3},
-{ 10, 1}, { 10, 2}, { 10, 3}, { 11, 1}, { 11, 2}, { 11, 3}, { 12, 1}, { 12, 2},
-{ 12, 3}, { 13, 1}, { 13, 2}, { 13, 3}, { 14, 1}, { 14, 2}, { 15, 1}, { 15, 2},
-{ 16, 1}, { 17, 1}, { 18, 1}, { 19, 1}, { 20, 1}, { 0, 1}, { 0, 2}, { 0, 3},
-{ 0, 4}, { 1, 1}, { 1, 2}, { 1, 3}, { 1, 4}, { 2, 1}, { 2, 2}, { 2, 3},
-{ 3, 1}, { 3, 2}, { 3, 3}, { 4, 1}, { 4, 2}, { 5, 1}, { 5, 2}, { 6, 1},
-{ 6, 2}, { 7, 1}, { 7, 2}, { 8, 1}, { 8, 2}, { 9, 1}, { 9, 2}, { 10, 1},
-{ 10, 2}, { 11, 1}, { 11, 2}, { 12, 1}, { 12, 2}, { 13, 1}, { 13, 2}, { 14, 1},
-{ 15, 1}, { 16, 1}, { 17, 1}, { 18, 1}, { 19, 1}, { 20, 1}, { 21, 1}, { 22, 1},
-{ 23, 1}, { 24, 1}, { 25, 1}, { 26, 1}
-},
-{
-{ 0, 1}, { 0, 2}, { 0, 3}, { 0, 4}, { 0, 5}, { 0, 6}, { 0, 7}, { 0, 8},
-{ 0, 9}, { 0, 10}, { 0, 11}, { 0, 12}, { 0, 13}, { 0, 14}, { 1, 1}, { 1, 2},
-{ 1, 3}, { 1, 4}, { 1, 5}, { 1, 6}, { 1, 7}, { 1, 8}, { 1, 9}, { 2, 1},
-{ 2, 2}, { 2, 3}, { 2, 4}, { 2, 5}, { 3, 1}, { 3, 2}, { 3, 3}, { 3, 4},
-{ 4, 1}, { 4, 2}, { 4, 3}, { 4, 4}, { 5, 1}, { 5, 2}, { 5, 3}, { 5, 4},
-{ 6, 1}, { 6, 2}, { 6, 3}, { 7, 1}, { 7, 2}, { 7, 3}, { 8, 1}, { 8, 2},
-{ 8, 3}, { 9, 1}, { 9, 2}, { 9, 3}, { 10, 1}, { 10, 2}, { 10, 3}, { 11, 1},
-{ 11, 2}, { 11, 3}, { 12, 1}, { 12, 2}, { 12, 3}, { 13, 1}, { 13, 2}, { 14, 1},
-{ 14, 2}, { 15, 1}, { 15, 2}, { 16, 1}, { 17, 1}, { 18, 1}, { 19, 1}, { 20, 1},
-{ 21, 1}, { 22, 1}, { 23, 1}, { 24, 1}, { 25, 1}, { 26, 1}, { 27, 1}, { 28, 1},
-{ 29, 1}, { 0, 1}, { 0, 2}, { 0, 3}, { 0, 4}, { 0, 5}, { 1, 1}, { 1, 2},
-{ 1, 3}, { 1, 4}, { 2, 1}, { 2, 2}, { 2, 3}, { 3, 1}, { 3, 2}, { 3, 3},
-{ 4, 1}, { 4, 2}, { 5, 1}, { 5, 2}, { 6, 1}, { 6, 2}, { 7, 1}, { 7, 2},
-{ 8, 1}, { 8, 2}, { 9, 1}, { 9, 2}, { 10, 1}, { 10, 2}, { 11, 1}, { 11, 2},
-{ 12, 1}, { 12, 2}, { 13, 1}, { 13, 2}, { 14, 1}, { 14, 2}, { 15, 1}, { 15, 2},
-{ 16, 1}, { 17, 1}, { 18, 1}, { 19, 1}, { 20, 1}, { 21, 1}, { 22, 1}, { 23, 1},
-{ 24, 1}, { 25, 1}, { 26, 1}, { 27, 1}, { 28, 1}, { 29, 1}, { 30, 1}, { 31, 1},
-{ 32, 1}, { 33, 1}, { 34, 1}, { 35, 1}, { 36, 1}, { 37, 1}, { 38, 1}, { 39, 1},
-{ 40, 1}, { 41, 1}, { 42, 1}, { 43, 1}
-},
-{
-{ 0, 1}, { 0, 2}, { 0, 3}, { 0, 4}, { 0, 5}, { 0, 6}, { 0, 7}, { 0, 8},
-{ 0, 9}, { 0, 10}, { 0, 11}, { 0, 12}, { 0, 13}, { 0, 14}, { 0, 15}, { 0, 16},
-{ 0, 17}, { 0, 18}, { 0, 19}, { 0, 20}, { 0, 21}, { 0, 22}, { 0, 23}, { 0, 24},
-{ 0, 25}, { 0, 26}, { 0, 27}, { 1, 1}, { 1, 2}, { 1, 3}, { 1, 4}, { 1, 5},
-{ 1, 6}, { 1, 7}, { 1, 8}, { 1, 9}, { 1, 10}, { 2, 1}, { 2, 2}, { 2, 3},
-{ 2, 4}, { 2, 5}, { 3, 1}, { 3, 2}, { 3, 3}, { 3, 4}, { 4, 1}, { 4, 2},
-{ 4, 3}, { 5, 1}, { 5, 2}, { 5, 3}, { 6, 1}, { 6, 2}, { 6, 3}, { 7, 1},
-{ 7, 2}, { 7, 3}, { 8, 1}, { 8, 2}, { 9, 1}, { 9, 2}, { 10, 1}, { 11, 1},
-{ 12, 1}, { 13, 1}, { 14, 1}, { 0, 1}, { 0, 2}, { 0, 3}, { 0, 4}, { 0, 5},
-{ 0, 6}, { 0, 7}, { 0, 8}, { 1, 1}, { 1, 2}, { 1, 3}, { 2, 1}, { 2, 2},
-{ 3, 1}, { 3, 2}, { 4, 1}, { 4, 2}, { 5, 1}, { 5, 2}, { 6, 1}, { 6, 2},
-{ 7, 1}, { 8, 1}, { 9, 1}, { 10, 1}, { 11, 1}, { 12, 1}, { 13, 1}, { 14, 1},
-{ 15, 1}, { 16, 1}, { 17, 1}, { 18, 1}, { 19, 1}, { 20, 1}
-},
-{
-{ 0, 1}, { 0, 2}, { 0, 3}, { 0, 4}, { 0, 5}, { 0, 6}, { 0, 7}, { 0, 8},
-{ 0, 9}, { 0, 10}, { 0, 11}, { 0, 12}, { 1, 1}, { 1, 2}, { 1, 3}, { 1, 4},
-{ 1, 5}, { 1, 6}, { 2, 1}, { 2, 2}, { 2, 3}, { 2, 4}, { 3, 1}, { 3, 2},
-{ 3, 3}, { 4, 1}, { 4, 2}, { 4, 3}, { 5, 1}, { 5, 2}, { 5, 3}, { 6, 1},
-{ 6, 2}, { 6, 3}, { 7, 1}, { 7, 2}, { 8, 1}, { 8, 2}, { 9, 1}, { 9, 2},
-{ 10, 1}, { 10, 2}, { 11, 1}, { 12, 1}, { 13, 1}, { 14, 1}, { 15, 1}, { 16, 1},
-{ 17, 1}, { 18, 1}, { 19, 1}, { 20, 1}, { 21, 1}, { 22, 1}, { 23, 1}, { 24, 1},
-{ 25, 1}, { 26, 1}, { 0, 1}, { 0, 2}, { 0, 3}, { 1, 1}, { 1, 2}, { 2, 1},
-{ 3, 1}, { 4, 1}, { 5, 1}, { 6, 1}, { 7, 1}, { 8, 1}, { 9, 1}, { 10, 1},
-{ 11, 1}, { 12, 1}, { 13, 1}, { 14, 1}, { 15, 1}, { 16, 1}, { 17, 1}, { 18, 1},
-{ 19, 1}, { 20, 1}, { 21, 1}, { 22, 1}, { 23, 1}, { 24, 1}, { 25, 1}, { 26, 1},
-{ 27, 1}, { 28, 1}, { 29, 1}, { 30, 1}, { 31, 1}, { 32, 1}, { 33, 1}, { 34, 1},
-{ 35, 1}, { 36, 1}, { 37, 1}, { 38, 1}, { 39, 1}, { 40, 1}
-},
-{
-{ 0, 1}, { 0, 2}, { 0, 3}, { 0, 4}, { 0, 5}, { 0, 6}, { 0, 7}, { 0, 8},
-{ 0, 9}, { 0, 10}, { 0, 11}, { 0, 12}, { 0, 13}, { 0, 14}, { 0, 15}, { 0, 16},
-{ 0, 17}, { 0, 18}, { 0, 19}, { 0, 20}, { 0, 21}, { 0, 22}, { 0, 23}, { 0, 24},
-{ 0, 25}, { 0, 26}, { 0, 27}, { 0, 28}, { 0, 29}, { 0, 30}, { 0, 31}, { 0, 32},
-{ 0, 33}, { 0, 34}, { 0, 35}, { 0, 36}, { 0, 37}, { 0, 38}, { 0, 39}, { 0, 40},
-{ 0, 41}, { 0, 42}, { 0, 43}, { 0, 44}, { 0, 45}, { 0, 46}, { 0, 47}, { 0, 48},
-{ 0, 49}, { 0, 50}, { 0, 51}, { 0, 52}, { 0, 53}, { 0, 54}, { 0, 55}, { 0, 56},
-{ 1, 1}, { 1, 2}, { 1, 3}, { 1, 4}, { 1, 5}, { 1, 6}, { 1, 7}, { 1, 8},
-{ 1, 9}, { 1, 10}, { 1, 11}, { 1, 12}, { 1, 13}, { 1, 14}, { 1, 15}, { 1, 16},
-{ 1, 17}, { 1, 18}, { 1, 19}, { 1, 20}, { 2, 1}, { 2, 2}, { 2, 3}, { 2, 4},
-{ 2, 5}, { 2, 6}, { 2, 7}, { 2, 8}, { 2, 9}, { 2, 10}, { 3, 1}, { 3, 2},
-{ 3, 3}, { 3, 4}, { 3, 5}, { 3, 6}, { 3, 7}, { 4, 1}, { 4, 2}, { 4, 3},
-{ 4, 4}, { 4, 5}, { 4, 6}, { 5, 1}, { 5, 2}, { 5, 3}, { 5, 4}, { 5, 5},
-{ 6, 1}, { 6, 2}, { 6, 3}, { 6, 4}, { 7, 1}, { 7, 2}, { 7, 3}, { 8, 1},
-{ 8, 2}, { 8, 3}, { 9, 1}, { 9, 2}, { 9, 3}, { 10, 1}, { 10, 2}, { 11, 1},
-{ 11, 2}, { 12, 1}, { 12, 2}, { 13, 1}, { 13, 2}, { 14, 1}, { 0, 1}, { 0, 2},
-{ 0, 3}, { 0, 4}, { 1, 1}, { 1, 2}, { 1, 3}, { 2, 1}, { 2, 2}, { 2, 3},
-{ 3, 1}, { 3, 2}, { 4, 1}, { 4, 2}, { 5, 1}, { 5, 2}, { 6, 1}, { 6, 2},
-{ 7, 1}, { 7, 2}, { 8, 1}, { 8, 2}, { 9, 1}, { 9, 2}, { 10, 1}, { 10, 2},
-{ 11, 1}, { 11, 2}, { 12, 1}, { 12, 2}, { 13, 1}, { 13, 2}, { 14, 1}, { 14, 2},
-{ 15, 1}, { 16, 1}
-},
-{
-{ 0, 1}, { 0, 2}, { 0, 3}, { 0, 4}, { 0, 5}, { 0, 6}, { 0, 7}, { 0, 8},
-{ 0, 9}, { 0, 10}, { 0, 11}, { 0, 12}, { 0, 13}, { 0, 14}, { 0, 15}, { 0, 16},
-{ 0, 17}, { 0, 18}, { 0, 19}, { 0, 20}, { 0, 21}, { 0, 22}, { 0, 23}, { 0, 24},
-{ 0, 25}, { 0, 26}, { 0, 27}, { 0, 28}, { 0, 29}, { 0, 30}, { 0, 31}, { 0, 32},
-{ 1, 1}, { 1, 2}, { 1, 3}, { 1, 4}, { 1, 5}, { 1, 6}, { 1, 7}, { 1, 8},
-{ 1, 9}, { 1, 10}, { 1, 11}, { 1, 12}, { 1, 13}, { 2, 1}, { 2, 2}, { 2, 3},
-{ 2, 4}, { 2, 5}, { 2, 6}, { 2, 7}, { 2, 8}, { 3, 1}, { 3, 2}, { 3, 3},
-{ 3, 4}, { 3, 5}, { 3, 6}, { 4, 1}, { 4, 2}, { 4, 3}, { 4, 4}, { 4, 5},
-{ 5, 1}, { 5, 2}, { 5, 3}, { 5, 4}, { 6, 1}, { 6, 2}, { 6, 3}, { 6, 4},
-{ 7, 1}, { 7, 2}, { 7, 3}, { 8, 1}, { 8, 2}, { 8, 3}, { 9, 1}, { 9, 2},
-{ 9, 3}, { 10, 1}, { 10, 2}, { 11, 1}, { 11, 2}, { 12, 1}, { 12, 2}, { 13, 1},
-{ 13, 2}, { 14, 1}, { 14, 2}, { 15, 1}, { 15, 2}, { 16, 1}, { 16, 2}, { 17, 1},
-{ 17, 2}, { 18, 1}, { 18, 2}, { 19, 1}, { 19, 2}, { 20, 1}, { 20, 2}, { 21, 1},
-{ 21, 2}, { 22, 1}, { 22, 2}, { 23, 1}, { 24, 1}, { 0, 1}, { 0, 2}, { 0, 3},
-{ 0, 4}, { 1, 1}, { 1, 2}, { 1, 3}, { 2, 1}, { 2, 2}, { 2, 3}, { 3, 1},
-{ 3, 2}, { 3, 3}, { 4, 1}, { 4, 2}, { 5, 1}, { 5, 2}, { 6, 1}, { 6, 2},
-{ 7, 1}, { 7, 2}, { 8, 1}, { 8, 2}, { 9, 1}, { 9, 2}, { 10, 1}, { 10, 2},
-{ 11, 1}, { 11, 2}, { 12, 1}, { 12, 2}, { 13, 1}, { 13, 2}, { 14, 1}, { 14, 2},
-{ 15, 1}, { 15, 2}, { 16, 1}, { 16, 2}, { 17, 1}, { 17, 2}, { 18, 1}, { 18, 2},
-{ 19, 1}, { 19, 2}, { 20, 1}, { 20, 2}, { 21, 1}, { 21, 2}, { 22, 1}, { 22, 2},
-{ 23, 1}, { 23, 2}, { 24, 1}, { 24, 2}, { 25, 1}, { 25, 2}, { 26, 1}, { 26, 2},
-{ 27, 1}, { 27, 2}, { 28, 1}, { 28, 2}, { 29, 1}, { 30, 1}
-}
-};
-
-static const uint8_t vc1_delta_level_table[AC_MODES][31] = {
-{
- 19, 15, 12, 11, 6, 5, 4, 4, 4, 4,
- 3, 3, 3, 3, 3, 3, 2, 2, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1
-},
-{
- 23, 11, 8, 7, 5, 5, 4, 4, 3, 3,
- 3, 3, 2, 2, 2, 2, 2, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1
-},
-{
- 16, 11, 8, 7, 5, 4, 4, 3, 3, 3,
- 3, 3, 3, 3, 2, 2, 1, 1, 1, 1,
- 1
-},
-{
- 14, 9, 5, 4, 4, 4, 3, 3, 3, 3,
- 3, 3, 3, 2, 2, 2, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1
-},
-{
- 27, 10, 5, 4, 3, 3, 3, 3, 2, 2,
- 1, 1, 1, 1, 1
-},
-{
- 12, 6, 4, 3, 3, 3, 3, 2, 2, 2,
- 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1
-},
-{
- 56, 20, 10, 7, 6, 5, 4, 3, 3, 3,
- 2, 2, 2, 2, 1
-},
-{
- 32, 13, 8, 6, 5, 4, 4, 3, 3, 3,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 1, 1
-}
-};
-
-static const uint8_t vc1_last_delta_level_table[AC_MODES][44] = {
-{
- 6, 5, 4, 4, 3, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1
-},
-{
- 9, 5, 4, 4, 3, 3, 3, 2, 2, 2,
- 2, 2, 2, 2, 2, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1
-},
-{
- 4, 4, 3, 3, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1
-},
-{
- 5, 4, 3, 3, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1
-},
-{
- 8, 3, 2, 2, 2, 2, 2, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1
-},
-{
- 3, 2, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1
-},
-{
- 4, 3, 3, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 1, 1
-},
-{
- 4, 3, 3, 3, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 1,
- 1
-}
-};
-
-static const uint8_t vc1_delta_run_table[AC_MODES][57] = {
-{
- -1, 30, 17, 15, 9, 5, 4, 3, 3, 3,
- 3, 3, 2, 1, 1, 1, 0, 0, 0,
- 0
-},
-{
- -1, 26, 16, 11, 7, 5, 3, 3, 2, 1,
- 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0
-},
-{
- -1, 20, 15, 13, 6, 4, 3, 3, 2, 1,
- 1, 1, 0, 0, 0, 0, 0
-},
-{
- -1, 29, 15, 12, 5, 2, 1, 1, 1, 1,
- 0, 0, 0, 0, 0
-},
-{
- -1, 14, 9, 7, 3, 2, 1, 1, 1, 1,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0
-},
-{
- -1, 26, 10, 6, 2, 1, 1, 0, 0, 0,
- 0, 0, 0
-},
-{
- -1, 14, 13, 9, 6, 5, 4, 3, 2, 2,
- 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0
-},
-{
- -1, 24, 22, 9, 6, 4, 3, 2, 2, 1,
- 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0
-}
-};
-
-static const uint8_t vc1_last_delta_run_table[AC_MODES][10] = {
-{
- -1, 37, 15, 4, 3, 1, 0
-},
-{
- -1, 36, 14, 6, 3, 1, 0, 0, 0,
- 0
-},
-{
- -1, 26, 13, 3, 1
-},
-{
- -1, 43, 15, 3, 1, 0
-},
-{
- -1, 20, 6, 1, 0, 0, 0, 0, 0
-},
-{
- -1, 40, 1, 0
-},
-{
- -1, 16, 14, 2, 0
-},
-{
- -1, 30, 28, 3, 0
-}
-};
diff --git a/src/libffmpeg/libavcodec/vc1data.h b/src/libffmpeg/libavcodec/vc1data.h
deleted file mode 100644
index 70e88b525..000000000
--- a/src/libffmpeg/libavcodec/vc1data.h
+++ /dev/null
@@ -1,652 +0,0 @@
-/*
- * VC-1 and WMV3 decoder
- * copyright (c) 2006 Konstantin Shishkov
- * (c) 2005 anonymous, Alex Beregszaszi, Michael Niedermayer
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file vc1data.h
- * VC-1 tables.
- */
-
-#ifndef VC1DATA_H
-#define VC1DATA_H
-
-#if 0 //original bfraction from vc9data.h, not conforming to standard
-/* Denominator used for vc1_bfraction_lut */
-#define B_FRACTION_DEN 840
-
-/* bfraction is fractional, we scale to the GCD 3*5*7*8 = 840 */
-const int16_t vc1_bfraction_lut[23] = {
- 420 /*1/2*/, 280 /*1/3*/, 560 /*2/3*/, 210 /*1/4*/,
- 630 /*3/4*/, 168 /*1/5*/, 336 /*2/5*/,
- 504 /*3/5*/, 672 /*4/5*/, 140 /*1/6*/, 700 /*5/6*/,
- 120 /*1/7*/, 240 /*2/7*/, 360 /*3/7*/, 480 /*4/7*/,
- 600 /*5/7*/, 720 /*6/7*/, 105 /*1/8*/, 315 /*3/8*/,
- 525 /*5/8*/, 735 /*7/8*/,
- -1 /*inv.*/, 0 /*BI fm*/
-};
-#else
-/* Denominator used for vc1_bfraction_lut */
-#define B_FRACTION_DEN 256
-
-/* pre-computed scales for all bfractions and base=256 */
-static const int16_t vc1_bfraction_lut[23] = {
- 128 /*1/2*/, 85 /*1/3*/, 170 /*2/3*/, 64 /*1/4*/,
- 192 /*3/4*/, 51 /*1/5*/, 102 /*2/5*/,
- 153 /*3/5*/, 204 /*4/5*/, 43 /*1/6*/, 215 /*5/6*/,
- 37 /*1/7*/, 74 /*2/7*/, 111 /*3/7*/, 148 /*4/7*/,
- 185 /*5/7*/, 222 /*6/7*/, 32 /*1/8*/, 96 /*3/8*/,
- 160 /*5/8*/, 224 /*7/8*/,
- -1 /*inv.*/, 0 /*BI fm*/
-};
-#endif
-
-static const uint8_t vc1_bfraction_bits[23] = {
- 3, 3, 3, 3,
- 3, 3, 3,
- 7, 7, 7, 7,
- 7, 7, 7, 7,
- 7, 7, 7, 7,
- 7, 7,
- 7, 7
-};
-static const uint8_t vc1_bfraction_codes[23] = {
- 0, 1, 2, 3,
- 4, 5, 6,
- 112, 113, 114, 115,
- 116, 117, 118, 119,
- 120, 121, 122, 123,
- 124, 125,
- 126, 127
-};
-
-//Same as H.264
-static const AVRational vc1_pixel_aspect[16]={
- {0, 1},
- {1, 1},
- {12, 11},
- {10, 11},
- {16, 11},
- {40, 33},
- {24, 11},
- {20, 11},
- {32, 11},
- {80, 33},
- {18, 11},
- {15, 11},
- {64, 33},
- {160, 99},
- {0, 1},
- {0, 1}
-};
-
-/* BitPlane IMODE - such a small table... */
-static const uint8_t vc1_imode_codes[7] = {
- 0, 2, 1, 3, 1, 2, 3
-};
-static const uint8_t vc1_imode_bits[7] = {
- 4, 2, 3, 2, 4, 3, 3
-};
-
-/* Normal-2 imode */
-static const uint8_t vc1_norm2_codes[4] = {
- 0, 4, 5, 3
-};
-static const uint8_t vc1_norm2_bits[4] = {
- 1, 3, 3, 2
-};
-
-static const uint16_t vc1_norm6_codes[64] = {
-0x001, 0x002, 0x003, 0x000, 0x004, 0x001, 0x002, 0x047, 0x005, 0x003, 0x004, 0x04B, 0x005, 0x04D, 0x04E, 0x30E,
-0x006, 0x006, 0x007, 0x053, 0x008, 0x055, 0x056, 0x30D, 0x009, 0x059, 0x05A, 0x30C, 0x05C, 0x30B, 0x30A, 0x037,
-0x007, 0x00A, 0x00B, 0x043, 0x00C, 0x045, 0x046, 0x309, 0x00D, 0x049, 0x04A, 0x308, 0x04C, 0x307, 0x306, 0x036,
-0x00E, 0x051, 0x052, 0x305, 0x054, 0x304, 0x303, 0x035, 0x058, 0x302, 0x301, 0x034, 0x300, 0x033, 0x032, 0x007,
-};
-
-static const uint8_t vc1_norm6_bits[64] = {
- 1, 4, 4, 8, 4, 8, 8, 10, 4, 8, 8, 10, 8, 10, 10, 13,
- 4, 8, 8, 10, 8, 10, 10, 13, 8, 10, 10, 13, 10, 13, 13, 9,
- 4, 8, 8, 10, 8, 10, 10, 13, 8, 10, 10, 13, 10, 13, 13, 9,
- 8, 10, 10, 13, 10, 13, 13, 9, 10, 13, 13, 9, 13, 9, 9, 6,
-};
-/* Normal-6 imode */
-static const uint8_t vc1_norm6_spec[64][5] = {
-{ 0, 1, 1 },
-{ 1, 2, 4 },
-{ 2, 3, 4 },
-{ 3, 0, 8 },
-{ 4, 4, 4 },
-{ 5, 1, 8 },
-{ 6, 2, 8 },
-{ 7, 2, 5, 7, 5 },
-{ 8, 5, 4 },
-{ 9, 3, 8 },
-{10, 4, 8 },
-{11, 2, 5, 11, 5 },
-{12, 5, 8 },
-{13, 2, 5, 13, 5 },
-{14, 2, 5, 14, 5 },
-{15, 3, 5, 14, 8 },
-{16, 6, 4 },
-{17, 6, 8 },
-{18, 7, 8 },
-{19, 2, 5, 19, 5 },
-{20, 8, 8 },
-{21, 2, 5, 21, 5 },
-{22, 2, 5, 22, 5 },
-{23, 3, 5, 13, 8 },
-{24, 9, 8 },
-{25, 2, 5, 25, 5 },
-{26, 2, 5, 26, 5 },
-{27, 3, 5, 12, 8 },
-{28, 2, 5, 28, 5 },
-{29, 3, 5, 11, 8 },
-{30, 3, 5, 10, 8 },
-{31, 3, 5, 7, 4 },
-{32, 7, 4 },
-{33, 10, 8 },
-{34, 11, 8 },
-{35, 2, 5, 3, 5 },
-{36, 12, 8 },
-{37, 2, 5, 5, 5 },
-{38, 2, 5, 6, 5 },
-{39, 3, 5, 9, 8 },
-{40, 13, 8 },
-{41, 2, 5, 9, 5 },
-{42, 2, 5, 10, 5 },
-{43, 3, 5, 8, 8 },
-{44, 2, 5, 12, 5 },
-{45, 3, 5, 7, 8 },
-{46, 3, 5, 6, 8 },
-{47, 3, 5, 6, 4 },
-{48, 14, 8 },
-{49, 2, 5, 17, 5 },
-{50, 2, 5, 18, 5 },
-{51, 3, 5, 5, 8 },
-{52, 2, 5, 20, 5 },
-{53, 3, 5, 4, 8 },
-{54, 3, 5, 3, 8 },
-{55, 3, 5, 5, 4 },
-{56, 2, 5, 24, 5 },
-{57, 3, 5, 2, 8 },
-{58, 3, 5, 1, 8 },
-{59, 3, 5, 4, 4 },
-{60, 3, 5, 0, 8 },
-{61, 3, 5, 3, 4 },
-{62, 3, 5, 2, 4 },
-{63, 3, 5, 1, 1 },
-};
-
-/* 4MV Block pattern VLC tables */
-static const uint8_t vc1_4mv_block_pattern_codes[4][16] = {
- { 14, 58, 59, 25, 12, 26, 15, 15, 13, 24, 27, 0, 28, 1, 2, 2},
- { 8, 18, 19, 4, 20, 5, 30, 11, 21, 31, 6, 12, 7, 13, 14, 0},
- { 15, 6, 7, 2, 8, 3, 28, 9, 10, 29, 4, 11, 5, 12, 13, 0},
- { 0, 11, 12, 4, 13, 5, 30, 16, 14, 31, 6, 17, 7, 18, 19, 19}
-};
-static const uint8_t vc1_4mv_block_pattern_bits[4][16] = {
- { 5, 6, 6, 5, 5, 5, 5, 4, 5, 5, 5, 3, 5, 3, 3, 2},
- { 4, 5, 5, 4, 5, 4, 5, 4, 5, 5, 4, 4, 4, 4, 4, 2},
- { 4, 4, 4, 4, 4, 4, 5, 4, 4, 5, 4, 4, 4, 4, 4, 3},
- { 2, 4, 4, 4, 4, 4, 5, 5, 4, 5, 4, 5, 4, 5, 5, 4}
-};
-
-const uint8_t wmv3_dc_scale_table[32]={
- 0, 2, 4, 8, 8, 8, 9, 9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21
-};
-
-/* P-Picture CBPCY VLC tables */
-#if 1 // Looks like original tables are not conforming to standard at all. Are they used for old WMV?
-static const uint16_t vc1_cbpcy_p_codes[4][64] = {
- {
- 0, 6, 15, 13, 13, 11, 3, 13, 5, 8, 49, 10, 12, 114, 102, 119,
- 1, 54, 96, 8, 10, 111, 5, 15, 12, 10, 2, 12, 13, 115, 53, 63,
- 1, 7, 1, 7, 14, 12, 4, 14, 1, 9, 97, 11, 7, 58, 52, 62,
- 4, 103, 1, 9, 11, 56, 101, 118, 4, 110, 100, 30, 2, 5, 4, 3
- },
- {
- 0, 9, 1, 18, 5, 14, 237, 26, 3, 121, 3, 22, 13, 16, 6, 30,
- 2, 10, 1, 20, 12, 241, 5, 28, 16, 12, 3, 24, 28, 124, 239, 247,
- 1, 240, 1, 19, 18, 15, 4, 27, 1, 122, 2, 23, 1, 17, 7, 31,
- 1, 11, 2, 21, 19, 246, 238, 29, 17, 13, 236, 25, 58, 63, 8, 125
- },
- {
- 0, 201, 25, 231, 5, 221, 1, 3, 2, 414, 2, 241, 16, 225, 195, 492,
- 2, 412, 1, 240, 7, 224, 98, 245, 1, 220, 96, 5, 9, 230, 101, 247,
- 1, 102, 1, 415, 24, 3, 2, 244, 3, 54, 3, 484, 17, 114, 200, 493,
- 3, 413, 1, 4, 13, 113, 99, 485, 4, 111, 194, 243, 5, 29, 26, 31
- },
- {
- 0, 28, 12, 44, 3, 36, 20, 52, 2, 32, 16, 48, 8, 40, 24, 28,
- 1, 30, 14, 46, 6, 38, 22, 54, 3, 34, 18, 50, 10, 42, 26, 30,
- 1, 29, 13, 45, 5, 37, 21, 53, 2, 33, 17, 49, 9, 41, 25, 29,
- 1, 31, 15, 47, 7, 39, 23, 55, 4, 35, 19, 51, 11, 43, 27, 31
- }
-};
-
-static const uint8_t vc1_cbpcy_p_bits[4][64] = {
- {
- 13, 13, 7, 13, 7, 13, 13, 12, 6, 13, 7, 12, 6, 8, 8, 8,
- 5, 7, 8, 12, 6, 8, 13, 12, 7, 13, 13, 12, 6, 8, 7, 7,
- 6, 13, 8, 12, 7, 13, 13, 12, 7, 13, 8, 12, 5, 7, 7, 7,
- 6, 8, 13, 12, 6, 7, 8, 8, 5, 8, 8, 6, 3, 3, 3, 2
- },
- {
- 14, 13, 8, 13, 3, 13, 8, 13, 3, 7, 8, 13, 4, 13, 13, 13,
- 3, 13, 13, 13, 4, 8, 13, 13, 5, 13, 13, 13, 5, 7, 8, 8,
- 3, 8, 14, 13, 5, 13, 13, 13, 4, 7, 13, 13, 6, 13, 13, 13,
- 5, 13, 8, 13, 5, 8, 8, 13, 5, 13, 8, 13, 6, 6, 13, 7
- },
- {
- 13, 8, 6, 8, 4, 8, 13, 12, 4, 9, 8, 8, 5, 8, 8, 9,
- 5, 9, 10, 8, 4, 8, 7, 8, 6, 8, 7, 13, 4, 8, 7, 8,
- 5, 7, 8, 9, 6, 13, 13, 8, 4, 6, 8, 9, 5, 7, 8, 9,
- 5, 9, 9, 13, 5, 7, 7, 9, 4, 7, 8, 8, 3, 5, 5, 5
- },
- {
- 9, 9, 9, 9, 2, 9, 9, 9, 2, 9, 9, 9, 9, 9, 9, 8,
- 3, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8,
- 2, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8
- }
-};
-#else
-static const uint16_t vc1_cbpcy_p_codes[4][64] = {
- {
- 0, 1, 1, 4, 5, 1, 12, 4, 13, 14, 10, 11, 12, 7, 13, 2,
- 15, 1, 96, 1, 49, 97, 2, 100, 3, 4, 5, 101, 102, 52, 53, 4,
- 6, 7, 54, 103, 8, 9, 10, 110, 11, 12, 111, 56, 114, 58, 115, 5,
- 13, 7, 8, 9, 10, 11, 12, 30, 13, 14, 15, 118, 119, 62, 63, 3
- },
- {
- 0, 1, 2, 1, 3, 1, 16, 17, 5, 18, 12, 19, 13, 1, 28, 58,
- 1, 1, 1, 2, 3, 2, 3, 236, 237, 4, 5, 238, 6, 7, 239, 8,
- 9, 240, 10, 11, 121, 122, 12, 13, 14, 15, 241, 246, 16, 17, 124, 63,
- 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 247, 125
- },
- {
- 0, 1, 2, 3, 2, 3, 1, 4, 5, 24, 7, 13, 16, 17, 9, 5,
- 25, 1, 1, 1, 2, 3, 96, 194, 1, 2, 98, 99, 195, 200, 101, 26,
- 201, 102, 412, 413, 414, 54, 220, 111, 221, 3, 224, 113, 225, 114, 230, 29,
- 231, 415, 240, 4, 241, 484, 5, 243, 3, 244, 245, 485, 492, 493, 247, 31
- },
- {
- 0, 1, 1, 1, 2, 2, 3, 4, 3, 5, 6, 7, 8, 9, 10, 11,
- 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
- 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
- 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 28, 29, 30, 31
- }
-};
-static const uint8_t vc1_cbpcy_p_bits[4][64] = {
- {
- 13, 6, 5, 6, 6, 7, 7, 5, 7, 7, 6, 6, 6, 5, 6, 3,
- 7, 8, 8, 13, 7, 8, 13, 8, 13, 13, 13, 8, 8, 7, 7, 3,
- 13, 13, 7, 8, 13, 13, 13, 8, 13, 13, 8, 7, 8, 7, 8, 3,
- 13, 12, 12, 12, 12, 12, 12, 6, 12, 12, 12, 8, 8, 7, 7, 2
- },
- {
- 14, 3, 3, 5, 3, 4, 5, 5, 3, 5, 4, 5, 4, 6, 5, 6,
- 8, 14, 13, 8, 8, 13, 13, 8, 8, 13, 13, 8, 13, 13, 8, 13,
- 13, 8, 13, 13, 7, 7, 13, 13, 13, 13, 8, 8, 13, 13, 7, 6,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 8, 7
- },
- {
- 13, 5, 5, 5, 4, 4, 6, 4, 4, 6, 4, 5, 5, 5, 4, 3,
- 6, 8, 10, 9, 8, 8, 7, 8, 13, 13, 7, 7, 8, 8, 7, 5,
- 8, 7, 9, 9, 9, 6, 8, 7, 8, 13, 8, 7, 8, 7, 8, 5,
- 8, 9, 8, 13, 8, 9, 13, 8, 12, 8, 8, 9, 9, 9, 8, 5
- },
- {
- 9, 2, 3, 9, 2, 9, 9, 9, 2, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8
- }
-};
-#endif
-
-/* MacroBlock Transform Type: 7.1.3.11, p89
- * 8x8:B
- * 8x4:B:btm 8x4:B:top 8x4:B:both,
- * 4x8:B:right 4x8:B:left 4x8:B:both
- * 4x4:B 8x8:MB
- * 8x4:MB:btm 8x4:MB:top 8x4,MB,both
- * 4x8,MB,right 4x8,MB,left
- * 4x4,MB */
-static const uint16_t vc1_ttmb_codes[3][16] = {
- {
- 0x0003,
- 0x002E, 0x005F, 0x0000,
- 0x0016, 0x0015, 0x0001,
- 0x0004, 0x0014,
- 0x02F1, 0x0179, 0x017B,
- 0x0BC0, 0x0BC1, 0x05E1,
- 0x017A
- },
- {
- 0x0006,
- 0x0006, 0x0003, 0x0007,
- 0x000F, 0x000E, 0x0000,
- 0x0002, 0x0002,
- 0x0014, 0x0011, 0x000B,
- 0x0009, 0x0021, 0x0015,
- 0x0020
- },
- {
- 0x0006,
- 0x0000, 0x000E, 0x0005,
- 0x0002, 0x0003, 0x0003,
- 0x000F, 0x0002,
- 0x0081, 0x0021, 0x0009,
- 0x0101, 0x0041, 0x0011,
- 0x0100
- }
-};
-
-static const uint8_t vc1_ttmb_bits[3][16] = {
- {
- 2,
- 6, 7, 2,
- 5, 5, 2,
- 3, 5,
- 10, 9, 9,
- 12, 12, 11,
- 9
- },
- {
- 3,
- 4, 4, 4,
- 4, 4, 3,
- 3, 2,
- 7, 7, 6,
- 6, 8, 7,
- 8
- },
- {
- 3,
- 3, 4, 5,
- 3, 3, 4,
- 4, 2,
- 10, 8, 6,
- 11, 9, 7,
- 11
- }
-};
-
-/* TTBLK (Transform Type per Block) tables */
-static const uint8_t vc1_ttblk_codes[3][8] = {
- { 0, 1, 3, 5, 16, 17, 18, 19},
- { 3, 0, 1, 2, 3, 5, 8, 9},
- { 1, 0, 1, 4, 6, 7, 10, 11}
-};
-static const uint8_t vc1_ttblk_bits[3][8] = {
- { 2, 2, 2, 3, 5, 5, 5, 5},
- { 2, 3, 3, 3, 3, 3, 4, 4},
- { 2, 3, 3, 3, 3, 3, 4, 4}
-};
-
-/* SUBBLKPAT tables, p93-94, reordered */
-static const uint8_t vc1_subblkpat_codes[3][15] = {
- { 14, 12, 7, 11, 9, 26, 2, 10, 27, 8, 0, 6, 1, 15, 1},
- { 14, 0, 8, 15, 10, 4, 23, 13, 5, 9, 25, 3, 24, 22, 1},
- { 5, 6, 2, 2, 8, 0, 28, 3, 1, 3, 29, 1, 19, 18, 15}
-};
-static const uint8_t vc1_subblkpat_bits[3][15] = {
- { 5, 5, 5, 5, 5, 6, 4, 5, 6, 5, 4, 5, 4, 5, 1},
- { 4, 3, 4, 4, 4, 5, 5, 4, 5, 4, 5, 4, 5, 5, 2},
- { 3, 3, 4, 3, 4, 5, 5, 3, 5, 4, 5, 4, 5, 5, 4}
-};
-
-/* MV differential tables, p265 */
-static const uint16_t vc1_mv_diff_codes[4][73] = {
- {
- 0, 2, 3, 8, 576, 3, 2, 6,
- 5, 577, 578, 7, 8, 9, 40, 19,
- 37, 82, 21, 22, 23, 579, 580, 166,
- 96, 167, 49, 194, 195, 581, 582, 583,
- 292, 293, 294, 13, 2, 7, 24, 50,
- 102, 295, 13, 7, 8, 18, 50, 103,
- 38, 20, 21, 22, 39, 204, 103, 23,
- 24, 25, 104, 410, 105, 106, 107, 108,
- 109, 220, 411, 442, 222, 443, 446, 447,
- 7 /* 73 elements */
- },
- {
- 0, 4, 5, 3, 4, 3, 4, 5,
- 20, 6, 21, 44, 45, 46, 3008, 95,
- 112, 113, 57, 3009, 3010, 116, 117, 3011,
- 118, 3012, 3013, 3014, 3015, 3016, 3017, 3018,
- 3019, 3020, 3021, 3022, 1, 4, 15, 160,
- 161, 41, 6, 11, 42, 162, 43, 119,
- 56, 57, 58, 163, 236, 237, 3023, 119,
- 120, 242, 122, 486, 1512, 487, 246, 494,
- 1513, 495, 1514, 1515, 1516, 1517, 1518, 1519,
- 31 /* 73 elements */
- },
- {
- 0, 512, 513, 514, 515, 2, 3, 258,
- 259, 260, 261, 262, 263, 264, 265, 266,
- 267, 268, 269, 270, 271, 272, 273, 274,
- 275, 276, 277, 278, 279, 280, 281, 282,
- 283, 284, 285, 286, 1, 5, 287, 288,
- 289, 290, 6, 7, 291, 292, 293, 294,
- 295, 296, 297, 298, 299, 300, 301, 302,
- 303, 304, 305, 306, 307, 308, 309, 310,
- 311, 312, 313, 314, 315, 316, 317, 318,
- 319 /* 73 elements */
- },
- {
- 0, 1, 1, 2, 3, 4, 1, 5,
- 4, 3, 5, 8, 6, 9, 10, 11,
- 12, 7, 104, 14, 105, 4, 10, 15,
- 11, 6, 14, 8, 106, 107, 108, 15,
- 109, 9, 55, 10, 1, 2, 1, 2,
- 3, 12, 6, 2, 6, 7, 28, 7,
- 15, 8, 5, 18, 29, 152, 77, 24,
- 25, 26, 39, 108, 13, 109, 55, 56,
- 57, 116, 11, 153, 234, 235, 118, 119,
- 15 /* 73 elements */
- }
-};
-static const uint8_t vc1_mv_diff_bits[4][73] = {
- {
- 6, 7, 7, 8, 14, 6, 5, 6, 7, 14, 14, 6, 6, 6, 8, 9,
- 10, 9, 7, 7, 7, 14, 14, 10, 9, 10, 8, 10, 10, 14, 14, 14,
- 13, 13, 13, 6, 3, 5, 6, 8, 9, 13, 5, 4, 4, 5, 7, 9,
- 6, 5, 5, 5, 6, 9, 8, 5, 5, 5, 7, 10, 7, 7, 7, 7,
- 7, 8, 10, 9, 8, 9, 9, 9, 3 /* 73 elements */
- },
- {
- 5, 7, 7, 6, 6, 5, 5, 6, 7, 5, 7, 8, 8, 8, 14, 9,
- 9, 9, 8, 14, 14, 9, 9, 14, 9, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 2, 3, 6, 8, 8, 6, 3, 4, 6, 8, 6, 9,
- 6, 6, 6, 8, 8, 8, 14, 7, 7, 8, 7, 9, 13, 9, 8, 9,
- 13, 9, 13, 13, 13, 13, 13, 13, 5 /* 73 elements */
-
- },
- {
- 3, 12, 12, 12, 12, 3, 4, 11, 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 1, 5, 11, 11, 11, 11, 4, 4, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11, 11 /* 73 elements */
- },
- {
- 15, 11, 15, 15, 15, 15, 12, 15, 12, 11, 12, 12, 15, 12, 12, 12,
- 12, 15, 15, 12, 15, 10, 11, 12, 11, 10, 11, 10, 15, 15, 15, 11,
- 15, 10, 14, 10, 4, 4, 5, 7, 8, 9, 5, 3, 4, 5, 6, 8,
- 5, 4, 3, 5, 6, 8, 7, 5, 5, 5, 6, 7, 9, 7, 6, 6,
- 6, 7, 10, 8, 8, 8, 7, 7, 4 /* 73 elements */
- }
-};
-
-/* DC differentials low+hi-mo, p217 are the same as in msmpeg4data .h */
-
-/* Scantables/ZZ scan are at 11.9 (p262) and 8.1.1.12 (p10) */
-static const int8_t vc1_normal_zz[64] = {
- 0, 8, 1, 2, 9, 16, 24, 17,
- 10, 3, 4, 11, 18, 25, 32, 40,
- 33, 48, 26, 19, 12, 5, 6, 13,
- 20, 27, 34, 41, 56, 49, 57, 42,
- 35, 28, 21, 14, 7, 15, 22, 29,
- 36, 43, 50, 58, 51, 59, 44, 37,
- 30, 23, 31, 38, 45, 52, 60, 53,
- 61, 46, 39, 47, 54, 62, 55, 63
-};
-
-static const int8_t vc1_horizontal_zz [64] = /* Table 227 */
-{
- 0, 1, 8, 2, 3, 9, 16, 24,
- 17, 10, 4, 5, 11, 18, 25, 32,
- 40, 48, 33, 26, 19, 12, 6, 7,
- 13, 20, 27, 34, 41, 56, 49, 57,
- 42, 35, 28, 21, 14, 15, 22, 29,
- 36, 43, 50, 58, 51, 44, 37, 30,
- 23, 31, 38, 45, 52, 59, 60, 53,
- 46, 39, 47, 54, 61, 62, 55, 63
-};
-
-static const int8_t vc1_vertical_zz [64] = /* Table 228 */
-{
- 0, 8, 16, 1, 24, 32, 40, 9,
- 2, 3, 10, 17, 25, 48, 56, 41,
- 33, 26, 18, 11, 4, 5, 12, 19,
- 27, 34, 49, 57, 50, 42, 35, 28,
- 20, 13, 6, 7, 14, 21, 29, 36,
- 43, 51, 58, 59, 52, 44, 37, 30,
- 22, 15, 23, 31, 38, 45, 60, 53,
- 46, 39, 47, 54, 61, 62, 55, 63
-};
-
-static const int8_t vc1_simple_progressive_8x8_zz [64] =
-/* Table 229 */
-{
- 0, 8, 1, 2, 9, 16, 24, 17,
- 10, 3, 4, 11, 18, 25, 32, 40,
- 48, 56, 41, 33, 26, 19, 12, 5,
- 6, 13, 20, 27, 34, 49, 57, 58,
- 50, 42, 35, 28, 21, 14, 7, 15,
- 22, 29, 36, 43, 51, 59, 60, 52,
- 44, 37, 30, 23, 31, 38, 45, 53,
- 61, 62, 54, 46, 39, 47, 55, 63
-};
-
-static const int8_t vc1_simple_progressive_8x4_zz [32] = /* Table 230 */
-{
- 0, 1, 2, 8, 3, 9, 10, 16,
- 4, 11, 17, 24, 18, 12, 5, 19,
- 25, 13, 20, 26, 27, 6, 21, 28,
- 14, 22, 29, 7, 30, 15, 23, 31
-};
-
-static const int8_t vc1_simple_progressive_4x8_zz [32] = /* Table 231 */
-{
- 0, 8, 1, 16,
- 9, 24, 17, 2,
- 32, 10, 25, 40,
- 18, 48, 33, 26,
- 56, 41, 34, 3,
- 49, 57, 11, 42,
- 19, 50, 27, 58,
- 35, 43, 51, 59
-};
-
-/* Table 232 */
-static const int8_t vc1_simple_progressive_4x4_zz [16] =
-{
- 0, 8, 16, 1,
- 9, 24, 17, 2,
- 10, 18, 25, 3,
- 11, 26, 19, 27
-};
-
-static const int8_t vc1_adv_progressive_8x4_zz [32] = /* Table 233 */
-{
- 0, 8, 1, 16, 2, 9, 10, 3,
- 24, 17, 4, 11, 18, 12, 5, 19,
- 25, 13, 20, 26, 27, 6, 21, 28,
- 14, 22, 29, 7, 30, 15, 23, 31
-};
-
-static const int8_t vc1_adv_progressive_4x8_zz [32] = /* Table 234 */
-{
- 0, 1, 8, 2,
- 9, 16, 17, 24,
- 10, 32, 25, 18,
- 40, 3, 33, 26,
- 48, 11, 56, 41,
- 34, 49, 57, 42,
- 19, 50, 27, 58,
- 35, 43, 51, 59
-};
-
-static const int8_t vc1_adv_interlaced_8x8_zz [64] = /* Table 235 */
-{
- 0, 8, 1, 16, 24, 9, 2, 32,
- 40, 48, 56, 17, 10, 3, 25, 18,
- 11, 4, 33, 41, 49, 57, 26, 34,
- 42, 50, 58, 19, 12, 5, 27, 20,
- 13, 6, 35, 28, 21, 14, 7, 15,
- 22, 29, 36, 43, 51, 59, 60, 52,
- 44, 37, 30, 23, 31, 38, 45, 53,
- 61, 62, 54, 46, 39, 47, 55, 63
-};
-
-static const int8_t vc1_adv_interlaced_8x4_zz [32] = /* Table 236 */
-{
- 0, 8, 16, 24, 1, 9, 2, 17,
- 25, 10, 3, 18, 26, 4, 11, 19,
- 12, 5, 13, 20, 27, 6, 21, 28,
- 14, 22, 29, 7, 30, 15, 23, 31
-};
-
-static const int8_t vc1_adv_interlaced_4x8_zz [32] = /* Table 237 */
-{
- 0, 1, 2, 8,
- 16, 9, 24, 17,
- 10, 3, 32, 40,
- 48, 56, 25, 18,
- 33, 26, 41, 34,
- 49, 57, 11, 42,
- 19, 50, 27, 58,
- 35, 43, 51, 59
-};
-
-static const int8_t vc1_adv_interlaced_4x4_zz [16] = /* Table 238 */
-{
- 0, 8, 16, 24,
- 1, 9, 17, 2,
- 25, 10, 18, 3,
- 26, 11, 19, 27
-};
-
-
-/* DQScale as specified in 8.1.3.9 - almost identical to 0x40000/i */
-static const int32_t vc1_dqscale[63] = {
-0x40000, 0x20000, 0x15555, 0x10000, 0xCCCD, 0xAAAB, 0x9249, 0x8000,
- 0x71C7, 0x6666, 0x5D17, 0x5555, 0x4EC5, 0x4925, 0x4444, 0x4000,
- 0x3C3C, 0x38E4, 0x35E5, 0x3333, 0x30C3, 0x2E8C, 0x2C86, 0x2AAB,
- 0x28F6, 0x2762, 0x25ED, 0x2492, 0x234F, 0x2222, 0x2108, 0x2000,
- 0x1F08, 0x1E1E, 0x1D42, 0x1C72, 0x1BAD, 0x1AF3, 0x1A42, 0x199A,
- 0x18FA, 0x1862, 0x17D0, 0x1746, 0x16C1, 0x1643, 0x15CA, 0x1555,
- 0x14E6, 0x147B, 0x1414, 0x13B1, 0x1352, 0x12F7, 0x129E, 0x1249,
- 0x11F7, 0x11A8, 0x115B, 0x1111, 0x10C9, 0x1084, 0x1000
-};
-#endif /* VC1DATA_H */
diff --git a/src/libffmpeg/libavcodec/vc1dsp.c b/src/libffmpeg/libavcodec/vc1dsp.c
deleted file mode 100644
index f19f266d1..000000000
--- a/src/libffmpeg/libavcodec/vc1dsp.c
+++ /dev/null
@@ -1,463 +0,0 @@
-/*
- * VC-1 and WMV3 decoder - DSP functions
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
-* @file vc1dsp.c
- * VC-1 and WMV3 decoder
- *
- */
-
-#include "dsputil.h"
-
-
-/** Apply overlap transform to horizontal edge
-*/
-static void vc1_v_overlap_c(uint8_t* src, int stride)
-{
- int i;
- int a, b, c, d;
- int d1, d2;
- int rnd = 1;
- for(i = 0; i < 8; i++) {
- a = src[-2*stride];
- b = src[-stride];
- c = src[0];
- d = src[stride];
- d1 = (a - d + 3 + rnd) >> 3;
- d2 = (a - d + b - c + 4 - rnd) >> 3;
-
- src[-2*stride] = a - d1;
- src[-stride] = b - d2;
- src[0] = c + d2;
- src[stride] = d + d1;
- src++;
- rnd = !rnd;
- }
-}
-
-/** Apply overlap transform to vertical edge
-*/
-static void vc1_h_overlap_c(uint8_t* src, int stride)
-{
- int i;
- int a, b, c, d;
- int d1, d2;
- int rnd = 1;
- for(i = 0; i < 8; i++) {
- a = src[-2];
- b = src[-1];
- c = src[0];
- d = src[1];
- d1 = (a - d + 3 + rnd) >> 3;
- d2 = (a - d + b - c + 4 - rnd) >> 3;
-
- src[-2] = a - d1;
- src[-1] = b - d2;
- src[0] = c + d2;
- src[1] = d + d1;
- src += stride;
- rnd = !rnd;
- }
-}
-
-
-/** Do inverse transform on 8x8 block
-*/
-static void vc1_inv_trans_8x8_c(DCTELEM block[64])
-{
- int i;
- register int t1,t2,t3,t4,t5,t6,t7,t8;
- DCTELEM *src, *dst;
-
- src = block;
- dst = block;
- for(i = 0; i < 8; i++){
- t1 = 12 * (src[0] + src[4]);
- t2 = 12 * (src[0] - src[4]);
- t3 = 16 * src[2] + 6 * src[6];
- t4 = 6 * src[2] - 16 * src[6];
-
- t5 = t1 + t3;
- t6 = t2 + t4;
- t7 = t2 - t4;
- t8 = t1 - t3;
-
- t1 = 16 * src[1] + 15 * src[3] + 9 * src[5] + 4 * src[7];
- t2 = 15 * src[1] - 4 * src[3] - 16 * src[5] - 9 * src[7];
- t3 = 9 * src[1] - 16 * src[3] + 4 * src[5] + 15 * src[7];
- t4 = 4 * src[1] - 9 * src[3] + 15 * src[5] - 16 * src[7];
-
- dst[0] = (t5 + t1 + 4) >> 3;
- dst[1] = (t6 + t2 + 4) >> 3;
- dst[2] = (t7 + t3 + 4) >> 3;
- dst[3] = (t8 + t4 + 4) >> 3;
- dst[4] = (t8 - t4 + 4) >> 3;
- dst[5] = (t7 - t3 + 4) >> 3;
- dst[6] = (t6 - t2 + 4) >> 3;
- dst[7] = (t5 - t1 + 4) >> 3;
-
- src += 8;
- dst += 8;
- }
-
- src = block;
- dst = block;
- for(i = 0; i < 8; i++){
- t1 = 12 * (src[ 0] + src[32]);
- t2 = 12 * (src[ 0] - src[32]);
- t3 = 16 * src[16] + 6 * src[48];
- t4 = 6 * src[16] - 16 * src[48];
-
- t5 = t1 + t3;
- t6 = t2 + t4;
- t7 = t2 - t4;
- t8 = t1 - t3;
-
- t1 = 16 * src[ 8] + 15 * src[24] + 9 * src[40] + 4 * src[56];
- t2 = 15 * src[ 8] - 4 * src[24] - 16 * src[40] - 9 * src[56];
- t3 = 9 * src[ 8] - 16 * src[24] + 4 * src[40] + 15 * src[56];
- t4 = 4 * src[ 8] - 9 * src[24] + 15 * src[40] - 16 * src[56];
-
- dst[ 0] = (t5 + t1 + 64) >> 7;
- dst[ 8] = (t6 + t2 + 64) >> 7;
- dst[16] = (t7 + t3 + 64) >> 7;
- dst[24] = (t8 + t4 + 64) >> 7;
- dst[32] = (t8 - t4 + 64 + 1) >> 7;
- dst[40] = (t7 - t3 + 64 + 1) >> 7;
- dst[48] = (t6 - t2 + 64 + 1) >> 7;
- dst[56] = (t5 - t1 + 64 + 1) >> 7;
-
- src++;
- dst++;
- }
-}
-
-/** Do inverse transform on 8x4 part of block
-*/
-static void vc1_inv_trans_8x4_c(DCTELEM block[64], int n)
-{
- int i;
- register int t1,t2,t3,t4,t5,t6,t7,t8;
- DCTELEM *src, *dst;
- int off;
-
- off = n * 32;
- src = block + off;
- dst = block + off;
- for(i = 0; i < 4; i++){
- t1 = 12 * (src[0] + src[4]);
- t2 = 12 * (src[0] - src[4]);
- t3 = 16 * src[2] + 6 * src[6];
- t4 = 6 * src[2] - 16 * src[6];
-
- t5 = t1 + t3;
- t6 = t2 + t4;
- t7 = t2 - t4;
- t8 = t1 - t3;
-
- t1 = 16 * src[1] + 15 * src[3] + 9 * src[5] + 4 * src[7];
- t2 = 15 * src[1] - 4 * src[3] - 16 * src[5] - 9 * src[7];
- t3 = 9 * src[1] - 16 * src[3] + 4 * src[5] + 15 * src[7];
- t4 = 4 * src[1] - 9 * src[3] + 15 * src[5] - 16 * src[7];
-
- dst[0] = (t5 + t1 + 4) >> 3;
- dst[1] = (t6 + t2 + 4) >> 3;
- dst[2] = (t7 + t3 + 4) >> 3;
- dst[3] = (t8 + t4 + 4) >> 3;
- dst[4] = (t8 - t4 + 4) >> 3;
- dst[5] = (t7 - t3 + 4) >> 3;
- dst[6] = (t6 - t2 + 4) >> 3;
- dst[7] = (t5 - t1 + 4) >> 3;
-
- src += 8;
- dst += 8;
- }
-
- src = block + off;
- dst = block + off;
- for(i = 0; i < 8; i++){
- t1 = 17 * (src[ 0] + src[16]);
- t2 = 17 * (src[ 0] - src[16]);
- t3 = 22 * src[ 8];
- t4 = 22 * src[24];
- t5 = 10 * src[ 8];
- t6 = 10 * src[24];
-
- dst[ 0] = (t1 + t3 + t6 + 64) >> 7;
- dst[ 8] = (t2 - t4 + t5 + 64) >> 7;
- dst[16] = (t2 + t4 - t5 + 64) >> 7;
- dst[24] = (t1 - t3 - t6 + 64) >> 7;
-
- src ++;
- dst ++;
- }
-}
-
-/** Do inverse transform on 4x8 parts of block
-*/
-static void vc1_inv_trans_4x8_c(DCTELEM block[64], int n)
-{
- int i;
- register int t1,t2,t3,t4,t5,t6,t7,t8;
- DCTELEM *src, *dst;
- int off;
-
- off = n * 4;
- src = block + off;
- dst = block + off;
- for(i = 0; i < 8; i++){
- t1 = 17 * (src[0] + src[2]);
- t2 = 17 * (src[0] - src[2]);
- t3 = 22 * src[1];
- t4 = 22 * src[3];
- t5 = 10 * src[1];
- t6 = 10 * src[3];
-
- dst[0] = (t1 + t3 + t6 + 4) >> 3;
- dst[1] = (t2 - t4 + t5 + 4) >> 3;
- dst[2] = (t2 + t4 - t5 + 4) >> 3;
- dst[3] = (t1 - t3 - t6 + 4) >> 3;
-
- src += 8;
- dst += 8;
- }
-
- src = block + off;
- dst = block + off;
- for(i = 0; i < 4; i++){
- t1 = 12 * (src[ 0] + src[32]);
- t2 = 12 * (src[ 0] - src[32]);
- t3 = 16 * src[16] + 6 * src[48];
- t4 = 6 * src[16] - 16 * src[48];
-
- t5 = t1 + t3;
- t6 = t2 + t4;
- t7 = t2 - t4;
- t8 = t1 - t3;
-
- t1 = 16 * src[ 8] + 15 * src[24] + 9 * src[40] + 4 * src[56];
- t2 = 15 * src[ 8] - 4 * src[24] - 16 * src[40] - 9 * src[56];
- t3 = 9 * src[ 8] - 16 * src[24] + 4 * src[40] + 15 * src[56];
- t4 = 4 * src[ 8] - 9 * src[24] + 15 * src[40] - 16 * src[56];
-
- dst[ 0] = (t5 + t1 + 64) >> 7;
- dst[ 8] = (t6 + t2 + 64) >> 7;
- dst[16] = (t7 + t3 + 64) >> 7;
- dst[24] = (t8 + t4 + 64) >> 7;
- dst[32] = (t8 - t4 + 64 + 1) >> 7;
- dst[40] = (t7 - t3 + 64 + 1) >> 7;
- dst[48] = (t6 - t2 + 64 + 1) >> 7;
- dst[56] = (t5 - t1 + 64 + 1) >> 7;
-
- src++;
- dst++;
- }
-}
-
-/** Do inverse transform on 4x4 part of block
-*/
-static void vc1_inv_trans_4x4_c(DCTELEM block[64], int n)
-{
- int i;
- register int t1,t2,t3,t4,t5,t6;
- DCTELEM *src, *dst;
- int off;
-
- off = (n&1) * 4 + (n&2) * 16;
- src = block + off;
- dst = block + off;
- for(i = 0; i < 4; i++){
- t1 = 17 * (src[0] + src[2]);
- t2 = 17 * (src[0] - src[2]);
- t3 = 22 * src[1];
- t4 = 22 * src[3];
- t5 = 10 * src[1];
- t6 = 10 * src[3];
-
- dst[0] = (t1 + t3 + t6 + 4) >> 3;
- dst[1] = (t2 - t4 + t5 + 4) >> 3;
- dst[2] = (t2 + t4 - t5 + 4) >> 3;
- dst[3] = (t1 - t3 - t6 + 4) >> 3;
-
- src += 8;
- dst += 8;
- }
-
- src = block + off;
- dst = block + off;
- for(i = 0; i < 4; i++){
- t1 = 17 * (src[ 0] + src[16]);
- t2 = 17 * (src[ 0] - src[16]);
- t3 = 22 * src[ 8];
- t4 = 22 * src[24];
- t5 = 10 * src[ 8];
- t6 = 10 * src[24];
-
- dst[ 0] = (t1 + t3 + t6 + 64) >> 7;
- dst[ 8] = (t2 - t4 + t5 + 64) >> 7;
- dst[16] = (t2 + t4 - t5 + 64) >> 7;
- dst[24] = (t1 - t3 - t6 + 64) >> 7;
-
- src ++;
- dst ++;
- }
-}
-
-/* motion compensation functions */
-
-/** Filter used to interpolate fractional pel values
- */
-static av_always_inline int vc1_mspel_filter(const uint8_t *src, int stride, int mode, int r)
-{
- switch(mode){
- case 0: //no shift
- return src[0];
- case 1: // 1/4 shift
- return (-4*src[-stride] + 53*src[0] + 18*src[stride] - 3*src[stride*2] + 32 - r) >> 6;
- case 2: // 1/2 shift
- return (-src[-stride] + 9*src[0] + 9*src[stride] - src[stride*2] + 8 - r) >> 4;
- case 3: // 3/4 shift
- return (-3*src[-stride] + 18*src[0] + 53*src[stride] - 4*src[stride*2] + 32 - r) >> 6;
- }
- return 0; //should not occur
-}
-
-/** Function used to do motion compensation with bicubic interpolation
- */
-static void vc1_mspel_mc(uint8_t *dst, const uint8_t *src, int stride, int mode, int rnd)
-{
- int i, j;
- uint8_t tmp[8*11], *tptr;
- int m, r;
-
- m = (mode & 3);
- r = rnd;
- src -= stride;
- tptr = tmp;
- for(j = 0; j < 11; j++) {
- for(i = 0; i < 8; i++)
- tptr[i] = clip_uint8(vc1_mspel_filter(src + i, 1, m, r));
- src += stride;
- tptr += 8;
- }
- r = 1 - rnd;
- m = (mode >> 2) & 3;
-
- tptr = tmp + 8;
- for(j = 0; j < 8; j++) {
- for(i = 0; i < 8; i++)
- dst[i] = clip_uint8(vc1_mspel_filter(tptr + i, 8, m, r));
- dst += stride;
- tptr += 8;
- }
-}
-
-/* pixel functions - really are entry points to vc1_mspel_mc */
-
-/* this one is defined in dsputil.c */
-void ff_put_vc1_mspel_mc00_c(uint8_t *dst, const uint8_t *src, int stride, int rnd);
-
-static void ff_put_vc1_mspel_mc10_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
- vc1_mspel_mc(dst, src, stride, 0x1, rnd);
-}
-
-static void ff_put_vc1_mspel_mc20_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
- vc1_mspel_mc(dst, src, stride, 0x2, rnd);
-}
-
-static void ff_put_vc1_mspel_mc30_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
- vc1_mspel_mc(dst, src, stride, 0x3, rnd);
-}
-
-static void ff_put_vc1_mspel_mc01_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
- vc1_mspel_mc(dst, src, stride, 0x4, rnd);
-}
-
-static void ff_put_vc1_mspel_mc11_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
- vc1_mspel_mc(dst, src, stride, 0x5, rnd);
-}
-
-static void ff_put_vc1_mspel_mc21_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
- vc1_mspel_mc(dst, src, stride, 0x6, rnd);
-}
-
-static void ff_put_vc1_mspel_mc31_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
- vc1_mspel_mc(dst, src, stride, 0x7, rnd);
-}
-
-static void ff_put_vc1_mspel_mc02_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
- vc1_mspel_mc(dst, src, stride, 0x8, rnd);
-}
-
-static void ff_put_vc1_mspel_mc12_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
- vc1_mspel_mc(dst, src, stride, 0x9, rnd);
-}
-
-static void ff_put_vc1_mspel_mc22_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
- vc1_mspel_mc(dst, src, stride, 0xA, rnd);
-}
-
-static void ff_put_vc1_mspel_mc32_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
- vc1_mspel_mc(dst, src, stride, 0xB, rnd);
-}
-
-static void ff_put_vc1_mspel_mc03_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
- vc1_mspel_mc(dst, src, stride, 0xC, rnd);
-}
-
-static void ff_put_vc1_mspel_mc13_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
- vc1_mspel_mc(dst, src, stride, 0xD, rnd);
-}
-
-static void ff_put_vc1_mspel_mc23_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
- vc1_mspel_mc(dst, src, stride, 0xE, rnd);
-}
-
-static void ff_put_vc1_mspel_mc33_c(uint8_t *dst, const uint8_t *src, int stride, int rnd) {
- vc1_mspel_mc(dst, src, stride, 0xF, rnd);
-}
-
-void ff_vc1dsp_init(DSPContext* dsp, AVCodecContext *avctx) {
- dsp->vc1_inv_trans_8x8 = vc1_inv_trans_8x8_c;
- dsp->vc1_inv_trans_4x8 = vc1_inv_trans_4x8_c;
- dsp->vc1_inv_trans_8x4 = vc1_inv_trans_8x4_c;
- dsp->vc1_inv_trans_4x4 = vc1_inv_trans_4x4_c;
- dsp->vc1_h_overlap = vc1_h_overlap_c;
- dsp->vc1_v_overlap = vc1_v_overlap_c;
-
- dsp->put_vc1_mspel_pixels_tab[ 0] = ff_put_vc1_mspel_mc00_c;
- dsp->put_vc1_mspel_pixels_tab[ 1] = ff_put_vc1_mspel_mc10_c;
- dsp->put_vc1_mspel_pixels_tab[ 2] = ff_put_vc1_mspel_mc20_c;
- dsp->put_vc1_mspel_pixels_tab[ 3] = ff_put_vc1_mspel_mc30_c;
- dsp->put_vc1_mspel_pixels_tab[ 4] = ff_put_vc1_mspel_mc01_c;
- dsp->put_vc1_mspel_pixels_tab[ 5] = ff_put_vc1_mspel_mc11_c;
- dsp->put_vc1_mspel_pixels_tab[ 6] = ff_put_vc1_mspel_mc21_c;
- dsp->put_vc1_mspel_pixels_tab[ 7] = ff_put_vc1_mspel_mc31_c;
- dsp->put_vc1_mspel_pixels_tab[ 8] = ff_put_vc1_mspel_mc02_c;
- dsp->put_vc1_mspel_pixels_tab[ 9] = ff_put_vc1_mspel_mc12_c;
- dsp->put_vc1_mspel_pixels_tab[10] = ff_put_vc1_mspel_mc22_c;
- dsp->put_vc1_mspel_pixels_tab[11] = ff_put_vc1_mspel_mc32_c;
- dsp->put_vc1_mspel_pixels_tab[12] = ff_put_vc1_mspel_mc03_c;
- dsp->put_vc1_mspel_pixels_tab[13] = ff_put_vc1_mspel_mc13_c;
- dsp->put_vc1_mspel_pixels_tab[14] = ff_put_vc1_mspel_mc23_c;
- dsp->put_vc1_mspel_pixels_tab[15] = ff_put_vc1_mspel_mc33_c;
-}
diff --git a/src/libffmpeg/libavcodec/vcr1.c b/src/libffmpeg/libavcodec/vcr1.c
deleted file mode 100644
index 62bf12320..000000000
--- a/src/libffmpeg/libavcodec/vcr1.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * ATI VCR1 codec
- * Copyright (c) 2003 Michael Niedermayer
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file vcr1.c
- * ati vcr1 codec.
- */
-
-#include "avcodec.h"
-#include "mpegvideo.h"
-
-//#undef NDEBUG
-//#include <assert.h>
-
-typedef struct VCR1Context{
- AVCodecContext *avctx;
- AVFrame picture;
- int delta[16];
- int offset[4];
-} VCR1Context;
-
-static int decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- VCR1Context * const a = avctx->priv_data;
- AVFrame *picture = data;
- AVFrame * const p= (AVFrame*)&a->picture;
- uint8_t *bytestream= buf;
- int i, x, y;
-
- if(p->data[0])
- avctx->release_buffer(avctx, p);
-
- p->reference= 0;
- if(avctx->get_buffer(avctx, p) < 0){
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
- p->pict_type= I_TYPE;
- p->key_frame= 1;
-
- for(i=0; i<16; i++){
- a->delta[i]= *(bytestream++);
- bytestream++;
- }
-
- for(y=0; y<avctx->height; y++){
- int offset;
- uint8_t *luma= &a->picture.data[0][ y*a->picture.linesize[0] ];
-
- if((y&3) == 0){
- uint8_t *cb= &a->picture.data[1][ (y>>2)*a->picture.linesize[1] ];
- uint8_t *cr= &a->picture.data[2][ (y>>2)*a->picture.linesize[2] ];
-
- for(i=0; i<4; i++)
- a->offset[i]= *(bytestream++);
-
- offset= a->offset[0] - a->delta[ bytestream[2]&0xF ];
- for(x=0; x<avctx->width; x+=4){
- luma[0]=( offset += a->delta[ bytestream[2]&0xF ]);
- luma[1]=( offset += a->delta[ bytestream[2]>>4 ]);
- luma[2]=( offset += a->delta[ bytestream[0]&0xF ]);
- luma[3]=( offset += a->delta[ bytestream[0]>>4 ]);
- luma += 4;
-
- *(cb++) = bytestream[3];
- *(cr++) = bytestream[1];
-
- bytestream+= 4;
- }
- }else{
- offset= a->offset[y&3] - a->delta[ bytestream[2]&0xF ];
-
- for(x=0; x<avctx->width; x+=8){
- luma[0]=( offset += a->delta[ bytestream[2]&0xF ]);
- luma[1]=( offset += a->delta[ bytestream[2]>>4 ]);
- luma[2]=( offset += a->delta[ bytestream[3]&0xF ]);
- luma[3]=( offset += a->delta[ bytestream[3]>>4 ]);
- luma[4]=( offset += a->delta[ bytestream[0]&0xF ]);
- luma[5]=( offset += a->delta[ bytestream[0]>>4 ]);
- luma[6]=( offset += a->delta[ bytestream[1]&0xF ]);
- luma[7]=( offset += a->delta[ bytestream[1]>>4 ]);
- luma += 8;
- bytestream+= 4;
- }
- }
- }
-
- *picture= *(AVFrame*)&a->picture;
- *data_size = sizeof(AVPicture);
-
- emms_c();
-
- return buf_size;
-}
-
-#if 0
-static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){
- VCR1Context * const a = avctx->priv_data;
- AVFrame *pict = data;
- AVFrame * const p= (AVFrame*)&a->picture;
- int size;
- int mb_x, mb_y;
-
- *p = *pict;
- p->pict_type= I_TYPE;
- p->key_frame= 1;
-
- emms_c();
-
- align_put_bits(&a->pb);
- while(get_bit_count(&a->pb)&31)
- put_bits(&a->pb, 8, 0);
-
- size= get_bit_count(&a->pb)/32;
-
- return size*4;
-}
-#endif
-
-static void common_init(AVCodecContext *avctx){
- VCR1Context * const a = avctx->priv_data;
-
- avctx->coded_frame= (AVFrame*)&a->picture;
- a->avctx= avctx;
-}
-
-static int decode_init(AVCodecContext *avctx){
-
- common_init(avctx);
-
- avctx->pix_fmt= PIX_FMT_YUV410P;
-
- return 0;
-}
-
-#if 0
-static int encode_init(AVCodecContext *avctx){
-
- common_init(avctx);
-
- return 0;
-}
-#endif
-
-AVCodec vcr1_decoder = {
- "vcr1",
- CODEC_TYPE_VIDEO,
- CODEC_ID_VCR1,
- sizeof(VCR1Context),
- decode_init,
- NULL,
- NULL,
- decode_frame,
- CODEC_CAP_DR1,
-};
-#if 0
-#ifdef CONFIG_ENCODERS
-
-AVCodec vcr1_encoder = {
- "vcr1",
- CODEC_TYPE_VIDEO,
- CODEC_ID_VCR1,
- sizeof(VCR1Context),
- encode_init,
- encode_frame,
- //encode_end,
-};
-
-#endif //CONFIG_ENCODERS
-#endif
diff --git a/src/libffmpeg/libavcodec/vmdav.c b/src/libffmpeg/libavcodec/vmdav.c
deleted file mode 100644
index e0f958cbe..000000000
--- a/src/libffmpeg/libavcodec/vmdav.c
+++ /dev/null
@@ -1,572 +0,0 @@
-/*
- * Sierra VMD Audio & Video Decoders
- * Copyright (C) 2004 the ffmpeg project
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file vmdvideo.c
- * Sierra VMD audio & video decoders
- * by Vladimir "VAG" Gneushev (vagsoft at mail.ru)
- * for more information on the Sierra VMD format, visit:
- * http://www.pcisys.net/~melanson/codecs/
- *
- * The video decoder outputs PAL8 colorspace data. The decoder expects
- * a 0x330-byte VMD file header to be transmitted via extradata during
- * codec initialization. Each encoded frame that is sent to this decoder
- * is expected to be prepended with the appropriate 16-byte frame
- * information record from the VMD file.
- *
- * The audio decoder, like the video decoder, expects each encoded data
- * chunk to be prepended with the appropriate 16-byte frame information
- * record from the VMD file. It does not require the 0x330-byte VMD file
- * header, but it does need the audio setup parameters passed in through
- * normal libavcodec API means.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "common.h"
-#include "avcodec.h"
-#include "dsputil.h"
-
-#define VMD_HEADER_SIZE 0x330
-#define PALETTE_COUNT 256
-
-/*
- * Video Decoder
- */
-
-typedef struct VmdVideoContext {
-
- AVCodecContext *avctx;
- DSPContext dsp;
- AVFrame frame;
- AVFrame prev_frame;
-
- unsigned char *buf;
- int size;
-
- unsigned char palette[PALETTE_COUNT * 4];
- unsigned char *unpack_buffer;
- int unpack_buffer_size;
-
-} VmdVideoContext;
-
-#define QUEUE_SIZE 0x1000
-#define QUEUE_MASK 0x0FFF
-
-static void lz_unpack(unsigned char *src, unsigned char *dest, int dest_len)
-{
- unsigned char *s;
- unsigned char *d;
- unsigned char *d_end;
- unsigned char queue[QUEUE_SIZE];
- unsigned int qpos;
- unsigned int dataleft;
- unsigned int chainofs;
- unsigned int chainlen;
- unsigned int speclen;
- unsigned char tag;
- unsigned int i, j;
-
- s = src;
- d = dest;
- d_end = d + dest_len;
- dataleft = AV_RL32(s);
- s += 4;
- memset(queue, 0x20, QUEUE_SIZE);
- if (AV_RL32(s) == 0x56781234) {
- s += 4;
- qpos = 0x111;
- speclen = 0xF + 3;
- } else {
- qpos = 0xFEE;
- speclen = 100; /* no speclen */
- }
-
- while (dataleft > 0) {
- tag = *s++;
- if ((tag == 0xFF) && (dataleft > 8)) {
- if (d + 8 > d_end)
- return;
- for (i = 0; i < 8; i++) {
- queue[qpos++] = *d++ = *s++;
- qpos &= QUEUE_MASK;
- }
- dataleft -= 8;
- } else {
- for (i = 0; i < 8; i++) {
- if (dataleft == 0)
- break;
- if (tag & 0x01) {
- if (d + 1 > d_end)
- return;
- queue[qpos++] = *d++ = *s++;
- qpos &= QUEUE_MASK;
- dataleft--;
- } else {
- chainofs = *s++;
- chainofs |= ((*s & 0xF0) << 4);
- chainlen = (*s++ & 0x0F) + 3;
- if (chainlen == speclen)
- chainlen = *s++ + 0xF + 3;
- if (d + chainlen > d_end)
- return;
- for (j = 0; j < chainlen; j++) {
- *d = queue[chainofs++ & QUEUE_MASK];
- queue[qpos++] = *d++;
- qpos &= QUEUE_MASK;
- }
- dataleft -= chainlen;
- }
- tag >>= 1;
- }
- }
- }
-}
-
-static int rle_unpack(unsigned char *src, unsigned char *dest,
- int src_len, int dest_len)
-{
- unsigned char *ps;
- unsigned char *pd;
- int i, l;
- unsigned char *dest_end = dest + dest_len;
-
- ps = src;
- pd = dest;
- if (src_len & 1)
- *pd++ = *ps++;
-
- src_len >>= 1;
- i = 0;
- do {
- l = *ps++;
- if (l & 0x80) {
- l = (l & 0x7F) * 2;
- if (pd + l > dest_end)
- return (ps - src);
- memcpy(pd, ps, l);
- ps += l;
- pd += l;
- } else {
- if (pd + i > dest_end)
- return (ps - src);
- for (i = 0; i < l; i++) {
- *pd++ = ps[0];
- *pd++ = ps[1];
- }
- ps += 2;
- }
- i += l;
- } while (i < src_len);
-
- return (ps - src);
-}
-
-static void vmd_decode(VmdVideoContext *s)
-{
- int i;
- unsigned int *palette32;
- unsigned char r, g, b;
-
- /* point to the start of the encoded data */
- unsigned char *p = s->buf + 16;
-
- unsigned char *pb;
- unsigned char meth;
- unsigned char *dp; /* pointer to current frame */
- unsigned char *pp; /* pointer to previous frame */
- unsigned char len;
- int ofs;
-
- int frame_x, frame_y;
- int frame_width, frame_height;
- int dp_size;
-
- frame_x = AV_RL16(&s->buf[6]);
- frame_y = AV_RL16(&s->buf[8]);
- frame_width = AV_RL16(&s->buf[10]) - frame_x + 1;
- frame_height = AV_RL16(&s->buf[12]) - frame_y + 1;
-
- /* if only a certain region will be updated, copy the entire previous
- * frame before the decode */
- if (frame_x || frame_y || (frame_width != s->avctx->width) ||
- (frame_height != s->avctx->height)) {
-
- memcpy(s->frame.data[0], s->prev_frame.data[0],
- s->avctx->height * s->frame.linesize[0]);
- }
-
- /* check if there is a new palette */
- if (s->buf[15] & 0x02) {
- p += 2;
- palette32 = (unsigned int *)s->palette;
- for (i = 0; i < PALETTE_COUNT; i++) {
- r = *p++ * 4;
- g = *p++ * 4;
- b = *p++ * 4;
- palette32[i] = (r << 16) | (g << 8) | (b);
- }
- s->size -= (256 * 3 + 2);
- }
- if (s->size >= 0) {
- /* originally UnpackFrame in VAG's code */
- pb = p;
- meth = *pb++;
- if (meth & 0x80) {
- lz_unpack(pb, s->unpack_buffer, s->unpack_buffer_size);
- meth &= 0x7F;
- pb = s->unpack_buffer;
- }
-
- dp = &s->frame.data[0][frame_y * s->frame.linesize[0] + frame_x];
- dp_size = s->frame.linesize[0] * s->avctx->height;
- pp = &s->prev_frame.data[0][frame_y * s->prev_frame.linesize[0] + frame_x];
- switch (meth) {
- case 1:
- for (i = 0; i < frame_height; i++) {
- ofs = 0;
- do {
- len = *pb++;
- if (len & 0x80) {
- len = (len & 0x7F) + 1;
- if (ofs + len > frame_width)
- return;
- memcpy(&dp[ofs], pb, len);
- pb += len;
- ofs += len;
- } else {
- /* interframe pixel copy */
- if (ofs + len + 1 > frame_width)
- return;
- memcpy(&dp[ofs], &pp[ofs], len + 1);
- ofs += len + 1;
- }
- } while (ofs < frame_width);
- if (ofs > frame_width) {
- av_log(s->avctx, AV_LOG_ERROR, "VMD video: offset > width (%d > %d)\n",
- ofs, frame_width);
- break;
- }
- dp += s->frame.linesize[0];
- pp += s->prev_frame.linesize[0];
- }
- break;
-
- case 2:
- for (i = 0; i < frame_height; i++) {
- memcpy(dp, pb, frame_width);
- pb += frame_width;
- dp += s->frame.linesize[0];
- pp += s->prev_frame.linesize[0];
- }
- break;
-
- case 3:
- for (i = 0; i < frame_height; i++) {
- ofs = 0;
- do {
- len = *pb++;
- if (len & 0x80) {
- len = (len & 0x7F) + 1;
- if (*pb++ == 0xFF)
- len = rle_unpack(pb, &dp[ofs], len, frame_width - ofs);
- else
- memcpy(&dp[ofs], pb, len);
- pb += len;
- ofs += len;
- } else {
- /* interframe pixel copy */
- if (ofs + len + 1 > frame_width)
- return;
- memcpy(&dp[ofs], &pp[ofs], len + 1);
- ofs += len + 1;
- }
- } while (ofs < frame_width);
- if (ofs > frame_width) {
- av_log(s->avctx, AV_LOG_ERROR, "VMD video: offset > width (%d > %d)\n",
- ofs, frame_width);
- }
- dp += s->frame.linesize[0];
- pp += s->prev_frame.linesize[0];
- }
- break;
- }
- }
-}
-
-static int vmdvideo_decode_init(AVCodecContext *avctx)
-{
- VmdVideoContext *s = (VmdVideoContext *)avctx->priv_data;
- int i;
- unsigned int *palette32;
- int palette_index = 0;
- unsigned char r, g, b;
- unsigned char *vmd_header;
- unsigned char *raw_palette;
-
- s->avctx = avctx;
- avctx->pix_fmt = PIX_FMT_PAL8;
- avctx->has_b_frames = 0;
- dsputil_init(&s->dsp, avctx);
-
- /* make sure the VMD header made it */
- if (s->avctx->extradata_size != VMD_HEADER_SIZE) {
- av_log(s->avctx, AV_LOG_ERROR, "VMD video: expected extradata size of %d\n",
- VMD_HEADER_SIZE);
- return -1;
- }
- vmd_header = (unsigned char *)avctx->extradata;
-
- s->unpack_buffer_size = AV_RL32(&vmd_header[800]);
- s->unpack_buffer = av_malloc(s->unpack_buffer_size);
- if (!s->unpack_buffer)
- return -1;
-
- /* load up the initial palette */
- raw_palette = &vmd_header[28];
- palette32 = (unsigned int *)s->palette;
- for (i = 0; i < PALETTE_COUNT; i++) {
- r = raw_palette[palette_index++] * 4;
- g = raw_palette[palette_index++] * 4;
- b = raw_palette[palette_index++] * 4;
- palette32[i] = (r << 16) | (g << 8) | (b);
- }
-
- s->frame.data[0] = s->prev_frame.data[0] = NULL;
-
- return 0;
-}
-
-static int vmdvideo_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- VmdVideoContext *s = (VmdVideoContext *)avctx->priv_data;
-
- s->buf = buf;
- s->size = buf_size;
-
- if (buf_size < 16)
- return buf_size;
-
- s->frame.reference = 1;
- if (avctx->get_buffer(avctx, &s->frame)) {
- av_log(s->avctx, AV_LOG_ERROR, "VMD Video: get_buffer() failed\n");
- return -1;
- }
-
- vmd_decode(s);
-
- /* make the palette available on the way out */
- memcpy(s->frame.data[1], s->palette, PALETTE_COUNT * 4);
-
- if (s->prev_frame.data[0])
- avctx->release_buffer(avctx, &s->prev_frame);
-
- /* shuffle frames */
- s->prev_frame = s->frame;
-
- *data_size = sizeof(AVFrame);
- *(AVFrame*)data = s->frame;
-
- /* report that the buffer was completely consumed */
- return buf_size;
-}
-
-static int vmdvideo_decode_end(AVCodecContext *avctx)
-{
- VmdVideoContext *s = (VmdVideoContext *)avctx->priv_data;
-
- if (s->prev_frame.data[0])
- avctx->release_buffer(avctx, &s->prev_frame);
- av_free(s->unpack_buffer);
-
- return 0;
-}
-
-
-/*
- * Audio Decoder
- */
-
-typedef struct VmdAudioContext {
- AVCodecContext *avctx;
- int channels;
- int bits;
- int block_align;
- int predictors[2];
-} VmdAudioContext;
-
-static uint16_t vmdaudio_table[128] = {
- 0x000, 0x008, 0x010, 0x020, 0x030, 0x040, 0x050, 0x060, 0x070, 0x080,
- 0x090, 0x0A0, 0x0B0, 0x0C0, 0x0D0, 0x0E0, 0x0F0, 0x100, 0x110, 0x120,
- 0x130, 0x140, 0x150, 0x160, 0x170, 0x180, 0x190, 0x1A0, 0x1B0, 0x1C0,
- 0x1D0, 0x1E0, 0x1F0, 0x200, 0x208, 0x210, 0x218, 0x220, 0x228, 0x230,
- 0x238, 0x240, 0x248, 0x250, 0x258, 0x260, 0x268, 0x270, 0x278, 0x280,
- 0x288, 0x290, 0x298, 0x2A0, 0x2A8, 0x2B0, 0x2B8, 0x2C0, 0x2C8, 0x2D0,
- 0x2D8, 0x2E0, 0x2E8, 0x2F0, 0x2F8, 0x300, 0x308, 0x310, 0x318, 0x320,
- 0x328, 0x330, 0x338, 0x340, 0x348, 0x350, 0x358, 0x360, 0x368, 0x370,
- 0x378, 0x380, 0x388, 0x390, 0x398, 0x3A0, 0x3A8, 0x3B0, 0x3B8, 0x3C0,
- 0x3C8, 0x3D0, 0x3D8, 0x3E0, 0x3E8, 0x3F0, 0x3F8, 0x400, 0x440, 0x480,
- 0x4C0, 0x500, 0x540, 0x580, 0x5C0, 0x600, 0x640, 0x680, 0x6C0, 0x700,
- 0x740, 0x780, 0x7C0, 0x800, 0x900, 0xA00, 0xB00, 0xC00, 0xD00, 0xE00,
- 0xF00, 0x1000, 0x1400, 0x1800, 0x1C00, 0x2000, 0x3000, 0x4000
-};
-
-static int vmdaudio_decode_init(AVCodecContext *avctx)
-{
- VmdAudioContext *s = (VmdAudioContext *)avctx->priv_data;
-
- s->avctx = avctx;
- s->channels = avctx->channels;
- s->bits = avctx->bits_per_sample;
- s->block_align = avctx->block_align;
-
- av_log(s->avctx, AV_LOG_DEBUG, "%d channels, %d bits/sample, block align = %d, sample rate = %d\n",
- s->channels, s->bits, s->block_align, avctx->sample_rate);
-
- return 0;
-}
-
-static void vmdaudio_decode_audio(VmdAudioContext *s, unsigned char *data,
- uint8_t *buf, int stereo)
-{
- int i;
- int chan = 0;
- int16_t *out = (int16_t*)data;
-
- for(i = 0; i < s->block_align; i++) {
- if(buf[i] & 0x80)
- s->predictors[chan] -= vmdaudio_table[buf[i] & 0x7F];
- else
- s->predictors[chan] += vmdaudio_table[buf[i]];
- s->predictors[chan] = clip(s->predictors[chan], -32768, 32767);
- out[i] = s->predictors[chan];
- chan ^= stereo;
- }
-}
-
-static int vmdaudio_loadsound(VmdAudioContext *s, unsigned char *data,
- uint8_t *buf, int silence)
-{
- int bytes_decoded = 0;
- int i;
-
-// if (silence)
-// av_log(s->avctx, AV_LOG_INFO, "silent block!\n");
- if (s->channels == 2) {
-
- /* stereo handling */
- if (silence) {
- memset(data, 0, s->block_align * 2);
- } else {
- if (s->bits == 16)
- vmdaudio_decode_audio(s, data, buf, 1);
- else {
- /* copy the data but convert it to signed */
- for (i = 0; i < s->block_align; i++){
- *data++ = buf[i] + 0x80;
- *data++ = buf[i] + 0x80;
- }
- }
- }
- } else {
- bytes_decoded = s->block_align * 2;
-
- /* mono handling */
- if (silence) {
- memset(data, 0, s->block_align * 2);
- } else {
- if (s->bits == 16) {
- vmdaudio_decode_audio(s, data, buf, 0);
- } else {
- /* copy the data but convert it to signed */
- for (i = 0; i < s->block_align; i++){
- *data++ = buf[i] + 0x80;
- *data++ = buf[i] + 0x80;
- }
- }
- }
- }
-
- return s->block_align * 2;
-}
-
-static int vmdaudio_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- VmdAudioContext *s = (VmdAudioContext *)avctx->priv_data;
- unsigned char *output_samples = (unsigned char *)data;
-
- /* point to the start of the encoded data */
- unsigned char *p = buf + 16;
-
- if (buf_size < 16)
- return buf_size;
-
- if (buf[6] == 1) {
- /* the chunk contains audio */
- *data_size = vmdaudio_loadsound(s, output_samples, p, 0);
- } else if (buf[6] == 2) {
- /* the chunk may contain audio */
- p += 4;
- *data_size = vmdaudio_loadsound(s, output_samples, p, (buf_size == 16));
- output_samples += (s->block_align * s->bits / 8);
- } else if (buf[6] == 3) {
- /* silent chunk */
- *data_size = vmdaudio_loadsound(s, output_samples, p, 1);
- }
-
- return buf_size;
-}
-
-
-/*
- * Public Data Structures
- */
-
-AVCodec vmdvideo_decoder = {
- "vmdvideo",
- CODEC_TYPE_VIDEO,
- CODEC_ID_VMDVIDEO,
- sizeof(VmdVideoContext),
- vmdvideo_decode_init,
- NULL,
- vmdvideo_decode_end,
- vmdvideo_decode_frame,
- CODEC_CAP_DR1,
-};
-
-AVCodec vmdaudio_decoder = {
- "vmdaudio",
- CODEC_TYPE_AUDIO,
- CODEC_ID_VMDAUDIO,
- sizeof(VmdAudioContext),
- vmdaudio_decode_init,
- NULL,
- NULL,
- vmdaudio_decode_frame,
-};
diff --git a/src/libffmpeg/libavcodec/vorbis.c b/src/libffmpeg/libavcodec/vorbis.c
deleted file mode 100644
index ca8d0a956..000000000
--- a/src/libffmpeg/libavcodec/vorbis.c
+++ /dev/null
@@ -1,1814 +0,0 @@
-/**
- * @file vorbis.c
- * Vorbis I decoder
- * @author Denes Balatoni ( dbalatoni programozo hu )
-
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#undef V_DEBUG
-//#define V_DEBUG
-//#define AV_DEBUG(...) av_log(NULL, AV_LOG_INFO, __VA_ARGS__)
-
-#include <math.h>
-
-#define ALT_BITSTREAM_READER_LE
-#include "avcodec.h"
-#include "bitstream.h"
-#include "dsputil.h"
-
-#include "vorbis.h"
-
-#define V_NB_BITS 8
-#define V_NB_BITS2 11
-#define V_MAX_VLCS (1<<16)
-
-#ifndef V_DEBUG
-#define AV_DEBUG(...)
-#endif
-
-#undef NDEBUG
-#include <assert.h>
-
-typedef struct {
- uint_fast8_t dimensions;
- uint_fast8_t lookup_type;
- uint_fast8_t maxdepth;
- VLC vlc;
- float *codevectors;
- unsigned int nb_bits;
-} vorbis_codebook;
-
-typedef union vorbis_floor_u vorbis_floor_data;
-typedef struct vorbis_floor0_s vorbis_floor0;
-typedef struct vorbis_floor1_s vorbis_floor1;
-struct vorbis_context_s;
-typedef
-uint_fast8_t (* vorbis_floor_decode_func)
- (struct vorbis_context_s *, vorbis_floor_data *, float *);
-typedef struct {
- uint_fast8_t floor_type;
- vorbis_floor_decode_func decode;
- union vorbis_floor_u
- {
- struct vorbis_floor0_s
- {
- uint_fast8_t order;
- uint_fast16_t rate;
- uint_fast16_t bark_map_size;
- int_fast32_t * map[2];
- uint_fast32_t map_size[2];
- uint_fast8_t amplitude_bits;
- uint_fast8_t amplitude_offset;
- uint_fast8_t num_books;
- uint_fast8_t * book_list;
- float * lsp;
- } t0;
- struct vorbis_floor1_s
- {
- uint_fast8_t partitions;
- uint_fast8_t maximum_class;
- uint_fast8_t partition_class[32];
- uint_fast8_t class_dimensions[16];
- uint_fast8_t class_subclasses[16];
- uint_fast8_t class_masterbook[16];
- int_fast16_t subclass_books[16][8];
- uint_fast8_t multiplier;
- uint_fast16_t x_list_dim;
- floor1_entry_t * list;
- } t1;
- } data;
-} vorbis_floor;
-
-typedef struct {
- uint_fast16_t type;
- uint_fast32_t begin;
- uint_fast32_t end;
- uint_fast32_t partition_size;
- uint_fast8_t classifications;
- uint_fast8_t classbook;
- int_fast16_t books[64][8];
- uint_fast8_t maxpass;
-} vorbis_residue;
-
-typedef struct {
- uint_fast8_t submaps;
- uint_fast16_t coupling_steps;
- uint_fast8_t *magnitude;
- uint_fast8_t *angle;
- uint_fast8_t *mux;
- uint_fast8_t submap_floor[16];
- uint_fast8_t submap_residue[16];
-} vorbis_mapping;
-
-typedef struct {
- uint_fast8_t blockflag;
- uint_fast16_t windowtype;
- uint_fast16_t transformtype;
- uint_fast8_t mapping;
-} vorbis_mode;
-
-typedef struct vorbis_context_s {
- AVCodecContext *avccontext;
- GetBitContext gb;
- DSPContext dsp;
-
- MDCTContext mdct[2];
- uint_fast8_t first_frame;
- uint_fast32_t version;
- uint_fast8_t audio_channels;
- uint_fast32_t audio_samplerate;
- uint_fast32_t bitrate_maximum;
- uint_fast32_t bitrate_nominal;
- uint_fast32_t bitrate_minimum;
- uint_fast32_t blocksize[2];
- const float * win[2];
- uint_fast16_t codebook_count;
- vorbis_codebook *codebooks;
- uint_fast8_t floor_count;
- vorbis_floor *floors;
- uint_fast8_t residue_count;
- vorbis_residue *residues;
- uint_fast8_t mapping_count;
- vorbis_mapping *mappings;
- uint_fast8_t mode_count;
- vorbis_mode *modes;
- uint_fast8_t mode_number; // mode number for the current packet
- float *channel_residues;
- float *channel_floors;
- float *saved;
- uint_fast16_t saved_start;
- float *ret;
- float *buf;
- float *buf_tmp;
- uint_fast32_t add_bias; // for float->int conversion
- uint_fast32_t exp_bias;
-} vorbis_context;
-
-/* Helper functions */
-
-#define BARK(x) \
- (13.1f*atan(0.00074f*(x))+2.24f*atan(1.85e-8f*(x)*(x))+1e-4f*(x))
-
-unsigned int ff_vorbis_nth_root(unsigned int x, unsigned int n) { // x^(1/n)
- unsigned int ret=0, i, j;
-
- do {
- ++ret;
- for(i=0,j=ret;i<n-1;i++) j*=ret;
- } while (j<=x);
-
- return (ret-1);
-}
-
-static float vorbisfloat2float(uint_fast32_t val) {
- double mant=val&0x1fffff;
- long exp=(val&0x7fe00000L)>>21;
- if (val&0x80000000) mant=-mant;
- return(ldexp(mant, exp-20-768));
-}
-
-
-// Generate vlc codes from vorbis huffman code lengths
-
-int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, uint_fast32_t num) {
- uint_fast32_t exit_at_level[33]={404,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
-
- uint_fast8_t i,j;
- uint_fast32_t code,p;
-
-#ifdef V_DEBUG
- GetBitContext gb;
-#endif
-
- for(p=0;(bits[p]==0) && (p<num);++p);
- if (p==num) {
-// av_log(vc->avccontext, AV_LOG_INFO, "An empty codebook. Heh?! \n");
- return 0;
- }
-
- codes[p]=0;
- for(i=0;i<bits[p];++i) {
- exit_at_level[i+1]=1<<i;
- }
-
-#ifdef V_DEBUG
- av_log(NULL, AV_LOG_INFO, " %d. of %d code len %d code %d - ", p, num, bits[p], codes[p]);
- init_get_bits(&gb, (uint_fast8_t *)&codes[p], bits[p]);
- for(i=0;i<bits[p];++i) {
- av_log(NULL, AV_LOG_INFO, "%s", get_bits1(&gb) ? "1" : "0");
- }
- av_log(NULL, AV_LOG_INFO, "\n");
-#endif
-
- ++p;
-
- for(;p<num;++p) {
- if (bits[p]==0) continue;
- // find corresponding exit(node which the tree can grow further from)
- for(i=bits[p];i>0;--i) {
- if (exit_at_level[i]) break;
- }
- if (!i) return 1; // overspecified tree
- code=exit_at_level[i];
- exit_at_level[i]=0;
- // construct code (append 0s to end) and introduce new exits
- for(j=i+1;j<=bits[p];++j) {
- exit_at_level[j]=code+(1<<(j-1));
- }
- codes[p]=code;
-
-#ifdef V_DEBUG
- av_log(NULL, AV_LOG_INFO, " %d. code len %d code %d - ", p, bits[p], codes[p]);
- init_get_bits(&gb, (uint_fast8_t *)&codes[p], bits[p]);
- for(i=0;i<bits[p];++i) {
- av_log(NULL, AV_LOG_INFO, "%s", get_bits1(&gb) ? "1" : "0");
- }
- av_log(NULL, AV_LOG_INFO, "\n");
-#endif
-
- }
-
- //no exits should be left (underspecified tree - ie. unused valid vlcs - not allowed by SPEC)
- for (p=1; p<33; p++)
- if (exit_at_level[p]) return 1;
-
- return 0;
-}
-
-void ff_vorbis_ready_floor1_list(floor1_entry_t * list, int values) {
- int i;
- list[0].sort = 0;
- list[1].sort = 1;
- for (i = 2; i < values; i++) {
- int j;
- list[i].low = 0;
- list[i].high = 1;
- list[i].sort = i;
- for (j = 2; j < i; j++) {
- int tmp = list[j].x;
- if (tmp < list[i].x) {
- if (tmp > list[list[i].low].x) list[i].low = j;
- } else {
- if (tmp < list[list[i].high].x) list[i].high = j;
- }
- }
- }
- for (i = 0; i < values - 1; i++) {
- int j;
- for (j = i + 1; j < values; j++) {
- if (list[list[i].sort].x > list[list[j].sort].x) {
- int tmp = list[i].sort;
- list[i].sort = list[j].sort;
- list[j].sort = tmp;
- }
- }
- }
-}
-
-// Free all allocated memory -----------------------------------------
-
-static void vorbis_free(vorbis_context *vc) {
- int_fast16_t i;
-
- av_freep(&vc->channel_residues);
- av_freep(&vc->channel_floors);
- av_freep(&vc->saved);
- av_freep(&vc->ret);
- av_freep(&vc->buf);
- av_freep(&vc->buf_tmp);
-
- av_freep(&vc->residues);
- av_freep(&vc->modes);
-
- ff_mdct_end(&vc->mdct[0]);
- ff_mdct_end(&vc->mdct[1]);
-
- for(i=0;i<vc->codebook_count;++i) {
- av_free(vc->codebooks[i].codevectors);
- free_vlc(&vc->codebooks[i].vlc);
- }
- av_freep(&vc->codebooks);
-
- for(i=0;i<vc->floor_count;++i) {
- if(vc->floors[i].floor_type==0) {
- av_free(vc->floors[i].data.t0.map[0]);
- av_free(vc->floors[i].data.t0.map[1]);
- av_free(vc->floors[i].data.t0.book_list);
- av_free(vc->floors[i].data.t0.lsp);
- }
- else {
- av_free(vc->floors[i].data.t1.list);
- }
- }
- av_freep(&vc->floors);
-
- for(i=0;i<vc->mapping_count;++i) {
- av_free(vc->mappings[i].magnitude);
- av_free(vc->mappings[i].angle);
- av_free(vc->mappings[i].mux);
- }
- av_freep(&vc->mappings);
-
- if(vc->exp_bias){
- av_freep(&vc->win[0]);
- av_freep(&vc->win[1]);
- }
-}
-
-// Parse setup header -------------------------------------------------
-
-// Process codebooks part
-
-static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc) {
- uint_fast16_t cb;
- uint8_t *tmp_vlc_bits;
- uint32_t *tmp_vlc_codes;
- GetBitContext *gb=&vc->gb;
-
- vc->codebook_count=get_bits(gb,8)+1;
-
- AV_DEBUG(" Codebooks: %d \n", vc->codebook_count);
-
- vc->codebooks=(vorbis_codebook *)av_mallocz(vc->codebook_count * sizeof(vorbis_codebook));
- tmp_vlc_bits=(uint8_t *)av_mallocz(V_MAX_VLCS * sizeof(uint8_t));
- tmp_vlc_codes=(uint32_t *)av_mallocz(V_MAX_VLCS * sizeof(uint32_t));
-
- for(cb=0;cb<vc->codebook_count;++cb) {
- vorbis_codebook *codebook_setup=&vc->codebooks[cb];
- uint_fast8_t ordered;
- uint_fast32_t t, used_entries=0;
- uint_fast32_t entries;
-
- AV_DEBUG(" %d. Codebook \n", cb);
-
- if (get_bits(gb, 24)!=0x564342) {
- av_log(vc->avccontext, AV_LOG_ERROR, " %"PRIdFAST16". Codebook setup data corrupt. \n", cb);
- goto error;
- }
-
- codebook_setup->dimensions=get_bits(gb, 16);
- if (codebook_setup->dimensions>16) {
- av_log(vc->avccontext, AV_LOG_ERROR, " %"PRIdFAST16". Codebook's dimension is too large (%d). \n", cb, codebook_setup->dimensions);
- goto error;
- }
- entries=get_bits(gb, 24);
- if (entries>V_MAX_VLCS) {
- av_log(vc->avccontext, AV_LOG_ERROR, " %"PRIdFAST16". Codebook has too many entries (%"PRIdFAST32"). \n", cb, entries);
- goto error;
- }
-
- ordered=get_bits1(gb);
-
- AV_DEBUG(" codebook_dimensions %d, codebook_entries %d \n", codebook_setup->dimensions, entries);
-
- if (!ordered) {
- uint_fast16_t ce;
- uint_fast8_t flag;
- uint_fast8_t sparse=get_bits1(gb);
-
- AV_DEBUG(" not ordered \n");
-
- if (sparse) {
- AV_DEBUG(" sparse \n");
-
- used_entries=0;
- for(ce=0;ce<entries;++ce) {
- flag=get_bits1(gb);
- if (flag) {
- tmp_vlc_bits[ce]=get_bits(gb, 5)+1;
- ++used_entries;
- }
- else tmp_vlc_bits[ce]=0;
- }
- } else {
- AV_DEBUG(" not sparse \n");
-
- used_entries=entries;
- for(ce=0;ce<entries;++ce) {
- tmp_vlc_bits[ce]=get_bits(gb, 5)+1;
- }
- }
- } else {
- uint_fast16_t current_entry=0;
- uint_fast8_t current_length=get_bits(gb, 5)+1;
-
- AV_DEBUG(" ordered, current length: %d \n", current_length); //FIXME
-
- used_entries=entries;
- for(;current_entry<used_entries;++current_length) {
- uint_fast16_t i, number;
-
- AV_DEBUG(" number bits: %d ", ilog(entries - current_entry));
-
- number=get_bits(gb, ilog(entries - current_entry));
-
- AV_DEBUG(" number: %d \n", number);
-
- for(i=current_entry;i<number+current_entry;++i) {
- if (i<used_entries) tmp_vlc_bits[i]=current_length;
- }
-
- current_entry+=number;
- }
- if (current_entry>used_entries) {
- av_log(vc->avccontext, AV_LOG_ERROR, " More codelengths than codes in codebook. \n");
- goto error;
- }
- }
-
- codebook_setup->lookup_type=get_bits(gb, 4);
-
- AV_DEBUG(" lookup type: %d : %s \n", codebook_setup->lookup_type, codebook_setup->lookup_type ? "vq" : "no lookup" );
-
-// If the codebook is used for (inverse) VQ, calculate codevectors.
-
- if (codebook_setup->lookup_type==1) {
- uint_fast16_t i, j, k;
- uint_fast16_t codebook_lookup_values=ff_vorbis_nth_root(entries, codebook_setup->dimensions);
- uint_fast16_t codebook_multiplicands[codebook_lookup_values];
-
- float codebook_minimum_value=vorbisfloat2float(get_bits_long(gb, 32));
- float codebook_delta_value=vorbisfloat2float(get_bits_long(gb, 32));
- uint_fast8_t codebook_value_bits=get_bits(gb, 4)+1;
- uint_fast8_t codebook_sequence_p=get_bits1(gb);
-
- AV_DEBUG(" We expect %d numbers for building the codevectors. \n", codebook_lookup_values);
- AV_DEBUG(" delta %f minmum %f \n", codebook_delta_value, codebook_minimum_value);
-
- for(i=0;i<codebook_lookup_values;++i) {
- codebook_multiplicands[i]=get_bits(gb, codebook_value_bits);
-
- AV_DEBUG(" multiplicands*delta+minmum : %e \n", (float)codebook_multiplicands[i]*codebook_delta_value+codebook_minimum_value);
- AV_DEBUG(" multiplicand %d \n", codebook_multiplicands[i]);
- }
-
-// Weed out unused vlcs and build codevector vector
- codebook_setup->codevectors=(float *)av_mallocz(used_entries*codebook_setup->dimensions * sizeof(float));
- for(j=0, i=0;i<entries;++i) {
- uint_fast8_t dim=codebook_setup->dimensions;
-
- if (tmp_vlc_bits[i]) {
- float last=0.0;
- uint_fast32_t lookup_offset=i;
-
-#ifdef V_DEBUG
- av_log(vc->avccontext, AV_LOG_INFO, "Lookup offset %d ,", i);
-#endif
-
- for(k=0;k<dim;++k) {
- uint_fast32_t multiplicand_offset = lookup_offset % codebook_lookup_values;
- codebook_setup->codevectors[j*dim+k]=codebook_multiplicands[multiplicand_offset]*codebook_delta_value+codebook_minimum_value+last;
- if (codebook_sequence_p) {
- last=codebook_setup->codevectors[j*dim+k];
- }
- lookup_offset/=codebook_lookup_values;
- }
- tmp_vlc_bits[j]=tmp_vlc_bits[i];
-
-#ifdef V_DEBUG
- av_log(vc->avccontext, AV_LOG_INFO, "real lookup offset %d, vector: ", j);
- for(k=0;k<dim;++k) {
- av_log(vc->avccontext, AV_LOG_INFO, " %f ", codebook_setup->codevectors[j*dim+k]);
- }
- av_log(vc->avccontext, AV_LOG_INFO, "\n");
-#endif
-
- ++j;
- }
- }
- if (j!=used_entries) {
- av_log(vc->avccontext, AV_LOG_ERROR, "Bug in codevector vector building code. \n");
- goto error;
- }
- entries=used_entries;
- }
- else if (codebook_setup->lookup_type>=2) {
- av_log(vc->avccontext, AV_LOG_ERROR, "Codebook lookup type not supported. \n");
- goto error;
- }
-
-// Initialize VLC table
- if (ff_vorbis_len2vlc(tmp_vlc_bits, tmp_vlc_codes, entries)) {
- av_log(vc->avccontext, AV_LOG_ERROR, " Invalid code lengths while generating vlcs. \n");
- goto error;
- }
- codebook_setup->maxdepth=0;
- for(t=0;t<entries;++t)
- if (tmp_vlc_bits[t]>=codebook_setup->maxdepth) codebook_setup->maxdepth=tmp_vlc_bits[t];
-
- if(codebook_setup->maxdepth > 3*V_NB_BITS) codebook_setup->nb_bits=V_NB_BITS2;
- else codebook_setup->nb_bits=V_NB_BITS;
-
- codebook_setup->maxdepth=(codebook_setup->maxdepth+codebook_setup->nb_bits-1)/codebook_setup->nb_bits;
-
- if (init_vlc(&codebook_setup->vlc, codebook_setup->nb_bits, entries, tmp_vlc_bits, sizeof(*tmp_vlc_bits), sizeof(*tmp_vlc_bits), tmp_vlc_codes, sizeof(*tmp_vlc_codes), sizeof(*tmp_vlc_codes), INIT_VLC_LE)) {
- av_log(vc->avccontext, AV_LOG_ERROR, " Error generating vlc tables. \n");
- goto error;
- }
- }
-
- av_free(tmp_vlc_bits);
- av_free(tmp_vlc_codes);
- return 0;
-
-// Error:
-error:
- av_free(tmp_vlc_bits);
- av_free(tmp_vlc_codes);
- return 1;
-}
-
-// Process time domain transforms part (unused in Vorbis I)
-
-static int vorbis_parse_setup_hdr_tdtransforms(vorbis_context *vc) {
- GetBitContext *gb=&vc->gb;
- uint_fast8_t i;
- uint_fast8_t vorbis_time_count=get_bits(gb, 6)+1;
-
- for(i=0;i<vorbis_time_count;++i) {
- uint_fast16_t vorbis_tdtransform=get_bits(gb, 16);
-
- AV_DEBUG(" Vorbis time domain transform %d: %d \n", vorbis_time_count, vorbis_tdtransform);
-
- if (vorbis_tdtransform) {
- av_log(vc->avccontext, AV_LOG_ERROR, "Vorbis time domain transform data nonzero. \n");
- return 1;
- }
- }
- return 0;
-}
-
-// Process floors part
-
-static uint_fast8_t vorbis_floor0_decode(vorbis_context *vc,
- vorbis_floor_data *vfu, float *vec);
-static void create_map( vorbis_context * vc, uint_fast8_t floor_number );
-static uint_fast8_t vorbis_floor1_decode(vorbis_context *vc,
- vorbis_floor_data *vfu, float *vec);
-static int vorbis_parse_setup_hdr_floors(vorbis_context *vc) {
- GetBitContext *gb=&vc->gb;
- uint_fast16_t i,j,k;
-
- vc->floor_count=get_bits(gb, 6)+1;
-
- vc->floors=(vorbis_floor *)av_mallocz(vc->floor_count * sizeof(vorbis_floor));
-
- for (i=0;i<vc->floor_count;++i) {
- vorbis_floor *floor_setup=&vc->floors[i];
-
- floor_setup->floor_type=get_bits(gb, 16);
-
- AV_DEBUG(" %d. floor type %d \n", i, floor_setup->floor_type);
-
- if (floor_setup->floor_type==1) {
- uint_fast8_t maximum_class=0;
- uint_fast8_t rangebits;
- uint_fast16_t floor1_values=2;
-
- floor_setup->decode=vorbis_floor1_decode;
-
- floor_setup->data.t1.partitions=get_bits(gb, 5);
-
- AV_DEBUG(" %d.floor: %d partitions \n", i, floor_setup->data.t1.partitions);
-
- for(j=0;j<floor_setup->data.t1.partitions;++j) {
- floor_setup->data.t1.partition_class[j]=get_bits(gb, 4);
- if (floor_setup->data.t1.partition_class[j]>maximum_class) maximum_class=floor_setup->data.t1.partition_class[j];
-
- AV_DEBUG(" %d. floor %d partition class %d \n", i, j, floor_setup->data.t1.partition_class[j]);
-
- }
-
- AV_DEBUG(" maximum class %d \n", maximum_class);
-
- floor_setup->data.t1.maximum_class=maximum_class;
-
- for(j=0;j<=maximum_class;++j) {
- floor_setup->data.t1.class_dimensions[j]=get_bits(gb, 3)+1;
- floor_setup->data.t1.class_subclasses[j]=get_bits(gb, 2);
-
- AV_DEBUG(" %d floor %d class dim: %d subclasses %d \n", i, j, floor_setup->data.t1.class_dimensions[j], floor_setup->data.t1.class_subclasses[j]);
-
- if (floor_setup->data.t1.class_subclasses[j]) {
- floor_setup->data.t1.class_masterbook[j]=get_bits(gb, 8);
-
- AV_DEBUG(" masterbook: %d \n", floor_setup->data.t1.class_masterbook[j]);
- }
-
- for(k=0;k<(1<<floor_setup->data.t1.class_subclasses[j]);++k) {
- floor_setup->data.t1.subclass_books[j][k]=(int16_t)get_bits(gb, 8)-1;
-
- AV_DEBUG(" book %d. : %d \n", k, floor_setup->data.t1.subclass_books[j][k]);
- }
- }
-
- floor_setup->data.t1.multiplier=get_bits(gb, 2)+1;
- floor_setup->data.t1.x_list_dim=2;
-
- for(j=0;j<floor_setup->data.t1.partitions;++j) {
- floor_setup->data.t1.x_list_dim+=floor_setup->data.t1.class_dimensions[floor_setup->data.t1.partition_class[j]];
- }
-
- floor_setup->data.t1.list=(floor1_entry_t *)av_mallocz(floor_setup->data.t1.x_list_dim * sizeof(floor1_entry_t));
-
-
- rangebits=get_bits(gb, 4);
- floor_setup->data.t1.list[0].x = 0;
- floor_setup->data.t1.list[1].x = (1<<rangebits);
-
- for(j=0;j<floor_setup->data.t1.partitions;++j) {
- for(k=0;k<floor_setup->data.t1.class_dimensions[floor_setup->data.t1.partition_class[j]];++k,++floor1_values) {
- floor_setup->data.t1.list[floor1_values].x=get_bits(gb, rangebits);
-
- AV_DEBUG(" %d. floor1 Y coord. %d \n", floor1_values, floor_setup->data.t1.list[floor1_values].x);
- }
- }
-
-// Precalculate order of x coordinates - needed for decode
- ff_vorbis_ready_floor1_list(floor_setup->data.t1.list, floor_setup->data.t1.x_list_dim);
- }
- else if(floor_setup->floor_type==0) {
- uint_fast8_t max_codebook_dim=0;
-
- floor_setup->decode=vorbis_floor0_decode;
-
- floor_setup->data.t0.order=get_bits(gb, 8);
- floor_setup->data.t0.rate=get_bits(gb, 16);
- floor_setup->data.t0.bark_map_size=get_bits(gb, 16);
- floor_setup->data.t0.amplitude_bits=get_bits(gb, 6);
- /* zero would result in a div by zero later *
- * 2^0 - 1 == 0 */
- if (floor_setup->data.t0.amplitude_bits == 0) {
- av_log(vc->avccontext, AV_LOG_ERROR,
- "Floor 0 amplitude bits is 0.\n");
- return 1;
- }
- floor_setup->data.t0.amplitude_offset=get_bits(gb, 8);
- floor_setup->data.t0.num_books=get_bits(gb, 4)+1;
-
- /* allocate mem for booklist */
- floor_setup->data.t0.book_list=
- av_malloc(floor_setup->data.t0.num_books);
- if(!floor_setup->data.t0.book_list) { return 1; }
- /* read book indexes */
- {
- int idx;
- uint_fast8_t book_idx;
- for (idx=0;idx<floor_setup->data.t0.num_books;++idx) {
- book_idx=get_bits(gb, 8);
- floor_setup->data.t0.book_list[idx]=book_idx;
- if (vc->codebooks[book_idx].dimensions > max_codebook_dim)
- max_codebook_dim=vc->codebooks[book_idx].dimensions;
-
- if (floor_setup->data.t0.book_list[idx]>vc->codebook_count)
- return 1;
- }
- }
-
- create_map( vc, i );
-
- /* allocate mem for lsp coefficients */
- {
- /* codebook dim is for padding if codebook dim doesn't *
- * divide order+1 then we need to read more data */
- floor_setup->data.t0.lsp=
- av_malloc((floor_setup->data.t0.order+1 + max_codebook_dim)
- * sizeof(float));
- if(!floor_setup->data.t0.lsp) { return 1; }
- }
-
-#ifdef V_DEBUG /* debug output parsed headers */
- AV_DEBUG("floor0 order: %u\n", floor_setup->data.t0.order);
- AV_DEBUG("floor0 rate: %u\n", floor_setup->data.t0.rate);
- AV_DEBUG("floor0 bark map size: %u\n",
- floor_setup->data.t0.bark_map_size);
- AV_DEBUG("floor0 amplitude bits: %u\n",
- floor_setup->data.t0.amplitude_bits);
- AV_DEBUG("floor0 amplitude offset: %u\n",
- floor_setup->data.t0.amplitude_offset);
- AV_DEBUG("floor0 number of books: %u\n",
- floor_setup->data.t0.num_books);
- AV_DEBUG("floor0 book list pointer: %p\n",
- floor_setup->data.t0.book_list);
- {
- int idx;
- for (idx=0;idx<floor_setup->data.t0.num_books;++idx) {
- AV_DEBUG( " Book %d: %u\n",
- idx+1,
- floor_setup->data.t0.book_list[idx] );
- }
- }
-#endif
- }
- else {
- av_log(vc->avccontext, AV_LOG_ERROR, "Invalid floor type!\n");
- return 1;
- }
- }
- return 0;
-}
-
-// Process residues part
-
-static int vorbis_parse_setup_hdr_residues(vorbis_context *vc){
- GetBitContext *gb=&vc->gb;
- uint_fast8_t i, j, k;
-
- vc->residue_count=get_bits(gb, 6)+1;
- vc->residues=(vorbis_residue *)av_mallocz(vc->residue_count * sizeof(vorbis_residue));
-
- AV_DEBUG(" There are %d residues. \n", vc->residue_count);
-
- for(i=0;i<vc->residue_count;++i) {
- vorbis_residue *res_setup=&vc->residues[i];
- uint_fast8_t cascade[64];
- uint_fast8_t high_bits;
- uint_fast8_t low_bits;
-
- res_setup->type=get_bits(gb, 16);
-
- AV_DEBUG(" %d. residue type %d \n", i, res_setup->type);
-
- res_setup->begin=get_bits(gb, 24);
- res_setup->end=get_bits(gb, 24);
- res_setup->partition_size=get_bits(gb, 24)+1;
- res_setup->classifications=get_bits(gb, 6)+1;
- res_setup->classbook=get_bits(gb, 8);
-
- AV_DEBUG(" begin %d end %d part.size %d classif.s %d classbook %d \n", res_setup->begin, res_setup->end, res_setup->partition_size,
- res_setup->classifications, res_setup->classbook);
-
- for(j=0;j<res_setup->classifications;++j) {
- high_bits=0;
- low_bits=get_bits(gb, 3);
- if (get_bits1(gb)) {
- high_bits=get_bits(gb, 5);
- }
- cascade[j]=(high_bits<<3)+low_bits;
-
- AV_DEBUG(" %d class casscade depth: %d \n", j, ilog(cascade[j]));
- }
-
- res_setup->maxpass=0;
- for(j=0;j<res_setup->classifications;++j) {
- for(k=0;k<8;++k) {
- if (cascade[j]&(1<<k)) {
- res_setup->books[j][k]=get_bits(gb, 8);
-
- AV_DEBUG(" %d class casscade depth %d book: %d \n", j, k, res_setup->books[j][k]);
-
- if (k>res_setup->maxpass) {
- res_setup->maxpass=k;
- }
- } else {
- res_setup->books[j][k]=-1;
- }
- }
- }
- }
- return 0;
-}
-
-// Process mappings part
-
-static int vorbis_parse_setup_hdr_mappings(vorbis_context *vc) {
- GetBitContext *gb=&vc->gb;
- uint_fast8_t i, j;
-
- vc->mapping_count=get_bits(gb, 6)+1;
- vc->mappings=(vorbis_mapping *)av_mallocz(vc->mapping_count * sizeof(vorbis_mapping));
-
- AV_DEBUG(" There are %d mappings. \n", vc->mapping_count);
-
- for(i=0;i<vc->mapping_count;++i) {
- vorbis_mapping *mapping_setup=&vc->mappings[i];
-
- if (get_bits(gb, 16)) {
- av_log(vc->avccontext, AV_LOG_ERROR, "Other mappings than type 0 are not compliant with the Vorbis I specification. \n");
- return 1;
- }
- if (get_bits1(gb)) {
- mapping_setup->submaps=get_bits(gb, 4)+1;
- } else {
- mapping_setup->submaps=1;
- }
-
- if (get_bits1(gb)) {
- mapping_setup->coupling_steps=get_bits(gb, 8)+1;
- mapping_setup->magnitude=(uint_fast8_t *)av_mallocz(mapping_setup->coupling_steps * sizeof(uint_fast8_t));
- mapping_setup->angle=(uint_fast8_t *)av_mallocz(mapping_setup->coupling_steps * sizeof(uint_fast8_t));
- for(j=0;j<mapping_setup->coupling_steps;++j) {
- mapping_setup->magnitude[j]=get_bits(gb, ilog(vc->audio_channels-1));
- mapping_setup->angle[j]=get_bits(gb, ilog(vc->audio_channels-1));
- // FIXME: sanity checks
- }
- } else {
- mapping_setup->coupling_steps=0;
- }
-
- AV_DEBUG(" %d mapping coupling steps: %d \n", i, mapping_setup->coupling_steps);
-
- if(get_bits(gb, 2)) {
- av_log(vc->avccontext, AV_LOG_ERROR, "%d. mapping setup data invalid. \n", i);
- return 1; // following spec.
- }
-
- if (mapping_setup->submaps>1) {
- mapping_setup->mux=(uint_fast8_t *)av_mallocz(vc->audio_channels * sizeof(uint_fast8_t));
- for(j=0;j<vc->audio_channels;++j) {
- mapping_setup->mux[j]=get_bits(gb, 4);
- }
- }
-
- for(j=0;j<mapping_setup->submaps;++j) {
- get_bits(gb, 8); // FIXME check?
- mapping_setup->submap_floor[j]=get_bits(gb, 8);
- mapping_setup->submap_residue[j]=get_bits(gb, 8);
-
- AV_DEBUG(" %d mapping %d submap : floor %d, residue %d \n", i, j, mapping_setup->submap_floor[j], mapping_setup->submap_residue[j]);
- }
- }
- return 0;
-}
-
-// Process modes part
-
-static void create_map( vorbis_context * vc, uint_fast8_t floor_number )
-{
- vorbis_floor * floors=vc->floors;
- vorbis_floor0 * vf;
- int idx;
- int_fast8_t blockflag;
- int_fast32_t * map;
- int_fast32_t n; //TODO: could theoretically be smaller?
-
- for (blockflag=0;blockflag<2;++blockflag)
- {
- n=vc->blocksize[blockflag]/2;
- floors[floor_number].data.t0.map[blockflag]=
- av_malloc((n+1) * sizeof(int_fast32_t)); // n+sentinel
-
- map=floors[floor_number].data.t0.map[blockflag];
- vf=&floors[floor_number].data.t0;
-
- for (idx=0; idx<n;++idx) {
- map[idx]=floor( BARK((vf->rate*idx)/(2.0f*n)) *
- ((vf->bark_map_size)/
- BARK(vf->rate/2.0f )) );
- if (vf->bark_map_size-1 < map[idx]) {
- map[idx]=vf->bark_map_size-1;
- }
- }
- map[n]=-1;
- vf->map_size[blockflag]=n;
- }
-
-# ifdef V_DEBUG
- for(idx=0;idx<=n;++idx) {
- AV_DEBUG("floor0 map: map at pos %d is %d\n",
- idx, map[idx]);
- }
-# endif
-}
-
-static int vorbis_parse_setup_hdr_modes(vorbis_context *vc) {
- GetBitContext *gb=&vc->gb;
- uint_fast8_t i;
-
- vc->mode_count=get_bits(gb, 6)+1;
- vc->modes=(vorbis_mode *)av_mallocz(vc->mode_count * sizeof(vorbis_mode));
-
- AV_DEBUG(" There are %d modes.\n", vc->mode_count);
-
- for(i=0;i<vc->mode_count;++i) {
- vorbis_mode *mode_setup=&vc->modes[i];
-
- mode_setup->blockflag=get_bits(gb, 1);
- mode_setup->windowtype=get_bits(gb, 16); //FIXME check
- mode_setup->transformtype=get_bits(gb, 16); //FIXME check
- mode_setup->mapping=get_bits(gb, 8); //FIXME check
-
- AV_DEBUG(" %d mode: blockflag %d, windowtype %d, transformtype %d, mapping %d \n", i, mode_setup->blockflag, mode_setup->windowtype, mode_setup->transformtype, mode_setup->mapping);
- }
- return 0;
-}
-
-// Process the whole setup header using the functions above
-
-static int vorbis_parse_setup_hdr(vorbis_context *vc) {
- GetBitContext *gb=&vc->gb;
-
- if ((get_bits(gb, 8)!='v') || (get_bits(gb, 8)!='o') ||
- (get_bits(gb, 8)!='r') || (get_bits(gb, 8)!='b') ||
- (get_bits(gb, 8)!='i') || (get_bits(gb, 8)!='s')) {
- av_log(vc->avccontext, AV_LOG_ERROR, " Vorbis setup header packet corrupt (no vorbis signature). \n");
- return 1;
- }
-
- if (vorbis_parse_setup_hdr_codebooks(vc)) {
- av_log(vc->avccontext, AV_LOG_ERROR, " Vorbis setup header packet corrupt (codebooks). \n");
- return 2;
- }
- if (vorbis_parse_setup_hdr_tdtransforms(vc)) {
- av_log(vc->avccontext, AV_LOG_ERROR, " Vorbis setup header packet corrupt (time domain transforms). \n");
- return 3;
- }
- if (vorbis_parse_setup_hdr_floors(vc)) {
- av_log(vc->avccontext, AV_LOG_ERROR, " Vorbis setup header packet corrupt (floors). \n");
- return 4;
- }
- if (vorbis_parse_setup_hdr_residues(vc)) {
- av_log(vc->avccontext, AV_LOG_ERROR, " Vorbis setup header packet corrupt (residues). \n");
- return 5;
- }
- if (vorbis_parse_setup_hdr_mappings(vc)) {
- av_log(vc->avccontext, AV_LOG_ERROR, " Vorbis setup header packet corrupt (mappings). \n");
- return 6;
- }
- if (vorbis_parse_setup_hdr_modes(vc)) {
- av_log(vc->avccontext, AV_LOG_ERROR, " Vorbis setup header packet corrupt (modes). \n");
- return 7;
- }
- if (!get_bits1(gb)) {
- av_log(vc->avccontext, AV_LOG_ERROR, " Vorbis setup header packet corrupt (framing flag). \n");
- return 8; // framing flag bit unset error
- }
-
- return 0;
-}
-
-// Process the identification header
-
-static int vorbis_parse_id_hdr(vorbis_context *vc){
- GetBitContext *gb=&vc->gb;
- uint_fast8_t bl0, bl1;
-
- if ((get_bits(gb, 8)!='v') || (get_bits(gb, 8)!='o') ||
- (get_bits(gb, 8)!='r') || (get_bits(gb, 8)!='b') ||
- (get_bits(gb, 8)!='i') || (get_bits(gb, 8)!='s')) {
- av_log(vc->avccontext, AV_LOG_ERROR, " Vorbis id header packet corrupt (no vorbis signature). \n");
- return 1;
- }
-
- vc->version=get_bits_long(gb, 32); //FIXME check 0
- vc->audio_channels=get_bits(gb, 8); //FIXME check >0
- vc->audio_samplerate=get_bits_long(gb, 32); //FIXME check >0
- vc->bitrate_maximum=get_bits_long(gb, 32);
- vc->bitrate_nominal=get_bits_long(gb, 32);
- vc->bitrate_minimum=get_bits_long(gb, 32);
- bl0=get_bits(gb, 4);
- bl1=get_bits(gb, 4);
- vc->blocksize[0]=(1<<bl0);
- vc->blocksize[1]=(1<<bl1);
- if (bl0>13 || bl0<6 || bl1>13 || bl1<6 || bl1<bl0) {
- av_log(vc->avccontext, AV_LOG_ERROR, " Vorbis id header packet corrupt (illegal blocksize). \n");
- return 3;
- }
- // output format int16
- if (vc->blocksize[1]/2 * vc->audio_channels * 2 >
- AVCODEC_MAX_AUDIO_FRAME_SIZE) {
- av_log(vc->avccontext, AV_LOG_ERROR, "Vorbis channel count makes "
- "output packets too large.\n");
- return 4;
- }
- vc->win[0]=ff_vorbis_vwin[bl0-6];
- vc->win[1]=ff_vorbis_vwin[bl1-6];
-
- if(vc->exp_bias){
- int i, j;
- for(j=0; j<2; j++){
- float *win = av_malloc(vc->blocksize[j]/2 * sizeof(float));
- for(i=0; i<vc->blocksize[j]/2; i++)
- win[i] = vc->win[j][i] * (1<<15);
- vc->win[j] = win;
- }
- }
-
- if ((get_bits1(gb)) == 0) {
- av_log(vc->avccontext, AV_LOG_ERROR, " Vorbis id header packet corrupt (framing flag not set). \n");
- return 2;
- }
-
- vc->channel_residues=(float *)av_malloc((vc->blocksize[1]/2)*vc->audio_channels * sizeof(float));
- vc->channel_floors=(float *)av_malloc((vc->blocksize[1]/2)*vc->audio_channels * sizeof(float));
- vc->saved=(float *)av_malloc((vc->blocksize[1]/2)*vc->audio_channels * sizeof(float));
- vc->ret=(float *)av_malloc((vc->blocksize[1]/2)*vc->audio_channels * sizeof(float));
- vc->buf=(float *)av_malloc(vc->blocksize[1] * sizeof(float));
- vc->buf_tmp=(float *)av_malloc(vc->blocksize[1] * sizeof(float));
- vc->saved_start=0;
-
- ff_mdct_init(&vc->mdct[0], bl0, 1);
- ff_mdct_init(&vc->mdct[1], bl1, 1);
-
- AV_DEBUG(" vorbis version %d \n audio_channels %d \n audio_samplerate %d \n bitrate_max %d \n bitrate_nom %d \n bitrate_min %d \n blk_0 %d blk_1 %d \n ",
- vc->version, vc->audio_channels, vc->audio_samplerate, vc->bitrate_maximum, vc->bitrate_nominal, vc->bitrate_minimum, vc->blocksize[0], vc->blocksize[1]);
-
-/*
- BLK=vc->blocksize[0];
- for(i=0;i<BLK/2;++i) {
- vc->win[0][i]=sin(0.5*3.14159265358*(sin(((float)i+0.5)/(float)BLK*3.14159265358))*(sin(((float)i+0.5)/(float)BLK*3.14159265358)));
- }
-*/
-
- return 0;
-}
-
-// Process the extradata using the functions above (identification header, setup header)
-
-static int vorbis_decode_init(AVCodecContext *avccontext) {
- vorbis_context *vc = avccontext->priv_data ;
- uint8_t *headers = avccontext->extradata;
- int headers_len=avccontext->extradata_size;
- uint8_t *header_start[3];
- int header_len[3];
- GetBitContext *gb = &(vc->gb);
- int i, j, hdr_type;
-
- vc->avccontext = avccontext;
- dsputil_init(&vc->dsp, avccontext);
-
- if(vc->dsp.float_to_int16 == ff_float_to_int16_c) {
- vc->add_bias = 385;
- vc->exp_bias = 0;
- } else {
- vc->add_bias = 0;
- vc->exp_bias = 15<<23;
- }
-
- if (!headers_len) {
- av_log(avccontext, AV_LOG_ERROR, "Extradata corrupt.\n");
- return -1;
- }
-
- if(headers[0] == 0 && headers[1] == 30) {
- for(i = 0; i < 3; i++){
- header_len[i] = *headers++ << 8;
- header_len[i] += *headers++;
- header_start[i] = headers;
- headers += header_len[i];
- }
- } else if(headers[0] == 2) {
- for(j=1,i=0;i<2;++i, ++j) {
- header_len[i]=0;
- while(j<headers_len && headers[j]==0xff) {
- header_len[i]+=0xff;
- ++j;
- }
- if (j>=headers_len) {
- av_log(avccontext, AV_LOG_ERROR, "Extradata corrupt.\n");
- return -1;
- }
- header_len[i]+=headers[j];
- }
- header_len[2]=headers_len-header_len[0]-header_len[1]-j;
- headers+=j;
- header_start[0] = headers;
- header_start[1] = header_start[0] + header_len[0];
- header_start[2] = header_start[1] + header_len[1];
- } else {
- av_log(avccontext, AV_LOG_ERROR, "Extradata corrupt.\n");
- return -1;
- }
-
- init_get_bits(gb, header_start[0], header_len[0]*8);
- hdr_type=get_bits(gb, 8);
- if (hdr_type!=1) {
- av_log(avccontext, AV_LOG_ERROR, "First header is not the id header.\n");
- return -1;
- }
- if (vorbis_parse_id_hdr(vc)) {
- av_log(avccontext, AV_LOG_ERROR, "Id header corrupt.\n");
- vorbis_free(vc);
- return -1;
- }
-
- init_get_bits(gb, header_start[2], header_len[2]*8);
- hdr_type=get_bits(gb, 8);
- if (hdr_type!=5) {
- av_log(avccontext, AV_LOG_ERROR, "Third header is not the setup header.\n");
- return -1;
- }
- if (vorbis_parse_setup_hdr(vc)) {
- av_log(avccontext, AV_LOG_ERROR, "Setup header corrupt.\n");
- vorbis_free(vc);
- return -1;
- }
-
- avccontext->channels = vc->audio_channels;
- avccontext->sample_rate = vc->audio_samplerate;
-
- return 0 ;
-}
-
-// Decode audiopackets -------------------------------------------------
-
-// Read and decode floor
-
-static uint_fast8_t vorbis_floor0_decode(vorbis_context *vc,
- vorbis_floor_data *vfu, float *vec) {
- vorbis_floor0 * vf=&vfu->t0;
- float * lsp=vf->lsp;
- uint_fast32_t amplitude;
- uint_fast32_t book_idx;
- uint_fast8_t blockflag=vc->modes[vc->mode_number].blockflag;
-
- amplitude=get_bits(&vc->gb, vf->amplitude_bits);
- if (amplitude>0) {
- float last = 0;
- uint_fast16_t lsp_len = 0;
- uint_fast16_t idx;
- vorbis_codebook codebook;
-
- book_idx=get_bits(&vc->gb, ilog(vf->num_books));
- if ( book_idx >= vf->num_books ) {
- av_log( vc->avccontext, AV_LOG_ERROR,
- "floor0 dec: booknumber too high!\n" );
- //FIXME: look above
- }
- AV_DEBUG( "floor0 dec: booknumber: %u\n", book_idx );
- codebook=vc->codebooks[vf->book_list[book_idx]];
-
- while (lsp_len<vf->order) {
- int vec_off;
-
- AV_DEBUG( "floor0 dec: book dimension: %d\n", codebook.dimensions );
- AV_DEBUG( "floor0 dec: maximum depth: %d\n", codebook.maxdepth );
- /* read temp vector */
- vec_off=get_vlc2(&vc->gb,
- codebook.vlc.table,
- codebook.nb_bits,
- codebook.maxdepth ) *
- codebook.dimensions;
- AV_DEBUG( "floor0 dec: vector offset: %d\n", vec_off );
- /* copy each vector component and add last to it */
- for (idx=0; idx<codebook.dimensions; ++idx) {
- lsp[lsp_len+idx]=codebook.codevectors[vec_off+idx]+last;
- }
- last=lsp[lsp_len+idx-1]; /* set last to last vector component */
-
- lsp_len += codebook.dimensions;
- }
-#ifdef V_DEBUG
- /* DEBUG: output lsp coeffs */
- {
- int idx;
- for ( idx = 0; idx < lsp_len; ++idx )
- AV_DEBUG("floor0 dec: coeff at %d is %f\n", idx, lsp[idx] );
- }
-#endif
-
- /* synthesize floor output vector */
- {
- int i;
- int order=vf->order;
- float wstep=M_PI/vf->bark_map_size;
-
- for(i=0;i<order;i++) { lsp[i]=2.0f*cos(lsp[i]); }
-
- AV_DEBUG("floor0 synth: map_size=%d; m=%d; wstep=%f\n",
- vf->map_size, order, wstep);
-
- i=0;
- while(i<vf->map_size[blockflag]) {
- int j, iter_cond=vf->map[blockflag][i];
- float p=0.5f;
- float q=0.5f;
- float two_cos_w=2.0f*cos(wstep*iter_cond); // needed all times
-
- /* similar part for the q and p products */
- for(j=0;j<order;j+=2) {
- q *= lsp[j] -two_cos_w;
- p *= lsp[j+1]-two_cos_w;
- }
- if(j==order) { // even order
- p *= p*(2.0f-two_cos_w);
- q *= q*(2.0f+two_cos_w);
- }
- else { // odd order
- q *= two_cos_w-lsp[j]; // one more time for q
-
- /* final step and square */
- p *= p*(4.f-two_cos_w*two_cos_w);
- q *= q;
- }
-
- /* calculate linear floor value */
- {
- q=exp( (
- ( (amplitude*vf->amplitude_offset)/
- (((1<<vf->amplitude_bits)-1) * sqrt(p+q)) )
- - vf->amplitude_offset ) * .11512925f
- );
- }
-
- /* fill vector */
- do { vec[i]=q; ++i; }while(vf->map[blockflag][i]==iter_cond);
- }
- }
- }
- else {
- /* this channel is unused */
- return 1;
- }
-
- AV_DEBUG(" Floor0 decoded\n");
-
- return 0;
-}
-
-static void render_line(int x0, int y0, int x1, int y1, float * buf, int n) {
- int dy = y1 - y0;
- int adx = x1 - x0;
- int ady = FFABS(dy);
- int base = dy / adx;
- int x = x0;
- int y = y0;
- int err = 0;
- int sy;
- if (dy < 0) sy = base - 1;
- else sy = base + 1;
- ady = ady - FFABS(base) * adx;
- if (x >= n) return;
- buf[x] = ff_vorbis_floor1_inverse_db_table[y];
- for (x = x0 + 1; x < x1; x++) {
- if (x >= n) return;
- err += ady;
- if (err >= adx) {
- err -= adx;
- y += sy;
- } else {
- y += base;
- }
- buf[x] = ff_vorbis_floor1_inverse_db_table[y];
- }
-}
-
-void ff_vorbis_floor1_render_list(floor1_entry_t * list, int values, uint_fast16_t * y_list, int * flag, int multiplier, float * out, int samples) {
- int lx, ly, i;
- lx = 0;
- ly = y_list[0] * multiplier;
- for (i = 1; i < values; i++) {
- int pos = list[i].sort;
- if (flag[pos]) {
- render_line(lx, ly, list[pos].x, y_list[pos] * multiplier, out, samples);
- lx = list[pos].x;
- ly = y_list[pos] * multiplier;
- }
- if (lx >= samples) break;
- }
- if (lx < samples) render_line(lx, ly, samples, ly, out, samples);
-}
-
-static uint_fast8_t vorbis_floor1_decode(vorbis_context *vc, vorbis_floor_data *vfu, float *vec) {
- vorbis_floor1 * vf=&vfu->t1;
- GetBitContext *gb=&vc->gb;
- uint_fast16_t range_v[4]={ 256, 128, 86, 64 };
- uint_fast16_t range=range_v[vf->multiplier-1];
- uint_fast16_t floor1_Y[vf->x_list_dim];
- uint_fast16_t floor1_Y_final[vf->x_list_dim];
- int floor1_flag[vf->x_list_dim];
- uint_fast8_t class_;
- uint_fast8_t cdim;
- uint_fast8_t cbits;
- uint_fast8_t csub;
- uint_fast8_t cval;
- int_fast16_t book;
- uint_fast16_t offset;
- uint_fast16_t i,j;
- /*u*/int_fast16_t adx, ady, off, predicted; // WTF ? dy/adx= (unsigned)dy/adx ?
- int_fast16_t dy, err;
-
-
- if (!get_bits1(gb)) return 1; // silence
-
-// Read values (or differences) for the floor's points
-
- floor1_Y[0]=get_bits(gb, ilog(range-1));
- floor1_Y[1]=get_bits(gb, ilog(range-1));
-
- AV_DEBUG("floor 0 Y %d floor 1 Y %d \n", floor1_Y[0], floor1_Y[1]);
-
- offset=2;
- for(i=0;i<vf->partitions;++i) {
- class_=vf->partition_class[i];
- cdim=vf->class_dimensions[class_];
- cbits=vf->class_subclasses[class_];
- csub=(1<<cbits)-1;
- cval=0;
-
- AV_DEBUG("Cbits %d \n", cbits);
-
- if (cbits) { // this reads all subclasses for this partition's class
- cval=get_vlc2(gb, vc->codebooks[vf->class_masterbook[class_]].vlc.table,
- vc->codebooks[vf->class_masterbook[class_]].nb_bits, 3);
- }
-
- for(j=0;j<cdim;++j) {
- book=vf->subclass_books[class_][cval & csub];
-
- AV_DEBUG("book %d Cbits %d cval %d bits:%d \n", book, cbits, cval, get_bits_count(gb));
-
- cval=cval>>cbits;
- if (book>-1) {
- floor1_Y[offset+j]=get_vlc2(gb, vc->codebooks[book].vlc.table,
- vc->codebooks[book].nb_bits, 3);
- } else {
- floor1_Y[offset+j]=0;
- }
-
- AV_DEBUG(" floor(%d) = %d \n", vf->list[offset+j].x, floor1_Y[offset+j]);
- }
- offset+=cdim;
- }
-
-// Amplitude calculation from the differences
-
- floor1_flag[0]=1;
- floor1_flag[1]=1;
- floor1_Y_final[0]=floor1_Y[0];
- floor1_Y_final[1]=floor1_Y[1];
-
- for(i=2;i<vf->x_list_dim;++i) {
- uint_fast16_t val, highroom, lowroom, room;
- uint_fast16_t high_neigh_offs;
- uint_fast16_t low_neigh_offs;
-
- low_neigh_offs=vf->list[i].low;
- high_neigh_offs=vf->list[i].high;
- dy=floor1_Y_final[high_neigh_offs]-floor1_Y_final[low_neigh_offs]; // render_point begin
- adx=vf->list[high_neigh_offs].x-vf->list[low_neigh_offs].x;
- ady= FFABS(dy);
- err=ady*(vf->list[i].x-vf->list[low_neigh_offs].x);
- off=(int16_t)err/(int16_t)adx;
- if (dy<0) {
- predicted=floor1_Y_final[low_neigh_offs]-off;
- } else {
- predicted=floor1_Y_final[low_neigh_offs]+off;
- } // render_point end
-
- val=floor1_Y[i];
- highroom=range-predicted;
- lowroom=predicted;
- if (highroom < lowroom) {
- room=highroom*2;
- } else {
- room=lowroom*2; // SPEC mispelling
- }
- if (val) {
- floor1_flag[low_neigh_offs]=1;
- floor1_flag[high_neigh_offs]=1;
- floor1_flag[i]=1;
- if (val>=room) {
- if (highroom > lowroom) {
- floor1_Y_final[i]=val-lowroom+predicted;
- } else {
- floor1_Y_final[i]=predicted-val+highroom-1;
- }
- } else {
- if (val & 1) {
- floor1_Y_final[i]=predicted-(val+1)/2;
- } else {
- floor1_Y_final[i]=predicted+val/2;
- }
- }
- } else {
- floor1_flag[i]=0;
- floor1_Y_final[i]=predicted;
- }
-
- AV_DEBUG(" Decoded floor(%d) = %d / val %d \n", vf->list[i].x, floor1_Y_final[i], val);
- }
-
-// Curve synth - connect the calculated dots and convert from dB scale FIXME optimize ?
-
- ff_vorbis_floor1_render_list(vf->list, vf->x_list_dim, floor1_Y_final, floor1_flag, vf->multiplier, vec, vf->list[1].x);
-
- AV_DEBUG(" Floor decoded\n");
-
- return 0;
-}
-
-// Read and decode residue
-
-static int vorbis_residue_decode(vorbis_context *vc, vorbis_residue *vr, uint_fast8_t ch, uint_fast8_t *do_not_decode, float *vec, uint_fast16_t vlen) {
- GetBitContext *gb=&vc->gb;
- uint_fast8_t c_p_c=vc->codebooks[vr->classbook].dimensions;
- uint_fast16_t n_to_read=vr->end-vr->begin;
- uint_fast16_t ptns_to_read=n_to_read/vr->partition_size;
- uint_fast8_t classifs[ptns_to_read*vc->audio_channels];
- uint_fast8_t pass;
- uint_fast8_t ch_used;
- uint_fast8_t i,j,l;
- uint_fast16_t k;
-
- if (vr->type==2) {
- for(j=1;j<ch;++j) {
- do_not_decode[0]&=do_not_decode[j]; // FIXME - clobbering input
- }
- if (do_not_decode[0]) return 0;
- ch_used=1;
- } else {
- ch_used=ch;
- }
-
- AV_DEBUG(" residue type 0/1/2 decode begin, ch: %d cpc %d \n", ch, c_p_c);
-
- for(pass=0;pass<=vr->maxpass;++pass) { // FIXME OPTIMIZE?
- uint_fast16_t voffset;
- uint_fast16_t partition_count;
- uint_fast16_t j_times_ptns_to_read;
-
- voffset=vr->begin;
- for(partition_count=0;partition_count<ptns_to_read;) { // SPEC error
- if (!pass) {
- uint_fast32_t inverse_class = ff_inverse[vr->classifications];
- for(j_times_ptns_to_read=0, j=0;j<ch_used;++j) {
- if (!do_not_decode[j]) {
- uint_fast32_t temp=get_vlc2(gb, vc->codebooks[vr->classbook].vlc.table,
- vc->codebooks[vr->classbook].nb_bits, 3);
-
- AV_DEBUG("Classword: %d \n", temp);
-
- assert(vr->classifications > 1 && temp<=65536); //needed for inverse[]
- for(i=0;i<c_p_c;++i) {
- uint_fast32_t temp2;
-
- temp2=(((uint_fast64_t)temp) * inverse_class)>>32;
- if (partition_count+c_p_c-1-i < ptns_to_read) {
- classifs[j_times_ptns_to_read+partition_count+c_p_c-1-i]=temp-temp2*vr->classifications;
- }
- temp=temp2;
- }
- }
- j_times_ptns_to_read+=ptns_to_read;
- }
- }
- for(i=0;(i<c_p_c) && (partition_count<ptns_to_read);++i) {
- for(j_times_ptns_to_read=0, j=0;j<ch_used;++j) {
- uint_fast16_t voffs;
-
- if (!do_not_decode[j]) {
- uint_fast8_t vqclass=classifs[j_times_ptns_to_read+partition_count];
- int_fast16_t vqbook=vr->books[vqclass][pass];
-
- if (vqbook>=0) {
- uint_fast16_t coffs;
- unsigned dim= vc->codebooks[vqbook].dimensions; // not uint_fast8_t: 64bit is slower here on amd64
- uint_fast16_t step= dim==1 ? vr->partition_size
- : FASTDIV(vr->partition_size, dim);
- vorbis_codebook codebook= vc->codebooks[vqbook];
-
- if (vr->type==0) {
-
- voffs=voffset+j*vlen;
- for(k=0;k<step;++k) {
- coffs=get_vlc2(gb, codebook.vlc.table, codebook.nb_bits, 3) * dim;
- for(l=0;l<dim;++l) {
- vec[voffs+k+l*step]+=codebook.codevectors[coffs+l]; // FPMATH
- }
- }
- }
- else if (vr->type==1) {
- voffs=voffset+j*vlen;
- for(k=0;k<step;++k) {
- coffs=get_vlc2(gb, codebook.vlc.table, codebook.nb_bits, 3) * dim;
- for(l=0;l<dim;++l, ++voffs) {
- vec[voffs]+=codebook.codevectors[coffs+l]; // FPMATH
-
- AV_DEBUG(" pass %d offs: %d curr: %f change: %f cv offs.: %d \n", pass, voffs, vec[voffs], codebook.codevectors[coffs+l], coffs);
- }
- }
- }
- else if (vr->type==2 && ch==2 && (voffset&1)==0 && (dim&1)==0) { // most frequent case optimized
- voffs=voffset>>1;
-
- if(dim==2) {
- for(k=0;k<step;++k) {
- coffs=get_vlc2(gb, codebook.vlc.table, codebook.nb_bits, 3) * 2;
- vec[voffs+k ]+=codebook.codevectors[coffs ]; // FPMATH
- vec[voffs+k+vlen]+=codebook.codevectors[coffs+1]; // FPMATH
- }
- } else
- for(k=0;k<step;++k) {
- coffs=get_vlc2(gb, codebook.vlc.table, codebook.nb_bits, 3) * dim;
- for(l=0;l<dim;l+=2, voffs++) {
- vec[voffs ]+=codebook.codevectors[coffs+l ]; // FPMATH
- vec[voffs+vlen]+=codebook.codevectors[coffs+l+1]; // FPMATH
-
- AV_DEBUG(" pass %d offs: %d curr: %f change: %f cv offs.: %d+%d \n", pass, voffset/ch+(voffs%ch)*vlen, vec[voffset/ch+(voffs%ch)*vlen], codebook.codevectors[coffs+l], coffs, l);
- }
- }
-
- }
- else if (vr->type==2) {
- voffs=voffset;
-
- for(k=0;k<step;++k) {
- coffs=get_vlc2(gb, codebook.vlc.table, codebook.nb_bits, 3) * dim;
- for(l=0;l<dim;++l, ++voffs) {
- vec[voffs/ch+(voffs%ch)*vlen]+=codebook.codevectors[coffs+l]; // FPMATH FIXME use if and counter instead of / and %
-
- AV_DEBUG(" pass %d offs: %d curr: %f change: %f cv offs.: %d+%d \n", pass, voffset/ch+(voffs%ch)*vlen, vec[voffset/ch+(voffs%ch)*vlen], codebook.codevectors[coffs+l], coffs, l);
- }
- }
- } else {
- av_log(vc->avccontext, AV_LOG_ERROR, " Invalid residue type while residue decode?! \n");
- return 1;
- }
- }
- }
- j_times_ptns_to_read+=ptns_to_read;
- }
- ++partition_count;
- voffset+=vr->partition_size;
- }
- }
- }
- return 0;
-}
-
-void vorbis_inverse_coupling(float *mag, float *ang, int blocksize)
-{
- int i;
- for(i=0; i<blocksize; i++)
- {
- if (mag[i]>0.0) {
- if (ang[i]>0.0) {
- ang[i]=mag[i]-ang[i];
- } else {
- float temp=ang[i];
- ang[i]=mag[i];
- mag[i]+=temp;
- }
- } else {
- if (ang[i]>0.0) {
- ang[i]+=mag[i];
- } else {
- float temp=ang[i];
- ang[i]=mag[i];
- mag[i]-=temp;
- }
- }
- }
-}
-
-// Decode the audio packet using the functions above
-
-static int vorbis_parse_audio_packet(vorbis_context *vc) {
- GetBitContext *gb=&vc->gb;
-
- uint_fast8_t previous_window=0,next_window=0;
- uint_fast8_t mode_number;
- uint_fast16_t blocksize;
- int_fast32_t i,j;
- uint_fast8_t no_residue[vc->audio_channels];
- uint_fast8_t do_not_decode[vc->audio_channels];
- vorbis_mapping *mapping;
- float *ch_res_ptr=vc->channel_residues;
- float *ch_floor_ptr=vc->channel_floors;
- uint_fast8_t res_chan[vc->audio_channels];
- uint_fast8_t res_num=0;
- int_fast16_t retlen=0;
- uint_fast16_t saved_start=0;
- float fadd_bias = vc->add_bias;
-
- if (get_bits1(gb)) {
- av_log(vc->avccontext, AV_LOG_ERROR, "Not a Vorbis I audio packet.\n");
- return -1; // packet type not audio
- }
-
- if (vc->mode_count==1) {
- mode_number=0;
- } else {
- mode_number=get_bits(gb, ilog(vc->mode_count-1));
- }
- vc->mode_number=mode_number;
- mapping=&vc->mappings[vc->modes[mode_number].mapping];
-
- AV_DEBUG(" Mode number: %d , mapping: %d , blocktype %d \n", mode_number, vc->modes[mode_number].mapping, vc->modes[mode_number].blockflag);
-
- if (vc->modes[mode_number].blockflag) {
- previous_window=get_bits1(gb);
- next_window=get_bits1(gb);
- }
-
- blocksize=vc->blocksize[vc->modes[mode_number].blockflag];
- memset(ch_res_ptr, 0, sizeof(float)*vc->audio_channels*blocksize/2); //FIXME can this be removed ?
- memset(ch_floor_ptr, 0, sizeof(float)*vc->audio_channels*blocksize/2); //FIXME can this be removed ?
-
-// Decode floor
-
- for(i=0;i<vc->audio_channels;++i) {
- vorbis_floor *floor;
- if (mapping->submaps>1) {
- floor=&vc->floors[mapping->submap_floor[mapping->mux[i]]];
- } else {
- floor=&vc->floors[mapping->submap_floor[0]];
- }
-
- no_residue[i]=floor->decode(vc, &floor->data, ch_floor_ptr);
- ch_floor_ptr+=blocksize/2;
- }
-
-// Nonzero vector propagate
-
- for(i=mapping->coupling_steps-1;i>=0;--i) {
- if (!(no_residue[mapping->magnitude[i]] & no_residue[mapping->angle[i]])) {
- no_residue[mapping->magnitude[i]]=0;
- no_residue[mapping->angle[i]]=0;
- }
- }
-
-// Decode residue
-
- for(i=0;i<mapping->submaps;++i) {
- vorbis_residue *residue;
- uint_fast8_t ch=0;
-
- for(j=0;j<vc->audio_channels;++j) {
- if ((mapping->submaps==1) || (i=mapping->mux[j])) {
- res_chan[j]=res_num;
- if (no_residue[j]) {
- do_not_decode[ch]=1;
- } else {
- do_not_decode[ch]=0;
- }
- ++ch;
- ++res_num;
- }
- }
- residue=&vc->residues[mapping->submap_residue[i]];
- vorbis_residue_decode(vc, residue, ch, do_not_decode, ch_res_ptr, blocksize/2);
-
- ch_res_ptr+=ch*blocksize/2;
- }
-
-// Inverse coupling
-
- for(i=mapping->coupling_steps-1;i>=0;--i) { //warning: i has to be signed
- float *mag, *ang;
-
- mag=vc->channel_residues+res_chan[mapping->magnitude[i]]*blocksize/2;
- ang=vc->channel_residues+res_chan[mapping->angle[i]]*blocksize/2;
- vc->dsp.vorbis_inverse_coupling(mag, ang, blocksize/2);
- }
-
-// Dotproduct
-
- for(j=0, ch_floor_ptr=vc->channel_floors;j<vc->audio_channels;++j,ch_floor_ptr+=blocksize/2) {
- ch_res_ptr=vc->channel_residues+res_chan[j]*blocksize/2;
- vc->dsp.vector_fmul(ch_floor_ptr, ch_res_ptr, blocksize/2);
- }
-
-// MDCT, overlap/add, save data for next overlapping FPMATH
-
- for(j=0;j<vc->audio_channels;++j) {
- uint_fast8_t step=vc->audio_channels;
- uint_fast16_t k;
- float *saved=vc->saved+j*vc->blocksize[1]/2;
- float *ret=vc->ret;
- const float *lwin=vc->win[1];
- const float *swin=vc->win[0];
- float *buf=vc->buf;
- float *buf_tmp=vc->buf_tmp;
-
- ch_floor_ptr=vc->channel_floors+j*blocksize/2;
-
- saved_start=vc->saved_start;
-
- vc->mdct[0].fft.imdct_calc(&vc->mdct[vc->modes[mode_number].blockflag], buf, ch_floor_ptr, buf_tmp);
-
- //FIXME process channels together, to allow faster simd vector_fmul_add_add?
- if (vc->modes[mode_number].blockflag) {
- // -- overlap/add
- if (previous_window) {
- vc->dsp.vector_fmul_add_add(ret+j, buf, lwin, saved, vc->add_bias, vc->blocksize[1]/2, step);
- retlen=vc->blocksize[1]/2;
- } else {
- int len = (vc->blocksize[1]-vc->blocksize[0])/4;
- buf += len;
- vc->dsp.vector_fmul_add_add(ret+j, buf, swin, saved, vc->add_bias, vc->blocksize[0]/2, step);
- k = vc->blocksize[0]/2*step + j;
- buf += vc->blocksize[0]/2;
- if(vc->exp_bias){
- for(i=0; i<len; i++, k+=step)
- ((uint32_t*)ret)[k] = ((uint32_t*)buf)[i] + vc->exp_bias; // ret[k]=buf[i]*(1<<bias)
- } else {
- for(i=0; i<len; i++, k+=step)
- ret[k] = buf[i] + fadd_bias;
- }
- buf=vc->buf;
- retlen=vc->blocksize[0]/2+len;
- }
- // -- save
- if (next_window) {
- buf += vc->blocksize[1]/2;
- vc->dsp.vector_fmul_reverse(saved, buf, lwin, vc->blocksize[1]/2);
- saved_start=0;
- } else {
- saved_start=(vc->blocksize[1]-vc->blocksize[0])/4;
- buf += vc->blocksize[1]/2;
- for(i=0; i<saved_start; i++)
- ((uint32_t*)saved)[i] = ((uint32_t*)buf)[i] + vc->exp_bias;
- vc->dsp.vector_fmul_reverse(saved+saved_start, buf+saved_start, swin, vc->blocksize[0]/2);
- }
- } else {
- // --overlap/add
- if(vc->add_bias) {
- for(k=j, i=0;i<saved_start;++i, k+=step)
- ret[k] = saved[i] + fadd_bias;
- } else {
- for(k=j, i=0;i<saved_start;++i, k+=step)
- ret[k] = saved[i];
- }
- vc->dsp.vector_fmul_add_add(ret+k, buf, swin, saved+saved_start, vc->add_bias, vc->blocksize[0]/2, step);
- retlen=saved_start+vc->blocksize[0]/2;
- // -- save
- buf += vc->blocksize[0]/2;
- vc->dsp.vector_fmul_reverse(saved, buf, swin, vc->blocksize[0]/2);
- saved_start=0;
- }
- }
- vc->saved_start=saved_start;
-
- return retlen*vc->audio_channels;
-}
-
-// Return the decoded audio packet through the standard api
-
-static int vorbis_decode_frame(AVCodecContext *avccontext,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- vorbis_context *vc = avccontext->priv_data ;
- GetBitContext *gb = &(vc->gb);
-
- int_fast16_t len;
-
- if(!buf_size){
- return 0;
- }
-
- AV_DEBUG("packet length %d \n", buf_size);
-
- init_get_bits(gb, buf, buf_size*8);
-
- len=vorbis_parse_audio_packet(vc);
-
- if (len<=0) {
- *data_size=0;
- return buf_size;
- }
-
- if (!vc->first_frame) {
- vc->first_frame=1;
- *data_size=0;
- return buf_size ;
- }
-
- AV_DEBUG("parsed %d bytes %d bits, returned %d samples (*ch*bits) \n", get_bits_count(gb)/8, get_bits_count(gb)%8, len);
-
- vc->dsp.float_to_int16(data, vc->ret, len);
- *data_size=len*2;
-
- return buf_size ;
-}
-
-// Close decoder
-
-static int vorbis_decode_close(AVCodecContext *avccontext) {
- vorbis_context *vc = avccontext->priv_data;
-
- vorbis_free(vc);
-
- return 0 ;
-}
-
-AVCodec vorbis_decoder = {
- "vorbis",
- CODEC_TYPE_AUDIO,
- CODEC_ID_VORBIS,
- sizeof(vorbis_context),
- vorbis_decode_init,
- NULL,
- vorbis_decode_close,
- vorbis_decode_frame,
-};
-
diff --git a/src/libffmpeg/libavcodec/vorbis.h b/src/libffmpeg/libavcodec/vorbis.h
deleted file mode 100644
index cda909aa9..000000000
--- a/src/libffmpeg/libavcodec/vorbis.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * copyright (c) 2006 Oded Shimon <ods15@ods15.dyndns.org>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef VORBIS_H
-#define VORBIS_H
-
-#include "avcodec.h"
-
-extern const float ff_vorbis_floor1_inverse_db_table[256];
-extern const float * ff_vorbis_vwin[8];
-
-typedef struct {
- uint_fast16_t x;
- uint_fast16_t sort;
- uint_fast16_t low;
- uint_fast16_t high;
-} floor1_entry_t;
-
-void ff_vorbis_ready_floor1_list(floor1_entry_t * list, int values);
-unsigned int ff_vorbis_nth_root(unsigned int x, unsigned int n); // x^(1/n)
-int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, uint_fast32_t num);
-void ff_vorbis_floor1_render_list(floor1_entry_t * list, int values, uint_fast16_t * y_list, int * flag, int multiplier, float * out, int samples);
-
-#define ilog(i) av_log2(2*(i))
-
-#endif
diff --git a/src/libffmpeg/libavcodec/vorbis_data.c b/src/libffmpeg/libavcodec/vorbis_data.c
deleted file mode 100644
index 5dc9c5f00..000000000
--- a/src/libffmpeg/libavcodec/vorbis_data.c
+++ /dev/null
@@ -1,2155 +0,0 @@
-/*
- * copyright (c) 2005 Denes Balatoni ( dbalatoni programozo hu )
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "vorbis.h"
-
-static const float vwin64[32] = {
- 0.0009460463F, 0.0085006468F, 0.0235352254F, 0.0458950567F,
- 0.0753351908F, 0.1115073077F, 0.1539457973F, 0.2020557475F,
- 0.2551056759F, 0.3122276645F, 0.3724270287F, 0.4346027792F,
- 0.4975789974F, 0.5601459521F, 0.6211085051F, 0.6793382689F,
- 0.7338252629F, 0.7837245849F, 0.8283939355F, 0.8674186656F,
- 0.9006222429F, 0.9280614787F, 0.9500073081F, 0.9669131782F,
- 0.9793740220F, 0.9880792941F, 0.9937636139F, 0.9971582668F,
- 0.9989462667F, 0.9997230082F, 0.9999638688F, 0.9999995525F,
-};
-
-static const float vwin128[64] = {
- 0.0002365472F, 0.0021280687F, 0.0059065254F, 0.0115626550F,
- 0.0190823442F, 0.0284463735F, 0.0396300935F, 0.0526030430F,
- 0.0673285281F, 0.0837631763F, 0.1018564887F, 0.1215504095F,
- 0.1427789367F, 0.1654677960F, 0.1895342001F, 0.2148867160F,
- 0.2414252576F, 0.2690412240F, 0.2976177952F, 0.3270303960F,
- 0.3571473350F, 0.3878306189F, 0.4189369387F, 0.4503188188F,
- 0.4818259135F, 0.5133064334F, 0.5446086751F, 0.5755826278F,
- 0.6060816248F, 0.6359640047F, 0.6650947483F, 0.6933470543F,
- 0.7206038179F, 0.7467589810F, 0.7717187213F, 0.7954024542F,
- 0.8177436264F, 0.8386902831F, 0.8582053981F, 0.8762669622F,
- 0.8928678298F, 0.9080153310F, 0.9217306608F, 0.9340480615F,
- 0.9450138200F, 0.9546851041F, 0.9631286621F, 0.9704194171F,
- 0.9766389810F, 0.9818741197F, 0.9862151938F, 0.9897546035F,
- 0.9925852598F, 0.9947991032F, 0.9964856900F, 0.9977308602F,
- 0.9986155015F, 0.9992144193F, 0.9995953200F, 0.9998179155F,
- 0.9999331503F, 0.9999825563F, 0.9999977357F, 0.9999999720F,
-};
-
-static const float vwin256[128] = {
- 0.0000591390F, 0.0005321979F, 0.0014780301F, 0.0028960636F,
- 0.0047854363F, 0.0071449926F, 0.0099732775F, 0.0132685298F,
- 0.0170286741F, 0.0212513119F, 0.0259337111F, 0.0310727950F,
- 0.0366651302F, 0.0427069140F, 0.0491939614F, 0.0561216907F,
- 0.0634851102F, 0.0712788035F, 0.0794969160F, 0.0881331402F,
- 0.0971807028F, 0.1066323515F, 0.1164803426F, 0.1267164297F,
- 0.1373318534F, 0.1483173323F, 0.1596630553F, 0.1713586755F,
- 0.1833933062F, 0.1957555184F, 0.2084333404F, 0.2214142599F,
- 0.2346852280F, 0.2482326664F, 0.2620424757F, 0.2761000481F,
- 0.2903902813F, 0.3048975959F, 0.3196059553F, 0.3344988887F,
- 0.3495595160F, 0.3647705766F, 0.3801144597F, 0.3955732382F,
- 0.4111287047F, 0.4267624093F, 0.4424557009F, 0.4581897696F,
- 0.4739456913F, 0.4897044744F, 0.5054471075F, 0.5211546088F,
- 0.5368080763F, 0.5523887395F, 0.5678780103F, 0.5832575361F,
- 0.5985092508F, 0.6136154277F, 0.6285587300F, 0.6433222619F,
- 0.6578896175F, 0.6722449294F, 0.6863729144F, 0.7002589187F,
- 0.7138889597F, 0.7272497662F, 0.7403288154F, 0.7531143679F,
- 0.7655954985F, 0.7777621249F, 0.7896050322F, 0.8011158947F,
- 0.8122872932F, 0.8231127294F, 0.8335866365F, 0.8437043850F,
- 0.8534622861F, 0.8628575905F, 0.8718884835F, 0.8805540765F,
- 0.8888543947F, 0.8967903616F, 0.9043637797F, 0.9115773078F,
- 0.9184344360F, 0.9249394562F, 0.9310974312F, 0.9369141608F,
- 0.9423961446F, 0.9475505439F, 0.9523851406F, 0.9569082947F,
- 0.9611289005F, 0.9650563408F, 0.9687004405F, 0.9720714191F,
- 0.9751798427F, 0.9780365753F, 0.9806527301F, 0.9830396204F,
- 0.9852087111F, 0.9871715701F, 0.9889398207F, 0.9905250941F,
- 0.9919389832F, 0.9931929973F, 0.9942985174F, 0.9952667537F,
- 0.9961087037F, 0.9968351119F, 0.9974564312F, 0.9979827858F,
- 0.9984239359F, 0.9987892441F, 0.9990876435F, 0.9993276081F,
- 0.9995171241F, 0.9996636648F, 0.9997741654F, 0.9998550016F,
- 0.9999119692F, 0.9999502656F, 0.9999744742F, 0.9999885497F,
- 0.9999958064F, 0.9999989077F, 0.9999998584F, 0.9999999983F,
-};
-
-static const float vwin512[256] = {
- 0.0000147849F, 0.0001330607F, 0.0003695946F, 0.0007243509F,
- 0.0011972759F, 0.0017882983F, 0.0024973285F, 0.0033242588F,
- 0.0042689632F, 0.0053312973F, 0.0065110982F, 0.0078081841F,
- 0.0092223540F, 0.0107533880F, 0.0124010466F, 0.0141650703F,
- 0.0160451800F, 0.0180410758F, 0.0201524373F, 0.0223789233F,
- 0.0247201710F, 0.0271757958F, 0.0297453914F, 0.0324285286F,
- 0.0352247556F, 0.0381335972F, 0.0411545545F, 0.0442871045F,
- 0.0475306997F, 0.0508847676F, 0.0543487103F, 0.0579219038F,
- 0.0616036982F, 0.0653934164F, 0.0692903546F, 0.0732937809F,
- 0.0774029356F, 0.0816170305F, 0.0859352485F, 0.0903567428F,
- 0.0948806375F, 0.0995060259F, 0.1042319712F, 0.1090575056F,
- 0.1139816300F, 0.1190033137F, 0.1241214941F, 0.1293350764F,
- 0.1346429333F, 0.1400439046F, 0.1455367974F, 0.1511203852F,
- 0.1567934083F, 0.1625545735F, 0.1684025537F, 0.1743359881F,
- 0.1803534820F, 0.1864536069F, 0.1926349000F, 0.1988958650F,
- 0.2052349715F, 0.2116506555F, 0.2181413191F, 0.2247053313F,
- 0.2313410275F, 0.2380467105F, 0.2448206500F, 0.2516610835F,
- 0.2585662164F, 0.2655342226F, 0.2725632448F, 0.2796513950F,
- 0.2867967551F, 0.2939973773F, 0.3012512852F, 0.3085564739F,
- 0.3159109111F, 0.3233125375F, 0.3307592680F, 0.3382489922F,
- 0.3457795756F, 0.3533488602F, 0.3609546657F, 0.3685947904F,
- 0.3762670121F, 0.3839690896F, 0.3916987634F, 0.3994537572F,
- 0.4072317788F, 0.4150305215F, 0.4228476653F, 0.4306808783F,
- 0.4385278181F, 0.4463861329F, 0.4542534630F, 0.4621274424F,
- 0.4700057001F, 0.4778858615F, 0.4857655502F, 0.4936423891F,
- 0.5015140023F, 0.5093780165F, 0.5172320626F, 0.5250737772F,
- 0.5329008043F, 0.5407107971F, 0.5485014192F, 0.5562703465F,
- 0.5640152688F, 0.5717338914F, 0.5794239366F, 0.5870831457F,
- 0.5947092801F, 0.6023001235F, 0.6098534829F, 0.6173671907F,
- 0.6248391059F, 0.6322671161F, 0.6396491384F, 0.6469831217F,
- 0.6542670475F, 0.6614989319F, 0.6686768267F, 0.6757988210F,
- 0.6828630426F, 0.6898676592F, 0.6968108799F, 0.7036909564F,
- 0.7105061843F, 0.7172549043F, 0.7239355032F, 0.7305464154F,
- 0.7370861235F, 0.7435531598F, 0.7499461068F, 0.7562635986F,
- 0.7625043214F, 0.7686670148F, 0.7747504721F, 0.7807535410F,
- 0.7866751247F, 0.7925141825F, 0.7982697296F, 0.8039408387F,
- 0.8095266395F, 0.8150263196F, 0.8204391248F, 0.8257643590F,
- 0.8310013848F, 0.8361496236F, 0.8412085555F, 0.8461777194F,
- 0.8510567129F, 0.8558451924F, 0.8605428730F, 0.8651495278F,
- 0.8696649882F, 0.8740891432F, 0.8784219392F, 0.8826633797F,
- 0.8868135244F, 0.8908724888F, 0.8948404441F, 0.8987176157F,
- 0.9025042831F, 0.9062007791F, 0.9098074886F, 0.9133248482F,
- 0.9167533451F, 0.9200935163F, 0.9233459472F, 0.9265112712F,
- 0.9295901680F, 0.9325833632F, 0.9354916263F, 0.9383157705F,
- 0.9410566504F, 0.9437151618F, 0.9462922398F, 0.9487888576F,
- 0.9512060252F, 0.9535447882F, 0.9558062262F, 0.9579914516F,
- 0.9601016078F, 0.9621378683F, 0.9641014348F, 0.9659935361F,
- 0.9678154261F, 0.9695683830F, 0.9712537071F, 0.9728727198F,
- 0.9744267618F, 0.9759171916F, 0.9773453842F, 0.9787127293F,
- 0.9800206298F, 0.9812705006F, 0.9824637665F, 0.9836018613F,
- 0.9846862258F, 0.9857183066F, 0.9866995544F, 0.9876314227F,
- 0.9885153662F, 0.9893528393F, 0.9901452948F, 0.9908941823F,
- 0.9916009470F, 0.9922670279F, 0.9928938570F, 0.9934828574F,
- 0.9940354423F, 0.9945530133F, 0.9950369595F, 0.9954886562F,
- 0.9959094633F, 0.9963007242F, 0.9966637649F, 0.9969998925F,
- 0.9973103939F, 0.9975965351F, 0.9978595598F, 0.9981006885F,
- 0.9983211172F, 0.9985220166F, 0.9987045311F, 0.9988697776F,
- 0.9990188449F, 0.9991527924F, 0.9992726499F, 0.9993794157F,
- 0.9994740570F, 0.9995575079F, 0.9996306699F, 0.9996944099F,
- 0.9997495605F, 0.9997969190F, 0.9998372465F, 0.9998712678F,
- 0.9998996704F, 0.9999231041F, 0.9999421807F, 0.9999574732F,
- 0.9999695157F, 0.9999788026F, 0.9999857885F, 0.9999908879F,
- 0.9999944746F, 0.9999968817F, 0.9999984010F, 0.9999992833F,
- 0.9999997377F, 0.9999999317F, 0.9999999911F, 0.9999999999F,
-};
-
-static const float vwin1024[512] = {
- 0.0000036962F, 0.0000332659F, 0.0000924041F, 0.0001811086F,
- 0.0002993761F, 0.0004472021F, 0.0006245811F, 0.0008315063F,
- 0.0010679699F, 0.0013339631F, 0.0016294757F, 0.0019544965F,
- 0.0023090133F, 0.0026930125F, 0.0031064797F, 0.0035493989F,
- 0.0040217533F, 0.0045235250F, 0.0050546946F, 0.0056152418F,
- 0.0062051451F, 0.0068243817F, 0.0074729278F, 0.0081507582F,
- 0.0088578466F, 0.0095941655F, 0.0103596863F, 0.0111543789F,
- 0.0119782122F, 0.0128311538F, 0.0137131701F, 0.0146242260F,
- 0.0155642855F, 0.0165333111F, 0.0175312640F, 0.0185581042F,
- 0.0196137903F, 0.0206982797F, 0.0218115284F, 0.0229534910F,
- 0.0241241208F, 0.0253233698F, 0.0265511886F, 0.0278075263F,
- 0.0290923308F, 0.0304055484F, 0.0317471241F, 0.0331170013F,
- 0.0345151222F, 0.0359414274F, 0.0373958560F, 0.0388783456F,
- 0.0403888325F, 0.0419272511F, 0.0434935347F, 0.0450876148F,
- 0.0467094213F, 0.0483588828F, 0.0500359261F, 0.0517404765F,
- 0.0534724575F, 0.0552317913F, 0.0570183983F, 0.0588321971F,
- 0.0606731048F, 0.0625410369F, 0.0644359070F, 0.0663576272F,
- 0.0683061077F, 0.0702812571F, 0.0722829821F, 0.0743111878F,
- 0.0763657775F, 0.0784466526F, 0.0805537129F, 0.0826868561F,
- 0.0848459782F, 0.0870309736F, 0.0892417345F, 0.0914781514F,
- 0.0937401128F, 0.0960275056F, 0.0983402145F, 0.1006781223F,
- 0.1030411101F, 0.1054290568F, 0.1078418397F, 0.1102793336F,
- 0.1127414119F, 0.1152279457F, 0.1177388042F, 0.1202738544F,
- 0.1228329618F, 0.1254159892F, 0.1280227980F, 0.1306532471F,
- 0.1333071937F, 0.1359844927F, 0.1386849970F, 0.1414085575F,
- 0.1441550230F, 0.1469242403F, 0.1497160539F, 0.1525303063F,
- 0.1553668381F, 0.1582254875F, 0.1611060909F, 0.1640084822F,
- 0.1669324936F, 0.1698779549F, 0.1728446939F, 0.1758325362F,
- 0.1788413055F, 0.1818708232F, 0.1849209084F, 0.1879913785F,
- 0.1910820485F, 0.1941927312F, 0.1973232376F, 0.2004733764F,
- 0.2036429541F, 0.2068317752F, 0.2100396421F, 0.2132663552F,
- 0.2165117125F, 0.2197755102F, 0.2230575422F, 0.2263576007F,
- 0.2296754753F, 0.2330109540F, 0.2363638225F, 0.2397338646F,
- 0.2431208619F, 0.2465245941F, 0.2499448389F, 0.2533813719F,
- 0.2568339669F, 0.2603023956F, 0.2637864277F, 0.2672858312F,
- 0.2708003718F, 0.2743298135F, 0.2778739186F, 0.2814324472F,
- 0.2850051576F, 0.2885918065F, 0.2921921485F, 0.2958059366F,
- 0.2994329219F, 0.3030728538F, 0.3067254799F, 0.3103905462F,
- 0.3140677969F, 0.3177569747F, 0.3214578205F, 0.3251700736F,
- 0.3288934718F, 0.3326277513F, 0.3363726468F, 0.3401278914F,
- 0.3438932168F, 0.3476683533F, 0.3514530297F, 0.3552469734F,
- 0.3590499106F, 0.3628615659F, 0.3666816630F, 0.3705099239F,
- 0.3743460698F, 0.3781898204F, 0.3820408945F, 0.3858990095F,
- 0.3897638820F, 0.3936352274F, 0.3975127601F, 0.4013961936F,
- 0.4052852405F, 0.4091796123F, 0.4130790198F, 0.4169831732F,
- 0.4208917815F, 0.4248045534F, 0.4287211965F, 0.4326414181F,
- 0.4365649248F, 0.4404914225F, 0.4444206167F, 0.4483522125F,
- 0.4522859146F, 0.4562214270F, 0.4601584538F, 0.4640966984F,
- 0.4680358644F, 0.4719756548F, 0.4759157726F, 0.4798559209F,
- 0.4837958024F, 0.4877351199F, 0.4916735765F, 0.4956108751F,
- 0.4995467188F, 0.5034808109F, 0.5074128550F, 0.5113425550F,
- 0.5152696149F, 0.5191937395F, 0.5231146336F, 0.5270320028F,
- 0.5309455530F, 0.5348549910F, 0.5387600239F, 0.5426603597F,
- 0.5465557070F, 0.5504457754F, 0.5543302752F, 0.5582089175F,
- 0.5620814145F, 0.5659474793F, 0.5698068262F, 0.5736591704F,
- 0.5775042283F, 0.5813417176F, 0.5851713571F, 0.5889928670F,
- 0.5928059689F, 0.5966103856F, 0.6004058415F, 0.6041920626F,
- 0.6079687761F, 0.6117357113F, 0.6154925986F, 0.6192391705F,
- 0.6229751612F, 0.6267003064F, 0.6304143441F, 0.6341170137F,
- 0.6378080569F, 0.6414872173F, 0.6451542405F, 0.6488088741F,
- 0.6524508681F, 0.6560799742F, 0.6596959469F, 0.6632985424F,
- 0.6668875197F, 0.6704626398F, 0.6740236662F, 0.6775703649F,
- 0.6811025043F, 0.6846198554F, 0.6881221916F, 0.6916092892F,
- 0.6950809269F, 0.6985368861F, 0.7019769510F, 0.7054009085F,
- 0.7088085484F, 0.7121996632F, 0.7155740484F, 0.7189315023F,
- 0.7222718263F, 0.7255948245F, 0.7289003043F, 0.7321880760F,
- 0.7354579530F, 0.7387097518F, 0.7419432921F, 0.7451583966F,
- 0.7483548915F, 0.7515326059F, 0.7546913723F, 0.7578310265F,
- 0.7609514077F, 0.7640523581F, 0.7671337237F, 0.7701953535F,
- 0.7732371001F, 0.7762588195F, 0.7792603711F, 0.7822416178F,
- 0.7852024259F, 0.7881426654F, 0.7910622097F, 0.7939609356F,
- 0.7968387237F, 0.7996954579F, 0.8025310261F, 0.8053453193F,
- 0.8081382324F, 0.8109096638F, 0.8136595156F, 0.8163876936F,
- 0.8190941071F, 0.8217786690F, 0.8244412960F, 0.8270819086F,
- 0.8297004305F, 0.8322967896F, 0.8348709171F, 0.8374227481F,
- 0.8399522213F, 0.8424592789F, 0.8449438672F, 0.8474059356F,
- 0.8498454378F, 0.8522623306F, 0.8546565748F, 0.8570281348F,
- 0.8593769787F, 0.8617030779F, 0.8640064080F, 0.8662869477F,
- 0.8685446796F, 0.8707795899F, 0.8729916682F, 0.8751809079F,
- 0.8773473059F, 0.8794908626F, 0.8816115819F, 0.8837094713F,
- 0.8857845418F, 0.8878368079F, 0.8898662874F, 0.8918730019F,
- 0.8938569760F, 0.8958182380F, 0.8977568194F, 0.8996727552F,
- 0.9015660837F, 0.9034368465F, 0.9052850885F, 0.9071108577F,
- 0.9089142057F, 0.9106951869F, 0.9124538591F, 0.9141902832F,
- 0.9159045233F, 0.9175966464F, 0.9192667228F, 0.9209148257F,
- 0.9225410313F, 0.9241454187F, 0.9257280701F, 0.9272890704F,
- 0.9288285075F, 0.9303464720F, 0.9318430576F, 0.9333183603F,
- 0.9347724792F, 0.9362055158F, 0.9376175745F, 0.9390087622F,
- 0.9403791881F, 0.9417289644F, 0.9430582055F, 0.9443670283F,
- 0.9456555521F, 0.9469238986F, 0.9481721917F, 0.9494005577F,
- 0.9506091252F, 0.9517980248F, 0.9529673894F, 0.9541173540F,
- 0.9552480557F, 0.9563596334F, 0.9574522282F, 0.9585259830F,
- 0.9595810428F, 0.9606175542F, 0.9616356656F, 0.9626355274F,
- 0.9636172915F, 0.9645811114F, 0.9655271425F, 0.9664555414F,
- 0.9673664664F, 0.9682600774F, 0.9691365355F, 0.9699960034F,
- 0.9708386448F, 0.9716646250F, 0.9724741103F, 0.9732672685F,
- 0.9740442683F, 0.9748052795F, 0.9755504729F, 0.9762800205F,
- 0.9769940950F, 0.9776928703F, 0.9783765210F, 0.9790452223F,
- 0.9796991504F, 0.9803384823F, 0.9809633954F, 0.9815740679F,
- 0.9821706784F, 0.9827534063F, 0.9833224312F, 0.9838779332F,
- 0.9844200928F, 0.9849490910F, 0.9854651087F, 0.9859683274F,
- 0.9864589286F, 0.9869370940F, 0.9874030054F, 0.9878568447F,
- 0.9882987937F, 0.9887290343F, 0.9891477481F, 0.9895551169F,
- 0.9899513220F, 0.9903365446F, 0.9907109658F, 0.9910747662F,
- 0.9914281260F, 0.9917712252F, 0.9921042433F, 0.9924273593F,
- 0.9927407516F, 0.9930445982F, 0.9933390763F, 0.9936243626F,
- 0.9939006331F, 0.9941680631F, 0.9944268269F, 0.9946770982F,
- 0.9949190498F, 0.9951528537F, 0.9953786808F, 0.9955967011F,
- 0.9958070836F, 0.9960099963F, 0.9962056061F, 0.9963940787F,
- 0.9965755786F, 0.9967502693F, 0.9969183129F, 0.9970798704F,
- 0.9972351013F, 0.9973841640F, 0.9975272151F, 0.9976644103F,
- 0.9977959036F, 0.9979218476F, 0.9980423932F, 0.9981576901F,
- 0.9982678862F, 0.9983731278F, 0.9984735596F, 0.9985693247F,
- 0.9986605645F, 0.9987474186F, 0.9988300248F, 0.9989085193F,
- 0.9989830364F, 0.9990537085F, 0.9991206662F, 0.9991840382F,
- 0.9992439513F, 0.9993005303F, 0.9993538982F, 0.9994041757F,
- 0.9994514817F, 0.9994959330F, 0.9995376444F, 0.9995767286F,
- 0.9996132960F, 0.9996474550F, 0.9996793121F, 0.9997089710F,
- 0.9997365339F, 0.9997621003F, 0.9997857677F, 0.9998076311F,
- 0.9998277836F, 0.9998463156F, 0.9998633155F, 0.9998788692F,
- 0.9998930603F, 0.9999059701F, 0.9999176774F, 0.9999282586F,
- 0.9999377880F, 0.9999463370F, 0.9999539749F, 0.9999607685F,
- 0.9999667820F, 0.9999720773F, 0.9999767136F, 0.9999807479F,
- 0.9999842344F, 0.9999872249F, 0.9999897688F, 0.9999919127F,
- 0.9999937009F, 0.9999951749F, 0.9999963738F, 0.9999973342F,
- 0.9999980900F, 0.9999986724F, 0.9999991103F, 0.9999994297F,
- 0.9999996543F, 0.9999998049F, 0.9999999000F, 0.9999999552F,
- 0.9999999836F, 0.9999999957F, 0.9999999994F, 1.0000000000F,
-};
-
-static const float vwin2048[1024] = {
- 0.0000009241F, 0.0000083165F, 0.0000231014F, 0.0000452785F,
- 0.0000748476F, 0.0001118085F, 0.0001561608F, 0.0002079041F,
- 0.0002670379F, 0.0003335617F, 0.0004074748F, 0.0004887765F,
- 0.0005774661F, 0.0006735427F, 0.0007770054F, 0.0008878533F,
- 0.0010060853F, 0.0011317002F, 0.0012646969F, 0.0014050742F,
- 0.0015528307F, 0.0017079650F, 0.0018704756F, 0.0020403610F,
- 0.0022176196F, 0.0024022497F, 0.0025942495F, 0.0027936173F,
- 0.0030003511F, 0.0032144490F, 0.0034359088F, 0.0036647286F,
- 0.0039009061F, 0.0041444391F, 0.0043953253F, 0.0046535621F,
- 0.0049191472F, 0.0051920781F, 0.0054723520F, 0.0057599664F,
- 0.0060549184F, 0.0063572052F, 0.0066668239F, 0.0069837715F,
- 0.0073080449F, 0.0076396410F, 0.0079785566F, 0.0083247884F,
- 0.0086783330F, 0.0090391871F, 0.0094073470F, 0.0097828092F,
- 0.0101655700F, 0.0105556258F, 0.0109529726F, 0.0113576065F,
- 0.0117695237F, 0.0121887200F, 0.0126151913F, 0.0130489335F,
- 0.0134899422F, 0.0139382130F, 0.0143937415F, 0.0148565233F,
- 0.0153265536F, 0.0158038279F, 0.0162883413F, 0.0167800889F,
- 0.0172790660F, 0.0177852675F, 0.0182986882F, 0.0188193231F,
- 0.0193471668F, 0.0198822141F, 0.0204244594F, 0.0209738974F,
- 0.0215305225F, 0.0220943289F, 0.0226653109F, 0.0232434627F,
- 0.0238287784F, 0.0244212519F, 0.0250208772F, 0.0256276481F,
- 0.0262415582F, 0.0268626014F, 0.0274907711F, 0.0281260608F,
- 0.0287684638F, 0.0294179736F, 0.0300745833F, 0.0307382859F,
- 0.0314090747F, 0.0320869424F, 0.0327718819F, 0.0334638860F,
- 0.0341629474F, 0.0348690586F, 0.0355822122F, 0.0363024004F,
- 0.0370296157F, 0.0377638502F, 0.0385050960F, 0.0392533451F,
- 0.0400085896F, 0.0407708211F, 0.0415400315F, 0.0423162123F,
- 0.0430993552F, 0.0438894515F, 0.0446864926F, 0.0454904698F,
- 0.0463013742F, 0.0471191969F, 0.0479439288F, 0.0487755607F,
- 0.0496140836F, 0.0504594879F, 0.0513117642F, 0.0521709031F,
- 0.0530368949F, 0.0539097297F, 0.0547893979F, 0.0556758894F,
- 0.0565691941F, 0.0574693019F, 0.0583762026F, 0.0592898858F,
- 0.0602103410F, 0.0611375576F, 0.0620715250F, 0.0630122324F,
- 0.0639596688F, 0.0649138234F, 0.0658746848F, 0.0668422421F,
- 0.0678164838F, 0.0687973985F, 0.0697849746F, 0.0707792005F,
- 0.0717800645F, 0.0727875547F, 0.0738016591F, 0.0748223656F,
- 0.0758496620F, 0.0768835359F, 0.0779239751F, 0.0789709668F,
- 0.0800244985F, 0.0810845574F, 0.0821511306F, 0.0832242052F,
- 0.0843037679F, 0.0853898056F, 0.0864823050F, 0.0875812525F,
- 0.0886866347F, 0.0897984378F, 0.0909166480F, 0.0920412513F,
- 0.0931722338F, 0.0943095813F, 0.0954532795F, 0.0966033140F,
- 0.0977596702F, 0.0989223336F, 0.1000912894F, 0.1012665227F,
- 0.1024480185F, 0.1036357616F, 0.1048297369F, 0.1060299290F,
- 0.1072363224F, 0.1084489014F, 0.1096676504F, 0.1108925534F,
- 0.1121235946F, 0.1133607577F, 0.1146040267F, 0.1158533850F,
- 0.1171088163F, 0.1183703040F, 0.1196378312F, 0.1209113812F,
- 0.1221909370F, 0.1234764815F, 0.1247679974F, 0.1260654674F,
- 0.1273688740F, 0.1286781995F, 0.1299934263F, 0.1313145365F,
- 0.1326415121F, 0.1339743349F, 0.1353129866F, 0.1366574490F,
- 0.1380077035F, 0.1393637315F, 0.1407255141F, 0.1420930325F,
- 0.1434662677F, 0.1448452004F, 0.1462298115F, 0.1476200814F,
- 0.1490159906F, 0.1504175195F, 0.1518246482F, 0.1532373569F,
- 0.1546556253F, 0.1560794333F, 0.1575087606F, 0.1589435866F,
- 0.1603838909F, 0.1618296526F, 0.1632808509F, 0.1647374648F,
- 0.1661994731F, 0.1676668546F, 0.1691395880F, 0.1706176516F,
- 0.1721010238F, 0.1735896829F, 0.1750836068F, 0.1765827736F,
- 0.1780871610F, 0.1795967468F, 0.1811115084F, 0.1826314234F,
- 0.1841564689F, 0.1856866221F, 0.1872218600F, 0.1887621595F,
- 0.1903074974F, 0.1918578503F, 0.1934131947F, 0.1949735068F,
- 0.1965387630F, 0.1981089393F, 0.1996840117F, 0.2012639560F,
- 0.2028487479F, 0.2044383630F, 0.2060327766F, 0.2076319642F,
- 0.2092359007F, 0.2108445614F, 0.2124579211F, 0.2140759545F,
- 0.2156986364F, 0.2173259411F, 0.2189578432F, 0.2205943168F,
- 0.2222353361F, 0.2238808751F, 0.2255309076F, 0.2271854073F,
- 0.2288443480F, 0.2305077030F, 0.2321754457F, 0.2338475493F,
- 0.2355239869F, 0.2372047315F, 0.2388897560F, 0.2405790329F,
- 0.2422725350F, 0.2439702347F, 0.2456721043F, 0.2473781159F,
- 0.2490882418F, 0.2508024539F, 0.2525207240F, 0.2542430237F,
- 0.2559693248F, 0.2576995986F, 0.2594338166F, 0.2611719498F,
- 0.2629139695F, 0.2646598466F, 0.2664095520F, 0.2681630564F,
- 0.2699203304F, 0.2716813445F, 0.2734460691F, 0.2752144744F,
- 0.2769865307F, 0.2787622079F, 0.2805414760F, 0.2823243047F,
- 0.2841106637F, 0.2859005227F, 0.2876938509F, 0.2894906179F,
- 0.2912907928F, 0.2930943447F, 0.2949012426F, 0.2967114554F,
- 0.2985249520F, 0.3003417009F, 0.3021616708F, 0.3039848301F,
- 0.3058111471F, 0.3076405901F, 0.3094731273F, 0.3113087266F,
- 0.3131473560F, 0.3149889833F, 0.3168335762F, 0.3186811024F,
- 0.3205315294F, 0.3223848245F, 0.3242409552F, 0.3260998886F,
- 0.3279615918F, 0.3298260319F, 0.3316931758F, 0.3335629903F,
- 0.3354354423F, 0.3373104982F, 0.3391881247F, 0.3410682882F,
- 0.3429509551F, 0.3448360917F, 0.3467236642F, 0.3486136387F,
- 0.3505059811F, 0.3524006575F, 0.3542976336F, 0.3561968753F,
- 0.3580983482F, 0.3600020179F, 0.3619078499F, 0.3638158096F,
- 0.3657258625F, 0.3676379737F, 0.3695521086F, 0.3714682321F,
- 0.3733863094F, 0.3753063055F, 0.3772281852F, 0.3791519134F,
- 0.3810774548F, 0.3830047742F, 0.3849338362F, 0.3868646053F,
- 0.3887970459F, 0.3907311227F, 0.3926667998F, 0.3946040417F,
- 0.3965428125F, 0.3984830765F, 0.4004247978F, 0.4023679403F,
- 0.4043124683F, 0.4062583455F, 0.4082055359F, 0.4101540034F,
- 0.4121037117F, 0.4140546246F, 0.4160067058F, 0.4179599190F,
- 0.4199142277F, 0.4218695956F, 0.4238259861F, 0.4257833627F,
- 0.4277416888F, 0.4297009279F, 0.4316610433F, 0.4336219983F,
- 0.4355837562F, 0.4375462803F, 0.4395095337F, 0.4414734797F,
- 0.4434380815F, 0.4454033021F, 0.4473691046F, 0.4493354521F,
- 0.4513023078F, 0.4532696345F, 0.4552373954F, 0.4572055533F,
- 0.4591740713F, 0.4611429123F, 0.4631120393F, 0.4650814151F,
- 0.4670510028F, 0.4690207650F, 0.4709906649F, 0.4729606651F,
- 0.4749307287F, 0.4769008185F, 0.4788708972F, 0.4808409279F,
- 0.4828108732F, 0.4847806962F, 0.4867503597F, 0.4887198264F,
- 0.4906890593F, 0.4926580213F, 0.4946266753F, 0.4965949840F,
- 0.4985629105F, 0.5005304176F, 0.5024974683F, 0.5044640255F,
- 0.5064300522F, 0.5083955114F, 0.5103603659F, 0.5123245790F,
- 0.5142881136F, 0.5162509328F, 0.5182129997F, 0.5201742774F,
- 0.5221347290F, 0.5240943178F, 0.5260530070F, 0.5280107598F,
- 0.5299675395F, 0.5319233095F, 0.5338780330F, 0.5358316736F,
- 0.5377841946F, 0.5397355596F, 0.5416857320F, 0.5436346755F,
- 0.5455823538F, 0.5475287304F, 0.5494737691F, 0.5514174337F,
- 0.5533596881F, 0.5553004962F, 0.5572398218F, 0.5591776291F,
- 0.5611138821F, 0.5630485449F, 0.5649815818F, 0.5669129570F,
- 0.5688426349F, 0.5707705799F, 0.5726967564F, 0.5746211290F,
- 0.5765436624F, 0.5784643212F, 0.5803830702F, 0.5822998743F,
- 0.5842146984F, 0.5861275076F, 0.5880382669F, 0.5899469416F,
- 0.5918534968F, 0.5937578981F, 0.5956601107F, 0.5975601004F,
- 0.5994578326F, 0.6013532732F, 0.6032463880F, 0.6051371429F,
- 0.6070255039F, 0.6089114372F, 0.6107949090F, 0.6126758856F,
- 0.6145543334F, 0.6164302191F, 0.6183035092F, 0.6201741706F,
- 0.6220421700F, 0.6239074745F, 0.6257700513F, 0.6276298674F,
- 0.6294868903F, 0.6313410873F, 0.6331924262F, 0.6350408745F,
- 0.6368864001F, 0.6387289710F, 0.6405685552F, 0.6424051209F,
- 0.6442386364F, 0.6460690702F, 0.6478963910F, 0.6497205673F,
- 0.6515415682F, 0.6533593625F, 0.6551739194F, 0.6569852082F,
- 0.6587931984F, 0.6605978593F, 0.6623991609F, 0.6641970728F,
- 0.6659915652F, 0.6677826081F, 0.6695701718F, 0.6713542268F,
- 0.6731347437F, 0.6749116932F, 0.6766850461F, 0.6784547736F,
- 0.6802208469F, 0.6819832374F, 0.6837419164F, 0.6854968559F,
- 0.6872480275F, 0.6889954034F, 0.6907389556F, 0.6924786566F,
- 0.6942144788F, 0.6959463950F, 0.6976743780F, 0.6993984008F,
- 0.7011184365F, 0.7028344587F, 0.7045464407F, 0.7062543564F,
- 0.7079581796F, 0.7096578844F, 0.7113534450F, 0.7130448359F,
- 0.7147320316F, 0.7164150070F, 0.7180937371F, 0.7197681970F,
- 0.7214383620F, 0.7231042077F, 0.7247657098F, 0.7264228443F,
- 0.7280755871F, 0.7297239147F, 0.7313678035F, 0.7330072301F,
- 0.7346421715F, 0.7362726046F, 0.7378985069F, 0.7395198556F,
- 0.7411366285F, 0.7427488034F, 0.7443563584F, 0.7459592717F,
- 0.7475575218F, 0.7491510873F, 0.7507399471F, 0.7523240803F,
- 0.7539034661F, 0.7554780839F, 0.7570479136F, 0.7586129349F,
- 0.7601731279F, 0.7617284730F, 0.7632789506F, 0.7648245416F,
- 0.7663652267F, 0.7679009872F, 0.7694318044F, 0.7709576599F,
- 0.7724785354F, 0.7739944130F, 0.7755052749F, 0.7770111035F,
- 0.7785118815F, 0.7800075916F, 0.7814982170F, 0.7829837410F,
- 0.7844641472F, 0.7859394191F, 0.7874095408F, 0.7888744965F,
- 0.7903342706F, 0.7917888476F, 0.7932382124F, 0.7946823501F,
- 0.7961212460F, 0.7975548855F, 0.7989832544F, 0.8004063386F,
- 0.8018241244F, 0.8032365981F, 0.8046437463F, 0.8060455560F,
- 0.8074420141F, 0.8088331080F, 0.8102188253F, 0.8115991536F,
- 0.8129740810F, 0.8143435957F, 0.8157076861F, 0.8170663409F,
- 0.8184195489F, 0.8197672994F, 0.8211095817F, 0.8224463853F,
- 0.8237777001F, 0.8251035161F, 0.8264238235F, 0.8277386129F,
- 0.8290478750F, 0.8303516008F, 0.8316497814F, 0.8329424083F,
- 0.8342294731F, 0.8355109677F, 0.8367868841F, 0.8380572148F,
- 0.8393219523F, 0.8405810893F, 0.8418346190F, 0.8430825345F,
- 0.8443248294F, 0.8455614974F, 0.8467925323F, 0.8480179285F,
- 0.8492376802F, 0.8504517822F, 0.8516602292F, 0.8528630164F,
- 0.8540601391F, 0.8552515928F, 0.8564373733F, 0.8576174766F,
- 0.8587918990F, 0.8599606368F, 0.8611236868F, 0.8622810460F,
- 0.8634327113F, 0.8645786802F, 0.8657189504F, 0.8668535195F,
- 0.8679823857F, 0.8691055472F, 0.8702230025F, 0.8713347503F,
- 0.8724407896F, 0.8735411194F, 0.8746357394F, 0.8757246489F,
- 0.8768078479F, 0.8778853364F, 0.8789571146F, 0.8800231832F,
- 0.8810835427F, 0.8821381942F, 0.8831871387F, 0.8842303777F,
- 0.8852679127F, 0.8862997456F, 0.8873258784F, 0.8883463132F,
- 0.8893610527F, 0.8903700994F, 0.8913734562F, 0.8923711263F,
- 0.8933631129F, 0.8943494196F, 0.8953300500F, 0.8963050083F,
- 0.8972742985F, 0.8982379249F, 0.8991958922F, 0.9001482052F,
- 0.9010948688F, 0.9020358883F, 0.9029712690F, 0.9039010165F,
- 0.9048251367F, 0.9057436357F, 0.9066565195F, 0.9075637946F,
- 0.9084654678F, 0.9093615456F, 0.9102520353F, 0.9111369440F,
- 0.9120162792F, 0.9128900484F, 0.9137582595F, 0.9146209204F,
- 0.9154780394F, 0.9163296248F, 0.9171756853F, 0.9180162296F,
- 0.9188512667F, 0.9196808057F, 0.9205048559F, 0.9213234270F,
- 0.9221365285F, 0.9229441704F, 0.9237463629F, 0.9245431160F,
- 0.9253344404F, 0.9261203465F, 0.9269008453F, 0.9276759477F,
- 0.9284456648F, 0.9292100080F, 0.9299689889F, 0.9307226190F,
- 0.9314709103F, 0.9322138747F, 0.9329515245F, 0.9336838721F,
- 0.9344109300F, 0.9351327108F, 0.9358492275F, 0.9365604931F,
- 0.9372665208F, 0.9379673239F, 0.9386629160F, 0.9393533107F,
- 0.9400385220F, 0.9407185637F, 0.9413934501F, 0.9420631954F,
- 0.9427278141F, 0.9433873208F, 0.9440417304F, 0.9446910576F,
- 0.9453353176F, 0.9459745255F, 0.9466086968F, 0.9472378469F,
- 0.9478619915F, 0.9484811463F, 0.9490953274F, 0.9497045506F,
- 0.9503088323F, 0.9509081888F, 0.9515026365F, 0.9520921921F,
- 0.9526768723F, 0.9532566940F, 0.9538316742F, 0.9544018300F,
- 0.9549671786F, 0.9555277375F, 0.9560835241F, 0.9566345562F,
- 0.9571808513F, 0.9577224275F, 0.9582593027F, 0.9587914949F,
- 0.9593190225F, 0.9598419038F, 0.9603601571F, 0.9608738012F,
- 0.9613828546F, 0.9618873361F, 0.9623872646F, 0.9628826591F,
- 0.9633735388F, 0.9638599227F, 0.9643418303F, 0.9648192808F,
- 0.9652922939F, 0.9657608890F, 0.9662250860F, 0.9666849046F,
- 0.9671403646F, 0.9675914861F, 0.9680382891F, 0.9684807937F,
- 0.9689190202F, 0.9693529890F, 0.9697827203F, 0.9702082347F,
- 0.9706295529F, 0.9710466953F, 0.9714596828F, 0.9718685362F,
- 0.9722732762F, 0.9726739240F, 0.9730705005F, 0.9734630267F,
- 0.9738515239F, 0.9742360134F, 0.9746165163F, 0.9749930540F,
- 0.9753656481F, 0.9757343198F, 0.9760990909F, 0.9764599829F,
- 0.9768170175F, 0.9771702164F, 0.9775196013F, 0.9778651941F,
- 0.9782070167F, 0.9785450909F, 0.9788794388F, 0.9792100824F,
- 0.9795370437F, 0.9798603449F, 0.9801800080F, 0.9804960554F,
- 0.9808085092F, 0.9811173916F, 0.9814227251F, 0.9817245318F,
- 0.9820228343F, 0.9823176549F, 0.9826090160F, 0.9828969402F,
- 0.9831814498F, 0.9834625674F, 0.9837403156F, 0.9840147169F,
- 0.9842857939F, 0.9845535692F, 0.9848180654F, 0.9850793052F,
- 0.9853373113F, 0.9855921062F, 0.9858437127F, 0.9860921535F,
- 0.9863374512F, 0.9865796287F, 0.9868187085F, 0.9870547136F,
- 0.9872876664F, 0.9875175899F, 0.9877445067F, 0.9879684396F,
- 0.9881894112F, 0.9884074444F, 0.9886225619F, 0.9888347863F,
- 0.9890441404F, 0.9892506468F, 0.9894543284F, 0.9896552077F,
- 0.9898533074F, 0.9900486502F, 0.9902412587F, 0.9904311555F,
- 0.9906183633F, 0.9908029045F, 0.9909848019F, 0.9911640779F,
- 0.9913407550F, 0.9915148557F, 0.9916864025F, 0.9918554179F,
- 0.9920219241F, 0.9921859437F, 0.9923474989F, 0.9925066120F,
- 0.9926633054F, 0.9928176012F, 0.9929695218F, 0.9931190891F,
- 0.9932663254F, 0.9934112527F, 0.9935538932F, 0.9936942686F,
- 0.9938324012F, 0.9939683126F, 0.9941020248F, 0.9942335597F,
- 0.9943629388F, 0.9944901841F, 0.9946153170F, 0.9947383593F,
- 0.9948593325F, 0.9949782579F, 0.9950951572F, 0.9952100516F,
- 0.9953229625F, 0.9954339111F, 0.9955429186F, 0.9956500062F,
- 0.9957551948F, 0.9958585056F, 0.9959599593F, 0.9960595769F,
- 0.9961573792F, 0.9962533869F, 0.9963476206F, 0.9964401009F,
- 0.9965308483F, 0.9966198833F, 0.9967072261F, 0.9967928971F,
- 0.9968769164F, 0.9969593041F, 0.9970400804F, 0.9971192651F,
- 0.9971968781F, 0.9972729391F, 0.9973474680F, 0.9974204842F,
- 0.9974920074F, 0.9975620569F, 0.9976306521F, 0.9976978122F,
- 0.9977635565F, 0.9978279039F, 0.9978908736F, 0.9979524842F,
- 0.9980127547F, 0.9980717037F, 0.9981293499F, 0.9981857116F,
- 0.9982408073F, 0.9982946554F, 0.9983472739F, 0.9983986810F,
- 0.9984488947F, 0.9984979328F, 0.9985458132F, 0.9985925534F,
- 0.9986381711F, 0.9986826838F, 0.9987261086F, 0.9987684630F,
- 0.9988097640F, 0.9988500286F, 0.9988892738F, 0.9989275163F,
- 0.9989647727F, 0.9990010597F, 0.9990363938F, 0.9990707911F,
- 0.9991042679F, 0.9991368404F, 0.9991685244F, 0.9991993358F,
- 0.9992292905F, 0.9992584038F, 0.9992866914F, 0.9993141686F,
- 0.9993408506F, 0.9993667526F, 0.9993918895F, 0.9994162761F,
- 0.9994399273F, 0.9994628576F, 0.9994850815F, 0.9995066133F,
- 0.9995274672F, 0.9995476574F, 0.9995671978F, 0.9995861021F,
- 0.9996043841F, 0.9996220573F, 0.9996391352F, 0.9996556310F,
- 0.9996715579F, 0.9996869288F, 0.9997017568F, 0.9997160543F,
- 0.9997298342F, 0.9997431088F, 0.9997558905F, 0.9997681914F,
- 0.9997800236F, 0.9997913990F, 0.9998023292F, 0.9998128261F,
- 0.9998229009F, 0.9998325650F, 0.9998418296F, 0.9998507058F,
- 0.9998592044F, 0.9998673362F, 0.9998751117F, 0.9998825415F,
- 0.9998896358F, 0.9998964047F, 0.9999028584F, 0.9999090066F,
- 0.9999148590F, 0.9999204253F, 0.9999257148F, 0.9999307368F,
- 0.9999355003F, 0.9999400144F, 0.9999442878F, 0.9999483293F,
- 0.9999521472F, 0.9999557499F, 0.9999591457F, 0.9999623426F,
- 0.9999653483F, 0.9999681708F, 0.9999708175F, 0.9999732959F,
- 0.9999756132F, 0.9999777765F, 0.9999797928F, 0.9999816688F,
- 0.9999834113F, 0.9999850266F, 0.9999865211F, 0.9999879009F,
- 0.9999891721F, 0.9999903405F, 0.9999914118F, 0.9999923914F,
- 0.9999932849F, 0.9999940972F, 0.9999948336F, 0.9999954989F,
- 0.9999960978F, 0.9999966349F, 0.9999971146F, 0.9999975411F,
- 0.9999979185F, 0.9999982507F, 0.9999985414F, 0.9999987944F,
- 0.9999990129F, 0.9999992003F, 0.9999993596F, 0.9999994939F,
- 0.9999996059F, 0.9999996981F, 0.9999997732F, 0.9999998333F,
- 0.9999998805F, 0.9999999170F, 0.9999999444F, 0.9999999643F,
- 0.9999999784F, 0.9999999878F, 0.9999999937F, 0.9999999972F,
- 0.9999999990F, 0.9999999997F, 1.0000000000F, 1.0000000000F,
-};
-
-static const float vwin4096[2048] = {
- 0.0000002310F, 0.0000020791F, 0.0000057754F, 0.0000113197F,
- 0.0000187121F, 0.0000279526F, 0.0000390412F, 0.0000519777F,
- 0.0000667623F, 0.0000833949F, 0.0001018753F, 0.0001222036F,
- 0.0001443798F, 0.0001684037F, 0.0001942754F, 0.0002219947F,
- 0.0002515616F, 0.0002829761F, 0.0003162380F, 0.0003513472F,
- 0.0003883038F, 0.0004271076F, 0.0004677584F, 0.0005102563F,
- 0.0005546011F, 0.0006007928F, 0.0006488311F, 0.0006987160F,
- 0.0007504474F, 0.0008040251F, 0.0008594490F, 0.0009167191F,
- 0.0009758351F, 0.0010367969F, 0.0010996044F, 0.0011642574F,
- 0.0012307558F, 0.0012990994F, 0.0013692880F, 0.0014413216F,
- 0.0015151998F, 0.0015909226F, 0.0016684898F, 0.0017479011F,
- 0.0018291565F, 0.0019122556F, 0.0019971983F, 0.0020839845F,
- 0.0021726138F, 0.0022630861F, 0.0023554012F, 0.0024495588F,
- 0.0025455588F, 0.0026434008F, 0.0027430847F, 0.0028446103F,
- 0.0029479772F, 0.0030531853F, 0.0031602342F, 0.0032691238F,
- 0.0033798538F, 0.0034924239F, 0.0036068338F, 0.0037230833F,
- 0.0038411721F, 0.0039610999F, 0.0040828664F, 0.0042064714F,
- 0.0043319145F, 0.0044591954F, 0.0045883139F, 0.0047192696F,
- 0.0048520622F, 0.0049866914F, 0.0051231569F, 0.0052614583F,
- 0.0054015953F, 0.0055435676F, 0.0056873748F, 0.0058330166F,
- 0.0059804926F, 0.0061298026F, 0.0062809460F, 0.0064339226F,
- 0.0065887320F, 0.0067453738F, 0.0069038476F, 0.0070641531F,
- 0.0072262899F, 0.0073902575F, 0.0075560556F, 0.0077236838F,
- 0.0078931417F, 0.0080644288F, 0.0082375447F, 0.0084124891F,
- 0.0085892615F, 0.0087678614F, 0.0089482885F, 0.0091305422F,
- 0.0093146223F, 0.0095005281F, 0.0096882592F, 0.0098778153F,
- 0.0100691958F, 0.0102624002F, 0.0104574281F, 0.0106542791F,
- 0.0108529525F, 0.0110534480F, 0.0112557651F, 0.0114599032F,
- 0.0116658618F, 0.0118736405F, 0.0120832387F, 0.0122946560F,
- 0.0125078917F, 0.0127229454F, 0.0129398166F, 0.0131585046F,
- 0.0133790090F, 0.0136013292F, 0.0138254647F, 0.0140514149F,
- 0.0142791792F, 0.0145087572F, 0.0147401481F, 0.0149733515F,
- 0.0152083667F, 0.0154451932F, 0.0156838304F, 0.0159242777F,
- 0.0161665345F, 0.0164106001F, 0.0166564741F, 0.0169041557F,
- 0.0171536443F, 0.0174049393F, 0.0176580401F, 0.0179129461F,
- 0.0181696565F, 0.0184281708F, 0.0186884883F, 0.0189506084F,
- 0.0192145303F, 0.0194802535F, 0.0197477772F, 0.0200171008F,
- 0.0202882236F, 0.0205611449F, 0.0208358639F, 0.0211123801F,
- 0.0213906927F, 0.0216708011F, 0.0219527043F, 0.0222364019F,
- 0.0225218930F, 0.0228091769F, 0.0230982529F, 0.0233891203F,
- 0.0236817782F, 0.0239762259F, 0.0242724628F, 0.0245704880F,
- 0.0248703007F, 0.0251719002F, 0.0254752858F, 0.0257804565F,
- 0.0260874117F, 0.0263961506F, 0.0267066722F, 0.0270189760F,
- 0.0273330609F, 0.0276489263F, 0.0279665712F, 0.0282859949F,
- 0.0286071966F, 0.0289301753F, 0.0292549303F, 0.0295814607F,
- 0.0299097656F, 0.0302398442F, 0.0305716957F, 0.0309053191F,
- 0.0312407135F, 0.0315778782F, 0.0319168122F, 0.0322575145F,
- 0.0325999844F, 0.0329442209F, 0.0332902231F, 0.0336379900F,
- 0.0339875208F, 0.0343388146F, 0.0346918703F, 0.0350466871F,
- 0.0354032640F, 0.0357616000F, 0.0361216943F, 0.0364835458F,
- 0.0368471535F, 0.0372125166F, 0.0375796339F, 0.0379485046F,
- 0.0383191276F, 0.0386915020F, 0.0390656267F, 0.0394415008F,
- 0.0398191231F, 0.0401984927F, 0.0405796086F, 0.0409624698F,
- 0.0413470751F, 0.0417334235F, 0.0421215141F, 0.0425113457F,
- 0.0429029172F, 0.0432962277F, 0.0436912760F, 0.0440880610F,
- 0.0444865817F, 0.0448868370F, 0.0452888257F, 0.0456925468F,
- 0.0460979992F, 0.0465051816F, 0.0469140931F, 0.0473247325F,
- 0.0477370986F, 0.0481511902F, 0.0485670064F, 0.0489845458F,
- 0.0494038074F, 0.0498247899F, 0.0502474922F, 0.0506719131F,
- 0.0510980514F, 0.0515259060F, 0.0519554756F, 0.0523867590F,
- 0.0528197550F, 0.0532544624F, 0.0536908800F, 0.0541290066F,
- 0.0545688408F, 0.0550103815F, 0.0554536274F, 0.0558985772F,
- 0.0563452297F, 0.0567935837F, 0.0572436377F, 0.0576953907F,
- 0.0581488412F, 0.0586039880F, 0.0590608297F, 0.0595193651F,
- 0.0599795929F, 0.0604415117F, 0.0609051202F, 0.0613704170F,
- 0.0618374009F, 0.0623060704F, 0.0627764243F, 0.0632484611F,
- 0.0637221795F, 0.0641975781F, 0.0646746555F, 0.0651534104F,
- 0.0656338413F, 0.0661159469F, 0.0665997257F, 0.0670851763F,
- 0.0675722973F, 0.0680610873F, 0.0685515448F, 0.0690436684F,
- 0.0695374567F, 0.0700329081F, 0.0705300213F, 0.0710287947F,
- 0.0715292269F, 0.0720313163F, 0.0725350616F, 0.0730404612F,
- 0.0735475136F, 0.0740562172F, 0.0745665707F, 0.0750785723F,
- 0.0755922207F, 0.0761075143F, 0.0766244515F, 0.0771430307F,
- 0.0776632505F, 0.0781851092F, 0.0787086052F, 0.0792337371F,
- 0.0797605032F, 0.0802889018F, 0.0808189315F, 0.0813505905F,
- 0.0818838773F, 0.0824187903F, 0.0829553277F, 0.0834934881F,
- 0.0840332697F, 0.0845746708F, 0.0851176899F, 0.0856623252F,
- 0.0862085751F, 0.0867564379F, 0.0873059119F, 0.0878569954F,
- 0.0884096867F, 0.0889639840F, 0.0895198858F, 0.0900773902F,
- 0.0906364955F, 0.0911972000F, 0.0917595019F, 0.0923233995F,
- 0.0928888909F, 0.0934559745F, 0.0940246485F, 0.0945949110F,
- 0.0951667604F, 0.0957401946F, 0.0963152121F, 0.0968918109F,
- 0.0974699893F, 0.0980497454F, 0.0986310773F, 0.0992139832F,
- 0.0997984614F, 0.1003845098F, 0.1009721267F, 0.1015613101F,
- 0.1021520582F, 0.1027443692F, 0.1033382410F, 0.1039336718F,
- 0.1045306597F, 0.1051292027F, 0.1057292990F, 0.1063309466F,
- 0.1069341435F, 0.1075388878F, 0.1081451776F, 0.1087530108F,
- 0.1093623856F, 0.1099732998F, 0.1105857516F, 0.1111997389F,
- 0.1118152597F, 0.1124323121F, 0.1130508939F, 0.1136710032F,
- 0.1142926379F, 0.1149157960F, 0.1155404755F, 0.1161666742F,
- 0.1167943901F, 0.1174236211F, 0.1180543652F, 0.1186866202F,
- 0.1193203841F, 0.1199556548F, 0.1205924300F, 0.1212307078F,
- 0.1218704860F, 0.1225117624F, 0.1231545349F, 0.1237988013F,
- 0.1244445596F, 0.1250918074F, 0.1257405427F, 0.1263907632F,
- 0.1270424667F, 0.1276956512F, 0.1283503142F, 0.1290064537F,
- 0.1296640674F, 0.1303231530F, 0.1309837084F, 0.1316457312F,
- 0.1323092193F, 0.1329741703F, 0.1336405820F, 0.1343084520F,
- 0.1349777782F, 0.1356485582F, 0.1363207897F, 0.1369944704F,
- 0.1376695979F, 0.1383461700F, 0.1390241842F, 0.1397036384F,
- 0.1403845300F, 0.1410668567F, 0.1417506162F, 0.1424358061F,
- 0.1431224240F, 0.1438104674F, 0.1444999341F, 0.1451908216F,
- 0.1458831274F, 0.1465768492F, 0.1472719844F, 0.1479685308F,
- 0.1486664857F, 0.1493658468F, 0.1500666115F, 0.1507687775F,
- 0.1514723422F, 0.1521773031F, 0.1528836577F, 0.1535914035F,
- 0.1543005380F, 0.1550110587F, 0.1557229631F, 0.1564362485F,
- 0.1571509124F, 0.1578669524F, 0.1585843657F, 0.1593031499F,
- 0.1600233024F, 0.1607448205F, 0.1614677017F, 0.1621919433F,
- 0.1629175428F, 0.1636444975F, 0.1643728047F, 0.1651024619F,
- 0.1658334665F, 0.1665658156F, 0.1672995067F, 0.1680345371F,
- 0.1687709041F, 0.1695086050F, 0.1702476372F, 0.1709879978F,
- 0.1717296843F, 0.1724726938F, 0.1732170237F, 0.1739626711F,
- 0.1747096335F, 0.1754579079F, 0.1762074916F, 0.1769583819F,
- 0.1777105760F, 0.1784640710F, 0.1792188642F, 0.1799749529F,
- 0.1807323340F, 0.1814910049F, 0.1822509628F, 0.1830122046F,
- 0.1837747277F, 0.1845385292F, 0.1853036062F, 0.1860699558F,
- 0.1868375751F, 0.1876064613F, 0.1883766114F, 0.1891480226F,
- 0.1899206919F, 0.1906946164F, 0.1914697932F, 0.1922462194F,
- 0.1930238919F, 0.1938028079F, 0.1945829643F, 0.1953643583F,
- 0.1961469868F, 0.1969308468F, 0.1977159353F, 0.1985022494F,
- 0.1992897859F, 0.2000785420F, 0.2008685145F, 0.2016597005F,
- 0.2024520968F, 0.2032457005F, 0.2040405084F, 0.2048365175F,
- 0.2056337247F, 0.2064321269F, 0.2072317211F, 0.2080325041F,
- 0.2088344727F, 0.2096376240F, 0.2104419547F, 0.2112474618F,
- 0.2120541420F, 0.2128619923F, 0.2136710094F, 0.2144811902F,
- 0.2152925315F, 0.2161050301F, 0.2169186829F, 0.2177334866F,
- 0.2185494381F, 0.2193665340F, 0.2201847712F, 0.2210041465F,
- 0.2218246565F, 0.2226462981F, 0.2234690680F, 0.2242929629F,
- 0.2251179796F, 0.2259441147F, 0.2267713650F, 0.2275997272F,
- 0.2284291979F, 0.2292597739F, 0.2300914518F, 0.2309242283F,
- 0.2317581001F, 0.2325930638F, 0.2334291160F, 0.2342662534F,
- 0.2351044727F, 0.2359437703F, 0.2367841431F, 0.2376255875F,
- 0.2384681001F, 0.2393116776F, 0.2401563165F, 0.2410020134F,
- 0.2418487649F, 0.2426965675F, 0.2435454178F, 0.2443953122F,
- 0.2452462474F, 0.2460982199F, 0.2469512262F, 0.2478052628F,
- 0.2486603262F, 0.2495164129F, 0.2503735194F, 0.2512316421F,
- 0.2520907776F, 0.2529509222F, 0.2538120726F, 0.2546742250F,
- 0.2555373760F, 0.2564015219F, 0.2572666593F, 0.2581327845F,
- 0.2589998939F, 0.2598679840F, 0.2607370510F, 0.2616070916F,
- 0.2624781019F, 0.2633500783F, 0.2642230173F, 0.2650969152F,
- 0.2659717684F, 0.2668475731F, 0.2677243257F, 0.2686020226F,
- 0.2694806601F, 0.2703602344F, 0.2712407419F, 0.2721221789F,
- 0.2730045417F, 0.2738878265F, 0.2747720297F, 0.2756571474F,
- 0.2765431760F, 0.2774301117F, 0.2783179508F, 0.2792066895F,
- 0.2800963240F, 0.2809868505F, 0.2818782654F, 0.2827705647F,
- 0.2836637447F, 0.2845578016F, 0.2854527315F, 0.2863485307F,
- 0.2872451953F, 0.2881427215F, 0.2890411055F, 0.2899403433F,
- 0.2908404312F, 0.2917413654F, 0.2926431418F, 0.2935457567F,
- 0.2944492061F, 0.2953534863F, 0.2962585932F, 0.2971645230F,
- 0.2980712717F, 0.2989788356F, 0.2998872105F, 0.3007963927F,
- 0.3017063781F, 0.3026171629F, 0.3035287430F, 0.3044411145F,
- 0.3053542736F, 0.3062682161F, 0.3071829381F, 0.3080984356F,
- 0.3090147047F, 0.3099317413F, 0.3108495414F, 0.3117681011F,
- 0.3126874163F, 0.3136074830F, 0.3145282972F, 0.3154498548F,
- 0.3163721517F, 0.3172951841F, 0.3182189477F, 0.3191434385F,
- 0.3200686525F, 0.3209945856F, 0.3219212336F, 0.3228485927F,
- 0.3237766585F, 0.3247054271F, 0.3256348943F, 0.3265650560F,
- 0.3274959081F, 0.3284274465F, 0.3293596671F, 0.3302925657F,
- 0.3312261382F, 0.3321603804F, 0.3330952882F, 0.3340308574F,
- 0.3349670838F, 0.3359039634F, 0.3368414919F, 0.3377796651F,
- 0.3387184789F, 0.3396579290F, 0.3405980113F, 0.3415387216F,
- 0.3424800556F, 0.3434220091F, 0.3443645779F, 0.3453077578F,
- 0.3462515446F, 0.3471959340F, 0.3481409217F, 0.3490865036F,
- 0.3500326754F, 0.3509794328F, 0.3519267715F, 0.3528746873F,
- 0.3538231759F, 0.3547722330F, 0.3557218544F, 0.3566720357F,
- 0.3576227727F, 0.3585740610F, 0.3595258964F, 0.3604782745F,
- 0.3614311910F, 0.3623846417F, 0.3633386221F, 0.3642931280F,
- 0.3652481549F, 0.3662036987F, 0.3671597548F, 0.3681163191F,
- 0.3690733870F, 0.3700309544F, 0.3709890167F, 0.3719475696F,
- 0.3729066089F, 0.3738661299F, 0.3748261285F, 0.3757866002F,
- 0.3767475406F, 0.3777089453F, 0.3786708100F, 0.3796331302F,
- 0.3805959014F, 0.3815591194F, 0.3825227796F, 0.3834868777F,
- 0.3844514093F, 0.3854163698F, 0.3863817549F, 0.3873475601F,
- 0.3883137810F, 0.3892804131F, 0.3902474521F, 0.3912148933F,
- 0.3921827325F, 0.3931509650F, 0.3941195865F, 0.3950885925F,
- 0.3960579785F, 0.3970277400F, 0.3979978725F, 0.3989683716F,
- 0.3999392328F, 0.4009104516F, 0.4018820234F, 0.4028539438F,
- 0.4038262084F, 0.4047988125F, 0.4057717516F, 0.4067450214F,
- 0.4077186172F, 0.4086925345F, 0.4096667688F, 0.4106413155F,
- 0.4116161703F, 0.4125913284F, 0.4135667854F, 0.4145425368F,
- 0.4155185780F, 0.4164949044F, 0.4174715116F, 0.4184483949F,
- 0.4194255498F, 0.4204029718F, 0.4213806563F, 0.4223585987F,
- 0.4233367946F, 0.4243152392F, 0.4252939281F, 0.4262728566F,
- 0.4272520202F, 0.4282314144F, 0.4292110345F, 0.4301908760F,
- 0.4311709343F, 0.4321512047F, 0.4331316828F, 0.4341123639F,
- 0.4350932435F, 0.4360743168F, 0.4370555794F, 0.4380370267F,
- 0.4390186540F, 0.4400004567F, 0.4409824303F, 0.4419645701F,
- 0.4429468716F, 0.4439293300F, 0.4449119409F, 0.4458946996F,
- 0.4468776014F, 0.4478606418F, 0.4488438162F, 0.4498271199F,
- 0.4508105483F, 0.4517940967F, 0.4527777607F, 0.4537615355F,
- 0.4547454165F, 0.4557293991F, 0.4567134786F, 0.4576976505F,
- 0.4586819101F, 0.4596662527F, 0.4606506738F, 0.4616351687F,
- 0.4626197328F, 0.4636043614F, 0.4645890499F, 0.4655737936F,
- 0.4665585880F, 0.4675434284F, 0.4685283101F, 0.4695132286F,
- 0.4704981791F, 0.4714831570F, 0.4724681577F, 0.4734531766F,
- 0.4744382089F, 0.4754232501F, 0.4764082956F, 0.4773933406F,
- 0.4783783806F, 0.4793634108F, 0.4803484267F, 0.4813334237F,
- 0.4823183969F, 0.4833033419F, 0.4842882540F, 0.4852731285F,
- 0.4862579608F, 0.4872427462F, 0.4882274802F, 0.4892121580F,
- 0.4901967751F, 0.4911813267F, 0.4921658083F, 0.4931502151F,
- 0.4941345427F, 0.4951187863F, 0.4961029412F, 0.4970870029F,
- 0.4980709667F, 0.4990548280F, 0.5000385822F, 0.5010222245F,
- 0.5020057505F, 0.5029891553F, 0.5039724345F, 0.5049555834F,
- 0.5059385973F, 0.5069214716F, 0.5079042018F, 0.5088867831F,
- 0.5098692110F, 0.5108514808F, 0.5118335879F, 0.5128155277F,
- 0.5137972956F, 0.5147788869F, 0.5157602971F, 0.5167415215F,
- 0.5177225555F, 0.5187033945F, 0.5196840339F, 0.5206644692F,
- 0.5216446956F, 0.5226247086F, 0.5236045035F, 0.5245840759F,
- 0.5255634211F, 0.5265425344F, 0.5275214114F, 0.5285000474F,
- 0.5294784378F, 0.5304565781F, 0.5314344637F, 0.5324120899F,
- 0.5333894522F, 0.5343665461F, 0.5353433670F, 0.5363199102F,
- 0.5372961713F, 0.5382721457F, 0.5392478287F, 0.5402232159F,
- 0.5411983027F, 0.5421730845F, 0.5431475569F, 0.5441217151F,
- 0.5450955548F, 0.5460690714F, 0.5470422602F, 0.5480151169F,
- 0.5489876368F, 0.5499598155F, 0.5509316484F, 0.5519031310F,
- 0.5528742587F, 0.5538450271F, 0.5548154317F, 0.5557854680F,
- 0.5567551314F, 0.5577244174F, 0.5586933216F, 0.5596618395F,
- 0.5606299665F, 0.5615976983F, 0.5625650302F, 0.5635319580F,
- 0.5644984770F, 0.5654645828F, 0.5664302709F, 0.5673955370F,
- 0.5683603765F, 0.5693247850F, 0.5702887580F, 0.5712522912F,
- 0.5722153800F, 0.5731780200F, 0.5741402069F, 0.5751019362F,
- 0.5760632034F, 0.5770240042F, 0.5779843341F, 0.5789441889F,
- 0.5799035639F, 0.5808624549F, 0.5818208575F, 0.5827787673F,
- 0.5837361800F, 0.5846930910F, 0.5856494961F, 0.5866053910F,
- 0.5875607712F, 0.5885156324F, 0.5894699703F, 0.5904237804F,
- 0.5913770586F, 0.5923298004F, 0.5932820016F, 0.5942336578F,
- 0.5951847646F, 0.5961353179F, 0.5970853132F, 0.5980347464F,
- 0.5989836131F, 0.5999319090F, 0.6008796298F, 0.6018267713F,
- 0.6027733292F, 0.6037192993F, 0.6046646773F, 0.6056094589F,
- 0.6065536400F, 0.6074972162F, 0.6084401833F, 0.6093825372F,
- 0.6103242736F, 0.6112653884F, 0.6122058772F, 0.6131457359F,
- 0.6140849604F, 0.6150235464F, 0.6159614897F, 0.6168987862F,
- 0.6178354318F, 0.6187714223F, 0.6197067535F, 0.6206414213F,
- 0.6215754215F, 0.6225087501F, 0.6234414028F, 0.6243733757F,
- 0.6253046646F, 0.6262352654F, 0.6271651739F, 0.6280943862F,
- 0.6290228982F, 0.6299507057F, 0.6308778048F, 0.6318041913F,
- 0.6327298612F, 0.6336548105F, 0.6345790352F, 0.6355025312F,
- 0.6364252945F, 0.6373473211F, 0.6382686070F, 0.6391891483F,
- 0.6401089409F, 0.6410279808F, 0.6419462642F, 0.6428637869F,
- 0.6437805452F, 0.6446965350F, 0.6456117524F, 0.6465261935F,
- 0.6474398544F, 0.6483527311F, 0.6492648197F, 0.6501761165F,
- 0.6510866174F, 0.6519963186F, 0.6529052162F, 0.6538133064F,
- 0.6547205854F, 0.6556270492F, 0.6565326941F, 0.6574375162F,
- 0.6583415117F, 0.6592446769F, 0.6601470079F, 0.6610485009F,
- 0.6619491521F, 0.6628489578F, 0.6637479143F, 0.6646460177F,
- 0.6655432643F, 0.6664396505F, 0.6673351724F, 0.6682298264F,
- 0.6691236087F, 0.6700165157F, 0.6709085436F, 0.6717996889F,
- 0.6726899478F, 0.6735793167F, 0.6744677918F, 0.6753553697F,
- 0.6762420466F, 0.6771278190F, 0.6780126832F, 0.6788966357F,
- 0.6797796728F, 0.6806617909F, 0.6815429866F, 0.6824232562F,
- 0.6833025961F, 0.6841810030F, 0.6850584731F, 0.6859350031F,
- 0.6868105894F, 0.6876852284F, 0.6885589168F, 0.6894316510F,
- 0.6903034275F, 0.6911742430F, 0.6920440939F, 0.6929129769F,
- 0.6937808884F, 0.6946478251F, 0.6955137837F, 0.6963787606F,
- 0.6972427525F, 0.6981057560F, 0.6989677678F, 0.6998287845F,
- 0.7006888028F, 0.7015478194F, 0.7024058309F, 0.7032628340F,
- 0.7041188254F, 0.7049738019F, 0.7058277601F, 0.7066806969F,
- 0.7075326089F, 0.7083834929F, 0.7092333457F, 0.7100821640F,
- 0.7109299447F, 0.7117766846F, 0.7126223804F, 0.7134670291F,
- 0.7143106273F, 0.7151531721F, 0.7159946602F, 0.7168350885F,
- 0.7176744539F, 0.7185127534F, 0.7193499837F, 0.7201861418F,
- 0.7210212247F, 0.7218552293F, 0.7226881526F, 0.7235199914F,
- 0.7243507428F, 0.7251804039F, 0.7260089715F, 0.7268364426F,
- 0.7276628144F, 0.7284880839F, 0.7293122481F, 0.7301353040F,
- 0.7309572487F, 0.7317780794F, 0.7325977930F, 0.7334163868F,
- 0.7342338579F, 0.7350502033F, 0.7358654202F, 0.7366795059F,
- 0.7374924573F, 0.7383042718F, 0.7391149465F, 0.7399244787F,
- 0.7407328655F, 0.7415401041F, 0.7423461920F, 0.7431511261F,
- 0.7439549040F, 0.7447575227F, 0.7455589797F, 0.7463592723F,
- 0.7471583976F, 0.7479563532F, 0.7487531363F, 0.7495487443F,
- 0.7503431745F, 0.7511364244F, 0.7519284913F, 0.7527193726F,
- 0.7535090658F, 0.7542975683F, 0.7550848776F, 0.7558709910F,
- 0.7566559062F, 0.7574396205F, 0.7582221314F, 0.7590034366F,
- 0.7597835334F, 0.7605624194F, 0.7613400923F, 0.7621165495F,
- 0.7628917886F, 0.7636658072F, 0.7644386030F, 0.7652101735F,
- 0.7659805164F, 0.7667496292F, 0.7675175098F, 0.7682841556F,
- 0.7690495645F, 0.7698137341F, 0.7705766622F, 0.7713383463F,
- 0.7720987844F, 0.7728579741F, 0.7736159132F, 0.7743725994F,
- 0.7751280306F, 0.7758822046F, 0.7766351192F, 0.7773867722F,
- 0.7781371614F, 0.7788862848F, 0.7796341401F, 0.7803807253F,
- 0.7811260383F, 0.7818700769F, 0.7826128392F, 0.7833543230F,
- 0.7840945263F, 0.7848334471F, 0.7855710833F, 0.7863074330F,
- 0.7870424941F, 0.7877762647F, 0.7885087428F, 0.7892399264F,
- 0.7899698137F, 0.7906984026F, 0.7914256914F, 0.7921516780F,
- 0.7928763607F, 0.7935997375F, 0.7943218065F, 0.7950425661F,
- 0.7957620142F, 0.7964801492F, 0.7971969692F, 0.7979124724F,
- 0.7986266570F, 0.7993395214F, 0.8000510638F, 0.8007612823F,
- 0.8014701754F, 0.8021777413F, 0.8028839784F, 0.8035888849F,
- 0.8042924592F, 0.8049946997F, 0.8056956048F, 0.8063951727F,
- 0.8070934020F, 0.8077902910F, 0.8084858381F, 0.8091800419F,
- 0.8098729007F, 0.8105644130F, 0.8112545774F, 0.8119433922F,
- 0.8126308561F, 0.8133169676F, 0.8140017251F, 0.8146851272F,
- 0.8153671726F, 0.8160478598F, 0.8167271874F, 0.8174051539F,
- 0.8180817582F, 0.8187569986F, 0.8194308741F, 0.8201033831F,
- 0.8207745244F, 0.8214442966F, 0.8221126986F, 0.8227797290F,
- 0.8234453865F, 0.8241096700F, 0.8247725781F, 0.8254341097F,
- 0.8260942636F, 0.8267530385F, 0.8274104334F, 0.8280664470F,
- 0.8287210782F, 0.8293743259F, 0.8300261889F, 0.8306766662F,
- 0.8313257566F, 0.8319734591F, 0.8326197727F, 0.8332646963F,
- 0.8339082288F, 0.8345503692F, 0.8351911167F, 0.8358304700F,
- 0.8364684284F, 0.8371049907F, 0.8377401562F, 0.8383739238F,
- 0.8390062927F, 0.8396372618F, 0.8402668305F, 0.8408949977F,
- 0.8415217626F, 0.8421471245F, 0.8427710823F, 0.8433936354F,
- 0.8440147830F, 0.8446345242F, 0.8452528582F, 0.8458697844F,
- 0.8464853020F, 0.8470994102F, 0.8477121084F, 0.8483233958F,
- 0.8489332718F, 0.8495417356F, 0.8501487866F, 0.8507544243F,
- 0.8513586479F, 0.8519614568F, 0.8525628505F, 0.8531628283F,
- 0.8537613897F, 0.8543585341F, 0.8549542611F, 0.8555485699F,
- 0.8561414603F, 0.8567329315F, 0.8573229832F, 0.8579116149F,
- 0.8584988262F, 0.8590846165F, 0.8596689855F, 0.8602519327F,
- 0.8608334577F, 0.8614135603F, 0.8619922399F, 0.8625694962F,
- 0.8631453289F, 0.8637197377F, 0.8642927222F, 0.8648642821F,
- 0.8654344172F, 0.8660031272F, 0.8665704118F, 0.8671362708F,
- 0.8677007039F, 0.8682637109F, 0.8688252917F, 0.8693854460F,
- 0.8699441737F, 0.8705014745F, 0.8710573485F, 0.8716117953F,
- 0.8721648150F, 0.8727164073F, 0.8732665723F, 0.8738153098F,
- 0.8743626197F, 0.8749085021F, 0.8754529569F, 0.8759959840F,
- 0.8765375835F, 0.8770777553F, 0.8776164996F, 0.8781538162F,
- 0.8786897054F, 0.8792241670F, 0.8797572013F, 0.8802888082F,
- 0.8808189880F, 0.8813477407F, 0.8818750664F, 0.8824009653F,
- 0.8829254375F, 0.8834484833F, 0.8839701028F, 0.8844902961F,
- 0.8850090636F, 0.8855264054F, 0.8860423218F, 0.8865568131F,
- 0.8870698794F, 0.8875815212F, 0.8880917386F, 0.8886005319F,
- 0.8891079016F, 0.8896138479F, 0.8901183712F, 0.8906214719F,
- 0.8911231503F, 0.8916234067F, 0.8921222417F, 0.8926196556F,
- 0.8931156489F, 0.8936102219F, 0.8941033752F, 0.8945951092F,
- 0.8950854244F, 0.8955743212F, 0.8960618003F, 0.8965478621F,
- 0.8970325071F, 0.8975157359F, 0.8979975490F, 0.8984779471F,
- 0.8989569307F, 0.8994345004F, 0.8999106568F, 0.9003854005F,
- 0.9008587323F, 0.9013306526F, 0.9018011623F, 0.9022702619F,
- 0.9027379521F, 0.9032042337F, 0.9036691074F, 0.9041325739F,
- 0.9045946339F, 0.9050552882F, 0.9055145376F, 0.9059723828F,
- 0.9064288246F, 0.9068838638F, 0.9073375013F, 0.9077897379F,
- 0.9082405743F, 0.9086900115F, 0.9091380503F, 0.9095846917F,
- 0.9100299364F, 0.9104737854F, 0.9109162397F, 0.9113573001F,
- 0.9117969675F, 0.9122352430F, 0.9126721275F, 0.9131076219F,
- 0.9135417273F, 0.9139744447F, 0.9144057750F, 0.9148357194F,
- 0.9152642787F, 0.9156914542F, 0.9161172468F, 0.9165416576F,
- 0.9169646877F, 0.9173863382F, 0.9178066102F, 0.9182255048F,
- 0.9186430232F, 0.9190591665F, 0.9194739359F, 0.9198873324F,
- 0.9202993574F, 0.9207100120F, 0.9211192973F, 0.9215272147F,
- 0.9219337653F, 0.9223389504F, 0.9227427713F, 0.9231452290F,
- 0.9235463251F, 0.9239460607F, 0.9243444371F, 0.9247414557F,
- 0.9251371177F, 0.9255314245F, 0.9259243774F, 0.9263159778F,
- 0.9267062270F, 0.9270951264F, 0.9274826774F, 0.9278688814F,
- 0.9282537398F, 0.9286372540F, 0.9290194254F, 0.9294002555F,
- 0.9297797458F, 0.9301578976F, 0.9305347125F, 0.9309101919F,
- 0.9312843373F, 0.9316571503F, 0.9320286323F, 0.9323987849F,
- 0.9327676097F, 0.9331351080F, 0.9335012816F, 0.9338661320F,
- 0.9342296607F, 0.9345918694F, 0.9349527596F, 0.9353123330F,
- 0.9356705911F, 0.9360275357F, 0.9363831683F, 0.9367374905F,
- 0.9370905042F, 0.9374422108F, 0.9377926122F, 0.9381417099F,
- 0.9384895057F, 0.9388360014F, 0.9391811985F, 0.9395250989F,
- 0.9398677043F, 0.9402090165F, 0.9405490371F, 0.9408877680F,
- 0.9412252110F, 0.9415613678F, 0.9418962402F, 0.9422298301F,
- 0.9425621392F, 0.9428931695F, 0.9432229226F, 0.9435514005F,
- 0.9438786050F, 0.9442045381F, 0.9445292014F, 0.9448525971F,
- 0.9451747268F, 0.9454955926F, 0.9458151963F, 0.9461335399F,
- 0.9464506253F, 0.9467664545F, 0.9470810293F, 0.9473943517F,
- 0.9477064238F, 0.9480172474F, 0.9483268246F, 0.9486351573F,
- 0.9489422475F, 0.9492480973F, 0.9495527087F, 0.9498560837F,
- 0.9501582243F, 0.9504591325F, 0.9507588105F, 0.9510572603F,
- 0.9513544839F, 0.9516504834F, 0.9519452609F, 0.9522388186F,
- 0.9525311584F, 0.9528222826F, 0.9531121932F, 0.9534008923F,
- 0.9536883821F, 0.9539746647F, 0.9542597424F, 0.9545436171F,
- 0.9548262912F, 0.9551077667F, 0.9553880459F, 0.9556671309F,
- 0.9559450239F, 0.9562217272F, 0.9564972429F, 0.9567715733F,
- 0.9570447206F, 0.9573166871F, 0.9575874749F, 0.9578570863F,
- 0.9581255236F, 0.9583927890F, 0.9586588849F, 0.9589238134F,
- 0.9591875769F, 0.9594501777F, 0.9597116180F, 0.9599719003F,
- 0.9602310267F, 0.9604889995F, 0.9607458213F, 0.9610014942F,
- 0.9612560206F, 0.9615094028F, 0.9617616433F, 0.9620127443F,
- 0.9622627083F, 0.9625115376F, 0.9627592345F, 0.9630058016F,
- 0.9632512411F, 0.9634955555F, 0.9637387471F, 0.9639808185F,
- 0.9642217720F, 0.9644616100F, 0.9647003349F, 0.9649379493F,
- 0.9651744556F, 0.9654098561F, 0.9656441534F, 0.9658773499F,
- 0.9661094480F, 0.9663404504F, 0.9665703593F, 0.9667991774F,
- 0.9670269071F, 0.9672535509F, 0.9674791114F, 0.9677035909F,
- 0.9679269921F, 0.9681493174F, 0.9683705694F, 0.9685907506F,
- 0.9688098636F, 0.9690279108F, 0.9692448948F, 0.9694608182F,
- 0.9696756836F, 0.9698894934F, 0.9701022503F, 0.9703139569F,
- 0.9705246156F, 0.9707342291F, 0.9709428000F, 0.9711503309F,
- 0.9713568243F, 0.9715622829F, 0.9717667093F, 0.9719701060F,
- 0.9721724757F, 0.9723738210F, 0.9725741446F, 0.9727734490F,
- 0.9729717369F, 0.9731690109F, 0.9733652737F, 0.9735605279F,
- 0.9737547762F, 0.9739480212F, 0.9741402656F, 0.9743315120F,
- 0.9745217631F, 0.9747110216F, 0.9748992901F, 0.9750865714F,
- 0.9752728681F, 0.9754581829F, 0.9756425184F, 0.9758258775F,
- 0.9760082627F, 0.9761896768F, 0.9763701224F, 0.9765496024F,
- 0.9767281193F, 0.9769056760F, 0.9770822751F, 0.9772579193F,
- 0.9774326114F, 0.9776063542F, 0.9777791502F, 0.9779510023F,
- 0.9781219133F, 0.9782918858F, 0.9784609226F, 0.9786290264F,
- 0.9787962000F, 0.9789624461F, 0.9791277676F, 0.9792921671F,
- 0.9794556474F, 0.9796182113F, 0.9797798615F, 0.9799406009F,
- 0.9801004321F, 0.9802593580F, 0.9804173813F, 0.9805745049F,
- 0.9807307314F, 0.9808860637F, 0.9810405046F, 0.9811940568F,
- 0.9813467232F, 0.9814985065F, 0.9816494095F, 0.9817994351F,
- 0.9819485860F, 0.9820968650F, 0.9822442750F, 0.9823908186F,
- 0.9825364988F, 0.9826813184F, 0.9828252801F, 0.9829683868F,
- 0.9831106413F, 0.9832520463F, 0.9833926048F, 0.9835323195F,
- 0.9836711932F, 0.9838092288F, 0.9839464291F, 0.9840827969F,
- 0.9842183351F, 0.9843530464F, 0.9844869337F, 0.9846199998F,
- 0.9847522475F, 0.9848836798F, 0.9850142993F, 0.9851441090F,
- 0.9852731117F, 0.9854013101F, 0.9855287073F, 0.9856553058F,
- 0.9857811087F, 0.9859061188F, 0.9860303388F, 0.9861537717F,
- 0.9862764202F, 0.9863982872F, 0.9865193756F, 0.9866396882F,
- 0.9867592277F, 0.9868779972F, 0.9869959993F, 0.9871132370F,
- 0.9872297131F, 0.9873454304F, 0.9874603918F, 0.9875746001F,
- 0.9876880581F, 0.9878007688F, 0.9879127348F, 0.9880239592F,
- 0.9881344447F, 0.9882441941F, 0.9883532104F, 0.9884614962F,
- 0.9885690546F, 0.9886758883F, 0.9887820001F, 0.9888873930F,
- 0.9889920697F, 0.9890960331F, 0.9891992859F, 0.9893018312F,
- 0.9894036716F, 0.9895048100F, 0.9896052493F, 0.9897049923F,
- 0.9898040418F, 0.9899024006F, 0.9900000717F, 0.9900970577F,
- 0.9901933616F, 0.9902889862F, 0.9903839343F, 0.9904782087F,
- 0.9905718122F, 0.9906647477F, 0.9907570180F, 0.9908486259F,
- 0.9909395742F, 0.9910298658F, 0.9911195034F, 0.9912084899F,
- 0.9912968281F, 0.9913845208F, 0.9914715708F, 0.9915579810F,
- 0.9916437540F, 0.9917288928F, 0.9918134001F, 0.9918972788F,
- 0.9919805316F, 0.9920631613F, 0.9921451707F, 0.9922265626F,
- 0.9923073399F, 0.9923875052F, 0.9924670615F, 0.9925460114F,
- 0.9926243577F, 0.9927021033F, 0.9927792508F, 0.9928558032F,
- 0.9929317631F, 0.9930071333F, 0.9930819167F, 0.9931561158F,
- 0.9932297337F, 0.9933027728F, 0.9933752362F, 0.9934471264F,
- 0.9935184462F, 0.9935891985F, 0.9936593859F, 0.9937290112F,
- 0.9937980771F, 0.9938665864F, 0.9939345418F, 0.9940019460F,
- 0.9940688018F, 0.9941351118F, 0.9942008789F, 0.9942661057F,
- 0.9943307950F, 0.9943949494F, 0.9944585717F, 0.9945216645F,
- 0.9945842307F, 0.9946462728F, 0.9947077936F, 0.9947687957F,
- 0.9948292820F, 0.9948892550F, 0.9949487174F, 0.9950076719F,
- 0.9950661212F, 0.9951240679F, 0.9951815148F, 0.9952384645F,
- 0.9952949196F, 0.9953508828F, 0.9954063568F, 0.9954613442F,
- 0.9955158476F, 0.9955698697F, 0.9956234132F, 0.9956764806F,
- 0.9957290746F, 0.9957811978F, 0.9958328528F, 0.9958840423F,
- 0.9959347688F, 0.9959850351F, 0.9960348435F, 0.9960841969F,
- 0.9961330977F, 0.9961815486F, 0.9962295521F, 0.9962771108F,
- 0.9963242274F, 0.9963709043F, 0.9964171441F, 0.9964629494F,
- 0.9965083228F, 0.9965532668F, 0.9965977840F, 0.9966418768F,
- 0.9966855479F, 0.9967287998F, 0.9967716350F, 0.9968140559F,
- 0.9968560653F, 0.9968976655F, 0.9969388591F, 0.9969796485F,
- 0.9970200363F, 0.9970600250F, 0.9970996170F, 0.9971388149F,
- 0.9971776211F, 0.9972160380F, 0.9972540683F, 0.9972917142F,
- 0.9973289783F, 0.9973658631F, 0.9974023709F, 0.9974385042F,
- 0.9974742655F, 0.9975096571F, 0.9975446816F, 0.9975793413F,
- 0.9976136386F, 0.9976475759F, 0.9976811557F, 0.9977143803F,
- 0.9977472521F, 0.9977797736F, 0.9978119470F, 0.9978437748F,
- 0.9978752593F, 0.9979064029F, 0.9979372079F, 0.9979676768F,
- 0.9979978117F, 0.9980276151F, 0.9980570893F, 0.9980862367F,
- 0.9981150595F, 0.9981435600F, 0.9981717406F, 0.9981996035F,
- 0.9982271511F, 0.9982543856F, 0.9982813093F, 0.9983079246F,
- 0.9983342336F, 0.9983602386F, 0.9983859418F, 0.9984113456F,
- 0.9984364522F, 0.9984612638F, 0.9984857825F, 0.9985100108F,
- 0.9985339507F, 0.9985576044F, 0.9985809743F, 0.9986040624F,
- 0.9986268710F, 0.9986494022F, 0.9986716583F, 0.9986936413F,
- 0.9987153535F, 0.9987367969F, 0.9987579738F, 0.9987788864F,
- 0.9987995366F, 0.9988199267F, 0.9988400587F, 0.9988599348F,
- 0.9988795572F, 0.9988989278F, 0.9989180487F, 0.9989369222F,
- 0.9989555501F, 0.9989739347F, 0.9989920780F, 0.9990099820F,
- 0.9990276487F, 0.9990450803F, 0.9990622787F, 0.9990792460F,
- 0.9990959841F, 0.9991124952F, 0.9991287812F, 0.9991448440F,
- 0.9991606858F, 0.9991763084F, 0.9991917139F, 0.9992069042F,
- 0.9992218813F, 0.9992366471F, 0.9992512035F, 0.9992655525F,
- 0.9992796961F, 0.9992936361F, 0.9993073744F, 0.9993209131F,
- 0.9993342538F, 0.9993473987F, 0.9993603494F, 0.9993731080F,
- 0.9993856762F, 0.9993980559F, 0.9994102490F, 0.9994222573F,
- 0.9994340827F, 0.9994457269F, 0.9994571918F, 0.9994684793F,
- 0.9994795910F, 0.9994905288F, 0.9995012945F, 0.9995118898F,
- 0.9995223165F, 0.9995325765F, 0.9995426713F, 0.9995526029F,
- 0.9995623728F, 0.9995719829F, 0.9995814349F, 0.9995907304F,
- 0.9995998712F, 0.9996088590F, 0.9996176954F, 0.9996263821F,
- 0.9996349208F, 0.9996433132F, 0.9996515609F, 0.9996596656F,
- 0.9996676288F, 0.9996754522F, 0.9996831375F, 0.9996906862F,
- 0.9996981000F, 0.9997053804F, 0.9997125290F, 0.9997195474F,
- 0.9997264371F, 0.9997331998F, 0.9997398369F, 0.9997463500F,
- 0.9997527406F, 0.9997590103F, 0.9997651606F, 0.9997711930F,
- 0.9997771089F, 0.9997829098F, 0.9997885973F, 0.9997941728F,
- 0.9997996378F, 0.9998049936F, 0.9998102419F, 0.9998153839F,
- 0.9998204211F, 0.9998253550F, 0.9998301868F, 0.9998349182F,
- 0.9998395503F, 0.9998440847F, 0.9998485226F, 0.9998528654F,
- 0.9998571146F, 0.9998612713F, 0.9998653370F, 0.9998693130F,
- 0.9998732007F, 0.9998770012F, 0.9998807159F, 0.9998843461F,
- 0.9998878931F, 0.9998913581F, 0.9998947424F, 0.9998980473F,
- 0.9999012740F, 0.9999044237F, 0.9999074976F, 0.9999104971F,
- 0.9999134231F, 0.9999162771F, 0.9999190601F, 0.9999217733F,
- 0.9999244179F, 0.9999269950F, 0.9999295058F, 0.9999319515F,
- 0.9999343332F, 0.9999366519F, 0.9999389088F, 0.9999411050F,
- 0.9999432416F, 0.9999453196F, 0.9999473402F, 0.9999493044F,
- 0.9999512132F, 0.9999530677F, 0.9999548690F, 0.9999566180F,
- 0.9999583157F, 0.9999599633F, 0.9999615616F, 0.9999631116F,
- 0.9999646144F, 0.9999660709F, 0.9999674820F, 0.9999688487F,
- 0.9999701719F, 0.9999714526F, 0.9999726917F, 0.9999738900F,
- 0.9999750486F, 0.9999761682F, 0.9999772497F, 0.9999782941F,
- 0.9999793021F, 0.9999802747F, 0.9999812126F, 0.9999821167F,
- 0.9999829878F, 0.9999838268F, 0.9999846343F, 0.9999854113F,
- 0.9999861584F, 0.9999868765F, 0.9999875664F, 0.9999882287F,
- 0.9999888642F, 0.9999894736F, 0.9999900577F, 0.9999906172F,
- 0.9999911528F, 0.9999916651F, 0.9999921548F, 0.9999926227F,
- 0.9999930693F, 0.9999934954F, 0.9999939015F, 0.9999942883F,
- 0.9999946564F, 0.9999950064F, 0.9999953390F, 0.9999956547F,
- 0.9999959541F, 0.9999962377F, 0.9999965062F, 0.9999967601F,
- 0.9999969998F, 0.9999972260F, 0.9999974392F, 0.9999976399F,
- 0.9999978285F, 0.9999980056F, 0.9999981716F, 0.9999983271F,
- 0.9999984724F, 0.9999986081F, 0.9999987345F, 0.9999988521F,
- 0.9999989613F, 0.9999990625F, 0.9999991562F, 0.9999992426F,
- 0.9999993223F, 0.9999993954F, 0.9999994625F, 0.9999995239F,
- 0.9999995798F, 0.9999996307F, 0.9999996768F, 0.9999997184F,
- 0.9999997559F, 0.9999997895F, 0.9999998195F, 0.9999998462F,
- 0.9999998698F, 0.9999998906F, 0.9999999088F, 0.9999999246F,
- 0.9999999383F, 0.9999999500F, 0.9999999600F, 0.9999999684F,
- 0.9999999754F, 0.9999999811F, 0.9999999858F, 0.9999999896F,
- 0.9999999925F, 0.9999999948F, 0.9999999965F, 0.9999999978F,
- 0.9999999986F, 0.9999999992F, 0.9999999996F, 0.9999999998F,
- 0.9999999999F, 1.0000000000F, 1.0000000000F, 1.0000000000F,
-};
-
-static const float vwin8192[4096] = {
- 0.0000000578F, 0.0000005198F, 0.0000014438F, 0.0000028299F,
- 0.0000046780F, 0.0000069882F, 0.0000097604F, 0.0000129945F,
- 0.0000166908F, 0.0000208490F, 0.0000254692F, 0.0000305515F,
- 0.0000360958F, 0.0000421021F, 0.0000485704F, 0.0000555006F,
- 0.0000628929F, 0.0000707472F, 0.0000790635F, 0.0000878417F,
- 0.0000970820F, 0.0001067842F, 0.0001169483F, 0.0001275744F,
- 0.0001386625F, 0.0001502126F, 0.0001622245F, 0.0001746984F,
- 0.0001876343F, 0.0002010320F, 0.0002148917F, 0.0002292132F,
- 0.0002439967F, 0.0002592421F, 0.0002749493F, 0.0002911184F,
- 0.0003077493F, 0.0003248421F, 0.0003423967F, 0.0003604132F,
- 0.0003788915F, 0.0003978316F, 0.0004172335F, 0.0004370971F,
- 0.0004574226F, 0.0004782098F, 0.0004994587F, 0.0005211694F,
- 0.0005433418F, 0.0005659759F, 0.0005890717F, 0.0006126292F,
- 0.0006366484F, 0.0006611292F, 0.0006860716F, 0.0007114757F,
- 0.0007373414F, 0.0007636687F, 0.0007904576F, 0.0008177080F,
- 0.0008454200F, 0.0008735935F, 0.0009022285F, 0.0009313250F,
- 0.0009608830F, 0.0009909025F, 0.0010213834F, 0.0010523257F,
- 0.0010837295F, 0.0011155946F, 0.0011479211F, 0.0011807090F,
- 0.0012139582F, 0.0012476687F, 0.0012818405F, 0.0013164736F,
- 0.0013515679F, 0.0013871235F, 0.0014231402F, 0.0014596182F,
- 0.0014965573F, 0.0015339576F, 0.0015718190F, 0.0016101415F,
- 0.0016489251F, 0.0016881698F, 0.0017278754F, 0.0017680421F,
- 0.0018086698F, 0.0018497584F, 0.0018913080F, 0.0019333185F,
- 0.0019757898F, 0.0020187221F, 0.0020621151F, 0.0021059690F,
- 0.0021502837F, 0.0021950591F, 0.0022402953F, 0.0022859921F,
- 0.0023321497F, 0.0023787679F, 0.0024258467F, 0.0024733861F,
- 0.0025213861F, 0.0025698466F, 0.0026187676F, 0.0026681491F,
- 0.0027179911F, 0.0027682935F, 0.0028190562F, 0.0028702794F,
- 0.0029219628F, 0.0029741066F, 0.0030267107F, 0.0030797749F,
- 0.0031332994F, 0.0031872841F, 0.0032417289F, 0.0032966338F,
- 0.0033519988F, 0.0034078238F, 0.0034641089F, 0.0035208539F,
- 0.0035780589F, 0.0036357237F, 0.0036938485F, 0.0037524331F,
- 0.0038114775F, 0.0038709817F, 0.0039309456F, 0.0039913692F,
- 0.0040522524F, 0.0041135953F, 0.0041753978F, 0.0042376599F,
- 0.0043003814F, 0.0043635624F, 0.0044272029F, 0.0044913028F,
- 0.0045558620F, 0.0046208806F, 0.0046863585F, 0.0047522955F,
- 0.0048186919F, 0.0048855473F, 0.0049528619F, 0.0050206356F,
- 0.0050888684F, 0.0051575601F, 0.0052267108F, 0.0052963204F,
- 0.0053663890F, 0.0054369163F, 0.0055079025F, 0.0055793474F,
- 0.0056512510F, 0.0057236133F, 0.0057964342F, 0.0058697137F,
- 0.0059434517F, 0.0060176482F, 0.0060923032F, 0.0061674166F,
- 0.0062429883F, 0.0063190183F, 0.0063955066F, 0.0064724532F,
- 0.0065498579F, 0.0066277207F, 0.0067060416F, 0.0067848205F,
- 0.0068640575F, 0.0069437523F, 0.0070239051F, 0.0071045157F,
- 0.0071855840F, 0.0072671102F, 0.0073490940F, 0.0074315355F,
- 0.0075144345F, 0.0075977911F, 0.0076816052F, 0.0077658768F,
- 0.0078506057F, 0.0079357920F, 0.0080214355F, 0.0081075363F,
- 0.0081940943F, 0.0082811094F, 0.0083685816F, 0.0084565108F,
- 0.0085448970F, 0.0086337401F, 0.0087230401F, 0.0088127969F,
- 0.0089030104F, 0.0089936807F, 0.0090848076F, 0.0091763911F,
- 0.0092684311F, 0.0093609276F, 0.0094538805F, 0.0095472898F,
- 0.0096411554F, 0.0097354772F, 0.0098302552F, 0.0099254894F,
- 0.0100211796F, 0.0101173259F, 0.0102139281F, 0.0103109863F,
- 0.0104085002F, 0.0105064700F, 0.0106048955F, 0.0107037766F,
- 0.0108031133F, 0.0109029056F, 0.0110031534F, 0.0111038565F,
- 0.0112050151F, 0.0113066289F, 0.0114086980F, 0.0115112222F,
- 0.0116142015F, 0.0117176359F, 0.0118215252F, 0.0119258695F,
- 0.0120306686F, 0.0121359225F, 0.0122416312F, 0.0123477944F,
- 0.0124544123F, 0.0125614847F, 0.0126690116F, 0.0127769928F,
- 0.0128854284F, 0.0129943182F, 0.0131036623F, 0.0132134604F,
- 0.0133237126F, 0.0134344188F, 0.0135455790F, 0.0136571929F,
- 0.0137692607F, 0.0138817821F, 0.0139947572F, 0.0141081859F,
- 0.0142220681F, 0.0143364037F, 0.0144511927F, 0.0145664350F,
- 0.0146821304F, 0.0147982791F, 0.0149148808F, 0.0150319355F,
- 0.0151494431F, 0.0152674036F, 0.0153858168F, 0.0155046828F,
- 0.0156240014F, 0.0157437726F, 0.0158639962F, 0.0159846723F,
- 0.0161058007F, 0.0162273814F, 0.0163494142F, 0.0164718991F,
- 0.0165948361F, 0.0167182250F, 0.0168420658F, 0.0169663584F,
- 0.0170911027F, 0.0172162987F, 0.0173419462F, 0.0174680452F,
- 0.0175945956F, 0.0177215974F, 0.0178490504F, 0.0179769545F,
- 0.0181053098F, 0.0182341160F, 0.0183633732F, 0.0184930812F,
- 0.0186232399F, 0.0187538494F, 0.0188849094F, 0.0190164200F,
- 0.0191483809F, 0.0192807923F, 0.0194136539F, 0.0195469656F,
- 0.0196807275F, 0.0198149394F, 0.0199496012F, 0.0200847128F,
- 0.0202202742F, 0.0203562853F, 0.0204927460F, 0.0206296561F,
- 0.0207670157F, 0.0209048245F, 0.0210430826F, 0.0211817899F,
- 0.0213209462F, 0.0214605515F, 0.0216006057F, 0.0217411086F,
- 0.0218820603F, 0.0220234605F, 0.0221653093F, 0.0223076066F,
- 0.0224503521F, 0.0225935459F, 0.0227371879F, 0.0228812779F,
- 0.0230258160F, 0.0231708018F, 0.0233162355F, 0.0234621169F,
- 0.0236084459F, 0.0237552224F, 0.0239024462F, 0.0240501175F,
- 0.0241982359F, 0.0243468015F, 0.0244958141F, 0.0246452736F,
- 0.0247951800F, 0.0249455331F, 0.0250963329F, 0.0252475792F,
- 0.0253992720F, 0.0255514111F, 0.0257039965F, 0.0258570281F,
- 0.0260105057F, 0.0261644293F, 0.0263187987F, 0.0264736139F,
- 0.0266288747F, 0.0267845811F, 0.0269407330F, 0.0270973302F,
- 0.0272543727F, 0.0274118604F, 0.0275697930F, 0.0277281707F,
- 0.0278869932F, 0.0280462604F, 0.0282059723F, 0.0283661287F,
- 0.0285267295F, 0.0286877747F, 0.0288492641F, 0.0290111976F,
- 0.0291735751F, 0.0293363965F, 0.0294996617F, 0.0296633706F,
- 0.0298275231F, 0.0299921190F, 0.0301571583F, 0.0303226409F,
- 0.0304885667F, 0.0306549354F, 0.0308217472F, 0.0309890017F,
- 0.0311566989F, 0.0313248388F, 0.0314934211F, 0.0316624459F,
- 0.0318319128F, 0.0320018220F, 0.0321721732F, 0.0323429663F,
- 0.0325142013F, 0.0326858779F, 0.0328579962F, 0.0330305559F,
- 0.0332035570F, 0.0333769994F, 0.0335508829F, 0.0337252074F,
- 0.0338999728F, 0.0340751790F, 0.0342508259F, 0.0344269134F,
- 0.0346034412F, 0.0347804094F, 0.0349578178F, 0.0351356663F,
- 0.0353139548F, 0.0354926831F, 0.0356718511F, 0.0358514588F,
- 0.0360315059F, 0.0362119924F, 0.0363929182F, 0.0365742831F,
- 0.0367560870F, 0.0369383297F, 0.0371210113F, 0.0373041315F,
- 0.0374876902F, 0.0376716873F, 0.0378561226F, 0.0380409961F,
- 0.0382263077F, 0.0384120571F, 0.0385982443F, 0.0387848691F,
- 0.0389719315F, 0.0391594313F, 0.0393473683F, 0.0395357425F,
- 0.0397245537F, 0.0399138017F, 0.0401034866F, 0.0402936080F,
- 0.0404841660F, 0.0406751603F, 0.0408665909F, 0.0410584576F,
- 0.0412507603F, 0.0414434988F, 0.0416366731F, 0.0418302829F,
- 0.0420243282F, 0.0422188088F, 0.0424137246F, 0.0426090755F,
- 0.0428048613F, 0.0430010819F, 0.0431977371F, 0.0433948269F,
- 0.0435923511F, 0.0437903095F, 0.0439887020F, 0.0441875285F,
- 0.0443867889F, 0.0445864830F, 0.0447866106F, 0.0449871717F,
- 0.0451881661F, 0.0453895936F, 0.0455914542F, 0.0457937477F,
- 0.0459964738F, 0.0461996326F, 0.0464032239F, 0.0466072475F,
- 0.0468117032F, 0.0470165910F, 0.0472219107F, 0.0474276622F,
- 0.0476338452F, 0.0478404597F, 0.0480475056F, 0.0482549827F,
- 0.0484628907F, 0.0486712297F, 0.0488799994F, 0.0490891998F,
- 0.0492988306F, 0.0495088917F, 0.0497193830F, 0.0499303043F,
- 0.0501416554F, 0.0503534363F, 0.0505656468F, 0.0507782867F,
- 0.0509913559F, 0.0512048542F, 0.0514187815F, 0.0516331376F,
- 0.0518479225F, 0.0520631358F, 0.0522787775F, 0.0524948475F,
- 0.0527113455F, 0.0529282715F, 0.0531456252F, 0.0533634066F,
- 0.0535816154F, 0.0538002515F, 0.0540193148F, 0.0542388051F,
- 0.0544587222F, 0.0546790660F, 0.0548998364F, 0.0551210331F,
- 0.0553426561F, 0.0555647051F, 0.0557871801F, 0.0560100807F,
- 0.0562334070F, 0.0564571587F, 0.0566813357F, 0.0569059378F,
- 0.0571309649F, 0.0573564168F, 0.0575822933F, 0.0578085942F,
- 0.0580353195F, 0.0582624689F, 0.0584900423F, 0.0587180396F,
- 0.0589464605F, 0.0591753049F, 0.0594045726F, 0.0596342635F,
- 0.0598643774F, 0.0600949141F, 0.0603258735F, 0.0605572555F,
- 0.0607890597F, 0.0610212862F, 0.0612539346F, 0.0614870049F,
- 0.0617204968F, 0.0619544103F, 0.0621887451F, 0.0624235010F,
- 0.0626586780F, 0.0628942758F, 0.0631302942F, 0.0633667331F,
- 0.0636035923F, 0.0638408717F, 0.0640785710F, 0.0643166901F,
- 0.0645552288F, 0.0647941870F, 0.0650335645F, 0.0652733610F,
- 0.0655135765F, 0.0657542108F, 0.0659952636F, 0.0662367348F,
- 0.0664786242F, 0.0667209316F, 0.0669636570F, 0.0672068000F,
- 0.0674503605F, 0.0676943384F, 0.0679387334F, 0.0681835454F,
- 0.0684287742F, 0.0686744196F, 0.0689204814F, 0.0691669595F,
- 0.0694138536F, 0.0696611637F, 0.0699088894F, 0.0701570307F,
- 0.0704055873F, 0.0706545590F, 0.0709039458F, 0.0711537473F,
- 0.0714039634F, 0.0716545939F, 0.0719056387F, 0.0721570975F,
- 0.0724089702F, 0.0726612565F, 0.0729139563F, 0.0731670694F,
- 0.0734205956F, 0.0736745347F, 0.0739288866F, 0.0741836510F,
- 0.0744388277F, 0.0746944166F, 0.0749504175F, 0.0752068301F,
- 0.0754636543F, 0.0757208899F, 0.0759785367F, 0.0762365946F,
- 0.0764950632F, 0.0767539424F, 0.0770132320F, 0.0772729319F,
- 0.0775330418F, 0.0777935616F, 0.0780544909F, 0.0783158298F,
- 0.0785775778F, 0.0788397349F, 0.0791023009F, 0.0793652755F,
- 0.0796286585F, 0.0798924498F, 0.0801566492F, 0.0804212564F,
- 0.0806862712F, 0.0809516935F, 0.0812175231F, 0.0814837597F,
- 0.0817504031F, 0.0820174532F, 0.0822849097F, 0.0825527724F,
- 0.0828210412F, 0.0830897158F, 0.0833587960F, 0.0836282816F,
- 0.0838981724F, 0.0841684682F, 0.0844391688F, 0.0847102740F,
- 0.0849817835F, 0.0852536973F, 0.0855260150F, 0.0857987364F,
- 0.0860718614F, 0.0863453897F, 0.0866193211F, 0.0868936554F,
- 0.0871683924F, 0.0874435319F, 0.0877190737F, 0.0879950175F,
- 0.0882713632F, 0.0885481105F, 0.0888252592F, 0.0891028091F,
- 0.0893807600F, 0.0896591117F, 0.0899378639F, 0.0902170165F,
- 0.0904965692F, 0.0907765218F, 0.0910568740F, 0.0913376258F,
- 0.0916187767F, 0.0919003268F, 0.0921822756F, 0.0924646230F,
- 0.0927473687F, 0.0930305126F, 0.0933140545F, 0.0935979940F,
- 0.0938823310F, 0.0941670653F, 0.0944521966F, 0.0947377247F,
- 0.0950236494F, 0.0953099704F, 0.0955966876F, 0.0958838007F,
- 0.0961713094F, 0.0964592136F, 0.0967475131F, 0.0970362075F,
- 0.0973252967F, 0.0976147805F, 0.0979046585F, 0.0981949307F,
- 0.0984855967F, 0.0987766563F, 0.0990681093F, 0.0993599555F,
- 0.0996521945F, 0.0999448263F, 0.1002378506F, 0.1005312671F,
- 0.1008250755F, 0.1011192757F, 0.1014138675F, 0.1017088505F,
- 0.1020042246F, 0.1022999895F, 0.1025961450F, 0.1028926909F,
- 0.1031896268F, 0.1034869526F, 0.1037846680F, 0.1040827729F,
- 0.1043812668F, 0.1046801497F, 0.1049794213F, 0.1052790813F,
- 0.1055791294F, 0.1058795656F, 0.1061803894F, 0.1064816006F,
- 0.1067831991F, 0.1070851846F, 0.1073875568F, 0.1076903155F,
- 0.1079934604F, 0.1082969913F, 0.1086009079F, 0.1089052101F,
- 0.1092098975F, 0.1095149699F, 0.1098204270F, 0.1101262687F,
- 0.1104324946F, 0.1107391045F, 0.1110460982F, 0.1113534754F,
- 0.1116612359F, 0.1119693793F, 0.1122779055F, 0.1125868142F,
- 0.1128961052F, 0.1132057781F, 0.1135158328F, 0.1138262690F,
- 0.1141370863F, 0.1144482847F, 0.1147598638F, 0.1150718233F,
- 0.1153841631F, 0.1156968828F, 0.1160099822F, 0.1163234610F,
- 0.1166373190F, 0.1169515559F, 0.1172661714F, 0.1175811654F,
- 0.1178965374F, 0.1182122874F, 0.1185284149F, 0.1188449198F,
- 0.1191618018F, 0.1194790606F, 0.1197966960F, 0.1201147076F,
- 0.1204330953F, 0.1207518587F, 0.1210709976F, 0.1213905118F,
- 0.1217104009F, 0.1220306647F, 0.1223513029F, 0.1226723153F,
- 0.1229937016F, 0.1233154615F, 0.1236375948F, 0.1239601011F,
- 0.1242829803F, 0.1246062319F, 0.1249298559F, 0.1252538518F,
- 0.1255782195F, 0.1259029586F, 0.1262280689F, 0.1265535501F,
- 0.1268794019F, 0.1272056241F, 0.1275322163F, 0.1278591784F,
- 0.1281865099F, 0.1285142108F, 0.1288422805F, 0.1291707190F,
- 0.1294995259F, 0.1298287009F, 0.1301582437F, 0.1304881542F,
- 0.1308184319F, 0.1311490766F, 0.1314800881F, 0.1318114660F,
- 0.1321432100F, 0.1324753200F, 0.1328077955F, 0.1331406364F,
- 0.1334738422F, 0.1338074129F, 0.1341413479F, 0.1344756472F,
- 0.1348103103F, 0.1351453370F, 0.1354807270F, 0.1358164801F,
- 0.1361525959F, 0.1364890741F, 0.1368259145F, 0.1371631167F,
- 0.1375006805F, 0.1378386056F, 0.1381768917F, 0.1385155384F,
- 0.1388545456F, 0.1391939129F, 0.1395336400F, 0.1398737266F,
- 0.1402141724F, 0.1405549772F, 0.1408961406F, 0.1412376623F,
- 0.1415795421F, 0.1419217797F, 0.1422643746F, 0.1426073268F,
- 0.1429506358F, 0.1432943013F, 0.1436383231F, 0.1439827008F,
- 0.1443274342F, 0.1446725229F, 0.1450179667F, 0.1453637652F,
- 0.1457099181F, 0.1460564252F, 0.1464032861F, 0.1467505006F,
- 0.1470980682F, 0.1474459888F, 0.1477942620F, 0.1481428875F,
- 0.1484918651F, 0.1488411942F, 0.1491908748F, 0.1495409065F,
- 0.1498912889F, 0.1502420218F, 0.1505931048F, 0.1509445376F,
- 0.1512963200F, 0.1516484516F, 0.1520009321F, 0.1523537612F,
- 0.1527069385F, 0.1530604638F, 0.1534143368F, 0.1537685571F,
- 0.1541231244F, 0.1544780384F, 0.1548332987F, 0.1551889052F,
- 0.1555448574F, 0.1559011550F, 0.1562577978F, 0.1566147853F,
- 0.1569721173F, 0.1573297935F, 0.1576878135F, 0.1580461771F,
- 0.1584048838F, 0.1587639334F, 0.1591233255F, 0.1594830599F,
- 0.1598431361F, 0.1602035540F, 0.1605643131F, 0.1609254131F,
- 0.1612868537F, 0.1616486346F, 0.1620107555F, 0.1623732160F,
- 0.1627360158F, 0.1630991545F, 0.1634626319F, 0.1638264476F,
- 0.1641906013F, 0.1645550926F, 0.1649199212F, 0.1652850869F,
- 0.1656505892F, 0.1660164278F, 0.1663826024F, 0.1667491127F,
- 0.1671159583F, 0.1674831388F, 0.1678506541F, 0.1682185036F,
- 0.1685866872F, 0.1689552044F, 0.1693240549F, 0.1696932384F,
- 0.1700627545F, 0.1704326029F, 0.1708027833F, 0.1711732952F,
- 0.1715441385F, 0.1719153127F, 0.1722868175F, 0.1726586526F,
- 0.1730308176F, 0.1734033121F, 0.1737761359F, 0.1741492886F,
- 0.1745227698F, 0.1748965792F, 0.1752707164F, 0.1756451812F,
- 0.1760199731F, 0.1763950918F, 0.1767705370F, 0.1771463083F,
- 0.1775224054F, 0.1778988279F, 0.1782755754F, 0.1786526477F,
- 0.1790300444F, 0.1794077651F, 0.1797858094F, 0.1801641771F,
- 0.1805428677F, 0.1809218810F, 0.1813012165F, 0.1816808739F,
- 0.1820608528F, 0.1824411530F, 0.1828217739F, 0.1832027154F,
- 0.1835839770F, 0.1839655584F, 0.1843474592F, 0.1847296790F,
- 0.1851122175F, 0.1854950744F, 0.1858782492F, 0.1862617417F,
- 0.1866455514F, 0.1870296780F, 0.1874141211F, 0.1877988804F,
- 0.1881839555F, 0.1885693461F, 0.1889550517F, 0.1893410721F,
- 0.1897274068F, 0.1901140555F, 0.1905010178F, 0.1908882933F,
- 0.1912758818F, 0.1916637828F, 0.1920519959F, 0.1924405208F,
- 0.1928293571F, 0.1932185044F, 0.1936079625F, 0.1939977308F,
- 0.1943878091F, 0.1947781969F, 0.1951688939F, 0.1955598998F,
- 0.1959512141F, 0.1963428364F, 0.1967347665F, 0.1971270038F,
- 0.1975195482F, 0.1979123990F, 0.1983055561F, 0.1986990190F,
- 0.1990927873F, 0.1994868607F, 0.1998812388F, 0.2002759212F,
- 0.2006709075F, 0.2010661974F, 0.2014617904F, 0.2018576862F,
- 0.2022538844F, 0.2026503847F, 0.2030471865F, 0.2034442897F,
- 0.2038416937F, 0.2042393982F, 0.2046374028F, 0.2050357071F,
- 0.2054343107F, 0.2058332133F, 0.2062324145F, 0.2066319138F,
- 0.2070317110F, 0.2074318055F, 0.2078321970F, 0.2082328852F,
- 0.2086338696F, 0.2090351498F, 0.2094367255F, 0.2098385962F,
- 0.2102407617F, 0.2106432213F, 0.2110459749F, 0.2114490220F,
- 0.2118523621F, 0.2122559950F, 0.2126599202F, 0.2130641373F,
- 0.2134686459F, 0.2138734456F, 0.2142785361F, 0.2146839168F,
- 0.2150895875F, 0.2154955478F, 0.2159017972F, 0.2163083353F,
- 0.2167151617F, 0.2171222761F, 0.2175296780F, 0.2179373670F,
- 0.2183453428F, 0.2187536049F, 0.2191621529F, 0.2195709864F,
- 0.2199801051F, 0.2203895085F, 0.2207991961F, 0.2212091677F,
- 0.2216194228F, 0.2220299610F, 0.2224407818F, 0.2228518850F,
- 0.2232632699F, 0.2236749364F, 0.2240868839F, 0.2244991121F,
- 0.2249116204F, 0.2253244086F, 0.2257374763F, 0.2261508229F,
- 0.2265644481F, 0.2269783514F, 0.2273925326F, 0.2278069911F,
- 0.2282217265F, 0.2286367384F, 0.2290520265F, 0.2294675902F,
- 0.2298834292F, 0.2302995431F, 0.2307159314F, 0.2311325937F,
- 0.2315495297F, 0.2319667388F, 0.2323842207F, 0.2328019749F,
- 0.2332200011F, 0.2336382988F, 0.2340568675F, 0.2344757070F,
- 0.2348948166F, 0.2353141961F, 0.2357338450F, 0.2361537629F,
- 0.2365739493F, 0.2369944038F, 0.2374151261F, 0.2378361156F,
- 0.2382573720F, 0.2386788948F, 0.2391006836F, 0.2395227380F,
- 0.2399450575F, 0.2403676417F, 0.2407904902F, 0.2412136026F,
- 0.2416369783F, 0.2420606171F, 0.2424845185F, 0.2429086820F,
- 0.2433331072F, 0.2437577936F, 0.2441827409F, 0.2446079486F,
- 0.2450334163F, 0.2454591435F, 0.2458851298F, 0.2463113747F,
- 0.2467378779F, 0.2471646389F, 0.2475916573F, 0.2480189325F,
- 0.2484464643F, 0.2488742521F, 0.2493022955F, 0.2497305940F,
- 0.2501591473F, 0.2505879549F, 0.2510170163F, 0.2514463311F,
- 0.2518758989F, 0.2523057193F, 0.2527357916F, 0.2531661157F,
- 0.2535966909F, 0.2540275169F, 0.2544585931F, 0.2548899193F,
- 0.2553214948F, 0.2557533193F, 0.2561853924F, 0.2566177135F,
- 0.2570502822F, 0.2574830981F, 0.2579161608F, 0.2583494697F,
- 0.2587830245F, 0.2592168246F, 0.2596508697F, 0.2600851593F,
- 0.2605196929F, 0.2609544701F, 0.2613894904F, 0.2618247534F,
- 0.2622602586F, 0.2626960055F, 0.2631319938F, 0.2635682230F,
- 0.2640046925F, 0.2644414021F, 0.2648783511F, 0.2653155391F,
- 0.2657529657F, 0.2661906305F, 0.2666285329F, 0.2670666725F,
- 0.2675050489F, 0.2679436616F, 0.2683825101F, 0.2688215940F,
- 0.2692609127F, 0.2697004660F, 0.2701402532F, 0.2705802739F,
- 0.2710205278F, 0.2714610142F, 0.2719017327F, 0.2723426830F,
- 0.2727838644F, 0.2732252766F, 0.2736669191F, 0.2741087914F,
- 0.2745508930F, 0.2749932235F, 0.2754357824F, 0.2758785693F,
- 0.2763215837F, 0.2767648251F, 0.2772082930F, 0.2776519870F,
- 0.2780959066F, 0.2785400513F, 0.2789844207F, 0.2794290143F,
- 0.2798738316F, 0.2803188722F, 0.2807641355F, 0.2812096211F,
- 0.2816553286F, 0.2821012574F, 0.2825474071F, 0.2829937773F,
- 0.2834403673F, 0.2838871768F, 0.2843342053F, 0.2847814523F,
- 0.2852289174F, 0.2856765999F, 0.2861244996F, 0.2865726159F,
- 0.2870209482F, 0.2874694962F, 0.2879182594F, 0.2883672372F,
- 0.2888164293F, 0.2892658350F, 0.2897154540F, 0.2901652858F,
- 0.2906153298F, 0.2910655856F, 0.2915160527F, 0.2919667306F,
- 0.2924176189F, 0.2928687171F, 0.2933200246F, 0.2937715409F,
- 0.2942232657F, 0.2946751984F, 0.2951273386F, 0.2955796856F,
- 0.2960322391F, 0.2964849986F, 0.2969379636F, 0.2973911335F,
- 0.2978445080F, 0.2982980864F, 0.2987518684F, 0.2992058534F,
- 0.2996600409F, 0.3001144305F, 0.3005690217F, 0.3010238139F,
- 0.3014788067F, 0.3019339995F, 0.3023893920F, 0.3028449835F,
- 0.3033007736F, 0.3037567618F, 0.3042129477F, 0.3046693306F,
- 0.3051259102F, 0.3055826859F, 0.3060396572F, 0.3064968236F,
- 0.3069541847F, 0.3074117399F, 0.3078694887F, 0.3083274307F,
- 0.3087855653F, 0.3092438920F, 0.3097024104F, 0.3101611199F,
- 0.3106200200F, 0.3110791103F, 0.3115383902F, 0.3119978592F,
- 0.3124575169F, 0.3129173627F, 0.3133773961F, 0.3138376166F,
- 0.3142980238F, 0.3147586170F, 0.3152193959F, 0.3156803598F,
- 0.3161415084F, 0.3166028410F, 0.3170643573F, 0.3175260566F,
- 0.3179879384F, 0.3184500023F, 0.3189122478F, 0.3193746743F,
- 0.3198372814F, 0.3203000685F, 0.3207630351F, 0.3212261807F,
- 0.3216895048F, 0.3221530069F, 0.3226166865F, 0.3230805430F,
- 0.3235445760F, 0.3240087849F, 0.3244731693F, 0.3249377285F,
- 0.3254024622F, 0.3258673698F, 0.3263324507F, 0.3267977045F,
- 0.3272631306F, 0.3277287286F, 0.3281944978F, 0.3286604379F,
- 0.3291265482F, 0.3295928284F, 0.3300592777F, 0.3305258958F,
- 0.3309926821F, 0.3314596361F, 0.3319267573F, 0.3323940451F,
- 0.3328614990F, 0.3333291186F, 0.3337969033F, 0.3342648525F,
- 0.3347329658F, 0.3352012427F, 0.3356696825F, 0.3361382849F,
- 0.3366070492F, 0.3370759749F, 0.3375450616F, 0.3380143087F,
- 0.3384837156F, 0.3389532819F, 0.3394230071F, 0.3398928905F,
- 0.3403629317F, 0.3408331302F, 0.3413034854F, 0.3417739967F,
- 0.3422446638F, 0.3427154860F, 0.3431864628F, 0.3436575938F,
- 0.3441288782F, 0.3446003158F, 0.3450719058F, 0.3455436478F,
- 0.3460155412F, 0.3464875856F, 0.3469597804F, 0.3474321250F,
- 0.3479046189F, 0.3483772617F, 0.3488500527F, 0.3493229914F,
- 0.3497960774F, 0.3502693100F, 0.3507426887F, 0.3512162131F,
- 0.3516898825F, 0.3521636965F, 0.3526376545F, 0.3531117559F,
- 0.3535860003F, 0.3540603870F, 0.3545349157F, 0.3550095856F,
- 0.3554843964F, 0.3559593474F, 0.3564344381F, 0.3569096680F,
- 0.3573850366F, 0.3578605432F, 0.3583361875F, 0.3588119687F,
- 0.3592878865F, 0.3597639402F, 0.3602401293F, 0.3607164533F,
- 0.3611929117F, 0.3616695038F, 0.3621462292F, 0.3626230873F,
- 0.3631000776F, 0.3635771995F, 0.3640544525F, 0.3645318360F,
- 0.3650093496F, 0.3654869926F, 0.3659647645F, 0.3664426648F,
- 0.3669206930F, 0.3673988484F, 0.3678771306F, 0.3683555390F,
- 0.3688340731F, 0.3693127322F, 0.3697915160F, 0.3702704237F,
- 0.3707494549F, 0.3712286091F, 0.3717078857F, 0.3721872840F,
- 0.3726668037F, 0.3731464441F, 0.3736262047F, 0.3741060850F,
- 0.3745860843F, 0.3750662023F, 0.3755464382F, 0.3760267915F,
- 0.3765072618F, 0.3769878484F, 0.3774685509F, 0.3779493686F,
- 0.3784303010F, 0.3789113475F, 0.3793925076F, 0.3798737809F,
- 0.3803551666F, 0.3808366642F, 0.3813182733F, 0.3817999932F,
- 0.3822818234F, 0.3827637633F, 0.3832458124F, 0.3837279702F,
- 0.3842102360F, 0.3846926093F, 0.3851750897F, 0.3856576764F,
- 0.3861403690F, 0.3866231670F, 0.3871060696F, 0.3875890765F,
- 0.3880721870F, 0.3885554007F, 0.3890387168F, 0.3895221349F,
- 0.3900056544F, 0.3904892748F, 0.3909729955F, 0.3914568160F,
- 0.3919407356F, 0.3924247539F, 0.3929088702F, 0.3933930841F,
- 0.3938773949F, 0.3943618021F, 0.3948463052F, 0.3953309035F,
- 0.3958155966F, 0.3963003838F, 0.3967852646F, 0.3972702385F,
- 0.3977553048F, 0.3982404631F, 0.3987257127F, 0.3992110531F,
- 0.3996964838F, 0.4001820041F, 0.4006676136F, 0.4011533116F,
- 0.4016390976F, 0.4021249710F, 0.4026109313F, 0.4030969779F,
- 0.4035831102F, 0.4040693277F, 0.4045556299F, 0.4050420160F,
- 0.4055284857F, 0.4060150383F, 0.4065016732F, 0.4069883899F,
- 0.4074751879F, 0.4079620665F, 0.4084490252F, 0.4089360635F,
- 0.4094231807F, 0.4099103763F, 0.4103976498F, 0.4108850005F,
- 0.4113724280F, 0.4118599315F, 0.4123475107F, 0.4128351648F,
- 0.4133228934F, 0.4138106959F, 0.4142985716F, 0.4147865201F,
- 0.4152745408F, 0.4157626330F, 0.4162507963F, 0.4167390301F,
- 0.4172273337F, 0.4177157067F, 0.4182041484F, 0.4186926583F,
- 0.4191812359F, 0.4196698805F, 0.4201585915F, 0.4206473685F,
- 0.4211362108F, 0.4216251179F, 0.4221140892F, 0.4226031241F,
- 0.4230922221F, 0.4235813826F, 0.4240706050F, 0.4245598887F,
- 0.4250492332F, 0.4255386379F, 0.4260281022F, 0.4265176256F,
- 0.4270072075F, 0.4274968473F, 0.4279865445F, 0.4284762984F,
- 0.4289661086F, 0.4294559743F, 0.4299458951F, 0.4304358704F,
- 0.4309258996F, 0.4314159822F, 0.4319061175F, 0.4323963050F,
- 0.4328865441F, 0.4333768342F, 0.4338671749F, 0.4343575654F,
- 0.4348480052F, 0.4353384938F, 0.4358290306F, 0.4363196149F,
- 0.4368102463F, 0.4373009241F, 0.4377916478F, 0.4382824168F,
- 0.4387732305F, 0.4392640884F, 0.4397549899F, 0.4402459343F,
- 0.4407369212F, 0.4412279499F, 0.4417190198F, 0.4422101305F,
- 0.4427012813F, 0.4431924717F, 0.4436837010F, 0.4441749686F,
- 0.4446662742F, 0.4451576169F, 0.4456489963F, 0.4461404118F,
- 0.4466318628F, 0.4471233487F, 0.4476148690F, 0.4481064230F,
- 0.4485980103F, 0.4490896302F, 0.4495812821F, 0.4500729654F,
- 0.4505646797F, 0.4510564243F, 0.4515481986F, 0.4520400021F,
- 0.4525318341F, 0.4530236942F, 0.4535155816F, 0.4540074959F,
- 0.4544994365F, 0.4549914028F, 0.4554833941F, 0.4559754100F,
- 0.4564674499F, 0.4569595131F, 0.4574515991F, 0.4579437074F,
- 0.4584358372F, 0.4589279881F, 0.4594201595F, 0.4599123508F,
- 0.4604045615F, 0.4608967908F, 0.4613890383F, 0.4618813034F,
- 0.4623735855F, 0.4628658841F, 0.4633581984F, 0.4638505281F,
- 0.4643428724F, 0.4648352308F, 0.4653276028F, 0.4658199877F,
- 0.4663123849F, 0.4668047940F, 0.4672972143F, 0.4677896451F,
- 0.4682820861F, 0.4687745365F, 0.4692669958F, 0.4697594634F,
- 0.4702519387F, 0.4707444211F, 0.4712369102F, 0.4717294052F,
- 0.4722219056F, 0.4727144109F, 0.4732069204F, 0.4736994336F,
- 0.4741919498F, 0.4746844686F, 0.4751769893F, 0.4756695113F,
- 0.4761620341F, 0.4766545571F, 0.4771470797F, 0.4776396013F,
- 0.4781321213F, 0.4786246392F, 0.4791171544F, 0.4796096663F,
- 0.4801021744F, 0.4805946779F, 0.4810871765F, 0.4815796694F,
- 0.4820721561F, 0.4825646360F, 0.4830571086F, 0.4835495732F,
- 0.4840420293F, 0.4845344763F, 0.4850269136F, 0.4855193407F,
- 0.4860117569F, 0.4865041617F, 0.4869965545F, 0.4874889347F,
- 0.4879813018F, 0.4884736551F, 0.4889659941F, 0.4894583182F,
- 0.4899506268F, 0.4904429193F, 0.4909351952F, 0.4914274538F,
- 0.4919196947F, 0.4924119172F, 0.4929041207F, 0.4933963046F,
- 0.4938884685F, 0.4943806116F, 0.4948727335F, 0.4953648335F,
- 0.4958569110F, 0.4963489656F, 0.4968409965F, 0.4973330032F,
- 0.4978249852F, 0.4983169419F, 0.4988088726F, 0.4993007768F,
- 0.4997926539F, 0.5002845034F, 0.5007763247F, 0.5012681171F,
- 0.5017598801F, 0.5022516132F, 0.5027433157F, 0.5032349871F,
- 0.5037266268F, 0.5042182341F, 0.5047098086F, 0.5052013497F,
- 0.5056928567F, 0.5061843292F, 0.5066757664F, 0.5071671679F,
- 0.5076585330F, 0.5081498613F, 0.5086411520F, 0.5091324047F,
- 0.5096236187F, 0.5101147934F, 0.5106059284F, 0.5110970230F,
- 0.5115880766F, 0.5120790887F, 0.5125700587F, 0.5130609860F,
- 0.5135518700F, 0.5140427102F, 0.5145335059F, 0.5150242566F,
- 0.5155149618F, 0.5160056208F, 0.5164962331F, 0.5169867980F,
- 0.5174773151F, 0.5179677837F, 0.5184582033F, 0.5189485733F,
- 0.5194388931F, 0.5199291621F, 0.5204193798F, 0.5209095455F,
- 0.5213996588F, 0.5218897190F, 0.5223797256F, 0.5228696779F,
- 0.5233595755F, 0.5238494177F, 0.5243392039F, 0.5248289337F,
- 0.5253186063F, 0.5258082213F, 0.5262977781F, 0.5267872760F,
- 0.5272767146F, 0.5277660932F, 0.5282554112F, 0.5287446682F,
- 0.5292338635F, 0.5297229965F, 0.5302120667F, 0.5307010736F,
- 0.5311900164F, 0.5316788947F, 0.5321677079F, 0.5326564554F,
- 0.5331451366F, 0.5336337511F, 0.5341222981F, 0.5346107771F,
- 0.5350991876F, 0.5355875290F, 0.5360758007F, 0.5365640021F,
- 0.5370521327F, 0.5375401920F, 0.5380281792F, 0.5385160939F,
- 0.5390039355F, 0.5394917034F, 0.5399793971F, 0.5404670159F,
- 0.5409545594F, 0.5414420269F, 0.5419294179F, 0.5424167318F,
- 0.5429039680F, 0.5433911261F, 0.5438782053F, 0.5443652051F,
- 0.5448521250F, 0.5453389644F, 0.5458257228F, 0.5463123995F,
- 0.5467989940F, 0.5472855057F, 0.5477719341F, 0.5482582786F,
- 0.5487445387F, 0.5492307137F, 0.5497168031F, 0.5502028063F,
- 0.5506887228F, 0.5511745520F, 0.5516602934F, 0.5521459463F,
- 0.5526315103F, 0.5531169847F, 0.5536023690F, 0.5540876626F,
- 0.5545728649F, 0.5550579755F, 0.5555429937F, 0.5560279189F,
- 0.5565127507F, 0.5569974884F, 0.5574821315F, 0.5579666794F,
- 0.5584511316F, 0.5589354875F, 0.5594197465F, 0.5599039080F,
- 0.5603879716F, 0.5608719367F, 0.5613558026F, 0.5618395689F,
- 0.5623232350F, 0.5628068002F, 0.5632902642F, 0.5637736262F,
- 0.5642568858F, 0.5647400423F, 0.5652230953F, 0.5657060442F,
- 0.5661888883F, 0.5666716272F, 0.5671542603F, 0.5676367870F,
- 0.5681192069F, 0.5686015192F, 0.5690837235F, 0.5695658192F,
- 0.5700478058F, 0.5705296827F, 0.5710114494F, 0.5714931052F,
- 0.5719746497F, 0.5724560822F, 0.5729374023F, 0.5734186094F,
- 0.5738997029F, 0.5743806823F, 0.5748615470F, 0.5753422965F,
- 0.5758229301F, 0.5763034475F, 0.5767838480F, 0.5772641310F,
- 0.5777442960F, 0.5782243426F, 0.5787042700F, 0.5791840778F,
- 0.5796637654F, 0.5801433322F, 0.5806227778F, 0.5811021016F,
- 0.5815813029F, 0.5820603814F, 0.5825393363F, 0.5830181673F,
- 0.5834968737F, 0.5839754549F, 0.5844539105F, 0.5849322399F,
- 0.5854104425F, 0.5858885179F, 0.5863664653F, 0.5868442844F,
- 0.5873219746F, 0.5877995353F, 0.5882769660F, 0.5887542661F,
- 0.5892314351F, 0.5897084724F, 0.5901853776F, 0.5906621500F,
- 0.5911387892F, 0.5916152945F, 0.5920916655F, 0.5925679016F,
- 0.5930440022F, 0.5935199669F, 0.5939957950F, 0.5944714861F,
- 0.5949470396F, 0.5954224550F, 0.5958977317F, 0.5963728692F,
- 0.5968478669F, 0.5973227244F, 0.5977974411F, 0.5982720163F,
- 0.5987464497F, 0.5992207407F, 0.5996948887F, 0.6001688932F,
- 0.6006427537F, 0.6011164696F, 0.6015900405F, 0.6020634657F,
- 0.6025367447F, 0.6030098770F, 0.6034828621F, 0.6039556995F,
- 0.6044283885F, 0.6049009288F, 0.6053733196F, 0.6058455606F,
- 0.6063176512F, 0.6067895909F, 0.6072613790F, 0.6077330152F,
- 0.6082044989F, 0.6086758295F, 0.6091470065F, 0.6096180294F,
- 0.6100888977F, 0.6105596108F, 0.6110301682F, 0.6115005694F,
- 0.6119708139F, 0.6124409011F, 0.6129108305F, 0.6133806017F,
- 0.6138502139F, 0.6143196669F, 0.6147889599F, 0.6152580926F,
- 0.6157270643F, 0.6161958746F, 0.6166645230F, 0.6171330088F,
- 0.6176013317F, 0.6180694910F, 0.6185374863F, 0.6190053171F,
- 0.6194729827F, 0.6199404828F, 0.6204078167F, 0.6208749841F,
- 0.6213419842F, 0.6218088168F, 0.6222754811F, 0.6227419768F,
- 0.6232083032F, 0.6236744600F, 0.6241404465F, 0.6246062622F,
- 0.6250719067F, 0.6255373795F, 0.6260026799F, 0.6264678076F,
- 0.6269327619F, 0.6273975425F, 0.6278621487F, 0.6283265800F,
- 0.6287908361F, 0.6292549163F, 0.6297188201F, 0.6301825471F,
- 0.6306460966F, 0.6311094683F, 0.6315726617F, 0.6320356761F,
- 0.6324985111F, 0.6329611662F, 0.6334236410F, 0.6338859348F,
- 0.6343480472F, 0.6348099777F, 0.6352717257F, 0.6357332909F,
- 0.6361946726F, 0.6366558704F, 0.6371168837F, 0.6375777122F,
- 0.6380383552F, 0.6384988123F, 0.6389590830F, 0.6394191668F,
- 0.6398790631F, 0.6403387716F, 0.6407982916F, 0.6412576228F,
- 0.6417167645F, 0.6421757163F, 0.6426344778F, 0.6430930483F,
- 0.6435514275F, 0.6440096149F, 0.6444676098F, 0.6449254119F,
- 0.6453830207F, 0.6458404356F, 0.6462976562F, 0.6467546820F,
- 0.6472115125F, 0.6476681472F, 0.6481245856F, 0.6485808273F,
- 0.6490368717F, 0.6494927183F, 0.6499483667F, 0.6504038164F,
- 0.6508590670F, 0.6513141178F, 0.6517689684F, 0.6522236185F,
- 0.6526780673F, 0.6531323146F, 0.6535863598F, 0.6540402024F,
- 0.6544938419F, 0.6549472779F, 0.6554005099F, 0.6558535373F,
- 0.6563063598F, 0.6567589769F, 0.6572113880F, 0.6576635927F,
- 0.6581155906F, 0.6585673810F, 0.6590189637F, 0.6594703380F,
- 0.6599215035F, 0.6603724598F, 0.6608232064F, 0.6612737427F,
- 0.6617240684F, 0.6621741829F, 0.6626240859F, 0.6630737767F,
- 0.6635232550F, 0.6639725202F, 0.6644215720F, 0.6648704098F,
- 0.6653190332F, 0.6657674417F, 0.6662156348F, 0.6666636121F,
- 0.6671113731F, 0.6675589174F, 0.6680062445F, 0.6684533538F,
- 0.6689002450F, 0.6693469177F, 0.6697933712F, 0.6702396052F,
- 0.6706856193F, 0.6711314129F, 0.6715769855F, 0.6720223369F,
- 0.6724674664F, 0.6729123736F, 0.6733570581F, 0.6738015194F,
- 0.6742457570F, 0.6746897706F, 0.6751335596F, 0.6755771236F,
- 0.6760204621F, 0.6764635747F, 0.6769064609F, 0.6773491204F,
- 0.6777915525F, 0.6782337570F, 0.6786757332F, 0.6791174809F,
- 0.6795589995F, 0.6800002886F, 0.6804413477F, 0.6808821765F,
- 0.6813227743F, 0.6817631409F, 0.6822032758F, 0.6826431785F,
- 0.6830828485F, 0.6835222855F, 0.6839614890F, 0.6844004585F,
- 0.6848391936F, 0.6852776939F, 0.6857159589F, 0.6861539883F,
- 0.6865917815F, 0.6870293381F, 0.6874666576F, 0.6879037398F,
- 0.6883405840F, 0.6887771899F, 0.6892135571F, 0.6896496850F,
- 0.6900855733F, 0.6905212216F, 0.6909566294F, 0.6913917963F,
- 0.6918267218F, 0.6922614055F, 0.6926958471F, 0.6931300459F,
- 0.6935640018F, 0.6939977141F, 0.6944311825F, 0.6948644066F,
- 0.6952973859F, 0.6957301200F, 0.6961626085F, 0.6965948510F,
- 0.6970268470F, 0.6974585961F, 0.6978900980F, 0.6983213521F,
- 0.6987523580F, 0.6991831154F, 0.6996136238F, 0.7000438828F,
- 0.7004738921F, 0.7009036510F, 0.7013331594F, 0.7017624166F,
- 0.7021914224F, 0.7026201763F, 0.7030486779F, 0.7034769268F,
- 0.7039049226F, 0.7043326648F, 0.7047601531F, 0.7051873870F,
- 0.7056143662F, 0.7060410902F, 0.7064675586F, 0.7068937711F,
- 0.7073197271F, 0.7077454264F, 0.7081708684F, 0.7085960529F,
- 0.7090209793F, 0.7094456474F, 0.7098700566F, 0.7102942066F,
- 0.7107180970F, 0.7111417274F, 0.7115650974F, 0.7119882066F,
- 0.7124110545F, 0.7128336409F, 0.7132559653F, 0.7136780272F,
- 0.7140998264F, 0.7145213624F, 0.7149426348F, 0.7153636433F,
- 0.7157843874F, 0.7162048668F, 0.7166250810F, 0.7170450296F,
- 0.7174647124F, 0.7178841289F, 0.7183032786F, 0.7187221613F,
- 0.7191407765F, 0.7195591239F, 0.7199772030F, 0.7203950135F,
- 0.7208125550F, 0.7212298271F, 0.7216468294F, 0.7220635616F,
- 0.7224800233F, 0.7228962140F, 0.7233121335F, 0.7237277813F,
- 0.7241431571F, 0.7245582604F, 0.7249730910F, 0.7253876484F,
- 0.7258019322F, 0.7262159422F, 0.7266296778F, 0.7270431388F,
- 0.7274563247F, 0.7278692353F, 0.7282818700F, 0.7286942287F,
- 0.7291063108F, 0.7295181160F, 0.7299296440F, 0.7303408944F,
- 0.7307518669F, 0.7311625609F, 0.7315729763F, 0.7319831126F,
- 0.7323929695F, 0.7328025466F, 0.7332118435F, 0.7336208600F,
- 0.7340295955F, 0.7344380499F, 0.7348462226F, 0.7352541134F,
- 0.7356617220F, 0.7360690478F, 0.7364760907F, 0.7368828502F,
- 0.7372893259F, 0.7376955176F, 0.7381014249F, 0.7385070475F,
- 0.7389123849F, 0.7393174368F, 0.7397222029F, 0.7401266829F,
- 0.7405308763F, 0.7409347829F, 0.7413384023F, 0.7417417341F,
- 0.7421447780F, 0.7425475338F, 0.7429500009F, 0.7433521791F,
- 0.7437540681F, 0.7441556674F, 0.7445569769F, 0.7449579960F,
- 0.7453587245F, 0.7457591621F, 0.7461593084F, 0.7465591631F,
- 0.7469587259F, 0.7473579963F, 0.7477569741F, 0.7481556590F,
- 0.7485540506F, 0.7489521486F, 0.7493499526F, 0.7497474623F,
- 0.7501446775F, 0.7505415977F, 0.7509382227F, 0.7513345521F,
- 0.7517305856F, 0.7521263229F, 0.7525217636F, 0.7529169074F,
- 0.7533117541F, 0.7537063032F, 0.7541005545F, 0.7544945076F,
- 0.7548881623F, 0.7552815182F, 0.7556745749F, 0.7560673323F,
- 0.7564597899F, 0.7568519474F, 0.7572438046F, 0.7576353611F,
- 0.7580266166F, 0.7584175708F, 0.7588082235F, 0.7591985741F,
- 0.7595886226F, 0.7599783685F, 0.7603678116F, 0.7607569515F,
- 0.7611457879F, 0.7615343206F, 0.7619225493F, 0.7623104735F,
- 0.7626980931F, 0.7630854078F, 0.7634724171F, 0.7638591209F,
- 0.7642455188F, 0.7646316106F, 0.7650173959F, 0.7654028744F,
- 0.7657880459F, 0.7661729100F, 0.7665574664F, 0.7669417150F,
- 0.7673256553F, 0.7677092871F, 0.7680926100F, 0.7684756239F,
- 0.7688583284F, 0.7692407232F, 0.7696228080F, 0.7700045826F,
- 0.7703860467F, 0.7707671999F, 0.7711480420F, 0.7715285728F,
- 0.7719087918F, 0.7722886989F, 0.7726682938F, 0.7730475762F,
- 0.7734265458F, 0.7738052023F, 0.7741835454F, 0.7745615750F,
- 0.7749392906F, 0.7753166921F, 0.7756937791F, 0.7760705514F,
- 0.7764470087F, 0.7768231508F, 0.7771989773F, 0.7775744880F,
- 0.7779496827F, 0.7783245610F, 0.7786991227F, 0.7790733676F,
- 0.7794472953F, 0.7798209056F, 0.7801941982F, 0.7805671729F,
- 0.7809398294F, 0.7813121675F, 0.7816841869F, 0.7820558873F,
- 0.7824272684F, 0.7827983301F, 0.7831690720F, 0.7835394940F,
- 0.7839095957F, 0.7842793768F, 0.7846488373F, 0.7850179767F,
- 0.7853867948F, 0.7857552914F, 0.7861234663F, 0.7864913191F,
- 0.7868588497F, 0.7872260578F, 0.7875929431F, 0.7879595055F,
- 0.7883257445F, 0.7886916601F, 0.7890572520F, 0.7894225198F,
- 0.7897874635F, 0.7901520827F, 0.7905163772F, 0.7908803468F,
- 0.7912439912F, 0.7916073102F, 0.7919703035F, 0.7923329710F,
- 0.7926953124F, 0.7930573274F, 0.7934190158F, 0.7937803774F,
- 0.7941414120F, 0.7945021193F, 0.7948624991F, 0.7952225511F,
- 0.7955822752F, 0.7959416711F, 0.7963007387F, 0.7966594775F,
- 0.7970178875F, 0.7973759685F, 0.7977337201F, 0.7980911422F,
- 0.7984482346F, 0.7988049970F, 0.7991614292F, 0.7995175310F,
- 0.7998733022F, 0.8002287426F, 0.8005838519F, 0.8009386299F,
- 0.8012930765F, 0.8016471914F, 0.8020009744F, 0.8023544253F,
- 0.8027075438F, 0.8030603298F, 0.8034127831F, 0.8037649035F,
- 0.8041166906F, 0.8044681445F, 0.8048192647F, 0.8051700512F,
- 0.8055205038F, 0.8058706222F, 0.8062204062F, 0.8065698556F,
- 0.8069189702F, 0.8072677499F, 0.8076161944F, 0.8079643036F,
- 0.8083120772F, 0.8086595151F, 0.8090066170F, 0.8093533827F,
- 0.8096998122F, 0.8100459051F, 0.8103916613F, 0.8107370806F,
- 0.8110821628F, 0.8114269077F, 0.8117713151F, 0.8121153849F,
- 0.8124591169F, 0.8128025108F, 0.8131455666F, 0.8134882839F,
- 0.8138306627F, 0.8141727027F, 0.8145144038F, 0.8148557658F,
- 0.8151967886F, 0.8155374718F, 0.8158778154F, 0.8162178192F,
- 0.8165574830F, 0.8168968067F, 0.8172357900F, 0.8175744328F,
- 0.8179127349F, 0.8182506962F, 0.8185883164F, 0.8189255955F,
- 0.8192625332F, 0.8195991295F, 0.8199353840F, 0.8202712967F,
- 0.8206068673F, 0.8209420958F, 0.8212769820F, 0.8216115256F,
- 0.8219457266F, 0.8222795848F, 0.8226131000F, 0.8229462721F,
- 0.8232791009F, 0.8236115863F, 0.8239437280F, 0.8242755260F,
- 0.8246069801F, 0.8249380901F, 0.8252688559F, 0.8255992774F,
- 0.8259293544F, 0.8262590867F, 0.8265884741F, 0.8269175167F,
- 0.8272462141F, 0.8275745663F, 0.8279025732F, 0.8282302344F,
- 0.8285575501F, 0.8288845199F, 0.8292111437F, 0.8295374215F,
- 0.8298633530F, 0.8301889382F, 0.8305141768F, 0.8308390688F,
- 0.8311636141F, 0.8314878124F, 0.8318116637F, 0.8321351678F,
- 0.8324583246F, 0.8327811340F, 0.8331035957F, 0.8334257098F,
- 0.8337474761F, 0.8340688944F, 0.8343899647F, 0.8347106867F,
- 0.8350310605F, 0.8353510857F, 0.8356707624F, 0.8359900904F,
- 0.8363090696F, 0.8366276999F, 0.8369459811F, 0.8372639131F,
- 0.8375814958F, 0.8378987292F, 0.8382156130F, 0.8385321472F,
- 0.8388483316F, 0.8391641662F, 0.8394796508F, 0.8397947853F,
- 0.8401095697F, 0.8404240037F, 0.8407380873F, 0.8410518204F,
- 0.8413652029F, 0.8416782347F, 0.8419909156F, 0.8423032456F,
- 0.8426152245F, 0.8429268523F, 0.8432381289F, 0.8435490541F,
- 0.8438596279F, 0.8441698502F, 0.8444797208F, 0.8447892396F,
- 0.8450984067F, 0.8454072218F, 0.8457156849F, 0.8460237959F,
- 0.8463315547F, 0.8466389612F, 0.8469460154F, 0.8472527170F,
- 0.8475590661F, 0.8478650625F, 0.8481707063F, 0.8484759971F,
- 0.8487809351F, 0.8490855201F, 0.8493897521F, 0.8496936308F,
- 0.8499971564F, 0.8503003286F, 0.8506031474F, 0.8509056128F,
- 0.8512077246F, 0.8515094828F, 0.8518108872F, 0.8521119379F,
- 0.8524126348F, 0.8527129777F, 0.8530129666F, 0.8533126015F,
- 0.8536118822F, 0.8539108087F, 0.8542093809F, 0.8545075988F,
- 0.8548054623F, 0.8551029712F, 0.8554001257F, 0.8556969255F,
- 0.8559933707F, 0.8562894611F, 0.8565851968F, 0.8568805775F,
- 0.8571756034F, 0.8574702743F, 0.8577645902F, 0.8580585509F,
- 0.8583521566F, 0.8586454070F, 0.8589383021F, 0.8592308420F,
- 0.8595230265F, 0.8598148556F, 0.8601063292F, 0.8603974473F,
- 0.8606882098F, 0.8609786167F, 0.8612686680F, 0.8615583636F,
- 0.8618477034F, 0.8621366874F, 0.8624253156F, 0.8627135878F,
- 0.8630015042F, 0.8632890646F, 0.8635762690F, 0.8638631173F,
- 0.8641496096F, 0.8644357457F, 0.8647215257F, 0.8650069495F,
- 0.8652920171F, 0.8655767283F, 0.8658610833F, 0.8661450820F,
- 0.8664287243F, 0.8667120102F, 0.8669949397F, 0.8672775127F,
- 0.8675597293F, 0.8678415894F, 0.8681230929F, 0.8684042398F,
- 0.8686850302F, 0.8689654640F, 0.8692455412F, 0.8695252617F,
- 0.8698046255F, 0.8700836327F, 0.8703622831F, 0.8706405768F,
- 0.8709185138F, 0.8711960940F, 0.8714733174F, 0.8717501840F,
- 0.8720266939F, 0.8723028469F, 0.8725786430F, 0.8728540824F,
- 0.8731291648F, 0.8734038905F, 0.8736782592F, 0.8739522711F,
- 0.8742259261F, 0.8744992242F, 0.8747721653F, 0.8750447496F,
- 0.8753169770F, 0.8755888475F, 0.8758603611F, 0.8761315177F,
- 0.8764023175F, 0.8766727603F, 0.8769428462F, 0.8772125752F,
- 0.8774819474F, 0.8777509626F, 0.8780196209F, 0.8782879224F,
- 0.8785558669F, 0.8788234546F, 0.8790906854F, 0.8793575594F,
- 0.8796240765F, 0.8798902368F, 0.8801560403F, 0.8804214870F,
- 0.8806865768F, 0.8809513099F, 0.8812156863F, 0.8814797059F,
- 0.8817433687F, 0.8820066749F, 0.8822696243F, 0.8825322171F,
- 0.8827944532F, 0.8830563327F, 0.8833178556F, 0.8835790219F,
- 0.8838398316F, 0.8841002848F, 0.8843603815F, 0.8846201217F,
- 0.8848795054F, 0.8851385327F, 0.8853972036F, 0.8856555182F,
- 0.8859134764F, 0.8861710783F, 0.8864283239F, 0.8866852133F,
- 0.8869417464F, 0.8871979234F, 0.8874537443F, 0.8877092090F,
- 0.8879643177F, 0.8882190704F, 0.8884734671F, 0.8887275078F,
- 0.8889811927F, 0.8892345216F, 0.8894874948F, 0.8897401122F,
- 0.8899923738F, 0.8902442798F, 0.8904958301F, 0.8907470248F,
- 0.8909978640F, 0.8912483477F, 0.8914984759F, 0.8917482487F,
- 0.8919976662F, 0.8922467284F, 0.8924954353F, 0.8927437871F,
- 0.8929917837F, 0.8932394252F, 0.8934867118F, 0.8937336433F,
- 0.8939802199F, 0.8942264417F, 0.8944723087F, 0.8947178210F,
- 0.8949629785F, 0.8952077815F, 0.8954522299F, 0.8956963239F,
- 0.8959400634F, 0.8961834486F, 0.8964264795F, 0.8966691561F,
- 0.8969114786F, 0.8971534470F, 0.8973950614F, 0.8976363219F,
- 0.8978772284F, 0.8981177812F, 0.8983579802F, 0.8985978256F,
- 0.8988373174F, 0.8990764556F, 0.8993152405F, 0.8995536720F,
- 0.8997917502F, 0.9000294751F, 0.9002668470F, 0.9005038658F,
- 0.9007405317F, 0.9009768446F, 0.9012128048F, 0.9014484123F,
- 0.9016836671F, 0.9019185693F, 0.9021531191F, 0.9023873165F,
- 0.9026211616F, 0.9028546546F, 0.9030877954F, 0.9033205841F,
- 0.9035530210F, 0.9037851059F, 0.9040168392F, 0.9042482207F,
- 0.9044792507F, 0.9047099293F, 0.9049402564F, 0.9051702323F,
- 0.9053998569F, 0.9056291305F, 0.9058580531F, 0.9060866248F,
- 0.9063148457F, 0.9065427159F, 0.9067702355F, 0.9069974046F,
- 0.9072242233F, 0.9074506917F, 0.9076768100F, 0.9079025782F,
- 0.9081279964F, 0.9083530647F, 0.9085777833F, 0.9088021523F,
- 0.9090261717F, 0.9092498417F, 0.9094731623F, 0.9096961338F,
- 0.9099187561F, 0.9101410295F, 0.9103629540F, 0.9105845297F,
- 0.9108057568F, 0.9110266354F, 0.9112471656F, 0.9114673475F,
- 0.9116871812F, 0.9119066668F, 0.9121258046F, 0.9123445945F,
- 0.9125630367F, 0.9127811314F, 0.9129988786F, 0.9132162785F,
- 0.9134333312F, 0.9136500368F, 0.9138663954F, 0.9140824073F,
- 0.9142980724F, 0.9145133910F, 0.9147283632F, 0.9149429890F,
- 0.9151572687F, 0.9153712023F, 0.9155847900F, 0.9157980319F,
- 0.9160109282F, 0.9162234790F, 0.9164356844F, 0.9166475445F,
- 0.9168590595F, 0.9170702296F, 0.9172810548F, 0.9174915354F,
- 0.9177016714F, 0.9179114629F, 0.9181209102F, 0.9183300134F,
- 0.9185387726F, 0.9187471879F, 0.9189552595F, 0.9191629876F,
- 0.9193703723F, 0.9195774136F, 0.9197841119F, 0.9199904672F,
- 0.9201964797F, 0.9204021495F, 0.9206074767F, 0.9208124616F,
- 0.9210171043F, 0.9212214049F, 0.9214253636F, 0.9216289805F,
- 0.9218322558F, 0.9220351896F, 0.9222377821F, 0.9224400335F,
- 0.9226419439F, 0.9228435134F, 0.9230447423F, 0.9232456307F,
- 0.9234461787F, 0.9236463865F, 0.9238462543F, 0.9240457822F,
- 0.9242449704F, 0.9244438190F, 0.9246423282F, 0.9248404983F,
- 0.9250383293F, 0.9252358214F, 0.9254329747F, 0.9256297896F,
- 0.9258262660F, 0.9260224042F, 0.9262182044F, 0.9264136667F,
- 0.9266087913F, 0.9268035783F, 0.9269980280F, 0.9271921405F,
- 0.9273859160F, 0.9275793546F, 0.9277724566F, 0.9279652221F,
- 0.9281576513F, 0.9283497443F, 0.9285415014F, 0.9287329227F,
- 0.9289240084F, 0.9291147586F, 0.9293051737F, 0.9294952536F,
- 0.9296849987F, 0.9298744091F, 0.9300634850F, 0.9302522266F,
- 0.9304406340F, 0.9306287074F, 0.9308164471F, 0.9310038532F,
- 0.9311909259F, 0.9313776654F, 0.9315640719F, 0.9317501455F,
- 0.9319358865F, 0.9321212951F, 0.9323063713F, 0.9324911155F,
- 0.9326755279F, 0.9328596085F, 0.9330433577F, 0.9332267756F,
- 0.9334098623F, 0.9335926182F, 0.9337750434F, 0.9339571380F,
- 0.9341389023F, 0.9343203366F, 0.9345014409F, 0.9346822155F,
- 0.9348626606F, 0.9350427763F, 0.9352225630F, 0.9354020207F,
- 0.9355811498F, 0.9357599503F, 0.9359384226F, 0.9361165667F,
- 0.9362943830F, 0.9364718716F, 0.9366490327F, 0.9368258666F,
- 0.9370023733F, 0.9371785533F, 0.9373544066F, 0.9375299335F,
- 0.9377051341F, 0.9378800087F, 0.9380545576F, 0.9382287809F,
- 0.9384026787F, 0.9385762515F, 0.9387494993F, 0.9389224223F,
- 0.9390950209F, 0.9392672951F, 0.9394392453F, 0.9396108716F,
- 0.9397821743F, 0.9399531536F, 0.9401238096F, 0.9402941427F,
- 0.9404641530F, 0.9406338407F, 0.9408032061F, 0.9409722495F,
- 0.9411409709F, 0.9413093707F, 0.9414774491F, 0.9416452062F,
- 0.9418126424F, 0.9419797579F, 0.9421465528F, 0.9423130274F,
- 0.9424791819F, 0.9426450166F, 0.9428105317F, 0.9429757274F,
- 0.9431406039F, 0.9433051616F, 0.9434694005F, 0.9436333209F,
- 0.9437969232F, 0.9439602074F, 0.9441231739F, 0.9442858229F,
- 0.9444481545F, 0.9446101691F, 0.9447718669F, 0.9449332481F,
- 0.9450943129F, 0.9452550617F, 0.9454154945F, 0.9455756118F,
- 0.9457354136F, 0.9458949003F, 0.9460540721F, 0.9462129292F,
- 0.9463714719F, 0.9465297003F, 0.9466876149F, 0.9468452157F,
- 0.9470025031F, 0.9471594772F, 0.9473161384F, 0.9474724869F,
- 0.9476285229F, 0.9477842466F, 0.9479396584F, 0.9480947585F,
- 0.9482495470F, 0.9484040243F, 0.9485581906F, 0.9487120462F,
- 0.9488655913F, 0.9490188262F, 0.9491717511F, 0.9493243662F,
- 0.9494766718F, 0.9496286683F, 0.9497803557F, 0.9499317345F,
- 0.9500828047F, 0.9502335668F, 0.9503840209F, 0.9505341673F,
- 0.9506840062F, 0.9508335380F, 0.9509827629F, 0.9511316810F,
- 0.9512802928F, 0.9514285984F, 0.9515765982F, 0.9517242923F,
- 0.9518716810F, 0.9520187646F, 0.9521655434F, 0.9523120176F,
- 0.9524581875F, 0.9526040534F, 0.9527496154F, 0.9528948739F,
- 0.9530398292F, 0.9531844814F, 0.9533288310F, 0.9534728780F,
- 0.9536166229F, 0.9537600659F, 0.9539032071F, 0.9540460470F,
- 0.9541885858F, 0.9543308237F, 0.9544727611F, 0.9546143981F,
- 0.9547557351F, 0.9548967723F, 0.9550375100F, 0.9551779485F,
- 0.9553180881F, 0.9554579290F, 0.9555974714F, 0.9557367158F,
- 0.9558756623F, 0.9560143112F, 0.9561526628F, 0.9562907174F,
- 0.9564284752F, 0.9565659366F, 0.9567031017F, 0.9568399710F,
- 0.9569765446F, 0.9571128229F, 0.9572488061F, 0.9573844944F,
- 0.9575198883F, 0.9576549879F, 0.9577897936F, 0.9579243056F,
- 0.9580585242F, 0.9581924497F, 0.9583260824F, 0.9584594226F,
- 0.9585924705F, 0.9587252264F, 0.9588576906F, 0.9589898634F,
- 0.9591217452F, 0.9592533360F, 0.9593846364F, 0.9595156465F,
- 0.9596463666F, 0.9597767971F, 0.9599069382F, 0.9600367901F,
- 0.9601663533F, 0.9602956279F, 0.9604246143F, 0.9605533128F,
- 0.9606817236F, 0.9608098471F, 0.9609376835F, 0.9610652332F,
- 0.9611924963F, 0.9613194733F, 0.9614461644F, 0.9615725699F,
- 0.9616986901F, 0.9618245253F, 0.9619500757F, 0.9620753418F,
- 0.9622003238F, 0.9623250219F, 0.9624494365F, 0.9625735679F,
- 0.9626974163F, 0.9628209821F, 0.9629442656F, 0.9630672671F,
- 0.9631899868F, 0.9633124251F, 0.9634345822F, 0.9635564585F,
- 0.9636780543F, 0.9637993699F, 0.9639204056F, 0.9640411616F,
- 0.9641616383F, 0.9642818359F, 0.9644017549F, 0.9645213955F,
- 0.9646407579F, 0.9647598426F, 0.9648786497F, 0.9649971797F,
- 0.9651154328F, 0.9652334092F, 0.9653511095F, 0.9654685337F,
- 0.9655856823F, 0.9657025556F, 0.9658191538F, 0.9659354773F,
- 0.9660515263F, 0.9661673013F, 0.9662828024F, 0.9663980300F,
- 0.9665129845F, 0.9666276660F, 0.9667420750F, 0.9668562118F,
- 0.9669700766F, 0.9670836698F, 0.9671969917F, 0.9673100425F,
- 0.9674228227F, 0.9675353325F, 0.9676475722F, 0.9677595422F,
- 0.9678712428F, 0.9679826742F, 0.9680938368F, 0.9682047309F,
- 0.9683153569F, 0.9684257150F, 0.9685358056F, 0.9686456289F,
- 0.9687551853F, 0.9688644752F, 0.9689734987F, 0.9690822564F,
- 0.9691907483F, 0.9692989750F, 0.9694069367F, 0.9695146337F,
- 0.9696220663F, 0.9697292349F, 0.9698361398F, 0.9699427813F,
- 0.9700491597F, 0.9701552754F, 0.9702611286F, 0.9703667197F,
- 0.9704720490F, 0.9705771169F, 0.9706819236F, 0.9707864695F,
- 0.9708907549F, 0.9709947802F, 0.9710985456F, 0.9712020514F,
- 0.9713052981F, 0.9714082859F, 0.9715110151F, 0.9716134862F,
- 0.9717156993F, 0.9718176549F, 0.9719193532F, 0.9720207946F,
- 0.9721219794F, 0.9722229080F, 0.9723235806F, 0.9724239976F,
- 0.9725241593F, 0.9726240661F, 0.9727237183F, 0.9728231161F,
- 0.9729222601F, 0.9730211503F, 0.9731197873F, 0.9732181713F,
- 0.9733163027F, 0.9734141817F, 0.9735118088F, 0.9736091842F,
- 0.9737063083F, 0.9738031814F, 0.9738998039F, 0.9739961760F,
- 0.9740922981F, 0.9741881706F, 0.9742837938F, 0.9743791680F,
- 0.9744742935F, 0.9745691707F, 0.9746637999F, 0.9747581814F,
- 0.9748523157F, 0.9749462029F, 0.9750398435F, 0.9751332378F,
- 0.9752263861F, 0.9753192887F, 0.9754119461F, 0.9755043585F,
- 0.9755965262F, 0.9756884496F, 0.9757801291F, 0.9758715650F,
- 0.9759627575F, 0.9760537071F, 0.9761444141F, 0.9762348789F,
- 0.9763251016F, 0.9764150828F, 0.9765048228F, 0.9765943218F,
- 0.9766835802F, 0.9767725984F, 0.9768613767F, 0.9769499154F,
- 0.9770382149F, 0.9771262755F, 0.9772140976F, 0.9773016815F,
- 0.9773890275F, 0.9774761360F, 0.9775630073F, 0.9776496418F,
- 0.9777360398F, 0.9778222016F, 0.9779081277F, 0.9779938182F,
- 0.9780792736F, 0.9781644943F, 0.9782494805F, 0.9783342326F,
- 0.9784187509F, 0.9785030359F, 0.9785870877F, 0.9786709069F,
- 0.9787544936F, 0.9788378484F, 0.9789209714F, 0.9790038631F,
- 0.9790865238F, 0.9791689538F, 0.9792511535F, 0.9793331232F,
- 0.9794148633F, 0.9794963742F, 0.9795776561F, 0.9796587094F,
- 0.9797395345F, 0.9798201316F, 0.9799005013F, 0.9799806437F,
- 0.9800605593F, 0.9801402483F, 0.9802197112F, 0.9802989483F,
- 0.9803779600F, 0.9804567465F, 0.9805353082F, 0.9806136455F,
- 0.9806917587F, 0.9807696482F, 0.9808473143F, 0.9809247574F,
- 0.9810019778F, 0.9810789759F, 0.9811557519F, 0.9812323064F,
- 0.9813086395F, 0.9813847517F, 0.9814606433F, 0.9815363147F,
- 0.9816117662F, 0.9816869981F, 0.9817620108F, 0.9818368047F,
- 0.9819113801F, 0.9819857374F, 0.9820598769F, 0.9821337989F,
- 0.9822075038F, 0.9822809920F, 0.9823542638F, 0.9824273195F,
- 0.9825001596F, 0.9825727843F, 0.9826451940F, 0.9827173891F,
- 0.9827893700F, 0.9828611368F, 0.9829326901F, 0.9830040302F,
- 0.9830751574F, 0.9831460720F, 0.9832167745F, 0.9832872652F,
- 0.9833575444F, 0.9834276124F, 0.9834974697F, 0.9835671166F,
- 0.9836365535F, 0.9837057806F, 0.9837747983F, 0.9838436071F,
- 0.9839122072F, 0.9839805990F, 0.9840487829F, 0.9841167591F,
- 0.9841845282F, 0.9842520903F, 0.9843194459F, 0.9843865953F,
- 0.9844535389F, 0.9845202771F, 0.9845868101F, 0.9846531383F,
- 0.9847192622F, 0.9847851820F, 0.9848508980F, 0.9849164108F,
- 0.9849817205F, 0.9850468276F, 0.9851117324F, 0.9851764352F,
- 0.9852409365F, 0.9853052366F, 0.9853693358F, 0.9854332344F,
- 0.9854969330F, 0.9855604317F, 0.9856237309F, 0.9856868310F,
- 0.9857497325F, 0.9858124355F, 0.9858749404F, 0.9859372477F,
- 0.9859993577F, 0.9860612707F, 0.9861229871F, 0.9861845072F,
- 0.9862458315F, 0.9863069601F, 0.9863678936F, 0.9864286322F,
- 0.9864891764F, 0.9865495264F, 0.9866096826F, 0.9866696454F,
- 0.9867294152F, 0.9867889922F, 0.9868483769F, 0.9869075695F,
- 0.9869665706F, 0.9870253803F, 0.9870839991F, 0.9871424273F,
- 0.9872006653F, 0.9872587135F, 0.9873165721F, 0.9873742415F,
- 0.9874317222F, 0.9874890144F, 0.9875461185F, 0.9876030348F,
- 0.9876597638F, 0.9877163057F, 0.9877726610F, 0.9878288300F,
- 0.9878848130F, 0.9879406104F, 0.9879962225F, 0.9880516497F,
- 0.9881068924F, 0.9881619509F, 0.9882168256F, 0.9882715168F,
- 0.9883260249F, 0.9883803502F, 0.9884344931F, 0.9884884539F,
- 0.9885422331F, 0.9885958309F, 0.9886492477F, 0.9887024838F,
- 0.9887555397F, 0.9888084157F, 0.9888611120F, 0.9889136292F,
- 0.9889659675F, 0.9890181273F, 0.9890701089F, 0.9891219128F,
- 0.9891735392F, 0.9892249885F, 0.9892762610F, 0.9893273572F,
- 0.9893782774F, 0.9894290219F, 0.9894795911F, 0.9895299853F,
- 0.9895802049F, 0.9896302502F, 0.9896801217F, 0.9897298196F,
- 0.9897793443F, 0.9898286961F, 0.9898778755F, 0.9899268828F,
- 0.9899757183F, 0.9900243823F, 0.9900728753F, 0.9901211976F,
- 0.9901693495F, 0.9902173314F, 0.9902651436F, 0.9903127865F,
- 0.9903602605F, 0.9904075659F, 0.9904547031F, 0.9905016723F,
- 0.9905484740F, 0.9905951086F, 0.9906415763F, 0.9906878775F,
- 0.9907340126F, 0.9907799819F, 0.9908257858F, 0.9908714247F,
- 0.9909168988F, 0.9909622086F, 0.9910073543F, 0.9910523364F,
- 0.9910971552F, 0.9911418110F, 0.9911863042F, 0.9912306351F,
- 0.9912748042F, 0.9913188117F, 0.9913626580F, 0.9914063435F,
- 0.9914498684F, 0.9914932333F, 0.9915364383F, 0.9915794839F,
- 0.9916223703F, 0.9916650981F, 0.9917076674F, 0.9917500787F,
- 0.9917923323F, 0.9918344286F, 0.9918763679F, 0.9919181505F,
- 0.9919597769F, 0.9920012473F, 0.9920425621F, 0.9920837217F,
- 0.9921247263F, 0.9921655765F, 0.9922062724F, 0.9922468145F,
- 0.9922872030F, 0.9923274385F, 0.9923675211F, 0.9924074513F,
- 0.9924472294F, 0.9924868557F, 0.9925263306F, 0.9925656544F,
- 0.9926048275F, 0.9926438503F, 0.9926827230F, 0.9927214461F,
- 0.9927600199F, 0.9927984446F, 0.9928367208F, 0.9928748486F,
- 0.9929128285F, 0.9929506608F, 0.9929883459F, 0.9930258841F,
- 0.9930632757F, 0.9931005211F, 0.9931376207F, 0.9931745747F,
- 0.9932113836F, 0.9932480476F, 0.9932845671F, 0.9933209425F,
- 0.9933571742F, 0.9933932623F, 0.9934292074F, 0.9934650097F,
- 0.9935006696F, 0.9935361874F, 0.9935715635F, 0.9936067982F,
- 0.9936418919F, 0.9936768448F, 0.9937116574F, 0.9937463300F,
- 0.9937808629F, 0.9938152565F, 0.9938495111F, 0.9938836271F,
- 0.9939176047F, 0.9939514444F, 0.9939851465F, 0.9940187112F,
- 0.9940521391F, 0.9940854303F, 0.9941185853F, 0.9941516044F,
- 0.9941844879F, 0.9942172361F, 0.9942498495F, 0.9942823283F,
- 0.9943146729F, 0.9943468836F, 0.9943789608F, 0.9944109047F,
- 0.9944427158F, 0.9944743944F, 0.9945059408F, 0.9945373553F,
- 0.9945686384F, 0.9945997902F, 0.9946308112F, 0.9946617017F,
- 0.9946924621F, 0.9947230926F, 0.9947535937F, 0.9947839656F,
- 0.9948142086F, 0.9948443232F, 0.9948743097F, 0.9949041683F,
- 0.9949338995F, 0.9949635035F, 0.9949929807F, 0.9950223315F,
- 0.9950515561F, 0.9950806549F, 0.9951096282F, 0.9951384764F,
- 0.9951671998F, 0.9951957987F, 0.9952242735F, 0.9952526245F,
- 0.9952808520F, 0.9953089564F, 0.9953369380F, 0.9953647971F,
- 0.9953925340F, 0.9954201491F, 0.9954476428F, 0.9954750153F,
- 0.9955022670F, 0.9955293981F, 0.9955564092F, 0.9955833003F,
- 0.9956100720F, 0.9956367245F, 0.9956632582F, 0.9956896733F,
- 0.9957159703F, 0.9957421494F, 0.9957682110F, 0.9957941553F,
- 0.9958199828F, 0.9958456937F, 0.9958712884F, 0.9958967672F,
- 0.9959221305F, 0.9959473784F, 0.9959725115F, 0.9959975300F,
- 0.9960224342F, 0.9960472244F, 0.9960719011F, 0.9960964644F,
- 0.9961209148F, 0.9961452525F, 0.9961694779F, 0.9961935913F,
- 0.9962175930F, 0.9962414834F, 0.9962652627F, 0.9962889313F,
- 0.9963124895F, 0.9963359377F, 0.9963592761F, 0.9963825051F,
- 0.9964056250F, 0.9964286361F, 0.9964515387F, 0.9964743332F,
- 0.9964970198F, 0.9965195990F, 0.9965420709F, 0.9965644360F,
- 0.9965866946F, 0.9966088469F, 0.9966308932F, 0.9966528340F,
- 0.9966746695F, 0.9966964001F, 0.9967180260F, 0.9967395475F,
- 0.9967609651F, 0.9967822789F, 0.9968034894F, 0.9968245968F,
- 0.9968456014F, 0.9968665036F, 0.9968873037F, 0.9969080019F,
- 0.9969285987F, 0.9969490942F, 0.9969694889F, 0.9969897830F,
- 0.9970099769F, 0.9970300708F, 0.9970500651F, 0.9970699601F,
- 0.9970897561F, 0.9971094533F, 0.9971290522F, 0.9971485531F,
- 0.9971679561F, 0.9971872617F, 0.9972064702F, 0.9972255818F,
- 0.9972445968F, 0.9972635157F, 0.9972823386F, 0.9973010659F,
- 0.9973196980F, 0.9973382350F, 0.9973566773F, 0.9973750253F,
- 0.9973932791F, 0.9974114392F, 0.9974295059F, 0.9974474793F,
- 0.9974653599F, 0.9974831480F, 0.9975008438F, 0.9975184476F,
- 0.9975359598F, 0.9975533806F, 0.9975707104F, 0.9975879495F,
- 0.9976050981F, 0.9976221566F, 0.9976391252F, 0.9976560043F,
- 0.9976727941F, 0.9976894950F, 0.9977061073F, 0.9977226312F,
- 0.9977390671F, 0.9977554152F, 0.9977716759F, 0.9977878495F,
- 0.9978039361F, 0.9978199363F, 0.9978358501F, 0.9978516780F,
- 0.9978674202F, 0.9978830771F, 0.9978986488F, 0.9979141358F,
- 0.9979295383F, 0.9979448566F, 0.9979600909F, 0.9979752417F,
- 0.9979903091F, 0.9980052936F, 0.9980201952F, 0.9980350145F,
- 0.9980497515F, 0.9980644067F, 0.9980789804F, 0.9980934727F,
- 0.9981078841F, 0.9981222147F, 0.9981364649F, 0.9981506350F,
- 0.9981647253F, 0.9981787360F, 0.9981926674F, 0.9982065199F,
- 0.9982202936F, 0.9982339890F, 0.9982476062F, 0.9982611456F,
- 0.9982746074F, 0.9982879920F, 0.9983012996F, 0.9983145304F,
- 0.9983276849F, 0.9983407632F, 0.9983537657F, 0.9983666926F,
- 0.9983795442F, 0.9983923208F, 0.9984050226F, 0.9984176501F,
- 0.9984302033F, 0.9984426827F, 0.9984550884F, 0.9984674208F,
- 0.9984796802F, 0.9984918667F, 0.9985039808F, 0.9985160227F,
- 0.9985279926F, 0.9985398909F, 0.9985517177F, 0.9985634734F,
- 0.9985751583F, 0.9985867727F, 0.9985983167F, 0.9986097907F,
- 0.9986211949F, 0.9986325297F, 0.9986437953F, 0.9986549919F,
- 0.9986661199F, 0.9986771795F, 0.9986881710F, 0.9986990946F,
- 0.9987099507F, 0.9987207394F, 0.9987314611F, 0.9987421161F,
- 0.9987527045F, 0.9987632267F, 0.9987736829F, 0.9987840734F,
- 0.9987943985F, 0.9988046584F, 0.9988148534F, 0.9988249838F,
- 0.9988350498F, 0.9988450516F, 0.9988549897F, 0.9988648641F,
- 0.9988746753F, 0.9988844233F, 0.9988941086F, 0.9989037313F,
- 0.9989132918F, 0.9989227902F, 0.9989322269F, 0.9989416021F,
- 0.9989509160F, 0.9989601690F, 0.9989693613F, 0.9989784931F,
- 0.9989875647F, 0.9989965763F, 0.9990055283F, 0.9990144208F,
- 0.9990232541F, 0.9990320286F, 0.9990407443F, 0.9990494016F,
- 0.9990580008F, 0.9990665421F, 0.9990750257F, 0.9990834519F,
- 0.9990918209F, 0.9991001331F, 0.9991083886F, 0.9991165877F,
- 0.9991247307F, 0.9991328177F, 0.9991408491F, 0.9991488251F,
- 0.9991567460F, 0.9991646119F, 0.9991724232F, 0.9991801801F,
- 0.9991878828F, 0.9991955316F, 0.9992031267F, 0.9992106684F,
- 0.9992181569F, 0.9992255925F, 0.9992329753F, 0.9992403057F,
- 0.9992475839F, 0.9992548101F, 0.9992619846F, 0.9992691076F,
- 0.9992761793F, 0.9992832001F, 0.9992901701F, 0.9992970895F,
- 0.9993039587F, 0.9993107777F, 0.9993175470F, 0.9993242667F,
- 0.9993309371F, 0.9993375583F, 0.9993441307F, 0.9993506545F,
- 0.9993571298F, 0.9993635570F, 0.9993699362F, 0.9993762678F,
- 0.9993825519F, 0.9993887887F, 0.9993949785F, 0.9994011216F,
- 0.9994072181F, 0.9994132683F, 0.9994192725F, 0.9994252307F,
- 0.9994311434F, 0.9994370107F, 0.9994428327F, 0.9994486099F,
- 0.9994543423F, 0.9994600303F, 0.9994656739F, 0.9994712736F,
- 0.9994768294F, 0.9994823417F, 0.9994878105F, 0.9994932363F,
- 0.9994986191F, 0.9995039592F, 0.9995092568F, 0.9995145122F,
- 0.9995197256F, 0.9995248971F, 0.9995300270F, 0.9995351156F,
- 0.9995401630F, 0.9995451695F, 0.9995501352F, 0.9995550604F,
- 0.9995599454F, 0.9995647903F, 0.9995695953F, 0.9995743607F,
- 0.9995790866F, 0.9995837734F, 0.9995884211F, 0.9995930300F,
- 0.9995976004F, 0.9996021324F, 0.9996066263F, 0.9996110822F,
- 0.9996155004F, 0.9996198810F, 0.9996242244F, 0.9996285306F,
- 0.9996327999F, 0.9996370326F, 0.9996412287F, 0.9996453886F,
- 0.9996495125F, 0.9996536004F, 0.9996576527F, 0.9996616696F,
- 0.9996656512F, 0.9996695977F, 0.9996735094F, 0.9996773865F,
- 0.9996812291F, 0.9996850374F, 0.9996888118F, 0.9996925523F,
- 0.9996962591F, 0.9996999325F, 0.9997035727F, 0.9997071798F,
- 0.9997107541F, 0.9997142957F, 0.9997178049F, 0.9997212818F,
- 0.9997247266F, 0.9997281396F, 0.9997315209F, 0.9997348708F,
- 0.9997381893F, 0.9997414767F, 0.9997447333F, 0.9997479591F,
- 0.9997511544F, 0.9997543194F, 0.9997574542F, 0.9997605591F,
- 0.9997636342F, 0.9997666797F, 0.9997696958F, 0.9997726828F,
- 0.9997756407F, 0.9997785698F, 0.9997814703F, 0.9997843423F,
- 0.9997871860F, 0.9997900016F, 0.9997927894F, 0.9997955494F,
- 0.9997982818F, 0.9998009869F, 0.9998036648F, 0.9998063157F,
- 0.9998089398F, 0.9998115373F, 0.9998141082F, 0.9998166529F,
- 0.9998191715F, 0.9998216642F, 0.9998241311F, 0.9998265724F,
- 0.9998289884F, 0.9998313790F, 0.9998337447F, 0.9998360854F,
- 0.9998384015F, 0.9998406930F, 0.9998429602F, 0.9998452031F,
- 0.9998474221F, 0.9998496171F, 0.9998517885F, 0.9998539364F,
- 0.9998560610F, 0.9998581624F, 0.9998602407F, 0.9998622962F,
- 0.9998643291F, 0.9998663394F, 0.9998683274F, 0.9998702932F,
- 0.9998722370F, 0.9998741589F, 0.9998760591F, 0.9998779378F,
- 0.9998797952F, 0.9998816313F, 0.9998834464F, 0.9998852406F,
- 0.9998870141F, 0.9998887670F, 0.9998904995F, 0.9998922117F,
- 0.9998939039F, 0.9998955761F, 0.9998972285F, 0.9998988613F,
- 0.9999004746F, 0.9999020686F, 0.9999036434F, 0.9999051992F,
- 0.9999067362F, 0.9999082544F, 0.9999097541F, 0.9999112354F,
- 0.9999126984F, 0.9999141433F, 0.9999155703F, 0.9999169794F,
- 0.9999183709F, 0.9999197449F, 0.9999211014F, 0.9999224408F,
- 0.9999237631F, 0.9999250684F, 0.9999263570F, 0.9999276289F,
- 0.9999288843F, 0.9999301233F, 0.9999313461F, 0.9999325529F,
- 0.9999337437F, 0.9999349187F, 0.9999360780F, 0.9999372218F,
- 0.9999383503F, 0.9999394635F, 0.9999405616F, 0.9999416447F,
- 0.9999427129F, 0.9999437665F, 0.9999448055F, 0.9999458301F,
- 0.9999468404F, 0.9999478365F, 0.9999488185F, 0.9999497867F,
- 0.9999507411F, 0.9999516819F, 0.9999526091F, 0.9999535230F,
- 0.9999544236F, 0.9999553111F, 0.9999561856F, 0.9999570472F,
- 0.9999578960F, 0.9999587323F, 0.9999595560F, 0.9999603674F,
- 0.9999611666F, 0.9999619536F, 0.9999627286F, 0.9999634917F,
- 0.9999642431F, 0.9999649828F, 0.9999657110F, 0.9999664278F,
- 0.9999671334F, 0.9999678278F, 0.9999685111F, 0.9999691835F,
- 0.9999698451F, 0.9999704960F, 0.9999711364F, 0.9999717662F,
- 0.9999723858F, 0.9999729950F, 0.9999735942F, 0.9999741834F,
- 0.9999747626F, 0.9999753321F, 0.9999758919F, 0.9999764421F,
- 0.9999769828F, 0.9999775143F, 0.9999780364F, 0.9999785495F,
- 0.9999790535F, 0.9999795485F, 0.9999800348F, 0.9999805124F,
- 0.9999809813F, 0.9999814417F, 0.9999818938F, 0.9999823375F,
- 0.9999827731F, 0.9999832005F, 0.9999836200F, 0.9999840316F,
- 0.9999844353F, 0.9999848314F, 0.9999852199F, 0.9999856008F,
- 0.9999859744F, 0.9999863407F, 0.9999866997F, 0.9999870516F,
- 0.9999873965F, 0.9999877345F, 0.9999880656F, 0.9999883900F,
- 0.9999887078F, 0.9999890190F, 0.9999893237F, 0.9999896220F,
- 0.9999899140F, 0.9999901999F, 0.9999904796F, 0.9999907533F,
- 0.9999910211F, 0.9999912830F, 0.9999915391F, 0.9999917896F,
- 0.9999920345F, 0.9999922738F, 0.9999925077F, 0.9999927363F,
- 0.9999929596F, 0.9999931777F, 0.9999933907F, 0.9999935987F,
- 0.9999938018F, 0.9999940000F, 0.9999941934F, 0.9999943820F,
- 0.9999945661F, 0.9999947456F, 0.9999949206F, 0.9999950912F,
- 0.9999952575F, 0.9999954195F, 0.9999955773F, 0.9999957311F,
- 0.9999958807F, 0.9999960265F, 0.9999961683F, 0.9999963063F,
- 0.9999964405F, 0.9999965710F, 0.9999966979F, 0.9999968213F,
- 0.9999969412F, 0.9999970576F, 0.9999971707F, 0.9999972805F,
- 0.9999973871F, 0.9999974905F, 0.9999975909F, 0.9999976881F,
- 0.9999977824F, 0.9999978738F, 0.9999979624F, 0.9999980481F,
- 0.9999981311F, 0.9999982115F, 0.9999982892F, 0.9999983644F,
- 0.9999984370F, 0.9999985072F, 0.9999985750F, 0.9999986405F,
- 0.9999987037F, 0.9999987647F, 0.9999988235F, 0.9999988802F,
- 0.9999989348F, 0.9999989873F, 0.9999990379F, 0.9999990866F,
- 0.9999991334F, 0.9999991784F, 0.9999992217F, 0.9999992632F,
- 0.9999993030F, 0.9999993411F, 0.9999993777F, 0.9999994128F,
- 0.9999994463F, 0.9999994784F, 0.9999995091F, 0.9999995384F,
- 0.9999995663F, 0.9999995930F, 0.9999996184F, 0.9999996426F,
- 0.9999996657F, 0.9999996876F, 0.9999997084F, 0.9999997282F,
- 0.9999997469F, 0.9999997647F, 0.9999997815F, 0.9999997973F,
- 0.9999998123F, 0.9999998265F, 0.9999998398F, 0.9999998524F,
- 0.9999998642F, 0.9999998753F, 0.9999998857F, 0.9999998954F,
- 0.9999999045F, 0.9999999130F, 0.9999999209F, 0.9999999282F,
- 0.9999999351F, 0.9999999414F, 0.9999999472F, 0.9999999526F,
- 0.9999999576F, 0.9999999622F, 0.9999999664F, 0.9999999702F,
- 0.9999999737F, 0.9999999769F, 0.9999999798F, 0.9999999824F,
- 0.9999999847F, 0.9999999868F, 0.9999999887F, 0.9999999904F,
- 0.9999999919F, 0.9999999932F, 0.9999999943F, 0.9999999953F,
- 0.9999999961F, 0.9999999969F, 0.9999999975F, 0.9999999980F,
- 0.9999999985F, 0.9999999988F, 0.9999999991F, 0.9999999993F,
- 0.9999999995F, 0.9999999997F, 0.9999999998F, 0.9999999999F,
- 0.9999999999F, 1.0000000000F, 1.0000000000F, 1.0000000000F,
- 1.0000000000F, 1.0000000000F, 1.0000000000F, 1.0000000000F,
-};
-
-const float ff_vorbis_floor1_inverse_db_table[256]={
- 1.0649863e-07F, 1.1341951e-07F, 1.2079015e-07F, 1.2863978e-07F,
- 1.3699951e-07F, 1.4590251e-07F, 1.5538408e-07F, 1.6548181e-07F,
- 1.7623575e-07F, 1.8768855e-07F, 1.9988561e-07F, 2.128753e-07F,
- 2.2670913e-07F, 2.4144197e-07F, 2.5713223e-07F, 2.7384213e-07F,
- 2.9163793e-07F, 3.1059021e-07F, 3.3077411e-07F, 3.5226968e-07F,
- 3.7516214e-07F, 3.9954229e-07F, 4.2550680e-07F, 4.5315863e-07F,
- 4.8260743e-07F, 5.1396998e-07F, 5.4737065e-07F, 5.8294187e-07F,
- 6.2082472e-07F, 6.6116941e-07F, 7.0413592e-07F, 7.4989464e-07F,
- 7.9862701e-07F, 8.5052630e-07F, 9.0579828e-07F, 9.6466216e-07F,
- 1.0273513e-06F, 1.0941144e-06F, 1.1652161e-06F, 1.2409384e-06F,
- 1.3215816e-06F, 1.4074654e-06F, 1.4989305e-06F, 1.5963394e-06F,
- 1.7000785e-06F, 1.8105592e-06F, 1.9282195e-06F, 2.0535261e-06F,
- 2.1869758e-06F, 2.3290978e-06F, 2.4804557e-06F, 2.6416497e-06F,
- 2.8133190e-06F, 2.9961443e-06F, 3.1908506e-06F, 3.3982101e-06F,
- 3.6190449e-06F, 3.8542308e-06F, 4.1047004e-06F, 4.3714470e-06F,
- 4.6555282e-06F, 4.9580707e-06F, 5.2802740e-06F, 5.6234160e-06F,
- 5.9888572e-06F, 6.3780469e-06F, 6.7925283e-06F, 7.2339451e-06F,
- 7.7040476e-06F, 8.2047000e-06F, 8.7378876e-06F, 9.3057248e-06F,
- 9.9104632e-06F, 1.0554501e-05F, 1.1240392e-05F, 1.1970856e-05F,
- 1.2748789e-05F, 1.3577278e-05F, 1.4459606e-05F, 1.5399272e-05F,
- 1.6400004e-05F, 1.7465768e-05F, 1.8600792e-05F, 1.9809576e-05F,
- 2.1096914e-05F, 2.2467911e-05F, 2.3928002e-05F, 2.5482978e-05F,
- 2.7139006e-05F, 2.8902651e-05F, 3.0780908e-05F, 3.2781225e-05F,
- 3.4911534e-05F, 3.7180282e-05F, 3.9596466e-05F, 4.2169667e-05F,
- 4.4910090e-05F, 4.7828601e-05F, 5.0936773e-05F, 5.4246931e-05F,
- 5.7772202e-05F, 6.1526565e-05F, 6.5524908e-05F, 6.9783085e-05F,
- 7.4317983e-05F, 7.9147585e-05F, 8.4291040e-05F, 8.9768747e-05F,
- 9.5602426e-05F, 0.00010181521F, 0.00010843174F, 0.00011547824F,
- 0.00012298267F, 0.00013097477F, 0.00013948625F, 0.00014855085F,
- 0.00015820453F, 0.00016848555F, 0.00017943469F, 0.00019109536F,
- 0.00020351382F, 0.00021673929F, 0.00023082423F, 0.00024582449F,
- 0.00026179955F, 0.00027881276F, 0.00029693158F, 0.00031622787F,
- 0.00033677814F, 0.00035866388F, 0.00038197188F, 0.00040679456F,
- 0.00043323036F, 0.00046138411F, 0.00049136745F, 0.00052329927F,
- 0.00055730621F, 0.00059352311F, 0.00063209358F, 0.00067317058F,
- 0.00071691700F, 0.00076350630F, 0.00081312324F, 0.00086596457F,
- 0.00092223983F, 0.00098217216F, 0.0010459992F, 0.0011139742F,
- 0.0011863665F, 0.0012634633F, 0.0013455702F, 0.0014330129F,
- 0.0015261382F, 0.0016253153F, 0.0017309374F, 0.0018434235F,
- 0.0019632195F, 0.0020908006F, 0.0022266726F, 0.0023713743F,
- 0.0025254795F, 0.0026895994F, 0.0028643847F, 0.0030505286F,
- 0.0032487691F, 0.0034598925F, 0.0036847358F, 0.0039241906F,
- 0.0041792066F, 0.0044507950F, 0.0047400328F, 0.0050480668F,
- 0.0053761186F, 0.0057254891F, 0.0060975636F, 0.0064938176F,
- 0.0069158225F, 0.0073652516F, 0.0078438871F, 0.0083536271F,
- 0.0088964928F, 0.009474637F, 0.010090352F, 0.010746080F,
- 0.011444421F, 0.012188144F, 0.012980198F, 0.013823725F,
- 0.014722068F, 0.015678791F, 0.016697687F, 0.017782797F,
- 0.018938423F, 0.020169149F, 0.021479854F, 0.022875735F,
- 0.024362330F, 0.025945531F, 0.027631618F, 0.029427276F,
- 0.031339626F, 0.033376252F, 0.035545228F, 0.037855157F,
- 0.040315199F, 0.042935108F, 0.045725273F, 0.048696758F,
- 0.051861348F, 0.055231591F, 0.058820850F, 0.062643361F,
- 0.066714279F, 0.071049749F, 0.075666962F, 0.080584227F,
- 0.085821044F, 0.091398179F, 0.097337747F, 0.10366330F,
- 0.11039993F, 0.11757434F, 0.12521498F, 0.13335215F,
- 0.14201813F, 0.15124727F, 0.16107617F, 0.17154380F,
- 0.18269168F, 0.19456402F, 0.20720788F, 0.22067342F,
- 0.23501402F, 0.25028656F, 0.26655159F, 0.28387361F,
- 0.30232132F, 0.32196786F, 0.34289114F, 0.36517414F,
- 0.38890521F, 0.41417847F, 0.44109412F, 0.46975890F,
- 0.50028648F, 0.53279791F, 0.56742212F, 0.60429640F,
- 0.64356699F, 0.68538959F, 0.72993007F, 0.77736504F,
- 0.82788260F, 0.88168307F, 0.9389798F, 1.F,
-};
-
-const float * ff_vorbis_vwin[8] = { vwin64, vwin128, vwin256, vwin512, vwin1024, vwin2048, vwin4096, vwin8192 };
-
diff --git a/src/libffmpeg/libavcodec/vp3.c b/src/libffmpeg/libavcodec/vp3.c
deleted file mode 100644
index f02215407..000000000
--- a/src/libffmpeg/libavcodec/vp3.c
+++ /dev/null
@@ -1,2657 +0,0 @@
-/*
- * Copyright (C) 2003-2004 the ffmpeg project
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file vp3.c
- * On2 VP3 Video Decoder
- *
- * VP3 Video Decoder by Mike Melanson (mike at multimedia.cx)
- * For more information about the VP3 coding process, visit:
- * http://multimedia.cx/
- *
- * Theora decoder by Alex Beregszaszi
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "common.h"
-#include "avcodec.h"
-#include "dsputil.h"
-#include "mpegvideo.h"
-
-#include "vp3data.h"
-
-#define FRAGMENT_PIXELS 8
-
-/*
- * Debugging Variables
- *
- * Define one or more of the following compile-time variables to 1 to obtain
- * elaborate information about certain aspects of the decoding process.
- *
- * KEYFRAMES_ONLY: set this to 1 to only see keyframes (VP3 slideshow mode)
- * DEBUG_VP3: high-level decoding flow
- * DEBUG_INIT: initialization parameters
- * DEBUG_DEQUANTIZERS: display how the dequanization tables are built
- * DEBUG_BLOCK_CODING: unpacking the superblock/macroblock/fragment coding
- * DEBUG_MODES: unpacking the coding modes for individual fragments
- * DEBUG_VECTORS: display the motion vectors
- * DEBUG_TOKEN: display exhaustive information about each DCT token
- * DEBUG_VLC: display the VLCs as they are extracted from the stream
- * DEBUG_DC_PRED: display the process of reversing DC prediction
- * DEBUG_IDCT: show every detail of the IDCT process
- */
-
-#define KEYFRAMES_ONLY 0
-
-#define DEBUG_VP3 0
-#define DEBUG_INIT 0
-#define DEBUG_DEQUANTIZERS 0
-#define DEBUG_BLOCK_CODING 0
-#define DEBUG_MODES 0
-#define DEBUG_VECTORS 0
-#define DEBUG_TOKEN 0
-#define DEBUG_VLC 0
-#define DEBUG_DC_PRED 0
-#define DEBUG_IDCT 0
-
-#if DEBUG_VP3
-#define debug_vp3(args...) av_log(NULL, AV_LOG_DEBUG, ## args)
-#else
-static inline void debug_vp3(const char *format, ...) { }
-#endif
-
-#if DEBUG_INIT
-#define debug_init(args...) av_log(NULL, AV_LOG_DEBUG, ## args)
-#else
-static inline void debug_init(const char *format, ...) { }
-#endif
-
-#if DEBUG_DEQUANTIZERS
-#define debug_dequantizers(args...) av_log(NULL, AV_LOG_DEBUG, ## args)
-#else
-static inline void debug_dequantizers(const char *format, ...) { }
-#endif
-
-#if DEBUG_BLOCK_CODING
-#define debug_block_coding(args...) av_log(NULL, AV_LOG_DEBUG, ## args)
-#else
-static inline void debug_block_coding(const char *format, ...) { }
-#endif
-
-#if DEBUG_MODES
-#define debug_modes(args...) av_log(NULL, AV_LOG_DEBUG, ## args)
-#else
-static inline void debug_modes(const char *format, ...) { }
-#endif
-
-#if DEBUG_VECTORS
-#define debug_vectors(args...) av_log(NULL, AV_LOG_DEBUG, ## args)
-#else
-static inline void debug_vectors(const char *format, ...) { }
-#endif
-
-#if DEBUG_TOKEN
-#define debug_token(args...) av_log(NULL, AV_LOG_DEBUG, ## args)
-#else
-static inline void debug_token(const char *format, ...) { }
-#endif
-
-#if DEBUG_VLC
-#define debug_vlc(args...) av_log(NULL, AV_LOG_DEBUG, ## args)
-#else
-static inline void debug_vlc(const char *format, ...) { }
-#endif
-
-#if DEBUG_DC_PRED
-#define debug_dc_pred(args...) av_log(NULL, AV_LOG_DEBUG, ## args)
-#else
-static inline void debug_dc_pred(const char *format, ...) { }
-#endif
-
-#if DEBUG_IDCT
-#define debug_idct(args...) av_log(NULL, AV_LOG_DEBUG, ## args)
-#else
-static inline void debug_idct(const char *format, ...) { }
-#endif
-
-typedef struct Coeff {
- struct Coeff *next;
- DCTELEM coeff;
- uint8_t index;
-} Coeff;
-
-//FIXME split things out into their own arrays
-typedef struct Vp3Fragment {
- Coeff *next_coeff;
- /* address of first pixel taking into account which plane the fragment
- * lives on as well as the plane stride */
- int first_pixel;
- /* this is the macroblock that the fragment belongs to */
- uint16_t macroblock;
- uint8_t coding_method;
- uint8_t coeff_count;
- int8_t motion_x;
- int8_t motion_y;
-} Vp3Fragment;
-
-#define SB_NOT_CODED 0
-#define SB_PARTIALLY_CODED 1
-#define SB_FULLY_CODED 2
-
-#define MODE_INTER_NO_MV 0
-#define MODE_INTRA 1
-#define MODE_INTER_PLUS_MV 2
-#define MODE_INTER_LAST_MV 3
-#define MODE_INTER_PRIOR_LAST 4
-#define MODE_USING_GOLDEN 5
-#define MODE_GOLDEN_MV 6
-#define MODE_INTER_FOURMV 7
-#define CODING_MODE_COUNT 8
-
-/* special internal mode */
-#define MODE_COPY 8
-
-/* There are 6 preset schemes, plus a free-form scheme */
-static int ModeAlphabet[7][CODING_MODE_COUNT] =
-{
- /* this is the custom scheme */
- { 0, 0, 0, 0, 0, 0, 0, 0 },
-
- /* scheme 1: Last motion vector dominates */
- { MODE_INTER_LAST_MV, MODE_INTER_PRIOR_LAST,
- MODE_INTER_PLUS_MV, MODE_INTER_NO_MV,
- MODE_INTRA, MODE_USING_GOLDEN,
- MODE_GOLDEN_MV, MODE_INTER_FOURMV },
-
- /* scheme 2 */
- { MODE_INTER_LAST_MV, MODE_INTER_PRIOR_LAST,
- MODE_INTER_NO_MV, MODE_INTER_PLUS_MV,
- MODE_INTRA, MODE_USING_GOLDEN,
- MODE_GOLDEN_MV, MODE_INTER_FOURMV },
-
- /* scheme 3 */
- { MODE_INTER_LAST_MV, MODE_INTER_PLUS_MV,
- MODE_INTER_PRIOR_LAST, MODE_INTER_NO_MV,
- MODE_INTRA, MODE_USING_GOLDEN,
- MODE_GOLDEN_MV, MODE_INTER_FOURMV },
-
- /* scheme 4 */
- { MODE_INTER_LAST_MV, MODE_INTER_PLUS_MV,
- MODE_INTER_NO_MV, MODE_INTER_PRIOR_LAST,
- MODE_INTRA, MODE_USING_GOLDEN,
- MODE_GOLDEN_MV, MODE_INTER_FOURMV },
-
- /* scheme 5: No motion vector dominates */
- { MODE_INTER_NO_MV, MODE_INTER_LAST_MV,
- MODE_INTER_PRIOR_LAST, MODE_INTER_PLUS_MV,
- MODE_INTRA, MODE_USING_GOLDEN,
- MODE_GOLDEN_MV, MODE_INTER_FOURMV },
-
- /* scheme 6 */
- { MODE_INTER_NO_MV, MODE_USING_GOLDEN,
- MODE_INTER_LAST_MV, MODE_INTER_PRIOR_LAST,
- MODE_INTER_PLUS_MV, MODE_INTRA,
- MODE_GOLDEN_MV, MODE_INTER_FOURMV },
-
-};
-
-#define MIN_DEQUANT_VAL 2
-
-typedef struct Vp3DecodeContext {
- AVCodecContext *avctx;
- int theora, theora_tables;
- int version;
- int width, height;
- AVFrame golden_frame;
- AVFrame last_frame;
- AVFrame current_frame;
- int keyframe;
- DSPContext dsp;
- int flipped_image;
-
- int qis[3];
- int nqis;
- int quality_index;
- int last_quality_index;
-
- int superblock_count;
- int superblock_width;
- int superblock_height;
- int y_superblock_width;
- int y_superblock_height;
- int c_superblock_width;
- int c_superblock_height;
- int u_superblock_start;
- int v_superblock_start;
- unsigned char *superblock_coding;
-
- int macroblock_count;
- int macroblock_width;
- int macroblock_height;
-
- int fragment_count;
- int fragment_width;
- int fragment_height;
-
- Vp3Fragment *all_fragments;
- Coeff *coeffs;
- Coeff *next_coeff;
- int fragment_start[3];
-
- ScanTable scantable;
-
- /* tables */
- uint16_t coded_dc_scale_factor[64];
- uint32_t coded_ac_scale_factor[64];
- uint8_t base_matrix[384][64];
- uint8_t qr_count[2][3];
- uint8_t qr_size [2][3][64];
- uint16_t qr_base[2][3][64];
-
- /* this is a list of indices into the all_fragments array indicating
- * which of the fragments are coded */
- int *coded_fragment_list;
- int coded_fragment_list_index;
- int pixel_addresses_inited;
-
- VLC dc_vlc[16];
- VLC ac_vlc_1[16];
- VLC ac_vlc_2[16];
- VLC ac_vlc_3[16];
- VLC ac_vlc_4[16];
-
- VLC superblock_run_length_vlc;
- VLC fragment_run_length_vlc;
- VLC mode_code_vlc;
- VLC motion_vector_vlc;
-
- /* these arrays need to be on 16-byte boundaries since SSE2 operations
- * index into them */
- DECLARE_ALIGNED_16(int16_t, qmat[2][4][64]); //<qmat[is_inter][plane]
-
- /* This table contains superblock_count * 16 entries. Each set of 16
- * numbers corresponds to the fragment indices 0..15 of the superblock.
- * An entry will be -1 to indicate that no entry corresponds to that
- * index. */
- int *superblock_fragments;
-
- /* This table contains superblock_count * 4 entries. Each set of 4
- * numbers corresponds to the macroblock indices 0..3 of the superblock.
- * An entry will be -1 to indicate that no entry corresponds to that
- * index. */
- int *superblock_macroblocks;
-
- /* This table contains macroblock_count * 6 entries. Each set of 6
- * numbers corresponds to the fragment indices 0..5 which comprise
- * the macroblock (4 Y fragments and 2 C fragments). */
- int *macroblock_fragments;
- /* This is an array that indicates how a particular macroblock
- * is coded. */
- unsigned char *macroblock_coding;
-
- int first_coded_y_fragment;
- int first_coded_c_fragment;
- int last_coded_y_fragment;
- int last_coded_c_fragment;
-
- uint8_t edge_emu_buffer[9*2048]; //FIXME dynamic alloc
- int8_t qscale_table[2048]; //FIXME dynamic alloc (width+15)/16
-
- /* Huffman decode */
- int hti;
- unsigned int hbits;
- int entries;
- int huff_code_size;
- uint16_t huffman_table[80][32][2];
-
- uint32_t filter_limit_values[64];
- int bounding_values_array[256];
-} Vp3DecodeContext;
-
-static int theora_decode_tables(AVCodecContext *avctx, GetBitContext *gb);
-
-/************************************************************************
- * VP3 specific functions
- ************************************************************************/
-
-/*
- * This function sets up all of the various blocks mappings:
- * superblocks <-> fragments, macroblocks <-> fragments,
- * superblocks <-> macroblocks
- *
- * Returns 0 is successful; returns 1 if *anything* went wrong.
- */
-static int init_block_mapping(Vp3DecodeContext *s)
-{
- int i, j;
- signed int hilbert_walk_mb[4];
-
- int current_fragment = 0;
- int current_width = 0;
- int current_height = 0;
- int right_edge = 0;
- int bottom_edge = 0;
- int superblock_row_inc = 0;
- int *hilbert = NULL;
- int mapping_index = 0;
-
- int current_macroblock;
- int c_fragment;
-
- signed char travel_width[16] = {
- 1, 1, 0, -1,
- 0, 0, 1, 0,
- 1, 0, 1, 0,
- 0, -1, 0, 1
- };
-
- signed char travel_height[16] = {
- 0, 0, 1, 0,
- 1, 1, 0, -1,
- 0, 1, 0, -1,
- -1, 0, -1, 0
- };
-
- signed char travel_width_mb[4] = {
- 1, 0, 1, 0
- };
-
- signed char travel_height_mb[4] = {
- 0, 1, 0, -1
- };
-
- debug_vp3(" vp3: initialize block mapping tables\n");
-
- hilbert_walk_mb[0] = 1;
- hilbert_walk_mb[1] = s->macroblock_width;
- hilbert_walk_mb[2] = 1;
- hilbert_walk_mb[3] = -s->macroblock_width;
-
- /* iterate through each superblock (all planes) and map the fragments */
- for (i = 0; i < s->superblock_count; i++) {
- debug_init(" superblock %d (u starts @ %d, v starts @ %d)\n",
- i, s->u_superblock_start, s->v_superblock_start);
-
- /* time to re-assign the limits? */
- if (i == 0) {
-
- /* start of Y superblocks */
- right_edge = s->fragment_width;
- bottom_edge = s->fragment_height;
- current_width = -1;
- current_height = 0;
- superblock_row_inc = 3 * s->fragment_width -
- (s->y_superblock_width * 4 - s->fragment_width);
-
- /* the first operation for this variable is to advance by 1 */
- current_fragment = -1;
-
- } else if (i == s->u_superblock_start) {
-
- /* start of U superblocks */
- right_edge = s->fragment_width / 2;
- bottom_edge = s->fragment_height / 2;
- current_width = -1;
- current_height = 0;
- superblock_row_inc = 3 * (s->fragment_width / 2) -
- (s->c_superblock_width * 4 - s->fragment_width / 2);
-
- /* the first operation for this variable is to advance by 1 */
- current_fragment = s->fragment_start[1] - 1;
-
- } else if (i == s->v_superblock_start) {
-
- /* start of V superblocks */
- right_edge = s->fragment_width / 2;
- bottom_edge = s->fragment_height / 2;
- current_width = -1;
- current_height = 0;
- superblock_row_inc = 3 * (s->fragment_width / 2) -
- (s->c_superblock_width * 4 - s->fragment_width / 2);
-
- /* the first operation for this variable is to advance by 1 */
- current_fragment = s->fragment_start[2] - 1;
-
- }
-
- if (current_width >= right_edge - 1) {
- /* reset width and move to next superblock row */
- current_width = -1;
- current_height += 4;
-
- /* fragment is now at the start of a new superblock row */
- current_fragment += superblock_row_inc;
- }
-
- /* iterate through all 16 fragments in a superblock */
- for (j = 0; j < 16; j++) {
- current_fragment += travel_width[j] + right_edge * travel_height[j];
- current_width += travel_width[j];
- current_height += travel_height[j];
-
- /* check if the fragment is in bounds */
- if ((current_width < right_edge) &&
- (current_height < bottom_edge)) {
- s->superblock_fragments[mapping_index] = current_fragment;
- debug_init(" mapping fragment %d to superblock %d, position %d (%d/%d x %d/%d)\n",
- s->superblock_fragments[mapping_index], i, j,
- current_width, right_edge, current_height, bottom_edge);
- } else {
- s->superblock_fragments[mapping_index] = -1;
- debug_init(" superblock %d, position %d has no fragment (%d/%d x %d/%d)\n",
- i, j,
- current_width, right_edge, current_height, bottom_edge);
- }
-
- mapping_index++;
- }
- }
-
- /* initialize the superblock <-> macroblock mapping; iterate through
- * all of the Y plane superblocks to build this mapping */
- right_edge = s->macroblock_width;
- bottom_edge = s->macroblock_height;
- current_width = -1;
- current_height = 0;
- superblock_row_inc = s->macroblock_width -
- (s->y_superblock_width * 2 - s->macroblock_width);;
- hilbert = hilbert_walk_mb;
- mapping_index = 0;
- current_macroblock = -1;
- for (i = 0; i < s->u_superblock_start; i++) {
-
- if (current_width >= right_edge - 1) {
- /* reset width and move to next superblock row */
- current_width = -1;
- current_height += 2;
-
- /* macroblock is now at the start of a new superblock row */
- current_macroblock += superblock_row_inc;
- }
-
- /* iterate through each potential macroblock in the superblock */
- for (j = 0; j < 4; j++) {
- current_macroblock += hilbert_walk_mb[j];
- current_width += travel_width_mb[j];
- current_height += travel_height_mb[j];
-
- /* check if the macroblock is in bounds */
- if ((current_width < right_edge) &&
- (current_height < bottom_edge)) {
- s->superblock_macroblocks[mapping_index] = current_macroblock;
- debug_init(" mapping macroblock %d to superblock %d, position %d (%d/%d x %d/%d)\n",
- s->superblock_macroblocks[mapping_index], i, j,
- current_width, right_edge, current_height, bottom_edge);
- } else {
- s->superblock_macroblocks[mapping_index] = -1;
- debug_init(" superblock %d, position %d has no macroblock (%d/%d x %d/%d)\n",
- i, j,
- current_width, right_edge, current_height, bottom_edge);
- }
-
- mapping_index++;
- }
- }
-
- /* initialize the macroblock <-> fragment mapping */
- current_fragment = 0;
- current_macroblock = 0;
- mapping_index = 0;
- for (i = 0; i < s->fragment_height; i += 2) {
-
- for (j = 0; j < s->fragment_width; j += 2) {
-
- debug_init(" macroblock %d contains fragments: ", current_macroblock);
- s->all_fragments[current_fragment].macroblock = current_macroblock;
- s->macroblock_fragments[mapping_index++] = current_fragment;
- debug_init("%d ", current_fragment);
-
- if (j + 1 < s->fragment_width) {
- s->all_fragments[current_fragment + 1].macroblock = current_macroblock;
- s->macroblock_fragments[mapping_index++] = current_fragment + 1;
- debug_init("%d ", current_fragment + 1);
- } else
- s->macroblock_fragments[mapping_index++] = -1;
-
- if (i + 1 < s->fragment_height) {
- s->all_fragments[current_fragment + s->fragment_width].macroblock =
- current_macroblock;
- s->macroblock_fragments[mapping_index++] =
- current_fragment + s->fragment_width;
- debug_init("%d ", current_fragment + s->fragment_width);
- } else
- s->macroblock_fragments[mapping_index++] = -1;
-
- if ((j + 1 < s->fragment_width) && (i + 1 < s->fragment_height)) {
- s->all_fragments[current_fragment + s->fragment_width + 1].macroblock =
- current_macroblock;
- s->macroblock_fragments[mapping_index++] =
- current_fragment + s->fragment_width + 1;
- debug_init("%d ", current_fragment + s->fragment_width + 1);
- } else
- s->macroblock_fragments[mapping_index++] = -1;
-
- /* C planes */
- c_fragment = s->fragment_start[1] +
- (i * s->fragment_width / 4) + (j / 2);
- s->all_fragments[c_fragment].macroblock = s->macroblock_count;
- s->macroblock_fragments[mapping_index++] = c_fragment;
- debug_init("%d ", c_fragment);
-
- c_fragment = s->fragment_start[2] +
- (i * s->fragment_width / 4) + (j / 2);
- s->all_fragments[c_fragment].macroblock = s->macroblock_count;
- s->macroblock_fragments[mapping_index++] = c_fragment;
- debug_init("%d ", c_fragment);
-
- debug_init("\n");
-
- if (j + 2 <= s->fragment_width)
- current_fragment += 2;
- else
- current_fragment++;
- current_macroblock++;
- }
-
- current_fragment += s->fragment_width;
- }
-
- return 0; /* successful path out */
-}
-
-/*
- * This function wipes out all of the fragment data.
- */
-static void init_frame(Vp3DecodeContext *s, GetBitContext *gb)
-{
- int i;
-
- /* zero out all of the fragment information */
- s->coded_fragment_list_index = 0;
- for (i = 0; i < s->fragment_count; i++) {
- s->all_fragments[i].coeff_count = 0;
- s->all_fragments[i].motion_x = 127;
- s->all_fragments[i].motion_y = 127;
- s->all_fragments[i].next_coeff= NULL;
- s->coeffs[i].index=
- s->coeffs[i].coeff=0;
- s->coeffs[i].next= NULL;
- }
-}
-
-/*
- * This function sets up the dequantization tables used for a particular
- * frame.
- */
-static void init_dequantizer(Vp3DecodeContext *s)
-{
- int ac_scale_factor = s->coded_ac_scale_factor[s->quality_index];
- int dc_scale_factor = s->coded_dc_scale_factor[s->quality_index];
- int i, plane, inter, qri, bmi, bmj, qistart;
-
- debug_vp3(" vp3: initializing dequantization tables\n");
-
- for(inter=0; inter<2; inter++){
- for(plane=0; plane<3; plane++){
- int sum=0;
- for(qri=0; qri<s->qr_count[inter][plane]; qri++){
- sum+= s->qr_size[inter][plane][qri];
- if(s->quality_index <= sum)
- break;
- }
- qistart= sum - s->qr_size[inter][plane][qri];
- bmi= s->qr_base[inter][plane][qri ];
- bmj= s->qr_base[inter][plane][qri+1];
- for(i=0; i<64; i++){
- int coeff= ( 2*(sum -s->quality_index)*s->base_matrix[bmi][i]
- - 2*(qistart-s->quality_index)*s->base_matrix[bmj][i]
- + s->qr_size[inter][plane][qri])
- / (2*s->qr_size[inter][plane][qri]);
-
- int qmin= 8<<(inter + !i);
- int qscale= i ? ac_scale_factor : dc_scale_factor;
-
- s->qmat[inter][plane][i]= clip((qscale * coeff)/100 * 4, qmin, 4096);
- }
- }
- }
-
- memset(s->qscale_table, (FFMAX(s->qmat[0][0][1], s->qmat[0][1][1])+8)/16, 512); //FIXME finetune
-}
-
-/*
- * This function initializes the loop filter boundary limits if the frame's
- * quality index is different from the previous frame's.
- */
-static void init_loop_filter(Vp3DecodeContext *s)
-{
- int *bounding_values= s->bounding_values_array+127;
- int filter_limit;
- int x;
-
- filter_limit = s->filter_limit_values[s->quality_index];
-
- /* set up the bounding values */
- memset(s->bounding_values_array, 0, 256 * sizeof(int));
- for (x = 0; x < filter_limit; x++) {
- bounding_values[-x - filter_limit] = -filter_limit + x;
- bounding_values[-x] = -x;
- bounding_values[x] = x;
- bounding_values[x + filter_limit] = filter_limit - x;
- }
-}
-
-/*
- * This function unpacks all of the superblock/macroblock/fragment coding
- * information from the bitstream.
- */
-static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb)
-{
- int bit = 0;
- int current_superblock = 0;
- int current_run = 0;
- int decode_fully_flags = 0;
- int decode_partial_blocks = 0;
- int first_c_fragment_seen;
-
- int i, j;
- int current_fragment;
-
- debug_vp3(" vp3: unpacking superblock coding\n");
-
- if (s->keyframe) {
-
- debug_vp3(" keyframe-- all superblocks are fully coded\n");
- memset(s->superblock_coding, SB_FULLY_CODED, s->superblock_count);
-
- } else {
-
- /* unpack the list of partially-coded superblocks */
- bit = get_bits(gb, 1);
- /* toggle the bit because as soon as the first run length is
- * fetched the bit will be toggled again */
- bit ^= 1;
- while (current_superblock < s->superblock_count) {
- if (current_run-- == 0) {
- bit ^= 1;
- current_run = get_vlc2(gb,
- s->superblock_run_length_vlc.table, 6, 2);
- if (current_run == 33)
- current_run += get_bits(gb, 12);
- debug_block_coding(" setting superblocks %d..%d to %s\n",
- current_superblock,
- current_superblock + current_run - 1,
- (bit) ? "partially coded" : "not coded");
-
- /* if any of the superblocks are not partially coded, flag
- * a boolean to decode the list of fully-coded superblocks */
- if (bit == 0) {
- decode_fully_flags = 1;
- } else {
-
- /* make a note of the fact that there are partially coded
- * superblocks */
- decode_partial_blocks = 1;
- }
- }
- s->superblock_coding[current_superblock++] = bit;
- }
-
- /* unpack the list of fully coded superblocks if any of the blocks were
- * not marked as partially coded in the previous step */
- if (decode_fully_flags) {
-
- current_superblock = 0;
- current_run = 0;
- bit = get_bits(gb, 1);
- /* toggle the bit because as soon as the first run length is
- * fetched the bit will be toggled again */
- bit ^= 1;
- while (current_superblock < s->superblock_count) {
-
- /* skip any superblocks already marked as partially coded */
- if (s->superblock_coding[current_superblock] == SB_NOT_CODED) {
-
- if (current_run-- == 0) {
- bit ^= 1;
- current_run = get_vlc2(gb,
- s->superblock_run_length_vlc.table, 6, 2);
- if (current_run == 33)
- current_run += get_bits(gb, 12);
- }
-
- debug_block_coding(" setting superblock %d to %s\n",
- current_superblock,
- (bit) ? "fully coded" : "not coded");
- s->superblock_coding[current_superblock] = 2*bit;
- }
- current_superblock++;
- }
- }
-
- /* if there were partial blocks, initialize bitstream for
- * unpacking fragment codings */
- if (decode_partial_blocks) {
-
- current_run = 0;
- bit = get_bits(gb, 1);
- /* toggle the bit because as soon as the first run length is
- * fetched the bit will be toggled again */
- bit ^= 1;
- }
- }
-
- /* figure out which fragments are coded; iterate through each
- * superblock (all planes) */
- s->coded_fragment_list_index = 0;
- s->next_coeff= s->coeffs + s->fragment_count;
- s->first_coded_y_fragment = s->first_coded_c_fragment = 0;
- s->last_coded_y_fragment = s->last_coded_c_fragment = -1;
- first_c_fragment_seen = 0;
- memset(s->macroblock_coding, MODE_COPY, s->macroblock_count);
- for (i = 0; i < s->superblock_count; i++) {
-
- /* iterate through all 16 fragments in a superblock */
- for (j = 0; j < 16; j++) {
-
- /* if the fragment is in bounds, check its coding status */
- current_fragment = s->superblock_fragments[i * 16 + j];
- if (current_fragment >= s->fragment_count) {
- av_log(s->avctx, AV_LOG_ERROR, " vp3:unpack_superblocks(): bad fragment number (%d >= %d)\n",
- current_fragment, s->fragment_count);
- return 1;
- }
- if (current_fragment != -1) {
- if (s->superblock_coding[i] == SB_NOT_CODED) {
-
- /* copy all the fragments from the prior frame */
- s->all_fragments[current_fragment].coding_method =
- MODE_COPY;
-
- } else if (s->superblock_coding[i] == SB_PARTIALLY_CODED) {
-
- /* fragment may or may not be coded; this is the case
- * that cares about the fragment coding runs */
- if (current_run-- == 0) {
- bit ^= 1;
- current_run = get_vlc2(gb,
- s->fragment_run_length_vlc.table, 5, 2);
- }
-
- if (bit) {
- /* default mode; actual mode will be decoded in
- * the next phase */
- s->all_fragments[current_fragment].coding_method =
- MODE_INTER_NO_MV;
- s->all_fragments[current_fragment].next_coeff= s->coeffs + current_fragment;
- s->coded_fragment_list[s->coded_fragment_list_index] =
- current_fragment;
- if ((current_fragment >= s->fragment_start[1]) &&
- (s->last_coded_y_fragment == -1) &&
- (!first_c_fragment_seen)) {
- s->first_coded_c_fragment = s->coded_fragment_list_index;
- s->last_coded_y_fragment = s->first_coded_c_fragment - 1;
- first_c_fragment_seen = 1;
- }
- s->coded_fragment_list_index++;
- s->macroblock_coding[s->all_fragments[current_fragment].macroblock] = MODE_INTER_NO_MV;
- debug_block_coding(" superblock %d is partially coded, fragment %d is coded\n",
- i, current_fragment);
- } else {
- /* not coded; copy this fragment from the prior frame */
- s->all_fragments[current_fragment].coding_method =
- MODE_COPY;
- debug_block_coding(" superblock %d is partially coded, fragment %d is not coded\n",
- i, current_fragment);
- }
-
- } else {
-
- /* fragments are fully coded in this superblock; actual
- * coding will be determined in next step */
- s->all_fragments[current_fragment].coding_method =
- MODE_INTER_NO_MV;
- s->all_fragments[current_fragment].next_coeff= s->coeffs + current_fragment;
- s->coded_fragment_list[s->coded_fragment_list_index] =
- current_fragment;
- if ((current_fragment >= s->fragment_start[1]) &&
- (s->last_coded_y_fragment == -1) &&
- (!first_c_fragment_seen)) {
- s->first_coded_c_fragment = s->coded_fragment_list_index;
- s->last_coded_y_fragment = s->first_coded_c_fragment - 1;
- first_c_fragment_seen = 1;
- }
- s->coded_fragment_list_index++;
- s->macroblock_coding[s->all_fragments[current_fragment].macroblock] = MODE_INTER_NO_MV;
- debug_block_coding(" superblock %d is fully coded, fragment %d is coded\n",
- i, current_fragment);
- }
- }
- }
- }
-
- if (!first_c_fragment_seen)
- /* only Y fragments coded in this frame */
- s->last_coded_y_fragment = s->coded_fragment_list_index - 1;
- else
- /* end the list of coded C fragments */
- s->last_coded_c_fragment = s->coded_fragment_list_index - 1;
-
- debug_block_coding(" %d total coded fragments, y: %d -> %d, c: %d -> %d\n",
- s->coded_fragment_list_index,
- s->first_coded_y_fragment,
- s->last_coded_y_fragment,
- s->first_coded_c_fragment,
- s->last_coded_c_fragment);
-
- return 0;
-}
-
-/*
- * This function unpacks all the coding mode data for individual macroblocks
- * from the bitstream.
- */
-static int unpack_modes(Vp3DecodeContext *s, GetBitContext *gb)
-{
- int i, j, k;
- int scheme;
- int current_macroblock;
- int current_fragment;
- int coding_mode;
-
- debug_vp3(" vp3: unpacking encoding modes\n");
-
- if (s->keyframe) {
- debug_vp3(" keyframe-- all blocks are coded as INTRA\n");
-
- for (i = 0; i < s->fragment_count; i++)
- s->all_fragments[i].coding_method = MODE_INTRA;
-
- } else {
-
- /* fetch the mode coding scheme for this frame */
- scheme = get_bits(gb, 3);
- debug_modes(" using mode alphabet %d\n", scheme);
-
- /* is it a custom coding scheme? */
- if (scheme == 0) {
- debug_modes(" custom mode alphabet ahead:\n");
- for (i = 0; i < 8; i++)
- ModeAlphabet[scheme][get_bits(gb, 3)] = i;
- }
-
- for (i = 0; i < 8; i++)
- debug_modes(" mode[%d][%d] = %d\n", scheme, i,
- ModeAlphabet[scheme][i]);
-
- /* iterate through all of the macroblocks that contain 1 or more
- * coded fragments */
- for (i = 0; i < s->u_superblock_start; i++) {
-
- for (j = 0; j < 4; j++) {
- current_macroblock = s->superblock_macroblocks[i * 4 + j];
- if ((current_macroblock == -1) ||
- (s->macroblock_coding[current_macroblock] == MODE_COPY))
- continue;
- if (current_macroblock >= s->macroblock_count) {
- av_log(s->avctx, AV_LOG_ERROR, " vp3:unpack_modes(): bad macroblock number (%d >= %d)\n",
- current_macroblock, s->macroblock_count);
- return 1;
- }
-
- /* mode 7 means get 3 bits for each coding mode */
- if (scheme == 7)
- coding_mode = get_bits(gb, 3);
- else
- coding_mode = ModeAlphabet[scheme]
- [get_vlc2(gb, s->mode_code_vlc.table, 3, 3)];
-
- s->macroblock_coding[current_macroblock] = coding_mode;
- for (k = 0; k < 6; k++) {
- current_fragment =
- s->macroblock_fragments[current_macroblock * 6 + k];
- if (current_fragment == -1)
- continue;
- if (current_fragment >= s->fragment_count) {
- av_log(s->avctx, AV_LOG_ERROR, " vp3:unpack_modes(): bad fragment number (%d >= %d)\n",
- current_fragment, s->fragment_count);
- return 1;
- }
- if (s->all_fragments[current_fragment].coding_method !=
- MODE_COPY)
- s->all_fragments[current_fragment].coding_method =
- coding_mode;
- }
-
- debug_modes(" coding method for macroblock starting @ fragment %d = %d\n",
- s->macroblock_fragments[current_macroblock * 6], coding_mode);
- }
- }
- }
-
- return 0;
-}
-
-/*
- * This function unpacks all the motion vectors for the individual
- * macroblocks from the bitstream.
- */
-static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb)
-{
- int i, j, k;
- int coding_mode;
- int motion_x[6];
- int motion_y[6];
- int last_motion_x = 0;
- int last_motion_y = 0;
- int prior_last_motion_x = 0;
- int prior_last_motion_y = 0;
- int current_macroblock;
- int current_fragment;
-
- debug_vp3(" vp3: unpacking motion vectors\n");
- if (s->keyframe) {
-
- debug_vp3(" keyframe-- there are no motion vectors\n");
-
- } else {
-
- memset(motion_x, 0, 6 * sizeof(int));
- memset(motion_y, 0, 6 * sizeof(int));
-
- /* coding mode 0 is the VLC scheme; 1 is the fixed code scheme */
- coding_mode = get_bits(gb, 1);
- debug_vectors(" using %s scheme for unpacking motion vectors\n",
- (coding_mode == 0) ? "VLC" : "fixed-length");
-
- /* iterate through all of the macroblocks that contain 1 or more
- * coded fragments */
- for (i = 0; i < s->u_superblock_start; i++) {
-
- for (j = 0; j < 4; j++) {
- current_macroblock = s->superblock_macroblocks[i * 4 + j];
- if ((current_macroblock == -1) ||
- (s->macroblock_coding[current_macroblock] == MODE_COPY))
- continue;
- if (current_macroblock >= s->macroblock_count) {
- av_log(s->avctx, AV_LOG_ERROR, " vp3:unpack_vectors(): bad macroblock number (%d >= %d)\n",
- current_macroblock, s->macroblock_count);
- return 1;
- }
-
- current_fragment = s->macroblock_fragments[current_macroblock * 6];
- if (current_fragment >= s->fragment_count) {
- av_log(s->avctx, AV_LOG_ERROR, " vp3:unpack_vectors(): bad fragment number (%d >= %d\n",
- current_fragment, s->fragment_count);
- return 1;
- }
- switch (s->macroblock_coding[current_macroblock]) {
-
- case MODE_INTER_PLUS_MV:
- case MODE_GOLDEN_MV:
- /* all 6 fragments use the same motion vector */
- if (coding_mode == 0) {
- motion_x[0] = motion_vector_table[get_vlc2(gb, s->motion_vector_vlc.table, 6, 2)];
- motion_y[0] = motion_vector_table[get_vlc2(gb, s->motion_vector_vlc.table, 6, 2)];
- } else {
- motion_x[0] = fixed_motion_vector_table[get_bits(gb, 6)];
- motion_y[0] = fixed_motion_vector_table[get_bits(gb, 6)];
- }
-
- for (k = 1; k < 6; k++) {
- motion_x[k] = motion_x[0];
- motion_y[k] = motion_y[0];
- }
-
- /* vector maintenance, only on MODE_INTER_PLUS_MV */
- if (s->macroblock_coding[current_macroblock] ==
- MODE_INTER_PLUS_MV) {
- prior_last_motion_x = last_motion_x;
- prior_last_motion_y = last_motion_y;
- last_motion_x = motion_x[0];
- last_motion_y = motion_y[0];
- }
- break;
-
- case MODE_INTER_FOURMV:
- /* fetch 4 vectors from the bitstream, one for each
- * Y fragment, then average for the C fragment vectors */
- motion_x[4] = motion_y[4] = 0;
- for (k = 0; k < 4; k++) {
- if (coding_mode == 0) {
- motion_x[k] = motion_vector_table[get_vlc2(gb, s->motion_vector_vlc.table, 6, 2)];
- motion_y[k] = motion_vector_table[get_vlc2(gb, s->motion_vector_vlc.table, 6, 2)];
- } else {
- motion_x[k] = fixed_motion_vector_table[get_bits(gb, 6)];
- motion_y[k] = fixed_motion_vector_table[get_bits(gb, 6)];
- }
- motion_x[4] += motion_x[k];
- motion_y[4] += motion_y[k];
- }
-
- motion_x[5]=
- motion_x[4]= RSHIFT(motion_x[4], 2);
- motion_y[5]=
- motion_y[4]= RSHIFT(motion_y[4], 2);
-
- /* vector maintenance; vector[3] is treated as the
- * last vector in this case */
- prior_last_motion_x = last_motion_x;
- prior_last_motion_y = last_motion_y;
- last_motion_x = motion_x[3];
- last_motion_y = motion_y[3];
- break;
-
- case MODE_INTER_LAST_MV:
- /* all 6 fragments use the last motion vector */
- motion_x[0] = last_motion_x;
- motion_y[0] = last_motion_y;
- for (k = 1; k < 6; k++) {
- motion_x[k] = motion_x[0];
- motion_y[k] = motion_y[0];
- }
-
- /* no vector maintenance (last vector remains the
- * last vector) */
- break;
-
- case MODE_INTER_PRIOR_LAST:
- /* all 6 fragments use the motion vector prior to the
- * last motion vector */
- motion_x[0] = prior_last_motion_x;
- motion_y[0] = prior_last_motion_y;
- for (k = 1; k < 6; k++) {
- motion_x[k] = motion_x[0];
- motion_y[k] = motion_y[0];
- }
-
- /* vector maintenance */
- prior_last_motion_x = last_motion_x;
- prior_last_motion_y = last_motion_y;
- last_motion_x = motion_x[0];
- last_motion_y = motion_y[0];
- break;
-
- default:
- /* covers intra, inter without MV, golden without MV */
- memset(motion_x, 0, 6 * sizeof(int));
- memset(motion_y, 0, 6 * sizeof(int));
-
- /* no vector maintenance */
- break;
- }
-
- /* assign the motion vectors to the correct fragments */
- debug_vectors(" vectors for macroblock starting @ fragment %d (coding method %d):\n",
- current_fragment,
- s->macroblock_coding[current_macroblock]);
- for (k = 0; k < 6; k++) {
- current_fragment =
- s->macroblock_fragments[current_macroblock * 6 + k];
- if (current_fragment == -1)
- continue;
- if (current_fragment >= s->fragment_count) {
- av_log(s->avctx, AV_LOG_ERROR, " vp3:unpack_vectors(): bad fragment number (%d >= %d)\n",
- current_fragment, s->fragment_count);
- return 1;
- }
- s->all_fragments[current_fragment].motion_x = motion_x[k];
- s->all_fragments[current_fragment].motion_y = motion_y[k];
- debug_vectors(" vector %d: fragment %d = (%d, %d)\n",
- k, current_fragment, motion_x[k], motion_y[k]);
- }
- }
- }
- }
-
- return 0;
-}
-
-/*
- * This function is called by unpack_dct_coeffs() to extract the VLCs from
- * the bitstream. The VLCs encode tokens which are used to unpack DCT
- * data. This function unpacks all the VLCs for either the Y plane or both
- * C planes, and is called for DC coefficients or different AC coefficient
- * levels (since different coefficient types require different VLC tables.
- *
- * This function returns a residual eob run. E.g, if a particular token gave
- * instructions to EOB the next 5 fragments and there were only 2 fragments
- * left in the current fragment range, 3 would be returned so that it could
- * be passed into the next call to this same function.
- */
-static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb,
- VLC *table, int coeff_index,
- int first_fragment, int last_fragment,
- int eob_run)
-{
- int i;
- int token;
- int zero_run = 0;
- DCTELEM coeff = 0;
- Vp3Fragment *fragment;
- uint8_t *perm= s->scantable.permutated;
- int bits_to_get;
-
- if ((first_fragment >= s->fragment_count) ||
- (last_fragment >= s->fragment_count)) {
-
- av_log(s->avctx, AV_LOG_ERROR, " vp3:unpack_vlcs(): bad fragment number (%d -> %d ?)\n",
- first_fragment, last_fragment);
- return 0;
- }
-
- for (i = first_fragment; i <= last_fragment; i++) {
-
- fragment = &s->all_fragments[s->coded_fragment_list[i]];
- if (fragment->coeff_count > coeff_index)
- continue;
-
- if (!eob_run) {
- /* decode a VLC into a token */
- token = get_vlc2(gb, table->table, 5, 3);
- debug_vlc(" token = %2d, ", token);
- /* use the token to get a zero run, a coefficient, and an eob run */
- if (token <= 6) {
- eob_run = eob_run_base[token];
- if (eob_run_get_bits[token])
- eob_run += get_bits(gb, eob_run_get_bits[token]);
- coeff = zero_run = 0;
- } else {
- bits_to_get = coeff_get_bits[token];
- if (!bits_to_get)
- coeff = coeff_tables[token][0];
- else
- coeff = coeff_tables[token][get_bits(gb, bits_to_get)];
-
- zero_run = zero_run_base[token];
- if (zero_run_get_bits[token])
- zero_run += get_bits(gb, zero_run_get_bits[token]);
- }
- }
-
- if (!eob_run) {
- fragment->coeff_count += zero_run;
- if (fragment->coeff_count < 64){
- fragment->next_coeff->coeff= coeff;
- fragment->next_coeff->index= perm[fragment->coeff_count++]; //FIXME perm here already?
- fragment->next_coeff->next= s->next_coeff;
- s->next_coeff->next=NULL;
- fragment->next_coeff= s->next_coeff++;
- }
- debug_vlc(" fragment %d coeff = %d\n",
- s->coded_fragment_list[i], fragment->next_coeff[coeff_index]);
- } else {
- fragment->coeff_count |= 128;
- debug_vlc(" fragment %d eob with %d coefficients\n",
- s->coded_fragment_list[i], fragment->coeff_count&127);
- eob_run--;
- }
- }
-
- return eob_run;
-}
-
-/*
- * This function unpacks all of the DCT coefficient data from the
- * bitstream.
- */
-static int unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb)
-{
- int i;
- int dc_y_table;
- int dc_c_table;
- int ac_y_table;
- int ac_c_table;
- int residual_eob_run = 0;
-
- /* fetch the DC table indices */
- dc_y_table = get_bits(gb, 4);
- dc_c_table = get_bits(gb, 4);
-
- /* unpack the Y plane DC coefficients */
- debug_vp3(" vp3: unpacking Y plane DC coefficients using table %d\n",
- dc_y_table);
- residual_eob_run = unpack_vlcs(s, gb, &s->dc_vlc[dc_y_table], 0,
- s->first_coded_y_fragment, s->last_coded_y_fragment, residual_eob_run);
-
- /* unpack the C plane DC coefficients */
- debug_vp3(" vp3: unpacking C plane DC coefficients using table %d\n",
- dc_c_table);
- residual_eob_run = unpack_vlcs(s, gb, &s->dc_vlc[dc_c_table], 0,
- s->first_coded_c_fragment, s->last_coded_c_fragment, residual_eob_run);
-
- /* fetch the AC table indices */
- ac_y_table = get_bits(gb, 4);
- ac_c_table = get_bits(gb, 4);
-
- /* unpack the group 1 AC coefficients (coeffs 1-5) */
- for (i = 1; i <= 5; i++) {
-
- debug_vp3(" vp3: unpacking level %d Y plane AC coefficients using table %d\n",
- i, ac_y_table);
- residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_1[ac_y_table], i,
- s->first_coded_y_fragment, s->last_coded_y_fragment, residual_eob_run);
-
- debug_vp3(" vp3: unpacking level %d C plane AC coefficients using table %d\n",
- i, ac_c_table);
- residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_1[ac_c_table], i,
- s->first_coded_c_fragment, s->last_coded_c_fragment, residual_eob_run);
- }
-
- /* unpack the group 2 AC coefficients (coeffs 6-14) */
- for (i = 6; i <= 14; i++) {
-
- debug_vp3(" vp3: unpacking level %d Y plane AC coefficients using table %d\n",
- i, ac_y_table);
- residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_2[ac_y_table], i,
- s->first_coded_y_fragment, s->last_coded_y_fragment, residual_eob_run);
-
- debug_vp3(" vp3: unpacking level %d C plane AC coefficients using table %d\n",
- i, ac_c_table);
- residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_2[ac_c_table], i,
- s->first_coded_c_fragment, s->last_coded_c_fragment, residual_eob_run);
- }
-
- /* unpack the group 3 AC coefficients (coeffs 15-27) */
- for (i = 15; i <= 27; i++) {
-
- debug_vp3(" vp3: unpacking level %d Y plane AC coefficients using table %d\n",
- i, ac_y_table);
- residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_3[ac_y_table], i,
- s->first_coded_y_fragment, s->last_coded_y_fragment, residual_eob_run);
-
- debug_vp3(" vp3: unpacking level %d C plane AC coefficients using table %d\n",
- i, ac_c_table);
- residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_3[ac_c_table], i,
- s->first_coded_c_fragment, s->last_coded_c_fragment, residual_eob_run);
- }
-
- /* unpack the group 4 AC coefficients (coeffs 28-63) */
- for (i = 28; i <= 63; i++) {
-
- debug_vp3(" vp3: unpacking level %d Y plane AC coefficients using table %d\n",
- i, ac_y_table);
- residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_4[ac_y_table], i,
- s->first_coded_y_fragment, s->last_coded_y_fragment, residual_eob_run);
-
- debug_vp3(" vp3: unpacking level %d C plane AC coefficients using table %d\n",
- i, ac_c_table);
- residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_4[ac_c_table], i,
- s->first_coded_c_fragment, s->last_coded_c_fragment, residual_eob_run);
- }
-
- return 0;
-}
-
-/*
- * This function reverses the DC prediction for each coded fragment in
- * the frame. Much of this function is adapted directly from the original
- * VP3 source code.
- */
-#define COMPATIBLE_FRAME(x) \
- (compatible_frame[s->all_fragments[x].coding_method] == current_frame_type)
-#define FRAME_CODED(x) (s->all_fragments[x].coding_method != MODE_COPY)
-#define DC_COEFF(u) (s->coeffs[u].index ? 0 : s->coeffs[u].coeff) //FIXME do somethin to simplify this
-
-static void reverse_dc_prediction(Vp3DecodeContext *s,
- int first_fragment,
- int fragment_width,
- int fragment_height)
-{
-
-#define PUL 8
-#define PU 4
-#define PUR 2
-#define PL 1
-
- int x, y;
- int i = first_fragment;
-
- int predicted_dc;
-
- /* DC values for the left, up-left, up, and up-right fragments */
- int vl, vul, vu, vur;
-
- /* indices for the left, up-left, up, and up-right fragments */
- int l, ul, u, ur;
-
- /*
- * The 6 fields mean:
- * 0: up-left multiplier
- * 1: up multiplier
- * 2: up-right multiplier
- * 3: left multiplier
- */
- int predictor_transform[16][4] = {
- { 0, 0, 0, 0},
- { 0, 0, 0,128}, // PL
- { 0, 0,128, 0}, // PUR
- { 0, 0, 53, 75}, // PUR|PL
- { 0,128, 0, 0}, // PU
- { 0, 64, 0, 64}, // PU|PL
- { 0,128, 0, 0}, // PU|PUR
- { 0, 0, 53, 75}, // PU|PUR|PL
- {128, 0, 0, 0}, // PUL
- { 0, 0, 0,128}, // PUL|PL
- { 64, 0, 64, 0}, // PUL|PUR
- { 0, 0, 53, 75}, // PUL|PUR|PL
- { 0,128, 0, 0}, // PUL|PU
- {-104,116, 0,116}, // PUL|PU|PL
- { 24, 80, 24, 0}, // PUL|PU|PUR
- {-104,116, 0,116} // PUL|PU|PUR|PL
- };
-
- /* This table shows which types of blocks can use other blocks for
- * prediction. For example, INTRA is the only mode in this table to
- * have a frame number of 0. That means INTRA blocks can only predict
- * from other INTRA blocks. There are 2 golden frame coding types;
- * blocks encoding in these modes can only predict from other blocks
- * that were encoded with these 1 of these 2 modes. */
- unsigned char compatible_frame[8] = {
- 1, /* MODE_INTER_NO_MV */
- 0, /* MODE_INTRA */
- 1, /* MODE_INTER_PLUS_MV */
- 1, /* MODE_INTER_LAST_MV */
- 1, /* MODE_INTER_PRIOR_MV */
- 2, /* MODE_USING_GOLDEN */
- 2, /* MODE_GOLDEN_MV */
- 1 /* MODE_INTER_FOUR_MV */
- };
- int current_frame_type;
-
- /* there is a last DC predictor for each of the 3 frame types */
- short last_dc[3];
-
- int transform = 0;
-
- debug_vp3(" vp3: reversing DC prediction\n");
-
- vul = vu = vur = vl = 0;
- last_dc[0] = last_dc[1] = last_dc[2] = 0;
-
- /* for each fragment row... */
- for (y = 0; y < fragment_height; y++) {
-
- /* for each fragment in a row... */
- for (x = 0; x < fragment_width; x++, i++) {
-
- /* reverse prediction if this block was coded */
- if (s->all_fragments[i].coding_method != MODE_COPY) {
-
- current_frame_type =
- compatible_frame[s->all_fragments[i].coding_method];
- debug_dc_pred(" frag %d: orig DC = %d, ",
- i, DC_COEFF(i));
-
- transform= 0;
- if(x){
- l= i-1;
- vl = DC_COEFF(l);
- if(FRAME_CODED(l) && COMPATIBLE_FRAME(l))
- transform |= PL;
- }
- if(y){
- u= i-fragment_width;
- vu = DC_COEFF(u);
- if(FRAME_CODED(u) && COMPATIBLE_FRAME(u))
- transform |= PU;
- if(x){
- ul= i-fragment_width-1;
- vul = DC_COEFF(ul);
- if(FRAME_CODED(ul) && COMPATIBLE_FRAME(ul))
- transform |= PUL;
- }
- if(x + 1 < fragment_width){
- ur= i-fragment_width+1;
- vur = DC_COEFF(ur);
- if(FRAME_CODED(ur) && COMPATIBLE_FRAME(ur))
- transform |= PUR;
- }
- }
-
- debug_dc_pred("transform = %d, ", transform);
-
- if (transform == 0) {
-
- /* if there were no fragments to predict from, use last
- * DC saved */
- predicted_dc = last_dc[current_frame_type];
- debug_dc_pred("from last DC (%d) = %d\n",
- current_frame_type, DC_COEFF(i));
-
- } else {
-
- /* apply the appropriate predictor transform */
- predicted_dc =
- (predictor_transform[transform][0] * vul) +
- (predictor_transform[transform][1] * vu) +
- (predictor_transform[transform][2] * vur) +
- (predictor_transform[transform][3] * vl);
-
- predicted_dc /= 128;
-
- /* check for outranging on the [ul u l] and
- * [ul u ur l] predictors */
- if ((transform == 13) || (transform == 15)) {
- if (FFABS(predicted_dc - vu) > 128)
- predicted_dc = vu;
- else if (FFABS(predicted_dc - vl) > 128)
- predicted_dc = vl;
- else if (FFABS(predicted_dc - vul) > 128)
- predicted_dc = vul;
- }
-
- debug_dc_pred("from pred DC = %d\n",
- DC_COEFF(i));
- }
-
- /* at long last, apply the predictor */
- if(s->coeffs[i].index){
- *s->next_coeff= s->coeffs[i];
- s->coeffs[i].index=0;
- s->coeffs[i].coeff=0;
- s->coeffs[i].next= s->next_coeff++;
- }
- s->coeffs[i].coeff += predicted_dc;
- /* save the DC */
- last_dc[current_frame_type] = DC_COEFF(i);
- if(DC_COEFF(i) && !(s->all_fragments[i].coeff_count&127)){
- s->all_fragments[i].coeff_count= 129;
-// s->all_fragments[i].next_coeff= s->next_coeff;
- s->coeffs[i].next= s->next_coeff;
- (s->next_coeff++)->next=NULL;
- }
- }
- }
- }
-}
-
-
-static void horizontal_filter(unsigned char *first_pixel, int stride,
- int *bounding_values);
-static void vertical_filter(unsigned char *first_pixel, int stride,
- int *bounding_values);
-
-/*
- * Perform the final rendering for a particular slice of data.
- * The slice number ranges from 0..(macroblock_height - 1).
- */
-static void render_slice(Vp3DecodeContext *s, int slice)
-{
- int x;
- int m, n;
- int16_t *dequantizer;
- DECLARE_ALIGNED_16(DCTELEM, block[64]);
- int motion_x = 0xdeadbeef, motion_y = 0xdeadbeef;
- int motion_halfpel_index;
- uint8_t *motion_source;
- int plane;
- int current_macroblock_entry = slice * s->macroblock_width * 6;
-
- if (slice >= s->macroblock_height)
- return;
-
- for (plane = 0; plane < 3; plane++) {
- uint8_t *output_plane = s->current_frame.data [plane];
- uint8_t * last_plane = s-> last_frame.data [plane];
- uint8_t *golden_plane = s-> golden_frame.data [plane];
- int stride = s->current_frame.linesize[plane];
- int plane_width = s->width >> !!plane;
- int plane_height = s->height >> !!plane;
- int y = slice * FRAGMENT_PIXELS << !plane ;
- int slice_height = y + (FRAGMENT_PIXELS << !plane);
- int i = s->macroblock_fragments[current_macroblock_entry + plane + 3*!!plane];
-
- if (!s->flipped_image) stride = -stride;
-
-
- if(FFABS(stride) > 2048)
- return; //various tables are fixed size
-
- /* for each fragment row in the slice (both of them)... */
- for (; y < slice_height; y += 8) {
-
- /* for each fragment in a row... */
- for (x = 0; x < plane_width; x += 8, i++) {
-
- if ((i < 0) || (i >= s->fragment_count)) {
- av_log(s->avctx, AV_LOG_ERROR, " vp3:render_slice(): bad fragment number (%d)\n", i);
- return;
- }
-
- /* transform if this block was coded */
- if ((s->all_fragments[i].coding_method != MODE_COPY) &&
- !((s->avctx->flags & CODEC_FLAG_GRAY) && plane)) {
-
- if ((s->all_fragments[i].coding_method == MODE_USING_GOLDEN) ||
- (s->all_fragments[i].coding_method == MODE_GOLDEN_MV))
- motion_source= golden_plane;
- else
- motion_source= last_plane;
-
- motion_source += s->all_fragments[i].first_pixel;
- motion_halfpel_index = 0;
-
- /* sort out the motion vector if this fragment is coded
- * using a motion vector method */
- if ((s->all_fragments[i].coding_method > MODE_INTRA) &&
- (s->all_fragments[i].coding_method != MODE_USING_GOLDEN)) {
- int src_x, src_y;
- motion_x = s->all_fragments[i].motion_x;
- motion_y = s->all_fragments[i].motion_y;
- if(plane){
- motion_x= (motion_x>>1) | (motion_x&1);
- motion_y= (motion_y>>1) | (motion_y&1);
- }
-
- src_x= (motion_x>>1) + x;
- src_y= (motion_y>>1) + y;
- if ((motion_x == 127) || (motion_y == 127))
- av_log(s->avctx, AV_LOG_ERROR, " help! got invalid motion vector! (%X, %X)\n", motion_x, motion_y);
-
- motion_halfpel_index = motion_x & 0x01;
- motion_source += (motion_x >> 1);
-
- motion_halfpel_index |= (motion_y & 0x01) << 1;
- motion_source += ((motion_y >> 1) * stride);
-
- if(src_x<0 || src_y<0 || src_x + 9 >= plane_width || src_y + 9 >= plane_height){
- uint8_t *temp= s->edge_emu_buffer;
- if(stride<0) temp -= 9*stride;
- else temp += 9*stride;
-
- ff_emulated_edge_mc(temp, motion_source, stride, 9, 9, src_x, src_y, plane_width, plane_height);
- motion_source= temp;
- }
- }
-
-
- /* first, take care of copying a block from either the
- * previous or the golden frame */
- if (s->all_fragments[i].coding_method != MODE_INTRA) {
- /* Note, it is possible to implement all MC cases with
- put_no_rnd_pixels_l2 which would look more like the
- VP3 source but this would be slower as
- put_no_rnd_pixels_tab is better optimzed */
- if(motion_halfpel_index != 3){
- s->dsp.put_no_rnd_pixels_tab[1][motion_halfpel_index](
- output_plane + s->all_fragments[i].first_pixel,
- motion_source, stride, 8);
- }else{
- int d= (motion_x ^ motion_y)>>31; // d is 0 if motion_x and _y have the same sign, else -1
- s->dsp.put_no_rnd_pixels_l2[1](
- output_plane + s->all_fragments[i].first_pixel,
- motion_source - d,
- motion_source + stride + 1 + d,
- stride, 8);
- }
- dequantizer = s->qmat[1][plane];
- }else{
- dequantizer = s->qmat[0][plane];
- }
-
- /* dequantize the DCT coefficients */
- debug_idct("fragment %d, coding mode %d, DC = %d, dequant = %d:\n",
- i, s->all_fragments[i].coding_method,
- DC_COEFF(i), dequantizer[0]);
-
- if(s->avctx->idct_algo==FF_IDCT_VP3){
- Coeff *coeff= s->coeffs + i;
- memset(block, 0, sizeof(block));
- while(coeff->next){
- block[coeff->index]= coeff->coeff * dequantizer[coeff->index];
- coeff= coeff->next;
- }
- }else{
- Coeff *coeff= s->coeffs + i;
- memset(block, 0, sizeof(block));
- while(coeff->next){
- block[coeff->index]= (coeff->coeff * dequantizer[coeff->index] + 2)>>2;
- coeff= coeff->next;
- }
- }
-
- /* invert DCT and place (or add) in final output */
-
- if (s->all_fragments[i].coding_method == MODE_INTRA) {
- if(s->avctx->idct_algo!=FF_IDCT_VP3)
- block[0] += 128<<3;
- s->dsp.idct_put(
- output_plane + s->all_fragments[i].first_pixel,
- stride,
- block);
- } else {
- s->dsp.idct_add(
- output_plane + s->all_fragments[i].first_pixel,
- stride,
- block);
- }
-
- debug_idct("block after idct_%s():\n",
- (s->all_fragments[i].coding_method == MODE_INTRA)?
- "put" : "add");
- for (m = 0; m < 8; m++) {
- for (n = 0; n < 8; n++) {
- debug_idct(" %3d", *(output_plane +
- s->all_fragments[i].first_pixel + (m * stride + n)));
- }
- debug_idct("\n");
- }
- debug_idct("\n");
-
- } else {
-
- /* copy directly from the previous frame */
- s->dsp.put_pixels_tab[1][0](
- output_plane + s->all_fragments[i].first_pixel,
- last_plane + s->all_fragments[i].first_pixel,
- stride, 8);
-
- }
-#if 0
- /* perform the left edge filter if:
- * - the fragment is not on the left column
- * - the fragment is coded in this frame
- * - the fragment is not coded in this frame but the left
- * fragment is coded in this frame (this is done instead
- * of a right edge filter when rendering the left fragment
- * since this fragment is not available yet) */
- if ((x > 0) &&
- ((s->all_fragments[i].coding_method != MODE_COPY) ||
- ((s->all_fragments[i].coding_method == MODE_COPY) &&
- (s->all_fragments[i - 1].coding_method != MODE_COPY)) )) {
- horizontal_filter(
- output_plane + s->all_fragments[i].first_pixel + 7*stride,
- -stride, s->bounding_values_array + 127);
- }
-
- /* perform the top edge filter if:
- * - the fragment is not on the top row
- * - the fragment is coded in this frame
- * - the fragment is not coded in this frame but the above
- * fragment is coded in this frame (this is done instead
- * of a bottom edge filter when rendering the above
- * fragment since this fragment is not available yet) */
- if ((y > 0) &&
- ((s->all_fragments[i].coding_method != MODE_COPY) ||
- ((s->all_fragments[i].coding_method == MODE_COPY) &&
- (s->all_fragments[i - fragment_width].coding_method != MODE_COPY)) )) {
- vertical_filter(
- output_plane + s->all_fragments[i].first_pixel - stride,
- -stride, s->bounding_values_array + 127);
- }
-#endif
- }
- }
- }
-
- /* this looks like a good place for slice dispatch... */
- /* algorithm:
- * if (slice == s->macroblock_height - 1)
- * dispatch (both last slice & 2nd-to-last slice);
- * else if (slice > 0)
- * dispatch (slice - 1);
- */
-
- emms_c();
-}
-
-static void horizontal_filter(unsigned char *first_pixel, int stride,
- int *bounding_values)
-{
- unsigned char *end;
- int filter_value;
-
- for (end= first_pixel + 8*stride; first_pixel != end; first_pixel += stride) {
- filter_value =
- (first_pixel[-2] - first_pixel[ 1])
- +3*(first_pixel[ 0] - first_pixel[-1]);
- filter_value = bounding_values[(filter_value + 4) >> 3];
- first_pixel[-1] = clip_uint8(first_pixel[-1] + filter_value);
- first_pixel[ 0] = clip_uint8(first_pixel[ 0] - filter_value);
- }
-}
-
-static void vertical_filter(unsigned char *first_pixel, int stride,
- int *bounding_values)
-{
- unsigned char *end;
- int filter_value;
- const int nstride= -stride;
-
- for (end= first_pixel + 8; first_pixel < end; first_pixel++) {
- filter_value =
- (first_pixel[2 * nstride] - first_pixel[ stride])
- +3*(first_pixel[0 ] - first_pixel[nstride]);
- filter_value = bounding_values[(filter_value + 4) >> 3];
- first_pixel[nstride] = clip_uint8(first_pixel[nstride] + filter_value);
- first_pixel[0] = clip_uint8(first_pixel[0] - filter_value);
- }
-}
-
-static void apply_loop_filter(Vp3DecodeContext *s)
-{
- int plane;
- int x, y;
- int *bounding_values= s->bounding_values_array+127;
-
-#if 0
- int bounding_values_array[256];
- int filter_limit;
-
- /* find the right loop limit value */
- for (x = 63; x >= 0; x--) {
- if (vp31_ac_scale_factor[x] >= s->quality_index)
- break;
- }
- filter_limit = vp31_filter_limit_values[s->quality_index];
-
- /* set up the bounding values */
- memset(bounding_values_array, 0, 256 * sizeof(int));
- for (x = 0; x < filter_limit; x++) {
- bounding_values[-x - filter_limit] = -filter_limit + x;
- bounding_values[-x] = -x;
- bounding_values[x] = x;
- bounding_values[x + filter_limit] = filter_limit - x;
- }
-#endif
-
- for (plane = 0; plane < 3; plane++) {
- int width = s->fragment_width >> !!plane;
- int height = s->fragment_height >> !!plane;
- int fragment = s->fragment_start [plane];
- int stride = s->current_frame.linesize[plane];
- uint8_t *plane_data = s->current_frame.data [plane];
- if (!s->flipped_image) stride = -stride;
-
- for (y = 0; y < height; y++) {
-
- for (x = 0; x < width; x++) {
-START_TIMER
- /* do not perform left edge filter for left columns frags */
- if ((x > 0) &&
- (s->all_fragments[fragment].coding_method != MODE_COPY)) {
- horizontal_filter(
- plane_data + s->all_fragments[fragment].first_pixel,
- stride, bounding_values);
- }
-
- /* do not perform top edge filter for top row fragments */
- if ((y > 0) &&
- (s->all_fragments[fragment].coding_method != MODE_COPY)) {
- vertical_filter(
- plane_data + s->all_fragments[fragment].first_pixel,
- stride, bounding_values);
- }
-
- /* do not perform right edge filter for right column
- * fragments or if right fragment neighbor is also coded
- * in this frame (it will be filtered in next iteration) */
- if ((x < width - 1) &&
- (s->all_fragments[fragment].coding_method != MODE_COPY) &&
- (s->all_fragments[fragment + 1].coding_method == MODE_COPY)) {
- horizontal_filter(
- plane_data + s->all_fragments[fragment + 1].first_pixel,
- stride, bounding_values);
- }
-
- /* do not perform bottom edge filter for bottom row
- * fragments or if bottom fragment neighbor is also coded
- * in this frame (it will be filtered in the next row) */
- if ((y < height - 1) &&
- (s->all_fragments[fragment].coding_method != MODE_COPY) &&
- (s->all_fragments[fragment + width].coding_method == MODE_COPY)) {
- vertical_filter(
- plane_data + s->all_fragments[fragment + width].first_pixel,
- stride, bounding_values);
- }
-
- fragment++;
-STOP_TIMER("loop filter")
- }
- }
- }
-}
-
-/*
- * This function computes the first pixel addresses for each fragment.
- * This function needs to be invoked after the first frame is allocated
- * so that it has access to the plane strides.
- */
-static void vp3_calculate_pixel_addresses(Vp3DecodeContext *s)
-{
-
- int i, x, y;
-
- /* figure out the first pixel addresses for each of the fragments */
- /* Y plane */
- i = 0;
- for (y = s->fragment_height; y > 0; y--) {
- for (x = 0; x < s->fragment_width; x++) {
- s->all_fragments[i++].first_pixel =
- s->golden_frame.linesize[0] * y * FRAGMENT_PIXELS -
- s->golden_frame.linesize[0] +
- x * FRAGMENT_PIXELS;
- debug_init(" fragment %d, first pixel @ %d\n",
- i-1, s->all_fragments[i-1].first_pixel);
- }
- }
-
- /* U plane */
- i = s->fragment_start[1];
- for (y = s->fragment_height / 2; y > 0; y--) {
- for (x = 0; x < s->fragment_width / 2; x++) {
- s->all_fragments[i++].first_pixel =
- s->golden_frame.linesize[1] * y * FRAGMENT_PIXELS -
- s->golden_frame.linesize[1] +
- x * FRAGMENT_PIXELS;
- debug_init(" fragment %d, first pixel @ %d\n",
- i-1, s->all_fragments[i-1].first_pixel);
- }
- }
-
- /* V plane */
- i = s->fragment_start[2];
- for (y = s->fragment_height / 2; y > 0; y--) {
- for (x = 0; x < s->fragment_width / 2; x++) {
- s->all_fragments[i++].first_pixel =
- s->golden_frame.linesize[2] * y * FRAGMENT_PIXELS -
- s->golden_frame.linesize[2] +
- x * FRAGMENT_PIXELS;
- debug_init(" fragment %d, first pixel @ %d\n",
- i-1, s->all_fragments[i-1].first_pixel);
- }
- }
-}
-
-/* FIXME: this should be merged with the above! */
-static void theora_calculate_pixel_addresses(Vp3DecodeContext *s)
-{
-
- int i, x, y;
-
- /* figure out the first pixel addresses for each of the fragments */
- /* Y plane */
- i = 0;
- for (y = 1; y <= s->fragment_height; y++) {
- for (x = 0; x < s->fragment_width; x++) {
- s->all_fragments[i++].first_pixel =
- s->golden_frame.linesize[0] * y * FRAGMENT_PIXELS -
- s->golden_frame.linesize[0] +
- x * FRAGMENT_PIXELS;
- debug_init(" fragment %d, first pixel @ %d\n",
- i-1, s->all_fragments[i-1].first_pixel);
- }
- }
-
- /* U plane */
- i = s->fragment_start[1];
- for (y = 1; y <= s->fragment_height / 2; y++) {
- for (x = 0; x < s->fragment_width / 2; x++) {
- s->all_fragments[i++].first_pixel =
- s->golden_frame.linesize[1] * y * FRAGMENT_PIXELS -
- s->golden_frame.linesize[1] +
- x * FRAGMENT_PIXELS;
- debug_init(" fragment %d, first pixel @ %d\n",
- i-1, s->all_fragments[i-1].first_pixel);
- }
- }
-
- /* V plane */
- i = s->fragment_start[2];
- for (y = 1; y <= s->fragment_height / 2; y++) {
- for (x = 0; x < s->fragment_width / 2; x++) {
- s->all_fragments[i++].first_pixel =
- s->golden_frame.linesize[2] * y * FRAGMENT_PIXELS -
- s->golden_frame.linesize[2] +
- x * FRAGMENT_PIXELS;
- debug_init(" fragment %d, first pixel @ %d\n",
- i-1, s->all_fragments[i-1].first_pixel);
- }
- }
-}
-
-/*
- * This is the ffmpeg/libavcodec API init function.
- */
-static int vp3_decode_init(AVCodecContext *avctx)
-{
- Vp3DecodeContext *s = avctx->priv_data;
- int i, inter, plane;
- int c_width;
- int c_height;
- int y_superblock_count;
- int c_superblock_count;
-
- if (avctx->codec_tag == MKTAG('V','P','3','0'))
- s->version = 0;
- else
- s->version = 1;
-
- s->avctx = avctx;
- s->width = (avctx->width + 15) & 0xFFFFFFF0;
- s->height = (avctx->height + 15) & 0xFFFFFFF0;
- avctx->pix_fmt = PIX_FMT_YUV420P;
- avctx->has_b_frames = 0;
- if(avctx->idct_algo==FF_IDCT_AUTO)
- avctx->idct_algo=FF_IDCT_VP3;
- dsputil_init(&s->dsp, avctx);
-
- ff_init_scantable(s->dsp.idct_permutation, &s->scantable, ff_zigzag_direct);
-
- /* initialize to an impossible value which will force a recalculation
- * in the first frame decode */
- s->quality_index = -1;
-
- s->y_superblock_width = (s->width + 31) / 32;
- s->y_superblock_height = (s->height + 31) / 32;
- y_superblock_count = s->y_superblock_width * s->y_superblock_height;
-
- /* work out the dimensions for the C planes */
- c_width = s->width / 2;
- c_height = s->height / 2;
- s->c_superblock_width = (c_width + 31) / 32;
- s->c_superblock_height = (c_height + 31) / 32;
- c_superblock_count = s->c_superblock_width * s->c_superblock_height;
-
- s->superblock_count = y_superblock_count + (c_superblock_count * 2);
- s->u_superblock_start = y_superblock_count;
- s->v_superblock_start = s->u_superblock_start + c_superblock_count;
- s->superblock_coding = av_malloc(s->superblock_count);
-
- s->macroblock_width = (s->width + 15) / 16;
- s->macroblock_height = (s->height + 15) / 16;
- s->macroblock_count = s->macroblock_width * s->macroblock_height;
-
- s->fragment_width = s->width / FRAGMENT_PIXELS;
- s->fragment_height = s->height / FRAGMENT_PIXELS;
-
- /* fragment count covers all 8x8 blocks for all 3 planes */
- s->fragment_count = s->fragment_width * s->fragment_height * 3 / 2;
- s->fragment_start[1] = s->fragment_width * s->fragment_height;
- s->fragment_start[2] = s->fragment_width * s->fragment_height * 5 / 4;
-
- debug_init(" Y plane: %d x %d\n", s->width, s->height);
- debug_init(" C plane: %d x %d\n", c_width, c_height);
- debug_init(" Y superblocks: %d x %d, %d total\n",
- s->y_superblock_width, s->y_superblock_height, y_superblock_count);
- debug_init(" C superblocks: %d x %d, %d total\n",
- s->c_superblock_width, s->c_superblock_height, c_superblock_count);
- debug_init(" total superblocks = %d, U starts @ %d, V starts @ %d\n",
- s->superblock_count, s->u_superblock_start, s->v_superblock_start);
- debug_init(" macroblocks: %d x %d, %d total\n",
- s->macroblock_width, s->macroblock_height, s->macroblock_count);
- debug_init(" %d fragments, %d x %d, u starts @ %d, v starts @ %d\n",
- s->fragment_count,
- s->fragment_width,
- s->fragment_height,
- s->fragment_start[1],
- s->fragment_start[2]);
-
- s->all_fragments = av_malloc(s->fragment_count * sizeof(Vp3Fragment));
- s->coeffs = av_malloc(s->fragment_count * sizeof(Coeff) * 65);
- s->coded_fragment_list = av_malloc(s->fragment_count * sizeof(int));
- s->pixel_addresses_inited = 0;
-
- if (!s->theora_tables)
- {
- for (i = 0; i < 64; i++) {
- s->coded_dc_scale_factor[i] = vp31_dc_scale_factor[i];
- s->coded_ac_scale_factor[i] = vp31_ac_scale_factor[i];
- s->base_matrix[0][i] = vp31_intra_y_dequant[i];
- s->base_matrix[1][i] = vp31_intra_c_dequant[i];
- s->base_matrix[2][i] = vp31_inter_dequant[i];
- s->filter_limit_values[i] = vp31_filter_limit_values[i];
- }
-
- for(inter=0; inter<2; inter++){
- for(plane=0; plane<3; plane++){
- s->qr_count[inter][plane]= 1;
- s->qr_size [inter][plane][0]= 63;
- s->qr_base [inter][plane][0]=
- s->qr_base [inter][plane][1]= 2*inter + (!!plane)*!inter;
- }
- }
-
- /* init VLC tables */
- for (i = 0; i < 16; i++) {
-
- /* DC histograms */
- init_vlc(&s->dc_vlc[i], 5, 32,
- &dc_bias[i][0][1], 4, 2,
- &dc_bias[i][0][0], 4, 2, 0);
-
- /* group 1 AC histograms */
- init_vlc(&s->ac_vlc_1[i], 5, 32,
- &ac_bias_0[i][0][1], 4, 2,
- &ac_bias_0[i][0][0], 4, 2, 0);
-
- /* group 2 AC histograms */
- init_vlc(&s->ac_vlc_2[i], 5, 32,
- &ac_bias_1[i][0][1], 4, 2,
- &ac_bias_1[i][0][0], 4, 2, 0);
-
- /* group 3 AC histograms */
- init_vlc(&s->ac_vlc_3[i], 5, 32,
- &ac_bias_2[i][0][1], 4, 2,
- &ac_bias_2[i][0][0], 4, 2, 0);
-
- /* group 4 AC histograms */
- init_vlc(&s->ac_vlc_4[i], 5, 32,
- &ac_bias_3[i][0][1], 4, 2,
- &ac_bias_3[i][0][0], 4, 2, 0);
- }
- } else {
- for (i = 0; i < 16; i++) {
-
- /* DC histograms */
- init_vlc(&s->dc_vlc[i], 5, 32,
- &s->huffman_table[i][0][1], 4, 2,
- &s->huffman_table[i][0][0], 4, 2, 0);
-
- /* group 1 AC histograms */
- init_vlc(&s->ac_vlc_1[i], 5, 32,
- &s->huffman_table[i+16][0][1], 4, 2,
- &s->huffman_table[i+16][0][0], 4, 2, 0);
-
- /* group 2 AC histograms */
- init_vlc(&s->ac_vlc_2[i], 5, 32,
- &s->huffman_table[i+16*2][0][1], 4, 2,
- &s->huffman_table[i+16*2][0][0], 4, 2, 0);
-
- /* group 3 AC histograms */
- init_vlc(&s->ac_vlc_3[i], 5, 32,
- &s->huffman_table[i+16*3][0][1], 4, 2,
- &s->huffman_table[i+16*3][0][0], 4, 2, 0);
-
- /* group 4 AC histograms */
- init_vlc(&s->ac_vlc_4[i], 5, 32,
- &s->huffman_table[i+16*4][0][1], 4, 2,
- &s->huffman_table[i+16*4][0][0], 4, 2, 0);
- }
- }
-
- init_vlc(&s->superblock_run_length_vlc, 6, 34,
- &superblock_run_length_vlc_table[0][1], 4, 2,
- &superblock_run_length_vlc_table[0][0], 4, 2, 0);
-
- init_vlc(&s->fragment_run_length_vlc, 5, 30,
- &fragment_run_length_vlc_table[0][1], 4, 2,
- &fragment_run_length_vlc_table[0][0], 4, 2, 0);
-
- init_vlc(&s->mode_code_vlc, 3, 8,
- &mode_code_vlc_table[0][1], 2, 1,
- &mode_code_vlc_table[0][0], 2, 1, 0);
-
- init_vlc(&s->motion_vector_vlc, 6, 63,
- &motion_vector_vlc_table[0][1], 2, 1,
- &motion_vector_vlc_table[0][0], 2, 1, 0);
-
- /* work out the block mapping tables */
- s->superblock_fragments = av_malloc(s->superblock_count * 16 * sizeof(int));
- s->superblock_macroblocks = av_malloc(s->superblock_count * 4 * sizeof(int));
- s->macroblock_fragments = av_malloc(s->macroblock_count * 6 * sizeof(int));
- s->macroblock_coding = av_malloc(s->macroblock_count + 1);
- init_block_mapping(s);
-
- for (i = 0; i < 3; i++) {
- s->current_frame.data[i] = NULL;
- s->last_frame.data[i] = NULL;
- s->golden_frame.data[i] = NULL;
- }
-
- return 0;
-}
-
-/*
- * This is the ffmpeg/libavcodec API frame decode function.
- */
-static int vp3_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- Vp3DecodeContext *s = avctx->priv_data;
- GetBitContext gb;
- static int counter = 0;
- int i;
-
- init_get_bits(&gb, buf, buf_size * 8);
-
- if (s->theora && get_bits1(&gb))
- {
-#if 1
- av_log(avctx, AV_LOG_ERROR, "Header packet passed to frame decoder, skipping\n");
- return -1;
-#else
- int ptype = get_bits(&gb, 7);
-
- skip_bits(&gb, 6*8); /* "theora" */
-
- switch(ptype)
- {
- case 1:
- theora_decode_comments(avctx, &gb);
- break;
- case 2:
- theora_decode_tables(avctx, &gb);
- init_dequantizer(s);
- break;
- default:
- av_log(avctx, AV_LOG_ERROR, "Unknown Theora config packet: %d\n", ptype);
- }
- return buf_size;
-#endif
- }
-
- s->keyframe = !get_bits1(&gb);
- if (!s->theora)
- skip_bits(&gb, 1);
- s->last_quality_index = s->quality_index;
-
- s->nqis=0;
- do{
- s->qis[s->nqis++]= get_bits(&gb, 6);
- } while(s->theora >= 0x030200 && s->nqis<3 && get_bits1(&gb));
-
- s->quality_index= s->qis[0];
-
- if (s->avctx->debug & FF_DEBUG_PICT_INFO)
- av_log(s->avctx, AV_LOG_INFO, " VP3 %sframe #%d: Q index = %d\n",
- s->keyframe?"key":"", counter, s->quality_index);
- counter++;
-
- if (s->quality_index != s->last_quality_index) {
- init_dequantizer(s);
- init_loop_filter(s);
- }
-
- if (s->keyframe) {
- if (!s->theora)
- {
- skip_bits(&gb, 4); /* width code */
- skip_bits(&gb, 4); /* height code */
- if (s->version)
- {
- s->version = get_bits(&gb, 5);
- if (counter == 1)
- av_log(s->avctx, AV_LOG_DEBUG, "VP version: %d\n", s->version);
- }
- }
- if (s->version || s->theora)
- {
- if (get_bits1(&gb))
- av_log(s->avctx, AV_LOG_ERROR, "Warning, unsupported keyframe coding type?!\n");
- skip_bits(&gb, 2); /* reserved? */
- }
-
- if (s->last_frame.data[0] == s->golden_frame.data[0]) {
- if (s->golden_frame.data[0])
- avctx->release_buffer(avctx, &s->golden_frame);
- s->last_frame= s->golden_frame; /* ensure that we catch any access to this released frame */
- } else {
- if (s->golden_frame.data[0])
- avctx->release_buffer(avctx, &s->golden_frame);
- if (s->last_frame.data[0])
- avctx->release_buffer(avctx, &s->last_frame);
- }
-
- s->golden_frame.reference = 3;
- if(avctx->get_buffer(avctx, &s->golden_frame) < 0) {
- av_log(s->avctx, AV_LOG_ERROR, "vp3: get_buffer() failed\n");
- return -1;
- }
-
- /* golden frame is also the current frame */
- s->current_frame= s->golden_frame;
-
- /* time to figure out pixel addresses? */
- if (!s->pixel_addresses_inited)
- {
- if (!s->flipped_image)
- vp3_calculate_pixel_addresses(s);
- else
- theora_calculate_pixel_addresses(s);
- s->pixel_addresses_inited = 1;
- }
- } else {
- /* allocate a new current frame */
- s->current_frame.reference = 3;
- if (!s->pixel_addresses_inited) {
- av_log(s->avctx, AV_LOG_ERROR, "vp3: first frame not a keyframe\n");
- return -1;
- }
- if(avctx->get_buffer(avctx, &s->current_frame) < 0) {
- av_log(s->avctx, AV_LOG_ERROR, "vp3: get_buffer() failed\n");
- return -1;
- }
- }
-
- s->current_frame.qscale_table= s->qscale_table; //FIXME allocate individual tables per AVFrame
- s->current_frame.qstride= 0;
-
- {START_TIMER
- init_frame(s, &gb);
- STOP_TIMER("init_frame")}
-
-#if KEYFRAMES_ONLY
-if (!s->keyframe) {
-
- memcpy(s->current_frame.data[0], s->golden_frame.data[0],
- s->current_frame.linesize[0] * s->height);
- memcpy(s->current_frame.data[1], s->golden_frame.data[1],
- s->current_frame.linesize[1] * s->height / 2);
- memcpy(s->current_frame.data[2], s->golden_frame.data[2],
- s->current_frame.linesize[2] * s->height / 2);
-
-} else {
-#endif
-
- {START_TIMER
- if (unpack_superblocks(s, &gb)){
- av_log(s->avctx, AV_LOG_ERROR, "error in unpack_superblocks\n");
- return -1;
- }
- STOP_TIMER("unpack_superblocks")}
- {START_TIMER
- if (unpack_modes(s, &gb)){
- av_log(s->avctx, AV_LOG_ERROR, "error in unpack_modes\n");
- return -1;
- }
- STOP_TIMER("unpack_modes")}
- {START_TIMER
- if (unpack_vectors(s, &gb)){
- av_log(s->avctx, AV_LOG_ERROR, "error in unpack_vectors\n");
- return -1;
- }
- STOP_TIMER("unpack_vectors")}
- {START_TIMER
- if (unpack_dct_coeffs(s, &gb)){
- av_log(s->avctx, AV_LOG_ERROR, "error in unpack_dct_coeffs\n");
- return -1;
- }
- STOP_TIMER("unpack_dct_coeffs")}
- {START_TIMER
-
- reverse_dc_prediction(s, 0, s->fragment_width, s->fragment_height);
- if ((avctx->flags & CODEC_FLAG_GRAY) == 0) {
- reverse_dc_prediction(s, s->fragment_start[1],
- s->fragment_width / 2, s->fragment_height / 2);
- reverse_dc_prediction(s, s->fragment_start[2],
- s->fragment_width / 2, s->fragment_height / 2);
- }
- STOP_TIMER("reverse_dc_prediction")}
- {START_TIMER
-
- for (i = 0; i < s->macroblock_height; i++)
- render_slice(s, i);
- STOP_TIMER("render_fragments")}
-
- {START_TIMER
- apply_loop_filter(s);
- STOP_TIMER("apply_loop_filter")}
-#if KEYFRAMES_ONLY
-}
-#endif
-
- *data_size=sizeof(AVFrame);
- *(AVFrame*)data= s->current_frame;
-
- /* release the last frame, if it is allocated and if it is not the
- * golden frame */
- if ((s->last_frame.data[0]) &&
- (s->last_frame.data[0] != s->golden_frame.data[0]))
- avctx->release_buffer(avctx, &s->last_frame);
-
- /* shuffle frames (last = current) */
- s->last_frame= s->current_frame;
- s->current_frame.data[0]= NULL; /* ensure that we catch any access to this released frame */
-
- return buf_size;
-}
-
-/*
- * This is the ffmpeg/libavcodec API module cleanup function.
- */
-static int vp3_decode_end(AVCodecContext *avctx)
-{
- Vp3DecodeContext *s = avctx->priv_data;
-
- av_free(s->all_fragments);
- av_free(s->coeffs);
- av_free(s->coded_fragment_list);
- av_free(s->superblock_fragments);
- av_free(s->superblock_macroblocks);
- av_free(s->macroblock_fragments);
- av_free(s->macroblock_coding);
-
- /* release all frames */
- if (s->golden_frame.data[0] && s->golden_frame.data[0] != s->last_frame.data[0])
- avctx->release_buffer(avctx, &s->golden_frame);
- if (s->last_frame.data[0])
- avctx->release_buffer(avctx, &s->last_frame);
- /* no need to release the current_frame since it will always be pointing
- * to the same frame as either the golden or last frame */
-
- return 0;
-}
-
-static int read_huffman_tree(AVCodecContext *avctx, GetBitContext *gb)
-{
- Vp3DecodeContext *s = avctx->priv_data;
-
- if (get_bits(gb, 1)) {
- int token;
- if (s->entries >= 32) { /* overflow */
- av_log(avctx, AV_LOG_ERROR, "huffman tree overflow\n");
- return -1;
- }
- token = get_bits(gb, 5);
- //av_log(avctx, AV_LOG_DEBUG, "hti %d hbits %x token %d entry : %d size %d\n", s->hti, s->hbits, token, s->entries, s->huff_code_size);
- s->huffman_table[s->hti][token][0] = s->hbits;
- s->huffman_table[s->hti][token][1] = s->huff_code_size;
- s->entries++;
- }
- else {
- if (s->huff_code_size >= 32) {/* overflow */
- av_log(avctx, AV_LOG_ERROR, "huffman tree overflow\n");
- return -1;
- }
- s->huff_code_size++;
- s->hbits <<= 1;
- read_huffman_tree(avctx, gb);
- s->hbits |= 1;
- read_huffman_tree(avctx, gb);
- s->hbits >>= 1;
- s->huff_code_size--;
- }
- return 0;
-}
-
-static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb)
-{
- Vp3DecodeContext *s = avctx->priv_data;
-
- s->theora = get_bits_long(gb, 24);
- av_log(avctx, AV_LOG_INFO, "Theora bitstream version %X\n", s->theora);
-
- /* 3.2.0 aka alpha3 has the same frame orientation as original vp3 */
- /* but previous versions have the image flipped relative to vp3 */
- if (s->theora < 0x030200)
- {
- s->flipped_image = 1;
- av_log(avctx, AV_LOG_DEBUG, "Old (<alpha3) Theora bitstream, flipped image\n");
- }
-
- s->width = get_bits(gb, 16) << 4;
- s->height = get_bits(gb, 16) << 4;
-
- if(avcodec_check_dimensions(avctx, s->width, s->height)){
- av_log(avctx, AV_LOG_ERROR, "Invalid dimensions (%dx%d)\n", s->width, s->height);
- s->width= s->height= 0;
- return -1;
- }
-
- if (s->theora >= 0x030400)
- {
- skip_bits(gb, 32); /* total number of superblocks in a frame */
- // fixme, the next field is 36bits long
- skip_bits(gb, 32); /* total number of blocks in a frame */
- skip_bits(gb, 4); /* total number of blocks in a frame */
- skip_bits(gb, 32); /* total number of macroblocks in a frame */
-
- skip_bits(gb, 24); /* frame width */
- skip_bits(gb, 24); /* frame height */
- }
- else
- {
- skip_bits(gb, 24); /* frame width */
- skip_bits(gb, 24); /* frame height */
- }
-
- if (s->theora >= 0x030200) {
- skip_bits(gb, 8); /* offset x */
- skip_bits(gb, 8); /* offset y */
- }
-
- skip_bits(gb, 32); /* fps numerator */
- skip_bits(gb, 32); /* fps denumerator */
- skip_bits(gb, 24); /* aspect numerator */
- skip_bits(gb, 24); /* aspect denumerator */
-
- if (s->theora < 0x030200)
- skip_bits(gb, 5); /* keyframe frequency force */
- skip_bits(gb, 8); /* colorspace */
- if (s->theora >= 0x030400)
- skip_bits(gb, 2); /* pixel format: 420,res,422,444 */
- skip_bits(gb, 24); /* bitrate */
-
- skip_bits(gb, 6); /* quality hint */
-
- if (s->theora >= 0x030200)
- {
- skip_bits(gb, 5); /* keyframe frequency force */
-
- if (s->theora < 0x030400)
- skip_bits(gb, 5); /* spare bits */
- }
-
-// align_get_bits(gb);
-
- avctx->width = s->width;
- avctx->height = s->height;
-
- return 0;
-}
-
-static int theora_decode_tables(AVCodecContext *avctx, GetBitContext *gb)
-{
- Vp3DecodeContext *s = avctx->priv_data;
- int i, n, matrices, inter, plane;
-
- if (s->theora >= 0x030200) {
- n = get_bits(gb, 3);
- /* loop filter limit values table */
- for (i = 0; i < 64; i++)
- s->filter_limit_values[i] = get_bits(gb, n);
- }
-
- if (s->theora >= 0x030200)
- n = get_bits(gb, 4) + 1;
- else
- n = 16;
- /* quality threshold table */
- for (i = 0; i < 64; i++)
- s->coded_ac_scale_factor[i] = get_bits(gb, n);
-
- if (s->theora >= 0x030200)
- n = get_bits(gb, 4) + 1;
- else
- n = 16;
- /* dc scale factor table */
- for (i = 0; i < 64; i++)
- s->coded_dc_scale_factor[i] = get_bits(gb, n);
-
- if (s->theora >= 0x030200)
- matrices = get_bits(gb, 9) + 1;
- else
- matrices = 3;
-
- if(matrices > 384){
- av_log(avctx, AV_LOG_ERROR, "invalid number of base matrixes\n");
- return -1;
- }
-
- for(n=0; n<matrices; n++){
- for (i = 0; i < 64; i++)
- s->base_matrix[n][i]= get_bits(gb, 8);
- }
-
- for (inter = 0; inter <= 1; inter++) {
- for (plane = 0; plane <= 2; plane++) {
- int newqr= 1;
- if (inter || plane > 0)
- newqr = get_bits(gb, 1);
- if (!newqr) {
- int qtj, plj;
- if(inter && get_bits(gb, 1)){
- qtj = 0;
- plj = plane;
- }else{
- qtj= (3*inter + plane - 1) / 3;
- plj= (plane + 2) % 3;
- }
- s->qr_count[inter][plane]= s->qr_count[qtj][plj];
- memcpy(s->qr_size[inter][plane], s->qr_size[qtj][plj], sizeof(s->qr_size[0][0]));
- memcpy(s->qr_base[inter][plane], s->qr_base[qtj][plj], sizeof(s->qr_base[0][0]));
- } else {
- int qri= 0;
- int qi = 0;
-
- for(;;){
- i= get_bits(gb, av_log2(matrices-1)+1);
- if(i>= matrices){
- av_log(avctx, AV_LOG_ERROR, "invalid base matrix index\n");
- return -1;
- }
- s->qr_base[inter][plane][qri]= i;
- if(qi >= 63)
- break;
- i = get_bits(gb, av_log2(63-qi)+1) + 1;
- s->qr_size[inter][plane][qri++]= i;
- qi += i;
- }
-
- if (qi > 63) {
- av_log(avctx, AV_LOG_ERROR, "invalid qi %d > 63\n", qi);
- return -1;
- }
- s->qr_count[inter][plane]= qri;
- }
- }
- }
-
- /* Huffman tables */
- for (s->hti = 0; s->hti < 80; s->hti++) {
- s->entries = 0;
- s->huff_code_size = 1;
- if (!get_bits(gb, 1)) {
- s->hbits = 0;
- read_huffman_tree(avctx, gb);
- s->hbits = 1;
- read_huffman_tree(avctx, gb);
- }
- }
-
- s->theora_tables = 1;
-
- return 0;
-}
-
-static int theora_decode_init(AVCodecContext *avctx)
-{
- Vp3DecodeContext *s = avctx->priv_data;
- GetBitContext gb;
- int ptype;
- uint8_t *p= avctx->extradata;
- int op_bytes, i;
-
- s->theora = 1;
-
- if (!avctx->extradata_size)
- {
- av_log(avctx, AV_LOG_ERROR, "Missing extradata!\n");
- return -1;
- }
-
- for(i=0;i<3;i++) {
- op_bytes = *(p++)<<8;
- op_bytes += *(p++);
-
- init_get_bits(&gb, p, op_bytes);
- p += op_bytes;
-
- ptype = get_bits(&gb, 8);
- debug_vp3("Theora headerpacket type: %x\n", ptype);
-
- if (!(ptype & 0x80))
- {
- av_log(avctx, AV_LOG_ERROR, "Invalid extradata!\n");
-// return -1;
- }
-
- // FIXME: check for this aswell
- skip_bits(&gb, 6*8); /* "theora" */
-
- switch(ptype)
- {
- case 0x80:
- theora_decode_header(avctx, &gb);
- break;
- case 0x81:
-// FIXME: is this needed? it breaks sometimes
-// theora_decode_comments(avctx, gb);
- break;
- case 0x82:
- theora_decode_tables(avctx, &gb);
- break;
- default:
- av_log(avctx, AV_LOG_ERROR, "Unknown Theora config packet: %d\n", ptype&~0x80);
- break;
- }
- if(8*op_bytes != get_bits_count(&gb))
- av_log(avctx, AV_LOG_ERROR, "%d bits left in packet %X\n", 8*op_bytes - get_bits_count(&gb), ptype);
- if (s->theora < 0x030200)
- break;
- }
-
- vp3_decode_init(avctx);
- return 0;
-}
-
-AVCodec vp3_decoder = {
- "vp3",
- CODEC_TYPE_VIDEO,
- CODEC_ID_VP3,
- sizeof(Vp3DecodeContext),
- vp3_decode_init,
- NULL,
- vp3_decode_end,
- vp3_decode_frame,
- 0,
- NULL
-};
-
-AVCodec theora_decoder = {
- "theora",
- CODEC_TYPE_VIDEO,
- CODEC_ID_THEORA,
- sizeof(Vp3DecodeContext),
- theora_decode_init,
- NULL,
- vp3_decode_end,
- vp3_decode_frame,
- 0,
- NULL
-};
diff --git a/src/libffmpeg/libavcodec/vp3data.h b/src/libffmpeg/libavcodec/vp3data.h
deleted file mode 100644
index d69ddfa28..000000000
--- a/src/libffmpeg/libavcodec/vp3data.h
+++ /dev/null
@@ -1,3178 +0,0 @@
-/*
- * copyright (C) 2003 the ffmpeg project
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef VP3DATA_H
-#define VP3DATA_H
-
-/* these coefficients dequantize intraframe Y plane coefficients
- * (note: same as JPEG) */
-static const int16_t vp31_intra_y_dequant[64] =
-{ 16, 11, 10, 16, 24, 40, 51, 61,
- 12, 12, 14, 19, 26, 58, 60, 55,
- 14, 13, 16, 24, 40, 57, 69, 56,
- 14, 17, 22, 29, 51, 87, 80, 62,
- 18, 22, 37, 58, 68, 109, 103, 77,
- 24, 35, 55, 64, 81, 104, 113, 92,
- 49, 64, 78, 87, 103, 121, 120, 101,
- 72, 92, 95, 98, 112, 100, 103, 99
-};
-
-/* these coefficients dequantize intraframe C plane coefficients
- * (note: same as JPEG) */
-static const int16_t vp31_intra_c_dequant[64] =
-{ 17, 18, 24, 47, 99, 99, 99, 99,
- 18, 21, 26, 66, 99, 99, 99, 99,
- 24, 26, 56, 99, 99, 99, 99, 99,
- 47, 66, 99, 99, 99, 99, 99, 99,
- 99, 99, 99, 99, 99, 99, 99, 99,
- 99, 99, 99, 99, 99, 99, 99, 99,
- 99, 99, 99, 99, 99, 99, 99, 99,
- 99, 99, 99, 99, 99, 99, 99, 99
-};
-
-/* these coefficients dequantize interframe coefficients (all planes) */
-static const int16_t vp31_inter_dequant[64] =
-{ 16, 16, 16, 20, 24, 28, 32, 40,
- 16, 16, 20, 24, 28, 32, 40, 48,
- 16, 20, 24, 28, 32, 40, 48, 64,
- 20, 24, 28, 32, 40, 48, 64, 64,
- 24, 28, 32, 40, 48, 64, 64, 64,
- 28, 32, 40, 48, 64, 64, 64, 96,
- 32, 40, 48, 64, 64, 64, 96, 128,
- 40, 48, 64, 64, 64, 96, 128, 128
-};
-
-static const int16_t vp31_dc_scale_factor[64] =
-{ 220, 200, 190, 180, 170, 170, 160, 160,
- 150, 150, 140, 140, 130, 130, 120, 120,
- 110, 110, 100, 100, 90, 90, 90, 80,
- 80, 80, 70, 70, 70, 60, 60, 60,
- 60, 50, 50, 50, 50, 40, 40, 40,
- 40, 40, 30, 30, 30, 30, 30, 30,
- 30, 20, 20, 20, 20, 20, 20, 20,
- 20, 10, 10, 10, 10, 10, 10, 10
-};
-
-static const uint32_t vp31_ac_scale_factor[64] =
-{ 500, 450, 400, 370, 340, 310, 285, 265,
- 245, 225, 210, 195, 185, 180, 170, 160,
- 150, 145, 135, 130, 125, 115, 110, 107,
- 100, 96, 93, 89, 85, 82, 75, 74,
- 70, 68, 64, 60, 57, 56, 52, 50,
- 49, 45, 44, 43, 40, 38, 37, 35,
- 33, 32, 30, 29, 28, 25, 24, 22,
- 21, 19, 18, 17, 15, 13, 12, 10
-};
-
-static const uint32_t vp31_filter_limit_values[64] =
-{ 30, 25, 20, 20, 15, 15, 14, 14,
- 13, 13, 12, 12, 11, 11, 10, 10,
- 9, 9, 8, 8, 7, 7, 7, 7,
- 6, 6, 6, 6, 5, 5, 5, 5,
- 4, 4, 4, 4, 3, 3, 3, 3,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0
-};
-
-static const uint16_t superblock_run_length_vlc_table[34][2] = {
- { 0, 1 },
-
- { 4, 3 }, { 5, 3 },
-
- { 0xC, 4 }, { 0xD, 4 },
-
- { 0x38, 6 }, { 0x39, 6 }, { 0x3A, 6 }, { 0x3B, 6 },
-
- { 0xF0, 8 }, { 0xF1, 8 }, { 0xF2, 8 }, { 0xF3, 8 },
- { 0xF4, 8 }, { 0xF5, 8 }, { 0xF6, 8 }, { 0xF7, 8 },
-
- { 0x3E0, 10 }, { 0x3E1, 10 }, { 0x3E2, 10 }, { 0x3E3, 10 },
- { 0x3E4, 10 }, { 0x3E5, 10 }, { 0x3E6, 10 }, { 0x3E7, 10 },
- { 0x3E8, 10 }, { 0x3E9, 10 }, { 0x3EA, 10 }, { 0x3EB, 10 },
- { 0x3EC, 10 }, { 0x3ED, 10 }, { 0x3EE, 10 }, { 0x3EF, 10 },
-
- { 0x3F, 6 } /* this last VLC is a special case for reading 12 more
- bits from stream and adding the value 34 */
-};
-
-static const uint16_t fragment_run_length_vlc_table[30][2] = {
- /* 1 -> 2 */
- { 0x0, 2 }, { 0x1, 2 },
-
- /* 3 -> 4 */
- { 0x4, 3 }, { 0x5, 3 },
-
- /* 5 -> 6 */
- { 0xC, 4 }, { 0xD, 4 },
-
- /* 7 -> 10 */
- { 0x38, 6 }, { 0x39, 6 },
- { 0x3A, 6 }, { 0x3B, 6 },
-
- /* 11 -> 14 */
- { 0x78, 7 }, { 0x79, 7 },
- { 0x7A, 7 }, { 0x7B, 7 },
-
- /* 15 -> 30 */
- { 0x1F0, 9 }, { 0x1F1, 9 }, { 0x1F2, 9 }, { 0x1F3, 9 },
- { 0x1F4, 9 }, { 0x1F5, 9 }, { 0x1F6, 9 }, { 0x1F7, 9 },
- { 0x1F8, 9 }, { 0x1F9, 9 }, { 0x1FA, 9 }, { 0x1FB, 9 },
- { 0x1FC, 9 }, { 0x1FD, 9 }, { 0x1FE, 9 }, { 0x1FF, 9 }
-};
-
-static const uint8_t mode_code_vlc_table[8][2] = {
- { 0, 1 }, { 2, 2 },
- { 6, 3 }, { 14, 4 },
- { 30, 5 }, { 62, 6 },
- { 126, 7 }, { 127, 7 }
-};
-
-static const uint8_t motion_vector_vlc_table[63][2] = {
- { 0, 3 },
- { 1, 3 },
- { 2, 3 },
-
- { 6, 4 }, { 7, 4 },
-
- { 8, 4 }, { 9, 4 },
-
- { 40, 6 }, { 41, 6 }, { 42, 6 }, { 43, 6 },
- { 44, 6 }, { 45, 6 }, { 46, 6 }, { 47, 6 },
-
- { 96, 7 }, { 97, 7 }, { 98, 7 }, { 99, 7 },
- { 100, 7 }, { 101, 7 }, { 102, 7 }, { 103, 7 },
- { 104, 7 }, { 105, 7 }, { 106, 7 }, { 107, 7 },
- { 108, 7 }, { 109, 7 }, { 110, 7 }, { 111, 7 },
-
- { 0xE0, 8 }, { 0xE1, 8 }, { 0xE2, 8 }, { 0xE3, 8 },
- { 0xE4, 8 }, { 0xE5, 8 }, { 0xE6, 8 }, { 0xE7, 8 },
- { 0xE8, 8 }, { 0xE9, 8 }, { 0xEA, 8 }, { 0xEB, 8 },
- { 0xEC, 8 }, { 0xED, 8 }, { 0xEE, 8 }, { 0xEF, 8 },
-
- { 0xF0, 8 }, { 0xF1, 8 }, { 0xF2, 8 }, { 0xF3, 8 },
- { 0xF4, 8 }, { 0xF5, 8 }, { 0xF6, 8 }, { 0xF7, 8 },
- { 0xF8, 8 }, { 0xF9, 8 }, { 0xFA, 8 }, { 0xFB, 8 },
- { 0xFC, 8 }, { 0xFD, 8 }, { 0xFE, 8 }, { 0xFF, 8 }
-};
-
-static const int motion_vector_table[63] = {
- 0, 1, -1,
- 2, -2,
- 3, -3,
- 4, -4, 5, -5, 6, -6, 7, -7,
- 8, -8, 9, -9, 10, -10, 11, -11, 12, -12, 13, -13, 14, -14, 15, -15,
- 16, -16, 17, -17, 18, -18, 19, -19, 20, -20, 21, -21, 22, -22, 23, -23,
- 24, -24, 25, -25, 26, -26, 27, -27, 28, -28, 29, -29, 30, -30, 31, -31
-};
-
-static const int8_t fixed_motion_vector_table[64] = {
- 0, 0, 1, -1, 2, -2, 3, -3,
- 4, -4, 5, -5, 6, -6, 7, -7,
- 8, -8, 9, -9, 10, -10, 11, -11,
- 12, -12, 13, -13, 14, -14, 15, -15,
- 16, -16, 17, -17, 18, -18, 19, -19,
- 20, -20, 21, -21, 22, -22, 23, -23,
- 24, -24, 25, -25, 26, -26, 27, -27,
- 28, -28, 29, -29, 30, -30, 31, -31
-};
-
-/* only tokens 0..6 indicate eob runs */
-static const int eob_run_base[7] = {
- 1, 2, 3, 4, 8, 16, 0
-};
-static const int eob_run_get_bits[7] = {
- 0, 0, 0, 2, 3, 4, 12
-};
-
-static const int zero_run_base[32] = {
- 0, 0, 0, 0, 0, 0, 0, /* 0..6 are never used */
- 0, 0, /* 7..8 */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 9..22 */
- 1, 2, 3, 4, 5, /* 23..27 */
- 6, 10, 1, 2 /* 28..31 */
-};
-static const int zero_run_get_bits[32] = {
- 0, 0, 0, 0, 0, 0, 0, /* 0..6 are never used */
- 3, 6, /* 7..8 */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 9..22 */
- 0, 0, 0, 0, 0, /* 23..27 */
- 2, 3, 0, 1 /* 28..31 */
-};
-
-static const int coeff_get_bits[32] = {
- 0, 0, 0, 0, 0, 0, 0, /* 0..6 are never used */
- 0, 0, 0, 0, 0, 0, /* 7..12 use constant coeffs */
- 1, 1, 1, 1, /* 13..16 are constants but still need sign bit */
- 2, 3, 4, 5, 6, 10, /* 17..22, for reading large coeffs */
- 1, 1, 1, 1, 1, 1, 1, /* 23..29 are constants but still need sign bit */
- 2, 2 /* 30..31 */
-};
-
-static const int16_t coeff_table_token_7_8[1] = { 0 };
-static const int16_t coeff_table_token_9[1] = { 1 };
-static const int16_t coeff_table_token_10[1] = { -1 };
-static const int16_t coeff_table_token_11[1] = { 2 };
-static const int16_t coeff_table_token_12[1] = { -2 };
-
-static const int16_t coeff_table_token_13[2] = { 3, -3 };
-static const int16_t coeff_table_token_14[2] = { 4, -4 };
-static const int16_t coeff_table_token_15[2] = { 5, -5 };
-static const int16_t coeff_table_token_16[2] = { 6, -6 };
-
-static const int16_t coeff_table_token_23_24_25_26_27_28_29[2] = { 1, -1 };
-static const int16_t coeff_table_token_30[4] = { 2, 3, -2, -3 };
-static const int16_t coeff_table_token_31[4] = { 2, 3, -2, -3 };
-
-static const int16_t coeff_table_token_17[4] = {
- 7, 8, -7, -8
-};
-
-static const int16_t coeff_table_token_18[8] = {
- 9, 10, 11, 12, -9, -10, -11, -12
-};
-
-static const int16_t coeff_table_token_19[16] = {
- 13, 14, 15, 16, 17, 18, 19, 20, -13, -14, -15, -16, -17, -18, -19, -20
-};
-
-static const int16_t coeff_table_token_20[32] = {
- 21, 22, 23, 24, 25, 26, 27, 28,
- 29, 30, 31, 32, 33, 34, 35, 36,
- -21, -22, -23, -24, -25, -26, -27, -28,
- -29, -30, -31, -32, -33, -34, -35, -36
-};
-
-static const int16_t coeff_table_token_21[64] = {
- 37, 38, 39, 40, 41, 42, 43, 44,
- 45, 46, 47, 48, 49, 50, 51, 52,
- 53, 54, 55, 56, 57, 58, 59, 60,
- 61, 62, 63, 64, 65, 66, 67, 68,
- -37, -38, -39, -40, -41, -42, -43, -44,
- -45, -46, -47, -48, -49, -50, -51, -52,
- -53, -54, -55, -56, -57, -58, -59, -60,
- -61, -62, -63, -64, -65, -66, -67, -68
-};
-
-static const int16_t coeff_table_token_22[1024] = {
- 69, 70, 71, 72, 73, 74, 75, 76,
- 77, 78, 79, 80, 81, 82, 83, 84,
- 85, 86, 87, 88, 89, 90, 91, 92,
- 93, 94, 95, 96, 97, 98, 99, 100,
- 101, 102, 103, 104, 105, 106, 107, 108,
- 109, 110, 111, 112, 113, 114, 115, 116,
- 117, 118, 119, 120, 121, 122, 123, 124,
- 125, 126, 127, 128, 129, 130, 131, 132,
- 133, 134, 135, 136, 137, 138, 139, 140,
- 141, 142, 143, 144, 145, 146, 147, 148,
- 149, 150, 151, 152, 153, 154, 155, 156,
- 157, 158, 159, 160, 161, 162, 163, 164,
- 165, 166, 167, 168, 169, 170, 171, 172,
- 173, 174, 175, 176, 177, 178, 179, 180,
- 181, 182, 183, 184, 185, 186, 187, 188,
- 189, 190, 191, 192, 193, 194, 195, 196,
- 197, 198, 199, 200, 201, 202, 203, 204,
- 205, 206, 207, 208, 209, 210, 211, 212,
- 213, 214, 215, 216, 217, 218, 219, 220,
- 221, 222, 223, 224, 225, 226, 227, 228,
- 229, 230, 231, 232, 233, 234, 235, 236,
- 237, 238, 239, 240, 241, 242, 243, 244,
- 245, 246, 247, 248, 249, 250, 251, 252,
- 253, 254, 255, 256, 257, 258, 259, 260,
- 261, 262, 263, 264, 265, 266, 267, 268,
- 269, 270, 271, 272, 273, 274, 275, 276,
- 277, 278, 279, 280, 281, 282, 283, 284,
- 285, 286, 287, 288, 289, 290, 291, 292,
- 293, 294, 295, 296, 297, 298, 299, 300,
- 301, 302, 303, 304, 305, 306, 307, 308,
- 309, 310, 311, 312, 313, 314, 315, 316,
- 317, 318, 319, 320, 321, 322, 323, 324,
- 325, 326, 327, 328, 329, 330, 331, 332,
- 333, 334, 335, 336, 337, 338, 339, 340,
- 341, 342, 343, 344, 345, 346, 347, 348,
- 349, 350, 351, 352, 353, 354, 355, 356,
- 357, 358, 359, 360, 361, 362, 363, 364,
- 365, 366, 367, 368, 369, 370, 371, 372,
- 373, 374, 375, 376, 377, 378, 379, 380,
- 381, 382, 383, 384, 385, 386, 387, 388,
- 389, 390, 391, 392, 393, 394, 395, 396,
- 397, 398, 399, 400, 401, 402, 403, 404,
- 405, 406, 407, 408, 409, 410, 411, 412,
- 413, 414, 415, 416, 417, 418, 419, 420,
- 421, 422, 423, 424, 425, 426, 427, 428,
- 429, 430, 431, 432, 433, 434, 435, 436,
- 437, 438, 439, 440, 441, 442, 443, 444,
- 445, 446, 447, 448, 449, 450, 451, 452,
- 453, 454, 455, 456, 457, 458, 459, 460,
- 461, 462, 463, 464, 465, 466, 467, 468,
- 469, 470, 471, 472, 473, 474, 475, 476,
- 477, 478, 479, 480, 481, 482, 483, 484,
- 485, 486, 487, 488, 489, 490, 491, 492,
- 493, 494, 495, 496, 497, 498, 499, 500,
- 501, 502, 503, 504, 505, 506, 507, 508,
- 509, 510, 511, 512, 513, 514, 515, 516,
- 517, 518, 519, 520, 521, 522, 523, 524,
- 525, 526, 527, 528, 529, 530, 531, 532,
- 533, 534, 535, 536, 537, 538, 539, 540,
- 541, 542, 543, 544, 545, 546, 547, 548,
- 549, 550, 551, 552, 553, 554, 555, 556,
- 557, 558, 559, 560, 561, 562, 563, 564,
- 565, 566, 567, 568, 569, 570, 571, 572,
- 573, 574, 575, 576, 577, 578, 579, 580,
- -69, -70, -71, -72, -73, -74, -75, -76,
- -77, -78, -79, -80, -81, -82, -83, -84,
- -85, -86, -87, -88, -89, -90, -91, -92,
- -93, -94, -95, -96, -97, -98, -99, -100,
- -101, -102, -103, -104, -105, -106, -107, -108,
- -109, -110, -111, -112, -113, -114, -115, -116,
- -117, -118, -119, -120, -121, -122, -123, -124,
- -125, -126, -127, -128, -129, -130, -131, -132,
- -133, -134, -135, -136, -137, -138, -139, -140,
- -141, -142, -143, -144, -145, -146, -147, -148,
- -149, -150, -151, -152, -153, -154, -155, -156,
- -157, -158, -159, -160, -161, -162, -163, -164,
- -165, -166, -167, -168, -169, -170, -171, -172,
- -173, -174, -175, -176, -177, -178, -179, -180,
- -181, -182, -183, -184, -185, -186, -187, -188,
- -189, -190, -191, -192, -193, -194, -195, -196,
- -197, -198, -199, -200, -201, -202, -203, -204,
- -205, -206, -207, -208, -209, -210, -211, -212,
- -213, -214, -215, -216, -217, -218, -219, -220,
- -221, -222, -223, -224, -225, -226, -227, -228,
- -229, -230, -231, -232, -233, -234, -235, -236,
- -237, -238, -239, -240, -241, -242, -243, -244,
- -245, -246, -247, -248, -249, -250, -251, -252,
- -253, -254, -255, -256, -257, -258, -259, -260,
- -261, -262, -263, -264, -265, -266, -267, -268,
- -269, -270, -271, -272, -273, -274, -275, -276,
- -277, -278, -279, -280, -281, -282, -283, -284,
- -285, -286, -287, -288, -289, -290, -291, -292,
- -293, -294, -295, -296, -297, -298, -299, -300,
- -301, -302, -303, -304, -305, -306, -307, -308,
- -309, -310, -311, -312, -313, -314, -315, -316,
- -317, -318, -319, -320, -321, -322, -323, -324,
- -325, -326, -327, -328, -329, -330, -331, -332,
- -333, -334, -335, -336, -337, -338, -339, -340,
- -341, -342, -343, -344, -345, -346, -347, -348,
- -349, -350, -351, -352, -353, -354, -355, -356,
- -357, -358, -359, -360, -361, -362, -363, -364,
- -365, -366, -367, -368, -369, -370, -371, -372,
- -373, -374, -375, -376, -377, -378, -379, -380,
- -381, -382, -383, -384, -385, -386, -387, -388,
- -389, -390, -391, -392, -393, -394, -395, -396,
- -397, -398, -399, -400, -401, -402, -403, -404,
- -405, -406, -407, -408, -409, -410, -411, -412,
- -413, -414, -415, -416, -417, -418, -419, -420,
- -421, -422, -423, -424, -425, -426, -427, -428,
- -429, -430, -431, -432, -433, -434, -435, -436,
- -437, -438, -439, -440, -441, -442, -443, -444,
- -445, -446, -447, -448, -449, -450, -451, -452,
- -453, -454, -455, -456, -457, -458, -459, -460,
- -461, -462, -463, -464, -465, -466, -467, -468,
- -469, -470, -471, -472, -473, -474, -475, -476,
- -477, -478, -479, -480, -481, -482, -483, -484,
- -485, -486, -487, -488, -489, -490, -491, -492,
- -493, -494, -495, -496, -497, -498, -499, -500,
- -501, -502, -503, -504, -505, -506, -507, -508,
- -509, -510, -511, -512, -513, -514, -515, -516,
- -517, -518, -519, -520, -521, -522, -523, -524,
- -525, -526, -527, -528, -529, -530, -531, -532,
- -533, -534, -535, -536, -537, -538, -539, -540,
- -541, -542, -543, -544, -545, -546, -547, -548,
- -549, -550, -551, -552, -553, -554, -555, -556,
- -557, -558, -559, -560, -561, -562, -563, -564,
- -565, -566, -567, -568, -569, -570, -571, -572,
- -573, -574, -575, -576, -577, -578, -579, -580
-};
-
-static const int16_t *coeff_tables[32] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- coeff_table_token_7_8,
-
- coeff_table_token_7_8,
- coeff_table_token_9,
- coeff_table_token_10,
- coeff_table_token_11,
- coeff_table_token_12,
- coeff_table_token_13,
- coeff_table_token_14,
- coeff_table_token_15,
-
- coeff_table_token_16,
- coeff_table_token_17,
- coeff_table_token_18,
- coeff_table_token_19,
- coeff_table_token_20,
- coeff_table_token_21,
- coeff_table_token_22,
- coeff_table_token_23_24_25_26_27_28_29,
-
- coeff_table_token_23_24_25_26_27_28_29,
- coeff_table_token_23_24_25_26_27_28_29,
- coeff_table_token_23_24_25_26_27_28_29,
- coeff_table_token_23_24_25_26_27_28_29,
- coeff_table_token_23_24_25_26_27_28_29,
- coeff_table_token_23_24_25_26_27_28_29,
- coeff_table_token_30,
- coeff_table_token_31
-};
-
-static const uint16_t dc_bias[16][32][2] = {
- { /* DC bias table 0 */
- { 0x2D, 6 },
- { 0x26, 7 },
- { 0x166, 9 },
- { 0x4E, 8 },
- { 0x2CE, 10 },
- { 0x59E, 11 },
- { 0x27D, 11 },
- { 0x8, 5 },
- { 0x4F9, 12 },
- { 0xF, 4 },
- { 0xE, 4 },
- { 0x1B, 5 },
- { 0x6, 4 },
- { 0x8, 4 },
- { 0x5, 4 },
- { 0x1A, 5 },
- { 0x15, 5 },
- { 0x7, 4 },
- { 0xC, 4 },
- { 0x1, 3 },
- { 0x0, 3 },
- { 0x9, 4 },
- { 0x17, 5 },
- { 0x29, 6 },
- { 0x28, 6 },
- { 0xB2, 8 },
- { 0x4F8, 12 },
- { 0x59F, 11 },
- { 0x9E, 9 },
- { 0x13F, 10 },
- { 0x12, 6 },
- { 0x58, 7 }
- },
- { /* DC bias table 1 */
- { 0x10, 5 },
- { 0x47, 7 },
- { 0x1FF, 9 },
- { 0x8C, 8 },
- { 0x3FC, 10 },
- { 0x46A, 11 },
- { 0x469, 11 },
- { 0x22, 6 },
- { 0x11A1, 13 },
- { 0xE, 4 },
- { 0xD, 4 },
- { 0x4, 4 },
- { 0x5, 4 },
- { 0x9, 4 },
- { 0x6, 4 },
- { 0x1E, 5 },
- { 0x16, 5 },
- { 0x7, 4 },
- { 0xC, 4 },
- { 0x1, 3 },
- { 0x0, 3 },
- { 0xA, 4 },
- { 0x17, 5 },
- { 0x7D, 7 },
- { 0x7E, 7 },
- { 0x11B, 9 },
- { 0x8D1, 12 },
- { 0x3FD, 10 },
- { 0x46B, 11 },
- { 0x11A0, 13 },
- { 0x7C, 7 },
- { 0xFE, 8 }
- },
- { /* DC bias table 2 */
- { 0x16, 5 },
- { 0x20, 6 },
- { 0x86, 8 },
- { 0x87, 8 },
- { 0x367, 10 },
- { 0x6CC, 11 },
- { 0x6CB, 11 },
- { 0x6E, 7 },
- { 0x366D, 14 },
- { 0xF, 4 },
- { 0xE, 4 },
- { 0x4, 4 },
- { 0x5, 4 },
- { 0xA, 4 },
- { 0x6, 4 },
- { 0x1A, 5 },
- { 0x11, 5 },
- { 0x7, 4 },
- { 0xC, 4 },
- { 0x1, 3 },
- { 0x0, 3 },
- { 0x9, 4 },
- { 0x17, 5 },
- { 0x6F, 7 },
- { 0x6D, 7 },
- { 0x364, 10 },
- { 0xD9A, 12 },
- { 0x6CA, 11 },
- { 0x1B37, 13 },
- { 0x366C, 14 },
- { 0x42, 7 },
- { 0xD8, 8 }
- },
- { /* DC bias table 3 */
- { 0x0, 4 },
- { 0x2D, 6 },
- { 0xF7, 8 },
- { 0x58, 7 },
- { 0x167, 9 },
- { 0x2CB, 10 },
- { 0x2CA, 10 },
- { 0xE, 6 },
- { 0x1661, 13 },
- { 0x3, 3 },
- { 0x2, 3 },
- { 0x8, 4 },
- { 0x9, 4 },
- { 0xD, 4 },
- { 0x2, 4 },
- { 0x1F, 5 },
- { 0x17, 5 },
- { 0x1, 4 },
- { 0xC, 4 },
- { 0xE, 4 },
- { 0xA, 4 },
- { 0x6, 5 },
- { 0x78, 7 },
- { 0xF, 6 },
- { 0x7A, 7 },
- { 0x164, 9 },
- { 0x599, 11 },
- { 0x2CD, 10 },
- { 0xB31, 12 },
- { 0x1660, 13 },
- { 0x79, 7 },
- { 0xF6, 8 }
- },
- { /* DC bias table 4 */
- { 0x3, 4 },
- { 0x3C, 6 },
- { 0xF, 7 },
- { 0x7A, 7 },
- { 0x1D, 8 },
- { 0x20, 9 },
- { 0x72, 10 },
- { 0x6, 6 },
- { 0x399, 13 },
- { 0x4, 3 },
- { 0x5, 3 },
- { 0x5, 4 },
- { 0x6, 4 },
- { 0xE, 4 },
- { 0x4, 4 },
- { 0x0, 4 },
- { 0x19, 5 },
- { 0x2, 4 },
- { 0xD, 4 },
- { 0x7, 4 },
- { 0x1F, 5 },
- { 0x30, 6 },
- { 0x11, 8 },
- { 0x31, 6 },
- { 0x5, 6 },
- { 0x21, 9 },
- { 0xE7, 11 },
- { 0x38, 9 },
- { 0x1CD, 12 },
- { 0x398, 13 },
- { 0x7B, 7 },
- { 0x9, 7 }
- },
- { /* DC bias table 5 */
- { 0x9, 4 },
- { 0x2, 5 },
- { 0x74, 7 },
- { 0x7, 6 },
- { 0xEC, 8 },
- { 0xD1, 9 },
- { 0x1A6, 10 },
- { 0x6, 6 },
- { 0xD21, 13 },
- { 0x5, 3 },
- { 0x6, 3 },
- { 0x8, 4 },
- { 0x7, 4 },
- { 0xF, 4 },
- { 0x4, 4 },
- { 0x0, 4 },
- { 0x1C, 5 },
- { 0x2, 4 },
- { 0x5, 4 },
- { 0x3, 4 },
- { 0xC, 5 },
- { 0x35, 7 },
- { 0x1A7, 10 },
- { 0x1B, 6 },
- { 0x77, 7 },
- { 0x1A5, 10 },
- { 0x349, 11 },
- { 0xD0, 9 },
- { 0x691, 12 },
- { 0xD20, 13 },
- { 0x75, 7 },
- { 0xED, 8 }
- },
- { /* DC bias table 6 */
- { 0xA, 4 },
- { 0xC, 5 },
- { 0x12, 6 },
- { 0x1B, 6 },
- { 0xB7, 8 },
- { 0x16C, 9 },
- { 0x99, 9 },
- { 0x5A, 7 },
- { 0x16D8, 13 },
- { 0x7, 3 },
- { 0x6, 3 },
- { 0x9, 4 },
- { 0x8, 4 },
- { 0x0, 3 },
- { 0x5, 4 },
- { 0x17, 5 },
- { 0xE, 5 },
- { 0x2, 4 },
- { 0x3, 4 },
- { 0xF, 5 },
- { 0x1A, 6 },
- { 0x4D, 8 },
- { 0x2DB3, 14 },
- { 0x2C, 6 },
- { 0x11, 6 },
- { 0x2DA, 10 },
- { 0x5B7, 11 },
- { 0x98, 9 },
- { 0xB6D, 12 },
- { 0x2DB2, 14 },
- { 0x10, 6 },
- { 0x27, 7 }
- },
- { /* DC bias table 7 */
- { 0xD, 4 },
- { 0xF, 5 },
- { 0x1D, 6 },
- { 0x8, 5 },
- { 0x51, 7 },
- { 0x56, 8 },
- { 0xAF, 9 },
- { 0x2A, 7 },
- { 0x148A, 13 },
- { 0x7, 3 },
- { 0x0, 2 },
- { 0x8, 4 },
- { 0x9, 4 },
- { 0xC, 4 },
- { 0x6, 4 },
- { 0x17, 5 },
- { 0xB, 5 },
- { 0x16, 5 },
- { 0x15, 5 },
- { 0x9, 5 },
- { 0x50, 7 },
- { 0xAE, 9 },
- { 0x2917, 14 },
- { 0x1C, 6 },
- { 0x14, 6 },
- { 0x290, 10 },
- { 0x523, 11 },
- { 0x149, 9 },
- { 0xA44, 12 },
- { 0x2916, 14 },
- { 0x53, 7 },
- { 0xA5, 8 }
- },
- { /* DC bias table 8 */
- { 0x1, 4 },
- { 0x1D, 6 },
- { 0xF5, 8 },
- { 0xF4, 8 },
- { 0x24D, 10 },
- { 0x499, 11 },
- { 0x498, 11 },
- { 0x1, 5 },
- { 0x21, 6 },
- { 0x6, 3 },
- { 0x5, 3 },
- { 0x6, 4 },
- { 0x5, 4 },
- { 0x2, 4 },
- { 0x7, 5 },
- { 0x25, 6 },
- { 0x7B, 7 },
- { 0x1C, 6 },
- { 0x20, 6 },
- { 0xD, 6 },
- { 0x48, 7 },
- { 0x92, 8 },
- { 0x127, 9 },
- { 0xE, 4 },
- { 0x4, 4 },
- { 0x11, 5 },
- { 0xC, 6 },
- { 0x3C, 6 },
- { 0xF, 5 },
- { 0x0, 5 },
- { 0x1F, 5 },
- { 0x13, 5 }
- },
- { /* DC bias table 9 */
- { 0x5, 4 },
- { 0x3C, 6 },
- { 0x40, 7 },
- { 0xD, 7 },
- { 0x31, 9 },
- { 0x61, 10 },
- { 0x60, 10 },
- { 0x2, 5 },
- { 0xF5, 8 },
- { 0x6, 3 },
- { 0x5, 3 },
- { 0x7, 4 },
- { 0x6, 4 },
- { 0x2, 4 },
- { 0x9, 5 },
- { 0x25, 6 },
- { 0x7, 6 },
- { 0x21, 6 },
- { 0x24, 6 },
- { 0x10, 6 },
- { 0x41, 7 },
- { 0xF4, 8 },
- { 0x19, 8 },
- { 0xE, 4 },
- { 0x3, 4 },
- { 0x11, 5 },
- { 0x11, 6 },
- { 0x3F, 6 },
- { 0x3E, 6 },
- { 0x7B, 7 },
- { 0x0, 4 },
- { 0x13, 5 }
- },
- { /* DC bias table 10 */
- { 0xA, 4 },
- { 0x7, 5 },
- { 0x1, 6 },
- { 0x9, 6 },
- { 0x131, 9 },
- { 0x261, 10 },
- { 0x260, 10 },
- { 0x15, 6 },
- { 0x1, 7 },
- { 0x7, 3 },
- { 0x6, 3 },
- { 0x8, 4 },
- { 0x7, 4 },
- { 0x6, 4 },
- { 0x12, 5 },
- { 0x2F, 6 },
- { 0x14, 6 },
- { 0x27, 6 },
- { 0x2D, 6 },
- { 0x16, 6 },
- { 0x4D, 7 },
- { 0x99, 8 },
- { 0x0, 7 },
- { 0x4, 4 },
- { 0x1, 4 },
- { 0x5, 5 },
- { 0x17, 6 },
- { 0x2E, 6 },
- { 0x2C, 6 },
- { 0x8, 6 },
- { 0x6, 5 },
- { 0x1, 5 }
- },
- { /* DC bias table 11 */
- { 0x0, 3 },
- { 0xE, 5 },
- { 0x17, 6 },
- { 0x2A, 6 },
- { 0x10, 7 },
- { 0xF9, 10 },
- { 0xF8, 10 },
- { 0x1E, 7 },
- { 0x3F, 8 },
- { 0x7, 3 },
- { 0x6, 3 },
- { 0x9, 4 },
- { 0x8, 4 },
- { 0x6, 4 },
- { 0xF, 5 },
- { 0x5, 5 },
- { 0x16, 6 },
- { 0x29, 6 },
- { 0x2B, 6 },
- { 0x15, 6 },
- { 0x50, 7 },
- { 0x11, 7 },
- { 0x7D, 9 },
- { 0x4, 4 },
- { 0x17, 5 },
- { 0x6, 5 },
- { 0x14, 6 },
- { 0x2C, 6 },
- { 0x2D, 6 },
- { 0xE, 6 },
- { 0x9, 6 },
- { 0x51, 7 }
- },
- { /* DC bias table 12 */
- { 0x2, 3 },
- { 0x18, 5 },
- { 0x2F, 6 },
- { 0xD, 5 },
- { 0x53, 7 },
- { 0x295, 10 },
- { 0x294, 10 },
- { 0xA4, 8 },
- { 0x7C, 8 },
- { 0x0, 2 },
- { 0x7, 3 },
- { 0x9, 4 },
- { 0x8, 4 },
- { 0x1B, 5 },
- { 0xC, 5 },
- { 0x28, 6 },
- { 0x6A, 7 },
- { 0x1E, 6 },
- { 0x1D, 6 },
- { 0x69, 7 },
- { 0xD7, 8 },
- { 0x7D, 8 },
- { 0x14B, 9 },
- { 0x19, 5 },
- { 0x16, 5 },
- { 0x2E, 6 },
- { 0x1C, 6 },
- { 0x2B, 6 },
- { 0x2A, 6 },
- { 0x68, 7 },
- { 0x3F, 7 },
- { 0xD6, 8 }
- },
- { /* DC bias table 13 */
- { 0x2, 3 },
- { 0x1B, 5 },
- { 0xC, 5 },
- { 0x18, 5 },
- { 0x29, 6 },
- { 0x7F, 8 },
- { 0x2F0, 10 },
- { 0x198, 9 },
- { 0x179, 9 },
- { 0x0, 2 },
- { 0x7, 3 },
- { 0x9, 4 },
- { 0x8, 4 },
- { 0x1A, 5 },
- { 0xD, 5 },
- { 0x2A, 6 },
- { 0x64, 7 },
- { 0x1E, 6 },
- { 0x67, 7 },
- { 0x5F, 7 },
- { 0xCD, 8 },
- { 0x7E, 8 },
- { 0x2F1, 10 },
- { 0x16, 5 },
- { 0xE, 5 },
- { 0x2E, 6 },
- { 0x65, 7 },
- { 0x2B, 6 },
- { 0x28, 6 },
- { 0x3E, 7 },
- { 0xBD, 8 },
- { 0x199, 9 }
- },
- { /* DC bias table 14 */
- { 0x2, 3 },
- { 0x7, 4 },
- { 0x16, 5 },
- { 0x6, 4 },
- { 0x36, 6 },
- { 0x5C, 7 },
- { 0x15D, 9 },
- { 0x15C, 9 },
- { 0x2BF, 10 },
- { 0x0, 2 },
- { 0x7, 3 },
- { 0x9, 4 },
- { 0x8, 4 },
- { 0x18, 5 },
- { 0x34, 6 },
- { 0x2A, 6 },
- { 0x5E, 7 },
- { 0x6A, 7 },
- { 0x64, 7 },
- { 0x5D, 7 },
- { 0xCB, 8 },
- { 0xAD, 8 },
- { 0x2BE, 10 },
- { 0x14, 5 },
- { 0x33, 6 },
- { 0x6E, 7 },
- { 0x5F, 7 },
- { 0x6F, 7 },
- { 0x6B, 7 },
- { 0xCA, 8 },
- { 0xAC, 8 },
- { 0x15E, 9 }
- },
- { /* DC bias table 15 */
- { 0xF, 4 },
- { 0x1D, 5 },
- { 0x18, 5 },
- { 0xB, 4 },
- { 0x19, 5 },
- { 0x29, 6 },
- { 0xD6, 8 },
- { 0x551, 11 },
- { 0xAA1, 12 },
- { 0x1, 2 },
- { 0x0, 2 },
- { 0x9, 4 },
- { 0x8, 4 },
- { 0x1B, 5 },
- { 0x38, 6 },
- { 0x28, 6 },
- { 0x57, 7 },
- { 0x6A, 7 },
- { 0x68, 7 },
- { 0x56, 7 },
- { 0xE5, 8 },
- { 0x155, 9 },
- { 0xAA0, 12 },
- { 0x73, 7 },
- { 0x69, 7 },
- { 0xD7, 8 },
- { 0xAB, 8 },
- { 0xE4, 8 },
- { 0xA9, 8 },
- { 0x151, 9 },
- { 0x150, 9 },
- { 0x2A9, 10 }
- }
-};
-
-static const uint16_t ac_bias_0[16][32][2] = {
- { /* AC bias group 1, table 0 */
- { 0x8, 5 },
- { 0x25, 7 },
- { 0x17A, 9 },
- { 0x2F7, 10 },
- { 0xBDB, 12 },
- { 0x17B4, 13 },
- { 0x2F6B, 14 },
- { 0x1D, 5 },
- { 0x2F6A, 14 },
- { 0x8, 4 },
- { 0x7, 4 },
- { 0x1, 4 },
- { 0x2, 4 },
- { 0xA, 4 },
- { 0x6, 4 },
- { 0x0, 4 },
- { 0x1C, 5 },
- { 0x9, 4 },
- { 0xD, 4 },
- { 0xF, 4 },
- { 0xC, 4 },
- { 0x3, 4 },
- { 0xA, 5 },
- { 0x16, 5 },
- { 0x13, 6 },
- { 0x5D, 7 },
- { 0x24, 7 },
- { 0xBC, 8 },
- { 0x5C, 7 },
- { 0x5EC, 11 },
- { 0xB, 5 },
- { 0x5F, 7 }
- },
- { /* AC bias group 1, table 1 */
- { 0xF, 5 },
- { 0x10, 6 },
- { 0x4B, 8 },
- { 0xC6, 8 },
- { 0x31D, 10 },
- { 0xC71, 12 },
- { 0xC70, 12 },
- { 0x1, 4 },
- { 0xC73, 12 },
- { 0x8, 4 },
- { 0x9, 4 },
- { 0x2, 4 },
- { 0x3, 4 },
- { 0xB, 4 },
- { 0x6, 4 },
- { 0x0, 4 },
- { 0x1C, 5 },
- { 0x5, 4 },
- { 0xD, 4 },
- { 0xF, 4 },
- { 0xA, 4 },
- { 0x19, 5 },
- { 0x13, 6 },
- { 0x1D, 5 },
- { 0x30, 6 },
- { 0x62, 7 },
- { 0x24, 7 },
- { 0x4A, 8 },
- { 0x18F, 9 },
- { 0xC72, 12 },
- { 0xE, 5 },
- { 0x11, 6 }
- },
- { /* AC bias group 1, table 2 */
- { 0x1B, 5 },
- { 0x3, 6 },
- { 0x8D, 8 },
- { 0x40, 7 },
- { 0x239, 10 },
- { 0x471, 11 },
- { 0x8E0, 12 },
- { 0x3, 4 },
- { 0x11C3, 13 },
- { 0xA, 4 },
- { 0x9, 4 },
- { 0x4, 4 },
- { 0x5, 4 },
- { 0xE, 4 },
- { 0x7, 4 },
- { 0x1, 4 },
- { 0x1E, 5 },
- { 0x6, 4 },
- { 0xC, 4 },
- { 0xB, 4 },
- { 0x2, 4 },
- { 0x0, 5 },
- { 0x41, 7 },
- { 0x1F, 5 },
- { 0x22, 6 },
- { 0x2, 6 },
- { 0x8F, 8 },
- { 0x8C, 8 },
- { 0x11D, 9 },
- { 0x11C2, 13 },
- { 0x1A, 5 },
- { 0x21, 6 }
- },
- { /* AC bias group 1, table 3 */
- { 0x1F, 5 },
- { 0x3, 6 },
- { 0x3, 7 },
- { 0x43, 7 },
- { 0xB, 9 },
- { 0x15, 10 },
- { 0x51, 12 },
- { 0x3, 4 },
- { 0x50, 12 },
- { 0xD, 4 },
- { 0xC, 4 },
- { 0x4, 4 },
- { 0x6, 4 },
- { 0xE, 4 },
- { 0xA, 4 },
- { 0x1, 4 },
- { 0x1E, 5 },
- { 0x5, 4 },
- { 0x9, 4 },
- { 0x7, 4 },
- { 0x11, 5 },
- { 0x2, 6 },
- { 0x4, 8 },
- { 0x2, 4 },
- { 0x2D, 6 },
- { 0x20, 6 },
- { 0x42, 7 },
- { 0x1, 7 },
- { 0x0, 7 },
- { 0x29, 11 },
- { 0x17, 5 },
- { 0x2C, 6 }
- },
- { /* AC bias group 1, table 4 */
- { 0x3, 4 },
- { 0x1F, 6 },
- { 0x3A, 7 },
- { 0x5D, 7 },
- { 0x173, 9 },
- { 0x2E4, 10 },
- { 0x172D, 13 },
- { 0x4, 4 },
- { 0x172C, 13 },
- { 0xF, 4 },
- { 0xE, 4 },
- { 0x9, 4 },
- { 0x8, 4 },
- { 0xC, 4 },
- { 0xA, 4 },
- { 0x1, 4 },
- { 0x16, 5 },
- { 0x2, 4 },
- { 0x5, 4 },
- { 0x1A, 5 },
- { 0x2F, 6 },
- { 0x38, 7 },
- { 0x5CA, 11 },
- { 0x6, 4 },
- { 0x37, 6 },
- { 0x1E, 6 },
- { 0x3B, 7 },
- { 0x39, 7 },
- { 0xB8, 8 },
- { 0xB97, 12 },
- { 0x0, 4 },
- { 0x36, 6 }
- },
- { /* AC bias group 1, table 5 */
- { 0x6, 4 },
- { 0x37, 6 },
- { 0x5D, 7 },
- { 0xC, 6 },
- { 0xB9, 8 },
- { 0x2E3, 10 },
- { 0x5C4, 11 },
- { 0x4, 4 },
- { 0x1715, 13 },
- { 0x0, 3 },
- { 0xF, 4 },
- { 0x8, 4 },
- { 0x7, 4 },
- { 0xC, 4 },
- { 0x9, 4 },
- { 0x1D, 5 },
- { 0x16, 5 },
- { 0x1C, 5 },
- { 0x1A, 5 },
- { 0xB, 5 },
- { 0x5E, 7 },
- { 0x170, 9 },
- { 0x1714, 13 },
- { 0xA, 4 },
- { 0xA, 5 },
- { 0x36, 6 },
- { 0x5F, 7 },
- { 0x1B, 7 },
- { 0x1A, 7 },
- { 0xB8B, 12 },
- { 0x2, 4 },
- { 0x7, 5 }
- },
- { /* AC bias group 1, table 6 */
- { 0xC, 4 },
- { 0xB, 5 },
- { 0x79, 7 },
- { 0x22, 6 },
- { 0xF0, 8 },
- { 0x119, 9 },
- { 0x230, 10 },
- { 0x1D, 5 },
- { 0x8C4, 12 },
- { 0x1, 3 },
- { 0x0, 3 },
- { 0xA, 4 },
- { 0x9, 4 },
- { 0xB, 4 },
- { 0x7, 4 },
- { 0x1C, 5 },
- { 0x3D, 6 },
- { 0xD, 5 },
- { 0x8, 5 },
- { 0x15, 6 },
- { 0x8D, 8 },
- { 0x118B, 13 },
- { 0x118A, 13 },
- { 0xD, 4 },
- { 0x10, 5 },
- { 0x9, 5 },
- { 0x14, 6 },
- { 0x47, 7 },
- { 0xF1, 8 },
- { 0x463, 11 },
- { 0x1F, 5 },
- { 0xC, 5 }
- },
- { /* AC bias group 1, table 7 */
- { 0x0, 3 },
- { 0x1A, 5 },
- { 0x33, 6 },
- { 0xC, 5 },
- { 0x46, 7 },
- { 0x1E3, 9 },
- { 0x3C5, 10 },
- { 0x17, 5 },
- { 0x1E21, 13 },
- { 0x2, 3 },
- { 0x1, 3 },
- { 0x9, 4 },
- { 0xA, 4 },
- { 0x7, 4 },
- { 0x1B, 5 },
- { 0x3D, 6 },
- { 0x1B, 6 },
- { 0x22, 6 },
- { 0x79, 7 },
- { 0xF0, 8 },
- { 0x1E20, 13 },
- { 0x1E23, 13 },
- { 0x1E22, 13 },
- { 0xE, 4 },
- { 0x16, 5 },
- { 0x18, 5 },
- { 0x32, 6 },
- { 0x1A, 6 },
- { 0x47, 7 },
- { 0x789, 11 },
- { 0x1F, 5 },
- { 0x10, 5 }
- },
- { /* AC bias group 1, table 8 */
- { 0x1D, 5 },
- { 0x61, 7 },
- { 0x4E, 8 },
- { 0x9E, 9 },
- { 0x27C, 11 },
- { 0x9F5, 13 },
- { 0x9F4, 13 },
- { 0x3, 4 },
- { 0x60, 7 },
- { 0x0, 3 },
- { 0xF, 4 },
- { 0xB, 4 },
- { 0xA, 4 },
- { 0x9, 4 },
- { 0x5, 4 },
- { 0xD, 5 },
- { 0x31, 6 },
- { 0x8, 5 },
- { 0x38, 6 },
- { 0x12, 6 },
- { 0x26, 7 },
- { 0x13F, 10 },
- { 0x4FB, 12 },
- { 0xD, 4 },
- { 0x2, 4 },
- { 0xC, 5 },
- { 0x39, 6 },
- { 0x1C, 6 },
- { 0xF, 5 },
- { 0x1D, 6 },
- { 0x8, 4 },
- { 0x19, 5 }
- },
- { /* AC bias group 1, table 9 */
- { 0x7, 4 },
- { 0x19, 6 },
- { 0xAB, 8 },
- { 0xAA, 8 },
- { 0x119, 10 },
- { 0x461, 12 },
- { 0x460, 12 },
- { 0x1B, 5 },
- { 0x47, 8 },
- { 0x1, 3 },
- { 0x0, 3 },
- { 0xC, 4 },
- { 0xB, 4 },
- { 0x9, 4 },
- { 0x5, 4 },
- { 0xD, 5 },
- { 0x35, 6 },
- { 0x3D, 6 },
- { 0x3C, 6 },
- { 0x18, 6 },
- { 0x22, 7 },
- { 0x8D, 9 },
- { 0x231, 11 },
- { 0xE, 4 },
- { 0x1F, 5 },
- { 0x9, 5 },
- { 0x2B, 6 },
- { 0x10, 6 },
- { 0x34, 6 },
- { 0x54, 7 },
- { 0x8, 4 },
- { 0x14, 5 }
- },
- { /* AC bias group 1, table 10 */
- { 0xC, 4 },
- { 0x5, 5 },
- { 0x8, 6 },
- { 0x5B, 7 },
- { 0x4D, 9 },
- { 0x131, 11 },
- { 0x261, 12 },
- { 0x1A, 5 },
- { 0x12, 7 },
- { 0x0, 3 },
- { 0xF, 4 },
- { 0xA, 4 },
- { 0x9, 4 },
- { 0x6, 4 },
- { 0x1B, 5 },
- { 0x6, 5 },
- { 0x1C, 6 },
- { 0x2C, 6 },
- { 0x15, 6 },
- { 0x5A, 7 },
- { 0x27, 8 },
- { 0x99, 10 },
- { 0x260, 12 },
- { 0xE, 4 },
- { 0x4, 4 },
- { 0xF, 5 },
- { 0x7, 5 },
- { 0x1D, 6 },
- { 0xB, 5 },
- { 0x14, 6 },
- { 0x8, 4 },
- { 0x17, 5 }
- },
- { /* AC bias group 1, table 11 */
- { 0xF, 4 },
- { 0x13, 5 },
- { 0x75, 7 },
- { 0x24, 6 },
- { 0x95, 8 },
- { 0x251, 10 },
- { 0x4A0, 11 },
- { 0x10, 5 },
- { 0xC8, 8 },
- { 0x2, 3 },
- { 0x1, 3 },
- { 0x1, 4 },
- { 0x0, 4 },
- { 0x1A, 5 },
- { 0x11, 5 },
- { 0x2C, 6 },
- { 0x65, 7 },
- { 0x74, 7 },
- { 0x4B, 7 },
- { 0xC9, 8 },
- { 0x129, 9 },
- { 0x943, 12 },
- { 0x942, 12 },
- { 0x3, 3 },
- { 0xA, 4 },
- { 0x1C, 5 },
- { 0x18, 5 },
- { 0x33, 6 },
- { 0x17, 5 },
- { 0x2D, 6 },
- { 0x1B, 5 },
- { 0x3B, 6 }
- },
- { /* AC bias group 1, table 12 */
- { 0x3, 3 },
- { 0x1A, 5 },
- { 0x2D, 6 },
- { 0x38, 6 },
- { 0x28, 7 },
- { 0x395, 10 },
- { 0xE51, 12 },
- { 0x37, 6 },
- { 0xE4, 8 },
- { 0x1, 3 },
- { 0x0, 3 },
- { 0x1F, 5 },
- { 0x1E, 5 },
- { 0x17, 5 },
- { 0x3A, 6 },
- { 0x73, 7 },
- { 0x2A, 7 },
- { 0x2B, 7 },
- { 0x29, 7 },
- { 0x1CB, 9 },
- { 0x729, 11 },
- { 0x1CA1, 13 },
- { 0x1CA0, 13 },
- { 0x4, 3 },
- { 0xA, 4 },
- { 0x4, 4 },
- { 0x18, 5 },
- { 0x36, 6 },
- { 0xB, 5 },
- { 0x2C, 6 },
- { 0x19, 5 },
- { 0x3B, 6 }
- },
- { /* AC bias group 1, table 13 */
- { 0x4, 3 },
- { 0x4, 4 },
- { 0x3F, 6 },
- { 0x17, 5 },
- { 0x75, 7 },
- { 0x1F5, 9 },
- { 0x7D1, 11 },
- { 0x17, 6 },
- { 0x1F6, 9 },
- { 0x1, 3 },
- { 0x0, 3 },
- { 0x1B, 5 },
- { 0x1A, 5 },
- { 0xA, 5 },
- { 0x32, 6 },
- { 0x74, 7 },
- { 0xF8, 8 },
- { 0xF9, 8 },
- { 0x1F7, 9 },
- { 0x3E9, 10 },
- { 0xFA0, 12 },
- { 0x1F43, 13 },
- { 0x1F42, 13 },
- { 0x3, 3 },
- { 0xA, 4 },
- { 0x1E, 5 },
- { 0x1C, 5 },
- { 0x3B, 6 },
- { 0x18, 5 },
- { 0x16, 6 },
- { 0x16, 5 },
- { 0x33, 6 }
- },
- { /* AC bias group 1, table 14 */
- { 0x4, 3 },
- { 0x7, 4 },
- { 0x18, 5 },
- { 0x1E, 5 },
- { 0x36, 6 },
- { 0x31, 7 },
- { 0x177, 9 },
- { 0x77, 7 },
- { 0x176, 9 },
- { 0x1, 3 },
- { 0x0, 3 },
- { 0x1A, 5 },
- { 0x19, 5 },
- { 0x3A, 6 },
- { 0x19, 6 },
- { 0x5C, 7 },
- { 0xBA, 8 },
- { 0x61, 8 },
- { 0xC1, 9 },
- { 0x180, 10 },
- { 0x302, 11 },
- { 0x607, 12 },
- { 0x606, 12 },
- { 0x2, 3 },
- { 0xA, 4 },
- { 0x1F, 5 },
- { 0x1C, 5 },
- { 0x37, 6 },
- { 0x16, 5 },
- { 0x76, 7 },
- { 0xD, 5 },
- { 0x2F, 6 }
- },
- { /* AC bias group 1, table 15 */
- { 0x0, 3 },
- { 0xA, 4 },
- { 0x1A, 5 },
- { 0xC, 4 },
- { 0x1D, 5 },
- { 0x39, 6 },
- { 0x78, 7 },
- { 0x5E, 7 },
- { 0x393, 11 },
- { 0x2, 3 },
- { 0x1, 3 },
- { 0x16, 5 },
- { 0xF, 5 },
- { 0x2E, 6 },
- { 0x5F, 7 },
- { 0x73, 8 },
- { 0xE5, 9 },
- { 0x1C8, 10 },
- { 0xE4A, 13 },
- { 0x1C97, 14 },
- { 0x1C96, 14 },
- { 0xE49, 13 },
- { 0xE48, 13 },
- { 0x4, 3 },
- { 0x6, 4 },
- { 0x1F, 5 },
- { 0x1B, 5 },
- { 0x1D, 6 },
- { 0x38, 6 },
- { 0x38, 7 },
- { 0x3D, 6 },
- { 0x79, 7 }
- }
-};
-
-static const uint16_t ac_bias_1[16][32][2] = {
- { /* AC bias group 2, table 0 */
- { 0xB, 5 },
- { 0x2B, 7 },
- { 0x54, 8 },
- { 0x1B7, 9 },
- { 0x6D9, 11 },
- { 0xDB1, 12 },
- { 0xDB0, 12 },
- { 0x2, 4 },
- { 0xAB, 9 },
- { 0x9, 4 },
- { 0xA, 4 },
- { 0x7, 4 },
- { 0x8, 4 },
- { 0xF, 4 },
- { 0xC, 4 },
- { 0x3, 4 },
- { 0x1D, 5 },
- { 0x4, 4 },
- { 0xB, 4 },
- { 0x6, 4 },
- { 0x1A, 5 },
- { 0x3, 6 },
- { 0xAA, 9 },
- { 0x1, 4 },
- { 0x0, 5 },
- { 0x14, 6 },
- { 0x6C, 7 },
- { 0xDA, 8 },
- { 0x2, 6 },
- { 0x36D, 10 },
- { 0x1C, 5 },
- { 0x37, 6 }
- },
- { /* AC bias group 2, table 1 */
- { 0x1D, 5 },
- { 0x4, 6 },
- { 0xB6, 8 },
- { 0x6A, 8 },
- { 0x5B9, 11 },
- { 0x16E1, 13 },
- { 0x16E0, 13 },
- { 0x7, 4 },
- { 0x16F, 9 },
- { 0xC, 4 },
- { 0xD, 4 },
- { 0x9, 4 },
- { 0x8, 4 },
- { 0xF, 4 },
- { 0xA, 4 },
- { 0x3, 4 },
- { 0x17, 5 },
- { 0x2, 4 },
- { 0x4, 4 },
- { 0x1C, 5 },
- { 0x2C, 6 },
- { 0x6B, 8 },
- { 0xB71, 12 },
- { 0x5, 4 },
- { 0x3, 5 },
- { 0x1B, 6 },
- { 0x5A, 7 },
- { 0x34, 7 },
- { 0x5, 6 },
- { 0x2DD, 10 },
- { 0x0, 4 },
- { 0xC, 5 }
- },
- { /* AC bias group 2, table 2 */
- { 0x3, 4 },
- { 0x7F, 7 },
- { 0xA1, 8 },
- { 0xA0, 8 },
- { 0x20C, 10 },
- { 0x834, 12 },
- { 0x106B, 13 },
- { 0x7, 4 },
- { 0x82, 8 },
- { 0xE, 4 },
- { 0xD, 4 },
- { 0xB, 4 },
- { 0xC, 4 },
- { 0x0, 3 },
- { 0x9, 4 },
- { 0x2, 4 },
- { 0x11, 5 },
- { 0x1E, 5 },
- { 0x15, 5 },
- { 0x3E, 6 },
- { 0x40, 7 },
- { 0x41B, 11 },
- { 0x106A, 13 },
- { 0x6, 4 },
- { 0xA, 5 },
- { 0x29, 6 },
- { 0x7E, 7 },
- { 0x51, 7 },
- { 0x21, 6 },
- { 0x107, 9 },
- { 0x4, 4 },
- { 0xB, 5 }
- },
- { /* AC bias group 2, table 3 */
- { 0x7, 4 },
- { 0x1B, 6 },
- { 0xF6, 8 },
- { 0xE9, 8 },
- { 0x3A1, 10 },
- { 0x740, 11 },
- { 0xE82, 12 },
- { 0x1F, 5 },
- { 0x1EF, 9 },
- { 0x1, 3 },
- { 0x2, 3 },
- { 0xB, 4 },
- { 0xC, 4 },
- { 0xD, 4 },
- { 0x8, 4 },
- { 0x1C, 5 },
- { 0x3, 5 },
- { 0x12, 5 },
- { 0x2, 5 },
- { 0x75, 7 },
- { 0x1D1, 9 },
- { 0x1D07, 13 },
- { 0x1D06, 13 },
- { 0xA, 4 },
- { 0x13, 5 },
- { 0x3B, 6 },
- { 0x1A, 6 },
- { 0x7A, 7 },
- { 0x3C, 6 },
- { 0x1EE, 9 },
- { 0x0, 4 },
- { 0xC, 5 }
- },
- { /* AC bias group 2, table 4 */
- { 0xD, 4 },
- { 0x3D, 6 },
- { 0x42, 7 },
- { 0x37, 7 },
- { 0xD9, 9 },
- { 0x362, 11 },
- { 0x6C6, 12 },
- { 0x1F, 5 },
- { 0x86, 8 },
- { 0x1, 3 },
- { 0x2, 3 },
- { 0xC, 4 },
- { 0xB, 4 },
- { 0xA, 4 },
- { 0x1, 4 },
- { 0xF, 5 },
- { 0x25, 6 },
- { 0x3C, 6 },
- { 0x1A, 6 },
- { 0x87, 8 },
- { 0x1B0, 10 },
- { 0xD8F, 13 },
- { 0xD8E, 13 },
- { 0xE, 4 },
- { 0x13, 5 },
- { 0xC, 5 },
- { 0x24, 6 },
- { 0x20, 6 },
- { 0x11, 5 },
- { 0x6D, 8 },
- { 0x0, 4 },
- { 0xE, 5 }
- },
- { /* AC bias group 2, table 5 */
- { 0x0, 3 },
- { 0x12, 5 },
- { 0x76, 7 },
- { 0x77, 7 },
- { 0x14D, 9 },
- { 0x533, 11 },
- { 0x14C9, 13 },
- { 0x13, 5 },
- { 0xA5, 8 },
- { 0x2, 3 },
- { 0x3, 3 },
- { 0xB, 4 },
- { 0xC, 4 },
- { 0x8, 4 },
- { 0x1A, 5 },
- { 0x2B, 6 },
- { 0x75, 7 },
- { 0x74, 7 },
- { 0xA7, 8 },
- { 0x298, 10 },
- { 0x14C8, 13 },
- { 0x14CB, 13 },
- { 0x14CA, 13 },
- { 0xF, 4 },
- { 0x1C, 5 },
- { 0x7, 5 },
- { 0x2A, 6 },
- { 0x28, 6 },
- { 0x1B, 5 },
- { 0xA4, 8 },
- { 0x2, 4 },
- { 0x6, 5 }
- },
- { /* AC bias group 2, table 6 */
- { 0x2, 3 },
- { 0x1A, 5 },
- { 0x2B, 6 },
- { 0x3A, 6 },
- { 0xED, 8 },
- { 0x283, 10 },
- { 0xA0A, 12 },
- { 0x4, 5 },
- { 0xA1, 8 },
- { 0x4, 3 },
- { 0x3, 3 },
- { 0xB, 4 },
- { 0xC, 4 },
- { 0x1F, 5 },
- { 0x6, 5 },
- { 0x77, 7 },
- { 0xA3, 8 },
- { 0xA2, 8 },
- { 0x140, 9 },
- { 0x1417, 13 },
- { 0x1416, 13 },
- { 0xA09, 12 },
- { 0xA08, 12 },
- { 0x0, 3 },
- { 0x1E, 5 },
- { 0x7, 5 },
- { 0x2A, 6 },
- { 0x29, 6 },
- { 0x1C, 5 },
- { 0xEC, 8 },
- { 0x1B, 5 },
- { 0x5, 5 }
- },
- { /* AC bias group 2, table 7 */
- { 0x2, 3 },
- { 0x2, 4 },
- { 0x18, 5 },
- { 0x1D, 5 },
- { 0x35, 6 },
- { 0xE4, 8 },
- { 0x1CF, 11 },
- { 0x1D, 7 },
- { 0x72, 9 },
- { 0x4, 3 },
- { 0x5, 3 },
- { 0x6, 4 },
- { 0x7, 4 },
- { 0x6, 5 },
- { 0x73, 7 },
- { 0x38, 8 },
- { 0x1CE, 11 },
- { 0x39B, 12 },
- { 0x398, 12 },
- { 0x733, 13 },
- { 0x732, 13 },
- { 0x735, 13 },
- { 0x734, 13 },
- { 0x0, 3 },
- { 0x1F, 5 },
- { 0x1B, 5 },
- { 0x34, 6 },
- { 0xF, 6 },
- { 0x1E, 5 },
- { 0xE5, 8 },
- { 0x19, 5 },
- { 0x38, 6 }
- },
- { /* AC bias group 2, table 8 */
- { 0x16, 5 },
- { 0x50, 7 },
- { 0x172, 9 },
- { 0x2E7, 10 },
- { 0x1732, 13 },
- { 0x2E67, 14 },
- { 0x2E66, 14 },
- { 0x6, 4 },
- { 0x51, 7 },
- { 0x1, 3 },
- { 0x0, 3 },
- { 0xD, 4 },
- { 0xC, 4 },
- { 0x9, 4 },
- { 0x1C, 5 },
- { 0x9, 5 },
- { 0x1C, 6 },
- { 0x1D, 6 },
- { 0x5D, 7 },
- { 0xB8, 8 },
- { 0x5CD, 11 },
- { 0x1731, 13 },
- { 0x1730, 13 },
- { 0xF, 4 },
- { 0x5, 4 },
- { 0xF, 5 },
- { 0x8, 5 },
- { 0x29, 6 },
- { 0x1D, 5 },
- { 0x2F, 6 },
- { 0x8, 4 },
- { 0x15, 5 }
- },
- { /* AC bias group 2, table 9 */
- { 0x9, 4 },
- { 0x21, 6 },
- { 0x40, 7 },
- { 0xAD, 8 },
- { 0x2B0, 10 },
- { 0x1589, 13 },
- { 0x1588, 13 },
- { 0x1C, 5 },
- { 0x5F, 7 },
- { 0x0, 3 },
- { 0xF, 4 },
- { 0xD, 4 },
- { 0xC, 4 },
- { 0x6, 4 },
- { 0x11, 5 },
- { 0x2A, 6 },
- { 0x57, 7 },
- { 0x5E, 7 },
- { 0x41, 7 },
- { 0x159, 9 },
- { 0x563, 11 },
- { 0x158B, 13 },
- { 0x158A, 13 },
- { 0x1, 3 },
- { 0x5, 4 },
- { 0x14, 5 },
- { 0x3B, 6 },
- { 0x2E, 6 },
- { 0x4, 4 },
- { 0x3A, 6 },
- { 0x7, 4 },
- { 0x16, 5 }
- },
- { /* AC bias group 2, table 10 */
- { 0xE, 4 },
- { 0x7, 5 },
- { 0x46, 7 },
- { 0x45, 7 },
- { 0x64, 9 },
- { 0x32A, 12 },
- { 0x657, 13 },
- { 0x18, 5 },
- { 0xD, 6 },
- { 0x0, 3 },
- { 0xF, 4 },
- { 0xA, 4 },
- { 0xB, 4 },
- { 0x1A, 5 },
- { 0x36, 6 },
- { 0x47, 7 },
- { 0x44, 7 },
- { 0x18, 7 },
- { 0x33, 8 },
- { 0xCB, 10 },
- { 0x656, 13 },
- { 0x329, 12 },
- { 0x328, 12 },
- { 0x2, 3 },
- { 0x6, 4 },
- { 0x19, 5 },
- { 0xE, 5 },
- { 0x37, 6 },
- { 0x9, 4 },
- { 0xF, 5 },
- { 0x2, 4 },
- { 0x10, 5 }
- },
- { /* AC bias group 2, table 11 */
- { 0x3, 3 },
- { 0x18, 5 },
- { 0x23, 6 },
- { 0x77, 7 },
- { 0x194, 9 },
- { 0x1956, 13 },
- { 0x32AF, 14 },
- { 0x3A, 6 },
- { 0x76, 7 },
- { 0x2, 3 },
- { 0x1, 3 },
- { 0x1F, 5 },
- { 0x1E, 5 },
- { 0x14, 5 },
- { 0x22, 6 },
- { 0x64, 7 },
- { 0x197, 9 },
- { 0x196, 9 },
- { 0x32B, 10 },
- { 0x654, 11 },
- { 0x32AE, 14 },
- { 0x1955, 13 },
- { 0x1954, 13 },
- { 0x0, 3 },
- { 0x9, 4 },
- { 0x1C, 5 },
- { 0x15, 5 },
- { 0x10, 5 },
- { 0xD, 4 },
- { 0x17, 5 },
- { 0x16, 5 },
- { 0x33, 6 }
- },
- { /* AC bias group 2, table 12 */
- { 0x5, 3 },
- { 0x6, 4 },
- { 0x3E, 6 },
- { 0x10, 5 },
- { 0x48, 7 },
- { 0x93F, 12 },
- { 0x24FA, 14 },
- { 0x32, 6 },
- { 0x67, 7 },
- { 0x2, 3 },
- { 0x1, 3 },
- { 0x1B, 5 },
- { 0x1E, 5 },
- { 0x34, 6 },
- { 0x66, 7 },
- { 0x92, 8 },
- { 0x126, 9 },
- { 0x24E, 10 },
- { 0x49E, 11 },
- { 0x49F7, 15 },
- { 0x49F6, 15 },
- { 0x24F9, 14 },
- { 0x24F8, 14 },
- { 0x0, 3 },
- { 0x7, 4 },
- { 0x18, 5 },
- { 0x11, 5 },
- { 0x3F, 6 },
- { 0xE, 4 },
- { 0x13, 5 },
- { 0x35, 6 },
- { 0x25, 6 }
- },
- { /* AC bias group 2, table 13 */
- { 0x5, 3 },
- { 0x8, 4 },
- { 0x12, 5 },
- { 0x1C, 5 },
- { 0x1C, 6 },
- { 0xEA, 9 },
- { 0x1D75, 14 },
- { 0x1E, 6 },
- { 0x66, 7 },
- { 0x1, 3 },
- { 0x2, 3 },
- { 0x1B, 5 },
- { 0x1A, 5 },
- { 0x1F, 6 },
- { 0x3B, 7 },
- { 0x74, 8 },
- { 0x1D6, 10 },
- { 0x3AF, 11 },
- { 0x1D74, 14 },
- { 0x1D77, 14 },
- { 0x1D76, 14 },
- { 0xEB9, 13 },
- { 0xEB8, 13 },
- { 0xF, 4 },
- { 0x6, 4 },
- { 0x13, 5 },
- { 0x3B, 6 },
- { 0x3A, 6 },
- { 0x0, 3 },
- { 0x18, 5 },
- { 0x32, 6 },
- { 0x67, 7 }
- },
- { /* AC bias group 2, table 14 */
- { 0x4, 3 },
- { 0xA, 4 },
- { 0x1B, 5 },
- { 0xC, 4 },
- { 0xD, 5 },
- { 0xE6, 8 },
- { 0x684, 11 },
- { 0x72, 7 },
- { 0xE7, 8 },
- { 0x2, 3 },
- { 0x1, 3 },
- { 0x17, 5 },
- { 0x16, 5 },
- { 0x18, 6 },
- { 0xD1, 8 },
- { 0x1A0, 9 },
- { 0x686, 11 },
- { 0xD0F, 12 },
- { 0xD0A, 12 },
- { 0x1A17, 13 },
- { 0x1A16, 13 },
- { 0x1A1D, 13 },
- { 0x1A1C, 13 },
- { 0xF, 4 },
- { 0x1D, 5 },
- { 0xE, 5 },
- { 0x35, 6 },
- { 0x38, 6 },
- { 0x0, 3 },
- { 0xF, 5 },
- { 0x19, 6 },
- { 0x69, 7 }
- },
- { /* AC bias group 2, table 15 */
- { 0x3, 3 },
- { 0xC, 4 },
- { 0x1B, 5 },
- { 0x0, 3 },
- { 0x3, 4 },
- { 0x2E, 6 },
- { 0x51, 9 },
- { 0xBC, 8 },
- { 0x53, 9 },
- { 0x4, 3 },
- { 0x2, 3 },
- { 0x16, 5 },
- { 0x15, 5 },
- { 0x15, 7 },
- { 0x50, 9 },
- { 0xA4, 10 },
- { 0x294, 12 },
- { 0x52B, 13 },
- { 0x52A, 13 },
- { 0x52D, 13 },
- { 0x52C, 13 },
- { 0x52F, 13 },
- { 0x52E, 13 },
- { 0xE, 4 },
- { 0x1A, 5 },
- { 0x4, 5 },
- { 0x28, 6 },
- { 0x29, 6 },
- { 0xF, 4 },
- { 0xB, 6 },
- { 0x5F, 7 },
- { 0xBD, 8 }
- }
-};
-
-static const uint16_t ac_bias_2[16][32][2] = {
- { /* AC bias group 3, table 0 */
- { 0x3, 4 },
- { 0x9, 6 },
- { 0xD0, 8 },
- { 0x1A3, 9 },
- { 0x344, 10 },
- { 0xD14, 12 },
- { 0x1A2B, 13 },
- { 0x4, 4 },
- { 0x15, 7 },
- { 0x0, 3 },
- { 0xF, 4 },
- { 0xB, 4 },
- { 0xC, 4 },
- { 0xE, 4 },
- { 0x9, 4 },
- { 0x1B, 5 },
- { 0xA, 5 },
- { 0x14, 5 },
- { 0xD, 5 },
- { 0x2A, 6 },
- { 0x14, 7 },
- { 0x68B, 11 },
- { 0x1A2A, 13 },
- { 0x8, 4 },
- { 0xB, 5 },
- { 0x2B, 6 },
- { 0xB, 6 },
- { 0x69, 7 },
- { 0x35, 6 },
- { 0x8, 6 },
- { 0x7, 4 },
- { 0xC, 5 }
- },
- { /* AC bias group 3, table 1 */
- { 0xA, 4 },
- { 0x3C, 6 },
- { 0x32, 7 },
- { 0x30, 7 },
- { 0xC5, 9 },
- { 0x621, 12 },
- { 0x620, 12 },
- { 0x1F, 5 },
- { 0x33, 7 },
- { 0x1, 3 },
- { 0x0, 3 },
- { 0xE, 4 },
- { 0xD, 4 },
- { 0xC, 4 },
- { 0x4, 4 },
- { 0xD, 5 },
- { 0x26, 6 },
- { 0x27, 6 },
- { 0x14, 6 },
- { 0x63, 8 },
- { 0x189, 10 },
- { 0x623, 12 },
- { 0x622, 12 },
- { 0xB, 4 },
- { 0x12, 5 },
- { 0x3D, 6 },
- { 0x22, 6 },
- { 0x15, 6 },
- { 0xB, 5 },
- { 0x23, 6 },
- { 0x7, 4 },
- { 0x10, 5 }
- },
- { /* AC bias group 3, table 2 */
- { 0xF, 4 },
- { 0xC, 5 },
- { 0x43, 7 },
- { 0x10, 6 },
- { 0x44, 8 },
- { 0x114, 10 },
- { 0x455, 12 },
- { 0x18, 5 },
- { 0x23, 7 },
- { 0x1, 3 },
- { 0x0, 3 },
- { 0xE, 4 },
- { 0xD, 4 },
- { 0x9, 4 },
- { 0x19, 5 },
- { 0x9, 5 },
- { 0x17, 6 },
- { 0x16, 6 },
- { 0x42, 7 },
- { 0x8B, 9 },
- { 0x454, 12 },
- { 0x457, 12 },
- { 0x456, 12 },
- { 0xB, 4 },
- { 0x15, 5 },
- { 0xA, 5 },
- { 0x29, 6 },
- { 0x20, 6 },
- { 0xD, 5 },
- { 0x28, 6 },
- { 0x7, 4 },
- { 0x11, 5 }
- },
- { /* AC bias group 3, table 3 */
- { 0x1, 3 },
- { 0x1A, 5 },
- { 0x29, 6 },
- { 0x2A, 6 },
- { 0xA0, 8 },
- { 0x285, 10 },
- { 0x1425, 13 },
- { 0x2, 5 },
- { 0x0, 7 },
- { 0x2, 3 },
- { 0x3, 3 },
- { 0xC, 4 },
- { 0xB, 4 },
- { 0x8, 4 },
- { 0x12, 5 },
- { 0x1, 6 },
- { 0x51, 7 },
- { 0x1, 7 },
- { 0x143, 9 },
- { 0x508, 11 },
- { 0x1424, 13 },
- { 0x1427, 13 },
- { 0x1426, 13 },
- { 0xF, 4 },
- { 0x1C, 5 },
- { 0x3, 5 },
- { 0x37, 6 },
- { 0x2B, 6 },
- { 0x13, 5 },
- { 0x36, 6 },
- { 0x1D, 5 },
- { 0x1, 5 }
- },
- { /* AC bias group 3, table 4 */
- { 0x4, 3 },
- { 0x1F, 5 },
- { 0x3D, 6 },
- { 0x6, 5 },
- { 0x16, 7 },
- { 0x53, 9 },
- { 0x14A, 11 },
- { 0x34, 6 },
- { 0x2A, 8 },
- { 0x2, 3 },
- { 0x3, 3 },
- { 0xB, 4 },
- { 0xC, 4 },
- { 0x1C, 5 },
- { 0x37, 6 },
- { 0x17, 7 },
- { 0x2B, 8 },
- { 0x28, 8 },
- { 0xA4, 10 },
- { 0x52D, 13 },
- { 0x52C, 13 },
- { 0x52F, 13 },
- { 0x52E, 13 },
- { 0x0, 3 },
- { 0x1D, 5 },
- { 0x7, 5 },
- { 0x4, 5 },
- { 0x35, 6 },
- { 0x14, 5 },
- { 0x36, 6 },
- { 0x15, 5 },
- { 0x3C, 6 }
- },
- { /* AC bias group 3, table 5 */
- { 0x4, 3 },
- { 0xA, 4 },
- { 0x7, 5 },
- { 0x1D, 5 },
- { 0x9, 6 },
- { 0x1F3, 9 },
- { 0x7C7, 11 },
- { 0x8, 6 },
- { 0x1F0, 9 },
- { 0x3, 3 },
- { 0x2, 3 },
- { 0xD, 4 },
- { 0xC, 4 },
- { 0x17, 5 },
- { 0x7D, 7 },
- { 0x1F2, 9 },
- { 0x7C6, 11 },
- { 0x7C5, 11 },
- { 0x1F12, 13 },
- { 0x3E27, 14 },
- { 0x3E26, 14 },
- { 0x1F11, 13 },
- { 0x1F10, 13 },
- { 0x0, 3 },
- { 0x1E, 5 },
- { 0x6, 5 },
- { 0x39, 6 },
- { 0x38, 6 },
- { 0x3F, 6 },
- { 0x2C, 6 },
- { 0x5, 5 },
- { 0x2D, 6 }
- },
- { /* AC bias group 3, table 6 */
- { 0x2, 3 },
- { 0x7, 4 },
- { 0x18, 5 },
- { 0x3, 4 },
- { 0x5, 5 },
- { 0x35, 7 },
- { 0x4F, 9 },
- { 0x12, 7 },
- { 0x4E5, 13 },
- { 0x5, 3 },
- { 0x4, 3 },
- { 0xD, 4 },
- { 0xE, 4 },
- { 0x33, 6 },
- { 0x26, 8 },
- { 0x9D, 10 },
- { 0x4E4, 13 },
- { 0x4E7, 13 },
- { 0x4E6, 13 },
- { 0x4E1, 13 },
- { 0x4E0, 13 },
- { 0x4E3, 13 },
- { 0x4E2, 13 },
- { 0x0, 3 },
- { 0x1F, 5 },
- { 0xC, 5 },
- { 0x3D, 6 },
- { 0x3C, 6 },
- { 0x32, 6 },
- { 0x34, 7 },
- { 0x1B, 6 },
- { 0x8, 6 }
- },
- { /* AC bias group 3, table 7 */
- { 0x0, 3 },
- { 0x4, 4 },
- { 0x1C, 5 },
- { 0xF, 4 },
- { 0x2, 4 },
- { 0x7, 5 },
- { 0x75, 7 },
- { 0xE8, 8 },
- { 0x1D2A, 13 },
- { 0x5, 3 },
- { 0x4, 3 },
- { 0xD, 4 },
- { 0xC, 4 },
- { 0x77, 7 },
- { 0xE96, 12 },
- { 0x3A57, 14 },
- { 0x3A56, 14 },
- { 0x3A5D, 14 },
- { 0x3A5C, 14 },
- { 0x3A5F, 14 },
- { 0x3A5E, 14 },
- { 0x1D29, 13 },
- { 0x1D28, 13 },
- { 0x3, 3 },
- { 0x6, 5 },
- { 0xA, 5 },
- { 0x2C, 7 },
- { 0x17, 6 },
- { 0x76, 7 },
- { 0x1D3, 9 },
- { 0x3A4, 10 },
- { 0x2D, 7 }
- },
- { /* AC bias group 3, table 8 */
- { 0xA, 4 },
- { 0x24, 6 },
- { 0xBF, 8 },
- { 0x85, 8 },
- { 0x211, 10 },
- { 0x842, 12 },
- { 0x1087, 13 },
- { 0x18, 5 },
- { 0x20, 6 },
- { 0x1, 3 },
- { 0x2, 3 },
- { 0xE, 4 },
- { 0xD, 4 },
- { 0x7, 4 },
- { 0x13, 5 },
- { 0x25, 6 },
- { 0x5E, 7 },
- { 0x43, 7 },
- { 0xBE, 8 },
- { 0x109, 9 },
- { 0x1086, 13 },
- { 0x841, 12 },
- { 0x840, 12 },
- { 0xF, 4 },
- { 0x1, 4 },
- { 0x11, 5 },
- { 0x0, 5 },
- { 0x2E, 6 },
- { 0x19, 5 },
- { 0x1, 5 },
- { 0x6, 4 },
- { 0x16, 5 }
- },
- { /* AC bias group 3, table 9 */
- { 0x2, 3 },
- { 0xF, 5 },
- { 0x6F, 7 },
- { 0x61, 7 },
- { 0x374, 10 },
- { 0x1BA8, 13 },
- { 0x3753, 14 },
- { 0x12, 5 },
- { 0x36, 6 },
- { 0x0, 3 },
- { 0x1, 3 },
- { 0xA, 4 },
- { 0xB, 4 },
- { 0x1A, 5 },
- { 0x31, 6 },
- { 0x60, 7 },
- { 0xDC, 8 },
- { 0x1BB, 9 },
- { 0x6EB, 11 },
- { 0x1BAB, 13 },
- { 0x3752, 14 },
- { 0x3755, 14 },
- { 0x3754, 14 },
- { 0xE, 4 },
- { 0x6, 4 },
- { 0x13, 5 },
- { 0xE, 5 },
- { 0x3E, 6 },
- { 0x8, 4 },
- { 0x1E, 5 },
- { 0x19, 5 },
- { 0x3F, 6 }
- },
- { /* AC bias group 3, table 10 */
- { 0x3, 3 },
- { 0x1C, 5 },
- { 0x25, 6 },
- { 0x24, 6 },
- { 0x1DA, 9 },
- { 0x1DBD, 13 },
- { 0x3B7C, 14 },
- { 0x3C, 6 },
- { 0x3D, 6 },
- { 0x0, 3 },
- { 0x1, 3 },
- { 0xB, 4 },
- { 0xA, 4 },
- { 0xB, 5 },
- { 0x77, 7 },
- { 0xEC, 8 },
- { 0x3B6, 10 },
- { 0x76E, 11 },
- { 0x1DBF, 13 },
- { 0x76FB, 15 },
- { 0x76FA, 15 },
- { 0x3B79, 14 },
- { 0x3B78, 14 },
- { 0xD, 4 },
- { 0x1F, 5 },
- { 0x13, 5 },
- { 0xA, 5 },
- { 0x8, 5 },
- { 0xC, 4 },
- { 0x8, 4 },
- { 0x9, 5 },
- { 0x3A, 6 }
- },
- { /* AC bias group 3, table 11 */
- { 0x5, 3 },
- { 0x3, 4 },
- { 0x4, 5 },
- { 0x10, 5 },
- { 0x8F, 8 },
- { 0x475, 11 },
- { 0x11D1, 13 },
- { 0x79, 7 },
- { 0x27, 6 },
- { 0x2, 3 },
- { 0x3, 3 },
- { 0x1, 4 },
- { 0x0, 4 },
- { 0x26, 6 },
- { 0x46, 7 },
- { 0x11C, 9 },
- { 0x477, 11 },
- { 0x8ED, 12 },
- { 0x11D0, 13 },
- { 0x11D3, 13 },
- { 0x11D2, 13 },
- { 0x11D9, 13 },
- { 0x11D8, 13 },
- { 0xD, 4 },
- { 0x1F, 5 },
- { 0x12, 5 },
- { 0x5, 5 },
- { 0x3D, 6 },
- { 0xC, 4 },
- { 0xE, 4 },
- { 0x22, 6 },
- { 0x78, 7 }
- },
- { /* AC bias group 3, table 12 */
- { 0x5, 3 },
- { 0xC, 4 },
- { 0x1B, 5 },
- { 0x0, 4 },
- { 0x6, 6 },
- { 0x3E2, 10 },
- { 0x3E3D, 14 },
- { 0xF, 7 },
- { 0x34, 6 },
- { 0x3, 3 },
- { 0x2, 3 },
- { 0x1E, 5 },
- { 0x1D, 5 },
- { 0x7D, 7 },
- { 0x1F0, 9 },
- { 0x7C6, 11 },
- { 0x3E3C, 14 },
- { 0x3E3F, 14 },
- { 0x3E3E, 14 },
- { 0x3E39, 14 },
- { 0x3E38, 14 },
- { 0x3E3B, 14 },
- { 0x3E3A, 14 },
- { 0x8, 4 },
- { 0x1C, 5 },
- { 0x2, 5 },
- { 0x3F, 6 },
- { 0x35, 6 },
- { 0x9, 4 },
- { 0x1, 3 },
- { 0xE, 7 },
- { 0xF9, 8 }
- },
- { /* AC bias group 3, table 13 */
- { 0x4, 3 },
- { 0xB, 4 },
- { 0x1, 4 },
- { 0xA, 4 },
- { 0x1E, 6 },
- { 0xE0, 9 },
- { 0xE1E, 13 },
- { 0x71, 8 },
- { 0x39, 7 },
- { 0x7, 3 },
- { 0x6, 3 },
- { 0xD, 5 },
- { 0xC, 5 },
- { 0x20, 7 },
- { 0x1C2, 10 },
- { 0x1C3F, 14 },
- { 0x1C3E, 14 },
- { 0xE19, 13 },
- { 0xE18, 13 },
- { 0xE1B, 13 },
- { 0xE1A, 13 },
- { 0xE1D, 13 },
- { 0xE1C, 13 },
- { 0x0, 4 },
- { 0x9, 5 },
- { 0x1D, 6 },
- { 0x1F, 6 },
- { 0x11, 6 },
- { 0x5, 4 },
- { 0x1, 3 },
- { 0x43, 8 },
- { 0x42, 8 }
- },
- { /* AC bias group 3, table 14 */
- { 0x4, 3 },
- { 0xD, 4 },
- { 0x7, 4 },
- { 0x2, 3 },
- { 0x14, 5 },
- { 0x16C, 9 },
- { 0x16D1, 13 },
- { 0x2DF, 10 },
- { 0x16E, 9 },
- { 0x0, 2 },
- { 0x7, 3 },
- { 0x2C, 6 },
- { 0x2B, 6 },
- { 0x2DE, 10 },
- { 0x16D0, 13 },
- { 0x16D3, 13 },
- { 0x16D2, 13 },
- { 0x2DB5, 14 },
- { 0x2DB4, 14 },
- { 0x2DB7, 14 },
- { 0x2DB6, 14 },
- { 0x16D9, 13 },
- { 0x16D8, 13 },
- { 0xC, 5 },
- { 0x2A, 6 },
- { 0x5A, 7 },
- { 0x1B, 6 },
- { 0x1A, 6 },
- { 0x17, 5 },
- { 0xC, 4 },
- { 0x5B7, 11 },
- { 0x5B5, 11 }
- },
- { /* AC bias group 3, table 15 */
- { 0x2, 2 },
- { 0xF, 4 },
- { 0x1C, 5 },
- { 0xC, 4 },
- { 0x3B, 6 },
- { 0x1AC, 9 },
- { 0x1AD8, 13 },
- { 0x35B3, 14 },
- { 0x35B2, 14 },
- { 0x1, 2 },
- { 0x0, 2 },
- { 0x69, 7 },
- { 0x68, 7 },
- { 0x35BD, 14 },
- { 0x35BC, 14 },
- { 0x35BF, 14 },
- { 0x35BE, 14 },
- { 0x35B9, 14 },
- { 0x35B8, 14 },
- { 0x35BB, 14 },
- { 0x35BA, 14 },
- { 0x35B5, 14 },
- { 0x35B4, 14 },
- { 0x1A9, 9 },
- { 0x1A8, 9 },
- { 0x35A, 10 },
- { 0xD7, 8 },
- { 0xD5, 8 },
- { 0x3A, 6 },
- { 0x1B, 5 },
- { 0x35B7, 14 },
- { 0x35B6, 14 }
- }
-};
-
-static const uint16_t ac_bias_3[16][32][2] = {
- { /* AC bias group 4, table 0 */
- { 0x0, 3 },
- { 0x10, 5 },
- { 0x72, 7 },
- { 0x71, 7 },
- { 0x154, 9 },
- { 0xAAB, 12 },
- { 0xAA8, 12 },
- { 0x14, 5 },
- { 0x70, 7 },
- { 0x2, 3 },
- { 0x3, 3 },
- { 0xC, 4 },
- { 0xB, 4 },
- { 0x3, 4 },
- { 0x11, 5 },
- { 0x73, 7 },
- { 0x54, 7 },
- { 0xAB, 8 },
- { 0x2AB, 10 },
- { 0x1553, 13 },
- { 0x1552, 13 },
- { 0x1555, 13 },
- { 0x1554, 13 },
- { 0xD, 4 },
- { 0x1E, 5 },
- { 0x12, 5 },
- { 0x3E, 6 },
- { 0x2B, 6 },
- { 0x2, 4 },
- { 0x3F, 6 },
- { 0x1D, 5 },
- { 0x13, 5 }
- },
- { /* AC bias group 4, table 1 */
- { 0x3, 3 },
- { 0x1F, 5 },
- { 0x29, 6 },
- { 0x3D, 6 },
- { 0xC, 7 },
- { 0x69, 10 },
- { 0x345, 13 },
- { 0x2, 5 },
- { 0x28, 6 },
- { 0x2, 3 },
- { 0x1, 3 },
- { 0xE, 4 },
- { 0xC, 4 },
- { 0x15, 5 },
- { 0x7, 6 },
- { 0x1B, 8 },
- { 0x6B, 10 },
- { 0x6A, 10 },
- { 0x344, 13 },
- { 0x347, 13 },
- { 0x346, 13 },
- { 0x1A1, 12 },
- { 0x1A0, 12 },
- { 0xB, 4 },
- { 0x1A, 5 },
- { 0x12, 5 },
- { 0x0, 5 },
- { 0x3C, 6 },
- { 0x8, 4 },
- { 0x1B, 5 },
- { 0x13, 5 },
- { 0x1, 5 }
- },
- { /* AC bias group 4, table 2 */
- { 0x4, 3 },
- { 0x4, 4 },
- { 0x3F, 6 },
- { 0x14, 5 },
- { 0x56, 7 },
- { 0x15C, 9 },
- { 0x15D5, 13 },
- { 0x3C, 6 },
- { 0x2A, 6 },
- { 0x0, 3 },
- { 0x1, 3 },
- { 0xE, 4 },
- { 0xD, 4 },
- { 0xC, 5 },
- { 0xAF, 8 },
- { 0x2BB, 10 },
- { 0x15D4, 13 },
- { 0x15D7, 13 },
- { 0x15D6, 13 },
- { 0x15D1, 13 },
- { 0x15D0, 13 },
- { 0x15D3, 13 },
- { 0x15D2, 13 },
- { 0xB, 4 },
- { 0x19, 5 },
- { 0xD, 5 },
- { 0x3E, 6 },
- { 0x31, 6 },
- { 0x7, 4 },
- { 0x5, 4 },
- { 0x3D, 6 },
- { 0x30, 6 }
- },
- { /* AC bias group 4, table 3 */
- { 0x5, 3 },
- { 0x8, 4 },
- { 0x1A, 5 },
- { 0x0, 4 },
- { 0x36, 6 },
- { 0x11, 8 },
- { 0x106, 12 },
- { 0xA, 7 },
- { 0x6E, 7 },
- { 0x2, 3 },
- { 0x3, 3 },
- { 0x3, 4 },
- { 0x2, 4 },
- { 0x6F, 7 },
- { 0x21, 9 },
- { 0x20F, 13 },
- { 0x20E, 13 },
- { 0x101, 12 },
- { 0x100, 12 },
- { 0x103, 12 },
- { 0x102, 12 },
- { 0x105, 12 },
- { 0x104, 12 },
- { 0xC, 4 },
- { 0x1E, 5 },
- { 0x3, 5 },
- { 0x3E, 6 },
- { 0x3F, 6 },
- { 0x9, 4 },
- { 0xE, 4 },
- { 0xB, 7 },
- { 0x9, 7 }
- },
- { /* AC bias group 4, table 4 */
- { 0x2, 3 },
- { 0xE, 4 },
- { 0x1E, 5 },
- { 0xC, 4 },
- { 0x1F, 5 },
- { 0x6E, 7 },
- { 0xAD, 10 },
- { 0xAF, 10 },
- { 0x14, 7 },
- { 0x4, 3 },
- { 0x3, 3 },
- { 0x1A, 5 },
- { 0x17, 5 },
- { 0x2A, 8 },
- { 0x576, 13 },
- { 0xAEF, 14 },
- { 0xAEE, 14 },
- { 0x571, 13 },
- { 0x570, 13 },
- { 0x573, 13 },
- { 0x572, 13 },
- { 0x575, 13 },
- { 0x574, 13 },
- { 0x3, 4 },
- { 0x16, 5 },
- { 0x4, 5 },
- { 0x36, 6 },
- { 0xB, 6 },
- { 0xA, 4 },
- { 0x0, 3 },
- { 0x6F, 7 },
- { 0xAC, 10 }
- },
- { /* AC bias group 4, table 5 */
- { 0x4, 3 },
- { 0x5, 4 },
- { 0x3, 3 },
- { 0x1, 3 },
- { 0x4, 4 },
- { 0x2F, 6 },
- { 0x526, 11 },
- { 0x1495, 13 },
- { 0xA6, 8 },
- { 0x7, 3 },
- { 0x6, 3 },
- { 0x2D, 6 },
- { 0x2C, 6 },
- { 0x1494, 13 },
- { 0x1497, 13 },
- { 0x1496, 13 },
- { 0x1491, 13 },
- { 0x1490, 13 },
- { 0x1493, 13 },
- { 0x1492, 13 },
- { 0x293D, 14 },
- { 0x293C, 14 },
- { 0x293F, 14 },
- { 0x0, 3 },
- { 0x28, 6 },
- { 0xA5, 8 },
- { 0x148, 9 },
- { 0xA7, 8 },
- { 0x2E, 6 },
- { 0x15, 5 },
- { 0xA4E, 12 },
- { 0x293E, 14 }
- },
- { /* AC bias group 4, table 6 */
- { 0x4, 3 },
- { 0x5, 4 },
- { 0x3, 3 },
- { 0x1, 3 },
- { 0x4, 4 },
- { 0x2F, 6 },
- { 0x526, 11 },
- { 0x1495, 13 },
- { 0xA6, 8 },
- { 0x7, 3 },
- { 0x6, 3 },
- { 0x2D, 6 },
- { 0x2C, 6 },
- { 0x1494, 13 },
- { 0x1497, 13 },
- { 0x1496, 13 },
- { 0x1491, 13 },
- { 0x1490, 13 },
- { 0x1493, 13 },
- { 0x1492, 13 },
- { 0x293D, 14 },
- { 0x293C, 14 },
- { 0x293F, 14 },
- { 0x0, 3 },
- { 0x28, 6 },
- { 0xA5, 8 },
- { 0x148, 9 },
- { 0xA7, 8 },
- { 0x2E, 6 },
- { 0x15, 5 },
- { 0xA4E, 12 },
- { 0x293E, 14 }
- },
- { /* AC bias group 4, table 7 */
- { 0x4, 3 },
- { 0x5, 4 },
- { 0x3, 3 },
- { 0x1, 3 },
- { 0x4, 4 },
- { 0x2F, 6 },
- { 0x526, 11 },
- { 0x1495, 13 },
- { 0xA6, 8 },
- { 0x7, 3 },
- { 0x6, 3 },
- { 0x2D, 6 },
- { 0x2C, 6 },
- { 0x1494, 13 },
- { 0x1497, 13 },
- { 0x1496, 13 },
- { 0x1491, 13 },
- { 0x1490, 13 },
- { 0x1493, 13 },
- { 0x1492, 13 },
- { 0x293D, 14 },
- { 0x293C, 14 },
- { 0x293F, 14 },
- { 0x0, 3 },
- { 0x28, 6 },
- { 0xA5, 8 },
- { 0x148, 9 },
- { 0xA7, 8 },
- { 0x2E, 6 },
- { 0x15, 5 },
- { 0xA4E, 12 },
- { 0x293E, 14 }
- },
- { /* AC bias group 4, table 8 */
- { 0x3, 3 },
- { 0x11, 5 },
- { 0x20, 6 },
- { 0x74, 7 },
- { 0x10D, 9 },
- { 0x863, 12 },
- { 0x860, 12 },
- { 0xA, 5 },
- { 0x75, 7 },
- { 0x1, 3 },
- { 0x0, 3 },
- { 0xB, 4 },
- { 0xA, 4 },
- { 0x18, 5 },
- { 0x38, 6 },
- { 0x42, 7 },
- { 0x10F, 9 },
- { 0x10E, 9 },
- { 0x219, 10 },
- { 0x10C3, 13 },
- { 0x10C2, 13 },
- { 0x10C5, 13 },
- { 0x10C4, 13 },
- { 0xF, 4 },
- { 0x4, 4 },
- { 0x19, 5 },
- { 0xB, 5 },
- { 0x39, 6 },
- { 0x9, 4 },
- { 0x1B, 5 },
- { 0x1A, 5 },
- { 0x3B, 6 }
- },
- { /* AC bias group 4, table 9 */
- { 0x5, 3 },
- { 0x1, 4 },
- { 0x3E, 6 },
- { 0x1, 5 },
- { 0xE2, 8 },
- { 0x1C6F, 13 },
- { 0x38D9, 14 },
- { 0x39, 6 },
- { 0x1F, 6 },
- { 0x2, 3 },
- { 0x1, 3 },
- { 0x9, 4 },
- { 0x8, 4 },
- { 0x0, 5 },
- { 0x70, 7 },
- { 0x1C7, 9 },
- { 0x38C, 10 },
- { 0x71A, 11 },
- { 0x38D8, 14 },
- { 0x38DB, 14 },
- { 0x38DA, 14 },
- { 0x38DD, 14 },
- { 0x38DC, 14 },
- { 0xD, 4 },
- { 0x1D, 5 },
- { 0xE, 5 },
- { 0x3F, 6 },
- { 0x3C, 6 },
- { 0xC, 4 },
- { 0x6, 4 },
- { 0x3D, 6 },
- { 0x1E, 6 }
- },
- { /* AC bias group 4, table 10 */
- { 0x6, 3 },
- { 0xB, 4 },
- { 0x11, 5 },
- { 0x1E, 5 },
- { 0x74, 7 },
- { 0x3AA, 10 },
- { 0x1D5C, 13 },
- { 0x1, 6 },
- { 0x21, 6 },
- { 0x1, 3 },
- { 0x2, 3 },
- { 0x7, 4 },
- { 0x6, 4 },
- { 0x3E, 6 },
- { 0xEB, 8 },
- { 0x1D4, 9 },
- { 0xEAF, 12 },
- { 0x3ABB, 14 },
- { 0x3ABA, 14 },
- { 0x1D59, 13 },
- { 0x1D58, 13 },
- { 0x1D5B, 13 },
- { 0x1D5A, 13 },
- { 0xA, 4 },
- { 0x1C, 5 },
- { 0x1, 5 },
- { 0x3F, 6 },
- { 0x3B, 6 },
- { 0x1, 4 },
- { 0x9, 4 },
- { 0x20, 6 },
- { 0x0, 6 }
- },
- { /* AC bias group 4, table 11 */
- { 0x4, 3 },
- { 0xA, 4 },
- { 0x17, 5 },
- { 0x4, 4 },
- { 0x16, 6 },
- { 0x16A, 9 },
- { 0x16B1, 13 },
- { 0x17, 7 },
- { 0x5B, 7 },
- { 0x6, 3 },
- { 0x7, 3 },
- { 0x1, 4 },
- { 0x0, 4 },
- { 0xA, 6 },
- { 0x2D7, 10 },
- { 0xB5A, 12 },
- { 0x16B0, 13 },
- { 0x16B3, 13 },
- { 0x16B2, 13 },
- { 0x2D6D, 14 },
- { 0x2D6C, 14 },
- { 0x2D6F, 14 },
- { 0x2D6E, 14 },
- { 0x6, 4 },
- { 0xA, 5 },
- { 0x4, 5 },
- { 0x2C, 6 },
- { 0x17, 6 },
- { 0x3, 4 },
- { 0x7, 4 },
- { 0x16, 7 },
- { 0xB4, 8 }
- },
- { /* AC bias group 4, table 12 */
- { 0x5, 3 },
- { 0xD, 4 },
- { 0x5, 4 },
- { 0x9, 4 },
- { 0x33, 6 },
- { 0x193, 9 },
- { 0x192C, 13 },
- { 0x61, 8 },
- { 0x31, 7 },
- { 0x0, 2 },
- { 0x7, 3 },
- { 0x10, 5 },
- { 0x11, 5 },
- { 0xC8, 8 },
- { 0x192F, 13 },
- { 0x325B, 14 },
- { 0x325A, 14 },
- { 0x1929, 13 },
- { 0x1928, 13 },
- { 0x192B, 13 },
- { 0x192A, 13 },
- { 0x325D, 14 },
- { 0x325C, 14 },
- { 0x18, 5 },
- { 0x1A, 6 },
- { 0x1B, 6 },
- { 0x65, 7 },
- { 0x19, 6 },
- { 0x4, 4 },
- { 0x7, 4 },
- { 0x60, 8 },
- { 0x324, 10 }
- },
- { /* AC bias group 4, table 13 */
- { 0x6, 3 },
- { 0x0, 3 },
- { 0x2, 4 },
- { 0xF, 4 },
- { 0x39, 6 },
- { 0x1D9, 9 },
- { 0x1D82, 13 },
- { 0x761, 11 },
- { 0x3BE, 10 },
- { 0x1, 2 },
- { 0x2, 2 },
- { 0xF, 6 },
- { 0xE, 6 },
- { 0x762, 11 },
- { 0x3B07, 14 },
- { 0x3B06, 14 },
- { 0x3B1D, 14 },
- { 0x3B1C, 14 },
- { 0x3B1F, 14 },
- { 0x3B1E, 14 },
- { 0x3B19, 14 },
- { 0x3B18, 14 },
- { 0x3B1B, 14 },
- { 0x38, 6 },
- { 0x1DE, 9 },
- { 0xED, 8 },
- { 0x3BF, 10 },
- { 0xEE, 8 },
- { 0x3A, 6 },
- { 0x6, 5 },
- { 0xEC0, 12 },
- { 0x3B1A, 14 }
- },
- { /* AC bias group 4, table 14 */
- { 0x0, 2 },
- { 0x2, 3 },
- { 0xF, 5 },
- { 0x6, 4 },
- { 0x1C, 6 },
- { 0x1D0, 10 },
- { 0xE8C, 13 },
- { 0x1D1B, 14 },
- { 0x1D1A, 14 },
- { 0x3, 2 },
- { 0x2, 2 },
- { 0xEA, 9 },
- { 0xE9, 9 },
- { 0xE89, 13 },
- { 0xE88, 13 },
- { 0xE8B, 13 },
- { 0xE8A, 13 },
- { 0x1D65, 14 },
- { 0x1D64, 14 },
- { 0x1D67, 14 },
- { 0x1D66, 14 },
- { 0x1D61, 14 },
- { 0x1D60, 14 },
- { 0x3AD, 11 },
- { 0x1D63, 14 },
- { 0x1D62, 14 },
- { 0x1D1D, 14 },
- { 0x1D1C, 14 },
- { 0x3B, 7 },
- { 0x1D7, 10 },
- { 0x1D1F, 14 },
- { 0x1D1E, 14 }
- },
- { /* AC bias group 4, table 15 */
- { 0x2, 2 },
- { 0xF, 4 },
- { 0x1C, 5 },
- { 0xC, 4 },
- { 0x3B, 6 },
- { 0x1AC, 9 },
- { 0x1AD8, 13 },
- { 0x35B3, 14 },
- { 0x35B2, 14 },
- { 0x1, 2 },
- { 0x0, 2 },
- { 0x69, 7 },
- { 0x68, 7 },
- { 0x35BD, 14 },
- { 0x35BC, 14 },
- { 0x35BF, 14 },
- { 0x35BE, 14 },
- { 0x35B9, 14 },
- { 0x35B8, 14 },
- { 0x35BB, 14 },
- { 0x35BA, 14 },
- { 0x35B5, 14 },
- { 0x35B4, 14 },
- { 0x1A9, 9 },
- { 0x1A8, 9 },
- { 0x35A, 10 },
- { 0xD7, 8 },
- { 0xD5, 8 },
- { 0x3A, 6 },
- { 0x1B, 5 },
- { 0x35B7, 14 },
- { 0x35B6, 14 }
- }
-};
-
-#endif /* VP3DATA_H */
diff --git a/src/libffmpeg/libavcodec/vp3dsp.c b/src/libffmpeg/libavcodec/vp3dsp.c
deleted file mode 100644
index bb9fed091..000000000
--- a/src/libffmpeg/libavcodec/vp3dsp.c
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * Copyright (C) 2004 the ffmpeg project
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file vp3dsp.c
- * Standard C DSP-oriented functions cribbed from the original VP3
- * source code.
- */
-
-#include "common.h"
-#include "avcodec.h"
-#include "dsputil.h"
-
-#define IdctAdjustBeforeShift 8
-#define xC1S7 64277
-#define xC2S6 60547
-#define xC3S5 54491
-#define xC4S4 46341
-#define xC5S3 36410
-#define xC6S2 25080
-#define xC7S1 12785
-
-#define M(a,b) (((a) * (b))>>16)
-
-static av_always_inline void idct(uint8_t *dst, int stride, int16_t *input, int type)
-{
- int16_t *ip = input;
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-
- int A, B, C, D, Ad, Bd, Cd, Dd, E, F, G, H;
- int Ed, Gd, Add, Bdd, Fd, Hd;
-
- int i;
-
- /* Inverse DCT on the rows now */
- for (i = 0; i < 8; i++) {
- /* Check for non-zero values */
- if ( ip[0] | ip[1] | ip[2] | ip[3] | ip[4] | ip[5] | ip[6] | ip[7] ) {
- A = M(xC1S7, ip[1]) + M(xC7S1, ip[7]);
- B = M(xC7S1, ip[1]) - M(xC1S7, ip[7]);
- C = M(xC3S5, ip[3]) + M(xC5S3, ip[5]);
- D = M(xC3S5, ip[5]) - M(xC5S3, ip[3]);
-
- Ad = M(xC4S4, (A - C));
- Bd = M(xC4S4, (B - D));
-
- Cd = A + C;
- Dd = B + D;
-
- E = M(xC4S4, (ip[0] + ip[4]));
- F = M(xC4S4, (ip[0] - ip[4]));
-
- G = M(xC2S6, ip[2]) + M(xC6S2, ip[6]);
- H = M(xC6S2, ip[2]) - M(xC2S6, ip[6]);
-
- Ed = E - G;
- Gd = E + G;
-
- Add = F + Ad;
- Bdd = Bd - H;
-
- Fd = F - Ad;
- Hd = Bd + H;
-
- /* Final sequence of operations over-write original inputs. */
- ip[0] = Gd + Cd ;
- ip[7] = Gd - Cd ;
-
- ip[1] = Add + Hd;
- ip[2] = Add - Hd;
-
- ip[3] = Ed + Dd ;
- ip[4] = Ed - Dd ;
-
- ip[5] = Fd + Bdd;
- ip[6] = Fd - Bdd;
- }
-
- ip += 8; /* next row */
- }
-
- ip = input;
-
- for ( i = 0; i < 8; i++) {
- /* Check for non-zero values (bitwise or faster than ||) */
- if ( ip[1 * 8] | ip[2 * 8] | ip[3 * 8] |
- ip[4 * 8] | ip[5 * 8] | ip[6 * 8] | ip[7 * 8] ) {
-
- A = M(xC1S7, ip[1*8]) + M(xC7S1, ip[7*8]);
- B = M(xC7S1, ip[1*8]) - M(xC1S7, ip[7*8]);
- C = M(xC3S5, ip[3*8]) + M(xC5S3, ip[5*8]);
- D = M(xC3S5, ip[5*8]) - M(xC5S3, ip[3*8]);
-
- Ad = M(xC4S4, (A - C));
- Bd = M(xC4S4, (B - D));
-
- Cd = A + C;
- Dd = B + D;
-
- E = M(xC4S4, (ip[0*8] + ip[4*8])) + 8;
- F = M(xC4S4, (ip[0*8] - ip[4*8])) + 8;
-
- if(type==1){ //HACK
- E += 16*128;
- F += 16*128;
- }
-
- G = M(xC2S6, ip[2*8]) + M(xC6S2, ip[6*8]);
- H = M(xC6S2, ip[2*8]) - M(xC2S6, ip[6*8]);
-
- Ed = E - G;
- Gd = E + G;
-
- Add = F + Ad;
- Bdd = Bd - H;
-
- Fd = F - Ad;
- Hd = Bd + H;
-
- /* Final sequence of operations over-write original inputs. */
- if(type==0){
- ip[0*8] = (Gd + Cd ) >> 4;
- ip[7*8] = (Gd - Cd ) >> 4;
-
- ip[1*8] = (Add + Hd ) >> 4;
- ip[2*8] = (Add - Hd ) >> 4;
-
- ip[3*8] = (Ed + Dd ) >> 4;
- ip[4*8] = (Ed - Dd ) >> 4;
-
- ip[5*8] = (Fd + Bdd ) >> 4;
- ip[6*8] = (Fd - Bdd ) >> 4;
- }else if(type==1){
- dst[0*stride] = cm[(Gd + Cd ) >> 4];
- dst[7*stride] = cm[(Gd - Cd ) >> 4];
-
- dst[1*stride] = cm[(Add + Hd ) >> 4];
- dst[2*stride] = cm[(Add - Hd ) >> 4];
-
- dst[3*stride] = cm[(Ed + Dd ) >> 4];
- dst[4*stride] = cm[(Ed - Dd ) >> 4];
-
- dst[5*stride] = cm[(Fd + Bdd ) >> 4];
- dst[6*stride] = cm[(Fd - Bdd ) >> 4];
- }else{
- dst[0*stride] = cm[dst[0*stride] + ((Gd + Cd ) >> 4)];
- dst[7*stride] = cm[dst[7*stride] + ((Gd - Cd ) >> 4)];
-
- dst[1*stride] = cm[dst[1*stride] + ((Add + Hd ) >> 4)];
- dst[2*stride] = cm[dst[2*stride] + ((Add - Hd ) >> 4)];
-
- dst[3*stride] = cm[dst[3*stride] + ((Ed + Dd ) >> 4)];
- dst[4*stride] = cm[dst[4*stride] + ((Ed - Dd ) >> 4)];
-
- dst[5*stride] = cm[dst[5*stride] + ((Fd + Bdd ) >> 4)];
- dst[6*stride] = cm[dst[6*stride] + ((Fd - Bdd ) >> 4)];
- }
-
- } else {
- if(type==0){
- ip[0*8] =
- ip[1*8] =
- ip[2*8] =
- ip[3*8] =
- ip[4*8] =
- ip[5*8] =
- ip[6*8] =
- ip[7*8] = ((xC4S4 * ip[0*8] + (IdctAdjustBeforeShift<<16))>>20);
- }else if(type==1){
- dst[0*stride]=
- dst[1*stride]=
- dst[2*stride]=
- dst[3*stride]=
- dst[4*stride]=
- dst[5*stride]=
- dst[6*stride]=
- dst[7*stride]= 128 + ((xC4S4 * ip[0*8] + (IdctAdjustBeforeShift<<16))>>20);
- }else{
- if(ip[0*8]){
- int v= ((xC4S4 * ip[0*8] + (IdctAdjustBeforeShift<<16))>>20);
- dst[0*stride] = cm[dst[0*stride] + v];
- dst[1*stride] = cm[dst[1*stride] + v];
- dst[2*stride] = cm[dst[2*stride] + v];
- dst[3*stride] = cm[dst[3*stride] + v];
- dst[4*stride] = cm[dst[4*stride] + v];
- dst[5*stride] = cm[dst[5*stride] + v];
- dst[6*stride] = cm[dst[6*stride] + v];
- dst[7*stride] = cm[dst[7*stride] + v];
- }
- }
- }
-
- ip++; /* next column */
- dst++;
- }
-}
-
-void ff_vp3_idct_c(DCTELEM *block/* align 16*/){
- idct(NULL, 0, block, 0);
-}
-
-void ff_vp3_idct_put_c(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/){
- idct(dest, line_size, block, 1);
-}
-
-void ff_vp3_idct_add_c(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/){
- idct(dest, line_size, block, 2);
-}
diff --git a/src/libffmpeg/libavcodec/vp5.c b/src/libffmpeg/libavcodec/vp5.c
deleted file mode 100644
index ac953c7aa..000000000
--- a/src/libffmpeg/libavcodec/vp5.c
+++ /dev/null
@@ -1,290 +0,0 @@
-/**
- * @file vp5.c
- * VP5 compatible video decoder
- *
- * Copyright (C) 2006 Aurelien Jacobs <aurel@gnuage.org>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "avcodec.h"
-#include "dsputil.h"
-#include "bitstream.h"
-#include "mpegvideo.h"
-
-#include "vp56.h"
-#include "vp56data.h"
-#include "vp5data.h"
-
-
-static int vp5_parse_header(vp56_context_t *s, uint8_t *buf, int buf_size,
- int *golden_frame)
-{
- vp56_range_coder_t *c = &s->c;
- int rows, cols;
-
- vp56_init_range_decoder(&s->c, buf, buf_size);
- s->frames[VP56_FRAME_CURRENT].key_frame = !vp56_rac_get(c);
- vp56_rac_get(c);
- vp56_init_dequant(s, vp56_rac_gets(c, 6));
- if (s->frames[VP56_FRAME_CURRENT].key_frame)
- {
- vp56_rac_gets(c, 8);
- if(vp56_rac_gets(c, 5) > 5)
- return 0;
- vp56_rac_gets(c, 2);
- if (vp56_rac_get(c)) {
- av_log(s->avctx, AV_LOG_ERROR, "interlacing not supported\n");
- return 0;
- }
- rows = vp56_rac_gets(c, 8); /* number of stored macroblock rows */
- cols = vp56_rac_gets(c, 8); /* number of stored macroblock cols */
- vp56_rac_gets(c, 8); /* number of displayed macroblock rows */
- vp56_rac_gets(c, 8); /* number of displayed macroblock cols */
- vp56_rac_gets(c, 2);
- if (16*cols != s->avctx->coded_width ||
- 16*rows != s->avctx->coded_height) {
- avcodec_set_dimensions(s->avctx, 16*cols, 16*rows);
- return 2;
- }
- }
- return 1;
-}
-
-/* Gives very similar result than the vp6 version except in a few cases */
-static int vp5_adjust(int v, int t)
-{
- int s2, s1 = v >> 31;
- v ^= s1;
- v -= s1;
- v *= v < 2*t;
- v -= t;
- s2 = v >> 31;
- v ^= s2;
- v -= s2;
- v = t - v;
- v += s1;
- v ^= s1;
- return v;
-}
-
-static void vp5_parse_vector_adjustment(vp56_context_t *s, vp56_mv_t *vect)
-{
- vp56_range_coder_t *c = &s->c;
- int comp, di;
-
- for (comp=0; comp<2; comp++) {
- int delta = 0;
- if (vp56_rac_get_prob(c, s->vector_model_dct[comp])) {
- int sign = vp56_rac_get_prob(c, s->vector_model_sig[comp]);
- di = vp56_rac_get_prob(c, s->vector_model_pdi[comp][0]);
- di |= vp56_rac_get_prob(c, s->vector_model_pdi[comp][1]) << 1;
- delta = vp56_rac_get_tree(c, vp56_pva_tree,
- s->vector_model_pdv[comp]);
- delta = di | (delta << 2);
- delta = (delta ^ -sign) + sign;
- }
- if (!comp)
- vect->x = delta;
- else
- vect->y = delta;
- }
-}
-
-static void vp5_parse_vector_models(vp56_context_t *s)
-{
- vp56_range_coder_t *c = &s->c;
- int comp, node;
-
- for (comp=0; comp<2; comp++) {
- if (vp56_rac_get_prob(c, vp5_vmc_pct[comp][0]))
- s->vector_model_dct[comp] = vp56_rac_gets_nn(c, 7);
- if (vp56_rac_get_prob(c, vp5_vmc_pct[comp][1]))
- s->vector_model_sig[comp] = vp56_rac_gets_nn(c, 7);
- if (vp56_rac_get_prob(c, vp5_vmc_pct[comp][2]))
- s->vector_model_pdi[comp][0] = vp56_rac_gets_nn(c, 7);
- if (vp56_rac_get_prob(c, vp5_vmc_pct[comp][3]))
- s->vector_model_pdi[comp][1] = vp56_rac_gets_nn(c, 7);
- }
-
- for (comp=0; comp<2; comp++)
- for (node=0; node<7; node++)
- if (vp56_rac_get_prob(c, vp5_vmc_pct[comp][4 + node]))
- s->vector_model_pdv[comp][node] = vp56_rac_gets_nn(c, 7);
-}
-
-static void vp5_parse_coeff_models(vp56_context_t *s)
-{
- vp56_range_coder_t *c = &s->c;
- uint8_t def_prob[11];
- int node, cg, ctx;
- int ct; /* code type */
- int pt; /* plane type (0 for Y, 1 for U or V) */
-
- memset(def_prob, 0x80, sizeof(def_prob));
-
- for (pt=0; pt<2; pt++)
- for (node=0; node<11; node++)
- if (vp56_rac_get_prob(c, vp5_dccv_pct[pt][node])) {
- def_prob[node] = vp56_rac_gets_nn(c, 7);
- s->coeff_model_dccv[pt][node] = def_prob[node];
- } else if (s->frames[VP56_FRAME_CURRENT].key_frame) {
- s->coeff_model_dccv[pt][node] = def_prob[node];
- }
-
- for (ct=0; ct<3; ct++)
- for (pt=0; pt<2; pt++)
- for (cg=0; cg<6; cg++)
- for (node=0; node<11; node++)
- if (vp56_rac_get_prob(c, vp5_ract_pct[ct][pt][cg][node])) {
- def_prob[node] = vp56_rac_gets_nn(c, 7);
- s->coeff_model_ract[pt][ct][cg][node] = def_prob[node];
- } else if (s->frames[VP56_FRAME_CURRENT].key_frame) {
- s->coeff_model_ract[pt][ct][cg][node] = def_prob[node];
- }
-
- /* coeff_model_dcct is a linear combination of coeff_model_dccv */
- for (pt=0; pt<2; pt++)
- for (ctx=0; ctx<36; ctx++)
- for (node=0; node<5; node++)
- s->coeff_model_dcct[pt][ctx][node] = clip(((s->coeff_model_dccv[pt][node] * vp5_dccv_lc[node][ctx][0] + 128) >> 8) + vp5_dccv_lc[node][ctx][1], 1, 254);
-
- /* coeff_model_acct is a linear combination of coeff_model_ract */
- for (ct=0; ct<3; ct++)
- for (pt=0; pt<2; pt++)
- for (cg=0; cg<3; cg++)
- for (ctx=0; ctx<6; ctx++)
- for (node=0; node<5; node++)
- s->coeff_model_acct[pt][ct][cg][ctx][node] = clip(((s->coeff_model_ract[pt][ct][cg][node] * vp5_ract_lc[ct][cg][node][ctx][0] + 128) >> 8) + vp5_ract_lc[ct][cg][node][ctx][1], 1, 254);
-}
-
-static void vp5_parse_coeff(vp56_context_t *s)
-{
- vp56_range_coder_t *c = &s->c;
- uint8_t *permute = s->scantable.permutated;
- uint8_t *model, *model2;
- int coeff, sign, coeff_idx;
- int b, i, cg, idx, ctx, ctx_last;
- int pt = 0; /* plane type (0 for Y, 1 for U or V) */
-
- for (b=0; b<6; b++) {
- int ct = 1; /* code type */
-
- if (b > 3) pt = 1;
-
- ctx = 6*s->coeff_ctx[vp56_b6to4[b]][0]
- + s->above_blocks[s->above_block_idx[b]].not_null_dc;
- model = s->coeff_model_dccv[pt];
- model2 = s->coeff_model_dcct[pt][ctx];
-
- for (coeff_idx=0; coeff_idx<64; ) {
- if (vp56_rac_get_prob(c, model2[0])) {
- if (vp56_rac_get_prob(c, model2[2])) {
- if (vp56_rac_get_prob(c, model2[3])) {
- s->coeff_ctx[vp56_b6to4[b]][coeff_idx] = 4;
- idx = vp56_rac_get_tree(c, vp56_pc_tree, model);
- sign = vp56_rac_get(c);
- coeff = vp56_coeff_bias[idx];
- for (i=vp56_coeff_bit_length[idx]; i>=0; i--)
- coeff += vp56_rac_get_prob(c, vp56_coeff_parse_table[idx][i]) << i;
- } else {
- if (vp56_rac_get_prob(c, model2[4])) {
- coeff = 3 + vp56_rac_get_prob(c, model[5]);
- s->coeff_ctx[vp56_b6to4[b]][coeff_idx] = 3;
- } else {
- coeff = 2;
- s->coeff_ctx[vp56_b6to4[b]][coeff_idx] = 2;
- }
- sign = vp56_rac_get(c);
- }
- ct = 2;
- } else {
- ct = 1;
- s->coeff_ctx[vp56_b6to4[b]][coeff_idx] = 1;
- sign = vp56_rac_get(c);
- coeff = 1;
- }
- coeff = (coeff ^ -sign) + sign;
- if (coeff_idx)
- coeff *= s->dequant_ac;
- s->block_coeff[b][permute[coeff_idx]] = coeff;
- } else {
- if (ct && !vp56_rac_get_prob(c, model2[1]))
- break;
- ct = 0;
- s->coeff_ctx[vp56_b6to4[b]][coeff_idx] = 0;
- }
-
- cg = vp5_coeff_groups[++coeff_idx];
- ctx = s->coeff_ctx[vp56_b6to4[b]][coeff_idx];
- model = s->coeff_model_ract[pt][ct][cg];
- model2 = cg > 2 ? model : s->coeff_model_acct[pt][ct][cg][ctx];
- }
-
- ctx_last = FFMIN(s->coeff_ctx_last[vp56_b6to4[b]], 24);
- s->coeff_ctx_last[vp56_b6to4[b]] = coeff_idx;
- if (coeff_idx < ctx_last)
- for (i=coeff_idx; i<=ctx_last; i++)
- s->coeff_ctx[vp56_b6to4[b]][i] = 5;
- s->above_blocks[s->above_block_idx[b]].not_null_dc = s->coeff_ctx[vp56_b6to4[b]][0];
- }
-}
-
-static void vp5_default_models_init(vp56_context_t *s)
-{
- int i;
-
- for (i=0; i<2; i++) {
- s->vector_model_sig[i] = 0x80;
- s->vector_model_dct[i] = 0x80;
- s->vector_model_pdi[i][0] = 0x55;
- s->vector_model_pdi[i][1] = 0x80;
- }
- memcpy(s->mb_types_stats, vp56_def_mb_types_stats, sizeof(s->mb_types_stats));
- memset(s->vector_model_pdv, 0x80, sizeof(s->vector_model_pdv));
-}
-
-static int vp5_decode_init(AVCodecContext *avctx)
-{
- vp56_context_t *s = avctx->priv_data;
-
- vp56_init(s, avctx, 1);
- s->vp56_coord_div = vp5_coord_div;
- s->parse_vector_adjustment = vp5_parse_vector_adjustment;
- s->adjust = vp5_adjust;
- s->parse_coeff = vp5_parse_coeff;
- s->default_models_init = vp5_default_models_init;
- s->parse_vector_models = vp5_parse_vector_models;
- s->parse_coeff_models = vp5_parse_coeff_models;
- s->parse_header = vp5_parse_header;
-
- return 0;
-}
-
-AVCodec vp5_decoder = {
- "vp5",
- CODEC_TYPE_VIDEO,
- CODEC_ID_VP5,
- sizeof(vp56_context_t),
- vp5_decode_init,
- NULL,
- vp56_free,
- vp56_decode_frame,
-};
diff --git a/src/libffmpeg/libavcodec/vp56.c b/src/libffmpeg/libavcodec/vp56.c
deleted file mode 100644
index eb78d02e4..000000000
--- a/src/libffmpeg/libavcodec/vp56.c
+++ /dev/null
@@ -1,665 +0,0 @@
-/**
- * @file vp56.c
- * VP5 and VP6 compatible video decoder (common features)
- *
- * Copyright (C) 2006 Aurelien Jacobs <aurel@gnuage.org>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "avcodec.h"
-
-#include "vp56.h"
-#include "vp56data.h"
-
-
-void vp56_init_dequant(vp56_context_t *s, int quantizer)
-{
- s->quantizer = quantizer;
- s->dequant_dc = vp56_dc_dequant[quantizer] << 2;
- s->dequant_ac = vp56_ac_dequant[quantizer] << 2;
-}
-
-static int vp56_get_vectors_predictors(vp56_context_t *s, int row, int col,
- vp56_frame_t ref_frame)
-{
- int nb_pred = 0;
- vp56_mv_t vect[2] = {{0,0}, {0,0}};
- int pos, offset;
- vp56_mv_t mvp;
-
- for (pos=0; pos<12; pos++) {
- mvp.x = col + vp56_candidate_predictor_pos[pos][0];
- mvp.y = row + vp56_candidate_predictor_pos[pos][1];
- if (mvp.x < 0 || mvp.x >= s->mb_width ||
- mvp.y < 0 || mvp.y >= s->mb_height)
- continue;
- offset = mvp.x + s->mb_width*mvp.y;
-
- if (vp56_reference_frame[s->macroblocks[offset].type] != ref_frame)
- continue;
- if ((s->macroblocks[offset].mv.x == vect[0].x &&
- s->macroblocks[offset].mv.y == vect[0].y) ||
- (s->macroblocks[offset].mv.x == 0 &&
- s->macroblocks[offset].mv.y == 0))
- continue;
-
- vect[nb_pred++] = s->macroblocks[offset].mv;
- if (nb_pred > 1) {
- nb_pred = -1;
- break;
- }
- s->vector_candidate_pos = pos;
- }
-
- s->vector_candidate[0] = vect[0];
- s->vector_candidate[1] = vect[1];
-
- return nb_pred+1;
-}
-
-static void vp56_parse_mb_type_models(vp56_context_t *s)
-{
- vp56_range_coder_t *c = &s->c;
- int i, ctx, type;
-
- for (ctx=0; ctx<3; ctx++) {
- if (vp56_rac_get_prob(c, 174)) {
- int idx = vp56_rac_gets(c, 4);
- memcpy(s->mb_types_stats[ctx],vp56_pre_def_mb_type_stats[idx][ctx],
- sizeof(s->mb_types_stats[ctx]));
- }
- if (vp56_rac_get_prob(c, 254)) {
- for (type=0; type<10; type++) {
- for(i=0; i<2; i++) {
- if (vp56_rac_get_prob(c, 205)) {
- int delta, sign = vp56_rac_get(c);
-
- delta = vp56_rac_get_tree(c, vp56_pmbtm_tree,
- vp56_mb_type_model_model);
- if (!delta)
- delta = 4 * vp56_rac_gets(c, 7);
- s->mb_types_stats[ctx][type][i] += (delta ^ -sign) + sign;
- }
- }
- }
- }
- }
-
- /* compute MB type probability tables based on previous MB type */
- for (ctx=0; ctx<3; ctx++) {
- int p[10];
-
- for (type=0; type<10; type++)
- p[type] = 100 * s->mb_types_stats[ctx][type][1];
-
- for (type=0; type<10; type++) {
- int p02, p34, p0234, p17, p56, p89, p5689, p156789;
-
- /* conservative MB type probability */
- s->mb_type_model[ctx][type][0] = 255 - (255 * s->mb_types_stats[ctx][type][0]) / (1 + s->mb_types_stats[ctx][type][0] + s->mb_types_stats[ctx][type][1]);
-
- p[type] = 0; /* same MB type => weight is null */
-
- /* binary tree parsing probabilities */
- p02 = p[0] + p[2];
- p34 = p[3] + p[4];
- p0234 = p02 + p34;
- p17 = p[1] + p[7];
- p56 = p[5] + p[6];
- p89 = p[8] + p[9];
- p5689 = p56 + p89;
- p156789 = p17 + p5689;
-
- s->mb_type_model[ctx][type][1] = 1 + 255 * p0234/(1+p0234+p156789);
- s->mb_type_model[ctx][type][2] = 1 + 255 * p02 / (1+p0234);
- s->mb_type_model[ctx][type][3] = 1 + 255 * p17 / (1+p156789);
- s->mb_type_model[ctx][type][4] = 1 + 255 * p[0] / (1+p02);
- s->mb_type_model[ctx][type][5] = 1 + 255 * p[3] / (1+p34);
- s->mb_type_model[ctx][type][6] = 1 + 255 * p[1] / (1+p17);
- s->mb_type_model[ctx][type][7] = 1 + 255 * p56 / (1+p5689);
- s->mb_type_model[ctx][type][8] = 1 + 255 * p[5] / (1+p56);
- s->mb_type_model[ctx][type][9] = 1 + 255 * p[8] / (1+p89);
-
- /* restore initial value */
- p[type] = 100 * s->mb_types_stats[ctx][type][1];
- }
- }
-}
-
-static vp56_mb_t vp56_parse_mb_type(vp56_context_t *s,
- vp56_mb_t prev_type, int ctx)
-{
- uint8_t *mb_type_model = s->mb_type_model[ctx][prev_type];
- vp56_range_coder_t *c = &s->c;
-
- if (vp56_rac_get_prob(c, mb_type_model[0]))
- return prev_type;
- else
- return vp56_rac_get_tree(c, vp56_pmbt_tree, mb_type_model);
-}
-
-static void vp56_decode_4mv(vp56_context_t *s, int row, int col)
-{
- vp56_mv_t mv = {0,0};
- int type[4];
- int b;
-
- /* parse each block type */
- for (b=0; b<4; b++) {
- type[b] = vp56_rac_gets(&s->c, 2);
- if (type[b])
- type[b]++; /* only returns 0, 2, 3 or 4 (all INTER_PF) */
- }
-
- /* get vectors */
- for (b=0; b<4; b++) {
- switch (type[b]) {
- case VP56_MB_INTER_NOVEC_PF:
- s->mv[b] = (vp56_mv_t) {0,0};
- break;
- case VP56_MB_INTER_DELTA_PF:
- s->parse_vector_adjustment(s, &s->mv[b]);
- break;
- case VP56_MB_INTER_V1_PF:
- s->mv[b] = s->vector_candidate[0];
- break;
- case VP56_MB_INTER_V2_PF:
- s->mv[b] = s->vector_candidate[1];
- break;
- }
- mv.x += s->mv[b].x;
- mv.y += s->mv[b].y;
- }
-
- /* this is the one selected for the whole MB for prediction */
- s->macroblocks[row * s->mb_width + col].mv = s->mv[3];
-
- /* chroma vectors are average luma vectors */
- if (s->avctx->codec->id == CODEC_ID_VP5) {
- s->mv[4].x = s->mv[5].x = RSHIFT(mv.x,2);
- s->mv[4].y = s->mv[5].y = RSHIFT(mv.y,2);
- } else {
- s->mv[4] = s->mv[5] = (vp56_mv_t) {mv.x/4, mv.y/4};
- }
-}
-
-static vp56_mb_t vp56_decode_mv(vp56_context_t *s, int row, int col)
-{
- vp56_mv_t *mv, vect = {0,0};
- int ctx, b;
-
- ctx = vp56_get_vectors_predictors(s, row, col, VP56_FRAME_PREVIOUS);
- s->mb_type = vp56_parse_mb_type(s, s->mb_type, ctx);
- s->macroblocks[row * s->mb_width + col].type = s->mb_type;
-
- switch (s->mb_type) {
- case VP56_MB_INTER_V1_PF:
- mv = &s->vector_candidate[0];
- break;
-
- case VP56_MB_INTER_V2_PF:
- mv = &s->vector_candidate[1];
- break;
-
- case VP56_MB_INTER_V1_GF:
- vp56_get_vectors_predictors(s, row, col, VP56_FRAME_GOLDEN);
- mv = &s->vector_candidate[0];
- break;
-
- case VP56_MB_INTER_V2_GF:
- vp56_get_vectors_predictors(s, row, col, VP56_FRAME_GOLDEN);
- mv = &s->vector_candidate[1];
- break;
-
- case VP56_MB_INTER_DELTA_PF:
- s->parse_vector_adjustment(s, &vect);
- mv = &vect;
- break;
-
- case VP56_MB_INTER_DELTA_GF:
- vp56_get_vectors_predictors(s, row, col, VP56_FRAME_GOLDEN);
- s->parse_vector_adjustment(s, &vect);
- mv = &vect;
- break;
-
- case VP56_MB_INTER_4V:
- vp56_decode_4mv(s, row, col);
- return s->mb_type;
-
- default:
- mv = &vect;
- break;
- }
-
- s->macroblocks[row*s->mb_width + col].mv = *mv;
-
- /* same vector for all blocks */
- for (b=0; b<6; b++)
- s->mv[b] = *mv;
-
- return s->mb_type;
-}
-
-static void vp56_add_predictors_dc(vp56_context_t *s, vp56_frame_t ref_frame)
-{
- int idx = s->scantable.permutated[0];
- int i;
-
- for (i=0; i<6; i++) {
- vp56_ref_dc_t *ab = &s->above_blocks[s->above_block_idx[i]];
- vp56_ref_dc_t *lb = &s->left_block[vp56_b6to4[i]];
- int count = 0;
- int dc = 0;
-
- if (ref_frame == lb->ref_frame) {
- dc += lb->dc_coeff;
- count++;
- }
- if (ref_frame == ab->ref_frame) {
- dc += ab->dc_coeff;
- count++;
- }
- if (s->avctx->codec->id == CODEC_ID_VP5) {
- if (count < 2 && ref_frame == ab[-1].ref_frame) {
- dc += ab[-1].dc_coeff;
- count++;
- }
- if (count < 2 && ref_frame == ab[1].ref_frame) {
- dc += ab[1].dc_coeff;
- count++;
- }
- }
- if (count == 0)
- dc = s->prev_dc[vp56_b6to3[i]][ref_frame];
- else if (count == 2)
- dc /= 2;
-
- s->block_coeff[i][idx] += dc;
- s->prev_dc[vp56_b6to3[i]][ref_frame] = s->block_coeff[i][idx];
- ab->dc_coeff = s->block_coeff[i][idx];
- ab->ref_frame = ref_frame;
- lb->dc_coeff = s->block_coeff[i][idx];
- lb->ref_frame = ref_frame;
- s->block_coeff[i][idx] *= s->dequant_dc;
- }
-}
-
-static void vp56_edge_filter(vp56_context_t *s, uint8_t *yuv,
- int pix_inc, int line_inc, int t)
-{
- int pix2_inc = 2 * pix_inc;
- int i, v;
-
- for (i=0; i<12; i++) {
- v = (yuv[-pix2_inc] + 3*(yuv[0]-yuv[-pix_inc]) - yuv[pix_inc] + 4) >>3;
- v = s->adjust(v, t);
- yuv[-pix_inc] = clip_uint8(yuv[-pix_inc] + v);
- yuv[0] = clip_uint8(yuv[0] - v);
- yuv += line_inc;
- }
-}
-
-static void vp56_deblock_filter(vp56_context_t *s, uint8_t *yuv,
- int stride, int dx, int dy)
-{
- int t = vp56_filter_threshold[s->quantizer];
- if (dx) vp56_edge_filter(s, yuv + 10-dx , 1, stride, t);
- if (dy) vp56_edge_filter(s, yuv + stride*(10-dy), stride, 1, t);
-}
-
-static void vp56_mc(vp56_context_t *s, int b, uint8_t *src,
- int stride, int x, int y)
-{
- int plane = vp56_b6to3[b];
- uint8_t *dst= s->frames[VP56_FRAME_CURRENT].data[plane]+s->block_offset[b];
- uint8_t *src_block;
- int src_offset;
- int overlap_offset = 0;
- int mask = s->vp56_coord_div[b] - 1;
- int deblock_filtering = s->deblock_filtering;
- int dx;
- int dy;
-
- if (s->avctx->skip_loop_filter >= AVDISCARD_ALL ||
- (s->avctx->skip_loop_filter >= AVDISCARD_NONKEY
- && !s->frames[VP56_FRAME_CURRENT].key_frame))
- deblock_filtering = 0;
-
- dx = s->mv[b].x / s->vp56_coord_div[b];
- dy = s->mv[b].y / s->vp56_coord_div[b];
-
- if (b >= 4) {
- x /= 2;
- y /= 2;
- }
- x += dx - 2;
- y += dy - 2;
-
- if (x<0 || x+12>=s->plane_width[plane] ||
- y<0 || y+12>=s->plane_height[plane]) {
- ff_emulated_edge_mc(s->edge_emu_buffer,
- src + s->block_offset[b] + (dy-2)*stride + (dx-2),
- stride, 12, 12, x, y,
- s->plane_width[plane],
- s->plane_height[plane]);
- src_block = s->edge_emu_buffer;
- src_offset = 2 + 2*stride;
- } else if (deblock_filtering) {
- /* only need a 12x12 block, but there is no such dsp function, */
- /* so copy a 16x12 block */
- s->dsp.put_pixels_tab[0][0](s->edge_emu_buffer,
- src + s->block_offset[b] + (dy-2)*stride + (dx-2),
- stride, 12);
- src_block = s->edge_emu_buffer;
- src_offset = 2 + 2*stride;
- } else {
- src_block = src;
- src_offset = s->block_offset[b] + dy*stride + dx;
- }
-
- if (deblock_filtering)
- vp56_deblock_filter(s, src_block, stride, dx&7, dy&7);
-
- if (s->mv[b].x & mask)
- overlap_offset += (s->mv[b].x > 0) ? 1 : -1;
- if (s->mv[b].y & mask)
- overlap_offset += (s->mv[b].y > 0) ? stride : -stride;
-
- if (overlap_offset) {
- if (s->filter)
- s->filter(s, dst, src_block, src_offset, src_offset+overlap_offset,
- stride, s->mv[b], mask, s->filter_selection, b<4);
- else
- s->dsp.put_no_rnd_pixels_l2[1](dst, src_block+src_offset,
- src_block+src_offset+overlap_offset,
- stride, 8);
- } else {
- s->dsp.put_pixels_tab[1][0](dst, src_block+src_offset, stride, 8);
- }
-}
-
-static void vp56_decode_mb(vp56_context_t *s, int row, int col)
-{
- AVFrame *frame_current, *frame_ref;
- vp56_mb_t mb_type;
- vp56_frame_t ref_frame;
- int b, plan, off;
-
- if (s->frames[VP56_FRAME_CURRENT].key_frame)
- mb_type = VP56_MB_INTRA;
- else
- mb_type = vp56_decode_mv(s, row, col);
- ref_frame = vp56_reference_frame[mb_type];
-
- memset(s->block_coeff, 0, sizeof(s->block_coeff));
-
- s->parse_coeff(s);
-
- vp56_add_predictors_dc(s, ref_frame);
-
- frame_current = &s->frames[VP56_FRAME_CURRENT];
- frame_ref = &s->frames[ref_frame];
-
- switch (mb_type) {
- case VP56_MB_INTRA:
- for (b=0; b<6; b++) {
- plan = vp56_b6to3[b];
- s->dsp.idct_put(frame_current->data[plan] + s->block_offset[b],
- s->stride[plan], s->block_coeff[b]);
- }
- break;
-
- case VP56_MB_INTER_NOVEC_PF:
- case VP56_MB_INTER_NOVEC_GF:
- for (b=0; b<6; b++) {
- plan = vp56_b6to3[b];
- off = s->block_offset[b];
- s->dsp.put_pixels_tab[1][0](frame_current->data[plan] + off,
- frame_ref->data[plan] + off,
- s->stride[plan], 8);
- s->dsp.idct_add(frame_current->data[plan] + off,
- s->stride[plan], s->block_coeff[b]);
- }
- break;
-
- case VP56_MB_INTER_DELTA_PF:
- case VP56_MB_INTER_V1_PF:
- case VP56_MB_INTER_V2_PF:
- case VP56_MB_INTER_DELTA_GF:
- case VP56_MB_INTER_4V:
- case VP56_MB_INTER_V1_GF:
- case VP56_MB_INTER_V2_GF:
- for (b=0; b<6; b++) {
- int x_off = b==1 || b==3 ? 8 : 0;
- int y_off = b==2 || b==3 ? 8 : 0;
- plan = vp56_b6to3[b];
- vp56_mc(s, b, frame_ref->data[plan], s->stride[plan],
- 16*col+x_off, 16*row+y_off);
- s->dsp.idct_add(frame_current->data[plan] + s->block_offset[b],
- s->stride[plan], s->block_coeff[b]);
- }
- break;
- }
-}
-
-static int vp56_size_changed(AVCodecContext *avctx, vp56_context_t *s)
-{
- int stride = s->frames[VP56_FRAME_CURRENT].linesize[0];
- int i;
-
- s->plane_width[0] = s->avctx->coded_width;
- s->plane_width[1] = s->plane_width[2] = s->avctx->coded_width/2;
- s->plane_height[0] = s->avctx->coded_height;
- s->plane_height[1] = s->plane_height[2] = s->avctx->coded_height/2;
-
- for (i=0; i<3; i++)
- s->stride[i] = s->flip * s->frames[VP56_FRAME_CURRENT].linesize[i];
-
- s->mb_width = (s->avctx->coded_width+15) / 16;
- s->mb_height = (s->avctx->coded_height+15) / 16;
-
- if (s->mb_width > 1000 || s->mb_height > 1000) {
- av_log(avctx, AV_LOG_ERROR, "picture too big\n");
- return -1;
- }
-
- s->above_blocks = av_realloc(s->above_blocks,
- (4*s->mb_width+6) * sizeof(*s->above_blocks));
- s->macroblocks = av_realloc(s->macroblocks,
- s->mb_width*s->mb_height*sizeof(*s->macroblocks));
- av_free(s->edge_emu_buffer_alloc);
- s->edge_emu_buffer_alloc = av_malloc(16*stride);
- s->edge_emu_buffer = s->edge_emu_buffer_alloc;
- if (s->flip < 0)
- s->edge_emu_buffer += 15 * stride;
-
- return 0;
-}
-
-int vp56_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- vp56_context_t *s = avctx->priv_data;
- AVFrame *const p = &s->frames[VP56_FRAME_CURRENT];
- AVFrame *picture = data;
- int mb_row, mb_col, mb_row_flip, mb_offset = 0;
- int block, y, uv, stride_y, stride_uv;
- int golden_frame = 0;
- int res;
-
- res = s->parse_header(s, buf, buf_size, &golden_frame);
- if (!res)
- return -1;
-
- p->reference = 1;
- if (avctx->get_buffer(avctx, p) < 0) {
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
-
- if (res == 2)
- if (vp56_size_changed(avctx, s)) {
- avctx->release_buffer(avctx, p);
- return -1;
- }
-
- if (p->key_frame) {
- p->pict_type = FF_I_TYPE;
- s->default_models_init(s);
- for (block=0; block<s->mb_height*s->mb_width; block++)
- s->macroblocks[block].type = VP56_MB_INTRA;
- } else {
- p->pict_type = FF_P_TYPE;
- vp56_parse_mb_type_models(s);
- s->parse_vector_models(s);
- s->mb_type = VP56_MB_INTER_NOVEC_PF;
- }
-
- s->parse_coeff_models(s);
-
- memset(s->prev_dc, 0, sizeof(s->prev_dc));
- s->prev_dc[1][VP56_FRAME_CURRENT] = 128;
- s->prev_dc[2][VP56_FRAME_CURRENT] = 128;
-
- for (block=0; block < 4*s->mb_width+6; block++) {
- s->above_blocks[block].ref_frame = -1;
- s->above_blocks[block].dc_coeff = 0;
- s->above_blocks[block].not_null_dc = 0;
- }
- s->above_blocks[2*s->mb_width + 2].ref_frame = 0;
- s->above_blocks[3*s->mb_width + 4].ref_frame = 0;
-
- stride_y = p->linesize[0];
- stride_uv = p->linesize[1];
-
- if (s->flip < 0)
- mb_offset = 7;
-
- /* main macroblocks loop */
- for (mb_row=0; mb_row<s->mb_height; mb_row++) {
- if (s->flip < 0)
- mb_row_flip = s->mb_height - mb_row - 1;
- else
- mb_row_flip = mb_row;
-
- for (block=0; block<4; block++) {
- s->left_block[block].ref_frame = -1;
- s->left_block[block].dc_coeff = 0;
- s->left_block[block].not_null_dc = 0;
- memset(s->coeff_ctx[block], 0, 64*sizeof(s->coeff_ctx[block][0]));
- }
- memset(s->coeff_ctx_last, 24, sizeof(s->coeff_ctx_last));
-
- s->above_block_idx[0] = 1;
- s->above_block_idx[1] = 2;
- s->above_block_idx[2] = 1;
- s->above_block_idx[3] = 2;
- s->above_block_idx[4] = 2*s->mb_width + 2 + 1;
- s->above_block_idx[5] = 3*s->mb_width + 4 + 1;
-
- s->block_offset[s->frbi] = (mb_row_flip*16 + mb_offset) * stride_y;
- s->block_offset[s->srbi] = s->block_offset[s->frbi] + 8*stride_y;
- s->block_offset[1] = s->block_offset[0] + 8;
- s->block_offset[3] = s->block_offset[2] + 8;
- s->block_offset[4] = (mb_row_flip*8 + mb_offset) * stride_uv;
- s->block_offset[5] = s->block_offset[4];
-
- for (mb_col=0; mb_col<s->mb_width; mb_col++) {
- vp56_decode_mb(s, mb_row, mb_col);
-
- for (y=0; y<4; y++) {
- s->above_block_idx[y] += 2;
- s->block_offset[y] += 16;
- }
-
- for (uv=4; uv<6; uv++) {
- s->above_block_idx[uv] += 1;
- s->block_offset[uv] += 8;
- }
- }
- }
-
- if (s->frames[VP56_FRAME_PREVIOUS].data[0]
- && (s->frames[VP56_FRAME_PREVIOUS].data[0]
- != s->frames[VP56_FRAME_GOLDEN].data[0])) {
- avctx->release_buffer(avctx, &s->frames[VP56_FRAME_PREVIOUS]);
- }
- if (p->key_frame || golden_frame) {
- if (s->frames[VP56_FRAME_GOLDEN].data[0])
- avctx->release_buffer(avctx, &s->frames[VP56_FRAME_GOLDEN]);
- s->frames[VP56_FRAME_GOLDEN] = *p;
- }
- s->frames[VP56_FRAME_PREVIOUS] = *p;
-
- *picture = *p;
- *data_size = sizeof(AVPicture);
-
- return buf_size;
-}
-
-void vp56_init(vp56_context_t *s, AVCodecContext *avctx, int flip)
-{
- int i;
-
- s->avctx = avctx;
- avctx->pix_fmt = PIX_FMT_YUV420P;
-
- if (s->avctx->idct_algo == FF_IDCT_AUTO)
- s->avctx->idct_algo = FF_IDCT_VP3;
- dsputil_init(&s->dsp, s->avctx);
- ff_init_scantable(s->dsp.idct_permutation, &s->scantable,ff_zigzag_direct);
-
- avcodec_set_dimensions(s->avctx, 0, 0);
-
- for (i=0; i<3; i++)
- s->frames[i].data[0] = NULL;
- s->edge_emu_buffer_alloc = NULL;
-
- s->above_blocks = NULL;
- s->macroblocks = NULL;
- s->quantizer = -1;
- s->deblock_filtering = 1;
-
- s->filter = NULL;
-
- if (flip) {
- s->flip = -1;
- s->frbi = 2;
- s->srbi = 0;
- } else {
- s->flip = 1;
- s->frbi = 0;
- s->srbi = 2;
- }
-}
-
-int vp56_free(AVCodecContext *avctx)
-{
- vp56_context_t *s = avctx->priv_data;
-
- av_free(s->above_blocks);
- av_free(s->macroblocks);
- av_free(s->edge_emu_buffer_alloc);
- if (s->frames[VP56_FRAME_GOLDEN].data[0]
- && (s->frames[VP56_FRAME_PREVIOUS].data[0]
- != s->frames[VP56_FRAME_GOLDEN].data[0]))
- avctx->release_buffer(avctx, &s->frames[VP56_FRAME_GOLDEN]);
- if (s->frames[VP56_FRAME_PREVIOUS].data[0])
- avctx->release_buffer(avctx, &s->frames[VP56_FRAME_PREVIOUS]);
- return 0;
-}
diff --git a/src/libffmpeg/libavcodec/vp56.h b/src/libffmpeg/libavcodec/vp56.h
deleted file mode 100644
index 50e201550..000000000
--- a/src/libffmpeg/libavcodec/vp56.h
+++ /dev/null
@@ -1,252 +0,0 @@
-/**
- * @file vp56.h
- * VP5 and VP6 compatible video decoder (common features)
- *
- * Copyright (C) 2006 Aurelien Jacobs <aurel@gnuage.org>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef VP56_H
-#define VP56_H
-
-#include "vp56data.h"
-#include "dsputil.h"
-#include "mpegvideo.h"
-
-
-typedef struct vp56_context vp56_context_t;
-typedef struct vp56_mv vp56_mv_t;
-
-typedef void (*vp56_parse_vector_adjustment_t)(vp56_context_t *s,
- vp56_mv_t *vect);
-typedef int (*vp56_adjust_t)(int v, int t);
-typedef void (*vp56_filter_t)(vp56_context_t *s, uint8_t *dst, uint8_t *src,
- int offset1, int offset2, int stride,
- vp56_mv_t mv, int mask, int select, int luma);
-typedef void (*vp56_parse_coeff_t)(vp56_context_t *s);
-typedef void (*vp56_default_models_init_t)(vp56_context_t *s);
-typedef void (*vp56_parse_vector_models_t)(vp56_context_t *s);
-typedef void (*vp56_parse_coeff_models_t)(vp56_context_t *s);
-typedef int (*vp56_parse_header_t)(vp56_context_t *s, uint8_t *buf,
- int buf_size, int *golden_frame);
-
-typedef struct {
- int high;
- int bits;
- const uint8_t *buffer;
- unsigned long code_word;
-} vp56_range_coder_t;
-
-typedef struct {
- uint8_t not_null_dc;
- vp56_frame_t ref_frame;
- DCTELEM dc_coeff;
-} vp56_ref_dc_t;
-
-struct vp56_mv {
- int x;
- int y;
-};
-
-typedef struct {
- uint8_t type;
- vp56_mv_t mv;
-} vp56_macroblock_t;
-
-struct vp56_context {
- AVCodecContext *avctx;
- DSPContext dsp;
- ScanTable scantable;
- AVFrame frames[3];
- uint8_t *edge_emu_buffer_alloc;
- uint8_t *edge_emu_buffer;
- vp56_range_coder_t c;
- vp56_range_coder_t cc;
- vp56_range_coder_t *ccp;
- int sub_version;
-
- /* frame info */
- int plane_width[3];
- int plane_height[3];
- int mb_width; /* number of horizontal MB */
- int mb_height; /* number of vertical MB */
- int block_offset[6];
-
- int quantizer;
- uint16_t dequant_dc;
- uint16_t dequant_ac;
-
- /* DC predictors management */
- vp56_ref_dc_t *above_blocks;
- vp56_ref_dc_t left_block[4];
- int above_block_idx[6];
- DCTELEM prev_dc[3][3]; /* [plan][ref_frame] */
-
- /* blocks / macroblock */
- vp56_mb_t mb_type;
- vp56_macroblock_t *macroblocks;
- DECLARE_ALIGNED_16(DCTELEM, block_coeff[6][64]);
- uint8_t coeff_reorder[64]; /* used in vp6 only */
- uint8_t coeff_index_to_pos[64]; /* used in vp6 only */
-
- /* motion vectors */
- vp56_mv_t mv[6]; /* vectors for each block in MB */
- vp56_mv_t vector_candidate[2];
- int vector_candidate_pos;
-
- /* filtering hints */
- int filter_header; /* used in vp6 only */
- int deblock_filtering;
- int filter_selection;
- int filter_mode;
- int max_vector_length;
- int sample_variance_threshold;
-
- /* AC models */
- uint8_t vector_model_sig[2]; /* delta sign */
- uint8_t vector_model_dct[2]; /* delta coding types */
- uint8_t vector_model_pdi[2][2]; /* predefined delta init */
- uint8_t vector_model_pdv[2][7]; /* predefined delta values */
- uint8_t vector_model_fdv[2][8]; /* 8 bit delta value definition */
- uint8_t mb_type_model[3][10][10]; /* model for decoding MB type */
- uint8_t coeff_model_dccv[2][11]; /* DC coeff value */
- uint8_t coeff_model_ract[2][3][6][11]; /* Run/AC coding type and AC coeff value */
- uint8_t coeff_model_acct[2][3][3][6][5];/* vp5 only AC coding type for coding group < 3 */
- uint8_t coeff_model_dcct[2][36][5]; /* DC coeff coding type */
- uint8_t coeff_model_runv[2][14]; /* run value (vp6 only) */
- uint8_t mb_types_stats[3][10][2]; /* contextual, next MB type stats */
- uint8_t coeff_ctx[4][64]; /* used in vp5 only */
- uint8_t coeff_ctx_last[4]; /* used in vp5 only */
-
- /* upside-down flipping hints */
- int flip; /* are we flipping ? */
- int frbi; /* first row block index in MB */
- int srbi; /* second row block index in MB */
- int stride[3]; /* stride for each plan */
-
- const uint8_t *vp56_coord_div;
- vp56_parse_vector_adjustment_t parse_vector_adjustment;
- vp56_adjust_t adjust;
- vp56_filter_t filter;
- vp56_parse_coeff_t parse_coeff;
- vp56_default_models_init_t default_models_init;
- vp56_parse_vector_models_t parse_vector_models;
- vp56_parse_coeff_models_t parse_coeff_models;
- vp56_parse_header_t parse_header;
-};
-
-
-void vp56_init(vp56_context_t *s, AVCodecContext *avctx, int flip);
-int vp56_free(AVCodecContext *avctx);
-void vp56_init_dequant(vp56_context_t *s, int quantizer);
-int vp56_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
- uint8_t *buf, int buf_size);
-
-
-/**
- * vp56 specific range coder implementation
- */
-
-static inline void vp56_init_range_decoder(vp56_range_coder_t *c,
- const uint8_t *buf, int buf_size)
-{
- c->high = 255;
- c->bits = 8;
- c->buffer = buf;
- c->code_word = *c->buffer++ << 8;
- c->code_word |= *c->buffer++;
-}
-
-static inline int vp56_rac_get_prob(vp56_range_coder_t *c, uint8_t prob)
-{
- unsigned int low = 1 + (((c->high - 1) * prob) / 256);
- unsigned int low_shift = low << 8;
- int bit = c->code_word >= low_shift;
-
- if (bit) {
- c->high -= low;
- c->code_word -= low_shift;
- } else {
- c->high = low;
- }
-
- /* normalize */
- while (c->high < 128) {
- c->high <<= 1;
- c->code_word <<= 1;
- if (--c->bits == 0) {
- c->bits = 8;
- c->code_word |= *c->buffer++;
- }
- }
- return bit;
-}
-
-static inline int vp56_rac_get(vp56_range_coder_t *c)
-{
- /* equiprobable */
- int low = (c->high + 1) >> 1;
- unsigned int low_shift = low << 8;
- int bit = c->code_word >= low_shift;
- if (bit) {
- c->high = (c->high - low) << 1;
- c->code_word -= low_shift;
- } else {
- c->high = low << 1;
- }
-
- /* normalize */
- c->code_word <<= 1;
- if (--c->bits == 0) {
- c->bits = 8;
- c->code_word |= *c->buffer++;
- }
- return bit;
-}
-
-static inline int vp56_rac_gets(vp56_range_coder_t *c, int bits)
-{
- int value = 0;
-
- while (bits--) {
- value = (value << 1) | vp56_rac_get(c);
- }
-
- return value;
-}
-
-static inline int vp56_rac_gets_nn(vp56_range_coder_t *c, int bits)
-{
- int v = vp56_rac_gets(c, 7) << 1;
- return v + !v;
-}
-
-static inline int vp56_rac_get_tree(vp56_range_coder_t *c,
- const vp56_tree_t *tree,
- const uint8_t *probs)
-{
- while (tree->val > 0) {
- if (vp56_rac_get_prob(c, probs[tree->prob_idx]))
- tree += tree->val;
- else
- tree++;
- }
- return -tree->val;
-}
-
-#endif /* VP56_H */
diff --git a/src/libffmpeg/libavcodec/vp56data.c b/src/libffmpeg/libavcodec/vp56data.c
deleted file mode 100644
index e75c6d1ce..000000000
--- a/src/libffmpeg/libavcodec/vp56data.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/**
- * @file vp56data.c
- * VP5 and VP6 compatible video decoder (common data)
- *
- * Copyright (C) 2006 Aurelien Jacobs <aurel@gnuage.org>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "vp56data.h"
-
-const uint8_t vp56_b6to3[] = { 0, 0, 0, 0, 1, 2 };
-const uint8_t vp56_b6to4[] = { 0, 0, 1, 1, 2, 3 };
-
-const uint8_t vp56_coeff_parse_table[6][11] = {
- { 159, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 145, 165, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 140, 148, 173, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 135, 140, 155, 176, 0, 0, 0, 0, 0, 0, 0 },
- { 130, 134, 141, 157, 180, 0, 0, 0, 0, 0, 0 },
- { 129, 130, 133, 140, 153, 177, 196, 230, 243, 254, 254 },
-};
-
-const uint8_t vp56_def_mb_types_stats[3][10][2] = {
- { { 69, 42 }, { 1, 2 }, { 1, 7 }, { 44, 42 }, { 6, 22 },
- { 1, 3 }, { 0, 2 }, { 1, 5 }, { 0, 1 }, { 0, 0 }, },
- { { 229, 8 }, { 1, 1 }, { 0, 8 }, { 0, 0 }, { 0, 0 },
- { 1, 2 }, { 0, 1 }, { 0, 0 }, { 1, 1 }, { 0, 0 }, },
- { { 122, 35 }, { 1, 1 }, { 1, 6 }, { 46, 34 }, { 0, 0 },
- { 1, 2 }, { 0, 1 }, { 0, 1 }, { 1, 1 }, { 0, 0 }, },
-};
-
-const vp56_tree_t vp56_pva_tree[] = {
- { 8, 0},
- { 4, 1},
- { 2, 2}, {-0}, {-1},
- { 2, 3}, {-2}, {-3},
- { 4, 4},
- { 2, 5}, {-4}, {-5},
- { 2, 6}, {-6}, {-7},
-};
-
-const vp56_tree_t vp56_pc_tree[] = {
- { 4, 6},
- { 2, 7}, {-0}, {-1},
- { 4, 8},
- { 2, 9}, {-2}, {-3},
- { 2,10}, {-4}, {-5},
-};
-
-const uint8_t vp56_coeff_bias[] = { 5, 7, 11, 19, 35, 67 };
-const uint8_t vp56_coeff_bit_length[] = { 0, 1, 2, 3, 4, 10 };
diff --git a/src/libffmpeg/libavcodec/vp56data.h b/src/libffmpeg/libavcodec/vp56data.h
deleted file mode 100644
index dbf92dd68..000000000
--- a/src/libffmpeg/libavcodec/vp56data.h
+++ /dev/null
@@ -1,248 +0,0 @@
-/**
- * @file vp56data.h
- * VP5 and VP6 compatible video decoder (common data)
- *
- * Copyright (C) 2006 Aurelien Jacobs <aurel@gnuage.org>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef VP56DATA_H
-#define VP56DATA_H
-
-#include "common.h"
-
-typedef enum {
- VP56_FRAME_CURRENT = 0,
- VP56_FRAME_PREVIOUS = 1,
- VP56_FRAME_GOLDEN = 2,
-} vp56_frame_t;
-
-typedef enum {
- VP56_MB_INTER_NOVEC_PF = 0, /**< Inter MB, no vector, from previous frame */
- VP56_MB_INTRA = 1, /**< Intra MB */
- VP56_MB_INTER_DELTA_PF = 2, /**< Inter MB, above/left vector + delta, from previous frame */
- VP56_MB_INTER_V1_PF = 3, /**< Inter MB, first vector, from previous frame */
- VP56_MB_INTER_V2_PF = 4, /**< Inter MB, second vector, from previous frame */
- VP56_MB_INTER_NOVEC_GF = 5, /**< Inter MB, no vector, from golden frame */
- VP56_MB_INTER_DELTA_GF = 6, /**< Inter MB, above/left vector + delta, from golden frame */
- VP56_MB_INTER_4V = 7, /**< Inter MB, 4 vectors, from previous frame */
- VP56_MB_INTER_V1_GF = 8, /**< Inter MB, first vector, from golden frame */
- VP56_MB_INTER_V2_GF = 9, /**< Inter MB, second vector, from golden frame */
-} vp56_mb_t;
-
-typedef struct {
- int8_t val;
- int8_t prob_idx;
-} vp56_tree_t;
-
-extern const uint8_t vp56_b6to3[];
-extern const uint8_t vp56_b6to4[];
-extern const uint8_t vp56_coeff_parse_table[6][11];
-extern const uint8_t vp56_def_mb_types_stats[3][10][2];
-extern const vp56_tree_t vp56_pva_tree[];
-extern const vp56_tree_t vp56_pc_tree[];
-extern const uint8_t vp56_coeff_bias[];
-extern const uint8_t vp56_coeff_bit_length[];
-
-static const vp56_frame_t vp56_reference_frame[] = {
- VP56_FRAME_PREVIOUS, /* VP56_MB_INTER_NOVEC_PF */
- VP56_FRAME_CURRENT, /* VP56_MB_INTRA */
- VP56_FRAME_PREVIOUS, /* VP56_MB_INTER_DELTA_PF */
- VP56_FRAME_PREVIOUS, /* VP56_MB_INTER_V1_PF */
- VP56_FRAME_PREVIOUS, /* VP56_MB_INTER_V2_PF */
- VP56_FRAME_GOLDEN, /* VP56_MB_INTER_NOVEC_GF */
- VP56_FRAME_GOLDEN, /* VP56_MB_INTER_DELTA_GF */
- VP56_FRAME_PREVIOUS, /* VP56_MB_INTER_4V */
- VP56_FRAME_GOLDEN, /* VP56_MB_INTER_V1_GF */
- VP56_FRAME_GOLDEN, /* VP56_MB_INTER_V2_GF */
-};
-
-static const uint8_t vp56_ac_dequant[64] = {
- 94, 92, 90, 88, 86, 82, 78, 74,
- 70, 66, 62, 58, 54, 53, 52, 51,
- 50, 49, 48, 47, 46, 45, 44, 43,
- 42, 40, 39, 37, 36, 35, 34, 33,
- 32, 31, 30, 29, 28, 27, 26, 25,
- 24, 23, 22, 21, 20, 19, 18, 17,
- 16, 15, 14, 13, 12, 11, 10, 9,
- 8, 7, 6, 5, 4, 3, 2, 1,
-};
-
-static const uint8_t vp56_dc_dequant[64] = {
- 47, 47, 47, 47, 45, 43, 43, 43,
- 43, 43, 42, 41, 41, 40, 40, 40,
- 40, 35, 35, 35, 35, 33, 33, 33,
- 33, 32, 32, 32, 27, 27, 26, 26,
- 25, 25, 24, 24, 23, 23, 19, 19,
- 19, 19, 18, 18, 17, 16, 16, 16,
- 16, 16, 15, 11, 11, 11, 10, 10,
- 9, 8, 7, 5, 3, 3, 2, 2,
-};
-
-static const uint8_t vp56_pre_def_mb_type_stats[16][3][10][2] = {
- { { { 9, 15 }, { 32, 25 }, { 7, 19 }, { 9, 21 }, { 1, 12 },
- { 14, 12 }, { 3, 18 }, { 14, 23 }, { 3, 10 }, { 0, 4 }, },
- { { 41, 22 }, { 1, 0 }, { 1, 31 }, { 0, 0 }, { 0, 0 },
- { 0, 1 }, { 1, 7 }, { 0, 1 }, { 98, 25 }, { 4, 10 }, },
- { { 2, 3 }, { 2, 3 }, { 0, 2 }, { 0, 2 }, { 0, 0 },
- { 11, 4 }, { 1, 4 }, { 0, 2 }, { 3, 2 }, { 0, 4 }, }, },
- { { { 48, 39 }, { 1, 2 }, { 11, 27 }, { 29, 44 }, { 7, 27 },
- { 1, 4 }, { 0, 3 }, { 1, 6 }, { 1, 2 }, { 0, 0 }, },
- { { 123, 37 }, { 6, 4 }, { 1, 27 }, { 0, 0 }, { 0, 0 },
- { 5, 8 }, { 1, 7 }, { 0, 1 }, { 12, 10 }, { 0, 2 }, },
- { { 49, 46 }, { 3, 4 }, { 7, 31 }, { 42, 41 }, { 0, 0 },
- { 2, 6 }, { 1, 7 }, { 1, 4 }, { 2, 4 }, { 0, 1 }, }, },
- { { { 21, 32 }, { 1, 2 }, { 4, 10 }, { 32, 43 }, { 6, 23 },
- { 2, 3 }, { 1, 19 }, { 1, 6 }, { 12, 21 }, { 0, 7 }, },
- { { 26, 14 }, { 14, 12 }, { 0, 24 }, { 0, 0 }, { 0, 0 },
- { 55, 17 }, { 1, 9 }, { 0, 36 }, { 5, 7 }, { 1, 3 }, },
- { { 26, 25 }, { 1, 1 }, { 2, 10 }, { 67, 39 }, { 0, 0 },
- { 1, 1 }, { 0, 14 }, { 0, 2 }, { 31, 26 }, { 1, 6 }, }, },
- { { { 69, 83 }, { 0, 0 }, { 0, 2 }, { 10, 29 }, { 3, 12 },
- { 0, 1 }, { 0, 3 }, { 0, 3 }, { 2, 2 }, { 0, 0 }, },
- { { 209, 5 }, { 0, 0 }, { 0, 27 }, { 0, 0 }, { 0, 0 },
- { 0, 1 }, { 0, 1 }, { 0, 1 }, { 0, 0 }, { 0, 0 }, },
- { { 103, 46 }, { 1, 2 }, { 2, 10 }, { 33, 42 }, { 0, 0 },
- { 1, 4 }, { 0, 3 }, { 0, 1 }, { 1, 3 }, { 0, 0 }, }, },
- { { { 11, 20 }, { 1, 4 }, { 18, 36 }, { 43, 48 }, { 13, 35 },
- { 0, 2 }, { 0, 5 }, { 3, 12 }, { 1, 2 }, { 0, 0 }, },
- { { 2, 5 }, { 4, 5 }, { 0, 121 }, { 0, 0 }, { 0, 0 },
- { 0, 3 }, { 2, 4 }, { 1, 4 }, { 2, 2 }, { 0, 1 }, },
- { { 14, 31 }, { 9, 13 }, { 14, 54 }, { 22, 29 }, { 0, 0 },
- { 2, 6 }, { 4, 18 }, { 6, 13 }, { 1, 5 }, { 0, 1 }, }, },
- { { { 70, 44 }, { 0, 1 }, { 2, 10 }, { 37, 46 }, { 8, 26 },
- { 0, 2 }, { 0, 2 }, { 0, 2 }, { 0, 1 }, { 0, 0 }, },
- { { 175, 5 }, { 0, 1 }, { 0, 48 }, { 0, 0 }, { 0, 0 },
- { 0, 2 }, { 0, 1 }, { 0, 2 }, { 0, 1 }, { 0, 0 }, },
- { { 85, 39 }, { 0, 0 }, { 1, 9 }, { 69, 40 }, { 0, 0 },
- { 0, 1 }, { 0, 3 }, { 0, 1 }, { 2, 3 }, { 0, 0 }, }, },
- { { { 8, 15 }, { 0, 1 }, { 8, 21 }, { 74, 53 }, { 22, 42 },
- { 0, 1 }, { 0, 2 }, { 0, 3 }, { 1, 2 }, { 0, 0 }, },
- { { 83, 5 }, { 2, 3 }, { 0, 102 }, { 0, 0 }, { 0, 0 },
- { 1, 3 }, { 0, 2 }, { 0, 1 }, { 0, 0 }, { 0, 0 }, },
- { { 31, 28 }, { 0, 0 }, { 3, 14 }, { 130, 34 }, { 0, 0 },
- { 0, 1 }, { 0, 3 }, { 0, 1 }, { 3, 3 }, { 0, 1 }, }, },
- { { { 141, 42 }, { 0, 0 }, { 1, 4 }, { 11, 24 }, { 1, 11 },
- { 0, 1 }, { 0, 1 }, { 0, 2 }, { 0, 0 }, { 0, 0 }, },
- { { 233, 6 }, { 0, 0 }, { 0, 8 }, { 0, 0 }, { 0, 0 },
- { 0, 1 }, { 0, 1 }, { 0, 0 }, { 0, 1 }, { 0, 0 }, },
- { { 171, 25 }, { 0, 0 }, { 1, 5 }, { 25, 21 }, { 0, 0 },
- { 0, 1 }, { 0, 1 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, }, },
- { { { 8, 19 }, { 4, 10 }, { 24, 45 }, { 21, 37 }, { 9, 29 },
- { 0, 3 }, { 1, 7 }, { 11, 25 }, { 0, 2 }, { 0, 1 }, },
- { { 34, 16 }, { 112, 21 }, { 1, 28 }, { 0, 0 }, { 0, 0 },
- { 6, 8 }, { 1, 7 }, { 0, 3 }, { 2, 5 }, { 0, 2 }, },
- { { 17, 21 }, { 68, 29 }, { 6, 15 }, { 13, 22 }, { 0, 0 },
- { 6, 12 }, { 3, 14 }, { 4, 10 }, { 1, 7 }, { 0, 3 }, }, },
- { { { 46, 42 }, { 0, 1 }, { 2, 10 }, { 54, 51 }, { 10, 30 },
- { 0, 2 }, { 0, 2 }, { 0, 1 }, { 0, 1 }, { 0, 0 }, },
- { { 159, 35 }, { 2, 2 }, { 0, 25 }, { 0, 0 }, { 0, 0 },
- { 3, 6 }, { 0, 5 }, { 0, 1 }, { 4, 4 }, { 0, 1 }, },
- { { 51, 39 }, { 0, 1 }, { 2, 12 }, { 91, 44 }, { 0, 0 },
- { 0, 2 }, { 0, 3 }, { 0, 1 }, { 2, 3 }, { 0, 1 }, }, },
- { { { 28, 32 }, { 0, 0 }, { 3, 10 }, { 75, 51 }, { 14, 33 },
- { 0, 1 }, { 0, 2 }, { 0, 1 }, { 1, 2 }, { 0, 0 }, },
- { { 75, 39 }, { 5, 7 }, { 2, 48 }, { 0, 0 }, { 0, 0 },
- { 3, 11 }, { 2, 16 }, { 1, 4 }, { 7, 10 }, { 0, 2 }, },
- { { 81, 25 }, { 0, 0 }, { 2, 9 }, { 106, 26 }, { 0, 0 },
- { 0, 1 }, { 0, 1 }, { 0, 1 }, { 1, 1 }, { 0, 0 }, }, },
- { { { 100, 46 }, { 0, 1 }, { 3, 9 }, { 21, 37 }, { 5, 20 },
- { 0, 1 }, { 0, 2 }, { 1, 2 }, { 0, 1 }, { 0, 0 }, },
- { { 212, 21 }, { 0, 1 }, { 0, 9 }, { 0, 0 }, { 0, 0 },
- { 1, 2 }, { 0, 2 }, { 0, 0 }, { 2, 2 }, { 0, 0 }, },
- { { 140, 37 }, { 0, 1 }, { 1, 8 }, { 24, 33 }, { 0, 0 },
- { 1, 2 }, { 0, 2 }, { 0, 1 }, { 1, 2 }, { 0, 0 }, }, },
- { { { 27, 29 }, { 0, 1 }, { 9, 25 }, { 53, 51 }, { 12, 34 },
- { 0, 1 }, { 0, 3 }, { 1, 5 }, { 0, 2 }, { 0, 0 }, },
- { { 4, 2 }, { 0, 0 }, { 0, 172 }, { 0, 0 }, { 0, 0 },
- { 0, 1 }, { 0, 2 }, { 0, 0 }, { 2, 0 }, { 0, 0 }, },
- { { 14, 23 }, { 1, 3 }, { 11, 53 }, { 90, 31 }, { 0, 0 },
- { 0, 3 }, { 1, 5 }, { 2, 6 }, { 1, 2 }, { 0, 0 }, }, },
- { { { 80, 38 }, { 0, 0 }, { 1, 4 }, { 69, 33 }, { 5, 16 },
- { 0, 1 }, { 0, 1 }, { 0, 0 }, { 0, 1 }, { 0, 0 }, },
- { { 187, 22 }, { 1, 1 }, { 0, 17 }, { 0, 0 }, { 0, 0 },
- { 3, 6 }, { 0, 4 }, { 0, 1 }, { 4, 4 }, { 0, 1 }, },
- { { 123, 29 }, { 0, 0 }, { 1, 7 }, { 57, 30 }, { 0, 0 },
- { 0, 1 }, { 0, 1 }, { 0, 1 }, { 0, 1 }, { 0, 0 }, }, },
- { { { 16, 20 }, { 0, 0 }, { 2, 8 }, { 104, 49 }, { 15, 33 },
- { 0, 1 }, { 0, 1 }, { 0, 1 }, { 1, 1 }, { 0, 0 }, },
- { { 133, 6 }, { 1, 2 }, { 1, 70 }, { 0, 0 }, { 0, 0 },
- { 0, 2 }, { 0, 4 }, { 0, 3 }, { 1, 1 }, { 0, 0 }, },
- { { 13, 14 }, { 0, 0 }, { 4, 20 }, { 175, 20 }, { 0, 0 },
- { 0, 1 }, { 0, 1 }, { 0, 1 }, { 1, 1 }, { 0, 0 }, }, },
- { { { 194, 16 }, { 0, 0 }, { 1, 1 }, { 1, 9 }, { 1, 3 },
- { 0, 0 }, { 0, 1 }, { 0, 1 }, { 0, 0 }, { 0, 0 }, },
- { { 251, 1 }, { 0, 0 }, { 0, 2 }, { 0, 0 }, { 0, 0 },
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, },
- { { 202, 23 }, { 0, 0 }, { 1, 3 }, { 2, 9 }, { 0, 0 },
- { 0, 1 }, { 0, 1 }, { 0, 1 }, { 0, 0 }, { 0, 0 }, }, },
-};
-
-static const uint8_t vp56_filter_threshold[] = {
- 14, 14, 13, 13, 12, 12, 10, 10,
- 10, 10, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 7, 7, 7, 7,
- 7, 7, 6, 6, 6, 6, 6, 6,
- 5, 5, 5, 5, 4, 4, 4, 4,
- 4, 4, 4, 3, 3, 3, 3, 2,
-};
-
-static const uint8_t vp56_mb_type_model_model[] = {
- 171, 83, 199, 140, 125, 104,
-};
-
-static const vp56_tree_t vp56_pmbtm_tree[] = {
- { 4, 0},
- { 2, 1}, {-8}, {-4},
- { 8, 2},
- { 6, 3},
- { 4, 4},
- { 2, 5}, {-24}, {-20}, {-16}, {-12}, {-0},
-};
-
-static const vp56_tree_t vp56_pmbt_tree[] = {
- { 8, 1},
- { 4, 2},
- { 2, 4}, {-VP56_MB_INTER_NOVEC_PF}, {-VP56_MB_INTER_DELTA_PF},
- { 2, 5}, {-VP56_MB_INTER_V1_PF}, {-VP56_MB_INTER_V2_PF},
- { 4, 3},
- { 2, 6}, {-VP56_MB_INTRA}, {-VP56_MB_INTER_4V},
- { 4, 7},
- { 2, 8}, {-VP56_MB_INTER_NOVEC_GF}, {-VP56_MB_INTER_DELTA_GF},
- { 2, 9}, {-VP56_MB_INTER_V1_GF}, {-VP56_MB_INTER_V2_GF},
-};
-
-/* relative pos of surrounding blocks, from closest to farthest */
-static const int8_t vp56_candidate_predictor_pos[12][2] = {
- { 0, -1 },
- { -1, 0 },
- { -1, -1 },
- { 1, -1 },
- { 0, -2 },
- { -2, 0 },
- { -2, -1 },
- { -1, -2 },
- { 1, -2 },
- { 2, -1 },
- { -2, -2 },
- { 2, -2 },
-};
-
-#endif /* VP56DATA */
diff --git a/src/libffmpeg/libavcodec/vp5data.h b/src/libffmpeg/libavcodec/vp5data.h
deleted file mode 100644
index effc17c2c..000000000
--- a/src/libffmpeg/libavcodec/vp5data.h
+++ /dev/null
@@ -1,173 +0,0 @@
-/**
- * @file vp5data.h
- * VP5 compatible video decoder
- *
- * Copyright (C) 2006 Aurelien Jacobs <aurel@gnuage.org>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef VP5DATA_H
-#define VP5DATA_H
-
-static const uint8_t vp5_coeff_groups[] = {
- -1, 0, 1, 1, 2, 1, 1, 2,
- 2, 1, 1, 2, 2, 2, 1, 2,
- 2, 2, 2, 2, 1, 1, 2, 2,
- 3, 3, 4, 3, 4, 4, 4, 3,
- 3, 3, 3, 3, 4, 3, 3, 3,
- 4, 4, 4, 4, 4, 3, 3, 4,
- 4, 4, 3, 4, 4, 4, 4, 4,
- 4, 4, 5, 5, 5, 5, 5, 5,
-};
-
-static const uint8_t vp5_vmc_pct[2][11] = {
- { 243, 220, 251, 253, 237, 232, 241, 245, 247, 251, 253 },
- { 235, 211, 246, 249, 234, 231, 248, 249, 252, 252, 254 },
-};
-
-static const uint8_t vp5_dccv_pct[2][11] = {
- { 146, 197, 181, 207, 232, 243, 238, 251, 244, 250, 249 },
- { 179, 219, 214, 240, 250, 254, 244, 254, 254, 254, 254 },
-};
-
-static const uint8_t vp5_ract_pct[3][2][6][11] = {
- { { { 227, 246, 230, 247, 244, 254, 254, 254, 254, 254, 254 },
- { 202, 254, 209, 231, 231, 249, 249, 253, 254, 254, 254 },
- { 206, 254, 225, 242, 241, 251, 253, 254, 254, 254, 254 },
- { 235, 254, 241, 253, 252, 254, 254, 254, 254, 254, 254 },
- { 234, 254, 248, 254, 254, 254, 254, 254, 254, 254, 254 },
- { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 } },
- { { 240, 254, 248, 254, 254, 254, 254, 254, 254, 254, 254 },
- { 238, 254, 240, 253, 254, 254, 254, 254, 254, 254, 254 },
- { 244, 254, 251, 254, 254, 254, 254, 254, 254, 254, 254 },
- { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 },
- { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 },
- { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 } } },
- { { { 206, 203, 227, 239, 247, 254, 253, 254, 254, 254, 254 },
- { 207, 199, 220, 236, 243, 252, 252, 254, 254, 254, 254 },
- { 212, 219, 230, 243, 244, 253, 252, 254, 254, 254, 254 },
- { 236, 237, 247, 252, 253, 254, 254, 254, 254, 254, 254 },
- { 240, 240, 248, 254, 254, 254, 254, 254, 254, 254, 254 },
- { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 } },
- { { 230, 233, 249, 254, 254, 254, 254, 254, 254, 254, 254 },
- { 238, 238, 250, 254, 254, 254, 254, 254, 254, 254, 254 },
- { 248, 251, 254, 254, 254, 254, 254, 254, 254, 254, 254 },
- { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 },
- { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 },
- { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 } } },
- { { { 225, 239, 227, 231, 244, 253, 243, 254, 254, 253, 254 },
- { 232, 234, 224, 228, 242, 249, 242, 252, 251, 251, 254 },
- { 235, 249, 238, 240, 251, 254, 249, 254, 253, 253, 254 },
- { 249, 253, 251, 250, 254, 254, 254, 254, 254, 254, 254 },
- { 251, 250, 249, 254, 254, 254, 254, 254, 254, 254, 254 },
- { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 } },
- { { 243, 244, 250, 250, 254, 254, 254, 254, 254, 254, 254 },
- { 249, 248, 250, 253, 254, 254, 254, 254, 254, 254, 254 },
- { 253, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 },
- { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 },
- { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 },
- { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 } } },
-};
-
-static const int16_t vp5_dccv_lc[5][36][2] = {
- { {154, 61}, {141, 54}, { 90, 45}, { 54, 34}, { 54, 13}, {128, 109},
- {136, 54}, {148, 45}, { 92, 41}, { 54, 33}, { 51, 15}, { 87, 113},
- { 87, 44}, { 97, 40}, { 67, 36}, { 46, 29}, { 41, 15}, { 64, 80},
- { 59, 33}, { 61, 31}, { 51, 28}, { 44, 22}, { 33, 12}, { 49, 63},
- { 69, 12}, { 59, 16}, { 46, 14}, { 31, 13}, { 26, 6}, { 92, 26},
- {128, 108}, { 77, 119}, { 54, 84}, { 26, 71}, { 87, 19}, { 95, 155} },
- { {154, 4}, {182, 0}, {159, -8}, {128, -5}, {143, -5}, {187, 55},
- {182, 0}, {228, -3}, {187, -7}, {174, -9}, {189, -11}, {169, 79},
- {161, -9}, {192, -8}, {187, -9}, {169, -10}, {136, -9}, {184, 40},
- {164, -11}, {179, -10}, {174, -10}, {161, -10}, {115, -7}, {197, 20},
- {195, -11}, {195, -11}, {146, -10}, {110, -6}, { 95, -4}, {195, 39},
- {182, 55}, {172, 77}, {177, 37}, {169, 29}, {172, 52}, { 92, 162} },
- { {174, 80}, {164, 80}, { 95, 80}, { 46, 66}, { 56, 24}, { 36, 193},
- {164, 80}, {166, 77}, {105, 76}, { 49, 68}, { 46, 31}, { 49, 186},
- { 97, 78}, {110, 74}, { 72, 72}, { 44, 60}, { 33, 30}, { 69, 131},
- { 61, 61}, { 69, 63}, { 51, 57}, { 31, 48}, { 26, 27}, { 64, 89},
- { 67, 23}, { 51, 32}, { 36, 33}, { 26, 28}, { 20, 12}, { 44, 68},
- { 26, 197}, { 41, 189}, { 61, 129}, { 28, 103}, { 49, 52}, {-12, 245} },
- { {102, 141}, { 79, 166}, { 72, 162}, { 97, 125}, {179, 4}, {307, 0},
- { 72, 168}, { 69, 175}, { 84, 160}, {105, 127}, {148, 34}, {310, 0},
- { 84, 151}, { 82, 161}, { 87, 153}, { 87, 135}, {115, 51}, {317, 0},
- { 97, 125}, {102, 131}, {105, 125}, { 87, 122}, { 84, 64}, { 54, 184},
- {166, 18}, {146, 43}, {125, 51}, { 90, 64}, { 95, 7}, { 38, 154},
- {294, 0}, { 13, 225}, { 10, 225}, { 67, 168}, { 0, 167}, {161, 94} },
- { {172, 76}, {172, 75}, {136, 80}, { 64, 98}, { 74, 67}, {315, 0},
- {169, 76}, {207, 56}, {164, 66}, { 97, 80}, { 67, 72}, {328, 0},
- {136, 80}, {187, 53}, {154, 62}, { 72, 85}, { -2, 105}, {305, 0},
- { 74, 91}, {128, 64}, {113, 64}, { 61, 77}, { 41, 75}, {259, 0},
- { 46, 84}, { 51, 81}, { 28, 89}, { 31, 78}, { 23, 77}, {202, 0},
- {323, 0}, {323, 0}, {300, 0}, {236, 0}, {195, 0}, {328, 0} },
-};
-
-static const int16_t vp5_ract_lc[3][3][5][6][2] = {
- { { { {276, 0}, {238, 0}, {195, 0}, {156, 0}, {113, 0}, {274, 0} },
- { { 0, 1}, { 0, 1}, { 0, 1}, { 0, 1}, { 0, 1}, { 0, 1} },
- { {192, 59}, {182, 50}, {141, 48}, {110, 40}, { 92, 19}, {125,128} },
- { {169, 87}, {169, 83}, {184, 62}, {220, 16}, {184, 0}, {264, 0} },
- { {212, 40}, {212, 36}, {169, 49}, {174, 27}, { 8,120}, {182, 71} } },
- { { {259, 10}, {197, 19}, {143, 22}, {123, 16}, {110, 8}, {133, 88} },
- { { 0, 1}, {256, 0}, { 0, 1}, { 0, 1}, { 0, 1}, { 0, 1} },
- { {207, 46}, {187, 50}, { 97, 83}, { 23,100}, { 41, 56}, { 56,188} },
- { {166, 90}, {146,108}, {161, 88}, {136, 95}, {174, 0}, {266, 0} },
- { {264, 7}, {243, 18}, {184, 43}, {-14,154}, { 20,112}, { 20,199} } },
- { { {230, 26}, {197, 22}, {159, 20}, {146, 12}, {136, 4}, { 54,162} },
- { { 0, 1}, { 0, 1}, { 0, 1}, { 0, 1}, { 0, 1}, { 0, 1} },
- { {192, 59}, {156, 72}, { 84,101}, { 49,101}, { 79, 47}, { 79,167} },
- { {138,115}, {136,116}, {166, 80}, {238, 0}, {195, 0}, {261, 0} },
- { {225, 33}, {205, 42}, {159, 61}, { 79, 96}, { 92, 66}, { 28,195} } },
- }, {
- { { {200, 37}, {197, 18}, {159, 13}, {143, 7}, {102, 5}, {123,126} },
- { {197, 3}, {220, -9}, {210,-12}, {187, -6}, {151, -2}, {174, 80} },
- { {200, 53}, {187, 47}, {159, 40}, {118, 38}, {100, 18}, {141,111} },
- { {179, 78}, {166, 86}, {197, 50}, {207, 27}, {187, 0}, {115,139} },
- { {218, 34}, {220, 29}, {174, 46}, {128, 61}, { 54, 89}, {187, 65} } },
- { { {238, 14}, {197, 18}, {125, 26}, { 90, 25}, { 82, 13}, {161, 86} },
- { {189, 1}, {205, -2}, {156, -4}, {143, -4}, {146, -4}, {172, 72} },
- { {230, 31}, {192, 45}, {102, 76}, { 38, 85}, { 56, 41}, { 64,173} },
- { {166, 91}, {141,111}, {128,116}, {118,109}, {177, 0}, { 23,222} },
- { {253, 14}, {236, 21}, {174, 49}, { 33,118}, { 44, 93}, { 23,187} } },
- { { {218, 28}, {179, 28}, {118, 35}, { 95, 30}, { 72, 24}, {128,108} },
- { {187, 1}, {174, -1}, {125, -1}, {110, -1}, {108, -1}, {202, 52} },
- { {197, 53}, {146, 75}, { 46,118}, { 33,103}, { 64, 50}, {118,126} },
- { {138,114}, {128,122}, {161, 86}, {243, -6}, {195, 0}, { 38,210} },
- { {215, 39}, {179, 58}, { 97,101}, { 95, 85}, { 87, 70}, { 69,152} } },
- }, {
- { { {236, 24}, {205, 18}, {172, 12}, {154, 6}, {125, 1}, {169, 75} },
- { {187, 4}, {230, -2}, {228, -4}, {236, -4}, {241, -2}, {192, 66} },
- { {200, 46}, {187, 42}, {159, 34}, {136, 25}, {105, 10}, {179, 62} },
- { {207, 55}, {192, 63}, {192, 54}, {195, 36}, {177, 1}, {143, 98} },
- { {225, 27}, {207, 34}, {200, 30}, {131, 57}, { 97, 60}, {197, 45} } },
- { { {271, 8}, {218, 13}, {133, 19}, { 90, 19}, { 72, 7}, {182, 51} },
- { {179, 1}, {225, -1}, {154, -2}, {110, -1}, { 92, 0}, {195, 41} },
- { {241, 26}, {189, 40}, { 82, 64}, { 33, 60}, { 67, 17}, {120, 94} },
- { {192, 68}, {151, 94}, {146, 90}, {143, 72}, {161, 0}, {113,128} },
- { {256, 12}, {218, 29}, {166, 48}, { 44, 99}, { 31, 87}, {148, 78} } },
- { { {238, 20}, {184, 22}, {113, 27}, { 90, 22}, { 74, 9}, {192, 37} },
- { {184, 0}, {215, -1}, {141, -1}, { 97, 0}, { 49, 0}, {264, 13} },
- { {182, 51}, {138, 61}, { 95, 63}, { 54, 59}, { 64, 25}, {200, 45} },
- { {179, 75}, {156, 87}, {174, 65}, {177, 44}, {174, 0}, {164, 85} },
- { {195, 45}, {148, 65}, {105, 79}, { 95, 72}, { 87, 60}, {169, 63} } },
- }
-};
-
-static const uint8_t vp5_coord_div[] = { 2, 2, 2, 2, 4, 4 };
-
-#endif /* VP5DATA_H */
diff --git a/src/libffmpeg/libavcodec/vp6.c b/src/libffmpeg/libavcodec/vp6.c
deleted file mode 100644
index df4ebf87d..000000000
--- a/src/libffmpeg/libavcodec/vp6.c
+++ /dev/null
@@ -1,556 +0,0 @@
-/**
- * @file vp6.c
- * VP6 compatible video decoder
- *
- * Copyright (C) 2006 Aurelien Jacobs <aurel@gnuage.org>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- *
- * The VP6F decoder accept an optional 1 byte extradata. It is composed of:
- * - upper 4bits: difference between encoded width and visible width
- * - lower 4bits: difference between encoded height and visible height
- */
-
-#include <stdlib.h>
-
-#include "avcodec.h"
-#include "dsputil.h"
-#include "bitstream.h"
-#include "mpegvideo.h"
-
-#include "vp56.h"
-#include "vp56data.h"
-#include "vp6data.h"
-
-
-static int vp6_parse_header(vp56_context_t *s, uint8_t *buf, int buf_size,
- int *golden_frame)
-{
- vp56_range_coder_t *c = &s->c;
- int parse_filter_info = 0;
- int coeff_offset = 0;
- int vrt_shift = 0;
- int sub_version;
- int rows, cols;
- int res = 1;
- int separated_coeff = buf[0] & 1;
-
- s->frames[VP56_FRAME_CURRENT].key_frame = !(buf[0] & 0x80);
- vp56_init_dequant(s, (buf[0] >> 1) & 0x3F);
-
- if (s->frames[VP56_FRAME_CURRENT].key_frame) {
- sub_version = buf[1] >> 3;
- if (sub_version > 8)
- return 0;
- s->filter_header = buf[1] & 0x06;
- if (buf[1] & 1) {
- av_log(s->avctx, AV_LOG_ERROR, "interlacing not supported\n");
- return 0;
- }
- if (separated_coeff || !s->filter_header) {
- coeff_offset = AV_RB16(buf+2) - 2;
- buf += 2;
- buf_size -= 2;
- }
-
- rows = buf[2]; /* number of stored macroblock rows */
- cols = buf[3]; /* number of stored macroblock cols */
- /* buf[4] is number of displayed macroblock rows */
- /* buf[5] is number of displayed macroblock cols */
-
- if (16*cols != s->avctx->coded_width ||
- 16*rows != s->avctx->coded_height) {
- avcodec_set_dimensions(s->avctx, 16*cols, 16*rows);
- if (s->avctx->extradata_size == 1) {
- s->avctx->width -= s->avctx->extradata[0] >> 4;
- s->avctx->height -= s->avctx->extradata[0] & 0x0F;
- }
- res = 2;
- }
-
- vp56_init_range_decoder(c, buf+6, buf_size-6);
- vp56_rac_gets(c, 2);
-
- parse_filter_info = s->filter_header;
- if (sub_version < 8)
- vrt_shift = 5;
- s->sub_version = sub_version;
- } else {
- if (!s->sub_version)
- return 0;
-
- if (separated_coeff || !s->filter_header) {
- coeff_offset = AV_RB16(buf+1) - 2;
- buf += 2;
- buf_size -= 2;
- }
- vp56_init_range_decoder(c, buf+1, buf_size-1);
-
- *golden_frame = vp56_rac_get(c);
- if (s->filter_header) {
- s->deblock_filtering = vp56_rac_get(c);
- if (s->deblock_filtering)
- vp56_rac_get(c);
- if (s->sub_version > 7)
- parse_filter_info = vp56_rac_get(c);
- }
- }
-
- if (parse_filter_info) {
- if (vp56_rac_get(c)) {
- s->filter_mode = 2;
- s->sample_variance_threshold = vp56_rac_gets(c, 5) << vrt_shift;
- s->max_vector_length = 2 << vp56_rac_gets(c, 3);
- } else if (vp56_rac_get(c)) {
- s->filter_mode = 1;
- } else {
- s->filter_mode = 0;
- }
- if (s->sub_version > 7)
- s->filter_selection = vp56_rac_gets(c, 4);
- else
- s->filter_selection = 16;
- }
-
- vp56_rac_get(c);
-
- if (coeff_offset) {
- vp56_init_range_decoder(&s->cc, buf+coeff_offset,
- buf_size-coeff_offset);
- s->ccp = &s->cc;
- } else {
- s->ccp = &s->c;
- }
-
- return res;
-}
-
-static void vp6_coeff_order_table_init(vp56_context_t *s)
-{
- int i, pos, idx = 1;
-
- s->coeff_index_to_pos[0] = 0;
- for (i=0; i<16; i++)
- for (pos=1; pos<64; pos++)
- if (s->coeff_reorder[pos] == i)
- s->coeff_index_to_pos[idx++] = pos;
-}
-
-static void vp6_default_models_init(vp56_context_t *s)
-{
- s->vector_model_dct[0] = 0xA2;
- s->vector_model_dct[1] = 0xA4;
- s->vector_model_sig[0] = 0x80;
- s->vector_model_sig[1] = 0x80;
-
- memcpy(s->mb_types_stats, vp56_def_mb_types_stats, sizeof(s->mb_types_stats));
- memcpy(s->vector_model_fdv, vp6_def_fdv_vector_model, sizeof(s->vector_model_fdv));
- memcpy(s->vector_model_pdv, vp6_def_pdv_vector_model, sizeof(s->vector_model_pdv));
- memcpy(s->coeff_model_runv, vp6_def_runv_coeff_model, sizeof(s->coeff_model_runv));
- memcpy(s->coeff_reorder, vp6_def_coeff_reorder, sizeof(s->coeff_reorder));
-
- vp6_coeff_order_table_init(s);
-}
-
-static void vp6_parse_vector_models(vp56_context_t *s)
-{
- vp56_range_coder_t *c = &s->c;
- int comp, node;
-
- for (comp=0; comp<2; comp++) {
- if (vp56_rac_get_prob(c, vp6_sig_dct_pct[comp][0]))
- s->vector_model_dct[comp] = vp56_rac_gets_nn(c, 7);
- if (vp56_rac_get_prob(c, vp6_sig_dct_pct[comp][1]))
- s->vector_model_sig[comp] = vp56_rac_gets_nn(c, 7);
- }
-
- for (comp=0; comp<2; comp++)
- for (node=0; node<7; node++)
- if (vp56_rac_get_prob(c, vp6_pdv_pct[comp][node]))
- s->vector_model_pdv[comp][node] = vp56_rac_gets_nn(c, 7);
-
- for (comp=0; comp<2; comp++)
- for (node=0; node<8; node++)
- if (vp56_rac_get_prob(c, vp6_fdv_pct[comp][node]))
- s->vector_model_fdv[comp][node] = vp56_rac_gets_nn(c, 7);
-}
-
-static void vp6_parse_coeff_models(vp56_context_t *s)
-{
- vp56_range_coder_t *c = &s->c;
- int def_prob[11];
- int node, cg, ctx, pos;
- int ct; /* code type */
- int pt; /* plane type (0 for Y, 1 for U or V) */
-
- memset(def_prob, 0x80, sizeof(def_prob));
-
- for (pt=0; pt<2; pt++)
- for (node=0; node<11; node++)
- if (vp56_rac_get_prob(c, vp6_dccv_pct[pt][node])) {
- def_prob[node] = vp56_rac_gets_nn(c, 7);
- s->coeff_model_dccv[pt][node] = def_prob[node];
- } else if (s->frames[VP56_FRAME_CURRENT].key_frame) {
- s->coeff_model_dccv[pt][node] = def_prob[node];
- }
-
- if (vp56_rac_get(c)) {
- for (pos=1; pos<64; pos++)
- if (vp56_rac_get_prob(c, vp6_coeff_reorder_pct[pos]))
- s->coeff_reorder[pos] = vp56_rac_gets(c, 4);
- vp6_coeff_order_table_init(s);
- }
-
- for (cg=0; cg<2; cg++)
- for (node=0; node<14; node++)
- if (vp56_rac_get_prob(c, vp6_runv_pct[cg][node]))
- s->coeff_model_runv[cg][node] = vp56_rac_gets_nn(c, 7);
-
- for (ct=0; ct<3; ct++)
- for (pt=0; pt<2; pt++)
- for (cg=0; cg<6; cg++)
- for (node=0; node<11; node++)
- if (vp56_rac_get_prob(c, vp6_ract_pct[ct][pt][cg][node])) {
- def_prob[node] = vp56_rac_gets_nn(c, 7);
- s->coeff_model_ract[pt][ct][cg][node] = def_prob[node];
- } else if (s->frames[VP56_FRAME_CURRENT].key_frame) {
- s->coeff_model_ract[pt][ct][cg][node] = def_prob[node];
- }
-
- /* coeff_model_dcct is a linear combination of coeff_model_dccv */
- for (pt=0; pt<2; pt++)
- for (ctx=0; ctx<3; ctx++)
- for (node=0; node<5; node++)
- s->coeff_model_dcct[pt][ctx][node] = clip(((s->coeff_model_dccv[pt][node] * vp6_dccv_lc[ctx][node][0] + 128) >> 8) + vp6_dccv_lc[ctx][node][1], 1, 255);
-}
-
-static void vp6_parse_vector_adjustment(vp56_context_t *s, vp56_mv_t *vect)
-{
- vp56_range_coder_t *c = &s->c;
- int comp;
-
- *vect = (vp56_mv_t) {0,0};
- if (s->vector_candidate_pos < 2)
- *vect = s->vector_candidate[0];
-
- for (comp=0; comp<2; comp++) {
- int i, delta = 0;
-
- if (vp56_rac_get_prob(c, s->vector_model_dct[comp])) {
- static const uint8_t prob_order[] = {0, 1, 2, 7, 6, 5, 4};
- for (i=0; i<sizeof(prob_order); i++) {
- int j = prob_order[i];
- delta |= vp56_rac_get_prob(c, s->vector_model_fdv[comp][j])<<j;
- }
- if (delta & 0xF0)
- delta |= vp56_rac_get_prob(c, s->vector_model_fdv[comp][3])<<3;
- else
- delta |= 8;
- } else {
- delta = vp56_rac_get_tree(c, vp56_pva_tree,
- s->vector_model_pdv[comp]);
- }
-
- if (delta && vp56_rac_get_prob(c, s->vector_model_sig[comp]))
- delta = -delta;
-
- if (!comp)
- vect->x += delta;
- else
- vect->y += delta;
- }
-}
-
-static void vp6_parse_coeff(vp56_context_t *s)
-{
- vp56_range_coder_t *c = s->ccp;
- uint8_t *permute = s->scantable.permutated;
- uint8_t *model, *model2, *model3;
- int coeff, sign, coeff_idx;
- int b, i, cg, idx, ctx;
- int pt = 0; /* plane type (0 for Y, 1 for U or V) */
-
- for (b=0; b<6; b++) {
- int ct = 1; /* code type */
- int run = 1;
-
- if (b > 3) pt = 1;
-
- ctx = s->left_block[vp56_b6to4[b]].not_null_dc
- + s->above_blocks[s->above_block_idx[b]].not_null_dc;
- model = s->coeff_model_dccv[pt];
- model2 = s->coeff_model_dcct[pt][ctx];
-
- for (coeff_idx=0; coeff_idx<64; ) {
- if ((coeff_idx>1 && ct==0) || vp56_rac_get_prob(c, model2[0])) {
- /* parse a coeff */
- if (coeff_idx == 0) {
- s->left_block[vp56_b6to4[b]].not_null_dc = 1;
- s->above_blocks[s->above_block_idx[b]].not_null_dc = 1;
- }
-
- if (vp56_rac_get_prob(c, model2[2])) {
- if (vp56_rac_get_prob(c, model2[3])) {
- idx = vp56_rac_get_tree(c, vp56_pc_tree, model);
- coeff = vp56_coeff_bias[idx];
- for (i=vp56_coeff_bit_length[idx]; i>=0; i--)
- coeff += vp56_rac_get_prob(c, vp56_coeff_parse_table[idx][i]) << i;
- } else {
- if (vp56_rac_get_prob(c, model2[4]))
- coeff = 3 + vp56_rac_get_prob(c, model[5]);
- else
- coeff = 2;
- }
- ct = 2;
- } else {
- ct = 1;
- coeff = 1;
- }
- sign = vp56_rac_get(c);
- coeff = (coeff ^ -sign) + sign;
- if (coeff_idx)
- coeff *= s->dequant_ac;
- idx = s->coeff_index_to_pos[coeff_idx];
- s->block_coeff[b][permute[idx]] = coeff;
- run = 1;
- } else {
- /* parse a run */
- ct = 0;
- if (coeff_idx == 0) {
- s->left_block[vp56_b6to4[b]].not_null_dc = 0;
- s->above_blocks[s->above_block_idx[b]].not_null_dc = 0;
- } else {
- if (!vp56_rac_get_prob(c, model2[1]))
- break;
-
- model3 = s->coeff_model_runv[coeff_idx >= 6];
- run = vp56_rac_get_tree(c, vp6_pcr_tree, model3);
- if (!run)
- for (run=9, i=0; i<6; i++)
- run += vp56_rac_get_prob(c, model3[i+8]) << i;
- }
- }
-
- cg = vp6_coeff_groups[coeff_idx+=run];
- model = model2 = s->coeff_model_ract[pt][ct][cg];
- }
- }
-}
-
-static int vp6_adjust(int v, int t)
-{
- int V = v, s = v >> 31;
- V ^= s;
- V -= s;
- if (V-t-1 >= (unsigned)(t-1))
- return v;
- V = 2*t - V;
- V += s;
- V ^= s;
- return V;
-}
-
-static int vp6_block_variance(uint8_t *src, int stride)
-{
- int sum = 0, square_sum = 0;
- int y, x;
-
- for (y=0; y<8; y+=2) {
- for (x=0; x<8; x+=2) {
- sum += src[x];
- square_sum += src[x]*src[x];
- }
- src += 2*stride;
- }
- return (16*square_sum - sum*sum) >> 8;
-}
-
-static void vp6_filter_hv2(vp56_context_t *s, uint8_t *dst, uint8_t *src,
- int stride, int delta, int16_t weight)
-{
- s->dsp.put_pixels_tab[1][0](dst, src, stride, 8);
- s->dsp.biweight_h264_pixels_tab[3](dst, src+delta, stride, 2,
- 8-weight, weight, 0);
-}
-
-static void vp6_filter_hv4(uint8_t *dst, uint8_t *src, int stride,
- int delta, const int16_t *weights)
-{
- int x, y;
-
- for (y=0; y<8; y++) {
- for (x=0; x<8; x++) {
- dst[x] = clip_uint8(( src[x-delta ] * weights[0]
- + src[x ] * weights[1]
- + src[x+delta ] * weights[2]
- + src[x+2*delta] * weights[3] + 64) >> 7);
- }
- src += stride;
- dst += stride;
- }
-}
-
-static void vp6_filter_diag2(vp56_context_t *s, uint8_t *dst, uint8_t *src,
- int stride, int h_weight, int v_weight)
-{
- uint8_t *tmp = s->edge_emu_buffer+16;
- int x, xmax;
-
- s->dsp.put_pixels_tab[1][0](tmp, src, stride, 8);
- s->dsp.biweight_h264_pixels_tab[3](tmp, src+1, stride, 2,
- 8-h_weight, h_weight, 0);
- /* we need a 8x9 block to do vertical filter, so compute one more line */
- for (x=8*stride, xmax=x+8; x<xmax; x++)
- tmp[x] = (src[x]*(8-h_weight) + src[x+1]*h_weight + 4) >> 3;
-
- s->dsp.put_pixels_tab[1][0](dst, tmp, stride, 8);
- s->dsp.biweight_h264_pixels_tab[3](dst, tmp+stride, stride, 2,
- 8-v_weight, v_weight, 0);
-}
-
-static void vp6_filter_diag4(uint8_t *dst, uint8_t *src, int stride,
- const int16_t *h_weights,const int16_t *v_weights)
-{
- int x, y;
- int tmp[8*11];
- int *t = tmp;
-
- src -= stride;
-
- for (y=0; y<11; y++) {
- for (x=0; x<8; x++) {
- t[x] = clip_uint8(( src[x-1] * h_weights[0]
- + src[x ] * h_weights[1]
- + src[x+1] * h_weights[2]
- + src[x+2] * h_weights[3] + 64) >> 7);
- }
- src += stride;
- t += 8;
- }
-
- t = tmp + 8;
- for (y=0; y<8; y++) {
- for (x=0; x<8; x++) {
- dst[x] = clip_uint8(( t[x-8 ] * v_weights[0]
- + t[x ] * v_weights[1]
- + t[x+8 ] * v_weights[2]
- + t[x+16] * v_weights[3] + 64) >> 7);
- }
- dst += stride;
- t += 8;
- }
-}
-
-static void vp6_filter(vp56_context_t *s, uint8_t *dst, uint8_t *src,
- int offset1, int offset2, int stride,
- vp56_mv_t mv, int mask, int select, int luma)
-{
- int filter4 = 0;
- int x8 = mv.x & mask;
- int y8 = mv.y & mask;
-
- if (luma) {
- x8 *= 2;
- y8 *= 2;
- filter4 = s->filter_mode;
- if (filter4 == 2) {
- if (s->max_vector_length &&
- (FFABS(mv.x) > s->max_vector_length ||
- FFABS(mv.y) > s->max_vector_length)) {
- filter4 = 0;
- } else if (s->sample_variance_threshold
- && (vp6_block_variance(src+offset1, stride)
- < s->sample_variance_threshold)) {
- filter4 = 0;
- }
- }
- }
-
- if ((y8 && (offset2-offset1)*s->flip<0) || (!y8 && offset1 > offset2)) {
- offset1 = offset2;
- }
-
- if (filter4) {
- if (!y8) { /* left or right combine */
- vp6_filter_hv4(dst, src+offset1, stride, 1,
- vp6_block_copy_filter[select][x8]);
- } else if (!x8) { /* above or below combine */
- vp6_filter_hv4(dst, src+offset1, stride, stride,
- vp6_block_copy_filter[select][y8]);
- } else if ((mv.x^mv.y) >> 31) { /* lower-left or upper-right combine */
- vp6_filter_diag4(dst, src+offset1-1, stride,
- vp6_block_copy_filter[select][x8],
- vp6_block_copy_filter[select][y8]);
- } else { /* lower-right or upper-left combine */
- vp6_filter_diag4(dst, src+offset1, stride,
- vp6_block_copy_filter[select][x8],
- vp6_block_copy_filter[select][y8]);
- }
- } else {
- if (!y8) { /* left or right combine */
- vp6_filter_hv2(s, dst, src+offset1, stride, 1, x8);
- } else if (!x8) { /* above or below combine */
- vp6_filter_hv2(s, dst, src+offset1, stride, stride, y8);
- } else if ((mv.x^mv.y) >> 31) { /* lower-left or upper-right combine */
- vp6_filter_diag2(s, dst, src+offset1-1, stride, x8, y8);
- } else { /* lower-right or upper-left combine */
- vp6_filter_diag2(s, dst, src+offset1, stride, x8, y8);
- }
- }
-}
-
-static int vp6_decode_init(AVCodecContext *avctx)
-{
- vp56_context_t *s = avctx->priv_data;
-
- vp56_init(s, avctx, avctx->codec->id == CODEC_ID_VP6);
- s->vp56_coord_div = vp6_coord_div;
- s->parse_vector_adjustment = vp6_parse_vector_adjustment;
- s->adjust = vp6_adjust;
- s->filter = vp6_filter;
- s->parse_coeff = vp6_parse_coeff;
- s->default_models_init = vp6_default_models_init;
- s->parse_vector_models = vp6_parse_vector_models;
- s->parse_coeff_models = vp6_parse_coeff_models;
- s->parse_header = vp6_parse_header;
-
- return 0;
-}
-
-AVCodec vp6_decoder = {
- "vp6",
- CODEC_TYPE_VIDEO,
- CODEC_ID_VP6,
- sizeof(vp56_context_t),
- vp6_decode_init,
- NULL,
- vp56_free,
- vp56_decode_frame,
-};
-
-/* flash version, not flipped upside-down */
-AVCodec vp6f_decoder = {
- "vp6f",
- CODEC_TYPE_VIDEO,
- CODEC_ID_VP6F,
- sizeof(vp56_context_t),
- vp6_decode_init,
- NULL,
- vp56_free,
- vp56_decode_frame,
-};
diff --git a/src/libffmpeg/libavcodec/vp6data.h b/src/libffmpeg/libavcodec/vp6data.h
deleted file mode 100644
index 0545a9d66..000000000
--- a/src/libffmpeg/libavcodec/vp6data.h
+++ /dev/null
@@ -1,300 +0,0 @@
-/**
- * @file vp6data.h
- * VP6 compatible video decoder
- *
- * Copyright (C) 2006 Aurelien Jacobs <aurel@gnuage.org>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef VP6DATA_H
-#define VP6DATA_H
-
-#include "vp56data.h"
-
-static const uint8_t vp6_def_fdv_vector_model[2][8] = {
- { 247, 210, 135, 68, 138, 220, 239, 246 },
- { 244, 184, 201, 44, 173, 221, 239, 253 },
-};
-
-static const uint8_t vp6_def_pdv_vector_model[2][7] = {
- { 225, 146, 172, 147, 214, 39, 156 },
- { 204, 170, 119, 235, 140, 230, 228 },
-};
-
-static const uint8_t vp6_def_coeff_reorder[] = {
- 0, 0, 1, 1, 1, 2, 2, 2,
- 2, 2, 2, 3, 3, 4, 4, 4,
- 5, 5, 5, 5, 6, 6, 7, 7,
- 7, 7, 7, 8, 8, 9, 9, 9,
- 9, 9, 9, 10, 10, 11, 11, 11,
- 11, 11, 11, 12, 12, 12, 12, 12,
- 12, 13, 13, 13, 13, 13, 14, 14,
- 14, 14, 15, 15, 15, 15, 15, 15,
-};
-
-static const uint8_t vp6_def_runv_coeff_model[2][14] = {
- { 198, 197, 196, 146, 198, 204, 169, 142, 130, 136, 149, 149, 191, 249 },
- { 135, 201, 181, 154, 98, 117, 132, 126, 146, 169, 184, 240, 246, 254 },
-};
-
-static const uint8_t vp6_sig_dct_pct[2][2] = {
- { 237, 246 },
- { 231, 243 },
-};
-
-static const uint8_t vp6_pdv_pct[2][7] = {
- { 253, 253, 254, 254, 254, 254, 254 },
- { 245, 253, 254, 254, 254, 254, 254 },
-};
-
-static const uint8_t vp6_fdv_pct[2][8] = {
- { 254, 254, 254, 254, 254, 250, 250, 252 },
- { 254, 254, 254, 254, 254, 251, 251, 254 },
-};
-
-static const uint8_t vp6_dccv_pct[2][11] = {
- { 146, 255, 181, 207, 232, 243, 238, 251, 244, 250, 249 },
- { 179, 255, 214, 240, 250, 255, 244, 255, 255, 255, 255 },
-};
-
-static const uint8_t vp6_coeff_reorder_pct[] = {
- 255, 132, 132, 159, 153, 151, 161, 170,
- 164, 162, 136, 110, 103, 114, 129, 118,
- 124, 125, 132, 136, 114, 110, 142, 135,
- 134, 123, 143, 126, 153, 183, 166, 161,
- 171, 180, 179, 164, 203, 218, 225, 217,
- 215, 206, 203, 217, 229, 241, 248, 243,
- 253, 255, 253, 255, 255, 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255,
-};
-
-static const uint8_t vp6_runv_pct[2][14] = {
- { 219, 246, 238, 249, 232, 239, 249, 255, 248, 253, 239, 244, 241, 248 },
- { 198, 232, 251, 253, 219, 241, 253, 255, 248, 249, 244, 238, 251, 255 },
-};
-
-static const uint8_t vp6_ract_pct[3][2][6][11] = {
- { { { 227, 246, 230, 247, 244, 255, 255, 255, 255, 255, 255 },
- { 255, 255, 209, 231, 231, 249, 249, 253, 255, 255, 255 },
- { 255, 255, 225, 242, 241, 251, 253, 255, 255, 255, 255 },
- { 255, 255, 241, 253, 252, 255, 255, 255, 255, 255, 255 },
- { 255, 255, 248, 255, 255, 255, 255, 255, 255, 255, 255 },
- { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } },
- { { 240, 255, 248, 255, 255, 255, 255, 255, 255, 255, 255 },
- { 255, 255, 240, 253, 255, 255, 255, 255, 255, 255, 255 },
- { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
- { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
- { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
- { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } } },
- { { { 206, 203, 227, 239, 247, 255, 253, 255, 255, 255, 255 },
- { 207, 199, 220, 236, 243, 252, 252, 255, 255, 255, 255 },
- { 212, 219, 230, 243, 244, 253, 252, 255, 255, 255, 255 },
- { 236, 237, 247, 252, 253, 255, 255, 255, 255, 255, 255 },
- { 240, 240, 248, 255, 255, 255, 255, 255, 255, 255, 255 },
- { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } },
- { { 230, 233, 249, 255, 255, 255, 255, 255, 255, 255, 255 },
- { 238, 238, 250, 255, 255, 255, 255, 255, 255, 255, 255 },
- { 248, 251, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
- { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
- { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
- { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } } },
- { { { 225, 239, 227, 231, 244, 253, 243, 255, 255, 253, 255 },
- { 232, 234, 224, 228, 242, 249, 242, 252, 251, 251, 255 },
- { 235, 249, 238, 240, 251, 255, 249, 255, 253, 253, 255 },
- { 249, 253, 251, 250, 255, 255, 255, 255, 255, 255, 255 },
- { 251, 250, 249, 255, 255, 255, 255, 255, 255, 255, 255 },
- { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } },
- { { 243, 244, 250, 250, 255, 255, 255, 255, 255, 255, 255 },
- { 249, 248, 250, 253, 255, 255, 255, 255, 255, 255, 255 },
- { 253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
- { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
- { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
- { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } } }
-};
-
-static const int vp6_dccv_lc[3][5][2] = {
- { { 122, 133 }, { 0, 1 }, { 78, 171 }, { 139, 117 }, { 168, 79 } },
- { { 133, 51 }, { 0, 1 }, { 169, 71 }, { 214, 44 }, { 210, 38 } },
- { { 142, -16 }, { 0, 1 }, { 221, -30 }, { 246, -3 }, { 203, 17 } },
-};
-
-static const uint8_t vp6_coeff_groups[] = {
- 0, 0, 1, 1, 1, 2, 2, 2,
- 2, 2, 2, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5,
-};
-
-static const int16_t vp6_block_copy_filter[17][8][4] = {
- { { 0, 128, 0, 0 }, /* 0 */
- { -3, 122, 9, 0 },
- { -4, 109, 24, -1 },
- { -5, 91, 45, -3 },
- { -4, 68, 68, -4 },
- { -3, 45, 91, -5 },
- { -1, 24, 109, -4 },
- { 0, 9, 122, -3 } },
- { { 0, 128, 0, 0 }, /* 1 */
- { -4, 124, 9, -1 },
- { -5, 110, 25, -2 },
- { -6, 91, 46, -3 },
- { -5, 69, 69, -5 },
- { -3, 46, 91, -6 },
- { -2, 25, 110, -5 },
- { -1, 9, 124, -4 } },
- { { 0, 128, 0, 0 }, /* 2 */
- { -4, 123, 10, -1 },
- { -6, 110, 26, -2 },
- { -7, 92, 47, -4 },
- { -6, 70, 70, -6 },
- { -4, 47, 92, -7 },
- { -2, 26, 110, -6 },
- { -1, 10, 123, -4 } },
- { { 0, 128, 0, 0 }, /* 3 */
- { -5, 124, 10, -1 },
- { -7, 110, 27, -2 },
- { -7, 91, 48, -4 },
- { -6, 70, 70, -6 },
- { -4, 48, 92, -8 },
- { -2, 27, 110, -7 },
- { -1, 10, 124, -5 } },
- { { 0, 128, 0, 0 }, /* 4 */
- { -6, 124, 11, -1 },
- { -8, 111, 28, -3 },
- { -8, 92, 49, -5 },
- { -7, 71, 71, -7 },
- { -5, 49, 92, -8 },
- { -3, 28, 111, -8 },
- { -1, 11, 124, -6 } },
- { { 0, 128, 0, 0 }, /* 5 */
- { -6, 123, 12, -1 },
- { -9, 111, 29, -3 },
- { -9, 93, 50, -6 },
- { -8, 72, 72, -8 },
- { -6, 50, 93, -9 },
- { -3, 29, 111, -9 },
- { -1, 12, 123, -6 } },
- { { 0, 128, 0, 0 }, /* 6 */
- { -7, 124, 12, -1 },
- { -10, 111, 30, -3 },
- { -10, 93, 51, -6 },
- { -9, 73, 73, -9 },
- { -6, 51, 93, -10 },
- { -3, 30, 111, -10 },
- { -1, 12, 124, -7 } },
- { { 0, 128, 0, 0 }, /* 7 */
- { -7, 123, 13, -1 },
- { -11, 112, 31, -4 },
- { -11, 94, 52, -7 },
- { -10, 74, 74, -10 },
- { -7, 52, 94, -11 },
- { -4, 31, 112, -11 },
- { -1, 13, 123, -7 } },
- { { 0, 128, 0, 0 }, /* 8 */
- { -8, 124, 13, -1 },
- { -12, 112, 32, -4 },
- { -12, 94, 53, -7 },
- { -10, 74, 74, -10 },
- { -7, 53, 94, -12 },
- { -4, 32, 112, -12 },
- { -1, 13, 124, -8 } },
- { { 0, 128, 0, 0 }, /* 9 */
- { -9, 124, 14, -1 },
- { -13, 112, 33, -4 },
- { -13, 95, 54, -8 },
- { -11, 75, 75, -11 },
- { -8, 54, 95, -13 },
- { -4, 33, 112, -13 },
- { -1, 14, 124, -9 } },
- { { 0, 128, 0, 0 }, /* 10 */
- { -9, 123, 15, -1 },
- { -14, 113, 34, -5 },
- { -14, 95, 55, -8 },
- { -12, 76, 76, -12 },
- { -8, 55, 95, -14 },
- { -5, 34, 112, -13 },
- { -1, 15, 123, -9 } },
- { { 0, 128, 0, 0 }, /* 11 */
- { -10, 124, 15, -1 },
- { -14, 113, 34, -5 },
- { -15, 96, 56, -9 },
- { -13, 77, 77, -13 },
- { -9, 56, 96, -15 },
- { -5, 34, 113, -14 },
- { -1, 15, 124, -10 } },
- { { 0, 128, 0, 0 }, /* 12 */
- { -10, 123, 16, -1 },
- { -15, 113, 35, -5 },
- { -16, 98, 56, -10 },
- { -14, 78, 78, -14 },
- { -10, 56, 98, -16 },
- { -5, 35, 113, -15 },
- { -1, 16, 123, -10 } },
- { { 0, 128, 0, 0 }, /* 13 */
- { -11, 124, 17, -2 },
- { -16, 113, 36, -5 },
- { -17, 98, 57, -10 },
- { -14, 78, 78, -14 },
- { -10, 57, 98, -17 },
- { -5, 36, 113, -16 },
- { -2, 17, 124, -11 } },
- { { 0, 128, 0, 0 }, /* 14 */
- { -12, 125, 17, -2 },
- { -17, 114, 37, -6 },
- { -18, 99, 58, -11 },
- { -15, 79, 79, -15 },
- { -11, 58, 99, -18 },
- { -6, 37, 114, -17 },
- { -2, 17, 125, -12 } },
- { { 0, 128, 0, 0 }, /* 15 */
- { -12, 124, 18, -2 },
- { -18, 114, 38, -6 },
- { -19, 99, 59, -11 },
- { -16, 80, 80, -16 },
- { -11, 59, 99, -19 },
- { -6, 38, 114, -18 },
- { -2, 18, 124, -12 } },
- { { 0, 128, 0, 0 }, /* 16 */
- { -4, 118, 16, -2 },
- { -7, 106, 34, -5 },
- { -8, 90, 53, -7 },
- { -8, 72, 72, -8 },
- { -7, 53, 90, -8 },
- { -5, 34, 106, -7 },
- { -2, 16, 118, -4 } },
-};
-
-static const vp56_tree_t vp6_pcr_tree[] = {
- { 8, 0},
- { 4, 1},
- { 2, 2}, {-1}, {-2},
- { 2, 3}, {-3}, {-4},
- { 8, 4},
- { 4, 5},
- { 2, 6}, {-5}, {-6},
- { 2, 7}, {-7}, {-8},
- {-0},
-};
-
-static const uint8_t vp6_coord_div[] = { 4, 4, 4, 4, 8, 8 };
-
-#endif /* VP6DATA_H */
diff --git a/src/libffmpeg/libavcodec/vqavideo.c b/src/libffmpeg/libavcodec/vqavideo.c
deleted file mode 100644
index 57fe6cf44..000000000
--- a/src/libffmpeg/libavcodec/vqavideo.c
+++ /dev/null
@@ -1,625 +0,0 @@
-/*
- * Westwood Studios VQA Video Decoder
- * Copyright (C) 2003 the ffmpeg project
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file vqavideo.c
- * VQA Video Decoder by Mike Melanson (melanson@pcisys.net)
- * For more information about the VQA format, visit:
- * http://wiki.multimedia.cx/index.php?title=VQA
- *
- * The VQA video decoder outputs PAL8 or RGB555 colorspace data, depending
- * on the type of data in the file.
- *
- * This decoder needs the 42-byte VQHD header from the beginning
- * of the VQA file passed through the extradata field. The VQHD header
- * is laid out as:
- *
- * bytes 0-3 chunk fourcc: 'VQHD'
- * bytes 4-7 chunk size in big-endian format, should be 0x0000002A
- * bytes 8-49 VQHD chunk data
- *
- * Bytes 8-49 are what this decoder expects to see.
- *
- * Briefly, VQA is a vector quantized animation format that operates in a
- * VGA palettized colorspace. It operates on pixel vectors (blocks)
- * of either 4x2 or 4x4 in size. Compressed VQA chunks can contain vector
- * codebooks, palette information, and code maps for rendering vectors onto
- * frames. Any of these components can also be compressed with a run-length
- * encoding (RLE) algorithm commonly referred to as "format80".
- *
- * VQA takes a novel approach to rate control. Each group of n frames
- * (usually, n = 8) relies on a different vector codebook. Rather than
- * transporting an entire codebook every 8th frame, the new codebook is
- * broken up into 8 pieces and sent along with the compressed video chunks
- * for each of the 8 frames preceding the 8 frames which require the
- * codebook. A full codebook is also sent on the very first frame of a
- * file. This is an interesting technique, although it makes random file
- * seeking difficult despite the fact that the frames are all intracoded.
- *
- * V1,2 VQA uses 12-bit codebook indices. If the 12-bit indices were
- * packed into bytes and then RLE compressed, bytewise, the results would
- * be poor. That is why the coding method divides each index into 2 parts,
- * the top 4 bits and the bottom 8 bits, then RL encodes the 4-bit pieces
- * together and the 8-bit pieces together. If most of the vectors are
- * clustered into one group of 256 vectors, most of the 4-bit index pieces
- * should be the same.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "common.h"
-#include "avcodec.h"
-#include "dsputil.h"
-
-#define PALETTE_COUNT 256
-#define VQA_HEADER_SIZE 0x2A
-#define CHUNK_PREAMBLE_SIZE 8
-
-/* allocate the maximum vector space, regardless of the file version:
- * (0xFF00 codebook vectors + 0x100 solid pixel vectors) * (4x4 pixels/block) */
-#define MAX_CODEBOOK_VECTORS 0xFF00
-#define SOLID_PIXEL_VECTORS 0x100
-#define MAX_VECTORS (MAX_CODEBOOK_VECTORS + SOLID_PIXEL_VECTORS)
-#define MAX_CODEBOOK_SIZE (MAX_VECTORS * 4 * 4)
-
-#define CBF0_TAG MKBETAG('C', 'B', 'F', '0')
-#define CBFZ_TAG MKBETAG('C', 'B', 'F', 'Z')
-#define CBP0_TAG MKBETAG('C', 'B', 'P', '0')
-#define CBPZ_TAG MKBETAG('C', 'B', 'P', 'Z')
-#define CPL0_TAG MKBETAG('C', 'P', 'L', '0')
-#define CPLZ_TAG MKBETAG('C', 'P', 'L', 'Z')
-#define VPTZ_TAG MKBETAG('V', 'P', 'T', 'Z')
-
-#define VQA_DEBUG 0
-
-#if VQA_DEBUG
-#define vqa_debug printf
-#else
-static inline void vqa_debug(const char *format, ...) { }
-#endif
-
-typedef struct VqaContext {
-
- AVCodecContext *avctx;
- DSPContext dsp;
- AVFrame frame;
-
- unsigned char *buf;
- int size;
-
- uint32_t palette[PALETTE_COUNT];
-
- int width; /* width of a frame */
- int height; /* height of a frame */
- int vector_width; /* width of individual vector */
- int vector_height; /* height of individual vector */
- int vqa_version; /* this should be either 1, 2 or 3 */
-
- unsigned char *codebook; /* the current codebook */
- int codebook_size;
- unsigned char *next_codebook_buffer; /* accumulator for next codebook */
- int next_codebook_buffer_index;
-
- unsigned char *decode_buffer;
- int decode_buffer_size;
-
- /* number of frames to go before replacing codebook */
- int partial_countdown;
- int partial_count;
-
-} VqaContext;
-
-static int vqa_decode_init(AVCodecContext *avctx)
-{
- VqaContext *s = (VqaContext *)avctx->priv_data;
- unsigned char *vqa_header;
- int i, j, codebook_index;;
-
- s->avctx = avctx;
- avctx->pix_fmt = PIX_FMT_PAL8;
- avctx->has_b_frames = 0;
- dsputil_init(&s->dsp, avctx);
-
- /* make sure the extradata made it */
- if (s->avctx->extradata_size != VQA_HEADER_SIZE) {
- av_log(s->avctx, AV_LOG_ERROR, " VQA video: expected extradata size of %d\n", VQA_HEADER_SIZE);
- return -1;
- }
-
- /* load up the VQA parameters from the header */
- vqa_header = (unsigned char *)s->avctx->extradata;
- s->vqa_version = vqa_header[0];
- s->width = AV_RL16(&vqa_header[6]);
- s->height = AV_RL16(&vqa_header[8]);
- if(avcodec_check_dimensions(avctx, s->width, s->height)){
- s->width= s->height= 0;
- return -1;
- }
- s->vector_width = vqa_header[10];
- s->vector_height = vqa_header[11];
- s->partial_count = s->partial_countdown = vqa_header[13];
-
- /* the vector dimensions have to meet very stringent requirements */
- if ((s->vector_width != 4) ||
- ((s->vector_height != 2) && (s->vector_height != 4))) {
- /* return without further initialization */
- return -1;
- }
-
- /* allocate codebooks */
- s->codebook_size = MAX_CODEBOOK_SIZE;
- s->codebook = av_malloc(s->codebook_size);
- s->next_codebook_buffer = av_malloc(s->codebook_size);
-
- /* initialize the solid-color vectors */
- if (s->vector_height == 4) {
- codebook_index = 0xFF00 * 16;
- for (i = 0; i < 256; i++)
- for (j = 0; j < 16; j++)
- s->codebook[codebook_index++] = i;
- } else {
- codebook_index = 0xF00 * 8;
- for (i = 0; i < 256; i++)
- for (j = 0; j < 8; j++)
- s->codebook[codebook_index++] = i;
- }
- s->next_codebook_buffer_index = 0;
-
- /* allocate decode buffer */
- s->decode_buffer_size = (s->width / s->vector_width) *
- (s->height / s->vector_height) * 2;
- s->decode_buffer = av_malloc(s->decode_buffer_size);
-
- s->frame.data[0] = NULL;
-
- return 0;
-}
-
-#define CHECK_COUNT() \
- if (dest_index + count > dest_size) { \
- av_log(NULL, AV_LOG_ERROR, " VQA video: decode_format80 problem: next op would overflow dest_index\n"); \
- av_log(NULL, AV_LOG_ERROR, " VQA video: current dest_index = %d, count = %d, dest_size = %d\n", \
- dest_index, count, dest_size); \
- return; \
- }
-
-static void decode_format80(unsigned char *src, int src_size,
- unsigned char *dest, int dest_size, int check_size) {
-
- int src_index = 0;
- int dest_index = 0;
- int count;
- int src_pos;
- unsigned char color;
- int i;
-
- while (src_index < src_size) {
-
- vqa_debug(" opcode %02X: ", src[src_index]);
-
- /* 0x80 means that frame is finished */
- if (src[src_index] == 0x80)
- return;
-
- if (dest_index >= dest_size) {
- av_log(NULL, AV_LOG_ERROR, " VQA video: decode_format80 problem: dest_index (%d) exceeded dest_size (%d)\n",
- dest_index, dest_size);
- return;
- }
-
- if (src[src_index] == 0xFF) {
-
- src_index++;
- count = AV_RL16(&src[src_index]);
- src_index += 2;
- src_pos = AV_RL16(&src[src_index]);
- src_index += 2;
- vqa_debug("(1) copy %X bytes from absolute pos %X\n", count, src_pos);
- CHECK_COUNT();
- for (i = 0; i < count; i++)
- dest[dest_index + i] = dest[src_pos + i];
- dest_index += count;
-
- } else if (src[src_index] == 0xFE) {
-
- src_index++;
- count = AV_RL16(&src[src_index]);
- src_index += 2;
- color = src[src_index++];
- vqa_debug("(2) set %X bytes to %02X\n", count, color);
- CHECK_COUNT();
- memset(&dest[dest_index], color, count);
- dest_index += count;
-
- } else if ((src[src_index] & 0xC0) == 0xC0) {
-
- count = (src[src_index++] & 0x3F) + 3;
- src_pos = AV_RL16(&src[src_index]);
- src_index += 2;
- vqa_debug("(3) copy %X bytes from absolute pos %X\n", count, src_pos);
- CHECK_COUNT();
- for (i = 0; i < count; i++)
- dest[dest_index + i] = dest[src_pos + i];
- dest_index += count;
-
- } else if (src[src_index] > 0x80) {
-
- count = src[src_index++] & 0x3F;
- vqa_debug("(4) copy %X bytes from source to dest\n", count);
- CHECK_COUNT();
- memcpy(&dest[dest_index], &src[src_index], count);
- src_index += count;
- dest_index += count;
-
- } else {
-
- count = ((src[src_index] & 0x70) >> 4) + 3;
- src_pos = AV_RB16(&src[src_index]) & 0x0FFF;
- src_index += 2;
- vqa_debug("(5) copy %X bytes from relpos %X\n", count, src_pos);
- CHECK_COUNT();
- for (i = 0; i < count; i++)
- dest[dest_index + i] = dest[dest_index - src_pos + i];
- dest_index += count;
- }
- }
-
- /* validate that the entire destination buffer was filled; this is
- * important for decoding frame maps since each vector needs to have a
- * codebook entry; it is not important for compressed codebooks because
- * not every entry needs to be filled */
- if (check_size)
- if (dest_index < dest_size)
- av_log(NULL, AV_LOG_ERROR, " VQA video: decode_format80 problem: decode finished with dest_index (%d) < dest_size (%d)\n",
- dest_index, dest_size);
-}
-
-static void vqa_decode_chunk(VqaContext *s)
-{
- unsigned int chunk_type;
- unsigned int chunk_size;
- int byte_skip;
- unsigned int index = 0;
- int i;
- unsigned char r, g, b;
- int index_shift;
-
- int cbf0_chunk = -1;
- int cbfz_chunk = -1;
- int cbp0_chunk = -1;
- int cbpz_chunk = -1;
- int cpl0_chunk = -1;
- int cplz_chunk = -1;
- int vptz_chunk = -1;
-
- int x, y;
- int lines = 0;
- int pixel_ptr;
- int vector_index = 0;
- int lobyte = 0;
- int hibyte = 0;
- int lobytes = 0;
- int hibytes = s->decode_buffer_size / 2;
-
- /* first, traverse through the frame and find the subchunks */
- while (index < s->size) {
-
- chunk_type = AV_RB32(&s->buf[index]);
- chunk_size = AV_RB32(&s->buf[index + 4]);
-
- switch (chunk_type) {
-
- case CBF0_TAG:
- cbf0_chunk = index;
- break;
-
- case CBFZ_TAG:
- cbfz_chunk = index;
- break;
-
- case CBP0_TAG:
- cbp0_chunk = index;
- break;
-
- case CBPZ_TAG:
- cbpz_chunk = index;
- break;
-
- case CPL0_TAG:
- cpl0_chunk = index;
- break;
-
- case CPLZ_TAG:
- cplz_chunk = index;
- break;
-
- case VPTZ_TAG:
- vptz_chunk = index;
- break;
-
- default:
- av_log(s->avctx, AV_LOG_ERROR, " VQA video: Found unknown chunk type: %c%c%c%c (%08X)\n",
- (chunk_type >> 24) & 0xFF,
- (chunk_type >> 16) & 0xFF,
- (chunk_type >> 8) & 0xFF,
- (chunk_type >> 0) & 0xFF,
- chunk_type);
- break;
- }
-
- byte_skip = chunk_size & 0x01;
- index += (CHUNK_PREAMBLE_SIZE + chunk_size + byte_skip);
- }
-
- /* next, deal with the palette */
- if ((cpl0_chunk != -1) && (cplz_chunk != -1)) {
-
- /* a chunk should not have both chunk types */
- av_log(s->avctx, AV_LOG_ERROR, " VQA video: problem: found both CPL0 and CPLZ chunks\n");
- return;
- }
-
- /* decompress the palette chunk */
- if (cplz_chunk != -1) {
-
-/* yet to be handled */
-
- }
-
- /* convert the RGB palette into the machine's endian format */
- if (cpl0_chunk != -1) {
-
- chunk_size = AV_RB32(&s->buf[cpl0_chunk + 4]);
- /* sanity check the palette size */
- if (chunk_size / 3 > 256) {
- av_log(s->avctx, AV_LOG_ERROR, " VQA video: problem: found a palette chunk with %d colors\n",
- chunk_size / 3);
- return;
- }
- cpl0_chunk += CHUNK_PREAMBLE_SIZE;
- for (i = 0; i < chunk_size / 3; i++) {
- /* scale by 4 to transform 6-bit palette -> 8-bit */
- r = s->buf[cpl0_chunk++] * 4;
- g = s->buf[cpl0_chunk++] * 4;
- b = s->buf[cpl0_chunk++] * 4;
- s->palette[i] = (r << 16) | (g << 8) | (b);
- }
- }
-
- /* next, look for a full codebook */
- if ((cbf0_chunk != -1) && (cbfz_chunk != -1)) {
-
- /* a chunk should not have both chunk types */
- av_log(s->avctx, AV_LOG_ERROR, " VQA video: problem: found both CBF0 and CBFZ chunks\n");
- return;
- }
-
- /* decompress the full codebook chunk */
- if (cbfz_chunk != -1) {
-
- chunk_size = AV_RB32(&s->buf[cbfz_chunk + 4]);
- cbfz_chunk += CHUNK_PREAMBLE_SIZE;
- decode_format80(&s->buf[cbfz_chunk], chunk_size,
- s->codebook, s->codebook_size, 0);
- }
-
- /* copy a full codebook */
- if (cbf0_chunk != -1) {
-
- chunk_size = AV_RB32(&s->buf[cbf0_chunk + 4]);
- /* sanity check the full codebook size */
- if (chunk_size > MAX_CODEBOOK_SIZE) {
- av_log(s->avctx, AV_LOG_ERROR, " VQA video: problem: CBF0 chunk too large (0x%X bytes)\n",
- chunk_size);
- return;
- }
- cbf0_chunk += CHUNK_PREAMBLE_SIZE;
-
- memcpy(s->codebook, &s->buf[cbf0_chunk], chunk_size);
- }
-
- /* decode the frame */
- if (vptz_chunk == -1) {
-
- /* something is wrong if there is no VPTZ chunk */
- av_log(s->avctx, AV_LOG_ERROR, " VQA video: problem: no VPTZ chunk found\n");
- return;
- }
-
- chunk_size = AV_RB32(&s->buf[vptz_chunk + 4]);
- vptz_chunk += CHUNK_PREAMBLE_SIZE;
- decode_format80(&s->buf[vptz_chunk], chunk_size,
- s->decode_buffer, s->decode_buffer_size, 1);
-
- /* render the final PAL8 frame */
- if (s->vector_height == 4)
- index_shift = 4;
- else
- index_shift = 3;
- for (y = 0; y < s->frame.linesize[0] * s->height;
- y += s->frame.linesize[0] * s->vector_height) {
-
- for (x = y; x < y + s->width; x += 4, lobytes++, hibytes++) {
- pixel_ptr = x;
-
- /* get the vector index, the method for which varies according to
- * VQA file version */
- switch (s->vqa_version) {
-
- case 1:
-/* still need sample media for this case (only one game, "Legend of
- * Kyrandia III : Malcolm's Revenge", is known to use this version) */
- lobyte = s->decode_buffer[lobytes * 2];
- hibyte = s->decode_buffer[(lobytes * 2) + 1];
- vector_index = ((hibyte << 8) | lobyte) >> 3;
- vector_index <<= index_shift;
- lines = s->vector_height;
- /* uniform color fill - a quick hack */
- if (hibyte == 0xFF) {
- while (lines--) {
- s->frame.data[0][pixel_ptr + 0] = 255 - lobyte;
- s->frame.data[0][pixel_ptr + 1] = 255 - lobyte;
- s->frame.data[0][pixel_ptr + 2] = 255 - lobyte;
- s->frame.data[0][pixel_ptr + 3] = 255 - lobyte;
- pixel_ptr += s->frame.linesize[0];
- }
- lines=0;
- }
- break;
-
- case 2:
- lobyte = s->decode_buffer[lobytes];
- hibyte = s->decode_buffer[hibytes];
- vector_index = (hibyte << 8) | lobyte;
- vector_index <<= index_shift;
- lines = s->vector_height;
- break;
-
- case 3:
-/* not implemented yet */
- lines = 0;
- break;
- }
-
- while (lines--) {
- s->frame.data[0][pixel_ptr + 0] = s->codebook[vector_index++];
- s->frame.data[0][pixel_ptr + 1] = s->codebook[vector_index++];
- s->frame.data[0][pixel_ptr + 2] = s->codebook[vector_index++];
- s->frame.data[0][pixel_ptr + 3] = s->codebook[vector_index++];
- pixel_ptr += s->frame.linesize[0];
- }
- }
- }
-
- /* handle partial codebook */
- if ((cbp0_chunk != -1) && (cbpz_chunk != -1)) {
- /* a chunk should not have both chunk types */
- av_log(s->avctx, AV_LOG_ERROR, " VQA video: problem: found both CBP0 and CBPZ chunks\n");
- return;
- }
-
- if (cbp0_chunk != -1) {
-
- chunk_size = AV_RB32(&s->buf[cbp0_chunk + 4]);
- cbp0_chunk += CHUNK_PREAMBLE_SIZE;
-
- /* accumulate partial codebook */
- memcpy(&s->next_codebook_buffer[s->next_codebook_buffer_index],
- &s->buf[cbp0_chunk], chunk_size);
- s->next_codebook_buffer_index += chunk_size;
-
- s->partial_countdown--;
- if (s->partial_countdown == 0) {
-
- /* time to replace codebook */
- memcpy(s->codebook, s->next_codebook_buffer,
- s->next_codebook_buffer_index);
-
- /* reset accounting */
- s->next_codebook_buffer_index = 0;
- s->partial_countdown = s->partial_count;
- }
- }
-
- if (cbpz_chunk != -1) {
-
- chunk_size = AV_RB32(&s->buf[cbpz_chunk + 4]);
- cbpz_chunk += CHUNK_PREAMBLE_SIZE;
-
- /* accumulate partial codebook */
- memcpy(&s->next_codebook_buffer[s->next_codebook_buffer_index],
- &s->buf[cbpz_chunk], chunk_size);
- s->next_codebook_buffer_index += chunk_size;
-
- s->partial_countdown--;
- if (s->partial_countdown == 0) {
-
- /* decompress codebook */
- decode_format80(s->next_codebook_buffer,
- s->next_codebook_buffer_index,
- s->codebook, s->codebook_size, 0);
-
- /* reset accounting */
- s->next_codebook_buffer_index = 0;
- s->partial_countdown = s->partial_count;
- }
- }
-}
-
-static int vqa_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- VqaContext *s = (VqaContext *)avctx->priv_data;
-
- s->buf = buf;
- s->size = buf_size;
-
- if (s->frame.data[0])
- avctx->release_buffer(avctx, &s->frame);
-
- if (avctx->get_buffer(avctx, &s->frame)) {
- av_log(s->avctx, AV_LOG_ERROR, " VQA Video: get_buffer() failed\n");
- return -1;
- }
-
- vqa_decode_chunk(s);
-
- /* make the palette available on the way out */
- memcpy(s->frame.data[1], s->palette, PALETTE_COUNT * 4);
- s->frame.palette_has_changed = 1;
-
- *data_size = sizeof(AVFrame);
- *(AVFrame*)data = s->frame;
-
- /* report that the buffer was completely consumed */
- return buf_size;
-}
-
-static int vqa_decode_end(AVCodecContext *avctx)
-{
- VqaContext *s = (VqaContext *)avctx->priv_data;
-
- av_free(s->codebook);
- av_free(s->next_codebook_buffer);
- av_free(s->decode_buffer);
-
- if (s->frame.data[0])
- avctx->release_buffer(avctx, &s->frame);
-
- return 0;
-}
-
-AVCodec vqa_decoder = {
- "vqavideo",
- CODEC_TYPE_VIDEO,
- CODEC_ID_WS_VQA,
- sizeof(VqaContext),
- vqa_decode_init,
- NULL,
- vqa_decode_end,
- vqa_decode_frame,
- CODEC_CAP_DR1,
-};
diff --git a/src/libffmpeg/libavcodec/wavpack.c b/src/libffmpeg/libavcodec/wavpack.c
deleted file mode 100644
index b462174da..000000000
--- a/src/libffmpeg/libavcodec/wavpack.c
+++ /dev/null
@@ -1,556 +0,0 @@
-/*
- * WavPack lossless audio decoder
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#define ALT_BITSTREAM_READER_LE
-#include "avcodec.h"
-#include "bitstream.h"
-
-/**
- * @file wavpack.c
- * WavPack lossless audio decoder
- */
-
-#define WV_JOINT 0x0010
-
-enum WP_ID_Flags{
- WP_IDF_MASK = 0x1F,
- WP_IDF_IGNORE = 0x20,
- WP_IDF_ODD = 0x40,
- WP_IDF_LONG = 0x80
-};
-
-enum WP_ID{
- WP_ID_DUMMY = 0,
- WP_ID_ENCINFO,
- WP_ID_DECTERMS,
- WP_ID_DECWEIGHTS,
- WP_ID_DECSAMPLES,
- WP_ID_ENTROPY,
- WP_ID_HYBRID,
- WP_ID_SHAPING,
- WP_ID_FLOATINFO,
- WP_ID_INT32INFO,
- WP_ID_DATA,
- WP_ID_CORR,
- WP_ID_FLT,
- WP_ID_CHANINFO
-};
-
-#define MAX_TERMS 16
-
-typedef struct Decorr {
- int delta;
- int value;
- int weightA;
- int weightB;
- int samplesA[8];
- int samplesB[8];
-} Decorr;
-
-typedef struct WavpackContext {
- AVCodecContext *avctx;
- int stereo;
- int joint;
- uint32_t CRC;
- GetBitContext gb;
- int data_size; // in bits
- int samples;
- int median[6];
- int terms;
- Decorr decorr[MAX_TERMS];
- int zero, one, zeroes;
-} WavpackContext;
-
-// exponent table copied from WavPack source
-static const uint8_t wp_exp2_table [256] = {
- 0x00, 0x01, 0x01, 0x02, 0x03, 0x03, 0x04, 0x05, 0x06, 0x06, 0x07, 0x08, 0x08, 0x09, 0x0a, 0x0b,
- 0x0b, 0x0c, 0x0d, 0x0e, 0x0e, 0x0f, 0x10, 0x10, 0x11, 0x12, 0x13, 0x13, 0x14, 0x15, 0x16, 0x16,
- 0x17, 0x18, 0x19, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1d, 0x1e, 0x1f, 0x20, 0x20, 0x21, 0x22, 0x23,
- 0x24, 0x24, 0x25, 0x26, 0x27, 0x28, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2c, 0x2d, 0x2e, 0x2f, 0x30,
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3a, 0x3b, 0x3c, 0x3d,
- 0x3e, 0x3f, 0x40, 0x41, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x48, 0x49, 0x4a, 0x4b,
- 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a,
- 0x5b, 0x5c, 0x5d, 0x5e, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
- 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
- 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x87, 0x88, 0x89, 0x8a,
- 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b,
- 0x9c, 0x9d, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad,
- 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0,
- 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc8, 0xc9, 0xca, 0xcb, 0xcd, 0xce, 0xcf, 0xd0, 0xd2, 0xd3, 0xd4,
- 0xd6, 0xd7, 0xd8, 0xd9, 0xdb, 0xdc, 0xdd, 0xde, 0xe0, 0xe1, 0xe2, 0xe4, 0xe5, 0xe6, 0xe8, 0xe9,
- 0xea, 0xec, 0xed, 0xee, 0xf0, 0xf1, 0xf2, 0xf4, 0xf5, 0xf6, 0xf8, 0xf9, 0xfa, 0xfc, 0xfd, 0xff
-};
-
-static av_always_inline int wp_exp2(int16_t val)
-{
- int res, neg = 0;
-
- if(val < 0){
- val = -val;
- neg = 1;
- }
-
- res = wp_exp2_table[val & 0xFF] | 0x100;
- val >>= 8;
- res = (val > 9) ? (res << (val - 9)) : (res >> (9 - val));
- return neg ? -res : res;
-}
-
-static inline int get_unary(GetBitContext *gb){
- int r=0;
- while(get_bits1(gb) && r<33)r++;
- return r;
-}
-
-// macros for manipulating median values
-#define GET_MED(n) ((median[n] >> 4) + 1)
-#define DEC_MED(n) median[n] -= ((median[n] + (128>>n) - 2) / (128>>n)) * 2
-#define INC_MED(n) median[n] += ((median[n] + (128>>n)) / (128>>n)) * 5
-
-// macros for applying weight
-#define UPDATE_WEIGHT_CLIP(weight, delta, samples, in) \
- if(samples && in){ \
- if((samples ^ in) < 0){ \
- weight -= delta; \
- if(weight < -1024) weight = -1024; \
- }else{ \
- weight += delta; \
- if(weight > 1024) weight = 1024; \
- } \
- }
-
-
-static av_always_inline int get_tail(GetBitContext *gb, int k)
-{
- int p, e, res;
-
- if(k<1)return 0;
- p = av_log2(k);
- e = (1 << (p + 1)) - k - 1;
- res = p ? get_bits(gb, p) : 0;
- if(res >= e){
- res = (res<<1) - e + get_bits1(gb);
- }
- return res;
-}
-
-static int wv_get_value(WavpackContext *ctx, GetBitContext *gb, int *median, int *last)
-{
- int t, t2;
- int sign, base, add, ret;
-
- *last = 0;
-
- if((ctx->median[0] < 2U) && (ctx->median[3] < 2U) && !ctx->zero && !ctx->one){
- if(ctx->zeroes){
- ctx->zeroes--;
- if(ctx->zeroes)
- return 0;
- }else{
- t = get_unary(gb);
- if(t >= 2) t = get_bits(gb, t - 1) | (1 << (t-1));
- ctx->zeroes = t;
- if(ctx->zeroes){
- memset(ctx->median, 0, sizeof(ctx->median));
- return 0;
- }
- }
- }
-
- if(get_bits_count(gb) >= ctx->data_size){
- *last = 1;
- return 0;
- }
-
- if(ctx->zero){
- t = 0;
- ctx->zero = 0;
- }else{
- t = get_unary(gb);
- if(get_bits_count(gb) >= ctx->data_size){
- *last = 1;
- return 0;
- }
- if(t == 16) {
- t2 = get_unary(gb);
- if(t2 < 2) t += t2;
- else t += get_bits(gb, t2 - 1) | (1 << (t2 - 1));
- }
-
- if(ctx->one){
- ctx->one = t&1;
- t = (t>>1) + 1;
- }else{
- ctx->one = t&1;
- t >>= 1;
- }
- ctx->zero = !ctx->one;
- }
-
- if(!t){
- base = 0;
- add = GET_MED(0) - 1;
- DEC_MED(0);
- }else if(t == 1){
- base = GET_MED(0);
- add = GET_MED(1) - 1;
- INC_MED(0);
- DEC_MED(1);
- }else if(t == 2){
- base = GET_MED(0) + GET_MED(1);
- add = GET_MED(2) - 1;
- INC_MED(0);
- INC_MED(1);
- DEC_MED(2);
- }else{
- base = GET_MED(0) + GET_MED(1) + GET_MED(2) * (t - 2);
- add = GET_MED(2) - 1;
- INC_MED(0);
- INC_MED(1);
- INC_MED(2);
- }
- ret = base + get_tail(gb, add);
- sign = get_bits1(gb);
- return sign ? ~ret : ret;
-}
-
-static int wv_unpack_stereo(WavpackContext *s, GetBitContext *gb, int16_t *dst)
-{
- int i, j, count = 0;
- int last, t;
- int A, B, L, L2, R, R2;
- int pos = 0;
- uint32_t crc = 0xFFFFFFFF;
-
- s->one = s->zero = s->zeroes = 0;
- do{
- L = wv_get_value(s, gb, s->median, &last);
- if(last) break;
- R = wv_get_value(s, gb, s->median + 3, &last);
- if(last) break;
- for(i = 0; i < s->terms; i++){
- t = s->decorr[i].value;
- j = 0;
- if(t > 0){
- if(t > 8){
- if(t & 1){
- A = 2 * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1];
- B = 2 * s->decorr[i].samplesB[0] - s->decorr[i].samplesB[1];
- }else{
- A = (3 * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1]) >> 1;
- B = (3 * s->decorr[i].samplesB[0] - s->decorr[i].samplesB[1]) >> 1;
- }
- s->decorr[i].samplesA[1] = s->decorr[i].samplesA[0];
- s->decorr[i].samplesB[1] = s->decorr[i].samplesB[0];
- j = 0;
- }else{
- A = s->decorr[i].samplesA[pos];
- B = s->decorr[i].samplesB[pos];
- j = (pos + t) & 7;
- }
- L2 = L + ((s->decorr[i].weightA * A + 512) >> 10);
- R2 = R + ((s->decorr[i].weightB * B + 512) >> 10);
- if(A && L) s->decorr[i].weightA -= ((((L ^ A) >> 30) & 2) - 1) * s->decorr[i].delta;
- if(B && R) s->decorr[i].weightB -= ((((R ^ B) >> 30) & 2) - 1) * s->decorr[i].delta;
- s->decorr[i].samplesA[j] = L = L2;
- s->decorr[i].samplesB[j] = R = R2;
- }else if(t == -1){
- L2 = L + ((s->decorr[i].weightA * s->decorr[i].samplesA[0] + 512) >> 10);
- UPDATE_WEIGHT_CLIP(s->decorr[i].weightA, s->decorr[i].delta, s->decorr[i].samplesA[0], L);
- L = L2;
- R2 = R + ((s->decorr[i].weightB * L2 + 512) >> 10);
- UPDATE_WEIGHT_CLIP(s->decorr[i].weightB, s->decorr[i].delta, L2, R);
- R = R2;
- s->decorr[i].samplesA[0] = R;
- }else{
- R2 = R + ((s->decorr[i].weightB * s->decorr[i].samplesB[0] + 512) >> 10);
- UPDATE_WEIGHT_CLIP(s->decorr[i].weightB, s->decorr[i].delta, s->decorr[i].samplesB[0], R);
- R = R2;
-
- if(t == -3){
- R2 = s->decorr[i].samplesA[0];
- s->decorr[i].samplesA[0] = R;
- }
-
- L2 = L + ((s->decorr[i].weightA * R2 + 512) >> 10);
- UPDATE_WEIGHT_CLIP(s->decorr[i].weightA, s->decorr[i].delta, R2, L);
- L = L2;
- s->decorr[i].samplesB[0] = L;
- }
- }
- pos = (pos + 1) & 7;
- if(s->joint)
- L += (R -= (L >> 1));
- crc = (crc * 3 + L) * 3 + R;
- *dst++ = L;
- *dst++ = R;
-
- count++;
- }while(!last && count < s->samples);
-
- if(crc != s->CRC){
- av_log(s->avctx, AV_LOG_ERROR, "CRC error\n");
- return -1;
- }
- return count * 2;
-}
-
-static int wv_unpack_mono(WavpackContext *s, GetBitContext *gb, int16_t *dst)
-{
- int i, j, count = 0;
- int last, t;
- int A, S, T;
- int pos = 0;
- uint32_t crc = 0xFFFFFFFF;
-
- s->one = s->zero = s->zeroes = 0;
- do{
- T = wv_get_value(s, gb, s->median, &last);
- S = 0;
- if(last) break;
- for(i = 0; i < s->terms; i++){
- t = s->decorr[i].value;
- if(t > 8){
- if(t & 1)
- A = 2 * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1];
- else
- A = (3 * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1]) >> 1;
- s->decorr[i].samplesA[1] = s->decorr[i].samplesA[0];
- j = 0;
- }else{
- A = s->decorr[i].samplesA[pos];
- j = (pos + t) & 7;
- }
- S = T + ((s->decorr[i].weightA * A + 512) >> 10);
- if(A && T) s->decorr[i].weightA -= ((((T ^ A) >> 30) & 2) - 1) * s->decorr[i].delta;
- s->decorr[i].samplesA[j] = T = S;
- }
- pos = (pos + 1) & 7;
- crc = crc * 3 + S;
- *dst++ = S;
- count++;
- }while(!last && count < s->samples);
-
- if(crc != s->CRC){
- av_log(s->avctx, AV_LOG_ERROR, "CRC error\n");
- return -1;
- }
- return count;
-}
-
-static int wavpack_decode_init(AVCodecContext *avctx)
-{
- WavpackContext *s = avctx->priv_data;
-
- s->avctx = avctx;
- s->stereo = (avctx->channels == 2);
-
- return 0;
-}
-
-static int wavpack_decode_close(AVCodecContext *avctx)
-{
-// WavpackContext *s = avctx->priv_data;
-
- return 0;
-}
-
-static int wavpack_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- WavpackContext *s = avctx->priv_data;
- int16_t *samples = data;
- int samplecount;
- int got_terms = 0, got_weights = 0, got_samples = 0, got_entropy = 0, got_bs = 0;
- uint8_t* buf_end = buf + buf_size;
- int i, j, id, size, ssize, weights, t;
-
- if (buf_size == 0) return 0;
-
- memset(s->decorr, 0, MAX_TERMS * sizeof(Decorr));
-
- s->samples = AV_RL32(buf); buf += 4;
- if(!s->samples) return buf_size;
- /* should not happen but who knows */
- if(s->samples * 2 * avctx->channels > AVCODEC_MAX_AUDIO_FRAME_SIZE){
- av_log(avctx, AV_LOG_ERROR, "Packet size is too big to be handled in lavc!\n");
- return -1;
- }
- s->joint = AV_RL32(buf) & WV_JOINT; buf += 4;
- s->CRC = AV_RL32(buf); buf += 4;
- // parse metadata blocks
- while(buf < buf_end){
- id = *buf++;
- size = *buf++;
- if(id & WP_IDF_LONG) {
- size |= (*buf++) << 8;
- size |= (*buf++) << 16;
- }
- size <<= 1; // size is specified in words
- ssize = size;
- if(id & WP_IDF_ODD) size--;
- if(size < 0){
- av_log(avctx, AV_LOG_ERROR, "Got incorrect block %02X with size %i\n", id, size);
- break;
- }
- if(buf + ssize > buf_end){
- av_log(avctx, AV_LOG_ERROR, "Block size %i is out of bounds\n", size);
- break;
- }
- if(id & WP_IDF_IGNORE){
- buf += ssize;
- continue;
- }
- switch(id & WP_IDF_MASK){
- case WP_ID_DECTERMS:
- s->terms = size;
- if(s->terms > MAX_TERMS){
- av_log(avctx, AV_LOG_ERROR, "Too many decorrelation terms\n");
- buf += ssize;
- continue;
- }
- for(i = 0; i < s->terms; i++) {
- s->decorr[s->terms - i - 1].value = (*buf & 0x1F) - 5;
- s->decorr[s->terms - i - 1].delta = *buf >> 5;
- buf++;
- }
- got_terms = 1;
- break;
- case WP_ID_DECWEIGHTS:
- if(!got_terms){
- av_log(avctx, AV_LOG_ERROR, "No decorrelation terms met\n");
- continue;
- }
- weights = size >> s->stereo;
- if(weights > MAX_TERMS || weights > s->terms){
- av_log(avctx, AV_LOG_ERROR, "Too many decorrelation weights\n");
- buf += ssize;
- continue;
- }
- for(i = 0; i < weights; i++) {
- t = (int8_t)(*buf++);
- s->decorr[s->terms - i - 1].weightA = t << 3;
- if(s->decorr[s->terms - i - 1].weightA > 0)
- s->decorr[s->terms - i - 1].weightA += (s->decorr[s->terms - i - 1].weightA + 64) >> 7;
- if(s->stereo){
- t = (int8_t)(*buf++);
- s->decorr[s->terms - i - 1].weightB = t << 3;
- if(s->decorr[s->terms - i - 1].weightB > 0)
- s->decorr[s->terms - i - 1].weightB += (s->decorr[s->terms - i - 1].weightB + 64) >> 7;
- }
- }
- got_weights = 1;
- break;
- case WP_ID_DECSAMPLES:
- if(!got_terms){
- av_log(avctx, AV_LOG_ERROR, "No decorrelation terms met\n");
- continue;
- }
- t = 0;
- for(i = s->terms - 1; (i >= 0) && (t < size); i--) {
- if(s->decorr[i].value > 8){
- s->decorr[i].samplesA[0] = wp_exp2(AV_RL16(buf)); buf += 2;
- s->decorr[i].samplesA[1] = wp_exp2(AV_RL16(buf)); buf += 2;
- if(s->stereo){
- s->decorr[i].samplesB[0] = wp_exp2(AV_RL16(buf)); buf += 2;
- s->decorr[i].samplesB[1] = wp_exp2(AV_RL16(buf)); buf += 2;
- t += 4;
- }
- t += 4;
- }else if(s->decorr[i].value < 0){
- s->decorr[i].samplesA[0] = wp_exp2(AV_RL16(buf)); buf += 2;
- s->decorr[i].samplesB[0] = wp_exp2(AV_RL16(buf)); buf += 2;
- t += 4;
- }else{
- for(j = 0; j < s->decorr[i].value; j++){
- s->decorr[i].samplesA[j] = wp_exp2(AV_RL16(buf)); buf += 2;
- if(s->stereo){
- s->decorr[i].samplesB[j] = wp_exp2(AV_RL16(buf)); buf += 2;
- }
- }
- t += s->decorr[i].value * 2 * avctx->channels;
- }
- }
- got_samples = 1;
- break;
- case WP_ID_ENTROPY:
- if(size != 6 * avctx->channels){
- av_log(avctx, AV_LOG_ERROR, "Entropy vars size should be %i, got %i", 6 * avctx->channels, size);
- buf += ssize;
- continue;
- }
- for(i = 0; i < 3 * avctx->channels; i++){
- s->median[i] = wp_exp2(AV_RL16(buf));
- buf += 2;
- }
- got_entropy = 1;
- break;
- case WP_ID_DATA:
- init_get_bits(&s->gb, buf, size * 8);
- s->data_size = size * 8;
- buf += size;
- got_bs = 1;
- break;
- default:
- buf += size;
- }
- if(id & WP_IDF_ODD) buf++;
- }
- if(!got_terms){
- av_log(avctx, AV_LOG_ERROR, "No block with decorrelation terms\n");
- return -1;
- }
- if(!got_weights){
- av_log(avctx, AV_LOG_ERROR, "No block with decorrelation weights\n");
- return -1;
- }
- if(!got_samples){
- av_log(avctx, AV_LOG_ERROR, "No block with decorrelation samples\n");
- return -1;
- }
- if(!got_entropy){
- av_log(avctx, AV_LOG_ERROR, "No block with entropy info\n");
- return -1;
- }
- if(!got_bs){
- av_log(avctx, AV_LOG_ERROR, "Packed samples not found\n");
- return -1;
- }
-
- if(s->stereo)
- samplecount = wv_unpack_stereo(s, &s->gb, samples);
- else
- samplecount = wv_unpack_mono(s, &s->gb, samples);
- *data_size = samplecount * 2;
-
- return buf_size;
-}
-
-AVCodec wavpack_decoder = {
- "wavpack",
- CODEC_TYPE_AUDIO,
- CODEC_ID_WAVPACK,
- sizeof(WavpackContext),
- wavpack_decode_init,
- NULL,
- wavpack_decode_close,
- wavpack_decode_frame,
-};
diff --git a/src/libffmpeg/libavcodec/wmadata.h b/src/libffmpeg/libavcodec/wmadata.h
deleted file mode 100644
index 35e545ce6..000000000
--- a/src/libffmpeg/libavcodec/wmadata.h
+++ /dev/null
@@ -1,1433 +0,0 @@
-/*
- * WMA compatible decoder
- * copyright (c) 2002 The FFmpeg Project
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file wmadata.h
- * Various WMA tables.
- */
-
-static const uint16_t wma_critical_freqs[25] = {
- 100, 200, 300, 400, 510, 630, 770, 920,
- 1080, 1270, 1480, 1720, 2000, 2320, 2700, 3150,
- 3700, 4400, 5300, 6400, 7700, 9500, 12000, 15500,
- 24500,
-};
-
-/* first value is number of bands */
-static const uint8_t exponent_band_22050[3][25] = {
- { 10, 4, 8, 4, 8, 8, 12, 20, 24, 24, 16, },
- { 14, 4, 8, 8, 4, 12, 12, 16, 24, 16, 20, 24, 32, 40, 36, },
- { 23, 4, 4, 4, 8, 4, 4, 8, 8, 8, 8, 8, 12, 12, 16, 16, 24, 24, 32, 44, 48, 60, 84, 72, },
-};
-
-static const uint8_t exponent_band_32000[3][25] = {
- { 11, 4, 4, 8, 4, 4, 12, 16, 24, 20, 28, 4, },
- { 15, 4, 8, 4, 4, 8, 8, 16, 20, 12, 20, 20, 28, 40, 56, 8, },
- { 16, 8, 4, 8, 8, 12, 16, 20, 24, 40, 32, 32, 44, 56, 80, 112, 16, },
-};
-
-static const uint8_t exponent_band_44100[3][25] = {
- { 12, 4, 4, 4, 4, 4, 8, 8, 8, 12, 16, 20, 36, },
- { 15, 4, 8, 4, 8, 8, 4, 8, 8, 12, 12, 12, 24, 28, 40, 76, },
- { 17, 4, 8, 8, 4, 12, 12, 8, 8, 24, 16, 20, 24, 32, 40, 60, 80, 152, },
-};
-
-static const uint16_t hgain_huffcodes[37] = {
- 0x00003, 0x002e7, 0x00001, 0x005cd, 0x0005d, 0x005c9, 0x0005e, 0x00003,
- 0x00016, 0x0000b, 0x00001, 0x00006, 0x00001, 0x00006, 0x00004, 0x00005,
- 0x00004, 0x00007, 0x00003, 0x00007, 0x00004, 0x0000a, 0x0000a, 0x00002,
- 0x00003, 0x00000, 0x00005, 0x00002, 0x0005f, 0x00004, 0x00003, 0x00002,
- 0x005c8, 0x000b8, 0x005ca, 0x005cb, 0x005cc,
-};
-
-static const uint8_t hgain_huffbits[37] = {
- 10, 12, 10, 13, 9, 13, 9, 8,
- 7, 5, 5, 4, 4, 3, 3, 3,
- 4, 3, 4, 4, 5, 5, 6, 8,
- 7, 10, 8, 10, 9, 8, 9, 9,
- 13, 10, 13, 13, 13,
-};
-
-static const float lsp_codebook[NB_LSP_COEFS][16] = {
- { 1.98732877, 1.97944528, 1.97179088, 1.96260549, 1.95038374, 1.93336114, 1.90719232, 1.86191415, },
- { 1.97260000, 1.96083160, 1.94982586, 1.93806164, 1.92516608, 1.91010199, 1.89232331, 1.87149812,
- 1.84564818, 1.81358067, 1.77620070, 1.73265264, 1.67907855, 1.60959081, 1.50829650, 1.33120330, },
- { 1.90109110, 1.86482426, 1.83419671, 1.80168452, 1.76650116, 1.72816320, 1.68502700, 1.63738256,
- 1.58501580, 1.51795181, 1.43679906, 1.33950585, 1.24176208, 1.12260729, 0.96749668, 0.74048265, },
- { 1.76943864, 1.67822463, 1.59946365, 1.53560582, 1.47470796, 1.41210167, 1.34509536, 1.27339507,
- 1.19303814, 1.09765169, 0.98818722, 0.87239446, 0.74369172, 0.59768184, 0.43168630, 0.17977021, },
- { 1.43428349, 1.32038354, 1.21074086, 1.10577988, 1.00561746, 0.90335924, 0.80437489, 0.70709671,
- 0.60427395, 0.49814048, 0.38509539, 0.27106800, 0.14407416, 0.00219910, -0.16725141, -0.36936085, },
- { 0.99895687, 0.84188166, 0.70753739, 0.57906595, 0.47055563, 0.36966965, 0.26826648, 0.17163380,
- 0.07208392, -0.03062936, -1.40037388, -0.25128968, -0.37213937, -0.51075646, -0.64887512, -0.80308031, },
- { 0.26515280, 0.06313551, -0.08872080, -0.21103548, -0.31069678, -0.39680323, -0.47223474, -0.54167135,
- -0.61444740, -0.68943343, -0.76580211, -0.85170082, -0.95289061, -1.06514703, -1.20510707, -1.37617746, },
- { -0.53940301, -0.73770929, -0.88424876, -1.01117930, -1.13389091, -1.26830073, -1.42041987, -1.62033919,
- -1.10158808, -1.16512566, -1.23337128, -1.30414401, -1.37663312, -1.46853845, -1.57625798, -1.66893638, },
- { -0.38601997, -0.56009350, -0.66978483, -0.76028471, -0.83846064, -0.90868087, -0.97408881, -1.03694962, },
- { -1.56144989, -1.65944032, -1.72689685, -1.77857740, -1.82203011, -1.86220079, -1.90283983, -1.94820479, },
-};
-
-static const uint32_t scale_huffcodes[121] = {
- 0x3ffe8, 0x3ffe6, 0x3ffe7, 0x3ffe5, 0x7fff5, 0x7fff1, 0x7ffed, 0x7fff6,
- 0x7ffee, 0x7ffef, 0x7fff0, 0x7fffc, 0x7fffd, 0x7ffff, 0x7fffe, 0x7fff7,
- 0x7fff8, 0x7fffb, 0x7fff9, 0x3ffe4, 0x7fffa, 0x3ffe3, 0x1ffef, 0x1fff0,
- 0x0fff5, 0x1ffee, 0x0fff2, 0x0fff3, 0x0fff4, 0x0fff1, 0x07ff6, 0x07ff7,
- 0x03ff9, 0x03ff5, 0x03ff7, 0x03ff3, 0x03ff6, 0x03ff2, 0x01ff7, 0x01ff5,
- 0x00ff9, 0x00ff7, 0x00ff6, 0x007f9, 0x00ff4, 0x007f8, 0x003f9, 0x003f7,
- 0x003f5, 0x001f8, 0x001f7, 0x000fa, 0x000f8, 0x000f6, 0x00079, 0x0003a,
- 0x00038, 0x0001a, 0x0000b, 0x00004, 0x00000, 0x0000a, 0x0000c, 0x0001b,
- 0x00039, 0x0003b, 0x00078, 0x0007a, 0x000f7, 0x000f9, 0x001f6, 0x001f9,
- 0x003f4, 0x003f6, 0x003f8, 0x007f5, 0x007f4, 0x007f6, 0x007f7, 0x00ff5,
- 0x00ff8, 0x01ff4, 0x01ff6, 0x01ff8, 0x03ff8, 0x03ff4, 0x0fff0, 0x07ff4,
- 0x0fff6, 0x07ff5, 0x3ffe2, 0x7ffd9, 0x7ffda, 0x7ffdb, 0x7ffdc, 0x7ffdd,
- 0x7ffde, 0x7ffd8, 0x7ffd2, 0x7ffd3, 0x7ffd4, 0x7ffd5, 0x7ffd6, 0x7fff2,
- 0x7ffdf, 0x7ffe7, 0x7ffe8, 0x7ffe9, 0x7ffea, 0x7ffeb, 0x7ffe6, 0x7ffe0,
- 0x7ffe1, 0x7ffe2, 0x7ffe3, 0x7ffe4, 0x7ffe5, 0x7ffd7, 0x7ffec, 0x7fff4,
- 0x7fff3,
-};
-
-static const uint8_t scale_huffbits[121] = {
- 18, 18, 18, 18, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 18, 19, 18, 17, 17,
- 16, 17, 16, 16, 16, 16, 15, 15,
- 14, 14, 14, 14, 14, 14, 13, 13,
- 12, 12, 12, 11, 12, 11, 10, 10,
- 10, 9, 9, 8, 8, 8, 7, 6,
- 6, 5, 4, 3, 1, 4, 4, 5,
- 6, 6, 7, 7, 8, 8, 9, 9,
- 10, 10, 10, 11, 11, 11, 11, 12,
- 12, 13, 13, 13, 14, 14, 16, 15,
- 16, 15, 18, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19,
-};
-
-static const uint32_t coef0_huffcodes[666] = {
- 0x00258, 0x0003d, 0x00000, 0x00005, 0x00008, 0x00008, 0x0000c, 0x0001b,
- 0x0001f, 0x00015, 0x00024, 0x00032, 0x0003a, 0x00026, 0x0002c, 0x0002f,
- 0x0004a, 0x0004d, 0x00061, 0x00070, 0x00073, 0x00048, 0x00052, 0x0005a,
- 0x0005d, 0x0006e, 0x00099, 0x0009e, 0x000c1, 0x000ce, 0x000e4, 0x000f0,
- 0x00093, 0x0009e, 0x000a2, 0x000a1, 0x000b8, 0x000d2, 0x000d3, 0x0012e,
- 0x00130, 0x000de, 0x0012d, 0x0019b, 0x001e4, 0x00139, 0x0013a, 0x0013f,
- 0x0014f, 0x0016d, 0x001a2, 0x0027c, 0x0027e, 0x00332, 0x0033c, 0x0033f,
- 0x0038b, 0x00396, 0x003c5, 0x00270, 0x0027c, 0x0025a, 0x00395, 0x00248,
- 0x004bd, 0x004fb, 0x00662, 0x00661, 0x0071b, 0x004e6, 0x004ff, 0x00666,
- 0x0071c, 0x0071a, 0x0071f, 0x00794, 0x00536, 0x004e2, 0x0078e, 0x004ee,
- 0x00518, 0x00535, 0x004fb, 0x0078d, 0x00530, 0x00680, 0x0068f, 0x005cb,
- 0x00965, 0x006a6, 0x00967, 0x0097f, 0x00682, 0x006ae, 0x00cd0, 0x00e28,
- 0x00f13, 0x00f1f, 0x009f5, 0x00cd3, 0x00f11, 0x00926, 0x00964, 0x00f32,
- 0x00f12, 0x00f30, 0x00966, 0x00d0b, 0x00a68, 0x00b91, 0x009c7, 0x00b73,
- 0x012fa, 0x0131d, 0x013f9, 0x01ca0, 0x0199c, 0x01c7a, 0x0198c, 0x01248,
- 0x01c74, 0x01c64, 0x0139e, 0x012fd, 0x00a77, 0x012fc, 0x01c7b, 0x012ca,
- 0x014cc, 0x014d2, 0x014e3, 0x014dc, 0x012dc, 0x03344, 0x02598, 0x0263c,
- 0x0333b, 0x025e6, 0x01a1c, 0x01e3c, 0x014e2, 0x033d4, 0x01a11, 0x03349,
- 0x03cce, 0x014e1, 0x01a34, 0x0273e, 0x02627, 0x0273f, 0x038ee, 0x03971,
- 0x03c67, 0x03c61, 0x0333d, 0x038c2, 0x0263f, 0x038cd, 0x02638, 0x02e41,
- 0x0351f, 0x03348, 0x03c66, 0x03562, 0x02989, 0x027d5, 0x0333c, 0x02e4f,
- 0x0343b, 0x02ddf, 0x04bc8, 0x029c0, 0x02e57, 0x04c72, 0x025b7, 0x03547,
- 0x03540, 0x029d3, 0x04c45, 0x025bb, 0x06600, 0x04c73, 0x04bce, 0x0357b,
- 0x029a6, 0x029d2, 0x0263e, 0x0298a, 0x07183, 0x06602, 0x07958, 0x04b66,
- 0x0537d, 0x05375, 0x04fe9, 0x04b67, 0x0799f, 0x04bc9, 0x051fe, 0x06a3b,
- 0x05bb6, 0x04fa8, 0x0728f, 0x05376, 0x0492c, 0x0537e, 0x0795a, 0x06a3c,
- 0x0e515, 0x07887, 0x0683a, 0x051f9, 0x051fd, 0x0cc6a, 0x06a8a, 0x0cc6d,
- 0x05bb3, 0x0683b, 0x051fc, 0x05378, 0x0728e, 0x07886, 0x05bb7, 0x0f2a4,
- 0x0795b, 0x0683c, 0x09fc1, 0x0683d, 0x0b752, 0x09678, 0x0a3e8, 0x06ac7,
- 0x051f0, 0x0b759, 0x06af3, 0x04b6b, 0x0f2a0, 0x0f2ad, 0x096c3, 0x0e518,
- 0x0b75c, 0x0d458, 0x0cc6b, 0x0537c, 0x067aa, 0x04fea, 0x0343a, 0x0cc71,
- 0x0967f, 0x09fc4, 0x096c2, 0x0e516, 0x0f2a1, 0x0d45c, 0x0d45d, 0x0d45e,
- 0x12fb9, 0x0967e, 0x1982f, 0x09883, 0x096c4, 0x0b753, 0x12fb8, 0x0f2a8,
- 0x1ca21, 0x096c5, 0x0e51a, 0x1ca27, 0x12f3c, 0x0d471, 0x0f2aa, 0x0b75b,
- 0x12fbb, 0x0f2a9, 0x0f2ac, 0x0d45a, 0x0b74f, 0x096c8, 0x16e91, 0x096ca,
- 0x12fbf, 0x0d0a7, 0x13103, 0x0d516, 0x16e99, 0x12cbd, 0x0a3ea, 0x19829,
- 0x0b755, 0x29ba7, 0x1ca28, 0x29ba5, 0x16e93, 0x1982c, 0x19828, 0x25994,
- 0x0a3eb, 0x1ca29, 0x16e90, 0x1ca25, 0x1982d, 0x1ca26, 0x16e9b, 0x0b756,
- 0x0967c, 0x25997, 0x0b75f, 0x198d3, 0x0b757, 0x19a2a, 0x0d45b, 0x0e517,
- 0x1ca24, 0x1ca23, 0x1ca22, 0x0b758, 0x16e97, 0x0cd14, 0x13100, 0x00007,
- 0x0003b, 0x0006b, 0x00097, 0x00138, 0x00125, 0x00173, 0x00258, 0x00335,
- 0x0028e, 0x004c6, 0x00715, 0x00729, 0x004ef, 0x00519, 0x004ed, 0x00532,
- 0x0068c, 0x00686, 0x00978, 0x00e5d, 0x00e31, 0x009f4, 0x00b92, 0x012f8,
- 0x00d06, 0x00a67, 0x00d44, 0x00a76, 0x00d59, 0x012cd, 0x01c78, 0x01c75,
- 0x0199f, 0x0198f, 0x01c67, 0x014c6, 0x01c79, 0x01c76, 0x00b94, 0x00d1b,
- 0x01e32, 0x01e31, 0x01ab0, 0x01a05, 0x01aa1, 0x0333a, 0x025e5, 0x02626,
- 0x03541, 0x03544, 0x03421, 0x03546, 0x02e55, 0x02e56, 0x0492d, 0x02dde,
- 0x0299b, 0x02ddc, 0x0357a, 0x0249c, 0x0668b, 0x1c77f, 0x1ca20, 0x0d45f,
- 0x09886, 0x16e9a, 0x0f2a7, 0x0b751, 0x0a3ee, 0x0cf59, 0x0cf57, 0x0b754,
- 0x0d0a6, 0x16e98, 0x0b760, 0x06ac6, 0x0a3f0, 0x12fbe, 0x13104, 0x0f2a5,
- 0x0a3ef, 0x0d472, 0x12cba, 0x1982e, 0x16e9c, 0x1c77e, 0x198d0, 0x13105,
- 0x16e92, 0x0b75d, 0x0d459, 0x0001a, 0x000c0, 0x0016c, 0x003cd, 0x00350,
- 0x0067b, 0x0051e, 0x006a9, 0x009f4, 0x00b72, 0x00d09, 0x01249, 0x01e3d,
- 0x01ca1, 0x01a1f, 0x01721, 0x01a8a, 0x016e8, 0x03347, 0x01a35, 0x0249d,
- 0x0299a, 0x02596, 0x02e4e, 0x0298b, 0x07182, 0x04c46, 0x025ba, 0x02e40,
- 0x027d6, 0x04fe8, 0x06607, 0x05310, 0x09884, 0x072e1, 0x06a3d, 0x04b6a,
- 0x04c7a, 0x06603, 0x04c7b, 0x03428, 0x06605, 0x09664, 0x09fc0, 0x071de,
- 0x06601, 0x05bb2, 0x09885, 0x0a3e2, 0x1c61f, 0x12cbb, 0x0b750, 0x0cf58,
- 0x0967d, 0x25995, 0x668ad, 0x0b75a, 0x09fc2, 0x0537f, 0x0b75e, 0x13fae,
- 0x12fbc, 0x00031, 0x001c4, 0x004c5, 0x005b8, 0x00cf4, 0x0096f, 0x00d46,
- 0x01e57, 0x01a04, 0x02625, 0x03346, 0x028f9, 0x04c47, 0x072e0, 0x04b69,
- 0x03420, 0x07957, 0x06639, 0x0799e, 0x07959, 0x07881, 0x04b68, 0x09fc3,
- 0x09fd6, 0x0cc70, 0x0a3f1, 0x12cbe, 0x0e30e, 0x0e51b, 0x06af2, 0x12cbc,
- 0x1c77d, 0x0f2ab, 0x12fbd, 0x1aa2f, 0x0a3ec, 0x0d473, 0x05377, 0x0a3e9,
- 0x1982b, 0x0e300, 0x12f3f, 0x0cf5f, 0x096c0, 0x38c3c, 0x16e94, 0x16e95,
- 0x12f3d, 0x29ba4, 0x29ba6, 0x1c77c, 0x6a8ba, 0x3545c, 0x33457, 0x668ac,
- 0x6a8bb, 0x16e9d, 0x0e519, 0x25996, 0x12f3e, 0x00036, 0x0033e, 0x006ad,
- 0x00d03, 0x012c8, 0x0124a, 0x03c42, 0x03ccd, 0x06606, 0x07880, 0x06852,
- 0x06a3a, 0x05bb4, 0x0f2a2, 0x09fc7, 0x12cb9, 0x0cc6c, 0x0a6e8, 0x096c1,
- 0x0004a, 0x00355, 0x012f9, 0x014e8, 0x01abe, 0x025b6, 0x0492e, 0x09fc6,
- 0x051ff, 0x0cc6f, 0x096cb, 0x0d071, 0x198d1, 0x12cb8, 0x38c3d, 0x13faf,
- 0x096c9, 0x0009d, 0x00539, 0x012ce, 0x0341f, 0x029c1, 0x04b33, 0x0a3e3,
- 0x0d070, 0x16e96, 0x0b763, 0x000a0, 0x009ce, 0x038cc, 0x0343d, 0x051fa,
- 0x09888, 0x12fba, 0x000df, 0x00a75, 0x029a7, 0x09fc5, 0x0e301, 0x0967b,
- 0x001e7, 0x012c9, 0x051fb, 0x09889, 0x0f2a6, 0x0016f, 0x01cb9, 0x0cf5a,
- 0x12cbf, 0x09679, 0x00272, 0x01a15, 0x0967a, 0x003cb, 0x025f6, 0x0b762,
- 0x0028d, 0x03c60, 0x0cf5e, 0x00352, 0x03ccc, 0x0072f, 0x07186, 0x004ec,
- 0x05379, 0x0068e, 0x09887, 0x006a7, 0x06af1, 0x00e29, 0x0cf5b, 0x00f31,
- 0x0d470, 0x009c6, 0x013fb, 0x13102, 0x019a5, 0x13101, 0x01983, 0x01c65,
- 0x0124f, 0x014c7, 0x01726, 0x01abf, 0x03304, 0x02624, 0x03c41, 0x027d7,
- 0x02ddd, 0x02e54, 0x0343c, 0x06604, 0x07181, 0x0663a, 0x04fa9, 0x0663b,
- 0x05311, 0x0537a, 0x06839, 0x05bb5, 0x0492f, 0x06af0, 0x096c7, 0x0cc6e,
- 0x0537b, 0x0cf5c, 0x0cf56, 0x198d2, 0x0cf5d, 0x0a3ed, 0x0f2a3, 0x1982a,
- 0x0b761, 0x096c6,
-};
-
-static const uint8_t coef0_huffbits[666] = {
- 11, 6, 2, 3, 4, 5, 5, 5,
- 5, 6, 6, 6, 6, 7, 7, 7,
- 7, 7, 7, 7, 7, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 11, 11, 11, 10, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 12, 12, 11, 12,
- 12, 12, 12, 11, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 13, 13, 12,
- 12, 12, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 14,
- 13, 13, 13, 13, 13, 13, 13, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 13, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 15,
- 15, 14, 14, 15, 15, 15, 14, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 14, 15, 15, 15, 15, 16,
- 16, 16, 15, 16, 15, 15, 16, 16,
- 16, 16, 15, 16, 16, 16, 15, 16,
- 16, 15, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 15, 15, 16, 16,
- 15, 16, 16, 16, 17, 17, 17, 16,
- 16, 17, 16, 16, 16, 16, 17, 16,
- 17, 17, 16, 16, 15, 15, 15, 16,
- 17, 16, 17, 16, 16, 17, 17, 17,
- 17, 17, 17, 16, 17, 17, 17, 16,
- 17, 17, 16, 17, 17, 17, 16, 17,
- 17, 16, 16, 17, 17, 17, 18, 17,
- 17, 17, 17, 17, 18, 18, 17, 17,
- 17, 19, 17, 19, 18, 17, 17, 18,
- 17, 17, 18, 17, 17, 17, 18, 17,
- 17, 18, 17, 17, 17, 17, 17, 16,
- 17, 17, 17, 17, 18, 16, 17, 4,
- 6, 8, 9, 9, 10, 10, 10, 10,
- 11, 11, 11, 11, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 14, 13, 13, 13, 13,
- 13, 13, 14, 14, 14, 14, 14, 14,
- 15, 15, 15, 15, 15, 15, 16, 15,
- 15, 15, 15, 15, 15, 17, 17, 17,
- 16, 18, 16, 17, 17, 16, 16, 17,
- 17, 18, 17, 16, 17, 17, 17, 16,
- 17, 17, 18, 17, 18, 17, 17, 17,
- 18, 17, 17, 5, 8, 10, 10, 11,
- 11, 12, 12, 12, 13, 13, 14, 13,
- 13, 14, 14, 14, 14, 14, 14, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 16, 16, 15, 16, 16,
- 15, 15, 15, 15, 15, 16, 16, 15,
- 15, 16, 16, 17, 17, 18, 17, 16,
- 17, 18, 19, 17, 16, 16, 17, 17,
- 17, 6, 9, 11, 12, 12, 13, 13,
- 13, 14, 14, 14, 15, 15, 15, 16,
- 15, 15, 15, 15, 15, 15, 16, 16,
- 16, 16, 17, 18, 16, 16, 16, 18,
- 17, 16, 17, 18, 17, 17, 16, 17,
- 17, 16, 17, 16, 17, 18, 18, 18,
- 17, 19, 19, 17, 20, 19, 18, 19,
- 20, 18, 16, 18, 17, 7, 10, 12,
- 13, 13, 14, 14, 14, 15, 15, 16,
- 16, 16, 16, 16, 18, 16, 17, 17,
- 8, 11, 13, 14, 14, 15, 16, 16,
- 16, 16, 17, 17, 17, 18, 18, 17,
- 17, 8, 12, 14, 15, 15, 15, 17,
- 17, 18, 17, 9, 12, 14, 15, 16,
- 16, 17, 9, 13, 15, 16, 16, 17,
- 9, 13, 16, 16, 16, 10, 13, 16,
- 18, 17, 10, 14, 17, 10, 14, 17,
- 11, 14, 16, 11, 14, 11, 15, 12,
- 16, 12, 16, 12, 16, 12, 16, 12,
- 17, 13, 13, 17, 13, 17, 13, 13,
- 14, 14, 14, 14, 14, 14, 14, 15,
- 15, 15, 15, 15, 15, 15, 16, 15,
- 16, 16, 16, 16, 16, 16, 17, 16,
- 16, 16, 16, 17, 16, 17, 16, 17,
- 17, 17,
-};
-
-static const uint32_t coef1_huffcodes[555] = {
- 0x00115, 0x00002, 0x00001, 0x00000, 0x0000d, 0x00007, 0x00013, 0x0001d,
- 0x00008, 0x0000c, 0x00023, 0x0002b, 0x0003f, 0x00017, 0x0001b, 0x00043,
- 0x00049, 0x00050, 0x00055, 0x00054, 0x00067, 0x00064, 0x0007b, 0x0002d,
- 0x00028, 0x0002a, 0x00085, 0x00089, 0x0002b, 0x00035, 0x00090, 0x00091,
- 0x00094, 0x00088, 0x000c1, 0x000c6, 0x000f2, 0x000e3, 0x000c5, 0x000e2,
- 0x00036, 0x000f0, 0x000a7, 0x000cd, 0x000fb, 0x00059, 0x00116, 0x00103,
- 0x00108, 0x0012b, 0x0012d, 0x00188, 0x0012e, 0x0014c, 0x001c3, 0x00187,
- 0x001e7, 0x0006f, 0x00094, 0x00069, 0x001e6, 0x001ca, 0x00147, 0x00195,
- 0x000a7, 0x00213, 0x00209, 0x00303, 0x00295, 0x00289, 0x0028c, 0x0028d,
- 0x00312, 0x00330, 0x0029b, 0x00308, 0x00328, 0x0029a, 0x0025e, 0x003c5,
- 0x00384, 0x0039f, 0x00397, 0x00296, 0x0032e, 0x00332, 0x003c6, 0x003e6,
- 0x0012d, 0x000d1, 0x00402, 0x000dd, 0x00161, 0x0012b, 0x00127, 0x0045d,
- 0x00601, 0x004ab, 0x0045f, 0x00410, 0x004bf, 0x00528, 0x0045c, 0x00424,
- 0x00400, 0x00511, 0x00618, 0x0073d, 0x0063a, 0x00614, 0x0073c, 0x007c0,
- 0x007cf, 0x00802, 0x00966, 0x00964, 0x00951, 0x008a0, 0x00346, 0x00803,
- 0x00a52, 0x0024a, 0x007c1, 0x0063f, 0x00126, 0x00406, 0x00789, 0x008a2,
- 0x00960, 0x00967, 0x00c05, 0x00c70, 0x00c79, 0x00a5d, 0x00c26, 0x00c4d,
- 0x00372, 0x008a5, 0x00c08, 0x002c5, 0x00f11, 0x00cc4, 0x00f8e, 0x00e16,
- 0x00496, 0x00e77, 0x00f9c, 0x00c25, 0x00f1e, 0x00c27, 0x00f1f, 0x00e17,
- 0x00ccd, 0x00355, 0x00c09, 0x00c78, 0x00f90, 0x00521, 0x00357, 0x00356,
- 0x0068e, 0x00f9d, 0x00c04, 0x00e58, 0x00a20, 0x00a2c, 0x00c4c, 0x0052f,
- 0x00f8d, 0x01178, 0x01053, 0x01097, 0x0180f, 0x0180d, 0x012fb, 0x012aa,
- 0x0202a, 0x00a40, 0x018ed, 0x01ceb, 0x01455, 0x018e3, 0x012a1, 0x00354,
- 0x00353, 0x00f1c, 0x00c7b, 0x00c37, 0x0101d, 0x012cb, 0x01142, 0x0197d,
- 0x01095, 0x01e3b, 0x0186b, 0x00588, 0x01c2a, 0x014b8, 0x01e3a, 0x018ec,
- 0x01f46, 0x012fa, 0x00a53, 0x01ce8, 0x00a55, 0x01c29, 0x0117b, 0x01052,
- 0x012a0, 0x00589, 0x00950, 0x01c2b, 0x00a50, 0x0208b, 0x0180e, 0x02027,
- 0x02556, 0x01e20, 0x006e7, 0x01c28, 0x0197a, 0x00684, 0x020a2, 0x01f22,
- 0x03018, 0x039cf, 0x03e25, 0x02557, 0x0294c, 0x028a6, 0x00d11, 0x028a9,
- 0x02979, 0x00d46, 0x00a56, 0x039ce, 0x030cc, 0x0329a, 0x0149d, 0x0510f,
- 0x0451c, 0x02028, 0x03299, 0x01ced, 0x014b9, 0x00f85, 0x00c7a, 0x01800,
- 0x00341, 0x012ca, 0x039c8, 0x0329d, 0x00d0d, 0x03e20, 0x05144, 0x00d45,
- 0x030d0, 0x0186d, 0x030d5, 0x00d0f, 0x00d40, 0x04114, 0x020a1, 0x0297f,
- 0x03e24, 0x032f1, 0x04047, 0x030d4, 0x028a8, 0x00d0e, 0x0451d, 0x04044,
- 0x0297e, 0x04042, 0x030d2, 0x030cf, 0x03e21, 0x03e26, 0x028a5, 0x0451a,
- 0x00d48, 0x01a16, 0x00d44, 0x04518, 0x0149b, 0x039ca, 0x01498, 0x0403d,
- 0x0451b, 0x0149c, 0x032f3, 0x030cb, 0x08073, 0x03e22, 0x0529a, 0x020aa,
- 0x039cc, 0x0738a, 0x06530, 0x07389, 0x06193, 0x08071, 0x04043, 0x030ce,
- 0x05147, 0x07388, 0x05145, 0x08072, 0x04521, 0x00d47, 0x0297c, 0x030cd,
- 0x030ca, 0x0000b, 0x0000c, 0x00083, 0x000e4, 0x00048, 0x00102, 0x001cc,
- 0x001f5, 0x00097, 0x0020b, 0x00124, 0x00453, 0x00627, 0x00639, 0x00605,
- 0x00517, 0x001b8, 0x00663, 0x00667, 0x007c3, 0x00823, 0x00961, 0x00963,
- 0x00e5a, 0x00e59, 0x00a2b, 0x00cbf, 0x00292, 0x00a2d, 0x007d0, 0x00953,
- 0x00cc5, 0x00f84, 0x004ab, 0x014a7, 0x0068a, 0x0117a, 0x0052e, 0x01442,
- 0x0052c, 0x00c77, 0x00f8f, 0x004aa, 0x01094, 0x01801, 0x012c4, 0x0297b,
- 0x00952, 0x01f19, 0x006a5, 0x01149, 0x012c5, 0x01803, 0x022f2, 0x0329b,
- 0x04520, 0x0149e, 0x00d13, 0x01f16, 0x01ce9, 0x0101c, 0x006e6, 0x039c9,
- 0x06191, 0x07c8e, 0x06192, 0x0ca63, 0x039cd, 0x06190, 0x06884, 0x06885,
- 0x07382, 0x00d49, 0x00d41, 0x0450c, 0x0149a, 0x030d1, 0x08077, 0x03e23,
- 0x01a15, 0x0e701, 0x0e702, 0x08079, 0x0822a, 0x0a218, 0x07887, 0x0403f,
- 0x0520b, 0x0529b, 0x0e700, 0x04519, 0x00007, 0x000e0, 0x000d0, 0x0039b,
- 0x003e5, 0x00163, 0x0063e, 0x007c9, 0x00806, 0x00954, 0x01044, 0x01f44,
- 0x0197c, 0x01f45, 0x00a51, 0x01f47, 0x00951, 0x0052d, 0x02291, 0x0092f,
- 0x00a54, 0x00d12, 0x0297d, 0x00d0c, 0x01499, 0x0329e, 0x032f0, 0x02025,
- 0x039c6, 0x00a57, 0x03e46, 0x00d42, 0x0738b, 0x05146, 0x04046, 0x08078,
- 0x0510e, 0x07886, 0x02904, 0x04156, 0x04157, 0x06032, 0x030d3, 0x08bce,
- 0x04040, 0x0403e, 0x0a414, 0x10457, 0x08075, 0x06887, 0x07c8f, 0x039c7,
- 0x07387, 0x08070, 0x08bcf, 0x1482a, 0x10456, 0x1482b, 0x01a17, 0x06886,
- 0x0450d, 0x00013, 0x0006b, 0x00615, 0x0080b, 0x0082b, 0x00952, 0x00e5b,
- 0x018e2, 0x0186c, 0x01f18, 0x0329f, 0x00d43, 0x03e29, 0x05140, 0x05141,
- 0x0ca62, 0x06033, 0x03c42, 0x03e28, 0x0450f, 0x0a21a, 0x07384, 0x0a219,
- 0x0e703, 0x0a21b, 0x01a14, 0x07383, 0x045e6, 0x0007a, 0x0012c, 0x00ccc,
- 0x0068f, 0x01802, 0x00a52, 0x00953, 0x04045, 0x01a20, 0x0451f, 0x000a4,
- 0x00735, 0x01cec, 0x02029, 0x020a3, 0x0451e, 0x00069, 0x00c24, 0x02024,
- 0x032f2, 0x05142, 0x00196, 0x00523, 0x000a6, 0x0197b, 0x0030b, 0x0092e,
- 0x003e9, 0x03e27, 0x00160, 0x05143, 0x00652, 0x04041, 0x00734, 0x028a7,
- 0x0080f, 0x01483, 0x0097c, 0x00340, 0x0068b, 0x00522, 0x01054, 0x01096,
- 0x01f17, 0x0202b, 0x01cea, 0x020a0, 0x02978, 0x02026, 0x0297a, 0x039cb,
- 0x03e2b, 0x0149f, 0x0329c, 0x07385, 0x08074, 0x0450e, 0x03e2a, 0x05149,
- 0x08076, 0x07386, 0x05148,
-};
-
-static const uint8_t coef1_huffbits[555] = {
- 9, 5, 2, 4, 4, 5, 5, 5,
- 6, 6, 6, 6, 6, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 8,
- 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8,
- 9, 8, 8, 8, 8, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 10, 10, 10, 9, 9, 9, 9,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 11, 11, 11, 11, 11, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 13, 12, 12, 12, 12, 12, 12, 12,
- 13, 12, 12, 12, 12, 12, 12, 12,
- 12, 13, 12, 12, 12, 13, 13, 13,
- 13, 12, 12, 12, 12, 12, 12, 13,
- 12, 13, 13, 13, 13, 13, 13, 13,
- 14, 14, 13, 13, 13, 13, 13, 13,
- 13, 12, 12, 12, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 14, 13, 14, 13, 13, 13,
- 13, 13, 14, 13, 14, 14, 13, 14,
- 14, 13, 14, 13, 13, 14, 14, 13,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 15, 14, 14, 14, 14, 15, 15,
- 15, 14, 14, 13, 13, 12, 12, 13,
- 13, 13, 14, 14, 15, 14, 15, 15,
- 14, 13, 14, 15, 15, 15, 14, 14,
- 14, 14, 15, 14, 14, 15, 15, 15,
- 14, 15, 14, 14, 14, 14, 14, 15,
- 15, 16, 15, 15, 15, 14, 15, 15,
- 15, 15, 14, 14, 16, 14, 15, 14,
- 14, 15, 15, 15, 15, 16, 15, 14,
- 15, 15, 15, 16, 15, 15, 14, 14,
- 14, 4, 7, 8, 8, 9, 9, 9,
- 9, 10, 10, 11, 11, 11, 11, 11,
- 11, 12, 11, 11, 11, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 11, 12,
- 12, 12, 13, 13, 13, 13, 13, 13,
- 13, 12, 12, 13, 13, 13, 13, 14,
- 14, 13, 14, 13, 13, 13, 14, 14,
- 15, 15, 14, 13, 13, 13, 14, 14,
- 15, 15, 15, 16, 14, 15, 17, 17,
- 15, 15, 15, 15, 15, 14, 16, 14,
- 16, 16, 16, 16, 16, 16, 15, 15,
- 17, 15, 16, 15, 6, 8, 10, 10,
- 10, 11, 11, 11, 12, 12, 13, 13,
- 13, 13, 14, 13, 14, 13, 14, 14,
- 14, 14, 14, 15, 15, 14, 14, 14,
- 14, 14, 14, 15, 15, 15, 15, 16,
- 15, 15, 16, 15, 15, 15, 14, 16,
- 15, 15, 18, 17, 16, 17, 15, 14,
- 15, 16, 16, 19, 17, 19, 16, 17,
- 15, 7, 10, 11, 12, 12, 12, 12,
- 13, 13, 13, 14, 15, 14, 15, 15,
- 16, 15, 14, 14, 15, 16, 15, 16,
- 16, 16, 16, 15, 15, 7, 11, 12,
- 13, 13, 14, 14, 15, 15, 15, 8,
- 11, 13, 14, 14, 15, 9, 12, 14,
- 14, 15, 9, 13, 10, 13, 10, 14,
- 10, 14, 11, 15, 11, 15, 11, 14,
- 12, 15, 12, 13, 13, 13, 13, 13,
- 13, 14, 13, 14, 14, 14, 14, 14,
- 14, 15, 14, 15, 16, 15, 14, 15,
- 16, 15, 15,
-};
-
-static const uint32_t coef2_huffcodes[1336] = {
- 0x003e6, 0x000f6, 0x00000, 0x00002, 0x00006, 0x0000f, 0x0001b, 0x00028,
- 0x00039, 0x0003f, 0x0006b, 0x00076, 0x000b7, 0x000e8, 0x000ef, 0x00169,
- 0x001a7, 0x001d4, 0x001dc, 0x002c4, 0x00349, 0x00355, 0x00391, 0x003dc,
- 0x00581, 0x005b2, 0x00698, 0x0070c, 0x00755, 0x0073a, 0x00774, 0x007cf,
- 0x00b0a, 0x00b66, 0x00d2e, 0x00d5e, 0x00e1b, 0x00eac, 0x00e5a, 0x00f7e,
- 0x00fa1, 0x0163e, 0x01a37, 0x01a52, 0x01c39, 0x01ab3, 0x01d5f, 0x01cb6,
- 0x01f52, 0x01dd9, 0x02c04, 0x02c2e, 0x02c2d, 0x02c23, 0x03467, 0x034a3,
- 0x0351b, 0x03501, 0x03a5d, 0x0351c, 0x03875, 0x03dea, 0x0397b, 0x039db,
- 0x03df1, 0x039d8, 0x03bb4, 0x0580a, 0x0584d, 0x05842, 0x05b13, 0x058ea,
- 0x0697d, 0x06a06, 0x068cc, 0x06ac7, 0x06a96, 0x072f4, 0x07543, 0x072b4,
- 0x07d20, 0x0b003, 0x073b5, 0x07be6, 0x0d180, 0x07bd1, 0x07cb8, 0x07d06,
- 0x07d25, 0x0d2f2, 0x0d19a, 0x0d334, 0x0e1dc, 0x0d529, 0x0d584, 0x0e1d2,
- 0x0e5e3, 0x0eec4, 0x0e564, 0x0fa49, 0x16001, 0x0eedc, 0x0f7fa, 0x1a32c,
- 0x16131, 0x16003, 0x0f9c8, 0x1ef80, 0x1d2a0, 0x1aa4b, 0x0f7ce, 0x1abfe,
- 0x1aa50, 0x1a458, 0x1a816, 0x1cae4, 0x1d2fe, 0x1d52e, 0x1aa4c, 0x2c245,
- 0x1d2a1, 0x1a35d, 0x1ca1b, 0x1d5d8, 0x1f531, 0x1ca1c, 0x1f389, 0x1f4af,
- 0x3a5e7, 0x351fb, 0x2c24b, 0x34bce, 0x2c24d, 0x2c249, 0x2c24a, 0x72dfc,
- 0x357ef, 0x35002, 0x3a5e6, 0x39431, 0x5843b, 0x34a77, 0x58431, 0x3a5f3,
- 0x3a5dd, 0x3e5e5, 0x356bd, 0x3976e, 0x6a3d2, 0x3500d, 0x694c4, 0x580bd,
- 0x3e5e8, 0x74b95, 0x34a6e, 0x3977c, 0x39432, 0x5b0d2, 0x6a3d8, 0x580b8,
- 0x5b0cb, 0x5b0d7, 0x72dee, 0x72ded, 0x72dec, 0x74b9c, 0x3977f, 0x72dea,
- 0x74b9e, 0x7be7d, 0x580bf, 0x5b0d5, 0x7cba8, 0x74b91, 0x3e5dd, 0xb6171,
- 0xd46b3, 0xd46b9, 0x7cba1, 0x74b9f, 0x72de1, 0xe59f5, 0x3e5eb, 0x00004,
- 0x00015, 0x00038, 0x00075, 0x000e8, 0x001d3, 0x00347, 0x0039c, 0x00690,
- 0x0074a, 0x00b60, 0x00e93, 0x00f74, 0x0163d, 0x01a5a, 0x01d24, 0x01cbe,
- 0x01f4b, 0x03468, 0x03562, 0x03947, 0x03e82, 0x05804, 0x05b12, 0x05803,
- 0x0696d, 0x06a9e, 0x0697c, 0x06978, 0x06afb, 0x074b2, 0x072f5, 0x073c0,
- 0x07541, 0x06944, 0x074b7, 0x070d3, 0x07ba9, 0x0b0b1, 0x0d1af, 0x0e1dd,
- 0x0e5e2, 0x0e1a3, 0x0eec3, 0x1612f, 0x0e961, 0x0eeda, 0x0e78e, 0x0fa48,
- 0x1612c, 0x0e511, 0x0e565, 0x0e953, 0x1aa4a, 0x0e59d, 0x1d52c, 0x1a811,
- 0x1cae7, 0x1abfc, 0x1d52d, 0x1cacf, 0x1cf05, 0x2c254, 0x34a72, 0x1f4ac,
- 0x3976b, 0x34a71, 0x2c6d9, 0x2d873, 0x34a6a, 0x357e7, 0x3464c, 0x3e5f5,
- 0x58433, 0x1f53a, 0x3500a, 0x357ea, 0x34a73, 0x3942f, 0x357e5, 0x39775,
- 0x694cd, 0x39772, 0x7cba5, 0x6a3ef, 0x35483, 0x74b98, 0x5b0c1, 0x39770,
- 0x3a5d7, 0x39433, 0x39434, 0x694ce, 0x580be, 0x3e5ff, 0x6a3ec, 0xb616f,
- 0xd46b1, 0x6a3d1, 0x72de5, 0x74b6e, 0x72de9, 0x3e700, 0xd46b6, 0x6a3e9,
- 0x74b69, 0xe5675, 0xd46b8, 0x7cbaa, 0x3a5d1, 0x0000c, 0x0003c, 0x000eb,
- 0x001f1, 0x003a4, 0x006a8, 0x007d5, 0x00d43, 0x00e77, 0x016c5, 0x01cb1,
- 0x02c5d, 0x03a55, 0x03a56, 0x03e51, 0x03bb5, 0x05b0a, 0x06a9f, 0x074b8,
- 0x07d28, 0x0d187, 0x0d40e, 0x0d52e, 0x0d425, 0x0eae3, 0x0e1d3, 0x1612e,
- 0x0e59e, 0x0eec2, 0x0e578, 0x0e51a, 0x0e579, 0x0e515, 0x0e960, 0x0d183,
- 0x0d220, 0x0d2cb, 0x0e512, 0x16c3e, 0x16002, 0x16c42, 0x1cae9, 0x3461a,
- 0x1d2fa, 0x1a308, 0x1a849, 0x1cf07, 0x1f38f, 0x34b65, 0x2c253, 0x1ef9e,
- 0x1cbc3, 0x1cbc1, 0x2c255, 0x1f384, 0x58435, 0x2c5cd, 0x3a5f7, 0x2c252,
- 0x3959c, 0x2c6d8, 0x3a5d3, 0x6ad78, 0x6a3f2, 0x7cba9, 0xb6176, 0x72deb,
- 0x39764, 0x3e5f6, 0x3a5d8, 0x74a8c, 0x6a3e6, 0x694d1, 0x6ad79, 0x1a4592,
- 0xe59fb, 0x7cbb3, 0x5b0cd, 0x00017, 0x000b5, 0x002c3, 0x005b7, 0x00b1c,
- 0x00e5c, 0x0163f, 0x01ab2, 0x01efa, 0x0348a, 0x0396e, 0x058da, 0x06963,
- 0x06a30, 0x072cd, 0x073cf, 0x07ce7, 0x0d2ca, 0x0d2d8, 0x0e764, 0x0e794,
- 0x16008, 0x16167, 0x1617e, 0x1aa49, 0x1a30b, 0x1a813, 0x2c6da, 0x1a580,
- 0x1cbc2, 0x0f9ca, 0x1617f, 0x1d2fe, 0x0f7fc, 0x16c40, 0x0e513, 0x0eec5,
- 0x0f7c3, 0x1d508, 0x1a81e, 0x1d2fd, 0x39430, 0x35486, 0x3e5fd, 0x2c24c,
- 0x2c75a, 0x34a74, 0x3a5f4, 0x3464d, 0x694ca, 0x3a5f1, 0x1d509, 0x1d5c0,
- 0x34648, 0x3464e, 0x6a3d5, 0x6a3e8, 0x6a3e7, 0x5b0c3, 0x2c248, 0x1f38a,
- 0x3a5f2, 0x6a3e5, 0x00029, 0x00168, 0x0058c, 0x00b67, 0x00f9d, 0x01c3d,
- 0x01cbf, 0x02c20, 0x0351d, 0x03df6, 0x06af9, 0x072b5, 0x0b1d7, 0x0b0b2,
- 0x0d40a, 0x0d52b, 0x0e952, 0x0e797, 0x163c3, 0x1c3a0, 0x1f386, 0x1ca21,
- 0x34655, 0x2c247, 0x1f53b, 0x2c250, 0x2c24f, 0x1f385, 0x1ef5d, 0x1cf15,
- 0x1caea, 0x1ab0a, 0x1cf19, 0x1f53d, 0x1d5c2, 0x1d2fb, 0x1ef58, 0x34a78,
- 0x357ec, 0x1f533, 0x3a5e1, 0x694d2, 0x58482, 0x3a5ee, 0x2c6dc, 0x357eb,
- 0x5b0c4, 0x39778, 0x6a3e1, 0x7cbb4, 0x3a5e1, 0x74b68, 0x3a5ef, 0x3a5d2,
- 0x39424, 0x72de2, 0xe59f6, 0xe59f7, 0x3e702, 0x3e5ec, 0x1f38b, 0x0003b,
- 0x001f0, 0x00777, 0x00fa8, 0x01cb2, 0x02d84, 0x03a57, 0x03dd6, 0x06917,
- 0x06a11, 0x07d07, 0x0eae2, 0x0e796, 0x0f9c9, 0x0f7fb, 0x16166, 0x16160,
- 0x1ab1b, 0x1abfa, 0x2d87b, 0x1d2f7, 0x39768, 0x1f38c, 0x34653, 0x34651,
- 0x6a3d9, 0x35001, 0x3abbd, 0x38742, 0x39426, 0x34a76, 0x3a5ec, 0x34a75,
- 0x35000, 0x35488, 0x1cf10, 0x2c6db, 0x357ed, 0x357e8, 0x357e9, 0x3a5f0,
- 0x694c2, 0xb6178, 0x72df5, 0x39425, 0x3942b, 0x74b6d, 0x74b6f, 0xb6177,
- 0xb6179, 0x74b6a, 0xb6172, 0x58487, 0x3e5ee, 0x3e5ed, 0x72df2, 0x72df4,
- 0x7cbae, 0x6a3ca, 0x70e86, 0x34bcf, 0x6a3c8, 0x00059, 0x00384, 0x00d5b,
- 0x01c38, 0x03560, 0x0395b, 0x0584e, 0x06964, 0x073cd, 0x0b1e7, 0x0e798,
- 0x0e78d, 0x0fa43, 0x1a848, 0x1a32f, 0x1aa4e, 0x3464a, 0x1f4ab, 0x1f38d,
- 0x3a5eb, 0x3a5d4, 0x3548a, 0x6a3c7, 0x5b0d0, 0x6a3c5, 0x7cbb0, 0x694cb,
- 0x3a5e5, 0x3e5e2, 0x3942c, 0x2d872, 0x1f4ae, 0x3a5d5, 0x694d3, 0x58481,
- 0x35009, 0x39774, 0x58432, 0xb616c, 0x5b0db, 0x3548b, 0xb6174, 0x1d5d95,
- 0xb004c, 0x7cbb2, 0x3a5e5, 0x74a8f, 0xe59f9, 0x72df6, 0xe59fd, 0x7cbad,
- 0xd427d, 0x72cff, 0x3977a, 0x5b0d9, 0xb616d, 0xb616b, 0x1a4593, 0x7cbaf,
- 0x5b0da, 0x00071, 0x003eb, 0x01603, 0x02c6c, 0x03961, 0x068c8, 0x06a31,
- 0x072bd, 0x0d2c2, 0x0e51b, 0x0e5e6, 0x1abfb, 0x1d2ff, 0x1cae5, 0x1ef5c,
- 0x1ef5e, 0x1cf13, 0x34a6d, 0x3976d, 0xb616a, 0x3e5f2, 0x6a3c4, 0xb6169,
- 0x3e5dc, 0x580b9, 0x74b99, 0x75764, 0x58434, 0x3a5d9, 0x6945a, 0x69459,
- 0x3548c, 0x3a5e9, 0x69457, 0x72df1, 0x6945e, 0x6a35e, 0x3e701, 0xb6168,
- 0x5b0dd, 0x3a5de, 0x6a3c2, 0xd4278, 0x6a3cc, 0x72dfd, 0xb6165, 0x16009a,
- 0x7cbb1, 0xd427c, 0xb6162, 0xe765e, 0x1cecbe, 0x7cbb6, 0x69454, 0xb6160,
- 0xd427a, 0x1d5d96, 0xb1d6d, 0xe59f4, 0x72de8, 0x3a5db, 0x0007a, 0x006ae,
- 0x01c3c, 0x03aba, 0x058e9, 0x072cc, 0x0d2dd, 0x0d22d, 0x0eec1, 0x0eedb,
- 0x1d2a2, 0x1ef5b, 0x357e2, 0x3abbf, 0x1d2f9, 0x35004, 0x3a5dc, 0x351fc,
- 0x3976c, 0x6a3c6, 0x6a3cb, 0x3e5ea, 0xe59f3, 0x6a3ce, 0x69452, 0xe59f0,
- 0x74b90, 0xd4279, 0xd427b, 0x7cbb5, 0x5b0c5, 0x3a5e3, 0x3a5e2, 0x000d0,
- 0x00775, 0x01efe, 0x03dd5, 0x0728c, 0x07cb9, 0x0e1a2, 0x0ea85, 0x0eed8,
- 0x1a30a, 0x1aa4f, 0x3a5df, 0x35008, 0x3a5e0, 0x3e5f4, 0x3e5f7, 0xb1d6c,
- 0x5843e, 0x34a70, 0x72df8, 0x74b6b, 0xd427f, 0x72df0, 0x5b0bf, 0x5b0c0,
- 0xd46b0, 0x72def, 0xe59f8, 0x162e64, 0xb1d6f, 0x3a5e0, 0x39427, 0x69166,
- 0x6a3e2, 0x6a3e3, 0x74a8d, 0xd427e, 0x1d5d97, 0xd46b4, 0x5b0d8, 0x6a3d3,
- 0x000e0, 0x00b63, 0x034cc, 0x06a33, 0x073c9, 0x0e1a0, 0x0f7fd, 0x0f9cc,
- 0x1617d, 0x1caeb, 0x1f4a9, 0x3abb3, 0x69450, 0x39420, 0x39777, 0x3e5e0,
- 0x6a3d4, 0x6a3ed, 0xb6166, 0xe59f1, 0xb1d6e, 0xe5676, 0x6a3ea, 0xe5674,
- 0xb6163, 0xd46b7, 0x7cba6, 0xd46ba, 0x1d5d94, 0xb6164, 0x6a3f1, 0x7cba2,
- 0x69451, 0x72dfa, 0xd46bb, 0x72df7, 0x74b94, 0x1cecbf, 0xe59fa, 0x16009b,
- 0x6a3e4, 0x000e6, 0x00e94, 0x03876, 0x070ef, 0x0d52a, 0x16015, 0x16014,
- 0x1abf9, 0x1cf17, 0x34a79, 0x34650, 0x3e705, 0x6a3d0, 0x58430, 0x74b9d,
- 0x7be7e, 0x5b0be, 0x39773, 0x6a3de, 0x000fb, 0x00f7b, 0x03dd7, 0x07bd0,
- 0x0e59c, 0x0f9cd, 0x1cf18, 0x1d2ff, 0x34a7a, 0x39429, 0x3500c, 0x72de0,
- 0x69456, 0x7be7c, 0xd46b5, 0xd46b2, 0x6a3dd, 0x001a2, 0x0163b, 0x06913,
- 0x0b016, 0x0fa42, 0x1a32d, 0x1cf06, 0x34a7c, 0x34a7d, 0xb6161, 0x35481,
- 0x3e5fa, 0x7cba0, 0x7be7f, 0x7cba3, 0x7cba7, 0x5b0d3, 0x72de6, 0x6a3dc,
- 0x001a9, 0x01ab4, 0x06a34, 0x0d46a, 0x16130, 0x1ef5f, 0x1f532, 0x1f536,
- 0x3942e, 0x58436, 0x6a3db, 0x6945b, 0x001c9, 0x01ca0, 0x0728b, 0x0eed9,
- 0x1f539, 0x1ca1d, 0x39765, 0x39766, 0x58439, 0x6945d, 0x39767, 0x001d3,
- 0x01f2c, 0x07bfc, 0x16161, 0x34652, 0x3a5ed, 0x3548d, 0x58438, 0x6a3da,
- 0x002c1, 0x02c5e, 0x0d335, 0x1ab1a, 0x2d874, 0x35006, 0x35484, 0x5b0cc,
- 0x74b9a, 0x72df3, 0x6a3d6, 0x002da, 0x034b3, 0x0d5ae, 0x1caee, 0x2d871,
- 0x357e3, 0x74b97, 0x72df9, 0x580ba, 0x5b0d4, 0x0034d, 0x0354e, 0x0f750,
- 0x1cbc0, 0x3a5e7, 0x3a5e4, 0x00385, 0x03a58, 0x16c41, 0x2c5cf, 0x3e5e1,
- 0x74b6c, 0xe5677, 0x6a3df, 0x00390, 0x03e50, 0x163c2, 0x2d876, 0x35482,
- 0x5b0d6, 0x5843a, 0x0039f, 0x0585e, 0x1a583, 0x3500f, 0x74b93, 0x39771,
- 0x003e4, 0x06912, 0x16c43, 0x357e1, 0x0058a, 0x0696f, 0x1f538, 0x5b0c9,
- 0x6a3cf, 0x005b6, 0x06af8, 0x1f534, 0x58483, 0x6a3e0, 0x00695, 0x07d02,
- 0x1cae8, 0x58485, 0x006a2, 0x0754a, 0x357ee, 0x3977b, 0x00748, 0x074b2,
- 0x34a7b, 0x00729, 0x0b1e0, 0x34649, 0x3e5e3, 0x0073d, 0x0d2c4, 0x3e5e6,
- 0x007bb, 0x0b099, 0x39762, 0x5b0ce, 0x6945f, 0x007d1, 0x0d5ab, 0x39779,
- 0x007d3, 0x0d52f, 0x39763, 0x6945c, 0x00b1a, 0x0d2c5, 0x35489, 0x00d23,
- 0x0eaed, 0x3e5f8, 0x00d32, 0x16016, 0x3e5fb, 0x00d41, 0x0e768, 0x3a5ed,
- 0x00e1f, 0x16017, 0x58027, 0x00ead, 0x0fa07, 0x69455, 0x00e54, 0x1612b,
- 0x00e55, 0x1a581, 0x00f78, 0x1a32b, 0x580bc, 0x6a3ee, 0x00f79, 0x1abfd,
- 0x00f95, 0x1ab18, 0x6a3f0, 0x01637, 0x1aa4d, 0x0162d, 0x1f53c, 0x6a3f3,
- 0x01a31, 0x1a810, 0x39769, 0x01a50, 0x1caef, 0x01a36, 0x1a32e, 0x01a67,
- 0x1f38e, 0x01a85, 0x1ef59, 0x01aa6, 0x1ef83, 0x01d51, 0x2c012, 0x01d53,
- 0x2d879, 0x01d5e, 0x35005, 0x01cba, 0x1cf04, 0x69453, 0x01d2d, 0x351ff,
- 0x01f2d, 0x2d86f, 0x01f29, 0x35007, 0x02c22, 0x351fa, 0x02c03, 0x3a5ec,
- 0x02c5f, 0x3a5eb, 0x02c58, 0x34a6b, 0x03469, 0x356be, 0x02c59, 0x34a6c,
- 0x0346a, 0x3a5ea, 0x034bd, 0x034bf, 0x356bf, 0x0386a, 0x03ab9, 0x5843f,
- 0x0386b, 0x3a5f5, 0x03a4b, 0x39421, 0x03aa4, 0x3a5e9, 0x03a5a, 0x03960,
- 0x3977e, 0x03de9, 0x03958, 0x03df7, 0x039e1, 0x3e5e4, 0x0395f, 0x69458,
- 0x03e91, 0x03df2, 0x39428, 0x058f2, 0x03e80, 0x6a3c3, 0x03e93, 0x694c0,
- 0x058b8, 0x5b0ca, 0x0584f, 0x694c1, 0x058f1, 0x068d6, 0x06a10, 0x06ac3,
- 0x06a32, 0x070d2, 0x06911, 0x074b1, 0x07494, 0x06ad4, 0x06ad6, 0x072b8,
- 0x06afa, 0x074b3, 0x07540, 0x073ce, 0x0b005, 0x074b3, 0x07495, 0x074b9,
- 0x0d336, 0x07bff, 0x07763, 0x073c8, 0x07d29, 0x0b622, 0x0d221, 0x0d181,
- 0x0b1d1, 0x074b8, 0x0b1d0, 0x0d19b, 0x0d2c3, 0x0b172, 0x0d2dc, 0x0b623,
- 0x0d5aa, 0x0d426, 0x0d182, 0x0e795, 0x0e1d1, 0x0d337, 0x0e96c, 0x0e5e4,
- 0x0e514, 0x0eaee, 0x16000, 0x0e767, 0x0e1a1, 0x0e78f, 0x16004, 0x0f7c2,
- 0x0e799, 0x0e5e7, 0x0e566, 0x0e769, 0x0f751, 0x0eede, 0x0fa06, 0x16005,
- 0x0fa9f, 0x1a5e6, 0x0e766, 0x1636f, 0x0eedd, 0x0eec0, 0x1a309, 0x1ceca,
- 0x163cd, 0x0f9cb, 0x0eedf, 0x1a582, 0x1612d, 0x0e5e5, 0x1abf8, 0x1a30c,
- 0x1ca1f, 0x163cc, 0x1a35c, 0x1ca1e, 0x1aa51, 0x163ac, 0x1a84e, 0x1a53f,
- 0x1cf16, 0x1d2fc, 0x1a5b3, 0x1ab19, 0x1a81f, 0x1d5c3, 0x16c3f, 0x1d5c1,
- 0x1d2fc, 0x1f4aa, 0x1a812, 0x1f535, 0x1cf12, 0x1a817, 0x1617c, 0x1ab0b,
- 0x1d2f8, 0x1ef82, 0x2d87a, 0x1d52f, 0x1f530, 0x1aa48, 0x35487, 0x1d2fd,
- 0x1f4ad, 0x1cf11, 0x3461b, 0x35485, 0x1ca20, 0x1caed, 0x1cae6, 0x1abff,
- 0x3464f, 0x34a6f, 0x1ef81, 0x3464b, 0x39d96, 0x1f383, 0x1f537, 0x1cf14,
- 0x2c5ce, 0x3500e, 0x2c251, 0x1caec, 0x1f387, 0x34654, 0x357e4, 0x2d878,
- 0x3500b, 0x35480, 0x3a5e8, 0x3548e, 0x34b64, 0x1f4a8, 0x35003, 0x3e5df,
- 0x2d870, 0x357e6, 0x3e5f0, 0x1ef5a, 0x3a5ea, 0x1f388, 0x3e703, 0x2c24e,
- 0x3a5e2, 0x351fd, 0x2c6dd, 0x3e704, 0x351fe, 0x2d875, 0x5b0c7, 0x3976a,
- 0x3a5e6, 0x39423, 0x58480, 0x2c246, 0x3a5e3, 0x2d877, 0x3e5f1, 0x3abbe,
- 0x58489, 0x3e5f9, 0x357e0, 0x3abbc, 0x5b0c6, 0x69167, 0x69165, 0x3e5e9,
- 0x39422, 0x3976f, 0x3977d, 0x3e5de, 0x6a3c9, 0x58b98, 0x3a5f6, 0x3a5d0,
- 0x58486, 0x6a3c1, 0x3e5fc, 0x5b0dc, 0x3548f, 0x3942d, 0x694c9, 0x58484,
- 0x3a5e8, 0x74b9b, 0x74b96, 0x694d0, 0x58488, 0x3a5e4, 0x3942a, 0x72ec2,
- 0x39776, 0x5b0d1, 0x5b0cf, 0x3a5d6, 0xe59fc, 0x5b0c8, 0x3e5e7, 0x7cbb7,
- 0x70e87, 0x7cbab, 0x5b0c2, 0x694c3, 0x74a8e, 0x3e5f3, 0x6a3cd, 0x72dfe,
- 0x73b2e, 0x72ec0, 0x694c5, 0x58437, 0x694c8, 0x72dff, 0x39435, 0x5843d,
- 0x6a3d7, 0x72ec1, 0xd22c8, 0x694cf, 0xb6173, 0x3e5fe, 0x580bb, 0xe59f2,
- 0xb616e, 0xb6175, 0x3a5da, 0x5b0bd, 0x694cc, 0x5843c, 0x694c7, 0x74b92,
- 0x72ec3, 0x694c6, 0xb6170, 0x7cbac, 0xb1733, 0x7cba4, 0xb6167, 0x72de7,
- 0x72de4, 0x6a3c0, 0x3e5ef, 0x162e65, 0x72de3, 0x72dfb, 0x6a35f, 0x6a3eb,
-};
-
-static const uint8_t coef2_huffbits[1336] = {
- 11, 9, 2, 3, 4, 4, 5, 6,
- 6, 7, 7, 8, 8, 8, 9, 9,
- 9, 9, 10, 10, 10, 10, 11, 11,
- 11, 11, 11, 11, 11, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 16, 15, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 18, 17, 17, 17, 17,
- 17, 17, 17, 18, 18, 17, 17, 18,
- 17, 17, 18, 17, 18, 18, 18, 18,
- 19, 18, 18, 18, 18, 18, 18, 20,
- 18, 18, 18, 19, 19, 18, 19, 18,
- 19, 19, 18, 19, 19, 18, 19, 19,
- 19, 19, 18, 19, 19, 19, 19, 19,
- 19, 19, 20, 20, 20, 19, 19, 20,
- 19, 20, 19, 19, 20, 19, 19, 20,
- 20, 20, 20, 19, 20, 21, 19, 3,
- 5, 7, 8, 9, 9, 10, 11, 11,
- 12, 12, 12, 13, 13, 13, 13, 14,
- 14, 14, 14, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 16, 16,
- 15, 15, 15, 15, 16, 16, 16, 16,
- 17, 16, 17, 17, 16, 17, 17, 17,
- 17, 17, 17, 16, 17, 17, 17, 17,
- 18, 17, 17, 18, 18, 18, 18, 18,
- 19, 18, 18, 18, 18, 18, 18, 19,
- 19, 18, 18, 18, 18, 19, 18, 19,
- 19, 19, 20, 19, 18, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 20,
- 20, 19, 20, 19, 20, 19, 20, 19,
- 19, 21, 20, 20, 19, 4, 7, 8,
- 10, 11, 11, 12, 12, 13, 13, 14,
- 14, 14, 14, 15, 15, 15, 15, 15,
- 16, 16, 16, 16, 16, 16, 16, 17,
- 17, 17, 17, 17, 17, 17, 16, 16,
- 16, 16, 17, 17, 17, 17, 18, 18,
- 18, 17, 17, 18, 18, 18, 18, 18,
- 18, 18, 18, 18, 19, 18, 18, 18,
- 19, 18, 19, 19, 19, 20, 20, 20,
- 19, 19, 19, 19, 19, 19, 19, 21,
- 21, 20, 19, 5, 8, 10, 11, 12,
- 13, 13, 13, 14, 14, 15, 15, 15,
- 15, 16, 16, 16, 16, 16, 17, 17,
- 17, 17, 17, 17, 17, 17, 18, 17,
- 18, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 19, 18, 19, 18,
- 18, 18, 18, 18, 19, 18, 17, 17,
- 18, 18, 19, 19, 19, 19, 18, 18,
- 18, 19, 6, 9, 11, 12, 13, 13,
- 14, 14, 14, 15, 15, 16, 16, 16,
- 16, 16, 16, 17, 17, 17, 18, 18,
- 18, 18, 18, 18, 18, 18, 18, 18,
- 18, 17, 18, 18, 17, 18, 18, 18,
- 18, 18, 18, 19, 19, 18, 18, 18,
- 19, 19, 19, 20, 19, 19, 18, 19,
- 19, 20, 21, 21, 19, 19, 18, 6,
- 10, 12, 13, 14, 14, 14, 15, 15,
- 15, 16, 16, 17, 17, 17, 17, 17,
- 17, 17, 18, 18, 19, 18, 18, 18,
- 19, 18, 18, 18, 19, 18, 18, 18,
- 18, 18, 18, 18, 18, 18, 18, 18,
- 19, 20, 20, 19, 19, 19, 19, 20,
- 20, 19, 20, 19, 19, 19, 20, 20,
- 20, 19, 19, 18, 19, 7, 10, 12,
- 13, 14, 15, 15, 15, 16, 16, 17,
- 17, 17, 17, 17, 17, 18, 18, 18,
- 18, 19, 18, 19, 19, 19, 20, 19,
- 18, 19, 19, 18, 18, 19, 19, 19,
- 18, 19, 19, 20, 19, 18, 20, 21,
- 20, 20, 19, 19, 21, 20, 21, 20,
- 20, 20, 19, 19, 20, 20, 21, 20,
- 19, 7, 11, 13, 14, 15, 15, 15,
- 16, 16, 17, 17, 17, 17, 18, 18,
- 18, 18, 18, 19, 20, 19, 19, 20,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 18, 18, 19, 20, 19, 19, 19, 20,
- 19, 19, 19, 20, 19, 20, 20, 21,
- 20, 20, 20, 21, 22, 20, 19, 20,
- 20, 21, 20, 21, 20, 19, 8, 11,
- 13, 14, 15, 16, 16, 16, 17, 17,
- 17, 18, 18, 18, 18, 18, 19, 18,
- 19, 19, 19, 19, 21, 19, 19, 21,
- 19, 20, 20, 20, 19, 18, 18, 8,
- 12, 14, 15, 16, 16, 16, 16, 17,
- 17, 17, 19, 18, 18, 19, 19, 20,
- 19, 18, 20, 19, 20, 20, 19, 19,
- 20, 20, 21, 21, 20, 19, 19, 19,
- 19, 19, 19, 20, 21, 20, 19, 19,
- 8, 12, 14, 15, 16, 16, 17, 17,
- 17, 18, 18, 18, 19, 19, 19, 19,
- 19, 19, 20, 21, 20, 21, 19, 21,
- 20, 20, 20, 20, 21, 20, 19, 20,
- 19, 20, 20, 20, 19, 22, 21, 21,
- 19, 9, 12, 14, 15, 16, 17, 17,
- 17, 18, 18, 18, 19, 19, 19, 19,
- 20, 19, 19, 19, 9, 13, 15, 16,
- 17, 17, 18, 18, 18, 19, 18, 20,
- 19, 20, 20, 20, 19, 9, 13, 15,
- 16, 17, 17, 18, 18, 18, 20, 18,
- 19, 20, 20, 20, 20, 19, 20, 19,
- 9, 13, 15, 16, 17, 18, 18, 18,
- 19, 19, 19, 19, 10, 14, 16, 17,
- 18, 18, 19, 19, 19, 19, 19, 10,
- 14, 16, 17, 18, 18, 18, 19, 19,
- 10, 14, 16, 17, 18, 18, 18, 19,
- 19, 20, 19, 10, 14, 16, 18, 18,
- 18, 19, 20, 19, 19, 10, 14, 17,
- 18, 18, 18, 10, 15, 17, 18, 19,
- 19, 21, 19, 11, 15, 17, 18, 18,
- 19, 19, 11, 15, 17, 18, 19, 19,
- 11, 15, 17, 18, 11, 15, 18, 19,
- 19, 11, 15, 18, 19, 19, 11, 16,
- 18, 19, 11, 15, 18, 19, 11, 16,
- 18, 12, 16, 18, 19, 12, 16, 19,
- 12, 16, 19, 19, 19, 12, 16, 19,
- 12, 16, 19, 19, 12, 16, 18, 12,
- 16, 19, 12, 17, 19, 12, 17, 19,
- 12, 17, 19, 12, 17, 19, 13, 17,
- 13, 17, 13, 17, 19, 19, 13, 17,
- 13, 17, 19, 13, 17, 13, 18, 19,
- 13, 17, 19, 13, 18, 13, 17, 13,
- 18, 13, 18, 13, 18, 13, 18, 13,
- 18, 13, 18, 14, 18, 19, 14, 18,
- 14, 18, 14, 18, 14, 18, 14, 19,
- 14, 19, 14, 18, 14, 18, 14, 18,
- 14, 19, 14, 14, 18, 14, 14, 19,
- 14, 18, 14, 19, 14, 19, 14, 15,
- 19, 15, 15, 15, 15, 19, 15, 19,
- 15, 15, 19, 15, 15, 19, 15, 19,
- 15, 19, 15, 19, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 16,
- 15, 15, 15, 16, 16, 16, 15, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 17, 16, 16, 16, 17,
- 17, 16, 17, 17, 16, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 18,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 18, 17, 17, 18, 17, 17, 17, 17,
- 18, 18, 17, 17, 17, 17, 17, 17,
- 17, 18, 17, 18, 18, 17, 17, 17,
- 18, 18, 18, 17, 18, 17, 18, 18,
- 18, 18, 18, 18, 18, 18, 18, 17,
- 18, 18, 18, 18, 19, 18, 18, 18,
- 18, 18, 18, 18, 18, 18, 18, 18,
- 18, 18, 18, 18, 18, 18, 18, 19,
- 18, 18, 19, 18, 18, 18, 19, 18,
- 19, 18, 18, 19, 18, 18, 19, 19,
- 19, 19, 19, 18, 19, 18, 19, 18,
- 19, 19, 18, 18, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 18, 19,
- 19, 19, 19, 19, 18, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 20,
- 19, 19, 19, 19, 21, 19, 19, 20,
- 19, 20, 19, 19, 19, 19, 19, 20,
- 20, 20, 19, 19, 19, 20, 19, 19,
- 19, 20, 20, 19, 20, 19, 19, 21,
- 20, 20, 19, 19, 19, 19, 19, 19,
- 20, 19, 20, 20, 20, 20, 20, 20,
- 20, 19, 19, 21, 20, 20, 19, 19,
-};
-
-static const uint32_t coef3_huffcodes[1072] = {
- 0x001b2, 0x00069, 0x00000, 0x00004, 0x00006, 0x0000e, 0x00014, 0x00019,
- 0x00016, 0x0002b, 0x00030, 0x0003d, 0x0003c, 0x0005a, 0x0005f, 0x0006d,
- 0x0007e, 0x0005f, 0x0007f, 0x000b6, 0x000bc, 0x000d8, 0x000f2, 0x000fe,
- 0x000bc, 0x000fc, 0x00161, 0x0016e, 0x00174, 0x00176, 0x001a2, 0x001e3,
- 0x001f3, 0x00174, 0x0017a, 0x001ea, 0x002a8, 0x002c4, 0x002e6, 0x00314,
- 0x00346, 0x00367, 0x003e9, 0x002e5, 0x002ee, 0x003d6, 0x00555, 0x00554,
- 0x00557, 0x005c3, 0x005d6, 0x006e0, 0x0062f, 0x006e2, 0x00799, 0x00789,
- 0x007fa, 0x005ce, 0x007fe, 0x005ec, 0x007cc, 0x007af, 0x00aa7, 0x00b19,
- 0x00b94, 0x00b85, 0x00b9f, 0x00c48, 0x00c45, 0x00dd8, 0x00c4c, 0x00c4b,
- 0x00d99, 0x00d1f, 0x00dc2, 0x00f95, 0x00fa2, 0x00bb5, 0x00b9f, 0x00f5d,
- 0x00bbf, 0x00f47, 0x0154a, 0x00fd5, 0x00f45, 0x00f7f, 0x0160d, 0x01889,
- 0x01757, 0x01722, 0x018b3, 0x0172d, 0x01a39, 0x01a18, 0x01bb3, 0x01b30,
- 0x01e63, 0x0173c, 0x01b35, 0x01723, 0x01e80, 0x01fee, 0x01761, 0x01ffc,
- 0x01f7f, 0x02c7c, 0x01fa1, 0x0177b, 0x01755, 0x0175a, 0x01fa6, 0x02eab,
- 0x0310a, 0x02c69, 0x03669, 0x03127, 0x03103, 0x02e43, 0x03662, 0x03165,
- 0x03124, 0x0313b, 0x03111, 0x03668, 0x0343b, 0x03c52, 0x03efc, 0x02e6c,
- 0x03fda, 0x03ef8, 0x02e7b, 0x03ee2, 0x03cc5, 0x03d72, 0x058c0, 0x03df8,
- 0x02ea9, 0x03e7e, 0x0556d, 0x05c82, 0x03d71, 0x03e7b, 0x03c42, 0x058d7,
- 0x03f4e, 0x06200, 0x03d70, 0x05cb2, 0x05c96, 0x05cb0, 0x03f45, 0x05cb1,
- 0x02e6d, 0x03110, 0x02f68, 0x05c90, 0x07ca6, 0x07c88, 0x06204, 0x062c8,
- 0x078a6, 0x07986, 0x079d5, 0x0b1ad, 0x07989, 0x0b079, 0x05cdd, 0x0aad4,
- 0x05de8, 0x07dcd, 0x07987, 0x05d67, 0x05d99, 0x0b91d, 0x07cf1, 0x05d9b,
- 0x079d7, 0x0b07b, 0x05c85, 0x05d9a, 0x07dcc, 0x07ebf, 0x07dce, 0x07dfb,
- 0x07ec0, 0x07d1a, 0x07a07, 0x05c84, 0x0c471, 0x07cf2, 0x0baef, 0x0b9d2,
- 0x05deb, 0x07bd6, 0x0b845, 0x05d98, 0x0b91a, 0x0bae8, 0x0c4e0, 0x0dc31,
- 0x0f93d, 0x0bbce, 0x0d1d2, 0x0f7a9, 0x0d9b9, 0x0bbcb, 0x0b900, 0x0aad7,
- 0x0babd, 0x0c4e1, 0x0f46f, 0x0c588, 0x0c58b, 0x160e6, 0x0bbcf, 0x0bac3,
- 0x0f945, 0x0f7a3, 0x0d1c1, 0x0fb8e, 0x0f7a4, 0x0fb8c, 0x0f40c, 0x0c473,
- 0x0fd72, 0x0bbcd, 0x0fffa, 0x0f940, 0x0bbc9, 0x0f7a8, 0x1a1ed, 0x0bbc5,
- 0x1f26f, 0x163fd, 0x160c7, 0x1a1f5, 0x0f947, 0x163fc, 0x154b3, 0x0fff6,
- 0x163f6, 0x160e9, 0x1a1f0, 0x0bab9, 0x0baba, 0x17086, 0x0b903, 0x0fd75,
- 0x0f308, 0x176f3, 0x163ff, 0x0fd7d, 0x1bb78, 0x163fb, 0x188db, 0x1a1f7,
- 0x154b2, 0x172fd, 0x163f4, 0x1bb73, 0x172ff, 0x0babc, 0x0f97d, 0x1a1f3,
- 0x1bb6d, 0x1ffd5, 0x1a1f4, 0x1f272, 0x17380, 0x17382, 0x1ffe7, 0x0bac8,
- 0x0bbc4, 0x188d3, 0x160e0, 0x0fd7b, 0x1725f, 0x172f5, 0x1bb79, 0x1fad9,
- 0x1f269, 0x188d0, 0x0bac4, 0x0bac5, 0x31185, 0x188d2, 0x188cc, 0x31187,
- 0x3e7fe, 0x188d1, 0x1bb6c, 0x1f268, 0x1fad2, 0x1ffd9, 0x1a1ea, 0x1bb68,
- 0x1facb, 0x3fdb2, 0x1e81a, 0x188ce, 0x172fb, 0x1a1ef, 0x1face, 0x1bb70,
- 0x0bac1, 0x1bb6b, 0x172f8, 0x1bb66, 0x1ffdf, 0x1bb6a, 0x1ffd7, 0x1f266,
- 0x176f8, 0x37653, 0x1fa7e, 0x31182, 0x1fac8, 0x2c7e3, 0x370ee, 0x176ec,
- 0x176e9, 0x2e4bc, 0x160c5, 0x3765a, 0x3ce9c, 0x17373, 0x176e8, 0x188d4,
- 0x176f1, 0x176ef, 0x37659, 0x1bb7c, 0x1ffde, 0x176f2, 0x3118b, 0x2c7d4,
- 0x37651, 0x5ce9f, 0x37650, 0x31191, 0x3f4f6, 0x3f4f5, 0x7a06c, 0x1fac1,
- 0x5c97b, 0x2c7e0, 0x79d3a, 0x3e7fd, 0x2c7df, 0x3f4f0, 0x7a06d, 0x376c1,
- 0x79d3b, 0x00004, 0x00014, 0x00059, 0x000ab, 0x000b8, 0x00177, 0x001f5,
- 0x001f2, 0x00315, 0x003fc, 0x005bd, 0x0062d, 0x006e8, 0x007dd, 0x00b04,
- 0x007cd, 0x00b1e, 0x00d1e, 0x00f15, 0x00f3b, 0x00f41, 0x01548, 0x018b0,
- 0x0173b, 0x01884, 0x01a1c, 0x01bb4, 0x01f25, 0x017b5, 0x0176d, 0x01ef8,
- 0x02e73, 0x03107, 0x03125, 0x03105, 0x02e49, 0x03ce8, 0x03ef9, 0x03e5e,
- 0x02e72, 0x03471, 0x03fd9, 0x0623f, 0x078a0, 0x06867, 0x05cb3, 0x06272,
- 0x068ec, 0x06e9a, 0x079d4, 0x06e98, 0x0b1aa, 0x06e1a, 0x07985, 0x068ee,
- 0x06e9b, 0x05c88, 0x0b1ac, 0x07dfa, 0x05d65, 0x07cf0, 0x07cbf, 0x0c475,
- 0x160eb, 0x1bb7e, 0x0f7a6, 0x1fedd, 0x160e3, 0x0fffb, 0x0fb8d, 0x0fff9,
- 0x0d1c0, 0x0c58c, 0x1a1e9, 0x0bab8, 0x0f5cf, 0x0fff5, 0x376c5, 0x1a1ec,
- 0x160ed, 0x1fede, 0x1fac9, 0x1a1eb, 0x1f224, 0x176ee, 0x0fd79, 0x17080,
- 0x17387, 0x1bb7a, 0x1ffe9, 0x176f7, 0x17385, 0x17781, 0x2c7d5, 0x17785,
- 0x1ffe3, 0x163f5, 0x1fac2, 0x3e7f9, 0x3118d, 0x3fdb1, 0x1ffe2, 0x1f226,
- 0x3118a, 0x2c7d9, 0x31190, 0x3118c, 0x3f4f3, 0x1bb7f, 0x1bb72, 0x31184,
- 0xb92f4, 0x3e7fb, 0x6e1d9, 0x1faca, 0x62300, 0x3fdb8, 0x3d037, 0x3e7fc,
- 0x62301, 0x3f4f2, 0x1f26a, 0x0000e, 0x00063, 0x000f8, 0x001ee, 0x00377,
- 0x003f7, 0x006e3, 0x005cc, 0x00b05, 0x00dd2, 0x00fd4, 0x0172e, 0x0172a,
- 0x01e23, 0x01f2d, 0x01763, 0x01769, 0x0176c, 0x02e75, 0x03104, 0x02ec1,
- 0x03e58, 0x0583f, 0x03f62, 0x03f44, 0x058c5, 0x0623c, 0x05cf4, 0x07bd7,
- 0x05d9d, 0x0aad2, 0x05d66, 0x0b1a9, 0x0b078, 0x07cfe, 0x0b918, 0x0c46f,
- 0x0b919, 0x0b847, 0x06e1b, 0x0b84b, 0x0aad8, 0x0fd74, 0x172f4, 0x17081,
- 0x0f97c, 0x1f273, 0x0f7a0, 0x0fd7c, 0x172f7, 0x0fd7a, 0x1bb77, 0x172fe,
- 0x1f270, 0x0fd73, 0x1bb7b, 0x1a1bc, 0x1bb7d, 0x0bbc3, 0x172f6, 0x0baeb,
- 0x0fb8f, 0x3f4f4, 0x3fdb4, 0x376c8, 0x3e7fa, 0x1ffd0, 0x62303, 0xb92f5,
- 0x1f261, 0x31189, 0x3fdb5, 0x2c7db, 0x376c9, 0x1fad6, 0x1fad1, 0x00015,
- 0x000f0, 0x002e0, 0x0058e, 0x005d7, 0x00c4d, 0x00fa1, 0x00bdb, 0x01756,
- 0x01f70, 0x02c19, 0x0313c, 0x0370f, 0x03cc0, 0x02ea8, 0x058c6, 0x058c7,
- 0x02eb7, 0x058d0, 0x07d18, 0x0aa58, 0x0b848, 0x05d9e, 0x05d6c, 0x0b84c,
- 0x0c589, 0x0b901, 0x163f8, 0x0bac9, 0x0b9c5, 0x0f93c, 0x188d8, 0x0bbc7,
- 0x160ec, 0x0fd6f, 0x188d9, 0x160ea, 0x0f7a7, 0x0f944, 0x0baab, 0x0dc3a,
- 0x188cf, 0x176fb, 0x2c7d8, 0x2c7d7, 0x1bb75, 0x5ce9e, 0x62302, 0x370ed,
- 0x176f4, 0x1ffd1, 0x370ef, 0x3f4f8, 0x376c7, 0x1ffe1, 0x376c6, 0x176ff,
- 0x6e1d8, 0x176f6, 0x17087, 0x0f5cd, 0x00035, 0x001a0, 0x0058b, 0x00aac,
- 0x00b9a, 0x0175f, 0x01e22, 0x01e8c, 0x01fb2, 0x0310b, 0x058d1, 0x0552e,
- 0x05c27, 0x0686e, 0x07ca7, 0x0c474, 0x0dc33, 0x07bf2, 0x05de9, 0x07a35,
- 0x0baaa, 0x0b9eb, 0x0fb95, 0x0b9b8, 0x17381, 0x1f262, 0x188cd, 0x17088,
- 0x172fa, 0x0f7a2, 0x1fad3, 0x0bac0, 0x3765c, 0x1fedf, 0x1f225, 0x1fad4,
- 0x2c7da, 0x5ce9d, 0x3e7f8, 0x1e203, 0x188d7, 0x00054, 0x002c0, 0x007a1,
- 0x00f78, 0x01b36, 0x01fa3, 0x0313a, 0x03436, 0x0343a, 0x07d1d, 0x07bd8,
- 0x05cdf, 0x0b846, 0x0b189, 0x0d9b8, 0x0fff8, 0x0d9be, 0x0c58a, 0x05dea,
- 0x0d1d3, 0x160e4, 0x1f26b, 0x188da, 0x1e202, 0x2c7d2, 0x163fe, 0x31193,
- 0x17782, 0x376c2, 0x2c7d1, 0x3fdb0, 0x3765d, 0x2c7d0, 0x1fad0, 0x1e201,
- 0x188dd, 0x2c7e2, 0x37657, 0x37655, 0x376c4, 0x376c0, 0x176ea, 0x0006f,
- 0x003cf, 0x00dd5, 0x01f23, 0x02c61, 0x02ed0, 0x05d54, 0x0552d, 0x07883,
- 0x0b1a8, 0x0b91c, 0x0babf, 0x0b902, 0x0f7aa, 0x0f7a5, 0x1a1e8, 0x1ffd6,
- 0x0babe, 0x1a1bf, 0x163f3, 0x1ffd8, 0x1fad7, 0x1f275, 0x1ffdc, 0x0007d,
- 0x005bc, 0x01549, 0x02a99, 0x03def, 0x06273, 0x079d6, 0x07d1b, 0x0aad3,
- 0x0d0fc, 0x2c7dd, 0x188d6, 0x0bac2, 0x2c7e1, 0x1bb76, 0x1a1bd, 0x31186,
- 0x0fd78, 0x1a1be, 0x31183, 0x3fdb6, 0x3f4f1, 0x37652, 0x1fad5, 0x3f4f9,
- 0x3e7ff, 0x5ce9c, 0x3765b, 0x31188, 0x17372, 0x000bd, 0x0078b, 0x01f21,
- 0x03c43, 0x03ded, 0x0aad6, 0x07ec1, 0x0f942, 0x05c86, 0x17089, 0x0babb,
- 0x1ffe8, 0x2c7de, 0x1f26e, 0x1fac4, 0x3f4f7, 0x37656, 0x1fa7d, 0x376c3,
- 0x3fdb3, 0x3118f, 0x1fac6, 0x000f8, 0x007ed, 0x01efd, 0x03e7a, 0x05c91,
- 0x0aad9, 0x0baec, 0x0dc32, 0x0f46e, 0x1e200, 0x176fa, 0x3765e, 0x3fdb7,
- 0x2c7d6, 0x3fdb9, 0x37654, 0x37658, 0x3118e, 0x1ffdb, 0x000f6, 0x00c43,
- 0x03106, 0x068ef, 0x0b84d, 0x0b188, 0x0bbcc, 0x1f264, 0x1bb69, 0x17386,
- 0x1fac0, 0x00171, 0x00f39, 0x03e41, 0x068ed, 0x0d9bc, 0x0f7a1, 0x1bb67,
- 0x1ffdd, 0x176f9, 0x001b9, 0x00f7d, 0x03f63, 0x0d0fd, 0x0b9ea, 0x188dc,
- 0x1fac3, 0x1a1f2, 0x31192, 0x1ffe4, 0x001f6, 0x01754, 0x06865, 0x0f309,
- 0x160e5, 0x176f5, 0x3765f, 0x1facc, 0x001e9, 0x01a1a, 0x06201, 0x0f105,
- 0x176f0, 0x002df, 0x01756, 0x05d6d, 0x163fa, 0x176ed, 0x00342, 0x02e40,
- 0x0d0ff, 0x17082, 0x003cd, 0x02a98, 0x0fffc, 0x2c7dc, 0x1fa7f, 0x003fe,
- 0x03764, 0x0fffd, 0x176fc, 0x1fac5, 0x002f7, 0x02ed1, 0x0fb97, 0x0058a,
- 0x02edc, 0x0bbc8, 0x005d4, 0x0623d, 0x160e8, 0x0062e, 0x05830, 0x163f9,
- 0x006eb, 0x06205, 0x1f274, 0x007de, 0x062c9, 0x1f265, 0x005c9, 0x05cde,
- 0x1ffd3, 0x005d4, 0x07988, 0x007ce, 0x0b849, 0x00b1b, 0x05c89, 0x1fac7,
- 0x00b93, 0x05c83, 0x00b9e, 0x0f14f, 0x00c4a, 0x0b9c7, 0x00dd4, 0x0c470,
- 0x1f271, 0x00f38, 0x0fb96, 0x176eb, 0x00fa0, 0x163f7, 0x00bb2, 0x0b91b,
- 0x00bbe, 0x0f102, 0x00f44, 0x0f946, 0x1facd, 0x00f79, 0x0d9bd, 0x0154d,
- 0x0bbc6, 0x00fd2, 0x160e7, 0x0172b, 0x188cb, 0x0175e, 0x0fd76, 0x0175c,
- 0x1bb71, 0x0189f, 0x1a1ee, 0x01f24, 0x1a1f6, 0x01ba7, 0x0bbca, 0x01f7d,
- 0x0ffff, 0x01f2e, 0x1bb65, 0x01bb5, 0x172f9, 0x01fef, 0x1f26c, 0x01f3e,
- 0x0fd77, 0x01762, 0x1bb6e, 0x01ef9, 0x172fc, 0x01fa0, 0x02ab7, 0x02e4a,
- 0x1f267, 0x01fb3, 0x1ffda, 0x02e42, 0x03101, 0x17780, 0x0313d, 0x03475,
- 0x17784, 0x03126, 0x1facf, 0x03c51, 0x17783, 0x03e40, 0x1ffe5, 0x03663,
- 0x1ffe0, 0x03e8f, 0x1f26d, 0x0343c, 0x03cc1, 0x176fd, 0x03e45, 0x02ec0,
- 0x03f61, 0x03dee, 0x03fd8, 0x0583e, 0x02e45, 0x03e59, 0x03d02, 0x05ce8,
- 0x05568, 0x176fe, 0x02f69, 0x1fad8, 0x058c1, 0x05c83, 0x1ffe6, 0x06271,
- 0x06e1c, 0x062c7, 0x068e1, 0x0552f, 0x06864, 0x06866, 0x06e99, 0x05cbc,
- 0x07ca5, 0x078a1, 0x05c82, 0x07dcf, 0x0623b, 0x0623e, 0x068e8, 0x07a36,
- 0x05d9c, 0x0b077, 0x07cf3, 0x07a34, 0x07ca4, 0x07d19, 0x079d2, 0x07d1c,
- 0x07bd9, 0x0b84a, 0x0fb94, 0x0aad5, 0x0dc30, 0x07bf3, 0x0baee, 0x0b07a,
- 0x0c472, 0x0b91e, 0x0d9ba, 0x05d9f, 0x0d0fe, 0x0b9c6, 0x05c87, 0x0f14e,
- 0x0baed, 0x0b92e, 0x0f103, 0x0b9c4, 0x0fb91, 0x0d9bb, 0x0b1ab, 0x0c58d,
- 0x0fffe, 0x0f93b, 0x0f941, 0x0baea, 0x0b91f, 0x0f5cc, 0x0d9bf, 0x0f943,
- 0x0f104, 0x1f260, 0x0fb92, 0x0f93f, 0x0f3a6, 0x0bac7, 0x0f7ab, 0x0bac6,
- 0x17383, 0x0fd6d, 0x0bae9, 0x0fd6e, 0x1e74f, 0x188ca, 0x1f227, 0x0fb93,
- 0x0fb90, 0x0fff7, 0x17085, 0x17083, 0x160e1, 0x17084, 0x0f93e, 0x160e2,
- 0x160c6, 0x1a1f1, 0x1bb6f, 0x17384, 0x0fd70, 0x1f263, 0x188d5, 0x173a6,
- 0x0f5ce, 0x163f2, 0x0fd71, 0x1ffd2, 0x160c4, 0x1ffd4, 0x2c7d3, 0x1bb74,
-};
-
-static const uint8_t coef3_huffbits[1072] = {
- 9, 7, 2, 3, 4, 4, 5, 5,
- 6, 6, 6, 6, 7, 7, 7, 7,
- 7, 8, 8, 8, 8, 8, 8, 8,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 12, 11, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 14, 13, 14, 14, 13, 14, 13,
- 13, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 15,
- 14, 14, 15, 14, 14, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 14, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 14, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 16, 15, 16, 16, 16,
- 16, 15, 15, 16, 16, 16, 16, 16,
- 15, 16, 16, 16, 15, 16, 15, 15,
- 16, 15, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 17, 16, 17, 16, 17, 17, 16,
- 17, 16, 17, 16, 16, 17, 17, 17,
- 16, 17, 16, 16, 17, 16, 17, 16,
- 17, 17, 16, 16, 17, 17, 17, 17,
- 17, 17, 17, 17, 16, 17, 17, 16,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 16, 18, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 16, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 18,
- 17, 17, 17, 17, 18, 17, 17, 18,
- 19, 17, 17, 17, 18, 17, 17, 17,
- 18, 18, 18, 17, 17, 17, 18, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 18, 18, 18, 18, 18, 18, 18, 18,
- 18, 18, 17, 18, 18, 18, 18, 17,
- 18, 18, 18, 17, 17, 18, 18, 18,
- 18, 19, 18, 18, 19, 19, 20, 18,
- 19, 18, 19, 19, 18, 19, 20, 18,
- 19, 4, 6, 7, 8, 9, 9, 9,
- 10, 10, 10, 11, 11, 11, 11, 12,
- 12, 12, 12, 12, 12, 13, 13, 13,
- 13, 13, 13, 13, 13, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 16, 15, 15, 15,
- 15, 16, 16, 15, 16, 16, 15, 16,
- 17, 17, 17, 17, 17, 16, 16, 16,
- 16, 16, 17, 17, 17, 16, 18, 17,
- 17, 17, 18, 17, 17, 18, 17, 17,
- 17, 17, 17, 18, 17, 18, 18, 18,
- 17, 17, 18, 19, 18, 18, 17, 17,
- 18, 18, 18, 18, 19, 17, 17, 18,
- 20, 19, 19, 18, 19, 18, 19, 19,
- 19, 19, 17, 5, 7, 9, 10, 10,
- 11, 11, 12, 12, 12, 13, 13, 13,
- 13, 13, 14, 14, 14, 14, 14, 15,
- 14, 15, 15, 15, 15, 15, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 15, 16, 16, 17, 17, 17,
- 16, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 16,
- 16, 19, 18, 18, 19, 17, 19, 20,
- 17, 18, 18, 18, 18, 18, 18, 6,
- 8, 10, 11, 12, 12, 12, 13, 13,
- 13, 14, 14, 14, 14, 15, 15, 15,
- 15, 15, 15, 16, 16, 16, 16, 16,
- 16, 17, 17, 17, 16, 16, 17, 17,
- 17, 17, 17, 17, 17, 16, 16, 16,
- 17, 18, 18, 18, 17, 19, 19, 18,
- 18, 17, 18, 19, 18, 17, 18, 18,
- 19, 18, 17, 17, 6, 9, 11, 12,
- 13, 13, 13, 14, 14, 14, 15, 15,
- 15, 15, 15, 16, 16, 16, 16, 16,
- 16, 17, 16, 17, 17, 17, 17, 17,
- 17, 17, 18, 17, 18, 17, 17, 18,
- 18, 19, 19, 17, 17, 7, 10, 12,
- 13, 13, 14, 14, 14, 14, 15, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 17, 17, 17, 17, 18, 17, 18,
- 18, 18, 18, 18, 18, 18, 18, 17,
- 17, 18, 18, 18, 18, 18, 18, 7,
- 10, 12, 13, 14, 15, 15, 15, 15,
- 16, 16, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 18, 17, 17, 8,
- 11, 13, 14, 15, 15, 15, 15, 16,
- 16, 18, 17, 17, 18, 17, 17, 18,
- 17, 17, 18, 18, 19, 18, 18, 19,
- 19, 19, 18, 18, 18, 8, 11, 13,
- 14, 15, 16, 16, 16, 16, 17, 17,
- 17, 18, 17, 18, 19, 18, 18, 18,
- 18, 18, 18, 8, 12, 14, 15, 15,
- 16, 16, 16, 17, 17, 18, 18, 18,
- 18, 18, 18, 18, 18, 17, 9, 12,
- 14, 15, 16, 16, 17, 17, 17, 17,
- 18, 9, 12, 14, 15, 16, 17, 17,
- 17, 18, 9, 13, 15, 16, 17, 17,
- 18, 17, 18, 17, 9, 13, 15, 16,
- 17, 18, 18, 18, 10, 13, 15, 16,
- 18, 10, 14, 16, 17, 18, 10, 14,
- 16, 17, 10, 14, 16, 18, 18, 10,
- 14, 16, 18, 18, 11, 15, 16, 11,
- 15, 17, 11, 15, 17, 11, 15, 17,
- 11, 15, 17, 11, 15, 17, 12, 16,
- 17, 12, 15, 12, 16, 12, 16, 18,
- 12, 16, 12, 16, 12, 16, 12, 16,
- 17, 12, 16, 18, 12, 17, 13, 16,
- 13, 16, 13, 16, 18, 13, 16, 13,
- 17, 13, 17, 13, 17, 13, 17, 13,
- 17, 13, 17, 13, 17, 13, 17, 13,
- 16, 13, 17, 13, 17, 13, 17, 14,
- 17, 14, 17, 14, 17, 14, 14, 14,
- 17, 14, 17, 14, 14, 18, 14, 14,
- 18, 14, 18, 14, 18, 14, 17, 14,
- 17, 14, 17, 14, 14, 18, 14, 15,
- 15, 15, 14, 15, 15, 14, 15, 15,
- 15, 18, 15, 18, 15, 15, 17, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 16, 15, 15, 15, 15, 16,
- 16, 16, 16, 16, 15, 15, 15, 15,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 17, 16, 16,
- 16, 17, 16, 16, 16, 17, 17, 17,
- 17, 17, 16, 17, 17, 17, 17, 16,
- 16, 16, 17, 17, 17, 17, 16, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 18, 17,
-};
-
-static const uint32_t coef4_huffcodes[476] = {
- 0x00f01, 0x0001e, 0x00000, 0x00004, 0x00006, 0x0000d, 0x0000a, 0x00017,
- 0x0001d, 0x00017, 0x0002c, 0x00031, 0x00039, 0x0003e, 0x00039, 0x0005a,
- 0x00066, 0x00070, 0x0007b, 0x00070, 0x00077, 0x000af, 0x000c9, 0x000f2,
- 0x000f4, 0x000b2, 0x000e3, 0x0015b, 0x0015d, 0x00181, 0x0019d, 0x001e3,
- 0x001c5, 0x002b5, 0x002db, 0x00338, 0x003c3, 0x003cc, 0x003f0, 0x002cd,
- 0x003fa, 0x003a1, 0x005b4, 0x00657, 0x007ab, 0x0074d, 0x0074c, 0x00ac1,
- 0x00ac5, 0x0076b, 0x00ca8, 0x00f04, 0x00f00, 0x00fe3, 0x00f3c, 0x00f10,
- 0x00f39, 0x00fe6, 0x00e26, 0x00e90, 0x016c5, 0x01827, 0x01954, 0x015c5,
- 0x01958, 0x01f8a, 0x01c4a, 0x02b0f, 0x02b41, 0x02b0e, 0x033c6, 0x03050,
- 0x01c4f, 0x02d88, 0x0305c, 0x03c18, 0x02b4f, 0x02cc2, 0x03a47, 0x05680,
- 0x0569d, 0x06442, 0x06443, 0x06446, 0x0656e, 0x06444, 0x07120, 0x0748a,
- 0x0c1ba, 0x07e22, 0x07aa6, 0x07f25, 0x07aa7, 0x07e20, 0x0c11b, 0x0c118,
- 0x07aa5, 0x0ad0a, 0x0f389, 0x19ebb, 0x0caad, 0x0fe42, 0x0fe40, 0x16c34,
- 0x2b4e5, 0x33d65, 0x16c30, 0x1e7ae, 0x1e25c, 0x18370, 0x1e703, 0x19eba,
- 0x16c37, 0x0e234, 0x16c6e, 0x00004, 0x0002a, 0x00061, 0x00075, 0x000cb,
- 0x000ff, 0x00190, 0x001eb, 0x001d1, 0x002b9, 0x00307, 0x00339, 0x0033f,
- 0x003fb, 0x003b4, 0x0060c, 0x00679, 0x00645, 0x0067d, 0x0078a, 0x007e3,
- 0x00749, 0x00ac4, 0x00ad2, 0x00ae3, 0x00c10, 0x00c16, 0x00ad1, 0x00cf4,
- 0x00fe2, 0x01586, 0x00e9d, 0x019f1, 0x01664, 0x01e26, 0x01d38, 0x02b4d,
- 0x033c5, 0x01fc2, 0x01fc3, 0x01d28, 0x03c1d, 0x0598e, 0x0f094, 0x07aa4,
- 0x0ad38, 0x0ac0c, 0x0c11a, 0x079ea, 0x0c881, 0x0fe44, 0x0b635, 0x0ac0d,
- 0x0b61e, 0x05987, 0x07121, 0x0f382, 0x0f387, 0x0e237, 0x0fe47, 0x0f383,
- 0x0f091, 0x0f385, 0x0e233, 0x182ee, 0x19eb8, 0x1663e, 0x0f093, 0x00014,
- 0x00058, 0x00159, 0x00167, 0x00300, 0x003d4, 0x005b5, 0x0079d, 0x0076a,
- 0x00b67, 0x00b60, 0x00f05, 0x00cf0, 0x00f17, 0x00e95, 0x01822, 0x01913,
- 0x016c2, 0x0182f, 0x01959, 0x01fcb, 0x01e27, 0x01c40, 0x033c7, 0x01e7b,
- 0x01c49, 0x02d89, 0x01e23, 0x01660, 0x03f12, 0x02cc6, 0x033e1, 0x05b34,
- 0x0609a, 0x06569, 0x07488, 0x07e21, 0x0cf5f, 0x0712c, 0x0389d, 0x067cf,
- 0x07f28, 0x1663f, 0x33d67, 0x1663d, 0x1e25d, 0x3c1ab, 0x15c44, 0x16c36,
- 0x0001f, 0x000ec, 0x00323, 0x005b2, 0x0079f, 0x00ac2, 0x00f16, 0x00e9e,
- 0x01956, 0x01e0f, 0x019ea, 0x01666, 0x02b89, 0x02b02, 0x02d8c, 0x03c1b,
- 0x03c19, 0x032b5, 0x03f9c, 0x02ccf, 0x03897, 0x05b35, 0x0ad02, 0x07f29,
- 0x06441, 0x03884, 0x07888, 0x0784e, 0x06568, 0x0c1bb, 0x05986, 0x067cc,
- 0x0fe49, 0x0fe48, 0x0c1bc, 0x0fe41, 0x18371, 0x1663c, 0x0e231, 0x0711e,
- 0x0ad09, 0x0f092, 0x0002d, 0x001db, 0x00781, 0x00c1a, 0x00f55, 0x01580,
- 0x01ea8, 0x02d9b, 0x032af, 0x03f16, 0x03c1c, 0x07834, 0x03c45, 0x0389c,
- 0x067ce, 0x06445, 0x0c1b9, 0x07889, 0x07f3a, 0x0784f, 0x07f2b, 0x0ad0b,
- 0x0f090, 0x0c11d, 0x0e94e, 0x0711f, 0x0e9f1, 0x0f38e, 0x079e9, 0x0ad03,
- 0x0f09b, 0x0caae, 0x0fe46, 0x2b4e6, 0x0e9f0, 0x19eb6, 0x67ac1, 0x67ac0,
- 0x33d66, 0x0f388, 0x00071, 0x003a0, 0x00ca9, 0x01829, 0x01d39, 0x02b43,
- 0x02cc4, 0x06554, 0x0f09a, 0x0b61f, 0x067cd, 0x0711c, 0x0b636, 0x07f2a,
- 0x0b634, 0x0c11f, 0x0cf5e, 0x0b61d, 0x0f06b, 0x0caab, 0x0c1be, 0x0e94c,
- 0x0f099, 0x182ed, 0x0e94f, 0x0c119, 0x0e232, 0x2b4e4, 0x0f38a, 0x19eb4,
- 0x1e25f, 0x0e94d, 0x000b7, 0x00785, 0x016cc, 0x03051, 0x033c4, 0x0656f,
- 0x03891, 0x0711d, 0x0caaf, 0x0f097, 0x07489, 0x0f098, 0x0c880, 0x0caaa,
- 0x0f386, 0x19eb7, 0x16c6f, 0x0f384, 0x182e8, 0x182e9, 0x0e230, 0x1e700,
- 0x33d62, 0x33d63, 0x33d64, 0x16c33, 0x0e216, 0x000fd, 0x00c15, 0x01665,
- 0x03c4a, 0x07f3b, 0x07896, 0x0c11c, 0x0e215, 0x16c32, 0x0f38b, 0x0f38d,
- 0x182ea, 0x1e701, 0x712df, 0x15c46, 0x00194, 0x00fe0, 0x03f13, 0x0748b,
- 0x0f096, 0x0cf80, 0x1e25e, 0xe25bd, 0x33d61, 0x16c31, 0x001f9, 0x01912,
- 0x05710, 0x0f3d0, 0x0c1bf, 0x00301, 0x01e24, 0x0ad08, 0x003cd, 0x01c41,
- 0x0c1bd, 0x00563, 0x03a52, 0x0f3d1, 0x00570, 0x02cce, 0x0e217, 0x0067b,
- 0x0655d, 0x0074b, 0x06447, 0x00c12, 0x074fb, 0x00f08, 0x0b61c, 0x00e22,
- 0x0fe43, 0x016c7, 0x01836, 0x019f2, 0x01c43, 0x01d3f, 0x01fcf, 0x02b4c,
- 0x0304c, 0x032b6, 0x03a46, 0x05607, 0x03f17, 0x02cc5, 0x0609b, 0x0655c,
- 0x07e23, 0x067c1, 0x07f26, 0x07f27, 0x0f095, 0x0e9f3, 0x0cf81, 0x0c11e,
- 0x0caac, 0x0f38f, 0x0e9f2, 0x074fa, 0x0e236, 0x0fe45, 0x1c428, 0x0e235,
- 0x182ef, 0x19eb5, 0x0f3d6, 0x182ec, 0x16c35, 0x0f38c, 0x2b4e7, 0x15c47,
- 0xe25bc, 0x1e702, 0x1c4b6, 0x0e25a, 0x3c1aa, 0x15c45, 0x1c429, 0x19eb9,
- 0x1e7af, 0x182eb, 0x1e0d4, 0x3896e,
-};
-
-static const uint8_t coef4_huffbits[476] = {
- 12, 6, 2, 3, 4, 4, 5, 5,
- 5, 6, 6, 6, 6, 6, 7, 7,
- 7, 7, 7, 8, 8, 8, 8, 8,
- 8, 9, 9, 9, 9, 9, 9, 9,
- 10, 10, 10, 10, 10, 10, 10, 11,
- 10, 11, 11, 11, 11, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 13, 13, 13, 13, 13, 13,
- 13, 13, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 16, 16,
- 16, 15, 15, 15, 15, 15, 16, 16,
- 15, 16, 16, 17, 16, 16, 16, 17,
- 18, 18, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 4, 6, 7, 8, 8,
- 8, 9, 9, 10, 10, 10, 10, 10,
- 10, 11, 11, 11, 11, 11, 11, 11,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 13, 13, 13, 14, 13, 14, 14,
- 14, 13, 13, 14, 14, 16, 16, 15,
- 16, 16, 16, 15, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 17, 16, 16,
- 16, 16, 17, 17, 17, 18, 16, 5,
- 8, 9, 10, 10, 10, 11, 11, 12,
- 12, 12, 12, 12, 12, 13, 13, 13,
- 13, 13, 13, 13, 13, 14, 14, 13,
- 14, 14, 13, 14, 14, 15, 14, 15,
- 15, 15, 16, 15, 16, 16, 15, 15,
- 15, 18, 18, 18, 17, 18, 17, 17,
- 6, 9, 10, 11, 11, 12, 12, 13,
- 13, 13, 13, 14, 14, 14, 14, 14,
- 14, 14, 14, 15, 15, 15, 16, 15,
- 15, 15, 15, 15, 15, 16, 16, 15,
- 16, 16, 16, 16, 17, 18, 17, 16,
- 16, 16, 7, 10, 11, 12, 12, 13,
- 13, 14, 14, 14, 14, 15, 14, 15,
- 15, 15, 16, 15, 15, 15, 15, 16,
- 16, 16, 17, 16, 17, 16, 15, 16,
- 16, 16, 16, 18, 17, 17, 19, 19,
- 18, 16, 7, 11, 12, 13, 14, 14,
- 15, 15, 16, 16, 15, 16, 16, 15,
- 16, 16, 16, 16, 16, 16, 16, 17,
- 16, 17, 17, 16, 17, 18, 16, 17,
- 17, 17, 8, 11, 13, 14, 14, 15,
- 15, 16, 16, 16, 16, 16, 16, 16,
- 16, 17, 17, 16, 17, 17, 17, 17,
- 18, 18, 18, 17, 17, 8, 12, 14,
- 14, 15, 15, 16, 17, 17, 16, 16,
- 17, 17, 20, 17, 9, 12, 14, 16,
- 16, 16, 17, 21, 18, 17, 9, 13,
- 15, 16, 16, 10, 13, 16, 10, 14,
- 16, 11, 15, 16, 11, 15, 17, 11,
- 15, 12, 15, 12, 16, 12, 16, 13,
- 16, 13, 13, 13, 14, 14, 13, 14,
- 14, 14, 15, 15, 14, 15, 15, 15,
- 15, 15, 15, 15, 16, 17, 16, 16,
- 16, 16, 17, 16, 17, 16, 18, 17,
- 17, 17, 16, 17, 17, 16, 18, 17,
- 21, 17, 18, 17, 18, 17, 18, 17,
- 17, 17, 17, 19,
-};
-
-static const uint32_t coef5_huffcodes[435] = {
- 0x00347, 0x0000b, 0x00001, 0x00001, 0x0000c, 0x00004, 0x00010, 0x00015,
- 0x0001f, 0x0000b, 0x00023, 0x00026, 0x00029, 0x00035, 0x00037, 0x00001,
- 0x00015, 0x0001a, 0x0001d, 0x0001c, 0x0001e, 0x0004e, 0x00049, 0x00051,
- 0x00078, 0x00004, 0x00000, 0x00008, 0x0000d, 0x0007b, 0x00005, 0x00032,
- 0x00095, 0x00091, 0x00096, 0x000a1, 0x000d9, 0x00003, 0x00019, 0x00061,
- 0x00066, 0x00060, 0x00017, 0x0000e, 0x00063, 0x001a0, 0x001b7, 0x001e6,
- 0x001e7, 0x001b6, 0x00018, 0x001e8, 0x00038, 0x00031, 0x00005, 0x0003d,
- 0x00027, 0x001ea, 0x0001a, 0x000c5, 0x000f9, 0x000ff, 0x000db, 0x00250,
- 0x000fc, 0x0025c, 0x00008, 0x00075, 0x003d7, 0x003d3, 0x001b0, 0x0007c,
- 0x003ca, 0x00036, 0x00189, 0x004a6, 0x004a2, 0x004fb, 0x000c0, 0x0007f,
- 0x0009a, 0x00311, 0x0006e, 0x0009b, 0x0068c, 0x006c0, 0x00484, 0x00012,
- 0x000c3, 0x0094f, 0x00979, 0x009f9, 0x00d09, 0x00da6, 0x00da8, 0x00901,
- 0x000c1, 0x00373, 0x00d08, 0x009fa, 0x00d8b, 0x00d85, 0x00d86, 0x000df,
- 0x006e2, 0x000ce, 0x00f24, 0x009fe, 0x001f7, 0x007c1, 0x000cf, 0x009fc,
- 0x009ff, 0x00d89, 0x00da9, 0x009fd, 0x001f8, 0x01a36, 0x0128c, 0x0129d,
- 0x01a37, 0x00196, 0x003ea, 0x00f8b, 0x00d93, 0x01e45, 0x01e58, 0x01e4b,
- 0x01e59, 0x013f1, 0x00309, 0x00265, 0x00308, 0x0243a, 0x027e1, 0x00f89,
- 0x00324, 0x03cbc, 0x03c86, 0x03695, 0x0243c, 0x0243b, 0x0243e, 0x01e4a,
- 0x003a5, 0x03468, 0x03428, 0x03c84, 0x027e0, 0x025e2, 0x01880, 0x00197,
- 0x00325, 0x03cb7, 0x0791e, 0x007ec, 0x06c75, 0x004c8, 0x04bc7, 0x004c6,
- 0x00983, 0x0481e, 0x01b53, 0x0251b, 0x01b58, 0x00984, 0x04fa8, 0x03cbb,
- 0x00f8a, 0x00322, 0x0346a, 0x0243d, 0x00326, 0x03469, 0x0481f, 0x0481d,
- 0x00746, 0x09032, 0x01b50, 0x01d13, 0x0d8e4, 0x0481b, 0x06c74, 0x0796b,
- 0x07969, 0x00985, 0x0d8e3, 0x00986, 0x00fa2, 0x01301, 0x06c7c, 0x00987,
- 0x03cb8, 0x0f4af, 0x00e88, 0x1b1c0, 0x00fce, 0x033eb, 0x03f6a, 0x03f69,
- 0x00fcf, 0x0791f, 0x004c9, 0x04871, 0x00fcd, 0x00982, 0x00fcc, 0x00fa3,
- 0x01d12, 0x0796c, 0x01b47, 0x00321, 0x0796a, 0x0d8e2, 0x04872, 0x04873,
- 0x0000e, 0x00014, 0x0000a, 0x000a0, 0x00012, 0x0007d, 0x001a2, 0x0003b,
- 0x0025f, 0x000dd, 0x0027c, 0x00343, 0x00368, 0x0036b, 0x0003e, 0x001fa,
- 0x00485, 0x001b3, 0x0007f, 0x001b1, 0x0019e, 0x004ba, 0x007ad, 0x00339,
- 0x00066, 0x007a4, 0x00793, 0x006c6, 0x0007e, 0x000f1, 0x00372, 0x009fb,
- 0x00d83, 0x00d8a, 0x00947, 0x009f4, 0x001d0, 0x01b09, 0x01b4b, 0x007ec,
- 0x003e1, 0x000ca, 0x003ec, 0x02539, 0x04fa9, 0x01b57, 0x03429, 0x03d2a,
- 0x00d97, 0x003a7, 0x00dc0, 0x00d96, 0x00dc1, 0x007eb, 0x03cba, 0x00c43,
- 0x00c41, 0x01b52, 0x007ef, 0x00323, 0x03cb9, 0x03c83, 0x007d0, 0x007ed,
- 0x06c7f, 0x09033, 0x03f6c, 0x36383, 0x1e95d, 0x06c78, 0x00747, 0x01b51,
- 0x00022, 0x00016, 0x00039, 0x00252, 0x00079, 0x00486, 0x00338, 0x00369,
- 0x00d88, 0x00026, 0x00d87, 0x00f4b, 0x00d82, 0x00027, 0x001e1, 0x01a15,
- 0x007c7, 0x012f0, 0x001e0, 0x006d0, 0x01a16, 0x01e44, 0x01e5f, 0x03690,
- 0x00d90, 0x00c42, 0x00daf, 0x00d92, 0x00f80, 0x00cfb, 0x0342f, 0x0487f,
- 0x01b46, 0x07968, 0x00d95, 0x00d91, 0x01b55, 0x03f68, 0x04bc6, 0x03cbd,
- 0x00f81, 0x00320, 0x00069, 0x000fe, 0x006d5, 0x0033f, 0x000de, 0x007c6,
- 0x01e40, 0x00d94, 0x00f88, 0x03c8e, 0x03694, 0x00dae, 0x00dad, 0x00267,
- 0x003a6, 0x00327, 0x0487e, 0x007ee, 0x00749, 0x004c7, 0x03692, 0x01b56,
- 0x00fd1, 0x07a56, 0x06c77, 0x09031, 0x00748, 0x06c7a, 0x0796d, 0x033ea,
- 0x06c76, 0x00fd0, 0x36382, 0x1e417, 0x00745, 0x04faf, 0x0d8e1, 0x03f6b,
- 0x1e95c, 0x04fad, 0x0009e, 0x004bd, 0x0067c, 0x01b08, 0x003eb, 0x01b45,
- 0x03691, 0x0d8e5, 0x07904, 0x00981, 0x007ea, 0x019f4, 0x06c7d, 0x04fab,
- 0x04fac, 0x06c7e, 0x01300, 0x06c7b, 0x0006f, 0x003f7, 0x03c85, 0x004c4,
- 0x0001e, 0x006e1, 0x03693, 0x01b44, 0x00241, 0x01e46, 0x0019d, 0x00266,
- 0x004bb, 0x02538, 0x007ac, 0x01b54, 0x00902, 0x04870, 0x00da7, 0x00900,
- 0x00185, 0x06c79, 0x006e3, 0x003e9, 0x01e94, 0x003ed, 0x003f2, 0x0342e,
- 0x0346b, 0x0251a, 0x004c5, 0x01881, 0x0481c, 0x01b59, 0x03c87, 0x04fae,
- 0x007e9, 0x03f6d, 0x0f20a, 0x09030, 0x04faa, 0x0d8e6, 0x03f6f, 0x0481a,
- 0x03f6e, 0x1e416, 0x0d8e7,
-};
-
-static const uint8_t coef5_huffbits[435] = {
- 10, 4, 2, 4, 4, 5, 5, 5,
- 5, 6, 6, 6, 6, 6, 6, 7,
- 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 8, 8, 8, 8, 7, 8, 8,
- 8, 8, 8, 8, 8, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 10, 9, 10, 10, 10, 10,
- 10, 9, 10, 10, 10, 10, 10, 10,
- 10, 10, 11, 11, 10, 10, 11, 11,
- 10, 11, 11, 11, 11, 11, 12, 12,
- 12, 12, 12, 12, 11, 11, 11, 12,
- 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 13,
- 13, 13, 12, 12, 13, 13, 13, 12,
- 12, 12, 12, 12, 13, 13, 13, 13,
- 13, 14, 14, 14, 14, 13, 13, 13,
- 13, 13, 14, 14, 14, 14, 14, 14,
- 15, 14, 14, 14, 14, 14, 14, 13,
- 14, 14, 14, 14, 14, 14, 15, 14,
- 15, 14, 15, 15, 15, 15, 15, 15,
- 16, 15, 15, 14, 15, 16, 15, 14,
- 14, 15, 14, 14, 15, 14, 15, 15,
- 15, 16, 15, 17, 16, 15, 15, 15,
- 15, 16, 16, 16, 16, 17, 15, 16,
- 14, 16, 16, 17, 16, 16, 16, 16,
- 16, 15, 15, 15, 16, 16, 16, 16,
- 17, 15, 15, 15, 15, 16, 15, 15,
- 4, 7, 8, 8, 9, 9, 9, 10,
- 10, 10, 10, 10, 10, 10, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 12,
- 12, 11, 11, 11, 12, 12, 12, 12,
- 12, 12, 12, 12, 13, 13, 13, 13,
- 12, 13, 14, 14, 15, 15, 14, 14,
- 14, 14, 14, 14, 14, 15, 14, 14,
- 14, 15, 15, 15, 14, 14, 15, 15,
- 15, 16, 16, 18, 17, 15, 15, 15,
- 6, 9, 10, 10, 11, 11, 12, 12,
- 12, 13, 12, 12, 12, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 14,
- 14, 14, 14, 14, 14, 14, 14, 15,
- 15, 15, 14, 14, 15, 16, 15, 14,
- 14, 15, 7, 10, 11, 12, 13, 13,
- 13, 14, 14, 14, 14, 14, 14, 14,
- 14, 15, 15, 15, 15, 15, 14, 15,
- 16, 15, 15, 16, 15, 15, 15, 16,
- 15, 16, 18, 17, 15, 15, 16, 16,
- 17, 15, 8, 11, 13, 13, 14, 15,
- 14, 16, 15, 16, 15, 15, 15, 15,
- 15, 15, 17, 15, 9, 12, 14, 15,
- 10, 13, 14, 15, 10, 13, 11, 14,
- 11, 14, 11, 15, 12, 15, 12, 12,
- 13, 15, 13, 14, 13, 14, 14, 14,
- 14, 14, 15, 15, 15, 15, 14, 15,
- 15, 16, 16, 16, 15, 16, 16, 15,
- 16, 17, 16,
-};
-
-static const uint16_t levels0[60] = {
-317, 92, 62, 60, 19, 17, 10, 7,
- 6, 5, 5, 3, 3, 3, 2, 2,
- 2, 2, 2, 2, 2, 1, 2, 2,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1,
-};
-
-static const uint16_t levels1[40] = {
-311, 91, 61, 28, 10, 6, 5, 2,
- 2, 2, 2, 2, 2, 2, 2, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
-};
-
-static const uint16_t levels2[340] = {
-181,110, 78, 63, 61, 62, 60, 61,
- 33, 41, 41, 19, 17, 19, 12, 11,
- 9, 11, 10, 6, 8, 7, 6, 4,
- 5, 5, 4, 4, 3, 4, 3, 5,
- 3, 4, 3, 3, 3, 3, 3, 3,
- 2, 2, 4, 2, 3, 2, 3, 3,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 3, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 1, 2, 1, 2, 2,
- 2, 2, 1, 2, 1, 1, 1, 2,
- 2, 1, 2, 1, 2, 2, 2, 2,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1,
-};
-
-static const uint16_t levels3[180] = {
-351,122, 76, 61, 41, 42, 24, 30,
- 22, 19, 11, 9, 10, 8, 5, 5,
- 4, 5, 5, 3, 3, 3, 3, 3,
- 3, 3, 2, 2, 3, 2, 2, 2,
- 3, 3, 2, 2, 2, 3, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 1, 1,
- 2, 2, 1, 2, 1, 2, 2, 2,
- 2, 2, 2, 1, 2, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 2,
- 2, 1, 2, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1,
-};
-
-static const uint16_t levels4[70] = {
-113, 68, 49, 42, 40, 32, 27, 15,
- 10, 5, 3, 3, 3, 3, 2, 2,
- 2, 2, 2, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1,
-};
-
-static const uint16_t levels5[40] = {
-214, 72, 42, 40, 18, 4, 4, 2,
- 2, 2, 2, 2, 1, 1, 2, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
-};
-
-static const CoefVLCTable coef_vlcs[6] = {
- {
- sizeof(coef0_huffbits), coef0_huffcodes, coef0_huffbits, levels0,
- },
- {
- sizeof(coef1_huffbits), coef1_huffcodes, coef1_huffbits, levels1,
- },
- {
- sizeof(coef2_huffbits), coef2_huffcodes, coef2_huffbits, levels2,
- },
- {
- sizeof(coef3_huffbits), coef3_huffcodes, coef3_huffbits, levels3,
- },
- {
- sizeof(coef4_huffbits), coef4_huffcodes, coef4_huffbits, levels4,
- },
- {
- sizeof(coef5_huffbits), coef5_huffcodes, coef5_huffbits, levels5,
- },
-};
diff --git a/src/libffmpeg/libavcodec/wmadec.c b/src/libffmpeg/libavcodec/wmadec.c
deleted file mode 100644
index bbf4970ce..000000000
--- a/src/libffmpeg/libavcodec/wmadec.c
+++ /dev/null
@@ -1,1337 +0,0 @@
-/*
- * WMA compatible decoder
- * Copyright (c) 2002 The FFmpeg Project.
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file wmadec.c
- * WMA compatible decoder.
- * This decoder handles Microsoft Windows Media Audio data, versions 1 & 2.
- * WMA v1 is identified by audio format 0x160 in Microsoft media files
- * (ASF/AVI/WAV). WMA v2 is identified by audio format 0x161.
- *
- * To use this decoder, a calling application must supply the extra data
- * bytes provided with the WMA data. These are the extra, codec-specific
- * bytes at the end of a WAVEFORMATEX data structure. Transmit these bytes
- * to the decoder using the extradata[_size] fields in AVCodecContext. There
- * should be 4 extra bytes for v1 data and 6 extra bytes for v2 data.
- */
-
-#include "avcodec.h"
-#include "bitstream.h"
-#include "dsputil.h"
-
-/* size of blocks */
-#define BLOCK_MIN_BITS 7
-#define BLOCK_MAX_BITS 11
-#define BLOCK_MAX_SIZE (1 << BLOCK_MAX_BITS)
-
-#define BLOCK_NB_SIZES (BLOCK_MAX_BITS - BLOCK_MIN_BITS + 1)
-
-/* XXX: find exact max size */
-#define HIGH_BAND_MAX_SIZE 16
-
-#define NB_LSP_COEFS 10
-
-/* XXX: is it a suitable value ? */
-#define MAX_CODED_SUPERFRAME_SIZE 16384
-
-#define MAX_CHANNELS 2
-
-#define NOISE_TAB_SIZE 8192
-
-#define LSP_POW_BITS 7
-
-#define VLCBITS 9
-#define VLCMAX ((22+VLCBITS-1)/VLCBITS)
-
-#define EXPVLCBITS 8
-#define EXPMAX ((19+EXPVLCBITS-1)/EXPVLCBITS)
-
-#define HGAINVLCBITS 9
-#define HGAINMAX ((13+HGAINVLCBITS-1)/HGAINVLCBITS)
-
-typedef struct WMADecodeContext {
- GetBitContext gb;
- int sample_rate;
- int nb_channels;
- int bit_rate;
- int version; /* 1 = 0x160 (WMAV1), 2 = 0x161 (WMAV2) */
- int block_align;
- int use_bit_reservoir;
- int use_variable_block_len;
- int use_exp_vlc; /* exponent coding: 0 = lsp, 1 = vlc + delta */
- int use_noise_coding; /* true if perceptual noise is added */
- int byte_offset_bits;
- VLC exp_vlc;
- int exponent_sizes[BLOCK_NB_SIZES];
- uint16_t exponent_bands[BLOCK_NB_SIZES][25];
- int high_band_start[BLOCK_NB_SIZES]; /* index of first coef in high band */
- int coefs_start; /* first coded coef */
- int coefs_end[BLOCK_NB_SIZES]; /* max number of coded coefficients */
- int exponent_high_sizes[BLOCK_NB_SIZES];
- int exponent_high_bands[BLOCK_NB_SIZES][HIGH_BAND_MAX_SIZE];
- VLC hgain_vlc;
-
- /* coded values in high bands */
- int high_band_coded[MAX_CHANNELS][HIGH_BAND_MAX_SIZE];
- int high_band_values[MAX_CHANNELS][HIGH_BAND_MAX_SIZE];
-
- /* there are two possible tables for spectral coefficients */
- VLC coef_vlc[2];
- uint16_t *run_table[2];
- uint16_t *level_table[2];
- /* frame info */
- int frame_len; /* frame length in samples */
- int frame_len_bits; /* frame_len = 1 << frame_len_bits */
- int nb_block_sizes; /* number of block sizes */
- /* block info */
- int reset_block_lengths;
- int block_len_bits; /* log2 of current block length */
- int next_block_len_bits; /* log2 of next block length */
- int prev_block_len_bits; /* log2 of prev block length */
- int block_len; /* block length in samples */
- int block_num; /* block number in current frame */
- int block_pos; /* current position in frame */
- uint8_t ms_stereo; /* true if mid/side stereo mode */
- uint8_t channel_coded[MAX_CHANNELS]; /* true if channel is coded */
- DECLARE_ALIGNED_16(float, exponents[MAX_CHANNELS][BLOCK_MAX_SIZE]);
- float max_exponent[MAX_CHANNELS];
- int16_t coefs1[MAX_CHANNELS][BLOCK_MAX_SIZE];
- DECLARE_ALIGNED_16(float, coefs[MAX_CHANNELS][BLOCK_MAX_SIZE]);
- DECLARE_ALIGNED_16(FFTSample, output[BLOCK_MAX_SIZE * 2]);
- DECLARE_ALIGNED_16(float, window[BLOCK_MAX_SIZE * 2]);
- MDCTContext mdct_ctx[BLOCK_NB_SIZES];
- float *windows[BLOCK_NB_SIZES];
- DECLARE_ALIGNED_16(FFTSample, mdct_tmp[BLOCK_MAX_SIZE]); /* temporary storage for imdct */
- /* output buffer for one frame and the last for IMDCT windowing */
- DECLARE_ALIGNED_16(float, frame_out[MAX_CHANNELS][BLOCK_MAX_SIZE * 2]);
- /* last frame info */
- uint8_t last_superframe[MAX_CODED_SUPERFRAME_SIZE + 4]; /* padding added */
- int last_bitoffset;
- int last_superframe_len;
- float noise_table[NOISE_TAB_SIZE];
- int noise_index;
- float noise_mult; /* XXX: suppress that and integrate it in the noise array */
- /* lsp_to_curve tables */
- float lsp_cos_table[BLOCK_MAX_SIZE];
- float lsp_pow_e_table[256];
- float lsp_pow_m_table1[(1 << LSP_POW_BITS)];
- float lsp_pow_m_table2[(1 << LSP_POW_BITS)];
- DSPContext dsp;
-
-#ifdef TRACE
- int frame_count;
-#endif
-} WMADecodeContext;
-
-typedef struct CoefVLCTable {
- int n; /* total number of codes */
- const uint32_t *huffcodes; /* VLC bit values */
- const uint8_t *huffbits; /* VLC bit size */
- const uint16_t *levels; /* table to build run/level tables */
-} CoefVLCTable;
-
-static void wma_lsp_to_curve_init(WMADecodeContext *s, int frame_len);
-
-#include "wmadata.h"
-
-#ifdef TRACE
-static void dump_shorts(const char *name, const short *tab, int n)
-{
- int i;
-
- tprintf("%s[%d]:\n", name, n);
- for(i=0;i<n;i++) {
- if ((i & 7) == 0)
- tprintf("%4d: ", i);
- tprintf(" %5d.0", tab[i]);
- if ((i & 7) == 7)
- tprintf("\n");
- }
-}
-
-static void dump_floats(const char *name, int prec, const float *tab, int n)
-{
- int i;
-
- tprintf("%s[%d]:\n", name, n);
- for(i=0;i<n;i++) {
- if ((i & 7) == 0)
- tprintf("%4d: ", i);
- tprintf(" %8.*f", prec, tab[i]);
- if ((i & 7) == 7)
- tprintf("\n");
- }
- if ((i & 7) != 0)
- tprintf("\n");
-}
-#endif
-
-/* XXX: use same run/length optimization as mpeg decoders */
-static void init_coef_vlc(VLC *vlc,
- uint16_t **prun_table, uint16_t **plevel_table,
- const CoefVLCTable *vlc_table)
-{
- int n = vlc_table->n;
- const uint8_t *table_bits = vlc_table->huffbits;
- const uint32_t *table_codes = vlc_table->huffcodes;
- const uint16_t *levels_table = vlc_table->levels;
- uint16_t *run_table, *level_table;
- const uint16_t *p;
- int i, l, j, level;
-
- init_vlc(vlc, VLCBITS, n, table_bits, 1, 1, table_codes, 4, 4, 0);
-
- run_table = av_malloc(n * sizeof(uint16_t));
- level_table = av_malloc(n * sizeof(uint16_t));
- p = levels_table;
- i = 2;
- level = 1;
- while (i < n) {
- l = *p++;
- for(j=0;j<l;j++) {
- run_table[i] = j;
- level_table[i] = level;
- i++;
- }
- level++;
- }
- *prun_table = run_table;
- *plevel_table = level_table;
-}
-
-static int wma_decode_init(AVCodecContext * avctx)
-{
- WMADecodeContext *s = avctx->priv_data;
- int i, flags1, flags2;
- float *window;
- uint8_t *extradata;
- float bps1, high_freq;
- volatile float bps;
- int sample_rate1;
- int coef_vlc_table;
-
- s->sample_rate = avctx->sample_rate;
- s->nb_channels = avctx->channels;
- s->bit_rate = avctx->bit_rate;
- s->block_align = avctx->block_align;
-
- dsputil_init(&s->dsp, avctx);
-
- if (avctx->codec->id == CODEC_ID_WMAV1) {
- s->version = 1;
- } else {
- s->version = 2;
- }
-
- /* extract flag infos */
- flags1 = 0;
- flags2 = 0;
- extradata = avctx->extradata;
- if (s->version == 1 && avctx->extradata_size >= 4) {
- flags1 = extradata[0] | (extradata[1] << 8);
- flags2 = extradata[2] | (extradata[3] << 8);
- } else if (s->version == 2 && avctx->extradata_size >= 6) {
- flags1 = extradata[0] | (extradata[1] << 8) |
- (extradata[2] << 16) | (extradata[3] << 24);
- flags2 = extradata[4] | (extradata[5] << 8);
- }
- s->use_exp_vlc = flags2 & 0x0001;
- s->use_bit_reservoir = flags2 & 0x0002;
- s->use_variable_block_len = flags2 & 0x0004;
-
- /* compute MDCT block size */
- if (s->sample_rate <= 16000) {
- s->frame_len_bits = 9;
- } else if (s->sample_rate <= 22050 ||
- (s->sample_rate <= 32000 && s->version == 1)) {
- s->frame_len_bits = 10;
- } else {
- s->frame_len_bits = 11;
- }
- s->frame_len = 1 << s->frame_len_bits;
- if (s->use_variable_block_len) {
- int nb_max, nb;
- nb = ((flags2 >> 3) & 3) + 1;
- if ((s->bit_rate / s->nb_channels) >= 32000)
- nb += 2;
- nb_max = s->frame_len_bits - BLOCK_MIN_BITS;
- if (nb > nb_max)
- nb = nb_max;
- s->nb_block_sizes = nb + 1;
- } else {
- s->nb_block_sizes = 1;
- }
-
- /* init rate dependant parameters */
- s->use_noise_coding = 1;
- high_freq = s->sample_rate * 0.5;
-
- /* if version 2, then the rates are normalized */
- sample_rate1 = s->sample_rate;
- if (s->version == 2) {
- if (sample_rate1 >= 44100)
- sample_rate1 = 44100;
- else if (sample_rate1 >= 22050)
- sample_rate1 = 22050;
- else if (sample_rate1 >= 16000)
- sample_rate1 = 16000;
- else if (sample_rate1 >= 11025)
- sample_rate1 = 11025;
- else if (sample_rate1 >= 8000)
- sample_rate1 = 8000;
- }
-
- bps = (float)s->bit_rate / (float)(s->nb_channels * s->sample_rate);
- s->byte_offset_bits = av_log2((int)(bps * s->frame_len / 8.0 + 0.5)) + 2;
-
- /* compute high frequency value and choose if noise coding should
- be activated */
- bps1 = bps;
- if (s->nb_channels == 2)
- bps1 = bps * 1.6;
- if (sample_rate1 == 44100) {
- if (bps1 >= 0.61)
- s->use_noise_coding = 0;
- else
- high_freq = high_freq * 0.4;
- } else if (sample_rate1 == 22050) {
- if (bps1 >= 1.16)
- s->use_noise_coding = 0;
- else if (bps1 >= 0.72)
- high_freq = high_freq * 0.7;
- else
- high_freq = high_freq * 0.6;
- } else if (sample_rate1 == 16000) {
- if (bps > 0.5)
- high_freq = high_freq * 0.5;
- else
- high_freq = high_freq * 0.3;
- } else if (sample_rate1 == 11025) {
- high_freq = high_freq * 0.7;
- } else if (sample_rate1 == 8000) {
- if (bps <= 0.625) {
- high_freq = high_freq * 0.5;
- } else if (bps > 0.75) {
- s->use_noise_coding = 0;
- } else {
- high_freq = high_freq * 0.65;
- }
- } else {
- if (bps >= 0.8) {
- high_freq = high_freq * 0.75;
- } else if (bps >= 0.6) {
- high_freq = high_freq * 0.6;
- } else {
- high_freq = high_freq * 0.5;
- }
- }
- dprintf("flags1=0x%x flags2=0x%x\n", flags1, flags2);
- dprintf("version=%d channels=%d sample_rate=%d bitrate=%d block_align=%d\n",
- s->version, s->nb_channels, s->sample_rate, s->bit_rate,
- s->block_align);
- dprintf("bps=%f bps1=%f high_freq=%f bitoffset=%d\n",
- bps, bps1, high_freq, s->byte_offset_bits);
- dprintf("use_noise_coding=%d use_exp_vlc=%d nb_block_sizes=%d\n",
- s->use_noise_coding, s->use_exp_vlc, s->nb_block_sizes);
-
- /* compute the scale factor band sizes for each MDCT block size */
- {
- int a, b, pos, lpos, k, block_len, i, j, n;
- const uint8_t *table;
-
- if (s->version == 1) {
- s->coefs_start = 3;
- } else {
- s->coefs_start = 0;
- }
- for(k = 0; k < s->nb_block_sizes; k++) {
- block_len = s->frame_len >> k;
-
- if (s->version == 1) {
- lpos = 0;
- for(i=0;i<25;i++) {
- a = wma_critical_freqs[i];
- b = s->sample_rate;
- pos = ((block_len * 2 * a) + (b >> 1)) / b;
- if (pos > block_len)
- pos = block_len;
- s->exponent_bands[0][i] = pos - lpos;
- if (pos >= block_len) {
- i++;
- break;
- }
- lpos = pos;
- }
- s->exponent_sizes[0] = i;
- } else {
- /* hardcoded tables */
- table = NULL;
- a = s->frame_len_bits - BLOCK_MIN_BITS - k;
- if (a < 3) {
- if (s->sample_rate >= 44100)
- table = exponent_band_44100[a];
- else if (s->sample_rate >= 32000)
- table = exponent_band_32000[a];
- else if (s->sample_rate >= 22050)
- table = exponent_band_22050[a];
- }
- if (table) {
- n = *table++;
- for(i=0;i<n;i++)
- s->exponent_bands[k][i] = table[i];
- s->exponent_sizes[k] = n;
- } else {
- j = 0;
- lpos = 0;
- for(i=0;i<25;i++) {
- a = wma_critical_freqs[i];
- b = s->sample_rate;
- pos = ((block_len * 2 * a) + (b << 1)) / (4 * b);
- pos <<= 2;
- if (pos > block_len)
- pos = block_len;
- if (pos > lpos)
- s->exponent_bands[k][j++] = pos - lpos;
- if (pos >= block_len)
- break;
- lpos = pos;
- }
- s->exponent_sizes[k] = j;
- }
- }
-
- /* max number of coefs */
- s->coefs_end[k] = (s->frame_len - ((s->frame_len * 9) / 100)) >> k;
- /* high freq computation */
- s->high_band_start[k] = (int)((block_len * 2 * high_freq) /
- s->sample_rate + 0.5);
- n = s->exponent_sizes[k];
- j = 0;
- pos = 0;
- for(i=0;i<n;i++) {
- int start, end;
- start = pos;
- pos += s->exponent_bands[k][i];
- end = pos;
- if (start < s->high_band_start[k])
- start = s->high_band_start[k];
- if (end > s->coefs_end[k])
- end = s->coefs_end[k];
- if (end > start)
- s->exponent_high_bands[k][j++] = end - start;
- }
- s->exponent_high_sizes[k] = j;
-#if 0
- tprintf("%5d: coefs_end=%d high_band_start=%d nb_high_bands=%d: ",
- s->frame_len >> k,
- s->coefs_end[k],
- s->high_band_start[k],
- s->exponent_high_sizes[k]);
- for(j=0;j<s->exponent_high_sizes[k];j++)
- tprintf(" %d", s->exponent_high_bands[k][j]);
- tprintf("\n");
-#endif
- }
- }
-
-#ifdef TRACE
- {
- int i, j;
- for(i = 0; i < s->nb_block_sizes; i++) {
- tprintf("%5d: n=%2d:",
- s->frame_len >> i,
- s->exponent_sizes[i]);
- for(j=0;j<s->exponent_sizes[i];j++)
- tprintf(" %d", s->exponent_bands[i][j]);
- tprintf("\n");
- }
- }
-#endif
-
- /* init MDCT */
- for(i = 0; i < s->nb_block_sizes; i++)
- ff_mdct_init(&s->mdct_ctx[i], s->frame_len_bits - i + 1, 1);
-
- /* init MDCT windows : simple sinus window */
- for(i = 0; i < s->nb_block_sizes; i++) {
- int n, j;
- float alpha;
- n = 1 << (s->frame_len_bits - i);
- window = av_malloc(sizeof(float) * n);
- alpha = M_PI / (2.0 * n);
- for(j=0;j<n;j++) {
- window[n - j - 1] = sin((j + 0.5) * alpha);
- }
- s->windows[i] = window;
- }
-
- s->reset_block_lengths = 1;
-
- if (s->use_noise_coding) {
-
- /* init the noise generator */
- if (s->use_exp_vlc)
- s->noise_mult = 0.02;
- else
- s->noise_mult = 0.04;
-
-#ifdef TRACE
- for(i=0;i<NOISE_TAB_SIZE;i++)
- s->noise_table[i] = 1.0 * s->noise_mult;
-#else
- {
- unsigned int seed;
- float norm;
- seed = 1;
- norm = (1.0 / (float)(1LL << 31)) * sqrt(3) * s->noise_mult;
- for(i=0;i<NOISE_TAB_SIZE;i++) {
- seed = seed * 314159 + 1;
- s->noise_table[i] = (float)((int)seed) * norm;
- }
- }
-#endif
- init_vlc(&s->hgain_vlc, HGAINVLCBITS, sizeof(hgain_huffbits),
- hgain_huffbits, 1, 1,
- hgain_huffcodes, 2, 2, 0);
- }
-
- if (s->use_exp_vlc) {
- init_vlc(&s->exp_vlc, EXPVLCBITS, sizeof(scale_huffbits),
- scale_huffbits, 1, 1,
- scale_huffcodes, 4, 4, 0);
- } else {
- wma_lsp_to_curve_init(s, s->frame_len);
- }
-
- /* choose the VLC tables for the coefficients */
- coef_vlc_table = 2;
- if (s->sample_rate >= 32000) {
- if (bps1 < 0.72)
- coef_vlc_table = 0;
- else if (bps1 < 1.16)
- coef_vlc_table = 1;
- }
-
- init_coef_vlc(&s->coef_vlc[0], &s->run_table[0], &s->level_table[0],
- &coef_vlcs[coef_vlc_table * 2]);
- init_coef_vlc(&s->coef_vlc[1], &s->run_table[1], &s->level_table[1],
- &coef_vlcs[coef_vlc_table * 2 + 1]);
- return 0;
-}
-
-/* interpolate values for a bigger or smaller block. The block must
- have multiple sizes */
-static void interpolate_array(float *scale, int old_size, int new_size)
-{
- int i, j, jincr, k;
- float v;
-
- if (new_size > old_size) {
- jincr = new_size / old_size;
- j = new_size;
- for(i = old_size - 1; i >=0; i--) {
- v = scale[i];
- k = jincr;
- do {
- scale[--j] = v;
- } while (--k);
- }
- } else if (new_size < old_size) {
- j = 0;
- jincr = old_size / new_size;
- for(i = 0; i < new_size; i++) {
- scale[i] = scale[j];
- j += jincr;
- }
- }
-}
-
-/* compute x^-0.25 with an exponent and mantissa table. We use linear
- interpolation to reduce the mantissa table size at a small speed
- expense (linear interpolation approximately doubles the number of
- bits of precision). */
-static inline float pow_m1_4(WMADecodeContext *s, float x)
-{
- union {
- float f;
- unsigned int v;
- } u, t;
- unsigned int e, m;
- float a, b;
-
- u.f = x;
- e = u.v >> 23;
- m = (u.v >> (23 - LSP_POW_BITS)) & ((1 << LSP_POW_BITS) - 1);
- /* build interpolation scale: 1 <= t < 2. */
- t.v = ((u.v << LSP_POW_BITS) & ((1 << 23) - 1)) | (127 << 23);
- a = s->lsp_pow_m_table1[m];
- b = s->lsp_pow_m_table2[m];
- return s->lsp_pow_e_table[e] * (a + b * t.f);
-}
-
-static void wma_lsp_to_curve_init(WMADecodeContext *s, int frame_len)
-{
- float wdel, a, b;
- int i, e, m;
-
- wdel = M_PI / frame_len;
- for(i=0;i<frame_len;i++)
- s->lsp_cos_table[i] = 2.0f * cos(wdel * i);
-
- /* tables for x^-0.25 computation */
- for(i=0;i<256;i++) {
- e = i - 126;
- s->lsp_pow_e_table[i] = pow(2.0, e * -0.25);
- }
-
- /* NOTE: these two tables are needed to avoid two operations in
- pow_m1_4 */
- b = 1.0;
- for(i=(1 << LSP_POW_BITS) - 1;i>=0;i--) {
- m = (1 << LSP_POW_BITS) + i;
- a = (float)m * (0.5 / (1 << LSP_POW_BITS));
- a = pow(a, -0.25);
- s->lsp_pow_m_table1[i] = 2 * a - b;
- s->lsp_pow_m_table2[i] = b - a;
- b = a;
- }
-#if 0
- for(i=1;i<20;i++) {
- float v, r1, r2;
- v = 5.0 / i;
- r1 = pow_m1_4(s, v);
- r2 = pow(v,-0.25);
- printf("%f^-0.25=%f e=%f\n", v, r1, r2 - r1);
- }
-#endif
-}
-
-/* NOTE: We use the same code as Vorbis here */
-/* XXX: optimize it further with SSE/3Dnow */
-static void wma_lsp_to_curve(WMADecodeContext *s,
- float *out, float *val_max_ptr,
- int n, float *lsp)
-{
- int i, j;
- float p, q, w, v, val_max;
-
- val_max = 0;
- for(i=0;i<n;i++) {
- p = 0.5f;
- q = 0.5f;
- w = s->lsp_cos_table[i];
- for(j=1;j<NB_LSP_COEFS;j+=2){
- q *= w - lsp[j - 1];
- p *= w - lsp[j];
- }
- p *= p * (2.0f - w);
- q *= q * (2.0f + w);
- v = p + q;
- v = pow_m1_4(s, v);
- if (v > val_max)
- val_max = v;
- out[i] = v;
- }
- *val_max_ptr = val_max;
-}
-
-/* decode exponents coded with LSP coefficients (same idea as Vorbis) */
-static void decode_exp_lsp(WMADecodeContext *s, int ch)
-{
- float lsp_coefs[NB_LSP_COEFS];
- int val, i;
-
- for(i = 0; i < NB_LSP_COEFS; i++) {
- if (i == 0 || i >= 8)
- val = get_bits(&s->gb, 3);
- else
- val = get_bits(&s->gb, 4);
- lsp_coefs[i] = lsp_codebook[i][val];
- }
-
- wma_lsp_to_curve(s, s->exponents[ch], &s->max_exponent[ch],
- s->block_len, lsp_coefs);
-}
-
-/* decode exponents coded with VLC codes */
-static int decode_exp_vlc(WMADecodeContext *s, int ch)
-{
- int last_exp, n, code;
- const uint16_t *ptr, *band_ptr;
- float v, *q, max_scale, *q_end;
-
- band_ptr = s->exponent_bands[s->frame_len_bits - s->block_len_bits];
- ptr = band_ptr;
- q = s->exponents[ch];
- q_end = q + s->block_len;
- max_scale = 0;
- if (s->version == 1) {
- last_exp = get_bits(&s->gb, 5) + 10;
- /* XXX: use a table */
- v = pow(10, last_exp * (1.0 / 16.0));
- max_scale = v;
- n = *ptr++;
- do {
- *q++ = v;
- } while (--n);
- }
- last_exp = 36;
- while (q < q_end) {
- code = get_vlc2(&s->gb, s->exp_vlc.table, EXPVLCBITS, EXPMAX);
- if (code < 0)
- return -1;
- /* NOTE: this offset is the same as MPEG4 AAC ! */
- last_exp += code - 60;
- /* XXX: use a table */
- v = pow(10, last_exp * (1.0 / 16.0));
- if (v > max_scale)
- max_scale = v;
- n = *ptr++;
- do {
- *q++ = v;
- } while (--n);
- }
- s->max_exponent[ch] = max_scale;
- return 0;
-}
-
-/* return 0 if OK. return 1 if last block of frame. return -1 if
- unrecorrable error. */
-static int wma_decode_block(WMADecodeContext *s)
-{
- int n, v, a, ch, code, bsize;
- int coef_nb_bits, total_gain, parse_exponents;
- int nb_coefs[MAX_CHANNELS];
- float mdct_norm;
-
-#ifdef TRACE
- tprintf("***decode_block: %d:%d\n", s->frame_count - 1, s->block_num);
-#endif
-
- /* compute current block length */
- if (s->use_variable_block_len) {
- n = av_log2(s->nb_block_sizes - 1) + 1;
-
- if (s->reset_block_lengths) {
- s->reset_block_lengths = 0;
- v = get_bits(&s->gb, n);
- if (v >= s->nb_block_sizes)
- return -1;
- s->prev_block_len_bits = s->frame_len_bits - v;
- v = get_bits(&s->gb, n);
- if (v >= s->nb_block_sizes)
- return -1;
- s->block_len_bits = s->frame_len_bits - v;
- } else {
- /* update block lengths */
- s->prev_block_len_bits = s->block_len_bits;
- s->block_len_bits = s->next_block_len_bits;
- }
- v = get_bits(&s->gb, n);
- if (v >= s->nb_block_sizes)
- return -1;
- s->next_block_len_bits = s->frame_len_bits - v;
- } else {
- /* fixed block len */
- s->next_block_len_bits = s->frame_len_bits;
- s->prev_block_len_bits = s->frame_len_bits;
- s->block_len_bits = s->frame_len_bits;
- }
-
- /* now check if the block length is coherent with the frame length */
- s->block_len = 1 << s->block_len_bits;
- if ((s->block_pos + s->block_len) > s->frame_len)
- return -1;
-
- if (s->nb_channels == 2) {
- s->ms_stereo = get_bits(&s->gb, 1);
- }
- v = 0;
- for(ch = 0; ch < s->nb_channels; ch++) {
- a = get_bits(&s->gb, 1);
- s->channel_coded[ch] = a;
- v |= a;
- }
- /* if no channel coded, no need to go further */
- /* XXX: fix potential framing problems */
- if (!v)
- goto next;
-
- bsize = s->frame_len_bits - s->block_len_bits;
-
- /* read total gain and extract corresponding number of bits for
- coef escape coding */
- total_gain = 1;
- for(;;) {
- a = get_bits(&s->gb, 7);
- total_gain += a;
- if (a != 127)
- break;
- }
-
- if (total_gain < 15)
- coef_nb_bits = 13;
- else if (total_gain < 32)
- coef_nb_bits = 12;
- else if (total_gain < 40)
- coef_nb_bits = 11;
- else if (total_gain < 45)
- coef_nb_bits = 10;
- else
- coef_nb_bits = 9;
-
- /* compute number of coefficients */
- n = s->coefs_end[bsize] - s->coefs_start;
- for(ch = 0; ch < s->nb_channels; ch++)
- nb_coefs[ch] = n;
-
- /* complex coding */
- if (s->use_noise_coding) {
-
- for(ch = 0; ch < s->nb_channels; ch++) {
- if (s->channel_coded[ch]) {
- int i, n, a;
- n = s->exponent_high_sizes[bsize];
- for(i=0;i<n;i++) {
- a = get_bits(&s->gb, 1);
- s->high_band_coded[ch][i] = a;
- /* if noise coding, the coefficients are not transmitted */
- if (a)
- nb_coefs[ch] -= s->exponent_high_bands[bsize][i];
- }
- }
- }
- for(ch = 0; ch < s->nb_channels; ch++) {
- if (s->channel_coded[ch]) {
- int i, n, val, code;
-
- n = s->exponent_high_sizes[bsize];
- val = (int)0x80000000;
- for(i=0;i<n;i++) {
- if (s->high_band_coded[ch][i]) {
- if (val == (int)0x80000000) {
- val = get_bits(&s->gb, 7) - 19;
- } else {
- code = get_vlc2(&s->gb, s->hgain_vlc.table, HGAINVLCBITS, HGAINMAX);
- if (code < 0)
- return -1;
- val += code - 18;
- }
- s->high_band_values[ch][i] = val;
- }
- }
- }
- }
- }
-
- /* exposant can be interpolated in short blocks. */
- parse_exponents = 1;
- if (s->block_len_bits != s->frame_len_bits) {
- parse_exponents = get_bits(&s->gb, 1);
- }
-
- if (parse_exponents) {
- for(ch = 0; ch < s->nb_channels; ch++) {
- if (s->channel_coded[ch]) {
- if (s->use_exp_vlc) {
- if (decode_exp_vlc(s, ch) < 0)
- return -1;
- } else {
- decode_exp_lsp(s, ch);
- }
- }
- }
- } else {
- for(ch = 0; ch < s->nb_channels; ch++) {
- if (s->channel_coded[ch]) {
- interpolate_array(s->exponents[ch], 1 << s->prev_block_len_bits,
- s->block_len);
- }
- }
- }
-
- /* parse spectral coefficients : just RLE encoding */
- for(ch = 0; ch < s->nb_channels; ch++) {
- if (s->channel_coded[ch]) {
- VLC *coef_vlc;
- int level, run, sign, tindex;
- int16_t *ptr, *eptr;
- const uint16_t *level_table, *run_table;
-
- /* special VLC tables are used for ms stereo because
- there is potentially less energy there */
- tindex = (ch == 1 && s->ms_stereo);
- coef_vlc = &s->coef_vlc[tindex];
- run_table = s->run_table[tindex];
- level_table = s->level_table[tindex];
- /* XXX: optimize */
- ptr = &s->coefs1[ch][0];
- eptr = ptr + nb_coefs[ch];
- memset(ptr, 0, s->block_len * sizeof(int16_t));
- for(;;) {
- code = get_vlc2(&s->gb, coef_vlc->table, VLCBITS, VLCMAX);
- if (code < 0)
- return -1;
- if (code == 1) {
- /* EOB */
- break;
- } else if (code == 0) {
- /* escape */
- level = get_bits(&s->gb, coef_nb_bits);
- /* NOTE: this is rather suboptimal. reading
- block_len_bits would be better */
- run = get_bits(&s->gb, s->frame_len_bits);
- } else {
- /* normal code */
- run = run_table[code];
- level = level_table[code];
- }
- sign = get_bits(&s->gb, 1);
- if (!sign)
- level = -level;
- ptr += run;
- if (ptr >= eptr)
- {
- av_log(NULL, AV_LOG_ERROR, "overflow in spectral RLE, ignoring\n");
- break;
- }
- *ptr++ = level;
- /* NOTE: EOB can be omitted */
- if (ptr >= eptr)
- break;
- }
- }
- if (s->version == 1 && s->nb_channels >= 2) {
- align_get_bits(&s->gb);
- }
- }
-
- /* normalize */
- {
- int n4 = s->block_len / 2;
- mdct_norm = 1.0 / (float)n4;
- if (s->version == 1) {
- mdct_norm *= sqrt(n4);
- }
- }
-
- /* finally compute the MDCT coefficients */
- for(ch = 0; ch < s->nb_channels; ch++) {
- if (s->channel_coded[ch]) {
- int16_t *coefs1;
- float *coefs, *exponents, mult, mult1, noise, *exp_ptr;
- int i, j, n, n1, last_high_band;
- float exp_power[HIGH_BAND_MAX_SIZE];
-
- coefs1 = s->coefs1[ch];
- exponents = s->exponents[ch];
- mult = pow(10, total_gain * 0.05) / s->max_exponent[ch];
- mult *= mdct_norm;
- coefs = s->coefs[ch];
- if (s->use_noise_coding) {
- mult1 = mult;
- /* very low freqs : noise */
- for(i = 0;i < s->coefs_start; i++) {
- *coefs++ = s->noise_table[s->noise_index] * (*exponents++) * mult1;
- s->noise_index = (s->noise_index + 1) & (NOISE_TAB_SIZE - 1);
- }
-
- n1 = s->exponent_high_sizes[bsize];
-
- /* compute power of high bands */
- exp_ptr = exponents +
- s->high_band_start[bsize] -
- s->coefs_start;
- last_high_band = 0; /* avoid warning */
- for(j=0;j<n1;j++) {
- n = s->exponent_high_bands[s->frame_len_bits -
- s->block_len_bits][j];
- if (s->high_band_coded[ch][j]) {
- float e2, v;
- e2 = 0;
- for(i = 0;i < n; i++) {
- v = exp_ptr[i];
- e2 += v * v;
- }
- exp_power[j] = e2 / n;
- last_high_band = j;
- tprintf("%d: power=%f (%d)\n", j, exp_power[j], n);
- }
- exp_ptr += n;
- }
-
- /* main freqs and high freqs */
- for(j=-1;j<n1;j++) {
- if (j < 0) {
- n = s->high_band_start[bsize] -
- s->coefs_start;
- } else {
- n = s->exponent_high_bands[s->frame_len_bits -
- s->block_len_bits][j];
- }
- if (j >= 0 && s->high_band_coded[ch][j]) {
- /* use noise with specified power */
- mult1 = sqrt(exp_power[j] / exp_power[last_high_band]);
- /* XXX: use a table */
- mult1 = mult1 * pow(10, s->high_band_values[ch][j] * 0.05);
- mult1 = mult1 / (s->max_exponent[ch] * s->noise_mult);
- mult1 *= mdct_norm;
- for(i = 0;i < n; i++) {
- noise = s->noise_table[s->noise_index];
- s->noise_index = (s->noise_index + 1) & (NOISE_TAB_SIZE - 1);
- *coefs++ = (*exponents++) * noise * mult1;
- }
- } else {
- /* coded values + small noise */
- for(i = 0;i < n; i++) {
- noise = s->noise_table[s->noise_index];
- s->noise_index = (s->noise_index + 1) & (NOISE_TAB_SIZE - 1);
- *coefs++ = ((*coefs1++) + noise) * (*exponents++) * mult;
- }
- }
- }
-
- /* very high freqs : noise */
- n = s->block_len - s->coefs_end[bsize];
- mult1 = mult * exponents[-1];
- for(i = 0; i < n; i++) {
- *coefs++ = s->noise_table[s->noise_index] * mult1;
- s->noise_index = (s->noise_index + 1) & (NOISE_TAB_SIZE - 1);
- }
- } else {
- /* XXX: optimize more */
- for(i = 0;i < s->coefs_start; i++)
- *coefs++ = 0.0;
- n = nb_coefs[ch];
- for(i = 0;i < n; i++) {
- *coefs++ = coefs1[i] * exponents[i] * mult;
- }
- n = s->block_len - s->coefs_end[bsize];
- for(i = 0;i < n; i++)
- *coefs++ = 0.0;
- }
- }
- }
-
-#ifdef TRACE
- for(ch = 0; ch < s->nb_channels; ch++) {
- if (s->channel_coded[ch]) {
- dump_floats("exponents", 3, s->exponents[ch], s->block_len);
- dump_floats("coefs", 1, s->coefs[ch], s->block_len);
- }
- }
-#endif
-
- if (s->ms_stereo && s->channel_coded[1]) {
- float a, b;
- int i;
-
- /* nominal case for ms stereo: we do it before mdct */
- /* no need to optimize this case because it should almost
- never happen */
- if (!s->channel_coded[0]) {
- tprintf("rare ms-stereo case happened\n");
- memset(s->coefs[0], 0, sizeof(float) * s->block_len);
- s->channel_coded[0] = 1;
- }
-
- for(i = 0; i < s->block_len; i++) {
- a = s->coefs[0][i];
- b = s->coefs[1][i];
- s->coefs[0][i] = a + b;
- s->coefs[1][i] = a - b;
- }
- }
-
- /* build the window : we ensure that when the windows overlap
- their squared sum is always 1 (MDCT reconstruction rule) */
- /* XXX: merge with output */
- {
- int i, next_block_len, block_len, prev_block_len, n;
- float *wptr;
-
- block_len = s->block_len;
- prev_block_len = 1 << s->prev_block_len_bits;
- next_block_len = 1 << s->next_block_len_bits;
-
- /* right part */
- wptr = s->window + block_len;
- if (block_len <= next_block_len) {
- for(i=0;i<block_len;i++)
- *wptr++ = s->windows[bsize][i];
- } else {
- /* overlap */
- n = (block_len / 2) - (next_block_len / 2);
- for(i=0;i<n;i++)
- *wptr++ = 1.0;
- for(i=0;i<next_block_len;i++)
- *wptr++ = s->windows[s->frame_len_bits - s->next_block_len_bits][i];
- for(i=0;i<n;i++)
- *wptr++ = 0.0;
- }
-
- /* left part */
- wptr = s->window + block_len;
- if (block_len <= prev_block_len) {
- for(i=0;i<block_len;i++)
- *--wptr = s->windows[bsize][i];
- } else {
- /* overlap */
- n = (block_len / 2) - (prev_block_len / 2);
- for(i=0;i<n;i++)
- *--wptr = 1.0;
- for(i=0;i<prev_block_len;i++)
- *--wptr = s->windows[s->frame_len_bits - s->prev_block_len_bits][i];
- for(i=0;i<n;i++)
- *--wptr = 0.0;
- }
- }
-
-
- for(ch = 0; ch < s->nb_channels; ch++) {
- if (s->channel_coded[ch]) {
- float *ptr;
- int n4, index, n;
-
- n = s->block_len;
- n4 = s->block_len / 2;
- s->mdct_ctx[bsize].fft.imdct_calc(&s->mdct_ctx[bsize],
- s->output, s->coefs[ch], s->mdct_tmp);
-
- /* XXX: optimize all that by build the window and
- multipying/adding at the same time */
-
- /* multiply by the window and add in the frame */
- index = (s->frame_len / 2) + s->block_pos - n4;
- ptr = &s->frame_out[ch][index];
- s->dsp.vector_fmul_add_add(ptr,s->window,s->output,ptr,0,2*n,1);
-
- /* specific fast case for ms-stereo : add to second
- channel if it is not coded */
- if (s->ms_stereo && !s->channel_coded[1]) {
- ptr = &s->frame_out[1][index];
- s->dsp.vector_fmul_add_add(ptr,s->window,s->output,ptr,0,2*n,1);
- }
- }
- }
- next:
- /* update block number */
- s->block_num++;
- s->block_pos += s->block_len;
- if (s->block_pos >= s->frame_len)
- return 1;
- else
- return 0;
-}
-
-/* decode a frame of frame_len samples */
-static int wma_decode_frame(WMADecodeContext *s, int16_t *samples)
-{
- int ret, i, n, a, ch, incr;
- int16_t *ptr;
- float *iptr;
-
-#ifdef TRACE
- tprintf("***decode_frame: %d size=%d\n", s->frame_count++, s->frame_len);
-#endif
-
- /* read each block */
- s->block_num = 0;
- s->block_pos = 0;
- for(;;) {
- ret = wma_decode_block(s);
- if (ret < 0)
- return -1;
- if (ret)
- break;
- }
-
- /* convert frame to integer */
- n = s->frame_len;
- incr = s->nb_channels;
- for(ch = 0; ch < s->nb_channels; ch++) {
- ptr = samples + ch;
- iptr = s->frame_out[ch];
-
- for(i=0;i<n;i++) {
- a = lrintf(*iptr++);
- if (a > 32767)
- a = 32767;
- else if (a < -32768)
- a = -32768;
- *ptr = a;
- ptr += incr;
- }
- /* prepare for next block */
- memmove(&s->frame_out[ch][0], &s->frame_out[ch][s->frame_len],
- s->frame_len * sizeof(float));
- /* XXX: suppress this */
- memset(&s->frame_out[ch][s->frame_len], 0,
- s->frame_len * sizeof(float));
- }
-
-#ifdef TRACE
- dump_shorts("samples", samples, n * s->nb_channels);
-#endif
- return 0;
-}
-
-static int wma_decode_superframe(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- WMADecodeContext *s = avctx->priv_data;
- int nb_frames, bit_offset, i, pos, len;
- uint8_t *q;
- int16_t *samples;
-
- tprintf("***decode_superframe:\n");
-
- if(buf_size==0){
- s->last_superframe_len = 0;
- return 0;
- }
-
- samples = data;
-
- init_get_bits(&s->gb, buf, buf_size*8);
-
- if (s->use_bit_reservoir) {
- /* read super frame header */
- get_bits(&s->gb, 4); /* super frame index */
- nb_frames = get_bits(&s->gb, 4) - 1;
-
- bit_offset = get_bits(&s->gb, s->byte_offset_bits + 3);
-
- if (s->last_superframe_len > 0) {
- // printf("skip=%d\n", s->last_bitoffset);
- /* add bit_offset bits to last frame */
- if ((s->last_superframe_len + ((bit_offset + 7) >> 3)) >
- MAX_CODED_SUPERFRAME_SIZE)
- goto fail;
- q = s->last_superframe + s->last_superframe_len;
- len = bit_offset;
- while (len > 7) {
- *q++ = (get_bits)(&s->gb, 8);
- len -= 8;
- }
- if (len > 0) {
- *q++ = (get_bits)(&s->gb, len) << (8 - len);
- }
-
- /* XXX: bit_offset bits into last frame */
- init_get_bits(&s->gb, s->last_superframe, MAX_CODED_SUPERFRAME_SIZE*8);
- /* skip unused bits */
- if (s->last_bitoffset > 0)
- skip_bits(&s->gb, s->last_bitoffset);
- /* this frame is stored in the last superframe and in the
- current one */
- if (wma_decode_frame(s, samples) < 0)
- goto fail;
- samples += s->nb_channels * s->frame_len;
- }
-
- /* read each frame starting from bit_offset */
- pos = bit_offset + 4 + 4 + s->byte_offset_bits + 3;
- init_get_bits(&s->gb, buf + (pos >> 3), (MAX_CODED_SUPERFRAME_SIZE - (pos >> 3))*8);
- len = pos & 7;
- if (len > 0)
- skip_bits(&s->gb, len);
-
- s->reset_block_lengths = 1;
- for(i=0;i<nb_frames;i++) {
- if (wma_decode_frame(s, samples) < 0)
- goto fail;
- samples += s->nb_channels * s->frame_len;
- }
-
- /* we copy the end of the frame in the last frame buffer */
- pos = get_bits_count(&s->gb) + ((bit_offset + 4 + 4 + s->byte_offset_bits + 3) & ~7);
- s->last_bitoffset = pos & 7;
- pos >>= 3;
- len = buf_size - pos;
- if (len > MAX_CODED_SUPERFRAME_SIZE || len < 0) {
- goto fail;
- }
- s->last_superframe_len = len;
- memcpy(s->last_superframe, buf + pos, len);
- } else {
- /* single frame decode */
- if (wma_decode_frame(s, samples) < 0)
- goto fail;
- samples += s->nb_channels * s->frame_len;
- }
- *data_size = (int8_t *)samples - (int8_t *)data;
- return s->block_align;
- fail:
- /* when error, we reset the bit reservoir */
- s->last_superframe_len = 0;
- return -1;
-}
-
-static int wma_decode_end(AVCodecContext *avctx)
-{
- WMADecodeContext *s = avctx->priv_data;
- int i;
-
- for(i = 0; i < s->nb_block_sizes; i++)
- ff_mdct_end(&s->mdct_ctx[i]);
- for(i = 0; i < s->nb_block_sizes; i++)
- av_free(s->windows[i]);
-
- if (s->use_exp_vlc) {
- free_vlc(&s->exp_vlc);
- }
- if (s->use_noise_coding) {
- free_vlc(&s->hgain_vlc);
- }
- for(i = 0;i < 2; i++) {
- free_vlc(&s->coef_vlc[i]);
- av_free(s->run_table[i]);
- av_free(s->level_table[i]);
- }
-
- return 0;
-}
-
-AVCodec wmav1_decoder =
-{
- "wmav1",
- CODEC_TYPE_AUDIO,
- CODEC_ID_WMAV1,
- sizeof(WMADecodeContext),
- wma_decode_init,
- NULL,
- wma_decode_end,
- wma_decode_superframe,
-};
-
-AVCodec wmav2_decoder =
-{
- "wmav2",
- CODEC_TYPE_AUDIO,
- CODEC_ID_WMAV2,
- sizeof(WMADecodeContext),
- wma_decode_init,
- NULL,
- wma_decode_end,
- wma_decode_superframe,
-};
diff --git a/src/libffmpeg/libavcodec/wmv2.c b/src/libffmpeg/libavcodec/wmv2.c
deleted file mode 100644
index f3d4f0f23..000000000
--- a/src/libffmpeg/libavcodec/wmv2.c
+++ /dev/null
@@ -1,861 +0,0 @@
-/*
- * Copyright (c) 2002 The FFmpeg Project.
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file wmv2.c
- * wmv2 codec.
- */
-
-#include "simple_idct.h"
-
-#define SKIP_TYPE_NONE 0
-#define SKIP_TYPE_MPEG 1
-#define SKIP_TYPE_ROW 2
-#define SKIP_TYPE_COL 3
-
-
-typedef struct Wmv2Context{
- MpegEncContext s;
- int j_type_bit;
- int j_type;
- int flag3;
- int flag63;
- int abt_flag;
- int abt_type;
- int abt_type_table[6];
- int per_mb_abt;
- int per_block_abt;
- int mspel_bit;
- int cbp_table_index;
- int top_left_mv_flag;
- int per_mb_rl_bit;
- int skip_type;
- int hshift;
-
- ScanTable abt_scantable[2];
- DECLARE_ALIGNED_8(DCTELEM, abt_block2[6][64]);
-}Wmv2Context;
-
-static void wmv2_common_init(Wmv2Context * w){
- MpegEncContext * const s= &w->s;
-
- ff_init_scantable(s->dsp.idct_permutation, &w->abt_scantable[0], wmv2_scantableA);
- ff_init_scantable(s->dsp.idct_permutation, &w->abt_scantable[1], wmv2_scantableB);
-}
-
-#ifdef CONFIG_ENCODERS
-
-static int encode_ext_header(Wmv2Context *w){
- MpegEncContext * const s= &w->s;
- PutBitContext pb;
- int code;
-
- init_put_bits(&pb, s->avctx->extradata, s->avctx->extradata_size);
-
- put_bits(&pb, 5, s->avctx->time_base.den / s->avctx->time_base.num); //yes 29.97 -> 29
- put_bits(&pb, 11, FFMIN(s->bit_rate/1024, 2047));
-
- put_bits(&pb, 1, w->mspel_bit=1);
- put_bits(&pb, 1, w->flag3=1);
- put_bits(&pb, 1, w->abt_flag=1);
- put_bits(&pb, 1, w->j_type_bit=1);
- put_bits(&pb, 1, w->top_left_mv_flag=0);
- put_bits(&pb, 1, w->per_mb_rl_bit=1);
- put_bits(&pb, 3, code=1);
-
- flush_put_bits(&pb);
-
- s->slice_height = s->mb_height / code;
-
- return 0;
-}
-
-static int wmv2_encode_init(AVCodecContext *avctx){
- Wmv2Context * const w= avctx->priv_data;
-
- if(MPV_encode_init(avctx) < 0)
- return -1;
-
- wmv2_common_init(w);
-
- avctx->extradata_size= 4;
- avctx->extradata= av_mallocz(avctx->extradata_size + 10);
- encode_ext_header(w);
-
- return 0;
-}
-
-#if 0 /* unused, remove? */
-static int wmv2_encode_end(AVCodecContext *avctx){
-
- if(MPV_encode_end(avctx) < 0)
- return -1;
-
- avctx->extradata_size= 0;
- av_freep(&avctx->extradata);
-
- return 0;
-}
-#endif
-
-int ff_wmv2_encode_picture_header(MpegEncContext * s, int picture_number)
-{
- Wmv2Context * const w= (Wmv2Context*)s;
-
- put_bits(&s->pb, 1, s->pict_type - 1);
- if(s->pict_type == I_TYPE){
- put_bits(&s->pb, 7, 0);
- }
- put_bits(&s->pb, 5, s->qscale);
-
- s->dc_table_index = 1;
- s->mv_table_index = 1; /* only if P frame */
-// s->use_skip_mb_code = 1; /* only if P frame */
- s->per_mb_rl_table = 0;
- s->mspel= 0;
- w->per_mb_abt=0;
- w->abt_type=0;
- w->j_type=0;
-
- assert(s->flipflop_rounding);
-
- if (s->pict_type == I_TYPE) {
- assert(s->no_rounding==1);
- if(w->j_type_bit) put_bits(&s->pb, 1, w->j_type);
-
- if(w->per_mb_rl_bit) put_bits(&s->pb, 1, s->per_mb_rl_table);
-
- if(!s->per_mb_rl_table){
- code012(&s->pb, s->rl_chroma_table_index);
- code012(&s->pb, s->rl_table_index);
- }
-
- put_bits(&s->pb, 1, s->dc_table_index);
-
- s->inter_intra_pred= 0;
- }else{
- int cbp_index;
-
- put_bits(&s->pb, 2, SKIP_TYPE_NONE);
-
- code012(&s->pb, cbp_index=0);
- if(s->qscale <= 10){
- int map[3]= {0,2,1};
- w->cbp_table_index= map[cbp_index];
- }else if(s->qscale <= 20){
- int map[3]= {1,0,2};
- w->cbp_table_index= map[cbp_index];
- }else{
- int map[3]= {2,1,0};
- w->cbp_table_index= map[cbp_index];
- }
-
- if(w->mspel_bit) put_bits(&s->pb, 1, s->mspel);
-
- if(w->abt_flag){
- put_bits(&s->pb, 1, w->per_mb_abt^1);
- if(!w->per_mb_abt){
- code012(&s->pb, w->abt_type);
- }
- }
-
- if(w->per_mb_rl_bit) put_bits(&s->pb, 1, s->per_mb_rl_table);
-
- if(!s->per_mb_rl_table){
- code012(&s->pb, s->rl_table_index);
- s->rl_chroma_table_index = s->rl_table_index;
- }
- put_bits(&s->pb, 1, s->dc_table_index);
- put_bits(&s->pb, 1, s->mv_table_index);
-
- s->inter_intra_pred= 0;//(s->width*s->height < 320*240 && s->bit_rate<=II_BITRATE);
- }
- s->esc3_level_length= 0;
- s->esc3_run_length= 0;
-
- return 0;
-}
-
-// nearly idential to wmv1 but thats just because we dont use the useless M$ crap features
-// its duplicated here in case someone wants to add support for these carp features
-void ff_wmv2_encode_mb(MpegEncContext * s,
- DCTELEM block[6][64],
- int motion_x, int motion_y)
-{
- Wmv2Context * const w= (Wmv2Context*)s;
- int cbp, coded_cbp, i;
- int pred_x, pred_y;
- uint8_t *coded_block;
-
- handle_slices(s);
-
- if (!s->mb_intra) {
- /* compute cbp */
- cbp = 0;
- for (i = 0; i < 6; i++) {
- if (s->block_last_index[i] >= 0)
- cbp |= 1 << (5 - i);
- }
-
- put_bits(&s->pb,
- wmv2_inter_table[w->cbp_table_index][cbp + 64][1],
- wmv2_inter_table[w->cbp_table_index][cbp + 64][0]);
-
- /* motion vector */
- h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
- msmpeg4_encode_motion(s, motion_x - pred_x,
- motion_y - pred_y);
- } else {
- /* compute cbp */
- cbp = 0;
- coded_cbp = 0;
- for (i = 0; i < 6; i++) {
- int val, pred;
- val = (s->block_last_index[i] >= 1);
- cbp |= val << (5 - i);
- if (i < 4) {
- /* predict value for close blocks only for luma */
- pred = coded_block_pred(s, i, &coded_block);
- *coded_block = val;
- val = val ^ pred;
- }
- coded_cbp |= val << (5 - i);
- }
-#if 0
- if (coded_cbp)
- printf("cbp=%x %x\n", cbp, coded_cbp);
-#endif
-
- if (s->pict_type == I_TYPE) {
- put_bits(&s->pb,
- ff_msmp4_mb_i_table[coded_cbp][1], ff_msmp4_mb_i_table[coded_cbp][0]);
- } else {
- put_bits(&s->pb,
- wmv2_inter_table[w->cbp_table_index][cbp][1],
- wmv2_inter_table[w->cbp_table_index][cbp][0]);
- }
- put_bits(&s->pb, 1, 0); /* no AC prediction yet */
- if(s->inter_intra_pred){
- s->h263_aic_dir=0;
- put_bits(&s->pb, table_inter_intra[s->h263_aic_dir][1], table_inter_intra[s->h263_aic_dir][0]);
- }
- }
-
- for (i = 0; i < 6; i++) {
- msmpeg4_encode_block(s, block[i], i);
- }
-}
-#endif //CONFIG_ENCODERS
-
-static void parse_mb_skip(Wmv2Context * w){
- int mb_x, mb_y;
- MpegEncContext * const s= &w->s;
- uint32_t * const mb_type= s->current_picture_ptr->mb_type;
-
- w->skip_type= get_bits(&s->gb, 2);
- switch(w->skip_type){
- case SKIP_TYPE_NONE:
- for(mb_y=0; mb_y<s->mb_height; mb_y++){
- for(mb_x=0; mb_x<s->mb_width; mb_x++){
- mb_type[mb_y*s->mb_stride + mb_x]= MB_TYPE_16x16 | MB_TYPE_L0;
- }
- }
- break;
- case SKIP_TYPE_MPEG:
- for(mb_y=0; mb_y<s->mb_height; mb_y++){
- for(mb_x=0; mb_x<s->mb_width; mb_x++){
- mb_type[mb_y*s->mb_stride + mb_x]= (get_bits1(&s->gb) ? MB_TYPE_SKIP : 0) | MB_TYPE_16x16 | MB_TYPE_L0;
- }
- }
- break;
- case SKIP_TYPE_ROW:
- for(mb_y=0; mb_y<s->mb_height; mb_y++){
- if(get_bits1(&s->gb)){
- for(mb_x=0; mb_x<s->mb_width; mb_x++){
- mb_type[mb_y*s->mb_stride + mb_x]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0;
- }
- }else{
- for(mb_x=0; mb_x<s->mb_width; mb_x++){
- mb_type[mb_y*s->mb_stride + mb_x]= (get_bits1(&s->gb) ? MB_TYPE_SKIP : 0) | MB_TYPE_16x16 | MB_TYPE_L0;
- }
- }
- }
- break;
- case SKIP_TYPE_COL:
- for(mb_x=0; mb_x<s->mb_width; mb_x++){
- if(get_bits1(&s->gb)){
- for(mb_y=0; mb_y<s->mb_height; mb_y++){
- mb_type[mb_y*s->mb_stride + mb_x]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0;
- }
- }else{
- for(mb_y=0; mb_y<s->mb_height; mb_y++){
- mb_type[mb_y*s->mb_stride + mb_x]= (get_bits1(&s->gb) ? MB_TYPE_SKIP : 0) | MB_TYPE_16x16 | MB_TYPE_L0;
- }
- }
- }
- break;
- }
-}
-
-static int decode_ext_header(Wmv2Context *w){
- MpegEncContext * const s= &w->s;
- GetBitContext gb;
- int fps;
- int code;
-
- if(s->avctx->extradata_size<4) return -1;
-
- init_get_bits(&gb, s->avctx->extradata, s->avctx->extradata_size*8);
-
- fps = get_bits(&gb, 5);
- s->bit_rate = get_bits(&gb, 11)*1024;
- w->mspel_bit = get_bits1(&gb);
- w->flag3 = get_bits1(&gb);
- w->abt_flag = get_bits1(&gb);
- w->j_type_bit = get_bits1(&gb);
- w->top_left_mv_flag= get_bits1(&gb);
- w->per_mb_rl_bit = get_bits1(&gb);
- code = get_bits(&gb, 3);
-
- if(code==0) return -1;
-
- s->slice_height = s->mb_height / code;
-
- if(s->avctx->debug&FF_DEBUG_PICT_INFO){
- av_log(s->avctx, AV_LOG_DEBUG, "fps:%d, br:%d, qpbit:%d, abt_flag:%d, j_type_bit:%d, tl_mv_flag:%d, mbrl_bit:%d, code:%d, flag3:%d, slices:%d\n",
- fps, s->bit_rate, w->mspel_bit, w->abt_flag, w->j_type_bit, w->top_left_mv_flag, w->per_mb_rl_bit, code, w->flag3,
- code);
- }
- return 0;
-}
-
-int ff_wmv2_decode_picture_header(MpegEncContext * s)
-{
- Wmv2Context * const w= (Wmv2Context*)s;
- int code;
-
-#if 0
-{
-int i;
-for(i=0; i<s->gb.size*8; i++)
- printf("%d", get_bits1(&s->gb));
-// get_bits1(&s->gb);
-printf("END\n");
-return -1;
-}
-#endif
- if(s->picture_number==0)
- decode_ext_header(w);
-
- s->pict_type = get_bits(&s->gb, 1) + 1;
- if(s->pict_type == I_TYPE){
- code = get_bits(&s->gb, 7);
- av_log(s->avctx, AV_LOG_DEBUG, "I7:%X/\n", code);
- }
- s->chroma_qscale= s->qscale = get_bits(&s->gb, 5);
- if(s->qscale < 0)
- return -1;
-
- return 0;
-}
-
-int ff_wmv2_decode_secondary_picture_header(MpegEncContext * s)
-{
- Wmv2Context * const w= (Wmv2Context*)s;
-
- if (s->pict_type == I_TYPE) {
- if(w->j_type_bit) w->j_type= get_bits1(&s->gb);
- else w->j_type= 0; //FIXME check
-
- if(!w->j_type){
- if(w->per_mb_rl_bit) s->per_mb_rl_table= get_bits1(&s->gb);
- else s->per_mb_rl_table= 0;
-
- if(!s->per_mb_rl_table){
- s->rl_chroma_table_index = decode012(&s->gb);
- s->rl_table_index = decode012(&s->gb);
- }
-
- s->dc_table_index = get_bits1(&s->gb);
- }
- s->inter_intra_pred= 0;
- s->no_rounding = 1;
- if(s->avctx->debug&FF_DEBUG_PICT_INFO){
- av_log(s->avctx, AV_LOG_DEBUG, "qscale:%d rlc:%d rl:%d dc:%d mbrl:%d j_type:%d \n",
- s->qscale,
- s->rl_chroma_table_index,
- s->rl_table_index,
- s->dc_table_index,
- s->per_mb_rl_table,
- w->j_type);
- }
- }else{
- int cbp_index;
- w->j_type=0;
-
- parse_mb_skip(w);
- cbp_index= decode012(&s->gb);
- if(s->qscale <= 10){
- int map[3]= {0,2,1};
- w->cbp_table_index= map[cbp_index];
- }else if(s->qscale <= 20){
- int map[3]= {1,0,2};
- w->cbp_table_index= map[cbp_index];
- }else{
- int map[3]= {2,1,0};
- w->cbp_table_index= map[cbp_index];
- }
-
- if(w->mspel_bit) s->mspel= get_bits1(&s->gb);
- else s->mspel= 0; //FIXME check
-
- if(w->abt_flag){
- w->per_mb_abt= get_bits1(&s->gb)^1;
- if(!w->per_mb_abt){
- w->abt_type= decode012(&s->gb);
- }
- }
-
- if(w->per_mb_rl_bit) s->per_mb_rl_table= get_bits1(&s->gb);
- else s->per_mb_rl_table= 0;
-
- if(!s->per_mb_rl_table){
- s->rl_table_index = decode012(&s->gb);
- s->rl_chroma_table_index = s->rl_table_index;
- }
-
- s->dc_table_index = get_bits1(&s->gb);
- s->mv_table_index = get_bits1(&s->gb);
-
- s->inter_intra_pred= 0;//(s->width*s->height < 320*240 && s->bit_rate<=II_BITRATE);
- s->no_rounding ^= 1;
-
- if(s->avctx->debug&FF_DEBUG_PICT_INFO){
- av_log(s->avctx, AV_LOG_DEBUG, "rl:%d rlc:%d dc:%d mv:%d mbrl:%d qp:%d mspel:%d per_mb_abt:%d abt_type:%d cbp:%d ii:%d\n",
- s->rl_table_index,
- s->rl_chroma_table_index,
- s->dc_table_index,
- s->mv_table_index,
- s->per_mb_rl_table,
- s->qscale,
- s->mspel,
- w->per_mb_abt,
- w->abt_type,
- w->cbp_table_index,
- s->inter_intra_pred);
- }
- }
- s->esc3_level_length= 0;
- s->esc3_run_length= 0;
-
-s->picture_number++; //FIXME ?
-
-
-// if(w->j_type)
-// return wmv2_decode_j_picture(w); //FIXME
-
- if(w->j_type){
- av_log(s->avctx, AV_LOG_ERROR, "J-type picture is not supported\n");
- return -1;
- }
-
- return 0;
-}
-
-static inline int wmv2_decode_motion(Wmv2Context *w, int *mx_ptr, int *my_ptr){
- MpegEncContext * const s= &w->s;
- int ret;
-
- ret= msmpeg4_decode_motion(s, mx_ptr, my_ptr);
-
- if(ret<0) return -1;
-
- if((((*mx_ptr)|(*my_ptr)) & 1) && s->mspel)
- w->hshift= get_bits1(&s->gb);
- else
- w->hshift= 0;
-
-//printf("%d %d ", *mx_ptr, *my_ptr);
-
- return 0;
-}
-
-static int16_t *wmv2_pred_motion(Wmv2Context *w, int *px, int *py){
- MpegEncContext * const s= &w->s;
- int xy, wrap, diff, type;
- int16_t *A, *B, *C, *mot_val;
-
- wrap = s->b8_stride;
- xy = s->block_index[0];
-
- mot_val = s->current_picture.motion_val[0][xy];
-
- A = s->current_picture.motion_val[0][xy - 1];
- B = s->current_picture.motion_val[0][xy - wrap];
- C = s->current_picture.motion_val[0][xy + 2 - wrap];
-
- if(s->mb_x && !s->first_slice_line && !s->mspel && w->top_left_mv_flag)
- diff= FFMAX(FFABS(A[0] - B[0]), FFABS(A[1] - B[1]));
- else
- diff=0;
-
- if(diff >= 8)
- type= get_bits1(&s->gb);
- else
- type= 2;
-
- if(type == 0){
- *px= A[0];
- *py= A[1];
- }else if(type == 1){
- *px= B[0];
- *py= B[1];
- }else{
- /* special case for first (slice) line */
- if (s->first_slice_line) {
- *px = A[0];
- *py = A[1];
- } else {
- *px = mid_pred(A[0], B[0], C[0]);
- *py = mid_pred(A[1], B[1], C[1]);
- }
- }
-
- return mot_val;
-}
-
-static inline int wmv2_decode_inter_block(Wmv2Context *w, DCTELEM *block, int n, int cbp){
- MpegEncContext * const s= &w->s;
- static const int sub_cbp_table[3]= {2,3,1};
- int sub_cbp;
-
- if(!cbp){
- s->block_last_index[n] = -1;
-
- return 0;
- }
-
- if(w->per_block_abt)
- w->abt_type= decode012(&s->gb);
-#if 0
- if(w->per_block_abt)
- printf("B%d", w->abt_type);
-#endif
- w->abt_type_table[n]= w->abt_type;
-
- if(w->abt_type){
-// const uint8_t *scantable= w->abt_scantable[w->abt_type-1].permutated;
- const uint8_t *scantable= w->abt_scantable[w->abt_type-1].scantable;
-// const uint8_t *scantable= w->abt_type-1 ? w->abt_scantable[1].permutated : w->abt_scantable[0].scantable;
-
- sub_cbp= sub_cbp_table[ decode012(&s->gb) ];
-// printf("S%d", sub_cbp);
-
- if(sub_cbp&1){
- if (msmpeg4_decode_block(s, block, n, 1, scantable) < 0)
- return -1;
- }
-
- if(sub_cbp&2){
- if (msmpeg4_decode_block(s, w->abt_block2[n], n, 1, scantable) < 0)
- return -1;
- }
- s->block_last_index[n] = 63;
-
- return 0;
- }else{
- return msmpeg4_decode_block(s, block, n, 1, s->inter_scantable.permutated);
- }
-}
-
-static void wmv2_add_block(Wmv2Context *w, DCTELEM *block1, uint8_t *dst, int stride, int n){
- MpegEncContext * const s= &w->s;
-
- if (s->block_last_index[n] >= 0) {
- switch(w->abt_type_table[n]){
- case 0:
- s->dsp.idct_add (dst, stride, block1);
- break;
- case 1:
- simple_idct84_add(dst , stride, block1);
- simple_idct84_add(dst + 4*stride, stride, w->abt_block2[n]);
- memset(w->abt_block2[n], 0, 64*sizeof(DCTELEM));
- break;
- case 2:
- simple_idct48_add(dst , stride, block1);
- simple_idct48_add(dst + 4 , stride, w->abt_block2[n]);
- memset(w->abt_block2[n], 0, 64*sizeof(DCTELEM));
- break;
- default:
- av_log(s->avctx, AV_LOG_ERROR, "internal error in WMV2 abt\n");
- }
- }
-}
-
-void ff_wmv2_add_mb(MpegEncContext *s, DCTELEM block1[6][64], uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr){
- Wmv2Context * const w= (Wmv2Context*)s;
-
- wmv2_add_block(w, block1[0], dest_y , s->linesize, 0);
- wmv2_add_block(w, block1[1], dest_y + 8 , s->linesize, 1);
- wmv2_add_block(w, block1[2], dest_y + 8*s->linesize, s->linesize, 2);
- wmv2_add_block(w, block1[3], dest_y + 8 + 8*s->linesize, s->linesize, 3);
-
- if(s->flags&CODEC_FLAG_GRAY) return;
-
- wmv2_add_block(w, block1[4], dest_cb , s->uvlinesize, 4);
- wmv2_add_block(w, block1[5], dest_cr , s->uvlinesize, 5);
-}
-
-void ff_mspel_motion(MpegEncContext *s,
- uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
- uint8_t **ref_picture, op_pixels_func (*pix_op)[4],
- int motion_x, int motion_y, int h)
-{
- Wmv2Context * const w= (Wmv2Context*)s;
- uint8_t *ptr;
- int dxy, offset, mx, my, src_x, src_y, v_edge_pos, linesize, uvlinesize;
- int emu=0;
-
- dxy = ((motion_y & 1) << 1) | (motion_x & 1);
- dxy = 2*dxy + w->hshift;
- src_x = s->mb_x * 16 + (motion_x >> 1);
- src_y = s->mb_y * 16 + (motion_y >> 1);
-
- /* WARNING: do no forget half pels */
- v_edge_pos = s->v_edge_pos;
- src_x = clip(src_x, -16, s->width);
- src_y = clip(src_y, -16, s->height);
-
- if(src_x<=-16 || src_x >= s->width)
- dxy &= ~3;
- if(src_y<=-16 || src_y >= s->height)
- dxy &= ~4;
-
- linesize = s->linesize;
- uvlinesize = s->uvlinesize;
- ptr = ref_picture[0] + (src_y * linesize) + src_x;
-
- if(s->flags&CODEC_FLAG_EMU_EDGE){
- if(src_x<1 || src_y<1 || src_x + 17 >= s->h_edge_pos
- || src_y + h+1 >= v_edge_pos){
- ff_emulated_edge_mc(s->edge_emu_buffer, ptr - 1 - s->linesize, s->linesize, 19, 19,
- src_x-1, src_y-1, s->h_edge_pos, s->v_edge_pos);
- ptr= s->edge_emu_buffer + 1 + s->linesize;
- emu=1;
- }
- }
-
- s->dsp.put_mspel_pixels_tab[dxy](dest_y , ptr , linesize);
- s->dsp.put_mspel_pixels_tab[dxy](dest_y+8 , ptr+8 , linesize);
- s->dsp.put_mspel_pixels_tab[dxy](dest_y +8*linesize, ptr +8*linesize, linesize);
- s->dsp.put_mspel_pixels_tab[dxy](dest_y+8+8*linesize, ptr+8+8*linesize, linesize);
-
- if(s->flags&CODEC_FLAG_GRAY) return;
-
- if (s->out_format == FMT_H263) {
- dxy = 0;
- if ((motion_x & 3) != 0)
- dxy |= 1;
- if ((motion_y & 3) != 0)
- dxy |= 2;
- mx = motion_x >> 2;
- my = motion_y >> 2;
- } else {
- mx = motion_x / 2;
- my = motion_y / 2;
- dxy = ((my & 1) << 1) | (mx & 1);
- mx >>= 1;
- my >>= 1;
- }
-
- src_x = s->mb_x * 8 + mx;
- src_y = s->mb_y * 8 + my;
- src_x = clip(src_x, -8, s->width >> 1);
- if (src_x == (s->width >> 1))
- dxy &= ~1;
- src_y = clip(src_y, -8, s->height >> 1);
- if (src_y == (s->height >> 1))
- dxy &= ~2;
- offset = (src_y * uvlinesize) + src_x;
- ptr = ref_picture[1] + offset;
- if(emu){
- ff_emulated_edge_mc(s->edge_emu_buffer, ptr, s->uvlinesize, 9, 9,
- src_x, src_y, s->h_edge_pos>>1, s->v_edge_pos>>1);
- ptr= s->edge_emu_buffer;
- }
- pix_op[1][dxy](dest_cb, ptr, uvlinesize, h >> 1);
-
- ptr = ref_picture[2] + offset;
- if(emu){
- ff_emulated_edge_mc(s->edge_emu_buffer, ptr, s->uvlinesize, 9, 9,
- src_x, src_y, s->h_edge_pos>>1, s->v_edge_pos>>1);
- ptr= s->edge_emu_buffer;
- }
- pix_op[1][dxy](dest_cr, ptr, uvlinesize, h >> 1);
-}
-
-
-static int wmv2_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
-{
- Wmv2Context * const w= (Wmv2Context*)s;
- int cbp, code, i;
- uint8_t *coded_val;
-
- if(w->j_type) return 0;
-
- if (s->pict_type == P_TYPE) {
- if(IS_SKIP(s->current_picture.mb_type[s->mb_y * s->mb_stride + s->mb_x])){
- /* skip mb */
- s->mb_intra = 0;
- for(i=0;i<6;i++)
- s->block_last_index[i] = -1;
- s->mv_dir = MV_DIR_FORWARD;
- s->mv_type = MV_TYPE_16X16;
- s->mv[0][0][0] = 0;
- s->mv[0][0][1] = 0;
- s->mb_skipped = 1;
- w->hshift=0;
- return 0;
- }
-
- code = get_vlc2(&s->gb, mb_non_intra_vlc[w->cbp_table_index].table, MB_NON_INTRA_VLC_BITS, 3);
- if (code < 0)
- return -1;
- s->mb_intra = (~code & 0x40) >> 6;
-
- cbp = code & 0x3f;
- } else {
- s->mb_intra = 1;
- code = get_vlc2(&s->gb, ff_msmp4_mb_i_vlc.table, MB_INTRA_VLC_BITS, 2);
- if (code < 0){
- av_log(s->avctx, AV_LOG_ERROR, "II-cbp illegal at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
- /* predict coded block pattern */
- cbp = 0;
- for(i=0;i<6;i++) {
- int val = ((code >> (5 - i)) & 1);
- if (i < 4) {
- int pred = coded_block_pred(s, i, &coded_val);
- val = val ^ pred;
- *coded_val = val;
- }
- cbp |= val << (5 - i);
- }
- }
-
- if (!s->mb_intra) {
- int mx, my;
-//printf("P at %d %d\n", s->mb_x, s->mb_y);
- wmv2_pred_motion(w, &mx, &my);
-
- if(cbp){
- s->dsp.clear_blocks(s->block[0]);
- if(s->per_mb_rl_table){
- s->rl_table_index = decode012(&s->gb);
- s->rl_chroma_table_index = s->rl_table_index;
- }
-
- if(w->abt_flag && w->per_mb_abt){
- w->per_block_abt= get_bits1(&s->gb);
- if(!w->per_block_abt)
- w->abt_type= decode012(&s->gb);
- }else
- w->per_block_abt=0;
- }
-
- if (wmv2_decode_motion(w, &mx, &my) < 0)
- return -1;
-
- s->mv_dir = MV_DIR_FORWARD;
- s->mv_type = MV_TYPE_16X16;
- s->mv[0][0][0] = mx;
- s->mv[0][0][1] = my;
-
- for (i = 0; i < 6; i++) {
- if (wmv2_decode_inter_block(w, block[i], i, (cbp >> (5 - i)) & 1) < 0)
- {
- av_log(s->avctx, AV_LOG_ERROR, "\nerror while decoding inter block: %d x %d (%d)\n", s->mb_x, s->mb_y, i);
- return -1;
- }
- }
- } else {
-//if(s->pict_type==P_TYPE)
-// printf("%d%d ", s->inter_intra_pred, cbp);
-//printf("I at %d %d %d %06X\n", s->mb_x, s->mb_y, ((cbp&3)? 1 : 0) +((cbp&0x3C)? 2 : 0), show_bits(&s->gb, 24));
- s->ac_pred = get_bits1(&s->gb);
- if(s->inter_intra_pred){
- s->h263_aic_dir= get_vlc2(&s->gb, inter_intra_vlc.table, INTER_INTRA_VLC_BITS, 1);
-// printf("%d%d %d %d/", s->ac_pred, s->h263_aic_dir, s->mb_x, s->mb_y);
- }
- if(s->per_mb_rl_table && cbp){
- s->rl_table_index = decode012(&s->gb);
- s->rl_chroma_table_index = s->rl_table_index;
- }
-
- s->dsp.clear_blocks(s->block[0]);
- for (i = 0; i < 6; i++) {
- if (msmpeg4_decode_block(s, block[i], i, (cbp >> (5 - i)) & 1, NULL) < 0)
- {
- av_log(s->avctx, AV_LOG_ERROR, "\nerror while decoding intra block: %d x %d (%d)\n", s->mb_x, s->mb_y, i);
- return -1;
- }
- }
- }
-
- return 0;
-}
-
-static int wmv2_decode_init(AVCodecContext *avctx){
- Wmv2Context * const w= avctx->priv_data;
-
- if(ff_h263_decode_init(avctx) < 0)
- return -1;
-
- wmv2_common_init(w);
-
- return 0;
-}
-
-AVCodec wmv2_decoder = {
- "wmv2",
- CODEC_TYPE_VIDEO,
- CODEC_ID_WMV2,
- sizeof(Wmv2Context),
- wmv2_decode_init,
- NULL,
- ff_h263_decode_end,
- ff_h263_decode_frame,
- CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
-};
-
-#ifdef CONFIG_ENCODERS
-AVCodec wmv2_encoder = {
- "wmv2",
- CODEC_TYPE_VIDEO,
- CODEC_ID_WMV2,
- sizeof(Wmv2Context),
- wmv2_encode_init,
- MPV_encode_picture,
- MPV_encode_end,
- .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV420P, -1},
-};
-#endif
diff --git a/src/libffmpeg/libavcodec/wnv1.c b/src/libffmpeg/libavcodec/wnv1.c
deleted file mode 100644
index 46b31a5c5..000000000
--- a/src/libffmpeg/libavcodec/wnv1.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Winnov WNV1 codec
- * Copyright (c) 2005 Konstantin Shishkov
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file wnv1.c
- * Winnov WNV1 codec.
- */
-
-#include "avcodec.h"
-#include "common.h"
-#include "bitstream.h"
-
-
-typedef struct WNV1Context{
- AVCodecContext *avctx;
- AVFrame pic;
-
- int shift;
- GetBitContext gb;
-} WNV1Context;
-
-static uint16_t code_tab[16][2]={
-{0x1FD,9}, {0xFD,8}, {0x7D,7}, {0x3D,6}, {0x1D,5}, {0x0D,4}, {0x005,3},
-{0x000,1},
-{0x004,3}, {0x0C,4}, {0x1C,5}, {0x3C,6}, {0x7C,7}, {0xFC,8}, {0x1FC,9}, {0xFF,8}
-};
-
-#define CODE_VLC_BITS 9
-static VLC code_vlc;
-
-/* returns modified base_value */
-static inline int wnv1_get_code(WNV1Context *w, int base_value)
-{
- int v = get_vlc2(&w->gb, code_vlc.table, CODE_VLC_BITS, 1);
-
- if(v==15)
- return ff_reverse[ get_bits(&w->gb, 8 - w->shift) ];
- else
- return base_value + ((v - 7)<<w->shift);
-}
-
-static int decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- WNV1Context * const l = avctx->priv_data;
- AVFrame * const p= (AVFrame*)&l->pic;
- unsigned char *Y,*U,*V;
- int i, j;
- int prev_y = 0, prev_u = 0, prev_v = 0;
-
- if(p->data[0])
- avctx->release_buffer(avctx, p);
-
- p->reference = 0;
- if(avctx->get_buffer(avctx, p) < 0){
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
- p->key_frame = 1;
-
- for(i=8; i<buf_size; i++)
- buf[i]= ff_reverse[ buf[i] ]; //FIXME ensure that the buffer is modifyable or use a temp one
- init_get_bits(&l->gb, buf+8, (buf_size-8)*8);
-
- if (buf[2] >> 4 == 6)
- l->shift = 2;
- else {
- l->shift = 8 - (buf[2] >> 4);
- if (l->shift > 4) {
- av_log(avctx, AV_LOG_ERROR, "Unknown WNV1 frame header value %i, please upload file for study\n", buf[2] >> 4);
- l->shift = 4;
- }
- if (l->shift < 1) {
- av_log(avctx, AV_LOG_ERROR, "Unknown WNV1 frame header value %i, please upload file for study\n", buf[2] >> 4);
- l->shift = 1;
- }
- }
-
- Y = p->data[0];
- U = p->data[1];
- V = p->data[2];
- for (j = 0; j < avctx->height; j++) {
- for (i = 0; i < avctx->width / 2; i++) {
- Y[i * 2] = wnv1_get_code(l, prev_y);
- prev_u = U[i] = wnv1_get_code(l, prev_u);
- prev_y = Y[(i * 2) + 1] = wnv1_get_code(l, Y[i * 2]);
- prev_v = V[i] = wnv1_get_code(l, prev_v);
- }
- Y += p->linesize[0];
- U += p->linesize[1];
- V += p->linesize[2];
- }
-
-
- *data_size = sizeof(AVFrame);
- *(AVFrame*)data = l->pic;
-
- return buf_size;
-}
-
-static int decode_init(AVCodecContext *avctx){
- WNV1Context * const l = avctx->priv_data;
-
- l->avctx = avctx;
- avctx->pix_fmt = PIX_FMT_YUV422P;
-
- if(!code_vlc.table){
- init_vlc(&code_vlc, CODE_VLC_BITS, 16,
- &code_tab[0][1], 4, 2,
- &code_tab[0][0], 4, 2, 1);
- }
-
- return 0;
-}
-
-AVCodec wnv1_decoder = {
- "wnv1",
- CODEC_TYPE_VIDEO,
- CODEC_ID_WNV1,
- sizeof(WNV1Context),
- decode_init,
- NULL,
- NULL,
- decode_frame,
- CODEC_CAP_DR1,
-};
diff --git a/src/libffmpeg/libavcodec/ws-snd1.c b/src/libffmpeg/libavcodec/ws-snd1.c
deleted file mode 100644
index 3624909a3..000000000
--- a/src/libffmpeg/libavcodec/ws-snd1.c
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Westwood SNDx codecs
- * Copyright (c) 2005 Konstantin Shishkov
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include "avcodec.h"
-
-/**
- * @file ws-snd.c
- * Westwood SNDx codecs.
- *
- * Reference documents about VQA format and its audio codecs
- * can be found here:
- * http://www.multimedia.cx
- */
-
-static const char ws_adpcm_2bit[] = { -2, -1, 0, 1};
-static const char ws_adpcm_4bit[] = {
- -9, -8, -6, -5, -4, -3, -2, -1,
- 0, 1, 2, 3, 4, 5, 6, 8 };
-
-#define CLIP8(a) if(a>127)a=127;if(a<-128)a=-128;
-
-static int ws_snd_decode_init(AVCodecContext * avctx)
-{
-// WSSNDContext *c = avctx->priv_data;
-
- return 0;
-}
-
-static int ws_snd_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
-// WSSNDContext *c = avctx->priv_data;
-
- int in_size, out_size;
- int sample = 0;
- int i;
- short *samples = data;
-
- if (!buf_size)
- return 0;
-
- out_size = AV_RL16(&buf[0]);
- *data_size = out_size * 2;
- in_size = AV_RL16(&buf[2]);
- buf += 4;
-
- if (in_size == out_size) {
- for (i = 0; i < out_size; i++)
- *samples++ = (*buf++ - 0x80) << 8;
- return buf_size;
- }
-
- while (out_size > 0) {
- int code;
- uint8_t count;
- code = (*buf) >> 6;
- count = (*buf) & 0x3F;
- buf++;
- switch(code) {
- case 0: /* ADPCM 2-bit */
- for (count++; count > 0; count--) {
- code = *buf++;
- sample += ws_adpcm_2bit[code & 0x3];
- CLIP8(sample);
- *samples++ = sample << 8;
- sample += ws_adpcm_2bit[(code >> 2) & 0x3];
- CLIP8(sample);
- *samples++ = sample << 8;
- sample += ws_adpcm_2bit[(code >> 4) & 0x3];
- CLIP8(sample);
- *samples++ = sample << 8;
- sample += ws_adpcm_2bit[(code >> 6) & 0x3];
- CLIP8(sample);
- *samples++ = sample << 8;
- out_size -= 4;
- }
- break;
- case 1: /* ADPCM 4-bit */
- for (count++; count > 0; count--) {
- code = *buf++;
- sample += ws_adpcm_4bit[code & 0xF];
- CLIP8(sample);
- *samples++ = sample << 8;
- sample += ws_adpcm_4bit[code >> 4];
- CLIP8(sample);
- *samples++ = sample << 8;
- out_size -= 2;
- }
- break;
- case 2: /* no compression */
- if (count & 0x20) { /* big delta */
- char t;
- t = count;
- t <<= 3;
- sample += t >> 3;
- *samples++ = sample << 8;
- out_size--;
- } else { /* copy */
- for (count++; count > 0; count--) {
- *samples++ = (*buf++ - 0x80) << 8;
- out_size--;
- }
- sample = buf[-1] - 0x80;
- }
- break;
- default: /* run */
- for(count++; count > 0; count--) {
- *samples++ = sample << 8;
- out_size--;
- }
- }
- }
-
- return buf_size;
-}
-
-AVCodec ws_snd1_decoder = {
- "ws_snd1",
- CODEC_TYPE_AUDIO,
- CODEC_ID_WESTWOOD_SND1,
- 0,
- ws_snd_decode_init,
- NULL,
- NULL,
- ws_snd_decode_frame,
-};
diff --git a/src/libffmpeg/libavcodec/xan.c b/src/libffmpeg/libavcodec/xan.c
deleted file mode 100644
index f697514a0..000000000
--- a/src/libffmpeg/libavcodec/xan.c
+++ /dev/null
@@ -1,492 +0,0 @@
-/*
- * Wing Commander/Xan Video Decoder
- * Copyright (C) 2003 the ffmpeg project
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file xan.c
- * Xan video decoder for Wing Commander III computer game
- * by Mario Brito (mbrito@student.dei.uc.pt)
- * and Mike Melanson (melanson@pcisys.net)
- *
- * The xan_wc3 decoder outputs PAL8 data.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "common.h"
-#include "avcodec.h"
-
-typedef struct XanContext {
-
- AVCodecContext *avctx;
- AVFrame last_frame;
- AVFrame current_frame;
-
- unsigned char *buf;
- int size;
-
- /* scratch space */
- unsigned char *buffer1;
- int buffer1_size;
- unsigned char *buffer2;
- int buffer2_size;
-
- int frame_size;
-
-} XanContext;
-
-static int xan_decode_init(AVCodecContext *avctx)
-{
- XanContext *s = avctx->priv_data;
-
- s->avctx = avctx;
- s->frame_size = 0;
-
- if ((avctx->codec->id == CODEC_ID_XAN_WC3) &&
- (s->avctx->palctrl == NULL)) {
- av_log(avctx, AV_LOG_ERROR, " WC3 Xan video: palette expected.\n");
- return -1;
- }
-
- avctx->pix_fmt = PIX_FMT_PAL8;
- avctx->has_b_frames = 0;
-
- if(avcodec_check_dimensions(avctx, avctx->width, avctx->height))
- return -1;
-
- s->buffer1_size = avctx->width * avctx->height;
- s->buffer1 = av_malloc(s->buffer1_size);
- s->buffer2_size = avctx->width * avctx->height;
- s->buffer2 = av_malloc(s->buffer2_size);
- if (!s->buffer1 || !s->buffer2)
- return -1;
-
- return 0;
-}
-
-/* This function is used in lieu of memcpy(). This decoder can not use
- * memcpy because the memory locations often overlap and
- * memcpy doesn't like that; it's not uncommon, for example, for
- * dest = src+1, to turn byte A into pattern AAAAAAAA.
- * This was originally repz movsb in Intel x86 ASM. */
-static inline void bytecopy(unsigned char *dest, unsigned char *src, int count)
-{
- int i;
-
- for (i = 0; i < count; i++)
- dest[i] = src[i];
-}
-
-static int xan_huffman_decode(unsigned char *dest, unsigned char *src,
- int dest_len)
-{
- unsigned char byte = *src++;
- unsigned char ival = byte + 0x16;
- unsigned char * ptr = src + byte*2;
- unsigned char val = ival;
- int counter = 0;
- unsigned char *dest_end = dest + dest_len;
-
- unsigned char bits = *ptr++;
-
- while ( val != 0x16 ) {
- if ( (1 << counter) & bits )
- val = src[byte + val - 0x17];
- else
- val = src[val - 0x17];
-
- if ( val < 0x16 ) {
- if (dest + 1 > dest_end)
- return 0;
- *dest++ = val;
- val = ival;
- }
-
- if (counter++ == 7) {
- counter = 0;
- bits = *ptr++;
- }
- }
-
- return 0;
-}
-
-static void xan_unpack(unsigned char *dest, unsigned char *src, int dest_len)
-{
- unsigned char opcode;
- int size;
- int offset;
- int byte1, byte2, byte3;
- unsigned char *dest_end = dest + dest_len;
-
- for (;;) {
- opcode = *src++;
-
- if ( (opcode & 0x80) == 0 ) {
-
- offset = *src++;
-
- size = opcode & 3;
- if (dest + size > dest_end)
- return;
- bytecopy(dest, src, size); dest += size; src += size;
-
- size = ((opcode & 0x1c) >> 2) + 3;
- if (dest + size > dest_end)
- return;
- bytecopy (dest, dest - (((opcode & 0x60) << 3) + offset + 1), size);
- dest += size;
-
- } else if ( (opcode & 0x40) == 0 ) {
-
- byte1 = *src++;
- byte2 = *src++;
-
- size = byte1 >> 6;
- if (dest + size > dest_end)
- return;
- bytecopy (dest, src, size); dest += size; src += size;
-
- size = (opcode & 0x3f) + 4;
- if (dest + size > dest_end)
- return;
- bytecopy (dest, dest - (((byte1 & 0x3f) << 8) + byte2 + 1), size);
- dest += size;
-
- } else if ( (opcode & 0x20) == 0 ) {
-
- byte1 = *src++;
- byte2 = *src++;
- byte3 = *src++;
-
- size = opcode & 3;
- if (dest + size > dest_end)
- return;
- bytecopy (dest, src, size); dest += size; src += size;
-
- size = byte3 + 5 + ((opcode & 0xc) << 6);
- if (dest + size > dest_end)
- return;
- bytecopy (dest,
- dest - ((((opcode & 0x10) >> 4) << 0x10) + 1 + (byte1 << 8) + byte2),
- size);
- dest += size;
- } else {
- size = ((opcode & 0x1f) << 2) + 4;
-
- if (size > 0x70)
- break;
-
- if (dest + size > dest_end)
- return;
- bytecopy (dest, src, size); dest += size; src += size;
- }
- }
-
- size = opcode & 3;
- bytecopy(dest, src, size); dest += size; src += size;
-}
-
-static void inline xan_wc3_output_pixel_run(XanContext *s,
- unsigned char *pixel_buffer, int x, int y, int pixel_count)
-{
- int stride;
- int line_inc;
- int index;
- int current_x;
- int width = s->avctx->width;
- unsigned char *palette_plane;
-
- palette_plane = s->current_frame.data[0];
- stride = s->current_frame.linesize[0];
- line_inc = stride - width;
- index = y * stride + x;
- current_x = x;
- while((pixel_count--) && (index < s->frame_size)) {
-
- /* don't do a memcpy() here; keyframes generally copy an entire
- * frame of data and the stride needs to be accounted for */
- palette_plane[index++] = *pixel_buffer++;
-
- current_x++;
- if (current_x >= width) {
- index += line_inc;
- current_x = 0;
- }
- }
-}
-
-static void inline xan_wc3_copy_pixel_run(XanContext *s,
- int x, int y, int pixel_count, int motion_x, int motion_y)
-{
- int stride;
- int line_inc;
- int curframe_index, prevframe_index;
- int curframe_x, prevframe_x;
- int width = s->avctx->width;
- unsigned char *palette_plane, *prev_palette_plane;
-
- palette_plane = s->current_frame.data[0];
- prev_palette_plane = s->last_frame.data[0];
- stride = s->current_frame.linesize[0];
- line_inc = stride - width;
- curframe_index = y * stride + x;
- curframe_x = x;
- prevframe_index = (y + motion_y) * stride + x + motion_x;
- prevframe_x = x + motion_x;
- while((pixel_count--) && (curframe_index < s->frame_size)) {
-
- palette_plane[curframe_index++] =
- prev_palette_plane[prevframe_index++];
-
- curframe_x++;
- if (curframe_x >= width) {
- curframe_index += line_inc;
- curframe_x = 0;
- }
-
- prevframe_x++;
- if (prevframe_x >= width) {
- prevframe_index += line_inc;
- prevframe_x = 0;
- }
- }
-}
-
-static void xan_wc3_decode_frame(XanContext *s) {
-
- int width = s->avctx->width;
- int height = s->avctx->height;
- int total_pixels = width * height;
- unsigned char opcode;
- unsigned char flag = 0;
- int size = 0;
- int motion_x, motion_y;
- int x, y;
-
- unsigned char *opcode_buffer = s->buffer1;
- int opcode_buffer_size = s->buffer1_size;
- unsigned char *imagedata_buffer = s->buffer2;
- int imagedata_buffer_size = s->buffer2_size;
-
- /* pointers to segments inside the compressed chunk */
- unsigned char *huffman_segment;
- unsigned char *size_segment;
- unsigned char *vector_segment;
- unsigned char *imagedata_segment;
-
- huffman_segment = s->buf + AV_RL16(&s->buf[0]);
- size_segment = s->buf + AV_RL16(&s->buf[2]);
- vector_segment = s->buf + AV_RL16(&s->buf[4]);
- imagedata_segment = s->buf + AV_RL16(&s->buf[6]);
-
- xan_huffman_decode(opcode_buffer, huffman_segment, opcode_buffer_size);
-
- if (imagedata_segment[0] == 2)
- xan_unpack(imagedata_buffer, &imagedata_segment[1],
- imagedata_buffer_size);
- else
- imagedata_buffer = &imagedata_segment[1];
-
- /* use the decoded data segments to build the frame */
- x = y = 0;
- while (total_pixels) {
-
- opcode = *opcode_buffer++;
- size = 0;
-
- switch (opcode) {
-
- case 0:
- flag ^= 1;
- continue;
-
- case 1:
- case 2:
- case 3:
- case 4:
- case 5:
- case 6:
- case 7:
- case 8:
- size = opcode;
- break;
-
- case 12:
- case 13:
- case 14:
- case 15:
- case 16:
- case 17:
- case 18:
- size += (opcode - 10);
- break;
-
- case 9:
- case 19:
- size = *size_segment++;
- break;
-
- case 10:
- case 20:
- size = AV_RB16(&size_segment[0]);
- size_segment += 2;
- break;
-
- case 11:
- case 21:
- size = (size_segment[0] << 16) | (size_segment[1] << 8) |
- size_segment[2];
- size_segment += 3;
- break;
- }
-
- if (opcode < 12) {
- flag ^= 1;
- if (flag) {
- /* run of (size) pixels is unchanged from last frame */
- xan_wc3_copy_pixel_run(s, x, y, size, 0, 0);
- } else {
- /* output a run of pixels from imagedata_buffer */
- xan_wc3_output_pixel_run(s, imagedata_buffer, x, y, size);
- imagedata_buffer += size;
- }
- } else {
- /* run-based motion compensation from last frame */
- motion_x = (*vector_segment >> 4) & 0xF;
- motion_y = *vector_segment & 0xF;
- vector_segment++;
-
- /* sign extension */
- if (motion_x & 0x8)
- motion_x |= 0xFFFFFFF0;
- if (motion_y & 0x8)
- motion_y |= 0xFFFFFFF0;
-
- /* copy a run of pixels from the previous frame */
- xan_wc3_copy_pixel_run(s, x, y, size, motion_x, motion_y);
-
- flag = 0;
- }
-
- /* coordinate accounting */
- total_pixels -= size;
- while (size) {
- if (x + size >= width) {
- y++;
- size -= (width - x);
- x = 0;
- } else {
- x += size;
- size = 0;
- }
- }
- }
-}
-
-static void xan_wc4_decode_frame(XanContext *s) {
-}
-
-static int xan_decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- XanContext *s = avctx->priv_data;
- AVPaletteControl *palette_control = avctx->palctrl;
-
- if (avctx->get_buffer(avctx, &s->current_frame)) {
- av_log(s->avctx, AV_LOG_ERROR, " Xan Video: get_buffer() failed\n");
- return -1;
- }
- s->current_frame.reference = 3;
-
- if (!s->frame_size)
- s->frame_size = s->current_frame.linesize[0] * s->avctx->height;
-
- palette_control->palette_changed = 0;
- memcpy(s->current_frame.data[1], palette_control->palette,
- AVPALETTE_SIZE);
- s->current_frame.palette_has_changed = 1;
-
- s->buf = buf;
- s->size = buf_size;
-
- if (avctx->codec->id == CODEC_ID_XAN_WC3)
- xan_wc3_decode_frame(s);
- else if (avctx->codec->id == CODEC_ID_XAN_WC4)
- xan_wc4_decode_frame(s);
-
- /* release the last frame if it is allocated */
- if (s->last_frame.data[0])
- avctx->release_buffer(avctx, &s->last_frame);
-
- /* shuffle frames */
- s->last_frame = s->current_frame;
-
- *data_size = sizeof(AVFrame);
- *(AVFrame*)data = s->current_frame;
-
- /* always report that the buffer was completely consumed */
- return buf_size;
-}
-
-static int xan_decode_end(AVCodecContext *avctx)
-{
- XanContext *s = avctx->priv_data;
-
- /* release the last frame */
- if (s->last_frame.data[0])
- avctx->release_buffer(avctx, &s->last_frame);
-
- av_free(s->buffer1);
- av_free(s->buffer2);
-
- return 0;
-}
-
-AVCodec xan_wc3_decoder = {
- "xan_wc3",
- CODEC_TYPE_VIDEO,
- CODEC_ID_XAN_WC3,
- sizeof(XanContext),
- xan_decode_init,
- NULL,
- xan_decode_end,
- xan_decode_frame,
- CODEC_CAP_DR1,
-};
-
-/*
-AVCodec xan_wc4_decoder = {
- "xan_wc4",
- CODEC_TYPE_VIDEO,
- CODEC_ID_XAN_WC4,
- sizeof(XanContext),
- xan_decode_init,
- NULL,
- xan_decode_end,
- xan_decode_frame,
- CODEC_CAP_DR1,
-};
-*/
diff --git a/src/libffmpeg/libavcodec/xl.c b/src/libffmpeg/libavcodec/xl.c
deleted file mode 100644
index 8a011d887..000000000
--- a/src/libffmpeg/libavcodec/xl.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Miro VideoXL codec
- * Copyright (c) 2004 Konstantin Shishkov
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file xl.c
- * Miro VideoXL codec.
- */
-
-#include "avcodec.h"
-#include "mpegvideo.h"
-
-typedef struct VideoXLContext{
- AVCodecContext *avctx;
- AVFrame pic;
-} VideoXLContext;
-
-static const int xl_table[32] = {
- 0, 1, 2, 3, 4, 5, 6, 7,
- 8, 9, 12, 15, 20, 25, 34, 46,
- 64, 82, 94, 103, 108, 113, 116, 119,
- 120, 121, 122, 123, 124, 125, 126, 127};
-
-static int decode_frame(AVCodecContext *avctx,
- void *data, int *data_size,
- uint8_t *buf, int buf_size)
-{
- VideoXLContext * const a = avctx->priv_data;
- AVFrame * const p= (AVFrame*)&a->pic;
- uint8_t *Y, *U, *V;
- int i, j;
- int stride;
- uint32_t val;
- int y0, y1, y2, y3, c0, c1;
-
- if(p->data[0])
- avctx->release_buffer(avctx, p);
-
- p->reference = 0;
- if(avctx->get_buffer(avctx, p) < 0){
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
- p->pict_type= I_TYPE;
- p->key_frame= 1;
-
- Y = a->pic.data[0];
- U = a->pic.data[1];
- V = a->pic.data[2];
-
- stride = avctx->width - 4;
- for (i = 0; i < avctx->height; i++) {
- /* lines are stored in reversed order */
- buf += stride;
-
- for (j = 0; j < avctx->width; j += 4) {
- /* value is stored in LE dword with word swapped */
- val = AV_RL32(buf);
- buf -= 4;
- val = ((val >> 16) & 0xFFFF) | ((val & 0xFFFF) << 16);
-
- if(!j)
- y0 = (val & 0x1F) << 2;
- else
- y0 = y3 + xl_table[val & 0x1F];
- val >>= 5;
- y1 = y0 + xl_table[val & 0x1F];
- val >>= 5;
- y2 = y1 + xl_table[val & 0x1F];
- val >>= 6; /* align to word */
- y3 = y2 + xl_table[val & 0x1F];
- val >>= 5;
- if(!j)
- c0 = (val & 0x1F) << 2;
- else
- c0 += xl_table[val & 0x1F];
- val >>= 5;
- if(!j)
- c1 = (val & 0x1F) << 2;
- else
- c1 += xl_table[val & 0x1F];
-
- Y[j + 0] = y0 << 1;
- Y[j + 1] = y1 << 1;
- Y[j + 2] = y2 << 1;
- Y[j + 3] = y3 << 1;
-
- U[j >> 2] = c0 << 1;
- V[j >> 2] = c1 << 1;
- }
-
- buf += avctx->width + 4;
- Y += a->pic.linesize[0];
- U += a->pic.linesize[1];
- V += a->pic.linesize[2];
- }
-
- *data_size = sizeof(AVFrame);
- *(AVFrame*)data = a->pic;
-
- return buf_size;
-}
-
-static int decode_init(AVCodecContext *avctx){
-// VideoXLContext * const a = avctx->priv_data;
-
- avctx->pix_fmt= PIX_FMT_YUV411P;
-
- return 0;
-}
-
-AVCodec xl_decoder = {
- "xl",
- CODEC_TYPE_VIDEO,
- CODEC_ID_VIXL,
- sizeof(VideoXLContext),
- decode_init,
- NULL,
- NULL,
- decode_frame,
- CODEC_CAP_DR1,
-};
diff --git a/src/libffmpeg/libavcodec/zmbv.c b/src/libffmpeg/libavcodec/zmbv.c
deleted file mode 100644
index 3b87c7db1..000000000
--- a/src/libffmpeg/libavcodec/zmbv.c
+++ /dev/null
@@ -1,692 +0,0 @@
-/*
- * Zip Motion Blocks Video (ZMBV) decoder
- * Copyright (c) 2006 Konstantin Shishkov
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file zmbv.c
- * Zip Motion Blocks Video decoder
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "common.h"
-#include "avcodec.h"
-
-#ifdef CONFIG_ZLIB
-#include <zlib.h>
-#endif
-
-#define ZMBV_KEYFRAME 1
-#define ZMBV_DELTAPAL 2
-
-enum ZmbvFormat {
- ZMBV_FMT_NONE = 0,
- ZMBV_FMT_1BPP = 1,
- ZMBV_FMT_2BPP = 2,
- ZMBV_FMT_4BPP = 3,
- ZMBV_FMT_8BPP = 4,
- ZMBV_FMT_15BPP = 5,
- ZMBV_FMT_16BPP = 6,
- ZMBV_FMT_24BPP = 7,
- ZMBV_FMT_32BPP = 8
-};
-
-/*
- * Decoder context
- */
-typedef struct ZmbvContext {
- AVCodecContext *avctx;
- AVFrame pic;
-
- int bpp;
- unsigned int decomp_size;
- uint8_t* decomp_buf;
- uint8_t pal[768];
- uint8_t *prev, *cur;
- int width, height;
- int fmt;
- int comp;
- int flags;
- int bw, bh, bx, by;
- int decomp_len;
-#ifdef CONFIG_ZLIB
- z_stream zstream;
-#endif
- int (*decode_intra)(struct ZmbvContext *c);
- int (*decode_xor)(struct ZmbvContext *c);
-} ZmbvContext;
-
-/**
- * Decode XOR'ed frame - 8bpp version
- */
-
-static int zmbv_decode_xor_8(ZmbvContext *c)
-{
- uint8_t *src = c->decomp_buf;
- uint8_t *output, *prev;
- int8_t *mvec;
- int x, y;
- int d, dx, dy, bw2, bh2;
- int block;
- int i, j;
- int mx, my;
-
- output = c->cur;
- prev = c->prev;
-
- if(c->flags & ZMBV_DELTAPAL){
- for(i = 0; i < 768; i++)
- c->pal[i] ^= *src++;
- }
-
- mvec = (int8_t*)src;
- src += ((c->bx * c->by * 2 + 3) & ~3);
-
- block = 0;
- for(y = 0; y < c->height; y += c->bh) {
- bh2 = ((c->height - y) > c->bh) ? c->bh : (c->height - y);
- for(x = 0; x < c->width; x += c->bw) {
- uint8_t *out, *tprev;
-
- d = mvec[block] & 1;
- dx = mvec[block] >> 1;
- dy = mvec[block + 1] >> 1;
- block += 2;
-
- bw2 = ((c->width - x) > c->bw) ? c->bw : (c->width - x);
-
- /* copy block - motion vectors out of bounds are used to zero blocks */
- out = output + x;
- tprev = prev + x + dx + dy * c->width;
- mx = x + dx;
- my = y + dy;
- for(j = 0; j < bh2; j++){
- if((my + j < 0) || (my + j >= c->height)) {
- memset(out, 0, bw2);
- } else {
- for(i = 0; i < bw2; i++){
- if((mx + i < 0) || (mx + i >= c->width))
- out[i] = 0;
- else
- out[i] = tprev[i];
- }
- }
- out += c->width;
- tprev += c->width;
- }
-
- if(d) { /* apply XOR'ed difference */
- out = output + x;
- for(j = 0; j < bh2; j++){
- for(i = 0; i < bw2; i++)
- out[i] ^= *src++;
- out += c->width;
- }
- }
- }
- output += c->width * c->bh;
- prev += c->width * c->bh;
- }
- if(src - c->decomp_buf != c->decomp_len)
- av_log(c->avctx, AV_LOG_ERROR, "Used %i of %i bytes\n", src-c->decomp_buf, c->decomp_len);
- return 0;
-}
-
-/**
- * Decode XOR'ed frame - 15bpp and 16bpp version
- */
-
-static int zmbv_decode_xor_16(ZmbvContext *c)
-{
- uint8_t *src = c->decomp_buf;
- uint16_t *output, *prev;
- int8_t *mvec;
- int x, y;
- int d, dx, dy, bw2, bh2;
- int block;
- int i, j;
- int mx, my;
-
- output = (uint16_t*)c->cur;
- prev = (uint16_t*)c->prev;
-
- mvec = (int8_t*)src;
- src += ((c->bx * c->by * 2 + 3) & ~3);
-
- block = 0;
- for(y = 0; y < c->height; y += c->bh) {
- bh2 = ((c->height - y) > c->bh) ? c->bh : (c->height - y);
- for(x = 0; x < c->width; x += c->bw) {
- uint16_t *out, *tprev;
-
- d = mvec[block] & 1;
- dx = mvec[block] >> 1;
- dy = mvec[block + 1] >> 1;
- block += 2;
-
- bw2 = ((c->width - x) > c->bw) ? c->bw : (c->width - x);
-
- /* copy block - motion vectors out of bounds are used to zero blocks */
- out = output + x;
- tprev = prev + x + dx + dy * c->width;
- mx = x + dx;
- my = y + dy;
- for(j = 0; j < bh2; j++){
- if((my + j < 0) || (my + j >= c->height)) {
- memset(out, 0, bw2 * 2);
- } else {
- for(i = 0; i < bw2; i++){
- if((mx + i < 0) || (mx + i >= c->width))
- out[i] = 0;
- else
- out[i] = tprev[i];
- }
- }
- out += c->width;
- tprev += c->width;
- }
-
- if(d) { /* apply XOR'ed difference */
- out = output + x;
- for(j = 0; j < bh2; j++){
- for(i = 0; i < bw2; i++) {
- out[i] ^= *((uint16_t*)src);
- src += 2;
- }
- out += c->width;
- }
- }
- }
- output += c->width * c->bh;
- prev += c->width * c->bh;
- }
- if(src - c->decomp_buf != c->decomp_len)
- av_log(c->avctx, AV_LOG_ERROR, "Used %i of %i bytes\n", src-c->decomp_buf, c->decomp_len);
- return 0;
-}
-
-#ifdef ZMBV_ENABLE_24BPP
-/**
- * Decode XOR'ed frame - 24bpp version
- */
-
-static int zmbv_decode_xor_24(ZmbvContext *c)
-{
- uint8_t *src = c->decomp_buf;
- uint8_t *output, *prev;
- int8_t *mvec;
- int x, y;
- int d, dx, dy, bw2, bh2;
- int block;
- int i, j;
- int mx, my;
- int stride;
-
- output = c->cur;
- prev = c->prev;
-
- stride = c->width * 3;
- mvec = (int8_t*)src;
- src += ((c->bx * c->by * 2 + 3) & ~3);
-
- block = 0;
- for(y = 0; y < c->height; y += c->bh) {
- bh2 = ((c->height - y) > c->bh) ? c->bh : (c->height - y);
- for(x = 0; x < c->width; x += c->bw) {
- uint8_t *out, *tprev;
-
- d = mvec[block] & 1;
- dx = mvec[block] >> 1;
- dy = mvec[block + 1] >> 1;
- block += 2;
-
- bw2 = ((c->width - x) > c->bw) ? c->bw : (c->width - x);
-
- /* copy block - motion vectors out of bounds are used to zero blocks */
- out = output + x * 3;
- tprev = prev + (x + dx) * 3 + dy * stride;
- mx = x + dx;
- my = y + dy;
- for(j = 0; j < bh2; j++){
- if((my + j < 0) || (my + j >= c->height)) {
- memset(out, 0, bw2 * 3);
- } else {
- for(i = 0; i < bw2; i++){
- if((mx + i < 0) || (mx + i >= c->width)) {
- out[i * 3 + 0] = 0;
- out[i * 3 + 1] = 0;
- out[i * 3 + 2] = 0;
- } else {
- out[i * 3 + 0] = tprev[i * 3 + 0];
- out[i * 3 + 1] = tprev[i * 3 + 1];
- out[i * 3 + 2] = tprev[i * 3 + 2];
- }
- }
- }
- out += stride;
- tprev += stride;
- }
-
- if(d) { /* apply XOR'ed difference */
- out = output + x * 3;
- for(j = 0; j < bh2; j++){
- for(i = 0; i < bw2; i++) {
- out[i * 3 + 0] ^= *src++;
- out[i * 3 + 1] ^= *src++;
- out[i * 3 + 2] ^= *src++;
- }
- out += stride;
- }
- }
- }
- output += stride * c->bh;
- prev += stride * c->bh;
- }
- if(src - c->decomp_buf != c->decomp_len)
- av_log(c->avctx, AV_LOG_ERROR, "Used %i of %i bytes\n", src-c->decomp_buf, c->decomp_len);
- return 0;
-}
-#endif //ZMBV_ENABLE_24BPP
-
-/**
- * Decode XOR'ed frame - 32bpp version
- */
-
-static int zmbv_decode_xor_32(ZmbvContext *c)
-{
- uint8_t *src = c->decomp_buf;
- uint32_t *output, *prev;
- int8_t *mvec;
- int x, y;
- int d, dx, dy, bw2, bh2;
- int block;
- int i, j;
- int mx, my;
-
- output = (uint32_t*)c->cur;
- prev = (uint32_t*)c->prev;
-
- mvec = (int8_t*)src;
- src += ((c->bx * c->by * 2 + 3) & ~3);
-
- block = 0;
- for(y = 0; y < c->height; y += c->bh) {
- bh2 = ((c->height - y) > c->bh) ? c->bh : (c->height - y);
- for(x = 0; x < c->width; x += c->bw) {
- uint32_t *out, *tprev;
-
- d = mvec[block] & 1;
- dx = mvec[block] >> 1;
- dy = mvec[block + 1] >> 1;
- block += 2;
-
- bw2 = ((c->width - x) > c->bw) ? c->bw : (c->width - x);
-
- /* copy block - motion vectors out of bounds are used to zero blocks */
- out = output + x;
- tprev = prev + x + dx + dy * c->width;
- mx = x + dx;
- my = y + dy;
- for(j = 0; j < bh2; j++){
- if((my + j < 0) || (my + j >= c->height)) {
- memset(out, 0, bw2 * 4);
- } else {
- for(i = 0; i < bw2; i++){
- if((mx + i < 0) || (mx + i >= c->width))
- out[i] = 0;
- else
- out[i] = tprev[i];
- }
- }
- out += c->width;
- tprev += c->width;
- }
-
- if(d) { /* apply XOR'ed difference */
- out = output + x;
- for(j = 0; j < bh2; j++){
- for(i = 0; i < bw2; i++) {
- out[i] ^= *((uint32_t*)src);
- src += 4;
- }
- out += c->width;
- }
- }
- }
- output += c->width * c->bh;
- prev += c->width * c->bh;
- }
- if(src - c->decomp_buf != c->decomp_len)
- av_log(c->avctx, AV_LOG_ERROR, "Used %i of %i bytes\n", src-c->decomp_buf, c->decomp_len);
- return 0;
-}
-
-/**
- * Decode intraframe
- */
-static int zmbv_decode_intra(ZmbvContext *c)
-{
- uint8_t *src = c->decomp_buf;
-
- /* make the palette available on the way out */
- if (c->fmt == ZMBV_FMT_8BPP) {
- memcpy(c->pal, src, 768);
- src += 768;
- }
-
- memcpy(c->cur, src, c->width * c->height * (c->bpp / 8));
- return 0;
-}
-
-static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size)
-{
- ZmbvContext * const c = (ZmbvContext *)avctx->priv_data;
- uint8_t *outptr;
-#ifdef CONFIG_ZLIB
- int zret = Z_OK; // Zlib return code
-#endif
- int len = buf_size;
- int hi_ver, lo_ver;
-
- if(c->pic.data[0])
- avctx->release_buffer(avctx, &c->pic);
-
- c->pic.reference = 1;
- c->pic.buffer_hints = FF_BUFFER_HINTS_VALID;
- if(avctx->get_buffer(avctx, &c->pic) < 0){
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
-
- outptr = c->pic.data[0]; // Output image pointer
-
- /* parse header */
- c->flags = buf[0];
- buf++; len--;
- if(c->flags & ZMBV_KEYFRAME) {
- hi_ver = buf[0];
- lo_ver = buf[1];
- c->comp = buf[2];
- c->fmt = buf[3];
- c->bw = buf[4];
- c->bh = buf[5];
-
- buf += 6;
- len -= 6;
- av_log(avctx, AV_LOG_DEBUG, "Flags=%X ver=%i.%i comp=%i fmt=%i blk=%ix%i\n",c->flags,hi_ver,lo_ver,c->comp,c->fmt,c->bw,c->bh);
- if(hi_ver != 0 || lo_ver != 1) {
- av_log(avctx, AV_LOG_ERROR, "Unsupported version %i.%i\n", hi_ver, lo_ver);
- return -1;
- }
- if(c->bw == 0 || c->bh == 0) {
- av_log(avctx, AV_LOG_ERROR, "Unsupported block size %ix%i\n", c->bw, c->bh);
- }
- if(c->comp != 0 && c->comp != 1) {
- av_log(avctx, AV_LOG_ERROR, "Unsupported compression type %i\n", c->comp);
- return -1;
- }
-
- switch(c->fmt) {
- case ZMBV_FMT_8BPP:
- c->bpp = 8;
- c->decode_intra = zmbv_decode_intra;
- c->decode_xor = zmbv_decode_xor_8;
- break;
- case ZMBV_FMT_15BPP:
- case ZMBV_FMT_16BPP:
- c->bpp = 16;
- c->decode_intra = zmbv_decode_intra;
- c->decode_xor = zmbv_decode_xor_16;
- break;
-#ifdef ZMBV_ENABLE_24BPP
- case ZMBV_FMT_24BPP:
- c->bpp = 24;
- c->decode_intra = zmbv_decode_intra;
- c->decode_xor = zmbv_decode_xor_24;
- break;
-#endif //ZMBV_ENABLE_24BPP
- case ZMBV_FMT_32BPP:
- c->bpp = 32;
- c->decode_intra = zmbv_decode_intra;
- c->decode_xor = zmbv_decode_xor_32;
- break;
- default:
- c->decode_intra = NULL;
- c->decode_xor = NULL;
- av_log(avctx, AV_LOG_ERROR, "Unsupported (for now) format %i\n", c->fmt);
- return -1;
- }
-#ifdef CONFIG_ZLIB
- zret = inflateReset(&c->zstream);
- if (zret != Z_OK) {
- av_log(avctx, AV_LOG_ERROR, "Inflate reset error: %d\n", zret);
- return -1;
- }
-#else
- av_log(avctx, AV_LOG_ERROR, "BUG! Zlib support not compiled in frame decoder.\n");
- return -1;
-#endif /* CONFIG_ZLIB */
- c->cur = av_realloc(c->cur, avctx->width * avctx->height * (c->bpp / 8));
- c->prev = av_realloc(c->prev, avctx->width * avctx->height * (c->bpp / 8));
- c->bx = (c->width + c->bw - 1) / c->bw;
- c->by = (c->height+ c->bh - 1) / c->bh;
- }
-
- if(c->decode_intra == NULL) {
- av_log(avctx, AV_LOG_ERROR, "Error! Got no format or no keyframe!\n");
- return -1;
- }
-
- if(c->comp == 0) { //Uncompressed data
- memcpy(c->decomp_buf, buf, len);
- c->decomp_size = 1;
- } else { // ZLIB-compressed data
-#ifdef CONFIG_ZLIB
- c->zstream.total_in = c->zstream.total_out = 0;
- c->zstream.next_in = buf;
- c->zstream.avail_in = len;
- c->zstream.next_out = c->decomp_buf;
- c->zstream.avail_out = c->decomp_size;
- inflate(&c->zstream, Z_FINISH);
- c->decomp_len = c->zstream.total_out;
-#else
- av_log(avctx, AV_LOG_ERROR, "BUG! Zlib support not compiled in frame decoder.\n");
- return -1;
-#endif
- }
- if(c->flags & ZMBV_KEYFRAME) {
- c->pic.key_frame = 1;
- c->pic.pict_type = FF_I_TYPE;
- c->decode_intra(c);
- } else {
- c->pic.key_frame = 0;
- c->pic.pict_type = FF_P_TYPE;
- c->decode_xor(c);
- }
-
- /* update frames */
- {
- uint8_t *out, *src;
- int i, j;
-
- out = c->pic.data[0];
- src = c->cur;
- switch(c->fmt) {
- case ZMBV_FMT_8BPP:
- for(j = 0; j < c->height; j++) {
- for(i = 0; i < c->width; i++) {
- out[i * 3 + 0] = c->pal[(*src) * 3 + 0];
- out[i * 3 + 1] = c->pal[(*src) * 3 + 1];
- out[i * 3 + 2] = c->pal[(*src) * 3 + 2];
- *src++;
- }
- out += c->pic.linesize[0];
- }
- break;
- case ZMBV_FMT_15BPP:
- for(j = 0; j < c->height; j++) {
- for(i = 0; i < c->width; i++) {
- uint16_t tmp = AV_RL16(src);
- src += 2;
- out[i * 3 + 0] = (tmp & 0x7C00) >> 7;
- out[i * 3 + 1] = (tmp & 0x03E0) >> 2;
- out[i * 3 + 2] = (tmp & 0x001F) << 3;
- }
- out += c->pic.linesize[0];
- }
- break;
- case ZMBV_FMT_16BPP:
- for(j = 0; j < c->height; j++) {
- for(i = 0; i < c->width; i++) {
- uint16_t tmp = AV_RL16(src);
- src += 2;
- out[i * 3 + 0] = (tmp & 0xF800) >> 8;
- out[i * 3 + 1] = (tmp & 0x07E0) >> 3;
- out[i * 3 + 2] = (tmp & 0x001F) << 3;
- }
- out += c->pic.linesize[0];
- }
- break;
-#ifdef ZMBV_ENABLE_24BPP
- case ZMBV_FMT_24BPP:
- for(j = 0; j < c->height; j++) {
- memcpy(out, src, c->width * 3);
- src += c->width * 3;
- out += c->pic.linesize[0];
- }
- break;
-#endif //ZMBV_ENABLE_24BPP
- case ZMBV_FMT_32BPP:
- for(j = 0; j < c->height; j++) {
- for(i = 0; i < c->width; i++) {
- uint32_t tmp = AV_RL32(src);
- src += 4;
- out[i * 3 + 0] = tmp >> 16;
- out[i * 3 + 1] = tmp >> 8;
- out[i * 3 + 2] = tmp >> 0;
- }
- out += c->pic.linesize[0];
- }
- break;
- default:
- av_log(avctx, AV_LOG_ERROR, "Cannot handle format %i\n", c->fmt);
- }
- memcpy(c->prev, c->cur, c->width * c->height * (c->bpp / 8));
- }
- *data_size = sizeof(AVFrame);
- *(AVFrame*)data = c->pic;
-
- /* always report that the buffer was completely consumed */
- return buf_size;
-}
-
-
-
-/*
- *
- * Init zmbv decoder
- *
- */
-static int decode_init(AVCodecContext *avctx)
-{
- ZmbvContext * const c = (ZmbvContext *)avctx->priv_data;
- int zret; // Zlib return code
-
- c->avctx = avctx;
- avctx->has_b_frames = 0;
-
- c->pic.data[0] = NULL;
- c->width = avctx->width;
- c->height = avctx->height;
-
- if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
- return 1;
- }
- c->bpp = avctx->bits_per_sample;
-
-#ifdef CONFIG_ZLIB
- // Needed if zlib unused or init aborted before inflateInit
- memset(&(c->zstream), 0, sizeof(z_stream));
-#else
- av_log(avctx, AV_LOG_ERROR, "Zlib support not compiled.\n");
- return 1;
-#endif
- avctx->pix_fmt = PIX_FMT_RGB24;
- c->decomp_size = (avctx->width + 255) * 4 * (avctx->height + 64);
-
- /* Allocate decompression buffer */
- if (c->decomp_size) {
- if ((c->decomp_buf = av_malloc(c->decomp_size)) == NULL) {
- av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n");
- return 1;
- }
- }
-
-#ifdef CONFIG_ZLIB
- c->zstream.zalloc = Z_NULL;
- c->zstream.zfree = Z_NULL;
- c->zstream.opaque = Z_NULL;
- zret = inflateInit(&(c->zstream));
- if (zret != Z_OK) {
- av_log(avctx, AV_LOG_ERROR, "Inflate init error: %d\n", zret);
- return 1;
- }
-#endif
-
- return 0;
-}
-
-
-
-/*
- *
- * Uninit zmbv decoder
- *
- */
-static int decode_end(AVCodecContext *avctx)
-{
- ZmbvContext * const c = (ZmbvContext *)avctx->priv_data;
-
- av_freep(&c->decomp_buf);
-
- if (c->pic.data[0])
- avctx->release_buffer(avctx, &c->pic);
-#ifdef CONFIG_ZLIB
- inflateEnd(&(c->zstream));
-#endif
- av_freep(&c->cur);
- av_freep(&c->prev);
-
- return 0;
-}
-
-AVCodec zmbv_decoder = {
- "zmbv",
- CODEC_TYPE_VIDEO,
- CODEC_ID_ZMBV,
- sizeof(ZmbvContext),
- decode_init,
- NULL,
- decode_end,
- decode_frame
-};
-
diff --git a/src/libffmpeg/libavutil/Makefile.am b/src/libffmpeg/libavutil/Makefile.am
deleted file mode 100644
index 6010a8134..000000000
--- a/src/libffmpeg/libavutil/Makefile.am
+++ /dev/null
@@ -1,38 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-AM_CPPFLAGS = $(LIBFFMPEG_CPPFLAGS) -I$(top_srcdir)/src/libffmpeg \
- -I$(top_builddir)/src/libffmpeg
-AM_CFLAGS = -fno-strict-aliasing
-ASFLAGS =
-
-noinst_LTLIBRARIES = libavutil.la
-
-libavutil_la_SOURCES = \
- adler32.c \
- crc.c \
- integer.c \
- lls.c \
- log.c \
- mathematics.c \
- md5.c \
- mem.c \
- rational.c
-
-libavutil_la_LDFLAGS = -avoid-version -module
-
-noinst_HEADERS = \
- adler32.h \
- avutil.h \
- bswap.h \
- common.h \
- crc.h \
- integer.h \
- internal.h \
- intfloat_readwrite.h \
- intreadwrite.h \
- lls.h \
- log.h \
- mathematics.h \
- md5.h \
- rational.h \
- x86_cpu.h
diff --git a/src/libffmpeg/libavutil/adler32.c b/src/libffmpeg/libavutil/adler32.c
deleted file mode 100644
index 50d57470b..000000000
--- a/src/libffmpeg/libavutil/adler32.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/* adler32.c -- compute the Adler-32 checksum of a data stream
- * This is a modified version based on adler32.c from the zlib library.
- *
- * Copyright (C) 1995 Mark Adler
- *
- * This software is provided 'as-is', without any express or implied
- * warranty. In no event will the authors be held liable for any damages
- * arising from the use of this software.
- *
- * Permission is granted to anyone to use this software for any purpose,
- * including commercial applications, and to alter it and redistribute it
- * freely, subject to the following restrictions:
- *
- * 1. The origin of this software must not be misrepresented; you must not
- * claim that you wrote the original software. If you use this software
- * in a product, an acknowledgment in the product documentation would be
- * appreciated but is not required.
- * 2. Altered source versions must be plainly marked as such, and must not be
- * misrepresented as being the original software.
- * 3. This notice may not be removed or altered from any source distribution.
- *
- */
-
-#include "common.h"
-#include "adler32.h"
-
-#define BASE 65521L /* largest prime smaller than 65536 */
-
-#define DO1(buf) {s1 += *buf++; s2 += s1;}
-#define DO4(buf) DO1(buf); DO1(buf); DO1(buf); DO1(buf);
-#define DO16(buf) DO4(buf); DO4(buf); DO4(buf); DO4(buf);
-
-unsigned long av_adler32_update(unsigned long adler, const uint8_t *buf, unsigned int len)
-{
- unsigned long s1 = adler & 0xffff;
- unsigned long s2 = adler >> 16;
-
- while (len>0) {
-#ifdef CONFIG_SMALL
- while(len>4 && s2 < (1U<<31)){
- DO4(buf); len-=4;
-#else
- while(len>16 && s2 < (1U<<31)){
- DO16(buf); len-=16;
-#endif
- }
- DO1(buf); len--;
- s1 %= BASE;
- s2 %= BASE;
- }
- return (s2 << 16) | s1;
-}
-
-#ifdef TEST
-#include "log.h"
-#define LEN 7001
-volatile int checksum;
-int main(){
- int i;
- char data[LEN];
- av_log_level = AV_LOG_DEBUG;
- for(i=0; i<LEN; i++)
- data[i]= ((i*i)>>3) + 123*i;
- for(i=0; i<1000; i++){
- START_TIMER
- checksum= av_adler32_update(1, data, LEN);
- STOP_TIMER("adler")
- }
- av_log(NULL, AV_LOG_DEBUG, "%X == 50E6E508\n", checksum);
-}
-#endif
diff --git a/src/libffmpeg/libavutil/adler32.h b/src/libffmpeg/libavutil/adler32.h
deleted file mode 100644
index f56d416fb..000000000
--- a/src/libffmpeg/libavutil/adler32.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * copyright (c) 2006 Mans Rullgard
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef ADLER32_H
-#define ADLER32_H
-
-unsigned long av_adler32_update(unsigned long adler, const uint8_t *buf,
- unsigned int len);
-
-#endif
diff --git a/src/libffmpeg/libavutil/avutil.h b/src/libffmpeg/libavutil/avutil.h
deleted file mode 100644
index d5a4570dc..000000000
--- a/src/libffmpeg/libavutil/avutil.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_H
-#define AVUTIL_H
-
-/**
- * @file avutil.h
- * external api header.
- */
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define AV_STRINGIFY(s) AV_TOSTRING(s)
-#define AV_TOSTRING(s) #s
-
-#define LIBAVUTIL_VERSION_INT ((49<<16)+(2<<8)+0)
-#define LIBAVUTIL_VERSION 49.2.0
-#define LIBAVUTIL_BUILD LIBAVUTIL_VERSION_INT
-
-#define LIBAVUTIL_IDENT "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION)
-
-
-#include "common.h"
-#include "mathematics.h"
-#include "rational.h"
-#include "integer.h"
-#include "intfloat_readwrite.h"
-#include "log.h"
-
-/**
- * Pixel format. Notes:
- *
- * PIX_FMT_RGB32 is handled in an endian-specific manner. A RGBA
- * color is put together as:
- * (A << 24) | (R << 16) | (G << 8) | B
- * This is stored as BGRA on little endian CPU architectures and ARGB on
- * big endian CPUs.
- *
- * When the pixel format is palettized RGB (PIX_FMT_PAL8), the palettized
- * image data is stored in AVFrame.data[0]. The palette is transported in
- * AVFrame.data[1] and, is 1024 bytes long (256 4-byte entries) and is
- * formatted the same as in PIX_FMT_RGB32 described above (i.e., it is
- * also endian-specific). Note also that the individual RGB palette
- * components stored in AVFrame.data[1] should be in the range 0..255.
- * This is important as many custom PAL8 video codecs that were designed
- * to run on the IBM VGA graphics adapter use 6-bit palette components.
- */
-enum PixelFormat {
- PIX_FMT_NONE= -1,
- PIX_FMT_YUV420P, ///< Planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
- PIX_FMT_YUYV422, ///< Packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
- PIX_FMT_RGB24, ///< Packed RGB 8:8:8, 24bpp, RGBRGB...
- PIX_FMT_BGR24, ///< Packed RGB 8:8:8, 24bpp, BGRBGR...
- PIX_FMT_YUV422P, ///< Planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
- PIX_FMT_YUV444P, ///< Planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
- PIX_FMT_RGB32, ///< Packed RGB 8:8:8, 32bpp, (msb)8A 8R 8G 8B(lsb), in cpu endianness
- PIX_FMT_YUV410P, ///< Planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
- PIX_FMT_YUV411P, ///< Planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
- PIX_FMT_RGB565, ///< Packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), in cpu endianness
- PIX_FMT_RGB555, ///< Packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), in cpu endianness most significant bit to 0
- PIX_FMT_GRAY8, ///< Y , 8bpp
- PIX_FMT_MONOWHITE, ///< Y , 1bpp, 1 is white
- PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black
- PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette
- PIX_FMT_YUVJ420P, ///< Planar YUV 4:2:0, 12bpp, full scale (jpeg)
- PIX_FMT_YUVJ422P, ///< Planar YUV 4:2:2, 16bpp, full scale (jpeg)
- PIX_FMT_YUVJ444P, ///< Planar YUV 4:4:4, 24bpp, full scale (jpeg)
- PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing(xvmc_render.h)
- PIX_FMT_XVMC_MPEG2_IDCT,
- PIX_FMT_UYVY422, ///< Packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
- PIX_FMT_UYYVYY411, ///< Packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
- PIX_FMT_BGR32, ///< Packed RGB 8:8:8, 32bpp, (msb)8A 8B 8G 8R(lsb), in cpu endianness
- PIX_FMT_BGR565, ///< Packed RGB 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), in cpu endianness
- PIX_FMT_BGR555, ///< Packed RGB 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), in cpu endianness most significant bit to 1
- PIX_FMT_BGR8, ///< Packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
- PIX_FMT_BGR4, ///< Packed RGB 1:2:1, 4bpp, (msb)1B 2G 1R(lsb)
- PIX_FMT_BGR4_BYTE, ///< Packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
- PIX_FMT_RGB8, ///< Packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
- PIX_FMT_RGB4, ///< Packed RGB 1:2:1, 4bpp, (msb)2R 3G 3B(lsb)
- PIX_FMT_RGB4_BYTE, ///< Packed RGB 1:2:1, 8bpp, (msb)2R 3G 3B(lsb)
- PIX_FMT_NV12, ///< Planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 for UV
- PIX_FMT_NV21, ///< as above, but U and V bytes are swapped
-
- PIX_FMT_RGB32_1, ///< Packed RGB 8:8:8, 32bpp, (msb)8R 8G 8B 8A(lsb), in cpu endianness
- PIX_FMT_BGR32_1, ///< Packed RGB 8:8:8, 32bpp, (msb)8B 8G 8R 8A(lsb), in cpu endianness
-
- PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian
- PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian
- PIX_FMT_NB, ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
-};
-
-#ifdef WORDS_BIGENDIAN
-#define PIX_FMT_RGBA PIX_FMT_RGB32_1
-#define PIX_FMT_BGRA PIX_FMT_BGR32_1
-#define PIX_FMT_ARGB PIX_FMT_RGB32
-#define PIX_FMT_ABGR PIX_FMT_BGR32
-#define PIX_FMT_GRAY16 PIX_FMT_GRAY16BE
-#else
-#define PIX_FMT_RGBA PIX_FMT_BGR32
-#define PIX_FMT_BGRA PIX_FMT_RGB32
-#define PIX_FMT_ARGB PIX_FMT_BGR32_1
-#define PIX_FMT_ABGR PIX_FMT_RGB32_1
-#define PIX_FMT_GRAY16 PIX_FMT_GRAY16LE
-#endif
-
-#if LIBAVUTIL_VERSION_INT < (50<<16)
-#define PIX_FMT_UYVY411 PIX_FMT_UYYVYY411
-#define PIX_FMT_RGBA32 PIX_FMT_RGB32
-#define PIX_FMT_YUV422 PIX_FMT_YUYV422
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* AVUTIL_H */
diff --git a/src/libffmpeg/libavutil/bswap.h b/src/libffmpeg/libavutil/bswap.h
deleted file mode 100644
index 03d613db2..000000000
--- a/src/libffmpeg/libavutil/bswap.h
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file bswap.h
- * byte swap.
- */
-
-#ifndef __BSWAP_H__
-#define __BSWAP_H__
-
-#ifdef HAVE_BYTESWAP_H
-#include <byteswap.h>
-#else
-
-#ifdef ARCH_X86_64
-# define LEGACY_REGS "=Q"
-#else
-# define LEGACY_REGS "=q"
-#endif
-
-#if defined(ARCH_X86)
-static av_always_inline uint16_t bswap_16(uint16_t x)
-{
- __asm("rorw $8, %0" :
- LEGACY_REGS (x) :
- "0" (x));
- return x;
-}
-
-static av_always_inline uint32_t bswap_32(uint32_t x)
-{
-#if __CPU__ != 386
- __asm("bswap %0":
- "=r" (x) :
-#else
- __asm("xchgb %b0,%h0\n"
- " rorl $16,%0\n"
- " xchgb %b0,%h0":
- LEGACY_REGS (x) :
-#endif
- "0" (x));
- return x;
-}
-
-static inline uint64_t bswap_64(uint64_t x)
-{
-#ifdef ARCH_X86_64
- __asm("bswap %0":
- "=r" (x) :
- "0" (x));
- return x;
-#else
- union {
- uint64_t ll;
- struct {
- uint32_t l,h;
- } l;
- } r;
- r.l.l = bswap_32 (x);
- r.l.h = bswap_32 (x>>32);
- return r.ll;
-#endif
-}
-
-#elif defined(ARCH_SH4)
-
-static av_always_inline uint16_t bswap_16(uint16_t x) {
- __asm__("swap.b %0,%0":"=r"(x):"0"(x));
- return x;
-}
-
-static av_always_inline uint32_t bswap_32(uint32_t x) {
- __asm__(
- "swap.b %0,%0\n"
- "swap.w %0,%0\n"
- "swap.b %0,%0\n"
- :"=r"(x):"0"(x));
- return x;
-}
-
-static inline uint64_t bswap_64(uint64_t x)
-{
- union {
- uint64_t ll;
- struct {
- uint32_t l,h;
- } l;
- } r;
- r.l.l = bswap_32 (x);
- r.l.h = bswap_32 (x>>32);
- return r.ll;
-}
-#else
-
-static av_always_inline uint16_t bswap_16(uint16_t x){
- return (x>>8) | (x<<8);
-}
-
-#ifdef ARCH_ARM
-static av_always_inline uint32_t bswap_32(uint32_t x){
- uint32_t t;
- __asm__ (
- "eor %1, %0, %0, ror #16 \n\t"
- "bic %1, %1, #0xFF0000 \n\t"
- "mov %0, %0, ror #8 \n\t"
- "eor %0, %0, %1, lsr #8 \n\t"
- : "+r"(x), "+r"(t));
- return x;
-}
-#else
-static av_always_inline uint32_t bswap_32(uint32_t x){
- x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
- return (x>>16) | (x<<16);
-}
-#endif
-
-static inline uint64_t bswap_64(uint64_t x)
-{
-#if 0
- x= ((x<< 8)&0xFF00FF00FF00FF00ULL) | ((x>> 8)&0x00FF00FF00FF00FFULL);
- x= ((x<<16)&0xFFFF0000FFFF0000ULL) | ((x>>16)&0x0000FFFF0000FFFFULL);
- return (x>>32) | (x<<32);
-#else
- union {
- uint64_t ll;
- uint32_t l[2];
- } w, r;
- w.ll = x;
- r.l[0] = bswap_32 (w.l[1]);
- r.l[1] = bswap_32 (w.l[0]);
- return r.ll;
-#endif
-}
-#endif /* defined(ARCH_X86) */
-
-#endif /* !HAVE_BYTESWAP_H */
-
-// be2me ... BigEndian to MachineEndian
-// le2me ... LittleEndian to MachineEndian
-
-#ifdef WORDS_BIGENDIAN
-#define be2me_16(x) (x)
-#define be2me_32(x) (x)
-#define be2me_64(x) (x)
-#define le2me_16(x) bswap_16(x)
-#define le2me_32(x) bswap_32(x)
-#define le2me_64(x) bswap_64(x)
-#else
-#define be2me_16(x) bswap_16(x)
-#define be2me_32(x) bswap_32(x)
-#define be2me_64(x) bswap_64(x)
-#define le2me_16(x) (x)
-#define le2me_32(x) (x)
-#define le2me_64(x) (x)
-#endif
-
-#endif /* __BSWAP_H__ */
diff --git a/src/libffmpeg/libavutil/common.h b/src/libffmpeg/libavutil/common.h
deleted file mode 100644
index 0d4346048..000000000
--- a/src/libffmpeg/libavutil/common.h
+++ /dev/null
@@ -1,364 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file common.h
- * common internal and external api header.
- */
-
-#ifndef COMMON_H
-#define COMMON_H
-
-#include <inttypes.h>
-
-#ifdef HAVE_AV_CONFIG_H
-/* only include the following when compiling package */
-# include "config.h"
-
-# include <stdlib.h>
-# include <stdio.h>
-# include <string.h>
-# include <ctype.h>
-# include <limits.h>
-# ifndef __BEOS__
-# include <errno.h>
-# else
-# include "berrno.h"
-# endif
-# include <math.h>
-#endif /* HAVE_AV_CONFIG_H */
-
-#ifndef av_always_inline
-#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
-# define av_always_inline __attribute__((always_inline)) inline
-#else
-# define av_always_inline inline
-#endif
-#endif
-
-#ifdef HAVE_AV_CONFIG_H
-# include "internal.h"
-#endif /* HAVE_AV_CONFIG_H */
-
-#ifndef attribute_deprecated
-#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
-# define attribute_deprecated __attribute__((deprecated))
-#else
-# define attribute_deprecated
-#endif
-#endif
-
-#ifndef INT64_C
-#define INT64_C(c) (c ## LL)
-#define UINT64_C(c) (c ## ULL)
-#endif
-
-//rounded divison & shift
-#define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b))
-/* assume b>0 */
-#define ROUNDED_DIV(a,b) (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b))
-#define FFABS(a) ((a) >= 0 ? (a) : (-(a)))
-#define FFSIGN(a) ((a) > 0 ? 1 : -1)
-
-#define FFMAX(a,b) ((a) > (b) ? (a) : (b))
-#define FFMIN(a,b) ((a) > (b) ? (b) : (a))
-
-#define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0)
-
-/* misc math functions */
-extern const uint8_t ff_log2_tab[256];
-
-static inline int av_log2(unsigned int v)
-{
- int n;
-
- n = 0;
- if (v & 0xffff0000) {
- v >>= 16;
- n += 16;
- }
- if (v & 0xff00) {
- v >>= 8;
- n += 8;
- }
- n += ff_log2_tab[v];
-
- return n;
-}
-
-static inline int av_log2_16bit(unsigned int v)
-{
- int n;
-
- n = 0;
- if (v & 0xff00) {
- v >>= 8;
- n += 8;
- }
- n += ff_log2_tab[v];
-
- return n;
-}
-
-/* median of 3 */
-static inline int mid_pred(int a, int b, int c)
-{
-#ifdef HAVE_CMOV
- int i=b;
- asm volatile(
- "cmp %2, %1 \n\t"
- "cmovg %1, %0 \n\t"
- "cmovg %2, %1 \n\t"
- "cmp %3, %1 \n\t"
- "cmovl %3, %1 \n\t"
- "cmp %1, %0 \n\t"
- "cmovg %1, %0 \n\t"
- :"+&r"(i), "+&r"(a)
- :"r"(b), "r"(c)
- );
- return i;
-#elif 0
- int t= (a-b)&((a-b)>>31);
- a-=t;
- b+=t;
- b-= (b-c)&((b-c)>>31);
- b+= (a-b)&((a-b)>>31);
-
- return b;
-#else
- if(a>b){
- if(c>b){
- if(c>a) b=a;
- else b=c;
- }
- }else{
- if(b>c){
- if(c>a) b=c;
- else b=a;
- }
- }
- return b;
-#endif
-}
-
-/**
- * clip a signed integer value into the amin-amax range
- * @param a value to clip
- * @param amin minimum value of the clip range
- * @param amax maximum value of the clip range
- * @return clipped value
- */
-static inline int clip(int a, int amin, int amax)
-{
- if (a < amin) return amin;
- else if (a > amax) return amax;
- else return a;
-}
-
-/**
- * clip a signed integer value into the 0-255 range
- * @param a value to clip
- * @return clipped value
- */
-static inline uint8_t clip_uint8(int a)
-{
- if (a&(~255)) return (-a)>>31;
- else return a;
-}
-
-/* math */
-int64_t ff_gcd(int64_t a, int64_t b);
-
-/**
- * converts fourcc string to int
- */
-static inline int ff_get_fourcc(const char *s){
-#ifdef HAVE_AV_CONFIG_H
- assert( strlen(s)==4 );
-#endif
-
- return (s[0]) + (s[1]<<8) + (s[2]<<16) + (s[3]<<24);
-}
-
-#define MKTAG(a,b,c,d) (a | (b << 8) | (c << 16) | (d << 24))
-#define MKBETAG(a,b,c,d) (d | (c << 8) | (b << 16) | (a << 24))
-
-/*!
- * \def GET_UTF8(val, GET_BYTE, ERROR)
- * converts a utf-8 character (up to 4 bytes long) to its 32-bit ucs-4 encoded form
- * \param val is the output and should be of type uint32_t. It holds the converted
- * ucs-4 character and should be a left value.
- * \param GET_BYTE gets utf-8 encoded bytes from any proper source. It can be
- * a function or a statement whose return value or evaluated value is of type
- * uint8_t. It will be executed up to 4 times for values in the valid utf-8 range,
- * and up to 7 times in the general case.
- * \param ERROR action that should be taken when an invalid utf-8 byte is returned
- * from GET_BYTE. It should be a statement that jumps out of the macro,
- * like exit(), goto, return, break, or continue.
- */
-#define GET_UTF8(val, GET_BYTE, ERROR)\
- val= GET_BYTE;\
- {\
- int ones= 7 - av_log2(val ^ 255);\
- if(ones==1)\
- ERROR\
- val&= 127>>ones;\
- while(--ones > 0){\
- int tmp= GET_BYTE - 128;\
- if(tmp>>6)\
- ERROR\
- val= (val<<6) + tmp;\
- }\
- }
-
-/*!
- * \def PUT_UTF8(val, tmp, PUT_BYTE)
- * converts a 32-bit unicode character to its utf-8 encoded form (up to 4 bytes long).
- * \param val is an input only argument and should be of type uint32_t. It holds
- * a ucs4 encoded unicode character that is to be converted to utf-8. If
- * val is given as a function it's executed only once.
- * \param tmp is a temporary variable and should be of type uint8_t. It
- * represents an intermediate value during conversion that is to be
- * outputted by PUT_BYTE.
- * \param PUT_BYTE writes the converted utf-8 bytes to any proper destination.
- * It could be a function or a statement, and uses tmp as the input byte.
- * For example, PUT_BYTE could be "*output++ = tmp;" PUT_BYTE will be
- * executed up to 4 times for values in the valid utf-8 range and up to
- * 7 times in the general case, depending on the length of the converted
- * unicode character.
- */
-#define PUT_UTF8(val, tmp, PUT_BYTE)\
- {\
- int bytes, shift;\
- uint32_t in = val;\
- if (in < 0x80) {\
- tmp = in;\
- PUT_BYTE\
- } else {\
- bytes = (av_log2(in) + 4) / 5;\
- shift = (bytes - 1) * 6;\
- tmp = (256 - (256 >> bytes)) | (in >> shift);\
- PUT_BYTE\
- while (shift >= 6) {\
- shift -= 6;\
- tmp = 0x80 | ((in >> shift) & 0x3f);\
- PUT_BYTE\
- }\
- }\
- }
-
-#if defined(ARCH_X86) || defined(ARCH_POWERPC)
-#if defined(ARCH_X86_64)
-static inline uint64_t read_time(void)
-{
- uint64_t a, d;
- asm volatile( "rdtsc\n\t"
- : "=a" (a), "=d" (d)
- );
- return (d << 32) | (a & 0xffffffff);
-}
-#elif defined(ARCH_X86_32)
-static inline long long read_time(void)
-{
- long long l;
- asm volatile( "rdtsc\n\t"
- : "=A" (l)
- );
- return l;
-}
-#else //FIXME check ppc64
-static inline uint64_t read_time(void)
-{
- uint32_t tbu, tbl, temp;
-
- /* from section 2.2.1 of the 32-bit PowerPC PEM */
- __asm__ __volatile__(
- "1:\n"
- "mftbu %2\n"
- "mftb %0\n"
- "mftbu %1\n"
- "cmpw %2,%1\n"
- "bne 1b\n"
- : "=r"(tbl), "=r"(tbu), "=r"(temp)
- :
- : "cc");
-
- return (((uint64_t)tbu)<<32) | (uint64_t)tbl;
-}
-#endif
-
-#define START_TIMER \
-uint64_t tend;\
-uint64_t tstart= read_time();\
-
-#define STOP_TIMER(id) \
-tend= read_time();\
-{\
- static uint64_t tsum=0;\
- static int tcount=0;\
- static int tskip_count=0;\
- if(tcount<2 || tend - tstart < 8*tsum/tcount){\
- tsum+= tend - tstart;\
- tcount++;\
- }else\
- tskip_count++;\
- if(((tcount+tskip_count)&(tcount+tskip_count-1))==0){\
- av_log(NULL, AV_LOG_DEBUG, "%"PRIu64" dezicycles in %s, %d runs, %d skips\n", tsum*10/tcount, id, tcount, tskip_count);\
- }\
-}
-#else
-#define START_TIMER
-#define STOP_TIMER(id) {}
-#endif
-
-/* memory */
-
-#ifdef __GNUC__
- #define DECLARE_ALIGNED(n,t,v) t v __attribute__ ((aligned (n)))
-#else
- #define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v
-#endif
-
-/* memory */
-void *av_malloc(unsigned int size);
-void *av_realloc(void *ptr, unsigned int size);
-void av_free(void *ptr);
-
-void *av_mallocz(unsigned int size);
-char *av_strdup(const char *s);
-void av_freep(void *ptr);
-
-/* xine: inline causes trouble for debug compiling */
-#ifdef DISABLE_INLINE
-# ifdef inline
-# undef inline
-# endif
-# ifdef always_inline
-# undef always_inline
-# endif
-# define inline
-# define always_inline
-#endif
-
-/* xine: another config.h with codecs to use */
-#include "ffmpeg_config.h"
-
-#endif /* COMMON_H */
-
diff --git a/src/libffmpeg/libavutil/crc.c b/src/libffmpeg/libavutil/crc.c
deleted file mode 100644
index baa605d32..000000000
--- a/src/libffmpeg/libavutil/crc.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "common.h"
-#include "crc.h"
-
-AVCRC *av_crcEDB88320;
-AVCRC *av_crc04C11DB7;
-AVCRC *av_crc8005 ;
-AVCRC *av_crc07 ;
-
-/**
- * Inits a crc table.
- * @param ctx must be an array of sizeof(AVCRC)*257 or sizeof(AVCRC)*1024
- * @param cts_size size of ctx in bytes
- * @return <0 on failure
- */
-int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size){
- int i, j;
- uint32_t c;
-
- if (bits < 8 || bits > 32 || poly >= (1LL<<bits))
- return -1;
- if (ctx_size != sizeof(AVCRC)*257 && ctx_size != sizeof(AVCRC)*1024)
- return -1;
-
- for (i = 0; i < 256; i++) {
- if (le) {
- for (c = i, j = 0; j < 8; j++)
- c = (c>>1)^(poly & (-(c&1)));
- ctx[i] = c;
- } else {
- for (c = i << 24, j = 0; j < 8; j++)
- c = (c<<1) ^ ((poly<<(32-bits)) & (((int32_t)c)>>31) );
- ctx[i] = bswap_32(c);
- }
- }
- ctx[256]=1;
-#ifndef CONFIG_SMALL
- if(ctx_size >= sizeof(AVCRC)*1024)
- for (i = 0; i < 256; i++)
- for(j=0; j<3; j++)
- ctx[256*(j+1) + i]= (ctx[256*j + i]>>8) ^ ctx[ ctx[256*j + i]&0xFF ];
-#endif
-
- return 0;
-}
-
-uint32_t av_crc(const AVCRC *ctx, uint32_t crc, const uint8_t *buffer, size_t length){
- const uint8_t *end= buffer+length;
-
-#ifndef CONFIG_SMALL
- if(!ctx[256])
- while(buffer<end-3){
- crc ^= le2me_32(*(uint32_t*)buffer); buffer+=4;
- crc = ctx[3*256 + ( crc &0xFF)]
- ^ctx[2*256 + ((crc>>8 )&0xFF)]
- ^ctx[1*256 + ((crc>>16)&0xFF)]
- ^ctx[0*256 + ((crc>>24) )];
- }
-#endif
- while(buffer<end)
- crc = ctx[((uint8_t)crc) ^ *buffer++] ^ (crc >> 8);
-
- return crc;
-}
-
-#ifdef TEST
-#undef printf
-main(){
- uint8_t buf[1999];
- int i;
- int p[4][4]={{1, 32, 0xedb88320L, 0x3D5CDD04},
- {0, 32, 0x04c11db7L, 0xC0F5BAE0},
- {0, 16, 0x8005 , 0x1FBB },
- {0, 8, 0x07 , 0xE3 },};
- AVCRC ctx[1 ? 1024:257];
-
- for(i=0; i<sizeof(buf); i++)
- buf[i]= i+i*i;
-
- for(i=0; i<4; i++){
- av_crc_init(ctx, p[i][0], p[i][1], p[i][2], sizeof(ctx));
- printf("crc %08X =%X\n", p[i][2], av_crc(ctx, 0, buf, sizeof(buf)));
- }
-}
-#endif
diff --git a/src/libffmpeg/libavutil/crc.h b/src/libffmpeg/libavutil/crc.h
deleted file mode 100644
index e739c309b..000000000
--- a/src/libffmpeg/libavutil/crc.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef CRC_H
-#define CRC_H
-
-typedef uint32_t AVCRC;
-
-extern AVCRC *av_crcEDB88320;
-extern AVCRC *av_crc04C11DB7;
-extern AVCRC *av_crc8005 ;
-extern AVCRC *av_crc07 ;
-
-int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size);
-uint32_t av_crc(const AVCRC *ctx, uint32_t start_crc, const uint8_t *buffer, size_t length);
-
-#endif /* CRC_H */
-
diff --git a/src/libffmpeg/libavutil/integer.c b/src/libffmpeg/libavutil/integer.c
deleted file mode 100644
index 5c7b71530..000000000
--- a/src/libffmpeg/libavutil/integer.c
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * arbitrary precision integers
- * Copyright (c) 2004 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file integer.c
- * arbitrary precision integers.
- * @author Michael Niedermayer <michaelni@gmx.at>
- */
-
-#include "common.h"
-#include "integer.h"
-
-AVInteger av_add_i(AVInteger a, AVInteger b){
- int i, carry=0;
-
- for(i=0; i<AV_INTEGER_SIZE; i++){
- carry= (carry>>16) + a.v[i] + b.v[i];
- a.v[i]= carry;
- }
- return a;
-}
-
-AVInteger av_sub_i(AVInteger a, AVInteger b){
- int i, carry=0;
-
- for(i=0; i<AV_INTEGER_SIZE; i++){
- carry= (carry>>16) + a.v[i] - b.v[i];
- a.v[i]= carry;
- }
- return a;
-}
-
-/**
- * returns the rounded down value of the logarithm of base 2 of the given AVInteger.
- * this is simply the index of the most significant bit which is 1. Or 0 of all bits are 0
- */
-int av_log2_i(AVInteger a){
- int i;
-
- for(i=AV_INTEGER_SIZE-1; i>=0; i--){
- if(a.v[i])
- return av_log2_16bit(a.v[i]) + 16*i;
- }
- return -1;
-}
-
-AVInteger av_mul_i(AVInteger a, AVInteger b){
- AVInteger out;
- int i, j;
- int na= (av_log2_i(a)+16) >> 4;
- int nb= (av_log2_i(b)+16) >> 4;
-
- memset(&out, 0, sizeof(out));
-
- for(i=0; i<na; i++){
- unsigned int carry=0;
-
- if(a.v[i])
- for(j=i; j<AV_INTEGER_SIZE && j-i<=nb; j++){
- carry= (carry>>16) + out.v[j] + a.v[i]*b.v[j-i];
- out.v[j]= carry;
- }
- }
-
- return out;
-}
-
-/**
- * returns 0 if a==b, 1 if a>b and -1 if a<b.
- */
-int av_cmp_i(AVInteger a, AVInteger b){
- int i;
- int v= (int16_t)a.v[AV_INTEGER_SIZE-1] - (int16_t)b.v[AV_INTEGER_SIZE-1];
- if(v) return (v>>16)|1;
-
- for(i=AV_INTEGER_SIZE-2; i>=0; i--){
- int v= a.v[i] - b.v[i];
- if(v) return (v>>16)|1;
- }
- return 0;
-}
-
-/**
- * bitwise shift.
- * @param s the number of bits by which the value should be shifted right, may be negative for shifting left
- */
-AVInteger av_shr_i(AVInteger a, int s){
- AVInteger out;
- int i;
-
- for(i=0; i<AV_INTEGER_SIZE; i++){
- int index= i + (s>>4);
- unsigned int v=0;
- if(index+1<AV_INTEGER_SIZE && index+1>=0) v = a.v[index+1]<<16;
- if(index <AV_INTEGER_SIZE && index >=0) v+= a.v[index ];
- out.v[i]= v >> (s&15);
- }
- return out;
-}
-
-/**
- * returns a % b.
- * @param quot a/b will be stored here
- */
-AVInteger av_mod_i(AVInteger *quot, AVInteger a, AVInteger b){
- int i= av_log2_i(a) - av_log2_i(b);
- AVInteger quot_temp;
- if(!quot) quot = &quot_temp;
-
- assert((int16_t)a.v[AV_INTEGER_SIZE-1] >= 0 && (int16_t)b.v[AV_INTEGER_SIZE-1] >= 0);
- assert(av_log2_i(b)>=0);
-
- if(i > 0)
- b= av_shr_i(b, -i);
-
- memset(quot, 0, sizeof(AVInteger));
-
- while(i-- >= 0){
- *quot= av_shr_i(*quot, -1);
- if(av_cmp_i(a, b) >= 0){
- a= av_sub_i(a, b);
- quot->v[0] += 1;
- }
- b= av_shr_i(b, 1);
- }
- return a;
-}
-
-/**
- * returns a/b.
- */
-AVInteger av_div_i(AVInteger a, AVInteger b){
- AVInteger quot;
- av_mod_i(&quot, a, b);
- return quot;
-}
-
-/**
- * converts the given int64_t to an AVInteger.
- */
-AVInteger av_int2i(int64_t a){
- AVInteger out;
- int i;
-
- for(i=0; i<AV_INTEGER_SIZE; i++){
- out.v[i]= a;
- a>>=16;
- }
- return out;
-}
-
-/**
- * converts the given AVInteger to an int64_t.
- * if the AVInteger is too large to fit into an int64_t,
- * then only the least significant 64bit will be used
- */
-int64_t av_i2int(AVInteger a){
- int i;
- int64_t out=(int8_t)a.v[AV_INTEGER_SIZE-1];
-
- for(i= AV_INTEGER_SIZE-2; i>=0; i--){
- out = (out<<16) + a.v[i];
- }
- return out;
-}
-
-#if 0
-#undef NDEBUG
-#include <assert.h>
-
-const uint8_t ff_log2_tab[256]={
- 0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
- 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
- 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
- 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
- 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
- 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
- 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
- 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
-};
-
-main(){
- int64_t a,b;
-
- for(a=7; a<256*256*256; a+=13215){
- for(b=3; b<256*256*256; b+=27118){
- AVInteger ai= av_int2i(a);
- AVInteger bi= av_int2i(b);
-
- assert(av_i2int(ai) == a);
- assert(av_i2int(bi) == b);
- assert(av_i2int(av_add_i(ai,bi)) == a+b);
- assert(av_i2int(av_sub_i(ai,bi)) == a-b);
- assert(av_i2int(av_mul_i(ai,bi)) == a*b);
- assert(av_i2int(av_shr_i(ai, 9)) == a>>9);
- assert(av_i2int(av_shr_i(ai,-9)) == a<<9);
- assert(av_i2int(av_shr_i(ai, 17)) == a>>17);
- assert(av_i2int(av_shr_i(ai,-17)) == a<<17);
- assert(av_log2_i(ai) == av_log2(a));
- assert(av_i2int(av_div_i(ai,bi)) == a/b);
- }
- }
-}
-#endif
diff --git a/src/libffmpeg/libavutil/integer.h b/src/libffmpeg/libavutil/integer.h
deleted file mode 100644
index a50ad9bae..000000000
--- a/src/libffmpeg/libavutil/integer.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * arbitrary precision integers
- * Copyright (c) 2004 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file integer.h
- * arbitrary precision integers
- * @author Michael Niedermayer <michaelni@gmx.at>
- */
-
-#ifndef INTEGER_H
-#define INTEGER_H
-
-#define AV_INTEGER_SIZE 8
-
-typedef struct AVInteger{
- uint16_t v[AV_INTEGER_SIZE];
-} AVInteger;
-
-AVInteger av_add_i(AVInteger a, AVInteger b);
-AVInteger av_sub_i(AVInteger a, AVInteger b);
-int av_log2_i(AVInteger a);
-AVInteger av_mul_i(AVInteger a, AVInteger b);
-int av_cmp_i(AVInteger a, AVInteger b);
-AVInteger av_shr_i(AVInteger a, int s);
-AVInteger av_mod_i(AVInteger *quot, AVInteger a, AVInteger b);
-AVInteger av_div_i(AVInteger a, AVInteger b);
-AVInteger av_int2i(int64_t a);
-int64_t av_i2int(AVInteger a);
-
-#endif // INTEGER_H
diff --git a/src/libffmpeg/libavutil/internal.h b/src/libffmpeg/libavutil/internal.h
deleted file mode 100644
index 0c4b44170..000000000
--- a/src/libffmpeg/libavutil/internal.h
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file internal.h
- * common internal api header.
- */
-
-#ifndef INTERNAL_H
-#define INTERNAL_H
-
-#ifndef attribute_used
-#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
-# define attribute_used __attribute__((used))
-#else
-# define attribute_used
-#endif
-#endif
-
-#ifndef attribute_unused
-#if defined(__GNUC__)
-# define attribute_unused __attribute__((unused))
-#else
-# define attribute_unused
-#endif
-#endif
-
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
-#ifndef PRId64
-#define PRId64 "lld"
-#endif
-
-#ifndef PRIu64
-#define PRIu64 "llu"
-#endif
-
-#ifndef PRIx64
-#define PRIx64 "llx"
-#endif
-
-#ifndef PRIX64
-#define PRIX64 "llX"
-#endif
-
-#ifndef PRId32
-#define PRId32 "d"
-#endif
-
-#ifndef PRIdFAST16
-#define PRIdFAST16 PRId32
-#endif
-
-#ifndef PRIdFAST32
-#define PRIdFAST32 PRId32
-#endif
-
-#ifndef INT16_MIN
-#define INT16_MIN (-0x7fff-1)
-#endif
-
-#ifndef INT16_MAX
-#define INT16_MAX 0x7fff
-#endif
-
-#ifndef INT32_MIN
-#define INT32_MIN (-0x7fffffff-1)
-#endif
-
-#ifndef INT32_MAX
-#define INT32_MAX 0x7fffffff
-#endif
-
-#ifndef UINT32_MAX
-#define UINT32_MAX 0xffffffff
-#endif
-
-#ifndef INT64_MIN
-#define INT64_MIN (-0x7fffffffffffffffLL-1)
-#endif
-
-#ifndef INT64_MAX
-#define INT64_MAX INT64_C(9223372036854775807)
-#endif
-
-#ifndef UINT64_MAX
-#define UINT64_MAX UINT64_C(0xFFFFFFFFFFFFFFFF)
-#endif
-
-#ifndef INT_BIT
-# if INT_MAX != 2147483647
-# define INT_BIT 64
-# else
-# define INT_BIT 32
-# endif
-#endif
-
-#if ( defined(__PIC__) || defined(__pic__) ) && ! defined(PIC)
-# define PIC
-#endif
-
-#ifndef ENODATA
-# define ENODATA 61
-#endif
-
-#include "intreadwrite.h"
-#include "bswap.h"
-
-#include <stddef.h>
-#ifndef offsetof
-# define offsetof(T,F) ((unsigned int)((char *)&((T *)0)->F))
-#endif
-
-#ifdef __MINGW32__
-# ifdef _DEBUG
-# define DEBUG
-# endif
-
-# define snprintf _snprintf
-# define vsnprintf _vsnprintf
-
-# ifdef CONFIG_WINCE
-# define perror(a)
-# define abort()
-# endif
-
-/* __MINGW32__ end */
-#elif defined (CONFIG_OS2)
-/* OS/2 EMX */
-
-# include <float.h>
-
-#endif /* !__MINGW32__ && CONFIG_OS2 */
-
-#ifdef USE_FASTMEMCPY
-# include "libvo/fastmemcpy.h"
-#endif
-
-// Use rip-relative addressing if compiling PIC code on x86-64.
-#if defined(__MINGW32__) || defined(__CYGWIN__) || \
- defined(__OS2__) || (defined (__OpenBSD__) && !defined(__ELF__))
-# if defined(ARCH_X86_64) && defined(PIC)
-# define MANGLE(a) "_" #a"(%%rip)"
-# else
-# define MANGLE(a) "_" #a
-# endif
-#else
-# if defined(ARCH_X86_64) && defined(PIC)
-# define MANGLE(a) #a"(%%rip)"
-# elif defined(CONFIG_DARWIN)
-# define MANGLE(a) "_" #a
-# else
-# define MANGLE(a) #a
-# endif
-#endif
-
-/* debug stuff */
-
-#if !defined(DEBUG) && !defined(NDEBUG)
-# define NDEBUG
-#endif
-#include <assert.h>
-
-/* dprintf macros */
-# ifdef DEBUG
-# ifdef __GNUC__
-# define dprintf(fmt,args...) av_log(NULL, AV_LOG_DEBUG, fmt, ##args)
-# else
-# define dprintf(fmt,...) av_log(NULL, AV_LOG_DEBUG, fmt, __VA_ARGS__)
-# endif
-# else
-# define dprintf(fmt,...)
-# endif
-
-#define av_abort() do { av_log(NULL, AV_LOG_ERROR, "Abort at %s:%d\n", __FILE__, __LINE__); abort(); } while (0)
-
-/* math */
-
-extern const uint32_t ff_inverse[256];
-
-#if defined(ARCH_X86)
-# define FASTDIV(a,b) \
- ({\
- int ret,dmy;\
- asm volatile(\
- "mull %3"\
- :"=d"(ret),"=a"(dmy)\
- :"1"(a),"g"(ff_inverse[b])\
- );\
- ret;\
- })
-#elif defined(ARCH_ARMV4L)
-# define FASTDIV(a,b) \
- ({\
- int ret,dmy;\
- asm volatile(\
- "umull %1, %0, %2, %3"\
- :"=&r"(ret),"=&r"(dmy)\
- :"r"(a),"r"(ff_inverse[b])\
- );\
- ret;\
- })
-#elif defined(CONFIG_FASTDIV)
-# define FASTDIV(a,b) ((uint32_t)((((uint64_t)a)*ff_inverse[b])>>32))
-#else
-# define FASTDIV(a,b) ((a)/(b))
-#endif
-
-extern const uint8_t ff_sqrt_tab[128];
-
-static inline int ff_sqrt(int a)
-{
- int ret=0;
- int s;
- int ret_sq=0;
-
- if(a<128) return ff_sqrt_tab[a];
-
- for(s=15; s>=0; s--){
- int b= ret_sq + (1<<(s*2)) + (ret<<s)*2;
- if(b<=a){
- ret_sq=b;
- ret+= 1<<s;
- }
- }
- return ret;
-}
-
-#if defined(ARCH_X86)
-#define MASK_ABS(mask, level)\
- asm volatile(\
- "cdq \n\t"\
- "xorl %1, %0 \n\t"\
- "subl %1, %0 \n\t"\
- : "+a" (level), "=&d" (mask)\
- );
-#else
-#define MASK_ABS(mask, level)\
- mask= level>>31;\
- level= (level^mask)-mask;
-#endif
-
-#ifdef HAVE_CMOV
-#define COPY3_IF_LT(x,y,a,b,c,d)\
-asm volatile (\
- "cmpl %0, %3 \n\t"\
- "cmovl %3, %0 \n\t"\
- "cmovl %4, %1 \n\t"\
- "cmovl %5, %2 \n\t"\
- : "+r" (x), "+r" (a), "+r" (c)\
- : "r" (y), "r" (b), "r" (d)\
-);
-#else
-#define COPY3_IF_LT(x,y,a,b,c,d)\
-if((y)<(x)){\
- (x)=(y);\
- (a)=(b);\
- (c)=(d);\
-}
-#endif
-
-/* avoid usage of various functions */
-#define malloc please_use_av_malloc
-#define free please_use_av_free
-#define realloc please_use_av_realloc
-#define time time_is_forbidden_due_to_security_issues
-#define rand rand_is_forbidden_due_to_state_trashing
-#define srand srand_is_forbidden_due_to_state_trashing
-#define sprintf sprintf_is_forbidden_due_to_security_issues_use_snprintf
-#define strcat strcat_is_forbidden_due_to_security_issues_use_pstrcat
-#if !(defined(LIBAVFORMAT_BUILD) || defined(_FRAMEHOOK_H))
-#define printf please_use_av_log
-#define fprintf please_use_av_log
-#endif
-
-#define CHECKED_ALLOCZ(p, size)\
-{\
- p= av_mallocz(size);\
- if(p==NULL && (size)!=0){\
- perror("malloc");\
- goto fail;\
- }\
-}
-
-#ifndef HAVE_LRINTF
-/* XXX: add ISOC specific test to avoid specific BSD testing. */
-/* better than nothing implementation. */
-/* btw, rintf() is existing on fbsd too -- alex */
-static av_always_inline long int lrintf(float x)
-{
-#ifdef __MINGW32__
-# ifdef ARCH_X86_32
- int32_t i;
- asm volatile(
- "fistpl %0\n\t"
- : "=m" (i) : "t" (x) : "st"
- );
- return i;
-# else
- /* XXX: incorrect, but make it compile */
- return (int)(x + (x < 0 ? -0.5 : 0.5));
-# endif /* ARCH_X86_32 */
-#else
- return (int)(rint(x));
-#endif /* __MINGW32__ */
-}
-#endif /* HAVE_LRINTF */
-
-#endif /* INTERNAL_H */
diff --git a/src/libffmpeg/libavutil/intfloat_readwrite.h b/src/libffmpeg/libavutil/intfloat_readwrite.h
deleted file mode 100644
index c535b64c8..000000000
--- a/src/libffmpeg/libavutil/intfloat_readwrite.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * copyright (c) 2005 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef INTFLOAT_READWRITE_H
-#define INTFLOAT_READWRITE_H
-
-#include "common.h"
-
-/* IEEE 80 bits extended float */
-typedef struct AVExtFloat {
- uint8_t exponent[2];
- uint8_t mantissa[8];
-} AVExtFloat;
-
-double av_int2dbl(int64_t v);
-float av_int2flt(int32_t v);
-double av_ext2dbl(const AVExtFloat ext);
-int64_t av_dbl2int(double d);
-int32_t av_flt2int(float d);
-AVExtFloat av_dbl2ext(double d);
-
-#endif /* INTFLOAT_READWRITE_H */
diff --git a/src/libffmpeg/libavutil/intreadwrite.h b/src/libffmpeg/libavutil/intreadwrite.h
deleted file mode 100644
index e6db5ce6f..000000000
--- a/src/libffmpeg/libavutil/intreadwrite.h
+++ /dev/null
@@ -1,65 +0,0 @@
-#ifndef INTREADWRITE_H
-#define INTREADWRITE_H
-
-#ifdef __GNUC__
-
-struct unaligned_64 { uint64_t l; } __attribute__((packed));
-struct unaligned_32 { uint32_t l; } __attribute__((packed));
-struct unaligned_16 { uint16_t l; } __attribute__((packed));
-
-#define LD16(a) (((const struct unaligned_16 *) (a))->l)
-#define LD32(a) (((const struct unaligned_32 *) (a))->l)
-#define LD64(a) (((const struct unaligned_64 *) (a))->l)
-
-#define ST16(a, b) (((struct unaligned_16 *) (a))->l) = (b)
-#define ST32(a, b) (((struct unaligned_32 *) (a))->l) = (b)
-
-#else /* __GNUC__ */
-
-#define LD16(a) (*((uint16_t*)(a)))
-#define LD32(a) (*((uint32_t*)(a)))
-#define LD64(a) (*((uint64_t*)(a)))
-
-#define ST16(a, b) *((uint16_t*)(a)) = (b)
-#define ST32(a, b) *((uint32_t*)(a)) = (b)
-
-#endif /* !__GNUC__ */
-
-/* endian macros */
-#define AV_RB8(x) (((uint8_t*)(x))[0])
-#define AV_WB8(p, i, d) { ((uint8_t*)(p))[(i)] = (d); }
-
-#define AV_RB16(x) ((((uint8_t*)(x))[0] << 8) | ((uint8_t*)(x))[1])
-#define AV_WB16(p, i, d) { \
- ((uint8_t*)(p))[(i)+1] = (d); \
- ((uint8_t*)(p))[(i)] = (d)>>8; }
-
-#define AV_RB32(x) ((((uint8_t*)(x))[0] << 24) | \
- (((uint8_t*)(x))[1] << 16) | \
- (((uint8_t*)(x))[2] << 8) | \
- ((uint8_t*)(x))[3])
-#define AV_WB32(p, i, d) { \
- ((uint8_t*)(p))[(i)+3] = (d); \
- ((uint8_t*)(p))[(i)+2] = (d)>>8; \
- ((uint8_t*)(p))[(i)+1] = (d)>>16; \
- ((uint8_t*)(p))[(i)] = (d)>>24; }
-
-#define AV_RL8(x) AV_RB8(x)
-#define AV_WL8(p, i, d) AV_WB8(p, i, d)
-
-#define AV_RL16(x) ((((uint8_t*)(x))[1] << 8) | ((uint8_t*)(x))[0])
-#define AV_WL16(p, i, d) { \
- ((uint8_t*)(p))[(i)] = (d); \
- ((uint8_t*)(p))[(i)+1] = (d)>>8; }
-
-#define AV_RL32(x) ((((uint8_t*)(x))[3] << 24) | \
- (((uint8_t*)(x))[2] << 16) | \
- (((uint8_t*)(x))[1] << 8) | \
- ((uint8_t*)(x))[0])
-#define AV_WL32(p, i, d) { \
- ((uint8_t*)(p))[(i)] = (d); \
- ((uint8_t*)(p))[(i)+1] = (d)>>8; \
- ((uint8_t*)(p))[(i)+2] = (d)>>16; \
- ((uint8_t*)(p))[(i)+3] = (d)>>24; }
-
-#endif /* INTREADWRITE_H */
diff --git a/src/libffmpeg/libavutil/lls.c b/src/libffmpeg/libavutil/lls.c
deleted file mode 100644
index aa9467dce..000000000
--- a/src/libffmpeg/libavutil/lls.c
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * linear least squares model
- *
- * Copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file lls.c
- * linear least squares model
- */
-
-#include <math.h>
-#include <string.h>
-
-#include "lls.h"
-
-#ifdef TEST
-#define av_log(a,b,...) printf(__VA_ARGS__)
-#endif
-
-void av_init_lls(LLSModel *m, int indep_count){
- memset(m, 0, sizeof(LLSModel));
-
- m->indep_count= indep_count;
-}
-
-void av_update_lls(LLSModel *m, double *var, double decay){
- int i,j;
-
- for(i=0; i<=m->indep_count; i++){
- for(j=i; j<=m->indep_count; j++){
- m->covariance[i][j] *= decay;
- m->covariance[i][j] += var[i]*var[j];
- }
- }
-}
-
-void av_solve_lls(LLSModel *m, double threshold, int min_order){
- int i,j,k;
- double (*factor)[MAX_VARS+1]= &m->covariance[1][0];
- double (*covar )[MAX_VARS+1]= &m->covariance[1][1];
- double *covar_y = m->covariance[0];
- int count= m->indep_count;
-
- for(i=0; i<count; i++){
- for(j=i; j<count; j++){
- double sum= covar[i][j];
-
- for(k=i-1; k>=0; k--)
- sum -= factor[i][k]*factor[j][k];
-
- if(i==j){
- if(sum < threshold)
- sum= 1.0;
- factor[i][i]= sqrt(sum);
- }else
- factor[j][i]= sum / factor[i][i];
- }
- }
- for(i=0; i<count; i++){
- double sum= covar_y[i+1];
- for(k=i-1; k>=0; k--)
- sum -= factor[i][k]*m->coeff[0][k];
- m->coeff[0][i]= sum / factor[i][i];
- }
-
- for(j=count-1; j>=min_order; j--){
- for(i=j; i>=0; i--){
- double sum= m->coeff[0][i];
- for(k=i+1; k<=j; k++)
- sum -= factor[k][i]*m->coeff[j][k];
- m->coeff[j][i]= sum / factor[i][i];
- }
-
- m->variance[j]= covar_y[0];
- for(i=0; i<=j; i++){
- double sum= m->coeff[j][i]*covar[i][i] - 2*covar_y[i+1];
- for(k=0; k<i; k++)
- sum += 2*m->coeff[j][k]*covar[k][i];
- m->variance[j] += m->coeff[j][i]*sum;
- }
- }
-}
-
-double av_evaluate_lls(LLSModel *m, double *param, int order){
- int i;
- double out= 0;
-
- for(i=0; i<=order; i++)
- out+= param[i]*m->coeff[order][i];
-
- return out;
-}
-
-#ifdef TEST
-
-#include <stdlib.h>
-#include <stdio.h>
-
-int main(){
- LLSModel m;
- int i, order;
-
- av_init_lls(&m, 3);
-
- for(i=0; i<100; i++){
- double var[4];
- double eval, variance;
-#if 0
- var[1] = rand() / (double)RAND_MAX;
- var[2] = rand() / (double)RAND_MAX;
- var[3] = rand() / (double)RAND_MAX;
-
- var[2]= var[1] + var[3]/2;
-
- var[0] = var[1] + var[2] + var[3] + var[1]*var[2]/100;
-#else
- var[0] = (rand() / (double)RAND_MAX - 0.5)*2;
- var[1] = var[0] + rand() / (double)RAND_MAX - 0.5;
- var[2] = var[1] + rand() / (double)RAND_MAX - 0.5;
- var[3] = var[2] + rand() / (double)RAND_MAX - 0.5;
-#endif
- av_update_lls(&m, var, 0.99);
- av_solve_lls(&m, 0.001, 0);
- for(order=0; order<3; order++){
- eval= av_evaluate_lls(&m, var+1, order);
- av_log(NULL, AV_LOG_DEBUG, "real:%f order:%d pred:%f var:%f coeffs:%f %f %f\n",
- var[0], order, eval, sqrt(m.variance[order] / (i+1)),
- m.coeff[order][0], m.coeff[order][1], m.coeff[order][2]);
- }
- }
- return 0;
-}
-
-#endif
diff --git a/src/libffmpeg/libavutil/lls.h b/src/libffmpeg/libavutil/lls.h
deleted file mode 100644
index 59ad2e958..000000000
--- a/src/libffmpeg/libavutil/lls.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * linear least squares model
- *
- * Copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef LLS_H
-#define LLS_H
-
-#define MAX_VARS 32
-
-//FIXME avoid direct access to LLSModel from outside
-
-/**
- * Linear least squares model.
- */
-typedef struct LLSModel{
- double covariance[MAX_VARS+1][MAX_VARS+1];
- double coeff[MAX_VARS][MAX_VARS];
- double variance[MAX_VARS];
- int indep_count;
-}LLSModel;
-
-void av_init_lls(LLSModel *m, int indep_count);
-void av_update_lls(LLSModel *m, double *param, double decay);
-void av_solve_lls(LLSModel *m, double threshold, int min_order);
-double av_evaluate_lls(LLSModel *m, double *param, int order);
-
-#endif
diff --git a/src/libffmpeg/libavutil/log.c b/src/libffmpeg/libavutil/log.c
deleted file mode 100644
index 4fd503d0d..000000000
--- a/src/libffmpeg/libavutil/log.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * log functions
- * Copyright (c) 2003 Michel Bardiaux
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file log.c
- * log.
- */
-
-#include "avutil.h"
-
-int av_log_level = AV_LOG_INFO;
-
-void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl)
-{
- static int print_prefix=1;
- AVClass* avc= ptr ? *(AVClass**)ptr : NULL;
- if(level>av_log_level)
- return;
-#undef fprintf
- if(print_prefix && avc) {
- fprintf(stderr, "[%s @ %p]", avc->item_name(ptr), avc);
- }
-#define fprintf please_use_av_log
-
- print_prefix= strstr(fmt, "\n") != NULL;
-
- vfprintf(stderr, fmt, vl);
-}
-
-#if LIBAVUTIL_VERSION_INT < (50<<16)
-static void (*av_log_callback)(void*, int, const char*, va_list) = av_log_default_callback;
-#else
-void (*av_vlog)(void*, int, const char*, va_list) = av_log_default_callback;
-#endif
-
-void av_log(void* avcl, int level, const char *fmt, ...)
-{
- va_list vl;
- va_start(vl, fmt);
- av_vlog(avcl, level, fmt, vl);
- va_end(vl);
-}
-
-#if LIBAVUTIL_VERSION_INT < (50<<16)
-void av_vlog(void* avcl, int level, const char *fmt, va_list vl)
-{
- av_log_callback(avcl, level, fmt, vl);
-}
-
-int av_log_get_level(void)
-{
- return av_log_level;
-}
-
-void av_log_set_level(int level)
-{
- av_log_level = level;
-}
-
-void av_log_set_callback(void (*callback)(void*, int, const char*, va_list))
-{
- av_log_callback = callback;
-}
-#endif
diff --git a/src/libffmpeg/libavutil/log.h b/src/libffmpeg/libavutil/log.h
deleted file mode 100644
index 56ca01289..000000000
--- a/src/libffmpeg/libavutil/log.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef LOG_H
-#define LOG_H
-
-#include <stdarg.h>
-
-/**
- * Used by av_log
- */
-typedef struct AVCLASS AVClass;
-struct AVCLASS {
- const char* class_name;
- const char* (*item_name)(void*); /* actually passing a pointer to an AVCodecContext
- or AVFormatContext, which begin with an AVClass.
- Needed because av_log is in libavcodec and has no visibility
- of AVIn/OutputFormat */
- const struct AVOption *option;
-};
-
-/* av_log API */
-
-#if LIBAVUTIL_VERSION_INT < (50<<16)
-#define AV_LOG_QUIET -1
-#define AV_LOG_FATAL 0
-#define AV_LOG_ERROR 0
-#define AV_LOG_WARNING 1
-#define AV_LOG_INFO 1
-#define AV_LOG_VERBOSE 1
-#define AV_LOG_DEBUG 2
-#else
-#define AV_LOG_QUIET -8
-
-/**
- * something went really wrong and we will crash now
- */
-#define AV_LOG_PANIC 0
-
-/**
- * something went wrong and recovery is not possible
- * like no header in a format which depends on it or a combination
- * of parameters which are not allowed
- */
-#define AV_LOG_FATAL 8
-
-/**
- * something went wrong and cannot losslessly be recovered
- * but not all future data is affected
- */
-#define AV_LOG_ERROR 16
-
-/**
- * something somehow does not look correct / something which may or may not
- * lead to some problems like use of -vstrict -2
- */
-#define AV_LOG_WARNING 24
-
-#define AV_LOG_INFO 32
-#define AV_LOG_VERBOSE 40
-
-/**
- * stuff which is only useful for libav* developers
- */
-#define AV_LOG_DEBUG 48
-#endif
-extern int av_log_level;
-
-#ifdef __GNUC__
-extern void av_log(void*, int level, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 3, 4)));
-#else
-extern void av_log(void*, int level, const char *fmt, ...);
-#endif
-
-#if LIBAVUTIL_VERSION_INT < (50<<16)
-extern void av_vlog(void*, int level, const char *fmt, va_list);
-extern int av_log_get_level(void);
-extern void av_log_set_level(int);
-extern void av_log_set_callback(void (*)(void*, int, const char*, va_list));
-extern void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl);
-#else
-extern void (*av_vlog)(void*, int, const char*, va_list);
-#endif
-
-#endif /* LOG_H */
diff --git a/src/libffmpeg/libavutil/mathematics.c b/src/libffmpeg/libavutil/mathematics.c
deleted file mode 100644
index 4be027d9d..000000000
--- a/src/libffmpeg/libavutil/mathematics.c
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Copyright (c) 2005 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file mathematics.c
- * Miscellaneous math routines and tables.
- */
-
-#include "common.h"
-#include "mathematics.h"
-
-const uint8_t ff_sqrt_tab[128]={
- 0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11
-};
-
-const uint8_t ff_log2_tab[256]={
- 0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
- 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
- 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
- 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
- 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
- 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
- 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
- 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
-};
-
-int64_t ff_gcd(int64_t a, int64_t b){
- if(b) return ff_gcd(b, a%b);
- else return a;
-}
-
-int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding rnd){
- int64_t r=0;
- assert(c > 0);
- assert(b >=0);
- assert(rnd >=0 && rnd<=5 && rnd!=4);
-
- if(a<0 && a != INT64_MIN) return -av_rescale_rnd(-a, b, c, rnd ^ ((rnd>>1)&1));
-
- if(rnd==AV_ROUND_NEAR_INF) r= c/2;
- else if(rnd&1) r= c-1;
-
- if(b<=INT_MAX && c<=INT_MAX){
- if(a<=INT_MAX)
- return (a * b + r)/c;
- else
- return a/c*b + (a%c*b + r)/c;
- }else{
-#if 1
- uint64_t a0= a&0xFFFFFFFF;
- uint64_t a1= a>>32;
- uint64_t b0= b&0xFFFFFFFF;
- uint64_t b1= b>>32;
- uint64_t t1= a0*b1 + a1*b0;
- uint64_t t1a= t1<<32;
- int i;
-
- a0 = a0*b0 + t1a;
- a1 = a1*b1 + (t1>>32) + (a0<t1a);
- a0 += r;
- a1 += a0<r;
-
- for(i=63; i>=0; i--){
-// int o= a1 & 0x8000000000000000ULL;
- a1+= a1 + ((a0>>i)&1);
- t1+=t1;
- if(/*o || */c <= a1){
- a1 -= c;
- t1++;
- }
- }
- return t1;
- }
-#else
- AVInteger ai;
- ai= av_mul_i(av_int2i(a), av_int2i(b));
- ai= av_add_i(ai, av_int2i(r));
-
- return av_i2int(av_div_i(ai, av_int2i(c)));
- }
-#endif
-}
-
-int64_t av_rescale(int64_t a, int64_t b, int64_t c){
- return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF);
-}
-
-int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq){
- int64_t b= bq.num * (int64_t)cq.den;
- int64_t c= cq.num * (int64_t)bq.den;
- return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF);
-}
-#if 0
-#include "integer.h"
-#undef printf
-main(){
- int64_t a,b,c,d,e;
-
- for(a=7; a<(1LL<<62); a+=a/3+1){
- for(b=3; b<(1LL<<62); b+=b/4+1){
- for(c=9; c<(1LL<<62); c+=(c*2)/5+3){
- int64_t r= c/2;
- AVInteger ai;
- ai= av_mul_i(av_int2i(a), av_int2i(b));
- ai= av_add_i(ai, av_int2i(r));
-
- d= av_i2int(av_div_i(ai, av_int2i(c)));
-
- e= av_rescale(a,b,c);
-
- if((double)a * (double)b / (double)c > (1LL<<63))
- continue;
-
- if(d!=e) printf("%"PRId64"*%"PRId64"/%"PRId64"= %"PRId64"=%"PRId64"\n", a, b, c, d, e);
- }
- }
- }
-}
-#endif
diff --git a/src/libffmpeg/libavutil/mathematics.h b/src/libffmpeg/libavutil/mathematics.h
deleted file mode 100644
index 0b74b254b..000000000
--- a/src/libffmpeg/libavutil/mathematics.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * copyright (c) 2005 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef MATHEMATICS_H
-#define MATHEMATICS_H
-
-#include "rational.h"
-
-enum AVRounding {
- AV_ROUND_ZERO = 0, ///< round toward zero
- AV_ROUND_INF = 1, ///< round away from zero
- AV_ROUND_DOWN = 2, ///< round toward -infinity
- AV_ROUND_UP = 3, ///< round toward +infinity
- AV_ROUND_NEAR_INF = 5, ///< round to nearest and halfway cases away from zero
-};
-
-/**
- * rescale a 64bit integer with rounding to nearest.
- * a simple a*b/c isn't possible as it can overflow
- */
-int64_t av_rescale(int64_t a, int64_t b, int64_t c);
-
-/**
- * rescale a 64bit integer with specified rounding.
- * a simple a*b/c isn't possible as it can overflow
- */
-int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding);
-
-/**
- * rescale a 64bit integer by 2 rational numbers.
- */
-int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq);
-
-#endif /* MATHEMATICS_H */
diff --git a/src/libffmpeg/libavutil/md5.c b/src/libffmpeg/libavutil/md5.c
deleted file mode 100644
index d33ad1483..000000000
--- a/src/libffmpeg/libavutil/md5.c
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * Copyright (C) 2006 Michael Niedermayer (michaelni@gmx.at)
- * Copyright (C) 2003-2005 by Christopher R. Hertel (crh@ubiqx.mn.org)
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * References:
- * IETF RFC 1321: The MD5 Message-Digest Algorithm
- * Ron Rivest. IETF, April, 1992
- *
- * based on http://ubiqx.org/libcifs/source/Auth/MD5.c
- * from Christopher R. Hertel (crh@ubiqx.mn.org)
- * simplified, cleaned and IMO redundant comments removed by michael
- *
- * if you use gcc, then version 4.1 or later and -fomit-frame-pointer is
- * strongly recommended
- */
-
-#include "common.h"
-#include <string.h>
-#include "md5.h"
-
-typedef struct AVMD5{
- uint8_t block[64];
- uint32_t ABCD[4];
- uint64_t len;
- int b_used;
-} AVMD5;
-
-const int av_md5_size= sizeof(AVMD5);
-
-static const uint8_t S[4][4] = {
- { 7, 12, 17, 22 }, /* Round 1 */
- { 5, 9, 14, 20 }, /* Round 2 */
- { 4, 11, 16, 23 }, /* Round 3 */
- { 6, 10, 15, 21 } /* Round 4 */
-};
-
-static const uint32_t T[64] = {
- 0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee, /* Round 1 */
- 0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501,
- 0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be,
- 0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821,
-
- 0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa, /* Round 2 */
- 0xd62f105d, 0x02441453, 0xd8a1e681, 0xe7d3fbc8,
- 0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0x455a14ed,
- 0xa9e3e905, 0xfcefa3f8, 0x676f02d9, 0x8d2a4c8a,
-
- 0xfffa3942, 0x8771f681, 0x6d9d6122, 0xfde5380c, /* Round 3 */
- 0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70,
- 0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x04881d05,
- 0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665,
-
- 0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039, /* Round 4 */
- 0x655b59c3, 0x8f0ccc92, 0xffeff47d, 0x85845dd1,
- 0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1,
- 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391,
-};
-
-#define CORE(i, a, b, c, d) \
- t = S[i>>4][i&3];\
- a += T[i];\
-\
- switch(i>>4){\
- case 0: a += (d ^ (b&(c^d))) + X[ i &15 ]; break;\
- case 1: a += (c ^ (d&(c^b))) + X[ (1+5*i)&15 ]; break;\
- case 2: a += (b^c^d) + X[ (5+3*i)&15 ]; break;\
- case 3: a += (c^(b|~d)) + X[ ( 7*i)&15 ]; break;\
- }\
- a = b + (( a << t ) | ( a >> (32 - t) ));
-
-static void body(uint32_t ABCD[4], uint32_t X[16]){
-
- int t;
- int i attribute_unused;
- unsigned int a= ABCD[3];
- unsigned int b= ABCD[2];
- unsigned int c= ABCD[1];
- unsigned int d= ABCD[0];
-
-#ifdef WORDS_BIGENDIAN
- for(i=0; i<16; i++)
- X[i]= bswap_32(X[i]);
-#endif
-
-#ifdef CONFIG_SMALL
- for( i = 0; i < 64; i++ ){
- CORE(i,a,b,c,d)
- t=d; d=c; c=b; b=a; a=t;
- }
-#else
-#define CORE2(i) CORE(i,a,b,c,d) CORE((i+1),d,a,b,c) CORE((i+2),c,d,a,b) CORE((i+3),b,c,d,a)
-#define CORE4(i) CORE2(i) CORE2((i+4)) CORE2((i+8)) CORE2((i+12))
-CORE4(0) CORE4(16) CORE4(32) CORE4(48)
-#endif
-
- ABCD[0] += d;
- ABCD[1] += c;
- ABCD[2] += b;
- ABCD[3] += a;
-}
-
-void av_md5_init(AVMD5 *ctx){
- ctx->len = 0;
- ctx->b_used = 0;
-
- ctx->ABCD[0] = 0x10325476;
- ctx->ABCD[1] = 0x98badcfe;
- ctx->ABCD[2] = 0xefcdab89;
- ctx->ABCD[3] = 0x67452301;
-}
-
-void av_md5_update(AVMD5 *ctx, const uint8_t *src, const int len){
- int i;
-
- ctx->len += len;
-
- for( i = 0; i < len; i++ ){
- ctx->block[ ctx->b_used++ ] = src[i];
- if( 64 == ctx->b_used ){
- body(ctx->ABCD, (uint32_t*) ctx->block);
- ctx->b_used = 0;
- }
- }
-}
-
-void av_md5_final(AVMD5 *ctx, uint8_t *dst){
- int i;
-
- ctx->block[ctx->b_used++] = 0x80;
-
- memset(&ctx->block[ctx->b_used], 0, 64 - ctx->b_used);
-
- if( 56 < ctx->b_used ){
- body( ctx->ABCD, (uint32_t*) ctx->block );
- memset(ctx->block, 0, 64);
- }
-
- for(i=0; i<8; i++)
- ctx->block[56+i] = (ctx->len << 3) >> (i<<3);
-
- body(ctx->ABCD, (uint32_t*) ctx->block);
-
- for(i=0; i<4; i++)
- ((uint32_t*)dst)[i]= le2me_32(ctx->ABCD[3-i]);
-}
-
-void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len){
- AVMD5 ctx[1];
-
- av_md5_init(ctx);
- av_md5_update(ctx, src, len);
- av_md5_final(ctx, dst);
-}
-
-#ifdef TEST
-#include <stdio.h>
-main(){
- uint64_t md5val;
- int i;
- uint8_t in[1000];
-
- for(i=0; i<1000; i++) in[i]= i*i;
- av_md5_sum( (uint8_t*)&md5val, in, 1000); printf("%"PRId64"\n", md5val);
- av_md5_sum( (uint8_t*)&md5val, in, 63); printf("%"PRId64"\n", md5val);
- av_md5_sum( (uint8_t*)&md5val, in, 64); printf("%"PRId64"\n", md5val);
- av_md5_sum( (uint8_t*)&md5val, in, 65); printf("%"PRId64"\n", md5val);
- for(i=0; i<1000; i++) in[i]= i % 127;
- av_md5_sum( (uint8_t*)&md5val, in, 999); printf("%"PRId64"\n", md5val);
-}
-#endif
diff --git a/src/libffmpeg/libavutil/md5.h b/src/libffmpeg/libavutil/md5.h
deleted file mode 100644
index 8d1b4b5fe..000000000
--- a/src/libffmpeg/libavutil/md5.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef MD5_H
-#define MD5_H
-
-extern const int av_md5_size;
-
-struct AVMD5;
-
-void av_md5_init(struct AVMD5 *ctx);
-void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, const int len);
-void av_md5_final(struct AVMD5 *ctx, uint8_t *dst);
-void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len);
-
-#endif /* MD5_H */
-
diff --git a/src/libffmpeg/libavutil/mem.c b/src/libffmpeg/libavutil/mem.c
deleted file mode 100644
index f43fb5420..000000000
--- a/src/libffmpeg/libavutil/mem.c
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * default memory allocator for libavutil
- * Copyright (c) 2002 Fabrice Bellard.
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file mem.c
- * default memory allocator for libavutil.
- */
-
-#include "common.h"
-
-/* here we can use OS dependant allocation functions */
-#undef malloc
-#undef free
-#undef realloc
-
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-
-/* you can redefine av_malloc and av_free in your project to use your
- memory allocator. You do not need to suppress this file because the
- linker will do it automatically */
-
-/**
- * Memory allocation of size byte with alignment suitable for all
- * memory accesses (including vectors if available on the
- * CPU). av_malloc(0) must return a non NULL pointer.
- */
-void *av_malloc(unsigned int size)
-{
- void *ptr;
-#ifdef CONFIG_MEMALIGN_HACK
- long diff;
-#endif
-
- /* let's disallow possible ambiguous cases */
- if(size > (INT_MAX-16) )
- return NULL;
-
-#ifdef CONFIG_MEMALIGN_HACK
- ptr = malloc(size+16);
- if(!ptr)
- return ptr;
- diff= ((-(long)ptr - 1)&15) + 1;
- ptr += diff;
- ((char*)ptr)[-1]= diff;
-#elif defined (HAVE_MEMALIGN)
- ptr = memalign(16,size);
- /* Why 64?
- Indeed, we should align it:
- on 4 for 386
- on 16 for 486
- on 32 for 586, PPro - k6-III
- on 64 for K7 (maybe for P3 too).
- Because L1 and L2 caches are aligned on those values.
- But I don't want to code such logic here!
- */
- /* Why 16?
- because some cpus need alignment, for example SSE2 on P4, & most RISC cpus
- it will just trigger an exception and the unaligned load will be done in the
- exception handler or it will just segfault (SSE2 on P4)
- Why not larger? because i didnt see a difference in benchmarks ...
- */
- /* benchmarks with p3
- memalign(64)+1 3071,3051,3032
- memalign(64)+2 3051,3032,3041
- memalign(64)+4 2911,2896,2915
- memalign(64)+8 2545,2554,2550
- memalign(64)+16 2543,2572,2563
- memalign(64)+32 2546,2545,2571
- memalign(64)+64 2570,2533,2558
-
- btw, malloc seems to do 8 byte alignment by default here
- */
-#else
- ptr = malloc(size);
-#endif
- return ptr;
-}
-
-/**
- * av_realloc semantics (same as glibc): if ptr is NULL and size > 0,
- * identical to malloc(size). If size is zero, it is identical to
- * free(ptr) and NULL is returned.
- */
-void *av_realloc(void *ptr, unsigned int size)
-{
-#ifdef CONFIG_MEMALIGN_HACK
- int diff;
-#endif
-
- /* let's disallow possible ambiguous cases */
- if(size > (INT_MAX-16) )
- return NULL;
-
-#ifdef CONFIG_MEMALIGN_HACK
- //FIXME this isn't aligned correctly, though it probably isn't needed
- if(!ptr) return av_malloc(size);
- diff= ((char*)ptr)[-1];
- return realloc(ptr - diff, size + diff) + diff;
-#else
- return realloc(ptr, size);
-#endif
-}
-
-/**
- * Free memory which has been allocated with av_malloc(z)() or av_realloc().
- * NOTE: ptr = NULL is explicetly allowed
- * Note2: it is recommended that you use av_freep() instead
- */
-void av_free(void *ptr)
-{
- /* XXX: this test should not be needed on most libcs */
- if (ptr)
-#ifdef CONFIG_MEMALIGN_HACK
- free(ptr - ((char*)ptr)[-1]);
-#else
- free(ptr);
-#endif
-}
-
-/**
- * Frees memory and sets the pointer to NULL.
- * @param arg pointer to the pointer which should be freed
- */
-void av_freep(void *arg)
-{
- void **ptr= (void**)arg;
- av_free(*ptr);
- *ptr = NULL;
-}
-
-void *av_mallocz(unsigned int size)
-{
- void *ptr;
-
- ptr = av_malloc(size);
- if (ptr)
- memset(ptr, 0, size);
- return ptr;
-}
-
-char *av_strdup(const char *s)
-{
- char *ptr;
- int len;
- len = strlen(s) + 1;
- ptr = av_malloc(len);
- if (ptr)
- memcpy(ptr, s, len);
- return ptr;
-}
-
diff --git a/src/libffmpeg/libavutil/rational.c b/src/libffmpeg/libavutil/rational.c
deleted file mode 100644
index 0480aa882..000000000
--- a/src/libffmpeg/libavutil/rational.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Rational numbers
- * Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file rational.c
- * Rational numbers
- * @author Michael Niedermayer <michaelni@gmx.at>
- */
-
-//#include <math.h>
-#include <limits.h>
-
-#include "common.h"
-#include "mathematics.h"
-#include "rational.h"
-
-int av_reduce(int *dst_nom, int *dst_den, int64_t nom, int64_t den, int64_t max){
- AVRational a0={0,1}, a1={1,0};
- int sign= (nom<0) ^ (den<0);
- int64_t gcd= ff_gcd(FFABS(nom), FFABS(den));
-
- if(gcd){
- nom = FFABS(nom)/gcd;
- den = FFABS(den)/gcd;
- }
- if(nom<=max && den<=max){
- a1= (AVRational){nom, den};
- den=0;
- }
-
- while(den){
- uint64_t x = nom / den;
- int64_t next_den= nom - den*x;
- int64_t a2n= x*a1.num + a0.num;
- int64_t a2d= x*a1.den + a0.den;
-
- if(a2n > max || a2d > max){
- if(a1.num) x= (max - a0.num) / a1.num;
- if(a1.den) x= FFMIN(x, (max - a0.den) / a1.den);
-
- if (den*(2*x*a1.den + a0.den) > nom*a1.den)
- a1 = (AVRational){x*a1.num + a0.num, x*a1.den + a0.den};
- break;
- }
-
- a0= a1;
- a1= (AVRational){a2n, a2d};
- nom= den;
- den= next_den;
- }
- assert(ff_gcd(a1.num, a1.den) <= 1U);
-
- *dst_nom = sign ? -a1.num : a1.num;
- *dst_den = a1.den;
-
- return den==0;
-}
-
-/**
- * returns b*c.
- */
-AVRational av_mul_q(AVRational b, AVRational c){
- av_reduce(&b.num, &b.den, b.num * (int64_t)c.num, b.den * (int64_t)c.den, INT_MAX);
- return b;
-}
-
-/**
- * returns b/c.
- */
-AVRational av_div_q(AVRational b, AVRational c){
- return av_mul_q(b, (AVRational){c.den, c.num});
-}
-
-/**
- * returns b+c.
- */
-AVRational av_add_q(AVRational b, AVRational c){
- av_reduce(&b.num, &b.den, b.num * (int64_t)c.den + c.num * (int64_t)b.den, b.den * (int64_t)c.den, INT_MAX);
- return b;
-}
-
-/**
- * returns b-c.
- */
-AVRational av_sub_q(AVRational b, AVRational c){
- return av_add_q(b, (AVRational){-c.num, c.den});
-}
-
-/**
- * Converts a double precission floating point number to a AVRational.
- * @param max the maximum allowed numerator and denominator
- */
-AVRational av_d2q(double d, int max){
- AVRational a;
-#define LOG2 0.69314718055994530941723212145817656807550013436025
- int exponent= FFMAX( (int)(log(fabs(d) + 1e-20)/LOG2), 0);
- int64_t den= 1LL << (61 - exponent);
- av_reduce(&a.num, &a.den, (int64_t)(d * den + 0.5), den, max);
-
- return a;
-}
diff --git a/src/libffmpeg/libavutil/rational.h b/src/libffmpeg/libavutil/rational.h
deleted file mode 100644
index 43fc22114..000000000
--- a/src/libffmpeg/libavutil/rational.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Rational numbers
- * Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/**
- * @file rational.h
- * Rational numbers.
- * @author Michael Niedermayer <michaelni@gmx.at>
- */
-
-#ifndef RATIONAL_H
-#define RATIONAL_H
-
-/**
- * Rational number num/den.
- */
-typedef struct AVRational{
- int num; ///< numerator
- int den; ///< denominator
-} AVRational;
-
-/**
- * returns 0 if a==b, 1 if a>b and -1 if a<b.
- */
-static inline int av_cmp_q(AVRational a, AVRational b){
- const int64_t tmp= a.num * (int64_t)b.den - b.num * (int64_t)a.den;
-
- if(tmp) return (tmp>>63)|1;
- else return 0;
-}
-
-/**
- * converts the given AVRational to a double.
- */
-static inline double av_q2d(AVRational a){
- return a.num / (double) a.den;
-}
-
-/**
- * reduce a fraction.
- * this is usefull for framerate calculations
- * @param max the maximum allowed for dst_nom & dst_den
- * @return 1 if exact, 0 otherwise
- */
-int av_reduce(int *dst_nom, int *dst_den, int64_t nom, int64_t den, int64_t max);
-
-AVRational av_mul_q(AVRational b, AVRational c);
-AVRational av_div_q(AVRational b, AVRational c);
-AVRational av_add_q(AVRational b, AVRational c);
-AVRational av_sub_q(AVRational b, AVRational c);
-AVRational av_d2q(double d, int max);
-
-#endif // RATIONAL_H
diff --git a/src/libffmpeg/libavutil/x86_cpu.h b/src/libffmpeg/libavutil/x86_cpu.h
deleted file mode 100644
index 3d54b2a60..000000000
--- a/src/libffmpeg/libavutil/x86_cpu.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_X86CPU_H
-#define AVUTIL_X86CPU_H
-
-#ifdef ARCH_X86_64
-# define REG_a "rax"
-# define REG_b "rbx"
-# define REG_c "rcx"
-# define REG_d "rdx"
-# define REG_D "rdi"
-# define REG_S "rsi"
-# define PTR_SIZE "8"
-
-# define REG_SP "rsp"
-# define REG_BP "rbp"
-# define REGBP rbp
-# define REGa rax
-# define REGb rbx
-# define REGc rcx
-# define REGSP rsp
-
-#else
-
-# define REG_a "eax"
-# define REG_b "ebx"
-# define REG_c "ecx"
-# define REG_d "edx"
-# define REG_D "edi"
-# define REG_S "esi"
-# define PTR_SIZE "4"
-
-# define REG_SP "esp"
-# define REG_BP "ebp"
-# define REGBP ebp
-# define REGa eax
-# define REGb ebx
-# define REGc ecx
-# define REGSP esp
-#endif
-
-#endif /* AVUTIL_X86CPU_H */
diff --git a/src/libmad/D.dat b/src/libmad/D.dat
deleted file mode 100644
index 31c6cd4fa..000000000
--- a/src/libmad/D.dat
+++ /dev/null
@@ -1,607 +0,0 @@
-/*
- * libmad - MPEG audio decoder library
- * Copyright (C) 2000-2004 Underbit Technologies, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * $Id: D.dat,v 1.3 2004/04/22 00:22:33 miguelfreitas Exp $
- */
-
-/*
- * These are the coefficients for the subband synthesis window. This is a
- * reordered version of Table B.3 from ISO/IEC 11172-3.
- *
- * Every value is parameterized so that shift optimizations can be made at
- * compile-time. For example, every value can be right-shifted 12 bits to
- * minimize multiply instruction times without any loss of accuracy.
- */
-
- { PRESHIFT(0x00000000) /* 0.000000000 */, /* 0 */
- -PRESHIFT(0x0001d000) /* -0.000442505 */,
- PRESHIFT(0x000d5000) /* 0.003250122 */,
- -PRESHIFT(0x001cb000) /* -0.007003784 */,
- PRESHIFT(0x007f5000) /* 0.031082153 */,
- -PRESHIFT(0x01421000) /* -0.078628540 */,
- PRESHIFT(0x019ae000) /* 0.100311279 */,
- -PRESHIFT(0x09271000) /* -0.572036743 */,
- PRESHIFT(0x1251e000) /* 1.144989014 */,
- PRESHIFT(0x09271000) /* 0.572036743 */,
- PRESHIFT(0x019ae000) /* 0.100311279 */,
- PRESHIFT(0x01421000) /* 0.078628540 */,
- PRESHIFT(0x007f5000) /* 0.031082153 */,
- PRESHIFT(0x001cb000) /* 0.007003784 */,
- PRESHIFT(0x000d5000) /* 0.003250122 */,
- PRESHIFT(0x0001d000) /* 0.000442505 */,
-
- PRESHIFT(0x00000000) /* 0.000000000 */,
- -PRESHIFT(0x0001d000) /* -0.000442505 */,
- PRESHIFT(0x000d5000) /* 0.003250122 */,
- -PRESHIFT(0x001cb000) /* -0.007003784 */,
- PRESHIFT(0x007f5000) /* 0.031082153 */,
- -PRESHIFT(0x01421000) /* -0.078628540 */,
- PRESHIFT(0x019ae000) /* 0.100311279 */,
- -PRESHIFT(0x09271000) /* -0.572036743 */,
- PRESHIFT(0x1251e000) /* 1.144989014 */,
- PRESHIFT(0x09271000) /* 0.572036743 */,
- PRESHIFT(0x019ae000) /* 0.100311279 */,
- PRESHIFT(0x01421000) /* 0.078628540 */,
- PRESHIFT(0x007f5000) /* 0.031082153 */,
- PRESHIFT(0x001cb000) /* 0.007003784 */,
- PRESHIFT(0x000d5000) /* 0.003250122 */,
- PRESHIFT(0x0001d000) /* 0.000442505 */ },
-
- { -PRESHIFT(0x00001000) /* -0.000015259 */, /* 1 */
- -PRESHIFT(0x0001f000) /* -0.000473022 */,
- PRESHIFT(0x000da000) /* 0.003326416 */,
- -PRESHIFT(0x00207000) /* -0.007919312 */,
- PRESHIFT(0x007d0000) /* 0.030517578 */,
- -PRESHIFT(0x0158d000) /* -0.084182739 */,
- PRESHIFT(0x01747000) /* 0.090927124 */,
- -PRESHIFT(0x099a8000) /* -0.600219727 */,
- PRESHIFT(0x124f0000) /* 1.144287109 */,
- PRESHIFT(0x08b38000) /* 0.543823242 */,
- PRESHIFT(0x01bde000) /* 0.108856201 */,
- PRESHIFT(0x012b4000) /* 0.073059082 */,
- PRESHIFT(0x0080f000) /* 0.031478882 */,
- PRESHIFT(0x00191000) /* 0.006118774 */,
- PRESHIFT(0x000d0000) /* 0.003173828 */,
- PRESHIFT(0x0001a000) /* 0.000396729 */,
-
- -PRESHIFT(0x00001000) /* -0.000015259 */,
- -PRESHIFT(0x0001f000) /* -0.000473022 */,
- PRESHIFT(0x000da000) /* 0.003326416 */,
- -PRESHIFT(0x00207000) /* -0.007919312 */,
- PRESHIFT(0x007d0000) /* 0.030517578 */,
- -PRESHIFT(0x0158d000) /* -0.084182739 */,
- PRESHIFT(0x01747000) /* 0.090927124 */,
- -PRESHIFT(0x099a8000) /* -0.600219727 */,
- PRESHIFT(0x124f0000) /* 1.144287109 */,
- PRESHIFT(0x08b38000) /* 0.543823242 */,
- PRESHIFT(0x01bde000) /* 0.108856201 */,
- PRESHIFT(0x012b4000) /* 0.073059082 */,
- PRESHIFT(0x0080f000) /* 0.031478882 */,
- PRESHIFT(0x00191000) /* 0.006118774 */,
- PRESHIFT(0x000d0000) /* 0.003173828 */,
- PRESHIFT(0x0001a000) /* 0.000396729 */ },
-
- { -PRESHIFT(0x00001000) /* -0.000015259 */, /* 2 */
- -PRESHIFT(0x00023000) /* -0.000534058 */,
- PRESHIFT(0x000de000) /* 0.003387451 */,
- -PRESHIFT(0x00245000) /* -0.008865356 */,
- PRESHIFT(0x007a0000) /* 0.029785156 */,
- -PRESHIFT(0x016f7000) /* -0.089706421 */,
- PRESHIFT(0x014a8000) /* 0.080688477 */,
- -PRESHIFT(0x0a0d8000) /* -0.628295898 */,
- PRESHIFT(0x12468000) /* 1.142211914 */,
- PRESHIFT(0x083ff000) /* 0.515609741 */,
- PRESHIFT(0x01dd8000) /* 0.116577148 */,
- PRESHIFT(0x01149000) /* 0.067520142 */,
- PRESHIFT(0x00820000) /* 0.031738281 */,
- PRESHIFT(0x0015b000) /* 0.005294800 */,
- PRESHIFT(0x000ca000) /* 0.003082275 */,
- PRESHIFT(0x00018000) /* 0.000366211 */,
-
- -PRESHIFT(0x00001000) /* -0.000015259 */,
- -PRESHIFT(0x00023000) /* -0.000534058 */,
- PRESHIFT(0x000de000) /* 0.003387451 */,
- -PRESHIFT(0x00245000) /* -0.008865356 */,
- PRESHIFT(0x007a0000) /* 0.029785156 */,
- -PRESHIFT(0x016f7000) /* -0.089706421 */,
- PRESHIFT(0x014a8000) /* 0.080688477 */,
- -PRESHIFT(0x0a0d8000) /* -0.628295898 */,
- PRESHIFT(0x12468000) /* 1.142211914 */,
- PRESHIFT(0x083ff000) /* 0.515609741 */,
- PRESHIFT(0x01dd8000) /* 0.116577148 */,
- PRESHIFT(0x01149000) /* 0.067520142 */,
- PRESHIFT(0x00820000) /* 0.031738281 */,
- PRESHIFT(0x0015b000) /* 0.005294800 */,
- PRESHIFT(0x000ca000) /* 0.003082275 */,
- PRESHIFT(0x00018000) /* 0.000366211 */ },
-
- { -PRESHIFT(0x00001000) /* -0.000015259 */, /* 3 */
- -PRESHIFT(0x00026000) /* -0.000579834 */,
- PRESHIFT(0x000e1000) /* 0.003433228 */,
- -PRESHIFT(0x00285000) /* -0.009841919 */,
- PRESHIFT(0x00765000) /* 0.028884888 */,
- -PRESHIFT(0x0185d000) /* -0.095169067 */,
- PRESHIFT(0x011d1000) /* 0.069595337 */,
- -PRESHIFT(0x0a7fe000) /* -0.656219482 */,
- PRESHIFT(0x12386000) /* 1.138763428 */,
- PRESHIFT(0x07ccb000) /* 0.487472534 */,
- PRESHIFT(0x01f9c000) /* 0.123474121 */,
- PRESHIFT(0x00fdf000) /* 0.061996460 */,
- PRESHIFT(0x00827000) /* 0.031845093 */,
- PRESHIFT(0x00126000) /* 0.004486084 */,
- PRESHIFT(0x000c4000) /* 0.002990723 */,
- PRESHIFT(0x00015000) /* 0.000320435 */,
-
- -PRESHIFT(0x00001000) /* -0.000015259 */,
- -PRESHIFT(0x00026000) /* -0.000579834 */,
- PRESHIFT(0x000e1000) /* 0.003433228 */,
- -PRESHIFT(0x00285000) /* -0.009841919 */,
- PRESHIFT(0x00765000) /* 0.028884888 */,
- -PRESHIFT(0x0185d000) /* -0.095169067 */,
- PRESHIFT(0x011d1000) /* 0.069595337 */,
- -PRESHIFT(0x0a7fe000) /* -0.656219482 */,
- PRESHIFT(0x12386000) /* 1.138763428 */,
- PRESHIFT(0x07ccb000) /* 0.487472534 */,
- PRESHIFT(0x01f9c000) /* 0.123474121 */,
- PRESHIFT(0x00fdf000) /* 0.061996460 */,
- PRESHIFT(0x00827000) /* 0.031845093 */,
- PRESHIFT(0x00126000) /* 0.004486084 */,
- PRESHIFT(0x000c4000) /* 0.002990723 */,
- PRESHIFT(0x00015000) /* 0.000320435 */ },
-
- { -PRESHIFT(0x00001000) /* -0.000015259 */, /* 4 */
- -PRESHIFT(0x00029000) /* -0.000625610 */,
- PRESHIFT(0x000e3000) /* 0.003463745 */,
- -PRESHIFT(0x002c7000) /* -0.010848999 */,
- PRESHIFT(0x0071e000) /* 0.027801514 */,
- -PRESHIFT(0x019bd000) /* -0.100540161 */,
- PRESHIFT(0x00ec0000) /* 0.057617187 */,
- -PRESHIFT(0x0af15000) /* -0.683914185 */,
- PRESHIFT(0x12249000) /* 1.133926392 */,
- PRESHIFT(0x075a0000) /* 0.459472656 */,
- PRESHIFT(0x0212c000) /* 0.129577637 */,
- PRESHIFT(0x00e79000) /* 0.056533813 */,
- PRESHIFT(0x00825000) /* 0.031814575 */,
- PRESHIFT(0x000f4000) /* 0.003723145 */,
- PRESHIFT(0x000be000) /* 0.002899170 */,
- PRESHIFT(0x00013000) /* 0.000289917 */,
-
- -PRESHIFT(0x00001000) /* -0.000015259 */,
- -PRESHIFT(0x00029000) /* -0.000625610 */,
- PRESHIFT(0x000e3000) /* 0.003463745 */,
- -PRESHIFT(0x002c7000) /* -0.010848999 */,
- PRESHIFT(0x0071e000) /* 0.027801514 */,
- -PRESHIFT(0x019bd000) /* -0.100540161 */,
- PRESHIFT(0x00ec0000) /* 0.057617187 */,
- -PRESHIFT(0x0af15000) /* -0.683914185 */,
- PRESHIFT(0x12249000) /* 1.133926392 */,
- PRESHIFT(0x075a0000) /* 0.459472656 */,
- PRESHIFT(0x0212c000) /* 0.129577637 */,
- PRESHIFT(0x00e79000) /* 0.056533813 */,
- PRESHIFT(0x00825000) /* 0.031814575 */,
- PRESHIFT(0x000f4000) /* 0.003723145 */,
- PRESHIFT(0x000be000) /* 0.002899170 */,
- PRESHIFT(0x00013000) /* 0.000289917 */ },
-
- { -PRESHIFT(0x00001000) /* -0.000015259 */, /* 5 */
- -PRESHIFT(0x0002d000) /* -0.000686646 */,
- PRESHIFT(0x000e4000) /* 0.003479004 */,
- -PRESHIFT(0x0030b000) /* -0.011886597 */,
- PRESHIFT(0x006cb000) /* 0.026535034 */,
- -PRESHIFT(0x01b17000) /* -0.105819702 */,
- PRESHIFT(0x00b77000) /* 0.044784546 */,
- -PRESHIFT(0x0b619000) /* -0.711318970 */,
- PRESHIFT(0x120b4000) /* 1.127746582 */,
- PRESHIFT(0x06e81000) /* 0.431655884 */,
- PRESHIFT(0x02288000) /* 0.134887695 */,
- PRESHIFT(0x00d17000) /* 0.051132202 */,
- PRESHIFT(0x0081b000) /* 0.031661987 */,
- PRESHIFT(0x000c5000) /* 0.003005981 */,
- PRESHIFT(0x000b7000) /* 0.002792358 */,
- PRESHIFT(0x00011000) /* 0.000259399 */,
-
- -PRESHIFT(0x00001000) /* -0.000015259 */,
- -PRESHIFT(0x0002d000) /* -0.000686646 */,
- PRESHIFT(0x000e4000) /* 0.003479004 */,
- -PRESHIFT(0x0030b000) /* -0.011886597 */,
- PRESHIFT(0x006cb000) /* 0.026535034 */,
- -PRESHIFT(0x01b17000) /* -0.105819702 */,
- PRESHIFT(0x00b77000) /* 0.044784546 */,
- -PRESHIFT(0x0b619000) /* -0.711318970 */,
- PRESHIFT(0x120b4000) /* 1.127746582 */,
- PRESHIFT(0x06e81000) /* 0.431655884 */,
- PRESHIFT(0x02288000) /* 0.134887695 */,
- PRESHIFT(0x00d17000) /* 0.051132202 */,
- PRESHIFT(0x0081b000) /* 0.031661987 */,
- PRESHIFT(0x000c5000) /* 0.003005981 */,
- PRESHIFT(0x000b7000) /* 0.002792358 */,
- PRESHIFT(0x00011000) /* 0.000259399 */ },
-
- { -PRESHIFT(0x00001000) /* -0.000015259 */, /* 6 */
- -PRESHIFT(0x00031000) /* -0.000747681 */,
- PRESHIFT(0x000e4000) /* 0.003479004 */,
- -PRESHIFT(0x00350000) /* -0.012939453 */,
- PRESHIFT(0x0066c000) /* 0.025085449 */,
- -PRESHIFT(0x01c67000) /* -0.110946655 */,
- PRESHIFT(0x007f5000) /* 0.031082153 */,
- -PRESHIFT(0x0bd06000) /* -0.738372803 */,
- PRESHIFT(0x11ec7000) /* 1.120223999 */,
- PRESHIFT(0x06772000) /* 0.404083252 */,
- PRESHIFT(0x023b3000) /* 0.139450073 */,
- PRESHIFT(0x00bbc000) /* 0.045837402 */,
- PRESHIFT(0x00809000) /* 0.031387329 */,
- PRESHIFT(0x00099000) /* 0.002334595 */,
- PRESHIFT(0x000b0000) /* 0.002685547 */,
- PRESHIFT(0x00010000) /* 0.000244141 */,
-
- -PRESHIFT(0x00001000) /* -0.000015259 */,
- -PRESHIFT(0x00031000) /* -0.000747681 */,
- PRESHIFT(0x000e4000) /* 0.003479004 */,
- -PRESHIFT(0x00350000) /* -0.012939453 */,
- PRESHIFT(0x0066c000) /* 0.025085449 */,
- -PRESHIFT(0x01c67000) /* -0.110946655 */,
- PRESHIFT(0x007f5000) /* 0.031082153 */,
- -PRESHIFT(0x0bd06000) /* -0.738372803 */,
- PRESHIFT(0x11ec7000) /* 1.120223999 */,
- PRESHIFT(0x06772000) /* 0.404083252 */,
- PRESHIFT(0x023b3000) /* 0.139450073 */,
- PRESHIFT(0x00bbc000) /* 0.045837402 */,
- PRESHIFT(0x00809000) /* 0.031387329 */,
- PRESHIFT(0x00099000) /* 0.002334595 */,
- PRESHIFT(0x000b0000) /* 0.002685547 */,
- PRESHIFT(0x00010000) /* 0.000244141 */ },
-
- { -PRESHIFT(0x00002000) /* -0.000030518 */, /* 7 */
- -PRESHIFT(0x00035000) /* -0.000808716 */,
- PRESHIFT(0x000e3000) /* 0.003463745 */,
- -PRESHIFT(0x00397000) /* -0.014022827 */,
- PRESHIFT(0x005ff000) /* 0.023422241 */,
- -PRESHIFT(0x01dad000) /* -0.115921021 */,
- PRESHIFT(0x0043a000) /* 0.016510010 */,
- -PRESHIFT(0x0c3d9000) /* -0.765029907 */,
- PRESHIFT(0x11c83000) /* 1.111373901 */,
- PRESHIFT(0x06076000) /* 0.376800537 */,
- PRESHIFT(0x024ad000) /* 0.143264771 */,
- PRESHIFT(0x00a67000) /* 0.040634155 */,
- PRESHIFT(0x007f0000) /* 0.031005859 */,
- PRESHIFT(0x0006f000) /* 0.001693726 */,
- PRESHIFT(0x000a9000) /* 0.002578735 */,
- PRESHIFT(0x0000e000) /* 0.000213623 */,
-
- -PRESHIFT(0x00002000) /* -0.000030518 */,
- -PRESHIFT(0x00035000) /* -0.000808716 */,
- PRESHIFT(0x000e3000) /* 0.003463745 */,
- -PRESHIFT(0x00397000) /* -0.014022827 */,
- PRESHIFT(0x005ff000) /* 0.023422241 */,
- -PRESHIFT(0x01dad000) /* -0.115921021 */,
- PRESHIFT(0x0043a000) /* 0.016510010 */,
- -PRESHIFT(0x0c3d9000) /* -0.765029907 */,
- PRESHIFT(0x11c83000) /* 1.111373901 */,
- PRESHIFT(0x06076000) /* 0.376800537 */,
- PRESHIFT(0x024ad000) /* 0.143264771 */,
- PRESHIFT(0x00a67000) /* 0.040634155 */,
- PRESHIFT(0x007f0000) /* 0.031005859 */,
- PRESHIFT(0x0006f000) /* 0.001693726 */,
- PRESHIFT(0x000a9000) /* 0.002578735 */,
- PRESHIFT(0x0000e000) /* 0.000213623 */ },
-
- { -PRESHIFT(0x00002000) /* -0.000030518 */, /* 8 */
- -PRESHIFT(0x0003a000) /* -0.000885010 */,
- PRESHIFT(0x000e0000) /* 0.003417969 */,
- -PRESHIFT(0x003df000) /* -0.015121460 */,
- PRESHIFT(0x00586000) /* 0.021575928 */,
- -PRESHIFT(0x01ee6000) /* -0.120697021 */,
- PRESHIFT(0x00046000) /* 0.001068115 */,
- -PRESHIFT(0x0ca8d000) /* -0.791213989 */,
- PRESHIFT(0x119e9000) /* 1.101211548 */,
- PRESHIFT(0x05991000) /* 0.349868774 */,
- PRESHIFT(0x02578000) /* 0.146362305 */,
- PRESHIFT(0x0091a000) /* 0.035552979 */,
- PRESHIFT(0x007d1000) /* 0.030532837 */,
- PRESHIFT(0x00048000) /* 0.001098633 */,
- PRESHIFT(0x000a1000) /* 0.002456665 */,
- PRESHIFT(0x0000d000) /* 0.000198364 */,
-
- -PRESHIFT(0x00002000) /* -0.000030518 */,
- -PRESHIFT(0x0003a000) /* -0.000885010 */,
- PRESHIFT(0x000e0000) /* 0.003417969 */,
- -PRESHIFT(0x003df000) /* -0.015121460 */,
- PRESHIFT(0x00586000) /* 0.021575928 */,
- -PRESHIFT(0x01ee6000) /* -0.120697021 */,
- PRESHIFT(0x00046000) /* 0.001068115 */,
- -PRESHIFT(0x0ca8d000) /* -0.791213989 */,
- PRESHIFT(0x119e9000) /* 1.101211548 */,
- PRESHIFT(0x05991000) /* 0.349868774 */,
- PRESHIFT(0x02578000) /* 0.146362305 */,
- PRESHIFT(0x0091a000) /* 0.035552979 */,
- PRESHIFT(0x007d1000) /* 0.030532837 */,
- PRESHIFT(0x00048000) /* 0.001098633 */,
- PRESHIFT(0x000a1000) /* 0.002456665 */,
- PRESHIFT(0x0000d000) /* 0.000198364 */ },
-
- { -PRESHIFT(0x00002000) /* -0.000030518 */, /* 9 */
- -PRESHIFT(0x0003f000) /* -0.000961304 */,
- PRESHIFT(0x000dd000) /* 0.003372192 */,
- -PRESHIFT(0x00428000) /* -0.016235352 */,
- PRESHIFT(0x00500000) /* 0.019531250 */,
- -PRESHIFT(0x02011000) /* -0.125259399 */,
- -PRESHIFT(0x003e6000) /* -0.015228271 */,
- -PRESHIFT(0x0d11e000) /* -0.816864014 */,
- PRESHIFT(0x116fc000) /* 1.089782715 */,
- PRESHIFT(0x052c5000) /* 0.323318481 */,
- PRESHIFT(0x02616000) /* 0.148773193 */,
- PRESHIFT(0x007d6000) /* 0.030609131 */,
- PRESHIFT(0x007aa000) /* 0.029937744 */,
- PRESHIFT(0x00024000) /* 0.000549316 */,
- PRESHIFT(0x0009a000) /* 0.002349854 */,
- PRESHIFT(0x0000b000) /* 0.000167847 */,
-
- -PRESHIFT(0x00002000) /* -0.000030518 */,
- -PRESHIFT(0x0003f000) /* -0.000961304 */,
- PRESHIFT(0x000dd000) /* 0.003372192 */,
- -PRESHIFT(0x00428000) /* -0.016235352 */,
- PRESHIFT(0x00500000) /* 0.019531250 */,
- -PRESHIFT(0x02011000) /* -0.125259399 */,
- -PRESHIFT(0x003e6000) /* -0.015228271 */,
- -PRESHIFT(0x0d11e000) /* -0.816864014 */,
- PRESHIFT(0x116fc000) /* 1.089782715 */,
- PRESHIFT(0x052c5000) /* 0.323318481 */,
- PRESHIFT(0x02616000) /* 0.148773193 */,
- PRESHIFT(0x007d6000) /* 0.030609131 */,
- PRESHIFT(0x007aa000) /* 0.029937744 */,
- PRESHIFT(0x00024000) /* 0.000549316 */,
- PRESHIFT(0x0009a000) /* 0.002349854 */,
- PRESHIFT(0x0000b000) /* 0.000167847 */ },
-
- { -PRESHIFT(0x00002000) /* -0.000030518 */, /* 10 */
- -PRESHIFT(0x00044000) /* -0.001037598 */,
- PRESHIFT(0x000d7000) /* 0.003280640 */,
- -PRESHIFT(0x00471000) /* -0.017349243 */,
- PRESHIFT(0x0046b000) /* 0.017257690 */,
- -PRESHIFT(0x0212b000) /* -0.129562378 */,
- -PRESHIFT(0x0084a000) /* -0.032379150 */,
- -PRESHIFT(0x0d78a000) /* -0.841949463 */,
- PRESHIFT(0x113be000) /* 1.077117920 */,
- PRESHIFT(0x04c16000) /* 0.297210693 */,
- PRESHIFT(0x02687000) /* 0.150497437 */,
- PRESHIFT(0x0069c000) /* 0.025817871 */,
- PRESHIFT(0x0077f000) /* 0.029281616 */,
- PRESHIFT(0x00002000) /* 0.000030518 */,
- PRESHIFT(0x00093000) /* 0.002243042 */,
- PRESHIFT(0x0000a000) /* 0.000152588 */,
-
- -PRESHIFT(0x00002000) /* -0.000030518 */,
- -PRESHIFT(0x00044000) /* -0.001037598 */,
- PRESHIFT(0x000d7000) /* 0.003280640 */,
- -PRESHIFT(0x00471000) /* -0.017349243 */,
- PRESHIFT(0x0046b000) /* 0.017257690 */,
- -PRESHIFT(0x0212b000) /* -0.129562378 */,
- -PRESHIFT(0x0084a000) /* -0.032379150 */,
- -PRESHIFT(0x0d78a000) /* -0.841949463 */,
- PRESHIFT(0x113be000) /* 1.077117920 */,
- PRESHIFT(0x04c16000) /* 0.297210693 */,
- PRESHIFT(0x02687000) /* 0.150497437 */,
- PRESHIFT(0x0069c000) /* 0.025817871 */,
- PRESHIFT(0x0077f000) /* 0.029281616 */,
- PRESHIFT(0x00002000) /* 0.000030518 */,
- PRESHIFT(0x00093000) /* 0.002243042 */,
- PRESHIFT(0x0000a000) /* 0.000152588 */ },
-
- { -PRESHIFT(0x00003000) /* -0.000045776 */, /* 11 */
- -PRESHIFT(0x00049000) /* -0.001113892 */,
- PRESHIFT(0x000d0000) /* 0.003173828 */,
- -PRESHIFT(0x004ba000) /* -0.018463135 */,
- PRESHIFT(0x003ca000) /* 0.014801025 */,
- -PRESHIFT(0x02233000) /* -0.133590698 */,
- -PRESHIFT(0x00ce4000) /* -0.050354004 */,
- -PRESHIFT(0x0ddca000) /* -0.866363525 */,
- PRESHIFT(0x1102f000) /* 1.063217163 */,
- PRESHIFT(0x04587000) /* 0.271591187 */,
- PRESHIFT(0x026cf000) /* 0.151596069 */,
- PRESHIFT(0x0056c000) /* 0.021179199 */,
- PRESHIFT(0x0074e000) /* 0.028533936 */,
- -PRESHIFT(0x0001d000) /* -0.000442505 */,
- PRESHIFT(0x0008b000) /* 0.002120972 */,
- PRESHIFT(0x00009000) /* 0.000137329 */,
-
- -PRESHIFT(0x00003000) /* -0.000045776 */,
- -PRESHIFT(0x00049000) /* -0.001113892 */,
- PRESHIFT(0x000d0000) /* 0.003173828 */,
- -PRESHIFT(0x004ba000) /* -0.018463135 */,
- PRESHIFT(0x003ca000) /* 0.014801025 */,
- -PRESHIFT(0x02233000) /* -0.133590698 */,
- -PRESHIFT(0x00ce4000) /* -0.050354004 */,
- -PRESHIFT(0x0ddca000) /* -0.866363525 */,
- PRESHIFT(0x1102f000) /* 1.063217163 */,
- PRESHIFT(0x04587000) /* 0.271591187 */,
- PRESHIFT(0x026cf000) /* 0.151596069 */,
- PRESHIFT(0x0056c000) /* 0.021179199 */,
- PRESHIFT(0x0074e000) /* 0.028533936 */,
- -PRESHIFT(0x0001d000) /* -0.000442505 */,
- PRESHIFT(0x0008b000) /* 0.002120972 */,
- PRESHIFT(0x00009000) /* 0.000137329 */ },
-
- { -PRESHIFT(0x00003000) /* -0.000045776 */, /* 12 */
- -PRESHIFT(0x0004f000) /* -0.001205444 */,
- PRESHIFT(0x000c8000) /* 0.003051758 */,
- -PRESHIFT(0x00503000) /* -0.019577026 */,
- PRESHIFT(0x0031a000) /* 0.012115479 */,
- -PRESHIFT(0x02326000) /* -0.137298584 */,
- -PRESHIFT(0x011b5000) /* -0.069168091 */,
- -PRESHIFT(0x0e3dd000) /* -0.890090942 */,
- PRESHIFT(0x10c54000) /* 1.048156738 */,
- PRESHIFT(0x03f1b000) /* 0.246505737 */,
- PRESHIFT(0x026ee000) /* 0.152069092 */,
- PRESHIFT(0x00447000) /* 0.016708374 */,
- PRESHIFT(0x00719000) /* 0.027725220 */,
- -PRESHIFT(0x00039000) /* -0.000869751 */,
- PRESHIFT(0x00084000) /* 0.002014160 */,
- PRESHIFT(0x00008000) /* 0.000122070 */,
-
- -PRESHIFT(0x00003000) /* -0.000045776 */,
- -PRESHIFT(0x0004f000) /* -0.001205444 */,
- PRESHIFT(0x000c8000) /* 0.003051758 */,
- -PRESHIFT(0x00503000) /* -0.019577026 */,
- PRESHIFT(0x0031a000) /* 0.012115479 */,
- -PRESHIFT(0x02326000) /* -0.137298584 */,
- -PRESHIFT(0x011b5000) /* -0.069168091 */,
- -PRESHIFT(0x0e3dd000) /* -0.890090942 */,
- PRESHIFT(0x10c54000) /* 1.048156738 */,
- PRESHIFT(0x03f1b000) /* 0.246505737 */,
- PRESHIFT(0x026ee000) /* 0.152069092 */,
- PRESHIFT(0x00447000) /* 0.016708374 */,
- PRESHIFT(0x00719000) /* 0.027725220 */,
- -PRESHIFT(0x00039000) /* -0.000869751 */,
- PRESHIFT(0x00084000) /* 0.002014160 */,
- PRESHIFT(0x00008000) /* 0.000122070 */ },
-
- { -PRESHIFT(0x00004000) /* -0.000061035 */, /* 13 */
- -PRESHIFT(0x00055000) /* -0.001296997 */,
- PRESHIFT(0x000bd000) /* 0.002883911 */,
- -PRESHIFT(0x0054c000) /* -0.020690918 */,
- PRESHIFT(0x0025d000) /* 0.009231567 */,
- -PRESHIFT(0x02403000) /* -0.140670776 */,
- -PRESHIFT(0x016ba000) /* -0.088775635 */,
- -PRESHIFT(0x0e9be000) /* -0.913055420 */,
- PRESHIFT(0x1082d000) /* 1.031936646 */,
- PRESHIFT(0x038d4000) /* 0.221984863 */,
- PRESHIFT(0x026e7000) /* 0.151962280 */,
- PRESHIFT(0x0032e000) /* 0.012420654 */,
- PRESHIFT(0x006df000) /* 0.026840210 */,
- -PRESHIFT(0x00053000) /* -0.001266479 */,
- PRESHIFT(0x0007d000) /* 0.001907349 */,
- PRESHIFT(0x00007000) /* 0.000106812 */,
-
- -PRESHIFT(0x00004000) /* -0.000061035 */,
- -PRESHIFT(0x00055000) /* -0.001296997 */,
- PRESHIFT(0x000bd000) /* 0.002883911 */,
- -PRESHIFT(0x0054c000) /* -0.020690918 */,
- PRESHIFT(0x0025d000) /* 0.009231567 */,
- -PRESHIFT(0x02403000) /* -0.140670776 */,
- -PRESHIFT(0x016ba000) /* -0.088775635 */,
- -PRESHIFT(0x0e9be000) /* -0.913055420 */,
- PRESHIFT(0x1082d000) /* 1.031936646 */,
- PRESHIFT(0x038d4000) /* 0.221984863 */,
- PRESHIFT(0x026e7000) /* 0.151962280 */,
- PRESHIFT(0x0032e000) /* 0.012420654 */,
- PRESHIFT(0x006df000) /* 0.026840210 */,
- -PRESHIFT(0x00053000) /* -0.001266479 */,
- PRESHIFT(0x0007d000) /* 0.001907349 */,
- PRESHIFT(0x00007000) /* 0.000106812 */ },
-
- { -PRESHIFT(0x00004000) /* -0.000061035 */, /* 14 */
- -PRESHIFT(0x0005b000) /* -0.001388550 */,
- PRESHIFT(0x000b1000) /* 0.002700806 */,
- -PRESHIFT(0x00594000) /* -0.021789551 */,
- PRESHIFT(0x00192000) /* 0.006134033 */,
- -PRESHIFT(0x024c8000) /* -0.143676758 */,
- -PRESHIFT(0x01bf2000) /* -0.109161377 */,
- -PRESHIFT(0x0ef69000) /* -0.935195923 */,
- PRESHIFT(0x103be000) /* 1.014617920 */,
- PRESHIFT(0x032b4000) /* 0.198059082 */,
- PRESHIFT(0x026bc000) /* 0.151306152 */,
- PRESHIFT(0x00221000) /* 0.008316040 */,
- PRESHIFT(0x006a2000) /* 0.025909424 */,
- -PRESHIFT(0x0006a000) /* -0.001617432 */,
- PRESHIFT(0x00075000) /* 0.001785278 */,
- PRESHIFT(0x00007000) /* 0.000106812 */,
-
- -PRESHIFT(0x00004000) /* -0.000061035 */,
- -PRESHIFT(0x0005b000) /* -0.001388550 */,
- PRESHIFT(0x000b1000) /* 0.002700806 */,
- -PRESHIFT(0x00594000) /* -0.021789551 */,
- PRESHIFT(0x00192000) /* 0.006134033 */,
- -PRESHIFT(0x024c8000) /* -0.143676758 */,
- -PRESHIFT(0x01bf2000) /* -0.109161377 */,
- -PRESHIFT(0x0ef69000) /* -0.935195923 */,
- PRESHIFT(0x103be000) /* 1.014617920 */,
- PRESHIFT(0x032b4000) /* 0.198059082 */,
- PRESHIFT(0x026bc000) /* 0.151306152 */,
- PRESHIFT(0x00221000) /* 0.008316040 */,
- PRESHIFT(0x006a2000) /* 0.025909424 */,
- -PRESHIFT(0x0006a000) /* -0.001617432 */,
- PRESHIFT(0x00075000) /* 0.001785278 */,
- PRESHIFT(0x00007000) /* 0.000106812 */ },
-
- { -PRESHIFT(0x00005000) /* -0.000076294 */, /* 15 */
- -PRESHIFT(0x00061000) /* -0.001480103 */,
- PRESHIFT(0x000a3000) /* 0.002487183 */,
- -PRESHIFT(0x005da000) /* -0.022857666 */,
- PRESHIFT(0x000b9000) /* 0.002822876 */,
- -PRESHIFT(0x02571000) /* -0.146255493 */,
- -PRESHIFT(0x0215c000) /* -0.130310059 */,
- -PRESHIFT(0x0f4dc000) /* -0.956481934 */,
- PRESHIFT(0x0ff0a000) /* 0.996246338 */,
- PRESHIFT(0x02cbf000) /* 0.174789429 */,
- PRESHIFT(0x0266e000) /* 0.150115967 */,
- PRESHIFT(0x00120000) /* 0.004394531 */,
- PRESHIFT(0x00662000) /* 0.024932861 */,
- -PRESHIFT(0x0007f000) /* -0.001937866 */,
- PRESHIFT(0x0006f000) /* 0.001693726 */,
- PRESHIFT(0x00006000) /* 0.000091553 */,
-
- -PRESHIFT(0x00005000) /* -0.000076294 */,
- -PRESHIFT(0x00061000) /* -0.001480103 */,
- PRESHIFT(0x000a3000) /* 0.002487183 */,
- -PRESHIFT(0x005da000) /* -0.022857666 */,
- PRESHIFT(0x000b9000) /* 0.002822876 */,
- -PRESHIFT(0x02571000) /* -0.146255493 */,
- -PRESHIFT(0x0215c000) /* -0.130310059 */,
- -PRESHIFT(0x0f4dc000) /* -0.956481934 */,
- PRESHIFT(0x0ff0a000) /* 0.996246338 */,
- PRESHIFT(0x02cbf000) /* 0.174789429 */,
- PRESHIFT(0x0266e000) /* 0.150115967 */,
- PRESHIFT(0x00120000) /* 0.004394531 */,
- PRESHIFT(0x00662000) /* 0.024932861 */,
- -PRESHIFT(0x0007f000) /* -0.001937866 */,
- PRESHIFT(0x0006f000) /* 0.001693726 */,
- PRESHIFT(0x00006000) /* 0.000091553 */ },
-
- { -PRESHIFT(0x00005000) /* -0.000076294 */, /* 16 */
- -PRESHIFT(0x00068000) /* -0.001586914 */,
- PRESHIFT(0x00092000) /* 0.002227783 */,
- -PRESHIFT(0x0061f000) /* -0.023910522 */,
- -PRESHIFT(0x0002d000) /* -0.000686646 */,
- -PRESHIFT(0x025ff000) /* -0.148422241 */,
- -PRESHIFT(0x026f7000) /* -0.152206421 */,
- -PRESHIFT(0x0fa13000) /* -0.976852417 */,
- PRESHIFT(0x0fa13000) /* 0.976852417 */,
- PRESHIFT(0x026f7000) /* 0.152206421 */,
- PRESHIFT(0x025ff000) /* 0.148422241 */,
- PRESHIFT(0x0002d000) /* 0.000686646 */,
- PRESHIFT(0x0061f000) /* 0.023910522 */,
- -PRESHIFT(0x00092000) /* -0.002227783 */,
- PRESHIFT(0x00068000) /* 0.001586914 */,
- PRESHIFT(0x00005000) /* 0.000076294 */,
-
- -PRESHIFT(0x00005000) /* -0.000076294 */,
- -PRESHIFT(0x00068000) /* -0.001586914 */,
- PRESHIFT(0x00092000) /* 0.002227783 */,
- -PRESHIFT(0x0061f000) /* -0.023910522 */,
- -PRESHIFT(0x0002d000) /* -0.000686646 */,
- -PRESHIFT(0x025ff000) /* -0.148422241 */,
- -PRESHIFT(0x026f7000) /* -0.152206421 */,
- -PRESHIFT(0x0fa13000) /* -0.976852417 */,
- PRESHIFT(0x0fa13000) /* 0.976852417 */,
- PRESHIFT(0x026f7000) /* 0.152206421 */,
- PRESHIFT(0x025ff000) /* 0.148422241 */,
- PRESHIFT(0x0002d000) /* 0.000686646 */,
- PRESHIFT(0x0061f000) /* 0.023910522 */,
- -PRESHIFT(0x00092000) /* -0.002227783 */,
- PRESHIFT(0x00068000) /* 0.001586914 */,
- PRESHIFT(0x00005000) /* 0.000076294 */ }
diff --git a/src/libmad/Makefile.am b/src/libmad/Makefile.am
deleted file mode 100644
index c879645c5..000000000
--- a/src/libmad/Makefile.am
+++ /dev/null
@@ -1,57 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-AM_CFLAGS = -DOPT_SPEED
-
-EXTRA_DIST = imdct_l_arm.S
-
-if MAD
-mad_module = xineplug_decode_mad.la
-endif
-
-xineplug_LTLIBRARIES = $(mad_module)
-
-if EXTERNAL_LIBMAD
-internal_sources =
-else
-internal_sources = \
- bit.c \
- fixed.c \
- frame.c \
- huffman.c \
- layer12.c \
- layer3.c \
- stream.c \
- synth.c \
- timer.c \
- version.c
-endif
-
-xineplug_decode_mad_la_SOURCES = \
- xine_mad_decoder.c \
- $(internal_sources)
-
-if EXTERNAL_LIBMAD
-xineplug_decode_mad_la_LIBADD = $(XINE_LIB) $(LIBMAD_LIBS)
-else
-xineplug_decode_mad_la_LIBADD = $(XINE_LIB)
-endif
-xineplug_decode_mad_la_CFLAGS = $(LIBMAD_CFLAGS) $(VISIBILITY_FLAG)
-xineplug_decode_mad_la_LDFLAGS = $(xineplug_ldflags)
-
-noinst_HEADERS = \
- D.dat \
- imdct_s.dat \
- qc_table.dat \
- rq_table.dat \
- sf_table.dat \
- bit.h \
- fixed.h \
- frame.h \
- global.h \
- huffman.h \
- layer12.h \
- layer3.h \
- stream.h \
- synth.h \
- timer.h \
- version.h
diff --git a/src/libmad/bit.c b/src/libmad/bit.c
deleted file mode 100644
index 8d9571e8f..000000000
--- a/src/libmad/bit.c
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * libmad - MPEG audio decoder library
- * Copyright (C) 2000-2004 Underbit Technologies, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * $Id: bit.c,v 1.3 2004/04/22 00:22:35 miguelfreitas Exp $
- */
-
-# ifdef HAVE_CONFIG_H
-# include "config.h"
-# endif
-
-# include "global.h"
-
-# ifdef HAVE_LIMITS_H
-# include <limits.h>
-# else
-# define CHAR_BIT 8
-# endif
-
-# include "bit.h"
-
-/*
- * This is the lookup table for computing the CRC-check word.
- * As described in section 2.4.3.1 and depicted in Figure A.9
- * of ISO/IEC 11172-3, the generator polynomial is:
- *
- * G(X) = X^16 + X^15 + X^2 + 1
- */
-static
-unsigned short const crc_table[256] = {
- 0x0000, 0x8005, 0x800f, 0x000a, 0x801b, 0x001e, 0x0014, 0x8011,
- 0x8033, 0x0036, 0x003c, 0x8039, 0x0028, 0x802d, 0x8027, 0x0022,
- 0x8063, 0x0066, 0x006c, 0x8069, 0x0078, 0x807d, 0x8077, 0x0072,
- 0x0050, 0x8055, 0x805f, 0x005a, 0x804b, 0x004e, 0x0044, 0x8041,
- 0x80c3, 0x00c6, 0x00cc, 0x80c9, 0x00d8, 0x80dd, 0x80d7, 0x00d2,
- 0x00f0, 0x80f5, 0x80ff, 0x00fa, 0x80eb, 0x00ee, 0x00e4, 0x80e1,
- 0x00a0, 0x80a5, 0x80af, 0x00aa, 0x80bb, 0x00be, 0x00b4, 0x80b1,
- 0x8093, 0x0096, 0x009c, 0x8099, 0x0088, 0x808d, 0x8087, 0x0082,
-
- 0x8183, 0x0186, 0x018c, 0x8189, 0x0198, 0x819d, 0x8197, 0x0192,
- 0x01b0, 0x81b5, 0x81bf, 0x01ba, 0x81ab, 0x01ae, 0x01a4, 0x81a1,
- 0x01e0, 0x81e5, 0x81ef, 0x01ea, 0x81fb, 0x01fe, 0x01f4, 0x81f1,
- 0x81d3, 0x01d6, 0x01dc, 0x81d9, 0x01c8, 0x81cd, 0x81c7, 0x01c2,
- 0x0140, 0x8145, 0x814f, 0x014a, 0x815b, 0x015e, 0x0154, 0x8151,
- 0x8173, 0x0176, 0x017c, 0x8179, 0x0168, 0x816d, 0x8167, 0x0162,
- 0x8123, 0x0126, 0x012c, 0x8129, 0x0138, 0x813d, 0x8137, 0x0132,
- 0x0110, 0x8115, 0x811f, 0x011a, 0x810b, 0x010e, 0x0104, 0x8101,
-
- 0x8303, 0x0306, 0x030c, 0x8309, 0x0318, 0x831d, 0x8317, 0x0312,
- 0x0330, 0x8335, 0x833f, 0x033a, 0x832b, 0x032e, 0x0324, 0x8321,
- 0x0360, 0x8365, 0x836f, 0x036a, 0x837b, 0x037e, 0x0374, 0x8371,
- 0x8353, 0x0356, 0x035c, 0x8359, 0x0348, 0x834d, 0x8347, 0x0342,
- 0x03c0, 0x83c5, 0x83cf, 0x03ca, 0x83db, 0x03de, 0x03d4, 0x83d1,
- 0x83f3, 0x03f6, 0x03fc, 0x83f9, 0x03e8, 0x83ed, 0x83e7, 0x03e2,
- 0x83a3, 0x03a6, 0x03ac, 0x83a9, 0x03b8, 0x83bd, 0x83b7, 0x03b2,
- 0x0390, 0x8395, 0x839f, 0x039a, 0x838b, 0x038e, 0x0384, 0x8381,
-
- 0x0280, 0x8285, 0x828f, 0x028a, 0x829b, 0x029e, 0x0294, 0x8291,
- 0x82b3, 0x02b6, 0x02bc, 0x82b9, 0x02a8, 0x82ad, 0x82a7, 0x02a2,
- 0x82e3, 0x02e6, 0x02ec, 0x82e9, 0x02f8, 0x82fd, 0x82f7, 0x02f2,
- 0x02d0, 0x82d5, 0x82df, 0x02da, 0x82cb, 0x02ce, 0x02c4, 0x82c1,
- 0x8243, 0x0246, 0x024c, 0x8249, 0x0258, 0x825d, 0x8257, 0x0252,
- 0x0270, 0x8275, 0x827f, 0x027a, 0x826b, 0x026e, 0x0264, 0x8261,
- 0x0220, 0x8225, 0x822f, 0x022a, 0x823b, 0x023e, 0x0234, 0x8231,
- 0x8213, 0x0216, 0x021c, 0x8219, 0x0208, 0x820d, 0x8207, 0x0202
-};
-
-# define CRC_POLY 0x8005
-
-/*
- * NAME: bit->init()
- * DESCRIPTION: initialize bit pointer struct
- */
-void mad_bit_init(struct mad_bitptr *bitptr, unsigned char const *byte)
-{
- bitptr->byte = byte;
- bitptr->cache = 0;
- bitptr->left = CHAR_BIT;
-}
-
-/*
- * NAME: bit->length()
- * DESCRIPTION: return number of bits between start and end points
- */
-unsigned int mad_bit_length(struct mad_bitptr const *begin,
- struct mad_bitptr const *end)
-{
- return begin->left +
- CHAR_BIT * (end->byte - (begin->byte + 1)) + (CHAR_BIT - end->left);
-}
-
-/*
- * NAME: bit->nextbyte()
- * DESCRIPTION: return pointer to next unprocessed byte
- */
-unsigned char const *mad_bit_nextbyte(struct mad_bitptr const *bitptr)
-{
- return bitptr->left == CHAR_BIT ? bitptr->byte : bitptr->byte + 1;
-}
-
-/*
- * NAME: bit->skip()
- * DESCRIPTION: advance bit pointer
- */
-void mad_bit_skip(struct mad_bitptr *bitptr, unsigned int len)
-{
- bitptr->byte += len / CHAR_BIT;
- bitptr->left -= len % CHAR_BIT;
-
- if (bitptr->left > CHAR_BIT) {
- bitptr->byte++;
- bitptr->left += CHAR_BIT;
- }
-
- if (bitptr->left < CHAR_BIT)
- bitptr->cache = *bitptr->byte;
-}
-
-/*
- * NAME: bit->read()
- * DESCRIPTION: read an arbitrary number of bits and return their UIMSBF value
- */
-unsigned long mad_bit_read(struct mad_bitptr *bitptr, unsigned int len)
-{
- register unsigned long value;
-
- if (bitptr->left == CHAR_BIT)
- bitptr->cache = *bitptr->byte;
-
- if (len < bitptr->left) {
- value = (bitptr->cache & ((1 << bitptr->left) - 1)) >>
- (bitptr->left - len);
- bitptr->left -= len;
-
- return value;
- }
-
- /* remaining bits in current byte */
-
- value = bitptr->cache & ((1 << bitptr->left) - 1);
- len -= bitptr->left;
-
- bitptr->byte++;
- bitptr->left = CHAR_BIT;
-
- /* more bytes */
-
- while (len >= CHAR_BIT) {
- value = (value << CHAR_BIT) | *bitptr->byte++;
- len -= CHAR_BIT;
- }
-
- if (len > 0) {
- bitptr->cache = *bitptr->byte;
-
- value = (value << len) | (bitptr->cache >> (CHAR_BIT - len));
- bitptr->left -= len;
- }
-
- return value;
-}
-
-# if 0
-/*
- * NAME: bit->write()
- * DESCRIPTION: write an arbitrary number of bits
- */
-void mad_bit_write(struct mad_bitptr *bitptr, unsigned int len,
- unsigned long value)
-{
- unsigned char *ptr;
-
- ptr = (unsigned char *) bitptr->byte;
-
- /* ... */
-}
-# endif
-
-/*
- * NAME: bit->crc()
- * DESCRIPTION: compute CRC-check word
- */
-unsigned short mad_bit_crc(struct mad_bitptr bitptr, unsigned int len,
- unsigned short init)
-{
- register unsigned int crc;
-
- for (crc = init; len >= 32; len -= 32) {
- register unsigned long data;
-
- data = mad_bit_read(&bitptr, 32);
-
- crc = (crc << 8) ^ crc_table[((crc >> 8) ^ (data >> 24)) & 0xff];
- crc = (crc << 8) ^ crc_table[((crc >> 8) ^ (data >> 16)) & 0xff];
- crc = (crc << 8) ^ crc_table[((crc >> 8) ^ (data >> 8)) & 0xff];
- crc = (crc << 8) ^ crc_table[((crc >> 8) ^ (data >> 0)) & 0xff];
- }
-
- switch (len / 8) {
- case 3: crc = (crc << 8) ^
- crc_table[((crc >> 8) ^ mad_bit_read(&bitptr, 8)) & 0xff];
- case 2: crc = (crc << 8) ^
- crc_table[((crc >> 8) ^ mad_bit_read(&bitptr, 8)) & 0xff];
- case 1: crc = (crc << 8) ^
- crc_table[((crc >> 8) ^ mad_bit_read(&bitptr, 8)) & 0xff];
-
- len %= 8;
-
- case 0: break;
- }
-
- while (len--) {
- register unsigned int msb;
-
- msb = mad_bit_read(&bitptr, 1) ^ (crc >> 15);
-
- crc <<= 1;
- if (msb & 1)
- crc ^= CRC_POLY;
- }
-
- return crc & 0xffff;
-}
diff --git a/src/libmad/bit.h b/src/libmad/bit.h
deleted file mode 100644
index 6c09d5493..000000000
--- a/src/libmad/bit.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * libmad - MPEG audio decoder library
- * Copyright (C) 2000-2004 Underbit Technologies, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * $Id: bit.h,v 1.3 2004/04/22 00:22:36 miguelfreitas Exp $
- */
-
-# ifndef LIBMAD_BIT_H
-# define LIBMAD_BIT_H
-
-struct mad_bitptr {
- unsigned char const *byte;
- unsigned short cache;
- unsigned short left;
-};
-
-void mad_bit_init(struct mad_bitptr *, unsigned char const *);
-
-# define mad_bit_finish(bitptr) /* nothing */
-
-unsigned int mad_bit_length(struct mad_bitptr const *,
- struct mad_bitptr const *);
-
-# define mad_bit_bitsleft(bitptr) ((bitptr)->left)
-unsigned char const *mad_bit_nextbyte(struct mad_bitptr const *);
-
-void mad_bit_skip(struct mad_bitptr *, unsigned int);
-unsigned long mad_bit_read(struct mad_bitptr *, unsigned int);
-void mad_bit_write(struct mad_bitptr *, unsigned int, unsigned long);
-
-unsigned short mad_bit_crc(struct mad_bitptr, unsigned int, unsigned short);
-
-# endif
diff --git a/src/libmad/fixed.c b/src/libmad/fixed.c
deleted file mode 100644
index ae02360ca..000000000
--- a/src/libmad/fixed.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * libmad - MPEG audio decoder library
- * Copyright (C) 2000-2004 Underbit Technologies, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * $Id: fixed.c,v 1.3 2004/04/22 00:22:36 miguelfreitas Exp $
- */
-
-# ifdef HAVE_CONFIG_H
-# include "config.h"
-# endif
-
-# include "global.h"
-
-# include "fixed.h"
-
-/*
- * NAME: fixed->abs()
- * DESCRIPTION: return absolute value of a fixed-point number
- */
-mad_fixed_t mad_f_abs(mad_fixed_t x)
-{
- return x < 0 ? -x : x;
-}
-
-/*
- * NAME: fixed->div()
- * DESCRIPTION: perform division using fixed-point math
- */
-mad_fixed_t mad_f_div(mad_fixed_t x, mad_fixed_t y)
-{
- mad_fixed_t q, r;
- unsigned int bits;
-
- q = mad_f_abs(x / y);
-
- if (x < 0) {
- x = -x;
- y = -y;
- }
-
- r = x % y;
-
- if (y < 0) {
- x = -x;
- y = -y;
- }
-
- if (q > mad_f_intpart(MAD_F_MAX) &&
- !(q == -mad_f_intpart(MAD_F_MIN) && r == 0 && (x < 0) != (y < 0)))
- return 0;
-
- for (bits = MAD_F_FRACBITS; bits && r; --bits) {
- q <<= 1, r <<= 1;
- if (r >= y)
- r -= y, ++q;
- }
-
- /* round */
- if (2 * r >= y)
- ++q;
-
- /* fix sign */
- if ((x < 0) != (y < 0))
- q = -q;
-
- return q << bits;
-}
diff --git a/src/libmad/fixed.h b/src/libmad/fixed.h
deleted file mode 100644
index 658b3399e..000000000
--- a/src/libmad/fixed.h
+++ /dev/null
@@ -1,499 +0,0 @@
-/*
- * libmad - MPEG audio decoder library
- * Copyright (C) 2000-2004 Underbit Technologies, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * $Id: fixed.h,v 1.3 2004/04/28 19:57:40 mroi Exp $
- */
-
-# ifndef LIBMAD_FIXED_H
-# define LIBMAD_FIXED_H
-
-# if SIZEOF_INT >= 4
-typedef signed int mad_fixed_t;
-
-typedef signed int mad_fixed64hi_t;
-typedef unsigned int mad_fixed64lo_t;
-# else
-typedef signed long mad_fixed_t;
-
-typedef signed long mad_fixed64hi_t;
-typedef unsigned long mad_fixed64lo_t;
-# endif
-
-# if defined(_MSC_VER)
-# define mad_fixed64_t signed __int64
-# elif 1 || defined(__GNUC__)
-# define mad_fixed64_t signed long long
-# endif
-
-# if defined(FPM_FLOAT)
-typedef double mad_sample_t;
-# else
-typedef mad_fixed_t mad_sample_t;
-# endif
-
-/*
- * Fixed-point format: 0xABBBBBBB
- * A == whole part (sign + 3 bits)
- * B == fractional part (28 bits)
- *
- * Values are signed two's complement, so the effective range is:
- * 0x80000000 to 0x7fffffff
- * -8.0 to +7.9999999962747097015380859375
- *
- * The smallest representable value is:
- * 0x00000001 == 0.0000000037252902984619140625 (i.e. about 3.725e-9)
- *
- * 28 bits of fractional accuracy represent about
- * 8.6 digits of decimal accuracy.
- *
- * Fixed-point numbers can be added or subtracted as normal
- * integers, but multiplication requires shifting the 64-bit result
- * from 56 fractional bits back to 28 (and rounding.)
- *
- * Changing the definition of MAD_F_FRACBITS is only partially
- * supported, and must be done with care.
- */
-
-# define MAD_F_FRACBITS 28
-
-# if MAD_F_FRACBITS == 28
-# define MAD_F(x) ((mad_fixed_t) (x##L))
-# else
-# if MAD_F_FRACBITS < 28
-# warning "MAD_F_FRACBITS < 28"
-# define MAD_F(x) ((mad_fixed_t) \
- (((x##L) + \
- (1L << (28 - MAD_F_FRACBITS - 1))) >> \
- (28 - MAD_F_FRACBITS)))
-# elif MAD_F_FRACBITS > 28
-# error "MAD_F_FRACBITS > 28 not currently supported"
-# define MAD_F(x) ((mad_fixed_t) \
- ((x##L) << (MAD_F_FRACBITS - 28)))
-# endif
-# endif
-
-# define MAD_F_MIN ((mad_fixed_t) -0x80000000L)
-# define MAD_F_MAX ((mad_fixed_t) +0x7fffffffL)
-
-# define MAD_F_ONE MAD_F(0x10000000)
-
-# define mad_f_tofixed(x) ((mad_fixed_t) \
- ((x) * (double) (1L << MAD_F_FRACBITS) + 0.5))
-# define mad_f_todouble(x) ((double) \
- ((x) / (double) (1L << MAD_F_FRACBITS)))
-
-# define mad_f_intpart(x) ((x) >> MAD_F_FRACBITS)
-# define mad_f_fracpart(x) ((x) & ((1L << MAD_F_FRACBITS) - 1))
- /* (x should be positive) */
-
-# define mad_f_fromint(x) ((x) << MAD_F_FRACBITS)
-
-# define mad_f_add(x, y) ((x) + (y))
-# define mad_f_sub(x, y) ((x) - (y))
-
-# if defined(FPM_FLOAT)
-# error "FPM_FLOAT not yet supported"
-
-# undef MAD_F
-# define MAD_F(x) mad_f_todouble(x)
-
-# define mad_f_mul(x, y) ((x) * (y))
-# define mad_f_scale64
-
-# undef ASO_ZEROCHECK
-
-# elif defined(FPM_64BIT)
-
-/*
- * This version should be the most accurate if 64-bit types are supported by
- * the compiler, although it may not be the most efficient.
- */
-# if defined(OPT_ACCURACY)
-# define mad_f_mul(x, y) \
- ((mad_fixed_t) \
- ((((mad_fixed64_t) (x) * (y)) + \
- (1L << (MAD_F_SCALEBITS - 1))) >> MAD_F_SCALEBITS))
-# else
-# define mad_f_mul(x, y) \
- ((mad_fixed_t) (((mad_fixed64_t) (x) * (y)) >> MAD_F_SCALEBITS))
-# endif
-
-# define MAD_F_SCALEBITS MAD_F_FRACBITS
-
-/* --- Intel --------------------------------------------------------------- */
-
-# elif defined(FPM_INTEL)
-
-# if defined(_MSC_VER)
-# pragma warning(push)
-# pragma warning(disable: 4035) /* no return value */
-static __forceinline
-mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
-{
- enum {
- fracbits = MAD_F_FRACBITS
- };
-
- __asm {
- mov eax, x
- imul y
- shrd eax, edx, fracbits
- }
-
- /* implicit return of eax */
-}
-# pragma warning(pop)
-
-# define mad_f_mul mad_f_mul_inline
-# define mad_f_scale64
-# else
-/*
- * This Intel version is fast and accurate; the disposition of the least
- * significant bit depends on OPT_ACCURACY via mad_f_scale64().
- */
-# define MAD_F_MLX(hi, lo, x, y) \
- asm ("imull %3" \
- : "=a" (lo), "=d" (hi) \
- : "%a" (x), "rm" (y) \
- : "cc")
-
-# if defined(OPT_ACCURACY)
-/*
- * This gives best accuracy but is not very fast.
- */
-# define MAD_F_MLA(hi, lo, x, y) \
- ({ mad_fixed64hi_t __hi; \
- mad_fixed64lo_t __lo; \
- MAD_F_MLX(__hi, __lo, (x), (y)); \
- asm ("addl %2,%0\n\t" \
- "adcl %3,%1" \
- : "=rm" (lo), "=rm" (hi) \
- : "r" (__lo), "r" (__hi), "0" (lo), "1" (hi) \
- : "cc"); \
- })
-# endif /* OPT_ACCURACY */
-
-# if defined(OPT_ACCURACY)
-/*
- * Surprisingly, this is faster than SHRD followed by ADC.
- */
-# define mad_f_scale64(hi, lo) \
- ({ mad_fixed64hi_t __hi_; \
- mad_fixed64lo_t __lo_; \
- mad_fixed_t __result; \
- asm ("addl %4,%2\n\t" \
- "adcl %5,%3" \
- : "=rm" (__lo_), "=rm" (__hi_) \
- : "0" (lo), "1" (hi), \
- "ir" (1L << (MAD_F_SCALEBITS - 1)), "ir" (0) \
- : "cc"); \
- asm ("shrdl %3,%2,%1" \
- : "=rm" (__result) \
- : "0" (__lo_), "r" (__hi_), "I" (MAD_F_SCALEBITS) \
- : "cc"); \
- __result; \
- })
-# elif defined(OPT_INTEL)
-/*
- * Alternate Intel scaling that may or may not perform better.
- */
-# define mad_f_scale64(hi, lo) \
- ({ mad_fixed_t __result; \
- asm ("shrl %3,%1\n\t" \
- "shll %4,%2\n\t" \
- "orl %2,%1" \
- : "=rm" (__result) \
- : "0" (lo), "r" (hi), \
- "I" (MAD_F_SCALEBITS), "I" (32 - MAD_F_SCALEBITS) \
- : "cc"); \
- __result; \
- })
-# else
-# define mad_f_scale64(hi, lo) \
- ({ mad_fixed_t __result; \
- asm ("shrdl %3,%2,%1" \
- : "=rm" (__result) \
- : "0" (lo), "r" (hi), "I" (MAD_F_SCALEBITS) \
- : "cc"); \
- __result; \
- })
-# endif /* OPT_ACCURACY */
-
-# define MAD_F_SCALEBITS MAD_F_FRACBITS
-# endif
-
-/* --- ARM ----------------------------------------------------------------- */
-
-# elif defined(FPM_ARM)
-
-/*
- * This ARM V4 version is as accurate as FPM_64BIT but much faster. The
- * least significant bit is properly rounded at no CPU cycle cost!
- */
-# if 1
-/*
- * This is faster than the default implementation via MAD_F_MLX() and
- * mad_f_scale64().
- */
-# define mad_f_mul(x, y) \
- ({ mad_fixed64hi_t __hi; \
- mad_fixed64lo_t __lo; \
- mad_fixed_t __result; \
- asm ("smull %0, %1, %3, %4\n\t" \
- "movs %0, %0, lsr %5\n\t" \
- "adc %2, %0, %1, lsl %6" \
- : "=&r" (__lo), "=&r" (__hi), "=r" (__result) \
- : "%r" (x), "r" (y), \
- "M" (MAD_F_SCALEBITS), "M" (32 - MAD_F_SCALEBITS) \
- : "cc"); \
- __result; \
- })
-# endif
-
-# define MAD_F_MLX(hi, lo, x, y) \
- asm ("smull %0, %1, %2, %3" \
- : "=&r" (lo), "=&r" (hi) \
- : "%r" (x), "r" (y))
-
-# define MAD_F_MLA(hi, lo, x, y) \
- asm ("smlal %0, %1, %2, %3" \
- : "+r" (lo), "+r" (hi) \
- : "%r" (x), "r" (y))
-
-# define MAD_F_MLN(hi, lo) \
- asm ("rsbs %0, %2, #0\n\t" \
- "rsc %1, %3, #0" \
- : "=r" (lo), "=r" (hi) \
- : "0" (lo), "1" (hi) \
- : "cc")
-
-# define mad_f_scale64(hi, lo) \
- ({ mad_fixed_t __result; \
- asm ("movs %0, %1, lsr %3\n\t" \
- "adc %0, %0, %2, lsl %4" \
- : "=&r" (__result) \
- : "r" (lo), "r" (hi), \
- "M" (MAD_F_SCALEBITS), "M" (32 - MAD_F_SCALEBITS) \
- : "cc"); \
- __result; \
- })
-
-# define MAD_F_SCALEBITS MAD_F_FRACBITS
-
-/* --- MIPS ---------------------------------------------------------------- */
-
-# elif defined(FPM_MIPS)
-
-/*
- * This MIPS version is fast and accurate; the disposition of the least
- * significant bit depends on OPT_ACCURACY via mad_f_scale64().
- */
-# define MAD_F_MLX(hi, lo, x, y) \
- asm ("mult %2,%3" \
- : "=l" (lo), "=h" (hi) \
- : "%r" (x), "r" (y))
-
-# if defined(HAVE_MADD_ASM)
-# define MAD_F_MLA(hi, lo, x, y) \
- asm ("madd %2,%3" \
- : "+l" (lo), "+h" (hi) \
- : "%r" (x), "r" (y))
-# elif defined(HAVE_MADD16_ASM)
-/*
- * This loses significant accuracy due to the 16-bit integer limit in the
- * multiply/accumulate instruction.
- */
-# define MAD_F_ML0(hi, lo, x, y) \
- asm ("mult %2,%3" \
- : "=l" (lo), "=h" (hi) \
- : "%r" ((x) >> 12), "r" ((y) >> 16))
-# define MAD_F_MLA(hi, lo, x, y) \
- asm ("madd16 %2,%3" \
- : "+l" (lo), "+h" (hi) \
- : "%r" ((x) >> 12), "r" ((y) >> 16))
-# define MAD_F_MLZ(hi, lo) ((mad_fixed_t) (lo))
-# endif
-
-# if defined(OPT_SPEED)
-# define mad_f_scale64(hi, lo) \
- ((mad_fixed_t) ((hi) << (32 - MAD_F_SCALEBITS)))
-# define MAD_F_SCALEBITS MAD_F_FRACBITS
-# endif
-
-/* --- SPARC --------------------------------------------------------------- */
-
-# elif defined(FPM_SPARC)
-
-/*
- * This SPARC V8 version is fast and accurate; the disposition of the least
- * significant bit depends on OPT_ACCURACY via mad_f_scale64().
- */
-# define MAD_F_MLX(hi, lo, x, y) \
- asm ("smul %2, %3, %0\n\t" \
- "rd %%y, %1" \
- : "=r" (lo), "=r" (hi) \
- : "%r" (x), "rI" (y))
-
-/* --- PowerPC ------------------------------------------------------------- */
-
-# elif defined(FPM_PPC)
-
-/*
- * This PowerPC version is fast and accurate; the disposition of the least
- * significant bit depends on OPT_ACCURACY via mad_f_scale64().
- */
-# define MAD_F_MLX(hi, lo, x, y) \
- do { \
- asm ("mullw %0,%1,%2" \
- : "=r" (lo) \
- : "%r" (x), "r" (y)); \
- asm ("mulhw %0,%1,%2" \
- : "=r" (hi) \
- : "%r" (x), "r" (y)); \
- } \
- while (0)
-
-# if defined(OPT_ACCURACY)
-/*
- * This gives best accuracy but is not very fast.
- */
-# define MAD_F_MLA(hi, lo, x, y) \
- ({ mad_fixed64hi_t __hi; \
- mad_fixed64lo_t __lo; \
- MAD_F_MLX(__hi, __lo, (x), (y)); \
- asm ("addc %0,%2,%3\n\t" \
- "adde %1,%4,%5" \
- : "=r" (lo), "=r" (hi) \
- : "%r" (lo), "r" (__lo), \
- "%r" (hi), "r" (__hi) \
- : "xer"); \
- })
-# endif
-
-# if defined(OPT_ACCURACY)
-/*
- * This is slower than the truncating version below it.
- */
-# define mad_f_scale64(hi, lo) \
- ({ mad_fixed_t __result, __round; \
- asm ("rotrwi %0,%1,%2" \
- : "=r" (__result) \
- : "r" (lo), "i" (MAD_F_SCALEBITS)); \
- asm ("extrwi %0,%1,1,0" \
- : "=r" (__round) \
- : "r" (__result)); \
- asm ("insrwi %0,%1,%2,0" \
- : "+r" (__result) \
- : "r" (hi), "i" (MAD_F_SCALEBITS)); \
- asm ("add %0,%1,%2" \
- : "=r" (__result) \
- : "%r" (__result), "r" (__round)); \
- __result; \
- })
-# else
-# define mad_f_scale64(hi, lo) \
- ({ mad_fixed_t __result; \
- asm ("rotrwi %0,%1,%2" \
- : "=r" (__result) \
- : "r" (lo), "i" (MAD_F_SCALEBITS)); \
- asm ("insrwi %0,%1,%2,0" \
- : "+r" (__result) \
- : "r" (hi), "i" (MAD_F_SCALEBITS)); \
- __result; \
- })
-# endif
-
-# define MAD_F_SCALEBITS MAD_F_FRACBITS
-
-/* --- Default ------------------------------------------------------------- */
-
-# elif defined(FPM_DEFAULT)
-
-/*
- * This version is the most portable but it loses significant accuracy.
- * Furthermore, accuracy is biased against the second argument, so care
- * should be taken when ordering operands.
- *
- * The scale factors are constant as this is not used with SSO.
- *
- * Pre-rounding is required to stay within the limits of compliance.
- */
-# if defined(OPT_SPEED)
-# define mad_f_mul(x, y) (((x) >> 12) * ((y) >> 16))
-# else
-# define mad_f_mul(x, y) ((((x) + (1L << 11)) >> 12) * \
- (((y) + (1L << 15)) >> 16))
-# endif
-
-/* ------------------------------------------------------------------------- */
-
-# else
-# error "no FPM selected"
-# endif
-
-/* default implementations */
-
-# if !defined(mad_f_mul)
-# define mad_f_mul(x, y) \
- ({ register mad_fixed64hi_t __hi; \
- register mad_fixed64lo_t __lo; \
- MAD_F_MLX(__hi, __lo, (x), (y)); \
- mad_f_scale64(__hi, __lo); \
- })
-# endif
-
-# if !defined(MAD_F_MLA)
-# define MAD_F_ML0(hi, lo, x, y) ((lo) = mad_f_mul((x), (y)))
-# define MAD_F_MLA(hi, lo, x, y) ((lo) += mad_f_mul((x), (y)))
-# define MAD_F_MLN(hi, lo) ((lo) = -(lo))
-# define MAD_F_MLZ(hi, lo) ((void) (hi), (mad_fixed_t) (lo))
-# endif
-
-# if !defined(MAD_F_ML0)
-# define MAD_F_ML0(hi, lo, x, y) MAD_F_MLX((hi), (lo), (x), (y))
-# endif
-
-# if !defined(MAD_F_MLN)
-# define MAD_F_MLN(hi, lo) ((hi) = ((lo) = -(lo)) ? ~(hi) : -(hi))
-# endif
-
-# if !defined(MAD_F_MLZ)
-# define MAD_F_MLZ(hi, lo) mad_f_scale64((hi), (lo))
-# endif
-
-# if !defined(mad_f_scale64)
-# if defined(OPT_ACCURACY)
-# define mad_f_scale64(hi, lo) \
- ((((mad_fixed_t) \
- (((hi) << (32 - (MAD_F_SCALEBITS - 1))) | \
- ((lo) >> (MAD_F_SCALEBITS - 1)))) + 1) >> 1)
-# else
-# define mad_f_scale64(hi, lo) \
- ((mad_fixed_t) \
- (((hi) << (32 - MAD_F_SCALEBITS)) | \
- ((lo) >> MAD_F_SCALEBITS)))
-# endif
-# define MAD_F_SCALEBITS MAD_F_FRACBITS
-# endif
-
-/* C routines */
-
-mad_fixed_t mad_f_abs(mad_fixed_t);
-mad_fixed_t mad_f_div(mad_fixed_t, mad_fixed_t);
-
-# endif
diff --git a/src/libmad/frame.c b/src/libmad/frame.c
deleted file mode 100644
index 6fe1970c0..000000000
--- a/src/libmad/frame.c
+++ /dev/null
@@ -1,503 +0,0 @@
-/*
- * libmad - MPEG audio decoder library
- * Copyright (C) 2000-2004 Underbit Technologies, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * $Id: frame.c,v 1.3 2004/04/22 00:22:36 miguelfreitas Exp $
- */
-
-# ifdef HAVE_CONFIG_H
-# include "config.h"
-# endif
-
-# include "global.h"
-
-# include <stdlib.h>
-
-# include "bit.h"
-# include "stream.h"
-# include "frame.h"
-# include "timer.h"
-# include "layer12.h"
-# include "layer3.h"
-
-static
-unsigned long const bitrate_table[5][15] = {
- /* MPEG-1 */
- { 0, 32000, 64000, 96000, 128000, 160000, 192000, 224000, /* Layer I */
- 256000, 288000, 320000, 352000, 384000, 416000, 448000 },
- { 0, 32000, 48000, 56000, 64000, 80000, 96000, 112000, /* Layer II */
- 128000, 160000, 192000, 224000, 256000, 320000, 384000 },
- { 0, 32000, 40000, 48000, 56000, 64000, 80000, 96000, /* Layer III */
- 112000, 128000, 160000, 192000, 224000, 256000, 320000 },
-
- /* MPEG-2 LSF */
- { 0, 32000, 48000, 56000, 64000, 80000, 96000, 112000, /* Layer I */
- 128000, 144000, 160000, 176000, 192000, 224000, 256000 },
- { 0, 8000, 16000, 24000, 32000, 40000, 48000, 56000, /* Layers */
- 64000, 80000, 96000, 112000, 128000, 144000, 160000 } /* II & III */
-};
-
-static
-unsigned int const samplerate_table[3] = { 44100, 48000, 32000 };
-
-static
-int (*const decoder_table[3])(struct mad_stream *, struct mad_frame *) = {
- mad_layer_I,
- mad_layer_II,
- mad_layer_III
-};
-
-/*
- * NAME: header->init()
- * DESCRIPTION: initialize header struct
- */
-void mad_header_init(struct mad_header *header)
-{
- header->layer = 0;
- header->mode = 0;
- header->mode_extension = 0;
- header->emphasis = 0;
-
- header->bitrate = 0;
- header->samplerate = 0;
-
- header->crc_check = 0;
- header->crc_target = 0;
-
- header->flags = 0;
- header->private_bits = 0;
-
- header->duration = mad_timer_zero;
-}
-
-/*
- * NAME: frame->init()
- * DESCRIPTION: initialize frame struct
- */
-void mad_frame_init(struct mad_frame *frame)
-{
- mad_header_init(&frame->header);
-
- frame->options = 0;
-
- frame->overlap = 0;
- mad_frame_mute(frame);
-}
-
-/*
- * NAME: frame->finish()
- * DESCRIPTION: deallocate any dynamic memory associated with frame
- */
-void mad_frame_finish(struct mad_frame *frame)
-{
- mad_header_finish(&frame->header);
-
- if (frame->overlap) {
- free(frame->overlap);
- frame->overlap = 0;
- }
-}
-
-/*
- * NAME: decode_header()
- * DESCRIPTION: read header data and following CRC word
- */
-static
-int decode_header(struct mad_header *header, struct mad_stream *stream)
-{
- unsigned int index;
-
- header->flags = 0;
- header->private_bits = 0;
-
- /* header() */
-
- /* syncword */
- mad_bit_skip(&stream->ptr, 11);
-
- /* MPEG 2.5 indicator (really part of syncword) */
- if (mad_bit_read(&stream->ptr, 1) == 0)
- header->flags |= MAD_FLAG_MPEG_2_5_EXT;
-
- /* ID */
- if (mad_bit_read(&stream->ptr, 1) == 0)
- header->flags |= MAD_FLAG_LSF_EXT;
- else if (header->flags & MAD_FLAG_MPEG_2_5_EXT) {
- stream->error = MAD_ERROR_LOSTSYNC;
- return -1;
- }
-
- /* layer */
- header->layer = 4 - mad_bit_read(&stream->ptr, 2);
-
- if (header->layer == 4) {
- stream->error = MAD_ERROR_BADLAYER;
- return -1;
- }
-
- /* protection_bit */
- if (mad_bit_read(&stream->ptr, 1) == 0) {
- header->flags |= MAD_FLAG_PROTECTION;
- header->crc_check = mad_bit_crc(stream->ptr, 16, 0xffff);
- }
-
- /* bitrate_index */
- index = mad_bit_read(&stream->ptr, 4);
-
- if (index == 15) {
- stream->error = MAD_ERROR_BADBITRATE;
- return -1;
- }
-
- if (header->flags & MAD_FLAG_LSF_EXT)
- header->bitrate = bitrate_table[3 + (header->layer >> 1)][index];
- else
- header->bitrate = bitrate_table[header->layer - 1][index];
-
- /* sampling_frequency */
- index = mad_bit_read(&stream->ptr, 2);
-
- if (index == 3) {
- stream->error = MAD_ERROR_BADSAMPLERATE;
- return -1;
- }
-
- header->samplerate = samplerate_table[index];
-
- if (header->flags & MAD_FLAG_LSF_EXT) {
- header->samplerate /= 2;
-
- if (header->flags & MAD_FLAG_MPEG_2_5_EXT)
- header->samplerate /= 2;
- }
-
- /* padding_bit */
- if (mad_bit_read(&stream->ptr, 1))
- header->flags |= MAD_FLAG_PADDING;
-
- /* private_bit */
- if (mad_bit_read(&stream->ptr, 1))
- header->private_bits |= MAD_PRIVATE_HEADER;
-
- /* mode */
- header->mode = 3 - mad_bit_read(&stream->ptr, 2);
-
- /* mode_extension */
- header->mode_extension = mad_bit_read(&stream->ptr, 2);
-
- /* copyright */
- if (mad_bit_read(&stream->ptr, 1))
- header->flags |= MAD_FLAG_COPYRIGHT;
-
- /* original/copy */
- if (mad_bit_read(&stream->ptr, 1))
- header->flags |= MAD_FLAG_ORIGINAL;
-
- /* emphasis */
- header->emphasis = mad_bit_read(&stream->ptr, 2);
-
-# if defined(OPT_STRICT)
- /*
- * ISO/IEC 11172-3 says this is a reserved emphasis value, but
- * streams exist which use it anyway. Since the value is not important
- * to the decoder proper, we allow it unless OPT_STRICT is defined.
- */
- if (header->emphasis == MAD_EMPHASIS_RESERVED) {
- stream->error = MAD_ERROR_BADEMPHASIS;
- return -1;
- }
-# endif
-
- /* error_check() */
-
- /* crc_check */
- if (header->flags & MAD_FLAG_PROTECTION)
- header->crc_target = mad_bit_read(&stream->ptr, 16);
-
- return 0;
-}
-
-/*
- * NAME: free_bitrate()
- * DESCRIPTION: attempt to discover the bitstream's free bitrate
- */
-static
-int free_bitrate(struct mad_stream *stream, struct mad_header const *header)
-{
- struct mad_bitptr keep_ptr;
- unsigned long rate = 0;
- unsigned int pad_slot, slots_per_frame;
- unsigned char const *ptr = 0;
-
- keep_ptr = stream->ptr;
-
- pad_slot = (header->flags & MAD_FLAG_PADDING) ? 1 : 0;
- slots_per_frame = (header->layer == MAD_LAYER_III &&
- (header->flags & MAD_FLAG_LSF_EXT)) ? 72 : 144;
-
- while (mad_stream_sync(stream) == 0) {
- struct mad_stream peek_stream;
- struct mad_header peek_header;
-
- peek_stream = *stream;
- peek_header = *header;
-
- if (decode_header(&peek_header, &peek_stream) == 0 &&
- peek_header.layer == header->layer &&
- peek_header.samplerate == header->samplerate) {
- unsigned int N;
-
- ptr = mad_bit_nextbyte(&stream->ptr);
-
- N = ptr - stream->this_frame;
-
- if (header->layer == MAD_LAYER_I) {
- rate = (unsigned long) header->samplerate *
- (N - 4 * pad_slot + 4) / 48 / 1000;
- }
- else {
- rate = (unsigned long) header->samplerate *
- (N - pad_slot + 1) / slots_per_frame / 1000;
- }
-
- if (rate >= 8)
- break;
- }
-
- mad_bit_skip(&stream->ptr, 8);
- }
-
- stream->ptr = keep_ptr;
-
- if (rate < 8 || (header->layer == MAD_LAYER_III && rate > 640)) {
- stream->error = MAD_ERROR_LOSTSYNC;
- return -1;
- }
-
- stream->freerate = rate * 1000;
-
- return 0;
-}
-
-/*
- * NAME: header->decode()
- * DESCRIPTION: read the next frame header from the stream
- */
-int mad_header_decode(struct mad_header *header, struct mad_stream *stream)
-{
- register unsigned char const *ptr, *end;
- unsigned int pad_slot, N;
-
- ptr = stream->next_frame;
- end = stream->bufend;
-
- if (ptr == 0) {
- stream->error = MAD_ERROR_BUFPTR;
- goto fail;
- }
-
- /* stream skip */
- if (stream->skiplen) {
- if (!stream->sync)
- ptr = stream->this_frame;
-
- if (end - ptr < stream->skiplen) {
- stream->skiplen -= end - ptr;
- stream->next_frame = end;
-
- stream->error = MAD_ERROR_BUFLEN;
- goto fail;
- }
-
- ptr += stream->skiplen;
- stream->skiplen = 0;
-
- stream->sync = 1;
- }
-
- sync:
- /* synchronize */
- if (stream->sync) {
- if (end - ptr < MAD_BUFFER_GUARD) {
- stream->next_frame = ptr;
-
- stream->error = MAD_ERROR_BUFLEN;
- goto fail;
- }
- else if (!(ptr[0] == 0xff && (ptr[1] & 0xe0) == 0xe0)) {
- /* mark point where frame sync word was expected */
- stream->this_frame = ptr;
- stream->next_frame = ptr + 1;
-
- stream->error = MAD_ERROR_LOSTSYNC;
- goto fail;
- }
- }
- else {
- mad_bit_init(&stream->ptr, ptr);
-
- if (mad_stream_sync(stream) == -1) {
- if (end - stream->next_frame >= MAD_BUFFER_GUARD)
- stream->next_frame = end - MAD_BUFFER_GUARD;
-
- stream->error = MAD_ERROR_BUFLEN;
- goto fail;
- }
-
- ptr = mad_bit_nextbyte(&stream->ptr);
- }
-
- /* begin processing */
- stream->this_frame = ptr;
- stream->next_frame = ptr + 1; /* possibly bogus sync word */
-
- mad_bit_init(&stream->ptr, stream->this_frame);
-
- if (decode_header(header, stream) == -1)
- goto fail;
-
- /* calculate frame duration */
- mad_timer_set(&header->duration, 0,
- 32 * MAD_NSBSAMPLES(header), header->samplerate);
-
- /* calculate free bit rate */
- if (header->bitrate == 0) {
- if ((stream->freerate == 0 || !stream->sync ||
- (header->layer == MAD_LAYER_III && stream->freerate > 640000)) &&
- free_bitrate(stream, header) == -1)
- goto fail;
-
- header->bitrate = stream->freerate;
- header->flags |= MAD_FLAG_FREEFORMAT;
- }
-
- /* calculate beginning of next frame */
- pad_slot = (header->flags & MAD_FLAG_PADDING) ? 1 : 0;
-
- if (header->layer == MAD_LAYER_I)
- N = ((12 * header->bitrate / header->samplerate) + pad_slot) * 4;
- else {
- unsigned int slots_per_frame;
-
- slots_per_frame = (header->layer == MAD_LAYER_III &&
- (header->flags & MAD_FLAG_LSF_EXT)) ? 72 : 144;
-
- N = (slots_per_frame * header->bitrate / header->samplerate) + pad_slot;
- }
-
- /* verify there is enough data left in buffer to decode this frame */
- if (N + MAD_BUFFER_GUARD > end - stream->this_frame) {
- stream->next_frame = stream->this_frame;
-
- stream->error = MAD_ERROR_BUFLEN;
- goto fail;
- }
-
- stream->next_frame = stream->this_frame + N;
-
- if (!stream->sync) {
- /* check that a valid frame header follows this frame */
-
- ptr = stream->next_frame;
- if (!(ptr[0] == 0xff && (ptr[1] & 0xe0) == 0xe0)) {
- ptr = stream->next_frame = stream->this_frame + 1;
- goto sync;
- }
-
- stream->sync = 1;
- }
-
- header->flags |= MAD_FLAG_INCOMPLETE;
-
- return 0;
-
- fail:
- stream->sync = 0;
-
- return -1;
-}
-
-/*
- * NAME: frame->decode()
- * DESCRIPTION: decode a single frame from a bitstream
- */
-int mad_frame_decode(struct mad_frame *frame, struct mad_stream *stream)
-{
- frame->options = stream->options;
-
- /* header() */
- /* error_check() */
-
- if (!(frame->header.flags & MAD_FLAG_INCOMPLETE) &&
- mad_header_decode(&frame->header, stream) == -1)
- goto fail;
-
- /* audio_data() */
-
- frame->header.flags &= ~MAD_FLAG_INCOMPLETE;
-
- if (decoder_table[frame->header.layer - 1](stream, frame) == -1) {
- if (!MAD_RECOVERABLE(stream->error))
- stream->next_frame = stream->this_frame;
-
- goto fail;
- }
-
- /* ancillary_data() */
-
- if (frame->header.layer != MAD_LAYER_III) {
- struct mad_bitptr next_frame;
-
- mad_bit_init(&next_frame, stream->next_frame);
-
- stream->anc_ptr = stream->ptr;
- stream->anc_bitlen = mad_bit_length(&stream->ptr, &next_frame);
-
- mad_bit_finish(&next_frame);
- }
-
- return 0;
-
- fail:
- stream->anc_bitlen = 0;
- return -1;
-}
-
-/*
- * NAME: frame->mute()
- * DESCRIPTION: zero all subband values so the frame becomes silent
- */
-void mad_frame_mute(struct mad_frame *frame)
-{
- unsigned int s, sb;
-
- for (s = 0; s < 36; ++s) {
- for (sb = 0; sb < 32; ++sb) {
- frame->sbsample[0][s][sb] =
- frame->sbsample[1][s][sb] = 0;
- }
- }
-
- if (frame->overlap) {
- for (s = 0; s < 18; ++s) {
- for (sb = 0; sb < 32; ++sb) {
- (*frame->overlap)[0][sb][s] =
- (*frame->overlap)[1][sb][s] = 0;
- }
- }
- }
-}
diff --git a/src/libmad/frame.h b/src/libmad/frame.h
deleted file mode 100644
index 270420ab8..000000000
--- a/src/libmad/frame.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * libmad - MPEG audio decoder library
- * Copyright (C) 2000-2004 Underbit Technologies, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * $Id: frame.h,v 1.3 2004/04/22 00:22:36 miguelfreitas Exp $
- */
-
-# ifndef LIBMAD_FRAME_H
-# define LIBMAD_FRAME_H
-
-# include "fixed.h"
-# include "timer.h"
-# include "stream.h"
-
-enum mad_layer {
- MAD_LAYER_I = 1, /* Layer I */
- MAD_LAYER_II = 2, /* Layer II */
- MAD_LAYER_III = 3 /* Layer III */
-};
-
-enum mad_mode {
- MAD_MODE_SINGLE_CHANNEL = 0, /* single channel */
- MAD_MODE_DUAL_CHANNEL = 1, /* dual channel */
- MAD_MODE_JOINT_STEREO = 2, /* joint (MS/intensity) stereo */
- MAD_MODE_STEREO = 3 /* normal LR stereo */
-};
-
-enum mad_emphasis {
- MAD_EMPHASIS_NONE = 0, /* no emphasis */
- MAD_EMPHASIS_50_15_US = 1, /* 50/15 microseconds emphasis */
- MAD_EMPHASIS_CCITT_J_17 = 3, /* CCITT J.17 emphasis */
- MAD_EMPHASIS_RESERVED = 2 /* unknown emphasis */
-};
-
-struct mad_header {
- enum mad_layer layer; /* audio layer (1, 2, or 3) */
- enum mad_mode mode; /* channel mode (see above) */
- int mode_extension; /* additional mode info */
- enum mad_emphasis emphasis; /* de-emphasis to use (see above) */
-
- unsigned long bitrate; /* stream bitrate (bps) */
- unsigned int samplerate; /* sampling frequency (Hz) */
-
- unsigned short crc_check; /* frame CRC accumulator */
- unsigned short crc_target; /* final target CRC checksum */
-
- int flags; /* flags (see below) */
- int private_bits; /* private bits (see below) */
-
- mad_timer_t duration; /* audio playing time of frame */
-};
-
-struct mad_frame {
- struct mad_header header; /* MPEG audio header */
-
- int options; /* decoding options (from stream) */
-
- mad_fixed_t sbsample[2][36][32]; /* synthesis subband filter samples */
- mad_fixed_t (*overlap)[2][32][18]; /* Layer III block overlap data */
-};
-
-# define MAD_NCHANNELS(header) ((header)->mode ? 2 : 1)
-# define MAD_NSBSAMPLES(header) \
- ((header)->layer == MAD_LAYER_I ? 12 : \
- (((header)->layer == MAD_LAYER_III && \
- ((header)->flags & MAD_FLAG_LSF_EXT)) ? 18 : 36))
-
-enum {
- MAD_FLAG_NPRIVATE_III = 0x0007, /* number of Layer III private bits */
- MAD_FLAG_INCOMPLETE = 0x0008, /* header but not data is decoded */
-
- MAD_FLAG_PROTECTION = 0x0010, /* frame has CRC protection */
- MAD_FLAG_COPYRIGHT = 0x0020, /* frame is copyright */
- MAD_FLAG_ORIGINAL = 0x0040, /* frame is original (else copy) */
- MAD_FLAG_PADDING = 0x0080, /* frame has additional slot */
-
- MAD_FLAG_I_STEREO = 0x0100, /* uses intensity joint stereo */
- MAD_FLAG_MS_STEREO = 0x0200, /* uses middle/side joint stereo */
- MAD_FLAG_FREEFORMAT = 0x0400, /* uses free format bitrate */
-
- MAD_FLAG_LSF_EXT = 0x1000, /* lower sampling freq. extension */
- MAD_FLAG_MC_EXT = 0x2000, /* multichannel audio extension */
- MAD_FLAG_MPEG_2_5_EXT = 0x4000 /* MPEG 2.5 (unofficial) extension */
-};
-
-enum {
- MAD_PRIVATE_HEADER = 0x0100, /* header private bit */
- MAD_PRIVATE_III = 0x001f /* Layer III private bits (up to 5) */
-};
-
-void mad_header_init(struct mad_header *);
-
-# define mad_header_finish(header) /* nothing */
-
-int mad_header_decode(struct mad_header *, struct mad_stream *);
-
-void mad_frame_init(struct mad_frame *);
-void mad_frame_finish(struct mad_frame *);
-
-int mad_frame_decode(struct mad_frame *, struct mad_stream *);
-
-void mad_frame_mute(struct mad_frame *);
-
-# endif
diff --git a/src/libmad/global.h b/src/libmad/global.h
deleted file mode 100644
index 2f4b41db5..000000000
--- a/src/libmad/global.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * libmad - MPEG audio decoder library
- * Copyright (C) 2000-2004 Underbit Technologies, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * $Id: global.h,v 1.4 2004/04/22 00:22:36 miguelfreitas Exp $
- */
-
-# ifndef LIBMAD_GLOBAL_H
-# define LIBMAD_GLOBAL_H
-
-/* conditional debugging */
-
-# if defined(DEBUG) && defined(NDEBUG)
-# error "cannot define both DEBUG and NDEBUG"
-# endif
-
-# if defined(DEBUG)
-# include <stdio.h>
-# endif
-
-/* conditional features */
-
-# if defined(OPT_SPEED) && defined(OPT_ACCURACY)
-# error "cannot optimize for both speed and accuracy"
-# endif
-
-# if defined(OPT_SPEED) && !defined(OPT_SSO)
-# define OPT_SSO
-# endif
-
-# if defined(HAVE_UNISTD_H) && defined(HAVE_WAITPID) && \
- defined(HAVE_FCNTL) && defined(HAVE_PIPE) && defined(HAVE_FORK)
-# define USE_ASYNC
-# endif
-
-# if !defined(HAVE_ASSERT_H)
-# if defined(NDEBUG)
-# define assert(x) /* nothing */
-# else
-# define assert(x) do { if (!(x)) abort(); } while (0)
-# endif
-# endif
-
-# endif
diff --git a/src/libmad/huffman.c b/src/libmad/huffman.c
deleted file mode 100644
index 5d34c0142..000000000
--- a/src/libmad/huffman.c
+++ /dev/null
@@ -1,3109 +0,0 @@
-/*
- * libmad - MPEG audio decoder library
- * Copyright (C) 2000-2004 Underbit Technologies, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * $Id: huffman.c,v 1.4 2004/04/22 00:22:36 miguelfreitas Exp $
- */
-
-# ifdef HAVE_CONFIG_H
-# include "config.h"
-# endif
-
-# include "global.h"
-
-# include "huffman.h"
-
-/*
- * These are the Huffman code words for Layer III.
- * The data for these tables are derived from Table B.7 of ISO/IEC 11172-3.
- *
- * These tables support decoding up to 4 Huffman code bits at a time.
- */
-
-# if defined(__GNUC__) || \
- (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901)
-# define PTR(offs, bits) { .ptr = { 0, bits, offs } }
-# define V(v, w, x, y, hlen) { .value = { 1, hlen, v, w, x, y } }
-# else
-# define PTR(offs, bits) { { 0, bits, offs } }
-# if defined(WORDS_BIGENDIAN)
-# define V(v, w, x, y, hlen) { { 1, hlen, (v << 11) | (w << 10) | \
- (x << 9) | (y << 8) } }
-# else
-# define V(v, w, x, y, hlen) { { 1, hlen, (v << 0) | (w << 1) | \
- (x << 2) | (y << 3) } }
-# endif
-# endif
-
-static
-union huffquad const hufftabA[] = {
- /* 0000 */ PTR(16, 2),
- /* 0001 */ PTR(20, 2),
- /* 0010 */ PTR(24, 1),
- /* 0011 */ PTR(26, 1),
- /* 0100 */ V(0, 0, 1, 0, 4),
- /* 0101 */ V(0, 0, 0, 1, 4),
- /* 0110 */ V(0, 1, 0, 0, 4),
- /* 0111 */ V(1, 0, 0, 0, 4),
- /* 1000 */ V(0, 0, 0, 0, 1),
- /* 1001 */ V(0, 0, 0, 0, 1),
- /* 1010 */ V(0, 0, 0, 0, 1),
- /* 1011 */ V(0, 0, 0, 0, 1),
- /* 1100 */ V(0, 0, 0, 0, 1),
- /* 1101 */ V(0, 0, 0, 0, 1),
- /* 1110 */ V(0, 0, 0, 0, 1),
- /* 1111 */ V(0, 0, 0, 0, 1),
-
- /* 0000 ... */
- /* 00 */ V(1, 0, 1, 1, 2), /* 16 */
- /* 01 */ V(1, 1, 1, 1, 2),
- /* 10 */ V(1, 1, 0, 1, 2),
- /* 11 */ V(1, 1, 1, 0, 2),
-
- /* 0001 ... */
- /* 00 */ V(0, 1, 1, 1, 2), /* 20 */
- /* 01 */ V(0, 1, 0, 1, 2),
- /* 10 */ V(1, 0, 0, 1, 1),
- /* 11 */ V(1, 0, 0, 1, 1),
-
- /* 0010 ... */
- /* 0 */ V(0, 1, 1, 0, 1), /* 24 */
- /* 1 */ V(0, 0, 1, 1, 1),
-
- /* 0011 ... */
- /* 0 */ V(1, 0, 1, 0, 1), /* 26 */
- /* 1 */ V(1, 1, 0, 0, 1)
-};
-
-static
-union huffquad const hufftabB[] = {
- /* 0000 */ V(1, 1, 1, 1, 4),
- /* 0001 */ V(1, 1, 1, 0, 4),
- /* 0010 */ V(1, 1, 0, 1, 4),
- /* 0011 */ V(1, 1, 0, 0, 4),
- /* 0100 */ V(1, 0, 1, 1, 4),
- /* 0101 */ V(1, 0, 1, 0, 4),
- /* 0110 */ V(1, 0, 0, 1, 4),
- /* 0111 */ V(1, 0, 0, 0, 4),
- /* 1000 */ V(0, 1, 1, 1, 4),
- /* 1001 */ V(0, 1, 1, 0, 4),
- /* 1010 */ V(0, 1, 0, 1, 4),
- /* 1011 */ V(0, 1, 0, 0, 4),
- /* 1100 */ V(0, 0, 1, 1, 4),
- /* 1101 */ V(0, 0, 1, 0, 4),
- /* 1110 */ V(0, 0, 0, 1, 4),
- /* 1111 */ V(0, 0, 0, 0, 4)
-};
-
-# undef V
-# undef PTR
-
-# if defined(__GNUC__) || \
- (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901)
-# define PTR(offs, bits) { .ptr = { 0, bits, offs } }
-# define V(x, y, hlen) { .value = { 1, hlen, x, y } }
-# else
-# define PTR(offs, bits) { { 0, bits, offs } }
-# if defined(WORDS_BIGENDIAN)
-# define V(x, y, hlen) { { 1, hlen, (x << 8) | (y << 4) } }
-# else
-# define V(x, y, hlen) { { 1, hlen, (x << 0) | (y << 4) } }
-# endif
-# endif
-
-static
-union huffpair const hufftab0[] = {
- /* */ V(0, 0, 0)
-};
-
-static
-union huffpair const hufftab1[] = {
- /* 000 */ V(1, 1, 3),
- /* 001 */ V(0, 1, 3),
- /* 010 */ V(1, 0, 2),
- /* 011 */ V(1, 0, 2),
- /* 100 */ V(0, 0, 1),
- /* 101 */ V(0, 0, 1),
- /* 110 */ V(0, 0, 1),
- /* 111 */ V(0, 0, 1)
-};
-
-static
-union huffpair const hufftab2[] = {
- /* 000 */ PTR(8, 3),
- /* 001 */ V(1, 1, 3),
- /* 010 */ V(0, 1, 3),
- /* 011 */ V(1, 0, 3),
- /* 100 */ V(0, 0, 1),
- /* 101 */ V(0, 0, 1),
- /* 110 */ V(0, 0, 1),
- /* 111 */ V(0, 0, 1),
-
- /* 000 ... */
- /* 000 */ V(2, 2, 3), /* 8 */
- /* 001 */ V(0, 2, 3),
- /* 010 */ V(1, 2, 2),
- /* 011 */ V(1, 2, 2),
- /* 100 */ V(2, 1, 2),
- /* 101 */ V(2, 1, 2),
- /* 110 */ V(2, 0, 2),
- /* 111 */ V(2, 0, 2)
-};
-
-static
-union huffpair const hufftab3[] = {
- /* 000 */ PTR(8, 3),
- /* 001 */ V(1, 0, 3),
- /* 010 */ V(1, 1, 2),
- /* 011 */ V(1, 1, 2),
- /* 100 */ V(0, 1, 2),
- /* 101 */ V(0, 1, 2),
- /* 110 */ V(0, 0, 2),
- /* 111 */ V(0, 0, 2),
-
- /* 000 ... */
- /* 000 */ V(2, 2, 3), /* 8 */
- /* 001 */ V(0, 2, 3),
- /* 010 */ V(1, 2, 2),
- /* 011 */ V(1, 2, 2),
- /* 100 */ V(2, 1, 2),
- /* 101 */ V(2, 1, 2),
- /* 110 */ V(2, 0, 2),
- /* 111 */ V(2, 0, 2)
-};
-
-static
-union huffpair const hufftab5[] = {
- /* 000 */ PTR(8, 4),
- /* 001 */ V(1, 1, 3),
- /* 010 */ V(0, 1, 3),
- /* 011 */ V(1, 0, 3),
- /* 100 */ V(0, 0, 1),
- /* 101 */ V(0, 0, 1),
- /* 110 */ V(0, 0, 1),
- /* 111 */ V(0, 0, 1),
-
- /* 000 ... */
- /* 0000 */ PTR(24, 1), /* 8 */
- /* 0001 */ V(3, 2, 4),
- /* 0010 */ V(3, 1, 3),
- /* 0011 */ V(3, 1, 3),
- /* 0100 */ V(1, 3, 4),
- /* 0101 */ V(0, 3, 4),
- /* 0110 */ V(3, 0, 4),
- /* 0111 */ V(2, 2, 4),
- /* 1000 */ V(1, 2, 3),
- /* 1001 */ V(1, 2, 3),
- /* 1010 */ V(2, 1, 3),
- /* 1011 */ V(2, 1, 3),
- /* 1100 */ V(0, 2, 3),
- /* 1101 */ V(0, 2, 3),
- /* 1110 */ V(2, 0, 3),
- /* 1111 */ V(2, 0, 3),
-
- /* 000 0000 ... */
- /* 0 */ V(3, 3, 1), /* 24 */
- /* 1 */ V(2, 3, 1)
-};
-
-static
-union huffpair const hufftab6[] = {
- /* 0000 */ PTR(16, 3),
- /* 0001 */ PTR(24, 1),
- /* 0010 */ PTR(26, 1),
- /* 0011 */ V(1, 2, 4),
- /* 0100 */ V(2, 1, 4),
- /* 0101 */ V(2, 0, 4),
- /* 0110 */ V(0, 1, 3),
- /* 0111 */ V(0, 1, 3),
- /* 1000 */ V(1, 1, 2),
- /* 1001 */ V(1, 1, 2),
- /* 1010 */ V(1, 1, 2),
- /* 1011 */ V(1, 1, 2),
- /* 1100 */ V(1, 0, 3),
- /* 1101 */ V(1, 0, 3),
- /* 1110 */ V(0, 0, 3),
- /* 1111 */ V(0, 0, 3),
-
- /* 0000 ... */
- /* 000 */ V(3, 3, 3), /* 16 */
- /* 001 */ V(0, 3, 3),
- /* 010 */ V(2, 3, 2),
- /* 011 */ V(2, 3, 2),
- /* 100 */ V(3, 2, 2),
- /* 101 */ V(3, 2, 2),
- /* 110 */ V(3, 0, 2),
- /* 111 */ V(3, 0, 2),
-
- /* 0001 ... */
- /* 0 */ V(1, 3, 1), /* 24 */
- /* 1 */ V(3, 1, 1),
-
- /* 0010 ... */
- /* 0 */ V(2, 2, 1), /* 26 */
- /* 1 */ V(0, 2, 1)
-};
-
-static
-union huffpair const hufftab7[] = {
- /* 0000 */ PTR(16, 4),
- /* 0001 */ PTR(32, 4),
- /* 0010 */ PTR(48, 2),
- /* 0011 */ V(1, 1, 4),
- /* 0100 */ V(0, 1, 3),
- /* 0101 */ V(0, 1, 3),
- /* 0110 */ V(1, 0, 3),
- /* 0111 */ V(1, 0, 3),
- /* 1000 */ V(0, 0, 1),
- /* 1001 */ V(0, 0, 1),
- /* 1010 */ V(0, 0, 1),
- /* 1011 */ V(0, 0, 1),
- /* 1100 */ V(0, 0, 1),
- /* 1101 */ V(0, 0, 1),
- /* 1110 */ V(0, 0, 1),
- /* 1111 */ V(0, 0, 1),
-
- /* 0000 ... */
- /* 0000 */ PTR(52, 2), /* 16 */
- /* 0001 */ PTR(56, 1),
- /* 0010 */ PTR(58, 1),
- /* 0011 */ V(1, 5, 4),
- /* 0100 */ V(5, 1, 4),
- /* 0101 */ PTR(60, 1),
- /* 0110 */ V(5, 0, 4),
- /* 0111 */ PTR(62, 1),
- /* 1000 */ V(2, 4, 4),
- /* 1001 */ V(4, 2, 4),
- /* 1010 */ V(1, 4, 3),
- /* 1011 */ V(1, 4, 3),
- /* 1100 */ V(4, 1, 3),
- /* 1101 */ V(4, 1, 3),
- /* 1110 */ V(4, 0, 3),
- /* 1111 */ V(4, 0, 3),
-
- /* 0001 ... */
- /* 0000 */ V(0, 4, 4), /* 32 */
- /* 0001 */ V(2, 3, 4),
- /* 0010 */ V(3, 2, 4),
- /* 0011 */ V(0, 3, 4),
- /* 0100 */ V(1, 3, 3),
- /* 0101 */ V(1, 3, 3),
- /* 0110 */ V(3, 1, 3),
- /* 0111 */ V(3, 1, 3),
- /* 1000 */ V(3, 0, 3),
- /* 1001 */ V(3, 0, 3),
- /* 1010 */ V(2, 2, 3),
- /* 1011 */ V(2, 2, 3),
- /* 1100 */ V(1, 2, 2),
- /* 1101 */ V(1, 2, 2),
- /* 1110 */ V(1, 2, 2),
- /* 1111 */ V(1, 2, 2),
-
- /* 0010 ... */
- /* 00 */ V(2, 1, 1), /* 48 */
- /* 01 */ V(2, 1, 1),
- /* 10 */ V(0, 2, 2),
- /* 11 */ V(2, 0, 2),
-
- /* 0000 0000 ... */
- /* 00 */ V(5, 5, 2), /* 52 */
- /* 01 */ V(4, 5, 2),
- /* 10 */ V(5, 4, 2),
- /* 11 */ V(5, 3, 2),
-
- /* 0000 0001 ... */
- /* 0 */ V(3, 5, 1), /* 56 */
- /* 1 */ V(4, 4, 1),
-
- /* 0000 0010 ... */
- /* 0 */ V(2, 5, 1), /* 58 */
- /* 1 */ V(5, 2, 1),
-
- /* 0000 0101 ... */
- /* 0 */ V(0, 5, 1), /* 60 */
- /* 1 */ V(3, 4, 1),
-
- /* 0000 0111 ... */
- /* 0 */ V(4, 3, 1), /* 62 */
- /* 1 */ V(3, 3, 1)
-};
-
-# if 0
-/* this version saves 8 entries (16 bytes) at the expense of
- an extra lookup in 4 out of 36 cases */
-static
-union huffpair const hufftab8[] = {
- /* 0000 */ PTR(16, 4),
- /* 0001 */ PTR(32, 2),
- /* 0010 */ V(1, 2, 4),
- /* 0011 */ V(2, 1, 4),
- /* 0100 */ V(1, 1, 2),
- /* 0101 */ V(1, 1, 2),
- /* 0110 */ V(1, 1, 2),
- /* 0111 */ V(1, 1, 2),
- /* 1000 */ V(0, 1, 3),
- /* 1001 */ V(0, 1, 3),
- /* 1010 */ V(1, 0, 3),
- /* 1011 */ V(1, 0, 3),
- /* 1100 */ V(0, 0, 2),
- /* 1101 */ V(0, 0, 2),
- /* 1110 */ V(0, 0, 2),
- /* 1111 */ V(0, 0, 2),
-
- /* 0000 ... */
- /* 0000 */ PTR(36, 3), /* 16 */
- /* 0001 */ PTR(44, 2),
- /* 0010 */ PTR(48, 1),
- /* 0011 */ V(1, 5, 4),
- /* 0100 */ V(5, 1, 4),
- /* 0101 */ PTR(50, 1),
- /* 0110 */ PTR(52, 1),
- /* 0111 */ V(2, 4, 4),
- /* 1000 */ V(4, 2, 4),
- /* 1001 */ V(1, 4, 4),
- /* 1010 */ V(4, 1, 3),
- /* 1011 */ V(4, 1, 3),
- /* 1100 */ V(0, 4, 4),
- /* 1101 */ V(4, 0, 4),
- /* 1110 */ V(2, 3, 4),
- /* 1111 */ V(3, 2, 4),
-
- /* 0001 ... */
- /* 00 */ PTR(54, 2), /* 32 */
- /* 01 */ V(2, 2, 2),
- /* 10 */ V(0, 2, 2),
- /* 11 */ V(2, 0, 2),
-
- /* 0000 0000 ... */
- /* 000 */ V(5, 5, 3), /* 36 */
- /* 001 */ V(5, 4, 3),
- /* 010 */ V(4, 5, 2),
- /* 011 */ V(4, 5, 2),
- /* 100 */ V(5, 3, 1),
- /* 101 */ V(5, 3, 1),
- /* 110 */ V(5, 3, 1),
- /* 111 */ V(5, 3, 1),
-
- /* 0000 0001 ... */
- /* 00 */ V(3, 5, 2), /* 44 */
- /* 01 */ V(4, 4, 2),
- /* 10 */ V(2, 5, 1),
- /* 11 */ V(2, 5, 1),
-
- /* 0000 0010 ... */
- /* 0 */ V(5, 2, 1), /* 48 */
- /* 1 */ V(0, 5, 1),
-
- /* 0000 0101 ... */
- /* 0 */ V(3, 4, 1), /* 50 */
- /* 1 */ V(4, 3, 1),
-
- /* 0000 0110 ... */
- /* 0 */ V(5, 0, 1), /* 52 */
- /* 1 */ V(3, 3, 1),
-
- /* 0001 00 ... */
- /* 00 */ V(1, 3, 2), /* 54 */
- /* 01 */ V(3, 1, 2),
- /* 10 */ V(0, 3, 2),
- /* 11 */ V(3, 0, 2),
-};
-# else
-static
-union huffpair const hufftab8[] = {
- /* 0000 */ PTR(16, 4),
- /* 0001 */ PTR(32, 4),
- /* 0010 */ V(1, 2, 4),
- /* 0011 */ V(2, 1, 4),
- /* 0100 */ V(1, 1, 2),
- /* 0101 */ V(1, 1, 2),
- /* 0110 */ V(1, 1, 2),
- /* 0111 */ V(1, 1, 2),
- /* 1000 */ V(0, 1, 3),
- /* 1001 */ V(0, 1, 3),
- /* 1010 */ V(1, 0, 3),
- /* 1011 */ V(1, 0, 3),
- /* 1100 */ V(0, 0, 2),
- /* 1101 */ V(0, 0, 2),
- /* 1110 */ V(0, 0, 2),
- /* 1111 */ V(0, 0, 2),
-
- /* 0000 ... */
- /* 0000 */ PTR(48, 3), /* 16 */
- /* 0001 */ PTR(56, 2),
- /* 0010 */ PTR(60, 1),
- /* 0011 */ V(1, 5, 4),
- /* 0100 */ V(5, 1, 4),
- /* 0101 */ PTR(62, 1),
- /* 0110 */ PTR(64, 1),
- /* 0111 */ V(2, 4, 4),
- /* 1000 */ V(4, 2, 4),
- /* 1001 */ V(1, 4, 4),
- /* 1010 */ V(4, 1, 3),
- /* 1011 */ V(4, 1, 3),
- /* 1100 */ V(0, 4, 4),
- /* 1101 */ V(4, 0, 4),
- /* 1110 */ V(2, 3, 4),
- /* 1111 */ V(3, 2, 4),
-
- /* 0001 ... */
- /* 0000 */ V(1, 3, 4), /* 32 */
- /* 0001 */ V(3, 1, 4),
- /* 0010 */ V(0, 3, 4),
- /* 0011 */ V(3, 0, 4),
- /* 0100 */ V(2, 2, 2),
- /* 0101 */ V(2, 2, 2),
- /* 0110 */ V(2, 2, 2),
- /* 0111 */ V(2, 2, 2),
- /* 1000 */ V(0, 2, 2),
- /* 1001 */ V(0, 2, 2),
- /* 1010 */ V(0, 2, 2),
- /* 1011 */ V(0, 2, 2),
- /* 1100 */ V(2, 0, 2),
- /* 1101 */ V(2, 0, 2),
- /* 1110 */ V(2, 0, 2),
- /* 1111 */ V(2, 0, 2),
-
- /* 0000 0000 ... */
- /* 000 */ V(5, 5, 3), /* 48 */
- /* 001 */ V(5, 4, 3),
- /* 010 */ V(4, 5, 2),
- /* 011 */ V(4, 5, 2),
- /* 100 */ V(5, 3, 1),
- /* 101 */ V(5, 3, 1),
- /* 110 */ V(5, 3, 1),
- /* 111 */ V(5, 3, 1),
-
- /* 0000 0001 ... */
- /* 00 */ V(3, 5, 2), /* 56 */
- /* 01 */ V(4, 4, 2),
- /* 10 */ V(2, 5, 1),
- /* 11 */ V(2, 5, 1),
-
- /* 0000 0010 ... */
- /* 0 */ V(5, 2, 1), /* 60 */
- /* 1 */ V(0, 5, 1),
-
- /* 0000 0101 ... */
- /* 0 */ V(3, 4, 1), /* 62 */
- /* 1 */ V(4, 3, 1),
-
- /* 0000 0110 ... */
- /* 0 */ V(5, 0, 1), /* 64 */
- /* 1 */ V(3, 3, 1)
-};
-# endif
-
-static
-union huffpair const hufftab9[] = {
- /* 0000 */ PTR(16, 4),
- /* 0001 */ PTR(32, 3),
- /* 0010 */ PTR(40, 2),
- /* 0011 */ PTR(44, 2),
- /* 0100 */ PTR(48, 1),
- /* 0101 */ V(1, 2, 4),
- /* 0110 */ V(2, 1, 4),
- /* 0111 */ V(2, 0, 4),
- /* 1000 */ V(1, 1, 3),
- /* 1001 */ V(1, 1, 3),
- /* 1010 */ V(0, 1, 3),
- /* 1011 */ V(0, 1, 3),
- /* 1100 */ V(1, 0, 3),
- /* 1101 */ V(1, 0, 3),
- /* 1110 */ V(0, 0, 3),
- /* 1111 */ V(0, 0, 3),
-
- /* 0000 ... */
- /* 0000 */ PTR(50, 1), /* 16 */
- /* 0001 */ V(3, 5, 4),
- /* 0010 */ V(5, 3, 4),
- /* 0011 */ PTR(52, 1),
- /* 0100 */ V(4, 4, 4),
- /* 0101 */ V(2, 5, 4),
- /* 0110 */ V(5, 2, 4),
- /* 0111 */ V(1, 5, 4),
- /* 1000 */ V(5, 1, 3),
- /* 1001 */ V(5, 1, 3),
- /* 1010 */ V(3, 4, 3),
- /* 1011 */ V(3, 4, 3),
- /* 1100 */ V(4, 3, 3),
- /* 1101 */ V(4, 3, 3),
- /* 1110 */ V(5, 0, 4),
- /* 1111 */ V(0, 4, 4),
-
- /* 0001 ... */
- /* 000 */ V(2, 4, 3), /* 32 */
- /* 001 */ V(4, 2, 3),
- /* 010 */ V(3, 3, 3),
- /* 011 */ V(4, 0, 3),
- /* 100 */ V(1, 4, 2),
- /* 101 */ V(1, 4, 2),
- /* 110 */ V(4, 1, 2),
- /* 111 */ V(4, 1, 2),
-
- /* 0010 ... */
- /* 00 */ V(2, 3, 2), /* 40 */
- /* 01 */ V(3, 2, 2),
- /* 10 */ V(1, 3, 1),
- /* 11 */ V(1, 3, 1),
-
- /* 0011 ... */
- /* 00 */ V(3, 1, 1), /* 44 */
- /* 01 */ V(3, 1, 1),
- /* 10 */ V(0, 3, 2),
- /* 11 */ V(3, 0, 2),
-
- /* 0100 ... */
- /* 0 */ V(2, 2, 1), /* 48 */
- /* 1 */ V(0, 2, 1),
-
- /* 0000 0000 ... */
- /* 0 */ V(5, 5, 1), /* 50 */
- /* 1 */ V(4, 5, 1),
-
- /* 0000 0011 ... */
- /* 0 */ V(5, 4, 1), /* 52 */
- /* 1 */ V(0, 5, 1)
-};
-
-static
-union huffpair const hufftab10[] = {
- /* 0000 */ PTR(16, 4),
- /* 0001 */ PTR(32, 4),
- /* 0010 */ PTR(48, 2),
- /* 0011 */ V(1, 1, 4),
- /* 0100 */ V(0, 1, 3),
- /* 0101 */ V(0, 1, 3),
- /* 0110 */ V(1, 0, 3),
- /* 0111 */ V(1, 0, 3),
- /* 1000 */ V(0, 0, 1),
- /* 1001 */ V(0, 0, 1),
- /* 1010 */ V(0, 0, 1),
- /* 1011 */ V(0, 0, 1),
- /* 1100 */ V(0, 0, 1),
- /* 1101 */ V(0, 0, 1),
- /* 1110 */ V(0, 0, 1),
- /* 1111 */ V(0, 0, 1),
-
- /* 0000 ... */
- /* 0000 */ PTR(52, 3), /* 16 */
- /* 0001 */ PTR(60, 2),
- /* 0010 */ PTR(64, 3),
- /* 0011 */ PTR(72, 1),
- /* 0100 */ PTR(74, 2),
- /* 0101 */ PTR(78, 2),
- /* 0110 */ PTR(82, 2),
- /* 0111 */ V(1, 7, 4),
- /* 1000 */ V(7, 1, 4),
- /* 1001 */ PTR(86, 1),
- /* 1010 */ PTR(88, 2),
- /* 1011 */ PTR(92, 2),
- /* 1100 */ V(1, 6, 4),
- /* 1101 */ V(6, 1, 4),
- /* 1110 */ V(6, 0, 4),
- /* 1111 */ PTR(96, 1),
-
- /* 0001 ... */
- /* 0000 */ PTR(98, 1), /* 32 */
- /* 0001 */ PTR(100, 1),
- /* 0010 */ V(1, 4, 4),
- /* 0011 */ V(4, 1, 4),
- /* 0100 */ V(4, 0, 4),
- /* 0101 */ V(2, 3, 4),
- /* 0110 */ V(3, 2, 4),
- /* 0111 */ V(0, 3, 4),
- /* 1000 */ V(1, 3, 3),
- /* 1001 */ V(1, 3, 3),
- /* 1010 */ V(3, 1, 3),
- /* 1011 */ V(3, 1, 3),
- /* 1100 */ V(3, 0, 3),
- /* 1101 */ V(3, 0, 3),
- /* 1110 */ V(2, 2, 3),
- /* 1111 */ V(2, 2, 3),
-
- /* 0010 ... */
- /* 00 */ V(1, 2, 2), /* 48 */
- /* 01 */ V(2, 1, 2),
- /* 10 */ V(0, 2, 2),
- /* 11 */ V(2, 0, 2),
-
- /* 0000 0000 ... */
- /* 000 */ V(7, 7, 3), /* 52 */
- /* 001 */ V(6, 7, 3),
- /* 010 */ V(7, 6, 3),
- /* 011 */ V(5, 7, 3),
- /* 100 */ V(7, 5, 3),
- /* 101 */ V(6, 6, 3),
- /* 110 */ V(4, 7, 2),
- /* 111 */ V(4, 7, 2),
-
- /* 0000 0001 ... */
- /* 00 */ V(7, 4, 2), /* 60 */
- /* 01 */ V(5, 6, 2),
- /* 10 */ V(6, 5, 2),
- /* 11 */ V(3, 7, 2),
-
- /* 0000 0010 ... */
- /* 000 */ V(7, 3, 2), /* 64 */
- /* 001 */ V(7, 3, 2),
- /* 010 */ V(4, 6, 2),
- /* 011 */ V(4, 6, 2),
- /* 100 */ V(5, 5, 3),
- /* 101 */ V(5, 4, 3),
- /* 110 */ V(6, 3, 2),
- /* 111 */ V(6, 3, 2),
-
- /* 0000 0011 ... */
- /* 0 */ V(2, 7, 1), /* 72 */
- /* 1 */ V(7, 2, 1),
-
- /* 0000 0100 ... */
- /* 00 */ V(6, 4, 2), /* 74 */
- /* 01 */ V(0, 7, 2),
- /* 10 */ V(7, 0, 1),
- /* 11 */ V(7, 0, 1),
-
- /* 0000 0101 ... */
- /* 00 */ V(6, 2, 1), /* 78 */
- /* 01 */ V(6, 2, 1),
- /* 10 */ V(4, 5, 2),
- /* 11 */ V(3, 5, 2),
-
- /* 0000 0110 ... */
- /* 00 */ V(0, 6, 1), /* 82 */
- /* 01 */ V(0, 6, 1),
- /* 10 */ V(5, 3, 2),
- /* 11 */ V(4, 4, 2),
-
- /* 0000 1001 ... */
- /* 0 */ V(3, 6, 1), /* 86 */
- /* 1 */ V(2, 6, 1),
-
- /* 0000 1010 ... */
- /* 00 */ V(2, 5, 2), /* 88 */
- /* 01 */ V(5, 2, 2),
- /* 10 */ V(1, 5, 1),
- /* 11 */ V(1, 5, 1),
-
- /* 0000 1011 ... */
- /* 00 */ V(5, 1, 1), /* 92 */
- /* 01 */ V(5, 1, 1),
- /* 10 */ V(3, 4, 2),
- /* 11 */ V(4, 3, 2),
-
- /* 0000 1111 ... */
- /* 0 */ V(0, 5, 1), /* 96 */
- /* 1 */ V(5, 0, 1),
-
- /* 0001 0000 ... */
- /* 0 */ V(2, 4, 1), /* 98 */
- /* 1 */ V(4, 2, 1),
-
- /* 0001 0001 ... */
- /* 0 */ V(3, 3, 1), /* 100 */
- /* 1 */ V(0, 4, 1)
-};
-
-static
-union huffpair const hufftab11[] = {
- /* 0000 */ PTR(16, 4),
- /* 0001 */ PTR(32, 4),
- /* 0010 */ PTR(48, 4),
- /* 0011 */ PTR(64, 3),
- /* 0100 */ V(1, 2, 4),
- /* 0101 */ PTR(72, 1),
- /* 0110 */ V(1, 1, 3),
- /* 0111 */ V(1, 1, 3),
- /* 1000 */ V(0, 1, 3),
- /* 1001 */ V(0, 1, 3),
- /* 1010 */ V(1, 0, 3),
- /* 1011 */ V(1, 0, 3),
- /* 1100 */ V(0, 0, 2),
- /* 1101 */ V(0, 0, 2),
- /* 1110 */ V(0, 0, 2),
- /* 1111 */ V(0, 0, 2),
-
- /* 0000 ... */
- /* 0000 */ PTR(74, 2), /* 16 */
- /* 0001 */ PTR(78, 3),
- /* 0010 */ PTR(86, 2),
- /* 0011 */ PTR(90, 1),
- /* 0100 */ PTR(92, 2),
- /* 0101 */ V(2, 7, 4),
- /* 0110 */ V(7, 2, 4),
- /* 0111 */ PTR(96, 1),
- /* 1000 */ V(7, 1, 3),
- /* 1001 */ V(7, 1, 3),
- /* 1010 */ V(1, 7, 4),
- /* 1011 */ V(7, 0, 4),
- /* 1100 */ V(3, 6, 4),
- /* 1101 */ V(6, 3, 4),
- /* 1110 */ V(6, 0, 4),
- /* 1111 */ PTR(98, 1),
-
- /* 0001 ... */
- /* 0000 */ PTR(100, 1), /* 32 */
- /* 0001 */ V(1, 5, 4),
- /* 0010 */ V(6, 2, 3),
- /* 0011 */ V(6, 2, 3),
- /* 0100 */ V(2, 6, 4),
- /* 0101 */ V(0, 6, 4),
- /* 0110 */ V(1, 6, 3),
- /* 0111 */ V(1, 6, 3),
- /* 1000 */ V(6, 1, 3),
- /* 1001 */ V(6, 1, 3),
- /* 1010 */ V(5, 1, 4),
- /* 1011 */ V(3, 4, 4),
- /* 1100 */ V(5, 0, 4),
- /* 1101 */ PTR(102, 1),
- /* 1110 */ V(2, 4, 4),
- /* 1111 */ V(4, 2, 4),
-
- /* 0010 ... */
- /* 0000 */ V(1, 4, 4), /* 48 */
- /* 0001 */ V(4, 1, 4),
- /* 0010 */ V(0, 4, 4),
- /* 0011 */ V(4, 0, 4),
- /* 0100 */ V(2, 3, 3),
- /* 0101 */ V(2, 3, 3),
- /* 0110 */ V(3, 2, 3),
- /* 0111 */ V(3, 2, 3),
- /* 1000 */ V(1, 3, 2),
- /* 1001 */ V(1, 3, 2),
- /* 1010 */ V(1, 3, 2),
- /* 1011 */ V(1, 3, 2),
- /* 1100 */ V(3, 1, 2),
- /* 1101 */ V(3, 1, 2),
- /* 1110 */ V(3, 1, 2),
- /* 1111 */ V(3, 1, 2),
-
- /* 0011 ... */
- /* 000 */ V(0, 3, 3), /* 64 */
- /* 001 */ V(3, 0, 3),
- /* 010 */ V(2, 2, 2),
- /* 011 */ V(2, 2, 2),
- /* 100 */ V(2, 1, 1),
- /* 101 */ V(2, 1, 1),
- /* 110 */ V(2, 1, 1),
- /* 111 */ V(2, 1, 1),
-
- /* 0101 ... */
- /* 0 */ V(0, 2, 1), /* 72 */
- /* 1 */ V(2, 0, 1),
-
- /* 0000 0000 ... */
- /* 00 */ V(7, 7, 2), /* 74 */
- /* 01 */ V(6, 7, 2),
- /* 10 */ V(7, 6, 2),
- /* 11 */ V(7, 5, 2),
-
- /* 0000 0001 ... */
- /* 000 */ V(6, 6, 2), /* 78 */
- /* 001 */ V(6, 6, 2),
- /* 010 */ V(4, 7, 2),
- /* 011 */ V(4, 7, 2),
- /* 100 */ V(7, 4, 2),
- /* 101 */ V(7, 4, 2),
- /* 110 */ V(5, 7, 3),
- /* 111 */ V(5, 5, 3),
-
- /* 0000 0010 ... */
- /* 00 */ V(5, 6, 2), /* 86 */
- /* 01 */ V(6, 5, 2),
- /* 10 */ V(3, 7, 1),
- /* 11 */ V(3, 7, 1),
-
- /* 0000 0011 ... */
- /* 0 */ V(7, 3, 1), /* 90 */
- /* 1 */ V(4, 6, 1),
-
- /* 0000 0100 ... */
- /* 00 */ V(4, 5, 2), /* 92 */
- /* 01 */ V(5, 4, 2),
- /* 10 */ V(3, 5, 2),
- /* 11 */ V(5, 3, 2),
-
- /* 0000 0111 ... */
- /* 0 */ V(6, 4, 1), /* 96 */
- /* 1 */ V(0, 7, 1),
-
- /* 0000 1111 ... */
- /* 0 */ V(4, 4, 1), /* 98 */
- /* 1 */ V(2, 5, 1),
-
- /* 0001 0000 ... */
- /* 0 */ V(5, 2, 1), /* 100 */
- /* 1 */ V(0, 5, 1),
-
- /* 0001 1101 ... */
- /* 0 */ V(4, 3, 1), /* 102 */
- /* 1 */ V(3, 3, 1)
-};
-
-static
-union huffpair const hufftab12[] = {
- /* 0000 */ PTR(16, 4),
- /* 0001 */ PTR(32, 4),
- /* 0010 */ PTR(48, 4),
- /* 0011 */ PTR(64, 2),
- /* 0100 */ PTR(68, 3),
- /* 0101 */ PTR(76, 1),
- /* 0110 */ V(1, 2, 4),
- /* 0111 */ V(2, 1, 4),
- /* 1000 */ PTR(78, 1),
- /* 1001 */ V(0, 0, 4),
- /* 1010 */ V(1, 1, 3),
- /* 1011 */ V(1, 1, 3),
- /* 1100 */ V(0, 1, 3),
- /* 1101 */ V(0, 1, 3),
- /* 1110 */ V(1, 0, 3),
- /* 1111 */ V(1, 0, 3),
-
- /* 0000 ... */
- /* 0000 */ PTR(80, 2), /* 16 */
- /* 0001 */ PTR(84, 1),
- /* 0010 */ PTR(86, 1),
- /* 0011 */ PTR(88, 1),
- /* 0100 */ V(5, 6, 4),
- /* 0101 */ V(3, 7, 4),
- /* 0110 */ PTR(90, 1),
- /* 0111 */ V(2, 7, 4),
- /* 1000 */ V(7, 2, 4),
- /* 1001 */ V(4, 6, 4),
- /* 1010 */ V(6, 4, 4),
- /* 1011 */ V(1, 7, 4),
- /* 1100 */ V(7, 1, 4),
- /* 1101 */ PTR(92, 1),
- /* 1110 */ V(3, 6, 4),
- /* 1111 */ V(6, 3, 4),
-
- /* 0001 ... */
- /* 0000 */ V(4, 5, 4), /* 32 */
- /* 0001 */ V(5, 4, 4),
- /* 0010 */ V(4, 4, 4),
- /* 0011 */ PTR(94, 1),
- /* 0100 */ V(2, 6, 3),
- /* 0101 */ V(2, 6, 3),
- /* 0110 */ V(6, 2, 3),
- /* 0111 */ V(6, 2, 3),
- /* 1000 */ V(6, 1, 3),
- /* 1001 */ V(6, 1, 3),
- /* 1010 */ V(1, 6, 4),
- /* 1011 */ V(6, 0, 4),
- /* 1100 */ V(3, 5, 4),
- /* 1101 */ V(5, 3, 4),
- /* 1110 */ V(2, 5, 4),
- /* 1111 */ V(5, 2, 4),
-
- /* 0010 ... */
- /* 0000 */ V(1, 5, 3), /* 48 */
- /* 0001 */ V(1, 5, 3),
- /* 0010 */ V(5, 1, 3),
- /* 0011 */ V(5, 1, 3),
- /* 0100 */ V(3, 4, 3),
- /* 0101 */ V(3, 4, 3),
- /* 0110 */ V(4, 3, 3),
- /* 0111 */ V(4, 3, 3),
- /* 1000 */ V(5, 0, 4),
- /* 1001 */ V(0, 4, 4),
- /* 1010 */ V(2, 4, 3),
- /* 1011 */ V(2, 4, 3),
- /* 1100 */ V(4, 2, 3),
- /* 1101 */ V(4, 2, 3),
- /* 1110 */ V(1, 4, 3),
- /* 1111 */ V(1, 4, 3),
-
- /* 0011 ... */
- /* 00 */ V(3, 3, 2), /* 64 */
- /* 01 */ V(4, 1, 2),
- /* 10 */ V(2, 3, 2),
- /* 11 */ V(3, 2, 2),
-
- /* 0100 ... */
- /* 000 */ V(4, 0, 3), /* 68 */
- /* 001 */ V(0, 3, 3),
- /* 010 */ V(3, 0, 2),
- /* 011 */ V(3, 0, 2),
- /* 100 */ V(1, 3, 1),
- /* 101 */ V(1, 3, 1),
- /* 110 */ V(1, 3, 1),
- /* 111 */ V(1, 3, 1),
-
- /* 0101 ... */
- /* 0 */ V(3, 1, 1), /* 76 */
- /* 1 */ V(2, 2, 1),
-
- /* 1000 ... */
- /* 0 */ V(0, 2, 1), /* 78 */
- /* 1 */ V(2, 0, 1),
-
- /* 0000 0000 ... */
- /* 00 */ V(7, 7, 2), /* 80 */
- /* 01 */ V(6, 7, 2),
- /* 10 */ V(7, 6, 1),
- /* 11 */ V(7, 6, 1),
-
- /* 0000 0001 ... */
- /* 0 */ V(5, 7, 1), /* 84 */
- /* 1 */ V(7, 5, 1),
-
- /* 0000 0010 ... */
- /* 0 */ V(6, 6, 1), /* 86 */
- /* 1 */ V(4, 7, 1),
-
- /* 0000 0011 ... */
- /* 0 */ V(7, 4, 1), /* 88 */
- /* 1 */ V(6, 5, 1),
-
- /* 0000 0110 ... */
- /* 0 */ V(7, 3, 1), /* 90 */
- /* 1 */ V(5, 5, 1),
-
- /* 0000 1101 ... */
- /* 0 */ V(0, 7, 1), /* 92 */
- /* 1 */ V(7, 0, 1),
-
- /* 0001 0011 ... */
- /* 0 */ V(0, 6, 1), /* 94 */
- /* 1 */ V(0, 5, 1)
-};
-
-static
-union huffpair const hufftab13[] = {
- /* 0000 */ PTR(16, 4),
- /* 0001 */ PTR(32, 4),
- /* 0010 */ PTR(48, 4),
- /* 0011 */ PTR(64, 2),
- /* 0100 */ V(1, 1, 4),
- /* 0101 */ V(0, 1, 4),
- /* 0110 */ V(1, 0, 3),
- /* 0111 */ V(1, 0, 3),
- /* 1000 */ V(0, 0, 1),
- /* 1001 */ V(0, 0, 1),
- /* 1010 */ V(0, 0, 1),
- /* 1011 */ V(0, 0, 1),
- /* 1100 */ V(0, 0, 1),
- /* 1101 */ V(0, 0, 1),
- /* 1110 */ V(0, 0, 1),
- /* 1111 */ V(0, 0, 1),
-
- /* 0000 ... */
- /* 0000 */ PTR(68, 4), /* 16 */
- /* 0001 */ PTR(84, 4),
- /* 0010 */ PTR(100, 4),
- /* 0011 */ PTR(116, 4),
- /* 0100 */ PTR(132, 4),
- /* 0101 */ PTR(148, 4),
- /* 0110 */ PTR(164, 3),
- /* 0111 */ PTR(172, 3),
- /* 1000 */ PTR(180, 3),
- /* 1001 */ PTR(188, 3),
- /* 1010 */ PTR(196, 3),
- /* 1011 */ PTR(204, 3),
- /* 1100 */ PTR(212, 1),
- /* 1101 */ PTR(214, 2),
- /* 1110 */ PTR(218, 3),
- /* 1111 */ PTR(226, 1),
-
- /* 0001 ... */
- /* 0000 */ PTR(228, 2), /* 32 */
- /* 0001 */ PTR(232, 2),
- /* 0010 */ PTR(236, 2),
- /* 0011 */ PTR(240, 2),
- /* 0100 */ V(8, 1, 4),
- /* 0101 */ PTR(244, 1),
- /* 0110 */ PTR(246, 1),
- /* 0111 */ PTR(248, 1),
- /* 1000 */ PTR(250, 2),
- /* 1001 */ PTR(254, 1),
- /* 1010 */ V(1, 5, 4),
- /* 1011 */ V(5, 1, 4),
- /* 1100 */ PTR(256, 1),
- /* 1101 */ PTR(258, 1),
- /* 1110 */ PTR(260, 1),
- /* 1111 */ V(1, 4, 4),
-
- /* 0010 ... */
- /* 0000 */ V(4, 1, 3), /* 48 */
- /* 0001 */ V(4, 1, 3),
- /* 0010 */ V(0, 4, 4),
- /* 0011 */ V(4, 0, 4),
- /* 0100 */ V(2, 3, 4),
- /* 0101 */ V(3, 2, 4),
- /* 0110 */ V(1, 3, 3),
- /* 0111 */ V(1, 3, 3),
- /* 1000 */ V(3, 1, 3),
- /* 1001 */ V(3, 1, 3),
- /* 1010 */ V(0, 3, 3),
- /* 1011 */ V(0, 3, 3),
- /* 1100 */ V(3, 0, 3),
- /* 1101 */ V(3, 0, 3),
- /* 1110 */ V(2, 2, 3),
- /* 1111 */ V(2, 2, 3),
-
- /* 0011 ... */
- /* 00 */ V(1, 2, 2), /* 64 */
- /* 01 */ V(2, 1, 2),
- /* 10 */ V(0, 2, 2),
- /* 11 */ V(2, 0, 2),
-
- /* 0000 0000 ... */
- /* 0000 */ PTR(262, 4), /* 68 */
- /* 0001 */ PTR(278, 4),
- /* 0010 */ PTR(294, 4),
- /* 0011 */ PTR(310, 3),
- /* 0100 */ PTR(318, 2),
- /* 0101 */ PTR(322, 2),
- /* 0110 */ PTR(326, 3),
- /* 0111 */ PTR(334, 2),
- /* 1000 */ PTR(338, 1),
- /* 1001 */ PTR(340, 2),
- /* 1010 */ PTR(344, 2),
- /* 1011 */ PTR(348, 2),
- /* 1100 */ PTR(352, 2),
- /* 1101 */ PTR(356, 2),
- /* 1110 */ V(1, 15, 4),
- /* 1111 */ V(15, 1, 4),
-
- /* 0000 0001 ... */
- /* 0000 */ V(15, 0, 4), /* 84 */
- /* 0001 */ PTR(360, 1),
- /* 0010 */ PTR(362, 1),
- /* 0011 */ PTR(364, 1),
- /* 0100 */ V(14, 2, 4),
- /* 0101 */ PTR(366, 1),
- /* 0110 */ V(1, 14, 4),
- /* 0111 */ V(14, 1, 4),
- /* 1000 */ PTR(368, 1),
- /* 1001 */ PTR(370, 1),
- /* 1010 */ PTR(372, 1),
- /* 1011 */ PTR(374, 1),
- /* 1100 */ PTR(376, 1),
- /* 1101 */ PTR(378, 1),
- /* 1110 */ V(12, 6, 4),
- /* 1111 */ V(3, 13, 4),
-
- /* 0000 0010 ... */
- /* 0000 */ PTR(380, 1), /* 100 */
- /* 0001 */ V(2, 13, 4),
- /* 0010 */ V(13, 2, 4),
- /* 0011 */ V(1, 13, 4),
- /* 0100 */ V(11, 7, 4),
- /* 0101 */ PTR(382, 1),
- /* 0110 */ PTR(384, 1),
- /* 0111 */ V(12, 3, 4),
- /* 1000 */ PTR(386, 1),
- /* 1001 */ V(4, 11, 4),
- /* 1010 */ V(13, 1, 3),
- /* 1011 */ V(13, 1, 3),
- /* 1100 */ V(0, 13, 4),
- /* 1101 */ V(13, 0, 4),
- /* 1110 */ V(8, 10, 4),
- /* 1111 */ V(10, 8, 4),
-
- /* 0000 0011 ... */
- /* 0000 */ V(4, 12, 4), /* 116 */
- /* 0001 */ V(12, 4, 4),
- /* 0010 */ V(6, 11, 4),
- /* 0011 */ V(11, 6, 4),
- /* 0100 */ V(3, 12, 3),
- /* 0101 */ V(3, 12, 3),
- /* 0110 */ V(2, 12, 3),
- /* 0111 */ V(2, 12, 3),
- /* 1000 */ V(12, 2, 3),
- /* 1001 */ V(12, 2, 3),
- /* 1010 */ V(5, 11, 3),
- /* 1011 */ V(5, 11, 3),
- /* 1100 */ V(11, 5, 4),
- /* 1101 */ V(8, 9, 4),
- /* 1110 */ V(1, 12, 3),
- /* 1111 */ V(1, 12, 3),
-
- /* 0000 0100 ... */
- /* 0000 */ V(12, 1, 3), /* 132 */
- /* 0001 */ V(12, 1, 3),
- /* 0010 */ V(9, 8, 4),
- /* 0011 */ V(0, 12, 4),
- /* 0100 */ V(12, 0, 3),
- /* 0101 */ V(12, 0, 3),
- /* 0110 */ V(11, 4, 4),
- /* 0111 */ V(6, 10, 4),
- /* 1000 */ V(10, 6, 4),
- /* 1001 */ V(7, 9, 4),
- /* 1010 */ V(3, 11, 3),
- /* 1011 */ V(3, 11, 3),
- /* 1100 */ V(11, 3, 3),
- /* 1101 */ V(11, 3, 3),
- /* 1110 */ V(8, 8, 4),
- /* 1111 */ V(5, 10, 4),
-
- /* 0000 0101 ... */
- /* 0000 */ V(2, 11, 3), /* 148 */
- /* 0001 */ V(2, 11, 3),
- /* 0010 */ V(10, 5, 4),
- /* 0011 */ V(6, 9, 4),
- /* 0100 */ V(10, 4, 3),
- /* 0101 */ V(10, 4, 3),
- /* 0110 */ V(7, 8, 4),
- /* 0111 */ V(8, 7, 4),
- /* 1000 */ V(9, 4, 3),
- /* 1001 */ V(9, 4, 3),
- /* 1010 */ V(7, 7, 4),
- /* 1011 */ V(7, 6, 4),
- /* 1100 */ V(11, 2, 2),
- /* 1101 */ V(11, 2, 2),
- /* 1110 */ V(11, 2, 2),
- /* 1111 */ V(11, 2, 2),
-
- /* 0000 0110 ... */
- /* 000 */ V(1, 11, 2), /* 164 */
- /* 001 */ V(1, 11, 2),
- /* 010 */ V(11, 1, 2),
- /* 011 */ V(11, 1, 2),
- /* 100 */ V(0, 11, 3),
- /* 101 */ V(11, 0, 3),
- /* 110 */ V(9, 6, 3),
- /* 111 */ V(4, 10, 3),
-
- /* 0000 0111 ... */
- /* 000 */ V(3, 10, 3), /* 172 */
- /* 001 */ V(10, 3, 3),
- /* 010 */ V(5, 9, 3),
- /* 011 */ V(9, 5, 3),
- /* 100 */ V(2, 10, 2),
- /* 101 */ V(2, 10, 2),
- /* 110 */ V(10, 2, 2),
- /* 111 */ V(10, 2, 2),
-
- /* 0000 1000 ... */
- /* 000 */ V(1, 10, 2), /* 180 */
- /* 001 */ V(1, 10, 2),
- /* 010 */ V(10, 1, 2),
- /* 011 */ V(10, 1, 2),
- /* 100 */ V(0, 10, 3),
- /* 101 */ V(6, 8, 3),
- /* 110 */ V(10, 0, 2),
- /* 111 */ V(10, 0, 2),
-
- /* 0000 1001 ... */
- /* 000 */ V(8, 6, 3), /* 188 */
- /* 001 */ V(4, 9, 3),
- /* 010 */ V(9, 3, 2),
- /* 011 */ V(9, 3, 2),
- /* 100 */ V(3, 9, 3),
- /* 101 */ V(5, 8, 3),
- /* 110 */ V(8, 5, 3),
- /* 111 */ V(6, 7, 3),
-
- /* 0000 1010 ... */
- /* 000 */ V(2, 9, 2), /* 196 */
- /* 001 */ V(2, 9, 2),
- /* 010 */ V(9, 2, 2),
- /* 011 */ V(9, 2, 2),
- /* 100 */ V(5, 7, 3),
- /* 101 */ V(7, 5, 3),
- /* 110 */ V(3, 8, 2),
- /* 111 */ V(3, 8, 2),
-
- /* 0000 1011 ... */
- /* 000 */ V(8, 3, 2), /* 204 */
- /* 001 */ V(8, 3, 2),
- /* 010 */ V(6, 6, 3),
- /* 011 */ V(4, 7, 3),
- /* 100 */ V(7, 4, 3),
- /* 101 */ V(5, 6, 3),
- /* 110 */ V(6, 5, 3),
- /* 111 */ V(7, 3, 3),
-
- /* 0000 1100 ... */
- /* 0 */ V(1, 9, 1), /* 212 */
- /* 1 */ V(9, 1, 1),
-
- /* 0000 1101 ... */
- /* 00 */ V(0, 9, 2), /* 214 */
- /* 01 */ V(9, 0, 2),
- /* 10 */ V(4, 8, 2),
- /* 11 */ V(8, 4, 2),
-
- /* 0000 1110 ... */
- /* 000 */ V(7, 2, 2), /* 218 */
- /* 001 */ V(7, 2, 2),
- /* 010 */ V(4, 6, 3),
- /* 011 */ V(6, 4, 3),
- /* 100 */ V(2, 8, 1),
- /* 101 */ V(2, 8, 1),
- /* 110 */ V(2, 8, 1),
- /* 111 */ V(2, 8, 1),
-
- /* 0000 1111 ... */
- /* 0 */ V(8, 2, 1), /* 226 */
- /* 1 */ V(1, 8, 1),
-
- /* 0001 0000 ... */
- /* 00 */ V(3, 7, 2), /* 228 */
- /* 01 */ V(2, 7, 2),
- /* 10 */ V(1, 7, 1),
- /* 11 */ V(1, 7, 1),
-
- /* 0001 0001 ... */
- /* 00 */ V(7, 1, 1), /* 232 */
- /* 01 */ V(7, 1, 1),
- /* 10 */ V(5, 5, 2),
- /* 11 */ V(0, 7, 2),
-
- /* 0001 0010 ... */
- /* 00 */ V(7, 0, 2), /* 236 */
- /* 01 */ V(3, 6, 2),
- /* 10 */ V(6, 3, 2),
- /* 11 */ V(4, 5, 2),
-
- /* 0001 0011 ... */
- /* 00 */ V(5, 4, 2), /* 240 */
- /* 01 */ V(2, 6, 2),
- /* 10 */ V(6, 2, 2),
- /* 11 */ V(3, 5, 2),
-
- /* 0001 0101 ... */
- /* 0 */ V(0, 8, 1), /* 244 */
- /* 1 */ V(8, 0, 1),
-
- /* 0001 0110 ... */
- /* 0 */ V(1, 6, 1), /* 246 */
- /* 1 */ V(6, 1, 1),
-
- /* 0001 0111 ... */
- /* 0 */ V(0, 6, 1), /* 248 */
- /* 1 */ V(6, 0, 1),
-
- /* 0001 1000 ... */
- /* 00 */ V(5, 3, 2), /* 250 */
- /* 01 */ V(4, 4, 2),
- /* 10 */ V(2, 5, 1),
- /* 11 */ V(2, 5, 1),
-
- /* 0001 1001 ... */
- /* 0 */ V(5, 2, 1), /* 254 */
- /* 1 */ V(0, 5, 1),
-
- /* 0001 1100 ... */
- /* 0 */ V(3, 4, 1), /* 256 */
- /* 1 */ V(4, 3, 1),
-
- /* 0001 1101 ... */
- /* 0 */ V(5, 0, 1), /* 258 */
- /* 1 */ V(2, 4, 1),
-
- /* 0001 1110 ... */
- /* 0 */ V(4, 2, 1), /* 260 */
- /* 1 */ V(3, 3, 1),
-
- /* 0000 0000 0000 ... */
- /* 0000 */ PTR(388, 3), /* 262 */
- /* 0001 */ V(15, 15, 4),
- /* 0010 */ V(14, 15, 4),
- /* 0011 */ V(13, 15, 4),
- /* 0100 */ V(14, 14, 4),
- /* 0101 */ V(12, 15, 4),
- /* 0110 */ V(13, 14, 4),
- /* 0111 */ V(11, 15, 4),
- /* 1000 */ V(15, 11, 4),
- /* 1001 */ V(12, 14, 4),
- /* 1010 */ V(13, 12, 4),
- /* 1011 */ PTR(396, 1),
- /* 1100 */ V(14, 12, 3),
- /* 1101 */ V(14, 12, 3),
- /* 1110 */ V(13, 13, 3),
- /* 1111 */ V(13, 13, 3),
-
- /* 0000 0000 0001 ... */
- /* 0000 */ V(15, 10, 4), /* 278 */
- /* 0001 */ V(12, 13, 4),
- /* 0010 */ V(11, 14, 3),
- /* 0011 */ V(11, 14, 3),
- /* 0100 */ V(14, 11, 3),
- /* 0101 */ V(14, 11, 3),
- /* 0110 */ V(9, 15, 3),
- /* 0111 */ V(9, 15, 3),
- /* 1000 */ V(15, 9, 3),
- /* 1001 */ V(15, 9, 3),
- /* 1010 */ V(14, 10, 3),
- /* 1011 */ V(14, 10, 3),
- /* 1100 */ V(11, 13, 3),
- /* 1101 */ V(11, 13, 3),
- /* 1110 */ V(13, 11, 3),
- /* 1111 */ V(13, 11, 3),
-
- /* 0000 0000 0010 ... */
- /* 0000 */ V(8, 15, 3), /* 294 */
- /* 0001 */ V(8, 15, 3),
- /* 0010 */ V(15, 8, 3),
- /* 0011 */ V(15, 8, 3),
- /* 0100 */ V(12, 12, 3),
- /* 0101 */ V(12, 12, 3),
- /* 0110 */ V(10, 14, 4),
- /* 0111 */ V(9, 14, 4),
- /* 1000 */ V(8, 14, 3),
- /* 1001 */ V(8, 14, 3),
- /* 1010 */ V(7, 15, 4),
- /* 1011 */ V(7, 14, 4),
- /* 1100 */ V(15, 7, 2),
- /* 1101 */ V(15, 7, 2),
- /* 1110 */ V(15, 7, 2),
- /* 1111 */ V(15, 7, 2),
-
- /* 0000 0000 0011 ... */
- /* 000 */ V(13, 10, 2), /* 310 */
- /* 001 */ V(13, 10, 2),
- /* 010 */ V(10, 13, 3),
- /* 011 */ V(11, 12, 3),
- /* 100 */ V(12, 11, 3),
- /* 101 */ V(15, 6, 3),
- /* 110 */ V(6, 15, 2),
- /* 111 */ V(6, 15, 2),
-
- /* 0000 0000 0100 ... */
- /* 00 */ V(14, 8, 2), /* 318 */
- /* 01 */ V(5, 15, 2),
- /* 10 */ V(9, 13, 2),
- /* 11 */ V(13, 9, 2),
-
- /* 0000 0000 0101 ... */
- /* 00 */ V(15, 5, 2), /* 322 */
- /* 01 */ V(14, 7, 2),
- /* 10 */ V(10, 12, 2),
- /* 11 */ V(11, 11, 2),
-
- /* 0000 0000 0110 ... */
- /* 000 */ V(4, 15, 2), /* 326 */
- /* 001 */ V(4, 15, 2),
- /* 010 */ V(15, 4, 2),
- /* 011 */ V(15, 4, 2),
- /* 100 */ V(12, 10, 3),
- /* 101 */ V(14, 6, 3),
- /* 110 */ V(15, 3, 2),
- /* 111 */ V(15, 3, 2),
-
- /* 0000 0000 0111 ... */
- /* 00 */ V(3, 15, 1), /* 334 */
- /* 01 */ V(3, 15, 1),
- /* 10 */ V(8, 13, 2),
- /* 11 */ V(13, 8, 2),
-
- /* 0000 0000 1000 ... */
- /* 0 */ V(2, 15, 1), /* 338 */
- /* 1 */ V(15, 2, 1),
-
- /* 0000 0000 1001 ... */
- /* 00 */ V(6, 14, 2), /* 340 */
- /* 01 */ V(9, 12, 2),
- /* 10 */ V(0, 15, 1),
- /* 11 */ V(0, 15, 1),
-
- /* 0000 0000 1010 ... */
- /* 00 */ V(12, 9, 2), /* 344 */
- /* 01 */ V(5, 14, 2),
- /* 10 */ V(10, 11, 1),
- /* 11 */ V(10, 11, 1),
-
- /* 0000 0000 1011 ... */
- /* 00 */ V(7, 13, 2), /* 348 */
- /* 01 */ V(13, 7, 2),
- /* 10 */ V(4, 14, 1),
- /* 11 */ V(4, 14, 1),
-
- /* 0000 0000 1100 ... */
- /* 00 */ V(12, 8, 2), /* 352 */
- /* 01 */ V(13, 6, 2),
- /* 10 */ V(3, 14, 1),
- /* 11 */ V(3, 14, 1),
-
- /* 0000 0000 1101 ... */
- /* 00 */ V(11, 9, 1), /* 356 */
- /* 01 */ V(11, 9, 1),
- /* 10 */ V(9, 11, 2),
- /* 11 */ V(10, 10, 2),
-
- /* 0000 0001 0001 ... */
- /* 0 */ V(11, 10, 1), /* 360 */
- /* 1 */ V(14, 5, 1),
-
- /* 0000 0001 0010 ... */
- /* 0 */ V(14, 4, 1), /* 362 */
- /* 1 */ V(8, 12, 1),
-
- /* 0000 0001 0011 ... */
- /* 0 */ V(6, 13, 1), /* 364 */
- /* 1 */ V(14, 3, 1),
-
- /* 0000 0001 0101 ... */
- /* 0 */ V(2, 14, 1), /* 366 */
- /* 1 */ V(0, 14, 1),
-
- /* 0000 0001 1000 ... */
- /* 0 */ V(14, 0, 1), /* 368 */
- /* 1 */ V(5, 13, 1),
-
- /* 0000 0001 1001 ... */
- /* 0 */ V(13, 5, 1), /* 370 */
- /* 1 */ V(7, 12, 1),
-
- /* 0000 0001 1010 ... */
- /* 0 */ V(12, 7, 1), /* 372 */
- /* 1 */ V(4, 13, 1),
-
- /* 0000 0001 1011 ... */
- /* 0 */ V(8, 11, 1), /* 374 */
- /* 1 */ V(11, 8, 1),
-
- /* 0000 0001 1100 ... */
- /* 0 */ V(13, 4, 1), /* 376 */
- /* 1 */ V(9, 10, 1),
-
- /* 0000 0001 1101 ... */
- /* 0 */ V(10, 9, 1), /* 378 */
- /* 1 */ V(6, 12, 1),
-
- /* 0000 0010 0000 ... */
- /* 0 */ V(13, 3, 1), /* 380 */
- /* 1 */ V(7, 11, 1),
-
- /* 0000 0010 0101 ... */
- /* 0 */ V(5, 12, 1), /* 382 */
- /* 1 */ V(12, 5, 1),
-
- /* 0000 0010 0110 ... */
- /* 0 */ V(9, 9, 1), /* 384 */
- /* 1 */ V(7, 10, 1),
-
- /* 0000 0010 1000 ... */
- /* 0 */ V(10, 7, 1), /* 386 */
- /* 1 */ V(9, 7, 1),
-
- /* 0000 0000 0000 0000 ... */
- /* 000 */ V(15, 14, 3), /* 388 */
- /* 001 */ V(15, 12, 3),
- /* 010 */ V(15, 13, 2),
- /* 011 */ V(15, 13, 2),
- /* 100 */ V(14, 13, 1),
- /* 101 */ V(14, 13, 1),
- /* 110 */ V(14, 13, 1),
- /* 111 */ V(14, 13, 1),
-
- /* 0000 0000 0000 1011 ... */
- /* 0 */ V(10, 15, 1), /* 396 */
- /* 1 */ V(14, 9, 1)
-};
-
-static
-union huffpair const hufftab15[] = {
- /* 0000 */ PTR(16, 4),
- /* 0001 */ PTR(32, 4),
- /* 0010 */ PTR(48, 4),
- /* 0011 */ PTR(64, 4),
- /* 0100 */ PTR(80, 4),
- /* 0101 */ PTR(96, 3),
- /* 0110 */ PTR(104, 3),
- /* 0111 */ PTR(112, 2),
- /* 1000 */ PTR(116, 1),
- /* 1001 */ PTR(118, 1),
- /* 1010 */ V(1, 1, 3),
- /* 1011 */ V(1, 1, 3),
- /* 1100 */ V(0, 1, 4),
- /* 1101 */ V(1, 0, 4),
- /* 1110 */ V(0, 0, 3),
- /* 1111 */ V(0, 0, 3),
-
- /* 0000 ... */
- /* 0000 */ PTR(120, 4), /* 16 */
- /* 0001 */ PTR(136, 4),
- /* 0010 */ PTR(152, 4),
- /* 0011 */ PTR(168, 4),
- /* 0100 */ PTR(184, 4),
- /* 0101 */ PTR(200, 3),
- /* 0110 */ PTR(208, 3),
- /* 0111 */ PTR(216, 4),
- /* 1000 */ PTR(232, 3),
- /* 1001 */ PTR(240, 3),
- /* 1010 */ PTR(248, 3),
- /* 1011 */ PTR(256, 3),
- /* 1100 */ PTR(264, 2),
- /* 1101 */ PTR(268, 3),
- /* 1110 */ PTR(276, 3),
- /* 1111 */ PTR(284, 2),
-
- /* 0001 ... */
- /* 0000 */ PTR(288, 2), /* 32 */
- /* 0001 */ PTR(292, 2),
- /* 0010 */ PTR(296, 2),
- /* 0011 */ PTR(300, 2),
- /* 0100 */ PTR(304, 2),
- /* 0101 */ PTR(308, 2),
- /* 0110 */ PTR(312, 2),
- /* 0111 */ PTR(316, 2),
- /* 1000 */ PTR(320, 1),
- /* 1001 */ PTR(322, 1),
- /* 1010 */ PTR(324, 1),
- /* 1011 */ PTR(326, 2),
- /* 1100 */ PTR(330, 1),
- /* 1101 */ PTR(332, 1),
- /* 1110 */ PTR(334, 2),
- /* 1111 */ PTR(338, 1),
-
- /* 0010 ... */
- /* 0000 */ PTR(340, 1), /* 48 */
- /* 0001 */ PTR(342, 1),
- /* 0010 */ V(9, 1, 4),
- /* 0011 */ PTR(344, 1),
- /* 0100 */ PTR(346, 1),
- /* 0101 */ PTR(348, 1),
- /* 0110 */ PTR(350, 1),
- /* 0111 */ PTR(352, 1),
- /* 1000 */ V(2, 8, 4),
- /* 1001 */ V(8, 2, 4),
- /* 1010 */ V(1, 8, 4),
- /* 1011 */ V(8, 1, 4),
- /* 1100 */ PTR(354, 1),
- /* 1101 */ PTR(356, 1),
- /* 1110 */ PTR(358, 1),
- /* 1111 */ PTR(360, 1),
-
- /* 0011 ... */
- /* 0000 */ V(2, 7, 4), /* 64 */
- /* 0001 */ V(7, 2, 4),
- /* 0010 */ V(6, 4, 4),
- /* 0011 */ V(1, 7, 4),
- /* 0100 */ V(5, 5, 4),
- /* 0101 */ V(7, 1, 4),
- /* 0110 */ PTR(362, 1),
- /* 0111 */ V(3, 6, 4),
- /* 1000 */ V(6, 3, 4),
- /* 1001 */ V(4, 5, 4),
- /* 1010 */ V(5, 4, 4),
- /* 1011 */ V(2, 6, 4),
- /* 1100 */ V(6, 2, 4),
- /* 1101 */ V(1, 6, 4),
- /* 1110 */ PTR(364, 1),
- /* 1111 */ V(3, 5, 4),
-
- /* 0100 ... */
- /* 0000 */ V(6, 1, 3), /* 80 */
- /* 0001 */ V(6, 1, 3),
- /* 0010 */ V(5, 3, 4),
- /* 0011 */ V(4, 4, 4),
- /* 0100 */ V(2, 5, 3),
- /* 0101 */ V(2, 5, 3),
- /* 0110 */ V(5, 2, 3),
- /* 0111 */ V(5, 2, 3),
- /* 1000 */ V(1, 5, 3),
- /* 1001 */ V(1, 5, 3),
- /* 1010 */ V(5, 1, 3),
- /* 1011 */ V(5, 1, 3),
- /* 1100 */ V(0, 5, 4),
- /* 1101 */ V(5, 0, 4),
- /* 1110 */ V(3, 4, 3),
- /* 1111 */ V(3, 4, 3),
-
- /* 0101 ... */
- /* 000 */ V(4, 3, 3), /* 96 */
- /* 001 */ V(2, 4, 3),
- /* 010 */ V(4, 2, 3),
- /* 011 */ V(3, 3, 3),
- /* 100 */ V(4, 1, 2),
- /* 101 */ V(4, 1, 2),
- /* 110 */ V(1, 4, 3),
- /* 111 */ V(0, 4, 3),
-
- /* 0110 ... */
- /* 000 */ V(2, 3, 2), /* 104 */
- /* 001 */ V(2, 3, 2),
- /* 010 */ V(3, 2, 2),
- /* 011 */ V(3, 2, 2),
- /* 100 */ V(4, 0, 3),
- /* 101 */ V(0, 3, 3),
- /* 110 */ V(1, 3, 2),
- /* 111 */ V(1, 3, 2),
-
- /* 0111 ... */
- /* 00 */ V(3, 1, 2), /* 112 */
- /* 01 */ V(3, 0, 2),
- /* 10 */ V(2, 2, 1),
- /* 11 */ V(2, 2, 1),
-
- /* 1000 ... */
- /* 0 */ V(1, 2, 1), /* 116 */
- /* 1 */ V(2, 1, 1),
-
- /* 1001 ... */
- /* 0 */ V(0, 2, 1), /* 118 */
- /* 1 */ V(2, 0, 1),
-
- /* 0000 0000 ... */
- /* 0000 */ PTR(366, 1), /* 120 */
- /* 0001 */ PTR(368, 1),
- /* 0010 */ V(14, 14, 4),
- /* 0011 */ PTR(370, 1),
- /* 0100 */ PTR(372, 1),
- /* 0101 */ PTR(374, 1),
- /* 0110 */ V(15, 11, 4),
- /* 0111 */ PTR(376, 1),
- /* 1000 */ V(13, 13, 4),
- /* 1001 */ V(10, 15, 4),
- /* 1010 */ V(15, 10, 4),
- /* 1011 */ V(11, 14, 4),
- /* 1100 */ V(14, 11, 4),
- /* 1101 */ V(12, 13, 4),
- /* 1110 */ V(13, 12, 4),
- /* 1111 */ V(9, 15, 4),
-
- /* 0000 0001 ... */
- /* 0000 */ V(15, 9, 4), /* 136 */
- /* 0001 */ V(14, 10, 4),
- /* 0010 */ V(11, 13, 4),
- /* 0011 */ V(13, 11, 4),
- /* 0100 */ V(8, 15, 4),
- /* 0101 */ V(15, 8, 4),
- /* 0110 */ V(12, 12, 4),
- /* 0111 */ V(9, 14, 4),
- /* 1000 */ V(14, 9, 4),
- /* 1001 */ V(7, 15, 4),
- /* 1010 */ V(15, 7, 4),
- /* 1011 */ V(10, 13, 4),
- /* 1100 */ V(13, 10, 4),
- /* 1101 */ V(11, 12, 4),
- /* 1110 */ V(6, 15, 4),
- /* 1111 */ PTR(378, 1),
-
- /* 0000 0010 ... */
- /* 0000 */ V(12, 11, 3), /* 152 */
- /* 0001 */ V(12, 11, 3),
- /* 0010 */ V(15, 6, 3),
- /* 0011 */ V(15, 6, 3),
- /* 0100 */ V(8, 14, 4),
- /* 0101 */ V(14, 8, 4),
- /* 0110 */ V(5, 15, 4),
- /* 0111 */ V(9, 13, 4),
- /* 1000 */ V(15, 5, 3),
- /* 1001 */ V(15, 5, 3),
- /* 1010 */ V(7, 14, 3),
- /* 1011 */ V(7, 14, 3),
- /* 1100 */ V(14, 7, 3),
- /* 1101 */ V(14, 7, 3),
- /* 1110 */ V(10, 12, 3),
- /* 1111 */ V(10, 12, 3),
-
- /* 0000 0011 ... */
- /* 0000 */ V(12, 10, 3), /* 168 */
- /* 0001 */ V(12, 10, 3),
- /* 0010 */ V(11, 11, 3),
- /* 0011 */ V(11, 11, 3),
- /* 0100 */ V(13, 9, 4),
- /* 0101 */ V(8, 13, 4),
- /* 0110 */ V(4, 15, 3),
- /* 0111 */ V(4, 15, 3),
- /* 1000 */ V(15, 4, 3),
- /* 1001 */ V(15, 4, 3),
- /* 1010 */ V(3, 15, 3),
- /* 1011 */ V(3, 15, 3),
- /* 1100 */ V(15, 3, 3),
- /* 1101 */ V(15, 3, 3),
- /* 1110 */ V(13, 8, 3),
- /* 1111 */ V(13, 8, 3),
-
- /* 0000 0100 ... */
- /* 0000 */ V(14, 6, 3), /* 184 */
- /* 0001 */ V(14, 6, 3),
- /* 0010 */ V(2, 15, 3),
- /* 0011 */ V(2, 15, 3),
- /* 0100 */ V(15, 2, 3),
- /* 0101 */ V(15, 2, 3),
- /* 0110 */ V(6, 14, 4),
- /* 0111 */ V(15, 0, 4),
- /* 1000 */ V(1, 15, 3),
- /* 1001 */ V(1, 15, 3),
- /* 1010 */ V(15, 1, 3),
- /* 1011 */ V(15, 1, 3),
- /* 1100 */ V(9, 12, 3),
- /* 1101 */ V(9, 12, 3),
- /* 1110 */ V(12, 9, 3),
- /* 1111 */ V(12, 9, 3),
-
- /* 0000 0101 ... */
- /* 000 */ V(5, 14, 3), /* 200 */
- /* 001 */ V(10, 11, 3),
- /* 010 */ V(11, 10, 3),
- /* 011 */ V(14, 5, 3),
- /* 100 */ V(7, 13, 3),
- /* 101 */ V(13, 7, 3),
- /* 110 */ V(4, 14, 3),
- /* 111 */ V(14, 4, 3),
-
- /* 0000 0110 ... */
- /* 000 */ V(8, 12, 3), /* 208 */
- /* 001 */ V(12, 8, 3),
- /* 010 */ V(3, 14, 3),
- /* 011 */ V(6, 13, 3),
- /* 100 */ V(13, 6, 3),
- /* 101 */ V(14, 3, 3),
- /* 110 */ V(9, 11, 3),
- /* 111 */ V(11, 9, 3),
-
- /* 0000 0111 ... */
- /* 0000 */ V(2, 14, 3), /* 216 */
- /* 0001 */ V(2, 14, 3),
- /* 0010 */ V(10, 10, 3),
- /* 0011 */ V(10, 10, 3),
- /* 0100 */ V(14, 2, 3),
- /* 0101 */ V(14, 2, 3),
- /* 0110 */ V(1, 14, 3),
- /* 0111 */ V(1, 14, 3),
- /* 1000 */ V(14, 1, 3),
- /* 1001 */ V(14, 1, 3),
- /* 1010 */ V(0, 14, 4),
- /* 1011 */ V(14, 0, 4),
- /* 1100 */ V(5, 13, 3),
- /* 1101 */ V(5, 13, 3),
- /* 1110 */ V(13, 5, 3),
- /* 1111 */ V(13, 5, 3),
-
- /* 0000 1000 ... */
- /* 000 */ V(7, 12, 3), /* 232 */
- /* 001 */ V(12, 7, 3),
- /* 010 */ V(4, 13, 3),
- /* 011 */ V(8, 11, 3),
- /* 100 */ V(13, 4, 2),
- /* 101 */ V(13, 4, 2),
- /* 110 */ V(11, 8, 3),
- /* 111 */ V(9, 10, 3),
-
- /* 0000 1001 ... */
- /* 000 */ V(10, 9, 3), /* 240 */
- /* 001 */ V(6, 12, 3),
- /* 010 */ V(12, 6, 3),
- /* 011 */ V(3, 13, 3),
- /* 100 */ V(13, 3, 2),
- /* 101 */ V(13, 3, 2),
- /* 110 */ V(13, 2, 2),
- /* 111 */ V(13, 2, 2),
-
- /* 0000 1010 ... */
- /* 000 */ V(2, 13, 3), /* 248 */
- /* 001 */ V(0, 13, 3),
- /* 010 */ V(1, 13, 2),
- /* 011 */ V(1, 13, 2),
- /* 100 */ V(7, 11, 2),
- /* 101 */ V(7, 11, 2),
- /* 110 */ V(11, 7, 2),
- /* 111 */ V(11, 7, 2),
-
- /* 0000 1011 ... */
- /* 000 */ V(13, 1, 2), /* 256 */
- /* 001 */ V(13, 1, 2),
- /* 010 */ V(5, 12, 3),
- /* 011 */ V(13, 0, 3),
- /* 100 */ V(12, 5, 2),
- /* 101 */ V(12, 5, 2),
- /* 110 */ V(8, 10, 2),
- /* 111 */ V(8, 10, 2),
-
- /* 0000 1100 ... */
- /* 00 */ V(10, 8, 2), /* 264 */
- /* 01 */ V(4, 12, 2),
- /* 10 */ V(12, 4, 2),
- /* 11 */ V(6, 11, 2),
-
- /* 0000 1101 ... */
- /* 000 */ V(11, 6, 2), /* 268 */
- /* 001 */ V(11, 6, 2),
- /* 010 */ V(9, 9, 3),
- /* 011 */ V(0, 12, 3),
- /* 100 */ V(3, 12, 2),
- /* 101 */ V(3, 12, 2),
- /* 110 */ V(12, 3, 2),
- /* 111 */ V(12, 3, 2),
-
- /* 0000 1110 ... */
- /* 000 */ V(7, 10, 2), /* 276 */
- /* 001 */ V(7, 10, 2),
- /* 010 */ V(10, 7, 2),
- /* 011 */ V(10, 7, 2),
- /* 100 */ V(10, 6, 2),
- /* 101 */ V(10, 6, 2),
- /* 110 */ V(12, 0, 3),
- /* 111 */ V(0, 11, 3),
-
- /* 0000 1111 ... */
- /* 00 */ V(12, 2, 1), /* 284 */
- /* 01 */ V(12, 2, 1),
- /* 10 */ V(2, 12, 2),
- /* 11 */ V(5, 11, 2),
-
- /* 0001 0000 ... */
- /* 00 */ V(11, 5, 2), /* 288 */
- /* 01 */ V(1, 12, 2),
- /* 10 */ V(8, 9, 2),
- /* 11 */ V(9, 8, 2),
-
- /* 0001 0001 ... */
- /* 00 */ V(12, 1, 2), /* 292 */
- /* 01 */ V(4, 11, 2),
- /* 10 */ V(11, 4, 2),
- /* 11 */ V(6, 10, 2),
-
- /* 0001 0010 ... */
- /* 00 */ V(3, 11, 2), /* 296 */
- /* 01 */ V(7, 9, 2),
- /* 10 */ V(11, 3, 1),
- /* 11 */ V(11, 3, 1),
-
- /* 0001 0011 ... */
- /* 00 */ V(9, 7, 2), /* 300 */
- /* 01 */ V(8, 8, 2),
- /* 10 */ V(2, 11, 2),
- /* 11 */ V(5, 10, 2),
-
- /* 0001 0100 ... */
- /* 00 */ V(11, 2, 1), /* 304 */
- /* 01 */ V(11, 2, 1),
- /* 10 */ V(10, 5, 2),
- /* 11 */ V(1, 11, 2),
-
- /* 0001 0101 ... */
- /* 00 */ V(11, 1, 1), /* 308 */
- /* 01 */ V(11, 1, 1),
- /* 10 */ V(11, 0, 2),
- /* 11 */ V(6, 9, 2),
-
- /* 0001 0110 ... */
- /* 00 */ V(9, 6, 2), /* 312 */
- /* 01 */ V(4, 10, 2),
- /* 10 */ V(10, 4, 2),
- /* 11 */ V(7, 8, 2),
-
- /* 0001 0111 ... */
- /* 00 */ V(8, 7, 2), /* 316 */
- /* 01 */ V(3, 10, 2),
- /* 10 */ V(10, 3, 1),
- /* 11 */ V(10, 3, 1),
-
- /* 0001 1000 ... */
- /* 0 */ V(5, 9, 1), /* 320 */
- /* 1 */ V(9, 5, 1),
-
- /* 0001 1001 ... */
- /* 0 */ V(2, 10, 1), /* 322 */
- /* 1 */ V(10, 2, 1),
-
- /* 0001 1010 ... */
- /* 0 */ V(1, 10, 1), /* 324 */
- /* 1 */ V(10, 1, 1),
-
- /* 0001 1011 ... */
- /* 00 */ V(0, 10, 2), /* 326 */
- /* 01 */ V(10, 0, 2),
- /* 10 */ V(6, 8, 1),
- /* 11 */ V(6, 8, 1),
-
- /* 0001 1100 ... */
- /* 0 */ V(8, 6, 1), /* 330 */
- /* 1 */ V(4, 9, 1),
-
- /* 0001 1101 ... */
- /* 0 */ V(9, 4, 1), /* 332 */
- /* 1 */ V(3, 9, 1),
-
- /* 0001 1110 ... */
- /* 00 */ V(9, 3, 1), /* 334 */
- /* 01 */ V(9, 3, 1),
- /* 10 */ V(7, 7, 2),
- /* 11 */ V(0, 9, 2),
-
- /* 0001 1111 ... */
- /* 0 */ V(5, 8, 1), /* 338 */
- /* 1 */ V(8, 5, 1),
-
- /* 0010 0000 ... */
- /* 0 */ V(2, 9, 1), /* 340 */
- /* 1 */ V(6, 7, 1),
-
- /* 0010 0001 ... */
- /* 0 */ V(7, 6, 1), /* 342 */
- /* 1 */ V(9, 2, 1),
-
- /* 0010 0011 ... */
- /* 0 */ V(1, 9, 1), /* 344 */
- /* 1 */ V(9, 0, 1),
-
- /* 0010 0100 ... */
- /* 0 */ V(4, 8, 1), /* 346 */
- /* 1 */ V(8, 4, 1),
-
- /* 0010 0101 ... */
- /* 0 */ V(5, 7, 1), /* 348 */
- /* 1 */ V(7, 5, 1),
-
- /* 0010 0110 ... */
- /* 0 */ V(3, 8, 1), /* 350 */
- /* 1 */ V(8, 3, 1),
-
- /* 0010 0111 ... */
- /* 0 */ V(6, 6, 1), /* 352 */
- /* 1 */ V(4, 7, 1),
-
- /* 0010 1100 ... */
- /* 0 */ V(7, 4, 1), /* 354 */
- /* 1 */ V(0, 8, 1),
-
- /* 0010 1101 ... */
- /* 0 */ V(8, 0, 1), /* 356 */
- /* 1 */ V(5, 6, 1),
-
- /* 0010 1110 ... */
- /* 0 */ V(6, 5, 1), /* 358 */
- /* 1 */ V(3, 7, 1),
-
- /* 0010 1111 ... */
- /* 0 */ V(7, 3, 1), /* 360 */
- /* 1 */ V(4, 6, 1),
-
- /* 0011 0110 ... */
- /* 0 */ V(0, 7, 1), /* 362 */
- /* 1 */ V(7, 0, 1),
-
- /* 0011 1110 ... */
- /* 0 */ V(0, 6, 1), /* 364 */
- /* 1 */ V(6, 0, 1),
-
- /* 0000 0000 0000 ... */
- /* 0 */ V(15, 15, 1), /* 366 */
- /* 1 */ V(14, 15, 1),
-
- /* 0000 0000 0001 ... */
- /* 0 */ V(15, 14, 1), /* 368 */
- /* 1 */ V(13, 15, 1),
-
- /* 0000 0000 0011 ... */
- /* 0 */ V(15, 13, 1), /* 370 */
- /* 1 */ V(12, 15, 1),
-
- /* 0000 0000 0100 ... */
- /* 0 */ V(15, 12, 1), /* 372 */
- /* 1 */ V(13, 14, 1),
-
- /* 0000 0000 0101 ... */
- /* 0 */ V(14, 13, 1), /* 374 */
- /* 1 */ V(11, 15, 1),
-
- /* 0000 0000 0111 ... */
- /* 0 */ V(12, 14, 1), /* 376 */
- /* 1 */ V(14, 12, 1),
-
- /* 0000 0001 1111 ... */
- /* 0 */ V(10, 14, 1), /* 378 */
- /* 1 */ V(0, 15, 1)
-};
-
-static
-union huffpair const hufftab16[] = {
- /* 0000 */ PTR(16, 4),
- /* 0001 */ PTR(32, 4),
- /* 0010 */ PTR(48, 4),
- /* 0011 */ PTR(64, 2),
- /* 0100 */ V(1, 1, 4),
- /* 0101 */ V(0, 1, 4),
- /* 0110 */ V(1, 0, 3),
- /* 0111 */ V(1, 0, 3),
- /* 1000 */ V(0, 0, 1),
- /* 1001 */ V(0, 0, 1),
- /* 1010 */ V(0, 0, 1),
- /* 1011 */ V(0, 0, 1),
- /* 1100 */ V(0, 0, 1),
- /* 1101 */ V(0, 0, 1),
- /* 1110 */ V(0, 0, 1),
- /* 1111 */ V(0, 0, 1),
-
- /* 0000 ... */
- /* 0000 */ PTR(68, 3), /* 16 */
- /* 0001 */ PTR(76, 3),
- /* 0010 */ PTR(84, 2),
- /* 0011 */ V(15, 15, 4),
- /* 0100 */ PTR(88, 2),
- /* 0101 */ PTR(92, 1),
- /* 0110 */ PTR(94, 4),
- /* 0111 */ V(15, 2, 4),
- /* 1000 */ PTR(110, 1),
- /* 1001 */ V(1, 15, 4),
- /* 1010 */ V(15, 1, 4),
- /* 1011 */ PTR(112, 4),
- /* 1100 */ PTR(128, 4),
- /* 1101 */ PTR(144, 4),
- /* 1110 */ PTR(160, 4),
- /* 1111 */ PTR(176, 4),
-
- /* 0001 ... */
- /* 0000 */ PTR(192, 4), /* 32 */
- /* 0001 */ PTR(208, 3),
- /* 0010 */ PTR(216, 3),
- /* 0011 */ PTR(224, 3),
- /* 0100 */ PTR(232, 3),
- /* 0101 */ PTR(240, 3),
- /* 0110 */ PTR(248, 3),
- /* 0111 */ PTR(256, 3),
- /* 1000 */ PTR(264, 2),
- /* 1001 */ PTR(268, 2),
- /* 1010 */ PTR(272, 1),
- /* 1011 */ PTR(274, 2),
- /* 1100 */ PTR(278, 2),
- /* 1101 */ PTR(282, 1),
- /* 1110 */ V(5, 1, 4),
- /* 1111 */ PTR(284, 1),
-
- /* 0010 ... */
- /* 0000 */ PTR(286, 1), /* 48 */
- /* 0001 */ PTR(288, 1),
- /* 0010 */ PTR(290, 1),
- /* 0011 */ V(1, 4, 4),
- /* 0100 */ V(4, 1, 4),
- /* 0101 */ PTR(292, 1),
- /* 0110 */ V(2, 3, 4),
- /* 0111 */ V(3, 2, 4),
- /* 1000 */ V(1, 3, 3),
- /* 1001 */ V(1, 3, 3),
- /* 1010 */ V(3, 1, 3),
- /* 1011 */ V(3, 1, 3),
- /* 1100 */ V(0, 3, 4),
- /* 1101 */ V(3, 0, 4),
- /* 1110 */ V(2, 2, 3),
- /* 1111 */ V(2, 2, 3),
-
- /* 0011 ... */
- /* 00 */ V(1, 2, 2), /* 64 */
- /* 01 */ V(2, 1, 2),
- /* 10 */ V(0, 2, 2),
- /* 11 */ V(2, 0, 2),
-
- /* 0000 0000 ... */
- /* 000 */ V(14, 15, 3), /* 68 */
- /* 001 */ V(15, 14, 3),
- /* 010 */ V(13, 15, 3),
- /* 011 */ V(15, 13, 3),
- /* 100 */ V(12, 15, 3),
- /* 101 */ V(15, 12, 3),
- /* 110 */ V(11, 15, 3),
- /* 111 */ V(15, 11, 3),
-
- /* 0000 0001 ... */
- /* 000 */ V(10, 15, 2), /* 76 */
- /* 001 */ V(10, 15, 2),
- /* 010 */ V(15, 10, 3),
- /* 011 */ V(9, 15, 3),
- /* 100 */ V(15, 9, 3),
- /* 101 */ V(15, 8, 3),
- /* 110 */ V(8, 15, 2),
- /* 111 */ V(8, 15, 2),
-
- /* 0000 0010 ... */
- /* 00 */ V(7, 15, 2), /* 84 */
- /* 01 */ V(15, 7, 2),
- /* 10 */ V(6, 15, 2),
- /* 11 */ V(15, 6, 2),
-
- /* 0000 0100 ... */
- /* 00 */ V(5, 15, 2), /* 88 */
- /* 01 */ V(15, 5, 2),
- /* 10 */ V(4, 15, 1),
- /* 11 */ V(4, 15, 1),
-
- /* 0000 0101 ... */
- /* 0 */ V(15, 4, 1), /* 92 */
- /* 1 */ V(15, 3, 1),
-
- /* 0000 0110 ... */
- /* 0000 */ V(15, 0, 1), /* 94 */
- /* 0001 */ V(15, 0, 1),
- /* 0010 */ V(15, 0, 1),
- /* 0011 */ V(15, 0, 1),
- /* 0100 */ V(15, 0, 1),
- /* 0101 */ V(15, 0, 1),
- /* 0110 */ V(15, 0, 1),
- /* 0111 */ V(15, 0, 1),
- /* 1000 */ V(3, 15, 2),
- /* 1001 */ V(3, 15, 2),
- /* 1010 */ V(3, 15, 2),
- /* 1011 */ V(3, 15, 2),
- /* 1100 */ PTR(294, 4),
- /* 1101 */ PTR(310, 3),
- /* 1110 */ PTR(318, 3),
- /* 1111 */ PTR(326, 3),
-
- /* 0000 1000 ... */
- /* 0 */ V(2, 15, 1), /* 110 */
- /* 1 */ V(0, 15, 1),
-
- /* 0000 1011 ... */
- /* 0000 */ PTR(334, 2), /* 112 */
- /* 0001 */ PTR(338, 2),
- /* 0010 */ PTR(342, 2),
- /* 0011 */ PTR(346, 1),
- /* 0100 */ PTR(348, 2),
- /* 0101 */ PTR(352, 2),
- /* 0110 */ PTR(356, 1),
- /* 0111 */ PTR(358, 2),
- /* 1000 */ PTR(362, 2),
- /* 1001 */ PTR(366, 2),
- /* 1010 */ PTR(370, 2),
- /* 1011 */ V(14, 3, 4),
- /* 1100 */ PTR(374, 1),
- /* 1101 */ PTR(376, 1),
- /* 1110 */ PTR(378, 1),
- /* 1111 */ PTR(380, 1),
-
- /* 0000 1100 ... */
- /* 0000 */ PTR(382, 1), /* 128 */
- /* 0001 */ PTR(384, 1),
- /* 0010 */ PTR(386, 1),
- /* 0011 */ V(0, 13, 4),
- /* 0100 */ PTR(388, 1),
- /* 0101 */ PTR(390, 1),
- /* 0110 */ PTR(392, 1),
- /* 0111 */ V(3, 12, 4),
- /* 1000 */ PTR(394, 1),
- /* 1001 */ V(1, 12, 4),
- /* 1010 */ V(12, 0, 4),
- /* 1011 */ PTR(396, 1),
- /* 1100 */ V(14, 2, 3),
- /* 1101 */ V(14, 2, 3),
- /* 1110 */ V(2, 14, 4),
- /* 1111 */ V(1, 14, 4),
-
- /* 0000 1101 ... */
- /* 0000 */ V(13, 3, 4), /* 144 */
- /* 0001 */ V(2, 13, 4),
- /* 0010 */ V(13, 2, 4),
- /* 0011 */ V(13, 1, 4),
- /* 0100 */ V(3, 11, 4),
- /* 0101 */ PTR(398, 1),
- /* 0110 */ V(1, 13, 3),
- /* 0111 */ V(1, 13, 3),
- /* 1000 */ V(12, 4, 4),
- /* 1001 */ V(6, 11, 4),
- /* 1010 */ V(12, 3, 4),
- /* 1011 */ V(10, 7, 4),
- /* 1100 */ V(2, 12, 3),
- /* 1101 */ V(2, 12, 3),
- /* 1110 */ V(12, 2, 4),
- /* 1111 */ V(11, 5, 4),
-
- /* 0000 1110 ... */
- /* 0000 */ V(12, 1, 4), /* 160 */
- /* 0001 */ V(0, 12, 4),
- /* 0010 */ V(4, 11, 4),
- /* 0011 */ V(11, 4, 4),
- /* 0100 */ V(6, 10, 4),
- /* 0101 */ V(10, 6, 4),
- /* 0110 */ V(11, 3, 3),
- /* 0111 */ V(11, 3, 3),
- /* 1000 */ V(5, 10, 4),
- /* 1001 */ V(10, 5, 4),
- /* 1010 */ V(2, 11, 3),
- /* 1011 */ V(2, 11, 3),
- /* 1100 */ V(11, 2, 3),
- /* 1101 */ V(11, 2, 3),
- /* 1110 */ V(1, 11, 3),
- /* 1111 */ V(1, 11, 3),
-
- /* 0000 1111 ... */
- /* 0000 */ V(11, 1, 3), /* 176 */
- /* 0001 */ V(11, 1, 3),
- /* 0010 */ V(0, 11, 4),
- /* 0011 */ V(11, 0, 4),
- /* 0100 */ V(6, 9, 4),
- /* 0101 */ V(9, 6, 4),
- /* 0110 */ V(4, 10, 4),
- /* 0111 */ V(10, 4, 4),
- /* 1000 */ V(7, 8, 4),
- /* 1001 */ V(8, 7, 4),
- /* 1010 */ V(10, 3, 3),
- /* 1011 */ V(10, 3, 3),
- /* 1100 */ V(3, 10, 4),
- /* 1101 */ V(5, 9, 4),
- /* 1110 */ V(2, 10, 3),
- /* 1111 */ V(2, 10, 3),
-
- /* 0001 0000 ... */
- /* 0000 */ V(9, 5, 4), /* 192 */
- /* 0001 */ V(6, 8, 4),
- /* 0010 */ V(10, 1, 3),
- /* 0011 */ V(10, 1, 3),
- /* 0100 */ V(8, 6, 4),
- /* 0101 */ V(7, 7, 4),
- /* 0110 */ V(9, 4, 3),
- /* 0111 */ V(9, 4, 3),
- /* 1000 */ V(4, 9, 4),
- /* 1001 */ V(5, 7, 4),
- /* 1010 */ V(6, 7, 3),
- /* 1011 */ V(6, 7, 3),
- /* 1100 */ V(10, 2, 2),
- /* 1101 */ V(10, 2, 2),
- /* 1110 */ V(10, 2, 2),
- /* 1111 */ V(10, 2, 2),
-
- /* 0001 0001 ... */
- /* 000 */ V(1, 10, 2), /* 208 */
- /* 001 */ V(1, 10, 2),
- /* 010 */ V(0, 10, 3),
- /* 011 */ V(10, 0, 3),
- /* 100 */ V(3, 9, 3),
- /* 101 */ V(9, 3, 3),
- /* 110 */ V(5, 8, 3),
- /* 111 */ V(8, 5, 3),
-
- /* 0001 0010 ... */
- /* 000 */ V(2, 9, 2), /* 216 */
- /* 001 */ V(2, 9, 2),
- /* 010 */ V(9, 2, 2),
- /* 011 */ V(9, 2, 2),
- /* 100 */ V(7, 6, 3),
- /* 101 */ V(0, 9, 3),
- /* 110 */ V(1, 9, 2),
- /* 111 */ V(1, 9, 2),
-
- /* 0001 0011 ... */
- /* 000 */ V(9, 1, 2), /* 224 */
- /* 001 */ V(9, 1, 2),
- /* 010 */ V(9, 0, 3),
- /* 011 */ V(4, 8, 3),
- /* 100 */ V(8, 4, 3),
- /* 101 */ V(7, 5, 3),
- /* 110 */ V(3, 8, 3),
- /* 111 */ V(8, 3, 3),
-
- /* 0001 0100 ... */
- /* 000 */ V(6, 6, 3), /* 232 */
- /* 001 */ V(2, 8, 3),
- /* 010 */ V(8, 2, 2),
- /* 011 */ V(8, 2, 2),
- /* 100 */ V(4, 7, 3),
- /* 101 */ V(7, 4, 3),
- /* 110 */ V(1, 8, 2),
- /* 111 */ V(1, 8, 2),
-
- /* 0001 0101 ... */
- /* 000 */ V(8, 1, 2), /* 240 */
- /* 001 */ V(8, 1, 2),
- /* 010 */ V(8, 0, 2),
- /* 011 */ V(8, 0, 2),
- /* 100 */ V(0, 8, 3),
- /* 101 */ V(5, 6, 3),
- /* 110 */ V(3, 7, 2),
- /* 111 */ V(3, 7, 2),
-
- /* 0001 0110 ... */
- /* 000 */ V(7, 3, 2), /* 248 */
- /* 001 */ V(7, 3, 2),
- /* 010 */ V(6, 5, 3),
- /* 011 */ V(4, 6, 3),
- /* 100 */ V(2, 7, 2),
- /* 101 */ V(2, 7, 2),
- /* 110 */ V(7, 2, 2),
- /* 111 */ V(7, 2, 2),
-
- /* 0001 0111 ... */
- /* 000 */ V(6, 4, 3), /* 256 */
- /* 001 */ V(5, 5, 3),
- /* 010 */ V(0, 7, 2),
- /* 011 */ V(0, 7, 2),
- /* 100 */ V(1, 7, 1),
- /* 101 */ V(1, 7, 1),
- /* 110 */ V(1, 7, 1),
- /* 111 */ V(1, 7, 1),
-
- /* 0001 1000 ... */
- /* 00 */ V(7, 1, 1), /* 264 */
- /* 01 */ V(7, 1, 1),
- /* 10 */ V(7, 0, 2),
- /* 11 */ V(3, 6, 2),
-
- /* 0001 1001 ... */
- /* 00 */ V(6, 3, 2), /* 268 */
- /* 01 */ V(4, 5, 2),
- /* 10 */ V(5, 4, 2),
- /* 11 */ V(2, 6, 2),
-
- /* 0001 1010 ... */
- /* 0 */ V(6, 2, 1), /* 272 */
- /* 1 */ V(1, 6, 1),
-
- /* 0001 1011 ... */
- /* 00 */ V(6, 1, 1), /* 274 */
- /* 01 */ V(6, 1, 1),
- /* 10 */ V(0, 6, 2),
- /* 11 */ V(6, 0, 2),
-
- /* 0001 1100 ... */
- /* 00 */ V(5, 3, 1), /* 278 */
- /* 01 */ V(5, 3, 1),
- /* 10 */ V(3, 5, 2),
- /* 11 */ V(4, 4, 2),
-
- /* 0001 1101 ... */
- /* 0 */ V(2, 5, 1), /* 282 */
- /* 1 */ V(5, 2, 1),
-
- /* 0001 1111 ... */
- /* 0 */ V(1, 5, 1), /* 284 */
- /* 1 */ V(0, 5, 1),
-
- /* 0010 0000 ... */
- /* 0 */ V(3, 4, 1), /* 286 */
- /* 1 */ V(4, 3, 1),
-
- /* 0010 0001 ... */
- /* 0 */ V(5, 0, 1), /* 288 */
- /* 1 */ V(2, 4, 1),
-
- /* 0010 0010 ... */
- /* 0 */ V(4, 2, 1), /* 290 */
- /* 1 */ V(3, 3, 1),
-
- /* 0010 0101 ... */
- /* 0 */ V(0, 4, 1), /* 292 */
- /* 1 */ V(4, 0, 1),
-
- /* 0000 0110 1100 ... */
- /* 0000 */ V(12, 14, 4), /* 294 */
- /* 0001 */ PTR(400, 1),
- /* 0010 */ V(13, 14, 3),
- /* 0011 */ V(13, 14, 3),
- /* 0100 */ V(14, 9, 3),
- /* 0101 */ V(14, 9, 3),
- /* 0110 */ V(14, 10, 4),
- /* 0111 */ V(13, 9, 4),
- /* 1000 */ V(14, 14, 2),
- /* 1001 */ V(14, 14, 2),
- /* 1010 */ V(14, 14, 2),
- /* 1011 */ V(14, 14, 2),
- /* 1100 */ V(14, 13, 3),
- /* 1101 */ V(14, 13, 3),
- /* 1110 */ V(14, 11, 3),
- /* 1111 */ V(14, 11, 3),
-
- /* 0000 0110 1101 ... */
- /* 000 */ V(11, 14, 2), /* 310 */
- /* 001 */ V(11, 14, 2),
- /* 010 */ V(12, 13, 2),
- /* 011 */ V(12, 13, 2),
- /* 100 */ V(13, 12, 3),
- /* 101 */ V(13, 11, 3),
- /* 110 */ V(10, 14, 2),
- /* 111 */ V(10, 14, 2),
-
- /* 0000 0110 1110 ... */
- /* 000 */ V(12, 12, 2), /* 318 */
- /* 001 */ V(12, 12, 2),
- /* 010 */ V(10, 13, 3),
- /* 011 */ V(13, 10, 3),
- /* 100 */ V(7, 14, 3),
- /* 101 */ V(10, 12, 3),
- /* 110 */ V(12, 10, 2),
- /* 111 */ V(12, 10, 2),
-
- /* 0000 0110 1111 ... */
- /* 000 */ V(12, 9, 3), /* 326 */
- /* 001 */ V(7, 13, 3),
- /* 010 */ V(5, 14, 2),
- /* 011 */ V(5, 14, 2),
- /* 100 */ V(11, 13, 1),
- /* 101 */ V(11, 13, 1),
- /* 110 */ V(11, 13, 1),
- /* 111 */ V(11, 13, 1),
-
- /* 0000 1011 0000 ... */
- /* 00 */ V(9, 14, 1), /* 334 */
- /* 01 */ V(9, 14, 1),
- /* 10 */ V(11, 12, 2),
- /* 11 */ V(12, 11, 2),
-
- /* 0000 1011 0001 ... */
- /* 00 */ V(8, 14, 2), /* 338 */
- /* 01 */ V(14, 8, 2),
- /* 10 */ V(9, 13, 2),
- /* 11 */ V(14, 7, 2),
-
- /* 0000 1011 0010 ... */
- /* 00 */ V(11, 11, 2), /* 342 */
- /* 01 */ V(8, 13, 2),
- /* 10 */ V(13, 8, 2),
- /* 11 */ V(6, 14, 2),
-
- /* 0000 1011 0011 ... */
- /* 0 */ V(14, 6, 1), /* 346 */
- /* 1 */ V(9, 12, 1),
-
- /* 0000 1011 0100 ... */
- /* 00 */ V(10, 11, 2), /* 348 */
- /* 01 */ V(11, 10, 2),
- /* 10 */ V(14, 5, 2),
- /* 11 */ V(13, 7, 2),
-
- /* 0000 1011 0101 ... */
- /* 00 */ V(4, 14, 1), /* 352 */
- /* 01 */ V(4, 14, 1),
- /* 10 */ V(14, 4, 2),
- /* 11 */ V(8, 12, 2),
-
- /* 0000 1011 0110 ... */
- /* 0 */ V(12, 8, 1), /* 356 */
- /* 1 */ V(3, 14, 1),
-
- /* 0000 1011 0111 ... */
- /* 00 */ V(6, 13, 1), /* 358 */
- /* 01 */ V(6, 13, 1),
- /* 10 */ V(13, 6, 2),
- /* 11 */ V(9, 11, 2),
-
- /* 0000 1011 1000 ... */
- /* 00 */ V(11, 9, 2), /* 362 */
- /* 01 */ V(10, 10, 2),
- /* 10 */ V(14, 1, 1),
- /* 11 */ V(14, 1, 1),
-
- /* 0000 1011 1001 ... */
- /* 00 */ V(13, 4, 1), /* 366 */
- /* 01 */ V(13, 4, 1),
- /* 10 */ V(11, 8, 2),
- /* 11 */ V(10, 9, 2),
-
- /* 0000 1011 1010 ... */
- /* 00 */ V(7, 11, 1), /* 370 */
- /* 01 */ V(7, 11, 1),
- /* 10 */ V(11, 7, 2),
- /* 11 */ V(13, 0, 2),
-
- /* 0000 1011 1100 ... */
- /* 0 */ V(0, 14, 1), /* 374 */
- /* 1 */ V(14, 0, 1),
-
- /* 0000 1011 1101 ... */
- /* 0 */ V(5, 13, 1), /* 376 */
- /* 1 */ V(13, 5, 1),
-
- /* 0000 1011 1110 ... */
- /* 0 */ V(7, 12, 1), /* 378 */
- /* 1 */ V(12, 7, 1),
-
- /* 0000 1011 1111 ... */
- /* 0 */ V(4, 13, 1), /* 380 */
- /* 1 */ V(8, 11, 1),
-
- /* 0000 1100 0000 ... */
- /* 0 */ V(9, 10, 1), /* 382 */
- /* 1 */ V(6, 12, 1),
-
- /* 0000 1100 0001 ... */
- /* 0 */ V(12, 6, 1), /* 384 */
- /* 1 */ V(3, 13, 1),
-
- /* 0000 1100 0010 ... */
- /* 0 */ V(5, 12, 1), /* 386 */
- /* 1 */ V(12, 5, 1),
-
- /* 0000 1100 0100 ... */
- /* 0 */ V(8, 10, 1), /* 388 */
- /* 1 */ V(10, 8, 1),
-
- /* 0000 1100 0101 ... */
- /* 0 */ V(9, 9, 1), /* 390 */
- /* 1 */ V(4, 12, 1),
-
- /* 0000 1100 0110 ... */
- /* 0 */ V(11, 6, 1), /* 392 */
- /* 1 */ V(7, 10, 1),
-
- /* 0000 1100 1000 ... */
- /* 0 */ V(5, 11, 1), /* 394 */
- /* 1 */ V(8, 9, 1),
-
- /* 0000 1100 1011 ... */
- /* 0 */ V(9, 8, 1), /* 396 */
- /* 1 */ V(7, 9, 1),
-
- /* 0000 1101 0101 ... */
- /* 0 */ V(9, 7, 1), /* 398 */
- /* 1 */ V(8, 8, 1),
-
- /* 0000 0110 1100 0001 ... */
- /* 0 */ V(14, 12, 1), /* 400 */
- /* 1 */ V(13, 13, 1)
-};
-
-static
-union huffpair const hufftab24[] = {
- /* 0000 */ PTR(16, 4),
- /* 0001 */ PTR(32, 4),
- /* 0010 */ PTR(48, 4),
- /* 0011 */ V(15, 15, 4),
- /* 0100 */ PTR(64, 4),
- /* 0101 */ PTR(80, 4),
- /* 0110 */ PTR(96, 4),
- /* 0111 */ PTR(112, 4),
- /* 1000 */ PTR(128, 4),
- /* 1001 */ PTR(144, 4),
- /* 1010 */ PTR(160, 3),
- /* 1011 */ PTR(168, 2),
- /* 1100 */ V(1, 1, 4),
- /* 1101 */ V(0, 1, 4),
- /* 1110 */ V(1, 0, 4),
- /* 1111 */ V(0, 0, 4),
-
- /* 0000 ... */
- /* 0000 */ V(14, 15, 4), /* 16 */
- /* 0001 */ V(15, 14, 4),
- /* 0010 */ V(13, 15, 4),
- /* 0011 */ V(15, 13, 4),
- /* 0100 */ V(12, 15, 4),
- /* 0101 */ V(15, 12, 4),
- /* 0110 */ V(11, 15, 4),
- /* 0111 */ V(15, 11, 4),
- /* 1000 */ V(15, 10, 3),
- /* 1001 */ V(15, 10, 3),
- /* 1010 */ V(10, 15, 4),
- /* 1011 */ V(9, 15, 4),
- /* 1100 */ V(15, 9, 3),
- /* 1101 */ V(15, 9, 3),
- /* 1110 */ V(15, 8, 3),
- /* 1111 */ V(15, 8, 3),
-
- /* 0001 ... */
- /* 0000 */ V(8, 15, 4), /* 32 */
- /* 0001 */ V(7, 15, 4),
- /* 0010 */ V(15, 7, 3),
- /* 0011 */ V(15, 7, 3),
- /* 0100 */ V(6, 15, 3),
- /* 0101 */ V(6, 15, 3),
- /* 0110 */ V(15, 6, 3),
- /* 0111 */ V(15, 6, 3),
- /* 1000 */ V(5, 15, 3),
- /* 1001 */ V(5, 15, 3),
- /* 1010 */ V(15, 5, 3),
- /* 1011 */ V(15, 5, 3),
- /* 1100 */ V(4, 15, 3),
- /* 1101 */ V(4, 15, 3),
- /* 1110 */ V(15, 4, 3),
- /* 1111 */ V(15, 4, 3),
-
- /* 0010 ... */
- /* 0000 */ V(3, 15, 3), /* 48 */
- /* 0001 */ V(3, 15, 3),
- /* 0010 */ V(15, 3, 3),
- /* 0011 */ V(15, 3, 3),
- /* 0100 */ V(2, 15, 3),
- /* 0101 */ V(2, 15, 3),
- /* 0110 */ V(15, 2, 3),
- /* 0111 */ V(15, 2, 3),
- /* 1000 */ V(15, 1, 3),
- /* 1001 */ V(15, 1, 3),
- /* 1010 */ V(1, 15, 4),
- /* 1011 */ V(15, 0, 4),
- /* 1100 */ PTR(172, 3),
- /* 1101 */ PTR(180, 3),
- /* 1110 */ PTR(188, 3),
- /* 1111 */ PTR(196, 3),
-
- /* 0100 ... */
- /* 0000 */ PTR(204, 4), /* 64 */
- /* 0001 */ PTR(220, 3),
- /* 0010 */ PTR(228, 3),
- /* 0011 */ PTR(236, 3),
- /* 0100 */ PTR(244, 2),
- /* 0101 */ PTR(248, 2),
- /* 0110 */ PTR(252, 2),
- /* 0111 */ PTR(256, 2),
- /* 1000 */ PTR(260, 2),
- /* 1001 */ PTR(264, 2),
- /* 1010 */ PTR(268, 2),
- /* 1011 */ PTR(272, 2),
- /* 1100 */ PTR(276, 2),
- /* 1101 */ PTR(280, 3),
- /* 1110 */ PTR(288, 2),
- /* 1111 */ PTR(292, 2),
-
- /* 0101 ... */
- /* 0000 */ PTR(296, 2), /* 80 */
- /* 0001 */ PTR(300, 3),
- /* 0010 */ PTR(308, 2),
- /* 0011 */ PTR(312, 3),
- /* 0100 */ PTR(320, 1),
- /* 0101 */ PTR(322, 2),
- /* 0110 */ PTR(326, 2),
- /* 0111 */ PTR(330, 1),
- /* 1000 */ PTR(332, 2),
- /* 1001 */ PTR(336, 1),
- /* 1010 */ PTR(338, 1),
- /* 1011 */ PTR(340, 1),
- /* 1100 */ PTR(342, 1),
- /* 1101 */ PTR(344, 1),
- /* 1110 */ PTR(346, 1),
- /* 1111 */ PTR(348, 1),
-
- /* 0110 ... */
- /* 0000 */ PTR(350, 1), /* 96 */
- /* 0001 */ PTR(352, 1),
- /* 0010 */ PTR(354, 1),
- /* 0011 */ PTR(356, 1),
- /* 0100 */ PTR(358, 1),
- /* 0101 */ PTR(360, 1),
- /* 0110 */ PTR(362, 1),
- /* 0111 */ PTR(364, 1),
- /* 1000 */ PTR(366, 1),
- /* 1001 */ PTR(368, 1),
- /* 1010 */ PTR(370, 2),
- /* 1011 */ PTR(374, 1),
- /* 1100 */ PTR(376, 2),
- /* 1101 */ V(7, 3, 4),
- /* 1110 */ PTR(380, 1),
- /* 1111 */ V(7, 2, 4),
-
- /* 0111 ... */
- /* 0000 */ V(4, 6, 4), /* 112 */
- /* 0001 */ V(6, 4, 4),
- /* 0010 */ V(5, 5, 4),
- /* 0011 */ V(7, 1, 4),
- /* 0100 */ V(3, 6, 4),
- /* 0101 */ V(6, 3, 4),
- /* 0110 */ V(4, 5, 4),
- /* 0111 */ V(5, 4, 4),
- /* 1000 */ V(2, 6, 4),
- /* 1001 */ V(6, 2, 4),
- /* 1010 */ V(1, 6, 4),
- /* 1011 */ V(6, 1, 4),
- /* 1100 */ PTR(382, 1),
- /* 1101 */ V(3, 5, 4),
- /* 1110 */ V(5, 3, 4),
- /* 1111 */ V(4, 4, 4),
-
- /* 1000 ... */
- /* 0000 */ V(2, 5, 4), /* 128 */
- /* 0001 */ V(5, 2, 4),
- /* 0010 */ V(1, 5, 4),
- /* 0011 */ PTR(384, 1),
- /* 0100 */ V(5, 1, 3),
- /* 0101 */ V(5, 1, 3),
- /* 0110 */ V(3, 4, 4),
- /* 0111 */ V(4, 3, 4),
- /* 1000 */ V(2, 4, 3),
- /* 1001 */ V(2, 4, 3),
- /* 1010 */ V(4, 2, 3),
- /* 1011 */ V(4, 2, 3),
- /* 1100 */ V(3, 3, 3),
- /* 1101 */ V(3, 3, 3),
- /* 1110 */ V(1, 4, 3),
- /* 1111 */ V(1, 4, 3),
-
- /* 1001 ... */
- /* 0000 */ V(4, 1, 3), /* 144 */
- /* 0001 */ V(4, 1, 3),
- /* 0010 */ V(0, 4, 4),
- /* 0011 */ V(4, 0, 4),
- /* 0100 */ V(2, 3, 3),
- /* 0101 */ V(2, 3, 3),
- /* 0110 */ V(3, 2, 3),
- /* 0111 */ V(3, 2, 3),
- /* 1000 */ V(1, 3, 2),
- /* 1001 */ V(1, 3, 2),
- /* 1010 */ V(1, 3, 2),
- /* 1011 */ V(1, 3, 2),
- /* 1100 */ V(3, 1, 2),
- /* 1101 */ V(3, 1, 2),
- /* 1110 */ V(3, 1, 2),
- /* 1111 */ V(3, 1, 2),
-
- /* 1010 ... */
- /* 000 */ V(0, 3, 3), /* 160 */
- /* 001 */ V(3, 0, 3),
- /* 010 */ V(2, 2, 2),
- /* 011 */ V(2, 2, 2),
- /* 100 */ V(1, 2, 1),
- /* 101 */ V(1, 2, 1),
- /* 110 */ V(1, 2, 1),
- /* 111 */ V(1, 2, 1),
-
- /* 1011 ... */
- /* 00 */ V(2, 1, 1), /* 168 */
- /* 01 */ V(2, 1, 1),
- /* 10 */ V(0, 2, 2),
- /* 11 */ V(2, 0, 2),
-
- /* 0010 1100 ... */
- /* 000 */ V(0, 15, 1), /* 172 */
- /* 001 */ V(0, 15, 1),
- /* 010 */ V(0, 15, 1),
- /* 011 */ V(0, 15, 1),
- /* 100 */ V(14, 14, 3),
- /* 101 */ V(13, 14, 3),
- /* 110 */ V(14, 13, 3),
- /* 111 */ V(12, 14, 3),
-
- /* 0010 1101 ... */
- /* 000 */ V(14, 12, 3), /* 180 */
- /* 001 */ V(13, 13, 3),
- /* 010 */ V(11, 14, 3),
- /* 011 */ V(14, 11, 3),
- /* 100 */ V(12, 13, 3),
- /* 101 */ V(13, 12, 3),
- /* 110 */ V(10, 14, 3),
- /* 111 */ V(14, 10, 3),
-
- /* 0010 1110 ... */
- /* 000 */ V(11, 13, 3), /* 188 */
- /* 001 */ V(13, 11, 3),
- /* 010 */ V(12, 12, 3),
- /* 011 */ V(9, 14, 3),
- /* 100 */ V(14, 9, 3),
- /* 101 */ V(10, 13, 3),
- /* 110 */ V(13, 10, 3),
- /* 111 */ V(11, 12, 3),
-
- /* 0010 1111 ... */
- /* 000 */ V(12, 11, 3), /* 196 */
- /* 001 */ V(8, 14, 3),
- /* 010 */ V(14, 8, 3),
- /* 011 */ V(9, 13, 3),
- /* 100 */ V(13, 9, 3),
- /* 101 */ V(7, 14, 3),
- /* 110 */ V(14, 7, 3),
- /* 111 */ V(10, 12, 3),
-
- /* 0100 0000 ... */
- /* 0000 */ V(12, 10, 3), /* 204 */
- /* 0001 */ V(12, 10, 3),
- /* 0010 */ V(11, 11, 3),
- /* 0011 */ V(11, 11, 3),
- /* 0100 */ V(8, 13, 3),
- /* 0101 */ V(8, 13, 3),
- /* 0110 */ V(13, 8, 3),
- /* 0111 */ V(13, 8, 3),
- /* 1000 */ V(0, 14, 4),
- /* 1001 */ V(14, 0, 4),
- /* 1010 */ V(0, 13, 3),
- /* 1011 */ V(0, 13, 3),
- /* 1100 */ V(14, 6, 2),
- /* 1101 */ V(14, 6, 2),
- /* 1110 */ V(14, 6, 2),
- /* 1111 */ V(14, 6, 2),
-
- /* 0100 0001 ... */
- /* 000 */ V(6, 14, 3), /* 220 */
- /* 001 */ V(9, 12, 3),
- /* 010 */ V(12, 9, 2),
- /* 011 */ V(12, 9, 2),
- /* 100 */ V(5, 14, 2),
- /* 101 */ V(5, 14, 2),
- /* 110 */ V(11, 10, 2),
- /* 111 */ V(11, 10, 2),
-
- /* 0100 0010 ... */
- /* 000 */ V(14, 5, 2), /* 228 */
- /* 001 */ V(14, 5, 2),
- /* 010 */ V(10, 11, 3),
- /* 011 */ V(7, 13, 3),
- /* 100 */ V(13, 7, 2),
- /* 101 */ V(13, 7, 2),
- /* 110 */ V(14, 4, 2),
- /* 111 */ V(14, 4, 2),
-
- /* 0100 0011 ... */
- /* 000 */ V(8, 12, 2), /* 236 */
- /* 001 */ V(8, 12, 2),
- /* 010 */ V(12, 8, 2),
- /* 011 */ V(12, 8, 2),
- /* 100 */ V(4, 14, 3),
- /* 101 */ V(2, 14, 3),
- /* 110 */ V(3, 14, 2),
- /* 111 */ V(3, 14, 2),
-
- /* 0100 0100 ... */
- /* 00 */ V(6, 13, 2), /* 244 */
- /* 01 */ V(13, 6, 2),
- /* 10 */ V(14, 3, 2),
- /* 11 */ V(9, 11, 2),
-
- /* 0100 0101 ... */
- /* 00 */ V(11, 9, 2), /* 248 */
- /* 01 */ V(10, 10, 2),
- /* 10 */ V(14, 2, 2),
- /* 11 */ V(1, 14, 2),
-
- /* 0100 0110 ... */
- /* 00 */ V(14, 1, 2), /* 252 */
- /* 01 */ V(5, 13, 2),
- /* 10 */ V(13, 5, 2),
- /* 11 */ V(7, 12, 2),
-
- /* 0100 0111 ... */
- /* 00 */ V(12, 7, 2), /* 256 */
- /* 01 */ V(4, 13, 2),
- /* 10 */ V(8, 11, 2),
- /* 11 */ V(11, 8, 2),
-
- /* 0100 1000 ... */
- /* 00 */ V(13, 4, 2), /* 260 */
- /* 01 */ V(9, 10, 2),
- /* 10 */ V(10, 9, 2),
- /* 11 */ V(6, 12, 2),
-
- /* 0100 1001 ... */
- /* 00 */ V(12, 6, 2), /* 264 */
- /* 01 */ V(3, 13, 2),
- /* 10 */ V(13, 3, 2),
- /* 11 */ V(2, 13, 2),
-
- /* 0100 1010 ... */
- /* 00 */ V(13, 2, 2), /* 268 */
- /* 01 */ V(1, 13, 2),
- /* 10 */ V(7, 11, 2),
- /* 11 */ V(11, 7, 2),
-
- /* 0100 1011 ... */
- /* 00 */ V(13, 1, 2), /* 272 */
- /* 01 */ V(5, 12, 2),
- /* 10 */ V(12, 5, 2),
- /* 11 */ V(8, 10, 2),
-
- /* 0100 1100 ... */
- /* 00 */ V(10, 8, 2), /* 276 */
- /* 01 */ V(9, 9, 2),
- /* 10 */ V(4, 12, 2),
- /* 11 */ V(12, 4, 2),
-
- /* 0100 1101 ... */
- /* 000 */ V(6, 11, 2), /* 280 */
- /* 001 */ V(6, 11, 2),
- /* 010 */ V(11, 6, 2),
- /* 011 */ V(11, 6, 2),
- /* 100 */ V(13, 0, 3),
- /* 101 */ V(0, 12, 3),
- /* 110 */ V(3, 12, 2),
- /* 111 */ V(3, 12, 2),
-
- /* 0100 1110 ... */
- /* 00 */ V(12, 3, 2), /* 288 */
- /* 01 */ V(7, 10, 2),
- /* 10 */ V(10, 7, 2),
- /* 11 */ V(2, 12, 2),
-
- /* 0100 1111 ... */
- /* 00 */ V(12, 2, 2), /* 292 */
- /* 01 */ V(5, 11, 2),
- /* 10 */ V(11, 5, 2),
- /* 11 */ V(1, 12, 2),
-
- /* 0101 0000 ... */
- /* 00 */ V(8, 9, 2), /* 296 */
- /* 01 */ V(9, 8, 2),
- /* 10 */ V(12, 1, 2),
- /* 11 */ V(4, 11, 2),
-
- /* 0101 0001 ... */
- /* 000 */ V(12, 0, 3), /* 300 */
- /* 001 */ V(0, 11, 3),
- /* 010 */ V(3, 11, 2),
- /* 011 */ V(3, 11, 2),
- /* 100 */ V(11, 0, 3),
- /* 101 */ V(0, 10, 3),
- /* 110 */ V(1, 10, 2),
- /* 111 */ V(1, 10, 2),
-
- /* 0101 0010 ... */
- /* 00 */ V(11, 4, 1), /* 308 */
- /* 01 */ V(11, 4, 1),
- /* 10 */ V(6, 10, 2),
- /* 11 */ V(10, 6, 2),
-
- /* 0101 0011 ... */
- /* 000 */ V(7, 9, 2), /* 312 */
- /* 001 */ V(7, 9, 2),
- /* 010 */ V(9, 7, 2),
- /* 011 */ V(9, 7, 2),
- /* 100 */ V(10, 0, 3),
- /* 101 */ V(0, 9, 3),
- /* 110 */ V(9, 0, 2),
- /* 111 */ V(9, 0, 2),
-
- /* 0101 0100 ... */
- /* 0 */ V(11, 3, 1), /* 320 */
- /* 1 */ V(8, 8, 1),
-
- /* 0101 0101 ... */
- /* 00 */ V(2, 11, 2), /* 322 */
- /* 01 */ V(5, 10, 2),
- /* 10 */ V(11, 2, 1),
- /* 11 */ V(11, 2, 1),
-
- /* 0101 0110 ... */
- /* 00 */ V(10, 5, 2), /* 326 */
- /* 01 */ V(1, 11, 2),
- /* 10 */ V(11, 1, 2),
- /* 11 */ V(6, 9, 2),
-
- /* 0101 0111 ... */
- /* 0 */ V(9, 6, 1), /* 330 */
- /* 1 */ V(10, 4, 1),
-
- /* 0101 1000 ... */
- /* 00 */ V(4, 10, 2), /* 332 */
- /* 01 */ V(7, 8, 2),
- /* 10 */ V(8, 7, 1),
- /* 11 */ V(8, 7, 1),
-
- /* 0101 1001 ... */
- /* 0 */ V(3, 10, 1), /* 336 */
- /* 1 */ V(10, 3, 1),
-
- /* 0101 1010 ... */
- /* 0 */ V(5, 9, 1), /* 338 */
- /* 1 */ V(9, 5, 1),
-
- /* 0101 1011 ... */
- /* 0 */ V(2, 10, 1), /* 340 */
- /* 1 */ V(10, 2, 1),
-
- /* 0101 1100 ... */
- /* 0 */ V(10, 1, 1), /* 342 */
- /* 1 */ V(6, 8, 1),
-
- /* 0101 1101 ... */
- /* 0 */ V(8, 6, 1), /* 344 */
- /* 1 */ V(7, 7, 1),
-
- /* 0101 1110 ... */
- /* 0 */ V(4, 9, 1), /* 346 */
- /* 1 */ V(9, 4, 1),
-
- /* 0101 1111 ... */
- /* 0 */ V(3, 9, 1), /* 348 */
- /* 1 */ V(9, 3, 1),
-
- /* 0110 0000 ... */
- /* 0 */ V(5, 8, 1), /* 350 */
- /* 1 */ V(8, 5, 1),
-
- /* 0110 0001 ... */
- /* 0 */ V(2, 9, 1), /* 352 */
- /* 1 */ V(6, 7, 1),
-
- /* 0110 0010 ... */
- /* 0 */ V(7, 6, 1), /* 354 */
- /* 1 */ V(9, 2, 1),
-
- /* 0110 0011 ... */
- /* 0 */ V(1, 9, 1), /* 356 */
- /* 1 */ V(9, 1, 1),
-
- /* 0110 0100 ... */
- /* 0 */ V(4, 8, 1), /* 358 */
- /* 1 */ V(8, 4, 1),
-
- /* 0110 0101 ... */
- /* 0 */ V(5, 7, 1), /* 360 */
- /* 1 */ V(7, 5, 1),
-
- /* 0110 0110 ... */
- /* 0 */ V(3, 8, 1), /* 362 */
- /* 1 */ V(8, 3, 1),
-
- /* 0110 0111 ... */
- /* 0 */ V(6, 6, 1), /* 364 */
- /* 1 */ V(2, 8, 1),
-
- /* 0110 1000 ... */
- /* 0 */ V(8, 2, 1), /* 366 */
- /* 1 */ V(1, 8, 1),
-
- /* 0110 1001 ... */
- /* 0 */ V(4, 7, 1), /* 368 */
- /* 1 */ V(7, 4, 1),
-
- /* 0110 1010 ... */
- /* 00 */ V(8, 1, 1), /* 370 */
- /* 01 */ V(8, 1, 1),
- /* 10 */ V(0, 8, 2),
- /* 11 */ V(8, 0, 2),
-
- /* 0110 1011 ... */
- /* 0 */ V(5, 6, 1), /* 374 */
- /* 1 */ V(6, 5, 1),
-
- /* 0110 1100 ... */
- /* 00 */ V(1, 7, 1), /* 376 */
- /* 01 */ V(1, 7, 1),
- /* 10 */ V(0, 7, 2),
- /* 11 */ V(7, 0, 2),
-
- /* 0110 1110 ... */
- /* 0 */ V(3, 7, 1), /* 380 */
- /* 1 */ V(2, 7, 1),
-
- /* 0111 1100 ... */
- /* 0 */ V(0, 6, 1), /* 382 */
- /* 1 */ V(6, 0, 1),
-
- /* 1000 0011 ... */
- /* 0 */ V(0, 5, 1), /* 384 */
- /* 1 */ V(5, 0, 1)
-};
-
-# undef V
-# undef PTR
-
-/* external tables */
-
-union huffquad const *const mad_huff_quad_table[2] = { hufftabA, hufftabB };
-
-struct hufftable const mad_huff_pair_table[32] = {
- /* 0 */ { hufftab0, 0, 0 },
- /* 1 */ { hufftab1, 0, 3 },
- /* 2 */ { hufftab2, 0, 3 },
- /* 3 */ { hufftab3, 0, 3 },
- /* 4 */ { 0 /* not used */ },
- /* 5 */ { hufftab5, 0, 3 },
- /* 6 */ { hufftab6, 0, 4 },
- /* 7 */ { hufftab7, 0, 4 },
- /* 8 */ { hufftab8, 0, 4 },
- /* 9 */ { hufftab9, 0, 4 },
- /* 10 */ { hufftab10, 0, 4 },
- /* 11 */ { hufftab11, 0, 4 },
- /* 12 */ { hufftab12, 0, 4 },
- /* 13 */ { hufftab13, 0, 4 },
- /* 14 */ { 0 /* not used */ },
- /* 15 */ { hufftab15, 0, 4 },
- /* 16 */ { hufftab16, 1, 4 },
- /* 17 */ { hufftab16, 2, 4 },
- /* 18 */ { hufftab16, 3, 4 },
- /* 19 */ { hufftab16, 4, 4 },
- /* 20 */ { hufftab16, 6, 4 },
- /* 21 */ { hufftab16, 8, 4 },
- /* 22 */ { hufftab16, 10, 4 },
- /* 23 */ { hufftab16, 13, 4 },
- /* 24 */ { hufftab24, 4, 4 },
- /* 25 */ { hufftab24, 5, 4 },
- /* 26 */ { hufftab24, 6, 4 },
- /* 27 */ { hufftab24, 7, 4 },
- /* 28 */ { hufftab24, 8, 4 },
- /* 29 */ { hufftab24, 9, 4 },
- /* 30 */ { hufftab24, 11, 4 },
- /* 31 */ { hufftab24, 13, 4 }
-};
diff --git a/src/libmad/huffman.h b/src/libmad/huffman.h
deleted file mode 100644
index 2f00c00a1..000000000
--- a/src/libmad/huffman.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * libmad - MPEG audio decoder library
- * Copyright (C) 2000-2004 Underbit Technologies, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * $Id: huffman.h,v 1.4 2004/04/22 00:22:41 miguelfreitas Exp $
- */
-
-# ifndef LIBMAD_HUFFMAN_H
-# define LIBMAD_HUFFMAN_H
-
-union huffquad {
- struct {
- unsigned short final : 1;
- unsigned short bits : 3;
- unsigned short offset : 12;
- } ptr;
- struct {
- unsigned short final : 1;
- unsigned short hlen : 3;
- unsigned short v : 1;
- unsigned short w : 1;
- unsigned short x : 1;
- unsigned short y : 1;
- } value;
- unsigned short final : 1;
-};
-
-union huffpair {
- struct {
- unsigned short final : 1;
- unsigned short bits : 3;
- unsigned short offset : 12;
- } ptr;
- struct {
- unsigned short final : 1;
- unsigned short hlen : 3;
- unsigned short x : 4;
- unsigned short y : 4;
- } value;
- unsigned short final : 1;
-};
-
-struct hufftable {
- union huffpair const *table;
- unsigned short linbits;
- unsigned short startbits;
-};
-
-extern union huffquad const *const mad_huff_quad_table[2];
-extern struct hufftable const mad_huff_pair_table[32];
-
-# endif
diff --git a/src/libmad/imdct_l_arm.S b/src/libmad/imdct_l_arm.S
deleted file mode 100644
index 35b2e2626..000000000
--- a/src/libmad/imdct_l_arm.S
+++ /dev/null
@@ -1,1000 +0,0 @@
-/*****************************************************************************
-* Copyright (C) 2000-2001 Andre McCurdy <armccurdy@yahoo.co.uk>
-*
-* This program is free software. you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation@ either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY, without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program@ if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*
-*****************************************************************************
-*
-* Notes:
-*
-*
-*****************************************************************************
-*
-* $Id: imdct_l_arm.S,v 1.1 2002/04/30 18:46:58 miguelfreitas Exp $
-*
-* 2001/03/24: Andre McCurdy <armccurdy@yahoo.co.uk>
-* - Corrected PIC unsafe loading of address of 'imdct36_long_karray'
-*
-* 2000/09/20: Robert Leslie <rob@mars.org>
-* - Added a global symbol with leading underscore per suggestion of
-* Simon Burge to support linking with the a.out format.
-*
-* 2000/09/15: Robert Leslie <rob@mars.org>
-* - Fixed a small bug where flags were changed before a conditional branch.
-*
-* 2000/09/15: Andre McCurdy <armccurdy@yahoo.co.uk>
-* - Applied Nicolas Pitre's rounding optimisation in all remaining places.
-*
-* 2000/09/09: Nicolas Pitre <nico@cam.org>
-* - Optimized rounding + scaling operations.
-*
-* 2000/08/09: Andre McCurdy <armccurdy@yahoo.co.uk>
-* - Original created.
-*
-****************************************************************************/
-
-
-/*
- On entry:
-
- r0 = pointer to 18 element input array
- r1 = pointer to 36 element output array
- r2 = windowing block type
-
-
- Stack frame created during execution of the function:
-
- Initial Holds:
- Stack
- pointer
- minus:
-
- 0
- 4 lr
- 8 r11
- 12 r10
- 16 r9
- 20 r8
- 24 r7
- 28 r6
- 32 r5
- 36 r4
-
- 40 r2 : windowing block type
-
- 44 ct00 high
- 48 ct00 low
- 52 ct01 high
- 56 ct01 low
- 60 ct04 high
- 64 ct04 low
- 68 ct06 high
- 72 ct06 low
- 76 ct05 high
- 80 ct05 low
- 84 ct03 high
- 88 ct03 low
- 92 -ct05 high
- 96 -ct05 low
- 100 -ct07 high
- 104 -ct07 low
- 108 ct07 high
- 112 ct07 low
- 116 ct02 high
- 120 ct02 low
-*/
-
-#define BLOCK_MODE_NORMAL 0
-#define BLOCK_MODE_START 1
-#define BLOCK_MODE_STOP 3
-
-
-#define X0 0x00
-#define X1 0x04
-#define X2 0x08
-#define X3 0x0C
-#define X4 0x10
-#define X5 0x14
-#define X6 0x18
-#define X7 0x1c
-#define X8 0x20
-#define X9 0x24
-#define X10 0x28
-#define X11 0x2c
-#define X12 0x30
-#define X13 0x34
-#define X14 0x38
-#define X15 0x3c
-#define X16 0x40
-#define X17 0x44
-
-#define x0 0x00
-#define x1 0x04
-#define x2 0x08
-#define x3 0x0C
-#define x4 0x10
-#define x5 0x14
-#define x6 0x18
-#define x7 0x1c
-#define x8 0x20
-#define x9 0x24
-#define x10 0x28
-#define x11 0x2c
-#define x12 0x30
-#define x13 0x34
-#define x14 0x38
-#define x15 0x3c
-#define x16 0x40
-#define x17 0x44
-#define x18 0x48
-#define x19 0x4c
-#define x20 0x50
-#define x21 0x54
-#define x22 0x58
-#define x23 0x5c
-#define x24 0x60
-#define x25 0x64
-#define x26 0x68
-#define x27 0x6c
-#define x28 0x70
-#define x29 0x74
-#define x30 0x78
-#define x31 0x7c
-#define x32 0x80
-#define x33 0x84
-#define x34 0x88
-#define x35 0x8c
-
-#define K00 0x0ffc19fd
-#define K01 0x00b2aa3e
-#define K02 0x0fdcf549
-#define K03 0x0216a2a2
-#define K04 0x0f9ee890
-#define K05 0x03768962
-#define K06 0x0f426cb5
-#define K07 0x04cfb0e2
-#define K08 0x0ec835e8
-#define K09 0x061f78aa
-#define K10 0x0e313245
-#define K11 0x07635284
-#define K12 0x0d7e8807
-#define K13 0x0898c779
-#define K14 0x0cb19346
-#define K15 0x09bd7ca0
-#define K16 0x0bcbe352
-#define K17 0x0acf37ad
-
-#define minus_K02 0xf0230ab7
-
-#define WL0 0x00b2aa3e
-#define WL1 0x0216a2a2
-#define WL2 0x03768962
-#define WL3 0x04cfb0e2
-#define WL4 0x061f78aa
-#define WL5 0x07635284
-#define WL6 0x0898c779
-#define WL7 0x09bd7ca0
-#define WL8 0x0acf37ad
-#define WL9 0x0bcbe352
-#define WL10 0x0cb19346
-#define WL11 0x0d7e8807
-#define WL12 0x0e313245
-#define WL13 0x0ec835e8
-#define WL14 0x0f426cb5
-#define WL15 0x0f9ee890
-#define WL16 0x0fdcf549
-#define WL17 0x0ffc19fd
-
-
-@*****************************************************************************
-
-
- .text
- .align
-
- .global III_imdct_l
- .global _III_imdct_l
-
-III_imdct_l:
-_III_imdct_l:
-
- stmdb sp!, { r2, r4 - r11, lr } @ all callee saved regs, plus arg3
-
- ldr r4, =K08 @ r4 = K08
- ldr r5, =K09 @ r5 = K09
- ldr r8, [r0, #X4] @ r8 = X4
- ldr r9, [r0, #X13] @ r9 = X13
- rsb r6, r4, #0 @ r6 = -K08
- rsb r7, r5, #0 @ r7 = -K09
-
- smull r2, r3, r4, r8 @ r2..r3 = (X4 * K08)
- smlal r2, r3, r5, r9 @ r2..r3 = (X4 * K08) + (X13 * K09) = ct01
-
- smull r10, lr, r8, r5 @ r10..lr = (X4 * K09)
- smlal r10, lr, r9, r6 @ r10..lr = (X4 * K09) + (X13 * -K08) = ct00
-
- ldr r8, [r0, #X7] @ r8 = X7
- ldr r9, [r0, #X16] @ r9 = X16
-
- stmdb sp!, { r2, r3, r10, lr } @ stack ct00_h, ct00_l, ct01_h, ct01_l
-
- add r8, r8, r9 @ r8 = (X7 + X16)
- ldr r9, [r0, #X1] @ r9 = X1
-
- smlal r2, r3, r6, r8 @ r2..r3 = ct01 + ((X7 + X16) * -K08)
- smlal r2, r3, r7, r9 @ r2..r3 += (X1 * -K09)
-
- ldr r7, [r0, #X10] @ r7 = X10
-
- rsbs r10, r10, #0
- rsc lr, lr, #0 @ r10..lr = -ct00
-
- smlal r2, r3, r5, r7 @ r2..r3 += (X10 * K09) = ct06
-
- smlal r10, lr, r9, r6 @ r10..lr = -ct00 + ( X1 * -K08)
- smlal r10, lr, r8, r5 @ r10..lr += ((X7 + X16) * K09)
- smlal r10, lr, r7, r4 @ r10..lr += ( X10 * K08) = ct04
-
- stmdb sp!, { r2, r3, r10, lr } @ stack ct04_h, ct04_l, ct06_h, ct06_l
-
- @----
-
- ldr r7, [r0, #X0]
- ldr r8, [r0, #X11]
- ldr r9, [r0, #X12]
- sub r7, r7, r8
- sub r7, r7, r9 @ r7 = (X0 - X11 -X12) = ct14
-
- ldr r9, [r0, #X3]
- ldr r8, [r0, #X8]
- ldr r11, [r0, #X15]
- sub r8, r8, r9
- add r8, r8, r11 @ r8 = (X8 - X3 + X15) = ct16
-
- add r11, r7, r8 @ r11 = ct14 + ct16 = ct18
-
- smlal r2, r3, r6, r11 @ r2..r3 = ct06 + ((X0 - X11 - X3 + X15 + X8 - X12) * -K08)
-
- ldr r6, [r0, #X2]
- ldr r9, [r0, #X9]
- ldr r12, [r0, #X14]
- sub r6, r6, r9
- sub r6, r6, r12 @ r6 = (X2 - X9 - X14) = ct15
-
- ldr r9, [r0, #X5]
- ldr r12, [r0, #X6]
- sub r9, r9, r12
- ldr r12, [r0, #X17]
- sub r9, r9, r12 @ r9 = (X5 - X6 - X17) = ct17
-
- add r12, r9, r6 @ r12 = ct15 + ct17 = ct19
-
- smlal r2, r3, r5, r12 @ r2..r3 += ((X2 - X9 + X5 - X6 - X17 - X14) * K09)
-
- smlal r10, lr, r11, r5 @ r10..lr = ct04 + (ct18 * K09)
- smlal r10, lr, r12, r4 @ r10..lr = ct04 + (ct18 * K09) + (ct19 * K08)
-
- movs r2, r2, lsr #28
- adc r2, r2, r3, lsl #4 @ r2 = bits[59..28] of r2..r3
- str r2, [r1, #x22] @ store result x22
-
- movs r10, r10, lsr #28
- adc r10, r10, lr, lsl #4 @ r10 = bits[59..28] of r10..lr
- str r10, [r1, #x4] @ store result x4
-
- @----
-
- ldmia sp, { r2, r3, r4, r5 } @ r2..r3 = ct06, r4..r5 = ct04 (dont update sp)
-
- @ r2..r3 = ct06
- @ r4..r5 = ct04
- @ r6 = ct15
- @ r7 = ct14
- @ r8 = ct16
- @ r9 = ct17
- @ r10 = .
- @ r11 = .
- @ r12 = .
- @ lr = .
-
- ldr r10, =K03 @ r10 = K03
- ldr lr, =K15 @ lr = K15
-
- smlal r2, r3, r10, r7 @ r2..r3 = ct06 + (ct14 * K03)
- smlal r4, r5, lr, r7 @ r4..r5 = ct04 + (ct14 * K15)
-
- ldr r12, =K14 @ r12 = K14
- rsb r10, r10, #0 @ r10 = -K03
-
- smlal r2, r3, lr, r6 @ r2..r3 += (ct15 * K15)
- smlal r4, r5, r10, r6 @ r4..r5 += (ct15 * -K03)
- smlal r2, r3, r12, r8 @ r2..r3 += (ct16 * K14)
-
- ldr r11, =minus_K02 @ r11 = -K02
- rsb r12, r12, #0 @ r12 = -K14
-
- smlal r4, r5, r12, r9 @ r4..r5 += (ct17 * -K14)
- smlal r2, r3, r11, r9 @ r2..r3 += (ct17 * -K02)
- smlal r4, r5, r11, r8 @ r4..r5 += (ct16 * -K02)
-
- movs r2, r2, lsr #28
- adc r2, r2, r3, lsl #4 @ r2 = bits[59..28] of r2..r3
- str r2, [r1, #x7] @ store result x7
-
- movs r4, r4, lsr #28
- adc r4, r4, r5, lsl #4 @ r4 = bits[59..28] of r4..r5
- str r4, [r1, #x1] @ store result x1
-
- @----
-
- ldmia sp, { r2, r3, r4, r5 } @ r2..r3 = ct06, r4..r5 = ct04 (dont update sp)
-
- @ r2..r3 = ct06
- @ r4..r5 = ct04
- @ r6 = ct15
- @ r7 = ct14
- @ r8 = ct16
- @ r9 = ct17
- @ r10 = -K03
- @ r11 = -K02
- @ r12 = -K14
- @ lr = K15
-
- rsbs r2, r2, #0
- rsc r3, r3, #0 @ r2..r3 = -ct06
-
- smlal r2, r3, r12, r7 @ r2..r3 = -ct06 + (ct14 * -K14)
- smlal r2, r3, r10, r8 @ r2..r3 += (ct16 * -K03)
-
- smlal r4, r5, r12, r6 @ r4..r5 = ct04 + (ct15 * -K14)
- smlal r4, r5, r10, r9 @ r4..r5 += (ct17 * -K03)
- smlal r4, r5, lr, r8 @ r4..r5 += (ct16 * K15)
- smlal r4, r5, r11, r7 @ r4..r5 += (ct14 * -K02)
-
- rsb lr, lr, #0 @ lr = -K15
- rsb r11, r11, #0 @ r11 = K02
-
- smlal r2, r3, lr, r9 @ r2..r3 += (ct17 * -K15)
- smlal r2, r3, r11, r6 @ r2..r3 += (ct15 * K02)
-
- movs r4, r4, lsr #28
- adc r4, r4, r5, lsl #4 @ r4 = bits[59..28] of r4..r5
- str r4, [r1, #x25] @ store result x25
-
- movs r2, r2, lsr #28
- adc r2, r2, r3, lsl #4 @ r2 = bits[59..28] of r2..r3
- str r2, [r1, #x19] @ store result x19
-
- @----
-
- ldr r2, [sp, #16] @ r2 = ct01_l
- ldr r3, [sp, #20] @ r3 = ct01_h
-
- ldr r6, [r0, #X1]
- ldr r8, [r0, #X7]
- ldr r9, [r0, #X10]
- ldr r7, [r0, #X16]
-
- rsbs r2, r2, #0
- rsc r3, r3, #0 @ r2..r3 = -ct01
-
- mov r4, r2
- mov r5, r3 @ r4..r5 = -ct01
-
- @ r2..r3 = -ct01
- @ r4..r5 = -ct01
- @ r6 = X1
- @ r7 = X16
- @ r8 = X7
- @ r9 = X10
- @ r10 = -K03
- @ r11 = K02
- @ r12 = -K14
- @ lr = -K15
-
- smlal r4, r5, r12, r7 @ r4..r5 = -ct01 + (X16 * -K14)
- smlal r2, r3, lr, r9 @ r2..r3 = -ct01 + (X10 * -K15)
-
- smlal r4, r5, r10, r8 @ r4..r5 += (X7 * -K03)
- smlal r2, r3, r10, r7 @ r2..r3 += (X16 * -K03)
-
- smlal r4, r5, r11, r9 @ r4..r5 += (X10 * K02)
- smlal r2, r3, r12, r8 @ r2..r3 += (X7 * -K14)
-
- rsb lr, lr, #0 @ lr = K15
- rsb r11, r11, #0 @ r11 = -K02
-
- smlal r4, r5, lr, r6 @ r4..r5 += (X1 * K15) = ct05
- smlal r2, r3, r11, r6 @ r2..r3 += (X1 * -K02) = ct03
-
- stmdb sp!, { r2, r3, r4, r5 } @ stack ct05_h, ct05_l, ct03_h, ct03_l
-
- rsbs r4, r4, #0
- rsc r5, r5, #0 @ r4..r5 = -ct05
-
- stmdb sp!, { r4, r5 } @ stack -ct05_h, -ct05_l
-
- ldr r2, [sp, #48] @ r2 = ct00_l
- ldr r3, [sp, #52] @ r3 = ct00_h
-
- rsb r10, r10, #0 @ r10 = K03
-
- rsbs r4, r2, #0
- rsc r5, r3, #0 @ r4..r5 = -ct00
-
- @ r2..r3 = ct00
- @ r4..r5 = -ct00
- @ r6 = X1
- @ r7 = X16
- @ r8 = X7
- @ r9 = X10
- @ r10 = K03
- @ r11 = -K02
- @ r12 = -K14
- @ lr = K15
-
- smlal r4, r5, r10, r6 @ r4..r5 = -ct00 + (X1 * K03)
- smlal r2, r3, r10, r9 @ r2..r3 = ct00 + (X10 * K03)
-
- smlal r4, r5, r12, r9 @ r4..r5 += (X10 * -K14)
- smlal r2, r3, r12, r6 @ r2..r3 += (X1 * -K14)
-
- smlal r4, r5, r11, r7 @ r4..r5 += (X16 * -K02)
- smlal r4, r5, lr, r8 @ r4..r5 += (X7 * K15) = ct07
-
- rsb lr, lr, #0 @ lr = -K15
- rsb r11, r11, #0 @ r11 = K02
-
- smlal r2, r3, r11, r8 @ r2..r3 += (X7 * K02)
- smlal r2, r3, lr, r7 @ r2..r3 += (X16 * -K15) = ct02
-
- rsbs r6, r4, #0
- rsc r7, r5, #0 @ r6..r7 = -ct07
-
- stmdb sp!, { r2 - r7 } @ stack -ct07_h, -ct07_l, ct07_h, ct07_l, ct02_h, ct02_l
-
-
- @----
-
- add r2, pc, #(imdct36_long_karray-.-8) @ r2 = base address of Knn array (PIC safe ?)
-
-
-loop:
- ldr r12, [r0, #X0]
-
- ldmia r2!, { r5 - r11 } @ first 7 words from Karray element
-
- smull r3, r4, r5, r12 @ sum = (Kxx * X0)
- ldr r12, [r0, #X2]
- ldr r5, [r0, #X3]
- smlal r3, r4, r6, r12 @ sum += (Kxx * X2)
- ldr r12, [r0, #X5]
- ldr r6, [r0, #X6]
- smlal r3, r4, r7, r5 @ sum += (Kxx * X3)
- smlal r3, r4, r8, r12 @ sum += (Kxx * X5)
- ldr r12, [r0, #X8]
- ldr r5, [r0, #X9]
- smlal r3, r4, r9, r6 @ sum += (Kxx * X6)
- smlal r3, r4, r10, r12 @ sum += (Kxx * X8)
- smlal r3, r4, r11, r5 @ sum += (Kxx * X9)
-
- ldmia r2!, { r5 - r10 } @ final 6 words from Karray element
-
- ldr r11, [r0, #X11]
- ldr r12, [r0, #X12]
- smlal r3, r4, r5, r11 @ sum += (Kxx * X11)
- ldr r11, [r0, #X14]
- ldr r5, [r0, #X15]
- smlal r3, r4, r6, r12 @ sum += (Kxx * X12)
- smlal r3, r4, r7, r11 @ sum += (Kxx * X14)
- ldr r11, [r0, #X17]
- smlal r3, r4, r8, r5 @ sum += (Kxx * X15)
- smlal r3, r4, r9, r11 @ sum += (Kxx * X17)
-
- add r5, sp, r10, lsr #16 @ create index back into stack for required ctxx
-
- ldmia r5, { r6, r7 } @ r6..r7 = ctxx
-
- mov r8, r10, lsl #16 @ push ctxx index off the top end
-
- adds r3, r3, r6 @ add low words
- adc r4, r4, r7 @ add high words, with carry
- movs r3, r3, lsr #28
- adc r3, r3, r4, lsl #4 @ r3 = bits[59..28] of r3..r4
-
- str r3, [r1, r8, lsr #24] @ push completion flag off the bottom end
-
- movs r8, r8, lsl #8 @ push result location index off the top end
- beq loop @ loop back if completion flag not set
- b imdct_l_windowing @ branch to windowing stage if looping finished
-
-imdct36_long_karray:
-
- .word K17, -K13, K10, -K06, -K05, K01, -K00, K04, -K07, K11, K12, -K16, 0x00000000
- .word K13, K07, K16, K01, K10, -K05, K04, -K11, K00, -K17, K06, -K12, 0x00200800
- .word K11, K17, K05, K12, -K01, K06, -K07, K00, -K13, K04, -K16, K10, 0x00200c00
- .word K07, K00, -K12, K05, -K16, -K10, K11, -K17, K04, K13, K01, K06, 0x00001400
- .word K05, K10, -K00, -K17, K07, -K13, K12, K06, -K16, K01, -K11, -K04, 0x00181800
- .word K01, K05, -K07, -K11, K13, K17, -K16, -K12, K10, K06, -K04, -K00, 0x00102000
- .word -K16, K12, -K11, K07, K04, -K00, -K01, K05, -K06, K10, K13, -K17, 0x00284800
- .word -K12, K06, K17, -K00, -K11, K04, K05, -K10, K01, K16, -K07, -K13, 0x00085000
- .word -K10, K16, K04, -K13, -K00, K07, K06, -K01, -K12, -K05, K17, K11, 0x00105400
- .word -K06, -K01, K13, K04, K17, -K11, -K10, -K16, -K05, K12, K00, K07, 0x00185c00
- .word -K04, -K11, -K01, K16, K06, K12, K13, -K07, -K17, -K00, -K10, -K05, 0x00006000
- .word -K00, -K04, -K06, -K10, -K12, -K16, -K17, -K13, -K11, -K07, -K05, -K01, 0x00206801
-
-
- @----
- @-------------------------------------------------------------------------
- @----
-
-imdct_l_windowing:
-
- ldr r11, [sp, #80] @ fetch function parameter 3 from out of the stack
- ldmia r1!, { r0, r2 - r9 } @ load 9 words from x0, update pointer
-
- @ r0 = x0
- @ r1 = &x[9]
- @ r2 = x1
- @ r3 = x2
- @ r4 = x3
- @ r5 = x4
- @ r6 = x5
- @ r7 = x6
- @ r8 = x7
- @ r9 = x8
- @ r10 = .
- @ r11 = window mode: (0 == normal), (1 == start block), (3 == stop block)
- @ r12 = .
- @ lr = .
-
- cmp r11, #BLOCK_MODE_STOP @ setup flags
- rsb r10, r0, #0 @ r10 = -x0 (DONT change flags !!)
- beq stop_block_x0_to_x17
-
-
- @ start and normal blocks are treated the same for x[0]..x[17]
-
-normal_block_x0_to_x17:
-
- ldr r12, =WL9 @ r12 = window_l[9]
-
- rsb r0, r9, #0 @ r0 = -x8
- rsb r9, r2, #0 @ r9 = -x1
- rsb r2, r8, #0 @ r2 = -x7
- rsb r8, r3, #0 @ r8 = -x2
- rsb r3, r7, #0 @ r3 = -x6
- rsb r7, r4, #0 @ r7 = -x3
- rsb r4, r6, #0 @ r4 = -x5
- rsb r6, r5, #0 @ r6 = -x4
-
- @ r0 = -x8
- @ r1 = &x[9]
- @ r2 = -x7
- @ r3 = -x6
- @ r4 = -x5
- @ r5 = .
- @ r6 = -x4
- @ r7 = -x3
- @ r8 = -x2
- @ r9 = -x1
- @ r10 = -x0
- @ r11 = window mode: (0 == normal), (1 == start block), (3 == stop block)
- @ r12 = window_l[9]
- @ lr = .
-
- smull r5, lr, r12, r0 @ r5..lr = (window_l[9] * (x[9] == -x[8]))
- ldr r12, =WL10 @ r12 = window_l[10]
- movs r5, r5, lsr #28
- adc r0, r5, lr, lsl #4 @ r0 = bits[59..28] of windowed x9
-
- smull r5, lr, r12, r2 @ r5..lr = (window_l[10] * (x[10] == -x[7]))
- ldr r12, =WL11 @ r12 = window_l[11]
- movs r5, r5, lsr #28
- adc r2, r5, lr, lsl #4 @ r2 = bits[59..28] of windowed x10
-
- smull r5, lr, r12, r3 @ r5..lr = (window_l[11] * (x[11] == -x[6]))
- ldr r12, =WL12 @ r12 = window_l[12]
- movs r5, r5, lsr #28
- adc r3, r5, lr, lsl #4 @ r3 = bits[59..28] of windowed x11
-
- smull r5, lr, r12, r4 @ r5..lr = (window_l[12] * (x[12] == -x[5]))
- ldr r12, =WL13 @ r12 = window_l[13]
- movs r5, r5, lsr #28
- adc r4, r5, lr, lsl #4 @ r4 = bits[59..28] of windowed x12
-
- smull r5, lr, r12, r6 @ r5..lr = (window_l[13] * (x[13] == -x[4]))
- ldr r12, =WL14 @ r12 = window_l[14]
- movs r5, r5, lsr #28
- adc r6, r5, lr, lsl #4 @ r6 = bits[59..28] of windowed x13
-
- smull r5, lr, r12, r7 @ r5..lr = (window_l[14] * (x[14] == -x[3]))
- ldr r12, =WL15 @ r12 = window_l[15]
- movs r5, r5, lsr #28
- adc r7, r5, lr, lsl #4 @ r7 = bits[59..28] of windowed x14
-
- smull r5, lr, r12, r8 @ r5..lr = (window_l[15] * (x[15] == -x[2]))
- ldr r12, =WL16 @ r12 = window_l[16]
- movs r5, r5, lsr #28
- adc r8, r5, lr, lsl #4 @ r8 = bits[59..28] of windowed x15
-
- smull r5, lr, r12, r9 @ r5..lr = (window_l[16] * (x[16] == -x[1]))
- ldr r12, =WL17 @ r12 = window_l[17]
- movs r5, r5, lsr #28
- adc r9, r5, lr, lsl #4 @ r9 = bits[59..28] of windowed x16
-
- smull r5, lr, r12, r10 @ r5..lr = (window_l[17] * (x[17] == -x[0]))
- ldr r12, =WL0 @ r12 = window_l[0]
- movs r5, r5, lsr #28
- adc r10, r5, lr, lsl #4 @ r10 = bits[59..28] of windowed x17
-
-
- stmia r1, { r0, r2 - r4, r6 - r10 } @ store windowed x[9] .. x[17]
- ldmdb r1!, { r0, r2 - r9 } @ load 9 words downto (and including) x0
-
-
- smull r10, lr, r12, r0 @ r10..lr = (window_l[0] * x[0])
- ldr r12, =WL1 @ r12 = window_l[1]
- movs r10, r10, lsr #28
- adc r0, r10, lr, lsl #4 @ r0 = bits[59..28] of windowed x0
-
- smull r10, lr, r12, r2 @ r10..lr = (window_l[1] * x[1])
- ldr r12, =WL2 @ r12 = window_l[2]
- movs r10, r10, lsr #28
- adc r2, r10, lr, lsl #4 @ r2 = bits[59..28] of windowed x1
-
- smull r10, lr, r12, r3 @ r10..lr = (window_l[2] * x[2])
- ldr r12, =WL3 @ r12 = window_l[3]
- movs r10, r10, lsr #28
- adc r3, r10, lr, lsl #4 @ r3 = bits[59..28] of windowed x2
-
- smull r10, lr, r12, r4 @ r10..lr = (window_l[3] * x[3])
- ldr r12, =WL4 @ r12 = window_l[4]
- movs r10, r10, lsr #28
- adc r4, r10, lr, lsl #4 @ r4 = bits[59..28] of windowed x3
-
- smull r10, lr, r12, r5 @ r10..lr = (window_l[4] * x[4])
- ldr r12, =WL5 @ r12 = window_l[5]
- movs r10, r10, lsr #28
- adc r5, r10, lr, lsl #4 @ r5 = bits[59..28] of windowed x4
-
- smull r10, lr, r12, r6 @ r10..lr = (window_l[5] * x[5])
- ldr r12, =WL6 @ r12 = window_l[6]
- movs r10, r10, lsr #28
- adc r6, r10, lr, lsl #4 @ r6 = bits[59..28] of windowed x5
-
- smull r10, lr, r12, r7 @ r10..lr = (window_l[6] * x[6])
- ldr r12, =WL7 @ r12 = window_l[7]
- movs r10, r10, lsr #28
- adc r7, r10, lr, lsl #4 @ r7 = bits[59..28] of windowed x6
-
- smull r10, lr, r12, r8 @ r10..lr = (window_l[7] * x[7])
- ldr r12, =WL8 @ r12 = window_l[8]
- movs r10, r10, lsr #28
- adc r8, r10, lr, lsl #4 @ r8 = bits[59..28] of windowed x7
-
- smull r10, lr, r12, r9 @ r10..lr = (window_l[8] * x[8])
- movs r10, r10, lsr #28
- adc r9, r10, lr, lsl #4 @ r9 = bits[59..28] of windowed x8
-
- stmia r1, { r0, r2 - r9 } @ store windowed x[0] .. x[8]
-
- cmp r11, #BLOCK_MODE_START
- beq start_block_x18_to_x35
-
-
- @----
-
-
-normal_block_x18_to_x35:
-
- ldr r11, =WL3 @ r11 = window_l[3]
- ldr r12, =WL4 @ r12 = window_l[4]
-
- add r1, r1, #(18*4) @ r1 = &x[18]
-
- ldmia r1!, { r0, r2 - r4, r6 - r10 } @ load 9 words from x18, update pointer
-
- @ r0 = x18
- @ r1 = &x[27]
- @ r2 = x19
- @ r3 = x20
- @ r4 = x21
- @ r5 = .
- @ r6 = x22
- @ r7 = x23
- @ r8 = x24
- @ r9 = x25
- @ r10 = x26
- @ r11 = window_l[3]
- @ r12 = window_l[4]
- @ lr = .
-
- smull r5, lr, r12, r6 @ r5..lr = (window_l[4] * (x[22] == x[31]))
- movs r5, r5, lsr #28
- adc r5, r5, lr, lsl #4 @ r5 = bits[59..28] of windowed x31
-
- smull r6, lr, r11, r4 @ r5..lr = (window_l[3] * (x[21] == x[32]))
- ldr r12, =WL5 @ r12 = window_l[5]
- movs r6, r6, lsr #28
- adc r6, r6, lr, lsl #4 @ r6 = bits[59..28] of windowed x32
-
- smull r4, lr, r12, r7 @ r4..lr = (window_l[5] * (x[23] == x[30]))
- ldr r11, =WL1 @ r11 = window_l[1]
- ldr r12, =WL2 @ r12 = window_l[2]
- movs r4, r4, lsr #28
- adc r4, r4, lr, lsl #4 @ r4 = bits[59..28] of windowed x30
-
- smull r7, lr, r12, r3 @ r7..lr = (window_l[2] * (x[20] == x[33]))
- ldr r12, =WL6 @ r12 = window_l[6]
- movs r7, r7, lsr #28
- adc r7, r7, lr, lsl #4 @ r7 = bits[59..28] of windowed x33
-
- smull r3, lr, r12, r8 @ r3..lr = (window_l[6] * (x[24] == x[29]))
- movs r3, r3, lsr #28
- adc r3, r3, lr, lsl #4 @ r3 = bits[59..28] of windowed x29
-
- smull r8, lr, r11, r2 @ r7..lr = (window_l[1] * (x[19] == x[34]))
- ldr r12, =WL7 @ r12 = window_l[7]
- ldr r11, =WL8 @ r11 = window_l[8]
- movs r8, r8, lsr #28
- adc r8, r8, lr, lsl #4 @ r8 = bits[59..28] of windowed x34
-
- smull r2, lr, r12, r9 @ r7..lr = (window_l[7] * (x[25] == x[28]))
- ldr r12, =WL0 @ r12 = window_l[0]
- movs r2, r2, lsr #28
- adc r2, r2, lr, lsl #4 @ r2 = bits[59..28] of windowed x28
-
- smull r9, lr, r12, r0 @ r3..lr = (window_l[0] * (x[18] == x[35]))
- movs r9, r9, lsr #28
- adc r9, r9, lr, lsl #4 @ r9 = bits[59..28] of windowed x35
-
- smull r0, lr, r11, r10 @ r7..lr = (window_l[8] * (x[26] == x[27]))
- ldr r11, =WL16 @ r11 = window_l[16]
- ldr r12, =WL17 @ r12 = window_l[17]
- movs r0, r0, lsr #28
- adc r0, r0, lr, lsl #4 @ r0 = bits[59..28] of windowed x27
-
-
- stmia r1, { r0, r2 - r9 } @ store windowed x[27] .. x[35]
- ldmdb r1!, { r0, r2 - r9 } @ load 9 words downto (and including) x18
-
-
- smull r10, lr, r12, r0 @ r10..lr = (window_l[17] * x[18])
- movs r10, r10, lsr #28
- adc r0, r10, lr, lsl #4 @ r0 = bits[59..28] of windowed x0
-
- smull r10, lr, r11, r2 @ r10..lr = (window_l[16] * x[19])
- ldr r11, =WL14 @ r11 = window_l[14]
- ldr r12, =WL15 @ r12 = window_l[15]
- movs r10, r10, lsr #28
- adc r2, r10, lr, lsl #4 @ r2 = bits[59..28] of windowed x1
-
- smull r10, lr, r12, r3 @ r10..lr = (window_l[15] * x[20])
- movs r10, r10, lsr #28
- adc r3, r10, lr, lsl #4 @ r3 = bits[59..28] of windowed x2
-
- smull r10, lr, r11, r4 @ r10..lr = (window_l[14] * x[21])
- ldr r11, =WL12 @ r11 = window_l[12]
- ldr r12, =WL13 @ r12 = window_l[13]
- movs r10, r10, lsr #28
- adc r4, r10, lr, lsl #4 @ r4 = bits[59..28] of windowed x3
-
- smull r10, lr, r12, r5 @ r10..lr = (window_l[13] * x[22])
- movs r10, r10, lsr #28
- adc r5, r10, lr, lsl #4 @ r5 = bits[59..28] of windowed x4
-
- smull r10, lr, r11, r6 @ r10..lr = (window_l[12] * x[23])
- ldr r11, =WL10 @ r12 = window_l[10]
- ldr r12, =WL11 @ r12 = window_l[11]
- movs r10, r10, lsr #28
- adc r6, r10, lr, lsl #4 @ r6 = bits[59..28] of windowed x5
-
- smull r10, lr, r12, r7 @ r10..lr = (window_l[11] * x[24])
- movs r10, r10, lsr #28
- adc r7, r10, lr, lsl #4 @ r7 = bits[59..28] of windowed x6
-
- smull r10, lr, r11, r8 @ r10..lr = (window_l[10] * x[25])
- ldr r12, =WL9 @ r12 = window_l[9]
- movs r10, r10, lsr #28
- adc r8, r10, lr, lsl #4 @ r8 = bits[59..28] of windowed x7
-
- smull r10, lr, r12, r9 @ r10..lr = (window_l[9] * x[26])
-
- movs r10, r10, lsr #28
- adc r9, r10, lr, lsl #4 @ r9 = bits[59..28] of windowed x8
-
- stmia r1, { r0, r2 - r9 } @ store windowed x[18] .. x[26]
-
- @----
- @ NB there are 2 possible exits from this function - this is only one of them
- @----
-
- add sp, sp, #(21*4) @ return stack frame
- ldmia sp!, { r4 - r11, pc } @ restore callee saved regs, and return
-
- @----
-
-
-stop_block_x0_to_x17:
-
- @ r0 = x0
- @ r1 = &x[9]
- @ r2 = x1
- @ r3 = x2
- @ r4 = x3
- @ r5 = x4
- @ r6 = x5
- @ r7 = x6
- @ r8 = x7
- @ r9 = x8
- @ r10 = -x0
- @ r11 = window mode: (0 == normal), (1 == start block), (3 == stop block)
- @ r12 = .
- @ lr = .
-
- rsb r0, r6, #0 @ r0 = -x5
- rsb r6, r2, #0 @ r6 = -x1
- rsb r2, r5, #0 @ r2 = -x4
- rsb r5, r3, #0 @ r5 = -x2
- rsb r3, r4, #0 @ r3 = -x3
-
- add r1, r1, #(3*4) @ r1 = &x[12]
- stmia r1, { r0, r2, r3, r5, r6, r10 } @ store unchanged x[12] .. x[17]
-
- ldr r0, =WL1 @ r0 = window_l[1] == window_s[0]
-
- rsb r10, r9, #0 @ r10 = -x8
- rsb r12, r8, #0 @ r12 = -x7
- rsb lr, r7, #0 @ lr = -x6
-
- @ r0 = WL1
- @ r1 = &x[12]
- @ r2 = .
- @ r3 = .
- @ r4 = .
- @ r5 = .
- @ r6 = .
- @ r7 = x6
- @ r8 = x7
- @ r9 = x8
- @ r10 = -x8
- @ r11 = window mode: (0 == normal), (1 == start block), (3 == stop block)
- @ r12 = -x7
- @ lr = -x6
-
- smull r5, r6, r0, r7 @ r5..r6 = (window_l[1] * x[6])
- ldr r2, =WL4 @ r2 = window_l[4] == window_s[1]
- movs r5, r5, lsr #28
- adc r7, r5, r6, lsl #4 @ r7 = bits[59..28] of windowed x6
-
- smull r5, r6, r2, r8 @ r5..r6 = (window_l[4] * x[7])
- ldr r3, =WL7 @ r3 = window_l[7] == window_s[2]
- movs r5, r5, lsr #28
- adc r8, r5, r6, lsl #4 @ r8 = bits[59..28] of windowed x7
-
- smull r5, r6, r3, r9 @ r5..r6 = (window_l[7] * x[8])
- ldr r4, =WL10 @ r4 = window_l[10] == window_s[3]
- movs r5, r5, lsr #28
- adc r9, r5, r6, lsl #4 @ r9 = bits[59..28] of windowed x8
-
- smull r5, r6, r4, r10 @ r5..r6 = (window_l[10] * (x[9] == -x[8]))
- ldr r0, =WL13 @ r0 = window_l[13] == window_s[4]
- movs r5, r5, lsr #28
- adc r10, r5, r6, lsl #4 @ r10 = bits[59..28] of windowed x9
-
- smull r5, r6, r0, r12 @ r5..r6 = (window_l[13] * (x[10] == -x[7]))
- ldr r2, =WL16 @ r2 = window_l[16] == window_s[5]
- movs r5, r5, lsr #28
- adc r12, r5, r6, lsl #4 @ r10 = bits[59..28] of windowed x9
-
- smull r5, r6, r2, lr @ r5..r6 = (window_l[16] * (x[11] == -x[6]))
-
- ldr r0, =0x00
-
- movs r5, r5, lsr #28
- adc lr, r5, r6, lsl #4 @ r10 = bits[59..28] of windowed x9
-
- stmdb r1!, { r7 - r10, r12, lr } @ store windowed x[6] .. x[11]
-
- ldr r5, =0x00
- ldr r6, =0x00
- ldr r2, =0x00
- ldr r3, =0x00
- ldr r4, =0x00
-
- stmdb r1!, { r0, r2 - r6 } @ store windowed x[0] .. x[5]
-
- b normal_block_x18_to_x35
-
-
- @----
-
-
-start_block_x18_to_x35:
-
- ldr r4, =WL1 @ r0 = window_l[1] == window_s[0]
-
- add r1, r1, #(24*4) @ r1 = &x[24]
-
- ldmia r1, { r0, r2, r3 } @ load 3 words from x24, dont update pointer
-
- @ r0 = x24
- @ r1 = &x[24]
- @ r2 = x25
- @ r3 = x26
- @ r4 = WL1
- @ r5 = WL4
- @ r6 = WL7
- @ r7 = WL10
- @ r8 = WL13
- @ r9 = WL16
- @ r10 = .
- @ r11 = .
- @ r12 = .
- @ lr = .
-
- ldr r5, =WL4 @ r5 = window_l[4] == window_s[1]
-
- smull r10, r11, r4, r0 @ r10..r11 = (window_l[1] * (x[24] == x[29]))
- ldr r6, =WL7 @ r6 = window_l[7] == window_s[2]
- movs r10, r10, lsr #28
- adc lr, r10, r11, lsl #4 @ lr = bits[59..28] of windowed x29
-
- smull r10, r11, r5, r2 @ r10..r11 = (window_l[4] * (x[25] == x[28]))
- ldr r7, =WL10 @ r7 = window_l[10] == window_s[3]
- movs r10, r10, lsr #28
- adc r12, r10, r11, lsl #4 @ r12 = bits[59..28] of windowed x28
-
- smull r10, r11, r6, r3 @ r10..r11 = (window_l[7] * (x[26] == x[27]))
- ldr r8, =WL13 @ r8 = window_l[13] == window_s[4]
- movs r10, r10, lsr #28
- adc r4, r10, r11, lsl #4 @ r4 = bits[59..28] of windowed x27
-
- smull r10, r11, r7, r3 @ r10..r11 = (window_l[10] * x[26])
- ldr r9, =WL16 @ r9 = window_l[16] == window_s[5]
- movs r10, r10, lsr #28
- adc r3, r10, r11, lsl #4 @ r3 = bits[59..28] of windowed x26
-
- smull r10, r11, r8, r2 @ r10..r11 = (window_l[13] * x[25])
- ldr r5, =0x00
- movs r10, r10, lsr #28
- adc r2, r10, r11, lsl #4 @ r2 = bits[59..28] of windowed x25
-
- smull r10, r11, r9, r0 @ r10..r11 = (window_l[16] * x[24])
- ldr r6, =0x00
- movs r10, r10, lsr #28
- adc r0, r10, r11, lsl #4 @ r0 = bits[59..28] of windowed x24
-
- stmia r1!, { r0, r2, r3, r4, r12, lr } @ store windowed x[24] .. x[29]
-
- ldr r7, =0x00
- ldr r8, =0x00
- ldr r9, =0x00
- ldr r10, =0x00
-
- stmia r1!, { r5 - r10 } @ store windowed x[30] .. x[35]
-
- @----
- @ NB there are 2 possible exits from this function - this is only one of them
- @----
-
- add sp, sp, #(21*4) @ return stack frame
- ldmia sp!, { r4 - r11, pc } @ restore callee saved regs, and return
-
- @----
- @END
- @----
-
diff --git a/src/libmad/imdct_s.dat b/src/libmad/imdct_s.dat
deleted file mode 100644
index c938859e0..000000000
--- a/src/libmad/imdct_s.dat
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * libmad - MPEG audio decoder library
- * Copyright (C) 2000-2004 Underbit Technologies, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * $Id: imdct_s.dat,v 1.3 2004/04/22 00:22:41 miguelfreitas Exp $
- */
-
- /* 0 */ { MAD_F(0x09bd7ca0) /* 0.608761429 */,
- -MAD_F(0x0ec835e8) /* -0.923879533 */,
- -MAD_F(0x0216a2a2) /* -0.130526192 */,
- MAD_F(0x0fdcf549) /* 0.991444861 */,
- -MAD_F(0x061f78aa) /* -0.382683432 */,
- -MAD_F(0x0cb19346) /* -0.793353340 */ },
-
- /* 6 */ { -MAD_F(0x0cb19346) /* -0.793353340 */,
- MAD_F(0x061f78aa) /* 0.382683432 */,
- MAD_F(0x0fdcf549) /* 0.991444861 */,
- MAD_F(0x0216a2a2) /* 0.130526192 */,
- -MAD_F(0x0ec835e8) /* -0.923879533 */,
- -MAD_F(0x09bd7ca0) /* -0.608761429 */ },
-
- /* 1 */ { MAD_F(0x061f78aa) /* 0.382683432 */,
- -MAD_F(0x0ec835e8) /* -0.923879533 */,
- MAD_F(0x0ec835e8) /* 0.923879533 */,
- -MAD_F(0x061f78aa) /* -0.382683432 */,
- -MAD_F(0x061f78aa) /* -0.382683432 */,
- MAD_F(0x0ec835e8) /* 0.923879533 */ },
-
- /* 7 */ { -MAD_F(0x0ec835e8) /* -0.923879533 */,
- -MAD_F(0x061f78aa) /* -0.382683432 */,
- MAD_F(0x061f78aa) /* 0.382683432 */,
- MAD_F(0x0ec835e8) /* 0.923879533 */,
- MAD_F(0x0ec835e8) /* 0.923879533 */,
- MAD_F(0x061f78aa) /* 0.382683432 */ },
-
- /* 2 */ { MAD_F(0x0216a2a2) /* 0.130526192 */,
- -MAD_F(0x061f78aa) /* -0.382683432 */,
- MAD_F(0x09bd7ca0) /* 0.608761429 */,
- -MAD_F(0x0cb19346) /* -0.793353340 */,
- MAD_F(0x0ec835e8) /* 0.923879533 */,
- -MAD_F(0x0fdcf549) /* -0.991444861 */ },
-
- /* 8 */ { -MAD_F(0x0fdcf549) /* -0.991444861 */,
- -MAD_F(0x0ec835e8) /* -0.923879533 */,
- -MAD_F(0x0cb19346) /* -0.793353340 */,
- -MAD_F(0x09bd7ca0) /* -0.608761429 */,
- -MAD_F(0x061f78aa) /* -0.382683432 */,
- -MAD_F(0x0216a2a2) /* -0.130526192 */ }
diff --git a/src/libmad/layer12.c b/src/libmad/layer12.c
deleted file mode 100644
index 25fd04d70..000000000
--- a/src/libmad/layer12.c
+++ /dev/null
@@ -1,534 +0,0 @@
-/*
- * libmad - MPEG audio decoder library
- * Copyright (C) 2000-2004 Underbit Technologies, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * $Id: layer12.c,v 1.3 2004/04/22 00:22:41 miguelfreitas Exp $
- */
-
-# ifdef HAVE_CONFIG_H
-# include "config.h"
-# endif
-
-# include "global.h"
-
-# ifdef HAVE_LIMITS_H
-# include <limits.h>
-# else
-# define CHAR_BIT 8
-# endif
-
-# include "fixed.h"
-# include "bit.h"
-# include "stream.h"
-# include "frame.h"
-# include "layer12.h"
-
-/*
- * scalefactor table
- * used in both Layer I and Layer II decoding
- */
-static
-mad_fixed_t const sf_table[64] = {
-# include "sf_table.dat"
-};
-
-/* --- Layer I ------------------------------------------------------------- */
-
-/* linear scaling table */
-static
-mad_fixed_t const linear_table[14] = {
- MAD_F(0x15555555), /* 2^2 / (2^2 - 1) == 1.33333333333333 */
- MAD_F(0x12492492), /* 2^3 / (2^3 - 1) == 1.14285714285714 */
- MAD_F(0x11111111), /* 2^4 / (2^4 - 1) == 1.06666666666667 */
- MAD_F(0x10842108), /* 2^5 / (2^5 - 1) == 1.03225806451613 */
- MAD_F(0x10410410), /* 2^6 / (2^6 - 1) == 1.01587301587302 */
- MAD_F(0x10204081), /* 2^7 / (2^7 - 1) == 1.00787401574803 */
- MAD_F(0x10101010), /* 2^8 / (2^8 - 1) == 1.00392156862745 */
- MAD_F(0x10080402), /* 2^9 / (2^9 - 1) == 1.00195694716243 */
- MAD_F(0x10040100), /* 2^10 / (2^10 - 1) == 1.00097751710655 */
- MAD_F(0x10020040), /* 2^11 / (2^11 - 1) == 1.00048851978505 */
- MAD_F(0x10010010), /* 2^12 / (2^12 - 1) == 1.00024420024420 */
- MAD_F(0x10008004), /* 2^13 / (2^13 - 1) == 1.00012208521548 */
- MAD_F(0x10004001), /* 2^14 / (2^14 - 1) == 1.00006103888177 */
- MAD_F(0x10002000) /* 2^15 / (2^15 - 1) == 1.00003051850948 */
-};
-
-/*
- * NAME: I_sample()
- * DESCRIPTION: decode one requantized Layer I sample from a bitstream
- */
-static
-mad_fixed_t I_sample(struct mad_bitptr *ptr, unsigned int nb)
-{
- mad_fixed_t sample;
-
- sample = mad_bit_read(ptr, nb);
-
- /* invert most significant bit, extend sign, then scale to fixed format */
-
- sample ^= 1 << (nb - 1);
- sample |= -(sample & (1 << (nb - 1)));
-
- sample <<= MAD_F_FRACBITS - (nb - 1);
-
- /* requantize the sample */
-
- /* s'' = (2^nb / (2^nb - 1)) * (s''' + 2^(-nb + 1)) */
-
- sample += MAD_F_ONE >> (nb - 1);
-
- return mad_f_mul(sample, linear_table[nb - 2]);
-
- /* s' = factor * s'' */
- /* (to be performed by caller) */
-}
-
-/*
- * NAME: layer->I()
- * DESCRIPTION: decode a single Layer I frame
- */
-int mad_layer_I(struct mad_stream *stream, struct mad_frame *frame)
-{
- struct mad_header *header = &frame->header;
- unsigned int nch, bound, ch, s, sb, nb;
- unsigned char allocation[2][32], scalefactor[2][32];
-
- nch = MAD_NCHANNELS(header);
-
- bound = 32;
- if (header->mode == MAD_MODE_JOINT_STEREO) {
- header->flags |= MAD_FLAG_I_STEREO;
- bound = 4 + header->mode_extension * 4;
- }
-
- /* check CRC word */
-
- if (header->flags & MAD_FLAG_PROTECTION) {
- header->crc_check =
- mad_bit_crc(stream->ptr, 4 * (bound * nch + (32 - bound)),
- header->crc_check);
-
- if (header->crc_check != header->crc_target &&
- !(frame->options & MAD_OPTION_IGNORECRC)) {
- stream->error = MAD_ERROR_BADCRC;
- return -1;
- }
- }
-
- /* decode bit allocations */
-
- for (sb = 0; sb < bound; ++sb) {
- for (ch = 0; ch < nch; ++ch) {
- nb = mad_bit_read(&stream->ptr, 4);
-
- if (nb == 15) {
- stream->error = MAD_ERROR_BADBITALLOC;
- return -1;
- }
-
- allocation[ch][sb] = nb ? nb + 1 : 0;
- }
- }
-
- for (sb = bound; sb < 32; ++sb) {
- nb = mad_bit_read(&stream->ptr, 4);
-
- if (nb == 15) {
- stream->error = MAD_ERROR_BADBITALLOC;
- return -1;
- }
-
- allocation[0][sb] =
- allocation[1][sb] = nb ? nb + 1 : 0;
- }
-
- /* decode scalefactors */
-
- for (sb = 0; sb < 32; ++sb) {
- for (ch = 0; ch < nch; ++ch) {
- if (allocation[ch][sb]) {
- scalefactor[ch][sb] = mad_bit_read(&stream->ptr, 6);
-
-# if defined(OPT_STRICT)
- /*
- * Scalefactor index 63 does not appear in Table B.1 of
- * ISO/IEC 11172-3. Nonetheless, other implementations accept it,
- * so we only reject it if OPT_STRICT is defined.
- */
- if (scalefactor[ch][sb] == 63) {
- stream->error = MAD_ERROR_BADSCALEFACTOR;
- return -1;
- }
-# endif
- }
- }
- }
-
- /* decode samples */
-
- for (s = 0; s < 12; ++s) {
- for (sb = 0; sb < bound; ++sb) {
- for (ch = 0; ch < nch; ++ch) {
- nb = allocation[ch][sb];
- frame->sbsample[ch][s][sb] = nb ?
- mad_f_mul(I_sample(&stream->ptr, nb),
- sf_table[scalefactor[ch][sb]]) : 0;
- }
- }
-
- for (sb = bound; sb < 32; ++sb) {
- if ((nb = allocation[0][sb])) {
- mad_fixed_t sample;
-
- sample = I_sample(&stream->ptr, nb);
-
- for (ch = 0; ch < nch; ++ch) {
- frame->sbsample[ch][s][sb] =
- mad_f_mul(sample, sf_table[scalefactor[ch][sb]]);
- }
- }
- else {
- for (ch = 0; ch < nch; ++ch)
- frame->sbsample[ch][s][sb] = 0;
- }
- }
- }
-
- return 0;
-}
-
-/* --- Layer II ------------------------------------------------------------ */
-
-/* possible quantization per subband table */
-static
-struct {
- unsigned int sblimit;
- unsigned char const offsets[30];
-} const sbquant_table[5] = {
- /* ISO/IEC 11172-3 Table B.2a */
- { 27, { 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 3, 3, 3, 3, 3, /* 0 */
- 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0 } },
- /* ISO/IEC 11172-3 Table B.2b */
- { 30, { 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 3, 3, 3, 3, 3, /* 1 */
- 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0 } },
- /* ISO/IEC 11172-3 Table B.2c */
- { 8, { 5, 5, 2, 2, 2, 2, 2, 2 } }, /* 2 */
- /* ISO/IEC 11172-3 Table B.2d */
- { 12, { 5, 5, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 } }, /* 3 */
- /* ISO/IEC 13818-3 Table B.1 */
- { 30, { 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, /* 4 */
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }
-};
-
-/* bit allocation table */
-static
-struct {
- unsigned short nbal;
- unsigned short offset;
-} const bitalloc_table[8] = {
- { 2, 0 }, /* 0 */
- { 2, 3 }, /* 1 */
- { 3, 3 }, /* 2 */
- { 3, 1 }, /* 3 */
- { 4, 2 }, /* 4 */
- { 4, 3 }, /* 5 */
- { 4, 4 }, /* 6 */
- { 4, 5 } /* 7 */
-};
-
-/* offsets into quantization class table */
-static
-unsigned char const offset_table[6][15] = {
- { 0, 1, 16 }, /* 0 */
- { 0, 1, 2, 3, 4, 5, 16 }, /* 1 */
- { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }, /* 2 */
- { 0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, /* 3 */
- { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16 }, /* 4 */
- { 0, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 } /* 5 */
-};
-
-/* quantization class table */
-static
-struct quantclass {
- unsigned short nlevels;
- unsigned char group;
- unsigned char bits;
- mad_fixed_t C;
- mad_fixed_t D;
-} const qc_table[17] = {
-# include "qc_table.dat"
-};
-
-/*
- * NAME: II_samples()
- * DESCRIPTION: decode three requantized Layer II samples from a bitstream
- */
-static
-void II_samples(struct mad_bitptr *ptr,
- struct quantclass const *quantclass,
- mad_fixed_t output[3])
-{
- unsigned int nb, s, sample[3];
-
- if ((nb = quantclass->group)) {
- unsigned int c, nlevels;
-
- /* degrouping */
- c = mad_bit_read(ptr, quantclass->bits);
- nlevels = quantclass->nlevels;
-
- for (s = 0; s < 3; ++s) {
- sample[s] = c % nlevels;
- c /= nlevels;
- }
- }
- else {
- nb = quantclass->bits;
-
- for (s = 0; s < 3; ++s)
- sample[s] = mad_bit_read(ptr, nb);
- }
-
- for (s = 0; s < 3; ++s) {
- mad_fixed_t requantized;
-
- /* invert most significant bit, extend sign, then scale to fixed format */
-
- requantized = sample[s] ^ (1 << (nb - 1));
- requantized |= -(requantized & (1 << (nb - 1)));
-
- requantized <<= MAD_F_FRACBITS - (nb - 1);
-
- /* requantize the sample */
-
- /* s'' = C * (s''' + D) */
-
- output[s] = mad_f_mul(requantized + quantclass->D, quantclass->C);
-
- /* s' = factor * s'' */
- /* (to be performed by caller) */
- }
-}
-
-/*
- * NAME: layer->II()
- * DESCRIPTION: decode a single Layer II frame
- */
-int mad_layer_II(struct mad_stream *stream, struct mad_frame *frame)
-{
- struct mad_header *header = &frame->header;
- struct mad_bitptr start;
- unsigned int index, sblimit, nbal, nch, bound, gr, ch, s, sb;
- unsigned char const *offsets;
- unsigned char allocation[2][32], scfsi[2][32], scalefactor[2][32][3];
- mad_fixed_t samples[3];
-
- nch = MAD_NCHANNELS(header);
-
- if (header->flags & MAD_FLAG_LSF_EXT)
- index = 4;
- else if (header->flags & MAD_FLAG_FREEFORMAT)
- goto freeformat;
- else {
- unsigned long bitrate_per_channel;
-
- bitrate_per_channel = header->bitrate;
- if (nch == 2) {
- bitrate_per_channel /= 2;
-
-# if defined(OPT_STRICT)
- /*
- * ISO/IEC 11172-3 allows only single channel mode for 32, 48, 56, and
- * 80 kbps bitrates in Layer II, but some encoders ignore this
- * restriction. We enforce it if OPT_STRICT is defined.
- */
- if (bitrate_per_channel <= 28000 || bitrate_per_channel == 40000) {
- stream->error = MAD_ERROR_BADMODE;
- return -1;
- }
-# endif
- }
- else { /* nch == 1 */
- if (bitrate_per_channel > 192000) {
- /*
- * ISO/IEC 11172-3 does not allow single channel mode for 224, 256,
- * 320, or 384 kbps bitrates in Layer II.
- */
- stream->error = MAD_ERROR_BADMODE;
- return -1;
- }
- }
-
- if (bitrate_per_channel <= 48000)
- index = (header->samplerate == 32000) ? 3 : 2;
- else if (bitrate_per_channel <= 80000)
- index = 0;
- else {
- freeformat:
- index = (header->samplerate == 48000) ? 0 : 1;
- }
- }
-
- sblimit = sbquant_table[index].sblimit;
- offsets = sbquant_table[index].offsets;
-
- bound = 32;
- if (header->mode == MAD_MODE_JOINT_STEREO) {
- header->flags |= MAD_FLAG_I_STEREO;
- bound = 4 + header->mode_extension * 4;
- }
-
- if (bound > sblimit)
- bound = sblimit;
-
- start = stream->ptr;
-
- /* decode bit allocations */
-
- for (sb = 0; sb < bound; ++sb) {
- nbal = bitalloc_table[offsets[sb]].nbal;
-
- for (ch = 0; ch < nch; ++ch)
- allocation[ch][sb] = mad_bit_read(&stream->ptr, nbal);
- }
-
- for (sb = bound; sb < sblimit; ++sb) {
- nbal = bitalloc_table[offsets[sb]].nbal;
-
- allocation[0][sb] =
- allocation[1][sb] = mad_bit_read(&stream->ptr, nbal);
- }
-
- /* decode scalefactor selection info */
-
- for (sb = 0; sb < sblimit; ++sb) {
- for (ch = 0; ch < nch; ++ch) {
- if (allocation[ch][sb])
- scfsi[ch][sb] = mad_bit_read(&stream->ptr, 2);
- }
- }
-
- /* check CRC word */
-
- if (header->flags & MAD_FLAG_PROTECTION) {
- header->crc_check =
- mad_bit_crc(start, mad_bit_length(&start, &stream->ptr),
- header->crc_check);
-
- if (header->crc_check != header->crc_target &&
- !(frame->options & MAD_OPTION_IGNORECRC)) {
- stream->error = MAD_ERROR_BADCRC;
- return -1;
- }
- }
-
- /* decode scalefactors */
-
- for (sb = 0; sb < sblimit; ++sb) {
- for (ch = 0; ch < nch; ++ch) {
- if (allocation[ch][sb]) {
- scalefactor[ch][sb][0] = mad_bit_read(&stream->ptr, 6);
-
- switch (scfsi[ch][sb]) {
- case 2:
- scalefactor[ch][sb][2] =
- scalefactor[ch][sb][1] =
- scalefactor[ch][sb][0];
- break;
-
- case 0:
- scalefactor[ch][sb][1] = mad_bit_read(&stream->ptr, 6);
- /* fall through */
-
- case 1:
- case 3:
- scalefactor[ch][sb][2] = mad_bit_read(&stream->ptr, 6);
- }
-
- if (scfsi[ch][sb] & 1)
- scalefactor[ch][sb][1] = scalefactor[ch][sb][scfsi[ch][sb] - 1];
-
-# if defined(OPT_STRICT)
- /*
- * Scalefactor index 63 does not appear in Table B.1 of
- * ISO/IEC 11172-3. Nonetheless, other implementations accept it,
- * so we only reject it if OPT_STRICT is defined.
- */
- if (scalefactor[ch][sb][0] == 63 ||
- scalefactor[ch][sb][1] == 63 ||
- scalefactor[ch][sb][2] == 63) {
- stream->error = MAD_ERROR_BADSCALEFACTOR;
- return -1;
- }
-# endif
- }
- }
- }
-
- /* decode samples */
-
- for (gr = 0; gr < 12; ++gr) {
- for (sb = 0; sb < bound; ++sb) {
- for (ch = 0; ch < nch; ++ch) {
- if ((index = allocation[ch][sb])) {
- index = offset_table[bitalloc_table[offsets[sb]].offset][index - 1];
-
- II_samples(&stream->ptr, &qc_table[index], samples);
-
- for (s = 0; s < 3; ++s) {
- frame->sbsample[ch][3 * gr + s][sb] =
- mad_f_mul(samples[s], sf_table[scalefactor[ch][sb][gr / 4]]);
- }
- }
- else {
- for (s = 0; s < 3; ++s)
- frame->sbsample[ch][3 * gr + s][sb] = 0;
- }
- }
- }
-
- for (sb = bound; sb < sblimit; ++sb) {
- if ((index = allocation[0][sb])) {
- index = offset_table[bitalloc_table[offsets[sb]].offset][index - 1];
-
- II_samples(&stream->ptr, &qc_table[index], samples);
-
- for (ch = 0; ch < nch; ++ch) {
- for (s = 0; s < 3; ++s) {
- frame->sbsample[ch][3 * gr + s][sb] =
- mad_f_mul(samples[s], sf_table[scalefactor[ch][sb][gr / 4]]);
- }
- }
- }
- else {
- for (ch = 0; ch < nch; ++ch) {
- for (s = 0; s < 3; ++s)
- frame->sbsample[ch][3 * gr + s][sb] = 0;
- }
- }
- }
-
- for (ch = 0; ch < nch; ++ch) {
- for (s = 0; s < 3; ++s) {
- for (sb = sblimit; sb < 32; ++sb)
- frame->sbsample[ch][3 * gr + s][sb] = 0;
- }
- }
- }
-
- return 0;
-}
diff --git a/src/libmad/layer12.h b/src/libmad/layer12.h
deleted file mode 100644
index 645bb6405..000000000
--- a/src/libmad/layer12.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * libmad - MPEG audio decoder library
- * Copyright (C) 2000-2004 Underbit Technologies, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * $Id: layer12.h,v 1.3 2004/04/22 00:22:49 miguelfreitas Exp $
- */
-
-# ifndef LIBMAD_LAYER12_H
-# define LIBMAD_LAYER12_H
-
-# include "stream.h"
-# include "frame.h"
-
-int mad_layer_I(struct mad_stream *, struct mad_frame *);
-int mad_layer_II(struct mad_stream *, struct mad_frame *);
-
-# endif
diff --git a/src/libmad/layer3.c b/src/libmad/layer3.c
deleted file mode 100644
index c5d46e8d1..000000000
--- a/src/libmad/layer3.c
+++ /dev/null
@@ -1,2698 +0,0 @@
-/*
- * libmad - MPEG audio decoder library
- * Copyright (C) 2000-2004 Underbit Technologies, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * $Id: layer3.c,v 1.7 2006/09/26 00:12:20 dgp85 Exp $
- */
-
-# ifdef HAVE_CONFIG_H
-# include "config.h"
-# endif
-
-# include "global.h"
-
-# include <stdlib.h>
-# include <string.h>
-
-# ifdef HAVE_ASSERT_H
-# include <assert.h>
-# endif
-
-# ifdef HAVE_LIMITS_H
-# include <limits.h>
-# else
-# define CHAR_BIT 8
-# endif
-
-# include "fixed.h"
-# include "bit.h"
-# include "stream.h"
-# include "frame.h"
-# include "huffman.h"
-# include "layer3.h"
-
-/* --- Layer III ----------------------------------------------------------- */
-
-enum {
- count1table_select = 0x01,
- scalefac_scale = 0x02,
- preflag = 0x04,
- mixed_block_flag = 0x08
-};
-
-enum {
- I_STEREO = 0x1,
- MS_STEREO = 0x2
-};
-
-struct sideinfo {
- unsigned int main_data_begin;
- unsigned int private_bits;
-
- unsigned char scfsi[2];
-
- struct granule {
- struct channel {
- /* from side info */
- unsigned short part2_3_length;
- unsigned short big_values;
- unsigned short global_gain;
- unsigned short scalefac_compress;
-
- unsigned char flags;
- unsigned char block_type;
- unsigned char table_select[3];
- unsigned char subblock_gain[3];
- unsigned char region0_count;
- unsigned char region1_count;
-
- /* from main_data */
- unsigned char scalefac[39]; /* scalefac_l and/or scalefac_s */
- } ch[2];
- } gr[2];
-};
-
-/*
- * scalefactor bit lengths
- * derived from section 2.4.2.7 of ISO/IEC 11172-3
- */
-static
-struct {
- unsigned char slen1;
- unsigned char slen2;
-} const sflen_table[16] = {
- { 0, 0 }, { 0, 1 }, { 0, 2 }, { 0, 3 },
- { 3, 0 }, { 1, 1 }, { 1, 2 }, { 1, 3 },
- { 2, 1 }, { 2, 2 }, { 2, 3 }, { 3, 1 },
- { 3, 2 }, { 3, 3 }, { 4, 2 }, { 4, 3 }
-};
-
-/*
- * number of LSF scalefactor band values
- * derived from section 2.4.3.2 of ISO/IEC 13818-3
- */
-static
-unsigned char const nsfb_table[6][3][4] = {
- { { 6, 5, 5, 5 },
- { 9, 9, 9, 9 },
- { 6, 9, 9, 9 } },
-
- { { 6, 5, 7, 3 },
- { 9, 9, 12, 6 },
- { 6, 9, 12, 6 } },
-
- { { 11, 10, 0, 0 },
- { 18, 18, 0, 0 },
- { 15, 18, 0, 0 } },
-
- { { 7, 7, 7, 0 },
- { 12, 12, 12, 0 },
- { 6, 15, 12, 0 } },
-
- { { 6, 6, 6, 3 },
- { 12, 9, 9, 6 },
- { 6, 12, 9, 6 } },
-
- { { 8, 8, 5, 0 },
- { 15, 12, 9, 0 },
- { 6, 18, 9, 0 } }
-};
-
-/*
- * MPEG-1 scalefactor band widths
- * derived from Table B.8 of ISO/IEC 11172-3
- */
-static
-unsigned char const sfb_48000_long[] = {
- 4, 4, 4, 4, 4, 4, 6, 6, 6, 8, 10,
- 12, 16, 18, 22, 28, 34, 40, 46, 54, 54, 192
-};
-
-static
-unsigned char const sfb_44100_long[] = {
- 4, 4, 4, 4, 4, 4, 6, 6, 8, 8, 10,
- 12, 16, 20, 24, 28, 34, 42, 50, 54, 76, 158
-};
-
-static
-unsigned char const sfb_32000_long[] = {
- 4, 4, 4, 4, 4, 4, 6, 6, 8, 10, 12,
- 16, 20, 24, 30, 38, 46, 56, 68, 84, 102, 26
-};
-
-static
-unsigned char const sfb_48000_short[] = {
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 6,
- 6, 6, 6, 6, 6, 10, 10, 10, 12, 12, 12, 14, 14,
- 14, 16, 16, 16, 20, 20, 20, 26, 26, 26, 66, 66, 66
-};
-
-static
-unsigned char const sfb_44100_short[] = {
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 6,
- 6, 6, 8, 8, 8, 10, 10, 10, 12, 12, 12, 14, 14,
- 14, 18, 18, 18, 22, 22, 22, 30, 30, 30, 56, 56, 56
-};
-
-static
-unsigned char const sfb_32000_short[] = {
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 6,
- 6, 6, 8, 8, 8, 12, 12, 12, 16, 16, 16, 20, 20,
- 20, 26, 26, 26, 34, 34, 34, 42, 42, 42, 12, 12, 12
-};
-
-static
-unsigned char const sfb_48000_mixed[] = {
- /* long */ 4, 4, 4, 4, 4, 4, 6, 6,
- /* short */ 4, 4, 4, 6, 6, 6, 6, 6, 6, 10,
- 10, 10, 12, 12, 12, 14, 14, 14, 16, 16,
- 16, 20, 20, 20, 26, 26, 26, 66, 66, 66
-};
-
-static
-unsigned char const sfb_44100_mixed[] = {
- /* long */ 4, 4, 4, 4, 4, 4, 6, 6,
- /* short */ 4, 4, 4, 6, 6, 6, 8, 8, 8, 10,
- 10, 10, 12, 12, 12, 14, 14, 14, 18, 18,
- 18, 22, 22, 22, 30, 30, 30, 56, 56, 56
-};
-
-static
-unsigned char const sfb_32000_mixed[] = {
- /* long */ 4, 4, 4, 4, 4, 4, 6, 6,
- /* short */ 4, 4, 4, 6, 6, 6, 8, 8, 8, 12,
- 12, 12, 16, 16, 16, 20, 20, 20, 26, 26,
- 26, 34, 34, 34, 42, 42, 42, 12, 12, 12
-};
-
-/*
- * MPEG-2 scalefactor band widths
- * derived from Table B.2 of ISO/IEC 13818-3
- */
-static
-unsigned char const sfb_24000_long[] = {
- 6, 6, 6, 6, 6, 6, 8, 10, 12, 14, 16,
- 18, 22, 26, 32, 38, 46, 54, 62, 70, 76, 36
-};
-
-static
-unsigned char const sfb_22050_long[] = {
- 6, 6, 6, 6, 6, 6, 8, 10, 12, 14, 16,
- 20, 24, 28, 32, 38, 46, 52, 60, 68, 58, 54
-};
-
-# define sfb_16000_long sfb_22050_long
-
-static
-unsigned char const sfb_24000_short[] = {
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 6, 6, 8,
- 8, 8, 10, 10, 10, 12, 12, 12, 14, 14, 14, 18, 18,
- 18, 24, 24, 24, 32, 32, 32, 44, 44, 44, 12, 12, 12
-};
-
-static
-unsigned char const sfb_22050_short[] = {
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 6, 6, 6,
- 6, 6, 8, 8, 8, 10, 10, 10, 14, 14, 14, 18, 18,
- 18, 26, 26, 26, 32, 32, 32, 42, 42, 42, 18, 18, 18
-};
-
-static
-unsigned char const sfb_16000_short[] = {
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 6, 6, 8,
- 8, 8, 10, 10, 10, 12, 12, 12, 14, 14, 14, 18, 18,
- 18, 24, 24, 24, 30, 30, 30, 40, 40, 40, 18, 18, 18
-};
-
-static
-unsigned char const sfb_24000_mixed[] = {
- /* long */ 6, 6, 6, 6, 6, 6,
- /* short */ 6, 6, 6, 8, 8, 8, 10, 10, 10, 12,
- 12, 12, 14, 14, 14, 18, 18, 18, 24, 24,
- 24, 32, 32, 32, 44, 44, 44, 12, 12, 12
-};
-
-static
-unsigned char const sfb_22050_mixed[] = {
- /* long */ 6, 6, 6, 6, 6, 6,
- /* short */ 6, 6, 6, 6, 6, 6, 8, 8, 8, 10,
- 10, 10, 14, 14, 14, 18, 18, 18, 26, 26,
- 26, 32, 32, 32, 42, 42, 42, 18, 18, 18
-};
-
-static
-unsigned char const sfb_16000_mixed[] = {
- /* long */ 6, 6, 6, 6, 6, 6,
- /* short */ 6, 6, 6, 8, 8, 8, 10, 10, 10, 12,
- 12, 12, 14, 14, 14, 18, 18, 18, 24, 24,
- 24, 30, 30, 30, 40, 40, 40, 18, 18, 18
-};
-
-/*
- * MPEG 2.5 scalefactor band widths
- * derived from public sources
- */
-# define sfb_12000_long sfb_16000_long
-# define sfb_11025_long sfb_12000_long
-
-static
-unsigned char const sfb_8000_long[] = {
- 12, 12, 12, 12, 12, 12, 16, 20, 24, 28, 32,
- 40, 48, 56, 64, 76, 90, 2, 2, 2, 2, 2
-};
-
-# define sfb_12000_short sfb_16000_short
-# define sfb_11025_short sfb_12000_short
-
-static
-unsigned char const sfb_8000_short[] = {
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 12, 12, 12, 16,
- 16, 16, 20, 20, 20, 24, 24, 24, 28, 28, 28, 36, 36,
- 36, 2, 2, 2, 2, 2, 2, 2, 2, 2, 26, 26, 26
-};
-
-# define sfb_12000_mixed sfb_16000_mixed
-# define sfb_11025_mixed sfb_12000_mixed
-
-/* the 8000 Hz short block scalefactor bands do not break after
- the first 36 frequency lines, so this is probably wrong */
-static
-unsigned char const sfb_8000_mixed[] = {
- /* long */ 12, 12, 12,
- /* short */ 4, 4, 4, 8, 8, 8, 12, 12, 12, 16, 16, 16,
- 20, 20, 20, 24, 24, 24, 28, 28, 28, 36, 36, 36,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 26, 26, 26
-};
-
-static
-struct {
- unsigned char const *l;
- unsigned char const *s;
- unsigned char const *m;
-} const sfbwidth_table[9] = {
- { sfb_48000_long, sfb_48000_short, sfb_48000_mixed },
- { sfb_44100_long, sfb_44100_short, sfb_44100_mixed },
- { sfb_32000_long, sfb_32000_short, sfb_32000_mixed },
- { sfb_24000_long, sfb_24000_short, sfb_24000_mixed },
- { sfb_22050_long, sfb_22050_short, sfb_22050_mixed },
- { sfb_16000_long, sfb_16000_short, sfb_16000_mixed },
- { sfb_12000_long, sfb_12000_short, sfb_12000_mixed },
- { sfb_11025_long, sfb_11025_short, sfb_11025_mixed },
- { sfb_8000_long, sfb_8000_short, sfb_8000_mixed }
-};
-
-/*
- * scalefactor band preemphasis (used only when preflag is set)
- * derived from Table B.6 of ISO/IEC 11172-3
- */
-static
-unsigned char const pretab[22] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 3, 2, 0
-};
-
-/*
- * table for requantization
- *
- * rq_table[x].mantissa * 2^(rq_table[x].exponent) = x^(4/3)
- */
-static
-struct fixedfloat {
- unsigned long mantissa : 27;
- unsigned short exponent : 5;
-} const rq_table[8207] = {
-# include "rq_table.dat"
-};
-
-/*
- * fractional powers of two
- * used for requantization and joint stereo decoding
- *
- * root_table[3 + x] = 2^(x/4)
- */
-static
-mad_fixed_t const root_table[7] = {
- MAD_F(0x09837f05) /* 2^(-3/4) == 0.59460355750136 */,
- MAD_F(0x0b504f33) /* 2^(-2/4) == 0.70710678118655 */,
- MAD_F(0x0d744fcd) /* 2^(-1/4) == 0.84089641525371 */,
- MAD_F(0x10000000) /* 2^( 0/4) == 1.00000000000000 */,
- MAD_F(0x1306fe0a) /* 2^(+1/4) == 1.18920711500272 */,
- MAD_F(0x16a09e66) /* 2^(+2/4) == 1.41421356237310 */,
- MAD_F(0x1ae89f99) /* 2^(+3/4) == 1.68179283050743 */
-};
-
-/*
- * coefficients for aliasing reduction
- * derived from Table B.9 of ISO/IEC 11172-3
- *
- * c[] = { -0.6, -0.535, -0.33, -0.185, -0.095, -0.041, -0.0142, -0.0037 }
- * cs[i] = 1 / sqrt(1 + c[i]^2)
- * ca[i] = c[i] / sqrt(1 + c[i]^2)
- */
-static
-mad_fixed_t const cs[8] = {
- +MAD_F(0x0db84a81) /* +0.857492926 */, +MAD_F(0x0e1b9d7f) /* +0.881741997 */,
- +MAD_F(0x0f31adcf) /* +0.949628649 */, +MAD_F(0x0fbba815) /* +0.983314592 */,
- +MAD_F(0x0feda417) /* +0.995517816 */, +MAD_F(0x0ffc8fc8) /* +0.999160558 */,
- +MAD_F(0x0fff964c) /* +0.999899195 */, +MAD_F(0x0ffff8d3) /* +0.999993155 */
-};
-
-static
-mad_fixed_t const ca[8] = {
- -MAD_F(0x083b5fe7) /* -0.514495755 */, -MAD_F(0x078c36d2) /* -0.471731969 */,
- -MAD_F(0x05039814) /* -0.313377454 */, -MAD_F(0x02e91dd1) /* -0.181913200 */,
- -MAD_F(0x0183603a) /* -0.094574193 */, -MAD_F(0x00a7cb87) /* -0.040965583 */,
- -MAD_F(0x003a2847) /* -0.014198569 */, -MAD_F(0x000f27b4) /* -0.003699975 */
-};
-
-/*
- * IMDCT coefficients for short blocks
- * derived from section 2.4.3.4.10.2 of ISO/IEC 11172-3
- *
- * imdct_s[i/even][k] = cos((PI / 24) * (2 * (i / 2) + 7) * (2 * k + 1))
- * imdct_s[i /odd][k] = cos((PI / 24) * (2 * (6 + (i-1)/2) + 7) * (2 * k + 1))
- */
-static
-mad_fixed_t const imdct_s[6][6] = {
-# include "imdct_s.dat"
-};
-
-# if !defined(ASO_IMDCT)
-/*
- * windowing coefficients for long blocks
- * derived from section 2.4.3.4.10.3 of ISO/IEC 11172-3
- *
- * window_l[i] = sin((PI / 36) * (i + 1/2))
- */
-static
-mad_fixed_t const window_l[36] = {
- MAD_F(0x00b2aa3e) /* 0.043619387 */, MAD_F(0x0216a2a2) /* 0.130526192 */,
- MAD_F(0x03768962) /* 0.216439614 */, MAD_F(0x04cfb0e2) /* 0.300705800 */,
- MAD_F(0x061f78aa) /* 0.382683432 */, MAD_F(0x07635284) /* 0.461748613 */,
- MAD_F(0x0898c779) /* 0.537299608 */, MAD_F(0x09bd7ca0) /* 0.608761429 */,
- MAD_F(0x0acf37ad) /* 0.675590208 */, MAD_F(0x0bcbe352) /* 0.737277337 */,
- MAD_F(0x0cb19346) /* 0.793353340 */, MAD_F(0x0d7e8807) /* 0.843391446 */,
-
- MAD_F(0x0e313245) /* 0.887010833 */, MAD_F(0x0ec835e8) /* 0.923879533 */,
- MAD_F(0x0f426cb5) /* 0.953716951 */, MAD_F(0x0f9ee890) /* 0.976296007 */,
- MAD_F(0x0fdcf549) /* 0.991444861 */, MAD_F(0x0ffc19fd) /* 0.999048222 */,
- MAD_F(0x0ffc19fd) /* 0.999048222 */, MAD_F(0x0fdcf549) /* 0.991444861 */,
- MAD_F(0x0f9ee890) /* 0.976296007 */, MAD_F(0x0f426cb5) /* 0.953716951 */,
- MAD_F(0x0ec835e8) /* 0.923879533 */, MAD_F(0x0e313245) /* 0.887010833 */,
-
- MAD_F(0x0d7e8807) /* 0.843391446 */, MAD_F(0x0cb19346) /* 0.793353340 */,
- MAD_F(0x0bcbe352) /* 0.737277337 */, MAD_F(0x0acf37ad) /* 0.675590208 */,
- MAD_F(0x09bd7ca0) /* 0.608761429 */, MAD_F(0x0898c779) /* 0.537299608 */,
- MAD_F(0x07635284) /* 0.461748613 */, MAD_F(0x061f78aa) /* 0.382683432 */,
- MAD_F(0x04cfb0e2) /* 0.300705800 */, MAD_F(0x03768962) /* 0.216439614 */,
- MAD_F(0x0216a2a2) /* 0.130526192 */, MAD_F(0x00b2aa3e) /* 0.043619387 */,
-};
-# endif /* ASO_IMDCT */
-
-/*
- * windowing coefficients for short blocks
- * derived from section 2.4.3.4.10.3 of ISO/IEC 11172-3
- *
- * window_s[i] = sin((PI / 12) * (i + 1/2))
- */
-static
-mad_fixed_t const window_s[12] = {
- MAD_F(0x0216a2a2) /* 0.130526192 */, MAD_F(0x061f78aa) /* 0.382683432 */,
- MAD_F(0x09bd7ca0) /* 0.608761429 */, MAD_F(0x0cb19346) /* 0.793353340 */,
- MAD_F(0x0ec835e8) /* 0.923879533 */, MAD_F(0x0fdcf549) /* 0.991444861 */,
- MAD_F(0x0fdcf549) /* 0.991444861 */, MAD_F(0x0ec835e8) /* 0.923879533 */,
- MAD_F(0x0cb19346) /* 0.793353340 */, MAD_F(0x09bd7ca0) /* 0.608761429 */,
- MAD_F(0x061f78aa) /* 0.382683432 */, MAD_F(0x0216a2a2) /* 0.130526192 */,
-};
-
-/*
- * coefficients for intensity stereo processing
- * derived from section 2.4.3.4.9.3 of ISO/IEC 11172-3
- *
- * is_ratio[i] = tan(i * (PI / 12))
- * is_table[i] = is_ratio[i] / (1 + is_ratio[i])
- */
-static
-mad_fixed_t const is_table[7] = {
- MAD_F(0x00000000) /* 0.000000000 */,
- MAD_F(0x0361962f) /* 0.211324865 */,
- MAD_F(0x05db3d74) /* 0.366025404 */,
- MAD_F(0x08000000) /* 0.500000000 */,
- MAD_F(0x0a24c28c) /* 0.633974596 */,
- MAD_F(0x0c9e69d1) /* 0.788675135 */,
- MAD_F(0x10000000) /* 1.000000000 */
-};
-
-/*
- * coefficients for LSF intensity stereo processing
- * derived from section 2.4.3.2 of ISO/IEC 13818-3
- *
- * is_lsf_table[0][i] = (1 / sqrt(sqrt(2)))^(i + 1)
- * is_lsf_table[1][i] = (1 / sqrt(2)) ^(i + 1)
- */
-static
-mad_fixed_t const is_lsf_table[2][15] = {
- {
- MAD_F(0x0d744fcd) /* 0.840896415 */,
- MAD_F(0x0b504f33) /* 0.707106781 */,
- MAD_F(0x09837f05) /* 0.594603558 */,
- MAD_F(0x08000000) /* 0.500000000 */,
- MAD_F(0x06ba27e6) /* 0.420448208 */,
- MAD_F(0x05a8279a) /* 0.353553391 */,
- MAD_F(0x04c1bf83) /* 0.297301779 */,
- MAD_F(0x04000000) /* 0.250000000 */,
- MAD_F(0x035d13f3) /* 0.210224104 */,
- MAD_F(0x02d413cd) /* 0.176776695 */,
- MAD_F(0x0260dfc1) /* 0.148650889 */,
- MAD_F(0x02000000) /* 0.125000000 */,
- MAD_F(0x01ae89fa) /* 0.105112052 */,
- MAD_F(0x016a09e6) /* 0.088388348 */,
- MAD_F(0x01306fe1) /* 0.074325445 */
- }, {
- MAD_F(0x0b504f33) /* 0.707106781 */,
- MAD_F(0x08000000) /* 0.500000000 */,
- MAD_F(0x05a8279a) /* 0.353553391 */,
- MAD_F(0x04000000) /* 0.250000000 */,
- MAD_F(0x02d413cd) /* 0.176776695 */,
- MAD_F(0x02000000) /* 0.125000000 */,
- MAD_F(0x016a09e6) /* 0.088388348 */,
- MAD_F(0x01000000) /* 0.062500000 */,
- MAD_F(0x00b504f3) /* 0.044194174 */,
- MAD_F(0x00800000) /* 0.031250000 */,
- MAD_F(0x005a827a) /* 0.022097087 */,
- MAD_F(0x00400000) /* 0.015625000 */,
- MAD_F(0x002d413d) /* 0.011048543 */,
- MAD_F(0x00200000) /* 0.007812500 */,
- MAD_F(0x0016a09e) /* 0.005524272 */
- }
-};
-
-/*
- * NAME: III_sideinfo()
- * DESCRIPTION: decode frame side information from a bitstream
- */
-static
-enum mad_error III_sideinfo(struct mad_bitptr *ptr, unsigned int nch,
- int lsf, struct sideinfo *si,
- unsigned int *data_bitlen,
- unsigned int *priv_bitlen)
-{
- unsigned int ngr, gr, ch, i;
- enum mad_error result = MAD_ERROR_NONE;
-
- *data_bitlen = 0;
- *priv_bitlen = lsf ? ((nch == 1) ? 1 : 2) : ((nch == 1) ? 5 : 3);
-
- si->main_data_begin = mad_bit_read(ptr, lsf ? 8 : 9);
- si->private_bits = mad_bit_read(ptr, *priv_bitlen);
-
- ngr = 1;
- if (!lsf) {
- ngr = 2;
-
- for (ch = 0; ch < nch; ++ch)
- si->scfsi[ch] = mad_bit_read(ptr, 4);
- }
-
- for (gr = 0; gr < ngr; ++gr) {
- struct granule *granule = &si->gr[gr];
-
- for (ch = 0; ch < nch; ++ch) {
- struct channel *channel = &granule->ch[ch];
-
- channel->part2_3_length = mad_bit_read(ptr, 12);
- channel->big_values = mad_bit_read(ptr, 9);
- channel->global_gain = mad_bit_read(ptr, 8);
- channel->scalefac_compress = mad_bit_read(ptr, lsf ? 9 : 4);
-
- *data_bitlen += channel->part2_3_length;
-
- if (channel->big_values > 288 && result == 0)
- result = MAD_ERROR_BADBIGVALUES;
-
- channel->flags = 0;
-
- /* window_switching_flag */
- if (mad_bit_read(ptr, 1)) {
- channel->block_type = mad_bit_read(ptr, 2);
-
- if (channel->block_type == 0 && result == 0)
- result = MAD_ERROR_BADBLOCKTYPE;
-
- if (!lsf && channel->block_type == 2 && si->scfsi[ch] && result == 0)
- result = MAD_ERROR_BADSCFSI;
-
- channel->region0_count = 7;
- channel->region1_count = 36;
-
- if (mad_bit_read(ptr, 1))
- channel->flags |= mixed_block_flag;
- else if (channel->block_type == 2)
- channel->region0_count = 8;
-
- for (i = 0; i < 2; ++i)
- channel->table_select[i] = mad_bit_read(ptr, 5);
-
-# if defined(DEBUG)
- channel->table_select[2] = 4; /* not used */
-# endif
-
- for (i = 0; i < 3; ++i)
- channel->subblock_gain[i] = mad_bit_read(ptr, 3);
- }
- else {
- channel->block_type = 0;
-
- for (i = 0; i < 3; ++i)
- channel->table_select[i] = mad_bit_read(ptr, 5);
-
- channel->region0_count = mad_bit_read(ptr, 4);
- channel->region1_count = mad_bit_read(ptr, 3);
- }
-
- /* [preflag,] scalefac_scale, count1table_select */
- channel->flags |= mad_bit_read(ptr, lsf ? 2 : 3);
- }
- }
-
- return result;
-}
-
-/*
- * NAME: III_scalefactors_lsf()
- * DESCRIPTION: decode channel scalefactors for LSF from a bitstream
- */
-static
-unsigned int III_scalefactors_lsf(struct mad_bitptr *ptr,
- struct channel *channel,
- struct channel *gr1ch, int mode_extension)
-{
- struct mad_bitptr start;
- unsigned int scalefac_compress, index, slen[4], part, n, i;
- unsigned char const *nsfb;
-
- start = *ptr;
-
- scalefac_compress = channel->scalefac_compress;
- index = (channel->block_type == 2) ?
- ((channel->flags & mixed_block_flag) ? 2 : 1) : 0;
-
- if (!((mode_extension & I_STEREO) && gr1ch)) {
- if (scalefac_compress < 400) {
- slen[0] = (scalefac_compress >> 4) / 5;
- slen[1] = (scalefac_compress >> 4) % 5;
- slen[2] = (scalefac_compress % 16) >> 2;
- slen[3] = scalefac_compress % 4;
-
- nsfb = nsfb_table[0][index];
- }
- else if (scalefac_compress < 500) {
- scalefac_compress -= 400;
-
- slen[0] = (scalefac_compress >> 2) / 5;
- slen[1] = (scalefac_compress >> 2) % 5;
- slen[2] = scalefac_compress % 4;
- slen[3] = 0;
-
- nsfb = nsfb_table[1][index];
- }
- else {
- scalefac_compress -= 500;
-
- slen[0] = scalefac_compress / 3;
- slen[1] = scalefac_compress % 3;
- slen[2] = 0;
- slen[3] = 0;
-
- channel->flags |= preflag;
-
- nsfb = nsfb_table[2][index];
- }
-
- n = 0;
- for (part = 0; part < 4; ++part) {
- for (i = 0; i < nsfb[part]; ++i)
- channel->scalefac[n++] = mad_bit_read(ptr, slen[part]);
- }
-
- while (n < 39)
- channel->scalefac[n++] = 0;
- }
- else { /* (mode_extension & I_STEREO) && gr1ch (i.e. ch == 1) */
- scalefac_compress >>= 1;
-
- if (scalefac_compress < 180) {
- slen[0] = scalefac_compress / 36;
- slen[1] = (scalefac_compress % 36) / 6;
- slen[2] = (scalefac_compress % 36) % 6;
- slen[3] = 0;
-
- nsfb = nsfb_table[3][index];
- }
- else if (scalefac_compress < 244) {
- scalefac_compress -= 180;
-
- slen[0] = (scalefac_compress % 64) >> 4;
- slen[1] = (scalefac_compress % 16) >> 2;
- slen[2] = scalefac_compress % 4;
- slen[3] = 0;
-
- nsfb = nsfb_table[4][index];
- }
- else {
- scalefac_compress -= 244;
-
- slen[0] = scalefac_compress / 3;
- slen[1] = scalefac_compress % 3;
- slen[2] = 0;
- slen[3] = 0;
-
- nsfb = nsfb_table[5][index];
- }
-
- n = 0;
- for (part = 0; part < 4; ++part) {
- unsigned int max, is_pos;
-
- max = (1 << slen[part]) - 1;
-
- for (i = 0; i < nsfb[part]; ++i) {
- is_pos = mad_bit_read(ptr, slen[part]);
-
- channel->scalefac[n] = is_pos;
- gr1ch->scalefac[n++] = (is_pos == max);
- }
- }
-
- while (n < 39) {
- channel->scalefac[n] = 0;
- gr1ch->scalefac[n++] = 0; /* apparently not illegal */
- }
- }
-
- return mad_bit_length(&start, ptr);
-}
-
-/*
- * NAME: III_scalefactors()
- * DESCRIPTION: decode channel scalefactors of one granule from a bitstream
- */
-static
-unsigned int III_scalefactors(struct mad_bitptr *ptr, struct channel *channel,
- struct channel const *gr0ch, unsigned int scfsi)
-{
- struct mad_bitptr start;
- unsigned int slen1, slen2, sfbi;
-
- start = *ptr;
-
- slen1 = sflen_table[channel->scalefac_compress].slen1;
- slen2 = sflen_table[channel->scalefac_compress].slen2;
-
- if (channel->block_type == 2) {
- unsigned int nsfb;
-
- sfbi = 0;
-
- nsfb = (channel->flags & mixed_block_flag) ? 8 + 3 * 3 : 6 * 3;
- while (nsfb--)
- channel->scalefac[sfbi++] = mad_bit_read(ptr, slen1);
-
- nsfb = 6 * 3;
- while (nsfb--)
- channel->scalefac[sfbi++] = mad_bit_read(ptr, slen2);
-
- nsfb = 1 * 3;
- while (nsfb--)
- channel->scalefac[sfbi++] = 0;
- }
- else { /* channel->block_type != 2 */
- if (scfsi & 0x8) {
- for (sfbi = 0; sfbi < 6; ++sfbi)
- channel->scalefac[sfbi] = gr0ch->scalefac[sfbi];
- }
- else {
- for (sfbi = 0; sfbi < 6; ++sfbi)
- channel->scalefac[sfbi] = mad_bit_read(ptr, slen1);
- }
-
- if (scfsi & 0x4) {
- for (sfbi = 6; sfbi < 11; ++sfbi)
- channel->scalefac[sfbi] = gr0ch->scalefac[sfbi];
- }
- else {
- for (sfbi = 6; sfbi < 11; ++sfbi)
- channel->scalefac[sfbi] = mad_bit_read(ptr, slen1);
- }
-
- if (scfsi & 0x2) {
- for (sfbi = 11; sfbi < 16; ++sfbi)
- channel->scalefac[sfbi] = gr0ch->scalefac[sfbi];
- }
- else {
- for (sfbi = 11; sfbi < 16; ++sfbi)
- channel->scalefac[sfbi] = mad_bit_read(ptr, slen2);
- }
-
- if (scfsi & 0x1) {
- for (sfbi = 16; sfbi < 21; ++sfbi)
- channel->scalefac[sfbi] = gr0ch->scalefac[sfbi];
- }
- else {
- for (sfbi = 16; sfbi < 21; ++sfbi)
- channel->scalefac[sfbi] = mad_bit_read(ptr, slen2);
- }
-
- channel->scalefac[21] = 0;
- }
-
- return mad_bit_length(&start, ptr);
-}
-
-/*
- * The Layer III formula for requantization and scaling is defined by
- * section 2.4.3.4.7.1 of ISO/IEC 11172-3, as follows:
- *
- * long blocks:
- * xr[i] = sign(is[i]) * abs(is[i])^(4/3) *
- * 2^((1/4) * (global_gain - 210)) *
- * 2^-(scalefac_multiplier *
- * (scalefac_l[sfb] + preflag * pretab[sfb]))
- *
- * short blocks:
- * xr[i] = sign(is[i]) * abs(is[i])^(4/3) *
- * 2^((1/4) * (global_gain - 210 - 8 * subblock_gain[w])) *
- * 2^-(scalefac_multiplier * scalefac_s[sfb][w])
- *
- * where:
- * scalefac_multiplier = (scalefac_scale + 1) / 2
- *
- * The routines III_exponents() and III_requantize() facilitate this
- * calculation.
- */
-
-/*
- * NAME: III_exponents()
- * DESCRIPTION: calculate scalefactor exponents
- */
-static
-void III_exponents(struct channel const *channel,
- unsigned char const *sfbwidth, signed int exponents[39])
-{
- signed int gain;
- unsigned int scalefac_multiplier, sfbi;
-
- gain = (signed int) channel->global_gain - 210;
- scalefac_multiplier = (channel->flags & scalefac_scale) ? 2 : 1;
-
- if (channel->block_type == 2) {
- unsigned int l;
- signed int gain0, gain1, gain2;
-
- sfbi = l = 0;
-
- if (channel->flags & mixed_block_flag) {
- unsigned int premask;
-
- premask = (channel->flags & preflag) ? ~0 : 0;
-
- /* long block subbands 0-1 */
-
- while (l < 36) {
- exponents[sfbi] = gain -
- (signed int) ((channel->scalefac[sfbi] + (pretab[sfbi] & premask)) <<
- scalefac_multiplier);
-
- l += sfbwidth[sfbi++];
- }
- }
-
- /* this is probably wrong for 8000 Hz short/mixed blocks */
-
- gain0 = gain - 8 * (signed int) channel->subblock_gain[0];
- gain1 = gain - 8 * (signed int) channel->subblock_gain[1];
- gain2 = gain - 8 * (signed int) channel->subblock_gain[2];
-
- while (l < 576) {
- exponents[sfbi + 0] = gain0 -
- (signed int) (channel->scalefac[sfbi + 0] << scalefac_multiplier);
- exponents[sfbi + 1] = gain1 -
- (signed int) (channel->scalefac[sfbi + 1] << scalefac_multiplier);
- exponents[sfbi + 2] = gain2 -
- (signed int) (channel->scalefac[sfbi + 2] << scalefac_multiplier);
-
- l += 3 * sfbwidth[sfbi];
- sfbi += 3;
- }
- }
- else { /* channel->block_type != 2 */
- if (channel->flags & preflag) {
- for (sfbi = 0; sfbi < 22; ++sfbi) {
- exponents[sfbi] = gain -
- (signed int) ((channel->scalefac[sfbi] + pretab[sfbi]) <<
- scalefac_multiplier);
- }
- }
- else {
- for (sfbi = 0; sfbi < 22; ++sfbi) {
- exponents[sfbi] = gain -
- (signed int) (channel->scalefac[sfbi] << scalefac_multiplier);
- }
- }
- }
-}
-
-/*
- * NAME: III_requantize()
- * DESCRIPTION: requantize one (positive) value
- */
-static
-mad_fixed_t III_requantize(unsigned int value, signed int exp)
-{
- mad_fixed_t requantized;
- signed int frac;
- struct fixedfloat const *power;
-
- frac = exp % 4; /* assumes sign(frac) == sign(exp) */
- exp /= 4;
-
- power = &rq_table[value];
- requantized = power->mantissa;
- exp += power->exponent;
-
- if (exp < 0) {
- if (-exp >= sizeof(mad_fixed_t) * CHAR_BIT) {
- /* underflow */
- requantized = 0;
- }
- else {
- requantized += 1L << (-exp - 1);
- requantized >>= -exp;
- }
- }
- else {
- if (exp >= 5) {
- /* overflow */
-# if defined(DEBUG)
- fprintf(stderr, "requantize overflow (%f * 2^%d)\n",
- mad_f_todouble(requantized), exp);
-# endif
- requantized = MAD_F_MAX;
- }
- else
- requantized <<= exp;
- }
-
- return frac ? mad_f_mul(requantized, root_table[3 + frac]) : requantized;
-}
-
-/* we must take care that sz >= bits and sz < sizeof(long) lest bits == 0 */
-# define MASK(cache, sz, bits) \
- (((cache) >> ((sz) - (bits))) & ((1 << (bits)) - 1))
-# define MASK1BIT(cache, sz) \
- ((cache) & (1 << ((sz) - 1)))
-
-/*
- * NAME: III_huffdecode()
- * DESCRIPTION: decode Huffman code words of one channel of one granule
- */
-static
-enum mad_error III_huffdecode(struct mad_bitptr *ptr, mad_fixed_t xr[576],
- struct channel *channel,
- unsigned char const *sfbwidth,
- unsigned int part2_length)
-{
- signed int exponents[39], exp;
- signed int const *expptr;
- struct mad_bitptr peek;
- signed int bits_left, cachesz;
- register mad_fixed_t *xrptr;
- mad_fixed_t const *sfbound;
- register unsigned long bitcache;
-
- bits_left = (signed) channel->part2_3_length - (signed) part2_length;
- if (bits_left < 0)
- return MAD_ERROR_BADPART3LEN;
-
- III_exponents(channel, sfbwidth, exponents);
-
- peek = *ptr;
- mad_bit_skip(ptr, bits_left);
-
- /* align bit reads to byte boundaries */
- cachesz = mad_bit_bitsleft(&peek);
- cachesz += ((32 - 1 - 24) + (24 - cachesz)) & ~7;
-
- bitcache = mad_bit_read(&peek, cachesz);
- bits_left -= cachesz;
-
- xrptr = &xr[0];
-
- /* big_values */
- {
- unsigned int region, rcount;
- struct hufftable const *entry;
- union huffpair const *table;
- unsigned int linbits, startbits, big_values, reqhits;
- mad_fixed_t reqcache[16];
-
- sfbound = xrptr + *sfbwidth++;
- rcount = channel->region0_count + 1;
-
- entry = &mad_huff_pair_table[channel->table_select[region = 0]];
- table = entry->table;
- linbits = entry->linbits;
- startbits = entry->startbits;
-
- if (table == 0)
- return MAD_ERROR_BADHUFFTABLE;
-
- expptr = &exponents[0];
- exp = *expptr++;
- reqhits = 0;
-
- big_values = channel->big_values;
-
- while (big_values-- && cachesz + bits_left > 0) {
- union huffpair const *pair;
- unsigned int clumpsz, value;
- register mad_fixed_t requantized;
-
- if (xrptr == sfbound) {
- sfbound += *sfbwidth++;
-
- /* change table if region boundary */
-
- if (--rcount == 0) {
- if (region == 0)
- rcount = channel->region1_count + 1;
- else
- rcount = 0; /* all remaining */
-
- entry = &mad_huff_pair_table[channel->table_select[++region]];
- table = entry->table;
- linbits = entry->linbits;
- startbits = entry->startbits;
-
- if (table == 0)
- return MAD_ERROR_BADHUFFTABLE;
- }
-
- if (exp != *expptr) {
- exp = *expptr;
- reqhits = 0;
- }
-
- ++expptr;
- }
-
- if (cachesz < 21) {
- unsigned int bits;
-
- bits = ((32 - 1 - 21) + (21 - cachesz)) & ~7;
- bitcache = (bitcache << bits) | mad_bit_read(&peek, bits);
- cachesz += bits;
- bits_left -= bits;
- }
-
- /* hcod (0..19) */
-
- clumpsz = startbits;
- pair = &table[MASK(bitcache, cachesz, clumpsz)];
-
- while (!pair->final) {
- cachesz -= clumpsz;
-
- clumpsz = pair->ptr.bits;
- pair = &table[pair->ptr.offset + MASK(bitcache, cachesz, clumpsz)];
- }
-
- cachesz -= pair->value.hlen;
-
- if (linbits) {
- /* x (0..14) */
-
- value = pair->value.x;
-
- switch (value) {
- case 0:
- xrptr[0] = 0;
- break;
-
- case 15:
- if (cachesz < linbits + 2) {
- bitcache = (bitcache << 16) | mad_bit_read(&peek, 16);
- cachesz += 16;
- bits_left -= 16;
- }
-
- value += MASK(bitcache, cachesz, linbits);
- cachesz -= linbits;
-
- requantized = III_requantize(value, exp);
- goto x_final;
-
- default:
- if (reqhits & (1 << value))
- requantized = reqcache[value];
- else {
- reqhits |= (1 << value);
- requantized = reqcache[value] = III_requantize(value, exp);
- }
-
- x_final:
- xrptr[0] = MASK1BIT(bitcache, cachesz--) ?
- -requantized : requantized;
- }
-
- /* y (0..14) */
-
- value = pair->value.y;
-
- switch (value) {
- case 0:
- xrptr[1] = 0;
- break;
-
- case 15:
- if (cachesz < linbits + 1) {
- bitcache = (bitcache << 16) | mad_bit_read(&peek, 16);
- cachesz += 16;
- bits_left -= 16;
- }
-
- value += MASK(bitcache, cachesz, linbits);
- cachesz -= linbits;
-
- requantized = III_requantize(value, exp);
- goto y_final;
-
- default:
- if (reqhits & (1 << value))
- requantized = reqcache[value];
- else {
- reqhits |= (1 << value);
- requantized = reqcache[value] = III_requantize(value, exp);
- }
-
- y_final:
- xrptr[1] = MASK1BIT(bitcache, cachesz--) ?
- -requantized : requantized;
- }
- }
- else {
- /* x (0..1) */
-
- value = pair->value.x;
-
- if (value == 0)
- xrptr[0] = 0;
- else {
- if (reqhits & (1 << value))
- requantized = reqcache[value];
- else {
- reqhits |= (1 << value);
- requantized = reqcache[value] = III_requantize(value, exp);
- }
-
- xrptr[0] = MASK1BIT(bitcache, cachesz--) ?
- -requantized : requantized;
- }
-
- /* y (0..1) */
-
- value = pair->value.y;
-
- if (value == 0)
- xrptr[1] = 0;
- else {
- if (reqhits & (1 << value))
- requantized = reqcache[value];
- else {
- reqhits |= (1 << value);
- requantized = reqcache[value] = III_requantize(value, exp);
- }
-
- xrptr[1] = MASK1BIT(bitcache, cachesz--) ?
- -requantized : requantized;
- }
- }
-
- xrptr += 2;
- }
- }
-
- if (cachesz + bits_left < 0)
- return MAD_ERROR_BADHUFFDATA; /* big_values overrun */
-
- /* count1 */
- {
- union huffquad const *table;
- register mad_fixed_t requantized;
-
- table = mad_huff_quad_table[channel->flags & count1table_select];
-
- requantized = III_requantize(1, exp);
-
- while (cachesz + bits_left > 0 && xrptr <= &xr[572]) {
- union huffquad const *quad;
-
- /* hcod (1..6) */
-
- if (cachesz < 10) {
- bitcache = (bitcache << 16) | mad_bit_read(&peek, 16);
- cachesz += 16;
- bits_left -= 16;
- }
-
- quad = &table[MASK(bitcache, cachesz, 4)];
-
- /* quad tables guaranteed to have at most one extra lookup */
- if (!quad->final) {
- cachesz -= 4;
-
- quad = &table[quad->ptr.offset +
- MASK(bitcache, cachesz, quad->ptr.bits)];
- }
-
- cachesz -= quad->value.hlen;
-
- if (xrptr == sfbound) {
- sfbound += *sfbwidth++;
-
- if (exp != *expptr) {
- exp = *expptr;
- requantized = III_requantize(1, exp);
- }
-
- ++expptr;
- }
-
- /* v (0..1) */
-
- xrptr[0] = quad->value.v ?
- (MASK1BIT(bitcache, cachesz--) ? -requantized : requantized) : 0;
-
- /* w (0..1) */
-
- xrptr[1] = quad->value.w ?
- (MASK1BIT(bitcache, cachesz--) ? -requantized : requantized) : 0;
-
- xrptr += 2;
-
- if (xrptr == sfbound) {
- sfbound += *sfbwidth++;
-
- if (exp != *expptr) {
- exp = *expptr;
- requantized = III_requantize(1, exp);
- }
-
- ++expptr;
- }
-
- /* x (0..1) */
-
- xrptr[0] = quad->value.x ?
- (MASK1BIT(bitcache, cachesz--) ? -requantized : requantized) : 0;
-
- /* y (0..1) */
-
- xrptr[1] = quad->value.y ?
- (MASK1BIT(bitcache, cachesz--) ? -requantized : requantized) : 0;
-
- xrptr += 2;
- }
-
- if (cachesz + bits_left < 0) {
-# if 0 && defined(DEBUG)
- fprintf(stderr, "huffman count1 overrun (%d bits)\n",
- -(cachesz + bits_left));
-# endif
-
- /* technically the bitstream is misformatted, but apparently
- some encoders are just a bit sloppy with stuffing bits */
-
- xrptr -= 4;
- }
- }
-
- assert(-bits_left <= MAD_BUFFER_GUARD * CHAR_BIT);
-
-# if 0 && defined(DEBUG)
- if (bits_left < 0)
- fprintf(stderr, "read %d bits too many\n", -bits_left);
- else if (cachesz + bits_left > 0)
- fprintf(stderr, "%d stuffing bits\n", cachesz + bits_left);
-# endif
-
- /* rzero */
- while (xrptr < &xr[576]) {
- xrptr[0] = 0;
- xrptr[1] = 0;
-
- xrptr += 2;
- }
-
- return MAD_ERROR_NONE;
-}
-
-# undef MASK
-# undef MASK1BIT
-
-/*
- * NAME: III_reorder()
- * DESCRIPTION: reorder frequency lines of a short block into subband order
- */
-static
-void III_reorder(mad_fixed_t xr[576], struct channel const *channel,
- unsigned char const sfbwidth[39])
-{
- mad_fixed_t tmp[32][3][6];
- unsigned int sb, l, f, w, sbw[3], sw[3];
-
- /* this is probably wrong for 8000 Hz mixed blocks */
-
- sb = 0;
- if (channel->flags & mixed_block_flag) {
- sb = 2;
-
- l = 0;
- while (l < 36)
- l += *sfbwidth++;
- }
-
- for (w = 0; w < 3; ++w) {
- sbw[w] = sb;
- sw[w] = 0;
- }
-
- f = *sfbwidth++;
- w = 0;
-
- for (l = 18 * sb; l < 576; ++l) {
- if (f-- == 0) {
- f = *sfbwidth++ - 1;
- w = (w + 1) % 3;
- }
-
- tmp[sbw[w]][w][sw[w]++] = xr[l];
-
- if (sw[w] == 6) {
- sw[w] = 0;
- ++sbw[w];
- }
- }
-
- memcpy(&xr[18 * sb], &tmp[sb], (576 - 18 * sb) * sizeof(mad_fixed_t));
-}
-
-/*
- * NAME: III_stereo()
- * DESCRIPTION: perform joint stereo processing on a granule
- */
-static
-enum mad_error III_stereo(mad_fixed_t xr[2][576],
- struct granule const *granule,
- struct mad_header *header,
- unsigned char const *sfbwidth)
-{
- short modes[39];
- unsigned int sfbi, l, n, i;
-
- if (granule->ch[0].block_type !=
- granule->ch[1].block_type ||
- (granule->ch[0].flags & mixed_block_flag) !=
- (granule->ch[1].flags & mixed_block_flag))
- return MAD_ERROR_BADSTEREO;
-
- for (i = 0; i < 39; ++i)
- modes[i] = header->mode_extension;
-
- /* intensity stereo */
-
- if (header->mode_extension & I_STEREO) {
- struct channel const *right_ch = &granule->ch[1];
- mad_fixed_t const *right_xr = xr[1];
- unsigned int is_pos;
-
- header->flags |= MAD_FLAG_I_STEREO;
-
- /* first determine which scalefactor bands are to be processed */
-
- if (right_ch->block_type == 2) {
- unsigned int lower, start, max, bound[3], w;
-
- lower = start = max = bound[0] = bound[1] = bound[2] = 0;
-
- sfbi = l = 0;
-
- if (right_ch->flags & mixed_block_flag) {
- while (l < 36) {
- n = sfbwidth[sfbi++];
-
- for (i = 0; i < n; ++i) {
- if (right_xr[i]) {
- lower = sfbi;
- break;
- }
- }
-
- right_xr += n;
- l += n;
- }
-
- start = sfbi;
- }
-
- w = 0;
- while (l < 576) {
- n = sfbwidth[sfbi++];
-
- for (i = 0; i < n; ++i) {
- if (right_xr[i]) {
- max = bound[w] = sfbi;
- break;
- }
- }
-
- right_xr += n;
- l += n;
- w = (w + 1) % 3;
- }
-
- if (max)
- lower = start;
-
- /* long blocks */
-
- for (i = 0; i < lower; ++i)
- modes[i] = header->mode_extension & ~I_STEREO;
-
- /* short blocks */
-
- w = 0;
- for (i = start; i < max; ++i) {
- if (i < bound[w])
- modes[i] = header->mode_extension & ~I_STEREO;
-
- w = (w + 1) % 3;
- }
- }
- else { /* right_ch->block_type != 2 */
- unsigned int bound;
-
- bound = 0;
- for (sfbi = l = 0; l < 576; l += n) {
- n = sfbwidth[sfbi++];
-
- for (i = 0; i < n; ++i) {
- if (right_xr[i]) {
- bound = sfbi;
- break;
- }
- }
-
- right_xr += n;
- }
-
- for (i = 0; i < bound; ++i)
- modes[i] = header->mode_extension & ~I_STEREO;
- }
-
- /* now do the actual processing */
-
- if (header->flags & MAD_FLAG_LSF_EXT) {
- unsigned char const *illegal_pos = granule[1].ch[1].scalefac;
- mad_fixed_t const *lsf_scale;
-
- /* intensity_scale */
- lsf_scale = is_lsf_table[right_ch->scalefac_compress & 0x1];
-
- for (sfbi = l = 0; l < 576; ++sfbi, l += n) {
- n = sfbwidth[sfbi];
-
- if (!(modes[sfbi] & I_STEREO))
- continue;
-
- if (illegal_pos[sfbi]) {
- modes[sfbi] &= ~I_STEREO;
- continue;
- }
-
- is_pos = right_ch->scalefac[sfbi];
-
- for (i = 0; i < n; ++i) {
- register mad_fixed_t left;
-
- left = xr[0][l + i];
-
- if (is_pos == 0)
- xr[1][l + i] = left;
- else {
- register mad_fixed_t opposite;
-
- opposite = mad_f_mul(left, lsf_scale[(is_pos - 1) / 2]);
-
- if (is_pos & 1) {
- xr[0][l + i] = opposite;
- xr[1][l + i] = left;
- }
- else
- xr[1][l + i] = opposite;
- }
- }
- }
- }
- else { /* !(header->flags & MAD_FLAG_LSF_EXT) */
- for (sfbi = l = 0; l < 576; ++sfbi, l += n) {
- n = sfbwidth[sfbi];
-
- if (!(modes[sfbi] & I_STEREO))
- continue;
-
- is_pos = right_ch->scalefac[sfbi];
-
- if (is_pos >= 7) { /* illegal intensity position */
- modes[sfbi] &= ~I_STEREO;
- continue;
- }
-
- for (i = 0; i < n; ++i) {
- register mad_fixed_t left;
-
- left = xr[0][l + i];
-
- xr[0][l + i] = mad_f_mul(left, is_table[ is_pos]);
- xr[1][l + i] = mad_f_mul(left, is_table[6 - is_pos]);
- }
- }
- }
- }
-
- /* middle/side stereo */
-
- if (header->mode_extension & MS_STEREO) {
- register mad_fixed_t invsqrt2;
-
- header->flags |= MAD_FLAG_MS_STEREO;
-
- invsqrt2 = root_table[3 + -2];
-
- for (sfbi = l = 0; l < 576; ++sfbi, l += n) {
- n = sfbwidth[sfbi];
-
- if (modes[sfbi] != MS_STEREO)
- continue;
-
- for (i = 0; i < n; ++i) {
- register mad_fixed_t m, s;
-
- m = xr[0][l + i];
- s = xr[1][l + i];
-
- xr[0][l + i] = mad_f_mul(m + s, invsqrt2); /* l = (m + s) / sqrt(2) */
- xr[1][l + i] = mad_f_mul(m - s, invsqrt2); /* r = (m - s) / sqrt(2) */
- }
- }
- }
-
- return MAD_ERROR_NONE;
-}
-
-/*
- * NAME: III_aliasreduce()
- * DESCRIPTION: perform frequency line alias reduction
- */
-static
-void III_aliasreduce(mad_fixed_t xr[576], int lines)
-{
- mad_fixed_t const *bound;
- int i;
-
- bound = &xr[lines];
- for (xr += 18; xr < bound; xr += 18) {
- for (i = 0; i < 8; ++i) {
- register mad_fixed_t a, b;
- register mad_fixed64hi_t hi = 0;
- register mad_fixed64lo_t lo = 0;
-
- a = xr[-1 - i];
- b = xr[ i];
-
-# if defined(ASO_ZEROCHECK)
- if (a | b) {
-# endif
- MAD_F_ML0(hi, lo, a, cs[i]);
- MAD_F_MLA(hi, lo, -b, ca[i]);
-
- xr[-1 - i] = MAD_F_MLZ(hi, lo);
-
- MAD_F_ML0(hi, lo, b, cs[i]);
- MAD_F_MLA(hi, lo, a, ca[i]);
-
- xr[ i] = MAD_F_MLZ(hi, lo);
-# if defined(ASO_ZEROCHECK)
- }
-# endif
- }
- }
-}
-
-# if defined(ASO_IMDCT)
-void III_imdct_l(mad_fixed_t const [18], mad_fixed_t [36], unsigned int);
-# else
-# if 1
-static
-void fastsdct(mad_fixed_t const x[9], mad_fixed_t y[18])
-{
- mad_fixed_t a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12;
- mad_fixed_t a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25;
- mad_fixed_t m0, m1, m2, m3, m4, m5, m6, m7;
-
- enum {
- c0 = MAD_F(0x1f838b8d), /* 2 * cos( 1 * PI / 18) */
- c1 = MAD_F(0x1bb67ae8), /* 2 * cos( 3 * PI / 18) */
- c2 = MAD_F(0x18836fa3), /* 2 * cos( 4 * PI / 18) */
- c3 = MAD_F(0x1491b752), /* 2 * cos( 5 * PI / 18) */
- c4 = MAD_F(0x0af1d43a), /* 2 * cos( 7 * PI / 18) */
- c5 = MAD_F(0x058e86a0), /* 2 * cos( 8 * PI / 18) */
- c6 = -MAD_F(0x1e11f642) /* 2 * cos(16 * PI / 18) */
- };
-
- a0 = x[3] + x[5];
- a1 = x[3] - x[5];
- a2 = x[6] + x[2];
- a3 = x[6] - x[2];
- a4 = x[1] + x[7];
- a5 = x[1] - x[7];
- a6 = x[8] + x[0];
- a7 = x[8] - x[0];
-
- a8 = a0 + a2;
- a9 = a0 - a2;
- a10 = a0 - a6;
- a11 = a2 - a6;
- a12 = a8 + a6;
- a13 = a1 - a3;
- a14 = a13 + a7;
- a15 = a3 + a7;
- a16 = a1 - a7;
- a17 = a1 + a3;
-
- m0 = mad_f_mul(a17, -c3);
- m1 = mad_f_mul(a16, -c0);
- m2 = mad_f_mul(a15, -c4);
- m3 = mad_f_mul(a14, -c1);
- m4 = mad_f_mul(a5, -c1);
- m5 = mad_f_mul(a11, -c6);
- m6 = mad_f_mul(a10, -c5);
- m7 = mad_f_mul(a9, -c2);
-
- a18 = x[4] + a4;
- a19 = 2 * x[4] - a4;
- a20 = a19 + m5;
- a21 = a19 - m5;
- a22 = a19 + m6;
- a23 = m4 + m2;
- a24 = m4 - m2;
- a25 = m4 + m1;
-
- /* output to every other slot for convenience */
-
- y[ 0] = a18 + a12;
- y[ 2] = m0 - a25;
- y[ 4] = m7 - a20;
- y[ 6] = m3;
- y[ 8] = a21 - m6;
- y[10] = a24 - m1;
- y[12] = a12 - 2 * a18;
- y[14] = a23 + m0;
- y[16] = a22 + m7;
-}
-
-static inline
-void sdctII(mad_fixed_t const x[18], mad_fixed_t X[18])
-{
- mad_fixed_t tmp[9];
- int i;
-
- /* scale[i] = 2 * cos(PI * (2 * i + 1) / (2 * 18)) */
- static mad_fixed_t const scale[9] = {
- MAD_F(0x1fe0d3b4), MAD_F(0x1ee8dd47), MAD_F(0x1d007930),
- MAD_F(0x1a367e59), MAD_F(0x16a09e66), MAD_F(0x125abcf8),
- MAD_F(0x0d8616bc), MAD_F(0x08483ee1), MAD_F(0x02c9fad7)
- };
-
- /* divide the 18-point SDCT-II into two 9-point SDCT-IIs */
-
- /* even input butterfly */
-
- for (i = 0; i < 9; i += 3) {
- tmp[i + 0] = x[i + 0] + x[18 - (i + 0) - 1];
- tmp[i + 1] = x[i + 1] + x[18 - (i + 1) - 1];
- tmp[i + 2] = x[i + 2] + x[18 - (i + 2) - 1];
- }
-
- fastsdct(tmp, &X[0]);
-
- /* odd input butterfly and scaling */
-
- for (i = 0; i < 9; i += 3) {
- tmp[i + 0] = mad_f_mul(x[i + 0] - x[18 - (i + 0) - 1], scale[i + 0]);
- tmp[i + 1] = mad_f_mul(x[i + 1] - x[18 - (i + 1) - 1], scale[i + 1]);
- tmp[i + 2] = mad_f_mul(x[i + 2] - x[18 - (i + 2) - 1], scale[i + 2]);
- }
-
- fastsdct(tmp, &X[1]);
-
- /* output accumulation */
-
- for (i = 3; i < 18; i += 8) {
- X[i + 0] -= X[(i + 0) - 2];
- X[i + 2] -= X[(i + 2) - 2];
- X[i + 4] -= X[(i + 4) - 2];
- X[i + 6] -= X[(i + 6) - 2];
- }
-}
-
-static inline
-void dctIV(mad_fixed_t const y[18], mad_fixed_t X[18])
-{
- mad_fixed_t tmp[18];
- int i;
-
- /* scale[i] = 2 * cos(PI * (2 * i + 1) / (4 * 18)) */
- static mad_fixed_t const scale[18] = {
- MAD_F(0x1ff833fa), MAD_F(0x1fb9ea93), MAD_F(0x1f3dd120),
- MAD_F(0x1e84d969), MAD_F(0x1d906bcf), MAD_F(0x1c62648b),
- MAD_F(0x1afd100f), MAD_F(0x1963268b), MAD_F(0x1797c6a4),
- MAD_F(0x159e6f5b), MAD_F(0x137af940), MAD_F(0x11318ef3),
- MAD_F(0x0ec6a507), MAD_F(0x0c3ef153), MAD_F(0x099f61c5),
- MAD_F(0x06ed12c5), MAD_F(0x042d4544), MAD_F(0x0165547c)
- };
-
- /* scaling */
-
- for (i = 0; i < 18; i += 3) {
- tmp[i + 0] = mad_f_mul(y[i + 0], scale[i + 0]);
- tmp[i + 1] = mad_f_mul(y[i + 1], scale[i + 1]);
- tmp[i + 2] = mad_f_mul(y[i + 2], scale[i + 2]);
- }
-
- /* SDCT-II */
-
- sdctII(tmp, X);
-
- /* scale reduction and output accumulation */
-
- X[0] /= 2;
- for (i = 1; i < 17; i += 4) {
- X[i + 0] = X[i + 0] / 2 - X[(i + 0) - 1];
- X[i + 1] = X[i + 1] / 2 - X[(i + 1) - 1];
- X[i + 2] = X[i + 2] / 2 - X[(i + 2) - 1];
- X[i + 3] = X[i + 3] / 2 - X[(i + 3) - 1];
- }
- X[17] = X[17] / 2 - X[16];
-}
-
-/*
- * NAME: imdct36
- * DESCRIPTION: perform X[18]->x[36] IMDCT using Szu-Wei Lee's fast algorithm
- */
-static inline
-void imdct36(mad_fixed_t const x[18], mad_fixed_t y[36])
-{
- mad_fixed_t tmp[18];
- int i;
-
- /* DCT-IV */
-
- dctIV(x, tmp);
-
- /* convert 18-point DCT-IV to 36-point IMDCT */
-
- for (i = 0; i < 9; i += 3) {
- y[i + 0] = tmp[9 + (i + 0)];
- y[i + 1] = tmp[9 + (i + 1)];
- y[i + 2] = tmp[9 + (i + 2)];
- }
- for (i = 9; i < 27; i += 3) {
- y[i + 0] = -tmp[36 - (9 + (i + 0)) - 1];
- y[i + 1] = -tmp[36 - (9 + (i + 1)) - 1];
- y[i + 2] = -tmp[36 - (9 + (i + 2)) - 1];
- }
- for (i = 27; i < 36; i += 3) {
- y[i + 0] = -tmp[(i + 0) - 27];
- y[i + 1] = -tmp[(i + 1) - 27];
- y[i + 2] = -tmp[(i + 2) - 27];
- }
-}
-# else
-/*
- * NAME: imdct36
- * DESCRIPTION: perform X[18]->x[36] IMDCT
- */
-static inline
-void imdct36(mad_fixed_t const X[18], mad_fixed_t x[36])
-{
- mad_fixed_t t0, t1, t2, t3, t4, t5, t6, t7;
- mad_fixed_t t8, t9, t10, t11, t12, t13, t14, t15;
- register mad_fixed64hi_t hi;
- register mad_fixed64lo_t lo;
-
- MAD_F_ML0(hi, lo, X[4], MAD_F(0x0ec835e8));
- MAD_F_MLA(hi, lo, X[13], MAD_F(0x061f78aa));
-
- t6 = MAD_F_MLZ(hi, lo);
-
- MAD_F_MLA(hi, lo, (t14 = X[1] - X[10]), -MAD_F(0x061f78aa));
- MAD_F_MLA(hi, lo, (t15 = X[7] + X[16]), -MAD_F(0x0ec835e8));
-
- t0 = MAD_F_MLZ(hi, lo);
-
- MAD_F_MLA(hi, lo, (t8 = X[0] - X[11] - X[12]), MAD_F(0x0216a2a2));
- MAD_F_MLA(hi, lo, (t9 = X[2] - X[9] - X[14]), MAD_F(0x09bd7ca0));
- MAD_F_MLA(hi, lo, (t10 = X[3] - X[8] - X[15]), -MAD_F(0x0cb19346));
- MAD_F_MLA(hi, lo, (t11 = X[5] - X[6] - X[17]), -MAD_F(0x0fdcf549));
-
- x[7] = MAD_F_MLZ(hi, lo);
- x[10] = -x[7];
-
- MAD_F_ML0(hi, lo, t8, -MAD_F(0x0cb19346));
- MAD_F_MLA(hi, lo, t9, MAD_F(0x0fdcf549));
- MAD_F_MLA(hi, lo, t10, MAD_F(0x0216a2a2));
- MAD_F_MLA(hi, lo, t11, -MAD_F(0x09bd7ca0));
-
- x[19] = x[34] = MAD_F_MLZ(hi, lo) - t0;
-
- t12 = X[0] - X[3] + X[8] - X[11] - X[12] + X[15];
- t13 = X[2] + X[5] - X[6] - X[9] - X[14] - X[17];
-
- MAD_F_ML0(hi, lo, t12, -MAD_F(0x0ec835e8));
- MAD_F_MLA(hi, lo, t13, MAD_F(0x061f78aa));
-
- x[22] = x[31] = MAD_F_MLZ(hi, lo) + t0;
-
- MAD_F_ML0(hi, lo, X[1], -MAD_F(0x09bd7ca0));
- MAD_F_MLA(hi, lo, X[7], MAD_F(0x0216a2a2));
- MAD_F_MLA(hi, lo, X[10], -MAD_F(0x0fdcf549));
- MAD_F_MLA(hi, lo, X[16], MAD_F(0x0cb19346));
-
- t1 = MAD_F_MLZ(hi, lo) + t6;
-
- MAD_F_ML0(hi, lo, X[0], MAD_F(0x03768962));
- MAD_F_MLA(hi, lo, X[2], MAD_F(0x0e313245));
- MAD_F_MLA(hi, lo, X[3], -MAD_F(0x0ffc19fd));
- MAD_F_MLA(hi, lo, X[5], -MAD_F(0x0acf37ad));
- MAD_F_MLA(hi, lo, X[6], MAD_F(0x04cfb0e2));
- MAD_F_MLA(hi, lo, X[8], -MAD_F(0x0898c779));
- MAD_F_MLA(hi, lo, X[9], MAD_F(0x0d7e8807));
- MAD_F_MLA(hi, lo, X[11], MAD_F(0x0f426cb5));
- MAD_F_MLA(hi, lo, X[12], -MAD_F(0x0bcbe352));
- MAD_F_MLA(hi, lo, X[14], MAD_F(0x00b2aa3e));
- MAD_F_MLA(hi, lo, X[15], -MAD_F(0x07635284));
- MAD_F_MLA(hi, lo, X[17], -MAD_F(0x0f9ee890));
-
- x[6] = MAD_F_MLZ(hi, lo) + t1;
- x[11] = -x[6];
-
- MAD_F_ML0(hi, lo, X[0], -MAD_F(0x0f426cb5));
- MAD_F_MLA(hi, lo, X[2], -MAD_F(0x00b2aa3e));
- MAD_F_MLA(hi, lo, X[3], MAD_F(0x0898c779));
- MAD_F_MLA(hi, lo, X[5], MAD_F(0x0f9ee890));
- MAD_F_MLA(hi, lo, X[6], MAD_F(0x0acf37ad));
- MAD_F_MLA(hi, lo, X[8], -MAD_F(0x07635284));
- MAD_F_MLA(hi, lo, X[9], -MAD_F(0x0e313245));
- MAD_F_MLA(hi, lo, X[11], -MAD_F(0x0bcbe352));
- MAD_F_MLA(hi, lo, X[12], -MAD_F(0x03768962));
- MAD_F_MLA(hi, lo, X[14], MAD_F(0x0d7e8807));
- MAD_F_MLA(hi, lo, X[15], MAD_F(0x0ffc19fd));
- MAD_F_MLA(hi, lo, X[17], MAD_F(0x04cfb0e2));
-
- x[23] = x[30] = MAD_F_MLZ(hi, lo) + t1;
-
- MAD_F_ML0(hi, lo, X[0], -MAD_F(0x0bcbe352));
- MAD_F_MLA(hi, lo, X[2], MAD_F(0x0d7e8807));
- MAD_F_MLA(hi, lo, X[3], -MAD_F(0x07635284));
- MAD_F_MLA(hi, lo, X[5], MAD_F(0x04cfb0e2));
- MAD_F_MLA(hi, lo, X[6], MAD_F(0x0f9ee890));
- MAD_F_MLA(hi, lo, X[8], -MAD_F(0x0ffc19fd));
- MAD_F_MLA(hi, lo, X[9], -MAD_F(0x00b2aa3e));
- MAD_F_MLA(hi, lo, X[11], MAD_F(0x03768962));
- MAD_F_MLA(hi, lo, X[12], -MAD_F(0x0f426cb5));
- MAD_F_MLA(hi, lo, X[14], MAD_F(0x0e313245));
- MAD_F_MLA(hi, lo, X[15], MAD_F(0x0898c779));
- MAD_F_MLA(hi, lo, X[17], -MAD_F(0x0acf37ad));
-
- x[18] = x[35] = MAD_F_MLZ(hi, lo) - t1;
-
- MAD_F_ML0(hi, lo, X[4], MAD_F(0x061f78aa));
- MAD_F_MLA(hi, lo, X[13], -MAD_F(0x0ec835e8));
-
- t7 = MAD_F_MLZ(hi, lo);
-
- MAD_F_MLA(hi, lo, X[1], -MAD_F(0x0cb19346));
- MAD_F_MLA(hi, lo, X[7], MAD_F(0x0fdcf549));
- MAD_F_MLA(hi, lo, X[10], MAD_F(0x0216a2a2));
- MAD_F_MLA(hi, lo, X[16], -MAD_F(0x09bd7ca0));
-
- t2 = MAD_F_MLZ(hi, lo);
-
- MAD_F_MLA(hi, lo, X[0], MAD_F(0x04cfb0e2));
- MAD_F_MLA(hi, lo, X[2], MAD_F(0x0ffc19fd));
- MAD_F_MLA(hi, lo, X[3], -MAD_F(0x0d7e8807));
- MAD_F_MLA(hi, lo, X[5], MAD_F(0x03768962));
- MAD_F_MLA(hi, lo, X[6], -MAD_F(0x0bcbe352));
- MAD_F_MLA(hi, lo, X[8], -MAD_F(0x0e313245));
- MAD_F_MLA(hi, lo, X[9], MAD_F(0x07635284));
- MAD_F_MLA(hi, lo, X[11], -MAD_F(0x0acf37ad));
- MAD_F_MLA(hi, lo, X[12], MAD_F(0x0f9ee890));
- MAD_F_MLA(hi, lo, X[14], MAD_F(0x0898c779));
- MAD_F_MLA(hi, lo, X[15], MAD_F(0x00b2aa3e));
- MAD_F_MLA(hi, lo, X[17], MAD_F(0x0f426cb5));
-
- x[5] = MAD_F_MLZ(hi, lo);
- x[12] = -x[5];
-
- MAD_F_ML0(hi, lo, X[0], MAD_F(0x0acf37ad));
- MAD_F_MLA(hi, lo, X[2], -MAD_F(0x0898c779));
- MAD_F_MLA(hi, lo, X[3], MAD_F(0x0e313245));
- MAD_F_MLA(hi, lo, X[5], -MAD_F(0x0f426cb5));
- MAD_F_MLA(hi, lo, X[6], -MAD_F(0x03768962));
- MAD_F_MLA(hi, lo, X[8], MAD_F(0x00b2aa3e));
- MAD_F_MLA(hi, lo, X[9], -MAD_F(0x0ffc19fd));
- MAD_F_MLA(hi, lo, X[11], MAD_F(0x0f9ee890));
- MAD_F_MLA(hi, lo, X[12], -MAD_F(0x04cfb0e2));
- MAD_F_MLA(hi, lo, X[14], MAD_F(0x07635284));
- MAD_F_MLA(hi, lo, X[15], MAD_F(0x0d7e8807));
- MAD_F_MLA(hi, lo, X[17], -MAD_F(0x0bcbe352));
-
- x[0] = MAD_F_MLZ(hi, lo) + t2;
- x[17] = -x[0];
-
- MAD_F_ML0(hi, lo, X[0], -MAD_F(0x0f9ee890));
- MAD_F_MLA(hi, lo, X[2], -MAD_F(0x07635284));
- MAD_F_MLA(hi, lo, X[3], -MAD_F(0x00b2aa3e));
- MAD_F_MLA(hi, lo, X[5], MAD_F(0x0bcbe352));
- MAD_F_MLA(hi, lo, X[6], MAD_F(0x0f426cb5));
- MAD_F_MLA(hi, lo, X[8], MAD_F(0x0d7e8807));
- MAD_F_MLA(hi, lo, X[9], MAD_F(0x0898c779));
- MAD_F_MLA(hi, lo, X[11], -MAD_F(0x04cfb0e2));
- MAD_F_MLA(hi, lo, X[12], -MAD_F(0x0acf37ad));
- MAD_F_MLA(hi, lo, X[14], -MAD_F(0x0ffc19fd));
- MAD_F_MLA(hi, lo, X[15], -MAD_F(0x0e313245));
- MAD_F_MLA(hi, lo, X[17], -MAD_F(0x03768962));
-
- x[24] = x[29] = MAD_F_MLZ(hi, lo) + t2;
-
- MAD_F_ML0(hi, lo, X[1], -MAD_F(0x0216a2a2));
- MAD_F_MLA(hi, lo, X[7], -MAD_F(0x09bd7ca0));
- MAD_F_MLA(hi, lo, X[10], MAD_F(0x0cb19346));
- MAD_F_MLA(hi, lo, X[16], MAD_F(0x0fdcf549));
-
- t3 = MAD_F_MLZ(hi, lo) + t7;
-
- MAD_F_ML0(hi, lo, X[0], MAD_F(0x00b2aa3e));
- MAD_F_MLA(hi, lo, X[2], MAD_F(0x03768962));
- MAD_F_MLA(hi, lo, X[3], -MAD_F(0x04cfb0e2));
- MAD_F_MLA(hi, lo, X[5], -MAD_F(0x07635284));
- MAD_F_MLA(hi, lo, X[6], MAD_F(0x0898c779));
- MAD_F_MLA(hi, lo, X[8], MAD_F(0x0acf37ad));
- MAD_F_MLA(hi, lo, X[9], -MAD_F(0x0bcbe352));
- MAD_F_MLA(hi, lo, X[11], -MAD_F(0x0d7e8807));
- MAD_F_MLA(hi, lo, X[12], MAD_F(0x0e313245));
- MAD_F_MLA(hi, lo, X[14], MAD_F(0x0f426cb5));
- MAD_F_MLA(hi, lo, X[15], -MAD_F(0x0f9ee890));
- MAD_F_MLA(hi, lo, X[17], -MAD_F(0x0ffc19fd));
-
- x[8] = MAD_F_MLZ(hi, lo) + t3;
- x[9] = -x[8];
-
- MAD_F_ML0(hi, lo, X[0], -MAD_F(0x0e313245));
- MAD_F_MLA(hi, lo, X[2], MAD_F(0x0bcbe352));
- MAD_F_MLA(hi, lo, X[3], MAD_F(0x0f9ee890));
- MAD_F_MLA(hi, lo, X[5], -MAD_F(0x0898c779));
- MAD_F_MLA(hi, lo, X[6], -MAD_F(0x0ffc19fd));
- MAD_F_MLA(hi, lo, X[8], MAD_F(0x04cfb0e2));
- MAD_F_MLA(hi, lo, X[9], MAD_F(0x0f426cb5));
- MAD_F_MLA(hi, lo, X[11], -MAD_F(0x00b2aa3e));
- MAD_F_MLA(hi, lo, X[12], -MAD_F(0x0d7e8807));
- MAD_F_MLA(hi, lo, X[14], -MAD_F(0x03768962));
- MAD_F_MLA(hi, lo, X[15], MAD_F(0x0acf37ad));
- MAD_F_MLA(hi, lo, X[17], MAD_F(0x07635284));
-
- x[21] = x[32] = MAD_F_MLZ(hi, lo) + t3;
-
- MAD_F_ML0(hi, lo, X[0], -MAD_F(0x0d7e8807));
- MAD_F_MLA(hi, lo, X[2], MAD_F(0x0f426cb5));
- MAD_F_MLA(hi, lo, X[3], MAD_F(0x0acf37ad));
- MAD_F_MLA(hi, lo, X[5], -MAD_F(0x0ffc19fd));
- MAD_F_MLA(hi, lo, X[6], -MAD_F(0x07635284));
- MAD_F_MLA(hi, lo, X[8], MAD_F(0x0f9ee890));
- MAD_F_MLA(hi, lo, X[9], MAD_F(0x03768962));
- MAD_F_MLA(hi, lo, X[11], -MAD_F(0x0e313245));
- MAD_F_MLA(hi, lo, X[12], MAD_F(0x00b2aa3e));
- MAD_F_MLA(hi, lo, X[14], MAD_F(0x0bcbe352));
- MAD_F_MLA(hi, lo, X[15], -MAD_F(0x04cfb0e2));
- MAD_F_MLA(hi, lo, X[17], -MAD_F(0x0898c779));
-
- x[20] = x[33] = MAD_F_MLZ(hi, lo) - t3;
-
- MAD_F_ML0(hi, lo, t14, -MAD_F(0x0ec835e8));
- MAD_F_MLA(hi, lo, t15, MAD_F(0x061f78aa));
-
- t4 = MAD_F_MLZ(hi, lo) - t7;
-
- MAD_F_ML0(hi, lo, t12, MAD_F(0x061f78aa));
- MAD_F_MLA(hi, lo, t13, MAD_F(0x0ec835e8));
-
- x[4] = MAD_F_MLZ(hi, lo) + t4;
- x[13] = -x[4];
-
- MAD_F_ML0(hi, lo, t8, MAD_F(0x09bd7ca0));
- MAD_F_MLA(hi, lo, t9, -MAD_F(0x0216a2a2));
- MAD_F_MLA(hi, lo, t10, MAD_F(0x0fdcf549));
- MAD_F_MLA(hi, lo, t11, -MAD_F(0x0cb19346));
-
- x[1] = MAD_F_MLZ(hi, lo) + t4;
- x[16] = -x[1];
-
- MAD_F_ML0(hi, lo, t8, -MAD_F(0x0fdcf549));
- MAD_F_MLA(hi, lo, t9, -MAD_F(0x0cb19346));
- MAD_F_MLA(hi, lo, t10, -MAD_F(0x09bd7ca0));
- MAD_F_MLA(hi, lo, t11, -MAD_F(0x0216a2a2));
-
- x[25] = x[28] = MAD_F_MLZ(hi, lo) + t4;
-
- MAD_F_ML0(hi, lo, X[1], -MAD_F(0x0fdcf549));
- MAD_F_MLA(hi, lo, X[7], -MAD_F(0x0cb19346));
- MAD_F_MLA(hi, lo, X[10], -MAD_F(0x09bd7ca0));
- MAD_F_MLA(hi, lo, X[16], -MAD_F(0x0216a2a2));
-
- t5 = MAD_F_MLZ(hi, lo) - t6;
-
- MAD_F_ML0(hi, lo, X[0], MAD_F(0x0898c779));
- MAD_F_MLA(hi, lo, X[2], MAD_F(0x04cfb0e2));
- MAD_F_MLA(hi, lo, X[3], MAD_F(0x0bcbe352));
- MAD_F_MLA(hi, lo, X[5], MAD_F(0x00b2aa3e));
- MAD_F_MLA(hi, lo, X[6], MAD_F(0x0e313245));
- MAD_F_MLA(hi, lo, X[8], -MAD_F(0x03768962));
- MAD_F_MLA(hi, lo, X[9], MAD_F(0x0f9ee890));
- MAD_F_MLA(hi, lo, X[11], -MAD_F(0x07635284));
- MAD_F_MLA(hi, lo, X[12], MAD_F(0x0ffc19fd));
- MAD_F_MLA(hi, lo, X[14], -MAD_F(0x0acf37ad));
- MAD_F_MLA(hi, lo, X[15], MAD_F(0x0f426cb5));
- MAD_F_MLA(hi, lo, X[17], -MAD_F(0x0d7e8807));
-
- x[2] = MAD_F_MLZ(hi, lo) + t5;
- x[15] = -x[2];
-
- MAD_F_ML0(hi, lo, X[0], MAD_F(0x07635284));
- MAD_F_MLA(hi, lo, X[2], MAD_F(0x0acf37ad));
- MAD_F_MLA(hi, lo, X[3], MAD_F(0x03768962));
- MAD_F_MLA(hi, lo, X[5], MAD_F(0x0d7e8807));
- MAD_F_MLA(hi, lo, X[6], -MAD_F(0x00b2aa3e));
- MAD_F_MLA(hi, lo, X[8], MAD_F(0x0f426cb5));
- MAD_F_MLA(hi, lo, X[9], -MAD_F(0x04cfb0e2));
- MAD_F_MLA(hi, lo, X[11], MAD_F(0x0ffc19fd));
- MAD_F_MLA(hi, lo, X[12], -MAD_F(0x0898c779));
- MAD_F_MLA(hi, lo, X[14], MAD_F(0x0f9ee890));
- MAD_F_MLA(hi, lo, X[15], -MAD_F(0x0bcbe352));
- MAD_F_MLA(hi, lo, X[17], MAD_F(0x0e313245));
-
- x[3] = MAD_F_MLZ(hi, lo) + t5;
- x[14] = -x[3];
-
- MAD_F_ML0(hi, lo, X[0], -MAD_F(0x0ffc19fd));
- MAD_F_MLA(hi, lo, X[2], -MAD_F(0x0f9ee890));
- MAD_F_MLA(hi, lo, X[3], -MAD_F(0x0f426cb5));
- MAD_F_MLA(hi, lo, X[5], -MAD_F(0x0e313245));
- MAD_F_MLA(hi, lo, X[6], -MAD_F(0x0d7e8807));
- MAD_F_MLA(hi, lo, X[8], -MAD_F(0x0bcbe352));
- MAD_F_MLA(hi, lo, X[9], -MAD_F(0x0acf37ad));
- MAD_F_MLA(hi, lo, X[11], -MAD_F(0x0898c779));
- MAD_F_MLA(hi, lo, X[12], -MAD_F(0x07635284));
- MAD_F_MLA(hi, lo, X[14], -MAD_F(0x04cfb0e2));
- MAD_F_MLA(hi, lo, X[15], -MAD_F(0x03768962));
- MAD_F_MLA(hi, lo, X[17], -MAD_F(0x00b2aa3e));
-
- x[26] = x[27] = MAD_F_MLZ(hi, lo) + t5;
-}
-# endif
-
-/*
- * NAME: III_imdct_l()
- * DESCRIPTION: perform IMDCT and windowing for long blocks
- */
-static
-void III_imdct_l(mad_fixed_t const X[18], mad_fixed_t z[36],
- unsigned int block_type)
-{
- unsigned int i;
-
- /* IMDCT */
-
- imdct36(X, z);
-
- /* windowing */
-
- switch (block_type) {
- case 0: /* normal window */
-# if defined(ASO_INTERLEAVE1)
- {
- register mad_fixed_t tmp1, tmp2;
-
- tmp1 = window_l[0];
- tmp2 = window_l[1];
-
- for (i = 0; i < 34; i += 2) {
- z[i + 0] = mad_f_mul(z[i + 0], tmp1);
- tmp1 = window_l[i + 2];
- z[i + 1] = mad_f_mul(z[i + 1], tmp2);
- tmp2 = window_l[i + 3];
- }
-
- z[34] = mad_f_mul(z[34], tmp1);
- z[35] = mad_f_mul(z[35], tmp2);
- }
-# elif defined(ASO_INTERLEAVE2)
- {
- register mad_fixed_t tmp1, tmp2;
-
- tmp1 = z[0];
- tmp2 = window_l[0];
-
- for (i = 0; i < 35; ++i) {
- z[i] = mad_f_mul(tmp1, tmp2);
- tmp1 = z[i + 1];
- tmp2 = window_l[i + 1];
- }
-
- z[35] = mad_f_mul(tmp1, tmp2);
- }
-# elif 1
- for (i = 0; i < 36; i += 4) {
- z[i + 0] = mad_f_mul(z[i + 0], window_l[i + 0]);
- z[i + 1] = mad_f_mul(z[i + 1], window_l[i + 1]);
- z[i + 2] = mad_f_mul(z[i + 2], window_l[i + 2]);
- z[i + 3] = mad_f_mul(z[i + 3], window_l[i + 3]);
- }
-# else
- for (i = 0; i < 36; ++i) z[i] = mad_f_mul(z[i], window_l[i]);
-# endif
- break;
-
- case 1: /* start block */
- for (i = 0; i < 18; i += 3) {
- z[i + 0] = mad_f_mul(z[i + 0], window_l[i + 0]);
- z[i + 1] = mad_f_mul(z[i + 1], window_l[i + 1]);
- z[i + 2] = mad_f_mul(z[i + 2], window_l[i + 2]);
- }
- /* (i = 18; i < 24; ++i) z[i] unchanged */
- for (i = 24; i < 30; ++i) z[i] = mad_f_mul(z[i], window_s[i - 18]);
- for (i = 30; i < 36; ++i) z[i] = 0;
- break;
-
- case 3: /* stop block */
- for (i = 0; i < 6; ++i) z[i] = 0;
- for (i = 6; i < 12; ++i) z[i] = mad_f_mul(z[i], window_s[i - 6]);
- /* (i = 12; i < 18; ++i) z[i] unchanged */
- for (i = 18; i < 36; i += 3) {
- z[i + 0] = mad_f_mul(z[i + 0], window_l[i + 0]);
- z[i + 1] = mad_f_mul(z[i + 1], window_l[i + 1]);
- z[i + 2] = mad_f_mul(z[i + 2], window_l[i + 2]);
- }
- break;
- }
-}
-# endif /* ASO_IMDCT */
-
-/*
- * NAME: III_imdct_s()
- * DESCRIPTION: perform IMDCT and windowing for short blocks
- */
-static
-void III_imdct_s(mad_fixed_t const X[18], mad_fixed_t z[36])
-{
- mad_fixed_t y[36], *yptr;
- mad_fixed_t const *wptr;
- int w, i;
- register mad_fixed64hi_t hi;
- register mad_fixed64lo_t lo;
-
- /* IMDCT */
-
- yptr = &y[0];
-
- for (w = 0; w < 3; ++w) {
- register mad_fixed_t const (*s)[6];
-
- s = imdct_s;
-
- for (i = 0; i < 3; ++i) {
- MAD_F_ML0(hi, lo, X[0], (*s)[0]);
- MAD_F_MLA(hi, lo, X[1], (*s)[1]);
- MAD_F_MLA(hi, lo, X[2], (*s)[2]);
- MAD_F_MLA(hi, lo, X[3], (*s)[3]);
- MAD_F_MLA(hi, lo, X[4], (*s)[4]);
- MAD_F_MLA(hi, lo, X[5], (*s)[5]);
-
- yptr[i + 0] = MAD_F_MLZ(hi, lo);
- yptr[5 - i] = -yptr[i + 0];
-
- ++s;
-
- MAD_F_ML0(hi, lo, X[0], (*s)[0]);
- MAD_F_MLA(hi, lo, X[1], (*s)[1]);
- MAD_F_MLA(hi, lo, X[2], (*s)[2]);
- MAD_F_MLA(hi, lo, X[3], (*s)[3]);
- MAD_F_MLA(hi, lo, X[4], (*s)[4]);
- MAD_F_MLA(hi, lo, X[5], (*s)[5]);
-
- yptr[ i + 6] = MAD_F_MLZ(hi, lo);
- yptr[11 - i] = yptr[i + 6];
-
- ++s;
- }
-
- yptr += 12;
- X += 6;
- }
-
- /* windowing, overlapping and concatenation */
-
- yptr = &y[0];
- wptr = &window_s[0];
-
- for (i = 0; i < 6; ++i) {
- z[i + 0] = 0;
- z[i + 6] = mad_f_mul(yptr[ 0 + 0], wptr[0]);
-
- MAD_F_ML0(hi, lo, yptr[ 0 + 6], wptr[6]);
- MAD_F_MLA(hi, lo, yptr[12 + 0], wptr[0]);
-
- z[i + 12] = MAD_F_MLZ(hi, lo);
-
- MAD_F_ML0(hi, lo, yptr[12 + 6], wptr[6]);
- MAD_F_MLA(hi, lo, yptr[24 + 0], wptr[0]);
-
- z[i + 18] = MAD_F_MLZ(hi, lo);
-
- z[i + 24] = mad_f_mul(yptr[24 + 6], wptr[6]);
- z[i + 30] = 0;
-
- ++yptr;
- ++wptr;
- }
-}
-
-/*
- * NAME: III_overlap()
- * DESCRIPTION: perform overlap-add of windowed IMDCT outputs
- */
-static
-void III_overlap(mad_fixed_t const output[36], mad_fixed_t overlap[18],
- mad_fixed_t sample[18][32], unsigned int sb)
-{
- unsigned int i;
-
-# if defined(ASO_INTERLEAVE2)
- {
- register mad_fixed_t tmp1, tmp2;
-
- tmp1 = overlap[0];
- tmp2 = overlap[1];
-
- for (i = 0; i < 16; i += 2) {
- sample[i + 0][sb] = output[i + 0 + 0] + tmp1;
- overlap[i + 0] = output[i + 0 + 18];
- tmp1 = overlap[i + 2];
-
- sample[i + 1][sb] = output[i + 1 + 0] + tmp2;
- overlap[i + 1] = output[i + 1 + 18];
- tmp2 = overlap[i + 3];
- }
-
- sample[16][sb] = output[16 + 0] + tmp1;
- overlap[16] = output[16 + 18];
- sample[17][sb] = output[17 + 0] + tmp2;
- overlap[17] = output[17 + 18];
- }
-# elif 0
- for (i = 0; i < 18; i += 2) {
- sample[i + 0][sb] = output[i + 0 + 0] + overlap[i + 0];
- overlap[i + 0] = output[i + 0 + 18];
-
- sample[i + 1][sb] = output[i + 1 + 0] + overlap[i + 1];
- overlap[i + 1] = output[i + 1 + 18];
- }
-# else
- for (i = 0; i < 18; ++i) {
- sample[i][sb] = output[i + 0] + overlap[i];
- overlap[i] = output[i + 18];
- }
-# endif
-}
-
-/*
- * NAME: III_overlap_z()
- * DESCRIPTION: perform "overlap-add" of zero IMDCT outputs
- */
-static inline
-void III_overlap_z(mad_fixed_t overlap[18],
- mad_fixed_t sample[18][32], unsigned int sb)
-{
- unsigned int i;
-
-# if defined(ASO_INTERLEAVE2)
- {
- register mad_fixed_t tmp1, tmp2;
-
- tmp1 = overlap[0];
- tmp2 = overlap[1];
-
- for (i = 0; i < 16; i += 2) {
- sample[i + 0][sb] = tmp1;
- overlap[i + 0] = 0;
- tmp1 = overlap[i + 2];
-
- sample[i + 1][sb] = tmp2;
- overlap[i + 1] = 0;
- tmp2 = overlap[i + 3];
- }
-
- sample[16][sb] = tmp1;
- overlap[16] = 0;
- sample[17][sb] = tmp2;
- overlap[17] = 0;
- }
-# else
- for (i = 0; i < 18; ++i) {
- sample[i][sb] = overlap[i];
- overlap[i] = 0;
- }
-# endif
-}
-
-/*
- * NAME: III_freqinver()
- * DESCRIPTION: perform subband frequency inversion for odd sample lines
- */
-static
-void III_freqinver(mad_fixed_t sample[18][32], unsigned int sb)
-{
- unsigned int i;
-
-# if 1 || defined(ASO_INTERLEAVE1) || defined(ASO_INTERLEAVE2)
- {
- register mad_fixed_t tmp1, tmp2;
-
- tmp1 = sample[1][sb];
- tmp2 = sample[3][sb];
-
- for (i = 1; i < 13; i += 4) {
- sample[i + 0][sb] = -tmp1;
- tmp1 = sample[i + 4][sb];
- sample[i + 2][sb] = -tmp2;
- tmp2 = sample[i + 6][sb];
- }
-
- sample[13][sb] = -tmp1;
- tmp1 = sample[17][sb];
- sample[15][sb] = -tmp2;
- sample[17][sb] = -tmp1;
- }
-# else
- for (i = 1; i < 18; i += 2)
- sample[i][sb] = -sample[i][sb];
-# endif
-}
-
-/*
- * NAME: III_decode()
- * DESCRIPTION: decode frame main_data
- */
-static
-enum mad_error III_decode(struct mad_bitptr *ptr, struct mad_frame *frame,
- struct sideinfo *si, unsigned int nch)
-{
- struct mad_header *header = &frame->header;
- unsigned int sfreqi, ngr, gr;
-
- {
- unsigned int sfreq;
-
- sfreq = header->samplerate;
- if (header->flags & MAD_FLAG_MPEG_2_5_EXT)
- sfreq *= 2;
-
- /* 48000 => 0, 44100 => 1, 32000 => 2,
- 24000 => 3, 22050 => 4, 16000 => 5 */
- sfreqi = ((sfreq >> 7) & 0x000f) +
- ((sfreq >> 15) & 0x0001) - 8;
-
- if (header->flags & MAD_FLAG_MPEG_2_5_EXT)
- sfreqi += 3;
- }
-
- /* scalefactors, Huffman decoding, requantization */
-
- ngr = (header->flags & MAD_FLAG_LSF_EXT) ? 1 : 2;
-
- for (gr = 0; gr < ngr; ++gr) {
- struct granule *granule = &si->gr[gr];
- unsigned char const *sfbwidth[2];
- mad_fixed_t xr[2][576];
- unsigned int ch;
- enum mad_error error;
-
- for (ch = 0; ch < nch; ++ch) {
- struct channel *channel = &granule->ch[ch];
- unsigned int part2_length;
-
- sfbwidth[ch] = sfbwidth_table[sfreqi].l;
- if (channel->block_type == 2) {
- sfbwidth[ch] = (channel->flags & mixed_block_flag) ?
- sfbwidth_table[sfreqi].m : sfbwidth_table[sfreqi].s;
- }
-
- if (header->flags & MAD_FLAG_LSF_EXT) {
- part2_length = III_scalefactors_lsf(ptr, channel,
- ch == 0 ? 0 : &si->gr[1].ch[1],
- header->mode_extension);
- }
- else {
- part2_length = III_scalefactors(ptr, channel, &si->gr[0].ch[ch],
- gr == 0 ? 0 : si->scfsi[ch]);
- }
-
- error = III_huffdecode(ptr, xr[ch], channel, sfbwidth[ch], part2_length);
- if (error)
- return error;
- }
-
- /* joint stereo processing */
-
- if (header->mode == MAD_MODE_JOINT_STEREO && header->mode_extension) {
- error = III_stereo(xr, granule, header, sfbwidth[0]);
- if (error)
- return error;
- }
-
- /* reordering, alias reduction, IMDCT, overlap-add, frequency inversion */
-
- for (ch = 0; ch < nch; ++ch) {
- struct channel const *channel = &granule->ch[ch];
- mad_fixed_t (*sample)[32] = &frame->sbsample[ch][18 * gr];
- unsigned int sb, l, i, sblimit;
- mad_fixed_t output[36];
-
- if (channel->block_type == 2) {
- III_reorder(xr[ch], channel, sfbwidth[ch]);
-
-# if !defined(OPT_STRICT)
- /*
- * According to ISO/IEC 11172-3, "Alias reduction is not applied for
- * granules with block_type == 2 (short block)." However, other
- * sources suggest alias reduction should indeed be performed on the
- * lower two subbands of mixed blocks. Most other implementations do
- * this, so by default we will too.
- */
- if (channel->flags & mixed_block_flag)
- III_aliasreduce(xr[ch], 36);
-# endif
- }
- else
- III_aliasreduce(xr[ch], 576);
-
- l = 0;
-
- /* subbands 0-1 */
-
- if (channel->block_type != 2 || (channel->flags & mixed_block_flag)) {
- unsigned int block_type;
-
- block_type = channel->block_type;
- if (channel->flags & mixed_block_flag)
- block_type = 0;
-
- /* long blocks */
- for (sb = 0; sb < 2; ++sb, l += 18) {
- III_imdct_l(&xr[ch][l], output, block_type);
- III_overlap(output, (*frame->overlap)[ch][sb], sample, sb);
- }
- }
- else {
- /* short blocks */
- for (sb = 0; sb < 2; ++sb, l += 18) {
- III_imdct_s(&xr[ch][l], output);
- III_overlap(output, (*frame->overlap)[ch][sb], sample, sb);
- }
- }
-
- III_freqinver(sample, 1);
-
- /* (nonzero) subbands 2-31 */
-
- i = 576;
- while (i > 36 && xr[ch][i - 1] == 0)
- --i;
-
- sblimit = 32 - (576 - i) / 18;
-
- if (channel->block_type != 2) {
- /* long blocks */
- for (sb = 2; sb < sblimit; ++sb, l += 18) {
- III_imdct_l(&xr[ch][l], output, channel->block_type);
- III_overlap(output, (*frame->overlap)[ch][sb], sample, sb);
-
- if (sb & 1)
- III_freqinver(sample, sb);
- }
- }
- else {
- /* short blocks */
- for (sb = 2; sb < sblimit; ++sb, l += 18) {
- III_imdct_s(&xr[ch][l], output);
- III_overlap(output, (*frame->overlap)[ch][sb], sample, sb);
-
- if (sb & 1)
- III_freqinver(sample, sb);
- }
- }
-
- /* remaining (zero) subbands */
-
- for (sb = sblimit; sb < 32; ++sb) {
- III_overlap_z((*frame->overlap)[ch][sb], sample, sb);
-
- if (sb & 1)
- III_freqinver(sample, sb);
- }
- }
- }
-
- return MAD_ERROR_NONE;
-}
-
-/*
- * NAME: layer->III()
- * DESCRIPTION: decode a single Layer III frame
- */
-int mad_layer_III(struct mad_stream *stream, struct mad_frame *frame)
-{
- struct mad_header *header = &frame->header;
- unsigned int nch, priv_bitlen, next_md_begin = 0;
- unsigned int si_len, data_bitlen, md_len;
- unsigned int frame_space, frame_used, frame_free;
- struct mad_bitptr ptr;
- struct sideinfo si;
- enum mad_error error;
- int result = 0;
-
- /* allocate Layer III dynamic structures */
-
- if (stream->main_data == 0) {
- stream->main_data = malloc(MAD_BUFFER_MDLEN);
- if (stream->main_data == 0) {
- stream->error = MAD_ERROR_NOMEM;
- return -1;
- }
- }
-
- if (frame->overlap == 0) {
- frame->overlap = calloc(2 * 32 * 18, sizeof(mad_fixed_t));
- if (frame->overlap == 0) {
- stream->error = MAD_ERROR_NOMEM;
- return -1;
- }
- }
-
- nch = MAD_NCHANNELS(header);
- si_len = (header->flags & MAD_FLAG_LSF_EXT) ?
- (nch == 1 ? 9 : 17) : (nch == 1 ? 17 : 32);
-
- /* check frame sanity */
-
- if (stream->next_frame - mad_bit_nextbyte(&stream->ptr) <
- (signed int) si_len) {
- stream->error = MAD_ERROR_BADFRAMELEN;
- stream->md_len = 0;
- return -1;
- }
-
- /* check CRC word */
-
- if (header->flags & MAD_FLAG_PROTECTION) {
- header->crc_check =
- mad_bit_crc(stream->ptr, si_len * CHAR_BIT, header->crc_check);
-
- if (header->crc_check != header->crc_target &&
- !(frame->options & MAD_OPTION_IGNORECRC)) {
- stream->error = MAD_ERROR_BADCRC;
- result = -1;
- }
- }
-
- /* decode frame side information */
-
- error = III_sideinfo(&stream->ptr, nch, header->flags & MAD_FLAG_LSF_EXT,
- &si, &data_bitlen, &priv_bitlen);
- if (error && result == 0) {
- stream->error = error;
- result = -1;
- }
-
- header->flags |= priv_bitlen;
- header->private_bits |= si.private_bits;
-
- /* find main_data of next frame */
-
- {
- struct mad_bitptr peek;
- unsigned long header;
-
- mad_bit_init(&peek, stream->next_frame);
-
- header = mad_bit_read(&peek, 32);
- if ((header & 0xffe60000L) /* syncword | layer */ == 0xffe20000L) {
- if (!(header & 0x00010000L)) /* protection_bit */
- mad_bit_skip(&peek, 16); /* crc_check */
-
- next_md_begin =
- mad_bit_read(&peek, (header & 0x00080000L) /* ID */ ? 9 : 8);
- }
-
- mad_bit_finish(&peek);
- }
-
- /* find main_data of this frame */
-
- frame_space = stream->next_frame - mad_bit_nextbyte(&stream->ptr);
-
- if (next_md_begin > si.main_data_begin + frame_space)
- next_md_begin = 0;
-
- md_len = si.main_data_begin + frame_space - next_md_begin;
-
- frame_used = 0;
-
- if (si.main_data_begin == 0) {
- ptr = stream->ptr;
- stream->md_len = 0;
-
- frame_used = md_len;
- }
- else {
- if (si.main_data_begin > stream->md_len) {
- if (result == 0) {
- stream->error = MAD_ERROR_BADDATAPTR;
- result = -1;
- }
- }
- else {
- mad_bit_init(&ptr,
- *stream->main_data + stream->md_len - si.main_data_begin);
-
- if (md_len > si.main_data_begin) {
- assert(stream->md_len + md_len -
- si.main_data_begin <= MAD_BUFFER_MDLEN);
-
- memcpy(*stream->main_data + stream->md_len,
- mad_bit_nextbyte(&stream->ptr),
- frame_used = md_len - si.main_data_begin);
- stream->md_len += frame_used;
- }
- }
- }
-
- frame_free = frame_space - frame_used;
-
- /* decode main_data */
-
- if (result == 0) {
- error = III_decode(&ptr, frame, &si, nch);
- if (error) {
- stream->error = error;
- result = -1;
- }
-
- /* designate ancillary bits */
-
- stream->anc_ptr = ptr;
- stream->anc_bitlen = md_len * CHAR_BIT - data_bitlen;
- }
-
-# if 0 && defined(DEBUG)
- fprintf(stderr,
- "main_data_begin:%u, md_len:%u, frame_free:%u, "
- "data_bitlen:%u, anc_bitlen: %u\n",
- si.main_data_begin, md_len, frame_free,
- data_bitlen, stream->anc_bitlen);
-# endif
-
- /* preload main_data buffer with up to 511 bytes for next frame(s) */
-
- if (frame_free >= next_md_begin) {
- memcpy(*stream->main_data,
- stream->next_frame - next_md_begin, next_md_begin);
- stream->md_len = next_md_begin;
- }
- else {
- if (md_len < si.main_data_begin) {
- unsigned int extra;
-
- extra = si.main_data_begin - md_len;
- if (extra + frame_free > next_md_begin)
- extra = next_md_begin - frame_free;
-
- if (extra < stream->md_len) {
- memmove(*stream->main_data,
- *stream->main_data + stream->md_len - extra, extra);
- stream->md_len = extra;
- }
- }
- else
- stream->md_len = 0;
-
- memcpy(*stream->main_data + stream->md_len,
- stream->next_frame - frame_free, frame_free);
- stream->md_len += frame_free;
- }
-
- return result;
-}
diff --git a/src/libmad/layer3.h b/src/libmad/layer3.h
deleted file mode 100644
index 3dca5b3b8..000000000
--- a/src/libmad/layer3.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * libmad - MPEG audio decoder library
- * Copyright (C) 2000-2004 Underbit Technologies, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * $Id: layer3.h,v 1.3 2004/04/22 00:23:06 miguelfreitas Exp $
- */
-
-# ifndef LIBMAD_LAYER3_H
-# define LIBMAD_LAYER3_H
-
-# include "stream.h"
-# include "frame.h"
-
-int mad_layer_III(struct mad_stream *, struct mad_frame *);
-
-# endif
diff --git a/src/libmad/qc_table.dat b/src/libmad/qc_table.dat
deleted file mode 100644
index 1848e0011..000000000
--- a/src/libmad/qc_table.dat
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * libmad - MPEG audio decoder library
- * Copyright (C) 2000-2001 Robert Leslie
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * $Id: qc_table.dat,v 1.2 2002/04/30 18:46:58 miguelfreitas Exp $
- */
-
-/*
- * These are the Layer II classes of quantization.
- * The table is derived from Table B.4 of ISO/IEC 11172-3.
- */
-
- { 3, 2, 5,
- MAD_F(0x15555555) /* 1.33333333333 => 1.33333333209, e 0.00000000124 */,
- MAD_F(0x08000000) /* 0.50000000000 => 0.50000000000, e 0.00000000000 */ },
- { 5, 3, 7,
- MAD_F(0x1999999a) /* 1.60000000000 => 1.60000000149, e -0.00000000149 */,
- MAD_F(0x08000000) /* 0.50000000000 => 0.50000000000, e 0.00000000000 */ },
- { 7, 0, 3,
- MAD_F(0x12492492) /* 1.14285714286 => 1.14285714179, e 0.00000000107 */,
- MAD_F(0x04000000) /* 0.25000000000 => 0.25000000000, e 0.00000000000 */ },
- { 9, 4, 10,
- MAD_F(0x1c71c71c) /* 1.77777777777 => 1.77777777612, e 0.00000000165 */,
- MAD_F(0x08000000) /* 0.50000000000 => 0.50000000000, e 0.00000000000 */ },
- { 15, 0, 4,
- MAD_F(0x11111111) /* 1.06666666666 => 1.06666666642, e 0.00000000024 */,
- MAD_F(0x02000000) /* 0.12500000000 => 0.12500000000, e 0.00000000000 */ },
- { 31, 0, 5,
- MAD_F(0x10842108) /* 1.03225806452 => 1.03225806355, e 0.00000000097 */,
- MAD_F(0x01000000) /* 0.06250000000 => 0.06250000000, e 0.00000000000 */ },
- { 63, 0, 6,
- MAD_F(0x10410410) /* 1.01587301587 => 1.01587301493, e 0.00000000094 */,
- MAD_F(0x00800000) /* 0.03125000000 => 0.03125000000, e 0.00000000000 */ },
- { 127, 0, 7,
- MAD_F(0x10204081) /* 1.00787401575 => 1.00787401572, e 0.00000000003 */,
- MAD_F(0x00400000) /* 0.01562500000 => 0.01562500000, e 0.00000000000 */ },
- { 255, 0, 8,
- MAD_F(0x10101010) /* 1.00392156863 => 1.00392156839, e 0.00000000024 */,
- MAD_F(0x00200000) /* 0.00781250000 => 0.00781250000, e 0.00000000000 */ },
- { 511, 0, 9,
- MAD_F(0x10080402) /* 1.00195694716 => 1.00195694715, e 0.00000000001 */,
- MAD_F(0x00100000) /* 0.00390625000 => 0.00390625000, e 0.00000000000 */ },
- { 1023, 0, 10,
- MAD_F(0x10040100) /* 1.00097751711 => 1.00097751617, e 0.00000000094 */,
- MAD_F(0x00080000) /* 0.00195312500 => 0.00195312500, e 0.00000000000 */ },
- { 2047, 0, 11,
- MAD_F(0x10020040) /* 1.00048851979 => 1.00048851967, e 0.00000000012 */,
- MAD_F(0x00040000) /* 0.00097656250 => 0.00097656250, e 0.00000000000 */ },
- { 4095, 0, 12,
- MAD_F(0x10010010) /* 1.00024420024 => 1.00024420023, e 0.00000000001 */,
- MAD_F(0x00020000) /* 0.00048828125 => 0.00048828125, e 0.00000000000 */ },
- { 8191, 0, 13,
- MAD_F(0x10008004) /* 1.00012208522 => 1.00012208521, e 0.00000000001 */,
- MAD_F(0x00010000) /* 0.00024414063 => 0.00024414062, e 0.00000000000 */ },
- { 16383, 0, 14,
- MAD_F(0x10004001) /* 1.00006103888 => 1.00006103888, e -0.00000000000 */,
- MAD_F(0x00008000) /* 0.00012207031 => 0.00012207031, e -0.00000000000 */ },
- { 32767, 0, 15,
- MAD_F(0x10002000) /* 1.00003051851 => 1.00003051758, e 0.00000000093 */,
- MAD_F(0x00004000) /* 0.00006103516 => 0.00006103516, e 0.00000000000 */ },
- { 65535, 0, 16,
- MAD_F(0x10001000) /* 1.00001525902 => 1.00001525879, e 0.00000000023 */,
- MAD_F(0x00002000) /* 0.00003051758 => 0.00003051758, e 0.00000000000 */ }
diff --git a/src/libmad/rq_table.dat b/src/libmad/rq_table.dat
deleted file mode 100644
index 7db10fd33..000000000
--- a/src/libmad/rq_table.dat
+++ /dev/null
@@ -1,8747 +0,0 @@
-/*
- * libmad - MPEG audio decoder library
- * Copyright (C) 2000-2001 Robert Leslie
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * $Id: rq_table.dat,v 1.2 2002/04/30 18:46:58 miguelfreitas Exp $
- */
-
-/*
- * This is the lookup table used to compute x^(4/3) for Layer III
- * requantization. To maintain the best possible accuracy, the value is
- * stored as a normalized mantissa with exponent. The requantization
- * algorithm recombines these parts with appropriate scaling.
- */
-
- /* 0 */ { MAD_F(0x00000000) /* 0.000000000 */, 0 },
- /* 1 */ { MAD_F(0x04000000) /* 0.250000000 */, 2 },
- /* 2 */ { MAD_F(0x050a28be) /* 0.314980262 */, 3 },
- /* 3 */ { MAD_F(0x0453a5cd) /* 0.270421794 */, 4 },
- /* 4 */ { MAD_F(0x06597fa9) /* 0.396850263 */, 4 },
- /* 5 */ { MAD_F(0x04466275) /* 0.267183742 */, 5 },
- /* 6 */ { MAD_F(0x05738c72) /* 0.340710111 */, 5 },
- /* 7 */ { MAD_F(0x06b1fc81) /* 0.418453696 */, 5 },
- /* 8 */ { MAD_F(0x04000000) /* 0.250000000 */, 6 },
- /* 9 */ { MAD_F(0x04ae20d7) /* 0.292511788 */, 6 },
- /* 10 */ { MAD_F(0x0562d694) /* 0.336630420 */, 6 },
- /* 11 */ { MAD_F(0x061dae96) /* 0.382246578 */, 6 },
- /* 12 */ { MAD_F(0x06de47f4) /* 0.429267841 */, 6 },
- /* 13 */ { MAD_F(0x07a44f7a) /* 0.477614858 */, 6 },
- /* 14 */ { MAD_F(0x0437be65) /* 0.263609310 */, 7 },
- /* 15 */ { MAD_F(0x049fc824) /* 0.289009227 */, 7 },
-
- /* 16 */ { MAD_F(0x050a28be) /* 0.314980262 */, 7 },
- /* 17 */ { MAD_F(0x0576c6f5) /* 0.341498336 */, 7 },
- /* 18 */ { MAD_F(0x05e58c0b) /* 0.368541759 */, 7 },
- /* 19 */ { MAD_F(0x06566361) /* 0.396090870 */, 7 },
- /* 20 */ { MAD_F(0x06c93a2e) /* 0.424127753 */, 7 },
- /* 21 */ { MAD_F(0x073dff3e) /* 0.452635998 */, 7 },
- /* 22 */ { MAD_F(0x07b4a2bc) /* 0.481600510 */, 7 },
- /* 23 */ { MAD_F(0x04168b05) /* 0.255503674 */, 8 },
- /* 24 */ { MAD_F(0x0453a5cd) /* 0.270421794 */, 8 },
- /* 25 */ { MAD_F(0x04919b6a) /* 0.285548607 */, 8 },
- /* 26 */ { MAD_F(0x04d065fb) /* 0.300878507 */, 8 },
- /* 27 */ { MAD_F(0x05100000) /* 0.316406250 */, 8 },
- /* 28 */ { MAD_F(0x05506451) /* 0.332126919 */, 8 },
- /* 29 */ { MAD_F(0x05918e15) /* 0.348035890 */, 8 },
- /* 30 */ { MAD_F(0x05d378bb) /* 0.364128809 */, 8 },
- /* 31 */ { MAD_F(0x06161ff3) /* 0.380401563 */, 8 },
-
- /* 32 */ { MAD_F(0x06597fa9) /* 0.396850263 */, 8 },
- /* 33 */ { MAD_F(0x069d9400) /* 0.413471222 */, 8 },
- /* 34 */ { MAD_F(0x06e2594c) /* 0.430260942 */, 8 },
- /* 35 */ { MAD_F(0x0727cc11) /* 0.447216097 */, 8 },
- /* 36 */ { MAD_F(0x076de8fc) /* 0.464333519 */, 8 },
- /* 37 */ { MAD_F(0x07b4ace3) /* 0.481610189 */, 8 },
- /* 38 */ { MAD_F(0x07fc14bf) /* 0.499043224 */, 8 },
- /* 39 */ { MAD_F(0x04220ed7) /* 0.258314934 */, 9 },
- /* 40 */ { MAD_F(0x04466275) /* 0.267183742 */, 9 },
- /* 41 */ { MAD_F(0x046b03e7) /* 0.276126771 */, 9 },
- /* 42 */ { MAD_F(0x048ff1e8) /* 0.285142811 */, 9 },
- /* 43 */ { MAD_F(0x04b52b3f) /* 0.294230696 */, 9 },
- /* 44 */ { MAD_F(0x04daaec0) /* 0.303389310 */, 9 },
- /* 45 */ { MAD_F(0x05007b49) /* 0.312617576 */, 9 },
- /* 46 */ { MAD_F(0x05268fc6) /* 0.321914457 */, 9 },
- /* 47 */ { MAD_F(0x054ceb2a) /* 0.331278957 */, 9 },
-
- /* 48 */ { MAD_F(0x05738c72) /* 0.340710111 */, 9 },
- /* 49 */ { MAD_F(0x059a72a5) /* 0.350206992 */, 9 },
- /* 50 */ { MAD_F(0x05c19cd3) /* 0.359768701 */, 9 },
- /* 51 */ { MAD_F(0x05e90a12) /* 0.369394372 */, 9 },
- /* 52 */ { MAD_F(0x0610b982) /* 0.379083164 */, 9 },
- /* 53 */ { MAD_F(0x0638aa48) /* 0.388834268 */, 9 },
- /* 54 */ { MAD_F(0x0660db91) /* 0.398646895 */, 9 },
- /* 55 */ { MAD_F(0x06894c90) /* 0.408520284 */, 9 },
- /* 56 */ { MAD_F(0x06b1fc81) /* 0.418453696 */, 9 },
- /* 57 */ { MAD_F(0x06daeaa1) /* 0.428446415 */, 9 },
- /* 58 */ { MAD_F(0x07041636) /* 0.438497744 */, 9 },
- /* 59 */ { MAD_F(0x072d7e8b) /* 0.448607009 */, 9 },
- /* 60 */ { MAD_F(0x075722ef) /* 0.458773552 */, 9 },
- /* 61 */ { MAD_F(0x078102b8) /* 0.468996735 */, 9 },
- /* 62 */ { MAD_F(0x07ab1d3e) /* 0.479275937 */, 9 },
- /* 63 */ { MAD_F(0x07d571e0) /* 0.489610555 */, 9 },
-
- /* 64 */ { MAD_F(0x04000000) /* 0.250000000 */, 10 },
- /* 65 */ { MAD_F(0x04156381) /* 0.255221850 */, 10 },
- /* 66 */ { MAD_F(0x042ae32a) /* 0.260470548 */, 10 },
- /* 67 */ { MAD_F(0x04407eb1) /* 0.265745823 */, 10 },
- /* 68 */ { MAD_F(0x045635cf) /* 0.271047409 */, 10 },
- /* 69 */ { MAD_F(0x046c083e) /* 0.276375048 */, 10 },
- /* 70 */ { MAD_F(0x0481f5bb) /* 0.281728487 */, 10 },
- /* 71 */ { MAD_F(0x0497fe03) /* 0.287107481 */, 10 },
- /* 72 */ { MAD_F(0x04ae20d7) /* 0.292511788 */, 10 },
- /* 73 */ { MAD_F(0x04c45df6) /* 0.297941173 */, 10 },
- /* 74 */ { MAD_F(0x04dab524) /* 0.303395408 */, 10 },
- /* 75 */ { MAD_F(0x04f12624) /* 0.308874267 */, 10 },
- /* 76 */ { MAD_F(0x0507b0bc) /* 0.314377532 */, 10 },
- /* 77 */ { MAD_F(0x051e54b1) /* 0.319904987 */, 10 },
- /* 78 */ { MAD_F(0x053511cb) /* 0.325456423 */, 10 },
- /* 79 */ { MAD_F(0x054be7d4) /* 0.331031635 */, 10 },
-
- /* 80 */ { MAD_F(0x0562d694) /* 0.336630420 */, 10 },
- /* 81 */ { MAD_F(0x0579ddd8) /* 0.342252584 */, 10 },
- /* 82 */ { MAD_F(0x0590fd6c) /* 0.347897931 */, 10 },
- /* 83 */ { MAD_F(0x05a8351c) /* 0.353566275 */, 10 },
- /* 84 */ { MAD_F(0x05bf84b8) /* 0.359257429 */, 10 },
- /* 85 */ { MAD_F(0x05d6ec0e) /* 0.364971213 */, 10 },
- /* 86 */ { MAD_F(0x05ee6aef) /* 0.370707448 */, 10 },
- /* 87 */ { MAD_F(0x0606012b) /* 0.376465960 */, 10 },
- /* 88 */ { MAD_F(0x061dae96) /* 0.382246578 */, 10 },
- /* 89 */ { MAD_F(0x06357302) /* 0.388049134 */, 10 },
- /* 90 */ { MAD_F(0x064d4e43) /* 0.393873464 */, 10 },
- /* 91 */ { MAD_F(0x0665402d) /* 0.399719406 */, 10 },
- /* 92 */ { MAD_F(0x067d4896) /* 0.405586801 */, 10 },
- /* 93 */ { MAD_F(0x06956753) /* 0.411475493 */, 10 },
- /* 94 */ { MAD_F(0x06ad9c3d) /* 0.417385331 */, 10 },
- /* 95 */ { MAD_F(0x06c5e72b) /* 0.423316162 */, 10 },
-
- /* 96 */ { MAD_F(0x06de47f4) /* 0.429267841 */, 10 },
- /* 97 */ { MAD_F(0x06f6be73) /* 0.435240221 */, 10 },
- /* 98 */ { MAD_F(0x070f4a80) /* 0.441233161 */, 10 },
- /* 99 */ { MAD_F(0x0727ebf7) /* 0.447246519 */, 10 },
- /* 100 */ { MAD_F(0x0740a2b2) /* 0.453280160 */, 10 },
- /* 101 */ { MAD_F(0x07596e8d) /* 0.459333946 */, 10 },
- /* 102 */ { MAD_F(0x07724f64) /* 0.465407744 */, 10 },
- /* 103 */ { MAD_F(0x078b4514) /* 0.471501425 */, 10 },
- /* 104 */ { MAD_F(0x07a44f7a) /* 0.477614858 */, 10 },
- /* 105 */ { MAD_F(0x07bd6e75) /* 0.483747918 */, 10 },
- /* 106 */ { MAD_F(0x07d6a1e2) /* 0.489900479 */, 10 },
- /* 107 */ { MAD_F(0x07efe9a1) /* 0.496072418 */, 10 },
- /* 108 */ { MAD_F(0x0404a2c9) /* 0.251131807 */, 11 },
- /* 109 */ { MAD_F(0x04115aca) /* 0.254236974 */, 11 },
- /* 110 */ { MAD_F(0x041e1cc4) /* 0.257351652 */, 11 },
- /* 111 */ { MAD_F(0x042ae8a7) /* 0.260475783 */, 11 },
-
- /* 112 */ { MAD_F(0x0437be65) /* 0.263609310 */, 11 },
- /* 113 */ { MAD_F(0x04449dee) /* 0.266752177 */, 11 },
- /* 114 */ { MAD_F(0x04518733) /* 0.269904329 */, 11 },
- /* 115 */ { MAD_F(0x045e7a26) /* 0.273065710 */, 11 },
- /* 116 */ { MAD_F(0x046b76b9) /* 0.276236269 */, 11 },
- /* 117 */ { MAD_F(0x04787cdc) /* 0.279415952 */, 11 },
- /* 118 */ { MAD_F(0x04858c83) /* 0.282604707 */, 11 },
- /* 119 */ { MAD_F(0x0492a59f) /* 0.285802482 */, 11 },
- /* 120 */ { MAD_F(0x049fc824) /* 0.289009227 */, 11 },
- /* 121 */ { MAD_F(0x04acf402) /* 0.292224893 */, 11 },
- /* 122 */ { MAD_F(0x04ba292e) /* 0.295449429 */, 11 },
- /* 123 */ { MAD_F(0x04c7679a) /* 0.298682788 */, 11 },
- /* 124 */ { MAD_F(0x04d4af3a) /* 0.301924921 */, 11 },
- /* 125 */ { MAD_F(0x04e20000) /* 0.305175781 */, 11 },
- /* 126 */ { MAD_F(0x04ef59e0) /* 0.308435322 */, 11 },
- /* 127 */ { MAD_F(0x04fcbcce) /* 0.311703498 */, 11 },
-
- /* 128 */ { MAD_F(0x050a28be) /* 0.314980262 */, 11 },
- /* 129 */ { MAD_F(0x05179da4) /* 0.318265572 */, 11 },
- /* 130 */ { MAD_F(0x05251b73) /* 0.321559381 */, 11 },
- /* 131 */ { MAD_F(0x0532a220) /* 0.324861647 */, 11 },
- /* 132 */ { MAD_F(0x054031a0) /* 0.328172327 */, 11 },
- /* 133 */ { MAD_F(0x054dc9e7) /* 0.331491377 */, 11 },
- /* 134 */ { MAD_F(0x055b6ae9) /* 0.334818756 */, 11 },
- /* 135 */ { MAD_F(0x0569149c) /* 0.338154423 */, 11 },
- /* 136 */ { MAD_F(0x0576c6f5) /* 0.341498336 */, 11 },
- /* 137 */ { MAD_F(0x058481e9) /* 0.344850455 */, 11 },
- /* 138 */ { MAD_F(0x0592456d) /* 0.348210741 */, 11 },
- /* 139 */ { MAD_F(0x05a01176) /* 0.351579152 */, 11 },
- /* 140 */ { MAD_F(0x05ade5fa) /* 0.354955651 */, 11 },
- /* 141 */ { MAD_F(0x05bbc2ef) /* 0.358340200 */, 11 },
- /* 142 */ { MAD_F(0x05c9a84a) /* 0.361732758 */, 11 },
- /* 143 */ { MAD_F(0x05d79601) /* 0.365133291 */, 11 },
-
- /* 144 */ { MAD_F(0x05e58c0b) /* 0.368541759 */, 11 },
- /* 145 */ { MAD_F(0x05f38a5d) /* 0.371958126 */, 11 },
- /* 146 */ { MAD_F(0x060190ee) /* 0.375382356 */, 11 },
- /* 147 */ { MAD_F(0x060f9fb3) /* 0.378814413 */, 11 },
- /* 148 */ { MAD_F(0x061db6a5) /* 0.382254261 */, 11 },
- /* 149 */ { MAD_F(0x062bd5b8) /* 0.385701865 */, 11 },
- /* 150 */ { MAD_F(0x0639fce4) /* 0.389157191 */, 11 },
- /* 151 */ { MAD_F(0x06482c1f) /* 0.392620204 */, 11 },
- /* 152 */ { MAD_F(0x06566361) /* 0.396090870 */, 11 },
- /* 153 */ { MAD_F(0x0664a2a0) /* 0.399569155 */, 11 },
- /* 154 */ { MAD_F(0x0672e9d4) /* 0.403055027 */, 11 },
- /* 155 */ { MAD_F(0x068138f3) /* 0.406548452 */, 11 },
- /* 156 */ { MAD_F(0x068f8ff5) /* 0.410049398 */, 11 },
- /* 157 */ { MAD_F(0x069deed1) /* 0.413557833 */, 11 },
- /* 158 */ { MAD_F(0x06ac557f) /* 0.417073724 */, 11 },
- /* 159 */ { MAD_F(0x06bac3f6) /* 0.420597041 */, 11 },
-
- /* 160 */ { MAD_F(0x06c93a2e) /* 0.424127753 */, 11 },
- /* 161 */ { MAD_F(0x06d7b81f) /* 0.427665827 */, 11 },
- /* 162 */ { MAD_F(0x06e63dc0) /* 0.431211234 */, 11 },
- /* 163 */ { MAD_F(0x06f4cb09) /* 0.434763944 */, 11 },
- /* 164 */ { MAD_F(0x07035ff3) /* 0.438323927 */, 11 },
- /* 165 */ { MAD_F(0x0711fc75) /* 0.441891153 */, 11 },
- /* 166 */ { MAD_F(0x0720a087) /* 0.445465593 */, 11 },
- /* 167 */ { MAD_F(0x072f4c22) /* 0.449047217 */, 11 },
- /* 168 */ { MAD_F(0x073dff3e) /* 0.452635998 */, 11 },
- /* 169 */ { MAD_F(0x074cb9d3) /* 0.456231906 */, 11 },
- /* 170 */ { MAD_F(0x075b7bdb) /* 0.459834914 */, 11 },
- /* 171 */ { MAD_F(0x076a454c) /* 0.463444993 */, 11 },
- /* 172 */ { MAD_F(0x07791620) /* 0.467062117 */, 11 },
- /* 173 */ { MAD_F(0x0787ee50) /* 0.470686258 */, 11 },
- /* 174 */ { MAD_F(0x0796cdd4) /* 0.474317388 */, 11 },
- /* 175 */ { MAD_F(0x07a5b4a5) /* 0.477955481 */, 11 },
-
- /* 176 */ { MAD_F(0x07b4a2bc) /* 0.481600510 */, 11 },
- /* 177 */ { MAD_F(0x07c39812) /* 0.485252449 */, 11 },
- /* 178 */ { MAD_F(0x07d294a0) /* 0.488911273 */, 11 },
- /* 179 */ { MAD_F(0x07e1985f) /* 0.492576954 */, 11 },
- /* 180 */ { MAD_F(0x07f0a348) /* 0.496249468 */, 11 },
- /* 181 */ { MAD_F(0x07ffb554) /* 0.499928790 */, 11 },
- /* 182 */ { MAD_F(0x0407673f) /* 0.251807447 */, 12 },
- /* 183 */ { MAD_F(0x040ef75e) /* 0.253653877 */, 12 },
- /* 184 */ { MAD_F(0x04168b05) /* 0.255503674 */, 12 },
- /* 185 */ { MAD_F(0x041e2230) /* 0.257356825 */, 12 },
- /* 186 */ { MAD_F(0x0425bcdd) /* 0.259213318 */, 12 },
- /* 187 */ { MAD_F(0x042d5b07) /* 0.261073141 */, 12 },
- /* 188 */ { MAD_F(0x0434fcad) /* 0.262936282 */, 12 },
- /* 189 */ { MAD_F(0x043ca1c9) /* 0.264802730 */, 12 },
- /* 190 */ { MAD_F(0x04444a5a) /* 0.266672472 */, 12 },
- /* 191 */ { MAD_F(0x044bf65d) /* 0.268545497 */, 12 },
-
- /* 192 */ { MAD_F(0x0453a5cd) /* 0.270421794 */, 12 },
- /* 193 */ { MAD_F(0x045b58a9) /* 0.272301352 */, 12 },
- /* 194 */ { MAD_F(0x04630eed) /* 0.274184158 */, 12 },
- /* 195 */ { MAD_F(0x046ac896) /* 0.276070203 */, 12 },
- /* 196 */ { MAD_F(0x047285a2) /* 0.277959474 */, 12 },
- /* 197 */ { MAD_F(0x047a460c) /* 0.279851960 */, 12 },
- /* 198 */ { MAD_F(0x048209d3) /* 0.281747652 */, 12 },
- /* 199 */ { MAD_F(0x0489d0f4) /* 0.283646538 */, 12 },
- /* 200 */ { MAD_F(0x04919b6a) /* 0.285548607 */, 12 },
- /* 201 */ { MAD_F(0x04996935) /* 0.287453849 */, 12 },
- /* 202 */ { MAD_F(0x04a13a50) /* 0.289362253 */, 12 },
- /* 203 */ { MAD_F(0x04a90eba) /* 0.291273810 */, 12 },
- /* 204 */ { MAD_F(0x04b0e66e) /* 0.293188507 */, 12 },
- /* 205 */ { MAD_F(0x04b8c16c) /* 0.295106336 */, 12 },
- /* 206 */ { MAD_F(0x04c09faf) /* 0.297027285 */, 12 },
- /* 207 */ { MAD_F(0x04c88135) /* 0.298951346 */, 12 },
-
- /* 208 */ { MAD_F(0x04d065fb) /* 0.300878507 */, 12 },
- /* 209 */ { MAD_F(0x04d84dff) /* 0.302808759 */, 12 },
- /* 210 */ { MAD_F(0x04e0393e) /* 0.304742092 */, 12 },
- /* 211 */ { MAD_F(0x04e827b6) /* 0.306678497 */, 12 },
- /* 212 */ { MAD_F(0x04f01963) /* 0.308617963 */, 12 },
- /* 213 */ { MAD_F(0x04f80e44) /* 0.310560480 */, 12 },
- /* 214 */ { MAD_F(0x05000655) /* 0.312506041 */, 12 },
- /* 215 */ { MAD_F(0x05080195) /* 0.314454634 */, 12 },
- /* 216 */ { MAD_F(0x05100000) /* 0.316406250 */, 12 },
- /* 217 */ { MAD_F(0x05180194) /* 0.318360880 */, 12 },
- /* 218 */ { MAD_F(0x0520064f) /* 0.320318516 */, 12 },
- /* 219 */ { MAD_F(0x05280e2d) /* 0.322279147 */, 12 },
- /* 220 */ { MAD_F(0x0530192e) /* 0.324242764 */, 12 },
- /* 221 */ { MAD_F(0x0538274e) /* 0.326209359 */, 12 },
- /* 222 */ { MAD_F(0x0540388a) /* 0.328178922 */, 12 },
- /* 223 */ { MAD_F(0x05484ce2) /* 0.330151445 */, 12 },
-
- /* 224 */ { MAD_F(0x05506451) /* 0.332126919 */, 12 },
- /* 225 */ { MAD_F(0x05587ed5) /* 0.334105334 */, 12 },
- /* 226 */ { MAD_F(0x05609c6e) /* 0.336086683 */, 12 },
- /* 227 */ { MAD_F(0x0568bd17) /* 0.338070956 */, 12 },
- /* 228 */ { MAD_F(0x0570e0cf) /* 0.340058145 */, 12 },
- /* 229 */ { MAD_F(0x05790793) /* 0.342048241 */, 12 },
- /* 230 */ { MAD_F(0x05813162) /* 0.344041237 */, 12 },
- /* 231 */ { MAD_F(0x05895e39) /* 0.346037122 */, 12 },
- /* 232 */ { MAD_F(0x05918e15) /* 0.348035890 */, 12 },
- /* 233 */ { MAD_F(0x0599c0f4) /* 0.350037532 */, 12 },
- /* 234 */ { MAD_F(0x05a1f6d5) /* 0.352042040 */, 12 },
- /* 235 */ { MAD_F(0x05aa2fb5) /* 0.354049405 */, 12 },
- /* 236 */ { MAD_F(0x05b26b92) /* 0.356059619 */, 12 },
- /* 237 */ { MAD_F(0x05baaa69) /* 0.358072674 */, 12 },
- /* 238 */ { MAD_F(0x05c2ec39) /* 0.360088563 */, 12 },
- /* 239 */ { MAD_F(0x05cb3100) /* 0.362107278 */, 12 },
-
- /* 240 */ { MAD_F(0x05d378bb) /* 0.364128809 */, 12 },
- /* 241 */ { MAD_F(0x05dbc368) /* 0.366153151 */, 12 },
- /* 242 */ { MAD_F(0x05e41105) /* 0.368180294 */, 12 },
- /* 243 */ { MAD_F(0x05ec6190) /* 0.370210231 */, 12 },
- /* 244 */ { MAD_F(0x05f4b507) /* 0.372242955 */, 12 },
- /* 245 */ { MAD_F(0x05fd0b68) /* 0.374278458 */, 12 },
- /* 246 */ { MAD_F(0x060564b1) /* 0.376316732 */, 12 },
- /* 247 */ { MAD_F(0x060dc0e0) /* 0.378357769 */, 12 },
- /* 248 */ { MAD_F(0x06161ff3) /* 0.380401563 */, 12 },
- /* 249 */ { MAD_F(0x061e81e8) /* 0.382448106 */, 12 },
- /* 250 */ { MAD_F(0x0626e6bc) /* 0.384497391 */, 12 },
- /* 251 */ { MAD_F(0x062f4e6f) /* 0.386549409 */, 12 },
- /* 252 */ { MAD_F(0x0637b8fd) /* 0.388604155 */, 12 },
- /* 253 */ { MAD_F(0x06402666) /* 0.390661620 */, 12 },
- /* 254 */ { MAD_F(0x064896a7) /* 0.392721798 */, 12 },
- /* 255 */ { MAD_F(0x065109be) /* 0.394784681 */, 12 },
-
- /* 256 */ { MAD_F(0x06597fa9) /* 0.396850263 */, 12 },
- /* 257 */ { MAD_F(0x0661f867) /* 0.398918536 */, 12 },
- /* 258 */ { MAD_F(0x066a73f5) /* 0.400989493 */, 12 },
- /* 259 */ { MAD_F(0x0672f252) /* 0.403063128 */, 12 },
- /* 260 */ { MAD_F(0x067b737c) /* 0.405139433 */, 12 },
- /* 261 */ { MAD_F(0x0683f771) /* 0.407218402 */, 12 },
- /* 262 */ { MAD_F(0x068c7e2f) /* 0.409300027 */, 12 },
- /* 263 */ { MAD_F(0x069507b5) /* 0.411384303 */, 12 },
- /* 264 */ { MAD_F(0x069d9400) /* 0.413471222 */, 12 },
- /* 265 */ { MAD_F(0x06a6230f) /* 0.415560778 */, 12 },
- /* 266 */ { MAD_F(0x06aeb4e0) /* 0.417652964 */, 12 },
- /* 267 */ { MAD_F(0x06b74971) /* 0.419747773 */, 12 },
- /* 268 */ { MAD_F(0x06bfe0c0) /* 0.421845199 */, 12 },
- /* 269 */ { MAD_F(0x06c87acc) /* 0.423945235 */, 12 },
- /* 270 */ { MAD_F(0x06d11794) /* 0.426047876 */, 12 },
- /* 271 */ { MAD_F(0x06d9b714) /* 0.428153114 */, 12 },
-
- /* 272 */ { MAD_F(0x06e2594c) /* 0.430260942 */, 12 },
- /* 273 */ { MAD_F(0x06eafe3a) /* 0.432371356 */, 12 },
- /* 274 */ { MAD_F(0x06f3a5dc) /* 0.434484348 */, 12 },
- /* 275 */ { MAD_F(0x06fc5030) /* 0.436599912 */, 12 },
- /* 276 */ { MAD_F(0x0704fd35) /* 0.438718042 */, 12 },
- /* 277 */ { MAD_F(0x070dacea) /* 0.440838732 */, 12 },
- /* 278 */ { MAD_F(0x07165f4b) /* 0.442961975 */, 12 },
- /* 279 */ { MAD_F(0x071f1459) /* 0.445087765 */, 12 },
- /* 280 */ { MAD_F(0x0727cc11) /* 0.447216097 */, 12 },
- /* 281 */ { MAD_F(0x07308671) /* 0.449346964 */, 12 },
- /* 282 */ { MAD_F(0x07394378) /* 0.451480360 */, 12 },
- /* 283 */ { MAD_F(0x07420325) /* 0.453616280 */, 12 },
- /* 284 */ { MAD_F(0x074ac575) /* 0.455754717 */, 12 },
- /* 285 */ { MAD_F(0x07538a67) /* 0.457895665 */, 12 },
- /* 286 */ { MAD_F(0x075c51fa) /* 0.460039119 */, 12 },
- /* 287 */ { MAD_F(0x07651c2c) /* 0.462185072 */, 12 },
-
- /* 288 */ { MAD_F(0x076de8fc) /* 0.464333519 */, 12 },
- /* 289 */ { MAD_F(0x0776b867) /* 0.466484455 */, 12 },
- /* 290 */ { MAD_F(0x077f8a6d) /* 0.468637872 */, 12 },
- /* 291 */ { MAD_F(0x07885f0b) /* 0.470793767 */, 12 },
- /* 292 */ { MAD_F(0x07913641) /* 0.472952132 */, 12 },
- /* 293 */ { MAD_F(0x079a100c) /* 0.475112962 */, 12 },
- /* 294 */ { MAD_F(0x07a2ec6c) /* 0.477276252 */, 12 },
- /* 295 */ { MAD_F(0x07abcb5f) /* 0.479441997 */, 12 },
- /* 296 */ { MAD_F(0x07b4ace3) /* 0.481610189 */, 12 },
- /* 297 */ { MAD_F(0x07bd90f6) /* 0.483780825 */, 12 },
- /* 298 */ { MAD_F(0x07c67798) /* 0.485953899 */, 12 },
- /* 299 */ { MAD_F(0x07cf60c7) /* 0.488129404 */, 12 },
- /* 300 */ { MAD_F(0x07d84c81) /* 0.490307336 */, 12 },
- /* 301 */ { MAD_F(0x07e13ac5) /* 0.492487690 */, 12 },
- /* 302 */ { MAD_F(0x07ea2b92) /* 0.494670459 */, 12 },
- /* 303 */ { MAD_F(0x07f31ee6) /* 0.496855639 */, 12 },
-
- /* 304 */ { MAD_F(0x07fc14bf) /* 0.499043224 */, 12 },
- /* 305 */ { MAD_F(0x0402868e) /* 0.250616605 */, 13 },
- /* 306 */ { MAD_F(0x040703ff) /* 0.251712795 */, 13 },
- /* 307 */ { MAD_F(0x040b82b0) /* 0.252810180 */, 13 },
- /* 308 */ { MAD_F(0x041002a1) /* 0.253908756 */, 13 },
- /* 309 */ { MAD_F(0x041483d1) /* 0.255008523 */, 13 },
- /* 310 */ { MAD_F(0x04190640) /* 0.256109476 */, 13 },
- /* 311 */ { MAD_F(0x041d89ed) /* 0.257211614 */, 13 },
- /* 312 */ { MAD_F(0x04220ed7) /* 0.258314934 */, 13 },
- /* 313 */ { MAD_F(0x042694fe) /* 0.259419433 */, 13 },
- /* 314 */ { MAD_F(0x042b1c60) /* 0.260525110 */, 13 },
- /* 315 */ { MAD_F(0x042fa4fe) /* 0.261631960 */, 13 },
- /* 316 */ { MAD_F(0x04342ed7) /* 0.262739982 */, 13 },
- /* 317 */ { MAD_F(0x0438b9e9) /* 0.263849174 */, 13 },
- /* 318 */ { MAD_F(0x043d4635) /* 0.264959533 */, 13 },
- /* 319 */ { MAD_F(0x0441d3b9) /* 0.266071056 */, 13 },
-
- /* 320 */ { MAD_F(0x04466275) /* 0.267183742 */, 13 },
- /* 321 */ { MAD_F(0x044af269) /* 0.268297587 */, 13 },
- /* 322 */ { MAD_F(0x044f8393) /* 0.269412589 */, 13 },
- /* 323 */ { MAD_F(0x045415f3) /* 0.270528746 */, 13 },
- /* 324 */ { MAD_F(0x0458a989) /* 0.271646056 */, 13 },
- /* 325 */ { MAD_F(0x045d3e53) /* 0.272764515 */, 13 },
- /* 326 */ { MAD_F(0x0461d451) /* 0.273884123 */, 13 },
- /* 327 */ { MAD_F(0x04666b83) /* 0.275004875 */, 13 },
- /* 328 */ { MAD_F(0x046b03e7) /* 0.276126771 */, 13 },
- /* 329 */ { MAD_F(0x046f9d7e) /* 0.277249808 */, 13 },
- /* 330 */ { MAD_F(0x04743847) /* 0.278373983 */, 13 },
- /* 331 */ { MAD_F(0x0478d440) /* 0.279499294 */, 13 },
- /* 332 */ { MAD_F(0x047d716a) /* 0.280625739 */, 13 },
- /* 333 */ { MAD_F(0x04820fc3) /* 0.281753315 */, 13 },
- /* 334 */ { MAD_F(0x0486af4c) /* 0.282882021 */, 13 },
- /* 335 */ { MAD_F(0x048b5003) /* 0.284011853 */, 13 },
-
- /* 336 */ { MAD_F(0x048ff1e8) /* 0.285142811 */, 13 },
- /* 337 */ { MAD_F(0x049494fb) /* 0.286274891 */, 13 },
- /* 338 */ { MAD_F(0x0499393a) /* 0.287408091 */, 13 },
- /* 339 */ { MAD_F(0x049ddea5) /* 0.288542409 */, 13 },
- /* 340 */ { MAD_F(0x04a2853c) /* 0.289677844 */, 13 },
- /* 341 */ { MAD_F(0x04a72cfe) /* 0.290814392 */, 13 },
- /* 342 */ { MAD_F(0x04abd5ea) /* 0.291952051 */, 13 },
- /* 343 */ { MAD_F(0x04b08000) /* 0.293090820 */, 13 },
- /* 344 */ { MAD_F(0x04b52b3f) /* 0.294230696 */, 13 },
- /* 345 */ { MAD_F(0x04b9d7a7) /* 0.295371678 */, 13 },
- /* 346 */ { MAD_F(0x04be8537) /* 0.296513762 */, 13 },
- /* 347 */ { MAD_F(0x04c333ee) /* 0.297656947 */, 13 },
- /* 348 */ { MAD_F(0x04c7e3cc) /* 0.298801231 */, 13 },
- /* 349 */ { MAD_F(0x04cc94d1) /* 0.299946611 */, 13 },
- /* 350 */ { MAD_F(0x04d146fb) /* 0.301093085 */, 13 },
- /* 351 */ { MAD_F(0x04d5fa4b) /* 0.302240653 */, 13 },
-
- /* 352 */ { MAD_F(0x04daaec0) /* 0.303389310 */, 13 },
- /* 353 */ { MAD_F(0x04df6458) /* 0.304539056 */, 13 },
- /* 354 */ { MAD_F(0x04e41b14) /* 0.305689888 */, 13 },
- /* 355 */ { MAD_F(0x04e8d2f3) /* 0.306841804 */, 13 },
- /* 356 */ { MAD_F(0x04ed8bf5) /* 0.307994802 */, 13 },
- /* 357 */ { MAD_F(0x04f24618) /* 0.309148880 */, 13 },
- /* 358 */ { MAD_F(0x04f7015d) /* 0.310304037 */, 13 },
- /* 359 */ { MAD_F(0x04fbbdc3) /* 0.311460269 */, 13 },
- /* 360 */ { MAD_F(0x05007b49) /* 0.312617576 */, 13 },
- /* 361 */ { MAD_F(0x050539ef) /* 0.313775954 */, 13 },
- /* 362 */ { MAD_F(0x0509f9b4) /* 0.314935403 */, 13 },
- /* 363 */ { MAD_F(0x050eba98) /* 0.316095920 */, 13 },
- /* 364 */ { MAD_F(0x05137c9a) /* 0.317257503 */, 13 },
- /* 365 */ { MAD_F(0x05183fba) /* 0.318420150 */, 13 },
- /* 366 */ { MAD_F(0x051d03f7) /* 0.319583859 */, 13 },
- /* 367 */ { MAD_F(0x0521c950) /* 0.320748629 */, 13 },
-
- /* 368 */ { MAD_F(0x05268fc6) /* 0.321914457 */, 13 },
- /* 369 */ { MAD_F(0x052b5757) /* 0.323081342 */, 13 },
- /* 370 */ { MAD_F(0x05302003) /* 0.324249281 */, 13 },
- /* 371 */ { MAD_F(0x0534e9ca) /* 0.325418273 */, 13 },
- /* 372 */ { MAD_F(0x0539b4ab) /* 0.326588316 */, 13 },
- /* 373 */ { MAD_F(0x053e80a6) /* 0.327759407 */, 13 },
- /* 374 */ { MAD_F(0x05434db9) /* 0.328931546 */, 13 },
- /* 375 */ { MAD_F(0x05481be5) /* 0.330104730 */, 13 },
- /* 376 */ { MAD_F(0x054ceb2a) /* 0.331278957 */, 13 },
- /* 377 */ { MAD_F(0x0551bb85) /* 0.332454225 */, 13 },
- /* 378 */ { MAD_F(0x05568cf8) /* 0.333630533 */, 13 },
- /* 379 */ { MAD_F(0x055b5f81) /* 0.334807879 */, 13 },
- /* 380 */ { MAD_F(0x05603321) /* 0.335986261 */, 13 },
- /* 381 */ { MAD_F(0x056507d6) /* 0.337165677 */, 13 },
- /* 382 */ { MAD_F(0x0569dda0) /* 0.338346125 */, 13 },
- /* 383 */ { MAD_F(0x056eb47f) /* 0.339527604 */, 13 },
-
- /* 384 */ { MAD_F(0x05738c72) /* 0.340710111 */, 13 },
- /* 385 */ { MAD_F(0x05786578) /* 0.341893646 */, 13 },
- /* 386 */ { MAD_F(0x057d3f92) /* 0.343078205 */, 13 },
- /* 387 */ { MAD_F(0x05821abf) /* 0.344263788 */, 13 },
- /* 388 */ { MAD_F(0x0586f6fd) /* 0.345450393 */, 13 },
- /* 389 */ { MAD_F(0x058bd44e) /* 0.346638017 */, 13 },
- /* 390 */ { MAD_F(0x0590b2b0) /* 0.347826659 */, 13 },
- /* 391 */ { MAD_F(0x05959222) /* 0.349016318 */, 13 },
- /* 392 */ { MAD_F(0x059a72a5) /* 0.350206992 */, 13 },
- /* 393 */ { MAD_F(0x059f5438) /* 0.351398678 */, 13 },
- /* 394 */ { MAD_F(0x05a436da) /* 0.352591376 */, 13 },
- /* 395 */ { MAD_F(0x05a91a8c) /* 0.353785083 */, 13 },
- /* 396 */ { MAD_F(0x05adff4c) /* 0.354979798 */, 13 },
- /* 397 */ { MAD_F(0x05b2e51a) /* 0.356175519 */, 13 },
- /* 398 */ { MAD_F(0x05b7cbf5) /* 0.357372244 */, 13 },
- /* 399 */ { MAD_F(0x05bcb3de) /* 0.358569972 */, 13 },
-
- /* 400 */ { MAD_F(0x05c19cd3) /* 0.359768701 */, 13 },
- /* 401 */ { MAD_F(0x05c686d5) /* 0.360968429 */, 13 },
- /* 402 */ { MAD_F(0x05cb71e2) /* 0.362169156 */, 13 },
- /* 403 */ { MAD_F(0x05d05dfb) /* 0.363370878 */, 13 },
- /* 404 */ { MAD_F(0x05d54b1f) /* 0.364573594 */, 13 },
- /* 405 */ { MAD_F(0x05da394d) /* 0.365777304 */, 13 },
- /* 406 */ { MAD_F(0x05df2885) /* 0.366982004 */, 13 },
- /* 407 */ { MAD_F(0x05e418c7) /* 0.368187694 */, 13 },
- /* 408 */ { MAD_F(0x05e90a12) /* 0.369394372 */, 13 },
- /* 409 */ { MAD_F(0x05edfc66) /* 0.370602036 */, 13 },
- /* 410 */ { MAD_F(0x05f2efc2) /* 0.371810684 */, 13 },
- /* 411 */ { MAD_F(0x05f7e426) /* 0.373020316 */, 13 },
- /* 412 */ { MAD_F(0x05fcd992) /* 0.374230929 */, 13 },
- /* 413 */ { MAD_F(0x0601d004) /* 0.375442522 */, 13 },
- /* 414 */ { MAD_F(0x0606c77d) /* 0.376655093 */, 13 },
- /* 415 */ { MAD_F(0x060bbffd) /* 0.377868641 */, 13 },
-
- /* 416 */ { MAD_F(0x0610b982) /* 0.379083164 */, 13 },
- /* 417 */ { MAD_F(0x0615b40c) /* 0.380298661 */, 13 },
- /* 418 */ { MAD_F(0x061aaf9c) /* 0.381515130 */, 13 },
- /* 419 */ { MAD_F(0x061fac2f) /* 0.382732569 */, 13 },
- /* 420 */ { MAD_F(0x0624a9c7) /* 0.383950977 */, 13 },
- /* 421 */ { MAD_F(0x0629a863) /* 0.385170352 */, 13 },
- /* 422 */ { MAD_F(0x062ea802) /* 0.386390694 */, 13 },
- /* 423 */ { MAD_F(0x0633a8a3) /* 0.387611999 */, 13 },
- /* 424 */ { MAD_F(0x0638aa48) /* 0.388834268 */, 13 },
- /* 425 */ { MAD_F(0x063dacee) /* 0.390057497 */, 13 },
- /* 426 */ { MAD_F(0x0642b096) /* 0.391281687 */, 13 },
- /* 427 */ { MAD_F(0x0647b53f) /* 0.392506834 */, 13 },
- /* 428 */ { MAD_F(0x064cbae9) /* 0.393732939 */, 13 },
- /* 429 */ { MAD_F(0x0651c193) /* 0.394959999 */, 13 },
- /* 430 */ { MAD_F(0x0656c93d) /* 0.396188012 */, 13 },
- /* 431 */ { MAD_F(0x065bd1e7) /* 0.397416978 */, 13 },
-
- /* 432 */ { MAD_F(0x0660db91) /* 0.398646895 */, 13 },
- /* 433 */ { MAD_F(0x0665e639) /* 0.399877761 */, 13 },
- /* 434 */ { MAD_F(0x066af1df) /* 0.401109575 */, 13 },
- /* 435 */ { MAD_F(0x066ffe84) /* 0.402342335 */, 13 },
- /* 436 */ { MAD_F(0x06750c26) /* 0.403576041 */, 13 },
- /* 437 */ { MAD_F(0x067a1ac6) /* 0.404810690 */, 13 },
- /* 438 */ { MAD_F(0x067f2a62) /* 0.406046281 */, 13 },
- /* 439 */ { MAD_F(0x06843afb) /* 0.407282813 */, 13 },
- /* 440 */ { MAD_F(0x06894c90) /* 0.408520284 */, 13 },
- /* 441 */ { MAD_F(0x068e5f21) /* 0.409758693 */, 13 },
- /* 442 */ { MAD_F(0x069372ae) /* 0.410998038 */, 13 },
- /* 443 */ { MAD_F(0x06988735) /* 0.412238319 */, 13 },
- /* 444 */ { MAD_F(0x069d9cb7) /* 0.413479532 */, 13 },
- /* 445 */ { MAD_F(0x06a2b333) /* 0.414721679 */, 13 },
- /* 446 */ { MAD_F(0x06a7caa9) /* 0.415964756 */, 13 },
- /* 447 */ { MAD_F(0x06ace318) /* 0.417208762 */, 13 },
-
- /* 448 */ { MAD_F(0x06b1fc81) /* 0.418453696 */, 13 },
- /* 449 */ { MAD_F(0x06b716e2) /* 0.419699557 */, 13 },
- /* 450 */ { MAD_F(0x06bc323b) /* 0.420946343 */, 13 },
- /* 451 */ { MAD_F(0x06c14e8d) /* 0.422194054 */, 13 },
- /* 452 */ { MAD_F(0x06c66bd6) /* 0.423442686 */, 13 },
- /* 453 */ { MAD_F(0x06cb8a17) /* 0.424692240 */, 13 },
- /* 454 */ { MAD_F(0x06d0a94e) /* 0.425942714 */, 13 },
- /* 455 */ { MAD_F(0x06d5c97c) /* 0.427194106 */, 13 },
- /* 456 */ { MAD_F(0x06daeaa1) /* 0.428446415 */, 13 },
- /* 457 */ { MAD_F(0x06e00cbb) /* 0.429699640 */, 13 },
- /* 458 */ { MAD_F(0x06e52fca) /* 0.430953779 */, 13 },
- /* 459 */ { MAD_F(0x06ea53cf) /* 0.432208832 */, 13 },
- /* 460 */ { MAD_F(0x06ef78c8) /* 0.433464796 */, 13 },
- /* 461 */ { MAD_F(0x06f49eb6) /* 0.434721671 */, 13 },
- /* 462 */ { MAD_F(0x06f9c597) /* 0.435979455 */, 13 },
- /* 463 */ { MAD_F(0x06feed6d) /* 0.437238146 */, 13 },
-
- /* 464 */ { MAD_F(0x07041636) /* 0.438497744 */, 13 },
- /* 465 */ { MAD_F(0x07093ff2) /* 0.439758248 */, 13 },
- /* 466 */ { MAD_F(0x070e6aa0) /* 0.441019655 */, 13 },
- /* 467 */ { MAD_F(0x07139641) /* 0.442281965 */, 13 },
- /* 468 */ { MAD_F(0x0718c2d3) /* 0.443545176 */, 13 },
- /* 469 */ { MAD_F(0x071df058) /* 0.444809288 */, 13 },
- /* 470 */ { MAD_F(0x07231ecd) /* 0.446074298 */, 13 },
- /* 471 */ { MAD_F(0x07284e34) /* 0.447340205 */, 13 },
- /* 472 */ { MAD_F(0x072d7e8b) /* 0.448607009 */, 13 },
- /* 473 */ { MAD_F(0x0732afd2) /* 0.449874708 */, 13 },
- /* 474 */ { MAD_F(0x0737e209) /* 0.451143300 */, 13 },
- /* 475 */ { MAD_F(0x073d1530) /* 0.452412785 */, 13 },
- /* 476 */ { MAD_F(0x07424946) /* 0.453683161 */, 13 },
- /* 477 */ { MAD_F(0x07477e4b) /* 0.454954427 */, 13 },
- /* 478 */ { MAD_F(0x074cb43e) /* 0.456226581 */, 13 },
- /* 479 */ { MAD_F(0x0751eb20) /* 0.457499623 */, 13 },
-
- /* 480 */ { MAD_F(0x075722ef) /* 0.458773552 */, 13 },
- /* 481 */ { MAD_F(0x075c5bac) /* 0.460048365 */, 13 },
- /* 482 */ { MAD_F(0x07619557) /* 0.461324062 */, 13 },
- /* 483 */ { MAD_F(0x0766cfee) /* 0.462600642 */, 13 },
- /* 484 */ { MAD_F(0x076c0b72) /* 0.463878102 */, 13 },
- /* 485 */ { MAD_F(0x077147e2) /* 0.465156443 */, 13 },
- /* 486 */ { MAD_F(0x0776853e) /* 0.466435663 */, 13 },
- /* 487 */ { MAD_F(0x077bc385) /* 0.467715761 */, 13 },
- /* 488 */ { MAD_F(0x078102b8) /* 0.468996735 */, 13 },
- /* 489 */ { MAD_F(0x078642d6) /* 0.470278584 */, 13 },
- /* 490 */ { MAD_F(0x078b83de) /* 0.471561307 */, 13 },
- /* 491 */ { MAD_F(0x0790c5d1) /* 0.472844904 */, 13 },
- /* 492 */ { MAD_F(0x079608ae) /* 0.474129372 */, 13 },
- /* 493 */ { MAD_F(0x079b4c74) /* 0.475414710 */, 13 },
- /* 494 */ { MAD_F(0x07a09124) /* 0.476700918 */, 13 },
- /* 495 */ { MAD_F(0x07a5d6bd) /* 0.477987994 */, 13 },
-
- /* 496 */ { MAD_F(0x07ab1d3e) /* 0.479275937 */, 13 },
- /* 497 */ { MAD_F(0x07b064a8) /* 0.480564746 */, 13 },
- /* 498 */ { MAD_F(0x07b5acfb) /* 0.481854420 */, 13 },
- /* 499 */ { MAD_F(0x07baf635) /* 0.483144957 */, 13 },
- /* 500 */ { MAD_F(0x07c04056) /* 0.484436356 */, 13 },
- /* 501 */ { MAD_F(0x07c58b5f) /* 0.485728617 */, 13 },
- /* 502 */ { MAD_F(0x07cad74e) /* 0.487021738 */, 13 },
- /* 503 */ { MAD_F(0x07d02424) /* 0.488315717 */, 13 },
- /* 504 */ { MAD_F(0x07d571e0) /* 0.489610555 */, 13 },
- /* 505 */ { MAD_F(0x07dac083) /* 0.490906249 */, 13 },
- /* 506 */ { MAD_F(0x07e0100a) /* 0.492202799 */, 13 },
- /* 507 */ { MAD_F(0x07e56078) /* 0.493500203 */, 13 },
- /* 508 */ { MAD_F(0x07eab1ca) /* 0.494798460 */, 13 },
- /* 509 */ { MAD_F(0x07f00401) /* 0.496097570 */, 13 },
- /* 510 */ { MAD_F(0x07f5571d) /* 0.497397530 */, 13 },
- /* 511 */ { MAD_F(0x07faab1c) /* 0.498698341 */, 13 },
-
- /* 512 */ { MAD_F(0x04000000) /* 0.250000000 */, 14 },
- /* 513 */ { MAD_F(0x0402aae3) /* 0.250651254 */, 14 },
- /* 514 */ { MAD_F(0x04055638) /* 0.251302930 */, 14 },
- /* 515 */ { MAD_F(0x040801ff) /* 0.251955030 */, 14 },
- /* 516 */ { MAD_F(0x040aae37) /* 0.252607552 */, 14 },
- /* 517 */ { MAD_F(0x040d5ae0) /* 0.253260495 */, 14 },
- /* 518 */ { MAD_F(0x041007fa) /* 0.253913860 */, 14 },
- /* 519 */ { MAD_F(0x0412b586) /* 0.254567645 */, 14 },
- /* 520 */ { MAD_F(0x04156381) /* 0.255221850 */, 14 },
- /* 521 */ { MAD_F(0x041811ee) /* 0.255876475 */, 14 },
- /* 522 */ { MAD_F(0x041ac0cb) /* 0.256531518 */, 14 },
- /* 523 */ { MAD_F(0x041d7018) /* 0.257186980 */, 14 },
- /* 524 */ { MAD_F(0x04201fd5) /* 0.257842860 */, 14 },
- /* 525 */ { MAD_F(0x0422d003) /* 0.258499157 */, 14 },
- /* 526 */ { MAD_F(0x042580a0) /* 0.259155872 */, 14 },
- /* 527 */ { MAD_F(0x042831ad) /* 0.259813002 */, 14 },
-
- /* 528 */ { MAD_F(0x042ae32a) /* 0.260470548 */, 14 },
- /* 529 */ { MAD_F(0x042d9516) /* 0.261128510 */, 14 },
- /* 530 */ { MAD_F(0x04304772) /* 0.261786886 */, 14 },
- /* 531 */ { MAD_F(0x0432fa3d) /* 0.262445676 */, 14 },
- /* 532 */ { MAD_F(0x0435ad76) /* 0.263104880 */, 14 },
- /* 533 */ { MAD_F(0x0438611f) /* 0.263764497 */, 14 },
- /* 534 */ { MAD_F(0x043b1536) /* 0.264424527 */, 14 },
- /* 535 */ { MAD_F(0x043dc9bc) /* 0.265084969 */, 14 },
- /* 536 */ { MAD_F(0x04407eb1) /* 0.265745823 */, 14 },
- /* 537 */ { MAD_F(0x04433414) /* 0.266407088 */, 14 },
- /* 538 */ { MAD_F(0x0445e9e5) /* 0.267068763 */, 14 },
- /* 539 */ { MAD_F(0x0448a024) /* 0.267730848 */, 14 },
- /* 540 */ { MAD_F(0x044b56d1) /* 0.268393343 */, 14 },
- /* 541 */ { MAD_F(0x044e0dec) /* 0.269056248 */, 14 },
- /* 542 */ { MAD_F(0x0450c575) /* 0.269719560 */, 14 },
- /* 543 */ { MAD_F(0x04537d6b) /* 0.270383281 */, 14 },
-
- /* 544 */ { MAD_F(0x045635cf) /* 0.271047409 */, 14 },
- /* 545 */ { MAD_F(0x0458ee9f) /* 0.271711944 */, 14 },
- /* 546 */ { MAD_F(0x045ba7dd) /* 0.272376886 */, 14 },
- /* 547 */ { MAD_F(0x045e6188) /* 0.273042234 */, 14 },
- /* 548 */ { MAD_F(0x04611ba0) /* 0.273707988 */, 14 },
- /* 549 */ { MAD_F(0x0463d625) /* 0.274374147 */, 14 },
- /* 550 */ { MAD_F(0x04669116) /* 0.275040710 */, 14 },
- /* 551 */ { MAD_F(0x04694c74) /* 0.275707677 */, 14 },
- /* 552 */ { MAD_F(0x046c083e) /* 0.276375048 */, 14 },
- /* 553 */ { MAD_F(0x046ec474) /* 0.277042822 */, 14 },
- /* 554 */ { MAD_F(0x04718116) /* 0.277710999 */, 14 },
- /* 555 */ { MAD_F(0x04743e25) /* 0.278379578 */, 14 },
- /* 556 */ { MAD_F(0x0476fb9f) /* 0.279048558 */, 14 },
- /* 557 */ { MAD_F(0x0479b984) /* 0.279717940 */, 14 },
- /* 558 */ { MAD_F(0x047c77d6) /* 0.280387722 */, 14 },
- /* 559 */ { MAD_F(0x047f3693) /* 0.281057905 */, 14 },
-
- /* 560 */ { MAD_F(0x0481f5bb) /* 0.281728487 */, 14 },
- /* 561 */ { MAD_F(0x0484b54e) /* 0.282399469 */, 14 },
- /* 562 */ { MAD_F(0x0487754c) /* 0.283070849 */, 14 },
- /* 563 */ { MAD_F(0x048a35b6) /* 0.283742628 */, 14 },
- /* 564 */ { MAD_F(0x048cf68a) /* 0.284414805 */, 14 },
- /* 565 */ { MAD_F(0x048fb7c8) /* 0.285087379 */, 14 },
- /* 566 */ { MAD_F(0x04927972) /* 0.285760350 */, 14 },
- /* 567 */ { MAD_F(0x04953b85) /* 0.286433717 */, 14 },
- /* 568 */ { MAD_F(0x0497fe03) /* 0.287107481 */, 14 },
- /* 569 */ { MAD_F(0x049ac0eb) /* 0.287781640 */, 14 },
- /* 570 */ { MAD_F(0x049d843e) /* 0.288456194 */, 14 },
- /* 571 */ { MAD_F(0x04a047fa) /* 0.289131142 */, 14 },
- /* 572 */ { MAD_F(0x04a30c20) /* 0.289806485 */, 14 },
- /* 573 */ { MAD_F(0x04a5d0af) /* 0.290482221 */, 14 },
- /* 574 */ { MAD_F(0x04a895a8) /* 0.291158351 */, 14 },
- /* 575 */ { MAD_F(0x04ab5b0b) /* 0.291834873 */, 14 },
-
- /* 576 */ { MAD_F(0x04ae20d7) /* 0.292511788 */, 14 },
- /* 577 */ { MAD_F(0x04b0e70c) /* 0.293189094 */, 14 },
- /* 578 */ { MAD_F(0x04b3adaa) /* 0.293866792 */, 14 },
- /* 579 */ { MAD_F(0x04b674b1) /* 0.294544881 */, 14 },
- /* 580 */ { MAD_F(0x04b93c21) /* 0.295223360 */, 14 },
- /* 581 */ { MAD_F(0x04bc03fa) /* 0.295902229 */, 14 },
- /* 582 */ { MAD_F(0x04becc3b) /* 0.296581488 */, 14 },
- /* 583 */ { MAD_F(0x04c194e4) /* 0.297261136 */, 14 },
- /* 584 */ { MAD_F(0x04c45df6) /* 0.297941173 */, 14 },
- /* 585 */ { MAD_F(0x04c72771) /* 0.298621598 */, 14 },
- /* 586 */ { MAD_F(0x04c9f153) /* 0.299302411 */, 14 },
- /* 587 */ { MAD_F(0x04ccbb9d) /* 0.299983611 */, 14 },
- /* 588 */ { MAD_F(0x04cf864f) /* 0.300665198 */, 14 },
- /* 589 */ { MAD_F(0x04d25169) /* 0.301347172 */, 14 },
- /* 590 */ { MAD_F(0x04d51ceb) /* 0.302029532 */, 14 },
- /* 591 */ { MAD_F(0x04d7e8d4) /* 0.302712277 */, 14 },
-
- /* 592 */ { MAD_F(0x04dab524) /* 0.303395408 */, 14 },
- /* 593 */ { MAD_F(0x04dd81dc) /* 0.304078923 */, 14 },
- /* 594 */ { MAD_F(0x04e04efb) /* 0.304762823 */, 14 },
- /* 595 */ { MAD_F(0x04e31c81) /* 0.305447106 */, 14 },
- /* 596 */ { MAD_F(0x04e5ea6e) /* 0.306131773 */, 14 },
- /* 597 */ { MAD_F(0x04e8b8c2) /* 0.306816823 */, 14 },
- /* 598 */ { MAD_F(0x04eb877c) /* 0.307502256 */, 14 },
- /* 599 */ { MAD_F(0x04ee569d) /* 0.308188071 */, 14 },
- /* 600 */ { MAD_F(0x04f12624) /* 0.308874267 */, 14 },
- /* 601 */ { MAD_F(0x04f3f612) /* 0.309560845 */, 14 },
- /* 602 */ { MAD_F(0x04f6c666) /* 0.310247804 */, 14 },
- /* 603 */ { MAD_F(0x04f99721) /* 0.310935143 */, 14 },
- /* 604 */ { MAD_F(0x04fc6841) /* 0.311622862 */, 14 },
- /* 605 */ { MAD_F(0x04ff39c7) /* 0.312310961 */, 14 },
- /* 606 */ { MAD_F(0x05020bb3) /* 0.312999439 */, 14 },
- /* 607 */ { MAD_F(0x0504de05) /* 0.313688296 */, 14 },
-
- /* 608 */ { MAD_F(0x0507b0bc) /* 0.314377532 */, 14 },
- /* 609 */ { MAD_F(0x050a83d8) /* 0.315067145 */, 14 },
- /* 610 */ { MAD_F(0x050d575b) /* 0.315757136 */, 14 },
- /* 611 */ { MAD_F(0x05102b42) /* 0.316447504 */, 14 },
- /* 612 */ { MAD_F(0x0512ff8e) /* 0.317138249 */, 14 },
- /* 613 */ { MAD_F(0x0515d440) /* 0.317829370 */, 14 },
- /* 614 */ { MAD_F(0x0518a956) /* 0.318520867 */, 14 },
- /* 615 */ { MAD_F(0x051b7ed1) /* 0.319212739 */, 14 },
- /* 616 */ { MAD_F(0x051e54b1) /* 0.319904987 */, 14 },
- /* 617 */ { MAD_F(0x05212af5) /* 0.320597609 */, 14 },
- /* 618 */ { MAD_F(0x0524019e) /* 0.321290606 */, 14 },
- /* 619 */ { MAD_F(0x0526d8ab) /* 0.321983976 */, 14 },
- /* 620 */ { MAD_F(0x0529b01d) /* 0.322677720 */, 14 },
- /* 621 */ { MAD_F(0x052c87f2) /* 0.323371837 */, 14 },
- /* 622 */ { MAD_F(0x052f602c) /* 0.324066327 */, 14 },
- /* 623 */ { MAD_F(0x053238ca) /* 0.324761189 */, 14 },
-
- /* 624 */ { MAD_F(0x053511cb) /* 0.325456423 */, 14 },
- /* 625 */ { MAD_F(0x0537eb30) /* 0.326152028 */, 14 },
- /* 626 */ { MAD_F(0x053ac4f9) /* 0.326848005 */, 14 },
- /* 627 */ { MAD_F(0x053d9f25) /* 0.327544352 */, 14 },
- /* 628 */ { MAD_F(0x054079b5) /* 0.328241070 */, 14 },
- /* 629 */ { MAD_F(0x054354a8) /* 0.328938157 */, 14 },
- /* 630 */ { MAD_F(0x05462ffe) /* 0.329635614 */, 14 },
- /* 631 */ { MAD_F(0x05490bb7) /* 0.330333440 */, 14 },
- /* 632 */ { MAD_F(0x054be7d4) /* 0.331031635 */, 14 },
- /* 633 */ { MAD_F(0x054ec453) /* 0.331730198 */, 14 },
- /* 634 */ { MAD_F(0x0551a134) /* 0.332429129 */, 14 },
- /* 635 */ { MAD_F(0x05547e79) /* 0.333128427 */, 14 },
- /* 636 */ { MAD_F(0x05575c20) /* 0.333828093 */, 14 },
- /* 637 */ { MAD_F(0x055a3a2a) /* 0.334528126 */, 14 },
- /* 638 */ { MAD_F(0x055d1896) /* 0.335228525 */, 14 },
- /* 639 */ { MAD_F(0x055ff764) /* 0.335929290 */, 14 },
-
- /* 640 */ { MAD_F(0x0562d694) /* 0.336630420 */, 14 },
- /* 641 */ { MAD_F(0x0565b627) /* 0.337331916 */, 14 },
- /* 642 */ { MAD_F(0x0568961b) /* 0.338033777 */, 14 },
- /* 643 */ { MAD_F(0x056b7671) /* 0.338736002 */, 14 },
- /* 644 */ { MAD_F(0x056e5729) /* 0.339438592 */, 14 },
- /* 645 */ { MAD_F(0x05713843) /* 0.340141545 */, 14 },
- /* 646 */ { MAD_F(0x057419be) /* 0.340844862 */, 14 },
- /* 647 */ { MAD_F(0x0576fb9a) /* 0.341548541 */, 14 },
- /* 648 */ { MAD_F(0x0579ddd8) /* 0.342252584 */, 14 },
- /* 649 */ { MAD_F(0x057cc077) /* 0.342956988 */, 14 },
- /* 650 */ { MAD_F(0x057fa378) /* 0.343661754 */, 14 },
- /* 651 */ { MAD_F(0x058286d9) /* 0.344366882 */, 14 },
- /* 652 */ { MAD_F(0x05856a9b) /* 0.345072371 */, 14 },
- /* 653 */ { MAD_F(0x05884ebe) /* 0.345778221 */, 14 },
- /* 654 */ { MAD_F(0x058b3342) /* 0.346484431 */, 14 },
- /* 655 */ { MAD_F(0x058e1827) /* 0.347191002 */, 14 },
-
- /* 656 */ { MAD_F(0x0590fd6c) /* 0.347897931 */, 14 },
- /* 657 */ { MAD_F(0x0593e311) /* 0.348605221 */, 14 },
- /* 658 */ { MAD_F(0x0596c917) /* 0.349312869 */, 14 },
- /* 659 */ { MAD_F(0x0599af7d) /* 0.350020876 */, 14 },
- /* 660 */ { MAD_F(0x059c9643) /* 0.350729240 */, 14 },
- /* 661 */ { MAD_F(0x059f7d6a) /* 0.351437963 */, 14 },
- /* 662 */ { MAD_F(0x05a264f0) /* 0.352147044 */, 14 },
- /* 663 */ { MAD_F(0x05a54cd6) /* 0.352856481 */, 14 },
- /* 664 */ { MAD_F(0x05a8351c) /* 0.353566275 */, 14 },
- /* 665 */ { MAD_F(0x05ab1dc2) /* 0.354276426 */, 14 },
- /* 666 */ { MAD_F(0x05ae06c7) /* 0.354986932 */, 14 },
- /* 667 */ { MAD_F(0x05b0f02b) /* 0.355697795 */, 14 },
- /* 668 */ { MAD_F(0x05b3d9f0) /* 0.356409012 */, 14 },
- /* 669 */ { MAD_F(0x05b6c413) /* 0.357120585 */, 14 },
- /* 670 */ { MAD_F(0x05b9ae95) /* 0.357832512 */, 14 },
- /* 671 */ { MAD_F(0x05bc9977) /* 0.358544794 */, 14 },
-
- /* 672 */ { MAD_F(0x05bf84b8) /* 0.359257429 */, 14 },
- /* 673 */ { MAD_F(0x05c27057) /* 0.359970419 */, 14 },
- /* 674 */ { MAD_F(0x05c55c56) /* 0.360683761 */, 14 },
- /* 675 */ { MAD_F(0x05c848b3) /* 0.361397456 */, 14 },
- /* 676 */ { MAD_F(0x05cb356e) /* 0.362111504 */, 14 },
- /* 677 */ { MAD_F(0x05ce2289) /* 0.362825904 */, 14 },
- /* 678 */ { MAD_F(0x05d11001) /* 0.363540655 */, 14 },
- /* 679 */ { MAD_F(0x05d3fdd8) /* 0.364255759 */, 14 },
- /* 680 */ { MAD_F(0x05d6ec0e) /* 0.364971213 */, 14 },
- /* 681 */ { MAD_F(0x05d9daa1) /* 0.365687018 */, 14 },
- /* 682 */ { MAD_F(0x05dcc993) /* 0.366403174 */, 14 },
- /* 683 */ { MAD_F(0x05dfb8e2) /* 0.367119680 */, 14 },
- /* 684 */ { MAD_F(0x05e2a890) /* 0.367836535 */, 14 },
- /* 685 */ { MAD_F(0x05e5989b) /* 0.368553740 */, 14 },
- /* 686 */ { MAD_F(0x05e88904) /* 0.369271294 */, 14 },
- /* 687 */ { MAD_F(0x05eb79cb) /* 0.369989197 */, 14 },
-
- /* 688 */ { MAD_F(0x05ee6aef) /* 0.370707448 */, 14 },
- /* 689 */ { MAD_F(0x05f15c70) /* 0.371426047 */, 14 },
- /* 690 */ { MAD_F(0x05f44e4f) /* 0.372144994 */, 14 },
- /* 691 */ { MAD_F(0x05f7408b) /* 0.372864289 */, 14 },
- /* 692 */ { MAD_F(0x05fa3324) /* 0.373583930 */, 14 },
- /* 693 */ { MAD_F(0x05fd261b) /* 0.374303918 */, 14 },
- /* 694 */ { MAD_F(0x0600196e) /* 0.375024253 */, 14 },
- /* 695 */ { MAD_F(0x06030d1e) /* 0.375744934 */, 14 },
- /* 696 */ { MAD_F(0x0606012b) /* 0.376465960 */, 14 },
- /* 697 */ { MAD_F(0x0608f595) /* 0.377187332 */, 14 },
- /* 698 */ { MAD_F(0x060bea5c) /* 0.377909049 */, 14 },
- /* 699 */ { MAD_F(0x060edf7f) /* 0.378631110 */, 14 },
- /* 700 */ { MAD_F(0x0611d4fe) /* 0.379353516 */, 14 },
- /* 701 */ { MAD_F(0x0614cada) /* 0.380076266 */, 14 },
- /* 702 */ { MAD_F(0x0617c112) /* 0.380799360 */, 14 },
- /* 703 */ { MAD_F(0x061ab7a6) /* 0.381522798 */, 14 },
-
- /* 704 */ { MAD_F(0x061dae96) /* 0.382246578 */, 14 },
- /* 705 */ { MAD_F(0x0620a5e3) /* 0.382970701 */, 14 },
- /* 706 */ { MAD_F(0x06239d8b) /* 0.383695167 */, 14 },
- /* 707 */ { MAD_F(0x0626958f) /* 0.384419975 */, 14 },
- /* 708 */ { MAD_F(0x06298def) /* 0.385145124 */, 14 },
- /* 709 */ { MAD_F(0x062c86aa) /* 0.385870615 */, 14 },
- /* 710 */ { MAD_F(0x062f7fc1) /* 0.386596448 */, 14 },
- /* 711 */ { MAD_F(0x06327934) /* 0.387322621 */, 14 },
- /* 712 */ { MAD_F(0x06357302) /* 0.388049134 */, 14 },
- /* 713 */ { MAD_F(0x06386d2b) /* 0.388775988 */, 14 },
- /* 714 */ { MAD_F(0x063b67b0) /* 0.389503182 */, 14 },
- /* 715 */ { MAD_F(0x063e6290) /* 0.390230715 */, 14 },
- /* 716 */ { MAD_F(0x06415dcb) /* 0.390958588 */, 14 },
- /* 717 */ { MAD_F(0x06445960) /* 0.391686799 */, 14 },
- /* 718 */ { MAD_F(0x06475551) /* 0.392415349 */, 14 },
- /* 719 */ { MAD_F(0x064a519c) /* 0.393144238 */, 14 },
-
- /* 720 */ { MAD_F(0x064d4e43) /* 0.393873464 */, 14 },
- /* 721 */ { MAD_F(0x06504b44) /* 0.394603028 */, 14 },
- /* 722 */ { MAD_F(0x0653489f) /* 0.395332930 */, 14 },
- /* 723 */ { MAD_F(0x06564655) /* 0.396063168 */, 14 },
- /* 724 */ { MAD_F(0x06594465) /* 0.396793743 */, 14 },
- /* 725 */ { MAD_F(0x065c42d0) /* 0.397524655 */, 14 },
- /* 726 */ { MAD_F(0x065f4195) /* 0.398255903 */, 14 },
- /* 727 */ { MAD_F(0x066240b4) /* 0.398987487 */, 14 },
- /* 728 */ { MAD_F(0x0665402d) /* 0.399719406 */, 14 },
- /* 729 */ { MAD_F(0x06684000) /* 0.400451660 */, 14 },
- /* 730 */ { MAD_F(0x066b402d) /* 0.401184249 */, 14 },
- /* 731 */ { MAD_F(0x066e40b3) /* 0.401917173 */, 14 },
- /* 732 */ { MAD_F(0x06714194) /* 0.402650431 */, 14 },
- /* 733 */ { MAD_F(0x067442ce) /* 0.403384024 */, 14 },
- /* 734 */ { MAD_F(0x06774462) /* 0.404117949 */, 14 },
- /* 735 */ { MAD_F(0x067a464f) /* 0.404852209 */, 14 },
-
- /* 736 */ { MAD_F(0x067d4896) /* 0.405586801 */, 14 },
- /* 737 */ { MAD_F(0x06804b36) /* 0.406321726 */, 14 },
- /* 738 */ { MAD_F(0x06834e2f) /* 0.407056983 */, 14 },
- /* 739 */ { MAD_F(0x06865181) /* 0.407792573 */, 14 },
- /* 740 */ { MAD_F(0x0689552c) /* 0.408528495 */, 14 },
- /* 741 */ { MAD_F(0x068c5931) /* 0.409264748 */, 14 },
- /* 742 */ { MAD_F(0x068f5d8e) /* 0.410001332 */, 14 },
- /* 743 */ { MAD_F(0x06926245) /* 0.410738247 */, 14 },
- /* 744 */ { MAD_F(0x06956753) /* 0.411475493 */, 14 },
- /* 745 */ { MAD_F(0x06986cbb) /* 0.412213070 */, 14 },
- /* 746 */ { MAD_F(0x069b727b) /* 0.412950976 */, 14 },
- /* 747 */ { MAD_F(0x069e7894) /* 0.413689213 */, 14 },
- /* 748 */ { MAD_F(0x06a17f05) /* 0.414427779 */, 14 },
- /* 749 */ { MAD_F(0x06a485cf) /* 0.415166674 */, 14 },
- /* 750 */ { MAD_F(0x06a78cf1) /* 0.415905897 */, 14 },
- /* 751 */ { MAD_F(0x06aa946b) /* 0.416645450 */, 14 },
-
- /* 752 */ { MAD_F(0x06ad9c3d) /* 0.417385331 */, 14 },
- /* 753 */ { MAD_F(0x06b0a468) /* 0.418125540 */, 14 },
- /* 754 */ { MAD_F(0x06b3acea) /* 0.418866076 */, 14 },
- /* 755 */ { MAD_F(0x06b6b5c4) /* 0.419606940 */, 14 },
- /* 756 */ { MAD_F(0x06b9bef6) /* 0.420348132 */, 14 },
- /* 757 */ { MAD_F(0x06bcc880) /* 0.421089650 */, 14 },
- /* 758 */ { MAD_F(0x06bfd261) /* 0.421831494 */, 14 },
- /* 759 */ { MAD_F(0x06c2dc9a) /* 0.422573665 */, 14 },
- /* 760 */ { MAD_F(0x06c5e72b) /* 0.423316162 */, 14 },
- /* 761 */ { MAD_F(0x06c8f213) /* 0.424058985 */, 14 },
- /* 762 */ { MAD_F(0x06cbfd52) /* 0.424802133 */, 14 },
- /* 763 */ { MAD_F(0x06cf08e9) /* 0.425545607 */, 14 },
- /* 764 */ { MAD_F(0x06d214d7) /* 0.426289405 */, 14 },
- /* 765 */ { MAD_F(0x06d5211c) /* 0.427033528 */, 14 },
- /* 766 */ { MAD_F(0x06d82db8) /* 0.427777975 */, 14 },
- /* 767 */ { MAD_F(0x06db3aaa) /* 0.428522746 */, 14 },
-
- /* 768 */ { MAD_F(0x06de47f4) /* 0.429267841 */, 14 },
- /* 769 */ { MAD_F(0x06e15595) /* 0.430013259 */, 14 },
- /* 770 */ { MAD_F(0x06e4638d) /* 0.430759001 */, 14 },
- /* 771 */ { MAD_F(0x06e771db) /* 0.431505065 */, 14 },
- /* 772 */ { MAD_F(0x06ea807f) /* 0.432251452 */, 14 },
- /* 773 */ { MAD_F(0x06ed8f7b) /* 0.432998162 */, 14 },
- /* 774 */ { MAD_F(0x06f09ecc) /* 0.433745193 */, 14 },
- /* 775 */ { MAD_F(0x06f3ae75) /* 0.434492546 */, 14 },
- /* 776 */ { MAD_F(0x06f6be73) /* 0.435240221 */, 14 },
- /* 777 */ { MAD_F(0x06f9cec8) /* 0.435988217 */, 14 },
- /* 778 */ { MAD_F(0x06fcdf72) /* 0.436736534 */, 14 },
- /* 779 */ { MAD_F(0x06fff073) /* 0.437485172 */, 14 },
- /* 780 */ { MAD_F(0x070301ca) /* 0.438234130 */, 14 },
- /* 781 */ { MAD_F(0x07061377) /* 0.438983408 */, 14 },
- /* 782 */ { MAD_F(0x0709257a) /* 0.439733006 */, 14 },
- /* 783 */ { MAD_F(0x070c37d2) /* 0.440482924 */, 14 },
-
- /* 784 */ { MAD_F(0x070f4a80) /* 0.441233161 */, 14 },
- /* 785 */ { MAD_F(0x07125d84) /* 0.441983717 */, 14 },
- /* 786 */ { MAD_F(0x071570de) /* 0.442734592 */, 14 },
- /* 787 */ { MAD_F(0x0718848d) /* 0.443485785 */, 14 },
- /* 788 */ { MAD_F(0x071b9891) /* 0.444237296 */, 14 },
- /* 789 */ { MAD_F(0x071eaceb) /* 0.444989126 */, 14 },
- /* 790 */ { MAD_F(0x0721c19a) /* 0.445741273 */, 14 },
- /* 791 */ { MAD_F(0x0724d69e) /* 0.446493738 */, 14 },
- /* 792 */ { MAD_F(0x0727ebf7) /* 0.447246519 */, 14 },
- /* 793 */ { MAD_F(0x072b01a6) /* 0.447999618 */, 14 },
- /* 794 */ { MAD_F(0x072e17a9) /* 0.448753033 */, 14 },
- /* 795 */ { MAD_F(0x07312e01) /* 0.449506765 */, 14 },
- /* 796 */ { MAD_F(0x073444ae) /* 0.450260813 */, 14 },
- /* 797 */ { MAD_F(0x07375bb0) /* 0.451015176 */, 14 },
- /* 798 */ { MAD_F(0x073a7307) /* 0.451769856 */, 14 },
- /* 799 */ { MAD_F(0x073d8ab2) /* 0.452524850 */, 14 },
-
- /* 800 */ { MAD_F(0x0740a2b2) /* 0.453280160 */, 14 },
- /* 801 */ { MAD_F(0x0743bb06) /* 0.454035784 */, 14 },
- /* 802 */ { MAD_F(0x0746d3af) /* 0.454791723 */, 14 },
- /* 803 */ { MAD_F(0x0749ecac) /* 0.455547976 */, 14 },
- /* 804 */ { MAD_F(0x074d05fe) /* 0.456304543 */, 14 },
- /* 805 */ { MAD_F(0x07501fa3) /* 0.457061423 */, 14 },
- /* 806 */ { MAD_F(0x0753399d) /* 0.457818618 */, 14 },
- /* 807 */ { MAD_F(0x075653eb) /* 0.458576125 */, 14 },
- /* 808 */ { MAD_F(0x07596e8d) /* 0.459333946 */, 14 },
- /* 809 */ { MAD_F(0x075c8983) /* 0.460092079 */, 14 },
- /* 810 */ { MAD_F(0x075fa4cc) /* 0.460850524 */, 14 },
- /* 811 */ { MAD_F(0x0762c06a) /* 0.461609282 */, 14 },
- /* 812 */ { MAD_F(0x0765dc5b) /* 0.462368352 */, 14 },
- /* 813 */ { MAD_F(0x0768f8a0) /* 0.463127733 */, 14 },
- /* 814 */ { MAD_F(0x076c1538) /* 0.463887426 */, 14 },
- /* 815 */ { MAD_F(0x076f3224) /* 0.464647430 */, 14 },
-
- /* 816 */ { MAD_F(0x07724f64) /* 0.465407744 */, 14 },
- /* 817 */ { MAD_F(0x07756cf7) /* 0.466168370 */, 14 },
- /* 818 */ { MAD_F(0x07788add) /* 0.466929306 */, 14 },
- /* 819 */ { MAD_F(0x077ba916) /* 0.467690552 */, 14 },
- /* 820 */ { MAD_F(0x077ec7a3) /* 0.468452108 */, 14 },
- /* 821 */ { MAD_F(0x0781e683) /* 0.469213973 */, 14 },
- /* 822 */ { MAD_F(0x078505b5) /* 0.469976148 */, 14 },
- /* 823 */ { MAD_F(0x0788253b) /* 0.470738632 */, 14 },
- /* 824 */ { MAD_F(0x078b4514) /* 0.471501425 */, 14 },
- /* 825 */ { MAD_F(0x078e653f) /* 0.472264527 */, 14 },
- /* 826 */ { MAD_F(0x079185be) /* 0.473027937 */, 14 },
- /* 827 */ { MAD_F(0x0794a68f) /* 0.473791655 */, 14 },
- /* 828 */ { MAD_F(0x0797c7b2) /* 0.474555681 */, 14 },
- /* 829 */ { MAD_F(0x079ae929) /* 0.475320014 */, 14 },
- /* 830 */ { MAD_F(0x079e0af1) /* 0.476084655 */, 14 },
- /* 831 */ { MAD_F(0x07a12d0c) /* 0.476849603 */, 14 },
-
- /* 832 */ { MAD_F(0x07a44f7a) /* 0.477614858 */, 14 },
- /* 833 */ { MAD_F(0x07a7723a) /* 0.478380420 */, 14 },
- /* 834 */ { MAD_F(0x07aa954c) /* 0.479146288 */, 14 },
- /* 835 */ { MAD_F(0x07adb8b0) /* 0.479912463 */, 14 },
- /* 836 */ { MAD_F(0x07b0dc67) /* 0.480678943 */, 14 },
- /* 837 */ { MAD_F(0x07b4006f) /* 0.481445729 */, 14 },
- /* 838 */ { MAD_F(0x07b724ca) /* 0.482212820 */, 14 },
- /* 839 */ { MAD_F(0x07ba4976) /* 0.482980216 */, 14 },
- /* 840 */ { MAD_F(0x07bd6e75) /* 0.483747918 */, 14 },
- /* 841 */ { MAD_F(0x07c093c5) /* 0.484515924 */, 14 },
- /* 842 */ { MAD_F(0x07c3b967) /* 0.485284235 */, 14 },
- /* 843 */ { MAD_F(0x07c6df5a) /* 0.486052849 */, 14 },
- /* 844 */ { MAD_F(0x07ca059f) /* 0.486821768 */, 14 },
- /* 845 */ { MAD_F(0x07cd2c36) /* 0.487590991 */, 14 },
- /* 846 */ { MAD_F(0x07d0531e) /* 0.488360517 */, 14 },
- /* 847 */ { MAD_F(0x07d37a57) /* 0.489130346 */, 14 },
-
- /* 848 */ { MAD_F(0x07d6a1e2) /* 0.489900479 */, 14 },
- /* 849 */ { MAD_F(0x07d9c9be) /* 0.490670914 */, 14 },
- /* 850 */ { MAD_F(0x07dcf1ec) /* 0.491441651 */, 14 },
- /* 851 */ { MAD_F(0x07e01a6a) /* 0.492212691 */, 14 },
- /* 852 */ { MAD_F(0x07e3433a) /* 0.492984033 */, 14 },
- /* 853 */ { MAD_F(0x07e66c5a) /* 0.493755677 */, 14 },
- /* 854 */ { MAD_F(0x07e995cc) /* 0.494527623 */, 14 },
- /* 855 */ { MAD_F(0x07ecbf8e) /* 0.495299870 */, 14 },
- /* 856 */ { MAD_F(0x07efe9a1) /* 0.496072418 */, 14 },
- /* 857 */ { MAD_F(0x07f31405) /* 0.496845266 */, 14 },
- /* 858 */ { MAD_F(0x07f63eba) /* 0.497618416 */, 14 },
- /* 859 */ { MAD_F(0x07f969c0) /* 0.498391866 */, 14 },
- /* 860 */ { MAD_F(0x07fc9516) /* 0.499165616 */, 14 },
- /* 861 */ { MAD_F(0x07ffc0bc) /* 0.499939666 */, 14 },
- /* 862 */ { MAD_F(0x04017659) /* 0.250357008 */, 15 },
- /* 863 */ { MAD_F(0x04030c7d) /* 0.250744333 */, 15 },
-
- /* 864 */ { MAD_F(0x0404a2c9) /* 0.251131807 */, 15 },
- /* 865 */ { MAD_F(0x0406393d) /* 0.251519431 */, 15 },
- /* 866 */ { MAD_F(0x0407cfd9) /* 0.251907204 */, 15 },
- /* 867 */ { MAD_F(0x0409669d) /* 0.252295127 */, 15 },
- /* 868 */ { MAD_F(0x040afd89) /* 0.252683198 */, 15 },
- /* 869 */ { MAD_F(0x040c949e) /* 0.253071419 */, 15 },
- /* 870 */ { MAD_F(0x040e2bda) /* 0.253459789 */, 15 },
- /* 871 */ { MAD_F(0x040fc33e) /* 0.253848307 */, 15 },
- /* 872 */ { MAD_F(0x04115aca) /* 0.254236974 */, 15 },
- /* 873 */ { MAD_F(0x0412f27e) /* 0.254625790 */, 15 },
- /* 874 */ { MAD_F(0x04148a5a) /* 0.255014755 */, 15 },
- /* 875 */ { MAD_F(0x0416225d) /* 0.255403867 */, 15 },
- /* 876 */ { MAD_F(0x0417ba89) /* 0.255793128 */, 15 },
- /* 877 */ { MAD_F(0x041952dc) /* 0.256182537 */, 15 },
- /* 878 */ { MAD_F(0x041aeb57) /* 0.256572095 */, 15 },
- /* 879 */ { MAD_F(0x041c83fa) /* 0.256961800 */, 15 },
-
- /* 880 */ { MAD_F(0x041e1cc4) /* 0.257351652 */, 15 },
- /* 881 */ { MAD_F(0x041fb5b6) /* 0.257741653 */, 15 },
- /* 882 */ { MAD_F(0x04214ed0) /* 0.258131801 */, 15 },
- /* 883 */ { MAD_F(0x0422e811) /* 0.258522097 */, 15 },
- /* 884 */ { MAD_F(0x04248179) /* 0.258912540 */, 15 },
- /* 885 */ { MAD_F(0x04261b0a) /* 0.259303130 */, 15 },
- /* 886 */ { MAD_F(0x0427b4c2) /* 0.259693868 */, 15 },
- /* 887 */ { MAD_F(0x04294ea1) /* 0.260084752 */, 15 },
- /* 888 */ { MAD_F(0x042ae8a7) /* 0.260475783 */, 15 },
- /* 889 */ { MAD_F(0x042c82d6) /* 0.260866961 */, 15 },
- /* 890 */ { MAD_F(0x042e1d2b) /* 0.261258286 */, 15 },
- /* 891 */ { MAD_F(0x042fb7a8) /* 0.261649758 */, 15 },
- /* 892 */ { MAD_F(0x0431524c) /* 0.262041376 */, 15 },
- /* 893 */ { MAD_F(0x0432ed17) /* 0.262433140 */, 15 },
- /* 894 */ { MAD_F(0x0434880a) /* 0.262825051 */, 15 },
- /* 895 */ { MAD_F(0x04362324) /* 0.263217107 */, 15 },
-
- /* 896 */ { MAD_F(0x0437be65) /* 0.263609310 */, 15 },
- /* 897 */ { MAD_F(0x043959cd) /* 0.264001659 */, 15 },
- /* 898 */ { MAD_F(0x043af55d) /* 0.264394153 */, 15 },
- /* 899 */ { MAD_F(0x043c9113) /* 0.264786794 */, 15 },
- /* 900 */ { MAD_F(0x043e2cf1) /* 0.265179580 */, 15 },
- /* 901 */ { MAD_F(0x043fc8f6) /* 0.265572511 */, 15 },
- /* 902 */ { MAD_F(0x04416522) /* 0.265965588 */, 15 },
- /* 903 */ { MAD_F(0x04430174) /* 0.266358810 */, 15 },
- /* 904 */ { MAD_F(0x04449dee) /* 0.266752177 */, 15 },
- /* 905 */ { MAD_F(0x04463a8f) /* 0.267145689 */, 15 },
- /* 906 */ { MAD_F(0x0447d756) /* 0.267539347 */, 15 },
- /* 907 */ { MAD_F(0x04497445) /* 0.267933149 */, 15 },
- /* 908 */ { MAD_F(0x044b115a) /* 0.268327096 */, 15 },
- /* 909 */ { MAD_F(0x044cae96) /* 0.268721187 */, 15 },
- /* 910 */ { MAD_F(0x044e4bf9) /* 0.269115423 */, 15 },
- /* 911 */ { MAD_F(0x044fe983) /* 0.269509804 */, 15 },
-
- /* 912 */ { MAD_F(0x04518733) /* 0.269904329 */, 15 },
- /* 913 */ { MAD_F(0x0453250a) /* 0.270298998 */, 15 },
- /* 914 */ { MAD_F(0x0454c308) /* 0.270693811 */, 15 },
- /* 915 */ { MAD_F(0x0456612d) /* 0.271088768 */, 15 },
- /* 916 */ { MAD_F(0x0457ff78) /* 0.271483869 */, 15 },
- /* 917 */ { MAD_F(0x04599dea) /* 0.271879114 */, 15 },
- /* 918 */ { MAD_F(0x045b3c82) /* 0.272274503 */, 15 },
- /* 919 */ { MAD_F(0x045cdb41) /* 0.272670035 */, 15 },
- /* 920 */ { MAD_F(0x045e7a26) /* 0.273065710 */, 15 },
- /* 921 */ { MAD_F(0x04601932) /* 0.273461530 */, 15 },
- /* 922 */ { MAD_F(0x0461b864) /* 0.273857492 */, 15 },
- /* 923 */ { MAD_F(0x046357bd) /* 0.274253597 */, 15 },
- /* 924 */ { MAD_F(0x0464f73c) /* 0.274649846 */, 15 },
- /* 925 */ { MAD_F(0x046696e2) /* 0.275046238 */, 15 },
- /* 926 */ { MAD_F(0x046836ae) /* 0.275442772 */, 15 },
- /* 927 */ { MAD_F(0x0469d6a0) /* 0.275839449 */, 15 },
-
- /* 928 */ { MAD_F(0x046b76b9) /* 0.276236269 */, 15 },
- /* 929 */ { MAD_F(0x046d16f7) /* 0.276633232 */, 15 },
- /* 930 */ { MAD_F(0x046eb75c) /* 0.277030337 */, 15 },
- /* 931 */ { MAD_F(0x047057e8) /* 0.277427584 */, 15 },
- /* 932 */ { MAD_F(0x0471f899) /* 0.277824973 */, 15 },
- /* 933 */ { MAD_F(0x04739971) /* 0.278222505 */, 15 },
- /* 934 */ { MAD_F(0x04753a6f) /* 0.278620179 */, 15 },
- /* 935 */ { MAD_F(0x0476db92) /* 0.279017995 */, 15 },
- /* 936 */ { MAD_F(0x04787cdc) /* 0.279415952 */, 15 },
- /* 937 */ { MAD_F(0x047a1e4c) /* 0.279814051 */, 15 },
- /* 938 */ { MAD_F(0x047bbfe2) /* 0.280212292 */, 15 },
- /* 939 */ { MAD_F(0x047d619e) /* 0.280610675 */, 15 },
- /* 940 */ { MAD_F(0x047f0380) /* 0.281009199 */, 15 },
- /* 941 */ { MAD_F(0x0480a588) /* 0.281407864 */, 15 },
- /* 942 */ { MAD_F(0x048247b6) /* 0.281806670 */, 15 },
- /* 943 */ { MAD_F(0x0483ea0a) /* 0.282205618 */, 15 },
-
- /* 944 */ { MAD_F(0x04858c83) /* 0.282604707 */, 15 },
- /* 945 */ { MAD_F(0x04872f22) /* 0.283003936 */, 15 },
- /* 946 */ { MAD_F(0x0488d1e8) /* 0.283403307 */, 15 },
- /* 947 */ { MAD_F(0x048a74d3) /* 0.283802818 */, 15 },
- /* 948 */ { MAD_F(0x048c17e3) /* 0.284202470 */, 15 },
- /* 949 */ { MAD_F(0x048dbb1a) /* 0.284602263 */, 15 },
- /* 950 */ { MAD_F(0x048f5e76) /* 0.285002195 */, 15 },
- /* 951 */ { MAD_F(0x049101f8) /* 0.285402269 */, 15 },
- /* 952 */ { MAD_F(0x0492a59f) /* 0.285802482 */, 15 },
- /* 953 */ { MAD_F(0x0494496c) /* 0.286202836 */, 15 },
- /* 954 */ { MAD_F(0x0495ed5f) /* 0.286603329 */, 15 },
- /* 955 */ { MAD_F(0x04979177) /* 0.287003963 */, 15 },
- /* 956 */ { MAD_F(0x049935b5) /* 0.287404737 */, 15 },
- /* 957 */ { MAD_F(0x049ada19) /* 0.287805650 */, 15 },
- /* 958 */ { MAD_F(0x049c7ea1) /* 0.288206703 */, 15 },
- /* 959 */ { MAD_F(0x049e2350) /* 0.288607895 */, 15 },
-
- /* 960 */ { MAD_F(0x049fc824) /* 0.289009227 */, 15 },
- /* 961 */ { MAD_F(0x04a16d1d) /* 0.289410699 */, 15 },
- /* 962 */ { MAD_F(0x04a3123b) /* 0.289812309 */, 15 },
- /* 963 */ { MAD_F(0x04a4b77f) /* 0.290214059 */, 15 },
- /* 964 */ { MAD_F(0x04a65ce8) /* 0.290615948 */, 15 },
- /* 965 */ { MAD_F(0x04a80277) /* 0.291017976 */, 15 },
- /* 966 */ { MAD_F(0x04a9a82b) /* 0.291420143 */, 15 },
- /* 967 */ { MAD_F(0x04ab4e04) /* 0.291822449 */, 15 },
- /* 968 */ { MAD_F(0x04acf402) /* 0.292224893 */, 15 },
- /* 969 */ { MAD_F(0x04ae9a26) /* 0.292627476 */, 15 },
- /* 970 */ { MAD_F(0x04b0406e) /* 0.293030197 */, 15 },
- /* 971 */ { MAD_F(0x04b1e6dc) /* 0.293433057 */, 15 },
- /* 972 */ { MAD_F(0x04b38d6f) /* 0.293836055 */, 15 },
- /* 973 */ { MAD_F(0x04b53427) /* 0.294239192 */, 15 },
- /* 974 */ { MAD_F(0x04b6db05) /* 0.294642466 */, 15 },
- /* 975 */ { MAD_F(0x04b88207) /* 0.295045879 */, 15 },
-
- /* 976 */ { MAD_F(0x04ba292e) /* 0.295449429 */, 15 },
- /* 977 */ { MAD_F(0x04bbd07a) /* 0.295853118 */, 15 },
- /* 978 */ { MAD_F(0x04bd77ec) /* 0.296256944 */, 15 },
- /* 979 */ { MAD_F(0x04bf1f82) /* 0.296660907 */, 15 },
- /* 980 */ { MAD_F(0x04c0c73d) /* 0.297065009 */, 15 },
- /* 981 */ { MAD_F(0x04c26f1d) /* 0.297469248 */, 15 },
- /* 982 */ { MAD_F(0x04c41722) /* 0.297873624 */, 15 },
- /* 983 */ { MAD_F(0x04c5bf4c) /* 0.298278137 */, 15 },
- /* 984 */ { MAD_F(0x04c7679a) /* 0.298682788 */, 15 },
- /* 985 */ { MAD_F(0x04c9100d) /* 0.299087576 */, 15 },
- /* 986 */ { MAD_F(0x04cab8a6) /* 0.299492500 */, 15 },
- /* 987 */ { MAD_F(0x04cc6163) /* 0.299897562 */, 15 },
- /* 988 */ { MAD_F(0x04ce0a44) /* 0.300302761 */, 15 },
- /* 989 */ { MAD_F(0x04cfb34b) /* 0.300708096 */, 15 },
- /* 990 */ { MAD_F(0x04d15c76) /* 0.301113568 */, 15 },
- /* 991 */ { MAD_F(0x04d305c5) /* 0.301519176 */, 15 },
-
- /* 992 */ { MAD_F(0x04d4af3a) /* 0.301924921 */, 15 },
- /* 993 */ { MAD_F(0x04d658d2) /* 0.302330802 */, 15 },
- /* 994 */ { MAD_F(0x04d80290) /* 0.302736820 */, 15 },
- /* 995 */ { MAD_F(0x04d9ac72) /* 0.303142973 */, 15 },
- /* 996 */ { MAD_F(0x04db5679) /* 0.303549263 */, 15 },
- /* 997 */ { MAD_F(0x04dd00a4) /* 0.303955689 */, 15 },
- /* 998 */ { MAD_F(0x04deaaf3) /* 0.304362251 */, 15 },
- /* 999 */ { MAD_F(0x04e05567) /* 0.304768948 */, 15 },
- /* 1000 */ { MAD_F(0x04e20000) /* 0.305175781 */, 15 },
- /* 1001 */ { MAD_F(0x04e3aabd) /* 0.305582750 */, 15 },
- /* 1002 */ { MAD_F(0x04e5559e) /* 0.305989854 */, 15 },
- /* 1003 */ { MAD_F(0x04e700a3) /* 0.306397094 */, 15 },
- /* 1004 */ { MAD_F(0x04e8abcd) /* 0.306804470 */, 15 },
- /* 1005 */ { MAD_F(0x04ea571c) /* 0.307211980 */, 15 },
- /* 1006 */ { MAD_F(0x04ec028e) /* 0.307619626 */, 15 },
- /* 1007 */ { MAD_F(0x04edae25) /* 0.308027406 */, 15 },
-
- /* 1008 */ { MAD_F(0x04ef59e0) /* 0.308435322 */, 15 },
- /* 1009 */ { MAD_F(0x04f105bf) /* 0.308843373 */, 15 },
- /* 1010 */ { MAD_F(0x04f2b1c3) /* 0.309251558 */, 15 },
- /* 1011 */ { MAD_F(0x04f45dea) /* 0.309659879 */, 15 },
- /* 1012 */ { MAD_F(0x04f60a36) /* 0.310068333 */, 15 },
- /* 1013 */ { MAD_F(0x04f7b6a6) /* 0.310476923 */, 15 },
- /* 1014 */ { MAD_F(0x04f9633a) /* 0.310885647 */, 15 },
- /* 1015 */ { MAD_F(0x04fb0ff2) /* 0.311294505 */, 15 },
- /* 1016 */ { MAD_F(0x04fcbcce) /* 0.311703498 */, 15 },
- /* 1017 */ { MAD_F(0x04fe69ce) /* 0.312112625 */, 15 },
- /* 1018 */ { MAD_F(0x050016f3) /* 0.312521885 */, 15 },
- /* 1019 */ { MAD_F(0x0501c43b) /* 0.312931280 */, 15 },
- /* 1020 */ { MAD_F(0x050371a7) /* 0.313340809 */, 15 },
- /* 1021 */ { MAD_F(0x05051f37) /* 0.313750472 */, 15 },
- /* 1022 */ { MAD_F(0x0506cceb) /* 0.314160269 */, 15 },
- /* 1023 */ { MAD_F(0x05087ac2) /* 0.314570199 */, 15 },
-
- /* 1024 */ { MAD_F(0x050a28be) /* 0.314980262 */, 15 },
- /* 1025 */ { MAD_F(0x050bd6de) /* 0.315390460 */, 15 },
- /* 1026 */ { MAD_F(0x050d8521) /* 0.315800790 */, 15 },
- /* 1027 */ { MAD_F(0x050f3388) /* 0.316211255 */, 15 },
- /* 1028 */ { MAD_F(0x0510e213) /* 0.316621852 */, 15 },
- /* 1029 */ { MAD_F(0x051290c2) /* 0.317032582 */, 15 },
- /* 1030 */ { MAD_F(0x05143f94) /* 0.317443446 */, 15 },
- /* 1031 */ { MAD_F(0x0515ee8a) /* 0.317854442 */, 15 },
- /* 1032 */ { MAD_F(0x05179da4) /* 0.318265572 */, 15 },
- /* 1033 */ { MAD_F(0x05194ce1) /* 0.318676834 */, 15 },
- /* 1034 */ { MAD_F(0x051afc42) /* 0.319088229 */, 15 },
- /* 1035 */ { MAD_F(0x051cabc7) /* 0.319499756 */, 15 },
- /* 1036 */ { MAD_F(0x051e5b6f) /* 0.319911417 */, 15 },
- /* 1037 */ { MAD_F(0x05200b3a) /* 0.320323209 */, 15 },
- /* 1038 */ { MAD_F(0x0521bb2a) /* 0.320735134 */, 15 },
- /* 1039 */ { MAD_F(0x05236b3d) /* 0.321147192 */, 15 },
-
- /* 1040 */ { MAD_F(0x05251b73) /* 0.321559381 */, 15 },
- /* 1041 */ { MAD_F(0x0526cbcd) /* 0.321971703 */, 15 },
- /* 1042 */ { MAD_F(0x05287c4a) /* 0.322384156 */, 15 },
- /* 1043 */ { MAD_F(0x052a2cea) /* 0.322796742 */, 15 },
- /* 1044 */ { MAD_F(0x052bddae) /* 0.323209460 */, 15 },
- /* 1045 */ { MAD_F(0x052d8e96) /* 0.323622309 */, 15 },
- /* 1046 */ { MAD_F(0x052f3fa1) /* 0.324035290 */, 15 },
- /* 1047 */ { MAD_F(0x0530f0cf) /* 0.324448403 */, 15 },
- /* 1048 */ { MAD_F(0x0532a220) /* 0.324861647 */, 15 },
- /* 1049 */ { MAD_F(0x05345395) /* 0.325275023 */, 15 },
- /* 1050 */ { MAD_F(0x0536052d) /* 0.325688530 */, 15 },
- /* 1051 */ { MAD_F(0x0537b6e8) /* 0.326102168 */, 15 },
- /* 1052 */ { MAD_F(0x053968c6) /* 0.326515938 */, 15 },
- /* 1053 */ { MAD_F(0x053b1ac8) /* 0.326929839 */, 15 },
- /* 1054 */ { MAD_F(0x053ccced) /* 0.327343870 */, 15 },
- /* 1055 */ { MAD_F(0x053e7f35) /* 0.327758033 */, 15 },
-
- /* 1056 */ { MAD_F(0x054031a0) /* 0.328172327 */, 15 },
- /* 1057 */ { MAD_F(0x0541e42e) /* 0.328586751 */, 15 },
- /* 1058 */ { MAD_F(0x054396df) /* 0.329001306 */, 15 },
- /* 1059 */ { MAD_F(0x054549b4) /* 0.329415992 */, 15 },
- /* 1060 */ { MAD_F(0x0546fcab) /* 0.329830808 */, 15 },
- /* 1061 */ { MAD_F(0x0548afc6) /* 0.330245755 */, 15 },
- /* 1062 */ { MAD_F(0x054a6303) /* 0.330660832 */, 15 },
- /* 1063 */ { MAD_F(0x054c1663) /* 0.331076039 */, 15 },
- /* 1064 */ { MAD_F(0x054dc9e7) /* 0.331491377 */, 15 },
- /* 1065 */ { MAD_F(0x054f7d8d) /* 0.331906845 */, 15 },
- /* 1066 */ { MAD_F(0x05513156) /* 0.332322443 */, 15 },
- /* 1067 */ { MAD_F(0x0552e542) /* 0.332738170 */, 15 },
- /* 1068 */ { MAD_F(0x05549951) /* 0.333154028 */, 15 },
- /* 1069 */ { MAD_F(0x05564d83) /* 0.333570016 */, 15 },
- /* 1070 */ { MAD_F(0x055801d8) /* 0.333986133 */, 15 },
- /* 1071 */ { MAD_F(0x0559b64f) /* 0.334402380 */, 15 },
-
- /* 1072 */ { MAD_F(0x055b6ae9) /* 0.334818756 */, 15 },
- /* 1073 */ { MAD_F(0x055d1fa6) /* 0.335235262 */, 15 },
- /* 1074 */ { MAD_F(0x055ed486) /* 0.335651898 */, 15 },
- /* 1075 */ { MAD_F(0x05608988) /* 0.336068662 */, 15 },
- /* 1076 */ { MAD_F(0x05623ead) /* 0.336485556 */, 15 },
- /* 1077 */ { MAD_F(0x0563f3f5) /* 0.336902579 */, 15 },
- /* 1078 */ { MAD_F(0x0565a960) /* 0.337319732 */, 15 },
- /* 1079 */ { MAD_F(0x05675eed) /* 0.337737013 */, 15 },
- /* 1080 */ { MAD_F(0x0569149c) /* 0.338154423 */, 15 },
- /* 1081 */ { MAD_F(0x056aca6f) /* 0.338571962 */, 15 },
- /* 1082 */ { MAD_F(0x056c8064) /* 0.338989630 */, 15 },
- /* 1083 */ { MAD_F(0x056e367b) /* 0.339407426 */, 15 },
- /* 1084 */ { MAD_F(0x056fecb5) /* 0.339825351 */, 15 },
- /* 1085 */ { MAD_F(0x0571a311) /* 0.340243405 */, 15 },
- /* 1086 */ { MAD_F(0x05735990) /* 0.340661587 */, 15 },
- /* 1087 */ { MAD_F(0x05751032) /* 0.341079898 */, 15 },
-
- /* 1088 */ { MAD_F(0x0576c6f5) /* 0.341498336 */, 15 },
- /* 1089 */ { MAD_F(0x05787ddc) /* 0.341916903 */, 15 },
- /* 1090 */ { MAD_F(0x057a34e4) /* 0.342335598 */, 15 },
- /* 1091 */ { MAD_F(0x057bec0f) /* 0.342754421 */, 15 },
- /* 1092 */ { MAD_F(0x057da35d) /* 0.343173373 */, 15 },
- /* 1093 */ { MAD_F(0x057f5acc) /* 0.343592452 */, 15 },
- /* 1094 */ { MAD_F(0x0581125e) /* 0.344011659 */, 15 },
- /* 1095 */ { MAD_F(0x0582ca12) /* 0.344430993 */, 15 },
- /* 1096 */ { MAD_F(0x058481e9) /* 0.344850455 */, 15 },
- /* 1097 */ { MAD_F(0x058639e2) /* 0.345270045 */, 15 },
- /* 1098 */ { MAD_F(0x0587f1fd) /* 0.345689763 */, 15 },
- /* 1099 */ { MAD_F(0x0589aa3a) /* 0.346109608 */, 15 },
- /* 1100 */ { MAD_F(0x058b629a) /* 0.346529580 */, 15 },
- /* 1101 */ { MAD_F(0x058d1b1b) /* 0.346949679 */, 15 },
- /* 1102 */ { MAD_F(0x058ed3bf) /* 0.347369906 */, 15 },
- /* 1103 */ { MAD_F(0x05908c85) /* 0.347790260 */, 15 },
-
- /* 1104 */ { MAD_F(0x0592456d) /* 0.348210741 */, 15 },
- /* 1105 */ { MAD_F(0x0593fe77) /* 0.348631348 */, 15 },
- /* 1106 */ { MAD_F(0x0595b7a3) /* 0.349052083 */, 15 },
- /* 1107 */ { MAD_F(0x059770f1) /* 0.349472945 */, 15 },
- /* 1108 */ { MAD_F(0x05992a61) /* 0.349893933 */, 15 },
- /* 1109 */ { MAD_F(0x059ae3f3) /* 0.350315048 */, 15 },
- /* 1110 */ { MAD_F(0x059c9da8) /* 0.350736290 */, 15 },
- /* 1111 */ { MAD_F(0x059e577e) /* 0.351157658 */, 15 },
- /* 1112 */ { MAD_F(0x05a01176) /* 0.351579152 */, 15 },
- /* 1113 */ { MAD_F(0x05a1cb90) /* 0.352000773 */, 15 },
- /* 1114 */ { MAD_F(0x05a385cc) /* 0.352422520 */, 15 },
- /* 1115 */ { MAD_F(0x05a5402a) /* 0.352844394 */, 15 },
- /* 1116 */ { MAD_F(0x05a6faa9) /* 0.353266393 */, 15 },
- /* 1117 */ { MAD_F(0x05a8b54b) /* 0.353688519 */, 15 },
- /* 1118 */ { MAD_F(0x05aa700e) /* 0.354110771 */, 15 },
- /* 1119 */ { MAD_F(0x05ac2af3) /* 0.354533148 */, 15 },
-
- /* 1120 */ { MAD_F(0x05ade5fa) /* 0.354955651 */, 15 },
- /* 1121 */ { MAD_F(0x05afa123) /* 0.355378281 */, 15 },
- /* 1122 */ { MAD_F(0x05b15c6d) /* 0.355801035 */, 15 },
- /* 1123 */ { MAD_F(0x05b317d9) /* 0.356223916 */, 15 },
- /* 1124 */ { MAD_F(0x05b4d367) /* 0.356646922 */, 15 },
- /* 1125 */ { MAD_F(0x05b68f16) /* 0.357070053 */, 15 },
- /* 1126 */ { MAD_F(0x05b84ae7) /* 0.357493310 */, 15 },
- /* 1127 */ { MAD_F(0x05ba06da) /* 0.357916692 */, 15 },
- /* 1128 */ { MAD_F(0x05bbc2ef) /* 0.358340200 */, 15 },
- /* 1129 */ { MAD_F(0x05bd7f25) /* 0.358763832 */, 15 },
- /* 1130 */ { MAD_F(0x05bf3b7c) /* 0.359187590 */, 15 },
- /* 1131 */ { MAD_F(0x05c0f7f5) /* 0.359611472 */, 15 },
- /* 1132 */ { MAD_F(0x05c2b490) /* 0.360035480 */, 15 },
- /* 1133 */ { MAD_F(0x05c4714c) /* 0.360459613 */, 15 },
- /* 1134 */ { MAD_F(0x05c62e2a) /* 0.360883870 */, 15 },
- /* 1135 */ { MAD_F(0x05c7eb29) /* 0.361308252 */, 15 },
-
- /* 1136 */ { MAD_F(0x05c9a84a) /* 0.361732758 */, 15 },
- /* 1137 */ { MAD_F(0x05cb658c) /* 0.362157390 */, 15 },
- /* 1138 */ { MAD_F(0x05cd22ef) /* 0.362582145 */, 15 },
- /* 1139 */ { MAD_F(0x05cee074) /* 0.363007026 */, 15 },
- /* 1140 */ { MAD_F(0x05d09e1b) /* 0.363432030 */, 15 },
- /* 1141 */ { MAD_F(0x05d25be2) /* 0.363857159 */, 15 },
- /* 1142 */ { MAD_F(0x05d419cb) /* 0.364282412 */, 15 },
- /* 1143 */ { MAD_F(0x05d5d7d5) /* 0.364707789 */, 15 },
- /* 1144 */ { MAD_F(0x05d79601) /* 0.365133291 */, 15 },
- /* 1145 */ { MAD_F(0x05d9544e) /* 0.365558916 */, 15 },
- /* 1146 */ { MAD_F(0x05db12bc) /* 0.365984665 */, 15 },
- /* 1147 */ { MAD_F(0x05dcd14c) /* 0.366410538 */, 15 },
- /* 1148 */ { MAD_F(0x05de8ffc) /* 0.366836535 */, 15 },
- /* 1149 */ { MAD_F(0x05e04ece) /* 0.367262655 */, 15 },
- /* 1150 */ { MAD_F(0x05e20dc1) /* 0.367688900 */, 15 },
- /* 1151 */ { MAD_F(0x05e3ccd5) /* 0.368115267 */, 15 },
-
- /* 1152 */ { MAD_F(0x05e58c0b) /* 0.368541759 */, 15 },
- /* 1153 */ { MAD_F(0x05e74b61) /* 0.368968373 */, 15 },
- /* 1154 */ { MAD_F(0x05e90ad9) /* 0.369395111 */, 15 },
- /* 1155 */ { MAD_F(0x05eaca72) /* 0.369821973 */, 15 },
- /* 1156 */ { MAD_F(0x05ec8a2b) /* 0.370248957 */, 15 },
- /* 1157 */ { MAD_F(0x05ee4a06) /* 0.370676065 */, 15 },
- /* 1158 */ { MAD_F(0x05f00a02) /* 0.371103295 */, 15 },
- /* 1159 */ { MAD_F(0x05f1ca1f) /* 0.371530649 */, 15 },
- /* 1160 */ { MAD_F(0x05f38a5d) /* 0.371958126 */, 15 },
- /* 1161 */ { MAD_F(0x05f54abc) /* 0.372385725 */, 15 },
- /* 1162 */ { MAD_F(0x05f70b3c) /* 0.372813448 */, 15 },
- /* 1163 */ { MAD_F(0x05f8cbdc) /* 0.373241292 */, 15 },
- /* 1164 */ { MAD_F(0x05fa8c9e) /* 0.373669260 */, 15 },
- /* 1165 */ { MAD_F(0x05fc4d81) /* 0.374097350 */, 15 },
- /* 1166 */ { MAD_F(0x05fe0e84) /* 0.374525563 */, 15 },
- /* 1167 */ { MAD_F(0x05ffcfa8) /* 0.374953898 */, 15 },
-
- /* 1168 */ { MAD_F(0x060190ee) /* 0.375382356 */, 15 },
- /* 1169 */ { MAD_F(0x06035254) /* 0.375810936 */, 15 },
- /* 1170 */ { MAD_F(0x060513da) /* 0.376239638 */, 15 },
- /* 1171 */ { MAD_F(0x0606d582) /* 0.376668462 */, 15 },
- /* 1172 */ { MAD_F(0x0608974a) /* 0.377097408 */, 15 },
- /* 1173 */ { MAD_F(0x060a5934) /* 0.377526476 */, 15 },
- /* 1174 */ { MAD_F(0x060c1b3d) /* 0.377955667 */, 15 },
- /* 1175 */ { MAD_F(0x060ddd68) /* 0.378384979 */, 15 },
- /* 1176 */ { MAD_F(0x060f9fb3) /* 0.378814413 */, 15 },
- /* 1177 */ { MAD_F(0x0611621f) /* 0.379243968 */, 15 },
- /* 1178 */ { MAD_F(0x061324ac) /* 0.379673646 */, 15 },
- /* 1179 */ { MAD_F(0x0614e759) /* 0.380103444 */, 15 },
- /* 1180 */ { MAD_F(0x0616aa27) /* 0.380533365 */, 15 },
- /* 1181 */ { MAD_F(0x06186d16) /* 0.380963407 */, 15 },
- /* 1182 */ { MAD_F(0x061a3025) /* 0.381393570 */, 15 },
- /* 1183 */ { MAD_F(0x061bf354) /* 0.381823855 */, 15 },
-
- /* 1184 */ { MAD_F(0x061db6a5) /* 0.382254261 */, 15 },
- /* 1185 */ { MAD_F(0x061f7a15) /* 0.382684788 */, 15 },
- /* 1186 */ { MAD_F(0x06213da7) /* 0.383115436 */, 15 },
- /* 1187 */ { MAD_F(0x06230158) /* 0.383546205 */, 15 },
- /* 1188 */ { MAD_F(0x0624c52a) /* 0.383977096 */, 15 },
- /* 1189 */ { MAD_F(0x0626891d) /* 0.384408107 */, 15 },
- /* 1190 */ { MAD_F(0x06284d30) /* 0.384839239 */, 15 },
- /* 1191 */ { MAD_F(0x062a1164) /* 0.385270492 */, 15 },
- /* 1192 */ { MAD_F(0x062bd5b8) /* 0.385701865 */, 15 },
- /* 1193 */ { MAD_F(0x062d9a2c) /* 0.386133359 */, 15 },
- /* 1194 */ { MAD_F(0x062f5ec1) /* 0.386564974 */, 15 },
- /* 1195 */ { MAD_F(0x06312376) /* 0.386996709 */, 15 },
- /* 1196 */ { MAD_F(0x0632e84b) /* 0.387428565 */, 15 },
- /* 1197 */ { MAD_F(0x0634ad41) /* 0.387860541 */, 15 },
- /* 1198 */ { MAD_F(0x06367257) /* 0.388292637 */, 15 },
- /* 1199 */ { MAD_F(0x0638378d) /* 0.388724854 */, 15 },
-
- /* 1200 */ { MAD_F(0x0639fce4) /* 0.389157191 */, 15 },
- /* 1201 */ { MAD_F(0x063bc25b) /* 0.389589648 */, 15 },
- /* 1202 */ { MAD_F(0x063d87f2) /* 0.390022225 */, 15 },
- /* 1203 */ { MAD_F(0x063f4da9) /* 0.390454922 */, 15 },
- /* 1204 */ { MAD_F(0x06411380) /* 0.390887739 */, 15 },
- /* 1205 */ { MAD_F(0x0642d978) /* 0.391320675 */, 15 },
- /* 1206 */ { MAD_F(0x06449f8f) /* 0.391753732 */, 15 },
- /* 1207 */ { MAD_F(0x064665c7) /* 0.392186908 */, 15 },
- /* 1208 */ { MAD_F(0x06482c1f) /* 0.392620204 */, 15 },
- /* 1209 */ { MAD_F(0x0649f297) /* 0.393053619 */, 15 },
- /* 1210 */ { MAD_F(0x064bb92f) /* 0.393487154 */, 15 },
- /* 1211 */ { MAD_F(0x064d7fe8) /* 0.393920808 */, 15 },
- /* 1212 */ { MAD_F(0x064f46c0) /* 0.394354582 */, 15 },
- /* 1213 */ { MAD_F(0x06510db8) /* 0.394788475 */, 15 },
- /* 1214 */ { MAD_F(0x0652d4d0) /* 0.395222488 */, 15 },
- /* 1215 */ { MAD_F(0x06549c09) /* 0.395656619 */, 15 },
-
- /* 1216 */ { MAD_F(0x06566361) /* 0.396090870 */, 15 },
- /* 1217 */ { MAD_F(0x06582ad9) /* 0.396525239 */, 15 },
- /* 1218 */ { MAD_F(0x0659f271) /* 0.396959728 */, 15 },
- /* 1219 */ { MAD_F(0x065bba29) /* 0.397394336 */, 15 },
- /* 1220 */ { MAD_F(0x065d8201) /* 0.397829062 */, 15 },
- /* 1221 */ { MAD_F(0x065f49f9) /* 0.398263907 */, 15 },
- /* 1222 */ { MAD_F(0x06611211) /* 0.398698871 */, 15 },
- /* 1223 */ { MAD_F(0x0662da49) /* 0.399133954 */, 15 },
- /* 1224 */ { MAD_F(0x0664a2a0) /* 0.399569155 */, 15 },
- /* 1225 */ { MAD_F(0x06666b17) /* 0.400004475 */, 15 },
- /* 1226 */ { MAD_F(0x066833ae) /* 0.400439913 */, 15 },
- /* 1227 */ { MAD_F(0x0669fc65) /* 0.400875470 */, 15 },
- /* 1228 */ { MAD_F(0x066bc53c) /* 0.401311145 */, 15 },
- /* 1229 */ { MAD_F(0x066d8e32) /* 0.401746938 */, 15 },
- /* 1230 */ { MAD_F(0x066f5748) /* 0.402182850 */, 15 },
- /* 1231 */ { MAD_F(0x0671207e) /* 0.402618879 */, 15 },
-
- /* 1232 */ { MAD_F(0x0672e9d4) /* 0.403055027 */, 15 },
- /* 1233 */ { MAD_F(0x0674b349) /* 0.403491293 */, 15 },
- /* 1234 */ { MAD_F(0x06767cde) /* 0.403927676 */, 15 },
- /* 1235 */ { MAD_F(0x06784692) /* 0.404364178 */, 15 },
- /* 1236 */ { MAD_F(0x067a1066) /* 0.404800797 */, 15 },
- /* 1237 */ { MAD_F(0x067bda5a) /* 0.405237535 */, 15 },
- /* 1238 */ { MAD_F(0x067da46d) /* 0.405674390 */, 15 },
- /* 1239 */ { MAD_F(0x067f6ea0) /* 0.406111362 */, 15 },
- /* 1240 */ { MAD_F(0x068138f3) /* 0.406548452 */, 15 },
- /* 1241 */ { MAD_F(0x06830365) /* 0.406985660 */, 15 },
- /* 1242 */ { MAD_F(0x0684cdf6) /* 0.407422985 */, 15 },
- /* 1243 */ { MAD_F(0x068698a8) /* 0.407860427 */, 15 },
- /* 1244 */ { MAD_F(0x06886378) /* 0.408297987 */, 15 },
- /* 1245 */ { MAD_F(0x068a2e68) /* 0.408735664 */, 15 },
- /* 1246 */ { MAD_F(0x068bf978) /* 0.409173458 */, 15 },
- /* 1247 */ { MAD_F(0x068dc4a7) /* 0.409611370 */, 15 },
-
- /* 1248 */ { MAD_F(0x068f8ff5) /* 0.410049398 */, 15 },
- /* 1249 */ { MAD_F(0x06915b63) /* 0.410487544 */, 15 },
- /* 1250 */ { MAD_F(0x069326f0) /* 0.410925806 */, 15 },
- /* 1251 */ { MAD_F(0x0694f29c) /* 0.411364185 */, 15 },
- /* 1252 */ { MAD_F(0x0696be68) /* 0.411802681 */, 15 },
- /* 1253 */ { MAD_F(0x06988a54) /* 0.412241294 */, 15 },
- /* 1254 */ { MAD_F(0x069a565e) /* 0.412680024 */, 15 },
- /* 1255 */ { MAD_F(0x069c2288) /* 0.413118870 */, 15 },
- /* 1256 */ { MAD_F(0x069deed1) /* 0.413557833 */, 15 },
- /* 1257 */ { MAD_F(0x069fbb3a) /* 0.413996912 */, 15 },
- /* 1258 */ { MAD_F(0x06a187c1) /* 0.414436108 */, 15 },
- /* 1259 */ { MAD_F(0x06a35468) /* 0.414875420 */, 15 },
- /* 1260 */ { MAD_F(0x06a5212f) /* 0.415314849 */, 15 },
- /* 1261 */ { MAD_F(0x06a6ee14) /* 0.415754393 */, 15 },
- /* 1262 */ { MAD_F(0x06a8bb18) /* 0.416194054 */, 15 },
- /* 1263 */ { MAD_F(0x06aa883c) /* 0.416633831 */, 15 },
-
- /* 1264 */ { MAD_F(0x06ac557f) /* 0.417073724 */, 15 },
- /* 1265 */ { MAD_F(0x06ae22e1) /* 0.417513734 */, 15 },
- /* 1266 */ { MAD_F(0x06aff062) /* 0.417953859 */, 15 },
- /* 1267 */ { MAD_F(0x06b1be03) /* 0.418394100 */, 15 },
- /* 1268 */ { MAD_F(0x06b38bc2) /* 0.418834457 */, 15 },
- /* 1269 */ { MAD_F(0x06b559a1) /* 0.419274929 */, 15 },
- /* 1270 */ { MAD_F(0x06b7279e) /* 0.419715518 */, 15 },
- /* 1271 */ { MAD_F(0x06b8f5bb) /* 0.420156222 */, 15 },
- /* 1272 */ { MAD_F(0x06bac3f6) /* 0.420597041 */, 15 },
- /* 1273 */ { MAD_F(0x06bc9251) /* 0.421037977 */, 15 },
- /* 1274 */ { MAD_F(0x06be60cb) /* 0.421479027 */, 15 },
- /* 1275 */ { MAD_F(0x06c02f63) /* 0.421920193 */, 15 },
- /* 1276 */ { MAD_F(0x06c1fe1b) /* 0.422361475 */, 15 },
- /* 1277 */ { MAD_F(0x06c3ccf1) /* 0.422802871 */, 15 },
- /* 1278 */ { MAD_F(0x06c59be7) /* 0.423244383 */, 15 },
- /* 1279 */ { MAD_F(0x06c76afb) /* 0.423686010 */, 15 },
-
- /* 1280 */ { MAD_F(0x06c93a2e) /* 0.424127753 */, 15 },
- /* 1281 */ { MAD_F(0x06cb0981) /* 0.424569610 */, 15 },
- /* 1282 */ { MAD_F(0x06ccd8f2) /* 0.425011582 */, 15 },
- /* 1283 */ { MAD_F(0x06cea881) /* 0.425453669 */, 15 },
- /* 1284 */ { MAD_F(0x06d07830) /* 0.425895871 */, 15 },
- /* 1285 */ { MAD_F(0x06d247fe) /* 0.426338188 */, 15 },
- /* 1286 */ { MAD_F(0x06d417ea) /* 0.426780620 */, 15 },
- /* 1287 */ { MAD_F(0x06d5e7f5) /* 0.427223166 */, 15 },
- /* 1288 */ { MAD_F(0x06d7b81f) /* 0.427665827 */, 15 },
- /* 1289 */ { MAD_F(0x06d98868) /* 0.428108603 */, 15 },
- /* 1290 */ { MAD_F(0x06db58cf) /* 0.428551493 */, 15 },
- /* 1291 */ { MAD_F(0x06dd2955) /* 0.428994497 */, 15 },
- /* 1292 */ { MAD_F(0x06def9fa) /* 0.429437616 */, 15 },
- /* 1293 */ { MAD_F(0x06e0cabe) /* 0.429880849 */, 15 },
- /* 1294 */ { MAD_F(0x06e29ba0) /* 0.430324197 */, 15 },
- /* 1295 */ { MAD_F(0x06e46ca1) /* 0.430767659 */, 15 },
-
- /* 1296 */ { MAD_F(0x06e63dc0) /* 0.431211234 */, 15 },
- /* 1297 */ { MAD_F(0x06e80efe) /* 0.431654924 */, 15 },
- /* 1298 */ { MAD_F(0x06e9e05b) /* 0.432098728 */, 15 },
- /* 1299 */ { MAD_F(0x06ebb1d6) /* 0.432542647 */, 15 },
- /* 1300 */ { MAD_F(0x06ed8370) /* 0.432986678 */, 15 },
- /* 1301 */ { MAD_F(0x06ef5529) /* 0.433430824 */, 15 },
- /* 1302 */ { MAD_F(0x06f12700) /* 0.433875084 */, 15 },
- /* 1303 */ { MAD_F(0x06f2f8f5) /* 0.434319457 */, 15 },
- /* 1304 */ { MAD_F(0x06f4cb09) /* 0.434763944 */, 15 },
- /* 1305 */ { MAD_F(0x06f69d3c) /* 0.435208545 */, 15 },
- /* 1306 */ { MAD_F(0x06f86f8d) /* 0.435653259 */, 15 },
- /* 1307 */ { MAD_F(0x06fa41fd) /* 0.436098087 */, 15 },
- /* 1308 */ { MAD_F(0x06fc148b) /* 0.436543029 */, 15 },
- /* 1309 */ { MAD_F(0x06fde737) /* 0.436988083 */, 15 },
- /* 1310 */ { MAD_F(0x06ffba02) /* 0.437433251 */, 15 },
- /* 1311 */ { MAD_F(0x07018ceb) /* 0.437878533 */, 15 },
-
- /* 1312 */ { MAD_F(0x07035ff3) /* 0.438323927 */, 15 },
- /* 1313 */ { MAD_F(0x07053319) /* 0.438769435 */, 15 },
- /* 1314 */ { MAD_F(0x0707065d) /* 0.439215056 */, 15 },
- /* 1315 */ { MAD_F(0x0708d9c0) /* 0.439660790 */, 15 },
- /* 1316 */ { MAD_F(0x070aad41) /* 0.440106636 */, 15 },
- /* 1317 */ { MAD_F(0x070c80e1) /* 0.440552596 */, 15 },
- /* 1318 */ { MAD_F(0x070e549f) /* 0.440998669 */, 15 },
- /* 1319 */ { MAD_F(0x0710287b) /* 0.441444855 */, 15 },
- /* 1320 */ { MAD_F(0x0711fc75) /* 0.441891153 */, 15 },
- /* 1321 */ { MAD_F(0x0713d08d) /* 0.442337564 */, 15 },
- /* 1322 */ { MAD_F(0x0715a4c4) /* 0.442784088 */, 15 },
- /* 1323 */ { MAD_F(0x07177919) /* 0.443230724 */, 15 },
- /* 1324 */ { MAD_F(0x07194d8c) /* 0.443677473 */, 15 },
- /* 1325 */ { MAD_F(0x071b221e) /* 0.444124334 */, 15 },
- /* 1326 */ { MAD_F(0x071cf6ce) /* 0.444571308 */, 15 },
- /* 1327 */ { MAD_F(0x071ecb9b) /* 0.445018394 */, 15 },
-
- /* 1328 */ { MAD_F(0x0720a087) /* 0.445465593 */, 15 },
- /* 1329 */ { MAD_F(0x07227591) /* 0.445912903 */, 15 },
- /* 1330 */ { MAD_F(0x07244ab9) /* 0.446360326 */, 15 },
- /* 1331 */ { MAD_F(0x07262000) /* 0.446807861 */, 15 },
- /* 1332 */ { MAD_F(0x0727f564) /* 0.447255509 */, 15 },
- /* 1333 */ { MAD_F(0x0729cae7) /* 0.447703268 */, 15 },
- /* 1334 */ { MAD_F(0x072ba087) /* 0.448151139 */, 15 },
- /* 1335 */ { MAD_F(0x072d7646) /* 0.448599122 */, 15 },
- /* 1336 */ { MAD_F(0x072f4c22) /* 0.449047217 */, 15 },
- /* 1337 */ { MAD_F(0x0731221d) /* 0.449495424 */, 15 },
- /* 1338 */ { MAD_F(0x0732f835) /* 0.449943742 */, 15 },
- /* 1339 */ { MAD_F(0x0734ce6c) /* 0.450392173 */, 15 },
- /* 1340 */ { MAD_F(0x0736a4c1) /* 0.450840715 */, 15 },
- /* 1341 */ { MAD_F(0x07387b33) /* 0.451289368 */, 15 },
- /* 1342 */ { MAD_F(0x073a51c4) /* 0.451738133 */, 15 },
- /* 1343 */ { MAD_F(0x073c2872) /* 0.452187010 */, 15 },
-
- /* 1344 */ { MAD_F(0x073dff3e) /* 0.452635998 */, 15 },
- /* 1345 */ { MAD_F(0x073fd628) /* 0.453085097 */, 15 },
- /* 1346 */ { MAD_F(0x0741ad30) /* 0.453534308 */, 15 },
- /* 1347 */ { MAD_F(0x07438456) /* 0.453983630 */, 15 },
- /* 1348 */ { MAD_F(0x07455b9a) /* 0.454433063 */, 15 },
- /* 1349 */ { MAD_F(0x074732fc) /* 0.454882607 */, 15 },
- /* 1350 */ { MAD_F(0x07490a7b) /* 0.455332262 */, 15 },
- /* 1351 */ { MAD_F(0x074ae218) /* 0.455782029 */, 15 },
- /* 1352 */ { MAD_F(0x074cb9d3) /* 0.456231906 */, 15 },
- /* 1353 */ { MAD_F(0x074e91ac) /* 0.456681894 */, 15 },
- /* 1354 */ { MAD_F(0x075069a3) /* 0.457131993 */, 15 },
- /* 1355 */ { MAD_F(0x075241b7) /* 0.457582203 */, 15 },
- /* 1356 */ { MAD_F(0x075419e9) /* 0.458032524 */, 15 },
- /* 1357 */ { MAD_F(0x0755f239) /* 0.458482956 */, 15 },
- /* 1358 */ { MAD_F(0x0757caa7) /* 0.458933498 */, 15 },
- /* 1359 */ { MAD_F(0x0759a332) /* 0.459384151 */, 15 },
-
- /* 1360 */ { MAD_F(0x075b7bdb) /* 0.459834914 */, 15 },
- /* 1361 */ { MAD_F(0x075d54a1) /* 0.460285788 */, 15 },
- /* 1362 */ { MAD_F(0x075f2d85) /* 0.460736772 */, 15 },
- /* 1363 */ { MAD_F(0x07610687) /* 0.461187867 */, 15 },
- /* 1364 */ { MAD_F(0x0762dfa6) /* 0.461639071 */, 15 },
- /* 1365 */ { MAD_F(0x0764b8e3) /* 0.462090387 */, 15 },
- /* 1366 */ { MAD_F(0x0766923e) /* 0.462541812 */, 15 },
- /* 1367 */ { MAD_F(0x07686bb6) /* 0.462993348 */, 15 },
- /* 1368 */ { MAD_F(0x076a454c) /* 0.463444993 */, 15 },
- /* 1369 */ { MAD_F(0x076c1eff) /* 0.463896749 */, 15 },
- /* 1370 */ { MAD_F(0x076df8d0) /* 0.464348615 */, 15 },
- /* 1371 */ { MAD_F(0x076fd2be) /* 0.464800591 */, 15 },
- /* 1372 */ { MAD_F(0x0771acca) /* 0.465252676 */, 15 },
- /* 1373 */ { MAD_F(0x077386f3) /* 0.465704872 */, 15 },
- /* 1374 */ { MAD_F(0x0775613a) /* 0.466157177 */, 15 },
- /* 1375 */ { MAD_F(0x07773b9e) /* 0.466609592 */, 15 },
-
- /* 1376 */ { MAD_F(0x07791620) /* 0.467062117 */, 15 },
- /* 1377 */ { MAD_F(0x077af0bf) /* 0.467514751 */, 15 },
- /* 1378 */ { MAD_F(0x077ccb7c) /* 0.467967495 */, 15 },
- /* 1379 */ { MAD_F(0x077ea656) /* 0.468420349 */, 15 },
- /* 1380 */ { MAD_F(0x0780814d) /* 0.468873312 */, 15 },
- /* 1381 */ { MAD_F(0x07825c62) /* 0.469326384 */, 15 },
- /* 1382 */ { MAD_F(0x07843794) /* 0.469779566 */, 15 },
- /* 1383 */ { MAD_F(0x078612e3) /* 0.470232857 */, 15 },
- /* 1384 */ { MAD_F(0x0787ee50) /* 0.470686258 */, 15 },
- /* 1385 */ { MAD_F(0x0789c9da) /* 0.471139767 */, 15 },
- /* 1386 */ { MAD_F(0x078ba581) /* 0.471593386 */, 15 },
- /* 1387 */ { MAD_F(0x078d8146) /* 0.472047114 */, 15 },
- /* 1388 */ { MAD_F(0x078f5d28) /* 0.472500951 */, 15 },
- /* 1389 */ { MAD_F(0x07913927) /* 0.472954896 */, 15 },
- /* 1390 */ { MAD_F(0x07931543) /* 0.473408951 */, 15 },
- /* 1391 */ { MAD_F(0x0794f17d) /* 0.473863115 */, 15 },
-
- /* 1392 */ { MAD_F(0x0796cdd4) /* 0.474317388 */, 15 },
- /* 1393 */ { MAD_F(0x0798aa48) /* 0.474771769 */, 15 },
- /* 1394 */ { MAD_F(0x079a86d9) /* 0.475226259 */, 15 },
- /* 1395 */ { MAD_F(0x079c6388) /* 0.475680858 */, 15 },
- /* 1396 */ { MAD_F(0x079e4053) /* 0.476135565 */, 15 },
- /* 1397 */ { MAD_F(0x07a01d3c) /* 0.476590381 */, 15 },
- /* 1398 */ { MAD_F(0x07a1fa42) /* 0.477045306 */, 15 },
- /* 1399 */ { MAD_F(0x07a3d765) /* 0.477500339 */, 15 },
- /* 1400 */ { MAD_F(0x07a5b4a5) /* 0.477955481 */, 15 },
- /* 1401 */ { MAD_F(0x07a79202) /* 0.478410731 */, 15 },
- /* 1402 */ { MAD_F(0x07a96f7d) /* 0.478866089 */, 15 },
- /* 1403 */ { MAD_F(0x07ab4d14) /* 0.479321555 */, 15 },
- /* 1404 */ { MAD_F(0x07ad2ac8) /* 0.479777130 */, 15 },
- /* 1405 */ { MAD_F(0x07af089a) /* 0.480232813 */, 15 },
- /* 1406 */ { MAD_F(0x07b0e688) /* 0.480688604 */, 15 },
- /* 1407 */ { MAD_F(0x07b2c494) /* 0.481144503 */, 15 },
-
- /* 1408 */ { MAD_F(0x07b4a2bc) /* 0.481600510 */, 15 },
- /* 1409 */ { MAD_F(0x07b68102) /* 0.482056625 */, 15 },
- /* 1410 */ { MAD_F(0x07b85f64) /* 0.482512848 */, 15 },
- /* 1411 */ { MAD_F(0x07ba3de4) /* 0.482969179 */, 15 },
- /* 1412 */ { MAD_F(0x07bc1c80) /* 0.483425618 */, 15 },
- /* 1413 */ { MAD_F(0x07bdfb39) /* 0.483882164 */, 15 },
- /* 1414 */ { MAD_F(0x07bfda0f) /* 0.484338818 */, 15 },
- /* 1415 */ { MAD_F(0x07c1b902) /* 0.484795580 */, 15 },
- /* 1416 */ { MAD_F(0x07c39812) /* 0.485252449 */, 15 },
- /* 1417 */ { MAD_F(0x07c5773f) /* 0.485709426 */, 15 },
- /* 1418 */ { MAD_F(0x07c75689) /* 0.486166511 */, 15 },
- /* 1419 */ { MAD_F(0x07c935ef) /* 0.486623703 */, 15 },
- /* 1420 */ { MAD_F(0x07cb1573) /* 0.487081002 */, 15 },
- /* 1421 */ { MAD_F(0x07ccf513) /* 0.487538409 */, 15 },
- /* 1422 */ { MAD_F(0x07ced4d0) /* 0.487995923 */, 15 },
- /* 1423 */ { MAD_F(0x07d0b4aa) /* 0.488453544 */, 15 },
-
- /* 1424 */ { MAD_F(0x07d294a0) /* 0.488911273 */, 15 },
- /* 1425 */ { MAD_F(0x07d474b3) /* 0.489369108 */, 15 },
- /* 1426 */ { MAD_F(0x07d654e4) /* 0.489827051 */, 15 },
- /* 1427 */ { MAD_F(0x07d83530) /* 0.490285101 */, 15 },
- /* 1428 */ { MAD_F(0x07da159a) /* 0.490743258 */, 15 },
- /* 1429 */ { MAD_F(0x07dbf620) /* 0.491201522 */, 15 },
- /* 1430 */ { MAD_F(0x07ddd6c3) /* 0.491659892 */, 15 },
- /* 1431 */ { MAD_F(0x07dfb783) /* 0.492118370 */, 15 },
- /* 1432 */ { MAD_F(0x07e1985f) /* 0.492576954 */, 15 },
- /* 1433 */ { MAD_F(0x07e37958) /* 0.493035645 */, 15 },
- /* 1434 */ { MAD_F(0x07e55a6e) /* 0.493494443 */, 15 },
- /* 1435 */ { MAD_F(0x07e73ba0) /* 0.493953348 */, 15 },
- /* 1436 */ { MAD_F(0x07e91cef) /* 0.494412359 */, 15 },
- /* 1437 */ { MAD_F(0x07eafe5a) /* 0.494871476 */, 15 },
- /* 1438 */ { MAD_F(0x07ecdfe2) /* 0.495330701 */, 15 },
- /* 1439 */ { MAD_F(0x07eec187) /* 0.495790031 */, 15 },
-
- /* 1440 */ { MAD_F(0x07f0a348) /* 0.496249468 */, 15 },
- /* 1441 */ { MAD_F(0x07f28526) /* 0.496709012 */, 15 },
- /* 1442 */ { MAD_F(0x07f46720) /* 0.497168662 */, 15 },
- /* 1443 */ { MAD_F(0x07f64937) /* 0.497628418 */, 15 },
- /* 1444 */ { MAD_F(0x07f82b6a) /* 0.498088280 */, 15 },
- /* 1445 */ { MAD_F(0x07fa0dba) /* 0.498548248 */, 15 },
- /* 1446 */ { MAD_F(0x07fbf026) /* 0.499008323 */, 15 },
- /* 1447 */ { MAD_F(0x07fdd2af) /* 0.499468503 */, 15 },
- /* 1448 */ { MAD_F(0x07ffb554) /* 0.499928790 */, 15 },
- /* 1449 */ { MAD_F(0x0400cc0b) /* 0.250194591 */, 16 },
- /* 1450 */ { MAD_F(0x0401bd7a) /* 0.250424840 */, 16 },
- /* 1451 */ { MAD_F(0x0402aef7) /* 0.250655143 */, 16 },
- /* 1452 */ { MAD_F(0x0403a083) /* 0.250885498 */, 16 },
- /* 1453 */ { MAD_F(0x0404921c) /* 0.251115906 */, 16 },
- /* 1454 */ { MAD_F(0x040583c4) /* 0.251346367 */, 16 },
- /* 1455 */ { MAD_F(0x0406757a) /* 0.251576880 */, 16 },
-
- /* 1456 */ { MAD_F(0x0407673f) /* 0.251807447 */, 16 },
- /* 1457 */ { MAD_F(0x04085911) /* 0.252038066 */, 16 },
- /* 1458 */ { MAD_F(0x04094af1) /* 0.252268738 */, 16 },
- /* 1459 */ { MAD_F(0x040a3ce0) /* 0.252499463 */, 16 },
- /* 1460 */ { MAD_F(0x040b2edd) /* 0.252730240 */, 16 },
- /* 1461 */ { MAD_F(0x040c20e8) /* 0.252961071 */, 16 },
- /* 1462 */ { MAD_F(0x040d1301) /* 0.253191953 */, 16 },
- /* 1463 */ { MAD_F(0x040e0529) /* 0.253422889 */, 16 },
- /* 1464 */ { MAD_F(0x040ef75e) /* 0.253653877 */, 16 },
- /* 1465 */ { MAD_F(0x040fe9a1) /* 0.253884918 */, 16 },
- /* 1466 */ { MAD_F(0x0410dbf3) /* 0.254116011 */, 16 },
- /* 1467 */ { MAD_F(0x0411ce53) /* 0.254347157 */, 16 },
- /* 1468 */ { MAD_F(0x0412c0c1) /* 0.254578356 */, 16 },
- /* 1469 */ { MAD_F(0x0413b33d) /* 0.254809606 */, 16 },
- /* 1470 */ { MAD_F(0x0414a5c7) /* 0.255040910 */, 16 },
- /* 1471 */ { MAD_F(0x0415985f) /* 0.255272266 */, 16 },
-
- /* 1472 */ { MAD_F(0x04168b05) /* 0.255503674 */, 16 },
- /* 1473 */ { MAD_F(0x04177db9) /* 0.255735135 */, 16 },
- /* 1474 */ { MAD_F(0x0418707c) /* 0.255966648 */, 16 },
- /* 1475 */ { MAD_F(0x0419634c) /* 0.256198213 */, 16 },
- /* 1476 */ { MAD_F(0x041a562a) /* 0.256429831 */, 16 },
- /* 1477 */ { MAD_F(0x041b4917) /* 0.256661501 */, 16 },
- /* 1478 */ { MAD_F(0x041c3c11) /* 0.256893223 */, 16 },
- /* 1479 */ { MAD_F(0x041d2f1a) /* 0.257124998 */, 16 },
- /* 1480 */ { MAD_F(0x041e2230) /* 0.257356825 */, 16 },
- /* 1481 */ { MAD_F(0x041f1555) /* 0.257588704 */, 16 },
- /* 1482 */ { MAD_F(0x04200888) /* 0.257820635 */, 16 },
- /* 1483 */ { MAD_F(0x0420fbc8) /* 0.258052619 */, 16 },
- /* 1484 */ { MAD_F(0x0421ef17) /* 0.258284654 */, 16 },
- /* 1485 */ { MAD_F(0x0422e273) /* 0.258516742 */, 16 },
- /* 1486 */ { MAD_F(0x0423d5de) /* 0.258748882 */, 16 },
- /* 1487 */ { MAD_F(0x0424c956) /* 0.258981074 */, 16 },
-
- /* 1488 */ { MAD_F(0x0425bcdd) /* 0.259213318 */, 16 },
- /* 1489 */ { MAD_F(0x0426b071) /* 0.259445614 */, 16 },
- /* 1490 */ { MAD_F(0x0427a414) /* 0.259677962 */, 16 },
- /* 1491 */ { MAD_F(0x042897c4) /* 0.259910362 */, 16 },
- /* 1492 */ { MAD_F(0x04298b83) /* 0.260142814 */, 16 },
- /* 1493 */ { MAD_F(0x042a7f4f) /* 0.260375318 */, 16 },
- /* 1494 */ { MAD_F(0x042b7329) /* 0.260607874 */, 16 },
- /* 1495 */ { MAD_F(0x042c6711) /* 0.260840481 */, 16 },
- /* 1496 */ { MAD_F(0x042d5b07) /* 0.261073141 */, 16 },
- /* 1497 */ { MAD_F(0x042e4f0b) /* 0.261305852 */, 16 },
- /* 1498 */ { MAD_F(0x042f431d) /* 0.261538616 */, 16 },
- /* 1499 */ { MAD_F(0x0430373d) /* 0.261771431 */, 16 },
- /* 1500 */ { MAD_F(0x04312b6b) /* 0.262004297 */, 16 },
- /* 1501 */ { MAD_F(0x04321fa6) /* 0.262237216 */, 16 },
- /* 1502 */ { MAD_F(0x043313f0) /* 0.262470186 */, 16 },
- /* 1503 */ { MAD_F(0x04340847) /* 0.262703208 */, 16 },
-
- /* 1504 */ { MAD_F(0x0434fcad) /* 0.262936282 */, 16 },
- /* 1505 */ { MAD_F(0x0435f120) /* 0.263169407 */, 16 },
- /* 1506 */ { MAD_F(0x0436e5a1) /* 0.263402584 */, 16 },
- /* 1507 */ { MAD_F(0x0437da2f) /* 0.263635813 */, 16 },
- /* 1508 */ { MAD_F(0x0438cecc) /* 0.263869093 */, 16 },
- /* 1509 */ { MAD_F(0x0439c377) /* 0.264102425 */, 16 },
- /* 1510 */ { MAD_F(0x043ab82f) /* 0.264335808 */, 16 },
- /* 1511 */ { MAD_F(0x043bacf5) /* 0.264569243 */, 16 },
- /* 1512 */ { MAD_F(0x043ca1c9) /* 0.264802730 */, 16 },
- /* 1513 */ { MAD_F(0x043d96ab) /* 0.265036267 */, 16 },
- /* 1514 */ { MAD_F(0x043e8b9b) /* 0.265269857 */, 16 },
- /* 1515 */ { MAD_F(0x043f8098) /* 0.265503498 */, 16 },
- /* 1516 */ { MAD_F(0x044075a3) /* 0.265737190 */, 16 },
- /* 1517 */ { MAD_F(0x04416abc) /* 0.265970933 */, 16 },
- /* 1518 */ { MAD_F(0x04425fe3) /* 0.266204728 */, 16 },
- /* 1519 */ { MAD_F(0x04435518) /* 0.266438574 */, 16 },
-
- /* 1520 */ { MAD_F(0x04444a5a) /* 0.266672472 */, 16 },
- /* 1521 */ { MAD_F(0x04453fab) /* 0.266906421 */, 16 },
- /* 1522 */ { MAD_F(0x04463508) /* 0.267140421 */, 16 },
- /* 1523 */ { MAD_F(0x04472a74) /* 0.267374472 */, 16 },
- /* 1524 */ { MAD_F(0x04481fee) /* 0.267608575 */, 16 },
- /* 1525 */ { MAD_F(0x04491575) /* 0.267842729 */, 16 },
- /* 1526 */ { MAD_F(0x044a0b0a) /* 0.268076934 */, 16 },
- /* 1527 */ { MAD_F(0x044b00ac) /* 0.268311190 */, 16 },
- /* 1528 */ { MAD_F(0x044bf65d) /* 0.268545497 */, 16 },
- /* 1529 */ { MAD_F(0x044cec1b) /* 0.268779856 */, 16 },
- /* 1530 */ { MAD_F(0x044de1e7) /* 0.269014265 */, 16 },
- /* 1531 */ { MAD_F(0x044ed7c0) /* 0.269248726 */, 16 },
- /* 1532 */ { MAD_F(0x044fcda8) /* 0.269483238 */, 16 },
- /* 1533 */ { MAD_F(0x0450c39c) /* 0.269717800 */, 16 },
- /* 1534 */ { MAD_F(0x0451b99f) /* 0.269952414 */, 16 },
- /* 1535 */ { MAD_F(0x0452afaf) /* 0.270187079 */, 16 },
-
- /* 1536 */ { MAD_F(0x0453a5cd) /* 0.270421794 */, 16 },
- /* 1537 */ { MAD_F(0x04549bf9) /* 0.270656561 */, 16 },
- /* 1538 */ { MAD_F(0x04559232) /* 0.270891379 */, 16 },
- /* 1539 */ { MAD_F(0x04568879) /* 0.271126247 */, 16 },
- /* 1540 */ { MAD_F(0x04577ece) /* 0.271361166 */, 16 },
- /* 1541 */ { MAD_F(0x04587530) /* 0.271596136 */, 16 },
- /* 1542 */ { MAD_F(0x04596ba0) /* 0.271831157 */, 16 },
- /* 1543 */ { MAD_F(0x045a621e) /* 0.272066229 */, 16 },
- /* 1544 */ { MAD_F(0x045b58a9) /* 0.272301352 */, 16 },
- /* 1545 */ { MAD_F(0x045c4f42) /* 0.272536525 */, 16 },
- /* 1546 */ { MAD_F(0x045d45e9) /* 0.272771749 */, 16 },
- /* 1547 */ { MAD_F(0x045e3c9d) /* 0.273007024 */, 16 },
- /* 1548 */ { MAD_F(0x045f335e) /* 0.273242350 */, 16 },
- /* 1549 */ { MAD_F(0x04602a2e) /* 0.273477726 */, 16 },
- /* 1550 */ { MAD_F(0x0461210b) /* 0.273713153 */, 16 },
- /* 1551 */ { MAD_F(0x046217f5) /* 0.273948630 */, 16 },
-
- /* 1552 */ { MAD_F(0x04630eed) /* 0.274184158 */, 16 },
- /* 1553 */ { MAD_F(0x046405f3) /* 0.274419737 */, 16 },
- /* 1554 */ { MAD_F(0x0464fd06) /* 0.274655366 */, 16 },
- /* 1555 */ { MAD_F(0x0465f427) /* 0.274891046 */, 16 },
- /* 1556 */ { MAD_F(0x0466eb55) /* 0.275126776 */, 16 },
- /* 1557 */ { MAD_F(0x0467e291) /* 0.275362557 */, 16 },
- /* 1558 */ { MAD_F(0x0468d9db) /* 0.275598389 */, 16 },
- /* 1559 */ { MAD_F(0x0469d132) /* 0.275834270 */, 16 },
- /* 1560 */ { MAD_F(0x046ac896) /* 0.276070203 */, 16 },
- /* 1561 */ { MAD_F(0x046bc009) /* 0.276306185 */, 16 },
- /* 1562 */ { MAD_F(0x046cb788) /* 0.276542218 */, 16 },
- /* 1563 */ { MAD_F(0x046daf15) /* 0.276778302 */, 16 },
- /* 1564 */ { MAD_F(0x046ea6b0) /* 0.277014435 */, 16 },
- /* 1565 */ { MAD_F(0x046f9e58) /* 0.277250619 */, 16 },
- /* 1566 */ { MAD_F(0x0470960e) /* 0.277486854 */, 16 },
- /* 1567 */ { MAD_F(0x04718dd1) /* 0.277723139 */, 16 },
-
- /* 1568 */ { MAD_F(0x047285a2) /* 0.277959474 */, 16 },
- /* 1569 */ { MAD_F(0x04737d80) /* 0.278195859 */, 16 },
- /* 1570 */ { MAD_F(0x0474756c) /* 0.278432294 */, 16 },
- /* 1571 */ { MAD_F(0x04756d65) /* 0.278668780 */, 16 },
- /* 1572 */ { MAD_F(0x0476656b) /* 0.278905316 */, 16 },
- /* 1573 */ { MAD_F(0x04775d7f) /* 0.279141902 */, 16 },
- /* 1574 */ { MAD_F(0x047855a1) /* 0.279378538 */, 16 },
- /* 1575 */ { MAD_F(0x04794dd0) /* 0.279615224 */, 16 },
- /* 1576 */ { MAD_F(0x047a460c) /* 0.279851960 */, 16 },
- /* 1577 */ { MAD_F(0x047b3e56) /* 0.280088747 */, 16 },
- /* 1578 */ { MAD_F(0x047c36ae) /* 0.280325583 */, 16 },
- /* 1579 */ { MAD_F(0x047d2f12) /* 0.280562470 */, 16 },
- /* 1580 */ { MAD_F(0x047e2784) /* 0.280799406 */, 16 },
- /* 1581 */ { MAD_F(0x047f2004) /* 0.281036393 */, 16 },
- /* 1582 */ { MAD_F(0x04801891) /* 0.281273429 */, 16 },
- /* 1583 */ { MAD_F(0x0481112b) /* 0.281510516 */, 16 },
-
- /* 1584 */ { MAD_F(0x048209d3) /* 0.281747652 */, 16 },
- /* 1585 */ { MAD_F(0x04830288) /* 0.281984838 */, 16 },
- /* 1586 */ { MAD_F(0x0483fb4b) /* 0.282222075 */, 16 },
- /* 1587 */ { MAD_F(0x0484f41b) /* 0.282459361 */, 16 },
- /* 1588 */ { MAD_F(0x0485ecf8) /* 0.282696697 */, 16 },
- /* 1589 */ { MAD_F(0x0486e5e3) /* 0.282934082 */, 16 },
- /* 1590 */ { MAD_F(0x0487dedb) /* 0.283171518 */, 16 },
- /* 1591 */ { MAD_F(0x0488d7e1) /* 0.283409003 */, 16 },
- /* 1592 */ { MAD_F(0x0489d0f4) /* 0.283646538 */, 16 },
- /* 1593 */ { MAD_F(0x048aca14) /* 0.283884123 */, 16 },
- /* 1594 */ { MAD_F(0x048bc341) /* 0.284121757 */, 16 },
- /* 1595 */ { MAD_F(0x048cbc7c) /* 0.284359441 */, 16 },
- /* 1596 */ { MAD_F(0x048db5c4) /* 0.284597175 */, 16 },
- /* 1597 */ { MAD_F(0x048eaf1a) /* 0.284834959 */, 16 },
- /* 1598 */ { MAD_F(0x048fa87d) /* 0.285072792 */, 16 },
- /* 1599 */ { MAD_F(0x0490a1ed) /* 0.285310675 */, 16 },
-
- /* 1600 */ { MAD_F(0x04919b6a) /* 0.285548607 */, 16 },
- /* 1601 */ { MAD_F(0x049294f5) /* 0.285786589 */, 16 },
- /* 1602 */ { MAD_F(0x04938e8d) /* 0.286024621 */, 16 },
- /* 1603 */ { MAD_F(0x04948833) /* 0.286262702 */, 16 },
- /* 1604 */ { MAD_F(0x049581e5) /* 0.286500832 */, 16 },
- /* 1605 */ { MAD_F(0x04967ba5) /* 0.286739012 */, 16 },
- /* 1606 */ { MAD_F(0x04977573) /* 0.286977242 */, 16 },
- /* 1607 */ { MAD_F(0x04986f4d) /* 0.287215521 */, 16 },
- /* 1608 */ { MAD_F(0x04996935) /* 0.287453849 */, 16 },
- /* 1609 */ { MAD_F(0x049a632a) /* 0.287692227 */, 16 },
- /* 1610 */ { MAD_F(0x049b5d2c) /* 0.287930654 */, 16 },
- /* 1611 */ { MAD_F(0x049c573c) /* 0.288169131 */, 16 },
- /* 1612 */ { MAD_F(0x049d5159) /* 0.288407657 */, 16 },
- /* 1613 */ { MAD_F(0x049e4b83) /* 0.288646232 */, 16 },
- /* 1614 */ { MAD_F(0x049f45ba) /* 0.288884857 */, 16 },
- /* 1615 */ { MAD_F(0x04a03ffe) /* 0.289123530 */, 16 },
-
- /* 1616 */ { MAD_F(0x04a13a50) /* 0.289362253 */, 16 },
- /* 1617 */ { MAD_F(0x04a234af) /* 0.289601026 */, 16 },
- /* 1618 */ { MAD_F(0x04a32f1b) /* 0.289839847 */, 16 },
- /* 1619 */ { MAD_F(0x04a42995) /* 0.290078718 */, 16 },
- /* 1620 */ { MAD_F(0x04a5241b) /* 0.290317638 */, 16 },
- /* 1621 */ { MAD_F(0x04a61eaf) /* 0.290556607 */, 16 },
- /* 1622 */ { MAD_F(0x04a71950) /* 0.290795626 */, 16 },
- /* 1623 */ { MAD_F(0x04a813fe) /* 0.291034693 */, 16 },
- /* 1624 */ { MAD_F(0x04a90eba) /* 0.291273810 */, 16 },
- /* 1625 */ { MAD_F(0x04aa0982) /* 0.291512975 */, 16 },
- /* 1626 */ { MAD_F(0x04ab0458) /* 0.291752190 */, 16 },
- /* 1627 */ { MAD_F(0x04abff3b) /* 0.291991453 */, 16 },
- /* 1628 */ { MAD_F(0x04acfa2b) /* 0.292230766 */, 16 },
- /* 1629 */ { MAD_F(0x04adf528) /* 0.292470128 */, 16 },
- /* 1630 */ { MAD_F(0x04aef032) /* 0.292709539 */, 16 },
- /* 1631 */ { MAD_F(0x04afeb4a) /* 0.292948998 */, 16 },
-
- /* 1632 */ { MAD_F(0x04b0e66e) /* 0.293188507 */, 16 },
- /* 1633 */ { MAD_F(0x04b1e1a0) /* 0.293428065 */, 16 },
- /* 1634 */ { MAD_F(0x04b2dcdf) /* 0.293667671 */, 16 },
- /* 1635 */ { MAD_F(0x04b3d82b) /* 0.293907326 */, 16 },
- /* 1636 */ { MAD_F(0x04b4d384) /* 0.294147031 */, 16 },
- /* 1637 */ { MAD_F(0x04b5ceea) /* 0.294386784 */, 16 },
- /* 1638 */ { MAD_F(0x04b6ca5e) /* 0.294626585 */, 16 },
- /* 1639 */ { MAD_F(0x04b7c5de) /* 0.294866436 */, 16 },
- /* 1640 */ { MAD_F(0x04b8c16c) /* 0.295106336 */, 16 },
- /* 1641 */ { MAD_F(0x04b9bd06) /* 0.295346284 */, 16 },
- /* 1642 */ { MAD_F(0x04bab8ae) /* 0.295586281 */, 16 },
- /* 1643 */ { MAD_F(0x04bbb463) /* 0.295826327 */, 16 },
- /* 1644 */ { MAD_F(0x04bcb024) /* 0.296066421 */, 16 },
- /* 1645 */ { MAD_F(0x04bdabf3) /* 0.296306564 */, 16 },
- /* 1646 */ { MAD_F(0x04bea7cf) /* 0.296546756 */, 16 },
- /* 1647 */ { MAD_F(0x04bfa3b8) /* 0.296786996 */, 16 },
-
- /* 1648 */ { MAD_F(0x04c09faf) /* 0.297027285 */, 16 },
- /* 1649 */ { MAD_F(0x04c19bb2) /* 0.297267623 */, 16 },
- /* 1650 */ { MAD_F(0x04c297c2) /* 0.297508009 */, 16 },
- /* 1651 */ { MAD_F(0x04c393df) /* 0.297748444 */, 16 },
- /* 1652 */ { MAD_F(0x04c49009) /* 0.297988927 */, 16 },
- /* 1653 */ { MAD_F(0x04c58c41) /* 0.298229459 */, 16 },
- /* 1654 */ { MAD_F(0x04c68885) /* 0.298470039 */, 16 },
- /* 1655 */ { MAD_F(0x04c784d6) /* 0.298710668 */, 16 },
- /* 1656 */ { MAD_F(0x04c88135) /* 0.298951346 */, 16 },
- /* 1657 */ { MAD_F(0x04c97da0) /* 0.299192071 */, 16 },
- /* 1658 */ { MAD_F(0x04ca7a18) /* 0.299432846 */, 16 },
- /* 1659 */ { MAD_F(0x04cb769e) /* 0.299673668 */, 16 },
- /* 1660 */ { MAD_F(0x04cc7330) /* 0.299914539 */, 16 },
- /* 1661 */ { MAD_F(0x04cd6fcf) /* 0.300155459 */, 16 },
- /* 1662 */ { MAD_F(0x04ce6c7b) /* 0.300396426 */, 16 },
- /* 1663 */ { MAD_F(0x04cf6935) /* 0.300637443 */, 16 },
-
- /* 1664 */ { MAD_F(0x04d065fb) /* 0.300878507 */, 16 },
- /* 1665 */ { MAD_F(0x04d162ce) /* 0.301119620 */, 16 },
- /* 1666 */ { MAD_F(0x04d25fae) /* 0.301360781 */, 16 },
- /* 1667 */ { MAD_F(0x04d35c9b) /* 0.301601990 */, 16 },
- /* 1668 */ { MAD_F(0x04d45995) /* 0.301843247 */, 16 },
- /* 1669 */ { MAD_F(0x04d5569c) /* 0.302084553 */, 16 },
- /* 1670 */ { MAD_F(0x04d653b0) /* 0.302325907 */, 16 },
- /* 1671 */ { MAD_F(0x04d750d1) /* 0.302567309 */, 16 },
- /* 1672 */ { MAD_F(0x04d84dff) /* 0.302808759 */, 16 },
- /* 1673 */ { MAD_F(0x04d94b3a) /* 0.303050257 */, 16 },
- /* 1674 */ { MAD_F(0x04da4881) /* 0.303291804 */, 16 },
- /* 1675 */ { MAD_F(0x04db45d6) /* 0.303533399 */, 16 },
- /* 1676 */ { MAD_F(0x04dc4337) /* 0.303775041 */, 16 },
- /* 1677 */ { MAD_F(0x04dd40a6) /* 0.304016732 */, 16 },
- /* 1678 */ { MAD_F(0x04de3e21) /* 0.304258471 */, 16 },
- /* 1679 */ { MAD_F(0x04df3ba9) /* 0.304500257 */, 16 },
-
- /* 1680 */ { MAD_F(0x04e0393e) /* 0.304742092 */, 16 },
- /* 1681 */ { MAD_F(0x04e136e0) /* 0.304983975 */, 16 },
- /* 1682 */ { MAD_F(0x04e2348f) /* 0.305225906 */, 16 },
- /* 1683 */ { MAD_F(0x04e3324b) /* 0.305467885 */, 16 },
- /* 1684 */ { MAD_F(0x04e43013) /* 0.305709911 */, 16 },
- /* 1685 */ { MAD_F(0x04e52de9) /* 0.305951986 */, 16 },
- /* 1686 */ { MAD_F(0x04e62bcb) /* 0.306194108 */, 16 },
- /* 1687 */ { MAD_F(0x04e729ba) /* 0.306436279 */, 16 },
- /* 1688 */ { MAD_F(0x04e827b6) /* 0.306678497 */, 16 },
- /* 1689 */ { MAD_F(0x04e925bf) /* 0.306920763 */, 16 },
- /* 1690 */ { MAD_F(0x04ea23d4) /* 0.307163077 */, 16 },
- /* 1691 */ { MAD_F(0x04eb21f7) /* 0.307405438 */, 16 },
- /* 1692 */ { MAD_F(0x04ec2026) /* 0.307647848 */, 16 },
- /* 1693 */ { MAD_F(0x04ed1e62) /* 0.307890305 */, 16 },
- /* 1694 */ { MAD_F(0x04ee1cab) /* 0.308132810 */, 16 },
- /* 1695 */ { MAD_F(0x04ef1b01) /* 0.308375362 */, 16 },
-
- /* 1696 */ { MAD_F(0x04f01963) /* 0.308617963 */, 16 },
- /* 1697 */ { MAD_F(0x04f117d3) /* 0.308860611 */, 16 },
- /* 1698 */ { MAD_F(0x04f2164f) /* 0.309103306 */, 16 },
- /* 1699 */ { MAD_F(0x04f314d8) /* 0.309346050 */, 16 },
- /* 1700 */ { MAD_F(0x04f4136d) /* 0.309588841 */, 16 },
- /* 1701 */ { MAD_F(0x04f51210) /* 0.309831679 */, 16 },
- /* 1702 */ { MAD_F(0x04f610bf) /* 0.310074565 */, 16 },
- /* 1703 */ { MAD_F(0x04f70f7b) /* 0.310317499 */, 16 },
- /* 1704 */ { MAD_F(0x04f80e44) /* 0.310560480 */, 16 },
- /* 1705 */ { MAD_F(0x04f90d19) /* 0.310803509 */, 16 },
- /* 1706 */ { MAD_F(0x04fa0bfc) /* 0.311046586 */, 16 },
- /* 1707 */ { MAD_F(0x04fb0aeb) /* 0.311289710 */, 16 },
- /* 1708 */ { MAD_F(0x04fc09e7) /* 0.311532881 */, 16 },
- /* 1709 */ { MAD_F(0x04fd08ef) /* 0.311776100 */, 16 },
- /* 1710 */ { MAD_F(0x04fe0805) /* 0.312019366 */, 16 },
- /* 1711 */ { MAD_F(0x04ff0727) /* 0.312262680 */, 16 },
-
- /* 1712 */ { MAD_F(0x05000655) /* 0.312506041 */, 16 },
- /* 1713 */ { MAD_F(0x05010591) /* 0.312749449 */, 16 },
- /* 1714 */ { MAD_F(0x050204d9) /* 0.312992905 */, 16 },
- /* 1715 */ { MAD_F(0x0503042e) /* 0.313236408 */, 16 },
- /* 1716 */ { MAD_F(0x0504038f) /* 0.313479959 */, 16 },
- /* 1717 */ { MAD_F(0x050502fe) /* 0.313723556 */, 16 },
- /* 1718 */ { MAD_F(0x05060279) /* 0.313967202 */, 16 },
- /* 1719 */ { MAD_F(0x05070200) /* 0.314210894 */, 16 },
- /* 1720 */ { MAD_F(0x05080195) /* 0.314454634 */, 16 },
- /* 1721 */ { MAD_F(0x05090136) /* 0.314698420 */, 16 },
- /* 1722 */ { MAD_F(0x050a00e3) /* 0.314942255 */, 16 },
- /* 1723 */ { MAD_F(0x050b009e) /* 0.315186136 */, 16 },
- /* 1724 */ { MAD_F(0x050c0065) /* 0.315430064 */, 16 },
- /* 1725 */ { MAD_F(0x050d0039) /* 0.315674040 */, 16 },
- /* 1726 */ { MAD_F(0x050e0019) /* 0.315918063 */, 16 },
- /* 1727 */ { MAD_F(0x050f0006) /* 0.316162133 */, 16 },
-
- /* 1728 */ { MAD_F(0x05100000) /* 0.316406250 */, 16 },
- /* 1729 */ { MAD_F(0x05110006) /* 0.316650414 */, 16 },
- /* 1730 */ { MAD_F(0x05120019) /* 0.316894625 */, 16 },
- /* 1731 */ { MAD_F(0x05130039) /* 0.317138884 */, 16 },
- /* 1732 */ { MAD_F(0x05140065) /* 0.317383189 */, 16 },
- /* 1733 */ { MAD_F(0x0515009e) /* 0.317627541 */, 16 },
- /* 1734 */ { MAD_F(0x051600e3) /* 0.317871941 */, 16 },
- /* 1735 */ { MAD_F(0x05170135) /* 0.318116387 */, 16 },
- /* 1736 */ { MAD_F(0x05180194) /* 0.318360880 */, 16 },
- /* 1737 */ { MAD_F(0x051901ff) /* 0.318605421 */, 16 },
- /* 1738 */ { MAD_F(0x051a0277) /* 0.318850008 */, 16 },
- /* 1739 */ { MAD_F(0x051b02fc) /* 0.319094642 */, 16 },
- /* 1740 */ { MAD_F(0x051c038d) /* 0.319339323 */, 16 },
- /* 1741 */ { MAD_F(0x051d042a) /* 0.319584051 */, 16 },
- /* 1742 */ { MAD_F(0x051e04d4) /* 0.319828826 */, 16 },
- /* 1743 */ { MAD_F(0x051f058b) /* 0.320073647 */, 16 },
-
- /* 1744 */ { MAD_F(0x0520064f) /* 0.320318516 */, 16 },
- /* 1745 */ { MAD_F(0x0521071f) /* 0.320563431 */, 16 },
- /* 1746 */ { MAD_F(0x052207fb) /* 0.320808393 */, 16 },
- /* 1747 */ { MAD_F(0x052308e4) /* 0.321053402 */, 16 },
- /* 1748 */ { MAD_F(0x052409da) /* 0.321298457 */, 16 },
- /* 1749 */ { MAD_F(0x05250adc) /* 0.321543560 */, 16 },
- /* 1750 */ { MAD_F(0x05260bea) /* 0.321788709 */, 16 },
- /* 1751 */ { MAD_F(0x05270d06) /* 0.322033904 */, 16 },
- /* 1752 */ { MAD_F(0x05280e2d) /* 0.322279147 */, 16 },
- /* 1753 */ { MAD_F(0x05290f62) /* 0.322524436 */, 16 },
- /* 1754 */ { MAD_F(0x052a10a3) /* 0.322769771 */, 16 },
- /* 1755 */ { MAD_F(0x052b11f0) /* 0.323015154 */, 16 },
- /* 1756 */ { MAD_F(0x052c134a) /* 0.323260583 */, 16 },
- /* 1757 */ { MAD_F(0x052d14b0) /* 0.323506058 */, 16 },
- /* 1758 */ { MAD_F(0x052e1623) /* 0.323751580 */, 16 },
- /* 1759 */ { MAD_F(0x052f17a2) /* 0.323997149 */, 16 },
-
- /* 1760 */ { MAD_F(0x0530192e) /* 0.324242764 */, 16 },
- /* 1761 */ { MAD_F(0x05311ac6) /* 0.324488426 */, 16 },
- /* 1762 */ { MAD_F(0x05321c6b) /* 0.324734134 */, 16 },
- /* 1763 */ { MAD_F(0x05331e1c) /* 0.324979889 */, 16 },
- /* 1764 */ { MAD_F(0x05341fda) /* 0.325225690 */, 16 },
- /* 1765 */ { MAD_F(0x053521a4) /* 0.325471538 */, 16 },
- /* 1766 */ { MAD_F(0x0536237b) /* 0.325717432 */, 16 },
- /* 1767 */ { MAD_F(0x0537255e) /* 0.325963372 */, 16 },
- /* 1768 */ { MAD_F(0x0538274e) /* 0.326209359 */, 16 },
- /* 1769 */ { MAD_F(0x0539294a) /* 0.326455392 */, 16 },
- /* 1770 */ { MAD_F(0x053a2b52) /* 0.326701472 */, 16 },
- /* 1771 */ { MAD_F(0x053b2d67) /* 0.326947598 */, 16 },
- /* 1772 */ { MAD_F(0x053c2f89) /* 0.327193770 */, 16 },
- /* 1773 */ { MAD_F(0x053d31b6) /* 0.327439989 */, 16 },
- /* 1774 */ { MAD_F(0x053e33f1) /* 0.327686254 */, 16 },
- /* 1775 */ { MAD_F(0x053f3637) /* 0.327932565 */, 16 },
-
- /* 1776 */ { MAD_F(0x0540388a) /* 0.328178922 */, 16 },
- /* 1777 */ { MAD_F(0x05413aea) /* 0.328425326 */, 16 },
- /* 1778 */ { MAD_F(0x05423d56) /* 0.328671776 */, 16 },
- /* 1779 */ { MAD_F(0x05433fce) /* 0.328918272 */, 16 },
- /* 1780 */ { MAD_F(0x05444253) /* 0.329164814 */, 16 },
- /* 1781 */ { MAD_F(0x054544e4) /* 0.329411403 */, 16 },
- /* 1782 */ { MAD_F(0x05464781) /* 0.329658038 */, 16 },
- /* 1783 */ { MAD_F(0x05474a2b) /* 0.329904718 */, 16 },
- /* 1784 */ { MAD_F(0x05484ce2) /* 0.330151445 */, 16 },
- /* 1785 */ { MAD_F(0x05494fa4) /* 0.330398218 */, 16 },
- /* 1786 */ { MAD_F(0x054a5273) /* 0.330645037 */, 16 },
- /* 1787 */ { MAD_F(0x054b554e) /* 0.330891903 */, 16 },
- /* 1788 */ { MAD_F(0x054c5836) /* 0.331138814 */, 16 },
- /* 1789 */ { MAD_F(0x054d5b2a) /* 0.331385771 */, 16 },
- /* 1790 */ { MAD_F(0x054e5e2b) /* 0.331632774 */, 16 },
- /* 1791 */ { MAD_F(0x054f6138) /* 0.331879824 */, 16 },
-
- /* 1792 */ { MAD_F(0x05506451) /* 0.332126919 */, 16 },
- /* 1793 */ { MAD_F(0x05516776) /* 0.332374060 */, 16 },
- /* 1794 */ { MAD_F(0x05526aa8) /* 0.332621247 */, 16 },
- /* 1795 */ { MAD_F(0x05536de6) /* 0.332868480 */, 16 },
- /* 1796 */ { MAD_F(0x05547131) /* 0.333115759 */, 16 },
- /* 1797 */ { MAD_F(0x05557487) /* 0.333363084 */, 16 },
- /* 1798 */ { MAD_F(0x055677ea) /* 0.333610455 */, 16 },
- /* 1799 */ { MAD_F(0x05577b5a) /* 0.333857872 */, 16 },
- /* 1800 */ { MAD_F(0x05587ed5) /* 0.334105334 */, 16 },
- /* 1801 */ { MAD_F(0x0559825e) /* 0.334352843 */, 16 },
- /* 1802 */ { MAD_F(0x055a85f2) /* 0.334600397 */, 16 },
- /* 1803 */ { MAD_F(0x055b8992) /* 0.334847997 */, 16 },
- /* 1804 */ { MAD_F(0x055c8d3f) /* 0.335095642 */, 16 },
- /* 1805 */ { MAD_F(0x055d90f9) /* 0.335343334 */, 16 },
- /* 1806 */ { MAD_F(0x055e94be) /* 0.335591071 */, 16 },
- /* 1807 */ { MAD_F(0x055f9890) /* 0.335838854 */, 16 },
-
- /* 1808 */ { MAD_F(0x05609c6e) /* 0.336086683 */, 16 },
- /* 1809 */ { MAD_F(0x0561a058) /* 0.336334557 */, 16 },
- /* 1810 */ { MAD_F(0x0562a44f) /* 0.336582477 */, 16 },
- /* 1811 */ { MAD_F(0x0563a851) /* 0.336830443 */, 16 },
- /* 1812 */ { MAD_F(0x0564ac60) /* 0.337078454 */, 16 },
- /* 1813 */ { MAD_F(0x0565b07c) /* 0.337326511 */, 16 },
- /* 1814 */ { MAD_F(0x0566b4a3) /* 0.337574614 */, 16 },
- /* 1815 */ { MAD_F(0x0567b8d7) /* 0.337822762 */, 16 },
- /* 1816 */ { MAD_F(0x0568bd17) /* 0.338070956 */, 16 },
- /* 1817 */ { MAD_F(0x0569c163) /* 0.338319195 */, 16 },
- /* 1818 */ { MAD_F(0x056ac5bc) /* 0.338567480 */, 16 },
- /* 1819 */ { MAD_F(0x056bca20) /* 0.338815811 */, 16 },
- /* 1820 */ { MAD_F(0x056cce91) /* 0.339064186 */, 16 },
- /* 1821 */ { MAD_F(0x056dd30e) /* 0.339312608 */, 16 },
- /* 1822 */ { MAD_F(0x056ed798) /* 0.339561075 */, 16 },
- /* 1823 */ { MAD_F(0x056fdc2d) /* 0.339809587 */, 16 },
-
- /* 1824 */ { MAD_F(0x0570e0cf) /* 0.340058145 */, 16 },
- /* 1825 */ { MAD_F(0x0571e57d) /* 0.340306748 */, 16 },
- /* 1826 */ { MAD_F(0x0572ea37) /* 0.340555397 */, 16 },
- /* 1827 */ { MAD_F(0x0573eefd) /* 0.340804091 */, 16 },
- /* 1828 */ { MAD_F(0x0574f3d0) /* 0.341052830 */, 16 },
- /* 1829 */ { MAD_F(0x0575f8ae) /* 0.341301615 */, 16 },
- /* 1830 */ { MAD_F(0x0576fd99) /* 0.341550445 */, 16 },
- /* 1831 */ { MAD_F(0x05780290) /* 0.341799321 */, 16 },
- /* 1832 */ { MAD_F(0x05790793) /* 0.342048241 */, 16 },
- /* 1833 */ { MAD_F(0x057a0ca3) /* 0.342297207 */, 16 },
- /* 1834 */ { MAD_F(0x057b11be) /* 0.342546219 */, 16 },
- /* 1835 */ { MAD_F(0x057c16e6) /* 0.342795275 */, 16 },
- /* 1836 */ { MAD_F(0x057d1c1a) /* 0.343044377 */, 16 },
- /* 1837 */ { MAD_F(0x057e2159) /* 0.343293524 */, 16 },
- /* 1838 */ { MAD_F(0x057f26a6) /* 0.343542717 */, 16 },
- /* 1839 */ { MAD_F(0x05802bfe) /* 0.343791954 */, 16 },
-
- /* 1840 */ { MAD_F(0x05813162) /* 0.344041237 */, 16 },
- /* 1841 */ { MAD_F(0x058236d2) /* 0.344290564 */, 16 },
- /* 1842 */ { MAD_F(0x05833c4f) /* 0.344539937 */, 16 },
- /* 1843 */ { MAD_F(0x058441d8) /* 0.344789356 */, 16 },
- /* 1844 */ { MAD_F(0x0585476c) /* 0.345038819 */, 16 },
- /* 1845 */ { MAD_F(0x05864d0d) /* 0.345288327 */, 16 },
- /* 1846 */ { MAD_F(0x058752ba) /* 0.345537880 */, 16 },
- /* 1847 */ { MAD_F(0x05885873) /* 0.345787479 */, 16 },
- /* 1848 */ { MAD_F(0x05895e39) /* 0.346037122 */, 16 },
- /* 1849 */ { MAD_F(0x058a640a) /* 0.346286811 */, 16 },
- /* 1850 */ { MAD_F(0x058b69e7) /* 0.346536545 */, 16 },
- /* 1851 */ { MAD_F(0x058c6fd1) /* 0.346786323 */, 16 },
- /* 1852 */ { MAD_F(0x058d75c6) /* 0.347036147 */, 16 },
- /* 1853 */ { MAD_F(0x058e7bc8) /* 0.347286015 */, 16 },
- /* 1854 */ { MAD_F(0x058f81d5) /* 0.347535929 */, 16 },
- /* 1855 */ { MAD_F(0x059087ef) /* 0.347785887 */, 16 },
-
- /* 1856 */ { MAD_F(0x05918e15) /* 0.348035890 */, 16 },
- /* 1857 */ { MAD_F(0x05929447) /* 0.348285939 */, 16 },
- /* 1858 */ { MAD_F(0x05939a84) /* 0.348536032 */, 16 },
- /* 1859 */ { MAD_F(0x0594a0ce) /* 0.348786170 */, 16 },
- /* 1860 */ { MAD_F(0x0595a724) /* 0.349036353 */, 16 },
- /* 1861 */ { MAD_F(0x0596ad86) /* 0.349286580 */, 16 },
- /* 1862 */ { MAD_F(0x0597b3f4) /* 0.349536853 */, 16 },
- /* 1863 */ { MAD_F(0x0598ba6e) /* 0.349787170 */, 16 },
- /* 1864 */ { MAD_F(0x0599c0f4) /* 0.350037532 */, 16 },
- /* 1865 */ { MAD_F(0x059ac786) /* 0.350287939 */, 16 },
- /* 1866 */ { MAD_F(0x059bce25) /* 0.350538391 */, 16 },
- /* 1867 */ { MAD_F(0x059cd4cf) /* 0.350788887 */, 16 },
- /* 1868 */ { MAD_F(0x059ddb85) /* 0.351039428 */, 16 },
- /* 1869 */ { MAD_F(0x059ee247) /* 0.351290014 */, 16 },
- /* 1870 */ { MAD_F(0x059fe915) /* 0.351540645 */, 16 },
- /* 1871 */ { MAD_F(0x05a0efef) /* 0.351791320 */, 16 },
-
- /* 1872 */ { MAD_F(0x05a1f6d5) /* 0.352042040 */, 16 },
- /* 1873 */ { MAD_F(0x05a2fdc7) /* 0.352292804 */, 16 },
- /* 1874 */ { MAD_F(0x05a404c5) /* 0.352543613 */, 16 },
- /* 1875 */ { MAD_F(0x05a50bcf) /* 0.352794467 */, 16 },
- /* 1876 */ { MAD_F(0x05a612e5) /* 0.353045365 */, 16 },
- /* 1877 */ { MAD_F(0x05a71a07) /* 0.353296308 */, 16 },
- /* 1878 */ { MAD_F(0x05a82135) /* 0.353547296 */, 16 },
- /* 1879 */ { MAD_F(0x05a9286f) /* 0.353798328 */, 16 },
- /* 1880 */ { MAD_F(0x05aa2fb5) /* 0.354049405 */, 16 },
- /* 1881 */ { MAD_F(0x05ab3707) /* 0.354300526 */, 16 },
- /* 1882 */ { MAD_F(0x05ac3e65) /* 0.354551691 */, 16 },
- /* 1883 */ { MAD_F(0x05ad45ce) /* 0.354802901 */, 16 },
- /* 1884 */ { MAD_F(0x05ae4d44) /* 0.355054156 */, 16 },
- /* 1885 */ { MAD_F(0x05af54c6) /* 0.355305455 */, 16 },
- /* 1886 */ { MAD_F(0x05b05c53) /* 0.355556799 */, 16 },
- /* 1887 */ { MAD_F(0x05b163ed) /* 0.355808187 */, 16 },
-
- /* 1888 */ { MAD_F(0x05b26b92) /* 0.356059619 */, 16 },
- /* 1889 */ { MAD_F(0x05b37343) /* 0.356311096 */, 16 },
- /* 1890 */ { MAD_F(0x05b47b00) /* 0.356562617 */, 16 },
- /* 1891 */ { MAD_F(0x05b582c9) /* 0.356814182 */, 16 },
- /* 1892 */ { MAD_F(0x05b68a9e) /* 0.357065792 */, 16 },
- /* 1893 */ { MAD_F(0x05b7927f) /* 0.357317446 */, 16 },
- /* 1894 */ { MAD_F(0x05b89a6c) /* 0.357569145 */, 16 },
- /* 1895 */ { MAD_F(0x05b9a265) /* 0.357820887 */, 16 },
- /* 1896 */ { MAD_F(0x05baaa69) /* 0.358072674 */, 16 },
- /* 1897 */ { MAD_F(0x05bbb27a) /* 0.358324506 */, 16 },
- /* 1898 */ { MAD_F(0x05bcba96) /* 0.358576381 */, 16 },
- /* 1899 */ { MAD_F(0x05bdc2be) /* 0.358828301 */, 16 },
- /* 1900 */ { MAD_F(0x05becaf2) /* 0.359080265 */, 16 },
- /* 1901 */ { MAD_F(0x05bfd332) /* 0.359332273 */, 16 },
- /* 1902 */ { MAD_F(0x05c0db7e) /* 0.359584326 */, 16 },
- /* 1903 */ { MAD_F(0x05c1e3d6) /* 0.359836423 */, 16 },
-
- /* 1904 */ { MAD_F(0x05c2ec39) /* 0.360088563 */, 16 },
- /* 1905 */ { MAD_F(0x05c3f4a9) /* 0.360340748 */, 16 },
- /* 1906 */ { MAD_F(0x05c4fd24) /* 0.360592977 */, 16 },
- /* 1907 */ { MAD_F(0x05c605ab) /* 0.360845251 */, 16 },
- /* 1908 */ { MAD_F(0x05c70e3e) /* 0.361097568 */, 16 },
- /* 1909 */ { MAD_F(0x05c816dd) /* 0.361349929 */, 16 },
- /* 1910 */ { MAD_F(0x05c91f87) /* 0.361602335 */, 16 },
- /* 1911 */ { MAD_F(0x05ca283e) /* 0.361854784 */, 16 },
- /* 1912 */ { MAD_F(0x05cb3100) /* 0.362107278 */, 16 },
- /* 1913 */ { MAD_F(0x05cc39ce) /* 0.362359815 */, 16 },
- /* 1914 */ { MAD_F(0x05cd42a8) /* 0.362612397 */, 16 },
- /* 1915 */ { MAD_F(0x05ce4b8d) /* 0.362865022 */, 16 },
- /* 1916 */ { MAD_F(0x05cf547f) /* 0.363117692 */, 16 },
- /* 1917 */ { MAD_F(0x05d05d7c) /* 0.363370405 */, 16 },
- /* 1918 */ { MAD_F(0x05d16685) /* 0.363623163 */, 16 },
- /* 1919 */ { MAD_F(0x05d26f9a) /* 0.363875964 */, 16 },
-
- /* 1920 */ { MAD_F(0x05d378bb) /* 0.364128809 */, 16 },
- /* 1921 */ { MAD_F(0x05d481e7) /* 0.364381698 */, 16 },
- /* 1922 */ { MAD_F(0x05d58b1f) /* 0.364634632 */, 16 },
- /* 1923 */ { MAD_F(0x05d69463) /* 0.364887608 */, 16 },
- /* 1924 */ { MAD_F(0x05d79db3) /* 0.365140629 */, 16 },
- /* 1925 */ { MAD_F(0x05d8a70f) /* 0.365393694 */, 16 },
- /* 1926 */ { MAD_F(0x05d9b076) /* 0.365646802 */, 16 },
- /* 1927 */ { MAD_F(0x05dab9e9) /* 0.365899955 */, 16 },
- /* 1928 */ { MAD_F(0x05dbc368) /* 0.366153151 */, 16 },
- /* 1929 */ { MAD_F(0x05dcccf2) /* 0.366406390 */, 16 },
- /* 1930 */ { MAD_F(0x05ddd689) /* 0.366659674 */, 16 },
- /* 1931 */ { MAD_F(0x05dee02b) /* 0.366913001 */, 16 },
- /* 1932 */ { MAD_F(0x05dfe9d8) /* 0.367166372 */, 16 },
- /* 1933 */ { MAD_F(0x05e0f392) /* 0.367419787 */, 16 },
- /* 1934 */ { MAD_F(0x05e1fd57) /* 0.367673246 */, 16 },
- /* 1935 */ { MAD_F(0x05e30728) /* 0.367926748 */, 16 },
-
- /* 1936 */ { MAD_F(0x05e41105) /* 0.368180294 */, 16 },
- /* 1937 */ { MAD_F(0x05e51aed) /* 0.368433883 */, 16 },
- /* 1938 */ { MAD_F(0x05e624e1) /* 0.368687517 */, 16 },
- /* 1939 */ { MAD_F(0x05e72ee1) /* 0.368941193 */, 16 },
- /* 1940 */ { MAD_F(0x05e838ed) /* 0.369194914 */, 16 },
- /* 1941 */ { MAD_F(0x05e94304) /* 0.369448678 */, 16 },
- /* 1942 */ { MAD_F(0x05ea4d27) /* 0.369702485 */, 16 },
- /* 1943 */ { MAD_F(0x05eb5756) /* 0.369956336 */, 16 },
- /* 1944 */ { MAD_F(0x05ec6190) /* 0.370210231 */, 16 },
- /* 1945 */ { MAD_F(0x05ed6bd6) /* 0.370464169 */, 16 },
- /* 1946 */ { MAD_F(0x05ee7628) /* 0.370718151 */, 16 },
- /* 1947 */ { MAD_F(0x05ef8085) /* 0.370972177 */, 16 },
- /* 1948 */ { MAD_F(0x05f08aee) /* 0.371226245 */, 16 },
- /* 1949 */ { MAD_F(0x05f19563) /* 0.371480358 */, 16 },
- /* 1950 */ { MAD_F(0x05f29fe3) /* 0.371734513 */, 16 },
- /* 1951 */ { MAD_F(0x05f3aa6f) /* 0.371988712 */, 16 },
-
- /* 1952 */ { MAD_F(0x05f4b507) /* 0.372242955 */, 16 },
- /* 1953 */ { MAD_F(0x05f5bfab) /* 0.372497241 */, 16 },
- /* 1954 */ { MAD_F(0x05f6ca5a) /* 0.372751570 */, 16 },
- /* 1955 */ { MAD_F(0x05f7d514) /* 0.373005943 */, 16 },
- /* 1956 */ { MAD_F(0x05f8dfdb) /* 0.373260359 */, 16 },
- /* 1957 */ { MAD_F(0x05f9eaad) /* 0.373514819 */, 16 },
- /* 1958 */ { MAD_F(0x05faf58a) /* 0.373769322 */, 16 },
- /* 1959 */ { MAD_F(0x05fc0073) /* 0.374023868 */, 16 },
- /* 1960 */ { MAD_F(0x05fd0b68) /* 0.374278458 */, 16 },
- /* 1961 */ { MAD_F(0x05fe1669) /* 0.374533091 */, 16 },
- /* 1962 */ { MAD_F(0x05ff2175) /* 0.374787767 */, 16 },
- /* 1963 */ { MAD_F(0x06002c8d) /* 0.375042486 */, 16 },
- /* 1964 */ { MAD_F(0x060137b0) /* 0.375297249 */, 16 },
- /* 1965 */ { MAD_F(0x060242df) /* 0.375552055 */, 16 },
- /* 1966 */ { MAD_F(0x06034e19) /* 0.375806904 */, 16 },
- /* 1967 */ { MAD_F(0x0604595f) /* 0.376061796 */, 16 },
-
- /* 1968 */ { MAD_F(0x060564b1) /* 0.376316732 */, 16 },
- /* 1969 */ { MAD_F(0x0606700f) /* 0.376571710 */, 16 },
- /* 1970 */ { MAD_F(0x06077b77) /* 0.376826732 */, 16 },
- /* 1971 */ { MAD_F(0x060886ec) /* 0.377081797 */, 16 },
- /* 1972 */ { MAD_F(0x0609926c) /* 0.377336905 */, 16 },
- /* 1973 */ { MAD_F(0x060a9df8) /* 0.377592057 */, 16 },
- /* 1974 */ { MAD_F(0x060ba98f) /* 0.377847251 */, 16 },
- /* 1975 */ { MAD_F(0x060cb532) /* 0.378102489 */, 16 },
- /* 1976 */ { MAD_F(0x060dc0e0) /* 0.378357769 */, 16 },
- /* 1977 */ { MAD_F(0x060ecc9a) /* 0.378613093 */, 16 },
- /* 1978 */ { MAD_F(0x060fd860) /* 0.378868460 */, 16 },
- /* 1979 */ { MAD_F(0x0610e431) /* 0.379123870 */, 16 },
- /* 1980 */ { MAD_F(0x0611f00d) /* 0.379379322 */, 16 },
- /* 1981 */ { MAD_F(0x0612fbf5) /* 0.379634818 */, 16 },
- /* 1982 */ { MAD_F(0x061407e9) /* 0.379890357 */, 16 },
- /* 1983 */ { MAD_F(0x061513e8) /* 0.380145939 */, 16 },
-
- /* 1984 */ { MAD_F(0x06161ff3) /* 0.380401563 */, 16 },
- /* 1985 */ { MAD_F(0x06172c09) /* 0.380657231 */, 16 },
- /* 1986 */ { MAD_F(0x0618382b) /* 0.380912942 */, 16 },
- /* 1987 */ { MAD_F(0x06194458) /* 0.381168695 */, 16 },
- /* 1988 */ { MAD_F(0x061a5091) /* 0.381424492 */, 16 },
- /* 1989 */ { MAD_F(0x061b5cd5) /* 0.381680331 */, 16 },
- /* 1990 */ { MAD_F(0x061c6925) /* 0.381936213 */, 16 },
- /* 1991 */ { MAD_F(0x061d7581) /* 0.382192138 */, 16 },
- /* 1992 */ { MAD_F(0x061e81e8) /* 0.382448106 */, 16 },
- /* 1993 */ { MAD_F(0x061f8e5a) /* 0.382704117 */, 16 },
- /* 1994 */ { MAD_F(0x06209ad8) /* 0.382960171 */, 16 },
- /* 1995 */ { MAD_F(0x0621a761) /* 0.383216267 */, 16 },
- /* 1996 */ { MAD_F(0x0622b3f6) /* 0.383472406 */, 16 },
- /* 1997 */ { MAD_F(0x0623c096) /* 0.383728588 */, 16 },
- /* 1998 */ { MAD_F(0x0624cd42) /* 0.383984813 */, 16 },
- /* 1999 */ { MAD_F(0x0625d9f9) /* 0.384241080 */, 16 },
-
- /* 2000 */ { MAD_F(0x0626e6bc) /* 0.384497391 */, 16 },
- /* 2001 */ { MAD_F(0x0627f38a) /* 0.384753744 */, 16 },
- /* 2002 */ { MAD_F(0x06290064) /* 0.385010139 */, 16 },
- /* 2003 */ { MAD_F(0x062a0d49) /* 0.385266578 */, 16 },
- /* 2004 */ { MAD_F(0x062b1a3a) /* 0.385523059 */, 16 },
- /* 2005 */ { MAD_F(0x062c2736) /* 0.385779582 */, 16 },
- /* 2006 */ { MAD_F(0x062d343d) /* 0.386036149 */, 16 },
- /* 2007 */ { MAD_F(0x062e4150) /* 0.386292758 */, 16 },
- /* 2008 */ { MAD_F(0x062f4e6f) /* 0.386549409 */, 16 },
- /* 2009 */ { MAD_F(0x06305b99) /* 0.386806104 */, 16 },
- /* 2010 */ { MAD_F(0x063168ce) /* 0.387062840 */, 16 },
- /* 2011 */ { MAD_F(0x0632760f) /* 0.387319620 */, 16 },
- /* 2012 */ { MAD_F(0x0633835b) /* 0.387576442 */, 16 },
- /* 2013 */ { MAD_F(0x063490b2) /* 0.387833306 */, 16 },
- /* 2014 */ { MAD_F(0x06359e15) /* 0.388090213 */, 16 },
- /* 2015 */ { MAD_F(0x0636ab83) /* 0.388347163 */, 16 },
-
- /* 2016 */ { MAD_F(0x0637b8fd) /* 0.388604155 */, 16 },
- /* 2017 */ { MAD_F(0x0638c682) /* 0.388861190 */, 16 },
- /* 2018 */ { MAD_F(0x0639d413) /* 0.389118267 */, 16 },
- /* 2019 */ { MAD_F(0x063ae1af) /* 0.389375386 */, 16 },
- /* 2020 */ { MAD_F(0x063bef56) /* 0.389632548 */, 16 },
- /* 2021 */ { MAD_F(0x063cfd09) /* 0.389889752 */, 16 },
- /* 2022 */ { MAD_F(0x063e0ac7) /* 0.390146999 */, 16 },
- /* 2023 */ { MAD_F(0x063f1891) /* 0.390404289 */, 16 },
- /* 2024 */ { MAD_F(0x06402666) /* 0.390661620 */, 16 },
- /* 2025 */ { MAD_F(0x06413446) /* 0.390918994 */, 16 },
- /* 2026 */ { MAD_F(0x06424232) /* 0.391176411 */, 16 },
- /* 2027 */ { MAD_F(0x06435029) /* 0.391433869 */, 16 },
- /* 2028 */ { MAD_F(0x06445e2b) /* 0.391691371 */, 16 },
- /* 2029 */ { MAD_F(0x06456c39) /* 0.391948914 */, 16 },
- /* 2030 */ { MAD_F(0x06467a52) /* 0.392206500 */, 16 },
- /* 2031 */ { MAD_F(0x06478877) /* 0.392464128 */, 16 },
-
- /* 2032 */ { MAD_F(0x064896a7) /* 0.392721798 */, 16 },
- /* 2033 */ { MAD_F(0x0649a4e2) /* 0.392979511 */, 16 },
- /* 2034 */ { MAD_F(0x064ab328) /* 0.393237266 */, 16 },
- /* 2035 */ { MAD_F(0x064bc17a) /* 0.393495063 */, 16 },
- /* 2036 */ { MAD_F(0x064ccfd8) /* 0.393752902 */, 16 },
- /* 2037 */ { MAD_F(0x064dde40) /* 0.394010784 */, 16 },
- /* 2038 */ { MAD_F(0x064eecb4) /* 0.394268707 */, 16 },
- /* 2039 */ { MAD_F(0x064ffb33) /* 0.394526673 */, 16 },
- /* 2040 */ { MAD_F(0x065109be) /* 0.394784681 */, 16 },
- /* 2041 */ { MAD_F(0x06521854) /* 0.395042732 */, 16 },
- /* 2042 */ { MAD_F(0x065326f5) /* 0.395300824 */, 16 },
- /* 2043 */ { MAD_F(0x065435a1) /* 0.395558959 */, 16 },
- /* 2044 */ { MAD_F(0x06554459) /* 0.395817135 */, 16 },
- /* 2045 */ { MAD_F(0x0656531c) /* 0.396075354 */, 16 },
- /* 2046 */ { MAD_F(0x065761ea) /* 0.396333615 */, 16 },
- /* 2047 */ { MAD_F(0x065870c4) /* 0.396591918 */, 16 },
-
- /* 2048 */ { MAD_F(0x06597fa9) /* 0.396850263 */, 16 },
- /* 2049 */ { MAD_F(0x065a8e99) /* 0.397108650 */, 16 },
- /* 2050 */ { MAD_F(0x065b9d95) /* 0.397367079 */, 16 },
- /* 2051 */ { MAD_F(0x065cac9c) /* 0.397625550 */, 16 },
- /* 2052 */ { MAD_F(0x065dbbae) /* 0.397884063 */, 16 },
- /* 2053 */ { MAD_F(0x065ecacb) /* 0.398142619 */, 16 },
- /* 2054 */ { MAD_F(0x065fd9f4) /* 0.398401216 */, 16 },
- /* 2055 */ { MAD_F(0x0660e928) /* 0.398659855 */, 16 },
- /* 2056 */ { MAD_F(0x0661f867) /* 0.398918536 */, 16 },
- /* 2057 */ { MAD_F(0x066307b1) /* 0.399177259 */, 16 },
- /* 2058 */ { MAD_F(0x06641707) /* 0.399436024 */, 16 },
- /* 2059 */ { MAD_F(0x06652668) /* 0.399694831 */, 16 },
- /* 2060 */ { MAD_F(0x066635d4) /* 0.399953679 */, 16 },
- /* 2061 */ { MAD_F(0x0667454c) /* 0.400212570 */, 16 },
- /* 2062 */ { MAD_F(0x066854ce) /* 0.400471503 */, 16 },
- /* 2063 */ { MAD_F(0x0669645c) /* 0.400730477 */, 16 },
-
- /* 2064 */ { MAD_F(0x066a73f5) /* 0.400989493 */, 16 },
- /* 2065 */ { MAD_F(0x066b839a) /* 0.401248551 */, 16 },
- /* 2066 */ { MAD_F(0x066c9349) /* 0.401507651 */, 16 },
- /* 2067 */ { MAD_F(0x066da304) /* 0.401766793 */, 16 },
- /* 2068 */ { MAD_F(0x066eb2ca) /* 0.402025976 */, 16 },
- /* 2069 */ { MAD_F(0x066fc29b) /* 0.402285202 */, 16 },
- /* 2070 */ { MAD_F(0x0670d278) /* 0.402544469 */, 16 },
- /* 2071 */ { MAD_F(0x0671e25f) /* 0.402803777 */, 16 },
- /* 2072 */ { MAD_F(0x0672f252) /* 0.403063128 */, 16 },
- /* 2073 */ { MAD_F(0x06740250) /* 0.403322520 */, 16 },
- /* 2074 */ { MAD_F(0x0675125a) /* 0.403581954 */, 16 },
- /* 2075 */ { MAD_F(0x0676226e) /* 0.403841430 */, 16 },
- /* 2076 */ { MAD_F(0x0677328e) /* 0.404100947 */, 16 },
- /* 2077 */ { MAD_F(0x067842b9) /* 0.404360506 */, 16 },
- /* 2078 */ { MAD_F(0x067952ef) /* 0.404620107 */, 16 },
- /* 2079 */ { MAD_F(0x067a6330) /* 0.404879749 */, 16 },
-
- /* 2080 */ { MAD_F(0x067b737c) /* 0.405139433 */, 16 },
- /* 2081 */ { MAD_F(0x067c83d4) /* 0.405399159 */, 16 },
- /* 2082 */ { MAD_F(0x067d9436) /* 0.405658926 */, 16 },
- /* 2083 */ { MAD_F(0x067ea4a4) /* 0.405918735 */, 16 },
- /* 2084 */ { MAD_F(0x067fb51d) /* 0.406178585 */, 16 },
- /* 2085 */ { MAD_F(0x0680c5a2) /* 0.406438477 */, 16 },
- /* 2086 */ { MAD_F(0x0681d631) /* 0.406698410 */, 16 },
- /* 2087 */ { MAD_F(0x0682e6cb) /* 0.406958385 */, 16 },
- /* 2088 */ { MAD_F(0x0683f771) /* 0.407218402 */, 16 },
- /* 2089 */ { MAD_F(0x06850822) /* 0.407478460 */, 16 },
- /* 2090 */ { MAD_F(0x068618de) /* 0.407738559 */, 16 },
- /* 2091 */ { MAD_F(0x068729a5) /* 0.407998700 */, 16 },
- /* 2092 */ { MAD_F(0x06883a77) /* 0.408258883 */, 16 },
- /* 2093 */ { MAD_F(0x06894b55) /* 0.408519107 */, 16 },
- /* 2094 */ { MAD_F(0x068a5c3d) /* 0.408779372 */, 16 },
- /* 2095 */ { MAD_F(0x068b6d31) /* 0.409039679 */, 16 },
-
- /* 2096 */ { MAD_F(0x068c7e2f) /* 0.409300027 */, 16 },
- /* 2097 */ { MAD_F(0x068d8f39) /* 0.409560417 */, 16 },
- /* 2098 */ { MAD_F(0x068ea04e) /* 0.409820848 */, 16 },
- /* 2099 */ { MAD_F(0x068fb16e) /* 0.410081321 */, 16 },
- /* 2100 */ { MAD_F(0x0690c299) /* 0.410341834 */, 16 },
- /* 2101 */ { MAD_F(0x0691d3cf) /* 0.410602390 */, 16 },
- /* 2102 */ { MAD_F(0x0692e511) /* 0.410862986 */, 16 },
- /* 2103 */ { MAD_F(0x0693f65d) /* 0.411123624 */, 16 },
- /* 2104 */ { MAD_F(0x069507b5) /* 0.411384303 */, 16 },
- /* 2105 */ { MAD_F(0x06961917) /* 0.411645024 */, 16 },
- /* 2106 */ { MAD_F(0x06972a85) /* 0.411905785 */, 16 },
- /* 2107 */ { MAD_F(0x06983bfe) /* 0.412166588 */, 16 },
- /* 2108 */ { MAD_F(0x06994d82) /* 0.412427433 */, 16 },
- /* 2109 */ { MAD_F(0x069a5f11) /* 0.412688318 */, 16 },
- /* 2110 */ { MAD_F(0x069b70ab) /* 0.412949245 */, 16 },
- /* 2111 */ { MAD_F(0x069c8250) /* 0.413210213 */, 16 },
-
- /* 2112 */ { MAD_F(0x069d9400) /* 0.413471222 */, 16 },
- /* 2113 */ { MAD_F(0x069ea5bb) /* 0.413732273 */, 16 },
- /* 2114 */ { MAD_F(0x069fb781) /* 0.413993364 */, 16 },
- /* 2115 */ { MAD_F(0x06a0c953) /* 0.414254497 */, 16 },
- /* 2116 */ { MAD_F(0x06a1db2f) /* 0.414515671 */, 16 },
- /* 2117 */ { MAD_F(0x06a2ed16) /* 0.414776886 */, 16 },
- /* 2118 */ { MAD_F(0x06a3ff09) /* 0.415038142 */, 16 },
- /* 2119 */ { MAD_F(0x06a51106) /* 0.415299440 */, 16 },
- /* 2120 */ { MAD_F(0x06a6230f) /* 0.415560778 */, 16 },
- /* 2121 */ { MAD_F(0x06a73522) /* 0.415822157 */, 16 },
- /* 2122 */ { MAD_F(0x06a84741) /* 0.416083578 */, 16 },
- /* 2123 */ { MAD_F(0x06a9596a) /* 0.416345040 */, 16 },
- /* 2124 */ { MAD_F(0x06aa6b9f) /* 0.416606542 */, 16 },
- /* 2125 */ { MAD_F(0x06ab7ddf) /* 0.416868086 */, 16 },
- /* 2126 */ { MAD_F(0x06ac9029) /* 0.417129671 */, 16 },
- /* 2127 */ { MAD_F(0x06ada27f) /* 0.417391297 */, 16 },
-
- /* 2128 */ { MAD_F(0x06aeb4e0) /* 0.417652964 */, 16 },
- /* 2129 */ { MAD_F(0x06afc74b) /* 0.417914672 */, 16 },
- /* 2130 */ { MAD_F(0x06b0d9c2) /* 0.418176420 */, 16 },
- /* 2131 */ { MAD_F(0x06b1ec43) /* 0.418438210 */, 16 },
- /* 2132 */ { MAD_F(0x06b2fed0) /* 0.418700041 */, 16 },
- /* 2133 */ { MAD_F(0x06b41168) /* 0.418961912 */, 16 },
- /* 2134 */ { MAD_F(0x06b5240a) /* 0.419223825 */, 16 },
- /* 2135 */ { MAD_F(0x06b636b8) /* 0.419485778 */, 16 },
- /* 2136 */ { MAD_F(0x06b74971) /* 0.419747773 */, 16 },
- /* 2137 */ { MAD_F(0x06b85c34) /* 0.420009808 */, 16 },
- /* 2138 */ { MAD_F(0x06b96f03) /* 0.420271884 */, 16 },
- /* 2139 */ { MAD_F(0x06ba81dc) /* 0.420534001 */, 16 },
- /* 2140 */ { MAD_F(0x06bb94c1) /* 0.420796159 */, 16 },
- /* 2141 */ { MAD_F(0x06bca7b0) /* 0.421058358 */, 16 },
- /* 2142 */ { MAD_F(0x06bdbaaa) /* 0.421320597 */, 16 },
- /* 2143 */ { MAD_F(0x06becdb0) /* 0.421582878 */, 16 },
-
- /* 2144 */ { MAD_F(0x06bfe0c0) /* 0.421845199 */, 16 },
- /* 2145 */ { MAD_F(0x06c0f3db) /* 0.422107561 */, 16 },
- /* 2146 */ { MAD_F(0x06c20702) /* 0.422369964 */, 16 },
- /* 2147 */ { MAD_F(0x06c31a33) /* 0.422632407 */, 16 },
- /* 2148 */ { MAD_F(0x06c42d6f) /* 0.422894891 */, 16 },
- /* 2149 */ { MAD_F(0x06c540b6) /* 0.423157416 */, 16 },
- /* 2150 */ { MAD_F(0x06c65408) /* 0.423419982 */, 16 },
- /* 2151 */ { MAD_F(0x06c76765) /* 0.423682588 */, 16 },
- /* 2152 */ { MAD_F(0x06c87acc) /* 0.423945235 */, 16 },
- /* 2153 */ { MAD_F(0x06c98e3f) /* 0.424207923 */, 16 },
- /* 2154 */ { MAD_F(0x06caa1bd) /* 0.424470652 */, 16 },
- /* 2155 */ { MAD_F(0x06cbb545) /* 0.424733421 */, 16 },
- /* 2156 */ { MAD_F(0x06ccc8d9) /* 0.424996230 */, 16 },
- /* 2157 */ { MAD_F(0x06cddc77) /* 0.425259081 */, 16 },
- /* 2158 */ { MAD_F(0x06cef020) /* 0.425521972 */, 16 },
- /* 2159 */ { MAD_F(0x06d003d4) /* 0.425784903 */, 16 },
-
- /* 2160 */ { MAD_F(0x06d11794) /* 0.426047876 */, 16 },
- /* 2161 */ { MAD_F(0x06d22b5e) /* 0.426310889 */, 16 },
- /* 2162 */ { MAD_F(0x06d33f32) /* 0.426573942 */, 16 },
- /* 2163 */ { MAD_F(0x06d45312) /* 0.426837036 */, 16 },
- /* 2164 */ { MAD_F(0x06d566fd) /* 0.427100170 */, 16 },
- /* 2165 */ { MAD_F(0x06d67af2) /* 0.427363345 */, 16 },
- /* 2166 */ { MAD_F(0x06d78ef3) /* 0.427626561 */, 16 },
- /* 2167 */ { MAD_F(0x06d8a2fe) /* 0.427889817 */, 16 },
- /* 2168 */ { MAD_F(0x06d9b714) /* 0.428153114 */, 16 },
- /* 2169 */ { MAD_F(0x06dacb35) /* 0.428416451 */, 16 },
- /* 2170 */ { MAD_F(0x06dbdf61) /* 0.428679828 */, 16 },
- /* 2171 */ { MAD_F(0x06dcf398) /* 0.428943246 */, 16 },
- /* 2172 */ { MAD_F(0x06de07d9) /* 0.429206704 */, 16 },
- /* 2173 */ { MAD_F(0x06df1c26) /* 0.429470203 */, 16 },
- /* 2174 */ { MAD_F(0x06e0307d) /* 0.429733743 */, 16 },
- /* 2175 */ { MAD_F(0x06e144df) /* 0.429997322 */, 16 },
-
- /* 2176 */ { MAD_F(0x06e2594c) /* 0.430260942 */, 16 },
- /* 2177 */ { MAD_F(0x06e36dc4) /* 0.430524603 */, 16 },
- /* 2178 */ { MAD_F(0x06e48246) /* 0.430788304 */, 16 },
- /* 2179 */ { MAD_F(0x06e596d4) /* 0.431052045 */, 16 },
- /* 2180 */ { MAD_F(0x06e6ab6c) /* 0.431315826 */, 16 },
- /* 2181 */ { MAD_F(0x06e7c00f) /* 0.431579648 */, 16 },
- /* 2182 */ { MAD_F(0x06e8d4bd) /* 0.431843511 */, 16 },
- /* 2183 */ { MAD_F(0x06e9e976) /* 0.432107413 */, 16 },
- /* 2184 */ { MAD_F(0x06eafe3a) /* 0.432371356 */, 16 },
- /* 2185 */ { MAD_F(0x06ec1308) /* 0.432635339 */, 16 },
- /* 2186 */ { MAD_F(0x06ed27e2) /* 0.432899362 */, 16 },
- /* 2187 */ { MAD_F(0x06ee3cc6) /* 0.433163426 */, 16 },
- /* 2188 */ { MAD_F(0x06ef51b4) /* 0.433427530 */, 16 },
- /* 2189 */ { MAD_F(0x06f066ae) /* 0.433691674 */, 16 },
- /* 2190 */ { MAD_F(0x06f17bb3) /* 0.433955859 */, 16 },
- /* 2191 */ { MAD_F(0x06f290c2) /* 0.434220083 */, 16 },
-
- /* 2192 */ { MAD_F(0x06f3a5dc) /* 0.434484348 */, 16 },
- /* 2193 */ { MAD_F(0x06f4bb01) /* 0.434748653 */, 16 },
- /* 2194 */ { MAD_F(0x06f5d030) /* 0.435012998 */, 16 },
- /* 2195 */ { MAD_F(0x06f6e56b) /* 0.435277383 */, 16 },
- /* 2196 */ { MAD_F(0x06f7fab0) /* 0.435541809 */, 16 },
- /* 2197 */ { MAD_F(0x06f91000) /* 0.435806274 */, 16 },
- /* 2198 */ { MAD_F(0x06fa255a) /* 0.436070780 */, 16 },
- /* 2199 */ { MAD_F(0x06fb3ac0) /* 0.436335326 */, 16 },
- /* 2200 */ { MAD_F(0x06fc5030) /* 0.436599912 */, 16 },
- /* 2201 */ { MAD_F(0x06fd65ab) /* 0.436864538 */, 16 },
- /* 2202 */ { MAD_F(0x06fe7b31) /* 0.437129204 */, 16 },
- /* 2203 */ { MAD_F(0x06ff90c2) /* 0.437393910 */, 16 },
- /* 2204 */ { MAD_F(0x0700a65d) /* 0.437658657 */, 16 },
- /* 2205 */ { MAD_F(0x0701bc03) /* 0.437923443 */, 16 },
- /* 2206 */ { MAD_F(0x0702d1b4) /* 0.438188269 */, 16 },
- /* 2207 */ { MAD_F(0x0703e76f) /* 0.438453136 */, 16 },
-
- /* 2208 */ { MAD_F(0x0704fd35) /* 0.438718042 */, 16 },
- /* 2209 */ { MAD_F(0x07061306) /* 0.438982988 */, 16 },
- /* 2210 */ { MAD_F(0x070728e2) /* 0.439247975 */, 16 },
- /* 2211 */ { MAD_F(0x07083ec9) /* 0.439513001 */, 16 },
- /* 2212 */ { MAD_F(0x070954ba) /* 0.439778067 */, 16 },
- /* 2213 */ { MAD_F(0x070a6ab6) /* 0.440043173 */, 16 },
- /* 2214 */ { MAD_F(0x070b80bc) /* 0.440308320 */, 16 },
- /* 2215 */ { MAD_F(0x070c96ce) /* 0.440573506 */, 16 },
- /* 2216 */ { MAD_F(0x070dacea) /* 0.440838732 */, 16 },
- /* 2217 */ { MAD_F(0x070ec310) /* 0.441103997 */, 16 },
- /* 2218 */ { MAD_F(0x070fd942) /* 0.441369303 */, 16 },
- /* 2219 */ { MAD_F(0x0710ef7e) /* 0.441634649 */, 16 },
- /* 2220 */ { MAD_F(0x071205c5) /* 0.441900034 */, 16 },
- /* 2221 */ { MAD_F(0x07131c17) /* 0.442165460 */, 16 },
- /* 2222 */ { MAD_F(0x07143273) /* 0.442430925 */, 16 },
- /* 2223 */ { MAD_F(0x071548da) /* 0.442696430 */, 16 },
-
- /* 2224 */ { MAD_F(0x07165f4b) /* 0.442961975 */, 16 },
- /* 2225 */ { MAD_F(0x071775c8) /* 0.443227559 */, 16 },
- /* 2226 */ { MAD_F(0x07188c4f) /* 0.443493184 */, 16 },
- /* 2227 */ { MAD_F(0x0719a2e0) /* 0.443758848 */, 16 },
- /* 2228 */ { MAD_F(0x071ab97d) /* 0.444024552 */, 16 },
- /* 2229 */ { MAD_F(0x071bd024) /* 0.444290296 */, 16 },
- /* 2230 */ { MAD_F(0x071ce6d6) /* 0.444556079 */, 16 },
- /* 2231 */ { MAD_F(0x071dfd92) /* 0.444821902 */, 16 },
- /* 2232 */ { MAD_F(0x071f1459) /* 0.445087765 */, 16 },
- /* 2233 */ { MAD_F(0x07202b2b) /* 0.445353668 */, 16 },
- /* 2234 */ { MAD_F(0x07214207) /* 0.445619610 */, 16 },
- /* 2235 */ { MAD_F(0x072258ee) /* 0.445885592 */, 16 },
- /* 2236 */ { MAD_F(0x07236fe0) /* 0.446151614 */, 16 },
- /* 2237 */ { MAD_F(0x072486dc) /* 0.446417675 */, 16 },
- /* 2238 */ { MAD_F(0x07259de3) /* 0.446683776 */, 16 },
- /* 2239 */ { MAD_F(0x0726b4f4) /* 0.446949917 */, 16 },
-
- /* 2240 */ { MAD_F(0x0727cc11) /* 0.447216097 */, 16 },
- /* 2241 */ { MAD_F(0x0728e338) /* 0.447482317 */, 16 },
- /* 2242 */ { MAD_F(0x0729fa69) /* 0.447748576 */, 16 },
- /* 2243 */ { MAD_F(0x072b11a5) /* 0.448014875 */, 16 },
- /* 2244 */ { MAD_F(0x072c28ec) /* 0.448281214 */, 16 },
- /* 2245 */ { MAD_F(0x072d403d) /* 0.448547592 */, 16 },
- /* 2246 */ { MAD_F(0x072e5799) /* 0.448814010 */, 16 },
- /* 2247 */ { MAD_F(0x072f6f00) /* 0.449080467 */, 16 },
- /* 2248 */ { MAD_F(0x07308671) /* 0.449346964 */, 16 },
- /* 2249 */ { MAD_F(0x07319ded) /* 0.449613501 */, 16 },
- /* 2250 */ { MAD_F(0x0732b573) /* 0.449880076 */, 16 },
- /* 2251 */ { MAD_F(0x0733cd04) /* 0.450146692 */, 16 },
- /* 2252 */ { MAD_F(0x0734e4a0) /* 0.450413347 */, 16 },
- /* 2253 */ { MAD_F(0x0735fc46) /* 0.450680041 */, 16 },
- /* 2254 */ { MAD_F(0x073713f7) /* 0.450946775 */, 16 },
- /* 2255 */ { MAD_F(0x07382bb2) /* 0.451213548 */, 16 },
-
- /* 2256 */ { MAD_F(0x07394378) /* 0.451480360 */, 16 },
- /* 2257 */ { MAD_F(0x073a5b49) /* 0.451747213 */, 16 },
- /* 2258 */ { MAD_F(0x073b7324) /* 0.452014104 */, 16 },
- /* 2259 */ { MAD_F(0x073c8b0a) /* 0.452281035 */, 16 },
- /* 2260 */ { MAD_F(0x073da2fa) /* 0.452548005 */, 16 },
- /* 2261 */ { MAD_F(0x073ebaf5) /* 0.452815015 */, 16 },
- /* 2262 */ { MAD_F(0x073fd2fa) /* 0.453082064 */, 16 },
- /* 2263 */ { MAD_F(0x0740eb0a) /* 0.453349152 */, 16 },
- /* 2264 */ { MAD_F(0x07420325) /* 0.453616280 */, 16 },
- /* 2265 */ { MAD_F(0x07431b4a) /* 0.453883447 */, 16 },
- /* 2266 */ { MAD_F(0x0744337a) /* 0.454150653 */, 16 },
- /* 2267 */ { MAD_F(0x07454bb4) /* 0.454417899 */, 16 },
- /* 2268 */ { MAD_F(0x074663f8) /* 0.454685184 */, 16 },
- /* 2269 */ { MAD_F(0x07477c48) /* 0.454952508 */, 16 },
- /* 2270 */ { MAD_F(0x074894a2) /* 0.455219872 */, 16 },
- /* 2271 */ { MAD_F(0x0749ad06) /* 0.455487275 */, 16 },
-
- /* 2272 */ { MAD_F(0x074ac575) /* 0.455754717 */, 16 },
- /* 2273 */ { MAD_F(0x074bddee) /* 0.456022198 */, 16 },
- /* 2274 */ { MAD_F(0x074cf672) /* 0.456289719 */, 16 },
- /* 2275 */ { MAD_F(0x074e0f01) /* 0.456557278 */, 16 },
- /* 2276 */ { MAD_F(0x074f279a) /* 0.456824877 */, 16 },
- /* 2277 */ { MAD_F(0x0750403e) /* 0.457092516 */, 16 },
- /* 2278 */ { MAD_F(0x075158ec) /* 0.457360193 */, 16 },
- /* 2279 */ { MAD_F(0x075271a4) /* 0.457627909 */, 16 },
- /* 2280 */ { MAD_F(0x07538a67) /* 0.457895665 */, 16 },
- /* 2281 */ { MAD_F(0x0754a335) /* 0.458163460 */, 16 },
- /* 2282 */ { MAD_F(0x0755bc0d) /* 0.458431294 */, 16 },
- /* 2283 */ { MAD_F(0x0756d4f0) /* 0.458699167 */, 16 },
- /* 2284 */ { MAD_F(0x0757eddd) /* 0.458967079 */, 16 },
- /* 2285 */ { MAD_F(0x075906d5) /* 0.459235030 */, 16 },
- /* 2286 */ { MAD_F(0x075a1fd7) /* 0.459503021 */, 16 },
- /* 2287 */ { MAD_F(0x075b38e3) /* 0.459771050 */, 16 },
-
- /* 2288 */ { MAD_F(0x075c51fa) /* 0.460039119 */, 16 },
- /* 2289 */ { MAD_F(0x075d6b1c) /* 0.460307226 */, 16 },
- /* 2290 */ { MAD_F(0x075e8448) /* 0.460575373 */, 16 },
- /* 2291 */ { MAD_F(0x075f9d7f) /* 0.460843559 */, 16 },
- /* 2292 */ { MAD_F(0x0760b6c0) /* 0.461111783 */, 16 },
- /* 2293 */ { MAD_F(0x0761d00b) /* 0.461380047 */, 16 },
- /* 2294 */ { MAD_F(0x0762e961) /* 0.461648350 */, 16 },
- /* 2295 */ { MAD_F(0x076402c1) /* 0.461916691 */, 16 },
- /* 2296 */ { MAD_F(0x07651c2c) /* 0.462185072 */, 16 },
- /* 2297 */ { MAD_F(0x076635a2) /* 0.462453492 */, 16 },
- /* 2298 */ { MAD_F(0x07674f22) /* 0.462721950 */, 16 },
- /* 2299 */ { MAD_F(0x076868ac) /* 0.462990448 */, 16 },
- /* 2300 */ { MAD_F(0x07698240) /* 0.463258984 */, 16 },
- /* 2301 */ { MAD_F(0x076a9be0) /* 0.463527560 */, 16 },
- /* 2302 */ { MAD_F(0x076bb589) /* 0.463796174 */, 16 },
- /* 2303 */ { MAD_F(0x076ccf3d) /* 0.464064827 */, 16 },
-
- /* 2304 */ { MAD_F(0x076de8fc) /* 0.464333519 */, 16 },
- /* 2305 */ { MAD_F(0x076f02c5) /* 0.464602250 */, 16 },
- /* 2306 */ { MAD_F(0x07701c98) /* 0.464871020 */, 16 },
- /* 2307 */ { MAD_F(0x07713676) /* 0.465139829 */, 16 },
- /* 2308 */ { MAD_F(0x0772505e) /* 0.465408676 */, 16 },
- /* 2309 */ { MAD_F(0x07736a51) /* 0.465677563 */, 16 },
- /* 2310 */ { MAD_F(0x0774844e) /* 0.465946488 */, 16 },
- /* 2311 */ { MAD_F(0x07759e55) /* 0.466215452 */, 16 },
- /* 2312 */ { MAD_F(0x0776b867) /* 0.466484455 */, 16 },
- /* 2313 */ { MAD_F(0x0777d283) /* 0.466753496 */, 16 },
- /* 2314 */ { MAD_F(0x0778ecaa) /* 0.467022577 */, 16 },
- /* 2315 */ { MAD_F(0x077a06db) /* 0.467291696 */, 16 },
- /* 2316 */ { MAD_F(0x077b2117) /* 0.467560854 */, 16 },
- /* 2317 */ { MAD_F(0x077c3b5d) /* 0.467830050 */, 16 },
- /* 2318 */ { MAD_F(0x077d55ad) /* 0.468099285 */, 16 },
- /* 2319 */ { MAD_F(0x077e7008) /* 0.468368560 */, 16 },
-
- /* 2320 */ { MAD_F(0x077f8a6d) /* 0.468637872 */, 16 },
- /* 2321 */ { MAD_F(0x0780a4dc) /* 0.468907224 */, 16 },
- /* 2322 */ { MAD_F(0x0781bf56) /* 0.469176614 */, 16 },
- /* 2323 */ { MAD_F(0x0782d9da) /* 0.469446043 */, 16 },
- /* 2324 */ { MAD_F(0x0783f469) /* 0.469715510 */, 16 },
- /* 2325 */ { MAD_F(0x07850f02) /* 0.469985016 */, 16 },
- /* 2326 */ { MAD_F(0x078629a5) /* 0.470254561 */, 16 },
- /* 2327 */ { MAD_F(0x07874453) /* 0.470524145 */, 16 },
- /* 2328 */ { MAD_F(0x07885f0b) /* 0.470793767 */, 16 },
- /* 2329 */ { MAD_F(0x078979ce) /* 0.471063427 */, 16 },
- /* 2330 */ { MAD_F(0x078a949a) /* 0.471333126 */, 16 },
- /* 2331 */ { MAD_F(0x078baf72) /* 0.471602864 */, 16 },
- /* 2332 */ { MAD_F(0x078cca53) /* 0.471872641 */, 16 },
- /* 2333 */ { MAD_F(0x078de53f) /* 0.472142456 */, 16 },
- /* 2334 */ { MAD_F(0x078f0035) /* 0.472412309 */, 16 },
- /* 2335 */ { MAD_F(0x07901b36) /* 0.472682201 */, 16 },
-
- /* 2336 */ { MAD_F(0x07913641) /* 0.472952132 */, 16 },
- /* 2337 */ { MAD_F(0x07925156) /* 0.473222101 */, 16 },
- /* 2338 */ { MAD_F(0x07936c76) /* 0.473492108 */, 16 },
- /* 2339 */ { MAD_F(0x079487a0) /* 0.473762155 */, 16 },
- /* 2340 */ { MAD_F(0x0795a2d4) /* 0.474032239 */, 16 },
- /* 2341 */ { MAD_F(0x0796be13) /* 0.474302362 */, 16 },
- /* 2342 */ { MAD_F(0x0797d95c) /* 0.474572524 */, 16 },
- /* 2343 */ { MAD_F(0x0798f4af) /* 0.474842724 */, 16 },
- /* 2344 */ { MAD_F(0x079a100c) /* 0.475112962 */, 16 },
- /* 2345 */ { MAD_F(0x079b2b74) /* 0.475383239 */, 16 },
- /* 2346 */ { MAD_F(0x079c46e7) /* 0.475653554 */, 16 },
- /* 2347 */ { MAD_F(0x079d6263) /* 0.475923908 */, 16 },
- /* 2348 */ { MAD_F(0x079e7dea) /* 0.476194300 */, 16 },
- /* 2349 */ { MAD_F(0x079f997b) /* 0.476464731 */, 16 },
- /* 2350 */ { MAD_F(0x07a0b516) /* 0.476735200 */, 16 },
- /* 2351 */ { MAD_F(0x07a1d0bc) /* 0.477005707 */, 16 },
-
- /* 2352 */ { MAD_F(0x07a2ec6c) /* 0.477276252 */, 16 },
- /* 2353 */ { MAD_F(0x07a40827) /* 0.477546836 */, 16 },
- /* 2354 */ { MAD_F(0x07a523eb) /* 0.477817459 */, 16 },
- /* 2355 */ { MAD_F(0x07a63fba) /* 0.478088119 */, 16 },
- /* 2356 */ { MAD_F(0x07a75b93) /* 0.478358818 */, 16 },
- /* 2357 */ { MAD_F(0x07a87777) /* 0.478629555 */, 16 },
- /* 2358 */ { MAD_F(0x07a99364) /* 0.478900331 */, 16 },
- /* 2359 */ { MAD_F(0x07aaaf5c) /* 0.479171145 */, 16 },
- /* 2360 */ { MAD_F(0x07abcb5f) /* 0.479441997 */, 16 },
- /* 2361 */ { MAD_F(0x07ace76b) /* 0.479712887 */, 16 },
- /* 2362 */ { MAD_F(0x07ae0382) /* 0.479983816 */, 16 },
- /* 2363 */ { MAD_F(0x07af1fa3) /* 0.480254782 */, 16 },
- /* 2364 */ { MAD_F(0x07b03bcf) /* 0.480525787 */, 16 },
- /* 2365 */ { MAD_F(0x07b15804) /* 0.480796831 */, 16 },
- /* 2366 */ { MAD_F(0x07b27444) /* 0.481067912 */, 16 },
- /* 2367 */ { MAD_F(0x07b3908e) /* 0.481339032 */, 16 },
-
- /* 2368 */ { MAD_F(0x07b4ace3) /* 0.481610189 */, 16 },
- /* 2369 */ { MAD_F(0x07b5c941) /* 0.481881385 */, 16 },
- /* 2370 */ { MAD_F(0x07b6e5aa) /* 0.482152620 */, 16 },
- /* 2371 */ { MAD_F(0x07b8021d) /* 0.482423892 */, 16 },
- /* 2372 */ { MAD_F(0x07b91e9b) /* 0.482695202 */, 16 },
- /* 2373 */ { MAD_F(0x07ba3b22) /* 0.482966551 */, 16 },
- /* 2374 */ { MAD_F(0x07bb57b4) /* 0.483237938 */, 16 },
- /* 2375 */ { MAD_F(0x07bc7450) /* 0.483509362 */, 16 },
- /* 2376 */ { MAD_F(0x07bd90f6) /* 0.483780825 */, 16 },
- /* 2377 */ { MAD_F(0x07beada7) /* 0.484052326 */, 16 },
- /* 2378 */ { MAD_F(0x07bfca61) /* 0.484323865 */, 16 },
- /* 2379 */ { MAD_F(0x07c0e726) /* 0.484595443 */, 16 },
- /* 2380 */ { MAD_F(0x07c203f5) /* 0.484867058 */, 16 },
- /* 2381 */ { MAD_F(0x07c320cf) /* 0.485138711 */, 16 },
- /* 2382 */ { MAD_F(0x07c43db2) /* 0.485410402 */, 16 },
- /* 2383 */ { MAD_F(0x07c55aa0) /* 0.485682131 */, 16 },
-
- /* 2384 */ { MAD_F(0x07c67798) /* 0.485953899 */, 16 },
- /* 2385 */ { MAD_F(0x07c7949a) /* 0.486225704 */, 16 },
- /* 2386 */ { MAD_F(0x07c8b1a7) /* 0.486497547 */, 16 },
- /* 2387 */ { MAD_F(0x07c9cebd) /* 0.486769429 */, 16 },
- /* 2388 */ { MAD_F(0x07caebde) /* 0.487041348 */, 16 },
- /* 2389 */ { MAD_F(0x07cc0909) /* 0.487313305 */, 16 },
- /* 2390 */ { MAD_F(0x07cd263e) /* 0.487585300 */, 16 },
- /* 2391 */ { MAD_F(0x07ce437d) /* 0.487857333 */, 16 },
- /* 2392 */ { MAD_F(0x07cf60c7) /* 0.488129404 */, 16 },
- /* 2393 */ { MAD_F(0x07d07e1b) /* 0.488401513 */, 16 },
- /* 2394 */ { MAD_F(0x07d19b79) /* 0.488673660 */, 16 },
- /* 2395 */ { MAD_F(0x07d2b8e1) /* 0.488945845 */, 16 },
- /* 2396 */ { MAD_F(0x07d3d653) /* 0.489218067 */, 16 },
- /* 2397 */ { MAD_F(0x07d4f3cf) /* 0.489490328 */, 16 },
- /* 2398 */ { MAD_F(0x07d61156) /* 0.489762626 */, 16 },
- /* 2399 */ { MAD_F(0x07d72ee6) /* 0.490034962 */, 16 },
-
- /* 2400 */ { MAD_F(0x07d84c81) /* 0.490307336 */, 16 },
- /* 2401 */ { MAD_F(0x07d96a26) /* 0.490579748 */, 16 },
- /* 2402 */ { MAD_F(0x07da87d5) /* 0.490852198 */, 16 },
- /* 2403 */ { MAD_F(0x07dba58f) /* 0.491124686 */, 16 },
- /* 2404 */ { MAD_F(0x07dcc352) /* 0.491397211 */, 16 },
- /* 2405 */ { MAD_F(0x07dde120) /* 0.491669774 */, 16 },
- /* 2406 */ { MAD_F(0x07defef7) /* 0.491942375 */, 16 },
- /* 2407 */ { MAD_F(0x07e01cd9) /* 0.492215014 */, 16 },
- /* 2408 */ { MAD_F(0x07e13ac5) /* 0.492487690 */, 16 },
- /* 2409 */ { MAD_F(0x07e258bc) /* 0.492760404 */, 16 },
- /* 2410 */ { MAD_F(0x07e376bc) /* 0.493033156 */, 16 },
- /* 2411 */ { MAD_F(0x07e494c6) /* 0.493305946 */, 16 },
- /* 2412 */ { MAD_F(0x07e5b2db) /* 0.493578773 */, 16 },
- /* 2413 */ { MAD_F(0x07e6d0f9) /* 0.493851638 */, 16 },
- /* 2414 */ { MAD_F(0x07e7ef22) /* 0.494124541 */, 16 },
- /* 2415 */ { MAD_F(0x07e90d55) /* 0.494397481 */, 16 },
-
- /* 2416 */ { MAD_F(0x07ea2b92) /* 0.494670459 */, 16 },
- /* 2417 */ { MAD_F(0x07eb49d9) /* 0.494943475 */, 16 },
- /* 2418 */ { MAD_F(0x07ec682a) /* 0.495216529 */, 16 },
- /* 2419 */ { MAD_F(0x07ed8686) /* 0.495489620 */, 16 },
- /* 2420 */ { MAD_F(0x07eea4eb) /* 0.495762748 */, 16 },
- /* 2421 */ { MAD_F(0x07efc35b) /* 0.496035915 */, 16 },
- /* 2422 */ { MAD_F(0x07f0e1d4) /* 0.496309119 */, 16 },
- /* 2423 */ { MAD_F(0x07f20058) /* 0.496582360 */, 16 },
- /* 2424 */ { MAD_F(0x07f31ee6) /* 0.496855639 */, 16 },
- /* 2425 */ { MAD_F(0x07f43d7e) /* 0.497128956 */, 16 },
- /* 2426 */ { MAD_F(0x07f55c20) /* 0.497402310 */, 16 },
- /* 2427 */ { MAD_F(0x07f67acc) /* 0.497675702 */, 16 },
- /* 2428 */ { MAD_F(0x07f79982) /* 0.497949132 */, 16 },
- /* 2429 */ { MAD_F(0x07f8b842) /* 0.498222598 */, 16 },
- /* 2430 */ { MAD_F(0x07f9d70c) /* 0.498496103 */, 16 },
- /* 2431 */ { MAD_F(0x07faf5e1) /* 0.498769645 */, 16 },
-
- /* 2432 */ { MAD_F(0x07fc14bf) /* 0.499043224 */, 16 },
- /* 2433 */ { MAD_F(0x07fd33a8) /* 0.499316841 */, 16 },
- /* 2434 */ { MAD_F(0x07fe529a) /* 0.499590496 */, 16 },
- /* 2435 */ { MAD_F(0x07ff7197) /* 0.499864188 */, 16 },
- /* 2436 */ { MAD_F(0x0400484f) /* 0.250068959 */, 17 },
- /* 2437 */ { MAD_F(0x0400d7d7) /* 0.250205842 */, 17 },
- /* 2438 */ { MAD_F(0x04016764) /* 0.250342744 */, 17 },
- /* 2439 */ { MAD_F(0x0401f6f7) /* 0.250479665 */, 17 },
- /* 2440 */ { MAD_F(0x0402868e) /* 0.250616605 */, 17 },
- /* 2441 */ { MAD_F(0x0403162b) /* 0.250753563 */, 17 },
- /* 2442 */ { MAD_F(0x0403a5cc) /* 0.250890540 */, 17 },
- /* 2443 */ { MAD_F(0x04043573) /* 0.251027536 */, 17 },
- /* 2444 */ { MAD_F(0x0404c51e) /* 0.251164550 */, 17 },
- /* 2445 */ { MAD_F(0x040554cf) /* 0.251301583 */, 17 },
- /* 2446 */ { MAD_F(0x0405e484) /* 0.251438635 */, 17 },
- /* 2447 */ { MAD_F(0x0406743f) /* 0.251575706 */, 17 },
-
- /* 2448 */ { MAD_F(0x040703ff) /* 0.251712795 */, 17 },
- /* 2449 */ { MAD_F(0x040793c3) /* 0.251849903 */, 17 },
- /* 2450 */ { MAD_F(0x0408238d) /* 0.251987029 */, 17 },
- /* 2451 */ { MAD_F(0x0408b35b) /* 0.252124174 */, 17 },
- /* 2452 */ { MAD_F(0x0409432f) /* 0.252261338 */, 17 },
- /* 2453 */ { MAD_F(0x0409d308) /* 0.252398520 */, 17 },
- /* 2454 */ { MAD_F(0x040a62e5) /* 0.252535721 */, 17 },
- /* 2455 */ { MAD_F(0x040af2c8) /* 0.252672941 */, 17 },
- /* 2456 */ { MAD_F(0x040b82b0) /* 0.252810180 */, 17 },
- /* 2457 */ { MAD_F(0x040c129c) /* 0.252947436 */, 17 },
- /* 2458 */ { MAD_F(0x040ca28e) /* 0.253084712 */, 17 },
- /* 2459 */ { MAD_F(0x040d3284) /* 0.253222006 */, 17 },
- /* 2460 */ { MAD_F(0x040dc280) /* 0.253359319 */, 17 },
- /* 2461 */ { MAD_F(0x040e5281) /* 0.253496651 */, 17 },
- /* 2462 */ { MAD_F(0x040ee286) /* 0.253634001 */, 17 },
- /* 2463 */ { MAD_F(0x040f7291) /* 0.253771369 */, 17 },
-
- /* 2464 */ { MAD_F(0x041002a1) /* 0.253908756 */, 17 },
- /* 2465 */ { MAD_F(0x041092b5) /* 0.254046162 */, 17 },
- /* 2466 */ { MAD_F(0x041122cf) /* 0.254183587 */, 17 },
- /* 2467 */ { MAD_F(0x0411b2ed) /* 0.254321030 */, 17 },
- /* 2468 */ { MAD_F(0x04124311) /* 0.254458491 */, 17 },
- /* 2469 */ { MAD_F(0x0412d339) /* 0.254595971 */, 17 },
- /* 2470 */ { MAD_F(0x04136367) /* 0.254733470 */, 17 },
- /* 2471 */ { MAD_F(0x0413f399) /* 0.254870987 */, 17 },
- /* 2472 */ { MAD_F(0x041483d1) /* 0.255008523 */, 17 },
- /* 2473 */ { MAD_F(0x0415140d) /* 0.255146077 */, 17 },
- /* 2474 */ { MAD_F(0x0415a44f) /* 0.255283650 */, 17 },
- /* 2475 */ { MAD_F(0x04163495) /* 0.255421241 */, 17 },
- /* 2476 */ { MAD_F(0x0416c4e1) /* 0.255558851 */, 17 },
- /* 2477 */ { MAD_F(0x04175531) /* 0.255696480 */, 17 },
- /* 2478 */ { MAD_F(0x0417e586) /* 0.255834127 */, 17 },
- /* 2479 */ { MAD_F(0x041875e1) /* 0.255971792 */, 17 },
-
- /* 2480 */ { MAD_F(0x04190640) /* 0.256109476 */, 17 },
- /* 2481 */ { MAD_F(0x041996a4) /* 0.256247179 */, 17 },
- /* 2482 */ { MAD_F(0x041a270d) /* 0.256384900 */, 17 },
- /* 2483 */ { MAD_F(0x041ab77b) /* 0.256522639 */, 17 },
- /* 2484 */ { MAD_F(0x041b47ef) /* 0.256660397 */, 17 },
- /* 2485 */ { MAD_F(0x041bd867) /* 0.256798174 */, 17 },
- /* 2486 */ { MAD_F(0x041c68e4) /* 0.256935969 */, 17 },
- /* 2487 */ { MAD_F(0x041cf966) /* 0.257073782 */, 17 },
- /* 2488 */ { MAD_F(0x041d89ed) /* 0.257211614 */, 17 },
- /* 2489 */ { MAD_F(0x041e1a79) /* 0.257349465 */, 17 },
- /* 2490 */ { MAD_F(0x041eab0a) /* 0.257487334 */, 17 },
- /* 2491 */ { MAD_F(0x041f3b9f) /* 0.257625221 */, 17 },
- /* 2492 */ { MAD_F(0x041fcc3a) /* 0.257763127 */, 17 },
- /* 2493 */ { MAD_F(0x04205cda) /* 0.257901051 */, 17 },
- /* 2494 */ { MAD_F(0x0420ed7f) /* 0.258038994 */, 17 },
- /* 2495 */ { MAD_F(0x04217e28) /* 0.258176955 */, 17 },
-
- /* 2496 */ { MAD_F(0x04220ed7) /* 0.258314934 */, 17 },
- /* 2497 */ { MAD_F(0x04229f8a) /* 0.258452932 */, 17 },
- /* 2498 */ { MAD_F(0x04233043) /* 0.258590948 */, 17 },
- /* 2499 */ { MAD_F(0x0423c100) /* 0.258728983 */, 17 },
- /* 2500 */ { MAD_F(0x042451c3) /* 0.258867036 */, 17 },
- /* 2501 */ { MAD_F(0x0424e28a) /* 0.259005108 */, 17 },
- /* 2502 */ { MAD_F(0x04257356) /* 0.259143198 */, 17 },
- /* 2503 */ { MAD_F(0x04260428) /* 0.259281307 */, 17 },
- /* 2504 */ { MAD_F(0x042694fe) /* 0.259419433 */, 17 },
- /* 2505 */ { MAD_F(0x042725d9) /* 0.259557579 */, 17 },
- /* 2506 */ { MAD_F(0x0427b6b9) /* 0.259695742 */, 17 },
- /* 2507 */ { MAD_F(0x0428479e) /* 0.259833924 */, 17 },
- /* 2508 */ { MAD_F(0x0428d888) /* 0.259972124 */, 17 },
- /* 2509 */ { MAD_F(0x04296976) /* 0.260110343 */, 17 },
- /* 2510 */ { MAD_F(0x0429fa6a) /* 0.260248580 */, 17 },
- /* 2511 */ { MAD_F(0x042a8b63) /* 0.260386836 */, 17 },
-
- /* 2512 */ { MAD_F(0x042b1c60) /* 0.260525110 */, 17 },
- /* 2513 */ { MAD_F(0x042bad63) /* 0.260663402 */, 17 },
- /* 2514 */ { MAD_F(0x042c3e6a) /* 0.260801712 */, 17 },
- /* 2515 */ { MAD_F(0x042ccf77) /* 0.260940041 */, 17 },
- /* 2516 */ { MAD_F(0x042d6088) /* 0.261078388 */, 17 },
- /* 2517 */ { MAD_F(0x042df19e) /* 0.261216754 */, 17 },
- /* 2518 */ { MAD_F(0x042e82b9) /* 0.261355137 */, 17 },
- /* 2519 */ { MAD_F(0x042f13d9) /* 0.261493540 */, 17 },
- /* 2520 */ { MAD_F(0x042fa4fe) /* 0.261631960 */, 17 },
- /* 2521 */ { MAD_F(0x04303628) /* 0.261770399 */, 17 },
- /* 2522 */ { MAD_F(0x0430c757) /* 0.261908856 */, 17 },
- /* 2523 */ { MAD_F(0x0431588b) /* 0.262047331 */, 17 },
- /* 2524 */ { MAD_F(0x0431e9c3) /* 0.262185825 */, 17 },
- /* 2525 */ { MAD_F(0x04327b01) /* 0.262324337 */, 17 },
- /* 2526 */ { MAD_F(0x04330c43) /* 0.262462867 */, 17 },
- /* 2527 */ { MAD_F(0x04339d8a) /* 0.262601416 */, 17 },
-
- /* 2528 */ { MAD_F(0x04342ed7) /* 0.262739982 */, 17 },
- /* 2529 */ { MAD_F(0x0434c028) /* 0.262878568 */, 17 },
- /* 2530 */ { MAD_F(0x0435517e) /* 0.263017171 */, 17 },
- /* 2531 */ { MAD_F(0x0435e2d9) /* 0.263155792 */, 17 },
- /* 2532 */ { MAD_F(0x04367439) /* 0.263294432 */, 17 },
- /* 2533 */ { MAD_F(0x0437059e) /* 0.263433090 */, 17 },
- /* 2534 */ { MAD_F(0x04379707) /* 0.263571767 */, 17 },
- /* 2535 */ { MAD_F(0x04382876) /* 0.263710461 */, 17 },
- /* 2536 */ { MAD_F(0x0438b9e9) /* 0.263849174 */, 17 },
- /* 2537 */ { MAD_F(0x04394b61) /* 0.263987905 */, 17 },
- /* 2538 */ { MAD_F(0x0439dcdf) /* 0.264126655 */, 17 },
- /* 2539 */ { MAD_F(0x043a6e61) /* 0.264265422 */, 17 },
- /* 2540 */ { MAD_F(0x043affe8) /* 0.264404208 */, 17 },
- /* 2541 */ { MAD_F(0x043b9174) /* 0.264543012 */, 17 },
- /* 2542 */ { MAD_F(0x043c2305) /* 0.264681834 */, 17 },
- /* 2543 */ { MAD_F(0x043cb49a) /* 0.264820674 */, 17 },
-
- /* 2544 */ { MAD_F(0x043d4635) /* 0.264959533 */, 17 },
- /* 2545 */ { MAD_F(0x043dd7d4) /* 0.265098410 */, 17 },
- /* 2546 */ { MAD_F(0x043e6979) /* 0.265237305 */, 17 },
- /* 2547 */ { MAD_F(0x043efb22) /* 0.265376218 */, 17 },
- /* 2548 */ { MAD_F(0x043f8cd0) /* 0.265515149 */, 17 },
- /* 2549 */ { MAD_F(0x04401e83) /* 0.265654099 */, 17 },
- /* 2550 */ { MAD_F(0x0440b03b) /* 0.265793066 */, 17 },
- /* 2551 */ { MAD_F(0x044141f7) /* 0.265932052 */, 17 },
- /* 2552 */ { MAD_F(0x0441d3b9) /* 0.266071056 */, 17 },
- /* 2553 */ { MAD_F(0x04426580) /* 0.266210078 */, 17 },
- /* 2554 */ { MAD_F(0x0442f74b) /* 0.266349119 */, 17 },
- /* 2555 */ { MAD_F(0x0443891b) /* 0.266488177 */, 17 },
- /* 2556 */ { MAD_F(0x04441af0) /* 0.266627254 */, 17 },
- /* 2557 */ { MAD_F(0x0444acca) /* 0.266766349 */, 17 },
- /* 2558 */ { MAD_F(0x04453ea9) /* 0.266905462 */, 17 },
- /* 2559 */ { MAD_F(0x0445d08d) /* 0.267044593 */, 17 },
-
- /* 2560 */ { MAD_F(0x04466275) /* 0.267183742 */, 17 },
- /* 2561 */ { MAD_F(0x0446f463) /* 0.267322909 */, 17 },
- /* 2562 */ { MAD_F(0x04478655) /* 0.267462094 */, 17 },
- /* 2563 */ { MAD_F(0x0448184c) /* 0.267601298 */, 17 },
- /* 2564 */ { MAD_F(0x0448aa48) /* 0.267740519 */, 17 },
- /* 2565 */ { MAD_F(0x04493c49) /* 0.267879759 */, 17 },
- /* 2566 */ { MAD_F(0x0449ce4f) /* 0.268019017 */, 17 },
- /* 2567 */ { MAD_F(0x044a6059) /* 0.268158293 */, 17 },
- /* 2568 */ { MAD_F(0x044af269) /* 0.268297587 */, 17 },
- /* 2569 */ { MAD_F(0x044b847d) /* 0.268436899 */, 17 },
- /* 2570 */ { MAD_F(0x044c1696) /* 0.268576229 */, 17 },
- /* 2571 */ { MAD_F(0x044ca8b4) /* 0.268715577 */, 17 },
- /* 2572 */ { MAD_F(0x044d3ad7) /* 0.268854943 */, 17 },
- /* 2573 */ { MAD_F(0x044dccff) /* 0.268994328 */, 17 },
- /* 2574 */ { MAD_F(0x044e5f2b) /* 0.269133730 */, 17 },
- /* 2575 */ { MAD_F(0x044ef15d) /* 0.269273150 */, 17 },
-
- /* 2576 */ { MAD_F(0x044f8393) /* 0.269412589 */, 17 },
- /* 2577 */ { MAD_F(0x045015ce) /* 0.269552045 */, 17 },
- /* 2578 */ { MAD_F(0x0450a80e) /* 0.269691520 */, 17 },
- /* 2579 */ { MAD_F(0x04513a53) /* 0.269831013 */, 17 },
- /* 2580 */ { MAD_F(0x0451cc9c) /* 0.269970523 */, 17 },
- /* 2581 */ { MAD_F(0x04525eeb) /* 0.270110052 */, 17 },
- /* 2582 */ { MAD_F(0x0452f13e) /* 0.270249599 */, 17 },
- /* 2583 */ { MAD_F(0x04538396) /* 0.270389163 */, 17 },
- /* 2584 */ { MAD_F(0x045415f3) /* 0.270528746 */, 17 },
- /* 2585 */ { MAD_F(0x0454a855) /* 0.270668347 */, 17 },
- /* 2586 */ { MAD_F(0x04553abb) /* 0.270807965 */, 17 },
- /* 2587 */ { MAD_F(0x0455cd27) /* 0.270947602 */, 17 },
- /* 2588 */ { MAD_F(0x04565f97) /* 0.271087257 */, 17 },
- /* 2589 */ { MAD_F(0x0456f20c) /* 0.271226930 */, 17 },
- /* 2590 */ { MAD_F(0x04578486) /* 0.271366620 */, 17 },
- /* 2591 */ { MAD_F(0x04581705) /* 0.271506329 */, 17 },
-
- /* 2592 */ { MAD_F(0x0458a989) /* 0.271646056 */, 17 },
- /* 2593 */ { MAD_F(0x04593c11) /* 0.271785800 */, 17 },
- /* 2594 */ { MAD_F(0x0459ce9e) /* 0.271925563 */, 17 },
- /* 2595 */ { MAD_F(0x045a6130) /* 0.272065343 */, 17 },
- /* 2596 */ { MAD_F(0x045af3c7) /* 0.272205142 */, 17 },
- /* 2597 */ { MAD_F(0x045b8663) /* 0.272344958 */, 17 },
- /* 2598 */ { MAD_F(0x045c1903) /* 0.272484793 */, 17 },
- /* 2599 */ { MAD_F(0x045caba9) /* 0.272624645 */, 17 },
- /* 2600 */ { MAD_F(0x045d3e53) /* 0.272764515 */, 17 },
- /* 2601 */ { MAD_F(0x045dd102) /* 0.272904403 */, 17 },
- /* 2602 */ { MAD_F(0x045e63b6) /* 0.273044310 */, 17 },
- /* 2603 */ { MAD_F(0x045ef66e) /* 0.273184234 */, 17 },
- /* 2604 */ { MAD_F(0x045f892b) /* 0.273324176 */, 17 },
- /* 2605 */ { MAD_F(0x04601bee) /* 0.273464136 */, 17 },
- /* 2606 */ { MAD_F(0x0460aeb5) /* 0.273604113 */, 17 },
- /* 2607 */ { MAD_F(0x04614180) /* 0.273744109 */, 17 },
-
- /* 2608 */ { MAD_F(0x0461d451) /* 0.273884123 */, 17 },
- /* 2609 */ { MAD_F(0x04626727) /* 0.274024154 */, 17 },
- /* 2610 */ { MAD_F(0x0462fa01) /* 0.274164204 */, 17 },
- /* 2611 */ { MAD_F(0x04638ce0) /* 0.274304271 */, 17 },
- /* 2612 */ { MAD_F(0x04641fc4) /* 0.274444356 */, 17 },
- /* 2613 */ { MAD_F(0x0464b2ac) /* 0.274584459 */, 17 },
- /* 2614 */ { MAD_F(0x0465459a) /* 0.274724580 */, 17 },
- /* 2615 */ { MAD_F(0x0465d88c) /* 0.274864719 */, 17 },
- /* 2616 */ { MAD_F(0x04666b83) /* 0.275004875 */, 17 },
- /* 2617 */ { MAD_F(0x0466fe7f) /* 0.275145050 */, 17 },
- /* 2618 */ { MAD_F(0x0467917f) /* 0.275285242 */, 17 },
- /* 2619 */ { MAD_F(0x04682485) /* 0.275425452 */, 17 },
- /* 2620 */ { MAD_F(0x0468b78f) /* 0.275565681 */, 17 },
- /* 2621 */ { MAD_F(0x04694a9e) /* 0.275705926 */, 17 },
- /* 2622 */ { MAD_F(0x0469ddb2) /* 0.275846190 */, 17 },
- /* 2623 */ { MAD_F(0x046a70ca) /* 0.275986472 */, 17 },
-
- /* 2624 */ { MAD_F(0x046b03e7) /* 0.276126771 */, 17 },
- /* 2625 */ { MAD_F(0x046b970a) /* 0.276267088 */, 17 },
- /* 2626 */ { MAD_F(0x046c2a31) /* 0.276407423 */, 17 },
- /* 2627 */ { MAD_F(0x046cbd5c) /* 0.276547776 */, 17 },
- /* 2628 */ { MAD_F(0x046d508d) /* 0.276688147 */, 17 },
- /* 2629 */ { MAD_F(0x046de3c2) /* 0.276828535 */, 17 },
- /* 2630 */ { MAD_F(0x046e76fc) /* 0.276968942 */, 17 },
- /* 2631 */ { MAD_F(0x046f0a3b) /* 0.277109366 */, 17 },
- /* 2632 */ { MAD_F(0x046f9d7e) /* 0.277249808 */, 17 },
- /* 2633 */ { MAD_F(0x047030c7) /* 0.277390267 */, 17 },
- /* 2634 */ { MAD_F(0x0470c414) /* 0.277530745 */, 17 },
- /* 2635 */ { MAD_F(0x04715766) /* 0.277671240 */, 17 },
- /* 2636 */ { MAD_F(0x0471eabc) /* 0.277811753 */, 17 },
- /* 2637 */ { MAD_F(0x04727e18) /* 0.277952284 */, 17 },
- /* 2638 */ { MAD_F(0x04731178) /* 0.278092832 */, 17 },
- /* 2639 */ { MAD_F(0x0473a4dd) /* 0.278233399 */, 17 },
-
- /* 2640 */ { MAD_F(0x04743847) /* 0.278373983 */, 17 },
- /* 2641 */ { MAD_F(0x0474cbb5) /* 0.278514584 */, 17 },
- /* 2642 */ { MAD_F(0x04755f29) /* 0.278655204 */, 17 },
- /* 2643 */ { MAD_F(0x0475f2a1) /* 0.278795841 */, 17 },
- /* 2644 */ { MAD_F(0x0476861d) /* 0.278936496 */, 17 },
- /* 2645 */ { MAD_F(0x0477199f) /* 0.279077169 */, 17 },
- /* 2646 */ { MAD_F(0x0477ad25) /* 0.279217860 */, 17 },
- /* 2647 */ { MAD_F(0x047840b0) /* 0.279358568 */, 17 },
- /* 2648 */ { MAD_F(0x0478d440) /* 0.279499294 */, 17 },
- /* 2649 */ { MAD_F(0x047967d5) /* 0.279640037 */, 17 },
- /* 2650 */ { MAD_F(0x0479fb6e) /* 0.279780799 */, 17 },
- /* 2651 */ { MAD_F(0x047a8f0c) /* 0.279921578 */, 17 },
- /* 2652 */ { MAD_F(0x047b22af) /* 0.280062375 */, 17 },
- /* 2653 */ { MAD_F(0x047bb657) /* 0.280203189 */, 17 },
- /* 2654 */ { MAD_F(0x047c4a03) /* 0.280344021 */, 17 },
- /* 2655 */ { MAD_F(0x047cddb4) /* 0.280484871 */, 17 },
-
- /* 2656 */ { MAD_F(0x047d716a) /* 0.280625739 */, 17 },
- /* 2657 */ { MAD_F(0x047e0524) /* 0.280766624 */, 17 },
- /* 2658 */ { MAD_F(0x047e98e4) /* 0.280907527 */, 17 },
- /* 2659 */ { MAD_F(0x047f2ca8) /* 0.281048447 */, 17 },
- /* 2660 */ { MAD_F(0x047fc071) /* 0.281189385 */, 17 },
- /* 2661 */ { MAD_F(0x0480543e) /* 0.281330341 */, 17 },
- /* 2662 */ { MAD_F(0x0480e811) /* 0.281471315 */, 17 },
- /* 2663 */ { MAD_F(0x04817be8) /* 0.281612306 */, 17 },
- /* 2664 */ { MAD_F(0x04820fc3) /* 0.281753315 */, 17 },
- /* 2665 */ { MAD_F(0x0482a3a4) /* 0.281894341 */, 17 },
- /* 2666 */ { MAD_F(0x04833789) /* 0.282035386 */, 17 },
- /* 2667 */ { MAD_F(0x0483cb73) /* 0.282176447 */, 17 },
- /* 2668 */ { MAD_F(0x04845f62) /* 0.282317527 */, 17 },
- /* 2669 */ { MAD_F(0x0484f355) /* 0.282458624 */, 17 },
- /* 2670 */ { MAD_F(0x0485874d) /* 0.282599738 */, 17 },
- /* 2671 */ { MAD_F(0x04861b4a) /* 0.282740871 */, 17 },
-
- /* 2672 */ { MAD_F(0x0486af4c) /* 0.282882021 */, 17 },
- /* 2673 */ { MAD_F(0x04874352) /* 0.283023188 */, 17 },
- /* 2674 */ { MAD_F(0x0487d75d) /* 0.283164373 */, 17 },
- /* 2675 */ { MAD_F(0x04886b6d) /* 0.283305576 */, 17 },
- /* 2676 */ { MAD_F(0x0488ff82) /* 0.283446796 */, 17 },
- /* 2677 */ { MAD_F(0x0489939b) /* 0.283588034 */, 17 },
- /* 2678 */ { MAD_F(0x048a27b9) /* 0.283729290 */, 17 },
- /* 2679 */ { MAD_F(0x048abbdc) /* 0.283870563 */, 17 },
- /* 2680 */ { MAD_F(0x048b5003) /* 0.284011853 */, 17 },
- /* 2681 */ { MAD_F(0x048be42f) /* 0.284153161 */, 17 },
- /* 2682 */ { MAD_F(0x048c7860) /* 0.284294487 */, 17 },
- /* 2683 */ { MAD_F(0x048d0c96) /* 0.284435831 */, 17 },
- /* 2684 */ { MAD_F(0x048da0d0) /* 0.284577192 */, 17 },
- /* 2685 */ { MAD_F(0x048e350f) /* 0.284718570 */, 17 },
- /* 2686 */ { MAD_F(0x048ec953) /* 0.284859966 */, 17 },
- /* 2687 */ { MAD_F(0x048f5d9b) /* 0.285001380 */, 17 },
-
- /* 2688 */ { MAD_F(0x048ff1e8) /* 0.285142811 */, 17 },
- /* 2689 */ { MAD_F(0x0490863a) /* 0.285284259 */, 17 },
- /* 2690 */ { MAD_F(0x04911a91) /* 0.285425726 */, 17 },
- /* 2691 */ { MAD_F(0x0491aeec) /* 0.285567209 */, 17 },
- /* 2692 */ { MAD_F(0x0492434c) /* 0.285708711 */, 17 },
- /* 2693 */ { MAD_F(0x0492d7b0) /* 0.285850229 */, 17 },
- /* 2694 */ { MAD_F(0x04936c1a) /* 0.285991766 */, 17 },
- /* 2695 */ { MAD_F(0x04940088) /* 0.286133319 */, 17 },
- /* 2696 */ { MAD_F(0x049494fb) /* 0.286274891 */, 17 },
- /* 2697 */ { MAD_F(0x04952972) /* 0.286416480 */, 17 },
- /* 2698 */ { MAD_F(0x0495bdee) /* 0.286558086 */, 17 },
- /* 2699 */ { MAD_F(0x0496526f) /* 0.286699710 */, 17 },
- /* 2700 */ { MAD_F(0x0496e6f5) /* 0.286841351 */, 17 },
- /* 2701 */ { MAD_F(0x04977b7f) /* 0.286983010 */, 17 },
- /* 2702 */ { MAD_F(0x0498100e) /* 0.287124686 */, 17 },
- /* 2703 */ { MAD_F(0x0498a4a1) /* 0.287266380 */, 17 },
-
- /* 2704 */ { MAD_F(0x0499393a) /* 0.287408091 */, 17 },
- /* 2705 */ { MAD_F(0x0499cdd7) /* 0.287549820 */, 17 },
- /* 2706 */ { MAD_F(0x049a6278) /* 0.287691566 */, 17 },
- /* 2707 */ { MAD_F(0x049af71f) /* 0.287833330 */, 17 },
- /* 2708 */ { MAD_F(0x049b8bca) /* 0.287975111 */, 17 },
- /* 2709 */ { MAD_F(0x049c207a) /* 0.288116909 */, 17 },
- /* 2710 */ { MAD_F(0x049cb52e) /* 0.288258725 */, 17 },
- /* 2711 */ { MAD_F(0x049d49e7) /* 0.288400559 */, 17 },
- /* 2712 */ { MAD_F(0x049ddea5) /* 0.288542409 */, 17 },
- /* 2713 */ { MAD_F(0x049e7367) /* 0.288684278 */, 17 },
- /* 2714 */ { MAD_F(0x049f082f) /* 0.288826163 */, 17 },
- /* 2715 */ { MAD_F(0x049f9cfa) /* 0.288968067 */, 17 },
- /* 2716 */ { MAD_F(0x04a031cb) /* 0.289109987 */, 17 },
- /* 2717 */ { MAD_F(0x04a0c6a0) /* 0.289251925 */, 17 },
- /* 2718 */ { MAD_F(0x04a15b7a) /* 0.289393881 */, 17 },
- /* 2719 */ { MAD_F(0x04a1f059) /* 0.289535854 */, 17 },
-
- /* 2720 */ { MAD_F(0x04a2853c) /* 0.289677844 */, 17 },
- /* 2721 */ { MAD_F(0x04a31a24) /* 0.289819851 */, 17 },
- /* 2722 */ { MAD_F(0x04a3af10) /* 0.289961876 */, 17 },
- /* 2723 */ { MAD_F(0x04a44401) /* 0.290103919 */, 17 },
- /* 2724 */ { MAD_F(0x04a4d8f7) /* 0.290245979 */, 17 },
- /* 2725 */ { MAD_F(0x04a56df2) /* 0.290388056 */, 17 },
- /* 2726 */ { MAD_F(0x04a602f1) /* 0.290530150 */, 17 },
- /* 2727 */ { MAD_F(0x04a697f5) /* 0.290672262 */, 17 },
- /* 2728 */ { MAD_F(0x04a72cfe) /* 0.290814392 */, 17 },
- /* 2729 */ { MAD_F(0x04a7c20b) /* 0.290956538 */, 17 },
- /* 2730 */ { MAD_F(0x04a8571d) /* 0.291098703 */, 17 },
- /* 2731 */ { MAD_F(0x04a8ec33) /* 0.291240884 */, 17 },
- /* 2732 */ { MAD_F(0x04a9814e) /* 0.291383083 */, 17 },
- /* 2733 */ { MAD_F(0x04aa166e) /* 0.291525299 */, 17 },
- /* 2734 */ { MAD_F(0x04aaab93) /* 0.291667532 */, 17 },
- /* 2735 */ { MAD_F(0x04ab40bc) /* 0.291809783 */, 17 },
-
- /* 2736 */ { MAD_F(0x04abd5ea) /* 0.291952051 */, 17 },
- /* 2737 */ { MAD_F(0x04ac6b1c) /* 0.292094337 */, 17 },
- /* 2738 */ { MAD_F(0x04ad0053) /* 0.292236640 */, 17 },
- /* 2739 */ { MAD_F(0x04ad958f) /* 0.292378960 */, 17 },
- /* 2740 */ { MAD_F(0x04ae2ad0) /* 0.292521297 */, 17 },
- /* 2741 */ { MAD_F(0x04aec015) /* 0.292663652 */, 17 },
- /* 2742 */ { MAD_F(0x04af555e) /* 0.292806024 */, 17 },
- /* 2743 */ { MAD_F(0x04afeaad) /* 0.292948414 */, 17 },
- /* 2744 */ { MAD_F(0x04b08000) /* 0.293090820 */, 17 },
- /* 2745 */ { MAD_F(0x04b11557) /* 0.293233244 */, 17 },
- /* 2746 */ { MAD_F(0x04b1aab4) /* 0.293375686 */, 17 },
- /* 2747 */ { MAD_F(0x04b24015) /* 0.293518144 */, 17 },
- /* 2748 */ { MAD_F(0x04b2d57a) /* 0.293660620 */, 17 },
- /* 2749 */ { MAD_F(0x04b36ae4) /* 0.293803113 */, 17 },
- /* 2750 */ { MAD_F(0x04b40053) /* 0.293945624 */, 17 },
- /* 2751 */ { MAD_F(0x04b495c7) /* 0.294088151 */, 17 },
-
- /* 2752 */ { MAD_F(0x04b52b3f) /* 0.294230696 */, 17 },
- /* 2753 */ { MAD_F(0x04b5c0bc) /* 0.294373259 */, 17 },
- /* 2754 */ { MAD_F(0x04b6563d) /* 0.294515838 */, 17 },
- /* 2755 */ { MAD_F(0x04b6ebc3) /* 0.294658435 */, 17 },
- /* 2756 */ { MAD_F(0x04b7814e) /* 0.294801049 */, 17 },
- /* 2757 */ { MAD_F(0x04b816dd) /* 0.294943680 */, 17 },
- /* 2758 */ { MAD_F(0x04b8ac71) /* 0.295086329 */, 17 },
- /* 2759 */ { MAD_F(0x04b9420a) /* 0.295228995 */, 17 },
- /* 2760 */ { MAD_F(0x04b9d7a7) /* 0.295371678 */, 17 },
- /* 2761 */ { MAD_F(0x04ba6d49) /* 0.295514378 */, 17 },
- /* 2762 */ { MAD_F(0x04bb02ef) /* 0.295657095 */, 17 },
- /* 2763 */ { MAD_F(0x04bb989a) /* 0.295799830 */, 17 },
- /* 2764 */ { MAD_F(0x04bc2e4a) /* 0.295942582 */, 17 },
- /* 2765 */ { MAD_F(0x04bcc3fe) /* 0.296085351 */, 17 },
- /* 2766 */ { MAD_F(0x04bd59b7) /* 0.296228138 */, 17 },
- /* 2767 */ { MAD_F(0x04bdef74) /* 0.296370941 */, 17 },
-
- /* 2768 */ { MAD_F(0x04be8537) /* 0.296513762 */, 17 },
- /* 2769 */ { MAD_F(0x04bf1afd) /* 0.296656600 */, 17 },
- /* 2770 */ { MAD_F(0x04bfb0c9) /* 0.296799455 */, 17 },
- /* 2771 */ { MAD_F(0x04c04699) /* 0.296942327 */, 17 },
- /* 2772 */ { MAD_F(0x04c0dc6d) /* 0.297085217 */, 17 },
- /* 2773 */ { MAD_F(0x04c17247) /* 0.297228124 */, 17 },
- /* 2774 */ { MAD_F(0x04c20824) /* 0.297371048 */, 17 },
- /* 2775 */ { MAD_F(0x04c29e07) /* 0.297513989 */, 17 },
- /* 2776 */ { MAD_F(0x04c333ee) /* 0.297656947 */, 17 },
- /* 2777 */ { MAD_F(0x04c3c9da) /* 0.297799922 */, 17 },
- /* 2778 */ { MAD_F(0x04c45fca) /* 0.297942915 */, 17 },
- /* 2779 */ { MAD_F(0x04c4f5bf) /* 0.298085925 */, 17 },
- /* 2780 */ { MAD_F(0x04c58bb8) /* 0.298228951 */, 17 },
- /* 2781 */ { MAD_F(0x04c621b6) /* 0.298371996 */, 17 },
- /* 2782 */ { MAD_F(0x04c6b7b9) /* 0.298515057 */, 17 },
- /* 2783 */ { MAD_F(0x04c74dc0) /* 0.298658135 */, 17 },
-
- /* 2784 */ { MAD_F(0x04c7e3cc) /* 0.298801231 */, 17 },
- /* 2785 */ { MAD_F(0x04c879dd) /* 0.298944343 */, 17 },
- /* 2786 */ { MAD_F(0x04c90ff2) /* 0.299087473 */, 17 },
- /* 2787 */ { MAD_F(0x04c9a60c) /* 0.299230620 */, 17 },
- /* 2788 */ { MAD_F(0x04ca3c2a) /* 0.299373784 */, 17 },
- /* 2789 */ { MAD_F(0x04cad24d) /* 0.299516965 */, 17 },
- /* 2790 */ { MAD_F(0x04cb6874) /* 0.299660163 */, 17 },
- /* 2791 */ { MAD_F(0x04cbfea0) /* 0.299803378 */, 17 },
- /* 2792 */ { MAD_F(0x04cc94d1) /* 0.299946611 */, 17 },
- /* 2793 */ { MAD_F(0x04cd2b06) /* 0.300089860 */, 17 },
- /* 2794 */ { MAD_F(0x04cdc140) /* 0.300233127 */, 17 },
- /* 2795 */ { MAD_F(0x04ce577f) /* 0.300376411 */, 17 },
- /* 2796 */ { MAD_F(0x04ceedc2) /* 0.300519711 */, 17 },
- /* 2797 */ { MAD_F(0x04cf8409) /* 0.300663029 */, 17 },
- /* 2798 */ { MAD_F(0x04d01a55) /* 0.300806364 */, 17 },
- /* 2799 */ { MAD_F(0x04d0b0a6) /* 0.300949716 */, 17 },
-
- /* 2800 */ { MAD_F(0x04d146fb) /* 0.301093085 */, 17 },
- /* 2801 */ { MAD_F(0x04d1dd55) /* 0.301236472 */, 17 },
- /* 2802 */ { MAD_F(0x04d273b4) /* 0.301379875 */, 17 },
- /* 2803 */ { MAD_F(0x04d30a17) /* 0.301523295 */, 17 },
- /* 2804 */ { MAD_F(0x04d3a07f) /* 0.301666733 */, 17 },
- /* 2805 */ { MAD_F(0x04d436eb) /* 0.301810187 */, 17 },
- /* 2806 */ { MAD_F(0x04d4cd5c) /* 0.301953659 */, 17 },
- /* 2807 */ { MAD_F(0x04d563d1) /* 0.302097147 */, 17 },
- /* 2808 */ { MAD_F(0x04d5fa4b) /* 0.302240653 */, 17 },
- /* 2809 */ { MAD_F(0x04d690ca) /* 0.302384175 */, 17 },
- /* 2810 */ { MAD_F(0x04d7274d) /* 0.302527715 */, 17 },
- /* 2811 */ { MAD_F(0x04d7bdd5) /* 0.302671271 */, 17 },
- /* 2812 */ { MAD_F(0x04d85461) /* 0.302814845 */, 17 },
- /* 2813 */ { MAD_F(0x04d8eaf2) /* 0.302958436 */, 17 },
- /* 2814 */ { MAD_F(0x04d98187) /* 0.303102044 */, 17 },
- /* 2815 */ { MAD_F(0x04da1821) /* 0.303245668 */, 17 },
-
- /* 2816 */ { MAD_F(0x04daaec0) /* 0.303389310 */, 17 },
- /* 2817 */ { MAD_F(0x04db4563) /* 0.303532969 */, 17 },
- /* 2818 */ { MAD_F(0x04dbdc0a) /* 0.303676645 */, 17 },
- /* 2819 */ { MAD_F(0x04dc72b7) /* 0.303820337 */, 17 },
- /* 2820 */ { MAD_F(0x04dd0967) /* 0.303964047 */, 17 },
- /* 2821 */ { MAD_F(0x04dda01d) /* 0.304107774 */, 17 },
- /* 2822 */ { MAD_F(0x04de36d7) /* 0.304251517 */, 17 },
- /* 2823 */ { MAD_F(0x04decd95) /* 0.304395278 */, 17 },
- /* 2824 */ { MAD_F(0x04df6458) /* 0.304539056 */, 17 },
- /* 2825 */ { MAD_F(0x04dffb20) /* 0.304682850 */, 17 },
- /* 2826 */ { MAD_F(0x04e091ec) /* 0.304826662 */, 17 },
- /* 2827 */ { MAD_F(0x04e128bc) /* 0.304970491 */, 17 },
- /* 2828 */ { MAD_F(0x04e1bf92) /* 0.305114336 */, 17 },
- /* 2829 */ { MAD_F(0x04e2566b) /* 0.305258199 */, 17 },
- /* 2830 */ { MAD_F(0x04e2ed4a) /* 0.305402078 */, 17 },
- /* 2831 */ { MAD_F(0x04e3842d) /* 0.305545974 */, 17 },
-
- /* 2832 */ { MAD_F(0x04e41b14) /* 0.305689888 */, 17 },
- /* 2833 */ { MAD_F(0x04e4b200) /* 0.305833818 */, 17 },
- /* 2834 */ { MAD_F(0x04e548f1) /* 0.305977765 */, 17 },
- /* 2835 */ { MAD_F(0x04e5dfe6) /* 0.306121729 */, 17 },
- /* 2836 */ { MAD_F(0x04e676df) /* 0.306265710 */, 17 },
- /* 2837 */ { MAD_F(0x04e70dde) /* 0.306409708 */, 17 },
- /* 2838 */ { MAD_F(0x04e7a4e0) /* 0.306553723 */, 17 },
- /* 2839 */ { MAD_F(0x04e83be7) /* 0.306697755 */, 17 },
- /* 2840 */ { MAD_F(0x04e8d2f3) /* 0.306841804 */, 17 },
- /* 2841 */ { MAD_F(0x04e96a04) /* 0.306985869 */, 17 },
- /* 2842 */ { MAD_F(0x04ea0118) /* 0.307129952 */, 17 },
- /* 2843 */ { MAD_F(0x04ea9832) /* 0.307274051 */, 17 },
- /* 2844 */ { MAD_F(0x04eb2f50) /* 0.307418168 */, 17 },
- /* 2845 */ { MAD_F(0x04ebc672) /* 0.307562301 */, 17 },
- /* 2846 */ { MAD_F(0x04ec5d99) /* 0.307706451 */, 17 },
- /* 2847 */ { MAD_F(0x04ecf4c5) /* 0.307850618 */, 17 },
-
- /* 2848 */ { MAD_F(0x04ed8bf5) /* 0.307994802 */, 17 },
- /* 2849 */ { MAD_F(0x04ee2329) /* 0.308139003 */, 17 },
- /* 2850 */ { MAD_F(0x04eeba63) /* 0.308283220 */, 17 },
- /* 2851 */ { MAD_F(0x04ef51a0) /* 0.308427455 */, 17 },
- /* 2852 */ { MAD_F(0x04efe8e2) /* 0.308571706 */, 17 },
- /* 2853 */ { MAD_F(0x04f08029) /* 0.308715974 */, 17 },
- /* 2854 */ { MAD_F(0x04f11774) /* 0.308860260 */, 17 },
- /* 2855 */ { MAD_F(0x04f1aec4) /* 0.309004561 */, 17 },
- /* 2856 */ { MAD_F(0x04f24618) /* 0.309148880 */, 17 },
- /* 2857 */ { MAD_F(0x04f2dd71) /* 0.309293216 */, 17 },
- /* 2858 */ { MAD_F(0x04f374cf) /* 0.309437568 */, 17 },
- /* 2859 */ { MAD_F(0x04f40c30) /* 0.309581938 */, 17 },
- /* 2860 */ { MAD_F(0x04f4a397) /* 0.309726324 */, 17 },
- /* 2861 */ { MAD_F(0x04f53b02) /* 0.309870727 */, 17 },
- /* 2862 */ { MAD_F(0x04f5d271) /* 0.310015147 */, 17 },
- /* 2863 */ { MAD_F(0x04f669e5) /* 0.310159583 */, 17 },
-
- /* 2864 */ { MAD_F(0x04f7015d) /* 0.310304037 */, 17 },
- /* 2865 */ { MAD_F(0x04f798da) /* 0.310448507 */, 17 },
- /* 2866 */ { MAD_F(0x04f8305c) /* 0.310592994 */, 17 },
- /* 2867 */ { MAD_F(0x04f8c7e2) /* 0.310737498 */, 17 },
- /* 2868 */ { MAD_F(0x04f95f6c) /* 0.310882018 */, 17 },
- /* 2869 */ { MAD_F(0x04f9f6fb) /* 0.311026556 */, 17 },
- /* 2870 */ { MAD_F(0x04fa8e8f) /* 0.311171110 */, 17 },
- /* 2871 */ { MAD_F(0x04fb2627) /* 0.311315681 */, 17 },
- /* 2872 */ { MAD_F(0x04fbbdc3) /* 0.311460269 */, 17 },
- /* 2873 */ { MAD_F(0x04fc5564) /* 0.311604874 */, 17 },
- /* 2874 */ { MAD_F(0x04fced0a) /* 0.311749495 */, 17 },
- /* 2875 */ { MAD_F(0x04fd84b4) /* 0.311894133 */, 17 },
- /* 2876 */ { MAD_F(0x04fe1c62) /* 0.312038788 */, 17 },
- /* 2877 */ { MAD_F(0x04feb415) /* 0.312183460 */, 17 },
- /* 2878 */ { MAD_F(0x04ff4bcd) /* 0.312328148 */, 17 },
- /* 2879 */ { MAD_F(0x04ffe389) /* 0.312472854 */, 17 },
-
- /* 2880 */ { MAD_F(0x05007b49) /* 0.312617576 */, 17 },
- /* 2881 */ { MAD_F(0x0501130e) /* 0.312762314 */, 17 },
- /* 2882 */ { MAD_F(0x0501aad8) /* 0.312907070 */, 17 },
- /* 2883 */ { MAD_F(0x050242a6) /* 0.313051842 */, 17 },
- /* 2884 */ { MAD_F(0x0502da78) /* 0.313196631 */, 17 },
- /* 2885 */ { MAD_F(0x0503724f) /* 0.313341437 */, 17 },
- /* 2886 */ { MAD_F(0x05040a2b) /* 0.313486259 */, 17 },
- /* 2887 */ { MAD_F(0x0504a20b) /* 0.313631098 */, 17 },
- /* 2888 */ { MAD_F(0x050539ef) /* 0.313775954 */, 17 },
- /* 2889 */ { MAD_F(0x0505d1d8) /* 0.313920827 */, 17 },
- /* 2890 */ { MAD_F(0x050669c5) /* 0.314065716 */, 17 },
- /* 2891 */ { MAD_F(0x050701b7) /* 0.314210622 */, 17 },
- /* 2892 */ { MAD_F(0x050799ae) /* 0.314355545 */, 17 },
- /* 2893 */ { MAD_F(0x050831a9) /* 0.314500484 */, 17 },
- /* 2894 */ { MAD_F(0x0508c9a8) /* 0.314645440 */, 17 },
- /* 2895 */ { MAD_F(0x050961ac) /* 0.314790413 */, 17 },
-
- /* 2896 */ { MAD_F(0x0509f9b4) /* 0.314935403 */, 17 },
- /* 2897 */ { MAD_F(0x050a91c1) /* 0.315080409 */, 17 },
- /* 2898 */ { MAD_F(0x050b29d2) /* 0.315225432 */, 17 },
- /* 2899 */ { MAD_F(0x050bc1e8) /* 0.315370472 */, 17 },
- /* 2900 */ { MAD_F(0x050c5a02) /* 0.315515528 */, 17 },
- /* 2901 */ { MAD_F(0x050cf221) /* 0.315660601 */, 17 },
- /* 2902 */ { MAD_F(0x050d8a44) /* 0.315805690 */, 17 },
- /* 2903 */ { MAD_F(0x050e226c) /* 0.315950797 */, 17 },
- /* 2904 */ { MAD_F(0x050eba98) /* 0.316095920 */, 17 },
- /* 2905 */ { MAD_F(0x050f52c9) /* 0.316241059 */, 17 },
- /* 2906 */ { MAD_F(0x050feafe) /* 0.316386216 */, 17 },
- /* 2907 */ { MAD_F(0x05108337) /* 0.316531388 */, 17 },
- /* 2908 */ { MAD_F(0x05111b75) /* 0.316676578 */, 17 },
- /* 2909 */ { MAD_F(0x0511b3b8) /* 0.316821784 */, 17 },
- /* 2910 */ { MAD_F(0x05124bff) /* 0.316967007 */, 17 },
- /* 2911 */ { MAD_F(0x0512e44a) /* 0.317112247 */, 17 },
-
- /* 2912 */ { MAD_F(0x05137c9a) /* 0.317257503 */, 17 },
- /* 2913 */ { MAD_F(0x051414ee) /* 0.317402775 */, 17 },
- /* 2914 */ { MAD_F(0x0514ad47) /* 0.317548065 */, 17 },
- /* 2915 */ { MAD_F(0x051545a5) /* 0.317693371 */, 17 },
- /* 2916 */ { MAD_F(0x0515de06) /* 0.317838693 */, 17 },
- /* 2917 */ { MAD_F(0x0516766d) /* 0.317984033 */, 17 },
- /* 2918 */ { MAD_F(0x05170ed7) /* 0.318129388 */, 17 },
- /* 2919 */ { MAD_F(0x0517a746) /* 0.318274761 */, 17 },
- /* 2920 */ { MAD_F(0x05183fba) /* 0.318420150 */, 17 },
- /* 2921 */ { MAD_F(0x0518d832) /* 0.318565555 */, 17 },
- /* 2922 */ { MAD_F(0x051970ae) /* 0.318710978 */, 17 },
- /* 2923 */ { MAD_F(0x051a092f) /* 0.318856416 */, 17 },
- /* 2924 */ { MAD_F(0x051aa1b5) /* 0.319001872 */, 17 },
- /* 2925 */ { MAD_F(0x051b3a3f) /* 0.319147344 */, 17 },
- /* 2926 */ { MAD_F(0x051bd2cd) /* 0.319292832 */, 17 },
- /* 2927 */ { MAD_F(0x051c6b60) /* 0.319438338 */, 17 },
-
- /* 2928 */ { MAD_F(0x051d03f7) /* 0.319583859 */, 17 },
- /* 2929 */ { MAD_F(0x051d9c92) /* 0.319729398 */, 17 },
- /* 2930 */ { MAD_F(0x051e3532) /* 0.319874952 */, 17 },
- /* 2931 */ { MAD_F(0x051ecdd7) /* 0.320020524 */, 17 },
- /* 2932 */ { MAD_F(0x051f6680) /* 0.320166112 */, 17 },
- /* 2933 */ { MAD_F(0x051fff2d) /* 0.320311716 */, 17 },
- /* 2934 */ { MAD_F(0x052097df) /* 0.320457337 */, 17 },
- /* 2935 */ { MAD_F(0x05213095) /* 0.320602975 */, 17 },
- /* 2936 */ { MAD_F(0x0521c950) /* 0.320748629 */, 17 },
- /* 2937 */ { MAD_F(0x0522620f) /* 0.320894300 */, 17 },
- /* 2938 */ { MAD_F(0x0522fad3) /* 0.321039987 */, 17 },
- /* 2939 */ { MAD_F(0x0523939b) /* 0.321185691 */, 17 },
- /* 2940 */ { MAD_F(0x05242c68) /* 0.321331411 */, 17 },
- /* 2941 */ { MAD_F(0x0524c538) /* 0.321477148 */, 17 },
- /* 2942 */ { MAD_F(0x05255e0e) /* 0.321622901 */, 17 },
- /* 2943 */ { MAD_F(0x0525f6e8) /* 0.321768671 */, 17 },
-
- /* 2944 */ { MAD_F(0x05268fc6) /* 0.321914457 */, 17 },
- /* 2945 */ { MAD_F(0x052728a9) /* 0.322060260 */, 17 },
- /* 2946 */ { MAD_F(0x0527c190) /* 0.322206079 */, 17 },
- /* 2947 */ { MAD_F(0x05285a7b) /* 0.322351915 */, 17 },
- /* 2948 */ { MAD_F(0x0528f36b) /* 0.322497768 */, 17 },
- /* 2949 */ { MAD_F(0x05298c5f) /* 0.322643636 */, 17 },
- /* 2950 */ { MAD_F(0x052a2558) /* 0.322789522 */, 17 },
- /* 2951 */ { MAD_F(0x052abe55) /* 0.322935424 */, 17 },
- /* 2952 */ { MAD_F(0x052b5757) /* 0.323081342 */, 17 },
- /* 2953 */ { MAD_F(0x052bf05d) /* 0.323227277 */, 17 },
- /* 2954 */ { MAD_F(0x052c8968) /* 0.323373228 */, 17 },
- /* 2955 */ { MAD_F(0x052d2277) /* 0.323519196 */, 17 },
- /* 2956 */ { MAD_F(0x052dbb8a) /* 0.323665180 */, 17 },
- /* 2957 */ { MAD_F(0x052e54a2) /* 0.323811180 */, 17 },
- /* 2958 */ { MAD_F(0x052eedbe) /* 0.323957197 */, 17 },
- /* 2959 */ { MAD_F(0x052f86de) /* 0.324103231 */, 17 },
-
- /* 2960 */ { MAD_F(0x05302003) /* 0.324249281 */, 17 },
- /* 2961 */ { MAD_F(0x0530b92d) /* 0.324395347 */, 17 },
- /* 2962 */ { MAD_F(0x0531525b) /* 0.324541430 */, 17 },
- /* 2963 */ { MAD_F(0x0531eb8d) /* 0.324687530 */, 17 },
- /* 2964 */ { MAD_F(0x053284c4) /* 0.324833646 */, 17 },
- /* 2965 */ { MAD_F(0x05331dff) /* 0.324979778 */, 17 },
- /* 2966 */ { MAD_F(0x0533b73e) /* 0.325125926 */, 17 },
- /* 2967 */ { MAD_F(0x05345082) /* 0.325272091 */, 17 },
- /* 2968 */ { MAD_F(0x0534e9ca) /* 0.325418273 */, 17 },
- /* 2969 */ { MAD_F(0x05358317) /* 0.325564471 */, 17 },
- /* 2970 */ { MAD_F(0x05361c68) /* 0.325710685 */, 17 },
- /* 2971 */ { MAD_F(0x0536b5be) /* 0.325856916 */, 17 },
- /* 2972 */ { MAD_F(0x05374f17) /* 0.326003163 */, 17 },
- /* 2973 */ { MAD_F(0x0537e876) /* 0.326149427 */, 17 },
- /* 2974 */ { MAD_F(0x053881d9) /* 0.326295707 */, 17 },
- /* 2975 */ { MAD_F(0x05391b40) /* 0.326442003 */, 17 },
-
- /* 2976 */ { MAD_F(0x0539b4ab) /* 0.326588316 */, 17 },
- /* 2977 */ { MAD_F(0x053a4e1b) /* 0.326734645 */, 17 },
- /* 2978 */ { MAD_F(0x053ae78f) /* 0.326880990 */, 17 },
- /* 2979 */ { MAD_F(0x053b8108) /* 0.327027352 */, 17 },
- /* 2980 */ { MAD_F(0x053c1a85) /* 0.327173730 */, 17 },
- /* 2981 */ { MAD_F(0x053cb407) /* 0.327320125 */, 17 },
- /* 2982 */ { MAD_F(0x053d4d8d) /* 0.327466536 */, 17 },
- /* 2983 */ { MAD_F(0x053de717) /* 0.327612963 */, 17 },
- /* 2984 */ { MAD_F(0x053e80a6) /* 0.327759407 */, 17 },
- /* 2985 */ { MAD_F(0x053f1a39) /* 0.327905867 */, 17 },
- /* 2986 */ { MAD_F(0x053fb3d0) /* 0.328052344 */, 17 },
- /* 2987 */ { MAD_F(0x05404d6c) /* 0.328198837 */, 17 },
- /* 2988 */ { MAD_F(0x0540e70c) /* 0.328345346 */, 17 },
- /* 2989 */ { MAD_F(0x054180b1) /* 0.328491871 */, 17 },
- /* 2990 */ { MAD_F(0x05421a5a) /* 0.328638413 */, 17 },
- /* 2991 */ { MAD_F(0x0542b407) /* 0.328784971 */, 17 },
-
- /* 2992 */ { MAD_F(0x05434db9) /* 0.328931546 */, 17 },
- /* 2993 */ { MAD_F(0x0543e76f) /* 0.329078137 */, 17 },
- /* 2994 */ { MAD_F(0x0544812a) /* 0.329224744 */, 17 },
- /* 2995 */ { MAD_F(0x05451ae9) /* 0.329371367 */, 17 },
- /* 2996 */ { MAD_F(0x0545b4ac) /* 0.329518007 */, 17 },
- /* 2997 */ { MAD_F(0x05464e74) /* 0.329664663 */, 17 },
- /* 2998 */ { MAD_F(0x0546e840) /* 0.329811336 */, 17 },
- /* 2999 */ { MAD_F(0x05478211) /* 0.329958024 */, 17 },
- /* 3000 */ { MAD_F(0x05481be5) /* 0.330104730 */, 17 },
- /* 3001 */ { MAD_F(0x0548b5bf) /* 0.330251451 */, 17 },
- /* 3002 */ { MAD_F(0x05494f9c) /* 0.330398189 */, 17 },
- /* 3003 */ { MAD_F(0x0549e97e) /* 0.330544943 */, 17 },
- /* 3004 */ { MAD_F(0x054a8364) /* 0.330691713 */, 17 },
- /* 3005 */ { MAD_F(0x054b1d4f) /* 0.330838499 */, 17 },
- /* 3006 */ { MAD_F(0x054bb73e) /* 0.330985302 */, 17 },
- /* 3007 */ { MAD_F(0x054c5132) /* 0.331132121 */, 17 },
-
- /* 3008 */ { MAD_F(0x054ceb2a) /* 0.331278957 */, 17 },
- /* 3009 */ { MAD_F(0x054d8526) /* 0.331425808 */, 17 },
- /* 3010 */ { MAD_F(0x054e1f26) /* 0.331572676 */, 17 },
- /* 3011 */ { MAD_F(0x054eb92b) /* 0.331719560 */, 17 },
- /* 3012 */ { MAD_F(0x054f5334) /* 0.331866461 */, 17 },
- /* 3013 */ { MAD_F(0x054fed42) /* 0.332013377 */, 17 },
- /* 3014 */ { MAD_F(0x05508754) /* 0.332160310 */, 17 },
- /* 3015 */ { MAD_F(0x0551216b) /* 0.332307260 */, 17 },
- /* 3016 */ { MAD_F(0x0551bb85) /* 0.332454225 */, 17 },
- /* 3017 */ { MAD_F(0x055255a4) /* 0.332601207 */, 17 },
- /* 3018 */ { MAD_F(0x0552efc8) /* 0.332748205 */, 17 },
- /* 3019 */ { MAD_F(0x055389f0) /* 0.332895219 */, 17 },
- /* 3020 */ { MAD_F(0x0554241c) /* 0.333042249 */, 17 },
- /* 3021 */ { MAD_F(0x0554be4c) /* 0.333189296 */, 17 },
- /* 3022 */ { MAD_F(0x05555881) /* 0.333336359 */, 17 },
- /* 3023 */ { MAD_F(0x0555f2ba) /* 0.333483438 */, 17 },
-
- /* 3024 */ { MAD_F(0x05568cf8) /* 0.333630533 */, 17 },
- /* 3025 */ { MAD_F(0x0557273a) /* 0.333777645 */, 17 },
- /* 3026 */ { MAD_F(0x0557c180) /* 0.333924772 */, 17 },
- /* 3027 */ { MAD_F(0x05585bcb) /* 0.334071916 */, 17 },
- /* 3028 */ { MAD_F(0x0558f61a) /* 0.334219076 */, 17 },
- /* 3029 */ { MAD_F(0x0559906d) /* 0.334366253 */, 17 },
- /* 3030 */ { MAD_F(0x055a2ac5) /* 0.334513445 */, 17 },
- /* 3031 */ { MAD_F(0x055ac521) /* 0.334660654 */, 17 },
- /* 3032 */ { MAD_F(0x055b5f81) /* 0.334807879 */, 17 },
- /* 3033 */ { MAD_F(0x055bf9e6) /* 0.334955120 */, 17 },
- /* 3034 */ { MAD_F(0x055c944f) /* 0.335102377 */, 17 },
- /* 3035 */ { MAD_F(0x055d2ebd) /* 0.335249651 */, 17 },
- /* 3036 */ { MAD_F(0x055dc92e) /* 0.335396941 */, 17 },
- /* 3037 */ { MAD_F(0x055e63a5) /* 0.335544246 */, 17 },
- /* 3038 */ { MAD_F(0x055efe1f) /* 0.335691568 */, 17 },
- /* 3039 */ { MAD_F(0x055f989e) /* 0.335838906 */, 17 },
-
- /* 3040 */ { MAD_F(0x05603321) /* 0.335986261 */, 17 },
- /* 3041 */ { MAD_F(0x0560cda8) /* 0.336133631 */, 17 },
- /* 3042 */ { MAD_F(0x05616834) /* 0.336281018 */, 17 },
- /* 3043 */ { MAD_F(0x056202c4) /* 0.336428421 */, 17 },
- /* 3044 */ { MAD_F(0x05629d59) /* 0.336575840 */, 17 },
- /* 3045 */ { MAD_F(0x056337f2) /* 0.336723275 */, 17 },
- /* 3046 */ { MAD_F(0x0563d28f) /* 0.336870726 */, 17 },
- /* 3047 */ { MAD_F(0x05646d30) /* 0.337018193 */, 17 },
- /* 3048 */ { MAD_F(0x056507d6) /* 0.337165677 */, 17 },
- /* 3049 */ { MAD_F(0x0565a280) /* 0.337313176 */, 17 },
- /* 3050 */ { MAD_F(0x05663d2f) /* 0.337460692 */, 17 },
- /* 3051 */ { MAD_F(0x0566d7e1) /* 0.337608224 */, 17 },
- /* 3052 */ { MAD_F(0x05677298) /* 0.337755772 */, 17 },
- /* 3053 */ { MAD_F(0x05680d54) /* 0.337903336 */, 17 },
- /* 3054 */ { MAD_F(0x0568a814) /* 0.338050916 */, 17 },
- /* 3055 */ { MAD_F(0x056942d8) /* 0.338198513 */, 17 },
-
- /* 3056 */ { MAD_F(0x0569dda0) /* 0.338346125 */, 17 },
- /* 3057 */ { MAD_F(0x056a786d) /* 0.338493753 */, 17 },
- /* 3058 */ { MAD_F(0x056b133e) /* 0.338641398 */, 17 },
- /* 3059 */ { MAD_F(0x056bae13) /* 0.338789059 */, 17 },
- /* 3060 */ { MAD_F(0x056c48ed) /* 0.338936736 */, 17 },
- /* 3061 */ { MAD_F(0x056ce3cb) /* 0.339084429 */, 17 },
- /* 3062 */ { MAD_F(0x056d7ead) /* 0.339232138 */, 17 },
- /* 3063 */ { MAD_F(0x056e1994) /* 0.339379863 */, 17 },
- /* 3064 */ { MAD_F(0x056eb47f) /* 0.339527604 */, 17 },
- /* 3065 */ { MAD_F(0x056f4f6e) /* 0.339675361 */, 17 },
- /* 3066 */ { MAD_F(0x056fea62) /* 0.339823134 */, 17 },
- /* 3067 */ { MAD_F(0x0570855a) /* 0.339970924 */, 17 },
- /* 3068 */ { MAD_F(0x05712056) /* 0.340118729 */, 17 },
- /* 3069 */ { MAD_F(0x0571bb56) /* 0.340266550 */, 17 },
- /* 3070 */ { MAD_F(0x0572565b) /* 0.340414388 */, 17 },
- /* 3071 */ { MAD_F(0x0572f164) /* 0.340562242 */, 17 },
-
- /* 3072 */ { MAD_F(0x05738c72) /* 0.340710111 */, 17 },
- /* 3073 */ { MAD_F(0x05742784) /* 0.340857997 */, 17 },
- /* 3074 */ { MAD_F(0x0574c29a) /* 0.341005899 */, 17 },
- /* 3075 */ { MAD_F(0x05755db4) /* 0.341153816 */, 17 },
- /* 3076 */ { MAD_F(0x0575f8d3) /* 0.341301750 */, 17 },
- /* 3077 */ { MAD_F(0x057693f6) /* 0.341449700 */, 17 },
- /* 3078 */ { MAD_F(0x05772f1d) /* 0.341597666 */, 17 },
- /* 3079 */ { MAD_F(0x0577ca49) /* 0.341745648 */, 17 },
- /* 3080 */ { MAD_F(0x05786578) /* 0.341893646 */, 17 },
- /* 3081 */ { MAD_F(0x057900ad) /* 0.342041659 */, 17 },
- /* 3082 */ { MAD_F(0x05799be5) /* 0.342189689 */, 17 },
- /* 3083 */ { MAD_F(0x057a3722) /* 0.342337735 */, 17 },
- /* 3084 */ { MAD_F(0x057ad263) /* 0.342485797 */, 17 },
- /* 3085 */ { MAD_F(0x057b6da8) /* 0.342633875 */, 17 },
- /* 3086 */ { MAD_F(0x057c08f2) /* 0.342781969 */, 17 },
- /* 3087 */ { MAD_F(0x057ca440) /* 0.342930079 */, 17 },
-
- /* 3088 */ { MAD_F(0x057d3f92) /* 0.343078205 */, 17 },
- /* 3089 */ { MAD_F(0x057ddae9) /* 0.343226347 */, 17 },
- /* 3090 */ { MAD_F(0x057e7644) /* 0.343374505 */, 17 },
- /* 3091 */ { MAD_F(0x057f11a3) /* 0.343522679 */, 17 },
- /* 3092 */ { MAD_F(0x057fad06) /* 0.343670869 */, 17 },
- /* 3093 */ { MAD_F(0x0580486e) /* 0.343819075 */, 17 },
- /* 3094 */ { MAD_F(0x0580e3da) /* 0.343967296 */, 17 },
- /* 3095 */ { MAD_F(0x05817f4a) /* 0.344115534 */, 17 },
- /* 3096 */ { MAD_F(0x05821abf) /* 0.344263788 */, 17 },
- /* 3097 */ { MAD_F(0x0582b638) /* 0.344412058 */, 17 },
- /* 3098 */ { MAD_F(0x058351b5) /* 0.344560343 */, 17 },
- /* 3099 */ { MAD_F(0x0583ed36) /* 0.344708645 */, 17 },
- /* 3100 */ { MAD_F(0x058488bc) /* 0.344856963 */, 17 },
- /* 3101 */ { MAD_F(0x05852446) /* 0.345005296 */, 17 },
- /* 3102 */ { MAD_F(0x0585bfd4) /* 0.345153646 */, 17 },
- /* 3103 */ { MAD_F(0x05865b67) /* 0.345302011 */, 17 },
-
- /* 3104 */ { MAD_F(0x0586f6fd) /* 0.345450393 */, 17 },
- /* 3105 */ { MAD_F(0x05879298) /* 0.345598790 */, 17 },
- /* 3106 */ { MAD_F(0x05882e38) /* 0.345747203 */, 17 },
- /* 3107 */ { MAD_F(0x0588c9dc) /* 0.345895632 */, 17 },
- /* 3108 */ { MAD_F(0x05896583) /* 0.346044077 */, 17 },
- /* 3109 */ { MAD_F(0x058a0130) /* 0.346192538 */, 17 },
- /* 3110 */ { MAD_F(0x058a9ce0) /* 0.346341015 */, 17 },
- /* 3111 */ { MAD_F(0x058b3895) /* 0.346489508 */, 17 },
- /* 3112 */ { MAD_F(0x058bd44e) /* 0.346638017 */, 17 },
- /* 3113 */ { MAD_F(0x058c700b) /* 0.346786542 */, 17 },
- /* 3114 */ { MAD_F(0x058d0bcd) /* 0.346935082 */, 17 },
- /* 3115 */ { MAD_F(0x058da793) /* 0.347083639 */, 17 },
- /* 3116 */ { MAD_F(0x058e435d) /* 0.347232211 */, 17 },
- /* 3117 */ { MAD_F(0x058edf2b) /* 0.347380799 */, 17 },
- /* 3118 */ { MAD_F(0x058f7afe) /* 0.347529403 */, 17 },
- /* 3119 */ { MAD_F(0x059016d5) /* 0.347678023 */, 17 },
-
- /* 3120 */ { MAD_F(0x0590b2b0) /* 0.347826659 */, 17 },
- /* 3121 */ { MAD_F(0x05914e8f) /* 0.347975311 */, 17 },
- /* 3122 */ { MAD_F(0x0591ea73) /* 0.348123979 */, 17 },
- /* 3123 */ { MAD_F(0x0592865b) /* 0.348272662 */, 17 },
- /* 3124 */ { MAD_F(0x05932247) /* 0.348421362 */, 17 },
- /* 3125 */ { MAD_F(0x0593be37) /* 0.348570077 */, 17 },
- /* 3126 */ { MAD_F(0x05945a2c) /* 0.348718808 */, 17 },
- /* 3127 */ { MAD_F(0x0594f625) /* 0.348867555 */, 17 },
- /* 3128 */ { MAD_F(0x05959222) /* 0.349016318 */, 17 },
- /* 3129 */ { MAD_F(0x05962e24) /* 0.349165097 */, 17 },
- /* 3130 */ { MAD_F(0x0596ca2a) /* 0.349313892 */, 17 },
- /* 3131 */ { MAD_F(0x05976634) /* 0.349462702 */, 17 },
- /* 3132 */ { MAD_F(0x05980242) /* 0.349611528 */, 17 },
- /* 3133 */ { MAD_F(0x05989e54) /* 0.349760370 */, 17 },
- /* 3134 */ { MAD_F(0x05993a6b) /* 0.349909228 */, 17 },
- /* 3135 */ { MAD_F(0x0599d686) /* 0.350058102 */, 17 },
-
- /* 3136 */ { MAD_F(0x059a72a5) /* 0.350206992 */, 17 },
- /* 3137 */ { MAD_F(0x059b0ec9) /* 0.350355897 */, 17 },
- /* 3138 */ { MAD_F(0x059baaf1) /* 0.350504818 */, 17 },
- /* 3139 */ { MAD_F(0x059c471d) /* 0.350653756 */, 17 },
- /* 3140 */ { MAD_F(0x059ce34d) /* 0.350802708 */, 17 },
- /* 3141 */ { MAD_F(0x059d7f81) /* 0.350951677 */, 17 },
- /* 3142 */ { MAD_F(0x059e1bba) /* 0.351100662 */, 17 },
- /* 3143 */ { MAD_F(0x059eb7f7) /* 0.351249662 */, 17 },
- /* 3144 */ { MAD_F(0x059f5438) /* 0.351398678 */, 17 },
- /* 3145 */ { MAD_F(0x059ff07e) /* 0.351547710 */, 17 },
- /* 3146 */ { MAD_F(0x05a08cc7) /* 0.351696758 */, 17 },
- /* 3147 */ { MAD_F(0x05a12915) /* 0.351845821 */, 17 },
- /* 3148 */ { MAD_F(0x05a1c567) /* 0.351994901 */, 17 },
- /* 3149 */ { MAD_F(0x05a261be) /* 0.352143996 */, 17 },
- /* 3150 */ { MAD_F(0x05a2fe18) /* 0.352293107 */, 17 },
- /* 3151 */ { MAD_F(0x05a39a77) /* 0.352442233 */, 17 },
-
- /* 3152 */ { MAD_F(0x05a436da) /* 0.352591376 */, 17 },
- /* 3153 */ { MAD_F(0x05a4d342) /* 0.352740534 */, 17 },
- /* 3154 */ { MAD_F(0x05a56fad) /* 0.352889708 */, 17 },
- /* 3155 */ { MAD_F(0x05a60c1d) /* 0.353038898 */, 17 },
- /* 3156 */ { MAD_F(0x05a6a891) /* 0.353188103 */, 17 },
- /* 3157 */ { MAD_F(0x05a7450a) /* 0.353337325 */, 17 },
- /* 3158 */ { MAD_F(0x05a7e186) /* 0.353486562 */, 17 },
- /* 3159 */ { MAD_F(0x05a87e07) /* 0.353635814 */, 17 },
- /* 3160 */ { MAD_F(0x05a91a8c) /* 0.353785083 */, 17 },
- /* 3161 */ { MAD_F(0x05a9b715) /* 0.353934367 */, 17 },
- /* 3162 */ { MAD_F(0x05aa53a2) /* 0.354083667 */, 17 },
- /* 3163 */ { MAD_F(0x05aaf034) /* 0.354232983 */, 17 },
- /* 3164 */ { MAD_F(0x05ab8cca) /* 0.354382314 */, 17 },
- /* 3165 */ { MAD_F(0x05ac2964) /* 0.354531662 */, 17 },
- /* 3166 */ { MAD_F(0x05acc602) /* 0.354681025 */, 17 },
- /* 3167 */ { MAD_F(0x05ad62a5) /* 0.354830403 */, 17 },
-
- /* 3168 */ { MAD_F(0x05adff4c) /* 0.354979798 */, 17 },
- /* 3169 */ { MAD_F(0x05ae9bf7) /* 0.355129208 */, 17 },
- /* 3170 */ { MAD_F(0x05af38a6) /* 0.355278634 */, 17 },
- /* 3171 */ { MAD_F(0x05afd559) /* 0.355428075 */, 17 },
- /* 3172 */ { MAD_F(0x05b07211) /* 0.355577533 */, 17 },
- /* 3173 */ { MAD_F(0x05b10ecd) /* 0.355727006 */, 17 },
- /* 3174 */ { MAD_F(0x05b1ab8d) /* 0.355876494 */, 17 },
- /* 3175 */ { MAD_F(0x05b24851) /* 0.356025999 */, 17 },
- /* 3176 */ { MAD_F(0x05b2e51a) /* 0.356175519 */, 17 },
- /* 3177 */ { MAD_F(0x05b381e6) /* 0.356325054 */, 17 },
- /* 3178 */ { MAD_F(0x05b41eb7) /* 0.356474606 */, 17 },
- /* 3179 */ { MAD_F(0x05b4bb8c) /* 0.356624173 */, 17 },
- /* 3180 */ { MAD_F(0x05b55866) /* 0.356773756 */, 17 },
- /* 3181 */ { MAD_F(0x05b5f543) /* 0.356923354 */, 17 },
- /* 3182 */ { MAD_F(0x05b69225) /* 0.357072969 */, 17 },
- /* 3183 */ { MAD_F(0x05b72f0b) /* 0.357222598 */, 17 },
-
- /* 3184 */ { MAD_F(0x05b7cbf5) /* 0.357372244 */, 17 },
- /* 3185 */ { MAD_F(0x05b868e3) /* 0.357521905 */, 17 },
- /* 3186 */ { MAD_F(0x05b905d6) /* 0.357671582 */, 17 },
- /* 3187 */ { MAD_F(0x05b9a2cd) /* 0.357821275 */, 17 },
- /* 3188 */ { MAD_F(0x05ba3fc8) /* 0.357970983 */, 17 },
- /* 3189 */ { MAD_F(0x05badcc7) /* 0.358120707 */, 17 },
- /* 3190 */ { MAD_F(0x05bb79ca) /* 0.358270446 */, 17 },
- /* 3191 */ { MAD_F(0x05bc16d2) /* 0.358420201 */, 17 },
- /* 3192 */ { MAD_F(0x05bcb3de) /* 0.358569972 */, 17 },
- /* 3193 */ { MAD_F(0x05bd50ee) /* 0.358719758 */, 17 },
- /* 3194 */ { MAD_F(0x05bdee02) /* 0.358869560 */, 17 },
- /* 3195 */ { MAD_F(0x05be8b1a) /* 0.359019378 */, 17 },
- /* 3196 */ { MAD_F(0x05bf2837) /* 0.359169211 */, 17 },
- /* 3197 */ { MAD_F(0x05bfc558) /* 0.359319060 */, 17 },
- /* 3198 */ { MAD_F(0x05c0627d) /* 0.359468925 */, 17 },
- /* 3199 */ { MAD_F(0x05c0ffa6) /* 0.359618805 */, 17 },
-
- /* 3200 */ { MAD_F(0x05c19cd3) /* 0.359768701 */, 17 },
- /* 3201 */ { MAD_F(0x05c23a05) /* 0.359918612 */, 17 },
- /* 3202 */ { MAD_F(0x05c2d73a) /* 0.360068540 */, 17 },
- /* 3203 */ { MAD_F(0x05c37474) /* 0.360218482 */, 17 },
- /* 3204 */ { MAD_F(0x05c411b2) /* 0.360368440 */, 17 },
- /* 3205 */ { MAD_F(0x05c4aef5) /* 0.360518414 */, 17 },
- /* 3206 */ { MAD_F(0x05c54c3b) /* 0.360668404 */, 17 },
- /* 3207 */ { MAD_F(0x05c5e986) /* 0.360818409 */, 17 },
- /* 3208 */ { MAD_F(0x05c686d5) /* 0.360968429 */, 17 },
- /* 3209 */ { MAD_F(0x05c72428) /* 0.361118466 */, 17 },
- /* 3210 */ { MAD_F(0x05c7c17f) /* 0.361268517 */, 17 },
- /* 3211 */ { MAD_F(0x05c85eda) /* 0.361418585 */, 17 },
- /* 3212 */ { MAD_F(0x05c8fc3a) /* 0.361568668 */, 17 },
- /* 3213 */ { MAD_F(0x05c9999e) /* 0.361718766 */, 17 },
- /* 3214 */ { MAD_F(0x05ca3706) /* 0.361868881 */, 17 },
- /* 3215 */ { MAD_F(0x05cad472) /* 0.362019010 */, 17 },
-
- /* 3216 */ { MAD_F(0x05cb71e2) /* 0.362169156 */, 17 },
- /* 3217 */ { MAD_F(0x05cc0f57) /* 0.362319316 */, 17 },
- /* 3218 */ { MAD_F(0x05ccaccf) /* 0.362469493 */, 17 },
- /* 3219 */ { MAD_F(0x05cd4a4c) /* 0.362619685 */, 17 },
- /* 3220 */ { MAD_F(0x05cde7cd) /* 0.362769892 */, 17 },
- /* 3221 */ { MAD_F(0x05ce8552) /* 0.362920115 */, 17 },
- /* 3222 */ { MAD_F(0x05cf22dc) /* 0.363070354 */, 17 },
- /* 3223 */ { MAD_F(0x05cfc069) /* 0.363220608 */, 17 },
- /* 3224 */ { MAD_F(0x05d05dfb) /* 0.363370878 */, 17 },
- /* 3225 */ { MAD_F(0x05d0fb91) /* 0.363521163 */, 17 },
- /* 3226 */ { MAD_F(0x05d1992b) /* 0.363671464 */, 17 },
- /* 3227 */ { MAD_F(0x05d236c9) /* 0.363821780 */, 17 },
- /* 3228 */ { MAD_F(0x05d2d46c) /* 0.363972112 */, 17 },
- /* 3229 */ { MAD_F(0x05d37212) /* 0.364122459 */, 17 },
- /* 3230 */ { MAD_F(0x05d40fbd) /* 0.364272822 */, 17 },
- /* 3231 */ { MAD_F(0x05d4ad6c) /* 0.364423200 */, 17 },
-
- /* 3232 */ { MAD_F(0x05d54b1f) /* 0.364573594 */, 17 },
- /* 3233 */ { MAD_F(0x05d5e8d6) /* 0.364724004 */, 17 },
- /* 3234 */ { MAD_F(0x05d68691) /* 0.364874429 */, 17 },
- /* 3235 */ { MAD_F(0x05d72451) /* 0.365024869 */, 17 },
- /* 3236 */ { MAD_F(0x05d7c215) /* 0.365175325 */, 17 },
- /* 3237 */ { MAD_F(0x05d85fdc) /* 0.365325796 */, 17 },
- /* 3238 */ { MAD_F(0x05d8fda8) /* 0.365476283 */, 17 },
- /* 3239 */ { MAD_F(0x05d99b79) /* 0.365626786 */, 17 },
- /* 3240 */ { MAD_F(0x05da394d) /* 0.365777304 */, 17 },
- /* 3241 */ { MAD_F(0x05dad726) /* 0.365927837 */, 17 },
- /* 3242 */ { MAD_F(0x05db7502) /* 0.366078386 */, 17 },
- /* 3243 */ { MAD_F(0x05dc12e3) /* 0.366228950 */, 17 },
- /* 3244 */ { MAD_F(0x05dcb0c8) /* 0.366379530 */, 17 },
- /* 3245 */ { MAD_F(0x05dd4eb1) /* 0.366530125 */, 17 },
- /* 3246 */ { MAD_F(0x05ddec9e) /* 0.366680736 */, 17 },
- /* 3247 */ { MAD_F(0x05de8a90) /* 0.366831362 */, 17 },
-
- /* 3248 */ { MAD_F(0x05df2885) /* 0.366982004 */, 17 },
- /* 3249 */ { MAD_F(0x05dfc67f) /* 0.367132661 */, 17 },
- /* 3250 */ { MAD_F(0x05e0647d) /* 0.367283334 */, 17 },
- /* 3251 */ { MAD_F(0x05e1027f) /* 0.367434022 */, 17 },
- /* 3252 */ { MAD_F(0x05e1a085) /* 0.367584725 */, 17 },
- /* 3253 */ { MAD_F(0x05e23e8f) /* 0.367735444 */, 17 },
- /* 3254 */ { MAD_F(0x05e2dc9e) /* 0.367886179 */, 17 },
- /* 3255 */ { MAD_F(0x05e37ab0) /* 0.368036929 */, 17 },
- /* 3256 */ { MAD_F(0x05e418c7) /* 0.368187694 */, 17 },
- /* 3257 */ { MAD_F(0x05e4b6e2) /* 0.368338475 */, 17 },
- /* 3258 */ { MAD_F(0x05e55501) /* 0.368489271 */, 17 },
- /* 3259 */ { MAD_F(0x05e5f324) /* 0.368640082 */, 17 },
- /* 3260 */ { MAD_F(0x05e6914c) /* 0.368790909 */, 17 },
- /* 3261 */ { MAD_F(0x05e72f77) /* 0.368941752 */, 17 },
- /* 3262 */ { MAD_F(0x05e7cda7) /* 0.369092610 */, 17 },
- /* 3263 */ { MAD_F(0x05e86bda) /* 0.369243483 */, 17 },
-
- /* 3264 */ { MAD_F(0x05e90a12) /* 0.369394372 */, 17 },
- /* 3265 */ { MAD_F(0x05e9a84e) /* 0.369545276 */, 17 },
- /* 3266 */ { MAD_F(0x05ea468e) /* 0.369696195 */, 17 },
- /* 3267 */ { MAD_F(0x05eae4d3) /* 0.369847130 */, 17 },
- /* 3268 */ { MAD_F(0x05eb831b) /* 0.369998080 */, 17 },
- /* 3269 */ { MAD_F(0x05ec2168) /* 0.370149046 */, 17 },
- /* 3270 */ { MAD_F(0x05ecbfb8) /* 0.370300027 */, 17 },
- /* 3271 */ { MAD_F(0x05ed5e0d) /* 0.370451024 */, 17 },
- /* 3272 */ { MAD_F(0x05edfc66) /* 0.370602036 */, 17 },
- /* 3273 */ { MAD_F(0x05ee9ac3) /* 0.370753063 */, 17 },
- /* 3274 */ { MAD_F(0x05ef3924) /* 0.370904105 */, 17 },
- /* 3275 */ { MAD_F(0x05efd78a) /* 0.371055163 */, 17 },
- /* 3276 */ { MAD_F(0x05f075f3) /* 0.371206237 */, 17 },
- /* 3277 */ { MAD_F(0x05f11461) /* 0.371357326 */, 17 },
- /* 3278 */ { MAD_F(0x05f1b2d3) /* 0.371508430 */, 17 },
- /* 3279 */ { MAD_F(0x05f25148) /* 0.371659549 */, 17 },
-
- /* 3280 */ { MAD_F(0x05f2efc2) /* 0.371810684 */, 17 },
- /* 3281 */ { MAD_F(0x05f38e40) /* 0.371961834 */, 17 },
- /* 3282 */ { MAD_F(0x05f42cc3) /* 0.372113000 */, 17 },
- /* 3283 */ { MAD_F(0x05f4cb49) /* 0.372264181 */, 17 },
- /* 3284 */ { MAD_F(0x05f569d3) /* 0.372415377 */, 17 },
- /* 3285 */ { MAD_F(0x05f60862) /* 0.372566589 */, 17 },
- /* 3286 */ { MAD_F(0x05f6a6f5) /* 0.372717816 */, 17 },
- /* 3287 */ { MAD_F(0x05f7458b) /* 0.372869058 */, 17 },
- /* 3288 */ { MAD_F(0x05f7e426) /* 0.373020316 */, 17 },
- /* 3289 */ { MAD_F(0x05f882c5) /* 0.373171589 */, 17 },
- /* 3290 */ { MAD_F(0x05f92169) /* 0.373322877 */, 17 },
- /* 3291 */ { MAD_F(0x05f9c010) /* 0.373474181 */, 17 },
- /* 3292 */ { MAD_F(0x05fa5ebb) /* 0.373625500 */, 17 },
- /* 3293 */ { MAD_F(0x05fafd6b) /* 0.373776834 */, 17 },
- /* 3294 */ { MAD_F(0x05fb9c1e) /* 0.373928184 */, 17 },
- /* 3295 */ { MAD_F(0x05fc3ad6) /* 0.374079549 */, 17 },
-
- /* 3296 */ { MAD_F(0x05fcd992) /* 0.374230929 */, 17 },
- /* 3297 */ { MAD_F(0x05fd7852) /* 0.374382325 */, 17 },
- /* 3298 */ { MAD_F(0x05fe1716) /* 0.374533735 */, 17 },
- /* 3299 */ { MAD_F(0x05feb5de) /* 0.374685162 */, 17 },
- /* 3300 */ { MAD_F(0x05ff54aa) /* 0.374836603 */, 17 },
- /* 3301 */ { MAD_F(0x05fff37b) /* 0.374988060 */, 17 },
- /* 3302 */ { MAD_F(0x0600924f) /* 0.375139532 */, 17 },
- /* 3303 */ { MAD_F(0x06013128) /* 0.375291019 */, 17 },
- /* 3304 */ { MAD_F(0x0601d004) /* 0.375442522 */, 17 },
- /* 3305 */ { MAD_F(0x06026ee5) /* 0.375594040 */, 17 },
- /* 3306 */ { MAD_F(0x06030dca) /* 0.375745573 */, 17 },
- /* 3307 */ { MAD_F(0x0603acb3) /* 0.375897122 */, 17 },
- /* 3308 */ { MAD_F(0x06044ba0) /* 0.376048685 */, 17 },
- /* 3309 */ { MAD_F(0x0604ea91) /* 0.376200265 */, 17 },
- /* 3310 */ { MAD_F(0x06058987) /* 0.376351859 */, 17 },
- /* 3311 */ { MAD_F(0x06062880) /* 0.376503468 */, 17 },
-
- /* 3312 */ { MAD_F(0x0606c77d) /* 0.376655093 */, 17 },
- /* 3313 */ { MAD_F(0x0607667f) /* 0.376806733 */, 17 },
- /* 3314 */ { MAD_F(0x06080585) /* 0.376958389 */, 17 },
- /* 3315 */ { MAD_F(0x0608a48f) /* 0.377110059 */, 17 },
- /* 3316 */ { MAD_F(0x0609439c) /* 0.377261745 */, 17 },
- /* 3317 */ { MAD_F(0x0609e2ae) /* 0.377413446 */, 17 },
- /* 3318 */ { MAD_F(0x060a81c4) /* 0.377565163 */, 17 },
- /* 3319 */ { MAD_F(0x060b20df) /* 0.377716894 */, 17 },
- /* 3320 */ { MAD_F(0x060bbffd) /* 0.377868641 */, 17 },
- /* 3321 */ { MAD_F(0x060c5f1f) /* 0.378020403 */, 17 },
- /* 3322 */ { MAD_F(0x060cfe46) /* 0.378172181 */, 17 },
- /* 3323 */ { MAD_F(0x060d9d70) /* 0.378323973 */, 17 },
- /* 3324 */ { MAD_F(0x060e3c9f) /* 0.378475781 */, 17 },
- /* 3325 */ { MAD_F(0x060edbd1) /* 0.378627604 */, 17 },
- /* 3326 */ { MAD_F(0x060f7b08) /* 0.378779442 */, 17 },
- /* 3327 */ { MAD_F(0x06101a43) /* 0.378931296 */, 17 },
-
- /* 3328 */ { MAD_F(0x0610b982) /* 0.379083164 */, 17 },
- /* 3329 */ { MAD_F(0x061158c5) /* 0.379235048 */, 17 },
- /* 3330 */ { MAD_F(0x0611f80c) /* 0.379386947 */, 17 },
- /* 3331 */ { MAD_F(0x06129757) /* 0.379538862 */, 17 },
- /* 3332 */ { MAD_F(0x061336a6) /* 0.379690791 */, 17 },
- /* 3333 */ { MAD_F(0x0613d5fa) /* 0.379842736 */, 17 },
- /* 3334 */ { MAD_F(0x06147551) /* 0.379994696 */, 17 },
- /* 3335 */ { MAD_F(0x061514ad) /* 0.380146671 */, 17 },
- /* 3336 */ { MAD_F(0x0615b40c) /* 0.380298661 */, 17 },
- /* 3337 */ { MAD_F(0x06165370) /* 0.380450666 */, 17 },
- /* 3338 */ { MAD_F(0x0616f2d8) /* 0.380602687 */, 17 },
- /* 3339 */ { MAD_F(0x06179243) /* 0.380754723 */, 17 },
- /* 3340 */ { MAD_F(0x061831b3) /* 0.380906774 */, 17 },
- /* 3341 */ { MAD_F(0x0618d127) /* 0.381058840 */, 17 },
- /* 3342 */ { MAD_F(0x0619709f) /* 0.381210921 */, 17 },
- /* 3343 */ { MAD_F(0x061a101b) /* 0.381363018 */, 17 },
-
- /* 3344 */ { MAD_F(0x061aaf9c) /* 0.381515130 */, 17 },
- /* 3345 */ { MAD_F(0x061b4f20) /* 0.381667257 */, 17 },
- /* 3346 */ { MAD_F(0x061beea8) /* 0.381819399 */, 17 },
- /* 3347 */ { MAD_F(0x061c8e34) /* 0.381971556 */, 17 },
- /* 3348 */ { MAD_F(0x061d2dc5) /* 0.382123728 */, 17 },
- /* 3349 */ { MAD_F(0x061dcd59) /* 0.382275916 */, 17 },
- /* 3350 */ { MAD_F(0x061e6cf2) /* 0.382428118 */, 17 },
- /* 3351 */ { MAD_F(0x061f0c8f) /* 0.382580336 */, 17 },
- /* 3352 */ { MAD_F(0x061fac2f) /* 0.382732569 */, 17 },
- /* 3353 */ { MAD_F(0x06204bd4) /* 0.382884817 */, 17 },
- /* 3354 */ { MAD_F(0x0620eb7d) /* 0.383037080 */, 17 },
- /* 3355 */ { MAD_F(0x06218b2a) /* 0.383189358 */, 17 },
- /* 3356 */ { MAD_F(0x06222adb) /* 0.383341652 */, 17 },
- /* 3357 */ { MAD_F(0x0622ca90) /* 0.383493960 */, 17 },
- /* 3358 */ { MAD_F(0x06236a49) /* 0.383646284 */, 17 },
- /* 3359 */ { MAD_F(0x06240a06) /* 0.383798623 */, 17 },
-
- /* 3360 */ { MAD_F(0x0624a9c7) /* 0.383950977 */, 17 },
- /* 3361 */ { MAD_F(0x0625498d) /* 0.384103346 */, 17 },
- /* 3362 */ { MAD_F(0x0625e956) /* 0.384255730 */, 17 },
- /* 3363 */ { MAD_F(0x06268923) /* 0.384408129 */, 17 },
- /* 3364 */ { MAD_F(0x062728f5) /* 0.384560544 */, 17 },
- /* 3365 */ { MAD_F(0x0627c8ca) /* 0.384712973 */, 17 },
- /* 3366 */ { MAD_F(0x062868a4) /* 0.384865418 */, 17 },
- /* 3367 */ { MAD_F(0x06290881) /* 0.385017878 */, 17 },
- /* 3368 */ { MAD_F(0x0629a863) /* 0.385170352 */, 17 },
- /* 3369 */ { MAD_F(0x062a4849) /* 0.385322842 */, 17 },
- /* 3370 */ { MAD_F(0x062ae832) /* 0.385475347 */, 17 },
- /* 3371 */ { MAD_F(0x062b8820) /* 0.385627867 */, 17 },
- /* 3372 */ { MAD_F(0x062c2812) /* 0.385780402 */, 17 },
- /* 3373 */ { MAD_F(0x062cc808) /* 0.385932953 */, 17 },
- /* 3374 */ { MAD_F(0x062d6802) /* 0.386085518 */, 17 },
- /* 3375 */ { MAD_F(0x062e0800) /* 0.386238098 */, 17 },
-
- /* 3376 */ { MAD_F(0x062ea802) /* 0.386390694 */, 17 },
- /* 3377 */ { MAD_F(0x062f4808) /* 0.386543304 */, 17 },
- /* 3378 */ { MAD_F(0x062fe812) /* 0.386695930 */, 17 },
- /* 3379 */ { MAD_F(0x06308820) /* 0.386848570 */, 17 },
- /* 3380 */ { MAD_F(0x06312832) /* 0.387001226 */, 17 },
- /* 3381 */ { MAD_F(0x0631c849) /* 0.387153897 */, 17 },
- /* 3382 */ { MAD_F(0x06326863) /* 0.387306582 */, 17 },
- /* 3383 */ { MAD_F(0x06330881) /* 0.387459283 */, 17 },
- /* 3384 */ { MAD_F(0x0633a8a3) /* 0.387611999 */, 17 },
- /* 3385 */ { MAD_F(0x063448ca) /* 0.387764730 */, 17 },
- /* 3386 */ { MAD_F(0x0634e8f4) /* 0.387917476 */, 17 },
- /* 3387 */ { MAD_F(0x06358923) /* 0.388070237 */, 17 },
- /* 3388 */ { MAD_F(0x06362955) /* 0.388223013 */, 17 },
- /* 3389 */ { MAD_F(0x0636c98c) /* 0.388375804 */, 17 },
- /* 3390 */ { MAD_F(0x063769c6) /* 0.388528610 */, 17 },
- /* 3391 */ { MAD_F(0x06380a05) /* 0.388681431 */, 17 },
-
- /* 3392 */ { MAD_F(0x0638aa48) /* 0.388834268 */, 17 },
- /* 3393 */ { MAD_F(0x06394a8e) /* 0.388987119 */, 17 },
- /* 3394 */ { MAD_F(0x0639ead9) /* 0.389139985 */, 17 },
- /* 3395 */ { MAD_F(0x063a8b28) /* 0.389292866 */, 17 },
- /* 3396 */ { MAD_F(0x063b2b7b) /* 0.389445762 */, 17 },
- /* 3397 */ { MAD_F(0x063bcbd1) /* 0.389598674 */, 17 },
- /* 3398 */ { MAD_F(0x063c6c2c) /* 0.389751600 */, 17 },
- /* 3399 */ { MAD_F(0x063d0c8b) /* 0.389904541 */, 17 },
- /* 3400 */ { MAD_F(0x063dacee) /* 0.390057497 */, 17 },
- /* 3401 */ { MAD_F(0x063e4d55) /* 0.390210468 */, 17 },
- /* 3402 */ { MAD_F(0x063eedc0) /* 0.390363455 */, 17 },
- /* 3403 */ { MAD_F(0x063f8e2f) /* 0.390516456 */, 17 },
- /* 3404 */ { MAD_F(0x06402ea2) /* 0.390669472 */, 17 },
- /* 3405 */ { MAD_F(0x0640cf19) /* 0.390822503 */, 17 },
- /* 3406 */ { MAD_F(0x06416f94) /* 0.390975549 */, 17 },
- /* 3407 */ { MAD_F(0x06421013) /* 0.391128611 */, 17 },
-
- /* 3408 */ { MAD_F(0x0642b096) /* 0.391281687 */, 17 },
- /* 3409 */ { MAD_F(0x0643511d) /* 0.391434778 */, 17 },
- /* 3410 */ { MAD_F(0x0643f1a8) /* 0.391587884 */, 17 },
- /* 3411 */ { MAD_F(0x06449237) /* 0.391741005 */, 17 },
- /* 3412 */ { MAD_F(0x064532ca) /* 0.391894141 */, 17 },
- /* 3413 */ { MAD_F(0x0645d361) /* 0.392047292 */, 17 },
- /* 3414 */ { MAD_F(0x064673fc) /* 0.392200458 */, 17 },
- /* 3415 */ { MAD_F(0x0647149c) /* 0.392353638 */, 17 },
- /* 3416 */ { MAD_F(0x0647b53f) /* 0.392506834 */, 17 },
- /* 3417 */ { MAD_F(0x064855e6) /* 0.392660045 */, 17 },
- /* 3418 */ { MAD_F(0x0648f691) /* 0.392813271 */, 17 },
- /* 3419 */ { MAD_F(0x06499740) /* 0.392966511 */, 17 },
- /* 3420 */ { MAD_F(0x064a37f4) /* 0.393119767 */, 17 },
- /* 3421 */ { MAD_F(0x064ad8ab) /* 0.393273038 */, 17 },
- /* 3422 */ { MAD_F(0x064b7966) /* 0.393426323 */, 17 },
- /* 3423 */ { MAD_F(0x064c1a25) /* 0.393579623 */, 17 },
-
- /* 3424 */ { MAD_F(0x064cbae9) /* 0.393732939 */, 17 },
- /* 3425 */ { MAD_F(0x064d5bb0) /* 0.393886269 */, 17 },
- /* 3426 */ { MAD_F(0x064dfc7b) /* 0.394039614 */, 17 },
- /* 3427 */ { MAD_F(0x064e9d4b) /* 0.394192974 */, 17 },
- /* 3428 */ { MAD_F(0x064f3e1e) /* 0.394346349 */, 17 },
- /* 3429 */ { MAD_F(0x064fdef5) /* 0.394499739 */, 17 },
- /* 3430 */ { MAD_F(0x06507fd0) /* 0.394653144 */, 17 },
- /* 3431 */ { MAD_F(0x065120b0) /* 0.394806564 */, 17 },
- /* 3432 */ { MAD_F(0x0651c193) /* 0.394959999 */, 17 },
- /* 3433 */ { MAD_F(0x0652627a) /* 0.395113448 */, 17 },
- /* 3434 */ { MAD_F(0x06530366) /* 0.395266913 */, 17 },
- /* 3435 */ { MAD_F(0x0653a455) /* 0.395420392 */, 17 },
- /* 3436 */ { MAD_F(0x06544548) /* 0.395573886 */, 17 },
- /* 3437 */ { MAD_F(0x0654e640) /* 0.395727395 */, 17 },
- /* 3438 */ { MAD_F(0x0655873b) /* 0.395880919 */, 17 },
- /* 3439 */ { MAD_F(0x0656283a) /* 0.396034458 */, 17 },
-
- /* 3440 */ { MAD_F(0x0656c93d) /* 0.396188012 */, 17 },
- /* 3441 */ { MAD_F(0x06576a45) /* 0.396341581 */, 17 },
- /* 3442 */ { MAD_F(0x06580b50) /* 0.396495164 */, 17 },
- /* 3443 */ { MAD_F(0x0658ac5f) /* 0.396648763 */, 17 },
- /* 3444 */ { MAD_F(0x06594d73) /* 0.396802376 */, 17 },
- /* 3445 */ { MAD_F(0x0659ee8a) /* 0.396956004 */, 17 },
- /* 3446 */ { MAD_F(0x065a8fa5) /* 0.397109647 */, 17 },
- /* 3447 */ { MAD_F(0x065b30c4) /* 0.397263305 */, 17 },
- /* 3448 */ { MAD_F(0x065bd1e7) /* 0.397416978 */, 17 },
- /* 3449 */ { MAD_F(0x065c730f) /* 0.397570666 */, 17 },
- /* 3450 */ { MAD_F(0x065d143a) /* 0.397724368 */, 17 },
- /* 3451 */ { MAD_F(0x065db569) /* 0.397878085 */, 17 },
- /* 3452 */ { MAD_F(0x065e569c) /* 0.398031818 */, 17 },
- /* 3453 */ { MAD_F(0x065ef7d3) /* 0.398185565 */, 17 },
- /* 3454 */ { MAD_F(0x065f990e) /* 0.398339326 */, 17 },
- /* 3455 */ { MAD_F(0x06603a4e) /* 0.398493103 */, 17 },
-
- /* 3456 */ { MAD_F(0x0660db91) /* 0.398646895 */, 17 },
- /* 3457 */ { MAD_F(0x06617cd8) /* 0.398800701 */, 17 },
- /* 3458 */ { MAD_F(0x06621e23) /* 0.398954522 */, 17 },
- /* 3459 */ { MAD_F(0x0662bf72) /* 0.399108358 */, 17 },
- /* 3460 */ { MAD_F(0x066360c5) /* 0.399262209 */, 17 },
- /* 3461 */ { MAD_F(0x0664021c) /* 0.399416075 */, 17 },
- /* 3462 */ { MAD_F(0x0664a377) /* 0.399569955 */, 17 },
- /* 3463 */ { MAD_F(0x066544d6) /* 0.399723851 */, 17 },
- /* 3464 */ { MAD_F(0x0665e639) /* 0.399877761 */, 17 },
- /* 3465 */ { MAD_F(0x066687a0) /* 0.400031686 */, 17 },
- /* 3466 */ { MAD_F(0x0667290b) /* 0.400185625 */, 17 },
- /* 3467 */ { MAD_F(0x0667ca79) /* 0.400339580 */, 17 },
- /* 3468 */ { MAD_F(0x06686bec) /* 0.400493549 */, 17 },
- /* 3469 */ { MAD_F(0x06690d63) /* 0.400647534 */, 17 },
- /* 3470 */ { MAD_F(0x0669aede) /* 0.400801533 */, 17 },
- /* 3471 */ { MAD_F(0x066a505d) /* 0.400955546 */, 17 },
-
- /* 3472 */ { MAD_F(0x066af1df) /* 0.401109575 */, 17 },
- /* 3473 */ { MAD_F(0x066b9366) /* 0.401263618 */, 17 },
- /* 3474 */ { MAD_F(0x066c34f1) /* 0.401417676 */, 17 },
- /* 3475 */ { MAD_F(0x066cd67f) /* 0.401571749 */, 17 },
- /* 3476 */ { MAD_F(0x066d7812) /* 0.401725837 */, 17 },
- /* 3477 */ { MAD_F(0x066e19a9) /* 0.401879939 */, 17 },
- /* 3478 */ { MAD_F(0x066ebb43) /* 0.402034056 */, 17 },
- /* 3479 */ { MAD_F(0x066f5ce2) /* 0.402188188 */, 17 },
- /* 3480 */ { MAD_F(0x066ffe84) /* 0.402342335 */, 17 },
- /* 3481 */ { MAD_F(0x0670a02a) /* 0.402496497 */, 17 },
- /* 3482 */ { MAD_F(0x067141d5) /* 0.402650673 */, 17 },
- /* 3483 */ { MAD_F(0x0671e383) /* 0.402804864 */, 17 },
- /* 3484 */ { MAD_F(0x06728535) /* 0.402959070 */, 17 },
- /* 3485 */ { MAD_F(0x067326ec) /* 0.403113291 */, 17 },
- /* 3486 */ { MAD_F(0x0673c8a6) /* 0.403267526 */, 17 },
- /* 3487 */ { MAD_F(0x06746a64) /* 0.403421776 */, 17 },
-
- /* 3488 */ { MAD_F(0x06750c26) /* 0.403576041 */, 17 },
- /* 3489 */ { MAD_F(0x0675adec) /* 0.403730320 */, 17 },
- /* 3490 */ { MAD_F(0x06764fb6) /* 0.403884615 */, 17 },
- /* 3491 */ { MAD_F(0x0676f184) /* 0.404038924 */, 17 },
- /* 3492 */ { MAD_F(0x06779356) /* 0.404193247 */, 17 },
- /* 3493 */ { MAD_F(0x0678352c) /* 0.404347586 */, 17 },
- /* 3494 */ { MAD_F(0x0678d706) /* 0.404501939 */, 17 },
- /* 3495 */ { MAD_F(0x067978e4) /* 0.404656307 */, 17 },
- /* 3496 */ { MAD_F(0x067a1ac6) /* 0.404810690 */, 17 },
- /* 3497 */ { MAD_F(0x067abcac) /* 0.404965087 */, 17 },
- /* 3498 */ { MAD_F(0x067b5e95) /* 0.405119499 */, 17 },
- /* 3499 */ { MAD_F(0x067c0083) /* 0.405273926 */, 17 },
- /* 3500 */ { MAD_F(0x067ca275) /* 0.405428368 */, 17 },
- /* 3501 */ { MAD_F(0x067d446a) /* 0.405582824 */, 17 },
- /* 3502 */ { MAD_F(0x067de664) /* 0.405737295 */, 17 },
- /* 3503 */ { MAD_F(0x067e8861) /* 0.405891781 */, 17 },
-
- /* 3504 */ { MAD_F(0x067f2a62) /* 0.406046281 */, 17 },
- /* 3505 */ { MAD_F(0x067fcc68) /* 0.406200796 */, 17 },
- /* 3506 */ { MAD_F(0x06806e71) /* 0.406355326 */, 17 },
- /* 3507 */ { MAD_F(0x0681107e) /* 0.406509870 */, 17 },
- /* 3508 */ { MAD_F(0x0681b28f) /* 0.406664429 */, 17 },
- /* 3509 */ { MAD_F(0x068254a4) /* 0.406819003 */, 17 },
- /* 3510 */ { MAD_F(0x0682f6bd) /* 0.406973592 */, 17 },
- /* 3511 */ { MAD_F(0x068398da) /* 0.407128195 */, 17 },
- /* 3512 */ { MAD_F(0x06843afb) /* 0.407282813 */, 17 },
- /* 3513 */ { MAD_F(0x0684dd20) /* 0.407437445 */, 17 },
- /* 3514 */ { MAD_F(0x06857f49) /* 0.407592093 */, 17 },
- /* 3515 */ { MAD_F(0x06862176) /* 0.407746754 */, 17 },
- /* 3516 */ { MAD_F(0x0686c3a6) /* 0.407901431 */, 17 },
- /* 3517 */ { MAD_F(0x068765db) /* 0.408056122 */, 17 },
- /* 3518 */ { MAD_F(0x06880814) /* 0.408210828 */, 17 },
- /* 3519 */ { MAD_F(0x0688aa50) /* 0.408365549 */, 17 },
-
- /* 3520 */ { MAD_F(0x06894c90) /* 0.408520284 */, 17 },
- /* 3521 */ { MAD_F(0x0689eed5) /* 0.408675034 */, 17 },
- /* 3522 */ { MAD_F(0x068a911d) /* 0.408829798 */, 17 },
- /* 3523 */ { MAD_F(0x068b3369) /* 0.408984577 */, 17 },
- /* 3524 */ { MAD_F(0x068bd5b9) /* 0.409139371 */, 17 },
- /* 3525 */ { MAD_F(0x068c780e) /* 0.409294180 */, 17 },
- /* 3526 */ { MAD_F(0x068d1a66) /* 0.409449003 */, 17 },
- /* 3527 */ { MAD_F(0x068dbcc1) /* 0.409603840 */, 17 },
- /* 3528 */ { MAD_F(0x068e5f21) /* 0.409758693 */, 17 },
- /* 3529 */ { MAD_F(0x068f0185) /* 0.409913560 */, 17 },
- /* 3530 */ { MAD_F(0x068fa3ed) /* 0.410068441 */, 17 },
- /* 3531 */ { MAD_F(0x06904658) /* 0.410223338 */, 17 },
- /* 3532 */ { MAD_F(0x0690e8c8) /* 0.410378249 */, 17 },
- /* 3533 */ { MAD_F(0x06918b3c) /* 0.410533174 */, 17 },
- /* 3534 */ { MAD_F(0x06922db3) /* 0.410688114 */, 17 },
- /* 3535 */ { MAD_F(0x0692d02e) /* 0.410843069 */, 17 },
-
- /* 3536 */ { MAD_F(0x069372ae) /* 0.410998038 */, 17 },
- /* 3537 */ { MAD_F(0x06941531) /* 0.411153022 */, 17 },
- /* 3538 */ { MAD_F(0x0694b7b8) /* 0.411308021 */, 17 },
- /* 3539 */ { MAD_F(0x06955a43) /* 0.411463034 */, 17 },
- /* 3540 */ { MAD_F(0x0695fcd2) /* 0.411618062 */, 17 },
- /* 3541 */ { MAD_F(0x06969f65) /* 0.411773104 */, 17 },
- /* 3542 */ { MAD_F(0x069741fb) /* 0.411928161 */, 17 },
- /* 3543 */ { MAD_F(0x0697e496) /* 0.412083232 */, 17 },
- /* 3544 */ { MAD_F(0x06988735) /* 0.412238319 */, 17 },
- /* 3545 */ { MAD_F(0x069929d7) /* 0.412393419 */, 17 },
- /* 3546 */ { MAD_F(0x0699cc7e) /* 0.412548535 */, 17 },
- /* 3547 */ { MAD_F(0x069a6f28) /* 0.412703664 */, 17 },
- /* 3548 */ { MAD_F(0x069b11d6) /* 0.412858809 */, 17 },
- /* 3549 */ { MAD_F(0x069bb489) /* 0.413013968 */, 17 },
- /* 3550 */ { MAD_F(0x069c573f) /* 0.413169142 */, 17 },
- /* 3551 */ { MAD_F(0x069cf9f9) /* 0.413324330 */, 17 },
-
- /* 3552 */ { MAD_F(0x069d9cb7) /* 0.413479532 */, 17 },
- /* 3553 */ { MAD_F(0x069e3f78) /* 0.413634750 */, 17 },
- /* 3554 */ { MAD_F(0x069ee23e) /* 0.413789982 */, 17 },
- /* 3555 */ { MAD_F(0x069f8508) /* 0.413945228 */, 17 },
- /* 3556 */ { MAD_F(0x06a027d5) /* 0.414100489 */, 17 },
- /* 3557 */ { MAD_F(0x06a0caa7) /* 0.414255765 */, 17 },
- /* 3558 */ { MAD_F(0x06a16d7c) /* 0.414411055 */, 17 },
- /* 3559 */ { MAD_F(0x06a21055) /* 0.414566359 */, 17 },
- /* 3560 */ { MAD_F(0x06a2b333) /* 0.414721679 */, 17 },
- /* 3561 */ { MAD_F(0x06a35614) /* 0.414877012 */, 17 },
- /* 3562 */ { MAD_F(0x06a3f8f9) /* 0.415032361 */, 17 },
- /* 3563 */ { MAD_F(0x06a49be2) /* 0.415187723 */, 17 },
- /* 3564 */ { MAD_F(0x06a53ece) /* 0.415343101 */, 17 },
- /* 3565 */ { MAD_F(0x06a5e1bf) /* 0.415498493 */, 17 },
- /* 3566 */ { MAD_F(0x06a684b4) /* 0.415653899 */, 17 },
- /* 3567 */ { MAD_F(0x06a727ac) /* 0.415809320 */, 17 },
-
- /* 3568 */ { MAD_F(0x06a7caa9) /* 0.415964756 */, 17 },
- /* 3569 */ { MAD_F(0x06a86da9) /* 0.416120206 */, 17 },
- /* 3570 */ { MAD_F(0x06a910ad) /* 0.416275670 */, 17 },
- /* 3571 */ { MAD_F(0x06a9b3b5) /* 0.416431149 */, 17 },
- /* 3572 */ { MAD_F(0x06aa56c1) /* 0.416586643 */, 17 },
- /* 3573 */ { MAD_F(0x06aaf9d1) /* 0.416742151 */, 17 },
- /* 3574 */ { MAD_F(0x06ab9ce5) /* 0.416897673 */, 17 },
- /* 3575 */ { MAD_F(0x06ac3ffc) /* 0.417053210 */, 17 },
- /* 3576 */ { MAD_F(0x06ace318) /* 0.417208762 */, 17 },
- /* 3577 */ { MAD_F(0x06ad8637) /* 0.417364328 */, 17 },
- /* 3578 */ { MAD_F(0x06ae295b) /* 0.417519909 */, 17 },
- /* 3579 */ { MAD_F(0x06aecc82) /* 0.417675504 */, 17 },
- /* 3580 */ { MAD_F(0x06af6fad) /* 0.417831113 */, 17 },
- /* 3581 */ { MAD_F(0x06b012dc) /* 0.417986737 */, 17 },
- /* 3582 */ { MAD_F(0x06b0b60f) /* 0.418142376 */, 17 },
- /* 3583 */ { MAD_F(0x06b15946) /* 0.418298029 */, 17 },
-
- /* 3584 */ { MAD_F(0x06b1fc81) /* 0.418453696 */, 17 },
- /* 3585 */ { MAD_F(0x06b29fbf) /* 0.418609378 */, 17 },
- /* 3586 */ { MAD_F(0x06b34302) /* 0.418765075 */, 17 },
- /* 3587 */ { MAD_F(0x06b3e648) /* 0.418920786 */, 17 },
- /* 3588 */ { MAD_F(0x06b48992) /* 0.419076511 */, 17 },
- /* 3589 */ { MAD_F(0x06b52ce0) /* 0.419232251 */, 17 },
- /* 3590 */ { MAD_F(0x06b5d032) /* 0.419388005 */, 17 },
- /* 3591 */ { MAD_F(0x06b67388) /* 0.419543774 */, 17 },
- /* 3592 */ { MAD_F(0x06b716e2) /* 0.419699557 */, 17 },
- /* 3593 */ { MAD_F(0x06b7ba3f) /* 0.419855355 */, 17 },
- /* 3594 */ { MAD_F(0x06b85da1) /* 0.420011167 */, 17 },
- /* 3595 */ { MAD_F(0x06b90106) /* 0.420166994 */, 17 },
- /* 3596 */ { MAD_F(0x06b9a470) /* 0.420322835 */, 17 },
- /* 3597 */ { MAD_F(0x06ba47dd) /* 0.420478690 */, 17 },
- /* 3598 */ { MAD_F(0x06baeb4e) /* 0.420634560 */, 17 },
- /* 3599 */ { MAD_F(0x06bb8ec3) /* 0.420790445 */, 17 },
-
- /* 3600 */ { MAD_F(0x06bc323b) /* 0.420946343 */, 17 },
- /* 3601 */ { MAD_F(0x06bcd5b8) /* 0.421102257 */, 17 },
- /* 3602 */ { MAD_F(0x06bd7939) /* 0.421258184 */, 17 },
- /* 3603 */ { MAD_F(0x06be1cbd) /* 0.421414127 */, 17 },
- /* 3604 */ { MAD_F(0x06bec045) /* 0.421570083 */, 17 },
- /* 3605 */ { MAD_F(0x06bf63d1) /* 0.421726054 */, 17 },
- /* 3606 */ { MAD_F(0x06c00761) /* 0.421882040 */, 17 },
- /* 3607 */ { MAD_F(0x06c0aaf5) /* 0.422038039 */, 17 },
- /* 3608 */ { MAD_F(0x06c14e8d) /* 0.422194054 */, 17 },
- /* 3609 */ { MAD_F(0x06c1f229) /* 0.422350082 */, 17 },
- /* 3610 */ { MAD_F(0x06c295c8) /* 0.422506125 */, 17 },
- /* 3611 */ { MAD_F(0x06c3396c) /* 0.422662183 */, 17 },
- /* 3612 */ { MAD_F(0x06c3dd13) /* 0.422818255 */, 17 },
- /* 3613 */ { MAD_F(0x06c480be) /* 0.422974341 */, 17 },
- /* 3614 */ { MAD_F(0x06c5246d) /* 0.423130442 */, 17 },
- /* 3615 */ { MAD_F(0x06c5c820) /* 0.423286557 */, 17 },
-
- /* 3616 */ { MAD_F(0x06c66bd6) /* 0.423442686 */, 17 },
- /* 3617 */ { MAD_F(0x06c70f91) /* 0.423598830 */, 17 },
- /* 3618 */ { MAD_F(0x06c7b34f) /* 0.423754988 */, 17 },
- /* 3619 */ { MAD_F(0x06c85712) /* 0.423911161 */, 17 },
- /* 3620 */ { MAD_F(0x06c8fad8) /* 0.424067348 */, 17 },
- /* 3621 */ { MAD_F(0x06c99ea2) /* 0.424223550 */, 17 },
- /* 3622 */ { MAD_F(0x06ca4270) /* 0.424379765 */, 17 },
- /* 3623 */ { MAD_F(0x06cae641) /* 0.424535996 */, 17 },
- /* 3624 */ { MAD_F(0x06cb8a17) /* 0.424692240 */, 17 },
- /* 3625 */ { MAD_F(0x06cc2df0) /* 0.424848499 */, 17 },
- /* 3626 */ { MAD_F(0x06ccd1ce) /* 0.425004772 */, 17 },
- /* 3627 */ { MAD_F(0x06cd75af) /* 0.425161060 */, 17 },
- /* 3628 */ { MAD_F(0x06ce1994) /* 0.425317362 */, 17 },
- /* 3629 */ { MAD_F(0x06cebd7d) /* 0.425473678 */, 17 },
- /* 3630 */ { MAD_F(0x06cf6169) /* 0.425630009 */, 17 },
- /* 3631 */ { MAD_F(0x06d0055a) /* 0.425786354 */, 17 },
-
- /* 3632 */ { MAD_F(0x06d0a94e) /* 0.425942714 */, 17 },
- /* 3633 */ { MAD_F(0x06d14d47) /* 0.426099088 */, 17 },
- /* 3634 */ { MAD_F(0x06d1f143) /* 0.426255476 */, 17 },
- /* 3635 */ { MAD_F(0x06d29543) /* 0.426411878 */, 17 },
- /* 3636 */ { MAD_F(0x06d33947) /* 0.426568295 */, 17 },
- /* 3637 */ { MAD_F(0x06d3dd4e) /* 0.426724726 */, 17 },
- /* 3638 */ { MAD_F(0x06d4815a) /* 0.426881172 */, 17 },
- /* 3639 */ { MAD_F(0x06d52569) /* 0.427037632 */, 17 },
- /* 3640 */ { MAD_F(0x06d5c97c) /* 0.427194106 */, 17 },
- /* 3641 */ { MAD_F(0x06d66d93) /* 0.427350594 */, 17 },
- /* 3642 */ { MAD_F(0x06d711ae) /* 0.427507097 */, 17 },
- /* 3643 */ { MAD_F(0x06d7b5cd) /* 0.427663614 */, 17 },
- /* 3644 */ { MAD_F(0x06d859f0) /* 0.427820146 */, 17 },
- /* 3645 */ { MAD_F(0x06d8fe16) /* 0.427976692 */, 17 },
- /* 3646 */ { MAD_F(0x06d9a240) /* 0.428133252 */, 17 },
- /* 3647 */ { MAD_F(0x06da466f) /* 0.428289826 */, 17 },
-
- /* 3648 */ { MAD_F(0x06daeaa1) /* 0.428446415 */, 17 },
- /* 3649 */ { MAD_F(0x06db8ed6) /* 0.428603018 */, 17 },
- /* 3650 */ { MAD_F(0x06dc3310) /* 0.428759635 */, 17 },
- /* 3651 */ { MAD_F(0x06dcd74d) /* 0.428916267 */, 17 },
- /* 3652 */ { MAD_F(0x06dd7b8f) /* 0.429072913 */, 17 },
- /* 3653 */ { MAD_F(0x06de1fd4) /* 0.429229573 */, 17 },
- /* 3654 */ { MAD_F(0x06dec41d) /* 0.429386248 */, 17 },
- /* 3655 */ { MAD_F(0x06df686a) /* 0.429542937 */, 17 },
- /* 3656 */ { MAD_F(0x06e00cbb) /* 0.429699640 */, 17 },
- /* 3657 */ { MAD_F(0x06e0b10f) /* 0.429856357 */, 17 },
- /* 3658 */ { MAD_F(0x06e15567) /* 0.430013089 */, 17 },
- /* 3659 */ { MAD_F(0x06e1f9c4) /* 0.430169835 */, 17 },
- /* 3660 */ { MAD_F(0x06e29e24) /* 0.430326595 */, 17 },
- /* 3661 */ { MAD_F(0x06e34287) /* 0.430483370 */, 17 },
- /* 3662 */ { MAD_F(0x06e3e6ef) /* 0.430640159 */, 17 },
- /* 3663 */ { MAD_F(0x06e48b5b) /* 0.430796962 */, 17 },
-
- /* 3664 */ { MAD_F(0x06e52fca) /* 0.430953779 */, 17 },
- /* 3665 */ { MAD_F(0x06e5d43d) /* 0.431110611 */, 17 },
- /* 3666 */ { MAD_F(0x06e678b4) /* 0.431267457 */, 17 },
- /* 3667 */ { MAD_F(0x06e71d2f) /* 0.431424317 */, 17 },
- /* 3668 */ { MAD_F(0x06e7c1ae) /* 0.431581192 */, 17 },
- /* 3669 */ { MAD_F(0x06e86630) /* 0.431738080 */, 17 },
- /* 3670 */ { MAD_F(0x06e90ab7) /* 0.431894983 */, 17 },
- /* 3671 */ { MAD_F(0x06e9af41) /* 0.432051900 */, 17 },
- /* 3672 */ { MAD_F(0x06ea53cf) /* 0.432208832 */, 17 },
- /* 3673 */ { MAD_F(0x06eaf860) /* 0.432365778 */, 17 },
- /* 3674 */ { MAD_F(0x06eb9cf6) /* 0.432522737 */, 17 },
- /* 3675 */ { MAD_F(0x06ec418f) /* 0.432679712 */, 17 },
- /* 3676 */ { MAD_F(0x06ece62d) /* 0.432836700 */, 17 },
- /* 3677 */ { MAD_F(0x06ed8ace) /* 0.432993703 */, 17 },
- /* 3678 */ { MAD_F(0x06ee2f73) /* 0.433150720 */, 17 },
- /* 3679 */ { MAD_F(0x06eed41b) /* 0.433307751 */, 17 },
-
- /* 3680 */ { MAD_F(0x06ef78c8) /* 0.433464796 */, 17 },
- /* 3681 */ { MAD_F(0x06f01d78) /* 0.433621856 */, 17 },
- /* 3682 */ { MAD_F(0x06f0c22c) /* 0.433778929 */, 17 },
- /* 3683 */ { MAD_F(0x06f166e4) /* 0.433936017 */, 17 },
- /* 3684 */ { MAD_F(0x06f20ba0) /* 0.434093120 */, 17 },
- /* 3685 */ { MAD_F(0x06f2b060) /* 0.434250236 */, 17 },
- /* 3686 */ { MAD_F(0x06f35523) /* 0.434407367 */, 17 },
- /* 3687 */ { MAD_F(0x06f3f9eb) /* 0.434564512 */, 17 },
- /* 3688 */ { MAD_F(0x06f49eb6) /* 0.434721671 */, 17 },
- /* 3689 */ { MAD_F(0x06f54385) /* 0.434878844 */, 17 },
- /* 3690 */ { MAD_F(0x06f5e857) /* 0.435036032 */, 17 },
- /* 3691 */ { MAD_F(0x06f68d2e) /* 0.435193233 */, 17 },
- /* 3692 */ { MAD_F(0x06f73208) /* 0.435350449 */, 17 },
- /* 3693 */ { MAD_F(0x06f7d6e6) /* 0.435507679 */, 17 },
- /* 3694 */ { MAD_F(0x06f87bc8) /* 0.435664924 */, 17 },
- /* 3695 */ { MAD_F(0x06f920ae) /* 0.435822182 */, 17 },
-
- /* 3696 */ { MAD_F(0x06f9c597) /* 0.435979455 */, 17 },
- /* 3697 */ { MAD_F(0x06fa6a85) /* 0.436136741 */, 17 },
- /* 3698 */ { MAD_F(0x06fb0f76) /* 0.436294042 */, 17 },
- /* 3699 */ { MAD_F(0x06fbb46b) /* 0.436451358 */, 17 },
- /* 3700 */ { MAD_F(0x06fc5964) /* 0.436608687 */, 17 },
- /* 3701 */ { MAD_F(0x06fcfe60) /* 0.436766031 */, 17 },
- /* 3702 */ { MAD_F(0x06fda361) /* 0.436923388 */, 17 },
- /* 3703 */ { MAD_F(0x06fe4865) /* 0.437080760 */, 17 },
- /* 3704 */ { MAD_F(0x06feed6d) /* 0.437238146 */, 17 },
- /* 3705 */ { MAD_F(0x06ff9279) /* 0.437395547 */, 17 },
- /* 3706 */ { MAD_F(0x07003788) /* 0.437552961 */, 17 },
- /* 3707 */ { MAD_F(0x0700dc9c) /* 0.437710389 */, 17 },
- /* 3708 */ { MAD_F(0x070181b3) /* 0.437867832 */, 17 },
- /* 3709 */ { MAD_F(0x070226ce) /* 0.438025289 */, 17 },
- /* 3710 */ { MAD_F(0x0702cbed) /* 0.438182760 */, 17 },
- /* 3711 */ { MAD_F(0x0703710f) /* 0.438340245 */, 17 },
-
- /* 3712 */ { MAD_F(0x07041636) /* 0.438497744 */, 17 },
- /* 3713 */ { MAD_F(0x0704bb60) /* 0.438655258 */, 17 },
- /* 3714 */ { MAD_F(0x0705608e) /* 0.438812785 */, 17 },
- /* 3715 */ { MAD_F(0x070605c0) /* 0.438970327 */, 17 },
- /* 3716 */ { MAD_F(0x0706aaf5) /* 0.439127883 */, 17 },
- /* 3717 */ { MAD_F(0x0707502f) /* 0.439285453 */, 17 },
- /* 3718 */ { MAD_F(0x0707f56c) /* 0.439443037 */, 17 },
- /* 3719 */ { MAD_F(0x07089aad) /* 0.439600635 */, 17 },
- /* 3720 */ { MAD_F(0x07093ff2) /* 0.439758248 */, 17 },
- /* 3721 */ { MAD_F(0x0709e53a) /* 0.439915874 */, 17 },
- /* 3722 */ { MAD_F(0x070a8a86) /* 0.440073515 */, 17 },
- /* 3723 */ { MAD_F(0x070b2fd7) /* 0.440231170 */, 17 },
- /* 3724 */ { MAD_F(0x070bd52a) /* 0.440388839 */, 17 },
- /* 3725 */ { MAD_F(0x070c7a82) /* 0.440546522 */, 17 },
- /* 3726 */ { MAD_F(0x070d1fde) /* 0.440704219 */, 17 },
- /* 3727 */ { MAD_F(0x070dc53d) /* 0.440861930 */, 17 },
-
- /* 3728 */ { MAD_F(0x070e6aa0) /* 0.441019655 */, 17 },
- /* 3729 */ { MAD_F(0x070f1007) /* 0.441177395 */, 17 },
- /* 3730 */ { MAD_F(0x070fb571) /* 0.441335148 */, 17 },
- /* 3731 */ { MAD_F(0x07105ae0) /* 0.441492916 */, 17 },
- /* 3732 */ { MAD_F(0x07110052) /* 0.441650697 */, 17 },
- /* 3733 */ { MAD_F(0x0711a5c8) /* 0.441808493 */, 17 },
- /* 3734 */ { MAD_F(0x07124b42) /* 0.441966303 */, 17 },
- /* 3735 */ { MAD_F(0x0712f0bf) /* 0.442124127 */, 17 },
- /* 3736 */ { MAD_F(0x07139641) /* 0.442281965 */, 17 },
- /* 3737 */ { MAD_F(0x07143bc6) /* 0.442439817 */, 17 },
- /* 3738 */ { MAD_F(0x0714e14f) /* 0.442597683 */, 17 },
- /* 3739 */ { MAD_F(0x071586db) /* 0.442755564 */, 17 },
- /* 3740 */ { MAD_F(0x07162c6c) /* 0.442913458 */, 17 },
- /* 3741 */ { MAD_F(0x0716d200) /* 0.443071366 */, 17 },
- /* 3742 */ { MAD_F(0x07177798) /* 0.443229289 */, 17 },
- /* 3743 */ { MAD_F(0x07181d34) /* 0.443387226 */, 17 },
-
- /* 3744 */ { MAD_F(0x0718c2d3) /* 0.443545176 */, 17 },
- /* 3745 */ { MAD_F(0x07196877) /* 0.443703141 */, 17 },
- /* 3746 */ { MAD_F(0x071a0e1e) /* 0.443861120 */, 17 },
- /* 3747 */ { MAD_F(0x071ab3c9) /* 0.444019113 */, 17 },
- /* 3748 */ { MAD_F(0x071b5977) /* 0.444177119 */, 17 },
- /* 3749 */ { MAD_F(0x071bff2a) /* 0.444335140 */, 17 },
- /* 3750 */ { MAD_F(0x071ca4e0) /* 0.444493175 */, 17 },
- /* 3751 */ { MAD_F(0x071d4a9a) /* 0.444651224 */, 17 },
- /* 3752 */ { MAD_F(0x071df058) /* 0.444809288 */, 17 },
- /* 3753 */ { MAD_F(0x071e9619) /* 0.444967365 */, 17 },
- /* 3754 */ { MAD_F(0x071f3bde) /* 0.445125456 */, 17 },
- /* 3755 */ { MAD_F(0x071fe1a8) /* 0.445283561 */, 17 },
- /* 3756 */ { MAD_F(0x07208774) /* 0.445441680 */, 17 },
- /* 3757 */ { MAD_F(0x07212d45) /* 0.445599814 */, 17 },
- /* 3758 */ { MAD_F(0x0721d319) /* 0.445757961 */, 17 },
- /* 3759 */ { MAD_F(0x072278f1) /* 0.445916122 */, 17 },
-
- /* 3760 */ { MAD_F(0x07231ecd) /* 0.446074298 */, 17 },
- /* 3761 */ { MAD_F(0x0723c4ad) /* 0.446232487 */, 17 },
- /* 3762 */ { MAD_F(0x07246a90) /* 0.446390690 */, 17 },
- /* 3763 */ { MAD_F(0x07251077) /* 0.446548908 */, 17 },
- /* 3764 */ { MAD_F(0x0725b662) /* 0.446707139 */, 17 },
- /* 3765 */ { MAD_F(0x07265c51) /* 0.446865385 */, 17 },
- /* 3766 */ { MAD_F(0x07270244) /* 0.447023644 */, 17 },
- /* 3767 */ { MAD_F(0x0727a83a) /* 0.447181918 */, 17 },
- /* 3768 */ { MAD_F(0x07284e34) /* 0.447340205 */, 17 },
- /* 3769 */ { MAD_F(0x0728f431) /* 0.447498507 */, 17 },
- /* 3770 */ { MAD_F(0x07299a33) /* 0.447656822 */, 17 },
- /* 3771 */ { MAD_F(0x072a4038) /* 0.447815152 */, 17 },
- /* 3772 */ { MAD_F(0x072ae641) /* 0.447973495 */, 17 },
- /* 3773 */ { MAD_F(0x072b8c4e) /* 0.448131853 */, 17 },
- /* 3774 */ { MAD_F(0x072c325e) /* 0.448290224 */, 17 },
- /* 3775 */ { MAD_F(0x072cd873) /* 0.448448609 */, 17 },
-
- /* 3776 */ { MAD_F(0x072d7e8b) /* 0.448607009 */, 17 },
- /* 3777 */ { MAD_F(0x072e24a7) /* 0.448765422 */, 17 },
- /* 3778 */ { MAD_F(0x072ecac6) /* 0.448923850 */, 17 },
- /* 3779 */ { MAD_F(0x072f70e9) /* 0.449082291 */, 17 },
- /* 3780 */ { MAD_F(0x07301710) /* 0.449240746 */, 17 },
- /* 3781 */ { MAD_F(0x0730bd3b) /* 0.449399216 */, 17 },
- /* 3782 */ { MAD_F(0x0731636a) /* 0.449557699 */, 17 },
- /* 3783 */ { MAD_F(0x0732099c) /* 0.449716196 */, 17 },
- /* 3784 */ { MAD_F(0x0732afd2) /* 0.449874708 */, 17 },
- /* 3785 */ { MAD_F(0x0733560c) /* 0.450033233 */, 17 },
- /* 3786 */ { MAD_F(0x0733fc49) /* 0.450191772 */, 17 },
- /* 3787 */ { MAD_F(0x0734a28b) /* 0.450350325 */, 17 },
- /* 3788 */ { MAD_F(0x073548d0) /* 0.450508892 */, 17 },
- /* 3789 */ { MAD_F(0x0735ef18) /* 0.450667473 */, 17 },
- /* 3790 */ { MAD_F(0x07369565) /* 0.450826068 */, 17 },
- /* 3791 */ { MAD_F(0x07373bb5) /* 0.450984677 */, 17 },
-
- /* 3792 */ { MAD_F(0x0737e209) /* 0.451143300 */, 17 },
- /* 3793 */ { MAD_F(0x07388861) /* 0.451301937 */, 17 },
- /* 3794 */ { MAD_F(0x07392ebc) /* 0.451460588 */, 17 },
- /* 3795 */ { MAD_F(0x0739d51c) /* 0.451619252 */, 17 },
- /* 3796 */ { MAD_F(0x073a7b7f) /* 0.451777931 */, 17 },
- /* 3797 */ { MAD_F(0x073b21e5) /* 0.451936623 */, 17 },
- /* 3798 */ { MAD_F(0x073bc850) /* 0.452095330 */, 17 },
- /* 3799 */ { MAD_F(0x073c6ebe) /* 0.452254050 */, 17 },
- /* 3800 */ { MAD_F(0x073d1530) /* 0.452412785 */, 17 },
- /* 3801 */ { MAD_F(0x073dbba6) /* 0.452571533 */, 17 },
- /* 3802 */ { MAD_F(0x073e621f) /* 0.452730295 */, 17 },
- /* 3803 */ { MAD_F(0x073f089c) /* 0.452889071 */, 17 },
- /* 3804 */ { MAD_F(0x073faf1d) /* 0.453047861 */, 17 },
- /* 3805 */ { MAD_F(0x074055a2) /* 0.453206665 */, 17 },
- /* 3806 */ { MAD_F(0x0740fc2a) /* 0.453365483 */, 17 },
- /* 3807 */ { MAD_F(0x0741a2b6) /* 0.453524315 */, 17 },
-
- /* 3808 */ { MAD_F(0x07424946) /* 0.453683161 */, 17 },
- /* 3809 */ { MAD_F(0x0742efd9) /* 0.453842020 */, 17 },
- /* 3810 */ { MAD_F(0x07439671) /* 0.454000894 */, 17 },
- /* 3811 */ { MAD_F(0x07443d0c) /* 0.454159781 */, 17 },
- /* 3812 */ { MAD_F(0x0744e3aa) /* 0.454318683 */, 17 },
- /* 3813 */ { MAD_F(0x07458a4d) /* 0.454477598 */, 17 },
- /* 3814 */ { MAD_F(0x074630f3) /* 0.454636527 */, 17 },
- /* 3815 */ { MAD_F(0x0746d79d) /* 0.454795470 */, 17 },
- /* 3816 */ { MAD_F(0x07477e4b) /* 0.454954427 */, 17 },
- /* 3817 */ { MAD_F(0x074824fc) /* 0.455113397 */, 17 },
- /* 3818 */ { MAD_F(0x0748cbb1) /* 0.455272382 */, 17 },
- /* 3819 */ { MAD_F(0x0749726a) /* 0.455431381 */, 17 },
- /* 3820 */ { MAD_F(0x074a1927) /* 0.455590393 */, 17 },
- /* 3821 */ { MAD_F(0x074abfe7) /* 0.455749419 */, 17 },
- /* 3822 */ { MAD_F(0x074b66ab) /* 0.455908459 */, 17 },
- /* 3823 */ { MAD_F(0x074c0d73) /* 0.456067513 */, 17 },
-
- /* 3824 */ { MAD_F(0x074cb43e) /* 0.456226581 */, 17 },
- /* 3825 */ { MAD_F(0x074d5b0d) /* 0.456385663 */, 17 },
- /* 3826 */ { MAD_F(0x074e01e0) /* 0.456544759 */, 17 },
- /* 3827 */ { MAD_F(0x074ea8b7) /* 0.456703868 */, 17 },
- /* 3828 */ { MAD_F(0x074f4f91) /* 0.456862992 */, 17 },
- /* 3829 */ { MAD_F(0x074ff66f) /* 0.457022129 */, 17 },
- /* 3830 */ { MAD_F(0x07509d51) /* 0.457181280 */, 17 },
- /* 3831 */ { MAD_F(0x07514437) /* 0.457340445 */, 17 },
- /* 3832 */ { MAD_F(0x0751eb20) /* 0.457499623 */, 17 },
- /* 3833 */ { MAD_F(0x0752920d) /* 0.457658816 */, 17 },
- /* 3834 */ { MAD_F(0x075338fd) /* 0.457818022 */, 17 },
- /* 3835 */ { MAD_F(0x0753dff2) /* 0.457977243 */, 17 },
- /* 3836 */ { MAD_F(0x075486ea) /* 0.458136477 */, 17 },
- /* 3837 */ { MAD_F(0x07552de6) /* 0.458295725 */, 17 },
- /* 3838 */ { MAD_F(0x0755d4e5) /* 0.458454987 */, 17 },
- /* 3839 */ { MAD_F(0x07567be8) /* 0.458614262 */, 17 },
-
- /* 3840 */ { MAD_F(0x075722ef) /* 0.458773552 */, 17 },
- /* 3841 */ { MAD_F(0x0757c9fa) /* 0.458932855 */, 17 },
- /* 3842 */ { MAD_F(0x07587108) /* 0.459092172 */, 17 },
- /* 3843 */ { MAD_F(0x0759181a) /* 0.459251503 */, 17 },
- /* 3844 */ { MAD_F(0x0759bf30) /* 0.459410848 */, 17 },
- /* 3845 */ { MAD_F(0x075a664a) /* 0.459570206 */, 17 },
- /* 3846 */ { MAD_F(0x075b0d67) /* 0.459729579 */, 17 },
- /* 3847 */ { MAD_F(0x075bb488) /* 0.459888965 */, 17 },
- /* 3848 */ { MAD_F(0x075c5bac) /* 0.460048365 */, 17 },
- /* 3849 */ { MAD_F(0x075d02d5) /* 0.460207779 */, 17 },
- /* 3850 */ { MAD_F(0x075daa01) /* 0.460367206 */, 17 },
- /* 3851 */ { MAD_F(0x075e5130) /* 0.460526648 */, 17 },
- /* 3852 */ { MAD_F(0x075ef864) /* 0.460686103 */, 17 },
- /* 3853 */ { MAD_F(0x075f9f9b) /* 0.460845572 */, 17 },
- /* 3854 */ { MAD_F(0x076046d6) /* 0.461005055 */, 17 },
- /* 3855 */ { MAD_F(0x0760ee14) /* 0.461164552 */, 17 },
-
- /* 3856 */ { MAD_F(0x07619557) /* 0.461324062 */, 17 },
- /* 3857 */ { MAD_F(0x07623c9d) /* 0.461483586 */, 17 },
- /* 3858 */ { MAD_F(0x0762e3e6) /* 0.461643124 */, 17 },
- /* 3859 */ { MAD_F(0x07638b34) /* 0.461802676 */, 17 },
- /* 3860 */ { MAD_F(0x07643285) /* 0.461962242 */, 17 },
- /* 3861 */ { MAD_F(0x0764d9d9) /* 0.462121821 */, 17 },
- /* 3862 */ { MAD_F(0x07658132) /* 0.462281414 */, 17 },
- /* 3863 */ { MAD_F(0x0766288e) /* 0.462441021 */, 17 },
- /* 3864 */ { MAD_F(0x0766cfee) /* 0.462600642 */, 17 },
- /* 3865 */ { MAD_F(0x07677751) /* 0.462760276 */, 17 },
- /* 3866 */ { MAD_F(0x07681eb9) /* 0.462919924 */, 17 },
- /* 3867 */ { MAD_F(0x0768c624) /* 0.463079586 */, 17 },
- /* 3868 */ { MAD_F(0x07696d92) /* 0.463239262 */, 17 },
- /* 3869 */ { MAD_F(0x076a1505) /* 0.463398951 */, 17 },
- /* 3870 */ { MAD_F(0x076abc7b) /* 0.463558655 */, 17 },
- /* 3871 */ { MAD_F(0x076b63f4) /* 0.463718372 */, 17 },
-
- /* 3872 */ { MAD_F(0x076c0b72) /* 0.463878102 */, 17 },
- /* 3873 */ { MAD_F(0x076cb2f3) /* 0.464037847 */, 17 },
- /* 3874 */ { MAD_F(0x076d5a78) /* 0.464197605 */, 17 },
- /* 3875 */ { MAD_F(0x076e0200) /* 0.464357377 */, 17 },
- /* 3876 */ { MAD_F(0x076ea98c) /* 0.464517163 */, 17 },
- /* 3877 */ { MAD_F(0x076f511c) /* 0.464676962 */, 17 },
- /* 3878 */ { MAD_F(0x076ff8b0) /* 0.464836776 */, 17 },
- /* 3879 */ { MAD_F(0x0770a047) /* 0.464996603 */, 17 },
- /* 3880 */ { MAD_F(0x077147e2) /* 0.465156443 */, 17 },
- /* 3881 */ { MAD_F(0x0771ef80) /* 0.465316298 */, 17 },
- /* 3882 */ { MAD_F(0x07729723) /* 0.465476166 */, 17 },
- /* 3883 */ { MAD_F(0x07733ec9) /* 0.465636048 */, 17 },
- /* 3884 */ { MAD_F(0x0773e672) /* 0.465795943 */, 17 },
- /* 3885 */ { MAD_F(0x07748e20) /* 0.465955853 */, 17 },
- /* 3886 */ { MAD_F(0x077535d1) /* 0.466115776 */, 17 },
- /* 3887 */ { MAD_F(0x0775dd85) /* 0.466275713 */, 17 },
-
- /* 3888 */ { MAD_F(0x0776853e) /* 0.466435663 */, 17 },
- /* 3889 */ { MAD_F(0x07772cfa) /* 0.466595627 */, 17 },
- /* 3890 */ { MAD_F(0x0777d4ba) /* 0.466755605 */, 17 },
- /* 3891 */ { MAD_F(0x07787c7d) /* 0.466915597 */, 17 },
- /* 3892 */ { MAD_F(0x07792444) /* 0.467075602 */, 17 },
- /* 3893 */ { MAD_F(0x0779cc0f) /* 0.467235621 */, 17 },
- /* 3894 */ { MAD_F(0x077a73dd) /* 0.467395654 */, 17 },
- /* 3895 */ { MAD_F(0x077b1baf) /* 0.467555701 */, 17 },
- /* 3896 */ { MAD_F(0x077bc385) /* 0.467715761 */, 17 },
- /* 3897 */ { MAD_F(0x077c6b5f) /* 0.467875835 */, 17 },
- /* 3898 */ { MAD_F(0x077d133c) /* 0.468035922 */, 17 },
- /* 3899 */ { MAD_F(0x077dbb1d) /* 0.468196023 */, 17 },
- /* 3900 */ { MAD_F(0x077e6301) /* 0.468356138 */, 17 },
- /* 3901 */ { MAD_F(0x077f0ae9) /* 0.468516267 */, 17 },
- /* 3902 */ { MAD_F(0x077fb2d5) /* 0.468676409 */, 17 },
- /* 3903 */ { MAD_F(0x07805ac5) /* 0.468836565 */, 17 },
-
- /* 3904 */ { MAD_F(0x078102b8) /* 0.468996735 */, 17 },
- /* 3905 */ { MAD_F(0x0781aaaf) /* 0.469156918 */, 17 },
- /* 3906 */ { MAD_F(0x078252aa) /* 0.469317115 */, 17 },
- /* 3907 */ { MAD_F(0x0782faa8) /* 0.469477326 */, 17 },
- /* 3908 */ { MAD_F(0x0783a2aa) /* 0.469637550 */, 17 },
- /* 3909 */ { MAD_F(0x07844aaf) /* 0.469797788 */, 17 },
- /* 3910 */ { MAD_F(0x0784f2b8) /* 0.469958040 */, 17 },
- /* 3911 */ { MAD_F(0x07859ac5) /* 0.470118305 */, 17 },
- /* 3912 */ { MAD_F(0x078642d6) /* 0.470278584 */, 17 },
- /* 3913 */ { MAD_F(0x0786eaea) /* 0.470438877 */, 17 },
- /* 3914 */ { MAD_F(0x07879302) /* 0.470599183 */, 17 },
- /* 3915 */ { MAD_F(0x07883b1e) /* 0.470759503 */, 17 },
- /* 3916 */ { MAD_F(0x0788e33d) /* 0.470919836 */, 17 },
- /* 3917 */ { MAD_F(0x07898b60) /* 0.471080184 */, 17 },
- /* 3918 */ { MAD_F(0x078a3386) /* 0.471240545 */, 17 },
- /* 3919 */ { MAD_F(0x078adbb0) /* 0.471400919 */, 17 },
-
- /* 3920 */ { MAD_F(0x078b83de) /* 0.471561307 */, 17 },
- /* 3921 */ { MAD_F(0x078c2c10) /* 0.471721709 */, 17 },
- /* 3922 */ { MAD_F(0x078cd445) /* 0.471882125 */, 17 },
- /* 3923 */ { MAD_F(0x078d7c7e) /* 0.472042554 */, 17 },
- /* 3924 */ { MAD_F(0x078e24ba) /* 0.472202996 */, 17 },
- /* 3925 */ { MAD_F(0x078eccfb) /* 0.472363453 */, 17 },
- /* 3926 */ { MAD_F(0x078f753e) /* 0.472523923 */, 17 },
- /* 3927 */ { MAD_F(0x07901d86) /* 0.472684406 */, 17 },
- /* 3928 */ { MAD_F(0x0790c5d1) /* 0.472844904 */, 17 },
- /* 3929 */ { MAD_F(0x07916e20) /* 0.473005414 */, 17 },
- /* 3930 */ { MAD_F(0x07921672) /* 0.473165939 */, 17 },
- /* 3931 */ { MAD_F(0x0792bec8) /* 0.473326477 */, 17 },
- /* 3932 */ { MAD_F(0x07936722) /* 0.473487029 */, 17 },
- /* 3933 */ { MAD_F(0x07940f80) /* 0.473647594 */, 17 },
- /* 3934 */ { MAD_F(0x0794b7e1) /* 0.473808173 */, 17 },
- /* 3935 */ { MAD_F(0x07956045) /* 0.473968765 */, 17 },
-
- /* 3936 */ { MAD_F(0x079608ae) /* 0.474129372 */, 17 },
- /* 3937 */ { MAD_F(0x0796b11a) /* 0.474289991 */, 17 },
- /* 3938 */ { MAD_F(0x0797598a) /* 0.474450625 */, 17 },
- /* 3939 */ { MAD_F(0x079801fd) /* 0.474611272 */, 17 },
- /* 3940 */ { MAD_F(0x0798aa74) /* 0.474771932 */, 17 },
- /* 3941 */ { MAD_F(0x079952ee) /* 0.474932606 */, 17 },
- /* 3942 */ { MAD_F(0x0799fb6d) /* 0.475093294 */, 17 },
- /* 3943 */ { MAD_F(0x079aa3ef) /* 0.475253995 */, 17 },
- /* 3944 */ { MAD_F(0x079b4c74) /* 0.475414710 */, 17 },
- /* 3945 */ { MAD_F(0x079bf4fd) /* 0.475575439 */, 17 },
- /* 3946 */ { MAD_F(0x079c9d8a) /* 0.475736181 */, 17 },
- /* 3947 */ { MAD_F(0x079d461b) /* 0.475896936 */, 17 },
- /* 3948 */ { MAD_F(0x079deeaf) /* 0.476057705 */, 17 },
- /* 3949 */ { MAD_F(0x079e9747) /* 0.476218488 */, 17 },
- /* 3950 */ { MAD_F(0x079f3fe2) /* 0.476379285 */, 17 },
- /* 3951 */ { MAD_F(0x079fe881) /* 0.476540095 */, 17 },
-
- /* 3952 */ { MAD_F(0x07a09124) /* 0.476700918 */, 17 },
- /* 3953 */ { MAD_F(0x07a139ca) /* 0.476861755 */, 17 },
- /* 3954 */ { MAD_F(0x07a1e274) /* 0.477022606 */, 17 },
- /* 3955 */ { MAD_F(0x07a28b22) /* 0.477183470 */, 17 },
- /* 3956 */ { MAD_F(0x07a333d3) /* 0.477344348 */, 17 },
- /* 3957 */ { MAD_F(0x07a3dc88) /* 0.477505239 */, 17 },
- /* 3958 */ { MAD_F(0x07a48541) /* 0.477666144 */, 17 },
- /* 3959 */ { MAD_F(0x07a52dfd) /* 0.477827062 */, 17 },
- /* 3960 */ { MAD_F(0x07a5d6bd) /* 0.477987994 */, 17 },
- /* 3961 */ { MAD_F(0x07a67f80) /* 0.478148940 */, 17 },
- /* 3962 */ { MAD_F(0x07a72847) /* 0.478309899 */, 17 },
- /* 3963 */ { MAD_F(0x07a7d112) /* 0.478470871 */, 17 },
- /* 3964 */ { MAD_F(0x07a879e1) /* 0.478631857 */, 17 },
- /* 3965 */ { MAD_F(0x07a922b3) /* 0.478792857 */, 17 },
- /* 3966 */ { MAD_F(0x07a9cb88) /* 0.478953870 */, 17 },
- /* 3967 */ { MAD_F(0x07aa7462) /* 0.479114897 */, 17 },
-
- /* 3968 */ { MAD_F(0x07ab1d3e) /* 0.479275937 */, 17 },
- /* 3969 */ { MAD_F(0x07abc61f) /* 0.479436991 */, 17 },
- /* 3970 */ { MAD_F(0x07ac6f03) /* 0.479598058 */, 17 },
- /* 3971 */ { MAD_F(0x07ad17eb) /* 0.479759139 */, 17 },
- /* 3972 */ { MAD_F(0x07adc0d6) /* 0.479920233 */, 17 },
- /* 3973 */ { MAD_F(0x07ae69c6) /* 0.480081341 */, 17 },
- /* 3974 */ { MAD_F(0x07af12b8) /* 0.480242463 */, 17 },
- /* 3975 */ { MAD_F(0x07afbbaf) /* 0.480403598 */, 17 },
- /* 3976 */ { MAD_F(0x07b064a8) /* 0.480564746 */, 17 },
- /* 3977 */ { MAD_F(0x07b10da6) /* 0.480725908 */, 17 },
- /* 3978 */ { MAD_F(0x07b1b6a7) /* 0.480887083 */, 17 },
- /* 3979 */ { MAD_F(0x07b25fac) /* 0.481048272 */, 17 },
- /* 3980 */ { MAD_F(0x07b308b5) /* 0.481209475 */, 17 },
- /* 3981 */ { MAD_F(0x07b3b1c1) /* 0.481370691 */, 17 },
- /* 3982 */ { MAD_F(0x07b45ad0) /* 0.481531920 */, 17 },
- /* 3983 */ { MAD_F(0x07b503e4) /* 0.481693163 */, 17 },
-
- /* 3984 */ { MAD_F(0x07b5acfb) /* 0.481854420 */, 17 },
- /* 3985 */ { MAD_F(0x07b65615) /* 0.482015690 */, 17 },
- /* 3986 */ { MAD_F(0x07b6ff33) /* 0.482176973 */, 17 },
- /* 3987 */ { MAD_F(0x07b7a855) /* 0.482338270 */, 17 },
- /* 3988 */ { MAD_F(0x07b8517b) /* 0.482499580 */, 17 },
- /* 3989 */ { MAD_F(0x07b8faa4) /* 0.482660904 */, 17 },
- /* 3990 */ { MAD_F(0x07b9a3d0) /* 0.482822242 */, 17 },
- /* 3991 */ { MAD_F(0x07ba4d01) /* 0.482983592 */, 17 },
- /* 3992 */ { MAD_F(0x07baf635) /* 0.483144957 */, 17 },
- /* 3993 */ { MAD_F(0x07bb9f6c) /* 0.483306335 */, 17 },
- /* 3994 */ { MAD_F(0x07bc48a7) /* 0.483467726 */, 17 },
- /* 3995 */ { MAD_F(0x07bcf1e6) /* 0.483629131 */, 17 },
- /* 3996 */ { MAD_F(0x07bd9b28) /* 0.483790549 */, 17 },
- /* 3997 */ { MAD_F(0x07be446e) /* 0.483951980 */, 17 },
- /* 3998 */ { MAD_F(0x07beedb8) /* 0.484113426 */, 17 },
- /* 3999 */ { MAD_F(0x07bf9705) /* 0.484274884 */, 17 },
-
- /* 4000 */ { MAD_F(0x07c04056) /* 0.484436356 */, 17 },
- /* 4001 */ { MAD_F(0x07c0e9aa) /* 0.484597842 */, 17 },
- /* 4002 */ { MAD_F(0x07c19302) /* 0.484759341 */, 17 },
- /* 4003 */ { MAD_F(0x07c23c5e) /* 0.484920853 */, 17 },
- /* 4004 */ { MAD_F(0x07c2e5bd) /* 0.485082379 */, 17 },
- /* 4005 */ { MAD_F(0x07c38f20) /* 0.485243918 */, 17 },
- /* 4006 */ { MAD_F(0x07c43887) /* 0.485405471 */, 17 },
- /* 4007 */ { MAD_F(0x07c4e1f1) /* 0.485567037 */, 17 },
- /* 4008 */ { MAD_F(0x07c58b5f) /* 0.485728617 */, 17 },
- /* 4009 */ { MAD_F(0x07c634d0) /* 0.485890210 */, 17 },
- /* 4010 */ { MAD_F(0x07c6de45) /* 0.486051817 */, 17 },
- /* 4011 */ { MAD_F(0x07c787bd) /* 0.486213436 */, 17 },
- /* 4012 */ { MAD_F(0x07c83139) /* 0.486375070 */, 17 },
- /* 4013 */ { MAD_F(0x07c8dab9) /* 0.486536717 */, 17 },
- /* 4014 */ { MAD_F(0x07c9843c) /* 0.486698377 */, 17 },
- /* 4015 */ { MAD_F(0x07ca2dc3) /* 0.486860051 */, 17 },
-
- /* 4016 */ { MAD_F(0x07cad74e) /* 0.487021738 */, 17 },
- /* 4017 */ { MAD_F(0x07cb80dc) /* 0.487183438 */, 17 },
- /* 4018 */ { MAD_F(0x07cc2a6e) /* 0.487345152 */, 17 },
- /* 4019 */ { MAD_F(0x07ccd403) /* 0.487506879 */, 17 },
- /* 4020 */ { MAD_F(0x07cd7d9c) /* 0.487668620 */, 17 },
- /* 4021 */ { MAD_F(0x07ce2739) /* 0.487830374 */, 17 },
- /* 4022 */ { MAD_F(0x07ced0d9) /* 0.487992142 */, 17 },
- /* 4023 */ { MAD_F(0x07cf7a7d) /* 0.488153923 */, 17 },
- /* 4024 */ { MAD_F(0x07d02424) /* 0.488315717 */, 17 },
- /* 4025 */ { MAD_F(0x07d0cdcf) /* 0.488477525 */, 17 },
- /* 4026 */ { MAD_F(0x07d1777e) /* 0.488639346 */, 17 },
- /* 4027 */ { MAD_F(0x07d22130) /* 0.488801181 */, 17 },
- /* 4028 */ { MAD_F(0x07d2cae5) /* 0.488963029 */, 17 },
- /* 4029 */ { MAD_F(0x07d3749f) /* 0.489124890 */, 17 },
- /* 4030 */ { MAD_F(0x07d41e5c) /* 0.489286765 */, 17 },
- /* 4031 */ { MAD_F(0x07d4c81c) /* 0.489448653 */, 17 },
-
- /* 4032 */ { MAD_F(0x07d571e0) /* 0.489610555 */, 17 },
- /* 4033 */ { MAD_F(0x07d61ba8) /* 0.489772470 */, 17 },
- /* 4034 */ { MAD_F(0x07d6c573) /* 0.489934398 */, 17 },
- /* 4035 */ { MAD_F(0x07d76f42) /* 0.490096340 */, 17 },
- /* 4036 */ { MAD_F(0x07d81915) /* 0.490258295 */, 17 },
- /* 4037 */ { MAD_F(0x07d8c2eb) /* 0.490420263 */, 17 },
- /* 4038 */ { MAD_F(0x07d96cc4) /* 0.490582245 */, 17 },
- /* 4039 */ { MAD_F(0x07da16a2) /* 0.490744240 */, 17 },
- /* 4040 */ { MAD_F(0x07dac083) /* 0.490906249 */, 17 },
- /* 4041 */ { MAD_F(0x07db6a67) /* 0.491068271 */, 17 },
- /* 4042 */ { MAD_F(0x07dc144f) /* 0.491230306 */, 17 },
- /* 4043 */ { MAD_F(0x07dcbe3b) /* 0.491392355 */, 17 },
- /* 4044 */ { MAD_F(0x07dd682a) /* 0.491554417 */, 17 },
- /* 4045 */ { MAD_F(0x07de121d) /* 0.491716492 */, 17 },
- /* 4046 */ { MAD_F(0x07debc13) /* 0.491878581 */, 17 },
- /* 4047 */ { MAD_F(0x07df660d) /* 0.492040683 */, 17 },
-
- /* 4048 */ { MAD_F(0x07e0100a) /* 0.492202799 */, 17 },
- /* 4049 */ { MAD_F(0x07e0ba0c) /* 0.492364928 */, 17 },
- /* 4050 */ { MAD_F(0x07e16410) /* 0.492527070 */, 17 },
- /* 4051 */ { MAD_F(0x07e20e19) /* 0.492689225 */, 17 },
- /* 4052 */ { MAD_F(0x07e2b824) /* 0.492851394 */, 17 },
- /* 4053 */ { MAD_F(0x07e36234) /* 0.493013576 */, 17 },
- /* 4054 */ { MAD_F(0x07e40c47) /* 0.493175772 */, 17 },
- /* 4055 */ { MAD_F(0x07e4b65e) /* 0.493337981 */, 17 },
- /* 4056 */ { MAD_F(0x07e56078) /* 0.493500203 */, 17 },
- /* 4057 */ { MAD_F(0x07e60a95) /* 0.493662438 */, 17 },
- /* 4058 */ { MAD_F(0x07e6b4b7) /* 0.493824687 */, 17 },
- /* 4059 */ { MAD_F(0x07e75edc) /* 0.493986949 */, 17 },
- /* 4060 */ { MAD_F(0x07e80904) /* 0.494149225 */, 17 },
- /* 4061 */ { MAD_F(0x07e8b330) /* 0.494311514 */, 17 },
- /* 4062 */ { MAD_F(0x07e95d60) /* 0.494473816 */, 17 },
- /* 4063 */ { MAD_F(0x07ea0793) /* 0.494636131 */, 17 },
-
- /* 4064 */ { MAD_F(0x07eab1ca) /* 0.494798460 */, 17 },
- /* 4065 */ { MAD_F(0x07eb5c04) /* 0.494960802 */, 17 },
- /* 4066 */ { MAD_F(0x07ec0642) /* 0.495123158 */, 17 },
- /* 4067 */ { MAD_F(0x07ecb084) /* 0.495285526 */, 17 },
- /* 4068 */ { MAD_F(0x07ed5ac9) /* 0.495447908 */, 17 },
- /* 4069 */ { MAD_F(0x07ee0512) /* 0.495610304 */, 17 },
- /* 4070 */ { MAD_F(0x07eeaf5e) /* 0.495772712 */, 17 },
- /* 4071 */ { MAD_F(0x07ef59ae) /* 0.495935134 */, 17 },
- /* 4072 */ { MAD_F(0x07f00401) /* 0.496097570 */, 17 },
- /* 4073 */ { MAD_F(0x07f0ae58) /* 0.496260018 */, 17 },
- /* 4074 */ { MAD_F(0x07f158b3) /* 0.496422480 */, 17 },
- /* 4075 */ { MAD_F(0x07f20311) /* 0.496584955 */, 17 },
- /* 4076 */ { MAD_F(0x07f2ad72) /* 0.496747444 */, 17 },
- /* 4077 */ { MAD_F(0x07f357d8) /* 0.496909945 */, 17 },
- /* 4078 */ { MAD_F(0x07f40240) /* 0.497072460 */, 17 },
- /* 4079 */ { MAD_F(0x07f4acad) /* 0.497234989 */, 17 },
-
- /* 4080 */ { MAD_F(0x07f5571d) /* 0.497397530 */, 17 },
- /* 4081 */ { MAD_F(0x07f60190) /* 0.497560085 */, 17 },
- /* 4082 */ { MAD_F(0x07f6ac07) /* 0.497722653 */, 17 },
- /* 4083 */ { MAD_F(0x07f75682) /* 0.497885235 */, 17 },
- /* 4084 */ { MAD_F(0x07f80100) /* 0.498047829 */, 17 },
- /* 4085 */ { MAD_F(0x07f8ab82) /* 0.498210437 */, 17 },
- /* 4086 */ { MAD_F(0x07f95607) /* 0.498373058 */, 17 },
- /* 4087 */ { MAD_F(0x07fa0090) /* 0.498535693 */, 17 },
- /* 4088 */ { MAD_F(0x07faab1c) /* 0.498698341 */, 17 },
- /* 4089 */ { MAD_F(0x07fb55ac) /* 0.498861002 */, 17 },
- /* 4090 */ { MAD_F(0x07fc0040) /* 0.499023676 */, 17 },
- /* 4091 */ { MAD_F(0x07fcaad7) /* 0.499186364 */, 17 },
- /* 4092 */ { MAD_F(0x07fd5572) /* 0.499349064 */, 17 },
- /* 4093 */ { MAD_F(0x07fe0010) /* 0.499511778 */, 17 },
- /* 4094 */ { MAD_F(0x07feaab2) /* 0.499674506 */, 17 },
- /* 4095 */ { MAD_F(0x07ff5557) /* 0.499837246 */, 17 },
-
- /* 4096 */ { MAD_F(0x04000000) /* 0.250000000 */, 18 },
- /* 4097 */ { MAD_F(0x04005556) /* 0.250081384 */, 18 },
- /* 4098 */ { MAD_F(0x0400aaae) /* 0.250162774 */, 18 },
- /* 4099 */ { MAD_F(0x04010008) /* 0.250244170 */, 18 },
- /* 4100 */ { MAD_F(0x04015563) /* 0.250325574 */, 18 },
- /* 4101 */ { MAD_F(0x0401aac1) /* 0.250406984 */, 18 },
- /* 4102 */ { MAD_F(0x04020020) /* 0.250488400 */, 18 },
- /* 4103 */ { MAD_F(0x04025581) /* 0.250569824 */, 18 },
- /* 4104 */ { MAD_F(0x0402aae3) /* 0.250651254 */, 18 },
- /* 4105 */ { MAD_F(0x04030048) /* 0.250732690 */, 18 },
- /* 4106 */ { MAD_F(0x040355ae) /* 0.250814133 */, 18 },
- /* 4107 */ { MAD_F(0x0403ab16) /* 0.250895583 */, 18 },
- /* 4108 */ { MAD_F(0x04040080) /* 0.250977039 */, 18 },
- /* 4109 */ { MAD_F(0x040455eb) /* 0.251058502 */, 18 },
- /* 4110 */ { MAD_F(0x0404ab59) /* 0.251139971 */, 18 },
- /* 4111 */ { MAD_F(0x040500c8) /* 0.251221448 */, 18 },
-
- /* 4112 */ { MAD_F(0x04055638) /* 0.251302930 */, 18 },
- /* 4113 */ { MAD_F(0x0405abab) /* 0.251384420 */, 18 },
- /* 4114 */ { MAD_F(0x0406011f) /* 0.251465916 */, 18 },
- /* 4115 */ { MAD_F(0x04065696) /* 0.251547418 */, 18 },
- /* 4116 */ { MAD_F(0x0406ac0e) /* 0.251628927 */, 18 },
- /* 4117 */ { MAD_F(0x04070187) /* 0.251710443 */, 18 },
- /* 4118 */ { MAD_F(0x04075703) /* 0.251791965 */, 18 },
- /* 4119 */ { MAD_F(0x0407ac80) /* 0.251873494 */, 18 },
- /* 4120 */ { MAD_F(0x040801ff) /* 0.251955030 */, 18 },
- /* 4121 */ { MAD_F(0x04085780) /* 0.252036572 */, 18 },
- /* 4122 */ { MAD_F(0x0408ad02) /* 0.252118121 */, 18 },
- /* 4123 */ { MAD_F(0x04090287) /* 0.252199676 */, 18 },
- /* 4124 */ { MAD_F(0x0409580d) /* 0.252281238 */, 18 },
- /* 4125 */ { MAD_F(0x0409ad95) /* 0.252362807 */, 18 },
- /* 4126 */ { MAD_F(0x040a031e) /* 0.252444382 */, 18 },
- /* 4127 */ { MAD_F(0x040a58aa) /* 0.252525963 */, 18 },
-
- /* 4128 */ { MAD_F(0x040aae37) /* 0.252607552 */, 18 },
- /* 4129 */ { MAD_F(0x040b03c6) /* 0.252689147 */, 18 },
- /* 4130 */ { MAD_F(0x040b5957) /* 0.252770748 */, 18 },
- /* 4131 */ { MAD_F(0x040baee9) /* 0.252852356 */, 18 },
- /* 4132 */ { MAD_F(0x040c047e) /* 0.252933971 */, 18 },
- /* 4133 */ { MAD_F(0x040c5a14) /* 0.253015592 */, 18 },
- /* 4134 */ { MAD_F(0x040cafab) /* 0.253097220 */, 18 },
- /* 4135 */ { MAD_F(0x040d0545) /* 0.253178854 */, 18 },
- /* 4136 */ { MAD_F(0x040d5ae0) /* 0.253260495 */, 18 },
- /* 4137 */ { MAD_F(0x040db07d) /* 0.253342143 */, 18 },
- /* 4138 */ { MAD_F(0x040e061c) /* 0.253423797 */, 18 },
- /* 4139 */ { MAD_F(0x040e5bbd) /* 0.253505457 */, 18 },
- /* 4140 */ { MAD_F(0x040eb15f) /* 0.253587125 */, 18 },
- /* 4141 */ { MAD_F(0x040f0703) /* 0.253668799 */, 18 },
- /* 4142 */ { MAD_F(0x040f5ca9) /* 0.253750479 */, 18 },
- /* 4143 */ { MAD_F(0x040fb251) /* 0.253832166 */, 18 },
-
- /* 4144 */ { MAD_F(0x041007fa) /* 0.253913860 */, 18 },
- /* 4145 */ { MAD_F(0x04105da6) /* 0.253995560 */, 18 },
- /* 4146 */ { MAD_F(0x0410b353) /* 0.254077266 */, 18 },
- /* 4147 */ { MAD_F(0x04110901) /* 0.254158980 */, 18 },
- /* 4148 */ { MAD_F(0x04115eb2) /* 0.254240700 */, 18 },
- /* 4149 */ { MAD_F(0x0411b464) /* 0.254322426 */, 18 },
- /* 4150 */ { MAD_F(0x04120a18) /* 0.254404159 */, 18 },
- /* 4151 */ { MAD_F(0x04125fce) /* 0.254485899 */, 18 },
- /* 4152 */ { MAD_F(0x0412b586) /* 0.254567645 */, 18 },
- /* 4153 */ { MAD_F(0x04130b3f) /* 0.254649397 */, 18 },
- /* 4154 */ { MAD_F(0x041360fa) /* 0.254731157 */, 18 },
- /* 4155 */ { MAD_F(0x0413b6b7) /* 0.254812922 */, 18 },
- /* 4156 */ { MAD_F(0x04140c75) /* 0.254894695 */, 18 },
- /* 4157 */ { MAD_F(0x04146236) /* 0.254976474 */, 18 },
- /* 4158 */ { MAD_F(0x0414b7f8) /* 0.255058259 */, 18 },
- /* 4159 */ { MAD_F(0x04150dbc) /* 0.255140051 */, 18 },
-
- /* 4160 */ { MAD_F(0x04156381) /* 0.255221850 */, 18 },
- /* 4161 */ { MAD_F(0x0415b949) /* 0.255303655 */, 18 },
- /* 4162 */ { MAD_F(0x04160f12) /* 0.255385467 */, 18 },
- /* 4163 */ { MAD_F(0x041664dd) /* 0.255467285 */, 18 },
- /* 4164 */ { MAD_F(0x0416baaa) /* 0.255549110 */, 18 },
- /* 4165 */ { MAD_F(0x04171078) /* 0.255630941 */, 18 },
- /* 4166 */ { MAD_F(0x04176648) /* 0.255712779 */, 18 },
- /* 4167 */ { MAD_F(0x0417bc1a) /* 0.255794624 */, 18 },
- /* 4168 */ { MAD_F(0x041811ee) /* 0.255876475 */, 18 },
- /* 4169 */ { MAD_F(0x041867c3) /* 0.255958332 */, 18 },
- /* 4170 */ { MAD_F(0x0418bd9b) /* 0.256040196 */, 18 },
- /* 4171 */ { MAD_F(0x04191374) /* 0.256122067 */, 18 },
- /* 4172 */ { MAD_F(0x0419694e) /* 0.256203944 */, 18 },
- /* 4173 */ { MAD_F(0x0419bf2b) /* 0.256285828 */, 18 },
- /* 4174 */ { MAD_F(0x041a1509) /* 0.256367718 */, 18 },
- /* 4175 */ { MAD_F(0x041a6ae9) /* 0.256449615 */, 18 },
-
- /* 4176 */ { MAD_F(0x041ac0cb) /* 0.256531518 */, 18 },
- /* 4177 */ { MAD_F(0x041b16ae) /* 0.256613428 */, 18 },
- /* 4178 */ { MAD_F(0x041b6c94) /* 0.256695344 */, 18 },
- /* 4179 */ { MAD_F(0x041bc27b) /* 0.256777267 */, 18 },
- /* 4180 */ { MAD_F(0x041c1863) /* 0.256859197 */, 18 },
- /* 4181 */ { MAD_F(0x041c6e4e) /* 0.256941133 */, 18 },
- /* 4182 */ { MAD_F(0x041cc43a) /* 0.257023076 */, 18 },
- /* 4183 */ { MAD_F(0x041d1a28) /* 0.257105025 */, 18 },
- /* 4184 */ { MAD_F(0x041d7018) /* 0.257186980 */, 18 },
- /* 4185 */ { MAD_F(0x041dc60a) /* 0.257268942 */, 18 },
- /* 4186 */ { MAD_F(0x041e1bfd) /* 0.257350911 */, 18 },
- /* 4187 */ { MAD_F(0x041e71f2) /* 0.257432886 */, 18 },
- /* 4188 */ { MAD_F(0x041ec7e9) /* 0.257514868 */, 18 },
- /* 4189 */ { MAD_F(0x041f1de1) /* 0.257596856 */, 18 },
- /* 4190 */ { MAD_F(0x041f73dc) /* 0.257678851 */, 18 },
- /* 4191 */ { MAD_F(0x041fc9d8) /* 0.257760852 */, 18 },
-
- /* 4192 */ { MAD_F(0x04201fd5) /* 0.257842860 */, 18 },
- /* 4193 */ { MAD_F(0x042075d5) /* 0.257924875 */, 18 },
- /* 4194 */ { MAD_F(0x0420cbd6) /* 0.258006895 */, 18 },
- /* 4195 */ { MAD_F(0x042121d9) /* 0.258088923 */, 18 },
- /* 4196 */ { MAD_F(0x042177de) /* 0.258170957 */, 18 },
- /* 4197 */ { MAD_F(0x0421cde5) /* 0.258252997 */, 18 },
- /* 4198 */ { MAD_F(0x042223ed) /* 0.258335044 */, 18 },
- /* 4199 */ { MAD_F(0x042279f7) /* 0.258417097 */, 18 },
- /* 4200 */ { MAD_F(0x0422d003) /* 0.258499157 */, 18 },
- /* 4201 */ { MAD_F(0x04232611) /* 0.258581224 */, 18 },
- /* 4202 */ { MAD_F(0x04237c20) /* 0.258663297 */, 18 },
- /* 4203 */ { MAD_F(0x0423d231) /* 0.258745376 */, 18 },
- /* 4204 */ { MAD_F(0x04242844) /* 0.258827462 */, 18 },
- /* 4205 */ { MAD_F(0x04247e58) /* 0.258909555 */, 18 },
- /* 4206 */ { MAD_F(0x0424d46e) /* 0.258991654 */, 18 },
- /* 4207 */ { MAD_F(0x04252a87) /* 0.259073760 */, 18 },
-
- /* 4208 */ { MAD_F(0x042580a0) /* 0.259155872 */, 18 },
- /* 4209 */ { MAD_F(0x0425d6bc) /* 0.259237990 */, 18 },
- /* 4210 */ { MAD_F(0x04262cd9) /* 0.259320115 */, 18 },
- /* 4211 */ { MAD_F(0x042682f8) /* 0.259402247 */, 18 },
- /* 4212 */ { MAD_F(0x0426d919) /* 0.259484385 */, 18 },
- /* 4213 */ { MAD_F(0x04272f3b) /* 0.259566529 */, 18 },
- /* 4214 */ { MAD_F(0x04278560) /* 0.259648680 */, 18 },
- /* 4215 */ { MAD_F(0x0427db86) /* 0.259730838 */, 18 },
- /* 4216 */ { MAD_F(0x042831ad) /* 0.259813002 */, 18 },
- /* 4217 */ { MAD_F(0x042887d7) /* 0.259895173 */, 18 },
- /* 4218 */ { MAD_F(0x0428de02) /* 0.259977350 */, 18 },
- /* 4219 */ { MAD_F(0x0429342f) /* 0.260059533 */, 18 },
- /* 4220 */ { MAD_F(0x04298a5e) /* 0.260141723 */, 18 },
- /* 4221 */ { MAD_F(0x0429e08e) /* 0.260223920 */, 18 },
- /* 4222 */ { MAD_F(0x042a36c0) /* 0.260306123 */, 18 },
- /* 4223 */ { MAD_F(0x042a8cf4) /* 0.260388332 */, 18 },
-
- /* 4224 */ { MAD_F(0x042ae32a) /* 0.260470548 */, 18 },
- /* 4225 */ { MAD_F(0x042b3962) /* 0.260552771 */, 18 },
- /* 4226 */ { MAD_F(0x042b8f9b) /* 0.260635000 */, 18 },
- /* 4227 */ { MAD_F(0x042be5d6) /* 0.260717235 */, 18 },
- /* 4228 */ { MAD_F(0x042c3c12) /* 0.260799477 */, 18 },
- /* 4229 */ { MAD_F(0x042c9251) /* 0.260881725 */, 18 },
- /* 4230 */ { MAD_F(0x042ce891) /* 0.260963980 */, 18 },
- /* 4231 */ { MAD_F(0x042d3ed3) /* 0.261046242 */, 18 },
- /* 4232 */ { MAD_F(0x042d9516) /* 0.261128510 */, 18 },
- /* 4233 */ { MAD_F(0x042deb5c) /* 0.261210784 */, 18 },
- /* 4234 */ { MAD_F(0x042e41a3) /* 0.261293065 */, 18 },
- /* 4235 */ { MAD_F(0x042e97ec) /* 0.261375352 */, 18 },
- /* 4236 */ { MAD_F(0x042eee36) /* 0.261457646 */, 18 },
- /* 4237 */ { MAD_F(0x042f4482) /* 0.261539946 */, 18 },
- /* 4238 */ { MAD_F(0x042f9ad1) /* 0.261622253 */, 18 },
- /* 4239 */ { MAD_F(0x042ff120) /* 0.261704566 */, 18 },
-
- /* 4240 */ { MAD_F(0x04304772) /* 0.261786886 */, 18 },
- /* 4241 */ { MAD_F(0x04309dc5) /* 0.261869212 */, 18 },
- /* 4242 */ { MAD_F(0x0430f41a) /* 0.261951545 */, 18 },
- /* 4243 */ { MAD_F(0x04314a71) /* 0.262033884 */, 18 },
- /* 4244 */ { MAD_F(0x0431a0c9) /* 0.262116229 */, 18 },
- /* 4245 */ { MAD_F(0x0431f723) /* 0.262198581 */, 18 },
- /* 4246 */ { MAD_F(0x04324d7f) /* 0.262280940 */, 18 },
- /* 4247 */ { MAD_F(0x0432a3dd) /* 0.262363305 */, 18 },
- /* 4248 */ { MAD_F(0x0432fa3d) /* 0.262445676 */, 18 },
- /* 4249 */ { MAD_F(0x0433509e) /* 0.262528054 */, 18 },
- /* 4250 */ { MAD_F(0x0433a701) /* 0.262610438 */, 18 },
- /* 4251 */ { MAD_F(0x0433fd65) /* 0.262692829 */, 18 },
- /* 4252 */ { MAD_F(0x043453cc) /* 0.262775227 */, 18 },
- /* 4253 */ { MAD_F(0x0434aa34) /* 0.262857630 */, 18 },
- /* 4254 */ { MAD_F(0x0435009d) /* 0.262940040 */, 18 },
- /* 4255 */ { MAD_F(0x04355709) /* 0.263022457 */, 18 },
-
- /* 4256 */ { MAD_F(0x0435ad76) /* 0.263104880 */, 18 },
- /* 4257 */ { MAD_F(0x043603e5) /* 0.263187310 */, 18 },
- /* 4258 */ { MAD_F(0x04365a56) /* 0.263269746 */, 18 },
- /* 4259 */ { MAD_F(0x0436b0c9) /* 0.263352188 */, 18 },
- /* 4260 */ { MAD_F(0x0437073d) /* 0.263434637 */, 18 },
- /* 4261 */ { MAD_F(0x04375db3) /* 0.263517093 */, 18 },
- /* 4262 */ { MAD_F(0x0437b42a) /* 0.263599554 */, 18 },
- /* 4263 */ { MAD_F(0x04380aa4) /* 0.263682023 */, 18 },
- /* 4264 */ { MAD_F(0x0438611f) /* 0.263764497 */, 18 },
- /* 4265 */ { MAD_F(0x0438b79c) /* 0.263846979 */, 18 },
- /* 4266 */ { MAD_F(0x04390e1a) /* 0.263929466 */, 18 },
- /* 4267 */ { MAD_F(0x0439649b) /* 0.264011960 */, 18 },
- /* 4268 */ { MAD_F(0x0439bb1d) /* 0.264094461 */, 18 },
- /* 4269 */ { MAD_F(0x043a11a1) /* 0.264176968 */, 18 },
- /* 4270 */ { MAD_F(0x043a6826) /* 0.264259481 */, 18 },
- /* 4271 */ { MAD_F(0x043abead) /* 0.264342001 */, 18 },
-
- /* 4272 */ { MAD_F(0x043b1536) /* 0.264424527 */, 18 },
- /* 4273 */ { MAD_F(0x043b6bc1) /* 0.264507060 */, 18 },
- /* 4274 */ { MAD_F(0x043bc24d) /* 0.264589599 */, 18 },
- /* 4275 */ { MAD_F(0x043c18dc) /* 0.264672145 */, 18 },
- /* 4276 */ { MAD_F(0x043c6f6c) /* 0.264754697 */, 18 },
- /* 4277 */ { MAD_F(0x043cc5fd) /* 0.264837255 */, 18 },
- /* 4278 */ { MAD_F(0x043d1c91) /* 0.264919820 */, 18 },
- /* 4279 */ { MAD_F(0x043d7326) /* 0.265002392 */, 18 },
- /* 4280 */ { MAD_F(0x043dc9bc) /* 0.265084969 */, 18 },
- /* 4281 */ { MAD_F(0x043e2055) /* 0.265167554 */, 18 },
- /* 4282 */ { MAD_F(0x043e76ef) /* 0.265250144 */, 18 },
- /* 4283 */ { MAD_F(0x043ecd8b) /* 0.265332741 */, 18 },
- /* 4284 */ { MAD_F(0x043f2429) /* 0.265415345 */, 18 },
- /* 4285 */ { MAD_F(0x043f7ac8) /* 0.265497955 */, 18 },
- /* 4286 */ { MAD_F(0x043fd169) /* 0.265580571 */, 18 },
- /* 4287 */ { MAD_F(0x0440280c) /* 0.265663194 */, 18 },
-
- /* 4288 */ { MAD_F(0x04407eb1) /* 0.265745823 */, 18 },
- /* 4289 */ { MAD_F(0x0440d557) /* 0.265828459 */, 18 },
- /* 4290 */ { MAD_F(0x04412bff) /* 0.265911101 */, 18 },
- /* 4291 */ { MAD_F(0x044182a9) /* 0.265993749 */, 18 },
- /* 4292 */ { MAD_F(0x0441d955) /* 0.266076404 */, 18 },
- /* 4293 */ { MAD_F(0x04423002) /* 0.266159065 */, 18 },
- /* 4294 */ { MAD_F(0x044286b1) /* 0.266241733 */, 18 },
- /* 4295 */ { MAD_F(0x0442dd61) /* 0.266324407 */, 18 },
- /* 4296 */ { MAD_F(0x04433414) /* 0.266407088 */, 18 },
- /* 4297 */ { MAD_F(0x04438ac8) /* 0.266489775 */, 18 },
- /* 4298 */ { MAD_F(0x0443e17e) /* 0.266572468 */, 18 },
- /* 4299 */ { MAD_F(0x04443835) /* 0.266655168 */, 18 },
- /* 4300 */ { MAD_F(0x04448eef) /* 0.266737874 */, 18 },
- /* 4301 */ { MAD_F(0x0444e5aa) /* 0.266820587 */, 18 },
- /* 4302 */ { MAD_F(0x04453c66) /* 0.266903306 */, 18 },
- /* 4303 */ { MAD_F(0x04459325) /* 0.266986031 */, 18 },
-
- /* 4304 */ { MAD_F(0x0445e9e5) /* 0.267068763 */, 18 },
- /* 4305 */ { MAD_F(0x044640a7) /* 0.267151501 */, 18 },
- /* 4306 */ { MAD_F(0x0446976a) /* 0.267234246 */, 18 },
- /* 4307 */ { MAD_F(0x0446ee30) /* 0.267316997 */, 18 },
- /* 4308 */ { MAD_F(0x044744f7) /* 0.267399755 */, 18 },
- /* 4309 */ { MAD_F(0x04479bc0) /* 0.267482518 */, 18 },
- /* 4310 */ { MAD_F(0x0447f28a) /* 0.267565289 */, 18 },
- /* 4311 */ { MAD_F(0x04484956) /* 0.267648065 */, 18 },
- /* 4312 */ { MAD_F(0x0448a024) /* 0.267730848 */, 18 },
- /* 4313 */ { MAD_F(0x0448f6f4) /* 0.267813638 */, 18 },
- /* 4314 */ { MAD_F(0x04494dc5) /* 0.267896434 */, 18 },
- /* 4315 */ { MAD_F(0x0449a498) /* 0.267979236 */, 18 },
- /* 4316 */ { MAD_F(0x0449fb6d) /* 0.268062045 */, 18 },
- /* 4317 */ { MAD_F(0x044a5243) /* 0.268144860 */, 18 },
- /* 4318 */ { MAD_F(0x044aa91c) /* 0.268227681 */, 18 },
- /* 4319 */ { MAD_F(0x044afff6) /* 0.268310509 */, 18 },
-
- /* 4320 */ { MAD_F(0x044b56d1) /* 0.268393343 */, 18 },
- /* 4321 */ { MAD_F(0x044badaf) /* 0.268476184 */, 18 },
- /* 4322 */ { MAD_F(0x044c048e) /* 0.268559031 */, 18 },
- /* 4323 */ { MAD_F(0x044c5b6f) /* 0.268641885 */, 18 },
- /* 4324 */ { MAD_F(0x044cb251) /* 0.268724744 */, 18 },
- /* 4325 */ { MAD_F(0x044d0935) /* 0.268807611 */, 18 },
- /* 4326 */ { MAD_F(0x044d601b) /* 0.268890483 */, 18 },
- /* 4327 */ { MAD_F(0x044db703) /* 0.268973362 */, 18 },
- /* 4328 */ { MAD_F(0x044e0dec) /* 0.269056248 */, 18 },
- /* 4329 */ { MAD_F(0x044e64d7) /* 0.269139139 */, 18 },
- /* 4330 */ { MAD_F(0x044ebbc4) /* 0.269222037 */, 18 },
- /* 4331 */ { MAD_F(0x044f12b3) /* 0.269304942 */, 18 },
- /* 4332 */ { MAD_F(0x044f69a3) /* 0.269387853 */, 18 },
- /* 4333 */ { MAD_F(0x044fc095) /* 0.269470770 */, 18 },
- /* 4334 */ { MAD_F(0x04501788) /* 0.269553694 */, 18 },
- /* 4335 */ { MAD_F(0x04506e7e) /* 0.269636624 */, 18 },
-
- /* 4336 */ { MAD_F(0x0450c575) /* 0.269719560 */, 18 },
- /* 4337 */ { MAD_F(0x04511c6e) /* 0.269802503 */, 18 },
- /* 4338 */ { MAD_F(0x04517368) /* 0.269885452 */, 18 },
- /* 4339 */ { MAD_F(0x0451ca64) /* 0.269968408 */, 18 },
- /* 4340 */ { MAD_F(0x04522162) /* 0.270051370 */, 18 },
- /* 4341 */ { MAD_F(0x04527862) /* 0.270134338 */, 18 },
- /* 4342 */ { MAD_F(0x0452cf63) /* 0.270217312 */, 18 },
- /* 4343 */ { MAD_F(0x04532666) /* 0.270300293 */, 18 },
- /* 4344 */ { MAD_F(0x04537d6b) /* 0.270383281 */, 18 },
- /* 4345 */ { MAD_F(0x0453d472) /* 0.270466275 */, 18 },
- /* 4346 */ { MAD_F(0x04542b7a) /* 0.270549275 */, 18 },
- /* 4347 */ { MAD_F(0x04548284) /* 0.270632281 */, 18 },
- /* 4348 */ { MAD_F(0x0454d98f) /* 0.270715294 */, 18 },
- /* 4349 */ { MAD_F(0x0455309c) /* 0.270798313 */, 18 },
- /* 4350 */ { MAD_F(0x045587ab) /* 0.270881339 */, 18 },
- /* 4351 */ { MAD_F(0x0455debc) /* 0.270964371 */, 18 },
-
- /* 4352 */ { MAD_F(0x045635cf) /* 0.271047409 */, 18 },
- /* 4353 */ { MAD_F(0x04568ce3) /* 0.271130454 */, 18 },
- /* 4354 */ { MAD_F(0x0456e3f9) /* 0.271213505 */, 18 },
- /* 4355 */ { MAD_F(0x04573b10) /* 0.271296562 */, 18 },
- /* 4356 */ { MAD_F(0x04579229) /* 0.271379626 */, 18 },
- /* 4357 */ { MAD_F(0x0457e944) /* 0.271462696 */, 18 },
- /* 4358 */ { MAD_F(0x04584061) /* 0.271545772 */, 18 },
- /* 4359 */ { MAD_F(0x0458977f) /* 0.271628855 */, 18 },
- /* 4360 */ { MAD_F(0x0458ee9f) /* 0.271711944 */, 18 },
- /* 4361 */ { MAD_F(0x045945c1) /* 0.271795040 */, 18 },
- /* 4362 */ { MAD_F(0x04599ce5) /* 0.271878142 */, 18 },
- /* 4363 */ { MAD_F(0x0459f40a) /* 0.271961250 */, 18 },
- /* 4364 */ { MAD_F(0x045a4b31) /* 0.272044365 */, 18 },
- /* 4365 */ { MAD_F(0x045aa259) /* 0.272127486 */, 18 },
- /* 4366 */ { MAD_F(0x045af984) /* 0.272210613 */, 18 },
- /* 4367 */ { MAD_F(0x045b50b0) /* 0.272293746 */, 18 },
-
- /* 4368 */ { MAD_F(0x045ba7dd) /* 0.272376886 */, 18 },
- /* 4369 */ { MAD_F(0x045bff0d) /* 0.272460033 */, 18 },
- /* 4370 */ { MAD_F(0x045c563e) /* 0.272543185 */, 18 },
- /* 4371 */ { MAD_F(0x045cad71) /* 0.272626344 */, 18 },
- /* 4372 */ { MAD_F(0x045d04a5) /* 0.272709510 */, 18 },
- /* 4373 */ { MAD_F(0x045d5bdc) /* 0.272792681 */, 18 },
- /* 4374 */ { MAD_F(0x045db313) /* 0.272875859 */, 18 },
- /* 4375 */ { MAD_F(0x045e0a4d) /* 0.272959044 */, 18 },
- /* 4376 */ { MAD_F(0x045e6188) /* 0.273042234 */, 18 },
- /* 4377 */ { MAD_F(0x045eb8c5) /* 0.273125431 */, 18 },
- /* 4378 */ { MAD_F(0x045f1004) /* 0.273208635 */, 18 },
- /* 4379 */ { MAD_F(0x045f6745) /* 0.273291844 */, 18 },
- /* 4380 */ { MAD_F(0x045fbe87) /* 0.273375060 */, 18 },
- /* 4381 */ { MAD_F(0x046015cb) /* 0.273458283 */, 18 },
- /* 4382 */ { MAD_F(0x04606d10) /* 0.273541511 */, 18 },
- /* 4383 */ { MAD_F(0x0460c457) /* 0.273624747 */, 18 },
-
- /* 4384 */ { MAD_F(0x04611ba0) /* 0.273707988 */, 18 },
- /* 4385 */ { MAD_F(0x046172eb) /* 0.273791236 */, 18 },
- /* 4386 */ { MAD_F(0x0461ca37) /* 0.273874490 */, 18 },
- /* 4387 */ { MAD_F(0x04622185) /* 0.273957750 */, 18 },
- /* 4388 */ { MAD_F(0x046278d5) /* 0.274041017 */, 18 },
- /* 4389 */ { MAD_F(0x0462d026) /* 0.274124290 */, 18 },
- /* 4390 */ { MAD_F(0x0463277a) /* 0.274207569 */, 18 },
- /* 4391 */ { MAD_F(0x04637ece) /* 0.274290855 */, 18 },
- /* 4392 */ { MAD_F(0x0463d625) /* 0.274374147 */, 18 },
- /* 4393 */ { MAD_F(0x04642d7d) /* 0.274457445 */, 18 },
- /* 4394 */ { MAD_F(0x046484d7) /* 0.274540749 */, 18 },
- /* 4395 */ { MAD_F(0x0464dc33) /* 0.274624060 */, 18 },
- /* 4396 */ { MAD_F(0x04653390) /* 0.274707378 */, 18 },
- /* 4397 */ { MAD_F(0x04658aef) /* 0.274790701 */, 18 },
- /* 4398 */ { MAD_F(0x0465e250) /* 0.274874031 */, 18 },
- /* 4399 */ { MAD_F(0x046639b2) /* 0.274957367 */, 18 },
-
- /* 4400 */ { MAD_F(0x04669116) /* 0.275040710 */, 18 },
- /* 4401 */ { MAD_F(0x0466e87c) /* 0.275124059 */, 18 },
- /* 4402 */ { MAD_F(0x04673fe3) /* 0.275207414 */, 18 },
- /* 4403 */ { MAD_F(0x0467974d) /* 0.275290775 */, 18 },
- /* 4404 */ { MAD_F(0x0467eeb7) /* 0.275374143 */, 18 },
- /* 4405 */ { MAD_F(0x04684624) /* 0.275457517 */, 18 },
- /* 4406 */ { MAD_F(0x04689d92) /* 0.275540897 */, 18 },
- /* 4407 */ { MAD_F(0x0468f502) /* 0.275624284 */, 18 },
- /* 4408 */ { MAD_F(0x04694c74) /* 0.275707677 */, 18 },
- /* 4409 */ { MAD_F(0x0469a3e7) /* 0.275791076 */, 18 },
- /* 4410 */ { MAD_F(0x0469fb5c) /* 0.275874482 */, 18 },
- /* 4411 */ { MAD_F(0x046a52d3) /* 0.275957894 */, 18 },
- /* 4412 */ { MAD_F(0x046aaa4b) /* 0.276041312 */, 18 },
- /* 4413 */ { MAD_F(0x046b01c5) /* 0.276124737 */, 18 },
- /* 4414 */ { MAD_F(0x046b5941) /* 0.276208167 */, 18 },
- /* 4415 */ { MAD_F(0x046bb0bf) /* 0.276291605 */, 18 },
-
- /* 4416 */ { MAD_F(0x046c083e) /* 0.276375048 */, 18 },
- /* 4417 */ { MAD_F(0x046c5fbf) /* 0.276458498 */, 18 },
- /* 4418 */ { MAD_F(0x046cb741) /* 0.276541954 */, 18 },
- /* 4419 */ { MAD_F(0x046d0ec5) /* 0.276625416 */, 18 },
- /* 4420 */ { MAD_F(0x046d664b) /* 0.276708885 */, 18 },
- /* 4421 */ { MAD_F(0x046dbdd3) /* 0.276792360 */, 18 },
- /* 4422 */ { MAD_F(0x046e155c) /* 0.276875841 */, 18 },
- /* 4423 */ { MAD_F(0x046e6ce7) /* 0.276959328 */, 18 },
- /* 4424 */ { MAD_F(0x046ec474) /* 0.277042822 */, 18 },
- /* 4425 */ { MAD_F(0x046f1c02) /* 0.277126322 */, 18 },
- /* 4426 */ { MAD_F(0x046f7392) /* 0.277209829 */, 18 },
- /* 4427 */ { MAD_F(0x046fcb24) /* 0.277293341 */, 18 },
- /* 4428 */ { MAD_F(0x047022b8) /* 0.277376860 */, 18 },
- /* 4429 */ { MAD_F(0x04707a4d) /* 0.277460385 */, 18 },
- /* 4430 */ { MAD_F(0x0470d1e4) /* 0.277543917 */, 18 },
- /* 4431 */ { MAD_F(0x0471297c) /* 0.277627455 */, 18 },
-
- /* 4432 */ { MAD_F(0x04718116) /* 0.277710999 */, 18 },
- /* 4433 */ { MAD_F(0x0471d8b2) /* 0.277794549 */, 18 },
- /* 4434 */ { MAD_F(0x04723050) /* 0.277878106 */, 18 },
- /* 4435 */ { MAD_F(0x047287ef) /* 0.277961669 */, 18 },
- /* 4436 */ { MAD_F(0x0472df90) /* 0.278045238 */, 18 },
- /* 4437 */ { MAD_F(0x04733733) /* 0.278128813 */, 18 },
- /* 4438 */ { MAD_F(0x04738ed7) /* 0.278212395 */, 18 },
- /* 4439 */ { MAD_F(0x0473e67d) /* 0.278295983 */, 18 },
- /* 4440 */ { MAD_F(0x04743e25) /* 0.278379578 */, 18 },
- /* 4441 */ { MAD_F(0x047495ce) /* 0.278463178 */, 18 },
- /* 4442 */ { MAD_F(0x0474ed79) /* 0.278546785 */, 18 },
- /* 4443 */ { MAD_F(0x04754526) /* 0.278630398 */, 18 },
- /* 4444 */ { MAD_F(0x04759cd4) /* 0.278714018 */, 18 },
- /* 4445 */ { MAD_F(0x0475f484) /* 0.278797643 */, 18 },
- /* 4446 */ { MAD_F(0x04764c36) /* 0.278881275 */, 18 },
- /* 4447 */ { MAD_F(0x0476a3ea) /* 0.278964914 */, 18 },
-
- /* 4448 */ { MAD_F(0x0476fb9f) /* 0.279048558 */, 18 },
- /* 4449 */ { MAD_F(0x04775356) /* 0.279132209 */, 18 },
- /* 4450 */ { MAD_F(0x0477ab0e) /* 0.279215866 */, 18 },
- /* 4451 */ { MAD_F(0x047802c8) /* 0.279299529 */, 18 },
- /* 4452 */ { MAD_F(0x04785a84) /* 0.279383199 */, 18 },
- /* 4453 */ { MAD_F(0x0478b242) /* 0.279466875 */, 18 },
- /* 4454 */ { MAD_F(0x04790a01) /* 0.279550557 */, 18 },
- /* 4455 */ { MAD_F(0x047961c2) /* 0.279634245 */, 18 },
- /* 4456 */ { MAD_F(0x0479b984) /* 0.279717940 */, 18 },
- /* 4457 */ { MAD_F(0x047a1149) /* 0.279801641 */, 18 },
- /* 4458 */ { MAD_F(0x047a690f) /* 0.279885348 */, 18 },
- /* 4459 */ { MAD_F(0x047ac0d6) /* 0.279969061 */, 18 },
- /* 4460 */ { MAD_F(0x047b18a0) /* 0.280052781 */, 18 },
- /* 4461 */ { MAD_F(0x047b706b) /* 0.280136507 */, 18 },
- /* 4462 */ { MAD_F(0x047bc837) /* 0.280220239 */, 18 },
- /* 4463 */ { MAD_F(0x047c2006) /* 0.280303978 */, 18 },
-
- /* 4464 */ { MAD_F(0x047c77d6) /* 0.280387722 */, 18 },
- /* 4465 */ { MAD_F(0x047ccfa8) /* 0.280471473 */, 18 },
- /* 4466 */ { MAD_F(0x047d277b) /* 0.280555230 */, 18 },
- /* 4467 */ { MAD_F(0x047d7f50) /* 0.280638994 */, 18 },
- /* 4468 */ { MAD_F(0x047dd727) /* 0.280722764 */, 18 },
- /* 4469 */ { MAD_F(0x047e2eff) /* 0.280806540 */, 18 },
- /* 4470 */ { MAD_F(0x047e86d9) /* 0.280890322 */, 18 },
- /* 4471 */ { MAD_F(0x047edeb5) /* 0.280974110 */, 18 },
- /* 4472 */ { MAD_F(0x047f3693) /* 0.281057905 */, 18 },
- /* 4473 */ { MAD_F(0x047f8e72) /* 0.281141706 */, 18 },
- /* 4474 */ { MAD_F(0x047fe653) /* 0.281225513 */, 18 },
- /* 4475 */ { MAD_F(0x04803e35) /* 0.281309326 */, 18 },
- /* 4476 */ { MAD_F(0x04809619) /* 0.281393146 */, 18 },
- /* 4477 */ { MAD_F(0x0480edff) /* 0.281476972 */, 18 },
- /* 4478 */ { MAD_F(0x048145e7) /* 0.281560804 */, 18 },
- /* 4479 */ { MAD_F(0x04819dd0) /* 0.281644643 */, 18 },
-
- /* 4480 */ { MAD_F(0x0481f5bb) /* 0.281728487 */, 18 },
- /* 4481 */ { MAD_F(0x04824da7) /* 0.281812338 */, 18 },
- /* 4482 */ { MAD_F(0x0482a595) /* 0.281896195 */, 18 },
- /* 4483 */ { MAD_F(0x0482fd85) /* 0.281980059 */, 18 },
- /* 4484 */ { MAD_F(0x04835577) /* 0.282063928 */, 18 },
- /* 4485 */ { MAD_F(0x0483ad6a) /* 0.282147804 */, 18 },
- /* 4486 */ { MAD_F(0x0484055f) /* 0.282231686 */, 18 },
- /* 4487 */ { MAD_F(0x04845d56) /* 0.282315574 */, 18 },
- /* 4488 */ { MAD_F(0x0484b54e) /* 0.282399469 */, 18 },
- /* 4489 */ { MAD_F(0x04850d48) /* 0.282483370 */, 18 },
- /* 4490 */ { MAD_F(0x04856544) /* 0.282567277 */, 18 },
- /* 4491 */ { MAD_F(0x0485bd41) /* 0.282651190 */, 18 },
- /* 4492 */ { MAD_F(0x04861540) /* 0.282735109 */, 18 },
- /* 4493 */ { MAD_F(0x04866d40) /* 0.282819035 */, 18 },
- /* 4494 */ { MAD_F(0x0486c543) /* 0.282902967 */, 18 },
- /* 4495 */ { MAD_F(0x04871d47) /* 0.282986905 */, 18 },
-
- /* 4496 */ { MAD_F(0x0487754c) /* 0.283070849 */, 18 },
- /* 4497 */ { MAD_F(0x0487cd54) /* 0.283154800 */, 18 },
- /* 4498 */ { MAD_F(0x0488255d) /* 0.283238757 */, 18 },
- /* 4499 */ { MAD_F(0x04887d67) /* 0.283322720 */, 18 },
- /* 4500 */ { MAD_F(0x0488d574) /* 0.283406689 */, 18 },
- /* 4501 */ { MAD_F(0x04892d82) /* 0.283490665 */, 18 },
- /* 4502 */ { MAD_F(0x04898591) /* 0.283574646 */, 18 },
- /* 4503 */ { MAD_F(0x0489dda3) /* 0.283658634 */, 18 },
- /* 4504 */ { MAD_F(0x048a35b6) /* 0.283742628 */, 18 },
- /* 4505 */ { MAD_F(0x048a8dca) /* 0.283826629 */, 18 },
- /* 4506 */ { MAD_F(0x048ae5e1) /* 0.283910635 */, 18 },
- /* 4507 */ { MAD_F(0x048b3df9) /* 0.283994648 */, 18 },
- /* 4508 */ { MAD_F(0x048b9612) /* 0.284078667 */, 18 },
- /* 4509 */ { MAD_F(0x048bee2e) /* 0.284162692 */, 18 },
- /* 4510 */ { MAD_F(0x048c464b) /* 0.284246723 */, 18 },
- /* 4511 */ { MAD_F(0x048c9e69) /* 0.284330761 */, 18 },
-
- /* 4512 */ { MAD_F(0x048cf68a) /* 0.284414805 */, 18 },
- /* 4513 */ { MAD_F(0x048d4eac) /* 0.284498855 */, 18 },
- /* 4514 */ { MAD_F(0x048da6cf) /* 0.284582911 */, 18 },
- /* 4515 */ { MAD_F(0x048dfef5) /* 0.284666974 */, 18 },
- /* 4516 */ { MAD_F(0x048e571c) /* 0.284751042 */, 18 },
- /* 4517 */ { MAD_F(0x048eaf44) /* 0.284835117 */, 18 },
- /* 4518 */ { MAD_F(0x048f076f) /* 0.284919198 */, 18 },
- /* 4519 */ { MAD_F(0x048f5f9b) /* 0.285003285 */, 18 },
- /* 4520 */ { MAD_F(0x048fb7c8) /* 0.285087379 */, 18 },
- /* 4521 */ { MAD_F(0x04900ff8) /* 0.285171479 */, 18 },
- /* 4522 */ { MAD_F(0x04906829) /* 0.285255584 */, 18 },
- /* 4523 */ { MAD_F(0x0490c05b) /* 0.285339697 */, 18 },
- /* 4524 */ { MAD_F(0x04911890) /* 0.285423815 */, 18 },
- /* 4525 */ { MAD_F(0x049170c6) /* 0.285507939 */, 18 },
- /* 4526 */ { MAD_F(0x0491c8fd) /* 0.285592070 */, 18 },
- /* 4527 */ { MAD_F(0x04922137) /* 0.285676207 */, 18 },
-
- /* 4528 */ { MAD_F(0x04927972) /* 0.285760350 */, 18 },
- /* 4529 */ { MAD_F(0x0492d1ae) /* 0.285844499 */, 18 },
- /* 4530 */ { MAD_F(0x049329ed) /* 0.285928655 */, 18 },
- /* 4531 */ { MAD_F(0x0493822c) /* 0.286012816 */, 18 },
- /* 4532 */ { MAD_F(0x0493da6e) /* 0.286096984 */, 18 },
- /* 4533 */ { MAD_F(0x049432b1) /* 0.286181158 */, 18 },
- /* 4534 */ { MAD_F(0x04948af6) /* 0.286265338 */, 18 },
- /* 4535 */ { MAD_F(0x0494e33d) /* 0.286349525 */, 18 },
- /* 4536 */ { MAD_F(0x04953b85) /* 0.286433717 */, 18 },
- /* 4537 */ { MAD_F(0x049593cf) /* 0.286517916 */, 18 },
- /* 4538 */ { MAD_F(0x0495ec1b) /* 0.286602121 */, 18 },
- /* 4539 */ { MAD_F(0x04964468) /* 0.286686332 */, 18 },
- /* 4540 */ { MAD_F(0x04969cb7) /* 0.286770550 */, 18 },
- /* 4541 */ { MAD_F(0x0496f508) /* 0.286854773 */, 18 },
- /* 4542 */ { MAD_F(0x04974d5a) /* 0.286939003 */, 18 },
- /* 4543 */ { MAD_F(0x0497a5ae) /* 0.287023239 */, 18 },
-
- /* 4544 */ { MAD_F(0x0497fe03) /* 0.287107481 */, 18 },
- /* 4545 */ { MAD_F(0x0498565a) /* 0.287191729 */, 18 },
- /* 4546 */ { MAD_F(0x0498aeb3) /* 0.287275983 */, 18 },
- /* 4547 */ { MAD_F(0x0499070e) /* 0.287360244 */, 18 },
- /* 4548 */ { MAD_F(0x04995f6a) /* 0.287444511 */, 18 },
- /* 4549 */ { MAD_F(0x0499b7c8) /* 0.287528784 */, 18 },
- /* 4550 */ { MAD_F(0x049a1027) /* 0.287613063 */, 18 },
- /* 4551 */ { MAD_F(0x049a6889) /* 0.287697348 */, 18 },
- /* 4552 */ { MAD_F(0x049ac0eb) /* 0.287781640 */, 18 },
- /* 4553 */ { MAD_F(0x049b1950) /* 0.287865937 */, 18 },
- /* 4554 */ { MAD_F(0x049b71b6) /* 0.287950241 */, 18 },
- /* 4555 */ { MAD_F(0x049bca1e) /* 0.288034551 */, 18 },
- /* 4556 */ { MAD_F(0x049c2287) /* 0.288118867 */, 18 },
- /* 4557 */ { MAD_F(0x049c7af2) /* 0.288203190 */, 18 },
- /* 4558 */ { MAD_F(0x049cd35f) /* 0.288287518 */, 18 },
- /* 4559 */ { MAD_F(0x049d2bce) /* 0.288371853 */, 18 },
-
- /* 4560 */ { MAD_F(0x049d843e) /* 0.288456194 */, 18 },
- /* 4561 */ { MAD_F(0x049ddcaf) /* 0.288540541 */, 18 },
- /* 4562 */ { MAD_F(0x049e3523) /* 0.288624894 */, 18 },
- /* 4563 */ { MAD_F(0x049e8d98) /* 0.288709253 */, 18 },
- /* 4564 */ { MAD_F(0x049ee60e) /* 0.288793619 */, 18 },
- /* 4565 */ { MAD_F(0x049f3e87) /* 0.288877990 */, 18 },
- /* 4566 */ { MAD_F(0x049f9701) /* 0.288962368 */, 18 },
- /* 4567 */ { MAD_F(0x049fef7c) /* 0.289046752 */, 18 },
- /* 4568 */ { MAD_F(0x04a047fa) /* 0.289131142 */, 18 },
- /* 4569 */ { MAD_F(0x04a0a079) /* 0.289215538 */, 18 },
- /* 4570 */ { MAD_F(0x04a0f8f9) /* 0.289299941 */, 18 },
- /* 4571 */ { MAD_F(0x04a1517c) /* 0.289384349 */, 18 },
- /* 4572 */ { MAD_F(0x04a1a9ff) /* 0.289468764 */, 18 },
- /* 4573 */ { MAD_F(0x04a20285) /* 0.289553185 */, 18 },
- /* 4574 */ { MAD_F(0x04a25b0c) /* 0.289637612 */, 18 },
- /* 4575 */ { MAD_F(0x04a2b395) /* 0.289722045 */, 18 },
-
- /* 4576 */ { MAD_F(0x04a30c20) /* 0.289806485 */, 18 },
- /* 4577 */ { MAD_F(0x04a364ac) /* 0.289890930 */, 18 },
- /* 4578 */ { MAD_F(0x04a3bd3a) /* 0.289975382 */, 18 },
- /* 4579 */ { MAD_F(0x04a415c9) /* 0.290059840 */, 18 },
- /* 4580 */ { MAD_F(0x04a46e5a) /* 0.290144304 */, 18 },
- /* 4581 */ { MAD_F(0x04a4c6ed) /* 0.290228774 */, 18 },
- /* 4582 */ { MAD_F(0x04a51f81) /* 0.290313250 */, 18 },
- /* 4583 */ { MAD_F(0x04a57818) /* 0.290397733 */, 18 },
- /* 4584 */ { MAD_F(0x04a5d0af) /* 0.290482221 */, 18 },
- /* 4585 */ { MAD_F(0x04a62949) /* 0.290566716 */, 18 },
- /* 4586 */ { MAD_F(0x04a681e4) /* 0.290651217 */, 18 },
- /* 4587 */ { MAD_F(0x04a6da80) /* 0.290735724 */, 18 },
- /* 4588 */ { MAD_F(0x04a7331f) /* 0.290820237 */, 18 },
- /* 4589 */ { MAD_F(0x04a78bbf) /* 0.290904756 */, 18 },
- /* 4590 */ { MAD_F(0x04a7e460) /* 0.290989281 */, 18 },
- /* 4591 */ { MAD_F(0x04a83d03) /* 0.291073813 */, 18 },
-
- /* 4592 */ { MAD_F(0x04a895a8) /* 0.291158351 */, 18 },
- /* 4593 */ { MAD_F(0x04a8ee4f) /* 0.291242894 */, 18 },
- /* 4594 */ { MAD_F(0x04a946f7) /* 0.291327444 */, 18 },
- /* 4595 */ { MAD_F(0x04a99fa1) /* 0.291412001 */, 18 },
- /* 4596 */ { MAD_F(0x04a9f84c) /* 0.291496563 */, 18 },
- /* 4597 */ { MAD_F(0x04aa50fa) /* 0.291581131 */, 18 },
- /* 4598 */ { MAD_F(0x04aaa9a8) /* 0.291665706 */, 18 },
- /* 4599 */ { MAD_F(0x04ab0259) /* 0.291750286 */, 18 },
- /* 4600 */ { MAD_F(0x04ab5b0b) /* 0.291834873 */, 18 },
- /* 4601 */ { MAD_F(0x04abb3bf) /* 0.291919466 */, 18 },
- /* 4602 */ { MAD_F(0x04ac0c74) /* 0.292004065 */, 18 },
- /* 4603 */ { MAD_F(0x04ac652b) /* 0.292088670 */, 18 },
- /* 4604 */ { MAD_F(0x04acbde4) /* 0.292173281 */, 18 },
- /* 4605 */ { MAD_F(0x04ad169e) /* 0.292257899 */, 18 },
- /* 4606 */ { MAD_F(0x04ad6f5a) /* 0.292342522 */, 18 },
- /* 4607 */ { MAD_F(0x04adc818) /* 0.292427152 */, 18 },
-
- /* 4608 */ { MAD_F(0x04ae20d7) /* 0.292511788 */, 18 },
- /* 4609 */ { MAD_F(0x04ae7998) /* 0.292596430 */, 18 },
- /* 4610 */ { MAD_F(0x04aed25a) /* 0.292681078 */, 18 },
- /* 4611 */ { MAD_F(0x04af2b1e) /* 0.292765732 */, 18 },
- /* 4612 */ { MAD_F(0x04af83e4) /* 0.292850392 */, 18 },
- /* 4613 */ { MAD_F(0x04afdcac) /* 0.292935058 */, 18 },
- /* 4614 */ { MAD_F(0x04b03575) /* 0.293019731 */, 18 },
- /* 4615 */ { MAD_F(0x04b08e40) /* 0.293104409 */, 18 },
- /* 4616 */ { MAD_F(0x04b0e70c) /* 0.293189094 */, 18 },
- /* 4617 */ { MAD_F(0x04b13fda) /* 0.293273785 */, 18 },
- /* 4618 */ { MAD_F(0x04b198aa) /* 0.293358482 */, 18 },
- /* 4619 */ { MAD_F(0x04b1f17b) /* 0.293443185 */, 18 },
- /* 4620 */ { MAD_F(0x04b24a4e) /* 0.293527894 */, 18 },
- /* 4621 */ { MAD_F(0x04b2a322) /* 0.293612609 */, 18 },
- /* 4622 */ { MAD_F(0x04b2fbf9) /* 0.293697331 */, 18 },
- /* 4623 */ { MAD_F(0x04b354d1) /* 0.293782058 */, 18 },
-
- /* 4624 */ { MAD_F(0x04b3adaa) /* 0.293866792 */, 18 },
- /* 4625 */ { MAD_F(0x04b40685) /* 0.293951532 */, 18 },
- /* 4626 */ { MAD_F(0x04b45f62) /* 0.294036278 */, 18 },
- /* 4627 */ { MAD_F(0x04b4b840) /* 0.294121029 */, 18 },
- /* 4628 */ { MAD_F(0x04b51120) /* 0.294205788 */, 18 },
- /* 4629 */ { MAD_F(0x04b56a02) /* 0.294290552 */, 18 },
- /* 4630 */ { MAD_F(0x04b5c2e6) /* 0.294375322 */, 18 },
- /* 4631 */ { MAD_F(0x04b61bcb) /* 0.294460098 */, 18 },
- /* 4632 */ { MAD_F(0x04b674b1) /* 0.294544881 */, 18 },
- /* 4633 */ { MAD_F(0x04b6cd99) /* 0.294629669 */, 18 },
- /* 4634 */ { MAD_F(0x04b72683) /* 0.294714464 */, 18 },
- /* 4635 */ { MAD_F(0x04b77f6f) /* 0.294799265 */, 18 },
- /* 4636 */ { MAD_F(0x04b7d85c) /* 0.294884072 */, 18 },
- /* 4637 */ { MAD_F(0x04b8314b) /* 0.294968885 */, 18 },
- /* 4638 */ { MAD_F(0x04b88a3b) /* 0.295053704 */, 18 },
- /* 4639 */ { MAD_F(0x04b8e32d) /* 0.295138529 */, 18 },
-
- /* 4640 */ { MAD_F(0x04b93c21) /* 0.295223360 */, 18 },
- /* 4641 */ { MAD_F(0x04b99516) /* 0.295308197 */, 18 },
- /* 4642 */ { MAD_F(0x04b9ee0d) /* 0.295393041 */, 18 },
- /* 4643 */ { MAD_F(0x04ba4706) /* 0.295477890 */, 18 },
- /* 4644 */ { MAD_F(0x04baa000) /* 0.295562746 */, 18 },
- /* 4645 */ { MAD_F(0x04baf8fc) /* 0.295647608 */, 18 },
- /* 4646 */ { MAD_F(0x04bb51fa) /* 0.295732476 */, 18 },
- /* 4647 */ { MAD_F(0x04bbaaf9) /* 0.295817349 */, 18 },
- /* 4648 */ { MAD_F(0x04bc03fa) /* 0.295902229 */, 18 },
- /* 4649 */ { MAD_F(0x04bc5cfc) /* 0.295987115 */, 18 },
- /* 4650 */ { MAD_F(0x04bcb600) /* 0.296072008 */, 18 },
- /* 4651 */ { MAD_F(0x04bd0f06) /* 0.296156906 */, 18 },
- /* 4652 */ { MAD_F(0x04bd680d) /* 0.296241810 */, 18 },
- /* 4653 */ { MAD_F(0x04bdc116) /* 0.296326721 */, 18 },
- /* 4654 */ { MAD_F(0x04be1a21) /* 0.296411637 */, 18 },
- /* 4655 */ { MAD_F(0x04be732d) /* 0.296496560 */, 18 },
-
- /* 4656 */ { MAD_F(0x04becc3b) /* 0.296581488 */, 18 },
- /* 4657 */ { MAD_F(0x04bf254a) /* 0.296666423 */, 18 },
- /* 4658 */ { MAD_F(0x04bf7e5b) /* 0.296751364 */, 18 },
- /* 4659 */ { MAD_F(0x04bfd76e) /* 0.296836311 */, 18 },
- /* 4660 */ { MAD_F(0x04c03083) /* 0.296921264 */, 18 },
- /* 4661 */ { MAD_F(0x04c08999) /* 0.297006223 */, 18 },
- /* 4662 */ { MAD_F(0x04c0e2b0) /* 0.297091188 */, 18 },
- /* 4663 */ { MAD_F(0x04c13bca) /* 0.297176159 */, 18 },
- /* 4664 */ { MAD_F(0x04c194e4) /* 0.297261136 */, 18 },
- /* 4665 */ { MAD_F(0x04c1ee01) /* 0.297346120 */, 18 },
- /* 4666 */ { MAD_F(0x04c2471f) /* 0.297431109 */, 18 },
- /* 4667 */ { MAD_F(0x04c2a03f) /* 0.297516105 */, 18 },
- /* 4668 */ { MAD_F(0x04c2f960) /* 0.297601106 */, 18 },
- /* 4669 */ { MAD_F(0x04c35283) /* 0.297686114 */, 18 },
- /* 4670 */ { MAD_F(0x04c3aba8) /* 0.297771128 */, 18 },
- /* 4671 */ { MAD_F(0x04c404ce) /* 0.297856147 */, 18 },
-
- /* 4672 */ { MAD_F(0x04c45df6) /* 0.297941173 */, 18 },
- /* 4673 */ { MAD_F(0x04c4b720) /* 0.298026205 */, 18 },
- /* 4674 */ { MAD_F(0x04c5104b) /* 0.298111243 */, 18 },
- /* 4675 */ { MAD_F(0x04c56978) /* 0.298196287 */, 18 },
- /* 4676 */ { MAD_F(0x04c5c2a7) /* 0.298281337 */, 18 },
- /* 4677 */ { MAD_F(0x04c61bd7) /* 0.298366393 */, 18 },
- /* 4678 */ { MAD_F(0x04c67508) /* 0.298451456 */, 18 },
- /* 4679 */ { MAD_F(0x04c6ce3c) /* 0.298536524 */, 18 },
- /* 4680 */ { MAD_F(0x04c72771) /* 0.298621598 */, 18 },
- /* 4681 */ { MAD_F(0x04c780a7) /* 0.298706679 */, 18 },
- /* 4682 */ { MAD_F(0x04c7d9df) /* 0.298791765 */, 18 },
- /* 4683 */ { MAD_F(0x04c83319) /* 0.298876858 */, 18 },
- /* 4684 */ { MAD_F(0x04c88c55) /* 0.298961956 */, 18 },
- /* 4685 */ { MAD_F(0x04c8e592) /* 0.299047061 */, 18 },
- /* 4686 */ { MAD_F(0x04c93ed1) /* 0.299132172 */, 18 },
- /* 4687 */ { MAD_F(0x04c99811) /* 0.299217288 */, 18 },
-
- /* 4688 */ { MAD_F(0x04c9f153) /* 0.299302411 */, 18 },
- /* 4689 */ { MAD_F(0x04ca4a97) /* 0.299387540 */, 18 },
- /* 4690 */ { MAD_F(0x04caa3dc) /* 0.299472675 */, 18 },
- /* 4691 */ { MAD_F(0x04cafd23) /* 0.299557816 */, 18 },
- /* 4692 */ { MAD_F(0x04cb566b) /* 0.299642963 */, 18 },
- /* 4693 */ { MAD_F(0x04cbafb5) /* 0.299728116 */, 18 },
- /* 4694 */ { MAD_F(0x04cc0901) /* 0.299813275 */, 18 },
- /* 4695 */ { MAD_F(0x04cc624e) /* 0.299898440 */, 18 },
- /* 4696 */ { MAD_F(0x04ccbb9d) /* 0.299983611 */, 18 },
- /* 4697 */ { MAD_F(0x04cd14ee) /* 0.300068789 */, 18 },
- /* 4698 */ { MAD_F(0x04cd6e40) /* 0.300153972 */, 18 },
- /* 4699 */ { MAD_F(0x04cdc794) /* 0.300239161 */, 18 },
- /* 4700 */ { MAD_F(0x04ce20e9) /* 0.300324357 */, 18 },
- /* 4701 */ { MAD_F(0x04ce7a40) /* 0.300409558 */, 18 },
- /* 4702 */ { MAD_F(0x04ced399) /* 0.300494765 */, 18 },
- /* 4703 */ { MAD_F(0x04cf2cf3) /* 0.300579979 */, 18 },
-
- /* 4704 */ { MAD_F(0x04cf864f) /* 0.300665198 */, 18 },
- /* 4705 */ { MAD_F(0x04cfdfad) /* 0.300750424 */, 18 },
- /* 4706 */ { MAD_F(0x04d0390c) /* 0.300835656 */, 18 },
- /* 4707 */ { MAD_F(0x04d0926d) /* 0.300920893 */, 18 },
- /* 4708 */ { MAD_F(0x04d0ebcf) /* 0.301006137 */, 18 },
- /* 4709 */ { MAD_F(0x04d14533) /* 0.301091387 */, 18 },
- /* 4710 */ { MAD_F(0x04d19e99) /* 0.301176643 */, 18 },
- /* 4711 */ { MAD_F(0x04d1f800) /* 0.301261904 */, 18 },
- /* 4712 */ { MAD_F(0x04d25169) /* 0.301347172 */, 18 },
- /* 4713 */ { MAD_F(0x04d2aad4) /* 0.301432446 */, 18 },
- /* 4714 */ { MAD_F(0x04d30440) /* 0.301517726 */, 18 },
- /* 4715 */ { MAD_F(0x04d35dae) /* 0.301603012 */, 18 },
- /* 4716 */ { MAD_F(0x04d3b71d) /* 0.301688304 */, 18 },
- /* 4717 */ { MAD_F(0x04d4108e) /* 0.301773602 */, 18 },
- /* 4718 */ { MAD_F(0x04d46a01) /* 0.301858906 */, 18 },
- /* 4719 */ { MAD_F(0x04d4c375) /* 0.301944216 */, 18 },
-
- /* 4720 */ { MAD_F(0x04d51ceb) /* 0.302029532 */, 18 },
- /* 4721 */ { MAD_F(0x04d57662) /* 0.302114854 */, 18 },
- /* 4722 */ { MAD_F(0x04d5cfdb) /* 0.302200182 */, 18 },
- /* 4723 */ { MAD_F(0x04d62956) /* 0.302285516 */, 18 },
- /* 4724 */ { MAD_F(0x04d682d2) /* 0.302370856 */, 18 },
- /* 4725 */ { MAD_F(0x04d6dc50) /* 0.302456203 */, 18 },
- /* 4726 */ { MAD_F(0x04d735d0) /* 0.302541555 */, 18 },
- /* 4727 */ { MAD_F(0x04d78f51) /* 0.302626913 */, 18 },
- /* 4728 */ { MAD_F(0x04d7e8d4) /* 0.302712277 */, 18 },
- /* 4729 */ { MAD_F(0x04d84258) /* 0.302797648 */, 18 },
- /* 4730 */ { MAD_F(0x04d89bde) /* 0.302883024 */, 18 },
- /* 4731 */ { MAD_F(0x04d8f566) /* 0.302968406 */, 18 },
- /* 4732 */ { MAD_F(0x04d94eef) /* 0.303053794 */, 18 },
- /* 4733 */ { MAD_F(0x04d9a87a) /* 0.303139189 */, 18 },
- /* 4734 */ { MAD_F(0x04da0207) /* 0.303224589 */, 18 },
- /* 4735 */ { MAD_F(0x04da5b95) /* 0.303309995 */, 18 },
-
- /* 4736 */ { MAD_F(0x04dab524) /* 0.303395408 */, 18 },
- /* 4737 */ { MAD_F(0x04db0eb6) /* 0.303480826 */, 18 },
- /* 4738 */ { MAD_F(0x04db6849) /* 0.303566251 */, 18 },
- /* 4739 */ { MAD_F(0x04dbc1dd) /* 0.303651681 */, 18 },
- /* 4740 */ { MAD_F(0x04dc1b73) /* 0.303737117 */, 18 },
- /* 4741 */ { MAD_F(0x04dc750b) /* 0.303822560 */, 18 },
- /* 4742 */ { MAD_F(0x04dccea5) /* 0.303908008 */, 18 },
- /* 4743 */ { MAD_F(0x04dd2840) /* 0.303993463 */, 18 },
- /* 4744 */ { MAD_F(0x04dd81dc) /* 0.304078923 */, 18 },
- /* 4745 */ { MAD_F(0x04dddb7a) /* 0.304164390 */, 18 },
- /* 4746 */ { MAD_F(0x04de351a) /* 0.304249862 */, 18 },
- /* 4747 */ { MAD_F(0x04de8ebc) /* 0.304335340 */, 18 },
- /* 4748 */ { MAD_F(0x04dee85f) /* 0.304420825 */, 18 },
- /* 4749 */ { MAD_F(0x04df4203) /* 0.304506315 */, 18 },
- /* 4750 */ { MAD_F(0x04df9baa) /* 0.304591812 */, 18 },
- /* 4751 */ { MAD_F(0x04dff552) /* 0.304677314 */, 18 },
-
- /* 4752 */ { MAD_F(0x04e04efb) /* 0.304762823 */, 18 },
- /* 4753 */ { MAD_F(0x04e0a8a6) /* 0.304848337 */, 18 },
- /* 4754 */ { MAD_F(0x04e10253) /* 0.304933858 */, 18 },
- /* 4755 */ { MAD_F(0x04e15c01) /* 0.305019384 */, 18 },
- /* 4756 */ { MAD_F(0x04e1b5b1) /* 0.305104917 */, 18 },
- /* 4757 */ { MAD_F(0x04e20f63) /* 0.305190455 */, 18 },
- /* 4758 */ { MAD_F(0x04e26916) /* 0.305275999 */, 18 },
- /* 4759 */ { MAD_F(0x04e2c2cb) /* 0.305361550 */, 18 },
- /* 4760 */ { MAD_F(0x04e31c81) /* 0.305447106 */, 18 },
- /* 4761 */ { MAD_F(0x04e37639) /* 0.305532669 */, 18 },
- /* 4762 */ { MAD_F(0x04e3cff3) /* 0.305618237 */, 18 },
- /* 4763 */ { MAD_F(0x04e429ae) /* 0.305703811 */, 18 },
- /* 4764 */ { MAD_F(0x04e4836b) /* 0.305789392 */, 18 },
- /* 4765 */ { MAD_F(0x04e4dd29) /* 0.305874978 */, 18 },
- /* 4766 */ { MAD_F(0x04e536e9) /* 0.305960571 */, 18 },
- /* 4767 */ { MAD_F(0x04e590ab) /* 0.306046169 */, 18 },
-
- /* 4768 */ { MAD_F(0x04e5ea6e) /* 0.306131773 */, 18 },
- /* 4769 */ { MAD_F(0x04e64433) /* 0.306217383 */, 18 },
- /* 4770 */ { MAD_F(0x04e69df9) /* 0.306303000 */, 18 },
- /* 4771 */ { MAD_F(0x04e6f7c1) /* 0.306388622 */, 18 },
- /* 4772 */ { MAD_F(0x04e7518b) /* 0.306474250 */, 18 },
- /* 4773 */ { MAD_F(0x04e7ab56) /* 0.306559885 */, 18 },
- /* 4774 */ { MAD_F(0x04e80523) /* 0.306645525 */, 18 },
- /* 4775 */ { MAD_F(0x04e85ef2) /* 0.306731171 */, 18 },
- /* 4776 */ { MAD_F(0x04e8b8c2) /* 0.306816823 */, 18 },
- /* 4777 */ { MAD_F(0x04e91293) /* 0.306902481 */, 18 },
- /* 4778 */ { MAD_F(0x04e96c67) /* 0.306988145 */, 18 },
- /* 4779 */ { MAD_F(0x04e9c63b) /* 0.307073816 */, 18 },
- /* 4780 */ { MAD_F(0x04ea2012) /* 0.307159492 */, 18 },
- /* 4781 */ { MAD_F(0x04ea79ea) /* 0.307245174 */, 18 },
- /* 4782 */ { MAD_F(0x04ead3c4) /* 0.307330862 */, 18 },
- /* 4783 */ { MAD_F(0x04eb2d9f) /* 0.307416556 */, 18 },
-
- /* 4784 */ { MAD_F(0x04eb877c) /* 0.307502256 */, 18 },
- /* 4785 */ { MAD_F(0x04ebe15b) /* 0.307587962 */, 18 },
- /* 4786 */ { MAD_F(0x04ec3b3b) /* 0.307673674 */, 18 },
- /* 4787 */ { MAD_F(0x04ec951c) /* 0.307759392 */, 18 },
- /* 4788 */ { MAD_F(0x04ecef00) /* 0.307845115 */, 18 },
- /* 4789 */ { MAD_F(0x04ed48e5) /* 0.307930845 */, 18 },
- /* 4790 */ { MAD_F(0x04eda2cb) /* 0.308016581 */, 18 },
- /* 4791 */ { MAD_F(0x04edfcb3) /* 0.308102323 */, 18 },
- /* 4792 */ { MAD_F(0x04ee569d) /* 0.308188071 */, 18 },
- /* 4793 */ { MAD_F(0x04eeb088) /* 0.308273824 */, 18 },
- /* 4794 */ { MAD_F(0x04ef0a75) /* 0.308359584 */, 18 },
- /* 4795 */ { MAD_F(0x04ef6464) /* 0.308445350 */, 18 },
- /* 4796 */ { MAD_F(0x04efbe54) /* 0.308531121 */, 18 },
- /* 4797 */ { MAD_F(0x04f01846) /* 0.308616899 */, 18 },
- /* 4798 */ { MAD_F(0x04f07239) /* 0.308702682 */, 18 },
- /* 4799 */ { MAD_F(0x04f0cc2e) /* 0.308788472 */, 18 },
-
- /* 4800 */ { MAD_F(0x04f12624) /* 0.308874267 */, 18 },
- /* 4801 */ { MAD_F(0x04f1801d) /* 0.308960068 */, 18 },
- /* 4802 */ { MAD_F(0x04f1da16) /* 0.309045876 */, 18 },
- /* 4803 */ { MAD_F(0x04f23412) /* 0.309131689 */, 18 },
- /* 4804 */ { MAD_F(0x04f28e0f) /* 0.309217508 */, 18 },
- /* 4805 */ { MAD_F(0x04f2e80d) /* 0.309303334 */, 18 },
- /* 4806 */ { MAD_F(0x04f3420d) /* 0.309389165 */, 18 },
- /* 4807 */ { MAD_F(0x04f39c0f) /* 0.309475002 */, 18 },
- /* 4808 */ { MAD_F(0x04f3f612) /* 0.309560845 */, 18 },
- /* 4809 */ { MAD_F(0x04f45017) /* 0.309646694 */, 18 },
- /* 4810 */ { MAD_F(0x04f4aa1e) /* 0.309732549 */, 18 },
- /* 4811 */ { MAD_F(0x04f50426) /* 0.309818410 */, 18 },
- /* 4812 */ { MAD_F(0x04f55e30) /* 0.309904277 */, 18 },
- /* 4813 */ { MAD_F(0x04f5b83b) /* 0.309990150 */, 18 },
- /* 4814 */ { MAD_F(0x04f61248) /* 0.310076028 */, 18 },
- /* 4815 */ { MAD_F(0x04f66c56) /* 0.310161913 */, 18 },
-
- /* 4816 */ { MAD_F(0x04f6c666) /* 0.310247804 */, 18 },
- /* 4817 */ { MAD_F(0x04f72078) /* 0.310333700 */, 18 },
- /* 4818 */ { MAD_F(0x04f77a8b) /* 0.310419603 */, 18 },
- /* 4819 */ { MAD_F(0x04f7d4a0) /* 0.310505511 */, 18 },
- /* 4820 */ { MAD_F(0x04f82eb7) /* 0.310591426 */, 18 },
- /* 4821 */ { MAD_F(0x04f888cf) /* 0.310677346 */, 18 },
- /* 4822 */ { MAD_F(0x04f8e2e9) /* 0.310763272 */, 18 },
- /* 4823 */ { MAD_F(0x04f93d04) /* 0.310849205 */, 18 },
- /* 4824 */ { MAD_F(0x04f99721) /* 0.310935143 */, 18 },
- /* 4825 */ { MAD_F(0x04f9f13f) /* 0.311021087 */, 18 },
- /* 4826 */ { MAD_F(0x04fa4b5f) /* 0.311107037 */, 18 },
- /* 4827 */ { MAD_F(0x04faa581) /* 0.311192993 */, 18 },
- /* 4828 */ { MAD_F(0x04faffa4) /* 0.311278955 */, 18 },
- /* 4829 */ { MAD_F(0x04fb59c9) /* 0.311364923 */, 18 },
- /* 4830 */ { MAD_F(0x04fbb3ef) /* 0.311450897 */, 18 },
- /* 4831 */ { MAD_F(0x04fc0e17) /* 0.311536877 */, 18 },
-
- /* 4832 */ { MAD_F(0x04fc6841) /* 0.311622862 */, 18 },
- /* 4833 */ { MAD_F(0x04fcc26c) /* 0.311708854 */, 18 },
- /* 4834 */ { MAD_F(0x04fd1c99) /* 0.311794851 */, 18 },
- /* 4835 */ { MAD_F(0x04fd76c7) /* 0.311880855 */, 18 },
- /* 4836 */ { MAD_F(0x04fdd0f7) /* 0.311966864 */, 18 },
- /* 4837 */ { MAD_F(0x04fe2b29) /* 0.312052880 */, 18 },
- /* 4838 */ { MAD_F(0x04fe855c) /* 0.312138901 */, 18 },
- /* 4839 */ { MAD_F(0x04fedf91) /* 0.312224928 */, 18 },
- /* 4840 */ { MAD_F(0x04ff39c7) /* 0.312310961 */, 18 },
- /* 4841 */ { MAD_F(0x04ff93ff) /* 0.312397000 */, 18 },
- /* 4842 */ { MAD_F(0x04ffee38) /* 0.312483045 */, 18 },
- /* 4843 */ { MAD_F(0x05004874) /* 0.312569096 */, 18 },
- /* 4844 */ { MAD_F(0x0500a2b0) /* 0.312655153 */, 18 },
- /* 4845 */ { MAD_F(0x0500fcef) /* 0.312741216 */, 18 },
- /* 4846 */ { MAD_F(0x0501572e) /* 0.312827284 */, 18 },
- /* 4847 */ { MAD_F(0x0501b170) /* 0.312913359 */, 18 },
-
- /* 4848 */ { MAD_F(0x05020bb3) /* 0.312999439 */, 18 },
- /* 4849 */ { MAD_F(0x050265f8) /* 0.313085526 */, 18 },
- /* 4850 */ { MAD_F(0x0502c03e) /* 0.313171618 */, 18 },
- /* 4851 */ { MAD_F(0x05031a86) /* 0.313257716 */, 18 },
- /* 4852 */ { MAD_F(0x050374cf) /* 0.313343820 */, 18 },
- /* 4853 */ { MAD_F(0x0503cf1a) /* 0.313429931 */, 18 },
- /* 4854 */ { MAD_F(0x05042967) /* 0.313516047 */, 18 },
- /* 4855 */ { MAD_F(0x050483b5) /* 0.313602168 */, 18 },
- /* 4856 */ { MAD_F(0x0504de05) /* 0.313688296 */, 18 },
- /* 4857 */ { MAD_F(0x05053856) /* 0.313774430 */, 18 },
- /* 4858 */ { MAD_F(0x050592a9) /* 0.313860570 */, 18 },
- /* 4859 */ { MAD_F(0x0505ecfd) /* 0.313946715 */, 18 },
- /* 4860 */ { MAD_F(0x05064754) /* 0.314032867 */, 18 },
- /* 4861 */ { MAD_F(0x0506a1ab) /* 0.314119024 */, 18 },
- /* 4862 */ { MAD_F(0x0506fc04) /* 0.314205187 */, 18 },
- /* 4863 */ { MAD_F(0x0507565f) /* 0.314291357 */, 18 },
-
- /* 4864 */ { MAD_F(0x0507b0bc) /* 0.314377532 */, 18 },
- /* 4865 */ { MAD_F(0x05080b1a) /* 0.314463713 */, 18 },
- /* 4866 */ { MAD_F(0x05086579) /* 0.314549900 */, 18 },
- /* 4867 */ { MAD_F(0x0508bfdb) /* 0.314636092 */, 18 },
- /* 4868 */ { MAD_F(0x05091a3d) /* 0.314722291 */, 18 },
- /* 4869 */ { MAD_F(0x050974a2) /* 0.314808496 */, 18 },
- /* 4870 */ { MAD_F(0x0509cf08) /* 0.314894706 */, 18 },
- /* 4871 */ { MAD_F(0x050a296f) /* 0.314980923 */, 18 },
- /* 4872 */ { MAD_F(0x050a83d8) /* 0.315067145 */, 18 },
- /* 4873 */ { MAD_F(0x050ade43) /* 0.315153373 */, 18 },
- /* 4874 */ { MAD_F(0x050b38af) /* 0.315239607 */, 18 },
- /* 4875 */ { MAD_F(0x050b931d) /* 0.315325847 */, 18 },
- /* 4876 */ { MAD_F(0x050bed8d) /* 0.315412093 */, 18 },
- /* 4877 */ { MAD_F(0x050c47fe) /* 0.315498345 */, 18 },
- /* 4878 */ { MAD_F(0x050ca271) /* 0.315584603 */, 18 },
- /* 4879 */ { MAD_F(0x050cfce5) /* 0.315670866 */, 18 },
-
- /* 4880 */ { MAD_F(0x050d575b) /* 0.315757136 */, 18 },
- /* 4881 */ { MAD_F(0x050db1d2) /* 0.315843411 */, 18 },
- /* 4882 */ { MAD_F(0x050e0c4b) /* 0.315929693 */, 18 },
- /* 4883 */ { MAD_F(0x050e66c5) /* 0.316015980 */, 18 },
- /* 4884 */ { MAD_F(0x050ec141) /* 0.316102273 */, 18 },
- /* 4885 */ { MAD_F(0x050f1bbf) /* 0.316188572 */, 18 },
- /* 4886 */ { MAD_F(0x050f763e) /* 0.316274877 */, 18 },
- /* 4887 */ { MAD_F(0x050fd0bf) /* 0.316361187 */, 18 },
- /* 4888 */ { MAD_F(0x05102b42) /* 0.316447504 */, 18 },
- /* 4889 */ { MAD_F(0x051085c6) /* 0.316533826 */, 18 },
- /* 4890 */ { MAD_F(0x0510e04b) /* 0.316620155 */, 18 },
- /* 4891 */ { MAD_F(0x05113ad3) /* 0.316706489 */, 18 },
- /* 4892 */ { MAD_F(0x0511955b) /* 0.316792829 */, 18 },
- /* 4893 */ { MAD_F(0x0511efe6) /* 0.316879175 */, 18 },
- /* 4894 */ { MAD_F(0x05124a72) /* 0.316965527 */, 18 },
- /* 4895 */ { MAD_F(0x0512a4ff) /* 0.317051885 */, 18 },
-
- /* 4896 */ { MAD_F(0x0512ff8e) /* 0.317138249 */, 18 },
- /* 4897 */ { MAD_F(0x05135a1f) /* 0.317224618 */, 18 },
- /* 4898 */ { MAD_F(0x0513b4b1) /* 0.317310994 */, 18 },
- /* 4899 */ { MAD_F(0x05140f45) /* 0.317397375 */, 18 },
- /* 4900 */ { MAD_F(0x051469da) /* 0.317483762 */, 18 },
- /* 4901 */ { MAD_F(0x0514c471) /* 0.317570155 */, 18 },
- /* 4902 */ { MAD_F(0x05151f0a) /* 0.317656554 */, 18 },
- /* 4903 */ { MAD_F(0x051579a4) /* 0.317742959 */, 18 },
- /* 4904 */ { MAD_F(0x0515d440) /* 0.317829370 */, 18 },
- /* 4905 */ { MAD_F(0x05162edd) /* 0.317915786 */, 18 },
- /* 4906 */ { MAD_F(0x0516897c) /* 0.318002209 */, 18 },
- /* 4907 */ { MAD_F(0x0516e41c) /* 0.318088637 */, 18 },
- /* 4908 */ { MAD_F(0x05173ebe) /* 0.318175071 */, 18 },
- /* 4909 */ { MAD_F(0x05179962) /* 0.318261511 */, 18 },
- /* 4910 */ { MAD_F(0x0517f407) /* 0.318347957 */, 18 },
- /* 4911 */ { MAD_F(0x05184eae) /* 0.318434409 */, 18 },
-
- /* 4912 */ { MAD_F(0x0518a956) /* 0.318520867 */, 18 },
- /* 4913 */ { MAD_F(0x05190400) /* 0.318607330 */, 18 },
- /* 4914 */ { MAD_F(0x05195eab) /* 0.318693800 */, 18 },
- /* 4915 */ { MAD_F(0x0519b958) /* 0.318780275 */, 18 },
- /* 4916 */ { MAD_F(0x051a1407) /* 0.318866756 */, 18 },
- /* 4917 */ { MAD_F(0x051a6eb7) /* 0.318953243 */, 18 },
- /* 4918 */ { MAD_F(0x051ac969) /* 0.319039736 */, 18 },
- /* 4919 */ { MAD_F(0x051b241c) /* 0.319126235 */, 18 },
- /* 4920 */ { MAD_F(0x051b7ed1) /* 0.319212739 */, 18 },
- /* 4921 */ { MAD_F(0x051bd987) /* 0.319299250 */, 18 },
- /* 4922 */ { MAD_F(0x051c3440) /* 0.319385766 */, 18 },
- /* 4923 */ { MAD_F(0x051c8ef9) /* 0.319472288 */, 18 },
- /* 4924 */ { MAD_F(0x051ce9b4) /* 0.319558816 */, 18 },
- /* 4925 */ { MAD_F(0x051d4471) /* 0.319645350 */, 18 },
- /* 4926 */ { MAD_F(0x051d9f2f) /* 0.319731890 */, 18 },
- /* 4927 */ { MAD_F(0x051df9ef) /* 0.319818435 */, 18 },
-
- /* 4928 */ { MAD_F(0x051e54b1) /* 0.319904987 */, 18 },
- /* 4929 */ { MAD_F(0x051eaf74) /* 0.319991544 */, 18 },
- /* 4930 */ { MAD_F(0x051f0a38) /* 0.320078107 */, 18 },
- /* 4931 */ { MAD_F(0x051f64ff) /* 0.320164676 */, 18 },
- /* 4932 */ { MAD_F(0x051fbfc6) /* 0.320251251 */, 18 },
- /* 4933 */ { MAD_F(0x05201a90) /* 0.320337832 */, 18 },
- /* 4934 */ { MAD_F(0x0520755b) /* 0.320424419 */, 18 },
- /* 4935 */ { MAD_F(0x0520d027) /* 0.320511011 */, 18 },
- /* 4936 */ { MAD_F(0x05212af5) /* 0.320597609 */, 18 },
- /* 4937 */ { MAD_F(0x052185c5) /* 0.320684213 */, 18 },
- /* 4938 */ { MAD_F(0x0521e096) /* 0.320770823 */, 18 },
- /* 4939 */ { MAD_F(0x05223b69) /* 0.320857439 */, 18 },
- /* 4940 */ { MAD_F(0x0522963d) /* 0.320944061 */, 18 },
- /* 4941 */ { MAD_F(0x0522f113) /* 0.321030688 */, 18 },
- /* 4942 */ { MAD_F(0x05234bea) /* 0.321117322 */, 18 },
- /* 4943 */ { MAD_F(0x0523a6c3) /* 0.321203961 */, 18 },
-
- /* 4944 */ { MAD_F(0x0524019e) /* 0.321290606 */, 18 },
- /* 4945 */ { MAD_F(0x05245c7a) /* 0.321377257 */, 18 },
- /* 4946 */ { MAD_F(0x0524b758) /* 0.321463913 */, 18 },
- /* 4947 */ { MAD_F(0x05251237) /* 0.321550576 */, 18 },
- /* 4948 */ { MAD_F(0x05256d18) /* 0.321637244 */, 18 },
- /* 4949 */ { MAD_F(0x0525c7fb) /* 0.321723919 */, 18 },
- /* 4950 */ { MAD_F(0x052622df) /* 0.321810599 */, 18 },
- /* 4951 */ { MAD_F(0x05267dc4) /* 0.321897285 */, 18 },
- /* 4952 */ { MAD_F(0x0526d8ab) /* 0.321983976 */, 18 },
- /* 4953 */ { MAD_F(0x05273394) /* 0.322070674 */, 18 },
- /* 4954 */ { MAD_F(0x05278e7e) /* 0.322157377 */, 18 },
- /* 4955 */ { MAD_F(0x0527e96a) /* 0.322244087 */, 18 },
- /* 4956 */ { MAD_F(0x05284457) /* 0.322330802 */, 18 },
- /* 4957 */ { MAD_F(0x05289f46) /* 0.322417523 */, 18 },
- /* 4958 */ { MAD_F(0x0528fa37) /* 0.322504249 */, 18 },
- /* 4959 */ { MAD_F(0x05295529) /* 0.322590982 */, 18 },
-
- /* 4960 */ { MAD_F(0x0529b01d) /* 0.322677720 */, 18 },
- /* 4961 */ { MAD_F(0x052a0b12) /* 0.322764465 */, 18 },
- /* 4962 */ { MAD_F(0x052a6609) /* 0.322851215 */, 18 },
- /* 4963 */ { MAD_F(0x052ac101) /* 0.322937971 */, 18 },
- /* 4964 */ { MAD_F(0x052b1bfb) /* 0.323024732 */, 18 },
- /* 4965 */ { MAD_F(0x052b76f7) /* 0.323111500 */, 18 },
- /* 4966 */ { MAD_F(0x052bd1f4) /* 0.323198273 */, 18 },
- /* 4967 */ { MAD_F(0x052c2cf2) /* 0.323285052 */, 18 },
- /* 4968 */ { MAD_F(0x052c87f2) /* 0.323371837 */, 18 },
- /* 4969 */ { MAD_F(0x052ce2f4) /* 0.323458628 */, 18 },
- /* 4970 */ { MAD_F(0x052d3df7) /* 0.323545425 */, 18 },
- /* 4971 */ { MAD_F(0x052d98fc) /* 0.323632227 */, 18 },
- /* 4972 */ { MAD_F(0x052df403) /* 0.323719036 */, 18 },
- /* 4973 */ { MAD_F(0x052e4f0b) /* 0.323805850 */, 18 },
- /* 4974 */ { MAD_F(0x052eaa14) /* 0.323892670 */, 18 },
- /* 4975 */ { MAD_F(0x052f051f) /* 0.323979496 */, 18 },
-
- /* 4976 */ { MAD_F(0x052f602c) /* 0.324066327 */, 18 },
- /* 4977 */ { MAD_F(0x052fbb3a) /* 0.324153165 */, 18 },
- /* 4978 */ { MAD_F(0x0530164a) /* 0.324240008 */, 18 },
- /* 4979 */ { MAD_F(0x0530715b) /* 0.324326857 */, 18 },
- /* 4980 */ { MAD_F(0x0530cc6e) /* 0.324413712 */, 18 },
- /* 4981 */ { MAD_F(0x05312783) /* 0.324500572 */, 18 },
- /* 4982 */ { MAD_F(0x05318299) /* 0.324587439 */, 18 },
- /* 4983 */ { MAD_F(0x0531ddb0) /* 0.324674311 */, 18 },
- /* 4984 */ { MAD_F(0x053238ca) /* 0.324761189 */, 18 },
- /* 4985 */ { MAD_F(0x053293e4) /* 0.324848073 */, 18 },
- /* 4986 */ { MAD_F(0x0532ef01) /* 0.324934963 */, 18 },
- /* 4987 */ { MAD_F(0x05334a1e) /* 0.325021858 */, 18 },
- /* 4988 */ { MAD_F(0x0533a53e) /* 0.325108760 */, 18 },
- /* 4989 */ { MAD_F(0x0534005f) /* 0.325195667 */, 18 },
- /* 4990 */ { MAD_F(0x05345b81) /* 0.325282580 */, 18 },
- /* 4991 */ { MAD_F(0x0534b6a5) /* 0.325369498 */, 18 },
-
- /* 4992 */ { MAD_F(0x053511cb) /* 0.325456423 */, 18 },
- /* 4993 */ { MAD_F(0x05356cf2) /* 0.325543353 */, 18 },
- /* 4994 */ { MAD_F(0x0535c81b) /* 0.325630290 */, 18 },
- /* 4995 */ { MAD_F(0x05362345) /* 0.325717232 */, 18 },
- /* 4996 */ { MAD_F(0x05367e71) /* 0.325804179 */, 18 },
- /* 4997 */ { MAD_F(0x0536d99f) /* 0.325891133 */, 18 },
- /* 4998 */ { MAD_F(0x053734ce) /* 0.325978092 */, 18 },
- /* 4999 */ { MAD_F(0x05378ffe) /* 0.326065057 */, 18 },
- /* 5000 */ { MAD_F(0x0537eb30) /* 0.326152028 */, 18 },
- /* 5001 */ { MAD_F(0x05384664) /* 0.326239005 */, 18 },
- /* 5002 */ { MAD_F(0x0538a199) /* 0.326325988 */, 18 },
- /* 5003 */ { MAD_F(0x0538fcd0) /* 0.326412976 */, 18 },
- /* 5004 */ { MAD_F(0x05395808) /* 0.326499970 */, 18 },
- /* 5005 */ { MAD_F(0x0539b342) /* 0.326586970 */, 18 },
- /* 5006 */ { MAD_F(0x053a0e7d) /* 0.326673976 */, 18 },
- /* 5007 */ { MAD_F(0x053a69ba) /* 0.326760988 */, 18 },
-
- /* 5008 */ { MAD_F(0x053ac4f9) /* 0.326848005 */, 18 },
- /* 5009 */ { MAD_F(0x053b2039) /* 0.326935028 */, 18 },
- /* 5010 */ { MAD_F(0x053b7b7b) /* 0.327022057 */, 18 },
- /* 5011 */ { MAD_F(0x053bd6be) /* 0.327109092 */, 18 },
- /* 5012 */ { MAD_F(0x053c3203) /* 0.327196132 */, 18 },
- /* 5013 */ { MAD_F(0x053c8d49) /* 0.327283178 */, 18 },
- /* 5014 */ { MAD_F(0x053ce891) /* 0.327370231 */, 18 },
- /* 5015 */ { MAD_F(0x053d43da) /* 0.327457288 */, 18 },
- /* 5016 */ { MAD_F(0x053d9f25) /* 0.327544352 */, 18 },
- /* 5017 */ { MAD_F(0x053dfa72) /* 0.327631421 */, 18 },
- /* 5018 */ { MAD_F(0x053e55c0) /* 0.327718497 */, 18 },
- /* 5019 */ { MAD_F(0x053eb10f) /* 0.327805578 */, 18 },
- /* 5020 */ { MAD_F(0x053f0c61) /* 0.327892665 */, 18 },
- /* 5021 */ { MAD_F(0x053f67b3) /* 0.327979757 */, 18 },
- /* 5022 */ { MAD_F(0x053fc308) /* 0.328066855 */, 18 },
- /* 5023 */ { MAD_F(0x05401e5e) /* 0.328153960 */, 18 },
-
- /* 5024 */ { MAD_F(0x054079b5) /* 0.328241070 */, 18 },
- /* 5025 */ { MAD_F(0x0540d50e) /* 0.328328185 */, 18 },
- /* 5026 */ { MAD_F(0x05413068) /* 0.328415307 */, 18 },
- /* 5027 */ { MAD_F(0x05418bc4) /* 0.328502434 */, 18 },
- /* 5028 */ { MAD_F(0x0541e722) /* 0.328589567 */, 18 },
- /* 5029 */ { MAD_F(0x05424281) /* 0.328676706 */, 18 },
- /* 5030 */ { MAD_F(0x05429de2) /* 0.328763850 */, 18 },
- /* 5031 */ { MAD_F(0x0542f944) /* 0.328851001 */, 18 },
- /* 5032 */ { MAD_F(0x054354a8) /* 0.328938157 */, 18 },
- /* 5033 */ { MAD_F(0x0543b00d) /* 0.329025319 */, 18 },
- /* 5034 */ { MAD_F(0x05440b74) /* 0.329112486 */, 18 },
- /* 5035 */ { MAD_F(0x054466dd) /* 0.329199660 */, 18 },
- /* 5036 */ { MAD_F(0x0544c247) /* 0.329286839 */, 18 },
- /* 5037 */ { MAD_F(0x05451db2) /* 0.329374024 */, 18 },
- /* 5038 */ { MAD_F(0x0545791f) /* 0.329461215 */, 18 },
- /* 5039 */ { MAD_F(0x0545d48e) /* 0.329548411 */, 18 },
-
- /* 5040 */ { MAD_F(0x05462ffe) /* 0.329635614 */, 18 },
- /* 5041 */ { MAD_F(0x05468b70) /* 0.329722822 */, 18 },
- /* 5042 */ { MAD_F(0x0546e6e3) /* 0.329810036 */, 18 },
- /* 5043 */ { MAD_F(0x05474258) /* 0.329897255 */, 18 },
- /* 5044 */ { MAD_F(0x05479dce) /* 0.329984481 */, 18 },
- /* 5045 */ { MAD_F(0x0547f946) /* 0.330071712 */, 18 },
- /* 5046 */ { MAD_F(0x054854c0) /* 0.330158949 */, 18 },
- /* 5047 */ { MAD_F(0x0548b03b) /* 0.330246191 */, 18 },
- /* 5048 */ { MAD_F(0x05490bb7) /* 0.330333440 */, 18 },
- /* 5049 */ { MAD_F(0x05496735) /* 0.330420694 */, 18 },
- /* 5050 */ { MAD_F(0x0549c2b5) /* 0.330507954 */, 18 },
- /* 5051 */ { MAD_F(0x054a1e36) /* 0.330595220 */, 18 },
- /* 5052 */ { MAD_F(0x054a79b9) /* 0.330682491 */, 18 },
- /* 5053 */ { MAD_F(0x054ad53d) /* 0.330769768 */, 18 },
- /* 5054 */ { MAD_F(0x054b30c3) /* 0.330857051 */, 18 },
- /* 5055 */ { MAD_F(0x054b8c4b) /* 0.330944340 */, 18 },
-
- /* 5056 */ { MAD_F(0x054be7d4) /* 0.331031635 */, 18 },
- /* 5057 */ { MAD_F(0x054c435e) /* 0.331118935 */, 18 },
- /* 5058 */ { MAD_F(0x054c9eea) /* 0.331206241 */, 18 },
- /* 5059 */ { MAD_F(0x054cfa78) /* 0.331293553 */, 18 },
- /* 5060 */ { MAD_F(0x054d5607) /* 0.331380870 */, 18 },
- /* 5061 */ { MAD_F(0x054db197) /* 0.331468193 */, 18 },
- /* 5062 */ { MAD_F(0x054e0d2a) /* 0.331555522 */, 18 },
- /* 5063 */ { MAD_F(0x054e68bd) /* 0.331642857 */, 18 },
- /* 5064 */ { MAD_F(0x054ec453) /* 0.331730198 */, 18 },
- /* 5065 */ { MAD_F(0x054f1fe9) /* 0.331817544 */, 18 },
- /* 5066 */ { MAD_F(0x054f7b82) /* 0.331904896 */, 18 },
- /* 5067 */ { MAD_F(0x054fd71c) /* 0.331992254 */, 18 },
- /* 5068 */ { MAD_F(0x055032b7) /* 0.332079617 */, 18 },
- /* 5069 */ { MAD_F(0x05508e54) /* 0.332166986 */, 18 },
- /* 5070 */ { MAD_F(0x0550e9f3) /* 0.332254361 */, 18 },
- /* 5071 */ { MAD_F(0x05514593) /* 0.332341742 */, 18 },
-
- /* 5072 */ { MAD_F(0x0551a134) /* 0.332429129 */, 18 },
- /* 5073 */ { MAD_F(0x0551fcd8) /* 0.332516521 */, 18 },
- /* 5074 */ { MAD_F(0x0552587c) /* 0.332603919 */, 18 },
- /* 5075 */ { MAD_F(0x0552b423) /* 0.332691323 */, 18 },
- /* 5076 */ { MAD_F(0x05530fca) /* 0.332778732 */, 18 },
- /* 5077 */ { MAD_F(0x05536b74) /* 0.332866147 */, 18 },
- /* 5078 */ { MAD_F(0x0553c71f) /* 0.332953568 */, 18 },
- /* 5079 */ { MAD_F(0x055422cb) /* 0.333040995 */, 18 },
- /* 5080 */ { MAD_F(0x05547e79) /* 0.333128427 */, 18 },
- /* 5081 */ { MAD_F(0x0554da29) /* 0.333215865 */, 18 },
- /* 5082 */ { MAD_F(0x055535da) /* 0.333303309 */, 18 },
- /* 5083 */ { MAD_F(0x0555918c) /* 0.333390759 */, 18 },
- /* 5084 */ { MAD_F(0x0555ed40) /* 0.333478214 */, 18 },
- /* 5085 */ { MAD_F(0x055648f6) /* 0.333565675 */, 18 },
- /* 5086 */ { MAD_F(0x0556a4ad) /* 0.333653142 */, 18 },
- /* 5087 */ { MAD_F(0x05570066) /* 0.333740615 */, 18 },
-
- /* 5088 */ { MAD_F(0x05575c20) /* 0.333828093 */, 18 },
- /* 5089 */ { MAD_F(0x0557b7dc) /* 0.333915577 */, 18 },
- /* 5090 */ { MAD_F(0x05581399) /* 0.334003067 */, 18 },
- /* 5091 */ { MAD_F(0x05586f58) /* 0.334090562 */, 18 },
- /* 5092 */ { MAD_F(0x0558cb19) /* 0.334178063 */, 18 },
- /* 5093 */ { MAD_F(0x055926db) /* 0.334265570 */, 18 },
- /* 5094 */ { MAD_F(0x0559829e) /* 0.334353083 */, 18 },
- /* 5095 */ { MAD_F(0x0559de63) /* 0.334440601 */, 18 },
- /* 5096 */ { MAD_F(0x055a3a2a) /* 0.334528126 */, 18 },
- /* 5097 */ { MAD_F(0x055a95f2) /* 0.334615655 */, 18 },
- /* 5098 */ { MAD_F(0x055af1bb) /* 0.334703191 */, 18 },
- /* 5099 */ { MAD_F(0x055b4d87) /* 0.334790732 */, 18 },
- /* 5100 */ { MAD_F(0x055ba953) /* 0.334878279 */, 18 },
- /* 5101 */ { MAD_F(0x055c0522) /* 0.334965832 */, 18 },
- /* 5102 */ { MAD_F(0x055c60f1) /* 0.335053391 */, 18 },
- /* 5103 */ { MAD_F(0x055cbcc3) /* 0.335140955 */, 18 },
-
- /* 5104 */ { MAD_F(0x055d1896) /* 0.335228525 */, 18 },
- /* 5105 */ { MAD_F(0x055d746a) /* 0.335316100 */, 18 },
- /* 5106 */ { MAD_F(0x055dd040) /* 0.335403682 */, 18 },
- /* 5107 */ { MAD_F(0x055e2c17) /* 0.335491269 */, 18 },
- /* 5108 */ { MAD_F(0x055e87f0) /* 0.335578861 */, 18 },
- /* 5109 */ { MAD_F(0x055ee3cb) /* 0.335666460 */, 18 },
- /* 5110 */ { MAD_F(0x055f3fa7) /* 0.335754064 */, 18 },
- /* 5111 */ { MAD_F(0x055f9b85) /* 0.335841674 */, 18 },
- /* 5112 */ { MAD_F(0x055ff764) /* 0.335929290 */, 18 },
- /* 5113 */ { MAD_F(0x05605344) /* 0.336016911 */, 18 },
- /* 5114 */ { MAD_F(0x0560af27) /* 0.336104538 */, 18 },
- /* 5115 */ { MAD_F(0x05610b0a) /* 0.336192171 */, 18 },
- /* 5116 */ { MAD_F(0x056166f0) /* 0.336279809 */, 18 },
- /* 5117 */ { MAD_F(0x0561c2d7) /* 0.336367453 */, 18 },
- /* 5118 */ { MAD_F(0x05621ebf) /* 0.336455103 */, 18 },
- /* 5119 */ { MAD_F(0x05627aa9) /* 0.336542759 */, 18 },
-
- /* 5120 */ { MAD_F(0x0562d694) /* 0.336630420 */, 18 },
- /* 5121 */ { MAD_F(0x05633281) /* 0.336718087 */, 18 },
- /* 5122 */ { MAD_F(0x05638e70) /* 0.336805760 */, 18 },
- /* 5123 */ { MAD_F(0x0563ea60) /* 0.336893439 */, 18 },
- /* 5124 */ { MAD_F(0x05644651) /* 0.336981123 */, 18 },
- /* 5125 */ { MAD_F(0x0564a244) /* 0.337068813 */, 18 },
- /* 5126 */ { MAD_F(0x0564fe39) /* 0.337156508 */, 18 },
- /* 5127 */ { MAD_F(0x05655a2f) /* 0.337244209 */, 18 },
- /* 5128 */ { MAD_F(0x0565b627) /* 0.337331916 */, 18 },
- /* 5129 */ { MAD_F(0x05661220) /* 0.337419629 */, 18 },
- /* 5130 */ { MAD_F(0x05666e1a) /* 0.337507347 */, 18 },
- /* 5131 */ { MAD_F(0x0566ca17) /* 0.337595071 */, 18 },
- /* 5132 */ { MAD_F(0x05672614) /* 0.337682801 */, 18 },
- /* 5133 */ { MAD_F(0x05678214) /* 0.337770537 */, 18 },
- /* 5134 */ { MAD_F(0x0567de15) /* 0.337858278 */, 18 },
- /* 5135 */ { MAD_F(0x05683a17) /* 0.337946025 */, 18 },
-
- /* 5136 */ { MAD_F(0x0568961b) /* 0.338033777 */, 18 },
- /* 5137 */ { MAD_F(0x0568f220) /* 0.338121535 */, 18 },
- /* 5138 */ { MAD_F(0x05694e27) /* 0.338209299 */, 18 },
- /* 5139 */ { MAD_F(0x0569aa30) /* 0.338297069 */, 18 },
- /* 5140 */ { MAD_F(0x056a063a) /* 0.338384844 */, 18 },
- /* 5141 */ { MAD_F(0x056a6245) /* 0.338472625 */, 18 },
- /* 5142 */ { MAD_F(0x056abe52) /* 0.338560412 */, 18 },
- /* 5143 */ { MAD_F(0x056b1a61) /* 0.338648204 */, 18 },
- /* 5144 */ { MAD_F(0x056b7671) /* 0.338736002 */, 18 },
- /* 5145 */ { MAD_F(0x056bd283) /* 0.338823806 */, 18 },
- /* 5146 */ { MAD_F(0x056c2e96) /* 0.338911616 */, 18 },
- /* 5147 */ { MAD_F(0x056c8aab) /* 0.338999431 */, 18 },
- /* 5148 */ { MAD_F(0x056ce6c1) /* 0.339087252 */, 18 },
- /* 5149 */ { MAD_F(0x056d42d9) /* 0.339175078 */, 18 },
- /* 5150 */ { MAD_F(0x056d9ef2) /* 0.339262910 */, 18 },
- /* 5151 */ { MAD_F(0x056dfb0d) /* 0.339350748 */, 18 },
-
- /* 5152 */ { MAD_F(0x056e5729) /* 0.339438592 */, 18 },
- /* 5153 */ { MAD_F(0x056eb347) /* 0.339526441 */, 18 },
- /* 5154 */ { MAD_F(0x056f0f66) /* 0.339614296 */, 18 },
- /* 5155 */ { MAD_F(0x056f6b87) /* 0.339702157 */, 18 },
- /* 5156 */ { MAD_F(0x056fc7aa) /* 0.339790023 */, 18 },
- /* 5157 */ { MAD_F(0x057023cd) /* 0.339877895 */, 18 },
- /* 5158 */ { MAD_F(0x05707ff3) /* 0.339965773 */, 18 },
- /* 5159 */ { MAD_F(0x0570dc1a) /* 0.340053656 */, 18 },
- /* 5160 */ { MAD_F(0x05713843) /* 0.340141545 */, 18 },
- /* 5161 */ { MAD_F(0x0571946d) /* 0.340229440 */, 18 },
- /* 5162 */ { MAD_F(0x0571f098) /* 0.340317340 */, 18 },
- /* 5163 */ { MAD_F(0x05724cc5) /* 0.340405246 */, 18 },
- /* 5164 */ { MAD_F(0x0572a8f4) /* 0.340493158 */, 18 },
- /* 5165 */ { MAD_F(0x05730524) /* 0.340581075 */, 18 },
- /* 5166 */ { MAD_F(0x05736156) /* 0.340668999 */, 18 },
- /* 5167 */ { MAD_F(0x0573bd89) /* 0.340756927 */, 18 },
-
- /* 5168 */ { MAD_F(0x057419be) /* 0.340844862 */, 18 },
- /* 5169 */ { MAD_F(0x057475f4) /* 0.340932802 */, 18 },
- /* 5170 */ { MAD_F(0x0574d22c) /* 0.341020748 */, 18 },
- /* 5171 */ { MAD_F(0x05752e65) /* 0.341108699 */, 18 },
- /* 5172 */ { MAD_F(0x05758aa0) /* 0.341196656 */, 18 },
- /* 5173 */ { MAD_F(0x0575e6dc) /* 0.341284619 */, 18 },
- /* 5174 */ { MAD_F(0x0576431a) /* 0.341372587 */, 18 },
- /* 5175 */ { MAD_F(0x05769f59) /* 0.341460562 */, 18 },
- /* 5176 */ { MAD_F(0x0576fb9a) /* 0.341548541 */, 18 },
- /* 5177 */ { MAD_F(0x057757dd) /* 0.341636527 */, 18 },
- /* 5178 */ { MAD_F(0x0577b421) /* 0.341724518 */, 18 },
- /* 5179 */ { MAD_F(0x05781066) /* 0.341812515 */, 18 },
- /* 5180 */ { MAD_F(0x05786cad) /* 0.341900517 */, 18 },
- /* 5181 */ { MAD_F(0x0578c8f5) /* 0.341988525 */, 18 },
- /* 5182 */ { MAD_F(0x0579253f) /* 0.342076539 */, 18 },
- /* 5183 */ { MAD_F(0x0579818b) /* 0.342164558 */, 18 },
-
- /* 5184 */ { MAD_F(0x0579ddd8) /* 0.342252584 */, 18 },
- /* 5185 */ { MAD_F(0x057a3a27) /* 0.342340614 */, 18 },
- /* 5186 */ { MAD_F(0x057a9677) /* 0.342428651 */, 18 },
- /* 5187 */ { MAD_F(0x057af2c8) /* 0.342516693 */, 18 },
- /* 5188 */ { MAD_F(0x057b4f1c) /* 0.342604741 */, 18 },
- /* 5189 */ { MAD_F(0x057bab70) /* 0.342692794 */, 18 },
- /* 5190 */ { MAD_F(0x057c07c6) /* 0.342780853 */, 18 },
- /* 5191 */ { MAD_F(0x057c641e) /* 0.342868918 */, 18 },
- /* 5192 */ { MAD_F(0x057cc077) /* 0.342956988 */, 18 },
- /* 5193 */ { MAD_F(0x057d1cd2) /* 0.343045064 */, 18 },
- /* 5194 */ { MAD_F(0x057d792e) /* 0.343133146 */, 18 },
- /* 5195 */ { MAD_F(0x057dd58c) /* 0.343221233 */, 18 },
- /* 5196 */ { MAD_F(0x057e31eb) /* 0.343309326 */, 18 },
- /* 5197 */ { MAD_F(0x057e8e4c) /* 0.343397425 */, 18 },
- /* 5198 */ { MAD_F(0x057eeaae) /* 0.343485529 */, 18 },
- /* 5199 */ { MAD_F(0x057f4712) /* 0.343573639 */, 18 },
-
- /* 5200 */ { MAD_F(0x057fa378) /* 0.343661754 */, 18 },
- /* 5201 */ { MAD_F(0x057fffde) /* 0.343749876 */, 18 },
- /* 5202 */ { MAD_F(0x05805c47) /* 0.343838003 */, 18 },
- /* 5203 */ { MAD_F(0x0580b8b1) /* 0.343926135 */, 18 },
- /* 5204 */ { MAD_F(0x0581151c) /* 0.344014273 */, 18 },
- /* 5205 */ { MAD_F(0x05817189) /* 0.344102417 */, 18 },
- /* 5206 */ { MAD_F(0x0581cdf7) /* 0.344190566 */, 18 },
- /* 5207 */ { MAD_F(0x05822a67) /* 0.344278722 */, 18 },
- /* 5208 */ { MAD_F(0x058286d9) /* 0.344366882 */, 18 },
- /* 5209 */ { MAD_F(0x0582e34c) /* 0.344455049 */, 18 },
- /* 5210 */ { MAD_F(0x05833fc0) /* 0.344543221 */, 18 },
- /* 5211 */ { MAD_F(0x05839c36) /* 0.344631398 */, 18 },
- /* 5212 */ { MAD_F(0x0583f8ae) /* 0.344719582 */, 18 },
- /* 5213 */ { MAD_F(0x05845527) /* 0.344807771 */, 18 },
- /* 5214 */ { MAD_F(0x0584b1a1) /* 0.344895965 */, 18 },
- /* 5215 */ { MAD_F(0x05850e1e) /* 0.344984165 */, 18 },
-
- /* 5216 */ { MAD_F(0x05856a9b) /* 0.345072371 */, 18 },
- /* 5217 */ { MAD_F(0x0585c71a) /* 0.345160583 */, 18 },
- /* 5218 */ { MAD_F(0x0586239b) /* 0.345248800 */, 18 },
- /* 5219 */ { MAD_F(0x0586801d) /* 0.345337023 */, 18 },
- /* 5220 */ { MAD_F(0x0586dca1) /* 0.345425251 */, 18 },
- /* 5221 */ { MAD_F(0x05873926) /* 0.345513485 */, 18 },
- /* 5222 */ { MAD_F(0x058795ac) /* 0.345601725 */, 18 },
- /* 5223 */ { MAD_F(0x0587f235) /* 0.345689970 */, 18 },
- /* 5224 */ { MAD_F(0x05884ebe) /* 0.345778221 */, 18 },
- /* 5225 */ { MAD_F(0x0588ab49) /* 0.345866478 */, 18 },
- /* 5226 */ { MAD_F(0x058907d6) /* 0.345954740 */, 18 },
- /* 5227 */ { MAD_F(0x05896464) /* 0.346043008 */, 18 },
- /* 5228 */ { MAD_F(0x0589c0f4) /* 0.346131281 */, 18 },
- /* 5229 */ { MAD_F(0x058a1d85) /* 0.346219560 */, 18 },
- /* 5230 */ { MAD_F(0x058a7a18) /* 0.346307845 */, 18 },
- /* 5231 */ { MAD_F(0x058ad6ac) /* 0.346396135 */, 18 },
-
- /* 5232 */ { MAD_F(0x058b3342) /* 0.346484431 */, 18 },
- /* 5233 */ { MAD_F(0x058b8fd9) /* 0.346572733 */, 18 },
- /* 5234 */ { MAD_F(0x058bec72) /* 0.346661040 */, 18 },
- /* 5235 */ { MAD_F(0x058c490c) /* 0.346749353 */, 18 },
- /* 5236 */ { MAD_F(0x058ca5a8) /* 0.346837671 */, 18 },
- /* 5237 */ { MAD_F(0x058d0246) /* 0.346925996 */, 18 },
- /* 5238 */ { MAD_F(0x058d5ee4) /* 0.347014325 */, 18 },
- /* 5239 */ { MAD_F(0x058dbb85) /* 0.347102661 */, 18 },
- /* 5240 */ { MAD_F(0x058e1827) /* 0.347191002 */, 18 },
- /* 5241 */ { MAD_F(0x058e74ca) /* 0.347279348 */, 18 },
- /* 5242 */ { MAD_F(0x058ed16f) /* 0.347367700 */, 18 },
- /* 5243 */ { MAD_F(0x058f2e15) /* 0.347456058 */, 18 },
- /* 5244 */ { MAD_F(0x058f8abd) /* 0.347544422 */, 18 },
- /* 5245 */ { MAD_F(0x058fe766) /* 0.347632791 */, 18 },
- /* 5246 */ { MAD_F(0x05904411) /* 0.347721165 */, 18 },
- /* 5247 */ { MAD_F(0x0590a0be) /* 0.347809546 */, 18 },
-
- /* 5248 */ { MAD_F(0x0590fd6c) /* 0.347897931 */, 18 },
- /* 5249 */ { MAD_F(0x05915a1b) /* 0.347986323 */, 18 },
- /* 5250 */ { MAD_F(0x0591b6cc) /* 0.348074720 */, 18 },
- /* 5251 */ { MAD_F(0x0592137e) /* 0.348163123 */, 18 },
- /* 5252 */ { MAD_F(0x05927032) /* 0.348251531 */, 18 },
- /* 5253 */ { MAD_F(0x0592cce8) /* 0.348339945 */, 18 },
- /* 5254 */ { MAD_F(0x0593299f) /* 0.348428365 */, 18 },
- /* 5255 */ { MAD_F(0x05938657) /* 0.348516790 */, 18 },
- /* 5256 */ { MAD_F(0x0593e311) /* 0.348605221 */, 18 },
- /* 5257 */ { MAD_F(0x05943fcd) /* 0.348693657 */, 18 },
- /* 5258 */ { MAD_F(0x05949c8a) /* 0.348782099 */, 18 },
- /* 5259 */ { MAD_F(0x0594f948) /* 0.348870547 */, 18 },
- /* 5260 */ { MAD_F(0x05955608) /* 0.348959000 */, 18 },
- /* 5261 */ { MAD_F(0x0595b2ca) /* 0.349047459 */, 18 },
- /* 5262 */ { MAD_F(0x05960f8c) /* 0.349135923 */, 18 },
- /* 5263 */ { MAD_F(0x05966c51) /* 0.349224393 */, 18 },
-
- /* 5264 */ { MAD_F(0x0596c917) /* 0.349312869 */, 18 },
- /* 5265 */ { MAD_F(0x059725de) /* 0.349401350 */, 18 },
- /* 5266 */ { MAD_F(0x059782a7) /* 0.349489837 */, 18 },
- /* 5267 */ { MAD_F(0x0597df72) /* 0.349578329 */, 18 },
- /* 5268 */ { MAD_F(0x05983c3e) /* 0.349666827 */, 18 },
- /* 5269 */ { MAD_F(0x0598990c) /* 0.349755331 */, 18 },
- /* 5270 */ { MAD_F(0x0598f5db) /* 0.349843840 */, 18 },
- /* 5271 */ { MAD_F(0x059952ab) /* 0.349932355 */, 18 },
- /* 5272 */ { MAD_F(0x0599af7d) /* 0.350020876 */, 18 },
- /* 5273 */ { MAD_F(0x059a0c51) /* 0.350109402 */, 18 },
- /* 5274 */ { MAD_F(0x059a6926) /* 0.350197933 */, 18 },
- /* 5275 */ { MAD_F(0x059ac5fc) /* 0.350286470 */, 18 },
- /* 5276 */ { MAD_F(0x059b22d4) /* 0.350375013 */, 18 },
- /* 5277 */ { MAD_F(0x059b7fae) /* 0.350463562 */, 18 },
- /* 5278 */ { MAD_F(0x059bdc89) /* 0.350552116 */, 18 },
- /* 5279 */ { MAD_F(0x059c3965) /* 0.350640675 */, 18 },
-
- /* 5280 */ { MAD_F(0x059c9643) /* 0.350729240 */, 18 },
- /* 5281 */ { MAD_F(0x059cf323) /* 0.350817811 */, 18 },
- /* 5282 */ { MAD_F(0x059d5004) /* 0.350906388 */, 18 },
- /* 5283 */ { MAD_F(0x059dace6) /* 0.350994970 */, 18 },
- /* 5284 */ { MAD_F(0x059e09cb) /* 0.351083557 */, 18 },
- /* 5285 */ { MAD_F(0x059e66b0) /* 0.351172150 */, 18 },
- /* 5286 */ { MAD_F(0x059ec397) /* 0.351260749 */, 18 },
- /* 5287 */ { MAD_F(0x059f2080) /* 0.351349353 */, 18 },
- /* 5288 */ { MAD_F(0x059f7d6a) /* 0.351437963 */, 18 },
- /* 5289 */ { MAD_F(0x059fda55) /* 0.351526579 */, 18 },
- /* 5290 */ { MAD_F(0x05a03742) /* 0.351615200 */, 18 },
- /* 5291 */ { MAD_F(0x05a09431) /* 0.351703827 */, 18 },
- /* 5292 */ { MAD_F(0x05a0f121) /* 0.351792459 */, 18 },
- /* 5293 */ { MAD_F(0x05a14e12) /* 0.351881097 */, 18 },
- /* 5294 */ { MAD_F(0x05a1ab05) /* 0.351969740 */, 18 },
- /* 5295 */ { MAD_F(0x05a207fa) /* 0.352058389 */, 18 },
-
- /* 5296 */ { MAD_F(0x05a264f0) /* 0.352147044 */, 18 },
- /* 5297 */ { MAD_F(0x05a2c1e7) /* 0.352235704 */, 18 },
- /* 5298 */ { MAD_F(0x05a31ee1) /* 0.352324369 */, 18 },
- /* 5299 */ { MAD_F(0x05a37bdb) /* 0.352413041 */, 18 },
- /* 5300 */ { MAD_F(0x05a3d8d7) /* 0.352501718 */, 18 },
- /* 5301 */ { MAD_F(0x05a435d5) /* 0.352590400 */, 18 },
- /* 5302 */ { MAD_F(0x05a492d4) /* 0.352679088 */, 18 },
- /* 5303 */ { MAD_F(0x05a4efd4) /* 0.352767782 */, 18 },
- /* 5304 */ { MAD_F(0x05a54cd6) /* 0.352856481 */, 18 },
- /* 5305 */ { MAD_F(0x05a5a9da) /* 0.352945186 */, 18 },
- /* 5306 */ { MAD_F(0x05a606df) /* 0.353033896 */, 18 },
- /* 5307 */ { MAD_F(0x05a663e5) /* 0.353122612 */, 18 },
- /* 5308 */ { MAD_F(0x05a6c0ed) /* 0.353211333 */, 18 },
- /* 5309 */ { MAD_F(0x05a71df7) /* 0.353300061 */, 18 },
- /* 5310 */ { MAD_F(0x05a77b02) /* 0.353388793 */, 18 },
- /* 5311 */ { MAD_F(0x05a7d80e) /* 0.353477531 */, 18 },
-
- /* 5312 */ { MAD_F(0x05a8351c) /* 0.353566275 */, 18 },
- /* 5313 */ { MAD_F(0x05a8922c) /* 0.353655024 */, 18 },
- /* 5314 */ { MAD_F(0x05a8ef3c) /* 0.353743779 */, 18 },
- /* 5315 */ { MAD_F(0x05a94c4f) /* 0.353832540 */, 18 },
- /* 5316 */ { MAD_F(0x05a9a963) /* 0.353921306 */, 18 },
- /* 5317 */ { MAD_F(0x05aa0678) /* 0.354010077 */, 18 },
- /* 5318 */ { MAD_F(0x05aa638f) /* 0.354098855 */, 18 },
- /* 5319 */ { MAD_F(0x05aac0a8) /* 0.354187637 */, 18 },
- /* 5320 */ { MAD_F(0x05ab1dc2) /* 0.354276426 */, 18 },
- /* 5321 */ { MAD_F(0x05ab7add) /* 0.354365220 */, 18 },
- /* 5322 */ { MAD_F(0x05abd7fa) /* 0.354454019 */, 18 },
- /* 5323 */ { MAD_F(0x05ac3518) /* 0.354542824 */, 18 },
- /* 5324 */ { MAD_F(0x05ac9238) /* 0.354631635 */, 18 },
- /* 5325 */ { MAD_F(0x05acef5a) /* 0.354720451 */, 18 },
- /* 5326 */ { MAD_F(0x05ad4c7d) /* 0.354809272 */, 18 },
- /* 5327 */ { MAD_F(0x05ada9a1) /* 0.354898100 */, 18 },
-
- /* 5328 */ { MAD_F(0x05ae06c7) /* 0.354986932 */, 18 },
- /* 5329 */ { MAD_F(0x05ae63ee) /* 0.355075771 */, 18 },
- /* 5330 */ { MAD_F(0x05aec117) /* 0.355164615 */, 18 },
- /* 5331 */ { MAD_F(0x05af1e41) /* 0.355253464 */, 18 },
- /* 5332 */ { MAD_F(0x05af7b6d) /* 0.355342319 */, 18 },
- /* 5333 */ { MAD_F(0x05afd89b) /* 0.355431180 */, 18 },
- /* 5334 */ { MAD_F(0x05b035c9) /* 0.355520046 */, 18 },
- /* 5335 */ { MAD_F(0x05b092fa) /* 0.355608917 */, 18 },
- /* 5336 */ { MAD_F(0x05b0f02b) /* 0.355697795 */, 18 },
- /* 5337 */ { MAD_F(0x05b14d5f) /* 0.355786677 */, 18 },
- /* 5338 */ { MAD_F(0x05b1aa94) /* 0.355875566 */, 18 },
- /* 5339 */ { MAD_F(0x05b207ca) /* 0.355964460 */, 18 },
- /* 5340 */ { MAD_F(0x05b26502) /* 0.356053359 */, 18 },
- /* 5341 */ { MAD_F(0x05b2c23b) /* 0.356142264 */, 18 },
- /* 5342 */ { MAD_F(0x05b31f76) /* 0.356231175 */, 18 },
- /* 5343 */ { MAD_F(0x05b37cb2) /* 0.356320091 */, 18 },
-
- /* 5344 */ { MAD_F(0x05b3d9f0) /* 0.356409012 */, 18 },
- /* 5345 */ { MAD_F(0x05b4372f) /* 0.356497940 */, 18 },
- /* 5346 */ { MAD_F(0x05b4946f) /* 0.356586872 */, 18 },
- /* 5347 */ { MAD_F(0x05b4f1b2) /* 0.356675811 */, 18 },
- /* 5348 */ { MAD_F(0x05b54ef5) /* 0.356764754 */, 18 },
- /* 5349 */ { MAD_F(0x05b5ac3a) /* 0.356853704 */, 18 },
- /* 5350 */ { MAD_F(0x05b60981) /* 0.356942659 */, 18 },
- /* 5351 */ { MAD_F(0x05b666c9) /* 0.357031619 */, 18 },
- /* 5352 */ { MAD_F(0x05b6c413) /* 0.357120585 */, 18 },
- /* 5353 */ { MAD_F(0x05b7215e) /* 0.357209557 */, 18 },
- /* 5354 */ { MAD_F(0x05b77eab) /* 0.357298534 */, 18 },
- /* 5355 */ { MAD_F(0x05b7dbf9) /* 0.357387516 */, 18 },
- /* 5356 */ { MAD_F(0x05b83948) /* 0.357476504 */, 18 },
- /* 5357 */ { MAD_F(0x05b89699) /* 0.357565498 */, 18 },
- /* 5358 */ { MAD_F(0x05b8f3ec) /* 0.357654497 */, 18 },
- /* 5359 */ { MAD_F(0x05b95140) /* 0.357743502 */, 18 },
-
- /* 5360 */ { MAD_F(0x05b9ae95) /* 0.357832512 */, 18 },
- /* 5361 */ { MAD_F(0x05ba0bec) /* 0.357921528 */, 18 },
- /* 5362 */ { MAD_F(0x05ba6945) /* 0.358010550 */, 18 },
- /* 5363 */ { MAD_F(0x05bac69f) /* 0.358099576 */, 18 },
- /* 5364 */ { MAD_F(0x05bb23fa) /* 0.358188609 */, 18 },
- /* 5365 */ { MAD_F(0x05bb8157) /* 0.358277647 */, 18 },
- /* 5366 */ { MAD_F(0x05bbdeb6) /* 0.358366690 */, 18 },
- /* 5367 */ { MAD_F(0x05bc3c16) /* 0.358455739 */, 18 },
- /* 5368 */ { MAD_F(0x05bc9977) /* 0.358544794 */, 18 },
- /* 5369 */ { MAD_F(0x05bcf6da) /* 0.358633854 */, 18 },
- /* 5370 */ { MAD_F(0x05bd543e) /* 0.358722920 */, 18 },
- /* 5371 */ { MAD_F(0x05bdb1a4) /* 0.358811991 */, 18 },
- /* 5372 */ { MAD_F(0x05be0f0b) /* 0.358901067 */, 18 },
- /* 5373 */ { MAD_F(0x05be6c74) /* 0.358990150 */, 18 },
- /* 5374 */ { MAD_F(0x05bec9df) /* 0.359079237 */, 18 },
- /* 5375 */ { MAD_F(0x05bf274a) /* 0.359168331 */, 18 },
-
- /* 5376 */ { MAD_F(0x05bf84b8) /* 0.359257429 */, 18 },
- /* 5377 */ { MAD_F(0x05bfe226) /* 0.359346534 */, 18 },
- /* 5378 */ { MAD_F(0x05c03f97) /* 0.359435644 */, 18 },
- /* 5379 */ { MAD_F(0x05c09d08) /* 0.359524759 */, 18 },
- /* 5380 */ { MAD_F(0x05c0fa7c) /* 0.359613880 */, 18 },
- /* 5381 */ { MAD_F(0x05c157f0) /* 0.359703006 */, 18 },
- /* 5382 */ { MAD_F(0x05c1b566) /* 0.359792138 */, 18 },
- /* 5383 */ { MAD_F(0x05c212de) /* 0.359881276 */, 18 },
- /* 5384 */ { MAD_F(0x05c27057) /* 0.359970419 */, 18 },
- /* 5385 */ { MAD_F(0x05c2cdd2) /* 0.360059567 */, 18 },
- /* 5386 */ { MAD_F(0x05c32b4e) /* 0.360148721 */, 18 },
- /* 5387 */ { MAD_F(0x05c388cb) /* 0.360237881 */, 18 },
- /* 5388 */ { MAD_F(0x05c3e64b) /* 0.360327046 */, 18 },
- /* 5389 */ { MAD_F(0x05c443cb) /* 0.360416216 */, 18 },
- /* 5390 */ { MAD_F(0x05c4a14d) /* 0.360505392 */, 18 },
- /* 5391 */ { MAD_F(0x05c4fed1) /* 0.360594574 */, 18 },
-
- /* 5392 */ { MAD_F(0x05c55c56) /* 0.360683761 */, 18 },
- /* 5393 */ { MAD_F(0x05c5b9dc) /* 0.360772953 */, 18 },
- /* 5394 */ { MAD_F(0x05c61764) /* 0.360862152 */, 18 },
- /* 5395 */ { MAD_F(0x05c674ed) /* 0.360951355 */, 18 },
- /* 5396 */ { MAD_F(0x05c6d278) /* 0.361040564 */, 18 },
- /* 5397 */ { MAD_F(0x05c73005) /* 0.361129779 */, 18 },
- /* 5398 */ { MAD_F(0x05c78d93) /* 0.361218999 */, 18 },
- /* 5399 */ { MAD_F(0x05c7eb22) /* 0.361308225 */, 18 },
- /* 5400 */ { MAD_F(0x05c848b3) /* 0.361397456 */, 18 },
- /* 5401 */ { MAD_F(0x05c8a645) /* 0.361486693 */, 18 },
- /* 5402 */ { MAD_F(0x05c903d9) /* 0.361575935 */, 18 },
- /* 5403 */ { MAD_F(0x05c9616e) /* 0.361665183 */, 18 },
- /* 5404 */ { MAD_F(0x05c9bf05) /* 0.361754436 */, 18 },
- /* 5405 */ { MAD_F(0x05ca1c9d) /* 0.361843695 */, 18 },
- /* 5406 */ { MAD_F(0x05ca7a37) /* 0.361932959 */, 18 },
- /* 5407 */ { MAD_F(0x05cad7d2) /* 0.362022229 */, 18 },
-
- /* 5408 */ { MAD_F(0x05cb356e) /* 0.362111504 */, 18 },
- /* 5409 */ { MAD_F(0x05cb930d) /* 0.362200785 */, 18 },
- /* 5410 */ { MAD_F(0x05cbf0ac) /* 0.362290071 */, 18 },
- /* 5411 */ { MAD_F(0x05cc4e4d) /* 0.362379362 */, 18 },
- /* 5412 */ { MAD_F(0x05ccabf0) /* 0.362468660 */, 18 },
- /* 5413 */ { MAD_F(0x05cd0994) /* 0.362557962 */, 18 },
- /* 5414 */ { MAD_F(0x05cd6739) /* 0.362647271 */, 18 },
- /* 5415 */ { MAD_F(0x05cdc4e0) /* 0.362736584 */, 18 },
- /* 5416 */ { MAD_F(0x05ce2289) /* 0.362825904 */, 18 },
- /* 5417 */ { MAD_F(0x05ce8033) /* 0.362915228 */, 18 },
- /* 5418 */ { MAD_F(0x05ceddde) /* 0.363004559 */, 18 },
- /* 5419 */ { MAD_F(0x05cf3b8b) /* 0.363093894 */, 18 },
- /* 5420 */ { MAD_F(0x05cf9939) /* 0.363183236 */, 18 },
- /* 5421 */ { MAD_F(0x05cff6e9) /* 0.363272582 */, 18 },
- /* 5422 */ { MAD_F(0x05d0549a) /* 0.363361935 */, 18 },
- /* 5423 */ { MAD_F(0x05d0b24d) /* 0.363451292 */, 18 },
-
- /* 5424 */ { MAD_F(0x05d11001) /* 0.363540655 */, 18 },
- /* 5425 */ { MAD_F(0x05d16db7) /* 0.363630024 */, 18 },
- /* 5426 */ { MAD_F(0x05d1cb6e) /* 0.363719398 */, 18 },
- /* 5427 */ { MAD_F(0x05d22927) /* 0.363808778 */, 18 },
- /* 5428 */ { MAD_F(0x05d286e1) /* 0.363898163 */, 18 },
- /* 5429 */ { MAD_F(0x05d2e49d) /* 0.363987554 */, 18 },
- /* 5430 */ { MAD_F(0x05d3425a) /* 0.364076950 */, 18 },
- /* 5431 */ { MAD_F(0x05d3a018) /* 0.364166352 */, 18 },
- /* 5432 */ { MAD_F(0x05d3fdd8) /* 0.364255759 */, 18 },
- /* 5433 */ { MAD_F(0x05d45b9a) /* 0.364345171 */, 18 },
- /* 5434 */ { MAD_F(0x05d4b95d) /* 0.364434589 */, 18 },
- /* 5435 */ { MAD_F(0x05d51721) /* 0.364524013 */, 18 },
- /* 5436 */ { MAD_F(0x05d574e7) /* 0.364613442 */, 18 },
- /* 5437 */ { MAD_F(0x05d5d2af) /* 0.364702877 */, 18 },
- /* 5438 */ { MAD_F(0x05d63078) /* 0.364792317 */, 18 },
- /* 5439 */ { MAD_F(0x05d68e42) /* 0.364881762 */, 18 },
-
- /* 5440 */ { MAD_F(0x05d6ec0e) /* 0.364971213 */, 18 },
- /* 5441 */ { MAD_F(0x05d749db) /* 0.365060669 */, 18 },
- /* 5442 */ { MAD_F(0x05d7a7aa) /* 0.365150131 */, 18 },
- /* 5443 */ { MAD_F(0x05d8057a) /* 0.365239599 */, 18 },
- /* 5444 */ { MAD_F(0x05d8634c) /* 0.365329072 */, 18 },
- /* 5445 */ { MAD_F(0x05d8c11f) /* 0.365418550 */, 18 },
- /* 5446 */ { MAD_F(0x05d91ef4) /* 0.365508034 */, 18 },
- /* 5447 */ { MAD_F(0x05d97cca) /* 0.365597523 */, 18 },
- /* 5448 */ { MAD_F(0x05d9daa1) /* 0.365687018 */, 18 },
- /* 5449 */ { MAD_F(0x05da387a) /* 0.365776518 */, 18 },
- /* 5450 */ { MAD_F(0x05da9655) /* 0.365866024 */, 18 },
- /* 5451 */ { MAD_F(0x05daf431) /* 0.365955536 */, 18 },
- /* 5452 */ { MAD_F(0x05db520e) /* 0.366045052 */, 18 },
- /* 5453 */ { MAD_F(0x05dbafed) /* 0.366134574 */, 18 },
- /* 5454 */ { MAD_F(0x05dc0dce) /* 0.366224102 */, 18 },
- /* 5455 */ { MAD_F(0x05dc6baf) /* 0.366313635 */, 18 },
-
- /* 5456 */ { MAD_F(0x05dcc993) /* 0.366403174 */, 18 },
- /* 5457 */ { MAD_F(0x05dd2778) /* 0.366492718 */, 18 },
- /* 5458 */ { MAD_F(0x05dd855e) /* 0.366582267 */, 18 },
- /* 5459 */ { MAD_F(0x05dde346) /* 0.366671822 */, 18 },
- /* 5460 */ { MAD_F(0x05de412f) /* 0.366761383 */, 18 },
- /* 5461 */ { MAD_F(0x05de9f1a) /* 0.366850949 */, 18 },
- /* 5462 */ { MAD_F(0x05defd06) /* 0.366940520 */, 18 },
- /* 5463 */ { MAD_F(0x05df5af3) /* 0.367030097 */, 18 },
- /* 5464 */ { MAD_F(0x05dfb8e2) /* 0.367119680 */, 18 },
- /* 5465 */ { MAD_F(0x05e016d3) /* 0.367209267 */, 18 },
- /* 5466 */ { MAD_F(0x05e074c5) /* 0.367298861 */, 18 },
- /* 5467 */ { MAD_F(0x05e0d2b8) /* 0.367388459 */, 18 },
- /* 5468 */ { MAD_F(0x05e130ad) /* 0.367478064 */, 18 },
- /* 5469 */ { MAD_F(0x05e18ea4) /* 0.367567673 */, 18 },
- /* 5470 */ { MAD_F(0x05e1ec9c) /* 0.367657288 */, 18 },
- /* 5471 */ { MAD_F(0x05e24a95) /* 0.367746909 */, 18 },
-
- /* 5472 */ { MAD_F(0x05e2a890) /* 0.367836535 */, 18 },
- /* 5473 */ { MAD_F(0x05e3068c) /* 0.367926167 */, 18 },
- /* 5474 */ { MAD_F(0x05e3648a) /* 0.368015804 */, 18 },
- /* 5475 */ { MAD_F(0x05e3c289) /* 0.368105446 */, 18 },
- /* 5476 */ { MAD_F(0x05e4208a) /* 0.368195094 */, 18 },
- /* 5477 */ { MAD_F(0x05e47e8c) /* 0.368284747 */, 18 },
- /* 5478 */ { MAD_F(0x05e4dc8f) /* 0.368374406 */, 18 },
- /* 5479 */ { MAD_F(0x05e53a94) /* 0.368464070 */, 18 },
- /* 5480 */ { MAD_F(0x05e5989b) /* 0.368553740 */, 18 },
- /* 5481 */ { MAD_F(0x05e5f6a3) /* 0.368643415 */, 18 },
- /* 5482 */ { MAD_F(0x05e654ac) /* 0.368733096 */, 18 },
- /* 5483 */ { MAD_F(0x05e6b2b7) /* 0.368822782 */, 18 },
- /* 5484 */ { MAD_F(0x05e710c4) /* 0.368912473 */, 18 },
- /* 5485 */ { MAD_F(0x05e76ed2) /* 0.369002170 */, 18 },
- /* 5486 */ { MAD_F(0x05e7cce1) /* 0.369091873 */, 18 },
- /* 5487 */ { MAD_F(0x05e82af2) /* 0.369181581 */, 18 },
-
- /* 5488 */ { MAD_F(0x05e88904) /* 0.369271294 */, 18 },
- /* 5489 */ { MAD_F(0x05e8e718) /* 0.369361013 */, 18 },
- /* 5490 */ { MAD_F(0x05e9452d) /* 0.369450737 */, 18 },
- /* 5491 */ { MAD_F(0x05e9a343) /* 0.369540467 */, 18 },
- /* 5492 */ { MAD_F(0x05ea015c) /* 0.369630202 */, 18 },
- /* 5493 */ { MAD_F(0x05ea5f75) /* 0.369719942 */, 18 },
- /* 5494 */ { MAD_F(0x05eabd90) /* 0.369809688 */, 18 },
- /* 5495 */ { MAD_F(0x05eb1bad) /* 0.369899440 */, 18 },
- /* 5496 */ { MAD_F(0x05eb79cb) /* 0.369989197 */, 18 },
- /* 5497 */ { MAD_F(0x05ebd7ea) /* 0.370078959 */, 18 },
- /* 5498 */ { MAD_F(0x05ec360b) /* 0.370168727 */, 18 },
- /* 5499 */ { MAD_F(0x05ec942d) /* 0.370258500 */, 18 },
- /* 5500 */ { MAD_F(0x05ecf251) /* 0.370348279 */, 18 },
- /* 5501 */ { MAD_F(0x05ed5076) /* 0.370438063 */, 18 },
- /* 5502 */ { MAD_F(0x05edae9d) /* 0.370527853 */, 18 },
- /* 5503 */ { MAD_F(0x05ee0cc5) /* 0.370617648 */, 18 },
-
- /* 5504 */ { MAD_F(0x05ee6aef) /* 0.370707448 */, 18 },
- /* 5505 */ { MAD_F(0x05eec91a) /* 0.370797254 */, 18 },
- /* 5506 */ { MAD_F(0x05ef2746) /* 0.370887065 */, 18 },
- /* 5507 */ { MAD_F(0x05ef8574) /* 0.370976882 */, 18 },
- /* 5508 */ { MAD_F(0x05efe3a4) /* 0.371066704 */, 18 },
- /* 5509 */ { MAD_F(0x05f041d5) /* 0.371156532 */, 18 },
- /* 5510 */ { MAD_F(0x05f0a007) /* 0.371246365 */, 18 },
- /* 5511 */ { MAD_F(0x05f0fe3b) /* 0.371336203 */, 18 },
- /* 5512 */ { MAD_F(0x05f15c70) /* 0.371426047 */, 18 },
- /* 5513 */ { MAD_F(0x05f1baa7) /* 0.371515897 */, 18 },
- /* 5514 */ { MAD_F(0x05f218df) /* 0.371605751 */, 18 },
- /* 5515 */ { MAD_F(0x05f27719) /* 0.371695612 */, 18 },
- /* 5516 */ { MAD_F(0x05f2d554) /* 0.371785477 */, 18 },
- /* 5517 */ { MAD_F(0x05f33390) /* 0.371875348 */, 18 },
- /* 5518 */ { MAD_F(0x05f391cf) /* 0.371965225 */, 18 },
- /* 5519 */ { MAD_F(0x05f3f00e) /* 0.372055107 */, 18 },
-
- /* 5520 */ { MAD_F(0x05f44e4f) /* 0.372144994 */, 18 },
- /* 5521 */ { MAD_F(0x05f4ac91) /* 0.372234887 */, 18 },
- /* 5522 */ { MAD_F(0x05f50ad5) /* 0.372324785 */, 18 },
- /* 5523 */ { MAD_F(0x05f5691b) /* 0.372414689 */, 18 },
- /* 5524 */ { MAD_F(0x05f5c761) /* 0.372504598 */, 18 },
- /* 5525 */ { MAD_F(0x05f625aa) /* 0.372594513 */, 18 },
- /* 5526 */ { MAD_F(0x05f683f3) /* 0.372684433 */, 18 },
- /* 5527 */ { MAD_F(0x05f6e23f) /* 0.372774358 */, 18 },
- /* 5528 */ { MAD_F(0x05f7408b) /* 0.372864289 */, 18 },
- /* 5529 */ { MAD_F(0x05f79ed9) /* 0.372954225 */, 18 },
- /* 5530 */ { MAD_F(0x05f7fd29) /* 0.373044167 */, 18 },
- /* 5531 */ { MAD_F(0x05f85b7a) /* 0.373134114 */, 18 },
- /* 5532 */ { MAD_F(0x05f8b9cc) /* 0.373224066 */, 18 },
- /* 5533 */ { MAD_F(0x05f91820) /* 0.373314024 */, 18 },
- /* 5534 */ { MAD_F(0x05f97675) /* 0.373403987 */, 18 },
- /* 5535 */ { MAD_F(0x05f9d4cc) /* 0.373493956 */, 18 },
-
- /* 5536 */ { MAD_F(0x05fa3324) /* 0.373583930 */, 18 },
- /* 5537 */ { MAD_F(0x05fa917e) /* 0.373673910 */, 18 },
- /* 5538 */ { MAD_F(0x05faefd9) /* 0.373763895 */, 18 },
- /* 5539 */ { MAD_F(0x05fb4e36) /* 0.373853885 */, 18 },
- /* 5540 */ { MAD_F(0x05fbac94) /* 0.373943881 */, 18 },
- /* 5541 */ { MAD_F(0x05fc0af3) /* 0.374033882 */, 18 },
- /* 5542 */ { MAD_F(0x05fc6954) /* 0.374123889 */, 18 },
- /* 5543 */ { MAD_F(0x05fcc7b7) /* 0.374213901 */, 18 },
- /* 5544 */ { MAD_F(0x05fd261b) /* 0.374303918 */, 18 },
- /* 5545 */ { MAD_F(0x05fd8480) /* 0.374393941 */, 18 },
- /* 5546 */ { MAD_F(0x05fde2e7) /* 0.374483970 */, 18 },
- /* 5547 */ { MAD_F(0x05fe414f) /* 0.374574003 */, 18 },
- /* 5548 */ { MAD_F(0x05fe9fb9) /* 0.374664042 */, 18 },
- /* 5549 */ { MAD_F(0x05fefe24) /* 0.374754087 */, 18 },
- /* 5550 */ { MAD_F(0x05ff5c91) /* 0.374844137 */, 18 },
- /* 5551 */ { MAD_F(0x05ffbaff) /* 0.374934192 */, 18 },
-
- /* 5552 */ { MAD_F(0x0600196e) /* 0.375024253 */, 18 },
- /* 5553 */ { MAD_F(0x060077df) /* 0.375114319 */, 18 },
- /* 5554 */ { MAD_F(0x0600d651) /* 0.375204391 */, 18 },
- /* 5555 */ { MAD_F(0x060134c5) /* 0.375294468 */, 18 },
- /* 5556 */ { MAD_F(0x0601933b) /* 0.375384550 */, 18 },
- /* 5557 */ { MAD_F(0x0601f1b1) /* 0.375474638 */, 18 },
- /* 5558 */ { MAD_F(0x0602502a) /* 0.375564731 */, 18 },
- /* 5559 */ { MAD_F(0x0602aea3) /* 0.375654830 */, 18 },
- /* 5560 */ { MAD_F(0x06030d1e) /* 0.375744934 */, 18 },
- /* 5561 */ { MAD_F(0x06036b9b) /* 0.375835043 */, 18 },
- /* 5562 */ { MAD_F(0x0603ca19) /* 0.375925158 */, 18 },
- /* 5563 */ { MAD_F(0x06042898) /* 0.376015278 */, 18 },
- /* 5564 */ { MAD_F(0x06048719) /* 0.376105404 */, 18 },
- /* 5565 */ { MAD_F(0x0604e59c) /* 0.376195535 */, 18 },
- /* 5566 */ { MAD_F(0x0605441f) /* 0.376285671 */, 18 },
- /* 5567 */ { MAD_F(0x0605a2a5) /* 0.376375813 */, 18 },
-
- /* 5568 */ { MAD_F(0x0606012b) /* 0.376465960 */, 18 },
- /* 5569 */ { MAD_F(0x06065fb4) /* 0.376556113 */, 18 },
- /* 5570 */ { MAD_F(0x0606be3d) /* 0.376646271 */, 18 },
- /* 5571 */ { MAD_F(0x06071cc8) /* 0.376736434 */, 18 },
- /* 5572 */ { MAD_F(0x06077b55) /* 0.376826603 */, 18 },
- /* 5573 */ { MAD_F(0x0607d9e3) /* 0.376916777 */, 18 },
- /* 5574 */ { MAD_F(0x06083872) /* 0.377006957 */, 18 },
- /* 5575 */ { MAD_F(0x06089703) /* 0.377097141 */, 18 },
- /* 5576 */ { MAD_F(0x0608f595) /* 0.377187332 */, 18 },
- /* 5577 */ { MAD_F(0x06095429) /* 0.377277528 */, 18 },
- /* 5578 */ { MAD_F(0x0609b2be) /* 0.377367729 */, 18 },
- /* 5579 */ { MAD_F(0x060a1155) /* 0.377457935 */, 18 },
- /* 5580 */ { MAD_F(0x060a6fed) /* 0.377548147 */, 18 },
- /* 5581 */ { MAD_F(0x060ace86) /* 0.377638364 */, 18 },
- /* 5582 */ { MAD_F(0x060b2d21) /* 0.377728587 */, 18 },
- /* 5583 */ { MAD_F(0x060b8bbe) /* 0.377818815 */, 18 },
-
- /* 5584 */ { MAD_F(0x060bea5c) /* 0.377909049 */, 18 },
- /* 5585 */ { MAD_F(0x060c48fb) /* 0.377999288 */, 18 },
- /* 5586 */ { MAD_F(0x060ca79c) /* 0.378089532 */, 18 },
- /* 5587 */ { MAD_F(0x060d063e) /* 0.378179781 */, 18 },
- /* 5588 */ { MAD_F(0x060d64e1) /* 0.378270036 */, 18 },
- /* 5589 */ { MAD_F(0x060dc387) /* 0.378360297 */, 18 },
- /* 5590 */ { MAD_F(0x060e222d) /* 0.378450563 */, 18 },
- /* 5591 */ { MAD_F(0x060e80d5) /* 0.378540834 */, 18 },
- /* 5592 */ { MAD_F(0x060edf7f) /* 0.378631110 */, 18 },
- /* 5593 */ { MAD_F(0x060f3e29) /* 0.378721392 */, 18 },
- /* 5594 */ { MAD_F(0x060f9cd6) /* 0.378811680 */, 18 },
- /* 5595 */ { MAD_F(0x060ffb83) /* 0.378901972 */, 18 },
- /* 5596 */ { MAD_F(0x06105a33) /* 0.378992270 */, 18 },
- /* 5597 */ { MAD_F(0x0610b8e3) /* 0.379082574 */, 18 },
- /* 5598 */ { MAD_F(0x06111795) /* 0.379172883 */, 18 },
- /* 5599 */ { MAD_F(0x06117649) /* 0.379263197 */, 18 },
-
- /* 5600 */ { MAD_F(0x0611d4fe) /* 0.379353516 */, 18 },
- /* 5601 */ { MAD_F(0x061233b4) /* 0.379443841 */, 18 },
- /* 5602 */ { MAD_F(0x0612926c) /* 0.379534172 */, 18 },
- /* 5603 */ { MAD_F(0x0612f125) /* 0.379624507 */, 18 },
- /* 5604 */ { MAD_F(0x06134fe0) /* 0.379714848 */, 18 },
- /* 5605 */ { MAD_F(0x0613ae9c) /* 0.379805195 */, 18 },
- /* 5606 */ { MAD_F(0x06140d5a) /* 0.379895547 */, 18 },
- /* 5607 */ { MAD_F(0x06146c19) /* 0.379985904 */, 18 },
- /* 5608 */ { MAD_F(0x0614cada) /* 0.380076266 */, 18 },
- /* 5609 */ { MAD_F(0x0615299c) /* 0.380166634 */, 18 },
- /* 5610 */ { MAD_F(0x0615885f) /* 0.380257008 */, 18 },
- /* 5611 */ { MAD_F(0x0615e724) /* 0.380347386 */, 18 },
- /* 5612 */ { MAD_F(0x061645ea) /* 0.380437770 */, 18 },
- /* 5613 */ { MAD_F(0x0616a4b2) /* 0.380528160 */, 18 },
- /* 5614 */ { MAD_F(0x0617037b) /* 0.380618555 */, 18 },
- /* 5615 */ { MAD_F(0x06176246) /* 0.380708955 */, 18 },
-
- /* 5616 */ { MAD_F(0x0617c112) /* 0.380799360 */, 18 },
- /* 5617 */ { MAD_F(0x06181fdf) /* 0.380889771 */, 18 },
- /* 5618 */ { MAD_F(0x06187eae) /* 0.380980187 */, 18 },
- /* 5619 */ { MAD_F(0x0618dd7e) /* 0.381070609 */, 18 },
- /* 5620 */ { MAD_F(0x06193c50) /* 0.381161036 */, 18 },
- /* 5621 */ { MAD_F(0x06199b24) /* 0.381251468 */, 18 },
- /* 5622 */ { MAD_F(0x0619f9f8) /* 0.381341906 */, 18 },
- /* 5623 */ { MAD_F(0x061a58ce) /* 0.381432349 */, 18 },
- /* 5624 */ { MAD_F(0x061ab7a6) /* 0.381522798 */, 18 },
- /* 5625 */ { MAD_F(0x061b167f) /* 0.381613251 */, 18 },
- /* 5626 */ { MAD_F(0x061b7559) /* 0.381703711 */, 18 },
- /* 5627 */ { MAD_F(0x061bd435) /* 0.381794175 */, 18 },
- /* 5628 */ { MAD_F(0x061c3313) /* 0.381884645 */, 18 },
- /* 5629 */ { MAD_F(0x061c91f1) /* 0.381975120 */, 18 },
- /* 5630 */ { MAD_F(0x061cf0d2) /* 0.382065601 */, 18 },
- /* 5631 */ { MAD_F(0x061d4fb3) /* 0.382156087 */, 18 },
-
- /* 5632 */ { MAD_F(0x061dae96) /* 0.382246578 */, 18 },
- /* 5633 */ { MAD_F(0x061e0d7b) /* 0.382337075 */, 18 },
- /* 5634 */ { MAD_F(0x061e6c61) /* 0.382427577 */, 18 },
- /* 5635 */ { MAD_F(0x061ecb48) /* 0.382518084 */, 18 },
- /* 5636 */ { MAD_F(0x061f2a31) /* 0.382608597 */, 18 },
- /* 5637 */ { MAD_F(0x061f891b) /* 0.382699115 */, 18 },
- /* 5638 */ { MAD_F(0x061fe807) /* 0.382789638 */, 18 },
- /* 5639 */ { MAD_F(0x062046f4) /* 0.382880167 */, 18 },
- /* 5640 */ { MAD_F(0x0620a5e3) /* 0.382970701 */, 18 },
- /* 5641 */ { MAD_F(0x062104d3) /* 0.383061241 */, 18 },
- /* 5642 */ { MAD_F(0x062163c4) /* 0.383151786 */, 18 },
- /* 5643 */ { MAD_F(0x0621c2b7) /* 0.383242336 */, 18 },
- /* 5644 */ { MAD_F(0x062221ab) /* 0.383332891 */, 18 },
- /* 5645 */ { MAD_F(0x062280a1) /* 0.383423452 */, 18 },
- /* 5646 */ { MAD_F(0x0622df98) /* 0.383514018 */, 18 },
- /* 5647 */ { MAD_F(0x06233e91) /* 0.383604590 */, 18 },
-
- /* 5648 */ { MAD_F(0x06239d8b) /* 0.383695167 */, 18 },
- /* 5649 */ { MAD_F(0x0623fc86) /* 0.383785749 */, 18 },
- /* 5650 */ { MAD_F(0x06245b83) /* 0.383876337 */, 18 },
- /* 5651 */ { MAD_F(0x0624ba82) /* 0.383966930 */, 18 },
- /* 5652 */ { MAD_F(0x06251981) /* 0.384057528 */, 18 },
- /* 5653 */ { MAD_F(0x06257883) /* 0.384148132 */, 18 },
- /* 5654 */ { MAD_F(0x0625d785) /* 0.384238741 */, 18 },
- /* 5655 */ { MAD_F(0x06263689) /* 0.384329355 */, 18 },
- /* 5656 */ { MAD_F(0x0626958f) /* 0.384419975 */, 18 },
- /* 5657 */ { MAD_F(0x0626f496) /* 0.384510600 */, 18 },
- /* 5658 */ { MAD_F(0x0627539e) /* 0.384601230 */, 18 },
- /* 5659 */ { MAD_F(0x0627b2a8) /* 0.384691866 */, 18 },
- /* 5660 */ { MAD_F(0x062811b3) /* 0.384782507 */, 18 },
- /* 5661 */ { MAD_F(0x062870c0) /* 0.384873153 */, 18 },
- /* 5662 */ { MAD_F(0x0628cfce) /* 0.384963805 */, 18 },
- /* 5663 */ { MAD_F(0x06292ede) /* 0.385054462 */, 18 },
-
- /* 5664 */ { MAD_F(0x06298def) /* 0.385145124 */, 18 },
- /* 5665 */ { MAD_F(0x0629ed01) /* 0.385235792 */, 18 },
- /* 5666 */ { MAD_F(0x062a4c15) /* 0.385326465 */, 18 },
- /* 5667 */ { MAD_F(0x062aab2a) /* 0.385417143 */, 18 },
- /* 5668 */ { MAD_F(0x062b0a41) /* 0.385507827 */, 18 },
- /* 5669 */ { MAD_F(0x062b6959) /* 0.385598516 */, 18 },
- /* 5670 */ { MAD_F(0x062bc873) /* 0.385689211 */, 18 },
- /* 5671 */ { MAD_F(0x062c278e) /* 0.385779910 */, 18 },
- /* 5672 */ { MAD_F(0x062c86aa) /* 0.385870615 */, 18 },
- /* 5673 */ { MAD_F(0x062ce5c8) /* 0.385961326 */, 18 },
- /* 5674 */ { MAD_F(0x062d44e8) /* 0.386052041 */, 18 },
- /* 5675 */ { MAD_F(0x062da408) /* 0.386142762 */, 18 },
- /* 5676 */ { MAD_F(0x062e032a) /* 0.386233489 */, 18 },
- /* 5677 */ { MAD_F(0x062e624e) /* 0.386324221 */, 18 },
- /* 5678 */ { MAD_F(0x062ec173) /* 0.386414958 */, 18 },
- /* 5679 */ { MAD_F(0x062f209a) /* 0.386505700 */, 18 },
-
- /* 5680 */ { MAD_F(0x062f7fc1) /* 0.386596448 */, 18 },
- /* 5681 */ { MAD_F(0x062fdeeb) /* 0.386687201 */, 18 },
- /* 5682 */ { MAD_F(0x06303e16) /* 0.386777959 */, 18 },
- /* 5683 */ { MAD_F(0x06309d42) /* 0.386868723 */, 18 },
- /* 5684 */ { MAD_F(0x0630fc6f) /* 0.386959492 */, 18 },
- /* 5685 */ { MAD_F(0x06315b9e) /* 0.387050266 */, 18 },
- /* 5686 */ { MAD_F(0x0631bacf) /* 0.387141045 */, 18 },
- /* 5687 */ { MAD_F(0x06321a01) /* 0.387231830 */, 18 },
- /* 5688 */ { MAD_F(0x06327934) /* 0.387322621 */, 18 },
- /* 5689 */ { MAD_F(0x0632d869) /* 0.387413416 */, 18 },
- /* 5690 */ { MAD_F(0x0633379f) /* 0.387504217 */, 18 },
- /* 5691 */ { MAD_F(0x063396d7) /* 0.387595023 */, 18 },
- /* 5692 */ { MAD_F(0x0633f610) /* 0.387685835 */, 18 },
- /* 5693 */ { MAD_F(0x0634554a) /* 0.387776652 */, 18 },
- /* 5694 */ { MAD_F(0x0634b486) /* 0.387867474 */, 18 },
- /* 5695 */ { MAD_F(0x063513c3) /* 0.387958301 */, 18 },
-
- /* 5696 */ { MAD_F(0x06357302) /* 0.388049134 */, 18 },
- /* 5697 */ { MAD_F(0x0635d242) /* 0.388139972 */, 18 },
- /* 5698 */ { MAD_F(0x06363184) /* 0.388230816 */, 18 },
- /* 5699 */ { MAD_F(0x063690c7) /* 0.388321665 */, 18 },
- /* 5700 */ { MAD_F(0x0636f00b) /* 0.388412519 */, 18 },
- /* 5701 */ { MAD_F(0x06374f51) /* 0.388503378 */, 18 },
- /* 5702 */ { MAD_F(0x0637ae99) /* 0.388594243 */, 18 },
- /* 5703 */ { MAD_F(0x06380de1) /* 0.388685113 */, 18 },
- /* 5704 */ { MAD_F(0x06386d2b) /* 0.388775988 */, 18 },
- /* 5705 */ { MAD_F(0x0638cc77) /* 0.388866869 */, 18 },
- /* 5706 */ { MAD_F(0x06392bc4) /* 0.388957755 */, 18 },
- /* 5707 */ { MAD_F(0x06398b12) /* 0.389048646 */, 18 },
- /* 5708 */ { MAD_F(0x0639ea62) /* 0.389139542 */, 18 },
- /* 5709 */ { MAD_F(0x063a49b4) /* 0.389230444 */, 18 },
- /* 5710 */ { MAD_F(0x063aa906) /* 0.389321352 */, 18 },
- /* 5711 */ { MAD_F(0x063b085a) /* 0.389412264 */, 18 },
-
- /* 5712 */ { MAD_F(0x063b67b0) /* 0.389503182 */, 18 },
- /* 5713 */ { MAD_F(0x063bc707) /* 0.389594105 */, 18 },
- /* 5714 */ { MAD_F(0x063c265f) /* 0.389685033 */, 18 },
- /* 5715 */ { MAD_F(0x063c85b9) /* 0.389775967 */, 18 },
- /* 5716 */ { MAD_F(0x063ce514) /* 0.389866906 */, 18 },
- /* 5717 */ { MAD_F(0x063d4471) /* 0.389957850 */, 18 },
- /* 5718 */ { MAD_F(0x063da3cf) /* 0.390048800 */, 18 },
- /* 5719 */ { MAD_F(0x063e032f) /* 0.390139755 */, 18 },
- /* 5720 */ { MAD_F(0x063e6290) /* 0.390230715 */, 18 },
- /* 5721 */ { MAD_F(0x063ec1f2) /* 0.390321681 */, 18 },
- /* 5722 */ { MAD_F(0x063f2156) /* 0.390412651 */, 18 },
- /* 5723 */ { MAD_F(0x063f80bb) /* 0.390503628 */, 18 },
- /* 5724 */ { MAD_F(0x063fe022) /* 0.390594609 */, 18 },
- /* 5725 */ { MAD_F(0x06403f8a) /* 0.390685596 */, 18 },
- /* 5726 */ { MAD_F(0x06409ef3) /* 0.390776588 */, 18 },
- /* 5727 */ { MAD_F(0x0640fe5e) /* 0.390867585 */, 18 },
-
- /* 5728 */ { MAD_F(0x06415dcb) /* 0.390958588 */, 18 },
- /* 5729 */ { MAD_F(0x0641bd38) /* 0.391049596 */, 18 },
- /* 5730 */ { MAD_F(0x06421ca7) /* 0.391140609 */, 18 },
- /* 5731 */ { MAD_F(0x06427c18) /* 0.391231627 */, 18 },
- /* 5732 */ { MAD_F(0x0642db8a) /* 0.391322651 */, 18 },
- /* 5733 */ { MAD_F(0x06433afd) /* 0.391413680 */, 18 },
- /* 5734 */ { MAD_F(0x06439a72) /* 0.391504714 */, 18 },
- /* 5735 */ { MAD_F(0x0643f9e9) /* 0.391595754 */, 18 },
- /* 5736 */ { MAD_F(0x06445960) /* 0.391686799 */, 18 },
- /* 5737 */ { MAD_F(0x0644b8d9) /* 0.391777849 */, 18 },
- /* 5738 */ { MAD_F(0x06451854) /* 0.391868905 */, 18 },
- /* 5739 */ { MAD_F(0x064577d0) /* 0.391959966 */, 18 },
- /* 5740 */ { MAD_F(0x0645d74d) /* 0.392051032 */, 18 },
- /* 5741 */ { MAD_F(0x064636cc) /* 0.392142103 */, 18 },
- /* 5742 */ { MAD_F(0x0646964c) /* 0.392233180 */, 18 },
- /* 5743 */ { MAD_F(0x0646f5ce) /* 0.392324262 */, 18 },
-
- /* 5744 */ { MAD_F(0x06475551) /* 0.392415349 */, 18 },
- /* 5745 */ { MAD_F(0x0647b4d5) /* 0.392506442 */, 18 },
- /* 5746 */ { MAD_F(0x0648145b) /* 0.392597540 */, 18 },
- /* 5747 */ { MAD_F(0x064873e3) /* 0.392688643 */, 18 },
- /* 5748 */ { MAD_F(0x0648d36b) /* 0.392779751 */, 18 },
- /* 5749 */ { MAD_F(0x064932f6) /* 0.392870865 */, 18 },
- /* 5750 */ { MAD_F(0x06499281) /* 0.392961984 */, 18 },
- /* 5751 */ { MAD_F(0x0649f20e) /* 0.393053108 */, 18 },
- /* 5752 */ { MAD_F(0x064a519c) /* 0.393144238 */, 18 },
- /* 5753 */ { MAD_F(0x064ab12c) /* 0.393235372 */, 18 },
- /* 5754 */ { MAD_F(0x064b10be) /* 0.393326513 */, 18 },
- /* 5755 */ { MAD_F(0x064b7050) /* 0.393417658 */, 18 },
- /* 5756 */ { MAD_F(0x064bcfe4) /* 0.393508809 */, 18 },
- /* 5757 */ { MAD_F(0x064c2f7a) /* 0.393599965 */, 18 },
- /* 5758 */ { MAD_F(0x064c8f11) /* 0.393691126 */, 18 },
- /* 5759 */ { MAD_F(0x064ceea9) /* 0.393782292 */, 18 },
-
- /* 5760 */ { MAD_F(0x064d4e43) /* 0.393873464 */, 18 },
- /* 5761 */ { MAD_F(0x064dadde) /* 0.393964641 */, 18 },
- /* 5762 */ { MAD_F(0x064e0d7a) /* 0.394055823 */, 18 },
- /* 5763 */ { MAD_F(0x064e6d18) /* 0.394147011 */, 18 },
- /* 5764 */ { MAD_F(0x064eccb8) /* 0.394238204 */, 18 },
- /* 5765 */ { MAD_F(0x064f2c59) /* 0.394329402 */, 18 },
- /* 5766 */ { MAD_F(0x064f8bfb) /* 0.394420605 */, 18 },
- /* 5767 */ { MAD_F(0x064feb9e) /* 0.394511814 */, 18 },
- /* 5768 */ { MAD_F(0x06504b44) /* 0.394603028 */, 18 },
- /* 5769 */ { MAD_F(0x0650aaea) /* 0.394694247 */, 18 },
- /* 5770 */ { MAD_F(0x06510a92) /* 0.394785472 */, 18 },
- /* 5771 */ { MAD_F(0x06516a3b) /* 0.394876702 */, 18 },
- /* 5772 */ { MAD_F(0x0651c9e6) /* 0.394967937 */, 18 },
- /* 5773 */ { MAD_F(0x06522992) /* 0.395059177 */, 18 },
- /* 5774 */ { MAD_F(0x06528940) /* 0.395150423 */, 18 },
- /* 5775 */ { MAD_F(0x0652e8ef) /* 0.395241673 */, 18 },
-
- /* 5776 */ { MAD_F(0x0653489f) /* 0.395332930 */, 18 },
- /* 5777 */ { MAD_F(0x0653a851) /* 0.395424191 */, 18 },
- /* 5778 */ { MAD_F(0x06540804) /* 0.395515458 */, 18 },
- /* 5779 */ { MAD_F(0x065467b9) /* 0.395606730 */, 18 },
- /* 5780 */ { MAD_F(0x0654c76f) /* 0.395698007 */, 18 },
- /* 5781 */ { MAD_F(0x06552726) /* 0.395789289 */, 18 },
- /* 5782 */ { MAD_F(0x065586df) /* 0.395880577 */, 18 },
- /* 5783 */ { MAD_F(0x0655e699) /* 0.395971870 */, 18 },
- /* 5784 */ { MAD_F(0x06564655) /* 0.396063168 */, 18 },
- /* 5785 */ { MAD_F(0x0656a612) /* 0.396154472 */, 18 },
- /* 5786 */ { MAD_F(0x065705d0) /* 0.396245780 */, 18 },
- /* 5787 */ { MAD_F(0x06576590) /* 0.396337094 */, 18 },
- /* 5788 */ { MAD_F(0x0657c552) /* 0.396428414 */, 18 },
- /* 5789 */ { MAD_F(0x06582514) /* 0.396519738 */, 18 },
- /* 5790 */ { MAD_F(0x065884d9) /* 0.396611068 */, 18 },
- /* 5791 */ { MAD_F(0x0658e49e) /* 0.396702403 */, 18 },
-
- /* 5792 */ { MAD_F(0x06594465) /* 0.396793743 */, 18 },
- /* 5793 */ { MAD_F(0x0659a42e) /* 0.396885089 */, 18 },
- /* 5794 */ { MAD_F(0x065a03f7) /* 0.396976440 */, 18 },
- /* 5795 */ { MAD_F(0x065a63c3) /* 0.397067796 */, 18 },
- /* 5796 */ { MAD_F(0x065ac38f) /* 0.397159157 */, 18 },
- /* 5797 */ { MAD_F(0x065b235d) /* 0.397250524 */, 18 },
- /* 5798 */ { MAD_F(0x065b832d) /* 0.397341896 */, 18 },
- /* 5799 */ { MAD_F(0x065be2fe) /* 0.397433273 */, 18 },
- /* 5800 */ { MAD_F(0x065c42d0) /* 0.397524655 */, 18 },
- /* 5801 */ { MAD_F(0x065ca2a3) /* 0.397616043 */, 18 },
- /* 5802 */ { MAD_F(0x065d0279) /* 0.397707436 */, 18 },
- /* 5803 */ { MAD_F(0x065d624f) /* 0.397798834 */, 18 },
- /* 5804 */ { MAD_F(0x065dc227) /* 0.397890237 */, 18 },
- /* 5805 */ { MAD_F(0x065e2200) /* 0.397981646 */, 18 },
- /* 5806 */ { MAD_F(0x065e81db) /* 0.398073059 */, 18 },
- /* 5807 */ { MAD_F(0x065ee1b7) /* 0.398164479 */, 18 },
-
- /* 5808 */ { MAD_F(0x065f4195) /* 0.398255903 */, 18 },
- /* 5809 */ { MAD_F(0x065fa174) /* 0.398347333 */, 18 },
- /* 5810 */ { MAD_F(0x06600154) /* 0.398438767 */, 18 },
- /* 5811 */ { MAD_F(0x06606136) /* 0.398530207 */, 18 },
- /* 5812 */ { MAD_F(0x0660c119) /* 0.398621653 */, 18 },
- /* 5813 */ { MAD_F(0x066120fd) /* 0.398713103 */, 18 },
- /* 5814 */ { MAD_F(0x066180e3) /* 0.398804559 */, 18 },
- /* 5815 */ { MAD_F(0x0661e0cb) /* 0.398896020 */, 18 },
- /* 5816 */ { MAD_F(0x066240b4) /* 0.398987487 */, 18 },
- /* 5817 */ { MAD_F(0x0662a09e) /* 0.399078958 */, 18 },
- /* 5818 */ { MAD_F(0x06630089) /* 0.399170435 */, 18 },
- /* 5819 */ { MAD_F(0x06636077) /* 0.399261917 */, 18 },
- /* 5820 */ { MAD_F(0x0663c065) /* 0.399353404 */, 18 },
- /* 5821 */ { MAD_F(0x06642055) /* 0.399444897 */, 18 },
- /* 5822 */ { MAD_F(0x06648046) /* 0.399536395 */, 18 },
- /* 5823 */ { MAD_F(0x0664e039) /* 0.399627898 */, 18 },
-
- /* 5824 */ { MAD_F(0x0665402d) /* 0.399719406 */, 18 },
- /* 5825 */ { MAD_F(0x0665a022) /* 0.399810919 */, 18 },
- /* 5826 */ { MAD_F(0x06660019) /* 0.399902438 */, 18 },
- /* 5827 */ { MAD_F(0x06666011) /* 0.399993962 */, 18 },
- /* 5828 */ { MAD_F(0x0666c00b) /* 0.400085491 */, 18 },
- /* 5829 */ { MAD_F(0x06672006) /* 0.400177026 */, 18 },
- /* 5830 */ { MAD_F(0x06678003) /* 0.400268565 */, 18 },
- /* 5831 */ { MAD_F(0x0667e000) /* 0.400360110 */, 18 },
- /* 5832 */ { MAD_F(0x06684000) /* 0.400451660 */, 18 },
- /* 5833 */ { MAD_F(0x0668a000) /* 0.400543216 */, 18 },
- /* 5834 */ { MAD_F(0x06690003) /* 0.400634776 */, 18 },
- /* 5835 */ { MAD_F(0x06696006) /* 0.400726342 */, 18 },
- /* 5836 */ { MAD_F(0x0669c00b) /* 0.400817913 */, 18 },
- /* 5837 */ { MAD_F(0x066a2011) /* 0.400909489 */, 18 },
- /* 5838 */ { MAD_F(0x066a8019) /* 0.401001071 */, 18 },
- /* 5839 */ { MAD_F(0x066ae022) /* 0.401092657 */, 18 },
-
- /* 5840 */ { MAD_F(0x066b402d) /* 0.401184249 */, 18 },
- /* 5841 */ { MAD_F(0x066ba039) /* 0.401275847 */, 18 },
- /* 5842 */ { MAD_F(0x066c0046) /* 0.401367449 */, 18 },
- /* 5843 */ { MAD_F(0x066c6055) /* 0.401459057 */, 18 },
- /* 5844 */ { MAD_F(0x066cc065) /* 0.401550670 */, 18 },
- /* 5845 */ { MAD_F(0x066d2076) /* 0.401642288 */, 18 },
- /* 5846 */ { MAD_F(0x066d8089) /* 0.401733911 */, 18 },
- /* 5847 */ { MAD_F(0x066de09e) /* 0.401825540 */, 18 },
- /* 5848 */ { MAD_F(0x066e40b3) /* 0.401917173 */, 18 },
- /* 5849 */ { MAD_F(0x066ea0cb) /* 0.402008812 */, 18 },
- /* 5850 */ { MAD_F(0x066f00e3) /* 0.402100457 */, 18 },
- /* 5851 */ { MAD_F(0x066f60fd) /* 0.402192106 */, 18 },
- /* 5852 */ { MAD_F(0x066fc118) /* 0.402283761 */, 18 },
- /* 5853 */ { MAD_F(0x06702135) /* 0.402375420 */, 18 },
- /* 5854 */ { MAD_F(0x06708153) /* 0.402467086 */, 18 },
- /* 5855 */ { MAD_F(0x0670e173) /* 0.402558756 */, 18 },
-
- /* 5856 */ { MAD_F(0x06714194) /* 0.402650431 */, 18 },
- /* 5857 */ { MAD_F(0x0671a1b6) /* 0.402742112 */, 18 },
- /* 5858 */ { MAD_F(0x067201da) /* 0.402833798 */, 18 },
- /* 5859 */ { MAD_F(0x067261ff) /* 0.402925489 */, 18 },
- /* 5860 */ { MAD_F(0x0672c226) /* 0.403017186 */, 18 },
- /* 5861 */ { MAD_F(0x0673224e) /* 0.403108887 */, 18 },
- /* 5862 */ { MAD_F(0x06738277) /* 0.403200594 */, 18 },
- /* 5863 */ { MAD_F(0x0673e2a2) /* 0.403292306 */, 18 },
- /* 5864 */ { MAD_F(0x067442ce) /* 0.403384024 */, 18 },
- /* 5865 */ { MAD_F(0x0674a2fc) /* 0.403475746 */, 18 },
- /* 5866 */ { MAD_F(0x0675032b) /* 0.403567474 */, 18 },
- /* 5867 */ { MAD_F(0x0675635b) /* 0.403659207 */, 18 },
- /* 5868 */ { MAD_F(0x0675c38d) /* 0.403750945 */, 18 },
- /* 5869 */ { MAD_F(0x067623c0) /* 0.403842688 */, 18 },
- /* 5870 */ { MAD_F(0x067683f4) /* 0.403934437 */, 18 },
- /* 5871 */ { MAD_F(0x0676e42a) /* 0.404026190 */, 18 },
-
- /* 5872 */ { MAD_F(0x06774462) /* 0.404117949 */, 18 },
- /* 5873 */ { MAD_F(0x0677a49b) /* 0.404209714 */, 18 },
- /* 5874 */ { MAD_F(0x067804d5) /* 0.404301483 */, 18 },
- /* 5875 */ { MAD_F(0x06786510) /* 0.404393258 */, 18 },
- /* 5876 */ { MAD_F(0x0678c54d) /* 0.404485037 */, 18 },
- /* 5877 */ { MAD_F(0x0679258c) /* 0.404576822 */, 18 },
- /* 5878 */ { MAD_F(0x067985cb) /* 0.404668613 */, 18 },
- /* 5879 */ { MAD_F(0x0679e60c) /* 0.404760408 */, 18 },
- /* 5880 */ { MAD_F(0x067a464f) /* 0.404852209 */, 18 },
- /* 5881 */ { MAD_F(0x067aa693) /* 0.404944014 */, 18 },
- /* 5882 */ { MAD_F(0x067b06d8) /* 0.405035825 */, 18 },
- /* 5883 */ { MAD_F(0x067b671f) /* 0.405127642 */, 18 },
- /* 5884 */ { MAD_F(0x067bc767) /* 0.405219463 */, 18 },
- /* 5885 */ { MAD_F(0x067c27b1) /* 0.405311290 */, 18 },
- /* 5886 */ { MAD_F(0x067c87fc) /* 0.405403122 */, 18 },
- /* 5887 */ { MAD_F(0x067ce848) /* 0.405494959 */, 18 },
-
- /* 5888 */ { MAD_F(0x067d4896) /* 0.405586801 */, 18 },
- /* 5889 */ { MAD_F(0x067da8e5) /* 0.405678648 */, 18 },
- /* 5890 */ { MAD_F(0x067e0935) /* 0.405770501 */, 18 },
- /* 5891 */ { MAD_F(0x067e6987) /* 0.405862359 */, 18 },
- /* 5892 */ { MAD_F(0x067ec9da) /* 0.405954222 */, 18 },
- /* 5893 */ { MAD_F(0x067f2a2f) /* 0.406046090 */, 18 },
- /* 5894 */ { MAD_F(0x067f8a85) /* 0.406137963 */, 18 },
- /* 5895 */ { MAD_F(0x067feadd) /* 0.406229842 */, 18 },
- /* 5896 */ { MAD_F(0x06804b36) /* 0.406321726 */, 18 },
- /* 5897 */ { MAD_F(0x0680ab90) /* 0.406413615 */, 18 },
- /* 5898 */ { MAD_F(0x06810beb) /* 0.406505509 */, 18 },
- /* 5899 */ { MAD_F(0x06816c49) /* 0.406597408 */, 18 },
- /* 5900 */ { MAD_F(0x0681cca7) /* 0.406689313 */, 18 },
- /* 5901 */ { MAD_F(0x06822d07) /* 0.406781223 */, 18 },
- /* 5902 */ { MAD_F(0x06828d68) /* 0.406873138 */, 18 },
- /* 5903 */ { MAD_F(0x0682edcb) /* 0.406965058 */, 18 },
-
- /* 5904 */ { MAD_F(0x06834e2f) /* 0.407056983 */, 18 },
- /* 5905 */ { MAD_F(0x0683ae94) /* 0.407148914 */, 18 },
- /* 5906 */ { MAD_F(0x06840efb) /* 0.407240850 */, 18 },
- /* 5907 */ { MAD_F(0x06846f63) /* 0.407332791 */, 18 },
- /* 5908 */ { MAD_F(0x0684cfcd) /* 0.407424737 */, 18 },
- /* 5909 */ { MAD_F(0x06853038) /* 0.407516688 */, 18 },
- /* 5910 */ { MAD_F(0x068590a4) /* 0.407608645 */, 18 },
- /* 5911 */ { MAD_F(0x0685f112) /* 0.407700606 */, 18 },
- /* 5912 */ { MAD_F(0x06865181) /* 0.407792573 */, 18 },
- /* 5913 */ { MAD_F(0x0686b1f2) /* 0.407884545 */, 18 },
- /* 5914 */ { MAD_F(0x06871264) /* 0.407976522 */, 18 },
- /* 5915 */ { MAD_F(0x068772d7) /* 0.408068505 */, 18 },
- /* 5916 */ { MAD_F(0x0687d34c) /* 0.408160492 */, 18 },
- /* 5917 */ { MAD_F(0x068833c2) /* 0.408252485 */, 18 },
- /* 5918 */ { MAD_F(0x06889439) /* 0.408344483 */, 18 },
- /* 5919 */ { MAD_F(0x0688f4b2) /* 0.408436486 */, 18 },
-
- /* 5920 */ { MAD_F(0x0689552c) /* 0.408528495 */, 18 },
- /* 5921 */ { MAD_F(0x0689b5a8) /* 0.408620508 */, 18 },
- /* 5922 */ { MAD_F(0x068a1625) /* 0.408712527 */, 18 },
- /* 5923 */ { MAD_F(0x068a76a4) /* 0.408804551 */, 18 },
- /* 5924 */ { MAD_F(0x068ad724) /* 0.408896580 */, 18 },
- /* 5925 */ { MAD_F(0x068b37a5) /* 0.408988614 */, 18 },
- /* 5926 */ { MAD_F(0x068b9827) /* 0.409080653 */, 18 },
- /* 5927 */ { MAD_F(0x068bf8ac) /* 0.409172698 */, 18 },
- /* 5928 */ { MAD_F(0x068c5931) /* 0.409264748 */, 18 },
- /* 5929 */ { MAD_F(0x068cb9b8) /* 0.409356803 */, 18 },
- /* 5930 */ { MAD_F(0x068d1a40) /* 0.409448863 */, 18 },
- /* 5931 */ { MAD_F(0x068d7aca) /* 0.409540928 */, 18 },
- /* 5932 */ { MAD_F(0x068ddb54) /* 0.409632999 */, 18 },
- /* 5933 */ { MAD_F(0x068e3be1) /* 0.409725074 */, 18 },
- /* 5934 */ { MAD_F(0x068e9c6f) /* 0.409817155 */, 18 },
- /* 5935 */ { MAD_F(0x068efcfe) /* 0.409909241 */, 18 },
-
- /* 5936 */ { MAD_F(0x068f5d8e) /* 0.410001332 */, 18 },
- /* 5937 */ { MAD_F(0x068fbe20) /* 0.410093428 */, 18 },
- /* 5938 */ { MAD_F(0x06901eb4) /* 0.410185530 */, 18 },
- /* 5939 */ { MAD_F(0x06907f48) /* 0.410277637 */, 18 },
- /* 5940 */ { MAD_F(0x0690dfde) /* 0.410369748 */, 18 },
- /* 5941 */ { MAD_F(0x06914076) /* 0.410461865 */, 18 },
- /* 5942 */ { MAD_F(0x0691a10f) /* 0.410553988 */, 18 },
- /* 5943 */ { MAD_F(0x069201a9) /* 0.410646115 */, 18 },
- /* 5944 */ { MAD_F(0x06926245) /* 0.410738247 */, 18 },
- /* 5945 */ { MAD_F(0x0692c2e2) /* 0.410830385 */, 18 },
- /* 5946 */ { MAD_F(0x06932380) /* 0.410922528 */, 18 },
- /* 5947 */ { MAD_F(0x06938420) /* 0.411014676 */, 18 },
- /* 5948 */ { MAD_F(0x0693e4c1) /* 0.411106829 */, 18 },
- /* 5949 */ { MAD_F(0x06944563) /* 0.411198987 */, 18 },
- /* 5950 */ { MAD_F(0x0694a607) /* 0.411291151 */, 18 },
- /* 5951 */ { MAD_F(0x069506ad) /* 0.411383320 */, 18 },
-
- /* 5952 */ { MAD_F(0x06956753) /* 0.411475493 */, 18 },
- /* 5953 */ { MAD_F(0x0695c7fc) /* 0.411567672 */, 18 },
- /* 5954 */ { MAD_F(0x069628a5) /* 0.411659857 */, 18 },
- /* 5955 */ { MAD_F(0x06968950) /* 0.411752046 */, 18 },
- /* 5956 */ { MAD_F(0x0696e9fc) /* 0.411844240 */, 18 },
- /* 5957 */ { MAD_F(0x06974aaa) /* 0.411936440 */, 18 },
- /* 5958 */ { MAD_F(0x0697ab59) /* 0.412028645 */, 18 },
- /* 5959 */ { MAD_F(0x06980c09) /* 0.412120855 */, 18 },
- /* 5960 */ { MAD_F(0x06986cbb) /* 0.412213070 */, 18 },
- /* 5961 */ { MAD_F(0x0698cd6e) /* 0.412305290 */, 18 },
- /* 5962 */ { MAD_F(0x06992e23) /* 0.412397516 */, 18 },
- /* 5963 */ { MAD_F(0x06998ed9) /* 0.412489746 */, 18 },
- /* 5964 */ { MAD_F(0x0699ef90) /* 0.412581982 */, 18 },
- /* 5965 */ { MAD_F(0x069a5049) /* 0.412674223 */, 18 },
- /* 5966 */ { MAD_F(0x069ab103) /* 0.412766469 */, 18 },
- /* 5967 */ { MAD_F(0x069b11bf) /* 0.412858720 */, 18 },
-
- /* 5968 */ { MAD_F(0x069b727b) /* 0.412950976 */, 18 },
- /* 5969 */ { MAD_F(0x069bd33a) /* 0.413043238 */, 18 },
- /* 5970 */ { MAD_F(0x069c33f9) /* 0.413135505 */, 18 },
- /* 5971 */ { MAD_F(0x069c94ba) /* 0.413227776 */, 18 },
- /* 5972 */ { MAD_F(0x069cf57d) /* 0.413320053 */, 18 },
- /* 5973 */ { MAD_F(0x069d5641) /* 0.413412335 */, 18 },
- /* 5974 */ { MAD_F(0x069db706) /* 0.413504623 */, 18 },
- /* 5975 */ { MAD_F(0x069e17cc) /* 0.413596915 */, 18 },
- /* 5976 */ { MAD_F(0x069e7894) /* 0.413689213 */, 18 },
- /* 5977 */ { MAD_F(0x069ed95e) /* 0.413781515 */, 18 },
- /* 5978 */ { MAD_F(0x069f3a28) /* 0.413873823 */, 18 },
- /* 5979 */ { MAD_F(0x069f9af4) /* 0.413966136 */, 18 },
- /* 5980 */ { MAD_F(0x069ffbc2) /* 0.414058454 */, 18 },
- /* 5981 */ { MAD_F(0x06a05c91) /* 0.414150778 */, 18 },
- /* 5982 */ { MAD_F(0x06a0bd61) /* 0.414243106 */, 18 },
- /* 5983 */ { MAD_F(0x06a11e32) /* 0.414335440 */, 18 },
-
- /* 5984 */ { MAD_F(0x06a17f05) /* 0.414427779 */, 18 },
- /* 5985 */ { MAD_F(0x06a1dfda) /* 0.414520122 */, 18 },
- /* 5986 */ { MAD_F(0x06a240b0) /* 0.414612471 */, 18 },
- /* 5987 */ { MAD_F(0x06a2a187) /* 0.414704826 */, 18 },
- /* 5988 */ { MAD_F(0x06a3025f) /* 0.414797185 */, 18 },
- /* 5989 */ { MAD_F(0x06a36339) /* 0.414889549 */, 18 },
- /* 5990 */ { MAD_F(0x06a3c414) /* 0.414981919 */, 18 },
- /* 5991 */ { MAD_F(0x06a424f1) /* 0.415074294 */, 18 },
- /* 5992 */ { MAD_F(0x06a485cf) /* 0.415166674 */, 18 },
- /* 5993 */ { MAD_F(0x06a4e6ae) /* 0.415259059 */, 18 },
- /* 5994 */ { MAD_F(0x06a5478f) /* 0.415351449 */, 18 },
- /* 5995 */ { MAD_F(0x06a5a871) /* 0.415443844 */, 18 },
- /* 5996 */ { MAD_F(0x06a60955) /* 0.415536244 */, 18 },
- /* 5997 */ { MAD_F(0x06a66a3a) /* 0.415628650 */, 18 },
- /* 5998 */ { MAD_F(0x06a6cb20) /* 0.415721061 */, 18 },
- /* 5999 */ { MAD_F(0x06a72c08) /* 0.415813476 */, 18 },
-
- /* 6000 */ { MAD_F(0x06a78cf1) /* 0.415905897 */, 18 },
- /* 6001 */ { MAD_F(0x06a7eddb) /* 0.415998324 */, 18 },
- /* 6002 */ { MAD_F(0x06a84ec7) /* 0.416090755 */, 18 },
- /* 6003 */ { MAD_F(0x06a8afb4) /* 0.416183191 */, 18 },
- /* 6004 */ { MAD_F(0x06a910a3) /* 0.416275633 */, 18 },
- /* 6005 */ { MAD_F(0x06a97193) /* 0.416368079 */, 18 },
- /* 6006 */ { MAD_F(0x06a9d284) /* 0.416460531 */, 18 },
- /* 6007 */ { MAD_F(0x06aa3377) /* 0.416552988 */, 18 },
- /* 6008 */ { MAD_F(0x06aa946b) /* 0.416645450 */, 18 },
- /* 6009 */ { MAD_F(0x06aaf561) /* 0.416737917 */, 18 },
- /* 6010 */ { MAD_F(0x06ab5657) /* 0.416830389 */, 18 },
- /* 6011 */ { MAD_F(0x06abb750) /* 0.416922867 */, 18 },
- /* 6012 */ { MAD_F(0x06ac1849) /* 0.417015349 */, 18 },
- /* 6013 */ { MAD_F(0x06ac7944) /* 0.417107837 */, 18 },
- /* 6014 */ { MAD_F(0x06acda41) /* 0.417200330 */, 18 },
- /* 6015 */ { MAD_F(0x06ad3b3e) /* 0.417292828 */, 18 },
-
- /* 6016 */ { MAD_F(0x06ad9c3d) /* 0.417385331 */, 18 },
- /* 6017 */ { MAD_F(0x06adfd3e) /* 0.417477839 */, 18 },
- /* 6018 */ { MAD_F(0x06ae5e40) /* 0.417570352 */, 18 },
- /* 6019 */ { MAD_F(0x06aebf43) /* 0.417662871 */, 18 },
- /* 6020 */ { MAD_F(0x06af2047) /* 0.417755394 */, 18 },
- /* 6021 */ { MAD_F(0x06af814d) /* 0.417847923 */, 18 },
- /* 6022 */ { MAD_F(0x06afe255) /* 0.417940457 */, 18 },
- /* 6023 */ { MAD_F(0x06b0435e) /* 0.418032996 */, 18 },
- /* 6024 */ { MAD_F(0x06b0a468) /* 0.418125540 */, 18 },
- /* 6025 */ { MAD_F(0x06b10573) /* 0.418218089 */, 18 },
- /* 6026 */ { MAD_F(0x06b16680) /* 0.418310643 */, 18 },
- /* 6027 */ { MAD_F(0x06b1c78e) /* 0.418403203 */, 18 },
- /* 6028 */ { MAD_F(0x06b2289e) /* 0.418495767 */, 18 },
- /* 6029 */ { MAD_F(0x06b289af) /* 0.418588337 */, 18 },
- /* 6030 */ { MAD_F(0x06b2eac1) /* 0.418680911 */, 18 },
- /* 6031 */ { MAD_F(0x06b34bd5) /* 0.418773491 */, 18 },
-
- /* 6032 */ { MAD_F(0x06b3acea) /* 0.418866076 */, 18 },
- /* 6033 */ { MAD_F(0x06b40e00) /* 0.418958666 */, 18 },
- /* 6034 */ { MAD_F(0x06b46f18) /* 0.419051262 */, 18 },
- /* 6035 */ { MAD_F(0x06b4d031) /* 0.419143862 */, 18 },
- /* 6036 */ { MAD_F(0x06b5314c) /* 0.419236467 */, 18 },
- /* 6037 */ { MAD_F(0x06b59268) /* 0.419329078 */, 18 },
- /* 6038 */ { MAD_F(0x06b5f385) /* 0.419421694 */, 18 },
- /* 6039 */ { MAD_F(0x06b654a4) /* 0.419514314 */, 18 },
- /* 6040 */ { MAD_F(0x06b6b5c4) /* 0.419606940 */, 18 },
- /* 6041 */ { MAD_F(0x06b716e6) /* 0.419699571 */, 18 },
- /* 6042 */ { MAD_F(0x06b77808) /* 0.419792208 */, 18 },
- /* 6043 */ { MAD_F(0x06b7d92d) /* 0.419884849 */, 18 },
- /* 6044 */ { MAD_F(0x06b83a52) /* 0.419977495 */, 18 },
- /* 6045 */ { MAD_F(0x06b89b79) /* 0.420070147 */, 18 },
- /* 6046 */ { MAD_F(0x06b8fca1) /* 0.420162803 */, 18 },
- /* 6047 */ { MAD_F(0x06b95dcb) /* 0.420255465 */, 18 },
-
- /* 6048 */ { MAD_F(0x06b9bef6) /* 0.420348132 */, 18 },
- /* 6049 */ { MAD_F(0x06ba2023) /* 0.420440803 */, 18 },
- /* 6050 */ { MAD_F(0x06ba8150) /* 0.420533481 */, 18 },
- /* 6051 */ { MAD_F(0x06bae280) /* 0.420626163 */, 18 },
- /* 6052 */ { MAD_F(0x06bb43b0) /* 0.420718850 */, 18 },
- /* 6053 */ { MAD_F(0x06bba4e2) /* 0.420811542 */, 18 },
- /* 6054 */ { MAD_F(0x06bc0615) /* 0.420904240 */, 18 },
- /* 6055 */ { MAD_F(0x06bc674a) /* 0.420996942 */, 18 },
- /* 6056 */ { MAD_F(0x06bcc880) /* 0.421089650 */, 18 },
- /* 6057 */ { MAD_F(0x06bd29b7) /* 0.421182362 */, 18 },
- /* 6058 */ { MAD_F(0x06bd8af0) /* 0.421275080 */, 18 },
- /* 6059 */ { MAD_F(0x06bdec2a) /* 0.421367803 */, 18 },
- /* 6060 */ { MAD_F(0x06be4d66) /* 0.421460531 */, 18 },
- /* 6061 */ { MAD_F(0x06beaea3) /* 0.421553264 */, 18 },
- /* 6062 */ { MAD_F(0x06bf0fe1) /* 0.421646003 */, 18 },
- /* 6063 */ { MAD_F(0x06bf7120) /* 0.421738746 */, 18 },
-
- /* 6064 */ { MAD_F(0x06bfd261) /* 0.421831494 */, 18 },
- /* 6065 */ { MAD_F(0x06c033a4) /* 0.421924248 */, 18 },
- /* 6066 */ { MAD_F(0x06c094e7) /* 0.422017007 */, 18 },
- /* 6067 */ { MAD_F(0x06c0f62c) /* 0.422109770 */, 18 },
- /* 6068 */ { MAD_F(0x06c15773) /* 0.422202539 */, 18 },
- /* 6069 */ { MAD_F(0x06c1b8bb) /* 0.422295313 */, 18 },
- /* 6070 */ { MAD_F(0x06c21a04) /* 0.422388092 */, 18 },
- /* 6071 */ { MAD_F(0x06c27b4e) /* 0.422480876 */, 18 },
- /* 6072 */ { MAD_F(0x06c2dc9a) /* 0.422573665 */, 18 },
- /* 6073 */ { MAD_F(0x06c33de8) /* 0.422666460 */, 18 },
- /* 6074 */ { MAD_F(0x06c39f36) /* 0.422759259 */, 18 },
- /* 6075 */ { MAD_F(0x06c40086) /* 0.422852064 */, 18 },
- /* 6076 */ { MAD_F(0x06c461d8) /* 0.422944873 */, 18 },
- /* 6077 */ { MAD_F(0x06c4c32a) /* 0.423037688 */, 18 },
- /* 6078 */ { MAD_F(0x06c5247f) /* 0.423130508 */, 18 },
- /* 6079 */ { MAD_F(0x06c585d4) /* 0.423223333 */, 18 },
-
- /* 6080 */ { MAD_F(0x06c5e72b) /* 0.423316162 */, 18 },
- /* 6081 */ { MAD_F(0x06c64883) /* 0.423408997 */, 18 },
- /* 6082 */ { MAD_F(0x06c6a9dd) /* 0.423501838 */, 18 },
- /* 6083 */ { MAD_F(0x06c70b38) /* 0.423594683 */, 18 },
- /* 6084 */ { MAD_F(0x06c76c94) /* 0.423687533 */, 18 },
- /* 6085 */ { MAD_F(0x06c7cdf2) /* 0.423780389 */, 18 },
- /* 6086 */ { MAD_F(0x06c82f51) /* 0.423873249 */, 18 },
- /* 6087 */ { MAD_F(0x06c890b1) /* 0.423966115 */, 18 },
- /* 6088 */ { MAD_F(0x06c8f213) /* 0.424058985 */, 18 },
- /* 6089 */ { MAD_F(0x06c95376) /* 0.424151861 */, 18 },
- /* 6090 */ { MAD_F(0x06c9b4da) /* 0.424244742 */, 18 },
- /* 6091 */ { MAD_F(0x06ca1640) /* 0.424337628 */, 18 },
- /* 6092 */ { MAD_F(0x06ca77a8) /* 0.424430519 */, 18 },
- /* 6093 */ { MAD_F(0x06cad910) /* 0.424523415 */, 18 },
- /* 6094 */ { MAD_F(0x06cb3a7a) /* 0.424616316 */, 18 },
- /* 6095 */ { MAD_F(0x06cb9be5) /* 0.424709222 */, 18 },
-
- /* 6096 */ { MAD_F(0x06cbfd52) /* 0.424802133 */, 18 },
- /* 6097 */ { MAD_F(0x06cc5ec0) /* 0.424895050 */, 18 },
- /* 6098 */ { MAD_F(0x06ccc030) /* 0.424987971 */, 18 },
- /* 6099 */ { MAD_F(0x06cd21a0) /* 0.425080898 */, 18 },
- /* 6100 */ { MAD_F(0x06cd8313) /* 0.425173829 */, 18 },
- /* 6101 */ { MAD_F(0x06cde486) /* 0.425266766 */, 18 },
- /* 6102 */ { MAD_F(0x06ce45fb) /* 0.425359708 */, 18 },
- /* 6103 */ { MAD_F(0x06cea771) /* 0.425452655 */, 18 },
- /* 6104 */ { MAD_F(0x06cf08e9) /* 0.425545607 */, 18 },
- /* 6105 */ { MAD_F(0x06cf6a62) /* 0.425638564 */, 18 },
- /* 6106 */ { MAD_F(0x06cfcbdc) /* 0.425731526 */, 18 },
- /* 6107 */ { MAD_F(0x06d02d58) /* 0.425824493 */, 18 },
- /* 6108 */ { MAD_F(0x06d08ed5) /* 0.425917465 */, 18 },
- /* 6109 */ { MAD_F(0x06d0f053) /* 0.426010443 */, 18 },
- /* 6110 */ { MAD_F(0x06d151d3) /* 0.426103425 */, 18 },
- /* 6111 */ { MAD_F(0x06d1b354) /* 0.426196412 */, 18 },
-
- /* 6112 */ { MAD_F(0x06d214d7) /* 0.426289405 */, 18 },
- /* 6113 */ { MAD_F(0x06d2765a) /* 0.426382403 */, 18 },
- /* 6114 */ { MAD_F(0x06d2d7e0) /* 0.426475405 */, 18 },
- /* 6115 */ { MAD_F(0x06d33966) /* 0.426568413 */, 18 },
- /* 6116 */ { MAD_F(0x06d39aee) /* 0.426661426 */, 18 },
- /* 6117 */ { MAD_F(0x06d3fc77) /* 0.426754444 */, 18 },
- /* 6118 */ { MAD_F(0x06d45e02) /* 0.426847467 */, 18 },
- /* 6119 */ { MAD_F(0x06d4bf8e) /* 0.426940495 */, 18 },
- /* 6120 */ { MAD_F(0x06d5211c) /* 0.427033528 */, 18 },
- /* 6121 */ { MAD_F(0x06d582aa) /* 0.427126566 */, 18 },
- /* 6122 */ { MAD_F(0x06d5e43a) /* 0.427219609 */, 18 },
- /* 6123 */ { MAD_F(0x06d645cc) /* 0.427312657 */, 18 },
- /* 6124 */ { MAD_F(0x06d6a75f) /* 0.427405711 */, 18 },
- /* 6125 */ { MAD_F(0x06d708f3) /* 0.427498769 */, 18 },
- /* 6126 */ { MAD_F(0x06d76a88) /* 0.427591833 */, 18 },
- /* 6127 */ { MAD_F(0x06d7cc1f) /* 0.427684901 */, 18 },
-
- /* 6128 */ { MAD_F(0x06d82db8) /* 0.427777975 */, 18 },
- /* 6129 */ { MAD_F(0x06d88f51) /* 0.427871054 */, 18 },
- /* 6130 */ { MAD_F(0x06d8f0ec) /* 0.427964137 */, 18 },
- /* 6131 */ { MAD_F(0x06d95288) /* 0.428057226 */, 18 },
- /* 6132 */ { MAD_F(0x06d9b426) /* 0.428150320 */, 18 },
- /* 6133 */ { MAD_F(0x06da15c5) /* 0.428243419 */, 18 },
- /* 6134 */ { MAD_F(0x06da7766) /* 0.428336523 */, 18 },
- /* 6135 */ { MAD_F(0x06dad907) /* 0.428429632 */, 18 },
- /* 6136 */ { MAD_F(0x06db3aaa) /* 0.428522746 */, 18 },
- /* 6137 */ { MAD_F(0x06db9c4f) /* 0.428615865 */, 18 },
- /* 6138 */ { MAD_F(0x06dbfdf5) /* 0.428708989 */, 18 },
- /* 6139 */ { MAD_F(0x06dc5f9c) /* 0.428802119 */, 18 },
- /* 6140 */ { MAD_F(0x06dcc145) /* 0.428895253 */, 18 },
- /* 6141 */ { MAD_F(0x06dd22ee) /* 0.428988392 */, 18 },
- /* 6142 */ { MAD_F(0x06dd849a) /* 0.429081537 */, 18 },
- /* 6143 */ { MAD_F(0x06dde646) /* 0.429174686 */, 18 },
-
- /* 6144 */ { MAD_F(0x06de47f4) /* 0.429267841 */, 18 },
- /* 6145 */ { MAD_F(0x06dea9a4) /* 0.429361001 */, 18 },
- /* 6146 */ { MAD_F(0x06df0b54) /* 0.429454165 */, 18 },
- /* 6147 */ { MAD_F(0x06df6d06) /* 0.429547335 */, 18 },
- /* 6148 */ { MAD_F(0x06dfceba) /* 0.429640510 */, 18 },
- /* 6149 */ { MAD_F(0x06e0306f) /* 0.429733690 */, 18 },
- /* 6150 */ { MAD_F(0x06e09225) /* 0.429826874 */, 18 },
- /* 6151 */ { MAD_F(0x06e0f3dc) /* 0.429920064 */, 18 },
- /* 6152 */ { MAD_F(0x06e15595) /* 0.430013259 */, 18 },
- /* 6153 */ { MAD_F(0x06e1b74f) /* 0.430106459 */, 18 },
- /* 6154 */ { MAD_F(0x06e2190b) /* 0.430199664 */, 18 },
- /* 6155 */ { MAD_F(0x06e27ac8) /* 0.430292875 */, 18 },
- /* 6156 */ { MAD_F(0x06e2dc86) /* 0.430386090 */, 18 },
- /* 6157 */ { MAD_F(0x06e33e46) /* 0.430479310 */, 18 },
- /* 6158 */ { MAD_F(0x06e3a007) /* 0.430572535 */, 18 },
- /* 6159 */ { MAD_F(0x06e401c9) /* 0.430665765 */, 18 },
-
- /* 6160 */ { MAD_F(0x06e4638d) /* 0.430759001 */, 18 },
- /* 6161 */ { MAD_F(0x06e4c552) /* 0.430852241 */, 18 },
- /* 6162 */ { MAD_F(0x06e52718) /* 0.430945487 */, 18 },
- /* 6163 */ { MAD_F(0x06e588e0) /* 0.431038737 */, 18 },
- /* 6164 */ { MAD_F(0x06e5eaa9) /* 0.431131993 */, 18 },
- /* 6165 */ { MAD_F(0x06e64c73) /* 0.431225253 */, 18 },
- /* 6166 */ { MAD_F(0x06e6ae3f) /* 0.431318519 */, 18 },
- /* 6167 */ { MAD_F(0x06e7100c) /* 0.431411790 */, 18 },
- /* 6168 */ { MAD_F(0x06e771db) /* 0.431505065 */, 18 },
- /* 6169 */ { MAD_F(0x06e7d3ab) /* 0.431598346 */, 18 },
- /* 6170 */ { MAD_F(0x06e8357c) /* 0.431691632 */, 18 },
- /* 6171 */ { MAD_F(0x06e8974e) /* 0.431784923 */, 18 },
- /* 6172 */ { MAD_F(0x06e8f922) /* 0.431878218 */, 18 },
- /* 6173 */ { MAD_F(0x06e95af8) /* 0.431971519 */, 18 },
- /* 6174 */ { MAD_F(0x06e9bcce) /* 0.432064825 */, 18 },
- /* 6175 */ { MAD_F(0x06ea1ea6) /* 0.432158136 */, 18 },
-
- /* 6176 */ { MAD_F(0x06ea807f) /* 0.432251452 */, 18 },
- /* 6177 */ { MAD_F(0x06eae25a) /* 0.432344773 */, 18 },
- /* 6178 */ { MAD_F(0x06eb4436) /* 0.432438099 */, 18 },
- /* 6179 */ { MAD_F(0x06eba614) /* 0.432531431 */, 18 },
- /* 6180 */ { MAD_F(0x06ec07f2) /* 0.432624767 */, 18 },
- /* 6181 */ { MAD_F(0x06ec69d2) /* 0.432718108 */, 18 },
- /* 6182 */ { MAD_F(0x06eccbb4) /* 0.432811454 */, 18 },
- /* 6183 */ { MAD_F(0x06ed2d97) /* 0.432904805 */, 18 },
- /* 6184 */ { MAD_F(0x06ed8f7b) /* 0.432998162 */, 18 },
- /* 6185 */ { MAD_F(0x06edf160) /* 0.433091523 */, 18 },
- /* 6186 */ { MAD_F(0x06ee5347) /* 0.433184889 */, 18 },
- /* 6187 */ { MAD_F(0x06eeb52f) /* 0.433278261 */, 18 },
- /* 6188 */ { MAD_F(0x06ef1719) /* 0.433371637 */, 18 },
- /* 6189 */ { MAD_F(0x06ef7904) /* 0.433465019 */, 18 },
- /* 6190 */ { MAD_F(0x06efdaf0) /* 0.433558405 */, 18 },
- /* 6191 */ { MAD_F(0x06f03cde) /* 0.433651797 */, 18 },
-
- /* 6192 */ { MAD_F(0x06f09ecc) /* 0.433745193 */, 18 },
- /* 6193 */ { MAD_F(0x06f100bd) /* 0.433838595 */, 18 },
- /* 6194 */ { MAD_F(0x06f162ae) /* 0.433932001 */, 18 },
- /* 6195 */ { MAD_F(0x06f1c4a1) /* 0.434025413 */, 18 },
- /* 6196 */ { MAD_F(0x06f22696) /* 0.434118830 */, 18 },
- /* 6197 */ { MAD_F(0x06f2888b) /* 0.434212251 */, 18 },
- /* 6198 */ { MAD_F(0x06f2ea82) /* 0.434305678 */, 18 },
- /* 6199 */ { MAD_F(0x06f34c7b) /* 0.434399110 */, 18 },
- /* 6200 */ { MAD_F(0x06f3ae75) /* 0.434492546 */, 18 },
- /* 6201 */ { MAD_F(0x06f41070) /* 0.434585988 */, 18 },
- /* 6202 */ { MAD_F(0x06f4726c) /* 0.434679435 */, 18 },
- /* 6203 */ { MAD_F(0x06f4d46a) /* 0.434772887 */, 18 },
- /* 6204 */ { MAD_F(0x06f53669) /* 0.434866344 */, 18 },
- /* 6205 */ { MAD_F(0x06f59869) /* 0.434959806 */, 18 },
- /* 6206 */ { MAD_F(0x06f5fa6b) /* 0.435053272 */, 18 },
- /* 6207 */ { MAD_F(0x06f65c6e) /* 0.435146744 */, 18 },
-
- /* 6208 */ { MAD_F(0x06f6be73) /* 0.435240221 */, 18 },
- /* 6209 */ { MAD_F(0x06f72079) /* 0.435333703 */, 18 },
- /* 6210 */ { MAD_F(0x06f78280) /* 0.435427190 */, 18 },
- /* 6211 */ { MAD_F(0x06f7e489) /* 0.435520682 */, 18 },
- /* 6212 */ { MAD_F(0x06f84693) /* 0.435614179 */, 18 },
- /* 6213 */ { MAD_F(0x06f8a89e) /* 0.435707681 */, 18 },
- /* 6214 */ { MAD_F(0x06f90aaa) /* 0.435801188 */, 18 },
- /* 6215 */ { MAD_F(0x06f96cb8) /* 0.435894700 */, 18 },
- /* 6216 */ { MAD_F(0x06f9cec8) /* 0.435988217 */, 18 },
- /* 6217 */ { MAD_F(0x06fa30d8) /* 0.436081739 */, 18 },
- /* 6218 */ { MAD_F(0x06fa92ea) /* 0.436175266 */, 18 },
- /* 6219 */ { MAD_F(0x06faf4fe) /* 0.436268799 */, 18 },
- /* 6220 */ { MAD_F(0x06fb5712) /* 0.436362336 */, 18 },
- /* 6221 */ { MAD_F(0x06fbb928) /* 0.436455878 */, 18 },
- /* 6222 */ { MAD_F(0x06fc1b40) /* 0.436549425 */, 18 },
- /* 6223 */ { MAD_F(0x06fc7d58) /* 0.436642977 */, 18 },
-
- /* 6224 */ { MAD_F(0x06fcdf72) /* 0.436736534 */, 18 },
- /* 6225 */ { MAD_F(0x06fd418e) /* 0.436830096 */, 18 },
- /* 6226 */ { MAD_F(0x06fda3ab) /* 0.436923664 */, 18 },
- /* 6227 */ { MAD_F(0x06fe05c9) /* 0.437017236 */, 18 },
- /* 6228 */ { MAD_F(0x06fe67e8) /* 0.437110813 */, 18 },
- /* 6229 */ { MAD_F(0x06feca09) /* 0.437204395 */, 18 },
- /* 6230 */ { MAD_F(0x06ff2c2b) /* 0.437297982 */, 18 },
- /* 6231 */ { MAD_F(0x06ff8e4f) /* 0.437391575 */, 18 },
- /* 6232 */ { MAD_F(0x06fff073) /* 0.437485172 */, 18 },
- /* 6233 */ { MAD_F(0x0700529a) /* 0.437578774 */, 18 },
- /* 6234 */ { MAD_F(0x0700b4c1) /* 0.437672381 */, 18 },
- /* 6235 */ { MAD_F(0x070116ea) /* 0.437765994 */, 18 },
- /* 6236 */ { MAD_F(0x07017914) /* 0.437859611 */, 18 },
- /* 6237 */ { MAD_F(0x0701db40) /* 0.437953233 */, 18 },
- /* 6238 */ { MAD_F(0x07023d6c) /* 0.438046860 */, 18 },
- /* 6239 */ { MAD_F(0x07029f9b) /* 0.438140493 */, 18 },
-
- /* 6240 */ { MAD_F(0x070301ca) /* 0.438234130 */, 18 },
- /* 6241 */ { MAD_F(0x070363fb) /* 0.438327772 */, 18 },
- /* 6242 */ { MAD_F(0x0703c62d) /* 0.438421419 */, 18 },
- /* 6243 */ { MAD_F(0x07042861) /* 0.438515072 */, 18 },
- /* 6244 */ { MAD_F(0x07048a96) /* 0.438608729 */, 18 },
- /* 6245 */ { MAD_F(0x0704eccc) /* 0.438702391 */, 18 },
- /* 6246 */ { MAD_F(0x07054f04) /* 0.438796059 */, 18 },
- /* 6247 */ { MAD_F(0x0705b13d) /* 0.438889731 */, 18 },
- /* 6248 */ { MAD_F(0x07061377) /* 0.438983408 */, 18 },
- /* 6249 */ { MAD_F(0x070675b3) /* 0.439077090 */, 18 },
- /* 6250 */ { MAD_F(0x0706d7f0) /* 0.439170778 */, 18 },
- /* 6251 */ { MAD_F(0x07073a2e) /* 0.439264470 */, 18 },
- /* 6252 */ { MAD_F(0x07079c6e) /* 0.439358167 */, 18 },
- /* 6253 */ { MAD_F(0x0707feaf) /* 0.439451869 */, 18 },
- /* 6254 */ { MAD_F(0x070860f1) /* 0.439545577 */, 18 },
- /* 6255 */ { MAD_F(0x0708c335) /* 0.439639289 */, 18 },
-
- /* 6256 */ { MAD_F(0x0709257a) /* 0.439733006 */, 18 },
- /* 6257 */ { MAD_F(0x070987c0) /* 0.439826728 */, 18 },
- /* 6258 */ { MAD_F(0x0709ea08) /* 0.439920456 */, 18 },
- /* 6259 */ { MAD_F(0x070a4c51) /* 0.440014188 */, 18 },
- /* 6260 */ { MAD_F(0x070aae9b) /* 0.440107925 */, 18 },
- /* 6261 */ { MAD_F(0x070b10e7) /* 0.440201667 */, 18 },
- /* 6262 */ { MAD_F(0x070b7334) /* 0.440295414 */, 18 },
- /* 6263 */ { MAD_F(0x070bd583) /* 0.440389167 */, 18 },
- /* 6264 */ { MAD_F(0x070c37d2) /* 0.440482924 */, 18 },
- /* 6265 */ { MAD_F(0x070c9a23) /* 0.440576686 */, 18 },
- /* 6266 */ { MAD_F(0x070cfc76) /* 0.440670453 */, 18 },
- /* 6267 */ { MAD_F(0x070d5eca) /* 0.440764225 */, 18 },
- /* 6268 */ { MAD_F(0x070dc11f) /* 0.440858002 */, 18 },
- /* 6269 */ { MAD_F(0x070e2375) /* 0.440951784 */, 18 },
- /* 6270 */ { MAD_F(0x070e85cd) /* 0.441045572 */, 18 },
- /* 6271 */ { MAD_F(0x070ee826) /* 0.441139364 */, 18 },
-
- /* 6272 */ { MAD_F(0x070f4a80) /* 0.441233161 */, 18 },
- /* 6273 */ { MAD_F(0x070facdc) /* 0.441326963 */, 18 },
- /* 6274 */ { MAD_F(0x07100f39) /* 0.441420770 */, 18 },
- /* 6275 */ { MAD_F(0x07107198) /* 0.441514582 */, 18 },
- /* 6276 */ { MAD_F(0x0710d3f8) /* 0.441608399 */, 18 },
- /* 6277 */ { MAD_F(0x07113659) /* 0.441702221 */, 18 },
- /* 6278 */ { MAD_F(0x071198bb) /* 0.441796048 */, 18 },
- /* 6279 */ { MAD_F(0x0711fb1f) /* 0.441889880 */, 18 },
- /* 6280 */ { MAD_F(0x07125d84) /* 0.441983717 */, 18 },
- /* 6281 */ { MAD_F(0x0712bfeb) /* 0.442077559 */, 18 },
- /* 6282 */ { MAD_F(0x07132253) /* 0.442171406 */, 18 },
- /* 6283 */ { MAD_F(0x071384bc) /* 0.442265257 */, 18 },
- /* 6284 */ { MAD_F(0x0713e726) /* 0.442359114 */, 18 },
- /* 6285 */ { MAD_F(0x07144992) /* 0.442452976 */, 18 },
- /* 6286 */ { MAD_F(0x0714abff) /* 0.442546843 */, 18 },
- /* 6287 */ { MAD_F(0x07150e6e) /* 0.442640715 */, 18 },
-
- /* 6288 */ { MAD_F(0x071570de) /* 0.442734592 */, 18 },
- /* 6289 */ { MAD_F(0x0715d34f) /* 0.442828473 */, 18 },
- /* 6290 */ { MAD_F(0x071635c1) /* 0.442922360 */, 18 },
- /* 6291 */ { MAD_F(0x07169835) /* 0.443016252 */, 18 },
- /* 6292 */ { MAD_F(0x0716faaa) /* 0.443110148 */, 18 },
- /* 6293 */ { MAD_F(0x07175d21) /* 0.443204050 */, 18 },
- /* 6294 */ { MAD_F(0x0717bf99) /* 0.443297957 */, 18 },
- /* 6295 */ { MAD_F(0x07182212) /* 0.443391868 */, 18 },
- /* 6296 */ { MAD_F(0x0718848d) /* 0.443485785 */, 18 },
- /* 6297 */ { MAD_F(0x0718e709) /* 0.443579706 */, 18 },
- /* 6298 */ { MAD_F(0x07194986) /* 0.443673633 */, 18 },
- /* 6299 */ { MAD_F(0x0719ac04) /* 0.443767564 */, 18 },
- /* 6300 */ { MAD_F(0x071a0e84) /* 0.443861501 */, 18 },
- /* 6301 */ { MAD_F(0x071a7105) /* 0.443955442 */, 18 },
- /* 6302 */ { MAD_F(0x071ad388) /* 0.444049389 */, 18 },
- /* 6303 */ { MAD_F(0x071b360c) /* 0.444143340 */, 18 },
-
- /* 6304 */ { MAD_F(0x071b9891) /* 0.444237296 */, 18 },
- /* 6305 */ { MAD_F(0x071bfb18) /* 0.444331258 */, 18 },
- /* 6306 */ { MAD_F(0x071c5d9f) /* 0.444425224 */, 18 },
- /* 6307 */ { MAD_F(0x071cc029) /* 0.444519195 */, 18 },
- /* 6308 */ { MAD_F(0x071d22b3) /* 0.444613171 */, 18 },
- /* 6309 */ { MAD_F(0x071d853f) /* 0.444707153 */, 18 },
- /* 6310 */ { MAD_F(0x071de7cc) /* 0.444801139 */, 18 },
- /* 6311 */ { MAD_F(0x071e4a5b) /* 0.444895130 */, 18 },
- /* 6312 */ { MAD_F(0x071eaceb) /* 0.444989126 */, 18 },
- /* 6313 */ { MAD_F(0x071f0f7c) /* 0.445083127 */, 18 },
- /* 6314 */ { MAD_F(0x071f720e) /* 0.445177133 */, 18 },
- /* 6315 */ { MAD_F(0x071fd4a2) /* 0.445271144 */, 18 },
- /* 6316 */ { MAD_F(0x07203737) /* 0.445365160 */, 18 },
- /* 6317 */ { MAD_F(0x072099ce) /* 0.445459181 */, 18 },
- /* 6318 */ { MAD_F(0x0720fc66) /* 0.445553206 */, 18 },
- /* 6319 */ { MAD_F(0x07215eff) /* 0.445647237 */, 18 },
-
- /* 6320 */ { MAD_F(0x0721c19a) /* 0.445741273 */, 18 },
- /* 6321 */ { MAD_F(0x07222436) /* 0.445835314 */, 18 },
- /* 6322 */ { MAD_F(0x072286d3) /* 0.445929359 */, 18 },
- /* 6323 */ { MAD_F(0x0722e971) /* 0.446023410 */, 18 },
- /* 6324 */ { MAD_F(0x07234c11) /* 0.446117466 */, 18 },
- /* 6325 */ { MAD_F(0x0723aeb2) /* 0.446211526 */, 18 },
- /* 6326 */ { MAD_F(0x07241155) /* 0.446305592 */, 18 },
- /* 6327 */ { MAD_F(0x072473f9) /* 0.446399662 */, 18 },
- /* 6328 */ { MAD_F(0x0724d69e) /* 0.446493738 */, 18 },
- /* 6329 */ { MAD_F(0x07253944) /* 0.446587818 */, 18 },
- /* 6330 */ { MAD_F(0x07259bec) /* 0.446681903 */, 18 },
- /* 6331 */ { MAD_F(0x0725fe95) /* 0.446775994 */, 18 },
- /* 6332 */ { MAD_F(0x07266140) /* 0.446870089 */, 18 },
- /* 6333 */ { MAD_F(0x0726c3ec) /* 0.446964189 */, 18 },
- /* 6334 */ { MAD_F(0x07272699) /* 0.447058294 */, 18 },
- /* 6335 */ { MAD_F(0x07278947) /* 0.447152404 */, 18 },
-
- /* 6336 */ { MAD_F(0x0727ebf7) /* 0.447246519 */, 18 },
- /* 6337 */ { MAD_F(0x07284ea8) /* 0.447340639 */, 18 },
- /* 6338 */ { MAD_F(0x0728b15b) /* 0.447434764 */, 18 },
- /* 6339 */ { MAD_F(0x0729140f) /* 0.447528894 */, 18 },
- /* 6340 */ { MAD_F(0x072976c4) /* 0.447623029 */, 18 },
- /* 6341 */ { MAD_F(0x0729d97a) /* 0.447717169 */, 18 },
- /* 6342 */ { MAD_F(0x072a3c32) /* 0.447811314 */, 18 },
- /* 6343 */ { MAD_F(0x072a9eeb) /* 0.447905463 */, 18 },
- /* 6344 */ { MAD_F(0x072b01a6) /* 0.447999618 */, 18 },
- /* 6345 */ { MAD_F(0x072b6461) /* 0.448093778 */, 18 },
- /* 6346 */ { MAD_F(0x072bc71e) /* 0.448187942 */, 18 },
- /* 6347 */ { MAD_F(0x072c29dd) /* 0.448282112 */, 18 },
- /* 6348 */ { MAD_F(0x072c8c9d) /* 0.448376286 */, 18 },
- /* 6349 */ { MAD_F(0x072cef5e) /* 0.448470466 */, 18 },
- /* 6350 */ { MAD_F(0x072d5220) /* 0.448564650 */, 18 },
- /* 6351 */ { MAD_F(0x072db4e4) /* 0.448658839 */, 18 },
-
- /* 6352 */ { MAD_F(0x072e17a9) /* 0.448753033 */, 18 },
- /* 6353 */ { MAD_F(0x072e7a6f) /* 0.448847233 */, 18 },
- /* 6354 */ { MAD_F(0x072edd37) /* 0.448941437 */, 18 },
- /* 6355 */ { MAD_F(0x072f4000) /* 0.449035646 */, 18 },
- /* 6356 */ { MAD_F(0x072fa2ca) /* 0.449129860 */, 18 },
- /* 6357 */ { MAD_F(0x07300596) /* 0.449224079 */, 18 },
- /* 6358 */ { MAD_F(0x07306863) /* 0.449318303 */, 18 },
- /* 6359 */ { MAD_F(0x0730cb32) /* 0.449412531 */, 18 },
- /* 6360 */ { MAD_F(0x07312e01) /* 0.449506765 */, 18 },
- /* 6361 */ { MAD_F(0x073190d2) /* 0.449601004 */, 18 },
- /* 6362 */ { MAD_F(0x0731f3a5) /* 0.449695247 */, 18 },
- /* 6363 */ { MAD_F(0x07325678) /* 0.449789496 */, 18 },
- /* 6364 */ { MAD_F(0x0732b94d) /* 0.449883749 */, 18 },
- /* 6365 */ { MAD_F(0x07331c23) /* 0.449978008 */, 18 },
- /* 6366 */ { MAD_F(0x07337efb) /* 0.450072271 */, 18 },
- /* 6367 */ { MAD_F(0x0733e1d4) /* 0.450166540 */, 18 },
-
- /* 6368 */ { MAD_F(0x073444ae) /* 0.450260813 */, 18 },
- /* 6369 */ { MAD_F(0x0734a78a) /* 0.450355091 */, 18 },
- /* 6370 */ { MAD_F(0x07350a67) /* 0.450449374 */, 18 },
- /* 6371 */ { MAD_F(0x07356d45) /* 0.450543662 */, 18 },
- /* 6372 */ { MAD_F(0x0735d025) /* 0.450637955 */, 18 },
- /* 6373 */ { MAD_F(0x07363306) /* 0.450732253 */, 18 },
- /* 6374 */ { MAD_F(0x073695e8) /* 0.450826556 */, 18 },
- /* 6375 */ { MAD_F(0x0736f8cb) /* 0.450920864 */, 18 },
- /* 6376 */ { MAD_F(0x07375bb0) /* 0.451015176 */, 18 },
- /* 6377 */ { MAD_F(0x0737be96) /* 0.451109494 */, 18 },
- /* 6378 */ { MAD_F(0x0738217e) /* 0.451203817 */, 18 },
- /* 6379 */ { MAD_F(0x07388467) /* 0.451298144 */, 18 },
- /* 6380 */ { MAD_F(0x0738e751) /* 0.451392477 */, 18 },
- /* 6381 */ { MAD_F(0x07394a3d) /* 0.451486814 */, 18 },
- /* 6382 */ { MAD_F(0x0739ad29) /* 0.451581156 */, 18 },
- /* 6383 */ { MAD_F(0x073a1017) /* 0.451675503 */, 18 },
-
- /* 6384 */ { MAD_F(0x073a7307) /* 0.451769856 */, 18 },
- /* 6385 */ { MAD_F(0x073ad5f8) /* 0.451864213 */, 18 },
- /* 6386 */ { MAD_F(0x073b38ea) /* 0.451958575 */, 18 },
- /* 6387 */ { MAD_F(0x073b9bdd) /* 0.452052942 */, 18 },
- /* 6388 */ { MAD_F(0x073bfed2) /* 0.452147313 */, 18 },
- /* 6389 */ { MAD_F(0x073c61c8) /* 0.452241690 */, 18 },
- /* 6390 */ { MAD_F(0x073cc4bf) /* 0.452336072 */, 18 },
- /* 6391 */ { MAD_F(0x073d27b8) /* 0.452430458 */, 18 },
- /* 6392 */ { MAD_F(0x073d8ab2) /* 0.452524850 */, 18 },
- /* 6393 */ { MAD_F(0x073dedae) /* 0.452619246 */, 18 },
- /* 6394 */ { MAD_F(0x073e50aa) /* 0.452713648 */, 18 },
- /* 6395 */ { MAD_F(0x073eb3a8) /* 0.452808054 */, 18 },
- /* 6396 */ { MAD_F(0x073f16a8) /* 0.452902465 */, 18 },
- /* 6397 */ { MAD_F(0x073f79a8) /* 0.452996882 */, 18 },
- /* 6398 */ { MAD_F(0x073fdcaa) /* 0.453091303 */, 18 },
- /* 6399 */ { MAD_F(0x07403fad) /* 0.453185729 */, 18 },
-
- /* 6400 */ { MAD_F(0x0740a2b2) /* 0.453280160 */, 18 },
- /* 6401 */ { MAD_F(0x074105b8) /* 0.453374595 */, 18 },
- /* 6402 */ { MAD_F(0x074168bf) /* 0.453469036 */, 18 },
- /* 6403 */ { MAD_F(0x0741cbc8) /* 0.453563482 */, 18 },
- /* 6404 */ { MAD_F(0x07422ed2) /* 0.453657932 */, 18 },
- /* 6405 */ { MAD_F(0x074291dd) /* 0.453752388 */, 18 },
- /* 6406 */ { MAD_F(0x0742f4e9) /* 0.453846848 */, 18 },
- /* 6407 */ { MAD_F(0x074357f7) /* 0.453941314 */, 18 },
- /* 6408 */ { MAD_F(0x0743bb06) /* 0.454035784 */, 18 },
- /* 6409 */ { MAD_F(0x07441e17) /* 0.454130259 */, 18 },
- /* 6410 */ { MAD_F(0x07448129) /* 0.454224739 */, 18 },
- /* 6411 */ { MAD_F(0x0744e43c) /* 0.454319224 */, 18 },
- /* 6412 */ { MAD_F(0x07454750) /* 0.454413714 */, 18 },
- /* 6413 */ { MAD_F(0x0745aa66) /* 0.454508209 */, 18 },
- /* 6414 */ { MAD_F(0x07460d7d) /* 0.454602708 */, 18 },
- /* 6415 */ { MAD_F(0x07467095) /* 0.454697213 */, 18 },
-
- /* 6416 */ { MAD_F(0x0746d3af) /* 0.454791723 */, 18 },
- /* 6417 */ { MAD_F(0x074736ca) /* 0.454886237 */, 18 },
- /* 6418 */ { MAD_F(0x074799e7) /* 0.454980756 */, 18 },
- /* 6419 */ { MAD_F(0x0747fd04) /* 0.455075281 */, 18 },
- /* 6420 */ { MAD_F(0x07486023) /* 0.455169810 */, 18 },
- /* 6421 */ { MAD_F(0x0748c344) /* 0.455264344 */, 18 },
- /* 6422 */ { MAD_F(0x07492665) /* 0.455358883 */, 18 },
- /* 6423 */ { MAD_F(0x07498988) /* 0.455453427 */, 18 },
- /* 6424 */ { MAD_F(0x0749ecac) /* 0.455547976 */, 18 },
- /* 6425 */ { MAD_F(0x074a4fd2) /* 0.455642529 */, 18 },
- /* 6426 */ { MAD_F(0x074ab2f9) /* 0.455737088 */, 18 },
- /* 6427 */ { MAD_F(0x074b1621) /* 0.455831652 */, 18 },
- /* 6428 */ { MAD_F(0x074b794b) /* 0.455926220 */, 18 },
- /* 6429 */ { MAD_F(0x074bdc75) /* 0.456020793 */, 18 },
- /* 6430 */ { MAD_F(0x074c3fa1) /* 0.456115372 */, 18 },
- /* 6431 */ { MAD_F(0x074ca2cf) /* 0.456209955 */, 18 },
-
- /* 6432 */ { MAD_F(0x074d05fe) /* 0.456304543 */, 18 },
- /* 6433 */ { MAD_F(0x074d692e) /* 0.456399136 */, 18 },
- /* 6434 */ { MAD_F(0x074dcc5f) /* 0.456493733 */, 18 },
- /* 6435 */ { MAD_F(0x074e2f92) /* 0.456588336 */, 18 },
- /* 6436 */ { MAD_F(0x074e92c6) /* 0.456682944 */, 18 },
- /* 6437 */ { MAD_F(0x074ef5fb) /* 0.456777556 */, 18 },
- /* 6438 */ { MAD_F(0x074f5932) /* 0.456872174 */, 18 },
- /* 6439 */ { MAD_F(0x074fbc6a) /* 0.456966796 */, 18 },
- /* 6440 */ { MAD_F(0x07501fa3) /* 0.457061423 */, 18 },
- /* 6441 */ { MAD_F(0x075082de) /* 0.457156056 */, 18 },
- /* 6442 */ { MAD_F(0x0750e61a) /* 0.457250693 */, 18 },
- /* 6443 */ { MAD_F(0x07514957) /* 0.457345335 */, 18 },
- /* 6444 */ { MAD_F(0x0751ac96) /* 0.457439981 */, 18 },
- /* 6445 */ { MAD_F(0x07520fd6) /* 0.457534633 */, 18 },
- /* 6446 */ { MAD_F(0x07527317) /* 0.457629290 */, 18 },
- /* 6447 */ { MAD_F(0x0752d659) /* 0.457723951 */, 18 },
-
- /* 6448 */ { MAD_F(0x0753399d) /* 0.457818618 */, 18 },
- /* 6449 */ { MAD_F(0x07539ce2) /* 0.457913289 */, 18 },
- /* 6450 */ { MAD_F(0x07540029) /* 0.458007965 */, 18 },
- /* 6451 */ { MAD_F(0x07546371) /* 0.458102646 */, 18 },
- /* 6452 */ { MAD_F(0x0754c6ba) /* 0.458197332 */, 18 },
- /* 6453 */ { MAD_F(0x07552a04) /* 0.458292023 */, 18 },
- /* 6454 */ { MAD_F(0x07558d50) /* 0.458386719 */, 18 },
- /* 6455 */ { MAD_F(0x0755f09d) /* 0.458481420 */, 18 },
- /* 6456 */ { MAD_F(0x075653eb) /* 0.458576125 */, 18 },
- /* 6457 */ { MAD_F(0x0756b73b) /* 0.458670836 */, 18 },
- /* 6458 */ { MAD_F(0x07571a8c) /* 0.458765551 */, 18 },
- /* 6459 */ { MAD_F(0x07577dde) /* 0.458860271 */, 18 },
- /* 6460 */ { MAD_F(0x0757e131) /* 0.458954996 */, 18 },
- /* 6461 */ { MAD_F(0x07584486) /* 0.459049726 */, 18 },
- /* 6462 */ { MAD_F(0x0758a7dd) /* 0.459144461 */, 18 },
- /* 6463 */ { MAD_F(0x07590b34) /* 0.459239201 */, 18 },
-
- /* 6464 */ { MAD_F(0x07596e8d) /* 0.459333946 */, 18 },
- /* 6465 */ { MAD_F(0x0759d1e7) /* 0.459428695 */, 18 },
- /* 6466 */ { MAD_F(0x075a3542) /* 0.459523450 */, 18 },
- /* 6467 */ { MAD_F(0x075a989f) /* 0.459618209 */, 18 },
- /* 6468 */ { MAD_F(0x075afbfd) /* 0.459712973 */, 18 },
- /* 6469 */ { MAD_F(0x075b5f5d) /* 0.459807742 */, 18 },
- /* 6470 */ { MAD_F(0x075bc2bd) /* 0.459902516 */, 18 },
- /* 6471 */ { MAD_F(0x075c261f) /* 0.459997295 */, 18 },
- /* 6472 */ { MAD_F(0x075c8983) /* 0.460092079 */, 18 },
- /* 6473 */ { MAD_F(0x075cece7) /* 0.460186867 */, 18 },
- /* 6474 */ { MAD_F(0x075d504d) /* 0.460281661 */, 18 },
- /* 6475 */ { MAD_F(0x075db3b5) /* 0.460376459 */, 18 },
- /* 6476 */ { MAD_F(0x075e171d) /* 0.460471262 */, 18 },
- /* 6477 */ { MAD_F(0x075e7a87) /* 0.460566071 */, 18 },
- /* 6478 */ { MAD_F(0x075eddf2) /* 0.460660884 */, 18 },
- /* 6479 */ { MAD_F(0x075f415f) /* 0.460755701 */, 18 },
-
- /* 6480 */ { MAD_F(0x075fa4cc) /* 0.460850524 */, 18 },
- /* 6481 */ { MAD_F(0x0760083b) /* 0.460945352 */, 18 },
- /* 6482 */ { MAD_F(0x07606bac) /* 0.461040184 */, 18 },
- /* 6483 */ { MAD_F(0x0760cf1e) /* 0.461135022 */, 18 },
- /* 6484 */ { MAD_F(0x07613291) /* 0.461229864 */, 18 },
- /* 6485 */ { MAD_F(0x07619605) /* 0.461324711 */, 18 },
- /* 6486 */ { MAD_F(0x0761f97b) /* 0.461419563 */, 18 },
- /* 6487 */ { MAD_F(0x07625cf2) /* 0.461514420 */, 18 },
- /* 6488 */ { MAD_F(0x0762c06a) /* 0.461609282 */, 18 },
- /* 6489 */ { MAD_F(0x076323e3) /* 0.461704149 */, 18 },
- /* 6490 */ { MAD_F(0x0763875e) /* 0.461799020 */, 18 },
- /* 6491 */ { MAD_F(0x0763eadb) /* 0.461893897 */, 18 },
- /* 6492 */ { MAD_F(0x07644e58) /* 0.461988778 */, 18 },
- /* 6493 */ { MAD_F(0x0764b1d7) /* 0.462083664 */, 18 },
- /* 6494 */ { MAD_F(0x07651557) /* 0.462178555 */, 18 },
- /* 6495 */ { MAD_F(0x076578d8) /* 0.462273451 */, 18 },
-
- /* 6496 */ { MAD_F(0x0765dc5b) /* 0.462368352 */, 18 },
- /* 6497 */ { MAD_F(0x07663fdf) /* 0.462463257 */, 18 },
- /* 6498 */ { MAD_F(0x0766a364) /* 0.462558168 */, 18 },
- /* 6499 */ { MAD_F(0x076706eb) /* 0.462653083 */, 18 },
- /* 6500 */ { MAD_F(0x07676a73) /* 0.462748003 */, 18 },
- /* 6501 */ { MAD_F(0x0767cdfc) /* 0.462842928 */, 18 },
- /* 6502 */ { MAD_F(0x07683187) /* 0.462937858 */, 18 },
- /* 6503 */ { MAD_F(0x07689513) /* 0.463032793 */, 18 },
- /* 6504 */ { MAD_F(0x0768f8a0) /* 0.463127733 */, 18 },
- /* 6505 */ { MAD_F(0x07695c2e) /* 0.463222678 */, 18 },
- /* 6506 */ { MAD_F(0x0769bfbe) /* 0.463317627 */, 18 },
- /* 6507 */ { MAD_F(0x076a234f) /* 0.463412581 */, 18 },
- /* 6508 */ { MAD_F(0x076a86e2) /* 0.463507540 */, 18 },
- /* 6509 */ { MAD_F(0x076aea75) /* 0.463602504 */, 18 },
- /* 6510 */ { MAD_F(0x076b4e0a) /* 0.463697473 */, 18 },
- /* 6511 */ { MAD_F(0x076bb1a1) /* 0.463792447 */, 18 },
-
- /* 6512 */ { MAD_F(0x076c1538) /* 0.463887426 */, 18 },
- /* 6513 */ { MAD_F(0x076c78d1) /* 0.463982409 */, 18 },
- /* 6514 */ { MAD_F(0x076cdc6c) /* 0.464077398 */, 18 },
- /* 6515 */ { MAD_F(0x076d4007) /* 0.464172391 */, 18 },
- /* 6516 */ { MAD_F(0x076da3a4) /* 0.464267389 */, 18 },
- /* 6517 */ { MAD_F(0x076e0742) /* 0.464362392 */, 18 },
- /* 6518 */ { MAD_F(0x076e6ae2) /* 0.464457399 */, 18 },
- /* 6519 */ { MAD_F(0x076ece82) /* 0.464552412 */, 18 },
- /* 6520 */ { MAD_F(0x076f3224) /* 0.464647430 */, 18 },
- /* 6521 */ { MAD_F(0x076f95c8) /* 0.464742452 */, 18 },
- /* 6522 */ { MAD_F(0x076ff96c) /* 0.464837479 */, 18 },
- /* 6523 */ { MAD_F(0x07705d12) /* 0.464932511 */, 18 },
- /* 6524 */ { MAD_F(0x0770c0ba) /* 0.465027548 */, 18 },
- /* 6525 */ { MAD_F(0x07712462) /* 0.465122590 */, 18 },
- /* 6526 */ { MAD_F(0x0771880c) /* 0.465217637 */, 18 },
- /* 6527 */ { MAD_F(0x0771ebb7) /* 0.465312688 */, 18 },
-
- /* 6528 */ { MAD_F(0x07724f64) /* 0.465407744 */, 18 },
- /* 6529 */ { MAD_F(0x0772b312) /* 0.465502806 */, 18 },
- /* 6530 */ { MAD_F(0x077316c1) /* 0.465597872 */, 18 },
- /* 6531 */ { MAD_F(0x07737a71) /* 0.465692943 */, 18 },
- /* 6532 */ { MAD_F(0x0773de23) /* 0.465788018 */, 18 },
- /* 6533 */ { MAD_F(0x077441d6) /* 0.465883099 */, 18 },
- /* 6534 */ { MAD_F(0x0774a58a) /* 0.465978184 */, 18 },
- /* 6535 */ { MAD_F(0x07750940) /* 0.466073275 */, 18 },
- /* 6536 */ { MAD_F(0x07756cf7) /* 0.466168370 */, 18 },
- /* 6537 */ { MAD_F(0x0775d0af) /* 0.466263470 */, 18 },
- /* 6538 */ { MAD_F(0x07763468) /* 0.466358575 */, 18 },
- /* 6539 */ { MAD_F(0x07769823) /* 0.466453684 */, 18 },
- /* 6540 */ { MAD_F(0x0776fbdf) /* 0.466548799 */, 18 },
- /* 6541 */ { MAD_F(0x07775f9d) /* 0.466643918 */, 18 },
- /* 6542 */ { MAD_F(0x0777c35c) /* 0.466739043 */, 18 },
- /* 6543 */ { MAD_F(0x0778271c) /* 0.466834172 */, 18 },
-
- /* 6544 */ { MAD_F(0x07788add) /* 0.466929306 */, 18 },
- /* 6545 */ { MAD_F(0x0778ee9f) /* 0.467024445 */, 18 },
- /* 6546 */ { MAD_F(0x07795263) /* 0.467119588 */, 18 },
- /* 6547 */ { MAD_F(0x0779b629) /* 0.467214737 */, 18 },
- /* 6548 */ { MAD_F(0x077a19ef) /* 0.467309890 */, 18 },
- /* 6549 */ { MAD_F(0x077a7db7) /* 0.467405048 */, 18 },
- /* 6550 */ { MAD_F(0x077ae180) /* 0.467500211 */, 18 },
- /* 6551 */ { MAD_F(0x077b454b) /* 0.467595379 */, 18 },
- /* 6552 */ { MAD_F(0x077ba916) /* 0.467690552 */, 18 },
- /* 6553 */ { MAD_F(0x077c0ce3) /* 0.467785729 */, 18 },
- /* 6554 */ { MAD_F(0x077c70b2) /* 0.467880912 */, 18 },
- /* 6555 */ { MAD_F(0x077cd481) /* 0.467976099 */, 18 },
- /* 6556 */ { MAD_F(0x077d3852) /* 0.468071291 */, 18 },
- /* 6557 */ { MAD_F(0x077d9c24) /* 0.468166488 */, 18 },
- /* 6558 */ { MAD_F(0x077dfff8) /* 0.468261690 */, 18 },
- /* 6559 */ { MAD_F(0x077e63cd) /* 0.468356896 */, 18 },
-
- /* 6560 */ { MAD_F(0x077ec7a3) /* 0.468452108 */, 18 },
- /* 6561 */ { MAD_F(0x077f2b7a) /* 0.468547324 */, 18 },
- /* 6562 */ { MAD_F(0x077f8f53) /* 0.468642545 */, 18 },
- /* 6563 */ { MAD_F(0x077ff32d) /* 0.468737771 */, 18 },
- /* 6564 */ { MAD_F(0x07805708) /* 0.468833002 */, 18 },
- /* 6565 */ { MAD_F(0x0780bae5) /* 0.468928237 */, 18 },
- /* 6566 */ { MAD_F(0x07811ec3) /* 0.469023478 */, 18 },
- /* 6567 */ { MAD_F(0x078182a2) /* 0.469118723 */, 18 },
- /* 6568 */ { MAD_F(0x0781e683) /* 0.469213973 */, 18 },
- /* 6569 */ { MAD_F(0x07824a64) /* 0.469309228 */, 18 },
- /* 6570 */ { MAD_F(0x0782ae47) /* 0.469404488 */, 18 },
- /* 6571 */ { MAD_F(0x0783122c) /* 0.469499752 */, 18 },
- /* 6572 */ { MAD_F(0x07837612) /* 0.469595022 */, 18 },
- /* 6573 */ { MAD_F(0x0783d9f9) /* 0.469690296 */, 18 },
- /* 6574 */ { MAD_F(0x07843de1) /* 0.469785575 */, 18 },
- /* 6575 */ { MAD_F(0x0784a1ca) /* 0.469880859 */, 18 },
-
- /* 6576 */ { MAD_F(0x078505b5) /* 0.469976148 */, 18 },
- /* 6577 */ { MAD_F(0x078569a2) /* 0.470071442 */, 18 },
- /* 6578 */ { MAD_F(0x0785cd8f) /* 0.470166740 */, 18 },
- /* 6579 */ { MAD_F(0x0786317e) /* 0.470262043 */, 18 },
- /* 6580 */ { MAD_F(0x0786956e) /* 0.470357351 */, 18 },
- /* 6581 */ { MAD_F(0x0786f95f) /* 0.470452664 */, 18 },
- /* 6582 */ { MAD_F(0x07875d52) /* 0.470547982 */, 18 },
- /* 6583 */ { MAD_F(0x0787c146) /* 0.470643305 */, 18 },
- /* 6584 */ { MAD_F(0x0788253b) /* 0.470738632 */, 18 },
- /* 6585 */ { MAD_F(0x07888932) /* 0.470833964 */, 18 },
- /* 6586 */ { MAD_F(0x0788ed2a) /* 0.470929301 */, 18 },
- /* 6587 */ { MAD_F(0x07895123) /* 0.471024643 */, 18 },
- /* 6588 */ { MAD_F(0x0789b51d) /* 0.471119990 */, 18 },
- /* 6589 */ { MAD_F(0x078a1919) /* 0.471215341 */, 18 },
- /* 6590 */ { MAD_F(0x078a7d16) /* 0.471310698 */, 18 },
- /* 6591 */ { MAD_F(0x078ae114) /* 0.471406059 */, 18 },
-
- /* 6592 */ { MAD_F(0x078b4514) /* 0.471501425 */, 18 },
- /* 6593 */ { MAD_F(0x078ba915) /* 0.471596796 */, 18 },
- /* 6594 */ { MAD_F(0x078c0d17) /* 0.471692171 */, 18 },
- /* 6595 */ { MAD_F(0x078c711a) /* 0.471787552 */, 18 },
- /* 6596 */ { MAD_F(0x078cd51f) /* 0.471882937 */, 18 },
- /* 6597 */ { MAD_F(0x078d3925) /* 0.471978327 */, 18 },
- /* 6598 */ { MAD_F(0x078d9d2d) /* 0.472073722 */, 18 },
- /* 6599 */ { MAD_F(0x078e0135) /* 0.472169122 */, 18 },
- /* 6600 */ { MAD_F(0x078e653f) /* 0.472264527 */, 18 },
- /* 6601 */ { MAD_F(0x078ec94b) /* 0.472359936 */, 18 },
- /* 6602 */ { MAD_F(0x078f2d57) /* 0.472455350 */, 18 },
- /* 6603 */ { MAD_F(0x078f9165) /* 0.472550769 */, 18 },
- /* 6604 */ { MAD_F(0x078ff574) /* 0.472646193 */, 18 },
- /* 6605 */ { MAD_F(0x07905985) /* 0.472741622 */, 18 },
- /* 6606 */ { MAD_F(0x0790bd96) /* 0.472837055 */, 18 },
- /* 6607 */ { MAD_F(0x079121a9) /* 0.472932493 */, 18 },
-
- /* 6608 */ { MAD_F(0x079185be) /* 0.473027937 */, 18 },
- /* 6609 */ { MAD_F(0x0791e9d3) /* 0.473123384 */, 18 },
- /* 6610 */ { MAD_F(0x07924dea) /* 0.473218837 */, 18 },
- /* 6611 */ { MAD_F(0x0792b202) /* 0.473314295 */, 18 },
- /* 6612 */ { MAD_F(0x0793161c) /* 0.473409757 */, 18 },
- /* 6613 */ { MAD_F(0x07937a37) /* 0.473505224 */, 18 },
- /* 6614 */ { MAD_F(0x0793de53) /* 0.473600696 */, 18 },
- /* 6615 */ { MAD_F(0x07944270) /* 0.473696173 */, 18 },
- /* 6616 */ { MAD_F(0x0794a68f) /* 0.473791655 */, 18 },
- /* 6617 */ { MAD_F(0x07950aaf) /* 0.473887141 */, 18 },
- /* 6618 */ { MAD_F(0x07956ed0) /* 0.473982632 */, 18 },
- /* 6619 */ { MAD_F(0x0795d2f2) /* 0.474078128 */, 18 },
- /* 6620 */ { MAD_F(0x07963716) /* 0.474173629 */, 18 },
- /* 6621 */ { MAD_F(0x07969b3b) /* 0.474269135 */, 18 },
- /* 6622 */ { MAD_F(0x0796ff62) /* 0.474364645 */, 18 },
- /* 6623 */ { MAD_F(0x07976389) /* 0.474460161 */, 18 },
-
- /* 6624 */ { MAD_F(0x0797c7b2) /* 0.474555681 */, 18 },
- /* 6625 */ { MAD_F(0x07982bdd) /* 0.474651205 */, 18 },
- /* 6626 */ { MAD_F(0x07989008) /* 0.474746735 */, 18 },
- /* 6627 */ { MAD_F(0x0798f435) /* 0.474842270 */, 18 },
- /* 6628 */ { MAD_F(0x07995863) /* 0.474937809 */, 18 },
- /* 6629 */ { MAD_F(0x0799bc92) /* 0.475033353 */, 18 },
- /* 6630 */ { MAD_F(0x079a20c3) /* 0.475128902 */, 18 },
- /* 6631 */ { MAD_F(0x079a84f5) /* 0.475224456 */, 18 },
- /* 6632 */ { MAD_F(0x079ae929) /* 0.475320014 */, 18 },
- /* 6633 */ { MAD_F(0x079b4d5d) /* 0.475415578 */, 18 },
- /* 6634 */ { MAD_F(0x079bb193) /* 0.475511146 */, 18 },
- /* 6635 */ { MAD_F(0x079c15ca) /* 0.475606719 */, 18 },
- /* 6636 */ { MAD_F(0x079c7a03) /* 0.475702296 */, 18 },
- /* 6637 */ { MAD_F(0x079cde3c) /* 0.475797879 */, 18 },
- /* 6638 */ { MAD_F(0x079d4277) /* 0.475893466 */, 18 },
- /* 6639 */ { MAD_F(0x079da6b4) /* 0.475989058 */, 18 },
-
- /* 6640 */ { MAD_F(0x079e0af1) /* 0.476084655 */, 18 },
- /* 6641 */ { MAD_F(0x079e6f30) /* 0.476180257 */, 18 },
- /* 6642 */ { MAD_F(0x079ed370) /* 0.476275863 */, 18 },
- /* 6643 */ { MAD_F(0x079f37b2) /* 0.476371475 */, 18 },
- /* 6644 */ { MAD_F(0x079f9bf5) /* 0.476467091 */, 18 },
- /* 6645 */ { MAD_F(0x07a00039) /* 0.476562712 */, 18 },
- /* 6646 */ { MAD_F(0x07a0647e) /* 0.476658338 */, 18 },
- /* 6647 */ { MAD_F(0x07a0c8c5) /* 0.476753968 */, 18 },
- /* 6648 */ { MAD_F(0x07a12d0c) /* 0.476849603 */, 18 },
- /* 6649 */ { MAD_F(0x07a19156) /* 0.476945243 */, 18 },
- /* 6650 */ { MAD_F(0x07a1f5a0) /* 0.477040888 */, 18 },
- /* 6651 */ { MAD_F(0x07a259ec) /* 0.477136538 */, 18 },
- /* 6652 */ { MAD_F(0x07a2be39) /* 0.477232193 */, 18 },
- /* 6653 */ { MAD_F(0x07a32287) /* 0.477327852 */, 18 },
- /* 6654 */ { MAD_F(0x07a386d7) /* 0.477423516 */, 18 },
- /* 6655 */ { MAD_F(0x07a3eb28) /* 0.477519185 */, 18 },
-
- /* 6656 */ { MAD_F(0x07a44f7a) /* 0.477614858 */, 18 },
- /* 6657 */ { MAD_F(0x07a4b3ce) /* 0.477710537 */, 18 },
- /* 6658 */ { MAD_F(0x07a51822) /* 0.477806220 */, 18 },
- /* 6659 */ { MAD_F(0x07a57c78) /* 0.477901908 */, 18 },
- /* 6660 */ { MAD_F(0x07a5e0d0) /* 0.477997601 */, 18 },
- /* 6661 */ { MAD_F(0x07a64528) /* 0.478093299 */, 18 },
- /* 6662 */ { MAD_F(0x07a6a982) /* 0.478189001 */, 18 },
- /* 6663 */ { MAD_F(0x07a70ddd) /* 0.478284708 */, 18 },
- /* 6664 */ { MAD_F(0x07a7723a) /* 0.478380420 */, 18 },
- /* 6665 */ { MAD_F(0x07a7d698) /* 0.478476137 */, 18 },
- /* 6666 */ { MAD_F(0x07a83af7) /* 0.478571858 */, 18 },
- /* 6667 */ { MAD_F(0x07a89f57) /* 0.478667585 */, 18 },
- /* 6668 */ { MAD_F(0x07a903b9) /* 0.478763316 */, 18 },
- /* 6669 */ { MAD_F(0x07a9681c) /* 0.478859052 */, 18 },
- /* 6670 */ { MAD_F(0x07a9cc80) /* 0.478954793 */, 18 },
- /* 6671 */ { MAD_F(0x07aa30e5) /* 0.479050538 */, 18 },
-
- /* 6672 */ { MAD_F(0x07aa954c) /* 0.479146288 */, 18 },
- /* 6673 */ { MAD_F(0x07aaf9b4) /* 0.479242043 */, 18 },
- /* 6674 */ { MAD_F(0x07ab5e1e) /* 0.479337803 */, 18 },
- /* 6675 */ { MAD_F(0x07abc288) /* 0.479433568 */, 18 },
- /* 6676 */ { MAD_F(0x07ac26f4) /* 0.479529337 */, 18 },
- /* 6677 */ { MAD_F(0x07ac8b61) /* 0.479625111 */, 18 },
- /* 6678 */ { MAD_F(0x07acefd0) /* 0.479720890 */, 18 },
- /* 6679 */ { MAD_F(0x07ad543f) /* 0.479816674 */, 18 },
- /* 6680 */ { MAD_F(0x07adb8b0) /* 0.479912463 */, 18 },
- /* 6681 */ { MAD_F(0x07ae1d23) /* 0.480008256 */, 18 },
- /* 6682 */ { MAD_F(0x07ae8196) /* 0.480104054 */, 18 },
- /* 6683 */ { MAD_F(0x07aee60b) /* 0.480199857 */, 18 },
- /* 6684 */ { MAD_F(0x07af4a81) /* 0.480295664 */, 18 },
- /* 6685 */ { MAD_F(0x07afaef9) /* 0.480391477 */, 18 },
- /* 6686 */ { MAD_F(0x07b01372) /* 0.480487294 */, 18 },
- /* 6687 */ { MAD_F(0x07b077ec) /* 0.480583116 */, 18 },
-
- /* 6688 */ { MAD_F(0x07b0dc67) /* 0.480678943 */, 18 },
- /* 6689 */ { MAD_F(0x07b140e4) /* 0.480774774 */, 18 },
- /* 6690 */ { MAD_F(0x07b1a561) /* 0.480870611 */, 18 },
- /* 6691 */ { MAD_F(0x07b209e1) /* 0.480966452 */, 18 },
- /* 6692 */ { MAD_F(0x07b26e61) /* 0.481062298 */, 18 },
- /* 6693 */ { MAD_F(0x07b2d2e3) /* 0.481158148 */, 18 },
- /* 6694 */ { MAD_F(0x07b33766) /* 0.481254004 */, 18 },
- /* 6695 */ { MAD_F(0x07b39bea) /* 0.481349864 */, 18 },
- /* 6696 */ { MAD_F(0x07b4006f) /* 0.481445729 */, 18 },
- /* 6697 */ { MAD_F(0x07b464f6) /* 0.481541598 */, 18 },
- /* 6698 */ { MAD_F(0x07b4c97e) /* 0.481637473 */, 18 },
- /* 6699 */ { MAD_F(0x07b52e08) /* 0.481733352 */, 18 },
- /* 6700 */ { MAD_F(0x07b59292) /* 0.481829236 */, 18 },
- /* 6701 */ { MAD_F(0x07b5f71e) /* 0.481925125 */, 18 },
- /* 6702 */ { MAD_F(0x07b65bac) /* 0.482021019 */, 18 },
- /* 6703 */ { MAD_F(0x07b6c03a) /* 0.482116917 */, 18 },
-
- /* 6704 */ { MAD_F(0x07b724ca) /* 0.482212820 */, 18 },
- /* 6705 */ { MAD_F(0x07b7895b) /* 0.482308728 */, 18 },
- /* 6706 */ { MAD_F(0x07b7eded) /* 0.482404640 */, 18 },
- /* 6707 */ { MAD_F(0x07b85281) /* 0.482500558 */, 18 },
- /* 6708 */ { MAD_F(0x07b8b716) /* 0.482596480 */, 18 },
- /* 6709 */ { MAD_F(0x07b91bac) /* 0.482692407 */, 18 },
- /* 6710 */ { MAD_F(0x07b98044) /* 0.482788339 */, 18 },
- /* 6711 */ { MAD_F(0x07b9e4dc) /* 0.482884275 */, 18 },
- /* 6712 */ { MAD_F(0x07ba4976) /* 0.482980216 */, 18 },
- /* 6713 */ { MAD_F(0x07baae12) /* 0.483076162 */, 18 },
- /* 6714 */ { MAD_F(0x07bb12ae) /* 0.483172113 */, 18 },
- /* 6715 */ { MAD_F(0x07bb774c) /* 0.483268069 */, 18 },
- /* 6716 */ { MAD_F(0x07bbdbeb) /* 0.483364029 */, 18 },
- /* 6717 */ { MAD_F(0x07bc408c) /* 0.483459994 */, 18 },
- /* 6718 */ { MAD_F(0x07bca52d) /* 0.483555964 */, 18 },
- /* 6719 */ { MAD_F(0x07bd09d0) /* 0.483651939 */, 18 },
-
- /* 6720 */ { MAD_F(0x07bd6e75) /* 0.483747918 */, 18 },
- /* 6721 */ { MAD_F(0x07bdd31a) /* 0.483843902 */, 18 },
- /* 6722 */ { MAD_F(0x07be37c1) /* 0.483939891 */, 18 },
- /* 6723 */ { MAD_F(0x07be9c69) /* 0.484035885 */, 18 },
- /* 6724 */ { MAD_F(0x07bf0113) /* 0.484131883 */, 18 },
- /* 6725 */ { MAD_F(0x07bf65bd) /* 0.484227886 */, 18 },
- /* 6726 */ { MAD_F(0x07bfca69) /* 0.484323894 */, 18 },
- /* 6727 */ { MAD_F(0x07c02f16) /* 0.484419907 */, 18 },
- /* 6728 */ { MAD_F(0x07c093c5) /* 0.484515924 */, 18 },
- /* 6729 */ { MAD_F(0x07c0f875) /* 0.484611946 */, 18 },
- /* 6730 */ { MAD_F(0x07c15d26) /* 0.484707973 */, 18 },
- /* 6731 */ { MAD_F(0x07c1c1d8) /* 0.484804005 */, 18 },
- /* 6732 */ { MAD_F(0x07c2268b) /* 0.484900041 */, 18 },
- /* 6733 */ { MAD_F(0x07c28b40) /* 0.484996083 */, 18 },
- /* 6734 */ { MAD_F(0x07c2eff6) /* 0.485092128 */, 18 },
- /* 6735 */ { MAD_F(0x07c354ae) /* 0.485188179 */, 18 },
-
- /* 6736 */ { MAD_F(0x07c3b967) /* 0.485284235 */, 18 },
- /* 6737 */ { MAD_F(0x07c41e21) /* 0.485380295 */, 18 },
- /* 6738 */ { MAD_F(0x07c482dc) /* 0.485476360 */, 18 },
- /* 6739 */ { MAD_F(0x07c4e798) /* 0.485572430 */, 18 },
- /* 6740 */ { MAD_F(0x07c54c56) /* 0.485668504 */, 18 },
- /* 6741 */ { MAD_F(0x07c5b115) /* 0.485764583 */, 18 },
- /* 6742 */ { MAD_F(0x07c615d6) /* 0.485860667 */, 18 },
- /* 6743 */ { MAD_F(0x07c67a97) /* 0.485956756 */, 18 },
- /* 6744 */ { MAD_F(0x07c6df5a) /* 0.486052849 */, 18 },
- /* 6745 */ { MAD_F(0x07c7441e) /* 0.486148948 */, 18 },
- /* 6746 */ { MAD_F(0x07c7a8e4) /* 0.486245051 */, 18 },
- /* 6747 */ { MAD_F(0x07c80daa) /* 0.486341158 */, 18 },
- /* 6748 */ { MAD_F(0x07c87272) /* 0.486437271 */, 18 },
- /* 6749 */ { MAD_F(0x07c8d73c) /* 0.486533388 */, 18 },
- /* 6750 */ { MAD_F(0x07c93c06) /* 0.486629510 */, 18 },
- /* 6751 */ { MAD_F(0x07c9a0d2) /* 0.486725637 */, 18 },
-
- /* 6752 */ { MAD_F(0x07ca059f) /* 0.486821768 */, 18 },
- /* 6753 */ { MAD_F(0x07ca6a6d) /* 0.486917905 */, 18 },
- /* 6754 */ { MAD_F(0x07cacf3d) /* 0.487014045 */, 18 },
- /* 6755 */ { MAD_F(0x07cb340e) /* 0.487110191 */, 18 },
- /* 6756 */ { MAD_F(0x07cb98e0) /* 0.487206342 */, 18 },
- /* 6757 */ { MAD_F(0x07cbfdb4) /* 0.487302497 */, 18 },
- /* 6758 */ { MAD_F(0x07cc6288) /* 0.487398657 */, 18 },
- /* 6759 */ { MAD_F(0x07ccc75e) /* 0.487494821 */, 18 },
- /* 6760 */ { MAD_F(0x07cd2c36) /* 0.487590991 */, 18 },
- /* 6761 */ { MAD_F(0x07cd910e) /* 0.487687165 */, 18 },
- /* 6762 */ { MAD_F(0x07cdf5e8) /* 0.487783344 */, 18 },
- /* 6763 */ { MAD_F(0x07ce5ac3) /* 0.487879528 */, 18 },
- /* 6764 */ { MAD_F(0x07cebfa0) /* 0.487975716 */, 18 },
- /* 6765 */ { MAD_F(0x07cf247d) /* 0.488071909 */, 18 },
- /* 6766 */ { MAD_F(0x07cf895c) /* 0.488168107 */, 18 },
- /* 6767 */ { MAD_F(0x07cfee3c) /* 0.488264310 */, 18 },
-
- /* 6768 */ { MAD_F(0x07d0531e) /* 0.488360517 */, 18 },
- /* 6769 */ { MAD_F(0x07d0b801) /* 0.488456729 */, 18 },
- /* 6770 */ { MAD_F(0x07d11ce5) /* 0.488552946 */, 18 },
- /* 6771 */ { MAD_F(0x07d181ca) /* 0.488649167 */, 18 },
- /* 6772 */ { MAD_F(0x07d1e6b0) /* 0.488745394 */, 18 },
- /* 6773 */ { MAD_F(0x07d24b98) /* 0.488841625 */, 18 },
- /* 6774 */ { MAD_F(0x07d2b081) /* 0.488937860 */, 18 },
- /* 6775 */ { MAD_F(0x07d3156c) /* 0.489034101 */, 18 },
- /* 6776 */ { MAD_F(0x07d37a57) /* 0.489130346 */, 18 },
- /* 6777 */ { MAD_F(0x07d3df44) /* 0.489226596 */, 18 },
- /* 6778 */ { MAD_F(0x07d44432) /* 0.489322851 */, 18 },
- /* 6779 */ { MAD_F(0x07d4a922) /* 0.489419110 */, 18 },
- /* 6780 */ { MAD_F(0x07d50e13) /* 0.489515375 */, 18 },
- /* 6781 */ { MAD_F(0x07d57305) /* 0.489611643 */, 18 },
- /* 6782 */ { MAD_F(0x07d5d7f8) /* 0.489707917 */, 18 },
- /* 6783 */ { MAD_F(0x07d63cec) /* 0.489804195 */, 18 },
-
- /* 6784 */ { MAD_F(0x07d6a1e2) /* 0.489900479 */, 18 },
- /* 6785 */ { MAD_F(0x07d706d9) /* 0.489996766 */, 18 },
- /* 6786 */ { MAD_F(0x07d76bd2) /* 0.490093059 */, 18 },
- /* 6787 */ { MAD_F(0x07d7d0cb) /* 0.490189356 */, 18 },
- /* 6788 */ { MAD_F(0x07d835c6) /* 0.490285658 */, 18 },
- /* 6789 */ { MAD_F(0x07d89ac2) /* 0.490381965 */, 18 },
- /* 6790 */ { MAD_F(0x07d8ffc0) /* 0.490478277 */, 18 },
- /* 6791 */ { MAD_F(0x07d964be) /* 0.490574593 */, 18 },
- /* 6792 */ { MAD_F(0x07d9c9be) /* 0.490670914 */, 18 },
- /* 6793 */ { MAD_F(0x07da2ebf) /* 0.490767239 */, 18 },
- /* 6794 */ { MAD_F(0x07da93c2) /* 0.490863570 */, 18 },
- /* 6795 */ { MAD_F(0x07daf8c6) /* 0.490959905 */, 18 },
- /* 6796 */ { MAD_F(0x07db5dcb) /* 0.491056245 */, 18 },
- /* 6797 */ { MAD_F(0x07dbc2d1) /* 0.491152589 */, 18 },
- /* 6798 */ { MAD_F(0x07dc27d9) /* 0.491248939 */, 18 },
- /* 6799 */ { MAD_F(0x07dc8ce1) /* 0.491345293 */, 18 },
-
- /* 6800 */ { MAD_F(0x07dcf1ec) /* 0.491441651 */, 18 },
- /* 6801 */ { MAD_F(0x07dd56f7) /* 0.491538015 */, 18 },
- /* 6802 */ { MAD_F(0x07ddbc04) /* 0.491634383 */, 18 },
- /* 6803 */ { MAD_F(0x07de2111) /* 0.491730756 */, 18 },
- /* 6804 */ { MAD_F(0x07de8621) /* 0.491827134 */, 18 },
- /* 6805 */ { MAD_F(0x07deeb31) /* 0.491923516 */, 18 },
- /* 6806 */ { MAD_F(0x07df5043) /* 0.492019903 */, 18 },
- /* 6807 */ { MAD_F(0x07dfb556) /* 0.492116295 */, 18 },
- /* 6808 */ { MAD_F(0x07e01a6a) /* 0.492212691 */, 18 },
- /* 6809 */ { MAD_F(0x07e07f80) /* 0.492309093 */, 18 },
- /* 6810 */ { MAD_F(0x07e0e496) /* 0.492405499 */, 18 },
- /* 6811 */ { MAD_F(0x07e149ae) /* 0.492501909 */, 18 },
- /* 6812 */ { MAD_F(0x07e1aec8) /* 0.492598325 */, 18 },
- /* 6813 */ { MAD_F(0x07e213e2) /* 0.492694745 */, 18 },
- /* 6814 */ { MAD_F(0x07e278fe) /* 0.492791170 */, 18 },
- /* 6815 */ { MAD_F(0x07e2de1b) /* 0.492887599 */, 18 },
-
- /* 6816 */ { MAD_F(0x07e3433a) /* 0.492984033 */, 18 },
- /* 6817 */ { MAD_F(0x07e3a859) /* 0.493080472 */, 18 },
- /* 6818 */ { MAD_F(0x07e40d7a) /* 0.493176916 */, 18 },
- /* 6819 */ { MAD_F(0x07e4729c) /* 0.493273365 */, 18 },
- /* 6820 */ { MAD_F(0x07e4d7c0) /* 0.493369818 */, 18 },
- /* 6821 */ { MAD_F(0x07e53ce4) /* 0.493466275 */, 18 },
- /* 6822 */ { MAD_F(0x07e5a20a) /* 0.493562738 */, 18 },
- /* 6823 */ { MAD_F(0x07e60732) /* 0.493659205 */, 18 },
- /* 6824 */ { MAD_F(0x07e66c5a) /* 0.493755677 */, 18 },
- /* 6825 */ { MAD_F(0x07e6d184) /* 0.493852154 */, 18 },
- /* 6826 */ { MAD_F(0x07e736af) /* 0.493948635 */, 18 },
- /* 6827 */ { MAD_F(0x07e79bdb) /* 0.494045122 */, 18 },
- /* 6828 */ { MAD_F(0x07e80109) /* 0.494141612 */, 18 },
- /* 6829 */ { MAD_F(0x07e86638) /* 0.494238108 */, 18 },
- /* 6830 */ { MAD_F(0x07e8cb68) /* 0.494334608 */, 18 },
- /* 6831 */ { MAD_F(0x07e93099) /* 0.494431113 */, 18 },
-
- /* 6832 */ { MAD_F(0x07e995cc) /* 0.494527623 */, 18 },
- /* 6833 */ { MAD_F(0x07e9fb00) /* 0.494624137 */, 18 },
- /* 6834 */ { MAD_F(0x07ea6035) /* 0.494720656 */, 18 },
- /* 6835 */ { MAD_F(0x07eac56b) /* 0.494817180 */, 18 },
- /* 6836 */ { MAD_F(0x07eb2aa3) /* 0.494913709 */, 18 },
- /* 6837 */ { MAD_F(0x07eb8fdc) /* 0.495010242 */, 18 },
- /* 6838 */ { MAD_F(0x07ebf516) /* 0.495106780 */, 18 },
- /* 6839 */ { MAD_F(0x07ec5a51) /* 0.495203322 */, 18 },
- /* 6840 */ { MAD_F(0x07ecbf8e) /* 0.495299870 */, 18 },
- /* 6841 */ { MAD_F(0x07ed24cc) /* 0.495396422 */, 18 },
- /* 6842 */ { MAD_F(0x07ed8a0b) /* 0.495492978 */, 18 },
- /* 6843 */ { MAD_F(0x07edef4c) /* 0.495589540 */, 18 },
- /* 6844 */ { MAD_F(0x07ee548e) /* 0.495686106 */, 18 },
- /* 6845 */ { MAD_F(0x07eeb9d1) /* 0.495782677 */, 18 },
- /* 6846 */ { MAD_F(0x07ef1f15) /* 0.495879252 */, 18 },
- /* 6847 */ { MAD_F(0x07ef845b) /* 0.495975833 */, 18 },
-
- /* 6848 */ { MAD_F(0x07efe9a1) /* 0.496072418 */, 18 },
- /* 6849 */ { MAD_F(0x07f04ee9) /* 0.496169007 */, 18 },
- /* 6850 */ { MAD_F(0x07f0b433) /* 0.496265602 */, 18 },
- /* 6851 */ { MAD_F(0x07f1197d) /* 0.496362201 */, 18 },
- /* 6852 */ { MAD_F(0x07f17ec9) /* 0.496458804 */, 18 },
- /* 6853 */ { MAD_F(0x07f1e416) /* 0.496555413 */, 18 },
- /* 6854 */ { MAD_F(0x07f24965) /* 0.496652026 */, 18 },
- /* 6855 */ { MAD_F(0x07f2aeb5) /* 0.496748644 */, 18 },
- /* 6856 */ { MAD_F(0x07f31405) /* 0.496845266 */, 18 },
- /* 6857 */ { MAD_F(0x07f37958) /* 0.496941894 */, 18 },
- /* 6858 */ { MAD_F(0x07f3deab) /* 0.497038526 */, 18 },
- /* 6859 */ { MAD_F(0x07f44400) /* 0.497135162 */, 18 },
- /* 6860 */ { MAD_F(0x07f4a956) /* 0.497231804 */, 18 },
- /* 6861 */ { MAD_F(0x07f50ead) /* 0.497328450 */, 18 },
- /* 6862 */ { MAD_F(0x07f57405) /* 0.497425100 */, 18 },
- /* 6863 */ { MAD_F(0x07f5d95f) /* 0.497521756 */, 18 },
-
- /* 6864 */ { MAD_F(0x07f63eba) /* 0.497618416 */, 18 },
- /* 6865 */ { MAD_F(0x07f6a416) /* 0.497715081 */, 18 },
- /* 6866 */ { MAD_F(0x07f70974) /* 0.497811750 */, 18 },
- /* 6867 */ { MAD_F(0x07f76ed3) /* 0.497908425 */, 18 },
- /* 6868 */ { MAD_F(0x07f7d433) /* 0.498005103 */, 18 },
- /* 6869 */ { MAD_F(0x07f83994) /* 0.498101787 */, 18 },
- /* 6870 */ { MAD_F(0x07f89ef7) /* 0.498198475 */, 18 },
- /* 6871 */ { MAD_F(0x07f9045a) /* 0.498295168 */, 18 },
- /* 6872 */ { MAD_F(0x07f969c0) /* 0.498391866 */, 18 },
- /* 6873 */ { MAD_F(0x07f9cf26) /* 0.498488568 */, 18 },
- /* 6874 */ { MAD_F(0x07fa348e) /* 0.498585275 */, 18 },
- /* 6875 */ { MAD_F(0x07fa99f6) /* 0.498681987 */, 18 },
- /* 6876 */ { MAD_F(0x07faff60) /* 0.498778704 */, 18 },
- /* 6877 */ { MAD_F(0x07fb64cc) /* 0.498875425 */, 18 },
- /* 6878 */ { MAD_F(0x07fbca38) /* 0.498972150 */, 18 },
- /* 6879 */ { MAD_F(0x07fc2fa6) /* 0.499068881 */, 18 },
-
- /* 6880 */ { MAD_F(0x07fc9516) /* 0.499165616 */, 18 },
- /* 6881 */ { MAD_F(0x07fcfa86) /* 0.499262356 */, 18 },
- /* 6882 */ { MAD_F(0x07fd5ff8) /* 0.499359101 */, 18 },
- /* 6883 */ { MAD_F(0x07fdc56b) /* 0.499455850 */, 18 },
- /* 6884 */ { MAD_F(0x07fe2adf) /* 0.499552604 */, 18 },
- /* 6885 */ { MAD_F(0x07fe9054) /* 0.499649362 */, 18 },
- /* 6886 */ { MAD_F(0x07fef5cb) /* 0.499746126 */, 18 },
- /* 6887 */ { MAD_F(0x07ff5b43) /* 0.499842894 */, 18 },
- /* 6888 */ { MAD_F(0x07ffc0bc) /* 0.499939666 */, 18 },
- /* 6889 */ { MAD_F(0x0400131b) /* 0.250018222 */, 19 },
- /* 6890 */ { MAD_F(0x040045d9) /* 0.250066613 */, 19 },
- /* 6891 */ { MAD_F(0x04007897) /* 0.250115006 */, 19 },
- /* 6892 */ { MAD_F(0x0400ab57) /* 0.250163402 */, 19 },
- /* 6893 */ { MAD_F(0x0400de16) /* 0.250211800 */, 19 },
- /* 6894 */ { MAD_F(0x040110d7) /* 0.250260200 */, 19 },
- /* 6895 */ { MAD_F(0x04014398) /* 0.250308603 */, 19 },
-
- /* 6896 */ { MAD_F(0x04017659) /* 0.250357008 */, 19 },
- /* 6897 */ { MAD_F(0x0401a91c) /* 0.250405415 */, 19 },
- /* 6898 */ { MAD_F(0x0401dbdf) /* 0.250453825 */, 19 },
- /* 6899 */ { MAD_F(0x04020ea2) /* 0.250502237 */, 19 },
- /* 6900 */ { MAD_F(0x04024166) /* 0.250550652 */, 19 },
- /* 6901 */ { MAD_F(0x0402742b) /* 0.250599068 */, 19 },
- /* 6902 */ { MAD_F(0x0402a6f0) /* 0.250647488 */, 19 },
- /* 6903 */ { MAD_F(0x0402d9b6) /* 0.250695909 */, 19 },
- /* 6904 */ { MAD_F(0x04030c7d) /* 0.250744333 */, 19 },
- /* 6905 */ { MAD_F(0x04033f44) /* 0.250792759 */, 19 },
- /* 6906 */ { MAD_F(0x0403720c) /* 0.250841187 */, 19 },
- /* 6907 */ { MAD_F(0x0403a4d5) /* 0.250889618 */, 19 },
- /* 6908 */ { MAD_F(0x0403d79e) /* 0.250938051 */, 19 },
- /* 6909 */ { MAD_F(0x04040a68) /* 0.250986487 */, 19 },
- /* 6910 */ { MAD_F(0x04043d32) /* 0.251034924 */, 19 },
- /* 6911 */ { MAD_F(0x04046ffd) /* 0.251083365 */, 19 },
-
- /* 6912 */ { MAD_F(0x0404a2c9) /* 0.251131807 */, 19 },
- /* 6913 */ { MAD_F(0x0404d595) /* 0.251180252 */, 19 },
- /* 6914 */ { MAD_F(0x04050862) /* 0.251228699 */, 19 },
- /* 6915 */ { MAD_F(0x04053b30) /* 0.251277148 */, 19 },
- /* 6916 */ { MAD_F(0x04056dfe) /* 0.251325600 */, 19 },
- /* 6917 */ { MAD_F(0x0405a0cd) /* 0.251374054 */, 19 },
- /* 6918 */ { MAD_F(0x0405d39c) /* 0.251422511 */, 19 },
- /* 6919 */ { MAD_F(0x0406066c) /* 0.251470970 */, 19 },
- /* 6920 */ { MAD_F(0x0406393d) /* 0.251519431 */, 19 },
- /* 6921 */ { MAD_F(0x04066c0e) /* 0.251567894 */, 19 },
- /* 6922 */ { MAD_F(0x04069ee0) /* 0.251616360 */, 19 },
- /* 6923 */ { MAD_F(0x0406d1b3) /* 0.251664828 */, 19 },
- /* 6924 */ { MAD_F(0x04070486) /* 0.251713299 */, 19 },
- /* 6925 */ { MAD_F(0x0407375a) /* 0.251761772 */, 19 },
- /* 6926 */ { MAD_F(0x04076a2e) /* 0.251810247 */, 19 },
- /* 6927 */ { MAD_F(0x04079d03) /* 0.251858724 */, 19 },
-
- /* 6928 */ { MAD_F(0x0407cfd9) /* 0.251907204 */, 19 },
- /* 6929 */ { MAD_F(0x040802af) /* 0.251955686 */, 19 },
- /* 6930 */ { MAD_F(0x04083586) /* 0.252004171 */, 19 },
- /* 6931 */ { MAD_F(0x0408685e) /* 0.252052658 */, 19 },
- /* 6932 */ { MAD_F(0x04089b36) /* 0.252101147 */, 19 },
- /* 6933 */ { MAD_F(0x0408ce0f) /* 0.252149638 */, 19 },
- /* 6934 */ { MAD_F(0x040900e8) /* 0.252198132 */, 19 },
- /* 6935 */ { MAD_F(0x040933c2) /* 0.252246628 */, 19 },
- /* 6936 */ { MAD_F(0x0409669d) /* 0.252295127 */, 19 },
- /* 6937 */ { MAD_F(0x04099978) /* 0.252343627 */, 19 },
- /* 6938 */ { MAD_F(0x0409cc54) /* 0.252392131 */, 19 },
- /* 6939 */ { MAD_F(0x0409ff31) /* 0.252440636 */, 19 },
- /* 6940 */ { MAD_F(0x040a320e) /* 0.252489144 */, 19 },
- /* 6941 */ { MAD_F(0x040a64ec) /* 0.252537654 */, 19 },
- /* 6942 */ { MAD_F(0x040a97cb) /* 0.252586166 */, 19 },
- /* 6943 */ { MAD_F(0x040acaaa) /* 0.252634681 */, 19 },
-
- /* 6944 */ { MAD_F(0x040afd89) /* 0.252683198 */, 19 },
- /* 6945 */ { MAD_F(0x040b306a) /* 0.252731718 */, 19 },
- /* 6946 */ { MAD_F(0x040b634b) /* 0.252780240 */, 19 },
- /* 6947 */ { MAD_F(0x040b962c) /* 0.252828764 */, 19 },
- /* 6948 */ { MAD_F(0x040bc90e) /* 0.252877290 */, 19 },
- /* 6949 */ { MAD_F(0x040bfbf1) /* 0.252925819 */, 19 },
- /* 6950 */ { MAD_F(0x040c2ed5) /* 0.252974350 */, 19 },
- /* 6951 */ { MAD_F(0x040c61b9) /* 0.253022883 */, 19 },
- /* 6952 */ { MAD_F(0x040c949e) /* 0.253071419 */, 19 },
- /* 6953 */ { MAD_F(0x040cc783) /* 0.253119957 */, 19 },
- /* 6954 */ { MAD_F(0x040cfa69) /* 0.253168498 */, 19 },
- /* 6955 */ { MAD_F(0x040d2d4f) /* 0.253217040 */, 19 },
- /* 6956 */ { MAD_F(0x040d6037) /* 0.253265585 */, 19 },
- /* 6957 */ { MAD_F(0x040d931e) /* 0.253314133 */, 19 },
- /* 6958 */ { MAD_F(0x040dc607) /* 0.253362682 */, 19 },
- /* 6959 */ { MAD_F(0x040df8f0) /* 0.253411234 */, 19 },
-
- /* 6960 */ { MAD_F(0x040e2bda) /* 0.253459789 */, 19 },
- /* 6961 */ { MAD_F(0x040e5ec4) /* 0.253508345 */, 19 },
- /* 6962 */ { MAD_F(0x040e91af) /* 0.253556904 */, 19 },
- /* 6963 */ { MAD_F(0x040ec49b) /* 0.253605466 */, 19 },
- /* 6964 */ { MAD_F(0x040ef787) /* 0.253654029 */, 19 },
- /* 6965 */ { MAD_F(0x040f2a74) /* 0.253702595 */, 19 },
- /* 6966 */ { MAD_F(0x040f5d61) /* 0.253751164 */, 19 },
- /* 6967 */ { MAD_F(0x040f904f) /* 0.253799734 */, 19 },
- /* 6968 */ { MAD_F(0x040fc33e) /* 0.253848307 */, 19 },
- /* 6969 */ { MAD_F(0x040ff62d) /* 0.253896883 */, 19 },
- /* 6970 */ { MAD_F(0x0410291d) /* 0.253945460 */, 19 },
- /* 6971 */ { MAD_F(0x04105c0e) /* 0.253994040 */, 19 },
- /* 6972 */ { MAD_F(0x04108eff) /* 0.254042622 */, 19 },
- /* 6973 */ { MAD_F(0x0410c1f1) /* 0.254091207 */, 19 },
- /* 6974 */ { MAD_F(0x0410f4e3) /* 0.254139794 */, 19 },
- /* 6975 */ { MAD_F(0x041127d6) /* 0.254188383 */, 19 },
-
- /* 6976 */ { MAD_F(0x04115aca) /* 0.254236974 */, 19 },
- /* 6977 */ { MAD_F(0x04118dbe) /* 0.254285568 */, 19 },
- /* 6978 */ { MAD_F(0x0411c0b3) /* 0.254334165 */, 19 },
- /* 6979 */ { MAD_F(0x0411f3a9) /* 0.254382763 */, 19 },
- /* 6980 */ { MAD_F(0x0412269f) /* 0.254431364 */, 19 },
- /* 6981 */ { MAD_F(0x04125996) /* 0.254479967 */, 19 },
- /* 6982 */ { MAD_F(0x04128c8d) /* 0.254528572 */, 19 },
- /* 6983 */ { MAD_F(0x0412bf85) /* 0.254577180 */, 19 },
- /* 6984 */ { MAD_F(0x0412f27e) /* 0.254625790 */, 19 },
- /* 6985 */ { MAD_F(0x04132577) /* 0.254674403 */, 19 },
- /* 6986 */ { MAD_F(0x04135871) /* 0.254723017 */, 19 },
- /* 6987 */ { MAD_F(0x04138b6c) /* 0.254771635 */, 19 },
- /* 6988 */ { MAD_F(0x0413be67) /* 0.254820254 */, 19 },
- /* 6989 */ { MAD_F(0x0413f163) /* 0.254868876 */, 19 },
- /* 6990 */ { MAD_F(0x0414245f) /* 0.254917500 */, 19 },
- /* 6991 */ { MAD_F(0x0414575c) /* 0.254966126 */, 19 },
-
- /* 6992 */ { MAD_F(0x04148a5a) /* 0.255014755 */, 19 },
- /* 6993 */ { MAD_F(0x0414bd58) /* 0.255063386 */, 19 },
- /* 6994 */ { MAD_F(0x0414f057) /* 0.255112019 */, 19 },
- /* 6995 */ { MAD_F(0x04152356) /* 0.255160655 */, 19 },
- /* 6996 */ { MAD_F(0x04155657) /* 0.255209292 */, 19 },
- /* 6997 */ { MAD_F(0x04158957) /* 0.255257933 */, 19 },
- /* 6998 */ { MAD_F(0x0415bc59) /* 0.255306575 */, 19 },
- /* 6999 */ { MAD_F(0x0415ef5b) /* 0.255355220 */, 19 },
- /* 7000 */ { MAD_F(0x0416225d) /* 0.255403867 */, 19 },
- /* 7001 */ { MAD_F(0x04165561) /* 0.255452517 */, 19 },
- /* 7002 */ { MAD_F(0x04168864) /* 0.255501169 */, 19 },
- /* 7003 */ { MAD_F(0x0416bb69) /* 0.255549823 */, 19 },
- /* 7004 */ { MAD_F(0x0416ee6e) /* 0.255598479 */, 19 },
- /* 7005 */ { MAD_F(0x04172174) /* 0.255647138 */, 19 },
- /* 7006 */ { MAD_F(0x0417547a) /* 0.255695799 */, 19 },
- /* 7007 */ { MAD_F(0x04178781) /* 0.255744463 */, 19 },
-
- /* 7008 */ { MAD_F(0x0417ba89) /* 0.255793128 */, 19 },
- /* 7009 */ { MAD_F(0x0417ed91) /* 0.255841796 */, 19 },
- /* 7010 */ { MAD_F(0x0418209a) /* 0.255890467 */, 19 },
- /* 7011 */ { MAD_F(0x041853a3) /* 0.255939139 */, 19 },
- /* 7012 */ { MAD_F(0x041886ad) /* 0.255987814 */, 19 },
- /* 7013 */ { MAD_F(0x0418b9b8) /* 0.256036492 */, 19 },
- /* 7014 */ { MAD_F(0x0418ecc3) /* 0.256085171 */, 19 },
- /* 7015 */ { MAD_F(0x04191fcf) /* 0.256133853 */, 19 },
- /* 7016 */ { MAD_F(0x041952dc) /* 0.256182537 */, 19 },
- /* 7017 */ { MAD_F(0x041985e9) /* 0.256231224 */, 19 },
- /* 7018 */ { MAD_F(0x0419b8f7) /* 0.256279913 */, 19 },
- /* 7019 */ { MAD_F(0x0419ec05) /* 0.256328604 */, 19 },
- /* 7020 */ { MAD_F(0x041a1f15) /* 0.256377297 */, 19 },
- /* 7021 */ { MAD_F(0x041a5224) /* 0.256425993 */, 19 },
- /* 7022 */ { MAD_F(0x041a8534) /* 0.256474691 */, 19 },
- /* 7023 */ { MAD_F(0x041ab845) /* 0.256523392 */, 19 },
-
- /* 7024 */ { MAD_F(0x041aeb57) /* 0.256572095 */, 19 },
- /* 7025 */ { MAD_F(0x041b1e69) /* 0.256620800 */, 19 },
- /* 7026 */ { MAD_F(0x041b517c) /* 0.256669507 */, 19 },
- /* 7027 */ { MAD_F(0x041b848f) /* 0.256718217 */, 19 },
- /* 7028 */ { MAD_F(0x041bb7a3) /* 0.256766929 */, 19 },
- /* 7029 */ { MAD_F(0x041beab8) /* 0.256815643 */, 19 },
- /* 7030 */ { MAD_F(0x041c1dcd) /* 0.256864359 */, 19 },
- /* 7031 */ { MAD_F(0x041c50e3) /* 0.256913078 */, 19 },
- /* 7032 */ { MAD_F(0x041c83fa) /* 0.256961800 */, 19 },
- /* 7033 */ { MAD_F(0x041cb711) /* 0.257010523 */, 19 },
- /* 7034 */ { MAD_F(0x041cea28) /* 0.257059249 */, 19 },
- /* 7035 */ { MAD_F(0x041d1d41) /* 0.257107977 */, 19 },
- /* 7036 */ { MAD_F(0x041d505a) /* 0.257156708 */, 19 },
- /* 7037 */ { MAD_F(0x041d8373) /* 0.257205440 */, 19 },
- /* 7038 */ { MAD_F(0x041db68e) /* 0.257254175 */, 19 },
- /* 7039 */ { MAD_F(0x041de9a8) /* 0.257302913 */, 19 },
-
- /* 7040 */ { MAD_F(0x041e1cc4) /* 0.257351652 */, 19 },
- /* 7041 */ { MAD_F(0x041e4fe0) /* 0.257400394 */, 19 },
- /* 7042 */ { MAD_F(0x041e82fd) /* 0.257449139 */, 19 },
- /* 7043 */ { MAD_F(0x041eb61a) /* 0.257497885 */, 19 },
- /* 7044 */ { MAD_F(0x041ee938) /* 0.257546634 */, 19 },
- /* 7045 */ { MAD_F(0x041f1c57) /* 0.257595386 */, 19 },
- /* 7046 */ { MAD_F(0x041f4f76) /* 0.257644139 */, 19 },
- /* 7047 */ { MAD_F(0x041f8296) /* 0.257692895 */, 19 },
- /* 7048 */ { MAD_F(0x041fb5b6) /* 0.257741653 */, 19 },
- /* 7049 */ { MAD_F(0x041fe8d7) /* 0.257790414 */, 19 },
- /* 7050 */ { MAD_F(0x04201bf9) /* 0.257839176 */, 19 },
- /* 7051 */ { MAD_F(0x04204f1b) /* 0.257887941 */, 19 },
- /* 7052 */ { MAD_F(0x0420823e) /* 0.257936709 */, 19 },
- /* 7053 */ { MAD_F(0x0420b561) /* 0.257985478 */, 19 },
- /* 7054 */ { MAD_F(0x0420e885) /* 0.258034250 */, 19 },
- /* 7055 */ { MAD_F(0x04211baa) /* 0.258083025 */, 19 },
-
- /* 7056 */ { MAD_F(0x04214ed0) /* 0.258131801 */, 19 },
- /* 7057 */ { MAD_F(0x042181f6) /* 0.258180580 */, 19 },
- /* 7058 */ { MAD_F(0x0421b51c) /* 0.258229361 */, 19 },
- /* 7059 */ { MAD_F(0x0421e843) /* 0.258278145 */, 19 },
- /* 7060 */ { MAD_F(0x04221b6b) /* 0.258326931 */, 19 },
- /* 7061 */ { MAD_F(0x04224e94) /* 0.258375719 */, 19 },
- /* 7062 */ { MAD_F(0x042281bd) /* 0.258424509 */, 19 },
- /* 7063 */ { MAD_F(0x0422b4e6) /* 0.258473302 */, 19 },
- /* 7064 */ { MAD_F(0x0422e811) /* 0.258522097 */, 19 },
- /* 7065 */ { MAD_F(0x04231b3c) /* 0.258570894 */, 19 },
- /* 7066 */ { MAD_F(0x04234e67) /* 0.258619694 */, 19 },
- /* 7067 */ { MAD_F(0x04238193) /* 0.258668496 */, 19 },
- /* 7068 */ { MAD_F(0x0423b4c0) /* 0.258717300 */, 19 },
- /* 7069 */ { MAD_F(0x0423e7ee) /* 0.258766106 */, 19 },
- /* 7070 */ { MAD_F(0x04241b1c) /* 0.258814915 */, 19 },
- /* 7071 */ { MAD_F(0x04244e4a) /* 0.258863726 */, 19 },
-
- /* 7072 */ { MAD_F(0x04248179) /* 0.258912540 */, 19 },
- /* 7073 */ { MAD_F(0x0424b4a9) /* 0.258961356 */, 19 },
- /* 7074 */ { MAD_F(0x0424e7da) /* 0.259010174 */, 19 },
- /* 7075 */ { MAD_F(0x04251b0b) /* 0.259058994 */, 19 },
- /* 7076 */ { MAD_F(0x04254e3d) /* 0.259107817 */, 19 },
- /* 7077 */ { MAD_F(0x0425816f) /* 0.259156642 */, 19 },
- /* 7078 */ { MAD_F(0x0425b4a2) /* 0.259205469 */, 19 },
- /* 7079 */ { MAD_F(0x0425e7d6) /* 0.259254298 */, 19 },
- /* 7080 */ { MAD_F(0x04261b0a) /* 0.259303130 */, 19 },
- /* 7081 */ { MAD_F(0x04264e3f) /* 0.259351964 */, 19 },
- /* 7082 */ { MAD_F(0x04268174) /* 0.259400801 */, 19 },
- /* 7083 */ { MAD_F(0x0426b4aa) /* 0.259449639 */, 19 },
- /* 7084 */ { MAD_F(0x0426e7e1) /* 0.259498480 */, 19 },
- /* 7085 */ { MAD_F(0x04271b18) /* 0.259547324 */, 19 },
- /* 7086 */ { MAD_F(0x04274e50) /* 0.259596169 */, 19 },
- /* 7087 */ { MAD_F(0x04278188) /* 0.259645017 */, 19 },
-
- /* 7088 */ { MAD_F(0x0427b4c2) /* 0.259693868 */, 19 },
- /* 7089 */ { MAD_F(0x0427e7fb) /* 0.259742720 */, 19 },
- /* 7090 */ { MAD_F(0x04281b36) /* 0.259791575 */, 19 },
- /* 7091 */ { MAD_F(0x04284e71) /* 0.259840432 */, 19 },
- /* 7092 */ { MAD_F(0x042881ac) /* 0.259889291 */, 19 },
- /* 7093 */ { MAD_F(0x0428b4e8) /* 0.259938153 */, 19 },
- /* 7094 */ { MAD_F(0x0428e825) /* 0.259987017 */, 19 },
- /* 7095 */ { MAD_F(0x04291b63) /* 0.260035883 */, 19 },
- /* 7096 */ { MAD_F(0x04294ea1) /* 0.260084752 */, 19 },
- /* 7097 */ { MAD_F(0x042981df) /* 0.260133623 */, 19 },
- /* 7098 */ { MAD_F(0x0429b51f) /* 0.260182496 */, 19 },
- /* 7099 */ { MAD_F(0x0429e85f) /* 0.260231372 */, 19 },
- /* 7100 */ { MAD_F(0x042a1b9f) /* 0.260280249 */, 19 },
- /* 7101 */ { MAD_F(0x042a4ee0) /* 0.260329129 */, 19 },
- /* 7102 */ { MAD_F(0x042a8222) /* 0.260378012 */, 19 },
- /* 7103 */ { MAD_F(0x042ab564) /* 0.260426896 */, 19 },
-
- /* 7104 */ { MAD_F(0x042ae8a7) /* 0.260475783 */, 19 },
- /* 7105 */ { MAD_F(0x042b1beb) /* 0.260524673 */, 19 },
- /* 7106 */ { MAD_F(0x042b4f2f) /* 0.260573564 */, 19 },
- /* 7107 */ { MAD_F(0x042b8274) /* 0.260622458 */, 19 },
- /* 7108 */ { MAD_F(0x042bb5ba) /* 0.260671354 */, 19 },
- /* 7109 */ { MAD_F(0x042be900) /* 0.260720252 */, 19 },
- /* 7110 */ { MAD_F(0x042c1c46) /* 0.260769153 */, 19 },
- /* 7111 */ { MAD_F(0x042c4f8e) /* 0.260818056 */, 19 },
- /* 7112 */ { MAD_F(0x042c82d6) /* 0.260866961 */, 19 },
- /* 7113 */ { MAD_F(0x042cb61e) /* 0.260915869 */, 19 },
- /* 7114 */ { MAD_F(0x042ce967) /* 0.260964779 */, 19 },
- /* 7115 */ { MAD_F(0x042d1cb1) /* 0.261013691 */, 19 },
- /* 7116 */ { MAD_F(0x042d4ffb) /* 0.261062606 */, 19 },
- /* 7117 */ { MAD_F(0x042d8346) /* 0.261111522 */, 19 },
- /* 7118 */ { MAD_F(0x042db692) /* 0.261160441 */, 19 },
- /* 7119 */ { MAD_F(0x042de9de) /* 0.261209363 */, 19 },
-
- /* 7120 */ { MAD_F(0x042e1d2b) /* 0.261258286 */, 19 },
- /* 7121 */ { MAD_F(0x042e5078) /* 0.261307212 */, 19 },
- /* 7122 */ { MAD_F(0x042e83c6) /* 0.261356140 */, 19 },
- /* 7123 */ { MAD_F(0x042eb715) /* 0.261405071 */, 19 },
- /* 7124 */ { MAD_F(0x042eea64) /* 0.261454004 */, 19 },
- /* 7125 */ { MAD_F(0x042f1db4) /* 0.261502939 */, 19 },
- /* 7126 */ { MAD_F(0x042f5105) /* 0.261551876 */, 19 },
- /* 7127 */ { MAD_F(0x042f8456) /* 0.261600816 */, 19 },
- /* 7128 */ { MAD_F(0x042fb7a8) /* 0.261649758 */, 19 },
- /* 7129 */ { MAD_F(0x042feafa) /* 0.261698702 */, 19 },
- /* 7130 */ { MAD_F(0x04301e4d) /* 0.261747649 */, 19 },
- /* 7131 */ { MAD_F(0x043051a1) /* 0.261796597 */, 19 },
- /* 7132 */ { MAD_F(0x043084f5) /* 0.261845548 */, 19 },
- /* 7133 */ { MAD_F(0x0430b84a) /* 0.261894502 */, 19 },
- /* 7134 */ { MAD_F(0x0430eb9f) /* 0.261943458 */, 19 },
- /* 7135 */ { MAD_F(0x04311ef5) /* 0.261992416 */, 19 },
-
- /* 7136 */ { MAD_F(0x0431524c) /* 0.262041376 */, 19 },
- /* 7137 */ { MAD_F(0x043185a3) /* 0.262090338 */, 19 },
- /* 7138 */ { MAD_F(0x0431b8fb) /* 0.262139303 */, 19 },
- /* 7139 */ { MAD_F(0x0431ec54) /* 0.262188270 */, 19 },
- /* 7140 */ { MAD_F(0x04321fad) /* 0.262237240 */, 19 },
- /* 7141 */ { MAD_F(0x04325306) /* 0.262286211 */, 19 },
- /* 7142 */ { MAD_F(0x04328661) /* 0.262335185 */, 19 },
- /* 7143 */ { MAD_F(0x0432b9bc) /* 0.262384162 */, 19 },
- /* 7144 */ { MAD_F(0x0432ed17) /* 0.262433140 */, 19 },
- /* 7145 */ { MAD_F(0x04332074) /* 0.262482121 */, 19 },
- /* 7146 */ { MAD_F(0x043353d0) /* 0.262531104 */, 19 },
- /* 7147 */ { MAD_F(0x0433872e) /* 0.262580089 */, 19 },
- /* 7148 */ { MAD_F(0x0433ba8c) /* 0.262629077 */, 19 },
- /* 7149 */ { MAD_F(0x0433edea) /* 0.262678067 */, 19 },
- /* 7150 */ { MAD_F(0x0434214a) /* 0.262727059 */, 19 },
- /* 7151 */ { MAD_F(0x043454aa) /* 0.262776054 */, 19 },
-
- /* 7152 */ { MAD_F(0x0434880a) /* 0.262825051 */, 19 },
- /* 7153 */ { MAD_F(0x0434bb6b) /* 0.262874050 */, 19 },
- /* 7154 */ { MAD_F(0x0434eecd) /* 0.262923051 */, 19 },
- /* 7155 */ { MAD_F(0x0435222f) /* 0.262972055 */, 19 },
- /* 7156 */ { MAD_F(0x04355592) /* 0.263021061 */, 19 },
- /* 7157 */ { MAD_F(0x043588f6) /* 0.263070069 */, 19 },
- /* 7158 */ { MAD_F(0x0435bc5a) /* 0.263119079 */, 19 },
- /* 7159 */ { MAD_F(0x0435efbf) /* 0.263168092 */, 19 },
- /* 7160 */ { MAD_F(0x04362324) /* 0.263217107 */, 19 },
- /* 7161 */ { MAD_F(0x0436568a) /* 0.263266125 */, 19 },
- /* 7162 */ { MAD_F(0x043689f1) /* 0.263315144 */, 19 },
- /* 7163 */ { MAD_F(0x0436bd58) /* 0.263364166 */, 19 },
- /* 7164 */ { MAD_F(0x0436f0c0) /* 0.263413191 */, 19 },
- /* 7165 */ { MAD_F(0x04372428) /* 0.263462217 */, 19 },
- /* 7166 */ { MAD_F(0x04375791) /* 0.263511246 */, 19 },
- /* 7167 */ { MAD_F(0x04378afb) /* 0.263560277 */, 19 },
-
- /* 7168 */ { MAD_F(0x0437be65) /* 0.263609310 */, 19 },
- /* 7169 */ { MAD_F(0x0437f1d0) /* 0.263658346 */, 19 },
- /* 7170 */ { MAD_F(0x0438253c) /* 0.263707384 */, 19 },
- /* 7171 */ { MAD_F(0x043858a8) /* 0.263756424 */, 19 },
- /* 7172 */ { MAD_F(0x04388c14) /* 0.263805466 */, 19 },
- /* 7173 */ { MAD_F(0x0438bf82) /* 0.263854511 */, 19 },
- /* 7174 */ { MAD_F(0x0438f2f0) /* 0.263903558 */, 19 },
- /* 7175 */ { MAD_F(0x0439265e) /* 0.263952607 */, 19 },
- /* 7176 */ { MAD_F(0x043959cd) /* 0.264001659 */, 19 },
- /* 7177 */ { MAD_F(0x04398d3d) /* 0.264050713 */, 19 },
- /* 7178 */ { MAD_F(0x0439c0ae) /* 0.264099769 */, 19 },
- /* 7179 */ { MAD_F(0x0439f41f) /* 0.264148827 */, 19 },
- /* 7180 */ { MAD_F(0x043a2790) /* 0.264197888 */, 19 },
- /* 7181 */ { MAD_F(0x043a5b02) /* 0.264246951 */, 19 },
- /* 7182 */ { MAD_F(0x043a8e75) /* 0.264296016 */, 19 },
- /* 7183 */ { MAD_F(0x043ac1e9) /* 0.264345084 */, 19 },
-
- /* 7184 */ { MAD_F(0x043af55d) /* 0.264394153 */, 19 },
- /* 7185 */ { MAD_F(0x043b28d2) /* 0.264443225 */, 19 },
- /* 7186 */ { MAD_F(0x043b5c47) /* 0.264492300 */, 19 },
- /* 7187 */ { MAD_F(0x043b8fbd) /* 0.264541376 */, 19 },
- /* 7188 */ { MAD_F(0x043bc333) /* 0.264590455 */, 19 },
- /* 7189 */ { MAD_F(0x043bf6aa) /* 0.264639536 */, 19 },
- /* 7190 */ { MAD_F(0x043c2a22) /* 0.264688620 */, 19 },
- /* 7191 */ { MAD_F(0x043c5d9a) /* 0.264737706 */, 19 },
- /* 7192 */ { MAD_F(0x043c9113) /* 0.264786794 */, 19 },
- /* 7193 */ { MAD_F(0x043cc48d) /* 0.264835884 */, 19 },
- /* 7194 */ { MAD_F(0x043cf807) /* 0.264884976 */, 19 },
- /* 7195 */ { MAD_F(0x043d2b82) /* 0.264934071 */, 19 },
- /* 7196 */ { MAD_F(0x043d5efd) /* 0.264983168 */, 19 },
- /* 7197 */ { MAD_F(0x043d9279) /* 0.265032268 */, 19 },
- /* 7198 */ { MAD_F(0x043dc5f6) /* 0.265081369 */, 19 },
- /* 7199 */ { MAD_F(0x043df973) /* 0.265130473 */, 19 },
-
- /* 7200 */ { MAD_F(0x043e2cf1) /* 0.265179580 */, 19 },
- /* 7201 */ { MAD_F(0x043e6070) /* 0.265228688 */, 19 },
- /* 7202 */ { MAD_F(0x043e93ef) /* 0.265277799 */, 19 },
- /* 7203 */ { MAD_F(0x043ec76e) /* 0.265326912 */, 19 },
- /* 7204 */ { MAD_F(0x043efaef) /* 0.265376027 */, 19 },
- /* 7205 */ { MAD_F(0x043f2e6f) /* 0.265425145 */, 19 },
- /* 7206 */ { MAD_F(0x043f61f1) /* 0.265474264 */, 19 },
- /* 7207 */ { MAD_F(0x043f9573) /* 0.265523387 */, 19 },
- /* 7208 */ { MAD_F(0x043fc8f6) /* 0.265572511 */, 19 },
- /* 7209 */ { MAD_F(0x043ffc79) /* 0.265621638 */, 19 },
- /* 7210 */ { MAD_F(0x04402ffd) /* 0.265670766 */, 19 },
- /* 7211 */ { MAD_F(0x04406382) /* 0.265719898 */, 19 },
- /* 7212 */ { MAD_F(0x04409707) /* 0.265769031 */, 19 },
- /* 7213 */ { MAD_F(0x0440ca8d) /* 0.265818167 */, 19 },
- /* 7214 */ { MAD_F(0x0440fe13) /* 0.265867305 */, 19 },
- /* 7215 */ { MAD_F(0x0441319a) /* 0.265916445 */, 19 },
-
- /* 7216 */ { MAD_F(0x04416522) /* 0.265965588 */, 19 },
- /* 7217 */ { MAD_F(0x044198aa) /* 0.266014732 */, 19 },
- /* 7218 */ { MAD_F(0x0441cc33) /* 0.266063880 */, 19 },
- /* 7219 */ { MAD_F(0x0441ffbc) /* 0.266113029 */, 19 },
- /* 7220 */ { MAD_F(0x04423346) /* 0.266162181 */, 19 },
- /* 7221 */ { MAD_F(0x044266d1) /* 0.266211334 */, 19 },
- /* 7222 */ { MAD_F(0x04429a5c) /* 0.266260491 */, 19 },
- /* 7223 */ { MAD_F(0x0442cde8) /* 0.266309649 */, 19 },
- /* 7224 */ { MAD_F(0x04430174) /* 0.266358810 */, 19 },
- /* 7225 */ { MAD_F(0x04433501) /* 0.266407973 */, 19 },
- /* 7226 */ { MAD_F(0x0443688f) /* 0.266457138 */, 19 },
- /* 7227 */ { MAD_F(0x04439c1d) /* 0.266506305 */, 19 },
- /* 7228 */ { MAD_F(0x0443cfac) /* 0.266555475 */, 19 },
- /* 7229 */ { MAD_F(0x0444033c) /* 0.266604647 */, 19 },
- /* 7230 */ { MAD_F(0x044436cc) /* 0.266653822 */, 19 },
- /* 7231 */ { MAD_F(0x04446a5d) /* 0.266702998 */, 19 },
-
- /* 7232 */ { MAD_F(0x04449dee) /* 0.266752177 */, 19 },
- /* 7233 */ { MAD_F(0x0444d180) /* 0.266801358 */, 19 },
- /* 7234 */ { MAD_F(0x04450513) /* 0.266850541 */, 19 },
- /* 7235 */ { MAD_F(0x044538a6) /* 0.266899727 */, 19 },
- /* 7236 */ { MAD_F(0x04456c39) /* 0.266948915 */, 19 },
- /* 7237 */ { MAD_F(0x04459fce) /* 0.266998105 */, 19 },
- /* 7238 */ { MAD_F(0x0445d363) /* 0.267047298 */, 19 },
- /* 7239 */ { MAD_F(0x044606f8) /* 0.267096492 */, 19 },
- /* 7240 */ { MAD_F(0x04463a8f) /* 0.267145689 */, 19 },
- /* 7241 */ { MAD_F(0x04466e25) /* 0.267194888 */, 19 },
- /* 7242 */ { MAD_F(0x0446a1bd) /* 0.267244090 */, 19 },
- /* 7243 */ { MAD_F(0x0446d555) /* 0.267293294 */, 19 },
- /* 7244 */ { MAD_F(0x044708ee) /* 0.267342500 */, 19 },
- /* 7245 */ { MAD_F(0x04473c87) /* 0.267391708 */, 19 },
- /* 7246 */ { MAD_F(0x04477021) /* 0.267440919 */, 19 },
- /* 7247 */ { MAD_F(0x0447a3bb) /* 0.267490131 */, 19 },
-
- /* 7248 */ { MAD_F(0x0447d756) /* 0.267539347 */, 19 },
- /* 7249 */ { MAD_F(0x04480af2) /* 0.267588564 */, 19 },
- /* 7250 */ { MAD_F(0x04483e8e) /* 0.267637783 */, 19 },
- /* 7251 */ { MAD_F(0x0448722b) /* 0.267687005 */, 19 },
- /* 7252 */ { MAD_F(0x0448a5c9) /* 0.267736229 */, 19 },
- /* 7253 */ { MAD_F(0x0448d967) /* 0.267785456 */, 19 },
- /* 7254 */ { MAD_F(0x04490d05) /* 0.267834685 */, 19 },
- /* 7255 */ { MAD_F(0x044940a5) /* 0.267883915 */, 19 },
- /* 7256 */ { MAD_F(0x04497445) /* 0.267933149 */, 19 },
- /* 7257 */ { MAD_F(0x0449a7e5) /* 0.267982384 */, 19 },
- /* 7258 */ { MAD_F(0x0449db86) /* 0.268031622 */, 19 },
- /* 7259 */ { MAD_F(0x044a0f28) /* 0.268080862 */, 19 },
- /* 7260 */ { MAD_F(0x044a42ca) /* 0.268130104 */, 19 },
- /* 7261 */ { MAD_F(0x044a766d) /* 0.268179349 */, 19 },
- /* 7262 */ { MAD_F(0x044aaa11) /* 0.268228595 */, 19 },
- /* 7263 */ { MAD_F(0x044addb5) /* 0.268277844 */, 19 },
-
- /* 7264 */ { MAD_F(0x044b115a) /* 0.268327096 */, 19 },
- /* 7265 */ { MAD_F(0x044b44ff) /* 0.268376349 */, 19 },
- /* 7266 */ { MAD_F(0x044b78a5) /* 0.268425605 */, 19 },
- /* 7267 */ { MAD_F(0x044bac4c) /* 0.268474863 */, 19 },
- /* 7268 */ { MAD_F(0x044bdff3) /* 0.268524123 */, 19 },
- /* 7269 */ { MAD_F(0x044c139b) /* 0.268573386 */, 19 },
- /* 7270 */ { MAD_F(0x044c4743) /* 0.268622651 */, 19 },
- /* 7271 */ { MAD_F(0x044c7aec) /* 0.268671918 */, 19 },
- /* 7272 */ { MAD_F(0x044cae96) /* 0.268721187 */, 19 },
- /* 7273 */ { MAD_F(0x044ce240) /* 0.268770459 */, 19 },
- /* 7274 */ { MAD_F(0x044d15eb) /* 0.268819733 */, 19 },
- /* 7275 */ { MAD_F(0x044d4997) /* 0.268869009 */, 19 },
- /* 7276 */ { MAD_F(0x044d7d43) /* 0.268918287 */, 19 },
- /* 7277 */ { MAD_F(0x044db0ef) /* 0.268967568 */, 19 },
- /* 7278 */ { MAD_F(0x044de49d) /* 0.269016851 */, 19 },
- /* 7279 */ { MAD_F(0x044e184b) /* 0.269066136 */, 19 },
-
- /* 7280 */ { MAD_F(0x044e4bf9) /* 0.269115423 */, 19 },
- /* 7281 */ { MAD_F(0x044e7fa8) /* 0.269164713 */, 19 },
- /* 7282 */ { MAD_F(0x044eb358) /* 0.269214005 */, 19 },
- /* 7283 */ { MAD_F(0x044ee708) /* 0.269263299 */, 19 },
- /* 7284 */ { MAD_F(0x044f1ab9) /* 0.269312595 */, 19 },
- /* 7285 */ { MAD_F(0x044f4e6b) /* 0.269361894 */, 19 },
- /* 7286 */ { MAD_F(0x044f821d) /* 0.269411195 */, 19 },
- /* 7287 */ { MAD_F(0x044fb5cf) /* 0.269460498 */, 19 },
- /* 7288 */ { MAD_F(0x044fe983) /* 0.269509804 */, 19 },
- /* 7289 */ { MAD_F(0x04501d37) /* 0.269559111 */, 19 },
- /* 7290 */ { MAD_F(0x045050eb) /* 0.269608421 */, 19 },
- /* 7291 */ { MAD_F(0x045084a0) /* 0.269657734 */, 19 },
- /* 7292 */ { MAD_F(0x0450b856) /* 0.269707048 */, 19 },
- /* 7293 */ { MAD_F(0x0450ec0d) /* 0.269756365 */, 19 },
- /* 7294 */ { MAD_F(0x04511fc4) /* 0.269805684 */, 19 },
- /* 7295 */ { MAD_F(0x0451537b) /* 0.269855005 */, 19 },
-
- /* 7296 */ { MAD_F(0x04518733) /* 0.269904329 */, 19 },
- /* 7297 */ { MAD_F(0x0451baec) /* 0.269953654 */, 19 },
- /* 7298 */ { MAD_F(0x0451eea5) /* 0.270002982 */, 19 },
- /* 7299 */ { MAD_F(0x0452225f) /* 0.270052313 */, 19 },
- /* 7300 */ { MAD_F(0x0452561a) /* 0.270101645 */, 19 },
- /* 7301 */ { MAD_F(0x045289d5) /* 0.270150980 */, 19 },
- /* 7302 */ { MAD_F(0x0452bd91) /* 0.270200317 */, 19 },
- /* 7303 */ { MAD_F(0x0452f14d) /* 0.270249656 */, 19 },
- /* 7304 */ { MAD_F(0x0453250a) /* 0.270298998 */, 19 },
- /* 7305 */ { MAD_F(0x045358c8) /* 0.270348341 */, 19 },
- /* 7306 */ { MAD_F(0x04538c86) /* 0.270397687 */, 19 },
- /* 7307 */ { MAD_F(0x0453c045) /* 0.270447036 */, 19 },
- /* 7308 */ { MAD_F(0x0453f405) /* 0.270496386 */, 19 },
- /* 7309 */ { MAD_F(0x045427c5) /* 0.270545739 */, 19 },
- /* 7310 */ { MAD_F(0x04545b85) /* 0.270595094 */, 19 },
- /* 7311 */ { MAD_F(0x04548f46) /* 0.270644451 */, 19 },
-
- /* 7312 */ { MAD_F(0x0454c308) /* 0.270693811 */, 19 },
- /* 7313 */ { MAD_F(0x0454f6cb) /* 0.270743173 */, 19 },
- /* 7314 */ { MAD_F(0x04552a8e) /* 0.270792537 */, 19 },
- /* 7315 */ { MAD_F(0x04555e51) /* 0.270841903 */, 19 },
- /* 7316 */ { MAD_F(0x04559216) /* 0.270891271 */, 19 },
- /* 7317 */ { MAD_F(0x0455c5db) /* 0.270940642 */, 19 },
- /* 7318 */ { MAD_F(0x0455f9a0) /* 0.270990015 */, 19 },
- /* 7319 */ { MAD_F(0x04562d66) /* 0.271039390 */, 19 },
- /* 7320 */ { MAD_F(0x0456612d) /* 0.271088768 */, 19 },
- /* 7321 */ { MAD_F(0x045694f4) /* 0.271138148 */, 19 },
- /* 7322 */ { MAD_F(0x0456c8bc) /* 0.271187530 */, 19 },
- /* 7323 */ { MAD_F(0x0456fc84) /* 0.271236914 */, 19 },
- /* 7324 */ { MAD_F(0x0457304e) /* 0.271286301 */, 19 },
- /* 7325 */ { MAD_F(0x04576417) /* 0.271335689 */, 19 },
- /* 7326 */ { MAD_F(0x045797e2) /* 0.271385080 */, 19 },
- /* 7327 */ { MAD_F(0x0457cbac) /* 0.271434474 */, 19 },
-
- /* 7328 */ { MAD_F(0x0457ff78) /* 0.271483869 */, 19 },
- /* 7329 */ { MAD_F(0x04583344) /* 0.271533267 */, 19 },
- /* 7330 */ { MAD_F(0x04586711) /* 0.271582667 */, 19 },
- /* 7331 */ { MAD_F(0x04589ade) /* 0.271632069 */, 19 },
- /* 7332 */ { MAD_F(0x0458ceac) /* 0.271681474 */, 19 },
- /* 7333 */ { MAD_F(0x0459027b) /* 0.271730880 */, 19 },
- /* 7334 */ { MAD_F(0x0459364a) /* 0.271780289 */, 19 },
- /* 7335 */ { MAD_F(0x04596a19) /* 0.271829701 */, 19 },
- /* 7336 */ { MAD_F(0x04599dea) /* 0.271879114 */, 19 },
- /* 7337 */ { MAD_F(0x0459d1bb) /* 0.271928530 */, 19 },
- /* 7338 */ { MAD_F(0x045a058c) /* 0.271977948 */, 19 },
- /* 7339 */ { MAD_F(0x045a395e) /* 0.272027368 */, 19 },
- /* 7340 */ { MAD_F(0x045a6d31) /* 0.272076790 */, 19 },
- /* 7341 */ { MAD_F(0x045aa104) /* 0.272126215 */, 19 },
- /* 7342 */ { MAD_F(0x045ad4d8) /* 0.272175642 */, 19 },
- /* 7343 */ { MAD_F(0x045b08ad) /* 0.272225071 */, 19 },
-
- /* 7344 */ { MAD_F(0x045b3c82) /* 0.272274503 */, 19 },
- /* 7345 */ { MAD_F(0x045b7058) /* 0.272323936 */, 19 },
- /* 7346 */ { MAD_F(0x045ba42e) /* 0.272373372 */, 19 },
- /* 7347 */ { MAD_F(0x045bd805) /* 0.272422810 */, 19 },
- /* 7348 */ { MAD_F(0x045c0bdd) /* 0.272472251 */, 19 },
- /* 7349 */ { MAD_F(0x045c3fb5) /* 0.272521693 */, 19 },
- /* 7350 */ { MAD_F(0x045c738e) /* 0.272571138 */, 19 },
- /* 7351 */ { MAD_F(0x045ca767) /* 0.272620585 */, 19 },
- /* 7352 */ { MAD_F(0x045cdb41) /* 0.272670035 */, 19 },
- /* 7353 */ { MAD_F(0x045d0f1b) /* 0.272719486 */, 19 },
- /* 7354 */ { MAD_F(0x045d42f7) /* 0.272768940 */, 19 },
- /* 7355 */ { MAD_F(0x045d76d2) /* 0.272818396 */, 19 },
- /* 7356 */ { MAD_F(0x045daaaf) /* 0.272867855 */, 19 },
- /* 7357 */ { MAD_F(0x045dde8c) /* 0.272917315 */, 19 },
- /* 7358 */ { MAD_F(0x045e1269) /* 0.272966778 */, 19 },
- /* 7359 */ { MAD_F(0x045e4647) /* 0.273016243 */, 19 },
-
- /* 7360 */ { MAD_F(0x045e7a26) /* 0.273065710 */, 19 },
- /* 7361 */ { MAD_F(0x045eae06) /* 0.273115180 */, 19 },
- /* 7362 */ { MAD_F(0x045ee1e6) /* 0.273164652 */, 19 },
- /* 7363 */ { MAD_F(0x045f15c6) /* 0.273214126 */, 19 },
- /* 7364 */ { MAD_F(0x045f49a7) /* 0.273263602 */, 19 },
- /* 7365 */ { MAD_F(0x045f7d89) /* 0.273313081 */, 19 },
- /* 7366 */ { MAD_F(0x045fb16c) /* 0.273362561 */, 19 },
- /* 7367 */ { MAD_F(0x045fe54f) /* 0.273412044 */, 19 },
- /* 7368 */ { MAD_F(0x04601932) /* 0.273461530 */, 19 },
- /* 7369 */ { MAD_F(0x04604d16) /* 0.273511017 */, 19 },
- /* 7370 */ { MAD_F(0x046080fb) /* 0.273560507 */, 19 },
- /* 7371 */ { MAD_F(0x0460b4e1) /* 0.273609999 */, 19 },
- /* 7372 */ { MAD_F(0x0460e8c7) /* 0.273659493 */, 19 },
- /* 7373 */ { MAD_F(0x04611cad) /* 0.273708989 */, 19 },
- /* 7374 */ { MAD_F(0x04615094) /* 0.273758488 */, 19 },
- /* 7375 */ { MAD_F(0x0461847c) /* 0.273807989 */, 19 },
-
- /* 7376 */ { MAD_F(0x0461b864) /* 0.273857492 */, 19 },
- /* 7377 */ { MAD_F(0x0461ec4d) /* 0.273906997 */, 19 },
- /* 7378 */ { MAD_F(0x04622037) /* 0.273956505 */, 19 },
- /* 7379 */ { MAD_F(0x04625421) /* 0.274006015 */, 19 },
- /* 7380 */ { MAD_F(0x0462880c) /* 0.274055527 */, 19 },
- /* 7381 */ { MAD_F(0x0462bbf7) /* 0.274105041 */, 19 },
- /* 7382 */ { MAD_F(0x0462efe3) /* 0.274154558 */, 19 },
- /* 7383 */ { MAD_F(0x046323d0) /* 0.274204076 */, 19 },
- /* 7384 */ { MAD_F(0x046357bd) /* 0.274253597 */, 19 },
- /* 7385 */ { MAD_F(0x04638bab) /* 0.274303121 */, 19 },
- /* 7386 */ { MAD_F(0x0463bf99) /* 0.274352646 */, 19 },
- /* 7387 */ { MAD_F(0x0463f388) /* 0.274402174 */, 19 },
- /* 7388 */ { MAD_F(0x04642778) /* 0.274451704 */, 19 },
- /* 7389 */ { MAD_F(0x04645b68) /* 0.274501236 */, 19 },
- /* 7390 */ { MAD_F(0x04648f59) /* 0.274550771 */, 19 },
- /* 7391 */ { MAD_F(0x0464c34a) /* 0.274600307 */, 19 },
-
- /* 7392 */ { MAD_F(0x0464f73c) /* 0.274649846 */, 19 },
- /* 7393 */ { MAD_F(0x04652b2f) /* 0.274699387 */, 19 },
- /* 7394 */ { MAD_F(0x04655f22) /* 0.274748931 */, 19 },
- /* 7395 */ { MAD_F(0x04659316) /* 0.274798476 */, 19 },
- /* 7396 */ { MAD_F(0x0465c70a) /* 0.274848024 */, 19 },
- /* 7397 */ { MAD_F(0x0465faff) /* 0.274897574 */, 19 },
- /* 7398 */ { MAD_F(0x04662ef5) /* 0.274947126 */, 19 },
- /* 7399 */ { MAD_F(0x046662eb) /* 0.274996681 */, 19 },
- /* 7400 */ { MAD_F(0x046696e2) /* 0.275046238 */, 19 },
- /* 7401 */ { MAD_F(0x0466cad9) /* 0.275095797 */, 19 },
- /* 7402 */ { MAD_F(0x0466fed1) /* 0.275145358 */, 19 },
- /* 7403 */ { MAD_F(0x046732ca) /* 0.275194921 */, 19 },
- /* 7404 */ { MAD_F(0x046766c3) /* 0.275244487 */, 19 },
- /* 7405 */ { MAD_F(0x04679abd) /* 0.275294055 */, 19 },
- /* 7406 */ { MAD_F(0x0467ceb7) /* 0.275343625 */, 19 },
- /* 7407 */ { MAD_F(0x046802b2) /* 0.275393198 */, 19 },
-
- /* 7408 */ { MAD_F(0x046836ae) /* 0.275442772 */, 19 },
- /* 7409 */ { MAD_F(0x04686aaa) /* 0.275492349 */, 19 },
- /* 7410 */ { MAD_F(0x04689ea7) /* 0.275541928 */, 19 },
- /* 7411 */ { MAD_F(0x0468d2a4) /* 0.275591509 */, 19 },
- /* 7412 */ { MAD_F(0x046906a2) /* 0.275641093 */, 19 },
- /* 7413 */ { MAD_F(0x04693aa1) /* 0.275690679 */, 19 },
- /* 7414 */ { MAD_F(0x04696ea0) /* 0.275740267 */, 19 },
- /* 7415 */ { MAD_F(0x0469a2a0) /* 0.275789857 */, 19 },
- /* 7416 */ { MAD_F(0x0469d6a0) /* 0.275839449 */, 19 },
- /* 7417 */ { MAD_F(0x046a0aa1) /* 0.275889044 */, 19 },
- /* 7418 */ { MAD_F(0x046a3ea3) /* 0.275938641 */, 19 },
- /* 7419 */ { MAD_F(0x046a72a5) /* 0.275988240 */, 19 },
- /* 7420 */ { MAD_F(0x046aa6a8) /* 0.276037842 */, 19 },
- /* 7421 */ { MAD_F(0x046adaab) /* 0.276087445 */, 19 },
- /* 7422 */ { MAD_F(0x046b0eaf) /* 0.276137051 */, 19 },
- /* 7423 */ { MAD_F(0x046b42b3) /* 0.276186659 */, 19 },
-
- /* 7424 */ { MAD_F(0x046b76b9) /* 0.276236269 */, 19 },
- /* 7425 */ { MAD_F(0x046baabe) /* 0.276285882 */, 19 },
- /* 7426 */ { MAD_F(0x046bdec5) /* 0.276335497 */, 19 },
- /* 7427 */ { MAD_F(0x046c12cc) /* 0.276385113 */, 19 },
- /* 7428 */ { MAD_F(0x046c46d3) /* 0.276434733 */, 19 },
- /* 7429 */ { MAD_F(0x046c7adb) /* 0.276484354 */, 19 },
- /* 7430 */ { MAD_F(0x046caee4) /* 0.276533978 */, 19 },
- /* 7431 */ { MAD_F(0x046ce2ee) /* 0.276583604 */, 19 },
- /* 7432 */ { MAD_F(0x046d16f7) /* 0.276633232 */, 19 },
- /* 7433 */ { MAD_F(0x046d4b02) /* 0.276682862 */, 19 },
- /* 7434 */ { MAD_F(0x046d7f0d) /* 0.276732495 */, 19 },
- /* 7435 */ { MAD_F(0x046db319) /* 0.276782129 */, 19 },
- /* 7436 */ { MAD_F(0x046de725) /* 0.276831766 */, 19 },
- /* 7437 */ { MAD_F(0x046e1b32) /* 0.276881406 */, 19 },
- /* 7438 */ { MAD_F(0x046e4f40) /* 0.276931047 */, 19 },
- /* 7439 */ { MAD_F(0x046e834e) /* 0.276980691 */, 19 },
-
- /* 7440 */ { MAD_F(0x046eb75c) /* 0.277030337 */, 19 },
- /* 7441 */ { MAD_F(0x046eeb6c) /* 0.277079985 */, 19 },
- /* 7442 */ { MAD_F(0x046f1f7c) /* 0.277129635 */, 19 },
- /* 7443 */ { MAD_F(0x046f538c) /* 0.277179288 */, 19 },
- /* 7444 */ { MAD_F(0x046f879d) /* 0.277228942 */, 19 },
- /* 7445 */ { MAD_F(0x046fbbaf) /* 0.277278600 */, 19 },
- /* 7446 */ { MAD_F(0x046fefc1) /* 0.277328259 */, 19 },
- /* 7447 */ { MAD_F(0x047023d4) /* 0.277377920 */, 19 },
- /* 7448 */ { MAD_F(0x047057e8) /* 0.277427584 */, 19 },
- /* 7449 */ { MAD_F(0x04708bfc) /* 0.277477250 */, 19 },
- /* 7450 */ { MAD_F(0x0470c011) /* 0.277526918 */, 19 },
- /* 7451 */ { MAD_F(0x0470f426) /* 0.277576588 */, 19 },
- /* 7452 */ { MAD_F(0x0471283c) /* 0.277626261 */, 19 },
- /* 7453 */ { MAD_F(0x04715c52) /* 0.277675936 */, 19 },
- /* 7454 */ { MAD_F(0x04719069) /* 0.277725613 */, 19 },
- /* 7455 */ { MAD_F(0x0471c481) /* 0.277775292 */, 19 },
-
- /* 7456 */ { MAD_F(0x0471f899) /* 0.277824973 */, 19 },
- /* 7457 */ { MAD_F(0x04722cb2) /* 0.277874657 */, 19 },
- /* 7458 */ { MAD_F(0x047260cc) /* 0.277924343 */, 19 },
- /* 7459 */ { MAD_F(0x047294e6) /* 0.277974031 */, 19 },
- /* 7460 */ { MAD_F(0x0472c900) /* 0.278023722 */, 19 },
- /* 7461 */ { MAD_F(0x0472fd1b) /* 0.278073414 */, 19 },
- /* 7462 */ { MAD_F(0x04733137) /* 0.278123109 */, 19 },
- /* 7463 */ { MAD_F(0x04736554) /* 0.278172806 */, 19 },
- /* 7464 */ { MAD_F(0x04739971) /* 0.278222505 */, 19 },
- /* 7465 */ { MAD_F(0x0473cd8e) /* 0.278272207 */, 19 },
- /* 7466 */ { MAD_F(0x047401ad) /* 0.278321910 */, 19 },
- /* 7467 */ { MAD_F(0x047435cb) /* 0.278371616 */, 19 },
- /* 7468 */ { MAD_F(0x047469eb) /* 0.278421324 */, 19 },
- /* 7469 */ { MAD_F(0x04749e0b) /* 0.278471035 */, 19 },
- /* 7470 */ { MAD_F(0x0474d22c) /* 0.278520747 */, 19 },
- /* 7471 */ { MAD_F(0x0475064d) /* 0.278570462 */, 19 },
-
- /* 7472 */ { MAD_F(0x04753a6f) /* 0.278620179 */, 19 },
- /* 7473 */ { MAD_F(0x04756e91) /* 0.278669898 */, 19 },
- /* 7474 */ { MAD_F(0x0475a2b4) /* 0.278719619 */, 19 },
- /* 7475 */ { MAD_F(0x0475d6d7) /* 0.278769343 */, 19 },
- /* 7476 */ { MAD_F(0x04760afc) /* 0.278819069 */, 19 },
- /* 7477 */ { MAD_F(0x04763f20) /* 0.278868797 */, 19 },
- /* 7478 */ { MAD_F(0x04767346) /* 0.278918527 */, 19 },
- /* 7479 */ { MAD_F(0x0476a76c) /* 0.278968260 */, 19 },
- /* 7480 */ { MAD_F(0x0476db92) /* 0.279017995 */, 19 },
- /* 7481 */ { MAD_F(0x04770fba) /* 0.279067731 */, 19 },
- /* 7482 */ { MAD_F(0x047743e1) /* 0.279117471 */, 19 },
- /* 7483 */ { MAD_F(0x0477780a) /* 0.279167212 */, 19 },
- /* 7484 */ { MAD_F(0x0477ac33) /* 0.279216956 */, 19 },
- /* 7485 */ { MAD_F(0x0477e05c) /* 0.279266701 */, 19 },
- /* 7486 */ { MAD_F(0x04781486) /* 0.279316449 */, 19 },
- /* 7487 */ { MAD_F(0x047848b1) /* 0.279366200 */, 19 },
-
- /* 7488 */ { MAD_F(0x04787cdc) /* 0.279415952 */, 19 },
- /* 7489 */ { MAD_F(0x0478b108) /* 0.279465707 */, 19 },
- /* 7490 */ { MAD_F(0x0478e535) /* 0.279515464 */, 19 },
- /* 7491 */ { MAD_F(0x04791962) /* 0.279565223 */, 19 },
- /* 7492 */ { MAD_F(0x04794d8f) /* 0.279614984 */, 19 },
- /* 7493 */ { MAD_F(0x047981be) /* 0.279664748 */, 19 },
- /* 7494 */ { MAD_F(0x0479b5ed) /* 0.279714513 */, 19 },
- /* 7495 */ { MAD_F(0x0479ea1c) /* 0.279764281 */, 19 },
- /* 7496 */ { MAD_F(0x047a1e4c) /* 0.279814051 */, 19 },
- /* 7497 */ { MAD_F(0x047a527d) /* 0.279863824 */, 19 },
- /* 7498 */ { MAD_F(0x047a86ae) /* 0.279913598 */, 19 },
- /* 7499 */ { MAD_F(0x047abae0) /* 0.279963375 */, 19 },
- /* 7500 */ { MAD_F(0x047aef12) /* 0.280013154 */, 19 },
- /* 7501 */ { MAD_F(0x047b2346) /* 0.280062935 */, 19 },
- /* 7502 */ { MAD_F(0x047b5779) /* 0.280112719 */, 19 },
- /* 7503 */ { MAD_F(0x047b8bad) /* 0.280162504 */, 19 },
-
- /* 7504 */ { MAD_F(0x047bbfe2) /* 0.280212292 */, 19 },
- /* 7505 */ { MAD_F(0x047bf418) /* 0.280262082 */, 19 },
- /* 7506 */ { MAD_F(0x047c284e) /* 0.280311875 */, 19 },
- /* 7507 */ { MAD_F(0x047c5c84) /* 0.280361669 */, 19 },
- /* 7508 */ { MAD_F(0x047c90bb) /* 0.280411466 */, 19 },
- /* 7509 */ { MAD_F(0x047cc4f3) /* 0.280461265 */, 19 },
- /* 7510 */ { MAD_F(0x047cf92c) /* 0.280511066 */, 19 },
- /* 7511 */ { MAD_F(0x047d2d65) /* 0.280560869 */, 19 },
- /* 7512 */ { MAD_F(0x047d619e) /* 0.280610675 */, 19 },
- /* 7513 */ { MAD_F(0x047d95d8) /* 0.280660483 */, 19 },
- /* 7514 */ { MAD_F(0x047dca13) /* 0.280710292 */, 19 },
- /* 7515 */ { MAD_F(0x047dfe4e) /* 0.280760105 */, 19 },
- /* 7516 */ { MAD_F(0x047e328a) /* 0.280809919 */, 19 },
- /* 7517 */ { MAD_F(0x047e66c7) /* 0.280859736 */, 19 },
- /* 7518 */ { MAD_F(0x047e9b04) /* 0.280909554 */, 19 },
- /* 7519 */ { MAD_F(0x047ecf42) /* 0.280959375 */, 19 },
-
- /* 7520 */ { MAD_F(0x047f0380) /* 0.281009199 */, 19 },
- /* 7521 */ { MAD_F(0x047f37bf) /* 0.281059024 */, 19 },
- /* 7522 */ { MAD_F(0x047f6bff) /* 0.281108852 */, 19 },
- /* 7523 */ { MAD_F(0x047fa03f) /* 0.281158682 */, 19 },
- /* 7524 */ { MAD_F(0x047fd47f) /* 0.281208514 */, 19 },
- /* 7525 */ { MAD_F(0x048008c1) /* 0.281258348 */, 19 },
- /* 7526 */ { MAD_F(0x04803d02) /* 0.281308184 */, 19 },
- /* 7527 */ { MAD_F(0x04807145) /* 0.281358023 */, 19 },
- /* 7528 */ { MAD_F(0x0480a588) /* 0.281407864 */, 19 },
- /* 7529 */ { MAD_F(0x0480d9cc) /* 0.281457707 */, 19 },
- /* 7530 */ { MAD_F(0x04810e10) /* 0.281507552 */, 19 },
- /* 7531 */ { MAD_F(0x04814255) /* 0.281557400 */, 19 },
- /* 7532 */ { MAD_F(0x0481769a) /* 0.281607250 */, 19 },
- /* 7533 */ { MAD_F(0x0481aae0) /* 0.281657101 */, 19 },
- /* 7534 */ { MAD_F(0x0481df27) /* 0.281706956 */, 19 },
- /* 7535 */ { MAD_F(0x0482136e) /* 0.281756812 */, 19 },
-
- /* 7536 */ { MAD_F(0x048247b6) /* 0.281806670 */, 19 },
- /* 7537 */ { MAD_F(0x04827bfe) /* 0.281856531 */, 19 },
- /* 7538 */ { MAD_F(0x0482b047) /* 0.281906394 */, 19 },
- /* 7539 */ { MAD_F(0x0482e491) /* 0.281956259 */, 19 },
- /* 7540 */ { MAD_F(0x048318db) /* 0.282006127 */, 19 },
- /* 7541 */ { MAD_F(0x04834d26) /* 0.282055996 */, 19 },
- /* 7542 */ { MAD_F(0x04838171) /* 0.282105868 */, 19 },
- /* 7543 */ { MAD_F(0x0483b5bd) /* 0.282155742 */, 19 },
- /* 7544 */ { MAD_F(0x0483ea0a) /* 0.282205618 */, 19 },
- /* 7545 */ { MAD_F(0x04841e57) /* 0.282255496 */, 19 },
- /* 7546 */ { MAD_F(0x048452a4) /* 0.282305377 */, 19 },
- /* 7547 */ { MAD_F(0x048486f3) /* 0.282355260 */, 19 },
- /* 7548 */ { MAD_F(0x0484bb42) /* 0.282405145 */, 19 },
- /* 7549 */ { MAD_F(0x0484ef91) /* 0.282455032 */, 19 },
- /* 7550 */ { MAD_F(0x048523e1) /* 0.282504921 */, 19 },
- /* 7551 */ { MAD_F(0x04855832) /* 0.282554813 */, 19 },
-
- /* 7552 */ { MAD_F(0x04858c83) /* 0.282604707 */, 19 },
- /* 7553 */ { MAD_F(0x0485c0d5) /* 0.282654603 */, 19 },
- /* 7554 */ { MAD_F(0x0485f527) /* 0.282704501 */, 19 },
- /* 7555 */ { MAD_F(0x0486297a) /* 0.282754401 */, 19 },
- /* 7556 */ { MAD_F(0x04865dce) /* 0.282804304 */, 19 },
- /* 7557 */ { MAD_F(0x04869222) /* 0.282854209 */, 19 },
- /* 7558 */ { MAD_F(0x0486c677) /* 0.282904116 */, 19 },
- /* 7559 */ { MAD_F(0x0486facc) /* 0.282954025 */, 19 },
- /* 7560 */ { MAD_F(0x04872f22) /* 0.283003936 */, 19 },
- /* 7561 */ { MAD_F(0x04876379) /* 0.283053850 */, 19 },
- /* 7562 */ { MAD_F(0x048797d0) /* 0.283103766 */, 19 },
- /* 7563 */ { MAD_F(0x0487cc28) /* 0.283153684 */, 19 },
- /* 7564 */ { MAD_F(0x04880080) /* 0.283203604 */, 19 },
- /* 7565 */ { MAD_F(0x048834d9) /* 0.283253527 */, 19 },
- /* 7566 */ { MAD_F(0x04886933) /* 0.283303451 */, 19 },
- /* 7567 */ { MAD_F(0x04889d8d) /* 0.283353378 */, 19 },
-
- /* 7568 */ { MAD_F(0x0488d1e8) /* 0.283403307 */, 19 },
- /* 7569 */ { MAD_F(0x04890643) /* 0.283453238 */, 19 },
- /* 7570 */ { MAD_F(0x04893a9f) /* 0.283503172 */, 19 },
- /* 7571 */ { MAD_F(0x04896efb) /* 0.283553107 */, 19 },
- /* 7572 */ { MAD_F(0x0489a358) /* 0.283603045 */, 19 },
- /* 7573 */ { MAD_F(0x0489d7b6) /* 0.283652985 */, 19 },
- /* 7574 */ { MAD_F(0x048a0c14) /* 0.283702927 */, 19 },
- /* 7575 */ { MAD_F(0x048a4073) /* 0.283752872 */, 19 },
- /* 7576 */ { MAD_F(0x048a74d3) /* 0.283802818 */, 19 },
- /* 7577 */ { MAD_F(0x048aa933) /* 0.283852767 */, 19 },
- /* 7578 */ { MAD_F(0x048add93) /* 0.283902718 */, 19 },
- /* 7579 */ { MAD_F(0x048b11f5) /* 0.283952671 */, 19 },
- /* 7580 */ { MAD_F(0x048b4656) /* 0.284002627 */, 19 },
- /* 7581 */ { MAD_F(0x048b7ab9) /* 0.284052584 */, 19 },
- /* 7582 */ { MAD_F(0x048baf1c) /* 0.284102544 */, 19 },
- /* 7583 */ { MAD_F(0x048be37f) /* 0.284152506 */, 19 },
-
- /* 7584 */ { MAD_F(0x048c17e3) /* 0.284202470 */, 19 },
- /* 7585 */ { MAD_F(0x048c4c48) /* 0.284252436 */, 19 },
- /* 7586 */ { MAD_F(0x048c80ad) /* 0.284302405 */, 19 },
- /* 7587 */ { MAD_F(0x048cb513) /* 0.284352376 */, 19 },
- /* 7588 */ { MAD_F(0x048ce97a) /* 0.284402349 */, 19 },
- /* 7589 */ { MAD_F(0x048d1de1) /* 0.284452324 */, 19 },
- /* 7590 */ { MAD_F(0x048d5249) /* 0.284502301 */, 19 },
- /* 7591 */ { MAD_F(0x048d86b1) /* 0.284552281 */, 19 },
- /* 7592 */ { MAD_F(0x048dbb1a) /* 0.284602263 */, 19 },
- /* 7593 */ { MAD_F(0x048def83) /* 0.284652246 */, 19 },
- /* 7594 */ { MAD_F(0x048e23ed) /* 0.284702233 */, 19 },
- /* 7595 */ { MAD_F(0x048e5858) /* 0.284752221 */, 19 },
- /* 7596 */ { MAD_F(0x048e8cc3) /* 0.284802211 */, 19 },
- /* 7597 */ { MAD_F(0x048ec12f) /* 0.284852204 */, 19 },
- /* 7598 */ { MAD_F(0x048ef59b) /* 0.284902199 */, 19 },
- /* 7599 */ { MAD_F(0x048f2a08) /* 0.284952196 */, 19 },
-
- /* 7600 */ { MAD_F(0x048f5e76) /* 0.285002195 */, 19 },
- /* 7601 */ { MAD_F(0x048f92e4) /* 0.285052197 */, 19 },
- /* 7602 */ { MAD_F(0x048fc753) /* 0.285102201 */, 19 },
- /* 7603 */ { MAD_F(0x048ffbc2) /* 0.285152206 */, 19 },
- /* 7604 */ { MAD_F(0x04903032) /* 0.285202214 */, 19 },
- /* 7605 */ { MAD_F(0x049064a3) /* 0.285252225 */, 19 },
- /* 7606 */ { MAD_F(0x04909914) /* 0.285302237 */, 19 },
- /* 7607 */ { MAD_F(0x0490cd86) /* 0.285352252 */, 19 },
- /* 7608 */ { MAD_F(0x049101f8) /* 0.285402269 */, 19 },
- /* 7609 */ { MAD_F(0x0491366b) /* 0.285452288 */, 19 },
- /* 7610 */ { MAD_F(0x04916ade) /* 0.285502309 */, 19 },
- /* 7611 */ { MAD_F(0x04919f52) /* 0.285552332 */, 19 },
- /* 7612 */ { MAD_F(0x0491d3c7) /* 0.285602358 */, 19 },
- /* 7613 */ { MAD_F(0x0492083c) /* 0.285652386 */, 19 },
- /* 7614 */ { MAD_F(0x04923cb2) /* 0.285702416 */, 19 },
- /* 7615 */ { MAD_F(0x04927128) /* 0.285752448 */, 19 },
-
- /* 7616 */ { MAD_F(0x0492a59f) /* 0.285802482 */, 19 },
- /* 7617 */ { MAD_F(0x0492da17) /* 0.285852519 */, 19 },
- /* 7618 */ { MAD_F(0x04930e8f) /* 0.285902557 */, 19 },
- /* 7619 */ { MAD_F(0x04934308) /* 0.285952598 */, 19 },
- /* 7620 */ { MAD_F(0x04937781) /* 0.286002641 */, 19 },
- /* 7621 */ { MAD_F(0x0493abfb) /* 0.286052687 */, 19 },
- /* 7622 */ { MAD_F(0x0493e076) /* 0.286102734 */, 19 },
- /* 7623 */ { MAD_F(0x049414f1) /* 0.286152784 */, 19 },
- /* 7624 */ { MAD_F(0x0494496c) /* 0.286202836 */, 19 },
- /* 7625 */ { MAD_F(0x04947de9) /* 0.286252890 */, 19 },
- /* 7626 */ { MAD_F(0x0494b266) /* 0.286302946 */, 19 },
- /* 7627 */ { MAD_F(0x0494e6e3) /* 0.286353005 */, 19 },
- /* 7628 */ { MAD_F(0x04951b61) /* 0.286403065 */, 19 },
- /* 7629 */ { MAD_F(0x04954fe0) /* 0.286453128 */, 19 },
- /* 7630 */ { MAD_F(0x0495845f) /* 0.286503193 */, 19 },
- /* 7631 */ { MAD_F(0x0495b8df) /* 0.286553260 */, 19 },
-
- /* 7632 */ { MAD_F(0x0495ed5f) /* 0.286603329 */, 19 },
- /* 7633 */ { MAD_F(0x049621e0) /* 0.286653401 */, 19 },
- /* 7634 */ { MAD_F(0x04965662) /* 0.286703475 */, 19 },
- /* 7635 */ { MAD_F(0x04968ae4) /* 0.286753551 */, 19 },
- /* 7636 */ { MAD_F(0x0496bf67) /* 0.286803629 */, 19 },
- /* 7637 */ { MAD_F(0x0496f3ea) /* 0.286853709 */, 19 },
- /* 7638 */ { MAD_F(0x0497286e) /* 0.286903792 */, 19 },
- /* 7639 */ { MAD_F(0x04975cf2) /* 0.286953876 */, 19 },
- /* 7640 */ { MAD_F(0x04979177) /* 0.287003963 */, 19 },
- /* 7641 */ { MAD_F(0x0497c5fd) /* 0.287054052 */, 19 },
- /* 7642 */ { MAD_F(0x0497fa83) /* 0.287104143 */, 19 },
- /* 7643 */ { MAD_F(0x04982f0a) /* 0.287154237 */, 19 },
- /* 7644 */ { MAD_F(0x04986392) /* 0.287204332 */, 19 },
- /* 7645 */ { MAD_F(0x0498981a) /* 0.287254430 */, 19 },
- /* 7646 */ { MAD_F(0x0498cca2) /* 0.287304530 */, 19 },
- /* 7647 */ { MAD_F(0x0499012c) /* 0.287354632 */, 19 },
-
- /* 7648 */ { MAD_F(0x049935b5) /* 0.287404737 */, 19 },
- /* 7649 */ { MAD_F(0x04996a40) /* 0.287454843 */, 19 },
- /* 7650 */ { MAD_F(0x04999ecb) /* 0.287504952 */, 19 },
- /* 7651 */ { MAD_F(0x0499d356) /* 0.287555063 */, 19 },
- /* 7652 */ { MAD_F(0x049a07e2) /* 0.287605176 */, 19 },
- /* 7653 */ { MAD_F(0x049a3c6f) /* 0.287655291 */, 19 },
- /* 7654 */ { MAD_F(0x049a70fc) /* 0.287705409 */, 19 },
- /* 7655 */ { MAD_F(0x049aa58a) /* 0.287755528 */, 19 },
- /* 7656 */ { MAD_F(0x049ada19) /* 0.287805650 */, 19 },
- /* 7657 */ { MAD_F(0x049b0ea8) /* 0.287855774 */, 19 },
- /* 7658 */ { MAD_F(0x049b4337) /* 0.287905900 */, 19 },
- /* 7659 */ { MAD_F(0x049b77c8) /* 0.287956028 */, 19 },
- /* 7660 */ { MAD_F(0x049bac58) /* 0.288006159 */, 19 },
- /* 7661 */ { MAD_F(0x049be0ea) /* 0.288056292 */, 19 },
- /* 7662 */ { MAD_F(0x049c157c) /* 0.288106427 */, 19 },
- /* 7663 */ { MAD_F(0x049c4a0e) /* 0.288156564 */, 19 },
-
- /* 7664 */ { MAD_F(0x049c7ea1) /* 0.288206703 */, 19 },
- /* 7665 */ { MAD_F(0x049cb335) /* 0.288256844 */, 19 },
- /* 7666 */ { MAD_F(0x049ce7ca) /* 0.288306988 */, 19 },
- /* 7667 */ { MAD_F(0x049d1c5e) /* 0.288357134 */, 19 },
- /* 7668 */ { MAD_F(0x049d50f4) /* 0.288407282 */, 19 },
- /* 7669 */ { MAD_F(0x049d858a) /* 0.288457432 */, 19 },
- /* 7670 */ { MAD_F(0x049dba21) /* 0.288507584 */, 19 },
- /* 7671 */ { MAD_F(0x049deeb8) /* 0.288557739 */, 19 },
- /* 7672 */ { MAD_F(0x049e2350) /* 0.288607895 */, 19 },
- /* 7673 */ { MAD_F(0x049e57e8) /* 0.288658054 */, 19 },
- /* 7674 */ { MAD_F(0x049e8c81) /* 0.288708215 */, 19 },
- /* 7675 */ { MAD_F(0x049ec11b) /* 0.288758379 */, 19 },
- /* 7676 */ { MAD_F(0x049ef5b5) /* 0.288808544 */, 19 },
- /* 7677 */ { MAD_F(0x049f2a50) /* 0.288858712 */, 19 },
- /* 7678 */ { MAD_F(0x049f5eeb) /* 0.288908881 */, 19 },
- /* 7679 */ { MAD_F(0x049f9387) /* 0.288959053 */, 19 },
-
- /* 7680 */ { MAD_F(0x049fc824) /* 0.289009227 */, 19 },
- /* 7681 */ { MAD_F(0x049ffcc1) /* 0.289059404 */, 19 },
- /* 7682 */ { MAD_F(0x04a0315e) /* 0.289109582 */, 19 },
- /* 7683 */ { MAD_F(0x04a065fd) /* 0.289159763 */, 19 },
- /* 7684 */ { MAD_F(0x04a09a9b) /* 0.289209946 */, 19 },
- /* 7685 */ { MAD_F(0x04a0cf3b) /* 0.289260131 */, 19 },
- /* 7686 */ { MAD_F(0x04a103db) /* 0.289310318 */, 19 },
- /* 7687 */ { MAD_F(0x04a1387b) /* 0.289360507 */, 19 },
- /* 7688 */ { MAD_F(0x04a16d1d) /* 0.289410699 */, 19 },
- /* 7689 */ { MAD_F(0x04a1a1be) /* 0.289460893 */, 19 },
- /* 7690 */ { MAD_F(0x04a1d661) /* 0.289511088 */, 19 },
- /* 7691 */ { MAD_F(0x04a20b04) /* 0.289561287 */, 19 },
- /* 7692 */ { MAD_F(0x04a23fa7) /* 0.289611487 */, 19 },
- /* 7693 */ { MAD_F(0x04a2744b) /* 0.289661689 */, 19 },
- /* 7694 */ { MAD_F(0x04a2a8f0) /* 0.289711894 */, 19 },
- /* 7695 */ { MAD_F(0x04a2dd95) /* 0.289762101 */, 19 },
-
- /* 7696 */ { MAD_F(0x04a3123b) /* 0.289812309 */, 19 },
- /* 7697 */ { MAD_F(0x04a346e2) /* 0.289862521 */, 19 },
- /* 7698 */ { MAD_F(0x04a37b89) /* 0.289912734 */, 19 },
- /* 7699 */ { MAD_F(0x04a3b030) /* 0.289962949 */, 19 },
- /* 7700 */ { MAD_F(0x04a3e4d8) /* 0.290013167 */, 19 },
- /* 7701 */ { MAD_F(0x04a41981) /* 0.290063387 */, 19 },
- /* 7702 */ { MAD_F(0x04a44e2b) /* 0.290113609 */, 19 },
- /* 7703 */ { MAD_F(0x04a482d5) /* 0.290163833 */, 19 },
- /* 7704 */ { MAD_F(0x04a4b77f) /* 0.290214059 */, 19 },
- /* 7705 */ { MAD_F(0x04a4ec2a) /* 0.290264288 */, 19 },
- /* 7706 */ { MAD_F(0x04a520d6) /* 0.290314519 */, 19 },
- /* 7707 */ { MAD_F(0x04a55582) /* 0.290364751 */, 19 },
- /* 7708 */ { MAD_F(0x04a58a2f) /* 0.290414986 */, 19 },
- /* 7709 */ { MAD_F(0x04a5bedd) /* 0.290465224 */, 19 },
- /* 7710 */ { MAD_F(0x04a5f38b) /* 0.290515463 */, 19 },
- /* 7711 */ { MAD_F(0x04a62839) /* 0.290565705 */, 19 },
-
- /* 7712 */ { MAD_F(0x04a65ce8) /* 0.290615948 */, 19 },
- /* 7713 */ { MAD_F(0x04a69198) /* 0.290666194 */, 19 },
- /* 7714 */ { MAD_F(0x04a6c648) /* 0.290716442 */, 19 },
- /* 7715 */ { MAD_F(0x04a6faf9) /* 0.290766692 */, 19 },
- /* 7716 */ { MAD_F(0x04a72fab) /* 0.290816945 */, 19 },
- /* 7717 */ { MAD_F(0x04a7645d) /* 0.290867199 */, 19 },
- /* 7718 */ { MAD_F(0x04a79910) /* 0.290917456 */, 19 },
- /* 7719 */ { MAD_F(0x04a7cdc3) /* 0.290967715 */, 19 },
- /* 7720 */ { MAD_F(0x04a80277) /* 0.291017976 */, 19 },
- /* 7721 */ { MAD_F(0x04a8372b) /* 0.291068239 */, 19 },
- /* 7722 */ { MAD_F(0x04a86be0) /* 0.291118505 */, 19 },
- /* 7723 */ { MAD_F(0x04a8a096) /* 0.291168772 */, 19 },
- /* 7724 */ { MAD_F(0x04a8d54c) /* 0.291219042 */, 19 },
- /* 7725 */ { MAD_F(0x04a90a03) /* 0.291269314 */, 19 },
- /* 7726 */ { MAD_F(0x04a93eba) /* 0.291319588 */, 19 },
- /* 7727 */ { MAD_F(0x04a97372) /* 0.291369865 */, 19 },
-
- /* 7728 */ { MAD_F(0x04a9a82b) /* 0.291420143 */, 19 },
- /* 7729 */ { MAD_F(0x04a9dce4) /* 0.291470424 */, 19 },
- /* 7730 */ { MAD_F(0x04aa119d) /* 0.291520706 */, 19 },
- /* 7731 */ { MAD_F(0x04aa4658) /* 0.291570991 */, 19 },
- /* 7732 */ { MAD_F(0x04aa7b13) /* 0.291621278 */, 19 },
- /* 7733 */ { MAD_F(0x04aaafce) /* 0.291671568 */, 19 },
- /* 7734 */ { MAD_F(0x04aae48a) /* 0.291721859 */, 19 },
- /* 7735 */ { MAD_F(0x04ab1947) /* 0.291772153 */, 19 },
- /* 7736 */ { MAD_F(0x04ab4e04) /* 0.291822449 */, 19 },
- /* 7737 */ { MAD_F(0x04ab82c2) /* 0.291872747 */, 19 },
- /* 7738 */ { MAD_F(0x04abb780) /* 0.291923047 */, 19 },
- /* 7739 */ { MAD_F(0x04abec3f) /* 0.291973349 */, 19 },
- /* 7740 */ { MAD_F(0x04ac20fe) /* 0.292023653 */, 19 },
- /* 7741 */ { MAD_F(0x04ac55be) /* 0.292073960 */, 19 },
- /* 7742 */ { MAD_F(0x04ac8a7f) /* 0.292124269 */, 19 },
- /* 7743 */ { MAD_F(0x04acbf40) /* 0.292174580 */, 19 },
-
- /* 7744 */ { MAD_F(0x04acf402) /* 0.292224893 */, 19 },
- /* 7745 */ { MAD_F(0x04ad28c5) /* 0.292275208 */, 19 },
- /* 7746 */ { MAD_F(0x04ad5d88) /* 0.292325526 */, 19 },
- /* 7747 */ { MAD_F(0x04ad924b) /* 0.292375845 */, 19 },
- /* 7748 */ { MAD_F(0x04adc70f) /* 0.292426167 */, 19 },
- /* 7749 */ { MAD_F(0x04adfbd4) /* 0.292476491 */, 19 },
- /* 7750 */ { MAD_F(0x04ae3099) /* 0.292526817 */, 19 },
- /* 7751 */ { MAD_F(0x04ae655f) /* 0.292577145 */, 19 },
- /* 7752 */ { MAD_F(0x04ae9a26) /* 0.292627476 */, 19 },
- /* 7753 */ { MAD_F(0x04aeceed) /* 0.292677808 */, 19 },
- /* 7754 */ { MAD_F(0x04af03b4) /* 0.292728143 */, 19 },
- /* 7755 */ { MAD_F(0x04af387d) /* 0.292778480 */, 19 },
- /* 7756 */ { MAD_F(0x04af6d45) /* 0.292828819 */, 19 },
- /* 7757 */ { MAD_F(0x04afa20f) /* 0.292879160 */, 19 },
- /* 7758 */ { MAD_F(0x04afd6d9) /* 0.292929504 */, 19 },
- /* 7759 */ { MAD_F(0x04b00ba3) /* 0.292979849 */, 19 },
-
- /* 7760 */ { MAD_F(0x04b0406e) /* 0.293030197 */, 19 },
- /* 7761 */ { MAD_F(0x04b0753a) /* 0.293080547 */, 19 },
- /* 7762 */ { MAD_F(0x04b0aa06) /* 0.293130899 */, 19 },
- /* 7763 */ { MAD_F(0x04b0ded3) /* 0.293181253 */, 19 },
- /* 7764 */ { MAD_F(0x04b113a1) /* 0.293231610 */, 19 },
- /* 7765 */ { MAD_F(0x04b1486f) /* 0.293281968 */, 19 },
- /* 7766 */ { MAD_F(0x04b17d3d) /* 0.293332329 */, 19 },
- /* 7767 */ { MAD_F(0x04b1b20c) /* 0.293382692 */, 19 },
- /* 7768 */ { MAD_F(0x04b1e6dc) /* 0.293433057 */, 19 },
- /* 7769 */ { MAD_F(0x04b21bad) /* 0.293483424 */, 19 },
- /* 7770 */ { MAD_F(0x04b2507d) /* 0.293533794 */, 19 },
- /* 7771 */ { MAD_F(0x04b2854f) /* 0.293584165 */, 19 },
- /* 7772 */ { MAD_F(0x04b2ba21) /* 0.293634539 */, 19 },
- /* 7773 */ { MAD_F(0x04b2eef4) /* 0.293684915 */, 19 },
- /* 7774 */ { MAD_F(0x04b323c7) /* 0.293735293 */, 19 },
- /* 7775 */ { MAD_F(0x04b3589b) /* 0.293785673 */, 19 },
-
- /* 7776 */ { MAD_F(0x04b38d6f) /* 0.293836055 */, 19 },
- /* 7777 */ { MAD_F(0x04b3c244) /* 0.293886440 */, 19 },
- /* 7778 */ { MAD_F(0x04b3f71a) /* 0.293936826 */, 19 },
- /* 7779 */ { MAD_F(0x04b42bf0) /* 0.293987215 */, 19 },
- /* 7780 */ { MAD_F(0x04b460c7) /* 0.294037606 */, 19 },
- /* 7781 */ { MAD_F(0x04b4959e) /* 0.294087999 */, 19 },
- /* 7782 */ { MAD_F(0x04b4ca76) /* 0.294138395 */, 19 },
- /* 7783 */ { MAD_F(0x04b4ff4e) /* 0.294188792 */, 19 },
- /* 7784 */ { MAD_F(0x04b53427) /* 0.294239192 */, 19 },
- /* 7785 */ { MAD_F(0x04b56901) /* 0.294289593 */, 19 },
- /* 7786 */ { MAD_F(0x04b59ddb) /* 0.294339997 */, 19 },
- /* 7787 */ { MAD_F(0x04b5d2b6) /* 0.294390403 */, 19 },
- /* 7788 */ { MAD_F(0x04b60791) /* 0.294440812 */, 19 },
- /* 7789 */ { MAD_F(0x04b63c6d) /* 0.294491222 */, 19 },
- /* 7790 */ { MAD_F(0x04b6714a) /* 0.294541635 */, 19 },
- /* 7791 */ { MAD_F(0x04b6a627) /* 0.294592049 */, 19 },
-
- /* 7792 */ { MAD_F(0x04b6db05) /* 0.294642466 */, 19 },
- /* 7793 */ { MAD_F(0x04b70fe3) /* 0.294692885 */, 19 },
- /* 7794 */ { MAD_F(0x04b744c2) /* 0.294743306 */, 19 },
- /* 7795 */ { MAD_F(0x04b779a1) /* 0.294793730 */, 19 },
- /* 7796 */ { MAD_F(0x04b7ae81) /* 0.294844155 */, 19 },
- /* 7797 */ { MAD_F(0x04b7e362) /* 0.294894583 */, 19 },
- /* 7798 */ { MAD_F(0x04b81843) /* 0.294945013 */, 19 },
- /* 7799 */ { MAD_F(0x04b84d24) /* 0.294995445 */, 19 },
- /* 7800 */ { MAD_F(0x04b88207) /* 0.295045879 */, 19 },
- /* 7801 */ { MAD_F(0x04b8b6ea) /* 0.295096315 */, 19 },
- /* 7802 */ { MAD_F(0x04b8ebcd) /* 0.295146753 */, 19 },
- /* 7803 */ { MAD_F(0x04b920b1) /* 0.295197194 */, 19 },
- /* 7804 */ { MAD_F(0x04b95596) /* 0.295247637 */, 19 },
- /* 7805 */ { MAD_F(0x04b98a7b) /* 0.295298082 */, 19 },
- /* 7806 */ { MAD_F(0x04b9bf61) /* 0.295348529 */, 19 },
- /* 7807 */ { MAD_F(0x04b9f447) /* 0.295398978 */, 19 },
-
- /* 7808 */ { MAD_F(0x04ba292e) /* 0.295449429 */, 19 },
- /* 7809 */ { MAD_F(0x04ba5e16) /* 0.295499883 */, 19 },
- /* 7810 */ { MAD_F(0x04ba92fe) /* 0.295550338 */, 19 },
- /* 7811 */ { MAD_F(0x04bac7e6) /* 0.295600796 */, 19 },
- /* 7812 */ { MAD_F(0x04bafcd0) /* 0.295651256 */, 19 },
- /* 7813 */ { MAD_F(0x04bb31b9) /* 0.295701718 */, 19 },
- /* 7814 */ { MAD_F(0x04bb66a4) /* 0.295752183 */, 19 },
- /* 7815 */ { MAD_F(0x04bb9b8f) /* 0.295802649 */, 19 },
- /* 7816 */ { MAD_F(0x04bbd07a) /* 0.295853118 */, 19 },
- /* 7817 */ { MAD_F(0x04bc0566) /* 0.295903588 */, 19 },
- /* 7818 */ { MAD_F(0x04bc3a53) /* 0.295954061 */, 19 },
- /* 7819 */ { MAD_F(0x04bc6f40) /* 0.296004536 */, 19 },
- /* 7820 */ { MAD_F(0x04bca42e) /* 0.296055013 */, 19 },
- /* 7821 */ { MAD_F(0x04bcd91d) /* 0.296105493 */, 19 },
- /* 7822 */ { MAD_F(0x04bd0e0c) /* 0.296155974 */, 19 },
- /* 7823 */ { MAD_F(0x04bd42fb) /* 0.296206458 */, 19 },
-
- /* 7824 */ { MAD_F(0x04bd77ec) /* 0.296256944 */, 19 },
- /* 7825 */ { MAD_F(0x04bdacdc) /* 0.296307432 */, 19 },
- /* 7826 */ { MAD_F(0x04bde1ce) /* 0.296357922 */, 19 },
- /* 7827 */ { MAD_F(0x04be16c0) /* 0.296408414 */, 19 },
- /* 7828 */ { MAD_F(0x04be4bb2) /* 0.296458908 */, 19 },
- /* 7829 */ { MAD_F(0x04be80a5) /* 0.296509405 */, 19 },
- /* 7830 */ { MAD_F(0x04beb599) /* 0.296559904 */, 19 },
- /* 7831 */ { MAD_F(0x04beea8d) /* 0.296610404 */, 19 },
- /* 7832 */ { MAD_F(0x04bf1f82) /* 0.296660907 */, 19 },
- /* 7833 */ { MAD_F(0x04bf5477) /* 0.296711413 */, 19 },
- /* 7834 */ { MAD_F(0x04bf896d) /* 0.296761920 */, 19 },
- /* 7835 */ { MAD_F(0x04bfbe64) /* 0.296812429 */, 19 },
- /* 7836 */ { MAD_F(0x04bff35b) /* 0.296862941 */, 19 },
- /* 7837 */ { MAD_F(0x04c02852) /* 0.296913455 */, 19 },
- /* 7838 */ { MAD_F(0x04c05d4b) /* 0.296963971 */, 19 },
- /* 7839 */ { MAD_F(0x04c09243) /* 0.297014489 */, 19 },
-
- /* 7840 */ { MAD_F(0x04c0c73d) /* 0.297065009 */, 19 },
- /* 7841 */ { MAD_F(0x04c0fc37) /* 0.297115531 */, 19 },
- /* 7842 */ { MAD_F(0x04c13131) /* 0.297166056 */, 19 },
- /* 7843 */ { MAD_F(0x04c1662d) /* 0.297216582 */, 19 },
- /* 7844 */ { MAD_F(0x04c19b28) /* 0.297267111 */, 19 },
- /* 7845 */ { MAD_F(0x04c1d025) /* 0.297317642 */, 19 },
- /* 7846 */ { MAD_F(0x04c20521) /* 0.297368175 */, 19 },
- /* 7847 */ { MAD_F(0x04c23a1f) /* 0.297418710 */, 19 },
- /* 7848 */ { MAD_F(0x04c26f1d) /* 0.297469248 */, 19 },
- /* 7849 */ { MAD_F(0x04c2a41b) /* 0.297519787 */, 19 },
- /* 7850 */ { MAD_F(0x04c2d91b) /* 0.297570329 */, 19 },
- /* 7851 */ { MAD_F(0x04c30e1a) /* 0.297620873 */, 19 },
- /* 7852 */ { MAD_F(0x04c3431b) /* 0.297671418 */, 19 },
- /* 7853 */ { MAD_F(0x04c3781c) /* 0.297721967 */, 19 },
- /* 7854 */ { MAD_F(0x04c3ad1d) /* 0.297772517 */, 19 },
- /* 7855 */ { MAD_F(0x04c3e21f) /* 0.297823069 */, 19 },
-
- /* 7856 */ { MAD_F(0x04c41722) /* 0.297873624 */, 19 },
- /* 7857 */ { MAD_F(0x04c44c25) /* 0.297924180 */, 19 },
- /* 7858 */ { MAD_F(0x04c48129) /* 0.297974739 */, 19 },
- /* 7859 */ { MAD_F(0x04c4b62d) /* 0.298025300 */, 19 },
- /* 7860 */ { MAD_F(0x04c4eb32) /* 0.298075863 */, 19 },
- /* 7861 */ { MAD_F(0x04c52038) /* 0.298126429 */, 19 },
- /* 7862 */ { MAD_F(0x04c5553e) /* 0.298176996 */, 19 },
- /* 7863 */ { MAD_F(0x04c58a44) /* 0.298227565 */, 19 },
- /* 7864 */ { MAD_F(0x04c5bf4c) /* 0.298278137 */, 19 },
- /* 7865 */ { MAD_F(0x04c5f453) /* 0.298328711 */, 19 },
- /* 7866 */ { MAD_F(0x04c6295c) /* 0.298379287 */, 19 },
- /* 7867 */ { MAD_F(0x04c65e65) /* 0.298429865 */, 19 },
- /* 7868 */ { MAD_F(0x04c6936e) /* 0.298480445 */, 19 },
- /* 7869 */ { MAD_F(0x04c6c878) /* 0.298531028 */, 19 },
- /* 7870 */ { MAD_F(0x04c6fd83) /* 0.298581612 */, 19 },
- /* 7871 */ { MAD_F(0x04c7328e) /* 0.298632199 */, 19 },
-
- /* 7872 */ { MAD_F(0x04c7679a) /* 0.298682788 */, 19 },
- /* 7873 */ { MAD_F(0x04c79ca7) /* 0.298733379 */, 19 },
- /* 7874 */ { MAD_F(0x04c7d1b4) /* 0.298783972 */, 19 },
- /* 7875 */ { MAD_F(0x04c806c1) /* 0.298834567 */, 19 },
- /* 7876 */ { MAD_F(0x04c83bcf) /* 0.298885165 */, 19 },
- /* 7877 */ { MAD_F(0x04c870de) /* 0.298935764 */, 19 },
- /* 7878 */ { MAD_F(0x04c8a5ed) /* 0.298986366 */, 19 },
- /* 7879 */ { MAD_F(0x04c8dafd) /* 0.299036970 */, 19 },
- /* 7880 */ { MAD_F(0x04c9100d) /* 0.299087576 */, 19 },
- /* 7881 */ { MAD_F(0x04c9451e) /* 0.299138184 */, 19 },
- /* 7882 */ { MAD_F(0x04c97a30) /* 0.299188794 */, 19 },
- /* 7883 */ { MAD_F(0x04c9af42) /* 0.299239406 */, 19 },
- /* 7884 */ { MAD_F(0x04c9e455) /* 0.299290021 */, 19 },
- /* 7885 */ { MAD_F(0x04ca1968) /* 0.299340638 */, 19 },
- /* 7886 */ { MAD_F(0x04ca4e7c) /* 0.299391256 */, 19 },
- /* 7887 */ { MAD_F(0x04ca8391) /* 0.299441877 */, 19 },
-
- /* 7888 */ { MAD_F(0x04cab8a6) /* 0.299492500 */, 19 },
- /* 7889 */ { MAD_F(0x04caedbb) /* 0.299543126 */, 19 },
- /* 7890 */ { MAD_F(0x04cb22d1) /* 0.299593753 */, 19 },
- /* 7891 */ { MAD_F(0x04cb57e8) /* 0.299644382 */, 19 },
- /* 7892 */ { MAD_F(0x04cb8d00) /* 0.299695014 */, 19 },
- /* 7893 */ { MAD_F(0x04cbc217) /* 0.299745648 */, 19 },
- /* 7894 */ { MAD_F(0x04cbf730) /* 0.299796284 */, 19 },
- /* 7895 */ { MAD_F(0x04cc2c49) /* 0.299846922 */, 19 },
- /* 7896 */ { MAD_F(0x04cc6163) /* 0.299897562 */, 19 },
- /* 7897 */ { MAD_F(0x04cc967d) /* 0.299948204 */, 19 },
- /* 7898 */ { MAD_F(0x04cccb98) /* 0.299998849 */, 19 },
- /* 7899 */ { MAD_F(0x04cd00b3) /* 0.300049495 */, 19 },
- /* 7900 */ { MAD_F(0x04cd35cf) /* 0.300100144 */, 19 },
- /* 7901 */ { MAD_F(0x04cd6aeb) /* 0.300150795 */, 19 },
- /* 7902 */ { MAD_F(0x04cda008) /* 0.300201448 */, 19 },
- /* 7903 */ { MAD_F(0x04cdd526) /* 0.300252103 */, 19 },
-
- /* 7904 */ { MAD_F(0x04ce0a44) /* 0.300302761 */, 19 },
- /* 7905 */ { MAD_F(0x04ce3f63) /* 0.300353420 */, 19 },
- /* 7906 */ { MAD_F(0x04ce7482) /* 0.300404082 */, 19 },
- /* 7907 */ { MAD_F(0x04cea9a2) /* 0.300454745 */, 19 },
- /* 7908 */ { MAD_F(0x04cedec3) /* 0.300505411 */, 19 },
- /* 7909 */ { MAD_F(0x04cf13e4) /* 0.300556079 */, 19 },
- /* 7910 */ { MAD_F(0x04cf4906) /* 0.300606749 */, 19 },
- /* 7911 */ { MAD_F(0x04cf7e28) /* 0.300657421 */, 19 },
- /* 7912 */ { MAD_F(0x04cfb34b) /* 0.300708096 */, 19 },
- /* 7913 */ { MAD_F(0x04cfe86e) /* 0.300758772 */, 19 },
- /* 7914 */ { MAD_F(0x04d01d92) /* 0.300809451 */, 19 },
- /* 7915 */ { MAD_F(0x04d052b6) /* 0.300860132 */, 19 },
- /* 7916 */ { MAD_F(0x04d087db) /* 0.300910815 */, 19 },
- /* 7917 */ { MAD_F(0x04d0bd01) /* 0.300961500 */, 19 },
- /* 7918 */ { MAD_F(0x04d0f227) /* 0.301012187 */, 19 },
- /* 7919 */ { MAD_F(0x04d1274e) /* 0.301062876 */, 19 },
-
- /* 7920 */ { MAD_F(0x04d15c76) /* 0.301113568 */, 19 },
- /* 7921 */ { MAD_F(0x04d1919e) /* 0.301164261 */, 19 },
- /* 7922 */ { MAD_F(0x04d1c6c6) /* 0.301214957 */, 19 },
- /* 7923 */ { MAD_F(0x04d1fbef) /* 0.301265655 */, 19 },
- /* 7924 */ { MAD_F(0x04d23119) /* 0.301316355 */, 19 },
- /* 7925 */ { MAD_F(0x04d26643) /* 0.301367057 */, 19 },
- /* 7926 */ { MAD_F(0x04d29b6e) /* 0.301417761 */, 19 },
- /* 7927 */ { MAD_F(0x04d2d099) /* 0.301468468 */, 19 },
- /* 7928 */ { MAD_F(0x04d305c5) /* 0.301519176 */, 19 },
- /* 7929 */ { MAD_F(0x04d33af2) /* 0.301569887 */, 19 },
- /* 7930 */ { MAD_F(0x04d3701f) /* 0.301620599 */, 19 },
- /* 7931 */ { MAD_F(0x04d3a54d) /* 0.301671314 */, 19 },
- /* 7932 */ { MAD_F(0x04d3da7b) /* 0.301722031 */, 19 },
- /* 7933 */ { MAD_F(0x04d40faa) /* 0.301772751 */, 19 },
- /* 7934 */ { MAD_F(0x04d444d9) /* 0.301823472 */, 19 },
- /* 7935 */ { MAD_F(0x04d47a09) /* 0.301874195 */, 19 },
-
- /* 7936 */ { MAD_F(0x04d4af3a) /* 0.301924921 */, 19 },
- /* 7937 */ { MAD_F(0x04d4e46b) /* 0.301975649 */, 19 },
- /* 7938 */ { MAD_F(0x04d5199c) /* 0.302026378 */, 19 },
- /* 7939 */ { MAD_F(0x04d54ecf) /* 0.302077110 */, 19 },
- /* 7940 */ { MAD_F(0x04d58401) /* 0.302127845 */, 19 },
- /* 7941 */ { MAD_F(0x04d5b935) /* 0.302178581 */, 19 },
- /* 7942 */ { MAD_F(0x04d5ee69) /* 0.302229319 */, 19 },
- /* 7943 */ { MAD_F(0x04d6239d) /* 0.302280060 */, 19 },
- /* 7944 */ { MAD_F(0x04d658d2) /* 0.302330802 */, 19 },
- /* 7945 */ { MAD_F(0x04d68e08) /* 0.302381547 */, 19 },
- /* 7946 */ { MAD_F(0x04d6c33e) /* 0.302432294 */, 19 },
- /* 7947 */ { MAD_F(0x04d6f875) /* 0.302483043 */, 19 },
- /* 7948 */ { MAD_F(0x04d72dad) /* 0.302533794 */, 19 },
- /* 7949 */ { MAD_F(0x04d762e5) /* 0.302584547 */, 19 },
- /* 7950 */ { MAD_F(0x04d7981d) /* 0.302635303 */, 19 },
- /* 7951 */ { MAD_F(0x04d7cd56) /* 0.302686060 */, 19 },
-
- /* 7952 */ { MAD_F(0x04d80290) /* 0.302736820 */, 19 },
- /* 7953 */ { MAD_F(0x04d837ca) /* 0.302787581 */, 19 },
- /* 7954 */ { MAD_F(0x04d86d05) /* 0.302838345 */, 19 },
- /* 7955 */ { MAD_F(0x04d8a240) /* 0.302889111 */, 19 },
- /* 7956 */ { MAD_F(0x04d8d77c) /* 0.302939879 */, 19 },
- /* 7957 */ { MAD_F(0x04d90cb9) /* 0.302990650 */, 19 },
- /* 7958 */ { MAD_F(0x04d941f6) /* 0.303041422 */, 19 },
- /* 7959 */ { MAD_F(0x04d97734) /* 0.303092197 */, 19 },
- /* 7960 */ { MAD_F(0x04d9ac72) /* 0.303142973 */, 19 },
- /* 7961 */ { MAD_F(0x04d9e1b1) /* 0.303193752 */, 19 },
- /* 7962 */ { MAD_F(0x04da16f0) /* 0.303244533 */, 19 },
- /* 7963 */ { MAD_F(0x04da4c30) /* 0.303295316 */, 19 },
- /* 7964 */ { MAD_F(0x04da8171) /* 0.303346101 */, 19 },
- /* 7965 */ { MAD_F(0x04dab6b2) /* 0.303396889 */, 19 },
- /* 7966 */ { MAD_F(0x04daebf4) /* 0.303447678 */, 19 },
- /* 7967 */ { MAD_F(0x04db2136) /* 0.303498469 */, 19 },
-
- /* 7968 */ { MAD_F(0x04db5679) /* 0.303549263 */, 19 },
- /* 7969 */ { MAD_F(0x04db8bbc) /* 0.303600059 */, 19 },
- /* 7970 */ { MAD_F(0x04dbc100) /* 0.303650857 */, 19 },
- /* 7971 */ { MAD_F(0x04dbf644) /* 0.303701657 */, 19 },
- /* 7972 */ { MAD_F(0x04dc2b8a) /* 0.303752459 */, 19 },
- /* 7973 */ { MAD_F(0x04dc60cf) /* 0.303803263 */, 19 },
- /* 7974 */ { MAD_F(0x04dc9616) /* 0.303854070 */, 19 },
- /* 7975 */ { MAD_F(0x04dccb5c) /* 0.303904878 */, 19 },
- /* 7976 */ { MAD_F(0x04dd00a4) /* 0.303955689 */, 19 },
- /* 7977 */ { MAD_F(0x04dd35ec) /* 0.304006502 */, 19 },
- /* 7978 */ { MAD_F(0x04dd6b34) /* 0.304057317 */, 19 },
- /* 7979 */ { MAD_F(0x04dda07d) /* 0.304108134 */, 19 },
- /* 7980 */ { MAD_F(0x04ddd5c7) /* 0.304158953 */, 19 },
- /* 7981 */ { MAD_F(0x04de0b11) /* 0.304209774 */, 19 },
- /* 7982 */ { MAD_F(0x04de405c) /* 0.304260597 */, 19 },
- /* 7983 */ { MAD_F(0x04de75a7) /* 0.304311423 */, 19 },
-
- /* 7984 */ { MAD_F(0x04deaaf3) /* 0.304362251 */, 19 },
- /* 7985 */ { MAD_F(0x04dee040) /* 0.304413080 */, 19 },
- /* 7986 */ { MAD_F(0x04df158d) /* 0.304463912 */, 19 },
- /* 7987 */ { MAD_F(0x04df4adb) /* 0.304514746 */, 19 },
- /* 7988 */ { MAD_F(0x04df8029) /* 0.304565582 */, 19 },
- /* 7989 */ { MAD_F(0x04dfb578) /* 0.304616421 */, 19 },
- /* 7990 */ { MAD_F(0x04dfeac7) /* 0.304667261 */, 19 },
- /* 7991 */ { MAD_F(0x04e02017) /* 0.304718103 */, 19 },
- /* 7992 */ { MAD_F(0x04e05567) /* 0.304768948 */, 19 },
- /* 7993 */ { MAD_F(0x04e08ab8) /* 0.304819795 */, 19 },
- /* 7994 */ { MAD_F(0x04e0c00a) /* 0.304870644 */, 19 },
- /* 7995 */ { MAD_F(0x04e0f55c) /* 0.304921495 */, 19 },
- /* 7996 */ { MAD_F(0x04e12aaf) /* 0.304972348 */, 19 },
- /* 7997 */ { MAD_F(0x04e16002) /* 0.305023203 */, 19 },
- /* 7998 */ { MAD_F(0x04e19556) /* 0.305074060 */, 19 },
- /* 7999 */ { MAD_F(0x04e1caab) /* 0.305124920 */, 19 },
-
- /* 8000 */ { MAD_F(0x04e20000) /* 0.305175781 */, 19 },
- /* 8001 */ { MAD_F(0x04e23555) /* 0.305226645 */, 19 },
- /* 8002 */ { MAD_F(0x04e26aac) /* 0.305277511 */, 19 },
- /* 8003 */ { MAD_F(0x04e2a002) /* 0.305328379 */, 19 },
- /* 8004 */ { MAD_F(0x04e2d55a) /* 0.305379249 */, 19 },
- /* 8005 */ { MAD_F(0x04e30ab2) /* 0.305430121 */, 19 },
- /* 8006 */ { MAD_F(0x04e3400a) /* 0.305480995 */, 19 },
- /* 8007 */ { MAD_F(0x04e37563) /* 0.305531872 */, 19 },
- /* 8008 */ { MAD_F(0x04e3aabd) /* 0.305582750 */, 19 },
- /* 8009 */ { MAD_F(0x04e3e017) /* 0.305633631 */, 19 },
- /* 8010 */ { MAD_F(0x04e41572) /* 0.305684513 */, 19 },
- /* 8011 */ { MAD_F(0x04e44acd) /* 0.305735398 */, 19 },
- /* 8012 */ { MAD_F(0x04e48029) /* 0.305786285 */, 19 },
- /* 8013 */ { MAD_F(0x04e4b585) /* 0.305837174 */, 19 },
- /* 8014 */ { MAD_F(0x04e4eae2) /* 0.305888066 */, 19 },
- /* 8015 */ { MAD_F(0x04e52040) /* 0.305938959 */, 19 },
-
- /* 8016 */ { MAD_F(0x04e5559e) /* 0.305989854 */, 19 },
- /* 8017 */ { MAD_F(0x04e58afd) /* 0.306040752 */, 19 },
- /* 8018 */ { MAD_F(0x04e5c05c) /* 0.306091652 */, 19 },
- /* 8019 */ { MAD_F(0x04e5f5bc) /* 0.306142554 */, 19 },
- /* 8020 */ { MAD_F(0x04e62b1c) /* 0.306193457 */, 19 },
- /* 8021 */ { MAD_F(0x04e6607d) /* 0.306244364 */, 19 },
- /* 8022 */ { MAD_F(0x04e695df) /* 0.306295272 */, 19 },
- /* 8023 */ { MAD_F(0x04e6cb41) /* 0.306346182 */, 19 },
- /* 8024 */ { MAD_F(0x04e700a3) /* 0.306397094 */, 19 },
- /* 8025 */ { MAD_F(0x04e73607) /* 0.306448009 */, 19 },
- /* 8026 */ { MAD_F(0x04e76b6b) /* 0.306498925 */, 19 },
- /* 8027 */ { MAD_F(0x04e7a0cf) /* 0.306549844 */, 19 },
- /* 8028 */ { MAD_F(0x04e7d634) /* 0.306600765 */, 19 },
- /* 8029 */ { MAD_F(0x04e80b99) /* 0.306651688 */, 19 },
- /* 8030 */ { MAD_F(0x04e84100) /* 0.306702613 */, 19 },
- /* 8031 */ { MAD_F(0x04e87666) /* 0.306753540 */, 19 },
-
- /* 8032 */ { MAD_F(0x04e8abcd) /* 0.306804470 */, 19 },
- /* 8033 */ { MAD_F(0x04e8e135) /* 0.306855401 */, 19 },
- /* 8034 */ { MAD_F(0x04e9169e) /* 0.306906334 */, 19 },
- /* 8035 */ { MAD_F(0x04e94c07) /* 0.306957270 */, 19 },
- /* 8036 */ { MAD_F(0x04e98170) /* 0.307008208 */, 19 },
- /* 8037 */ { MAD_F(0x04e9b6da) /* 0.307059148 */, 19 },
- /* 8038 */ { MAD_F(0x04e9ec45) /* 0.307110090 */, 19 },
- /* 8039 */ { MAD_F(0x04ea21b0) /* 0.307161034 */, 19 },
- /* 8040 */ { MAD_F(0x04ea571c) /* 0.307211980 */, 19 },
- /* 8041 */ { MAD_F(0x04ea8c88) /* 0.307262928 */, 19 },
- /* 8042 */ { MAD_F(0x04eac1f5) /* 0.307313879 */, 19 },
- /* 8043 */ { MAD_F(0x04eaf762) /* 0.307364831 */, 19 },
- /* 8044 */ { MAD_F(0x04eb2cd0) /* 0.307415786 */, 19 },
- /* 8045 */ { MAD_F(0x04eb623f) /* 0.307466743 */, 19 },
- /* 8046 */ { MAD_F(0x04eb97ae) /* 0.307517702 */, 19 },
- /* 8047 */ { MAD_F(0x04ebcd1e) /* 0.307568663 */, 19 },
-
- /* 8048 */ { MAD_F(0x04ec028e) /* 0.307619626 */, 19 },
- /* 8049 */ { MAD_F(0x04ec37ff) /* 0.307670591 */, 19 },
- /* 8050 */ { MAD_F(0x04ec6d71) /* 0.307721558 */, 19 },
- /* 8051 */ { MAD_F(0x04eca2e3) /* 0.307772528 */, 19 },
- /* 8052 */ { MAD_F(0x04ecd855) /* 0.307823499 */, 19 },
- /* 8053 */ { MAD_F(0x04ed0dc8) /* 0.307874473 */, 19 },
- /* 8054 */ { MAD_F(0x04ed433c) /* 0.307925449 */, 19 },
- /* 8055 */ { MAD_F(0x04ed78b0) /* 0.307976426 */, 19 },
- /* 8056 */ { MAD_F(0x04edae25) /* 0.308027406 */, 19 },
- /* 8057 */ { MAD_F(0x04ede39a) /* 0.308078389 */, 19 },
- /* 8058 */ { MAD_F(0x04ee1910) /* 0.308129373 */, 19 },
- /* 8059 */ { MAD_F(0x04ee4e87) /* 0.308180359 */, 19 },
- /* 8060 */ { MAD_F(0x04ee83fe) /* 0.308231347 */, 19 },
- /* 8061 */ { MAD_F(0x04eeb976) /* 0.308282338 */, 19 },
- /* 8062 */ { MAD_F(0x04eeeeee) /* 0.308333331 */, 19 },
- /* 8063 */ { MAD_F(0x04ef2467) /* 0.308384325 */, 19 },
-
- /* 8064 */ { MAD_F(0x04ef59e0) /* 0.308435322 */, 19 },
- /* 8065 */ { MAD_F(0x04ef8f5a) /* 0.308486321 */, 19 },
- /* 8066 */ { MAD_F(0x04efc4d5) /* 0.308537322 */, 19 },
- /* 8067 */ { MAD_F(0x04effa50) /* 0.308588325 */, 19 },
- /* 8068 */ { MAD_F(0x04f02fcb) /* 0.308639331 */, 19 },
- /* 8069 */ { MAD_F(0x04f06547) /* 0.308690338 */, 19 },
- /* 8070 */ { MAD_F(0x04f09ac4) /* 0.308741348 */, 19 },
- /* 8071 */ { MAD_F(0x04f0d041) /* 0.308792359 */, 19 },
- /* 8072 */ { MAD_F(0x04f105bf) /* 0.308843373 */, 19 },
- /* 8073 */ { MAD_F(0x04f13b3e) /* 0.308894389 */, 19 },
- /* 8074 */ { MAD_F(0x04f170bd) /* 0.308945407 */, 19 },
- /* 8075 */ { MAD_F(0x04f1a63c) /* 0.308996427 */, 19 },
- /* 8076 */ { MAD_F(0x04f1dbbd) /* 0.309047449 */, 19 },
- /* 8077 */ { MAD_F(0x04f2113d) /* 0.309098473 */, 19 },
- /* 8078 */ { MAD_F(0x04f246bf) /* 0.309149499 */, 19 },
- /* 8079 */ { MAD_F(0x04f27c40) /* 0.309200528 */, 19 },
-
- /* 8080 */ { MAD_F(0x04f2b1c3) /* 0.309251558 */, 19 },
- /* 8081 */ { MAD_F(0x04f2e746) /* 0.309302591 */, 19 },
- /* 8082 */ { MAD_F(0x04f31cc9) /* 0.309353626 */, 19 },
- /* 8083 */ { MAD_F(0x04f3524d) /* 0.309404663 */, 19 },
- /* 8084 */ { MAD_F(0x04f387d2) /* 0.309455702 */, 19 },
- /* 8085 */ { MAD_F(0x04f3bd57) /* 0.309506743 */, 19 },
- /* 8086 */ { MAD_F(0x04f3f2dd) /* 0.309557786 */, 19 },
- /* 8087 */ { MAD_F(0x04f42864) /* 0.309608831 */, 19 },
- /* 8088 */ { MAD_F(0x04f45dea) /* 0.309659879 */, 19 },
- /* 8089 */ { MAD_F(0x04f49372) /* 0.309710928 */, 19 },
- /* 8090 */ { MAD_F(0x04f4c8fa) /* 0.309761980 */, 19 },
- /* 8091 */ { MAD_F(0x04f4fe83) /* 0.309813033 */, 19 },
- /* 8092 */ { MAD_F(0x04f5340c) /* 0.309864089 */, 19 },
- /* 8093 */ { MAD_F(0x04f56996) /* 0.309915147 */, 19 },
- /* 8094 */ { MAD_F(0x04f59f20) /* 0.309966207 */, 19 },
- /* 8095 */ { MAD_F(0x04f5d4ab) /* 0.310017269 */, 19 },
-
- /* 8096 */ { MAD_F(0x04f60a36) /* 0.310068333 */, 19 },
- /* 8097 */ { MAD_F(0x04f63fc2) /* 0.310119400 */, 19 },
- /* 8098 */ { MAD_F(0x04f6754f) /* 0.310170468 */, 19 },
- /* 8099 */ { MAD_F(0x04f6aadc) /* 0.310221539 */, 19 },
- /* 8100 */ { MAD_F(0x04f6e06a) /* 0.310272611 */, 19 },
- /* 8101 */ { MAD_F(0x04f715f8) /* 0.310323686 */, 19 },
- /* 8102 */ { MAD_F(0x04f74b87) /* 0.310374763 */, 19 },
- /* 8103 */ { MAD_F(0x04f78116) /* 0.310425842 */, 19 },
- /* 8104 */ { MAD_F(0x04f7b6a6) /* 0.310476923 */, 19 },
- /* 8105 */ { MAD_F(0x04f7ec37) /* 0.310528006 */, 19 },
- /* 8106 */ { MAD_F(0x04f821c8) /* 0.310579091 */, 19 },
- /* 8107 */ { MAD_F(0x04f85759) /* 0.310630179 */, 19 },
- /* 8108 */ { MAD_F(0x04f88cec) /* 0.310681268 */, 19 },
- /* 8109 */ { MAD_F(0x04f8c27e) /* 0.310732360 */, 19 },
- /* 8110 */ { MAD_F(0x04f8f812) /* 0.310783453 */, 19 },
- /* 8111 */ { MAD_F(0x04f92da6) /* 0.310834549 */, 19 },
-
- /* 8112 */ { MAD_F(0x04f9633a) /* 0.310885647 */, 19 },
- /* 8113 */ { MAD_F(0x04f998cf) /* 0.310936747 */, 19 },
- /* 8114 */ { MAD_F(0x04f9ce65) /* 0.310987849 */, 19 },
- /* 8115 */ { MAD_F(0x04fa03fb) /* 0.311038953 */, 19 },
- /* 8116 */ { MAD_F(0x04fa3992) /* 0.311090059 */, 19 },
- /* 8117 */ { MAD_F(0x04fa6f29) /* 0.311141168 */, 19 },
- /* 8118 */ { MAD_F(0x04faa4c1) /* 0.311192278 */, 19 },
- /* 8119 */ { MAD_F(0x04fada59) /* 0.311243390 */, 19 },
- /* 8120 */ { MAD_F(0x04fb0ff2) /* 0.311294505 */, 19 },
- /* 8121 */ { MAD_F(0x04fb458c) /* 0.311345622 */, 19 },
- /* 8122 */ { MAD_F(0x04fb7b26) /* 0.311396741 */, 19 },
- /* 8123 */ { MAD_F(0x04fbb0c1) /* 0.311447862 */, 19 },
- /* 8124 */ { MAD_F(0x04fbe65c) /* 0.311498985 */, 19 },
- /* 8125 */ { MAD_F(0x04fc1bf8) /* 0.311550110 */, 19 },
- /* 8126 */ { MAD_F(0x04fc5194) /* 0.311601237 */, 19 },
- /* 8127 */ { MAD_F(0x04fc8731) /* 0.311652366 */, 19 },
-
- /* 8128 */ { MAD_F(0x04fcbcce) /* 0.311703498 */, 19 },
- /* 8129 */ { MAD_F(0x04fcf26c) /* 0.311754631 */, 19 },
- /* 8130 */ { MAD_F(0x04fd280b) /* 0.311805767 */, 19 },
- /* 8131 */ { MAD_F(0x04fd5daa) /* 0.311856905 */, 19 },
- /* 8132 */ { MAD_F(0x04fd934a) /* 0.311908044 */, 19 },
- /* 8133 */ { MAD_F(0x04fdc8ea) /* 0.311959186 */, 19 },
- /* 8134 */ { MAD_F(0x04fdfe8b) /* 0.312010330 */, 19 },
- /* 8135 */ { MAD_F(0x04fe342c) /* 0.312061476 */, 19 },
- /* 8136 */ { MAD_F(0x04fe69ce) /* 0.312112625 */, 19 },
- /* 8137 */ { MAD_F(0x04fe9f71) /* 0.312163775 */, 19 },
- /* 8138 */ { MAD_F(0x04fed514) /* 0.312214927 */, 19 },
- /* 8139 */ { MAD_F(0x04ff0ab8) /* 0.312266082 */, 19 },
- /* 8140 */ { MAD_F(0x04ff405c) /* 0.312317238 */, 19 },
- /* 8141 */ { MAD_F(0x04ff7601) /* 0.312368397 */, 19 },
- /* 8142 */ { MAD_F(0x04ffaba6) /* 0.312419558 */, 19 },
- /* 8143 */ { MAD_F(0x04ffe14c) /* 0.312470720 */, 19 },
-
- /* 8144 */ { MAD_F(0x050016f3) /* 0.312521885 */, 19 },
- /* 8145 */ { MAD_F(0x05004c9a) /* 0.312573052 */, 19 },
- /* 8146 */ { MAD_F(0x05008241) /* 0.312624222 */, 19 },
- /* 8147 */ { MAD_F(0x0500b7e9) /* 0.312675393 */, 19 },
- /* 8148 */ { MAD_F(0x0500ed92) /* 0.312726566 */, 19 },
- /* 8149 */ { MAD_F(0x0501233b) /* 0.312777742 */, 19 },
- /* 8150 */ { MAD_F(0x050158e5) /* 0.312828919 */, 19 },
- /* 8151 */ { MAD_F(0x05018e90) /* 0.312880099 */, 19 },
- /* 8152 */ { MAD_F(0x0501c43b) /* 0.312931280 */, 19 },
- /* 8153 */ { MAD_F(0x0501f9e6) /* 0.312982464 */, 19 },
- /* 8154 */ { MAD_F(0x05022f92) /* 0.313033650 */, 19 },
- /* 8155 */ { MAD_F(0x0502653f) /* 0.313084838 */, 19 },
- /* 8156 */ { MAD_F(0x05029aec) /* 0.313136028 */, 19 },
- /* 8157 */ { MAD_F(0x0502d09a) /* 0.313187220 */, 19 },
- /* 8158 */ { MAD_F(0x05030648) /* 0.313238414 */, 19 },
- /* 8159 */ { MAD_F(0x05033bf7) /* 0.313289611 */, 19 },
-
- /* 8160 */ { MAD_F(0x050371a7) /* 0.313340809 */, 19 },
- /* 8161 */ { MAD_F(0x0503a757) /* 0.313392010 */, 19 },
- /* 8162 */ { MAD_F(0x0503dd07) /* 0.313443212 */, 19 },
- /* 8163 */ { MAD_F(0x050412b9) /* 0.313494417 */, 19 },
- /* 8164 */ { MAD_F(0x0504486a) /* 0.313545624 */, 19 },
- /* 8165 */ { MAD_F(0x05047e1d) /* 0.313596833 */, 19 },
- /* 8166 */ { MAD_F(0x0504b3cf) /* 0.313648044 */, 19 },
- /* 8167 */ { MAD_F(0x0504e983) /* 0.313699257 */, 19 },
- /* 8168 */ { MAD_F(0x05051f37) /* 0.313750472 */, 19 },
- /* 8169 */ { MAD_F(0x050554eb) /* 0.313801689 */, 19 },
- /* 8170 */ { MAD_F(0x05058aa0) /* 0.313852909 */, 19 },
- /* 8171 */ { MAD_F(0x0505c056) /* 0.313904130 */, 19 },
- /* 8172 */ { MAD_F(0x0505f60c) /* 0.313955354 */, 19 },
- /* 8173 */ { MAD_F(0x05062bc3) /* 0.314006579 */, 19 },
- /* 8174 */ { MAD_F(0x0506617a) /* 0.314057807 */, 19 },
- /* 8175 */ { MAD_F(0x05069732) /* 0.314109037 */, 19 },
-
- /* 8176 */ { MAD_F(0x0506cceb) /* 0.314160269 */, 19 },
- /* 8177 */ { MAD_F(0x050702a4) /* 0.314211502 */, 19 },
- /* 8178 */ { MAD_F(0x0507385d) /* 0.314262739 */, 19 },
- /* 8179 */ { MAD_F(0x05076e17) /* 0.314313977 */, 19 },
- /* 8180 */ { MAD_F(0x0507a3d2) /* 0.314365217 */, 19 },
- /* 8181 */ { MAD_F(0x0507d98d) /* 0.314416459 */, 19 },
- /* 8182 */ { MAD_F(0x05080f49) /* 0.314467704 */, 19 },
- /* 8183 */ { MAD_F(0x05084506) /* 0.314518950 */, 19 },
- /* 8184 */ { MAD_F(0x05087ac2) /* 0.314570199 */, 19 },
- /* 8185 */ { MAD_F(0x0508b080) /* 0.314621449 */, 19 },
- /* 8186 */ { MAD_F(0x0508e63e) /* 0.314672702 */, 19 },
- /* 8187 */ { MAD_F(0x05091bfd) /* 0.314723957 */, 19 },
- /* 8188 */ { MAD_F(0x050951bc) /* 0.314775214 */, 19 },
- /* 8189 */ { MAD_F(0x0509877c) /* 0.314826473 */, 19 },
- /* 8190 */ { MAD_F(0x0509bd3c) /* 0.314877734 */, 19 },
- /* 8191 */ { MAD_F(0x0509f2fd) /* 0.314928997 */, 19 },
-
- /* 8192 */ { MAD_F(0x050a28be) /* 0.314980262 */, 19 },
- /* 8193 */ { MAD_F(0x050a5e80) /* 0.315031530 */, 19 },
- /* 8194 */ { MAD_F(0x050a9443) /* 0.315082799 */, 19 },
- /* 8195 */ { MAD_F(0x050aca06) /* 0.315134071 */, 19 },
- /* 8196 */ { MAD_F(0x050affc9) /* 0.315185344 */, 19 },
- /* 8197 */ { MAD_F(0x050b358e) /* 0.315236620 */, 19 },
- /* 8198 */ { MAD_F(0x050b6b52) /* 0.315287898 */, 19 },
- /* 8199 */ { MAD_F(0x050ba118) /* 0.315339178 */, 19 },
- /* 8200 */ { MAD_F(0x050bd6de) /* 0.315390460 */, 19 },
- /* 8201 */ { MAD_F(0x050c0ca4) /* 0.315441744 */, 19 },
- /* 8202 */ { MAD_F(0x050c426b) /* 0.315493030 */, 19 },
- /* 8203 */ { MAD_F(0x050c7833) /* 0.315544318 */, 19 },
- /* 8204 */ { MAD_F(0x050cadfb) /* 0.315595608 */, 19 },
- /* 8205 */ { MAD_F(0x050ce3c4) /* 0.315646901 */, 19 },
- /* 8206 */ { MAD_F(0x050d198d) /* 0.315698195 */, 19 }
diff --git a/src/libmad/sf_table.dat b/src/libmad/sf_table.dat
deleted file mode 100644
index ea7a1c191..000000000
--- a/src/libmad/sf_table.dat
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * libmad - MPEG audio decoder library
- * Copyright (C) 2000-2001 Robert Leslie
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * $Id: sf_table.dat,v 1.2 2002/04/30 18:46:58 miguelfreitas Exp $
- */
-
-/*
- * These are the scalefactor values for Layer I and Layer II.
- * The values are from Table B.1 of ISO/IEC 11172-3.
- *
- * There is some error introduced by the 32-bit fixed-point representation;
- * the amount of error is shown. For 16-bit PCM output, this shouldn't be
- * too much of a problem.
- */
-
- MAD_F(0x20000000), /* 2.000000000000 => 2.000000000000, e 0.000000000000 */
- MAD_F(0x1965fea5), /* 1.587401051968 => 1.587401051074, e 0.000000000894 */
- MAD_F(0x1428a2fa), /* 1.259921049895 => 1.259921051562, e -0.000000001667 */
- MAD_F(0x10000000), /* 1.000000000000 => 1.000000000000, e 0.000000000000 */
- MAD_F(0x0cb2ff53), /* 0.793700525984 => 0.793700527400, e -0.000000001416 */
- MAD_F(0x0a14517d), /* 0.629960524947 => 0.629960525781, e -0.000000000833 */
- MAD_F(0x08000000), /* 0.500000000000 => 0.500000000000, e 0.000000000000 */
- MAD_F(0x06597fa9), /* 0.396850262992 => 0.396850261837, e 0.000000001155 */
-
- MAD_F(0x050a28be), /* 0.314980262474 => 0.314980261028, e 0.000000001446 */
- MAD_F(0x04000000), /* 0.250000000000 => 0.250000000000, e 0.000000000000 */
- MAD_F(0x032cbfd5), /* 0.198425131496 => 0.198425132781, e -0.000000001285 */
- MAD_F(0x0285145f), /* 0.157490131237 => 0.157490130514, e 0.000000000723 */
- MAD_F(0x02000000), /* 0.125000000000 => 0.125000000000, e 0.000000000000 */
- MAD_F(0x01965fea), /* 0.099212565748 => 0.099212564528, e 0.000000001220 */
- MAD_F(0x01428a30), /* 0.078745065618 => 0.078745067120, e -0.000000001501 */
- MAD_F(0x01000000), /* 0.062500000000 => 0.062500000000, e 0.000000000000 */
-
- MAD_F(0x00cb2ff5), /* 0.049606282874 => 0.049606282264, e 0.000000000610 */
- MAD_F(0x00a14518), /* 0.039372532809 => 0.039372533560, e -0.000000000751 */
- MAD_F(0x00800000), /* 0.031250000000 => 0.031250000000, e 0.000000000000 */
- MAD_F(0x006597fb), /* 0.024803141437 => 0.024803142995, e -0.000000001558 */
- MAD_F(0x0050a28c), /* 0.019686266405 => 0.019686266780, e -0.000000000375 */
- MAD_F(0x00400000), /* 0.015625000000 => 0.015625000000, e 0.000000000000 */
- MAD_F(0x0032cbfd), /* 0.012401570719 => 0.012401569635, e 0.000000001084 */
- MAD_F(0x00285146), /* 0.009843133202 => 0.009843133390, e -0.000000000188 */
-
- MAD_F(0x00200000), /* 0.007812500000 => 0.007812500000, e 0.000000000000 */
- MAD_F(0x001965ff), /* 0.006200785359 => 0.006200786680, e -0.000000001321 */
- MAD_F(0x001428a3), /* 0.004921566601 => 0.004921566695, e -0.000000000094 */
- MAD_F(0x00100000), /* 0.003906250000 => 0.003906250000, e 0.000000000000 */
- MAD_F(0x000cb2ff), /* 0.003100392680 => 0.003100391477, e 0.000000001202 */
- MAD_F(0x000a1451), /* 0.002460783301 => 0.002460781485, e 0.000000001816 */
- MAD_F(0x00080000), /* 0.001953125000 => 0.001953125000, e 0.000000000000 */
- MAD_F(0x00065980), /* 0.001550196340 => 0.001550197601, e -0.000000001262 */
-
- MAD_F(0x00050a29), /* 0.001230391650 => 0.001230392605, e -0.000000000955 */
- MAD_F(0x00040000), /* 0.000976562500 => 0.000976562500, e 0.000000000000 */
- MAD_F(0x00032cc0), /* 0.000775098170 => 0.000775098801, e -0.000000000631 */
- MAD_F(0x00028514), /* 0.000615195825 => 0.000615194440, e 0.000000001385 */
- MAD_F(0x00020000), /* 0.000488281250 => 0.000488281250, e 0.000000000000 */
- MAD_F(0x00019660), /* 0.000387549085 => 0.000387549400, e -0.000000000315 */
- MAD_F(0x0001428a), /* 0.000307597913 => 0.000307597220, e 0.000000000693 */
- MAD_F(0x00010000), /* 0.000244140625 => 0.000244140625, e 0.000000000000 */
-
- MAD_F(0x0000cb30), /* 0.000193774542 => 0.000193774700, e -0.000000000158 */
- MAD_F(0x0000a145), /* 0.000153798956 => 0.000153798610, e 0.000000000346 */
- MAD_F(0x00008000), /* 0.000122070313 => 0.000122070313, e 0.000000000000 */
- MAD_F(0x00006598), /* 0.000096887271 => 0.000096887350, e -0.000000000079 */
- MAD_F(0x000050a3), /* 0.000076899478 => 0.000076901168, e -0.000000001689 */
- MAD_F(0x00004000), /* 0.000061035156 => 0.000061035156, e 0.000000000000 */
- MAD_F(0x000032cc), /* 0.000048443636 => 0.000048443675, e -0.000000000039 */
- MAD_F(0x00002851), /* 0.000038449739 => 0.000038448721, e 0.000000001018 */
-
- MAD_F(0x00002000), /* 0.000030517578 => 0.000030517578, e 0.000000000000 */
- MAD_F(0x00001966), /* 0.000024221818 => 0.000024221838, e -0.000000000020 */
- MAD_F(0x00001429), /* 0.000019224870 => 0.000019226223, e -0.000000001354 */
- MAD_F(0x00001000), /* 0.000015258789 => 0.000015258789, e -0.000000000000 */
- MAD_F(0x00000cb3), /* 0.000012110909 => 0.000012110919, e -0.000000000010 */
- MAD_F(0x00000a14), /* 0.000009612435 => 0.000009611249, e 0.000000001186 */
- MAD_F(0x00000800), /* 0.000007629395 => 0.000007629395, e -0.000000000000 */
- MAD_F(0x00000659), /* 0.000006055454 => 0.000006053597, e 0.000000001858 */
-
- MAD_F(0x0000050a), /* 0.000004806217 => 0.000004805624, e 0.000000000593 */
- MAD_F(0x00000400), /* 0.000003814697 => 0.000003814697, e 0.000000000000 */
- MAD_F(0x0000032d), /* 0.000003027727 => 0.000003028661, e -0.000000000934 */
- MAD_F(0x00000285), /* 0.000002403109 => 0.000002402812, e 0.000000000296 */
- MAD_F(0x00000200), /* 0.000001907349 => 0.000001907349, e -0.000000000000 */
- MAD_F(0x00000196), /* 0.000001513864 => 0.000001512468, e 0.000000001396 */
- MAD_F(0x00000143) /* 0.000001201554 => 0.000001203269, e -0.000000001714 */
diff --git a/src/libmad/stream.c b/src/libmad/stream.c
deleted file mode 100644
index fecc87434..000000000
--- a/src/libmad/stream.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * libmad - MPEG audio decoder library
- * Copyright (C) 2000-2004 Underbit Technologies, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * $Id: stream.c,v 1.3 2004/04/22 00:23:07 miguelfreitas Exp $
- */
-
-# ifdef HAVE_CONFIG_H
-# include "config.h"
-# endif
-
-# include "global.h"
-
-# include <stdlib.h>
-
-# include "bit.h"
-# include "stream.h"
-
-/*
- * NAME: stream->init()
- * DESCRIPTION: initialize stream struct
- */
-void mad_stream_init(struct mad_stream *stream)
-{
- stream->buffer = 0;
- stream->bufend = 0;
- stream->skiplen = 0;
-
- stream->sync = 0;
- stream->freerate = 0;
-
- stream->this_frame = 0;
- stream->next_frame = 0;
- mad_bit_init(&stream->ptr, 0);
-
- mad_bit_init(&stream->anc_ptr, 0);
- stream->anc_bitlen = 0;
-
- stream->main_data = 0;
- stream->md_len = 0;
-
- stream->options = 0;
- stream->error = MAD_ERROR_NONE;
-}
-
-/*
- * NAME: stream->finish()
- * DESCRIPTION: deallocate any dynamic memory associated with stream
- */
-void mad_stream_finish(struct mad_stream *stream)
-{
- if (stream->main_data) {
- free(stream->main_data);
- stream->main_data = 0;
- }
-
- mad_bit_finish(&stream->anc_ptr);
- mad_bit_finish(&stream->ptr);
-}
-
-/*
- * NAME: stream->buffer()
- * DESCRIPTION: set stream buffer pointers
- */
-void mad_stream_buffer(struct mad_stream *stream,
- unsigned char const *buffer, unsigned long length)
-{
- stream->buffer = buffer;
- stream->bufend = buffer + length;
-
- stream->this_frame = buffer;
- stream->next_frame = buffer;
-
- stream->sync = 1;
-
- mad_bit_init(&stream->ptr, buffer);
-}
-
-/*
- * NAME: stream->skip()
- * DESCRIPTION: arrange to skip bytes before the next frame
- */
-void mad_stream_skip(struct mad_stream *stream, unsigned long length)
-{
- stream->skiplen += length;
-}
-
-/*
- * NAME: stream->sync()
- * DESCRIPTION: locate the next stream sync word
- */
-int mad_stream_sync(struct mad_stream *stream)
-{
- register unsigned char const *ptr, *end;
-
- ptr = mad_bit_nextbyte(&stream->ptr);
- end = stream->bufend;
-
- while (ptr < end - 1 &&
- !(ptr[0] == 0xff && (ptr[1] & 0xe0) == 0xe0))
- ++ptr;
-
- if (end - ptr < MAD_BUFFER_GUARD)
- return -1;
-
- mad_bit_init(&stream->ptr, ptr);
-
- return 0;
-}
-
-/*
- * NAME: stream->errorstr()
- * DESCRIPTION: return a string description of the current error condition
- */
-char const *mad_stream_errorstr(struct mad_stream const *stream)
-{
- switch (stream->error) {
- case MAD_ERROR_NONE: return "no error";
-
- case MAD_ERROR_BUFLEN: return "input buffer too small (or EOF)";
- case MAD_ERROR_BUFPTR: return "invalid (null) buffer pointer";
-
- case MAD_ERROR_NOMEM: return "not enough memory";
-
- case MAD_ERROR_LOSTSYNC: return "lost synchronization";
- case MAD_ERROR_BADLAYER: return "reserved header layer value";
- case MAD_ERROR_BADBITRATE: return "forbidden bitrate value";
- case MAD_ERROR_BADSAMPLERATE: return "reserved sample frequency value";
- case MAD_ERROR_BADEMPHASIS: return "reserved emphasis value";
-
- case MAD_ERROR_BADCRC: return "CRC check failed";
- case MAD_ERROR_BADBITALLOC: return "forbidden bit allocation value";
- case MAD_ERROR_BADSCALEFACTOR: return "bad scalefactor index";
- case MAD_ERROR_BADMODE: return "bad bitrate/mode combination";
- case MAD_ERROR_BADFRAMELEN: return "bad frame length";
- case MAD_ERROR_BADBIGVALUES: return "bad big_values count";
- case MAD_ERROR_BADBLOCKTYPE: return "reserved block_type";
- case MAD_ERROR_BADSCFSI: return "bad scalefactor selection info";
- case MAD_ERROR_BADDATAPTR: return "bad main_data_begin pointer";
- case MAD_ERROR_BADPART3LEN: return "bad audio data length";
- case MAD_ERROR_BADHUFFTABLE: return "bad Huffman table select";
- case MAD_ERROR_BADHUFFDATA: return "Huffman data overrun";
- case MAD_ERROR_BADSTEREO: return "incompatible block_type for JS";
- }
-
- return 0;
-}
diff --git a/src/libmad/stream.h b/src/libmad/stream.h
deleted file mode 100644
index b99b87582..000000000
--- a/src/libmad/stream.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * libmad - MPEG audio decoder library
- * Copyright (C) 2000-2004 Underbit Technologies, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * $Id: stream.h,v 1.3 2004/04/22 00:23:12 miguelfreitas Exp $
- */
-
-# ifndef LIBMAD_STREAM_H
-# define LIBMAD_STREAM_H
-
-# include "bit.h"
-
-# define MAD_BUFFER_GUARD 8
-# define MAD_BUFFER_MDLEN (511 + 2048 + MAD_BUFFER_GUARD)
-
-enum mad_error {
- MAD_ERROR_NONE = 0x0000, /* no error */
-
- MAD_ERROR_BUFLEN = 0x0001, /* input buffer too small (or EOF) */
- MAD_ERROR_BUFPTR = 0x0002, /* invalid (null) buffer pointer */
-
- MAD_ERROR_NOMEM = 0x0031, /* not enough memory */
-
- MAD_ERROR_LOSTSYNC = 0x0101, /* lost synchronization */
- MAD_ERROR_BADLAYER = 0x0102, /* reserved header layer value */
- MAD_ERROR_BADBITRATE = 0x0103, /* forbidden bitrate value */
- MAD_ERROR_BADSAMPLERATE = 0x0104, /* reserved sample frequency value */
- MAD_ERROR_BADEMPHASIS = 0x0105, /* reserved emphasis value */
-
- MAD_ERROR_BADCRC = 0x0201, /* CRC check failed */
- MAD_ERROR_BADBITALLOC = 0x0211, /* forbidden bit allocation value */
- MAD_ERROR_BADSCALEFACTOR = 0x0221, /* bad scalefactor index */
- MAD_ERROR_BADMODE = 0x0222, /* bad bitrate/mode combination */
- MAD_ERROR_BADFRAMELEN = 0x0231, /* bad frame length */
- MAD_ERROR_BADBIGVALUES = 0x0232, /* bad big_values count */
- MAD_ERROR_BADBLOCKTYPE = 0x0233, /* reserved block_type */
- MAD_ERROR_BADSCFSI = 0x0234, /* bad scalefactor selection info */
- MAD_ERROR_BADDATAPTR = 0x0235, /* bad main_data_begin pointer */
- MAD_ERROR_BADPART3LEN = 0x0236, /* bad audio data length */
- MAD_ERROR_BADHUFFTABLE = 0x0237, /* bad Huffman table select */
- MAD_ERROR_BADHUFFDATA = 0x0238, /* Huffman data overrun */
- MAD_ERROR_BADSTEREO = 0x0239 /* incompatible block_type for JS */
-};
-
-# define MAD_RECOVERABLE(error) ((error) & 0xff00)
-
-struct mad_stream {
- unsigned char const *buffer; /* input bitstream buffer */
- unsigned char const *bufend; /* end of buffer */
- unsigned long skiplen; /* bytes to skip before next frame */
-
- int sync; /* stream sync found */
- unsigned long freerate; /* free bitrate (fixed) */
-
- unsigned char const *this_frame; /* start of current frame */
- unsigned char const *next_frame; /* start of next frame */
- struct mad_bitptr ptr; /* current processing bit pointer */
-
- struct mad_bitptr anc_ptr; /* ancillary bits pointer */
- unsigned int anc_bitlen; /* number of ancillary bits */
-
- unsigned char (*main_data)[MAD_BUFFER_MDLEN];
- /* Layer III main_data() */
- unsigned int md_len; /* bytes in main_data */
-
- int options; /* decoding options (see below) */
- enum mad_error error; /* error code (see above) */
-};
-
-enum {
- MAD_OPTION_IGNORECRC = 0x0001, /* ignore CRC errors */
- MAD_OPTION_HALFSAMPLERATE = 0x0002 /* generate PCM at 1/2 sample rate */
-# if 0 /* not yet implemented */
- MAD_OPTION_LEFTCHANNEL = 0x0010, /* decode left channel only */
- MAD_OPTION_RIGHTCHANNEL = 0x0020, /* decode right channel only */
- MAD_OPTION_SINGLECHANNEL = 0x0030 /* combine channels */
-# endif
-};
-
-void mad_stream_init(struct mad_stream *);
-void mad_stream_finish(struct mad_stream *);
-
-# define mad_stream_options(stream, opts) \
- ((void) ((stream)->options = (opts)))
-
-void mad_stream_buffer(struct mad_stream *,
- unsigned char const *, unsigned long);
-void mad_stream_skip(struct mad_stream *, unsigned long);
-
-int mad_stream_sync(struct mad_stream *);
-
-char const *mad_stream_errorstr(struct mad_stream const *);
-
-# endif
diff --git a/src/libmad/synth.c b/src/libmad/synth.c
deleted file mode 100644
index c05ad3efc..000000000
--- a/src/libmad/synth.c
+++ /dev/null
@@ -1,857 +0,0 @@
-/*
- * libmad - MPEG audio decoder library
- * Copyright (C) 2000-2004 Underbit Technologies, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * $Id: synth.c,v 1.4 2006/09/26 03:02:20 dgp85 Exp $
- */
-
-# ifdef HAVE_CONFIG_H
-# include "config.h"
-# endif
-
-# include "global.h"
-
-# include "fixed.h"
-# include "frame.h"
-# include "synth.h"
-
-/*
- * NAME: synth->init()
- * DESCRIPTION: initialize synth struct
- */
-void mad_synth_init(struct mad_synth *synth)
-{
- mad_synth_mute(synth);
-
- synth->phase = 0;
-
- synth->pcm.samplerate = 0;
- synth->pcm.channels = 0;
- synth->pcm.length = 0;
-}
-
-/*
- * NAME: synth->mute()
- * DESCRIPTION: zero all polyphase filterbank values, resetting synthesis
- */
-void mad_synth_mute(struct mad_synth *synth)
-{
- unsigned int ch, s, v;
-
- for (ch = 0; ch < 2; ++ch) {
- for (s = 0; s < 16; ++s) {
- for (v = 0; v < 8; ++v) {
- synth->filter[ch][0][0][s][v] = synth->filter[ch][0][1][s][v] =
- synth->filter[ch][1][0][s][v] = synth->filter[ch][1][1][s][v] = 0;
- }
- }
- }
-}
-
-/*
- * An optional optimization called here the Subband Synthesis Optimization
- * (SSO) improves the performance of subband synthesis at the expense of
- * accuracy.
- *
- * The idea is to simplify 32x32->64-bit multiplication to 32x32->32 such
- * that extra scaling and rounding are not necessary. This often allows the
- * compiler to use faster 32-bit multiply-accumulate instructions instead of
- * explicit 64-bit multiply, shift, and add instructions.
- *
- * SSO works like this: a full 32x32->64-bit multiply of two mad_fixed_t
- * values requires the result to be right-shifted 28 bits to be properly
- * scaled to the same fixed-point format. Right shifts can be applied at any
- * time to either operand or to the result, so the optimization involves
- * careful placement of these shifts to minimize the loss of accuracy.
- *
- * First, a 14-bit shift is applied with rounding at compile-time to the D[]
- * table of coefficients for the subband synthesis window. This only loses 2
- * bits of accuracy because the lower 12 bits are always zero. A second
- * 12-bit shift occurs after the DCT calculation. This loses 12 bits of
- * accuracy. Finally, a third 2-bit shift occurs just before the sample is
- * saved in the PCM buffer. 14 + 12 + 2 == 28 bits.
- */
-
-/* FPM_DEFAULT without OPT_SSO will actually lose accuracy and performance */
-
-# if defined(FPM_DEFAULT) && !defined(OPT_SSO)
-# define OPT_SSO
-# endif
-
-/* second SSO shift, with rounding */
-
-# if defined(OPT_SSO)
-# define SHIFT(x) (((x) + (1L << 11)) >> 12)
-# else
-# define SHIFT(x) (x)
-# endif
-
-/* possible DCT speed optimization */
-
-# if defined(OPT_SPEED) && defined(MAD_F_MLX)
-# define OPT_DCTO
-# define MUL(x, y) \
- ({ mad_fixed64hi_t hi; \
- mad_fixed64lo_t lo; \
- MAD_F_MLX(hi, lo, (x), (y)); \
- hi << (32 - MAD_F_SCALEBITS - 3); \
- })
-# else
-# undef OPT_DCTO
-# define MUL(x, y) mad_f_mul((x), (y))
-# endif
-
-/*
- * NAME: dct32()
- * DESCRIPTION: perform fast in[32]->out[32] DCT
- */
-static
-void dct32(mad_fixed_t const in[32], unsigned int slot,
- mad_fixed_t lo[16][8], mad_fixed_t hi[16][8])
-{
- mad_fixed_t t0, t1, t2, t3, t4, t5, t6, t7;
- mad_fixed_t t8, t9, t10, t11, t12, t13, t14, t15;
- mad_fixed_t t16, t17, t18, t19, t20, t21, t22, t23;
- mad_fixed_t t24, t25, t26, t27, t28, t29, t30, t31;
- mad_fixed_t t32, t33, t34, t35, t36, t37, t38, t39;
- mad_fixed_t t40, t41, t42, t43, t44, t45, t46, t47;
- mad_fixed_t t48, t49, t50, t51, t52, t53, t54, t55;
- mad_fixed_t t56, t57, t58, t59, t60, t61, t62, t63;
- mad_fixed_t t64, t65, t66, t67, t68, t69, t70, t71;
- mad_fixed_t t72, t73, t74, t75, t76, t77, t78, t79;
- mad_fixed_t t80, t81, t82, t83, t84, t85, t86, t87;
- mad_fixed_t t88, t89, t90, t91, t92, t93, t94, t95;
- mad_fixed_t t96, t97, t98, t99, t100, t101, t102, t103;
- mad_fixed_t t104, t105, t106, t107, t108, t109, t110, t111;
- mad_fixed_t t112, t113, t114, t115, t116, t117, t118, t119;
- mad_fixed_t t120, t121, t122, t123, t124, t125, t126, t127;
- mad_fixed_t t128, t129, t130, t131, t132, t133, t134, t135;
- mad_fixed_t t136, t137, t138, t139, t140, t141, t142, t143;
- mad_fixed_t t144, t145, t146, t147, t148, t149, t150, t151;
- mad_fixed_t t152, t153, t154, t155, t156, t157, t158, t159;
- mad_fixed_t t160, t161, t162, t163, t164, t165, t166, t167;
- mad_fixed_t t168, t169, t170, t171, t172, t173, t174, t175;
- mad_fixed_t t176;
-
- /* costab[i] = cos(PI / (2 * 32) * i) */
-
-# if defined(OPT_DCTO)
-# define costab1 MAD_F(0x7fd8878e)
-# define costab2 MAD_F(0x7f62368f)
-# define costab3 MAD_F(0x7e9d55fc)
-# define costab4 MAD_F(0x7d8a5f40)
-# define costab5 MAD_F(0x7c29fbee)
-# define costab6 MAD_F(0x7a7d055b)
-# define costab7 MAD_F(0x78848414)
-# define costab8 MAD_F(0x7641af3d)
-# define costab9 MAD_F(0x73b5ebd1)
-# define costab10 MAD_F(0x70e2cbc6)
-# define costab11 MAD_F(0x6dca0d14)
-# define costab12 MAD_F(0x6a6d98a4)
-# define costab13 MAD_F(0x66cf8120)
-# define costab14 MAD_F(0x62f201ac)
-# define costab15 MAD_F(0x5ed77c8a)
-# define costab16 MAD_F(0x5a82799a)
-# define costab17 MAD_F(0x55f5a4d2)
-# define costab18 MAD_F(0x5133cc94)
-# define costab19 MAD_F(0x4c3fdff4)
-# define costab20 MAD_F(0x471cece7)
-# define costab21 MAD_F(0x41ce1e65)
-# define costab22 MAD_F(0x3c56ba70)
-# define costab23 MAD_F(0x36ba2014)
-# define costab24 MAD_F(0x30fbc54d)
-# define costab25 MAD_F(0x2b1f34eb)
-# define costab26 MAD_F(0x25280c5e)
-# define costab27 MAD_F(0x1f19f97b)
-# define costab28 MAD_F(0x18f8b83c)
-# define costab29 MAD_F(0x12c8106f)
-# define costab30 MAD_F(0x0c8bd35e)
-# define costab31 MAD_F(0x0647d97c)
-# else
-# define costab1 MAD_F(0x0ffb10f2) /* 0.998795456 */
-# define costab2 MAD_F(0x0fec46d2) /* 0.995184727 */
-# define costab3 MAD_F(0x0fd3aac0) /* 0.989176510 */
-# define costab4 MAD_F(0x0fb14be8) /* 0.980785280 */
-# define costab5 MAD_F(0x0f853f7e) /* 0.970031253 */
-# define costab6 MAD_F(0x0f4fa0ab) /* 0.956940336 */
-# define costab7 MAD_F(0x0f109082) /* 0.941544065 */
-# define costab8 MAD_F(0x0ec835e8) /* 0.923879533 */
-# define costab9 MAD_F(0x0e76bd7a) /* 0.903989293 */
-# define costab10 MAD_F(0x0e1c5979) /* 0.881921264 */
-# define costab11 MAD_F(0x0db941a3) /* 0.857728610 */
-# define costab12 MAD_F(0x0d4db315) /* 0.831469612 */
-# define costab13 MAD_F(0x0cd9f024) /* 0.803207531 */
-# define costab14 MAD_F(0x0c5e4036) /* 0.773010453 */
-# define costab15 MAD_F(0x0bdaef91) /* 0.740951125 */
-# define costab16 MAD_F(0x0b504f33) /* 0.707106781 */
-# define costab17 MAD_F(0x0abeb49a) /* 0.671558955 */
-# define costab18 MAD_F(0x0a267993) /* 0.634393284 */
-# define costab19 MAD_F(0x0987fbfe) /* 0.595699304 */
-# define costab20 MAD_F(0x08e39d9d) /* 0.555570233 */
-# define costab21 MAD_F(0x0839c3cd) /* 0.514102744 */
-# define costab22 MAD_F(0x078ad74e) /* 0.471396737 */
-# define costab23 MAD_F(0x06d74402) /* 0.427555093 */
-# define costab24 MAD_F(0x061f78aa) /* 0.382683432 */
-# define costab25 MAD_F(0x0563e69d) /* 0.336889853 */
-# define costab26 MAD_F(0x04a5018c) /* 0.290284677 */
-# define costab27 MAD_F(0x03e33f2f) /* 0.242980180 */
-# define costab28 MAD_F(0x031f1708) /* 0.195090322 */
-# define costab29 MAD_F(0x0259020e) /* 0.146730474 */
-# define costab30 MAD_F(0x01917a6c) /* 0.098017140 */
-# define costab31 MAD_F(0x00c8fb30) /* 0.049067674 */
-# endif
-
- t0 = in[0] + in[31]; t16 = MUL(in[0] - in[31], costab1);
- t1 = in[15] + in[16]; t17 = MUL(in[15] - in[16], costab31);
-
- t41 = t16 + t17;
- t59 = MUL(t16 - t17, costab2);
- t33 = t0 + t1;
- t50 = MUL(t0 - t1, costab2);
-
- t2 = in[7] + in[24]; t18 = MUL(in[7] - in[24], costab15);
- t3 = in[8] + in[23]; t19 = MUL(in[8] - in[23], costab17);
-
- t42 = t18 + t19;
- t60 = MUL(t18 - t19, costab30);
- t34 = t2 + t3;
- t51 = MUL(t2 - t3, costab30);
-
- t4 = in[3] + in[28]; t20 = MUL(in[3] - in[28], costab7);
- t5 = in[12] + in[19]; t21 = MUL(in[12] - in[19], costab25);
-
- t43 = t20 + t21;
- t61 = MUL(t20 - t21, costab14);
- t35 = t4 + t5;
- t52 = MUL(t4 - t5, costab14);
-
- t6 = in[4] + in[27]; t22 = MUL(in[4] - in[27], costab9);
- t7 = in[11] + in[20]; t23 = MUL(in[11] - in[20], costab23);
-
- t44 = t22 + t23;
- t62 = MUL(t22 - t23, costab18);
- t36 = t6 + t7;
- t53 = MUL(t6 - t7, costab18);
-
- t8 = in[1] + in[30]; t24 = MUL(in[1] - in[30], costab3);
- t9 = in[14] + in[17]; t25 = MUL(in[14] - in[17], costab29);
-
- t45 = t24 + t25;
- t63 = MUL(t24 - t25, costab6);
- t37 = t8 + t9;
- t54 = MUL(t8 - t9, costab6);
-
- t10 = in[6] + in[25]; t26 = MUL(in[6] - in[25], costab13);
- t11 = in[9] + in[22]; t27 = MUL(in[9] - in[22], costab19);
-
- t46 = t26 + t27;
- t64 = MUL(t26 - t27, costab26);
- t38 = t10 + t11;
- t55 = MUL(t10 - t11, costab26);
-
- t12 = in[2] + in[29]; t28 = MUL(in[2] - in[29], costab5);
- t13 = in[13] + in[18]; t29 = MUL(in[13] - in[18], costab27);
-
- t47 = t28 + t29;
- t65 = MUL(t28 - t29, costab10);
- t39 = t12 + t13;
- t56 = MUL(t12 - t13, costab10);
-
- t14 = in[5] + in[26]; t30 = MUL(in[5] - in[26], costab11);
- t15 = in[10] + in[21]; t31 = MUL(in[10] - in[21], costab21);
-
- t48 = t30 + t31;
- t66 = MUL(t30 - t31, costab22);
- t40 = t14 + t15;
- t57 = MUL(t14 - t15, costab22);
-
- t69 = t33 + t34; t89 = MUL(t33 - t34, costab4);
- t70 = t35 + t36; t90 = MUL(t35 - t36, costab28);
- t71 = t37 + t38; t91 = MUL(t37 - t38, costab12);
- t72 = t39 + t40; t92 = MUL(t39 - t40, costab20);
- t73 = t41 + t42; t94 = MUL(t41 - t42, costab4);
- t74 = t43 + t44; t95 = MUL(t43 - t44, costab28);
- t75 = t45 + t46; t96 = MUL(t45 - t46, costab12);
- t76 = t47 + t48; t97 = MUL(t47 - t48, costab20);
-
- t78 = t50 + t51; t100 = MUL(t50 - t51, costab4);
- t79 = t52 + t53; t101 = MUL(t52 - t53, costab28);
- t80 = t54 + t55; t102 = MUL(t54 - t55, costab12);
- t81 = t56 + t57; t103 = MUL(t56 - t57, costab20);
-
- t83 = t59 + t60; t106 = MUL(t59 - t60, costab4);
- t84 = t61 + t62; t107 = MUL(t61 - t62, costab28);
- t85 = t63 + t64; t108 = MUL(t63 - t64, costab12);
- t86 = t65 + t66; t109 = MUL(t65 - t66, costab20);
-
- t113 = t69 + t70;
- t114 = t71 + t72;
-
- /* 0 */ hi[15][slot] = SHIFT(t113 + t114);
- /* 16 */ lo[ 0][slot] = SHIFT(MUL(t113 - t114, costab16));
-
- t115 = t73 + t74;
- t116 = t75 + t76;
-
- t32 = t115 + t116;
-
- /* 1 */ hi[14][slot] = SHIFT(t32);
-
- t118 = t78 + t79;
- t119 = t80 + t81;
-
- t58 = t118 + t119;
-
- /* 2 */ hi[13][slot] = SHIFT(t58);
-
- t121 = t83 + t84;
- t122 = t85 + t86;
-
- t67 = t121 + t122;
-
- t49 = (t67 * 2) - t32;
-
- /* 3 */ hi[12][slot] = SHIFT(t49);
-
- t125 = t89 + t90;
- t126 = t91 + t92;
-
- t93 = t125 + t126;
-
- /* 4 */ hi[11][slot] = SHIFT(t93);
-
- t128 = t94 + t95;
- t129 = t96 + t97;
-
- t98 = t128 + t129;
-
- t68 = (t98 * 2) - t49;
-
- /* 5 */ hi[10][slot] = SHIFT(t68);
-
- t132 = t100 + t101;
- t133 = t102 + t103;
-
- t104 = t132 + t133;
-
- t82 = (t104 * 2) - t58;
-
- /* 6 */ hi[ 9][slot] = SHIFT(t82);
-
- t136 = t106 + t107;
- t137 = t108 + t109;
-
- t110 = t136 + t137;
-
- t87 = (t110 * 2) - t67;
-
- t77 = (t87 * 2) - t68;
-
- /* 7 */ hi[ 8][slot] = SHIFT(t77);
-
- t141 = MUL(t69 - t70, costab8);
- t142 = MUL(t71 - t72, costab24);
- t143 = t141 + t142;
-
- /* 8 */ hi[ 7][slot] = SHIFT(t143);
- /* 24 */ lo[ 8][slot] =
- SHIFT((MUL(t141 - t142, costab16) * 2) - t143);
-
- t144 = MUL(t73 - t74, costab8);
- t145 = MUL(t75 - t76, costab24);
- t146 = t144 + t145;
-
- t88 = (t146 * 2) - t77;
-
- /* 9 */ hi[ 6][slot] = SHIFT(t88);
-
- t148 = MUL(t78 - t79, costab8);
- t149 = MUL(t80 - t81, costab24);
- t150 = t148 + t149;
-
- t105 = (t150 * 2) - t82;
-
- /* 10 */ hi[ 5][slot] = SHIFT(t105);
-
- t152 = MUL(t83 - t84, costab8);
- t153 = MUL(t85 - t86, costab24);
- t154 = t152 + t153;
-
- t111 = (t154 * 2) - t87;
-
- t99 = (t111 * 2) - t88;
-
- /* 11 */ hi[ 4][slot] = SHIFT(t99);
-
- t157 = MUL(t89 - t90, costab8);
- t158 = MUL(t91 - t92, costab24);
- t159 = t157 + t158;
-
- t127 = (t159 * 2) - t93;
-
- /* 12 */ hi[ 3][slot] = SHIFT(t127);
-
- t160 = (MUL(t125 - t126, costab16) * 2) - t127;
-
- /* 20 */ lo[ 4][slot] = SHIFT(t160);
- /* 28 */ lo[12][slot] =
- SHIFT((((MUL(t157 - t158, costab16) * 2) - t159) * 2) - t160);
-
- t161 = MUL(t94 - t95, costab8);
- t162 = MUL(t96 - t97, costab24);
- t163 = t161 + t162;
-
- t130 = (t163 * 2) - t98;
-
- t112 = (t130 * 2) - t99;
-
- /* 13 */ hi[ 2][slot] = SHIFT(t112);
-
- t164 = (MUL(t128 - t129, costab16) * 2) - t130;
-
- t166 = MUL(t100 - t101, costab8);
- t167 = MUL(t102 - t103, costab24);
- t168 = t166 + t167;
-
- t134 = (t168 * 2) - t104;
-
- t120 = (t134 * 2) - t105;
-
- /* 14 */ hi[ 1][slot] = SHIFT(t120);
-
- t135 = (MUL(t118 - t119, costab16) * 2) - t120;
-
- /* 18 */ lo[ 2][slot] = SHIFT(t135);
-
- t169 = (MUL(t132 - t133, costab16) * 2) - t134;
-
- t151 = (t169 * 2) - t135;
-
- /* 22 */ lo[ 6][slot] = SHIFT(t151);
-
- t170 = (((MUL(t148 - t149, costab16) * 2) - t150) * 2) - t151;
-
- /* 26 */ lo[10][slot] = SHIFT(t170);
- /* 30 */ lo[14][slot] =
- SHIFT((((((MUL(t166 - t167, costab16) * 2) -
- t168) * 2) - t169) * 2) - t170);
-
- t171 = MUL(t106 - t107, costab8);
- t172 = MUL(t108 - t109, costab24);
- t173 = t171 + t172;
-
- t138 = (t173 * 2) - t110;
-
- t123 = (t138 * 2) - t111;
-
- t139 = (MUL(t121 - t122, costab16) * 2) - t123;
-
- t117 = (t123 * 2) - t112;
-
- /* 15 */ hi[ 0][slot] = SHIFT(t117);
-
- t124 = (MUL(t115 - t116, costab16) * 2) - t117;
-
- /* 17 */ lo[ 1][slot] = SHIFT(t124);
-
- t131 = (t139 * 2) - t124;
-
- /* 19 */ lo[ 3][slot] = SHIFT(t131);
-
- t140 = (t164 * 2) - t131;
-
- /* 21 */ lo[ 5][slot] = SHIFT(t140);
-
- t174 = (MUL(t136 - t137, costab16) * 2) - t138;
-
- t155 = (t174 * 2) - t139;
-
- t147 = (t155 * 2) - t140;
-
- /* 23 */ lo[ 7][slot] = SHIFT(t147);
-
- t156 = (((MUL(t144 - t145, costab16) * 2) - t146) * 2) - t147;
-
- /* 25 */ lo[ 9][slot] = SHIFT(t156);
-
- t175 = (((MUL(t152 - t153, costab16) * 2) - t154) * 2) - t155;
-
- t165 = (t175 * 2) - t156;
-
- /* 27 */ lo[11][slot] = SHIFT(t165);
-
- t176 = (((((MUL(t161 - t162, costab16) * 2) -
- t163) * 2) - t164) * 2) - t165;
-
- /* 29 */ lo[13][slot] = SHIFT(t176);
- /* 31 */ lo[15][slot] =
- SHIFT((((((((MUL(t171 - t172, costab16) * 2) -
- t173) * 2) - t174) * 2) - t175) * 2) - t176);
-
- /*
- * Totals:
- * 80 multiplies
- * 80 additions
- * 119 subtractions
- * 49 shifts (not counting SSO)
- */
-}
-
-# undef MUL
-# undef SHIFT
-
-/* third SSO shift and/or D[] optimization preshift */
-
-# if defined(OPT_SSO)
-# if MAD_F_FRACBITS != 28
-# error "MAD_F_FRACBITS must be 28 to use OPT_SSO"
-# endif
-# define ML0(hi, lo, x, y) ((lo) = (x) * (y))
-# define MLA(hi, lo, x, y) ((lo) += (x) * (y))
-# define MLN(hi, lo) ((lo) = -(lo))
-# define MLZ(hi, lo) ((void) (hi), (mad_fixed_t) (lo))
-# define SHIFT(x) ((x) >> 2)
-# define PRESHIFT(x) ((MAD_F(x) + (1L << 13)) >> 14)
-# else
-# define ML0(hi, lo, x, y) MAD_F_ML0((hi), (lo), (x), (y))
-# define MLA(hi, lo, x, y) MAD_F_MLA((hi), (lo), (x), (y))
-# define MLN(hi, lo) MAD_F_MLN((hi), (lo))
-# define MLZ(hi, lo) MAD_F_MLZ((hi), (lo))
-# define SHIFT(x) (x)
-# if defined(MAD_F_SCALEBITS)
-# undef MAD_F_SCALEBITS
-# define MAD_F_SCALEBITS (MAD_F_FRACBITS - 12)
-# define PRESHIFT(x) (MAD_F(x) >> 12)
-# else
-# define PRESHIFT(x) MAD_F(x)
-# endif
-# endif
-
-static
-mad_fixed_t const D[17][32] = {
-# include "D.dat"
-};
-
-# if defined(ASO_SYNTH)
-void synth_full(struct mad_synth *, struct mad_frame const *,
- unsigned int, unsigned int);
-# else
-/*
- * NAME: synth->full()
- * DESCRIPTION: perform full frequency PCM synthesis
- */
-static
-void synth_full(struct mad_synth *synth, struct mad_frame const *frame,
- unsigned int nch, unsigned int ns)
-{
- unsigned int phase, ch, s, sb, pe, po;
- mad_fixed_t *pcm1, *pcm2, (*filter)[2][2][16][8];
- mad_fixed_t const (*sbsample)[36][32];
- register mad_fixed_t (*fe)[8], (*fx)[8], (*fo)[8];
- register mad_fixed_t const (*Dptr)[32], *ptr;
- register mad_fixed64hi_t hi = 0;
- register mad_fixed64lo_t lo = 0;
-
- for (ch = 0; ch < nch; ++ch) {
- sbsample = &frame->sbsample[ch];
- filter = &synth->filter[ch];
- phase = synth->phase;
- pcm1 = synth->pcm.samples[ch];
-
- for (s = 0; s < ns; ++s) {
- dct32((*sbsample)[s], phase >> 1,
- (*filter)[0][phase & 1], (*filter)[1][phase & 1]);
-
- pe = phase & ~1;
- po = ((phase - 1) & 0xf) | 1;
-
- /* calculate 32 samples */
-
- fe = &(*filter)[0][ phase & 1][0];
- fx = &(*filter)[0][~phase & 1][0];
- fo = &(*filter)[1][~phase & 1][0];
-
- Dptr = &D[0];
-
- ptr = *Dptr + po;
- ML0(hi, lo, (*fx)[0], ptr[ 0]);
- MLA(hi, lo, (*fx)[1], ptr[14]);
- MLA(hi, lo, (*fx)[2], ptr[12]);
- MLA(hi, lo, (*fx)[3], ptr[10]);
- MLA(hi, lo, (*fx)[4], ptr[ 8]);
- MLA(hi, lo, (*fx)[5], ptr[ 6]);
- MLA(hi, lo, (*fx)[6], ptr[ 4]);
- MLA(hi, lo, (*fx)[7], ptr[ 2]);
- MLN(hi, lo);
-
- ptr = *Dptr + pe;
- MLA(hi, lo, (*fe)[0], ptr[ 0]);
- MLA(hi, lo, (*fe)[1], ptr[14]);
- MLA(hi, lo, (*fe)[2], ptr[12]);
- MLA(hi, lo, (*fe)[3], ptr[10]);
- MLA(hi, lo, (*fe)[4], ptr[ 8]);
- MLA(hi, lo, (*fe)[5], ptr[ 6]);
- MLA(hi, lo, (*fe)[6], ptr[ 4]);
- MLA(hi, lo, (*fe)[7], ptr[ 2]);
-
- *pcm1++ = SHIFT(MLZ(hi, lo));
-
- pcm2 = pcm1 + 30;
-
- for (sb = 1; sb < 16; ++sb) {
- ++fe;
- ++Dptr;
-
- /* D[32 - sb][i] == -D[sb][31 - i] */
-
- ptr = *Dptr + po;
- ML0(hi, lo, (*fo)[0], ptr[ 0]);
- MLA(hi, lo, (*fo)[1], ptr[14]);
- MLA(hi, lo, (*fo)[2], ptr[12]);
- MLA(hi, lo, (*fo)[3], ptr[10]);
- MLA(hi, lo, (*fo)[4], ptr[ 8]);
- MLA(hi, lo, (*fo)[5], ptr[ 6]);
- MLA(hi, lo, (*fo)[6], ptr[ 4]);
- MLA(hi, lo, (*fo)[7], ptr[ 2]);
- MLN(hi, lo);
-
- ptr = *Dptr + pe;
- MLA(hi, lo, (*fe)[7], ptr[ 2]);
- MLA(hi, lo, (*fe)[6], ptr[ 4]);
- MLA(hi, lo, (*fe)[5], ptr[ 6]);
- MLA(hi, lo, (*fe)[4], ptr[ 8]);
- MLA(hi, lo, (*fe)[3], ptr[10]);
- MLA(hi, lo, (*fe)[2], ptr[12]);
- MLA(hi, lo, (*fe)[1], ptr[14]);
- MLA(hi, lo, (*fe)[0], ptr[ 0]);
-
- *pcm1++ = SHIFT(MLZ(hi, lo));
-
- ptr = *Dptr - pe;
- ML0(hi, lo, (*fe)[0], ptr[31 - 16]);
- MLA(hi, lo, (*fe)[1], ptr[31 - 14]);
- MLA(hi, lo, (*fe)[2], ptr[31 - 12]);
- MLA(hi, lo, (*fe)[3], ptr[31 - 10]);
- MLA(hi, lo, (*fe)[4], ptr[31 - 8]);
- MLA(hi, lo, (*fe)[5], ptr[31 - 6]);
- MLA(hi, lo, (*fe)[6], ptr[31 - 4]);
- MLA(hi, lo, (*fe)[7], ptr[31 - 2]);
-
- ptr = *Dptr - po;
- MLA(hi, lo, (*fo)[7], ptr[31 - 2]);
- MLA(hi, lo, (*fo)[6], ptr[31 - 4]);
- MLA(hi, lo, (*fo)[5], ptr[31 - 6]);
- MLA(hi, lo, (*fo)[4], ptr[31 - 8]);
- MLA(hi, lo, (*fo)[3], ptr[31 - 10]);
- MLA(hi, lo, (*fo)[2], ptr[31 - 12]);
- MLA(hi, lo, (*fo)[1], ptr[31 - 14]);
- MLA(hi, lo, (*fo)[0], ptr[31 - 16]);
-
- *pcm2-- = SHIFT(MLZ(hi, lo));
-
- ++fo;
- }
-
- ++Dptr;
-
- ptr = *Dptr + po;
- ML0(hi, lo, (*fo)[0], ptr[ 0]);
- MLA(hi, lo, (*fo)[1], ptr[14]);
- MLA(hi, lo, (*fo)[2], ptr[12]);
- MLA(hi, lo, (*fo)[3], ptr[10]);
- MLA(hi, lo, (*fo)[4], ptr[ 8]);
- MLA(hi, lo, (*fo)[5], ptr[ 6]);
- MLA(hi, lo, (*fo)[6], ptr[ 4]);
- MLA(hi, lo, (*fo)[7], ptr[ 2]);
-
- *pcm1 = SHIFT(-MLZ(hi, lo));
- pcm1 += 16;
-
- phase = (phase + 1) % 16;
- }
- }
-}
-# endif
-
-/*
- * NAME: synth->half()
- * DESCRIPTION: perform half frequency PCM synthesis
- */
-static
-void synth_half(struct mad_synth *synth, struct mad_frame const *frame,
- unsigned int nch, unsigned int ns)
-{
- unsigned int phase, ch, s, sb, pe, po;
- mad_fixed_t *pcm1, *pcm2, (*filter)[2][2][16][8];
- mad_fixed_t const (*sbsample)[36][32];
- register mad_fixed_t (*fe)[8], (*fx)[8], (*fo)[8];
- register mad_fixed_t const (*Dptr)[32], *ptr;
- register mad_fixed64hi_t hi = 0;
- register mad_fixed64lo_t lo = 0;
-
- for (ch = 0; ch < nch; ++ch) {
- sbsample = &frame->sbsample[ch];
- filter = &synth->filter[ch];
- phase = synth->phase;
- pcm1 = synth->pcm.samples[ch];
-
- for (s = 0; s < ns; ++s) {
- dct32((*sbsample)[s], phase >> 1,
- (*filter)[0][phase & 1], (*filter)[1][phase & 1]);
-
- pe = phase & ~1;
- po = ((phase - 1) & 0xf) | 1;
-
- /* calculate 16 samples */
-
- fe = &(*filter)[0][ phase & 1][0];
- fx = &(*filter)[0][~phase & 1][0];
- fo = &(*filter)[1][~phase & 1][0];
-
- Dptr = &D[0];
-
- ptr = *Dptr + po;
- ML0(hi, lo, (*fx)[0], ptr[ 0]);
- MLA(hi, lo, (*fx)[1], ptr[14]);
- MLA(hi, lo, (*fx)[2], ptr[12]);
- MLA(hi, lo, (*fx)[3], ptr[10]);
- MLA(hi, lo, (*fx)[4], ptr[ 8]);
- MLA(hi, lo, (*fx)[5], ptr[ 6]);
- MLA(hi, lo, (*fx)[6], ptr[ 4]);
- MLA(hi, lo, (*fx)[7], ptr[ 2]);
- MLN(hi, lo);
-
- ptr = *Dptr + pe;
- MLA(hi, lo, (*fe)[0], ptr[ 0]);
- MLA(hi, lo, (*fe)[1], ptr[14]);
- MLA(hi, lo, (*fe)[2], ptr[12]);
- MLA(hi, lo, (*fe)[3], ptr[10]);
- MLA(hi, lo, (*fe)[4], ptr[ 8]);
- MLA(hi, lo, (*fe)[5], ptr[ 6]);
- MLA(hi, lo, (*fe)[6], ptr[ 4]);
- MLA(hi, lo, (*fe)[7], ptr[ 2]);
-
- *pcm1++ = SHIFT(MLZ(hi, lo));
-
- pcm2 = pcm1 + 14;
-
- for (sb = 1; sb < 16; ++sb) {
- ++fe;
- ++Dptr;
-
- /* D[32 - sb][i] == -D[sb][31 - i] */
-
- if (!(sb & 1)) {
- ptr = *Dptr + po;
- ML0(hi, lo, (*fo)[0], ptr[ 0]);
- MLA(hi, lo, (*fo)[1], ptr[14]);
- MLA(hi, lo, (*fo)[2], ptr[12]);
- MLA(hi, lo, (*fo)[3], ptr[10]);
- MLA(hi, lo, (*fo)[4], ptr[ 8]);
- MLA(hi, lo, (*fo)[5], ptr[ 6]);
- MLA(hi, lo, (*fo)[6], ptr[ 4]);
- MLA(hi, lo, (*fo)[7], ptr[ 2]);
- MLN(hi, lo);
-
- ptr = *Dptr + pe;
- MLA(hi, lo, (*fe)[7], ptr[ 2]);
- MLA(hi, lo, (*fe)[6], ptr[ 4]);
- MLA(hi, lo, (*fe)[5], ptr[ 6]);
- MLA(hi, lo, (*fe)[4], ptr[ 8]);
- MLA(hi, lo, (*fe)[3], ptr[10]);
- MLA(hi, lo, (*fe)[2], ptr[12]);
- MLA(hi, lo, (*fe)[1], ptr[14]);
- MLA(hi, lo, (*fe)[0], ptr[ 0]);
-
- *pcm1++ = SHIFT(MLZ(hi, lo));
-
- ptr = *Dptr - po;
- ML0(hi, lo, (*fo)[7], ptr[31 - 2]);
- MLA(hi, lo, (*fo)[6], ptr[31 - 4]);
- MLA(hi, lo, (*fo)[5], ptr[31 - 6]);
- MLA(hi, lo, (*fo)[4], ptr[31 - 8]);
- MLA(hi, lo, (*fo)[3], ptr[31 - 10]);
- MLA(hi, lo, (*fo)[2], ptr[31 - 12]);
- MLA(hi, lo, (*fo)[1], ptr[31 - 14]);
- MLA(hi, lo, (*fo)[0], ptr[31 - 16]);
-
- ptr = *Dptr - pe;
- MLA(hi, lo, (*fe)[0], ptr[31 - 16]);
- MLA(hi, lo, (*fe)[1], ptr[31 - 14]);
- MLA(hi, lo, (*fe)[2], ptr[31 - 12]);
- MLA(hi, lo, (*fe)[3], ptr[31 - 10]);
- MLA(hi, lo, (*fe)[4], ptr[31 - 8]);
- MLA(hi, lo, (*fe)[5], ptr[31 - 6]);
- MLA(hi, lo, (*fe)[6], ptr[31 - 4]);
- MLA(hi, lo, (*fe)[7], ptr[31 - 2]);
-
- *pcm2-- = SHIFT(MLZ(hi, lo));
- }
-
- ++fo;
- }
-
- ++Dptr;
-
- ptr = *Dptr + po;
- ML0(hi, lo, (*fo)[0], ptr[ 0]);
- MLA(hi, lo, (*fo)[1], ptr[14]);
- MLA(hi, lo, (*fo)[2], ptr[12]);
- MLA(hi, lo, (*fo)[3], ptr[10]);
- MLA(hi, lo, (*fo)[4], ptr[ 8]);
- MLA(hi, lo, (*fo)[5], ptr[ 6]);
- MLA(hi, lo, (*fo)[6], ptr[ 4]);
- MLA(hi, lo, (*fo)[7], ptr[ 2]);
-
- *pcm1 = SHIFT(-MLZ(hi, lo));
- pcm1 += 8;
-
- phase = (phase + 1) % 16;
- }
- }
-}
-
-/*
- * NAME: synth->frame()
- * DESCRIPTION: perform PCM synthesis of frame subband samples
- */
-void mad_synth_frame(struct mad_synth *synth, struct mad_frame const *frame)
-{
- unsigned int nch, ns;
- void (*synth_frame)(struct mad_synth *, struct mad_frame const *,
- unsigned int, unsigned int);
-
- nch = MAD_NCHANNELS(&frame->header);
- ns = MAD_NSBSAMPLES(&frame->header);
-
- synth->pcm.samplerate = frame->header.samplerate;
- synth->pcm.channels = nch;
- synth->pcm.length = 32 * ns;
-
- synth_frame = synth_full;
-
- if (frame->options & MAD_OPTION_HALFSAMPLERATE) {
- synth->pcm.samplerate /= 2;
- synth->pcm.length /= 2;
-
- synth_frame = synth_half;
- }
-
- synth_frame(synth, frame, nch, ns);
-
- synth->phase = (synth->phase + ns) % 16;
-}
diff --git a/src/libmad/synth.h b/src/libmad/synth.h
deleted file mode 100644
index d5a63589e..000000000
--- a/src/libmad/synth.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * libmad - MPEG audio decoder library
- * Copyright (C) 2000-2004 Underbit Technologies, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * $Id: synth.h,v 1.3 2004/04/22 00:23:24 miguelfreitas Exp $
- */
-
-# ifndef LIBMAD_SYNTH_H
-# define LIBMAD_SYNTH_H
-
-# include "fixed.h"
-# include "frame.h"
-
-struct mad_pcm {
- unsigned int samplerate; /* sampling frequency (Hz) */
- unsigned short channels; /* number of channels */
- unsigned short length; /* number of samples per channel */
- mad_fixed_t samples[2][1152]; /* PCM output samples [ch][sample] */
-};
-
-struct mad_synth {
- mad_fixed_t filter[2][2][2][16][8]; /* polyphase filterbank outputs */
- /* [ch][eo][peo][s][v] */
-
- unsigned int phase; /* current processing phase */
-
- struct mad_pcm pcm; /* PCM output */
-};
-
-/* single channel PCM selector */
-enum {
- MAD_PCM_CHANNEL_SINGLE = 0
-};
-
-/* dual channel PCM selector */
-enum {
- MAD_PCM_CHANNEL_DUAL_1 = 0,
- MAD_PCM_CHANNEL_DUAL_2 = 1
-};
-
-/* stereo PCM selector */
-enum {
- MAD_PCM_CHANNEL_STEREO_LEFT = 0,
- MAD_PCM_CHANNEL_STEREO_RIGHT = 1
-};
-
-void mad_synth_init(struct mad_synth *);
-
-# define mad_synth_finish(synth) /* nothing */
-
-void mad_synth_mute(struct mad_synth *);
-
-void mad_synth_frame(struct mad_synth *, struct mad_frame const *);
-
-# endif
diff --git a/src/libmad/timer.c b/src/libmad/timer.c
deleted file mode 100644
index 9aa2e8924..000000000
--- a/src/libmad/timer.c
+++ /dev/null
@@ -1,485 +0,0 @@
-/*
- * libmad - MPEG audio decoder library
- * Copyright (C) 2000-2004 Underbit Technologies, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * $Id: timer.c,v 1.6 2004/04/22 00:23:26 miguelfreitas Exp $
- */
-
-# ifdef HAVE_CONFIG_H
-# include "config.h"
-# endif
-
-# include "global.h"
-
-# include <stdio.h>
-
-# ifdef HAVE_ASSERT_H
-# include <assert.h>
-# endif
-
-# include "timer.h"
-
-mad_timer_t const mad_timer_zero = { 0, 0 };
-
-/*
- * NAME: timer->compare()
- * DESCRIPTION: indicate relative order of two timers
- */
-int mad_timer_compare(mad_timer_t timer1, mad_timer_t timer2)
-{
- signed long diff;
-
- diff = timer1.seconds - timer2.seconds;
- if (diff < 0)
- return -1;
- else if (diff > 0)
- return +1;
-
- diff = timer1.fraction - timer2.fraction;
- if (diff < 0)
- return -1;
- else if (diff > 0)
- return +1;
-
- return 0;
-}
-
-/*
- * NAME: timer->negate()
- * DESCRIPTION: invert the sign of a timer
- */
-void mad_timer_negate(mad_timer_t *timer)
-{
- timer->seconds = -timer->seconds;
-
- if (timer->fraction) {
- timer->seconds -= 1;
- timer->fraction = MAD_TIMER_RESOLUTION - timer->fraction;
- }
-}
-
-/*
- * NAME: timer->abs()
- * DESCRIPTION: return the absolute value of a timer
- */
-mad_timer_t mad_timer_abs(mad_timer_t timer)
-{
- if (timer.seconds < 0)
- mad_timer_negate(&timer);
-
- return timer;
-}
-
-/*
- * NAME: reduce_timer()
- * DESCRIPTION: carry timer fraction into seconds
- */
-static
-void reduce_timer(mad_timer_t *timer)
-{
- timer->seconds += timer->fraction / MAD_TIMER_RESOLUTION;
- timer->fraction %= MAD_TIMER_RESOLUTION;
-}
-
-/*
- * NAME: gcd()
- * DESCRIPTION: compute greatest common denominator
- */
-static
-unsigned long gcd(unsigned long num1, unsigned long num2)
-{
- unsigned long tmp;
-
- while (num2) {
- tmp = num2;
- num2 = num1 % num2;
- num1 = tmp;
- }
-
- return num1;
-}
-
-/*
- * NAME: reduce_rational()
- * DESCRIPTION: convert rational expression to lowest terms
- */
-static
-void reduce_rational(unsigned long *numer, unsigned long *denom)
-{
- unsigned long factor;
-
- factor = gcd(*numer, *denom);
-
- assert(factor != 0);
-
- *numer /= factor;
- *denom /= factor;
-}
-
-/*
- * NAME: scale_rational()
- * DESCRIPTION: solve numer/denom == ?/scale avoiding overflowing
- */
-static
-unsigned long scale_rational(unsigned long numer, unsigned long denom,
- unsigned long scale)
-{
- reduce_rational(&numer, &denom);
- reduce_rational(&scale, &denom);
-
- assert(denom != 0);
-
- if (denom < scale)
- return numer * (scale / denom) + numer * (scale % denom) / denom;
- if (denom < numer)
- return scale * (numer / denom) + scale * (numer % denom) / denom;
-
- return numer * scale / denom;
-}
-
-/*
- * NAME: timer->set()
- * DESCRIPTION: set timer to specific (positive) value
- */
-void mad_timer_set(mad_timer_t *timer, unsigned long seconds,
- unsigned long numer, unsigned long denom)
-{
- timer->seconds = seconds;
- if (numer >= denom && denom > 0) {
- timer->seconds += numer / denom;
- numer %= denom;
- }
-
- switch (denom) {
- case 0:
- case 1:
- timer->fraction = 0;
- break;
-
- case MAD_TIMER_RESOLUTION:
- timer->fraction = numer;
- break;
-
- case 1000:
- timer->fraction = numer * (MAD_TIMER_RESOLUTION / 1000);
- break;
-
- case 8000:
- timer->fraction = numer * (MAD_TIMER_RESOLUTION / 8000);
- break;
-
- case 11025:
- timer->fraction = numer * (MAD_TIMER_RESOLUTION / 11025);
- break;
-
- case 12000:
- timer->fraction = numer * (MAD_TIMER_RESOLUTION / 12000);
- break;
-
- case 16000:
- timer->fraction = numer * (MAD_TIMER_RESOLUTION / 16000);
- break;
-
- case 22050:
- timer->fraction = numer * (MAD_TIMER_RESOLUTION / 22050);
- break;
-
- case 24000:
- timer->fraction = numer * (MAD_TIMER_RESOLUTION / 24000);
- break;
-
- case 32000:
- timer->fraction = numer * (MAD_TIMER_RESOLUTION / 32000);
- break;
-
- case 44100:
- timer->fraction = numer * (MAD_TIMER_RESOLUTION / 44100);
- break;
-
- case 48000:
- timer->fraction = numer * (MAD_TIMER_RESOLUTION / 48000);
- break;
-
- default:
- timer->fraction = scale_rational(numer, denom, MAD_TIMER_RESOLUTION);
- break;
- }
-
- if (timer->fraction >= MAD_TIMER_RESOLUTION)
- reduce_timer(timer);
-}
-
-/*
- * NAME: timer->add()
- * DESCRIPTION: add one timer to another
- */
-void mad_timer_add(mad_timer_t *timer, mad_timer_t incr)
-{
- timer->seconds += incr.seconds;
- timer->fraction += incr.fraction;
-
- if (timer->fraction >= MAD_TIMER_RESOLUTION)
- reduce_timer(timer);
-}
-
-/*
- * NAME: timer->multiply()
- * DESCRIPTION: multiply a timer by a scalar value
- */
-void mad_timer_multiply(mad_timer_t *timer, signed long scalar)
-{
- mad_timer_t addend;
- unsigned long factor;
-
- factor = scalar;
- if (scalar < 0) {
- factor = -scalar;
- mad_timer_negate(timer);
- }
-
- addend = *timer;
- *timer = mad_timer_zero;
-
- while (factor) {
- if (factor & 1)
- mad_timer_add(timer, addend);
-
- mad_timer_add(&addend, addend);
- factor >>= 1;
- }
-}
-
-/*
- * NAME: timer->count()
- * DESCRIPTION: return timer value in selected units
- */
-signed long mad_timer_count(mad_timer_t timer, enum mad_units units)
-{
- switch (units) {
- case MAD_UNITS_HOURS:
- return timer.seconds / 60 / 60;
-
- case MAD_UNITS_MINUTES:
- return timer.seconds / 60;
-
- case MAD_UNITS_SECONDS:
- return timer.seconds;
-
- case MAD_UNITS_DECISECONDS:
- case MAD_UNITS_CENTISECONDS:
- case MAD_UNITS_MILLISECONDS:
-
- case MAD_UNITS_8000_HZ:
- case MAD_UNITS_11025_HZ:
- case MAD_UNITS_12000_HZ:
- case MAD_UNITS_16000_HZ:
- case MAD_UNITS_22050_HZ:
- case MAD_UNITS_24000_HZ:
- case MAD_UNITS_32000_HZ:
- case MAD_UNITS_44100_HZ:
- case MAD_UNITS_48000_HZ:
-
- case MAD_UNITS_24_FPS:
- case MAD_UNITS_25_FPS:
- case MAD_UNITS_30_FPS:
- case MAD_UNITS_48_FPS:
- case MAD_UNITS_50_FPS:
- case MAD_UNITS_60_FPS:
- case MAD_UNITS_75_FPS:
- return timer.seconds * (signed long) units +
- (signed long) scale_rational(timer.fraction, MAD_TIMER_RESOLUTION,
- units);
-
- case MAD_UNITS_23_976_FPS:
- case MAD_UNITS_24_975_FPS:
- case MAD_UNITS_29_97_FPS:
- case MAD_UNITS_47_952_FPS:
- case MAD_UNITS_49_95_FPS:
- case MAD_UNITS_59_94_FPS:
- return (mad_timer_count(timer, -units) + 1) * 1000 / 1001;
- }
-
- /* unsupported units */
- return 0;
-}
-
-/*
- * NAME: timer->fraction()
- * DESCRIPTION: return fractional part of timer in arbitrary terms
- */
-unsigned long mad_timer_fraction(mad_timer_t timer, unsigned long denom)
-{
- timer = mad_timer_abs(timer);
-
- switch (denom) {
- case 0:
- return timer.fraction ?
- MAD_TIMER_RESOLUTION / timer.fraction : MAD_TIMER_RESOLUTION + 1;
-
- case MAD_TIMER_RESOLUTION:
- return timer.fraction;
-
- default:
- return scale_rational(timer.fraction, MAD_TIMER_RESOLUTION, denom);
- }
-}
-
-/*
- * NAME: timer->string()
- * DESCRIPTION: write a string representation of a timer using a template
- */
-void mad_timer_string(mad_timer_t timer,
- char *dest, char const *format, enum mad_units units,
- enum mad_units fracunits, unsigned long subparts)
-{
- unsigned long hours, minutes, seconds, sub;
- unsigned int frac;
-
- timer = mad_timer_abs(timer);
-
- seconds = timer.seconds;
- frac = sub = 0;
-
- switch (fracunits) {
- case MAD_UNITS_HOURS:
- case MAD_UNITS_MINUTES:
- case MAD_UNITS_SECONDS:
- break;
-
- case MAD_UNITS_DECISECONDS:
- case MAD_UNITS_CENTISECONDS:
- case MAD_UNITS_MILLISECONDS:
-
- case MAD_UNITS_8000_HZ:
- case MAD_UNITS_11025_HZ:
- case MAD_UNITS_12000_HZ:
- case MAD_UNITS_16000_HZ:
- case MAD_UNITS_22050_HZ:
- case MAD_UNITS_24000_HZ:
- case MAD_UNITS_32000_HZ:
- case MAD_UNITS_44100_HZ:
- case MAD_UNITS_48000_HZ:
-
- case MAD_UNITS_24_FPS:
- case MAD_UNITS_25_FPS:
- case MAD_UNITS_30_FPS:
- case MAD_UNITS_48_FPS:
- case MAD_UNITS_50_FPS:
- case MAD_UNITS_60_FPS:
- case MAD_UNITS_75_FPS:
- {
- unsigned long denom;
-
- denom = MAD_TIMER_RESOLUTION / fracunits;
-
- frac = timer.fraction / denom;
- sub = scale_rational(timer.fraction % denom, denom, subparts);
- }
- break;
-
- case MAD_UNITS_23_976_FPS:
- case MAD_UNITS_24_975_FPS:
- case MAD_UNITS_29_97_FPS:
- case MAD_UNITS_47_952_FPS:
- case MAD_UNITS_49_95_FPS:
- case MAD_UNITS_59_94_FPS:
- /* drop-frame encoding */
- /* N.B. this is only well-defined for MAD_UNITS_29_97_FPS */
- {
- unsigned long frame, cycle, d, m;
-
- frame = mad_timer_count(timer, fracunits);
-
- cycle = -fracunits * 60 * 10 - (10 - 1) * 2;
-
- d = frame / cycle;
- m = frame % cycle;
- frame += (10 - 1) * 2 * d;
- if (m > 2)
- frame += 2 * ((m - 2) / (cycle / 10));
-
- frac = frame % -fracunits;
- seconds = frame / -fracunits;
- }
- break;
- }
-
- switch (units) {
- case MAD_UNITS_HOURS:
- minutes = seconds / 60;
- hours = minutes / 60;
-
- sprintf(dest, format,
- hours,
- (unsigned int) (minutes % 60),
- (unsigned int) (seconds % 60),
- frac, sub);
- break;
-
- case MAD_UNITS_MINUTES:
- minutes = seconds / 60;
-
- sprintf(dest, format,
- minutes,
- (unsigned int) (seconds % 60),
- frac, sub);
- break;
-
- case MAD_UNITS_SECONDS:
- sprintf(dest, format,
- seconds,
- frac, sub);
- break;
-
- case MAD_UNITS_23_976_FPS:
- case MAD_UNITS_24_975_FPS:
- case MAD_UNITS_29_97_FPS:
- case MAD_UNITS_47_952_FPS:
- case MAD_UNITS_49_95_FPS:
- case MAD_UNITS_59_94_FPS:
- if (fracunits < 0) {
- /* not yet implemented */
- sub = 0;
- }
-
- /* fall through */
-
- case MAD_UNITS_DECISECONDS:
- case MAD_UNITS_CENTISECONDS:
- case MAD_UNITS_MILLISECONDS:
-
- case MAD_UNITS_8000_HZ:
- case MAD_UNITS_11025_HZ:
- case MAD_UNITS_12000_HZ:
- case MAD_UNITS_16000_HZ:
- case MAD_UNITS_22050_HZ:
- case MAD_UNITS_24000_HZ:
- case MAD_UNITS_32000_HZ:
- case MAD_UNITS_44100_HZ:
- case MAD_UNITS_48000_HZ:
-
- case MAD_UNITS_24_FPS:
- case MAD_UNITS_25_FPS:
- case MAD_UNITS_30_FPS:
- case MAD_UNITS_48_FPS:
- case MAD_UNITS_50_FPS:
- case MAD_UNITS_60_FPS:
- case MAD_UNITS_75_FPS:
- sprintf(dest, format, mad_timer_count(timer, units), sub);
- break;
- }
-}
diff --git a/src/libmad/timer.h b/src/libmad/timer.h
deleted file mode 100644
index 88e997d5e..000000000
--- a/src/libmad/timer.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * libmad - MPEG audio decoder library
- * Copyright (C) 2000-2004 Underbit Technologies, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * $Id: timer.h,v 1.3 2004/04/22 00:23:27 miguelfreitas Exp $
- */
-
-# ifndef LIBMAD_TIMER_H
-# define LIBMAD_TIMER_H
-
-typedef struct {
- signed long seconds; /* whole seconds */
- unsigned long fraction; /* 1/MAD_TIMER_RESOLUTION seconds */
-} mad_timer_t;
-
-extern mad_timer_t const mad_timer_zero;
-
-# define MAD_TIMER_RESOLUTION 352800000UL
-
-enum mad_units {
- MAD_UNITS_HOURS = -2,
- MAD_UNITS_MINUTES = -1,
- MAD_UNITS_SECONDS = 0,
-
- /* metric units */
-
- MAD_UNITS_DECISECONDS = 10,
- MAD_UNITS_CENTISECONDS = 100,
- MAD_UNITS_MILLISECONDS = 1000,
-
- /* audio sample units */
-
- MAD_UNITS_8000_HZ = 8000,
- MAD_UNITS_11025_HZ = 11025,
- MAD_UNITS_12000_HZ = 12000,
-
- MAD_UNITS_16000_HZ = 16000,
- MAD_UNITS_22050_HZ = 22050,
- MAD_UNITS_24000_HZ = 24000,
-
- MAD_UNITS_32000_HZ = 32000,
- MAD_UNITS_44100_HZ = 44100,
- MAD_UNITS_48000_HZ = 48000,
-
- /* video frame/field units */
-
- MAD_UNITS_24_FPS = 24,
- MAD_UNITS_25_FPS = 25,
- MAD_UNITS_30_FPS = 30,
- MAD_UNITS_48_FPS = 48,
- MAD_UNITS_50_FPS = 50,
- MAD_UNITS_60_FPS = 60,
-
- /* CD audio frames */
-
- MAD_UNITS_75_FPS = 75,
-
- /* video drop-frame units */
-
- MAD_UNITS_23_976_FPS = -24,
- MAD_UNITS_24_975_FPS = -25,
- MAD_UNITS_29_97_FPS = -30,
- MAD_UNITS_47_952_FPS = -48,
- MAD_UNITS_49_95_FPS = -50,
- MAD_UNITS_59_94_FPS = -60
-};
-
-# define mad_timer_reset(timer) ((void) (*(timer) = mad_timer_zero))
-
-int mad_timer_compare(mad_timer_t, mad_timer_t);
-
-# define mad_timer_sign(timer) mad_timer_compare((timer), mad_timer_zero)
-
-void mad_timer_negate(mad_timer_t *);
-mad_timer_t mad_timer_abs(mad_timer_t);
-
-void mad_timer_set(mad_timer_t *, unsigned long, unsigned long, unsigned long);
-void mad_timer_add(mad_timer_t *, mad_timer_t);
-void mad_timer_multiply(mad_timer_t *, signed long);
-
-signed long mad_timer_count(mad_timer_t, enum mad_units);
-unsigned long mad_timer_fraction(mad_timer_t, unsigned long);
-void mad_timer_string(mad_timer_t, char *, char const *,
- enum mad_units, enum mad_units, unsigned long);
-
-# endif
diff --git a/src/libmad/version.c b/src/libmad/version.c
deleted file mode 100644
index 8fc70f408..000000000
--- a/src/libmad/version.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * libmad - MPEG audio decoder library
- * Copyright (C) 2000-2004 Underbit Technologies, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * $Id: version.c,v 1.2 2004/04/22 00:23:27 miguelfreitas Exp $
- */
-
-# ifdef HAVE_CONFIG_H
-# include "config.h"
-# endif
-
-# include "global.h"
-
-# include "version.h"
-
-char const mad_version[] = "MPEG Audio Decoder " MAD_VERSION;
-char const mad_copyright[] = "Copyright (C) " MAD_PUBLISHYEAR " " MAD_AUTHOR;
-char const mad_author[] = MAD_AUTHOR " <" MAD_EMAIL ">";
-
-char const mad_build[] = ""
-# if defined(DEBUG)
- "DEBUG "
-# elif defined(NDEBUG)
- "NDEBUG "
-# endif
-
-# if defined(EXPERIMENTAL)
- "EXPERIMENTAL "
-# endif
-
-# if defined(FPM_64BIT)
- "FPM_64BIT "
-# elif defined(FPM_INTEL)
- "FPM_INTEL "
-# elif defined(FPM_ARM)
- "FPM_ARM "
-# elif defined(FPM_MIPS)
- "FPM_MIPS "
-# elif defined(FPM_SPARC)
- "FPM_SPARC "
-# elif defined(FPM_PPC)
- "FPM_PPC "
-# elif defined(FPM_DEFAULT)
- "FPM_DEFAULT "
-# endif
-
-# if defined(ASO_IMDCT)
- "ASO_IMDCT "
-# endif
-# if defined(ASO_INTERLEAVE1)
- "ASO_INTERLEAVE1 "
-# endif
-# if defined(ASO_INTERLEAVE2)
- "ASO_INTERLEAVE2 "
-# endif
-# if defined(ASO_ZEROCHECK)
- "ASO_ZEROCHECK "
-# endif
-
-# if defined(OPT_SPEED)
- "OPT_SPEED "
-# elif defined(OPT_ACCURACY)
- "OPT_ACCURACY "
-# endif
-
-# if defined(OPT_SSO)
- "OPT_SSO "
-# endif
-
-# if defined(OPT_DCTO) /* never defined here */
- "OPT_DCTO "
-# endif
-
-# if defined(OPT_STRICT)
- "OPT_STRICT "
-# endif
-;
diff --git a/src/libmad/version.h b/src/libmad/version.h
deleted file mode 100644
index c056e6fc9..000000000
--- a/src/libmad/version.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * libmad - MPEG audio decoder library
- * Copyright (C) 2000-2004 Underbit Technologies, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * $Id: version.h,v 1.2 2004/04/22 00:23:29 miguelfreitas Exp $
- */
-
-# ifndef LIBMAD_VERSION_H
-# define LIBMAD_VERSION_H
-
-# define MAD_VERSION_MAJOR 0
-# define MAD_VERSION_MINOR 15
-# define MAD_VERSION_PATCH 1
-# define MAD_VERSION_EXTRA " (beta)"
-
-# define MAD_VERSION_STRINGIZE(str) #str
-# define MAD_VERSION_STRING(num) MAD_VERSION_STRINGIZE(num)
-
-# define MAD_VERSION MAD_VERSION_STRING(MAD_VERSION_MAJOR) "." \
- MAD_VERSION_STRING(MAD_VERSION_MINOR) "." \
- MAD_VERSION_STRING(MAD_VERSION_PATCH) \
- MAD_VERSION_EXTRA
-
-# define MAD_PUBLISHYEAR "2000-2004"
-# define MAD_AUTHOR "Underbit Technologies, Inc."
-# define MAD_EMAIL "info@underbit.com"
-
-extern char const mad_version[];
-extern char const mad_copyright[];
-extern char const mad_author[];
-extern char const mad_build[];
-
-# endif
diff --git a/src/libmpeg2/Makefile.am b/src/libmpeg2/Makefile.am
index 66fb39f13..d772f0e09 100644
--- a/src/libmpeg2/Makefile.am
+++ b/src/libmpeg2/Makefile.am
@@ -1,5 +1,11 @@
include $(top_srcdir)/misc/Makefile.common
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_LDFLAGS = $(xineplug_ldflags)
+
+noinst_HEADERS = vlc.h mpeg2.h xvmc.h xvmc_vld.h mpeg2_internal.h idct_mlib.h vis.h \
+ libmpeg2_accel.h
+
xineplug_LTLIBRARIES = xineplug_decode_mpeg2.la
xineplug_decode_mpeg2_la_SOURCES = \
@@ -23,8 +29,4 @@ xineplug_decode_mpeg2_la_SOURCES = \
libmpeg2_accel.c
xineplug_decode_mpeg2_la_LIBADD = $(MLIB_LIBS) $(XINE_LIB) -lm
-xineplug_decode_mpeg2_la_CFLAGS = $(VISIBILITY_FLAG) $(LIBMPEG2_CFLAGS)
-xineplug_decode_mpeg2_la_LDFLAGS = $(xineplug_ldflags)
-
-noinst_HEADERS = vlc.h mpeg2.h xvmc.h xvmc_vld.h mpeg2_internal.h idct_mlib.h vis.h \
- libmpeg2_accel.h
+xineplug_decode_mpeg2_la_CFLAGS = $(AM_CFLAGS) $(MLIB_CFLAGS)
diff --git a/src/libmpeg2new/Makefile.am b/src/libmpeg2new/Makefile.am
index 49959da86..8c248fdcb 100644
--- a/src/libmpeg2new/Makefile.am
+++ b/src/libmpeg2new/Makefile.am
@@ -1,13 +1,12 @@
include $(top_srcdir)/misc/Makefile.common
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_LDFLAGS = $(xineplug_ldflags)
+
SUBDIRS = libmpeg2
xineplug_LTLIBRARIES = xineplug_decode_mpeg2.la
-xineplug_decode_mpeg2_la_SOURCES = \
- xine_mpeg2_decoder.c
-
-xineplug_decode_mpeg2_la_CFLAGS = $(VISIBILITY_FLAG) $(LIBMPEG2_CFLAGS)
+xineplug_decode_mpeg2_la_SOURCES = xine_mpeg2_decoder.c
xineplug_decode_mpeg2_la_LIBADD = $(XINE_LIB) ./libmpeg2/libmpeg2.la
-xineplug_decode_mpeg2_la_LDFLAGS = $(xineplug_ldflags)
-
+xineplug_decode_mpeg2_la_CFLAGS = $(AM_CFLAGS) $(MLIB_CFLAGS)
diff --git a/src/libmpeg2new/libmpeg2/Makefile.am b/src/libmpeg2new/libmpeg2/Makefile.am
index f99894f12..2caa3ddc2 100644
--- a/src/libmpeg2new/libmpeg2/Makefile.am
+++ b/src/libmpeg2new/libmpeg2/Makefile.am
@@ -1,5 +1,7 @@
include $(top_srcdir)/misc/Makefile.common
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+
noinst_LTLIBRARIES = libmpeg2.la libmpeg2arch.la
libmpeg2_la_SOURCES = alloc.c header.c decode.c slice.c motion_comp.c idct.c
@@ -10,4 +12,3 @@ libmpeg2arch_la_SOURCES = motion_comp_mmx.c idct_mmx.c \
motion_comp_alpha.c idct_alpha.c \
motion_comp_vis.c \
cpu_accel.c cpu_state.c
-
diff --git a/src/libmusepack/Makefile.am b/src/libmusepack/Makefile.am
deleted file mode 100644
index 01875bdad..000000000
--- a/src/libmusepack/Makefile.am
+++ /dev/null
@@ -1,26 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-SUBDIRS = musepack
-
-EXTRA_DIST = diff_against_svn.patch
-
-if MUSEPACK
-xineplug_LTLIBRARIES = xineplug_decode_mpc.la
-endif
-
-if EXTERNAL_MPCDEC
-internal_sources =
-else
-internal_sources = huffsv46.c huffsv7.c idtag.c mpc_decoder.c \
- mpc_reader.c requant.c streaminfo.c synth_filter.c
-endif
-
-if EXTERNAL_MPCDEC
-xineplug_decode_mpc_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) -lmpcdec
-else
-xineplug_decode_mpc_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
-endif
-
-xineplug_decode_mpc_la_SOURCES = $(internal_sources) xine_musepack_decoder.c
-xineplug_decode_mpc_la_CFLAGS = $(VISIBILITY_FLAG)
-xineplug_decode_mpc_la_LDFLAGS = $(xineplug_ldflags)
diff --git a/src/libmusepack/diff_against_svn.patch b/src/libmusepack/diff_against_svn.patch
deleted file mode 100644
index 1d44efb95..000000000
--- a/src/libmusepack/diff_against_svn.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-Use xine's inttypes.
-The file config_types.h is generated from config_types.h.in in musepack SVN.
-Check for previous swap32 definition before writing a new swap32 function.
-
-Index: src/libmusepack/musepack/config_types.h
-===================================================================
-RCS file: /home/valtri/CVS/xine-lib/src/libmusepack/musepack/config_types.h,v
-retrieving revision 1.1.1.2
-diff -u -p -u -p -r1.1.1.2 config_types.h
---- src/libmusepack/musepack/config_types.h 3 Feb 2005 00:19:24 -0000 1.1.1.2
-+++ src/libmusepack/musepack/config_types.h 3 Feb 2005 00:21:06 -0000
-@@ -1,7 +1,7 @@
- #ifndef __CONFIG_TYPES_H__
- #define __CONFIG_TYPES_H__
-
--#include <stdint.h>
-+#include "os_types.h"
-
- #ifdef WORDS_BIGENDIAN
- #undef MPC_LITTLE_ENDIAN
-Index: src/libmusepack/synth_filter.c
-===================================================================
-RCS file: /cvsroot/xine/xine-lib/src/libmusepack/synth_filter.c,v
-retrieving revision 1.1
-diff -u -r1.1 synth_filter.c
---- src/libmusepack/synth_filter.c 14 Jan 2005 15:24:25 -0000 1.1
-+++ src/libmusepack/synth_filter.c 7 Jan 2006 10:54:27 -0000
-@@ -39,8 +39,6 @@
- #include "musepack/musepack.h"
- #include "musepack/internal.h"
-
--typedef mpc_int32_t ptrdiff_t;
--
- /* C O N S T A N T S */
- #undef _
-
-diff -r d25b274e6e6a src/libmusepack/musepack/internal.h
---- a/src/libmusepack/musepack/internal.h Wed Apr 04 13:41:11 2007 +0200
-+++ b/src/libmusepack/musepack/internal.h Wed Apr 04 13:42:45 2007 +0200
-@@ -8,6 +8,7 @@ enum {
- MPC_DECODER_SYNTH_DELAY = 481
- };
-
-+#ifndef swap32
- /// Big/little endian 32 bit byte swapping routine.
- static inline
- mpc_uint32_t swap32(mpc_uint32_t val) {
-@@ -16,6 +17,7 @@ mpc_uint32_t swap32(mpc_uint32_t val) {
- (mpc_uint32_t)src[0] |
- ((mpc_uint32_t)src[1] << 8) | ((mpc_uint32_t)src[2] << 16) | ((mpc_uint32_t)src[3] << 24);
- }
-+#endif
-
- /// Searches for a ID3v2-tag and reads the length (in bytes) of it.
- /// \param reader supplying raw stream data
diff --git a/src/libmusepack/huffsv46.c b/src/libmusepack/huffsv46.c
deleted file mode 100644
index 6ade01b9d..000000000
--- a/src/libmusepack/huffsv46.c
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- Copyright (c) 2004, The Musepack Development Team
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are
- met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials provided
- with the distribution.
-
- * Neither the name of the The Musepack Development Team nor the
- names of its contributors may be used to endorse or promote
- products derived from this software without specific prior
- written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/// \file huffsv46.c
-/// Implementations of huffman decoding for streamversions < 7.
-
-#include "musepack/musepack.h"
-#include "musepack/requant.h"
-#include "musepack/huffman.h"
-
-void
-mpc_decoder_init_huffman_sv6(mpc_decoder *d)
-{
- mpc_decoder_init_huffman_sv6_tables(d);
- mpc_decoder_resort_huff_tables(16, d->Region_A , 0);
- mpc_decoder_resort_huff_tables( 8, d->Region_B , 0);
- mpc_decoder_resort_huff_tables( 4, d->Region_C , 0);
- mpc_decoder_resort_huff_tables( 8, d->SCFI_Bundle , 0);
- mpc_decoder_resort_huff_tables(13, d->DSCF_Entropie , 6);
- mpc_decoder_resort_huff_tables( 3, d->Entropie_1 , Dc[1]);
- mpc_decoder_resort_huff_tables( 5, d->Entropie_2 , Dc[2]);
- mpc_decoder_resort_huff_tables( 7, d->Entropie_3 , Dc[3]);
- mpc_decoder_resort_huff_tables( 9, d->Entropie_4 , Dc[4]);
- mpc_decoder_resort_huff_tables(15, d->Entropie_5 , Dc[5]);
- mpc_decoder_resort_huff_tables(31, d->Entropie_6 , Dc[6]);
- mpc_decoder_resort_huff_tables(63, d->Entropie_7 , Dc[7]);
-}
-
-void
-mpc_decoder_init_huffman_sv6_tables(mpc_decoder *d)
-{
- // SCFI-bundle
- d->SCFI_Bundle[7].Code= 1; d->SCFI_Bundle[7].Length= 1;
- d->SCFI_Bundle[3].Code= 1; d->SCFI_Bundle[3].Length= 2;
- d->SCFI_Bundle[5].Code= 0; d->SCFI_Bundle[5].Length= 3;
- d->SCFI_Bundle[1].Code= 7; d->SCFI_Bundle[1].Length= 5;
- d->SCFI_Bundle[2].Code= 6; d->SCFI_Bundle[2].Length= 5;
- d->SCFI_Bundle[4].Code= 4; d->SCFI_Bundle[4].Length= 5;
- d->SCFI_Bundle[0].Code= 11; d->SCFI_Bundle[0].Length= 6;
- d->SCFI_Bundle[6].Code= 10; d->SCFI_Bundle[6].Length= 6;
-
- // region A (subbands 0..10)
- d->Region_A[ 1].Code= 1; d->Region_A[ 1].Length= 1;
- d->Region_A[ 2].Code= 0; d->Region_A[ 2].Length= 2;
- d->Region_A[ 0].Code= 2; d->Region_A[ 0].Length= 3;
- d->Region_A[ 3].Code= 15; d->Region_A[ 3].Length= 5;
- d->Region_A[ 5].Code= 13; d->Region_A[ 5].Length= 5;
- d->Region_A[ 6].Code= 12; d->Region_A[ 6].Length= 5;
- d->Region_A[ 4].Code= 29; d->Region_A[ 4].Length= 6;
- d->Region_A[ 7].Code= 57; d->Region_A[ 7].Length= 7;
- d->Region_A[ 8].Code= 113; d->Region_A[ 8].Length= 8;
- d->Region_A[ 9].Code= 225; d->Region_A[ 9].Length= 9;
- d->Region_A[10].Code= 449; d->Region_A[10].Length= 10;
- d->Region_A[11].Code= 897; d->Region_A[11].Length= 11;
- d->Region_A[12].Code= 1793; d->Region_A[12].Length= 12;
- d->Region_A[13].Code= 3585; d->Region_A[13].Length= 13;
- d->Region_A[14].Code= 7169; d->Region_A[14].Length= 14;
- d->Region_A[15].Code= 7168; d->Region_A[15].Length= 14;
-
- // region B (subbands 11..22)
- d->Region_B[1].Code= 1; d->Region_B[1].Length= 1;
- d->Region_B[0].Code= 1; d->Region_B[0].Length= 2;
- d->Region_B[2].Code= 1; d->Region_B[2].Length= 3;
- d->Region_B[3].Code= 1; d->Region_B[3].Length= 4;
- d->Region_B[4].Code= 1; d->Region_B[4].Length= 5;
- d->Region_B[5].Code= 1; d->Region_B[5].Length= 6;
- d->Region_B[6].Code= 1; d->Region_B[6].Length= 7;
- d->Region_B[7].Code= 0; d->Region_B[7].Length= 7;
-
- // region C (subbands 23..31)
- d->Region_C[0].Code= 1; d->Region_C[0].Length= 1;
- d->Region_C[1].Code= 1; d->Region_C[1].Length= 2;
- d->Region_C[2].Code= 1; d->Region_C[2].Length= 3;
- d->Region_C[3].Code= 0; d->Region_C[3].Length= 3;
-
- // DSCF
- d->DSCF_Entropie[ 6].Code= 0; d->DSCF_Entropie[ 6].Length= 2;
- d->DSCF_Entropie[ 7].Code= 7; d->DSCF_Entropie[ 7].Length= 3;
- d->DSCF_Entropie[ 5].Code= 4; d->DSCF_Entropie[ 5].Length= 3;
- d->DSCF_Entropie[ 8].Code= 3; d->DSCF_Entropie[ 8].Length= 3;
- d->DSCF_Entropie[ 9].Code= 13; d->DSCF_Entropie[ 9].Length= 4;
- d->DSCF_Entropie[ 4].Code= 11; d->DSCF_Entropie[ 4].Length= 4;
- d->DSCF_Entropie[10].Code= 10; d->DSCF_Entropie[10].Length= 4;
- d->DSCF_Entropie[ 2].Code= 4; d->DSCF_Entropie[ 2].Length= 4;
- d->DSCF_Entropie[11].Code= 25; d->DSCF_Entropie[11].Length= 5;
- d->DSCF_Entropie[ 3].Code= 24; d->DSCF_Entropie[ 3].Length= 5;
- d->DSCF_Entropie[ 1].Code= 11; d->DSCF_Entropie[ 1].Length= 5;
- d->DSCF_Entropie[12].Code= 21; d->DSCF_Entropie[12].Length= 6;
- d->DSCF_Entropie[ 0].Code= 20; d->DSCF_Entropie[ 0].Length= 6;
-
- // first quantizer
- d->Entropie_1[1].Code= 1; d->Entropie_1[1].Length= 1;
- d->Entropie_1[0].Code= 1; d->Entropie_1[0].Length= 2;
- d->Entropie_1[2].Code= 0; d->Entropie_1[2].Length= 2;
-
- // second quantizer
- d->Entropie_2[2].Code= 3; d->Entropie_2[2].Length= 2;
- d->Entropie_2[3].Code= 1; d->Entropie_2[3].Length= 2;
- d->Entropie_2[1].Code= 0; d->Entropie_2[1].Length= 2;
- d->Entropie_2[4].Code= 5; d->Entropie_2[4].Length= 3;
- d->Entropie_2[0].Code= 4; d->Entropie_2[0].Length= 3;
-
- // third quantizer
- d->Entropie_3[3].Code= 3; d->Entropie_3[3].Length= 2;
- d->Entropie_3[2].Code= 1; d->Entropie_3[2].Length= 2;
- d->Entropie_3[4].Code= 0; d->Entropie_3[4].Length= 2;
- d->Entropie_3[1].Code= 5; d->Entropie_3[1].Length= 3;
- d->Entropie_3[5].Code= 9; d->Entropie_3[5].Length= 4;
- d->Entropie_3[0].Code= 17; d->Entropie_3[0].Length= 5;
- d->Entropie_3[6].Code= 16; d->Entropie_3[6].Length= 5;
-
- // forth quantizer
- d->Entropie_4[4].Code= 0; d->Entropie_4[4].Length= 2;
- d->Entropie_4[5].Code= 6; d->Entropie_4[5].Length= 3;
- d->Entropie_4[3].Code= 5; d->Entropie_4[3].Length= 3;
- d->Entropie_4[6].Code= 4; d->Entropie_4[6].Length= 3;
- d->Entropie_4[2].Code= 3; d->Entropie_4[2].Length= 3;
- d->Entropie_4[7].Code= 15; d->Entropie_4[7].Length= 4;
- d->Entropie_4[1].Code= 14; d->Entropie_4[1].Length= 4;
- d->Entropie_4[0].Code= 5; d->Entropie_4[0].Length= 4;
- d->Entropie_4[8].Code= 4; d->Entropie_4[8].Length= 4;
-
- // fifth quantizer
- d->Entropie_5[7 ].Code= 4; d->Entropie_5[7 ].Length= 3;
- d->Entropie_5[8 ].Code= 3; d->Entropie_5[8 ].Length= 3;
- d->Entropie_5[6 ].Code= 2; d->Entropie_5[6 ].Length= 3;
- d->Entropie_5[9 ].Code= 0; d->Entropie_5[9 ].Length= 3;
- d->Entropie_5[5 ].Code= 15; d->Entropie_5[5 ].Length= 4;
- d->Entropie_5[4 ].Code= 13; d->Entropie_5[4 ].Length= 4;
- d->Entropie_5[10].Code= 12; d->Entropie_5[10].Length= 4;
- d->Entropie_5[11].Code= 10; d->Entropie_5[11].Length= 4;
- d->Entropie_5[3 ].Code= 3; d->Entropie_5[3 ].Length= 4;
- d->Entropie_5[12].Code= 2; d->Entropie_5[12].Length= 4;
- d->Entropie_5[2 ].Code= 29; d->Entropie_5[2 ].Length= 5;
- d->Entropie_5[1 ].Code= 23; d->Entropie_5[1 ].Length= 5;
- d->Entropie_5[13].Code= 22; d->Entropie_5[13].Length= 5;
- d->Entropie_5[0 ].Code= 57; d->Entropie_5[0 ].Length= 6;
- d->Entropie_5[14].Code= 56; d->Entropie_5[14].Length= 6;
-
- // sixth quantizer
- d->Entropie_6[15].Code= 9; d->Entropie_6[15].Length= 4;
- d->Entropie_6[16].Code= 8; d->Entropie_6[16].Length= 4;
- d->Entropie_6[14].Code= 7; d->Entropie_6[14].Length= 4;
- d->Entropie_6[18].Code= 6; d->Entropie_6[18].Length= 4;
- d->Entropie_6[17].Code= 5; d->Entropie_6[17].Length= 4;
- d->Entropie_6[12].Code= 3; d->Entropie_6[12].Length= 4;
- d->Entropie_6[13].Code= 2; d->Entropie_6[13].Length= 4;
- d->Entropie_6[19].Code= 0; d->Entropie_6[19].Length= 4;
- d->Entropie_6[11].Code= 31; d->Entropie_6[11].Length= 5;
- d->Entropie_6[20].Code= 30; d->Entropie_6[20].Length= 5;
- d->Entropie_6[10].Code= 29; d->Entropie_6[10].Length= 5;
- d->Entropie_6[9 ].Code= 27; d->Entropie_6[9 ].Length= 5;
- d->Entropie_6[21].Code= 26; d->Entropie_6[21].Length= 5;
- d->Entropie_6[22].Code= 25; d->Entropie_6[22].Length= 5;
- d->Entropie_6[8 ].Code= 24; d->Entropie_6[8 ].Length= 5;
- d->Entropie_6[7 ].Code= 23; d->Entropie_6[7 ].Length= 5;
- d->Entropie_6[23].Code= 21; d->Entropie_6[23].Length= 5;
- d->Entropie_6[6 ].Code= 9; d->Entropie_6[6 ].Length= 5;
- d->Entropie_6[24].Code= 3; d->Entropie_6[24].Length= 5;
- d->Entropie_6[25].Code= 57; d->Entropie_6[25].Length= 6;
- d->Entropie_6[5 ].Code= 56; d->Entropie_6[5 ].Length= 6;
- d->Entropie_6[4 ].Code= 45; d->Entropie_6[4 ].Length= 6;
- d->Entropie_6[26].Code= 41; d->Entropie_6[26].Length= 6;
- d->Entropie_6[2 ].Code= 40; d->Entropie_6[2 ].Length= 6;
- d->Entropie_6[27].Code= 17; d->Entropie_6[27].Length= 6;
- d->Entropie_6[28].Code= 16; d->Entropie_6[28].Length= 6;
- d->Entropie_6[3 ].Code= 5; d->Entropie_6[3 ].Length= 6;
- d->Entropie_6[29].Code= 89; d->Entropie_6[29].Length= 7;
- d->Entropie_6[1 ].Code= 88; d->Entropie_6[1 ].Length= 7;
- d->Entropie_6[30].Code= 9; d->Entropie_6[30].Length= 7;
- d->Entropie_6[0 ].Code= 8; d->Entropie_6[0 ].Length= 7;
-
- // seventh quantizer
- d->Entropie_7[25].Code= 0; d->Entropie_7[25].Length= 5;
- d->Entropie_7[37].Code= 1; d->Entropie_7[37].Length= 5;
- d->Entropie_7[62].Code= 16; d->Entropie_7[62].Length= 8;
- d->Entropie_7[ 0].Code= 17; d->Entropie_7[ 0].Length= 8;
- d->Entropie_7[ 3].Code= 9; d->Entropie_7[ 3].Length= 7;
- d->Entropie_7[ 5].Code= 10; d->Entropie_7[ 5].Length= 7;
- d->Entropie_7[ 6].Code= 11; d->Entropie_7[ 6].Length= 7;
- d->Entropie_7[38].Code= 3; d->Entropie_7[38].Length= 5;
- d->Entropie_7[35].Code= 4; d->Entropie_7[35].Length= 5;
- d->Entropie_7[33].Code= 5; d->Entropie_7[33].Length= 5;
- d->Entropie_7[24].Code= 6; d->Entropie_7[24].Length= 5;
- d->Entropie_7[27].Code= 7; d->Entropie_7[27].Length= 5;
- d->Entropie_7[26].Code= 8; d->Entropie_7[26].Length= 5;
- d->Entropie_7[12].Code= 18; d->Entropie_7[12].Length= 6;
- d->Entropie_7[50].Code= 19; d->Entropie_7[50].Length= 6;
- d->Entropie_7[29].Code= 10; d->Entropie_7[29].Length= 5;
- d->Entropie_7[31].Code= 11; d->Entropie_7[31].Length= 5;
- d->Entropie_7[36].Code= 12; d->Entropie_7[36].Length= 5;
- d->Entropie_7[34].Code= 13; d->Entropie_7[34].Length= 5;
- d->Entropie_7[28].Code= 14; d->Entropie_7[28].Length= 5;
- d->Entropie_7[49].Code= 30; d->Entropie_7[49].Length= 6;
- d->Entropie_7[56].Code= 62; d->Entropie_7[56].Length= 7;
- d->Entropie_7[ 7].Code= 63; d->Entropie_7[ 7].Length= 7;
- d->Entropie_7[32].Code= 16; d->Entropie_7[32].Length= 5;
- d->Entropie_7[30].Code= 17; d->Entropie_7[30].Length= 5;
- d->Entropie_7[13].Code= 36; d->Entropie_7[13].Length= 6;
- d->Entropie_7[55].Code= 74; d->Entropie_7[55].Length= 7;
- d->Entropie_7[61].Code= 150; d->Entropie_7[61].Length= 8;
- d->Entropie_7[ 1].Code= 151; d->Entropie_7[ 1].Length= 8;
- d->Entropie_7[14].Code= 38; d->Entropie_7[14].Length= 6;
- d->Entropie_7[48].Code= 39; d->Entropie_7[48].Length= 6;
- d->Entropie_7[ 4].Code= 80; d->Entropie_7[ 4].Length= 7;
- d->Entropie_7[58].Code= 81; d->Entropie_7[58].Length= 7;
- d->Entropie_7[47].Code= 41; d->Entropie_7[47].Length= 6;
- d->Entropie_7[15].Code= 42; d->Entropie_7[15].Length= 6;
- d->Entropie_7[16].Code= 43; d->Entropie_7[16].Length= 6;
- d->Entropie_7[54].Code= 88; d->Entropie_7[54].Length= 7;
- d->Entropie_7[ 8].Code= 89; d->Entropie_7[ 8].Length= 7;
- d->Entropie_7[17].Code= 45; d->Entropie_7[17].Length= 6;
- d->Entropie_7[46].Code= 46; d->Entropie_7[46].Length= 6;
- d->Entropie_7[45].Code= 47; d->Entropie_7[45].Length= 6;
- d->Entropie_7[53].Code= 96; d->Entropie_7[53].Length= 7;
- d->Entropie_7[ 9].Code= 97; d->Entropie_7[ 9].Length= 7;
- d->Entropie_7[43].Code= 49; d->Entropie_7[43].Length= 6;
- d->Entropie_7[19].Code= 50; d->Entropie_7[19].Length= 6;
- d->Entropie_7[18].Code= 51; d->Entropie_7[18].Length= 6;
- d->Entropie_7[44].Code= 52; d->Entropie_7[44].Length= 6;
- d->Entropie_7[ 2].Code= 212; d->Entropie_7[ 2].Length= 8;
- d->Entropie_7[60].Code= 213; d->Entropie_7[60].Length= 8;
- d->Entropie_7[10].Code= 107; d->Entropie_7[10].Length= 7;
- d->Entropie_7[42].Code= 54; d->Entropie_7[42].Length= 6;
- d->Entropie_7[41].Code= 55; d->Entropie_7[41].Length= 6;
- d->Entropie_7[20].Code= 56; d->Entropie_7[20].Length= 6;
- d->Entropie_7[21].Code= 57; d->Entropie_7[21].Length= 6;
- d->Entropie_7[52].Code= 116; d->Entropie_7[52].Length= 7;
- d->Entropie_7[51].Code= 117; d->Entropie_7[51].Length= 7;
- d->Entropie_7[40].Code= 59; d->Entropie_7[40].Length= 6;
- d->Entropie_7[22].Code= 60; d->Entropie_7[22].Length= 6;
- d->Entropie_7[23].Code= 61; d->Entropie_7[23].Length= 6;
- d->Entropie_7[39].Code= 62; d->Entropie_7[39].Length= 6;
- d->Entropie_7[11].Code= 126; d->Entropie_7[11].Length= 7;
- d->Entropie_7[57].Code= 254; d->Entropie_7[57].Length= 8;
- d->Entropie_7[59].Code= 255; d->Entropie_7[59].Length= 8;
-}
diff --git a/src/libmusepack/huffsv7.c b/src/libmusepack/huffsv7.c
deleted file mode 100644
index 80a8f2bff..000000000
--- a/src/libmusepack/huffsv7.c
+++ /dev/null
@@ -1,500 +0,0 @@
-/*
- Copyright (c) 2004, The Musepack Development Team
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are
- met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials provided
- with the distribution.
-
- * Neither the name of the The Musepack Development Team nor the
- names of its contributors may be used to endorse or promote
- products derived from this software without specific prior
- written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/// \file huffsv7.c
-/// Implementations of sv7 huffman decoding functions.
-
-#include "musepack/musepack.h"
-#include "musepack/huffman.h"
-#include "musepack/requant.h"
-
-void
-mpc_decoder_init_huffman_sv7(mpc_decoder *d)
-{
- mpc_decoder_init_huffman_sv7_tables(d);
- mpc_decoder_resort_huff_tables(10, &(d->HuffHdr[0]) , 5);
- mpc_decoder_resort_huff_tables( 4, &(d->HuffSCFI[0]) , 0);
- mpc_decoder_resort_huff_tables(16, &(d->HuffDSCF[0]) , 7);
- mpc_decoder_resort_huff_tables(27, &(d->HuffQ1[0][0]) , 0);
- mpc_decoder_resort_huff_tables(27, &(d->HuffQ1[1][0]) , 0);
- mpc_decoder_resort_huff_tables(25, &(d->HuffQ2[0][0]) , 0);
- mpc_decoder_resort_huff_tables(25, &(d->HuffQ2[1][0]) , 0);
- mpc_decoder_resort_huff_tables( 7, &(d->HuffQ3[0][0]) , Dc[3]);
- mpc_decoder_resort_huff_tables( 7, &(d->HuffQ3[1][0]) , Dc[3]);
- mpc_decoder_resort_huff_tables( 9, &(d->HuffQ4[0][0]) , Dc[4]);
- mpc_decoder_resort_huff_tables( 9, &(d->HuffQ4[1][0]) , Dc[4]);
- mpc_decoder_resort_huff_tables(15, &(d->HuffQ5[0][0]) , Dc[5]);
- mpc_decoder_resort_huff_tables(15, &(d->HuffQ5[1][0]) , Dc[5]);
- mpc_decoder_resort_huff_tables(31, &(d->HuffQ6[0][0]) , Dc[6]);
- mpc_decoder_resort_huff_tables(31, &(d->HuffQ6[1][0]) , Dc[6]);
- mpc_decoder_resort_huff_tables(63, &(d->HuffQ7[0][0]) , Dc[7]);
- mpc_decoder_resort_huff_tables(63, &(d->HuffQ7[1][0]) , Dc[7]);
-}
-
-void
-mpc_decoder_init_huffman_sv7_tables(mpc_decoder *d)
-{
- /***************************** SCFI *******************************/
- d->HuffSCFI[0].Code = 2; d->HuffSCFI[0].Length = 3;
- d->HuffSCFI[1].Code = 1; d->HuffSCFI[1].Length = 1;
- d->HuffSCFI[2].Code = 3; d->HuffSCFI[2].Length = 3;
- d->HuffSCFI[3].Code = 0; d->HuffSCFI[3].Length = 2;
-
- /***************************** DSCF *******************************/
- d->HuffDSCF[ 0].Code = 32; d->HuffDSCF[ 0].Length = 6;
- d->HuffDSCF[ 1].Code = 4; d->HuffDSCF[ 1].Length = 5;
- d->HuffDSCF[ 2].Code = 17; d->HuffDSCF[ 2].Length = 5;
- d->HuffDSCF[ 3].Code = 30; d->HuffDSCF[ 3].Length = 5;
- d->HuffDSCF[ 4].Code = 13; d->HuffDSCF[ 4].Length = 4;
- d->HuffDSCF[ 5].Code = 0; d->HuffDSCF[ 5].Length = 3;
- d->HuffDSCF[ 6].Code = 3; d->HuffDSCF[ 6].Length = 3;
- d->HuffDSCF[ 7].Code = 9; d->HuffDSCF[ 7].Length = 4;
- d->HuffDSCF[ 8].Code = 5; d->HuffDSCF[ 8].Length = 3;
- d->HuffDSCF[ 9].Code = 2; d->HuffDSCF[ 9].Length = 3;
- d->HuffDSCF[10].Code = 14; d->HuffDSCF[10].Length = 4;
- d->HuffDSCF[11].Code = 3; d->HuffDSCF[11].Length = 4;
- d->HuffDSCF[12].Code = 31; d->HuffDSCF[12].Length = 5;
- d->HuffDSCF[13].Code = 5; d->HuffDSCF[13].Length = 5;
- d->HuffDSCF[14].Code = 33; d->HuffDSCF[14].Length = 6;
- d->HuffDSCF[15].Code = 12; d->HuffDSCF[15].Length = 4;
-
- /************************* frame-header ***************************/
- /***************** differential quantizer indizes *****************/
- d->HuffHdr[0].Code = 92; d->HuffHdr[0].Length = 8;
- d->HuffHdr[1].Code = 47; d->HuffHdr[1].Length = 7;
- d->HuffHdr[2].Code = 10; d->HuffHdr[2].Length = 5;
- d->HuffHdr[3].Code = 4; d->HuffHdr[3].Length = 4;
- d->HuffHdr[4].Code = 0; d->HuffHdr[4].Length = 2;
- d->HuffHdr[5].Code = 1; d->HuffHdr[5].Length = 1;
- d->HuffHdr[6].Code = 3; d->HuffHdr[6].Length = 3;
- d->HuffHdr[7].Code = 22; d->HuffHdr[7].Length = 6;
- d->HuffHdr[8].Code = 187; d->HuffHdr[8].Length = 9;
- d->HuffHdr[9].Code = 186; d->HuffHdr[9].Length = 9;
-
- /********************** 3-step quantizer **************************/
- /********************* 3 bundled samples **************************/
- //less shaped, book 0
- d->HuffQ1[0][ 0].Code = 54; d->HuffQ1[0][ 0].Length = 6;
- d->HuffQ1[0][ 1].Code = 9; d->HuffQ1[0][ 1].Length = 5;
- d->HuffQ1[0][ 2].Code = 32; d->HuffQ1[0][ 2].Length = 6;
- d->HuffQ1[0][ 3].Code = 5; d->HuffQ1[0][ 3].Length = 5;
- d->HuffQ1[0][ 4].Code = 10; d->HuffQ1[0][ 4].Length = 4;
- d->HuffQ1[0][ 5].Code = 7; d->HuffQ1[0][ 5].Length = 5;
- d->HuffQ1[0][ 6].Code = 52; d->HuffQ1[0][ 6].Length = 6;
- d->HuffQ1[0][ 7].Code = 0; d->HuffQ1[0][ 7].Length = 5;
- d->HuffQ1[0][ 8].Code = 35; d->HuffQ1[0][ 8].Length = 6;
- d->HuffQ1[0][ 9].Code = 10; d->HuffQ1[0][ 9].Length = 5;
- d->HuffQ1[0][10].Code = 6; d->HuffQ1[0][10].Length = 4;
- d->HuffQ1[0][11].Code = 4; d->HuffQ1[0][11].Length = 5;
- d->HuffQ1[0][12].Code = 11; d->HuffQ1[0][12].Length = 4;
- d->HuffQ1[0][13].Code = 7; d->HuffQ1[0][13].Length = 3;
- d->HuffQ1[0][14].Code = 12; d->HuffQ1[0][14].Length = 4;
- d->HuffQ1[0][15].Code = 3; d->HuffQ1[0][15].Length = 5;
- d->HuffQ1[0][16].Code = 7; d->HuffQ1[0][16].Length = 4;
- d->HuffQ1[0][17].Code = 11; d->HuffQ1[0][17].Length = 5;
- d->HuffQ1[0][18].Code = 34; d->HuffQ1[0][18].Length = 6;
- d->HuffQ1[0][19].Code = 1; d->HuffQ1[0][19].Length = 5;
- d->HuffQ1[0][20].Code = 53; d->HuffQ1[0][20].Length = 6;
- d->HuffQ1[0][21].Code = 6; d->HuffQ1[0][21].Length = 5;
- d->HuffQ1[0][22].Code = 9; d->HuffQ1[0][22].Length = 4;
- d->HuffQ1[0][23].Code = 2; d->HuffQ1[0][23].Length = 5;
- d->HuffQ1[0][24].Code = 33; d->HuffQ1[0][24].Length = 6;
- d->HuffQ1[0][25].Code = 8; d->HuffQ1[0][25].Length = 5;
- d->HuffQ1[0][26].Code = 55; d->HuffQ1[0][26].Length = 6;
-
- //more shaped, book 1
- d->HuffQ1[1][ 0].Code = 103; d->HuffQ1[1][ 0].Length = 8;
- d->HuffQ1[1][ 1].Code = 62; d->HuffQ1[1][ 1].Length = 7;
- d->HuffQ1[1][ 2].Code = 225; d->HuffQ1[1][ 2].Length = 9;
- d->HuffQ1[1][ 3].Code = 55; d->HuffQ1[1][ 3].Length = 7;
- d->HuffQ1[1][ 4].Code = 3; d->HuffQ1[1][ 4].Length = 4;
- d->HuffQ1[1][ 5].Code = 52; d->HuffQ1[1][ 5].Length = 7;
- d->HuffQ1[1][ 6].Code = 101; d->HuffQ1[1][ 6].Length = 8;
- d->HuffQ1[1][ 7].Code = 60; d->HuffQ1[1][ 7].Length = 7;
- d->HuffQ1[1][ 8].Code = 227; d->HuffQ1[1][ 8].Length = 9;
- d->HuffQ1[1][ 9].Code = 24; d->HuffQ1[1][ 9].Length = 6;
- d->HuffQ1[1][10].Code = 0; d->HuffQ1[1][10].Length = 4;
- d->HuffQ1[1][11].Code = 61; d->HuffQ1[1][11].Length = 7;
- d->HuffQ1[1][12].Code = 4; d->HuffQ1[1][12].Length = 4;
- d->HuffQ1[1][13].Code = 1; d->HuffQ1[1][13].Length = 1;
- d->HuffQ1[1][14].Code = 5; d->HuffQ1[1][14].Length = 4;
- d->HuffQ1[1][15].Code = 63; d->HuffQ1[1][15].Length = 7;
- d->HuffQ1[1][16].Code = 1; d->HuffQ1[1][16].Length = 4;
- d->HuffQ1[1][17].Code = 59; d->HuffQ1[1][17].Length = 7;
- d->HuffQ1[1][18].Code = 226; d->HuffQ1[1][18].Length = 9;
- d->HuffQ1[1][19].Code = 57; d->HuffQ1[1][19].Length = 7;
- d->HuffQ1[1][20].Code = 100; d->HuffQ1[1][20].Length = 8;
- d->HuffQ1[1][21].Code = 53; d->HuffQ1[1][21].Length = 7;
- d->HuffQ1[1][22].Code = 2; d->HuffQ1[1][22].Length = 4;
- d->HuffQ1[1][23].Code = 54; d->HuffQ1[1][23].Length = 7;
- d->HuffQ1[1][24].Code = 224; d->HuffQ1[1][24].Length = 9;
- d->HuffQ1[1][25].Code = 58; d->HuffQ1[1][25].Length = 7;
- d->HuffQ1[1][26].Code = 102; d->HuffQ1[1][26].Length = 8;
-
- /********************** 5-step quantizer **************************/
- /********************* 2 bundled samples **************************/
- //less shaped, book 0
- d->HuffQ2[0][ 0].Code = 89; d->HuffQ2[0][ 0].Length = 7;
- d->HuffQ2[0][ 1].Code = 47; d->HuffQ2[0][ 1].Length = 6;
- d->HuffQ2[0][ 2].Code = 15; d->HuffQ2[0][ 2].Length = 5;
- d->HuffQ2[0][ 3].Code = 0; d->HuffQ2[0][ 3].Length = 5;
- d->HuffQ2[0][ 4].Code = 91; d->HuffQ2[0][ 4].Length = 7;
- d->HuffQ2[0][ 5].Code = 4; d->HuffQ2[0][ 5].Length = 5;
- d->HuffQ2[0][ 6].Code = 6; d->HuffQ2[0][ 6].Length = 4;
- d->HuffQ2[0][ 7].Code = 13; d->HuffQ2[0][ 7].Length = 4;
- d->HuffQ2[0][ 8].Code = 4; d->HuffQ2[0][ 8].Length = 4;
- d->HuffQ2[0][ 9].Code = 5; d->HuffQ2[0][ 9].Length = 5;
- d->HuffQ2[0][10].Code = 20; d->HuffQ2[0][10].Length = 5;
- d->HuffQ2[0][11].Code = 12; d->HuffQ2[0][11].Length = 4;
- d->HuffQ2[0][12].Code = 4; d->HuffQ2[0][12].Length = 3;
- d->HuffQ2[0][13].Code = 15; d->HuffQ2[0][13].Length = 4;
- d->HuffQ2[0][14].Code = 14; d->HuffQ2[0][14].Length = 5;
- d->HuffQ2[0][15].Code = 3; d->HuffQ2[0][15].Length = 5;
- d->HuffQ2[0][16].Code = 3; d->HuffQ2[0][16].Length = 4;
- d->HuffQ2[0][17].Code = 14; d->HuffQ2[0][17].Length = 4;
- d->HuffQ2[0][18].Code = 5; d->HuffQ2[0][18].Length = 4;
- d->HuffQ2[0][19].Code = 1; d->HuffQ2[0][19].Length = 5;
- d->HuffQ2[0][20].Code = 90; d->HuffQ2[0][20].Length = 7;
- d->HuffQ2[0][21].Code = 2; d->HuffQ2[0][21].Length = 5;
- d->HuffQ2[0][22].Code = 21; d->HuffQ2[0][22].Length = 5;
- d->HuffQ2[0][23].Code = 46; d->HuffQ2[0][23].Length = 6;
- d->HuffQ2[0][24].Code = 88; d->HuffQ2[0][24].Length = 7;
-
- //more shaped, book 1
- d->HuffQ2[1][ 0].Code = 921; d->HuffQ2[1][ 0].Length = 10;
- d->HuffQ2[1][ 1].Code = 113; d->HuffQ2[1][ 1].Length = 7;
- d->HuffQ2[1][ 2].Code = 51; d->HuffQ2[1][ 2].Length = 6;
- d->HuffQ2[1][ 3].Code = 231; d->HuffQ2[1][ 3].Length = 8;
- d->HuffQ2[1][ 4].Code = 922; d->HuffQ2[1][ 4].Length = 10;
- d->HuffQ2[1][ 5].Code = 104; d->HuffQ2[1][ 5].Length = 7;
- d->HuffQ2[1][ 6].Code = 30; d->HuffQ2[1][ 6].Length = 5;
- d->HuffQ2[1][ 7].Code = 0; d->HuffQ2[1][ 7].Length = 3;
- d->HuffQ2[1][ 8].Code = 29; d->HuffQ2[1][ 8].Length = 5;
- d->HuffQ2[1][ 9].Code = 105; d->HuffQ2[1][ 9].Length = 7;
- d->HuffQ2[1][10].Code = 50; d->HuffQ2[1][10].Length = 6;
- d->HuffQ2[1][11].Code = 1; d->HuffQ2[1][11].Length = 3;
- d->HuffQ2[1][12].Code = 2; d->HuffQ2[1][12].Length = 2;
- d->HuffQ2[1][13].Code = 3; d->HuffQ2[1][13].Length = 3;
- d->HuffQ2[1][14].Code = 49; d->HuffQ2[1][14].Length = 6;
- d->HuffQ2[1][15].Code = 107; d->HuffQ2[1][15].Length = 7;
- d->HuffQ2[1][16].Code = 27; d->HuffQ2[1][16].Length = 5;
- d->HuffQ2[1][17].Code = 2; d->HuffQ2[1][17].Length = 3;
- d->HuffQ2[1][18].Code = 31; d->HuffQ2[1][18].Length = 5;
- d->HuffQ2[1][19].Code = 112; d->HuffQ2[1][19].Length = 7;
- d->HuffQ2[1][20].Code = 920; d->HuffQ2[1][20].Length = 10;
- d->HuffQ2[1][21].Code = 106; d->HuffQ2[1][21].Length = 7;
- d->HuffQ2[1][22].Code = 48; d->HuffQ2[1][22].Length = 6;
- d->HuffQ2[1][23].Code = 114; d->HuffQ2[1][23].Length = 7;
- d->HuffQ2[1][24].Code = 923; d->HuffQ2[1][24].Length = 10;
-
- /********************** 7-step quantizer **************************/
- /*********************** single samples ***************************/
- //less shaped, book 0
- d->HuffQ3[0][0].Code = 12; d->HuffQ3[0][0].Length = 4;
- d->HuffQ3[0][1].Code = 4; d->HuffQ3[0][1].Length = 3;
- d->HuffQ3[0][2].Code = 0; d->HuffQ3[0][2].Length = 2;
- d->HuffQ3[0][3].Code = 1; d->HuffQ3[0][3].Length = 2;
- d->HuffQ3[0][4].Code = 7; d->HuffQ3[0][4].Length = 3;
- d->HuffQ3[0][5].Code = 5; d->HuffQ3[0][5].Length = 3;
- d->HuffQ3[0][6].Code = 13; d->HuffQ3[0][6].Length = 4;
-
- //more shaped, book 1
- d->HuffQ3[1][0].Code = 4; d->HuffQ3[1][0].Length = 5;
- d->HuffQ3[1][1].Code = 3; d->HuffQ3[1][1].Length = 4;
- d->HuffQ3[1][2].Code = 2; d->HuffQ3[1][2].Length = 2;
- d->HuffQ3[1][3].Code = 3; d->HuffQ3[1][3].Length = 2;
- d->HuffQ3[1][4].Code = 1; d->HuffQ3[1][4].Length = 2;
- d->HuffQ3[1][5].Code = 0; d->HuffQ3[1][5].Length = 3;
- d->HuffQ3[1][6].Code = 5; d->HuffQ3[1][6].Length = 5;
-
- /********************** 9-step quantizer **************************/
- /*********************** single samples ***************************/
- //less shaped, book 0
- d->HuffQ4[0][0].Code = 5; d->HuffQ4[0][0].Length = 4;
- d->HuffQ4[0][1].Code = 0; d->HuffQ4[0][1].Length = 3;
- d->HuffQ4[0][2].Code = 4; d->HuffQ4[0][2].Length = 3;
- d->HuffQ4[0][3].Code = 6; d->HuffQ4[0][3].Length = 3;
- d->HuffQ4[0][4].Code = 7; d->HuffQ4[0][4].Length = 3;
- d->HuffQ4[0][5].Code = 5; d->HuffQ4[0][5].Length = 3;
- d->HuffQ4[0][6].Code = 3; d->HuffQ4[0][6].Length = 3;
- d->HuffQ4[0][7].Code = 1; d->HuffQ4[0][7].Length = 3;
- d->HuffQ4[0][8].Code = 4; d->HuffQ4[0][8].Length = 4;
-
- //more shaped, book 1
- d->HuffQ4[1][0].Code = 9; d->HuffQ4[1][0].Length = 5;
- d->HuffQ4[1][1].Code = 12; d->HuffQ4[1][1].Length = 4;
- d->HuffQ4[1][2].Code = 3; d->HuffQ4[1][2].Length = 3;
- d->HuffQ4[1][3].Code = 0; d->HuffQ4[1][3].Length = 2;
- d->HuffQ4[1][4].Code = 2; d->HuffQ4[1][4].Length = 2;
- d->HuffQ4[1][5].Code = 7; d->HuffQ4[1][5].Length = 3;
- d->HuffQ4[1][6].Code = 13; d->HuffQ4[1][6].Length = 4;
- d->HuffQ4[1][7].Code = 5; d->HuffQ4[1][7].Length = 4;
- d->HuffQ4[1][8].Code = 8; d->HuffQ4[1][8].Length = 5;
-
- /********************* 15-step quantizer **************************/
- /*********************** single samples ***************************/
- //less shaped, book 0
- d->HuffQ5[0][ 0].Code = 57; d->HuffQ5[0][ 0].Length = 6;
- d->HuffQ5[0][ 1].Code = 23; d->HuffQ5[0][ 1].Length = 5;
- d->HuffQ5[0][ 2].Code = 8; d->HuffQ5[0][ 2].Length = 4;
- d->HuffQ5[0][ 3].Code = 10; d->HuffQ5[0][ 3].Length = 4;
- d->HuffQ5[0][ 4].Code = 13; d->HuffQ5[0][ 4].Length = 4;
- d->HuffQ5[0][ 5].Code = 0; d->HuffQ5[0][ 5].Length = 3;
- d->HuffQ5[0][ 6].Code = 2; d->HuffQ5[0][ 6].Length = 3;
- d->HuffQ5[0][ 7].Code = 3; d->HuffQ5[0][ 7].Length = 3;
- d->HuffQ5[0][ 8].Code = 1; d->HuffQ5[0][ 8].Length = 3;
- d->HuffQ5[0][ 9].Code = 15; d->HuffQ5[0][ 9].Length = 4;
- d->HuffQ5[0][10].Code = 12; d->HuffQ5[0][10].Length = 4;
- d->HuffQ5[0][11].Code = 9; d->HuffQ5[0][11].Length = 4;
- d->HuffQ5[0][12].Code = 29; d->HuffQ5[0][12].Length = 5;
- d->HuffQ5[0][13].Code = 22; d->HuffQ5[0][13].Length = 5;
- d->HuffQ5[0][14].Code = 56; d->HuffQ5[0][14].Length = 6;
-
- //more shaped, book 1
- d->HuffQ5[1][ 0].Code = 229; d->HuffQ5[1][ 0].Length = 8;
- d->HuffQ5[1][ 1].Code = 56; d->HuffQ5[1][ 1].Length = 6;
- d->HuffQ5[1][ 2].Code = 7; d->HuffQ5[1][ 2].Length = 5;
- d->HuffQ5[1][ 3].Code = 2; d->HuffQ5[1][ 3].Length = 4;
- d->HuffQ5[1][ 4].Code = 0; d->HuffQ5[1][ 4].Length = 3;
- d->HuffQ5[1][ 5].Code = 3; d->HuffQ5[1][ 5].Length = 3;
- d->HuffQ5[1][ 6].Code = 5; d->HuffQ5[1][ 6].Length = 3;
- d->HuffQ5[1][ 7].Code = 6; d->HuffQ5[1][ 7].Length = 3;
- d->HuffQ5[1][ 8].Code = 4; d->HuffQ5[1][ 8].Length = 3;
- d->HuffQ5[1][ 9].Code = 2; d->HuffQ5[1][ 9].Length = 3;
- d->HuffQ5[1][10].Code = 15; d->HuffQ5[1][10].Length = 4;
- d->HuffQ5[1][11].Code = 29; d->HuffQ5[1][11].Length = 5;
- d->HuffQ5[1][12].Code = 6; d->HuffQ5[1][12].Length = 5;
- d->HuffQ5[1][13].Code = 115; d->HuffQ5[1][13].Length = 7;
- d->HuffQ5[1][14].Code = 228; d->HuffQ5[1][14].Length = 8;
-
- /********************* 31-step quantizer **************************/
- /*********************** single samples ***************************/
- //less shaped, book 0
- d->HuffQ6[0][ 0].Code = 65; d->HuffQ6[0][ 0].Length = 7;
- d->HuffQ6[0][ 1].Code = 6; d->HuffQ6[0][ 1].Length = 6;
- d->HuffQ6[0][ 2].Code = 44; d->HuffQ6[0][ 2].Length = 6;
- d->HuffQ6[0][ 3].Code = 45; d->HuffQ6[0][ 3].Length = 6;
- d->HuffQ6[0][ 4].Code = 59; d->HuffQ6[0][ 4].Length = 6;
- d->HuffQ6[0][ 5].Code = 13; d->HuffQ6[0][ 5].Length = 5;
- d->HuffQ6[0][ 6].Code = 17; d->HuffQ6[0][ 6].Length = 5;
- d->HuffQ6[0][ 7].Code = 19; d->HuffQ6[0][ 7].Length = 5;
- d->HuffQ6[0][ 8].Code = 23; d->HuffQ6[0][ 8].Length = 5;
- d->HuffQ6[0][ 9].Code = 21; d->HuffQ6[0][ 9].Length = 5;
- d->HuffQ6[0][10].Code = 26; d->HuffQ6[0][10].Length = 5;
- d->HuffQ6[0][11].Code = 30; d->HuffQ6[0][11].Length = 5;
- d->HuffQ6[0][12].Code = 0; d->HuffQ6[0][12].Length = 4;
- d->HuffQ6[0][13].Code = 2; d->HuffQ6[0][13].Length = 4;
- d->HuffQ6[0][14].Code = 5; d->HuffQ6[0][14].Length = 4;
- d->HuffQ6[0][15].Code = 7; d->HuffQ6[0][15].Length = 4;
- d->HuffQ6[0][16].Code = 3; d->HuffQ6[0][16].Length = 4;
- d->HuffQ6[0][17].Code = 4; d->HuffQ6[0][17].Length = 4;
- d->HuffQ6[0][18].Code = 31; d->HuffQ6[0][18].Length = 5;
- d->HuffQ6[0][19].Code = 28; d->HuffQ6[0][19].Length = 5;
- d->HuffQ6[0][20].Code = 25; d->HuffQ6[0][20].Length = 5;
- d->HuffQ6[0][21].Code = 27; d->HuffQ6[0][21].Length = 5;
- d->HuffQ6[0][22].Code = 24; d->HuffQ6[0][22].Length = 5;
- d->HuffQ6[0][23].Code = 20; d->HuffQ6[0][23].Length = 5;
- d->HuffQ6[0][24].Code = 18; d->HuffQ6[0][24].Length = 5;
- d->HuffQ6[0][25].Code = 12; d->HuffQ6[0][25].Length = 5;
- d->HuffQ6[0][26].Code = 2; d->HuffQ6[0][26].Length = 5;
- d->HuffQ6[0][27].Code = 58; d->HuffQ6[0][27].Length = 6;
- d->HuffQ6[0][28].Code = 33; d->HuffQ6[0][28].Length = 6;
- d->HuffQ6[0][29].Code = 7; d->HuffQ6[0][29].Length = 6;
- d->HuffQ6[0][30].Code = 64; d->HuffQ6[0][30].Length = 7;
-
- //more shaped, book 1
- d->HuffQ6[1][ 0].Code = 6472; d->HuffQ6[1][ 0].Length = 13;
- d->HuffQ6[1][ 1].Code = 6474; d->HuffQ6[1][ 1].Length = 13;
- d->HuffQ6[1][ 2].Code = 808; d->HuffQ6[1][ 2].Length = 10;
- d->HuffQ6[1][ 3].Code = 405; d->HuffQ6[1][ 3].Length = 9;
- d->HuffQ6[1][ 4].Code = 203; d->HuffQ6[1][ 4].Length = 8;
- d->HuffQ6[1][ 5].Code = 102; d->HuffQ6[1][ 5].Length = 7;
- d->HuffQ6[1][ 6].Code = 49; d->HuffQ6[1][ 6].Length = 6;
- d->HuffQ6[1][ 7].Code = 9; d->HuffQ6[1][ 7].Length = 5;
- d->HuffQ6[1][ 8].Code = 15; d->HuffQ6[1][ 8].Length = 5;
- d->HuffQ6[1][ 9].Code = 31; d->HuffQ6[1][ 9].Length = 5;
- d->HuffQ6[1][10].Code = 2; d->HuffQ6[1][10].Length = 4;
- d->HuffQ6[1][11].Code = 6; d->HuffQ6[1][11].Length = 4;
- d->HuffQ6[1][12].Code = 8; d->HuffQ6[1][12].Length = 4;
- d->HuffQ6[1][13].Code = 11; d->HuffQ6[1][13].Length = 4;
- d->HuffQ6[1][14].Code = 13; d->HuffQ6[1][14].Length = 4;
- d->HuffQ6[1][15].Code = 0; d->HuffQ6[1][15].Length = 3;
- d->HuffQ6[1][16].Code = 14; d->HuffQ6[1][16].Length = 4;
- d->HuffQ6[1][17].Code = 10; d->HuffQ6[1][17].Length = 4;
- d->HuffQ6[1][18].Code = 9; d->HuffQ6[1][18].Length = 4;
- d->HuffQ6[1][19].Code = 5; d->HuffQ6[1][19].Length = 4;
- d->HuffQ6[1][20].Code = 3; d->HuffQ6[1][20].Length = 4;
- d->HuffQ6[1][21].Code = 30; d->HuffQ6[1][21].Length = 5;
- d->HuffQ6[1][22].Code = 14; d->HuffQ6[1][22].Length = 5;
- d->HuffQ6[1][23].Code = 8; d->HuffQ6[1][23].Length = 5;
- d->HuffQ6[1][24].Code = 48; d->HuffQ6[1][24].Length = 6;
- d->HuffQ6[1][25].Code = 103; d->HuffQ6[1][25].Length = 7;
- d->HuffQ6[1][26].Code = 201; d->HuffQ6[1][26].Length = 8;
- d->HuffQ6[1][27].Code = 200; d->HuffQ6[1][27].Length = 8;
- d->HuffQ6[1][28].Code = 1619; d->HuffQ6[1][28].Length = 11;
- d->HuffQ6[1][29].Code = 6473; d->HuffQ6[1][29].Length = 13;
- d->HuffQ6[1][30].Code = 6475; d->HuffQ6[1][30].Length = 13;
-
- /********************* 63-step quantizer **************************/
- /*********************** single samples ***************************/
- //less shaped, book 0
- d->HuffQ7[0][ 0].Code = 103; d->HuffQ7[0][ 0].Length = 8; /* 0.003338 - 01100111 */
- d->HuffQ7[0][ 1].Code = 153; d->HuffQ7[0][ 1].Length = 8; /* 0.003766 - 10011001 */
- d->HuffQ7[0][ 2].Code = 181; d->HuffQ7[0][ 2].Length = 8; /* 0.004715 - 10110101 */
- d->HuffQ7[0][ 3].Code = 233; d->HuffQ7[0][ 3].Length = 8; /* 0.005528 - 11101001 */
- d->HuffQ7[0][ 4].Code = 64; d->HuffQ7[0][ 4].Length = 7; /* 0.006677 - 1000000 */
- d->HuffQ7[0][ 5].Code = 65; d->HuffQ7[0][ 5].Length = 7; /* 0.007041 - 1000001 */
- d->HuffQ7[0][ 6].Code = 77; d->HuffQ7[0][ 6].Length = 7; /* 0.007733 - 1001101 */
- d->HuffQ7[0][ 7].Code = 81; d->HuffQ7[0][ 7].Length = 7; /* 0.008296 - 1010001 */
- d->HuffQ7[0][ 8].Code = 91; d->HuffQ7[0][ 8].Length = 7; /* 0.009295 - 1011011 */
- d->HuffQ7[0][ 9].Code = 113; d->HuffQ7[0][ 9].Length = 7; /* 0.010814 - 1110001 */
- d->HuffQ7[0][10].Code = 112; d->HuffQ7[0][10].Length = 7; /* 0.010807 - 1110000 */
- d->HuffQ7[0][11].Code = 24; d->HuffQ7[0][11].Length = 6; /* 0.012748 - 011000 */
- d->HuffQ7[0][12].Code = 29; d->HuffQ7[0][12].Length = 6; /* 0.013390 - 011101 */
- d->HuffQ7[0][13].Code = 35; d->HuffQ7[0][13].Length = 6; /* 0.014224 - 100011 */
- d->HuffQ7[0][14].Code = 37; d->HuffQ7[0][14].Length = 6; /* 0.015201 - 100101 */
- d->HuffQ7[0][15].Code = 41; d->HuffQ7[0][15].Length = 6; /* 0.016642 - 101001 */
- d->HuffQ7[0][16].Code = 44; d->HuffQ7[0][16].Length = 6; /* 0.017292 - 101100 */
- d->HuffQ7[0][17].Code = 46; d->HuffQ7[0][17].Length = 6; /* 0.018647 - 101110 */
- d->HuffQ7[0][18].Code = 51; d->HuffQ7[0][18].Length = 6; /* 0.020473 - 110011 */
- d->HuffQ7[0][19].Code = 49; d->HuffQ7[0][19].Length = 6; /* 0.020152 - 110001 */
- d->HuffQ7[0][20].Code = 54; d->HuffQ7[0][20].Length = 6; /* 0.021315 - 110110 */
- d->HuffQ7[0][21].Code = 55; d->HuffQ7[0][21].Length = 6; /* 0.021358 - 110111 */
- d->HuffQ7[0][22].Code = 57; d->HuffQ7[0][22].Length = 6; /* 0.021700 - 111001 */
- d->HuffQ7[0][23].Code = 60; d->HuffQ7[0][23].Length = 6; /* 0.022449 - 111100 */
- d->HuffQ7[0][24].Code = 0; d->HuffQ7[0][24].Length = 5; /* 0.023063 - 00000 */
- d->HuffQ7[0][25].Code = 2; d->HuffQ7[0][25].Length = 5; /* 0.023854 - 00010 */
- d->HuffQ7[0][26].Code = 10; d->HuffQ7[0][26].Length = 5; /* 0.025481 - 01010 */
- d->HuffQ7[0][27].Code = 5; d->HuffQ7[0][27].Length = 5; /* 0.024867 - 00101 */
- d->HuffQ7[0][28].Code = 9; d->HuffQ7[0][28].Length = 5; /* 0.025352 - 01001 */
- d->HuffQ7[0][29].Code = 6; d->HuffQ7[0][29].Length = 5; /* 0.025074 - 00110 */
- d->HuffQ7[0][30].Code = 13; d->HuffQ7[0][30].Length = 5; /* 0.025745 - 01101 */
- d->HuffQ7[0][31].Code = 7; d->HuffQ7[0][31].Length = 5; /* 0.025195 - 00111 */
- d->HuffQ7[0][32].Code = 11; d->HuffQ7[0][32].Length = 5; /* 0.025502 - 01011 */
- d->HuffQ7[0][33].Code = 15; d->HuffQ7[0][33].Length = 5; /* 0.026251 - 01111 */
- d->HuffQ7[0][34].Code = 8; d->HuffQ7[0][34].Length = 5; /* 0.025260 - 01000 */
- d->HuffQ7[0][35].Code = 4; d->HuffQ7[0][35].Length = 5; /* 0.024418 - 00100 */
- d->HuffQ7[0][36].Code = 3; d->HuffQ7[0][36].Length = 5; /* 0.023983 - 00011 */
- d->HuffQ7[0][37].Code = 1; d->HuffQ7[0][37].Length = 5; /* 0.023697 - 00001 */
- d->HuffQ7[0][38].Code = 63; d->HuffQ7[0][38].Length = 6; /* 0.023041 - 111111 */
- d->HuffQ7[0][39].Code = 62; d->HuffQ7[0][39].Length = 6; /* 0.022656 - 111110 */
- d->HuffQ7[0][40].Code = 61; d->HuffQ7[0][40].Length = 6; /* 0.022549 - 111101 */
- d->HuffQ7[0][41].Code = 53; d->HuffQ7[0][41].Length = 6; /* 0.021151 - 110101 */
- d->HuffQ7[0][42].Code = 59; d->HuffQ7[0][42].Length = 6; /* 0.022042 - 111011 */
- d->HuffQ7[0][43].Code = 52; d->HuffQ7[0][43].Length = 6; /* 0.020837 - 110100 */
- d->HuffQ7[0][44].Code = 48; d->HuffQ7[0][44].Length = 6; /* 0.019446 - 110000 */
- d->HuffQ7[0][45].Code = 47; d->HuffQ7[0][45].Length = 6; /* 0.019189 - 101111 */
- d->HuffQ7[0][46].Code = 43; d->HuffQ7[0][46].Length = 6; /* 0.017177 - 101011 */
- d->HuffQ7[0][47].Code = 42; d->HuffQ7[0][47].Length = 6; /* 0.017035 - 101010 */
- d->HuffQ7[0][48].Code = 39; d->HuffQ7[0][48].Length = 6; /* 0.015287 - 100111 */
- d->HuffQ7[0][49].Code = 36; d->HuffQ7[0][49].Length = 6; /* 0.014559 - 100100 */
- d->HuffQ7[0][50].Code = 33; d->HuffQ7[0][50].Length = 6; /* 0.014117 - 100001 */
- d->HuffQ7[0][51].Code = 28; d->HuffQ7[0][51].Length = 6; /* 0.012776 - 011100 */
- d->HuffQ7[0][52].Code = 117; d->HuffQ7[0][52].Length = 7; /* 0.011107 - 1110101 */
- d->HuffQ7[0][53].Code = 101; d->HuffQ7[0][53].Length = 7; /* 0.010636 - 1100101 */
- d->HuffQ7[0][54].Code = 100; d->HuffQ7[0][54].Length = 7; /* 0.009751 - 1100100 */
- d->HuffQ7[0][55].Code = 80; d->HuffQ7[0][55].Length = 7; /* 0.008132 - 1010000 */
- d->HuffQ7[0][56].Code = 69; d->HuffQ7[0][56].Length = 7; /* 0.007091 - 1000101 */
- d->HuffQ7[0][57].Code = 68; d->HuffQ7[0][57].Length = 7; /* 0.007084 - 1000100 */
- d->HuffQ7[0][58].Code = 50; d->HuffQ7[0][58].Length = 7; /* 0.006277 - 0110010 */
- d->HuffQ7[0][59].Code = 232; d->HuffQ7[0][59].Length = 8; /* 0.005386 - 11101000 */
- d->HuffQ7[0][60].Code = 180; d->HuffQ7[0][60].Length = 8; /* 0.004408 - 10110100 */
- d->HuffQ7[0][61].Code = 152; d->HuffQ7[0][61].Length = 8; /* 0.003759 - 10011000 */
- d->HuffQ7[0][62].Code = 102; d->HuffQ7[0][62].Length = 8; /* 0.003160 - 01100110 */
-
- //more shaped, book 1
- d->HuffQ7[1][ 0].Code = 14244; d->HuffQ7[1][ 0].Length = 14; /* 0.000059 - 11011110100100 */
- d->HuffQ7[1][ 1].Code = 14253; d->HuffQ7[1][ 1].Length = 14; /* 0.000098 - 11011110101101 */
- d->HuffQ7[1][ 2].Code = 14246; d->HuffQ7[1][ 2].Length = 14; /* 0.000078 - 11011110100110 */
- d->HuffQ7[1][ 3].Code = 14254; d->HuffQ7[1][ 3].Length = 14; /* 0.000111 - 11011110101110 */
- d->HuffQ7[1][ 4].Code = 3562; d->HuffQ7[1][ 4].Length = 12; /* 0.000320 - 110111101010 */
- d->HuffQ7[1][ 5].Code = 752; d->HuffQ7[1][ 5].Length = 10; /* 0.000920 - 1011110000 */
- d->HuffQ7[1][ 6].Code = 753; d->HuffQ7[1][ 6].Length = 10; /* 0.001057 - 1011110001 */
- d->HuffQ7[1][ 7].Code = 160; d->HuffQ7[1][ 7].Length = 9; /* 0.001403 - 010100000 */
- d->HuffQ7[1][ 8].Code = 162; d->HuffQ7[1][ 8].Length = 9; /* 0.001579 - 010100010 */
- d->HuffQ7[1][ 9].Code = 444; d->HuffQ7[1][ 9].Length = 9; /* 0.002486 - 110111100 */
- d->HuffQ7[1][10].Code = 122; d->HuffQ7[1][10].Length = 8; /* 0.003772 - 01111010 */
- d->HuffQ7[1][11].Code = 223; d->HuffQ7[1][11].Length = 8; /* 0.005710 - 11011111 */
- d->HuffQ7[1][12].Code = 60; d->HuffQ7[1][12].Length = 7; /* 0.006858 - 0111100 */
- d->HuffQ7[1][13].Code = 73; d->HuffQ7[1][13].Length = 7; /* 0.008033 - 1001001 */
- d->HuffQ7[1][14].Code = 110; d->HuffQ7[1][14].Length = 7; /* 0.009827 - 1101110 */
- d->HuffQ7[1][15].Code = 14; d->HuffQ7[1][15].Length = 6; /* 0.012601 - 001110 */
- d->HuffQ7[1][16].Code = 24; d->HuffQ7[1][16].Length = 6; /* 0.013194 - 011000 */
- d->HuffQ7[1][17].Code = 25; d->HuffQ7[1][17].Length = 6; /* 0.013938 - 011001 */
- d->HuffQ7[1][18].Code = 34; d->HuffQ7[1][18].Length = 6; /* 0.015693 - 100010 */
- d->HuffQ7[1][19].Code = 37; d->HuffQ7[1][19].Length = 6; /* 0.017846 - 100101 */
- d->HuffQ7[1][20].Code = 54; d->HuffQ7[1][20].Length = 6; /* 0.020078 - 110110 */
- d->HuffQ7[1][21].Code = 3; d->HuffQ7[1][21].Length = 5; /* 0.022975 - 00011 */
- d->HuffQ7[1][22].Code = 9; d->HuffQ7[1][22].Length = 5; /* 0.025631 - 01001 */
- d->HuffQ7[1][23].Code = 11; d->HuffQ7[1][23].Length = 5; /* 0.027021 - 01011 */
- d->HuffQ7[1][24].Code = 16; d->HuffQ7[1][24].Length = 5; /* 0.031465 - 10000 */
- d->HuffQ7[1][25].Code = 19; d->HuffQ7[1][25].Length = 5; /* 0.034244 - 10011 */
- d->HuffQ7[1][26].Code = 21; d->HuffQ7[1][26].Length = 5; /* 0.035921 - 10101 */
- d->HuffQ7[1][27].Code = 24; d->HuffQ7[1][27].Length = 5; /* 0.037938 - 11000 */
- d->HuffQ7[1][28].Code = 26; d->HuffQ7[1][28].Length = 5; /* 0.039595 - 11010 */
- d->HuffQ7[1][29].Code = 29; d->HuffQ7[1][29].Length = 5; /* 0.041546 - 11101 */
- d->HuffQ7[1][30].Code = 31; d->HuffQ7[1][30].Length = 5; /* 0.042623 - 11111 */
- d->HuffQ7[1][31].Code = 2; d->HuffQ7[1][31].Length = 4; /* 0.045180 - 0010 */
- d->HuffQ7[1][32].Code = 0; d->HuffQ7[1][32].Length = 4; /* 0.043151 - 0000 */
- d->HuffQ7[1][33].Code = 30; d->HuffQ7[1][33].Length = 5; /* 0.042538 - 11110 */
- d->HuffQ7[1][34].Code = 28; d->HuffQ7[1][34].Length = 5; /* 0.041422 - 11100 */
- d->HuffQ7[1][35].Code = 25; d->HuffQ7[1][35].Length = 5; /* 0.039145 - 11001 */
- d->HuffQ7[1][36].Code = 22; d->HuffQ7[1][36].Length = 5; /* 0.036691 - 10110 */
- d->HuffQ7[1][37].Code = 20; d->HuffQ7[1][37].Length = 5; /* 0.034955 - 10100 */
- d->HuffQ7[1][38].Code = 14; d->HuffQ7[1][38].Length = 5; /* 0.029155 - 01110 */
- d->HuffQ7[1][39].Code = 13; d->HuffQ7[1][39].Length = 5; /* 0.027921 - 01101 */
- d->HuffQ7[1][40].Code = 8; d->HuffQ7[1][40].Length = 5; /* 0.025553 - 01000 */
- d->HuffQ7[1][41].Code = 6; d->HuffQ7[1][41].Length = 5; /* 0.023093 - 00110 */
- d->HuffQ7[1][42].Code = 2; d->HuffQ7[1][42].Length = 5; /* 0.021200 - 00010 */
- d->HuffQ7[1][43].Code = 46; d->HuffQ7[1][43].Length = 6; /* 0.018134 - 101110 */
- d->HuffQ7[1][44].Code = 35; d->HuffQ7[1][44].Length = 6; /* 0.015824 - 100011 */
- d->HuffQ7[1][45].Code = 31; d->HuffQ7[1][45].Length = 6; /* 0.014701 - 011111 */
- d->HuffQ7[1][46].Code = 21; d->HuffQ7[1][46].Length = 6; /* 0.013187 - 010101 */
- d->HuffQ7[1][47].Code = 15; d->HuffQ7[1][47].Length = 6; /* 0.012776 - 001111 */
- d->HuffQ7[1][48].Code = 95; d->HuffQ7[1][48].Length = 7; /* 0.009664 - 1011111 */
- d->HuffQ7[1][49].Code = 72; d->HuffQ7[1][49].Length = 7; /* 0.007922 - 1001000 */
- d->HuffQ7[1][50].Code = 41; d->HuffQ7[1][50].Length = 7; /* 0.006838 - 0101001 */
- d->HuffQ7[1][51].Code = 189; d->HuffQ7[1][51].Length = 8; /* 0.005024 - 10111101 */
- d->HuffQ7[1][52].Code = 123; d->HuffQ7[1][52].Length = 8; /* 0.003830 - 01111011 */
- d->HuffQ7[1][53].Code = 377; d->HuffQ7[1][53].Length = 9; /* 0.002232 - 101111001 */
- d->HuffQ7[1][54].Code = 161; d->HuffQ7[1][54].Length = 9; /* 0.001566 - 010100001 */
- d->HuffQ7[1][55].Code = 891; d->HuffQ7[1][55].Length = 10; /* 0.001383 - 1101111011 */
- d->HuffQ7[1][56].Code = 327; d->HuffQ7[1][56].Length = 10; /* 0.000900 - 0101000111 */
- d->HuffQ7[1][57].Code = 326; d->HuffQ7[1][57].Length = 10; /* 0.000790 - 0101000110 */
- d->HuffQ7[1][58].Code = 3560; d->HuffQ7[1][58].Length = 12; /* 0.000254 - 110111101000 */
- d->HuffQ7[1][59].Code = 14255; d->HuffQ7[1][59].Length = 14; /* 0.000117 - 11011110101111 */
- d->HuffQ7[1][60].Code = 14247; d->HuffQ7[1][60].Length = 14; /* 0.000085 - 11011110100111 */
- d->HuffQ7[1][61].Code = 14252; d->HuffQ7[1][61].Length = 14; /* 0.000085 - 11011110101100 */
- d->HuffQ7[1][62].Code = 14245; d->HuffQ7[1][62].Length = 14; /* 0.000065 - 11011110100101 */
-}
diff --git a/src/libmusepack/idtag.c b/src/libmusepack/idtag.c
deleted file mode 100644
index 4b02b33f4..000000000
--- a/src/libmusepack/idtag.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- Copyright (c) 2004, The Musepack Development Team
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are
- met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials provided
- with the distribution.
-
- * Neither the name of the The Musepack Development Team nor the
- names of its contributors may be used to endorse or promote
- products derived from this software without specific prior
- written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/// \file idtag.c
-/// Rudimentary id3tag handling routines, just enough to skip id3v2 tags,
-/// if present.
-
-#include "musepack/musepack.h"
-#include "musepack/internal.h"
-
-mpc_int32_t
-JumpID3v2 (mpc_reader* r) {
- unsigned char tmp [10];
- mpc_uint32_t Unsynchronisation; // ID3v2.4-flag
- mpc_uint32_t ExtHeaderPresent; // ID3v2.4-flag
- mpc_uint32_t ExperimentalFlag; // ID3v2.4-flag
- mpc_uint32_t FooterPresent; // ID3v2.4-flag
- mpc_int32_t ret;
-
- // seek to first byte of mpc data
- if (!r->seek (r->data, 0)) {
- return 0;
- }
-
- r->read(r->data, tmp, sizeof(tmp));
-
- // check id3-tag
- if ( 0 != memcmp ( tmp, "ID3", 3) )
- return 0;
-
- // read flags
- Unsynchronisation = tmp[5] & 0x80;
- ExtHeaderPresent = tmp[5] & 0x40;
- ExperimentalFlag = tmp[5] & 0x20;
- FooterPresent = tmp[5] & 0x10;
-
- if ( tmp[5] & 0x0F )
- return -1; // not (yet???) allowed
- if ( (tmp[6] | tmp[7] | tmp[8] | tmp[9]) & 0x80 )
- return -1; // not allowed
-
- // read HeaderSize (syncsave: 4 * $0xxxxxxx = 28 significant bits)
- ret = tmp[6] << 21;
- ret += tmp[7] << 14;
- ret += tmp[8] << 7;
- ret += tmp[9] ;
- ret += 10;
- if ( FooterPresent )
- ret += 10;
-
- return ret;
-}
diff --git a/src/libmusepack/mpc_decoder.c b/src/libmusepack/mpc_decoder.c
deleted file mode 100644
index d65708c52..000000000
--- a/src/libmusepack/mpc_decoder.c
+++ /dev/null
@@ -1,1349 +0,0 @@
-/*
- Copyright (c) 2004, The Musepack Development Team
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are
- met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials provided
- with the distribution.
-
- * Neither the name of the The Musepack Development Team nor the
- names of its contributors may be used to endorse or promote
- products derived from this software without specific prior
- written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/// \file mpc_decoder.c
-/// Core decoding routines and logic.
-
-#include "musepack/musepack.h"
-#include "musepack/internal.h"
-#include "musepack/requant.h"
-#include "musepack/huffman.h"
-
-//------------------------------------------------------------------------------
-// types
-//------------------------------------------------------------------------------
-enum
- {
- EQ_TAP = 13, // length of FIR filter for EQ
- DELAY = ((EQ_TAP + 1) / 2), // delay of FIR
- FIR_BANDS = 4, // number of subbands to be FIR filtered
- MEMSIZE = MPC_DECODER_MEMSIZE, // overall buffer size
- MEMSIZE2 = (MEMSIZE/2), // size of one buffer
- MEMMASK = (MEMSIZE-1)
- };
-
-//------------------------------------------------------------------------------
-// forward declarations
-//------------------------------------------------------------------------------
-void mpc_decoder_init_huffman_sv6(mpc_decoder *d);
-void mpc_decoder_init_huffman_sv7(mpc_decoder *d);
-void mpc_decoder_read_bitstream_sv6(mpc_decoder *d);
-void mpc_decoder_read_bitstream_sv7(mpc_decoder *d);
-void mpc_decoder_update_buffer(mpc_decoder *d, mpc_uint32_t RING);
-mpc_bool_t mpc_decoder_seek_sample(mpc_decoder *d, mpc_int64_t destsample);
-void mpc_decoder_requantisierung(mpc_decoder *d, const mpc_int32_t Last_Band);
-
-//------------------------------------------------------------------------------
-// utility functions
-//------------------------------------------------------------------------------
-static mpc_int32_t f_read(mpc_decoder *d, void *ptr, size_t size)
-{
- return d->r->read(d->r->data, ptr, size);
-};
-
-static mpc_bool_t f_seek(mpc_decoder *d, mpc_int32_t offset)
-{
- return d->r->seek(d->r->data, offset);
-};
-
-static mpc_int32_t f_read_dword(mpc_decoder *d, mpc_uint32_t * ptr, mpc_uint32_t count)
-{
- count = f_read(d, ptr, count << 2) >> 2;
-#ifndef MPC_LITTLE_ENDIAN
- mpc_uint32_t n;
- for(n = 0; n< count; n++) {
- ptr[n] = swap32(ptr[n]);
- }
-#endif
- return count;
-}
-
-//------------------------------------------------------------------------------
-// huffman & bitstream functions
-//------------------------------------------------------------------------------
-static const mpc_uint32_t mask [33] = {
- 0x00000000, 0x00000001, 0x00000003, 0x00000007,
- 0x0000000F, 0x0000001F, 0x0000003F, 0x0000007F,
- 0x000000FF, 0x000001FF, 0x000003FF, 0x000007FF,
- 0x00000FFF, 0x00001FFF, 0x00003FFF, 0x00007FFF,
- 0x0000FFFF, 0x0001FFFF, 0x0003FFFF, 0x0007FFFF,
- 0x000FFFFF, 0x001FFFFF, 0x003FFFFF, 0x007FFFFF,
- 0x00FFFFFF, 0x01FFFFFF, 0x03FFFFFF, 0x07FFFFFF,
- 0x0FFFFFFF, 0x1FFFFFFF, 0x3FFFFFFF, 0x7FFFFFFF,
- 0xFFFFFFFF
-};
-
-/* F U N C T I O N S */
-
-// resets bitstream decoding
-static void
-mpc_decoder_reset_bitstream_decode(mpc_decoder *d)
-{
- d->dword = 0;
- d->pos = 0;
- d->Zaehler = 0;
- d->WordsRead = 0;
-}
-
-// reports the number of read bits
-static mpc_uint32_t
-mpc_decoder_bits_read(mpc_decoder *d)
-{
- return 32 * d->WordsRead + d->pos;
-}
-
-// read desired number of bits out of the bitstream
-static mpc_uint32_t
-mpc_decoder_bitstream_read(mpc_decoder *d, const mpc_uint32_t bits)
-{
- mpc_uint32_t out = d->dword;
-
- d->pos += bits;
-
- if (d->pos < 32) {
- out >>= (32 - d->pos);
- }
- else {
- d->dword = d->Speicher[d->Zaehler = (d->Zaehler + 1) & MEMMASK];
- d->pos -= 32;
- if (d->pos) {
- out <<= d->pos;
- out |= d->dword >> (32 - d->pos);
- }
- ++(d->WordsRead);
- }
-
- return out & mask[bits];
-}
-
-// decode SCFI-bundle (sv4,5,6)
-static void
-mpc_decoder_scfi_bundle_read(
- mpc_decoder *d,
- HuffmanTyp* Table, mpc_int32_t* SCFI, mpc_int32_t* DSCF)
-{
- // load preview and decode
- mpc_uint32_t code = d->dword << d->pos;
- if (d->pos > 26) {
- code |= d->Speicher[(d->Zaehler + 1) & MEMMASK] >> (32 - d->pos);
- }
- while (code < Table->Code) {
- Table++;
- }
-
- // set the new position within bitstream without performing a dummy-read
- if ((d->pos += Table->Length) >= 32) {
- d->pos -= 32;
- d->dword = d->Speicher[d->Zaehler = (d->Zaehler+1) & MEMMASK];
- ++(d->WordsRead);
- }
-
- *SCFI = Table->Value >> 1;
- *DSCF = Table->Value & 1;
-}
-
-static int
-mpc_decoder_huffman_typ_cmpfn(const void* p1, const void* p2)
-{
- if (((HuffmanTyp*) p1)->Code < ((HuffmanTyp*) p2)->Code ) return +1;
- if (((HuffmanTyp*) p1)->Code > ((HuffmanTyp*) p2)->Code ) return -1;
- return 0;
-}
-
-// sort huffman-tables by codeword
-// offset resulting value
-void
-mpc_decoder_resort_huff_tables(
- const mpc_uint32_t elements, HuffmanTyp* Table, const mpc_int32_t offset )
-{
- mpc_uint32_t i;
-
- for ( i = 0; i < elements; i++ ) {
- Table[i].Code <<= 32 - Table[i].Length;
- Table[i].Value = i - offset;
- }
- qsort(Table, elements, sizeof(*Table), mpc_decoder_huffman_typ_cmpfn);
-}
-
-// basic huffman decoding routine
-// works with maximum lengths up to 14
-static mpc_int32_t
-mpc_decoder_huffman_decode(mpc_decoder *d, const HuffmanTyp *Table)
-{
- // load preview and decode
- mpc_uint32_t code = d->dword << d->pos;
- if (d->pos > 18) {
- code |= d->Speicher[(d->Zaehler + 1) & MEMMASK] >> (32 - d->pos);
- }
- while (code < Table->Code) {
- Table++;
- }
-
- // set the new position within bitstream without performing a dummy-read
- if ((d->pos += Table->Length) >= 32) {
- d->pos -= 32;
- d->dword = d->Speicher[d->Zaehler = (d->Zaehler + 1) & MEMMASK];
- ++(d->WordsRead);
- }
-
- return Table->Value;
-}
-
-// faster huffman through previewing less bits
-// works with maximum lengths up to 10
-static mpc_int32_t
-mpc_decoder_huffman_decode_fast(mpc_decoder *d, const HuffmanTyp* Table)
-{
- // load preview and decode
- mpc_uint32_t code = d->dword << d->pos;
- if (d->pos > 22) {
- code |= d->Speicher[(d->Zaehler + 1) & MEMMASK] >> (32 - d->pos);
- }
- while (code < Table->Code) {
- Table++;
- }
-
- // set the new position within bitstream without performing a dummy-read
- if ((d->pos += Table->Length) >= 32) {
- d->pos -= 32;
- d->dword = d->Speicher[d->Zaehler = (d->Zaehler + 1) & MEMMASK];
- ++(d->WordsRead);
- }
-
- return Table->Value;
-}
-
-// even faster huffman through previewing even less bits
-// works with maximum lengths up to 5
-static mpc_int32_t
-mpc_decoder_huffman_decode_faster(mpc_decoder *d, const HuffmanTyp* Table)
-{
- // load preview and decode
- mpc_uint32_t code = d->dword << d->pos;
- if (d->pos > 27) {
- code |= d->Speicher[(d->Zaehler + 1) & MEMMASK] >> (32 - d->pos);
- }
- while (code < Table->Code) {
- Table++;
- }
-
- // set the new position within bitstream without performing a dummy-read
- if ((d->pos += Table->Length) >= 32) {
- d->pos -= 32;
- d->dword = d->Speicher[d->Zaehler = (d->Zaehler + 1) & MEMMASK];
- ++(d->WordsRead);
- }
-
- return Table->Value;
-}
-
-static void
-mpc_decoder_reset_v(mpc_decoder *d)
-{
- memset(d->V_L, 0, sizeof d->V_L);
- memset(d->V_R, 0, sizeof d->V_R);
-}
-
-static void
-mpc_decoder_reset_synthesis(mpc_decoder *d)
-{
- mpc_decoder_reset_v(d);
-}
-
-static void
-mpc_decoder_reset_y(mpc_decoder *d)
-{
- memset(d->Y_L, 0, sizeof d->Y_L);
- memset(d->Y_R, 0, sizeof d->Y_R);
-}
-
-static void
-mpc_decoder_reset_globals(mpc_decoder *d)
-{
- mpc_decoder_reset_bitstream_decode(d);
-
- d->DecodedFrames = 0;
- d->StreamVersion = 0;
- d->MS_used = 0;
-
- memset(d->Y_L , 0, sizeof d->Y_L );
- memset(d->Y_R , 0, sizeof d->Y_R );
- memset(d->SCF_Index_L , 0, sizeof d->SCF_Index_L );
- memset(d->SCF_Index_R , 0, sizeof d->SCF_Index_R );
- memset(d->Res_L , 0, sizeof d->Res_L );
- memset(d->Res_R , 0, sizeof d->Res_R );
- memset(d->SCFI_L , 0, sizeof d->SCFI_L );
- memset(d->SCFI_R , 0, sizeof d->SCFI_R );
- memset(d->DSCF_Flag_L , 0, sizeof d->DSCF_Flag_L );
- memset(d->DSCF_Flag_R , 0, sizeof d->DSCF_Flag_R );
- memset(d->DSCF_Reference_L, 0, sizeof d->DSCF_Reference_L );
- memset(d->DSCF_Reference_R, 0, sizeof d->DSCF_Reference_R );
- memset(d->Q , 0, sizeof d->Q );
- memset(d->MS_Flag , 0, sizeof d->MS_Flag );
-}
-
-static mpc_uint32_t
-mpc_decoder_decode_internal(mpc_decoder *d, MPC_SAMPLE_FORMAT *buffer)
-{
- mpc_uint32_t output_frame_length = MPC_FRAME_LENGTH;
-
- mpc_uint32_t FrameBitCnt = 0;
-
- if (d->DecodedFrames >= d->OverallFrames) {
- return (mpc_uint32_t)(-1); // end of file -> abort decoding
- }
-
- // read jump-info for validity check of frame
- d->FwdJumpInfo = mpc_decoder_bitstream_read(d, 20);
-
- d->ActDecodePos = (d->Zaehler << 5) + d->pos;
-
- // decode data and check for validity of frame
- FrameBitCnt = mpc_decoder_bits_read(d);
- switch (d->StreamVersion) {
- case 0x04:
- case 0x05:
- case 0x06:
- mpc_decoder_read_bitstream_sv6(d);
- break;
- case 0x07:
- case 0x17:
- mpc_decoder_read_bitstream_sv7(d);
- break;
- default:
- return (mpc_uint32_t)(-1);
- }
- d->FrameWasValid = mpc_decoder_bits_read(d) - FrameBitCnt == d->FwdJumpInfo;
-
- // synthesize signal
- mpc_decoder_requantisierung(d, d->Max_Band);
-
- //if ( d->EQ_activated && PluginSettings.EQbyMPC )
- // perform_EQ ();
-
- mpc_decoder_synthese_filter_float(d, buffer);
-
- d->DecodedFrames++;
-
- // cut off first MPC_DECODER_SYNTH_DELAY zero-samples
- if (d->DecodedFrames == d->OverallFrames && d->StreamVersion >= 6) {
- // reconstruct exact filelength
- mpc_int32_t mod_block = mpc_decoder_bitstream_read(d, 11);
- mpc_int32_t FilterDecay;
-
- if (mod_block == 0) {
- // Encoder bugfix
- mod_block = 1152;
- }
- FilterDecay = (mod_block + MPC_DECODER_SYNTH_DELAY) % MPC_FRAME_LENGTH;
-
- // additional FilterDecay samples are needed for decay of synthesis filter
- if (MPC_DECODER_SYNTH_DELAY + mod_block >= MPC_FRAME_LENGTH) {
-
- // **********************************************************************
- // Rhoades 4/16/2002
- // Commented out are blocks of code which cause gapless playback to fail.
- // Temporary fix...
- // **********************************************************************
-
- if (!d->TrueGaplessPresent) {
- mpc_decoder_reset_y(d);
- }
- else {
- //if ( MPC_FRAME_LENGTH != d->LastValidSamples ) {
- mpc_decoder_bitstream_read(d, 20);
- mpc_decoder_read_bitstream_sv7(d);
- mpc_decoder_requantisierung(d, d->Max_Band);
- //FilterDecay = d->LastValidSamples;
- //}
- //else {
- //FilterDecay = 0;
- //}
- }
-
- mpc_decoder_synthese_filter_float(d, buffer + 2304);
-
- output_frame_length = MPC_FRAME_LENGTH + FilterDecay;
- }
- else { // there are only FilterDecay samples needed for this frame
- output_frame_length = FilterDecay;
- }
- }
-
- if (d->samples_to_skip) {
- if (output_frame_length < d->samples_to_skip) {
- d->samples_to_skip -= output_frame_length;
- output_frame_length = 0;
- }
- else {
- output_frame_length -= d->samples_to_skip;
- memmove(
- buffer,
- buffer + d->samples_to_skip * 2,
- output_frame_length * 2 * sizeof (MPC_SAMPLE_FORMAT));
- d->samples_to_skip = 0;
- }
- }
-
- return output_frame_length;
-}
-
-mpc_uint32_t mpc_decoder_decode(
- mpc_decoder *d,
- MPC_SAMPLE_FORMAT *buffer,
- mpc_uint32_t *vbr_update_acc,
- mpc_uint32_t *vbr_update_bits)
-{
- for(;;)
- {
- //const mpc_int32_t MaxBrokenFrames = 0; // PluginSettings.MaxBrokenFrames
-
- mpc_uint32_t RING = d->Zaehler;
- mpc_int32_t vbr_ring = (RING << 5) + d->pos;
-
- mpc_uint32_t valid_samples = mpc_decoder_decode_internal(d, buffer);
-
- if (valid_samples == (mpc_uint32_t)(-1) ) {
- return 0;
- }
-
- /**************** ERROR CONCEALMENT *****************/
- if (d->FrameWasValid == 0 ) {
- // error occurred in bitstream
- return (mpc_uint32_t)(-1);
- }
- else {
- if (vbr_update_acc && vbr_update_bits) {
- (*vbr_update_acc) ++;
- vbr_ring = (d->Zaehler << 5) + d->pos - vbr_ring;
- if (vbr_ring < 0) {
- vbr_ring += 524288;
- }
- (*vbr_update_bits) += vbr_ring;
- }
-
- }
- mpc_decoder_update_buffer(d, RING);
-
- if (valid_samples > 0) {
- return valid_samples;
- }
- }
-}
-
-void
-mpc_decoder_requantisierung(mpc_decoder *d, const mpc_int32_t Last_Band)
-{
- mpc_int32_t Band;
- mpc_int32_t n;
- MPC_SAMPLE_FORMAT facL;
- MPC_SAMPLE_FORMAT facR;
- MPC_SAMPLE_FORMAT templ;
- MPC_SAMPLE_FORMAT tempr;
- MPC_SAMPLE_FORMAT* YL;
- MPC_SAMPLE_FORMAT* YR;
- mpc_int32_t* L;
- mpc_int32_t* R;
-
-#ifdef MPC_FIXED_POINT
-#if MPC_FIXED_POINT_FRACTPART == 14
-#define MPC_MULTIPLY_SCF(CcVal, SCF_idx) \
- MPC_MULTIPLY_EX(CcVal, d->SCF[SCF_idx], d->SCF_shift[SCF_idx])
-#else
-
-#error FIXME, Cc table is in 18.14 format
-
-#endif
-#else
-#define MPC_MULTIPLY_SCF(CcVal, SCF_idx) \
- MPC_MULTIPLY(CcVal, d->SCF[SCF_idx])
-#endif
- // requantization and scaling of subband-samples
- for ( Band = 0; Band <= Last_Band; Band++ ) { // setting pointers
- YL = d->Y_L[0] + Band;
- YR = d->Y_R[0] + Band;
- L = d->Q[Band].L;
- R = d->Q[Band].R;
- /************************** MS-coded **************************/
- if ( d->MS_Flag [Band] ) {
- if ( d->Res_L [Band] ) {
- if ( d->Res_R [Band] ) { // M!=0, S!=0
- facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][0]);
- facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][0]);
- for ( n = 0; n < 12; n++, YL += 32, YR += 32 ) {
- *YL = (templ = MPC_MULTIPLY_FLOAT_INT(facL,*L++))+(tempr = MPC_MULTIPLY_FLOAT_INT(facR,*R++));
- *YR = templ - tempr;
- }
- facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][1]);
- facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][1]);
- for ( ; n < 24; n++, YL += 32, YR += 32 ) {
- *YL = (templ = MPC_MULTIPLY_FLOAT_INT(facL,*L++))+(tempr = MPC_MULTIPLY_FLOAT_INT(facR,*R++));
- *YR = templ - tempr;
- }
- facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][2]);
- facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][2]);
- for ( ; n < 36; n++, YL += 32, YR += 32 ) {
- *YL = (templ = MPC_MULTIPLY_FLOAT_INT(facL,*L++))+(tempr = MPC_MULTIPLY_FLOAT_INT(facR,*R++));
- *YR = templ - tempr;
- }
- } else { // M!=0, S==0
- facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][0]);
- for ( n = 0; n < 12; n++, YL += 32, YR += 32 ) {
- *YR = *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
- }
- facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][1]);
- for ( ; n < 24; n++, YL += 32, YR += 32 ) {
- *YR = *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
- }
- facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][2]);
- for ( ; n < 36; n++, YL += 32, YR += 32 ) {
- *YR = *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
- }
- }
- } else {
- if (d->Res_R[Band]) // M==0, S!=0
- {
- facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][0]);
- for ( n = 0; n < 12; n++, YL += 32, YR += 32 ) {
- *YR = - (*YL = MPC_MULTIPLY_FLOAT_INT(facR,*(R++)));
- }
- facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][1]);
- for ( ; n < 24; n++, YL += 32, YR += 32 ) {
- *YR = - (*YL = MPC_MULTIPLY_FLOAT_INT(facR,*(R++)));
- }
- facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][2]);
- for ( ; n < 36; n++, YL += 32, YR += 32 ) {
- *YR = - (*YL = MPC_MULTIPLY_FLOAT_INT(facR,*(R++)));
- }
- } else { // M==0, S==0
- for ( n = 0; n < 36; n++, YL += 32, YR += 32 ) {
- *YR = *YL = 0;
- }
- }
- }
- }
- /************************** LR-coded **************************/
- else {
- if ( d->Res_L [Band] ) {
- if ( d->Res_R [Band] ) { // L!=0, R!=0
- facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][0]);
- facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][0]);
- for (n = 0; n < 12; n++, YL += 32, YR += 32 ) {
- *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
- *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++);
- }
- facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][1]);
- facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][1]);
- for (; n < 24; n++, YL += 32, YR += 32 ) {
- *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
- *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++);
- }
- facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][2]);
- facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][2]);
- for (; n < 36; n++, YL += 32, YR += 32 ) {
- *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
- *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++);
- }
- } else { // L!=0, R==0
- facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][0]);
- for ( n = 0; n < 12; n++, YL += 32, YR += 32 ) {
- *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
- *YR = 0;
- }
- facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][1]);
- for ( ; n < 24; n++, YL += 32, YR += 32 ) {
- *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
- *YR = 0;
- }
- facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][2]);
- for ( ; n < 36; n++, YL += 32, YR += 32 ) {
- *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
- *YR = 0;
- }
- }
- }
- else {
- if ( d->Res_R [Band] ) { // L==0, R!=0
- facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][0]);
- for ( n = 0; n < 12; n++, YL += 32, YR += 32 ) {
- *YL = 0;
- *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++);
- }
- facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][1]);
- for ( ; n < 24; n++, YL += 32, YR += 32 ) {
- *YL = 0;
- *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++);
- }
- facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][2]);
- for ( ; n < 36; n++, YL += 32, YR += 32 ) {
- *YL = 0;
- *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++);
- }
- } else { // L==0, R==0
- for ( n = 0; n < 36; n++, YL += 32, YR += 32 ) {
- *YR = *YL = 0;
- }
- }
- }
- }
- }
-}
-
-/****************************************** SV 6 ******************************************/
-void
-mpc_decoder_read_bitstream_sv6(mpc_decoder *d)
-{
- mpc_int32_t n,k;
- mpc_int32_t Max_used_Band=0;
- HuffmanTyp *Table;
- const HuffmanTyp *x1;
- const HuffmanTyp *x2;
- mpc_int32_t *L;
- mpc_int32_t *R;
- mpc_int32_t *ResL = d->Res_L;
- mpc_int32_t *ResR = d->Res_R;
-
- /************************ HEADER **************************/
- ResL = d->Res_L;
- ResR = d->Res_R;
- for (n=0; n <= d->Max_Band; ++n, ++ResL, ++ResR)
- {
- if (n<11) Table = d->Region_A;
- else if (n>=11 && n<=22) Table = d->Region_B;
- else /*if (n>=23)*/ Table = d->Region_C;
-
- *ResL = d->Q_res[n][mpc_decoder_huffman_decode(d, Table)];
- if (d->MS_used) {
- d->MS_Flag[n] = mpc_decoder_bitstream_read(d, 1);
- }
- *ResR = d->Q_res[n][mpc_decoder_huffman_decode(d, Table)];
-
- // only perform the following procedure up to the maximum non-zero subband
- if (*ResL || *ResR) Max_used_Band = n;
- }
-
- /************************* SCFI-Bundle *****************************/
- ResL = d->Res_L;
- ResR = d->Res_R;
- for (n=0; n<=Max_used_Band; ++n, ++ResL, ++ResR) {
- if (*ResL) mpc_decoder_scfi_bundle_read(d, d->SCFI_Bundle, &(d->SCFI_L[n]), &(d->DSCF_Flag_L[n]));
- if (*ResR) mpc_decoder_scfi_bundle_read(d, d->SCFI_Bundle, &(d->SCFI_R[n]), &(d->DSCF_Flag_R[n]));
- }
-
- /***************************** SCFI ********************************/
- ResL = d->Res_L;
- ResR = d->Res_R;
- L = d->SCF_Index_L[0];
- R = d->SCF_Index_R[0];
- for (n=0; n <= Max_used_Band; ++n, ++ResL, ++ResR, L+=3, R+=3)
- {
- if (*ResL)
- {
- /*********** DSCF ************/
- if (d->DSCF_Flag_L[n]==1)
- {
- L[2] = d->DSCF_Reference_L[n];
- switch (d->SCFI_L[n])
- {
- case 3:
- L[0] = L[2] + mpc_decoder_huffman_decode_fast(d, d->DSCF_Entropie);
- L[1] = L[0];
- L[2] = L[1];
- break;
- case 1:
- L[0] = L[2] + mpc_decoder_huffman_decode_fast(d, d->DSCF_Entropie);
- L[1] = L[0] + mpc_decoder_huffman_decode_fast(d, d->DSCF_Entropie);
- L[2] = L[1];
- break;
- case 2:
- L[0] = L[2] + mpc_decoder_huffman_decode_fast(d, d->DSCF_Entropie);
- L[1] = L[0];
- L[2] = L[1] + mpc_decoder_huffman_decode_fast(d, d->DSCF_Entropie);
- break;
- case 0:
- L[0] = L[2] + mpc_decoder_huffman_decode_fast(d, d->DSCF_Entropie);
- L[1] = L[0] + mpc_decoder_huffman_decode_fast(d, d->DSCF_Entropie);
- L[2] = L[1] + mpc_decoder_huffman_decode_fast(d, d->DSCF_Entropie);
- break;
- default:
- return;
- break;
- }
- }
- /************ SCF ************/
- else
- {
- switch (d->SCFI_L[n])
- {
- case 3:
- L[0] = mpc_decoder_bitstream_read(d, 6);
- L[1] = L[0];
- L[2] = L[1];
- break;
- case 1:
- L[0] = mpc_decoder_bitstream_read(d, 6);
- L[1] = mpc_decoder_bitstream_read(d, 6);
- L[2] = L[1];
- break;
- case 2:
- L[0] = mpc_decoder_bitstream_read(d, 6);
- L[1] = L[0];
- L[2] = mpc_decoder_bitstream_read(d, 6);
- break;
- case 0:
- L[0] = mpc_decoder_bitstream_read(d, 6);
- L[1] = mpc_decoder_bitstream_read(d, 6);
- L[2] = mpc_decoder_bitstream_read(d, 6);
- break;
- default:
- return;
- break;
- }
- }
- // update Reference for DSCF
- d->DSCF_Reference_L[n] = L[2];
- }
- if (*ResR)
- {
- R[2] = d->DSCF_Reference_R[n];
- /*********** DSCF ************/
- if (d->DSCF_Flag_R[n]==1)
- {
- switch (d->SCFI_R[n])
- {
- case 3:
- R[0] = R[2] + mpc_decoder_huffman_decode_fast(d, d->DSCF_Entropie);
- R[1] = R[0];
- R[2] = R[1];
- break;
- case 1:
- R[0] = R[2] + mpc_decoder_huffman_decode_fast(d, d->DSCF_Entropie);
- R[1] = R[0] + mpc_decoder_huffman_decode_fast(d, d->DSCF_Entropie);
- R[2] = R[1];
- break;
- case 2:
- R[0] = R[2] + mpc_decoder_huffman_decode_fast(d, d->DSCF_Entropie);
- R[1] = R[0];
- R[2] = R[1] + mpc_decoder_huffman_decode_fast(d, d->DSCF_Entropie);
- break;
- case 0:
- R[0] = R[2] + mpc_decoder_huffman_decode_fast(d, d->DSCF_Entropie);
- R[1] = R[0] + mpc_decoder_huffman_decode_fast(d, d->DSCF_Entropie);
- R[2] = R[1] + mpc_decoder_huffman_decode_fast(d, d->DSCF_Entropie);
- break;
- default:
- return;
- break;
- }
- }
- /************ SCF ************/
- else
- {
- switch (d->SCFI_R[n])
- {
- case 3:
- R[0] = mpc_decoder_bitstream_read(d, 6);
- R[1] = R[0];
- R[2] = R[1];
- break;
- case 1:
- R[0] = mpc_decoder_bitstream_read(d, 6);
- R[1] = mpc_decoder_bitstream_read(d, 6);
- R[2] = R[1];
- break;
- case 2:
- R[0] = mpc_decoder_bitstream_read(d, 6);
- R[1] = R[0];
- R[2] = mpc_decoder_bitstream_read(d, 6);
- break;
- case 0:
- R[0] = mpc_decoder_bitstream_read(d, 6);
- R[1] = mpc_decoder_bitstream_read(d, 6);
- R[2] = mpc_decoder_bitstream_read(d, 6);
- break;
- default:
- return;
- break;
- }
- }
- // update Reference for DSCF
- d->DSCF_Reference_R[n] = R[2];
- }
- }
-
- /**************************** Samples ****************************/
- ResL = d->Res_L;
- ResR = d->Res_R;
- for (n=0; n <= Max_used_Band; ++n, ++ResL, ++ResR)
- {
- // setting pointers
- x1 = d->SampleHuff[*ResL];
- x2 = d->SampleHuff[*ResR];
- L = d->Q[n].L;
- R = d->Q[n].R;
-
- if (x1!=NULL || x2!=NULL)
- for (k=0; k<36; ++k)
- {
- if (x1 != NULL) *L++ = mpc_decoder_huffman_decode_fast(d, x1);
- if (x2 != NULL) *R++ = mpc_decoder_huffman_decode_fast(d, x2);
- }
-
- if (*ResL>7 || *ResR>7)
- for (k=0; k<36; ++k)
- {
- if (*ResL>7) *L++ = (mpc_int32_t)mpc_decoder_bitstream_read(d, Res_bit[*ResL]) - Dc[*ResL];
- if (*ResR>7) *R++ = (mpc_int32_t)mpc_decoder_bitstream_read(d, Res_bit[*ResR]) - Dc[*ResR];
- }
- }
-}
-
-/****************************************** SV 7 ******************************************/
-void
-mpc_decoder_read_bitstream_sv7(mpc_decoder *d)
-{
- // these arrays hold decoding results for bundled quantizers (3- and 5-step)
- /*static*/ mpc_int32_t idx30[] = { -1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1};
- /*static*/ mpc_int32_t idx31[] = { -1,-1,-1, 0, 0, 0, 1, 1, 1,-1,-1,-1, 0, 0, 0, 1, 1, 1,-1,-1,-1, 0, 0, 0, 1, 1, 1};
- /*static*/ mpc_int32_t idx32[] = { -1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1};
- /*static*/ mpc_int32_t idx50[] = { -2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2};
- /*static*/ mpc_int32_t idx51[] = { -2,-2,-2,-2,-2,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2};
-
- mpc_int32_t n,k;
- mpc_int32_t Max_used_Band=0;
- const HuffmanTyp *Table;
- mpc_int32_t idx;
- mpc_int32_t *L ,*R;
- mpc_int32_t *ResL,*ResR;
- mpc_uint32_t tmp;
-
- /***************************** Header *****************************/
- ResL = d->Res_L;
- ResR = d->Res_R;
-
- // first subband
- *ResL = mpc_decoder_bitstream_read(d, 4);
- *ResR = mpc_decoder_bitstream_read(d, 4);
- if (d->MS_used && !(*ResL==0 && *ResR==0)) {
- d->MS_Flag[0] = mpc_decoder_bitstream_read(d, 1);
- }
-
- // consecutive subbands
- ++ResL; ++ResR; // increase pointers
- for (n=1; n <= d->Max_Band; ++n, ++ResL, ++ResR)
- {
- idx = mpc_decoder_huffman_decode_fast(d, d->HuffHdr);
- *ResL = (idx!=4) ? *(ResL-1) + idx : mpc_decoder_bitstream_read(d, 4);
-
- idx = mpc_decoder_huffman_decode_fast(d, d->HuffHdr);
- *ResR = (idx!=4) ? *(ResR-1) + idx : mpc_decoder_bitstream_read(d, 4);
-
- if (d->MS_used && !(*ResL==0 && *ResR==0)) {
- d->MS_Flag[n] = mpc_decoder_bitstream_read(d, 1);
- }
-
- // only perform following procedures up to the maximum non-zero subband
- if (*ResL!=0 || *ResR!=0) {
- Max_used_Band = n;
- }
- }
- /****************************** SCFI ******************************/
- L = d->SCFI_L;
- R = d->SCFI_R;
- ResL = d->Res_L;
- ResR = d->Res_R;
- for (n=0; n <= Max_used_Band; ++n, ++L, ++R, ++ResL, ++ResR) {
- if (*ResL) *L = mpc_decoder_huffman_decode_faster(d, d->HuffSCFI);
- if (*ResR) *R = mpc_decoder_huffman_decode_faster(d, d->HuffSCFI);
- }
-
- /**************************** SCF/DSCF ****************************/
- ResL = d->Res_L;
- ResR = d->Res_R;
- L = d->SCF_Index_L[0];
- R = d->SCF_Index_R[0];
- for (n=0; n<=Max_used_Band; ++n, ++ResL, ++ResR, L+=3, R+=3) {
- if (*ResL)
- {
- L[2] = d->DSCF_Reference_L[n];
- switch (d->SCFI_L[n])
- {
- case 1:
- idx = mpc_decoder_huffman_decode_fast(d, d->HuffDSCF);
- L[0] = (idx!=8) ? L[2] + idx : mpc_decoder_bitstream_read(d, 6);
- idx = mpc_decoder_huffman_decode_fast(d, d->HuffDSCF);
- L[1] = (idx!=8) ? L[0] + idx : mpc_decoder_bitstream_read(d, 6);
- L[2] = L[1];
- break;
- case 3:
- idx = mpc_decoder_huffman_decode_fast(d, d->HuffDSCF);
- L[0] = (idx!=8) ? L[2] + idx : mpc_decoder_bitstream_read(d, 6);
- L[1] = L[0];
- L[2] = L[1];
- break;
- case 2:
- idx = mpc_decoder_huffman_decode_fast(d, d->HuffDSCF);
- L[0] = (idx!=8) ? L[2] + idx : mpc_decoder_bitstream_read(d, 6);
- L[1] = L[0];
- idx = mpc_decoder_huffman_decode_fast(d, d->HuffDSCF);
- L[2] = (idx!=8) ? L[1] + idx : mpc_decoder_bitstream_read(d, 6);
- break;
- case 0:
- idx = mpc_decoder_huffman_decode_fast(d, d->HuffDSCF);
- L[0] = (idx!=8) ? L[2] + idx : mpc_decoder_bitstream_read(d, 6);
- idx = mpc_decoder_huffman_decode_fast(d, d->HuffDSCF);
- L[1] = (idx!=8) ? L[0] + idx : mpc_decoder_bitstream_read(d, 6);
- idx = mpc_decoder_huffman_decode_fast(d, d->HuffDSCF);
- L[2] = (idx!=8) ? L[1] + idx : mpc_decoder_bitstream_read(d, 6);
- break;
- default:
- return;
- break;
- }
- // update Reference for DSCF
- d->DSCF_Reference_L[n] = L[2];
- }
- if (*ResR)
- {
- R[2] = d->DSCF_Reference_R[n];
- switch (d->SCFI_R[n])
- {
- case 1:
- idx = mpc_decoder_huffman_decode_fast(d, d->HuffDSCF);
- R[0] = (idx!=8) ? R[2] + idx : mpc_decoder_bitstream_read(d, 6);
- idx = mpc_decoder_huffman_decode_fast(d, d->HuffDSCF);
- R[1] = (idx!=8) ? R[0] + idx : mpc_decoder_bitstream_read(d, 6);
- R[2] = R[1];
- break;
- case 3:
- idx = mpc_decoder_huffman_decode_fast(d, d->HuffDSCF);
- R[0] = (idx!=8) ? R[2] + idx : mpc_decoder_bitstream_read(d, 6);
- R[1] = R[0];
- R[2] = R[1];
- break;
- case 2:
- idx = mpc_decoder_huffman_decode_fast(d, d->HuffDSCF);
- R[0] = (idx!=8) ? R[2] + idx : mpc_decoder_bitstream_read(d, 6);
- R[1] = R[0];
- idx = mpc_decoder_huffman_decode_fast(d, d->HuffDSCF);
- R[2] = (idx!=8) ? R[1] + idx : mpc_decoder_bitstream_read(d, 6);
- break;
- case 0:
- idx = mpc_decoder_huffman_decode_fast(d, d->HuffDSCF);
- R[0] = (idx!=8) ? R[2] + idx : mpc_decoder_bitstream_read(d, 6);
- idx = mpc_decoder_huffman_decode_fast(d, d->HuffDSCF);
- R[1] = (idx!=8) ? R[0] + idx : mpc_decoder_bitstream_read(d, 6);
- idx = mpc_decoder_huffman_decode_fast(d, d->HuffDSCF);
- R[2] = (idx!=8) ? R[1] + idx : mpc_decoder_bitstream_read(d, 6);
- break;
- default:
- return;
- break;
- }
- // update Reference for DSCF
- d->DSCF_Reference_R[n] = R[2];
- }
- }
- /***************************** Samples ****************************/
- ResL = d->Res_L;
- ResR = d->Res_R;
- L = d->Q[0].L;
- R = d->Q[0].R;
- for (n=0; n <= Max_used_Band; ++n, ++ResL, ++ResR, L+=36, R+=36)
- {
- /************** links **************/
- switch (*ResL)
- {
- case -2: case -3: case -4: case -5: case -6: case -7: case -8: case -9:
- case -10: case -11: case -12: case -13: case -14: case -15: case -16: case -17:
- L += 36;
- break;
- case -1:
- for (k=0; k<36; k++ ) {
- tmp = random_int(d);
- *L++ = ((tmp >> 24) & 0xFF) + ((tmp >> 16) & 0xFF) + ((tmp >> 8) & 0xFF) + ((tmp >> 0) & 0xFF) - 510;
- }
- break;
- case 0:
- L += 36;// increase pointer
- break;
- case 1:
- Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][1];
- for (k=0; k<12; ++k)
- {
- idx = mpc_decoder_huffman_decode_fast(d, Table);
- *L++ = idx30[idx];
- *L++ = idx31[idx];
- *L++ = idx32[idx];
- }
- break;
- case 2:
- Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][2];
- for (k=0; k<18; ++k)
- {
- idx = mpc_decoder_huffman_decode_fast(d, Table);
- *L++ = idx50[idx];
- *L++ = idx51[idx];
- }
- break;
- case 3:
- case 4:
- Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResL];
- for (k=0; k<36; ++k)
- *L++ = mpc_decoder_huffman_decode_faster(d, Table);
- break;
- case 5:
- Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResL];
- for (k=0; k<36; ++k)
- *L++ = mpc_decoder_huffman_decode_fast(d, Table);
- break;
- case 6:
- case 7:
- Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResL];
- for (k=0; k<36; ++k)
- *L++ = mpc_decoder_huffman_decode(d, Table);
- break;
- case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15: case 16: case 17:
- tmp = Dc[*ResL];
- for (k=0; k<36; ++k)
- *L++ = (mpc_int32_t)mpc_decoder_bitstream_read(d, Res_bit[*ResL]) - tmp;
- break;
- default:
- return;
- }
- /************** rechts **************/
- switch (*ResR)
- {
- case -2: case -3: case -4: case -5: case -6: case -7: case -8: case -9:
- case -10: case -11: case -12: case -13: case -14: case -15: case -16: case -17:
- R += 36;
- break;
- case -1:
- for (k=0; k<36; k++ ) {
- tmp = random_int(d);
- *R++ = ((tmp >> 24) & 0xFF) + ((tmp >> 16) & 0xFF) + ((tmp >> 8) & 0xFF) + ((tmp >> 0) & 0xFF) - 510;
- }
- break;
- case 0:
- R += 36;// increase pointer
- break;
- case 1:
- Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][1];
- for (k=0; k<12; ++k)
- {
- idx = mpc_decoder_huffman_decode_fast(d, Table);
- *R++ = idx30[idx];
- *R++ = idx31[idx];
- *R++ = idx32[idx];
- }
- break;
- case 2:
- Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][2];
- for (k=0; k<18; ++k)
- {
- idx = mpc_decoder_huffman_decode_fast(d, Table);
- *R++ = idx50[idx];
- *R++ = idx51[idx];
- }
- break;
- case 3:
- case 4:
- Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResR];
- for (k=0; k<36; ++k)
- *R++ = mpc_decoder_huffman_decode_faster(d, Table);
- break;
- case 5:
- Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResR];
- for (k=0; k<36; ++k)
- *R++ = mpc_decoder_huffman_decode_fast(d, Table);
- break;
- case 6:
- case 7:
- Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResR];
- for (k=0; k<36; ++k)
- *R++ = mpc_decoder_huffman_decode(d, Table);
- break;
- case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15: case 16: case 17:
- tmp = Dc[*ResR];
- for (k=0; k<36; ++k)
- *R++ = (mpc_int32_t)mpc_decoder_bitstream_read(d, Res_bit[*ResR]) - tmp;
- break;
- default:
- return;
- }
- }
-}
-
-void mpc_decoder_setup(mpc_decoder *d, mpc_reader *r)
-{
- d->r = r;
-
- d->HuffQ[0][0] = 0;
- d->HuffQ[1][0] = 0;
- d->HuffQ[0][1] = d->HuffQ1[0];
- d->HuffQ[1][1] = d->HuffQ1[1];
- d->HuffQ[0][2] = d->HuffQ2[0];
- d->HuffQ[1][2] = d->HuffQ2[1];
- d->HuffQ[0][3] = d->HuffQ3[0];
- d->HuffQ[1][3] = d->HuffQ3[1];
- d->HuffQ[0][4] = d->HuffQ4[0];
- d->HuffQ[1][4] = d->HuffQ4[1];
- d->HuffQ[0][5] = d->HuffQ5[0];
- d->HuffQ[1][5] = d->HuffQ5[1];
- d->HuffQ[0][6] = d->HuffQ6[0];
- d->HuffQ[1][6] = d->HuffQ6[1];
- d->HuffQ[0][7] = d->HuffQ7[0];
- d->HuffQ[1][7] = d->HuffQ7[1];
-
- d->SampleHuff[0] = NULL;
- d->SampleHuff[1] = d->Entropie_1;
- d->SampleHuff[2] = d->Entropie_2;
- d->SampleHuff[3] = d->Entropie_3;
- d->SampleHuff[4] = d->Entropie_4;
- d->SampleHuff[5] = d->Entropie_5;
- d->SampleHuff[6] = d->Entropie_6;
- d->SampleHuff[7] = d->Entropie_7;
- d->SampleHuff[8] = NULL;
- d->SampleHuff[9] = NULL;
- d->SampleHuff[10] = NULL;
- d->SampleHuff[11] = NULL;
- d->SampleHuff[12] = NULL;
- d->SampleHuff[13] = NULL;
- d->SampleHuff[14] = NULL;
- d->SampleHuff[15] = NULL;
- d->SampleHuff[16] = NULL;
- d->SampleHuff[17] = NULL;
-
- d->EQ_activated = 0;
- d->MPCHeaderPos = 0;
- d->StreamVersion = 0;
- d->MS_used = 0;
- d->FwdJumpInfo = 0;
- d->ActDecodePos = 0;
- d->FrameWasValid = 0;
- d->OverallFrames = 0;
- d->DecodedFrames = 0;
- d->LastValidSamples = 0;
- d->TrueGaplessPresent = 0;
- d->WordsRead = 0;
- d->Max_Band = 0;
- d->SampleRate = 0;
-// clips = 0;
- d->__r1 = 1;
- d->__r2 = 1;
-
- d->dword = 0;
- d->pos = 0;
- d->Zaehler = 0;
- d->WordsRead = 0;
- d->Max_Band = 0;
-
- mpc_decoder_initialisiere_quantisierungstabellen(d, 1.0f);
- mpc_decoder_init_huffman_sv6(d);
- mpc_decoder_init_huffman_sv7(d);
-}
-
-static void mpc_decoder_set_streaminfo(mpc_decoder *d, mpc_streaminfo *si)
-{
- mpc_decoder_reset_synthesis(d);
- mpc_decoder_reset_globals(d);
-
- d->StreamVersion = si->stream_version;
- d->MS_used = si->ms;
- d->Max_Band = si->max_band;
- d->OverallFrames = si->frames;
- d->MPCHeaderPos = si->header_position;
- d->LastValidSamples = si->last_frame_samples;
- d->TrueGaplessPresent = si->is_true_gapless;
- d->SampleRate = (mpc_int32_t)si->sample_freq;
-
- d->samples_to_skip = MPC_DECODER_SYNTH_DELAY;
-}
-
-mpc_bool_t mpc_decoder_initialize(mpc_decoder *d, mpc_streaminfo *si)
-{
- mpc_decoder_set_streaminfo(d, si);
-
- // AB: setting position to the beginning of the data-bitstream
- switch (d->StreamVersion) {
- case 0x04: f_seek(d, 4 + d->MPCHeaderPos); d->pos = 16; break; // Geht auch über eine der Helperfunktionen
- case 0x05:
- case 0x06: f_seek(d, 8 + d->MPCHeaderPos); d->pos = 0; break;
- case 0x07:
- case 0x17: /*f_seek ( 24 + d->MPCHeaderPos );*/ d->pos = 8; break;
- default: return FALSE;
- }
-
- // AB: fill buffer and initialize decoder
- f_read_dword(d, d->Speicher, MEMSIZE );
- d->dword = d->Speicher[d->Zaehler = 0];
-
- return TRUE;
-}
-
-//---------------------------------------------------------------
-// will seek from the beginning of the file to the desired
-// position in ms (given by seek_needed)
-//---------------------------------------------------------------
-#if 0
-static void
-helper1(mpc_decoder *d, mpc_uint32_t bitpos)
-{
- f_seek(d, (bitpos >> 5) * 4 + d->MPCHeaderPos);
- f_read_dword(d, d->Speicher, 2);
- d->dword = d->Speicher[d->Zaehler = 0];
- d->pos = bitpos & 31;
-}
-#endif
-
-static void
-helper2(mpc_decoder *d, mpc_uint32_t bitpos)
-{
- f_seek(d, (bitpos>>5) * 4 + d->MPCHeaderPos);
- f_read_dword(d, d->Speicher, MEMSIZE);
- d->dword = d->Speicher[d->Zaehler = 0];
- d->pos = bitpos & 31;
-}
-
-#if 0
-static void
-helper3(mpc_decoder *d, mpc_uint32_t bitpos, mpc_uint32_t* buffoffs)
-{
- d->pos = bitpos & 31;
- bitpos >>= 5;
- if ((mpc_uint32_t)(bitpos - *buffoffs) >= MEMSIZE - 2) {
- *buffoffs = bitpos;
- f_seek(d, bitpos * 4L + d->MPCHeaderPos);
- f_read_dword(d, d->Speicher, MEMSIZE );
- }
- d->dword = d->Speicher[d->Zaehler = bitpos - *buffoffs ];
-}
-#endif
-
-static mpc_uint32_t get_initial_fpos(mpc_decoder *d, mpc_uint32_t StreamVersion)
-{
- mpc_uint32_t fpos = 0;
- switch ( d->StreamVersion ) { // setting position to the beginning of the data-bitstream
- case 0x04: fpos = 48; break;
- case 0x05:
- case 0x06: fpos = 64; break;
- case 0x07:
- case 0x17: fpos = 200; break;
- }
- return fpos;
-}
-
-mpc_bool_t mpc_decoder_seek_seconds(mpc_decoder *d, double seconds)
-{
- return mpc_decoder_seek_sample(d, (mpc_int64_t)(seconds * (double)d->SampleRate + 0.5));
-}
-
-mpc_bool_t mpc_decoder_seek_sample(mpc_decoder *d, mpc_int64_t destsample)
-{
- mpc_uint32_t fpos;
- mpc_uint32_t fwd;
-
- fwd = (mpc_uint32_t) (destsample / MPC_FRAME_LENGTH);
- d->samples_to_skip = MPC_DECODER_SYNTH_DELAY + (mpc_uint32_t)(destsample % MPC_FRAME_LENGTH);
-
- memset(d->Y_L , 0, sizeof d->Y_L );
- memset(d->Y_R , 0, sizeof d->Y_R );
- memset(d->SCF_Index_L , 0, sizeof d->SCF_Index_L );
- memset(d->SCF_Index_R , 0, sizeof d->SCF_Index_R );
- memset(d->Res_L , 0, sizeof d->Res_L );
- memset(d->Res_R , 0, sizeof d->Res_R );
- memset(d->SCFI_L , 0, sizeof d->SCFI_L );
- memset(d->SCFI_R , 0, sizeof d->SCFI_R );
- memset(d->DSCF_Flag_L , 0, sizeof d->DSCF_Flag_L );
- memset(d->DSCF_Flag_R , 0, sizeof d->DSCF_Flag_R );
- memset(d->DSCF_Reference_L, 0, sizeof d->DSCF_Reference_L );
- memset(d->DSCF_Reference_R, 0, sizeof d->DSCF_Reference_R );
- memset(d->Q , 0, sizeof d->Q );
- memset(d->MS_Flag , 0, sizeof d->MS_Flag );
-
- // resetting synthesis filter to avoid "clicks"
- mpc_decoder_reset_synthesis(d);
-
- // prevent from desired position out of allowed range
- fwd = fwd < d->OverallFrames ? fwd : d->OverallFrames;
-
- // reset number of decoded frames
- d->DecodedFrames = 0;
-
- fpos = get_initial_fpos(d, d->StreamVersion);
- if (fpos == 0) {
- return FALSE;
- }
-
- helper2(d, fpos);
-
- // read the last 32 frames before the desired position to scan the scalefactors (artifactless jumping)
- for ( ; d->DecodedFrames < fwd; d->DecodedFrames++ ) {
- mpc_uint32_t FrameBitCnt;
- mpc_uint32_t RING;
- RING = d->Zaehler;
- d->FwdJumpInfo = mpc_decoder_bitstream_read(d, 20); // read jump-info
- d->ActDecodePos = (d->Zaehler << 5) + d->pos;
- FrameBitCnt = mpc_decoder_bits_read(d); // scanning the scalefactors and check for validity of frame
- if (d->StreamVersion >= 7) {
- mpc_decoder_read_bitstream_sv7(d);
- }
- else {
- mpc_decoder_read_bitstream_sv6(d);
- }
- if (mpc_decoder_bits_read(d) - FrameBitCnt != d->FwdJumpInfo ) {
- // Box ("Bug in perform_jump");
- return FALSE;
- }
- // update buffer
- if ((RING ^ d->Zaehler) & MEMSIZE2) {
- f_read_dword(d, d->Speicher + (RING & MEMSIZE2), MEMSIZE2);
- }
- }
-
- // LastBitsRead = BitsRead ();
- // LastFrame = d->DecodedFrames;
-
- return TRUE;
-}
-
-void mpc_decoder_update_buffer(mpc_decoder *d, mpc_uint32_t RING)
-{
- if ((RING ^ d->Zaehler) & MEMSIZE2 ) {
- // update buffer
- f_read_dword(d, d->Speicher + (RING & MEMSIZE2), MEMSIZE2);
- }
-}
-
-
diff --git a/src/libmusepack/mpc_reader.c b/src/libmusepack/mpc_reader.c
deleted file mode 100644
index 5ed913698..000000000
--- a/src/libmusepack/mpc_reader.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- Copyright (c) 2004, The Musepack Development Team
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are
- met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials provided
- with the distribution.
-
- * Neither the name of the The Musepack Development Team nor the
- names of its contributors may be used to endorse or promote
- products derived from this software without specific prior
- written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/// \file mpc_reader.c
-/// Contains implementations for simple file-based mpc_reader
-
-#include "musepack/musepack.h"
-
-/// mpc_reader callback implementations
-static mpc_int32_t
-read_impl(void *data, void *ptr, mpc_int32_t size)
-{
- mpc_reader *d = (mpc_reader *) data;
-
- return fread(ptr, 1, size, d->file);
-}
-
-static mpc_bool_t
-seek_impl(void *data, int offset)
-{
- mpc_reader *d = (mpc_reader *) data;
-
- return d->is_seekable ? !fseek(d->file, offset, SEEK_SET) : FALSE;
-}
-
-static mpc_int32_t
-tell_impl(void *data)
-{
- mpc_reader *d = (mpc_reader *) data;
-
- return ftell(d->file);
-}
-
-static mpc_int32_t
-get_size_impl(void *data)
-{
- mpc_reader *d = (mpc_reader *) data;
-
- return d->file_size;
-}
-
-static mpc_bool_t
-canseek_impl(void *data)
-{
- mpc_reader *d = (mpc_reader *) data;
-
- return d->is_seekable;
-}
-
-void
-mpc_reader_setup_file_reader(mpc_reader *reader, FILE *input)
-{
- reader->seek = seek_impl;
- reader->read = read_impl;
- reader->tell = tell_impl;
- reader->get_size = get_size_impl;
- reader->canseek = canseek_impl;
- reader->data = reader; // point back to ourselves
-
- reader->file = input;
- reader->is_seekable = TRUE;
- fseek(reader->file, 0, SEEK_END);
- reader->file_size = ftell(reader->file);
- fseek(reader->file, 0, SEEK_SET);
-}
diff --git a/src/libmusepack/musepack/Makefile.am b/src/libmusepack/musepack/Makefile.am
deleted file mode 100644
index 1d37e1d79..000000000
--- a/src/libmusepack/musepack/Makefile.am
+++ /dev/null
@@ -1,5 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-noinst_HEADERS = config_types.h decoder.h huffman.h internal.h math.h \
- musepack.h reader.h requant.h streaminfo.h
-
diff --git a/src/libmusepack/musepack/config_types.h b/src/libmusepack/musepack/config_types.h
deleted file mode 100644
index f501f5a38..000000000
--- a/src/libmusepack/musepack/config_types.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#ifndef __CONFIG_TYPES_H__
-#define __CONFIG_TYPES_H__
-
-#include "os_types.h"
-
-#ifdef WORDS_BIGENDIAN
- #undef MPC_LITTLE_ENDIAN
-#else
- #define MPC_LITTLE_ENDIAN
-#endif
-
-typedef unsigned char mpc_bool_t;
-#define TRUE 1
-#define FALSE 0
-
-/* these are filled in by configure */
-typedef int16_t mpc_int16_t;
-typedef uint16_t mpc_uint16_t;
-typedef int32_t mpc_int32_t;
-typedef uint32_t mpc_uint32_t;
-typedef int64_t mpc_int64_t;
-
-#endif
diff --git a/src/libmusepack/musepack/decoder.h b/src/libmusepack/musepack/decoder.h
deleted file mode 100644
index 08c316390..000000000
--- a/src/libmusepack/musepack/decoder.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/// \file decoder.h
-
-#ifndef _musepack_decoder_h_
-#define _musepack_decoder_h_
-
-#include "musepack/huffman.h"
-#include "musepack/math.h"
-#include "musepack/musepack.h"
-#include "musepack/reader.h"
-#include "musepack/streaminfo.h"
-
-enum {
- MPC_V_MEM = 2304,
- MPC_DECODER_MEMSIZE = 16384, // overall buffer size
-};
-
-typedef struct {
- mpc_int32_t L [36];
- mpc_int32_t R [36];
-} QuantTyp;
-
-typedef struct mpc_decoder_t {
- mpc_reader *r;
-
- /// @name internal state variables
- //@{
-
- mpc_uint32_t dword; /// actually decoded 32bit-word
- mpc_uint32_t pos; /// bit-position within dword
- mpc_uint32_t Speicher[MPC_DECODER_MEMSIZE]; /// read-buffer
- mpc_uint32_t Zaehler; /// actual index within read-buffer
-
- mpc_uint32_t samples_to_skip;
-
- mpc_uint32_t FwdJumpInfo;
- mpc_uint32_t ActDecodePos;
- mpc_uint32_t FrameWasValid;
-
- mpc_uint32_t DecodedFrames;
- mpc_uint32_t OverallFrames;
- mpc_int32_t SampleRate; // Sample frequency
-
- mpc_uint32_t StreamVersion; // version of bitstream
- mpc_uint32_t MS_used; // MS-coding used ?
- mpc_int32_t Max_Band;
- mpc_uint32_t MPCHeaderPos; // AB: needed to support ID3v2
- mpc_uint32_t LastValidSamples;
- mpc_uint32_t TrueGaplessPresent;
-
- mpc_uint32_t EQ_activated;
-
- mpc_uint32_t WordsRead; // counts amount of decoded dwords
-
- // randomizer state variables
- mpc_uint32_t __r1;
- mpc_uint32_t __r2;
-
- mpc_uint32_t Q_bit [32];
- mpc_uint32_t Q_res [32][16];
-
- // huffman table stuff
- HuffmanTyp HuffHdr [10];
- HuffmanTyp HuffSCFI [ 4];
- HuffmanTyp HuffDSCF [16];
- HuffmanTyp* HuffQ [2] [8];
-
- HuffmanTyp HuffQ1 [2] [3*3*3];
- HuffmanTyp HuffQ2 [2] [5*5];
- HuffmanTyp HuffQ3 [2] [ 7];
- HuffmanTyp HuffQ4 [2] [ 9];
- HuffmanTyp HuffQ5 [2] [15];
- HuffmanTyp HuffQ6 [2] [31];
- HuffmanTyp HuffQ7 [2] [63];
- const HuffmanTyp* SampleHuff [18];
- HuffmanTyp SCFI_Bundle [ 8];
- HuffmanTyp DSCF_Entropie [13];
- HuffmanTyp Region_A [16];
- HuffmanTyp Region_B [ 8];
- HuffmanTyp Region_C [ 4];
-
- HuffmanTyp Entropie_1 [ 3];
- HuffmanTyp Entropie_2 [ 5];
- HuffmanTyp Entropie_3 [ 7];
- HuffmanTyp Entropie_4 [ 9];
- HuffmanTyp Entropie_5 [15];
- HuffmanTyp Entropie_6 [31];
- HuffmanTyp Entropie_7 [63];
-
- mpc_int32_t SCF_Index_L [32] [3];
- mpc_int32_t SCF_Index_R [32] [3]; // holds scalefactor-indices
- QuantTyp Q [32]; // holds quantized samples
- mpc_int32_t Res_L [32];
- mpc_int32_t Res_R [32]; // holds the chosen quantizer for each subband
- mpc_int32_t DSCF_Flag_L [32];
- mpc_int32_t DSCF_Flag_R [32]; // differential SCF used?
- mpc_int32_t SCFI_L [32];
- mpc_int32_t SCFI_R [32]; // describes order of transmitted SCF
- mpc_int32_t DSCF_Reference_L [32];
- mpc_int32_t DSCF_Reference_R [32]; // holds last frames SCF
- mpc_int32_t MS_Flag[32]; // MS used?
-#ifdef MPC_FIXED_POINT
- unsigned char SCF_shift[256];
-#endif
-
- MPC_SAMPLE_FORMAT V_L[MPC_V_MEM + 960];
- MPC_SAMPLE_FORMAT V_R[MPC_V_MEM + 960];
- MPC_SAMPLE_FORMAT Y_L[36][32];
- MPC_SAMPLE_FORMAT Y_R[36][32];
- MPC_SAMPLE_FORMAT SCF[256]; ///< holds adapted scalefactors (for clipping prevention)
- //@}
-
-} mpc_decoder;
-
-#endif // _mpc_decoder_h
diff --git a/src/libmusepack/musepack/huffman.h b/src/libmusepack/musepack/huffman.h
deleted file mode 100644
index 7f587771f..000000000
--- a/src/libmusepack/musepack/huffman.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/// \file huffman.h
-/// Data structures and functions for huffman coding.
-
-#ifndef _musepack_huffman_h_
-#define _musepack_huffman_h_
-
-#include "musepack/config_types.h"
-#include "musepack/decoder.h"
-
-struct mpc_decoder_t; // forward declare to break circular dependencies
-
-/// Huffman table entry.
-typedef struct huffman_type_t {
- mpc_uint32_t Code;
- mpc_uint32_t Length;
- mpc_int32_t Value;
-} HuffmanTyp;
-
-//! \brief Sorts huffman-tables by codeword.
-//!
-//! offset resulting value.
-//! \param elements
-//! \param Table table to sort
-//! \param offset offset of resulting sort
-void
-mpc_decoder_resort_huff_tables(
- const mpc_uint32_t elements, HuffmanTyp *Table, const mpc_int32_t offset);
-
-/// Initializes sv6 huffman decoding structures.
-void mpc_decoder_init_huffman_sv6(struct mpc_decoder_t *d);
-
-/// Initializes sv6 huffman decoding tables.
-void mpc_decoder_init_huffman_sv6_tables(struct mpc_decoder_t *d);
-
-/// Initializes sv7 huffman decoding structures.
-void mpc_decoder_init_huffman_sv7(struct mpc_decoder_t *d);
-
-/// Initializes sv7 huffman decoding tables.
-void mpc_decoder_init_huffman_sv7_tables(struct mpc_decoder_t *d);
-
-#endif // _musepack_huffman_h_
diff --git a/src/libmusepack/musepack/internal.h b/src/libmusepack/musepack/internal.h
deleted file mode 100644
index f86b45bb3..000000000
--- a/src/libmusepack/musepack/internal.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/// \file musepack_internal.h
-/// Definitions and structures used only internally by the libmusepack.
-
-#ifndef _musepack_internal_h
-#define _musepack_internal_h
-
-enum {
- MPC_DECODER_SYNTH_DELAY = 481
-};
-
-#ifndef swap32
-/// Big/little endian 32 bit byte swapping routine.
-static inline
-mpc_uint32_t swap32(mpc_uint32_t val) {
- const unsigned char* src = (const unsigned char*)&val;
- return
- (mpc_uint32_t)src[0] |
- ((mpc_uint32_t)src[1] << 8) | ((mpc_uint32_t)src[2] << 16) | ((mpc_uint32_t)src[3] << 24);
-}
-#endif
-
-/// Searches for a ID3v2-tag and reads the length (in bytes) of it.
-/// \param reader supplying raw stream data
-/// \return size of tag, in bytes
-/// \return -1 on errors of any kind
-mpc_int32_t JumpID3v2(mpc_reader* fp);
-
-/// helper functions used by multiple files
-mpc_uint32_t random_int(mpc_decoder *d); // in synth_filter.c
-void mpc_decoder_initialisiere_quantisierungstabellen(mpc_decoder *d, double scale_factor);
-void mpc_decoder_synthese_filter_float(mpc_decoder *d, MPC_SAMPLE_FORMAT* OutData);
-
-#endif // _musepack_internal_h
-
diff --git a/src/libmusepack/musepack/math.h b/src/libmusepack/musepack/math.h
deleted file mode 100644
index f3d52c504..000000000
--- a/src/libmusepack/musepack/math.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/// \file mpc_math.h
-/// Libmusepack internal math routines.
-
-#ifndef _musepack_math_h_
-#define _musepack_math_h_
-
-//#define MPC_FIXED_POINT
-
-#define MPC_FIXED_POINT_SHIFT 16
-
-#ifdef MPC_FIXED_POINT
-
-
-#ifdef _WIN32_WCE
-
-#include <cmnintrin.h>
-
-#define MPC_HAVE_MULHIGH
-
-#endif
-
-
-#define MPC_FIXED_POINT_SCALE_SHIFT (MPC_FIXED_POINT_SHIFT + MPC_FIXED_POINT_FRACTPART)
-#define MPC_FIXED_POINT_SCALE (1 << (MPC_FIXED_POINT_SCALE_SHIFT - 1))
-
-
-//in fixedpoint mode, results in decode output buffer are in -MPC_FIXED_POINT_SCALE ... MPC_FIXED_POINT_SCALE range
-
-#define MPC_FIXED_POINT_FRACTPART 14
-typedef mpc_int32_t MPC_SAMPLE_FORMAT;
-
-typedef mpc_int64_t MPC_SAMPLE_FORMAT_MULTIPLY;
-
-#define MAKE_MPC_SAMPLE(X) (MPC_SAMPLE_FORMAT)((double)(X) * (double)(((mpc_int64_t)1)<<MPC_FIXED_POINT_FRACTPART))
-#define MAKE_MPC_SAMPLE_EX(X,Y) (MPC_SAMPLE_FORMAT)((double)(X) * (double)(((mpc_int64_t)1)<<(Y)))
-
-#define MPC_MULTIPLY_NOTRUNCATE(X,Y) \
- (((MPC_SAMPLE_FORMAT_MULTIPLY)(X) * (MPC_SAMPLE_FORMAT_MULTIPLY)(Y)) >> MPC_FIXED_POINT_FRACTPART)
-
-#define MPC_MULTIPLY_EX_NOTRUNCATE(X,Y,Z) \
- (((MPC_SAMPLE_FORMAT_MULTIPLY)(X) * (MPC_SAMPLE_FORMAT_MULTIPLY)(Y)) >> (Z))
-
-#ifdef _DEBUG
-static inline MPC_SAMPLE_FORMAT MPC_MULTIPLY(MPC_SAMPLE_FORMAT item1,MPC_SAMPLE_FORMAT item2)
-{
- MPC_SAMPLE_FORMAT_MULTIPLY temp = MPC_MULTIPLY_NOTRUNCATE(item1,item2);
- assert(temp == (MPC_SAMPLE_FORMAT_MULTIPLY)(MPC_SAMPLE_FORMAT)temp);
- return (MPC_SAMPLE_FORMAT)temp;
-}
-
-static inline MPC_SAMPLE_FORMAT MPC_MULTIPLY_EX(MPC_SAMPLE_FORMAT item1,MPC_SAMPLE_FORMAT item2,unsigned shift)
-{
- MPC_SAMPLE_FORMAT_MULTIPLY temp = MPC_MULTIPLY_EX_NOTRUNCATE(item1,item2,shift);
- assert(temp == (MPC_SAMPLE_FORMAT_MULTIPLY)(MPC_SAMPLE_FORMAT)temp);
- return (MPC_SAMPLE_FORMAT)temp;
-}
-
-#else
-
-#define MPC_MULTIPLY(X,Y) ((MPC_SAMPLE_FORMAT)MPC_MULTIPLY_NOTRUNCATE(X,Y))
-#define MPC_MULTIPLY_EX(X,Y,Z) ((MPC_SAMPLE_FORMAT)MPC_MULTIPLY_EX_NOTRUNCATE(X,Y,Z))
-
-#endif
-
-#ifdef MPC_HAVE_MULHIGH
-#define MPC_MULTIPLY_FRACT(X,Y) _MulHigh(X,Y)
-#else
-#define MPC_MULTIPLY_FRACT(X,Y) MPC_MULTIPLY_EX(X,Y,32)
-#endif
-
-#define MPC_MAKE_FRACT_CONST(X) (MPC_SAMPLE_FORMAT)((X) * (double)(((mpc_int64_t)1)<<32) )
-#define MPC_MULTIPLY_FRACT_CONST(X,Y) MPC_MULTIPLY_FRACT(X,MPC_MAKE_FRACT_CONST(Y))
-#define MPC_MULTIPLY_FRACT_CONST_FIX(X,Y,Z) ( MPC_MULTIPLY_FRACT(X,MPC_MAKE_FRACT_CONST( Y / (1<<(Z)) )) << (Z) )
-#define MPC_MULTIPLY_FRACT_CONST_SHR(X,Y,Z) MPC_MULTIPLY_FRACT(X,MPC_MAKE_FRACT_CONST( Y / (1<<(Z)) ))
-
-#define MPC_MULTIPLY_FLOAT_INT(X,Y) ((X)*(Y))
-#define MPC_SCALE_CONST(X,Y,Z) MPC_MULTIPLY_EX(X,MAKE_MPC_SAMPLE_EX(Y,Z),(Z))
-#define MPC_SCALE_CONST_SHL(X,Y,Z,S) MPC_MULTIPLY_EX(X,MAKE_MPC_SAMPLE_EX(Y,Z),(Z)-(S))
-#define MPC_SCALE_CONST_SHR(X,Y,Z,S) MPC_MULTIPLY_EX(X,MAKE_MPC_SAMPLE_EX(Y,Z),(Z)+(S))
-#define MPC_SHR(X,Y) ((X)>>(Y))
-#define MPC_SHL(X,Y) ((X)<<(Y))
-
-#else
-
-//in floating-point mode, decoded samples are in -1...1 range
-
-typedef float MPC_SAMPLE_FORMAT;
-
-#define MAKE_MPC_SAMPLE(X) ((MPC_SAMPLE_FORMAT)(X))
-#define MAKE_MPC_SAMPLE_EX(X,Y) ((MPC_SAMPLE_FORMAT)(X))
-
-#define MPC_MULTIPLY_FRACT(X,Y) ((X)*(Y))
-#define MPC_MAKE_FRACT_CONST(X) (X)
-#define MPC_MULTIPLY_FRACT_CONST(X,Y) MPC_MULTPLY_FRACT(X,MPC_MAKE_FRACT_CONST(Y))
-#define MPC_MULTIPLY_FRACT_CONST_SHR(X,Y,Z) MPC_MULTIPLY_FRACT(X,MPC_MAKE_FRACT_CONST( Y ))
-#define MPC_MULTIPLY_FRACT_CONST_FIX(X,Y,Z) MPC_MULTIPLY_FRACT(X,MPC_MAKE_FRACT_CONST( Y ))
-
-#define MPC_MULTIPLY_FLOAT_INT(X,Y) ((X)*(Y))
-#define MPC_MULTIPLY(X,Y) ((X)*(Y))
-#define MPC_MULTIPLY_EX(X,Y,Z) ((X)*(Y))
-#define MPC_SCALE_CONST(X,Y,Z) ((X)*(Y))
-#define MPC_SCALE_CONST_SHL(X,Y,Z,S) ((X)*(Y))
-#define MPC_SCALE_CONST_SHR(X,Y,Z,S) ((X)*(Y))
-#define MPC_SHR(X,Y) (X)
-#define MPC_SHL(X,Y) (X)
-
-#endif
-
-#endif // _musepack_math_h_
-
diff --git a/src/libmusepack/musepack/musepack.h b/src/libmusepack/musepack/musepack.h
deleted file mode 100644
index dfbf0a36d..000000000
--- a/src/libmusepack/musepack/musepack.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/// \file musepack.h
-/// Top level include file for libmusepack.
-
-#ifndef _musepack_h_
-#define _musepack_h_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-#include "musepack/config_types.h"
-#include "musepack/decoder.h"
-#include "musepack/math.h"
-#include "musepack/reader.h"
-#include "musepack/streaminfo.h"
-
-enum {
- MPC_FRAME_LENGTH = (36 * 32), /// samples per mpc frame
- MPC_DECODER_BUFFER_LENGTH = 4 * MPC_FRAME_LENGTH /// required buffer size for decoder
-};
-
-// error codes
-#define ERROR_CODE_OK 0
-#define ERROR_CODE_FILE -1
-#define ERROR_CODE_SV7BETA 1
-#define ERROR_CODE_CBR 2
-#define ERROR_CODE_IS 3
-#define ERROR_CODE_BLOCKSIZE 4
-#define ERROR_CODE_INVALIDSV 5
-
-/// Initializes a streaminfo structure.
-/// \param si streaminfo structure to initialize
-void mpc_streaminfo_init(mpc_streaminfo *si);
-
-/// Reads streaminfo header from the mpc stream supplied by r.
-/// \param si streaminfo pointer to which info will be written
-/// \param r stream reader to supply raw data
-/// \return error code
-mpc_int32_t mpc_streaminfo_read(mpc_streaminfo *si, mpc_reader *r);
-
-/// Gets length of stream si, in seconds.
-/// \return length of stream in seconds
-double mpc_streaminfo_get_length(mpc_streaminfo *si);
-
-/// Returns length of stream si, in samples.
-/// \return length of stream in samples
-mpc_int64_t mpc_streaminfo_get_length_samples(mpc_streaminfo *si);
-
-/// Sets up decoder library.
-/// Call this first when preparing to decode an mpc stream.
-/// \param r reader that will supply raw data to the decoder
-void mpc_decoder_setup(mpc_decoder *d, mpc_reader *r);
-
-/// Initializes mpc decoder with the supplied stream info parameters.
-/// Call this next after calling mpc_decoder_setup.
-/// \param si streaminfo structure indicating format of source stream
-/// \return TRUE if decoder was initalized successfully, FALSE otherwise
-mpc_bool_t mpc_decoder_initialize(mpc_decoder *d, mpc_streaminfo *si);
-
-/// Sets decoder sample scaling factor. All decoded samples will be multiplied
-/// by this factor.
-/// \param scale_factor multiplicative scaling factor
-void mpc_decoder_scale_output(mpc_decoder *d, double scale_factor);
-
-/// Actually reads data from previously initialized stream. Call
-/// this iteratively to decode the mpc stream.
-/// \param buffer destination buffer for decoded samples
-/// \param vbr_update_acc \todo document me
-/// \param vbr_update_bits \todo document me
-/// \return -1 if an error is encountered
-/// \return 0 if the stream has been completely decoded successfully and there are no more samples
-/// \return > 0 to indicate the number of bytes that were actually read from the stream.
-mpc_uint32_t mpc_decoder_decode(
- mpc_decoder *d,
- MPC_SAMPLE_FORMAT *buffer,
- mpc_uint32_t *vbr_update_acc,
- mpc_uint32_t *vbr_update_bits);
-
-/// Seeks to the specified sample in the source stream.
-mpc_bool_t mpc_decoder_seek_sample(mpc_decoder *d, mpc_int64_t destsample);
-
-/// Seeks to specified position in seconds in the source stream.
-mpc_bool_t mpc_decoder_seek_seconds(mpc_decoder *d, double seconds);
-
-#ifdef __cplusplus
-}
-#endif // __cplusplus
-
-#endif // _musepack_h_
diff --git a/src/libmusepack/musepack/reader.h b/src/libmusepack/musepack/reader.h
deleted file mode 100644
index 2f29f97e4..000000000
--- a/src/libmusepack/musepack/reader.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/// \file reader.h
-
-#ifndef _musepack_reader_h_
-#define _musepack_reader_h_
-
-/// \brief Stream reader interface structure.
-///
-/// This is the structure you must supply to the musepack decoding library
-/// to feed it with raw data. Implement the five member functions to provide
-/// a functional reader.
-typedef struct mpc_reader_t {
- /// Reads size bytes of data into buffer at ptr.
- mpc_int32_t (*read)(void *t, void *ptr, mpc_int32_t size);
-
- /// Seeks to byte position offset.
- mpc_bool_t (*seek)(void *t, mpc_int32_t offset);
-
- /// Returns the current byte offset in the stream.
- mpc_int32_t (*tell)(void *t);
-
- /// Returns the total length of the source stream, in bytes.
- mpc_int32_t (*get_size)(void *t);
-
- /// True if the stream is a seekable stream.
- mpc_bool_t (*canseek)(void *t);
-
- /// Optional field that can be used to identify a particular instance of
- /// reader or carry along data associated with that reader.
- void *data;
-
- // These are used by provided internal standard file-based reader implementation.
- // You shouldn't touch them. They're included in the main struct to avoid
- // malloc/free.
- FILE *file;
- long file_size;
- mpc_bool_t is_seekable;
-} mpc_reader;
-
-/// Initializes reader with default stdio file reader implementation. Use
-/// this if you're just reading from a plain file.
-///
-/// \param r reader struct to initalize
-/// \param input input stream to attach to the reader
-void mpc_reader_setup_file_reader(mpc_reader *r, FILE *input);
-
-#endif // _musepack_reader_h_
diff --git a/src/libmusepack/musepack/requant.h b/src/libmusepack/musepack/requant.h
deleted file mode 100644
index dc9a5c32f..000000000
--- a/src/libmusepack/musepack/requant.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/// \file requant.h
-/// Requantization function definitions.
-
-#ifndef _musepack_requant_h
-#define _musepack_requant_h_
-
-#include "musepack/musepack.h"
-
-/* C O N S T A N T S */
-extern const mpc_uint32_t Res_bit [18]; // bits per sample for chosen quantizer
-extern const MPC_SAMPLE_FORMAT __Cc [1 + 18]; // coefficients for requantization
-extern const mpc_int32_t __Dc [1 + 18]; // offset for requantization
-
-#define Cc (__Cc + 1)
-#define Dc (__Dc + 1)
-
-#endif // _musepack_requant_h_
diff --git a/src/libmusepack/musepack/streaminfo.h b/src/libmusepack/musepack/streaminfo.h
deleted file mode 100644
index dc8e77c22..000000000
--- a/src/libmusepack/musepack/streaminfo.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/// \file streaminfo.h
-
-#ifndef _musepack_streaminfo_h_
-#define _musepack_streaminfo_h_
-
-typedef mpc_int32_t mpc_streaminfo_off_t;
-
-/// \brief mpc stream properties structure
-///
-/// Structure containing all the properties of an mpc stream. Populated
-/// by the streaminfo_read function.
-typedef struct mpc_streaminfo {
- /// @name core mpc stream properties
- //@{
- mpc_uint32_t sample_freq; ///< sample frequency of stream
- mpc_uint32_t channels; ///< number of channels in stream
- mpc_streaminfo_off_t header_position; ///< byte offset of position of header in stream
- mpc_uint32_t stream_version; ///< streamversion of stream
- mpc_uint32_t bitrate; ///< bitrate of stream file (in bps)
- double average_bitrate; ///< average bitrate of stream (in bits/sec)
- mpc_uint32_t frames; ///< number of frames in stream
- mpc_int64_t pcm_samples;
- mpc_uint32_t max_band; ///< maximum band-index used in stream (0...31)
- mpc_uint32_t is; ///< intensity stereo (0: off, 1: on)
- mpc_uint32_t ms; ///< mid/side stereo (0: off, 1: on)
- mpc_uint32_t block_size; ///< only needed for SV4...SV6 -> not supported
- mpc_uint32_t profile; ///< quality profile of stream
- const char* profile_name; ///< name of profile used by stream
- //@}
-
- /// @name replaygain related fields
- //@{
- mpc_int16_t gain_title; ///< replaygain title value
- mpc_int16_t gain_album; ///< replaygain album value
- mpc_uint16_t peak_album; ///< peak album loudness level
- mpc_uint16_t peak_title; ///< peak title loudness level
- //@}
-
- /// @name true gapless support data
- //@{
- mpc_uint32_t is_true_gapless; ///< true gapless? (0: no, 1: yes)
- mpc_uint32_t last_frame_samples; ///< number of valid samples within last frame
-
- mpc_uint32_t encoder_version; ///< version of encoder used
- char encoder[256]; ///< encoder name
-
- mpc_streaminfo_off_t tag_offset; ///< offset to file tags
- mpc_streaminfo_off_t total_file_length; ///< total length of underlying file
- //@}
-} mpc_streaminfo;
-
-#endif // _musepack_streaminfo_h_
diff --git a/src/libmusepack/requant.c b/src/libmusepack/requant.c
deleted file mode 100644
index d318d0bd0..000000000
--- a/src/libmusepack/requant.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- Copyright (c) 2004, The Musepack Development Team
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are
- met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials provided
- with the distribution.
-
- * Neither the name of the The Musepack Development Team nor the
- names of its contributors may be used to endorse or promote
- products derived from this software without specific prior
- written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/// \file requant.c
-/// Requantization function implementations.
-/// \todo document me
-
-#include "musepack/musepack.h"
-#include "musepack/internal.h"
-
-/* C O N S T A N T S */
-// bits per sample for chosen quantizer
-const mpc_uint32_t Res_bit [18] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
-};
-
-// coefficients for requantization
-// 65536/step bzw. 65536/(2*D+1)
-
-#define _(X) MAKE_MPC_SAMPLE_EX(X,14)
-
-const MPC_SAMPLE_FORMAT __Cc [1 + 18] = {
- _(111.285962475327f), // 32768/2/255*sqrt(3)
- _(65536.000000000000f), _(21845.333333333332f), _(13107.200000000001f), _(9362.285714285713f),
- _(7281.777777777777f), _(4369.066666666666f), _(2114.064516129032f), _(1040.253968253968f),
- _(516.031496062992f), _(257.003921568627f), _(128.250489236790f), _(64.062561094819f),
- _(32.015632633121f), _(16.003907203907f), _(8.000976681723f), _(4.000244155527f),
- _(2.000061037018f), _(1.000015259021f)
-};
-
-#undef _
-
-// offset for requantization
-// 2*D+1 = steps of quantizer
-const mpc_int32_t __Dc [1 + 18] = {
- 2,
- 0, 1, 2, 3, 4, 7, 15, 31, 63,
- 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767
-};
-
-#ifdef MPC_FIXED_POINT
-static mpc_uint32_t find_shift(double fval)
-{
- mpc_int64_t val = (mpc_int64_t)fval;
- if (val<0) val = -val;
- mpc_uint32_t ptr = 0;
- while(val) {val>>=1;ptr++;}
-
- return ptr > 31 ? 0 : 31 - ptr;
-}
-#endif
-
-/* F U N C T I O N S */
-
-#define SET_SCF(N,X) d->SCF[N] = MAKE_MPC_SAMPLE_EX(X,SCF_shift[N] = (unsigned char)find_shift(X));
-
-void
-mpc_decoder_scale_output(mpc_decoder *d, double factor)
-{
- mpc_int32_t n;
- double f1;
- double f2;
-#ifndef MPC_FIXED_POINT
- factor *= 1.0 / (double)(1<<(MPC_FIXED_POINT_SHIFT-1));
-#else
- factor *= 1.0 / (double)(1<<(16 - MPC_FIXED_POINT_SHIFT));
-#endif
- f1 = f2 = factor;
-
- // handles +1.58...-98.41 dB, where's scf[n] / scf[n-1] = 1.20050805774840750476
-
- SET_SCF(1,factor);
-
- f1 *= 0.83298066476582673961;
- f2 *= 1/0.83298066476582673961;
-
- for ( n = 1; n <= 128; n++ ) {
- SET_SCF((unsigned char)(1+n),f1);
- SET_SCF((unsigned char)(1-n),f2);
- f1 *= 0.83298066476582673961;
- f2 *= 1/0.83298066476582673961;
- }
-}
-
-static void
-mpc_decoder_quantisierungsmodes(mpc_decoder *d) // conversion: index -> quantizer (bitstream reading)
-{ // conversion: quantizer -> index (bitstream writing)
- mpc_int32_t Band = 0;
- mpc_int32_t i;
-
- do {
- d->Q_bit [Band] = 4;
- for ( i = 0; i < 16-1; i++ )
- d->Q_res [Band] [i] = i;
- d->Q_res [Band][i] = 17;
- Band++;
- } while ( Band < 11 );
-
- do {
- d->Q_bit [Band] = 3;
- for ( i = 0; i < 8-1; i++ )
- d->Q_res [Band] [i] = i;
- d->Q_res [Band] [i] = 17;
- Band++;
- } while ( Band < 23 );
-
- do {
- d->Q_bit [Band] = 2;
- for ( i = 0; i < 4-1; i++ )
- d->Q_res [Band] [i] = i;
- d->Q_res [Band] [i] = 17;
- Band++;
- } while ( Band < 32 );
-}
-
-void
-mpc_decoder_initialisiere_quantisierungstabellen(mpc_decoder *d, double scale_factor)
-{
- mpc_decoder_quantisierungsmodes(d);
- mpc_decoder_scale_output(d, scale_factor);
-}
diff --git a/src/libmusepack/streaminfo.c b/src/libmusepack/streaminfo.c
deleted file mode 100644
index 2c6ff1c6f..000000000
--- a/src/libmusepack/streaminfo.c
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- Copyright (c) 2004, The Musepack Development Team
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are
- met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials provided
- with the distribution.
-
- * Neither the name of the The Musepack Development Team nor the
- names of its contributors may be used to endorse or promote
- products derived from this software without specific prior
- written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/// \file streaminfo.c
-/// Implementation of streaminfo reading functions.
-
-#include "musepack/musepack.h"
-#include "musepack/internal.h"
-
-static const char *
-Stringify(mpc_uint32_t profile) // profile is 0...15, where 7...13 is used
-{
- static const char na[] = "n.a.";
- static const char *Names[] = {
- na, "'Unstable/Experimental'", na, na,
- na, "'quality 0'", "'quality 1'", "'Telephone'",
- "'Thumb'", "'Radio'", "'Standard'", "'Xtreme'",
- "'Insane'", "'BrainDead'", "'quality 9'", "'quality 10'"
- };
-
- return profile >= sizeof(Names) / sizeof(*Names) ? na : Names[profile];
-}
-
-void
-mpc_streaminfo_init(mpc_streaminfo * si)
-{
- memset(si, 0, sizeof(mpc_streaminfo));
-}
-
-// read information from SV8 header
-// not yet implemented
-static mpc_int32_t
-streaminfo_read_header_sv8(mpc_streaminfo * si, mpc_reader * fp)
-{
- return 0;
-}
-
-/// Reads streaminfo from SV7 header.
-static mpc_int32_t
-streaminfo_read_header_sv7(mpc_streaminfo * si, mpc_uint32_t HeaderData[8])
-{
- const mpc_int32_t samplefreqs[4] = { 44100, 48000, 37800, 32000 };
-
- //mpc_uint32_t HeaderData [8];
- mpc_uint16_t Estimatedpeak_title = 0;
-
- if (si->stream_version > 0x71) {
- // Update (si->stream_version);
- return 0;
- }
-
- /*
- if ( !fp->seek ( si->header_position ) ) // seek to header start
- return ERROR_CODE_FILE;
- if ( fp->read ( HeaderData, sizeof HeaderData) != sizeof HeaderData )
- return ERROR_CODE_FILE;
- */
-
- si->bitrate = 0;
- si->frames = HeaderData[1];
- si->is = 0;
- si->ms = (HeaderData[2] >> 30) & 0x0001;
- si->max_band = (HeaderData[2] >> 24) & 0x003F;
- si->block_size = 1;
- si->profile = (HeaderData[2] << 8) >> 28;
- si->profile_name = Stringify(si->profile);
- si->sample_freq = samplefreqs[(HeaderData[2] >> 16) & 0x0003];
- Estimatedpeak_title = (mpc_uint16_t) (HeaderData[2] & 0xFFFF); // read the ReplayGain data
- si->gain_title = (mpc_uint16_t) ((HeaderData[3] >> 16) & 0xFFFF);
- si->peak_title = (mpc_uint16_t) (HeaderData[3] & 0xFFFF);
- si->gain_album = (mpc_uint16_t) ((HeaderData[4] >> 16) & 0xFFFF);
- si->peak_album = (mpc_uint16_t) (HeaderData[4] & 0xFFFF);
- si->is_true_gapless = (HeaderData[5] >> 31) & 0x0001; // true gapless: used?
- si->last_frame_samples = (HeaderData[5] >> 20) & 0x07FF; // true gapless: valid samples for last frame
- si->encoder_version = (HeaderData[6] >> 24) & 0x00FF;
-
- if (si->encoder_version == 0) {
- sprintf(si->encoder, "Buschmann 1.7.0...9, Klemm 0.90...1.05");
- }
- else {
- switch (si->encoder_version % 10) {
- case 0:
- sprintf(si->encoder, "Release %u.%u", si->encoder_version / 100,
- si->encoder_version / 10 % 10);
- break;
- case 2:
- case 4:
- case 6:
- case 8:
- sprintf(si->encoder, "Beta %u.%02u", si->encoder_version / 100,
- si->encoder_version % 100);
- break;
- default:
- sprintf(si->encoder, "--Alpha-- %u.%02u",
- si->encoder_version / 100, si->encoder_version % 100);
- break;
- }
- }
-
- // if ( si->peak_title == 0 ) // there is no correct peak_title contained within header
- // si->peak_title = (mpc_uint16_t)(Estimatedpeak_title * 1.18);
- // if ( si->peak_album == 0 )
- // si->peak_album = si->peak_title; // no correct peak_album, use peak_title
-
- //si->sample_freq = 44100; // AB: used by all files up to SV7
- si->channels = 2;
-
- return ERROR_CODE_OK;
-}
-
-// read information from SV4-SV6 header
-static mpc_int32_t
-streaminfo_read_header_sv6(mpc_streaminfo * si, mpc_uint32_t HeaderData[8])
-{
- //mpc_uint32_t HeaderData [8];
-
- /*
- if ( !fp->seek ( si->header_position ) ) // seek to header start
- return ERROR_CODE_FILE;
- if ( fp->read ( HeaderData, sizeof HeaderData ) != sizeof HeaderData )
- return ERROR_CODE_FILE;
- */
-
- si->bitrate = (HeaderData[0] >> 23) & 0x01FF; // read the file-header (SV6 and below)
- si->is = (HeaderData[0] >> 22) & 0x0001;
- si->ms = (HeaderData[0] >> 21) & 0x0001;
- si->stream_version = (HeaderData[0] >> 11) & 0x03FF;
- si->max_band = (HeaderData[0] >> 6) & 0x001F;
- si->block_size = (HeaderData[0]) & 0x003F;
- si->profile = 0;
- si->profile_name = Stringify((mpc_uint32_t) (-1));
- if (si->stream_version >= 5)
- si->frames = HeaderData[1]; // 32 bit
- else
- si->frames = (HeaderData[1] >> 16); // 16 bit
-
- si->gain_title = 0; // not supported
- si->peak_title = 0;
- si->gain_album = 0;
- si->peak_album = 0;
-
- si->last_frame_samples = 0;
- si->is_true_gapless = 0;
-
- si->encoder_version = 0;
- si->encoder[0] = '\0';
-
- if (si->stream_version == 7)
- return ERROR_CODE_SV7BETA; // are there any unsupported parameters used?
- if (si->bitrate != 0)
- return ERROR_CODE_CBR;
- if (si->is != 0)
- return ERROR_CODE_IS;
- if (si->block_size != 1)
- return ERROR_CODE_BLOCKSIZE;
-
- if (si->stream_version < 6) // Bugfix: last frame was invalid for up to SV5
- si->frames -= 1;
-
- si->sample_freq = 44100; // AB: used by all files up to SV7
- si->channels = 2;
-
- if (si->stream_version < 4 || si->stream_version > 7)
- return ERROR_CODE_INVALIDSV;
-
- return ERROR_CODE_OK;
-}
-
-// reads file header and tags
-mpc_int32_t
-mpc_streaminfo_read(mpc_streaminfo * si, mpc_reader * r)
-{
- mpc_uint32_t HeaderData[8];
- mpc_int32_t Error = 0;
-
- // get header position
- if ((si->header_position = JumpID3v2(r)) < 0) {
- return ERROR_CODE_FILE;
- }
- // seek to first byte of mpc data
- if (!r->seek(r->data, si->header_position)) {
- return ERROR_CODE_FILE;
- }
- if (r->read(r->data, HeaderData, 8 * 4) != 8 * 4) {
- return ERROR_CODE_FILE;
- }
- if (!r->seek(r->data, si->header_position + 6 * 4)) {
- return ERROR_CODE_FILE;
- }
-
- si->total_file_length = r->get_size(r->data);
- si->tag_offset = si->total_file_length;
- if (memcmp(HeaderData, "MP+", 3) == 0) {
-#ifndef MPC_LITTLE_ENDIAN
- mpc_uint32_t ptr;
- for (ptr = 0; ptr < 8; ptr++) {
- HeaderData[ptr] = swap32(HeaderData[ptr]);
- }
-#endif
- si->stream_version = HeaderData[0] >> 24;
-
- // stream version 8
- if ((si->stream_version & 15) >= 8) {
- Error = streaminfo_read_header_sv8(si, r);
- }
- // stream version 7
- else if ((si->stream_version & 15) == 7) {
- Error = streaminfo_read_header_sv7(si, HeaderData);
- }
- }
- else {
- // stream version 4-6
- Error = streaminfo_read_header_sv6(si, HeaderData);
- }
-
- // estimation, exact value needs too much time
- si->pcm_samples = 1152 * si->frames - 576;
-
- if (si->pcm_samples > 0) {
- si->average_bitrate =
- (si->tag_offset -
- si->header_position) * 8.0 * si->sample_freq / si->pcm_samples;
- }
- else {
- si->average_bitrate = 0;
- }
-
- return Error;
-}
-
-double
-mpc_streaminfo_get_length(mpc_streaminfo * si)
-{
- return (double)mpc_streaminfo_get_length_samples(si) /
- (double)si->sample_freq;
-}
-
-mpc_int64_t
-mpc_streaminfo_get_length_samples(mpc_streaminfo * si)
-{
- mpc_int64_t samples = (mpc_int64_t) si->frames * MPC_FRAME_LENGTH;
- if (si->is_true_gapless) {
- samples -= (MPC_FRAME_LENGTH - si->last_frame_samples);
- }
- else {
- samples -= MPC_DECODER_SYNTH_DELAY;
- }
- return samples;
-}
diff --git a/src/libmusepack/synth_filter.c b/src/libmusepack/synth_filter.c
deleted file mode 100644
index dceb0a64d..000000000
--- a/src/libmusepack/synth_filter.c
+++ /dev/null
@@ -1,440 +0,0 @@
-/*
- Copyright (c) 2004, The Musepack Development Team
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are
- met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials provided
- with the distribution.
-
- * Neither the name of the The Musepack Development Team nor the
- names of its contributors may be used to endorse or promote
- products derived from this software without specific prior
- written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/// \file synth_filter.c
-/// Synthesis functions.
-/// \todo document me
-
-#include "musepack/musepack.h"
-#include "musepack/internal.h"
-
-/* C O N S T A N T S */
-#undef _
-
-#define MPC_FIXED_POINT_SYNTH_FIX 2
-
-#ifdef MPC_FIXED_POINT
-#define _(value) MPC_MAKE_FRACT_CONST((double)value/(double)(0x40000))
-#else
-#define _(value) MAKE_MPC_SAMPLE((double)value/(double)(0x10000))
-#endif
-
-
-static const MPC_SAMPLE_FORMAT Di_opt [32] [16] = {
- { _( 0), _( -29), _( 213), _( -459), _( 2037), _(-5153), _( 6574), _(-37489), _(75038), _(37489), _(6574), _( 5153), _(2037), _( 459), _(213), _(29) },
- { _( -1), _( -31), _( 218), _( -519), _( 2000), _(-5517), _( 5959), _(-39336), _(74992), _(35640), _(7134), _( 4788), _(2063), _( 401), _(208), _(26) },
- { _( -1), _( -35), _( 222), _( -581), _( 1952), _(-5879), _( 5288), _(-41176), _(74856), _(33791), _(7640), _( 4425), _(2080), _( 347), _(202), _(24) },
- { _( -1), _( -38), _( 225), _( -645), _( 1893), _(-6237), _( 4561), _(-43006), _(74630), _(31947), _(8092), _( 4063), _(2087), _( 294), _(196), _(21) },
- { _( -1), _( -41), _( 227), _( -711), _( 1822), _(-6589), _( 3776), _(-44821), _(74313), _(30112), _(8492), _( 3705), _(2085), _( 244), _(190), _(19) },
- { _( -1), _( -45), _( 228), _( -779), _( 1739), _(-6935), _( 2935), _(-46617), _(73908), _(28289), _(8840), _( 3351), _(2075), _( 197), _(183), _(17) },
- { _( -1), _( -49), _( 228), _( -848), _( 1644), _(-7271), _( 2037), _(-48390), _(73415), _(26482), _(9139), _( 3004), _(2057), _( 153), _(176), _(16) },
- { _( -2), _( -53), _( 227), _( -919), _( 1535), _(-7597), _( 1082), _(-50137), _(72835), _(24694), _(9389), _( 2663), _(2032), _( 111), _(169), _(14) },
- { _( -2), _( -58), _( 224), _( -991), _( 1414), _(-7910), _( 70), _(-51853), _(72169), _(22929), _(9592), _( 2330), _(2001), _( 72), _(161), _(13) },
- { _( -2), _( -63), _( 221), _(-1064), _( 1280), _(-8209), _( -998), _(-53534), _(71420), _(21189), _(9750), _( 2006), _(1962), _( 36), _(154), _(11) },
- { _( -2), _( -68), _( 215), _(-1137), _( 1131), _(-8491), _( -2122), _(-55178), _(70590), _(19478), _(9863), _( 1692), _(1919), _( 2), _(147), _(10) },
- { _( -3), _( -73), _( 208), _(-1210), _( 970), _(-8755), _( -3300), _(-56778), _(69679), _(17799), _(9935), _( 1388), _(1870), _( -29), _(139), _( 9) },
- { _( -3), _( -79), _( 200), _(-1283), _( 794), _(-8998), _( -4533), _(-58333), _(68692), _(16155), _(9966), _( 1095), _(1817), _( -57), _(132), _( 8) },
- { _( -4), _( -85), _( 189), _(-1356), _( 605), _(-9219), _( -5818), _(-59838), _(67629), _(14548), _(9959), _( 814), _(1759), _( -83), _(125), _( 7) },
- { _( -4), _( -91), _( 177), _(-1428), _( 402), _(-9416), _( -7154), _(-61289), _(66494), _(12980), _(9916), _( 545), _(1698), _(-106), _(117), _( 7) },
- { _( -5), _( -97), _( 163), _(-1498), _( 185), _(-9585), _( -8540), _(-62684), _(65290), _(11455), _(9838), _( 288), _(1634), _(-127), _(111), _( 6) },
- { _( -5), _(-104), _( 146), _(-1567), _( -45), _(-9727), _( -9975), _(-64019), _(64019), _( 9975), _(9727), _( 45), _(1567), _(-146), _(104), _( 5) },
- { _( -6), _(-111), _( 127), _(-1634), _( -288), _(-9838), _(-11455), _(-65290), _(62684), _( 8540), _(9585), _( -185), _(1498), _(-163), _( 97), _( 5) },
- { _( -7), _(-117), _( 106), _(-1698), _( -545), _(-9916), _(-12980), _(-66494), _(61289), _( 7154), _(9416), _( -402), _(1428), _(-177), _( 91), _( 4) },
- { _( -7), _(-125), _( 83), _(-1759), _( -814), _(-9959), _(-14548), _(-67629), _(59838), _( 5818), _(9219), _( -605), _(1356), _(-189), _( 85), _( 4) },
- { _( -8), _(-132), _( 57), _(-1817), _(-1095), _(-9966), _(-16155), _(-68692), _(58333), _( 4533), _(8998), _( -794), _(1283), _(-200), _( 79), _( 3) },
- { _( -9), _(-139), _( 29), _(-1870), _(-1388), _(-9935), _(-17799), _(-69679), _(56778), _( 3300), _(8755), _( -970), _(1210), _(-208), _( 73), _( 3) },
- { _(-10), _(-147), _( -2), _(-1919), _(-1692), _(-9863), _(-19478), _(-70590), _(55178), _( 2122), _(8491), _(-1131), _(1137), _(-215), _( 68), _( 2) },
- { _(-11), _(-154), _( -36), _(-1962), _(-2006), _(-9750), _(-21189), _(-71420), _(53534), _( 998), _(8209), _(-1280), _(1064), _(-221), _( 63), _( 2) },
- { _(-13), _(-161), _( -72), _(-2001), _(-2330), _(-9592), _(-22929), _(-72169), _(51853), _( -70), _(7910), _(-1414), _( 991), _(-224), _( 58), _( 2) },
- { _(-14), _(-169), _(-111), _(-2032), _(-2663), _(-9389), _(-24694), _(-72835), _(50137), _(-1082), _(7597), _(-1535), _( 919), _(-227), _( 53), _( 2) },
- { _(-16), _(-176), _(-153), _(-2057), _(-3004), _(-9139), _(-26482), _(-73415), _(48390), _(-2037), _(7271), _(-1644), _( 848), _(-228), _( 49), _( 1) },
- { _(-17), _(-183), _(-197), _(-2075), _(-3351), _(-8840), _(-28289), _(-73908), _(46617), _(-2935), _(6935), _(-1739), _( 779), _(-228), _( 45), _( 1) },
- { _(-19), _(-190), _(-244), _(-2085), _(-3705), _(-8492), _(-30112), _(-74313), _(44821), _(-3776), _(6589), _(-1822), _( 711), _(-227), _( 41), _( 1) },
- { _(-21), _(-196), _(-294), _(-2087), _(-4063), _(-8092), _(-31947), _(-74630), _(43006), _(-4561), _(6237), _(-1893), _( 645), _(-225), _( 38), _( 1) },
- { _(-24), _(-202), _(-347), _(-2080), _(-4425), _(-7640), _(-33791), _(-74856), _(41176), _(-5288), _(5879), _(-1952), _( 581), _(-222), _( 35), _( 1) },
- { _(-26), _(-208), _(-401), _(-2063), _(-4788), _(-7134), _(-35640), _(-74992), _(39336), _(-5959), _(5517), _(-2000), _( 519), _(-218), _( 31), _( 1) }
-};
-
-#undef _
-
-static void Calculate_New_V ( const MPC_SAMPLE_FORMAT * Sample, MPC_SAMPLE_FORMAT * V )
-{
- // Calculating new V-buffer values for left channel
- // calculate new V-values (ISO-11172-3, p. 39)
- // based upon fast-MDCT algorithm by Byeong Gi Lee
- /*static*/ MPC_SAMPLE_FORMAT A00, A01, A02, A03, A04, A05, A06, A07, A08, A09, A10, A11, A12, A13, A14, A15;
- /*static*/ MPC_SAMPLE_FORMAT B00, B01, B02, B03, B04, B05, B06, B07, B08, B09, B10, B11, B12, B13, B14, B15;
- MPC_SAMPLE_FORMAT tmp;
-
- A00 = Sample[ 0] + Sample[31];
- A01 = Sample[ 1] + Sample[30];
- A02 = Sample[ 2] + Sample[29];
- A03 = Sample[ 3] + Sample[28];
- A04 = Sample[ 4] + Sample[27];
- A05 = Sample[ 5] + Sample[26];
- A06 = Sample[ 6] + Sample[25];
- A07 = Sample[ 7] + Sample[24];
- A08 = Sample[ 8] + Sample[23];
- A09 = Sample[ 9] + Sample[22];
- A10 = Sample[10] + Sample[21];
- A11 = Sample[11] + Sample[20];
- A12 = Sample[12] + Sample[19];
- A13 = Sample[13] + Sample[18];
- A14 = Sample[14] + Sample[17];
- A15 = Sample[15] + Sample[16];
-
- B00 = A00 + A15;
- B01 = A01 + A14;
- B02 = A02 + A13;
- B03 = A03 + A12;
- B04 = A04 + A11;
- B05 = A05 + A10;
- B06 = A06 + A09;
- B07 = A07 + A08;;
- B08 = MPC_SCALE_CONST((A00 - A15) , 0.5024192929f , 31);
- B09 = MPC_SCALE_CONST((A01 - A14) , 0.5224986076f , 31);
- B10 = MPC_SCALE_CONST((A02 - A13) , 0.5669440627f , 31);
- B11 = MPC_SCALE_CONST((A03 - A12) , 0.6468217969f , 31);
- B12 = MPC_SCALE_CONST((A04 - A11) , 0.7881546021f , 31);
- B13 = MPC_SCALE_CONST((A05 - A10) , 1.0606776476f , 30);
- B14 = MPC_SCALE_CONST((A06 - A09) , 1.7224471569f , 30);
- B15 = MPC_SCALE_CONST((A07 - A08) , 5.1011486053f , 28);
-
- A00 = B00 + B07;
- A01 = B01 + B06;
- A02 = B02 + B05;
- A03 = B03 + B04;
- A04 = MPC_SCALE_CONST((B00 - B07) , 0.5097956061f , 31);
- A05 = MPC_SCALE_CONST((B01 - B06) , 0.6013448834f , 31);
- A06 = MPC_SCALE_CONST((B02 - B05) , 0.8999761939f , 31);
- A07 = MPC_SCALE_CONST((B03 - B04) , 2.5629155636f , 29);
- A08 = B08 + B15;
- A09 = B09 + B14;
- A10 = B10 + B13;
- A11 = B11 + B12;
- A12 = MPC_SCALE_CONST((B08 - B15) , 0.5097956061f , 31);
- A13 = MPC_SCALE_CONST((B09 - B14) , 0.6013448834f , 31);
- A14 = MPC_SCALE_CONST((B10 - B13) , 0.8999761939f , 31);
- A15 = MPC_SCALE_CONST((B11 - B12) , 2.5629155636f , 29);
-
- B00 = A00 + A03;
- B01 = A01 + A02;
- B02 = MPC_MULTIPLY_FRACT_CONST_FIX((A00 - A03) , 0.5411961079f , 1);
- B03 = MPC_MULTIPLY_FRACT_CONST_FIX((A01 - A02) , 1.3065630198f , 2);
- B04 = A04 + A07;
- B05 = A05 + A06;
- B06 = MPC_MULTIPLY_FRACT_CONST_FIX((A04 - A07) , 0.5411961079f , 1);
- B07 = MPC_MULTIPLY_FRACT_CONST_FIX((A05 - A06) , 1.3065630198f , 2);
- B08 = A08 + A11;
- B09 = A09 + A10;
- B10 = MPC_MULTIPLY_FRACT_CONST_FIX((A08 - A11) , 0.5411961079f , 1);
- B11 = MPC_MULTIPLY_FRACT_CONST_FIX((A09 - A10) , 1.3065630198f , 2);
- B12 = A12 + A15;
- B13 = A13 + A14;
- B14 = MPC_MULTIPLY_FRACT_CONST_FIX((A12 - A15) , 0.5411961079f , 1);
- B15 = MPC_MULTIPLY_FRACT_CONST_FIX((A13 - A14) , 1.3065630198f , 2);
-
- A00 = B00 + B01;
- A01 = MPC_MULTIPLY_FRACT_CONST_FIX((B00 - B01) , 0.7071067691f , 1);
- A02 = B02 + B03;
- A03 = MPC_MULTIPLY_FRACT_CONST_FIX((B02 - B03) , 0.7071067691f , 1);
- A04 = B04 + B05;
- A05 = MPC_MULTIPLY_FRACT_CONST_FIX((B04 - B05) , 0.7071067691f , 1);
- A06 = B06 + B07;
- A07 = MPC_MULTIPLY_FRACT_CONST_FIX((B06 - B07) , 0.7071067691f , 1);
- A08 = B08 + B09;
- A09 = MPC_MULTIPLY_FRACT_CONST_FIX((B08 - B09) , 0.7071067691f , 1);
- A10 = B10 + B11;
- A11 = MPC_MULTIPLY_FRACT_CONST_FIX((B10 - B11) , 0.7071067691f , 1);
- A12 = B12 + B13;
- A13 = MPC_MULTIPLY_FRACT_CONST_FIX((B12 - B13) , 0.7071067691f , 1);
- A14 = B14 + B15;
- A15 = MPC_MULTIPLY_FRACT_CONST_FIX((B14 - B15) , 0.7071067691f , 1);
-
- V[48] = -A00;
- V[ 0] = A01;
- V[40] = -A02 - (V[ 8] = A03);
- V[36] = -((V[ 4] = A05 + (V[12] = A07)) + A06);
- V[44] = - A04 - A06 - A07;
- V[ 6] = (V[10] = A11 + (V[14] = A15)) + A13;
- V[38] = (V[34] = -(V[ 2] = A09 + A13 + A15) - A14) + A09 - A10 - A11;
- V[46] = (tmp = -(A12 + A14 + A15)) - A08;
- V[42] = tmp - A10 - A11;
-
- A00 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 0] - Sample[31]) , 0.5006030202f , MPC_FIXED_POINT_SYNTH_FIX);
- A01 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 1] - Sample[30]) , 0.5054709315f , MPC_FIXED_POINT_SYNTH_FIX);
- A02 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 2] - Sample[29]) , 0.5154473186f , MPC_FIXED_POINT_SYNTH_FIX);
- A03 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 3] - Sample[28]) , 0.5310425758f , MPC_FIXED_POINT_SYNTH_FIX);
- A04 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 4] - Sample[27]) , 0.5531039238f , MPC_FIXED_POINT_SYNTH_FIX);
- A05 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 5] - Sample[26]) , 0.5829349756f , MPC_FIXED_POINT_SYNTH_FIX);
- A06 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 6] - Sample[25]) , 0.6225041151f , MPC_FIXED_POINT_SYNTH_FIX);
- A07 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 7] - Sample[24]) , 0.6748083234f , MPC_FIXED_POINT_SYNTH_FIX);
- A08 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 8] - Sample[23]) , 0.7445362806f , MPC_FIXED_POINT_SYNTH_FIX);
- A09 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 9] - Sample[22]) , 0.8393496275f , MPC_FIXED_POINT_SYNTH_FIX);
- A10 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[10] - Sample[21]) , 0.9725682139f , MPC_FIXED_POINT_SYNTH_FIX);
-#if MPC_FIXED_POINT_SYNTH_FIX>=2
- A11 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[11] - Sample[20]) , 1.1694399118f , MPC_FIXED_POINT_SYNTH_FIX);
- A12 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[12] - Sample[19]) , 1.4841645956f , MPC_FIXED_POINT_SYNTH_FIX);
-#else
- A11 = MPC_SCALE_CONST_SHR ((Sample[11] - Sample[20]) , 1.1694399118f , 30, MPC_FIXED_POINT_SYNTH_FIX);
- A12 = MPC_SCALE_CONST_SHR ((Sample[12] - Sample[19]) , 1.4841645956f , 30, MPC_FIXED_POINT_SYNTH_FIX);
-#endif
- A13 = MPC_SCALE_CONST_SHR ((Sample[13] - Sample[18]) , 2.0577809811f , 29, MPC_FIXED_POINT_SYNTH_FIX);
- A14 = MPC_SCALE_CONST_SHR ((Sample[14] - Sample[17]) , 3.4076085091f , 29, MPC_FIXED_POINT_SYNTH_FIX);
- A15 = MPC_SCALE_CONST_SHR ((Sample[15] - Sample[16]) , 10.1900081635f, 27 ,MPC_FIXED_POINT_SYNTH_FIX);
-
- B00 = A00 + A15;
- B01 = A01 + A14;
- B02 = A02 + A13;
- B03 = A03 + A12;
- B04 = A04 + A11;
- B05 = A05 + A10;
- B06 = A06 + A09;
- B07 = A07 + A08;
- B08 = MPC_SCALE_CONST((A00 - A15) , 0.5024192929f , 31);
- B09 = MPC_SCALE_CONST((A01 - A14) , 0.5224986076f , 31);
- B10 = MPC_SCALE_CONST((A02 - A13) , 0.5669440627f , 31);
- B11 = MPC_SCALE_CONST((A03 - A12) , 0.6468217969f , 31);
- B12 = MPC_SCALE_CONST((A04 - A11) , 0.7881546021f , 31);
- B13 = MPC_SCALE_CONST((A05 - A10) , 1.0606776476f , 30);
- B14 = MPC_SCALE_CONST((A06 - A09) , 1.7224471569f , 30);
- B15 = MPC_SCALE_CONST((A07 - A08) , 5.1011486053f , 28);
-
- A00 = B00 + B07;
- A01 = B01 + B06;
- A02 = B02 + B05;
- A03 = B03 + B04;
- A04 = MPC_SCALE_CONST((B00 - B07) , 0.5097956061f , 31);
- A05 = MPC_SCALE_CONST((B01 - B06) , 0.6013448834f , 31);
- A06 = MPC_SCALE_CONST((B02 - B05) , 0.8999761939f , 31);
- A07 = MPC_SCALE_CONST((B03 - B04) , 2.5629155636f , 29);
- A08 = B08 + B15;
- A09 = B09 + B14;
- A10 = B10 + B13;
- A11 = B11 + B12;
- A12 = MPC_SCALE_CONST((B08 - B15) , 0.5097956061f , 31);
- A13 = MPC_SCALE_CONST((B09 - B14) , 0.6013448834f , 31);
- A14 = MPC_SCALE_CONST((B10 - B13) , 0.8999761939f , 31);
- A15 = MPC_SCALE_CONST((B11 - B12) , 2.5629155636f , 29);
-
- B00 = A00 + A03;
- B01 = A01 + A02;
- B02 = MPC_SCALE_CONST((A00 - A03) , 0.5411961079f , 31);
- B03 = MPC_SCALE_CONST((A01 - A02) , 1.3065630198f , 30);
- B04 = A04 + A07;
- B05 = A05 + A06;
- B06 = MPC_SCALE_CONST((A04 - A07) , 0.5411961079f , 31);
- B07 = MPC_SCALE_CONST((A05 - A06) , 1.3065630198f , 30);
- B08 = A08 + A11;
- B09 = A09 + A10;
- B10 = MPC_SCALE_CONST((A08 - A11) , 0.5411961079f , 31);
- B11 = MPC_SCALE_CONST((A09 - A10) , 1.3065630198f , 30);
- B12 = A12 + A15;
- B13 = A13 + A14;
- B14 = MPC_SCALE_CONST((A12 - A15) , 0.5411961079f , 31);
- B15 = MPC_SCALE_CONST((A13 - A14) , 1.3065630198f , 30);
-
- A00 = MPC_SHL(B00 + B01, MPC_FIXED_POINT_SYNTH_FIX);
- A01 = MPC_SCALE_CONST_SHL((B00 - B01) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
- A02 = MPC_SHL(B02 + B03, MPC_FIXED_POINT_SYNTH_FIX);
- A03 = MPC_SCALE_CONST_SHL((B02 - B03) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
- A04 = MPC_SHL(B04 + B05, MPC_FIXED_POINT_SYNTH_FIX);
- A05 = MPC_SCALE_CONST_SHL((B04 - B05) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
- A06 = MPC_SHL(B06 + B07, MPC_FIXED_POINT_SYNTH_FIX);
- A07 = MPC_SCALE_CONST_SHL((B06 - B07) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
- A08 = MPC_SHL(B08 + B09, MPC_FIXED_POINT_SYNTH_FIX);
- A09 = MPC_SCALE_CONST_SHL((B08 - B09) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
- A10 = MPC_SHL(B10 + B11, MPC_FIXED_POINT_SYNTH_FIX);
- A11 = MPC_SCALE_CONST_SHL((B10 - B11) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
- A12 = MPC_SHL(B12 + B13, MPC_FIXED_POINT_SYNTH_FIX);
- A13 = MPC_SCALE_CONST_SHL((B12 - B13) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
- A14 = MPC_SHL(B14 + B15, MPC_FIXED_POINT_SYNTH_FIX);
- A15 = MPC_SCALE_CONST_SHL((B14 - B15) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
-
- // mehrfach verwendete Ausdrücke: A04+A06+A07, A09+A13+A15
- V[ 5] = (V[11] = (V[13] = A07 + (V[15] = A15)) + A11) + A05 + A13;
- V[ 7] = (V[ 9] = A03 + A11 + A15) + A13;
- V[33] = -(V[ 1] = A01 + A09 + A13 + A15) - A14;
- V[35] = -(V[ 3] = A05 + A07 + A09 + A13 + A15) - A06 - A14;
- V[37] = (tmp = -(A10 + A11 + A13 + A14 + A15)) - A05 - A06 - A07;
- V[39] = tmp - A02 - A03; // abhängig vom Befehl drüber
- V[41] = (tmp += A13 - A12) - A02 - A03; // abhängig vom Befehl 2 drüber
- V[43] = tmp - A04 - A06 - A07; // abhängig von Befehlen 1 und 3 drüber
- V[47] = (tmp = -(A08 + A12 + A14 + A15)) - A00;
- V[45] = tmp - A04 - A06 - A07; // abhängig vom Befehl drüber
-
- V[32] = -V[ 0];
- V[31] = -V[ 1];
- V[30] = -V[ 2];
- V[29] = -V[ 3];
- V[28] = -V[ 4];
- V[27] = -V[ 5];
- V[26] = -V[ 6];
- V[25] = -V[ 7];
- V[24] = -V[ 8];
- V[23] = -V[ 9];
- V[22] = -V[10];
- V[21] = -V[11];
- V[20] = -V[12];
- V[19] = -V[13];
- V[18] = -V[14];
- V[17] = -V[15];
-
- V[63] = V[33];
- V[62] = V[34];
- V[61] = V[35];
- V[60] = V[36];
- V[59] = V[37];
- V[58] = V[38];
- V[57] = V[39];
- V[56] = V[40];
- V[55] = V[41];
- V[54] = V[42];
- V[53] = V[43];
- V[52] = V[44];
- V[51] = V[45];
- V[50] = V[46];
- V[49] = V[47];
-}
-
-static void Synthese_Filter_float_internal(MPC_SAMPLE_FORMAT * OutData,MPC_SAMPLE_FORMAT * V,const MPC_SAMPLE_FORMAT * Y)
-{
- mpc_uint32_t n;
- for ( n = 0; n < 36; n++, Y += 32 ) {
- V -= 64;
- Calculate_New_V ( Y, V );
- {
- MPC_SAMPLE_FORMAT * Data = OutData;
- const MPC_SAMPLE_FORMAT * D = (const MPC_SAMPLE_FORMAT *) &Di_opt;
- mpc_int32_t k;
- //mpc_int32_t tmp;
-
-
-
- for ( k = 0; k < 32; k++, D += 16, V++ ) {
- *Data = MPC_SHL(
- MPC_MULTIPLY_FRACT(V[ 0],D[ 0]) + MPC_MULTIPLY_FRACT(V[ 96],D[ 1]) + MPC_MULTIPLY_FRACT(V[128],D[ 2]) + MPC_MULTIPLY_FRACT(V[224],D[ 3])
- + MPC_MULTIPLY_FRACT(V[256],D[ 4]) + MPC_MULTIPLY_FRACT(V[352],D[ 5]) + MPC_MULTIPLY_FRACT(V[384],D[ 6]) + MPC_MULTIPLY_FRACT(V[480],D[ 7])
- + MPC_MULTIPLY_FRACT(V[512],D[ 8]) + MPC_MULTIPLY_FRACT(V[608],D[ 9]) + MPC_MULTIPLY_FRACT(V[640],D[10]) + MPC_MULTIPLY_FRACT(V[736],D[11])
- + MPC_MULTIPLY_FRACT(V[768],D[12]) + MPC_MULTIPLY_FRACT(V[864],D[13]) + MPC_MULTIPLY_FRACT(V[896],D[14]) + MPC_MULTIPLY_FRACT(V[992],D[15])
- , 2);
-
- Data += 2;
- }
- V -= 32;//bleh
- OutData+=64;
- }
- }
-}
-
-void
-mpc_decoder_synthese_filter_float(mpc_decoder *d, MPC_SAMPLE_FORMAT* OutData)
-{
- /********* left channel ********/
- memmove(d->V_L + MPC_V_MEM, d->V_L, 960 * sizeof(MPC_SAMPLE_FORMAT) );
-
- Synthese_Filter_float_internal(
- OutData,
- (MPC_SAMPLE_FORMAT *)(d->V_L + MPC_V_MEM),
- (MPC_SAMPLE_FORMAT *)(d->Y_L [0]));
-
- /******** right channel ********/
- memmove(d->V_R + MPC_V_MEM, d->V_R, 960 * sizeof(MPC_SAMPLE_FORMAT) );
-
- Synthese_Filter_float_internal(
- OutData + 1,
- (MPC_SAMPLE_FORMAT *)(d->V_R + MPC_V_MEM),
- (MPC_SAMPLE_FORMAT *)(d->Y_R [0]));
-}
-
-/*******************************************/
-/* */
-/* dithered synthesis */
-/* */
-/*******************************************/
-
-static const unsigned char Parity [256] = { // parity
- 0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,
- 1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,
- 1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,
- 0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,
- 1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,
- 0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,
- 0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,
- 1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0
-};
-
-/*
- * This is a simple random number generator with good quality for audio purposes.
- * It consists of two polycounters with opposite rotation direction and different
- * periods. The periods are coprime, so the total period is the product of both.
- *
- * -------------------------------------------------------------------------------------------------
- * +-> |31:30:29:28:27:26:25:24:23:22:21:20:19:18:17:16:15:14:13:12:11:10: 9: 8: 7: 6: 5: 4: 3: 2: 1: 0|
- * | -------------------------------------------------------------------------------------------------
- * | | | | | | |
- * | +--+--+--+-XOR-+--------+
- * | |
- * +--------------------------------------------------------------------------------------+
- *
- * -------------------------------------------------------------------------------------------------
- * |31:30:29:28:27:26:25:24:23:22:21:20:19:18:17:16:15:14:13:12:11:10: 9: 8: 7: 6: 5: 4: 3: 2: 1: 0| <-+
- * ------------------------------------------------------------------------------------------------- |
- * | | | | |
- * +--+----XOR----+--+ |
- * | |
- * +----------------------------------------------------------------------------------------+
- *
- *
- * The first has an period of 3*5*17*257*65537, the second of 7*47*73*178481,
- * which gives a period of 18.410.713.077.675.721.215. The result is the
- * XORed values of both generators.
- */
-mpc_uint32_t
-random_int(mpc_decoder *d)
-{
-#if 1
- mpc_uint32_t t1, t2, t3, t4;
-
- t3 = t1 = d->__r1; t4 = t2 = d->__r2; // Parity calculation is done via table lookup, this is also available
- t1 &= 0xF5; t2 >>= 25; // on CPUs without parity, can be implemented in C and avoid unpredictable
- t1 = Parity [t1]; t2 &= 0x63; // jumps and slow rotate through the carry flag operations.
- t1 <<= 31; t2 = Parity [t2];
-
- return (d->__r1 = (t3 >> 1) | t1 ) ^ (d->__r2 = (t4 + t4) | t2 );
-#else
- return (d->__r1 = (d->__r1 >> 1) | ((mpc_uint32_t)Parity [d->__r1 & 0xF5] << 31) ) ^
- (d->__r2 = (d->__r2 << 1) | (mpc_uint32_t)Parity [(d->__r2 >> 25) & 0x63] );
-#endif
-}
diff --git a/src/libreal/Makefile.am b/src/libreal/Makefile.am
index 6e76d6279..7072039dd 100644
--- a/src/libreal/Makefile.am
+++ b/src/libreal/Makefile.am
@@ -1,12 +1,13 @@
include $(top_srcdir)/misc/Makefile.common
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_LDFLAGS = $(xineplug_ldflags)
+
+noinst_HEADERS = real_common.h
+
if ENABLE_REAL
xineplug_LTLIBRARIES = xineplug_decode_real.la
endif
xineplug_decode_real_la_SOURCES = xine_real_video_decoder.c real_common.c xine_real_audio_decoder.c
xineplug_decode_real_la_LIBADD = $(XINE_LIB) $(DYNAMIC_LD_LIBS) $(LTLIBINTL)
-xineplug_decode_real_la_CFLAGS = $(VISIBILITY_FLAG)
-xineplug_decode_real_la_LDFLAGS = $(xineplug_ldflags)
-
-noinst_HEADERS = real_common.h
diff --git a/src/libspucc/Makefile.am b/src/libspucc/Makefile.am
index a8af8632e..87266505c 100644
--- a/src/libspucc/Makefile.am
+++ b/src/libspucc/Makefile.am
@@ -1,10 +1,12 @@
include $(top_srcdir)/misc/Makefile.common
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_LDFLAGS = $(xineplug_ldflags)
+
+noinst_HEADERS = cc_decoder.h
+
xineplug_LTLIBRARIES = xineplug_decode_spucc.la
xineplug_decode_spucc_la_SOURCES = cc_decoder.c xine_cc_decoder.c
-xineplug_decode_spucc_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS) -fno-strict-aliasing
-xineplug_decode_spucc_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
-xineplug_decode_spucc_la_LDFLAGS = -avoid-version -module
-
-noinst_HEADERS = cc_decoder.h
+xineplug_decode_spucc_la_LIBADD = $(XINE_LIB)
+xineplug_decode_spucc_la_CFLAGS = $(AM_CFLAGS) -fno-strict-aliasing
diff --git a/src/libspucmml/Makefile.am b/src/libspucmml/Makefile.am
index 81e8d3623..85f5dbcd9 100644
--- a/src/libspucmml/Makefile.am
+++ b/src/libspucmml/Makefile.am
@@ -1,8 +1,9 @@
include $(top_srcdir)/misc/Makefile.common
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_LDFLAGS = $(xineplug_ldflags)
+
xineplug_LTLIBRARIES = xineplug_decode_spucmml.la
xineplug_decode_spucmml_la_SOURCES = xine_cmml_decoder.c
xineplug_decode_spucmml_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
-xineplug_decode_spucmml_la_CFLAGS = $(VISIBILITY_FLAG)
-xineplug_decode_spucmml_la_LDFLAGS = $(xineplug_ldflags)
diff --git a/src/libspudec/Makefile.am b/src/libspudec/Makefile.am
index 208d994f5..62de3774d 100644
--- a/src/libspudec/Makefile.am
+++ b/src/libspudec/Makefile.am
@@ -1,26 +1,21 @@
include $(top_srcdir)/misc/Makefile.common
-xineplug_LTLIBRARIES = xineplug_decode_spu.la
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_CPPFLAGS = -I$(top_srcdir)/src/input/libdvdnav
+AM_LDFLAGS = $(xineplug_ldflags)
-if HAVE_DVDNAV
+noinst_HEADERS = spu.h
-xineplug_decode_spu_la_SOURCES = \
- spu.c \
- xine_spu_decoder.c
-xineplug_decode_spu_la_LIBADD = $(XINE_LIB) $(DVDNAV_LIBS) $(PTHREAD_LIBS)
+xineplug_LTLIBRARIES = xineplug_decode_spu.la
+if WITH_EXTERNAL_DVDNAV
+external_dvdnav_libs = $(DVDNAV_LIBS)
+internal_dvdnav_sources =
else
-
-xineplug_decode_spu_la_SOURCES = \
- nav_read.c \
- spu.c \
- xine_spu_decoder.c
-AM_CPPFLAGS = -I$(top_srcdir)/src/input/libdvdnav
-xineplug_decode_spu_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS)
-
+external_dvdnav_libs =
+internal_dvdnav_sources = nav_read.c
endif
-xineplug_decode_spu_la_CFLAGS = $(DVDNAV_CFLAGS) $(VISIBILITY_FLAG)
-xineplug_decode_spu_la_LDFLAGS = $(xineplug_ldflags)
-
-noinst_HEADERS = spu.h
+xineplug_decode_spu_la_SOURCES = $(internal_dvdnav_sources) spu.c xine_spu_decoder.c
+xineplug_decode_spu_la_LIBADD = $(XINE_LIB) $(external_dvdnav_libs) $(PTHREAD_LIBS)
+xineplug_decode_spu_la_CFLAGS = $(AM_CFLAGS) $(DVDNAV_CFLAGS)
diff --git a/src/libspudvb/Makefile.am b/src/libspudvb/Makefile.am
index 310c02f0b..1adb154db 100644
--- a/src/libspudvb/Makefile.am
+++ b/src/libspudvb/Makefile.am
@@ -1,8 +1,9 @@
include $(top_srcdir)/misc/Makefile.common
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_LDFLAGS = $(xineplug_ldflags)
+
xineplug_LTLIBRARIES = xineplug_decode_spudvb.la
xineplug_decode_spudvb_la_SOURCES = xine_spudvb_decoder.c
xineplug_decode_spudvb_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_decode_spudvb_la_CFLAGS = $(VISIBILITY_FLAG)
-xineplug_decode_spudvb_la_LDFLAGS = $(xineplug_ldflags)
diff --git a/src/libspudvb/xine_spudvb_decoder.c b/src/libspudvb/xine_spudvb_decoder.c
index 7fe972be6..f5bb49b33 100644
--- a/src/libspudvb/xine_spudvb_decoder.c
+++ b/src/libspudvb/xine_spudvb_decoder.c
@@ -30,6 +30,7 @@
#include "pthread.h"
#include <errno.h>
#include "xine_internal.h"
+#include "spu.h"
#include "osd.h"
#define MAX_REGIONS 7
@@ -292,6 +293,24 @@ static void decode_4bit_pixel_code_string (dvb_spu_decoder_t * this, int r, int
}
}
+static void recalculate_trans (dvb_spu_decoder_t *this)
+{
+ dvbsub_func_t *const dvbsub = this->dvbsub;
+ xine_spu_opacity_t opacity;
+ int i;
+
+ _x_spu_get_opacity (this->stream->xine, &opacity);
+ for (i = 0; i < MAX_REGIONS * 256; ++i) {
+ /* ETSI-300-743 says "full transparency if Y == 0". */
+ if (dvbsub->colours[i].y == 0)
+ dvbsub->trans[i] = 0;
+ else {
+ int v = _x_spu_calculate_opacity (&dvbsub->colours[i], dvbsub->colours[i].foo, &opacity);
+ dvbsub->trans[i] = v * 14 / 255 + 1;
+ }
+ }
+
+}
static void set_clut(dvb_spu_decoder_t *this,int CLUT_id,int CLUT_entry_id,int Y_value, int Cr_value, int Cb_value, int T_value) {
@@ -304,13 +323,7 @@ static void set_clut(dvb_spu_decoder_t *this,int CLUT_id,int CLUT_entry_id,int Y
dvbsub->colours[(CLUT_id*256)+CLUT_entry_id].y=Y_value;
dvbsub->colours[(CLUT_id*256)+CLUT_entry_id].cr=Cr_value;
dvbsub->colours[(CLUT_id*256)+CLUT_entry_id].cb=Cb_value;
-
- if (Y_value==0) {
- dvbsub->trans[(CLUT_id*256)+CLUT_entry_id]=T_value;
- } else {
- dvbsub->trans[(CLUT_id*256)+CLUT_entry_id]=255;
- }
-
+ dvbsub->colours[(CLUT_id*256)+CLUT_entry_id].foo = T_value;
}
static void process_CLUT_definition_segment(dvb_spu_decoder_t *this) {
@@ -816,6 +829,7 @@ static void spudec_decode_data (spu_decoder_t * this_gen, buf_element_t * buf)
process_object_data_segment (this);
break;
case 0x80: /* Page is now completely rendered */
+ recalculate_trans(this);
draw_subtitles( this );
break;
default:
@@ -911,6 +925,18 @@ static spu_decoder_t *dvb_spu_class_open_plugin (spu_decoder_class_t * class_gen
this->dvbsub->regions[i].CLUT_id = 0;
}
+ {
+ xine_spu_opacity_t opacity;
+ static const clut_t black = { 0, 0, 0, 0 };
+ int t;
+
+ _x_spu_get_opacity (this->stream->xine, &opacity);
+ t = _x_spu_calculate_opacity (&black, 0, &opacity);
+
+ for (i = 0; i < MAX_REGIONS * 256; i++)
+ this->dvbsub->colours[i].foo = t;
+ }
+
pthread_mutex_init(&this->dvbsub_osd_mutex, NULL);
pthread_cond_init(&this->dvbsub_restart_timeout, NULL);
this->dvbsub_hide_timeout.tv_nsec = 0;
diff --git a/src/libsputext/Makefile.am b/src/libsputext/Makefile.am
index 4f03d7fa9..14c6f2323 100644
--- a/src/libsputext/Makefile.am
+++ b/src/libsputext/Makefile.am
@@ -1,13 +1,12 @@
include $(top_srcdir)/misc/Makefile.common
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
AM_LDFLAGS = $(xineplug_ldflags)
xineplug_LTLIBRARIES = xineplug_decode_sputext.la xineplug_dmx_sputext.la
xineplug_dmx_sputext_la_SOURCES = demux_sputext.c
xineplug_dmx_sputext_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
-xineplug_dmx_sputext_la_CFLAGS = $(VISIBILITY_FLAG)
xineplug_decode_sputext_la_SOURCES = xine_sputext_decoder.c
xineplug_decode_sputext_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
-xineplug_decode_sputext_la_CFLAGS = $(VISIBILITY_FLAG)
diff --git a/src/libsputext/xine_sputext_decoder.c b/src/libsputext/xine_sputext_decoder.c
index 5d9a3c116..66ce4a533 100644
--- a/src/libsputext/xine_sputext_decoder.c
+++ b/src/libsputext/xine_sputext_decoder.c
@@ -908,7 +908,7 @@ static void update_src_encoding(void *class_gen, xine_cfg_entry_t *entry)
static void *init_spu_decoder_plugin (xine_t *xine, void *data) {
- static const char *subtitle_size_strings[] = {
+ static const char *const subtitle_size_strings[] = {
"tiny", "small", "normal", "large", "very large", "huge", NULL
};
sputext_class_t *this ;
diff --git a/src/libw32dll/DirectShow/Makefile.am b/src/libw32dll/DirectShow/Makefile.am
index a74c65815..02eddc00a 100644
--- a/src/libw32dll/DirectShow/Makefile.am
+++ b/src/libw32dll/DirectShow/Makefile.am
@@ -1,26 +1,9 @@
include $(top_srcdir)/misc/Makefile.common
-AM_CFLAGS = $(X_CFLAGS) -fno-omit-frame-pointer \
- -Wmissing-prototypes -Wimplicit-function-declaration \
- -DWIN32_PATH=\"@w32_path@\" -DNOAVIFILE_HEADERS \
+AM_CFLAGS = $(X_CFLAGS) -fno-omit-frame-pointer
+AM_CPPFLAGS = -DWIN32_PATH=\"$(w32_path)\" -DNOAVIFILE_HEADERS \
-I$(srcdir)/.. -I$(srcdir)/../wine
-if HAVE_W32DLL
-ds_filter_lib = libds_filter.la
-endif
-
-noinst_LTLIBRARIES = $(ds_filter_lib)
-
-libds_filter_la_SOURCES = \
- allocator.c \
- cmediasample.c \
- guids.c \
- inputpin.c \
- outputpin.c \
- DS_Filter.c \
- DS_AudioDecoder.c \
- DS_VideoDecoder.c
-
noinst_HEADERS = \
allocator.h \
cmediasample.h \
@@ -32,3 +15,15 @@ noinst_HEADERS = \
DS_AudioDecoder.h \
DS_Filter.h \
DS_VideoDecoder.h
+
+noinst_LTLIBRARIES = libds_filter.la
+
+libds_filter_la_SOURCES = \
+ allocator.c \
+ cmediasample.c \
+ guids.c \
+ inputpin.c \
+ outputpin.c \
+ DS_Filter.c \
+ DS_AudioDecoder.c \
+ DS_VideoDecoder.c
diff --git a/src/libw32dll/Makefile.am b/src/libw32dll/Makefile.am
index e7f655888..f8063d3a2 100644
--- a/src/libw32dll/Makefile.am
+++ b/src/libw32dll/Makefile.am
@@ -1,38 +1,32 @@
include $(top_srcdir)/misc/Makefile.common
-AM_CFLAGS = -I$(srcdir)/wine -DWIN32_PATH=\"@w32_path@\" $(VISIBILITY_FLAG)
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_CPPFLAGS = -I$(srcdir)/wine -DWIN32_PATH=\"$(w32_path)\"
+AM_LDFLAGS = $(xineplug_ldflags)
-SUBDIRS = wine DirectShow dmo qtx
-
-if HAVE_W32DLL
-w32dll_codec = xineplug_decode_w32dll.la
-qt_codec = xineplug_decode_qt.la
+SUBDIRS =
+if ENABLE_W32DLL
+SUBDIRS += wine DirectShow dmo qtx
endif
-xineplug_LTLIBRARIES = $(w32dll_codec) $(qt_codec)
-
EXTRA_DIST = common.c
+noinst_HEADERS = libwin32.h w32codec.h
+
+if ENABLE_W32DLL
+xineplug_LTLIBRARIES = xineplug_decode_w32dll.la xineplug_decode_qt.la
+endif
+
xineplug_decode_w32dll_la_SOURCES = w32codec.c
-xineplug_decode_w32dll_la_LDFLAGS = -avoid-version -module
+xineplug_decode_w32dll_la_DEPS = $(XDG_BASEDIR_DEPS)
xineplug_decode_w32dll_la_LIBADD = \
$(top_builddir)/src/libw32dll/wine/libwine.la \
- $(XINE_LIB) \
- $(PTHREAD_LIBS) \
- $(LTLIBINTL) \
- -lm \
$(top_builddir)/src/libw32dll/DirectShow/libds_filter.la \
$(top_builddir)/src/libw32dll/dmo/libdmo_filter.la \
- @KSTAT_LIBS@
+ $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL) -lm $(KSTAT_LIBS) $(XDG_BASEDIR_LIBS)
+xineplug_decode_w32dll_la_CPPFLAGS = $(AM_CPPFLAGS) $(XDG_BASEDIR_CPPFLAGS)
xineplug_decode_qt_la_SOURCES = qt_decoder.c
-xineplug_decode_qt_la_LDFLAGS = -avoid-version -module
xineplug_decode_qt_la_LIBADD = \
$(top_builddir)/src/libw32dll/wine/libwine.la \
- $(XINE_LIB) \
- $(PTHREAD_LIBS) \
- $(LTLIBINTL) \
- -lm \
- @KSTAT_LIBS@
-
-noinst_HEADERS = libwin32.h w32codec.h
+ $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL) -lm $(KSTAT_LIBS)
diff --git a/src/libw32dll/dmo/Makefile.am b/src/libw32dll/dmo/Makefile.am
index 2b7cd3e37..531a4559a 100644
--- a/src/libw32dll/dmo/Makefile.am
+++ b/src/libw32dll/dmo/Makefile.am
@@ -1,22 +1,7 @@
include $(top_srcdir)/misc/Makefile.common
-AM_CFLAGS = $(X_CFLAGS) -fno-omit-frame-pointer \
- -Wmissing-prototypes -Wimplicit-function-declaration \
- -DWIN32_PATH=\"@w32_path@\" -DNOAVIFILE_HEADERS \
- -I$(srcdir)/.. -I$(srcdir)/../wine
-
-if HAVE_W32DLL
-dmo_filter_lib = libdmo_filter.la
-endif
-
-noinst_LTLIBRARIES = $(dmo_filter_lib)
-
-libdmo_filter_la_SOURCES = \
- buffer.c \
- DMO_AudioDecoder.c \
- dmo.c \
- dmo_guids.c \
- DMO_VideoDecoder.c
+AM_CFLAGS = $(X_CFLAGS) -fno-omit-frame-pointer
+AM_CPPFLAGS = -DWIN32_PATH=\"$(w32_path)\" -DNOAVIFILE_HEADERS -I$(srcdir)/.. -I$(srcdir)/../wine
noinst_HEADERS = \
DMO_AudioDecoder.h \
@@ -25,3 +10,12 @@ noinst_HEADERS = \
DMO_Filter.h \
dmo.h \
DMO_VideoDecoder.h
+
+noinst_LTLIBRARIES = libdmo_filter.la
+
+libdmo_filter_la_SOURCES = \
+ buffer.c \
+ DMO_AudioDecoder.c \
+ dmo.c \
+ dmo_guids.c \
+ DMO_VideoDecoder.c
diff --git a/src/libw32dll/wine/Makefile.am b/src/libw32dll/wine/Makefile.am
index 63da4068e..1756e3262 100644
--- a/src/libw32dll/wine/Makefile.am
+++ b/src/libw32dll/wine/Makefile.am
@@ -1,40 +1,13 @@
include $(top_srcdir)/misc/Makefile.common
-LIBTOOL = $(SHELL) $(top_builddir)/libtool
-
-EXTRA_DIST = stubs.s wrapper.S
-
-noinst_LTLIBRARIES = $(wine_lib)
-
-AM_CFLAGS = $(X_CFLAGS) @W32_NO_OPTIMIZE@ \
- -Wmissing-prototypes -Wimplicit-function-declaration \
- -DWIN32_PATH=\"@w32_path@\" -I$(srcdir)/.. -D__WINE__ \
+# disable -fomit-frame-pointer, -finline-functions, and -frename-registers
+# because they cause bad behavior of wine
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(X_CFLAGS) @W32_NO_OPTIMIZE@ \
+ -fno-omit-frame-pointer -fno-inline-functions -fno-rename-registers
+AM_CPPFLAGS = -DWIN32_PATH=\"$(w32_path)\" -I$(srcdir)/.. -D__WINE__ \
-Ddbg_printf=__vprintf -DTRACE=__vprintf
-# CFLAGS is here to filter out -fomit-frame-pointer,
-# -finline-functions and -frename-registers because they cause bad
-# behavior of wine
-CFLAGS = `echo @CFLAGS@ | sed -e 's/-fomit-frame-pointer//g;s/-finline-functions//g;s/-frename-registers//g'`
-
-if HAVE_W32DLL
-wine_lib = libwine.la
-endif
-
-libwine_la_SOURCES = \
- afl.c \
- driver.c \
- elfdll.c \
- ext.c \
- ldt_keeper.c \
- module.c \
- pe_image.c \
- pe_resource.c \
- resource.c \
- registry.c \
- vfl.c \
- win32.c \
- stubs.s \
- wrapper.S
+EXTRA_DIST = stubs.s wrapper.S
noinst_HEADERS = \
avifmt.h \
@@ -74,3 +47,21 @@ noinst_HEADERS = \
winuser.h \
wrapper.h
+noinst_LTLIBRARIES = libwine.la
+
+libwine_la_SOURCES = \
+ afl.c \
+ driver.c \
+ elfdll.c \
+ ext.c \
+ ldt_keeper.c \
+ module.c \
+ pe_image.c \
+ pe_resource.c \
+ resource.c \
+ registry.c \
+ vfl.c \
+ win32.c \
+ stubs.s \
+ wrapper.S
+libwine_la_CPPFLAGS = $(AM_CPPFLAGS) $(XDG_BASEDIR_CPPFLAGS)
diff --git a/src/libw32dll/wine/registry.c b/src/libw32dll/wine/registry.c
index 0f91499b3..c8e3c4dd0 100644
--- a/src/libw32dll/wine/registry.c
+++ b/src/libw32dll/wine/registry.c
@@ -19,6 +19,7 @@
#ifdef XINE_MAJOR
#include "xineutils.h"
+#include <basedir.h>
#endif
//#undef TRACE
@@ -302,44 +303,22 @@ static struct reg_value* insert_reg_value(int handle, const char* name, int type
static void init_registry(void)
{
+ xdgHandle tmph = xdgAllocHandle();
+ const char *const xdg_cache_home = xdgCacheHome(tmph);
+
TRACE("Initializing registry\n");
// can't be free-ed - it's static and probably thread
// unsafe structure which is stored in glibc
-#ifdef MPLAYER
- regpathname = get_path("registry");
- localregpathname = regpathname;
-#else
-#ifdef XINE_MAJOR
- localregpathname = (char *)malloc(strlen(xine_get_homedir()) + 21);
- sprintf(localregpathname, "%s/.xine/win32registry", xine_get_homedir());
-#else
- // regpathname is an external pointer
- //
- // registry.c is holding it's own internal pointer
- // localregpathname - which is being allocate/deallocated
-
- if (localregpathname == 0)
- {
- const char* pthn = regpathname;
- if (!regpathname)
- {
- // avifile - for now reading data from user's home
- struct passwd* pwent;
- pwent = getpwuid(geteuid());
- pthn = pwent->pw_dir;
- }
-
- localregpathname = (char*)malloc(strlen(pthn)+20);
- strcpy(localregpathname, pthn);
- strcat(localregpathname, "/.registry");
- }
-#endif
-#endif
+ localregpathname = malloc(strlen(xdg_cache_home) + sizeof("/"PACKAGE"/win32registry"));
+ strcpy(localregpathname, xdg_cache_home);
+ strcat(localregpathname, "/"PACKAGE"/win32registry");
open_registry();
insert_handle(HKEY_LOCAL_MACHINE, "HKLM");
insert_handle(HKEY_CURRENT_USER, "HKCU");
+
+ xdgFreeHandle(tmph);
}
#if 0
diff --git a/src/libw32dll/wine/windef.h b/src/libw32dll/wine/windef.h
index e7f691a02..b86f2f740 100644
--- a/src/libw32dll/wine/windef.h
+++ b/src/libw32dll/wine/windef.h
@@ -7,8 +7,9 @@
#ifndef __WINE_WINDEF_H
#define __WINE_WINDEF_H
+#include "config.h"
+
#ifdef __WINE__
-# include "config.h"
# undef UNICODE
#endif
@@ -493,14 +494,14 @@ typedef LRESULT CALLBACK (*WNDPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
/* Macro for structure packing. */
+#define WINE_PACKED XINE_PACKED
+
#if defined(__GNUC__) || defined(__ICC)
#ifndef _EGCS_
-#define WINE_PACKED __attribute__((packed))
#define WINE_UNUSED __attribute__((unused))
#define WINE_NORETURN __attribute__((noreturn))
#endif
#else
-#define WINE_PACKED /* nothing */
#define WINE_UNUSED /* nothing */
#define WINE_NORETURN /* nothing */
#endif
diff --git a/src/libxineadec/Makefile.am b/src/libxineadec/Makefile.am
index b2ffcf078..0680f8196 100644
--- a/src/libxineadec/Makefile.am
+++ b/src/libxineadec/Makefile.am
@@ -1,42 +1,84 @@
include $(top_srcdir)/misc/Makefile.common
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_LDFLAGS = $(xineplug_ldflags)
+
EXTRA_DIST = fooaudio.c
-SUBDIRS = gsm610 nosefart
+if ENABLE_MUSEPACK
+musepack_module = xineplug_decode_mpc.la
+endif
-AM_LDFLAGS = $(xineplug_ldflags)
+if ENABLE_DTS
+dts_module = xineplug_decode_dts.la
+endif
-if HAVE_VORBIS
-vorbis_module = xineplug_decode_vorbis.la
+if ENABLE_MAD
+mad_module = xineplug_decode_mad.la
endif
-if HAVE_SPEEX
-speex_module = xineplug_decode_speex.la
+if ENABLE_A52DEC
+a52_module = xineplug_decode_a52.la
endif
+if ENABLE_FAAD
+faad_module = xineplug_decode_faad.la
+endif
+
+$(top_builddir)/contrib/a52dec/liba52.la:
+ $(MAKE) -C $(top_builddir)/contrib/a52dec
+
+$(top_builddir)/contrib/libfaad/libfaad.la:
+ $(MAKE) -C $(top_builddir)/contrib/libfaad
+
+$(top_builddir)/contrib/libmad/libmad.la:
+ $(MAKE) -C $(top_builddir)/contrib/libmad
+
+$(top_builddir)/contrib/libmpcdec/libmpcdec.la:
+ $(MAKE) -C $(top_builddir)/contrib/libmpcdec
+
+$(top_builddir)/contrib/libdca/libdca.la:
+ $(MAKE) -C $(top_builddir)/contrib/libdca
+
+$(top_builddir)/contrib/gsm610/libgsm610.la:
+ $(MAKE) -C $(top_builddir)/contrib/gsm610
+
xineplug_LTLIBRARIES = \
xineplug_decode_gsm610.la \
- xineplug_decode_nsf.la \
xineplug_decode_lpcm.la \
- $(vorbis_module) \
- $(speex_module)
+ $(musepack_module) \
+ $(dts_module) \
+ $(mad_module) \
+ $(a52_module) \
+ $(faad_module)
xineplug_decode_gsm610_la_SOURCES = gsm610.c
-xineplug_decode_gsm610_la_CFLAGS = $(VISIBILITY_FLAG)
-xineplug_decode_gsm610_la_LIBADD = $(XINE_LIB) gsm610/libgsm610.la
-
-xineplug_decode_nsf_la_SOURCES = nsf.c
-xineplug_decode_nsf_la_CFLAGS = $(VISIBILITY_FLAG) -DNSF_PLAYER -fno-strict-aliasing
-xineplug_decode_nsf_la_LIBADD = $(XINE_LIB) -lm nosefart/libnosefart.la
+xineplug_decode_gsm610_la_LIBADD = $(XINE_LIB) $(top_builddir)/contrib/gsm610/libgsm610.la
+xineplug_decode_gsm610_la_CPPFLAGS = -I$(top_srcdir)/contrib/gsm610
xineplug_decode_lpcm_la_SOURCES = xine_lpcm_decoder.c
-xineplug_decode_lpcm_la_CFLAGS = $(VISIBILITY_FLAG)
xineplug_decode_lpcm_la_LIBADD = $(XINE_LIB)
-xineplug_decode_vorbis_la_SOURCES = xine_vorbis_decoder.c
-xineplug_decode_vorbis_la_LIBADD = $(XINE_LIB) $(VORBIS_LIBS) $(OGG_LIBS)
-xineplug_decode_vorbis_la_CFLAGS = $(VISIBILITY_FLAG) $(VORBIS_CFLAGS)
+xineplug_decode_mpc_la_SOURCES = xine_musepack_decoder.c
+xineplug_decode_mpc_la_DEPENDENCIES = $(MPCDEC_DEPS)
+xineplug_decode_mpc_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) $(MPCDEC_LIBS)
+xineplug_decode_mpc_la_CFLAGS = $(AM_CFLAGS) $(MPCDEC_CFLAGS)
+
+xineplug_decode_dts_la_SOURCES = xine_dts_decoder.c
+xineplug_decode_dts_la_DEPENDENCIES = $(LIBDTS_DEPS)
+xineplug_decode_dts_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) $(LIBDTS_LIBS)
+xineplug_decode_dts_la_CFLAGS = $(AM_CFLAGS) $(LIBDTS_CFLAGS)
+
+xineplug_decode_mad_la_SOURCES = xine_mad_decoder.c
+xineplug_decode_mad_la_DEPENDENCIES = $(LIBMAD_DEPS)
+xineplug_decode_mad_la_LIBADD = $(XINE_LIB) $(LIBMAD_LIBS)
+xineplug_decode_mad_la_CFLAGS = $(AM_CFLAGS) $(LIBMAD_CFLAGS)
+
+xineplug_decode_a52_la_SOURCES = xine_a52_decoder.c
+xineplug_decode_a52_la_DEPENDENCIES = $(A52DEC_DEPS)
+xineplug_decode_a52_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) $(A52DEC_LIBS) -lm
+xineplug_decode_a52_la_CFLAGS = $(AM_CFLAGS) $(A52DEC_CFLAGS)
-xineplug_decode_speex_la_SOURCES = xine_speex_decoder.c
-xineplug_decode_speex_la_LIBADD = $(XINE_LIB) $(SPEEX_LIBS)
-xineplug_decode_speex_la_CFLAGS = $(VISIBILITY_FLAGS) $(SPEEX_CFLAGS)
+xineplug_decode_faad_la_SOURCES = xine_faad_decoder.c
+xineplug_decode_faad_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) $(top_builddir)/contrib/libfaad/libfaad.la -lm
+xineplug_decode_faad_la_CPPFLAGS = -I$(top_srcdir)/contrib/libfaad
diff --git a/src/libxineadec/gsm610.c b/src/libxineadec/gsm610.c
index 700d1ee4d..d26dc54ad 100644
--- a/src/libxineadec/gsm610.c
+++ b/src/libxineadec/gsm610.c
@@ -61,8 +61,8 @@
#include "xineutils.h"
#include "bswap.h"
-#include "gsm610/private.h"
-#include "gsm610/gsm.h"
+#include "private.h"
+#include "gsm.h"
#define AUDIOBUFSIZE 128*1024
@@ -86,7 +86,6 @@ typedef struct gsm610_decoder_s {
int bufsize;
int size;
- unsigned short decode_buffer[GSM610_BLOCK_SIZE];
gsm gsm_state;
} gsm610_decoder_t;
@@ -138,6 +137,7 @@ static void gsm610_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
this->size += buf->size;
if (buf->decoder_flags & BUF_FLAG_FRAME_END) { /* time to decode a frame */
+ int16_t decode_buffer[GSM610_BLOCK_SIZE];
/* handle the Microsoft variant of GSM data */
if (this->buf_type == BUF_AUDIO_MSGSM) {
@@ -154,7 +154,7 @@ static void gsm610_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
in_ptr = 0;
while (this->size) {
- gsm_decode(this->gsm_state, &this->buf[in_ptr], this->decode_buffer);
+ gsm_decode(this->gsm_state, &this->buf[in_ptr], decode_buffer);
if ((in_ptr % 65) == 0) {
in_ptr += 33;
this->size -= 33;
@@ -167,7 +167,7 @@ static void gsm610_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
* always contain at least 160 samples */
audio_buffer = this->stream->audio_out->get_buffer (this->stream->audio_out);
- xine_fast_memcpy(audio_buffer->mem, this->decode_buffer,
+ xine_fast_memcpy(audio_buffer->mem, decode_buffer,
GSM610_BLOCK_SIZE * 2);
audio_buffer->num_frames = GSM610_BLOCK_SIZE;
@@ -189,7 +189,7 @@ static void gsm610_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
in_ptr = 0;
while (this->size) {
- gsm_decode(this->gsm_state, &this->buf[in_ptr], this->decode_buffer);
+ gsm_decode(this->gsm_state, &this->buf[in_ptr], decode_buffer);
in_ptr += 33;
this->size -= 33;
@@ -197,7 +197,7 @@ static void gsm610_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
* always contain at least 160 samples */
audio_buffer = this->stream->audio_out->get_buffer (this->stream->audio_out);
- xine_fast_memcpy(audio_buffer->mem, this->decode_buffer,
+ xine_fast_memcpy(audio_buffer->mem, decode_buffer,
GSM610_BLOCK_SIZE * 2);
audio_buffer->num_frames = GSM610_BLOCK_SIZE;
diff --git a/src/libxineadec/gsm610/Makefile.am b/src/libxineadec/gsm610/Makefile.am
deleted file mode 100644
index fe25ad9c3..000000000
--- a/src/libxineadec/gsm610/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-noinst_LTLIBRARIES = libgsm610.la
-
-libgsm610_la_SOURCES = \
- add.c \
- decode.c \
- gsm_create.c \
- gsm_decode.c \
- gsm_destroy.c \
- long_term.c \
- lpc.c \
- rpe.c \
- short_term.c \
- table.c
-
-libgsm610_la_CFLAGS = $(VISIBILITY_FLAG)
-libgsm610_la_LDFLAGS = -avoid-version -module
-
-noinst_HEADERS = \
- gsm_config.h \
- gsm.h \
- private.h \
- proto.h \
- unproto.h
diff --git a/src/libxineadec/gsm610/add.c b/src/libxineadec/gsm610/add.c
deleted file mode 100644
index cd4b5dd3b..000000000
--- a/src/libxineadec/gsm610/add.c
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
- * Universitaet Berlin. See the accompanying file "COPYRIGHT" for
- * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
- */
-
-/* $Header: /nfshome/cvs/xine-lib/src/libxineadec/gsm610/add.c,v 1.1 2002/10/12 19:12:49 tmmm Exp $ */
-
-/*
- * See private.h for the more commonly used macro versions.
- */
-
-#include <stdio.h>
-#include <assert.h>
-
-#include "private.h"
-#include "gsm.h"
-#include "proto.h"
-
-#define saturate(x) \
- ((x) < MIN_WORD ? MIN_WORD : (x) > MAX_WORD ? MAX_WORD: (x))
-
-word gsm_add P2((a,b), word a, word b)
-{
- longword sum = (longword)a + (longword)b;
- return saturate(sum);
-}
-
-word gsm_sub P2((a,b), word a, word b)
-{
- longword diff = (longword)a - (longword)b;
- return saturate(diff);
-}
-
-word gsm_mult P2((a,b), word a, word b)
-{
- if (a == MIN_WORD && b == MIN_WORD) return MAX_WORD;
- else return SASR( (longword)a * (longword)b, 15 );
-}
-
-word gsm_mult_r P2((a,b), word a, word b)
-{
- if (b == MIN_WORD && a == MIN_WORD) return MAX_WORD;
- else {
- longword prod = (longword)a * (longword)b + 16384;
- prod >>= 15;
- return prod & 0xFFFF;
- }
-}
-
-word gsm_abs P1((a), word a)
-{
- return a < 0 ? (a == MIN_WORD ? MAX_WORD : -a) : a;
-}
-
-longword gsm_L_mult P2((a,b),word a, word b)
-{
- assert( a != MIN_WORD || b != MIN_WORD );
- return ((longword)a * (longword)b) << 1;
-}
-
-longword gsm_L_add P2((a,b), longword a, longword b)
-{
- if (a < 0) {
- if (b >= 0) return a + b;
- else {
- ulongword A = (ulongword)-(a + 1) + (ulongword)-(b + 1);
- return A >= MAX_LONGWORD ? MIN_LONGWORD :-(longword)A-2;
- }
- }
- else if (b <= 0) return a + b;
- else {
- ulongword A = (ulongword)a + (ulongword)b;
- return A > MAX_LONGWORD ? MAX_LONGWORD : A;
- }
-}
-
-longword gsm_L_sub P2((a,b), longword a, longword b)
-{
- if (a >= 0) {
- if (b >= 0) return a - b;
- else {
- /* a>=0, b<0 */
-
- ulongword A = (ulongword)a + -(b + 1);
- return A >= MAX_LONGWORD ? MAX_LONGWORD : (A + 1);
- }
- }
- else if (b <= 0) return a - b;
- else {
- /* a<0, b>0 */
-
- ulongword A = (ulongword)-(a + 1) + b;
- return A >= MAX_LONGWORD ? MIN_LONGWORD : -(longword)A - 1;
- }
-}
-
-static unsigned char const bitoff[ 256 ] = {
- 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-};
-
-word gsm_norm P1((a), longword a )
-/*
- * the number of left shifts needed to normalize the 32 bit
- * variable L_var1 for positive values on the interval
- *
- * with minimum of
- * minimum of 1073741824 (01000000000000000000000000000000) and
- * maximum of 2147483647 (01111111111111111111111111111111)
- *
- *
- * and for negative values on the interval with
- * minimum of -2147483648 (-10000000000000000000000000000000) and
- * maximum of -1073741824 ( -1000000000000000000000000000000).
- *
- * in order to normalize the result, the following
- * operation must be done: L_norm_var1 = L_var1 << norm( L_var1 );
- *
- * (That's 'ffs', only from the left, not the right..)
- */
-{
- assert(a != 0);
-
- if (a < 0) {
- if (a <= -1073741824) return 0;
- a = ~a;
- }
-
- return a & 0xffff0000
- ? ( a & 0xff000000
- ? -1 + bitoff[ 0xFF & (a >> 24) ]
- : 7 + bitoff[ 0xFF & (a >> 16) ] )
- : ( a & 0xff00
- ? 15 + bitoff[ 0xFF & (a >> 8) ]
- : 23 + bitoff[ 0xFF & a ] );
-}
-
-longword gsm_L_asl P2((a,n), longword a, int n)
-{
- if (n >= 32) return 0;
- if (n <= -32) return -(a < 0);
- if (n < 0) return gsm_L_asr(a, -n);
- return a << n;
-}
-
-word gsm_asl P2((a,n), word a, int n)
-{
- if (n >= 16) return 0;
- if (n <= -16) return -(a < 0);
- if (n < 0) return gsm_asr(a, -n);
- return a << n;
-}
-
-longword gsm_L_asr P2((a,n), longword a, int n)
-{
- if (n >= 32) return -(a < 0);
- if (n <= -32) return 0;
- if (n < 0) return a << -n;
-
-# ifdef SASR
- return a >> n;
-# else
- if (a >= 0) return a >> n;
- else return -(longword)( -(ulongword)a >> n );
-# endif
-}
-
-word gsm_asr P2((a,n), word a, int n)
-{
- if (n >= 16) return -(a < 0);
- if (n <= -16) return 0;
- if (n < 0) return a << -n;
-
-# ifdef SASR
- return a >> n;
-# else
- if (a >= 0) return a >> n;
- else return -(word)( -(uword)a >> n );
-# endif
-}
-
-/*
- * (From p. 46, end of section 4.2.5)
- *
- * NOTE: The following lines gives [sic] one correct implementation
- * of the div(num, denum) arithmetic operation. Compute div
- * which is the integer division of num by denum: with denum
- * >= num > 0
- */
-
-word gsm_div P2((num,denum), word num, word denum)
-{
- longword L_num = num;
- longword L_denum = denum;
- word div = 0;
- int k = 15;
-
- /* The parameter num sometimes becomes zero.
- * Although this is explicitly guarded against in 4.2.5,
- * we assume that the result should then be zero as well.
- */
-
- /* assert(num != 0); */
-
- assert(num >= 0 && denum >= num);
- if (num == 0)
- return 0;
-
- while (k--) {
- div <<= 1;
- L_num <<= 1;
-
- if (L_num >= L_denum) {
- L_num -= L_denum;
- div++;
- }
- }
-
- return div;
-}
diff --git a/src/libxineadec/gsm610/decode.c b/src/libxineadec/gsm610/decode.c
deleted file mode 100644
index 66dcab665..000000000
--- a/src/libxineadec/gsm610/decode.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
- * Universitaet Berlin. See the accompanying file "COPYRIGHT" for
- * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
- */
-
-/* $Header: /nfshome/cvs/xine-lib/src/libxineadec/gsm610/decode.c,v 1.1 2002/10/12 19:12:49 tmmm Exp $ */
-
-#include <stdio.h>
-
-#include "private.h"
-#include "gsm.h"
-#include "proto.h"
-
-/*
- * 4.3 FIXED POINT IMPLEMENTATION OF THE RPE-LTP DECODER
- */
-
-static void Postprocessing P2((S,s),
- struct gsm_state * S,
- register word * s)
-{
- register int k;
- register word msr = S->msr;
- register longword ltmp; /* for GSM_ADD */
- register word tmp;
-
- for (k = 160; k--; s++) {
- tmp = GSM_MULT_R( msr, 28180 );
- msr = GSM_ADD(*s, tmp); /* Deemphasis */
- *s = GSM_ADD(msr, msr) & 0xFFF8; /* Truncation & Upscaling */
- }
- S->msr = msr;
-}
-
-void Gsm_Decoder P8((S,LARcr, Ncr,bcr,Mcr,xmaxcr,xMcr,s),
- struct gsm_state * S,
-
- word * LARcr, /* [0..7] IN */
-
- word * Ncr, /* [0..3] IN */
- word * bcr, /* [0..3] IN */
- word * Mcr, /* [0..3] IN */
- word * xmaxcr, /* [0..3] IN */
- word * xMcr, /* [0..13*4] IN */
-
- word * s) /* [0..159] OUT */
-{
- int j, k;
- word erp[40], wt[160];
- word * drp = S->dp0 + 120;
-
- for (j=0; j <= 3; j++, xmaxcr++, bcr++, Ncr++, Mcr++, xMcr += 13) {
-
- Gsm_RPE_Decoding( S, *xmaxcr, *Mcr, xMcr, erp );
- Gsm_Long_Term_Synthesis_Filtering( S, *Ncr, *bcr, erp, drp );
-
- for (k = 0; k <= 39; k++) wt[ j * 40 + k ] = drp[ k ];
- }
-
- Gsm_Short_Term_Synthesis_Filter( S, LARcr, wt, s );
- Postprocessing(S, s);
-}
diff --git a/src/libxineadec/gsm610/gsm.h b/src/libxineadec/gsm610/gsm.h
deleted file mode 100644
index 34ad8f7a5..000000000
--- a/src/libxineadec/gsm610/gsm.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
- * Universitaet Berlin. See the accompanying file "COPYRIGHT" for
- * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
- */
-
-/*$Header: /nfshome/cvs/xine-lib/src/libxineadec/gsm610/gsm.h,v 1.1 2002/10/12 19:12:49 tmmm Exp $*/
-
-#ifndef GSM_H
-#define GSM_H
-
-#ifdef __cplusplus
-# define NeedFunctionPrototypes 1
-#endif
-
-#if __STDC__
-# define NeedFunctionPrototypes 1
-#endif
-
-#ifdef _NO_PROTO
-# undef NeedFunctionPrototypes
-#endif
-
-#ifdef NeedFunctionPrototypes
-# include <stdio.h> /* for FILE * */
-#endif
-
-#undef GSM_P
-#if NeedFunctionPrototypes
-# define GSM_P( protos ) protos
-#else
-# define GSM_P( protos ) ( /* protos */ )
-#endif
-
-/*
- * Interface
- */
-
-typedef struct gsm_state * gsm;
-typedef short gsm_signal; /* signed 16 bit */
-typedef unsigned char gsm_byte;
-typedef gsm_byte gsm_frame[33]; /* 33 * 8 bits */
-
-#define GSM_MAGIC 0xD /* 13 kbit/s RPE-LTP */
-
-#define GSM_PATCHLEVEL 10
-#define GSM_MINOR 0
-#define GSM_MAJOR 1
-
-#define GSM_OPT_VERBOSE 1
-#define GSM_OPT_FAST 2
-#define GSM_OPT_LTP_CUT 3
-#define GSM_OPT_WAV49 4
-#define GSM_OPT_FRAME_INDEX 5
-#define GSM_OPT_FRAME_CHAIN 6
-
-extern gsm gsm_create GSM_P((void));
-extern void gsm_destroy GSM_P((gsm));
-
-extern int gsm_print GSM_P((FILE *, gsm, gsm_byte *));
-extern int gsm_option GSM_P((gsm, int, int *));
-
-extern void gsm_encode GSM_P((gsm, gsm_signal *, gsm_byte *));
-extern int gsm_decode GSM_P((gsm, gsm_byte *, gsm_signal *));
-
-extern int gsm_explode GSM_P((gsm, gsm_byte *, gsm_signal *));
-extern void gsm_implode GSM_P((gsm, gsm_signal *, gsm_byte *));
-
-#undef GSM_P
-
-#endif /* GSM_H */
diff --git a/src/libxineadec/gsm610/gsm_config.h b/src/libxineadec/gsm610/gsm_config.h
deleted file mode 100644
index a40004221..000000000
--- a/src/libxineadec/gsm610/gsm_config.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
- * Universitaet Berlin. See the accompanying file "COPYRIGHT" for
- * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
- */
-
-/*$Header: /nfshome/cvs/xine-lib/src/libxineadec/gsm610/gsm_config.h,v 1.2 2004/05/12 16:21:41 mroi Exp $*/
-
-#ifndef CONFIG_H
-#define CONFIG_H
-
-/*efine SIGHANDLER_T int / * signal handlers are void */
-/*efine HAS_SYSV_SIGNAL 1 / * sigs not blocked/reset? */
-
-#define HAS_STDLIB_H 1 /* /usr/include/stdlib.h */
-/*efine HAS_LIMITS_H 1 / * /usr/include/limits.h */
-#define HAS_FCNTL_H 1 /* /usr/include/fcntl.h */
-/*efine HAS_ERRNO_DECL 1 / * errno.h declares errno */
-
-#define HAS_FSTAT 1 /* fstat syscall */
-#define HAS_FCHMOD 1 /* fchmod syscall */
-#define HAS_CHMOD 1 /* chmod syscall */
-#define HAS_FCHOWN 1 /* fchown syscall */
-#define HAS_CHOWN 1 /* chown syscall */
-/*efine HAS__FSETMODE 1 / * _fsetmode -- set file mode */
-
-#define HAS_STRING_H 1 /* /usr/include/string.h */
-/*efine HAS_STRINGS_H 1 / * /usr/include/strings.h */
-
-#define HAS_UNISTD_H 1 /* /usr/include/unistd.h */
-#define HAS_UTIME 1 /* POSIX utime(path, times) */
-/*efine HAS_UTIMES 1 / * use utimes() syscall instead */
-#define HAS_UTIME_H 1 /* UTIME header file */
-/*efine HAS_UTIMBUF 1 / * struct utimbuf */
-/*efine HAS_UTIMEUSEC 1 / * microseconds in utimbuf? */
-
-#endif /* CONFIG_H */
diff --git a/src/libxineadec/gsm610/gsm_create.c b/src/libxineadec/gsm610/gsm_create.c
deleted file mode 100644
index df80758f0..000000000
--- a/src/libxineadec/gsm610/gsm_create.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
- * Universitaet Berlin. See the accompanying file "COPYRIGHT" for
- * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
- */
-
-static char const ident[] = "$Header: /nfshome/cvs/xine-lib/src/libxineadec/gsm610/gsm_create.c,v 1.1 2002/10/12 19:12:49 tmmm Exp $";
-
-#include "gsm_config.h"
-
-#ifdef HAS_STRING_H
-#include <string.h>
-#else
-# include "proto.h"
- extern char * memset P((char *, int, int));
-#endif
-
-#ifdef HAS_STDLIB_H
-# include <stdlib.h>
-#else
-# ifdef HAS_MALLOC_H
-# include <malloc.h>
-# else
- extern char * malloc();
-# endif
-#endif
-
-#include <stdio.h>
-
-#include "gsm.h"
-#include "private.h"
-#include "proto.h"
-
-gsm gsm_create P0()
-{
- gsm r;
-
- r = (gsm)malloc(sizeof(struct gsm_state));
- if (!r) return r;
-
- memset((char *)r, 0, sizeof(*r));
- r->nrp = 40;
-
- return r;
-}
diff --git a/src/libxineadec/gsm610/gsm_decode.c b/src/libxineadec/gsm610/gsm_decode.c
deleted file mode 100644
index 849818c14..000000000
--- a/src/libxineadec/gsm610/gsm_decode.c
+++ /dev/null
@@ -1,359 +0,0 @@
-/*
- * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
- * Universitaet Berlin. See the accompanying file "COPYRIGHT" for
- * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
- */
-
-/* $Header: /nfshome/cvs/xine-lib/src/libxineadec/gsm610/gsm_decode.c,v 1.1 2002/10/12 19:12:49 tmmm Exp $ */
-
-#include "private.h"
-
-#include "gsm.h"
-#include "proto.h"
-
-int gsm_decode P3((s, c, target), gsm s, gsm_byte * c, gsm_signal * target)
-{
- word LARc[8], Nc[4], Mc[4], bc[4], xmaxc[4], xmc[13*4];
-
- if (s->wav_fmt) {
-
- uword sr = 0;
-
- s->frame_index = !s->frame_index;
- if (s->frame_index) {
-
- sr = *c++;
- LARc[0] = sr & 0x3f; sr >>= 6;
- sr |= (uword)*c++ << 2;
- LARc[1] = sr & 0x3f; sr >>= 6;
- sr |= (uword)*c++ << 4;
- LARc[2] = sr & 0x1f; sr >>= 5;
- LARc[3] = sr & 0x1f; sr >>= 5;
- sr |= (uword)*c++ << 2;
- LARc[4] = sr & 0xf; sr >>= 4;
- LARc[5] = sr & 0xf; sr >>= 4;
- sr |= (uword)*c++ << 2; /* 5 */
- LARc[6] = sr & 0x7; sr >>= 3;
- LARc[7] = sr & 0x7; sr >>= 3;
- sr |= (uword)*c++ << 4;
- Nc[0] = sr & 0x7f; sr >>= 7;
- bc[0] = sr & 0x3; sr >>= 2;
- Mc[0] = sr & 0x3; sr >>= 2;
- sr |= (uword)*c++ << 1;
- xmaxc[0] = sr & 0x3f; sr >>= 6;
- xmc[0] = sr & 0x7; sr >>= 3;
- sr = *c++;
- xmc[1] = sr & 0x7; sr >>= 3;
- xmc[2] = sr & 0x7; sr >>= 3;
- sr |= (uword)*c++ << 2;
- xmc[3] = sr & 0x7; sr >>= 3;
- xmc[4] = sr & 0x7; sr >>= 3;
- xmc[5] = sr & 0x7; sr >>= 3;
- sr |= (uword)*c++ << 1; /* 10 */
- xmc[6] = sr & 0x7; sr >>= 3;
- xmc[7] = sr & 0x7; sr >>= 3;
- xmc[8] = sr & 0x7; sr >>= 3;
- sr = *c++;
- xmc[9] = sr & 0x7; sr >>= 3;
- xmc[10] = sr & 0x7; sr >>= 3;
- sr |= (uword)*c++ << 2;
- xmc[11] = sr & 0x7; sr >>= 3;
- xmc[12] = sr & 0x7; sr >>= 3;
- sr |= (uword)*c++ << 4;
- Nc[1] = sr & 0x7f; sr >>= 7;
- bc[1] = sr & 0x3; sr >>= 2;
- Mc[1] = sr & 0x3; sr >>= 2;
- sr |= (uword)*c++ << 1;
- xmaxc[1] = sr & 0x3f; sr >>= 6;
- xmc[13] = sr & 0x7; sr >>= 3;
- sr = *c++; /* 15 */
- xmc[14] = sr & 0x7; sr >>= 3;
- xmc[15] = sr & 0x7; sr >>= 3;
- sr |= (uword)*c++ << 2;
- xmc[16] = sr & 0x7; sr >>= 3;
- xmc[17] = sr & 0x7; sr >>= 3;
- xmc[18] = sr & 0x7; sr >>= 3;
- sr |= (uword)*c++ << 1;
- xmc[19] = sr & 0x7; sr >>= 3;
- xmc[20] = sr & 0x7; sr >>= 3;
- xmc[21] = sr & 0x7; sr >>= 3;
- sr = *c++;
- xmc[22] = sr & 0x7; sr >>= 3;
- xmc[23] = sr & 0x7; sr >>= 3;
- sr |= (uword)*c++ << 2;
- xmc[24] = sr & 0x7; sr >>= 3;
- xmc[25] = sr & 0x7; sr >>= 3;
- sr |= (uword)*c++ << 4; /* 20 */
- Nc[2] = sr & 0x7f; sr >>= 7;
- bc[2] = sr & 0x3; sr >>= 2;
- Mc[2] = sr & 0x3; sr >>= 2;
- sr |= (uword)*c++ << 1;
- xmaxc[2] = sr & 0x3f; sr >>= 6;
- xmc[26] = sr & 0x7; sr >>= 3;
- sr = *c++;
- xmc[27] = sr & 0x7; sr >>= 3;
- xmc[28] = sr & 0x7; sr >>= 3;
- sr |= (uword)*c++ << 2;
- xmc[29] = sr & 0x7; sr >>= 3;
- xmc[30] = sr & 0x7; sr >>= 3;
- xmc[31] = sr & 0x7; sr >>= 3;
- sr |= (uword)*c++ << 1;
- xmc[32] = sr & 0x7; sr >>= 3;
- xmc[33] = sr & 0x7; sr >>= 3;
- xmc[34] = sr & 0x7; sr >>= 3;
- sr = *c++; /* 25 */
- xmc[35] = sr & 0x7; sr >>= 3;
- xmc[36] = sr & 0x7; sr >>= 3;
- sr |= (uword)*c++ << 2;
- xmc[37] = sr & 0x7; sr >>= 3;
- xmc[38] = sr & 0x7; sr >>= 3;
- sr |= (uword)*c++ << 4;
- Nc[3] = sr & 0x7f; sr >>= 7;
- bc[3] = sr & 0x3; sr >>= 2;
- Mc[3] = sr & 0x3; sr >>= 2;
- sr |= (uword)*c++ << 1;
- xmaxc[3] = sr & 0x3f; sr >>= 6;
- xmc[39] = sr & 0x7; sr >>= 3;
- sr = *c++;
- xmc[40] = sr & 0x7; sr >>= 3;
- xmc[41] = sr & 0x7; sr >>= 3;
- sr |= (uword)*c++ << 2; /* 30 */
- xmc[42] = sr & 0x7; sr >>= 3;
- xmc[43] = sr & 0x7; sr >>= 3;
- xmc[44] = sr & 0x7; sr >>= 3;
- sr |= (uword)*c++ << 1;
- xmc[45] = sr & 0x7; sr >>= 3;
- xmc[46] = sr & 0x7; sr >>= 3;
- xmc[47] = sr & 0x7; sr >>= 3;
- sr = *c++;
- xmc[48] = sr & 0x7; sr >>= 3;
- xmc[49] = sr & 0x7; sr >>= 3;
- sr |= (uword)*c++ << 2;
- xmc[50] = sr & 0x7; sr >>= 3;
- xmc[51] = sr & 0x7; sr >>= 3;
-
- s->frame_chain = sr & 0xf;
- }
- else {
- sr = s->frame_chain;
- sr |= (uword)*c++ << 4; /* 1 */
- LARc[0] = sr & 0x3f; sr >>= 6;
- LARc[1] = sr & 0x3f; sr >>= 6;
- sr = *c++;
- LARc[2] = sr & 0x1f; sr >>= 5;
- sr |= (uword)*c++ << 3;
- LARc[3] = sr & 0x1f; sr >>= 5;
- LARc[4] = sr & 0xf; sr >>= 4;
- sr |= (uword)*c++ << 2;
- LARc[5] = sr & 0xf; sr >>= 4;
- LARc[6] = sr & 0x7; sr >>= 3;
- LARc[7] = sr & 0x7; sr >>= 3;
- sr = *c++; /* 5 */
- Nc[0] = sr & 0x7f; sr >>= 7;
- sr |= (uword)*c++ << 1;
- bc[0] = sr & 0x3; sr >>= 2;
- Mc[0] = sr & 0x3; sr >>= 2;
- sr |= (uword)*c++ << 5;
- xmaxc[0] = sr & 0x3f; sr >>= 6;
- xmc[0] = sr & 0x7; sr >>= 3;
- xmc[1] = sr & 0x7; sr >>= 3;
- sr |= (uword)*c++ << 1;
- xmc[2] = sr & 0x7; sr >>= 3;
- xmc[3] = sr & 0x7; sr >>= 3;
- xmc[4] = sr & 0x7; sr >>= 3;
- sr = *c++;
- xmc[5] = sr & 0x7; sr >>= 3;
- xmc[6] = sr & 0x7; sr >>= 3;
- sr |= (uword)*c++ << 2; /* 10 */
- xmc[7] = sr & 0x7; sr >>= 3;
- xmc[8] = sr & 0x7; sr >>= 3;
- xmc[9] = sr & 0x7; sr >>= 3;
- sr |= (uword)*c++ << 1;
- xmc[10] = sr & 0x7; sr >>= 3;
- xmc[11] = sr & 0x7; sr >>= 3;
- xmc[12] = sr & 0x7; sr >>= 3;
- sr = *c++;
- Nc[1] = sr & 0x7f; sr >>= 7;
- sr |= (uword)*c++ << 1;
- bc[1] = sr & 0x3; sr >>= 2;
- Mc[1] = sr & 0x3; sr >>= 2;
- sr |= (uword)*c++ << 5;
- xmaxc[1] = sr & 0x3f; sr >>= 6;
- xmc[13] = sr & 0x7; sr >>= 3;
- xmc[14] = sr & 0x7; sr >>= 3;
- sr |= (uword)*c++ << 1; /* 15 */
- xmc[15] = sr & 0x7; sr >>= 3;
- xmc[16] = sr & 0x7; sr >>= 3;
- xmc[17] = sr & 0x7; sr >>= 3;
- sr = *c++;
- xmc[18] = sr & 0x7; sr >>= 3;
- xmc[19] = sr & 0x7; sr >>= 3;
- sr |= (uword)*c++ << 2;
- xmc[20] = sr & 0x7; sr >>= 3;
- xmc[21] = sr & 0x7; sr >>= 3;
- xmc[22] = sr & 0x7; sr >>= 3;
- sr |= (uword)*c++ << 1;
- xmc[23] = sr & 0x7; sr >>= 3;
- xmc[24] = sr & 0x7; sr >>= 3;
- xmc[25] = sr & 0x7; sr >>= 3;
- sr = *c++;
- Nc[2] = sr & 0x7f; sr >>= 7;
- sr |= (uword)*c++ << 1; /* 20 */
- bc[2] = sr & 0x3; sr >>= 2;
- Mc[2] = sr & 0x3; sr >>= 2;
- sr |= (uword)*c++ << 5;
- xmaxc[2] = sr & 0x3f; sr >>= 6;
- xmc[26] = sr & 0x7; sr >>= 3;
- xmc[27] = sr & 0x7; sr >>= 3;
- sr |= (uword)*c++ << 1;
- xmc[28] = sr & 0x7; sr >>= 3;
- xmc[29] = sr & 0x7; sr >>= 3;
- xmc[30] = sr & 0x7; sr >>= 3;
- sr = *c++;
- xmc[31] = sr & 0x7; sr >>= 3;
- xmc[32] = sr & 0x7; sr >>= 3;
- sr |= (uword)*c++ << 2;
- xmc[33] = sr & 0x7; sr >>= 3;
- xmc[34] = sr & 0x7; sr >>= 3;
- xmc[35] = sr & 0x7; sr >>= 3;
- sr |= (uword)*c++ << 1; /* 25 */
- xmc[36] = sr & 0x7; sr >>= 3;
- xmc[37] = sr & 0x7; sr >>= 3;
- xmc[38] = sr & 0x7; sr >>= 3;
- sr = *c++;
- Nc[3] = sr & 0x7f; sr >>= 7;
- sr |= (uword)*c++ << 1;
- bc[3] = sr & 0x3; sr >>= 2;
- Mc[3] = sr & 0x3; sr >>= 2;
- sr |= (uword)*c++ << 5;
- xmaxc[3] = sr & 0x3f; sr >>= 6;
- xmc[39] = sr & 0x7; sr >>= 3;
- xmc[40] = sr & 0x7; sr >>= 3;
- sr |= (uword)*c++ << 1;
- xmc[41] = sr & 0x7; sr >>= 3;
- xmc[42] = sr & 0x7; sr >>= 3;
- xmc[43] = sr & 0x7; sr >>= 3;
- sr = *c++; /* 30 */
- xmc[44] = sr & 0x7; sr >>= 3;
- xmc[45] = sr & 0x7; sr >>= 3;
- sr |= (uword)*c++ << 2;
- xmc[46] = sr & 0x7; sr >>= 3;
- xmc[47] = sr & 0x7; sr >>= 3;
- xmc[48] = sr & 0x7; sr >>= 3;
- sr |= (uword)*c++ << 1;
- xmc[49] = sr & 0x7; sr >>= 3;
- xmc[50] = sr & 0x7; sr >>= 3;
- xmc[51] = sr & 0x7; sr >>= 3;
- }
- }
- else
- {
- /* GSM_MAGIC = (*c >> 4) & 0xF; */
-
- if (((*c >> 4) & 0x0F) != GSM_MAGIC) return -1;
-
- LARc[0] = (*c++ & 0xF) << 2; /* 1 */
- LARc[0] |= (*c >> 6) & 0x3;
- LARc[1] = *c++ & 0x3F;
- LARc[2] = (*c >> 3) & 0x1F;
- LARc[3] = (*c++ & 0x7) << 2;
- LARc[3] |= (*c >> 6) & 0x3;
- LARc[4] = (*c >> 2) & 0xF;
- LARc[5] = (*c++ & 0x3) << 2;
- LARc[5] |= (*c >> 6) & 0x3;
- LARc[6] = (*c >> 3) & 0x7;
- LARc[7] = *c++ & 0x7;
- Nc[0] = (*c >> 1) & 0x7F;
- bc[0] = (*c++ & 0x1) << 1;
- bc[0] |= (*c >> 7) & 0x1;
- Mc[0] = (*c >> 5) & 0x3;
- xmaxc[0] = (*c++ & 0x1F) << 1;
- xmaxc[0] |= (*c >> 7) & 0x1;
- xmc[0] = (*c >> 4) & 0x7;
- xmc[1] = (*c >> 1) & 0x7;
- xmc[2] = (*c++ & 0x1) << 2;
- xmc[2] |= (*c >> 6) & 0x3;
- xmc[3] = (*c >> 3) & 0x7;
- xmc[4] = *c++ & 0x7;
- xmc[5] = (*c >> 5) & 0x7;
- xmc[6] = (*c >> 2) & 0x7;
- xmc[7] = (*c++ & 0x3) << 1; /* 10 */
- xmc[7] |= (*c >> 7) & 0x1;
- xmc[8] = (*c >> 4) & 0x7;
- xmc[9] = (*c >> 1) & 0x7;
- xmc[10] = (*c++ & 0x1) << 2;
- xmc[10] |= (*c >> 6) & 0x3;
- xmc[11] = (*c >> 3) & 0x7;
- xmc[12] = *c++ & 0x7;
- Nc[1] = (*c >> 1) & 0x7F;
- bc[1] = (*c++ & 0x1) << 1;
- bc[1] |= (*c >> 7) & 0x1;
- Mc[1] = (*c >> 5) & 0x3;
- xmaxc[1] = (*c++ & 0x1F) << 1;
- xmaxc[1] |= (*c >> 7) & 0x1;
- xmc[13] = (*c >> 4) & 0x7;
- xmc[14] = (*c >> 1) & 0x7;
- xmc[15] = (*c++ & 0x1) << 2;
- xmc[15] |= (*c >> 6) & 0x3;
- xmc[16] = (*c >> 3) & 0x7;
- xmc[17] = *c++ & 0x7;
- xmc[18] = (*c >> 5) & 0x7;
- xmc[19] = (*c >> 2) & 0x7;
- xmc[20] = (*c++ & 0x3) << 1;
- xmc[20] |= (*c >> 7) & 0x1;
- xmc[21] = (*c >> 4) & 0x7;
- xmc[22] = (*c >> 1) & 0x7;
- xmc[23] = (*c++ & 0x1) << 2;
- xmc[23] |= (*c >> 6) & 0x3;
- xmc[24] = (*c >> 3) & 0x7;
- xmc[25] = *c++ & 0x7;
- Nc[2] = (*c >> 1) & 0x7F;
- bc[2] = (*c++ & 0x1) << 1; /* 20 */
- bc[2] |= (*c >> 7) & 0x1;
- Mc[2] = (*c >> 5) & 0x3;
- xmaxc[2] = (*c++ & 0x1F) << 1;
- xmaxc[2] |= (*c >> 7) & 0x1;
- xmc[26] = (*c >> 4) & 0x7;
- xmc[27] = (*c >> 1) & 0x7;
- xmc[28] = (*c++ & 0x1) << 2;
- xmc[28] |= (*c >> 6) & 0x3;
- xmc[29] = (*c >> 3) & 0x7;
- xmc[30] = *c++ & 0x7;
- xmc[31] = (*c >> 5) & 0x7;
- xmc[32] = (*c >> 2) & 0x7;
- xmc[33] = (*c++ & 0x3) << 1;
- xmc[33] |= (*c >> 7) & 0x1;
- xmc[34] = (*c >> 4) & 0x7;
- xmc[35] = (*c >> 1) & 0x7;
- xmc[36] = (*c++ & 0x1) << 2;
- xmc[36] |= (*c >> 6) & 0x3;
- xmc[37] = (*c >> 3) & 0x7;
- xmc[38] = *c++ & 0x7;
- Nc[3] = (*c >> 1) & 0x7F;
- bc[3] = (*c++ & 0x1) << 1;
- bc[3] |= (*c >> 7) & 0x1;
- Mc[3] = (*c >> 5) & 0x3;
- xmaxc[3] = (*c++ & 0x1F) << 1;
- xmaxc[3] |= (*c >> 7) & 0x1;
- xmc[39] = (*c >> 4) & 0x7;
- xmc[40] = (*c >> 1) & 0x7;
- xmc[41] = (*c++ & 0x1) << 2;
- xmc[41] |= (*c >> 6) & 0x3;
- xmc[42] = (*c >> 3) & 0x7;
- xmc[43] = *c++ & 0x7; /* 30 */
- xmc[44] = (*c >> 5) & 0x7;
- xmc[45] = (*c >> 2) & 0x7;
- xmc[46] = (*c++ & 0x3) << 1;
- xmc[46] |= (*c >> 7) & 0x1;
- xmc[47] = (*c >> 4) & 0x7;
- xmc[48] = (*c >> 1) & 0x7;
- xmc[49] = (*c++ & 0x1) << 2;
- xmc[49] |= (*c >> 6) & 0x3;
- xmc[50] = (*c >> 3) & 0x7;
- xmc[51] = *c & 0x7; /* 33 */
- }
-
- Gsm_Decoder(s, LARc, Nc, bc, Mc, xmaxc, xmc, target);
-
- return 0;
-}
diff --git a/src/libxineadec/gsm610/gsm_destroy.c b/src/libxineadec/gsm610/gsm_destroy.c
deleted file mode 100644
index 481a74660..000000000
--- a/src/libxineadec/gsm610/gsm_destroy.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
- * Universitaet Berlin. See the accompanying file "COPYRIGHT" for
- * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
- */
-
-/* $Header: /nfshome/cvs/xine-lib/src/libxineadec/gsm610/gsm_destroy.c,v 1.1 2002/10/12 19:12:49 tmmm Exp $ */
-
-#include "gsm.h"
-#include "gsm_config.h"
-#include "proto.h"
-
-#ifdef HAS_STDLIB_H
-# include <stdlib.h>
-#else
-# ifdef HAS_MALLOC_H
-# include <malloc.h>
-# else
- extern void free();
-# endif
-#endif
-
-void gsm_destroy P1((S), gsm S)
-{
- if (S) free((char *)S);
-}
diff --git a/src/libxineadec/gsm610/long_term.c b/src/libxineadec/gsm610/long_term.c
deleted file mode 100644
index 625662e1f..000000000
--- a/src/libxineadec/gsm610/long_term.c
+++ /dev/null
@@ -1,960 +0,0 @@
-/*
- * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
- * Universitaet Berlin. See the accompanying file "COPYRIGHT" for
- * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
- */
-
-/* $Header: /nfshome/cvs/xine-lib/src/libxineadec/gsm610/long_term.c,v 1.3 2003/12/07 15:34:30 f1rmb Exp $ */
-
-#include <stdio.h>
-#include "xineutils.h"
-
-#include "private.h"
-
-#include "gsm.h"
-#include "proto.h"
-
-/*
- * 4.2.11 .. 4.2.12 LONG TERM PREDICTOR (LTP) SECTION
- */
-
-
-/*
- * This module computes the LTP gain (bc) and the LTP lag (Nc)
- * for the long term analysis filter. This is done by calculating a
- * maximum of the cross-correlation function between the current
- * sub-segment short term residual signal d[0..39] (output of
- * the short term analysis filter; for simplification the index
- * of this array begins at 0 and ends at 39 for each sub-segment of the
- * RPE-LTP analysis) and the previous reconstructed short term
- * residual signal dp[ -120 .. -1 ]. A dynamic scaling must be
- * performed to avoid overflow.
- */
-
- /* The next procedure exists in six versions. First two integer
- * version (if USE_FLOAT_MUL is not defined); then four floating
- * point versions, twice with proper scaling (USE_FLOAT_MUL defined),
- * once without (USE_FLOAT_MUL and FAST defined, and fast run-time
- * option used). Every pair has first a Cut version (see the -C
- * option to toast or the LTP_CUT option to gsm_option()), then the
- * uncut one. (For a detailed explanation of why this is altogether
- * a bad idea, see Henry Spencer and Geoff Collyer, ``#ifdef Considered
- * Harmful''.)
-a */
-
-#ifndef USE_FLOAT_MUL
-
-#ifdef LTP_CUT
-
-static void Cut_Calculation_of_the_LTP_parameters P5((st, d,dp,bc_out,Nc_out),
-
- struct gsm_state * st,
-
- register word * d, /* [0..39] IN */
- register word * dp, /* [-120..-1] IN */
- word * bc_out, /* OUT */
- word * Nc_out /* OUT */
-)
-{
- register int k, lambda;
- word Nc, bc;
- word wt[40];
-
- longword L_result;
- longword L_max, L_power;
- word R, S, dmax, scal, best_k;
- word ltp_cut;
-
- register word temp, wt_k;
-
- /* Search of the optimum scaling of d[0..39].
- */
- dmax = 0;
- for (k = 0; k <= 39; k++) {
- temp = d[k];
- temp = GSM_ABS( temp );
- if (temp > dmax) {
- dmax = temp;
- best_k = k;
- }
- }
- temp = 0;
- if (dmax == 0) scal = 0;
- else {
- _x_assert(dmax > 0);
- temp = gsm_norm( (longword)dmax << 16 );
- }
- if (temp > 6) scal = 0;
- else scal = 6 - temp;
-
- _x_assert(scal >= 0);
-
- /* Search for the maximum cross-correlation and coding of the LTP lag
- */
- L_max = 0;
- Nc = 40; /* index for the maximum cross-correlation */
- wt_k = SASR(d[best_k], scal);
-
- for (lambda = 40; lambda <= 120; lambda++) {
- L_result = (longword)wt_k * dp[best_k - lambda];
- if (L_result > L_max) {
- Nc = lambda;
- L_max = L_result;
- }
- }
- *Nc_out = Nc;
- L_max <<= 1;
-
- /* Rescaling of L_max
- */
- _x_assert((scal <= 100) && (scal >= -100));
- L_max = L_max >> (6 - scal); /* sub(6, scal) */
-
- _x_assert(Nc <= 120 && Nc >= 40);
-
- /* Compute the power of the reconstructed short term residual
- * signal dp[..]
- */
- L_power = 0;
- for (k = 0; k <= 39; k++) {
-
- register longword L_temp;
-
- L_temp = SASR( dp[k - Nc], 3 );
- L_power += L_temp * L_temp;
- }
- L_power <<= 1; /* from L_MULT */
-
- /* Normalization of L_max and L_power
- */
-
- if (L_max <= 0) {
- *bc_out = 0;
- return;
- }
- if (L_max >= L_power) {
- *bc_out = 3;
- return;
- }
-
- temp = gsm_norm( L_power );
-
- R = SASR( L_max << temp, 16 );
- S = SASR( L_power << temp, 16 );
-
- /* Coding of the LTP gain
- */
-
- /* Table 4.3a must be used to obtain the level DLB[i] for the
- * quantization of the LTP gain b to get the coded version bc.
- */
- for (bc = 0; bc <= 2; bc++) if (R <= gsm_mult(S, gsm_DLB[bc])) break;
- *bc_out = bc;
-}
-
-#endif /* LTP_CUT */
-
-static void Calculation_of_the_LTP_parameters P4((d,dp,bc_out,Nc_out),
- register word * d, /* [0..39] IN */
- register word * dp, /* [-120..-1] IN */
- word * bc_out, /* OUT */
- word * Nc_out /* OUT */
-)
-{
- register int k, lambda;
- word Nc, bc;
- word wt[40];
-
- longword L_max, L_power;
- word R, S, dmax, scal;
- register word temp;
-
- /* Search of the optimum scaling of d[0..39].
- */
- dmax = 0;
-
- for (k = 0; k <= 39; k++) {
- temp = d[k];
- temp = GSM_ABS( temp );
- if (temp > dmax) dmax = temp;
- }
-
- temp = 0;
- if (dmax == 0) scal = 0;
- else {
- _x_assert(dmax > 0);
- temp = gsm_norm( (longword)dmax << 16 );
- }
-
- if (temp > 6) scal = 0;
- else scal = 6 - temp;
-
- _x_assert(scal >= 0);
-
- /* Initialization of a working array wt
- */
-
- for (k = 0; k <= 39; k++) wt[k] = SASR( d[k], scal );
-
- /* Search for the maximum cross-correlation and coding of the LTP lag
- */
- L_max = 0;
- Nc = 40; /* index for the maximum cross-correlation */
-
- for (lambda = 40; lambda <= 120; lambda++) {
-
-# undef STEP
-# define STEP(k) (longword)wt[k] * dp[k - lambda]
-
- register longword L_result;
-
- L_result = STEP(0) ; L_result += STEP(1) ;
- L_result += STEP(2) ; L_result += STEP(3) ;
- L_result += STEP(4) ; L_result += STEP(5) ;
- L_result += STEP(6) ; L_result += STEP(7) ;
- L_result += STEP(8) ; L_result += STEP(9) ;
- L_result += STEP(10) ; L_result += STEP(11) ;
- L_result += STEP(12) ; L_result += STEP(13) ;
- L_result += STEP(14) ; L_result += STEP(15) ;
- L_result += STEP(16) ; L_result += STEP(17) ;
- L_result += STEP(18) ; L_result += STEP(19) ;
- L_result += STEP(20) ; L_result += STEP(21) ;
- L_result += STEP(22) ; L_result += STEP(23) ;
- L_result += STEP(24) ; L_result += STEP(25) ;
- L_result += STEP(26) ; L_result += STEP(27) ;
- L_result += STEP(28) ; L_result += STEP(29) ;
- L_result += STEP(30) ; L_result += STEP(31) ;
- L_result += STEP(32) ; L_result += STEP(33) ;
- L_result += STEP(34) ; L_result += STEP(35) ;
- L_result += STEP(36) ; L_result += STEP(37) ;
- L_result += STEP(38) ; L_result += STEP(39) ;
-
- if (L_result > L_max) {
-
- Nc = lambda;
- L_max = L_result;
- }
- }
-
- *Nc_out = Nc;
-
- L_max <<= 1;
-
- /* Rescaling of L_max
- */
- _x_assert( (scal <= 100) && (scal >= -100));
- L_max = L_max >> (6 - scal); /* sub(6, scal) */
-
- _x_assert( Nc <= 120 && Nc >= 40);
-
- /* Compute the power of the reconstructed short term residual
- * signal dp[..]
- */
- L_power = 0;
- for (k = 0; k <= 39; k++) {
-
- register longword L_temp;
-
- L_temp = SASR( dp[k - Nc], 3 );
- L_power += L_temp * L_temp;
- }
- L_power <<= 1; /* from L_MULT */
-
- /* Normalization of L_max and L_power
- */
-
- if (L_max <= 0) {
- *bc_out = 0;
- return;
- }
- if (L_max >= L_power) {
- *bc_out = 3;
- return;
- }
-
- temp = gsm_norm( L_power );
-
- R = SASR( L_max << temp, 16 );
- S = SASR( L_power << temp, 16 );
-
- /* Coding of the LTP gain
- */
-
- /* Table 4.3a must be used to obtain the level DLB[i] for the
- * quantization of the LTP gain b to get the coded version bc.
- */
- for (bc = 0; bc <= 2; bc++) if (R <= gsm_mult(S, gsm_DLB[bc])) break;
- *bc_out = bc;
-}
-
-#else /* USE_FLOAT_MUL */
-
-#ifdef LTP_CUT
-
-static void Cut_Calculation_of_the_LTP_parameters P5((st, d,dp,bc_out,Nc_out),
- struct gsm_state * st, /* IN */
- register word * d, /* [0..39] IN */
- register word * dp, /* [-120..-1] IN */
- word * bc_out, /* OUT */
- word * Nc_out /* OUT */
-)
-{
- register int k, lambda;
- word Nc, bc;
- word ltp_cut;
-
- float wt_float[40];
- float dp_float_base[120], * dp_float = dp_float_base + 120;
-
- longword L_max, L_power;
- word R, S, dmax, scal;
- register word temp;
-
- /* Search of the optimum scaling of d[0..39].
- */
- dmax = 0;
-
- for (k = 0; k <= 39; k++) {
- temp = d[k];
- temp = GSM_ABS( temp );
- if (temp > dmax) dmax = temp;
- }
-
- temp = 0;
- if (dmax == 0) scal = 0;
- else {
- _x_assert(dmax > 0);
-
- temp = gsm_norm( (longword)dmax << 16 );
- }
-
- if (temp > 6) scal = 0;
- else scal = 6 - temp;
-
- _x_assert(scal >= 0);
-
- ltp_cut = (longword)SASR(dmax, scal) * st->ltp_cut / 100;
-
-
- /* Initialization of a working array wt
- */
-
- for (k = 0; k < 40; k++) {
- register word w = SASR( d[k], scal );
- if (w < 0 ? w > -ltp_cut : w < ltp_cut) {
- wt_float[k] = 0.0;
- }
- else {
- wt_float[k] = w;
- }
- }
- for (k = -120; k < 0; k++) dp_float[k] = dp[k];
-
- /* Search for the maximum cross-correlation and coding of the LTP lag
- */
- L_max = 0;
- Nc = 40; /* index for the maximum cross-correlation */
-
- for (lambda = 40; lambda <= 120; lambda += 9) {
-
- /* Calculate L_result for l = lambda .. lambda + 9.
- */
- register float *lp = dp_float - lambda;
-
- register float W;
- register float a = lp[-8], b = lp[-7], c = lp[-6],
- d = lp[-5], e = lp[-4], f = lp[-3],
- g = lp[-2], h = lp[-1];
- register float E;
- register float S0 = 0, S1 = 0, S2 = 0, S3 = 0, S4 = 0,
- S5 = 0, S6 = 0, S7 = 0, S8 = 0;
-
-# undef STEP
-# define STEP(K, a, b, c, d, e, f, g, h) \
- if ((W = wt_float[K]) != 0.0) { \
- E = W * a; S8 += E; \
- E = W * b; S7 += E; \
- E = W * c; S6 += E; \
- E = W * d; S5 += E; \
- E = W * e; S4 += E; \
- E = W * f; S3 += E; \
- E = W * g; S2 += E; \
- E = W * h; S1 += E; \
- a = lp[K]; \
- E = W * a; S0 += E; } else (a = lp[K])
-
-# define STEP_A(K) STEP(K, a, b, c, d, e, f, g, h)
-# define STEP_B(K) STEP(K, b, c, d, e, f, g, h, a)
-# define STEP_C(K) STEP(K, c, d, e, f, g, h, a, b)
-# define STEP_D(K) STEP(K, d, e, f, g, h, a, b, c)
-# define STEP_E(K) STEP(K, e, f, g, h, a, b, c, d)
-# define STEP_F(K) STEP(K, f, g, h, a, b, c, d, e)
-# define STEP_G(K) STEP(K, g, h, a, b, c, d, e, f)
-# define STEP_H(K) STEP(K, h, a, b, c, d, e, f, g)
-
- STEP_A( 0); STEP_B( 1); STEP_C( 2); STEP_D( 3);
- STEP_E( 4); STEP_F( 5); STEP_G( 6); STEP_H( 7);
-
- STEP_A( 8); STEP_B( 9); STEP_C(10); STEP_D(11);
- STEP_E(12); STEP_F(13); STEP_G(14); STEP_H(15);
-
- STEP_A(16); STEP_B(17); STEP_C(18); STEP_D(19);
- STEP_E(20); STEP_F(21); STEP_G(22); STEP_H(23);
-
- STEP_A(24); STEP_B(25); STEP_C(26); STEP_D(27);
- STEP_E(28); STEP_F(29); STEP_G(30); STEP_H(31);
-
- STEP_A(32); STEP_B(33); STEP_C(34); STEP_D(35);
- STEP_E(36); STEP_F(37); STEP_G(38); STEP_H(39);
-
- if (S0 > L_max) { L_max = S0; Nc = lambda; }
- if (S1 > L_max) { L_max = S1; Nc = lambda + 1; }
- if (S2 > L_max) { L_max = S2; Nc = lambda + 2; }
- if (S3 > L_max) { L_max = S3; Nc = lambda + 3; }
- if (S4 > L_max) { L_max = S4; Nc = lambda + 4; }
- if (S5 > L_max) { L_max = S5; Nc = lambda + 5; }
- if (S6 > L_max) { L_max = S6; Nc = lambda + 6; }
- if (S7 > L_max) { L_max = S7; Nc = lambda + 7; }
- if (S8 > L_max) { L_max = S8; Nc = lambda + 8; }
-
- }
- *Nc_out = Nc;
-
- L_max <<= 1;
-
- /* Rescaling of L_max
- */
- _x_assert( (scal <= 100) && (scal >= -100));
-
- L_max = L_max >> (6 - scal); /* sub(6, scal) */
-
- _x_assert( Nc <= 120 && Nc >= 40);
-
- /* Compute the power of the reconstructed short term residual
- * signal dp[..]
- */
- L_power = 0;
- for (k = 0; k <= 39; k++) {
-
- register longword L_temp;
-
- L_temp = SASR( dp[k - Nc], 3 );
- L_power += L_temp * L_temp;
- }
- L_power <<= 1; /* from L_MULT */
-
- /* Normalization of L_max and L_power
- */
-
- if (L_max <= 0) {
- *bc_out = 0;
- return;
- }
- if (L_max >= L_power) {
- *bc_out = 3;
- return;
- }
-
- temp = gsm_norm( L_power );
-
- R = SASR( L_max << temp, 16 );
- S = SASR( L_power << temp, 16 );
-
- /* Coding of the LTP gain
- */
-
- /* Table 4.3a must be used to obtain the level DLB[i] for the
- * quantization of the LTP gain b to get the coded version bc.
- */
- for (bc = 0; bc <= 2; bc++) if (R <= gsm_mult(S, gsm_DLB[bc])) break;
- *bc_out = bc;
-}
-
-#endif /* LTP_CUT */
-
-static void Calculation_of_the_LTP_parameters P4((d,dp,bc_out,Nc_out),
- register word * d, /* [0..39] IN */
- register word * dp, /* [-120..-1] IN */
- word * bc_out, /* OUT */
- word * Nc_out /* OUT */
-)
-{
- register int k, lambda;
- word Nc, bc;
-
- float wt_float[40];
- float dp_float_base[120], * dp_float = dp_float_base + 120;
-
- longword L_max, L_power;
- word R, S, dmax, scal;
- register word temp;
-
- /* Search of the optimum scaling of d[0..39].
- */
- dmax = 0;
-
- for (k = 0; k <= 39; k++) {
- temp = d[k];
- temp = GSM_ABS( temp );
- if (temp > dmax) dmax = temp;
- }
-
- temp = 0;
- if (dmax == 0) scal = 0;
- else {
- _x_assert(dmax > 0);
- temp = gsm_norm( (longword)dmax << 16 );
- }
-
- if (temp > 6) scal = 0;
- else scal = 6 - temp;
-
- _x_assert(scal >= 0);
-
- /* Initialization of a working array wt
- */
-
- for (k = 0; k < 40; k++) wt_float[k] = SASR( d[k], scal );
- for (k = -120; k < 0; k++) dp_float[k] = dp[k];
-
- /* Search for the maximum cross-correlation and coding of the LTP lag
- */
- L_max = 0;
- Nc = 40; /* index for the maximum cross-correlation */
-
- for (lambda = 40; lambda <= 120; lambda += 9) {
-
- /* Calculate L_result for l = lambda .. lambda + 9.
- */
- register float *lp = dp_float - lambda;
-
- register float W;
- register float a = lp[-8], b = lp[-7], c = lp[-6],
- d = lp[-5], e = lp[-4], f = lp[-3],
- g = lp[-2], h = lp[-1];
- register float E;
- register float S0 = 0, S1 = 0, S2 = 0, S3 = 0, S4 = 0,
- S5 = 0, S6 = 0, S7 = 0, S8 = 0;
-
-# undef STEP
-# define STEP(K, a, b, c, d, e, f, g, h) \
- W = wt_float[K]; \
- E = W * a; S8 += E; \
- E = W * b; S7 += E; \
- E = W * c; S6 += E; \
- E = W * d; S5 += E; \
- E = W * e; S4 += E; \
- E = W * f; S3 += E; \
- E = W * g; S2 += E; \
- E = W * h; S1 += E; \
- a = lp[K]; \
- E = W * a; S0 += E
-
-# define STEP_A(K) STEP(K, a, b, c, d, e, f, g, h)
-# define STEP_B(K) STEP(K, b, c, d, e, f, g, h, a)
-# define STEP_C(K) STEP(K, c, d, e, f, g, h, a, b)
-# define STEP_D(K) STEP(K, d, e, f, g, h, a, b, c)
-# define STEP_E(K) STEP(K, e, f, g, h, a, b, c, d)
-# define STEP_F(K) STEP(K, f, g, h, a, b, c, d, e)
-# define STEP_G(K) STEP(K, g, h, a, b, c, d, e, f)
-# define STEP_H(K) STEP(K, h, a, b, c, d, e, f, g)
-
- STEP_A( 0); STEP_B( 1); STEP_C( 2); STEP_D( 3);
- STEP_E( 4); STEP_F( 5); STEP_G( 6); STEP_H( 7);
-
- STEP_A( 8); STEP_B( 9); STEP_C(10); STEP_D(11);
- STEP_E(12); STEP_F(13); STEP_G(14); STEP_H(15);
-
- STEP_A(16); STEP_B(17); STEP_C(18); STEP_D(19);
- STEP_E(20); STEP_F(21); STEP_G(22); STEP_H(23);
-
- STEP_A(24); STEP_B(25); STEP_C(26); STEP_D(27);
- STEP_E(28); STEP_F(29); STEP_G(30); STEP_H(31);
-
- STEP_A(32); STEP_B(33); STEP_C(34); STEP_D(35);
- STEP_E(36); STEP_F(37); STEP_G(38); STEP_H(39);
-
- if (S0 > L_max) { L_max = S0; Nc = lambda; }
- if (S1 > L_max) { L_max = S1; Nc = lambda + 1; }
- if (S2 > L_max) { L_max = S2; Nc = lambda + 2; }
- if (S3 > L_max) { L_max = S3; Nc = lambda + 3; }
- if (S4 > L_max) { L_max = S4; Nc = lambda + 4; }
- if (S5 > L_max) { L_max = S5; Nc = lambda + 5; }
- if (S6 > L_max) { L_max = S6; Nc = lambda + 6; }
- if (S7 > L_max) { L_max = S7; Nc = lambda + 7; }
- if (S8 > L_max) { L_max = S8; Nc = lambda + 8; }
- }
- *Nc_out = Nc;
-
- L_max <<= 1;
-
- /* Rescaling of L_max
- */
-
- _x_assert( (scal <= 100) && (scal >= -100));
-
- L_max = L_max >> (6 - scal); /* sub(6, scal) */
-
- _x_assert( Nc <= 120 && Nc >= 40);
-
-
- /* Compute the power of the reconstructed short term residual
- * signal dp[..]
- */
- L_power = 0;
- for (k = 0; k <= 39; k++) {
-
- register longword L_temp;
-
- L_temp = SASR( dp[k - Nc], 3 );
- L_power += L_temp * L_temp;
- }
- L_power <<= 1; /* from L_MULT */
-
- /* Normalization of L_max and L_power
- */
-
- if (L_max <= 0) {
- *bc_out = 0;
- return;
- }
- if (L_max >= L_power) {
- *bc_out = 3;
- return;
- }
-
- temp = gsm_norm( L_power );
-
- R = SASR( L_max << temp, 16 );
- S = SASR( L_power << temp, 16 );
-
- /* Coding of the LTP gain
- */
-
- /* Table 4.3a must be used to obtain the level DLB[i] for the
- * quantization of the LTP gain b to get the coded version bc.
- */
- for (bc = 0; bc <= 2; bc++) if (R <= gsm_mult(S, gsm_DLB[bc])) break;
- *bc_out = bc;
-}
-
-#ifdef FAST
-#ifdef LTP_CUT
-
-static void Cut_Fast_Calculation_of_the_LTP_parameters P5((st,
- d,dp,bc_out,Nc_out),
- struct gsm_state * st, /* IN */
- register word * d, /* [0..39] IN */
- register word * dp, /* [-120..-1] IN */
- word * bc_out, /* OUT */
- word * Nc_out /* OUT */
-)
-{
- register int k, lambda;
- register float wt_float;
- word Nc, bc;
- word wt_max, best_k, ltp_cut;
-
- float dp_float_base[120], * dp_float = dp_float_base + 120;
-
- register float L_result, L_max, L_power;
-
- wt_max = 0;
-
- for (k = 0; k < 40; ++k) {
- if ( d[k] > wt_max) wt_max = d[best_k = k];
- else if (-d[k] > wt_max) wt_max = -d[best_k = k];
- }
-
- _x_assert(wt_max >= 0);
- wt_float = (float)wt_max;
-
- for (k = -120; k < 0; ++k) dp_float[k] = (float)dp[k];
-
- /* Search for the maximum cross-correlation and coding of the LTP lag
- */
- L_max = 0;
- Nc = 40; /* index for the maximum cross-correlation */
-
- for (lambda = 40; lambda <= 120; lambda++) {
- L_result = wt_float * dp_float[best_k - lambda];
- if (L_result > L_max) {
- Nc = lambda;
- L_max = L_result;
- }
- }
-
- *Nc_out = Nc;
- if (L_max <= 0.) {
- *bc_out = 0;
- return;
- }
-
- /* Compute the power of the reconstructed short term residual
- * signal dp[..]
- */
- dp_float -= Nc;
- L_power = 0;
- for (k = 0; k < 40; ++k) {
- register float f = dp_float[k];
- L_power += f * f;
- }
-
- if (L_max >= L_power) {
- *bc_out = 3;
- return;
- }
-
- /* Coding of the LTP gain
- * Table 4.3a must be used to obtain the level DLB[i] for the
- * quantization of the LTP gain b to get the coded version bc.
- */
- lambda = L_max / L_power * 32768.;
- for (bc = 0; bc <= 2; ++bc) if (lambda <= gsm_DLB[bc]) break;
- *bc_out = bc;
-}
-
-#endif /* LTP_CUT */
-
-static void Fast_Calculation_of_the_LTP_parameters P4((d,dp,bc_out,Nc_out),
- register word * d, /* [0..39] IN */
- register word * dp, /* [-120..-1] IN */
- word * bc_out, /* OUT */
- word * Nc_out /* OUT */
-)
-{
- register int k, lambda;
- word Nc, bc;
-
- float wt_float[40];
- float dp_float_base[120], * dp_float = dp_float_base + 120;
-
- register float L_max, L_power;
-
- for (k = 0; k < 40; ++k) wt_float[k] = (float)d[k];
- for (k = -120; k < 0; ++k) dp_float[k] = (float)dp[k];
-
- /* Search for the maximum cross-correlation and coding of the LTP lag
- */
- L_max = 0;
- Nc = 40; /* index for the maximum cross-correlation */
-
- for (lambda = 40; lambda <= 120; lambda += 9) {
-
- /* Calculate L_result for l = lambda .. lambda + 9.
- */
- register float *lp = dp_float - lambda;
-
- register float W;
- register float a = lp[-8], b = lp[-7], c = lp[-6],
- d = lp[-5], e = lp[-4], f = lp[-3],
- g = lp[-2], h = lp[-1];
- register float E;
- register float S0 = 0, S1 = 0, S2 = 0, S3 = 0, S4 = 0,
- S5 = 0, S6 = 0, S7 = 0, S8 = 0;
-
-# undef STEP
-# define STEP(K, a, b, c, d, e, f, g, h) \
- W = wt_float[K]; \
- E = W * a; S8 += E; \
- E = W * b; S7 += E; \
- E = W * c; S6 += E; \
- E = W * d; S5 += E; \
- E = W * e; S4 += E; \
- E = W * f; S3 += E; \
- E = W * g; S2 += E; \
- E = W * h; S1 += E; \
- a = lp[K]; \
- E = W * a; S0 += E
-
-# define STEP_A(K) STEP(K, a, b, c, d, e, f, g, h)
-# define STEP_B(K) STEP(K, b, c, d, e, f, g, h, a)
-# define STEP_C(K) STEP(K, c, d, e, f, g, h, a, b)
-# define STEP_D(K) STEP(K, d, e, f, g, h, a, b, c)
-# define STEP_E(K) STEP(K, e, f, g, h, a, b, c, d)
-# define STEP_F(K) STEP(K, f, g, h, a, b, c, d, e)
-# define STEP_G(K) STEP(K, g, h, a, b, c, d, e, f)
-# define STEP_H(K) STEP(K, h, a, b, c, d, e, f, g)
-
- STEP_A( 0); STEP_B( 1); STEP_C( 2); STEP_D( 3);
- STEP_E( 4); STEP_F( 5); STEP_G( 6); STEP_H( 7);
-
- STEP_A( 8); STEP_B( 9); STEP_C(10); STEP_D(11);
- STEP_E(12); STEP_F(13); STEP_G(14); STEP_H(15);
-
- STEP_A(16); STEP_B(17); STEP_C(18); STEP_D(19);
- STEP_E(20); STEP_F(21); STEP_G(22); STEP_H(23);
-
- STEP_A(24); STEP_B(25); STEP_C(26); STEP_D(27);
- STEP_E(28); STEP_F(29); STEP_G(30); STEP_H(31);
-
- STEP_A(32); STEP_B(33); STEP_C(34); STEP_D(35);
- STEP_E(36); STEP_F(37); STEP_G(38); STEP_H(39);
-
- if (S0 > L_max) { L_max = S0; Nc = lambda; }
- if (S1 > L_max) { L_max = S1; Nc = lambda + 1; }
- if (S2 > L_max) { L_max = S2; Nc = lambda + 2; }
- if (S3 > L_max) { L_max = S3; Nc = lambda + 3; }
- if (S4 > L_max) { L_max = S4; Nc = lambda + 4; }
- if (S5 > L_max) { L_max = S5; Nc = lambda + 5; }
- if (S6 > L_max) { L_max = S6; Nc = lambda + 6; }
- if (S7 > L_max) { L_max = S7; Nc = lambda + 7; }
- if (S8 > L_max) { L_max = S8; Nc = lambda + 8; }
- }
- *Nc_out = Nc;
-
- if (L_max <= 0.) {
- *bc_out = 0;
- return;
- }
-
- /* Compute the power of the reconstructed short term residual
- * signal dp[..]
- */
- dp_float -= Nc;
- L_power = 0;
- for (k = 0; k < 40; ++k) {
- register float f = dp_float[k];
- L_power += f * f;
- }
-
- if (L_max >= L_power) {
- *bc_out = 3;
- return;
- }
-
- /* Coding of the LTP gain
- * Table 4.3a must be used to obtain the level DLB[i] for the
- * quantization of the LTP gain b to get the coded version bc.
- */
- lambda = L_max / L_power * 32768.;
- for (bc = 0; bc <= 2; ++bc) if (lambda <= gsm_DLB[bc]) break;
- *bc_out = bc;
-}
-
-#endif /* FAST */
-#endif /* USE_FLOAT_MUL */
-
-
-/* 4.2.12 */
-
-static void Long_term_analysis_filtering P6((bc,Nc,dp,d,dpp,e),
- word bc, /* IN */
- word Nc, /* IN */
- register word * dp, /* previous d [-120..-1] IN */
- register word * d, /* d [0..39] IN */
- register word * dpp, /* estimate [0..39] OUT */
- register word * e /* long term res. signal [0..39] OUT */
-)
-/*
- * In this part, we have to decode the bc parameter to compute
- * the samples of the estimate dpp[0..39]. The decoding of bc needs the
- * use of table 4.3b. The long term residual signal e[0..39]
- * is then calculated to be fed to the RPE encoding section.
- */
-{
- register int k;
- register longword ltmp;
-
-# undef STEP
-# define STEP(BP) \
- for (k = 0; k <= 39; k++) { \
- dpp[k] = GSM_MULT_R( BP, dp[k - Nc]); \
- e[k] = GSM_SUB( d[k], dpp[k] ); \
- }
-
- switch (bc) {
- case 0: STEP( 3277 ); break;
- case 1: STEP( 11469 ); break;
- case 2: STEP( 21299 ); break;
- case 3: STEP( 32767 ); break;
- }
-}
-
-void Gsm_Long_Term_Predictor P7((S,d,dp,e,dpp,Nc,bc), /* 4x for 160 samples */
-
- struct gsm_state * S,
-
- word * d, /* [0..39] residual signal IN */
- word * dp, /* [-120..-1] d' IN */
-
- word * e, /* [0..39] OUT */
- word * dpp, /* [0..39] OUT */
- word * Nc, /* correlation lag OUT */
- word * bc /* gain factor OUT */
-)
-{
- _x_assert( d );
- _x_assert( dp );
- _x_assert( e );
- _x_assert( dpp );
- _x_assert( Nc );
- _x_assert( bc );
-
-#if defined(FAST) && defined(USE_FLOAT_MUL)
- if (S->fast)
-#if defined (LTP_CUT)
- if (S->ltp_cut)
- Cut_Fast_Calculation_of_the_LTP_parameters(S,
- d, dp, bc, Nc);
- else
-#endif /* LTP_CUT */
- Fast_Calculation_of_the_LTP_parameters(d, dp, bc, Nc );
- else
-#endif /* FAST & USE_FLOAT_MUL */
-#ifdef LTP_CUT
- if (S->ltp_cut)
- Cut_Calculation_of_the_LTP_parameters(S, d, dp, bc, Nc);
- else
-#endif
- Calculation_of_the_LTP_parameters(d, dp, bc, Nc);
-
- Long_term_analysis_filtering( *bc, *Nc, dp, d, dpp, e );
-}
-
-/* 4.3.2 */
-void Gsm_Long_Term_Synthesis_Filtering P5((S,Ncr,bcr,erp,drp),
- struct gsm_state * S,
-
- word Ncr,
- word bcr,
- register word * erp, /* [0..39] IN */
- register word * drp /* [-120..-1] IN, [-120..40] OUT */
-)
-/*
- * This procedure uses the bcr and Ncr parameter to realize the
- * long term synthesis filtering. The decoding of bcr needs
- * table 4.3b.
- */
-{
- register longword ltmp; /* for ADD */
- register int k;
- word brp, drpp, Nr;
-
- /* Check the limits of Nr.
- */
- Nr = Ncr < 40 || Ncr > 120 ? S->nrp : Ncr;
- S->nrp = Nr;
- _x_assert(Nr >= 40 && Nr <= 120);
-
- /* Decoding of the LTP gain bcr
- */
- brp = gsm_QLB[ bcr ];
-
- /* Computation of the reconstructed short term residual
- * signal drp[0..39]
- */
- _x_assert(brp != MIN_WORD);
-
- for (k = 0; k <= 39; k++) {
- drpp = GSM_MULT_R( brp, drp[ k - Nr ] );
- drp[k] = GSM_ADD( erp[k], drpp );
- }
-
- /*
- * Update of the reconstructed short term residual signal
- * drp[ -1..-120 ]
- */
-
- for (k = 0; k <= 119; k++) drp[ -120 + k ] = drp[ -80 + k ];
-}
diff --git a/src/libxineadec/gsm610/lpc.c b/src/libxineadec/gsm610/lpc.c
deleted file mode 100644
index 0f51fa55f..000000000
--- a/src/libxineadec/gsm610/lpc.c
+++ /dev/null
@@ -1,350 +0,0 @@
-/*
- * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
- * Universitaet Berlin. See the accompanying file "COPYRIGHT" for
- * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
- */
-
-/* $Header: /nfshome/cvs/xine-lib/src/libxineadec/gsm610/lpc.c,v 1.3 2003/12/07 15:34:30 f1rmb Exp $ */
-
-#include <stdio.h>
-#include "xineutils.h"
-
-#include "private.h"
-
-#include "gsm.h"
-#include "proto.h"
-
-#undef P
-
-/*
- * 4.2.4 .. 4.2.7 LPC ANALYSIS SECTION
- */
-
-/* 4.2.4 */
-
-
-static void Autocorrelation P2((s, L_ACF),
- word * s, /* [0..159] IN/OUT */
- longword * L_ACF) /* [0..8] OUT */
-/*
- * The goal is to compute the array L_ACF[k]. The signal s[i] must
- * be scaled in order to avoid an overflow situation.
- */
-{
- register int k, i;
-
- word temp, smax, scalauto;
-
-#ifdef USE_FLOAT_MUL
- float float_s[160];
-#endif
-
- /* Dynamic scaling of the array s[0..159]
- */
-
- /* Search for the maximum.
- */
- smax = 0;
- for (k = 0; k <= 159; k++) {
- temp = GSM_ABS( s[k] );
- if (temp > smax) smax = temp;
- }
-
- /* Computation of the scaling factor.
- */
- if (smax == 0) scalauto = 0;
- else {
- _x_assert(smax > 0);
- scalauto = 4 - gsm_norm( (longword)smax << 16 );/* sub(4,..) */
- }
-
- /* Scaling of the array s[0...159]
- */
-
- if (scalauto > 0) {
-
-# ifdef USE_FLOAT_MUL
-# define SCALE(n) \
- case n: for (k = 0; k <= 159; k++) \
- float_s[k] = (float) \
- (s[k] = GSM_MULT_R(s[k], 16384 >> (n-1)));\
- break;
-# else
-# define SCALE(n) \
- case n: for (k = 0; k <= 159; k++) \
- s[k] = GSM_MULT_R( s[k], 16384 >> (n-1) );\
- break;
-# endif /* USE_FLOAT_MUL */
-
- switch (scalauto) {
- SCALE(1)
- SCALE(2)
- SCALE(3)
- SCALE(4)
- }
-# undef SCALE
- }
-# ifdef USE_FLOAT_MUL
- else for (k = 0; k <= 159; k++) float_s[k] = (float) s[k];
-# endif
-
- /* Compute the L_ACF[..].
- */
- {
-# ifdef USE_FLOAT_MUL
- register float * sp = float_s;
- register float sl = *sp;
-
-# define STEP(k) L_ACF[k] += (longword)(sl * sp[ -(k) ]);
-# else
- word * sp = s;
- word sl = *sp;
-
-# define STEP(k) L_ACF[k] += ((longword)sl * sp[ -(k) ]);
-# endif
-
-# define NEXTI sl = *++sp
-
-
- for (k = 9; k--; L_ACF[k] = 0) ;
-
- STEP (0);
- NEXTI;
- STEP(0); STEP(1);
- NEXTI;
- STEP(0); STEP(1); STEP(2);
- NEXTI;
- STEP(0); STEP(1); STEP(2); STEP(3);
- NEXTI;
- STEP(0); STEP(1); STEP(2); STEP(3); STEP(4);
- NEXTI;
- STEP(0); STEP(1); STEP(2); STEP(3); STEP(4); STEP(5);
- NEXTI;
- STEP(0); STEP(1); STEP(2); STEP(3); STEP(4); STEP(5); STEP(6);
- NEXTI;
- STEP(0); STEP(1); STEP(2); STEP(3); STEP(4); STEP(5); STEP(6); STEP(7);
-
- for (i = 8; i <= 159; i++) {
-
- NEXTI;
-
- STEP(0);
- STEP(1); STEP(2); STEP(3); STEP(4);
- STEP(5); STEP(6); STEP(7); STEP(8);
- }
-
- for (k = 9; k--; L_ACF[k] <<= 1) ;
-
- }
- /* Rescaling of the array s[0..159]
- */
- if (scalauto > 0) {
- _x_assert(scalauto <= 4);
- for (k = 160; k--; *s++ <<= scalauto) ;
- }
-}
-
-#if defined(USE_FLOAT_MUL) && defined(FAST)
-
-static void Fast_Autocorrelation P2((s, L_ACF),
- word * s, /* [0..159] IN/OUT */
- longword * L_ACF) /* [0..8] OUT */
-{
- register int k, i;
- float f_L_ACF[9];
- float scale;
-
- float s_f[160];
- register float *sf = s_f;
-
- for (i = 0; i < 160; ++i) sf[i] = s[i];
- for (k = 0; k <= 8; k++) {
- register float L_temp2 = 0;
- register float *sfl = sf - k;
- for (i = k; i < 160; ++i) L_temp2 += sf[i] * sfl[i];
- f_L_ACF[k] = L_temp2;
- }
- scale = MAX_LONGWORD / f_L_ACF[0];
-
- for (k = 0; k <= 8; k++) {
- L_ACF[k] = f_L_ACF[k] * scale;
- }
-}
-#endif /* defined (USE_FLOAT_MUL) && defined (FAST) */
-
-/* 4.2.5 */
-
-static void Reflection_coefficients P2( (L_ACF, r),
- longword * L_ACF, /* 0...8 IN */
- register word * r /* 0...7 OUT */
-)
-{
- register int i, m, n;
- register word temp;
- register longword ltmp;
- word ACF[9]; /* 0..8 */
- word P[ 9]; /* 0..8 */
- word K[ 9]; /* 2..8 */
-
- /* Schur recursion with 16 bits arithmetic.
- */
-
- if (L_ACF[0] == 0) {
- for (i = 8; i--; *r++ = 0) ;
- return;
- }
-
- _x_assert( L_ACF[0] != 0 );
- temp = gsm_norm( L_ACF[0] );
-
- _x_assert(temp >= 0 && temp < 32);
-
- /* ? overflow ? */
- for (i = 0; i <= 8; i++) ACF[i] = SASR( L_ACF[i] << temp, 16 );
-
- /* Initialize array P[..] and K[..] for the recursion.
- */
-
- for (i = 1; i <= 7; i++) K[ i ] = ACF[ i ];
- for (i = 0; i <= 8; i++) P[ i ] = ACF[ i ];
-
- /* Compute reflection coefficients
- */
- for (n = 1; n <= 8; n++, r++) {
-
- temp = P[1];
- temp = GSM_ABS(temp);
- if (P[0] < temp) {
- for (i = n; i <= 8; i++) *r++ = 0;
- return;
- }
-
- *r = gsm_div( temp, P[0] );
-
- _x_assert(*r >= 0);
-
- if (P[1] > 0) *r = -*r; /* r[n] = sub(0, r[n]) */
-
- _x_assert(*r != MIN_WORD);
-
- if (n == 8) return;
-
- /* Schur recursion
- */
- temp = GSM_MULT_R( P[1], *r );
- P[0] = GSM_ADD( P[0], temp );
-
- for (m = 1; m <= 8 - n; m++) {
- temp = GSM_MULT_R( K[ m ], *r );
- P[m] = GSM_ADD( P[ m+1 ], temp );
-
- temp = GSM_MULT_R( P[ m+1 ], *r );
- K[m] = GSM_ADD( K[ m ], temp );
- }
- }
-}
-
-/* 4.2.6 */
-
-static void Transformation_to_Log_Area_Ratios P1((r),
- register word * r /* 0..7 IN/OUT */
-)
-/*
- * The following scaling for r[..] and LAR[..] has been used:
- *
- * r[..] = integer( real_r[..]*32768. ); -1 <= real_r < 1.
- * LAR[..] = integer( real_LAR[..] * 16384 );
- * with -1.625 <= real_LAR <= 1.625
- */
-{
- register word temp;
- register int i;
-
-
- /* Computation of the LAR[0..7] from the r[0..7]
- */
- for (i = 1; i <= 8; i++, r++) {
-
- temp = *r;
- temp = GSM_ABS(temp);
-
- _x_assert(temp >= 0);
-
- if (temp < 22118) {
- temp >>= 1;
- } else if (temp < 31130) {
- _x_assert(temp >= 11059);
- temp -= 11059;
- } else {
- _x_assert(temp >= 26112);
- temp -= 26112;
- temp <<= 2;
- }
-
- if (*r < 0) {
- *r = -temp;
- }
- else {
- *r = temp;
- }
- _x_assert(*r != MIN_WORD);
- }
-}
-
-/* 4.2.7 */
-
-static void Quantization_and_coding P1((LAR),
- register word * LAR /* [0..7] IN/OUT */
-)
-{
- register word temp;
- longword ltmp;
-
-
- /* This procedure needs four tables; the following equations
- * give the optimum scaling for the constants:
- *
- * A[0..7] = integer( real_A[0..7] * 1024 )
- * B[0..7] = integer( real_B[0..7] * 512 )
- * MAC[0..7] = maximum of the LARc[0..7]
- * MIC[0..7] = minimum of the LARc[0..7]
- */
-
-# undef STEP
-# define STEP( A, B, MAC, MIC ) \
- temp = GSM_MULT( A, *LAR ); \
- temp = GSM_ADD( temp, B ); \
- temp = GSM_ADD( temp, 256 ); \
- temp = SASR( temp, 9 ); \
- *LAR = temp>MAC ? MAC - MIC : (temp<MIC ? 0 : temp - MIC); \
- LAR++;
-
- STEP( 20480, 0, 31, -32 );
- STEP( 20480, 0, 31, -32 );
- STEP( 20480, 2048, 15, -16 );
- STEP( 20480, -2560, 15, -16 );
-
- STEP( 13964, 94, 7, -8 );
- STEP( 15360, -1792, 7, -8 );
- STEP( 8534, -341, 3, -4 );
- STEP( 9036, -1144, 3, -4 );
-
-# undef STEP
-}
-
-void Gsm_LPC_Analysis P3((S, s,LARc),
- struct gsm_state *S,
- word * s, /* 0..159 signals IN/OUT */
- word * LARc) /* 0..7 LARc's OUT */
-{
- longword L_ACF[9];
-
-#if defined(USE_FLOAT_MUL) && defined(FAST)
- if (S->fast) Fast_Autocorrelation (s, L_ACF );
- else
-#endif
- Autocorrelation (s, L_ACF );
- Reflection_coefficients (L_ACF, LARc );
- Transformation_to_Log_Area_Ratios (LARc);
- Quantization_and_coding (LARc);
-}
diff --git a/src/libxineadec/gsm610/private.h b/src/libxineadec/gsm610/private.h
deleted file mode 100644
index 33a5172b0..000000000
--- a/src/libxineadec/gsm610/private.h
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
- * Universitaet Berlin. See the accompanying file "COPYRIGHT" for
- * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
- */
-
-/*$Header: /nfshome/cvs/xine-lib/src/libxineadec/gsm610/private.h,v 1.1 2002/10/12 19:12:49 tmmm Exp $*/
-
-#ifndef PRIVATE_H
-#define PRIVATE_H
-
-typedef short word; /* 16 bit signed int */
-typedef long longword; /* 32 bit signed int */
-
-typedef unsigned short uword; /* unsigned word */
-typedef unsigned long ulongword; /* unsigned longword */
-
-struct gsm_state {
-
- word dp0[ 280 ];
-
- word z1; /* preprocessing.c, Offset_com. */
- longword L_z2; /* Offset_com. */
- int mp; /* Preemphasis */
-
- word u[8]; /* short_term_aly_filter.c */
- word LARpp[2][8]; /* */
- word j; /* */
-
- word ltp_cut; /* long_term.c, LTP crosscorr. */
- word nrp; /* 40 */ /* long_term.c, synthesis */
- word v[9]; /* short_term.c, synthesis */
- word msr; /* decoder.c, Postprocessing */
-
- char verbose; /* only used if !NDEBUG */
- char fast; /* only used if FAST */
-
- char wav_fmt; /* only used if WAV49 defined */
- unsigned char frame_index; /* odd/even chaining */
- unsigned char frame_chain; /* half-byte to carry forward */
-};
-
-
-#define MIN_WORD (-32767 - 1)
-#define MAX_WORD 32767
-
-#define MIN_LONGWORD (-2147483647 - 1)
-#define MAX_LONGWORD 2147483647
-
-#ifdef SASR /* flag: >> is a signed arithmetic shift right */
-#undef SASR
-#define SASR(x, by) ((x) >> (by))
-#else
-#define SASR(x, by) ((x) >= 0 ? (x) >> (by) : (~(-((x) + 1) >> (by))))
-#endif /* SASR */
-
-#include "proto.h"
-
-/*
- * Prototypes from add.c
- */
-extern word gsm_mult P((word a, word b));
-extern longword gsm_L_mult P((word a, word b));
-extern word gsm_mult_r P((word a, word b));
-
-extern word gsm_div P((word num, word denum));
-
-extern word gsm_add P(( word a, word b ));
-extern longword gsm_L_add P(( longword a, longword b ));
-
-extern word gsm_sub P((word a, word b));
-extern longword gsm_L_sub P((longword a, longword b));
-
-extern word gsm_abs P((word a));
-
-extern word gsm_norm P(( longword a ));
-
-extern longword gsm_L_asl P((longword a, int n));
-extern word gsm_asl P((word a, int n));
-
-extern longword gsm_L_asr P((longword a, int n));
-extern word gsm_asr P((word a, int n));
-
-/*
- * Inlined functions from add.h
- */
-
-/*
- * #define GSM_MULT_R(a, b) (* word a, word b, !(a == b == MIN_WORD) *) \
- * (0x0FFFF & SASR(((longword)(a) * (longword)(b) + 16384), 15))
- */
-#define GSM_MULT_R(a, b) /* word a, word b, !(a == b == MIN_WORD) */ \
- (SASR( ((longword)(a) * (longword)(b) + 16384), 15 ))
-
-# define GSM_MULT(a,b) /* word a, word b, !(a == b == MIN_WORD) */ \
- (SASR( ((longword)(a) * (longword)(b)), 15 ))
-
-# define GSM_L_MULT(a, b) /* word a, word b */ \
- (((longword)(a) * (longword)(b)) << 1)
-
-# define GSM_L_ADD(a, b) \
- ( (a) < 0 ? ( (b) >= 0 ? (a) + (b) \
- : (utmp = (ulongword)-((a) + 1) + (ulongword)-((b) + 1)) \
- >= MAX_LONGWORD ? MIN_LONGWORD : -(longword)utmp-2 ) \
- : ((b) <= 0 ? (a) + (b) \
- : (utmp = (ulongword)(a) + (ulongword)(b)) >= MAX_LONGWORD \
- ? MAX_LONGWORD : utmp))
-
-/*
- * # define GSM_ADD(a, b) \
- * ((ltmp = (longword)(a) + (longword)(b)) >= MAX_WORD \
- * ? MAX_WORD : ltmp <= MIN_WORD ? MIN_WORD : ltmp)
- */
-/* Nonportable, but faster: */
-
-#define GSM_ADD(a, b) \
- ((ulongword)((ltmp = (longword)(a) + (longword)(b)) - MIN_WORD) > \
- MAX_WORD - MIN_WORD ? (ltmp > 0 ? MAX_WORD : MIN_WORD) : ltmp)
-
-# define GSM_SUB(a, b) \
- ((ltmp = (longword)(a) - (longword)(b)) >= MAX_WORD \
- ? MAX_WORD : ltmp <= MIN_WORD ? MIN_WORD : ltmp)
-
-# define GSM_ABS(a) ((a) < 0 ? ((a) == MIN_WORD ? MAX_WORD : -(a)) : (a))
-
-/* Use these if necessary:
-
-# define GSM_MULT_R(a, b) gsm_mult_r(a, b)
-# define GSM_MULT(a, b) gsm_mult(a, b)
-# define GSM_L_MULT(a, b) gsm_L_mult(a, b)
-
-# define GSM_L_ADD(a, b) gsm_L_add(a, b)
-# define GSM_ADD(a, b) gsm_add(a, b)
-# define GSM_SUB(a, b) gsm_sub(a, b)
-
-# define GSM_ABS(a) gsm_abs(a)
-
-*/
-
-/*
- * More prototypes from implementations..
- */
-extern void Gsm_Coder P((
- struct gsm_state * S,
- word * s, /* [0..159] samples IN */
- word * LARc, /* [0..7] LAR coefficients OUT */
- word * Nc, /* [0..3] LTP lag OUT */
- word * bc, /* [0..3] coded LTP gain OUT */
- word * Mc, /* [0..3] RPE grid selection OUT */
- word * xmaxc,/* [0..3] Coded maximum amplitude OUT */
- word * xMc /* [13*4] normalized RPE samples OUT */));
-
-extern void Gsm_Long_Term_Predictor P(( /* 4x for 160 samples */
- struct gsm_state * S,
- word * d, /* [0..39] residual signal IN */
- word * dp, /* [-120..-1] d' IN */
- word * e, /* [0..40] OUT */
- word * dpp, /* [0..40] OUT */
- word * Nc, /* correlation lag OUT */
- word * bc /* gain factor OUT */));
-
-extern void Gsm_LPC_Analysis P((
- struct gsm_state * S,
- word * s, /* 0..159 signals IN/OUT */
- word * LARc)); /* 0..7 LARc's OUT */
-
-extern void Gsm_Preprocess P((
- struct gsm_state * S,
- word * s, word * so));
-
-extern void Gsm_Encoding P((
- struct gsm_state * S,
- word * e,
- word * ep,
- word * xmaxc,
- word * Mc,
- word * xMc));
-
-extern void Gsm_Short_Term_Analysis_Filter P((
- struct gsm_state * S,
- word * LARc, /* coded log area ratio [0..7] IN */
- word * d /* st res. signal [0..159] IN/OUT */));
-
-extern void Gsm_Decoder P((
- struct gsm_state * S,
- word * LARcr, /* [0..7] IN */
- word * Ncr, /* [0..3] IN */
- word * bcr, /* [0..3] IN */
- word * Mcr, /* [0..3] IN */
- word * xmaxcr, /* [0..3] IN */
- word * xMcr, /* [0..13*4] IN */
- word * s)); /* [0..159] OUT */
-
-extern void Gsm_Decoding P((
- struct gsm_state * S,
- word xmaxcr,
- word Mcr,
- word * xMcr, /* [0..12] IN */
- word * erp)); /* [0..39] OUT */
-
-extern void Gsm_Long_Term_Synthesis_Filtering P((
- struct gsm_state* S,
- word Ncr,
- word bcr,
- word * erp, /* [0..39] IN */
- word * drp)); /* [-120..-1] IN, [0..40] OUT */
-
-void Gsm_RPE_Decoding P((
- struct gsm_state *S,
- word xmaxcr,
- word Mcr,
- word * xMcr, /* [0..12], 3 bits IN */
- word * erp)); /* [0..39] OUT */
-
-void Gsm_RPE_Encoding P((
- struct gsm_state * S,
- word * e, /* -5..-1][0..39][40..44 IN/OUT */
- word * xmaxc, /* OUT */
- word * Mc, /* OUT */
- word * xMc)); /* [0..12] OUT */
-
-extern void Gsm_Short_Term_Synthesis_Filter P((
- struct gsm_state * S,
- word * LARcr, /* log area ratios [0..7] IN */
- word * drp, /* received d [0...39] IN */
- word * s)); /* signal s [0..159] OUT */
-
-extern void Gsm_Update_of_reconstructed_short_time_residual_signal P((
- word * dpp, /* [0...39] IN */
- word * ep, /* [0...39] IN */
- word * dp)); /* [-120...-1] IN/OUT */
-
-/*
- * Tables from table.c
- */
-#ifndef GSM_TABLE_C
-
-extern word gsm_A[8], gsm_B[8], gsm_MIC[8], gsm_MAC[8];
-extern word gsm_INVA[8];
-extern word gsm_DLB[4], gsm_QLB[4];
-extern word gsm_H[11];
-extern word gsm_NRFAC[8];
-extern word gsm_FAC[8];
-
-#endif /* GSM_TABLE_C */
-
-/*
- * Debugging
- */
-#ifdef NDEBUG
-
-# define gsm_debug_words(a, b, c, d) /* nil */
-# define gsm_debug_longwords(a, b, c, d) /* nil */
-# define gsm_debug_word(a, b) /* nil */
-# define gsm_debug_longword(a, b) /* nil */
-
-#else /* !NDEBUG => DEBUG */
-
- extern void gsm_debug_words P((char * name, int, int, word *));
- extern void gsm_debug_longwords P((char * name, int, int, longword *));
- extern void gsm_debug_longword P((char * name, longword));
- extern void gsm_debug_word P((char * name, word));
-
-#endif /* !NDEBUG */
-
-#include "unproto.h"
-
-#endif /* PRIVATE_H */
diff --git a/src/libxineadec/gsm610/proto.h b/src/libxineadec/gsm610/proto.h
deleted file mode 100644
index a80ebf9e4..000000000
--- a/src/libxineadec/gsm610/proto.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
- * Universitaet Berlin. See the accompanying file "COPYRIGHT" for
- * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
- */
-
-/*$Header: /nfshome/cvs/xine-lib/src/libxineadec/gsm610/proto.h,v 1.1 2002/10/12 19:12:49 tmmm Exp $*/
-
-#ifndef PROTO_H
-#define PROTO_H
-
-#if __cplusplus
-# define NeedFunctionPrototypes 1
-#endif
-
-#if __STDC__
-# define NeedFunctionPrototypes 1
-#endif
-
-#ifdef _NO_PROTO
-# undef NeedFunctionPrototypes
-#endif
-
-#undef P /* gnu stdio.h actually defines this... */
-#undef P0
-#undef P1
-#undef P2
-#undef P3
-#undef P4
-#undef P5
-#undef P6
-#undef P7
-#undef P8
-
-#if NeedFunctionPrototypes
-
-# define P( protos ) protos
-
-# define P0() (void)
-# define P1(x, a) (a)
-# define P2(x, a, b) (a, b)
-# define P3(x, a, b, c) (a, b, c)
-# define P4(x, a, b, c, d) (a, b, c, d)
-# define P5(x, a, b, c, d, e) (a, b, c, d, e)
-# define P6(x, a, b, c, d, e, f) (a, b, c, d, e, f)
-# define P7(x, a, b, c, d, e, f, g) (a, b, c, d, e, f, g)
-# define P8(x, a, b, c, d, e, f, g, h) (a, b, c, d, e, f, g, h)
-
-#else /* !NeedFunctionPrototypes */
-
-# define P( protos ) ( /* protos */ )
-
-# define P0() ()
-# define P1(x, a) x a;
-# define P2(x, a, b) x a; b;
-# define P3(x, a, b, c) x a; b; c;
-# define P4(x, a, b, c, d) x a; b; c; d;
-# define P5(x, a, b, c, d, e) x a; b; c; d; e;
-# define P6(x, a, b, c, d, e, f) x a; b; c; d; e; f;
-# define P7(x, a, b, c, d, e, f, g) x a; b; c; d; e; f; g;
-# define P8(x, a, b, c, d, e, f, g, h) x a; b; c; d; e; f; g; h;
-
-#endif /* !NeedFunctionPrototypes */
-
-#endif /* PROTO_H */
diff --git a/src/libxineadec/gsm610/rpe.c b/src/libxineadec/gsm610/rpe.c
deleted file mode 100644
index 67d94d30e..000000000
--- a/src/libxineadec/gsm610/rpe.c
+++ /dev/null
@@ -1,489 +0,0 @@
-/*
- * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
- * Universitaet Berlin. See the accompanying file "COPYRIGHT" for
- * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
- */
-
-/* $Header: /nfshome/cvs/xine-lib/src/libxineadec/gsm610/rpe.c,v 1.3 2003/12/07 15:34:30 f1rmb Exp $ */
-
-#include <stdio.h>
-#include "xineutils.h"
-#include "private.h"
-
-#include "gsm.h"
-#include "proto.h"
-
-/* 4.2.13 .. 4.2.17 RPE ENCODING SECTION
- */
-
-/* 4.2.13 */
-
-static void Weighting_filter P2((e, x),
- register word * e, /* signal [-5..0.39.44] IN */
- word * x /* signal [0..39] OUT */
-)
-/*
- * The coefficients of the weighting filter are stored in a table
- * (see table 4.4). The following scaling is used:
- *
- * H[0..10] = integer( real_H[ 0..10] * 8192 );
- */
-{
- /* word wt[ 50 ]; */
-
- register longword L_result;
- register int k /* , i */ ;
-
- /* Initialization of a temporary working array wt[0...49]
- */
-
- /* for (k = 0; k <= 4; k++) wt[k] = 0;
- * for (k = 5; k <= 44; k++) wt[k] = *e++;
- * for (k = 45; k <= 49; k++) wt[k] = 0;
- *
- * (e[-5..-1] and e[40..44] are allocated by the caller,
- * are initially zero and are not written anywhere.)
- */
- e -= 5;
-
- /* Compute the signal x[0..39]
- */
- for (k = 0; k <= 39; k++) {
-
- L_result = 8192 >> 1;
-
- /* for (i = 0; i <= 10; i++) {
- * L_temp = GSM_L_MULT( wt[k+i], gsm_H[i] );
- * L_result = GSM_L_ADD( L_result, L_temp );
- * }
- */
-
-#undef STEP
-#define STEP( i, H ) (e[ k + i ] * (longword)H)
-
- /* Every one of these multiplications is done twice --
- * but I don't see an elegant way to optimize this.
- * Do you?
- */
-
-#ifdef STUPID_COMPILER
- L_result += STEP( 0, -134 ) ;
- L_result += STEP( 1, -374 ) ;
- /* + STEP( 2, 0 ) */
- L_result += STEP( 3, 2054 ) ;
- L_result += STEP( 4, 5741 ) ;
- L_result += STEP( 5, 8192 ) ;
- L_result += STEP( 6, 5741 ) ;
- L_result += STEP( 7, 2054 ) ;
- /* + STEP( 8, 0 ) */
- L_result += STEP( 9, -374 ) ;
- L_result += STEP( 10, -134 ) ;
-#else
- L_result +=
- STEP( 0, -134 )
- + STEP( 1, -374 )
- /* + STEP( 2, 0 ) */
- + STEP( 3, 2054 )
- + STEP( 4, 5741 )
- + STEP( 5, 8192 )
- + STEP( 6, 5741 )
- + STEP( 7, 2054 )
- /* + STEP( 8, 0 ) */
- + STEP( 9, -374 )
- + STEP(10, -134 )
- ;
-#endif
-
- /* L_result = GSM_L_ADD( L_result, L_result ); (* scaling(x2) *)
- * L_result = GSM_L_ADD( L_result, L_result ); (* scaling(x4) *)
- *
- * x[k] = SASR( L_result, 16 );
- */
-
- /* 2 adds vs. >>16 => 14, minus one shift to compensate for
- * those we lost when replacing L_MULT by '*'.
- */
-
- L_result = SASR( L_result, 13 );
- x[k] = ( L_result < MIN_WORD ? MIN_WORD
- : (L_result > MAX_WORD ? MAX_WORD : L_result ));
- }
-}
-
-/* 4.2.14 */
-
-static void RPE_grid_selection P3((x,xM,Mc_out),
- word * x, /* [0..39] IN */
- word * xM, /* [0..12] OUT */
- word * Mc_out /* OUT */
-)
-/*
- * The signal x[0..39] is used to select the RPE grid which is
- * represented by Mc.
- */
-{
- /* register word temp1; */
- register int /* m, */ i;
- register longword L_result, L_temp;
- longword EM; /* xxx should be L_EM? */
- word Mc;
-
- longword L_common_0_3;
-
- EM = 0;
- Mc = 0;
-
- /* for (m = 0; m <= 3; m++) {
- * L_result = 0;
- *
- *
- * for (i = 0; i <= 12; i++) {
- *
- * temp1 = SASR( x[m + 3*i], 2 );
- *
- * _x_assert(temp1 != MIN_WORD);
- *
- * L_temp = GSM_L_MULT( temp1, temp1 );
- * L_result = GSM_L_ADD( L_temp, L_result );
- * }
- *
- * if (L_result > EM) {
- * Mc = m;
- * EM = L_result;
- * }
- * }
- */
-
-#undef STEP
-#define STEP( m, i ) L_temp = SASR( x[m + 3 * i], 2 ); \
- L_result += L_temp * L_temp;
-
- /* common part of 0 and 3 */
-
- L_result = 0;
- STEP( 0, 1 ); STEP( 0, 2 ); STEP( 0, 3 ); STEP( 0, 4 );
- STEP( 0, 5 ); STEP( 0, 6 ); STEP( 0, 7 ); STEP( 0, 8 );
- STEP( 0, 9 ); STEP( 0, 10); STEP( 0, 11); STEP( 0, 12);
- L_common_0_3 = L_result;
-
- /* i = 0 */
-
- STEP( 0, 0 );
- L_result <<= 1; /* implicit in L_MULT */
- EM = L_result;
-
- /* i = 1 */
-
- L_result = 0;
- STEP( 1, 0 );
- STEP( 1, 1 ); STEP( 1, 2 ); STEP( 1, 3 ); STEP( 1, 4 );
- STEP( 1, 5 ); STEP( 1, 6 ); STEP( 1, 7 ); STEP( 1, 8 );
- STEP( 1, 9 ); STEP( 1, 10); STEP( 1, 11); STEP( 1, 12);
- L_result <<= 1;
- if (L_result > EM) {
- Mc = 1;
- EM = L_result;
- }
-
- /* i = 2 */
-
- L_result = 0;
- STEP( 2, 0 );
- STEP( 2, 1 ); STEP( 2, 2 ); STEP( 2, 3 ); STEP( 2, 4 );
- STEP( 2, 5 ); STEP( 2, 6 ); STEP( 2, 7 ); STEP( 2, 8 );
- STEP( 2, 9 ); STEP( 2, 10); STEP( 2, 11); STEP( 2, 12);
- L_result <<= 1;
- if (L_result > EM) {
- Mc = 2;
- EM = L_result;
- }
-
- /* i = 3 */
-
- L_result = L_common_0_3;
- STEP( 3, 12 );
- L_result <<= 1;
- if (L_result > EM) {
- Mc = 3;
- EM = L_result;
- }
-
- /**/
-
- /* Down-sampling by a factor 3 to get the selected xM[0..12]
- * RPE sequence.
- */
- for (i = 0; i <= 12; i ++) xM[i] = x[Mc + 3*i];
- *Mc_out = Mc;
-}
-
-/* 4.12.15 */
-
-static void APCM_quantization_xmaxc_to_exp_mant P3((xmaxc,exp_out,mant_out),
- word xmaxc, /* IN */
- word * exp_out, /* OUT */
- word * mant_out ) /* OUT */
-{
- word exp, mant;
-
- /* Compute exponent and mantissa of the decoded version of xmaxc
- */
-
- exp = 0;
- if (xmaxc > 15) exp = SASR(xmaxc, 3) - 1;
- mant = xmaxc - (exp << 3);
-
- if (mant == 0) {
- exp = -4;
- mant = 7;
- }
- else {
- while (mant <= 7) {
- mant = mant << 1 | 1;
- exp--;
- }
- mant -= 8;
- }
-
- _x_assert( exp >= -4 && exp <= 6 );
- _x_assert( mant >= 0 && mant <= 7 );
-
- *exp_out = exp;
- *mant_out = mant;
-}
-
-static void APCM_quantization P5((xM,xMc,mant_out,exp_out,xmaxc_out),
- word * xM, /* [0..12] IN */
-
- word * xMc, /* [0..12] OUT */
- word * mant_out, /* OUT */
- word * exp_out, /* OUT */
- word * xmaxc_out /* OUT */
-)
-{
- int i, itest;
-
- word xmax, xmaxc, temp, temp1, temp2;
- word exp, mant;
-
-
- /* Find the maximum absolute value xmax of xM[0..12].
- */
-
- xmax = 0;
- for (i = 0; i <= 12; i++) {
- temp = xM[i];
- temp = GSM_ABS(temp);
- if (temp > xmax) xmax = temp;
- }
-
- /* Qantizing and coding of xmax to get xmaxc.
- */
-
- exp = 0;
- temp = SASR( xmax, 9 );
- itest = 0;
-
- for (i = 0; i <= 5; i++) {
-
- itest |= (temp <= 0);
- temp = SASR( temp, 1 );
-
- _x_assert(exp <= 5);
- if (itest == 0) exp++; /* exp = add (exp, 1) */
- }
-
- _x_assert(exp <= 6 && exp >= 0);
- temp = exp + 5;
-
- _x_assert(temp <= 11 && temp >= 0);
- xmaxc = gsm_add( SASR(xmax, temp), exp << 3 );
-
- /* Quantizing and coding of the xM[0..12] RPE sequence
- * to get the xMc[0..12]
- */
-
- APCM_quantization_xmaxc_to_exp_mant( xmaxc, &exp, &mant );
-
- /* This computation uses the fact that the decoded version of xmaxc
- * can be calculated by using the exponent and the mantissa part of
- * xmaxc (logarithmic table).
- * So, this method avoids any division and uses only a scaling
- * of the RPE samples by a function of the exponent. A direct
- * multiplication by the inverse of the mantissa (NRFAC[0..7]
- * found in table 4.5) gives the 3 bit coded version xMc[0..12]
- * of the RPE samples.
- */
-
-
- /* Direct computation of xMc[0..12] using table 4.5
- */
-
- _x_assert((exp <= 4096) && (exp >= -4096));
- _x_assert((mant >= 0) && (mant <= 7));
-
- temp1 = 6 - exp; /* normalization by the exponent */
- temp2 = gsm_NRFAC[ mant ]; /* inverse mantissa */
-
- for (i = 0; i <= 12; i++) {
-
- _x_assert(temp1 >= 0 && temp1 < 16);
-
- temp = xM[i] << temp1;
- temp = GSM_MULT( temp, temp2 );
- temp = SASR(temp, 12);
- xMc[i] = temp + 4; /* see note below */
- }
-
- /* NOTE: This equation is used to make all the xMc[i] positive.
- */
-
- *mant_out = mant;
- *exp_out = exp;
- *xmaxc_out = xmaxc;
-}
-
-/* 4.2.16 */
-
-static void APCM_inverse_quantization P4((xMc,mant,exp,xMp),
- register word * xMc, /* [0..12] IN */
- word mant,
- word exp,
- register word * xMp) /* [0..12] OUT */
-/*
- * This part is for decoding the RPE sequence of coded xMc[0..12]
- * samples to obtain the xMp[0..12] array. Table 4.6 is used to get
- * the mantissa of xmaxc (FAC[0..7]).
- */
-{
- int i;
- word temp, temp1, temp2, temp3;
- longword ltmp;
-
- _x_assert((mant >= 0) && (mant <= 7));
-
- temp1 = gsm_FAC[ mant ]; /* see 4.2-15 for mant */
- temp2 = gsm_sub( 6, exp ); /* see 4.2-15 for exp */
- temp3 = gsm_asl( 1, gsm_sub( temp2, 1 ));
-
- for (i = 13; i--;) {
- _x_assert((mant >= 0) && (mant <= 7));
-
- _x_assert((*xMc <= 7) && (*xMc >= 0)); /* 3 bit unsigned */
-
- /* temp = gsm_sub( *xMc++ << 1, 7 ); */
- temp = (*xMc++ << 1) - 7; /* restore sign */
-
- _x_assert((temp <= 7) && (temp >= -7)); /* 4 bit signed */
-
- temp <<= 12; /* 16 bit signed */
- temp = GSM_MULT_R( temp1, temp );
- temp = GSM_ADD( temp, temp3 );
- *xMp++ = gsm_asr( temp, temp2 );
- }
-}
-
-/* 4.2.17 */
-
-static void RPE_grid_positioning P3((Mc,xMp,ep),
- word Mc, /* grid position IN */
- register word * xMp, /* [0..12] IN */
- register word * ep /* [0..39] OUT */
-)
-/*
- * This procedure computes the reconstructed long term residual signal
- * ep[0..39] for the LTP analysis filter. The inputs are the Mc
- * which is the grid position selection and the xMp[0..12] decoded
- * RPE samples which are upsampled by a factor of 3 by inserting zero
- * values.
- */
-{
- int i = 13;
-
- _x_assert((0 <= Mc) && (Mc <= 3));
-
- switch (Mc) {
- case 3: *ep++ = 0;
- case 2: do {
- *ep++ = 0;
- case 1: *ep++ = 0;
- case 0: *ep++ = *xMp++;
- } while (--i);
- }
- while (++Mc < 4) *ep++ = 0;
-
- /*
-
- int i, k;
- for (k = 0; k <= 39; k++) ep[k] = 0;
- for (i = 0; i <= 12; i++) {
- ep[ Mc + (3*i) ] = xMp[i];
- }
- */
-}
-
-/* 4.2.18 */
-
-/* This procedure adds the reconstructed long term residual signal
- * ep[0..39] to the estimated signal dpp[0..39] from the long term
- * analysis filter to compute the reconstructed short term residual
- * signal dp[-40..-1]; also the reconstructed short term residual
- * array dp[-120..-41] is updated.
- */
-
-#if 0 /* Has been inlined in code.c */
-void Gsm_Update_of_reconstructed_short_time_residual_signal P3((dpp, ep, dp),
- word * dpp, /* [0...39] IN */
- word * ep, /* [0...39] IN */
- word * dp) /* [-120...-1] IN/OUT */
-{
- int k;
-
- for (k = 0; k <= 79; k++)
- dp[ -120 + k ] = dp[ -80 + k ];
-
- for (k = 0; k <= 39; k++)
- dp[ -40 + k ] = gsm_add( ep[k], dpp[k] );
-}
-#endif /* Has been inlined in code.c */
-
-void Gsm_RPE_Encoding P5((S,e,xmaxc,Mc,xMc),
-
- struct gsm_state * S,
-
- word * e, /* -5..-1][0..39][40..44 IN/OUT */
- word * xmaxc, /* OUT */
- word * Mc, /* OUT */
- word * xMc) /* [0..12] OUT */
-{
- word x[40];
- word xM[13], xMp[13];
- word mant, exp;
-
- Weighting_filter(e, x);
- RPE_grid_selection(x, xM, Mc);
-
- APCM_quantization( xM, xMc, &mant, &exp, xmaxc);
- APCM_inverse_quantization( xMc, mant, exp, xMp);
-
- RPE_grid_positioning( *Mc, xMp, e );
-
-}
-
-void Gsm_RPE_Decoding P5((S, xmaxcr, Mcr, xMcr, erp),
- struct gsm_state * S,
-
- word xmaxcr,
- word Mcr,
- word * xMcr, /* [0..12], 3 bits IN */
- word * erp /* [0..39] OUT */
-)
-{
- word exp, mant;
- word xMp[ 13 ];
-
- APCM_quantization_xmaxc_to_exp_mant( xmaxcr, &exp, &mant );
- APCM_inverse_quantization( xMcr, mant, exp, xMp );
- RPE_grid_positioning( Mcr, xMp, erp );
-
-}
diff --git a/src/libxineadec/gsm610/short_term.c b/src/libxineadec/gsm610/short_term.c
deleted file mode 100644
index 8222b2caa..000000000
--- a/src/libxineadec/gsm610/short_term.c
+++ /dev/null
@@ -1,428 +0,0 @@
-/*
- * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
- * Universitaet Berlin. See the accompanying file "COPYRIGHT" for
- * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
- */
-
-/* $Header: /nfshome/cvs/xine-lib/src/libxineadec/gsm610/short_term.c,v 1.3 2003/12/07 15:34:30 f1rmb Exp $ */
-
-#include <stdio.h>
-#include "xineutils.h"
-#include "private.h"
-
-#include "gsm.h"
-#include "proto.h"
-
-/*
- * SHORT TERM ANALYSIS FILTERING SECTION
- */
-
-/* 4.2.8 */
-
-static void Decoding_of_the_coded_Log_Area_Ratios P2((LARc,LARpp),
- word * LARc, /* coded log area ratio [0..7] IN */
- word * LARpp) /* out: decoded .. */
-{
- register word temp1 /* , temp2 */;
- register long ltmp; /* for GSM_ADD */
-
- /* This procedure requires for efficient implementation
- * two tables.
- *
- * INVA[1..8] = integer( (32768 * 8) / real_A[1..8])
- * MIC[1..8] = minimum value of the LARc[1..8]
- */
-
- /* Compute the LARpp[1..8]
- */
-
- /* for (i = 1; i <= 8; i++, B++, MIC++, INVA++, LARc++, LARpp++) {
- *
- * temp1 = GSM_ADD( *LARc, *MIC ) << 10;
- * temp2 = *B << 1;
- * temp1 = GSM_SUB( temp1, temp2 );
- *
- * _x_assert(*INVA != MIN_WORD);
- *
- * temp1 = GSM_MULT_R( *INVA, temp1 );
- * *LARpp = GSM_ADD( temp1, temp1 );
- * }
- */
-
-#undef STEP
-#define STEP( B, MIC, INVA ) \
- temp1 = GSM_ADD( *LARc++, MIC ) << 10; \
- temp1 = GSM_SUB( temp1, B << 1 ); \
- temp1 = GSM_MULT_R( INVA, temp1 ); \
- *LARpp++ = GSM_ADD( temp1, temp1 );
-
- STEP( 0, -32, 13107 );
- STEP( 0, -32, 13107 );
- STEP( 2048, -16, 13107 );
- STEP( -2560, -16, 13107 );
-
- STEP( 94, -8, 19223 );
- STEP( -1792, -8, 17476 );
- STEP( -341, -4, 31454 );
- STEP( -1144, -4, 29708 );
-
- /* NOTE: the addition of *MIC is used to restore
- * the sign of *LARc.
- */
-}
-
-/* 4.2.9 */
-/* Computation of the quantized reflection coefficients
- */
-
-/* 4.2.9.1 Interpolation of the LARpp[1..8] to get the LARp[1..8]
- */
-
-/*
- * Within each frame of 160 analyzed speech samples the short term
- * analysis and synthesis filters operate with four different sets of
- * coefficients, derived from the previous set of decoded LARs(LARpp(j-1))
- * and the actual set of decoded LARs (LARpp(j))
- *
- * (Initial value: LARpp(j-1)[1..8] = 0.)
- */
-
-static void Coefficients_0_12 P3((LARpp_j_1, LARpp_j, LARp),
- register word * LARpp_j_1,
- register word * LARpp_j,
- register word * LARp)
-{
- register int i;
- register longword ltmp;
-
- for (i = 1; i <= 8; i++, LARp++, LARpp_j_1++, LARpp_j++) {
- *LARp = GSM_ADD( SASR( *LARpp_j_1, 2 ), SASR( *LARpp_j, 2 ));
- *LARp = GSM_ADD( *LARp, SASR( *LARpp_j_1, 1));
- }
-}
-
-static void Coefficients_13_26 P3((LARpp_j_1, LARpp_j, LARp),
- register word * LARpp_j_1,
- register word * LARpp_j,
- register word * LARp)
-{
- register int i;
- register longword ltmp;
- for (i = 1; i <= 8; i++, LARpp_j_1++, LARpp_j++, LARp++) {
- *LARp = GSM_ADD( SASR( *LARpp_j_1, 1), SASR( *LARpp_j, 1 ));
- }
-}
-
-static void Coefficients_27_39 P3((LARpp_j_1, LARpp_j, LARp),
- register word * LARpp_j_1,
- register word * LARpp_j,
- register word * LARp)
-{
- register int i;
- register longword ltmp;
-
- for (i = 1; i <= 8; i++, LARpp_j_1++, LARpp_j++, LARp++) {
- *LARp = GSM_ADD( SASR( *LARpp_j_1, 2 ), SASR( *LARpp_j, 2 ));
- *LARp = GSM_ADD( *LARp, SASR( *LARpp_j, 1 ));
- }
-}
-
-
-static void Coefficients_40_159 P2((LARpp_j, LARp),
- register word * LARpp_j,
- register word * LARp)
-{
- register int i;
-
- for (i = 1; i <= 8; i++, LARp++, LARpp_j++)
- *LARp = *LARpp_j;
-}
-
-/* 4.2.9.2 */
-
-static void LARp_to_rp P1((LARp),
- register word * LARp) /* [0..7] IN/OUT */
-/*
- * The input of this procedure is the interpolated LARp[0..7] array.
- * The reflection coefficients, rp[i], are used in the analysis
- * filter and in the synthesis filter.
- */
-{
- register int i;
- register word temp;
- register longword ltmp;
-
- for (i = 1; i <= 8; i++, LARp++) {
-
- /* temp = GSM_ABS( *LARp );
- *
- * if (temp < 11059) temp <<= 1;
- * else if (temp < 20070) temp += 11059;
- * else temp = GSM_ADD( temp >> 2, 26112 );
- *
- * *LARp = *LARp < 0 ? -temp : temp;
- */
-
- if (*LARp < 0) {
- temp = *LARp == MIN_WORD ? MAX_WORD : -(*LARp);
- *LARp = - ((temp < 11059) ? temp << 1
- : ((temp < 20070) ? temp + 11059
- : GSM_ADD( temp >> 2, 26112 )));
- } else {
- temp = *LARp;
- *LARp = (temp < 11059) ? temp << 1
- : ((temp < 20070) ? temp + 11059
- : GSM_ADD( temp >> 2, 26112 ));
- }
- }
-}
-
-
-/* 4.2.10 */
-static void Short_term_analysis_filtering P4((S,rp,k_n,s),
- struct gsm_state * S,
- register word * rp, /* [0..7] IN */
- register int k_n, /* k_end - k_start */
- register word * s /* [0..n-1] IN/OUT */
-)
-/*
- * This procedure computes the short term residual signal d[..] to be fed
- * to the RPE-LTP loop from the s[..] signal and from the local rp[..]
- * array (quantized reflection coefficients). As the call of this
- * procedure can be done in many ways (see the interpolation of the LAR
- * coefficient), it is assumed that the computation begins with index
- * k_start (for arrays d[..] and s[..]) and stops with index k_end
- * (k_start and k_end are defined in 4.2.9.1). This procedure also
- * needs to keep the array u[0..7] in memory for each call.
- */
-{
- register word * u = S->u;
- register int i;
- register word di, zzz, ui, sav, rpi;
- register longword ltmp;
-
- for (; k_n--; s++) {
-
- di = sav = *s;
-
- for (i = 0; i < 8; i++) { /* YYY */
-
- ui = u[i];
- rpi = rp[i];
- u[i] = sav;
-
- zzz = GSM_MULT_R(rpi, di);
- sav = GSM_ADD( ui, zzz);
-
- zzz = GSM_MULT_R(rpi, ui);
- di = GSM_ADD( di, zzz );
- }
-
- *s = di;
- }
-}
-
-#if defined(USE_FLOAT_MUL) && defined(FAST)
-
-static void Fast_Short_term_analysis_filtering P4((S,rp,k_n,s),
- struct gsm_state * S,
- register word * rp, /* [0..7] IN */
- register int k_n, /* k_end - k_start */
- register word * s /* [0..n-1] IN/OUT */
-)
-{
- register word * u = S->u;
- register int i;
-
- float uf[8],
- rpf[8];
-
- register float scalef = 3.0517578125e-5;
- register float sav, di, temp;
-
- for (i = 0; i < 8; ++i) {
- uf[i] = u[i];
- rpf[i] = rp[i] * scalef;
- }
- for (; k_n--; s++) {
- sav = di = *s;
- for (i = 0; i < 8; ++i) {
- register float rpfi = rpf[i];
- register float ufi = uf[i];
-
- uf[i] = sav;
- temp = rpfi * di + ufi;
- di += rpfi * ufi;
- sav = temp;
- }
- *s = di;
- }
- for (i = 0; i < 8; ++i) u[i] = uf[i];
-}
-#endif /* ! (defined (USE_FLOAT_MUL) && defined (FAST)) */
-
-static void Short_term_synthesis_filtering P5((S,rrp,k,wt,sr),
- struct gsm_state * S,
- register word * rrp, /* [0..7] IN */
- register int k, /* k_end - k_start */
- register word * wt, /* [0..k-1] IN */
- register word * sr /* [0..k-1] OUT */
-)
-{
- register word * v = S->v;
- register int i;
- register word sri, tmp1, tmp2;
- register longword ltmp; /* for GSM_ADD & GSM_SUB */
-
- while (k--) {
- sri = *wt++;
- for (i = 8; i--;) {
-
- /* sri = GSM_SUB( sri, gsm_mult_r( rrp[i], v[i] ) );
- */
- tmp1 = rrp[i];
- tmp2 = v[i];
- tmp2 = ( tmp1 == MIN_WORD && tmp2 == MIN_WORD
- ? MAX_WORD
- : 0x0FFFF & (( (longword)tmp1 * (longword)tmp2
- + 16384) >> 15)) ;
-
- sri = GSM_SUB( sri, tmp2 );
-
- /* v[i+1] = GSM_ADD( v[i], gsm_mult_r( rrp[i], sri ) );
- */
- tmp1 = ( tmp1 == MIN_WORD && sri == MIN_WORD
- ? MAX_WORD
- : 0x0FFFF & (( (longword)tmp1 * (longword)sri
- + 16384) >> 15)) ;
-
- v[i+1] = GSM_ADD( v[i], tmp1);
- }
- *sr++ = v[0] = sri;
- }
-}
-
-
-#if defined(FAST) && defined(USE_FLOAT_MUL)
-
-static void Fast_Short_term_synthesis_filtering P5((S,rrp,k,wt,sr),
- struct gsm_state * S,
- register word * rrp, /* [0..7] IN */
- register int k, /* k_end - k_start */
- register word * wt, /* [0..k-1] IN */
- register word * sr /* [0..k-1] OUT */
-)
-{
- register word * v = S->v;
- register int i;
-
- float va[9], rrpa[8];
- register float scalef = 3.0517578125e-5, temp;
-
- for (i = 0; i < 8; ++i) {
- va[i] = v[i];
- rrpa[i] = (float)rrp[i] * scalef;
- }
- while (k--) {
- register float sri = *wt++;
- for (i = 8; i--;) {
- sri -= rrpa[i] * va[i];
- if (sri < -32768.) sri = -32768.;
- else if (sri > 32767.) sri = 32767.;
-
- temp = va[i] + rrpa[i] * sri;
- if (temp < -32768.) temp = -32768.;
- else if (temp > 32767.) temp = 32767.;
- va[i+1] = temp;
- }
- *sr++ = va[0] = sri;
- }
- for (i = 0; i < 9; ++i) v[i] = va[i];
-}
-
-#endif /* defined(FAST) && defined(USE_FLOAT_MUL) */
-
-void Gsm_Short_Term_Analysis_Filter P3((S,LARc,s),
-
- struct gsm_state * S,
-
- word * LARc, /* coded log area ratio [0..7] IN */
- word * s /* signal [0..159] IN/OUT */
-)
-{
- word * LARpp_j = S->LARpp[ S->j ];
- word * LARpp_j_1 = S->LARpp[ S->j ^= 1 ];
-
- word LARp[8];
-
-#undef FILTER
-#if defined(FAST) && defined(USE_FLOAT_MUL)
-# define FILTER (* (S->fast \
- ? Fast_Short_term_analysis_filtering \
- : Short_term_analysis_filtering ))
-
-#else
-# define FILTER Short_term_analysis_filtering
-#endif
-
- Decoding_of_the_coded_Log_Area_Ratios( LARc, LARpp_j );
-
- Coefficients_0_12( LARpp_j_1, LARpp_j, LARp );
- LARp_to_rp( LARp );
- FILTER( S, LARp, 13, s);
-
- Coefficients_13_26( LARpp_j_1, LARpp_j, LARp);
- LARp_to_rp( LARp );
- FILTER( S, LARp, 14, s + 13);
-
- Coefficients_27_39( LARpp_j_1, LARpp_j, LARp);
- LARp_to_rp( LARp );
- FILTER( S, LARp, 13, s + 27);
-
- Coefficients_40_159( LARpp_j, LARp);
- LARp_to_rp( LARp );
- FILTER( S, LARp, 120, s + 40);
-}
-
-void Gsm_Short_Term_Synthesis_Filter P4((S, LARcr, wt, s),
- struct gsm_state * S,
-
- word * LARcr, /* received log area ratios [0..7] IN */
- word * wt, /* received d [0..159] IN */
-
- word * s /* signal s [0..159] OUT */
-)
-{
- word * LARpp_j = S->LARpp[ S->j ];
- word * LARpp_j_1 = S->LARpp[ S->j ^=1 ];
-
- word LARp[8];
-
-#undef FILTER
-#if defined(FAST) && defined(USE_FLOAT_MUL)
-
-# define FILTER (* (S->fast \
- ? Fast_Short_term_synthesis_filtering \
- : Short_term_synthesis_filtering ))
-#else
-# define FILTER Short_term_synthesis_filtering
-#endif
-
- Decoding_of_the_coded_Log_Area_Ratios( LARcr, LARpp_j );
-
- Coefficients_0_12( LARpp_j_1, LARpp_j, LARp );
- LARp_to_rp( LARp );
- FILTER( S, LARp, 13, wt, s );
-
- Coefficients_13_26( LARpp_j_1, LARpp_j, LARp);
- LARp_to_rp( LARp );
- FILTER( S, LARp, 14, wt + 13, s + 13 );
-
- Coefficients_27_39( LARpp_j_1, LARpp_j, LARp);
- LARp_to_rp( LARp );
- FILTER( S, LARp, 13, wt + 27, s + 27 );
-
- Coefficients_40_159( LARpp_j, LARp );
- LARp_to_rp( LARp );
- FILTER(S, LARp, 120, wt + 40, s + 40);
-}
diff --git a/src/libxineadec/gsm610/table.c b/src/libxineadec/gsm610/table.c
deleted file mode 100644
index 797685c07..000000000
--- a/src/libxineadec/gsm610/table.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
- * Universitaet Berlin. See the accompanying file "COPYRIGHT" for
- * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
- */
-
-/* $Header: /nfshome/cvs/xine-lib/src/libxineadec/gsm610/table.c,v 1.1 2002/10/12 19:12:49 tmmm Exp $ */
-
-/* Most of these tables are inlined at their point of use.
- */
-
-/* 4.4 TABLES USED IN THE FIXED POINT IMPLEMENTATION OF THE RPE-LTP
- * CODER AND DECODER
- *
- * (Most of them inlined, so watch out.)
- */
-
-#define GSM_TABLE_C
-#include "private.h"
-#include "gsm.h"
-
-/* Table 4.1 Quantization of the Log.-Area Ratios
- */
-/* i 1 2 3 4 5 6 7 8 */
-word gsm_A[8] = {20480, 20480, 20480, 20480, 13964, 15360, 8534, 9036};
-word gsm_B[8] = { 0, 0, 2048, -2560, 94, -1792, -341, -1144};
-word gsm_MIC[8] = { -32, -32, -16, -16, -8, -8, -4, -4 };
-word gsm_MAC[8] = { 31, 31, 15, 15, 7, 7, 3, 3 };
-
-
-/* Table 4.2 Tabulation of 1/A[1..8]
- */
-word gsm_INVA[8]={ 13107, 13107, 13107, 13107, 19223, 17476, 31454, 29708 };
-
-
-/* Table 4.3a Decision level of the LTP gain quantizer
- */
-/* bc 0 1 2 3 */
-word gsm_DLB[4] = { 6554, 16384, 26214, 32767 };
-
-
-/* Table 4.3b Quantization levels of the LTP gain quantizer
- */
-/* bc 0 1 2 3 */
-word gsm_QLB[4] = { 3277, 11469, 21299, 32767 };
-
-
-/* Table 4.4 Coefficients of the weighting filter
- */
-/* i 0 1 2 3 4 5 6 7 8 9 10 */
-word gsm_H[11] = {-134, -374, 0, 2054, 5741, 8192, 5741, 2054, 0, -374, -134 };
-
-
-/* Table 4.5 Normalized inverse mantissa used to compute xM/xmax
- */
-/* i 0 1 2 3 4 5 6 7 */
-word gsm_NRFAC[8] = { 29128, 26215, 23832, 21846, 20165, 18725, 17476, 16384 };
-
-
-/* Table 4.6 Normalized direct mantissa used to compute xM/xmax
- */
-/* i 0 1 2 3 4 5 6 7 */
-word gsm_FAC[8] = { 18431, 20479, 22527, 24575, 26623, 28671, 30719, 32767 };
diff --git a/src/libxineadec/gsm610/unproto.h b/src/libxineadec/gsm610/unproto.h
deleted file mode 100644
index f49530c22..000000000
--- a/src/libxineadec/gsm610/unproto.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
- * Universitaet Berlin. See the accompanying file "COPYRIGHT" for
- * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
- */
-
-/*$Header: /nfshome/cvs/xine-lib/src/libxineadec/gsm610/unproto.h,v 1.1 2002/10/12 19:12:49 tmmm Exp $*/
-
-#ifdef PROTO_H /* sic */
-#undef PROTO_H
-
-#undef P
-#undef P0
-#undef P1
-#undef P2
-#undef P3
-#undef P4
-#undef P5
-#undef P6
-#undef P7
-#undef P8
-
-#endif /* PROTO_H */
diff --git a/src/libxineadec/nosefart/Makefile.am b/src/libxineadec/nosefart/Makefile.am
deleted file mode 100644
index 51cc3f238..000000000
--- a/src/libxineadec/nosefart/Makefile.am
+++ /dev/null
@@ -1,34 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-noinst_LTLIBRARIES = libnosefart.la
-
-libnosefart_la_SOURCES = \
- fds_snd.c \
- log.c \
- mmc5_snd.c \
- nes_apu.c \
- vrc7_snd.c \
- dis6502.c \
- fmopl.c \
- memguard.c \
- nes6502.c \
- nsf.c \
- vrcvisnd.c
-
-libnosefart_la_CFLAGS = $(VISIBILITY_FLAG) -DNSF_PLAYER -fno-strict-aliasing
-
-noinst_HEADERS = \
- dis6502.h \
- fmopl.h \
- memguard.h \
- nes6502.h \
- nsf.h \
- types.h \
- vrc7_snd.h \
- fds_snd.h \
- log.h \
- mmc5_snd.h \
- nes_apu.h \
- osd.h \
- version.h \
- vrcvisnd.h
diff --git a/src/libxineadec/nosefart/diff_to_nosefart_cvs.patch b/src/libxineadec/nosefart/diff_to_nosefart_cvs.patch
deleted file mode 100644
index 280cd89cb..000000000
--- a/src/libxineadec/nosefart/diff_to_nosefart_cvs.patch
+++ /dev/null
@@ -1,75 +0,0 @@
-diff -u -p -r1.1.1.1 types.h
---- types.h 26 Jul 2004 15:27:59 -0000 1.1.1.1
-+++ types.h 26 Aug 2004 16:00:07 -0000
-@@ -23,8 +23,8 @@
- ** $Id: diff_to_nosefart_cvs.patch,v 1.2 2005/05/07 09:11:39 valtri Exp $
- */
-
--#ifndef _TYPES_H_
--#define _TYPES_H_
-+#ifndef _NOSEFART_TYPES_H_
-+#define _NOSEFART_TYPES_H_
-
- #ifdef HAVE_CONFIG_H
- #include "config.h"
-@@ -88,7 +88,7 @@ typedef uint8 boolean;
- #define ASSERT_MSG(msg)
- #endif
-
--#endif /* _TYPES_H_ */
-+#endif /* _NOSEFART_TYPES_H_ */
-
- /*
- ** $Log: diff_to_nosefart_cvs.patch,v $
- ** Revision 1.2 2005/05/07 09:11:39 valtri
- ** *BUGFIX*
- ** gcc4 patches from Dams Nadé (livna.org) and Keenan Pepper.
- **
- ** Revision 1.1 2004/08/27 19:33:37 valtri
- ** MINGW32 port. Engine library and most of plugins compiles now.
- **
- ** List of some changes:
- ** - replaced some _MSC_VER by more common WIN32
- ** - define INTLDIR, remove -static flag for included intl
- ** - shared more common CFLAGS with DEBUG_CFLAGS
- ** - use WIN32_CFLAGS for all building
- ** - separate some flags into THREAD_CFLAGS_CONFIG,
- ** THREAD_CFLAGS_CONFIG and ZLIB_LIB_CONFIG for public xine-config,
- ** automatically use internal libs if necessary
- ** - don't warn about missing X for mingw and cygwin
- ** - libw32dll disabled for WIN32 (making native loader would be
- ** interesting, or porting wine code to Windows? :->)
- ** - DVB and RTP disabled for WIN32, not ported yet
- ** - fix build and fix a warning in cdda
- ** - fix build for nosefart and libfaad
- ** - implement configure option --disable-freetype
- ** - sync libxine.pc and xine-config.in
- ** - add -liberty to goom under WIN32
- ** - move original build files from included phread and zlib into archives
- ** and replace them by autotools
- **
-Index: nes_apu.c
-===================================================================
-RCS file: /home/valtri/CVS/xine-lib/src/libxineadec/nosefart/nes_apu.c,v
-retrieving revision 1.1.1.1
-diff -u -p -r1.1.1.1 nes_apu.c
---- nes_apu.c 12 Dec 2004 13:57:16 -0000 1.1.1.1
-+++ nes_apu.c 7 May 2005 08:23:36 -0000
-@@ -1011,10 +1011,13 @@ void apu_process(void *buffer, int num_s
- accum = -0x8000;
-
- /* signed 16-bit output, unsigned 8-bit */
-- if (16 == apu->sample_bits)
-- *((int16 *) buffer)++ = (int16) accum;
-- else
-- *((uint8 *) buffer)++ = (accum >> 8) ^ 0x80;
-+ if (16 == apu->sample_bits) {
-+ *((int16 *) buffer) = (int16) accum;
-+ buffer = (int16 *) buffer + 1;
-+ } else {
-+ *((uint8 *) buffer) = (accum >> 8) ^ 0x80;
-+ buffer = (int8 *) buffer + 1;
-+ }
- }
-
- /* resync cycle counter */
diff --git a/src/libxineadec/nosefart/dis6502.c b/src/libxineadec/nosefart/dis6502.c
deleted file mode 100644
index ff552d219..000000000
--- a/src/libxineadec/nosefart/dis6502.c
+++ /dev/null
@@ -1,474 +0,0 @@
-/*
-** Nofrendo (c) 1998-2000 Matthew Conte (matt@conte.com)
-**
-**
-** This program is free software; you can redistribute it and/or
-** modify it under the terms of version 2 of the GNU Library General
-** Public License as published by the Free Software Foundation.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-** Library General Public License for more details. To obtain a
-** copy of the GNU Library General Public License, write to the Free
-** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-**
-** Any permitted reproduction of these routines, in whole or in part,
-** must bear this legend.
-**
-**
-** dis6502.c
-**
-** 6502 disassembler based on code from John Saeger
-** $Id: dis6502.c,v 1.2 2003/12/05 15:55:01 f1rmb Exp $
-*/
-
-#include "types.h"
-#include "log.h"
-#include "nes6502.h"
-#include "dis6502.h"
-
-#ifdef NES6502_DEBUG
-
-/* addressing modes */
-enum { _imp, _acc, _rel, _imm, _abs, _abs_x, _abs_y, _zero, _zero_x, _zero_y, _ind, _ind_x, _ind_y };
-
-/* keep a filthy local copy of PC to
-** reduce the amount of parameter passing
-*/
-static uint32 pc_reg;
-
-
-static uint8 dis_op8(void)
-{
- return (nes6502_getbyte(pc_reg + 1));
-}
-
-static uint16 dis_op16(void)
-{
- return (nes6502_getbyte(pc_reg + 1) + (nes6502_getbyte(pc_reg + 2) << 8));
-}
-
-static void dis_show_ind(void)
-{
- log_printf("(%04X) ", dis_op16());
-}
-
-static void dis_show_ind_x(void)
-{
- log_printf("(%02X,x) ", dis_op8());
-}
-
-static void dis_show_ind_y(void)
-{
- log_printf("(%02X),y ", dis_op8());
-}
-
-static void dis_show_zero_x(void)
-{
- log_printf(" %02X,x ", dis_op8());
-}
-
-static void dis_show_zero_y(void)
-{
- log_printf(" %02X,y ", dis_op8());
-}
-
-static void dis_show_abs_y(void)
-{
- log_printf(" %04X,y ", dis_op16());
-}
-
-static void dis_show_abs_x(void)
-{
- log_printf(" %04X,x ", dis_op16());
-}
-
-static void dis_show_zero(void)
-{
- log_printf(" %02X ", dis_op8());
-}
-
-static void dis_show_abs(void)
-{
- log_printf(" %04X ", dis_op16());
-}
-
-static void dis_show_immediate(void)
-{
- log_printf("#%02X ", dis_op8());
-}
-
-static void dis_show_acc(void)
-{
- log_printf(" a ");
-}
-
-static void dis_show_relative(void)
-{
- int target;
-
- target = (int8) dis_op8();
- target += (pc_reg + 2);
- log_printf(" %04X ", target);
-}
-
-static void dis_show_code(int optype)
-{
- log_printf("%02X ", nes6502_getbyte(pc_reg));
-
- switch (optype)
- {
- case _imp:
- case _acc:
- log_printf(" ");
- break;
-
- case _rel:
- case _imm:
- case _zero:
- case _zero_x:
- log_printf("%02X ", nes6502_getbyte(pc_reg + 1));
- break;
-
- case _abs:
- case _abs_x:
- case _abs_y:
- case _ind:
- case _ind_x:
- case _ind_y:
- log_printf("%02X %02X ", nes6502_getbyte(pc_reg + 1), nes6502_getbyte(pc_reg + 2));
- break;
- }
-}
-
-static void dis_show_op(char *opstr, int optype)
-{
- dis_show_code(optype);
- log_printf("%s ", opstr);
-
- switch(optype)
- {
- case _imp: log_printf(" "); break;
- case _acc: dis_show_acc(); break;
- case _rel: dis_show_relative(); break;
- case _imm: dis_show_immediate(); break;
- case _abs: dis_show_abs(); break;
- case _abs_x: dis_show_abs_x(); break;
- case _abs_y: dis_show_abs_y(); break;
- case _zero: dis_show_zero(); break;
- case _zero_x: dis_show_zero_x(); break;
- case _ind: dis_show_ind(); break;
- case _ind_x: dis_show_ind_x(); break;
- case _ind_y: dis_show_ind_y(); break;
- }
-}
-
-void nes6502_disasm(uint32 PC, uint8 P, uint8 A, uint8 X, uint8 Y, uint8 S)
-{
- pc_reg = PC;
-
- log_printf("%04X: ", pc_reg);
-
- switch(nes6502_getbyte(pc_reg))
- {
- case 0x00: dis_show_op("brk",_imp); break;
- case 0x01: dis_show_op("ora",_ind_x); break;
- case 0x02: dis_show_op("jam",_imp); break;
- case 0x03: dis_show_op("slo",_ind_x); break;
- case 0x04: dis_show_op("nop",_zero); break;
- case 0x05: dis_show_op("ora",_zero); break;
- case 0x06: dis_show_op("asl",_zero); break;
- case 0x07: dis_show_op("slo",_zero); break;
- case 0x08: dis_show_op("php",_imp); break;
- case 0x09: dis_show_op("ora",_imm); break;
- case 0x0a: dis_show_op("asl",_acc); break;
- case 0x0b: dis_show_op("anc",_imm); break;
- case 0x0c: dis_show_op("nop",_abs); break;
- case 0x0d: dis_show_op("ora",_abs); break;
- case 0x0e: dis_show_op("asl",_abs); break;
- case 0x0f: dis_show_op("slo",_abs); break;
-
- case 0x10: dis_show_op("bpl",_rel); break;
- case 0x11: dis_show_op("ora",_ind_y); break;
- case 0x12: dis_show_op("jam",_imp); break;
- case 0x13: dis_show_op("slo",_ind_y); break;
- case 0x14: dis_show_op("nop",_zero_x); break;
- case 0x15: dis_show_op("ora",_zero_x); break;
- case 0x16: dis_show_op("asl",_zero_x); break;
- case 0x17: dis_show_op("slo",_zero_x); break;
- case 0x18: dis_show_op("clc",_imp); break;
- case 0x19: dis_show_op("ora",_abs_y); break;
- case 0x1a: dis_show_op("nop",_imp); break;
- case 0x1b: dis_show_op("slo",_abs_y); break;
- case 0x1c: dis_show_op("nop",_abs_x); break;
- case 0x1d: dis_show_op("ora",_abs_x); break;
- case 0x1e: dis_show_op("asl",_abs_x); break;
- case 0x1f: dis_show_op("slo",_abs_x); break;
-
- case 0x20: dis_show_op("jsr",_abs); break;
- case 0x21: dis_show_op("and",_ind_x); break;
- case 0x22: dis_show_op("jam",_imp); break;
- case 0x23: dis_show_op("rla",_ind_x); break;
- case 0x24: dis_show_op("bit",_zero); break;
- case 0x25: dis_show_op("and",_zero); break;
- case 0x26: dis_show_op("rol",_zero); break;
- case 0x27: dis_show_op("rla",_zero); break;
- case 0x28: dis_show_op("plp",_imp); break;
- case 0x29: dis_show_op("and",_imm); break;
- case 0x2a: dis_show_op("rol",_acc); break;
- case 0x2b: dis_show_op("anc",_imm); break;
- case 0x2c: dis_show_op("bit",_abs); break;
- case 0x2d: dis_show_op("and",_abs); break;
- case 0x2e: dis_show_op("rol",_abs); break;
- case 0x2f: dis_show_op("rla",_abs); break;
-
- case 0x30: dis_show_op("bmi",_rel); break;
- case 0x31: dis_show_op("and",_ind_y); break;
- case 0x32: dis_show_op("jam",_imp); break;
- case 0x33: dis_show_op("rla",_ind_y); break;
-/* case 0x34: dis_show_op("nop",_zero); break;*/
- case 0x34: dis_show_op("nop",_imp); break;
- case 0x35: dis_show_op("and",_zero_x); break;
- case 0x36: dis_show_op("rol",_zero_x); break;
- case 0x37: dis_show_op("rla",_zero_x); break;
- case 0x38: dis_show_op("sec",_imp); break;
- case 0x39: dis_show_op("and",_abs_y); break;
- case 0x3a: dis_show_op("nop",_imp); break;
- case 0x3b: dis_show_op("rla",_abs_y); break;
-/* case 0x3c: dis_show_op("nop",_imp); break;*/
- case 0x3c: dis_show_op("nop",_abs_x); break;
- case 0x3d: dis_show_op("and",_abs_x); break;
- case 0x3e: dis_show_op("rol",_abs_x); break;
- case 0x3f: dis_show_op("rla",_abs_x); break;
-
- case 0x40: dis_show_op("rti",_imp); break;
- case 0x41: dis_show_op("eor",_ind_x); break;
- case 0x42: dis_show_op("jam",_imp); break;
- case 0x43: dis_show_op("sre",_ind_x); break;
- case 0x44: dis_show_op("nop",_zero); break;
- case 0x45: dis_show_op("eor",_zero); break;
- case 0x46: dis_show_op("lsr",_zero); break;
- case 0x47: dis_show_op("sre",_zero); break;
- case 0x48: dis_show_op("pha",_imp); break;
- case 0x49: dis_show_op("eor",_imm); break;
- case 0x4a: dis_show_op("lsr",_acc); break;
- case 0x4b: dis_show_op("asr",_imm); break;
- case 0x4c: dis_show_op("jmp",_abs); break;
- case 0x4d: dis_show_op("eor",_abs); break;
- case 0x4e: dis_show_op("lsr",_abs); break;
- case 0x4f: dis_show_op("sre",_abs); break;
-
- case 0x50: dis_show_op("bvc",_rel); break;
- case 0x51: dis_show_op("eor",_ind_y); break;
- case 0x52: dis_show_op("jam",_imp); break;
- case 0x53: dis_show_op("sre",_ind_y); break;
- case 0x54: dis_show_op("nop",_zero_x); break;
- case 0x55: dis_show_op("eor",_zero_x); break;
- case 0x56: dis_show_op("lsr",_zero_x); break;
- case 0x57: dis_show_op("sre",_zero_x); break;
- case 0x58: dis_show_op("cli",_imp); break;
- case 0x59: dis_show_op("eor",_abs_y); break;
- case 0x5a: dis_show_op("nop",_imp); break;
- case 0x5b: dis_show_op("sre",_abs_y); break;
- case 0x5c: dis_show_op("nop",_abs_x); break;
- case 0x5d: dis_show_op("eor",_abs_x); break;
- case 0x5e: dis_show_op("lsr",_abs_x); break;
- case 0x5f: dis_show_op("sre",_abs_x); break;
-
- case 0x60: dis_show_op("rts",_imp); break;
- case 0x61: dis_show_op("adc",_ind_x); break;
- case 0x62: dis_show_op("jam",_imp); break;
- case 0x63: dis_show_op("rra",_ind_x); break;
- case 0x64: dis_show_op("nop",_zero); break;
- case 0x65: dis_show_op("adc",_zero); break;
- case 0x66: dis_show_op("ror",_zero); break;
- case 0x67: dis_show_op("rra",_zero); break;
- case 0x68: dis_show_op("pla",_imp); break;
- case 0x69: dis_show_op("adc",_imm); break;
- case 0x6a: dis_show_op("ror",_acc); break;
- case 0x6b: dis_show_op("arr",_imm); break;
- case 0x6c: dis_show_op("jmp",_ind); break;
- case 0x6d: dis_show_op("adc",_abs); break;
- case 0x6e: dis_show_op("ror",_abs); break;
- case 0x6f: dis_show_op("rra",_abs); break;
-
- case 0x70: dis_show_op("bvs",_rel); break;
- case 0x71: dis_show_op("adc",_ind_y); break;
- case 0x72: dis_show_op("jam",_imp); break;
- case 0x73: dis_show_op("rra",_ind_y); break;
- case 0x74: dis_show_op("nop",_zero_x); break;
- case 0x75: dis_show_op("adc",_zero_x); break;
- case 0x76: dis_show_op("ror",_zero_x); break;
- case 0x77: dis_show_op("rra",_zero_x); break;
- case 0x78: dis_show_op("sei",_imp); break;
- case 0x79: dis_show_op("adc",_abs_y); break;
- case 0x7a: dis_show_op("nop",_imp); break;
- case 0x7b: dis_show_op("rra",_abs_y); break;
- case 0x7c: dis_show_op("nop",_abs_x); break;
- case 0x7d: dis_show_op("adc",_abs_x); break;
- case 0x7e: dis_show_op("ror",_abs_x); break;
- case 0x7f: dis_show_op("rra",_abs_x); break;
-
- case 0x80: dis_show_op("nop",_imm); break;
- case 0x81: dis_show_op("sta",_ind_x); break;
- case 0x82: dis_show_op("nop",_imm); break;
- case 0x83: dis_show_op("sax",_ind_x); break;
- case 0x84: dis_show_op("sty",_zero); break;
- case 0x85: dis_show_op("sta",_zero); break;
- case 0x86: dis_show_op("stx",_zero); break;
- case 0x87: dis_show_op("sax",_zero); break;
- case 0x88: dis_show_op("dey",_imp); break;
- case 0x89: dis_show_op("nop",_imm); break;
- case 0x8a: dis_show_op("txa",_imp); break;
- case 0x8b: dis_show_op("ane",_imm); break;
- case 0x8c: dis_show_op("sty",_abs); break;
- case 0x8d: dis_show_op("sta",_abs); break;
- case 0x8e: dis_show_op("stx",_abs); break;
- case 0x8f: dis_show_op("sax",_abs); break;
-
- case 0x90: dis_show_op("bcc",_rel); break;
- case 0x91: dis_show_op("sta",_ind_y); break;
- case 0x92: dis_show_op("jam",_imp); break;
- case 0x93: dis_show_op("sha",_ind_y); break;
- case 0x94: dis_show_op("sty",_zero_x); break;
- case 0x95: dis_show_op("sta",_zero_x); break;
- case 0x96: dis_show_op("stx",_zero_y); break;
- case 0x97: dis_show_op("sax",_zero_y); break;
- case 0x98: dis_show_op("tya",_imp); break;
- case 0x99: dis_show_op("sta",_abs_y); break;
- case 0x9a: dis_show_op("txs",_imp); break;
- case 0x9b: dis_show_op("shs",_abs_y); break;
- case 0x9c: dis_show_op("shy",_abs_x); break;
- case 0x9d: dis_show_op("sta",_abs_x); break;
- case 0x9e: dis_show_op("shx",_abs_y); break;
- case 0x9f: dis_show_op("sha",_abs_y); break;
-
- case 0xa0: dis_show_op("ldy",_imm); break;
- case 0xa1: dis_show_op("lda",_ind_x); break;
- case 0xa2: dis_show_op("ldx",_imm); break;
- case 0xa3: dis_show_op("lax",_ind_x); break;
- case 0xa4: dis_show_op("ldy",_zero); break;
- case 0xa5: dis_show_op("lda",_zero); break;
- case 0xa6: dis_show_op("ldx",_zero); break;
- case 0xa7: dis_show_op("lax",_zero); break;
- case 0xa8: dis_show_op("tay",_imp); break;
- case 0xa9: dis_show_op("lda",_imm); break;
- case 0xaa: dis_show_op("tax",_imp); break;
- case 0xab: dis_show_op("lxa",_imm); break;
- case 0xac: dis_show_op("ldy",_abs); break;
- case 0xad: dis_show_op("lda",_abs); break;
- case 0xae: dis_show_op("ldx",_abs); break;
- case 0xaf: dis_show_op("lax",_abs); break;
-
- case 0xb0: dis_show_op("bcs",_rel); break;
- case 0xb1: dis_show_op("lda",_ind_y); break;
- case 0xb2: dis_show_op("jam",_imp); break;
- case 0xb3: dis_show_op("lax",_ind_y); break;
- case 0xb4: dis_show_op("ldy",_zero_x); break;
- case 0xb5: dis_show_op("lda",_zero_x); break;
- case 0xb6: dis_show_op("ldx",_zero_y); break;
- case 0xb7: dis_show_op("lax",_zero_y); break;
- case 0xb8: dis_show_op("clv",_imp); break;
- case 0xb9: dis_show_op("lda",_abs_y); break;
- case 0xba: dis_show_op("tsx",_imp); break;
- case 0xbb: dis_show_op("las",_abs_y); break;
- case 0xbc: dis_show_op("ldy",_abs_x); break;
- case 0xbd: dis_show_op("lda",_abs_x); break;
- case 0xbe: dis_show_op("ldx",_abs_y); break;
- case 0xbf: dis_show_op("lax",_abs_y); break;
-
- case 0xc0: dis_show_op("cpy",_imm); break;
- case 0xc1: dis_show_op("cmp",_ind_x); break;
- case 0xc2: dis_show_op("nop",_imm); break;
- case 0xc3: dis_show_op("dcp",_ind_x); break;
- case 0xc4: dis_show_op("cpy",_zero); break;
- case 0xc5: dis_show_op("cmp",_zero); break;
- case 0xc6: dis_show_op("dec",_zero); break;
- case 0xc7: dis_show_op("dcp",_zero); break;
- case 0xc8: dis_show_op("iny",_imp); break;
- case 0xc9: dis_show_op("cmp",_imm); break;
- case 0xca: dis_show_op("dex",_imp); break;
- case 0xcb: dis_show_op("sbx",_imm); break;
- case 0xcc: dis_show_op("cpy",_abs); break;
- case 0xcd: dis_show_op("cmp",_abs); break;
- case 0xce: dis_show_op("dec",_abs); break;
- case 0xcf: dis_show_op("dcp",_abs); break;
-
- case 0xd0: dis_show_op("bne",_rel); break;
- case 0xd1: dis_show_op("cmp",_ind_y); break;
- case 0xd2: dis_show_op("jam",_imp); break;
- case 0xd3: dis_show_op("dcp",_ind_y); break;
- case 0xd4: dis_show_op("nop",_zero_x); break;
- case 0xd5: dis_show_op("cmp",_zero_x); break;
- case 0xd6: dis_show_op("dec",_zero_x); break;
- case 0xd7: dis_show_op("dcp",_zero_x); break;
- case 0xd8: dis_show_op("cld",_imp); break;
- case 0xd9: dis_show_op("cmp",_abs_y); break;
- case 0xda: dis_show_op("nop",_imp); break;
- case 0xdb: dis_show_op("dcp",_abs_y); break;
- case 0xdc: dis_show_op("nop",_abs_x); break;
- case 0xdd: dis_show_op("cmp",_abs_x); break;
- case 0xde: dis_show_op("dec",_abs_x); break;
- case 0xdf: dis_show_op("dcp",_abs_x); break;
-
- case 0xe0: dis_show_op("cpx",_imm); break;
- case 0xe1: dis_show_op("sbc",_ind_x); break;
- case 0xe2: dis_show_op("nop",_imm); break;
- case 0xe3: dis_show_op("isb",_ind_x); break;
- case 0xe4: dis_show_op("cpx",_zero); break;
- case 0xe5: dis_show_op("sbc",_zero); break;
- case 0xe6: dis_show_op("inc",_zero); break;
- case 0xe7: dis_show_op("isb",_zero); break;
- case 0xe8: dis_show_op("inx",_imp); break;
- case 0xe9: dis_show_op("sbc",_imm); break;
- case 0xea: dis_show_op("nop",_imp); break;
- case 0xeb: dis_show_op("sbc",_imm); break;
- case 0xec: dis_show_op("cpx",_abs); break;
- case 0xed: dis_show_op("sbc",_abs); break;
- case 0xee: dis_show_op("inc",_abs); break;
- case 0xef: dis_show_op("isb",_abs); break;
-
- case 0xf0: dis_show_op("beq",_rel); break;
- case 0xf1: dis_show_op("sbc",_ind_y); break;
- case 0xf2: dis_show_op("jam",_imp); break;
- case 0xf3: dis_show_op("isb",_ind_y); break;
- case 0xf4: dis_show_op("nop",_zero_x); break;
- case 0xf5: dis_show_op("sbc",_zero_x); break;
- case 0xf6: dis_show_op("inc",_zero_x); break;
- case 0xf7: dis_show_op("isb",_zero_x); break;
- case 0xf8: dis_show_op("sed",_imp); break;
- case 0xf9: dis_show_op("sbc",_abs_y); break;
- case 0xfa: dis_show_op("nop",_imp); break;
- case 0xfb: dis_show_op("isb",_abs_y); break;
- case 0xfc: dis_show_op("nop",_abs_x); break;
- case 0xfd: dis_show_op("sbc",_abs_x); break;
- case 0xfe: dis_show_op("inc",_abs_x); break;
- case 0xff: dis_show_op("isb",_abs_x); break;
- }
-
- log_printf("%c%c1%c%c%c%c%c %02X %02X %02X %02X\n",
- (P & N_FLAG) ? 'N' : 'n',
- (P & V_FLAG) ? 'V' : 'v',
- (P & V_FLAG) ? 'B' : 'b',
- (P & V_FLAG) ? 'D' : 'd',
- (P & V_FLAG) ? 'I' : 'i',
- (P & V_FLAG) ? 'Z' : 'z',
- (P & V_FLAG) ? 'C' : 'c',
- A, X, Y, S);
-}
-
-#endif /* NES6502_DEBUG */
-
-/*
-** $Log: dis6502.c,v $
-** Revision 1.2 2003/12/05 15:55:01 f1rmb
-** cleanup phase II. use xprintf when it's relevant, use xine_xmalloc when it's relevant too. Small other little fix (can't remember). Change few internal function prototype because it xine_t pointer need to be used if some xine's internal sections. NOTE: libdvd{nav,read} is still too noisy, i will take a look to made it quit, without invasive changes. To be continued...
-**
-** Revision 1.1 2003/01/08 07:04:35 tmmm
-** initial import of Nosefart sources
-**
-** Revision 1.4 2000/06/09 15:12:25 matt
-** initial revision
-**
-*/
diff --git a/src/libxineadec/nosefart/dis6502.h b/src/libxineadec/nosefart/dis6502.h
deleted file mode 100644
index a02fd73ae..000000000
--- a/src/libxineadec/nosefart/dis6502.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
-** Nofrendo (c) 1998-2000 Matthew Conte (matt@conte.com)
-**
-**
-** This program is free software; you can redistribute it and/or
-** modify it under the terms of version 2 of the GNU Library General
-** Public License as published by the Free Software Foundation.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-** Library General Public License for more details. To obtain a
-** copy of the GNU Library General Public License, write to the Free
-** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-**
-** Any permitted reproduction of these routines, in whole or in part,
-** must bear this legend.
-**
-**
-** dis6502.h
-**
-** 6502 disassembler header
-** $Id: dis6502.h,v 1.2 2003/12/05 15:55:01 f1rmb Exp $
-*/
-
-#ifndef _DIS6502_H_
-#define _DIS6502_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-extern void nes6502_disasm(uint32 PC, uint8 P, uint8 A, uint8 X, uint8 Y, uint8 S);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* !_DIS6502_H_ */
-
-/*
-** $Log: dis6502.h,v $
-** Revision 1.2 2003/12/05 15:55:01 f1rmb
-** cleanup phase II. use xprintf when it's relevant, use xine_xmalloc when it's relevant too. Small other little fix (can't remember). Change few internal function prototype because it xine_t pointer need to be used if some xine's internal sections. NOTE: libdvd{nav,read} is still too noisy, i will take a look to made it quit, without invasive changes. To be continued...
-**
-** Revision 1.1 2003/01/08 07:04:35 tmmm
-** initial import of Nosefart sources
-**
-** Revision 1.4 2000/06/09 15:12:25 matt
-** initial revision
-**
-*/
diff --git a/src/libxineadec/nosefart/fds_snd.c b/src/libxineadec/nosefart/fds_snd.c
deleted file mode 100644
index fe2e4d624..000000000
--- a/src/libxineadec/nosefart/fds_snd.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
-** Nofrendo (c) 1998-2000 Matthew Conte (matt@conte.com)
-**
-**
-** This program is free software; you can redistribute it and/or
-** modify it under the terms of version 2 of the GNU Library General
-** Public License as published by the Free Software Foundation.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-** Library General Public License for more details. To obtain a
-** copy of the GNU Library General Public License, write to the Free
-** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-**
-** Any permitted reproduction of these routines, in whole or in part,
-** must bear this legend.
-**
-**
-** fds_snd.c
-**
-** Famicom Disk System sound emulation
-** $Id: fds_snd.c,v 1.2 2003/12/05 15:55:01 f1rmb Exp $
-*/
-
-#include "types.h"
-#include "nes_apu.h"
-#include "fds_snd.h"
-
-static int32 fds_incsize = 0;
-
-/* mix sound channels together */
-static int32 fds_process(void)
-{
- int32 output;
- output = 0;
-
- return output;
-}
-
-/* write to registers */
-static void fds_write(uint32 address, uint8 value)
-{
-}
-
-/* reset state of vrcvi sound channels */
-static void fds_reset(void)
-{
- fds_incsize = apu_getcyclerate();
-}
-
-static void fds_init(void)
-{
-}
-
-/* TODO: bleh */
-static void fds_shutdown(void)
-{
-}
-
-static apu_memwrite fds_memwrite[] =
-{
- { 0x4040, 0x4092, fds_write },
- { -1, -1, NULL }
-};
-
-apuext_t fds_ext =
-{
- fds_init,
- fds_shutdown,
- fds_reset,
- fds_process,
- NULL, /* no reads */
- fds_memwrite
-};
-
-/*
-** $Log: fds_snd.c,v $
-** Revision 1.2 2003/12/05 15:55:01 f1rmb
-** cleanup phase II. use xprintf when it's relevant, use xine_xmalloc when it's relevant too. Small other little fix (can't remember). Change few internal function prototype because it xine_t pointer need to be used if some xine's internal sections. NOTE: libdvd{nav,read} is still too noisy, i will take a look to made it quit, without invasive changes. To be continued...
-**
-** Revision 1.1 2003/01/08 07:04:35 tmmm
-** initial import of Nosefart sources
-**
-** Revision 1.3 2000/07/03 02:18:53 matt
-** much better external module exporting
-**
-** Revision 1.2 2000/06/20 04:06:16 matt
-** migrated external sound definition to apu module
-**
-** Revision 1.1 2000/06/20 00:06:47 matt
-** initial revision
-**
-*/
diff --git a/src/libxineadec/nosefart/fds_snd.h b/src/libxineadec/nosefart/fds_snd.h
deleted file mode 100644
index 9d20b5b2a..000000000
--- a/src/libxineadec/nosefart/fds_snd.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-** Nofrendo (c) 1998-2000 Matthew Conte (matt@conte.com)
-**
-**
-** This program is free software; you can redistribute it and/or
-** modify it under the terms of version 2 of the GNU Library General
-** Public License as published by the Free Software Foundation.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-** Library General Public License for more details. To obtain a
-** copy of the GNU Library General Public License, write to the Free
-** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-**
-** Any permitted reproduction of these routines, in whole or in part,
-** must bear this legend.
-**
-**
-** fds_snd.h
-**
-** Famicom Disk System sound emulation
-** $Id: fds_snd.h,v 1.2 2003/12/05 15:55:01 f1rmb Exp $
-*/
-
-#ifndef _FDS_SND_H_
-#define _FDS_SND_H_
-
-#include "nes_apu.h"
-
-extern apuext_t fds_ext;
-
-
-#endif /* _VRCVISND_H_ */
-
-/*
-** $Log: fds_snd.h,v $
-** Revision 1.2 2003/12/05 15:55:01 f1rmb
-** cleanup phase II. use xprintf when it's relevant, use xine_xmalloc when it's relevant too. Small other little fix (can't remember). Change few internal function prototype because it xine_t pointer need to be used if some xine's internal sections. NOTE: libdvd{nav,read} is still too noisy, i will take a look to made it quit, without invasive changes. To be continued...
-**
-** Revision 1.1 2003/01/08 07:04:35 tmmm
-** initial import of Nosefart sources
-**
-** Revision 1.2 2000/06/20 04:06:16 matt
-** migrated external sound definition to apu module
-**
-** Revision 1.1 2000/06/20 00:06:47 matt
-** initial revision
-**
-*/
diff --git a/src/libxineadec/nosefart/fmopl.c b/src/libxineadec/nosefart/fmopl.c
deleted file mode 100644
index 29c884096..000000000
--- a/src/libxineadec/nosefart/fmopl.c
+++ /dev/null
@@ -1,1323 +0,0 @@
-/*
-**
-** File: fmopl.c -- software implementation of FM sound generator
-**
-** Copyright (C) 1999 Tatsuyuki Satoh , MultiArcadeMachineEmurator development
-**
-** Version 0.36f
-**
-*/
-
-/*
- preliminary :
- Problem :
- note:
-*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
-#include <math.h>
-//#include "driver.h" /* use M.A.M.E. */
-#include "fmopl.h"
-
-/* MPC - hacks */
-#include "types.h"
-#include "log.h"
-
-#ifndef PI
-#define PI 3.14159265358979323846
-#endif
-
-/* -------------------- preliminary define section --------------------- */
-/* attack/decay rate time rate */
-#define OPL_ARRATE 141280 /* RATE 4 = 2826.24ms @ 3.6MHz */
-#define OPL_DRRATE 1956000 /* RATE 4 = 39280.64ms @ 3.6MHz */
-
-#define DELTAT_MIXING_LEVEL (1) /* DELTA-T ADPCM MIXING LEVEL */
-
-#define FREQ_BITS 24 /* frequency turn */
-
-/* counter bits = 20 , octerve 7 */
-#define FREQ_RATE (1<<(FREQ_BITS-20))
-#define TL_BITS (FREQ_BITS+2)
-
-/* final output shift , limit minimum and maximum */
-#define OPL_OUTSB (TL_BITS+3-16) /* OPL output final shift 16bit */
-#define OPL_MAXOUT (0x7fff<<OPL_OUTSB)
-#define OPL_MINOUT (-0x8000<<OPL_OUTSB)
-
-/* -------------------- quality selection --------------------- */
-
-/* sinwave entries */
-/* used static memory = SIN_ENT * 4 (byte) */
-#define SIN_ENT 2048
-
-/* output level entries (envelope,sinwave) */
-/* envelope counter lower bits */
-#define ENV_BITS 16
-/* envelope output entries */
-#define EG_ENT 4096
-/* used dynamic memory = EG_ENT*4*4(byte)or EG_ENT*6*4(byte) */
-/* used static memory = EG_ENT*4 (byte) */
-
-#define EG_OFF ((2*EG_ENT)<<ENV_BITS) /* OFF */
-#define EG_DED EG_OFF
-#define EG_DST (EG_ENT<<ENV_BITS) /* DECAY START */
-#define EG_AED EG_DST
-#define EG_AST 0 /* ATTACK START */
-
-#define EG_STEP (96.0/EG_ENT) /* OPL is 0.1875 dB step */
-
-/* LFO table entries */
-#define VIB_ENT 512
-#define VIB_SHIFT (32-9)
-#define AMS_ENT 512
-#define AMS_SHIFT (32-9)
-
-#define VIB_RATE 256
-
-/* -------------------- local defines , macros --------------------- */
-
-/* register number to channel number , slot offset */
-#define SLOT1 0
-#define SLOT2 1
-
-/* envelope phase */
-#define ENV_MOD_RR 0x00
-#define ENV_MOD_DR 0x01
-#define ENV_MOD_AR 0x02
-
-/* -------------------- tables --------------------- */
-static const int slot_array[32]=
-{
- 0, 2, 4, 1, 3, 5,-1,-1,
- 6, 8,10, 7, 9,11,-1,-1,
- 12,14,16,13,15,17,-1,-1,
- -1,-1,-1,-1,-1,-1,-1,-1
-};
-
-/* key scale level */
-#define ML(x) ((UINT32)((x)*0.1875*2/EG_STEP))
-static const UINT32 KSL_TABLE[8*16]=
-{
- /* OCT 0 */
- ML(0.000), ML(0.000), ML(0.000), ML(0.000),
- ML(0.000), ML(0.000), ML(0.000), ML(0.000),
- ML(0.000), ML(0.000), ML(0.000), ML(0.000),
- ML(0.000), ML(0.000), ML(0.000), ML(0.000),
- /* OCT 1 */
- ML(0.000), ML(0.000), ML(0.000), ML(0.000),
- ML(0.000), ML(0.000), ML(0.000), ML(0.000),
- ML(0.000), ML(0.750), ML(1.125), ML(1.500),
- ML(1.875), ML(2.250), ML(2.625), ML(3.000),
- /* OCT 2 */
- ML(0.000), ML(0.000), ML(0.000), ML(0.000),
- ML(0.000), ML(1.125), ML(1.875), ML(2.625),
- ML(3.000), ML(3.750), ML(4.125), ML(4.500),
- ML(4.875), ML(5.250), ML(5.625), ML(6.000),
- /* OCT 3 */
- ML(0.000), ML(0.000), ML(0.000), ML(1.875),
- ML(3.000), ML(4.125), ML(4.875), ML(5.625),
- ML(6.000), ML(6.750), ML(7.125), ML(7.500),
- ML(7.875), ML(8.250), ML(8.625), ML(9.000),
- /* OCT 4 */
- ML(0.000), ML(0.000), ML(3.000), ML(4.875),
- ML(6.000), ML(7.125), ML(7.875), ML(8.625),
- ML(9.000), ML(9.750),ML(10.125),ML(10.500),
- ML(10.875),ML(11.250),ML(11.625),ML(12.000),
- /* OCT 5 */
- ML(0.000), ML(3.000), ML(6.000), ML(7.875),
- ML(9.000),ML(10.125),ML(10.875),ML(11.625),
- ML(12.000),ML(12.750),ML(13.125),ML(13.500),
- ML(13.875),ML(14.250),ML(14.625),ML(15.000),
- /* OCT 6 */
- ML(0.000), ML(6.000), ML(9.000),ML(10.875),
- ML(12.000),ML(13.125),ML(13.875),ML(14.625),
- ML(15.000),ML(15.750),ML(16.125),ML(16.500),
- ML(16.875),ML(17.250),ML(17.625),ML(18.000),
- /* OCT 7 */
- ML(0.000), ML(9.000),ML(12.000),ML(13.875),
- ML(15.000),ML(16.125),ML(16.875),ML(17.625),
- ML(18.000),ML(18.750),ML(19.125),ML(19.500),
- ML(19.875),ML(20.250),ML(20.625),ML(21.000)
-};
-#undef ML
-
-/* sustain lebel table (3db per step) */
-/* 0 - 15: 0, 3, 6, 9,12,15,18,21,24,27,30,33,36,39,42,93 (dB)*/
-#define SC(db) ((INT32) (db*((3/EG_STEP)*(1<<ENV_BITS)))+EG_DST)
-static const INT32 SL_TABLE[16]={
- SC( 0),SC( 1),SC( 2),SC(3 ),SC(4 ),SC(5 ),SC(6 ),SC( 7),
- SC( 8),SC( 9),SC(10),SC(11),SC(12),SC(13),SC(14),SC(31)
-};
-#undef SC
-
-#define TL_MAX (EG_ENT*2) /* limit(tl + ksr + envelope) + sinwave */
-/* TotalLevel : 48 24 12 6 3 1.5 0.75 (dB) */
-/* TL_TABLE[ 0 to TL_MAX ] : plus section */
-/* TL_TABLE[ TL_MAX to TL_MAX+TL_MAX-1 ] : minus section */
-static INT32 *TL_TABLE;
-
-/* pointers to TL_TABLE with sinwave output offset */
-static INT32 **SIN_TABLE;
-
-/* LFO table */
-static INT32 *AMS_TABLE;
-static INT32 *VIB_TABLE;
-
-/* envelope output curve table */
-/* attack + decay + OFF */
-static INT32 ENV_CURVE[2*EG_ENT+1];
-
-/* multiple table */
-#define ML(x) ((UINT32) (2*(x)))
-static const UINT32 MUL_TABLE[16]= {
-/* 1/2, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15 */
- ML(0.50), ML(1.00), ML(2.00), ML(3.00), ML(4.00), ML(5.00), ML(6.00), ML(7.00),
- ML(8.00), ML(9.00),ML(10.00),ML(10.00),ML(12.00),ML(12.00),ML(15.00),ML(15.00)
-};
-#undef ML
-
-/* dummy attack / decay rate ( when rate == 0 ) */
-static INT32 RATE_0[16]=
-{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
-
-/* -------------------- static state --------------------- */
-
-/* lock level of common table */
-static int num_lock = 0;
-
-/* work table */
-static void *cur_chip = NULL; /* current chip point */
-/* currenct chip state */
-/* static FMSAMPLE *bufL,*bufR; */
-static OPL_CH *S_CH;
-static OPL_CH *E_CH;
-OPL_SLOT *SLOT7_1,*SLOT7_2,*SLOT8_1,*SLOT8_2;
-
-static INT32 outd[1];
-static INT32 ams;
-static INT32 vib;
-INT32 *ams_table;
-INT32 *vib_table;
-static INT32 amsIncr;
-static INT32 vibIncr;
-static INT32 feedback2; /* connect for SLOT 2 */
-
-/* log output level */
-#define LOG_ERR 3 /* ERROR */
-#define LOG_WAR 2 /* WARNING */
-#define LOG_INF 1 /* INFORMATION */
-
-#define LOG_LEVEL LOG_INF
-
-//#define LOG(n,x) if( (n)>=LOG_LEVEL ) logerror x
-#define LOG(n,x) if( (n)>=LOG_LEVEL ) log_printf x
-
-/* --------------------- subroutines --------------------- */
-
-INLINE int Limit( int val, int max, int min ) {
- if ( val > max )
- val = max;
- else if ( val < min )
- val = min;
-
- return val;
-}
-
-/* status set and IRQ handling */
-INLINE void OPL_STATUS_SET(FM_OPL *OPL,int flag)
-{
- /* set status flag */
- OPL->status |= flag;
- if(!(OPL->status & 0x80))
- {
- if(OPL->status & OPL->statusmask)
- { /* IRQ on */
- OPL->status |= 0x80;
- /* callback user interrupt handler (IRQ is OFF to ON) */
- if(OPL->IRQHandler) (OPL->IRQHandler)(OPL->IRQParam,1);
- }
- }
-}
-
-/* status reset and IRQ handling */
-INLINE void OPL_STATUS_RESET(FM_OPL *OPL,int flag)
-{
- /* reset status flag */
- OPL->status &=~flag;
- if((OPL->status & 0x80))
- {
- if (!(OPL->status & OPL->statusmask) )
- {
- OPL->status &= 0x7f;
- /* callback user interrupt handler (IRQ is ON to OFF) */
- if(OPL->IRQHandler) (OPL->IRQHandler)(OPL->IRQParam,0);
- }
- }
-}
-
-/* IRQ mask set */
-INLINE void OPL_STATUSMASK_SET(FM_OPL *OPL,int flag)
-{
- OPL->statusmask = flag;
- /* IRQ handling check */
- OPL_STATUS_SET(OPL,0);
- OPL_STATUS_RESET(OPL,0);
-}
-
-/* ----- key on ----- */
-INLINE void OPL_KEYON(OPL_SLOT *SLOT)
-{
- /* sin wave restart */
- SLOT->Cnt = 0;
- /* set attack */
- SLOT->evm = ENV_MOD_AR;
- SLOT->evs = SLOT->evsa;
- SLOT->evc = EG_AST;
- SLOT->eve = EG_AED;
-}
-/* ----- key off ----- */
-INLINE void OPL_KEYOFF(OPL_SLOT *SLOT)
-{
- if( SLOT->evm > ENV_MOD_RR)
- {
- /* set envelope counter from envleope output */
- SLOT->evm = ENV_MOD_RR;
- if( !(SLOT->evc&EG_DST) )
- //SLOT->evc = (ENV_CURVE[SLOT->evc>>ENV_BITS]<<ENV_BITS) + EG_DST;
- SLOT->evc = EG_DST;
- SLOT->eve = EG_DED;
- SLOT->evs = SLOT->evsr;
- }
-}
-
-/* ---------- calcrate Envelope Generator & Phase Generator ---------- */
-/* return : envelope output */
-INLINE UINT32 OPL_CALC_SLOT( OPL_SLOT *SLOT )
-{
- /* calcrate envelope generator */
- if( (SLOT->evc+=SLOT->evs) >= SLOT->eve )
- {
- switch( SLOT->evm ){
- case ENV_MOD_AR: /* ATTACK -> DECAY1 */
- /* next DR */
- SLOT->evm = ENV_MOD_DR;
- SLOT->evc = EG_DST;
- SLOT->eve = SLOT->SL;
- SLOT->evs = SLOT->evsd;
- break;
- case ENV_MOD_DR: /* DECAY -> SL or RR */
- SLOT->evc = SLOT->SL;
- SLOT->eve = EG_DED;
- if(SLOT->eg_typ)
- {
- SLOT->evs = 0;
- }
- else
- {
- SLOT->evm = ENV_MOD_RR;
- SLOT->evs = SLOT->evsr;
- }
- break;
- case ENV_MOD_RR: /* RR -> OFF */
- SLOT->evc = EG_OFF;
- SLOT->eve = EG_OFF+1;
- SLOT->evs = 0;
- break;
- }
- }
- /* calcrate envelope */
- return SLOT->TLL+ENV_CURVE[SLOT->evc>>ENV_BITS]+(SLOT->ams ? ams : 0);
-}
-
-/* set algorythm connection */
-static void set_algorythm( OPL_CH *CH)
-{
- INT32 *carrier = &outd[0];
- CH->connect1 = CH->CON ? carrier : &feedback2;
- CH->connect2 = carrier;
-}
-
-/* ---------- frequency counter for operater update ---------- */
-INLINE void CALC_FCSLOT(OPL_CH *CH,OPL_SLOT *SLOT)
-{
- int ksr;
-
- /* frequency step counter */
- SLOT->Incr = CH->fc * SLOT->mul;
- ksr = CH->kcode >> SLOT->KSR;
-
- if( SLOT->ksr != ksr )
- {
- SLOT->ksr = ksr;
- /* attack , decay rate recalcration */
- SLOT->evsa = SLOT->AR[ksr];
- SLOT->evsd = SLOT->DR[ksr];
- SLOT->evsr = SLOT->RR[ksr];
- }
- SLOT->TLL = SLOT->TL + (CH->ksl_base>>SLOT->ksl);
-}
-
-/* set multi,am,vib,EG-TYP,KSR,mul */
-INLINE void set_mul(FM_OPL *OPL,int slot,int v)
-{
- OPL_CH *CH = &OPL->P_CH[slot/2];
- OPL_SLOT *SLOT = &CH->SLOT[slot&1];
-
- SLOT->mul = MUL_TABLE[v&0x0f];
- SLOT->KSR = (v&0x10) ? 0 : 2;
- SLOT->eg_typ = (v&0x20)>>5;
- SLOT->vib = (v&0x40);
- SLOT->ams = (v&0x80);
- CALC_FCSLOT(CH,SLOT);
-}
-
-/* set ksl & tl */
-INLINE void set_ksl_tl(FM_OPL *OPL,int slot,int v)
-{
- OPL_CH *CH = &OPL->P_CH[slot/2];
- OPL_SLOT *SLOT = &CH->SLOT[slot&1];
- int ksl = v>>6; /* 0 / 1.5 / 3 / 6 db/OCT */
-
- SLOT->ksl = ksl ? 3-ksl : 31;
- SLOT->TL = (INT32) (((v&0x3f)*(0.75/EG_STEP))); /* 0.75db step */
-
- if( !(OPL->mode&0x80) )
- { /* not CSM latch total level */
- SLOT->TLL = SLOT->TL + (CH->ksl_base>>SLOT->ksl);
- }
-}
-
-/* set attack rate & decay rate */
-INLINE void set_ar_dr(FM_OPL *OPL,int slot,int v)
-{
- OPL_CH *CH = &OPL->P_CH[slot/2];
- OPL_SLOT *SLOT = &CH->SLOT[slot&1];
- int ar = v>>4;
- int dr = v&0x0f;
-
- SLOT->AR = ar ? &OPL->AR_TABLE[ar<<2] : RATE_0;
- SLOT->evsa = SLOT->AR[SLOT->ksr];
- if( SLOT->evm == ENV_MOD_AR ) SLOT->evs = SLOT->evsa;
-
- SLOT->DR = dr ? &OPL->DR_TABLE[dr<<2] : RATE_0;
- SLOT->evsd = SLOT->DR[SLOT->ksr];
- if( SLOT->evm == ENV_MOD_DR ) SLOT->evs = SLOT->evsd;
-}
-
-/* set sustain level & release rate */
-INLINE void set_sl_rr(FM_OPL *OPL,int slot,int v)
-{
- OPL_CH *CH = &OPL->P_CH[slot/2];
- OPL_SLOT *SLOT = &CH->SLOT[slot&1];
- int sl = v>>4;
- int rr = v & 0x0f;
-
- SLOT->SL = SL_TABLE[sl];
- if( SLOT->evm == ENV_MOD_DR ) SLOT->eve = SLOT->SL;
- SLOT->RR = &OPL->DR_TABLE[rr<<2];
- SLOT->evsr = SLOT->RR[SLOT->ksr];
- if( SLOT->evm == ENV_MOD_RR ) SLOT->evs = SLOT->evsr;
-}
-
-/* operator output calcrator */
-#define OP_OUT(slot,env,con) slot->wavetable[((slot->Cnt+con)/(0x1000000/SIN_ENT))&(SIN_ENT-1)][env]
-/* ---------- calcrate one of channel ---------- */
-INLINE void OPL_CALC_CH( OPL_CH *CH )
-{
- UINT32 env_out;
- OPL_SLOT *SLOT;
-
- feedback2 = 0;
- /* SLOT 1 */
- SLOT = &CH->SLOT[SLOT1];
- env_out=OPL_CALC_SLOT(SLOT);
- if( env_out < EG_ENT-1 )
- {
- /* PG */
- if(SLOT->vib) SLOT->Cnt += (SLOT->Incr*vib/VIB_RATE);
- else SLOT->Cnt += SLOT->Incr;
- /* connectoion */
- if(CH->FB)
- {
- int feedback1 = (CH->op1_out[0]+CH->op1_out[1])>>CH->FB;
- CH->op1_out[1] = CH->op1_out[0];
- *CH->connect1 += CH->op1_out[0] = OP_OUT(SLOT,env_out,feedback1);
- }
- else
- {
- *CH->connect1 += OP_OUT(SLOT,env_out,0);
- }
- }else
- {
- CH->op1_out[1] = CH->op1_out[0];
- CH->op1_out[0] = 0;
- }
- /* SLOT 2 */
- SLOT = &CH->SLOT[SLOT2];
- env_out=OPL_CALC_SLOT(SLOT);
- if( env_out < EG_ENT-1 )
- {
- /* PG */
- if(SLOT->vib) SLOT->Cnt += (SLOT->Incr*vib/VIB_RATE);
- else SLOT->Cnt += SLOT->Incr;
- /* connectoion */
- outd[0] += OP_OUT(SLOT,env_out, feedback2);
- }
-}
-
-/* ---------- calcrate rythm block ---------- */
-#define WHITE_NOISE_db 6.0
-INLINE void OPL_CALC_RH( OPL_CH *CH )
-{
- UINT32 env_tam,env_sd,env_top,env_hh;
- int whitenoise = (rand()&1)*((int)(WHITE_NOISE_db/EG_STEP));
- INT32 tone8;
-
- OPL_SLOT *SLOT;
- int env_out;
-
- /* BD : same as FM serial mode and output level is large */
- feedback2 = 0;
- /* SLOT 1 */
- SLOT = &CH[6].SLOT[SLOT1];
- env_out=OPL_CALC_SLOT(SLOT);
- if( env_out < EG_ENT-1 )
- {
- /* PG */
- if(SLOT->vib) SLOT->Cnt += (SLOT->Incr*vib/VIB_RATE);
- else SLOT->Cnt += SLOT->Incr;
- /* connectoion */
- if(CH[6].FB)
- {
- int feedback1 = (CH[6].op1_out[0]+CH[6].op1_out[1])>>CH[6].FB;
- CH[6].op1_out[1] = CH[6].op1_out[0];
- feedback2 = CH[6].op1_out[0] = OP_OUT(SLOT,env_out,feedback1);
- }
- else
- {
- feedback2 = OP_OUT(SLOT,env_out,0);
- }
- }else
- {
- feedback2 = 0;
- CH[6].op1_out[1] = CH[6].op1_out[0];
- CH[6].op1_out[0] = 0;
- }
- /* SLOT 2 */
- SLOT = &CH[6].SLOT[SLOT2];
- env_out=OPL_CALC_SLOT(SLOT);
- if( env_out < EG_ENT-1 )
- {
- /* PG */
- if(SLOT->vib) SLOT->Cnt += (SLOT->Incr*vib/VIB_RATE);
- else SLOT->Cnt += SLOT->Incr;
- /* connectoion */
- outd[0] += OP_OUT(SLOT,env_out, feedback2)*2;
- }
-
- // SD (17) = mul14[fnum7] + white noise
- // TAM (15) = mul15[fnum8]
- // TOP (18) = fnum6(mul18[fnum8]+whitenoise)
- // HH (14) = fnum7(mul18[fnum8]+whitenoise) + white noise
- env_sd =OPL_CALC_SLOT(SLOT7_2) + whitenoise;
- env_tam=OPL_CALC_SLOT(SLOT8_1);
- env_top=OPL_CALC_SLOT(SLOT8_2);
- env_hh =OPL_CALC_SLOT(SLOT7_1) + whitenoise;
-
- /* PG */
- if(SLOT7_1->vib) SLOT7_1->Cnt += (2*SLOT7_1->Incr*vib/VIB_RATE);
- else SLOT7_1->Cnt += 2*SLOT7_1->Incr;
- if(SLOT7_2->vib) SLOT7_2->Cnt += ((CH[7].fc*8)*vib/VIB_RATE);
- else SLOT7_2->Cnt += (CH[7].fc*8);
- if(SLOT8_1->vib) SLOT8_1->Cnt += (SLOT8_1->Incr*vib/VIB_RATE);
- else SLOT8_1->Cnt += SLOT8_1->Incr;
- if(SLOT8_2->vib) SLOT8_2->Cnt += ((CH[8].fc*48)*vib/VIB_RATE);
- else SLOT8_2->Cnt += (CH[8].fc*48);
-
- tone8 = OP_OUT(SLOT8_2,whitenoise,0 );
-
- /* SD */
- if( env_sd < EG_ENT-1 )
- outd[0] += OP_OUT(SLOT7_1,env_sd, 0)*8;
- /* TAM */
- if( env_tam < EG_ENT-1 )
- outd[0] += OP_OUT(SLOT8_1,env_tam, 0)*2;
- /* TOP-CY */
- if( env_top < EG_ENT-1 )
- outd[0] += OP_OUT(SLOT7_2,env_top,tone8)*2;
- /* HH */
- if( env_hh < EG_ENT-1 )
- outd[0] += OP_OUT(SLOT7_2,env_hh,tone8)*2;
-}
-
-/* ----------- initialize time tabls ----------- */
-static void init_timetables( FM_OPL *OPL , int ARRATE , int DRRATE )
-{
- int i;
- double rate;
-
- /* make attack rate & decay rate tables */
- for (i = 0;i < 4;i++) OPL->AR_TABLE[i] = OPL->DR_TABLE[i] = 0;
- for (i = 4;i <= 60;i++){
- rate = OPL->freqbase; /* frequency rate */
- if( i < 60 ) rate *= 1.0+(i&3)*0.25; /* b0-1 : x1 , x1.25 , x1.5 , x1.75 */
- rate *= 1<<((i>>2)-1); /* b2-5 : shift bit */
- rate *= (double)(EG_ENT<<ENV_BITS);
- OPL->AR_TABLE[i] = (INT32) (rate / ARRATE);
- OPL->DR_TABLE[i] = (INT32) (rate / DRRATE);
- }
- for (i = 60;i < 76;i++)
- {
- OPL->AR_TABLE[i] = EG_AED-1;
- OPL->DR_TABLE[i] = OPL->DR_TABLE[60];
- }
-#if 0
- for (i = 0;i < 64 ;i++){ /* make for overflow area */
- LOG(LOG_WAR,("rate %2d , ar %f ms , dr %f ms \n",i,
- ((double)(EG_ENT<<ENV_BITS) / OPL->AR_TABLE[i]) * (1000.0 / OPL->rate),
- ((double)(EG_ENT<<ENV_BITS) / OPL->DR_TABLE[i]) * (1000.0 / OPL->rate) ));
- }
-#endif
-}
-
-/* ---------- generic table initialize ---------- */
-static int OPLOpenTable( void )
-{
- int s,t;
- double rate;
- int i,j;
- double pom;
-
- /* allocate dynamic tables */
- if( (TL_TABLE = malloc(TL_MAX*2*sizeof(INT32))) == NULL)
- return 0;
- if( (SIN_TABLE = malloc(SIN_ENT*4 *sizeof(INT32 *))) == NULL)
- {
- free(TL_TABLE);
- return 0;
- }
- if( (AMS_TABLE = malloc(AMS_ENT*2 *sizeof(INT32))) == NULL)
- {
- free(TL_TABLE);
- free(SIN_TABLE);
- return 0;
- }
- if( (VIB_TABLE = malloc(VIB_ENT*2 *sizeof(INT32))) == NULL)
- {
- free(TL_TABLE);
- free(SIN_TABLE);
- free(AMS_TABLE);
- return 0;
- }
- /* make total level table */
- for (t = 0;t < EG_ENT-1 ;t++){
- rate = ((1<<TL_BITS)-1)/pow(10,EG_STEP*t/20); /* dB -> voltage */
- TL_TABLE[ t] = (int)rate;
- TL_TABLE[TL_MAX+t] = -TL_TABLE[t];
-/* LOG(LOG_INF,("TotalLevel(%3d) = %x\n",t,TL_TABLE[t]));*/
- }
- /* fill volume off area */
- for ( t = EG_ENT-1; t < TL_MAX ;t++){
- TL_TABLE[t] = TL_TABLE[TL_MAX+t] = 0;
- }
-
- /* make sinwave table (total level offet) */
- /* degree 0 = degree 180 = off */
- SIN_TABLE[0] = SIN_TABLE[SIN_ENT/2] = &TL_TABLE[EG_ENT-1];
- for (s = 1;s <= SIN_ENT/4;s++){
- pom = sin(2*PI*s/SIN_ENT); /* sin */
- pom = 20*log10(1/pom); /* decibel */
- j = (int) (pom / EG_STEP); /* TL_TABLE steps */
-
- /* degree 0 - 90 , degree 180 - 90 : plus section */
- SIN_TABLE[ s] = SIN_TABLE[SIN_ENT/2-s] = &TL_TABLE[j];
- /* degree 180 - 270 , degree 360 - 270 : minus section */
- SIN_TABLE[SIN_ENT/2+s] = SIN_TABLE[SIN_ENT -s] = &TL_TABLE[TL_MAX+j];
-/* LOG(LOG_INF,("sin(%3d) = %f:%f db\n",s,pom,(double)j * EG_STEP));*/
- }
- for (s = 0;s < SIN_ENT;s++)
- {
- SIN_TABLE[SIN_ENT*1+s] = s<(SIN_ENT/2) ? SIN_TABLE[s] : &TL_TABLE[EG_ENT];
- SIN_TABLE[SIN_ENT*2+s] = SIN_TABLE[s % (SIN_ENT/2)];
- SIN_TABLE[SIN_ENT*3+s] = (s/(SIN_ENT/4))&1 ? &TL_TABLE[EG_ENT] : SIN_TABLE[SIN_ENT*2+s];
- }
-
- /* envelope counter -> envelope output table */
- for (i=0; i<EG_ENT; i++)
- {
- /* ATTACK curve */
- pom = pow( ((double)(EG_ENT-1-i)/EG_ENT) , 8 ) * EG_ENT;
- /* if( pom >= EG_ENT ) pom = EG_ENT-1; */
- ENV_CURVE[i] = (int)pom;
- /* DECAY ,RELEASE curve */
- ENV_CURVE[(EG_DST>>ENV_BITS)+i]= i;
- }
- /* off */
- ENV_CURVE[EG_OFF>>ENV_BITS]= EG_ENT-1;
- /* make LFO ams table */
- for (i=0; i<AMS_ENT; i++)
- {
- pom = (1.0+sin(2*PI*i/AMS_ENT))/2; /* sin */
- AMS_TABLE[i] = (INT32) ((1.0/EG_STEP)*pom); /* 1dB */
- AMS_TABLE[AMS_ENT+i] = (INT32) ((4.8/EG_STEP)*pom); /* 4.8dB */
- }
- /* make LFO vibrate table */
- for (i=0; i<VIB_ENT; i++)
- {
- /* 100cent = 1seminote = 6% ?? */
- pom = (double)VIB_RATE*0.06*sin(2*PI*i/VIB_ENT); /* +-100sect step */
- VIB_TABLE[i] = VIB_RATE + (INT32) (pom*0.07); /* +- 7cent */
- VIB_TABLE[VIB_ENT+i] = VIB_RATE + (INT32) (pom*0.14); /* +-14cent */
- /* LOG(LOG_INF,("vib %d=%d\n",i,VIB_TABLE[VIB_ENT+i])); */
- }
- return 1;
-}
-
-
-static void OPLCloseTable( void )
-{
- free(TL_TABLE);
- free(SIN_TABLE);
- free(AMS_TABLE);
- free(VIB_TABLE);
-}
-
-/* CSM Key Controll */
-INLINE void CSMKeyControll(OPL_CH *CH)
-{
- OPL_SLOT *slot1 = &CH->SLOT[SLOT1];
- OPL_SLOT *slot2 = &CH->SLOT[SLOT2];
- /* all key off */
- OPL_KEYOFF(slot1);
- OPL_KEYOFF(slot2);
- /* total level latch */
- slot1->TLL = slot1->TL + (CH->ksl_base>>slot1->ksl);
- slot1->TLL = slot1->TL + (CH->ksl_base>>slot1->ksl);
- /* key on */
- CH->op1_out[0] = CH->op1_out[1] = 0;
- OPL_KEYON(slot1);
- OPL_KEYON(slot2);
-}
-
-/* ---------- opl initialize ---------- */
-static void OPL_initalize(FM_OPL *OPL)
-{
- int fn;
-
- /* frequency base */
- OPL->freqbase = (OPL->rate) ? ((double)OPL->clock / OPL->rate) / 72 : 0;
- /* Timer base time */
- OPL->TimerBase = 1.0/((double)OPL->clock / 72.0 );
- /* make time tables */
- init_timetables( OPL , OPL_ARRATE , OPL_DRRATE );
- /* make fnumber -> increment counter table */
- for( fn=0 ; fn < 1024 ; fn++ )
- {
- OPL->FN_TABLE[fn] = (UINT32) (OPL->freqbase * fn * FREQ_RATE * (1<<7) / 2);
- }
- /* LFO freq.table */
- OPL->amsIncr = (INT32) (OPL->rate ? (double)AMS_ENT*(1<<AMS_SHIFT) / OPL->rate * 3.7 * ((double)OPL->clock/3600000) : 0);
- OPL->vibIncr = (INT32) (OPL->rate ? (double)VIB_ENT*(1<<VIB_SHIFT) / OPL->rate * 6.4 * ((double)OPL->clock/3600000) : 0);
-}
-
-/* ---------- write a OPL registers ---------- */
-static void OPLWriteReg(FM_OPL *OPL, int r, int v)
-{
- OPL_CH *CH;
- int slot;
- unsigned int block_fnum;
-
- switch(r&0xe0)
- {
- case 0x00: /* 00-1f:controll */
- switch(r&0x1f)
- {
- case 0x01:
- /* wave selector enable */
- if(OPL->type&OPL_TYPE_WAVESEL)
- {
- OPL->wavesel = v&0x20;
- if(!OPL->wavesel)
- {
- /* preset compatible mode */
- int c;
- for(c=0;c<OPL->max_ch;c++)
- {
- OPL->P_CH[c].SLOT[SLOT1].wavetable = &SIN_TABLE[0];
- OPL->P_CH[c].SLOT[SLOT2].wavetable = &SIN_TABLE[0];
- }
- }
- }
- return;
- case 0x02: /* Timer 1 */
- OPL->T[0] = (256-v)*4;
- break;
- case 0x03: /* Timer 2 */
- OPL->T[1] = (256-v)*16;
- return;
- case 0x04: /* IRQ clear / mask and Timer enable */
- if(v&0x80)
- { /* IRQ flag clear */
- OPL_STATUS_RESET(OPL,0x7f);
- }
- else
- { /* set IRQ mask ,timer enable*/
- UINT8 st1 = v&1;
- UINT8 st2 = (v>>1)&1;
- /* IRQRST,T1MSK,t2MSK,EOSMSK,BRMSK,x,ST2,ST1 */
- OPL_STATUS_RESET(OPL,v&0x78);
- OPL_STATUSMASK_SET(OPL,((~v)&0x78)|0x01);
- /* timer 2 */
- if(OPL->st[1] != st2)
- {
- double interval = st2 ? (double)OPL->T[1]*OPL->TimerBase : 0.0;
- OPL->st[1] = st2;
- if (OPL->TimerHandler) (OPL->TimerHandler)(OPL->TimerParam+1,interval);
- }
- /* timer 1 */
- if(OPL->st[0] != st1)
- {
- double interval = st1 ? (double)OPL->T[0]*OPL->TimerBase : 0.0;
- OPL->st[0] = st1;
- if (OPL->TimerHandler) (OPL->TimerHandler)(OPL->TimerParam+0,interval);
- }
- }
- return;
-#if BUILD_Y8950
- case 0x06: /* Key Board OUT */
- if(OPL->type&OPL_TYPE_KEYBOARD)
- {
- if(OPL->keyboardhandler_w)
- OPL->keyboardhandler_w(OPL->keyboard_param,v);
- else
- LOG(LOG_WAR,("OPL:write unmapped KEYBOARD port\n"));
- }
- return;
- case 0x07: /* DELTA-T controll : START,REC,MEMDATA,REPT,SPOFF,x,x,RST */
- if(OPL->type&OPL_TYPE_ADPCM)
- YM_DELTAT_ADPCM_Write(OPL->deltat,r-0x07,v);
- return;
- case 0x08: /* MODE,DELTA-T : CSM,NOTESEL,x,x,smpl,da/ad,64k,rom */
- OPL->mode = v;
- v&=0x1f; /* for DELTA-T unit */
- case 0x09: /* START ADD */
- case 0x0a:
- case 0x0b: /* STOP ADD */
- case 0x0c:
- case 0x0d: /* PRESCALE */
- case 0x0e:
- case 0x0f: /* ADPCM data */
- case 0x10: /* DELTA-N */
- case 0x11: /* DELTA-N */
- case 0x12: /* EG-CTRL */
- if(OPL->type&OPL_TYPE_ADPCM)
- YM_DELTAT_ADPCM_Write(OPL->deltat,r-0x07,v);
- return;
-#if 0
- case 0x15: /* DAC data */
- case 0x16:
- case 0x17: /* SHIFT */
- return;
- case 0x18: /* I/O CTRL (Direction) */
- if(OPL->type&OPL_TYPE_IO)
- OPL->portDirection = v&0x0f;
- return;
- case 0x19: /* I/O DATA */
- if(OPL->type&OPL_TYPE_IO)
- {
- OPL->portLatch = v;
- if(OPL->porthandler_w)
- OPL->porthandler_w(OPL->port_param,v&OPL->portDirection);
- }
- return;
- case 0x1a: /* PCM data */
- return;
-#endif
-#endif
- }
- break;
- case 0x20: /* am,vib,ksr,eg type,mul */
- slot = slot_array[r&0x1f];
- if(slot == -1) return;
- set_mul(OPL,slot,v);
- return;
- case 0x40:
- slot = slot_array[r&0x1f];
- if(slot == -1) return;
- set_ksl_tl(OPL,slot,v);
- return;
- case 0x60:
- slot = slot_array[r&0x1f];
- if(slot == -1) return;
- set_ar_dr(OPL,slot,v);
- return;
- case 0x80:
- slot = slot_array[r&0x1f];
- if(slot == -1) return;
- set_sl_rr(OPL,slot,v);
- return;
- case 0xa0:
- switch(r)
- {
- case 0xbd:
- /* amsep,vibdep,r,bd,sd,tom,tc,hh */
- {
- UINT8 rkey = OPL->rythm^v;
- OPL->ams_table = &AMS_TABLE[v&0x80 ? AMS_ENT : 0];
- OPL->vib_table = &VIB_TABLE[v&0x40 ? VIB_ENT : 0];
- OPL->rythm = v&0x3f;
- if(OPL->rythm&0x20)
- {
-#if 0
- usrintf_showmessage("OPL Rythm mode select");
-#endif
- /* BD key on/off */
- if(rkey&0x10)
- {
- if(v&0x10)
- {
- OPL->P_CH[6].op1_out[0] = OPL->P_CH[6].op1_out[1] = 0;
- OPL_KEYON(&OPL->P_CH[6].SLOT[SLOT1]);
- OPL_KEYON(&OPL->P_CH[6].SLOT[SLOT2]);
- }
- else
- {
- OPL_KEYOFF(&OPL->P_CH[6].SLOT[SLOT1]);
- OPL_KEYOFF(&OPL->P_CH[6].SLOT[SLOT2]);
- }
- }
- /* SD key on/off */
- if(rkey&0x08)
- {
- if(v&0x08) OPL_KEYON(&OPL->P_CH[7].SLOT[SLOT2]);
- else OPL_KEYOFF(&OPL->P_CH[7].SLOT[SLOT2]);
- }/* TAM key on/off */
- if(rkey&0x04)
- {
- if(v&0x04) OPL_KEYON(&OPL->P_CH[8].SLOT[SLOT1]);
- else OPL_KEYOFF(&OPL->P_CH[8].SLOT[SLOT1]);
- }
- /* TOP-CY key on/off */
- if(rkey&0x02)
- {
- if(v&0x02) OPL_KEYON(&OPL->P_CH[8].SLOT[SLOT2]);
- else OPL_KEYOFF(&OPL->P_CH[8].SLOT[SLOT2]);
- }
- /* HH key on/off */
- if(rkey&0x01)
- {
- if(v&0x01) OPL_KEYON(&OPL->P_CH[7].SLOT[SLOT1]);
- else OPL_KEYOFF(&OPL->P_CH[7].SLOT[SLOT1]);
- }
- }
- }
- return;
- }
- /* keyon,block,fnum */
- if( (r&0x0f) > 8) return;
- CH = &OPL->P_CH[r&0x0f];
- if(!(r&0x10))
- { /* a0-a8 */
- block_fnum = (CH->block_fnum&0x1f00) | v;
- }
- else
- { /* b0-b8 */
- int keyon = (v>>5)&1;
- block_fnum = ((v&0x1f)<<8) | (CH->block_fnum&0xff);
- if(CH->keyon != keyon)
- {
- if( (CH->keyon=keyon) )
- {
- CH->op1_out[0] = CH->op1_out[1] = 0;
- OPL_KEYON(&CH->SLOT[SLOT1]);
- OPL_KEYON(&CH->SLOT[SLOT2]);
- }
- else
- {
- OPL_KEYOFF(&CH->SLOT[SLOT1]);
- OPL_KEYOFF(&CH->SLOT[SLOT2]);
- }
- }
- }
- /* update */
- if(CH->block_fnum != block_fnum)
- {
- int blockRv = 7-(block_fnum>>10);
- int fnum = block_fnum&0x3ff;
- CH->block_fnum = block_fnum;
-
- CH->ksl_base = KSL_TABLE[block_fnum>>6];
- CH->fc = OPL->FN_TABLE[fnum]>>blockRv;
- CH->kcode = CH->block_fnum>>9;
- if( (OPL->mode&0x40) && CH->block_fnum&0x100) CH->kcode |=1;
- CALC_FCSLOT(CH,&CH->SLOT[SLOT1]);
- CALC_FCSLOT(CH,&CH->SLOT[SLOT2]);
- }
- return;
- case 0xc0:
- /* FB,C */
- if( (r&0x0f) > 8) return;
- CH = &OPL->P_CH[r&0x0f];
- {
- int feedback = (v>>1)&7;
- CH->FB = feedback ? (8+1) - feedback : 0;
- CH->CON = v&1;
- set_algorythm(CH);
- }
- return;
- case 0xe0: /* wave type */
- slot = slot_array[r&0x1f];
- if(slot == -1) return;
- CH = &OPL->P_CH[slot/2];
- if(OPL->wavesel)
- {
- /* LOG(LOG_INF,("OPL SLOT %d wave select %d\n",slot,v&3)); */
- CH->SLOT[slot&1].wavetable = &SIN_TABLE[(v&0x03)*SIN_ENT];
- }
- return;
- }
-}
-
-/* lock/unlock for common table */
-static int OPL_LockTable(void)
-{
- num_lock++;
- if(num_lock>1) return 0;
- /* first time */
- cur_chip = NULL;
- /* allocate total level table (128kb space) */
- if( !OPLOpenTable() )
- {
- num_lock--;
- return -1;
- }
- return 0;
-}
-
-static void OPL_UnLockTable(void)
-{
- if(num_lock) num_lock--;
- if(num_lock) return;
- /* last time */
- cur_chip = NULL;
- OPLCloseTable();
-}
-
-#if (BUILD_YM3812 || BUILD_YM3526)
-/*******************************************************************************/
-/* YM3812 local section */
-/*******************************************************************************/
-
-/* ---------- update one of chip ----------- */
-void YM3812UpdateOne(FM_OPL *OPL, INT16 *buffer, int length)
-{
- int i;
- int data;
- FMSAMPLE *buf = buffer;
- UINT32 amsCnt = OPL->amsCnt;
- UINT32 vibCnt = OPL->vibCnt;
- UINT8 rythm = OPL->rythm&0x20;
- OPL_CH *CH,*R_CH;
-
- if( (void *)OPL != cur_chip ){
- cur_chip = (void *)OPL;
- /* channel pointers */
- S_CH = OPL->P_CH;
- E_CH = &S_CH[9];
- /* rythm slot */
- SLOT7_1 = &S_CH[7].SLOT[SLOT1];
- SLOT7_2 = &S_CH[7].SLOT[SLOT2];
- SLOT8_1 = &S_CH[8].SLOT[SLOT1];
- SLOT8_2 = &S_CH[8].SLOT[SLOT2];
- /* LFO state */
- amsIncr = OPL->amsIncr;
- vibIncr = OPL->vibIncr;
- ams_table = OPL->ams_table;
- vib_table = OPL->vib_table;
- }
- R_CH = rythm ? &S_CH[6] : E_CH;
- for( i=0; i < length ; i++ )
- {
- /* channel A channel B channel C */
- /* LFO */
- ams = ams_table[(amsCnt+=amsIncr)>>AMS_SHIFT];
- vib = vib_table[(vibCnt+=vibIncr)>>VIB_SHIFT];
- outd[0] = 0;
- /* FM part */
- for(CH=S_CH ; CH < R_CH ; CH++)
- OPL_CALC_CH(CH);
- /* Rythn part */
- if(rythm)
- OPL_CALC_RH(S_CH);
- /* limit check */
- data = Limit( outd[0] , OPL_MAXOUT, OPL_MINOUT );
- /* store to sound buffer */
- buf[i] = data >> OPL_OUTSB;
- }
-
- OPL->amsCnt = amsCnt;
- OPL->vibCnt = vibCnt;
-}
-#endif /* (BUILD_YM3812 || BUILD_YM3526) */
-
-#if BUILD_Y8950
-
-void Y8950UpdateOne(FM_OPL *OPL, INT16 *buffer, int length)
-{
- int i;
- int data;
- FMSAMPLE *buf = buffer;
- UINT32 amsCnt = OPL->amsCnt;
- UINT32 vibCnt = OPL->vibCnt;
- UINT8 rythm = OPL->rythm&0x20;
- OPL_CH *CH,*R_CH;
- YM_DELTAT *DELTAT = OPL->deltat;
-
- /* setup DELTA-T unit */
- YM_DELTAT_DECODE_PRESET(DELTAT);
-
- if( (void *)OPL != cur_chip ){
- cur_chip = (void *)OPL;
- /* channel pointers */
- S_CH = OPL->P_CH;
- E_CH = &S_CH[9];
- /* rythm slot */
- SLOT7_1 = &S_CH[7].SLOT[SLOT1];
- SLOT7_2 = &S_CH[7].SLOT[SLOT2];
- SLOT8_1 = &S_CH[8].SLOT[SLOT1];
- SLOT8_2 = &S_CH[8].SLOT[SLOT2];
- /* LFO state */
- amsIncr = OPL->amsIncr;
- vibIncr = OPL->vibIncr;
- ams_table = OPL->ams_table;
- vib_table = OPL->vib_table;
- }
- R_CH = rythm ? &S_CH[6] : E_CH;
- for( i=0; i < length ; i++ )
- {
- /* channel A channel B channel C */
- /* LFO */
- ams = ams_table[(amsCnt+=amsIncr)>>AMS_SHIFT];
- vib = vib_table[(vibCnt+=vibIncr)>>VIB_SHIFT];
- outd[0] = 0;
- /* deltaT ADPCM */
- if( DELTAT->flag )
- YM_DELTAT_ADPCM_CALC(DELTAT);
- /* FM part */
- for(CH=S_CH ; CH < R_CH ; CH++)
- OPL_CALC_CH(CH);
- /* Rythn part */
- if(rythm)
- OPL_CALC_RH(S_CH);
- /* limit check */
- data = Limit( outd[0] , OPL_MAXOUT, OPL_MINOUT );
- /* store to sound buffer */
- buf[i] = data >> OPL_OUTSB;
- }
- OPL->amsCnt = amsCnt;
- OPL->vibCnt = vibCnt;
- /* deltaT START flag */
- if( !DELTAT->flag )
- OPL->status &= 0xfe;
-}
-#endif
-
-/* ---------- reset one of chip ---------- */
-void OPLResetChip(FM_OPL *OPL)
-{
- int c,s;
- int i;
-
- /* reset chip */
- OPL->mode = 0; /* normal mode */
- OPL_STATUS_RESET(OPL,0x7f);
- /* reset with register write */
- OPLWriteReg(OPL,0x01,0); /* wabesel disable */
- OPLWriteReg(OPL,0x02,0); /* Timer1 */
- OPLWriteReg(OPL,0x03,0); /* Timer2 */
- OPLWriteReg(OPL,0x04,0); /* IRQ mask clear */
- for(i = 0xff ; i >= 0x20 ; i-- ) OPLWriteReg(OPL,i,0);
- /* reset OPerator paramater */
- for( c = 0 ; c < OPL->max_ch ; c++ )
- {
- OPL_CH *CH = &OPL->P_CH[c];
- /* OPL->P_CH[c].PAN = OPN_CENTER; */
- for(s = 0 ; s < 2 ; s++ )
- {
- /* wave table */
- CH->SLOT[s].wavetable = &SIN_TABLE[0];
- /* CH->SLOT[s].evm = ENV_MOD_RR; */
- CH->SLOT[s].evc = EG_OFF;
- CH->SLOT[s].eve = EG_OFF+1;
- CH->SLOT[s].evs = 0;
- }
- }
-#if BUILD_Y8950
- if(OPL->type&OPL_TYPE_ADPCM)
- {
- YM_DELTAT *DELTAT = OPL->deltat;
-
- DELTAT->freqbase = OPL->freqbase;
- DELTAT->output_pointer = outd;
- DELTAT->portshift = 5;
- DELTAT->output_range = DELTAT_MIXING_LEVEL<<TL_BITS;
- YM_DELTAT_ADPCM_Reset(DELTAT,0);
- }
-#endif
-}
-
-/* ---------- Create one of vietual YM3812 ---------- */
-/* 'rate' is sampling rate and 'bufsiz' is the size of the */
-FM_OPL *OPLCreate(int type, int clock, int rate)
-{
- char *ptr;
- FM_OPL *OPL;
- int state_size;
- int max_ch = 9; /* normaly 9 channels */
-
- if( OPL_LockTable() ==-1) return NULL;
- /* allocate OPL state space */
- state_size = sizeof(FM_OPL);
- state_size += sizeof(OPL_CH)*max_ch;
-#if BUILD_Y8950
- if(type&OPL_TYPE_ADPCM) state_size+= sizeof(YM_DELTAT);
-#endif
- /* allocate memory block */
- ptr = malloc(state_size);
- if(ptr==NULL) return NULL;
- /* clear */
- memset(ptr,0,state_size);
- OPL = (FM_OPL *)ptr; ptr+=sizeof(FM_OPL);
- OPL->P_CH = (OPL_CH *)ptr; ptr+=sizeof(OPL_CH)*max_ch;
-#if BUILD_Y8950
- if(type&OPL_TYPE_ADPCM) OPL->deltat = (YM_DELTAT *)ptr; ptr+=sizeof(YM_DELTAT);
-#endif
- /* set channel state pointer */
- OPL->type = type;
- OPL->clock = clock;
- OPL->rate = rate;
- OPL->max_ch = max_ch;
- /* init grobal tables */
- OPL_initalize(OPL);
- /* reset chip */
- OPLResetChip(OPL);
- return OPL;
-}
-
-/* ---------- Destroy one of vietual YM3812 ---------- */
-void OPLDestroy(FM_OPL *OPL)
-{
- OPL_UnLockTable();
- free(OPL);
-}
-
-/* ---------- Option handlers ---------- */
-
-void OPLSetTimerHandler(FM_OPL *OPL,OPL_TIMERHANDLER TimerHandler,int channelOffset)
-{
- OPL->TimerHandler = TimerHandler;
- OPL->TimerParam = channelOffset;
-}
-void OPLSetIRQHandler(FM_OPL *OPL,OPL_IRQHANDLER IRQHandler,int param)
-{
- OPL->IRQHandler = IRQHandler;
- OPL->IRQParam = param;
-}
-void OPLSetUpdateHandler(FM_OPL *OPL,OPL_UPDATEHANDLER UpdateHandler,int param)
-{
- OPL->UpdateHandler = UpdateHandler;
- OPL->UpdateParam = param;
-}
-#if BUILD_Y8950
-void OPLSetPortHandler(FM_OPL *OPL,OPL_PORTHANDLER_W PortHandler_w,OPL_PORTHANDLER_R PortHandler_r,int param)
-{
- OPL->porthandler_w = PortHandler_w;
- OPL->porthandler_r = PortHandler_r;
- OPL->port_param = param;
-}
-
-void OPLSetKeyboardHandler(FM_OPL *OPL,OPL_PORTHANDLER_W KeyboardHandler_w,OPL_PORTHANDLER_R KeyboardHandler_r,int param)
-{
- OPL->keyboardhandler_w = KeyboardHandler_w;
- OPL->keyboardhandler_r = KeyboardHandler_r;
- OPL->keyboard_param = param;
-}
-#endif
-/* ---------- YM3812 I/O interface ---------- */
-int OPLWrite(FM_OPL *OPL,int a,int v)
-{
- if( !(a&1) )
- { /* address port */
- OPL->address = v & 0xff;
- }
- else
- { /* data port */
- if(OPL->UpdateHandler) OPL->UpdateHandler(OPL->UpdateParam,0);
- OPLWriteReg(OPL,OPL->address,v);
- }
- return OPL->status>>7;
-}
-
-unsigned char OPLRead(FM_OPL *OPL,int a)
-{
- if( !(a&1) )
- { /* status port */
- return OPL->status & (OPL->statusmask|0x80);
- }
- /* data port */
- switch(OPL->address)
- {
- case 0x05: /* KeyBoard IN */
- if(OPL->type&OPL_TYPE_KEYBOARD)
- {
- if(OPL->keyboardhandler_r)
- return OPL->keyboardhandler_r(OPL->keyboard_param);
- else
- LOG(LOG_WAR,("OPL:read unmapped KEYBOARD port\n"));
- }
- return 0;
-#if 0
- case 0x0f: /* ADPCM-DATA */
- return 0;
-#endif
- case 0x19: /* I/O DATA */
- if(OPL->type&OPL_TYPE_IO)
- {
- if(OPL->porthandler_r)
- return OPL->porthandler_r(OPL->port_param);
- else
- LOG(LOG_WAR,("OPL:read unmapped I/O port\n"));
- }
- return 0;
- case 0x1a: /* PCM-DATA */
- return 0;
- }
- return 0;
-}
-
-int OPLTimerOver(FM_OPL *OPL,int c)
-{
- if( c )
- { /* Timer B */
- OPL_STATUS_SET(OPL,0x20);
- }
- else
- { /* Timer A */
- OPL_STATUS_SET(OPL,0x40);
- /* CSM mode key,TL controll */
- if( OPL->mode & 0x80 )
- { /* CSM mode total level latch and auto key on */
- int ch;
- if(OPL->UpdateHandler) OPL->UpdateHandler(OPL->UpdateParam,0);
- for(ch=0;ch<9;ch++)
- CSMKeyControll( &OPL->P_CH[ch] );
- }
- }
- /* reload timer */
- if (OPL->TimerHandler) (OPL->TimerHandler)(OPL->TimerParam+c,(double)OPL->T[c]*OPL->TimerBase);
- return OPL->status>>7;
-}
diff --git a/src/libxineadec/nosefart/fmopl.h b/src/libxineadec/nosefart/fmopl.h
deleted file mode 100644
index 92a2859d7..000000000
--- a/src/libxineadec/nosefart/fmopl.h
+++ /dev/null
@@ -1,164 +0,0 @@
-#ifndef __FMOPL_H_
-#define __FMOPL_H_
-
-#define HAS_YM3812 1
-typedef signed short int FMSAMPLE;
-
-
-#define BUILD_YM3812 (HAS_YM3812)
-#define BUILD_YM3526 (HAS_YM3526)
-#define BUILD_Y8950 (HAS_Y8950)
-
-/* compiler dependence */
-#ifndef OSD_CPU_H
-#define OSD_CPU_H
-typedef unsigned char UINT8; /* unsigned 8bit */
-typedef unsigned short UINT16; /* unsigned 16bit */
-typedef unsigned int UINT32; /* unsigned 32bit */
-typedef signed char INT8; /* signed 8bit */
-typedef signed short INT16; /* signed 16bit */
-typedef signed int INT32; /* signed 32bit */
-#endif
-
-#if BUILD_Y8950
-#include "ymdeltat.h"
-#endif
-
-typedef void (*OPL_TIMERHANDLER)(int channel,double interval_Sec);
-typedef void (*OPL_IRQHANDLER)(int param,int irq);
-typedef void (*OPL_UPDATEHANDLER)(int param,int min_interval_us);
-typedef void (*OPL_PORTHANDLER_W)(int param,unsigned char data);
-typedef unsigned char (*OPL_PORTHANDLER_R)(int param);
-
-/* !!!!! here is private section , do not access there member direct !!!!! */
-
-#define OPL_TYPE_WAVESEL 0x01 /* waveform select */
-#define OPL_TYPE_ADPCM 0x02 /* DELTA-T ADPCM unit */
-#define OPL_TYPE_KEYBOARD 0x04 /* keyboard interface */
-#define OPL_TYPE_IO 0x08 /* I/O port */
-
-/* ---------- OPL one of slot ---------- */
-typedef struct fm_opl_slot {
- INT32 TL; /* total level :TL << 8 */
- INT32 TLL; /* adjusted now TL */
- UINT8 KSR; /* key scale rate :(shift down bit) */
- INT32 *AR; /* attack rate :&AR_TABLE[AR<<2] */
- INT32 *DR; /* decay rate :&DR_TALBE[DR<<2] */
- INT32 SL; /* sustin level :SL_TALBE[SL] */
- INT32 *RR; /* release rate :&DR_TABLE[RR<<2] */
- UINT8 ksl; /* keyscale level :(shift down bits) */
- UINT8 ksr; /* key scale rate :kcode>>KSR */
- UINT32 mul; /* multiple :ML_TABLE[ML] */
- UINT32 Cnt; /* frequency count : */
- UINT32 Incr; /* frequency step : */
- /* envelope generator state */
- UINT8 eg_typ; /* envelope type flag */
- UINT8 evm; /* envelope phase */
- INT32 evc; /* envelope counter */
- INT32 eve; /* envelope counter end point */
- INT32 evs; /* envelope counter step */
- INT32 evsa; /* envelope step for AR :AR[ksr] */
- INT32 evsd; /* envelope step for DR :DR[ksr] */
- INT32 evsr; /* envelope step for RR :RR[ksr] */
- /* LFO */
- UINT8 ams; /* ams flag */
- UINT8 vib; /* vibrate flag */
- /* wave selector */
- INT32 **wavetable;
-}OPL_SLOT;
-
-/* ---------- OPL one of channel ---------- */
-typedef struct fm_opl_channel {
- OPL_SLOT SLOT[2];
- UINT8 CON; /* connection type */
- UINT8 FB; /* feed back :(shift down bit) */
- INT32 *connect1; /* slot1 output pointer */
- INT32 *connect2; /* slot2 output pointer */
- INT32 op1_out[2]; /* slot1 output for selfeedback */
- /* phase generator state */
- UINT32 block_fnum; /* block+fnum : */
- UINT8 kcode; /* key code : KeyScaleCode */
- UINT32 fc; /* Freq. Increment base */
- UINT32 ksl_base; /* KeyScaleLevel Base step */
- UINT8 keyon; /* key on/off flag */
-} OPL_CH;
-
-/* OPL state */
-typedef struct fm_opl_f {
- UINT8 type; /* chip type */
- int clock; /* master clock (Hz) */
- int rate; /* sampling rate (Hz) */
- double freqbase; /* frequency base */
- double TimerBase; /* Timer base time (==sampling time) */
- UINT8 address; /* address register */
- UINT8 status; /* status flag */
- UINT8 statusmask; /* status mask */
- UINT32 mode; /* Reg.08 : CSM , notesel,etc. */
- /* Timer */
- int T[2]; /* timer counter */
- UINT8 st[2]; /* timer enable */
- /* FM channel slots */
- OPL_CH *P_CH; /* pointer of CH */
- int max_ch; /* maximum channel */
- /* Rythm sention */
- UINT8 rythm; /* Rythm mode , key flag */
-#if BUILD_Y8950
- /* Delta-T ADPCM unit (Y8950) */
- YM_DELTAT *deltat; /* DELTA-T ADPCM */
-#endif
- /* Keyboard / I/O interface unit (Y8950) */
- UINT8 portDirection;
- UINT8 portLatch;
- OPL_PORTHANDLER_R porthandler_r;
- OPL_PORTHANDLER_W porthandler_w;
- int port_param;
- OPL_PORTHANDLER_R keyboardhandler_r;
- OPL_PORTHANDLER_W keyboardhandler_w;
- int keyboard_param;
- /* time tables */
- INT32 AR_TABLE[75]; /* atttack rate tables */
- INT32 DR_TABLE[75]; /* decay rate tables */
- UINT32 FN_TABLE[1024]; /* fnumber -> increment counter */
- /* LFO */
- INT32 *ams_table;
- INT32 *vib_table;
- INT32 amsCnt;
- INT32 amsIncr;
- INT32 vibCnt;
- INT32 vibIncr;
- /* wave selector enable flag */
- UINT8 wavesel;
- /* external event callback handler */
- OPL_TIMERHANDLER TimerHandler; /* TIMER handler */
- int TimerParam; /* TIMER parameter */
- OPL_IRQHANDLER IRQHandler; /* IRQ handler */
- int IRQParam; /* IRQ parameter */
- OPL_UPDATEHANDLER UpdateHandler; /* stream update handler */
- int UpdateParam; /* stream update parameter */
-} FM_OPL;
-
-/* ---------- Generic interface section ---------- */
-#define OPL_TYPE_YM3526 (0)
-#define OPL_TYPE_YM3812 (OPL_TYPE_WAVESEL)
-#define OPL_TYPE_Y8950 (OPL_TYPE_ADPCM|OPL_TYPE_KEYBOARD|OPL_TYPE_IO)
-
-FM_OPL *OPLCreate(int type, int clock, int rate);
-void OPLDestroy(FM_OPL *OPL);
-void OPLSetTimerHandler(FM_OPL *OPL,OPL_TIMERHANDLER TimerHandler,int channelOffset);
-void OPLSetIRQHandler(FM_OPL *OPL,OPL_IRQHANDLER IRQHandler,int param);
-void OPLSetUpdateHandler(FM_OPL *OPL,OPL_UPDATEHANDLER UpdateHandler,int param);
-/* Y8950 port handlers */
-void OPLSetPortHandler(FM_OPL *OPL,OPL_PORTHANDLER_W PortHandler_w,OPL_PORTHANDLER_R PortHandler_r,int param);
-void OPLSetKeyboardHandler(FM_OPL *OPL,OPL_PORTHANDLER_W KeyboardHandler_w,OPL_PORTHANDLER_R KeyboardHandler_r,int param);
-
-void OPLResetChip(FM_OPL *OPL);
-int OPLWrite(FM_OPL *OPL,int a,int v);
-unsigned char OPLRead(FM_OPL *OPL,int a);
-int OPLTimerOver(FM_OPL *OPL,int c);
-
-/* YM3626/YM3812 local section */
-void YM3812UpdateOne(FM_OPL *OPL, INT16 *buffer, int length);
-
-void Y8950UpdateOne(FM_OPL *OPL, INT16 *buffer, int length);
-
-#endif
diff --git a/src/libxineadec/nosefart/log.c b/src/libxineadec/nosefart/log.c
deleted file mode 100644
index 8935a596e..000000000
--- a/src/libxineadec/nosefart/log.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
-** Nofrendo (c) 1998-2000 Matthew Conte (matt@conte.com)
-**
-**
-** This program is free software; you can redistribute it and/or
-** modify it under the terms of version 2 of the GNU Library General
-** Public License as published by the Free Software Foundation.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-** Library General Public License for more details. To obtain a
-** copy of the GNU Library General Public License, write to the Free
-** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-**
-** Any permitted reproduction of these routines, in whole or in part,
-** must bear this legend.
-**
-**
-** log.c
-**
-** Error logging functions
-** $Id: log.c,v 1.2 2003/12/05 15:55:01 f1rmb Exp $
-*/
-
-#include <stdio.h>
-#include <stdarg.h>
-#include "types.h"
-#include "log.h"
-
-
-#ifdef OSD_LOG
-#include "osd.h"
-#endif
-
-#if defined(OSD_LOG) && !defined(NOFRENDO_DEBUG)
-#error NOFRENDO_DEBUG must be defined as well as OSD_LOG
-#endif
-
-/* Note that all of these functions will be empty if
-** debugging is not enabled.
-*/
-#ifdef NOFRENDO_DEBUG
-static FILE *errorlog;
-#endif
-
-int log_init(void)
-{
-#ifdef NOFRENDO_DEBUG
-#ifdef OSD_LOG
- /* Initialize an OSD logging system */
- osd_loginit();
-#endif /* OSD_LOG */
- errorlog = fopen("errorlog.txt", "wt");
- if (NULL == errorlog)
- return (-1);
-#endif /* NOFRENDO_DEBUG */
- return 0;
-}
-
-void log_shutdown(void)
-{
-#ifdef NOFRENDO_DEBUG
- /* Snoop around for unallocated blocks */
- mem_checkblocks();
- mem_checkleaks();
-#ifdef OSD_LOG
- osd_logshutdown();
-#endif /* OSD_LOG */
- fclose(errorlog);
-#endif /* NOFRENDO_DEBUG */
-}
-
-void log_print(const char *string)
-{
-#ifdef NOFRENDO_DEBUG
-#ifdef OSD_LOG
- osd_logprint(string);
-#endif /* OSD_LOG */
- /* Log it to disk, as well */
- fputs(string, errorlog);
-#endif /* NOFRENDO_DEBUG */
-}
-
-void log_printf(const char *format, ... )
-{
-#ifdef NOFRENDO_DEBUG
-#ifdef OSD_LOG
- char buffer[1024 + 1];
-#endif /* OSD_LOG */
- va_list arg;
-
- va_start(arg, format);
-
-#ifdef OSD_LOG
- vsprintf(buffer, format, arg);
- osd_logprint(buffer);
-#endif /* OSD_LOG */
- vfprintf(errorlog, format, arg);
- va_end(arg);
-#endif /* NOFRENDO_DEBUG */
-}
-
-/*
-** $Log: log.c,v $
-** Revision 1.2 2003/12/05 15:55:01 f1rmb
-** cleanup phase II. use xprintf when it's relevant, use xine_xmalloc when it's relevant too. Small other little fix (can't remember). Change few internal function prototype because it xine_t pointer need to be used if some xine's internal sections. NOTE: libdvd{nav,read} is still too noisy, i will take a look to made it quit, without invasive changes. To be continued...
-**
-** Revision 1.1 2003/01/08 07:04:35 tmmm
-** initial import of Nosefart sources
-**
-** Revision 1.5 2000/06/26 04:55:33 matt
-** minor change
-**
-** Revision 1.4 2000/06/09 15:12:25 matt
-** initial revision
-**
-*/
diff --git a/src/libxineadec/nosefart/log.h b/src/libxineadec/nosefart/log.h
deleted file mode 100644
index a12deff0a..000000000
--- a/src/libxineadec/nosefart/log.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
-** Nofrendo (c) 1998-2000 Matthew Conte (matt@conte.com)
-**
-**
-** This program is free software; you can redistribute it and/or
-** modify it under the terms of version 2 of the GNU Library General
-** Public License as published by the Free Software Foundation.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-** Library General Public License for more details. To obtain a
-** copy of the GNU Library General Public License, write to the Free
-** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-**
-** Any permitted reproduction of these routines, in whole or in part,
-** must bear this legend.
-**
-**
-** log.h
-**
-** Error logging header file
-** $Id: log.h,v 1.3 2006/04/21 23:15:45 dsalt Exp $
-*/
-
-#ifndef _LOG_H_
-#define _LOG_H_
-
-#include <stdio.h>
-#include "attributes.h"
-
-extern int log_init(void);
-extern void log_shutdown(void);
-extern void log_print(const char *string);
-extern void log_printf(const char *format, ...) XINE_FORMAT_PRINTF(1, 2);
-
-#endif /* _LOG_H_ */
-
-/*
-** $Log: log.h,v $
-** Revision 1.3 2006/04/21 23:15:45 dsalt
-** Add printf format attributes.
-**
-** Revision 1.2 2003/12/05 15:55:01 f1rmb
-** cleanup phase II. use xprintf when it's relevant, use xine_xmalloc when it's relevant too. Small other little fix (can't remember). Change few internal function prototype because it xine_t pointer need to be used if some xine's internal sections. NOTE: libdvd{nav,read} is still too noisy, i will take a look to made it quit, without invasive changes. To be continued...
-**
-** Revision 1.1 2003/01/08 07:04:35 tmmm
-** initial import of Nosefart sources
-**
-** Revision 1.4 2000/06/09 15:12:25 matt
-** initial revision
-**
-*/
diff --git a/src/libxineadec/nosefart/memguard.c b/src/libxineadec/nosefart/memguard.c
deleted file mode 100644
index 35b3ef6ba..000000000
--- a/src/libxineadec/nosefart/memguard.c
+++ /dev/null
@@ -1,417 +0,0 @@
-/*
-** Nofrendo (c) 1998-2000 Matthew Conte (matt@conte.com)
-**
-**
-** This program is free software; you can redistribute it and/or
-** modify it under the terms of version 2 of the GNU Library General
-** Public License as published by the Free Software Foundation.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-** Library General Public License for more details. To obtain a
-** copy of the GNU Library General Public License, write to the Free
-** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-**
-** Any permitted reproduction of these routines, in whole or in part,
-** must bear this legend.
-**
-**
-** memguard.c
-**
-** memory allocation wrapper routines
-**
-** NOTE: based on code (c) 1998 the Retrocade group
-** $Id: memguard.c,v 1.4 2004/02/20 19:53:39 komadori Exp $
-*/
-
-#include "types.h"
-
-/* undefine macro definitions, so we get real calls */
-#undef malloc
-#undef free
-
-#include <string.h>
-#include <stdlib.h>
-
-#if HAVE_INTTYPES_H
-# include <inttypes.h>
-#else
-# if HAVE_STDINT_H
-# include <stdint.h>
-# endif
-#endif
-
-#include "memguard.h"
-#include "log.h"
-
-
-/* Maximum number of allocated blocks at any one time */
-#define MAX_BLOCKS 16384
-
-/* Memory block structure */
-typedef struct memblock_s
-{
- void *block_addr;
- int block_size;
- char *file_name;
- int line_num;
-} memblock_t;
-
-boolean mem_debug = TRUE; /* debugging flag */
-
-
-#ifdef NOFRENDO_DEBUG
-
-static int mem_blockcount = 0; /* allocated block count */
-static memblock_t *mem_record = NULL;
-
-#define GUARD_STRING "GgUuAaRrDdSsTtRrIiNnGgBbLlOoCcKk"
-#define GUARD_LENGTH 64 /* before and after allocated block */
-
-
-/*
-** Check the memory guard to make sure out of bounds writes have not
-** occurred.
-*/
-static boolean mem_checkguardblock(void *data, int guard_size)
-{
- uint8 *orig, *chk, *blk;
- int i, alloc_size;
-
- /* get the original pointer */
- orig = (((uint8 *) data) - guard_size);
-
- /* get the size */
- alloc_size = *((uint32 *) orig);
-
- /* now skip past the size */
- blk = orig + sizeof(uint32);
-
- /* check leading guard string */
- chk = GUARD_STRING;
- for (i = sizeof(uint32); i < guard_size; i++)
- {
- if (0 == *chk)
- chk = GUARD_STRING;
- if (*blk != *chk)
- return FALSE;
- chk++;
- blk++;
- }
-
- /* check end of block */
- chk = GUARD_STRING;
- blk = ((uint8 *) data) + alloc_size;
- for (i = 0; i < guard_size; i++)
- {
- if (0 == *chk)
- chk = GUARD_STRING;
- if (*blk != *chk)
- return FALSE;
- chk++;
- blk++;
- }
-
- /* we're okay! */
- return TRUE;
-}
-
-/* free a guard block */
-static void mem_freeguardblock(void *data, int guard_size)
-{
- uint8 *orig = (((uint8 *) data) - guard_size);
-
- free(orig);
-}
-
-/* fill in the memory guard, advance the pointer to the 'real' memory */
-static void *mem_guardblock(int alloc_size, int guard_size)
-{
- void *orig;
- uint8 *blk, *chk;
- int i;
-
- /* allocate memory */
- orig = calloc(alloc_size + (guard_size * 2), 1);
- if (NULL == orig)
- return NULL;
-
- blk = ((uint8 *) orig);
-
- /* store the size of the newly allocated block*/
- *((uint32 *) blk) = alloc_size;
-
- /* skip past the size */
- blk += sizeof(uint32);
-
- /* put guard string at beginning of block */
- chk = GUARD_STRING;
- for (i = sizeof(uint32); i < guard_size; i++)
- {
- if (0 == *chk)
- chk = GUARD_STRING;
- *blk++ = *chk++;
- }
-
- /* check end of block */
- chk = GUARD_STRING;
- blk = guard_size + (uint8 *) orig + alloc_size;
- for (i = 0; i < guard_size; i++)
- {
- if (0 == *chk)
- chk = GUARD_STRING;
- *blk++ = *chk++;
- }
-
- return (void *) (guard_size + (uint8 *) orig);
-}
-
-
-/* Allocate a bunch of memory to keep track of all memory blocks */
-static void mem_init(void)
-{
- if (mem_record)
- {
- free(mem_record);
- mem_record = NULL;
- }
-
- mem_record = calloc(MAX_BLOCKS * sizeof(memblock_t), 1);
- ASSERT(mem_record);
-}
-
-/* add a block of memory to the master record */
-static void mem_addblock(void *data, int block_size, char *file, int line)
-{
- int i;
-
- for (i = 0; i < MAX_BLOCKS; i++)
- {
- if (NULL == mem_record[i].block_addr)
- {
- mem_record[i].block_addr = data;
- mem_record[i].block_size = block_size;
- mem_record[i].file_name = file;
- mem_record[i].line_num = line;
- return;
- }
- }
-
- ASSERT_MSG("out of memory blocks.");
-}
-
-/* find an entry in the block record and delete it */
-static void mem_deleteblock(void *data, char *file, int line)
-{
- int i;
- char fail[256];
-
- for (i = 0; i < MAX_BLOCKS; i++)
- {
- if (data == mem_record[i].block_addr)
- {
- if (FALSE == mem_checkguardblock(mem_record[i].block_addr, GUARD_LENGTH))
- {
- sprintf(fail, "mem_deleteblock 0x%08X at line %d of %s -- block corrupt",
- (uint32) data, line, file);
- ASSERT_MSG(fail);
- }
-
- memset(&mem_record[i], 0, sizeof(memblock_t));
- return;
- }
- }
-
- sprintf(fail, "mem_deleteblock 0x%08X at line %d of %s -- block not found",
- (uint32) data, line, file);
- ASSERT_MSG(fail);
-}
-#endif /* NOFRENDO_DEBUG */
-
-/* allocates memory and clears it */
-#ifdef NOFRENDO_DEBUG
-void *_my_malloc(int size, char *file, int line)
-#else
-void *_my_malloc(int size)
-#endif
-{
- void *temp;
- char fail[256];
-
-#ifdef NOFRENDO_DEBUG
- if (NULL == mem_record && FALSE != mem_debug)
- mem_init();
-
- if (FALSE != mem_debug)
- temp = mem_guardblock(size, GUARD_LENGTH);
- else
-#endif /* NOFRENDO_DEBUG */
- temp = calloc(sizeof(uint8), size);
-
- if (NULL == temp)
- {
-#ifdef NOFRENDO_DEBUG
- sprintf(fail, "malloc: out of memory at line %d of %s. block size: %d\n",
- line, file, size);
-#else
- sprintf(fail, "malloc: out of memory. block size: %d\n", size);
-#endif
- ASSERT_MSG(fail);
- }
-
-#ifdef NOFRENDO_DEBUG
- if (FALSE != mem_debug)
- mem_addblock(temp, size, file, line);
-
- mem_blockcount++;
-#endif
-
- return temp;
-}
-
-/* free a pointer allocated with my_malloc */
-#ifdef NOFRENDO_DEBUG
-void _my_free(void **data, char *file, int line)
-#else
-void _my_free(void **data)
-#endif
-{
- char fail[256];
-
- if (NULL == data || NULL == *data
- || ((uintptr_t)-1) == (uintptr_t) *data || ((uintptr_t)-1) == (uintptr_t) data)
- {
-#ifdef NOFRENDO_DEBUG
- sprintf(fail, "free: attempted to free NULL pointer at line %d of %s\n",
- line, file);
-#else
- sprintf(fail, "free: attempted to free NULL pointer.\n");
-#endif
- ASSERT_MSG(fail);
- }
-
-#ifdef NOFRENDO_DEBUG
- /* if this is true, we are in REAL trouble */
- if (0 == mem_blockcount)
- {
- ASSERT_MSG("free: attempted to free memory when no blocks available");
- }
-
- if (FALSE != mem_debug)
- mem_deleteblock(*data, file, line);
-
- mem_blockcount--; /* dec our block count */
-
- if (FALSE != mem_debug)
- mem_freeguardblock(*data, GUARD_LENGTH);
- else
-#endif /* NOFRENDO_DEBUG */
- free(*data);
-
- *data = NULL; /* NULL our source */
-}
-
-/* check for orphaned memory handles */
-void mem_checkleaks(void)
-{
-#ifdef NOFRENDO_DEBUG
- int i;
-
- if (FALSE == mem_debug)
- return;
-
- if (mem_blockcount)
- {
- log_printf("memory leak - %d unfreed block%s\n\n", mem_blockcount,
- mem_blockcount == 1 ? "" : "s");
-
- for (i = 0; i < MAX_BLOCKS; i++)
- {
- if (mem_record[i].block_addr)
- {
- log_printf("addr: 0x%08X, size: %d, line %d of %s%s\n",
- (uint32) mem_record[i].block_addr,
- mem_record[i].block_size,
- mem_record[i].line_num,
- mem_record[i].file_name,
- (FALSE == mem_checkguardblock(mem_record[i].block_addr, GUARD_LENGTH))
- ? " -- block corrupt" : "");
- }
- }
- }
- else
- log_printf("no memory leaks\n");
-#endif
-}
-
-void mem_checkblocks(void)
-{
-#ifdef NOFRENDO_DEBUG
- int i;
-
- if (FALSE == mem_debug)
- return;
-
- for (i = 0; i < MAX_BLOCKS; i++)
- {
- if (mem_record[i].block_addr)
- {
- if (FALSE == mem_checkguardblock(mem_record[i].block_addr, GUARD_LENGTH))
- {
- log_printf("addr: 0x%08X, size: %d, line %d of %s -- block corrupt\n",
- (uint32) mem_record[i].block_addr,
- mem_record[i].block_size,
- mem_record[i].line_num,
- mem_record[i].file_name);
- }
- }
- }
-#endif /* NOFRENDO_DEBUG */
-}
-
-/*
-** $Log: memguard.c,v $
-** Revision 1.4 2004/02/20 19:53:39 komadori
-** Fixed detection of linux framebuffer support. Included xineutils.h in dsputil_mlib.c and added to diff_to_ffmpeg_cvs.txt. Fixed function prototype in dsputil_mlib.c (should be sent back to ffmpeg-dev at some point). Fixed includes in nosefart. Fixed nested comments and includes in goom.
-**
-** Revision 1.3 2004/02/19 02:50:25 rockyb
-** Mandrake patches from
-** http://cvs.mandrakesoft.com/cgi-bin/cvsweb.cgi/SPECS/xine-lib/
-** via Goetz Waschk who reports:
-**
-** The amd64 patch (xine-lib-1-rc0a-amd64.patch) sets some conservative
-** CFLAGS for amd64,
-**
-** the lib64 patch (xine-lib-1-rc0a-lib64.patch) replaces hardcoded
-** /lib to support the lib64 library dir on amd64,
-**
-** the directfb patch (xine-lib-1-rc2-no-directfb.patch) adds a
-** configure option to disable directfb,
-**
-** the linuxfb patch (xine-lib-1-rc3a-no-linuxfb.patch) does the same
-** for linux framebuffer and
-**
-** the 64bit fixes patch (xine-lib-1-rc3-64bit-fixes.patch) doesn't
-** apply at the moment against the CVS -- demux_ogg.c was not applied.
-** it includes some 64 bit pointer and other fixes for 64bit architectures.
-** from Gwenole Beauchesne
-**
-** I haven't tested other than apply and compile.
-**
-** Revision 1.2 2003/12/05 15:55:01 f1rmb
-** cleanup phase II. use xprintf when it's relevant, use xine_xmalloc when it's relevant too. Small other little fix (can't remember). Change few internal function prototype because it xine_t pointer need to be used if some xine's internal sections. NOTE: libdvd{nav,read} is still too noisy, i will take a look to made it quit, without invasive changes. To be continued...
-**
-** Revision 1.1 2003/01/08 07:04:35 tmmm
-** initial import of Nosefart sources
-**
-** Revision 1.8 2000/06/26 04:54:48 matt
-** simplified and made more robust
-**
-** Revision 1.7 2000/06/12 01:11:41 matt
-** cleaned up some error output for win32
-**
-** Revision 1.6 2000/06/09 15:12:25 matt
-** initial revision
-**
-*/
diff --git a/src/libxineadec/nosefart/memguard.h b/src/libxineadec/nosefart/memguard.h
deleted file mode 100644
index d80d6fb7c..000000000
--- a/src/libxineadec/nosefart/memguard.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
-** Nofrendo (c) 1998-2000 Matthew Conte (matt@conte.com)
-**
-**
-** This program is free software; you can redistribute it and/or
-** modify it under the terms of version 2 of the GNU Library General
-** Public License as published by the Free Software Foundation.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-** Library General Public License for more details. To obtain a
-** copy of the GNU Library General Public License, write to the Free
-** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-**
-** Any permitted reproduction of these routines, in whole or in part,
-** must bear this legend.
-**
-**
-** memguard.h
-**
-** memory allocation wrapper routines
-** $Id: memguard.h,v 1.2 2003/03/01 02:23:01 storri Exp $
-*/
-
-#ifndef _MEMGUARD_H_
-#define _MEMGUARD_H_
-
-#ifdef NOFRENDO_DEBUG
-
-#define malloc(s) _my_malloc((s), __FILE__, __LINE__)
-#define free(d) _my_free((void **) &(d), __FILE__, __LINE__)
-
-extern void *_my_malloc(int size, char *file, int line);
-extern void _my_free(void **data, char *file, int line);
-
-#else /* Non-debugging versions of calls */
-
-#define malloc(s) _my_malloc((s))
-#define free(d) _my_free((void **) &(d))
-
-extern void *_my_malloc(int size);
-extern void _my_free(void **data);
-
-#endif /* NOFRENDO_DEBUG */
-
-
-extern void mem_checkblocks(void);
-extern void mem_checkleaks(void);
-
-extern boolean mem_debug;
-
-#endif /* _MEMGUARD_H_ */
-
-/*
-** $Log: memguard.h,v $
-** Revision 1.2 2003/03/01 02:23:01 storri
-** Added new line at end of file to remove compiler warning.
-**
-** Revision 1.1 2003/01/08 07:04:35 tmmm
-** initial import of Nosefart sources
-**
-** Revision 1.5 2000/06/26 04:54:48 matt
-** simplified and made more robust
-**
-** Revision 1.4 2000/06/09 15:12:25 matt
-** initial revision
-**
-*/
-
diff --git a/src/libxineadec/nosefart/mmc5_snd.c b/src/libxineadec/nosefart/mmc5_snd.c
deleted file mode 100644
index 7269fa967..000000000
--- a/src/libxineadec/nosefart/mmc5_snd.c
+++ /dev/null
@@ -1,360 +0,0 @@
-/*
-** Nofrendo (c) 1998-2000 Matthew Conte (matt@conte.com)
-**
-**
-** This program is free software; you can redistribute it and/or
-** modify it under the terms of version 2 of the GNU Library General
-** Public License as published by the Free Software Foundation.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-** Library General Public License for more details. To obtain a
-** copy of the GNU Library General Public License, write to the Free
-** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-**
-** Any permitted reproduction of these routines, in whole or in part,
-** must bear this legend.
-**
-**
-** mmc5_snd.c
-**
-** Nintendo MMC5 sound emulation
-** $Id: mmc5_snd.c,v 1.2 2003/12/05 15:55:01 f1rmb Exp $
-*/
-
-#include <string.h>
-#include "types.h"
-#include "mmc5_snd.h"
-#include "nes_apu.h"
-
-/* TODO: encapsulate apu/mmc5 rectangle */
-
-#define APU_OVERSAMPLE
-#define APU_VOLUME_DECAY(x) ((x) -= ((x) >> 7))
-
-
-typedef struct mmc5dac_s
-{
- int32 output;
- boolean enabled;
-} mmc5dac_t;
-
-
-/* look up table madness */
-static int32 decay_lut[16];
-static int vbl_lut[32];
-
-/* various sound constants for sound emulation */
-/* vblank length table used for rectangles, triangle, noise */
-static const uint8 vbl_length[32] =
-{
- 5, 127, 10, 1, 19, 2, 40, 3, 80, 4, 30, 5, 7, 6, 13, 7,
- 6, 8, 12, 9, 24, 10, 48, 11, 96, 12, 36, 13, 8, 14, 16, 15
-};
-
-/* ratios of pos/neg pulse for rectangle waves
-** 2/16 = 12.5%, 4/16 = 25%, 8/16 = 50%, 12/16 = 75%
-** (4-bit adder in rectangles, hence the 16)
-*/
-static const int duty_lut[4] =
-{
- 2, 4, 8, 12
-};
-
-
-static int32 mmc5_incsize;
-static uint8 mul[2];
-static mmc5rectangle_t mmc5rect[2];
-static mmc5dac_t mmc5dac;
-
-#define MMC5_RECTANGLE_OUTPUT chan->output_vol
-static int32 mmc5_rectangle(mmc5rectangle_t *chan)
-{
- int32 output;
-
-#ifdef APU_OVERSAMPLE
- int num_times;
- int32 total;
-#endif /* APU_OVERSAMPLE */
-
- /* reg0: 0-3=volume, 4=envelope, 5=hold, 6-7=duty cycle
- ** reg1: 0-2=sweep shifts, 3=sweep inc/dec, 4-6=sweep length, 7=sweep on
- ** reg2: 8 bits of freq
- ** reg3: 0-2=high freq, 7-4=vbl length counter
- */
-
- APU_VOLUME_DECAY(chan->output_vol);
-
- if (FALSE == chan->enabled || 0 == chan->vbl_length)
- return MMC5_RECTANGLE_OUTPUT;
-
- /* vbl length counter */
- if (FALSE == chan->holdnote)
- chan->vbl_length--;
-
- /* envelope decay at a rate of (env_delay + 1) / 240 secs */
- chan->env_phase -= 4; /* 240/60 */
- while (chan->env_phase < 0)
- {
- chan->env_phase += chan->env_delay;
-
- if (chan->holdnote)
- chan->env_vol = (chan->env_vol + 1) & 0x0F;
- else if (chan->env_vol < 0x0F)
- chan->env_vol++;
- }
-
- if (chan->freq < APU_TO_FIXED(4))
- return MMC5_RECTANGLE_OUTPUT;
-
- chan->phaseacc -= mmc5_incsize; /* # of cycles per sample */
- if (chan->phaseacc >= 0)
- return MMC5_RECTANGLE_OUTPUT;
-
-#ifdef APU_OVERSAMPLE
- num_times = total = 0;
-
- if (chan->fixed_envelope)
- output = chan->volume << 8; /* fixed volume */
- else
- output = (chan->env_vol ^ 0x0F) << 8;
-#endif
-
- while (chan->phaseacc < 0)
- {
- chan->phaseacc += chan->freq;
- chan->adder = (chan->adder + 1) & 0x0F;
-
-#ifdef APU_OVERSAMPLE
- if (chan->adder < chan->duty_flip)
- total += output;
- else
- total -= output;
-
- num_times++;
-#endif
- }
-
-#ifdef APU_OVERSAMPLE
- chan->output_vol = total / num_times;
-#else
- if (chan->fixed_envelope)
- output = chan->volume << 8; /* fixed volume */
- else
- output = (chan->env_vol ^ 0x0F) << 8;
-
- if (0 == chan->adder)
- chan->output_vol = output;
- else if (chan->adder == chan->duty_flip)
- chan->output_vol = -output;
-#endif
-
- return MMC5_RECTANGLE_OUTPUT;
-}
-
-static uint8 mmc5_read(uint32 address)
-{
- uint32 retval;
-
- retval = (uint32) (mul[0] * mul[1]);
-
- switch (address)
- {
- case 0x5205:
- return (uint8) retval;
-
- case 0x5206:
- return (uint8) (retval >> 8);
-
- default:
- return 0xFF;
- }
-}
-
-/* mix vrcvi sound channels together */
-static int32 mmc5_process(void)
-{
- int32 accum;
-
- accum = mmc5_rectangle(&mmc5rect[0]);
- accum += mmc5_rectangle(&mmc5rect[1]);
- if (mmc5dac.enabled)
- accum += mmc5dac.output;
-
- return accum;
-}
-
-/* write to registers */
-static void mmc5_write(uint32 address, uint8 value)
-{
- int chan;
-
- switch (address)
- {
- /* rectangles */
- case MMC5_WRA0:
- case MMC5_WRB0:
- chan = (address & 4) ? 1 : 0;
- mmc5rect[chan].regs[0] = value;
-
- mmc5rect[chan].volume = value & 0x0F;
- mmc5rect[chan].env_delay = decay_lut[value & 0x0F];
- mmc5rect[chan].holdnote = (value & 0x20) ? TRUE : FALSE;
- mmc5rect[chan].fixed_envelope = (value & 0x10) ? TRUE : FALSE;
- mmc5rect[chan].duty_flip = duty_lut[value >> 6];
- break;
-
- case MMC5_WRA1:
- case MMC5_WRB1:
- break;
-
- case MMC5_WRA2:
- case MMC5_WRB2:
- chan = (address & 4) ? 1 : 0;
- mmc5rect[chan].regs[2] = value;
- if (mmc5rect[chan].enabled)
- mmc5rect[chan].freq = APU_TO_FIXED((((mmc5rect[chan].regs[3] & 7) << 8) + value) + 1);
- break;
-
- case MMC5_WRA3:
- case MMC5_WRB3:
- chan = (address & 4) ? 1 : 0;
- mmc5rect[chan].regs[3] = value;
-
- if (mmc5rect[chan].enabled)
- {
- mmc5rect[chan].vbl_length = vbl_lut[value >> 3];
- mmc5rect[chan].env_vol = 0;
- mmc5rect[chan].freq = APU_TO_FIXED((((value & 7) << 8) + mmc5rect[chan].regs[2]) + 1);
- mmc5rect[chan].adder = 0;
- }
- break;
-
- case MMC5_SMASK:
- if (value & 0x01)
- mmc5rect[0].enabled = TRUE;
- else
- {
- mmc5rect[0].enabled = FALSE;
- mmc5rect[0].vbl_length = 0;
- }
-
- if (value & 0x02)
- mmc5rect[1].enabled = TRUE;
- else
- {
- mmc5rect[1].enabled = FALSE;
- mmc5rect[1].vbl_length = 0;
- }
-
- break;
-
- case 0x5010:
- if (value & 0x01)
- mmc5dac.enabled = TRUE;
- else
- mmc5dac.enabled = FALSE;
- break;
-
- case 0x5011:
- mmc5dac.output = (value ^ 0x80) << 8;
- break;
-
- case 0x5205:
- mul[0] = value;
- break;
-
- case 0x5206:
- mul[1] = value;
- break;
-
- default:
- break;
- }
-}
-
-/* reset state of vrcvi sound channels */
-static void mmc5_reset(void)
-{
- int i;
-
- /* get the phase period from the apu */
- mmc5_incsize = apu_getcyclerate();
-
- for (i = 0x5000; i < 0x5008; i++)
- mmc5_write(i, 0);
-
- mmc5_write(0x5010, 0);
- mmc5_write(0x5011, 0);
-}
-
-static void mmc5_init(void)
-{
- int i;
- int num_samples = apu_getcontext()->num_samples;
-
- /* lut used for enveloping and frequency sweeps */
- for (i = 0; i < 16; i++)
- decay_lut[i] = num_samples * (i + 1);
-
- /* used for note length, based on vblanks and size of audio buffer */
- for (i = 0; i < 32; i++)
- vbl_lut[i] = vbl_length[i] * num_samples;
-}
-
-/* TODO: bleh */
-static void mmc5_shutdown(void)
-{
-}
-
-static apu_memread mmc5_memread[] =
-{
- { 0x5205, 0x5206, mmc5_read },
- { -1, -1, NULL }
-};
-
-static apu_memwrite mmc5_memwrite[] =
-{
- { 0x5000, 0x5015, mmc5_write },
- { 0x5205, 0x5206, mmc5_write },
- { -1, -1, NULL }
-};
-
-apuext_t mmc5_ext =
-{
- mmc5_init,
- mmc5_shutdown,
- mmc5_reset,
- mmc5_process,
- mmc5_memread,
- mmc5_memwrite
-};
-
-/*
-** $Log: mmc5_snd.c,v $
-** Revision 1.2 2003/12/05 15:55:01 f1rmb
-** cleanup phase II. use xprintf when it's relevant, use xine_xmalloc when it's relevant too. Small other little fix (can't remember). Change few internal function prototype because it xine_t pointer need to be used if some xine's internal sections. NOTE: libdvd{nav,read} is still too noisy, i will take a look to made it quit, without invasive changes. To be continued...
-**
-** Revision 1.1 2003/01/08 07:04:35 tmmm
-** initial import of Nosefart sources
-**
-** Revision 1.6 2000/07/04 04:51:41 matt
-** cleanups
-**
-** Revision 1.5 2000/07/03 02:18:53 matt
-** much better external module exporting
-**
-** Revision 1.4 2000/06/28 22:03:51 matt
-** fixed stupid oversight
-**
-** Revision 1.3 2000/06/20 20:46:58 matt
-** minor cleanups
-**
-** Revision 1.2 2000/06/20 04:06:16 matt
-** migrated external sound definition to apu module
-**
-** Revision 1.1 2000/06/20 00:06:47 matt
-** initial revision
-**
-*/
diff --git a/src/libxineadec/nosefart/mmc5_snd.h b/src/libxineadec/nosefart/mmc5_snd.h
deleted file mode 100644
index 256cc2285..000000000
--- a/src/libxineadec/nosefart/mmc5_snd.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
-** Nofrendo (c) 1998-2000 Matthew Conte (matt@conte.com)
-**
-**
-** This program is free software; you can redistribute it and/or
-** modify it under the terms of version 2 of the GNU Library General
-** Public License as published by the Free Software Foundation.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-** Library General Public License for more details. To obtain a
-** copy of the GNU Library General Public License, write to the Free
-** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-**
-** Any permitted reproduction of these routines, in whole or in part,
-** must bear this legend.
-**
-**
-** mmc5_snd.h
-**
-** Nintendo MMC5 sound emulation header
-** $Id: mmc5_snd.h,v 1.2 2003/12/05 15:55:01 f1rmb Exp $
-*/
-
-#ifndef _MMC5_SND_H_
-#define _MMC5_SND_H_
-
-#define MMC5_WRA0 0x5000
-#define MMC5_WRA1 0x5001
-#define MMC5_WRA2 0x5002
-#define MMC5_WRA3 0x5003
-#define MMC5_WRB0 0x5004
-#define MMC5_WRB1 0x5005
-#define MMC5_WRB2 0x5006
-#define MMC5_WRB3 0x5007
-#define MMC5_SMASK 0x5015
-
-typedef struct mmc5rectangle_s
-{
- uint8 regs[4];
-
- boolean enabled;
-
- int32 phaseacc;
- int32 freq;
- int32 output_vol;
- boolean fixed_envelope;
- boolean holdnote;
- uint8 volume;
-
- int32 env_phase;
- int32 env_delay;
- uint8 env_vol;
-
- int vbl_length;
- uint8 adder;
- int duty_flip;
-} mmc5rectangle_t;
-
-
-#include "nes_apu.h"
-
-extern apuext_t mmc5_ext;
-
-#endif /* !_MMC5_SND_H_ */
-
-/*
-** $Log: mmc5_snd.h,v $
-** Revision 1.2 2003/12/05 15:55:01 f1rmb
-** cleanup phase II. use xprintf when it's relevant, use xine_xmalloc when it's relevant too. Small other little fix (can't remember). Change few internal function prototype because it xine_t pointer need to be used if some xine's internal sections. NOTE: libdvd{nav,read} is still too noisy, i will take a look to made it quit, without invasive changes. To be continued...
-**
-** Revision 1.1 2003/01/08 07:04:35 tmmm
-** initial import of Nosefart sources
-**
-** Revision 1.2 2000/06/20 04:06:16 matt
-** migrated external sound definition to apu module
-**
-** Revision 1.1 2000/06/20 00:06:47 matt
-** initial revision
-**
-*/
diff --git a/src/libxineadec/nosefart/nes6502.c b/src/libxineadec/nosefart/nes6502.c
deleted file mode 100644
index f1ca80af4..000000000
--- a/src/libxineadec/nosefart/nes6502.c
+++ /dev/null
@@ -1,2386 +0,0 @@
-/*
-** Nofrendo (c) 1998-2000 Matthew Conte (matt@conte.com)
-**
-**
-** This program is free software; you can redistribute it and/or
-** modify it under the terms of version 2 of the GNU Library General
-** Public License as published by the Free Software Foundation.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-** Library General Public License for more details. To obtain a
-** copy of the GNU Library General Public License, write to the Free
-** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-**
-** Any permitted reproduction of these routines, in whole or in part,
-** must bear this legend.
-**
-**
-** nes6502.c
-**
-** NES custom 6502 (2A03) CPU implementation
-** $Id: nes6502.c,v 1.2 2003/01/09 19:50:03 jkeil Exp $
-*/
-
-
-#include "types.h"
-#include "nes6502.h"
-#include "dis6502.h"
-#include <stdio.h>
-
-
-#define ADD_CYCLES(x) instruction_cycles += (x)
-#define INC_CYCLES() instruction_cycles++
-//#define ADD_CYCLES(x) remaining_cycles -= (x)
-//#define INC_CYCLES() remaining_cycles--
-
-/*
-** Check to see if an index reg addition overflowed to next page
-*/
-#define CHECK_INDEX_OVERFLOW(addr, reg) \
-{ \
- if ((uint8) (addr) < (reg)) \
- INC_CYCLES(); \
-}
-
-/*
-** Addressing mode macros
-*/
-
-#define NO_READ(value) /* empty */
-
-#define IMMEDIATE_BYTE(value) \
-{ \
- value = bank_readbyte(PC++); \
-}
-
-
-#define ABSOLUTE_ADDR(address) \
-{ \
- address = bank_readaddress(PC); \
- PC += 2; \
-}
-
-#define ABSOLUTE(address, value) \
-{ \
- ABSOLUTE_ADDR(address); \
- value = mem_read(address); \
-}
-
-#define ABSOLUTE_BYTE(value) \
-{ \
- ABSOLUTE(temp, value); \
-}
-
-#define ABS_IND_X_ADDR(address) \
-{ \
- address = (bank_readaddress(PC) + X) & 0xFFFF; \
- PC += 2; \
- CHECK_INDEX_OVERFLOW(address, X); \
-}
-
-#define ABS_IND_X(address, value) \
-{ \
- ABS_IND_X_ADDR(address); \
- value = mem_read(address); \
-}
-
-#define ABS_IND_X_BYTE(value) \
-{ \
- ABS_IND_X(temp, value); \
-}
-
-#define ABS_IND_Y_ADDR(address) \
-{ \
- address = (bank_readaddress(PC) + Y) & 0xFFFF; \
- PC += 2; \
- CHECK_INDEX_OVERFLOW(address, Y); \
-}
-
-#define ABS_IND_Y(address, value) \
-{ \
- ABS_IND_Y_ADDR(address); \
- value = mem_read(address); \
-}
-
-#define ABS_IND_Y_BYTE(value) \
-{ \
- ABS_IND_Y(temp, value); \
-}
-
-#define ZERO_PAGE_ADDR(address) \
-{ \
- IMMEDIATE_BYTE(address); \
-}
-
-#define ZERO_PAGE(address, value) \
-{ \
- ZERO_PAGE_ADDR(address); \
- value = ZP_READ(address); \
-}
-
-#define ZERO_PAGE_BYTE(value) \
-{ \
- ZERO_PAGE(btemp, value); \
-}
-
-/* Zero-page indexed Y doesn't really exist, just for LDX / STX */
-#define ZP_IND_X_ADDR(address) \
-{ \
- address = bank_readbyte(PC++) + X; \
-}
-
-#define ZP_IND_X(bAddr, value) \
-{ \
- ZP_IND_X_ADDR(bAddr); \
- value = ZP_READ(bAddr); \
-}
-
-#define ZP_IND_X_BYTE(value) \
-{ \
- ZP_IND_X(btemp, value); \
-}
-
-#define ZP_IND_Y_ADDR(address) \
-{ \
- address = bank_readbyte(PC++) + Y; \
-}
-
-#define ZP_IND_Y(address, value) \
-{ \
- ZP_IND_Y_ADDR(address); \
- value = ZP_READ(address); \
-}
-
-#define ZP_IND_Y_BYTE(value) \
-{ \
- ZP_IND_Y(btemp, value); \
-}
-
-/*
-** For conditional jump relative instructions
-** (BCC, BCS, BEQ, BMI, BNE, BPL, BVC, BVS)
-*/
-#define RELATIVE_JUMP(cond) \
-{ \
- if (cond) \
- { \
- IMMEDIATE_BYTE(btemp); \
- if (((int8) btemp + (uint8) PC) & 0xFF00) \
- ADD_CYCLES(4); \
- else \
- ADD_CYCLES(3); \
- PC += ((int8) btemp); \
- } \
- else \
- { \
- PC++; \
- ADD_CYCLES(2); \
- } \
-}
-
-/*
-** This is actually indexed indirect, but I call it
-** indirect X to avoid confusion
-*/
-#define INDIR_X_ADDR(address) \
-{ \
- btemp = bank_readbyte(PC++) + X; \
- address = zp_address(btemp); \
-}
-
-#define INDIR_X(address, value) \
-{ \
- INDIR_X_ADDR(address); \
- value = mem_read(address); \
-}
-
-#define INDIR_X_BYTE(value) \
-{ \
- INDIR_X(temp, value); \
-}
-
-/*
-** This is actually indirect indexed, but I call it
-** indirect y to avoid confusion
-*/
-#define INDIR_Y_ADDR(address) \
-{ \
- IMMEDIATE_BYTE(btemp); \
- address = (zp_address(btemp) + Y) & 0xFFFF; \
- /* ???? */ \
- CHECK_INDEX_OVERFLOW(address, Y); \
-}
-
-#define INDIR_Y(address, value) \
-{ \
- INDIR_Y_ADDR(address); \
- value = mem_read(address); \
-}
-
-#define INDIR_Y_BYTE(value) \
-{ \
- /*IMMEDIATE_BYTE(btemp); \
- temp = zp_address(btemp) + Y; \
- CHECK_INDEX_OVERFLOW(temp, Y); \
- value = mem_read(temp);*/ \
- INDIR_Y(temp, value); \
-}
-
-
-#define JUMP(address) PC = bank_readaddress((address))
-
-/*
-** Interrupt macros
-*/
-#define NMI() \
-{ \
- PUSH(PC >> 8); \
- PUSH(PC & 0xFF); \
- CLEAR_FLAG(B_FLAG); \
- PUSH(P); \
- SET_FLAG(I_FLAG); \
- JUMP(NMI_VECTOR); \
- int_pending &= ~NMI_MASK; \
- ADD_CYCLES(INT_CYCLES); \
-}
-
-#define IRQ() \
-{ \
- PUSH(PC >> 8); \
- PUSH(PC & 0xFF); \
- CLEAR_FLAG(B_FLAG); \
- PUSH(P); \
- SET_FLAG(I_FLAG); \
- JUMP(IRQ_VECTOR); \
- int_pending &= ~IRQ_MASK; \
- ADD_CYCLES(INT_CYCLES); \
-}
-
-/*
-** Instruction macros
-*/
-
-/* Warning! NES CPU has no decimal mode, so by default this does no BCD! */
-#ifdef NES6502_DECIMAL
-#define ADC(cycles, read_func) \
-{ \
- read_func(data); \
- if (P & D_FLAG) \
- { \
- temp = (A & 0x0F) + (data & 0x0F) + (P & C_FLAG); \
- if (temp >= 10) \
- temp = (temp - 10) | 0x10; \
- temp += (A & 0xF0) + (data & 0xF0); \
- TEST_AND_FLAG(0 == ((A + data + (P & C_FLAG)) & 0xFF), Z_FLAG); \
- TEST_AND_FLAG(temp & 0x80, N_FLAG); \
- TEST_AND_FLAG(((~(A ^ data)) & (A ^ temp) & 0x80), V_FLAG); \
- if (temp > 0x9F) \
- temp += 0x60; \
- TEST_AND_FLAG(temp > 0xFF, C_FLAG); \
- A = (uint8) temp; \
- } \
- else \
- { \
- temp = A + data + (P & C_FLAG); \
- /* Set C on carry */ \
- TEST_AND_FLAG(temp > 0xFF, C_FLAG); \
- /* Set V on overflow */ \
- TEST_AND_FLAG(((~(A ^ data)) & (A ^ temp) & 0x80), V_FLAG); \
- A = (uint8) temp; \
- SET_NZ_FLAGS(A); \
- }\
- ADD_CYCLES(cycles); \
-}
-#else
-#define ADC(cycles, read_func) \
-{ \
- read_func(data); \
- temp = A + data + (P & C_FLAG); \
- /* Set C on carry */ \
- TEST_AND_FLAG(temp > 0xFF, C_FLAG); \
- /* Set V on overflow */ \
- TEST_AND_FLAG(((~(A ^ data)) & (A ^ temp) & 0x80), V_FLAG); \
- A = (uint8) temp; \
- SET_NZ_FLAGS(A); \
- ADD_CYCLES(cycles); \
-}
-#endif /* NES6502_DECIMAL */
-
-/* undocumented */
-#define ANC(cycles, read_func) \
-{ \
- read_func(data); \
- A &= data; \
- SET_NZ_FLAGS(A); \
- TEST_AND_FLAG(P & N_FLAG, C_FLAG); \
- ADD_CYCLES(cycles); \
-}
-
-#define AND(cycles, read_func) \
-{ \
- read_func(data); \
- A &= data; \
- SET_NZ_FLAGS(A); \
- ADD_CYCLES(cycles); \
-}
-
-/* undocumented */
-#define ANE(cycles, read_func) \
-{ \
- read_func(data); \
- A = (A | 0xEE) & X & data; \
- SET_NZ_FLAGS(A); \
- ADD_CYCLES(cycles); \
-}
-
-/* undocumented */
-#ifdef NES6502_DECIMAL
-#define ARR(cycles, read_func) \
-{ \
- read_func(data); \
- data &= A; \
- if (P & D_FLAG) \
- { \
- temp = (data >> 1) | ((P & C_FLAG) << 7); \
- SET_NZ_FLAGS(temp); \
- TEST_AND_FLAG((temp ^ data) & 0x40, V_FLAG); \
- if (((data & 0x0F) + (data & 0x01)) > 5) \
- temp = (temp & 0xF0) | ((temp + 0x6) & 0x0F); \
- if (((data & 0xF0) + (data & 0x10)) > 0x50) \
- { \
- temp = (temp & 0x0F) | ((temp + 0x60) & 0xF0); \
- SET_FLAG(C_FLAG); \
- } \
- else \
- CLEAR_FLAG(C_FLAG); \
- A = (uint8) temp; \
- } \
- else \
- { \
- A = (data >> 1) | ((P & C_FLAG) << 7); \
- SET_NZ_FLAGS(A); \
- TEST_AND_FLAG(A & 0x40, C_FLAG); \
- TEST_AND_FLAG(((A >> 6) ^ (A >> 5)) & 1, V_FLAG); \
- }\
- ADD_CYCLES(cycles); \
-}
-#else
-#define ARR(cycles, read_func) \
-{ \
- read_func(data); \
- data &= A; \
- A = (data >> 1) | ((P & C_FLAG) << 7); \
- SET_NZ_FLAGS(A); \
- TEST_AND_FLAG(A & 0x40, C_FLAG); \
- TEST_AND_FLAG((A >> 6) ^ (A >> 5), V_FLAG); \
- ADD_CYCLES(cycles); \
-}
-#endif /* NES6502_DECIMAL */
-
-#define ASL(cycles, read_func, write_func, addr) \
-{ \
- read_func(addr, data); \
- TEST_AND_FLAG(data & 0x80, C_FLAG); \
- data <<= 1; \
- write_func(addr, data); \
- SET_NZ_FLAGS(data); \
- ADD_CYCLES(cycles); \
-}
-
-#define ASL_A() \
-{ \
- TEST_AND_FLAG(A & 0x80, C_FLAG); \
- A <<= 1; \
- SET_NZ_FLAGS(A); \
- ADD_CYCLES(2); \
-}
-
-/* undocumented */
-#define ASR(cycles, read_func) \
-{ \
- read_func(data); \
- data &= A; \
- TEST_AND_FLAG(data & 0x01, C_FLAG); \
- A = data >> 1; \
- SET_NZ_FLAGS(A); \
- ADD_CYCLES(cycles); \
-}
-
-#define BCC() \
-{ \
- RELATIVE_JUMP((IS_FLAG_CLEAR(C_FLAG))); \
-}
-
-#define BCS() \
-{ \
- RELATIVE_JUMP((IS_FLAG_SET(C_FLAG))); \
-}
-
-#define BEQ() \
-{ \
- RELATIVE_JUMP((IS_FLAG_SET(Z_FLAG))); \
-}
-
-#define BIT(cycles, read_func) \
-{ \
- read_func(data); \
- TEST_AND_FLAG(0 == (data & A), Z_FLAG);\
- CLEAR_FLAG(N_FLAG | V_FLAG); \
- /* move bit 7/6 of data into N/V flags */ \
- SET_FLAG(data & (N_FLAG | V_FLAG)); \
- ADD_CYCLES(cycles); \
-}
-
-#define BMI() \
-{ \
- RELATIVE_JUMP((IS_FLAG_SET(N_FLAG))); \
-}
-
-#define BNE() \
-{ \
- RELATIVE_JUMP((IS_FLAG_CLEAR(Z_FLAG))); \
-}
-
-#define BPL() \
-{ \
- RELATIVE_JUMP((IS_FLAG_CLEAR(N_FLAG))); \
-}
-
-/* Software interrupt type thang */
-#define BRK() \
-{ \
- PC++; \
- PUSH(PC >> 8); \
- PUSH(PC & 0xFF); \
- SET_FLAG(B_FLAG); \
- PUSH(P); \
- SET_FLAG(I_FLAG); \
- JUMP(IRQ_VECTOR); \
- ADD_CYCLES(7); \
-}
-
-#define BVC() \
-{ \
- RELATIVE_JUMP((IS_FLAG_CLEAR(V_FLAG))); \
-}
-
-#define BVS() \
-{ \
- RELATIVE_JUMP((IS_FLAG_SET(V_FLAG))); \
-}
-
-#define CLC() \
-{ \
- CLEAR_FLAG(C_FLAG); \
- ADD_CYCLES(2); \
-}
-
-#define CLD() \
-{ \
- CLEAR_FLAG(D_FLAG); \
- ADD_CYCLES(2); \
-}
-
-#define CLI() \
-{ \
- CLEAR_FLAG(I_FLAG); \
- ADD_CYCLES(2); \
-}
-
-#define CLV() \
-{ \
- CLEAR_FLAG(V_FLAG); \
- ADD_CYCLES(2); \
-}
-
-/* TODO: ick! */
-#define _COMPARE(reg, value) \
-{ \
- temp = (reg) - (value); \
- /* C is clear when data > A */ \
- TEST_AND_FLAG(0 == (temp & 0x8000), C_FLAG); \
- SET_NZ_FLAGS((uint8) temp); /* handles Z flag */ \
-}
-
-#define CMP(cycles, read_func) \
-{ \
- read_func(data); \
- _COMPARE(A, data); \
- ADD_CYCLES(cycles); \
-}
-
-#define CPX(cycles, read_func) \
-{ \
- read_func(data); \
- _COMPARE(X, data); \
- ADD_CYCLES(cycles); \
-}
-
-#define CPY(cycles, read_func) \
-{ \
- read_func(data); \
- _COMPARE(Y, data); \
- ADD_CYCLES(cycles); \
-}
-
-/* undocumented */
-#define DCP(cycles, read_func, write_func, addr) \
-{ \
- read_func(addr, data); \
- data--; \
- write_func(addr, data); \
- CMP(cycles, NO_READ); \
-}
-
-#define DEC(cycles, read_func, write_func, addr) \
-{ \
- read_func(addr, data); \
- data--; \
- write_func(addr, data); \
- SET_NZ_FLAGS(data); \
- ADD_CYCLES(cycles); \
-}
-
-#define DEX() \
-{ \
- X--; \
- SET_NZ_FLAGS(X); \
- ADD_CYCLES(2); \
-}
-
-#define DEY() \
-{ \
- Y--; \
- SET_NZ_FLAGS(Y); \
- ADD_CYCLES(2); \
-}
-
-/* undocumented (double-NOP) */
-#define DOP(cycles) \
-{ \
- PC++; \
- ADD_CYCLES(cycles); \
-}
-
-#define EOR(cycles, read_func) \
-{ \
- read_func(data); \
- A ^= data; \
- SET_NZ_FLAGS(A); \
- ADD_CYCLES(cycles); \
-}
-
-#define INC(cycles, read_func, write_func, addr) \
-{ \
- read_func(addr, data); \
- data++; \
- write_func(addr, data); \
- SET_NZ_FLAGS(data); \
- ADD_CYCLES(cycles); \
-}
-
-#define INX() \
-{ \
- X++; \
- SET_NZ_FLAGS(X); \
- ADD_CYCLES(2); \
-}
-
-#define INY() \
-{ \
- Y++; \
- SET_NZ_FLAGS(Y); \
- ADD_CYCLES(2); \
-}
-
-/* undocumented */
-#define ISB(cycles, read_func, write_func, addr) \
-{ \
- read_func(addr, data); \
- data++; \
- write_func(addr, data); \
- SBC(cycles, NO_READ); \
-}
-
-#ifdef NES6502_TESTOPS
-#define JAM() \
-{ \
- cpu_Jam(); \
-}
-#elif defined(NSF_PLAYER)
-#define JAM() \
-{ \
-}
-#else
-#define JAM() \
-{ \
- char jambuf[20]; \
- sprintf(jambuf, "JAM: PC=$%04X", PC); \
- ASSERT_MSG(jambuf); \
- ADD_CYCLES(2); \
-}
-#endif /* NES6502_TESTOPS */
-
-#define JMP_INDIRECT() \
-{ \
- temp = bank_readaddress(PC); \
- /* bug in crossing page boundaries */ \
- if (0xFF == (uint8) temp) \
- PC = (bank_readbyte(temp & ~0xFF) << 8) | bank_readbyte(temp); \
- else \
- JUMP(temp); \
- ADD_CYCLES(5); \
-}
-
-#define JMP_ABSOLUTE() \
-{ \
- JUMP(PC); \
- ADD_CYCLES(3); \
-}
-
-#define JSR() \
-{ \
- PC++; \
- PUSH(PC >> 8); \
- PUSH(PC & 0xFF); \
- JUMP(PC - 1); \
- ADD_CYCLES(6); \
-}
-
-/* undocumented */
-#define LAS(cycles, read_func) \
-{ \
- read_func(data); \
- A = X = S = (S & data); \
- SET_NZ_FLAGS(A); \
- ADD_CYCLES(cycles); \
-}
-
-/* undocumented */
-#define LAX(cycles, read_func) \
-{ \
- read_func(A); \
- X = A; \
- SET_NZ_FLAGS(A); \
- ADD_CYCLES(cycles); \
-}
-
-#define LDA(cycles, read_func) \
-{ \
- read_func(A); \
- SET_NZ_FLAGS(A); \
- ADD_CYCLES(cycles); \
-}
-
-#define LDX(cycles, read_func) \
-{ \
- read_func(X); \
- SET_NZ_FLAGS(X);\
- ADD_CYCLES(cycles); \
-}
-
-#define LDY(cycles, read_func) \
-{ \
- read_func(Y); \
- SET_NZ_FLAGS(Y);\
- ADD_CYCLES(cycles); \
-}
-
-#define LSR(cycles, read_func, write_func, addr) \
-{ \
- read_func(addr, data); \
- TEST_AND_FLAG(data & 0x01, C_FLAG); \
- data >>= 1; \
- write_func(addr, data); \
- SET_NZ_FLAGS(data); \
- ADD_CYCLES(cycles); \
-}
-
-#define LSR_A() \
-{ \
- TEST_AND_FLAG(A & 0x01, C_FLAG); \
- A >>= 1; \
- SET_NZ_FLAGS(A); \
- ADD_CYCLES(2); \
-}
-
-/* undocumented */
-#define LXA(cycles, read_func) \
-{ \
- read_func(data); \
- A = X = ((A | 0xEE) & data); \
- SET_NZ_FLAGS(A); \
- ADD_CYCLES(cycles); \
-}
-
-#define NOP() \
-{ \
- ADD_CYCLES(2); \
-}
-
-#define ORA(cycles, read_func) \
-{ \
- read_func(data); \
- A |= data; \
- SET_NZ_FLAGS(A);\
- ADD_CYCLES(cycles); \
-}
-
-#define PHA() \
-{ \
- PUSH(A); \
- ADD_CYCLES(3); \
-}
-
-#define PHP() \
-{ \
- /* B flag is pushed on stack as well */ \
- PUSH((P | B_FLAG)); \
- ADD_CYCLES(3); \
-}
-
-#define PLA() \
-{ \
- A = PULL(); \
- SET_NZ_FLAGS(A); \
- ADD_CYCLES(4); \
-}
-
-#define PLP() \
-{ \
- P = PULL(); \
- SET_FLAG(R_FLAG); /* ensure reserved flag is set */ \
- ADD_CYCLES(4); \
-}
-
-/* undocumented */
-#define RLA(cycles, read_func, write_func, addr) \
-{ \
- read_func(addr, data); \
- if (P & C_FLAG) \
- { \
- TEST_AND_FLAG(data & 0x80, C_FLAG); \
- data = (data << 1) | 1; \
- } \
- else \
- { \
- TEST_AND_FLAG(data & 0x80, C_FLAG); \
- data <<= 1; \
- } \
- write_func(addr, data); \
- A &= data; \
- SET_NZ_FLAGS(A); \
- ADD_CYCLES(cycles); \
-}
-
-/* 9-bit rotation (carry flag used for rollover) */
-#define ROL(cycles, read_func, write_func, addr) \
-{ \
- read_func(addr, data); \
- if (P & C_FLAG) \
- { \
- TEST_AND_FLAG(data & 0x80, C_FLAG); \
- data = (data << 1) | 1; \
- } \
- else \
- { \
- TEST_AND_FLAG(data & 0x80, C_FLAG); \
- data <<= 1; \
- } \
- write_func(addr, data); \
- SET_NZ_FLAGS(data); \
- ADD_CYCLES(cycles); \
-}
-
-#define ROL_A() \
-{ \
- if (P & C_FLAG) \
- { \
- TEST_AND_FLAG(A & 0x80, C_FLAG); \
- A = (A << 1) | 1; \
- } \
- else \
- { \
- TEST_AND_FLAG(A & 0x80, C_FLAG); \
- A <<= 1; \
- } \
- SET_NZ_FLAGS(A); \
- ADD_CYCLES(2); \
-}
-
-#define ROR(cycles, read_func, write_func, addr) \
-{ \
- read_func(addr, data); \
- if (P & C_FLAG) \
- { \
- TEST_AND_FLAG(data & 1, C_FLAG); \
- data = (data >> 1) | 0x80; \
- } \
- else \
- { \
- TEST_AND_FLAG(data & 1, C_FLAG); \
- data >>= 1; \
- } \
- write_func(addr, data); \
- SET_NZ_FLAGS(data); \
- ADD_CYCLES(cycles); \
-}
-
-#define ROR_A() \
-{ \
- if (P & C_FLAG) \
- { \
- TEST_AND_FLAG(A & 1, C_FLAG); \
- A = (A >> 1) | 0x80; \
- } \
- else \
- { \
- TEST_AND_FLAG(A & 1, C_FLAG); \
- A >>= 1; \
- } \
- SET_NZ_FLAGS(A); \
- ADD_CYCLES(2); \
-}
-
-/* undocumented */
-#define RRA(cycles, read_func, write_func, addr) \
-{ \
- read_func(addr, data); \
- if (P & C_FLAG) \
- { \
- TEST_AND_FLAG(data & 1, C_FLAG); \
- data = (data >> 1) | 0x80; \
- } \
- else \
- { \
- TEST_AND_FLAG(data & 1, C_FLAG); \
- data >>= 1; \
- } \
- write_func(addr, data); \
- ADC(cycles, NO_READ); \
-}
-
-#define RTI() \
-{ \
- P = PULL(); \
- SET_FLAG(R_FLAG); /* ensure reserved flag is set */ \
- PC = PULL(); \
- PC |= PULL() << 8; \
- ADD_CYCLES(6); \
-}
-
-#define RTS() \
-{ \
- PC = PULL(); \
- PC = (PC | (PULL() << 8)) + 1; \
- ADD_CYCLES(6); \
-}
-
-/* undocumented */
-#define SAX(cycles, read_func, write_func, addr) \
-{ \
- read_func(addr); \
- data = A & X; \
- write_func(addr, data); \
- ADD_CYCLES(cycles); \
-}
-
-/* Warning! NES CPU has no decimal mode, so by default this does no BCD! */
-#ifdef NES6502_DECIMAL
-#define SBC(cycles, read_func) \
-{ \
- read_func(data); \
- /* NOT(C) is considered borrow */ \
- temp = A - data - ((P & C_FLAG) ^ C_FLAG); \
- if (P & D_FLAG) \
- { \
- uint8 al, ah; \
- al = (A & 0x0F) - (data & 0x0F) - ((P & C_FLAG) ^ C_FLAG); \
- ah = (A >> 4) - (data >> 4); \
- if (al & 0x10) \
- { \
- al -= 6; \
- ah--; \
- } \
- if (ah & 0x10) \
- ah -= 6; \
- TEST_AND_FLAG(temp < 0x100, C_FLAG); \
- TEST_AND_FLAG(((A ^ temp) & 0x80) && ((A ^ data) & 0x80), V_FLAG); \
- SET_NZ_FLAGS(temp & 0xFF); \
- A = (ah << 4) | (al & 0x0F); \
- } \
- else \
- { \
- TEST_AND_FLAG(((A ^ temp) & 0x80) && ((A ^ data) & 0x80), V_FLAG); \
- TEST_AND_FLAG(temp < 0x100, C_FLAG); \
- A = (uint8) temp; \
- SET_NZ_FLAGS(A & 0xFF); \
- } \
- ADD_CYCLES(cycles); \
-}
-#else
-#define SBC(cycles, read_func) \
-{ \
- read_func(data); \
- temp = A - data - ((P & C_FLAG) ^ C_FLAG); \
- TEST_AND_FLAG(((A ^ data) & (A ^ temp) & 0x80), V_FLAG); \
- TEST_AND_FLAG(temp < 0x100, C_FLAG); \
- A = (uint8) temp; \
- SET_NZ_FLAGS(A); \
- ADD_CYCLES(cycles); \
-}
-#endif /* NES6502_DECIMAL */
-
-/* undocumented */
-#define SBX(cycles, read_func) \
-{ \
- read_func(data); \
- temp = (A & X) - data; \
- TEST_AND_FLAG(temp < 0x100, C_FLAG); \
- X = temp & 0xFF; \
- SET_NZ_FLAGS(X); \
- ADD_CYCLES(cycles); \
-}
-
-#define SEC() \
-{ \
- SET_FLAG(C_FLAG); \
- ADD_CYCLES(2); \
-}
-
-#define SED() \
-{ \
- SET_FLAG(D_FLAG); \
- ADD_CYCLES(2); \
-}
-
-#define SEI() \
-{ \
- SET_FLAG(I_FLAG); \
- ADD_CYCLES(2); \
-}
-
-/* undocumented */
-#define SHA(cycles, read_func, write_func, addr) \
-{ \
- read_func(addr); \
- data = A & X & ((uint8) ((addr >> 8) + 1)); \
- write_func(addr, data); \
- ADD_CYCLES(cycles); \
-}
-
-/* undocumented */
-#define SHS(cycles, read_func, write_func, addr) \
-{ \
- read_func(addr); \
- S = A & X; \
- data = S & ((uint8) ((addr >> 8) + 1)); \
- write_func(addr, data); \
- ADD_CYCLES(cycles); \
-}
-
-/* undocumented */
-#define SHX(cycles, read_func, write_func, addr) \
-{ \
- read_func(addr); \
- data = X & ((uint8) ((addr >> 8) + 1)); \
- write_func(addr, data); \
- ADD_CYCLES(cycles); \
-}
-
-/* undocumented */
-#define SHY(cycles, read_func, write_func, addr) \
-{ \
- read_func(addr); \
- data = Y & ((uint8) ((addr >> 8 ) + 1)); \
- write_func(addr, data); \
- ADD_CYCLES(cycles); \
-}
-
-/* undocumented */
-#define SLO(cycles, read_func, write_func, addr) \
-{ \
- read_func(addr, data); \
- TEST_AND_FLAG(data & 0x80, C_FLAG); \
- data <<= 1; \
- write_func(addr, data); \
- A |= data; \
- SET_NZ_FLAGS(A); \
- ADD_CYCLES(cycles); \
-}
-
-/* unoffical */
-#define SRE(cycles, read_func, write_func, addr) \
-{ \
- read_func(addr, data); \
- TEST_AND_FLAG(data & 1, C_FLAG); \
- data >>= 1; \
- write_func(addr, data); \
- A ^= data; \
- SET_NZ_FLAGS(A); \
- ADD_CYCLES(cycles); \
-}
-
-#define STA(cycles, read_func, write_func, addr) \
-{ \
- read_func(addr); \
- write_func(addr, A); \
- ADD_CYCLES(cycles); \
-}
-
-#define STX(cycles, read_func, write_func, addr) \
-{ \
- read_func(addr); \
- write_func(addr, X); \
- ADD_CYCLES(cycles); \
-}
-
-#define STY(cycles, read_func, write_func, addr) \
-{ \
- read_func(addr); \
- write_func(addr, Y); \
- ADD_CYCLES(cycles); \
-}
-
-#define TAX() \
-{ \
- X = A; \
- SET_NZ_FLAGS(X);\
- ADD_CYCLES(2); \
-}
-
-#define TAY() \
-{ \
- Y = A; \
- SET_NZ_FLAGS(Y);\
- ADD_CYCLES(2); \
-}
-
-/* undocumented (triple-NOP) */
-#define TOP() \
-{ \
- PC += 2; \
- ADD_CYCLES(4); \
-}
-
-#define TSX() \
-{ \
- X = S; \
- SET_NZ_FLAGS(X);\
- ADD_CYCLES(2); \
-}
-
-#define TXA() \
-{ \
- A = X; \
- SET_NZ_FLAGS(A);\
- ADD_CYCLES(2); \
-}
-
-#define TXS() \
-{ \
- S = X; \
- ADD_CYCLES(2); \
-}
-
-#define TYA() \
-{ \
- A = Y; \
- SET_NZ_FLAGS(A); \
- ADD_CYCLES(2); \
-}
-
-
-/*
-** Stack and data fetching macros
-*/
-
-/* Set/clear/test bits in the flags register */
-#define SET_FLAG(mask) P |= (mask)
-#define CLEAR_FLAG(mask) P &= ~(mask)
-#define IS_FLAG_SET(mask) (P & (mask))
-#define IS_FLAG_CLEAR(mask) (0 == IS_FLAG_SET((mask)))
-
-#define TEST_AND_FLAG(test, mask) \
-{ \
- if ((test)) \
- SET_FLAG((mask)); \
- else \
- CLEAR_FLAG((mask)); \
-}
-
-
-/*
-** flag register helper macros
-*/
-
-/* register push/pull */
-#define PUSH(value) stack_page[S--] = (uint8) (value)
-#define PULL() stack_page[++S]
-
-/* Sets the Z and N flags based on given data, taken from precomputed table */
-#define SET_NZ_FLAGS(value) P &= ~(N_FLAG | Z_FLAG); \
- P |= flag_table[(value)]
-
-#define GET_GLOBAL_REGS() \
-{ \
- PC = reg_PC; \
- A = reg_A; \
- X = reg_X; \
- Y = reg_Y; \
- P = reg_P; \
- S = reg_S; \
-}
-
-#define SET_LOCAL_REGS() \
-{ \
- reg_PC = PC; \
- reg_A = A; \
- reg_X = X; \
- reg_Y = Y; \
- reg_P = P; \
- reg_S = S; \
-}
-
-
-/* static data */
-static nes6502_memread *pmem_read, *pmr;
-static nes6502_memwrite *pmem_write, *pmw;
-
-/* lookup table for N/Z flags */
-static uint8 flag_table[256];
-
-/* internal critical CPU vars */
-static uint32 reg_PC;
-static uint8 reg_A, reg_P, reg_X, reg_Y, reg_S;
-static uint8 int_pending;
-static int dma_cycles;
-
-/* execution cycle count (can be reset by user) */
-static uint32 total_cycles = 0;
-
-/* memory region pointers */
-static uint8 *nes6502_banks[NES6502_NUMBANKS];
-static uint8 *ram = NULL;
-static uint8 *stack_page = NULL;
-
-
-/*
-** Zero-page helper macros
-*/
-
-#define ZP_READ(addr) ram[(addr)]
-#define ZP_WRITE(addr, value) ram[(addr)] = (uint8) (value)
-
-
-INLINE uint8 bank_readbyte(register uint32 address)
-{
- ASSERT(nes6502_banks[address >> NES6502_BANKSHIFT]);
- return nes6502_banks[address >> NES6502_BANKSHIFT][address & NES6502_BANKMASK];
-}
-
-INLINE void bank_writebyte(register uint32 address, register uint8 value)
-{
- ASSERT(nes6502_banks[address >> NES6502_BANKSHIFT]);
- nes6502_banks[address >> NES6502_BANKSHIFT][address & NES6502_BANKMASK] = value;
-}
-
-INLINE uint32 zp_address(register uint8 address)
-{
- uint8 *x = ram + address;
- return (x[1] << 8) | x[0];
-}
-
-INLINE uint32 bank_readaddress(register uint32 address)
-{
- uint8 *x = nes6502_banks[address >> NES6502_BANKSHIFT] + (address & NES6502_BANKMASK);
- return (x[1] << 8) | x[0];
-}
-
-/* read a byte of 6502 memory */
-static uint8 mem_read(uint32 address)
-{
- /* TODO: following cases are N2A03-specific */
- /* RAM */
- if (address < 0x800)
- return ram[address];
- /* always paged memory */
-// else if (address >= 0x6000)
- else if (address >= 0x8000)
- return bank_readbyte(address);
- /* check memory range handlers */
- else
- {
- for (pmr = pmem_read; pmr->min_range != 0xFFFFFFFF; pmr++)
- {
- if ((address >= pmr->min_range) && (address <= pmr->max_range))
- return pmr->read_func(address);
- }
- }
-
- /* return paged memory */
- return bank_readbyte(address);
-}
-
-/* write a byte of data to 6502 memory */
-static void mem_write(uint32 address, uint8 value)
-{
- /* RAM */
- if (address < 0x800)
- {
- ram[address] = value;
- return;
- }
- /* check memory range handlers */
- else
- {
- for (pmw = pmem_write; pmw->min_range != 0xFFFFFFFF; pmw++)
- {
- if ((address >= pmw->min_range) && (address <= pmw->max_range))
- {
- pmw->write_func(address, value);
- return;
- }
- }
- }
-
- /* write to paged memory */
- bank_writebyte(address, value);
-}
-
-/* set the current context */
-void nes6502_setcontext(nes6502_context *cpu)
-{
- int loop;
-
- ASSERT(cpu);
-
- /* Set the page pointers */
- for (loop = 0; loop < NES6502_NUMBANKS; loop++)
- nes6502_banks[loop] = cpu->mem_page[loop];
-
- ram = nes6502_banks[0]; /* quicker zero-page/RAM references */
- stack_page = ram + STACK_OFFSET;
-
- pmem_read = cpu->read_handler;
- pmem_write = cpu->write_handler;
-
- reg_PC = cpu->pc_reg;
- reg_A = cpu->a_reg;
- reg_P = cpu->p_reg;
- reg_X = cpu->x_reg;
- reg_Y = cpu->y_reg;
- reg_S = cpu->s_reg;
- int_pending = cpu->int_pending;
- dma_cycles = cpu->dma_cycles;
-}
-
-/* get the current context */
-void nes6502_getcontext(nes6502_context *cpu)
-{
- int loop;
-
- /* Set the page pointers */
- for (loop = 0; loop < NES6502_NUMBANKS; loop++)
- cpu->mem_page[loop] = nes6502_banks[loop];
-
- cpu->read_handler = pmem_read;
- cpu->write_handler = pmem_write;
-
- cpu->pc_reg = reg_PC;
- cpu->a_reg = reg_A;
- cpu->p_reg = reg_P;
- cpu->x_reg = reg_X;
- cpu->y_reg = reg_Y;
- cpu->s_reg = reg_S;
- cpu->int_pending = int_pending;
- cpu->dma_cycles = dma_cycles;
-}
-
-/* DMA a byte of data from ROM */
-uint8 nes6502_getbyte(uint32 address)
-{
- return bank_readbyte(address);
-}
-
-/* get number of elapsed cycles */
-uint32 nes6502_getcycles(boolean reset_flag)
-{
- uint32 cycles = total_cycles;
-
- if (reset_flag)
- total_cycles = 0;
-
- return cycles;
-}
-
-
-/* Execute instructions until count expires
-**
-** Returns the number of cycles *actually* executed
-** (note that this can be from 0-6 cycles more than you wanted)
-*/
-int nes6502_execute(int remaining_cycles)
-{
- int instruction_cycles, old_cycles = total_cycles;
- uint32 temp, addr; /* for macros */
- uint32 PC;
- uint8 A, X, Y, P, S;
- uint8 opcode, data;
- uint8 btemp, baddr; /* for macros */
-
- GET_GLOBAL_REGS();
-
- /* Continue until we run out of cycles */
- while (remaining_cycles > 0)
- {
- instruction_cycles = 0;
-
- /* check for DMA cycle burning */
- if (dma_cycles)
- {
- if (remaining_cycles <= dma_cycles)
- {
- dma_cycles -= remaining_cycles;
- total_cycles += remaining_cycles;
- goto _execute_done;
- }
- else
- {
- remaining_cycles -= dma_cycles;
- total_cycles += dma_cycles;
- dma_cycles = 0;
- }
- }
-
- if (int_pending)
- {
- /* NMI has highest priority */
- if (int_pending & NMI_MASK)
- {
- NMI();
- }
- /* IRQ has lowest priority */
- else /* if (int_pending & IRQ_MASK) */
- {
- if (IS_FLAG_CLEAR(I_FLAG))
- IRQ();
- }
- }
-
- /* Fetch instruction */
- //nes6502_disasm(PC, P, A, X, Y, S);
-
- opcode = bank_readbyte(PC++);
-
- /* Execute instruction */
- switch (opcode)
- {
- case 0x00: /* BRK */
- BRK();
- break;
-
- case 0x01: /* ORA ($nn,X) */
- ORA(6, INDIR_X_BYTE);
- break;
-
- /* JAM */
- case 0x02: /* JAM */
- case 0x12: /* JAM */
- case 0x22: /* JAM */
- case 0x32: /* JAM */
- case 0x42: /* JAM */
- case 0x52: /* JAM */
- case 0x62: /* JAM */
- case 0x72: /* JAM */
- case 0x92: /* JAM */
- case 0xB2: /* JAM */
- case 0xD2: /* JAM */
- case 0xF2: /* JAM */
- JAM();
- /* kill switch for CPU emulation */
- goto _execute_done;
-
- case 0x03: /* SLO ($nn,X) */
- SLO(8, INDIR_X, mem_write, addr);
- break;
-
- case 0x04: /* NOP $nn */
- case 0x44: /* NOP $nn */
- case 0x64: /* NOP $nn */
- DOP(3);
- break;
-
- case 0x05: /* ORA $nn */
- ORA(3, ZERO_PAGE_BYTE);
- break;
-
- case 0x06: /* ASL $nn */
- ASL(5, ZERO_PAGE, ZP_WRITE, baddr);
- break;
-
- case 0x07: /* SLO $nn */
- SLO(5, ZERO_PAGE, ZP_WRITE, baddr);
- break;
-
- case 0x08: /* PHP */
- PHP();
- break;
-
- case 0x09: /* ORA #$nn */
- ORA(2, IMMEDIATE_BYTE);
- break;
-
- case 0x0A: /* ASL A */
- ASL_A();
- break;
-
- case 0x0B: /* ANC #$nn */
- ANC(2, IMMEDIATE_BYTE);
- break;
-
- case 0x0C: /* NOP $nnnn */
- TOP();
- break;
-
- case 0x0D: /* ORA $nnnn */
- ORA(4, ABSOLUTE_BYTE);
- break;
-
- case 0x0E: /* ASL $nnnn */
- ASL(6, ABSOLUTE, mem_write, addr);
- break;
-
- case 0x0F: /* SLO $nnnn */
- SLO(6, ABSOLUTE, mem_write, addr);
- break;
-
- case 0x10: /* BPL $nnnn */
- BPL();
- break;
-
- case 0x11: /* ORA ($nn),Y */
- ORA(5, INDIR_Y_BYTE);
- break;
-
- case 0x13: /* SLO ($nn),Y */
- SLO(8, INDIR_Y, mem_write, addr);
- break;
-
- case 0x14: /* NOP $nn,X */
- case 0x34: /* NOP */
- case 0x54: /* NOP $nn,X */
- case 0x74: /* NOP $nn,X */
- case 0xD4: /* NOP $nn,X */
- case 0xF4: /* NOP ($nn,X) */
- DOP(4);
- break;
-
- case 0x15: /* ORA $nn,X */
- ORA(4, ZP_IND_X_BYTE);
- break;
-
- case 0x16: /* ASL $nn,X */
- ASL(6, ZP_IND_X, ZP_WRITE, baddr);
- break;
-
- case 0x17: /* SLO $nn,X */
- SLO(6, ZP_IND_X, ZP_WRITE, baddr);
- break;
-
- case 0x18: /* CLC */
- CLC();
- break;
-
- case 0x19: /* ORA $nnnn,Y */
- ORA(4, ABS_IND_Y_BYTE);
- break;
-
- case 0x1A: /* NOP */
- case 0x3A: /* NOP */
- case 0x5A: /* NOP */
- case 0x7A: /* NOP */
- case 0xDA: /* NOP */
- case 0xFA: /* NOP */
- NOP();
- break;
-
- case 0x1B: /* SLO $nnnn,Y */
- SLO(7, ABS_IND_Y, mem_write, addr);
- break;
-
- case 0x1C: /* NOP $nnnn,X */
- case 0x3C: /* NOP $nnnn,X */
- case 0x5C: /* NOP $nnnn,X */
- case 0x7C: /* NOP $nnnn,X */
- case 0xDC: /* NOP $nnnn,X */
- case 0xFC: /* NOP $nnnn,X */
- TOP();
- break;
-
- case 0x1D: /* ORA $nnnn,X */
- ORA(4, ABS_IND_X_BYTE);
- break;
-
- case 0x1E: /* ASL $nnnn,X */
- ASL(7, ABS_IND_X, mem_write, addr);
- break;
-
- case 0x1F: /* SLO $nnnn,X */
- SLO(7, ABS_IND_X, mem_write, addr);
- break;
-
- case 0x20: /* JSR $nnnn */
- JSR();
- break;
-
- case 0x21: /* AND ($nn,X) */
- AND(6, INDIR_X_BYTE);
- break;
-
- case 0x23: /* RLA ($nn,X) */
- RLA(8, INDIR_X, mem_write, addr);
- break;
-
- case 0x24: /* BIT $nn */
- BIT(3, ZERO_PAGE_BYTE);
- break;
-
- case 0x25: /* AND $nn */
- AND(3, ZERO_PAGE_BYTE);
- break;
-
- case 0x26: /* ROL $nn */
- ROL(5, ZERO_PAGE, ZP_WRITE, baddr);
- break;
-
- case 0x27: /* RLA $nn */
- RLA(5, ZERO_PAGE, ZP_WRITE, baddr);
- break;
-
- case 0x28: /* PLP */
- PLP();
- break;
-
- case 0x29: /* AND #$nn */
- AND(2, IMMEDIATE_BYTE);
- break;
-
- case 0x2A: /* ROL A */
- ROL_A();
- break;
-
- case 0x2B: /* ANC #$nn */
- ANC(2, IMMEDIATE_BYTE);
- break;
-
- case 0x2C: /* BIT $nnnn */
- BIT(4, ABSOLUTE_BYTE);
- break;
-
- case 0x2D: /* AND $nnnn */
- AND(4, ABSOLUTE_BYTE);
- break;
-
- case 0x2E: /* ROL $nnnn */
- ROL(6, ABSOLUTE, mem_write, addr);
- break;
-
- case 0x2F: /* RLA $nnnn */
- RLA(6, ABSOLUTE, mem_write, addr);
- break;
-
- case 0x30: /* BMI $nnnn */
- BMI();
- break;
-
- case 0x31: /* AND ($nn),Y */
- AND(5, INDIR_Y_BYTE);
- break;
-
- case 0x33: /* RLA ($nn),Y */
- RLA(8, INDIR_Y, mem_write, addr);
- break;
-
- case 0x35: /* AND $nn,X */
- AND(4, ZP_IND_X_BYTE);
- break;
-
- case 0x36: /* ROL $nn,X */
- ROL(6, ZP_IND_X, ZP_WRITE, baddr);
- break;
-
- case 0x37: /* RLA $nn,X */
- RLA(6, ZP_IND_X, ZP_WRITE, baddr);
- break;
-
- case 0x38: /* SEC */
- SEC();
- break;
-
- case 0x39: /* AND $nnnn,Y */
- AND(4, ABS_IND_Y_BYTE);
- break;
-
- case 0x3B: /* RLA $nnnn,Y */
- RLA(7, ABS_IND_Y, mem_write, addr);
- break;
-
- case 0x3D: /* AND $nnnn,X */
- AND(4, ABS_IND_X_BYTE);
- break;
-
- case 0x3E: /* ROL $nnnn,X */
- ROL(7, ABS_IND_X, mem_write, addr);
- break;
-
- case 0x3F: /* RLA $nnnn,X */
- RLA(7, ABS_IND_X, mem_write, addr);
- break;
-
- case 0x40: /* RTI */
- RTI();
- break;
-
- case 0x41: /* EOR ($nn,X) */
- EOR(6, INDIR_X_BYTE);
- break;
-
- case 0x43: /* SRE ($nn,X) */
- SRE(8, INDIR_X, mem_write, addr);
- break;
-
- case 0x45: /* EOR $nn */
- EOR(3, ZERO_PAGE_BYTE);
- break;
-
- case 0x46: /* LSR $nn */
- LSR(5, ZERO_PAGE, ZP_WRITE, baddr);
- break;
-
- case 0x47: /* SRE $nn */
- SRE(5, ZERO_PAGE, ZP_WRITE, baddr);
- break;
-
- case 0x48: /* PHA */
- PHA();
- break;
-
- case 0x49: /* EOR #$nn */
- EOR(2, IMMEDIATE_BYTE);
- break;
-
- case 0x4A: /* LSR A */
- LSR_A();
- break;
-
- case 0x4B: /* ASR #$nn */
- ASR(2, IMMEDIATE_BYTE);
- break;
-
- case 0x4C: /* JMP $nnnn */
- JMP_ABSOLUTE();
- break;
-
- case 0x4D: /* EOR $nnnn */
- EOR(4, ABSOLUTE_BYTE);
- break;
-
- case 0x4E: /* LSR $nnnn */
- LSR(6, ABSOLUTE, mem_write, addr);
- break;
-
- case 0x4F: /* SRE $nnnn */
- SRE(6, ABSOLUTE, mem_write, addr);
- break;
-
- case 0x50: /* BVC $nnnn */
- BVC();
- break;
-
- case 0x51: /* EOR ($nn),Y */
- EOR(5, INDIR_Y_BYTE);
- break;
-
- case 0x53: /* SRE ($nn),Y */
- SRE(8, INDIR_Y, mem_write, addr);
- break;
-
- case 0x55: /* EOR $nn,X */
- EOR(4, ZP_IND_X_BYTE);
- break;
-
- case 0x56: /* LSR $nn,X */
- LSR(6, ZP_IND_X, ZP_WRITE, baddr);
- break;
-
- case 0x57: /* SRE $nn,X */
- SRE(6, ZP_IND_X, ZP_WRITE, baddr);
- break;
-
- case 0x58: /* CLI */
- CLI();
- break;
-
- case 0x59: /* EOR $nnnn,Y */
- EOR(4, ABS_IND_Y_BYTE);
- break;
-
- case 0x5B: /* SRE $nnnn,Y */
- SRE(7, ABS_IND_Y, mem_write, addr);
- break;
-
- case 0x5D: /* EOR $nnnn,X */
- EOR(4, ABS_IND_X_BYTE);
- break;
-
- case 0x5E: /* LSR $nnnn,X */
- LSR(7, ABS_IND_X, mem_write, addr);
- break;
-
- case 0x5F: /* SRE $nnnn,X */
- SRE(7, ABS_IND_X, mem_write, addr);
- break;
-
- case 0x60: /* RTS */
- RTS();
- break;
-
- case 0x61: /* ADC ($nn,X) */
- ADC(6, INDIR_X_BYTE);
- break;
-
- case 0x63: /* RRA ($nn,X) */
- RRA(8, INDIR_X, mem_write, addr);
- break;
-
- case 0x65: /* ADC $nn */
- ADC(3, ZERO_PAGE_BYTE);
- break;
-
- case 0x66: /* ROR $nn */
- ROR(5, ZERO_PAGE, ZP_WRITE, baddr);
- break;
-
- case 0x67: /* RRA $nn */
- RRA(5, ZERO_PAGE, ZP_WRITE, baddr);
- break;
-
- case 0x68: /* PLA */
- PLA();
- break;
-
- case 0x69: /* ADC #$nn */
- ADC(2, IMMEDIATE_BYTE);
- break;
-
- case 0x6A: /* ROR A */
- ROR_A();
- break;
-
- case 0x6B: /* ARR #$nn */
- ARR(2, IMMEDIATE_BYTE);
- break;
-
- case 0x6C: /* JMP ($nnnn) */
- JMP_INDIRECT();
- break;
-
- case 0x6D: /* ADC $nnnn */
- ADC(4, ABSOLUTE_BYTE);
- break;
-
- case 0x6E: /* ROR $nnnn */
- ROR(6, ABSOLUTE, mem_write, addr);
- break;
-
- case 0x6F: /* RRA $nnnn */
- RRA(6, ABSOLUTE, mem_write, addr);
- break;
-
- case 0x70: /* BVS $nnnn */
- BVS();
- break;
-
- case 0x71: /* ADC ($nn),Y */
- ADC(5, INDIR_Y_BYTE);
- break;
-
- case 0x73: /* RRA ($nn),Y */
- RRA(8, INDIR_Y, mem_write, addr);
- break;
-
- case 0x75: /* ADC $nn,X */
- ADC(4, ZP_IND_X_BYTE);
- break;
-
- case 0x76: /* ROR $nn,X */
- ROR(6, ZP_IND_X, ZP_WRITE, baddr);
- break;
-
- case 0x77: /* RRA $nn,X */
- RRA(6, ZP_IND_X, ZP_WRITE, baddr);
- break;
-
- case 0x78: /* SEI */
- SEI();
- break;
-
- case 0x79: /* ADC $nnnn,Y */
- ADC(4, ABS_IND_Y_BYTE);
- break;
-
- case 0x7B: /* RRA $nnnn,Y */
- RRA(7, ABS_IND_Y, mem_write, addr);
- break;
-
- case 0x7D: /* ADC $nnnn,X */
- ADC(4, ABS_IND_X_BYTE);
- break;
-
- case 0x7E: /* ROR $nnnn,X */
- ROR(7, ABS_IND_X, mem_write, addr);
- break;
-
- case 0x7F: /* RRA $nnnn,X */
- RRA(7, ABS_IND_X, mem_write, addr);
- break;
-
- case 0x80: /* NOP #$nn */
- case 0x82: /* NOP #$nn */
- case 0x89: /* NOP #$nn */
- case 0xC2: /* NOP #$nn */
- case 0xE2: /* NOP #$nn */
- DOP(2);
- break;
-
- case 0x81: /* STA ($nn,X) */
- STA(6, INDIR_X_ADDR, mem_write, addr);
- break;
-
- case 0x83: /* SAX ($nn,X) */
- SAX(6, INDIR_X_ADDR, mem_write, addr);
- break;
-
- case 0x84: /* STY $nn */
- STY(3, ZERO_PAGE_ADDR, ZP_WRITE, baddr);
- break;
-
- case 0x85: /* STA $nn */
- STA(3, ZERO_PAGE_ADDR, ZP_WRITE, baddr);
- break;
-
- case 0x86: /* STX $nn */
- STX(3, ZERO_PAGE_ADDR, ZP_WRITE, baddr);
- break;
-
- case 0x87: /* SAX $nn */
- SAX(3, ZERO_PAGE_ADDR, ZP_WRITE, baddr);
- break;
-
- case 0x88: /* DEY */
- DEY();
- break;
-
- case 0x8A: /* TXA */
- TXA();
- break;
-
- case 0x8B: /* ANE #$nn */
- ANE(2, IMMEDIATE_BYTE);
- break;
-
- case 0x8C: /* STY $nnnn */
- STY(4, ABSOLUTE_ADDR, mem_write, addr);
- break;
-
- case 0x8D: /* STA $nnnn */
- STA(4, ABSOLUTE_ADDR, mem_write, addr);
- break;
-
- case 0x8E: /* STX $nnnn */
- STX(4, ABSOLUTE_ADDR, mem_write, addr);
- break;
-
- case 0x8F: /* SAX $nnnn */
- SAX(4, ABSOLUTE_ADDR, mem_write, addr);
- break;
-
- case 0x90: /* BCC $nnnn */
- BCC();
- break;
-
- case 0x91: /* STA ($nn),Y */
- STA(6, INDIR_Y_ADDR, mem_write, addr);
- break;
-
- case 0x93: /* SHA ($nn),Y */
- SHA(6, INDIR_Y_ADDR, mem_write, addr);
- break;
-
- case 0x94: /* STY $nn,X */
- STY(4, ZP_IND_X_ADDR, ZP_WRITE, baddr);
- break;
-
- case 0x95: /* STA $nn,X */
- STA(4, ZP_IND_X_ADDR, ZP_WRITE, baddr);
- break;
-
- case 0x96: /* STX $nn,Y */
- STX(4, ZP_IND_Y_ADDR, ZP_WRITE, baddr);
- break;
-
- case 0x97: /* SAX $nn,Y */
- SAX(4, ZP_IND_Y_ADDR, ZP_WRITE, baddr);
- break;
-
- case 0x98: /* TYA */
- TYA();
- break;
-
- case 0x99: /* STA $nnnn,Y */
- STA(5, ABS_IND_Y_ADDR, mem_write, addr);
- break;
-
- case 0x9A: /* TXS */
- TXS();
- break;
-
- case 0x9B: /* SHS $nnnn,Y */
- SHS(5, ABS_IND_Y_ADDR, mem_write, addr);
- break;
-
- case 0x9C: /* SHY $nnnn,X */
- SHY(5, ABS_IND_X_ADDR, mem_write, addr);
- break;
-
- case 0x9D: /* STA $nnnn,X */
- STA(5, ABS_IND_X_ADDR, mem_write, addr);
- break;
-
- case 0x9E: /* SHX $nnnn,Y */
- SHX(5, ABS_IND_Y_ADDR, mem_write, addr);
- break;
-
- case 0x9F: /* SHA $nnnn,Y */
- SHA(5, ABS_IND_Y_ADDR, mem_write, addr);
- break;
-
- case 0xA0: /* LDY #$nn */
- LDY(2, IMMEDIATE_BYTE);
- break;
-
- case 0xA1: /* LDA ($nn,X) */
- LDA(6, INDIR_X_BYTE);
- break;
-
- case 0xA2: /* LDX #$nn */
- LDX(2, IMMEDIATE_BYTE);
- break;
-
- case 0xA3: /* LAX ($nn,X) */
- LAX(6, INDIR_X_BYTE);
- break;
-
- case 0xA4: /* LDY $nn */
- LDY(3, ZERO_PAGE_BYTE);
- break;
-
- case 0xA5: /* LDA $nn */
- LDA(3, ZERO_PAGE_BYTE);
- break;
-
- case 0xA6: /* LDX $nn */
- LDX(3, ZERO_PAGE_BYTE);
- break;
-
- case 0xA7: /* LAX $nn */
- LAX(3, ZERO_PAGE_BYTE);
- break;
-
- case 0xA8: /* TAY */
- TAY();
- break;
-
- case 0xA9: /* LDA #$nn */
- LDA(2, IMMEDIATE_BYTE);
- break;
-
- case 0xAA: /* TAX */
- TAX();
- break;
-
- case 0xAB: /* LXA #$nn */
- LXA(2, IMMEDIATE_BYTE);
- break;
-
- case 0xAC: /* LDY $nnnn */
- LDY(4, ABSOLUTE_BYTE);
- break;
-
- case 0xAD: /* LDA $nnnn */
- LDA(4, ABSOLUTE_BYTE);
- break;
-
- case 0xAE: /* LDX $nnnn */
- LDX(4, ABSOLUTE_BYTE);
- break;
-
- case 0xAF: /* LAX $nnnn */
- LAX(4, ABSOLUTE_BYTE);
- break;
-
- case 0xB0: /* BCS $nnnn */
- BCS();
- break;
-
- case 0xB1: /* LDA ($nn),Y */
- LDA(5, INDIR_Y_BYTE);
- break;
-
- case 0xB3: /* LAX ($nn),Y */
- LAX(5, INDIR_Y_BYTE);
- break;
-
- case 0xB4: /* LDY $nn,X */
- LDY(4, ZP_IND_X_BYTE);
- break;
-
- case 0xB5: /* LDA $nn,X */
- LDA(4, ZP_IND_X_BYTE);
- break;
-
- case 0xB6: /* LDX $nn,Y */
- LDX(4, ZP_IND_Y_BYTE);
- break;
-
- case 0xB7: /* LAX $nn,Y */
- LAX(4, ZP_IND_Y_BYTE);
- break;
-
- case 0xB8: /* CLV */
- CLV();
- break;
-
- case 0xB9: /* LDA $nnnn,Y */
- LDA(4, ABS_IND_Y_BYTE);
- break;
-
- case 0xBA: /* TSX */
- TSX();
- break;
-
- case 0xBB: /* LAS $nnnn,Y */
- LAS(4, ABS_IND_Y_BYTE);
- break;
-
- case 0xBC: /* LDY $nnnn,X */
- LDY(4, ABS_IND_X_BYTE);
- break;
-
- case 0xBD: /* LDA $nnnn,X */
- LDA(4, ABS_IND_X_BYTE);
- break;
-
- case 0xBE: /* LDX $nnnn,Y */
- LDX(4, ABS_IND_Y_BYTE);
- break;
-
- case 0xBF: /* LAX $nnnn,Y */
- LAX(4, ABS_IND_Y_BYTE);
- break;
-
- case 0xC0: /* CPY #$nn */
- CPY(2, IMMEDIATE_BYTE);
- break;
-
- case 0xC1: /* CMP ($nn,X) */
- CMP(6, INDIR_X_BYTE);
- break;
-
- case 0xC3: /* DCP ($nn,X) */
- DCP(8, INDIR_X, mem_write, addr);
- break;
-
- case 0xC4: /* CPY $nn */
- CPY(3, ZERO_PAGE_BYTE);
- break;
-
- case 0xC5: /* CMP $nn */
- CMP(3, ZERO_PAGE_BYTE);
- break;
-
- case 0xC6: /* DEC $nn */
- DEC(5, ZERO_PAGE, ZP_WRITE, baddr);
- break;
-
- case 0xC7: /* DCP $nn */
- DCP(5, ZERO_PAGE, ZP_WRITE, baddr);
- break;
-
- case 0xC8: /* INY */
- INY();
- break;
-
- case 0xC9: /* CMP #$nn */
- CMP(2, IMMEDIATE_BYTE);
- break;
-
- case 0xCA: /* DEX */
- DEX();
- break;
-
- case 0xCB: /* SBX #$nn */
- SBX(2, IMMEDIATE_BYTE);
- break;
-
- case 0xCC: /* CPY $nnnn */
- CPY(4, ABSOLUTE_BYTE);
- break;
-
- case 0xCD: /* CMP $nnnn */
- CMP(4, ABSOLUTE_BYTE);
- break;
-
- case 0xCE: /* DEC $nnnn */
- DEC(6, ABSOLUTE, mem_write, addr);
- break;
-
- case 0xCF: /* DCP $nnnn */
- DCP(6, ABSOLUTE, mem_write, addr);
- break;
-
- case 0xD0: /* BNE $nnnn */
- BNE();
- break;
-
- case 0xD1: /* CMP ($nn),Y */
- CMP(5, INDIR_Y_BYTE);
- break;
-
- case 0xD3: /* DCP ($nn),Y */
- DCP(8, INDIR_Y, mem_write, addr);
- break;
-
- case 0xD5: /* CMP $nn,X */
- CMP(4, ZP_IND_X_BYTE);
- break;
-
- case 0xD6: /* DEC $nn,X */
- DEC(6, ZP_IND_X, ZP_WRITE, baddr);
- break;
-
- case 0xD7: /* DCP $nn,X */
- DCP(6, ZP_IND_X, ZP_WRITE, baddr);
- break;
-
- case 0xD8: /* CLD */
- CLD();
- break;
-
- case 0xD9: /* CMP $nnnn,Y */
- CMP(4, ABS_IND_Y_BYTE);
- break;
-
- case 0xDB: /* DCP $nnnn,Y */
- DCP(7, ABS_IND_Y, mem_write, addr);
- break;
-
- case 0xDD: /* CMP $nnnn,X */
- CMP(4, ABS_IND_X_BYTE);
- break;
-
- case 0xDE: /* DEC $nnnn,X */
- DEC(7, ABS_IND_X, mem_write, addr);
- break;
-
- case 0xDF: /* DCP $nnnn,X */
- DCP(7, ABS_IND_X, mem_write, addr);
- break;
-
- case 0xE0: /* CPX #$nn */
- CPX(2, IMMEDIATE_BYTE);
- break;
-
- case 0xE1: /* SBC ($nn,X) */
- SBC(6, INDIR_X_BYTE);
- break;
-
- case 0xE3: /* ISB ($nn,X) */
- ISB(8, INDIR_X, mem_write, addr);
- break;
-
- case 0xE4: /* CPX $nn */
- CPX(3, ZERO_PAGE_BYTE);
- break;
-
- case 0xE5: /* SBC $nn */
- SBC(3, ZERO_PAGE_BYTE);
- break;
-
- case 0xE6: /* INC $nn */
- INC(5, ZERO_PAGE, ZP_WRITE, baddr);
- break;
-
- case 0xE7: /* ISB $nn */
- ISB(5, ZERO_PAGE, ZP_WRITE, baddr);
- break;
-
- case 0xE8: /* INX */
- INX();
- break;
-
- case 0xE9: /* SBC #$nn */
- case 0xEB: /* USBC #$nn */
- SBC(2, IMMEDIATE_BYTE);
- break;
-
- case 0xEA: /* NOP */
- NOP();
- break;
-
- case 0xEC: /* CPX $nnnn */
- CPX(4, ABSOLUTE_BYTE);
- break;
-
- case 0xED: /* SBC $nnnn */
- SBC(4, ABSOLUTE_BYTE);
- break;
-
- case 0xEE: /* INC $nnnn */
- INC(6, ABSOLUTE, mem_write, addr);
- break;
-
- case 0xEF: /* ISB $nnnn */
- ISB(6, ABSOLUTE, mem_write, addr);
- break;
-
- case 0xF0: /* BEQ $nnnn */
- BEQ();
- break;
-
- case 0xF1: /* SBC ($nn),Y */
- SBC(5, INDIR_Y_BYTE);
- break;
-
- case 0xF3: /* ISB ($nn),Y */
- ISB(8, INDIR_Y, mem_write, addr);
- break;
-
- case 0xF5: /* SBC $nn,X */
- SBC(4, ZP_IND_X_BYTE);
- break;
-
- case 0xF6: /* INC $nn,X */
- INC(6, ZP_IND_X, ZP_WRITE, baddr);
- break;
-
- case 0xF7: /* ISB $nn,X */
- ISB(6, ZP_IND_X, ZP_WRITE, baddr);
- break;
-
- case 0xF8: /* SED */
- SED();
- break;
-
- case 0xF9: /* SBC $nnnn,Y */
- SBC(4, ABS_IND_Y_BYTE);
- break;
-
- case 0xFB: /* ISB $nnnn,Y */
- ISB(7, ABS_IND_Y, mem_write, addr);
- break;
-
- case 0xFD: /* SBC $nnnn,X */
- SBC(4, ABS_IND_X_BYTE);
- break;
-
- case 0xFE: /* INC $nnnn,X */
- INC(7, ABS_IND_X, mem_write, addr);
- break;
-
- case 0xFF: /* ISB $nnnn,X */
- ISB(7, ABS_IND_X, mem_write, addr);
- break;
- }
-
- /* Calculate remaining/elapsed clock cycles */
- remaining_cycles -= instruction_cycles;
- total_cycles += instruction_cycles;
- }
-
-_execute_done:
-
- /* restore local copy of regs */
- SET_LOCAL_REGS();
-
- /* Return our actual amount of executed cycles */
- return (total_cycles - old_cycles);
-}
-
-/* Initialize tables, etc. */
-void nes6502_init(void)
-{
- int index;
-
- /* Build the N / Z flag lookup table */
- flag_table[0] = Z_FLAG;
-
- for (index = 1; index < 256; index++)
- flag_table[index] = (index & 0x80) ? N_FLAG : 0;
-
- reg_A = reg_X = reg_Y = 0;
- reg_S = 0xFF; /* Stack grows down */
-}
-
-
-/* Issue a CPU Reset */
-void nes6502_reset(void)
-{
- reg_P = Z_FLAG | R_FLAG | I_FLAG; /* Reserved bit always 1 */
- int_pending = dma_cycles = 0; /* No pending interrupts */
- reg_PC = bank_readaddress(RESET_VECTOR); /* Fetch reset vector */
- /* TODO: 6 cycles for RESET? */
-}
-
-/* Non-maskable interrupt */
-void nes6502_nmi(void)
-{
- int_pending |= NMI_MASK;
-}
-
-/* Interrupt request */
-void nes6502_irq(void)
-{
- int_pending |= IRQ_MASK;
-}
-
-/* Set dma period (in cycles) */
-void nes6502_setdma(int cycles)
-{
- dma_cycles += cycles;
-}
-
-/*
-** $Log: nes6502.c,v $
-** Revision 1.2 2003/01/09 19:50:03 jkeil
-** NSF audio files were crashing on SPARC.
-**
-** - Define the correct HOST_ENDIAN for SPARC
-** - remove unaligned memory accesses
-**
-** Revision 1.1 2003/01/08 07:04:35 tmmm
-** initial import of Nosefart sources
-**
-** Revision 1.6 2000/07/04 04:50:07 matt
-** minor change to includes
-**
-** Revision 1.5 2000/07/03 02:18:16 matt
-** added a few notes about potential failure cases
-**
-** Revision 1.4 2000/06/09 15:12:25 matt
-** initial revision
-**
-*/
diff --git a/src/libxineadec/nosefart/nes6502.h b/src/libxineadec/nosefart/nes6502.h
deleted file mode 100644
index 9b9be5811..000000000
--- a/src/libxineadec/nosefart/nes6502.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
-** Nofrendo (c) 1998-2000 Matthew Conte (matt@conte.com)
-**
-**
-** This program is free software; you can redistribute it and/or
-** modify it under the terms of version 2 of the GNU Library General
-** Public License as published by the Free Software Foundation.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-** Library General Public License for more details. To obtain a
-** copy of the GNU Library General Public License, write to the Free
-** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-**
-** Any permitted reproduction of these routines, in whole or in part,
-** must bear this legend.
-**
-**
-** nes6502.h
-**
-** NES custom 6502 CPU definitions / prototypes
-** $Id: nes6502.h,v 1.2 2003/12/05 15:55:01 f1rmb Exp $
-*/
-
-/* NOTE: 16-bit addresses avoided like the plague: use 32-bit values
-** wherever humanly possible
-*/
-#ifndef _NES6502_H_
-#define _NES6502_H_
-
-/* Define this to enable decimal mode in ADC / SBC (not needed in NES) */
-/*#define NES6502_DECIMAL*/
-
-/* number of bank pointers the CPU emulation core handles */
-#ifdef NSF_PLAYER
-#define NES6502_4KBANKS
-#endif
-
-#ifdef NES6502_4KBANKS
-#define NES6502_NUMBANKS 16
-#define NES6502_BANKSHIFT 12
-#else
-#define NES6502_NUMBANKS 8
-#define NES6502_BANKSHIFT 13
-#endif
-
-#define NES6502_BANKMASK ((0x10000 / NES6502_NUMBANKS) - 1)
-
-
-/* P (flag) register bitmasks */
-#define N_FLAG 0x80
-#define V_FLAG 0x40
-#define R_FLAG 0x20 /* Reserved, always 1 */
-#define B_FLAG 0x10
-#define D_FLAG 0x08
-#define I_FLAG 0x04
-#define Z_FLAG 0x02
-#define C_FLAG 0x01
-
-/* Vector addresses */
-#define NMI_VECTOR 0xFFFA
-#define RESET_VECTOR 0xFFFC
-#define IRQ_VECTOR 0xFFFE
-
-/* cycle counts for interrupts */
-#define INT_CYCLES 7
-#define RESET_CYCLES 6
-
-#define NMI_MASK 0x01
-#define IRQ_MASK 0x02
-
-/* Stack is located on 6502 page 1 */
-#define STACK_OFFSET 0x0100
-
-typedef struct
-{
- uint32 min_range, max_range;
- uint8 (*read_func)(uint32 address);
-} nes6502_memread;
-
-typedef struct
-{
- uint32 min_range, max_range;
- void (*write_func)(uint32 address, uint8 value);
-} nes6502_memwrite;
-
-typedef struct
-{
- uint8 *mem_page[NES6502_NUMBANKS]; /* memory page pointers */
- nes6502_memread *read_handler;
- nes6502_memwrite *write_handler;
- int dma_cycles;
- uint32 pc_reg;
- uint8 a_reg, p_reg, x_reg, y_reg, s_reg;
- uint8 int_pending;
-} nes6502_context;
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/* Functions which govern the 6502's execution */
-extern void nes6502_init(void);
-extern void nes6502_reset(void);
-extern int nes6502_execute(int total_cycles);
-extern void nes6502_nmi(void);
-extern void nes6502_irq(void);
-extern uint8 nes6502_getbyte(uint32 address);
-extern uint32 nes6502_getcycles(boolean reset_flag);
-extern void nes6502_setdma(int cycles);
-
-/* Context get/set */
-extern void nes6502_setcontext(nes6502_context *cpu);
-extern void nes6502_getcontext(nes6502_context *cpu);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _NES6502_H_ */
-
-/*
-** $Log: nes6502.h,v $
-** Revision 1.2 2003/12/05 15:55:01 f1rmb
-** cleanup phase II. use xprintf when it's relevant, use xine_xmalloc when it's relevant too. Small other little fix (can't remember). Change few internal function prototype because it xine_t pointer need to be used if some xine's internal sections. NOTE: libdvd{nav,read} is still too noisy, i will take a look to made it quit, without invasive changes. To be continued...
-**
-** Revision 1.1 2003/01/08 07:04:35 tmmm
-** initial import of Nosefart sources
-**
-** Revision 1.4 2000/06/09 15:12:25 matt
-** initial revision
-**
-*/
diff --git a/src/libxineadec/nosefart/nes_apu.c b/src/libxineadec/nosefart/nes_apu.c
deleted file mode 100644
index 4a2ed8f4d..000000000
--- a/src/libxineadec/nosefart/nes_apu.c
+++ /dev/null
@@ -1,1212 +0,0 @@
-/*
-** Nofrendo (c) 1998-2000 Matthew Conte (matt@conte.com)
-**
-**
-** This program is free software; you can redistribute it and/or
-** modify it under the terms of version 2 of the GNU Library General
-** Public License as published by the Free Software Foundation.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-** Library General Public License for more details. To obtain a
-** copy of the GNU Library General Public License, write to the Free
-** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-**
-** Any permitted reproduction of these routines, in whole or in part,
-** must bear this legend.
-**
-**
-** nes_apu.c
-**
-** NES APU emulation
-** $Id: nes_apu.c,v 1.4 2005/05/07 09:11:39 valtri Exp $
-*/
-
-#include <string.h>
-#include "types.h"
-#include "log.h"
-#include "nes_apu.h"
-#include "nes6502.h"
-
-#ifdef NSF_PLAYER
-#include "nsf.h"
-#else
-#include "nes.h"
-#include "nes_ppu.h"
-#include "nes_mmc.h"
-#include "nesinput.h"
-#endif /* !NSF_PLAYER */
-
-
-#define APU_OVERSAMPLE
-#define APU_VOLUME_DECAY(x) ((x) -= ((x) >> 7))
-
-
-/* pointer to active APU */
-static apu_t *apu;
-
-/* look up table madness */
-static int32 decay_lut[16];
-static int vbl_lut[32];
-static int trilength_lut[128];
-
-/* noise lookups for both modes */
-#ifndef REALTIME_NOISE
-static int8 noise_long_lut[APU_NOISE_32K];
-static int8 noise_short_lut[APU_NOISE_93];
-#endif /* !REALTIME_NOISE */
-
-
-/* vblank length table used for rectangles, triangle, noise */
-static const uint8 vbl_length[32] =
-{
- 5, 127,
- 10, 1,
- 19, 2,
- 40, 3,
- 80, 4,
- 30, 5,
- 7, 6,
- 13, 7,
- 6, 8,
- 12, 9,
- 24, 10,
- 48, 11,
- 96, 12,
- 36, 13,
- 8, 14,
- 16, 15
-};
-
-/* frequency limit of rectangle channels */
-static const int freq_limit[8] =
-{
- 0x3FF, 0x555, 0x666, 0x71C, 0x787, 0x7C1, 0x7E0, 0x7F0
-};
-
-/* noise frequency lookup table */
-static const int noise_freq[16] =
-{
- 4, 8, 16, 32, 64, 96, 128, 160,
- 202, 254, 380, 508, 762, 1016, 2034, 4068
-};
-
-/* DMC transfer freqs */
-const int dmc_clocks[16] =
-{
- 428, 380, 340, 320, 286, 254, 226, 214,
- 190, 160, 142, 128, 106, 85, 72, 54
-};
-
-/* ratios of pos/neg pulse for rectangle waves */
-static const int duty_lut[4] = { 2, 4, 8, 12 };
-
-#if 0 /* unused */
-static void apu_setcontext(apu_t *src_apu)
-{
- apu = src_apu;
-}
-#endif
-
-/*
-** Simple queue routines
-*/
-#define APU_QEMPTY() (apu->q_head == apu->q_tail)
-
-static void apu_enqueue(apudata_t *d)
-{
- ASSERT(apu);
- apu->queue[apu->q_head] = *d;
-
- apu->q_head = (apu->q_head + 1) & APUQUEUE_MASK;
-
- if (APU_QEMPTY())
- log_printf("apu: queue overflow\n");
-}
-
-static apudata_t *apu_dequeue(void)
-{
- int loc;
-
- ASSERT(apu);
-
- if (APU_QEMPTY())
- log_printf("apu: queue empty\n");
-
- loc = apu->q_tail;
- apu->q_tail = (apu->q_tail + 1) & APUQUEUE_MASK;
-
- return &apu->queue[loc];
-}
-
-void apu_setchan(int chan, boolean enabled)
-{
- ASSERT(apu);
- apu->mix_enable[chan] = enabled;
-}
-
-/* emulation of the 15-bit shift register the
-** NES uses to generate pseudo-random series
-** for the white noise channel
-*/
-#ifdef REALTIME_NOISE
-INLINE int8 shift_register15(uint8 xor_tap)
-{
- static int sreg = 0x4000;
- int bit0, tap, bit14;
-
- bit0 = sreg & 1;
- tap = (sreg & xor_tap) ? 1 : 0;
- bit14 = (bit0 ^ tap);
- sreg >>= 1;
- sreg |= (bit14 << 14);
- return (bit0 ^ 1);
-}
-#else
-static void shift_register15(int8 *buf, int count)
-{
- static int sreg = 0x4000;
- int bit0, bit1, bit6, bit14;
-
- if (count == APU_NOISE_93)
- {
- while (count--)
- {
- bit0 = sreg & 1;
- bit6 = (sreg & 0x40) >> 6;
- bit14 = (bit0 ^ bit6);
- sreg >>= 1;
- sreg |= (bit14 << 14);
- *buf++ = bit0 ^ 1;
- }
- }
- else /* 32K noise */
- {
- while (count--)
- {
- bit0 = sreg & 1;
- bit1 = (sreg & 2) >> 1;
- bit14 = (bit0 ^ bit1);
- sreg >>= 1;
- sreg |= (bit14 << 14);
- *buf++ = bit0 ^ 1;
- }
- }
-}
-#endif
-
-/* RECTANGLE WAVE
-** ==============
-** reg0: 0-3=volume, 4=envelope, 5=hold, 6-7=duty cycle
-** reg1: 0-2=sweep shifts, 3=sweep inc/dec, 4-6=sweep length, 7=sweep on
-** reg2: 8 bits of freq
-** reg3: 0-2=high freq, 7-4=vbl length counter
-*/
-#define APU_RECTANGLE_OUTPUT chan->output_vol
-static int32 apu_rectangle(rectangle_t *chan)
-{
- int32 output;
-
-#ifdef APU_OVERSAMPLE
- int num_times;
- int32 total;
-#endif
-
- APU_VOLUME_DECAY(chan->output_vol);
-
- if (FALSE == chan->enabled || 0 == chan->vbl_length)
- return APU_RECTANGLE_OUTPUT;
-
- /* vbl length counter */
- if (FALSE == chan->holdnote)
- chan->vbl_length--;
-
- /* envelope decay at a rate of (env_delay + 1) / 240 secs */
- chan->env_phase -= 4; /* 240/60 */
- while (chan->env_phase < 0)
- {
- chan->env_phase += chan->env_delay;
-
- if (chan->holdnote)
- chan->env_vol = (chan->env_vol + 1) & 0x0F;
- else if (chan->env_vol < 0x0F)
- chan->env_vol++;
- }
-
- if ((FALSE == chan->sweep_inc && chan->freq > chan->freq_limit)
- || chan->freq < APU_TO_FIXED(4))
- return APU_RECTANGLE_OUTPUT;
-
- /* frequency sweeping at a rate of (sweep_delay + 1) / 120 secs */
- if (chan->sweep_on && chan->sweep_shifts)
- {
- chan->sweep_phase -= 2; /* 120/60 */
- while (chan->sweep_phase < 0)
- {
- chan->sweep_phase += chan->sweep_delay;
- if (chan->sweep_inc) /* ramp up */
- chan->freq -= chan->freq >> (chan->sweep_shifts);
- else /* ramp down */
- chan->freq += chan->freq >> (chan->sweep_shifts);
- }
- }
-
- chan->phaseacc -= apu->cycle_rate; /* # of cycles per sample */
- if (chan->phaseacc >= 0)
- return APU_RECTANGLE_OUTPUT;
-
-#ifdef APU_OVERSAMPLE
- num_times = total = 0;
-
- if (chan->fixed_envelope)
- output = chan->volume << 8; /* fixed volume */
- else
- output = (chan->env_vol ^ 0x0F) << 8;
-#endif
-
- while (chan->phaseacc < 0)
- {
- chan->phaseacc += chan->freq;
- chan->adder = (chan->adder + 1) & 0x0F;
-
-#ifdef APU_OVERSAMPLE
- if (chan->adder < chan->duty_flip)
- total += output;
- else
- total -= output;
-
- num_times++;
-#endif
- }
-
-#ifdef APU_OVERSAMPLE
- chan->output_vol = total / num_times;
-#else
- if (chan->fixed_envelope)
- output = chan->volume << 8; /* fixed volume */
- else
- output = (chan->env_vol ^ 0x0F) << 8;
-
- if (0 == chan->adder)
- chan->output_vol = output;
- else if (chan->adder == chan->duty_flip)
- chan->output_vol = -output;
-#endif
-
- return APU_RECTANGLE_OUTPUT;
-}
-
-/* TRIANGLE WAVE
-** =============
-** reg0: 7=holdnote, 6-0=linear length counter
-** reg2: low 8 bits of frequency
-** reg3: 7-3=length counter, 2-0=high 3 bits of frequency
-*/
-#define APU_TRIANGLE_OUTPUT (chan->output_vol + (chan->output_vol >> 2))
-static int32 apu_triangle(triangle_t *chan)
-{
- APU_VOLUME_DECAY(chan->output_vol);
-
- if (FALSE == chan->enabled || 0 == chan->vbl_length)
- return APU_TRIANGLE_OUTPUT;
-
- if (chan->counter_started)
- {
- if (chan->linear_length > 0)
- chan->linear_length--;
- if (chan->vbl_length && FALSE == chan->holdnote)
- chan->vbl_length--;
- }
- else if (FALSE == chan->holdnote && chan->write_latency)
- {
- if (--chan->write_latency == 0)
- chan->counter_started = TRUE;
- }
-/*
- if (chan->countmode == COUNTMODE_COUNT)
- {
- if (chan->linear_length > 0)
- chan->linear_length--;
- if (chan->vbl_length)
- chan->vbl_length--;
- }
-*/
- if (0 == chan->linear_length || chan->freq < APU_TO_FIXED(4)) /* inaudible */
- return APU_TRIANGLE_OUTPUT;
-
- chan->phaseacc -= apu->cycle_rate; /* # of cycles per sample */
- while (chan->phaseacc < 0)
- {
- chan->phaseacc += chan->freq;
- chan->adder = (chan->adder + 1) & 0x1F;
-
- if (chan->adder & 0x10)
- chan->output_vol -= (2 << 8);
- else
- chan->output_vol += (2 << 8);
- }
-
- return APU_TRIANGLE_OUTPUT;
-}
-
-
-/* WHITE NOISE CHANNEL
-** ===================
-** reg0: 0-3=volume, 4=envelope, 5=hold
-** reg2: 7=small(93 byte) sample,3-0=freq lookup
-** reg3: 7-4=vbl length counter
-*/
-#define APU_NOISE_OUTPUT ((chan->output_vol + chan->output_vol + chan->output_vol) >> 2)
-
-static int32 apu_noise(noise_t *chan)
-{
- int32 outvol;
-
-#if defined(APU_OVERSAMPLE) && defined(REALTIME_NOISE)
-#else
- int32 noise_bit;
-#endif
-#ifdef APU_OVERSAMPLE
- int num_times;
- int32 total;
-#endif
-
- APU_VOLUME_DECAY(chan->output_vol);
-
- if (FALSE == chan->enabled || 0 == chan->vbl_length)
- return APU_NOISE_OUTPUT;
-
- /* vbl length counter */
- if (FALSE == chan->holdnote)
- chan->vbl_length--;
-
- /* envelope decay at a rate of (env_delay + 1) / 240 secs */
- chan->env_phase -= 4; /* 240/60 */
- while (chan->env_phase < 0)
- {
- chan->env_phase += chan->env_delay;
-
- if (chan->holdnote)
- chan->env_vol = (chan->env_vol + 1) & 0x0F;
- else if (chan->env_vol < 0x0F)
- chan->env_vol++;
- }
-
- chan->phaseacc -= apu->cycle_rate; /* # of cycles per sample */
- if (chan->phaseacc >= 0)
- return APU_NOISE_OUTPUT;
-
-#ifdef APU_OVERSAMPLE
- num_times = total = 0;
-
- if (chan->fixed_envelope)
- outvol = chan->volume << 8; /* fixed volume */
- else
- outvol = (chan->env_vol ^ 0x0F) << 8;
-#endif
-
- while (chan->phaseacc < 0)
- {
- chan->phaseacc += chan->freq;
-
-#ifdef REALTIME_NOISE
-
-#ifdef APU_OVERSAMPLE
- if (shift_register15(chan->xor_tap))
- total += outvol;
- else
- total -= outvol;
-
- num_times++;
-#else
- noise_bit = shift_register15(chan->xor_tap);
-#endif
-
-#else
- chan->cur_pos++;
-
- if (chan->short_sample)
- {
- if (APU_NOISE_93 == chan->cur_pos)
- chan->cur_pos = 0;
- }
- else
- {
- if (APU_NOISE_32K == chan->cur_pos)
- chan->cur_pos = 0;
- }
-
-#ifdef APU_OVERSAMPLE
- if (chan->short_sample)
- noise_bit = noise_short_lut[chan->cur_pos];
- else
- noise_bit = noise_long_lut[chan->cur_pos];
-
- if (noise_bit)
- total += outvol;
- else
- total -= outvol;
-
- num_times++;
-#endif
-#endif /* REALTIME_NOISE */
- }
-
-#ifdef APU_OVERSAMPLE
- chan->output_vol = total / num_times;
-#else
- if (chan->fixed_envelope)
- outvol = chan->volume << 8; /* fixed volume */
- else
- outvol = (chan->env_vol ^ 0x0F) << 8;
-
-#ifndef REALTIME_NOISE
- if (chan->short_sample)
- noise_bit = noise_short_lut[chan->cur_pos];
- else
- noise_bit = noise_long_lut[chan->cur_pos];
-#endif /* !REALTIME_NOISE */
-
- if (noise_bit)
- chan->output_vol = outvol;
- else
- chan->output_vol = -outvol;
-#endif
-
- return APU_NOISE_OUTPUT;
-}
-
-
-INLINE void apu_dmcreload(dmc_t *chan)
-{
- chan->address = chan->cached_addr;
- chan->dma_length = chan->cached_dmalength;
- chan->irq_occurred = FALSE;
-}
-
-/* DELTA MODULATION CHANNEL
-** =========================
-** reg0: 7=irq gen, 6=looping, 3-0=pointer to clock table
-** reg1: output dc level, 6 bits unsigned
-** reg2: 8 bits of 64-byte aligned address offset : $C000 + (value * 64)
-** reg3: length, (value * 16) + 1
-*/
-#define APU_DMC_OUTPUT ((chan->output_vol + chan->output_vol + chan->output_vol) >> 2)
-static int32 apu_dmc(dmc_t *chan)
-{
- int delta_bit;
-
- APU_VOLUME_DECAY(chan->output_vol);
-
- /* only process when channel is alive */
- if (chan->dma_length)
- {
- chan->phaseacc -= apu->cycle_rate; /* # of cycles per sample */
-
- while (chan->phaseacc < 0)
- {
- chan->phaseacc += chan->freq;
-
- delta_bit = (chan->dma_length & 7) ^ 7;
-
- if (7 == delta_bit)
- {
- chan->cur_byte = nes6502_getbyte(chan->address);
-
- /* steal a cycle from CPU*/
- nes6502_setdma(1);
-
- if (0xFFFF == chan->address)
- chan->address = 0x8000;
- else
- chan->address++;
- }
-
- if (--chan->dma_length == 0)
- {
- /* if loop bit set, we're cool to retrigger sample */
- if (chan->looping)
- apu_dmcreload(chan);
- else
- {
- /* check to see if we should generate an irq */
- if (chan->irq_gen)
- {
- chan->irq_occurred = TRUE;
- nes6502_irq();
- }
-
- /* bodge for timestamp queue */
- chan->enabled = FALSE;
- break;
- }
- }
-
- /* positive delta */
- if (chan->cur_byte & (1 << delta_bit))
- {
- if (chan->regs[1] < 0x7D)
- {
- chan->regs[1] += 2;
- chan->output_vol += (2 << 8);
- }
-/*
- if (chan->regs[1] < 0x3F)
- chan->regs[1]++;
-
- chan->output_vol &= ~(0x7E << 8);
- chan->output_vol |= ((chan->regs[1] << 1) << 8);
-*/
- }
- /* negative delta */
- else
- {
- if (chan->regs[1] > 1)
- {
- chan->regs[1] -= 2;
- chan->output_vol -= (2 << 8);
- }
-
-/*
- if (chan->regs[1] > 0)
- chan->regs[1]--;
-
- chan->output_vol &= ~(0x7E << 8);
- chan->output_vol |= ((chan->regs[1] << 1) << 8);
-*/
- }
- }
- }
-
- return APU_DMC_OUTPUT;
-}
-
-
-static void apu_regwrite(uint32 address, uint8 value)
-{
- int chan;
-
- ASSERT(apu);
- switch (address)
- {
- /* rectangles */
- case APU_WRA0:
- case APU_WRB0:
- chan = (address & 4) ? 1 : 0;
- apu->rectangle[chan].regs[0] = value;
-
- apu->rectangle[chan].volume = value & 0x0F;
- apu->rectangle[chan].env_delay = decay_lut[value & 0x0F];
- apu->rectangle[chan].holdnote = (value & 0x20) ? TRUE : FALSE;
- apu->rectangle[chan].fixed_envelope = (value & 0x10) ? TRUE : FALSE;
- apu->rectangle[chan].duty_flip = duty_lut[value >> 6];
- break;
-
- case APU_WRA1:
- case APU_WRB1:
- chan = (address & 4) ? 1 : 0;
- apu->rectangle[chan].regs[1] = value;
- apu->rectangle[chan].sweep_on = (value & 0x80) ? TRUE : FALSE;
- apu->rectangle[chan].sweep_shifts = value & 7;
- apu->rectangle[chan].sweep_delay = decay_lut[(value >> 4) & 7];
-
- apu->rectangle[chan].sweep_inc = (value & 0x08) ? TRUE : FALSE;
- apu->rectangle[chan].freq_limit = APU_TO_FIXED(freq_limit[value & 7]);
- break;
-
- case APU_WRA2:
- case APU_WRB2:
- chan = (address & 4) ? 1 : 0;
- apu->rectangle[chan].regs[2] = value;
-// if (apu->rectangle[chan].enabled)
- apu->rectangle[chan].freq = APU_TO_FIXED((((apu->rectangle[chan].regs[3] & 7) << 8) + value) + 1);
- break;
-
- case APU_WRA3:
- case APU_WRB3:
- chan = (address & 4) ? 1 : 0;
- apu->rectangle[chan].regs[3] = value;
-
-// if (apu->rectangle[chan].enabled)
- {
- apu->rectangle[chan].vbl_length = vbl_lut[value >> 3];
- apu->rectangle[chan].env_vol = 0;
- apu->rectangle[chan].freq = APU_TO_FIXED((((value & 7) << 8) + apu->rectangle[chan].regs[2]) + 1);
- apu->rectangle[chan].adder = 0;
- }
- break;
-
- /* triangle */
- case APU_WRC0:
-/*
- if (0 == (apu->triangle.regs[0] & 0x80))
- apu->triangle.countmode = COUNTMODE_COUNT;
- else
- {
- if (apu->triangle.countmode == COUNTMODE_LOAD && apu->triangle.vbl_length)
- apu->triangle.linear_length = trilength_lut[value & 0x7F];
-
- if (0 == (value & 0x80))
- apu->triangle.countmode = COUNTMODE_COUNT;
- }
-*/
- apu->triangle.regs[0] = value;
-
- apu->triangle.holdnote = (value & 0x80) ? TRUE : FALSE;
-
-
-// if (apu->triangle.enabled)
- {
- if (FALSE == apu->triangle.counter_started && apu->triangle.vbl_length)
- apu->triangle.linear_length = trilength_lut[value & 0x7F];
- }
-
- break;
-
- case APU_WRC2:
-
- apu->triangle.regs[1] = value;
-
-// if (apu->triangle.enabled)
- apu->triangle.freq = APU_TO_FIXED((((apu->triangle.regs[2] & 7) << 8) + value) + 1);
- break;
-
- case APU_WRC3:
-
- apu->triangle.regs[2] = value;
-
- /* this is somewhat of a hack. there appears to be some latency on
- ** the Real Thing between when trireg0 is written to and when the
- ** linear length counter actually begins its countdown. we want to
- ** prevent the case where the program writes to the freq regs first,
- ** then to reg 0, and the counter accidentally starts running because
- ** of the sound queue's timestamp processing.
- **
- ** set latency to a couple scanlines -- should be plenty of time for
- ** the 6502 code to do a couple of table dereferences and load up the
- ** other triregs
- */
-
- /* 06/13/00 MPC -- seems to work OK */
- apu->triangle.write_latency = (int) (2 * NES_SCANLINE_CYCLES / APU_FROM_FIXED(apu->cycle_rate));
-/*
- apu->triangle.linear_length = trilength_lut[apu->triangle.regs[0] & 0x7F];
- if (0 == (apu->triangle.regs[0] & 0x80))
- apu->triangle.countmode = COUNTMODE_COUNT;
- else
- apu->triangle.countmode = COUNTMODE_LOAD;
-*/
-// if (apu->triangle.enabled)
- {
- apu->triangle.freq = APU_TO_FIXED((((value & 7) << 8) + apu->triangle.regs[1]) + 1);
- apu->triangle.vbl_length = vbl_lut[value >> 3];
- apu->triangle.counter_started = FALSE;
- apu->triangle.linear_length = trilength_lut[apu->triangle.regs[0] & 0x7F];
- }
-
- break;
-
- /* noise */
- case APU_WRD0:
- apu->noise.regs[0] = value;
- apu->noise.env_delay = decay_lut[value & 0x0F];
- apu->noise.holdnote = (value & 0x20) ? TRUE : FALSE;
- apu->noise.fixed_envelope = (value & 0x10) ? TRUE : FALSE;
- apu->noise.volume = value & 0x0F;
- break;
-
- case APU_WRD2:
- apu->noise.regs[1] = value;
- apu->noise.freq = APU_TO_FIXED(noise_freq[value & 0x0F]);
-
-#ifdef REALTIME_NOISE
- apu->noise.xor_tap = (value & 0x80) ? 0x40: 0x02;
-#else
- /* detect transition from long->short sample */
- if ((value & 0x80) && FALSE == apu->noise.short_sample)
- {
- /* recalculate short noise buffer */
- shift_register15(noise_short_lut, APU_NOISE_93);
- apu->noise.cur_pos = 0;
- }
- apu->noise.short_sample = (value & 0x80) ? TRUE : FALSE;
-#endif
- break;
-
- case APU_WRD3:
- apu->noise.regs[2] = value;
-
-// if (apu->noise.enabled)
- {
- apu->noise.vbl_length = vbl_lut[value >> 3];
- apu->noise.env_vol = 0; /* reset envelope */
- }
- break;
-
- /* DMC */
- case APU_WRE0:
- apu->dmc.regs[0] = value;
-
- apu->dmc.freq = APU_TO_FIXED(dmc_clocks[value & 0x0F]);
- apu->dmc.looping = (value & 0x40) ? TRUE : FALSE;
-
- if (value & 0x80)
- apu->dmc.irq_gen = TRUE;
- else
- {
- apu->dmc.irq_gen = FALSE;
- apu->dmc.irq_occurred = FALSE;
- }
- break;
-
- case APU_WRE1: /* 7-bit DAC */
- /* add the _delta_ between written value and
- ** current output level of the volume reg
- */
- value &= 0x7F; /* bit 7 ignored */
- apu->dmc.output_vol += ((value - apu->dmc.regs[1]) << 8);
- apu->dmc.regs[1] = value;
-/*
- apu->dmc.output_vol = (value & 0x7F) << 8;
- apu->dmc.regs[1] = (value & 0x7E) >> 1;
-*/
- break;
-
- case APU_WRE2:
- apu->dmc.regs[2] = value;
- apu->dmc.cached_addr = 0xC000 + (uint16) (value << 6);
- break;
-
- case APU_WRE3:
- apu->dmc.regs[3] = value;
- apu->dmc.cached_dmalength = ((value << 4) + 1) << 3;
- break;
-
- case APU_SMASK:
- /* bodge for timestamp queue */
- apu->dmc.enabled = (value & 0x10) ? TRUE : FALSE;
-
- apu->enable_reg = value;
-
- for (chan = 0; chan < 2; chan++)
- {
- if (value & (1 << chan))
- apu->rectangle[chan].enabled = TRUE;
- else
- {
- apu->rectangle[chan].enabled = FALSE;
- apu->rectangle[chan].vbl_length = 0;
- }
- }
-
- if (value & 0x04)
- apu->triangle.enabled = TRUE;
- else
- {
- apu->triangle.enabled = FALSE;
- apu->triangle.vbl_length = 0;
- apu->triangle.linear_length = 0;
- apu->triangle.counter_started = FALSE;
- apu->triangle.write_latency = 0;
- }
-
- if (value & 0x08)
- apu->noise.enabled = TRUE;
- else
- {
- apu->noise.enabled = FALSE;
- apu->noise.vbl_length = 0;
- }
-
- if (value & 0x10)
- {
- if (0 == apu->dmc.dma_length)
- apu_dmcreload(&apu->dmc);
- }
- else
- apu->dmc.dma_length = 0;
-
- apu->dmc.irq_occurred = FALSE;
- break;
-
- /* unused, but they get hit in some mem-clear loops */
- case 0x4009:
- case 0x400D:
- break;
-
- default:
- break;
- }
-}
-
-/* Read from $4000-$4017 */
-uint8 apu_read(uint32 address)
-{
- uint8 value;
-
- ASSERT(apu);
-
- switch (address)
- {
- case APU_SMASK:
- /* seems that bit 6 denotes vblank -- return 1 for now */
- value = 0x40;
-
- /* Return 1 in 0-5 bit pos if a channel is playing */
- if (apu->rectangle[0].enabled && apu->rectangle[0].vbl_length)
- value |= 0x01;
- if (apu->rectangle[1].enabled && apu->rectangle[1].vbl_length)
- value |= 0x02;
- if (apu->triangle.enabled && apu->triangle.vbl_length)
- value |= 0x04;
- if (apu->noise.enabled && apu->noise.vbl_length)
- value |= 0x08;
-
- //if (apu->dmc.dma_length)
- /* bodge for timestamp queue */
- if (apu->dmc.enabled)
- value |= 0x10;
-
- if (apu->dmc.irq_occurred)
- value |= 0x80;
-
- break;
-
-#ifndef NSF_PLAYER
- case APU_JOY0:
- value = input_get(INP_JOYPAD0);
- break;
-
- case APU_JOY1:
- value = input_get(INP_ZAPPER | INP_JOYPAD1 /*| INP_ARKANOID*/ /*| INP_POWERPAD*/);
- break;
-#endif /* !NSF_PLAYER */
-
- default:
- value = (address >> 8); /* heavy capacitance on data bus */
- break;
- }
-
- return value;
-}
-
-
-void apu_write(uint32 address, uint8 value)
-{
-#ifndef NSF_PLAYER
- static uint8 last_write;
-#endif /* !NSF_PLAYER */
- apudata_t d;
-
- switch (address)
- {
- case 0x4015:
- /* bodge for timestamp queue */
- apu->dmc.enabled = (value & 0x10) ? TRUE : FALSE;
-
- case 0x4000: case 0x4001: case 0x4002: case 0x4003:
- case 0x4004: case 0x4005: case 0x4006: case 0x4007:
- case 0x4008: case 0x4009: case 0x400A: case 0x400B:
- case 0x400C: case 0x400D: case 0x400E: case 0x400F:
- case 0x4010: case 0x4011: case 0x4012: case 0x4013:
- d.timestamp = nes6502_getcycles(FALSE);
- d.address = address;
- d.value = value;
- apu_enqueue(&d);
- break;
-
-#ifndef NSF_PLAYER
- case APU_OAMDMA:
- ppu_oamdma(address, value);
- break;
-
- case APU_JOY0:
- /* VS system VROM switching */
- mmc_vsvrom(value & 4);
-
- /* see if we need to strobe them joypads */
- value &= 1;
- if ((0 == value) && last_write)
- input_strobe();
- last_write = value;
- break;
-
- case APU_JOY1: /* Some kind of IRQ control business */
- break;
-
-#endif /* !NSF_PLAYER */
-
- default:
- break;
- }
-}
-
-void apu_getpcmdata(void **data, int *num_samples, int *sample_bits)
-{
- ASSERT(apu);
- *data = apu->buffer;
- *num_samples = apu->num_samples;
- *sample_bits = apu->sample_bits;
-}
-
-
-void apu_process(void *buffer, int num_samples)
-{
- apudata_t *d;
- uint32 elapsed_cycles;
- static int32 prev_sample = 0;
- int32 next_sample, accum;
-
- ASSERT(apu);
-
- /* grab it, keep it local for speed */
- elapsed_cycles = (uint32) apu->elapsed_cycles;
-
- /* BLEH */
- apu->buffer = buffer;
-
- while (num_samples--)
- {
- while ((FALSE == APU_QEMPTY()) && (apu->queue[apu->q_tail].timestamp <= elapsed_cycles))
- {
- d = apu_dequeue();
- apu_regwrite(d->address, d->value);
- }
-
- elapsed_cycles += APU_FROM_FIXED(apu->cycle_rate);
-
- accum = 0;
- if (apu->mix_enable[0]) accum += apu_rectangle(&apu->rectangle[0]);
- if (apu->mix_enable[1]) accum += apu_rectangle(&apu->rectangle[1]);
- if (apu->mix_enable[2]) accum += apu_triangle(&apu->triangle);
- if (apu->mix_enable[3]) accum += apu_noise(&apu->noise);
- if (apu->mix_enable[4]) accum += apu_dmc(&apu->dmc);
-
- if (apu->ext && apu->mix_enable[5]) accum += apu->ext->process();
-
- /* do any filtering */
- if (APU_FILTER_NONE != apu->filter_type)
- {
- next_sample = accum;
-
- if (APU_FILTER_LOWPASS == apu->filter_type)
- {
- accum += prev_sample;
- accum >>= 1;
- }
- else
- accum = (accum + accum + accum + prev_sample) >> 2;
-
- prev_sample = next_sample;
- }
-
- /* little extra kick for the kids */
- accum <<= 1;
-
- /* prevent clipping */
- if (accum > 0x7FFF)
- accum = 0x7FFF;
- else if (accum < -0x8000)
- accum = -0x8000;
-
- /* signed 16-bit output, unsigned 8-bit */
- if (16 == apu->sample_bits) {
- *((int16 *) buffer) = (int16) accum;
- buffer = (int16 *) buffer + 1;
- } else {
- *((uint8 *) buffer) = (accum >> 8) ^ 0x80;
- buffer = (int8 *) buffer + 1;
- }
- }
-
- /* resync cycle counter */
- apu->elapsed_cycles = nes6502_getcycles(FALSE);
-}
-
-/* set the filter type */
-void apu_setfilter(int filter_type)
-{
- ASSERT(apu);
- apu->filter_type = filter_type;
-}
-
-void apu_reset(void)
-{
- uint32 address;
-
- ASSERT(apu);
-
- apu->elapsed_cycles = 0;
- memset(&apu->queue, 0, APUQUEUE_SIZE * sizeof(apudata_t));
- apu->q_head = 0;
- apu->q_tail = 0;
-
- /* use to avoid bugs =) */
- for (address = 0x4000; address <= 0x4013; address++)
- apu_regwrite(address, 0);
-
-#ifdef NSF_PLAYER
- apu_regwrite(0x400C, 0x10); /* silence noise channel on NSF start */
- apu_regwrite(0x4015, 0x0F);
-#else
- apu_regwrite(0x4015, 0);
-#endif /* NSF_PLAYER */
-
- if (apu->ext)
- apu->ext->reset();
-}
-
-static void apu_build_luts(int num_samples)
-{
- int i;
-
- /* lut used for enveloping and frequency sweeps */
- for (i = 0; i < 16; i++)
- decay_lut[i] = num_samples * (i + 1);
-
- /* used for note length, based on vblanks and size of audio buffer */
- for (i = 0; i < 32; i++)
- vbl_lut[i] = vbl_length[i] * num_samples;
-
- /* triangle wave channel's linear length table */
- for (i = 0; i < 128; i++)
- trilength_lut[i] = (i * num_samples) / 4;
-
-#ifndef REALTIME_NOISE
- /* generate noise samples */
- shift_register15(noise_long_lut, APU_NOISE_32K);
- shift_register15(noise_short_lut, APU_NOISE_93);
-#endif /* !REALTIME_NOISE */
-}
-
-static void apu_setactive(apu_t *active)
-{
- ASSERT(active);
- apu = active;
-}
-
-/* Initializes emulated sound hardware, creates waveforms/voices */
-apu_t *apu_create(int sample_rate, int refresh_rate, int sample_bits, boolean stereo)
-{
- apu_t *temp_apu;
- int channel;
-
- temp_apu = malloc(sizeof(apu_t));
- if (NULL == temp_apu)
- return NULL;
-
- temp_apu->sample_rate = sample_rate;
- temp_apu->refresh_rate = refresh_rate;
- temp_apu->sample_bits = sample_bits;
-
- temp_apu->num_samples = sample_rate / refresh_rate;
- /* turn into fixed point! */
- temp_apu->cycle_rate = (int32) (APU_BASEFREQ * 65536.0 / (float) sample_rate);
-
- /* build various lookup tables for apu */
- apu_build_luts(temp_apu->num_samples);
-
- /* set the update routine */
- temp_apu->process = apu_process;
- temp_apu->ext = NULL;
-
- apu_setactive(temp_apu);
- apu_reset();
-
- for (channel = 0; channel < 6; channel++)
- apu_setchan(channel, TRUE);
-
- apu_setfilter(APU_FILTER_LOWPASS);
-
- return temp_apu;
-}
-
-apu_t *apu_getcontext(void)
-{
- return apu;
-}
-
-void apu_destroy(apu_t *src_apu)
-{
- if (src_apu)
- {
- if (src_apu->ext)
- src_apu->ext->shutdown();
- free(src_apu);
- }
-}
-
-void apu_setext(apu_t *src_apu, apuext_t *ext)
-{
- ASSERT(src_apu);
-
- src_apu->ext = ext;
-
- /* initialize it */
- if (src_apu->ext)
- src_apu->ext->init();
-}
-
-/* this exists for external mixing routines */
-int32 apu_getcyclerate(void)
-{
- ASSERT(apu);
- return apu->cycle_rate;
-}
-
-/*
-** $Log: nes_apu.c,v $
-** Revision 1.4 2005/05/07 09:11:39 valtri
-** *BUGFIX*
-** gcc4 patches from Dams Nadé (livna.org) and Keenan Pepper.
-**
-** Revision 1.3 2004/12/12 06:55:59 athp
-** Code cleanups and elimination of some compiler warnings; patch courtesy of AL13N
-**
-** Revision 1.2 2003/08/25 21:51:43 f1rmb
-** Reduce GCC verbosity (various prototype declaration fixes). ffmpeg, wine and fft*post are untouched (fft: for now).
-**
-** Revision 1.1 2003/01/08 07:04:35 tmmm
-** initial import of Nosefart sources
-**
-** Revision 1.19 2000/07/04 04:53:26 matt
-** minor changes, sound amplification
-**
-** Revision 1.18 2000/07/03 02:18:53 matt
-** much better external module exporting
-**
-** Revision 1.17 2000/06/26 11:01:55 matt
-** made triangle a tad quieter
-**
-** Revision 1.16 2000/06/26 05:10:33 matt
-** fixed cycle rate generation accuracy
-**
-** Revision 1.15 2000/06/26 05:00:37 matt
-** cleanups
-**
-** Revision 1.14 2000/06/23 11:06:24 matt
-** more faithful mixing of channels
-**
-** Revision 1.13 2000/06/23 03:29:27 matt
-** cleaned up external sound inteface
-**
-** Revision 1.12 2000/06/20 00:08:39 matt
-** bugfix to rectangle wave
-**
-** Revision 1.11 2000/06/13 13:48:58 matt
-** fixed triangle write latency for fixed point apu cycle rate
-**
-** Revision 1.10 2000/06/12 01:14:36 matt
-** minor change to clipping extents
-**
-** Revision 1.9 2000/06/09 20:00:56 matt
-** fixed noise hiccup in NSF player mode
-**
-** Revision 1.8 2000/06/09 16:49:02 matt
-** removed all floating point from sound generation
-**
-** Revision 1.7 2000/06/09 15:12:28 matt
-** initial revision
-**
-*/
diff --git a/src/libxineadec/nosefart/nes_apu.h b/src/libxineadec/nosefart/nes_apu.h
deleted file mode 100644
index 09b5842d9..000000000
--- a/src/libxineadec/nosefart/nes_apu.h
+++ /dev/null
@@ -1,331 +0,0 @@
-/*
-** Nofrendo (c) 1998-2000 Matthew Conte (matt@conte.com)
-**
-**
-** This program is free software; you can redistribute it and/or
-** modify it under the terms of version 2 of the GNU Library General
-** Public License as published by the Free Software Foundation.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-** Library General Public License for more details. To obtain a
-** copy of the GNU Library General Public License, write to the Free
-** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-**
-** Any permitted reproduction of these routines, in whole or in part,
-** must bear this legend.
-**
-**
-** nes_apu.h
-**
-** NES APU emulation header file
-** $Id: nes_apu.h,v 1.2 2003/01/09 19:50:03 jkeil Exp $
-*/
-
-#ifndef _NES_APU_H_
-#define _NES_APU_H_
-
-#ifdef __GNUC__
-#define INLINE static inline
-#elif defined(WIN32)
-#define INLINE static __inline
-#else
-#define INLINE static
-#endif
-
-/* define this for realtime generated noise */
-#define REALTIME_NOISE
-
-#define APU_WRA0 0x4000
-#define APU_WRA1 0x4001
-#define APU_WRA2 0x4002
-#define APU_WRA3 0x4003
-#define APU_WRB0 0x4004
-#define APU_WRB1 0x4005
-#define APU_WRB2 0x4006
-#define APU_WRB3 0x4007
-#define APU_WRC0 0x4008
-#define APU_WRC2 0x400A
-#define APU_WRC3 0x400B
-#define APU_WRD0 0x400C
-#define APU_WRD2 0x400E
-#define APU_WRD3 0x400F
-#define APU_WRE0 0x4010
-#define APU_WRE1 0x4011
-#define APU_WRE2 0x4012
-#define APU_WRE3 0x4013
-
-#define APU_OAMDMA 0x4014
-#define APU_SMASK 0x4015
-#define APU_JOY0 0x4016
-#define APU_JOY1 0x4017
-
-/* length of generated noise */
-#define APU_NOISE_32K 0x7FFF
-#define APU_NOISE_93 93
-
-#define APU_BASEFREQ (NES_MASTER_CLOCK / 12)
-
-/* to/from 16.16 fixed point */
-#define APU_TO_FIXED(x) ((x) << 16)
-#define APU_FROM_FIXED(x) ((x) >> 16)
-
-
-/* channel structures */
-/* As much data as possible is precalculated,
-** to keep the sample processing as lean as possible
-*/
-
-typedef struct rectangle_s
-{
- uint8 regs[4];
-
- boolean enabled;
-
- int32 phaseacc;
- int32 freq;
- int32 output_vol;
- boolean fixed_envelope;
- boolean holdnote;
- uint8 volume;
-
- int32 sweep_phase;
- int32 sweep_delay;
- boolean sweep_on;
- uint8 sweep_shifts;
- uint8 sweep_length;
- boolean sweep_inc;
- int32 freq_limit;
-
- int32 env_phase;
- int32 env_delay;
- uint8 env_vol;
-
- int vbl_length;
- uint8 adder;
- int duty_flip;
-} rectangle_t;
-
-/*
-enum
-{
- COUNTMODE_LOAD,
- COUNTMODE_COUNT
-};
-*/
-
-typedef struct triangle_s
-{
- uint8 regs[3];
-
- boolean enabled;
-
- int32 freq;
- int32 phaseacc;
- int32 output_vol;
-
- uint8 adder;
-
- boolean holdnote;
- boolean counter_started;
- /* quasi-hack */
- int write_latency;
-
-// boolean countmode;
-
- int vbl_length;
- int linear_length;
-
-} triangle_t;
-
-
-typedef struct noise_s
-{
- uint8 regs[3];
-
- boolean enabled;
-
- int32 freq;
- int32 phaseacc;
- int32 output_vol;
-
- int32 env_phase;
- int32 env_delay;
- uint8 env_vol;
- boolean fixed_envelope;
- boolean holdnote;
-
- uint8 volume;
-
- int vbl_length;
-
-#ifdef REALTIME_NOISE
- uint8 xor_tap;
-#else
- boolean short_sample;
- int cur_pos;
-#endif /* REALTIME_NOISE */
-} noise_t;
-
-typedef struct dmc_s
-{
- uint8 regs[4];
-
- /* bodge for timestamp queue */
- boolean enabled;
-
- int32 freq;
- int32 phaseacc;
- int32 output_vol;
-
- uint32 address;
- uint32 cached_addr;
- int dma_length;
- int cached_dmalength;
- uint8 cur_byte;
-
- boolean looping;
- boolean irq_gen;
- boolean irq_occurred;
-
-} dmc_t;
-
-enum
-{
- APU_FILTER_NONE,
- APU_FILTER_LOWPASS,
- APU_FILTER_WEIGHTED
-};
-
-typedef struct
-{
- uint32 min_range, max_range;
- uint8 (*read_func)(uint32 address);
-} apu_memread;
-
-typedef struct
-{
- uint32 min_range, max_range;
- void (*write_func)(uint32 address, uint8 value);
-} apu_memwrite;
-
-/* external sound chip stuff */
-typedef struct apuext_s
-{
- void (*init)(void);
- void (*shutdown)(void);
- void (*reset)(void);
- int32 (*process)(void);
- apu_memread *mem_read;
- apu_memwrite *mem_write;
-} apuext_t;
-
-
-/* APU queue structure */
-#define APUQUEUE_SIZE 4096
-#define APUQUEUE_MASK (APUQUEUE_SIZE - 1)
-
-/* apu ring buffer member */
-typedef struct apudata_s
-{
- uint32 timestamp, address;
- uint8 value;
-} apudata_t;
-
-
-typedef struct apu_s
-{
- rectangle_t rectangle[2];
- triangle_t triangle;
- noise_t noise;
- dmc_t dmc;
- uint8 enable_reg;
-
- apudata_t queue[APUQUEUE_SIZE];
- int q_head, q_tail;
- uint32 elapsed_cycles;
-
- void *buffer; /* pointer to output buffer */
- int num_samples;
-
- boolean mix_enable[6];
- int filter_type;
-
- int32 cycle_rate;
-
- int sample_rate;
- int sample_bits;
- int refresh_rate;
-
- void (*process)(void *buffer, int num_samples);
-
- /* external sound chip */
- apuext_t *ext;
-} apu_t;
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/* Function prototypes */
-extern apu_t *apu_create(int sample_rate, int refresh_rate, int sample_bits, boolean stereo);
-extern void apu_destroy(apu_t *apu);
-extern void apu_setext(apu_t *apu, apuext_t *ext);
-extern void apu_setfilter(int filter_type);
-extern void apu_process(void *buffer, int num_samples);
-extern void apu_reset(void);
-extern void apu_setchan(int chan, boolean enabled);
-extern int32 apu_getcyclerate(void);
-extern apu_t *apu_getcontext(void);
-
-extern uint8 apu_read(uint32 address);
-extern void apu_write(uint32 address, uint8 value);
-
-/* for visualization */
-extern void apu_getpcmdata(void **data, int *num_samples, int *sample_bits);
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _NES_APU_H_ */
-
-/*
-** $Log: nes_apu.h,v $
-** Revision 1.2 2003/01/09 19:50:03 jkeil
-** NSF audio files were crashing on SPARC.
-**
-** - Define the correct HOST_ENDIAN for SPARC
-** - remove unaligned memory accesses
-**
-** Revision 1.1 2003/01/08 07:04:35 tmmm
-** initial import of Nosefart sources
-**
-** Revision 1.12 2000/07/04 04:54:48 matt
-** minor changes that helped with MAME
-**
-** Revision 1.11 2000/07/03 02:18:53 matt
-** much better external module exporting
-**
-** Revision 1.10 2000/06/26 05:00:37 matt
-** cleanups
-**
-** Revision 1.9 2000/06/23 03:29:28 matt
-** cleaned up external sound inteface
-**
-** Revision 1.8 2000/06/20 04:06:16 matt
-** migrated external sound definition to apu module
-**
-** Revision 1.7 2000/06/20 00:07:35 matt
-** added convenience members to apu_t struct
-**
-** Revision 1.6 2000/06/09 16:49:02 matt
-** removed all floating point from sound generation
-**
-** Revision 1.5 2000/06/09 15:12:28 matt
-** initial revision
-**
-*/
diff --git a/src/libxineadec/nosefart/nsf.c b/src/libxineadec/nosefart/nsf.c
deleted file mode 100644
index 6bbc96423..000000000
--- a/src/libxineadec/nosefart/nsf.c
+++ /dev/null
@@ -1,632 +0,0 @@
-/*
-** Nofrendo (c) 1998-2000 Matthew Conte (matt@conte.com)
-**
-**
-** This program is free software; you can redistribute it and/or
-** modify it under the terms of version 2 of the GNU Library General
-** Public License as published by the Free Software Foundation.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-** Library General Public License for more details. To obtain a
-** copy of the GNU Library General Public License, write to the Free
-** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-**
-** Any permitted reproduction of these routines, in whole or in part,
-** must bear this legend.
-**
-**
-** nsf.c
-**
-** NSF loading/saving related functions
-** $Id: nsf.c,v 1.4 2006/09/26 00:52:17 dgp85 Exp $
-*/
-
-#include <stdio.h>
-#include <string.h>
-#include "types.h"
-#include "nsf.h"
-#include "log.h"
-#include "nes6502.h"
-#include "nes_apu.h"
-#include "vrcvisnd.h"
-#include "vrc7_snd.h"
-#include "mmc5_snd.h"
-#include "fds_snd.h"
-
-/* TODO: bleh! should encapsulate in NSF */
-#define MAX_ADDRESS_HANDLERS 32
-static nes6502_memread nsf_readhandler[MAX_ADDRESS_HANDLERS];
-static nes6502_memwrite nsf_writehandler[MAX_ADDRESS_HANDLERS];
-
-static nsf_t *cur_nsf = NULL;
-
-static void nsf_setcontext(nsf_t *nsf)
-{
- ASSERT(nsf);
- cur_nsf = nsf;
-}
-
-static uint8 read_mirrored_ram(uint32 address)
-{
- return cur_nsf->cpu->mem_page[0][address & 0x7FF];
-}
-
-static void write_mirrored_ram(uint32 address, uint8 value)
-{
- cur_nsf->cpu->mem_page[0][address & 0x7FF] = value;
-}
-
-/* can be used for both banked and non-bankswitched NSFs */
-static void nsf_bankswitch(uint32 address, uint8 value)
-{
- int cpu_page;
- uint8 *offset;
-
- cpu_page = address & 0x0F;
- offset = (cur_nsf->data - (cur_nsf->load_addr & 0x0FFF)) + (value << 12);
-
- nes6502_getcontext(cur_nsf->cpu);
- cur_nsf->cpu->mem_page[cpu_page] = offset;
- nes6502_setcontext(cur_nsf->cpu);
-}
-
-static nes6502_memread default_readhandler[] =
-{
- { 0x0800, 0x1FFF, read_mirrored_ram },
- { 0x4000, 0x4017, apu_read },
- { -1, -1, NULL }
-};
-
-static nes6502_memwrite default_writehandler[] =
-{
- { 0x0800, 0x1FFF, write_mirrored_ram },
- { 0x4000, 0x4017, apu_write },
- { 0x5FF6, 0x5FFF, nsf_bankswitch },
- { -1, -1, NULL}
-};
-
-static uint8 invalid_read(uint32 address)
-{
-#ifdef NOFRENDO_DEBUG
- log_printf("filthy NSF read from $%04X\n", address);
-#endif /* NOFRENDO_DEBUG */
-
- return 0xFF;
-}
-
-static void invalid_write(uint32 address, uint8 value)
-{
-#ifdef NOFRENDO_DEBUG
- log_printf("filthy NSF tried to write $%02X to $%04X\n", value, address);
-#endif /* NOFRENDO_DEBUG */
-}
-
-/* set up the address handlers that the CPU uses */
-static void build_address_handlers(nsf_t *nsf)
-{
- int count, num_handlers;
-
- memset(nsf_readhandler, 0, sizeof(nsf_readhandler));
- memset(nsf_writehandler, 0, sizeof(nsf_writehandler));
-
- num_handlers = 0;
- for (count = 0; num_handlers < MAX_ADDRESS_HANDLERS; count++, num_handlers++)
- {
- if (NULL == default_readhandler[count].read_func)
- break;
-
- memcpy(&nsf_readhandler[num_handlers], &default_readhandler[count],
- sizeof(nes6502_memread));
- }
-
- if (nsf->apu->ext)
- {
- if (NULL != nsf->apu->ext->mem_read)
- {
- for (count = 0; num_handlers < MAX_ADDRESS_HANDLERS; count++, num_handlers++)
- {
- if (NULL == nsf->apu->ext->mem_read[count].read_func)
- break;
-
- memcpy(&nsf_readhandler[num_handlers], &nsf->apu->ext->mem_read[count],
- sizeof(nes6502_memread));
- }
- }
- }
-
- /* catch-all for bad reads */
- nsf_readhandler[num_handlers].min_range = 0x2000; /* min address */
- nsf_readhandler[num_handlers].max_range = 0x5BFF; /* max address */
- nsf_readhandler[num_handlers].read_func = invalid_read; /* handler */
- num_handlers++;
- nsf_readhandler[num_handlers].min_range = -1;
- nsf_readhandler[num_handlers].max_range = -1;
- nsf_readhandler[num_handlers].read_func = NULL;
- num_handlers++;
- ASSERT(num_handlers <= MAX_ADDRESS_HANDLERS);
-
- num_handlers = 0;
- for (count = 0; num_handlers < MAX_ADDRESS_HANDLERS; count++, num_handlers++)
- {
- if (NULL == default_writehandler[count].write_func)
- break;
-
- memcpy(&nsf_writehandler[num_handlers], &default_writehandler[count],
- sizeof(nes6502_memwrite));
- }
-
- if (nsf->apu->ext)
- {
- if (NULL != nsf->apu->ext->mem_write)
- {
- for (count = 0; num_handlers < MAX_ADDRESS_HANDLERS; count++, num_handlers++)
- {
- if (NULL == nsf->apu->ext->mem_write[count].write_func)
- break;
-
- memcpy(&nsf_writehandler[num_handlers], &nsf->apu->ext->mem_write[count],
- sizeof(nes6502_memwrite));
- }
- }
- }
-
- /* catch-all for bad writes */
- nsf_writehandler[num_handlers].min_range = 0x2000; /* min address */
- nsf_writehandler[num_handlers].max_range = 0x5BFF; /* max address */
- nsf_writehandler[num_handlers].write_func = invalid_write; /* handler */
- num_handlers++;
- /* protect region at $8000-$FFFF */
- nsf_writehandler[num_handlers].min_range = 0x8000; /* min address */
- nsf_writehandler[num_handlers].max_range = 0xFFFF; /* max address */
- nsf_writehandler[num_handlers].write_func = invalid_write; /* handler */
- num_handlers++;
- nsf_writehandler[num_handlers].min_range = -1;
- nsf_writehandler[num_handlers].max_range = -1;
- nsf_writehandler[num_handlers].write_func = NULL;
- num_handlers++;
- ASSERT(num_handlers <= MAX_ADDRESS_HANDLERS);
-}
-
-#define NSF_ROUTINE_LOC 0x5000
-
-/* sets up a simple loop that calls the desired routine and spins */
-static void nsf_setup_routine(uint32 address, uint8 a_reg, uint8 x_reg)
-{
- uint8 *mem;
-
- nes6502_getcontext(cur_nsf->cpu);
- mem = cur_nsf->cpu->mem_page[NSF_ROUTINE_LOC >> 12] + (NSF_ROUTINE_LOC & 0x0FFF);
-
- /* our lovely 4-byte 6502 NSF player */
- mem[0] = 0x20; /* JSR address */
- mem[1] = address & 0xFF;
- mem[2] = address >> 8;
- mem[3] = 0xF2; /* JAM (cpu kill op) */
-
- cur_nsf->cpu->pc_reg = NSF_ROUTINE_LOC;
- cur_nsf->cpu->a_reg = a_reg;
- cur_nsf->cpu->x_reg = x_reg;
- cur_nsf->cpu->y_reg = 0;
- cur_nsf->cpu->s_reg = 0xFF;
-
- nes6502_setcontext(cur_nsf->cpu);
-}
-
-/* retrieve any external soundchip driver */
-static apuext_t *nsf_getext(nsf_t *nsf)
-{
- switch (nsf->ext_sound_type)
- {
- case EXT_SOUND_VRCVI:
- return &vrcvi_ext;
-
- case EXT_SOUND_VRCVII:
- return &vrc7_ext;
-
- case EXT_SOUND_FDS:
- return &fds_ext;
-
- case EXT_SOUND_MMC5:
- return &mmc5_ext;
-
- case EXT_SOUND_NAMCO106:
- case EXT_SOUND_SUNSOFT_FME07:
- case EXT_SOUND_NONE:
- default:
- return NULL;
- }
-}
-
-static void nsf_inittune(nsf_t *nsf)
-{
- uint8 bank, x_reg;
- uint8 start_bank, num_banks;
-
- memset(nsf->cpu->mem_page[0], 0, 0x800);
- memset(nsf->cpu->mem_page[6], 0, 0x1000);
- memset(nsf->cpu->mem_page[7], 0, 0x1000);
-
- if (nsf->bankswitched)
- {
- /* the first hack of the NSF spec! */
- if (EXT_SOUND_FDS == nsf->ext_sound_type)
- {
- nsf_bankswitch(0x5FF6, nsf->bankswitch_info[6]);
- nsf_bankswitch(0x5FF7, nsf->bankswitch_info[7]);
- }
-
- for (bank = 0; bank < 8; bank++)
- nsf_bankswitch(0x5FF8 + bank, nsf->bankswitch_info[bank]);
- }
- else
- {
- /* not bankswitched, just page in our standard stuff */
- ASSERT(nsf->load_addr + nsf->length <= 0x10000);
-
- /* avoid ripper filth */
- for (bank = 0; bank < 8; bank++)
- nsf_bankswitch(0x5FF8 + bank, bank);
-
- start_bank = nsf->load_addr >> 12;
- num_banks = ((nsf->load_addr + nsf->length - 1) >> 12) - start_bank + 1;
-
- for (bank = 0; bank < num_banks; bank++)
- nsf_bankswitch(0x5FF0 + start_bank + bank, bank);
- }
-
- /* determine PAL/NTSC compatibility shite */
- if (nsf->pal_ntsc_bits & NSF_DEDICATED_PAL)
- x_reg = 1;
- else
- x_reg = 0;
-
- /* execute 1 frame or so; let init routine run free */
- nsf_setup_routine(nsf->init_addr, (uint8) (nsf->current_song - 1), x_reg);
- nes6502_execute((int) NES_FRAME_CYCLES);
-}
-
-void nsf_frame(nsf_t *nsf)
-{
- //nsf_setcontext(nsf); /* future expansion =) */
-
- /* one frame of NES processing */
- nsf_setup_routine(nsf->play_addr, 0, 0);
- nes6502_execute((int) NES_FRAME_CYCLES);
-}
-
-/* Deallocate memory */
-static void nes_shutdown(nsf_t *nsf)
-{
- int i;
-
- ASSERT(nsf);
-
- if (nsf->cpu)
- {
- if (nsf->cpu->mem_page[0])
- free(nsf->cpu->mem_page[0]);
- for (i = 5; i <= 7; i++)
- {
- if (nsf->cpu->mem_page[i])
- free(nsf->cpu->mem_page[i]);
- }
- free(nsf->cpu);
- }
-}
-
-void nsf_init(void)
-{
- nes6502_init();
-}
-
-/* Initialize NES CPU, hardware, etc. */
-static int nsf_cpuinit(nsf_t *nsf)
-{
- int i;
-
- nsf->cpu = malloc(sizeof(nes6502_context));
- if (NULL == nsf->cpu)
- return -1;
-
- memset(nsf->cpu, 0, sizeof(nes6502_context));
-
- nsf->cpu->mem_page[0] = malloc(0x800);
- if (NULL == nsf->cpu->mem_page[0])
- return -1;
-
- /* allocate some space for the NSF "player" MMC5 EXRAM, and WRAM */
- for (i = 5; i <= 7; i++)
- {
- nsf->cpu->mem_page[i] = malloc(0x1000);
- if (NULL == nsf->cpu->mem_page[i])
- return -1;
- }
-
- nsf->cpu->read_handler = nsf_readhandler;
- nsf->cpu->write_handler = nsf_writehandler;
-
- return 0;
-}
-
-static void nsf_setup(nsf_t *nsf)
-{
- int i;
-
- nsf->current_song = nsf->start_song;
-
- if (nsf->pal_ntsc_bits & NSF_DEDICATED_PAL)
- {
- if (nsf->pal_speed)
- nsf->playback_rate = 1000000 / nsf->pal_speed;
- else
- nsf->playback_rate = 50; /* 50 Hz */
- }
- else
- {
- if (nsf->ntsc_speed)
- nsf->playback_rate = 1000000 / nsf->ntsc_speed;
- else
- nsf->playback_rate = 60; /* 60 Hz */
- }
-
- nsf->bankswitched = FALSE;
-
- for (i = 0; i < 8; i++)
- {
- if (nsf->bankswitch_info[i])
- {
- nsf->bankswitched = TRUE;
- break;
- }
- }
-}
-
-#ifdef HOST_LITTLE_ENDIAN
-#define SWAP_16(x) (x)
-#else /* !HOST_LITTLE_ENDIAN */
-#define SWAP_16(x) (((uint16) x >> 8) | (((uint16) x & 0xFF) << 8))
-#endif /* !HOST_LITTLE_ENDIAN */
-
-/* Load a ROM image into memory */
-nsf_t *nsf_load(char *filename, void *source, int length)
-{
- FILE *fp = NULL;
- char *new_fn = NULL;
- nsf_t *temp_nsf;
-
- if (NULL == filename && NULL == source)
- return NULL;
-
- if (NULL == source)
- {
- fp = fopen(filename, "rb");
-
- /* Didn't find the file? Maybe the .NSF extension was omitted */
- if (NULL == fp)
- {
- new_fn = malloc(strlen(filename) + 5);
- if (NULL == new_fn)
- return NULL;
- strcpy(new_fn, filename);
-
- if (NULL == strrchr(new_fn, '.'))
- strcat(new_fn, ".nsf");
-
- fp = fopen(new_fn, "rb");
-
- if (NULL == fp)
- {
- log_printf("could not find file '%s'\n", new_fn);
- free(new_fn);
- return NULL;
- }
- }
- }
-
- temp_nsf = malloc(sizeof(nsf_t));
- if (NULL == temp_nsf) {
- fclose(fp);
- free(new_fn);
- return NULL;
- }
-
- /* Read in the header */
- if (NULL == source)
- fread(temp_nsf, 1, NSF_HEADER_SIZE, fp);
- else
- memcpy(temp_nsf, source, NSF_HEADER_SIZE);
-
- if (memcmp(temp_nsf->id, NSF_MAGIC, 5))
- {
- if (NULL == source)
- {
- log_printf("%s is not an NSF format file\n", new_fn);
- fclose(fp);
- free(new_fn);
- }
- nsf_free(&temp_nsf);
- return NULL;
- }
-
- /* fixup endianness */
- temp_nsf->load_addr = SWAP_16(temp_nsf->load_addr);
- temp_nsf->init_addr = SWAP_16(temp_nsf->init_addr);
- temp_nsf->play_addr = SWAP_16(temp_nsf->play_addr);
- temp_nsf->ntsc_speed = SWAP_16(temp_nsf->ntsc_speed);
- temp_nsf->pal_speed = SWAP_16(temp_nsf->pal_speed);
-
- /* we're now at position 80h */
- if (NULL == source)
- {
- fseek(fp, 0, SEEK_END);
- temp_nsf->length = ftell(fp) - NSF_HEADER_SIZE;
- }
- else
- {
- temp_nsf->length = length - NSF_HEADER_SIZE;
- }
-
- /* Allocate NSF space, and load it up! */
- temp_nsf->data = malloc(temp_nsf->length);
- if (NULL == temp_nsf->data)
- {
- log_printf("error allocating memory for NSF data\n");
- nsf_free(&temp_nsf);
- return NULL;
- }
-
- /* seek to end of header, read in data */
- if (NULL == source)
- {
- fseek(fp, NSF_HEADER_SIZE, SEEK_SET);
- fread(temp_nsf->data, temp_nsf->length, 1, fp);
-
- fclose(fp);
-
- if (new_fn)
- free(new_fn);
- }
- else
- memcpy(temp_nsf->data, (uint8 *) source + NSF_HEADER_SIZE, length - NSF_HEADER_SIZE);
-
- /* Set up some variables */
- nsf_setup(temp_nsf);
-
- temp_nsf->apu = NULL; /* just make sure */
-
- if (nsf_cpuinit(temp_nsf))
- {
- nsf_free(&temp_nsf);
- return NULL;
- }
-
- return temp_nsf;
-}
-
-/* Free an NSF */
-void nsf_free(nsf_t **nsf)
-{
- if (*nsf)
- {
- if ((*nsf)->apu)
- apu_destroy((*nsf)->apu);
-
- nes_shutdown(*nsf);
-
- if ((*nsf)->data)
- free((*nsf)->data);
-
- free(*nsf);
- }
-}
-
-void nsf_setchan(nsf_t *nsf, int chan, boolean enabled)
-{
- if (nsf)
- {
- nsf_setcontext(nsf);
- apu_setchan(chan, enabled);
- }
-}
-
-void nsf_playtrack(nsf_t *nsf, int track, int sample_rate, int sample_bits, boolean stereo)
-{
- ASSERT(nsf);
-
- /* make this NSF the current context */
- nsf_setcontext(nsf);
-
- /* create the APU */
- if (nsf->apu)
- apu_destroy(nsf->apu);
-
- nsf->apu = apu_create(sample_rate, nsf->playback_rate, sample_bits, stereo);
- if (NULL == nsf->apu)
- {
- nsf_free(&nsf);
- return;
- }
-
- apu_setext(nsf->apu, nsf_getext(nsf));
-
- /* go ahead and init all the read/write handlers */
- build_address_handlers(nsf);
-
- /* convenience? */
- nsf->process = nsf->apu->process;
-
- nes6502_setcontext(nsf->cpu);
-
- if (track > nsf->num_songs)
- track = nsf->num_songs;
- else if (track < 1)
- track = 1;
-
- nsf->current_song = track;
-
- apu_reset();
-
- nsf_inittune(nsf);
-}
-
-void nsf_setfilter(nsf_t *nsf, int filter_type)
-{
- if (nsf)
- {
- nsf_setcontext(nsf);
- apu_setfilter(filter_type);
- }
-}
-
-/*
-** $Log: nsf.c,v $
-** Revision 1.4 2006/09/26 00:52:17 dgp85
-** Free the filename string and close the file pointer when returning.
-**
-** Found by Coverity Scan.
-**
-** Revision 1.3 2003/08/25 21:51:43 f1rmb
-** Reduce GCC verbosity (various prototype declaration fixes). ffmpeg, wine and fft*post are untouched (fft: for now).
-**
-** Revision 1.2 2003/01/09 18:36:40 jkeil
-** memcpy copies too much, corrupts malloc heap
-**
-** Revision 1.1 2003/01/08 07:04:35 tmmm
-** initial import of Nosefart sources
-**
-** Revision 1.14 2000/07/05 14:54:45 matt
-** fix for naughty Crystalis rip
-**
-** Revision 1.13 2000/07/04 04:59:38 matt
-** removed DOS-specific stuff, fixed bug in address handlers
-**
-** Revision 1.12 2000/07/03 02:19:36 matt
-** dynamic address range handlers, cleaner and faster
-**
-** Revision 1.11 2000/06/23 03:27:58 matt
-** cleaned up external sound inteface
-**
-** Revision 1.10 2000/06/20 20:42:47 matt
-** accuracy changes
-**
-** Revision 1.9 2000/06/20 00:05:58 matt
-** changed to driver-based external sound generation
-**
-** Revision 1.8 2000/06/13 03:51:54 matt
-** update API to take freq/sample data on nsf_playtrack
-**
-** Revision 1.7 2000/06/12 03:57:14 matt
-** more robust checking for winamp plugin
-**
-** Revision 1.6 2000/06/12 01:13:00 matt
-** added CPU/APU as members of the nsf struct
-**
-** Revision 1.5 2000/06/11 16:09:21 matt
-** nsf_free is more robust
-**
-** Revision 1.4 2000/06/09 15:12:26 matt
-** initial revision
-**
-*/
diff --git a/src/libxineadec/nosefart/nsf.h b/src/libxineadec/nosefart/nsf.h
deleted file mode 100644
index 163e2f62f..000000000
--- a/src/libxineadec/nosefart/nsf.h
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
-** Nofrendo (c) 1998-2000 Matthew Conte (matt@conte.com)
-**
-**
-** This program is free software; you can redistribute it and/or
-** modify it under the terms of version 2 of the GNU Library General
-** Public License as published by the Free Software Foundation.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-** Library General Public License for more details. To obtain a
-** copy of the GNU Library General Public License, write to the Free
-** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-**
-** Any permitted reproduction of these routines, in whole or in part,
-** must bear this legend.
-**
-**
-** nsf.h
-**
-** NSF loading/saving related defines / prototypes
-** $Id: nsf.h,v 1.3 2007/01/18 21:34:10 dgp85 Exp $
-*/
-
-#ifndef _NSF_H_
-#define _NSF_H_
-
-#include "osd.h"
-#include "nes6502.h"
-#include "nes_apu.h"
-
-#define NSF_MAGIC "NESM\x1A"
-
-#define NSF_DEDICATED_PAL 0x01
-#define NSF_DUAL_PAL_NTSC 0x02
-
-#define EXT_SOUND_NONE 0x00
-#define EXT_SOUND_VRCVI 0x01
-#define EXT_SOUND_VRCVII 0x02
-#define EXT_SOUND_FDS 0x04
-#define EXT_SOUND_MMC5 0x08
-#define EXT_SOUND_NAMCO106 0x10
-#define EXT_SOUND_SUNSOFT_FME07 0x20
-/* bits 6,7: future expansion */
-
-#define NSF_HEADER_SIZE 0x80
-
-/* 60 Hertz refresh (NTSC) */
-#define NES_MASTER_CLOCK 21477272.7272
-#define NTSC_REFRESH 60
-#define NTSC_SUBCARRIER_DIV 12
-#define NTSC_SCANLINES 262
-
-#define NES_FRAME_CYCLES ((NES_MASTER_CLOCK / NTSC_SUBCARRIER_DIV) / NTSC_REFRESH)
-#define NES_SCANLINE_CYCLES (NES_FRAME_CYCLES / NTSC_SCANLINES)
-
-/* filter levels */
-enum
-{
- NSF_FILTER_NONE,
- NSF_FILTER_LOWPASS,
- NSF_FILTER_WEIGHTED
-};
-
-typedef struct nsf_s
-{
- /* NESM header */
- uint8 id[5]; /* NESM\x1A */
- uint8 version; /* spec version */
- uint8 num_songs; /* total num songs */
- uint8 start_song; /* first song */
- uint16 load_addr; /* loc to load code */
- uint16 init_addr; /* init call address */
- uint16 play_addr; /* play call address */
- uint8 song_name[32]; /* name of song */
- uint8 artist_name[32]; /* artist name */
- uint8 copyright[32]; /* copyright info */
- uint16 ntsc_speed; /* playback speed (if NTSC) */
- uint8 bankswitch_info[8]; /* initial code banking */
- uint16 pal_speed; /* playback speed (if PAL) */
- uint8 pal_ntsc_bits; /* NTSC/PAL determination bits */
- uint8 ext_sound_type; /* type of external sound gen. */
- uint8 reserved[4]; /* reserved */
-
- /* things that the NSF player needs */
- uint8 *data; /* actual NSF data */
- uint32 length; /* length of data */
- uint32 playback_rate; /* current playback rate */
- uint8 current_song; /* current song */
- boolean bankswitched; /* is bankswitched? */
-
- /* CPU and APU contexts */
- nes6502_context *cpu;
- apu_t *apu;
-
- /* our main processing routine, calls all external mixing routines */
- void (*process)(void *buffer, int num_samples);
-} __PACKED__ nsf_t;
-
-/* Function prototypes */
-extern void nsf_init(void);
-
-extern nsf_t *nsf_load(char *filename, void *source, int length);
-extern void nsf_free(nsf_t **nsf_info);
-
-extern void nsf_playtrack(nsf_t *nsf, int track, int sample_rate, int sample_bits,
- boolean stereo);
-extern void nsf_frame(nsf_t *nsf);
-extern void nsf_setchan(nsf_t *nsf, int chan, boolean enabled);
-extern void nsf_setfilter(nsf_t *nsf, int filter_type);
-
-#endif /* _NSF_H_ */
-
-/*
-** $Log: nsf.h,v $
-** Revision 1.3 2007/01/18 21:34:10 dgp85
-** __attribute__(packed) is used on the struct, not on its members.
-**
-** Revision 1.2 2003/12/05 15:55:01 f1rmb
-** cleanup phase II. use xprintf when it's relevant, use xine_xmalloc when it's relevant too. Small other little fix (can't remember). Change few internal function prototype because it xine_t pointer need to be used if some xine's internal sections. NOTE: libdvd{nav,read} is still too noisy, i will take a look to made it quit, without invasive changes. To be continued...
-**
-** Revision 1.1 2003/01/08 07:04:35 tmmm
-** initial import of Nosefart sources
-**
-** Revision 1.11 2000/07/04 04:59:24 matt
-** removed DOS-specific stuff
-**
-** Revision 1.10 2000/07/03 02:19:36 matt
-** dynamic address range handlers, cleaner and faster
-**
-** Revision 1.9 2000/06/23 03:27:58 matt
-** cleaned up external sound inteface
-**
-** Revision 1.8 2000/06/20 04:04:37 matt
-** moved external soundchip struct to apu module
-**
-** Revision 1.7 2000/06/20 00:05:45 matt
-** changed to driver-based external sound generation
-**
-** Revision 1.6 2000/06/13 03:51:54 matt
-** update API to take freq/sample data on nsf_playtrack
-**
-** Revision 1.5 2000/06/12 01:13:00 matt
-** added CPU/APU as members of the nsf struct
-**
-** Revision 1.4 2000/06/09 15:12:26 matt
-** initial revision
-**
-*/
diff --git a/src/libxineadec/nosefart/osd.h b/src/libxineadec/nosefart/osd.h
deleted file mode 100644
index ee90aa972..000000000
--- a/src/libxineadec/nosefart/osd.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
-** Nofrendo (c) 1998-2000 Matthew Conte (matt@conte.com)
-**
-**
-** This program is free software; you can redistribute it and/or
-** modify it under the terms of version 2 of the GNU Library General
-** Public License as published by the Free Software Foundation.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-** Library General Public License for more details. To obtain a
-** copy of the GNU Library General Public License, write to the Free
-** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-**
-** Any permitted reproduction of these routines, in whole or in part,
-** must bear this legend.
-**
-**
-** osd.h
-**
-** O/S dependent routine defintions (must be customized)
-** $Id: osd.h,v 1.2 2003/07/12 12:31:14 mroi Exp $
-*/
-
-#ifndef _OSD_H_
-#define _OSD_H_
-
-
-#if defined(__GNUC__) || defined(__ICC)
-#define __PACKED__ __attribute__ ((packed))
-#define PATH_SEP '/'
-#ifdef __DJGPP__
-#include <dpmi.h>
-#include "dos_ints.h"
-#endif
-#elif defined(WIN32)
-#define __PACKED__
-#define PATH_SEP '\\'
-#else /* crapintosh? */
-#define __PACKED__
-#define PATH_SEP ':'
-#endif
-
-extern void osd_loginit(void);
-extern void osd_logshutdown(void);
-extern void osd_logprint(const char *string);
-
-extern int osd_startsound(void (*playfunc)(void *buffer, int size));
-extern int osd_getsoundbps(void);
-extern int osd_getsamplerate(void);
-
-
-#ifndef NSF_PLAYER
-#include "rgb.h"
-#include "bitmap.h"
-
-extern bitmap_t *osd_getvidbuf(void);
-typedef void (*blitproc_t)(bitmap_t *bmp, int x_pos, int y_pos, int width, int height);
-extern blitproc_t osd_blit;
-extern void osd_copytoscreen(void);
-
-extern void osd_showusage(char *filename);
-extern void osd_fullname(char *fullname, const char *shortname);
-extern char *osd_newextension(char *string, char *ext);
-
-extern void osd_setpalette(rgb_t *pal);
-extern void osd_restorepalette(void);
-
-extern void osd_getinput(void);
-extern int osd_gethostinput(void);
-extern void osd_getmouse(int *x, int *y, int *button);
-
-extern int osd_init(void);
-extern void osd_shutdown(void);
-#endif /* !NSF_PLAYER */
-
-#endif /* _OSD_H_ */
-
-/*
-** $Log: osd.h,v $
-** Revision 1.2 2003/07/12 12:31:14 mroi
-** - adding support for the Intel compiler icc
-** - general multipass compilation make targets
-**
-** Revision 1.1 2003/01/08 07:04:35 tmmm
-** initial import of Nosefart sources
-**
-** Revision 1.7 2000/07/04 04:45:33 matt
-** moved INLINE define into types.h
-**
-** Revision 1.6 2000/06/29 16:06:18 neil
-** Wrapped DOS-specific headers in an ifdef
-**
-** Revision 1.5 2000/06/09 15:12:25 matt
-** initial revision
-**
-*/
diff --git a/src/libxineadec/nosefart/types.h b/src/libxineadec/nosefart/types.h
deleted file mode 100644
index 01f196035..000000000
--- a/src/libxineadec/nosefart/types.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
-** Nofrendo (c) 1998-2000 Matthew Conte (matt@conte.com)
-**
-**
-** This program is free software; you can redistribute it and/or
-** modify it under the terms of version 2 of the GNU Library General
-** Public License as published by the Free Software Foundation.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-** Library General Public License for more details. To obtain a
-** copy of the GNU Library General Public License, write to the Free
-** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-**
-** Any permitted reproduction of these routines, in whole or in part,
-** must bear this legend.
-**
-**
-** types.h
-**
-** Data type definitions
-** $Id: types.h,v 1.4 2004/08/27 19:33:37 valtri Exp $
-*/
-
-#ifndef _NOSEFART_TYPES_H_
-#define _NOSEFART_TYPES_H_
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-/* Define this if running on little-endian (x86) systems */
-#ifdef WORDS_BIGENDIAN
-#undef HOST_LITTLE_ENDIAN
-#else
-#define HOST_LITTLE_ENDIAN
-#endif
-
-#ifdef __GNUC__
-#define INLINE static inline
-#elif defined(WIN32)
-#define INLINE static __inline
-#else /* crapintosh? */
-#define INLINE static
-#endif
-
-/* These should be changed depending on the platform */
-typedef char int8;
-typedef short int16;
-typedef int int32;
-
-typedef unsigned char uint8;
-typedef unsigned short uint16;
-typedef unsigned int uint32;
-
-typedef uint8 boolean;
-
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-#ifndef NULL
-#define NULL ((void *) 0)
-#endif
-
-#ifdef NOFRENDO_DEBUG
-#include <stdlib.h>
-#include "memguard.h"
-#include "log.h"
-#define ASSERT(expr) if (FALSE == (expr))\
- {\
- log_printf("ASSERT: line %d of %s\n", __LINE__, __FILE__);\
- log_shutdown();\
- exit(1);\
- }
-#define ASSERT_MSG(msg) {\
- log_printf("ASSERT: %s\n", msg);\
- log_shutdown();\
- exit(1);\
- }
-#else /* Not debugging */
-#include "memguard.h"
-#define ASSERT(expr)
-#define ASSERT_MSG(msg)
-#endif
-
-#endif /* _NOSEFART_TYPES_H_ */
-
-/*
-** $Log: types.h,v $
-** Revision 1.4 2004/08/27 19:33:37 valtri
-** MINGW32 port. Engine library and most of plugins compiles now.
-**
-** List of some changes:
-** - replaced some _MSC_VER by more common WIN32
-** - define INTLDIR, remove -static flag for included intl
-** - shared more common CFLAGS with DEBUG_CFLAGS
-** - use WIN32_CFLAGS for all building
-** - separate some flags into THREAD_CFLAGS_CONFIG,
-** THREAD_CFLAGS_CONFIG and ZLIB_LIB_CONFIG for public xine-config,
-** automatically use internal libs if necessary
-** - don't warn about missing X for mingw and cygwin
-** - libw32dll disabled for WIN32 (making native loader would be
-** interesting, or porting wine code to Windows? :->)
-** - DVB and RTP disabled for WIN32, not ported yet
-** - fix build and fix a warning in cdda
-** - fix build for nosefart and libfaad
-** - implement configure option --disable-freetype
-** - sync libxine.pc and xine-config.in
-** - add -liberty to goom under WIN32
-** - move original build files from included phread and zlib into archives
-** and replace them by autotools
-**
-** Revision 1.3 2003/01/11 15:53:53 tmmm
-** make the Nosefart engine aware of the config's WORDS_BIGENDIAN #define
-**
-** Revision 1.2 2003/01/09 19:50:04 jkeil
-** NSF audio files were crashing on SPARC.
-**
-** - Define the correct HOST_ENDIAN for SPARC
-** - remove unaligned memory accesses
-**
-** Revision 1.1 2003/01/08 07:04:36 tmmm
-** initial import of Nosefart sources
-**
-** Revision 1.7 2000/07/04 04:46:44 matt
-** moved INLINE define from osd.h
-**
-** Revision 1.6 2000/06/09 15:12:25 matt
-** initial revision
-**
-*/
diff --git a/src/libxineadec/nosefart/version.h b/src/libxineadec/nosefart/version.h
deleted file mode 100644
index d7dcb2e5d..000000000
--- a/src/libxineadec/nosefart/version.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
-** Nofrendo (c) 1998-2000 Matthew Conte (matt@conte.com)
-**
-**
-** This program is free software; you can redistribute it and/or
-** modify it under the terms of version 2 of the GNU Library General
-** Public License as published by the Free Software Foundation.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-** Library General Public License for more details. To obtain a
-** copy of the GNU Library General Public License, write to the Free
-** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-**
-** Any permitted reproduction of these routines, in whole or in part,
-** must bear this legend.
-**
-**
-** version.h
-**
-** Program name / version definitions
-** $Id: version.h,v 1.2 2003/12/05 15:55:01 f1rmb Exp $
-*/
-
-#ifndef _VERSION_H_
-#define _VERSION_H_
-
-#ifdef NSF_PLAYER
-#define APP_STRING "Nosefart"
-#else
-#define APP_STRING "Nofrendo"
-#endif /* NSF_PLAYER */
-
-#define APP_VERSION "1.92"
-
-#endif /* _VERSION_H_ */
-
-/*
-** $Log: version.h,v $
-** Revision 1.2 2003/12/05 15:55:01 f1rmb
-** cleanup phase II. use xprintf when it's relevant, use xine_xmalloc when it's relevant too. Small other little fix (can't remember). Change few internal function prototype because it xine_t pointer need to be used if some xine's internal sections. NOTE: libdvd{nav,read} is still too noisy, i will take a look to made it quit, without invasive changes. To be continued...
-**
-** Revision 1.1 2003/01/08 07:04:36 tmmm
-** initial import of Nosefart sources
-**
-** Revision 1.7 2000/07/04 04:46:55 matt
-** updated version number
-**
-** Revision 1.6 2000/06/20 00:03:39 matt
-** updated for 1.91
-**
-** Revision 1.5 2000/06/09 17:01:56 matt
-** changed version to 1.90
-**
-** Revision 1.4 2000/06/09 15:12:25 matt
-** initial revision
-**
-*/
diff --git a/src/libxineadec/nosefart/vrc7_snd.c b/src/libxineadec/nosefart/vrc7_snd.c
deleted file mode 100644
index 42cff0103..000000000
--- a/src/libxineadec/nosefart/vrc7_snd.c
+++ /dev/null
@@ -1,347 +0,0 @@
-/*
-** Nofrendo (c) 1998-2000 Matthew Conte (matt@conte.com)
-**
-**
-** This program is free software; you can redistribute it and/or
-** modify it under the terms of version 2 of the GNU Library General
-** Public License as published by the Free Software Foundation.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-** Library General Public License for more details. To obtain a
-** copy of the GNU Library General Public License, write to the Free
-** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-**
-** Any permitted reproduction of these routines, in whole or in part,
-** must bear this legend.
-**
-**
-** vrc7_snd.c
-**
-** VRCVII sound hardware emulation
-** Thanks to Charles MacDonald (cgfm2@hooked.net) for donating code.
-** $Id: vrc7_snd.c,v 1.2 2003/12/05 15:55:01 f1rmb Exp $
-*/
-
-#include <stdio.h>
-#include "types.h"
-#include "vrc7_snd.h"
-#include "fmopl.h"
-
-
-static int buflen;
-static int16 *buffer;
-
-#define OPL_WRITE(opl, r, d) \
-{ \
- OPLWrite((opl)->ym3812, 0, (r)); \
- OPLWrite((opl)->ym3812, 1, (d)); \
-}
-
-static vrc7_t vrc7;
-
-/* Fixed instrument settings, from MAME's YM2413 emulation */
-/* This might need some tweaking... */
-unsigned char table[16][11] =
-{
- /* 20 23 40 43 60 63 80 83 E0 E3 C0 */
- { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
-
- /* MAME */
- { 0x01, 0x22, 0x23, 0x07, 0xF0, 0xF0, 0x07, 0x18, 0x00, 0x00, 0x00 }, /* Violin */
- { 0x23, 0x01, 0x68, 0x05, 0xF2, 0x74, 0x6C, 0x89, 0x00, 0x00, 0x00 }, /* Acoustic Guitar(steel) */
- { 0x13, 0x11, 0x25, 0x00, 0xD2, 0xB2, 0xF4, 0xF4, 0x00, 0x00, 0x00 }, /* Acoustic Grand */
- { 0x22, 0x21, 0x1B, 0x05, 0xC0, 0xA1, 0x18, 0x08, 0x00, 0x00, 0x00 }, /* Flute */
- { 0x22, 0x21, 0x2C, 0x03, 0xD2, 0xA1, 0x18, 0x57, 0x00, 0x00, 0x00 }, /* Clarinet */
- { 0x01, 0x22, 0xBA, 0x01, 0xF1, 0xF1, 0x1E, 0x04, 0x00, 0x00, 0x00 }, /* Oboe */
- { 0x21, 0x21, 0x28, 0x06, 0xF1, 0xF1, 0x6B, 0x3E, 0x00, 0x00, 0x00 }, /* Trumpet */
- { 0x27, 0x21, 0x60, 0x00, 0xF0, 0xF0, 0x0D, 0x0F, 0x00, 0x00, 0x00 }, /* Church Organ */
- { 0x20, 0x21, 0x2B, 0x06, 0x85, 0xF1, 0x6D, 0x89, 0x00, 0x00, 0x00 }, /* French Horn */
- { 0x01, 0x21, 0xBF, 0x02, 0x53, 0x62, 0x5F, 0xAE, 0x01, 0x00, 0x00 }, /* Synth Voice */
- { 0x23, 0x21, 0x70, 0x07, 0xD4, 0xA3, 0x4E, 0x64, 0x01, 0x00, 0x00 }, /* Harpsichord */
- { 0x2B, 0x21, 0xA4, 0x07, 0xF6, 0x93, 0x5C, 0x4D, 0x00, 0x00, 0x00 }, /* Vibraphone */
- { 0x21, 0x23, 0xAD, 0x07, 0x77, 0xF1, 0x18, 0x37, 0x00, 0x00, 0x00 }, /* Synth Bass 1 */
- { 0x21, 0x21, 0x2A, 0x03, 0xF3, 0xE2, 0x29, 0x46, 0x00, 0x00, 0x00 }, /* Acoustic Bass */
- { 0x21, 0x23, 0x37, 0x03, 0xF3, 0xE2, 0x29, 0x46, 0x00, 0x00, 0x00 }, /* Electric Guitar(clean) */
-
-
-#if 0
- /* Horton, try 1 */
- { 0x05, 0x03, 0x10, 0x06, 0x74, 0xA1, 0x13, 0xF4, 0x00, 0x00, 0x00 },
- { 0x05, 0x01, 0x16, 0x00, 0xF9, 0xA2, 0x15, 0xF5, 0x00, 0x00, 0x00 },
- { 0x01, 0x41, 0x11, 0x00, 0xA0, 0xA0, 0x83, 0x95, 0x00, 0x00, 0x00 },
- { 0x01, 0x41, 0x17, 0x00, 0x60, 0xF0, 0x83, 0x95, 0x00, 0x00, 0x00 },
- { 0x24, 0x41, 0x1F, 0x00, 0x50, 0xB0, 0x94, 0x94, 0x00, 0x00, 0x00 },
- { 0x05, 0x01, 0x0B, 0x04, 0x65, 0xA0, 0x54, 0x95, 0x00, 0x00, 0x00 },
- { 0x11, 0x41, 0x0E, 0x04, 0x70, 0xC7, 0x13, 0x10, 0x00, 0x00, 0x00 },
- { 0x02, 0x44, 0x16, 0x06, 0xE0, 0xE0, 0x31, 0x35, 0x00, 0x00, 0x00 },
- { 0x48, 0x22, 0x22, 0x07, 0x50, 0xA1, 0xA5, 0xF4, 0x00, 0x00, 0x00 },
- { 0x05, 0xA1, 0x18, 0x00, 0xA2, 0xA2, 0xF5, 0xF5, 0x00, 0x00, 0x00 },
- { 0x07, 0x81, 0x2B, 0x05, 0xA5, 0xA5, 0x03, 0x03, 0x00, 0x00, 0x00 },
- { 0x01, 0x41, 0x08, 0x08, 0xA0, 0xA0, 0x83, 0x95, 0x00, 0x00, 0x00 },
- { 0x21, 0x61, 0x12, 0x00, 0x93, 0x92, 0x74, 0x75, 0x00, 0x00, 0x00 },
- { 0x21, 0x62, 0x21, 0x00, 0x84, 0x85, 0x34, 0x15, 0x00, 0x00, 0x00 },
- { 0x21, 0x62, 0x0E, 0x00, 0xA1, 0xA0, 0x34, 0x15, 0x00, 0x00, 0x00 },
-#endif
-
-#if 0
- /* Horton try 2 */
- { 0x31, 0x22, 0x23, 0x07, 0xF0, 0xF0, 0xE8, 0xF7, 0x00, 0x00, 0x00 },
- { 0x03, 0x31, 0x68, 0x05, 0xF2, 0x74, 0x79, 0x9C, 0x00, 0x00, 0x00 },
- { 0x01, 0x51, 0x72, 0x04, 0xF1, 0xD3, 0x9D, 0x8B, 0x00, 0x00, 0x00 },
- { 0x22, 0x61, 0x1B, 0x05, 0xC0, 0xA1, 0xF8, 0xE8, 0x00, 0x00, 0x00 },
- { 0x22, 0x61, 0x2C, 0x03, 0xD2, 0xA1, 0xA7, 0xE8, 0x00, 0x00, 0x00 },
- { 0x31, 0x22, 0xFA, 0x01, 0xF1, 0xF1, 0xF4, 0xEE, 0x00, 0x00, 0x00 },
- { 0x21, 0x61, 0x28, 0x06, 0xF1, 0xF1, 0xCE, 0x9B, 0x00, 0x00, 0x00 },
- { 0x27, 0x61, 0x60, 0x00, 0xF0, 0xF0, 0xFF, 0xFD, 0x00, 0x00, 0x00 },
- { 0x60, 0x21, 0x2B, 0x06, 0x85, 0xF1, 0x79, 0x9D, 0x00, 0x00, 0x00 },
- { 0x31, 0xA1, 0xFF, 0x0A, 0x53, 0x62, 0x5E, 0xAF, 0x00, 0x00, 0x00 },
- { 0x03, 0xA1, 0x70, 0x0F, 0xD4, 0xA3, 0x94, 0xBE, 0x00, 0x00, 0x00 },
- { 0x2B, 0x61, 0xE4, 0x07, 0xF6, 0x93, 0xBD, 0xAC, 0x00, 0x00, 0x00 },
- { 0x21, 0x63, 0xED, 0x07, 0x77, 0xF1, 0xC7, 0xE8, 0x00, 0x00, 0x00 },
- { 0x21, 0x61, 0x2A, 0x03, 0xF3, 0xE2, 0xB6, 0xD9, 0x00, 0x00, 0x00 },
- { 0x21, 0x63, 0x37, 0x03, 0xF3, 0xE2, 0xB6, 0xD9, 0x00, 0x00, 0x00 },
-#endif
-};
-
-static void vrc7_reset(void)
-{
- int n;
-
- /* Point to current VRC7 context */
- vrc7_t *opll = &vrc7;
-
- /* Clear all YM3812 registers */
- for (n = 0; n < 0x100; n++)
- OPL_WRITE(opll, n, 0x00);
-
- /* Turn off rhythm mode and key-on bits */
- OPL_WRITE(opll, 0xBD, 0xC0);
-
- /* Enable waveform select */
- OPL_WRITE(opll, 0x01, 0x20);
-}
-
-static void vrc7_init(void)
-{
- vrc7.ym3812 = OPLCreate(OPL_TYPE_YM3812, 3579545, apu_getcontext()->sample_rate);
- ASSERT(vrc7.ym3812);
- buflen = apu_getcontext()->num_samples;
- buffer = malloc(buflen * 2);
- ASSERT(buffer);
- vrc7_reset();
-}
-
-static void vrc7_shutdown(void)
-{
- vrc7_reset();
- OPLDestroy(vrc7.ym3812);
- free(buffer);
-}
-
-/* channel (0-9), instrument (0-F), volume (0-3F, YM3812 format) */
-static void load_instrument(uint8 ch, uint8 inst, uint8 vol)
-{
- /* Point to current VRC7 context */
- vrc7_t *opll = &vrc7;
-
- /* Point to fixed instrument or user table */
- uint8 *param = (inst == 0) ? &opll->user[0] : &table[inst][0];
-
- /* Maps channels to operator registers */
- uint8 ch2op[] = {0, 1, 2, 8, 9, 10, 16, 17, 18};
-
- /* Make operator offset from requested channel */
- uint8 op = ch2op[ch];
-
- /* Store volume level */
- opll->channel[ch].volume = (vol & 0x3F);
-
- /* Store instrument number */
- opll->channel[ch].instrument = (inst & 0x0F);
-
- /* Update instrument settings, except frequency registers */
- OPL_WRITE(opll, 0x20 + op, param[0]);
- OPL_WRITE(opll, 0x23 + op, param[1]);
- OPL_WRITE(opll, 0x40 + op, param[2]);
- OPL_WRITE(opll, 0x43 + op, (param[3] & 0xC0) | opll->channel[ch].volume);
- OPL_WRITE(opll, 0x60 + op, param[4]);
- OPL_WRITE(opll, 0x63 + op, param[5]);
- OPL_WRITE(opll, 0x80 + op, param[6]);
- OPL_WRITE(opll, 0x83 + op, param[7]);
- OPL_WRITE(opll, 0xE0 + op, param[8]);
- OPL_WRITE(opll, 0xE3 + op, param[9]);
- OPL_WRITE(opll, 0xC0 + ch, param[10]);
-}
-
-static void vrc7_write(uint32 address, uint8 data)
-{
- /* Point to current VRC7 context */
- vrc7_t *opll = &vrc7;
-
- if (address & 0x0020) /* data port */
- {
- /* Store register data */
- opll->reg[opll->latch] = data;
-
- switch (opll->latch & 0x30)
- {
- case 0x00: /* User instrument registers */
- switch (opll->latch & 0x0F)
- {
- case 0x00: /* Misc. ctrl. (modulator) */
- case 0x01: /* Misc. ctrl. (carrier) */
- case 0x02: /* Key scale level and total level (modulator) */
- case 0x04: /* Attack / Decay (modulator) */
- case 0x05: /* Attack / Decay (carrier) */
- case 0x06: /* Sustain / Release (modulator) */
- case 0x07: /* Sustain / Release (carrier) */
- opll->user[(opll->latch & 0x07)] = data;
- break;
-
- case 0x03: /* Key scale level, carrier/modulator waveform, feedback */
-
- /* Key scale level (carrier) */
- /* Don't touch the total level (channel volume) */
- opll->user[3] = (opll->user[3] & 0x3F) | (data & 0xC0);
-
- /* Waveform select for the modulator */
- opll->user[8] = (data >> 3) & 1;
-
- /* Waveform select for the carrier */
- opll->user[9] = (data >> 4) & 1;
-
- /* Store feedback level in YM3812 format */
- opll->user[10] = ((data & 0x07) << 1) & 0x0E;
- break;
- }
-
- /* If the user instrument registers were accessed, then
- go through each channel and update the ones that were
- currently using the user instrument. We can skip the
- last three channels in rhythm mode since they can
- only use percussion sounds anyways. */
- if (opll->latch <= 0x05)
- {
- uint8 x;
-
- for (x = 0; x < 6; x++)
- if (opll->channel[x].instrument == 0x00)
- load_instrument(x, 0x00, opll->channel[x].volume);
- }
- break;
-
- case 0x10: /* Channel Frequency (LSB) */
- case 0x20: /* Channel Frequency (MSB) + key-on and sustain control */
- {
- uint8 block;
- uint16 frequency;
- uint8 ch = (opll->latch & 0x0F);
-
- /* Ensure proper channel range */
- if (ch > 0x05)
- break;
-
- /* Get VRC7 channel frequency */
- frequency = ((opll->reg[0x10 + ch] & 0xFF) | ((opll->reg[0x20 + ch] & 0x01) << 8));
-
- /* Scale 9 bit frequency to 10 bits */
- frequency = (frequency << 1) & 0x1FFF;
-
- /* Get VRC7 block */
- block = (opll->reg[0x20 + ch] >> 1) & 7;
-
- /* Add in block */
- frequency |= (block << 10);
-
- /* Add key-on flag */
- if (opll->reg[0x20 + ch] & 0x10)
- frequency |= 0x2000;
-
- /* Save current frequency/block/key-on setting */
- opll->channel[ch].frequency = (frequency & 0x3FFF);
-
- /* Write changes to YM3812 */
- OPL_WRITE(opll, 0xA0 + ch, (opll->channel[ch].frequency >> 0) & 0xFF);
- OPL_WRITE(opll, 0xB0 + ch, (opll->channel[ch].frequency >> 8) & 0xFF);
- }
- break;
-
- case 0x30: /* Channel Volume Level and Instrument Select */
-
- /* Ensure proper channel range */
- if (opll->latch > 0x35)
- break;
-
- {
- uint8 ch = (opll->latch & 0x0F);
- uint8 inst = (data >> 4) & 0x0F;
- uint8 vol = (data & 0x0F) << 2;
- load_instrument(ch, inst, vol);
- }
-
- break;
- }
- }
- else /* Register latch */
- {
- opll->latch = (data & 0x3F);
- }
-}
-
-static int32 vrc7_process(void)
-{
- static int sample = 0;
-
- /* update a large chunk at once */
- if (sample >= buflen)
- {
- sample -= buflen;
- YM3812UpdateOne(vrc7.ym3812, buffer, buflen);
- }
-
- return (int32) ((int16 *) buffer)[sample++];
-}
-
-static apu_memwrite vrc7_memwrite[] =
-{
- { 0x9010, 0x9010, vrc7_write },
- { 0x9030, 0x9030, vrc7_write },
- { -1, -1, NULL }
-};
-
-apuext_t vrc7_ext =
-{
- vrc7_init,
- vrc7_shutdown,
- vrc7_reset,
- vrc7_process,
- NULL, /* no reads */
- vrc7_memwrite
-};
-
-/*
-** $Log: vrc7_snd.c,v $
-** Revision 1.2 2003/12/05 15:55:01 f1rmb
-** cleanup phase II. use xprintf when it's relevant, use xine_xmalloc when it's relevant too. Small other little fix (can't remember). Change few internal function prototype because it xine_t pointer need to be used if some xine's internal sections. NOTE: libdvd{nav,read} is still too noisy, i will take a look to made it quit, without invasive changes. To be continued...
-**
-** Revision 1.1 2003/01/08 07:04:36 tmmm
-** initial import of Nosefart sources
-**
-** Revision 1.5 2000/07/04 04:51:02 matt
-** made data types stricter
-**
-** Revision 1.4 2000/07/03 02:18:53 matt
-** much better external module exporting
-**
-** Revision 1.3 2000/06/20 20:45:09 matt
-** minor cleanups
-**
-** Revision 1.2 2000/06/20 04:06:16 matt
-** migrated external sound definition to apu module
-**
-** Revision 1.1 2000/06/20 00:06:47 matt
-** initial revision
-**
-*/
diff --git a/src/libxineadec/nosefart/vrc7_snd.h b/src/libxineadec/nosefart/vrc7_snd.h
deleted file mode 100644
index fd3880b63..000000000
--- a/src/libxineadec/nosefart/vrc7_snd.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
-** Nofrendo (c) 1998-2000 Matthew Conte (matt@conte.com)
-**
-**
-** This program is free software; you can redistribute it and/or
-** modify it under the terms of version 2 of the GNU Library General
-** Public License as published by the Free Software Foundation.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-** Library General Public License for more details. To obtain a
-** copy of the GNU Library General Public License, write to the Free
-** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-**
-** Any permitted reproduction of these routines, in whole or in part,
-** must bear this legend.
-**
-**
-** vrc7_snd.h
-**
-** VRCVII (Konami MMC) sound hardware emulation header
-** Thanks to Charles MacDonald (cgfm2@hooked.net) for donating code.
-**
-** $Id: vrc7_snd.h,v 1.1 2003/01/08 07:04:36 tmmm Exp $
-*/
-
-#ifndef _VRC7_SND_H_
-#define _VRC7_SND_H_
-
-#include "fmopl.h"
-
-/* VRC7 context */
-typedef struct vrc7_s
-{
- uint8 reg[0x40]; /* 64 registers */
- uint8 latch; /* Register latch */
- uint8 user[0x10]; /* User instrument settings */
- struct
- {
- uint16 frequency; /* Channel frequency */
- uint8 volume; /* Channel volume */
- uint8 instrument; /* Channel instrument */
- } channel[9];
-
- FM_OPL *ym3812;
-} vrc7_t;
-
-
-#include "nes_apu.h"
-
-extern apuext_t vrc7_ext;
-
-#endif /* !_VRC7_SND_H_ */
-
-/*
-** $Log: vrc7_snd.h,v $
-** Revision 1.1 2003/01/08 07:04:36 tmmm
-** initial import of Nosefart sources
-**
-** Revision 1.3 2000/07/04 04:51:02 matt
-** made data types stricter
-**
-** Revision 1.2 2000/06/20 04:06:16 matt
-** migrated external sound definition to apu module
-**
-** Revision 1.1 2000/06/20 00:06:47 matt
-** initial revision
-**
-*/
diff --git a/src/libxineadec/nosefart/vrcvisnd.c b/src/libxineadec/nosefart/vrcvisnd.c
deleted file mode 100644
index b1f26fe52..000000000
--- a/src/libxineadec/nosefart/vrcvisnd.c
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
-** Nofrendo (c) 1998-2000 Matthew Conte (matt@conte.com)
-**
-**
-** This program is free software; you can redistribute it and/or
-** modify it under the terms of version 2 of the GNU Library General
-** Public License as published by the Free Software Foundation.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-** Library General Public License for more details. To obtain a
-** copy of the GNU Library General Public License, write to the Free
-** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-**
-** Any permitted reproduction of these routines, in whole or in part,
-** must bear this legend.
-**
-**
-** vrcvisnd.c
-**
-** VRCVI sound hardware emulation
-** $Id: vrcvisnd.c,v 1.2 2003/12/05 15:55:01 f1rmb Exp $
-*/
-
-#include "types.h"
-#include "vrcvisnd.h"
-#include "nes_apu.h"
-
-
-static vrcvisnd_t vrcvi;
-static int32 vrcvi_incsize;
-
-/* VRCVI rectangle wave generation */
-static int32 vrcvi_rectangle(vrcvirectangle_t *chan)
-{
- /* reg0: 0-3=volume, 4-6=duty cycle
- ** reg1: 8 bits of freq
- ** reg2: 0-3=high freq, 7=enable
- */
-
- chan->phaseacc -= vrcvi_incsize; /* # of clocks per wave cycle */
- while (chan->phaseacc < 0)
- {
- chan->phaseacc += chan->freq;
- chan->adder = (chan->adder + 1) & 0x0F;
- }
-
- /* return if not enabled */
- if (FALSE == chan->enabled)
- return 0;
-
- if (chan->adder < chan->duty_flip)
- return -(chan->volume);
- else
- return chan->volume;
-}
-
-/* VRCVI sawtooth wave generation */
-static int32 vrcvi_sawtooth(vrcvisawtooth_t *chan)
-{
- /* reg0: 0-5=phase accumulator bits
- ** reg1: 8 bits of freq
- ** reg2: 0-3=high freq, 7=enable
- */
-
- chan->phaseacc -= vrcvi_incsize; /* # of clocks per wav cycle */
- while (chan->phaseacc < 0)
- {
- chan->phaseacc += chan->freq;
- chan->output_acc += chan->volume;
-
- if (7 == ++chan->adder)
- {
- chan->adder = 0;
- chan->output_acc = 0;
- }
- }
-
- /* return if not enabled */
- if (FALSE == chan->enabled)
- return 0;
- else
- return (chan->output_acc >> 3) << 9;
-}
-
-/* mix vrcvi sound channels together */
-static int32 vrcvi_process(void)
-{
- int32 output;
-
- output = vrcvi_rectangle(&vrcvi.rectangle[0]);
- output += vrcvi_rectangle(&vrcvi.rectangle[1]);
- output += vrcvi_sawtooth(&vrcvi.saw);
-
- return output;
-}
-
-/* write to registers */
-static void vrcvi_write(uint32 address, uint8 value)
-{
- int chan;
-
- switch (address & 0xB003)
- {
- case 0x9000:
- case 0xA000:
- chan = (address >> 12) - 9;
- vrcvi.rectangle[chan].reg[0] = value;
- vrcvi.rectangle[chan].volume = (value & 0x0F) << 8;
- vrcvi.rectangle[chan].duty_flip = (value >> 4) + 1;
- break;
- case 0x9001:
- case 0xA001:
- chan = (address >> 12) - 9;
- vrcvi.rectangle[chan].reg[1] = value;
- vrcvi.rectangle[chan].freq = APU_TO_FIXED(((vrcvi.rectangle[chan].reg[2] & 0x0F) << 8) + value + 1);
- break;
- case 0x9002:
- case 0xA002:
- chan = (address >> 12) - 9;
- vrcvi.rectangle[chan].reg[2] = value;
- vrcvi.rectangle[chan].freq = APU_TO_FIXED(((value & 0x0F) << 8) + vrcvi.rectangle[chan].reg[1] + 1);
- vrcvi.rectangle[chan].enabled = (value & 0x80) ? TRUE : FALSE;
- break;
- case 0xB000:
- vrcvi.saw.reg[0] = value;
- vrcvi.saw.volume = value & 0x3F;
- break;
- case 0xB001:
- vrcvi.saw.reg[1] = value;
- vrcvi.saw.freq = APU_TO_FIXED((((vrcvi.saw.reg[2] & 0x0F) << 8) + value + 1) << 1);
- break;
- case 0xB002:
- vrcvi.saw.reg[2] = value;
- vrcvi.saw.freq = APU_TO_FIXED((((value & 0x0F) << 8) + vrcvi.saw.reg[1] + 1) << 1);
- vrcvi.saw.enabled = (value & 0x80) ? TRUE : FALSE;
- break;
- default:
- break;
- }
-}
-
-/* reset state of vrcvi sound channels */
-static void vrcvi_reset(void)
-{
- int i;
-
- /* preload regs */
- for (i = 0; i < 3; i++)
- {
- vrcvi_write(0x9000 + i, 0);
- vrcvi_write(0xA000 + i, 0);
- vrcvi_write(0xB000 + i, 0);
- }
-
- /* get the phase period from the apu */
- vrcvi_incsize = apu_getcyclerate();
-}
-
-static void vrcvi_dummy(void)
-{
-}
-
-static apu_memwrite vrcvi_memwrite[] =
-{
-// { 0x4040, 0x4092, ext_write }, /* FDS sound regs */
- { 0x9000, 0x9002, vrcvi_write }, /* vrc6 */
- { 0xA000, 0xA002, vrcvi_write },
- { 0xB000, 0xB002, vrcvi_write },
- { -1, -1, NULL }
-};
-
-apuext_t vrcvi_ext =
-{
- vrcvi_dummy, /* no init */
- vrcvi_dummy, /* no shutdown */
- vrcvi_reset,
- vrcvi_process,
- NULL, /* no reads */
- vrcvi_memwrite
-};
-
-/*
-** $Log: vrcvisnd.c,v $
-** Revision 1.2 2003/12/05 15:55:01 f1rmb
-** cleanup phase II. use xprintf when it's relevant, use xine_xmalloc when it's relevant too. Small other little fix (can't remember). Change few internal function prototype because it xine_t pointer need to be used if some xine's internal sections. NOTE: libdvd{nav,read} is still too noisy, i will take a look to made it quit, without invasive changes. To be continued...
-**
-** Revision 1.1 2003/01/08 07:04:36 tmmm
-** initial import of Nosefart sources
-**
-** Revision 1.9 2000/07/04 04:51:41 matt
-** cleanups
-**
-** Revision 1.8 2000/07/03 02:18:53 matt
-** much better external module exporting
-**
-** Revision 1.7 2000/06/20 04:06:16 matt
-** migrated external sound definition to apu module
-**
-** Revision 1.6 2000/06/20 00:08:58 matt
-** changed to driver based API
-**
-** Revision 1.5 2000/06/09 16:49:02 matt
-** removed all floating point from sound generation
-**
-** Revision 1.4 2000/06/09 15:12:28 matt
-** initial revision
-**
-*/
diff --git a/src/libxineadec/nosefart/vrcvisnd.h b/src/libxineadec/nosefart/vrcvisnd.h
deleted file mode 100644
index 7666fec0c..000000000
--- a/src/libxineadec/nosefart/vrcvisnd.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
-** Nofrendo (c) 1998-2000 Matthew Conte (matt@conte.com)
-**
-**
-** This program is free software; you can redistribute it and/or
-** modify it under the terms of version 2 of the GNU Library General
-** Public License as published by the Free Software Foundation.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-** Library General Public License for more details. To obtain a
-** copy of the GNU Library General Public License, write to the Free
-** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-**
-** Any permitted reproduction of these routines, in whole or in part,
-** must bear this legend.
-**
-**
-** vrcvisnd.h
-**
-** VRCVI (Konami MMC) sound hardware emulation header
-** $Id: vrcvisnd.h,v 1.2 2003/12/05 15:55:01 f1rmb Exp $
-*/
-
-#ifndef _VRCVISND_H_
-#define _VRCVISND_H_
-
-typedef struct vrcvirectangle_s
-{
- uint8 reg[3];
- int32 phaseacc;
- uint8 adder;
-
- int32 freq;
- int32 volume;
- uint8 duty_flip;
- boolean enabled;
-} vrcvirectangle_t;
-
-typedef struct vrcvisawtooth_s
-{
- uint8 reg[3];
- int32 phaseacc;
- uint8 adder;
- uint8 output_acc;
-
- int32 freq;
- uint8 volume;
- boolean enabled;
-} vrcvisawtooth_t;
-
-typedef struct vrcvisnd_s
-{
- vrcvirectangle_t rectangle[2];
- vrcvisawtooth_t saw;
-} vrcvisnd_t;
-
-#include "nes_apu.h"
-
-extern apuext_t vrcvi_ext;
-
-#endif /* _VRCVISND_H_ */
-
-/*
-** $Log: vrcvisnd.h,v $
-** Revision 1.2 2003/12/05 15:55:01 f1rmb
-** cleanup phase II. use xprintf when it's relevant, use xine_xmalloc when it's relevant too. Small other little fix (can't remember). Change few internal function prototype because it xine_t pointer need to be used if some xine's internal sections. NOTE: libdvd{nav,read} is still too noisy, i will take a look to made it quit, without invasive changes. To be continued...
-**
-** Revision 1.1 2003/01/08 07:04:36 tmmm
-** initial import of Nosefart sources
-**
-** Revision 1.7 2000/06/20 04:06:16 matt
-** migrated external sound definition to apu module
-**
-** Revision 1.6 2000/06/20 00:08:58 matt
-** changed to driver based API
-**
-** Revision 1.5 2000/06/09 16:49:02 matt
-** removed all floating point from sound generation
-**
-** Revision 1.4 2000/06/09 15:12:28 matt
-** initial revision
-**
-*/
diff --git a/src/liba52/xine_a52_decoder.c b/src/libxineadec/xine_a52_decoder.c
index 27480d859..2a9214f75 100644
--- a/src/liba52/xine_a52_decoder.c
+++ b/src/libxineadec/xine_a52_decoder.c
@@ -64,7 +64,7 @@
#include "buffer.h"
#include "xineutils.h"
-#include "crc.c"
+#include "../../contrib/a52dec/crc.c"
#undef DEBUG_A52
#ifdef DEBUG_A52
diff --git a/src/libdts/xine_dts_decoder.c b/src/libxineadec/xine_dts_decoder.c
index 39854600a..b7b55c85c 100644
--- a/src/libdts/xine_dts_decoder.c
+++ b/src/libxineadec/xine_dts_decoder.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2000-2005 the xine project
+ * Copyright (C) 2000-2007 the xine project
*
* This file is part of xine, a unix video player.
*
@@ -16,12 +16,14 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+/**
+ * @file
+ * @brief DTS decoder for xine
*
- * $Id: xine_decoder.c,v 1.67 2007/02/20 00:34:57 dgp85 Exp $
- *
- * 04-09-2001 DTS passtrough (C) Joachim Koenig
- * 09-12-2001 DTS passthrough inprovements (C) James Courtier-Dutton
- *
+ * @author Joachim Koenig (2001-09-04)
+ * @author James Courtier-Dutton (2001-12-09)
*/
#ifndef __sun
@@ -50,11 +52,9 @@
#include "audio_out.h"
#include "buffer.h"
-#ifdef HAVE_DTS_H
-# include <dts.h>
-#else
-# include "internal-dts.h"
-#endif
+#include "bswap.h"
+
+#include <dts.h>
#define MAX_AC5_FRAME 4096
@@ -91,65 +91,54 @@ typedef struct {
} dts_decoder_t;
-static void dts_reset (audio_decoder_t *this_gen);
-static void dts_discontinuity (audio_decoder_t *this_gen);
-
-static void dts_reset (audio_decoder_t *this_gen) {
-
- /* dts_decoder_t *this = (dts_decoder_t *) this_gen; */
-
-}
-
-static void dts_discontinuity (audio_decoder_t *this_gen) {
+static void dts_reset (audio_decoder_t *const this_gen) {
}
-#if 0
-static inline int16_t blah (int32_t i) {
-
- if (i > 0x43c07fff)
- return 32767;
- else if (i < 0x43bf8000)
- return -32768;
- else
- return i - 0x43c00000;
-}
-static inline void float_to_int (float * _f, int16_t * s16, int num_channels) {
- int i;
- int32_t * f = (int32_t *) _f; /* XXX assumes IEEE float format */
-
- for (i = 0; i < 256; i++) {
- s16[num_channels*i] = blah (f[i]);
- }
+static void dts_discontinuity (audio_decoder_t *const this_gen) {
}
-#endif
-static inline void float_to_int (float * _f, int16_t * s16, int num_channels) {
- int i;
- float f;
- for (i = 0; i < 256; i++) {
- f = _f[i] * 32767;
- if (f > INT16_MAX) f = INT16_MAX;
- if (f < INT16_MIN) f = INT16_MIN;
- s16[num_channels*i] = f;
+/**
+ * @brief Convert a array of floating point samples into 16-bit signed integer samples
+ * @param f Floating point samples array (origin)
+ * @param s16 16-bit signed integer samples array (destination)
+ * @param num_channels Number of channels present in the stream
+ *
+ * @todo This same work is being done in many decoders to adapt the output of
+ * the decoder to what the audio output can actually use, this should be
+ * done by the audio_output loop, not by the decoders.
+ * @note This is subtly different from the function with the same name in xine_musepack_decoder.c
+ */
+static inline void float_to_int (const float *const _f, int16_t *const s16, const int num_channels) {
+ const int endidx = 256 * num_channels;
+ int i, j;
+
+ for (i = 0, j = 0; j < endidx; i++, j += num_channels) {
+ const float f = _f[i] * 32767;
+ if (f > INT16_MAX)
+ s16[j] = INT16_MAX;
+ else if (f < INT16_MIN)
+ s16[j] = INT16_MIN;
+ else
+ s16[j] = f;
/* printf("samples[%d] = %f, %d\n", i, _f[i], s16[num_channels*i]); */
}
}
-static inline void mute_channel (int16_t * s16, int num_channels) {
+static inline void mute_channel (int16_t *const s16, const int num_channels) {
+ const int endidx = 256 * num_channels;
int i;
-
- for (i = 0; i < 256; i++) {
- s16[num_channels*i] = 0;
- }
+
+ for (i = 0; i < endidx; i += num_channels)
+ s16[i] = 0;
}
-static void dts_decode_frame (dts_decoder_t *this, int64_t pts, int preview_mode) {
+static void dts_decode_frame (dts_decoder_t *this, const int64_t pts, const int preview_mode) {
audio_buffer_t *audio_buffer;
uint32_t ac5_spdif_type=0;
int output_mode = AO_CAP_MODE_STEREO;
uint8_t *data_out;
- uint8_t *data_in = this->frame_buffer;
+ uint8_t *const data_in = this->frame_buffer;
lprintf("decode_frame\n");
audio_buffer = this->stream->audio_out->get_buffer (this->stream->audio_out);
@@ -227,7 +216,7 @@ static void dts_decode_frame (dts_decoder_t *this, int64_t pts, int preview_mode
} else {
/* Software decode */
int i, dts_output_flags;
- int16_t *int_samples = audio_buffer->mem;
+ int16_t *const int_samples = audio_buffer->mem;
int number_of_dts_blocks;
level_t level = 1.0;
@@ -327,10 +316,10 @@ static void dts_decode_frame (dts_decoder_t *this, int64_t pts, int preview_mode
static void dts_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
- dts_decoder_t *this = (dts_decoder_t *) this_gen;
+ dts_decoder_t *const this = (dts_decoder_t *) this_gen;
uint8_t *current = (uint8_t *)buf->content;
uint8_t *sync_start=current + 1;
- uint8_t *end = buf->content + buf->size;
+ uint8_t *const end = buf->content + buf->size;
lprintf("decode_data\n");
@@ -351,31 +340,17 @@ static void dts_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
(this->syncdword == 0xfe7f0180) ||
(this->syncdword == 0x7ffe8001) ) {
*/
- if ((this->syncdword == 0x7ffe8001)) {
- lprintf ("sync found: syncdword=0x%x\n", this->syncdword);
- this->frame_buffer[0] = 0x7f;
- this->frame_buffer[1] = 0xfe;
- this->frame_buffer[2] = 0x80;
- this->frame_buffer[3] = 0x01;
-
- this->sync_state = 1;
- this->frame_ptr = this->frame_buffer+4;
- this->pts = buf->pts;
- break;
- }
- if ((this->syncdword == 0xff1f00e8)) {
+ if ((this->syncdword == 0x7ffe8001) || (this->syncdword == 0xff1f00e8)) {
+ const uint32_t be_syncdword = be2me_32(this->syncdword);
lprintf ("sync found: syncdword=0x%x\n", this->syncdword);
- this->frame_buffer[0] = 0xff;
- this->frame_buffer[1] = 0x1f;
- this->frame_buffer[2] = 0x00;
- this->frame_buffer[3] = 0xe8;
+
+ memcpy(this->frame_buffer, &be_syncdword, sizeof(be_syncdword));
this->sync_state = 1;
this->frame_ptr = this->frame_buffer+4;
this->pts = buf->pts;
- break;
}
break;
@@ -383,9 +358,9 @@ static void dts_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
sync_start = current - 1;
*this->frame_ptr++ = *current++;
if ((this->frame_ptr - this->frame_buffer) > 19) {
- int old_dts_flags = this->dts_flags;
- int old_dts_sample_rate = this->dts_sample_rate;
- int old_dts_bit_rate = this->dts_bit_rate;
+ const int old_dts_flags = this->dts_flags;
+ const int old_dts_sample_rate = this->dts_sample_rate;
+ const int old_dts_bit_rate = this->dts_bit_rate;
this->ac5_length = dts_syncinfo (this->dts_state, this->frame_buffer,
&this->dts_flags,
@@ -470,11 +445,10 @@ static void dts_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
}
static void dts_dispose (audio_decoder_t *this_gen) {
- dts_decoder_t *this = (dts_decoder_t *) this_gen;
+ dts_decoder_t *const this = (dts_decoder_t *) this_gen;
if (this->output_open)
this->stream->audio_out->close (this->stream->audio_out, this->stream);
- this->output_open = 0;
free (this);
}
@@ -498,7 +472,6 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stre
else {
this->bypass_mode = 0;
/* FIXME: Leave "DOLBY pro logic" downmix out for now. */
-
this->dts_flags_map[DTS_MONO] = DTS_MONO;
this->dts_flags_map[DTS_STEREO] = DTS_STEREO;
this->dts_flags_map[DTS_3F] = DTS_STEREO;
diff --git a/src/libfaad/xine_faad_decoder.c b/src/libxineadec/xine_faad_decoder.c
index 3ce1852d3..72eec08a8 100644
--- a/src/libfaad/xine_faad_decoder.c
+++ b/src/libxineadec/xine_faad_decoder.c
@@ -75,7 +75,6 @@ typedef struct faad_decoder_s {
int bits_per_sample;
unsigned char num_channels;
int sbr;
- uint32_t ao_cap_mode;
int output_open;
@@ -177,16 +176,18 @@ static int faad_open_dec( faad_decoder_t *this ) {
}
static int faad_open_output( faad_decoder_t *this ) {
+ int ao_cap_mode;
+
this->rec_audio_src_size = this->num_channels * FAAD_MIN_STREAMSIZE;
switch( this->num_channels ) {
case 1:
- this->ao_cap_mode=AO_CAP_MODE_MONO;
+ ao_cap_mode=AO_CAP_MODE_MONO;
break;
case 6:
if(this->stream->audio_out->get_capabilities(this->stream->audio_out) &
AO_CAP_MODE_5_1CHANNEL) {
- this->ao_cap_mode = AO_CAP_MODE_5_1CHANNEL;
+ ao_cap_mode = AO_CAP_MODE_5_1CHANNEL;
break;
} else {
this->faac_cfg = NeAACDecGetCurrentConfiguration(this->faac_dec);
@@ -195,7 +196,7 @@ static int faad_open_output( faad_decoder_t *this ) {
this->num_channels = 2;
}
case 2:
- this->ao_cap_mode=AO_CAP_MODE_STEREO;
+ ao_cap_mode=AO_CAP_MODE_STEREO;
break;
}
@@ -203,7 +204,7 @@ static int faad_open_output( faad_decoder_t *this ) {
this->stream,
this->bits_per_sample,
this->rate,
- this->ao_cap_mode) ;
+ ao_cap_mode) ;
return this->output_open;
}
diff --git a/src/libxineadec/xine_lpcm_decoder.c b/src/libxineadec/xine_lpcm_decoder.c
index de9585849..ef50d9c51 100644
--- a/src/libxineadec/xine_lpcm_decoder.c
+++ b/src/libxineadec/xine_lpcm_decoder.c
@@ -16,13 +16,15 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+/**
+ * @file
+ * @author James Courtier-Dutton <james@superbug.demon.co.uk>
*
- * $Id: xine_decoder.c,v 1.62 2007/03/17 20:59:36 dgp85 Exp $
- *
- * 31-8-2001 Added LPCM rate sensing.
- * (c) 2001 James Courtier-Dutton James@superbug.demon.co.uk
- *
+ * @date 2001-08-31 Added LPCM rate sensing
*/
+
#ifndef __sun
#define _XOPEN_SOURCE 500
#endif
@@ -61,7 +63,7 @@ typedef struct lpcm_decoder_s {
uint32_t ao_cap_mode;
int output_open;
- int cpu_be; /* TRUE, if we're a Big endian CPU */
+ int cpu_be; /**< TRUE, if we're a Big endian CPU */
} lpcm_decoder_t;
static void lpcm_reset (audio_decoder_t *this_gen) {
diff --git a/src/libmad/xine_mad_decoder.c b/src/libxineadec/xine_mad_decoder.c
index e8801c37a..e8801c37a 100644
--- a/src/libmad/xine_mad_decoder.c
+++ b/src/libxineadec/xine_mad_decoder.c
diff --git a/src/libmusepack/xine_musepack_decoder.c b/src/libxineadec/xine_musepack_decoder.c
index 44f2444d6..d68583a5b 100644
--- a/src/libmusepack/xine_musepack_decoder.c
+++ b/src/libxineadec/xine_musepack_decoder.c
@@ -16,14 +16,15 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+/**
+ * @file
+ * @brief xine interface to libmusepack/libmpcdec
+ * @author James Stembridge <jstembridge@gmail.com>
*
- * xine interface to libmusepack by James Stembridge <jstembridge@gmail.com>
- *
- * TODO:
- * 32bit float output
- * Seeking??
- *
- * $Id: xine_decoder.c,v 1.10 2007/01/19 02:35:36 dgp85 Exp $
+ * @todo Add support for 32-bit float samples.
+ * @todo Add support for seeking.
*/
#include <stdio.h>
@@ -43,11 +44,7 @@
#include "buffer.h"
#include "xineutils.h"
-#ifdef HAVE_MPCDEC_MPCDEC_H
-# include <mpcdec/mpcdec.h>
-#else
-# include "musepack/musepack.h"
-#endif
+#include <mpcdec/mpcdec.h>
#define MPC_DECODER_MEMSIZE 65536
#define MPC_DECODER_MEMSIZE2 (MPC_DECODER_MEMSIZE/2)
@@ -91,8 +88,8 @@ typedef struct mpc_decoder_s {
*************************************************************************/
/* Reads size bytes of data into buffer at ptr. */
-static int32_t mpc_reader_read(void *data, void *ptr, int size) {
- mpc_decoder_t *this = (mpc_decoder_t *) data;
+static int32_t mpc_reader_read(void *const data, void *const ptr, int size) {
+ mpc_decoder_t *const this = (mpc_decoder_t *) data;
lprintf("mpc_reader_read: size=%d\n", size);
@@ -110,8 +107,8 @@ static int32_t mpc_reader_read(void *data, void *ptr, int size) {
}
/* Seeks to byte position offset. */
-static mpc_bool_t mpc_reader_seek(void *data, int32_t offset) {
- mpc_decoder_t *this = (mpc_decoder_t *) data;
+static mpc_bool_t mpc_reader_seek(void *const data, const int32_t offset) {
+ mpc_decoder_t *const this = (mpc_decoder_t *) data;
lprintf("mpc_reader_seek: offset=%d\n", offset);
@@ -123,7 +120,7 @@ static mpc_bool_t mpc_reader_seek(void *data, int32_t offset) {
}
/* Returns the current byte offset in the stream. */
-static int32_t mpc_reader_tell(void *data) {
+static int32_t mpc_reader_tell(void *const data) {
lprintf("mpc_reader_tell\n");
/* Tell isn't used so just return 0 */
@@ -131,8 +128,8 @@ static int32_t mpc_reader_tell(void *data) {
}
/* Returns the total length of the source stream, in bytes. */
-static int32_t mpc_reader_get_size(void *data) {
- mpc_decoder_t *this = (mpc_decoder_t *) data;
+static int32_t mpc_reader_get_size(void *const data) {
+ mpc_decoder_t *const this = (const mpc_decoder_t *) data;
lprintf("mpc_reader_get_size\n");
@@ -146,15 +143,26 @@ static mpc_bool_t mpc_reader_canseek(void *data) {
return TRUE;
}
-/* Convert 32bit float samples into 16bit int samples */
-static inline void float_to_int(float *_f, int16_t *s16, int samples) {
+/**
+ * @brief Convert a array of floating point samples into 16-bit signed integer samples
+ * @param f Floating point samples array (origin)
+ * @param s16 16-bit signed integer samples array (destination)
+ * @param samples Number of samples to convert
+ *
+ * @todo This same work is being done in many decoders to adapt the output of
+ * the decoder to what the audio output can actually use, this should be
+ * done by the audio_output loop, not by the decoders.
+ */
+static inline void float_to_int(const float *const _f, int16_t *const s16, const int samples) {
int i;
- float f;
for (i = 0; i < samples; i++) {
- f = _f[i] * 32767;
- if (f > INT16_MAX) f = INT16_MAX;
- if (f < INT16_MIN) f = INT16_MIN;
- s16[i] = f;
+ const float f = _f[i] * 32767;
+ if (f > INT16_MAX)
+ s16[i] = INT16_MAX;
+ else if (f < INT16_MIN)
+ s16[i] = INT16_MIN;
+ else
+ s16[i] = f;
/* printf("samples[%d] = %f, %d\n", i, _f[i], s16[num_channels*i]); */
}
}
@@ -385,11 +393,9 @@ static void mpc_dispose (audio_decoder_t *this_gen) {
/* close the audio output */
if (this->output_open)
this->stream->audio_out->close (this->stream->audio_out, this->stream);
- this->output_open = 0;
/* free anything that was allocated during operation */
- if (this->buf)
- free(this->buf);
+ free(this->buf);
free(this);
}
diff --git a/src/libxinevdec/Makefile.am b/src/libxinevdec/Makefile.am
index 9805eb09e..321d70c1f 100644
--- a/src/libxinevdec/Makefile.am
+++ b/src/libxinevdec/Makefile.am
@@ -1,22 +1,18 @@
include $(top_srcdir)/misc/Makefile.common
-AM_CFLAGS = $(VISIBILITY_FLAG)
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
AM_LDFLAGS = $(xineplug_ldflags)
EXTRA_DIST = foovideo.c
-if HAVE_WAND
+if ENABLE_IMAGEMAGICK
image_module = xineplug_decode_image.la
endif
-if HAVE_GDK_PIXBUF
+if ENABLE_GDK_PIXBUF
gdkpixbuf_module = xineplug_decode_gdk_pixbuf.la
endif
-if HAVE_THEORA
-theora_module = xineplug_decode_theora.la
-endif
-
xineplug_LTLIBRARIES = $(image_module) \
$(gdkpixbuf_module) \
$(theora_module) \
@@ -34,13 +30,9 @@ xineplug_decode_yuv_la_SOURCES = yuv.c
xineplug_decode_yuv_la_LIBADD = $(XINE_LIB)
xineplug_decode_image_la_SOURCES = image.c
-xineplug_decode_image_la_CFLAGS = $(AM_CFLAGS) $(WAND_CFLAGS)
xineplug_decode_image_la_LIBADD = $(XINE_LIB) $(DYNAMIC_LD_LIBS) $(WAND_LIBS)
+xineplug_decode_image_la_CFLAGS = $(AM_CFLAGS) $(WAND_CFLAGS)
xineplug_decode_gdk_pixbuf_la_SOURCES = gdkpixbuf.c
-xineplug_decode_gdk_pixbuf_la_CFLAGS = $(AM_CFLAGS) $(GDK_PIXBUF_CFLAGS)
xineplug_decode_gdk_pixbuf_la_LIBADD = $(XINE_LIB) $(DYNAMIC_LD_LIBS) $(GDK_PIXBUF_LIBS)
-
-xineplug_decode_theora_la_SOURCES = xine_theora_decoder.c
-xineplug_decode_theora_la_CFLAGS = $(AM_CFLAGS) $(OGG_CFLAGS) $(THEORA_CFLAGS)
-xineplug_decode_theora_la_LIBADD = $(XINE_LIB) $(OGG_LIBS) $(THEORA_LIBS)
+xineplug_decode_gdk_pixbuf_la_CFLAGS = $(AM_CFLAGS) $(GDK_PIXBUF_CFLAGS)
diff --git a/src/libxinevdec/bitplane.c b/src/libxinevdec/bitplane.c
index f9a3aa8e0..5812a16ea 100644
--- a/src/libxinevdec/bitplane.c
+++ b/src/libxinevdec/bitplane.c
@@ -1160,8 +1160,8 @@ static void bitplane_decode_data (video_decoder_t *this_gen,
this->bytes_per_pixel = 1;
/* New Buffer for indexes (palette based formats) */
- this->index_buf = xine_xmalloc( this->num_pixel * this->bytes_per_pixel );
- this->index_buf_hist = xine_xmalloc( this->num_pixel * this->bytes_per_pixel );
+ this->index_buf = xine_xcalloc( this->num_pixel, this->bytes_per_pixel );
+ this->index_buf_hist = xine_xcalloc( this->num_pixel, this->bytes_per_pixel );
this->num_bitplanes = bih->biPlanes;
this->camg_mode = bih->biCompression;
@@ -1316,8 +1316,8 @@ static void bitplane_decode_data (video_decoder_t *this_gen,
}
}
if( this->index_buf == NULL ) {
- this->index_buf = xine_xmalloc( (this->num_pixel * this->bytes_per_pixel) );
- this->index_buf_hist = xine_xmalloc( (this->num_pixel * this->bytes_per_pixel) );
+ this->index_buf = xine_xcalloc( this->num_pixel, this->bytes_per_pixel );
+ this->index_buf_hist = xine_xcalloc( this->num_pixel, this->bytes_per_pixel );
for (i = 0; i < (this->num_pixel * this->bytes_per_pixel); i++) {
this->index_buf[i] = 0;
this->index_buf_hist[i] = 0;
diff --git a/src/post/Makefile.am b/src/post/Makefile.am
index 8408c3f3a..6c28b41f7 100644
--- a/src/post/Makefile.am
+++ b/src/post/Makefile.am
@@ -1,4 +1,3 @@
include $(top_srcdir)/misc/Makefile.common
-SUBDIRS = \
- planar goom visualizations mosaico deinterlace audio
+SUBDIRS = planar goom visualizations mosaico deinterlace audio
diff --git a/src/post/audio/Makefile.am b/src/post/audio/Makefile.am
index 41a364d0d..c2df5c21d 100644
--- a/src/post/audio/Makefile.am
+++ b/src/post/audio/Makefile.am
@@ -1,12 +1,12 @@
include $(top_srcdir)/misc/Makefile.common
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_LDFLAGS = $(xineplug_ldflags)
+
noinst_HEADERS = dsp.h filter.h window.h audio_filters.h
xinepost_LTLIBRARIES = xineplug_post_audio_filters.la
xineplug_post_audio_filters_la_SOURCES = \
upmix.c upmix_mono.c filter.c window.c stretch.c volnorm.c audio_filters.c
-xineplug_post_audio_filters_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL) -lm
-xineplug_post_audio_filters_la_CFLAGS = $(VISIBILITY_FLAG)
-xineplug_post_audio_filters_la_LDFLAGS = -avoid-version -module
-
+xineplug_post_audio_filters_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS) -lm
diff --git a/src/post/deinterlace/Makefile.am b/src/post/deinterlace/Makefile.am
index d382a2e98..1a90b72bf 100644
--- a/src/post/deinterlace/Makefile.am
+++ b/src/post/deinterlace/Makefile.am
@@ -1,8 +1,9 @@
include $(top_srcdir)/misc/Makefile.common
-SUBDIRS = plugins
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_LDFLAGS = $(xineplug_ldflags) $(IMPURE_TEXT_LDFLAGS)
-EXTRA_DIST =
+SUBDIRS = plugins
xinepost_LTLIBRARIES = xineplug_post_tvtime.la
@@ -11,8 +12,4 @@ xineplug_post_tvtime_la_SOURCES = xine_plugin.c \
xineplug_post_tvtime_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) \
$(top_builddir)/src/post/deinterlace/plugins/libdeinterlaceplugins.la
-xineplug_post_tvtime_la_CFLAGS = $(VISIBILITY_FLAG)
-xineplug_post_tvtime_la_LDFLAGS = -avoid-version -module \
- @IMPURE_TEXT_LDFLAGS@
-
noinst_HEADERS = deinterlace.h pulldown.h speedtools.h speedy.h tvtime.h
diff --git a/src/post/deinterlace/plugins/Makefile.am b/src/post/deinterlace/plugins/Makefile.am
index 17d170127..4185b5706 100644
--- a/src/post/deinterlace/plugins/Makefile.am
+++ b/src/post/deinterlace/plugins/Makefile.am
@@ -17,6 +17,11 @@ include $(top_srcdir)/misc/Makefile.common
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# libpostproc is here so we can use their nice mangle.h
+AM_CFLAGS = $(VISIBILITY_FLAG)
+AM_CPPFLAGS = -I$(top_srcdir)/src/post/deinterlace \
+ -I$(top_srcdir)/contrib/ffmpeg/libpostproc
+
EXTRA_DIST = greedy2frame_template.c greedyh.asm \
tomsmocomp/SearchLoop0A.inc tomsmocomp/SearchLoopBottom.inc \
tomsmocomp/SearchLoopEdgeA.inc tomsmocomp/SearchLoopEdgeA8.inc \
@@ -28,25 +33,26 @@ EXTRA_DIST = greedy2frame_template.c greedyh.asm \
tomsmocomp/TomsMoCompAll2.inc tomsmocomp/WierdBob.inc \
tomsmocomp/tomsmocompmacros.h x86-64_macros.inc
-# libpostproc is here so we can use their nice mangle.h
-AM_CFLAGS = -I$(top_srcdir)/src/post/deinterlace \
- -I$(top_srcdir)/src/libffmpeg/libavcodec/libpostproc
-
-noinst_LTLIBRARIES = libdeinterlaceplugins.la
-
-libdeinterlaceplugins_la_SOURCES = \
- double.c \
- greedy.c \
- linear.c \
- linearblend.c \
- vfir.c \
- weave.c \
- greedy2frame.c \
- scalerbob.c \
- kdetv_greedyh.c \
- kdetv_tomsmocomp.c
-libdeinterlaceplugins_la_LIBADD = $(XINE_LIB)
-libdeinterlaceplugins_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-libdeinterlaceplugins_la_LDFLAGS = -avoid-version -module
-
noinst_HEADERS = plugins.h greedyhmacros.h
+
+if DEBUG_BUILD
+debug_sources = greedy2frame.c
+nodebug_sources =
+else
+debug_sources =
+nodebug_sources = greedy2frame.c
+endif
+
+# per-object CFLAGS -- drop optimization on kdetv_greedyh.c so that gcc
+# doesn't run out of general registers trying to compile it.
+
+noinst_LTLIBRARIES = libdeinterlacepluginsO1.la libdeinterlaceplugins.la
+libdeinterlacepluginsO1_la_SOURCES = kdetv_greedyh.c $(debug_sources)
+libdeinterlacepluginsO1_la_CFLAGS = $(O1_CFLAGS) $(AM_CFLAGS)
+
+libdeinterlaceplugins_la_SOURCES = double.c greedy.c linear.c linearblend.c \
+ vfir.c weave.c scalerbob.c kdetv_tomsmocomp.c \
+ $(nodebug_sources)
+libdeinterlaceplugins_la_LIBADD = $(XINE_LIB) libdeinterlacepluginsO1.la
+libdeinterlaceplugins_la_CFLAGS = $(DEFAULT_OCFLAGS) $(AM_CFLAGS)
+libdeinterlaceplugins_la_LDFLAGS = $(AM_LDFLAGS) $(xineplug_ldflags)
diff --git a/src/post/goom/Makefile.am b/src/post/goom/Makefile.am
index c01482917..22b4af79f 100644
--- a/src/post/goom/Makefile.am
+++ b/src/post/goom/Makefile.am
@@ -1,36 +1,15 @@
include $(top_srcdir)/misc/Makefile.common
-EXTRA_DIST = mmx.c xmmx.c ppc_drawings.s ppc_zoom_ultimate.s diff_against_release.patch \
- gfontrle.c mathtools.c
-
-## -fomit-frame-pointer segfaults here
-## Use -O2 if -Os is stripped or x86 does not build
-#CFLAGS = `echo @CFLAGS@ | sed -e 's/-fomit-frame-pointer//g;s/-Os/-O2/g'`
-CFLAGS = `echo @CFLAGS@ | sed -e 's/-Os/-O2/g'`
-
-# Avoid errors with -O0
-xineplug_post_goom_la-xmmx.o xineplug_post_goom_la-xmmx.lo: CFLAGS=`echo @CFLAGS@ | sed -e 's/-O0\?\s/-Os /g'`
-
-xinepost_LTLIBRARIES = xineplug_post_goom.la
+AM_CFLAGS = $(VISIBILITY_FLAG)
## doesn't work
-#if PPC_ARCH
+#if ARCH_PPC
#extra_files = ppc_drawings.s ppc_zoom_ultimate.s
#AM_CPPFLAGS = -DCPU_POWERPC
#endif
-if HAVE_MMX
-extra_files = mmx.c xmmx.c
-endif
-
-xineplug_post_goom_la_SOURCES = $(extra_files) xine_goom.c \
- config_param.c convolve_fx.c cpu_info.c drawmethods.c filters.c flying_stars_fx.c \
- gfontlib.c goom_core.c goom_tools.c goomsl.c goomsl_hash.c goomsl_heap.c \
- goomsl_lex.c goomsl_yacc.c graphic.c ifs.c lines.c \
- plugin_info.c sound_tester.c surf3d.c tentacle3d.c v3d.c
-xineplug_post_goom_la_LIBADD = $(XINE_LIB) $(GOOM_LIBS) $(PTHREAD_LIBS) $(LTLIBINTL) -lm
-xineplug_post_goom_la_CFLAGS = $(VISIBILITY_FLAG)
-xineplug_post_goom_la_LDFLAGS = -avoid-version -module
+EXTRA_DIST = mmx.c xmmx.c ppc_drawings.s ppc_zoom_ultimate.s diff_against_release.patch \
+ gfontrle.c mathtools.c
noinst_HEADERS = cpu_info.h default_scripts.h drawmethods.h gfontlib.h goom.h \
goom_config.h goom_config_param.h goom_filters.h goom_fx.h goom_graphic.h \
@@ -38,3 +17,21 @@ noinst_HEADERS = cpu_info.h default_scripts.h drawmethods.h gfontlib.h goom.h \
goomsl_heap.h goomsl_private.h goomsl_yacc.h ifs.h lines.h mathtools.h mmx.h \
ppc_drawings.h ppc_zoom_ultimate.h sound_tester.h surf3d.h tentacle3d.h v3d.h \
motif_goom1.h motif_goom2.h
+
+noinst_LTLIBRARIES = libpost_goom_asm.la
+libpost_goom_asm_la_SOURCES = xmmx.c
+if DEBUG_BUILD
+libpost_goom_asm_la_CFLAGS = $(O1_CFLAGS) $(AM_CFLAGS)
+else
+libpost_goom_asm_la_CFLAGS = $(DEFAULT_OCFLAGS) $(AM_CFLAGS)
+endif
+
+xinepost_LTLIBRARIES = xineplug_post_goom.la
+xineplug_post_goom_la_SOURCES = mmx.c xine_goom.c \
+ config_param.c convolve_fx.c cpu_info.c drawmethods.c filters.c flying_stars_fx.c \
+ gfontlib.c goom_core.c goom_tools.c goomsl.c goomsl_hash.c goomsl_heap.c \
+ goomsl_lex.c goomsl_yacc.c graphic.c ifs.c lines.c \
+ plugin_info.c sound_tester.c surf3d.c tentacle3d.c v3d.c
+xineplug_post_goom_la_LIBADD = $(XINE_LIB) $(GOOM_LIBS) $(PTHREAD_LIBS) $(LTLIBINTL) -lm $(noinst_LTLIBRARIES)
+xineplug_post_goom_la_CFLAGS = $(DEFAULT_OCFLAGS) $(AM_CFLAGS)
+xineplug_post_goom_la_LDFLAGS = $(AM_LDFLAGS) $(xineplug_ldflags)
diff --git a/src/post/goom/gfontlib.c b/src/post/goom/gfontlib.c
index 2bc366305..2bc366305 100644..100755
--- a/src/post/goom/gfontlib.c
+++ b/src/post/goom/gfontlib.c
diff --git a/src/post/goom/gfontlib.h b/src/post/goom/gfontlib.h
index 0520b7da9..0520b7da9 100644..100755
--- a/src/post/goom/gfontlib.h
+++ b/src/post/goom/gfontlib.h
diff --git a/src/post/goom/gfontrle.c b/src/post/goom/gfontrle.c
index a22545a1e..a22545a1e 100644..100755
--- a/src/post/goom/gfontrle.c
+++ b/src/post/goom/gfontrle.c
diff --git a/src/post/goom/mathtools.h b/src/post/goom/mathtools.h
index 165fc66b0..165fc66b0 100644..100755
--- a/src/post/goom/mathtools.h
+++ b/src/post/goom/mathtools.h
diff --git a/src/post/goom/mmx.h b/src/post/goom/mmx.h
index b650d8b12..88789e86f 100644
--- a/src/post/goom/mmx.h
+++ b/src/post/goom/mmx.h
@@ -31,6 +31,8 @@
# include "config.h"
#endif
+#include "attributes.h"
+
#include "goom_graphic.h"
/* Warning: at this writing, the version of GAS packaged
@@ -58,7 +60,7 @@ typedef union {
char b[8]; /* 8 Byte (8-bit) values */
unsigned char ub[8]; /* 8 Unsigned Byte */
float s[2]; /* Single-precision (32-bit) value */
-} __attribute__ ((aligned (8))) mmx_t; /* On an 8-byte (64-bit) boundary */
+} ATTR_ALIGN(8) mmx_t; /* On an 8-byte (64-bit) boundary */
diff --git a/src/post/goom/surf3d.c b/src/post/goom/surf3d.c
index ba8c69094..ba8c69094 100644..100755
--- a/src/post/goom/surf3d.c
+++ b/src/post/goom/surf3d.c
diff --git a/src/post/goom/surf3d.h b/src/post/goom/surf3d.h
index 482b6a090..482b6a090 100644..100755
--- a/src/post/goom/surf3d.h
+++ b/src/post/goom/surf3d.h
diff --git a/src/post/goom/tentacle3d.c b/src/post/goom/tentacle3d.c
index e1e2157e7..e1e2157e7 100644..100755
--- a/src/post/goom/tentacle3d.c
+++ b/src/post/goom/tentacle3d.c
diff --git a/src/post/goom/tentacle3d.h b/src/post/goom/tentacle3d.h
index ad0858fad..ad0858fad 100644..100755
--- a/src/post/goom/tentacle3d.h
+++ b/src/post/goom/tentacle3d.h
diff --git a/src/post/goom/v3d.h b/src/post/goom/v3d.h
index 7690847f2..7690847f2 100644..100755
--- a/src/post/goom/v3d.h
+++ b/src/post/goom/v3d.h
diff --git a/src/post/mosaico/Makefile.am b/src/post/mosaico/Makefile.am
index af027b6e6..106d480c3 100644
--- a/src/post/mosaico/Makefile.am
+++ b/src/post/mosaico/Makefile.am
@@ -1,13 +1,12 @@
include $(top_srcdir)/misc/Makefile.common
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_LDFLAGS = $(xineplug_ldflags)
+
xinepost_LTLIBRARIES = xineplug_post_mosaico.la xineplug_post_switch.la
xineplug_post_mosaico_la_SOURCES = mosaico.c
xineplug_post_mosaico_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_post_mosaico_la_CFLAGS = $(VISIBILITY_FLAG)
-xineplug_post_mosaico_la_LDFLAGS = -avoid-version -module
xineplug_post_switch_la_SOURCES = switch.c
xineplug_post_switch_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_post_switch_la_CFLAGS = $(VISIBILITY_FLAG)
-xineplug_post_switch_la_LDFLAGS = -avoid-version -module
diff --git a/src/post/mosaico/mosaico.c b/src/post/mosaico/mosaico.c
index 40173bd5d..cc7fefe2c 100644
--- a/src/post/mosaico/mosaico.c
+++ b/src/post/mosaico/mosaico.c
@@ -160,7 +160,7 @@ static post_plugin_t *mosaico_open_plugin(post_class_t *class_gen, int inputs,
_x_post_init(&this->post, 0, inputs);
- this->pip = (mosaico_pip_t *)xine_xmalloc(sizeof(mosaico_pip_t) * (inputs - 1));
+ this->pip = (mosaico_pip_t *)xine_xcalloc((inputs - 1), sizeof(mosaico_pip_t));
this->pip_count = inputs - 1;
pthread_cond_init(&this->vpts_limit_changed, NULL);
diff --git a/src/post/planar/Makefile.am b/src/post/planar/Makefile.am
index 4ba6bfa41..cb1ee68f9 100644
--- a/src/post/planar/Makefile.am
+++ b/src/post/planar/Makefile.am
@@ -1,34 +1,30 @@
include $(top_srcdir)/misc/Makefile.common
-POSTPROC_INT_LIB = $(top_builddir)/src/libffmpeg/libavcodec/libpostproc/libpostprocess.la
+AM_CFLAGS = $(VISIBILITY_FLAG) $(ff_cflags)
+AM_CPPFLAGS =
+AM_LDFLAGS =
-if HAVE_FFMPEG
+if WITH_EXTERNAL_FFMPEG
postproc_lib = $(FFMPEG_POSTPROC_LIBS)
-ff_cflags = $(FFMPEG_POSTPROC_CFLAGS)
+ff_cflags = $(FFMPEG_POSTPROC_CFLAGS)
else
-ff_cflags = -I$(top_srcdir)/src/libffmpeg/libavcodec/libpostproc
-postproc_lib = $(POSTPROC_INT_LIB)
-postproc_dep = $(postproc_lib)
-endif
+AM_CPPFLAGS += -I$(top_srcdir)/contrib/ffmpeg/libpostproc
+postproc_lib = $(top_builddir)/contrib/ffmpeg/libpostproc/libpostproc.a \
+ $(top_builddir)/contrib/ffmpeg/libavutil/libavutil.a
-# -fomit-frame-pointer is always needed. it might cause debug to not
-# work, but at least it compiles.
-AM_CFLAGS = $(ff_cflags) -fomit-frame-pointer
+$(top_builddir)/contrib/ffmpeg/libpostproc/libpostproc.a:
+ $(MAKE) -C $(top_builddir)/contrib ffmpeg/libpostproc/libpostproc.a
+$(top_builddir)/contrib/ffmpeg/libavutil/libavutil.a:
+ $(MAKE) -C $(top_builddir)/contrib ffmpeg/libavutil/libavutil.a
+endif
-# Avoid errors with -O0
-xineplug_post_planar_la-eq.o xineplug_post_planar_la-eq.lo: CFLAGS=`echo @CFLAGS@ | sed -e 's/-O0\?\s/-Os /g'`
-xineplug_post_planar_la-eq2.o xineplug_post_planar_la-eq2.lo: CFLAGS=`echo @CFLAGS@ | sed -e 's/-O0\?\s/-Os /g'`
-xineplug_post_planar_la-noise.o xineplug_post_planar_la-noise.lo: CFLAGS=`echo @CFLAGS@ | sed -e 's/-O0\?\s/-Os /g'`
+noinst_LTLIBRARIES = libpost_planar_asm.la
+libpost_planar_asm_la_SOURCES = eq.c eq2.c noise.c
+libpost_planar_asm_la_CFLAGS = $(O1_CFLAGS) -fomit-frame-pointer $(AM_CFLAGS)
xinepost_LTLIBRARIES = xineplug_post_planar.la
-
xineplug_post_planar_la_SOURCES = planar.c invert.c expand.c fill.c boxblur.c \
- denoise3d.c eq.c eq2.c unsharp.c pp.c noise.c
-xineplug_post_planar_la_DEPENDENCIES = $(postproc_dep)
-xineplug_post_planar_la_LIBADD = $(XINE_LIB) $(postproc_lib) -lm $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_post_planar_la_LDFLAGS = -avoid-version -module \
- @IMPURE_TEXT_LDFLAGS@
-xineplug_post_planar_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-
-$(POSTPROC_INT_LIB):
- cd $(top_builddir)/src/libffmpeg/libavcodec/libpostproc && $(MAKE) libpostprocess.la
+ denoise3d.c unsharp.c pp.c
+xineplug_post_planar_la_LIBADD = $(XINE_LIB) $(postproc_lib) -lm $(PTHREAD_LIBS) $(LTLIBINTL) $(noinst_LTLIBRARIES)
+xineplug_post_planar_la_CFLAGS = $(DEFAULT_OCFLAGS) $(AM_CFLAGS)
+xineplug_post_planar_la_LDFLAGS = $(AM_LDFLAGS) $(xineplug_ldflags) $(IMPURE_TEXT_LDFLAGS)
diff --git a/src/post/planar/pp.c b/src/post/planar/pp.c
index c66e40459..c66e40459 100644..100755
--- a/src/post/planar/pp.c
+++ b/src/post/planar/pp.c
diff --git a/src/post/visualizations/Makefile.am b/src/post/visualizations/Makefile.am
index f42598d9c..bea89ac49 100644
--- a/src/post/visualizations/Makefile.am
+++ b/src/post/visualizations/Makefile.am
@@ -1,13 +1,14 @@
include $(top_srcdir)/misc/Makefile.common
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_LDFLAGS = $(xineplug_ldflags)
+
EXTRA_DIST = fooviz.c
+noinst_HEADERS = fft.h visualizations.h
+
xinepost_LTLIBRARIES = xineplug_post_visualizations.la
xineplug_post_visualizations_la_SOURCES = \
visualizations.c fft.c fftscope.c oscope.c fftgraph.c
xineplug_post_visualizations_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS) -lm
-xineplug_post_visualizations_la_CFLAGS = $(VISIBILITY_FLAG)
-xineplug_post_visualizations_la_LDFLAGS = -avoid-version -module
-
-noinst_HEADERS = fft.h visualizations.h
diff --git a/src/vdr/Makefile.am b/src/vdr/Makefile.am
new file mode 100644
index 000000000..fcdf6cae4
--- /dev/null
+++ b/src/vdr/Makefile.am
@@ -0,0 +1,17 @@
+include $(top_srcdir)/misc/Makefile.common
+
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_LDFLAGS = $(xineplug_ldflags)
+
+xineinclude_HEADERS = input_vdr.h
+
+if ENABLE_DVB
+xineplug_LTLIBRARIES = xineplug_inp_vdr.la
+xinepost_LTLIBRARIES = xineplug_post_vdr.la
+endif
+
+xineplug_inp_vdr_la_SOURCES = input_vdr.c
+xineplug_inp_vdr_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS)
+
+xineplug_post_vdr_la_SOURCES = post_vdr.c post_vdr_video.c post_vdr_audio.c post_vdr.h
+xineplug_post_vdr_la_LIBADD = $(XINE_LIB)
diff --git a/src/vdr/input_vdr.c b/src/vdr/input_vdr.c
new file mode 100644
index 000000000..2b68817f9
--- /dev/null
+++ b/src/vdr/input_vdr.c
@@ -0,0 +1,2693 @@
+/*
+ * Copyright (C) 2003-2004 the xine project
+ *
+ * This file is part of xine, a free video player.
+ *
+ * xine is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * xine is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ *
+ * $Id: input_vdr.c,v 1.51 2003/05/02 15:02:11 miguelfreitas Exp $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include <sys/poll.h>
+#include <errno.h>
+#include <pthread.h>
+
+#include <sys/socket.h>
+#include <resolv.h>
+#include <netdb.h>
+
+#define LOG_MODULE "input_vdr"
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
+#include "xine_internal.h"
+#include "xineutils.h"
+#include "input_plugin.h"
+
+#include "input_vdr.h"
+#include "post_vdr.h"
+
+
+
+#define VDR_MAX_NUM_WINDOWS 16
+#define VDR_ABS_FIFO_DIR "/tmp/vdr-xine"
+
+#define BUF_SIZE 1024
+
+#define LOG_OSD(x)
+/*
+#define LOG_OSD(x) x
+*/
+
+
+typedef struct
+{
+ input_plugin_t input_plugin;
+
+ xine_stream_t *stream;
+ xine_stream_t *stream_external;
+
+ int fh;
+ int fh_control;
+ int fh_result;
+ int fh_event;
+
+ char *mrl;
+
+ off_t curpos;
+ char seek_buf[ BUF_SIZE ];
+
+ char *preview;
+ off_t preview_size;
+
+ enum funcs cur_func;
+ off_t cur_size;
+ off_t cur_done;
+
+ xine_osd_t *osd_window[ VDR_MAX_NUM_WINDOWS ];
+ uint8_t *osd_buffer;
+ uint32_t osd_buffer_size;
+ uint8_t osd_unscaled_blending;
+
+ uint8_t audio_channels;
+ uint8_t trick_speed_mode;
+ uint8_t mute_mode;
+ uint8_t volume_mode;
+ int last_volume;
+ vdr_frame_size_changed_data_t frame_size;
+
+ pthread_t rpc_thread;
+ int rpc_thread_shutdown;
+ pthread_mutex_t rpc_thread_shutdown_lock;
+ pthread_cond_t rpc_thread_shutdown_cond;
+
+ xine_event_queue_t *event_queue;
+ xine_event_queue_t *event_queue_external;
+
+ pthread_mutex_t adjust_zoom_lock;
+ uint16_t image4_3_zoom_x;
+ uint16_t image4_3_zoom_y;
+ uint16_t image16_9_zoom_x;
+ uint16_t image16_9_zoom_y;
+
+}
+vdr_input_plugin_t;
+
+
+
+typedef struct
+{
+ input_class_t input_class;
+ xine_t *xine;
+ char *mrls[ 2 ];
+}
+vdr_input_class_t;
+
+
+
+static int vdr_write(int f, void *b, int n)
+{
+ int t = 0, r;
+
+ while (t < n)
+ {
+ /*
+ * System calls are not a thread cancellation point in Linux
+ * pthreads. However, the RT signal sent to cancel the thread
+ * will cause recv() to return with EINTR, and we can manually
+ * check cancellation.
+ */
+ pthread_testcancel();
+ r = write(f, ((char *)b) + t, n - t);
+ pthread_testcancel();
+
+ if (r < 0
+ && (errno == EINTR
+ || errno == EAGAIN))
+ {
+ continue;
+ }
+
+ if (r < 0)
+ return r;
+
+ t += r;
+ }
+
+ return t;
+}
+
+
+
+static int internal_write_event_play_external(vdr_input_plugin_t *this, uint32_t key);
+
+static void event_handler_external(void *user_data, const xine_event_t *event)
+{
+ vdr_input_plugin_t *this = (vdr_input_plugin_t *)user_data;
+ uint32_t key = key_none;
+/*
+ printf("event_handler_external(): event->type: %d\n", event->type);
+*/
+ switch (event->type)
+ {
+ case XINE_EVENT_UI_PLAYBACK_FINISHED:
+ break;
+
+ default:
+ return;
+ }
+
+ if (0 != internal_write_event_play_external(this, key))
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ _("%s: input event write: %s.\n"), LOG_MODULE, strerror(errno));
+}
+
+static void external_stream_stop(vdr_input_plugin_t *this)
+{
+ if (this->stream_external)
+ {
+ xine_stop(this->stream_external);
+ xine_close(this->stream_external);
+
+ if (this->event_queue_external)
+ {
+ xine_event_dispose_queue(this->event_queue_external);
+ this->event_queue_external = 0;
+ }
+
+ _x_demux_flush_engine(this->stream_external);
+
+ xine_dispose(this->stream_external);
+ this->stream_external = 0;
+ }
+}
+
+static void external_stream_play(vdr_input_plugin_t *this, char *file_name)
+{
+ external_stream_stop(this);
+
+ this->stream_external = xine_stream_new(this->stream->xine, this->stream->audio_out, this->stream->video_out);
+
+ this->event_queue_external = xine_event_new_queue(this->stream_external);
+
+ xine_event_create_listener_thread(this->event_queue_external, event_handler_external, this);
+
+ if (!xine_open(this->stream_external, file_name)
+ || !xine_play(this->stream_external, 0, 0))
+ {
+ uint32_t key = key_none;
+
+ if ( 0 != internal_write_event_play_external(this, key))
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ _("%s: input event write: %s.\n"), LOG_MODULE, strerror(errno));
+ }
+}
+
+static off_t vdr_read_abort(xine_stream_t *stream, int fd, char *buf, off_t todo)
+{
+ off_t ret;
+
+ while (1)
+ {
+ /*
+ * System calls are not a thread cancellation point in Linux
+ * pthreads. However, the RT signal sent to cancel the thread
+ * will cause recv() to return with EINTR, and we can manually
+ * check cancellation.
+ */
+ pthread_testcancel();
+ ret = _x_read_abort(stream, fd, buf, todo);
+ pthread_testcancel();
+
+ if (ret < 0
+ && (errno == EINTR
+ || errno == EAGAIN))
+ {
+ continue;
+ }
+
+ break;
+ }
+
+ return ret;
+}
+
+#define READ_DATA_OR_FAIL(kind, log) \
+ data_##kind##_t *data = &data_union.kind; \
+ { \
+ log; \
+ n = vdr_read_abort(this->stream, this->fh_control, (char *)data + sizeof (data->header), sizeof (*data) - sizeof (data->header)); \
+ if (n != sizeof (*data) - sizeof (data->header)) \
+ return -1; \
+ \
+ this->cur_size -= n; \
+ }
+
+static double _now()
+{
+ struct timeval tv;
+
+ gettimeofday(&tv, 0);
+
+ return (tv.tv_sec * 1000000.0 + tv.tv_usec) / 1000.0;
+}
+
+static void adjust_zoom(vdr_input_plugin_t *this)
+{
+ pthread_mutex_lock(&this->adjust_zoom_lock);
+
+ if (this->image4_3_zoom_x && this->image4_3_zoom_y
+ && this->image16_9_zoom_x && this->image16_9_zoom_y)
+ {
+ int ratio = (int)(10000 * this->frame_size.r + 0.5);
+fprintf(stderr, "ratio: %d\n", ratio);
+ if (13332 <= ratio && ratio <= 13334)
+ {
+ xine_set_param(this->stream, XINE_PARAM_VO_ZOOM_X, this->image4_3_zoom_x);
+ xine_set_param(this->stream, XINE_PARAM_VO_ZOOM_Y, this->image4_3_zoom_y);
+ }
+ else if (17777 <= ratio && ratio <= 17779)
+ {
+ xine_set_param(this->stream, XINE_PARAM_VO_ZOOM_X, this->image16_9_zoom_x);
+ xine_set_param(this->stream, XINE_PARAM_VO_ZOOM_Y, this->image16_9_zoom_y);
+ }
+ }
+
+ pthread_mutex_unlock(&this->adjust_zoom_lock);
+}
+
+static off_t vdr_execute_rpc_command(vdr_input_plugin_t *this)
+{
+ data_union_t data_union;
+ off_t n;
+
+ n = vdr_read_abort(this->stream, this->fh_control, (char *)&data_union, sizeof (data_union.header));
+ if (n != sizeof (data_union.header))
+ return -1;
+
+ this->cur_func = data_union.header.func;
+ this->cur_size = data_union.header.len - sizeof (data_union.header);
+ this->cur_done = 0;
+
+ switch (this->cur_func)
+ {
+ case func_nop:
+ {
+ READ_DATA_OR_FAIL(nop, lprintf("got NOP\n"));
+ }
+ break;
+
+ case func_osd_new:
+ {
+ READ_DATA_OR_FAIL(osd_new, LOG_OSD(lprintf("got OSDNEW\n")));
+/*
+ LOG_OSD(lprintf("... (%d,%d)-(%d,%d)\n", data->x, data->y, data->width, data->height));
+
+ fprintf(stderr, "vdr: osdnew %d\n", data->window);
+*/
+ if (data->window >= VDR_MAX_NUM_WINDOWS)
+ return -1;
+
+ if (0 != this->osd_window[ data->window ])
+ return -1;
+
+ this->osd_window[ data->window ] = xine_osd_new(this->stream
+ , data->x
+ , data->y
+ , data->width
+ , data->height);
+
+ if (0 == this->osd_window[ data->window ])
+ return -1;
+ }
+ break;
+
+ case func_osd_free:
+ {
+ READ_DATA_OR_FAIL(osd_free, LOG_OSD(lprintf("got OSDFREE\n")));
+/*
+ fprintf(stderr, "vdr: osdfree %d\n", data->window);
+*/
+ if (data->window >= VDR_MAX_NUM_WINDOWS)
+ return -1;
+
+ if (0 != this->osd_window[ data->window ])
+ xine_osd_free(this->osd_window[ data->window ]);
+
+ this->osd_window[ data->window ] = 0;
+ }
+ break;
+
+ case func_osd_show:
+ {
+ READ_DATA_OR_FAIL(osd_show, LOG_OSD(lprintf("got OSDSHOW\n")));
+/*
+ fprintf(stderr, "vdr: osdshow %d\n", data->window);
+*/
+ if (data->window >= VDR_MAX_NUM_WINDOWS)
+ return -1;
+
+ if (0 != this->osd_window[ data->window ])
+ {
+ if (this->osd_unscaled_blending)
+ xine_osd_show_unscaled(this->osd_window[ data->window ], 0);
+ else
+ xine_osd_show(this->osd_window[ data->window ], 0);
+ }
+ }
+ break;
+
+ case func_osd_hide:
+ {
+ READ_DATA_OR_FAIL(osd_hide, LOG_OSD(lprintf("got OSDHIDE\n")));
+/*
+ fprintf(stderr, "vdr: osdhide %d\n", data->window);
+*/
+ if (data->window >= VDR_MAX_NUM_WINDOWS)
+ return -1;
+
+ if (0 != this->osd_window[ data->window ])
+ {
+ if (this->osd_unscaled_blending)
+ xine_osd_show_unscaled(this->osd_window[ data->window ], 0);
+ else
+ xine_osd_show(this->osd_window[ data->window ], 0);
+ }
+ }
+ break;
+
+ case func_osd_flush:
+ {
+ double _t1, _t2;
+ int _n = 0;
+ int _to = 0;
+ int r = 0;
+
+ READ_DATA_OR_FAIL(osd_flush, LOG_OSD(lprintf("got OSDFLUSH\n")));
+/*
+ fprintf(stderr, "vdr: osdflush +\n");
+*/
+ _t1 = _now();
+
+ while ((r = _x_query_unprocessed_osd_events(this->stream)))
+ {
+ if ((_now() - _t1) > 200)
+ {
+ _to = 1;
+ break;
+ }
+/*
+ fprintf(stderr, "redraw_needed: 1\n");
+*/
+/* sched_yield(); */
+ xine_usec_sleep(5000);
+ _n++;
+ }
+
+ _t2 = _now();
+ fprintf(stderr, "vdr: osdflush: n: %d, %.1lf, timeout: %d, result: %d\n", _n, _t2 - _t1, _to, r);
+/*
+ fprintf(stderr, "redraw_needed: 0\n");
+
+ fprintf(stderr, "vdr: osdflush -\n");
+*/
+ }
+ break;
+
+ case func_osd_set_position:
+ {
+ READ_DATA_OR_FAIL(osd_set_position, LOG_OSD(lprintf("got OSDSETPOSITION\n")));
+/*
+ fprintf(stderr, "vdr: osdsetposition %d\n", data->window);
+*/
+ if (data->window >= VDR_MAX_NUM_WINDOWS)
+ return -1;
+
+ if (0 != this->osd_window[ data->window ])
+ xine_osd_set_position(this->osd_window[ data->window ], data->x, data->y);
+ }
+ break;
+
+ case func_osd_draw_bitmap:
+ {
+ READ_DATA_OR_FAIL(osd_draw_bitmap, LOG_OSD(lprintf("got OSDDRAWBITMAP\n")));
+/*
+ fprintf(stderr, "vdr: osddrawbitmap %d\n", data->window);
+*/
+ if (this->osd_buffer_size < this->cur_size)
+ {
+ if (this->osd_buffer)
+ free(this->osd_buffer);
+
+ this->osd_buffer_size = 0;
+
+ this->osd_buffer = xine_xmalloc(this->cur_size);
+ if (!this->osd_buffer)
+ return -1;
+
+ this->osd_buffer_size = this->cur_size;
+ }
+
+ n = vdr_read_abort (this->stream, this->fh_control, (char *)this->osd_buffer, this->cur_size);
+ if (n != this->cur_size)
+ return -1;
+
+ this->cur_size -= n;
+
+ if (data->window >= VDR_MAX_NUM_WINDOWS)
+ return -1;
+
+ if (0 != this->osd_window[ data->window ])
+ xine_osd_draw_bitmap(this->osd_window[ data->window ], this->osd_buffer, data->x, data->y, data->width, data->height, 0);
+ }
+ break;
+
+ case func_set_color:
+ {
+ uint32_t vdr_color[ 256 ];
+
+ READ_DATA_OR_FAIL(set_color, lprintf("got SETCOLOR\n"));
+
+ if (((data->num + 1) * sizeof (uint32_t)) != this->cur_size)
+ return -1;
+
+ n = vdr_read_abort (this->stream, this->fh_control, (char *)&vdr_color[ data->index ], this->cur_size);
+ if (n != this->cur_size)
+ return -1;
+
+ this->cur_size -= n;
+
+ if (data->window >= VDR_MAX_NUM_WINDOWS)
+ return -1;
+
+ if (0 != this->osd_window[ data->window ])
+ {
+ uint32_t color[ 256 ];
+ uint8_t trans[ 256 ];
+
+ xine_osd_get_palette(this->osd_window[ data->window ], color, trans);
+
+ {
+ int i;
+
+ for (i = data->index; i <= (data->index + data->num); i++)
+ {
+ int a = (vdr_color[ i ] & 0xff000000) >> 0x18;
+ int r = (vdr_color[ i ] & 0x00ff0000) >> 0x10;
+ int g = (vdr_color[ i ] & 0x0000ff00) >> 0x08;
+ int b = (vdr_color[ i ] & 0x000000ff) >> 0x00;
+
+ int y = (( 66 * r + 129 * g + 25 * b + 128) >> 8) + 16;
+ int cr = ((112 * r - 94 * g - 18 * b + 128) >> 8) + 128;
+ int cb = ((-38 * r - 74 * g + 112 * b + 128) >> 8) + 128;
+
+ uint8_t *dst = (uint8_t *)&color[ i ];
+ *dst++ = cb;
+ *dst++ = cr;
+ *dst++ = y;
+ *dst++ = 0;
+
+ trans[ i ] = a >> 4;
+ }
+ }
+
+ xine_osd_set_palette(this->osd_window[ data->window ], color, trans);
+ }
+ }
+ break;
+
+ case func_play_external:
+ {
+ char file_name[ 1024 ];
+ int file_name_len = 0;
+
+ READ_DATA_OR_FAIL(play_external, lprintf("got PLAYEXTERNAL\n"));
+
+ file_name_len = this->cur_size;
+
+ if (0 != file_name_len)
+ {
+ if (file_name_len <= 1
+ || file_name_len > sizeof (file_name))
+ {
+ return -1;
+ }
+
+ n = vdr_read_abort (this->stream, this->fh_control, file_name, file_name_len);
+ if (n != file_name_len)
+ return -1;
+
+ if (file_name[ file_name_len - 1 ] != '\0')
+ return -1;
+
+ this->cur_size -= n;
+ }
+
+ lprintf((file_name_len > 0) ? "----------- play external: %s\n" : "---------- stop external\n", file_name);
+
+ if (file_name_len > 0)
+ external_stream_play(this, file_name);
+ else
+ external_stream_stop(this);
+ }
+ break;
+
+ case func_clear:
+ {
+ READ_DATA_OR_FAIL(clear, lprintf("got CLEAR\n"));
+
+ {
+ int orig_speed = xine_get_param(this->stream, XINE_PARAM_FINE_SPEED);
+ if (orig_speed <= 0)
+ xine_set_param(this->stream, XINE_PARAM_FINE_SPEED, XINE_FINE_SPEED_NORMAL);
+fprintf(stderr, "+++ CLEAR(%d%c)\n", data->n, data->s ? 'b' : 'a');
+/*
+ if (!this->dont_change_xine_volume)
+ xine_set_param(this->stream, XINE_PARAM_AUDIO_VOLUME, 0);
+*/
+ _x_demux_flush_engine(this->stream);
+fprintf(stderr, "=== CLEAR(%d.1)\n", data->n);
+ _x_demux_control_start(this->stream);
+fprintf(stderr, "=== CLEAR(%d.2)\n", data->n);
+ _x_demux_seek(this->stream, 0, 0, 0);
+fprintf(stderr, "=== CLEAR(%d.3)\n", data->n);
+
+ _x_stream_info_reset(this->stream, XINE_STREAM_INFO_AUDIO_BITRATE);
+fprintf(stderr, "=== CLEAR(%d.4)\n", data->n);
+ _x_meta_info_reset(this->stream, XINE_META_INFO_AUDIOCODEC);
+fprintf(stderr, "=== CLEAR(%d.5)\n", data->n);
+
+ _x_trigger_relaxed_frame_drop_mode(this->stream);
+/* _x_reset_relaxed_frame_drop_mode(this->stream); */
+/*
+ if (!this->dont_change_xine_volume)
+ xine_set_param(this->stream, XINE_PARAM_AUDIO_VOLUME, this->last_volume);
+*/
+fprintf(stderr, "--- CLEAR(%d%c)\n", data->n, data->s ? 'b' : 'a');
+ if (orig_speed <= 0)
+ xine_set_param(this->stream, XINE_PARAM_FINE_SPEED, orig_speed);
+ }
+ }
+ break;
+
+ case func_first_frame:
+ {
+ READ_DATA_OR_FAIL(first_frame, lprintf("got FIRST FRAME\n"));
+
+ _x_trigger_relaxed_frame_drop_mode(this->stream);
+/* _x_reset_relaxed_frame_drop_mode(this->stream); */
+ }
+ break;
+
+ case func_still_frame:
+ {
+ READ_DATA_OR_FAIL(still_frame, lprintf("got STILL FRAME\n"));
+
+ _x_reset_relaxed_frame_drop_mode(this->stream);
+ }
+ break;
+
+ case func_set_video_window:
+ {
+ READ_DATA_OR_FAIL(set_video_window, lprintf("got SET VIDEO WINDOW\n"));
+/*
+ fprintf(stderr, "svw: (%d, %d)x(%d, %d), (%d, %d)\n", data->x, data->y, data->w, data->h, data->wRef, data->hRef);
+*/
+ {
+ xine_event_t event;
+ vdr_set_video_window_data_t event_data;
+
+ event_data.x = data->x;
+ event_data.y = data->y;
+ event_data.w = data->w;
+ event_data.h = data->h;
+ event_data.w_ref = data->w_ref;
+ event_data.h_ref = data->h_ref;
+
+ event.type = XINE_EVENT_VDR_SETVIDEOWINDOW;
+ event.data = &event_data;
+ event.data_length = sizeof (event_data);
+
+ xine_event_send(this->stream, &event);
+ }
+ }
+ break;
+
+ case func_select_audio:
+ {
+ READ_DATA_OR_FAIL(select_audio, lprintf("got SELECT AUDIO\n"));
+
+ this->audio_channels = data->channels;
+
+ {
+ xine_event_t event;
+ vdr_select_audio_data_t event_data;
+
+ event_data.channels = this->audio_channels;
+
+ event.type = XINE_EVENT_VDR_SELECTAUDIO;
+ event.data = &event_data;
+ event.data_length = sizeof (event_data);
+
+ xine_event_send(this->stream, &event);
+ }
+ }
+ break;
+
+ case func_trick_speed_mode:
+ {
+ READ_DATA_OR_FAIL(trick_speed_mode, lprintf("got TRICK SPEED MODE\n"));
+
+ if (this->trick_speed_mode != data->on)
+ {
+fprintf(stderr, "ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß\n");
+ this->trick_speed_mode = data->on;
+
+ _x_demux_seek(this->stream, 0, 0, 0);
+
+ {
+ xine_event_t event;
+
+ event.type = XINE_EVENT_VDR_TRICKSPEEDMODE;
+ event.data = 0;
+ event.data_length = this->trick_speed_mode;
+/* fprintf(stderr, "************************: %p, %d\n", event.data, event.data_length); */
+ xine_event_send(this->stream, &event);
+ }
+ }
+ }
+ break;
+
+ case func_flush:
+ {
+ READ_DATA_OR_FAIL(flush, lprintf("got FLUSH\n"));
+
+ if (!data->just_wait)
+ {
+ if (this->stream->video_fifo)
+ {
+ buf_element_t *buf = this->stream->video_fifo->buffer_pool_alloc(this->stream->video_fifo);
+ if (!buf)
+ {
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG, _("%s: buffer_pool_alloc() failed!\n"), LOG_MODULE);
+ return -1;
+ }
+
+ buf->type = BUF_CONTROL_FLUSH_DECODER;
+
+ this->stream->video_fifo->put(this->stream->video_fifo, buf);
+ }
+ }
+
+ {
+ double _t1, _t2;
+ int _n = 0;
+
+ int vb = -1, ab = -1, vf = -1, af = -1;
+
+ uint8_t timed_out = 0;
+
+ struct timeval now, then;
+
+ if (data->ms_timeout >= 0)
+ {
+ gettimeofday(&now, 0);
+
+ then = now;
+ then.tv_usec += (data->ms_timeout % 1000) * 1000;
+ then.tv_sec += (data->ms_timeout / 1000);
+
+ if (then.tv_usec >= 1000000)
+ {
+ then.tv_usec -= 1000000;
+ then.tv_sec += 1;
+ }
+ }
+ else
+ {
+ then.tv_usec = 0;
+ then.tv_sec = 0;
+ }
+
+ _t1 = _now();
+
+ while (1)
+ {
+ _x_query_buffer_usage(this->stream, &vb, &ab, &vf, &af);
+
+ if (vb <= 0 && ab <= 0 && vf <= 0 && af <= 0)
+ break;
+
+ if (data->ms_timeout >= 0
+ && timercmp(&now, &then, >=))
+ {
+ timed_out++;
+ break;
+ }
+
+/* sched_yield(); */
+ xine_usec_sleep(5000);
+ _n++;
+
+ if (data->ms_timeout >= 0)
+ gettimeofday(&now, 0);
+ }
+
+ _t2 = _now();
+ fprintf(stderr, "vdr: flush: n: %d, %.1lf\n", _n, _t2 - _t1);
+
+ xprintf(this->stream->xine
+ , XINE_VERBOSITY_LOG
+ , _("%s: flush buffers (vb: %d, ab: %d, vf: %d, af: %d) %s.\n")
+ , LOG_MODULE, vb, ab, vf, af
+ , (timed_out ? "timed out" : "done"));
+
+ {
+ result_flush_t result_flush;
+ result_flush.header.func = data->header.func;
+ result_flush.header.len = sizeof (result_flush);
+
+ result_flush.timed_out = timed_out;
+
+ if (sizeof (result_flush) != vdr_write(this->fh_result, &result_flush, sizeof (result_flush)))
+ return -1;
+ }
+ }
+ }
+ break;
+
+ case func_mute:
+ {
+ READ_DATA_OR_FAIL(mute, lprintf("got MUTE\n"));
+
+ {
+ int param_mute = (this->volume_mode == INPUT_VDR_VOLUME_CHANGE_SW) ? XINE_PARAM_AUDIO_AMP_MUTE : XINE_PARAM_AUDIO_MUTE;
+ xine_set_param(this->stream, param_mute, data->mute);
+ }
+ }
+ break;
+
+ case func_set_volume:
+ {
+ READ_DATA_OR_FAIL(set_volume, lprintf("got SETVOLUME\n"));
+
+ {
+ int change_volume = (this->volume_mode != INPUT_VDR_VOLUME_IGNORE);
+ int do_mute = (this->last_volume != 0 && 0 == data->volume);
+ int do_unmute = (this->last_volume <= 0 && 0 != data->volume);
+ int report_change = 0;
+
+ int param_mute = (this->volume_mode == INPUT_VDR_VOLUME_CHANGE_SW) ? XINE_PARAM_AUDIO_AMP_MUTE : XINE_PARAM_AUDIO_MUTE;
+ int param_volume = (this->volume_mode == INPUT_VDR_VOLUME_CHANGE_SW) ? XINE_PARAM_AUDIO_AMP_LEVEL : XINE_PARAM_AUDIO_VOLUME;
+
+ this->last_volume = data->volume;
+
+ if (do_mute || do_unmute)
+ {
+ switch (this->mute_mode)
+ {
+ case INPUT_VDR_MUTE_EXECUTE:
+ report_change = 1;
+ xine_set_param(this->stream, param_mute, do_mute);
+
+ case INPUT_VDR_MUTE_IGNORE:
+ if (do_mute)
+ change_volume = 0;
+ break;
+
+ case INPUT_VDR_MUTE_SIMULATE:
+ change_volume = 1;
+ break;
+
+ default:
+ return -1;
+ };
+ }
+
+ if (change_volume)
+ {
+ report_change = 1;
+ xine_set_param(this->stream, param_volume, this->last_volume);
+ }
+
+ if (report_change && this->volume_mode != INPUT_VDR_VOLUME_CHANGE_SW)
+ {
+ xine_event_t event;
+ xine_audio_level_data_t data;
+
+ data.left
+ = data.right
+ = xine_get_param(this->stream, param_volume);
+ data.mute
+ = xine_get_param(this->stream, param_mute);
+
+ event.type = XINE_EVENT_AUDIO_LEVEL;
+ event.data = &data;
+ event.data_length = sizeof (data);
+
+ xine_event_send(this->stream, &event);
+ }
+ }
+ }
+ break;
+
+ case func_set_speed:
+ {
+ READ_DATA_OR_FAIL(set_speed, lprintf("got SETSPEED\n"));
+
+ lprintf("... got SETSPEED %d\n", data->speed);
+
+ if (data->speed != xine_get_param(this->stream, XINE_PARAM_FINE_SPEED))
+ xine_set_param(this->stream, XINE_PARAM_FINE_SPEED, data->speed);
+ }
+ break;
+
+ case func_set_prebuffer:
+ {
+ READ_DATA_OR_FAIL(set_prebuffer, lprintf("got SETPREBUFFER\n"));
+
+ xine_set_param(this->stream, XINE_PARAM_METRONOM_PREBUFFER, data->prebuffer);
+ }
+ break;
+
+ case func_metronom:
+ {
+ READ_DATA_OR_FAIL(metronom, lprintf("got METRONOM\n"));
+
+ _x_demux_control_newpts(this->stream, data->pts, data->flags);
+ }
+ break;
+
+ case func_start:
+ {
+ READ_DATA_OR_FAIL(start, lprintf("got START\n"));
+
+ _x_demux_control_start(this->stream);
+ _x_demux_seek(this->stream, 0, 0, 0);
+ }
+ break;
+
+ case func_wait:
+ {
+ READ_DATA_OR_FAIL(wait, lprintf("got WAIT\n"));
+
+ {
+ result_wait_t result_wait;
+ result_wait.header.func = data->header.func;
+ result_wait.header.len = sizeof (result_wait);
+
+ if (sizeof (result_wait) != vdr_write(this->fh_result, &result_wait, sizeof (result_wait)))
+ return -1;
+ }
+ }
+ break;
+
+ case func_setup:
+ {
+ READ_DATA_OR_FAIL(setup, lprintf("got SETUP\n"));
+
+ this->osd_unscaled_blending = data->osd_unscaled_blending;
+ this->volume_mode = data->volume_mode;
+ this->mute_mode = data->mute_mode;
+ this->image4_3_zoom_x = data->image4_3_zoom_x;
+ this->image4_3_zoom_y = data->image4_3_zoom_y;
+ this->image16_9_zoom_x = data->image16_9_zoom_x;
+ this->image16_9_zoom_y = data->image16_9_zoom_y;
+
+ adjust_zoom(this);
+ }
+ break;
+
+ case func_grab_image:
+ {
+ READ_DATA_OR_FAIL(grab_image, lprintf("got GRABIMAGE\n"));
+
+ {
+ off_t ret_val = -1;
+
+ uint8_t *img = 0;
+ int frame_size = 0;
+ int width = 0;
+ int height = 0;
+ int ratio_code = 0;
+ int format = 0;
+
+ int orig_speed = xine_get_param(this->stream, XINE_PARAM_FINE_SPEED);
+ if (XINE_SPEED_PAUSE != orig_speed)
+ xine_set_param(this->stream, XINE_PARAM_FINE_SPEED, XINE_SPEED_PAUSE);
+
+ if (xine_get_current_frame(this->stream, &width, &height, &ratio_code, &format, 0))
+ {
+ switch (format)
+ {
+ case XINE_IMGFMT_YV12:
+ frame_size = width * height
+ + ((width + 1) / 2) * ((height + 1) / 2)
+ + ((width + 1) / 2) * ((height + 1) / 2);
+ break;
+
+ case XINE_IMGFMT_YUY2:
+ frame_size = width * height
+ + ((width + 1) / 2) * height
+ + ((width + 1) / 2) * height;
+ break;
+ }
+
+ img = xine_xmalloc(frame_size);
+
+ if (!xine_get_current_frame(this->stream, &width, &height, &ratio_code, &format, img))
+ frame_size = 0;
+
+ if (ratio_code == XINE_VO_ASPECT_SQUARE)
+ ratio_code = 10000;
+ else if (ratio_code == XINE_VO_ASPECT_4_3)
+ ratio_code = 13333;
+ else if (ratio_code == XINE_VO_ASPECT_ANAMORPHIC)
+ ratio_code = 17778;
+ else if (ratio_code == XINE_VO_ASPECT_DVB)
+ ratio_code = 21100;
+
+ if (0 == frame_size)
+ {
+ width = 0;
+ height = 0;
+ ratio_code = 0;
+ }
+ }
+
+ if (XINE_SPEED_PAUSE != orig_speed)
+ xine_set_param(this->stream, XINE_PARAM_FINE_SPEED, orig_speed);
+
+ {
+ result_grab_image_t result_grab_image;
+ result_grab_image.header.func = data->header.func;
+ result_grab_image.header.len = sizeof (result_grab_image) + frame_size;
+
+ result_grab_image.width = width;
+ result_grab_image.height = height;
+ result_grab_image.ratio = ratio_code;
+ result_grab_image.format = format;
+
+ if (sizeof (result_grab_image) == vdr_write(this->fh_result, &result_grab_image, sizeof (result_grab_image)))
+ {
+ if (frame_size == vdr_write(this->fh_result, img, frame_size))
+ ret_val = 0;
+ }
+ }
+
+ if (img)
+ free(img);
+
+ if (ret_val != 0)
+ return ret_val;
+ }
+ }
+ break;
+
+ case func_get_pts:
+ {
+ READ_DATA_OR_FAIL(get_pts, lprintf("got GETPTS\n"));
+
+ {
+ result_get_pts_t result_get_pts;
+ result_get_pts.header.func = data->header.func;
+ result_get_pts.header.len = sizeof (result_get_pts);
+
+ result_get_pts.pts = xine_get_current_vpts(this->stream) - this->stream->metronom->get_option(this->stream->metronom, METRONOM_VPTS_OFFSET);
+
+ if (sizeof (result_get_pts) != vdr_write(this->fh_result, &result_get_pts, sizeof (result_get_pts)))
+ return -1;
+ }
+ }
+ break;
+
+ case func_get_version:
+ {
+ READ_DATA_OR_FAIL(get_version, lprintf("got GETVERSION\n"));
+
+ {
+ result_get_version_t result_get_version;
+ result_get_version.header.func = data->header.func;
+ result_get_version.header.len = sizeof (result_get_version);
+
+ result_get_version.version = XINE_INPUT_VDR_VERSION;
+
+ if (sizeof (result_get_version) != vdr_write(this->fh_result, &result_get_version, sizeof (result_get_version)))
+ return -1;
+ }
+ }
+ break;
+
+ case func_video_size:
+ {
+ READ_DATA_OR_FAIL(video_size, lprintf("got VIDEO SIZE\n"));
+
+ {
+ int format;
+
+ result_video_size_t result_video_size;
+ result_video_size.header.func = data->header.func;
+ result_video_size.header.len = sizeof (result_video_size);
+
+ result_video_size.top = -1;
+ result_video_size.left = -1;
+ result_video_size.width = -1;
+ result_video_size.height = -1;
+ result_video_size.ratio = 0;
+
+ xine_get_current_frame(this->stream, &result_video_size.width, &result_video_size.height, &result_video_size.ratio, &format, 0);
+
+ if (result_video_size.ratio == XINE_VO_ASPECT_SQUARE)
+ result_video_size.ratio = 10000;
+ else if (result_video_size.ratio == XINE_VO_ASPECT_4_3)
+ result_video_size.ratio = 13333;
+ else if (result_video_size.ratio == XINE_VO_ASPECT_ANAMORPHIC)
+ result_video_size.ratio = 17778;
+ else if (result_video_size.ratio == XINE_VO_ASPECT_DVB)
+ result_video_size.ratio = 21100;
+
+ if (0 != this->frame_size.x
+ || 0 != this->frame_size.y
+ || 0 != this->frame_size.w
+ || 0 != this->frame_size.h)
+ {
+ result_video_size.left = this->frame_size.x;
+ result_video_size.top = this->frame_size.y;
+ result_video_size.width = this->frame_size.w;
+ result_video_size.height = this->frame_size.h;
+ }
+//fprintf(stderr, "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE\n");
+ result_video_size.zoom_x = xine_get_param(this->stream, XINE_PARAM_VO_ZOOM_X);
+ result_video_size.zoom_y = xine_get_param(this->stream, XINE_PARAM_VO_ZOOM_Y);
+//fprintf(stderr, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\n");
+ if (sizeof (result_video_size) != vdr_write(this->fh_result, &result_video_size, sizeof (result_video_size)))
+ return -1;
+//fprintf(stderr, "GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG\n");
+ }
+ }
+ break;
+
+ case func_reset_audio:
+ {
+ double _t1, _t2;
+ int _n = 0;
+
+ READ_DATA_OR_FAIL(reset_audio, lprintf("got RESET AUDIO\n"));
+
+ if (this->stream->audio_fifo)
+ {
+ xine_set_param(this->stream, XINE_PARAM_IGNORE_AUDIO, 1);
+ xine_set_param(this->stream, XINE_PARAM_AUDIO_CHANNEL_LOGICAL, -2);
+
+ _t1 = _now();
+
+ while (1)
+ {
+ int n = xine_get_stream_info(this->stream, XINE_STREAM_INFO_MAX_AUDIO_CHANNEL);
+ if (n <= 0)
+ break;
+
+ /* keep the decoder running */
+ if (this->stream->audio_fifo)
+ {
+ buf_element_t *buf = this->stream->audio_fifo->buffer_pool_alloc(this->stream->audio_fifo);
+ if (!buf)
+ {
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG, _("%s: buffer_pool_alloc() failed!\n"), LOG_MODULE);
+ return -1;
+ }
+
+ buf->type = BUF_CONTROL_RESET_TRACK_MAP;
+
+ this->stream->audio_fifo->put(this->stream->audio_fifo, buf);
+ }
+
+/* sched_yield(); */
+ xine_usec_sleep(5000);
+ _n++;
+ }
+
+ _t2 = _now();
+ fprintf(stderr, "vdr: reset_audio: n: %d, %.1lf\n", _n, _t2 - _t1);
+
+ xine_set_param(this->stream, XINE_PARAM_AUDIO_CHANNEL_LOGICAL, -1);
+
+ _x_stream_info_reset(this->stream, XINE_STREAM_INFO_AUDIO_BITRATE);
+ _x_meta_info_reset(this->stream, XINE_META_INFO_AUDIOCODEC);
+
+ xine_set_param(this->stream, XINE_PARAM_IGNORE_AUDIO, 0);
+ }
+ }
+ break;
+
+ default:
+ lprintf("unknown function: %d\n", this->cur_func);
+ }
+
+ if (this->cur_size != this->cur_done)
+ {
+ off_t skip = this->cur_size - this->cur_done;
+
+ lprintf("func: %d, skipping: %lld\n", this->cur_func, skip);
+
+ while (skip > BUF_SIZE)
+ {
+ n = vdr_read_abort(this->stream, this->fh_control, this->seek_buf, BUF_SIZE);
+ if (n != BUF_SIZE)
+ return -1;
+
+ skip -= BUF_SIZE;
+ }
+
+ n = vdr_read_abort(this->stream, this->fh_control, this->seek_buf, skip);
+ if (n != skip)
+ return -1;
+
+ this->cur_done = this->cur_size;
+
+ return -1;
+ }
+
+ return 0;
+}
+
+static void *vdr_rpc_thread_loop(void *arg)
+{
+ vdr_input_plugin_t *this = (vdr_input_plugin_t *)arg;
+ int frontend_lock_failures = 0;
+ int failed = 0;
+
+ while (!failed
+ && !this->rpc_thread_shutdown)
+ {
+ struct timeval timeout;
+ fd_set rset;
+
+ FD_ZERO(&rset);
+ FD_SET(this->fh_control, &rset);
+
+ timeout.tv_sec = 0;
+ timeout.tv_usec = 50000;
+
+ if (select(this->fh_control + 1, &rset, NULL, NULL, &timeout) > 0)
+ {
+ if (!_x_lock_frontend(this->stream, 100))
+ {
+ if (++frontend_lock_failures > 50)
+ {
+ failed = 1;
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ LOG_MODULE ": locking frontend for rpc command execution failed, exiting ...\n");
+ }
+ }
+ else
+ {
+ frontend_lock_failures = 0;
+
+ if (_x_lock_port_rewiring(this->stream->xine, 100))
+ {
+ if (vdr_execute_rpc_command(this) < 0)
+ {
+ failed = 1;
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ LOG_MODULE ": execution of rpc command %d (%s) failed, exiting ...\n", this->cur_func, "");
+ }
+
+ _x_unlock_port_rewiring(this->stream->xine);
+ }
+
+ _x_unlock_frontend(this->stream);
+ }
+ }
+ }
+
+ /* close control and result channel here to have vdr-xine initiate a disconnect for the above error case ... */
+ close(this->fh_control);
+ this->fh_control = -1;
+
+ close(this->fh_result);
+ this->fh_result = -1;
+
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ LOG_MODULE ": rpc thread done.\n");
+
+ pthread_mutex_lock(&this->rpc_thread_shutdown_lock);
+ this->rpc_thread_shutdown = -1;
+ pthread_cond_broadcast(&this->rpc_thread_shutdown_cond);
+ pthread_mutex_unlock(&this->rpc_thread_shutdown_lock);
+
+ return 0;
+}
+
+static int internal_write_event_key(vdr_input_plugin_t *this, uint32_t key)
+{
+ event_key_t event;
+ event.header.func = func_key;
+ event.header.len = sizeof (event);
+
+ event.key = key;
+
+ if (sizeof (event) != vdr_write(this->fh_event, &event, sizeof (event)))
+ return -1;
+
+ return 0;
+}
+
+static int internal_write_event_frame_size(vdr_input_plugin_t *this)
+{
+ event_frame_size_t event;
+ event.header.func = func_frame_size;
+ event.header.len = sizeof (event);
+
+ event.left = this->frame_size.x;
+ event.top = this->frame_size.y;
+ event.width = this->frame_size.w,
+ event.height = this->frame_size.h;
+ event.zoom_x = xine_get_param(this->stream, XINE_PARAM_VO_ZOOM_X);
+ event.zoom_y = xine_get_param(this->stream, XINE_PARAM_VO_ZOOM_Y);
+
+ if (sizeof (event) != vdr_write(this->fh_event, &event, sizeof (event)))
+ return -1;
+
+ return 0;
+}
+
+static int internal_write_event_play_external(vdr_input_plugin_t *this, uint32_t key)
+{
+ event_play_external_t event;
+ event.header.func = func_play_external;
+ event.header.len = sizeof (event);
+
+ event.key = key;
+
+ if (sizeof (event) != vdr_write(this->fh_event, &event, sizeof (event)))
+ return -1;
+
+ return 0;
+}
+
+static off_t vdr_plugin_read(input_plugin_t *this_gen,
+ void *buf_gen, off_t len)
+{
+ vdr_input_plugin_t *this = (vdr_input_plugin_t *) this_gen;
+ char *buf = (char *)buf_gen;
+ off_t n, total;
+#ifdef LOG_READ
+ lprintf ("reading %lld bytes...\n", len);
+#endif
+ total=0;
+ if (this->curpos < this->preview_size)
+ {
+ n = this->preview_size - this->curpos;
+ if (n > (len - total))
+ n = len - total;
+#ifdef LOG_READ
+ lprintf ("%lld bytes from preview (which has %lld bytes)\n",
+ n, this->preview_size);
+#endif
+ memcpy (&buf[total], &this->preview[this->curpos], n);
+ this->curpos += n;
+ total += n;
+ }
+
+ if( (len-total) > 0 )
+ {
+ int retries = 0;
+ do
+ {
+ n = vdr_read_abort (this->stream, this->fh, &buf[total], len-total);
+ if (0 == n)
+ lprintf("read 0, retries: %d\n", retries);
+ }
+ while (0 == n
+ && !this->stream_external
+ && _x_continue_stream_processing(this->stream)
+ && 200 > retries++); /* 200 * 50ms */
+#ifdef LOG_READ
+ lprintf ("got %lld bytes (%lld/%lld bytes read)\n",
+ n,total,len);
+#endif
+ if (n < 0)
+ {
+ _x_message(this->stream, XINE_MSG_READ_ERROR, NULL);
+ return 0;
+ }
+
+ this->curpos += n;
+ total += n;
+ }
+ return total;
+}
+
+static buf_element_t *vdr_plugin_read_block(input_plugin_t *this_gen, fifo_buffer_t *fifo,
+ off_t todo)
+{
+ off_t total_bytes;
+ buf_element_t *buf = fifo->buffer_pool_alloc(fifo);
+
+ buf->content = buf->mem;
+ buf->type = BUF_DEMUX_BLOCK;
+
+ total_bytes = vdr_plugin_read(this_gen, (char *)buf->content, todo);
+
+ if (total_bytes != todo)
+ {
+ buf->free_buffer(buf);
+ return NULL;
+ }
+
+ buf->size = total_bytes;
+
+ return buf;
+}
+
+/* forward reference */
+static off_t vdr_plugin_get_current_pos(input_plugin_t *this_gen);
+
+static off_t vdr_plugin_seek(input_plugin_t *this_gen, off_t offset, int origin)
+{
+ vdr_input_plugin_t *this = (vdr_input_plugin_t *)this_gen;
+
+ lprintf("seek %lld offset, %d origin...\n",
+ offset, origin);
+
+ if ((origin == SEEK_CUR) && (offset >= 0))
+ {
+ for ( ; ((int)offset) - BUF_SIZE > 0; offset -= BUF_SIZE)
+ {
+ if (!this_gen->read(this_gen, this->seek_buf, BUF_SIZE))
+ return this->curpos;
+ }
+
+ this_gen->read (this_gen, this->seek_buf, offset);
+ }
+
+ if (origin == SEEK_SET)
+ {
+ if (offset < this->curpos)
+ {
+ if (this->curpos <= this->preview_size)
+ this->curpos = offset;
+ else
+ lprintf("cannot seek back! (%lld > %lld)\n", this->curpos, offset);
+ }
+ else
+ {
+ offset -= this->curpos;
+
+ for ( ; ((int)offset) - BUF_SIZE > 0; offset -= BUF_SIZE)
+ {
+ if (!this_gen->read(this_gen, this->seek_buf, BUF_SIZE))
+ return this->curpos;
+ }
+
+ this_gen->read(this_gen, this->seek_buf, offset);
+ }
+ }
+
+ return this->curpos;
+}
+
+static off_t vdr_plugin_get_length(input_plugin_t *this_gen)
+{
+ return 0;
+}
+
+static uint32_t vdr_plugin_get_capabilities(input_plugin_t *this_gen)
+{
+ return INPUT_CAP_NOCAP; /* INPUT_CAP_PREVIEW; */
+}
+
+static uint32_t vdr_plugin_get_blocksize(input_plugin_t *this_gen)
+{
+ return 0;
+}
+
+static off_t vdr_plugin_get_current_pos(input_plugin_t *this_gen)
+{
+ vdr_input_plugin_t *this = (vdr_input_plugin_t *)this_gen;
+
+ return this->curpos;
+}
+
+static const char *vdr_plugin_get_mrl(input_plugin_t *this_gen)
+{
+ vdr_input_plugin_t *this = (vdr_input_plugin_t *)this_gen;
+
+ return this->mrl;
+}
+
+static void vdr_plugin_dispose(input_plugin_t *this_gen)
+{
+ vdr_input_plugin_t *this = (vdr_input_plugin_t *)this_gen;
+ int i;
+
+ external_stream_stop(this);
+
+ if (this->event_queue)
+ xine_event_dispose_queue(this->event_queue);
+
+ if (this->rpc_thread)
+ {
+ struct timespec abstime;
+ int ms_to_time_out = 10000;
+
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG, _("%s: shutting down rpc thread (timeout: %d ms) ...\n"), LOG_MODULE, ms_to_time_out);
+
+ pthread_mutex_lock(&this->rpc_thread_shutdown_lock);
+
+ if (this->rpc_thread_shutdown > -1)
+ {
+ this->rpc_thread_shutdown = 1;
+
+ {
+ struct timeval now;
+ gettimeofday(&now, 0);
+
+ abstime.tv_sec = now.tv_sec + ms_to_time_out / 1000;
+ abstime.tv_nsec = now.tv_usec * 1000 + (ms_to_time_out % 1000) * 1e6;
+
+ if (abstime.tv_nsec > 1e9)
+ {
+ abstime.tv_nsec -= 1e9;
+ abstime.tv_sec++;
+ }
+ }
+
+ if (0 != pthread_cond_timedwait(&this->rpc_thread_shutdown_cond, &this->rpc_thread_shutdown_lock, &abstime))
+ {
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG, _("%s: cancelling rpc thread in function %d...\n"), LOG_MODULE, this->cur_func);
+ pthread_cancel(this->rpc_thread);
+ }
+ }
+
+ pthread_mutex_unlock(&this->rpc_thread_shutdown_lock);
+
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG, _("%s: joining rpc thread ...\n"), LOG_MODULE);
+ pthread_join(this->rpc_thread, 0);
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG, _("%s: rpc thread joined.\n"), LOG_MODULE);
+ }
+
+ pthread_cond_destroy(&this->rpc_thread_shutdown_cond);
+ pthread_mutex_destroy(&this->rpc_thread_shutdown_lock);
+
+ pthread_mutex_destroy(&this->adjust_zoom_lock);
+
+ if (this->fh_result != -1)
+ close(this->fh_result);
+
+ if (this->fh_control != -1)
+ close(this->fh_control);
+
+ if (this->fh_event != -1)
+ close(this->fh_event);
+
+ for (i = 0; i < VDR_MAX_NUM_WINDOWS; i++)
+ {
+ if (0 == this->osd_window[ i ])
+ continue;
+
+ xine_osd_hide(this->osd_window[ i ], 0);
+ xine_osd_free(this->osd_window[ i ]);
+ }
+
+ if (this->osd_buffer)
+ free(this->osd_buffer);
+
+ if ((this->fh != STDIN_FILENO) && (this->fh != -1))
+ close(this->fh);
+
+ free(this->mrl);
+ free(this);
+}
+
+static int vdr_plugin_get_optional_data(input_plugin_t *this_gen,
+ void *data, int data_type)
+{
+ vdr_input_plugin_t *this = (vdr_input_plugin_t *)this_gen;
+ int preview_size = (this->preview_size > MAX_PREVIEW_SIZE) ? MAX_PREVIEW_SIZE : this->preview_size;
+ (void)preview_size;
+/*
+ switch (data_type)
+ {
+ case INPUT_OPTIONAL_DATA_PREVIEW:
+ memcpy (data, this->preview, preview_size);
+ return preview_size;
+ }
+*/
+ return INPUT_OPTIONAL_UNSUPPORTED;
+}
+
+static uint8_t preview_mpg_data[] =
+{
+/* 0x0000 */ 0x00, 0x00, 0x01, 0xb3, 0x2d, 0x02, 0x40, 0x23, 0x12, 0x4f, 0xa3, 0x80, 0x00, 0x00, 0x01, 0xb5,
+/* 0x0010 */ 0x14, 0x82, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0xb5, 0x23, 0x05, 0x05, 0x05, 0x0b, 0x42,
+/* 0x0020 */ 0x12, 0x00, 0x00, 0x00, 0x01, 0xb8, 0x00, 0x08, 0x00, 0x40, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0f,
+/* 0x0030 */ 0xff, 0xf8, 0x00, 0x00, 0x01, 0xb5, 0x8f, 0xff, 0xf7, 0xdd, 0x80, 0x00, 0x00, 0x01, 0x01, 0x0b,
+/* 0x0040 */ 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
+/* 0x0050 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
+/* 0x0060 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
+/* 0x0070 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
+/* 0x0080 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
+/* 0x0090 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
+/* 0x00a0 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
+/* 0x00b0 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
+/* 0x00c0 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
+/* 0x00d0 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
+/* 0x00e0 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
+/* 0x00f0 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
+/* 0x0100 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
+/* 0x0110 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
+/* 0x0120 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00,
+/* 0x0130 */ 0x01, 0x02, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
+/* 0x0140 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
+/* 0x0150 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
+/* 0x0160 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
+/* 0x0170 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
+/* 0x0180 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
+/* 0x0190 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
+/* 0x01a0 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
+/* 0x01b0 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
+/* 0x01c0 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
+/* 0x01d0 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
+/* 0x01e0 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
+/* 0x01f0 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
+/* 0x0200 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
+/* 0x0210 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
+/* 0x0220 */ 0x60, 0x00, 0x00, 0x01, 0x03, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
+/* 0x0230 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
+/* 0x0240 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
+/* 0x0250 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
+/* 0x0260 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
+/* 0x0270 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
+/* 0x0280 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
+/* 0x0290 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
+/* 0x02a0 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
+/* 0x02b0 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
+/* 0x02c0 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
+/* 0x02d0 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
+/* 0x02e0 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
+/* 0x02f0 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
+/* 0x0300 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
+/* 0x0310 */ 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x04, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
+/* 0x0320 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
+/* 0x0330 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
+/* 0x0340 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
+/* 0x0350 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
+/* 0x0360 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
+/* 0x0370 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
+/* 0x0380 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
+/* 0x0390 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
+/* 0x03a0 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
+/* 0x03b0 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
+/* 0x03c0 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
+/* 0x03d0 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
+/* 0x03e0 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
+/* 0x03f0 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
+/* 0x0400 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x05, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3,
+/* 0x0410 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
+/* 0x0420 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
+/* 0x0430 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
+/* 0x0440 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
+/* 0x0450 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
+/* 0x0460 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
+/* 0x0470 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
+/* 0x0480 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
+/* 0x0490 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
+/* 0x04a0 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
+/* 0x04b0 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
+/* 0x04c0 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
+/* 0x04d0 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
+/* 0x04e0 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
+/* 0x04f0 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x06, 0x0b, 0xfc,
+/* 0x0500 */ 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
+/* 0x0510 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
+/* 0x0520 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
+/* 0x0530 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
+/* 0x0540 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
+/* 0x0550 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
+/* 0x0560 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
+/* 0x0570 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
+/* 0x0580 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
+/* 0x0590 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
+/* 0x05a0 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
+/* 0x05b0 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
+/* 0x05c0 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
+/* 0x05d0 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
+/* 0x05e0 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01,
+/* 0x05f0 */ 0x07, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
+/* 0x0600 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
+/* 0x0610 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
+/* 0x0620 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
+/* 0x0630 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
+/* 0x0640 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
+/* 0x0650 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
+/* 0x0660 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
+/* 0x0670 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
+/* 0x0680 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
+/* 0x0690 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
+/* 0x06a0 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
+/* 0x06b0 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
+/* 0x06c0 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
+/* 0x06d0 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60,
+/* 0x06e0 */ 0x00, 0x00, 0x01, 0x08, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
+/* 0x06f0 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
+/* 0x0700 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
+/* 0x0710 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
+/* 0x0720 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
+/* 0x0730 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
+/* 0x0740 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
+/* 0x0750 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
+/* 0x0760 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
+/* 0x0770 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
+/* 0x0780 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
+/* 0x0790 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
+/* 0x07a0 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
+/* 0x07b0 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
+/* 0x07c0 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
+/* 0x07d0 */ 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x09, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
+/* 0x07e0 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
+/* 0x07f0 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
+/* 0x0800 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
+/* 0x0810 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
+/* 0x0820 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
+/* 0x0830 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
+/* 0x0840 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
+/* 0x0850 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
+/* 0x0860 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
+/* 0x0870 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
+/* 0x0880 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
+/* 0x0890 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
+/* 0x08a0 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
+/* 0x08b0 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
+/* 0x08c0 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x0a, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46,
+/* 0x08d0 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
+/* 0x08e0 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
+/* 0x08f0 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
+/* 0x0900 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
+/* 0x0910 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
+/* 0x0920 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
+/* 0x0930 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
+/* 0x0940 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
+/* 0x0950 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
+/* 0x0960 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
+/* 0x0970 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
+/* 0x0980 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
+/* 0x0990 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
+/* 0x09a0 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
+/* 0x09b0 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x0b, 0x0b, 0xfc, 0x3e,
+/* 0x09c0 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
+/* 0x09d0 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
+/* 0x09e0 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
+/* 0x09f0 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
+/* 0x0a00 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
+/* 0x0a10 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
+/* 0x0a20 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
+/* 0x0a30 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
+/* 0x0a40 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
+/* 0x0a50 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
+/* 0x0a60 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
+/* 0x0a70 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
+/* 0x0a80 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
+/* 0x0a90 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
+/* 0x0aa0 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x0c,
+/* 0x0ab0 */ 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
+/* 0x0ac0 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
+/* 0x0ad0 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
+/* 0x0ae0 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
+/* 0x0af0 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
+/* 0x0b00 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
+/* 0x0b10 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
+/* 0x0b20 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
+/* 0x0b30 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
+/* 0x0b40 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
+/* 0x0b50 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
+/* 0x0b60 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
+/* 0x0b70 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
+/* 0x0b80 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
+/* 0x0b90 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00,
+/* 0x0ba0 */ 0x00, 0x01, 0x0d, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
+/* 0x0bb0 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
+/* 0x0bc0 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
+/* 0x0bd0 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
+/* 0x0be0 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
+/* 0x0bf0 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
+/* 0x0c00 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
+/* 0x0c10 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
+/* 0x0c20 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
+/* 0x0c30 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
+/* 0x0c40 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
+/* 0x0c50 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
+/* 0x0c60 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
+/* 0x0c70 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
+/* 0x0c80 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
+/* 0x0c90 */ 0x18, 0x60, 0x00, 0x00, 0x01, 0x0e, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
+/* 0x0ca0 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
+/* 0x0cb0 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
+/* 0x0cc0 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
+/* 0x0cd0 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
+/* 0x0ce0 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
+/* 0x0cf0 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
+/* 0x0d00 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
+/* 0x0d10 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
+/* 0x0d20 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
+/* 0x0d30 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
+/* 0x0d40 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
+/* 0x0d50 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
+/* 0x0d60 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
+/* 0x0d70 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
+/* 0x0d80 */ 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x0f, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18,
+/* 0x0d90 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
+/* 0x0da0 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
+/* 0x0db0 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
+/* 0x0dc0 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
+/* 0x0dd0 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
+/* 0x0de0 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
+/* 0x0df0 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
+/* 0x0e00 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
+/* 0x0e10 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
+/* 0x0e20 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
+/* 0x0e30 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
+/* 0x0e40 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
+/* 0x0e50 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
+/* 0x0e60 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
+/* 0x0e70 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x10, 0x0b, 0xfc, 0x3e, 0xd1,
+/* 0x0e80 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
+/* 0x0e90 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
+/* 0x0ea0 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
+/* 0x0eb0 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
+/* 0x0ec0 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
+/* 0x0ed0 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
+/* 0x0ee0 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
+/* 0x0ef0 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
+/* 0x0f00 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
+/* 0x0f10 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
+/* 0x0f20 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
+/* 0x0f30 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
+/* 0x0f40 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
+/* 0x0f50 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
+/* 0x0f60 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x11, 0x0b,
+/* 0x0f70 */ 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
+/* 0x0f80 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
+/* 0x0f90 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
+/* 0x0fa0 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
+/* 0x0fb0 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
+/* 0x0fc0 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
+/* 0x0fd0 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
+/* 0x0fe0 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
+/* 0x0ff0 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
+/* 0x1000 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
+/* 0x1010 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
+/* 0x1020 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
+/* 0x1030 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
+/* 0x1040 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
+/* 0x1050 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00,
+/* 0x1060 */ 0x01, 0x12, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
+/* 0x1070 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
+/* 0x1080 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
+/* 0x1090 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
+/* 0x10a0 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
+/* 0x10b0 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
+/* 0x10c0 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
+/* 0x10d0 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
+/* 0x10e0 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
+/* 0x10f0 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
+/* 0x1100 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
+/* 0x1110 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
+/* 0x1120 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
+/* 0x1130 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
+/* 0x1140 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
+/* 0x1150 */ 0x60, 0x00, 0x00, 0x01, 0x13, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
+/* 0x1160 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
+/* 0x1170 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
+/* 0x1180 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
+/* 0x1190 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
+/* 0x11a0 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
+/* 0x11b0 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
+/* 0x11c0 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
+/* 0x11d0 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
+/* 0x11e0 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
+/* 0x11f0 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
+/* 0x1200 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
+/* 0x1210 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
+/* 0x1220 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
+/* 0x1230 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
+/* 0x1240 */ 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x14, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
+/* 0x1250 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
+/* 0x1260 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
+/* 0x1270 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
+/* 0x1280 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
+/* 0x1290 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
+/* 0x12a0 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
+/* 0x12b0 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
+/* 0x12c0 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
+/* 0x12d0 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
+/* 0x12e0 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
+/* 0x12f0 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
+/* 0x1300 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
+/* 0x1310 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
+/* 0x1320 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
+/* 0x1330 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x15, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3,
+/* 0x1340 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
+/* 0x1350 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
+/* 0x1360 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
+/* 0x1370 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
+/* 0x1380 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
+/* 0x1390 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
+/* 0x13a0 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
+/* 0x13b0 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
+/* 0x13c0 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
+/* 0x13d0 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
+/* 0x13e0 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
+/* 0x13f0 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
+/* 0x1400 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
+/* 0x1410 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
+/* 0x1420 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x16, 0x0b, 0xfc,
+/* 0x1430 */ 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
+/* 0x1440 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
+/* 0x1450 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
+/* 0x1460 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
+/* 0x1470 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
+/* 0x1480 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
+/* 0x1490 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
+/* 0x14a0 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
+/* 0x14b0 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
+/* 0x14c0 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
+/* 0x14d0 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
+/* 0x14e0 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
+/* 0x14f0 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
+/* 0x1500 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
+/* 0x1510 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01,
+/* 0x1520 */ 0x17, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
+/* 0x1530 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
+/* 0x1540 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
+/* 0x1550 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
+/* 0x1560 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
+/* 0x1570 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
+/* 0x1580 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
+/* 0x1590 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
+/* 0x15a0 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
+/* 0x15b0 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
+/* 0x15c0 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
+/* 0x15d0 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
+/* 0x15e0 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
+/* 0x15f0 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
+/* 0x1600 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60,
+/* 0x1610 */ 0x00, 0x00, 0x01, 0x18, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
+/* 0x1620 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
+/* 0x1630 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
+/* 0x1640 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
+/* 0x1650 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
+/* 0x1660 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
+/* 0x1670 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
+/* 0x1680 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
+/* 0x1690 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
+/* 0x16a0 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
+/* 0x16b0 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
+/* 0x16c0 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
+/* 0x16d0 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
+/* 0x16e0 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
+/* 0x16f0 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
+/* 0x1700 */ 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x19, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
+/* 0x1710 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
+/* 0x1720 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
+/* 0x1730 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
+/* 0x1740 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
+/* 0x1750 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
+/* 0x1760 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
+/* 0x1770 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
+/* 0x1780 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
+/* 0x1790 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
+/* 0x17a0 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
+/* 0x17b0 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
+/* 0x17c0 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
+/* 0x17d0 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
+/* 0x17e0 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
+/* 0x17f0 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x1a, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46,
+/* 0x1800 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
+/* 0x1810 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
+/* 0x1820 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
+/* 0x1830 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
+/* 0x1840 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
+/* 0x1850 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
+/* 0x1860 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
+/* 0x1870 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
+/* 0x1880 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
+/* 0x1890 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
+/* 0x18a0 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
+/* 0x18b0 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
+/* 0x18c0 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
+/* 0x18d0 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
+/* 0x18e0 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x1b, 0x0b, 0xfc, 0x3e,
+/* 0x18f0 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
+/* 0x1900 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
+/* 0x1910 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
+/* 0x1920 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
+/* 0x1930 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
+/* 0x1940 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
+/* 0x1950 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
+/* 0x1960 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
+/* 0x1970 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
+/* 0x1980 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
+/* 0x1990 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
+/* 0x19a0 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
+/* 0x19b0 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
+/* 0x19c0 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
+/* 0x19d0 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x1c,
+/* 0x19e0 */ 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
+/* 0x19f0 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
+/* 0x1a00 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
+/* 0x1a10 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
+/* 0x1a20 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
+/* 0x1a30 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
+/* 0x1a40 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
+/* 0x1a50 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
+/* 0x1a60 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
+/* 0x1a70 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
+/* 0x1a80 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
+/* 0x1a90 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
+/* 0x1aa0 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
+/* 0x1ab0 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
+/* 0x1ac0 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00,
+/* 0x1ad0 */ 0x00, 0x01, 0x1d, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
+/* 0x1ae0 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
+/* 0x1af0 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
+/* 0x1b00 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
+/* 0x1b10 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
+/* 0x1b20 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
+/* 0x1b30 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
+/* 0x1b40 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
+/* 0x1b50 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
+/* 0x1b60 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
+/* 0x1b70 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
+/* 0x1b80 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
+/* 0x1b90 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
+/* 0x1ba0 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
+/* 0x1bb0 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
+/* 0x1bc0 */ 0x18, 0x60, 0x00, 0x00, 0x01, 0x1e, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
+/* 0x1bd0 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
+/* 0x1be0 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
+/* 0x1bf0 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
+/* 0x1c00 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
+/* 0x1c10 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
+/* 0x1c20 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
+/* 0x1c30 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
+/* 0x1c40 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
+/* 0x1c50 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
+/* 0x1c60 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
+/* 0x1c70 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
+/* 0x1c80 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
+/* 0x1c90 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
+/* 0x1ca0 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
+/* 0x1cb0 */ 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x1f, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18,
+/* 0x1cc0 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
+/* 0x1cd0 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
+/* 0x1ce0 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
+/* 0x1cf0 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
+/* 0x1d00 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
+/* 0x1d10 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
+/* 0x1d20 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
+/* 0x1d30 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
+/* 0x1d40 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
+/* 0x1d50 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
+/* 0x1d60 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
+/* 0x1d70 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
+/* 0x1d80 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
+/* 0x1d90 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
+/* 0x1da0 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x20, 0x0b, 0xfc, 0x3e, 0xd1,
+/* 0x1db0 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
+/* 0x1dc0 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
+/* 0x1dd0 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
+/* 0x1de0 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
+/* 0x1df0 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
+/* 0x1e00 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
+/* 0x1e10 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
+/* 0x1e20 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
+/* 0x1e30 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
+/* 0x1e40 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
+/* 0x1e50 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
+/* 0x1e60 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
+/* 0x1e70 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
+/* 0x1e80 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
+/* 0x1e90 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x21, 0x0b,
+/* 0x1ea0 */ 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
+/* 0x1eb0 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
+/* 0x1ec0 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
+/* 0x1ed0 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
+/* 0x1ee0 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
+/* 0x1ef0 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
+/* 0x1f00 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
+/* 0x1f10 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
+/* 0x1f20 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
+/* 0x1f30 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
+/* 0x1f40 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
+/* 0x1f50 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
+/* 0x1f60 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
+/* 0x1f70 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
+/* 0x1f80 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00,
+/* 0x1f90 */ 0x01, 0x22, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
+/* 0x1fa0 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
+/* 0x1fb0 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
+/* 0x1fc0 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
+/* 0x1fd0 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
+/* 0x1fe0 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
+/* 0x1ff0 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
+/* 0x2000 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
+/* 0x2010 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
+/* 0x2020 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
+/* 0x2030 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
+/* 0x2040 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
+/* 0x2050 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
+/* 0x2060 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
+/* 0x2070 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
+/* 0x2080 */ 0x60, 0x00, 0x00, 0x01, 0x23, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
+/* 0x2090 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
+/* 0x20a0 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
+/* 0x20b0 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61,
+/* 0x20c0 */ 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86,
+/* 0x20d0 */ 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18,
+/* 0x20e0 */ 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61,
+/* 0x20f0 */ 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86,
+/* 0x2100 */ 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b,
+/* 0x2110 */ 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
+/* 0x2120 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
+/* 0x2130 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
+/* 0x2140 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
+/* 0x2150 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
+/* 0x2160 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
+/* 0x2170 */ 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0x24, 0x0b, 0xfc, 0x3e, 0xd1, 0xa3, 0x46, 0x18, 0x6e,
+/* 0x2180 */ 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8,
+/* 0x2190 */ 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3,
+/* 0x21a0 */ 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d,
+/* 0x21b0 */ 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34,
+/* 0x21c0 */ 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1,
+/* 0x21d0 */ 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46,
+/* 0x21e0 */ 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a,
+/* 0x21f0 */ 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68,
+/* 0x2200 */ 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3,
+/* 0x2210 */ 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d,
+/* 0x2220 */ 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34,
+/* 0x2230 */ 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x6e, 0x34, 0x68, 0xd1,
+/* 0x2240 */ 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18, 0x61, 0xb8, 0xd1, 0xa3, 0x46,
+/* 0x2250 */ 0x18, 0x6e, 0x34, 0x68, 0xd1, 0x86, 0x1b, 0x8d, 0x1a, 0x34, 0x61, 0x86, 0xe3, 0x46, 0x8d, 0x18,
+/* 0x2260 */ 0x61, 0xb8, 0xd1, 0xa3, 0x46, 0x18, 0x60, 0x00, 0x00, 0x01, 0xb7
+/* 0x226b */
+};
+
+static uint8_t preview_data[ sizeof (preview_mpg_data) + ((sizeof (preview_mpg_data) - 1) / (2048 - 6 - 3) + 1) * (6 + 3) ];
+
+static inline const char *mrl_to_fifo (const char *mrl)
+{
+ /* vdr://foo -> /foo */
+ return mrl + 3 + strspn (mrl + 4, "/");
+}
+
+static inline const char *mrl_to_host (const char *mrl)
+{
+ /* netvdr://host:port -> host:port */
+ return strrchr (mrl, '/') + 1;
+}
+
+static int vdr_plugin_open_fifo_mrl(input_plugin_t *this_gen)
+{
+ vdr_input_plugin_t *this = (vdr_input_plugin_t *)this_gen;
+ char *filename = strdup (mrl_to_fifo (this->mrl));
+
+ _x_mrl_unescape (filename);
+ this->fh = open(filename, O_RDONLY | O_NONBLOCK);
+
+ lprintf("filename '%s'\n", filename);
+
+ if (this->fh == -1)
+ {
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ _("%s: failed to open '%s' (%s)\n"), LOG_MODULE,
+ filename,
+ strerror(errno));
+ free (filename);
+ return 0;
+ }
+
+ {
+ struct pollfd poll_fh = { this->fh, POLLIN, 0 };
+
+ int r = poll(&poll_fh, 1, 300);
+ if (1 != r)
+ {
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ _("%s: failed to open '%s' (%s)\n"), LOG_MODULE,
+ filename,
+ _("timeout expired during setup phase"));
+ free (filename);
+ return 0;
+ }
+ }
+
+ fcntl(this->fh, F_SETFL, ~O_NONBLOCK & fcntl(this->fh, F_GETFL, 0));
+
+ {
+ char *filename_control = 0;
+ asprintf(&filename_control, "%s.control", filename);
+
+ this->fh_control = open(filename_control, O_RDONLY);
+
+ if (this->fh_control == -1) {
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ _("%s: failed to open '%s' (%s)\n"), LOG_MODULE,
+ filename_control,
+ strerror(errno));
+
+ free(filename_control);
+ free (filename);
+ return 0;
+ }
+
+ free(filename_control);
+ }
+
+ {
+ char *filename_result = 0;
+ asprintf(&filename_result, "%s.result", filename);
+
+ this->fh_result = open(filename_result, O_WRONLY);
+
+ if (this->fh_result == -1) {
+ perror("failed");
+
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ _("%s: failed to open '%s' (%s)\n"), LOG_MODULE,
+ filename_result,
+ strerror(errno));
+
+ free(filename_result);
+ free (filename);
+ return 0;
+ }
+
+ free(filename_result);
+ }
+
+ {
+ char *filename_event = 0;
+ asprintf(&filename_event, "%s.event", filename);
+
+ this->fh_event = open(filename_event, O_WRONLY);
+
+ if (this->fh_event == -1) {
+ perror("failed");
+
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ _("%s: failed to open '%s' (%s)\n"), LOG_MODULE,
+ filename_event,
+ strerror(errno));
+
+ free(filename_event);
+ free (filename);
+ return 0;
+ }
+
+ free(filename_event);
+ }
+
+ free (filename);
+ return 1;
+}
+
+static int vdr_plugin_open_socket(vdr_input_plugin_t *this, struct hostent *host, unsigned short port)
+{
+ int fd;
+ struct sockaddr_in sain;
+ struct in_addr iaddr;
+
+ if ((fd = socket(PF_INET, SOCK_STREAM, 0)) == -1)
+ {
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ _("%s: failed to create socket for port %d (%s)\n"), LOG_MODULE,
+ port, strerror(errno));
+ return -1;
+ }
+
+ iaddr.s_addr = *((unsigned int *)host->h_addr_list[0]);
+
+ sain.sin_port = htons(port);
+ sain.sin_family = AF_INET;
+ sain.sin_addr = iaddr;
+
+ if (connect(fd, (struct sockaddr *)&sain, sizeof (sain)) < 0)
+ {
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ _("%s: failed to connect to port %d (%s)\n"), LOG_MODULE, port,
+ strerror(errno));
+
+ return -1;
+ }
+
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ _("%s: socket opening (port %d) successful, fd = %d\n"), LOG_MODULE, port, fd);
+
+ return fd;
+}
+
+static int vdr_plugin_open_sockets(vdr_input_plugin_t *this)
+{
+ struct hostent *host;
+ char *mrl_host = strdup (mrl_to_host (this->mrl));
+ char *mrl_port;
+ int port = 18701;
+
+ mrl_port = strchr(mrl_host, '#');
+ if (mrl_port)
+ *mrl_port = 0; /* strip off things like '#demux:mpeg_pes' */
+
+ _x_mrl_unescape (mrl_host);
+
+ mrl_port = strchr(mrl_host, ':');
+ if (mrl_port)
+ {
+ port = atoi(mrl_port + 1);
+ *mrl_port = 0;
+ }
+
+ host = gethostbyname(mrl_host);
+
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ _("%s: connecting to vdr.\n"), LOG_MODULE);
+
+ if (!host)
+ {
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ _("%s: failed to resolve hostname '%s' (%s)\n"), LOG_MODULE,
+ mrl_host,
+ strerror(errno));
+ free (mrl_host);
+ return 0;
+ }
+ free (mrl_host);
+
+ if ((this->fh = vdr_plugin_open_socket(this, host, port + 0)) == -1)
+ return 0;
+
+ fcntl(this->fh, F_SETFL, ~O_NONBLOCK & fcntl(this->fh, F_GETFL, 0));
+
+ if ((this->fh_control = vdr_plugin_open_socket(this, host, port + 1)) == -1)
+ return 0;
+
+ if ((this->fh_result = vdr_plugin_open_socket(this, host, port + 2)) == -1)
+ return 0;
+
+ if ((this->fh_event = vdr_plugin_open_socket(this, host, port + 3)) == -1)
+ return 0;
+
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ _("%s: connecting to all sockets (port %d .. %d) was successful.\n"), LOG_MODULE, port, port + 3);
+
+ return 1;
+}
+
+static int vdr_plugin_open_socket_mrl(input_plugin_t *this_gen)
+{
+ vdr_input_plugin_t *this = (vdr_input_plugin_t *)this_gen;
+
+ lprintf("input_vdr: connecting to vdr-xine-server...\n");
+
+ if (!vdr_plugin_open_sockets(this))
+ return 0;
+
+ return 1;
+}
+
+static int vdr_plugin_open(input_plugin_t *this_gen)
+{
+ vdr_input_plugin_t *this = (vdr_input_plugin_t *)this_gen;
+
+ lprintf("trying to open '%s'...\n", this->mrl);
+
+ if (this->fh == -1)
+ {
+ int err = 0;
+
+ if (!strncasecmp(&this->mrl[0], "vdr:/", 5))
+ {
+ if (!vdr_plugin_open_fifo_mrl(this_gen))
+ return 0;
+ }
+ else if (!strncasecmp(&this->mrl[0], "netvdr:/", 8))
+ {
+ if (!vdr_plugin_open_socket_mrl(this_gen))
+ return 0;
+ }
+ else
+ {
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ _("%s: MRL (%s) invalid! MRL should start with vdr://path/to/fifo/stream or netvdr://host:port where ':port' is optional.\n"), LOG_MODULE,
+ strerror(err));
+ return 0;
+ }
+
+ this->rpc_thread_shutdown = 0;
+ if ((err = pthread_create(&this->rpc_thread, NULL,
+ vdr_rpc_thread_loop, (void *)this)) != 0)
+ {
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ _("%s: can't create new thread (%s)\n"), LOG_MODULE,
+ strerror(err));
+
+ return 0;
+ }
+ }
+
+ /*
+ * mrl accepted and opened successfully at this point
+ *
+ * => create plugin instance
+ */
+
+ /*
+ * fill preview buffer
+ */
+
+ if (!preview_data[ 2 ])
+ {
+ uint8_t *src = preview_mpg_data;
+ uint8_t *dst = preview_data;
+ int todo = sizeof (preview_mpg_data);
+ int bite = 2048 - 6 - 3;
+
+ while (todo > 0)
+ {
+ if (bite > todo)
+ bite = todo;
+
+ *dst++ = 0x00;
+ *dst++ = 0x00;
+ *dst++ = 0x01;
+ *dst++ = 0xe0;
+
+ *dst++ = (bite + 3) >> 8;
+ *dst++ = (bite + 3) & 0xff;
+
+ *dst++ = 0x80;
+ *dst++ = 0x00;
+ *dst++ = 0x00;
+
+ memcpy(dst, src, bite);
+ dst += bite;
+ src += bite;
+
+ todo -= bite;
+ }
+ }
+
+ this->preview = (char *)&preview_data;
+ this->preview_size = 0; /* sizeof (preview_data); */
+ this->curpos = 0;
+
+ return 1;
+}
+
+static void event_handler(void *user_data, const xine_event_t *event)
+{
+ vdr_input_plugin_t *this = (vdr_input_plugin_t *)user_data;
+ uint32_t key = key_none;
+
+ lprintf("eventHandler(): event->type: %d\n", event->type);
+
+ if (XINE_EVENT_VDR_FRAMESIZECHANGED == event->type)
+ {
+ memcpy(&this->frame_size, event->data, event->data_length);
+
+ if (0 != internal_write_event_frame_size(this))
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ _("%s: input event write: %s.\n"), LOG_MODULE, strerror(errno));
+
+ adjust_zoom(this);
+ return;
+ }
+ else if (XINE_EVENT_VDR_PLUGINSTARTED == event->type)
+ {
+ if (0 == event->data_length) /* vdr_video */
+ {
+ xine_event_t event;
+
+ event.type = XINE_EVENT_VDR_TRICKSPEEDMODE;
+ event.data = 0;
+ event.data_length = this->trick_speed_mode;
+
+ xine_event_send(this->stream, &event);
+ }
+ else if (1 == event->data_length) /* vdr_audio */
+ {
+ xine_event_t event;
+ vdr_select_audio_data_t event_data;
+
+ event_data.channels = this->audio_channels;
+
+ event.type = XINE_EVENT_VDR_SELECTAUDIO;
+ event.data = &event_data;
+ event.data_length = sizeof (event_data);
+
+ xine_event_send(this->stream, &event);
+ }
+ else
+ {
+ fprintf(stderr, "input_vdr: illegal XINE_EVENT_VDR_PLUGINSTARTED: %d\n", event->data_length);
+ }
+ }
+
+ switch (event->type)
+ {
+ case XINE_EVENT_INPUT_UP: key = key_up; break;
+ case XINE_EVENT_INPUT_DOWN: key = key_down; break;
+ case XINE_EVENT_INPUT_LEFT: key = key_left; break;
+ case XINE_EVENT_INPUT_RIGHT: key = key_right; break;
+ case XINE_EVENT_INPUT_SELECT: key = key_ok; break;
+ case XINE_EVENT_VDR_BACK: key = key_back; break;
+ case XINE_EVENT_VDR_CHANNELPLUS: key = key_channel_plus; break;
+ case XINE_EVENT_VDR_CHANNELMINUS: key = key_channel_minus; break;
+ case XINE_EVENT_VDR_RED: key = key_red; break;
+ case XINE_EVENT_VDR_GREEN: key = key_green; break;
+ case XINE_EVENT_VDR_YELLOW: key = key_yellow; break;
+ case XINE_EVENT_VDR_BLUE: key = key_blue; break;
+ case XINE_EVENT_VDR_PLAY: key = key_play; break;
+ case XINE_EVENT_VDR_PAUSE: key = key_pause; break;
+ case XINE_EVENT_VDR_STOP: key = key_stop; break;
+ case XINE_EVENT_VDR_RECORD: key = key_record; break;
+ case XINE_EVENT_VDR_FASTFWD: key = key_fast_fwd; break;
+ case XINE_EVENT_VDR_FASTREW: key = key_fast_rew; break;
+ case XINE_EVENT_VDR_POWER: key = key_power; break;
+ case XINE_EVENT_VDR_SCHEDULE: key = key_schedule; break;
+ case XINE_EVENT_VDR_CHANNELS: key = key_channels; break;
+ case XINE_EVENT_VDR_TIMERS: key = key_timers; break;
+ case XINE_EVENT_VDR_RECORDINGS: key = key_recordings; break;
+ case XINE_EVENT_INPUT_MENU1: key = key_menu; break;
+ case XINE_EVENT_VDR_SETUP: key = key_setup; break;
+ case XINE_EVENT_VDR_COMMANDS: key = key_commands; break;
+ case XINE_EVENT_INPUT_NUMBER_0: key = key_0; break;
+ case XINE_EVENT_INPUT_NUMBER_1: key = key_1; break;
+ case XINE_EVENT_INPUT_NUMBER_2: key = key_2; break;
+ case XINE_EVENT_INPUT_NUMBER_3: key = key_3; break;
+ case XINE_EVENT_INPUT_NUMBER_4: key = key_4; break;
+ case XINE_EVENT_INPUT_NUMBER_5: key = key_5; break;
+ case XINE_EVENT_INPUT_NUMBER_6: key = key_6; break;
+ case XINE_EVENT_INPUT_NUMBER_7: key = key_7; break;
+ case XINE_EVENT_INPUT_NUMBER_8: key = key_8; break;
+ case XINE_EVENT_INPUT_NUMBER_9: key = key_9; break;
+ case XINE_EVENT_VDR_USER1: key = key_user1; break;
+ case XINE_EVENT_VDR_USER2: key = key_user2; break;
+ case XINE_EVENT_VDR_USER3: key = key_user3; break;
+ case XINE_EVENT_VDR_USER4: key = key_user4; break;
+ case XINE_EVENT_VDR_USER5: key = key_user5; break;
+ case XINE_EVENT_VDR_USER6: key = key_user6; break;
+ case XINE_EVENT_VDR_USER7: key = key_user7; break;
+ case XINE_EVENT_VDR_USER8: key = key_user8; break;
+ case XINE_EVENT_VDR_USER9: key = key_user9; break;
+ case XINE_EVENT_VDR_VOLPLUS: key = key_volume_plus; break;
+ case XINE_EVENT_VDR_VOLMINUS: key = key_volume_minus; break;
+ case XINE_EVENT_VDR_MUTE: key = key_mute; break;
+ case XINE_EVENT_VDR_AUDIO: key = key_audio; break;
+ case XINE_EVENT_VDR_INFO: key = key_info; break;
+ case XINE_EVENT_VDR_CHANNELPREVIOUS: key = key_channel_previous; break;
+ case XINE_EVENT_INPUT_NEXT: key = key_next; break;
+ case XINE_EVENT_INPUT_PREVIOUS: key = key_previous; break;
+ case XINE_EVENT_VDR_SUBTITLES: key = key_subtitles; break;
+ default:
+ return;
+ }
+
+ if (0 != internal_write_event_key(this, key))
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ _("%s: input event write: %s.\n"), LOG_MODULE, strerror(errno));
+}
+
+static input_plugin_t *vdr_class_get_instance(input_class_t *cls_gen, xine_stream_t *stream,
+ const char *data)
+{
+ vdr_input_plugin_t *this;
+ char *mrl = strdup(data);
+
+ if (!strncasecmp(mrl, "vdr:/", 5))
+ lprintf("filename '%s'\n", mrl_to_path (mrl));
+ else if (!strncasecmp(mrl, "netvdr:/", 5))
+ lprintf("host '%s'\n", mrl_to_socket (mrl));
+ else
+ {
+ free(mrl);
+ return NULL;
+ }
+
+ /*
+ * mrl accepted and opened successfully at this point
+ *
+ * => create plugin instance
+ */
+
+ this = (vdr_input_plugin_t *)xine_xmalloc(sizeof (vdr_input_plugin_t));
+
+ this->stream = stream;
+ this->curpos = 0;
+ this->mrl = mrl;
+ this->fh = -1;
+ this->fh_control = -1;
+ this->fh_result = -1;
+ this->fh_event = -1;
+
+ this->input_plugin.open = vdr_plugin_open;
+ this->input_plugin.get_capabilities = vdr_plugin_get_capabilities;
+ this->input_plugin.read = vdr_plugin_read;
+ this->input_plugin.read_block = vdr_plugin_read_block;
+ this->input_plugin.seek = vdr_plugin_seek;
+ this->input_plugin.get_current_pos = vdr_plugin_get_current_pos;
+ this->input_plugin.get_length = vdr_plugin_get_length;
+ this->input_plugin.get_blocksize = vdr_plugin_get_blocksize;
+ this->input_plugin.get_mrl = vdr_plugin_get_mrl;
+ this->input_plugin.dispose = vdr_plugin_dispose;
+ this->input_plugin.get_optional_data = vdr_plugin_get_optional_data;
+ this->input_plugin.input_class = cls_gen;
+
+ this->cur_func = func_unknown;
+ this->cur_size = 0;
+ this->cur_done = 0;
+
+ memset(this->osd_window, 0, sizeof (this->osd_window));
+
+ this->osd_buffer = 0;
+ this->osd_buffer_size = 0;
+ this->osd_unscaled_blending = 0;
+ this->trick_speed_mode = 0;
+ this->audio_channels = 0;
+ this->mute_mode = INPUT_VDR_MUTE_SIMULATE;
+ this->volume_mode = INPUT_VDR_VOLUME_CHANGE_HW;
+ this->last_volume = -1;
+ this->frame_size.x = 0;
+ this->frame_size.y = 0;
+ this->frame_size.w = 0;
+ this->frame_size.h = 0;
+ this->frame_size.r = 0;
+
+ this->stream_external = 0;
+ this->event_queue_external = 0;
+
+ pthread_mutex_init(&this->rpc_thread_shutdown_lock, 0);
+ pthread_cond_init(&this->rpc_thread_shutdown_cond, 0);
+
+ pthread_mutex_init(&this->adjust_zoom_lock, 0);
+ this->image4_3_zoom_x = 0;
+ this->image4_3_zoom_y = 0;
+ this->image16_9_zoom_x = 0;
+ this->image16_9_zoom_y = 0;
+
+ this->event_queue = xine_event_new_queue(this->stream);
+ if (this->event_queue)
+ xine_event_create_listener_thread(this->event_queue, event_handler, this);
+
+ return &this->input_plugin;
+}
+
+/*
+ * vdr input plugin class stuff
+ */
+
+static const char *vdr_class_get_description(input_class_t *this_gen)
+{
+ return _("VDR display device plugin");
+}
+
+static const char *vdr_class_get_identifier (input_class_t *this_gen)
+{
+ return "VDR";
+}
+
+static void vdr_class_dispose (input_class_t *this_gen)
+{
+ vdr_input_class_t *this = (vdr_input_class_t *)this_gen;
+
+ free(this);
+}
+
+static char **vdr_class_get_autoplay_list(input_class_t *this_gen,
+ int *num_files)
+{
+ vdr_input_class_t *class = (vdr_input_class_t *)this_gen;
+
+ *num_files = 1;
+ return class->mrls;
+}
+
+static void *init_class(xine_t *xine, void *data)
+{
+ vdr_input_class_t *this;
+
+ lprintf("init_class\n");
+
+ this = (vdr_input_class_t *)xine_xmalloc(sizeof (vdr_input_class_t));
+
+ this->xine = xine;
+
+ this->mrls[ 0 ] = "vdr:/" VDR_ABS_FIFO_DIR "/stream#demux:mpeg_pes";
+ this->mrls[ 1 ] = 0;
+
+ this->input_class.get_instance = vdr_class_get_instance;
+ this->input_class.get_identifier = vdr_class_get_identifier;
+ this->input_class.get_description = vdr_class_get_description;
+ this->input_class.get_dir = NULL;
+ this->input_class.get_autoplay_list = vdr_class_get_autoplay_list;
+ this->input_class.dispose = vdr_class_dispose;
+ this->input_class.eject_media = NULL;
+
+ return this;
+}
+
+/*
+ * exported plugin catalog entry
+ */
+
+plugin_info_t xine_plugin_info[] EXPORTED =
+{
+ /* type, API, "name", version, special_info, init_function */
+ { PLUGIN_INPUT, 17, "VDR", XINE_VERSION_CODE, NULL, init_class },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
+
diff --git a/src/vdr/input_vdr.h b/src/vdr/input_vdr.h
new file mode 100644
index 000000000..a6bb6791f
--- /dev/null
+++ b/src/vdr/input_vdr.h
@@ -0,0 +1,597 @@
+
+#ifndef __INPUT_VDR_H
+#define __INPUT_VDR_H
+
+
+#define XINE_INPUT_VDR_VERSION 712
+
+
+enum funcs
+{
+ func_unknown = -1
+ , func_nop
+ , func_osd_new
+ , func_osd_free
+ , func_osd_show
+ , func_osd_hide
+ , func_osd_set_position
+ , func_osd_draw_bitmap
+ , func_set_color
+ , func_clear
+ , func_mute
+ , func_set_volume
+ , func_set_speed
+ , func_set_prebuffer
+ , func_metronom
+ , func_start
+ , func_wait
+ , func_setup
+ , func_grab_image
+ , func_get_pts
+ , func_flush
+ , func_first_frame
+ , func_still_frame
+ , func_video_size
+ , func_set_video_window
+ , func_osd_flush
+ , func_play_external
+ , func_key
+ , func_frame_size
+ , func_reset_audio
+ , func_select_audio
+ , func_trick_speed_mode
+ , func_get_version
+};
+
+enum keys
+{
+ key_none,
+ key_up,
+ key_down,
+ key_menu,
+ key_ok,
+ key_back,
+ key_left,
+ key_right,
+ key_red,
+ key_green,
+ key_yellow,
+ key_blue,
+ key_0,
+ key_1,
+ key_2,
+ key_3,
+ key_4,
+ key_5,
+ key_6,
+ key_7,
+ key_8,
+ key_9,
+ key_play,
+ key_pause,
+ key_stop,
+ key_record,
+ key_fast_fwd,
+ key_fast_rew,
+ key_power,
+ key_channel_plus,
+ key_channel_minus,
+ key_volume_plus,
+ key_volume_minus,
+ key_mute,
+ key_schedule,
+ key_channels,
+ key_timers,
+ key_recordings,
+ key_setup,
+ key_commands,
+ key_user1,
+ key_user2,
+ key_user3,
+ key_user4,
+ key_user5,
+ key_user6,
+ key_user7,
+ key_user8,
+ key_user9,
+ key_audio,
+ key_info,
+ key_channel_previous,
+ key_next,
+ key_previous,
+ key_subtitles,
+};
+
+
+
+typedef struct __attribute__((packed)) data_header_s
+{
+ uint32_t func:8;
+ uint32_t len:24;
+}
+data_header_t;
+
+
+
+typedef data_header_t result_header_t;
+typedef data_header_t event_header_t;
+
+
+
+typedef struct __attribute__((packed)) data_nop_s
+{
+ data_header_t header;
+}
+data_nop_t;
+
+
+
+typedef struct __attribute__((packed)) data_osd_new_s
+{
+ data_header_t header;
+
+ uint8_t window;
+ int16_t x;
+ int16_t y;
+ uint16_t width;
+ uint16_t height;
+}
+data_osd_new_t;
+
+
+
+typedef struct __attribute__((packed)) data_osd_free_s
+{
+ data_header_t header;
+
+ uint8_t window;
+}
+data_osd_free_t;
+
+
+
+typedef struct __attribute__((packed)) data_osd_show_s
+{
+ data_header_t header;
+
+ uint8_t window;
+}
+data_osd_show_t;
+
+
+
+typedef struct __attribute__((packed)) data_osd_hide_s
+{
+ data_header_t header;
+
+ uint8_t window;
+}
+data_osd_hide_t;
+
+
+
+typedef struct __attribute__((packed)) data_osd_flush_s
+{
+ data_header_t header;
+}
+data_osd_flush_t;
+
+
+
+typedef struct __attribute__((packed)) data_play_external_s
+{
+ data_header_t header;
+}
+data_play_external_t;
+
+
+
+typedef struct __attribute__((packed)) data_osd_set_position_s
+{
+ data_header_t header;
+
+ uint8_t window;
+ int16_t x;
+ int16_t y;
+}
+data_osd_set_position_t;
+
+
+
+typedef struct __attribute__((packed)) data_osd_draw_bitmap_s
+{
+ data_header_t header;
+
+ uint8_t window;
+ int16_t x;
+ int16_t y;
+ uint16_t width;
+ uint16_t height;
+}
+data_osd_draw_bitmap_t;
+
+
+
+typedef struct __attribute__((packed)) data_set_color_s
+{
+ data_header_t header;
+
+ uint8_t window;
+ uint8_t index;
+ uint8_t num;
+}
+data_set_color_t;
+
+
+
+typedef struct __attribute__((packed)) data_flush_s
+{
+ data_header_t header;
+
+ int32_t ms_timeout;
+ uint8_t just_wait;
+}
+data_flush_t;
+
+
+
+typedef struct __attribute__((packed)) result_flush_s
+{
+ result_header_t header;
+
+ uint8_t timed_out;
+}
+result_flush_t;
+
+
+
+typedef struct __attribute__((packed)) data_clear_s
+{
+ data_header_t header;
+
+ int32_t n;
+ int8_t s;
+}
+data_clear_t;
+
+
+
+typedef struct __attribute__((packed)) data_mute_s
+{
+ data_header_t header;
+
+ uint8_t mute;
+}
+data_mute_t;
+
+
+
+typedef struct __attribute__((packed)) data_set_volume_s
+{
+ data_header_t header;
+
+ uint8_t volume;
+}
+data_set_volume_t;
+
+
+
+typedef struct __attribute__((packed)) data_set_speed_s
+{
+ data_header_t header;
+
+ int32_t speed;
+}
+data_set_speed_t;
+
+
+
+typedef struct __attribute__((packed)) data_set_prebuffer_s
+{
+ data_header_t header;
+
+ uint32_t prebuffer;
+}
+data_set_prebuffer_t;
+
+
+
+typedef struct __attribute__((packed)) data_metronom_s
+{
+ data_header_t header;
+
+ int64_t pts;
+ uint32_t flags;
+}
+data_metronom_t;
+
+
+
+typedef struct __attribute__((packed)) data_start_s
+{
+ data_header_t header;
+}
+data_start_t;
+
+
+
+typedef struct __attribute__((packed)) data_wait_s
+{
+ data_header_t header;
+}
+data_wait_t;
+
+
+
+typedef struct __attribute__((packed)) result_wait_s
+{
+ result_header_t header;
+}
+result_wait_t;
+
+
+
+#define INPUT_VDR_VOLUME_IGNORE 0
+#define INPUT_VDR_VOLUME_CHANGE_HW 1
+#define INPUT_VDR_VOLUME_CHANGE_SW 2
+
+#define INPUT_VDR_MUTE_IGNORE 0
+#define INPUT_VDR_MUTE_EXECUTE 1
+#define INPUT_VDR_MUTE_SIMULATE 2
+
+typedef struct __attribute__((packed)) data_setup_s
+{
+ data_header_t header;
+
+ uint8_t osd_unscaled_blending;
+ uint8_t volume_mode;
+ uint8_t mute_mode;
+ uint16_t image4_3_zoom_x;
+ uint16_t image4_3_zoom_y;
+ uint16_t image16_9_zoom_x;
+ uint16_t image16_9_zoom_y;
+}
+data_setup_t;
+
+
+
+typedef struct __attribute__((packed)) data_first_frame_s
+{
+ data_header_t header;
+}
+data_first_frame_t;
+
+
+
+typedef struct __attribute__((packed)) data_still_frame_s
+{
+ data_header_t header;
+}
+data_still_frame_t;
+
+
+
+typedef struct __attribute__((packed)) data_set_video_window_s
+{
+ data_header_t header;
+
+ uint32_t x;
+ uint32_t y;
+ uint32_t w;
+ uint32_t h;
+ uint32_t w_ref;
+ uint32_t h_ref;
+}
+data_set_video_window_t;
+
+
+
+typedef struct __attribute__((packed)) data_grab_image_s
+{
+ data_header_t header;
+}
+data_grab_image_t;
+
+
+
+typedef struct __attribute__((packed)) result_grab_image_s
+{
+ result_header_t header;
+
+ int32_t width;
+ int32_t height;
+ int32_t ratio;
+ int32_t format;
+}
+result_grab_image_t;
+
+
+
+typedef struct __attribute__((packed)) data_get_pts_s
+{
+ data_header_t header;
+}
+data_get_pts_t;
+
+
+
+typedef struct __attribute__((packed)) result_get_pts_s
+{
+ result_header_t header;
+
+ int64_t pts;
+}
+result_get_pts_t;
+
+
+
+typedef struct __attribute__((packed)) data_get_version_s
+{
+ data_header_t header;
+}
+data_get_version_t;
+
+
+
+typedef struct __attribute__((packed)) result_get_version_s
+{
+ result_header_t header;
+
+ int32_t version;
+}
+result_get_version_t;
+
+
+
+typedef struct __attribute__((packed)) data_video_size_s
+{
+ data_header_t header;
+}
+data_video_size_t;
+
+
+
+typedef struct __attribute__((packed)) result_video_size_s
+{
+ result_header_t header;
+
+ int32_t left;
+ int32_t top;
+ int32_t width;
+ int32_t height;
+ int32_t ratio;
+ int32_t zoom_x;
+ int32_t zoom_y;
+}
+result_video_size_t;
+
+
+
+typedef struct __attribute__((packed)) data_reset_audio_s
+{
+ data_header_t header;
+}
+data_reset_audio_t;
+
+
+
+typedef struct __attribute__((packed)) event_key_s
+{
+ event_header_t header;
+
+ uint32_t key;
+}
+event_key_t;
+
+
+
+typedef struct __attribute__((packed)) event_frame_size_s
+{
+ event_header_t header;
+
+ int32_t left;
+ int32_t top;
+ int32_t width;
+ int32_t height;
+ int32_t zoom_x;
+ int32_t zoom_y;
+}
+event_frame_size_t;
+
+
+
+typedef struct __attribute__((packed)) event_play_external_s
+{
+ event_header_t header;
+
+ uint32_t key;
+}
+event_play_external_t;
+
+
+
+typedef struct __attribute__((packed)) data_select_audio_s
+{
+ data_header_t header;
+
+ uint8_t channels;
+}
+data_select_audio_t;
+
+
+
+typedef struct __attribute__((packed)) data_trick_speed_mode_s
+{
+ data_header_t header;
+
+ uint8_t on;
+}
+data_trick_speed_mode_t;
+
+
+
+typedef union __attribute__((packed)) data_union_u
+{
+ data_header_t header;
+ data_nop_t nop;
+ data_osd_new_t osd_new;
+ data_osd_free_t osd_free;
+ data_osd_show_t osd_show;
+ data_osd_hide_t osd_hide;
+ data_osd_set_position_t osd_set_position;
+ data_osd_draw_bitmap_t osd_draw_bitmap;
+ data_set_color_t set_color;
+ data_flush_t flush;
+ data_clear_t clear;
+ data_mute_t mute;
+ data_set_volume_t set_volume;
+ data_set_speed_t set_speed;
+ data_set_prebuffer_t set_prebuffer;
+ data_metronom_t metronom;
+ data_start_t start;
+ data_wait_t wait;
+ data_setup_t setup;
+ data_grab_image_t grab_image;
+ data_get_pts_t get_pts;
+ data_first_frame_t first_frame;
+ data_still_frame_t still_frame;
+ data_video_size_t video_size;
+ data_set_video_window_t set_video_window;
+ data_osd_flush_t osd_flush;
+ data_play_external_t play_external;
+ data_reset_audio_t reset_audio;
+ data_select_audio_t select_audio;
+ data_trick_speed_mode_t trick_speed_mode;
+ data_get_version_t get_version;
+}
+data_union_t;
+
+
+
+typedef union __attribute__((packed)) result_union_u
+{
+ result_header_t header;
+ result_grab_image_t grab_image;
+ result_get_pts_t get_pts;
+ result_flush_t flush;
+ result_video_size_t video_size;
+ result_get_version_t get_version;
+ result_wait_t wait;
+}
+result_union_t;
+
+
+
+typedef union __attribute__((packed)) event_union_u
+{
+ event_header_t header;
+ event_key_t key;
+ event_frame_size_t frame_size;
+ event_play_external_t play_external;
+}
+event_union_t;
+
+
+
+#endif /* __INPUT_VDR_H */
+
diff --git a/src/vdr/post_vdr.c b/src/vdr/post_vdr.c
new file mode 100644
index 000000000..fd95b371f
--- /dev/null
+++ b/src/vdr/post_vdr.c
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2000-2004 the xine project
+ *
+ * This file is part of xine, a free video player.
+ *
+ * xine is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * xine is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ *
+ * $Id: vdr.c,v 1.20 2004/04/17 19:54:32 mroi Exp $
+ */
+
+/*
+ * plugins for VDR
+ */
+
+#include "xine_internal.h"
+#include "post.h"
+#include "post_vdr.h"
+
+
+
+static post_info_t vdr_video_special_info = { XINE_POST_TYPE_VIDEO_FILTER };
+static post_info_t vdr_audio_special_info = { XINE_POST_TYPE_AUDIO_FILTER };
+
+plugin_info_t xine_plugin_info[] EXPORTED =
+{
+ /* type, API, "name", version, special_info, init_function */
+ { PLUGIN_POST, 9, "vdr" , XINE_VERSION_CODE, &vdr_video_special_info, &vdr_video_init_plugin },
+ { PLUGIN_POST, 9, "vdr_video", XINE_VERSION_CODE, &vdr_video_special_info, &vdr_video_init_plugin },
+ { PLUGIN_POST, 9, "vdr_audio", XINE_VERSION_CODE, &vdr_audio_special_info, &vdr_audio_init_plugin },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
+
diff --git a/src/vdr/post_vdr.h b/src/vdr/post_vdr.h
new file mode 100644
index 000000000..7684727eb
--- /dev/null
+++ b/src/vdr/post_vdr.h
@@ -0,0 +1,72 @@
+
+#ifndef __POST_VDR_H
+#define __POST_VDR_H
+
+
+
+typedef struct vdr_set_video_window_data_s {
+ int32_t x;
+ int32_t y;
+ int32_t w;
+ int32_t h;
+ int32_t w_ref;
+ int32_t h_ref;
+
+} vdr_set_video_window_data_t;
+
+
+
+typedef struct vdr_frame_size_changed_data_s {
+ int32_t x;
+ int32_t y;
+ int32_t w;
+ int32_t h;
+ double r;
+
+} vdr_frame_size_changed_data_t;
+
+
+
+typedef struct vdr_select_audio_data_s {
+ uint8_t channels;
+
+} vdr_select_audio_data_t;
+
+
+
+inline static int vdr_is_vdr_stream(xine_stream_t *stream)
+{
+ if (!stream
+ || !stream->input_plugin
+ || !stream->input_plugin->input_class)
+ {
+ return 0;
+ }
+
+ {
+ input_class_t *input_class = stream->input_plugin->input_class;
+
+ if (input_class->get_identifier)
+ {
+ const char *identifier = input_class->get_identifier(input_class);
+ if (identifier
+ && 0 == strcmp(identifier, "VDR"))
+ {
+ return 1;
+ }
+ }
+ }
+
+ return 0;
+}
+
+
+
+/* plugin class initialization function */
+void *vdr_video_init_plugin(xine_t *xine, void *);
+void *vdr_audio_init_plugin(xine_t *xine, void *);
+
+
+
+#endif /* __POST_VDR_H */
+
diff --git a/src/vdr/post_vdr_audio.c b/src/vdr/post_vdr_audio.c
new file mode 100644
index 000000000..365a0fb01
--- /dev/null
+++ b/src/vdr/post_vdr_audio.c
@@ -0,0 +1,287 @@
+/*
+ * Copyright (C) 2000-2004 the xine project
+ *
+ * This file is part of xine, a free video player.
+ *
+ * xine is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * xine is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ *
+ * $Id: vdr.c,v 1.20 2004/04/17 19:54:32 mroi Exp $
+ */
+
+/*
+ * select audio channel plugin for VDR
+ */
+
+#define LOG_MODULE "vdr_audio"
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
+
+#include "xine_internal.h"
+#include "post.h"
+#include "post_vdr.h"
+
+
+
+typedef struct vdr_audio_post_plugin_s
+{
+ post_plugin_t post_plugin;
+
+ xine_event_queue_t *event_queue;
+ xine_stream_t *vdr_stream;
+
+ uint8_t audio_channels;
+ int num_channels;
+
+}
+vdr_audio_post_plugin_t;
+
+
+static void vdr_audio_select_audio(vdr_audio_post_plugin_t *this, uint8_t channels)
+{
+ this->audio_channels = channels;
+}
+
+
+/* plugin class functions */
+static post_plugin_t *vdr_audio_open_plugin(post_class_t *class_gen, int inputs,
+ xine_audio_port_t **audio_target,
+ xine_video_port_t **video_target);
+static char *vdr_audio_get_identifier(post_class_t *class_gen);
+static char *vdr_audio_get_description(post_class_t *class_gen);
+static void vdr_audio_class_dispose(post_class_t *class_gen);
+
+/* plugin instance functions */
+static void vdr_audio_dispose(post_plugin_t *this_gen);
+
+/* replaced ao_port functions */
+static int vdr_audio_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream,
+ uint32_t bits, uint32_t rate, int mode);
+static void vdr_audio_port_put_buffer(xine_audio_port_t *port_gen, audio_buffer_t *buf, xine_stream_t *stream);
+
+
+
+void *vdr_audio_init_plugin(xine_t *xine, void *data)
+{
+ post_class_t *class = (post_class_t *)malloc(sizeof (post_class_t));
+
+ if (!class)
+ return NULL;
+
+ class->open_plugin = vdr_audio_open_plugin;
+ class->get_identifier = vdr_audio_get_identifier;
+ class->get_description = vdr_audio_get_description;
+ class->dispose = vdr_audio_class_dispose;
+
+ return class;
+}
+
+static post_plugin_t *vdr_audio_open_plugin(post_class_t *class_gen, int inputs,
+ xine_audio_port_t **audio_target,
+ xine_video_port_t **video_target)
+{
+ vdr_audio_post_plugin_t *this = (vdr_audio_post_plugin_t *)xine_xmalloc(sizeof (vdr_audio_post_plugin_t));
+ post_in_t *input;
+ post_out_t *output;
+ post_audio_port_t *port;
+/*
+fprintf(stderr, "~~~~~~~~~~ vdr open plugin\n");
+*/
+ if (!this || !audio_target || !audio_target[ 0 ])
+ {
+ free(this);
+ return NULL;
+ }
+
+ _x_post_init(&this->post_plugin, 1, 0);
+ this->post_plugin.dispose = vdr_audio_dispose;
+
+ port = _x_post_intercept_audio_port(&this->post_plugin, audio_target[ 0 ], &input, &output);
+ port->new_port.open = vdr_audio_port_open;
+ port->new_port.put_buffer = vdr_audio_port_put_buffer;
+
+ this->post_plugin.xine_post.audio_input[ 0 ] = &port->new_port;
+
+
+
+ this->audio_channels = 0;
+
+ return &this->post_plugin;
+}
+
+static char *vdr_audio_get_identifier(post_class_t *class_gen)
+{
+ return "vdr_audio";
+}
+
+static char *vdr_audio_get_description(post_class_t *class_gen)
+{
+ return "modifies every audio frame as requested by VDR";
+}
+
+static void vdr_audio_class_dispose(post_class_t *class_gen)
+{
+ free(class_gen);
+}
+
+
+static void vdr_audio_dispose(post_plugin_t *this_gen)
+{
+/*
+fprintf(stderr, "~~~~~~~~~~ vdr dispose\n");
+*/
+ if (_x_post_dispose(this_gen))
+ {
+ vdr_audio_post_plugin_t *this = (vdr_audio_post_plugin_t *)this_gen;
+
+ if (this->vdr_stream)
+ xine_event_dispose_queue(this->event_queue);
+
+ free(this_gen);
+ }
+}
+
+static int vdr_audio_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream,
+ uint32_t bits, uint32_t rate, int mode) {
+
+ post_audio_port_t *port = (post_audio_port_t *)port_gen;
+ vdr_audio_post_plugin_t *this = (vdr_audio_post_plugin_t *)port->post;
+
+ _x_post_rewire(&this->post_plugin);
+ _x_post_inc_usage(port);
+/*
+fprintf(stderr, "~~~~~~~~~~ vdr port open\n");
+*/
+ port->stream = stream;
+ port->bits = bits;
+ port->rate = rate;
+ port->mode = mode;
+
+ this->num_channels = _x_ao_mode2channels(mode);
+
+ return (port->original_port->open) (port->original_port, stream, bits, rate, mode );
+}
+
+
+static void vdr_audio_port_put_buffer(xine_audio_port_t *port_gen, audio_buffer_t *buf, xine_stream_t *stream)
+{
+ post_audio_port_t *port = (post_audio_port_t *)port_gen;
+ vdr_audio_post_plugin_t *this = (vdr_audio_post_plugin_t *)port->post;
+ xine_event_t *event;
+/*
+fprintf(stderr, "~~~~~~ vdr_audio\n");
+*/
+ if (this->vdr_stream
+ && !_x_continue_stream_processing(this->vdr_stream))
+ {
+ this->vdr_stream = 0;
+
+ xine_event_dispose_queue(this->event_queue);
+ this->event_queue = 0;
+
+ this->audio_channels = 0;
+ }
+
+ if (!this->vdr_stream
+ && vdr_is_vdr_stream(stream))
+ {
+ this->event_queue = xine_event_new_queue(stream);
+ if (this->event_queue)
+ {
+ this->vdr_stream = stream;
+
+ {
+ xine_event_t event;
+
+ event.type = XINE_EVENT_VDR_PLUGINSTARTED;
+ event.data = 0;
+ event.data_length = 1; /* vdr_audio */
+
+ xine_event_send(this->vdr_stream, &event);
+ }
+ }
+ }
+
+ if (this->event_queue)
+ {
+ while ((event = xine_event_get(this->event_queue)))
+ {
+ if (event->type == XINE_EVENT_VDR_SELECTAUDIO)
+ {
+ vdr_select_audio_data_t *data = (vdr_select_audio_data_t *)event->data;
+
+ vdr_audio_select_audio(this, data->channels);
+ }
+
+ xine_event_free(event);
+ }
+ }
+
+ if (this->num_channels == 2
+ && this->audio_channels != 0
+ && this->audio_channels != 3)
+ {
+ audio_buffer_t *vdr_buf = port->original_port->get_buffer(port->original_port);
+ vdr_buf->num_frames = buf->num_frames;
+ vdr_buf->vpts = buf->vpts;
+ vdr_buf->frame_header_count = buf->frame_header_count;
+ vdr_buf->first_access_unit = buf->first_access_unit;
+ /* FIXME: The audio buffer should contain this info.
+ * We should not have to get it from the open call.
+ */
+ vdr_buf->format.bits = buf->format.bits;
+ vdr_buf->format.rate = buf->format.rate;
+ vdr_buf->format.mode = buf->format.mode;
+ _x_extra_info_merge(vdr_buf->extra_info, buf->extra_info);
+
+ {
+ int step = buf->format.bits / 8;
+ uint8_t *src = (uint8_t *)buf->mem;
+ uint8_t *dst = (uint8_t *)vdr_buf->mem;
+
+ if (this->audio_channels == 2)
+ src += step;
+/*
+ fprintf(stderr, "~~~~~~~~~~ vdr port put buffer: channels: %d, %d\n"
+ , this->audio_channels
+ , buf->format.bits);
+*/
+ int i, k;
+ for (i = 0; i < buf->num_frames; i++)
+ {
+ for (k = 0; k < step; k++)
+ *dst++ = *src++;
+
+ src -= step;
+
+ for (k = 0; k < step; k++)
+ *dst++ = *src++;
+
+ src += step;
+ }
+ }
+
+ /* pass data to original port */
+ port->original_port->put_buffer(port->original_port, vdr_buf, stream);
+
+ /* free data from origial buffer */
+ buf->num_frames = 0; /* UNDOCUMENTED, but hey, it works! Force old audio_out buffer free. */
+ }
+
+ port->original_port->put_buffer(port->original_port, buf, stream);
+
+ return;
+}
diff --git a/src/vdr/post_vdr_video.c b/src/vdr/post_vdr_video.c
new file mode 100644
index 000000000..52bef43b6
--- /dev/null
+++ b/src/vdr/post_vdr_video.c
@@ -0,0 +1,495 @@
+/*
+ * Copyright (C) 2000-2004 the xine project
+ *
+ * This file is part of xine, a free video player.
+ *
+ * xine is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * xine is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ *
+ * $Id: vdr.c,v 1.20 2004/04/17 19:54:32 mroi Exp $
+ */
+
+/*
+ * frame scaler plugin for VDR
+ */
+
+#define LOG_MODULE "vdr_video"
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
+
+#include "xine_internal.h"
+#include "post.h"
+#include "post_vdr.h"
+
+
+
+typedef struct vdr_video_post_plugin_s
+{
+ post_plugin_t post_plugin;
+
+ xine_event_queue_t *event_queue;
+ xine_stream_t *vdr_stream;
+
+ int8_t trick_speed_mode;
+ int8_t enabled;
+
+ int32_t x;
+ int32_t y;
+ int32_t w;
+ int32_t h;
+ int32_t w_ref;
+ int32_t h_ref;
+
+ int32_t old_frame_left;
+ int32_t old_frame_top;
+ int32_t old_frame_width;
+ int32_t old_frame_height;
+ double old_frame_ratio;
+
+}
+vdr_video_post_plugin_t;
+
+
+static void vdr_video_set_video_window(vdr_video_post_plugin_t *this, int32_t x, int32_t y, int32_t w, int32_t h, int32_t w_ref, int32_t h_ref)
+{
+ this->enabled = 0;
+
+ this->x = x;
+ this->y = y;
+ this->w = w;
+ this->h = h;
+ this->w_ref = w_ref;
+ this->h_ref = h_ref;
+
+ if (w != w_ref || h != h_ref)
+ this->enabled = 1;
+}
+
+
+/* plugin class functions */
+static post_plugin_t *vdr_video_open_plugin(post_class_t *class_gen, int inputs,
+ xine_audio_port_t **audio_target,
+ xine_video_port_t **video_target);
+static char *vdr_video_get_identifier(post_class_t *class_gen);
+static char *vdr_video_get_description(post_class_t *class_gen);
+static void vdr_video_class_dispose(post_class_t *class_gen);
+
+/* plugin instance functions */
+static void vdr_video_dispose(post_plugin_t *this_gen);
+
+/* route preprocessing functions check */
+static int vdr_video_route_preprocessing_procs(post_video_port_t *port, vo_frame_t *frame);
+
+/* replaced vo_frame functions */
+static int vdr_video_draw(vo_frame_t *frame, xine_stream_t *stream);
+
+
+void *vdr_video_init_plugin(xine_t *xine, void *data)
+{
+ post_class_t *class = (post_class_t *)malloc(sizeof (post_class_t));
+
+ if (!class)
+ return NULL;
+
+ class->open_plugin = vdr_video_open_plugin;
+ class->get_identifier = vdr_video_get_identifier;
+ class->get_description = vdr_video_get_description;
+ class->dispose = vdr_video_class_dispose;
+
+ return class;
+}
+
+static post_plugin_t *vdr_video_open_plugin(post_class_t *class_gen, int inputs,
+ xine_audio_port_t **audio_target,
+ xine_video_port_t **video_target)
+{
+ vdr_video_post_plugin_t *this = (vdr_video_post_plugin_t *)xine_xmalloc(sizeof (vdr_video_post_plugin_t));
+ post_in_t *input;
+ post_out_t *output;
+ post_video_port_t *port;
+
+ if (!this || !video_target || !video_target[ 0 ])
+ {
+ free(this);
+ return NULL;
+ }
+
+ _x_post_init(&this->post_plugin, 0, 1);
+ this->post_plugin.dispose = vdr_video_dispose;
+
+ port = _x_post_intercept_video_port(&this->post_plugin, video_target[ 0 ], &input, &output);
+ port->route_preprocessing_procs = vdr_video_route_preprocessing_procs;
+ port->new_frame->draw = vdr_video_draw;
+ this->post_plugin.xine_post.video_input[ 0 ] = &port->new_port;
+
+ this->enabled = 0;
+ this->vdr_stream = 0;
+ this->event_queue = 0;
+ this->old_frame_left = 0;
+ this->old_frame_top = 0;
+ this->old_frame_width = 0;
+ this->old_frame_height = 0;
+ this->old_frame_ratio = 0;
+ this->trick_speed_mode = 0;
+
+ return &this->post_plugin;
+}
+
+static char *vdr_video_get_identifier(post_class_t *class_gen)
+{
+ return "vdr";
+}
+
+static char *vdr_video_get_description(post_class_t *class_gen)
+{
+ return "modifies every video frame as requested by VDR";
+}
+
+static void vdr_video_class_dispose(post_class_t *class_gen)
+{
+ free(class_gen);
+}
+
+
+static void vdr_video_dispose(post_plugin_t *this_gen)
+{
+ if (_x_post_dispose(this_gen))
+ {
+ vdr_video_post_plugin_t *this = (vdr_video_post_plugin_t *)this_gen;
+
+ if (this->vdr_stream)
+ {
+ xine_event_t event;
+ vdr_frame_size_changed_data_t event_data;
+
+ event_data.x = 0;
+ event_data.y = 0;
+ event_data.w = 0;
+ event_data.h = 0;
+
+ event.type = XINE_EVENT_VDR_FRAMESIZECHANGED;
+ event.data = &event_data;
+ event.data_length = sizeof (event_data);
+
+ xine_event_send(this->vdr_stream, &event);
+
+ xine_event_dispose_queue(this->event_queue);
+ }
+
+ free(this_gen);
+ }
+}
+
+static int vdr_video_route_preprocessing_procs(post_video_port_t *port, vo_frame_t *frame)
+{
+ vdr_video_post_plugin_t *this = (vdr_video_post_plugin_t *)port->post;
+ return !this->enabled
+ || (frame->format != XINE_IMGFMT_YUY2
+ && frame->format != XINE_IMGFMT_YV12);
+}
+
+
+static inline void vdr_video_scale(uint8_t *src, uint8_t *dst, int y_inc, int x_inc, int w_dst, int h_dst, int x, int y, int w, int h, int w_ref, int h_ref, int init)
+{
+ int x0 = x * w_dst / w_ref;
+ int y0 = y * h_dst / h_ref;
+
+ int x1 = ((x + w) * w_dst - 1 + w_ref) / w_ref;
+ int y1 = ((y + h) * h_dst - 1 + h_ref) / h_ref;
+
+ int dx = x1 - x0;
+ int dy = y1 - y0;
+
+ int yy, xx;
+
+ int dy2 = dy + dy;
+ int h_dst2 = h_dst + h_dst;
+ int y_eps = h_dst - dy2;
+
+ int dx2 = dx + dx;
+ int w_dst2 = w_dst + w_dst;
+ int x_eps0 = w_dst - dx2;
+
+ for (yy = 0; yy < y0; yy++)
+ {
+ uint8_t *dst0 = dst;
+
+ for (xx = 0; xx < w_dst; xx++)
+ {
+ *dst0 = init;
+ dst0 += x_inc;
+ }
+
+ dst += y_inc;
+ }
+
+ for (yy = y0; yy < y1; yy++)
+ {
+ uint8_t *dst0 = dst;
+ uint8_t *src0 = src;
+
+ int x_eps = x_eps0;
+
+ for (xx = 0; xx < x0; xx++)
+ {
+ *dst0 = init;
+ dst0 += x_inc;
+ }
+
+ for (xx = x0; xx < x1; xx++)
+ {
+ *dst0 = *src0;
+ dst0 += x_inc;
+
+ x_eps += w_dst2;
+ while (x_eps >= 0)
+ {
+ src0 += x_inc;
+ x_eps -= dx2;
+ }
+ }
+
+ for (xx = x1; xx < w_dst; xx++)
+ {
+ *dst0 = init;
+ dst0 += x_inc;
+ }
+
+ dst += y_inc;
+
+ y_eps += h_dst2;
+ while (y_eps >= 0)
+ {
+ src += y_inc;
+ y_eps -= dy2;
+ }
+ }
+
+ for (yy = y1; yy < h_dst; yy++)
+ {
+ uint8_t *dst0 = dst;
+
+ for (xx = 0; xx < w_dst; xx++)
+ {
+ *dst0 = init;
+ dst0 += x_inc;
+ }
+
+ dst += y_inc;
+ }
+}
+
+static void vdr_video_scale_YUY2(vdr_video_post_plugin_t *this, vo_frame_t *src, vo_frame_t *dst)
+{
+ int w = dst->width - dst->crop_left - dst->crop_right;
+ int h = dst->height - dst->crop_top - dst->crop_bottom;
+ int offset;
+
+ if (w < 0)
+ w = 0;
+
+ if (h < 0)
+ h = 0;
+
+ offset = dst->pitches[ 0 ] * dst->crop_top + 2 * dst->crop_left;
+ vdr_video_scale(&src->base[ 0 ][ 0 ] + offset, &dst->base[ 0 ][ 0 ] + offset, dst->pitches[ 0 ], 2, w , h, this->x, this->y, this->w, this->h, this->w_ref, this->h_ref, 0x00);
+ offset = dst->pitches[ 0 ] * dst->crop_top + 4 * ((dst->crop_left + 1) / 2);
+ vdr_video_scale(&src->base[ 0 ][ 1 ] + offset, &dst->base[ 0 ][ 1 ] + offset, dst->pitches[ 0 ], 4, (w + 1) / 2, h, this->x, this->y, this->w, this->h, this->w_ref, this->h_ref, 0x80);
+ offset = dst->pitches[ 0 ] * dst->crop_top + 4 * ((dst->crop_left + 1) / 2);
+ vdr_video_scale(&src->base[ 0 ][ 3 ] + offset, &dst->base[ 0 ][ 3 ] + offset, dst->pitches[ 0 ], 4, (w + 1) / 2, h, this->x, this->y, this->w, this->h, this->w_ref, this->h_ref, 0x80);
+}
+
+static void vdr_video_scale_YV12(vdr_video_post_plugin_t *this, vo_frame_t *src, vo_frame_t *dst)
+{
+ int w = dst->width - dst->crop_left - dst->crop_right;
+ int h = dst->height - dst->crop_top - dst->crop_bottom;
+ int offset;
+
+ if (w < 0)
+ w = 0;
+
+ if (h < 0)
+ h = 0;
+
+ offset = dst->pitches[ 0 ] * dst->crop_top + 1 * dst->crop_left;
+ vdr_video_scale(&src->base[ 0 ][ 0 ] + offset, &dst->base[ 0 ][ 0 ] + offset, dst->pitches[ 0 ], 1, w , h , this->x, this->y, this->w, this->h, this->w_ref, this->h_ref, 0x00);
+ offset = dst->pitches[ 1 ] * ((dst->crop_top + 1) / 2) + 1 * ((dst->crop_left + 1) / 2);
+ vdr_video_scale(&src->base[ 1 ][ 0 ] + offset, &dst->base[ 1 ][ 0 ] + offset, dst->pitches[ 1 ], 1, (w + 1) / 2, (h + 1) / 2, this->x, this->y, this->w, this->h, this->w_ref, this->h_ref, 0x80);
+ offset = dst->pitches[ 2 ] * ((dst->crop_top + 1) / 2) + 1 * ((dst->crop_left + 1) / 2);
+ vdr_video_scale(&src->base[ 2 ][ 0 ] + offset, &dst->base[ 2 ][ 0 ] + offset, dst->pitches[ 2 ], 1, (w + 1) / 2, (h + 1) / 2, this->x, this->y, this->w, this->h, this->w_ref, this->h_ref, 0x80);
+}
+
+
+static int vdr_video_draw(vo_frame_t *frame, xine_stream_t *stream)
+{
+ post_video_port_t *port = (post_video_port_t *)frame->port;
+ vdr_video_post_plugin_t *this = (vdr_video_post_plugin_t *)port->post;
+ vo_frame_t *vdr_frame;
+ xine_event_t *event;
+ int skip;
+
+ if (this->vdr_stream
+ && !_x_continue_stream_processing(this->vdr_stream))
+ {
+ this->vdr_stream = 0;
+
+ xine_event_dispose_queue(this->event_queue);
+ this->event_queue = 0;
+
+ this->old_frame_left = 0;
+ this->old_frame_top = 0;
+ this->old_frame_width = 0;
+ this->old_frame_height = 0;
+ this->old_frame_ratio = 0;
+ }
+
+ if (!this->vdr_stream
+ && vdr_is_vdr_stream(stream))
+ {
+ this->event_queue = xine_event_new_queue(stream);
+ if (this->event_queue)
+ {
+ this->vdr_stream = stream;
+
+ {
+ xine_event_t event;
+
+ event.type = XINE_EVENT_VDR_PLUGINSTARTED;
+ event.data = 0;
+ event.data_length = 0; /* vdr_video */
+
+ xine_event_send(this->vdr_stream, &event);
+ }
+ }
+ }
+
+ if (this->event_queue)
+ {
+ while ((event = xine_event_get(this->event_queue)))
+ {
+ if (event->type == XINE_EVENT_VDR_SETVIDEOWINDOW)
+ {
+ vdr_set_video_window_data_t *data = (vdr_set_video_window_data_t *)event->data;
+
+ vdr_video_set_video_window(this, data->x, data->y, data->w, data->h, data->w_ref, data->h_ref);
+ }
+ else if (event->type == XINE_EVENT_VDR_TRICKSPEEDMODE)
+ {
+/*
+ fprintf(stderr, "###############################: %p, %d\n", event->data, event->data_length);
+ this->trick_speed_mode = (0 != event->data_length);
+*/
+ }
+
+ xine_event_free(event);
+ }
+ }
+
+ {
+ int32_t frame_left = frame->crop_left;
+ int32_t frame_width = frame->width - frame->crop_left - frame->crop_right;
+ int32_t frame_top = frame->crop_top;
+ int32_t frame_height = frame->height - frame->crop_top - frame->crop_bottom;
+ double frame_ratio = frame->ratio;
+
+ if (frame_left < 0)
+ frame_left = 0;
+ if (frame_width > frame->width)
+ frame_width = frame->width;
+ if (frame_top < 0)
+ frame_top = 0;
+ if (frame_height > frame->height)
+ frame_height = frame->height;
+
+ if (this->vdr_stream
+ && frame_width != 0
+ && frame_height != 0
+ && (this->old_frame_left != frame_left
+ || this->old_frame_top != frame_top
+ || this->old_frame_width != frame_width
+ || this->old_frame_height != frame_height
+ || this->old_frame_ratio != frame_ratio))
+ {
+ xine_event_t event;
+ vdr_frame_size_changed_data_t event_data;
+
+ event_data.x = frame_left;
+ event_data.y = frame_top;
+ event_data.w = frame_width;
+ event_data.h = frame_height;
+ event_data.r = frame_ratio;
+
+ xprintf(this->vdr_stream->xine, XINE_VERBOSITY_LOG,
+ _(LOG_MODULE ": osd: (%d, %d)-(%d, %d)@%lg\n"), frame_left, frame_top, frame_width, frame_height, frame_ratio);
+
+ event.type = XINE_EVENT_VDR_FRAMESIZECHANGED;
+ event.data = &event_data;
+ event.data_length = sizeof (event_data);
+
+ xine_event_send(this->vdr_stream, &event);
+
+ this->old_frame_left = frame_left;
+ this->old_frame_top = frame_top;
+ this->old_frame_width = frame_width;
+ this->old_frame_height = frame_height;
+ this->old_frame_ratio = frame_ratio;
+ }
+ }
+/*
+ fprintf(stderr, "~~~~~~~~~~~~ trickspeedmode: %d\n", this->trick_speed_mode);
+
+ if (this->vdr_stream
+ && this->trick_speed_mode)
+ {
+ frame->pts = 0;
+ frame->next->pts = 0;
+ }
+*/
+ if (!this->enabled
+ || frame->bad_frame
+ || (frame->format != XINE_IMGFMT_YUY2
+ && frame->format != XINE_IMGFMT_YV12)
+ || frame->proc_frame
+ || frame->proc_slice)
+ {
+ _x_post_frame_copy_down(frame, frame->next);
+ skip = frame->next->draw(frame->next, stream);
+ _x_post_frame_copy_up(frame, frame->next);
+ return skip;
+ }
+
+ vdr_frame = port->original_port->get_frame(port->original_port,
+ frame->width, frame->height, frame->ratio, frame->format, frame->flags | VO_BOTH_FIELDS);
+
+ _x_post_frame_copy_down(frame, vdr_frame);
+
+ switch (vdr_frame->format)
+ {
+ case XINE_IMGFMT_YUY2:
+ vdr_video_scale_YUY2(this, frame, vdr_frame);
+ break;
+
+ case XINE_IMGFMT_YV12:
+ vdr_video_scale_YV12(this, frame, vdr_frame);
+ break;
+ }
+
+ skip = vdr_frame->draw(vdr_frame, stream);
+ _x_post_frame_copy_up(frame, vdr_frame);
+ vdr_frame->free(vdr_frame);
+
+ return skip;
+}
diff --git a/src/video_out/Makefile.am b/src/video_out/Makefile.am
index 408eb1e95..913fed7cd 100644
--- a/src/video_out/Makefile.am
+++ b/src/video_out/Makefile.am
@@ -1,14 +1,18 @@
include $(top_srcdir)/misc/Makefile.common
-AM_CPPFLAGS = -DXINE_COMPILE
-AM_LDFLAGS = $(xineplug_ldflags)
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_LDFLAGS = $(xineplug_ldflags)
+AM_OBJCFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
-SUBDIRS = libdha vidix macosx
+SUBDIRS =
+
+if ENABLE_MACOSX_VIDEO
+SUBDIRS += macosx
+endif
EXTRA_DIST = video_out_directfb.c video_out_directfb_fb.c video_out_directfb_x.c video_out_directx.c video_out_macosx.m
-VIDIX_CFLAGS = -I$(top_builddir)/src/video_out/vidix \
- -I$(top_srcdir)/src/video_out/vidix
+noinst_HEADERS = video_out_syncfb.h yuv2rgb.h x11osd.h xcbosd.h
if HAVE_X11
X11OSD = x11osd.c
@@ -16,72 +20,74 @@ xshm_module = xineplug_vo_out_xshm.la
if HAVE_XV
xv_module = xineplug_vo_out_xv.la
endif
-if HAVE_XVMC
+if ENABLE_XVMC
xvmc_module = xineplug_vo_out_xvmc.la
endif
-if HAVE_XXMC
+if ENABLE_XXMC
xxmc_module = xineplug_vo_out_xxmc.la
endif
-if HAVE_OPENGL
+if ENABLE_OPENGL
opengl_module = xineplug_vo_out_opengl.la
endif
-if HAVE_SYNCFB
+if ENABLE_SYNCFB
syncfb_module = xineplug_vo_out_syncfb.la
endif
-if HAVE_SUNFB
-if HAVE_SUNDGA
+if ENABLE_SUNFB
+if ENABLE_SUNDGA
pgx64_module = xineplug_vo_out_pgx64.la
pgx32_module = xineplug_vo_out_pgx32.la
endif
endif
endif
-if HAVE_XCB
+if ENABLE_XCB
XCBOSD = xcbosd.c
-if HAVE_XCBSHM
+if ENABLE_XCBSHM
xcbshm_module = xineplug_vo_out_xcbshm.la
endif
-if HAVE_XCBXV
+if ENABLE_XCBXV
xcbxv_module = xineplug_vo_out_xcbxv.la
endif
endif
-if HAVE_VIDIX
+if ENABLE_VIDIX
vidix_module = xineplug_vo_out_vidix.la
+$(top_builddir)/contrib/vidix/libvidix.la:
+ $(MAKE) -C $(top_builddir)/contrib/vidix libvidix.la
endif
-if HAVE_AA
+if ENABLE_AA
aa_module = xineplug_vo_out_aa.la
endif
-if HAVE_CACA
+if ENABLE_CACA
caca_module = xineplug_vo_out_caca.la
endif
-if HAVE_FB
+if ENABLE_FB
fb_module = xineplug_vo_out_fb.la
endif
-if HAVE_DIRECTFB
+if ENABLE_DIRECTFB
directfb_module = xineplug_vo_out_directfb.la
if HAVE_X11
directfb_module += xineplug_vo_out_xdirectfb.la
endif
endif
-if HAVE_SDL
+if ENABLE_SDL
sdl_module = xineplug_vo_out_sdl.la
endif
-if HAVE_STK
+if ENABLE_STK
stk_module = xineplug_vo_out_stk.la
endif
-if HAVE_DIRECTX
+if ENABLE_DIRECTX
directx_module = xineplug_vo_out_directx.la
endif
-if HAVE_MACOSX_VIDEO
+if ENABLE_MACOSX_VIDEO
macosx_module = xineplug_vo_out_macosx.la
endif
@@ -104,101 +110,94 @@ xineplug_LTLIBRARIES = $(xshm_module) $(xv_module) $(xvmc_module) \
xineplug_vo_out_xcbshm_la_SOURCES = yuv2rgb.c yuv2rgb_mmx.c yuv2rgb_mlib.c video_out_xcbshm.c $(XCBOSD)
xineplug_vo_out_xcbshm_la_LIBADD = $(MLIB_LIBS) $(XINE_LIB) $(PTHREAD_LIBS) $(XCB_LIBS) $(XCBSHM_LIBS) $(LTLIBINTL)
-xineplug_vo_out_xcbshm_la_CFLAGS = $(VISIBILITY_FLAG) $(MLIB_CFLAGS) $(XCB_CFLAGS) $(XCBSHM_CFLAGS)
+xineplug_vo_out_xcbshm_la_CFLAGS = $(AM_CFLAGS) $(MLIB_CFLAGS) $(XCB_CFLAGS) $(XCBSHM_CFLAGS)
-xineplug_vo_out_xcbxv_la_SOURCES = deinterlace.c video_out_xcbxv.c $(XCBOSD)
+xineplug_vo_out_xcbxv_la_SOURCES = video_out_xcbxv.c $(XCBOSD)
xineplug_vo_out_xcbxv_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL) $(XCBXV_LIBS) $(XCB_LIBS)
-xineplug_vo_out_xcbxv_la_CFLAGS = $(VISIBILITY_FLAG) $(XCB_CFLAGS) $(XCBXV_CFLAGS)
+xineplug_vo_out_xcbxv_la_CFLAGS = $(AM_CFLAGS) $(XCB_CFLAGS) $(XCBXV_CFLAGS)
xineplug_vo_out_xshm_la_SOURCES = yuv2rgb.c yuv2rgb_mmx.c yuv2rgb_mlib.c \
video_out_xshm.c $(X11OSD)
xineplug_vo_out_xshm_la_LIBADD = $(MLIB_LIBS) $(X_LIBS) $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_vo_out_xshm_la_CFLAGS = $(VISIBILITY_FLAG) $(X_CFLAGS) $(MLIB_CFLAGS) -fno-strict-aliasing
+xineplug_vo_out_xshm_la_CFLAGS = $(AM_CFLAGS) $(X_CFLAGS) $(MLIB_CFLAGS) -fno-strict-aliasing
-xineplug_vo_out_xv_la_SOURCES = $(X11OSD) deinterlace.c video_out_xv.c
+xineplug_vo_out_xv_la_SOURCES = $(X11OSD) video_out_xv.c
xineplug_vo_out_xv_la_LIBADD = $(XV_LIBS) $(X_LIBS) $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_vo_out_xv_la_CFLAGS = $(VISIBILITY_FLAG) $(X_CFLAGS) $(XV_CFLAGS) -fno-strict-aliasing
+xineplug_vo_out_xv_la_CFLAGS = $(AM_CFLAGS) $(X_CFLAGS) $(XV_CFLAGS) -fno-strict-aliasing
-xineplug_vo_out_xvmc_la_SOURCES = deinterlace.c video_out_xvmc.c
+xineplug_vo_out_xvmc_la_SOURCES = video_out_xvmc.c
xineplug_vo_out_xvmc_la_LIBADD = $(XVMC_LIBS) $(XV_LIBS) $(X_LIBS) $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_vo_out_xvmc_la_CFLAGS = $(VISIBILITY_FLAG) $(X_CFLAGS) $(XV_CFLAGS)
+xineplug_vo_out_xvmc_la_CFLAGS = $(AM_CFLAGS) $(X_CFLAGS) $(XV_CFLAGS)
-xineplug_vo_out_xxmc_la_SOURCES = $(X11OSD) deinterlace.c video_out_xxmc.c\
+xineplug_vo_out_xxmc_la_SOURCES = $(X11OSD) video_out_xxmc.c\
xvmc_mocomp.c xvmc_vld.c xxmc.h
xineplug_vo_out_xxmc_la_LIBADD = $(XXMC_LIBS) $(XV_LIBS) $(X_LIBS) $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_vo_out_xxmc_la_CFLAGS = $(VISIBILITY_FLAG) $(X_CFLAGS) $(XV_CFLAGS) -fno-strict-aliasing
+xineplug_vo_out_xxmc_la_CFLAGS = $(AM_CFLAGS) $(X_CFLAGS) $(XV_CFLAGS) -fno-strict-aliasing
xineplug_vo_out_opengl_la_SOURCES = yuv2rgb.c yuv2rgb_mmx.c yuv2rgb_mlib.c \
video_out_opengl.c myglext.h $(X11OSD)
xineplug_vo_out_opengl_la_LIBADD = $(MLIB_LIBS) $(OPENGL_LIBS) $(GLUT_LIBS) \
$(GLU_LIBS) $(X_LIBS) $(XINE_LIB) $(PTHREAD_LIBS) $(DYNAMIC_LD_LIBS) $(LTLIBINTL)
-xineplug_vo_out_opengl_la_CFLAGS = $(VISIBILITY_FLAG) $(X_CFLAGS) $(MLIB_CFLAGS) -fno-strict-aliasing
+xineplug_vo_out_opengl_la_CFLAGS = $(AM_CFLAGS) $(X_CFLAGS) $(MLIB_CFLAGS) -fno-strict-aliasing
xineplug_vo_out_syncfb_la_SOURCES = video_out_syncfb.c
xineplug_vo_out_syncfb_la_LIBADD = $(X_LIBS) $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_vo_out_syncfb_la_CFLAGS = $(VISIBILITY_FLAG)
xineplug_vo_out_pgx64_la_SOURCES = video_out_pgx64.c
xineplug_vo_out_pgx64_la_LIBADD = $(XINE_LIB) $(X_LIBS) $(SUNDGA_LIBS) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_vo_out_pgx64_la_CFLAGS = $(VISIBILITY_FLAG) $(X_CFLAGS) $(SUNDGA_CFLAGS)
+xineplug_vo_out_pgx64_la_CFLAGS = $(AM_CFLAGS) $(X_CFLAGS)
+xineplug_vo_out_pgx64_la_CPPFLAGS = $(AM_CPPFLAGS) $(SUNDGA_CPPFLAGS)
xineplug_vo_out_pgx32_la_SOURCES = video_out_pgx32.c
xineplug_vo_out_pgx32_la_LIBADD = $(XINE_LIB) $(X_LIBS) $(SUNDGA_LIBS) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_vo_out_pgx32_la_CFLAGS = $(VISIBILITY_FLAG) $(X_CFLAGS) $(SUNDGA_CFLAGS)
+xineplug_vo_out_pgx32_la_CFLAGS = $(AM_CFLAGS) $(X_CFLAGS)
+xineplug_vo_out_pgx32_la_CPPFLAGS = $(AM_CPPFLAGS) $(SUNDGA_CPPFLAGS)
xineplug_vo_out_vidix_la_SOURCES = video_out_vidix.c $(X11OSD)
xineplug_vo_out_vidix_la_LIBADD = $(XINE_LIB) $(X_LIBS) \
- $(top_builddir)/src/video_out/vidix/libvidix.la $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_vo_out_vidix_la_CFLAGS = $(VISIBILITY_FLAG) $(VIDIX_CFLAGS) $(X_CFLAGS) -fno-strict-aliasing
+ $(top_builddir)/contrib/vidix/libvidix.la $(PTHREAD_LIBS) $(LTLIBINTL)
+xineplug_vo_out_vidix_la_CFLAGS = $(AM_CFLAGS) $(X_CFLAGS) -fno-strict-aliasing
+xineplug_vo_out_vidix_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_builddir)/contrib/vidix \
+ -I$(top_srcdir)/contrib/vidix
+
xineplug_vo_out_aa_la_SOURCES = video_out_aa.c
xineplug_vo_out_aa_la_LIBADD = $(AALIB_LIBS) $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_vo_out_aa_la_CFLAGS = $(VISIBILITY_FLAG) $(AALIB_CFLAGS)
+xineplug_vo_out_aa_la_CFLAGS = $(AM_CFLAGS) $(AALIB_CFLAGS)
xineplug_vo_out_caca_la_SOURCES = yuv2rgb.c yuv2rgb_mmx.c yuv2rgb_mlib.c \
video_out_caca.c
xineplug_vo_out_caca_la_LIBADD = $(CACA_LIBS) $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_vo_out_caca_la_CFLAGS = $(VISIBILITY_FLAG) $(CACA_CFLAGS)
+xineplug_vo_out_caca_la_CFLAGS = $(AM_CFLAGS) $(CACA_CFLAGS)
xineplug_vo_out_fb_la_SOURCES = yuv2rgb.c yuv2rgb_mmx.c yuv2rgb_mlib.c \
video_out_fb.c
xineplug_vo_out_fb_la_LIBADD = $(MLIB_LIBS) $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_vo_out_fb_la_CFLAGS = $(VISIBILITY_FLAG) $(MLIB_CFLAGS)
+xineplug_vo_out_fb_la_CFLAGS = $(AM_CFLAGS) $(MLIB_CFLAGS)
xineplug_vo_out_directfb_la_SOURCES = video_out_directfb_fb.c
xineplug_vo_out_directfb_la_LIBADD = $(XINE_LIB) $(DIRECTFB_LIBS) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_vo_out_directfb_la_CFLAGS = $(VISIBILITY_FLAG) $(DIRECTFB_CFLAGS) -fno-strict-aliasing
+xineplug_vo_out_directfb_la_CFLAGS = $(AM_CFLAGS) $(DIRECTFB_CFLAGS) -fno-strict-aliasing
xineplug_vo_out_xdirectfb_la_SOURCES = video_out_directfb_x.c $(X11OSD)
xineplug_vo_out_xdirectfb_la_LIBADD = $(XINE_LIB) $(DIRECTFB_LIBS) $(X_LIBS) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_vo_out_xdirectfb_la_CFLAGS = $(VISIBILITY_FLAG) $(DIRECTFB_CFLAGS) -fno-strict-aliasing
+xineplug_vo_out_xdirectfb_la_CFLAGS = $(AM_CFLAGS) $(DIRECTFB_CFLAGS) -fno-strict-aliasing
xineplug_vo_out_sdl_la_SOURCES = video_out_sdl.c
xineplug_vo_out_sdl_la_LIBADD = $(SDL_LIBS) $(X_LIBS) $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_vo_out_sdl_la_CFLAGS = $(VISIBILITY_FLAG) $(X_CFLAGS) $(SDL_CFLAGS)
+xineplug_vo_out_sdl_la_CFLAGS = $(AM_CFLAGS) $(X_CFLAGS) $(SDL_CFLAGS)
xineplug_vo_out_stk_la_SOURCES = video_out_stk.c
xineplug_vo_out_stk_la_LIBADD = $(XINE_LIB) $(LIBSTK_LIBS) $(PTHREAD_LIBS)
-xineplug_vo_out_stk_la_CFLAGS = $(VISIBILITY_FLAG) $(LIBSTK_CFLAGS)
+xineplug_vo_out_stk_la_CFLAGS = $(AM_CFLAGS) $(LIBSTK_CFLAGS)
xineplug_vo_out_directx_la_SOURCES = yuv2rgb.c yuv2rgb_mmx.c video_out_directx.c
-xineplug_vo_out_directx_la_CPPFLAGS = $(AM_CPPFLAGS) $(DIRECTX_CPPFLAGS)
xineplug_vo_out_directx_la_LIBADD = $(DIRECTX_VIDEO_LIBS) $(XINE_LIB) $(PTHREAD_LIBS)
-xineplug_vo_out_directx_la_CFLAGS = $(VISIBILITY_FLAG)
+xineplug_vo_out_directx_la_CPPFLAGS = $(AM_CPPFLAGS) $(DIRECTX_CPPFLAGS)
xineplug_vo_out_none_la_SOURCES = video_out_none.c
xineplug_vo_out_none_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_vo_out_none_la_CFLAGS = $(VISIBILITY_FLAG)
xineplug_vo_out_macosx_la_SOURCES = video_out_macosx.m
-xineplug_vo_out_macosx_la_CPPFLAGS = $(AM_CPPFLAGS) $(X_CFLAGS) $(MLIB_CFLAGS)
-xineplug_vo_out_macosx_la_OBJCFLAGS = $(VISIBILITY_FLAG)
-xineplug_vo_out_macosx_la_LIBADD = $(MLIB_LIBS) $(OPENGL_LIBS) $(GLUT_LIBS) \
- $(GLU_LIBS) $(X_LIBS) $(XINE_LIB) $(PTHREAD_LIBS)
-# The "-Wl,-framework -Wl,Cocoa" is needed for libtool versions before
-# 1.5.x (1.257): the default version that ships with Mac OS X is 1.5 (1.1220)
-xineplug_vo_out_macosx_la_LDFLAGS = $(AM_LDFLAGS) \
- -Wl,-framework -Wl,Cocoa -framework Cocoa -framework OpenGL
-
-noinst_HEADERS = deinterlace.h video_out_syncfb.h \
- yuv2rgb.h x11osd.h xcbosd.h
+xineplug_vo_out_macosx_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS)
+xineplug_vo_out_macosx_la_LDFLAGS = $(AM_LDFLAGS) -framework Cocoa -framework OpenGL
diff --git a/src/video_out/deinterlace.c b/src/video_out/deinterlace.c
deleted file mode 100644
index 1fda3d733..000000000
--- a/src/video_out/deinterlace.c
+++ /dev/null
@@ -1,847 +0,0 @@
- /*
- * Copyright (C) 2001 the xine project
- *
- * This file is part of xine, a free video player.
- *
- * xine is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * xine is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- *
- * Deinterlace routines by Miguel Freitas
- * based of DScaler project sources (deinterlace.sourceforge.net)
- *
- * Currently only available for Xv driver and MMX extensions
- *
- * small todo list:
- * - implement non-MMX versions for all methods
- * - support MMX2 instructions
- * - move some generic code from xv driver to this file
- * - make it also work for yuy2 frames
- *
- */
-
-#include <stdio.h>
-#include <string.h>
-#include "xine_internal.h"
-#include "deinterlace.h"
-#include "xineutils.h"
-
-
-/*
- DeinterlaceFieldBob algorithm
- Based on Virtual Dub plugin by Gunnar Thalin
- MMX asm version from dscaler project (deinterlace.sourceforge.net)
- Linux version for Xine player by Miguel Freitas
-*/
-static void deinterlace_bob_yuv_mmx( uint8_t *pdst, uint8_t *psrc[],
- int width, int height )
-{
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
- int Line;
- uint64_t *YVal1;
- uint64_t *YVal2;
- uint64_t *YVal3;
- uint64_t *Dest;
- uint8_t* pEvenLines = psrc[0];
- uint8_t* pOddLines = psrc[0]+width;
- int LineLength = width;
- int SourcePitch = width * 2;
- int IsOdd = 1;
- long EdgeDetect = 625;
- long JaggieThreshold = 73;
-
- int n;
-
- uint64_t qwEdgeDetect;
- uint64_t qwThreshold;
-
- static mmx_t YMask = {ub:{0xff,0,0xff,0,0xff,0,0xff,0}};
- static mmx_t Mask = {ub:{0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe}};
-
- qwEdgeDetect = EdgeDetect;
- qwEdgeDetect += (qwEdgeDetect << 48) + (qwEdgeDetect << 32) + (qwEdgeDetect << 16);
- qwThreshold = JaggieThreshold;
- qwThreshold += (qwThreshold << 48) + (qwThreshold << 32) + (qwThreshold << 16);
-
-
- // copy first even line no matter what, and the first odd line if we're
- // processing an odd field.
- xine_fast_memcpy(pdst, pEvenLines, LineLength);
- if (IsOdd)
- xine_fast_memcpy(pdst + LineLength, pOddLines, LineLength);
-
- height = height / 2;
- for (Line = 0; Line < height - 1; ++Line)
- {
- if (IsOdd)
- {
- YVal1 = (uint64_t *)(pOddLines + Line * SourcePitch);
- YVal2 = (uint64_t *)(pEvenLines + (Line + 1) * SourcePitch);
- YVal3 = (uint64_t *)(pOddLines + (Line + 1) * SourcePitch);
- Dest = (uint64_t *)(pdst + (Line * 2 + 2) * LineLength);
- }
- else
- {
- YVal1 = (uint64_t *)(pEvenLines + Line * SourcePitch);
- YVal2 = (uint64_t *)(pOddLines + Line * SourcePitch);
- YVal3 = (uint64_t *)(pEvenLines + (Line + 1) * SourcePitch);
- Dest = (uint64_t *)(pdst + (Line * 2 + 1) * LineLength);
- }
-
- // For ease of reading, the comments below assume that we're operating on an odd
- // field (i.e., that bIsOdd is true). The exact same processing is done when we
- // operate on an even field, but the roles of the odd and even fields are reversed.
- // It's just too cumbersome to explain the algorithm in terms of "the next odd
- // line if we're doing an odd field, or the next even line if we're doing an
- // even field" etc. So wherever you see "odd" or "even" below, keep in mind that
- // half the time this function is called, those words' meanings will invert.
-
- // Copy the odd line to the overlay verbatim.
- xine_fast_memcpy((char *)Dest + LineLength, YVal3, LineLength);
-
- n = LineLength >> 3;
- while( n-- )
- {
- movq_m2r (*YVal1++, mm0);
- movq_m2r (*YVal2++, mm1);
- movq_m2r (*YVal3++, mm2);
-
- // get intensities in mm3 - 4
- movq_r2r ( mm0, mm3 );
- pand_m2r ( YMask, mm3 );
- movq_r2r ( mm1, mm4 );
- pand_m2r ( YMask, mm4 );
- movq_r2r ( mm2, mm5 );
- pand_m2r ( YMask, mm5 );
-
- // get average in mm0
- pand_m2r ( Mask, mm0 );
- pand_m2r ( Mask, mm2 );
- psrlw_i2r ( 01, mm0 );
- psrlw_i2r ( 01, mm2 );
- paddw_r2r ( mm2, mm0 );
-
- // work out (O1 - E) * (O2 - E) / 2 - EdgeDetect * (O1 - O2) ^ 2 >> 12
- // result will be in mm6
-
- psrlw_i2r ( 01, mm3 );
- psrlw_i2r ( 01, mm4 );
- psrlw_i2r ( 01, mm5 );
-
- movq_r2r ( mm3, mm6 );
- psubw_r2r ( mm4, mm6 ); //mm6 = O1 - E
-
- movq_r2r ( mm5, mm7 );
- psubw_r2r ( mm4, mm7 ); //mm7 = O2 - E
-
- pmullw_r2r ( mm7, mm6 ); // mm6 = (O1 - E) * (O2 - E)
-
- movq_r2r ( mm3, mm7 );
- psubw_r2r ( mm5, mm7 ); // mm7 = (O1 - O2)
- pmullw_r2r ( mm7, mm7 ); // mm7 = (O1 - O2) ^ 2
- psrlw_i2r ( 12, mm7 ); // mm7 = (O1 - O2) ^ 2 >> 12
- pmullw_m2r ( *&qwEdgeDetect, mm7 );// mm7 = EdgeDetect * (O1 - O2) ^ 2 >> 12
-
- psubw_r2r ( mm7, mm6 ); // mm6 is what we want
-
- pcmpgtw_m2r ( *&qwThreshold, mm6 );
-
- movq_r2r ( mm6, mm7 );
-
- pand_r2r ( mm6, mm0 );
-
- pandn_r2r ( mm1, mm7 );
-
- por_r2r ( mm0, mm7 );
-
- movq_r2m ( mm7, *Dest++ );
- }
- }
-
- // Copy last odd line if we're processing an even field.
- if (! IsOdd)
- {
- xine_fast_memcpy(pdst + (height * 2 - 1) * LineLength,
- pOddLines + (height - 1) * SourcePitch,
- LineLength);
- }
-
- // clear out the MMX registers ready for doing floating point
- // again
- emms();
-#endif
-}
-
-/* Deinterlace the latest field, with a tendency to weave rather than bob.
- Good for high detail on low-movement scenes.
- Seems to produce bad output in general case, need to check if this
- is normal or if the code is broken.
-*/
-static int deinterlace_weave_yuv_mmx( uint8_t *pdst, uint8_t *psrc[],
- int width, int height )
-{
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
-
- int Line;
- uint64_t *YVal1;
- uint64_t *YVal2;
- uint64_t *YVal3;
- uint64_t *YVal4;
- uint64_t *Dest;
- uint8_t* pEvenLines = psrc[0];
- uint8_t* pOddLines = psrc[0]+width;
- uint8_t* pPrevLines;
-
- int LineLength = width;
- int SourcePitch = width * 2;
- int IsOdd = 1;
-
- long TemporalTolerance = 300;
- long SpatialTolerance = 600;
- long SimilarityThreshold = 25;
-
- int n;
-
- uint64_t qwSpatialTolerance;
- uint64_t qwTemporalTolerance;
- uint64_t qwThreshold;
-
- static mmx_t YMask = {ub:{0xff,0,0xff,0,0xff,0,0xff,0}};
- static mmx_t Mask = {ub:{0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe}};
-
-
- // Make sure we have all the data we need.
- if ( psrc[0] == NULL || psrc[1] == NULL )
- return 0;
-
- if (IsOdd)
- pPrevLines = psrc[1] + width;
- else
- pPrevLines = psrc[1];
-
- // Since the code uses MMX to process 4 pixels at a time, we need our constants
- // to be represented 4 times per quadword.
- qwSpatialTolerance = SpatialTolerance;
- qwSpatialTolerance += (qwSpatialTolerance << 48) + (qwSpatialTolerance << 32) + (qwSpatialTolerance << 16);
- qwTemporalTolerance = TemporalTolerance;
- qwTemporalTolerance += (qwTemporalTolerance << 48) + (qwTemporalTolerance << 32) + (qwTemporalTolerance << 16);
- qwThreshold = SimilarityThreshold;
- qwThreshold += (qwThreshold << 48) + (qwThreshold << 32) + (qwThreshold << 16);
-
- // copy first even line no matter what, and the first odd line if we're
- // processing an even field.
- xine_fast_memcpy(pdst, pEvenLines, LineLength);
- if (!IsOdd)
- xine_fast_memcpy(pdst + LineLength, pOddLines, LineLength);
-
- height = height / 2;
- for (Line = 0; Line < height - 1; ++Line)
- {
- if (IsOdd)
- {
- YVal1 = (uint64_t *)(pEvenLines + Line * SourcePitch);
- YVal2 = (uint64_t *)(pOddLines + Line * SourcePitch);
- YVal3 = (uint64_t *)(pEvenLines + (Line + 1) * SourcePitch);
- YVal4 = (uint64_t *)(pPrevLines + Line * SourcePitch);
- Dest = (uint64_t *)(pdst + (Line * 2 + 1) * LineLength);
- }
- else
- {
- YVal1 = (uint64_t *)(pOddLines + Line * SourcePitch);
- YVal2 = (uint64_t *)(pEvenLines + (Line + 1) * SourcePitch);
- YVal3 = (uint64_t *)(pOddLines + (Line + 1) * SourcePitch);
- YVal4 = (uint64_t *)(pPrevLines + (Line + 1) * SourcePitch);
- Dest = (uint64_t *)(pdst + (Line * 2 + 2) * LineLength);
- }
-
- // For ease of reading, the comments below assume that we're operating on an odd
- // field (i.e., that bIsOdd is true). The exact same processing is done when we
- // operate on an even field, but the roles of the odd and even fields are reversed.
- // It's just too cumbersome to explain the algorithm in terms of "the next odd
- // line if we're doing an odd field, or the next even line if we're doing an
- // even field" etc. So wherever you see "odd" or "even" below, keep in mind that
- // half the time this function is called, those words' meanings will invert.
-
- // Copy the even scanline below this one to the overlay buffer, since we'll be
- // adapting the current scanline to the even lines surrounding it. The scanline
- // above has already been copied by the previous pass through the loop.
- xine_fast_memcpy((char *)Dest + LineLength, YVal3, LineLength);
-
- n = LineLength >> 3;
- while( n-- )
- {
- movq_m2r ( *YVal1++, mm0 ); // mm0 = E1
- movq_m2r ( *YVal2++, mm1 ); // mm1 = O
- movq_m2r ( *YVal3++, mm2 ); // mm2 = E2
-
- movq_r2r ( mm0, mm3 ); // mm3 = intensity(E1)
- movq_r2r ( mm1, mm4 ); // mm4 = intensity(O)
- movq_r2r ( mm2, mm6 ); // mm6 = intensity(E2)
-
- pand_m2r ( YMask, mm3 );
- pand_m2r ( YMask, mm4 );
- pand_m2r ( YMask, mm6 );
-
- // Average E1 and E2 for interpolated bobbing.
- // leave result in mm0
- pand_m2r ( Mask, mm0 ); // mm0 = E1 with lower chroma bit stripped off
- pand_m2r ( Mask, mm2 ); // mm2 = E2 with lower chroma bit stripped off
- psrlw_i2r ( 01, mm0 ); // mm0 = E1 / 2
- psrlw_i2r ( 01, mm2 ); // mm2 = E2 / 2
- paddb_r2r ( mm2, mm0 );
-
- // The meat of the work is done here. We want to see whether this pixel is
- // close in luminosity to ANY of: its top neighbor, its bottom neighbor,
- // or its predecessor. To do this without branching, we use MMX's
- // saturation feature, which gives us Z(x) = x if x>=0, or 0 if x<0.
- //
- // The formula we're computing here is
- // Z(ST - (E1 - O) ^ 2) + Z(ST - (E2 - O) ^ 2) + Z(TT - (Oold - O) ^ 2)
- // where ST is spatial tolerance and TT is temporal tolerance. The idea
- // is that if a pixel is similar to none of its neighbors, the resulting
- // value will be pretty low, probably zero. A high value therefore indicates
- // that the pixel had a similar neighbor. The pixel in the same position
- // in the field before last (Oold) is considered a neighbor since we want
- // to be able to display 1-pixel-high horizontal lines.
-
- movq_m2r ( *&qwSpatialTolerance, mm7 );
- movq_r2r ( mm3, mm5 ); // mm5 = E1
- psubsw_r2r ( mm4, mm5 ); // mm5 = E1 - O
- psraw_i2r ( 1, mm5 );
- pmullw_r2r ( mm5, mm5 ); // mm5 = (E1 - O) ^ 2
- psubusw_r2r ( mm5, mm7 ); // mm7 = ST - (E1 - O) ^ 2, or 0 if that's negative
-
- movq_m2r ( *&qwSpatialTolerance, mm3 );
- movq_r2r ( mm6, mm5 ); // mm5 = E2
- psubsw_r2r ( mm4, mm5 ); // mm5 = E2 - O
- psraw_i2r ( 1, mm5 );
- pmullw_r2r ( mm5, mm5 ); // mm5 = (E2 - O) ^ 2
- psubusw_r2r ( mm5, mm3 ); // mm0 = ST - (E2 - O) ^ 2, or 0 if that's negative
- paddusw_r2r ( mm3, mm7 ); // mm7 = (ST - (E1 - O) ^ 2) + (ST - (E2 - O) ^ 2)
-
- movq_m2r ( *&qwTemporalTolerance, mm3 );
- movq_m2r ( *YVal4++, mm5 ); // mm5 = Oold
- pand_m2r ( YMask, mm5 );
- psubsw_r2r ( mm4, mm5 ); // mm5 = Oold - O
- psraw_i2r ( 1, mm5 ); // XXX
- pmullw_r2r ( mm5, mm5 ); // mm5 = (Oold - O) ^ 2
- psubusw_r2r ( mm5, mm3 ); /* mm0 = TT - (Oold - O) ^ 2, or 0 if that's negative */
- paddusw_r2r ( mm3, mm7 ); // mm7 = our magic number
-
- /*
- * Now compare the similarity totals against our threshold. The pcmpgtw
- * instruction will populate the target register with a bunch of mask bits,
- * filling words where the comparison is true with 1s and ones where it's
- * false with 0s. A few ANDs and NOTs and an OR later, we have bobbed
- * values for pixels under the similarity threshold and weaved ones for
- * pixels over the threshold.
- */
-
- pcmpgtw_m2r( *&qwThreshold, mm7 ); // mm7 = 0xffff where we're greater than the threshold, 0 elsewhere
- movq_r2r ( mm7, mm6 ); // mm6 = 0xffff where we're greater than the threshold, 0 elsewhere
- pand_r2r ( mm1, mm7 ); // mm7 = weaved data where we're greater than the threshold, 0 elsewhere
- pandn_r2r ( mm0, mm6 ); // mm6 = bobbed data where we're not greater than the threshold, 0 elsewhere
- por_r2r ( mm6, mm7 ); // mm7 = bobbed and weaved data
-
- movq_r2m ( mm7, *Dest++ );
- }
- }
-
- // Copy last odd line if we're processing an odd field.
- if (IsOdd)
- {
- xine_fast_memcpy(pdst + (height * 2 - 1) * LineLength,
- pOddLines + (height - 1) * SourcePitch,
- LineLength);
- }
-
- // clear out the MMX registers ready for doing floating point
- // again
- emms();
-
-#endif
-
- return 1;
-}
-
-
-// This is a simple lightweight DeInterlace method that uses little CPU time
-// but gives very good results for low or intermedite motion. (MORE CPU THAN BOB)
-// It defers frames by one field, but that does not seem to produce noticeable
-// lip sync problems.
-//
-// The method used is to take either the older or newer weave pixel depending
-// upon which give the smaller comb factor, and then clip to avoid large damage
-// when wrong.
-//
-// I'd intended this to be part of a larger more elaborate method added to
-// Blended Clip but this give too good results for the CPU to ignore here.
-static int deinterlace_greedy_yuv_mmx( uint8_t *pdst, uint8_t *psrc[],
- int width, int height )
-{
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
- int Line;
- int LoopCtr;
- uint64_t *L1; // ptr to Line1, of 3
- uint64_t *L2; // ptr to Line2, the weave line
- uint64_t *L3; // ptr to Line3
- uint64_t *LP2; // ptr to prev Line2
- uint64_t *Dest;
- uint8_t* pEvenLines = psrc[0];
- uint8_t* pOddLines = psrc[0]+width;
- uint8_t* pPrevLines;
-
- static mmx_t ShiftMask = {ub:{0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe}};
-
- int LineLength = width;
- int SourcePitch = width * 2;
- int IsOdd = 1;
- long GreedyMaxComb = 15;
- static mmx_t MaxComb;
- int i;
-
- if ( psrc[0] == NULL || psrc[1] == NULL )
- return 0;
-
- if (IsOdd)
- pPrevLines = psrc[1] + width;
- else
- pPrevLines = psrc[1];
-
-
- for( i = 0; i < 8; i++ )
- MaxComb.ub[i] = GreedyMaxComb; // How badly do we let it weave? 0-255
-
-
- // copy first even line no matter what, and the first odd line if we're
- // processing an EVEN field. (note diff from other deint rtns.)
- xine_fast_memcpy(pdst, pEvenLines, LineLength); //DL0
- if (!IsOdd)
- xine_fast_memcpy(pdst + LineLength, pOddLines, LineLength); //DL1
-
- height = height / 2;
- for (Line = 0; Line < height - 1; ++Line)
- {
- LoopCtr = LineLength / 8; // there are LineLength / 8 qwords per line
-
- if (IsOdd)
- {
- L1 = (uint64_t *)(pEvenLines + Line * SourcePitch);
- L2 = (uint64_t *)(pOddLines + Line * SourcePitch);
- L3 = (uint64_t *)(pEvenLines + (Line + 1) * SourcePitch);
- LP2 = (uint64_t *)(pPrevLines + Line * SourcePitch); // prev Odd lines
- Dest = (uint64_t *)(pdst + (Line * 2 + 1) * LineLength);
- }
- else
- {
- L1 = (uint64_t *)(pOddLines + Line * SourcePitch);
- L2 = (uint64_t *)(pEvenLines + (Line + 1) * SourcePitch);
- L3 = (uint64_t *)(pOddLines + (Line + 1) * SourcePitch);
- LP2 = (uint64_t *)(pPrevLines + (Line + 1) * SourcePitch); //prev even lines
- Dest = (uint64_t *)(pdst + (Line * 2 + 2) * LineLength);
- }
-
- xine_fast_memcpy((char *)Dest + LineLength, L3, LineLength);
-
-// For ease of reading, the comments below assume that we're operating on an odd
-// field (i.e., that info->IsOdd is true). Assume the obvious for even lines..
-
- while( LoopCtr-- )
- {
- movq_m2r ( *L1++, mm1 );
- movq_m2r ( *L2++, mm2 );
- movq_m2r ( *L3++, mm3 );
- movq_m2r ( *LP2++, mm0 );
-
- // average L1 and L3 leave result in mm4
- movq_r2r ( mm1, mm4 ); // L1
-
- pand_m2r ( ShiftMask, mm4 );
- psrlw_i2r ( 01, mm4 );
- movq_r2r ( mm3, mm5 ); // L3
- pand_m2r ( ShiftMask, mm5 );
- psrlw_i2r ( 01, mm5 );
- paddb_r2r ( mm5, mm4 ); // the average, for computing comb
-
- // get abs value of possible L2 comb
- movq_r2r ( mm2, mm7 ); // L2
- psubusb_r2r ( mm4, mm7 ); // L2 - avg
- movq_r2r ( mm4, mm5 ); // avg
- psubusb_r2r ( mm2, mm5 ); // avg - L2
- por_r2r ( mm7, mm5 ); // abs(avg-L2)
- movq_r2r ( mm4, mm6 ); // copy of avg for later
-
- // get abs value of possible LP2 comb
- movq_r2r ( mm0, mm7 ); // LP2
- psubusb_r2r ( mm4, mm7 ); // LP2 - avg
- psubusb_r2r ( mm0, mm4 ); // avg - LP2
- por_r2r ( mm7, mm4 ); // abs(avg-LP2)
-
- // use L2 or LP2 depending upon which makes smaller comb
- psubusb_r2r ( mm5, mm4 ); // see if it goes to zero
- psubusb_r2r ( mm5, mm5 ); // 0
- pcmpeqb_r2r ( mm5, mm4 ); // if (mm4=0) then FF else 0
- pcmpeqb_r2r ( mm4, mm5 ); // opposite of mm4
-
- // if Comb(LP2) <= Comb(L2) then mm4=ff, mm5=0 else mm4=0, mm5 = 55
- pand_r2r ( mm2, mm5 ); // use L2 if mm5 == ff, else 0
- pand_r2r ( mm0, mm4 ); // use LP2 if mm4 = ff, else 0
- por_r2r ( mm5, mm4 ); // may the best win
-
- // Now lets clip our chosen value to be not outside of the range
- // of the high/low range L1-L3 by more than abs(L1-L3)
- // This allows some comb but limits the damages and also allows more
- // detail than a boring oversmoothed clip.
-
- movq_r2r ( mm1, mm2 ); // copy L1
- psubusb_r2r ( mm3, mm2 ); // - L3, with saturation
- paddusb_r2r ( mm3, mm2 ); // now = Max(L1,L3)
-
- pcmpeqb_r2r ( mm7, mm7 ); // all ffffffff
- psubusb_r2r ( mm1, mm7 ); // - L1
- paddusb_r2r ( mm7, mm3 ); // add, may sat at fff..
- psubusb_r2r ( mm7, mm3 ); // now = Min(L1,L3)
-
- // allow the value to be above the high or below the low by amt of MaxComb
- paddusb_m2r ( MaxComb, mm2 ); // increase max by diff
- psubusb_m2r ( MaxComb, mm3 ); // lower min by diff
-
- psubusb_r2r ( mm3, mm4 ); // best - Min
- paddusb_r2r ( mm3, mm4 ); // now = Max(best,Min(L1,L3)
-
- pcmpeqb_r2r ( mm7, mm7 ); // all ffffffff
- psubusb_r2r ( mm4, mm7 ); // - Max(best,Min(best,L3)
- paddusb_r2r ( mm7, mm2 ); // add may sat at FFF..
- psubusb_r2r ( mm7, mm2 ); // now = Min( Max(best, Min(L1,L3), L2 )=L2 clipped
-
- movq_r2m ( mm2, *Dest++ ); // move in our clipped best
-
- }
- }
-
- /* Copy last odd line if we're processing an Odd field. */
- if (IsOdd)
- {
- xine_fast_memcpy(pdst + (height * 2 - 1) * LineLength,
- pOddLines + (height - 1) * SourcePitch,
- LineLength);
- }
-
- /* clear out the MMX registers ready for doing floating point again */
- emms();
-
-#endif
-
- return 1;
-}
-
-/* Use one field to interpolate the other (low cpu utilization)
- Will lose resolution but does not produce weaving effect
- (good for fast moving scenes) also know as "linear interpolation"
-*/
-static void deinterlace_onefield_yuv_mmx( uint8_t *pdst, uint8_t *psrc[],
- int width, int height )
-{
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
- int Line;
- uint64_t *YVal1;
- uint64_t *YVal3;
- uint64_t *Dest;
- uint8_t* pEvenLines = psrc[0];
- uint8_t* pOddLines = psrc[0]+width;
- int LineLength = width;
- int SourcePitch = width * 2;
- int IsOdd = 1;
-
- int n;
-
- static mmx_t Mask = {ub:{0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe}};
-
- /*
- * copy first even line no matter what, and the first odd line if we're
- * processing an odd field.
- */
-
- xine_fast_memcpy(pdst, pEvenLines, LineLength);
- if (IsOdd)
- xine_fast_memcpy(pdst + LineLength, pOddLines, LineLength);
-
- height = height / 2;
- for (Line = 0; Line < height - 1; ++Line)
- {
- if (IsOdd)
- {
- YVal1 = (uint64_t *)(pOddLines + Line * SourcePitch);
- YVal3 = (uint64_t *)(pOddLines + (Line + 1) * SourcePitch);
- Dest = (uint64_t *)(pdst + (Line * 2 + 2) * LineLength);
- }
- else
- {
- YVal1 = (uint64_t *)(pEvenLines + Line * SourcePitch);
- YVal3 = (uint64_t *)(pEvenLines + (Line + 1) * SourcePitch);
- Dest = (uint64_t *)(pdst + (Line * 2 + 1) * LineLength);
- }
-
- // Copy the odd line to the overlay verbatim.
- xine_fast_memcpy((char *)Dest + LineLength, YVal3, LineLength);
-
- n = LineLength >> 3;
- while( n-- )
- {
- movq_m2r (*YVal1++, mm0);
- movq_m2r (*YVal3++, mm2);
-
- // get average in mm0
- pand_m2r ( Mask, mm0 );
- pand_m2r ( Mask, mm2 );
- psrlw_i2r ( 01, mm0 );
- psrlw_i2r ( 01, mm2 );
- paddw_r2r ( mm2, mm0 );
-
- movq_r2m ( mm0, *Dest++ );
- }
- }
-
- /* Copy last odd line if we're processing an even field. */
- if (! IsOdd)
- {
- xine_fast_memcpy(pdst + (height * 2 - 1) * LineLength,
- pOddLines + (height - 1) * SourcePitch,
- LineLength);
- }
-
- /* clear out the MMX registers ready for doing floating point
- * again
- */
- emms();
-#endif
-}
-
-/* Linear Blend filter - does a kind of vertical blurring on the image.
- (idea borrowed from mplayer's sources)
-*/
-static void deinterlace_linearblend_yuv_mmx( uint8_t *pdst, uint8_t *psrc[],
- int width, int height )
-{
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
- int Line;
- uint64_t *YVal1;
- uint64_t *YVal2;
- uint64_t *YVal3;
- uint64_t *Dest;
- int LineLength = width;
-
- int n;
-
- /* Copy first line */
- xine_fast_memcpy(pdst, psrc[0], LineLength);
-
- for (Line = 1; Line < height - 1; ++Line)
- {
- YVal1 = (uint64_t *)(psrc[0] + (Line - 1) * LineLength);
- YVal2 = (uint64_t *)(psrc[0] + (Line) * LineLength);
- YVal3 = (uint64_t *)(psrc[0] + (Line + 1) * LineLength);
- Dest = (uint64_t *)(pdst + Line * LineLength);
-
- n = LineLength >> 3;
- while( n-- )
- {
- /* load data from 3 lines */
- movq_m2r (*YVal1++, mm0);
- movq_m2r (*YVal2++, mm1);
- movq_m2r (*YVal3++, mm2);
-
- /* expand bytes to words */
- punpckhbw_r2r (mm0, mm3);
- punpckhbw_r2r (mm1, mm4);
- punpckhbw_r2r (mm2, mm5);
- punpcklbw_r2r (mm0, mm0);
- punpcklbw_r2r (mm1, mm1);
- punpcklbw_r2r (mm2, mm2);
-
- /*
- * deinterlacing:
- * deint_line = (line0 + 2*line1 + line2) / 4
- */
- psrlw_i2r (07, mm0);
- psrlw_i2r (06, mm1);
- psrlw_i2r (07, mm2);
- psrlw_i2r (07, mm3);
- psrlw_i2r (06, mm4);
- psrlw_i2r (07, mm5);
- paddw_r2r (mm1, mm0);
- paddw_r2r (mm2, mm0);
- paddw_r2r (mm4, mm3);
- paddw_r2r (mm5, mm3);
- psrlw_i2r (03, mm0);
- psrlw_i2r (03, mm3);
-
- /* pack 8 words to 8 bytes in mm0 */
- packuswb_r2r (mm3, mm0);
-
- movq_r2m ( mm0, *Dest++ );
- }
- }
-
- /* Copy last line */
- xine_fast_memcpy(pdst + Line * LineLength,
- psrc[0] + Line * LineLength, LineLength);
-
- /* clear out the MMX registers ready for doing floating point
- * again
- */
- emms();
-#endif
-}
-
-/* Linear Blend filter - C version contributed by Rogerio Brito.
- This algorithm has the same interface as the other functions.
-
- The destination "screen" (pdst) is constructed from the source
- screen (psrc[0]) line by line.
-
- The i-th line of the destination screen is the average of 3 lines
- from the source screen: the (i-1)-th, i-th and (i+1)-th lines, with
- the i-th line having weight 2 in the computation.
-
- Remarks:
- * each line on pdst doesn't depend on previous lines;
- * due to the way the algorithm is defined, the first & last lines of the
- screen aren't deinterlaced.
-
-*/
-static void deinterlace_linearblend_yuv( uint8_t *pdst, uint8_t *psrc[],
- int width, int height )
-{
- register int x, y;
- register uint8_t *l0, *l1, *l2, *l3;
-
- l0 = pdst; /* target line */
- l1 = psrc[0]; /* 1st source line */
- l2 = l1 + width; /* 2nd source line = line that follows l1 */
- l3 = l2 + width; /* 3rd source line = line that follows l2 */
-
- /* Copy the first line */
- xine_fast_memcpy(l0, l1, width);
- l0 += width;
-
- for (y = 1; y < height-1; ++y) {
- /* computes avg of: l1 + 2*l2 + l3 */
-
- for (x = 0; x < width; ++x) {
- l0[x] = (l1[x] + (l2[x]<<1) + l3[x]) >> 2;
- }
-
- /* updates the line pointers */
- l1 = l2; l2 = l3; l3 += width;
- l0 += width;
- }
-
- /* Copy the last line */
- xine_fast_memcpy(l0, l1, width);
-}
-
-static int check_for_mmx(void)
-{
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
-static int config_flags = -1;
-
- if ( config_flags == -1 )
- config_flags = xine_mm_accel();
- if (config_flags & MM_ACCEL_X86_MMX)
- return 1;
- return 0;
-#else
- return 0;
-#endif
-}
-
-/* generic YUV deinterlacer
- pdst -> pointer to destination bitmap
- psrc -> array of pointers to source bitmaps ([0] = most recent)
- width,height -> dimension for bitmaps
- method -> DEINTERLACE_xxx
-*/
-
-void deinterlace_yuv( uint8_t *pdst, uint8_t *psrc[],
- int width, int height, int method )
-{
- switch( method ) {
- case DEINTERLACE_NONE:
- xine_fast_memcpy(pdst,psrc[0],width*height);
- break;
- case DEINTERLACE_BOB:
- if( check_for_mmx() )
- deinterlace_bob_yuv_mmx(pdst,psrc,width,height);
- else /* FIXME: provide an alternative? */
- xine_fast_memcpy(pdst,psrc[0],width*height);
- break;
- case DEINTERLACE_WEAVE:
- if( check_for_mmx() )
- {
- if( !deinterlace_weave_yuv_mmx(pdst,psrc,width,height) )
- xine_fast_memcpy(pdst,psrc[0],width*height);
- }
- else /* FIXME: provide an alternative? */
- xine_fast_memcpy(pdst,psrc[0],width*height);
- break;
- case DEINTERLACE_GREEDY:
- if( check_for_mmx() )
- {
- if( !deinterlace_greedy_yuv_mmx(pdst,psrc,width,height) )
- xine_fast_memcpy(pdst,psrc[0],width*height);
- }
- else /* FIXME: provide an alternative? */
- xine_fast_memcpy(pdst,psrc[0],width*height);
- break;
- case DEINTERLACE_ONEFIELD:
- if( check_for_mmx() )
- deinterlace_onefield_yuv_mmx(pdst,psrc,width,height);
- else /* FIXME: provide an alternative? */
- xine_fast_memcpy(pdst,psrc[0],width*height);
- break;
- case DEINTERLACE_ONEFIELDXV:
- lprintf("ONEFIELDXV must be handled by the video driver.\n");
- break;
- case DEINTERLACE_LINEARBLEND:
- if( check_for_mmx() )
- deinterlace_linearblend_yuv_mmx(pdst,psrc,width,height);
- else
- deinterlace_linearblend_yuv(pdst,psrc,width,height);
- break;
- default:
- lprintf("unknow method %d.\n",method);
- break;
- }
-}
-
-int deinterlace_yuv_supported ( int method )
-{
- switch( method ) {
- case DEINTERLACE_NONE:
- return 1;
- case DEINTERLACE_BOB:
- case DEINTERLACE_WEAVE:
- case DEINTERLACE_GREEDY:
- case DEINTERLACE_ONEFIELD:
- return check_for_mmx();
- case DEINTERLACE_ONEFIELDXV:
- lprintf ("ONEFIELDXV must be handled by the video driver.\n");
- return 0;
- case DEINTERLACE_LINEARBLEND:
- return 1;
- }
-
- return 0;
-}
-
diff --git a/src/video_out/deinterlace.h b/src/video_out/deinterlace.h
deleted file mode 100644
index a9904b42a..000000000
--- a/src/video_out/deinterlace.h
+++ /dev/null
@@ -1,55 +0,0 @@
- /*
- * Copyright (C) 2001 the xine project
- *
- * This file is part of xine, a free video player.
- *
- * xine is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * xine is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- *
- * Deinterlace routines by Miguel Freitas
- * based of DScaler project sources (deinterlace.sourceforge.net)
- *
- * Currently only available for Xv driver and MMX extensions
- *
- */
-
-#ifndef __DEINTERLACE_H__
-#define __DEINTERLACE_H__
-
-#include "video_out.h"
-
-int deinterlace_yuv_supported ( int method );
-void deinterlace_yuv( uint8_t *pdst, uint8_t *psrc[],
- int width, int height, int method );
-
-#define DEINTERLACE_NONE 0
-#define DEINTERLACE_BOB 1
-#define DEINTERLACE_WEAVE 2
-#define DEINTERLACE_GREEDY 3
-#define DEINTERLACE_ONEFIELD 4
-#define DEINTERLACE_ONEFIELDXV 5
-#define DEINTERLACE_LINEARBLEND 6
-
-static const char *deinterlace_methods[] = {
- "none",
- "bob",
- "weave",
- "greedy",
- "onefield",
- "onefield_xv",
- "linearblend",
- NULL
-};
-
-#endif
diff --git a/src/video_out/libdha/.hgignore b/src/video_out/libdha/.hgignore
deleted file mode 100644
index 7b5ba91fb..000000000
--- a/src/video_out/libdha/.hgignore
+++ /dev/null
@@ -1,9 +0,0 @@
-.libs
-.deps
-*.lo
-*.la
-pci_dev_ids.c
-pci_ids.h
-pci_names.c
-pci_names.h
-pci_vendors.h
diff --git a/src/video_out/libdha/AsmMacros.h b/src/video_out/libdha/AsmMacros.h
deleted file mode 100644
index d1b136a7b..000000000
--- a/src/video_out/libdha/AsmMacros.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/* $XConsortium: AsmMacros.h /main/13 1996/10/25 11:33:12 kaleb $ */
-/*
- * (c) Copyright 1993,1994 by David Wexelblat <dwex@xfree86.org>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * DAVID WEXELBLAT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of David Wexelblat shall not be
- * used in advertising or otherwise to promote the sale, use or other dealings
- * in this Software without prior written authorization from David Wexelblat.
- *
- */
-/*
- * Copyright 1997
- * Digital Equipment Corporation. All rights reserved.
- * This software is furnished under license and may be used and copied only in
- * accordance with the following terms and conditions. Subject to these
- * conditions, you may download, copy, install, use, modify and distribute
- * this software in source and/or binary form. No title or ownership is
- * transferred hereby.
- *
- * 1) Any source code used, modified or distributed must reproduce and retain
- * this copyright notice and list of conditions as they appear in the source
- * file.
- *
- * 2) No right is granted to use any trade name, trademark, or logo of Digital
- * Equipment Corporation. Neither the "Digital Equipment Corporation" name
- * nor any trademark or logo of Digital Equipment Corporation may be used
- * to endorse or promote products derived from this software without the
- * prior written permission of Digital Equipment Corporation.
- *
- * 3) This software is provided "AS-IS" and any express or implied warranties,
- * including but not limited to, any implied warranties of merchantability,
- * fitness for a particular purpose, or non-infringement are disclaimed. In
- * no event shall DIGITAL be liable for any damages whatsoever, and in
- * particular, DIGITAL shall not be liable for special, indirect,
- * consequential, or incidental damages or damages for
- * lost profits, loss of revenue or loss of use, whether such damages arise
- * in contract,
- * negligence, tort, under statute, in equity, at law or otherwise, even if
- * advised of the possibility of such damage.
- *
- */
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/util/AsmMacros.h,v 1.1 2001/11/16 21:13:34 tsi Exp $ */
-
-/*
- * Modified for readability by Nick Kurshev
-*/
-
-#if defined(__GNUC__) || defined(__ICC)
-#if defined(__alpha__)
-#include "sysdep/AsmMacros_alpha.h"
-#elif defined(__ia64__)
-#include "sysdep/AsmMacros_ia64.h"
-#elif defined(__sparc__)
-#include "sysdep/AsmMacros_sparc.h"
-#elif defined( __arm32__ )
-#include "sysdep/AsmMacros_arm32.h"
-#elif defined(__powerpc__)
-#include "sysdep/AsmMacros_powerpc.h"
-#elif defined (__i386__)
-#include "sysdep/AsmMacros_x86.h"
-#else
-#include "sysdep/AsmMacros_generic.h"
-#endif
-
-#else /* __GNUC__ */
-
-#if defined(_MINIX) && defined(_ACK)
-
-/* inb, outb, inw and outw are defined in the library */
-/* ... but I've no idea if the same is true for inl & outl */
-
-extern u8_t inb(U16_t);
-extern void outb(U16_t, U8_t);
-extern u16_t inw(U16_t);
-extern void outw(U16_t, U16_t);
-extern u32_t inl(U16_t);
-extern void outl(U16_t, U32_t);
-
-#else /* not _MINIX and _ACK */
-
-# if defined(__STDC__) && (__STDC__ == 1)
-# ifndef NCR
-# define asm __asm
-# endif
-# endif
-# ifdef SVR4
-# include <sys/types.h>
-# ifndef __USLC__
-# define __USLC__
-# endif
-# endif
-#ifndef SCO325
-# include <sys/inline.h>
-#else
-# include "../common/scoasm.h"
-#endif
-#define intr_disable() asm("cli")
-#define intr_enable() asm("sti")
-
-#endif /* _MINIX and _ACK */
-#endif /* __GNUC__ */
diff --git a/src/video_out/libdha/Makefile.am b/src/video_out/libdha/Makefile.am
deleted file mode 100644
index 8d94347d1..000000000
--- a/src/video_out/libdha/Makefile.am
+++ /dev/null
@@ -1,42 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-EXTRA_DIST = README pci_db2c.awk
-
-SUBDIRS = bin kernelhelper oth sysdep
-
-AM_CFLAGS = @STATIC@
-
-if HAVE_VIDIX
-dha_lib = libdha.la
-endif
-
-awk_generated = pci_dev_ids.c pci_ids.h pci_names.c pci_names.h pci_vendors.h
-CLEANFILES = $(awk_generated)
-
-noinst_LTLIBRARIES = $(dha_lib)
-
-libdha_la_SOURCES = libdha.c mtrr.c pci.c mmi.c ports.c irq.c cpu_flush.c
-nodist_libdha_la_SOURCES = pci_names.c
-
-EXTRA_PROGRAMS = test
-
-test_SOURCES = test.c
-test_LDADD = $(top_builddir)/src/video_out/libdha/libdha.la
-
-noinst_HEADERS = AsmMacros.h libdha.h pci_ids.h pci_names.h pci_vendors.h
-
-## for OpenBSD LIBS += -li386
-
-## We have to create some files, on the fly, this is why this rule is needed.
-pci_db2c.awk:
-oth/pci.db:
-
-$(awk_generated): pci_db2c.awk oth/pci.db
- LC_ALL=C $(AWK) -f $(top_srcdir)/src/video_out/libdha/pci_db2c.awk \
- $(top_srcdir)/src/video_out/libdha/oth/pci.db
-
-pci_names.lo: $(awk_generated)
- source='$*.c' object='$@' libtool=yes \
- depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' \
- $(CCDEPMODE) $(depcomp) \
- $(LTCOMPILE) -c -o $@ `test -f $*.c || echo '$(srcdir)/'`$*.c
diff --git a/src/video_out/libdha/README b/src/video_out/libdha/README
deleted file mode 100644
index a855880cd..000000000
--- a/src/video_out/libdha/README
+++ /dev/null
@@ -1,12 +0,0 @@
-libdha - Library of Direct Hardware Access.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-This library was designed for direct hardware access under different
-OS and architectures. It's not linux specific only (like harddrake
-and other).
-
-This library is based on gfxdump utility from GATOS project.
-Full list of supported OS'es see in libdha.h
-
-Note: This library requires ROOT privileges or SUID'ed executable
-file (same as XServer).
-(Or use newly developed libdha kernel helper. Look at kernelhelper/dhahelper.c)
diff --git a/src/video_out/libdha/bin/Makefile.am b/src/video_out/libdha/bin/Makefile.am
deleted file mode 100644
index 24c6d3abf..000000000
--- a/src/video_out/libdha/bin/Makefile.am
+++ /dev/null
@@ -1,3 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-EXTRA_DIST = README mapdev.copyright mapdev.vxd
diff --git a/src/video_out/libdha/bin/README b/src/video_out/libdha/bin/README
deleted file mode 100644
index fe4bfa6f3..000000000
--- a/src/video_out/libdha/bin/README
+++ /dev/null
@@ -1,6 +0,0 @@
-mapdev.vxd
-~~~~~~~~~~
-mapdev.vxd - provides direct hardware access under Win9x.
-install: Just copy it into %WINDOWS%\system folder and reboot.
-note: This driver won't work under NT-based systems
-(like WinNT, Win2000 and even WinME and WinXP due importing NT things).
diff --git a/src/video_out/libdha/bin/mapdev.copyright b/src/video_out/libdha/bin/mapdev.copyright
deleted file mode 100644
index b22433d29..000000000
--- a/src/video_out/libdha/bin/mapdev.copyright
+++ /dev/null
@@ -1,70 +0,0 @@
-From khazzah@melita.com Mon Jun 23 21:48:19 1997
-Return-Path: <khazzah@melita.com>
-Received: from melita.melita.com by max4.rrze.uni-erlangen.de; Mon, 23 Jun 1997 21:48:16 +0200
-Received: from mailgate.melita.com ([192.68.22.8]) by melita.melita.com (8.6.12/8.6.9) with SMTP id QAA29292 for <Stefan.Dirsch@stud.uni-erlangen.de>; Mon, 23 Jun 1997 16:17:55 -0400
-Received: by mailgate.melita.com with Microsoft Mail
- id <33AEFD34@mailgate.melita.com>; Mon, 23 Jun 97 15:48:20 PDT
-From: Karen Hazzah <khazzah@melita.com>
-To: "'Stefan.Dirsch@stud.uni-erlangen.de'" <Stefan.Dirsch@stud.uni-erlangen.de>
-Subject: Your post to vxd newsgroup
-Date: Sun, 22 Jun 97 20:51:00 PDT
-Message-ID: <33AEFD34@mailgate.melita.com>
-Encoding: 22 TEXT
-X-Mailer: Microsoft Mail V3.0
-
-
-I posted an answer to your question in the newsgroup. I also have
-additional information for you.
-
-I can email you the binary for VxD which does exactly what you need:
-given a physical address, returns a pointer that can be used by a
-Win32 application. I'll also give you source for a Win32 app which
-uses the VxD to read an area of physical memory.
-
-I don't offer this solution to everyone, since in most cases the
-proper solution is for them to write a VxD which interacts with their
-hardware, rather than simply getting a pointer to the hardware and
-interacting with it from an application.
-
-However, in your case, you're just using a VxD as a tool to get your
-Linux driver working...you shouldn't have to write a VxD for this :-)
-
-Let me know if you're interested.
-===============================================================================
-Hello Karen
-
-A long time ago, you sent me your VXD for reading an area of physical
-memory under Win32, so I could make register dumps of the graphic
-chip. Did I ever mention, that it works perfectly for me?
-
-Why I contact you is, that I really would like to offer this solution
-to all XFree86 members, so that it will be much easier in the future
-for XFree86 to develop drivers for graphic boards.
-
-Can I count with your agreement? Would you like to add a special
-copyright to your software?
-
-Stefan
-===============================================================================
-From KHazzah@melita.com Wed Mar 4 00:00:28 1998
-Return-Path: <KHazzah@melita.com>
-Received: from melita.melita.com (melita.com [192.68.22.2])
- by Galois.suse.de (8.8.8/8.8.8) with SMTP id AAA03709
- for <sndirsch@suse.de>; Wed, 4 Mar 1998 00:00:26 +0100
-Received: from norcross.melita.com (norcross.melita.com [192.68.22.10]) by melita.melita.com (8.6.12/8.6.9) with ESMTP id TAA31217 for <sndirsch@suse.de>; Tue, 3 Mar 1998 19:48:10 -0500
-Received: by zippy.melita.com with Internet Mail Service (5.5.1960.3)
- id <F5X7MBSS>; Tue, 3 Mar 1998 18:00:26 -0500
-Message-ID: <D8EE8292EB83D111A15E00805FA67447166532@zippy.melita.com>
-From: "Hazzah, Karen" <KHazzah@melita.com>
-To: Stefan Dirsch <sndirsch@suse.de>
-Subject: RE: VXD binary for Win32 for reading an area of physical memory
-Date: Tue, 3 Mar 1998 18:00:25 -0500
-MIME-Version: 1.0
-X-Mailer: Internet Mail Service (5.5.1960.3)
-Content-Type: text/plain
-Status: ROr
-
-OK, you have my permission to make it publicly available, as is.
-
-If you make it available on the web (ftp, etc.), please give me the
-URL so I can refer others to it.
diff --git a/src/video_out/libdha/bin/mapdev.vxd b/src/video_out/libdha/bin/mapdev.vxd
deleted file mode 100644
index e09194b84..000000000
--- a/src/video_out/libdha/bin/mapdev.vxd
+++ /dev/null
Binary files differ
diff --git a/src/video_out/libdha/cpu_flush.c b/src/video_out/libdha/cpu_flush.c
deleted file mode 100644
index 9186f89e8..000000000
--- a/src/video_out/libdha/cpu_flush.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* CPU flush support */
-#include <stdio.h>
-#include <sys/ioctl.h>
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include "libdha.h"
-#include "kernelhelper/dhahelper.h"
-
-void cpu_flush(void *va,unsigned long length)
-{
- int retval;
- int libdha_fd=-1;
- if( libdha_fd == -1) libdha_fd = open("/dev/dhahelper",O_RDWR);
- if (libdha_fd > 0)
- {
- dhahelper_cpu_flush_t _l2;
- _l2.va = va;
- _l2.length = length;
- retval = ioctl(libdha_fd, DHAHELPER_CPU_FLUSH, &_l2);
- close(libdha_fd);
- }
-}
diff --git a/src/video_out/libdha/irq.c b/src/video_out/libdha/irq.c
deleted file mode 100644
index abccaf74c..000000000
--- a/src/video_out/libdha/irq.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/* HW IRQ support */
-#include <stdio.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <sys/mman.h> /* mlock */
-#include <pthread.h>
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include "libdha.h"
-#include "kernelhelper/dhahelper.h"
-
-
-static int libdha_fd=-1;
-static int hwirq_locks=0;
-
-int hwirq_install(int bus, int dev, int func,
- int ar, u_long ao, uint32_t ad)
-{
- int retval;
- if( libdha_fd == -1) libdha_fd = open("/dev/dhahelper",O_RDWR);
- hwirq_locks++;
- if (libdha_fd > 0)
- {
- dhahelper_irq_t _irq;
- _irq.bus = bus;
- _irq.dev = dev;
- _irq.func = func;
- _irq.ack_region = ar;
- _irq.ack_offset = ao;
- _irq.ack_data = ad;
- retval = ioctl(libdha_fd, DHAHELPER_INSTALL_IRQ, &_irq);
- return retval;
- }
- return errno;
-}
-
-int hwirq_wait(unsigned irqnum)
-{
- int retval;
- if (libdha_fd > 0)
- {
- dhahelper_irq_t _irq;
- _irq.num = irqnum;
- retval = ioctl(libdha_fd, DHAHELPER_ACK_IRQ, &_irq);
- return retval;
- }
- return EINVAL;
-}
-
-int hwirq_uninstall(int bus, int dev, int func)
-{
- if (libdha_fd > 0)
- {
- dhahelper_irq_t _irq;
- _irq.bus = bus;
- _irq.dev = dev;
- _irq.func = func;
- ioctl(libdha_fd, DHAHELPER_FREE_IRQ, &_irq);
- }
- if(!hwirq_locks) { close(libdha_fd); libdha_fd=-1; }
- return 0;
-}
diff --git a/src/video_out/libdha/kernelhelper/Makefile.am b/src/video_out/libdha/kernelhelper/Makefile.am
deleted file mode 100644
index 82a37eae3..000000000
--- a/src/video_out/libdha/kernelhelper/Makefile.am
+++ /dev/null
@@ -1,53 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-EXTRA_DIST = README dhahelper.c
-
-KCFLAGS = -O2 -Wall -D__KERNEL__ -DMODULE -include `echo @LINUX_INCLUDE@ | sed -e 's/\-I//g'`/linux/modversions.h
-
-KVERSION = $(shell $(SHELL) -c 'uname -r')
-moddir = /lib/modules/$(KVERSION)/misc
-
-KCOMPILE = $(CC) $(CFLAGS) $(KCFLAGS) $(INCLUDES) $(LINUX_INCLUDE)
-
-if HAVE_LINUX
-if BUILD_DHA_KMOD
-KERNEL_MODULE = dhahelper.o
-endif
-endif
-
-noinst_HEADERS = dhahelper.h
-
-EXTRA_PROGRAMS = test
-test_SOURCES = test.c
-
-dhahelper.o:
- $(KCOMPILE) -c `test -f $*.c || echo '$(srcdir)/'`$*.c
-
-nodes:
- $(MKNOD) -m 666 /dev/dhahelper c 252 0
-
-all: $(KERNEL_MODULE)
-
-install-exec-local: $(KERNEL_MODULE)
-@BUILD_DHA_KMOD_TRUE@ @$(NORMAL_INSTALL)
-@BUILD_DHA_KMOD_TRUE@ $(mkinstalldirs) $(DESTDIR)$(moddir)
-@BUILD_DHA_KMOD_TRUE@ @list='$(KERNEL_MODULE)'; \
-@BUILD_DHA_KMOD_TRUE@ for p in $$list; do \
-@BUILD_DHA_KMOD_TRUE@ if test -f $$p; then \
-@BUILD_DHA_KMOD_TRUE@ echo "$(INSTALL) -o root -g root -m 644 $$p $(DESTDIR)$(moddir)/$$p"; \
-@BUILD_DHA_KMOD_TRUE@ $(INSTALL) -o root -g root -m 644 $$p $(DESTDIR)$(moddir)/$$p; \
-@BUILD_DHA_KMOD_TRUE@ else :; fi; \
-@BUILD_DHA_KMOD_TRUE@ done; \
-@BUILD_DHA_KMOD_TRUE@ $(DEPMOD) -a
-@BUILD_DHA_KMOD_TRUE@ if test ! -c /dev/dhahelper; then \
-@BUILD_DHA_KMOD_TRUE@ $(MAKE) nodes; \
-@BUILD_DHA_KMOD_TRUE@ fi
-
-
-uninstall-local:
-@BUILD_DHA_KMOD_TRUE@ @$(NORMAL_UNINSTALL)
-@BUILD_DHA_KMOD_TRUE@ @list='$(KERNEL_MODULE)'; \
-@BUILD_DHA_KMOD_TRUE@ for p in $$list; do \
-@BUILD_DHA_KMOD_TRUE@ echo "rm -f $(DESTDIR)$(moddir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
-@BUILD_DHA_KMOD_TRUE@ rm -f $(DESTDIR)$(moddir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
-@BUILD_DHA_KMOD_TRUE@ done
diff --git a/src/video_out/libdha/kernelhelper/README b/src/video_out/libdha/kernelhelper/README
deleted file mode 100644
index 98a7923b3..000000000
--- a/src/video_out/libdha/kernelhelper/README
+++ /dev/null
@@ -1,38 +0,0 @@
-dhahelper is small driver to provide some kernel function into userspace.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-The main reason you need to use dhahelper is for busmastering.
-(Btw, lacking of possibility to implement conversion of
-virtual addresses into physical in userspace caused
-implementing of so-called DRM drivers for Linux from
-XFree86 side).
-Second goal (still is unfinished) - provide possibility
-to control port and physical memory access through
-groups and access rights of this driver. (Unix way).
-
-Installation:
-~~~~~~~~~~~~~
-just type in this directory:
-make all install
-
-The device node /dev/dhahelper will be created. The initial
-permissions of this node are restrictive. See below for information
-on how to make it available to non-root users.
-
-Porting:
-~~~~~~~~
-This driver was developed only for Linux.
-So if someone will port that on other unices
-then any patches are gladly accepted.
-
-WARNING:
-~~~~~~~~
-
-This driver violates some kernel security rules. To keep this driver
-from anonymous access I suggest you create a new group (e.g. dha) for
-/dev/dhahelper and set the permissions to 660 (or ug+rw,o-rw). Then
-do one of the following:
-
-- add trusted users to group dha.
-- make trusted applications SGID to dha.
-
-Good luck!
diff --git a/src/video_out/libdha/kernelhelper/dhahelper.c b/src/video_out/libdha/kernelhelper/dhahelper.c
deleted file mode 100644
index 0e755064a..000000000
--- a/src/video_out/libdha/kernelhelper/dhahelper.c
+++ /dev/null
@@ -1,1239 +0,0 @@
-/*
- Direct Hardware Access kernel helper
-
- (C) 2002 Alex Beregszaszi <alex@naxine.org>
- (C) 2002-2003 Nick Kurshev <nickols_k@mail.ru>
- (C) 2002-2004 Måns Rullgård <mru@users.sourceforge.net>
-
- Accessing hardware from userspace as USER (no root needed!)
-
- Tested on 2.2.x (2.2.19), 2.4.x (2.4.3,2.4.17) and 2.6.1.
-
- License: GPL
-
- WARNING! THIS MODULE VIOLATES SEVERAL SECURITY LINES! DON'T USE IT
- ON PRODUCTION SYSTEMS, ONLY AT HOME, ON A "SINGLE-USER" SYSTEM.
- NO WARRANTY!
-
- IF YOU WANT TO USE IT ON PRODUCTION SYSTEMS THEN PLEASE READ 'README'
- FILE TO KNOW HOW TO PREVENT ANONYMOUS ACCESS TO THIS MODULE.
-
- Tech:
- Communication between userspace and kernelspace goes over character
- device using ioctl.
-
- Usage:
- mknod -m 600 /dev/dhahelper c 252 0
-
- Also you can change the major number, setting the "dhahelper_major"
- module parameter, the default is 252, specified in dhahelper.h.
-
- Note: do not use other than minor==0, the module forbids it.
-
- TODO:
- * select (request?) a "valid" major number (from Linux project? ;)
- * make security
- * is pci handling needed? (libdha does this with lowlevel port funcs)
- * is mttr handling needed?
- * test on older kernels (2.0.x (?))
-*/
-
-#ifndef MODULE
-#define MODULE
-#endif
-
-#ifndef __KERNEL__
-#define __KERNEL__
-#endif
-
-#include <linux/config.h>
-
-#ifdef CONFIG_MODVERSION
-#define MODVERSION
-#include <linux/modversions.h>
-#endif
-
-#include <linux/version.h>
-#include <linux/module.h>
-#include <linux/types.h>
-#include <linux/kernel.h>
-#include <linux/sched.h>
-#include <linux/mm.h>
-#include <linux/pagemap.h>
-#include <linux/init.h>
-#include <linux/pci.h>
-#include <linux/interrupt.h>
-#include <linux/vmalloc.h>
-#include <linux/string.h>
-#include <linux/errno.h>
-#include <asm/io.h>
-#include <asm/pgtable.h>
-#include <asm/unistd.h>
-#include <asm/uaccess.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
-#include <linux/malloc.h>
-#else
-#include <linux/slab.h>
-#endif
-
-#include <linux/pci.h>
-#include <linux/ioport.h>
-#include <linux/init.h>
-
-#include <asm/uaccess.h>
-#include <asm/system.h>
-#include <asm/io.h>
-
-#include <linux/mman.h>
-
-#include <linux/fs.h>
-#include <linux/unistd.h>
-
-#ifdef CONFIG_MTRR
-#include <asm/mtrr.h>
-#endif
-#ifdef CONFIG_DEVFS_FS
-#include <linux/devfs_fs_kernel.h>
-#endif
-
-#include "dhahelper.h"
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-#define pte_offset(p,a) pte_offset_kernel(p,a)
-#define LockPage(p) SetPageLocked(p)
-#define UnlockPage(p) ClearPageLocked(p)
-#define irqreturn(n) return(n)
-#else
-#define irqreturn_t void
-#define irqreturn(n) return
-#endif
-
-MODULE_AUTHOR("Alex Beregszaszi <alex@naxine.org>, Nick Kurshev <nickols_k@mail.ru>, Måns Rullgård <mru@users.sf.net>");
-MODULE_DESCRIPTION("Provides userspace access to hardware");
-#ifdef MODULE_LICENSE
-MODULE_LICENSE("GPL");
-#endif
-
-static int dhahelper_major = DEFAULT_MAJOR;
-MODULE_PARM(dhahelper_major, "i");
-MODULE_PARM_DESC(dhahelper_major, "Major number of dhahelper characterdevice");
-
-/* 0 = silent */
-/* 1 = report errors (default) */
-/* 2 = debug */
-static int dhahelper_verbosity = 1;
-MODULE_PARM(dhahelper_verbosity, "i");
-MODULE_PARM_DESC(dhahelper_verbosity, "Level of verbosity (0 = silent, 1 = only errors, 2 = debug)");
-
-static int dhahelper_open(struct inode *inode, struct file *file)
-{
- if (dhahelper_verbosity > 1)
- printk(KERN_DEBUG "dhahelper: device opened\n");
-
- if (MINOR(inode->i_rdev) != 0)
- return -ENXIO;
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
- MOD_INC_USE_COUNT;
-#endif
-
- return 0;
-}
-
-static int dhahelper_release(struct inode *inode, struct file *file)
-{
- if (dhahelper_verbosity > 1)
- printk(KERN_DEBUG "dhahelper: device released\n");
-
- if (MINOR(inode->i_rdev) != 0)
- return -ENXIO;
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
- MOD_DEC_USE_COUNT;
-#endif
-
- return 0;
-}
-
-static int dhahelper_get_version(int * arg)
-{
- int version = API_VERSION;
-
- if (copy_to_user(arg, &version, sizeof(int)))
- {
- if (dhahelper_verbosity > 0)
- printk(KERN_ERR "dhahelper: failed copy to userspace\n");
- return -EFAULT;
- }
- return 0;
-}
-
-static int dhahelper_port(dhahelper_port_t * arg)
-{
- dhahelper_port_t port;
- if (copy_from_user(&port, arg, sizeof(dhahelper_port_t)))
- {
- if (dhahelper_verbosity > 0)
- printk(KERN_ERR "dhahelper: failed copy from userspace\n");
- return -EFAULT;
- }
- switch(port.operation)
- {
- case PORT_OP_READ:
- {
- switch(port.size)
- {
- case 1:
- port.value = inb(port.addr);
- break;
- case 2:
- port.value = inw(port.addr);
- break;
- case 4:
- port.value = inl(port.addr);
- break;
- default:
- if (dhahelper_verbosity > 0)
- printk(KERN_ERR "dhahelper: invalid port read size (%d)\n",
- port.size);
- return -EINVAL;
- }
- break;
- }
- case PORT_OP_WRITE:
- {
- switch(port.size)
- {
- case 1:
- outb(port.value, port.addr);
- break;
- case 2:
- outw(port.value, port.addr);
- break;
- case 4:
- outl(port.value, port.addr);
- break;
- default:
- if (dhahelper_verbosity > 0)
- printk(KERN_ERR "dhahelper: invalid port write size (%d)\n",
- port.size);
- return -EINVAL;
- }
- break;
- }
- default:
- if (dhahelper_verbosity > 0)
- printk(KERN_ERR "dhahelper: invalid port operation (%d)\n",
- port.operation);
- return -EINVAL;
- }
- /* copy back only if read was performed */
- if (port.operation == PORT_OP_READ)
- if (copy_to_user(arg, &port, sizeof(dhahelper_port_t)))
- {
- if (dhahelper_verbosity > 0)
- printk(KERN_ERR "dhahelper: failed copy to userspace\n");
- return -EFAULT;
- }
- return 0;
-}
-
-/*******************************/
-/* Memory management functions */
-/* from kernel:/drivers/media/video/bttv-driver.c */
-/*******************************/
-
-#define MDEBUG(x) do { } while(0) /* Debug memory management */
-
-/* [DaveM] I've recoded most of this so that:
- * 1) It's easier to tell what is happening
- * 2) It's more portable, especially for translating things
- * out of vmalloc mapped areas in the kernel.
- * 3) Less unnecessary translations happen.
- *
- * The code used to assume that the kernel vmalloc mappings
- * existed in the page tables of every process, this is simply
- * not guarenteed. We now use pgd_offset_k which is the
- * defined way to get at the kernel page tables.
- */
-
-/* Given PGD from the address space's page table, return the kernel
- * virtual mapping of the physical memory mapped at ADR.
- */
-static inline unsigned long uvirt_to_kva(pgd_t *pgd, unsigned long adr)
-{
- unsigned long ret = 0UL;
- pmd_t *pmd;
- pte_t *ptep, pte;
-
- if (!pgd_none(*pgd)) {
- pmd = pmd_offset(pgd, adr);
- if (!pmd_none(*pmd)) {
- ptep = pte_offset(pmd, adr);
- pte = *ptep;
- if(pte_present(pte)) {
- ret = (unsigned long) page_address(pte_page(pte));
- ret |= (adr & (PAGE_SIZE - 1));
-
- }
- }
- }
- MDEBUG(printk("uv2kva(%lx-->%lx)", adr, ret));
- return ret;
-}
-
-static inline unsigned long uvirt_to_bus(unsigned long adr)
-{
- unsigned long kva, ret;
-
- kva = uvirt_to_kva(pgd_offset(current->mm, adr), adr);
- ret = virt_to_bus((void *)kva);
- MDEBUG(printk("uv2b(%lx-->%lx)", adr, ret));
- return ret;
-}
-
-static inline unsigned long uvirt_to_pa(unsigned long adr)
-{
- unsigned long kva, ret;
-
- kva = uvirt_to_kva(pgd_offset(current->mm, adr), adr);
- ret = virt_to_phys((void *)kva);
- MDEBUG(printk("uv2b(%lx-->%lx)", adr, ret));
- return ret;
-}
-
-static inline unsigned long kvirt_to_bus(unsigned long va)
-{
- unsigned long kva, ret;
-
- kva = uvirt_to_kva(pgd_offset_k(va), va);
- ret = virt_to_bus((void *)kva);
- MDEBUG(printk("kv2b(%lx-->%lx)", adr, ret));
- return ret;
-}
-
-/* Here we want the physical address of the memory.
- * This is used when initializing the contents of the
- * area and marking the pages as reserved.
- */
-static inline unsigned long kvirt_to_pa(unsigned long va)
-{
- unsigned long kva, ret;
-
- kva = uvirt_to_kva(pgd_offset_k(va), va);
- ret = __pa(kva);
- MDEBUG(printk("kv2pa(%lx-->%lx)", adr, ret));
- return ret;
-}
-
-static void * rvmalloc(signed long size)
-{
- void * mem;
- unsigned long adr, page;
-
- mem=vmalloc_32(size);
- if (mem)
- {
- memset(mem, 0, size); /* Clear the ram out, no junk to the user */
- adr=(unsigned long) mem;
- while (size > 0)
- {
- page = kvirt_to_pa(adr);
- SetPageReserved(virt_to_page(__va(page)));
- adr+=PAGE_SIZE;
- size-=PAGE_SIZE;
- }
- }
- return mem;
-}
-
-static int pag_lock(unsigned long addr)
-{
- unsigned long page;
- unsigned long kva;
-
- kva = uvirt_to_kva(pgd_offset(current->mm, addr), addr);
- if(kva)
- {
- lock_it:
- page = uvirt_to_pa((unsigned long)addr);
- LockPage(virt_to_page(__va(page)));
- SetPageReserved(virt_to_page(__va(page)));
- }
- else
- {
- copy_from_user(&page,(char *)addr,1); /* try access it */
- kva = uvirt_to_kva(pgd_offset(current->mm, addr), addr);
- if(kva) goto lock_it;
- else return EPERM;
- }
- return 0;
-}
-
-static int pag_unlock(unsigned long addr)
-{
- unsigned long page;
- unsigned long kva;
-
- kva = uvirt_to_kva(pgd_offset(current->mm, addr), addr);
- if(kva)
- {
- page = uvirt_to_pa((unsigned long)addr);
- UnlockPage(virt_to_page(__va(page)));
- ClearPageReserved(virt_to_page(__va(page)));
- return 0;
- }
- return EPERM;
-}
-
-
-static void rvfree(void * mem, signed long size)
-{
- unsigned long adr, page;
-
- if (mem)
- {
- adr=(unsigned long) mem;
- while (size > 0)
- {
- page = kvirt_to_pa(adr);
- ClearPageReserved(virt_to_page(__va(page)));
- adr+=PAGE_SIZE;
- size-=PAGE_SIZE;
- }
- vfree(mem);
- }
-}
-
-
-static int dhahelper_virt_to_phys(dhahelper_vmi_t *arg)
-{
- dhahelper_vmi_t mem;
- unsigned long i,nitems;
- char *addr;
- if (copy_from_user(&mem, arg, sizeof(dhahelper_vmi_t)))
- {
- if (dhahelper_verbosity > 0)
- printk(KERN_ERR "dhahelper: failed copy from userspace\n");
- return -EFAULT;
- }
- nitems = mem.length / PAGE_SIZE;
- if(mem.length % PAGE_SIZE) nitems++;
- addr = mem.virtaddr;
- for(i=0;i<nitems;i++)
- {
- unsigned long result;
- result = uvirt_to_pa((unsigned long)addr);
- if (copy_to_user(&mem.realaddr[i], &result, sizeof(unsigned long)))
- {
- if (dhahelper_verbosity > 0)
- printk(KERN_ERR "dhahelper: failed copy to userspace\n");
- return -EFAULT;
- }
- addr += PAGE_SIZE;
- }
- return 0;
-}
-
-static int dhahelper_virt_to_bus(dhahelper_vmi_t *arg)
-{
- dhahelper_vmi_t mem;
- unsigned long i,nitems;
- char *addr;
- if (copy_from_user(&mem, arg, sizeof(dhahelper_vmi_t)))
- {
- if (dhahelper_verbosity > 0)
- printk(KERN_ERR "dhahelper: failed copy from userspace\n");
- return -EFAULT;
- }
- nitems = mem.length / PAGE_SIZE;
- if(mem.length % PAGE_SIZE) nitems++;
- addr = mem.virtaddr;
- for(i=0;i<nitems;i++)
- {
- unsigned long result;
- result = uvirt_to_bus((unsigned long)addr);
- if (copy_to_user(&mem.realaddr[i], &result, sizeof(unsigned long)))
- {
- if (dhahelper_verbosity > 0)
- printk(KERN_ERR "dhahelper: failed copy to userspace\n");
- return -EFAULT;
- }
- addr += PAGE_SIZE;
- }
- return 0;
-}
-
-
-static int dhahelper_alloc_pa(dhahelper_mem_t *arg)
-{
- dhahelper_mem_t mem;
- if (copy_from_user(&mem, arg, sizeof(dhahelper_mem_t)))
- {
- if (dhahelper_verbosity > 0)
- printk(KERN_ERR "dhahelper: failed copy from userspace\n");
- return -EFAULT;
- }
- mem.addr = rvmalloc(mem.length);
- if (copy_to_user(arg, &mem, sizeof(dhahelper_mem_t)))
- {
- if (dhahelper_verbosity > 0)
- printk(KERN_ERR "dhahelper: failed copy to userspace\n");
- return -EFAULT;
- }
- return 0;
-}
-
-static int dhahelper_free_pa(dhahelper_mem_t *arg)
-{
- dhahelper_mem_t mem;
- if (copy_from_user(&mem, arg, sizeof(dhahelper_mem_t)))
- {
- if (dhahelper_verbosity > 0)
- printk(KERN_ERR "dhahelper: failed copy from userspace\n");
- return -EFAULT;
- }
- rvfree(mem.addr,mem.length);
- return 0;
-}
-
-static int dhahelper_lock_mem(dhahelper_mem_t *arg)
-{
- dhahelper_mem_t mem;
- int retval;
- unsigned long i,nitems,addr;
- if (copy_from_user(&mem, arg, sizeof(dhahelper_mem_t)))
- {
- if (dhahelper_verbosity > 0)
- printk(KERN_ERR "dhahelper: failed copy from userspace\n");
- return -EFAULT;
- }
- nitems = mem.length / PAGE_SIZE;
- if(mem.length % PAGE_SIZE) nitems++;
- addr = (unsigned long)mem.addr;
- for(i=0;i<nitems;i++)
- {
- retval = pag_lock((unsigned long)addr);
- if(retval)
- {
- unsigned long j;
- addr = (unsigned long)mem.addr;
- for(j=0;j<i;j++)
- {
- pag_unlock(addr);
- addr += PAGE_SIZE;
- }
- return retval;
- }
- addr += PAGE_SIZE;
- }
- return 0;
-}
-
-static int dhahelper_unlock_mem(dhahelper_mem_t *arg)
-{
- dhahelper_mem_t mem;
- int retval;
- unsigned long i,nitems,addr;
- if (copy_from_user(&mem, arg, sizeof(dhahelper_mem_t)))
- {
- if (dhahelper_verbosity > 0)
- printk(KERN_ERR "dhahelper: failed copy from userspace\n");
- return -EFAULT;
- }
- nitems = mem.length / PAGE_SIZE;
- if(mem.length % PAGE_SIZE) nitems++;
- addr = (unsigned long)mem.addr;
- for(i=0;i<nitems;i++)
- {
- retval = pag_unlock((unsigned long)addr);
- if(retval) return retval;
- addr += PAGE_SIZE;
- }
- return 0;
-}
-
-static struct dha_irq {
- spinlock_t lock;
- unsigned long flags;
- int handled;
- int rcvd;
- volatile u32 *ack_addr;
- u32 ack_data;
- struct pci_dev *dev;
- wait_queue_head_t wait;
- unsigned long count;
-} dha_irqs[256];
-
-static irqreturn_t dhahelper_irq_handler(int irq, void *dev_id,
- struct pt_regs *regs)
-{
- spin_lock_irqsave(&dha_irqs[irq].lock, dha_irqs[irq].flags);
- if(dha_irqs[irq].handled){
- dha_irqs[irq].rcvd = 1;
- dha_irqs[irq].count++;
- if(dha_irqs[irq].ack_addr){
- *dha_irqs[irq].ack_addr = dha_irqs[irq].ack_data;
- mb();
- }
- wake_up_interruptible(&dha_irqs[irq].wait);
- }
- spin_unlock_irqrestore(&dha_irqs[irq].lock, dha_irqs[irq].flags);
- irqreturn(0);
-}
-
-static int dhahelper_install_irq(dhahelper_irq_t *arg)
-{
- dhahelper_irq_t my_irq;
- struct pci_dev *pci;
- long rlen;
- int retval;
- long ack_addr;
- int irqn;
-
- if (copy_from_user(&my_irq, arg, sizeof(dhahelper_irq_t)))
- {
- if (dhahelper_verbosity > 0)
- printk(KERN_ERR "dhahelper: failed copy from userspace\n");
- return -EFAULT;
- }
-
- if(!(pci = pci_find_slot(my_irq.bus, PCI_DEVFN(my_irq.dev, my_irq.func))))
- return -EINVAL;
-
- rlen = pci_resource_len(pci, my_irq.ack_region);
- if(my_irq.ack_offset > rlen - 4)
- return -EINVAL;
-
- irqn = pci->irq;
-
- spin_lock_irqsave(&dha_irqs[irqn].lock,
- dha_irqs[irqn].flags);
-
- if(dha_irqs[irqn].handled){
- retval = -EBUSY;
- goto fail;
- }
-
- if(my_irq.ack_region >= 0){
- ack_addr = pci_resource_start(pci, my_irq.ack_region);
- ack_addr += my_irq.ack_offset;
-#ifdef CONFIG_ALPHA
- ack_addr += ((struct pci_controller *) pci->sysdata)->dense_mem_base;
-#endif
- /* FIXME: Other architectures */
-
- dha_irqs[irqn].ack_addr = phys_to_virt(ack_addr);
- dha_irqs[irqn].ack_data = my_irq.ack_data;
- } else {
- dha_irqs[irqn].ack_addr = 0;
- }
-
- dha_irqs[irqn].lock = SPIN_LOCK_UNLOCKED;
- dha_irqs[irqn].flags = 0;
- dha_irqs[irqn].rcvd = 0;
- dha_irqs[irqn].dev = pci;
- init_waitqueue_head(&dha_irqs[irqn].wait);
- dha_irqs[irqn].count = 0;
-
- retval = request_irq(irqn, dhahelper_irq_handler,
- SA_SHIRQ, "dhahelper", pci);
-
- if(retval < 0)
- goto fail;
-
- copy_to_user(&arg->num, &irqn, sizeof(irqn));
-
- dha_irqs[irqn].handled = 1;
-
-out:
- spin_unlock_irqrestore(&dha_irqs[irqn].lock,
- dha_irqs[irqn].flags);
- return retval;
-
-fail:
- if(retval == -EINVAL){
- printk("dhahelper: bad irq number or handler\n");
- } else if(retval == -EBUSY){
- printk("dhahelper: IRQ %u busy\n", irqn);
- } else {
- printk("dhahelper: Could not install irq handler...\n");
- }
- printk("dhahelper: Perhaps you need to let your BIOS assign an IRQ to your video card\n");
- goto out;
-}
-
-static int dhahelper_free_irq(dhahelper_irq_t *arg)
-{
- dhahelper_irq_t irq;
- struct pci_dev *pci;
- int irqn;
-
- if (copy_from_user(&irq, arg, sizeof(dhahelper_irq_t)))
- {
- if (dhahelper_verbosity > 0)
- printk(KERN_ERR "dhahelper: failed copy from userspace\n");
- return -EFAULT;
- }
-
- pci = pci_find_slot(irq.bus, PCI_DEVFN(irq.dev, irq.func));
- if(!pci)
- return -EINVAL;
-
- irqn = pci->irq;
-
- spin_lock_irqsave(&dha_irqs[irqn].lock, dha_irqs[irqn].flags);
- if(dha_irqs[irqn].handled) {
- free_irq(irqn, pci);
- dha_irqs[irqn].handled = 0;
- printk("IRQ %i: %li\n", irqn, dha_irqs[irqn].count);
- }
- spin_unlock_irqrestore(&dha_irqs[irqn].lock, dha_irqs[irqn].flags);
- return 0;
-}
-
-static int dhahelper_ack_irq(dhahelper_irq_t *arg)
-{
- dhahelper_irq_t irq;
- int retval = 0;
- DECLARE_WAITQUEUE(wait, current);
- if (copy_from_user(&irq, arg, sizeof(dhahelper_irq_t)))
- {
- if (dhahelper_verbosity > 0)
- printk(KERN_ERR "dhahelper: failed copy from userspace\n");
- return -EFAULT;
- }
- if(irq.num > 255) return -EINVAL;
- if(!dha_irqs[irq.num].handled) return -ESRCH;
- add_wait_queue(&dha_irqs[irq.num].wait, &wait);
- set_current_state(TASK_INTERRUPTIBLE);
- for(;;){
- int r;
- spin_lock_irqsave(&dha_irqs[irq.num].lock,
- dha_irqs[irq.num].flags);
- r = dha_irqs[irq.num].rcvd;
- spin_unlock_irqrestore(&dha_irqs[irq.num].lock,
- dha_irqs[irq.num].flags);
-
- if(r){
- dha_irqs[irq.num].rcvd = 0;
- break;
- }
-
- if(signal_pending(current)){
- retval = -ERESTARTSYS;
- break;
- }
-
- schedule();
- }
- set_current_state(TASK_RUNNING);
- remove_wait_queue(&dha_irqs[irq.num].wait, &wait);
- return retval;
-}
-
-static int dhahelper_cpu_flush(dhahelper_cpu_flush_t *arg)
-{
- dhahelper_cpu_flush_t my_l2;
- if (copy_from_user(&my_l2, arg, sizeof(dhahelper_cpu_flush_t)))
- {
- if (dhahelper_verbosity > 0)
- printk(KERN_ERR "dhahelper: failed copy from userspace\n");
- return -EFAULT;
- }
-#if defined(__i386__)
- /* WBINVD writes all modified cache lines back to main memory */
- if(boot_cpu_data.x86 > 3) { __asm __volatile("wbinvd":::"memory"); }
-#else
- /* FIXME!!!*/
- mb(); /* declared in "asm/system.h" */
-#endif
- return 0;
-}
-
-static struct pci_dev *pdev = NULL;
-static int dhahelper_pci_find(dhahelper_pci_device_t *arg)
-{
- dhahelper_pci_device_t this_dev;
- pdev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pdev);
- if(pdev)
- {
- this_dev.bus = pdev->bus->number;
- this_dev.card = PCI_SLOT(pdev->devfn);
- this_dev.func = PCI_FUNC(pdev->devfn);
- this_dev.vendor = pdev->vendor;
- this_dev.device = pdev->device;
- this_dev.base0 = pci_resource_start (pdev, 0);
- this_dev.base1 = pci_resource_start (pdev, 1);
- this_dev.base2 = pci_resource_start (pdev, 2);
- pci_read_config_dword(pdev, pdev->rom_base_reg, (u32*)&this_dev.baserom);
- this_dev.base3 = pci_resource_start (pdev, 3);
- this_dev.base4 = pci_resource_start (pdev, 4);
- this_dev.base5 = pci_resource_start (pdev, 5);
- pci_read_config_byte(pdev, PCI_INTERRUPT_LINE, &this_dev.irq);
- pci_read_config_byte(pdev, PCI_INTERRUPT_PIN, &this_dev.ipin);
- pci_read_config_byte(pdev, PCI_MIN_GNT, &this_dev.gnt);
- pci_read_config_byte(pdev, PCI_MAX_LAT, &this_dev.lat);
- }
- else memset(&this_dev,0,sizeof(dhahelper_pci_device_t));
- if (copy_to_user(arg, &this_dev, sizeof(dhahelper_pci_device_t)))
- {
- if (dhahelper_verbosity > 0)
- printk(KERN_ERR "dhahelper: failed copy to userspace\n");
- return -EFAULT;
- }
- return pdev?0:-ENODATA;
-}
-
-static int dhahelper_pci_config(dhahelper_pci_config_t *arg)
-{
- dhahelper_pci_config_t op;
- struct pci_dev *pdev;
- if (copy_from_user(&op, arg, sizeof(dhahelper_pci_config_t)))
- {
- if (dhahelper_verbosity > 0)
- printk(KERN_ERR "dhahelper: failed copy from userspace\n");
- return -EFAULT;
- }
- pdev = pci_find_slot(op.bus,PCI_DEVFN(op.dev,op.func));
- if(!pdev)
- {
- if (dhahelper_verbosity > 0)
- printk(KERN_ERR "dhahelper: can't identify device\n");
- return -EFAULT;
- }
- switch(op.operation)
- {
- case PCI_OP_READ:
- switch(op.size)
- {
- case 1:
- pci_read_config_byte(pdev,op.cmd,(u8*)&op.ret);
- break;
- case 2:
- pci_read_config_word(pdev,op.cmd,(u16*)&op.ret);
- break;
- case 4:
- pci_read_config_dword(pdev,op.cmd,(u32*)&op.ret);
- break;
- default:
- if (dhahelper_verbosity > 0)
- printk(KERN_ERR "dhahelper: wrong size of pci operation: %u \n",op.size);
- return -EFAULT;
- }
- case PCI_OP_WRITE:
- switch(op.size)
- {
- case 1:
- pci_write_config_byte(pdev,op.cmd,op.ret);
- break;
- case 2:
- pci_write_config_word(pdev,op.cmd,op.ret);
- break;
- case 4:
- pci_write_config_dword(pdev,op.cmd,op.ret);
- break;
- default:
- if (dhahelper_verbosity > 0)
- printk(KERN_ERR "dhahelper: wrong size of pci operation: %u \n",op.size);
- return -EFAULT;
- }
- default:
- if (dhahelper_verbosity > 0)
- printk(KERN_ERR "dhahelper: unknown pci operation %i\n",op.operation);
- return -EFAULT;
- }
- if (copy_to_user(arg, &op, sizeof(dhahelper_pci_device_t)))
- {
- if (dhahelper_verbosity > 0)
- printk(KERN_ERR "dhahelper: failed copy to userspace\n");
- return -EFAULT;
- }
- return 0;
-}
-
-static int dhahelper_mtrr(dhahelper_mtrr_t *arg)
-{
-#ifdef CONFIG_MTRR
- dhahelper_mtrr_t op;
- if (copy_from_user(&op, arg, sizeof(dhahelper_pci_config_t)))
- {
- if (dhahelper_verbosity > 0)
- printk(KERN_ERR "dhahelper: failed copy from userspace\n");
- return -EFAULT;
- }
- switch(op.operation)
- {
- case MTRR_OP_ADD:
- op.privat = mtrr_add (op.start,op.size,op.type,1);
- break;
- case MTRR_OP_DEL:
- mtrr_del(op.privat, op.start, op.size);
- break;
- default:
- if (dhahelper_verbosity > 0)
- printk(KERN_ERR "dhahelper: unknown mtrr operation %i\n",op.operation);
- return -EFAULT;
- }
- if (copy_to_user(arg, &op, sizeof(dhahelper_mtrr_t)))
- {
- if (dhahelper_verbosity > 0)
- printk(KERN_ERR "dhahelper: failed copy to userspace\n");
- return -EFAULT;
- }
-#endif
- return 0;
-}
-
-static int dhahelper_ioctl(struct inode *inode, struct file *file,
- unsigned int cmd, unsigned long arg)
-{
- if (dhahelper_verbosity > 1)
- printk(KERN_DEBUG "dhahelper: ioctl(cmd=%x, arg=%lx)\n",
- cmd, arg);
-
- if (MINOR(inode->i_rdev) != 0)
- return -ENXIO;
-
- switch(cmd)
- {
- case DHAHELPER_GET_VERSION: return dhahelper_get_version((int *)arg);
- case DHAHELPER_PORT: return dhahelper_port((dhahelper_port_t *)arg);
- case DHAHELPER_MTRR: return dhahelper_mtrr((dhahelper_mtrr_t *)arg);
- case DHAHELPER_PCI_CONFIG: return dhahelper_pci_config((dhahelper_pci_config_t *)arg);
- case DHAHELPER_VIRT_TO_PHYS:return dhahelper_virt_to_phys((dhahelper_vmi_t *)arg);
- case DHAHELPER_VIRT_TO_BUS: return dhahelper_virt_to_bus((dhahelper_vmi_t *)arg);
- case DHAHELPER_ALLOC_PA:return dhahelper_alloc_pa((dhahelper_mem_t *)arg);
- case DHAHELPER_FREE_PA: return dhahelper_free_pa((dhahelper_mem_t *)arg);
- case DHAHELPER_LOCK_MEM: return dhahelper_lock_mem((dhahelper_mem_t *)arg);
- case DHAHELPER_UNLOCK_MEM: return dhahelper_unlock_mem((dhahelper_mem_t *)arg);
- case DHAHELPER_INSTALL_IRQ: return dhahelper_install_irq((dhahelper_irq_t *)arg);
- case DHAHELPER_ACK_IRQ: return dhahelper_ack_irq((dhahelper_irq_t *)arg);
- case DHAHELPER_FREE_IRQ: return dhahelper_free_irq((dhahelper_irq_t *)arg);
- case DHAHELPER_CPU_FLUSH: return dhahelper_cpu_flush((dhahelper_cpu_flush_t *)arg);
- case DHAHELPER_PCI_FIND: return dhahelper_pci_find((dhahelper_pci_device_t *)arg);
- default:
- if (dhahelper_verbosity > 0)
- printk(KERN_ERR "dhahelper: invalid ioctl (%x)\n", cmd);
- return -EINVAL;
- }
- return 0;
-}
-
-/*
- fops functions were shamelessly stolen from linux-kernel project ;)
-*/
-
-static loff_t dhahelper_lseek(struct file * file, loff_t offset, int orig)
-{
- switch (orig) {
- case 0:
- file->f_pos = offset;
- return file->f_pos;
- case 1:
- file->f_pos += offset;
- return file->f_pos;
- default:
- return -EINVAL;
- }
-}
-
-/*
- * This funcion reads the *physical* memory. The f_pos points directly to the
- * memory location.
- */
-static ssize_t dhahelper_read(struct file * file, char * buf,
- size_t count, loff_t *ppos)
-{
- unsigned long p = *ppos;
- unsigned long end_mem;
- ssize_t read;
-
- end_mem = __pa(high_memory);
- if (p >= end_mem)
- return 0;
- if (count > end_mem - p)
- count = end_mem - p;
- read = 0;
-#if defined(__sparc__) || defined(__mc68000__)
- /* we don't have page 0 mapped on sparc and m68k.. */
- if (p < PAGE_SIZE) {
- unsigned long sz = PAGE_SIZE-p;
- if (sz > count)
- sz = count;
- if (sz > 0) {
- if (clear_user(buf, sz))
- return -EFAULT;
- buf += sz;
- p += sz;
- count -= sz;
- read += sz;
- }
- }
-#endif
- if (copy_to_user(buf, __va(p), count))
- return -EFAULT;
- read += count;
- *ppos += read;
- return read;
-}
-
-static ssize_t do_write_mem(struct file * file, void *p, unsigned long realp,
- const char * buf, size_t count, loff_t *ppos)
-{
- ssize_t written;
-
- written = 0;
-#if defined(__sparc__) || defined(__mc68000__)
- /* we don't have page 0 mapped on sparc and m68k.. */
- if (realp < PAGE_SIZE) {
- unsigned long sz = PAGE_SIZE-realp;
- if (sz > count) sz = count;
- /* Hmm. Do something? */
- buf+=sz;
- p+=sz;
- count-=sz;
- written+=sz;
- }
-#endif
- if (copy_from_user(p, buf, count))
- return -EFAULT;
- written += count;
- *ppos += written;
- return written;
-}
-
-static ssize_t dhahelper_write(struct file * file, const char * buf,
- size_t count, loff_t *ppos)
-{
- unsigned long p = *ppos;
- unsigned long end_mem;
-
- end_mem = __pa(high_memory);
- if (p >= end_mem)
- return 0;
- if (count > end_mem - p)
- count = end_mem - p;
- return do_write_mem(file, __va(p), p, buf, count, ppos);
-}
-
-#ifndef pgprot_noncached
-
-/*
- * This should probably be per-architecture in <asm/pgtable.h>
- */
-static inline pgprot_t pgprot_noncached(pgprot_t _prot)
-{
- unsigned long prot = pgprot_val(_prot);
-
-#if defined(__i386__) || defined(__x86_64__)
- /* On PPro and successors, PCD alone doesn't always mean
- uncached because of interactions with the MTRRs. PCD | PWT
- means definitely uncached. */
- if (boot_cpu_data.x86 > 3)
- prot |= _PAGE_PCD | _PAGE_PWT;
-#elif defined(__powerpc__)
- prot |= _PAGE_NO_CACHE | _PAGE_GUARDED;
-#elif defined(__mc68000__)
-#ifdef SUN3_PAGE_NOCACHE
- if (MMU_IS_SUN3)
- prot |= SUN3_PAGE_NOCACHE;
- else
-#endif
- if (MMU_IS_851 || MMU_IS_030)
- prot |= _PAGE_NOCACHE030;
- /* Use no-cache mode, serialized */
- else if (MMU_IS_040 || MMU_IS_060)
- prot = (prot & _CACHEMASK040) | _PAGE_NOCACHE_S;
-#endif
-
- return __pgprot(prot);
-}
-
-#endif /* !pgprot_noncached */
-
-/*
- * Architectures vary in how they handle caching for addresses
- * outside of main memory.
- */
-static inline int noncached_address(unsigned long addr)
-{
-#if defined(__i386__)
- /*
- * On the PPro and successors, the MTRRs are used to set
- * memory types for physical addresses outside main memory,
- * so blindly setting PCD or PWT on those pages is wrong.
- * For Pentiums and earlier, the surround logic should disable
- * caching for the high addresses through the KEN pin, but
- * we maintain the tradition of paranoia in this code.
- */
- return !( test_bit(X86_FEATURE_MTRR, boot_cpu_data.x86_capability) ||
- test_bit(X86_FEATURE_K6_MTRR, boot_cpu_data.x86_capability) ||
- test_bit(X86_FEATURE_CYRIX_ARR, boot_cpu_data.x86_capability) ||
- test_bit(X86_FEATURE_CENTAUR_MCR, boot_cpu_data.x86_capability) )
- && addr >= __pa(high_memory);
-#else
- return addr >= __pa(high_memory);
-#endif
-}
-
-static int dhahelper_mmap(struct file * file, struct vm_area_struct * vma)
-{
- unsigned long offset = vma->vm_pgoff << PAGE_SHIFT;
- int err;
-
- /*
- * Accessing memory above the top the kernel knows about or
- * through a file pointer that was marked O_SYNC will be
- * done non-cached.
- */
- if (noncached_address(offset) || (file->f_flags & O_SYNC))
- vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
-
- /* Don't try to swap out physical pages.. */
- vma->vm_flags |= VM_RESERVED;
-
- /*
- * Don't dump addresses that are not real memory to a core file.
- */
- if (offset >= __pa(high_memory) || (file->f_flags & O_SYNC))
- vma->vm_flags |= VM_IO;
-
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
- err = remap_page_range(vma, vma->vm_start, offset,
- vma->vm_end-vma->vm_start, vma->vm_page_prot);
-#else
- err = remap_page_range(vma->vm_start, offset,
- vma->vm_end-vma->vm_start, vma->vm_page_prot);
-#endif
- if(err)
- return -EAGAIN;
- return 0;
-}
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
-static struct file_operations dhahelper_fops =
-{
- /*llseek*/ dhahelper_lseek,
- /*read*/ dhahelper_read,
- /*write*/ dhahelper_write,
- /*readdir*/ NULL,
- /*poll*/ NULL,
- /*ioctl*/ dhahelper_ioctl,
- /*mmap*/ dhahelper_mmap,
- /*open*/ dhahelper_open,
- /*flush*/ NULL,
- /*release*/ dhahelper_release,
- /* zero out the last 5 entries too ? */
-};
-#else
-static struct file_operations dhahelper_fops =
-{
- owner: THIS_MODULE,
- ioctl: dhahelper_ioctl,
- open: dhahelper_open,
- release: dhahelper_release,
- llseek: dhahelper_lseek,
- read: dhahelper_read,
- write: dhahelper_write,
- mmap: dhahelper_mmap,
-};
-#endif
-
-#ifdef CONFIG_DEVFS_FS
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
-devfs_handle_t dha_devfsh;
-
-static int
-register_dev(void)
-{
- dha_devfsh = devfs_register(NULL, "dhahelper", DEVFS_FL_NONE,
- dhahelper_major, 0,
- S_IFCHR | S_IRUSR | S_IWUSR,
- &dhahelper_fops, NULL);
- if(!dha_devfsh)
- return -EIO;
- return 0;
-}
-
-static void
-unregister_dev(void)
-{
- devfs_unregister(dha_devfsh);
-}
-#else /* VERSION < 2.6.0 */
-static int
-register_dev(void)
-{
- devfs_mk_cdev(MKDEV(dhahelper_major, 0), S_IFCHR | S_IRUSR | S_IWUSR,
- "dhahelper");
- if(register_chrdev(dhahelper_major, "dhahelper", &dhahelper_fops))
- return -EIO;
- return 0;
-}
-
-static void
-unregister_dev(void)
-{
- devfs_remove("dhahelper");
- unregister_chrdev(dhahelper_major, "dhahelper");
-}
-#endif /* VERSION < 2.6.0 */
-#else
-static int
-register_dev(void)
-{
- return register_chrdev(dhahelper_major, "dhahelper", &dhahelper_fops);
-}
-
-static void
-unregister_dev(void)
-{
- unregister_chrdev(dhahelper_major, "dhahelper");
-}
-#endif /* defined CONFIG_DEVFS_FS */
-
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
-int init_module(void)
-#else
-static int __init init_dhahelper(void)
-#endif
-{
- int err = 0;
- printk(KERN_INFO "Direct Hardware Access kernel helper (C) Alex Beregszaszi\n");
-
- err = register_dev();
- if(err){
- if (dhahelper_verbosity > 0)
- printk(KERN_ERR "dhahelper: unable to register character device (major: %d)\n",
- dhahelper_major);
- return err;
- }
- memset(dha_irqs, 0, sizeof(dha_irqs));
- return 0;
-}
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
-void cleanup_module(void)
-#else
-static void __exit exit_dhahelper(void)
-#endif
-{
- unsigned i;
- for(i=0;i<256;i++)
- if(dha_irqs[i].handled)
- free_irq(i, dha_irqs[i].dev);
-
- unregister_dev();
-}
-
-#ifdef EXPORT_NO_SYMBOLS
-EXPORT_NO_SYMBOLS;
-#endif
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
-module_init(init_dhahelper);
-module_exit(exit_dhahelper);
-#endif
diff --git a/src/video_out/libdha/kernelhelper/dhahelper.h b/src/video_out/libdha/kernelhelper/dhahelper.h
deleted file mode 100644
index 7db56abb5..000000000
--- a/src/video_out/libdha/kernelhelper/dhahelper.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- Direct Hardware Access kernel helper
-
- (C) 2002 Alex Beregszaszi <alex@naxine.org>
- (C) 2002-2003 Nick Kurshev <nickols_k@mail.ru>
-*/
-
-#ifndef DHAHELPER_H
-#define DHAHELPER_H
-
-/* #include <linux/ioctl.h> */
-
-/* feel free to change */
-#define DEFAULT_MAJOR 252 /* 240-254 LOCAL/EXPERIMENTAL USE */
-
-#define API_VERSION 0x30 /* 3.0*/
-
-typedef struct dhahelper_port_s
-{
-#define PORT_OP_READ 1
-#define PORT_OP_WRITE 2
- int operation;
- int size;
- int addr; // FIXME - switch to void* (64bit)
- int value;
-} dhahelper_port_t;
-
-typedef struct dhahelper_mtrr_s
-{
-#define MTRR_OP_ADD 1
-#define MTRR_OP_DEL 2
- int operation;
- long start;
- long size;
- int type;
- int privat;
-} dhahelper_mtrr_t;
-
-typedef struct dhahelper_pci_config_s
-{
-#define PCI_OP_READ 0
-#define PCI_OP_WRITE 1
- int operation;
- int bus;
- int dev;
- int func;
- int cmd;
- int size;
- long ret;
-} dhahelper_pci_config_t;
-
-typedef struct dhahelper_vmi_s
-{
- void * virtaddr;
- unsigned long length;
- unsigned long *realaddr;
-}dhahelper_vmi_t;
-
-typedef struct dhahelper_mem_s
-{
- void * addr;
- unsigned long length;
-}dhahelper_mem_t;
-
-typedef struct dhahelper_irq_s
-{
- unsigned num;
- int bus, dev, func;
- int ack_region;
- unsigned long ack_offset;
- unsigned int ack_data;
-}dhahelper_irq_t;
-
-typedef struct dhahelper_cpu_flush_s
-{
- void *va;
- unsigned long length;
-}dhahelper_cpu_flush_t;
-
-typedef struct dhahelper_pci_device_s
-{
- int bus,card,func; /* PCI/AGP bus:card:func */
- unsigned short vendor,device; /* Card vendor+device ID */
- unsigned long base0,base1,base2,baserom; /* Memory and I/O base addresses */
- unsigned long base3,base4,base5; /* Memory and I/O base addresses */
- unsigned char irq,ipin,gnt,lat; /* assigned IRQ parameters for this card */
-}dhahelper_pci_device_t;
-
-#define DHAHELPER_GET_VERSION _IOW('D', 0, int)
-#define DHAHELPER_PORT _IOWR('D', 1, dhahelper_port_t)
-#define DHAHELPER_MTRR _IOWR('D', 2, dhahelper_mtrr_t)
-#define DHAHELPER_PCI_CONFIG _IOWR('D', 3, dhahelper_pci_config_t)
-#define DHAHELPER_VIRT_TO_PHYS _IOWR('D', 4, dhahelper_vmi_t)
-#define DHAHELPER_VIRT_TO_BUS _IOWR('D', 5, dhahelper_vmi_t)
-#define DHAHELPER_ALLOC_PA _IOWR('D', 6, dhahelper_mem_t)
-#define DHAHELPER_FREE_PA _IOWR('D', 7, dhahelper_mem_t)
-#define DHAHELPER_LOCK_MEM _IOWR('D', 8, dhahelper_mem_t)
-#define DHAHELPER_UNLOCK_MEM _IOWR('D', 9, dhahelper_mem_t)
-#define DHAHELPER_INSTALL_IRQ _IOWR('D', 10, dhahelper_irq_t)
-#define DHAHELPER_ACK_IRQ _IOWR('D', 11, dhahelper_irq_t)
-#define DHAHELPER_FREE_IRQ _IOWR('D', 12, dhahelper_irq_t)
-#define DHAHELPER_CPU_FLUSH _IOWR('D', 13, dhahelper_cpu_flush_t)
-#define DHAHELPER_PCI_FIND _IOWR('D', 14, dhahelper_pci_device_t)
-
-#endif /* DHAHELPER_H */
diff --git a/src/video_out/libdha/kernelhelper/test.c b/src/video_out/libdha/kernelhelper/test.c
deleted file mode 100644
index d2d807f3f..000000000
--- a/src/video_out/libdha/kernelhelper/test.c
+++ /dev/null
@@ -1,49 +0,0 @@
-#include <string.h>
-#include <stdio.h>
-#include <sys/ioctl.h>
-#include <unistd.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/mman.h>
-#include <stdlib.h>
-
-#include "dhahelper.h"
-
-int main(int argc, char *argv[])
-{
- int fd;
- int ret;
-
- fd = open("/dev/dhahelper", O_RDWR);
- if(fd < 0){
- perror("dev/dhahelper");
- exit(1);
- }
-
- ioctl(fd, DHAHELPER_GET_VERSION, &ret);
-
- printf("api version: %d\n", ret);
- if (ret != API_VERSION)
- printf("incompatible api!\n");
-
- {
- void *mem;
- unsigned long size=256;
- mem = mmap(0,size,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0);
- printf("allocated to %p\n", mem);
-
- if (argc > 1)
- if (mem != 0)
- {
- int i;
-
- for (i = 0; i < 256; i++)
- printf("[%x] ", *(int *)(mem+i));
- printf("\n");
- }
-
- munmap((void *)mem, size);
- }
-
- return(0);
-}
diff --git a/src/video_out/libdha/libdha.c b/src/video_out/libdha/libdha.c
deleted file mode 100644
index 73a4387a2..000000000
--- a/src/video_out/libdha/libdha.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- libgha.c - Library for direct hardware access
- Copyrights:
- 1996/10/27 - Robin Cutshaw (robin@xfree86.org)
- XFree86 3.3.3 implementation
- 1999 - Øyvind Aabling.
- Modified for GATOS/win/gfxdump.
-
- 2002 - library implementation by Nick Kurshev
- - dhahelper and some changes by Alex Beregszaszi
-
- supported O/S's: SVR4, UnixWare, SCO, Solaris,
- FreeBSD, NetBSD, 386BSD, BSDI BSD/386,
- Linux, Mach/386, ISC
- DOS (WATCOM 9.5 compiler), Win9x (with mapdev.vxd)
- Licence: GPL
- Original location: www.linuxvideo.org/gatos
-*/
-
-#include "config.h"
-
-#include "libdha.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#ifdef ARCH_ALPHA
-#include <sys/io.h>
-#endif
-#include <unistd.h>
-
-/* instead exit() use libdha_exit, and do the 'mother-application' deinit
- only in this code */
-void libdha_exit(const char *message, int level)
-{
- printf("libdha: FATAL: %s\n", message);
- exit(level); /* FIXME */
-}
-
-#if defined(_WIN32)
-#include "sysdep/libdha_win32.c"
-#elif defined (__EMX__)
-#include "sysdep/libdha_os2.c"
-#else
-
-#if defined(SVR4) || defined(SCO325)
-# if !(defined(sun) && defined (i386) && defined (SVR4))
-# define DEV_MEM "/dev/pmem"
-# elif defined(PowerMAX_OS)
-# define DEV_MEM "/dev/iomem"
-# endif
-# ifdef SCO325
-# undef DEV_MEM
-# define DEV_MEM "/dev/mem"
-# endif
-# endif /* SVR4 */
-
-/* Generic version */
-#include <sys/mman.h>
-#include <sys/ioctl.h>
-#ifndef DEV_MEM
-#define DEV_MEM "/dev/mem"
-#endif
-
-#include "kernelhelper/dhahelper.h"
-
-static int devmem_fd=-1;
-static unsigned devmem_locks=0;
-void *map_phys_mem(unsigned long base, unsigned long size)
-{
-#ifdef ARCH_ALPHA
-/* TODO: move it into sysdep */
- base += bus_base();
-#endif
- if( devmem_fd == -1)
- {
- if ( (devmem_fd = open("/dev/dhahelper",O_RDWR)) < 0)
- {
- if ( (devmem_fd = open(DEV_MEM,O_RDWR)) == -1)
- {
- perror("libdha: open(/dev/mem) failed");
- exit(1);
- }
- }
- }
- devmem_locks++;
- return mmap(0,size,PROT_READ|PROT_WRITE,MAP_SHARED,devmem_fd,base) ;
-}
-
-void unmap_phys_mem(void *ptr, unsigned long size)
-{
- int res=munmap(ptr,size) ;
- if (res == -1) { perror("libdha: munmap() failed") ; exit(1) ; }
- devmem_locks--;
- if(!devmem_locks) { close(devmem_fd); devmem_fd=-1; }
-}
-#endif
diff --git a/src/video_out/libdha/libdha.h b/src/video_out/libdha/libdha.h
deleted file mode 100644
index 2bd8fe39b..000000000
--- a/src/video_out/libdha/libdha.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- libgha.h - Library for direct hardware access
- Copyrights:
- 1996/10/27 - Robin Cutshaw (robin@xfree86.org)
- XFree86 3.3.3 implementation
- 1999 - Øyvind Aabling.
- Modified for GATOS/win/gfxdump.
- 2002 - library implementation by Nick Kurshev
-
- supported O/S's: SVR4, UnixWare, SCO, Solaris,
- FreeBSD, NetBSD, 386BSD, BSDI BSD/386,
- Linux, Mach/386, ISC
- DOS (WATCOM 9.5 compiler), Win9x (with mapdev.vxd)
- Licence: GPL
-*/
-#ifndef LIBDHA_H
-#define LIBDHA_H
-
-#if defined (__FreeBSD__)
-# include <inttypes.h>
-#else
-# include <stdint.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define MAX_DEV_PER_VENDOR_CFG1 64
-#define MAX_PCI_DEVICES_PER_BUS 32
-#define MAX_PCI_DEVICES 64
-#define PCI_MULTIFUNC_DEV 0x80
-
-typedef struct pciinfo_s
-{
- int bus,card,func; /* PCI/AGP bus:card:func */
- unsigned short vendor,device; /* Card vendor+device ID */
- unsigned long base0,base1,base2,baserom; /* Memory and I/O base addresses */
- unsigned long base3,base4,base5; /* Memory and I/O base addresses */
- unsigned char irq,ipin,gnt,lat; /* assigned IRQ parameters for this card */
-// unsigned base0_limit, base1_limit, base2_limit, baserom_limit;
-}pciinfo_t;
-
-extern int pci_config_read(unsigned char bus, unsigned char dev, unsigned char func,
- unsigned char cmd, int len, unsigned long *val);
-extern int pci_config_write(unsigned char bus, unsigned char dev, unsigned char func,
- unsigned char cmd, int len, unsigned long val);
- /* Fill array pci_list which must have size MAX_PCI_DEVICES
- and return 0 if sucessful */
-extern int pci_scan(pciinfo_t *pci_list,unsigned *num_card);
-
- /* Enables/disables accessing to IO space from application side.
- Should return 0 if o'k or errno on error. */
-extern int enable_app_io( void );
-extern int disable_app_io( void );
-
-extern unsigned char INPORT8(unsigned idx);
-extern unsigned short INPORT16(unsigned idx);
-extern unsigned INPORT32(unsigned idx);
-#define INPORT(idx) INPORT32(idx)
-extern void OUTPORT8(unsigned idx,unsigned char val);
-extern void OUTPORT16(unsigned idx,unsigned short val);
-extern void OUTPORT32(unsigned idx,unsigned val);
-#define OUTPORT(idx,val) OUTPORT32(idx,val)
-
-extern void * map_phys_mem(unsigned long base, unsigned long size);
-extern void unmap_phys_mem(void *ptr, unsigned long size);
-
-/* These are the region types */
-#define MTRR_TYPE_UNCACHABLE 0
-#define MTRR_TYPE_WRCOMB 1
-#define MTRR_TYPE_WRTHROUGH 4
-#define MTRR_TYPE_WRPROT 5
-#define MTRR_TYPE_WRBACK 6
-extern int mtrr_set_type(unsigned base,unsigned size,int type);
-
-/* Busmastering support */
- /* returns 0 if support exists else errno */
-extern int bm_open( void );
-extern void bm_close( void );
- /* Converts virtual memory addresses into physical
- returns 0 if OK else - errno
- parray should have enough length to accept length/page_size
- elements. virt_addr can be located in non-continious memory
- block and can be allocated by malloc(). (kmalloc() is not
- needed). Note: if you have some very old card which requires
- continous memory block then you need to implement bm_kmalloc
- bm_kfree functions here. NOTE2: to be sure that every page of
- region is present in physical memory (is not swapped out) use
- m(un)lock functions. Note3: Probably your card will want to
- have page-aligned block for DMA transfer so use
- memalign(PAGE_SIZE,mem_size) function to alloc such memory. */
-extern int bm_virt_to_phys( void * virt_addr, unsigned long length,
- unsigned long * parray );
- /* Converts virtual memory addresses into bus address
- Works in the same way as bm_virt_to_phys.
- WARNING: This function will be die after implementing
- bm_alloc_pci_shmem() because we really can't pass
- any memory address to card. Example: 64-bit linear address
- can't be passed into 32-bit card. Even more - some old
- cards can access 24-bit address space only */
-extern int bm_virt_to_bus( void * virt_addr, unsigned long length,
- unsigned long * barray );
-
- /* NOTE: bm_alloc_pci_shmem() and bm_free_pci_shmem()
- are still not implemented!
- arguments:
- pciinfo_t - specifies pci card for which memory should be shared
- bitness - can be 16,24,32,64 specifies addressing possibilities
- of the card
- length - specifies size of memory which should allocated
- op - specifies direction as combination flags TO_CARD,FROM_CARD
- Return value - should be tuned
- we need to have something like this:
- struct pci_shmem
- {
- void * handler;
- void * virt_addr
- void * array_of_bus_addr[];
- unsigned long length;
- }
- NOTE2: After finalizing of these functions bm_virt_to_bus() will be die */
-extern void * bm_alloc_pci_shmem(pciinfo_t *, unsigned mem_bitness, unsigned long length,int op );
-extern void bm_free_pci_shmem(void * pci_shmem);
-
-extern int bm_lock_mem( const void * addr, unsigned long length );
-extern int bm_unlock_mem( const void * addr, unsigned long length );
-
-/* HWIRQ support */
-
-extern int hwirq_install(int bus, int dev, int func,
- int areg, unsigned long aoff, uint32_t adata);
-extern int hwirq_wait(unsigned irqnum);
-extern int hwirq_uninstall(int bus, int dev, int func);
-
-/* CPU flushing support */
-extern void cpu_flush(void *va,unsigned long length);
-
-extern void libdha_exit(const char *message, int level);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/src/video_out/libdha/mmi.c b/src/video_out/libdha/mmi.c
deleted file mode 100644
index 39d21926a..000000000
--- a/src/video_out/libdha/mmi.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/* Memory manager interface */
-#include <stdio.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <sys/mman.h> /* mlock */
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include "libdha.h"
-#include "kernelhelper/dhahelper.h"
-
-static int libdha_fd=-1;
-
-#define ALLOWED_VER 0x10
-int bm_open( void )
-{
- int retv;
- libdha_fd = open("/dev/dhahelper",O_RDWR);
- retv = libdha_fd > 0 ? 0 : ENXIO;
- if(!retv)
- {
- int ver;
- ioctl(libdha_fd,DHAHELPER_GET_VERSION,&ver);
- if(ver < ALLOWED_VER)
- {
- printf("libdha: You have wrong version (%i) of /dev/dhahelper\n"
- "libdha: Please upgrade your driver up to ver=%i\n",ver,ALLOWED_VER);
- retv = EINVAL;
- close(libdha_fd);
- }
- }
- else printf("libdha: Can't open /dev/dhahelper\n");
- return retv;
-}
-
-void bm_close( void )
-{
- close(libdha_fd);
-}
-
-int bm_virt_to_phys( void * virt_addr, unsigned long length, unsigned long * parray )
-{
- dhahelper_vmi_t vmi;
- vmi.virtaddr = virt_addr;
- vmi.length = length;
- vmi.realaddr = parray;
- if(libdha_fd > 0) return ioctl(libdha_fd,DHAHELPER_VIRT_TO_PHYS,&vmi);
- return ENXIO;
-}
-
-int bm_virt_to_bus( void * virt_addr, unsigned long length, unsigned long * barray )
-{
- dhahelper_vmi_t vmi;
- vmi.virtaddr = virt_addr;
- vmi.length = length;
- vmi.realaddr = barray;
- if(libdha_fd > 0) return ioctl(libdha_fd,DHAHELPER_VIRT_TO_BUS,&vmi);
- return ENXIO;
-}
-
-void * bm_alloc_pci_shmem(pciinfo_t *pi, unsigned mem_bitness, unsigned long length,int op )
-{
- printf("libdha: Pure virtual function call - bm_alloc_pci_shmem()\n");
-#if 0
- dhahelper_mem_t vmi;
- vmi.length = length;
- if(libdha_fd > 0)
- {
- if(ioctl(libdha_fd,DHAHELPER_ALLOC_PA,&vmi) == 0)
- return vmi.addr;
- }
-#endif
- return NULL;
-}
-
-void bm_free_pci_shmem(void * pci_shmem)
-{
- printf("libdha: Pure virtual function call - bm_free_pci_shmem()\n");
-#if 0
- dhahelper_mem_t vmi;
- vmi.addr = virt_addr;
- vmi.length = length;
- if(libdha_fd > 0)
- {
- ioctl(libdha_fd,DHAHELPER_FREE_PA,&vmi);
- }
-#endif
-}
-
-int bm_lock_mem( const void *addr, unsigned long length )
-{
- dhahelper_mem_t vmi;
- vmi.addr = (void *) addr;
- vmi.length = length;
- if(libdha_fd > 0)
- {
- return ioctl(libdha_fd,DHAHELPER_LOCK_MEM,&vmi);
- }
- return mlock(addr,length);
-}
-
-int bm_unlock_mem( const void * addr, unsigned long length )
-{
- dhahelper_mem_t vmi;
- vmi.addr = (void *) addr;
- vmi.length = length;
- if(libdha_fd > 0)
- {
- return ioctl(libdha_fd,DHAHELPER_UNLOCK_MEM,&vmi);
- }
- return munlock(addr,length);
-}
diff --git a/src/video_out/libdha/mtrr.c b/src/video_out/libdha/mtrr.c
deleted file mode 100644
index 48ae5a1fd..000000000
--- a/src/video_out/libdha/mtrr.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- mtrr.c - Stuff for optimizing memory access
- Copyrights:
- 2002 - Linux version by Nick Kurshev
- Licence: GPL
-*/
-
-#include "config.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/ioctl.h>
-#include "kernelhelper/dhahelper.h"
-#include "libdha.h"
-
-#if defined (__i386__) && defined (__NetBSD__)
-#include <sys/param.h>
-#if __NetBSD_Version__ > 105240000
-#include <stdint.h>
-#include <stdlib.h>
-#include <machine/mtrr.h>
-#include <machine/sysarch.h>
-#endif
-#endif
-
-int mtrr_set_type(unsigned base,unsigned size,int type)
-{
- int dhahelper_fd;
- dhahelper_fd = open("/dev/dhahelper",O_RDWR);
- if(dhahelper_fd > 0)
- {
- int retval;
- dhahelper_mtrr_t mtrrs;
- mtrrs.operation = MTRR_OP_ADD;
- mtrrs.start = base;
- mtrrs.size = size;
- mtrrs.type = type;
- retval = ioctl(dhahelper_fd, DHAHELPER_ACK_IRQ, &mtrrs);
- close(dhahelper_fd);
- return retval;
- }
-#if defined (__NetBSD__) && (__NetBSD_Version__) > 105240000
- {
- struct mtrr *mtrrp;
- int n;
-
- mtrrp = malloc(sizeof (struct mtrr));
- mtrrp->base = base;
- mtrrp->len = size;
- mtrrp->type = type;
- mtrrp->flags = MTRR_VALID | MTRR_PRIVATE;
- n = 1;
-
- if (i386_set_mtrr(mtrrp, &n) < 0) {
- free(mtrrp);
- return errno;
- }
- free(mtrrp);
- return 0;
- }
-#else
- {
- FILE * mtrr_fd;
- char * stype;
- switch(type)
- {
- case MTRR_TYPE_UNCACHABLE: stype = "uncachable"; break;
- case MTRR_TYPE_WRCOMB: stype = "write-combining"; break;
- case MTRR_TYPE_WRTHROUGH: stype = "write-through"; break;
- case MTRR_TYPE_WRPROT: stype = "write-protect"; break;
- case MTRR_TYPE_WRBACK: stype = "write-back"; break;
- default: return EINVAL;
- }
- mtrr_fd = fopen("/proc/mtrr","wt");
- if(mtrr_fd)
- {
- char sout[256];
- unsigned wr_len;
- sprintf(sout,"base=0x%08X size=0x%08X type=%s\n",base,size,stype);
- wr_len = fprintf(mtrr_fd,"%s",sout);
- /*printf("MTRR: %s\n",sout);*/
- fclose(mtrr_fd);
- return wr_len == strlen(sout) ? 0 : EPERM;
- }
- }
-#endif
- return ENOSYS;
-}
diff --git a/src/video_out/libdha/oth/Makefile.am b/src/video_out/libdha/oth/Makefile.am
deleted file mode 100644
index 55651d233..000000000
--- a/src/video_out/libdha/oth/Makefile.am
+++ /dev/null
@@ -1,3 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-EXTRA_DIST = pci.db
diff --git a/src/video_out/libdha/oth/pci.db b/src/video_out/libdha/oth/pci.db
deleted file mode 100644
index 083b2892f..000000000
--- a/src/video_out/libdha/oth/pci.db
+++ /dev/null
@@ -1,9471 +0,0 @@
-v 0000 Gammagraphx, Inc. 0
-v 001a Ascend Communications, Inc. 0
-v 0033 Paradyne corp. 0
-v 003d Lockheed Martin-Marietta Corp 0
-v 0059 Tiger Jet Network Inc. (Wrong ID) 0 Real TJN ID is e159, but they got it wrong several times --mj
-v 0070 Hauppauge computer works Inc. 0
-d 00704000 WinTV PVR-350 0
-d 00704001 WinTV PVR-250 (v1) 0
-d 00704009 WinTV PVR-250 0
-d 00704801 WinTV PVR-250 MCE 0
-v 0071 Nebula Electronics Ltd. 0
-v 0095 Silicon Image, Inc. (Wrong ID) 0
-d 00950680 Ultra ATA/133 IDE RAID CONTROLLER CARD 0
-v 0100 Ncipher Corp Ltd 0
-v 018a LevelOne 0 018a is not LevelOne but there is a board misprogrammed
-d 018a0106 FPC-0106TX misprogrammed [RTL81xx] 0
-v 021b Compaq Computer Corporation 0 021b is not Compaq but there is a board misprogrammed
-d 021b8139 HNE-300 (RealTek RTL8139c) [iPaq Networking] 0
-v 0291 Davicom Semiconductor, Inc. 0 http://www.davicom.com.tw/
-d 02918212 DM9102A(DM9102AE, SM9102AF) Ethernet 100/10 MBit(Rev 40) 0
-v 02ac SpeedStream 0 SpeedStream is Efficient Networks, Inc, a Siemens Company
-d 02ac1012 1012 PCMCIA 10/100 Ethernet Card [RTL81xx] 0
-v 0357 TTTech AG 0
-d 0357000a TTP-Monitoring Card V2.0 0
-v 05e3 CyberDoor 0
-d 05e30701 CBD516 0
-v 0675 Dynalink 0
-d 06751700 IS64PH ISDN Adapter 0
-d 06751702 IS64PH ISDN Adapter 0
-v 0925 VIA Technologies, Inc. (Wrong ID) 0 Wrong ID used in subsystem ID of VIA USB controllers.
-v 09c1 Arris 0
-d 09c10704 CM 200E Cable Modem 0
-v 0a89 BREA Technologies Inc 0
-v 0b49 ASCII Corporation 0
-d 0b49064f Trance Vibrator 0 see http://homepage1.nifty.com/mcn/lab/machines/trance_vibrator/usbview.vib.txt
-v 0e11 Compaq Computer Corporation 0
-d 0e110001 PCI to EISA Bridge 0
-d 0e110002 PCI to ISA Bridge 0
-d 0e110046 Smart Array 64xx 0
-s 0e1100460e11409a Smart Array 641 0
-s 0e1100460e11409b Smart Array 642 0
-s 0e1100460e11409c Smart Array 6400 0
-s 0e1100460e11409d Smart Array 6400 EM 0
-d 0e110049 NC7132 Gigabit Upgrade Module 0
-d 0e11004a NC6136 Gigabit Server Adapter 0
-d 0e11007c NC7770 1000BaseTX 0
-d 0e11007d NC6770 1000BaseTX 0
-d 0e110085 NC7780 1000BaseTX 0
-d 0e1100bb NC7760 0
-d 0e1100ca NC7771 0
-d 0e1100cb NC7781 0
-d 0e1100cf NC7772 0
-d 0e1100d0 NC7782 0
-d 0e1100d1 NC7783 0
-d 0e1100e3 NC7761 0
-d 0e110508 Netelligent 4/16 Token Ring 0
-d 0e111000 Triflex/Pentium Bridge, Model 1000 0
-d 0e112000 Triflex/Pentium Bridge, Model 2000 0
-d 0e113032 QVision 1280/p 0
-d 0e113033 QVision 1280/p 0
-d 0e113034 QVision 1280/p 0
-d 0e114000 4000 [Triflex] 0
-d 0e114030 SMART-2/P 0
-d 0e114031 SMART-2SL 0
-d 0e114032 Smart Array 3200 0
-d 0e114033 Smart Array 3100ES 0
-d 0e114034 Smart Array 221 0
-d 0e114040 Integrated Array 0
-d 0e114048 Compaq Raid LC2 0
-d 0e114050 Smart Array 4200 0
-d 0e114051 Smart Array 4250ES 0
-d 0e114058 Smart Array 431 0
-d 0e114070 Smart Array 5300 0
-d 0e114080 Smart Array 5i 0
-d 0e114082 Smart Array 532 0
-d 0e114083 Smart Array 5312 0
-d 0e114091 Smart Array 6i 0
-d 0e11409a Smart Array 641 0
-d 0e11409b Smart Array 642 0
-d 0e11409c Smart Array 6400 0
-d 0e11409d Smart Array 6400 EM 0
-d 0e116010 HotPlug PCI Bridge 6010 0
-d 0e117020 USB Controller 0
-d 0e11a0ec Fibre Channel Host Controller 0
-d 0e11a0f0 Advanced System Management Controller 0
-d 0e11a0f3 Triflex PCI to ISA Bridge 0
-d 0e11a0f7 PCI Hotplug Controller 0
-s 0e11a0f78086002a PCI Hotplug Controller A 0
-s 0e11a0f78086002b PCI Hotplug Controller B 0
-d 0e11a0f8 ZFMicro Chipset USB 0
-d 0e11a0fc FibreChannel HBA Tachyon 0
-d 0e11ae10 Smart-2/P RAID Controller 0
-s 0e11ae100e114030 Smart-2/P Array Controller 0
-s 0e11ae100e114031 Smart-2SL Array Controller 0
-s 0e11ae100e114032 Smart Array Controller 0
-s 0e11ae100e114033 Smart 3100ES Array Controller 0
-d 0e11ae29 MIS-L 0
-d 0e11ae2a MPC 0
-d 0e11ae2b MIS-E 0
-d 0e11ae31 System Management Controller 0
-d 0e11ae32 Netelligent 10/100 TX PCI UTP 0
-d 0e11ae33 Triflex Dual EIDE Controller 0
-d 0e11ae34 Netelligent 10 T PCI UTP 0
-d 0e11ae35 Integrated NetFlex-3/P 0
-d 0e11ae40 Netelligent Dual 10/100 TX PCI UTP 0
-d 0e11ae43 Netelligent Integrated 10/100 TX UTP 0
-d 0e11ae69 CETUS-L 0
-d 0e11ae6c Northstar 0
-d 0e11ae6d NorthStar CPU to PCI Bridge 0
-d 0e11b011 Netelligent 10/100 TX Embedded UTP 0
-d 0e11b012 Netelligent 10 T/2 PCI UTP/Coax 0
-d 0e11b01e NC3120 Fast Ethernet NIC 0
-d 0e11b01f NC3122 Fast Ethernet NIC 0
-d 0e11b02f NC1120 Ethernet NIC 0
-d 0e11b030 Netelligent 10/100 TX UTP 0
-d 0e11b04a 10/100 TX PCI Intel WOL UTP Controller 0
-d 0e11b060 Smart Array 5300 Controller 0
-d 0e11b0c6 NC3161 Fast Ethernet NIC 0
-d 0e11b0c7 NC3160 Fast Ethernet NIC 0
-d 0e11b0d7 NC3121 Fast Ethernet NIC 0
-d 0e11b0dd NC3131 Fast Ethernet NIC 0
-d 0e11b0de NC3132 Fast Ethernet Module 0
-d 0e11b0df NC6132 Gigabit Module 0
-d 0e11b0e0 NC6133 Gigabit Module 0
-d 0e11b0e1 NC3133 Fast Ethernet Module 0
-d 0e11b123 NC6134 Gigabit NIC 0
-d 0e11b134 NC3163 Fast Ethernet NIC 0
-d 0e11b13c NC3162 Fast Ethernet NIC 0
-d 0e11b144 NC3123 Fast Ethernet NIC 0
-d 0e11b163 NC3134 Fast Ethernet NIC 0
-d 0e11b164 NC3165 Fast Ethernet Upgrade Module 0
-d 0e11b178 Smart Array 5i/532 0
-s 0e11b1780e114080 Smart Array 5i 0
-s 0e11b1780e114082 Smart Array 532 0
-s 0e11b1780e114083 Smart Array 5312 0
-d 0e11b1a4 NC7131 Gigabit Server Adapter 0
-d 0e11b200 Memory Hot-Plug Controller 0 HP Memory Hot-Plug Controller
-d 0e11b203 Integrated Lights Out Controller 0
-d 0e11b204 Integrated Lights Out Processor 0
-d 0e11f130 NetFlex-3/P ThunderLAN 1.0 0
-d 0e11f150 NetFlex-3/P ThunderLAN 2.3 0
-v 0e55 HaSoTec GmbH 0
-v 1000 LSI Logic / Symbios Logic 0 Formerly NCR
-d 10000001 53c810 0
-s 1000000110001000 LSI53C810AE PCI to SCSI I/O Processor 0
-d 10000002 53c820 0
-d 10000003 53c825 0
-s 1000000310001000 LSI53C825AE PCI to SCSI I/O Processor (Ultra Wide) 0
-d 10000004 53c815 0
-d 10000005 53c810AP 0
-d 10000006 53c860 0
-s 1000000610001000 LSI53C860E PCI to Ultra SCSI I/O Processor 0
-d 1000000a 53c1510 0
-s 1000000a10001000 LSI53C1510 PCI to Dual Channel Wide Ultra2 SCSI Controller (Nonintelligent mode) 0
-d 1000000b 53C896/897 0
-s 1000000b0e116004 EOB003 Series SCSI host adapter 0
-s 1000000b10001000 LSI53C896/7 PCI to Dual Channel Ultra2 SCSI Multifunction Controller 0
-s 1000000b10001010 LSI22910 PCI to Dual Channel Ultra2 SCSI host adapter 0
-s 1000000b10001020 LSI21002 PCI to Dual Channel Ultra2 SCSI host adapter 0
-s 1000000b13e91000 6221L-4U 0 multifunction PCI card: Dual U2W SCSI, dual 10/100TX, graphics
-d 1000000c 53c895 0
-s 1000000c10001010 LSI8951U PCI to Ultra2 SCSI host adapter 0
-s 1000000c10001020 LSI8952U PCI to Ultra2 SCSI host adapter 0
-s 1000000c1de13906 DC-390U2B SCSI adapter 0
-s 1000000c1de13907 DC-390U2W 0
-d 1000000d 53c885 0
-d 1000000f 53c875 0
-s 1000000f0e117004 Embedded Ultra Wide SCSI Controller 0
-s 1000000f10001000 LSI53C876/E PCI to Dual Channel SCSI Controller 0
-s 1000000f10001010 LSI22801 PCI to Dual Channel Ultra SCSI host adapter 0
-s 1000000f10001020 LSI22802 PCI to Dual Channel Ultra SCSI host adapter 0
-s 1000000f10928760 FirePort 40 Dual SCSI Controller 0
-s 1000000f1de13904 DC390F/U Ultra Wide SCSI Adapter 0
-s 1000000f4c531000 CC7/CR7/CP7/VC7/VP7/VR7 mainboard 0
-s 1000000f4c531050 CT7 mainboard 0
-d 10000010 53C1510 0
-s 100000100e114040 Integrated Array Controller 0
-s 100000100e114048 RAID LC2 Controller 0
-s 1000001010001000 53C1510 PCI to Dual Channel Wide Ultra2 SCSI Controller (Intelligent mode) 0
-d 10000012 53c895a 0
-s 1000001210001000 LSI53C895A PCI to Ultra2 SCSI Controller 0
-d 10000013 53c875a 0
-s 1000001310001000 LSI53C875A PCI to Ultra SCSI Controller 0
-d 10000020 53c1010 Ultra3 SCSI Adapter 0
-s 1000002010001000 LSI53C1010-33 PCI to Dual Channel Ultra160 SCSI Controller 0
-s 100000201de11020 DC-390U3W 0
-d 10000021 53c1010 66MHz Ultra3 SCSI Adapter 0
-s 1000002110001000 LSI53C1000/1000R/1010R/1010-66 PCI to Ultra160 SCSI Controller 0
-s 1000002110001010 Asus TR-DLS onboard 53C1010-66 0
-s 10000021124b1070 PMC-USCSI3 0
-s 100000214c531080 CT8 mainboard 0
-s 100000214c531300 P017 mezzanine (32-bit PMC) 0
-s 100000214c531310 P017 mezzanine (64-bit PMC) 0
-d 10000030 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI 0
-s 1000003010280123 PowerEdge 2600 0
-s 100000301028014a PowerEdge 1750 0
-s 100000301028016c PowerEdge 1850 MPT Fusion SCSI/RAID (Perc 4) 0
-s 1000003010281010 LSI U320 SCSI Controller 0
-d 10000031 53c1030ZC PCI-X Fusion-MPT Dual Ultra320 SCSI 0
-d 10000032 53c1035 PCI-X Fusion-MPT Dual Ultra320 SCSI 0
-s 1000003210001000 LSI53C1020/1030 PCI-X to Ultra320 SCSI Controller 0
-d 10000033 1030ZC_53c1035 PCI-X Fusion-MPT Dual Ultra320 SCSI 0
-d 10000040 53c1035 PCI-X Fusion-MPT Dual Ultra320 SCSI 0
-s 1000004010000033 MegaRAID SCSI 320-2XR 0
-s 1000004010000066 MegaRAID SCSI 320-2XRWS 0
-d 10000041 53C1035ZC PCI-X Fusion-MPT Dual Ultra320 SCSI 0
-d 1000008f 53c875J 0
-s 1000008f10928000 FirePort 40 SCSI Controller 0
-s 1000008f10928760 FirePort 40 Dual SCSI Host Adapter 0
-d 10000407 MegaRAID 0
-s 1000040710000530 MegaRAID 530 SCSI 320-0X RAID Controller 0
-s 1000040710000531 MegaRAID 531 SCSI 320-4X RAID Controller 0
-s 1000040710000532 MegaRAID 532 SCSI 320-2X RAID Controller 0
-s 1000040710280531 PowerEdge Expandable RAID Controller 4/QC 0
-s 1000040710280533 PowerEdge Expandable RAID Controller 4/QC 0
-s 1000040780860530 MegaRAID Intel RAID Controller SRCZCRX 0
-s 1000040780860532 MegaRAID Intel RAID Controller SRCU42X 0
-d 10000408 MegaRAID 0
-s 1000040810000001 MegaRAID SCSI 320-1E RAID Controller 0
-s 1000040810000002 MegaRAID SCSI 320-2E RAID Controller 0
-s 100004081025004d MegaRAID ACER ROMB-2E RAID Controller 0
-s 1000040810280001 PowerEdge RAID Controller PERC4e/SC 0
-s 1000040810280002 PowerEdge RAID Controller PERC4e/DC 0
-s 1000040817341065 FSC MegaRAID PCI Express ROMB 0
-s 1000040880860002 MegaRAID Intel RAID Controller SRCU42E 0
-d 10000409 MegaRAID 0
-s 1000040910003004 MegaRAID SATA 300-4X RAID Controller 0
-s 1000040910003008 MegaRAID SATA 300-8X RAID Controller 0
-s 1000040980863008 MegaRAID RAID Controller SRCS28X 0
-s 1000040980863431 MegaRAID RAID Controller Alief SROMBU42E 0
-s 1000040980863499 MegaRAID RAID Controller Harwich SROMBU42E 0
-d 10000621 FC909 Fibre Channel Adapter 0
-d 10000622 FC929 Fibre Channel Adapter 0
-s 1000062210001020 44929 O Dual Fibre Channel card 0
-d 10000623 FC929 LAN 0
-d 10000624 FC919 Fibre Channel Adapter 0
-d 10000625 FC919 LAN 0
-d 10000626 FC929X Fibre Channel Adapter 0
-s 1000062610001010 7202-XP-LC Dual Fibre Channel card 0
-d 10000627 FC929X LAN 0
-d 10000628 FC919X Fibre Channel Adapter 0
-d 10000629 FC919X LAN 0
-d 10000701 83C885 NT50 DigitalScape Fast Ethernet 0
-d 10000702 Yellowfin G-NIC gigabit ethernet 0
-s 1000070213180000 PEI100X 0
-d 10000804 SA2010 0
-d 10000805 SA2010ZC 0
-d 10000806 SA2020 0
-d 10000807 SA2020ZC 0
-d 10000901 61C102 0
-d 10001000 63C815 0
-d 10001960 MegaRAID 0
-s 1000196010000518 MegaRAID 518 SCSI 320-2 Controller 0
-s 1000196010000520 MegaRAID 520 SCSI 320-1 Controller 0
-s 1000196010000522 MegaRAID 522 i4 133 RAID Controller 0
-s 1000196010000523 MegaRAID SATA 150-6 RAID Controller 0
-s 1000196010004523 MegaRAID SATA 150-4 RAID Controller 0
-s 100019601000a520 MegaRAID ZCR SCSI 320-0 Controller 0
-s 1000196010280518 MegaRAID 518 DELL PERC 4/DC RAID Controller 0
-s 1000196010280520 MegaRAID 520 DELL PERC 4/SC RAID Controller 0
-s 1000196010280531 PowerEdge Expandable RAID Controller 4/QC 0
-s 1000196010280533 PowerEdge Expandable RAID Controller 4/QC 0
-s 1000196080860520 MegaRAIDRAID Controller SRCU41L 0
-s 1000196080860523 MegaRAID RAID Controller SRCS16 0
-v 1001 Kolter Electronic 0
-d 10010010 PCI 1616 Measurement card with 32 digital I/O lines 0
-d 10010011 OPTO-PCI Opto-Isolated digital I/O board 0
-d 10010012 PCI-AD/DA Analogue I/O board 0
-d 10010013 PCI-OPTO-RELAIS Digital I/O board with relay outputs 0
-d 10010014 PCI-Counter/Timer Counter Timer board 0
-d 10010015 PCI-DAC416 Analogue output board 0
-d 10010016 PCI-MFB Analogue I/O board 0
-d 10010017 PROTO-3 PCI Prototyping board 0
-d 10019100 INI-9100/9100W SCSI Host 0
-v 1002 ATI Technologies Inc 0
-d 10023150 M24 1P [Radeon Mobility X600] 0
-d 10023154 M24 1T [FireGL M24 GL] 0
-d 10023e50 RV380 0x3e50 [Radeon X600] 0
-d 10023e54 RV380 0x3e54 [FireGL V3200] 0
-d 10023e70 RV380 [Radeon X600] Secondary 0
-d 10024136 Radeon IGP 320 M 0
-d 10024137 Radeon IGP330/340/350 0
-d 10024144 R300 AD [Radeon 9500 Pro] 0
-d 10024145 R300 AE [Radeon 9700 Pro] 0 New PCI ID provided by ATI developer relations (correction to above)
-d 10024146 R300 AF [Radeon 9700 Pro] 0 New PCI ID provided by ATI developer relations (oops, correction to above)
-d 10024147 R300 AG [FireGL Z1/X1] 0
-d 10024148 R350 AH [Radeon 9800] 0
-d 10024149 R350 AI [Radeon 9800] 0
-d 1002414a R350 AJ [Radeon 9800] 0
-d 1002414b R350 AK [Fire GL X2] 0
-d 10024150 RV350 AP [Radeon 9600] 0 New PCI ID provided by ATI developer relations
-s 1002415010020002 R9600 Pro primary (Asus OEM for HP) 0
-s 1002415010020003 R9600 Pro secondary (Asus OEM for HP) 0
-s 1002415014584024 Giga-Byte GV-R96128D Primary 0
-s 10024150148c2064 PowerColor R96A-C3N 0
-s 10024150148c2066 PowerColor R96A-C3N 0
-s 10024150174b7c19 Sapphire Atlantis Radeon 9600 Pro 0
-s 10024150174b7c29 GC-R9600PRO Primary [Sapphire] 0
-s 1002415017ee2002 Radeon 9600 256Mb Primary 0
-s 1002415018bc0101 GC-R9600PRO Primary 0
-d 10024151 RV350 AQ [Radeon 9600] 0 New PCI ID provided by ATI developer relations
-s 100241511043c004 A9600SE 0
-d 10024152 RV350 AR [Radeon 9600] 0 New PCI ID provided by ATI developer relations
-s 1002415210020002 Radeon 9600XT 0
-s 100241521043c002 Radeon 9600 XT TVD 0
-d 10024153 RV350 AS [Radeon 9600 AS] 0
-d 10024154 RV350 AT [Fire GL T2] 0
-d 10024155 RV350 AU [Fire GL T2] 0
-d 10024156 RV350 AV [Fire GL T2] 0
-d 10024157 RV350 AW [Fire GL T2] 0
-d 10024158 68800AX [Mach32] 0
-d 10024164 R300 AD [Radeon 9500 Pro] (Secondary) 0 The PCI ID is unrelated to any DVI output.
-d 10024165 R300 AE [Radeon 9700 Pro] (Secondary) 0 New PCI ID info provided by ATI developer relations
-d 10024166 R300 AF [Radeon 9700 Pro] (Secondary) 0 New PCI ID info provided by ATI developer relations
-d 10024168 Radeon R350 [Radeon 9800] (Secondary) 0 New PCI ID provided by ATI developer relations
-d 10024170 RV350 AP [Radeon 9600] (Secondary) 0 New PCI ID provided by ATI developer relations (correction to above)
-s 1002417014584025 Giga-Byte GV-R96128D Secondary 0
-s 10024170148c2067 PowerColor R96A-C3N (Secondary) 0
-s 10024170174b7c28 GC-R9600PRO Secondary [Sapphire] 0
-s 1002417017ee2003 Radeon 9600 256Mb Secondary 0
-s 1002417018bc0100 GC-R9600PRO Secondary 0
-d 10024171 RV350 AQ [Radeon 9600] (Secondary) 0 New PCI ID provided by ATI developer relations (correction to above)
-s 100241711043c005 A9600SE (Secondary) 0
-d 10024172 RV350 AR [Radeon 9600] (Secondary) 0 New PCI ID provided by ATI developer relations (correction to above)
-s 1002417210020003 Radeon 9600XT (Secondary) 0
-s 100241721043c003 A9600XT (Secondary) 0
-d 10024173 RV350 ?? [Radeon 9550] (Secondary) 0
-d 10024237 Radeon 7000 IGP 0
-d 10024242 R200 BB [Radeon All in Wonder 8500DV] 0
-s 10024242100202aa Radeon 8500 AIW DV Edition 0
-d 10024243 R200 BC [Radeon All in Wonder 8500] 0
-d 10024336 Radeon Mobility U1 0
-s 10024336103c0024 Pavilion ze4400 builtin Video 0
-d 10024337 Radeon IGP 330M/340M/350M 0
-s 100243371014053a ThinkPad R40e (2684-HVG) builtin VGA controller 0
-s 10024337103c0850 Radeon IGP 345M 0
-d 10024341 IXP150 AC'97 Audio Controller 0
-d 10024345 EHCI USB Controller 0
-d 10024347 OHCI USB Controller #1 0
-d 10024348 OHCI USB Controller #2 0
-d 1002434d IXP AC'97 Modem 0
-d 10024353 ATI SMBus 0 Radeon 9100 IGP integrated
-d 10024354 215CT [Mach64 CT] 0
-d 10024358 210888CX [Mach64 CX] 0
-d 10024437 Radeon Mobility 7000 IGP 0
-d 10024554 210888ET [Mach64 ET] 0
-d 10024654 Mach64 VT 0
-d 10024742 3D Rage Pro AGP 1X/2X 0
-s 1002474210020040 Rage Pro Turbo AGP 2X 0
-s 1002474210020044 Rage Pro Turbo AGP 2X 0
-s 1002474210020061 Rage Pro AIW AGP 2X 0
-s 1002474210020062 Rage Pro AIW AGP 2X 0
-s 1002474210020063 Rage Pro AIW AGP 2X 0
-s 1002474210020080 Rage Pro Turbo AGP 2X 0
-s 1002474210020084 Rage Pro Turbo AGP 2X 0
-s 1002474210024742 Rage Pro Turbo AGP 2X 0
-s 1002474210028001 Rage Pro Turbo AGP 2X 0
-s 1002474210280082 Rage Pro Turbo AGP 2X 0
-s 1002474210284082 Optiplex GX1 Onboard Display Adapter 0
-s 1002474210288082 Rage Pro Turbo AGP 2X 0
-s 100247421028c082 Rage Pro Turbo AGP 2X 0
-s 1002474280864152 Xpert 98D AGP 2X 0
-s 100247428086464a Rage Pro Turbo AGP 2X 0
-d 10024744 3D Rage Pro AGP 1X 0
-s 1002474410024744 Rage Pro Turbo AGP 0
-d 10024747 3D Rage Pro 0
-d 10024749 3D Rage Pro 0
-s 1002474910020061 Rage Pro AIW 0
-s 1002474910020062 Rage Pro AIW 0
-d 1002474c Rage XC 0
-d 1002474d Rage XL AGP 2X 0
-s 1002474d10020004 Xpert 98 RXL AGP 2X 0
-s 1002474d10020008 Xpert 98 RXL AGP 2X 0
-s 1002474d10020080 Rage XL AGP 2X 0
-s 1002474d10020084 Xpert 98 AGP 2X 0
-s 1002474d1002474d Rage XL AGP 0
-s 1002474d1033806a Rage XL AGP 0
-d 1002474e Rage XC AGP 0
-s 1002474e1002474e Rage XC AGP 0
-d 1002474f Rage XL 0
-s 1002474f10020008 Rage XL 0
-s 1002474f1002474f Rage XL 0
-d 10024750 3D Rage Pro 215GP 0
-s 1002475010020040 Rage Pro Turbo 0
-s 1002475010020044 Rage Pro Turbo 0
-s 1002475010020080 Rage Pro Turbo 0
-s 1002475010020084 Rage Pro Turbo 0
-s 1002475010024750 Rage Pro Turbo 0
-d 10024751 3D Rage Pro 215GQ 0
-d 10024752 Rage XL 0
-s 1002475210020008 Rage XL 0
-s 1002475210024752 Rage XL 0
-s 1002475210028008 Rage XL 0
-s 10024752102800ce PowerEdge 1400 0
-s 10024752102800d1 PowerEdge 2550 0
-s 10024752102800d9 PowerEdge 2500 0
-s 1002475280863411 SDS2 Mainboard 0
-s 1002475280863427 S875WP1-E mainboard 0
-d 10024753 Rage XC 0
-s 1002475310024753 Rage XC 0
-d 10024754 3D Rage I/II 215GT [Mach64 GT] 0
-d 10024755 3D Rage II+ 215GTB [Mach64 GTB] 0
-d 10024756 3D Rage IIC 215IIC [Mach64 GT IIC] 0
-s 1002475610024756 Rage IIC 0
-d 10024757 3D Rage IIC AGP 0
-s 1002475710024757 Rage IIC AGP 0
-s 1002475710280089 Rage 3D IIC 0
-s 1002475710284082 Rage 3D IIC 0
-s 1002475710288082 Rage 3D IIC 0
-s 100247571028c082 Rage 3D IIC 0
-d 10024758 210888GX [Mach64 GX] 0
-d 10024759 3D Rage IIC 0
-d 1002475a 3D Rage IIC AGP 0
-s 1002475a10020084 Rage 3D Pro AGP 2x XPERT 98 0
-s 1002475a10020087 Rage 3D IIC 0
-s 1002475a1002475a Rage IIC AGP 0
-d 10024964 Radeon RV250 Id [Radeon 9000] 0
-d 10024965 Radeon RV250 Ie [Radeon 9000] 0
-d 10024966 Radeon RV250 If [Radeon 9000] 0
-s 1002496610f10002 RV250 If [Tachyon G9000 PRO] 0
-s 10024966148c2039 RV250 If [Radeon 9000 Pro "Evil Commando"] 0
-s 1002496615099a00 RV250 If [Radeon 9000 "AT009"] 0
-s 1002496616810040 RV250 If [3D prophet 9000] 0 New subdevice - 3D Prophet 9000 PCI by Hercules. AGP version probably would have same ID, so not specified.
-s 10024966174b7176 RV250 If [Sapphire Radeon 9000 Pro] 0
-s 10024966174b7192 RV250 If [Radeon 9000 "Atlantis"] 0
-s 1002496617af2005 RV250 If [Excalibur Radeon 9000 Pro] 0
-s 1002496617af2006 RV250 If [Excalibur Radeon 9000] 0
-d 10024967 Radeon RV250 Ig [Radeon 9000] 0
-d 1002496e Radeon RV250 [Radeon 9000] (Secondary) 0
-d 10024a48 R420 JH [Radeon X800] 0
-d 10024a49 R420 JI [Radeon X800PRO] 0
-d 10024a4a R420 JJ [Radeon X800SE] 0
-d 10024a4b R420 JK [Radeon X800] 0
-d 10024a4c R420 JL [Radeon X800] 0
-d 10024a4d R420 JM [FireGL X3] 0
-d 10024a4e M18 JN [Radeon Mobility 9800] 0
-d 10024a50 R420 JP [Radeon X800XT] 0
-d 10024a70 R420 [X800XT-PE] (Secondary) 0
-d 10024c42 3D Rage LT Pro AGP-133 0
-s 10024c420e11b0e7 Rage LT Pro (Compaq Presario 5240) 0
-s 10024c420e11b0e8 Rage 3D LT Pro 0
-s 10024c420e11b10e 3D Rage LT Pro (Compaq Armada 1750) 0
-s 10024c4210020040 Rage LT Pro AGP 2X 0
-s 10024c4210020044 Rage LT Pro AGP 2X 0
-s 10024c4210024c42 Rage LT Pro AGP 2X 0
-s 10024c4210028001 Rage LT Pro AGP 2X 0
-s 10024c4210280085 Rage 3D LT Pro 0
-d 10024c44 3D Rage LT Pro AGP-66 0
-d 10024c45 Rage Mobility M3 AGP 0
-d 10024c46 Rage Mobility M3 AGP 2x 0
-s 10024c46102800b1 Latitude C600 0
-d 10024c47 3D Rage LT-G 215LG 0
-d 10024c49 3D Rage LT Pro 0
-s 10024c4910020004 Rage LT Pro 0
-s 10024c4910020040 Rage LT Pro 0
-s 10024c4910020044 Rage LT Pro 0
-s 10024c4910024c49 Rage LT Pro 0
-d 10024c4d Rage Mobility P/M AGP 2x 0
-s 10024c4d0e11b111 Armada M700 0
-s 10024c4d0e11b160 Armada E500 0
-s 10024c4d10020084 Xpert 98 AGP 2X (Mobility) 0
-s 10024c4d10140154 ThinkPad A20m 0
-s 10024c4d102800aa Latitude CPt 0
-d 10024c4e Rage Mobility L AGP 2x 0
-d 10024c50 3D Rage LT Pro 0
-s 10024c5010024c50 Rage LT Pro 0
-d 10024c51 3D Rage LT Pro 0
-d 10024c52 Rage Mobility P/M 0
-s 10024c5210338112 Versa Note VXi 0
-d 10024c53 Rage Mobility L 0
-d 10024c54 264LT [Mach64 LT] 0
-d 10024c57 Radeon Mobility M7 LW [Radeon Mobility 7500] 0
-s 10024c5710140517 ThinkPad T30 0
-s 10024c57102800e6 Radeon Mobility M7 LW (Dell Inspiron 8100) 0
-s 10024c571028012a Latitude C640 0
-s 10024c57144dc006 Radeon Mobility M7 LW in vpr Matrix 170B4 0
-d 10024c58 Radeon RV200 LX [Mobility FireGL 7800 M7] 0
-d 10024c59 Radeon Mobility M6 LY 0
-s 10024c5910140235 ThinkPad A30/A30p (2652/2653) 0
-s 10024c5910140239 ThinkPad X22/X23/X24 0
-s 10024c59104d80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP 0
-d 10024c5a Radeon Mobility M6 LZ 0
-d 10024c64 Radeon R250 Ld [Radeon Mobility 9000 M9] 0
-d 10024c65 Radeon R250 Le [Radeon Mobility 9000 M9] 0
-d 10024c66 Radeon R250 Lf [FireGL 9000] 0
-d 10024c67 Radeon R250 Lg [Radeon Mobility 9000 M9] 0
-d 10024c6e Radeon R250 Ln [Radeon Mobility 9000 M9] [Secondary] 0 Secondary chip to the Lf
-d 10024d46 Rage Mobility M4 AGP 0
-d 10024d4c Rage Mobility M4 AGP 0
-d 10024e44 Radeon R300 ND [Radeon 9700 Pro] 0
-d 10024e45 Radeon R300 NE [Radeon 9500 Pro] 0
-s 10024e4510020002 Radeon R300 NE [Radeon 9500 Pro] 0
-s 10024e4516810002 Hercules 3D Prophet 9500 PRO [Radeon 9500 Pro] 0
-d 10024e46 RV350 NF [Radeon 9600] 0 New PCI ID provided by ATI developer relations (correction to above)
-d 10024e47 Radeon R300 NG [FireGL X1] 0
-d 10024e48 Radeon R350 [Radeon 9800 Pro] 0 (added pro)
-d 10024e49 Radeon R350 [Radeon 9800] 0 New PCI ID provided by ATI developer relations
-d 10024e4a RV350 NJ [Radeon 9800 XT] 0
-d 10024e4b R350 NK [Fire GL X2] 0
-d 10024e50 RV350 [Mobility Radeon 9600 M10] 0 New PCI ID provided by ATI developer relations
-s 10024e501025005a TravelMate 290 0
-s 10024e50103c0890 NC6000 laptop 0
-s 10024e5017341055 Amilo M1420W 0
-d 10024e51 M10 NQ [Radeon Mobility 9600] 0
-d 10024e52 RV350 [Mobility Radeon 9600 M10] 0
-d 10024e53 M10 NS [Radeon Mobility 9600] 0
-d 10024e54 M10 NT [FireGL Mobility T2] 0
-d 10024e56 M11 NV [FireGL Mobility T2e] 0
-d 10024e64 Radeon R300 [Radeon 9700 Pro] (Secondary) 0
-d 10024e65 Radeon R300 [Radeon 9500 Pro] (Secondary) 0
-s 10024e6510020003 Radeon R300 NE [Radeon 9500 Pro] 0
-s 10024e6516810003 Hercules 3D Prophet 9500 PRO [Radeon 9500 Pro] (Secondary) 0
-d 10024e66 RV350 NF [Radeon 9600] (Secondary) 0 New PCI ID provided by ATI developer relations (correction to above)
-d 10024e67 Radeon R300 [FireGL X1] (Secondary) 0
-d 10024e68 Radeon R350 [Radeon 9800 Pro] (Secondary) 0 (added pro)
-d 10024e69 Radeon R350 [Radeon 9800] (Secondary) 0 New PCI ID provided by ATI developer relations
-d 10024e6a RV350 NJ [Radeon 9800 XT] (Secondary) 0
-d 10025041 Rage 128 PA/PRO 0
-d 10025042 Rage 128 PB/PRO AGP 2x 0
-d 10025043 Rage 128 PC/PRO AGP 4x 0
-d 10025044 Rage 128 PD/PRO TMDS 0
-s 1002504410020028 Rage 128 AIW 0
-s 1002504410020029 Rage 128 AIW 0
-d 10025045 Rage 128 PE/PRO AGP 2x TMDS 0
-d 10025046 Rage 128 PF/PRO AGP 4x TMDS 0
-s 1002504610020004 Rage Fury Pro 0
-s 1002504610020008 Rage Fury Pro/Xpert 2000 Pro 0
-s 1002504610020014 Rage Fury Pro 0
-s 1002504610020018 Rage Fury Pro/Xpert 2000 Pro 0
-s 1002504610020028 Rage 128 Pro AIW AGP 0
-s 100250461002002a Rage 128 Pro AIW AGP 0
-s 1002504610020048 Rage Fury Pro 0
-s 1002504610022000 Rage Fury MAXX AGP 4x (TMDS) (VGA device) 0
-s 1002504610022001 Rage Fury MAXX AGP 4x (TMDS) (Extra device?!) 0
-d 10025047 Rage 128 PG/PRO 0
-d 10025048 Rage 128 PH/PRO AGP 2x 0
-d 10025049 Rage 128 PI/PRO AGP 4x 0
-d 1002504a Rage 128 PJ/PRO TMDS 0
-d 1002504b Rage 128 PK/PRO AGP 2x TMDS 0
-d 1002504c Rage 128 PL/PRO AGP 4x TMDS 0
-d 1002504d Rage 128 PM/PRO 0
-d 1002504e Rage 128 PN/PRO AGP 2x 0
-d 1002504f Rage 128 PO/PRO AGP 4x 0
-d 10025050 Rage 128 PP/PRO TMDS [Xpert 128] 0
-s 1002505010020008 Xpert 128 0
-d 10025051 Rage 128 PQ/PRO AGP 2x TMDS 0
-d 10025052 Rage 128 PR/PRO AGP 4x TMDS 0
-d 10025053 Rage 128 PS/PRO 0
-d 10025054 Rage 128 PT/PRO AGP 2x 0
-d 10025055 Rage 128 PU/PRO AGP 4x 0
-d 10025056 Rage 128 PV/PRO TMDS 0
-d 10025057 Rage 128 PW/PRO AGP 2x TMDS 0
-d 10025058 Rage 128 PX/PRO AGP 4x TMDS 0
-d 10025144 Radeon R100 QD [Radeon 7200] 0
-s 1002514410020008 Radeon 7000/Radeon VE 0
-s 1002514410020009 Radeon 7000/Radeon 0
-s 100251441002000a Radeon 7000/Radeon 0
-s 100251441002001a Radeon 7000/Radeon 0
-s 1002514410020029 Radeon AIW 0
-s 1002514410020038 Radeon 7000/Radeon 0
-s 1002514410020039 Radeon 7000/Radeon 0
-s 100251441002008a Radeon 7000/Radeon 0
-s 10025144100200ba Radeon 7000/Radeon 0
-s 1002514410020139 Radeon 7000/Radeon 0
-s 100251441002028a Radeon 7000/Radeon 0
-s 10025144100202aa Radeon AIW 0
-s 100251441002053a Radeon 7000/Radeon 0
-d 10025145 Radeon R100 QE 0
-d 10025146 Radeon R100 QF 0
-d 10025147 Radeon R100 QG 0
-d 10025148 Radeon R200 QH [Radeon 8500] 0
-s 100251481002010a FireGL 8800 64Mb 0
-s 1002514810020152 FireGL 8800 128Mb 0
-s 1002514810020162 FireGL 8700 32Mb 0
-s 1002514810020172 FireGL 8700 64Mb 0
-d 10025149 Radeon R200 QI 0
-d 1002514a Radeon R200 QJ 0
-d 1002514b Radeon R200 QK 0
-d 1002514c Radeon R200 QL [Radeon 8500 LE] 0
-s 1002514c1002003a Radeon R200 QL [Radeon 8500 LE] 0
-s 1002514c1002013a Radeon 8500 0
-s 1002514c148c2026 R200 QL [Radeon 8500 Evil Master II Multi Display Edition] 0
-s 1002514c16810010 Radeon 8500 [3D Prophet 8500 128Mb] 0
-s 1002514c174b7149 Radeon R200 QL [Sapphire Radeon 8500 LE] 0
-d 1002514d Radeon R200 QM [Radeon 9100] 0
-d 1002514e Radeon R200 QN [Radeon 8500LE] 0
-d 1002514f Radeon R200 QO [Radeon 8500LE] 0
-d 10025154 R200 QT [Radeon 8500] 0
-d 10025155 R200 QU [Radeon 9100] 0
-d 10025157 Radeon RV200 QW [Radeon 7500] 0
-s 100251571002013a Radeon 7500 0
-s 100251571002103a Dell Optiplex GX260 0
-s 1002515714584000 RV200 QW [RADEON 7500 PRO MAYA AR] 0
-s 10025157148c2024 RV200 QW [Radeon 7500LE Dual Display] 0
-s 10025157148c2025 RV200 QW [Radeon 7500 Evil Master Multi Display Edition] 0
-s 10025157148c2036 RV200 QW [Radeon 7500 PCI Dual Display] 0
-s 10025157174b7146 RV200 QW [Radeon 7500 LE] 0
-s 10025157174b7147 RV200 QW [Sapphire Radeon 7500LE] 0
-s 10025157174b7161 Radeon RV200 QW [Radeon 7500 LE] 0
-s 1002515717af0202 RV200 QW [Excalibur Radeon 7500LE] 0
-d 10025158 Radeon RV200 QX [Radeon 7500] 0
-d 10025159 Radeon RV100 QY [Radeon 7000/VE] 0
-s 100251591002000a Radeon 7000/Radeon VE 0
-s 100251591002000b Radeon 7000 0
-s 1002515910020038 Radeon 7000/Radeon VE 0
-s 100251591002003a Radeon 7000/Radeon VE 0
-s 10025159100200ba Radeon 7000/Radeon VE 0
-s 100251591002013a Radeon 7000/Radeon VE 0
-s 1002515914584002 RV100 QY [RADEON 7000 PRO MAYA AV Series] 0
-s 10025159148c2003 RV100 QY [Radeon 7000 Multi-Display Edition] 0
-s 10025159148c2023 RV100 QY [Radeon 7000 Evil Master Multi-Display] 0
-s 10025159174b7112 RV100 QY [Sapphire Radeon VE 7000] 0
-s 10025159174b7c28 Sapphire Radeon VE 7000 DDR 0
-s 1002515917870202 RV100 QY [Excalibur Radeon 7000] 0
-d 1002515a Radeon RV100 QZ [Radeon 7000/VE] 0
-d 10025168 Radeon R200 Qh 0
-d 10025169 Radeon R200 Qi 0
-d 1002516a Radeon R200 Qj 0
-d 1002516b Radeon R200 Qk 0
-d 1002516c Radeon R200 Ql 0 This one is not in ATI documentation, but is in XFree86 source code
-d 10025245 Rage 128 RE/SG 0
-s 1002524510020008 Xpert 128 0
-s 1002524510020028 Rage 128 AIW 0
-s 1002524510020029 Rage 128 AIW 0
-s 1002524510020068 Rage 128 AIW 0
-d 10025246 Rage 128 RF/SG AGP 0
-s 1002524610020004 Magnum/Xpert 128/Xpert 99 0
-s 1002524610020008 Magnum/Xpert128/X99/Xpert2000 0
-s 1002524610020028 Rage 128 AIW AGP 0
-s 1002524610020044 Rage Fury/Xpert 128/Xpert 2000 0
-s 1002524610020068 Rage 128 AIW AGP 0
-s 1002524610020448 Rage Fury 0
-d 10025247 Rage 128 RG 0
-d 1002524b Rage 128 RK/VR 0
-d 1002524c Rage 128 RL/VR AGP 0
-s 1002524c10020008 Xpert 99/Xpert 2000 0
-s 1002524c10020088 Xpert 99 0
-d 10025345 Rage 128 SE/4x 0
-d 10025346 Rage 128 SF/4x AGP 2x 0
-s 1002534610020048 RAGE 128 16MB VGA TVOUT AMC PAL 0
-d 10025347 Rage 128 SG/4x AGP 4x 0
-d 10025348 Rage 128 SH 0
-d 1002534b Rage 128 SK/4x 0
-d 1002534c Rage 128 SL/4x AGP 2x 0
-d 1002534d Rage 128 SM/4x AGP 4x 0
-s 1002534d10020008 Xpert 99/Xpert 2000 0
-s 1002534d10020018 Xpert 2000 0
-d 1002534e Rage 128 4x 0
-d 10025354 Mach 64 VT 0
-s 1002535410025654 Mach 64 reference 0
-d 10025446 Rage 128 Pro Ultra TF 0
-s 1002544610020004 Rage Fury Pro 0
-s 1002544610020008 Rage Fury Pro/Xpert 2000 Pro 0
-s 1002544610020018 Rage Fury Pro/Xpert 2000 Pro 0
-s 1002544610020028 Rage 128 AIW Pro AGP 0
-s 1002544610020029 Rage 128 AIW 0
-s 100254461002002a Rage 128 AIW Pro AGP 0
-s 100254461002002b Rage 128 AIW 0
-s 1002544610020048 Xpert 2000 Pro 0
-d 1002544c Rage 128 Pro Ultra TL 0
-d 10025452 Rage 128 Pro Ultra TR 0
-s 100254521002001c Rage 128 Pro 4XL 0
-s 10025452103c1279 Rage 128 Pro 4XL 0
-d 10025453 Rage 128 Pro Ultra TS 0
-d 10025454 Rage 128 Pro Ultra TT 0
-d 10025455 Rage 128 Pro Ultra TU 0
-d 10025460 M22 [Radeon Mobility M300] 0
-d 10025464 M22 [FireGL GL] 0
-d 10025548 R423 UH [Radeon X800 (PCIE)] 0
-d 10025549 R423 UI [Radeon X800PRO (PCIE)] 0
-d 1002554a R423 UJ [Radeon X800LE (PCIE)] 0
-d 1002554b R423 UK [Radeon X800SE (PCIE)] 0
-d 10025551 R423 UQ [FireGL V7200 (PCIE)] 0
-d 10025552 R423 UR [FireGL V5100 (PCIE)] 0
-d 10025554 R423 UT [FireGL V7100 (PCIE)] 0
-d 1002556b Radeon R423 UK (PCIE) [X800 SE] (Secondary) 0
-d 10025654 264VT [Mach64 VT] 0
-s 1002565410025654 Mach64VT Reference 0
-d 10025655 264VT3 [Mach64 VT3] 0
-d 10025656 264VT4 [Mach64 VT4] 0
-d 10025830 RS300 Host Bridge 0
-d 10025831 RS300 Host Bridge 0
-d 10025832 RS300 Host Bridge 0
-d 10025833 Radeon 9100 IGP Host Bridge 0
-d 10025834 Radeon 9100 IGP 0
-d 10025835 RS300M AGP [Radeon Mobility 9100IGP] 0
-d 10025838 Radeon 9100 IGP AGP Bridge 0
-d 10025941 RV280 [Radeon 9200] (Secondary) 0
-s 10025941174b7c12 Sapphire Radeon 9200 0
-s 1002594117af200d Excalibur Radeon 9200 0 http://www.hightech.com.hk/html/9200.htm
-s 1002594118bc0050 GeXcube GC-R9200-C3 (Secondary) 0
-d 10025944 RV280 [Radeon 9200 SE (PCI)] 0
-d 10025960 RV280 [Radeon 9200 PRO] 0
-d 10025961 RV280 [Radeon 9200] 0
-s 1002596110022f72 All-in-Wonder 9200 Series 0
-s 1002596112ab5961 YUAN SMARTVGA Radeon 9200 0
-s 1002596114584018 Gigabyte Radeon 9200 0
-s 10025961174b7c13 Sapphire Radeon 9200 0
-s 1002596117af200c Excalibur Radeon 9200 0 http://www.hightech.com.hk/html/9200.htm
-s 1002596118bc0050 Radeon 9200 Game Buster 0
-s 1002596118bc0051 GeXcube GC-R9200-C3 0
-s 1002596118bc0053 Radeon 9200 Game Buster VIVO 0
-d 10025962 RV280 [Radeon 9200] 0
-d 10025964 RV280 [Radeon 9200 SE] 0
-s 100259641043c006 ASUS Radeon 9200 SE / TD / 128M 0
-s 1002596414584018 Radeon 9200 SE 0
-s 10025964148c2073 CN-AG92E 0
-s 10025964174b7c13 Sapphire Radeon 9200 SE 0
-s 1002596417875964 Excalibur 9200SE VIVO 128M 0
-s 1002596417af2012 Radeon 9200 SE Excalibur 0
-s 1002596418bc0170 Sapphire Radeon 9200 SE 128MB Game Buster 0
-s 1002596418bc0173 GC-R9200L(SE)-C3H [Radeon 9200 Game Buster] 0 128MB DDR, DVI/VGA/TV out
-d 10025b60 RV370 5B60 [Radeon X300 (PCIE)] 0
-s 10025b601043002a EAX300SE 0
-d 10025b62 RV370 5B62 [Radeon X600 (PCIE)] 0
-d 10025b64 RV370 5B64 [FireGL V3100 (PCIE)] 0
-d 10025b65 RV370 5B65 [FireGL D1100 (PCIE)] 0
-d 10025c61 M9+ 5C61 [Radeon Mobility 9200 (AGP)] 0
-d 10025c63 M9+ 5C63 [Radeon Mobility 9200 (AGP)] 0
-d 10025d44 RV280 [Radeon 9200 SE] (Secondary) 0
-s 10025d4414584019 Radeon 9200 SE (Secondary) 0
-s 10025d44174b7c12 Sapphire Radeon 9200 SE (Secondary) 0
-s 10025d4417875965 Excalibur 9200SE VIVO 128M (Secondary) 0
-s 10025d4417af2013 Radeon 9200 SE Excalibur (Secondary) 0
-s 10025d4418bc0171 Radeon 9200 SE 128MB Game Buster (Secondary) 0
-s 10025d4418bc0172 GC-R9200L(SE)-C3H [Radeon 9200 Game Buster] 0
-d 10025d57 R423 5F57 [Radeon X800XT (PCIE)] 0
-d 1002700f PCI Bridge [IGP 320M] 0
-d 10027010 PCI Bridge [IGP 340M] 0
-d 10027834 Radeon 9100 PRO IGP 0
-d 10027835 Radeon Mobility 9200 IGP 0
-d 10027c37 RV350 AQ [Radeon 9600 SE] 0
-d 1002cab0 AGP Bridge [IGP 320M] 0
-d 1002cab2 RS200/RS200M AGP Bridge [IGP 340M] 0
-d 1002cbb2 RS200/RS200M AGP Bridge [IGP 340M] 0
-v 1003 ULSI Systems 0
-d 10030201 US201 0
-v 1004 VLSI Technology Inc 0
-d 10040005 82C592-FC1 0
-d 10040006 82C593-FC1 0
-d 10040007 82C594-AFC2 0
-d 10040008 82C596/7 [Wildcat] 0
-d 10040009 82C597-AFC2 0
-d 1004000c 82C541 [Lynx] 0
-d 1004000d 82C543 [Lynx] 0
-d 10040101 82C532 0
-d 10040102 82C534 [Eagle] 0
-d 10040103 82C538 0
-d 10040104 82C535 0
-d 10040105 82C147 0
-d 10040200 82C975 0
-d 10040280 82C925 0
-d 10040304 QSound ThunderBird PCI Audio 0
-s 1004030410040304 QSound ThunderBird PCI Audio 0
-s 10040304122d1206 DSP368 Audio 0
-s 1004030414835020 XWave Thunder 3D Audio 0
-d 10040305 QSound ThunderBird PCI Audio Gameport 0
-s 1004030510040305 QSound ThunderBird PCI Audio Gameport 0
-s 10040305122d1207 DSP368 Audio Gameport 0
-s 1004030514835021 XWave Thunder 3D Audio Gameport 0
-d 10040306 QSound ThunderBird PCI Audio Support Registers 0
-s 1004030610040306 QSound ThunderBird PCI Audio Support Registers 0
-s 10040306122d1208 DSP368 Audio Support Registers 0
-s 1004030614835022 XWave Thunder 3D Audio Support Registers 0
-d 10040307 Thunderbird 0
-d 10040308 Thunderbird 0
-d 10040702 VAS96011 [Golden Gate II] 0
-d 10040703 Tollgate 0
-v 1005 Avance Logic Inc. [ALI] 0
-d 10052064 ALG2032/2064 0
-d 10052128 ALG2364A 0
-d 10052301 ALG2301 0
-d 10052302 ALG2302 0
-d 10052364 ALG2364 0
-d 10052464 ALG2364A 0
-d 10052501 ALG2564A/25128A 0
-v 1006 Reply Group 0
-v 1007 NetFrame Systems Inc 0
-v 1008 Epson 0
-v 100a Phoenix Technologies 0
-v 100b National Semiconductor Corporation 0
-d 100b0001 DP83810 0
-d 100b0002 87415/87560 IDE 0
-d 100b000e 87560 Legacy I/O 0
-d 100b000f FireWire Controller 0
-d 100b0011 NS87560 National PCI System I/O 0
-d 100b0012 USB Controller 0
-d 100b0020 DP83815 (MacPhyter) Ethernet Controller 0
-s 100b0020103c0024 Pavilion ze4400 builtin Network 0
-s 100b00201385f311 FA311 / FA312 (FA311 with WoL HW) 0
-d 100b0022 DP83820 10/100/1000 Ethernet Controller 0
-d 100b0028 CS5535 Host bridge 0
-d 100b002b CS5535 ISA bridge 0
-d 100b002d CS5535 IDE 0
-d 100b002e CS5535 Audio 0
-d 100b002f CS5535 USB 0
-d 100b0030 CS5535 Video 0
-d 100b0035 DP83065 [Saturn] 10/100/1000 Ethernet Controller 0
-d 100b0500 SCx200 Bridge 0
-d 100b0501 SCx200 SMI 0
-d 100b0502 SCx200 IDE 0
-d 100b0503 SCx200 Audio 0
-d 100b0504 SCx200 Video 0
-d 100b0505 SCx200 XBus 0
-d 100b0510 SC1100 Bridge 0
-d 100b0511 SC1100 SMI 0
-d 100b0515 SC1100 XBus 0
-d 100bd001 87410 IDE 0
-v 100c Tseng Labs Inc 0
-d 100c3202 ET4000/W32p rev A 0
-d 100c3205 ET4000/W32p rev B 0
-d 100c3206 ET4000/W32p rev C 0
-d 100c3207 ET4000/W32p rev D 0
-d 100c3208 ET6000 0
-d 100c4702 ET6300 0
-v 100d AST Research Inc 0
-v 100e Weitek 0
-d 100e9000 P9000 Viper 0
-d 100e9001 P9000 Viper 0
-d 100e9002 P9000 Viper 0
-d 100e9100 P9100 Viper Pro/SE 0
-v 1010 Video Logic, Ltd. 0
-v 1011 Digital Equipment Corporation 0
-d 10110001 DECchip 21050 0
-d 10110002 DECchip 21040 [Tulip] 0
-d 10110004 DECchip 21030 [TGA] 0
-d 10110007 NVRAM [Zephyr NVRAM] 0
-d 10110008 KZPSA [KZPSA] 0
-d 10110009 DECchip 21140 [FasterNet] 0
-s 1011000910250310 21140 Fast Ethernet 0
-s 1011000910b82001 SMC9332BDT EtherPower 10/100 0
-s 1011000910b82002 SMC9332BVT EtherPower T4 10/100 0
-s 1011000910b82003 SMC9334BDT EtherPower 10/100 (1-port) 0
-s 1011000911092400 ANA-6944A/TX Fast Ethernet 0
-s 1011000911122300 RNS2300 Fast Ethernet 0
-s 1011000911122320 RNS2320 Fast Ethernet 0
-s 1011000911122340 RNS2340 Fast Ethernet 0
-s 1011000911131207 EN-1207-TX Fast Ethernet 0
-s 1011000911861100 DFE-500TX Fast Ethernet 0
-s 1011000911861112 DFE-570TX Fast Ethernet 0
-s 1011000911861140 DFE-660 Cardbus Ethernet 10/100 0
-s 1011000911861142 DFE-660 Cardbus Ethernet 10/100 0
-s 1011000911f60503 Freedomline Fast Ethernet 0
-s 1011000912829100 AEF-380TXD Fast Ethernet 0
-s 1011000913851100 FA310TX Fast Ethernet 0
-s 1011000926460001 KNE100TX Fast Ethernet 0
-d 1011000a 21230 Video Codec 0
-d 1011000d PBXGB [TGA2] 0
-d 1011000f DEFPA 0
-d 10110014 DECchip 21041 [Tulip Pass 3] 0
-s 1011001411860100 DE-530+ 0
-d 10110016 DGLPB [OPPO] 0
-d 10110017 PV-PCI Graphics Controller (ZLXp-L) 0
-d 10110019 DECchip 21142/43 0
-s 101100191011500a DE500A Fast Ethernet 0
-s 101100191011500b DE500B Fast Ethernet 0
-s 1011001910140001 10/100 EtherJet Cardbus 0
-s 1011001910250315 ALN315 Fast Ethernet 0
-s 101100191033800c PC-9821-CS01 100BASE-TX Interface Card 0
-s 101100191033800d PC-9821NR-B06 100BASE-TX Interface Card 0
-s 10110019108d0016 Rapidfire 2327 10/100 Ethernet 0
-s 10110019108d0017 GoCard 2250 Ethernet 10/100 Cardbus 0
-s 1011001910b82005 SMC8032DT Extreme Ethernet 10/100 0
-s 1011001910b88034 SMC8034 Extreme Ethernet 10/100 0
-s 1011001910ef8169 Cardbus Fast Ethernet 0
-s 1011001911092a00 ANA-6911A/TX Fast Ethernet 0
-s 1011001911092b00 ANA-6911A/TXC Fast Ethernet 0
-s 1011001911093000 ANA-6922/TX Fast Ethernet 0
-s 1011001911131207 Cheetah Fast Ethernet 0
-s 1011001911132220 Cardbus Fast Ethernet 0
-s 10110019115d0002 Cardbus Ethernet 10/100 0
-s 1011001911790203 Fast Ethernet 0
-s 1011001911790204 Cardbus Fast Ethernet 0
-s 1011001911861100 DFE-500TX Fast Ethernet 0
-s 1011001911861101 DFE-500TX Fast Ethernet 0
-s 1011001911861102 DFE-500TX Fast Ethernet 0
-s 1011001911861112 DFE-570TX Quad Fast Ethernet 0
-s 1011001912592800 AT-2800Tx Fast Ethernet 0
-s 1011001912660004 Eagle Fast EtherMAX 0
-s 1011001912af0019 NetFlyer Cardbus Fast Ethernet 0
-s 1011001913740001 Cardbus Ethernet Card 10/100 0
-s 1011001913740002 Cardbus Ethernet Card 10/100 0
-s 1011001913740007 Cardbus Ethernet Card 10/100 0
-s 1011001913740008 Cardbus Ethernet Card 10/100 0
-s 1011001913852100 FA510 0
-s 1011001913950001 10/100 Ethernet CardBus PC Card 0
-s 1011001913d1ab01 EtherFast 10/100 Cardbus (PCMPC200) 0
-s 1011001914cb0100 LNDL-100N 100Base-TX Ethernet PC Card 0
-s 1011001980860001 EtherExpress PRO/100 Mobile CardBus 32 0
-d 1011001a Farallon PN9000SX Gigabit Ethernet 0
-d 10110021 DECchip 21052 0
-d 10110022 DECchip 21150 0
-d 10110023 DECchip 21150 0
-d 10110024 DECchip 21152 0
-d 10110025 DECchip 21153 0
-d 10110026 DECchip 21154 0
-d 10110034 56k Modem Cardbus 0
-s 1011003413740003 56k Modem Cardbus 0
-d 10110045 DECchip 21553 0
-d 10110046 DECchip 21554 0
-s 101100460e114050 Integrated Smart Array 0
-s 101100460e114051 Integrated Smart Array 0
-s 101100460e114058 Integrated Smart Array 0
-s 10110046103c10c2 Hewlett-Packard NetRAID-4M 0
-s 1011004612d9000a IP Telephony card 0
-s 101100464c531050 CT7 mainboard 0
-s 101100464c531051 CE7 mainboard 0
-s 1011004690050364 5400S (Mustang) 0
-s 1011004690050365 5400S (Mustang) 0
-s 1011004690051364 Dell PowerEdge RAID Controller 2 0
-s 1011004690051365 Dell PowerEdge RAID Controller 2 0
-s 10110046e4bf1000 CC8-1-BLUES 0
-d 10111065 StrongARM DC21285 0
-s 1011106510690020 DAC960P / DAC1164P 0
-v 1012 Micronics Computers Inc 0
-v 1013 Cirrus Logic 0
-d 10130038 GD 7548 0
-d 10130040 GD 7555 Flat Panel GUI Accelerator 0
-d 1013004c GD 7556 Video/Graphics LCD/CRT Ctrlr 0
-d 101300a0 GD 5430/40 [Alpine] 0
-d 101300a2 GD 5432 [Alpine] 0
-d 101300a4 GD 5434-4 [Alpine] 0
-d 101300a8 GD 5434-8 [Alpine] 0
-d 101300ac GD 5436 [Alpine] 0
-d 101300b0 GD 5440 0
-d 101300b8 GD 5446 0
-d 101300bc GD 5480 0
-s 101300bc101300bc CL-GD5480 0
-d 101300d0 GD 5462 0
-d 101300d2 GD 5462 [Laguna I] 0
-d 101300d4 GD 5464 [Laguna] 0
-d 101300d5 GD 5464 BD [Laguna] 0
-d 101300d6 GD 5465 [Laguna] 0
-s 101300d613ce8031 Barco Metheus 2 Megapixel, Dual Head 0
-s 101300d613cf8031 Barco Metheus 2 Megapixel, Dual Head 0
-d 101300e8 GD 5436U 0
-d 10131100 CL 6729 0
-d 10131110 PD 6832 PCMCIA/CardBus Ctrlr 0
-d 10131112 PD 6834 PCMCIA/CardBus Ctrlr 0
-d 10131113 PD 6833 PCMCIA/CardBus Ctrlr 0
-d 10131200 GD 7542 [Nordic] 0
-d 10131202 GD 7543 [Viking] 0
-d 10131204 GD 7541 [Nordic Light] 0
-d 10134400 CD 4400 0
-d 10136001 CS 4610/11 [CrystalClear SoundFusion Audio Accelerator] 0
-s 1013600110141010 CS4610 SoundFusion Audio Accelerator 0
-d 10136003 CS 4614/22/24 [CrystalClear SoundFusion Audio Accelerator] 0
-s 1013600310134280 Crystal SoundFusion PCI Audio Accelerator 0
-s 1013600316810050 Game Theater XP 0
-s 101360031681a011 Fortissimo III 7.1 0
-d 10136004 CS 4614/22/24 [CrystalClear SoundFusion Audio Accelerator] 0
-d 10136005 Crystal CS4281 PCI Audio 0
-s 1013600510134281 Crystal CS4281 PCI Audio 0
-s 1013600510cf10a8 Crystal CS4281 PCI Audio 0
-s 1013600510cf10a9 Crystal CS4281 PCI Audio 0
-s 1013600510cf10aa Crystal CS4281 PCI Audio 0
-s 1013600510cf10ab Crystal CS4281 PCI Audio 0
-s 1013600510cf10ac Crystal CS4281 PCI Audio 0
-s 1013600510cf10ad Crystal CS4281 PCI Audio 0
-s 1013600510cf10b4 Crystal CS4281 PCI Audio 0
-s 1013600511790001 Crystal CS4281 PCI Audio 0
-s 1013600514c0000c Crystal CS4281 PCI Audio 0
-v 1014 IBM 0
-d 10140002 PCI to MCA Bridge 0
-d 10140005 Alta Lite 0
-d 10140007 Alta MP 0
-d 1014000a Fire Coral 0
-d 10140017 CPU to PCI Bridge 0
-d 10140018 TR Auto LANstreamer 0
-d 1014001b GXT-150P 0
-d 1014001c Carrera 0
-d 1014001d 82G2675 0
-d 10140020 GXT1000 Graphics Adapter 0
-d 10140022 IBM27-82351 0
-d 1014002d Python 0
-d 1014002e SCSI RAID Adapter [ServeRAID] 0 [official name in AIX 5]
-s 1014002e1014002e ServeRAID-3x 0
-s 1014002e1014022e ServeRAID-4H 0
-d 10140031 2 Port Serial Adapter 0
-s 1014003110140031 2721 WAN IOA - 2 Port Sync Serial Adapter 0 AS400 iSeries PCI sync serial card
-d 10140036 Miami 0
-d 10140037 82660 CPU to PCI Bridge 0
-d 1014003a CPU to PCI Bridge 0
-d 1014003c GXT250P/GXT255P Graphics Adapter 0
-d 1014003e 16/4 Token ring UTP/STP controller 0
-s 1014003e1014003e Token-Ring Adapter 0
-s 1014003e101400cd Token-Ring Adapter + Wake-On-LAN 0
-s 1014003e101400ce 16/4 Token-Ring Adapter 2 0
-s 1014003e101400cf 16/4 Token-Ring Adapter Special 0
-s 1014003e101400e4 High-Speed 100/16/4 Token-Ring Adapter 0
-s 1014003e101400e5 16/4 Token-Ring Adapter 2 + Wake-On-LAN 0
-s 1014003e1014016d iSeries 2744 Card 0
-d 10140045 SSA Adapter 0
-d 10140046 MPIC interrupt controller 0
-d 10140047 PCI to PCI Bridge 0
-d 10140048 PCI to PCI Bridge 0
-d 10140049 Warhead SCSI Controller 0
-d 1014004e ATM Controller (14104e00) 0
-d 1014004f ATM Controller (14104f00) 0
-d 10140050 ATM Controller (14105000) 0
-d 10140053 25 MBit ATM Controller 0
-d 10140054 GXT500P/GXT550P Graphics Adapter 0
-d 10140057 MPEG PCI Bridge 0
-d 1014005c i82557B 10/100 0
-d 1014005e GXT800P Graphics Adapter 0
-d 1014007c ATM Controller (14107c00) 0
-d 1014007d 3780IDSP [MWave] 0
-d 1014008b EADS PCI to PCI Bridge 0
-d 1014008e GXT3000P Graphics Adapter 0
-d 10140090 GXT 3000P 0
-s 101400901014008e GXT-3000P 0
-d 10140091 SSA Adapter 0
-d 10140095 20H2999 PCI Docking Bridge 0
-d 10140096 Chukar chipset SCSI controller 0
-s 1014009610140097 iSeries 2778 DASD IOA 0
-s 1014009610140098 iSeries 2763 DASD IOA 0
-s 1014009610140099 iSeries 2748 DASD IOA 0
-d 1014009f PCI 4758 Cryptographic Accelerator 0
-d 101400a5 ATM Controller (1410a500) 0
-d 101400a6 ATM 155MBPS MM Controller (1410a600) 0
-d 101400b7 256-bit Graphics Rasterizer [Fire GL1] 0
-s 101400b7109200b8 FireGL1 AGP 32Mb 0
-d 101400b8 GXT2000P Graphics Adapter 0
-d 101400be ATM 622MBPS Controller (1410be00) 0
-d 101400dc Advanced Systems Management Adapter (ASMA) 0
-d 101400fc CPC710 Dual Bridge and Memory Controller (PCI-64) 0
-d 10140104 Gigabit Ethernet-SX Adapter 0
-d 10140105 CPC710 Dual Bridge and Memory Controller (PCI-32) 0
-d 1014010f Remote Supervisor Adapter (RSA) 0
-d 10140142 Yotta Video Compositor Input 0
-s 1014014210140143 Yotta Input Controller (ytin) 0
-d 10140144 Yotta Video Compositor Output 0
-s 1014014410140145 Yotta Output Controller (ytout) 0
-d 10140156 405GP PLB to PCI Bridge 0
-d 1014015e 622Mbps ATM PCI Adapter 0
-d 10140160 64bit/66MHz PCI ATM 155 MMF 0
-d 1014016e GXT4000P Graphics Adapter 0
-d 10140170 GXT6000P Graphics Adapter 0
-d 1014017d GXT300P Graphics Adapter 0
-d 10140180 Snipe chipset SCSI controller 0
-s 1014018010140241 iSeries 2757 DASD IOA 0
-s 1014018010140264 Quad Channel PCI-X U320 SCSI RAID Adapter (2780) 0
-d 10140188 EADS-X PCI-X to PCI-X Bridge 0
-d 101401a7 PCI-X to PCI-X Bridge 0
-d 101401bd ServeRAID Controller 0
-s 101401bd101401be ServeRAID-4M 0
-s 101401bd101401bf ServeRAID-4L 0
-s 101401bd10140208 ServeRAID-4Mx 0
-s 101401bd1014020e ServeRAID-4Lx 0
-s 101401bd1014022e ServeRAID-4H 0
-s 101401bd10140258 ServeRAID-5i 0
-s 101401bd10140259 ServeRAID-5i 0
-d 101401c1 64bit/66MHz PCI ATM 155 UTP 0
-d 101401e6 Cryptographic Accelerator 0
-d 101401ff 10/100 Mbps Ethernet 0
-d 10140219 Multiport Serial Adapter 0
-s 101402191014021a Dual RVX 0
-s 1014021910140251 Internal Modem/RVX 0
-s 1014021910140252 Quad Internal Modem 0
-d 1014021b GXT6500P Graphics Adapter 0
-d 1014021c GXT4500P Graphics Adapter 0
-d 10140233 GXT135P Graphics Adapter 0
-d 10140266 PCI-X Dual Channel SCSI 0
-d 10140268 Gigabit Ethernet-SX Adapter (PCI-X) 0
-d 10140269 10/100/1000 Base-TX Ethernet Adapter (PCI-X) 0
-d 10140302 Winnipeg PCI-X Host Bridge 0
-d 10140314 ZISC 036 Neural accelerator card 0
-d 1014ffff MPIC-2 interrupt controller 0
-v 1015 LSI Logic Corp of Canada 0
-v 1016 ICL Personal Systems 0
-v 1017 SPEA Software AG 0
-d 10175343 SPEA 3D Accelerator 0
-v 1018 Unisys Systems 0
-v 1019 Elitegroup Computer Systems 0
-v 101a AT&T GIS (NCR) 0
-d 101a0005 100VG ethernet 0
-v 101b Vitesse Semiconductor 0
-v 101c Western Digital 0
-d 101c0193 33C193A 0
-d 101c0196 33C196A 0
-d 101c0197 33C197A 0
-d 101c0296 33C296A 0
-d 101c3193 7193 0
-d 101c3197 7197 0
-d 101c3296 33C296A 0
-d 101c4296 34C296 0
-d 101c9710 Pipeline 9710 0
-d 101c9712 Pipeline 9712 0
-d 101cc24a 90C 0
-v 101e American Megatrends Inc. 0
-d 101e1960 MegaRAID 0
-s 101e1960101e0471 MegaRAID 471 Enterprise 1600 RAID Controller 0
-s 101e1960101e0475 MegaRAID 475 Express 500/500LC RAID Controller 0
-s 101e1960101e0477 MegaRAID 477 Elite 3100 RAID Controller 0
-s 101e1960101e0493 MegaRAID 493 Elite 1600 RAID Controller 0
-s 101e1960101e0494 MegaRAID 494 Elite 1650 RAID Controller 0
-s 101e1960101e0503 MegaRAID 503 Enterprise 1650 RAID Controller 0
-s 101e1960101e0511 MegaRAID 511 i4 IDE RAID Controller 0
-s 101e1960101e0522 MegaRAID 522 i4133 RAID Controller 0
-s 101e196010280471 PowerEdge RAID Controller 3/QC 0
-s 101e196010280475 PowerEdge RAID Controller 3/SC 0
-s 101e196010280493 PowerEdge RAID Controller 3/DC 0
-s 101e196010280511 PowerEdge Cost Effective RAID Controller ATA100/4Ch 0
-d 101e9010 MegaRAID 428 Ultra RAID Controller 0
-d 101e9030 EIDE Controller 0
-d 101e9031 EIDE Controller 0
-d 101e9032 EIDE & SCSI Controller 0
-d 101e9033 SCSI Controller 0
-d 101e9040 Multimedia card 0
-d 101e9060 MegaRAID 434 Ultra GT RAID Controller 0
-d 101e9063 MegaRAC 0
-s 101e9063101e0767 Dell Remote Assistant Card 2 0
-v 101f PictureTel 0
-v 1020 Hitachi Computer Products 0
-v 1021 OKI Electric Industry Co. Ltd. 0
-v 1022 Advanced Micro Devices [AMD] 0
-d 10221100 K8 [Athlon64/Opteron] HyperTransport Technology Configuration 0
-d 10221101 K8 [Athlon64/Opteron] Address Map 0
-d 10221102 K8 [Athlon64/Opteron] DRAM Controller 0
-d 10221103 K8 [Athlon64/Opteron] Miscellaneous Control 0
-d 10222000 79c970 [PCnet32 LANCE] 0
-s 1022200010142000 NetFinity 10/100 Fast Ethernet 0
-s 1022200010222000 PCnet - Fast 79C971 0
-s 10222000103c104c Ethernet with LAN remote power Adapter 0
-s 10222000103c1064 Ethernet with LAN remote power Adapter 0
-s 10222000103c1065 Ethernet with LAN remote power Adapter 0
-s 10222000103c106c Ethernet with LAN remote power Adapter 0
-s 10222000103c106e Ethernet with LAN remote power Adapter 0
-s 10222000103c10ea Ethernet with LAN remote power Adapter 0
-s 1022200011131220 EN1220 10/100 Fast Ethernet 0
-s 1022200012592450 AT-2450 10/100 Fast Ethernet 0
-s 1022200012592454 AT-2450v4 10Mb Ethernet Adapter 0
-s 1022200012592700 AT-2700TX 10/100 Fast Ethernet 0
-s 1022200012592701 AT-2700FX 100Mb Ethernet 0
-s 102220004c531000 CC7/CR7/CP7/VC7/VP7/VR7 mainboard 0
-s 102220004c531010 CP5/CR6 mainboard 0
-s 102220004c531020 VR6 mainboard 0
-s 102220004c531030 PC5 mainboard 0
-s 102220004c531040 CL7 mainboard 0
-s 102220004c531060 PC7 mainboard 0
-d 10222001 79c978 [HomePNA] 0
-s 1022200110920a78 Multimedia Home Network Adapter 0
-s 1022200116680299 ActionLink Home Network Adapter 0
-d 10222003 Am 1771 MBW [Alchemy] 0
-d 10222020 53c974 [PCscsi] 0
-d 10222040 79c974 0
-d 10223000 ELanSC520 Microcontroller 0
-d 10227006 AMD-751 [Irongate] System Controller 0
-d 10227007 AMD-751 [Irongate] AGP Bridge 0
-d 1022700a AMD-IGR4 AGP Host to PCI Bridge 0
-d 1022700b AMD-IGR4 PCI to PCI Bridge 0
-d 1022700c AMD-760 MP [IGD4-2P] System Controller 0
-d 1022700d AMD-760 MP [IGD4-2P] AGP Bridge 0
-d 1022700e AMD-760 [IGD4-1P] System Controller 0
-d 1022700f AMD-760 [IGD4-1P] AGP Bridge 0
-d 10227400 AMD-755 [Cobra] ISA 0
-d 10227401 AMD-755 [Cobra] IDE 0
-d 10227403 AMD-755 [Cobra] ACPI 0
-d 10227404 AMD-755 [Cobra] USB 0
-d 10227408 AMD-756 [Viper] ISA 0
-d 10227409 AMD-756 [Viper] IDE 0
-d 1022740b AMD-756 [Viper] ACPI 0
-d 1022740c AMD-756 [Viper] USB 0
-d 10227410 AMD-766 [ViperPlus] ISA 0
-d 10227411 AMD-766 [ViperPlus] IDE 0
-d 10227413 AMD-766 [ViperPlus] ACPI 0
-d 10227414 AMD-766 [ViperPlus] USB 0
-d 10227440 AMD-768 [Opus] ISA 0
-s 1022744010438044 A7M-D Mainboard 0
-d 10227441 AMD-768 [Opus] IDE 0
-d 10227443 AMD-768 [Opus] ACPI 0
-s 1022744310438044 A7M-D Mainboard 0
-d 10227445 AMD-768 [Opus] Audio 0
-d 10227446 AMD-768 [Opus] MC97 Modem (Smart Link HAMR5600 compatible) 0
-d 10227448 AMD-768 [Opus] PCI 0
-d 10227449 AMD-768 [Opus] USB 0
-d 10227450 AMD-8131 PCI-X Bridge 0
-d 10227451 AMD-8131 PCI-X APIC 0
-d 10227454 AMD-8151 System Controller 0
-d 10227455 AMD-8151 AGP Bridge 0
-d 10227460 AMD-8111 PCI 0
-s 10227460161f3017 HDAMB 0
-d 10227461 AMD-8111 USB 0
-d 10227462 AMD-8111 Ethernet 0
-d 10227464 AMD-8111 USB 0
-s 10227464161f3017 HDAMB 0
-d 10227468 AMD-8111 LPC 0
-s 10227468161f3017 HDAMB 0
-d 10227469 AMD-8111 IDE 0
-s 10227469161f3017 HDAMB 0
-d 1022746a AMD-8111 SMBus 2.0 0
-d 1022746b AMD-8111 ACPI 0
-s 1022746b161f3017 HDAMB 0
-d 1022746d AMD-8111 AC97 Audio 0
-s 1022746d161f3017 HDAMB 0
-d 1022746e AMD-8111 MC97 Modem 0
-d 1022756b AMD-8111 ACPI 0
-v 1023 Trident Microsystems 0
-d 10230194 82C194 0
-d 10232000 4DWave DX 0
-d 10232001 4DWave NX 0
-s 10232001122d1400 Trident PCI288-Q3DII (NX) 0
-d 10232100 CyberBlade XP4m32 0
-d 10238400 CyberBlade/i7 0
-s 1023840010238400 CyberBlade i7 AGP 0
-d 10238420 CyberBlade/i7d 0
-s 102384200e11b15a CyberBlade i7 AGP 0
-d 10238500 CyberBlade/i1 0
-d 10238520 CyberBlade i1 0
-s 102385200e11b16e CyberBlade i1 AGP 0
-s 1023852010238520 CyberBlade i1 AGP 0
-d 10238620 CyberBlade/i1 0
-s 1023862010140502 ThinkPad R30/T30 0
-d 10238820 CyberBlade XPAi1 0
-d 10239320 TGUI 9320 0
-d 10239350 GUI Accelerator 0
-d 10239360 Flat panel GUI Accelerator 0
-d 10239382 Cyber 9382 [Reference design] 0
-d 10239383 Cyber 9383 [Reference design] 0
-d 10239385 Cyber 9385 [Reference design] 0
-d 10239386 Cyber 9386 0
-d 10239388 Cyber 9388 0
-d 10239397 Cyber 9397 0
-d 1023939a Cyber 9397DVD 0
-d 10239420 TGUI 9420 0
-d 10239430 TGUI 9430 0
-d 10239440 TGUI 9440 0
-d 10239460 TGUI 9460 0
-d 10239470 TGUI 9470 0
-d 10239520 Cyber 9520 0
-d 10239525 Cyber 9525 0
-s 1023952510cf1094 Lifebook C6155 0
-d 10239540 Cyber 9540 0
-d 10239660 TGUI 9660/938x/968x 0
-d 10239680 TGUI 9680 0
-d 10239682 TGUI 9682 0
-d 10239683 TGUI 9683 0
-d 10239685 ProVIDIA 9685 0
-d 10239750 3DImage 9750 0
-s 1023975010149750 3DImage 9750 0
-s 1023975010239750 3DImage 9750 0
-d 10239753 TGUI 9753 0
-d 10239754 TGUI 9754 0
-d 10239759 TGUI 975 0
-d 10239783 TGUI 9783 0
-d 10239785 TGUI 9785 0
-d 10239850 3DImage 9850 0
-d 10239880 Blade 3D PCI/AGP 0
-s 1023988010239880 Blade 3D 0
-d 10239910 CyberBlade/XP 0
-d 10239930 CyberBlade/XPm 0
-v 1024 Zenith Data Systems 0
-v 1025 Acer Incorporated [ALI] 0
-d 10251435 M1435 0
-d 10251445 M1445 0
-d 10251449 M1449 0
-d 10251451 M1451 0
-d 10251461 M1461 0
-d 10251489 M1489 0
-d 10251511 M1511 0
-d 10251512 ALI M1512 Aladdin 0
-d 10251513 M1513 0
-d 10251521 ALI M1521 Aladdin III CPU Bridge 0
-s 1025152110b91521 ALI M1521 Aladdin III CPU Bridge 0
-d 10251523 ALI M1523 ISA Bridge 0
-s 1025152310b91523 ALI M1523 ISA Bridge 0
-d 10251531 M1531 Northbridge [Aladdin IV/IV+] 0
-d 10251533 M1533 PCI-to-ISA Bridge 0
-s 1025153310b91533 ALI M1533 Aladdin IV/V ISA South Bridge 0
-d 10251535 M1535 PCI Bridge + Super I/O + FIR 0
-d 10251541 M1541 Northbridge [Aladdin V] 0
-s 1025154110b91541 ALI M1541 Aladdin V/V+ AGP+PCI North Bridge 0
-d 10251542 M1542 Northbridge [Aladdin V] 0
-d 10251543 M1543 PCI-to-ISA Bridge + Super I/O + FIR 0
-d 10251561 M1561 Northbridge [Aladdin 7] 0
-d 10251621 M1621 Northbridge [Aladdin-Pro II] 0
-d 10251631 M1631 Northbridge+3D Graphics [Aladdin TNT2] 0
-d 10251641 M1641 Northbridge [Aladdin-Pro IV] 0
-d 10251647 M1647 [MaGiK1] PCI North Bridge 0
-d 10251671 M1671 Northbridge [ALADDiN-P4] 0
-d 10251672 Northbridge [CyberALADDiN-P4] 0
-d 10253141 M3141 0
-d 10253143 M3143 0
-d 10253145 M3145 0
-d 10253147 M3147 0
-d 10253149 M3149 0
-d 10253151 M3151 0
-d 10253307 M3307 MPEG-I Video Controller 0
-d 10253309 M3309 MPEG-II Video w/ Software Audio Decoder 0
-d 10253321 M3321 MPEG-II Audio/Video Decoder 0
-d 10255212 M4803 0
-d 10255215 ALI PCI EIDE Controller 0
-d 10255217 M5217H 0
-d 10255219 M5219 0
-d 10255225 M5225 0
-d 10255229 M5229 0
-d 10255235 M5235 0
-d 10255237 M5237 PCI USB Host Controller 0
-d 10255240 EIDE Controller 0
-d 10255241 PCMCIA Bridge 0
-d 10255242 General Purpose Controller 0
-d 10255243 PCI to PCI Bridge Controller 0
-d 10255244 Floppy Disk Controller 0
-d 10255247 M1541 PCI to PCI Bridge 0
-d 10255251 M5251 P1394 Controller 0
-d 10255427 PCI to AGP Bridge 0
-d 10255451 M5451 PCI AC-Link Controller Audio Device 0
-d 10255453 M5453 PCI AC-Link Controller Modem Device 0
-d 10257101 M7101 PCI PMU Power Management Controller 0
-s 1025710110b97101 M7101 PCI PMU Power Management Controller 0
-v 1028 Dell 0
-d 10280001 PowerEdge Expandable RAID Controller 2/Si 0
-s 1028000110280001 PowerEdge 2400 0
-d 10280002 PowerEdge Expandable RAID Controller 3/Di 0
-s 1028000210280002 PowerEdge 4400 0
-d 10280003 PowerEdge Expandable RAID Controller 3/Si 0
-s 1028000310280003 PowerEdge 2450 0
-d 10280006 PowerEdge Expandable RAID Controller 3/Di 0
-d 10280007 Remote Access Card III 0
-d 10280008 Remote Access Card III 0
-d 10280009 Remote Access Card III: BMC/SMIC device not present 0
-d 1028000a PowerEdge Expandable RAID Controller 3/Di 0
-d 1028000c Embedded Remote Access or ERA/O 0
-d 1028000d Embedded Remote Access: BMC/SMIC device 0
-d 1028000e PowerEdge Expandable RAID controller 4/Di 0
-d 1028000f PowerEdge Expandable RAID controller 4/Di 0
-d 10280010 Remote Access Card 4 0
-d 10280011 Remote Access Card 4 Daughter Card 0
-d 10280012 Remote Access Card 4 Daughter Card Virtual UART 0
-d 10280013 PowerEdge Expandable RAID controller 4 0
-s 102800131028016c PowerEdge Expandable RAID Controller 4e/Si 0
-s 102800131028016d PowerEdge Expandable RAID Controller 4e/Di 0
-s 102800131028016e PowerEdge Expandable RAID Controller 4e/Di 0
-s 102800131028016f PowerEdge Expandable RAID Controller 4e/Di 0
-s 1028001310280170 PowerEdge Expandable RAID Controller 4e/Di 0
-d 10280014 Remote Access Card 4 Daughter Card SMIC interface 0
-v 1029 Siemens Nixdorf IS 0
-v 102a LSI Logic 0
-d 102a0000 HYDRA 0
-d 102a0010 ASPEN 0
-d 102a001f AHA-2940U2/U2W /7890/7891 SCSI Controllers 0
-s 102a001f9005000f 2940U2W SCSI Controller 0
-s 102a001f90050106 2940U2W SCSI Controller 0
-s 102a001f9005a180 2940U2W SCSI Controller 0
-d 102a00c5 AIC-7899 U160/m SCSI Controller 0
-s 102a00c5102800c5 PowerEdge 2550/2650/4600 0
-d 102a00cf AIC-7899P U160/m 0
-s 102a00cf10280106 PowerEdge 4600 0
-s 102a00cf10280121 PowerEdge 2650 0
-v 102b Matrox Graphics, Inc. 0
-d 102b0010 MGA-I [Impression?] 0 DJ: I've a suspicion that 0010 is a duplicate of 0d10.
-d 102b0100 MGA 1064SG [Mystique] 0
-d 102b0518 MGA-II [Athena] 0
-d 102b0519 MGA 2064W [Millennium] 0
-d 102b051a MGA 1064SG [Mystique] 0
-s 102b051a102b0100 MGA-1064SG Mystique 0
-s 102b051a102b1100 MGA-1084SG Mystique 0
-s 102b051a102b1200 MGA-1084SG Mystique 0
-s 102b051a1100102b MGA-1084SG Mystique 0
-s 102b051a110a0018 Scenic Pro C5 (D1025) 0
-d 102b051b MGA 2164W [Millennium II] 0
-s 102b051b102b051b MGA-2164W Millennium II 0
-s 102b051b102b1100 MGA-2164W Millennium II 0
-s 102b051b102b1200 MGA-2164W Millennium II 0
-d 102b051e MGA 1064SG [Mystique] AGP 0
-d 102b051f MGA 2164W [Millennium II] AGP 0
-d 102b0520 MGA G200 0
-s 102b0520102bdbc2 G200 Multi-Monitor 0
-s 102b0520102bdbc8 G200 Multi-Monitor 0
-s 102b0520102bdbe2 G200 Multi-Monitor 0
-s 102b0520102bdbe8 G200 Multi-Monitor 0
-s 102b0520102bff03 Millennium G200 SD 0
-s 102b0520102bff04 Marvel G200 0
-d 102b0521 MGA G200 AGP 0
-s 102b05211014ff03 Millennium G200 AGP 0
-s 102b0521102b48e9 Mystique G200 AGP 0
-s 102b0521102b48f8 Millennium G200 SD AGP 0
-s 102b0521102b4a60 Millennium G200 LE AGP 0
-s 102b0521102b4a64 Millennium G200 AGP 0
-s 102b0521102bc93c Millennium G200 AGP 0
-s 102b0521102bc9b0 Millennium G200 AGP 0
-s 102b0521102bc9bc Millennium G200 AGP 0
-s 102b0521102bca60 Millennium G250 LE AGP 0
-s 102b0521102bca6c Millennium G250 AGP 0
-s 102b0521102bdbbc Millennium G200 AGP 0
-s 102b0521102bdbc2 Millennium G200 MMS (Dual G200) 0
-s 102b0521102bdbc3 G200 Multi-Monitor 0
-s 102b0521102bdbc8 Millennium G200 MMS (Dual G200) 0
-s 102b0521102bdbd2 G200 Multi-Monitor 0
-s 102b0521102bdbd3 G200 Multi-Monitor 0
-s 102b0521102bdbd4 G200 Multi-Monitor 0
-s 102b0521102bdbd5 G200 Multi-Monitor 0
-s 102b0521102bdbd8 G200 Multi-Monitor 0
-s 102b0521102bdbd9 G200 Multi-Monitor 0
-s 102b0521102bdbe2 Millennium G200 MMS (Quad G200) 0
-s 102b0521102bdbe3 G200 Multi-Monitor 0
-s 102b0521102bdbe8 Millennium G200 MMS (Quad G200) 0
-s 102b0521102bdbf2 G200 Multi-Monitor 0
-s 102b0521102bdbf3 G200 Multi-Monitor 0
-s 102b0521102bdbf4 G200 Multi-Monitor 0
-s 102b0521102bdbf5 G200 Multi-Monitor 0
-s 102b0521102bdbf8 G200 Multi-Monitor 0
-s 102b0521102bdbf9 G200 Multi-Monitor 0
-s 102b0521102bf806 Mystique G200 Video AGP 0
-s 102b0521102bff00 MGA-G200 AGP 0
-s 102b0521102bff02 Mystique G200 AGP 0
-s 102b0521102bff03 Millennium G200 AGP 0
-s 102b0521102bff04 Marvel G200 AGP 0
-s 102b0521110a0032 MGA-G200 AGP 0
-d 102b0525 MGA G400 AGP 0
-s 102b05250e11b16f MGA-G400 AGP 0
-s 102b0525102b0328 Millennium G400 16Mb SDRAM 0
-s 102b0525102b0338 Millennium G400 16Mb SDRAM 0
-s 102b0525102b0378 Millennium G400 32Mb SDRAM 0
-s 102b0525102b0541 Millennium G450 Dual Head 0
-s 102b0525102b0542 Millennium G450 Dual Head LX 0
-s 102b0525102b0543 Millennium G450 Single Head LX 0
-s 102b0525102b0641 Millennium G450 32Mb SDRAM Dual Head 0
-s 102b0525102b0642 Millennium G450 32Mb SDRAM Dual Head LX 0
-s 102b0525102b0643 Millennium G450 32Mb SDRAM Single Head LX 0
-s 102b0525102b07c0 Millennium G450 Dual Head LE 0
-s 102b0525102b07c1 Millennium G450 SDR Dual Head LE 0
-s 102b0525102b0d41 Millennium G450 Dual Head PCI 0
-s 102b0525102b0d42 Millennium G450 Dual Head LX PCI 0
-s 102b0525102b0d43 Millennium G450 32Mb Dual Head PCI 0
-s 102b0525102b0e00 Marvel G450 eTV 0
-s 102b0525102b0e01 Marvel G450 eTV 0
-s 102b0525102b0e02 Marvel G450 eTV 0
-s 102b0525102b0e03 Marvel G450 eTV 0
-s 102b0525102b0f80 Millennium G450 Low Profile 0
-s 102b0525102b0f81 Millennium G450 Low Profile 0
-s 102b0525102b0f82 Millennium G450 Low Profile DVI 0
-s 102b0525102b0f83 Millennium G450 Low Profile DVI 0
-s 102b0525102b19d8 Millennium G400 16Mb SGRAM 0
-s 102b0525102b19f8 Millennium G400 32Mb SGRAM 0
-s 102b0525102b2159 Millennium G400 Dual Head 16Mb 0
-s 102b0525102b2179 Millennium G400 MAX/Dual Head 32Mb 0
-s 102b0525102b217d Millennium G400 Dual Head Max 0
-s 102b0525102b23c0 Millennium G450 0
-s 102b0525102b23c1 Millennium G450 0
-s 102b0525102b23c2 Millennium G450 DVI 0
-s 102b0525102b23c3 Millennium G450 DVI 0
-s 102b0525102b2f58 Millennium G400 0
-s 102b0525102b2f78 Millennium G400 0
-s 102b0525102b3693 Marvel G400 AGP 0
-s 102b0525102b5dd0 4Sight II 0
-s 102b0525102b5f50 4Sight II 0
-s 102b0525102b5f51 4Sight II 0
-s 102b0525102b5f52 4Sight II 0
-s 102b0525102b9010 Millennium G400 Dual Head 0
-s 102b052514580400 GA-G400 0
-s 102b052517050001 Millennium G450 32MB SGRAM 0
-s 102b052517050002 Millennium G450 16MB SGRAM 0
-s 102b052517050003 Millennium G450 32MB 0
-s 102b052517050004 Millennium G450 16MB 0
-d 102b0527 MGA Parhelia AGP 0
-s 102b0527102b0840 Parhelia 128Mb 0
-d 102b0d10 MGA Ultima/Impression 0
-d 102b1000 MGA G100 [Productiva] 0
-s 102b1000102bff01 Productiva G100 0
-s 102b1000102bff05 Productiva G100 Multi-Monitor 0
-d 102b1001 MGA G100 [Productiva] AGP 0
-s 102b1001102b1001 MGA-G100 AGP 0
-s 102b1001102bff00 MGA-G100 AGP 0
-s 102b1001102bff01 MGA-G100 Productiva AGP 0
-s 102b1001102bff03 Millennium G100 AGP 0
-s 102b1001102bff04 MGA-G100 AGP 0
-s 102b1001102bff05 MGA-G100 Productiva AGP Multi-Monitor 0
-s 102b1001110a001e MGA-G100 AGP 0
-d 102b2007 MGA Mistral 0
-d 102b2527 MGA G550 AGP 0
-s 102b2527102b0f83 Millennium G550 0
-s 102b2527102b0f84 Millennium G550 Dual Head DDR 32Mb 0
-s 102b2527102b1e41 Millennium G550 0
-d 102b2537 MGA G650 AGP 0
-d 102b4536 VIA Framegrabber 0
-d 102b6573 Shark 10/100 Multiport SwitchNIC 0
-v 102c Chips and Technologies 0
-d 102c00b8 F64310 0
-d 102c00c0 F69000 HiQVideo 0
-s 102c00c0102c00c0 F69000 HiQVideo 0
-s 102c00c04c531000 CC7/CR7/CP7/VC7/VP7/VR7 mainboard 0
-s 102c00c04c531010 CP5/CR6 mainboard 0
-s 102c00c04c531020 VR6 mainboard 0
-s 102c00c04c531030 PC5 mainboard 0
-s 102c00c04c531050 CT7 mainboard 0
-s 102c00c04c531051 CE7 mainboard 0
-d 102c00d0 F65545 0
-d 102c00d8 F65545 0
-d 102c00dc F65548 0
-d 102c00e0 F65550 0
-d 102c00e4 F65554 0
-d 102c00e5 F65555 HiQVPro 0
-s 102c00e50e11b049 Armada 1700 Laptop Display Controller 0
-d 102c00f0 F68554 0
-d 102c00f4 F68554 HiQVision 0
-d 102c00f5 F68555 0
-d 102c0c30 F69030 0
-s 102c0c304c531000 CC7/CR7/CP7/VC7/VP7/VR7 mainboard 0
-s 102c0c304c531050 CT7 mainboard 0
-s 102c0c304c531051 CE7 mainboard 0
-s 102c0c304c531080 CT8 mainboard 0 C5C project cancelled
-v 102d Wyse Technology Inc. 0
-d 102d50dc 3328 Audio 0
-v 102e Olivetti Advanced Technology 0
-v 102f Toshiba America 0
-d 102f0009 r4x00 0
-d 102f000a TX3927 MIPS RISC PCI Controller 0
-d 102f0020 ATM Meteor 155 0
-s 102f0020102f00f8 ATM Meteor 155 0
-d 102f0030 TC35815CF PCI 10/100 Mbit Ethernet Controller 0
-d 102f0031 TC35815CF PCI 10/100 Mbit Ethernet Controller with WOL 0
-d 102f0105 TC86C001 [goku-s] IDE 0
-d 102f0106 TC86C001 [goku-s] USB 1.1 Host 0
-d 102f0107 TC86C001 [goku-s] USB Device Controller 0
-d 102f0108 TC86C001 [goku-s] I2C/SIO/GPIO Controller 0
-d 102f0180 TX4927/38 MIPS RISC PCI Controller 0
-d 102f0181 TX4925 MIPS RISC PCI Controller 0
-d 102f0182 TX4937 MIPS RISC PCI Controller 0
-v 1030 TMC Research 0
-v 1031 Miro Computer Products AG 0
-d 10315601 DC20 ASIC 0
-d 10315607 Video I/O & motion JPEG compressor 0
-d 10315631 Media 3D 0
-d 10316057 MiroVideo DC10/DC30+ 0
-v 1032 Compaq 0
-v 1033 NEC Corporation 0
-d 10330000 Vr4181A USB Host or Function Control Unit 0
-d 10330001 PCI to 486-like bus Bridge 0
-d 10330002 PCI to VL98 Bridge 0
-d 10330003 ATM Controller 0
-d 10330004 R4000 PCI Bridge 0
-d 10330005 PCI to 486-like bus Bridge 0
-d 10330006 PC-9800 Graphic Accelerator 0
-d 10330007 PCI to UX-Bus Bridge 0
-d 10330008 PC-9800 Graphic Accelerator 0
-d 10330009 PCI to PC9800 Core-Graph Bridge 0
-d 10330016 PCI to VL Bridge 0
-d 1033001a [Nile II] 0
-d 10330021 Vrc4373 [Nile I] 0
-d 10330029 PowerVR PCX1 0
-d 1033002a PowerVR 3D 0
-d 1033002c Star Alpha 2 0
-d 1033002d PCI to C-bus Bridge 0
-d 10330035 USB 0
-s 1033003511790001 USB 0
-s 1033003512ee7000 Root Hub 0
-s 1033003517990001 Root Hub 0
-s 10330035807d0035 PCI-USB2 (OHCI subsystem) 0
-d 1033003b PCI to C-bus Bridge 0
-d 1033003e NAPCCARD Cardbus Controller 0
-d 10330046 PowerVR PCX2 [midas] 0
-d 1033005a Vrc5074 [Nile 4] 0
-d 10330063 Firewarden 0
-d 10330067 PowerVR Neon 250 Chipset 0
-s 1033006710100020 PowerVR Neon 250 AGP 32Mb 0
-s 1033006710100080 PowerVR Neon 250 AGP 16Mb 0
-s 1033006710100088 PowerVR Neon 250 16Mb 0
-s 1033006710100090 PowerVR Neon 250 AGP 16Mb 0
-s 1033006710100098 PowerVR Neon 250 16Mb 0
-s 10330067101000a0 PowerVR Neon 250 AGP 32Mb 0
-s 10330067101000a8 PowerVR Neon 250 32Mb 0
-s 1033006710100120 PowerVR Neon 250 AGP 32Mb 0
-d 10330074 56k Voice Modem 0
-s 1033007410338014 RCV56ACF 56k Voice Modem 0
-d 1033009b Vrc5476 0
-d 103300a5 VRC4173 0
-d 103300a6 VRC5477 AC97 0
-d 103300cd IEEE 1394 [OrangeLink] Host Controller 0
-s 103300cd12ee8011 Root hub 0
-d 103300ce IEEE 1394 Host Controller 0
-d 103300df Vr4131 0
-d 103300e0 USB 2.0 0
-s 103300e00ee43383 Sitecom IEEE 1394 / USB2.0 Combo Card 0
-s 103300e012ee7001 Root hub 0
-s 103300e017990002 Root Hub 0
-s 103300e0807d1043 PCI-USB2 (EHCI subsystem) 0
-d 103300e7 IEEE 1394 Host Controller 0
-d 103300f2 uPD72874 IEEE1394 OHCI 1.1 3-port PHY-Link Ctrlr 0
-d 103300f3 uPD6113x Multimedia Decoder/Processor [EMMA2] 0
-d 1033010c VR7701 0
-v 1034 Framatome Connectors USA Inc. 0
-v 1035 Comp. & Comm. Research Lab 0
-v 1036 Future Domain Corp. 0
-d 10360000 TMC-18C30 [36C70] 0
-v 1037 Hitachi Micro Systems 0
-v 1038 AMP, Inc 0
-v 1039 Silicon Integrated Systems [SiS] 0
-d 10390001 Virtual PCI-to-PCI bridge (AGP) 0
-d 10390002 SG86C202 0
-d 10390006 85C501/2/3 0
-d 10390008 SiS85C503/5513 (LPC Bridge) 0
-d 10390009 ACPI 0
-d 10390016 SiS961/2 SMBus Controller 0 source: http://members.datafast.net.au/dft0802/downloads/pcidevs.txt
-d 10390018 SiS85C503/5513 (LPC Bridge) 0
-d 10390180 RAID bus controller 180 SATA/PATA [SiS] 0 Controller for 2 PATA and 2 SATA channels
-d 10390181 SiS SATA 0
-d 10390200 5597/5598/6326 VGA 0
-s 1039020010390000 SiS5597 SVGA (Shared RAM) 0
-d 10390204 82C204 0
-d 10390205 SG86C205 0
-d 10390300 300/305 PCI/AGP VGA Display Adapter 0
-s 10390300107d2720 Leadtek WinFast VR300 0
-d 10390310 315H PCI/AGP VGA Display Adapter 0
-d 10390315 315 PCI/AGP VGA Display Adapter 0
-d 10390325 315PRO PCI/AGP VGA Display Adapter 0
-d 10390330 330 [Xabre] PCI/AGP VGA Display Adapter 0
-d 10390406 85C501/2 0
-d 10390496 85C496 0
-d 10390530 530 Host 0
-d 10390540 540 Host 0
-d 10390550 550 Host 0
-d 10390597 5513C 0
-d 10390601 85C601 0
-d 10390620 620 Host 0
-d 10390630 630 Host 0
-d 10390633 633 Host 0
-d 10390635 635 Host 0
-d 10390645 SiS645 Host & Memory & AGP Controller 0
-d 10390646 SiS645DX Host & Memory & AGP Controller 0
-d 10390648 SiS 645xx 0
-d 10390650 650/M650 Host 0
-d 10390651 651 Host 0
-d 10390655 655 Host 0
-d 10390660 660 Host 0
-d 10390661 661FX/M661FX/M661MX Host 0
-d 10390730 730 Host 0
-d 10390733 733 Host 0
-d 10390735 735 Host 0
-d 10390740 740 Host 0
-d 10390741 741/741GX/M741 Host 0
-d 10390745 745 Host 0
-d 10390746 746 Host 0
-d 10390755 755 Host 0
-d 10390760 760/M760 Host 0
-d 10390900 SiS900 PCI Fast Ethernet 0
-s 1039090010190a14 K7S5A motherboard 0
-s 1039090010390900 SiS900 10/100 Ethernet Adapter 0
-s 1039090010438035 CUSI-FX motherboard 0
-d 10390961 SiS961 [MuTIOL Media IO] 0
-d 10390962 SiS962 [MuTIOL Media IO] 0
-d 10390963 SiS963 [MuTIOL Media IO] 0
-d 10390964 SiS964 [MuTIOL Media IO] 0
-d 10390965 SiS965 [MuTIOL Media IO] 0
-d 10393602 83C602 0
-d 10395107 5107 0
-d 10395300 SiS540 PCI Display Adapter 0
-d 10395315 550 PCI/AGP VGA Display Adapter 0
-d 10395401 486 PCI Chipset 0
-d 10395511 5511/5512 0
-d 10395513 5513 [IDE] 0
-s 1039551310190970 P6STP-FL motherboard 0
-s 1039551310395513 SiS5513 EIDE Controller (A,B step) 0
-s 1039551310438035 CUSI-FX motherboard 0
-d 10395517 5517 0
-d 10395571 5571 0
-d 10395581 5581 Pentium Chipset 0
-d 10395582 5582 0
-d 10395591 5591/5592 Host 0
-d 10395596 5596 Pentium Chipset 0
-d 10395597 5597 [SiS5582] 0
-d 10395600 5600 Host 0
-d 10396204 Video decoder & MPEG interface 0
-d 10396205 VGA Controller 0
-d 10396236 6236 3D-AGP 0
-d 10396300 630/730 PCI/AGP VGA Display Adapter 0
-s 1039630010190970 P6STP-FL motherboard 0
-s 1039630010438035 CUSI-FX motherboard 0
-d 10396306 530/620 PCI/AGP VGA Display Adapter 0
-s 1039630610396306 SiS530,620 GUI Accelerator+3D 0
-d 10396325 65x/M650/740 PCI/AGP VGA Display Adapter 0
-d 10396326 86C326 5598/6326 0
-s 1039632610396326 SiS6326 GUI Accelerator 0
-s 1039632610920a50 SpeedStar A50 0
-s 1039632610920a70 SpeedStar A70 0
-s 1039632610924910 SpeedStar A70 0
-s 1039632610924920 SpeedStar A70 0
-s 1039632615696326 SiS6326 GUI Accelerator 0
-d 10396330 661/741/760 PCI/AGP VGA Display Adapter 0
-s 1039633010396330 [M]661xX/[M]741[GX]/[M]760 PCI/AGP VGA Adapter 0
-d 10397001 USB 1.0 Controller 0
-s 1039700110190a14 K7S5A motherboard 0
-s 1039700110397000 Onboard USB Controller 0
-d 10397002 USB 2.0 Controller 0
-s 1039700215097002 Onboard USB Controller 0
-d 10397007 FireWire Controller 0
-d 10397012 Sound Controller 0
-d 10397013 AC'97 Modem Controller 0 There are may be different modem codecs here (Intel537 compatible and incompatible)
-d 10397016 SiS7016 PCI Fast Ethernet Adapter 0
-s 1039701610397016 SiS7016 10/100 Ethernet Adapter 0
-d 10397018 SiS PCI Audio Accelerator 0
-s 10397018101401b6 SiS PCI Audio Accelerator 0
-s 10397018101401b7 SiS PCI Audio Accelerator 0
-s 1039701810197018 SiS PCI Audio Accelerator 0
-s 103970181025000e SiS PCI Audio Accelerator 0
-s 1039701810250018 SiS PCI Audio Accelerator 0
-s 1039701810397018 SiS PCI Audio Accelerator 0
-s 103970181043800b SiS PCI Audio Accelerator 0
-s 1039701810547018 SiS PCI Audio Accelerator 0
-s 10397018107d5330 SiS PCI Audio Accelerator 0
-s 10397018107d5350 SiS PCI Audio Accelerator 0
-s 1039701811703209 SiS PCI Audio Accelerator 0
-s 103970181462400a SiS PCI Audio Accelerator 0
-s 1039701814a42089 SiS PCI Audio Accelerator 0
-s 1039701814cd2194 SiS PCI Audio Accelerator 0
-s 1039701814ff1100 SiS PCI Audio Accelerator 0
-s 10397018152d8808 SiS PCI Audio Accelerator 0
-s 1039701815581103 SiS PCI Audio Accelerator 0
-s 1039701815582200 SiS PCI Audio Accelerator 0
-s 1039701815637018 SiS PCI Audio Accelerator 0
-s 1039701815c50111 SiS PCI Audio Accelerator 0
-s 10397018270fa171 SiS PCI Audio Accelerator 0
-s 10397018a0a00022 SiS PCI Audio Accelerator 0
-d 10397019 SiS7019 Audio Accelerator 0
-v 103a Seiko Epson Corporation 0
-v 103b Tatung Co. of America 0
-v 103c Hewlett-Packard Company 0
-d 103c1005 A4977A Visualize EG 0
-d 103c1006 Visualize FX6 0
-d 103c1008 Visualize FX4 0
-d 103c100a Visualize FX2 0
-d 103c1028 Tach TL Fibre Channel Host Adapter 0
-d 103c1029 Tach XL2 Fibre Channel Host Adapter 0
-s 103c1029107e000f Interphase 5560 Fibre Channel Adapter 0
-s 103c102990049210 1Gb/2Gb Family Fibre Channel Controller 0
-s 103c102990049211 1Gb/2Gb Family Fibre Channel Controller 0
-d 103c102a Tach TS Fibre Channel Host Adapter 0
-s 103c102a107e000e Interphase 5540/5541 Fibre Channel Adapter 0
-s 103c102a90049110 1Gb/2Gb Family Fibre Channel Controller 0
-s 103c102a90049111 1Gb/2Gb Family Fibre Channel Controller 0
-d 103c1030 J2585A DeskDirect 10/100VG NIC 0
-d 103c1031 J2585B HP 10/100VG PCI LAN Adapter 0
-s 103c1031103c1040 J2973A DeskDirect 10BaseT NIC 0
-s 103c1031103c1041 J2585B DeskDirect 10/100VG NIC 0
-s 103c1031103c1042 J2970A DeskDirect 10BaseT/2 NIC 0
-d 103c1040 J2973A DeskDirect 10BaseT NIC 0
-d 103c1041 J2585B DeskDirect 10/100 NIC 0
-d 103c1042 J2970A DeskDirect 10BaseT/2 NIC 0
-d 103c1048 Diva Serial [GSP] Multiport UART 0
-s 103c1048103c1049 Tosca Console 0
-s 103c1048103c104a Tosca Secondary 0
-s 103c1048103c104b Maestro SP2 0
-s 103c1048103c1223 Superdome Console 0
-s 103c1048103c1226 Keystone SP2 0
-s 103c1048103c1227 Powerbar SP2 0
-s 103c1048103c1282 Everest SP2 0
-d 103c1054 PCI Local Bus Adapter 0
-d 103c1064 79C970 PCnet Ethernet Controller 0
-d 103c108b Visualize FXe 0
-d 103c10c1 NetServer Smart IRQ Router 0
-d 103c10ed TopTools Remote Control 0
-d 103c1200 82557B 10/100 NIC 0
-d 103c1219 NetServer PCI Hot-Plug Controller 0
-d 103c121a NetServer SMIC Controller 0
-d 103c121b NetServer Legacy COM Port Decoder 0
-d 103c121c NetServer PCI COM Port Decoder 0
-d 103c1229 zx1 System Bus Adapter 0
-d 103c122a zx1 I/O Controller 0
-d 103c122e zx1 Local Bus Adapter 0
-d 103c127c sx1000 I/O Controller 0
-d 103c1290 Auxiliary Diva Serial Port 0
-d 103c2910 E2910A PCIBus Exerciser 0
-d 103c2925 E2925A 32 Bit, 33 MHzPCI Exerciser & Analyzer 0
-v 103e Solliday Engineering 0
-v 103f Synopsys/Logic Modeling Group 0
-v 1040 Accelgraphics Inc. 0
-v 1041 Computrend 0
-v 1042 Micron 0
-d 10421000 PC Tech RZ1000 0
-d 10421001 PC Tech RZ1001 0
-d 10423000 Samurai_0 0
-d 10423010 Samurai_1 0
-d 10423020 Samurai_IDE 0
-v 1043 ASUSTeK Computer Inc. 0
-d 10430675 ISDNLink P-IN100-ST-D 0
-d 10434015 v7100 SDRAM [GeForce2 MX] 0
-d 10434021 v7100 Combo Deluxe [GeForce2 MX + TV tuner] 0
-d 10434057 v8200 GeForce 3 0
-d 10438043 v8240 PAL 128M [P4T] Motherboard 0
-d 1043807b v9280/TD [Geforce4 TI4200 8X With TV-Out and DVI] 0
-d 104380bb v9180 Magic/T [GeForce4 MX440 AGP 8x 64MB TV-out] 0
-v 1044 Adaptec (formerly DPT) 0
-d 10441012 Domino RAID Engine 0
-d 1044a400 SmartCache/Raid I-IV Controller 0
-d 1044a500 PCI Bridge 0
-d 1044a501 SmartRAID V Controller 0
-s 1044a5011044c001 PM1554U2 Ultra2 Single Channel 0
-s 1044a5011044c002 PM1654U2 Ultra2 Single Channel 0
-s 1044a5011044c003 PM1564U3 Ultra3 Single Channel 0
-s 1044a5011044c004 PM1564U3 Ultra3 Dual Channel 0
-s 1044a5011044c005 PM1554U2 Ultra2 Single Channel (NON ACPI) 0
-s 1044a5011044c00a PM2554U2 Ultra2 Single Channel 0
-s 1044a5011044c00b PM2654U2 Ultra2 Single Channel 0
-s 1044a5011044c00c PM2664U3 Ultra3 Single Channel 0
-s 1044a5011044c00d PM2664U3 Ultra3 Dual Channel 0
-s 1044a5011044c00e PM2554U2 Ultra2 Single Channel (NON ACPI) 0
-s 1044a5011044c00f PM2654U2 Ultra2 Single Channel (NON ACPI) 0
-s 1044a5011044c014 PM3754U2 Ultra2 Single Channel (NON ACPI) 0
-s 1044a5011044c015 PM3755U2B Ultra2 Single Channel (NON ACPI) 0
-s 1044a5011044c016 PM3755F Fibre Channel (NON ACPI) 0
-s 1044a5011044c01e PM3757U2 Ultra2 Single Channel 0
-s 1044a5011044c01f PM3757U2 Ultra2 Dual Channel 0
-s 1044a5011044c020 PM3767U3 Ultra3 Dual Channel 0
-s 1044a5011044c021 PM3767U3 Ultra3 Quad Channel 0
-s 1044a5011044c028 PM2865U3 Ultra3 Single Channel 0
-s 1044a5011044c029 PM2865U3 Ultra3 Dual Channel 0
-s 1044a5011044c02a PM2865F Fibre Channel 0
-s 1044a5011044c03c 2000S Ultra3 Single Channel 0
-s 1044a5011044c03d 2000S Ultra3 Dual Channel 0
-s 1044a5011044c03e 2000F Fibre Channel 0
-s 1044a5011044c046 3000S Ultra3 Single Channel 0
-s 1044a5011044c047 3000S Ultra3 Dual Channel 0
-s 1044a5011044c048 3000F Fibre Channel 0
-s 1044a5011044c050 5000S Ultra3 Single Channel 0
-s 1044a5011044c051 5000S Ultra3 Dual Channel 0
-s 1044a5011044c052 5000F Fibre Channel 0
-s 1044a5011044c05a 2400A UDMA Four Channel 0
-s 1044a5011044c05b 2400A UDMA Four Channel DAC 0
-s 1044a5011044c064 3010S Ultra3 Dual Channel 0
-s 1044a5011044c065 3010S Ultra3 Four Channel 0
-s 1044a5011044c066 3010S Fibre Channel 0
-d 1044a511 SmartRAID V Controller 0
-s 1044a5111044c032 ASR-2005S I2O Zero Channel 0
-v 1045 OPTi Inc. 0
-d 1045a0f8 82C750 [Vendetta] USB Controller 0
-d 1045c101 92C264 0
-d 1045c178 92C178 0
-d 1045c556 82X556 [Viper] 0
-d 1045c557 82C557 [Viper-M] 0
-d 1045c558 82C558 [Viper-M ISA+IDE] 0
-d 1045c567 82C750 [Vendetta], device 0 0
-d 1045c568 82C750 [Vendetta], device 1 0
-d 1045c569 82C579 [Viper XPress+ Chipset] 0
-d 1045c621 82C621 [Viper-M/N+] 0
-d 1045c700 82C700 [FireStar] 0
-d 1045c701 82C701 [FireStar Plus] 0
-d 1045c814 82C814 [Firebridge 1] 0
-d 1045c822 82C822 0
-d 1045c824 82C824 0
-d 1045c825 82C825 [Firebridge 2] 0
-d 1045c832 82C832 0
-d 1045c861 82C861 0
-d 1045c895 82C895 0
-d 1045c935 EV1935 ECTIVA MachOne PCIAudio 0
-d 1045d568 82C825 [Firebridge 2] 0
-d 1045d721 IDE [FireStar] 0
-v 1046 IPC Corporation, Ltd. 0
-v 1047 Genoa Systems Corp 0
-v 1048 Elsa AG 0
-d 10480c60 Gladiac MX 0
-d 10480d22 Quadro4 900XGL [ELSA GLoria4 900XGL] 0
-d 10481000 QuickStep 1000 0
-d 10483000 QuickStep 3000 0
-d 10488901 Gloria XL 0
-v 1049 Fountain Technologies, Inc. 0
-v 104a STMicroelectronics 0 # nee SGS Thomson Microelectronics
-d 104a0008 STG 2000X 0
-d 104a0009 STG 1764X 0
-d 104a0010 STG4000 [3D Prophet Kyro Series] 0
-d 104a0209 STPC Consumer/Industrial North- and Southbridge 0
-d 104a020a STPC Atlas/ConsumerS/Consumer IIA Northbridge 0
-d 104a0210 STPC Atlas ISA Bridge 0 From <http://gatekeeper.dec.com/pub/BSD/FreeBSD/FreeBSD-stable/src/share/misc/pci_vendors>
-d 104a021a STPC Consumer S Southbridge 0
-d 104a021b STPC Consumer IIA Southbridge 0
-d 104a0500 ST70137 [Unicorn] ADSL DMT Transceiver 0
-d 104a0564 STPC Client Northbridge 0
-d 104a0981 21x4x DEC-Tulip compatible 10/100 Ethernet 0
-d 104a1746 STG 1764X 0
-d 104a2774 21x4x DEC-Tulip compatible 10/100 Ethernet 0
-d 104a3520 MPEG-II decoder card 0
-d 104a55cc STPC Client Southbridge 0
-v 104b BusLogic 0
-d 104b0140 BT-946C (old) [multimaster 01] 0
-d 104b1040 BT-946C (BA80C30) [MultiMaster 10] 0
-d 104b8130 Flashpoint LT 0
-v 104c Texas Instruments 0
-d 104c0500 100 MBit LAN Controller 0
-d 104c0508 TMS380C2X Compressor Interface 0
-d 104c1000 Eagle i/f AS 0
-d 104c104c PCI1510 PC card Cardbus Controller 0
-d 104c3d04 TVP4010 [Permedia] 0
-d 104c3d07 TVP4020 [Permedia 2] 0
-s 104c3d0710114d10 Comet 0
-s 104c3d071040000f AccelStar II 0
-s 104c3d0710400011 AccelStar II 0
-s 104c3d0710480a31 WINNER 2000 0
-s 104c3d0710480a32 GLoria Synergy 0
-s 104c3d0710480a35 GLoria Synergy 0
-s 104c3d07107d2633 WinFast 3D L2300 0
-s 104c3d0710920127 FIRE GL 1000 PRO 0
-s 104c3d0710920136 FIRE GL 1000 PRO 0
-s 104c3d0710920141 FIRE GL 1000 PRO 0
-s 104c3d0710920146 FIRE GL 1000 PRO 0
-s 104c3d0710920148 FIRE GL 1000 PRO 0
-s 104c3d0710920149 FIRE GL 1000 PRO 0
-s 104c3d0710920152 FIRE GL 1000 PRO 0
-s 104c3d0710920154 FIRE GL 1000 PRO 0
-s 104c3d0710920155 FIRE GL 1000 PRO 0
-s 104c3d0710920156 FIRE GL 1000 PRO 0
-s 104c3d0710920157 FIRE GL 1000 PRO 0
-s 104c3d0710973d01 Jeronimo Pro 0
-s 104c3d071102100f Graphics Blaster Extreme 0
-s 104c3d073d3d0100 Reference Permedia 2 3D 0
-d 104c8000 PCILynx/PCILynx2 IEEE 1394 Link Layer Controller 0
-s 104c8000e4bf1010 CF1-1-SNARE 0
-s 104c8000e4bf1020 CF1-2-SNARE 0
-d 104c8009 FireWire Controller 0
-s 104c8009104d8032 8032 OHCI i.LINK (IEEE 1394) Controller 0
-d 104c8017 PCI4410 FireWire Controller 0
-d 104c8019 TSB12LV23 IEEE-1394 Controller 0
-s 104c801911bd000a Studio DV500-1394 0
-s 104c801911bd000e Studio DV 0
-s 104c8019e4bf1010 CF2-1-CYMBAL 0
-d 104c8020 TSB12LV26 IEEE-1394 Controller (Link) 0
-d 104c8021 TSB43AA22 IEEE-1394 Controller (PHY/Link Integrated) 0
-s 104c8021104d80df Vaio PCG-FX403 0
-s 104c8021104d80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP 0
-d 104c8022 TSB43AB22 IEEE-1394a-2000 Controller (PHY/Link) 0
-d 104c8023 TSB43AB22/A IEEE-1394a-2000 Controller (PHY/Link) 0
-d 104c8024 TSB43AB23 IEEE-1394a-2000 Controller (PHY/Link) 0
-d 104c8025 TSB82AA2 IEEE-1394b Link Layer Controller 0
-s 104c802555aa55aa FireWire 800 PCI Card 0
-d 104c8026 TSB43AB21 IEEE-1394a-2000 Controller (PHY/Link) 0
-d 104c8027 PCI4451 IEEE-1394 Controller 0
-s 104c8027102800e6 PCI4451 IEEE-1394 Controller (Dell Inspiron 8100) 0
-d 104c8029 PCI4510 IEEE-1394 Controller 0
-s 104c802910280163 Latitude D505 0
-s 104c802910718160 MIM2900 0
-d 104c802e PCI7x20 1394a-2000 OHCI Two-Port PHY/Link-Layer Controller 0
-d 104c8201 PCI1620 Firmware Loading Function 0
-d 104c8400 ACX 100 22Mbps Wireless Interface 0
-s 104c840000fc16ec U.S. Robotics 22 Mbps Wireless PC Card (model 2210) 0
-s 104c840000fd16ec U.S. Robotics 22Mbps Wireless PCI Adapter (model 2216) 0
-s 104c840011863b00 DWL-650+ PC Card cardbus 22Mbs Wireless Adapter [AirPlus] 0
-s 104c840011863b01 DWL-520+ 22Mbps PCI Wireless Adapter 0
-d 104c8401 ACX 100 22Mbps Wireless Interface 0
-d 104c9000 Wireless Interface (of unknown type) 0 OK, this info is almost useless as is, but at least it's known that it's a wireless card. More info requested from reporter (whi
-d 104c9066 ACX 111 54Mbps Wireless Interface 0
-d 104ca001 TDC1570 0
-d 104ca100 TDC1561 0
-d 104ca102 TNETA1575 HyperSAR Plus w/PCI Host i/f & UTOPIA i/f 0
-d 104ca106 TMS320C6205 Fixed Point DSP 0
-s 104ca106175c5000 ASI50xx Audio Adapter 0
-s 104ca106175c8700 ASI87xx Radio Tuner card 0
-d 104cac10 PCI1050 0
-d 104cac11 PCI1053 0
-d 104cac12 PCI1130 0
-d 104cac13 PCI1031 0
-d 104cac15 PCI1131 0
-d 104cac16 PCI1250 0
-s 104cac1610140092 ThinkPad 600 0
-d 104cac17 PCI1220 0
-d 104cac18 PCI1260 0
-d 104cac19 PCI1221 0
-d 104cac1a PCI1210 0
-d 104cac1b PCI1450 0
-s 104cac1b0e11b113 Armada M700 0
-d 104cac1c PCI1225 0
-s 104cac1c0e11b121 Armada E500 0
-s 104cac1c10280088 Dell Computer Corporation Latitude CPi A400XT 0
-d 104cac1d PCI1251A 0
-d 104cac1e PCI1211 0
-d 104cac1f PCI1251B 0
-d 104cac20 TI 2030 0
-d 104cac21 PCI2031 0
-d 104cac22 PCI2032 PCI Docking Bridge 0
-d 104cac23 PCI2250 PCI-to-PCI Bridge 0
-d 104cac28 PCI2050 PCI-to-PCI Bridge 0
-d 104cac30 PCI1260 PC card Cardbus Controller 0
-d 104cac40 PCI4450 PC card Cardbus Controller 0
-d 104cac41 PCI4410 PC card Cardbus Controller 0
-d 104cac42 PCI4451 PC card Cardbus Controller 0
-s 104cac42102800e6 PCI4451 PC card CardBus Controller (Dell Inspiron 8100) 0
-d 104cac44 PCI4510 PC card Cardbus Controller 0
-s 104cac4410280163 Latitude D505 0
-s 104cac4410718160 MIM2000 0
-d 104cac46 PCI4520 PC card Cardbus Controller 0
-d 104cac50 PCI1410 PC card Cardbus Controller 0
-d 104cac51 PCI1420 0
-s 104cac511014023b ThinkPad T23 (2647-4MG) 0
-s 104cac51102800b1 Latitude C600 0
-s 104cac511028012a Latitude C640 0
-s 104cac51103380cd Versa Note VXi 0
-s 104cac5110cf1095 Lifebook C6155 0
-s 104cac51e4bf1000 CP2-2-HIPHOP 0
-d 104cac52 PCI1451 PC card Cardbus Controller 0
-d 104cac53 PCI1421 PC card Cardbus Controller 0
-d 104cac54 PCI1620 PC Card Controller 0
-d 104cac55 PCI1520 PC card Cardbus Controller 0
-s 104cac5510140512 ThinkPad T30/T40 0
-d 104cac56 PCI1510 PC card Cardbus Controller 0
-s 104cac5610140528 ThinkPad R40e (2684-HVG) Cardbus Controller 0
-d 104cac60 PCI2040 PCI to DSP Bridge Controller 0
-s 104cac60175c5100 ASI51xx Audio Adapter 0
-s 104cac60175c6100 ASI61xx Audio Adapter 0
-s 104cac60175c6200 ASI62xx Audio Adapter 0
-d 104cac8d PCI 7620 0
-d 104cac8e PCI7420 CardBus Controller 0
-d 104cac8f PCI7420/PCI7620 Dual Socket CardBus and Smart Card Cont. w/ 1394a-2000 OHCI Two-Port PHY/Link-Layer Cont. and SD/MS-Pro Sockets 0
-d 104cfe00 FireWire Host Controller 0
-d 104cfe03 12C01A FireWire Host Controller 0
-v 104d Sony Corporation 0
-d 104d8009 CXD1947Q i.LINK Controller 0
-d 104d8039 CXD3222 i.LINK Controller 0
-d 104d8056 Rockwell HCF 56K modem 0
-d 104d808a Memory Stick Controller 0
-v 104e Oak Technology, Inc 0
-d 104e0017 OTI-64017 0
-d 104e0107 OTI-107 [Spitfire] 0
-d 104e0109 Video Adapter 0
-d 104e0111 OTI-64111 [Spitfire] 0
-d 104e0217 OTI-64217 0
-d 104e0317 OTI-64317 0
-v 104f Co-time Computer Ltd 0
-v 1050 Winbond Electronics Corp 0
-d 10500000 NE2000 0
-d 10500001 W83769F 0
-d 10500105 W82C105 0
-d 10500840 W89C840 0
-s 1050084010500001 W89C840 Ethernet Adapter 0
-s 1050084010500840 W89C840 Ethernet Adapter 0
-d 10500940 W89C940 0
-d 10505a5a W89C940F 0
-d 10506692 W6692 0
-d 10509921 W99200F MPEG-1 Video Encoder 0
-d 10509922 W99200F/W9922PF MPEG-1/2 Video Encoder 0
-d 10509970 W9970CF 0
-v 1051 Anigma, Inc. 0
-v 1052 ?Young Micro Systems 0
-v 1053 Young Micro Systems 0
-v 1054 Hitachi, Ltd 0
-v 1055 Efar Microsystems 0
-d 10559130 SLC90E66 [Victory66] IDE 0
-d 10559460 SLC90E66 [Victory66] ISA 0
-d 10559462 SLC90E66 [Victory66] USB 0
-d 10559463 SLC90E66 [Victory66] ACPI 0
-v 1056 ICL 0
-v 1057 Motorola 0 Motorola made a mistake and used 1507 instead of 1057 in some chips. Please look at the 1507 entry as well when updating this.
-d 10570001 MPC105 [Eagle] 0
-d 10570002 MPC106 [Grackle] 0
-d 10570003 MPC8240 [Kahlua] 0
-d 10570004 MPC107 0
-d 10570006 MPC8245 [Unity] 0
-d 10570008 MPC8540 0
-d 10570009 MPC8560 0
-d 10570100 MC145575 [HFC-PCI] 0
-d 10570431 KTI829c 100VG 0
-d 10571801 DSP56301 Digital Signal Processor 0
-s 1057180114fb0101 Transas Radar Imitator Board [RIM] 0
-s 1057180114fb0102 Transas Radar Imitator Board [RIM-2] 0
-s 1057180114fb0202 Transas Radar Integrator Board [RIB-2] 0
-s 1057180114fb0611 1 channel CAN bus Controller [CanPci-1] 0
-s 1057180114fb0612 2 channels CAN bus Controller [CanPci-2] 0
-s 1057180114fb0613 3 channels CAN bus Controller [CanPci-3] 0
-s 1057180114fb0614 4 channels CAN bus Controller [CanPci-4] 0
-s 1057180114fb0621 1 channel CAN bus Controller [CanPci2-1] 0
-s 1057180114fb0622 2 channels CAN bus Controller [CanPci2-2] 0
-s 1057180114fb0810 Transas VTS Radar Integrator Board [RIB-4] 0
-s 10571801175c4200 ASI4215 Audio Adapter 0
-s 10571801175c4300 ASI43xx Audio Adapter 0
-s 10571801175c4400 ASI4401 Audio Adapter 0
-s 10571801ecc00030 Layla 0
-d 105718c0 MPC8265A/MPC8266 0
-d 105718c1 MPC8271/MPC8272 0
-d 10574801 Raven 0
-d 10574802 Falcon 0
-d 10574803 Hawk 0
-d 10574806 CPX8216 0
-d 10574d68 20268 0
-d 10575600 SM56 PCI Modem 0
-s 1057560010570300 SM56 PCI Speakerphone Modem 0
-s 1057560010570301 SM56 PCI Voice Modem 0
-s 1057560010570302 SM56 PCI Fax Modem 0
-s 1057560010575600 SM56 PCI Voice modem 0
-s 1057560013d20300 SM56 PCI Speakerphone Modem 0
-s 1057560013d20301 SM56 PCI Voice modem 0
-s 1057560013d20302 SM56 PCI Fax Modem 0
-s 1057560014360300 SM56 PCI Speakerphone Modem 0
-s 1057560014360301 SM56 PCI Voice modem 0
-s 1057560014360302 SM56 PCI Fax Modem 0
-s 10575600144f100c SM56 PCI Fax Modem 0
-s 1057560014940300 SM56 PCI Speakerphone Modem 0
-s 1057560014940301 SM56 PCI Voice modem 0
-s 1057560014c80300 SM56 PCI Speakerphone Modem 0
-s 1057560014c80302 SM56 PCI Fax Modem 0
-s 1057560016680300 SM56 PCI Speakerphone Modem 0
-s 1057560016680302 SM56 PCI Fax Modem 0
-d 10575803 MPC5200 0
-d 10576400 MPC190 Security Processor (S1 family, encryption) 0
-d 10576405 MPC184 Security Processor (S1 family) 0
-v 1058 Electronics & Telecommunications RSH 0
-v 1059 Teknor Industrial Computers Inc 0
-v 105a Promise Technology, Inc. 0
-d 105a0d30 PDC20265 (FastTrak100 Lite/Ultra100) 0 more correct description from promise linux sources
-s 105a0d30105a4d33 Ultra100 0
-d 105a0d38 20263 0
-s 105a0d38105a4d39 Fasttrak66 0
-d 105a1275 20275 0
-d 105a3318 PDC20318 (SATA150 TX4) 0
-d 105a3319 PDC20319 (FastTrak S150 TX4) 0
-s 105a331980863427 S875WP1-E mainboard 0
-d 105a3371 PDC20371 (FastTrak S150 TX2plus) 0
-d 105a3373 PDC20378 (FastTrak 378/SATA 378) 0
-s 105a3373104380f5 PC-DL Deluxe motherboard 0
-s 105a33731462702e K8T NEO FIS2R motherboard 0
-d 105a3375 PDC20375 (SATA150 TX2plus) 0
-d 105a3376 PDC20376 (FastTrak 376) 0
-s 105a33761043809e A7V8X motherboard 0
-d 105a3574 PDC20579 SATAII 150 IDE Controller 0
-d 105a3d18 PDC20518 SATAII 150 IDE Controller 0
-d 105a4d30 PDC20267 (FastTrak100/Ultra100) 0
-s 105a4d30105a4d33 Ultra100 0
-s 105a4d30105a4d39 FastTrak100 0
-d 105a4d33 20246 0
-s 105a4d33105a4d33 20246 IDE Controller 0
-d 105a4d38 PDC20262 (FastTrak66/Ultra66) 0
-s 105a4d38105a4d30 Ultra Device on SuperTrak 0
-s 105a4d38105a4d33 Ultra66 0
-s 105a4d38105a4d39 FastTrak66 0
-d 105a4d68 PDC20268 (Ultra100 TX2) 0
-s 105a4d68105a4d68 Ultra100TX2 0
-d 105a4d69 20269 0
-s 105a4d69105a4d68 Ultra133TX2 0
-d 105a5275 PDC20276 (MBFastTrak133 Lite) 0
-s 105a5275105a0275 SuperTrak SX6000 IDE 0
-s 105a5275105a1275 MBFastTrak133 Lite (tm) Controller (RAID mode) 0
-s 105a52751458b001 MBUltra 133 0
-d 105a5300 DC5300 0
-d 105a6268 PDC20270 (FastTrak100 LP/TX2/TX4) 0
-s 105a6268105a4d68 FastTrak100 TX2 0
-d 105a6269 PDC20271 (FastTrak TX2000) 0
-s 105a6269105a6269 FastTrak TX2/TX2000 0
-d 105a6621 PDC20621 (FastTrak S150 SX4/FastTrak SX4000 lite) 0
-d 105a6622 PDC20621 [SATA150 SX4] 4 Channel IDE RAID Controller 0
-d 105a6626 PDC20618 (Ultra 618) 0
-d 105a6629 PDC20619 (FastTrak TX4000) 0
-d 105a7275 PDC20277 (SBFastTrak133 Lite) 0
-v 105b Foxconn International, Inc. 0
-v 105c Wipro Infotech Limited 0
-v 105d Number 9 Computer Company 0
-d 105d2309 Imagine 128 0
-d 105d2339 Imagine 128-II 0
-s 105d2339105d0000 Imagine 128 series 2 4Mb VRAM 0
-s 105d2339105d0001 Imagine 128 series 2 4Mb VRAM 0
-s 105d2339105d0002 Imagine 128 series 2 4Mb VRAM 0
-s 105d2339105d0003 Imagine 128 series 2 4Mb VRAM 0
-s 105d2339105d0004 Imagine 128 series 2 4Mb VRAM 0
-s 105d2339105d0005 Imagine 128 series 2 4Mb VRAM 0
-s 105d2339105d0006 Imagine 128 series 2 4Mb VRAM 0
-s 105d2339105d0007 Imagine 128 series 2 4Mb VRAM 0
-s 105d2339105d0008 Imagine 128 series 2e 4Mb DRAM 0
-s 105d2339105d0009 Imagine 128 series 2e 4Mb DRAM 0
-s 105d2339105d000a Imagine 128 series 2 8Mb VRAM 0
-s 105d2339105d000b Imagine 128 series 2 8Mb H-VRAM 0
-s 105d233911a4000a Barco Metheus 5 Megapixel 0
-s 105d233913cc0000 Barco Metheus 5 Megapixel 0
-s 105d233913cc0004 Barco Metheus 5 Megapixel 0
-s 105d233913cc0005 Barco Metheus 5 Megapixel 0
-s 105d233913cc0006 Barco Metheus 5 Megapixel 0
-s 105d233913cc0008 Barco Metheus 5 Megapixel 0
-s 105d233913cc0009 Barco Metheus 5 Megapixel 0
-s 105d233913cc000a Barco Metheus 5 Megapixel 0
-s 105d233913cc000c Barco Metheus 5 Megapixel 0
-d 105d493d Imagine 128 T2R [Ticket to Ride] 0
-s 105d493d11a4000a Barco Metheus 5 Megapixel, Dual Head 0
-s 105d493d11a4000b Barco Metheus 5 Megapixel, Dual Head 0
-s 105d493d13cc0002 Barco Metheus 4 Megapixel, Dual Head 0
-s 105d493d13cc0003 Barco Metheus 5 Megapixel, Dual Head 0
-s 105d493d13cc0007 Barco Metheus 5 Megapixel, Dual Head 0
-s 105d493d13cc0008 Barco Metheus 5 Megapixel, Dual Head 0
-s 105d493d13cc0009 Barco Metheus 5 Megapixel, Dual Head 0
-s 105d493d13cc000a Barco Metheus 5 Megapixel, Dual Head 0
-d 105d5348 Revolution 4 0
-s 105d5348105d0037 Revolution IV-FP AGP (For SGI 1600SW) 0
-v 105e Vtech Computers Ltd 0
-v 105f Infotronic America Inc 0
-v 1060 United Microelectronics [UMC] 0
-d 10600001 UM82C881 0
-d 10600002 UM82C886 0
-d 10600101 UM8673F 0
-d 10600881 UM8881 0
-d 10600886 UM8886F 0
-d 10600891 UM8891A 0
-d 10601001 UM886A 0
-d 1060673a UM8886BF 0
-d 1060673b EIDE Master/DMA 0
-d 10608710 UM8710 0
-d 1060886a UM8886A 0
-d 10608881 UM8881F 0
-d 10608886 UM8886F 0
-d 1060888a UM8886A 0
-d 10608891 UM8891A 0
-d 10609017 UM9017F 0
-d 10609018 UM9018 0
-d 10609026 UM9026 0
-d 1060e881 UM8881N 0
-d 1060e886 UM8886N 0
-d 1060e88a UM8886N 0
-d 1060e891 UM8891N 0
-v 1061 I.I.T. 0
-d 10610001 AGX016 0
-d 10610002 IIT3204/3501 0
-v 1062 Maspar Computer Corp 0
-v 1063 Ocean Office Automation 0
-v 1064 Alcatel 0
-v 1065 Texas Microsystems 0
-v 1066 PicoPower Technology 0
-d 10660000 PT80C826 0
-d 10660001 PT86C521 [Vesuvius v1] Host Bridge 0
-d 10660002 PT86C523 [Vesuvius v3] PCI-ISA Bridge Master 0
-d 10660003 PT86C524 [Nile] PCI-to-PCI Bridge 0
-d 10660004 PT86C525 [Nile-II] PCI-to-PCI Bridge 0
-d 10660005 National PC87550 System Controller 0
-d 10668002 PT86C523 [Vesuvius v3] PCI-ISA Bridge Slave 0
-v 1067 Mitsubishi Electric 0
-d 10670301 AccelGraphics AccelECLIPSE 0
-d 10670304 AccelGALAXY A2100 [OEM Evans & Sutherland] 0
-d 10670308 Tornado 3000 [OEM Evans & Sutherland] 0
-d 10671002 VG500 [VolumePro Volume Rendering Accelerator] 0
-v 1068 Diversified Technology 0
-v 1069 Mylex Corporation 0
-d 10690001 DAC960P 0
-d 10690002 DAC960PD 0
-d 10690010 DAC960PG 0
-d 10690020 DAC960LA 0
-d 10690050 AcceleRAID 352/170/160 support Device 0
-d 1069b166 Gemstone chipset SCSI controller 0
-s 1069b16610140242 iSeries 2872 DASD IOA 0
-s 1069b16610140266 Dual Channel PCI-X U320 SCSI Adapter 0
-s 1069b16610140278 Dual Channel PCI-X U320 SCSI RAID Adapter 0
-d 1069ba55 eXtremeRAID 1100 support Device 0
-d 1069ba56 eXtremeRAID 2000/3000 support Device 0
-v 106a Aten Research Inc 0
-v 106b Apple Computer Inc. 0
-d 106b0001 Bandit PowerPC host bridge 0
-d 106b0002 Grand Central I/O 0
-d 106b0003 Control Video 0
-d 106b0004 PlanB Video-In 0
-d 106b0007 O'Hare I/O 0
-d 106b000e Hydra Mac I/O 0
-d 106b0010 Heathrow Mac I/O 0
-d 106b0017 Paddington Mac I/O 0
-d 106b0018 UniNorth FireWire 0
-d 106b0019 KeyLargo USB 0
-d 106b001e UniNorth Internal PCI 0
-d 106b001f UniNorth PCI 0
-d 106b0020 UniNorth AGP 0
-d 106b0021 UniNorth GMAC (Sun GEM) 0
-d 106b0022 KeyLargo Mac I/O 0
-d 106b0024 UniNorth/Pangea GMAC (Sun GEM) 0
-d 106b0025 KeyLargo/Pangea Mac I/O 0
-d 106b0026 KeyLargo/Pangea USB 0
-d 106b0027 UniNorth/Pangea AGP 0
-d 106b0028 UniNorth/Pangea PCI 0
-d 106b0029 UniNorth/Pangea Internal PCI 0
-d 106b002d UniNorth 1.5 AGP 0
-d 106b002e UniNorth 1.5 PCI 0
-d 106b002f UniNorth 1.5 Internal PCI 0
-d 106b0030 UniNorth/Pangea FireWire 0
-d 106b0031 UniNorth 2 FireWire 0
-d 106b0032 UniNorth 2 GMAC (Sun GEM) 0
-d 106b0033 UniNorth 2 ATA/100 0
-d 106b0034 UniNorth 2 AGP 0
-d 106b0035 UniNorth 2 PCI 0
-d 106b0036 UniNorth 2 Internal PCI 0
-d 106b003b UniNorth/Intrepid ATA/100 0
-d 106b003e KeyLargo/Intrepid Mac I/O 0
-d 106b003f KeyLargo/Intrepid USB 0
-d 106b0040 K2 KeyLargo USB 0
-d 106b0041 K2 KeyLargo Mac/IO 0
-d 106b0042 K2 FireWire 0
-d 106b0043 K2 ATA/100 0
-d 106b0045 K2 HT-PCI Bridge 0
-d 106b0046 K2 HT-PCI Bridge 0
-d 106b0047 K2 HT-PCI Bridge 0
-d 106b0048 K2 HT-PCI Bridge 0
-d 106b0049 K2 HT-PCI Bridge 0
-d 106b004b U3 AGP 0
-d 106b004c K2 GMAC (Sun GEM) 0
-d 106b004f Shasta Mac I/O 0
-d 106b0050 Shasta IDE 0
-d 106b0051 Shasta (Sun GEM) 0
-d 106b0052 Shasta Firewire 0
-d 106b0053 Shasta PCI Bridge 0
-d 106b0054 Shasta PCI Bridge 0
-d 106b0055 Shasta PCI Bridge 0
-d 106b0058 U3L AGP Bridge 0
-d 106b1645 Tigon3 Gigabit Ethernet NIC (BCM5701) 0
-v 106c Hynix Semiconductor 0
-d 106c8801 Dual Pentium ISA/PCI Motherboard 0
-d 106c8802 PowerPC ISA/PCI Motherboard 0
-d 106c8803 Dual Window Graphics Accelerator 0
-d 106c8804 LAN Controller 0
-d 106c8805 100-BaseT LAN 0
-v 106d Sequent Computer Systems 0
-v 106e DFI, Inc 0
-v 106f City Gate Development Ltd 0
-v 1070 Daewoo Telecom Ltd 0
-v 1071 Mitac 0
-d 10718160 Mitac 8060B Mobile Platform 0
-v 1072 GIT Co Ltd 0
-v 1073 Yamaha Corporation 0
-d 10730001 3D GUI Accelerator 0
-d 10730002 YGV615 [RPA3 3D-Graphics Controller] 0
-d 10730003 YMF-740 0
-d 10730004 YMF-724 0
-s 1073000410730004 YMF724-Based PCI Audio Adapter 0
-d 10730005 DS1 Audio 0
-s 1073000510730005 DS-XG PCI Audio CODEC 0
-d 10730006 DS1 Audio 0
-d 10730008 DS1 Audio 0
-s 1073000810730008 DS-XG PCI Audio CODEC 0
-d 1073000a DS1L Audio 0
-s 1073000a10730004 DS-XG PCI Audio CODEC 0
-s 1073000a1073000a DS-XG PCI Audio CODEC 0
-d 1073000c YMF-740C [DS-1L Audio Controller] 0
-s 1073000c107a000c DS-XG PCI Audio CODEC 0
-d 1073000d YMF-724F [DS-1 Audio Controller] 0
-s 1073000d1073000d DS-XG PCI Audio CODEC 0
-d 10730010 YMF-744B [DS-1S Audio Controller] 0
-s 1073001010730006 DS-XG PCI Audio CODEC 0
-s 1073001010730010 DS-XG PCI Audio CODEC 0
-d 10730012 YMF-754 [DS-1E Audio Controller] 0
-s 1073001210730012 DS-XG PCI Audio Codec 0
-d 10730020 DS-1 Audio 0
-d 10732000 DS2416 Digital Mixing Card 0
-s 1073200010732000 DS2416 Digital Mixing Card 0
-v 1074 NexGen Microsystems 0
-d 10744e78 82c500/1 0
-v 1075 Advanced Integrations Research 0
-v 1076 Chaintech Computer Co. Ltd 0
-v 1077 QLogic Corp. 0
-d 10771016 ISP10160 Single Channel Ultra3 SCSI Processor 0
-d 10771020 ISP1020 Fast-wide SCSI 0
-d 10771022 ISP1022 Fast-wide SCSI 0
-d 10771080 ISP1080 SCSI Host Adapter 0
-d 10771216 ISP12160 Dual Channel Ultra3 SCSI Processor 0
-s 10771216101e8471 QLA12160 on AMI MegaRAID 0
-s 10771216101e8493 QLA12160 on AMI MegaRAID 0
-d 10771240 ISP1240 SCSI Host Adapter 0
-d 10771280 ISP1280 SCSI Host Adapter 0
-d 10772020 ISP2020A Fast!SCSI Basic Adapter 0
-d 10772100 QLA2100 64-bit Fibre Channel Adapter 0
-s 1077210010770001 QLA2100 64-bit Fibre Channel Adapter 0
-d 10772200 QLA2200 64-bit Fibre Channel Adapter 0
-s 1077220010770002 QLA2200 0
-d 10772300 QLA2300 64-bit Fibre Channel Adapter 0
-d 10772312 QLA2312 Fibre Channel Adapter 0
-v 1078 Cyrix Corporation 0
-d 10780000 5510 [Grappa] 0
-d 10780001 PCI Master 0
-d 10780002 5520 [Cognac] 0
-d 10780100 5530 Legacy [Kahlua] 0
-d 10780101 5530 SMI [Kahlua] 0
-d 10780102 5530 IDE [Kahlua] 0
-d 10780103 5530 Audio [Kahlua] 0
-d 10780104 5530 Video [Kahlua] 0
-d 10780400 ZFMicro PCI Bridge 0
-d 10780401 ZFMicro Chipset SMI 0
-d 10780402 ZFMicro Chipset IDE 0
-d 10780403 ZFMicro Expansion Bus 0
-v 1079 I-Bus 0
-v 107a NetWorth 0
-v 107b Gateway 2000 0
-v 107c LG Electronics [Lucky Goldstar Co. Ltd] 0
-v 107d LeadTek Research Inc. 0
-d 107d0000 P86C850 0
-d 107d2134 WinFast 3D S320 II 0
-d 107d2971 [GeForce FX 5900] WinFast A350 TDH MyViVo 0
-v 107e Interphase Corporation 0
-d 107e0001 5515 ATM Adapter [Flipper] 0
-d 107e0002 100 VG AnyLan Controller 0
-d 107e0004 5526 Fibre Channel Host Adapter 0
-d 107e0005 x526 Fibre Channel Host Adapter 0
-d 107e0008 5525/5575 ATM Adapter (155 Mbit) [Atlantic] 0
-d 107e9003 5535-4P-BRI-ST 0
-d 107e9007 5535-4P-BRI-U 0
-d 107e9008 5535-1P-SR 0
-d 107e900c 5535-1P-SR-ST 0
-d 107e900e 5535-1P-SR-U 0
-d 107e9011 5535-1P-PRI 0
-d 107e9013 5535-2P-PRI 0
-d 107e9023 5536-4P-BRI-ST 0
-d 107e9027 5536-4P-BRI-U 0
-d 107e9031 5536-1P-PRI 0
-d 107e9033 5536-2P-PRI 0
-v 107f Data Technology Corporation 0
-d 107f0802 SL82C105 0
-v 1080 Contaq Microsystems 0
-d 10800600 82C599 0
-d 1080c691 Cypress CY82C691 0
-d 1080c693 82c693 0
-v 1081 Supermac Technology 0
-d 10810d47 Radius PCI to NuBUS Bridge 0
-v 1082 EFA Corporation of America 0
-v 1083 Forex Computer Corporation 0
-d 10830001 FR710 0
-v 1084 Parador 0
-v 1085 Tulip Computers Int.B.V. 0
-v 1086 J. Bond Computer Systems 0
-v 1087 Cache Computer 0
-v 1088 Microcomputer Systems (M) Son 0
-v 1089 Data General Corporation 0
-v 108a SBS Technologies 0 Formerly Bit3 Computer Corp.
-d 108a0001 VME Bridge Model 617 0
-d 108a0010 VME Bridge Model 618 0
-d 108a0040 dataBLIZZARD 0
-d 108a3000 VME Bridge Model 2706 0
-v 108c Oakleigh Systems Inc. 0
-v 108d Olicom 0
-d 108d0001 Token-Ring 16/4 PCI Adapter (3136/3137) 0
-d 108d0002 16/4 Token Ring 0
-d 108d0004 RapidFire 3139 Token-Ring 16/4 PCI Adapter 0
-s 108d0004108d0004 OC-3139/3140 RapidFire Token-Ring 16/4 Adapter 0
-d 108d0005 GoCard 3250 Token-Ring 16/4 CardBus PC Card 0
-d 108d0006 OC-3530 RapidFire Token-Ring 100 0
-d 108d0007 RapidFire 3141 Token-Ring 16/4 PCI Fiber Adapter 0
-s 108d0007108d0007 OC-3141 RapidFire Token-Ring 16/4 Adapter 0
-d 108d0008 RapidFire 3540 HSTR 100/16/4 PCI Adapter 0
-s 108d0008108d0008 OC-3540 RapidFire HSTR 100/16/4 Adapter 0
-d 108d0011 OC-2315 0
-d 108d0012 OC-2325 0
-d 108d0013 OC-2183/2185 0
-d 108d0014 OC-2326 0
-d 108d0019 OC-2327/2250 10/100 Ethernet Adapter 0
-s 108d0019108d0016 OC-2327 Rapidfire 10/100 Ethernet Adapter 0
-s 108d0019108d0017 OC-2250 GoCard 10/100 Ethernet Adapter 0
-d 108d0021 OC-6151/6152 [RapidFire ATM 155] 0
-d 108d0022 ATM Adapter 0
-v 108e Sun Microsystems Computer Corp. 0
-d 108e0001 EBUS 0
-d 108e1000 EBUS 0
-d 108e1001 Happy Meal 0
-d 108e1100 RIO EBUS 0
-d 108e1101 RIO GEM 0
-d 108e1102 RIO 1394 0
-d 108e1103 RIO USB 0
-d 108e2bad GEM 0
-d 108e5000 Simba Advanced PCI Bridge 0
-d 108e5043 SunPCI Co-processor 0
-d 108e8000 Psycho PCI Bus Module 0
-d 108e8001 Schizo PCI Bus Module 0
-d 108ea000 Ultra IIi 0
-d 108ea001 Ultra IIe 0
-d 108ea801 Tomatillo PCI Bus Module 0
-d 108eabba Cassini 10/100/1000 0
-v 108f Systemsoft 0
-v 1090 Encore Computer Corporation 0
-v 1091 Intergraph Corporation 0
-d 10910020 3D graphics processor 0
-d 10910021 3D graphics processor w/Texturing 0
-d 10910040 3D graphics frame buffer 0
-d 10910041 3D graphics frame buffer 0
-d 10910060 Proprietary bus bridge 0
-d 109100e4 Powerstorm 4D50T 0
-d 10910720 Motion JPEG codec 0
-d 109107a0 Sun Expert3D-Lite Graphics Accelerator 0
-d 10911091 Sun Expert3D Graphics Accelerator 0
-v 1092 Diamond Multimedia Systems 0
-d 109200a0 Speedstar Pro SE 0
-d 109200a8 Speedstar 64 0
-d 10920550 Viper V550 0
-d 109208d4 Supra 2260 Modem 0
-d 1092094c SupraExpress 56i Pro 0
-d 10921092 Viper V330 0
-d 10926120 Maximum DVD 0
-d 10928810 Stealth SE 0
-d 10928811 Stealth 64/SE 0
-d 10928880 Stealth 0
-d 10928881 Stealth 0
-d 109288b0 Stealth 64 0
-d 109288b1 Stealth 64 0
-d 109288c0 Stealth 64 0
-d 109288c1 Stealth 64 0
-d 109288d0 Stealth 64 0
-d 109288d1 Stealth 64 0
-d 109288f0 Stealth 64 0
-d 109288f1 Stealth 64 0
-d 10929999 DMD-I0928-1 "Monster sound" sound chip 0
-v 1093 National Instruments 0
-d 10930160 PCI-DIO-96 0
-d 10930162 PCI-MIO-16XE-50 0
-d 10931170 PCI-MIO-16XE-10 0
-d 10931180 PCI-MIO-16E-1 0
-d 10931190 PCI-MIO-16E-4 0
-d 10931330 PCI-6031E 0
-d 10931350 PCI-6071E 0
-d 109314e0 PCI-6110 0
-d 109314f0 PCI-6111 0
-d 109317d0 PCI-6503 0
-d 10931870 PCI-6713 0
-d 10931880 PCI-6711 0
-d 109318b0 PCI-6052E 0
-d 10932410 PCI-6733 0
-d 10932890 PCI-6036E 0
-d 10932a60 PCI-6023E 0
-d 10932a70 PCI-6024E 0
-d 10932a80 PCI-6025E 0
-d 10932c80 PCI-6035E 0
-d 10932ca0 PCI-6034E 0
-d 1093b001 IMAQ-PCI-1408 0
-d 1093b011 IMAQ-PXI-1408 0
-d 1093b021 IMAQ-PCI-1424 0
-d 1093b031 IMAQ-PCI-1413 0
-d 1093b041 IMAQ-PCI-1407 0
-d 1093b051 IMAQ-PXI-1407 0
-d 1093b061 IMAQ-PCI-1411 0
-d 1093b071 IMAQ-PCI-1422 0
-d 1093b081 IMAQ-PXI-1422 0
-d 1093b091 IMAQ-PXI-1411 0
-d 1093c801 PCI-GPIB 0
-d 1093c831 PCI-GPIB bridge 0
-v 1094 First International Computers [FIC] 0
-v 1095 Silicon Image, Inc. (formerly CMD Technology Inc) 0
-d 10950240 Adaptec AAR-1210SA SATA HostRAID Controller 0
-d 10950640 PCI0640 0
-d 10950643 PCI0643 0
-d 10950646 PCI0646 0
-d 10950647 PCI0647 0
-d 10950648 PCI0648 0
-d 10950649 SiI 0649 Ultra ATA/100 PCI to ATA Host Controller 0
-s 109506490e11005d Integrated Ultra ATA-100 Dual Channel Controller 0
-s 109506490e11007e Integrated Ultra ATA-100 IDE RAID Controller 0
-s 10950649101e0649 AMI MegaRAID IDE 100 Controller 0
-d 10950650 PBC0650A 0
-d 10950670 USB0670 0
-s 1095067010950670 USB0670 0
-d 10950673 USB0673 0
-d 10950680 PCI0680 Ultra ATA-133 Host Controller 0
-s 1095068010953680 Winic W-680 (Silicon Image 680 based) 0
-d 10953112 SiI 3112 [SATALink/SATARaid] Serial ATA Controller 0
-s 1095311210953112 SiI 3112 SATALink Controller 0
-s 1095311210956112 SiI 3112 SATARaid Controller 0
-d 10953114 SiI 3114 [SATALink/SATARaid] Serial ATA Controller 0
-s 1095311410953114 SiI 3114 SATALink Controller 0
-s 1095311410956114 SiI 3114 SATARaid Controller 0
-d 10953124 SiI 3124 PCI-X Serial ATA Controller 0
-s 1095312410953124 SiI 3124 PCI-X Serial ATA Controller 0
-d 10953512 SiI 3512 [SATALink/SATARaid] Serial ATA Controller 0
-s 1095351210953512 SiI 3512 SATALink Controller 0
-s 1095351210956512 SiI 3512 SATARaid Controller 0
-v 1096 Alacron 0
-v 1097 Appian Technology 0
-v 1098 Quantum Designs (H.K.) Ltd 0
-d 10980001 QD-8500 0
-d 10980002 QD-8580 0
-v 1099 Samsung Electronics Co., Ltd 0
-v 109a Packard Bell 0
-v 109b Gemlight Computer Ltd. 0
-v 109c Megachips Corporation 0
-v 109d Zida Technologies Ltd. 0
-v 109e Brooktree Corporation 0
-d 109e0350 Bt848 Video Capture 0
-d 109e0351 Bt849A Video capture 0
-d 109e0369 Bt878 Video Capture 0
-s 109e036910020001 TV-Wonder 0
-s 109e036910020003 TV-Wonder/VE 0
-d 109e036c Bt879(?) Video Capture 0
-s 109e036c13e90070 Win/TV (Video Section) 0
-d 109e036e Bt878 Video Capture 0
-s 109e036e007013eb WinTV Series 0
-s 109e036e0070ff01 Viewcast Osprey 200 0
-s 109e036e00710101 DigiTV PCI 0
-s 109e036e107d6606 WinFast TV 2000 0
-s 109e036e11bd0012 PCTV pro (TV + FM stereo receiver) 0
-s 109e036e11bd001c PCTV Sat (DBC receiver) 0
-s 109e036e127a0001 Bt878 Mediastream Controller NTSC 0
-s 109e036e127a0002 Bt878 Mediastream Controller PAL BG 0
-s 109e036e127a0003 Bt878a Mediastream Controller PAL BG 0
-s 109e036e127a0048 Bt878/832 Mediastream Controller 0
-s 109e036e144f3000 MagicTView CPH060 - Video 0
-s 109e036e14610002 TV98 Series (TV/No FM/Remote) 0
-s 109e036e14610004 AVerTV WDM Video Capture 0
-s 109e036e14610761 AverTV DVB-T 0
-s 109e036e14f10001 Bt878 Mediastream Controller NTSC 0
-s 109e036e14f10002 Bt878 Mediastream Controller PAL BG 0
-s 109e036e14f10003 Bt878a Mediastream Controller PAL BG 0
-s 109e036e14f10048 Bt878/832 Mediastream Controller 0
-s 109e036e18220001 VisionPlus DVB card 0
-s 109e036e18511850 FlyVideo'98 - Video 0
-s 109e036e18511851 FlyVideo II 0
-s 109e036e18521852 FlyVideo'98 - Video (with FM Tuner) 0
-s 109e036e270ffc00 Digitop DTT-1000 0
-s 109e036ebd111200 PCTV pro (TV + FM stereo receiver) 0
-d 109e036f Bt879 Video Capture 0
-s 109e036f127a0044 Bt879 Video Capture NTSC 0
-s 109e036f127a0122 Bt879 Video Capture PAL I 0
-s 109e036f127a0144 Bt879 Video Capture NTSC 0
-s 109e036f127a0222 Bt879 Video Capture PAL BG 0
-s 109e036f127a0244 Bt879a Video Capture NTSC 0
-s 109e036f127a0322 Bt879 Video Capture NTSC 0
-s 109e036f127a0422 Bt879 Video Capture NTSC 0
-s 109e036f127a1122 Bt879 Video Capture PAL I 0
-s 109e036f127a1222 Bt879 Video Capture PAL BG 0
-s 109e036f127a1322 Bt879 Video Capture NTSC 0
-s 109e036f127a1522 Bt879a Video Capture PAL I 0
-s 109e036f127a1622 Bt879a Video Capture PAL BG 0
-s 109e036f127a1722 Bt879a Video Capture NTSC 0
-s 109e036f14f10044 Bt879 Video Capture NTSC 0
-s 109e036f14f10122 Bt879 Video Capture PAL I 0
-s 109e036f14f10144 Bt879 Video Capture NTSC 0
-s 109e036f14f10222 Bt879 Video Capture PAL BG 0
-s 109e036f14f10244 Bt879a Video Capture NTSC 0
-s 109e036f14f10322 Bt879 Video Capture NTSC 0
-s 109e036f14f10422 Bt879 Video Capture NTSC 0
-s 109e036f14f11122 Bt879 Video Capture PAL I 0
-s 109e036f14f11222 Bt879 Video Capture PAL BG 0
-s 109e036f14f11322 Bt879 Video Capture NTSC 0
-s 109e036f14f11522 Bt879a Video Capture PAL I 0
-s 109e036f14f11622 Bt879a Video Capture PAL BG 0
-s 109e036f14f11722 Bt879a Video Capture NTSC 0
-s 109e036f18511850 FlyVideo'98 - Video 0
-s 109e036f18511851 FlyVideo II 0
-s 109e036f18521852 FlyVideo'98 - Video (with FM Tuner) 0
-d 109e0370 Bt880 Video Capture 0
-s 109e037018511850 FlyVideo'98 0
-s 109e037018511851 FlyVideo'98 EZ - video 0
-s 109e037018521852 FlyVideo'98 (with FM Tuner) 0
-d 109e0878 Bt878 Audio Capture 0
-s 109e0878007013eb WinTV Series 0
-s 109e08780070ff01 Viewcast Osprey 200 0
-s 109e087800710101 DigiTV PCI 0
-s 109e087810020001 TV-Wonder 0
-s 109e087810020003 TV-Wonder/VE 0
-s 109e087811bd0012 PCTV pro (TV + FM stereo receiver, audio section) 0
-s 109e087811bd001c PCTV Sat (DBC receiver) 0
-s 109e0878127a0001 Bt878 Video Capture (Audio Section) 0
-s 109e0878127a0002 Bt878 Video Capture (Audio Section) 0
-s 109e0878127a0003 Bt878 Video Capture (Audio Section) 0
-s 109e0878127a0048 Bt878 Video Capture (Audio Section) 0
-s 109e087813e90070 Win/TV (Audio Section) 0
-s 109e0878144f3000 MagicTView CPH060 - Audio 0
-s 109e087814610004 AVerTV WDM Audio Capture 0
-s 109e087814610761 AVerTV DVB-T 0
-s 109e087814f10001 Bt878 Video Capture (Audio Section) 0
-s 109e087814f10002 Bt878 Video Capture (Audio Section) 0
-s 109e087814f10003 Bt878 Video Capture (Audio Section) 0
-s 109e087814f10048 Bt878 Video Capture (Audio Section) 0
-s 109e087818220001 VisionPlus DVB Card 0
-s 109e0878270ffc00 Digitop DTT-1000 0
-s 109e0878bd111200 PCTV pro (TV + FM stereo receiver, audio section) 0
-d 109e0879 Bt879 Audio Capture 0
-s 109e0879127a0044 Bt879 Video Capture (Audio Section) 0
-s 109e0879127a0122 Bt879 Video Capture (Audio Section) 0
-s 109e0879127a0144 Bt879 Video Capture (Audio Section) 0
-s 109e0879127a0222 Bt879 Video Capture (Audio Section) 0
-s 109e0879127a0244 Bt879 Video Capture (Audio Section) 0
-s 109e0879127a0322 Bt879 Video Capture (Audio Section) 0
-s 109e0879127a0422 Bt879 Video Capture (Audio Section) 0
-s 109e0879127a1122 Bt879 Video Capture (Audio Section) 0
-s 109e0879127a1222 Bt879 Video Capture (Audio Section) 0
-s 109e0879127a1322 Bt879 Video Capture (Audio Section) 0
-s 109e0879127a1522 Bt879 Video Capture (Audio Section) 0
-s 109e0879127a1622 Bt879 Video Capture (Audio Section) 0
-s 109e0879127a1722 Bt879 Video Capture (Audio Section) 0
-s 109e087914f10044 Bt879 Video Capture (Audio Section) 0
-s 109e087914f10122 Bt879 Video Capture (Audio Section) 0
-s 109e087914f10144 Bt879 Video Capture (Audio Section) 0
-s 109e087914f10222 Bt879 Video Capture (Audio Section) 0
-s 109e087914f10244 Bt879 Video Capture (Audio Section) 0
-s 109e087914f10322 Bt879 Video Capture (Audio Section) 0
-s 109e087914f10422 Bt879 Video Capture (Audio Section) 0
-s 109e087914f11122 Bt879 Video Capture (Audio Section) 0
-s 109e087914f11222 Bt879 Video Capture (Audio Section) 0
-s 109e087914f11322 Bt879 Video Capture (Audio Section) 0
-s 109e087914f11522 Bt879 Video Capture (Audio Section) 0
-s 109e087914f11622 Bt879 Video Capture (Audio Section) 0
-s 109e087914f11722 Bt879 Video Capture (Audio Section) 0
-d 109e0880 Bt880 Audio Capture 0
-d 109e2115 BtV 2115 Mediastream controller 0
-d 109e2125 BtV 2125 Mediastream controller 0
-d 109e2164 BtV 2164 0
-d 109e2165 BtV 2165 0
-d 109e8230 Bt8230 ATM Segment/Reassembly Ctrlr (SRC) 0
-d 109e8472 Bt8472 0
-d 109e8474 Bt8474 0
-v 109f Trigem Computer Inc. 0
-v 10a0 Meidensha Corporation 0
-v 10a1 Juko Electronics Ind. Co. Ltd 0
-v 10a2 Quantum Corporation 0
-v 10a3 Everex Systems Inc 0
-v 10a4 Globe Manufacturing Sales 0
-v 10a5 Smart Link Ltd. 0
-d 10a53052 SmartPCI562 56K Modem 0
-d 10a55449 SmartPCI561 modem 0
-v 10a6 Informtech Industrial Ltd. 0
-v 10a7 Benchmarq Microelectronics 0
-v 10a8 Sierra Semiconductor 0
-d 10a80000 STB Horizon 64 0
-v 10a9 Silicon Graphics, Inc. 0
-d 10a90001 Crosstalk to PCI Bridge 0
-d 10a90002 Linc I/O controller 0
-d 10a90003 IOC3 I/O controller 0
-d 10a90004 O2 MACE 0
-d 10a90005 RAD Audio 0
-d 10a90006 HPCEX 0
-d 10a90007 RPCEX 0
-d 10a90008 DiVO VIP 0
-d 10a90009 AceNIC Gigabit Ethernet 0
-s 10a9000910a98002 AceNIC Gigabit Ethernet 0
-d 10a90010 AMP Video I/O 0
-d 10a90011 GRIP 0
-d 10a90012 SGH PSHAC GSN 0
-d 10a91001 Magic Carpet 0
-d 10a91002 Lithium 0
-d 10a91003 Dual JPEG 1 0
-d 10a91004 Dual JPEG 2 0
-d 10a91005 Dual JPEG 3 0
-d 10a91006 Dual JPEG 4 0
-d 10a91007 Dual JPEG 5 0
-d 10a91008 Cesium 0
-d 10a9100a IOC4 I/O controller 0
-d 10a92001 Fibre Channel 0
-d 10a92002 ASDE 0
-d 10a98001 O2 1394 0
-d 10a98002 G-net NT 0
-v 10aa ACC Microelectronics 0
-d 10aa0000 ACCM 2188 0
-v 10ab Digicom 0
-v 10ac Honeywell IAC 0
-v 10ad Symphony Labs 0
-d 10ad0001 W83769F 0
-d 10ad0003 SL82C103 0
-d 10ad0005 SL82C105 0
-d 10ad0103 SL82c103 0
-d 10ad0105 SL82c105 0
-d 10ad0565 W83C553 0
-v 10ae Cornerstone Technology 0
-v 10af Micro Computer Systems Inc 0
-v 10b0 CardExpert Technology 0
-v 10b1 Cabletron Systems Inc 0
-v 10b2 Raytheon Company 0
-v 10b3 Databook Inc 0
-d 10b33106 DB87144 0
-d 10b3b106 DB87144 0
-v 10b4 STB Systems Inc 0
-d 10b41b1d Velocity 128 3D 0
-s 10b41b1d10b4237e Velocity 4400 0
-v 10b5 PLX Technology, Inc. 0
-d 10b50001 i960 PCI bus interface 0
-d 10b51076 VScom 800 8 port serial adaptor 0
-d 10b51077 VScom 400 4 port serial adaptor 0
-d 10b51078 VScom 210 2 port serial and 1 port parallel adaptor 0
-d 10b51103 VScom 200 2 port serial adaptor 0
-d 10b51146 VScom 010 1 port parallel adaptor 0
-d 10b51147 VScom 020 2 port parallel adaptor 0
-d 10b52724 Thales PCSM Security Card 0
-d 10b59030 PCI <-> IOBus Bridge Hot Swap 0
-s 10b5903010b52862 Alpermann+Velte PCL PCI LV (3V/5V): Timecode Reader Board 0
-s 10b5903010b52906 Alpermann+Velte PCI TS (3V/5V): Time Synchronisation Board 0
-s 10b5903010b52940 Alpermann+Velte PCL PCI D (3V/5V): Timecode Reader Board 0
-s 10b5903015ed1002 MCCS 8-port Serial Hot Swap 0
-s 10b5903015ed1003 MCCS 16-port Serial Hot Swap 0
-d 10b59036 9036 0
-d 10b59050 PCI <-> IOBus Bridge 0
-s 10b5905010b51067 IXXAT CAN i165 0
-s 10b5905010b51172 IK220 (Heidenhain) 0
-s 10b5905010b52036 SatPak GPS 0
-s 10b5905010b52221 Alpermann+Velte PCL PCI LV: Timecode Reader Board 0
-s 10b5905010b52273 SH-ARC SoHard ARCnet card 0
-s 10b5905010b52431 Alpermann+Velte PCL PCI D: Timecode Reader Board 0
-s 10b5905010b52905 Alpermann+Velte PCI TS: Time Synchronisation Board 0
-s 10b5905010b59050 MP9050 0
-s 10b5905014980362 TPMC866 8 Channel Serial Card 0
-s 10b5905015220001 RockForce 4 Port V.90 Data/Fax/Voice Modem 0
-s 10b5905015220002 RockForce 2 Port V.90 Data/Fax/Voice Modem 0
-s 10b5905015220003 RockForce 6 Port V.90 Data/Fax/Voice Modem 0
-s 10b5905015220004 RockForce 8 Port V.90 Data/Fax/Voice Modem 0
-s 10b5905015220010 RockForce2000 4 Port V.90 Data/Fax/Voice Modem 0
-s 10b5905015220020 RockForce2000 2 Port V.90 Data/Fax/Voice Modem 0
-s 10b5905015ed1000 Macrolink MCCS 8-port Serial 0
-s 10b5905015ed1001 Macrolink MCCS 16-port Serial 0
-s 10b5905015ed1002 Macrolink MCCS 8-port Serial Hot Swap 0
-s 10b5905015ed1003 Macrolink MCCS 16-port Serial Hot Swap 0
-s 10b5905056542036 OpenSwitch 6 Telephony card 0 Sorry, there was a typo
-s 10b5905056543132 OpenSwitch 12 Telephony card 0 Sorry, there was a typo
-s 10b5905056545634 OpenLine4 Telephony Card 0
-s 10b59050d531c002 PCIntelliCAN 2xSJA1000 CAN bus 0
-s 10b59050d84d4006 EX-4006 1P 0
-s 10b59050d84d4008 EX-4008 1P EPP/ECP 0
-s 10b59050d84d4014 EX-4014 2P 0
-s 10b59050d84d4018 EX-4018 3P EPP/ECP 0
-s 10b59050d84d4025 EX-4025 1S(16C550) RS-232 0
-s 10b59050d84d4027 EX-4027 1S(16C650) RS-232 0
-s 10b59050d84d4028 EX-4028 1S(16C850) RS-232 0
-s 10b59050d84d4036 EX-4036 2S(16C650) RS-232 0
-s 10b59050d84d4037 EX-4037 2S(16C650) RS-232 0
-s 10b59050d84d4038 EX-4038 2S(16C850) RS-232 0
-s 10b59050d84d4052 EX-4052 1S(16C550) RS-422/485 0
-s 10b59050d84d4053 EX-4053 2S(16C550) RS-422/485 0
-s 10b59050d84d4055 EX-4055 4S(16C550) RS-232 0
-s 10b59050d84d4058 EX-4055 4S(16C650) RS-232 0
-s 10b59050d84d4065 EX-4065 8S(16C550) RS-232 0
-s 10b59050d84d4068 EX-4068 8S(16C650) RS-232 0
-s 10b59050d84d4078 EX-4078 2S(16C552) RS-232+1P 0
-d 10b59054 PCI <-> IOBus Bridge 0
-s 10b5905410b52455 Wessex Techology PHIL-PCI 0
-s 10b5905410b52696 Innes Corp AM Radcap card 0
-s 10b5905410b52717 Innes Corp Auricon card 0
-s 10b5905410b52844 Innes Corp TVS Encoder card 0
-s 10b5905412d90002 PCI Prosody Card rev 1.5 0
-s 10b5905416df0011 PIKA PrimeNet MM PCI 0
-s 10b5905416df0012 PIKA PrimeNet MM cPCI 8 0
-s 10b5905416df0013 PIKA PrimeNet MM cPCI 8 (without CAS Signaling Option) 0
-s 10b5905416df0014 PIKA PrimeNet MM cPCI 4 0
-s 10b5905416df0015 PIKA Daytona MM 0
-s 10b5905416df0016 PIKA InLine MM 0
-d 10b59056 Francois 0
-s 10b5905610b52979 CellinkBlade 11 - CPCI board VoATM AAL1 0
-d 10b59060 9060 0
-d 10b5906d 9060SD 0
-s 10b5906d125c0640 Aries 16000P 0
-d 10b5906e 9060ES 0
-d 10b59080 9080 0
-s 10b59080103c10eb (Agilent) E2777B 83K Series PCI based Optical Communication Interface 0
-s 10b59080103c10ec (Agilent) E6978-66442 PCI CIC 0
-s 10b5908010b59080 9080 [real subsystem ID not set] 0
-s 10b59080129d0002 Aculab PCI Prosidy card 0
-s 10b5908012d90002 PCI Prosody Card 0
-s 10b5908012df4422 4422PCI ["Do-All" Telemetry Data Aquisition System] 0
-d 10b5bb04 B&B 3PCIOSD1A Isolated PCI Serial 0
-v 10b6 Madge Networks 0
-d 10b60001 Smart 16/4 PCI Ringnode 0
-d 10b60002 Smart 16/4 PCI Ringnode Mk2 0
-s 10b6000210b60002 Smart 16/4 PCI Ringnode Mk2 0
-s 10b6000210b60006 16/4 CardBus Adapter 0
-d 10b60003 Smart 16/4 PCI Ringnode Mk3 0
-s 10b600030e11b0fd Compaq NC4621 PCI, 4/16, WOL 0
-s 10b6000310b60003 Smart 16/4 PCI Ringnode Mk3 0
-s 10b6000310b60007 Presto PCI Plus Adapter 0
-d 10b60004 Smart 16/4 PCI Ringnode Mk1 0
-d 10b60006 16/4 Cardbus Adapter 0
-s 10b6000610b60006 16/4 CardBus Adapter 0
-d 10b60007 Presto PCI Adapter 0
-s 10b6000710b60007 Presto PCI 0
-d 10b60009 Smart 100/16/4 PCI-HS Ringnode 0
-s 10b6000910b60009 Smart 100/16/4 PCI-HS Ringnode 0
-d 10b6000a Smart 100/16/4 PCI Ringnode 0
-s 10b6000a10b6000a Smart 100/16/4 PCI Ringnode 0
-d 10b6000b 16/4 CardBus Adapter Mk2 0
-s 10b6000b10b60008 16/4 CardBus Adapter Mk2 0
-s 10b6000b10b6000b 16/4 Cardbus Adapter Mk2 0
-d 10b6000c RapidFire 3140V2 16/4 TR Adapter 0
-s 10b6000c10b6000c RapidFire 3140V2 16/4 TR Adapter 0
-d 10b61000 Collage 25/155 ATM Client Adapter 0
-d 10b61001 Collage 155 ATM Server Adapter 0
-v 10b7 3Com Corporation 0
-d 10b70001 3c985 1000BaseSX (SX/TX) 0
-d 10b70013 AR5212 802.11abg NIC (3CRDAG675) 0
-s 10b7001310b72031 3CRDAG675 11a/b/g Wireless PCI Adapter 0
-d 10b70910 3C910-A01 0
-d 10b71006 MINI PCI type 3B Data Fax Modem 0
-d 10b71007 Mini PCI 56k Winmodem 0
-s 10b7100710b7615c Mini PCI 56K Modem 0
-d 10b71201 3c982-TXM 10/100baseTX Dual Port A [Hydra] 0
-d 10b71202 3c982-TXM 10/100baseTX Dual Port B [Hydra] 0
-d 10b71700 3c940 10/100/1000Base-T [Marvell] 0
-s 10b71700104380eb P4P800 Mainboard 0
-s 10b7170010b70010 3C940 Gigabit LOM Ethernet Adapter 0
-s 10b7170010b70020 3C941 Gigabit LOM Ethernet Adapter 0
-s 10b71700147b1407 KV8-MAX3 motherboard 0
-d 10b73390 3c339 TokenLink Velocity 0
-d 10b73590 3c359 TokenLink Velocity XL 0
-s 10b7359010b73590 TokenLink Velocity XL Adapter (3C359/359B) 0
-d 10b74500 3c450 HomePNA [Tornado] 0
-d 10b75055 3c555 Laptop Hurricane 0
-d 10b75057 3c575 Megahertz 10/100 LAN CardBus [Boomerang] 0
-s 10b7505710b75a57 3C575 Megahertz 10/100 LAN Cardbus PC Card 0
-d 10b75157 3cCFE575BT Megahertz 10/100 LAN CardBus [Cyclone] 0
-s 10b7515710b75b57 3C575 Megahertz 10/100 LAN Cardbus PC Card 0
-d 10b75257 3cCFE575CT CardBus [Cyclone] 0
-s 10b7525710b75c57 FE575C-3Com 10/100 LAN CardBus-Fast Ethernet 0
-d 10b75900 3c590 10BaseT [Vortex] 0
-d 10b75920 3c592 EISA 10mbps Demon/Vortex 0
-d 10b75950 3c595 100BaseTX [Vortex] 0
-d 10b75951 3c595 100BaseT4 [Vortex] 0
-d 10b75952 3c595 100Base-MII [Vortex] 0
-d 10b75970 3c597 EISA Fast Demon/Vortex 0
-d 10b75b57 3c595 Megahertz 10/100 LAN CardBus [Boomerang] 0
-s 10b75b5710b75b57 3C575 Megahertz 10/100 LAN Cardbus PC Card 0
-d 10b76000 3CRSHPW796 [OfficeConnect Wireless CardBus] 0
-d 10b76001 3com 3CRWE154G72 [Office Connect Wireless LAN Adapter] 0
-d 10b76055 3c556 Hurricane CardBus [Cyclone] 0
-d 10b76056 3c556B CardBus [Tornado] 0
-s 10b7605610b76556 10/100 Mini PCI Ethernet Adapter 0
-d 10b76560 3cCFE656 CardBus [Cyclone] 0
-s 10b7656010b7656a 3CCFEM656 10/100 LAN+56K Modem CardBus 0
-d 10b76561 3cCFEM656 10/100 LAN+56K Modem CardBus 0
-s 10b7656110b7656b 3CCFEM656 10/100 LAN+56K Modem CardBus 0
-d 10b76562 3cCFEM656B 10/100 LAN+Winmodem CardBus [Cyclone] 0
-s 10b7656210b7656b 3CCFEM656B 10/100 LAN+56K Modem CardBus 0
-d 10b76563 3cCFEM656B 10/100 LAN+56K Modem CardBus 0
-s 10b7656310b7656b 3CCFEM656 10/100 LAN+56K Modem CardBus 0
-d 10b76564 3cXFEM656C 10/100 LAN+Winmodem CardBus [Tornado] 0
-d 10b77646 3cSOHO100-TX Hurricane 0
-d 10b77770 3CRWE777 PCI(PLX) Wireless Adaptor [Airconnect] 0
-d 10b77940 3c803 FDDILink UTP Controller 0
-d 10b77980 3c804 FDDILink SAS Controller 0
-d 10b77990 3c805 FDDILink DAS Controller 0
-d 10b780eb 3c940B 10/100/1000Base-T 0
-d 10b78811 Token ring 0
-d 10b79000 3c900 10BaseT [Boomerang] 0
-d 10b79001 3c900 10Mbps Combo [Boomerang] 0
-d 10b79004 3c900B-TPO Etherlink XL [Cyclone] 0
-s 10b7900410b79004 3C900B-TPO Etherlink XL TPO 10Mb 0
-d 10b79005 3c900B-Combo Etherlink XL [Cyclone] 0
-s 10b7900510b79005 3C900B-Combo Etherlink XL Combo 0
-d 10b79006 3c900B-TPC Etherlink XL [Cyclone] 0
-d 10b7900a 3c900B-FL 10base-FL [Cyclone] 0
-d 10b79050 3c905 100BaseTX [Boomerang] 0
-d 10b79051 3c905 100BaseT4 [Boomerang] 0
-d 10b79055 3c905B 100BaseTX [Cyclone] 0
-s 10b7905510280080 3C905B Fast Etherlink XL 10/100 0
-s 10b7905510280081 3C905B Fast Etherlink XL 10/100 0
-s 10b7905510280082 3C905B Fast Etherlink XL 10/100 0
-s 10b7905510280083 3C905B Fast Etherlink XL 10/100 0
-s 10b7905510280084 3C905B Fast Etherlink XL 10/100 0
-s 10b7905510280085 3C905B Fast Etherlink XL 10/100 0
-s 10b7905510280086 3C905B Fast Etherlink XL 10/100 0
-s 10b7905510280087 3C905B Fast Etherlink XL 10/100 0
-s 10b7905510280088 3C905B Fast Etherlink XL 10/100 0
-s 10b7905510280089 3C905B Fast Etherlink XL 10/100 0
-s 10b7905510280090 3C905B Fast Etherlink XL 10/100 0
-s 10b7905510280091 3C905B Fast Etherlink XL 10/100 0
-s 10b7905510280092 3C905B Fast Etherlink XL 10/100 0
-s 10b7905510280093 3C905B Fast Etherlink XL 10/100 0
-s 10b7905510280094 3C905B Fast Etherlink XL 10/100 0
-s 10b7905510280095 3C905B Fast Etherlink XL 10/100 0
-s 10b7905510280096 3C905B Fast Etherlink XL 10/100 0
-s 10b7905510280097 3C905B Fast Etherlink XL 10/100 0
-s 10b7905510280098 3C905B Fast Etherlink XL 10/100 0
-s 10b7905510280099 3C905B Fast Etherlink XL 10/100 0
-s 10b7905510b79055 3C905B Fast Etherlink XL 10/100 0
-d 10b79056 3c905B-T4 Fast EtherLink XL [Cyclone] 0
-d 10b79058 3c905B Deluxe Etherlink 10/100/BNC [Cyclone] 0
-d 10b7905a 3c905B-FX Fast Etherlink XL FX 100baseFx [Cyclone] 0
-d 10b79200 3c905C-TX/TX-M [Tornado] 0
-s 10b7920010280095 3C920 Integrated Fast Ethernet Controller 0
-s 10b7920010280097 3C920 Integrated Fast Ethernet Controller 0
-s 10b79200102800fe Optiplex GX240 0
-s 10b792001028012a 3C920 Integrated Fast Ethernet Controller [Latitude C640] 0
-s 10b7920010b71000 3C905C-TX Fast Etherlink for PC Management NIC 0
-s 10b7920010b77000 10/100 Mini PCI Ethernet Adapter 0
-s 10b7920010f12466 Tiger MPX S2466 (3C920 Integrated Fast Ethernet Controller) 0
-d 10b79201 3C920B-EMB Integrated Fast Ethernet Controller [Tornado] 0
-s 10b79201104380ab A7N8X Deluxe onboard 3C920B-EMB Integrated Fast Ethernet Controller 0
-d 10b79202 3Com 3C920B-EMB-WNM Integrated Fast Ethernet Controller 0
-d 10b79210 3C920B-EMB-WNM Integrated Fast Ethernet Controller 0
-d 10b79300 3CSOHO100B-TX 910-A01 [tulip] 0
-d 10b79800 3c980-TX Fast Etherlink XL Server Adapter [Cyclone] 0
-s 10b7980010b79800 3c980-TX Fast Etherlink XL Server Adapter 0
-d 10b79805 3c980-C 10/100baseTX NIC [Python-T] 0
-s 10b7980510b71201 EtherLink Server 10/100 Dual Port A 0
-s 10b7980510b71202 EtherLink Server 10/100 Dual Port B 0
-s 10b7980510b79805 3c980 10/100baseTX NIC [Python-T] 0
-s 10b7980510f12462 Thunder K7 S2462 0
-d 10b79900 3C990-TX [Typhoon] 0
-d 10b79902 3CR990-TX-95 [Typhoon 56-bit] 0
-d 10b79903 3CR990-TX-97 [Typhoon 168-bit] 0
-d 10b79904 3C990B-TX-M/3C990BSVR [Typhoon2] 0
-s 10b7990410b71000 3CR990B-TX-M [Typhoon2] 0
-s 10b7990410b72000 3CR990BSVR [Typhoon2 Server] 0
-d 10b79905 3CR990-FX-95/97/95 [Typhon Fiber] 0
-s 10b7990510b71101 3CR990-FX-95 [Typhoon Fiber 56-bit] 0
-s 10b7990510b71102 3CR990-FX-97 [Typhoon Fiber 168-bit] 0
-s 10b7990510b72101 3CR990-FX-95 Server [Typhoon Fiber 56-bit] 0
-s 10b7990510b72102 3CR990-FX-97 Server [Typhoon Fiber 168-bit] 0
-d 10b79908 3CR990SVR95 [Typhoon Server 56-bit] 0
-d 10b79909 3CR990SVR97 [Typhoon Server 168-bit] 0
-d 10b7990a 3C990SVR [Typhoon Server] 0
-d 10b7990b 3C990SVR [Typhoon Server] 0
-v 10b8 Standard Microsystems Corp [SMC] 0
-d 10b80005 83c170 EPIC/100 Fast Ethernet Adapter 0
-s 10b800051055e000 LANEPIC 10/100 [EVB171Q-PCI] 0
-s 10b800051055e002 LANEPIC 10/100 [EVB171G-PCI] 0
-s 10b8000510b8a011 EtherPower II 10/100 0
-s 10b8000510b8a014 EtherPower II 10/100 0
-s 10b8000510b8a015 EtherPower II 10/100 0
-s 10b8000510b8a016 EtherPower II 10/100 0
-s 10b8000510b8a017 EtherPower II 10/100 0
-d 10b80006 83c175 EPIC/100 Fast Ethernet Adapter 0
-s 10b800061055e100 LANEPIC Cardbus Fast Ethernet Adapter 0
-s 10b800061055e102 LANEPIC Cardbus Fast Ethernet Adapter 0
-s 10b800061055e300 LANEPIC Cardbus Fast Ethernet Adapter 0
-s 10b800061055e302 LANEPIC Cardbus Fast Ethernet Adapter 0
-s 10b8000610b8a012 LANEPIC Cardbus Fast Ethernet Adapter 0
-s 10b8000613a28002 LANEPIC Cardbus Fast Ethernet Adapter 0
-s 10b8000613a28006 LANEPIC Cardbus Fast Ethernet Adapter 0
-d 10b81000 FDC 37c665 0
-d 10b81001 FDC 37C922 0
-d 10b82802 SMC2802W [EZ Connect g] 0 802.11g card
-d 10b8a011 83C170QF 0
-d 10b8b106 SMC34C90 0
-v 10b9 ALi Corporation 0
-d 10b90101 CMI8338/C3DX PCI Audio Device 0
-d 10b90111 C-Media CMI8738/C3DX Audio Device (OEM) 0
-s 10b9011110b90111 C-Media CMI8738/C3DX Audio Device (OEM) 0
-d 10b90780 Multi-IO Card 0
-d 10b90782 Multi-IO Card 0
-d 10b91435 M1435 0
-d 10b91445 M1445 0
-d 10b91449 M1449 0
-d 10b91451 M1451 0
-d 10b91461 M1461 0
-d 10b91489 M1489 0
-d 10b91511 M1511 [Aladdin] 0
-d 10b91512 M1512 [Aladdin] 0
-d 10b91513 M1513 [Aladdin] 0
-d 10b91521 M1521 [Aladdin III] 0
-s 10b9152110b91521 ALI M1521 Aladdin III CPU Bridge 0
-d 10b91523 M1523 0
-s 10b9152310b91523 ALI M1523 ISA Bridge 0
-d 10b91531 M1531 [Aladdin IV] 0
-d 10b91533 M1533 PCI to ISA Bridge [Aladdin IV] 0
-s 10b915331014053b ThinkPad R40e (2684-HVG) PCI to ISA Bridge 0
-s 10b9153310b91533 ALI M1533 Aladdin IV ISA Bridge 0
-d 10b91541 M1541 0
-s 10b9154110b91541 ALI M1541 Aladdin V/V+ AGP System Controller 0
-d 10b91543 M1543 0
-d 10b91563 M1563 HyperTransport South Bridge 0
-d 10b91621 M1621 0
-d 10b91631 ALI M1631 PCI North Bridge Aladdin Pro III 0
-d 10b91632 M1632M Northbridge+Trident 0
-d 10b91641 ALI M1641 PCI North Bridge Aladdin Pro IV 0
-d 10b91644 M1644/M1644T Northbridge+Trident 0
-d 10b91646 M1646 Northbridge+Trident 0
-d 10b91647 M1647 Northbridge [MAGiK 1 / MobileMAGiK 1] 0
-d 10b91651 M1651/M1651T Northbridge [Aladdin-Pro 5/5M,Aladdin-Pro 5T/5TM] 0
-d 10b91671 M1671 Super P4 Northbridge [AGP4X,PCI and SDR/DDR] 0
-d 10b91672 M1672 Northbridge [CyberALADDiN-P4] 0
-d 10b91681 M1681 P4 Northbridge [AGP8X,HyperTransport and SDR/DDR] 0
-d 10b91687 M1687 K8 Northbridge [AGP8X and HyperTransport] 0
-d 10b91689 M1689 K8 Northbridge [Super K8 Single Chip] 0
-d 10b93141 M3141 0
-d 10b93143 M3143 0
-d 10b93145 M3145 0
-d 10b93147 M3147 0
-d 10b93149 M3149 0
-d 10b93151 M3151 0
-d 10b93307 M3307 0
-d 10b93309 M3309 0
-d 10b93323 M3325 Video/Audio Decoder 0
-d 10b95212 M4803 0
-d 10b95215 MS4803 0
-d 10b95217 M5217H 0
-d 10b95219 M5219 0
-d 10b95225 M5225 0
-d 10b95229 M5229 IDE 0
-s 10b952291014050f ThinkPad R30 0
-s 10b952291014053d ThinkPad R40e (2684-HVG) builtin IDE 0
-s 10b95229103c0024 Pavilion ze4400 builtin IDE 0
-s 10b9522910438053 A7A266 Motherboard IDE 0
-d 10b95235 M5225 0
-d 10b95237 USB 1.1 Controller 0
-s 10b9523710140540 ThinkPad R40e (2684-HVG) builtin USB 0
-s 10b95237103c0024 Pavilion ze4400 builtin USB 0
-d 10b95239 USB 2.0 Controller 0
-d 10b95243 M1541 PCI to AGP Controller 0
-d 10b95246 AGP8X Controller 0
-d 10b95247 PCI to AGP Controller 0
-d 10b95249 M5249 HTT to PCI Bridge 0
-d 10b95251 M5251 P1394 OHCI 1.0 Controller 0
-d 10b95253 M5253 P1394 OHCI 1.1 Controller 0
-d 10b95261 M5261 Ethernet Controller 0
-d 10b95263 M5263 Ethernet Controller 0
-d 10b95281 ALi M5281 Serial ATA / RAID Host Controller 0
-d 10b95450 Lucent Technologies Soft Modem AMR 0
-d 10b95451 M5451 PCI AC-Link Controller Audio Device 0
-s 10b9545110140506 ThinkPad R30 0
-s 10b954511014053e ThinkPad R40e (2684-HVG) builtin Audio 0
-s 10b95451103c0024 Pavilion ze4400 builtin Audio 0
-s 10b9545110b95451 HP Compaq nc4010 (DY885AA#ABN) 0
-d 10b95453 M5453 PCI AC-Link Controller Modem Device 0
-d 10b95455 M5455 PCI AC-Link Controller Audio Device 0
-d 10b95457 M5457 AC'97 Modem Controller 0
-s 10b9545710140535 ThinkPad R40e (2684-HVG) builtin modem 0
-s 10b95457103c0024 Pavilion ze4400 builtin Modem Device 0
-d 10b95459 SmartLink SmartPCI561 56K Modem 0 Same but more usefull for driver's lookup
-d 10b9545a SmartLink SmartPCI563 56K Modem 0 SmartLink PCI SoftModem
-d 10b95471 M5471 Memory Stick Controller 0
-d 10b95473 M5473 SD-MMC Controller 0
-d 10b97101 M7101 Power Management Controller [PMU] 0
-s 10b9710110140510 ThinkPad R30 0
-s 10b971011014053c ThinkPad R40e (2684-HVG) Power Management Controller 0
-s 10b97101103c0024 Pavilion ze4400 0
-v 10ba Mitsubishi Electric Corp. 0
-d 10ba0301 AccelGraphics AccelECLIPSE 0
-d 10ba0304 AccelGALAXY A2100 [OEM Evans & Sutherland] 0
-d 10ba0308 Tornado 3000 [OEM Evans & Sutherland] 0
-d 10ba1002 VG500 [VolumePro Volume Rendering Accelerator] 0
-v 10bb Dapha Electronics Corporation 0
-v 10bc Advanced Logic Research 0
-v 10bd Surecom Technology 0
-d 10bd0e34 NE-34 0
-v 10be Tseng Labs International Co. 0
-v 10bf Most Inc 0
-v 10c0 Boca Research Inc. 0
-v 10c1 ICM Co., Ltd. 0
-v 10c2 Auspex Systems Inc. 0
-v 10c3 Samsung Semiconductors, Inc. 0
-d 10c31100 Smartether100 SC1100 LAN Adapter (i82557B) 0
-v 10c4 Award Software International Inc. 0
-v 10c5 Xerox Corporation 0
-v 10c6 Rambus Inc. 0
-v 10c7 Media Vision 0
-v 10c8 Neomagic Corporation 0
-d 10c80001 NM2070 [MagicGraph 128] 0
-d 10c80002 NM2090 [MagicGraph 128V] 0
-d 10c80003 NM2093 [MagicGraph 128ZV] 0
-d 10c80004 NM2160 [MagicGraph 128XD] 0
-s 10c80004101400ba MagicGraph 128XD 0
-s 10c8000410251007 MagicGraph 128XD 0
-s 10c8000410280074 MagicGraph 128XD 0
-s 10c8000410280075 MagicGraph 128XD 0
-s 10c800041028007d MagicGraph 128XD 0
-s 10c800041028007e MagicGraph 128XD 0
-s 10c800041033802f MagicGraph 128XD 0
-s 10c80004104d801b MagicGraph 128XD 0
-s 10c80004104d802f MagicGraph 128XD 0
-s 10c80004104d830b MagicGraph 128XD 0
-s 10c8000410ba0e00 MagicGraph 128XD 0
-s 10c8000410c80004 MagicGraph 128XD 0
-s 10c8000410cf1029 MagicGraph 128XD 0
-s 10c8000410f78308 MagicGraph 128XD 0
-s 10c8000410f78309 MagicGraph 128XD 0
-s 10c8000410f7830b MagicGraph 128XD 0
-s 10c8000410f7830d MagicGraph 128XD 0
-s 10c8000410f78312 MagicGraph 128XD 0
-d 10c80005 NM2200 [MagicGraph 256AV] 0
-s 10c80005101400dd ThinkPad 570 0
-s 10c8000510280088 Latitude CPi A 0
-d 10c80006 NM2360 [MagicMedia 256ZX] 0
-d 10c80016 NM2380 [MagicMedia 256XL+] 0
-s 10c8001610c80016 MagicMedia 256XL+ 0
-d 10c80025 NM2230 [MagicGraph 256AV+] 0
-d 10c80083 NM2093 [MagicGraph 128ZV+] 0
-d 10c88005 NM2200 [MagicMedia 256AV Audio] 0
-s 10c880050e11b0d1 MagicMedia 256AV Audio Device on Discovery 0
-s 10c880050e11b126 MagicMedia 256AV Audio Device on Durango 0
-s 10c88005101400dd MagicMedia 256AV Audio Device on BlackTip Thinkpad 0
-s 10c8800510251003 MagicMedia 256AV Audio Device on TravelMate 720 0
-s 10c8800510280088 Latitude CPi A 0
-s 10c880051028008f MagicMedia 256AV Audio Device on Colorado Inspiron 0
-s 10c88005103c0007 MagicMedia 256AV Audio Device on Voyager II 0
-s 10c88005103c0008 MagicMedia 256AV Audio Device on Voyager III 0
-s 10c88005103c000d MagicMedia 256AV Audio Device on Omnibook 900 0
-s 10c8800510c88005 MagicMedia 256AV Audio Device on FireAnt 0
-s 10c88005110a8005 MagicMedia 256AV Audio Device 0
-s 10c8800514c00004 MagicMedia 256AV Audio Device 0
-d 10c88006 NM2360 [MagicMedia 256ZX Audio] 0
-d 10c88016 NM2380 [MagicMedia 256XL+ Audio] 0
-v 10c9 Dataexpert Corporation 0
-v 10ca Fujitsu Microelectr., Inc. 0
-v 10cb Omron Corporation 0
-v 10cc Mai Logic Incorporated 0 nee Mentor ARC Inc
-d 10cc0660 Articia S Host Bridge 0
-d 10cc0661 Articia S PCI Bridge 0
-v 10cd Advanced System Products, Inc 0
-d 10cd1100 ASC1100 0
-d 10cd1200 ASC1200 [(abp940) Fast SCSI-II] 0
-d 10cd1300 ABP940-U / ABP960-U 0
-s 10cd130010cd1310 ASC1300 SCSI Adapter 0
-d 10cd2300 ABP940-UW 0
-d 10cd2500 ABP940-U2W 0
-v 10ce Radius 0
-v 10cf Fujitsu Limited. 0 nee Citicorp TTI
-d 10cf2001 mb86605 0
-v 10d1 FuturePlus Systems Corp. 0
-v 10d2 Molex Incorporated 0
-v 10d3 Jabil Circuit Inc 0
-v 10d4 Hualon Microelectronics 0
-v 10d5 Autologic Inc. 0
-v 10d6 Cetia 0
-v 10d7 BCM Advanced Research 0
-v 10d8 Advanced Peripherals Labs 0
-v 10d9 Macronix, Inc. [MXIC] 0
-d 10d90512 MX98713 0
-d 10d90531 MX987x5 0
-s 10d9053111861200 DFE-540TX ProFAST 10/100 Adapter 0
-d 10d98625 MX86250 0
-d 10d98888 MX86200 0
-v 10da Compaq IPG-Austin 0
-d 10da0508 TC4048 Token Ring 4/16 0
-d 10da3390 Tl3c3x9 0
-v 10db Rohm LSI Systems, Inc. 0
-v 10dc CERN/ECP/EDU 0
-d 10dc0001 STAR/RD24 SCI-PCI (PMC) 0
-d 10dc0002 TAR/RD24 SCI-PCI (PMC) 0
-d 10dc0021 HIPPI destination 0
-d 10dc0022 HIPPI source 0
-d 10dc10dc ATT2C15-3 FPGA 0
-v 10dd Evans & Sutherland 0
-v 10de nVidia Corporation 0
-d 10de0008 NV1 [EDGE 3D] 0
-d 10de0009 NV1 [EDGE 3D] 0
-d 10de0010 NV2 [Mutara V08] 0
-d 10de0020 NV4 [RIVA TNT] 0
-s 10de002010430200 V3400 TNT 0
-s 10de002010480c18 Erazor II SGRAM 0
-s 10de002010480c1b Erazor II 0
-s 10de002010920550 Viper V550 0
-s 10de002010920552 Viper V550 0
-s 10de002010924804 Viper V550 0
-s 10de002010924808 Viper V550 0
-s 10de002010924810 Viper V550 0
-s 10de002010924812 Viper V550 0
-s 10de002010924815 Viper V550 0
-s 10de002010924820 Viper V550 with TV out 0
-s 10de002010924822 Viper V550 0
-s 10de002010924904 Viper V550 0
-s 10de002010924914 Viper V550 0
-s 10de002010928225 Viper V550 0
-s 10de002010b4273d Velocity 4400 0
-s 10de002010b4273e Velocity 4400 0
-s 10de002010b42740 Velocity 4400 0
-s 10de002010de0020 Riva TNT 0
-s 10de002011021015 Graphics Blaster CT6710 0
-s 10de002011021016 Graphics Blaster RIVA TNT 0
-d 10de0028 NV5 [RIVA TNT2/TNT2 Pro] 0
-s 10de002810430200 AGP-V3800 SGRAM 0
-s 10de002810430201 AGP-V3800 SDRAM 0
-s 10de002810430205 PCI-V3800 0
-s 10de002810434000 AGP-V3800PRO 0
-s 10de002810480c21 Synergy II 0
-s 10de002810480c31 Erazor III 0
-s 10de0028107d2134 WinFast 3D S320 II + TV-Out 0
-s 10de002810924804 Viper V770 0
-s 10de002810924a00 Viper V770 0
-s 10de002810924a02 Viper V770 Ultra 0
-s 10de002810925a00 RIVA TNT2/TNT2 Pro 0
-s 10de002810926a02 Viper V770 Ultra 0
-s 10de002810927a02 Viper V770 Ultra 0
-s 10de002810de0005 RIVA TNT2 Pro 0
-s 10de002810de000f Compaq NVIDIA TNT2 Pro 0
-s 10de002811021020 3D Blaster RIVA TNT2 0
-s 10de002811021026 3D Blaster RIVA TNT2 Digital 0
-s 10de002814af5810 Maxi Gamer Xentor 0
-d 10de0029 NV5 [RIVA TNT2 Ultra] 0
-s 10de002910430200 AGP-V3800 Deluxe 0
-s 10de002910430201 AGP-V3800 Ultra SDRAM 0
-s 10de002910430205 PCI-V3800 Ultra 0
-s 10de002911021021 3D Blaster RIVA TNT2 Ultra 0
-s 10de002911021029 3D Blaster RIVA TNT2 Ultra 0
-s 10de00291102102f 3D Blaster RIVA TNT2 Ultra 0
-s 10de002914af5820 Maxi Gamer Xentor 32 0
-d 10de002a NV5 [Riva TnT2] 0
-d 10de002b NV5 [Riva TnT2] 0
-d 10de002c NV6 [Vanta/Vanta LT] 0
-s 10de002c10430200 AGP-V3800 Combat SDRAM 0
-s 10de002c10430201 AGP-V3800 Combat 0
-s 10de002c10926820 Viper V730 0
-s 10de002c11021031 CT6938 VANTA 8MB 0
-s 10de002c11021034 CT6894 VANTA 16MB 0
-s 10de002c14af5008 Maxi Gamer Phoenix 2 0
-d 10de002d NV5M64 [RIVA TNT2 Model 64/Model 64 Pro] 0
-s 10de002d10430200 AGP-V3800M 0
-s 10de002d10430201 AGP-V3800M 0
-s 10de002d10480c3a Erazor III LT 0
-s 10de002d10de001e M64 AGP4x 0
-s 10de002d11021023 CT6892 RIVA TNT2 Value 0
-s 10de002d11021024 CT6932 RIVA TNT2 Value 32Mb 0
-s 10de002d1102102c CT6931 RIVA TNT2 Value [Jumper] 0
-s 10de002d14628808 MSI-8808 0
-s 10de002d15541041 Pixelview RIVA TNT2 M64 0
-d 10de002e NV6 [Vanta] 0
-d 10de002f NV6 [Vanta] 0
-d 10de0034 MCP04 SMBus 0
-d 10de0035 MCP04 IDE 0
-d 10de0036 MCP04 Serial ATA Controller 0
-d 10de0037 MCP04 Ethernet Controller 0
-d 10de0038 MCP04 Ethernet Controller 0
-d 10de003a MCP04 AC'97 Audio Controller 0
-d 10de003b MCP04 USB Controller 0
-d 10de003c MCP04 USB Controller 0
-d 10de003d MCP04 PCI Bridge 0
-d 10de003e MCP04 Serial ATA Controller 0
-d 10de0040 nv40 [GeForce 6800 Ultra] 0
-d 10de0041 NV40 [GeForce 6800] 0
-d 10de0042 NV40.2 0
-d 10de0043 NV40.3 0
-d 10de0045 NV40 [GeForce 6800 GT] 0
-d 10de0049 NV40GL 0
-d 10de004e NV40GL [Quadro FX 4000] 0
-d 10de0052 CK804 SMBus 0
-d 10de0053 CK804 IDE 0
-d 10de0054 CK804 Serial ATA Controller 0
-d 10de0055 CK804 Serial ATA Controller 0
-d 10de0056 CK804 Ethernet Controller 0
-d 10de0057 CK804 Ethernet Controller 0
-d 10de0059 CK804 AC'97 Audio Controller 0
-d 10de005a CK804 USB Controller 0
-d 10de005b CK804 USB Controller 0
-d 10de005c CK804 PCI Bridge 0
-d 10de005d CK804 PCIE Bridge 0
-d 10de005e CK804 Memory Controller 0
-d 10de0060 nForce2 ISA Bridge 0
-s 10de0060104380ad A7N8X Mainboard 0
-d 10de0064 nForce2 SMBus (MCP) 0
-d 10de0065 nForce2 IDE 0
-d 10de0066 nForce2 Ethernet Controller 0
-s 10de0066104380a7 A7N8X Mainboard onboard nForce2 Ethernet 0
-d 10de0067 nForce2 USB Controller 0
-s 10de006710430c11 A7N8X Mainboard 0
-d 10de0068 nForce2 USB Controller 0
-s 10de006810430c11 A7N8X Mainboard 0
-d 10de006a nForce2 AC97 Audio Controler (MCP) 0
-d 10de006b nForce MultiMedia audio [Via VT82C686B] 0
-s 10de006b10de006b nForce2 MCP Audio Processing Unit 0
-d 10de006c nForce2 External PCI Bridge 0
-d 10de006d nForce2 PCI Bridge 0
-d 10de006e nForce2 FireWire (IEEE 1394) Controller 0
-d 10de0084 MCP2A SMBus 0
-d 10de0085 MCP2A IDE 0
-d 10de0086 MCP2A Ethernet Controller 0
-d 10de0087 MCP2A USB Controller 0
-d 10de0088 MCP2A USB Controller 0
-d 10de008a MCP2S AC'97 Audio Controller 0
-d 10de008b MCP2A PCI Bridge 0
-d 10de008c MCP2A Ethernet Controller 0
-d 10de008e nForce2 Serial ATA Controller 0
-d 10de00a0 NV5 [Aladdin TNT2] 0
-s 10de00a014af5810 Maxi Gamer Xentor 0
-d 10de00c0 NV41.0 0
-d 10de00c1 NV41.1 0
-d 10de00c2 NV41.2 0
-d 10de00c8 NV41.8 0
-d 10de00ce NV41GL 0
-d 10de00d0 nForce3 LPC Bridge 0
-d 10de00d1 nForce3 Host Bridge 0
-d 10de00d2 nForce3 AGP Bridge 0
-d 10de00d3 CK804 Memory Controller 0
-d 10de00d4 nForce3 SMBus 0
-d 10de00d5 nForce3 IDE 0
-d 10de00d6 nForce3 Ethernet 0
-d 10de00d7 nForce3 USB 1.1 0
-d 10de00d8 nForce3 USB 2.0 0
-d 10de00da nForce3 Audio 0
-d 10de00dd nForce3 PCI Bridge 0
-d 10de00df CK8S Ethernet Controller 0
-d 10de00e1 nForce3 250Gb Host Bridge 0
-d 10de00e2 nForce3 250Gb AGP Host to PCI Bridge 0
-d 10de00e3 CK8S Serial ATA Controller (v2.5) 0
-d 10de00e4 nForce 250Gb PCI System Management 0
-d 10de00e5 CK8S Parallel ATA Controller (v2.5) 0
-d 10de00e6 CK8S Ethernet Controller 0
-d 10de00e7 CK8S USB Controller 0
-d 10de00e8 CK8S USB Controller 0
-d 10de00ea nForce3 250Gb AC'97 Audio Controller 0
-d 10de00ed nForce3 250Gb PCI-to-PCI Bridge 0
-d 10de00ee CK8S Serial ATA Controller (v2.5) 0
-d 10de00f0 NV40 [GeForce 6800/GeForce 6800 Ultra] 0
-d 10de00f1 NV43 [GeForce 6600/GeForce 6600 GT] 0
-d 10de00f2 NV43 [GeForce 6600 GT] 0
-d 10de00f8 NV45GL [Quadro FX 3400] 0
-d 10de00f9 NV40 [GeForce 6800 Ultra] 0
-d 10de00fa NV36 [GeForce PCX 5750] 0
-d 10de00fb NV35 [GeForce PCX 5900] 0
-d 10de00fc NV37GL [Quadro FX 330/GeForce PCX 5300] 0
-d 10de00fd NV37GL [Quadro FX 330] 0
-d 10de00fe NV38GL [Quadro FX 1300] 0
-d 10de00ff NV18 [GeForce PCX 4300] 0
-d 10de0100 NV10 [GeForce 256 SDR] 0
-s 10de010010430200 AGP-V6600 SGRAM 0
-s 10de010010430201 AGP-V6600 SDRAM 0
-s 10de010010434008 AGP-V6600 SGRAM 0
-s 10de010010434009 AGP-V6600 SDRAM 0
-s 10de01001102102d CT6941 GeForce 256 0
-s 10de010014af5022 3D Prophet SE 0
-d 10de0101 NV10DDR [GeForce 256 DDR] 0
-s 10de010110430202 AGP-V6800 DDR 0
-s 10de01011043400a AGP-V6800 DDR SGRAM 0
-s 10de01011043400b AGP-V6800 DDR SDRAM 0
-s 10de0101107d2822 WinFast GeForce 256 0
-s 10de01011102102e CT6971 GeForce 256 DDR 0
-s 10de010114af5021 3D Prophet DDR-DVI 0
-d 10de0103 NV10GL [Quadro] 0
-d 10de0110 NV11 [GeForce2 MX/MX 400] 0
-s 10de011010434015 AGP-V7100 Pro 0
-s 10de011010434031 V7100 Pro with TV output 0
-s 10de011010de0091 Dell OEM GeForce 2 MX 400 0
-s 10de011014628817 MSI GeForce2 MX400 Pro32S [MS-8817] 0
-s 10de011014af7102 3D Prophet II MX 0
-s 10de011014af7103 3D Prophet II MX Dual-Display 0
-d 10de0111 NV11DDR [GeForce2 MX 100 DDR/200 DDR] 0
-d 10de0112 NV11 [GeForce2 Go] 0
-d 10de0113 NV11GL [Quadro2 MXR/EX] 0
-d 10de0150 NV15 [GeForce2 GTS/Pro] 0
-s 10de015010434016 V7700 AGP Video Card 0
-s 10de0150107d2840 WinFast GeForce2 GTS with TV output 0
-s 10de0150107d2842 WinFast GeForce 2 Pro 0
-s 10de015014628831 Creative GeForce2 Pro 0
-d 10de0151 NV15DDR [GeForce2 Ti] 0
-s 10de01511043405f V7700Ti 0
-s 10de015114625506 Creative 3D Blaster Geforce2 Titanium 0
-d 10de0152 NV15BR [GeForce2 Ultra, Bladerunner] 0
-s 10de015210480c56 GLADIAC Ultra 0
-d 10de0153 NV15GL [Quadro2 Pro] 0
-d 10de0170 NV17 [GeForce4 MX 460] 0
-d 10de0171 NV17 [GeForce4 MX 440] 0
-s 10de017110b00002 Gainward Pro/600 TV 0
-s 10de017114628661 G4MX440-VTP 0
-s 10de017114628730 MX440SES-T (MS-8873) 0
-s 10de0171147b8f00 Abit Siluro GeForce4MX440 0
-d 10de0172 NV17 [GeForce4 MX 420] 0
-d 10de0173 NV17 [GeForce4 MX 440-SE] 0
-d 10de0174 NV17 [GeForce4 440 Go] 0
-d 10de0175 NV17 [GeForce4 420 Go] 0
-d 10de0176 NV17 [GeForce4 420 Go 32M] 0
-s 10de01764c531090 Cx9 / Vx9 mainboard 0
-d 10de0177 NV17 [GeForce4 460 Go] 0
-d 10de0178 NV17GL [Quadro4 550 XGL] 0
-d 10de0179 NV17 [GeForce4 440 Go 64M] 0
-s 10de017910de0179 GeForce4 MX (Mac) 0
-d 10de017a NV17GL [Quadro4 200/400 NVS] 0
-d 10de017b NV17GL [Quadro4 550 XGL] 0
-d 10de017c NV17GL [Quadro4 550 GoGL] 0
-d 10de017d NV17 [GeForce4 410 Go 16M] 0
-d 10de0181 NV18 [GeForce4 MX 440 AGP 8x] 0
-s 10de01811043806f V9180 Magic 0
-s 10de018114628880 MS-StarForce GeForce4 MX 440 with AGP8X 0
-s 10de018114628900 MS-8890 GeForce 4 MX440 AGP8X 0
-s 10de018114629350 MSI Geforce4 MX T8X with AGP8X 0
-s 10de0181147b8f0d Siluro GF4 MX-8X 0
-d 10de0182 NV18 [GeForce4 MX 440SE AGP 8x] 0
-d 10de0183 NV18 [GeForce4 MX 420 AGP 8x] 0
-d 10de0185 NV18 [GeForce4 MX 4000 AGP 8x] 0
-d 10de0186 NV18M [GeForce4 448 Go] 0
-d 10de0187 NV18M [GeForce4 488 Go] 0
-d 10de0188 NV18GL [Quadro4 580 XGL] 0
-d 10de018a NV18GL [Quadro4 NVS AGP 8x] 0
-d 10de018b NV18GL [Quadro4 380 XGL] 0
-d 10de018d NV18M [GeForce4 448 Go] 0
-d 10de01a0 NVCrush11 [GeForce2 MX Integrated Graphics] 0
-d 10de01a4 nForce CPU bridge 0
-d 10de01ab nForce 420 Memory Controller (DDR) 0
-d 10de01ac nForce 220/420 Memory Controller 0
-d 10de01ad nForce 220/420 Memory Controller 0
-d 10de01b0 nForce Audio 0
-d 10de01b1 nForce Audio 0
-d 10de01b2 nForce ISA Bridge 0
-d 10de01b4 nForce PCI System Management 0
-d 10de01b7 nForce AGP to PCI Bridge 0
-d 10de01b8 nForce PCI-to-PCI bridge 0
-d 10de01bc nForce IDE 0
-d 10de01c1 nForce AC'97 Modem Controller 0
-d 10de01c2 nForce USB Controller 0
-d 10de01c3 nForce Ethernet Controller 0
-d 10de01e0 nForce2 AGP (different version?) 0
-d 10de01e8 nForce2 AGP 0
-d 10de01ea nForce2 Memory Controller 0 0
-d 10de01eb nForce2 Memory Controller 1 0
-d 10de01ec nForce2 Memory Controller 2 0
-d 10de01ed nForce2 Memory Controller 3 0
-d 10de01ee nForce2 Memory Controller 4 0
-d 10de01ef nForce2 Memory Controller 5 0
-d 10de01f0 NV18 [GeForce4 MX - nForce GPU] 0
-d 10de0200 NV20 [GeForce3] 0
-s 10de02001043402f AGP-V8200 DDR 0
-d 10de0201 NV20 [GeForce3 Ti 200] 0
-d 10de0202 NV20 [GeForce3 Ti 500] 0
-s 10de02021043405b V8200 T5 0
-s 10de02021545002f Xtasy 6964 0
-d 10de0203 NV20DCC [Quadro DCC] 0
-d 10de0250 NV25 [GeForce4 Ti 4600] 0
-d 10de0251 NV25 [GeForce4 Ti 4400] 0
-s 10de025110438023 v8440 GeForce 4 Ti4400 0
-d 10de0252 NV25 [GeForce4 Ti] 0
-d 10de0253 NV25 [GeForce4 Ti 4200] 0
-s 10de0253107d2896 WinFast A250 LE TD (Dual VGA/TV-out/DVI) 0
-s 10de0253147b8f09 Siluro (Dual VGA/TV-out/DVI) 0
-d 10de0258 NV25GL [Quadro4 900 XGL] 0
-d 10de0259 NV25GL [Quadro4 750 XGL] 0
-d 10de025b NV25GL [Quadro4 700 XGL] 0
-d 10de0280 NV28 [GeForce4 Ti 4800] 0
-d 10de0281 NV28 [GeForce4 Ti 4200 AGP 8x] 0
-d 10de0282 NV28 [GeForce4 Ti 4800 SE] 0
-d 10de0286 NV28 [GeForce4 Ti 4200 Go AGP 8x] 0
-d 10de0288 NV28GL [Quadro4 980 XGL] 0
-d 10de0289 NV28GL [Quadro4 780 XGL] 0
-d 10de028c NV28GLM [Quadro4 700 GoGL] 0
-d 10de0300 NV30 [GeForce FX] 0
-d 10de0301 NV30 [GeForce FX 5800 Ultra] 0
-d 10de0302 NV30 [GeForce FX 5800] 0
-d 10de0308 NV30GL [Quadro FX 2000] 0
-d 10de0309 NV30GL [Quadro FX 1000] 0
-d 10de0311 NV31 [GeForce FX 5600 Ultra] 0
-d 10de0312 NV31 [GeForce FX 5600] 0
-d 10de0313 NV31 0
-d 10de0314 NV31 [GeForce FX 5600XT] 0
-s 10de03141043814a V9560XT/TD 0
-d 10de0316 NV31 0
-d 10de0317 NV31 0
-d 10de031a NV31M [GeForce FX Go 5600] 0
-d 10de031b NV31M [GeForce FX Go5650] 0
-d 10de031c NVIDIA Quadro FX 700 Go 0
-d 10de031d NV31 0
-d 10de031e NV31 0
-d 10de031f NV31 0
-d 10de0320 NV34 [GeForce FX 5200] 0
-d 10de0321 NV34 [GeForce FX 5200 Ultra] 0
-d 10de0322 NV34 [GeForce FX 5200] 0
-s 10de032214629171 MS-8917 (FX5200-T128) 0
-d 10de0323 NV34 [GeForce FX 5200LE] 0
-d 10de0324 NV34M [GeForce FX Go 5200] 0
-s 10de032410718160 MIM2000 0
-d 10de0325 NV34M [GeForce FX Go5250] 0
-d 10de0326 NV34 [GeForce FX 5500] 0
-d 10de0327 NV34 [GeForce FX 5100] 0
-d 10de0328 NV34M [GeForce FX Go 5200] 0
-d 10de0329 NV34M [GeForce FX Go5200] 0
-d 10de032a NV34GL [Quadro NVS 280 PCI] 0
-d 10de032b NV34GL [Quadro FX 500/600 PCI] 0
-d 10de032c NV34GLM [GeForce FX Go 5300] 0
-d 10de032d NV34 [GeForce FX Go5100] 0
-d 10de032f NV34 0
-d 10de0330 NV35 [GeForce FX 5900 Ultra] 0
-d 10de0331 NV35 [GeForce FX 5900] 0
-s 10de033110438145 V9950GE 0
-d 10de0332 NV35 [GeForce FX 5900XT] 0
-d 10de0333 NV38 [GeForce FX 5950 Ultra] 0
-d 10de0334 NV35 [GeForce FX 5900ZT] 0
-d 10de0338 NV35GL [Quadro FX 3000] 0
-d 10de033f NV35GL [Quadro FX 700] 0
-d 10de0341 NV36.1 [GeForce FX 5700 Ultra] 0
-d 10de0342 NV36.2 [GeForce FX 5700] 0
-d 10de0343 NV36 [GeForce FX 5700LE] 0
-d 10de0344 NV36.4 [GeForce FX 5700VE] 0
-d 10de0345 NV36.5 0
-d 10de0347 NV36 [GeForce FX Go5700] 0
-d 10de0348 NV36 [GeForce FX Go5700] 0
-d 10de0349 NV36 0
-d 10de034b NV36 0
-d 10de034c NV36 [Quadro FX Go1000] 0
-d 10de034e NV36GL [Quadro FX 1100] 0
-d 10de034f NV36GL 0
-v 10df Emulex Corporation 0
-d 10df1ae5 LP6000 Fibre Channel Host Adapter 0
-d 10df1ae6 LP 8000 Fibre Channel Host Adapter Alternate ID (JX1:2-3, JX2:1-2) 0
-d 10df1ae7 LP 8000 Fibre Channel Host Adapter Alternate ID (JX1:2-3, JX2:2-3) 0
-d 10dff015 LP1150e 0
-d 10dff085 LP850 Fibre Channel Adapter 0
-d 10dff095 LP952 Fibre Channel Adapter 0
-d 10dff098 LP982 Fibre Channel Adapter 0
-d 10dff0a1 LightPulse Fibre Channel Adapter 0
-d 10dff0a5 LP1050 0
-d 10dff0d5 LP1150 0
-d 10dff100 LP11000e 0
-d 10dff700 LP7000 Fibre Channel Host Adapter 0
-d 10dff701 LP 7000EFibre Channel Host Adapter Alternate ID (JX1:2-3, JX2:1-2) 0
-d 10dff800 LP8000 Fibre Channel Host Adapter 0
-d 10dff801 LP 8000 Fibre Channel Host Adapter Alternate ID (JX1:2-3, JX2:1-2) 0
-d 10dff900 LP9000 Fibre Channel Host Adapter 0
-d 10dff901 LP 9000 Fibre Channel Host Adapter Alternate ID (JX1:2-3, JX2:1-2) 0
-d 10dff980 LP9802 Fibre Channel Adapter 0
-d 10dff981 LP 9802 Fibre Channel Host Adapter Alternate ID 0
-d 10dff982 LP 9802 Fibre Channel Host Adapter Alternate ID 0
-d 10dffa00 LP10000 Fibre Channel Host Adapter 0
-d 10dffa01 LP101 0
-d 10dffb00 LightPulse Fibre Channel Adapter 0
-d 10dffd00 LP11000 0
-v 10e0 Integrated Micro Solutions Inc. 0
-d 10e05026 IMS5026/27/28 0
-d 10e05027 IMS5027 0
-d 10e05028 IMS5028 0
-d 10e08849 IMS8849 0
-d 10e08853 IMS8853 0
-d 10e09128 IMS9128 [Twin turbo 128] 0
-v 10e1 Tekram Technology Co.,Ltd. 0
-d 10e10391 TRM-S1040 0
-s 10e1039110e10391 DC-315U SCSI-3 Host Adapter 0
-d 10e1690c DC-690c 0
-d 10e1dc29 DC-290 0
-v 10e2 Aptix Corporation 0
-v 10e3 Tundra Semiconductor Corp. 0
-d 10e30000 CA91C042 [Universe] 0
-d 10e30860 CA91C860 [QSpan] 0
-d 10e30862 CA91C862A [QSpan-II] 0
-d 10e38260 CA91L8200B [Dual PCI PowerSpan II] 0
-d 10e38261 CA91L8260B [Single PCI PowerSpan II] 0
-v 10e4 Tandem Computers 0
-v 10e5 Micro Industries Corporation 0
-v 10e6 Gainbery Computer Products Inc. 0
-v 10e7 Vadem 0
-v 10e8 Applied Micro Circuits Corp. 0
-d 10e81072 INES GPIB-PCI (AMCC5920 based) 0
-d 10e82011 Q-Motion Video Capture/Edit board 0
-d 10e84750 S5930 [Matchmaker] 0
-d 10e85920 S5920 0
-d 10e88043 LANai4.x [Myrinet LANai interface chip] 0
-d 10e88062 S5933_PARASTATION 0
-d 10e8807d S5933 [Matchmaker] 0
-d 10e88088 Kongsberg Spacetec Format Synchronizer 0
-d 10e88089 Kongsberg Spacetec Serial Output Board 0
-d 10e8809c S5933_HEPC3 0
-d 10e880d7 PCI-9112 0
-d 10e880d9 PCI-9118 0
-d 10e880da PCI-9812 0
-d 10e8811a PCI-IEEE1355-DS-DE Interface 0
-d 10e8814c Fastcom ESCC-PCI (Commtech, Inc.) 0
-d 10e88170 S5933 [Matchmaker] (Chipset Development Tool) 0
-d 10e881e6 Multimedia video controller 0 sold with Roper Scientifc(Photometrics) CoolSnap HQ camera
-d 10e88291 Fastcom 232/8-PCI (Commtech, Inc.) 0
-d 10e882c4 Fastcom 422/4-PCI (Commtech, Inc.) 0
-d 10e882c5 Fastcom 422/2-PCI (Commtech, Inc.) 0
-d 10e882c6 Fastcom IG422/1-PCI (Commtech, Inc.) 0
-d 10e882c7 Fastcom IG232/2-PCI (Commtech, Inc.) 0
-d 10e882ca Fastcom 232/4-PCI (Commtech, Inc.) 0
-d 10e882db AJA HDNTV HD SDI Framestore 0
-d 10e882e2 Fastcom DIO24H-PCI (Commtech, Inc.) 0
-d 10e88851 S5933 on Innes Corp FM Radio Capture card 0
-v 10e9 Alps Electric Co., Ltd. 0
-v 10ea Intergraphics Systems 0
-d 10ea1680 IGA-1680 0
-d 10ea1682 IGA-1682 0
-d 10ea1683 IGA-1683 0
-d 10ea2000 CyberPro 2000 0
-d 10ea2010 CyberPro 2000A 0
-d 10ea5000 CyberPro 5000 0
-d 10ea5050 CyberPro 5050 0
-d 10ea5202 CyberPro 5202 0
-d 10ea5252 CyberPro5252 0 CyberPro5202 Audio Function
-v 10eb Artists Graphics 0
-d 10eb0101 3GA 0
-d 10eb8111 Twist3 Frame Grabber 0
-v 10ec Realtek Semiconductor Co., Ltd. 0
-d 10ec8029 RTL-8029(AS) 0
-s 10ec802910b82011 EZ-Card (SMC1208) 0
-s 10ec802910ec8029 RTL-8029(AS) 0
-s 10ec802911131208 EN1208 0
-s 10ec802911860300 DE-528 0
-s 10ec802912592400 AT-2400 0
-d 10ec8129 RTL-8129 0
-s 10ec812910ec8129 RT8129 Fast Ethernet Adapter 0
-d 10ec8138 RT8139 (B/C) Cardbus Fast Ethernet Adapter 0
-s 10ec813810ec8138 RT8139 (B/C) Fast Ethernet Adapter 0
-d 10ec8139 RTL-8139/8139C/8139C+ 0
-s 10ec81390357000a TTP-Monitoring Card V2.0 0
-s 10ec81391025005a TravelMate 290 0
-s 10ec813910258920 ALN-325 0
-s 10ec813910258921 ALN-325 0
-s 10ec813910718160 MIM2000 0
-s 10ec813910bd0320 EP-320X-R 0
-s 10ec813910ec8139 RT8139 0
-s 10ec81391113ec01 FNC-0107TX 0
-s 10ec813911861300 DFE-538TX 0
-s 10ec813911861320 SN5200 0
-s 10ec813911868139 DRN-32TX 0
-s 10ec813911f68139 FN22-3(A) LinxPRO Ethernet Adapter 0
-s 10ec813912592500 AT-2500TX 0
-s 10ec813912592503 AT-2500TX/ACPI 0
-s 10ec81391429d010 ND010 0
-s 10ec813914329130 EN-9130TX 0
-s 10ec813914368139 RT8139 0
-s 10ec81391458e000 GA-7VM400M/7VT600 Motherboard 0
-s 10ec8139146c1439 FE-1439TX 0
-s 10ec813914896001 GF100TXRII 0
-s 10ec813914896002 GF100TXRA 0
-s 10ec8139149c139a LFE-8139ATX 0
-s 10ec8139149c8139 LFE-8139TX 0
-s 10ec813914cb0200 LNR-100 Family 10/100 Base-TX Ethernet 0
-s 10ec813917995000 F5D5000 PCI Card/Desktop Network PCI Card 0
-s 10ec813926460001 EtheRx 0
-s 10ec81398e2e7000 KF-230TX 0
-s 10ec81398e2e7100 KF-230TX/2 0
-s 10ec8139a0a00007 ALN-325C 0
-d 10ec8169 RTL-8169 Gigabit Ethernet 0
-s 10ec81691259c107 CG-LAPCIGT 0
-s 10ec81691371434e ProG-2000L 0
-s 10ec81691458e000 GA-K8VT800 Pro Motherboard 0
-s 10ec81691462702c K8T NEO 2 motherboard 0
-d 10ec8180 RTL8180L 802.11b MAC 0
-d 10ec8197 SmartLAN56 56K Modem 0
-v 10ed Ascii Corporation 0
-d 10ed7310 V7310 0
-v 10ee Xilinx Corporation 0
-d 10ee3fc0 RME Digi96 0
-d 10ee3fc1 RME Digi96/8 0
-d 10ee3fc2 RME Digi96/8 Pro 0
-d 10ee3fc3 RME Digi96/8 Pad 0
-d 10ee3fc4 RME Digi9652 (Hammerfall) 0
-d 10ee3fc5 RME Hammerfall DSP 0
-d 10ee3fc6 RME Hammerfall DSP MADI 0
-d 10ee8381 Ellips Santos Frame Grabber 0
-v 10ef Racore Computer Products, Inc. 0
-d 10ef8154 M815x Token Ring Adapter 0
-v 10f0 Peritek Corporation 0
-v 10f1 Tyan Computer 0
-v 10f2 Achme Computer, Inc. 0
-v 10f3 Alaris, Inc. 0
-v 10f4 S-MOS Systems, Inc. 0
-v 10f5 NKK Corporation 0
-d 10f5a001 NDR4000 [NR4600 Bridge] 0
-v 10f6 Creative Electronic Systems SA 0
-v 10f7 Matsushita Electric Industrial Co., Ltd. 0
-v 10f8 Altos India Ltd 0
-v 10f9 PC Direct 0
-v 10fa Truevision 0
-d 10fa000c TARGA 1000 0
-v 10fb Thesys Gesellschaft für Mikroelektronik mbH 0
-d 10fb186f TH 6255 0
-v 10fc I-O Data Device, Inc. 0
-d 10fc0003 Cardbus IDE Controller 0 What's in the cardbus end of a Sony ACR-A01 card, comes with newer Vaio CD-RW drives
-d 10fc0005 Cardbus SCSI CBSC II 0
-v 10fd Soyo Computer, Inc 0
-v 10fe Fast Multimedia AG 0
-v 10ff NCube 0
-v 1100 Jazz Multimedia 0
-v 1101 Initio Corporation 0
-d 11011060 INI-A100U2W 0
-d 11019100 INI-9100/9100W 0
-d 11019400 INI-940 0
-d 11019401 INI-950 0
-d 11019500 360P 0
-d 11019502 Initio INI-9100UW Ultra Wide SCSI Controller INIC-950P chip 0
-v 1102 Creative Labs 0
-d 11020002 SB Live! EMU10k1 0
-s 1102000211020020 CT4850 SBLive! Value 0
-s 1102000211020021 CT4620 SBLive! 0
-s 110200021102002f SBLive! mainboard implementation 0
-s 1102000211024001 E-mu APS 0
-s 1102000211028022 CT4780 SBLive! Value 0
-s 1102000211028023 CT4790 SoundBlaster PCI512 0
-s 1102000211028024 CT4760 SBLive! 0
-s 1102000211028025 SBLive! Mainboard Implementation 0
-s 1102000211028026 CT4830 SBLive! Value 0
-s 1102000211028027 CT4832 SBLive! Value 0
-s 1102000211028028 CT4760 SBLive! OEM version 0
-s 1102000211028031 CT4831 SBLive! Value 0
-s 1102000211028040 CT4760 SBLive! 0
-s 1102000211028051 CT4850 SBLive! Value 0
-s 1102000211028061 SBLive! Player 5.1 0
-s 1102000211028064 SB Live! 5.1 Model SB0100 0
-s 1102000211028065 SBLive! 5.1 Digital Model SB0220 0
-s 1102000211028067 SBLive! 5.1 eMicro 28028 0
-d 11020004 SB Audigy 0
-s 1102000411020051 SB0090 Audigy Player 0
-s 1102000411020053 SB0090 Audigy Player/OEM 0
-s 1102000411020058 SB0090 Audigy Player/OEM 0
-s 1102000411022002 SB Audigy 2 ZS (SB0350) 0
-d 11020006 [SB Live! Value] EMU10k1X 0
-d 11020007 SB Audigy LS 0
-s 1102000711021001 SB0310 Audigy LS 0
-s 1102000711021002 SB0312 Audigy LS 0
-d 11020008 SB0400 Audigy2 Value 0
-d 11024001 SB Audigy FireWire Port 0
-s 1102400111020010 SB Audigy FireWire Port 0
-d 11027002 SB Live! MIDI/Game Port 0
-s 1102700211020020 Gameport Joystick 0
-d 11027003 SB Audigy MIDI/Game port 0
-s 1102700311020040 SB Audigy MIDI/Game Port 0
-d 11027004 [SB Live! Value] Input device controller 0
-d 11027005 SB Audigy LS MIDI/Game port 0
-s 1102700511021001 SB0310 Audigy LS MIDI/Game port 0
-s 1102700511021002 SB0312 Audigy LS MIDI/Game port 0
-d 11028064 SB0100 [SBLive! 5.1 OEM] 0
-d 11028938 Ectiva EV1938 0
-v 1103 Triones Technologies, Inc. 0
-d 11030003 HPT343 0
-d 11030004 HPT366/368/370/370A/372 0 Revisions: 01=HPT366, 03=HPT370, 04=HPT370A, 05=HPT372
-s 1103000411030001 HPT370A 0
-s 1103000411030003 HPT343 / HPT345 / HPT363 UDMA33 0
-s 1103000411030004 HPT366 UDMA66 (r1) / HPT368 UDMA66 (r2) / HPT370 UDMA100 (r3) / HPT370 UDMA100 RAID (r4) 0
-s 1103000411030005 HPT370 UDMA100 0
-s 1103000411030006 HPT302 0
-s 1103000411030007 HPT371 UDMA133 0
-s 1103000411030008 HPT374 UDMA/ATA133 RAID Controller 0
-d 11030005 HPT372A 0
-d 11030006 HPT302 0
-d 11030007 HPT371 0
-d 11030008 HPT374 0
-d 11030009 HPT372N 0
-v 1104 RasterOps Corp. 0
-v 1105 Sigma Designs, Inc. 0
-d 11051105 REALmagic Xcard MPEG 1/2/3/4 DVD Decoder 0
-d 11058300 REALmagic Hollywood Plus DVD Decoder 0
-d 11058400 EM840x REALmagic DVD/MPEG-2 Audio/Video Decoder 0
-d 11058401 EM8401 REALmagic DVD/MPEG-2 A/V Decoder 0
-d 11058470 EM8470 REALmagic DVD/MPEG-4 A/V Decoder 0
-d 11058471 EM8471 REALmagic DVD/MPEG-4 A/V Decoder 0
-d 11058475 EM8475 REALmagic DVD/MPEG-4 A/V Decoder 0
-d 11058476 EM8476 REALmagic DVD/MPEG-4 A/V Decoder 0
-d 11058485 EM8485 REALmagic DVD/MPEG-4 A/V Decoder 0
-d 11058486 EM8486 REALmagic DVD/MPEG-4 A/V Decoder 0
-v 1106 VIA Technologies, Inc. 0
-d 11060102 Embedded VIA Ethernet Controller 0
-d 11060130 VT6305 1394.A Controller 0
-d 11060305 VT8363/8365 [KT133/KM133] 0
-s 1106030510438033 A7V Mainboard 0
-s 110603051043803e A7V-E Mainboard 0
-s 1106030510438042 A7V133/A7V133-C Mainboard 0
-s 11060305147ba401 KT7/KT7-RAID/KT7A/KT7A-RAID Mainboard 0
-d 11060391 VT8371 [KX133] 0
-d 11060501 VT8501 [Apollo MVP4] 0
-d 11060505 VT82C505 0
-d 11060561 VT82C576MV 0 Shares chip with :0576. The VT82C576M has :1571 instead of :0561.
-d 11060571 VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE 0
-s 1106057110190985 P6VXA Motherboard 0
-s 1106057110190a81 L7VTA v1.0 Motherboard (KT400-8235) 0
-s 1106057110438052 VT8233A Bus Master ATA100/66/33 IDE 0
-s 110605711043808c A7V8X motherboard 0
-s 11060571104380a1 A7V8X-X motherboard rev. 1.01 0
-s 11060571104380ed A7V600 motherboard 0
-s 1106057111060571 VT82C586/B/VT82C686/A/B/VT8233/A/C/VT8235 PIPC Bus Master IDE 0
-s 1106057111790001 Magnia Z310 0
-s 110605711297f641 FX41 motherboard 0
-s 1106057114585002 GA-7VAX Mainboard 0
-s 1106057114627020 K8T NEO 2 motherboard 0
-s 11060571147b1407 KV8-MAX3 motherboard 0
-s 1106057118490571 K7VT2 motherboard 0
-d 11060576 VT82C576 3V [Apollo Master] 0
-d 11060585 VT82C585VP [Apollo VP1/VPX] 0
-d 11060586 VT82C586/A/B PCI-to-ISA [Apollo VP] 0
-s 1106058611060000 MVP3 ISA Bridge 0
-d 11060595 VT82C595 [Apollo VP2] 0
-d 11060596 VT82C596 ISA [Mobile South] 0
-s 1106059611060000 VT82C596/A/B PCI to ISA Bridge 0
-s 1106059614580596 VT82C596/A/B PCI to ISA Bridge 0
-d 11060597 VT82C597 [Apollo VP3] 0
-d 11060598 VT82C598 [Apollo MVP3] 0
-d 11060601 VT8601 [Apollo ProMedia] 0
-d 11060605 VT8605 [ProSavage PM133] 0
-s 110606051043802c CUV4X mainboard 0
-d 11060680 VT82C680 [Apollo P6] 0
-d 11060686 VT82C686 [Apollo Super South] 0
-s 1106068610190985 P6VXA Motherboard 0
-s 110606861043802c CUV4X mainboard 0
-s 1106068610438033 A7V Mainboard 0
-s 110606861043803e A7V-E Mainboard 0
-s 1106068610438040 A7M266 Mainboard 0
-s 1106068610438042 A7V133/A7V133-C Mainboard 0
-s 1106068611060000 VT82C686/A PCI to ISA Bridge 0
-s 1106068611060686 VT82C686/A PCI to ISA Bridge 0
-s 1106068611790001 Magnia Z310 0
-s 11060686147ba702 KG7-Lite Mainboard 0
-d 11060691 VT82C693A/694x [Apollo PRO133x] 0
-s 1106069110190985 P6VXA Motherboard 0
-s 1106069111790001 Magnia Z310 0
-s 1106069114580691 VT82C691 Apollo Pro System Controller 0
-d 11060693 VT82C693 [Apollo Pro Plus] 0
-d 11060698 VT82C693A [Apollo Pro133 AGP] 0
-d 11060926 VT82C926 [Amazon] 0
-d 11061000 VT82C570MV 0
-d 11061106 VT82C570MV 0
-d 11061571 VT82C576M/VT82C586 0
-d 11061595 VT82C595/97 [Apollo VP2/97] 0
-d 11063022 CLE266 0
-d 11063038 VT82xxxxx UHCI USB 1.1 Controller 0 This is *not* USB 2.0 as the existing entry suggests
-s 1106303809251234 USB Controller 0
-s 1106303810190985 P6VXA Motherboard 0
-s 1106303810190a81 L7VTA v1.0 Motherboard (KT400-8235) 0
-s 110630381043808c VT6202 USB2.0 4 port controller 0
-s 11063038104380a1 A7V8X-X motherboard 0
-s 11063038104380ed A7V600 motherboard 0
-s 1106303811790001 Magnia Z310 0
-s 1106303814585004 GA-7VAX Mainboard 0
-s 1106303814627020 K8T NEO 2 motherboard 0
-s 11063038147b1407 KV8-MAX3 motherboard 0
-d 11063040 VT82C586B ACPI 0
-d 11063043 VT86C100A [Rhine] 0
-s 1106304310bd0000 VT86C100A Fast Ethernet Adapter 0
-s 1106304311060100 VT86C100A Fast Ethernet Adapter 0
-s 1106304311861400 DFE-530TX rev A 0
-d 11063044 IEEE 1394 Host Controller 0
-s 110630441025005a TravelMate 290 0
-s 1106304414581000 GA-7VT600-1394 Motherboard 0
-s 110630441462702d K8T NEO 2 motherboard 0
-d 11063050 VT82C596 Power Management 0
-d 11063051 VT82C596 Power Management 0
-d 11063053 VT6105M [Rhine-III] 0
-d 11063057 VT82C686 [Apollo Super ACPI] 0
-s 1106305710190985 P6VXA Motherboard 0
-s 1106305710438033 A7V Mainboard 0
-s 110630571043803e A7V-E Mainboard 0
-s 1106305710438040 A7M266 Mainboard 0
-s 1106305710438042 A7V133/A7V133-C Mainboard 0
-s 1106305711790001 Magnia Z310 0
-d 11063058 VT82C686 AC97 Audio Controller 0
-s 110630580e110097 SoundMax Digital Integrated Audio 0
-s 110630580e11b194 Soundmax integrated digital audio 0
-s 1106305810190985 P6VXA Motherboard 0
-s 1106305810431106 A7V133/A7V133-C Mainboard 0
-s 1106305811064511 Onboard Audio on EP7KXA 0
-s 1106305814587600 Onboard Audio 0
-s 1106305814623091 MS-6309 Onboard Audio 0
-s 1106305814623300 MS-6330 Onboard Audio 0
-s 1106305815dd7609 Onboard Audio 0
-d 11063059 VT8233/A/8235/8237 AC97 Audio Controller 0
-s 1106305910190a81 L7VTA v1.0 Motherboard (KT400-8235) 0
-s 1106305910438095 A7V8X Motherboard (Realtek ALC650 codec) 0
-s 11063059104380a1 A7V8X-X Motherboard 0
-s 11063059104380b0 A7V600 motherboard (ADI AD1980 codec [SoundMAX]) 0
-s 1106305911063059 L7VMM2 Motherboard 0
-s 1106305911064161 K7VT2 motherboard 0
-s 110630591297c160 FX41 motherboard (Realtek ALC650 codec) 0
-s 110630591458a002 GA-7VAX Onboard Audio (Realtek ALC650) 0
-s 1106305914620080 K8T NEO 2 motherboard 0
-s 1106305914623800 KT266 onboard audio 0
-s 11063059147b1407 KV8-MAX3 motherboard 0
-d 11063065 VT6102 [Rhine-II] 0
-s 11063065104380a1 A7V8X-X Motherboard 0
-s 1106306511060102 VT6102 [Rhine II] Embeded Ethernet Controller on VT8235 0
-s 1106306511861400 DFE-530TX rev A 0
-s 1106306511861401 DFE-530TX rev B 0
-s 1106306513b91421 LD-10/100AL PCI Fast Ethernet Adapter (rev.B) 0
-d 11063068 AC'97 Modem Controller 0 This hosts more than just the Intel 537 codec, it also hosts PCtel (SIL33) and SmartLink (SIL34) codecs
-s 110630681462309e MS-6309 Saturn Motherboard 0
-d 11063074 VT8233 PCI to ISA Bridge 0
-s 1106307410438052 VT8233A 0
-d 11063091 VT8633 [Apollo Pro266] 0
-d 11063099 VT8366/A/7 [Apollo KT266/A/333] 0
-s 1106309910438064 A7V266-E Mainboard 0
-s 110630991043807f A7V333 Mainboard 0
-s 1106309918493099 K7VT2 motherboard 0
-d 11063101 VT8653 Host Bridge 0
-d 11063102 VT8662 Host Bridge 0
-d 11063103 VT8615 Host Bridge 0
-d 11063104 USB 2.0 0
-s 1106310410190a81 L7VTA v1.0 Motherboard (KT400-8235) 0
-s 110631041043808c A7V8X motherboard 0
-s 11063104104380a1 A7V8X-X motherboard rev 1.01 0
-s 11063104104380ed A7V600 motherboard 0
-s 110631041297f641 FX41 motherboard 0
-s 1106310414585004 GA-7VAX Mainboard 0
-s 1106310414627020 K8T NEO 2 motherboard 0
-s 11063104147b1407 KV8-MAX3 motherboard 0
-d 11063106 VT6105 [Rhine-III] 0
-s 1106310611861403 DFE-530TX rev C 0
-d 11063108 S3 Unichrome Pro VGA Adapter 0
-d 11063109 VT8233C PCI to ISA Bridge 0
-d 11063112 VT8361 [KLE133] Host Bridge 0
-d 11063116 VT8375 [KM266/KL266] Host Bridge 0
-s 110631161297f641 FX41 motherboard 0
-d 11063118 S3 Unichrome Pro VGA Adapter 0
-d 11063119 VT6120/VT6121/VT6122 Gigabit Ethernet Adapter 0
-d 11063122 VT8623 [Apollo CLE266] integrated CastleRock graphics 0 found on EPIA M6000/9000 mainboard
-d 11063123 VT8623 [Apollo CLE266] 0 found on EPIA M6000/9000 mainboard
-d 11063128 VT8753 [P4X266 AGP] 0
-d 11063133 VT3133 Host Bridge 0
-d 11063147 VT8233A ISA Bridge 0
-d 11063148 P4M266 Host Bridge 0
-d 11063149 VIA VT6420 SATA RAID Controller 0
-s 11063149104380ed A7V600 motherboard 0
-s 110631491458b003 GA-7VM400AM(F) Motherboard 0
-s 1106314914627020 K8T Neo 2 Motherboard 0
-d 11063156 P/KN266 Host Bridge 0
-d 11063164 VT6410 ATA133 RAID controller 0 on ASUS P4P800
-d 11063168 VT8374 P4X400 Host Controller/AGP Bridge 0
-d 11063177 VT8235 ISA Bridge 0
-s 1106317710190a81 L7VTA v1.0 Motherboard (KT400-8235) 0
-s 110631771043808c A7V8X motherboard 0
-s 11063177104380a1 A7V8X-X motherboard 0
-s 110631771297f641 FX41 motherboard 0
-s 1106317714585001 GA-7VAX Mainboard 0
-s 1106317718493177 K7VT2 motherboard 0
-d 11063188 VT8385 [K8T800 AGP] Host Bridge 0
-s 11063188147b1407 KV8-MAX3 motherboard 0
-d 11063189 VT8377 [KT400/KT600 AGP] Host Bridge 0
-s 110631891043807f A7V8X motherboard 0
-s 1106318914585000 GA-7VAX Mainboard 0
-d 11063204 K8M800 0
-d 11063205 VT8378 [KM400/A] Chipset Host Bridge 0
-s 1106320514585000 GA-7VM400M Motherboard 0
-d 11063227 VT8237 ISA bridge [KT600/K8T800 South] 0
-s 11063227104380ed A7V600 motherboard 0
-s 1106322711063227 DFI KT600-AL Motherboard 0
-s 1106322714585001 GA-7VT600 Motherboard 0
-s 11063227147b1407 KV8-MAX3 motherboard 0
-d 11064149 VIA VT6420 (ATA133) Controller 0
-d 11065030 VT82C596 ACPI [Apollo PRO] 0
-d 11066100 VT85C100A [Rhine II] 0
-d 11067204 K8M800 0
-d 11067205 VT8378 [S3 UniChrome] Integrated Video 0 S3 Graphics UniChromeâ„¢ 2D/3D Graphics with motion compensation
-s 110672051458d000 Gigabyte GA-7VM400(A)M(F) Motherboard 0
-d 11068231 VT8231 [PCI-to-ISA Bridge] 0
-d 11068235 VT8235 ACPI 0
-d 11068305 VT8363/8365 [KT133/KM133 AGP] 0
-d 11068391 VT8371 [KX133 AGP] 0
-d 11068501 VT8501 [Apollo MVP4 AGP] 0
-d 11068596 VT82C596 [Apollo PRO AGP] 0
-d 11068597 VT82C597 [Apollo VP3 AGP] 0
-d 11068598 VT82C598/694x [Apollo MVP3/Pro133x AGP] 0
-s 1106859810190985 P6VXA Motherboard 0
-d 11068601 VT8601 [Apollo ProMedia AGP] 0
-d 11068605 VT8605 [PM133 AGP] 0
-d 11068691 VT82C691 [Apollo Pro] 0
-d 11068693 VT82C693 [Apollo Pro Plus] PCI Bridge 0
-d 1106b091 VT8633 [Apollo Pro266 AGP] 0
-d 1106b099 VT8366/A/7 [Apollo KT266/A/333 AGP] 0
-d 1106b101 VT8653 AGP Bridge 0
-d 1106b102 VT8362 AGP Bridge 0
-d 1106b103 VT8615 AGP Bridge 0
-d 1106b112 VT8361 [KLE133] AGP Bridge 0
-d 1106b168 VT8235 PCI Bridge 0
-d 1106b188 VT8237 PCI bridge [K8T800 South] 0
-s 1106b188147b1407 KV8-MAX3 motherboard 0
-d 1106b198 VT8237 PCI Bridge 0
-d 1106d104 VT8237 Integrated Fast Ethernet Controller 0 32-Bit PCI bus master Ethernet MAC with standard MII interface
-v 1107 Stratus Computers 0
-d 11070576 VIA VT82C570MV [Apollo] (Wrong vendor ID!) 0
-v 1108 Proteon, Inc. 0
-d 11080100 p1690plus_AA 0
-d 11080101 p1690plus_AB 0
-d 11080105 P1690Plus 0
-d 11080108 P1690Plus 0
-d 11080138 P1690Plus 0
-d 11080139 P1690Plus 0
-d 1108013c P1690Plus 0
-d 1108013d P1690Plus 0
-v 1109 Cogent Data Technologies, Inc. 0
-d 11091400 EM110TX [EX110TX] 0
-v 110a Siemens Nixdorf AG 0
-d 110a0002 Pirahna 2-port 0
-d 110a0005 Tulip controller, power management, switch extender 0
-d 110a0006 FSC PINC (I/O-APIC) 0
-d 110a0015 FSC Multiprocessor Interrupt Controller 0
-d 110a001d FSC Copernicus Management Controller 0
-d 110a007b FSC Remote Service Controller, mailbox device 0
-d 110a007c FSC Remote Service Controller, shared memory device 0
-d 110a007d FSC Remote Service Controller, SMIC device 0
-d 110a2102 DSCC4 WAN adapter 0
-d 110a2104 Eicon Diva 2.02 compatible passive ISDN card 0
-d 110a3142 SIMATIC NET CP 5613A1 (Profibus Adapter) 0
-d 110a4021 SIMATIC NET CP 5512 (Profibus and MPI Cardbus Adapter) 0
-d 110a4029 SIMATIC NET CP 5613A2 (Profibus Adapter) 0
-d 110a4942 FPGA I-Bus Tracer for MBD 0
-d 110a6120 SZB6120 0
-v 110b Chromatic Research Inc. 0
-d 110b0001 Mpact Media Processor 0
-d 110b0004 Mpact 2 0
-v 110c Mini-Max Technology, Inc. 0
-v 110d Znyx Advanced Systems 0
-v 110e CPU Technology 0
-v 110f Ross Technology 0
-v 1110 Powerhouse Systems 0
-d 11106037 Firepower Powerized SMP I/O ASIC 0
-d 11106073 Firepower Powerized SMP I/O ASIC 0
-v 1111 Santa Cruz Operation 0
-v 1112 Osicom Technologies Inc 0 Also claimed to be RNS or Rockwell International, current PCISIG records list Osicom
-d 11122200 FDDI Adapter 0
-d 11122300 Fast Ethernet Adapter 0
-d 11122340 4 Port Fast Ethernet Adapter 0
-d 11122400 ATM Adapter 0
-v 1113 Accton Technology Corporation 0
-d 11131211 SMC2-1211TX 0
-s 11131211103c1207 EN-1207D Fast Ethernet Adapter 0
-s 1113121111131211 EN-1207D Fast Ethernet Adapter 0
-d 11131216 EN-1216 Ethernet Adapter 0
-s 1113121611132242 EN2242 10/100 Ethernet Mini-PCI Card 0
-s 11131216111a1020 SpeedStream 1020 PCI 10/100 Ethernet Adaptor [EN-1207F-TX ?] 0
-d 11131217 EN-1217 Ethernet Adapter 0
-d 11135105 10Mbps Network card 0
-d 11139211 EN-1207D Fast Ethernet Adapter 0
-s 1113921111139211 EN-1207D Fast Ethernet Adapter 0
-d 11139511 21x4x DEC-Tulip compatible Fast Ethernet 0
-d 1113d301 CPWNA100 (Philips wireless PCMCIA) 0
-d 1113ec02 SMC 1244TX v3 0
-v 1114 Atmel Corporation 0
-d 11140506 802.11b Wireless Network Adaptor (at76c506) 0
-v 1115 3D Labs 0
-v 1116 Data Translation 0
-d 11160022 DT3001 0
-d 11160023 DT3002 0
-d 11160024 DT3003 0
-d 11160025 DT3004 0
-d 11160026 DT3005 0
-d 11160027 DT3001-PGL 0
-d 11160028 DT3003-PGL 0
-v 1117 Datacube, Inc 0
-d 11179500 Max-1C SVGA card 0
-d 11179501 Max-1C image processing 0
-v 1118 Berg Electronics 0
-v 1119 ICP Vortex Computersysteme GmbH 0
-d 11190000 GDT 6000/6020/6050 0
-d 11190001 GDT 6000B/6010 0
-d 11190002 GDT 6110/6510 0
-d 11190003 GDT 6120/6520 0
-d 11190004 GDT 6530 0
-d 11190005 GDT 6550 0
-d 11190006 GDT 6117/6517 0
-d 11190007 GDT 6127/6527 0
-d 11190008 GDT 6537 0
-d 11190009 GDT 6557/6557-ECC 0
-d 1119000a GDT 6115/6515 0
-d 1119000b GDT 6125/6525 0
-d 1119000c GDT 6535 0
-d 1119000d GDT 6555 0
-d 11190010 GDT 6115/6515 0
-d 11190011 GDT 6125/6525 0
-d 11190012 GDT 6535 0
-d 11190013 GDT 6555/6555-ECC 0
-d 11190100 GDT 6117RP/6517RP 0
-d 11190101 GDT 6127RP/6527RP 0
-d 11190102 GDT 6537RP 0
-d 11190103 GDT 6557RP 0
-d 11190104 GDT 6111RP/6511RP 0
-d 11190105 GDT 6121RP/6521RP 0
-d 11190110 GDT 6117RD/6517RD 0
-d 11190111 GDT 6127RD/6527RD 0
-d 11190112 GDT 6537RD 0
-d 11190113 GDT 6557RD 0
-d 11190114 GDT 6111RD/6511RD 0
-d 11190115 GDT 6121RD/6521RD 0
-d 11190118 GDT 6118RD/6518RD/6618RD 0
-d 11190119 GDT 6128RD/6528RD/6628RD 0
-d 1119011a GDT 6538RD/6638RD 0
-d 1119011b GDT 6558RD/6658RD 0
-d 11190120 GDT 6117RP2/6517RP2 0
-d 11190121 GDT 6127RP2/6527RP2 0
-d 11190122 GDT 6537RP2 0
-d 11190123 GDT 6557RP2 0
-d 11190124 GDT 6111RP2/6511RP2 0
-d 11190125 GDT 6121RP2/6521RP2 0
-d 11190136 GDT 6113RS/6513RS 0
-d 11190137 GDT 6123RS/6523RS 0
-d 11190138 GDT 6118RS/6518RS/6618RS 0
-d 11190139 GDT 6128RS/6528RS/6628RS 0
-d 1119013a GDT 6538RS/6638RS 0
-d 1119013b GDT 6558RS/6658RS 0
-d 1119013c GDT 6533RS/6633RS 0
-d 1119013d GDT 6543RS/6643RS 0
-d 1119013e GDT 6553RS/6653RS 0
-d 1119013f GDT 6563RS/6663RS 0
-d 11190166 GDT 7113RN/7513RN/7613RN 0
-d 11190167 GDT 7123RN/7523RN/7623RN 0
-d 11190168 GDT 7118RN/7518RN/7518RN 0
-d 11190169 GDT 7128RN/7528RN/7628RN 0
-d 1119016a GDT 7538RN/7638RN 0
-d 1119016b GDT 7558RN/7658RN 0
-d 1119016c GDT 7533RN/7633RN 0
-d 1119016d GDT 7543RN/7643RN 0
-d 1119016e GDT 7553RN/7653RN 0
-d 1119016f GDT 7563RN/7663RN 0
-d 111901d6 GDT 4x13RZ 0
-d 111901d7 GDT 4x23RZ 0
-d 111901f6 GDT 8x13RZ 0
-d 111901f7 GDT 8x23RZ 0
-d 111901fc GDT 8x33RZ 0
-d 111901fd GDT 8x43RZ 0
-d 111901fe GDT 8x53RZ 0
-d 111901ff GDT 8x63RZ 0
-d 11190210 GDT 6519RD/6619RD 0
-d 11190211 GDT 6529RD/6629RD 0
-d 11190260 GDT 7519RN/7619RN 0
-d 11190261 GDT 7529RN/7629RN 0
-d 111902ff GDT MAXRP 0
-d 11190300 GDT NEWRX 0
-v 111a Efficient Networks, Inc 0
-d 111a0000 155P-MF1 (FPGA) 0
-d 111a0002 155P-MF1 (ASIC) 0
-d 111a0003 ENI-25P ATM 0
-s 111a0003111a0000 ENI-25p Miniport ATM Adapter 0
-d 111a0005 SpeedStream (LANAI) 0
-s 111a0005111a0001 ENI-3010 ATM 0
-s 111a0005111a0009 ENI-3060 ADSL (VPI=0) 0
-s 111a0005111a0101 ENI-3010 ATM 0
-s 111a0005111a0109 ENI-3060CO ADSL (VPI=0) 0
-s 111a0005111a0809 ENI-3060 ADSL (VPI=0 or 8) 0
-s 111a0005111a0909 ENI-3060CO ADSL (VPI=0 or 8) 0
-s 111a0005111a0a09 ENI-3060 ADSL (VPI=<0..15>) 0
-d 111a0007 SpeedStream ADSL 0
-s 111a0007111a1001 ENI-3061 ADSL [ASIC] 0
-d 111a1203 SpeedStream 1023 Wireless PCI Adapter 0
-v 111b Teledyne Electronic Systems 0
-v 111c Tricord Systems Inc. 0
-d 111c0001 Powerbis Bridge 0
-v 111d Integrated Device Technology, Inc. 0
-d 111d0001 IDT77201/77211 155Mbps ATM SAR Controller [NICStAR] 0
-d 111d0003 IDT77222/77252 155Mbps ATM MICRO ABR SAR Controller 0
-d 111d0004 IDT77V252 155Mbps ATM MICRO ABR SAR Controller 0
-d 111d0005 IDT77V222 155Mbps ATM MICRO ABR SAR Controller 0
-v 111e Eldec 0
-v 111f Precision Digital Images 0
-d 111f4a47 Precision MX Video engine interface 0
-d 111f5243 Frame capture bus interface 0
-v 1120 EMC Corporation 0
-v 1121 Zilog 0
-v 1122 Multi-tech Systems, Inc. 0
-v 1123 Excellent Design, Inc. 0
-v 1124 Leutron Vision AG 0
-v 1125 Eurocore 0
-v 1126 Vigra 0
-v 1127 FORE Systems Inc 0
-d 11270200 ForeRunner PCA-200 ATM 0
-d 11270210 PCA-200PC 0
-d 11270250 ATM 0
-d 11270300 ForeRunner PCA-200EPC ATM 0
-d 11270310 ATM 0
-d 11270400 ForeRunnerHE ATM Adapter 0
-s 1127040011270400 ForeRunnerHE ATM 0
-v 1129 Firmworks 0
-v 112a Hermes Electronics Company, Ltd. 0
-v 112b Linotype - Hell AG 0
-v 112c Zenith Data Systems 0
-v 112d Ravicad 0
-v 112e Infomedia Microelectronics Inc. 0
-v 112f Imaging Technology Inc 0
-d 112f0000 MVC IC-PCI 0
-d 112f0001 MVC IM-PCI Video frame grabber/processor 0
-v 1130 Computervision 0
-v 1131 Philips Semiconductors 0
-d 11311561 USB 1.1 Host Controller 0
-d 11311562 USB 2.0 Host Controller 0
-d 11313400 SmartPCI56(UCB1500) 56K Modem 0
-d 11315400 TriMedia TM1000/1100 0
-d 11315402 TriMedia TM-1300 0
-d 11317130 SAA7130 Video Broadcast Decoder 0
-s 1131713051680138 LiveView FlyVideo 2000 0
-d 11317133 SAA713X Audio+video broadcast decoder 0
-s 1131713351680138 LifeView FlyVideo 3000 0
-s 1131713351680212 LifeView FlyTV Platinum mini 0
-d 11317134 SAA7134 0 PCI audio and video broadcast decoder (http://www.semiconductors.philips.com/pip/saa7134hl)
-d 11317135 SAA7135 Audio+video broadcast decoder 0
-d 11317145 SAA7145 0
-d 11317146 SAA7146 0
-s 11317146110a0000 Fujitsu/Siemens DVB-C card rev1.5 0
-s 11317146110affff Fujitsu/Siemens DVB-C card rev1.5 0
-s 1131714611314f56 KNC1 DVB-S Budget 0
-s 1131714611314f61 Fujitsu-Siemens Activy DVB-S Budget 0
-s 11317146114b2003 DVRaptor Video Edit/Capture Card 0
-s 1131714611bd0006 DV500 Overlay 0
-s 1131714611bd000a DV500 Overlay 0
-s 1131714613c20000 Siemens/Technotrend/Hauppauge DVB card rev1.3 or rev1.5 0
-s 1131714613c20001 Technotrend/Hauppauge DVB card rev1.3 or rev1.6 0
-s 1131714613c20002 Technotrend/Hauppauge DVB card rev2.1 0
-s 1131714613c20003 Technotrend/Hauppauge DVB card rev2.1 0
-s 1131714613c20004 Technotrend/Hauppauge DVB card rev2.1 0
-s 1131714613c20006 Technotrend/Hauppauge DVB card rev1.3 or rev1.6 0
-s 1131714613c20008 Technotrend/Hauppauge DVB-T 0
-s 1131714613c2000a Octal/Technotrend DVB-C for iTV 0
-s 1131714613c21003 Technotrend-Budget / Hauppauge WinTV-NOVA-S DVB card 0
-s 1131714613c21004 Technotrend-Budget / Hauppauge WinTV-NOVA-C DVB card 0
-s 1131714613c21005 Technotrend-Budget / Hauppauge WinTV-NOVA-T DVB card 0
-s 1131714613c2100c Technotrend-Budget / Hauppauge WinTV-NOVA-CI DVB card 0
-s 1131714613c2100f Technotrend-Budget / Hauppauge WinTV-NOVA-CI DVB card 0
-s 1131714613c21011 Technotrend-Budget / Hauppauge WinTV-NOVA-T DVB card 0
-s 1131714613c21013 SATELCO Multimedia DVB 0
-s 1131714613c21102 Technotrend/Hauppauge DVB card rev2.1 0
-v 1132 Mitel Corp. 0
-v 1133 Eicon Networks Corporation 0 This is the new official company name. See disclaimer on www.eicon.com for details!
-d 11337901 EiconCard S90 0
-d 11337902 EiconCard S90 0
-d 11337911 EiconCard S91 0
-d 11337912 EiconCard S91 0
-d 11337941 EiconCard S94 0
-d 11337942 EiconCard S94 0
-d 11337943 EiconCard S94 0
-d 11337944 EiconCard S94 0
-d 1133b921 EiconCard P92 0
-d 1133b922 EiconCard P92 0
-d 1133b923 EiconCard P92 0
-d 1133e001 Diva Pro 2.0 S/T 0
-d 1133e002 Diva 2.0 S/T PCI 0
-d 1133e003 Diva Pro 2.0 U 0
-d 1133e004 Diva 2.0 U PCI 0
-d 1133e005 Diva 2.01 S/T PCI 0
-d 1133e006 Diva CT S/T PCI 0
-d 1133e007 Diva CT U PCI 0
-d 1133e008 Diva CT Lite S/T PCI 0
-d 1133e009 Diva CT Lite U PCI 0
-d 1133e00a Diva ISDN+V.90 PCI 0
-d 1133e00b Diva 2.02 PCI S/T 0
-d 1133e00c Diva 2.02 PCI U 0
-d 1133e00d Diva ISDN Pro 3.0 PCI 0
-d 1133e00e Diva ISDN+CT S/T PCI Rev 2 0
-d 1133e010 Diva Server BRI-2M PCI 0
-s 1133e010110a0021 Fujitsu Siemens ISDN S0 0
-s 1133e01080010014 Diva Server BRI-2M PCI Cornet NQ 0
-d 1133e011 Diva Server BRI S/T Rev 2 0
-d 1133e012 Diva Server 4BRI-8M PCI 0
-s 1133e01280010014 Diva Server 4BRI-8M PCI Cornet NQ 0
-d 1133e013 Diva Server 4BRI Rev 2 0
-s 1133e01311331300 Diva Server V-4BRI-8 0
-s 1133e0131133e013 Diva Server 4BRI-8M 2.0 PCI 0
-s 1133e01380010014 Diva Server 4BRI-8M 2.0 PCI Cornet NQ 0
-d 1133e014 Diva Server PRI-30M PCI 0
-s 1133e01400080100 Diva Server PRI-30M PCI 0
-s 1133e01480010014 Diva Server PRI-30M PCI Cornet NQ 0
-d 1133e015 DIVA Server PRI Rev 2 0
-s 1133e0151133e015 Diva Server PRI 2.0 PCI 0
-s 1133e01580010014 Diva Server PRI 2.0 PCI Cornet NQ 0
-d 1133e016 Diva Server Voice 4BRI PCI 0
-s 1133e01680010014 Diva Server PRI Cornet NQ 0
-d 1133e017 Diva Server Voice 4BRI Rev 2 0
-s 1133e0171133e017 Diva Server Voice 4BRI-8M 2.0 PCI 0
-s 1133e01780010014 Diva Server Voice 4BRI-8M 2.0 PCI Cornet NQ 0
-d 1133e018 Diva Server BRI-2M 2.0 PCI 0
-s 1133e01811331800 Diva Server V-BRI-2 0
-s 1133e0181133e018 Diva Server BRI-2M 2.0 PCI 0
-s 1133e01880010014 Diva Server BRI-2M 2.0 PCI Cornet NQ 0
-d 1133e019 Diva Server Voice PRI Rev 2 0
-s 1133e0191133e019 Diva Server Voice PRI 2.0 PCI 0
-s 1133e01980010014 Diva Server Voice PRI 2.0 PCI Cornet NQ 0
-d 1133e01a Diva Server 2FX 0
-d 1133e01b Diva Server Voice BRI-2M 2.0 PCI 0
-s 1133e01b1133e01b Diva Server Voice BRI-2M 2.0 PCI 0
-s 1133e01b80010014 Diva Server Voice BRI-2M 2.0 PCI Cornet NQ 0
-d 1133e01c Diva Server PRI Rev 3 0
-s 1133e01c11331c01 Diva Server PRI/E1/T1-8 0
-s 1133e01c11331c02 Diva Server PRI/T1-24 0
-s 1133e01c11331c03 Diva Server PRI/E1-30 0
-s 1133e01c11331c04 Diva Server PRI/E1/T1 0
-s 1133e01c11331c05 Diva Server V-PRI/T1-24 0
-s 1133e01c11331c06 Diva Server V-PRI/E1-30 0
-s 1133e01c11331c07 Diva Server PRI/E1/T1-8 Cornet NQ 0
-s 1133e01c11331c08 Diva Server PRI/T1-24 Cornet NQ 0
-s 1133e01c11331c09 Diva Server PRI/E1-30 Cornet NQ 0
-s 1133e01c11331c0a Diva Server PRI/E1/T1 Cornet NQ 0
-s 1133e01c11331c0b Diva Server V-PRI/T1-24 Cornet NQ 0
-s 1133e01c11331c0c Diva Server V-PRI/E1-30 Cornet NQ 0
-d 1133e01e Diva Server 2PRI 0
-s 1133e01e11331e00 Diva Server V-2PRI/E1-60 0
-s 1133e01e11331e01 Diva Server V-2PRI/T1-48 0
-s 1133e01e11331e02 Diva Server 2PRI/E1-60 0
-s 1133e01e11331e03 Diva Server 2PRI/T1-48 0
-d 1133e020 Diva Server 4PRI 0
-s 1133e02011332000 Diva Server V-4PRI/E1-120 0
-s 1133e02011332001 Diva Server V-4PRI/T1-96 0
-s 1133e02011332002 Diva Server 4PRI/E1-120 0
-s 1133e02011332003 Diva Server 4PRI/T1-96 0
-d 1133e024 Diva Server Analog-4P 0
-s 1133e02411332400 Diva Server V-Analog-4P 0
-s 1133e0241133e024 Diva Server Analog-4P 0
-d 1133e028 Diva Server Analog-8P 0
-s 1133e02811332800 Diva Server V-Analog-8P 0
-s 1133e0281133e028 Diva Server Analog-8P 0
-v 1134 Mercury Computer Systems 0
-d 11340001 Raceway Bridge 0
-d 11340002 Dual PCI to RapidIO Bridge 0
-v 1135 Fuji Xerox Co Ltd 0
-d 11350001 Printer controller 0
-v 1136 Momentum Data Systems 0
-v 1137 Cisco Systems Inc 0
-v 1138 Ziatech Corporation 0
-d 11388905 8905 [STD 32 Bridge] 0
-v 1139 Dynamic Pictures, Inc 0
-d 11390001 VGA Compatable 3D Graphics 0
-v 113a FWB Inc 0
-v 113b Network Computing Devices 0
-v 113c Cyclone Microsystems, Inc. 0
-d 113c0000 PCI-9060 i960 Bridge 0
-d 113c0001 PCI-SDK [PCI i960 Evaluation Platform] 0
-d 113c0911 PCI-911 [i960Jx-based Intelligent I/O Controller] 0
-d 113c0912 PCI-912 [i960CF-based Intelligent I/O Controller] 0
-d 113c0913 PCI-913 0
-d 113c0914 PCI-914 [I/O Controller w/ secondary PCI bus] 0
-v 113d Leading Edge Products Inc 0
-v 113e Sanyo Electric Co - Computer Engineering Dept 0
-v 113f Equinox Systems, Inc. 0
-d 113f0808 SST-64P Adapter 0
-d 113f1010 SST-128P Adapter 0
-d 113f80c0 SST-16P DB Adapter 0
-d 113f80c4 SST-16P RJ Adapter 0
-d 113f80c8 SST-16P Adapter 0
-d 113f8888 SST-4P Adapter 0
-d 113f9090 SST-8P Adapter 0
-v 1140 Intervoice Inc 0
-v 1141 Crest Microsystem Inc 0
-v 1142 Alliance Semiconductor Corporation 0
-d 11423210 AP6410 0
-d 11426422 ProVideo 6422 0
-d 11426424 ProVideo 6424 0
-d 11426425 ProMotion AT25 0
-d 1142643d ProMotion AT3D 0
-v 1143 NetPower, Inc 0
-v 1144 Cincinnati Milacron 0
-d 11440001 Noservo controller 0
-v 1145 Workbit Corporation 0
-d 11458007 NinjaSCSI-32 Workbit 0
-d 1145f007 NinjaSCSI-32 KME 0
-d 1145f010 NinjaSCSI-32 Workbit 0
-d 1145f012 NinjaSCSI-32 Logitec 0
-d 1145f013 NinjaSCSI-32 Logitec 0
-d 1145f015 NinjaSCSI-32 Melco 0
-v 1146 Force Computers 0
-v 1147 Interface Corp 0
-v 1148 SysKonnect 0 Formerly (Schneider & Koch)
-d 11484000 FDDI Adapter 0
-s 114840000e11b03b Netelligent 100 FDDI DAS Fibre SC 0
-s 114840000e11b03c Netelligent 100 FDDI SAS Fibre SC 0
-s 114840000e11b03d Netelligent 100 FDDI DAS UTP 0
-s 114840000e11b03e Netelligent 100 FDDI SAS UTP 0
-s 114840000e11b03f Netelligent 100 FDDI SAS Fibre MIC 0
-s 1148400011485521 FDDI SK-5521 (SK-NET FDDI-UP) 0
-s 1148400011485522 FDDI SK-5522 (SK-NET FDDI-UP DAS) 0
-s 1148400011485541 FDDI SK-5541 (SK-NET FDDI-FP) 0
-s 1148400011485543 FDDI SK-5543 (SK-NET FDDI-LP) 0
-s 1148400011485544 FDDI SK-5544 (SK-NET FDDI-LP DAS) 0
-s 1148400011485821 FDDI SK-5821 (SK-NET FDDI-UP64) 0
-s 1148400011485822 FDDI SK-5822 (SK-NET FDDI-UP64 DAS) 0
-s 1148400011485841 FDDI SK-5841 (SK-NET FDDI-FP64) 0
-s 1148400011485843 FDDI SK-5843 (SK-NET FDDI-LP64) 0
-s 1148400011485844 FDDI SK-5844 (SK-NET FDDI-LP64 DAS) 0
-d 11484200 Token Ring adapter 0
-d 11484300 SK-98xx Gigabit Ethernet Server Adapter 0
-s 1148430011489821 SK-9821 Gigabit Ethernet Server Adapter (SK-NET GE-T) 0
-s 1148430011489822 SK-9822 Gigabit Ethernet Server Adapter (SK-NET GE-T dual link) 0
-s 1148430011489841 SK-9841 Gigabit Ethernet Server Adapter (SK-NET GE-LX) 0
-s 1148430011489842 SK-9842 Gigabit Ethernet Server Adapter (SK-NET GE-LX dual link) 0
-s 1148430011489843 SK-9843 Gigabit Ethernet Server Adapter (SK-NET GE-SX) 0
-s 1148430011489844 SK-9844 Gigabit Ethernet Server Adapter (SK-NET GE-SX dual link) 0
-s 1148430011489861 SK-9861 Gigabit Ethernet Server Adapter (SK-NET GE-SX Volition) 0
-s 1148430011489862 SK-9862 Gigabit Ethernet Server Adapter (SK-NET GE-SX Volition dual link) 0
-s 1148430011489871 SK-9871 Gigabit Ethernet Server Adapter (SK-NET GE-ZX) 0
-s 1148430011489872 SK-9872 Gigabit Ethernet Server Adapter (SK-NET GE-ZX dual link) 0
-s 1148430012592970 AT-2970SX Gigabit Ethernet Adapter 0
-s 1148430012592971 AT-2970LX Gigabit Ethernet Adapter 0
-s 1148430012592972 AT-2970TX Gigabit Ethernet Adapter 0
-s 1148430012592973 AT-2971SX Gigabit Ethernet Adapter 0
-s 1148430012592974 AT-2971T Gigabit Ethernet Adapter 0
-s 1148430012592975 AT-2970SX/2SC Gigabit Ethernet Adapter 0
-s 1148430012592976 AT-2970LX/2SC Gigabit Ethernet Adapter 0
-s 1148430012592977 AT-2970TX/2TX Gigabit Ethernet Adapter 0
-d 11484320 SK-98xx V2.0 Gigabit Ethernet Adapter 0
-s 1148432011480121 Marvell RDK-8001 Adapter 0
-s 1148432011480221 Marvell RDK-8002 Adapter 0
-s 1148432011480321 Marvell RDK-8003 Adapter 0
-s 1148432011480421 Marvell RDK-8004 Adapter 0
-s 1148432011480621 Marvell RDK-8006 Adapter 0
-s 1148432011480721 Marvell RDK-8007 Adapter 0
-s 1148432011480821 Marvell RDK-8008 Adapter 0
-s 1148432011480921 Marvell RDK-8009 Adapter 0
-s 1148432011481121 Marvell RDK-8011 Adapter 0
-s 1148432011481221 Marvell RDK-8012 Adapter 0
-s 1148432011483221 SK-9521 V2.0 10/100/1000Base-T Adapter 0
-s 1148432011485021 SK-9821 V2.0 Gigabit Ethernet 10/100/1000Base-T Adapter 0
-s 1148432011485041 SK-9841 V2.0 Gigabit Ethernet 1000Base-LX Adapter 0
-s 1148432011485043 SK-9843 V2.0 Gigabit Ethernet 1000Base-SX Adapter 0
-s 1148432011485051 SK-9851 V2.0 Gigabit Ethernet 1000Base-SX Adapter 0
-s 1148432011485061 SK-9861 V2.0 Gigabit Ethernet 1000Base-SX Adapter 0
-s 1148432011485071 SK-9871 V2.0 Gigabit Ethernet 1000Base-ZX Adapter 0
-s 1148432011489521 SK-9521 10/100/1000Base-T Adapter 0
-d 11484400 SK-9Dxx Gigabit Ethernet Adapter 0
-d 11484500 SK-9Mxx Gigabit Ethernet Adapter 0
-d 11489e00 SK-9Exx 10/100/1000Base-T Adapter 0
-s 11489e0011482100 SK-9E21 Server Adapter 0
-s 11489e00114821d0 SK-9E21D 10/100/1000Base-T Adapter 0
-s 11489e0011482200 SK-9E22 Server Adapter 0
-s 11489e0011488100 SK-9E81 Server Adapter 0
-s 11489e0011488200 SK-9E82 Server Adapter 0
-s 11489e0011489100 SK-9E91 Server Adapter 0
-s 11489e0011489200 SK-9E92 Server Adapter 0
-v 1149 Win System Corporation 0
-v 114a VMIC 0
-d 114a5579 VMIPCI-5579 (Reflective Memory Card) 0
-d 114a5587 VMIPCI-5587 (Reflective Memory Card) 0
-d 114a6504 VMIC PCI 7755 FPGA 0
-d 114a7587 VMIVME-7587 0
-v 114b Canopus Co., Ltd 0
-v 114c Annabooks 0
-v 114d IC Corporation 0
-v 114e Nikon Systems Inc 0
-v 114f Digi International 0
-d 114f0002 AccelePort EPC 0
-d 114f0003 RightSwitch SE-6 0
-d 114f0004 AccelePort Xem 0
-d 114f0005 AccelePort Xr 0
-d 114f0006 AccelePort Xr,C/X 0
-d 114f0009 AccelePort Xr/J 0
-d 114f000a AccelePort EPC/J 0
-d 114f000c DataFirePRIme T1 (1-port) 0
-d 114f000d SyncPort 2-Port (x.25/FR) 0
-d 114f0011 AccelePort 8r EIA-232 (IBM) 0
-d 114f0012 AccelePort 8r EIA-422 0
-d 114f0013 AccelePort Xr 0
-d 114f0014 AccelePort 8r EIA-422 0
-d 114f0015 AccelePort Xem 0
-d 114f0016 AccelePort EPC/X 0
-d 114f0017 AccelePort C/X 0
-d 114f001a DataFirePRIme E1 (1-port) 0
-d 114f001b AccelePort C/X (IBM) 0
-d 114f001d DataFire RAS T1/E1/PRI 0
-s 114f001d114f0050 DataFire RAS E1 Adapter 0
-s 114f001d114f0051 DataFire RAS Dual E1 Adapter 0
-s 114f001d114f0052 DataFire RAS T1 Adapter 0
-s 114f001d114f0053 DataFire RAS Dual T1 Adapter 0
-d 114f0023 AccelePort RAS 0
-d 114f0024 DataFire RAS B4 ST/U 0
-s 114f0024114f0030 DataFire RAS BRI U Adapter 0
-s 114f0024114f0031 DataFire RAS BRI S/T Adapter 0
-d 114f0026 AccelePort 4r 920 0
-d 114f0027 AccelePort Xr 920 0
-d 114f0028 ClassicBoard 4 0
-d 114f0029 ClassicBoard 8 0
-d 114f0034 AccelePort 2r 920 0
-d 114f0035 DataFire DSP T1/E1/PRI cPCI 0
-d 114f0040 AccelePort Xp 0
-d 114f0042 AccelePort 2p 0
-d 114f0043 AccelePort 4p 0
-d 114f0044 AccelePort 8p 0
-d 114f0045 AccelePort 16p 0
-d 114f004e AccelePort 32p 0
-d 114f0070 Datafire Micro V IOM2 (Europe) 0
-d 114f0071 Datafire Micro V (Europe) 0
-d 114f0072 Datafire Micro V IOM2 (North America) 0
-d 114f0073 Datafire Micro V (North America) 0
-d 114f00b0 Digi Neo 4 0
-d 114f00b1 Digi Neo 8 0
-d 114f00c8 Digi Neo 2 DB9 0
-d 114f00c9 Digi Neo 2 DB9 PRI 0
-d 114f00ca Digi Neo 2 RJ45 0
-d 114f00cb Digi Neo 2 RJ45 PRI 0
-d 114f00d0 ClassicBoard 4 422 0
-d 114f00d1 ClassicBoard 8 422 0
-d 114f6001 Avanstar 0
-v 1150 Thinking Machines Corp 0
-v 1151 JAE Electronics Inc. 0
-v 1152 Megatek 0
-v 1153 Land Win Electronic Corp 0
-v 1154 Melco Inc 0
-v 1155 Pine Technology Ltd 0
-v 1156 Periscope Engineering 0
-v 1157 Avsys Corporation 0
-v 1158 Voarx R & D Inc 0
-d 11583011 Tokenet/vg 1001/10m anylan 0
-d 11589050 Lanfleet/Truevalue 0
-d 11589051 Lanfleet/Truevalue 0
-v 1159 Mutech Corp 0
-d 11590001 MV-1000 0
-v 115a Harlequin Ltd 0
-v 115b Parallax Graphics 0
-v 115c Photron Ltd. 0
-v 115d Xircom 0
-d 115d0003 Cardbus Ethernet 10/100 0
-s 115d000310140181 10/100 EtherJet Cardbus Adapter 0
-s 115d000310141181 10/100 EtherJet Cardbus Adapter 0
-s 115d000310148181 10/100 EtherJet Cardbus Adapter 0
-s 115d000310149181 10/100 EtherJet Cardbus Adapter 0
-s 115d0003115d0181 Cardbus Ethernet 10/100 0
-s 115d0003115d1181 Cardbus Ethernet 10/100 0
-s 115d000311790181 Cardbus Ethernet 10/100 0
-s 115d000380868181 EtherExpress PRO/100 Mobile CardBus 32 Adapter 0
-s 115d000380869181 EtherExpress PRO/100 Mobile CardBus 32 Adapter 0
-d 115d0005 Cardbus Ethernet 10/100 0
-s 115d000510140182 10/100 EtherJet Cardbus Adapter 0
-s 115d000510141182 10/100 EtherJet Cardbus Adapter 0
-s 115d0005115d0182 Cardbus Ethernet 10/100 0
-s 115d0005115d1182 Cardbus Ethernet 10/100 0
-d 115d0007 Cardbus Ethernet 10/100 0
-s 115d000710140182 10/100 EtherJet Cardbus Adapter 0
-s 115d000710141182 10/100 EtherJet Cardbus Adapter 0
-s 115d0007115d0182 Cardbus Ethernet 10/100 0
-s 115d0007115d1182 Cardbus Ethernet 10/100 0
-d 115d000b Cardbus Ethernet 10/100 0
-s 115d000b10140183 10/100 EtherJet Cardbus Adapter 0
-s 115d000b115d0183 Cardbus Ethernet 10/100 0
-d 115d000c Mini-PCI V.90 56k Modem 0
-d 115d000f Cardbus Ethernet 10/100 0
-s 115d000f10140183 10/100 EtherJet Cardbus Adapter 0
-s 115d000f115d0183 Cardbus Ethernet 10/100 0
-d 115d00d4 Mini-PCI K56Flex Modem 0
-d 115d0101 Cardbus 56k modem 0
-s 115d0101115d1081 Cardbus 56k Modem 0
-d 115d0103 Cardbus Ethernet + 56k Modem 0
-s 115d010310149181 Cardbus 56k Modem 0
-s 115d010311151181 Cardbus Ethernet 100 + 56k Modem 0
-s 115d0103115d1181 CBEM56G-100 Ethernet + 56k Modem 0
-s 115d010380869181 PRO/100 LAN + Modem56 CardBus 0
-v 115e Peer Protocols Inc 0
-v 115f Maxtor Corporation 0
-v 1160 Megasoft Inc 0
-v 1161 PFU Limited 0
-v 1162 OA Laboratory Co Ltd 0
-v 1163 Rendition 0
-d 11630001 Verite 1000 0
-d 11632000 Verite V2000/V2100/V2200 0
-s 1163200010922000 Stealth II S220 0
-v 1164 Advanced Peripherals Technologies 0
-v 1165 Imagraph Corporation 0
-d 11650001 Motion TPEG Recorder/Player with audio 0
-v 1166 ServerWorks 0
-d 11660000 CMIC-LE 0
-d 11660005 CNB20-LE Host Bridge 0
-d 11660006 CNB20HE Host Bridge 0
-d 11660007 CNB20-LE Host Bridge 0
-d 11660008 CNB20HE Host Bridge 0
-d 11660009 CNB20LE Host Bridge 0
-d 11660010 CIOB30 0
-d 11660011 CMIC-HE 0
-d 11660012 CMIC-WS Host Bridge (GC-LE chipset) 0
-d 11660013 CNB20-HE Host Bridge 0
-d 11660014 CMIC-LE Host Bridge (GC-LE chipset) 0
-d 11660015 CMIC-GC Host Bridge 0
-d 11660016 CMIC-GC Host Bridge 0
-d 11660017 GCNB-LE Host Bridge 0
-d 11660101 CIOB-X2 PCI-X I/O Bridge 0
-d 11660110 CIOB-E I/O Bridge with Gigabit Ethernet 0
-d 11660200 OSB4 South Bridge 0
-d 11660201 CSB5 South Bridge 0
-s 116602014c531080 CT8 mainboard 0
-d 11660203 CSB6 South Bridge 0
-d 11660211 OSB4 IDE Controller 0
-d 11660212 CSB5 IDE Controller 0
-s 116602124c531080 CT8 mainboard 0
-d 11660213 CSB6 RAID/IDE Controller 0
-d 11660217 CSB6 IDE Controller 0
-d 11660220 OSB4/CSB5 OHCI USB Controller 0
-s 116602204c531080 CT8 mainboard 0
-d 11660221 CSB6 OHCI USB Controller 0
-d 11660225 CSB5 LPC bridge 0
-s 116602254c531080 CT8 mainboard 0 cancelled
-d 11660227 GCLE-2 Host Bridge 0
-d 11660230 CSB5 LPC bridge 0
-s 116602304c531080 CT8 mainboard 0
-d 11660240 K2 SATA 0
-v 1167 Mutoh Industries Inc 0
-v 1168 Thine Electronics Inc 0
-v 1169 Centre for Development of Advanced Computing 0
-v 116a Polaris Communications 0
-d 116a6100 Bus/Tag Channel 0
-d 116a6800 Escon Channel 0
-d 116a7100 Bus/Tag Channel 0
-d 116a7800 Escon Channel 0
-v 116b Connectware Inc 0
-v 116c Intelligent Resources Integrated Systems 0
-v 116d Martin-Marietta 0
-v 116e Electronics for Imaging 0
-v 116f Workstation Technology 0
-v 1170 Inventec Corporation 0
-v 1171 Loughborough Sound Images Plc 0
-v 1172 Altera Corporation 0
-v 1173 Adobe Systems, Inc 0
-v 1174 Bridgeport Machines 0
-v 1175 Mitron Computer Inc. 0
-v 1176 SBE Incorporated 0
-v 1177 Silicon Engineering 0
-v 1178 Alfa, Inc. 0
-d 1178afa1 Fast Ethernet Adapter 0
-v 1179 Toshiba America Info Systems 0
-d 11790103 EX-IDE Type-B 0
-d 11790404 DVD Decoder card 0
-d 11790406 Tecra Video Capture device 0
-d 11790407 DVD Decoder card (Version 2) 0
-d 11790601 601 0
-d 11790603 ToPIC95 PCI to CardBus Bridge for Notebooks 0
-d 1179060a ToPIC95 0
-d 1179060f ToPIC97 0
-d 11790617 ToPIC100 PCI to Cardbus Bridge with ZV Support 0
-d 11790618 CPU to PCI and PCI to ISA bridge 0
-d 11790701 FIR Port 0 Claimed to be Lucent DSP1645 [Mars], but that's apparently incorrect. Does anyone know the correct ID?
-d 11790804 TC6371AF SmartMedia Controller 0
-d 11790805 SD TypA Controller 0
-d 11790d01 FIR Port Type-DO 0
-s 11790d0111790001 FIR Port Type-DO 0
-v 117a A-Trend Technology 0
-v 117b L G Electronics, Inc. 0
-v 117c Atto Technology 0
-v 117d Becton & Dickinson 0
-v 117e T/R Systems 0
-v 117f Integrated Circuit Systems 0
-v 1180 Ricoh Co Ltd 0
-d 11800465 RL5c465 0
-d 11800466 RL5c466 0
-d 11800475 RL5c475 0
-s 11800475144dc006 vpr Matrix 170B4 CardBus bridge 0
-d 11800476 RL5c476 II 0
-s 1180047610140185 ThinkPad A/T/X Series 0
-s 11800476104d80df Vaio PCG-FX403 0
-s 11800476104d80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP 0
-s 1180047614ef0220 PCD-RP-220S 0
-d 11800477 RL5c477 0
-d 11800478 RL5c478 0
-s 1180047810140184 ThinkPad A30p (2653-64G) 0
-d 11800522 R5C522 IEEE 1394 Controller 0
-s 11800522101401cf ThinkPad A30p (2653-64G) 0
-d 11800551 R5C551 IEEE 1394 Controller 0
-s 11800551144dc006 vpr Matrix 170B4 0
-d 11800552 R5C552 IEEE 1394 Controller 0
-s 1180055210140511 ThinkPad A/T/X Series 0
-v 1181 Telmatics International 0
-v 1183 Fujikura Ltd 0
-v 1184 Forks Inc 0
-v 1185 Dataworld International Ltd 0
-v 1186 D-Link System Inc 0
-d 11860100 DC21041 0
-d 11861002 DL10050 Sundance Ethernet 0
-s 1186100211861002 DFE-550TX 0
-s 1186100211861012 DFE-580TX 0
-d 11861025 AirPlus Xtreme G DWL-G650 Adapter 0
-d 11861026 AirXpert DWL-AG650 Wireless Cardbus Adapter 0
-d 11861043 AirXpert DWL-AG650 Wireless Cardbus Adapter 0
-d 11861300 RTL8139 Ethernet 0
-s 1186130011861300 DFE-538TX 10/100 Ethernet Adapter 0
-s 1186130011861301 DFE-530TX+ 10/100 Ethernet Adapter 0
-d 11861340 DFE-690TXD CardBus PC Card 0
-d 11861541 DFE-680TXD CardBus PC Card 0
-d 11861561 DRP-32TXD Cardbus PC Card 0
-d 11862027 AirPlus Xtreme G DWL-G520 Adapter 0
-d 11863203 AirPlus Xtreme G DWL-G520 Adapter 0
-d 11863300 DWL-510 2.4GHz Wireless PCI Adapter 0
-d 11863a03 AirPro DWL-A650 Wireless Cardbus Adapter(rev.B) 0
-d 11863a04 AirPro DWL-AB650 Multimode Wireless Cardbus Adapter 0
-d 11863a05 AirPro DWL-AB520 Multimode Wireless PCI Adapter 0
-d 11863a07 AirXpert DWL-AG650 Wireless Cardbus Adapter 0
-d 11863a08 AirXpert DWL-AG520 Wireless PCI Adapter 0
-d 11863a10 AirXpert DWL-AG650 Wireless Cardbus Adapter(rev.B) 0
-d 11863a11 AirXpert DWL-AG520 Wireless PCI Adapter(rev.B) 0
-d 11863a12 AirPlus DWL-G650 Wireless Cardbus Adapter(rev.C) 0
-d 11863a13 AirPlus DWL-G520 Wireless PCI Adapter(rev.B) 0
-d 11863a14 AirPremier DWL-AG530 Wireless PCI Adapter 0
-d 11863a63 AirXpert DWL-AG660 Wireless Cardbus Adapter 0
-d 11863b05 DWL-G650+ CardBus PC Card 0
-d 11864000 DL2000-based Gigabit Ethernet 0
-d 11864c00 Gigabit Ethernet Adapter 0
-s 11864c0011864c00 DGE-530T Gigabit Ethernet Adapter 0
-d 11868400 D-Link DWL-650+ CardBus PC Card 0
-v 1187 Advanced Technology Laboratories, Inc. 0
-v 1188 Shima Seiki Manufacturing Ltd. 0
-v 1189 Matsushita Electronics Co Ltd 0
-v 118a Hilevel Technology 0
-v 118b Hypertec Pty Limited 0
-v 118c Corollary, Inc 0
-d 118c0014 PCIB [C-bus II to PCI bus host bridge chip] 0
-d 118c1117 Intel 8-way XEON Profusion Chipset [Cache Coherency Filter] 0
-v 118d BitFlow Inc 0
-d 118d0001 Raptor-PCI framegrabber 0
-d 118d0012 Model 12 Road Runner Frame Grabber 0
-d 118d0014 Model 14 Road Runner Frame Grabber 0
-d 118d0024 Model 24 Road Runner Frame Grabber 0
-d 118d0044 Model 44 Road Runner Frame Grabber 0
-d 118d0112 Model 12 Road Runner Frame Grabber 0
-d 118d0114 Model 14 Road Runner Frame Grabber 0
-d 118d0124 Model 24 Road Runner Frame Grabber 0
-d 118d0144 Model 44 Road Runner Frame Grabber 0
-d 118d0212 Model 12 Road Runner Frame Grabber 0
-d 118d0214 Model 14 Road Runner Frame Grabber 0
-d 118d0224 Model 24 Road Runner Frame Grabber 0
-d 118d0244 Model 44 Road Runner Frame Grabber 0
-d 118d0312 Model 12 Road Runner Frame Grabber 0
-d 118d0314 Model 14 Road Runner Frame Grabber 0
-d 118d0324 Model 24 Road Runner Frame Grabber 0
-d 118d0344 Model 44 Road Runner Frame Grabber 0
-v 118e Hermstedt GmbH 0
-v 118f Green Logic 0
-v 1190 Tripace 0
-d 1190c731 TP-910/920/940 PCI Ultra(Wide) SCSI Adapter 0
-v 1191 Artop Electronic Corp 0
-d 11910003 SCSI Cache Host Adapter 0
-d 11910004 ATP8400 0
-d 11910005 ATP850UF 0
-d 11910006 ATP860 NO-BIOS 0
-d 11910007 ATP860 0
-d 11910008 ATP865 NO-ROM 0
-d 11910009 ATP865 0
-d 11918002 AEC6710 SCSI-2 Host Adapter 0
-d 11918010 AEC6712UW SCSI 0
-d 11918020 AEC6712U SCSI 0
-d 11918030 AEC6712S SCSI 0
-d 11918040 AEC6712D SCSI 0
-d 11918050 AEC6712SUW SCSI 0
-v 1192 Densan Company Ltd 0
-v 1193 Zeitnet Inc. 0
-d 11930001 1221 0
-d 11930002 1225 0
-v 1194 Toucan Technology 0
-v 1195 Ratoc System Inc 0
-v 1196 Hytec Electronics Ltd 0
-v 1197 Gage Applied Sciences, Inc. 0
-d 1197010c CompuScope 82G 8bit 2GS/s Analog Input Card 0
-v 1198 Lambda Systems Inc 0
-v 1199 Attachmate Corporation 0
-v 119a Mind Share, Inc. 0
-v 119b Omega Micro Inc. 0
-d 119b1221 82C092G 0
-v 119c Information Technology Inst. 0
-v 119d Bug, Inc. Sapporo Japan 0
-v 119e Fujitsu Microelectronics Ltd. 0
-d 119e0001 FireStream 155 0
-d 119e0003 FireStream 50 0
-v 119f Bull HN Information Systems 0
-v 11a0 Convex Computer Corporation 0
-v 11a1 Hamamatsu Photonics K.K. 0
-v 11a2 Sierra Research and Technology 0
-v 11a3 Deuretzbacher GmbH & Co. Eng. KG 0
-v 11a4 Barco Graphics NV 0
-v 11a5 Microunity Systems Eng. Inc 0
-v 11a6 Pure Data Ltd. 0
-v 11a7 Power Computing Corp. 0
-v 11a8 Systech Corp. 0
-v 11a9 InnoSys Inc. 0
-d 11a94240 AMCC S933Q Intelligent Serial Card 0
-v 11aa Actel 0
-v 11ab Marvell Technology Group Ltd. 0 Formerly Galileo Technology, Inc.
-d 11ab0146 GT-64010/64010A System Controller 0
-d 11ab138f W8300 802.11 Adapter (rev 07) 0
-d 11ab1fa6 Marvell W8300 802.11 Adapter 0
-d 11ab4320 Gigabit Ethernet Controller 0
-s 11ab432010190f38 Marvell 88E8001 Gigabit Ethernet Controller (ECS) 0
-s 11ab432010198001 Marvell 88E8001 Gigabit Ethernet Controller (ECS) 0
-s 11ab43201043173c Marvell 88E8001 Gigabit Ethernet Controller (Asus) 0
-s 11ab43201043811a Marvell 88E8001 Gigabit Ethernet Controller (Asus) 0
-s 11ab4320105b0c19 Marvell 88E8001 Gigabit Ethernet Controller (Foxconn) 0
-s 11ab432010b8b452 SMC EZ Card 1000 (SMC9452TXV.2) 0
-s 11ab432011ab0121 Marvell RDK-8001 0
-s 11ab432011ab0321 Marvell RDK-8003 0
-s 11ab432011ab1021 Marvell RDK-8010 0
-s 11ab432011ab5021 Marvell Yukon Gigabit Ethernet 10/100/1000Base-T Controller (64 bit) 0
-s 11ab432011ab9521 Marvell Yukon Gigabit Ethernet 10/100/1000Base-T Controller (32 bit) 0
-s 11ab43201458e000 Marvell 88E8001 Gigabit Ethernet Controller (Gigabyte) 0
-s 11ab4320147b1406 Marvell 88E8001 Gigabit Ethernet Controller (Abit) 0
-s 11ab432015d40047 Marvell 88E8001 Gigabit Ethernet Controller (Iwill) 0
-s 11ab432016959025 Marvell 88E8001 Gigabit Ethernet Controller (Epox) 0
-s 11ab432017f21c03 Marvell 88E8001 Gigabit Ethernet Controller (Albatron) 0
-s 11ab4320270f2803 Marvell 88E8001 Gigabit Ethernet Controller (Chaintech) 0
-d 11ab4350 Fast Ethernet Controller 0
-s 11ab435011790001 Marvell 88E8035 Fast Ethernet Controller (Toshiba) 0
-s 11ab435011ab3521 Marvell RDK-8035 0
-s 11ab43501854000d Marvell 88E8035 Fast Ethernet Controller (LGE) 0
-s 11ab43501854000e Marvell 88E8035 Fast Ethernet Controller (LGE) 0
-s 11ab43501854000f Marvell 88E8035 Fast Ethernet Controller (LGE) 0
-s 11ab435018540011 Marvell 88E8035 Fast Ethernet Controller (LGE) 0
-s 11ab435018540012 Marvell 88E8035 Fast Ethernet Controller (LGE) 0
-s 11ab435018540016 Marvell 88E8035 Fast Ethernet Controller (LGE) 0
-s 11ab435018540017 Marvell 88E8035 Fast Ethernet Controller (LGE) 0
-s 11ab435018540018 Marvell 88E8035 Fast Ethernet Controller (LGE) 0
-s 11ab435018540019 Marvell 88E8035 Fast Ethernet Controller (LGE) 0
-s 11ab43501854001c Marvell 88E8035 Fast Ethernet Controller (LGE) 0
-s 11ab43501854001e Marvell 88E8035 Fast Ethernet Controller (LGE) 0
-s 11ab435018540020 Marvell 88E8035 Fast Ethernet Controller (LGE) 0
-d 11ab4351 Fast Ethernet Controller 0
-s 11ab4351107b4009 Marvell 88E8036 Fast Ethernet Controller (Wistron) 0
-s 11ab435110f78338 Marvell 88E8036 Fast Ethernet Controller (Panasonic) 0
-s 11ab435111790001 Marvell 88E8036 Fast Ethernet Controller (Toshiba) 0
-s 11ab43511179ff00 Marvell 88E8036 Fast Ethernet Controller (Compal) 0
-s 11ab43511179ff10 Marvell 88E8036 Fast Ethernet Controller (Inventec) 0
-s 11ab435111ab3621 Marvell RDK-8036 0
-s 11ab435113d1ac12 Abocom EFE3K - 10/100 Ethernet Expresscard 0
-s 11ab4351161f203d Marvell 88E8036 Fast Ethernet Controller (Arima) 0
-s 11ab43511854000d Marvell 88E8036 Fast Ethernet Controller (LGE) 0
-s 11ab43511854000e Marvell 88E8036 Fast Ethernet Controller (LGE) 0
-s 11ab43511854000f Marvell 88E8036 Fast Ethernet Controller (LGE) 0
-s 11ab435118540011 Marvell 88E8036 Fast Ethernet Controller (LGE) 0
-s 11ab435118540012 Marvell 88E8036 Fast Ethernet Controller (LGE) 0
-s 11ab435118540016 Marvell 88E8036 Fast Ethernet Controller (LGE) 0
-s 11ab435118540017 Marvell 88E8036 Fast Ethernet Controller (LGE) 0
-s 11ab435118540018 Marvell 88E8036 Fast Ethernet Controller (LGE) 0
-s 11ab435118540019 Marvell 88E8036 Fast Ethernet Controller (LGE) 0
-s 11ab43511854001c Marvell 88E8036 Fast Ethernet Controller (LGE) 0
-s 11ab43511854001e Marvell 88E8036 Fast Ethernet Controller (LGE) 0
-s 11ab435118540020 Marvell 88E8036 Fast Ethernet Controller (LGE) 0
-d 11ab4360 Gigabit Ethernet Controller 0
-s 11ab436010438134 Marvell 88E8052 Gigabit Ethernet Controller (Asus) 0
-s 11ab4360107b4009 Marvell 88E8052 Gigabit Ethernet Controller (Wistron) 0
-s 11ab436011ab5221 Marvell RDK-8052 0
-s 11ab43601458e000 Marvell 88E8052 Gigabit Ethernet Controller (Gigabyte) 0
-s 11ab43601462052c Marvell 88E8052 Gigabit Ethernet Controller (MSI) 0
-s 11ab436018498052 Marvell 88E8052 Gigabit Ethernet Controller (ASRock) 0
-s 11ab43601940e000 Marvell 88E8052 Gigabit Ethernet Controller (Gigabyte) 0
-s 11ab4360a0a00509 Marvell 88E8052 Gigabit Ethernet Controller (Aopen) 0
-d 11ab4361 Gigabit Ethernet Controller 0
-s 11ab4361107b3015 Marvell 88E8050 Gigabit Ethernet Controller (Gateway) 0
-s 11ab436111ab5021 Marvell 88E8050 Gigabit Ethernet Controller (Intel) 0
-s 11ab436180863063 D925XCVLK mainboard 0
-d 11ab4362 Gigabit Ethernet Controller 0
-s 11ab4362103c2a0d Marvell 88E8053 Gigabit Ethernet Controller (Asus) 0
-s 11ab436210438142 Marvell 88E8053 Gigabit Ethernet Controller (Asus) 0
-s 11ab4362109f3197 Marvell 88E8053 Gigabit Ethernet Controller (Trigem) 0
-s 11ab436210f78338 Marvell 88E8053 Gigabit Ethernet Controller (Panasonic) 0
-s 11ab436210fda430 Marvell 88E8053 Gigabit Ethernet Controller (SOYO) 0
-s 11ab436211790001 Marvell 88E8053 Gigabit Ethernet Controller (Toshiba) 0
-s 11ab43621179ff00 Marvell 88E8053 Gigabit Ethernet Controller (Compal) 0
-s 11ab43621179ff10 Marvell 88E8053 Gigabit Ethernet Controller (Inventec) 0
-s 11ab436211ab5321 Marvell RDK-8053 0
-s 11ab43621297c240 Marvell 88E8053 Gigabit Ethernet Controller (Shuttle) 0
-s 11ab43621297c241 Marvell 88E8053 Gigabit Ethernet Controller (Shuttle) 0
-s 11ab43621297c242 Marvell 88E8053 Gigabit Ethernet Controller (Shuttle) 0
-s 11ab43621297c243 Marvell 88E8053 Gigabit Ethernet Controller (Shuttle) 0
-s 11ab43621297c244 Marvell 88E8053 Gigabit Ethernet Controller (Shuttle) 0
-s 11ab436213d1ac11 Abocom EGE5K - Giga Ethernet Expresscard 0
-s 11ab43621458e000 Marvell 88E8053 Gigabit Ethernet Controller (Gigabyte) 0
-s 11ab43621462058c Marvell 88E8053 Gigabit Ethernet Controller (MSI) 0
-s 11ab436214c00012 Marvell 88E8053 Gigabit Ethernet Controller (Compal) 0
-s 11ab4362155804a0 Marvell 88E8053 Gigabit Ethernet Controller (Clevo) 0
-s 11ab436215bd1003 Marvell 88E8053 Gigabit Ethernet Controller (DFI) 0
-s 11ab4362161f203c Marvell 88E8053 Gigabit Ethernet Controller (Arima) 0
-s 11ab4362161f203d Marvell 88E8053 Gigabit Ethernet Controller (Arima) 0
-s 11ab436216959029 Marvell 88E8053 Gigabit Ethernet Controller (Epox) 0
-s 11ab436217f22c08 Marvell 88E8053 Gigabit Ethernet Controller (Albatron) 0
-s 11ab436217ff0585 Marvell 88E8053 Gigabit Ethernet Controller (Quanta) 0
-s 11ab436218498053 Marvell 88E8053 Gigabit Ethernet Controller (ASRock) 0
-s 11ab43621854000b Marvell 88E8053 Gigabit Ethernet Controller (LGE) 0
-s 11ab43621854000c Marvell 88E8053 Gigabit Ethernet Controller (LGE) 0
-s 11ab436218540010 Marvell 88E8053 Gigabit Ethernet Controller (LGE) 0
-s 11ab436218540013 Marvell 88E8053 Gigabit Ethernet Controller (LGE) 0
-s 11ab436218540014 Marvell 88E8053 Gigabit Ethernet Controller (LGE) 0
-s 11ab436218540015 Marvell 88E8053 Gigabit Ethernet Controller (LGE) 0
-s 11ab43621854001a Marvell 88E8053 Gigabit Ethernet Controller (LGE) 0
-s 11ab43621854001b Marvell 88E8053 Gigabit Ethernet Controller (LGE) 0
-s 11ab43621854001d Marvell 88E8053 Gigabit Ethernet Controller (LGE) 0
-s 11ab43621854001f Marvell 88E8053 Gigabit Ethernet Controller (LGE) 0
-s 11ab436218540021 Marvell 88E8053 Gigabit Ethernet Controller (LGE) 0
-s 11ab436218540022 Marvell 88E8053 Gigabit Ethernet Controller (LGE) 0
-s 11ab43621940e000 Marvell 88E8053 Gigabit Ethernet Controller (Gigabyte) 0
-s 11ab4362270f2801 Marvell 88E8053 Gigabit Ethernet Controller (Chaintech) 0
-s 11ab4362a0a00506 Marvell 88E8053 Gigabit Ethernet Controller (Aopen) 0
-d 11ab4611 GT-64115 System Controller 0
-d 11ab4620 GT-64120/64120A/64121A System Controller 0
-d 11ab4801 GT-48001 0
-d 11ab5040 MV88SX5040 4-port SATA I PCI-X Controller 0
-d 11ab5041 MV88SX5041 4-port SATA I PCI-X Controller 0
-d 11ab5080 MV88SX5080 8-port SATA I PCI-X Controller 0
-d 11ab5081 MV88SX5081 8-port SATA I PCI-X Controller 0
-d 11ab6041 MV88SX6041 4-port SATA II PCI-X Controller 0
-d 11ab6081 MV88SX6081 8-port SATA II PCI-X Controller 0
-d 11ab6460 MV64360/64361/64362 System Controller 0
-d 11abf003 GT-64010 Primary Image Piranha Image Generator 0
-v 11ac Canon Information Systems Research Aust. 0
-v 11ad Lite-On Communications Inc 0
-d 11ad0002 LNE100TX 0
-s 11ad000211ad0002 LNE100TX 0
-s 11ad000211ad0003 LNE100TX 0
-s 11ad000211adf003 LNE100TX 0
-s 11ad000211adffff LNE100TX 0
-s 11ad00021385f004 FA310TX 0
-d 11adc115 LNE100TX [Linksys EtherFast 10/100] 0
-s 11adc11511adc001 LNE100TX [ver 2.0] 0
-v 11ae Aztech System Ltd 0
-v 11af Avid Technology Inc. 0
-d 11af0001 [Cinema] 0
-v 11b0 V3 Semiconductor Inc. 0
-d 11b00002 V300PSC 0
-d 11b00292 V292PBC [Am29030/40 Bridge] 0
-d 11b00960 V96xPBC 0
-d 11b0c960 V96DPC 0
-v 11b1 Apricot Computers 0
-v 11b2 Eastman Kodak 0
-v 11b3 Barr Systems Inc. 0
-v 11b4 Leitch Technology International 0
-v 11b5 Radstone Technology Plc 0
-v 11b6 United Video Corp 0
-v 11b7 Motorola 0
-v 11b8 XPoint Technologies, Inc 0
-d 11b80001 Quad PeerMaster 0
-v 11b9 Pathlight Technology Inc. 0
-d 11b9c0ed SSA Controller 0
-v 11ba Videotron Corp 0
-v 11bb Pyramid Technology 0
-v 11bc Network Peripherals Inc 0
-d 11bc0001 NP-PCI 0
-v 11bd Pinnacle Systems Inc. 0
-v 11be International Microcircuits Inc 0
-v 11bf Astrodesign, Inc. 0
-v 11c0 Hewlett Packard 0
-v 11c1 Agere Systems (former Lucent Microelectronics) 0
-d 11c10440 56k WinModem 0
-s 11c1044010338015 LT WinModem 56k Data+Fax+Voice+Dsvd 0
-s 11c1044010338047 LT WinModem 56k Data+Fax+Voice+Dsvd 0
-s 11c104401033804f LT WinModem 56k Data+Fax+Voice+Dsvd 0
-s 11c1044010cf102c LB LT Modem V.90 56k 0
-s 11c1044010cf104a BIBLO LT Modem 56k 0
-s 11c1044010cf105f LB2 LT Modem V.90 56k 0
-s 11c1044011790001 Internal V.90 Modem 0
-s 11c1044011c10440 LT WinModem 56k Data+Fax+Voice+Dsvd 0
-s 11c10440122d4101 MDP7800-U Modem 0
-s 11c10440122d4102 MDP7800SP-U Modem 0
-s 11c1044013e00040 LT WinModem 56k Data+Fax+Voice+Dsvd 0
-s 11c1044013e00440 LT WinModem 56k Data+Fax+Voice+Dsvd 0
-s 11c1044013e00441 LT WinModem 56k Data+Fax+Voice+Dsvd 0
-s 11c1044013e00450 LT WinModem 56k Data+Fax+Voice+Dsvd 0
-s 11c1044013e0f100 LT WinModem 56k Data+Fax+Voice+Dsvd 0
-s 11c1044013e0f101 LT WinModem 56k Data+Fax+Voice+Dsvd 0
-s 11c10440144d2101 LT56PV Modem 0
-s 11c10440149f0440 LT WinModem 56k Data+Fax+Voice+Dsvd 0
-d 11c10441 56k WinModem 0
-s 11c104411033804d LT WinModem 56k Data+Fax 0
-s 11c1044110338065 LT WinModem 56k Data+Fax 0
-s 11c1044110920440 Supra 56i 0
-s 11c1044111790001 Internal V.90 Modem 0
-s 11c1044111c10440 LT WinModem 56k Data+Fax 0
-s 11c1044111c10441 LT WinModem 56k Data+Fax 0
-s 11c10441122d4100 MDP7800-U Modem 0
-s 11c1044113e00040 LT WinModem 56k Data+Fax 0
-s 11c1044113e00100 LT WinModem 56k Data+Fax 0
-s 11c1044113e00410 LT WinModem 56k Data+Fax 0
-s 11c1044113e00420 TelePath Internet 56k WinModem 0
-s 11c1044113e00440 LT WinModem 56k Data+Fax 0
-s 11c1044113e00443 LT WinModem 56k Data+Fax 0
-s 11c1044113e0f102 LT WinModem 56k Data+Fax 0
-s 11c1044114169804 CommWave 56k Modem 0
-s 11c10441141d0440 LT WinModem 56k Data+Fax 0
-s 11c10441144f0441 Lucent 56k V.90 DF Modem 0
-s 11c10441144f0449 Lucent 56k V.90 DF Modem 0
-s 11c10441144f110d Lucent Win Modem 0
-s 11c1044114680441 Presario 56k V.90 DF Modem 0
-s 11c1044116680440 Lucent Win Modem 0
-d 11c10442 56k WinModem 0
-s 11c1044211c10440 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd 0
-s 11c1044211c10442 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd 0
-s 11c1044213e00412 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd 0
-s 11c1044213e00442 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd 0
-s 11c1044213fc2471 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd 0
-s 11c10442144d2104 LT56PT Modem 0
-s 11c10442144f1104 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd 0
-s 11c10442149f0440 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd 0
-s 11c1044216680440 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd 0
-d 11c10443 LT WinModem 0
-d 11c10444 LT WinModem 0
-d 11c10445 LT WinModem 0
-s 11c1044580862203 PRO/100+ MiniPCI (probably an Ambit U98.003.C.00 combo card) 0
-s 11c1044580862204 PRO/100+ MiniPCI on Armada E500 0
-d 11c10446 LT WinModem 0
-d 11c10447 LT WinModem 0
-d 11c10448 WinModem 56k 0
-s 11c1044810140131 Lucent Win Modem 0
-s 11c1044810338066 LT WinModem 56k Data+Fax+Voice+Dsvd 0
-s 11c1044813e00030 56k Voice Modem 0
-s 11c1044813e00040 LT WinModem 56k Data+Fax+Voice+Dsvd 0
-s 11c1044816682400 LT WinModem 56k (MiniPCI Ethernet+Modem) 0 Actiontech eth+modem card as used by Dell &c.
-d 11c10449 WinModem 56k 0
-s 11c104490e11b14d 56k V.90 Modem 0
-s 11c1044913e00020 LT WinModem 56k Data+Fax 0
-s 11c1044913e00041 TelePath Internet 56k WinModem 0
-s 11c1044914360440 Lucent Win Modem 0
-s 11c10449144f0449 Lucent 56k V.90 DFi Modem 0
-s 11c1044914680410 IBM ThinkPad T23 (2647-4MG) 0
-s 11c1044914680440 Lucent Win Modem 0
-s 11c1044914680449 Presario 56k V.90 DFi Modem 0
-d 11c1044a F-1156IV WinModem (V90, 56KFlex) 0
-s 11c1044a10cf1072 LB Global LT Modem 0
-s 11c1044a13e00012 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd 0
-s 11c1044a13e00042 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd 0
-s 11c1044a144f1005 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd 0
-d 11c1044b LT WinModem 0
-d 11c1044c LT WinModem 0
-d 11c1044d LT WinModem 0
-d 11c1044e LT WinModem 0
-d 11c1044f V90 WildWire Modem 0
-d 11c10450 LT WinModem 0
-s 11c10450103380a8 Versa Note Vxi 0
-s 11c10450144f4005 Magnia SG20 0
-d 11c10451 LT WinModem 0
-d 11c10452 LT WinModem 0
-d 11c10453 LT WinModem 0
-d 11c10454 LT WinModem 0
-d 11c10455 LT WinModem 0
-d 11c10456 LT WinModem 0
-d 11c10457 LT WinModem 0
-d 11c10458 LT WinModem 0
-d 11c10459 LT WinModem 0
-d 11c1045a LT WinModem 0
-d 11c1045c LT WinModem 0
-d 11c10461 V90 WildWire Modem 0
-d 11c10462 V90 WildWire Modem 0
-d 11c10480 Venus Modem (V90, 56KFlex) 0
-d 11c1048c V.92 56K WinModem 0
-d 11c1048f V.92 56k WinModem 0 InPorte Home Internal 56k Modem/fax/answering machine/SMS Features
-d 11c15801 USB 0
-d 11c15802 USS-312 USB Controller 0
-d 11c15803 USS-344S USB Controller 0 4 port PCI USB Controller made by Agere (formely Lucent)
-d 11c15811 FW323 0
-s 11c158118086524c D865PERL mainboard 0
-s 11c15811dead0800 FireWire Host Bus Adapter 0
-d 11c1ab10 WL60010 Wireless LAN MAC 0
-d 11c1ab11 WL60040 Multimode Wireles LAN MAC 0
-s 11c1ab1111c1ab12 WaveLAN 11abg Cardbus card (Model 1102) 0
-s 11c1ab1111c1ab13 WaveLAN 11abg MiniPCI card (Model 0512) 0
-s 11c1ab1111c1ab15 WaveLAN 11abg Cardbus card (Model 1106) 0
-s 11c1ab1111c1ab16 WaveLAN 11abg MiniPCI card (Model 0516) 0
-d 11c1ab20 ORiNOCO PCI Adapter 0
-d 11c1ab21 Agere Wireless PCI Adapter 0
-d 11c1ab30 Hermes2 Mini-PCI WaveLAN a/b/g 0
-s 11c1ab3014cd2012 Hermes2 Mini-PCI WaveLAN a/b/g 0
-v 11c2 Sand Microelectronics 0
-v 11c3 NEC Corporation 0
-v 11c4 Document Technologies, Inc 0
-v 11c5 Shiva Corporation 0
-v 11c6 Dainippon Screen Mfg. Co. Ltd 0
-v 11c7 D.C.M. Data Systems 0
-v 11c8 Dolphin Interconnect Solutions AS 0
-d 11c80658 PSB32 SCI-Adapter D31x 0
-d 11c8d665 PSB64 SCI-Adapter D32x 0
-d 11c8d667 PSB66 SCI-Adapter D33x 0
-v 11c9 Magma 0
-d 11c90010 16-line serial port w/- DMA 0
-d 11c90011 4-line serial port w/- DMA 0
-v 11ca LSI Systems, Inc 0
-v 11cb Specialix Research Ltd. 0
-d 11cb2000 PCI_9050 0
-s 11cb200011cb0200 SX 0
-s 11cb200011cbb008 I/O8+ 0
-d 11cb4000 SUPI_1 0
-d 11cb8000 T225 0
-v 11cc Michels & Kleberhoff Computer GmbH 0
-v 11cd HAL Computer Systems, Inc. 0
-v 11ce Netaccess 0
-v 11cf Pioneer Electronic Corporation 0
-v 11d0 Lockheed Martin Federal Systems-Manassas 0
-v 11d1 Auravision 0
-d 11d101f7 VxP524 0
-v 11d2 Intercom Inc. 0
-v 11d3 Trancell Systems Inc 0
-v 11d4 Analog Devices 0
-d 11d41535 Blackfin BF535 processor 0
-d 11d41805 SM56 PCI modem 0
-d 11d41889 AD1889 sound chip 0
-v 11d5 Ikon Corporation 0
-d 11d50115 10115 0
-d 11d50117 10117 0
-v 11d6 Tekelec Telecom 0
-v 11d7 Trenton Technology, Inc. 0
-v 11d8 Image Technologies Development 0
-v 11d9 TEC Corporation 0
-v 11da Novell 0
-v 11db Sega Enterprises Ltd 0
-v 11dc Questra Corporation 0
-v 11dd Crosfield Electronics Limited 0
-v 11de Zoran Corporation 0
-d 11de6057 ZR36057PQC Video cutting chipset 0
-s 11de605710317efe DC10 Plus 0
-s 11de60571031fc00 MiroVIDEO DC50, Motion JPEG Capture/CODEC Board 0
-s 11de605713ca4231 JPEG/TV Card 0
-d 11de6120 ZR36120 0
-s 11de61201328f001 Cinemaster C DVD Decoder 0
-v 11df New Wave PDG 0
-v 11e0 Cray Communications A/S 0
-v 11e1 GEC Plessey Semi Inc. 0
-v 11e2 Samsung Information Systems America 0
-v 11e3 Quicklogic Corporation 0
-d 11e35030 PC Watchdog 0
-v 11e4 Second Wave Inc 0
-v 11e5 IIX Consulting 0
-v 11e6 Mitsui-Zosen System Research 0
-v 11e7 Toshiba America, Elec. Company 0
-v 11e8 Digital Processing Systems Inc. 0
-v 11e9 Highwater Designs Ltd. 0
-v 11ea Elsag Bailey 0
-v 11eb Formation Inc. 0
-v 11ec Coreco Inc 0
-v 11ed Mediamatics 0
-v 11ee Dome Imaging Systems Inc 0
-v 11ef Nicolet Technologies B.V. 0
-v 11f0 Compu-Shack 0
-d 11f04231 FDDI 0
-d 11f04232 FASTline UTP Quattro 0
-d 11f04233 FASTline FO 0
-d 11f04234 FASTline UTP 0
-d 11f04235 FASTline-II UTP 0
-d 11f04236 FASTline-II FO 0
-d 11f04731 GIGAline 0
-v 11f1 Symbios Logic Inc 0
-v 11f2 Picture Tel Japan K.K. 0
-v 11f3 Keithley Metrabyte 0
-v 11f4 Kinetic Systems Corporation 0
-d 11f42915 CAMAC controller 0
-v 11f5 Computing Devices International 0
-v 11f6 Compex 0
-d 11f60112 ENet100VG4 0
-d 11f60113 FreedomLine 100 0
-d 11f61401 ReadyLink 2000 0
-d 11f62011 RL100-ATX 10/100 0
-s 11f6201111f62011 RL100-ATX 0
-d 11f62201 ReadyLink 100TX (Winbond W89C840) 0
-s 11f6220111f62011 ReadyLink 100TX 0
-d 11f69881 RL100TX Fast Ethernet 0
-v 11f7 Scientific Atlanta 0
-v 11f8 PMC-Sierra Inc. 0
-d 11f87375 PM7375 [LASAR-155 ATM SAR] 0
-v 11f9 I-Cube Inc 0
-v 11fa Kasan Electronics Company, Ltd. 0
-v 11fb Datel Inc 0
-v 11fc Silicon Magic 0
-v 11fd High Street Consultants 0
-v 11fe Comtrol Corporation 0
-d 11fe0001 RocketPort 32 port w/external I/F 0
-d 11fe0002 RocketPort 8 port w/external I/F 0
-d 11fe0003 RocketPort 16 port w/external I/F 0
-d 11fe0004 RocketPort 4 port w/quad cable 0
-d 11fe0005 RocketPort 8 port w/octa cable 0
-d 11fe0006 RocketPort 8 port w/RJ11 connectors 0
-d 11fe0007 RocketPort 4 port w/RJ11 connectors 0
-d 11fe0008 RocketPort 8 port w/ DB78 SNI (Siemens) connector 0
-d 11fe0009 RocketPort 16 port w/ DB78 SNI (Siemens) connector 0
-d 11fe000a RocketPort Plus 4 port 0
-d 11fe000b RocketPort Plus 8 port 0
-d 11fe000c RocketModem 6 port 0
-d 11fe000d RocketModem 4-port 0
-d 11fe000e RocketPort Plus 2 port RS232 0
-d 11fe000f RocketPort Plus 2 port RS422 0
-d 11fe0801 RocketPort UPCI 32 port w/external I/F 0
-d 11fe0802 RocketPort UPCI 8 port w/external I/F 0
-d 11fe0803 RocketPort UPCI 16 port w/external I/F 0
-d 11fe0805 RocketPort UPCI 8 port w/octa cable 0
-d 11fe080c RocketModem III 8 port 0
-d 11fe080d RocketModem III 4 port 0
-d 11fe0903 RocketPort Compact PCI 16 port w/external I/F 0
-d 11fe8015 RocketPort 4-port UART 16954 0
-v 11ff Scion Corporation 0
-d 11ff0003 AG-5 0
-v 1200 CSS Corporation 0
-v 1201 Vista Controls Corp 0
-v 1202 Network General Corp. 0
-d 12024300 Gigabit Ethernet Adapter 0
-s 1202430012029841 SK-9841 LX 0
-s 1202430012029842 SK-9841 LX dual link 0
-s 1202430012029843 SK-9843 SX 0
-s 1202430012029844 SK-9843 SX dual link 0
-v 1203 Bayer Corporation, Agfa Division 0
-v 1204 Lattice Semiconductor Corporation 0
-v 1205 Array Corporation 0
-v 1206 Amdahl Corporation 0
-v 1208 Parsytec GmbH 0
-d 12084853 HS-Link Device 0
-v 1209 SCI Systems Inc 0
-v 120a Synaptel 0
-v 120b Adaptive Solutions 0
-v 120c Technical Corp. 0
-v 120d Compression Labs, Inc. 0
-v 120e Cyclades Corporation 0
-d 120e0100 Cyclom-Y below first megabyte 0
-d 120e0101 Cyclom-Y above first megabyte 0
-d 120e0102 Cyclom-4Y below first megabyte 0
-d 120e0103 Cyclom-4Y above first megabyte 0
-d 120e0104 Cyclom-8Y below first megabyte 0
-d 120e0105 Cyclom-8Y above first megabyte 0
-d 120e0200 Cyclades-Z below first megabyte 0
-d 120e0201 Cyclades-Z above first megabyte 0
-d 120e0300 PC300/RSV or /X21 (2 ports) 0
-d 120e0301 PC300/RSV or /X21 (1 port) 0
-d 120e0310 PC300/TE (2 ports) 0
-d 120e0311 PC300/TE (1 port) 0
-d 120e0320 PC300/TE-M (2 ports) 0
-d 120e0321 PC300/TE-M (1 port) 0
-d 120e0400 PC400 0
-v 120f Essential Communications 0
-d 120f0001 Roadrunner serial HIPPI 0
-v 1210 Hyperparallel Technologies 0
-v 1211 Braintech Inc 0
-v 1212 Kingston Technology Corp. 0
-v 1213 Applied Intelligent Systems, Inc. 0
-v 1214 Performance Technologies, Inc. 0
-v 1215 Interware Co., Ltd 0
-v 1216 Purup Prepress A/S 0
-v 1217 O2 Micro, Inc. 0
-d 12176729 OZ6729 0
-d 1217673a OZ6730 0
-d 12176832 OZ6832/6833 Cardbus Controller 0
-d 12176836 OZ6836/6860 Cardbus Controller 0
-d 12176872 OZ6812 Cardbus Controller 0
-d 12176925 OZ6922 Cardbus Controller 0
-d 12176933 OZ6933 Cardbus Controller 0
-s 1217693310251016 Travelmate 612 TX 0
-d 12176972 OZ6912 Cardbus Controller 0
-s 121769721014020c ThinkPad R30 0
-s 1217697211790001 Magnia Z310 0
-d 12177110 OZ711Mx MultiMediaBay Accelerator 0
-s 12177110103c0890 NC6000 laptop 0
-d 12177112 OZ711EC1/M1 SmartCardBus MultiMediaBay Controller 0
-d 12177113 OZ711EC1 SmartCardBus Controller 0
-d 12177114 OZ711M1 SmartCardBus MultiMediaBay Controller 0
-d 121771e2 OZ711E2 SmartCardBus Controller 0
-d 12177212 OZ711M2 SmartCardBus MultiMediaBay Controller 0
-d 12177213 OZ6933E CardBus Controller 0
-d 12177223 OZ711M3 SmartCardBus MultiMediaBay Controller 0
-s 12177223103c0890 NC6000 laptop 0
-v 1218 Hybricon Corp. 0
-v 1219 First Virtual Corporation 0
-v 121a 3Dfx Interactive, Inc. 0
-d 121a0001 Voodoo 0
-d 121a0002 Voodoo 2 0
-d 121a0003 Voodoo Banshee 0
-s 121a000310920003 Monster Fusion 0
-s 121a000310924000 Monster Fusion 0
-s 121a000310924002 Monster Fusion 0
-s 121a000310924801 Monster Fusion AGP 0
-s 121a000310924803 Monster Fusion AGP 0
-s 121a000310928030 Monster Fusion 0
-s 121a000310928035 Monster Fusion AGP 0
-s 121a000310b00001 Dragon 4000 0
-s 121a000311021018 3D Blaster Banshee VE 0
-s 121a0003121a0001 Voodoo Banshee AGP 0
-s 121a0003121a0003 Voodoo Banshee AGP SGRAM 0
-s 121a0003121a0004 Voodoo Banshee 0
-s 121a0003139c0016 Raven 0
-s 121a0003139c0017 Raven 0
-s 121a000314af0002 Maxi Gamer Phoenix 0
-d 121a0004 Voodoo Banshee [Velocity 100] 0
-d 121a0005 Voodoo 3 0
-s 121a0005121a0004 Voodoo3 AGP 0
-s 121a0005121a0030 Voodoo3 AGP 0
-s 121a0005121a0031 Voodoo3 AGP 0
-s 121a0005121a0034 Voodoo3 AGP 0
-s 121a0005121a0036 Voodoo3 2000 PCI 0
-s 121a0005121a0037 Voodoo3 AGP 0
-s 121a0005121a0038 Voodoo3 AGP 0
-s 121a0005121a003a Voodoo3 AGP 0
-s 121a0005121a0044 Voodoo3 0
-s 121a0005121a004b Velocity 100 0
-s 121a0005121a004c Velocity 200 0
-s 121a0005121a004d Voodoo3 AGP 0
-s 121a0005121a004e Voodoo3 AGP 0
-s 121a0005121a0051 Voodoo3 AGP 0
-s 121a0005121a0052 Voodoo3 AGP 0
-s 121a0005121a0060 Voodoo3 3500 TV (NTSC) 0
-s 121a0005121a0061 Voodoo3 3500 TV (PAL) 0
-s 121a0005121a0062 Voodoo3 3500 TV (SECAM) 0
-d 121a0009 Voodoo 4 / Voodoo 5 0
-s 121a0009121a0003 Voodoo5 PCI 5500 0
-s 121a0009121a0009 Voodoo5 AGP 5500/6000 0
-d 121a0057 Voodoo 3/3000 [Avenger] 0
-v 121b Advanced Telecommunications Modules 0
-v 121c Nippon Texaco., Ltd 0
-v 121d Lippert Automationstechnik GmbH 0
-v 121e CSPI 0
-v 121f Arcus Technology, Inc. 0
-v 1220 Ariel Corporation 0
-d 12201220 AMCC 5933 TMS320C80 DSP/Imaging board 0
-v 1221 Contec Co., Ltd 0
-v 1222 Ancor Communications, Inc. 0
-v 1223 Artesyn Communication Products 0
-d 12230003 PM/Link 0
-d 12230004 PM/T1 0
-d 12230005 PM/E1 0
-d 12230008 PM/SLS 0
-d 12230009 BajaSpan Resource Target 0
-d 1223000a BajaSpan Section 0 0
-d 1223000b BajaSpan Section 1 0
-d 1223000c BajaSpan Section 2 0
-d 1223000d BajaSpan Section 3 0
-d 1223000e PM/PPC 0
-v 1224 Interactive Images 0
-v 1225 Power I/O, Inc. 0
-v 1227 Tech-Source 0
-d 12270006 Raptor GFX 8P 0
-v 1228 Norsk Elektro Optikk A/S 0
-v 1229 Data Kinesis Inc. 0
-v 122a Integrated Telecom 0
-v 122b LG Industrial Systems Co., Ltd 0
-v 122c Sican GmbH 0
-v 122d Aztech System Ltd 0
-d 122d1206 368DSP 0
-d 122d1400 Trident PCI288-Q3DII (NX) 0
-d 122d50dc 3328 Audio 0
-s 122d50dc122d0001 3328 Audio 0
-d 122d80da 3328 Audio 0
-s 122d80da122d0001 3328 Audio 0
-v 122e Xyratex 0
-v 122f Andrew Corporation 0
-v 1230 Fishcamp Engineering 0
-v 1231 Woodward McCoach, Inc. 0
-v 1232 GPT Limited 0
-v 1233 Bus-Tech, Inc. 0
-v 1234 Technical Corp. 0
-v 1235 Risq Modular Systems, Inc. 0
-v 1236 Sigma Designs Corporation 0
-d 12360000 RealMagic64/GX 0
-d 12366401 REALmagic 64/GX (SD 6425) 0
-v 1237 Alta Technology Corporation 0
-v 1238 Adtran 0
-v 1239 3DO Company 0
-v 123a Visicom Laboratories, Inc. 0
-v 123b Seeq Technology, Inc. 0
-v 123c Century Systems, Inc. 0
-v 123d Engineering Design Team, Inc. 0
-d 123d0000 EasyConnect 8/32 0
-d 123d0002 EasyConnect 8/64 0
-d 123d0003 EasyIO 0
-v 123e Simutech, Inc. 0
-v 123f C-Cube Microsystems 0
-d 123f00e4 MPEG 0
-d 123f8120 E4? 0
-s 123f812011bd0006 DV500 E4 0
-s 123f812011bd000a DV500 E4 0
-d 123f8888 Cinemaster C 3.0 DVD Decoder 0
-s 123f888810020001 Cinemaster C 3.0 DVD Decoder 0
-s 123f888810020002 Cinemaster C 3.0 DVD Decoder 0
-s 123f888813280001 Cinemaster C 3.0 DVD Decoder 0
-v 1240 Marathon Technologies Corp. 0
-v 1241 DSC Communications 0
-v 1242 JNI Corporation 0 Formerly Jaycor Networks, Inc.
-d 12421560 JNIC-1560 PCI-X Fibre Channel Controller 0
-s 1242156012426562 FCX2-6562 Dual Channel PCI-X Fibre Channel Adapter 0
-s 124215601242656a FCX-6562 PCI-X Fibre Channel Adapter 0
-d 12424643 FCI-1063 Fibre Channel Adapter 0
-d 12426562 FCX2-6562 Dual Channel PCI-X Fibre Channel Adapter 0
-d 1242656a FCX-6562 PCI-X Fibre Channel Adapter 0
-v 1243 Delphax 0
-v 1244 AVM Audiovisuelles MKTG & Computer System GmbH 0
-d 12440700 B1 ISDN 0
-d 12440800 C4 ISDN 0
-d 12440a00 A1 ISDN [Fritz] 0
-s 12440a0012440a00 FRITZ!Card ISDN Controller 0
-d 12440e00 Fritz!PCI v2.0 ISDN 0
-d 12441100 C2 ISDN 0
-d 12441200 T1 ISDN 0
-d 12442700 Fritz!Card DSL SL 0
-d 12442900 Fritz!Card DSL v2.0 0
-v 1245 A.P.D., S.A. 0
-v 1246 Dipix Technologies, Inc. 0
-v 1247 Xylon Research, Inc. 0
-v 1248 Central Data Corporation 0
-v 1249 Samsung Electronics Co., Ltd. 0
-v 124a AEG Electrocom GmbH 0
-v 124b SBS/Greenspring Modular I/O 0
-d 124b0040 PCI-40A or cPCI-200 Quad IndustryPack carrier 0
-s 124b0040124b9080 PCI9080 Bridge 0
-v 124c Solitron Technologies, Inc. 0
-v 124d Stallion Technologies, Inc. 0
-d 124d0000 EasyConnection 8/32 0
-d 124d0002 EasyConnection 8/64 0
-d 124d0003 EasyIO 0
-d 124d0004 EasyConnection/RA 0
-v 124e Cylink 0
-v 124f Infotrend Technology, Inc. 0
-d 124f0041 IFT-2000 Series RAID Controller 0
-v 1250 Hitachi Microcomputer System Ltd 0
-v 1251 VLSI Solutions Oy 0
-v 1253 Guzik Technical Enterprises 0
-v 1254 Linear Systems Ltd. 0
-v 1255 Optibase Ltd 0
-d 12551110 MPEG Forge 0
-d 12551210 MPEG Fusion 0
-d 12552110 VideoPlex 0
-d 12552120 VideoPlex CC 0
-d 12552130 VideoQuest 0
-v 1256 Perceptive Solutions, Inc. 0
-d 12564201 PCI-2220I 0
-d 12564401 PCI-2240I 0
-d 12565201 PCI-2000 0
-v 1257 Vertex Networks, Inc. 0
-v 1258 Gilbarco, Inc. 0
-v 1259 Allied Telesyn International 0
-d 12592560 AT-2560 Fast Ethernet Adapter (i82557B) 0
-d 1259a117 RTL81xx Fast Ethernet 0
-d 1259a120 21x4x DEC-Tulip compatible 10/100 Ethernet 0
-v 125a ABB Power Systems 0
-v 125b Asix Electronics Corporation 0
-d 125b1400 ALFA GFC2204 Fast Ethernet 0
-v 125c Aurora Technologies, Inc. 0
-d 125c0101 Saturn 4520P 0
-d 125c0640 Aries 16000P 0
-v 125d ESS Technology 0
-d 125d0000 ES336H Fax Modem (Early Model) 0
-d 125d1948 Solo? 0
-d 125d1968 ES1968 Maestro 2 0
-s 125d196810280085 ES1968 Maestro-2 PCI 0
-s 125d196810338051 ES1968 Maestro-2 Audiodrive 0
-d 125d1969 ES1969 Solo-1 Audiodrive 0
-s 125d196910140166 ES1969 SOLO-1 AudioDrive on IBM Aptiva Mainboard 0
-s 125d1969125d8888 Solo-1 Audio Adapter 0
-d 125d1978 ES1978 Maestro 2E 0
-s 125d19780e11b112 Armada M700/E500 0
-s 125d19781033803c ES1978 Maestro-2E Audiodrive 0
-s 125d197810338058 ES1978 Maestro-2E Audiodrive 0
-s 125d197810924000 Monster Sound MX400 0
-s 125d197811790001 ES1978 Maestro-2E Audiodrive 0
-d 125d1988 ES1988 Allegro-1 0
-s 125d198810924100 Sonic Impact S100 0
-s 125d1988125d1988 ESS Allegro-1 Audiodrive 0
-d 125d1989 ESS Modem 0
-s 125d1989125d1989 ESS Modem 0
-d 125d1998 ES1983S Maestro-3i PCI Audio Accelerator 0
-s 125d1998102800b1 Latitude C600 0
-s 125d1998102800e6 ES1983S Maestro-3i (Dell Inspiron 8100) 0
-d 125d1999 ES1983S Maestro-3i PCI Modem Accelerator 0
-d 125d199a ES1983S Maestro-3i PCI Audio Accelerator 0
-d 125d199b ES1983S Maestro-3i PCI Modem Accelerator 0
-d 125d2808 ES336H Fax Modem (Later Model) 0
-d 125d2838 ES2838/2839 SuperLink Modem 0
-d 125d2898 ES2898 Modem 0
-s 125d2898125d0424 ES56-PI Data Fax Modem 0
-s 125d2898125d0425 ES56T-PI Data Fax Modem 0
-s 125d2898125d0426 ES56V-PI Data Fax Modem 0
-s 125d2898125d0427 VW-PI Data Fax Modem 0
-s 125d2898125d0428 ES56ST-PI Data Fax Modem 0
-s 125d2898125d0429 ES56SV-PI Data Fax Modem 0
-s 125d2898147ac001 ES56-PI Data Fax Modem 0
-s 125d289814fe0428 ES56-PI Data Fax Modem 0
-s 125d289814fe0429 ES56-PI Data Fax Modem 0
-v 125e Specialvideo Engineering SRL 0
-v 125f Concurrent Technologies, Inc. 0
-v 1260 Intersil Corporation 0
-d 12603872 Prism 2.5 Wavelan chipset 0
-s 1260387214680202 LAN-Express IEEE 802.11b Wireless LAN 0
-d 12603873 Prism 2.5 Wavelan chipset 0
-s 1260387311863501 DWL-520 Wireless PCI Adapter 0
-s 1260387311863700 DWL-520 Wireless PCI Adapter, Rev E1 0
-s 1260387313854105 MA311 802.11b wireless adapter 0
-s 1260387316680414 HWP01170-01 802.11b PCI Wireless Adapter 0
-s 1260387316a51601 AIR.mate PC-400 PCI Wireless LAN Adapter 0
-s 1260387317373874 WMP11 Wireless 802.11b PCI Adapter 0
-s 1260387380862513 Wireless 802.11b MiniPCI Adapter 0
-d 12603886 ISL3886 [Prism Javelin/Prism Xbow] 0
-s 1260388617cf0037 Z-Com XG-901 and clones Wireless Adapter 0
-d 12603890 Intersil ISL3890 [Prism GT/Prism Duette] 0
-s 1260389010b82802 SMC2802W Wireless PCI Adapter 0
-s 1260389010b82835 SMC2835W Wireless Cardbus Adapter 0
-s 1260389010b8a835 SMC2835W V2 Wireless Cardbus Adapter 0
-s 126038901113ee03 SMC2802W V2 Wireless PCI Adapter 0
-s 1260389011863202 DWL-G650 A1 Wireless Adapter 0
-s 126038901259c104 CG-WLCB54GT Wireless Adapter 0
-s 1260389013854800 WG511 Wireless Adapter 0
-s 1260389016a51605 ALLNET ALL0271 Wireless PCI Adapter 0
-s 1260389017cf0014 Z-Com XG-600 and clones Wireless Adapter 0
-s 1260389017cf0020 Z-Com XG-900 and clones Wireless Adapter 0
-d 12608130 HMP8130 NTSC/PAL Video Decoder 0
-d 12608131 HMP8131 NTSC/PAL Video Decoder 0
-v 1261 Matsushita-Kotobuki Electronics Industries, Ltd. 0
-v 1262 ES Computer Company, Ltd. 0
-v 1263 Sonic Solutions 0
-v 1264 Aval Nagasaki Corporation 0
-v 1265 Casio Computer Co., Ltd. 0
-v 1266 Microdyne Corporation 0
-d 12660001 NE10/100 Adapter (i82557B) 0
-d 12661910 NE2000Plus (RT8029) Ethernet Adapter 0
-s 1266191012661910 NE2000Plus Ethernet Adapter 0
-v 1267 S. A. Telecommunications 0
-d 12675352 PCR2101 0
-d 12675a4b Telsat Turbo 0
-v 1268 Tektronix 0
-v 1269 Thomson-CSF/TTM 0
-v 126a Lexmark International, Inc. 0
-v 126b Adax, Inc. 0
-v 126c Northern Telecom 0
-d 126c1211 10/100BaseTX [RTL81xx] 0
-d 126c126c 802.11b Wireless Ethernet Adapter 0
-v 126d Splash Technology, Inc. 0
-v 126e Sumitomo Metal Industries, Ltd. 0
-v 126f Silicon Motion, Inc. 0
-d 126f0501 SM501 VoyagerGX 0
-d 126f0710 SM710 LynxEM 0
-d 126f0712 SM712 LynxEM+ 0
-d 126f0720 SM720 Lynx3DM 0
-d 126f0730 SM731 Cougar3DR 0
-d 126f0810 SM810 LynxE 0
-d 126f0811 SM811 LynxE 0
-d 126f0820 SM820 Lynx3D 0
-d 126f0910 SM910 0
-v 1270 Olympus Optical Co., Ltd. 0
-v 1271 GW Instruments 0
-v 1272 Telematics International 0
-v 1273 Hughes Network Systems 0
-d 12730002 DirecPC 0
-v 1274 Ensoniq 0
-d 12741171 ES1373 [AudioPCI] (also Creative Labs CT5803) 0
-d 12741371 ES1371 [AudioPCI-97] 0
-s 127413710e110024 AudioPCI on Motherboard Compaq Deskpro 0
-s 127413710e11b1a7 ES1371, ES1373 AudioPCI 0
-s 12741371103380ac ES1371, ES1373 AudioPCI 0
-s 1274137110421854 Tazer 0
-s 12741371107b8054 Tabor2 0
-s 1274137112741371 Creative Sound Blaster AudioPCI64V, AudioPCI128 0
-s 1274137114626470 ES1371, ES1373 AudioPCI On Motherboard MS-6147 1.1A 0
-s 1274137114626560 ES1371, ES1373 AudioPCI On Motherboard MS-6156 1.10 0
-s 1274137114626630 ES1371, ES1373 AudioPCI On Motherboard MS-6163BX 1.0A 0
-s 1274137114626631 ES1371, ES1373 AudioPCI On Motherboard MS-6163VIA 1.0A 0
-s 1274137114626632 ES1371, ES1373 AudioPCI On Motherboard MS-6163BX 2.0A 0
-s 1274137114626633 ES1371, ES1373 AudioPCI On Motherboard MS-6163VIA 2.0A 0
-s 1274137114626820 ES1371, ES1373 AudioPCI On Motherboard MS-6182 1.00 0
-s 1274137114626822 ES1371, ES1373 AudioPCI On Motherboard MS-6182 1.00A 0
-s 1274137114626830 ES1371, ES1373 AudioPCI On Motherboard MS-6183 1.00 0
-s 1274137114626880 ES1371, ES1373 AudioPCI On Motherboard MS-6188 1.00 0
-s 1274137114626900 ES1371, ES1373 AudioPCI On Motherboard MS-6190 1.00 0
-s 1274137114626910 ES1371, ES1373 AudioPCI On Motherboard MS-6191 0
-s 1274137114626930 ES1371, ES1373 AudioPCI On Motherboard MS-6193 0
-s 1274137114626990 ES1371, ES1373 AudioPCI On Motherboard MS-6199BX 2.0A 0
-s 1274137114626991 ES1371, ES1373 AudioPCI On Motherboard MS-6199VIA 2.0A 0
-s 1274137114a42077 ES1371, ES1373 AudioPCI On Motherboard KR639 0
-s 1274137114a42105 ES1371, ES1373 AudioPCI On Motherboard MR800 0
-s 1274137114a42107 ES1371, ES1373 AudioPCI On Motherboard MR801 0
-s 1274137114a42172 ES1371, ES1373 AudioPCI On Motherboard DR739 0
-s 1274137115099902 ES1371, ES1373 AudioPCI On Motherboard KW11 0
-s 1274137115099903 ES1371, ES1373 AudioPCI On Motherboard KW31 0
-s 1274137115099904 ES1371, ES1373 AudioPCI On Motherboard KA11 0
-s 1274137115099905 ES1371, ES1373 AudioPCI On Motherboard KC13 0
-s 12741371152d8801 ES1371, ES1373 AudioPCI On Motherboard CP810E 0
-s 12741371152d8802 ES1371, ES1373 AudioPCI On Motherboard CP810 0
-s 12741371152d8803 ES1371, ES1373 AudioPCI On Motherboard P3810E 0
-s 12741371152d8804 ES1371, ES1373 AudioPCI On Motherboard P3810-S 0
-s 12741371152d8805 ES1371, ES1373 AudioPCI On Motherboard P3820-S 0
-s 12741371270f2001 ES1371, ES1373 AudioPCI On Motherboard 6CTR 0
-s 12741371270f2200 ES1371, ES1373 AudioPCI On Motherboard 6WTX 0
-s 12741371270f3000 ES1371, ES1373 AudioPCI On Motherboard 6WSV 0
-s 12741371270f3100 ES1371, ES1373 AudioPCI On Motherboard 6WIV2 0
-s 12741371270f3102 ES1371, ES1373 AudioPCI On Motherboard 6WIV 0
-s 12741371270f7060 ES1371, ES1373 AudioPCI On Motherboard 6ASA2 0
-s 1274137180864249 ES1371, ES1373 AudioPCI On Motherboard BI440ZX 0
-s 127413718086424c ES1371, ES1373 AudioPCI On Motherboard BL440ZX 0
-s 127413718086425a ES1371, ES1373 AudioPCI On Motherboard BZ440ZX 0
-s 1274137180864341 ES1371, ES1373 AudioPCI On Motherboard Cayman 0
-s 1274137180864343 ES1371, ES1373 AudioPCI On Motherboard Cape Cod 0
-s 1274137180864649 ES1371, ES1373 AudioPCI On Motherboard Fire Island 0
-s 127413718086464a ES1371, ES1373 AudioPCI On Motherboard FJ440ZX 0
-s 1274137180864d4f ES1371, ES1373 AudioPCI On Motherboard Montreal 0
-s 1274137180864f43 ES1371, ES1373 AudioPCI On Motherboard OC440LX 0
-s 1274137180865243 ES1371, ES1373 AudioPCI On Motherboard RC440BX 0
-s 1274137180865352 ES1371, ES1373 AudioPCI On Motherboard SunRiver 0
-s 1274137180865643 ES1371, ES1373 AudioPCI On Motherboard Vancouver 0
-s 1274137180865753 ES1371, ES1373 AudioPCI On Motherboard WS440BX 0
-d 12745000 ES1370 [AudioPCI] 0
-d 12745880 5880 AudioPCI 0
-s 1274588012742000 Creative Sound Blaster AudioPCI128 0
-s 1274588012742003 Creative SoundBlaster AudioPCI 128 0
-s 1274588012745880 Creative Sound Blaster AudioPCI128 0
-s 1274588012748001 Sound Blaster 16PCI 4.1ch 0
-s 127458801458a000 5880 AudioPCI On Motherboard 6OXET 0
-s 1274588014626880 5880 AudioPCI On Motherboard MS-6188 1.00 0
-s 12745880270f2001 5880 AudioPCI On Motherboard 6CTR 0
-s 12745880270f2200 5880 AudioPCI On Motherboard 6WTX 0
-s 12745880270f7040 5880 AudioPCI On Motherboard 6ATA4 0
-v 1275 Network Appliance Corporation 0
-v 1276 Switched Network Technologies, Inc. 0
-v 1277 Comstream 0
-v 1278 Transtech Parallel Systems Ltd. 0
-d 12780701 TPE3/TM3 PowerPC Node 0
-d 12780710 TPE5 PowerPC PCI board 0
-v 1279 Transmeta Corporation 0
-d 12790295 Northbridge 0
-d 12790395 LongRun Northbridge 0
-d 12790396 SDRAM controller 0
-d 12790397 BIOS scratchpad 0
-v 127a Rockwell International 0
-d 127a1002 HCF 56k Data/Fax Modem 0
-s 127a10021092094c SupraExpress 56i PRO [Diamond SUP2380] 0
-s 127a1002122d4002 HPG / MDP3858-U 0
-s 127a1002122d4005 MDP3858-E 0
-s 127a1002122d4007 MDP3858-A/-NZ 0
-s 127a1002122d4012 MDP3858-SA 0
-s 127a1002122d4017 MDP3858-W 0
-s 127a1002122d4018 MDP3858-W 0
-s 127a1002127a1002 Rockwell 56K D/F HCF Modem 0
-d 127a1003 HCF 56k Data/Fax Modem 0
-s 127a10030e11b0bc 229-DF Zephyr 0
-s 127a10030e11b114 229-DF Cheetah 0
-s 127a10031033802b 229-DF 0
-s 127a100313df1003 PCI56RX Modem 0
-s 127a100313e00117 IBM 0
-s 127a100313e00147 IBM F-1156IV+/R3 Spain V.90 Modem 0
-s 127a100313e00197 IBM 0
-s 127a100313e001c7 IBM F-1156IV+/R3 WW V.90 Modem 0
-s 127a100313e001f7 IBM 0
-s 127a100314361003 IBM 0
-s 127a100314361103 IBM 5614PM3G V.90 Modem 0
-s 127a100314361602 Compaq 229-DF Ducati 0
-d 127a1004 HCF 56k Data/Fax/Voice Modem 0
-s 127a100410481500 MicroLink 56k Modem 0
-s 127a100410cf1059 Fujitsu 229-DFRT 0
-d 127a1005 HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem 0
-s 127a100510338029 229-DFSV 0
-s 127a100510338054 Modem 0
-s 127a100510cf103c Fujitsu 0
-s 127a100510cf1055 Fujitsu 229-DFSV 0
-s 127a100510cf1056 Fujitsu 229-DFSV 0
-s 127a1005122d4003 MDP3858SP-U 0
-s 127a1005122d4006 Packard Bell MDP3858V-E 0
-s 127a1005122d4008 MDP3858SP-A/SP-NZ 0
-s 127a1005122d4009 MDP3858SP-E 0
-s 127a1005122d4010 MDP3858V-U 0
-s 127a1005122d4011 MDP3858SP-SA 0
-s 127a1005122d4013 MDP3858V-A/V-NZ 0
-s 127a1005122d4015 MDP3858SP-W 0
-s 127a1005122d4016 MDP3858V-W 0
-s 127a1005122d4019 MDP3858V-SA 0
-s 127a100513df1005 PCI56RVP Modem 0
-s 127a100513e00187 IBM 0
-s 127a100513e001a7 IBM 0
-s 127a100513e001b7 IBM DF-1156IV+/R3 Spain V.90 Modem 0
-s 127a100513e001d7 IBM DF-1156IV+/R3 WW V.90 Modem 0
-s 127a100514361005 IBM 0
-s 127a100514361105 IBM 0
-s 127a100514371105 IBM 5614PS3G V.90 Modem 0
-d 127a1022 HCF 56k Modem 0
-s 127a102214361303 M3-5614PM3G V.90 Modem 0
-d 127a1023 HCF 56k Data/Fax Modem 0
-s 127a1023122d4020 Packard Bell MDP3858-WE 0
-s 127a1023122d4023 MDP3858-UE 0
-s 127a102313e00247 IBM F-1156IV+/R6 Spain V.90 Modem 0
-s 127a102313e00297 IBM 0
-s 127a102313e002c7 IBM F-1156IV+/R6 WW V.90 Modem 0
-s 127a102314361203 IBM 0
-s 127a102314361303 IBM 0
-d 127a1024 HCF 56k Data/Fax/Voice Modem 0
-d 127a1025 HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem 0
-s 127a102510cf106a Fujitsu 235-DFSV 0
-s 127a1025122d4021 Packard Bell MDP3858V-WE 0
-s 127a1025122d4022 MDP3858SP-WE 0
-s 127a1025122d4024 MDP3858V-UE 0
-s 127a1025122d4025 MDP3858SP-UE 0
-d 127a1026 HCF 56k PCI Speakerphone Modem 0
-d 127a1032 HCF 56k Modem 0
-d 127a1033 HCF 56k Modem 0
-d 127a1034 HCF 56k Modem 0
-d 127a1035 HCF 56k PCI Speakerphone Modem 0
-d 127a1036 HCF 56k Modem 0
-d 127a1085 HCF 56k Volcano PCI Modem 0
-d 127a2005 HCF 56k Data/Fax Modem 0
-s 127a2005104d8044 229-DFSV 0
-s 127a2005104d8045 229-DFSV 0
-s 127a2005104d8055 PBE/Aztech 235W-DFSV 0
-s 127a2005104d8056 235-DFSV 0
-s 127a2005104d805a Modem 0
-s 127a2005104d805f Modem 0
-s 127a2005104d8074 Modem 0
-d 127a2013 HSF 56k Data/Fax Modem 0
-s 127a201311790001 Modem 0
-s 127a20131179ff00 Modem 0
-d 127a2014 HSF 56k Data/Fax/Voice Modem 0
-s 127a201410cf1057 Fujitsu Citicorp III 0
-s 127a2014122d4050 MSP3880-U 0
-s 127a2014122d4055 MSP3880-W 0
-d 127a2015 HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem 0
-s 127a201510cf1063 Fujitsu 0
-s 127a201510cf1064 Fujitsu 0
-s 127a201514682015 Fujitsu 0
-d 127a2016 HSF 56k Data/Fax/Voice/Spkp Modem 0
-s 127a2016122d4051 MSP3880V-W 0
-s 127a2016122d4052 MSP3880SP-W 0
-s 127a2016122d4054 MSP3880V-U 0
-s 127a2016122d4056 MSP3880SP-U 0
-s 127a2016122d4057 MSP3880SP-A 0
-d 127a4311 Riptide HSF 56k PCI Modem 0
-s 127a4311127a4311 Ring Modular? Riptide HSF RT HP Dom 0
-s 127a431113e00210 HP-GVC 0
-d 127a4320 Riptide PCI Audio Controller 0
-s 127a432012354320 Riptide PCI Audio Controller 0
-d 127a4321 Riptide HCF 56k PCI Modem 0
-s 127a432112354321 Hewlett Packard DF 0
-s 127a432112354324 Hewlett Packard DF 0
-s 127a432113e00210 Hewlett Packard DF 0
-s 127a4321144d2321 Riptide 0
-d 127a4322 Riptide PCI Game Controller 0
-s 127a432212354322 Riptide PCI Game Controller 0
-d 127a8234 RapidFire 616X ATM155 Adapter 0
-s 127a8234108d0022 RapidFire 616X ATM155 Adapter 0
-s 127a8234108d0027 RapidFire 616X ATM155 Adapter 0
-v 127b Pixera Corporation 0
-v 127c Crosspoint Solutions, Inc. 0
-v 127d Vela Research 0
-v 127e Winnov, L.P. 0
-v 127f Fujifilm 0
-v 1280 Photoscript Group Ltd. 0
-v 1281 Yokogawa Electric Corporation 0
-v 1282 Davicom Semiconductor, Inc. 0
-d 12829009 Ethernet 100/10 MBit 0
-d 12829100 21x4x DEC-Tulip compatible 10/100 Ethernet 0
-d 12829102 21x4x DEC-Tulip compatible 10/100 Ethernet 0
-d 12829132 Ethernet 100/10 MBit 0
-v 1283 Integrated Technology Express, Inc. 0
-d 1283673a IT8330G 0
-d 12838212 IT/ITE8212 Dual channel ATA RAID controller (PCI version seems to be IT8212, embedded seems to be ITE8212) 0
-s 1283821212830001 IT/ITE8212 Dual channel ATA RAID controller 0
-d 12838330 IT8330G 0
-d 12838872 IT8874F PCI Dual Serial Port Controller 0
-d 12838888 IT8888F PCI to ISA Bridge with SMB 0
-d 12838889 IT8889F PCI to ISA Bridge 0
-d 1283e886 IT8330G 0
-v 1284 Sahara Networks, Inc. 0
-v 1285 Platform Technologies, Inc. 0
-d 12850100 AGOGO sound chip (aka ESS Maestro 1) 0
-v 1286 Mazet GmbH 0
-v 1287 M-Pact, Inc. 0
-d 1287001e LS220D DVD Decoder 0
-d 1287001f LS220C DVD Decoder 0
-v 1288 Timestep Corporation 0
-v 1289 AVC Technology, Inc. 0
-v 128a Asante Technologies, Inc. 0
-v 128b Transwitch Corporation 0
-v 128c Retix Corporation 0
-v 128d G2 Networks, Inc. 0
-d 128d0021 ATM155 Adapter 0
-v 128e Hoontech Corporation/Samho Multi Tech Ltd. 0
-d 128e0008 ST128 WSS/SB 0
-d 128e0009 ST128 SAM9407 0
-d 128e000a ST128 Game Port 0
-d 128e000b ST128 MPU Port 0
-d 128e000c ST128 Ctrl Port 0
-v 128f Tateno Dennou, Inc. 0
-v 1290 Sord Computer Corporation 0
-v 1291 NCS Computer Italia 0
-v 1292 Tritech Microelectronics Inc 0
-v 1293 Media Reality Technology 0
-v 1294 Rhetorex, Inc. 0
-v 1295 Imagenation Corporation 0
-v 1296 Kofax Image Products 0
-v 1297 Holco Enterprise Co, Ltd/Shuttle Computer 0
-v 1298 Spellcaster Telecommunications Inc. 0
-v 1299 Knowledge Technology Lab. 0
-v 129a VMetro, inc. 0
-d 129a0615 PBT-615 PCI-X Bus Analyzer 0
-v 129b Image Access 0
-v 129c Jaycor 0
-v 129d Compcore Multimedia, Inc. 0
-v 129e Victor Company of Japan, Ltd. 0
-v 129f OEC Medical Systems, Inc. 0
-v 12a0 Allen-Bradley Company 0
-v 12a1 Simpact Associates, Inc. 0
-v 12a2 Newgen Systems Corporation 0
-v 12a3 Lucent Technologies 0
-d 12a38105 T8105 H100 Digital Switch 0
-v 12a4 NTT Electronics Technology Company 0
-v 12a5 Vision Dynamics Ltd. 0
-v 12a6 Scalable Networks, Inc. 0
-v 12a7 AMO GmbH 0
-v 12a8 News Datacom 0
-v 12a9 Xiotech Corporation 0
-v 12aa SDL Communications, Inc. 0
-v 12ab Yuan Yuan Enterprise Co., Ltd. 0
-d 12ab0002 AU8830 [Vortex2] Based Sound Card With A3D Support 0
-d 12ab3000 MPG-200C PCI DVD Decoder Card 0
-v 12ac Measurex Corporation 0
-v 12ad Multidata GmbH 0
-v 12ae Alteon Networks Inc. 0
-d 12ae0001 AceNIC Gigabit Ethernet 0
-s 12ae000110140104 Gigabit Ethernet-SX PCI Adapter 0
-s 12ae000112ae0001 Gigabit Ethernet-SX (Universal) 0
-s 12ae000114100104 Gigabit Ethernet-SX PCI Adapter 0
-d 12ae0002 AceNIC Gigabit Ethernet (Copper) 0
-s 12ae000210a98002 Acenic Gigabit Ethernet 0
-s 12ae000212ae0002 Gigabit Ethernet-T (3C986-T) 0
-d 12ae00fa Farallon PN9100-T Gigabit Ethernet 0
-v 12af TDK USA Corp 0
-v 12b0 Jorge Scientific Corp 0
-v 12b1 GammaLink 0
-v 12b2 General Signal Networks 0
-v 12b3 Inter-Face Co Ltd 0
-v 12b4 FutureTel Inc 0
-v 12b5 Granite Systems Inc. 0
-v 12b6 Natural Microsystems 0
-v 12b7 Cognex Modular Vision Systems Div. - Acumen Inc. 0
-v 12b8 Korg 0
-v 12b9 3Com Corp, Modem Division (formerly US Robotics) 0
-d 12b91006 WinModem 0
-s 12b9100612b9005c USR 56k Internal Voice WinModem (Model 3472) 0
-s 12b9100612b9005e USR 56k Internal WinModem (Models 662975) 0
-s 12b9100612b90062 USR 56k Internal Voice WinModem (Model 662978) 0
-s 12b9100612b90068 USR 56k Internal Voice WinModem (Model 5690) 0
-s 12b9100612b9007a USR 56k Internal Voice WinModem (Model 662974) 0
-s 12b9100612b9007f USR 56k Internal WinModem (Models 5698, 5699) 0
-s 12b9100612b90080 USR 56k Internal WinModem (Models 2975, 3528) 0
-s 12b9100612b90081 USR 56k Internal Voice WinModem (Models 2974, 3529) 0
-s 12b9100612b90091 USR 56k Internal Voice WinModem (Model 2978) 0
-d 12b91007 USR 56k Internal WinModem 0
-s 12b9100712b900a3 USR 56k Internal WinModem (Model 3595) 0
-d 12b91008 56K FaxModem Model 5610 0
-s 12b9100812b900a2 USR 56k Internal FAX Modem (Model 2977) 0
-s 12b9100812b900aa USR 56k Internal Voice Modem (Model 2976) 0
-s 12b9100812b900ab USR 56k Internal Voice Modem (Model 5609) 0
-s 12b9100812b900ac USR 56k Internal Voice Modem (Model 3298) 0
-s 12b9100812b900ad USR 56k Internal FAX Modem (Model 5610) 0
-v 12ba BittWare, Inc. 0
-v 12bb Nippon Unisoft Corporation 0
-v 12bc Array Microsystems 0
-v 12bd Computerm Corp. 0
-v 12be Anchor Chips Inc. 0
-d 12be3041 AN3041Q CO-MEM 0
-d 12be3042 AN3042Q CO-MEM Lite 0
-s 12be304212be3042 Anchor Chips Lite Evaluation Board 0
-v 12bf Fujifilm Microdevices 0
-v 12c0 Infimed 0
-v 12c1 GMM Research Corp 0
-v 12c2 Mentec Limited 0
-v 12c3 Holtek Microelectronics Inc 0
-d 12c30058 PCI NE2K Ethernet 0
-d 12c35598 PCI NE2K Ethernet 0
-v 12c4 Connect Tech Inc 0
-v 12c5 Picture Elements Incorporated 0
-d 12c5007e Imaging/Scanning Subsystem Engine 0
-d 12c5007f Imaging/Scanning Subsystem Engine 0
-d 12c50081 PCIVST [Grayscale Thresholding Engine] 0
-d 12c50085 Video Simulator/Sender 0
-d 12c50086 THR2 Multi-scale Thresholder 0
-v 12c6 Mitani Corporation 0
-v 12c7 Dialogic Corp 0
-v 12c8 G Force Co, Ltd 0
-v 12c9 Gigi Operations 0
-v 12ca Integrated Computing Engines 0
-v 12cb Antex Electronics Corporation 0
-v 12cc Pluto Technologies International 0
-v 12cd Aims Lab 0
-v 12ce Netspeed Inc. 0
-v 12cf Prophet Systems, Inc. 0
-v 12d0 GDE Systems, Inc. 0
-v 12d1 PSITech 0
-v 12d2 NVidia / SGS Thomson (Joint Venture) 0
-d 12d20008 NV1 0
-d 12d20009 DAC64 0
-d 12d20018 Riva128 0
-s 12d2001810480c10 VICTORY Erazor 0
-s 12d20018107b8030 STB Velocity 128 0
-s 12d2001810920350 Viper V330 0
-s 12d2001810921092 Viper V330 0
-s 12d2001810b41b1b STB Velocity 128 0
-s 12d2001810b41b1d STB Velocity 128 0
-s 12d2001810b41b1e STB Velocity 128, PAL TV-Out 0
-s 12d2001810b41b20 STB Velocity 128 Sapphire 0
-s 12d2001810b41b21 STB Velocity 128 0
-s 12d2001810b41b22 STB Velocity 128 AGP, NTSC TV-Out 0
-s 12d2001810b41b23 STB Velocity 128 AGP, PAL TV-Out 0
-s 12d2001810b41b27 STB Velocity 128 DVD 0
-s 12d2001810b41b88 MVP Pro 128 0
-s 12d2001810b4222a STB Velocity 128 AGP 0
-s 12d2001810b42230 STB Velocity 128 0
-s 12d2001810b42232 STB Velocity 128 0
-s 12d2001810b42235 STB Velocity 128 AGP 0
-s 12d200182a1554a3 3DVision-SAGP / 3DexPlorer 3000 0
-d 12d20019 Riva128ZX 0
-d 12d20020 TNT 0
-d 12d20028 TNT2 0
-d 12d20029 UTNT2 0
-d 12d2002c VTNT2 0
-d 12d200a0 ITNT2 0
-v 12d3 Vingmed Sound A/S 0
-v 12d4 Ulticom (Formerly DGM&S) 0
-d 12d40200 T1 Card 0
-v 12d5 Equator Technologies Inc 0
-v 12d6 Analogic Corp 0
-v 12d7 Biotronic SRL 0
-v 12d8 Pericom Semiconductor 0
-v 12d9 Aculab PLC 0
-d 12d90002 PCI Prosody 0
-d 12d90004 cPCI Prosody 0
-d 12d90005 Aculab E1/T1 PCI card 0
-v 12da True Time Inc. 0
-v 12db Annapolis Micro Systems, Inc 0
-v 12dc Symicron Computer Communication Ltd. 0
-v 12dd Management Graphics 0
-v 12de Rainbow Technologies 0
-d 12de0200 CryptoSwift CS200 0
-v 12df SBS Technologies Inc 0
-v 12e0 Chase Research 0
-d 12e00010 ST16C654 Quad UART 0
-d 12e00020 ST16C654 Quad UART 0
-d 12e00030 ST16C654 Quad UART 0
-v 12e1 Nintendo Co, Ltd 0
-v 12e2 Datum Inc. Bancomm-Timing Division 0
-v 12e3 Imation Corp - Medical Imaging Systems 0
-v 12e4 Brooktrout Technology Inc 0
-v 12e5 Apex Semiconductor Inc 0
-v 12e6 Cirel Systems 0
-v 12e7 Sunsgroup Corporation 0
-v 12e8 Crisc Corp 0
-v 12e9 GE Spacenet 0
-v 12ea Zuken 0
-v 12eb Aureal Semiconductor 0
-d 12eb0001 Vortex 1 0
-s 12eb0001104d8036 AU8820 Vortex Digital Audio Processor 0
-s 12eb000110922000 Sonic Impact A3D 0
-s 12eb000110922100 Sonic Impact A3D 0
-s 12eb000110922110 Sonic Impact A3D 0
-s 12eb000110922200 Sonic Impact A3D 0
-s 12eb0001122d1002 AU8820 Vortex Digital Audio Processor 0
-s 12eb000112eb0001 AU8820 Vortex Digital Audio Processor 0
-s 12eb000150533355 Montego 0
-d 12eb0002 Vortex 2 0
-s 12eb0002104d8049 AU8830 Vortex 3D Digital Audio Processor 0
-s 12eb0002104d807b AU8830 Vortex 3D Digital Audio Processor 0
-s 12eb000210923000 Monster Sound II 0
-s 12eb000210923001 Monster Sound II 0
-s 12eb000210923002 Monster Sound II 0
-s 12eb000210923003 Monster Sound II 0
-s 12eb000210923004 Monster Sound II 0
-s 12eb000212eb0001 AU8830 Vortex 3D Digital Audio Processor 0
-s 12eb000212eb0002 AU8830 Vortex 3D Digital Audio Processor 0
-s 12eb000212eb0088 AU8830 Vortex 3D Digital Audio Processor 0
-s 12eb0002144d3510 AU8830 Vortex 3D Digital Audio Processor 0
-s 12eb000250533356 Montego II 0
-d 12eb0003 AU8810 Vortex Digital Audio Processor 0
-s 12eb0003104d8049 AU8810 Vortex Digital Audio Processor 0
-s 12eb0003104d8077 AU8810 Vortex Digital Audio Processor 0
-s 12eb0003109f1000 AU8810 Vortex Digital Audio Processor 0
-s 12eb000312eb0003 AU8810 Vortex Digital Audio Processor 0
-s 12eb000314626780 AU8810 Vortex Digital Audio Processor 0
-s 12eb000314a42073 AU8810 Vortex Digital Audio Processor 0
-s 12eb000314a42091 AU8810 Vortex Digital Audio Processor 0
-s 12eb000314a42104 AU8810 Vortex Digital Audio Processor 0
-s 12eb000314a42106 AU8810 Vortex Digital Audio Processor 0
-d 12eb8803 Vortex 56k Software Modem 0
-s 12eb880312eb8803 Vortex 56k Software Modem 0
-v 12ec 3A International, Inc. 0
-v 12ed Optivision Inc. 0
-v 12ee Orange Micro 0
-v 12ef Vienna Systems 0
-v 12f0 Pentek 0
-v 12f1 Sorenson Vision Inc 0
-v 12f2 Gammagraphx, Inc. 0
-v 12f3 Radstone Technology 0
-v 12f4 Megatel 0
-v 12f5 Forks 0
-v 12f6 Dawson France 0
-v 12f7 Cognex 0
-v 12f8 Electronic Design GmbH 0
-d 12f80002 VideoMaker 0
-v 12f9 Four Fold Ltd 0
-v 12fb Spectrum Signal Processing 0
-v 12fc Capital Equipment Corp 0
-v 12fd I2S 0
-v 12fe ESD Electronic System Design GmbH 0
-v 12ff Lexicon 0
-v 1300 Harman International Industries Inc 0
-v 1302 Computer Sciences Corp 0
-v 1303 Innovative Integration 0
-v 1304 Juniper Networks 0
-v 1305 Netphone, Inc 0
-v 1306 Duet Technologies 0
-v 1307 Measurement Computing 0 Formerly ComputerBoards
-d 13070001 PCI-DAS1602/16 0
-d 1307000b PCI-DIO48H 0
-d 1307000c PCI-PDISO8 0
-d 1307000d PCI-PDISO16 0
-d 1307000f PCI-DAS1200 0
-d 13070010 PCI-DAS1602/12 0
-d 13070014 PCI-DIO24H 0
-d 13070015 PCI-DIO24H/CTR3 0
-d 13070016 PCI-DIO48H/CTR15 0
-d 13070017 PCI-DIO96H 0
-d 13070018 PCI-CTR05 0
-d 13070019 PCI-DAS1200/JR 0
-d 1307001a PCI-DAS1001 0
-d 1307001b PCI-DAS1002 0
-d 1307001c PCI-DAS1602JR/16 0
-d 1307001d PCI-DAS6402/16 0
-d 1307001e PCI-DAS6402/12 0
-d 1307001f PCI-DAS16/M1 0
-d 13070020 PCI-DDA02/12 0
-d 13070021 PCI-DDA04/12 0
-d 13070022 PCI-DDA08/12 0
-d 13070023 PCI-DDA02/16 0
-d 13070024 PCI-DDA04/16 0
-d 13070025 PCI-DDA08/16 0
-d 13070026 PCI-DAC04/12-HS 0
-d 13070027 PCI-DAC04/16-HS 0
-d 13070028 PCI-DIO24 0
-d 13070029 PCI-DAS08 0
-d 1307002c PCI-INT32 0
-d 13070033 PCI-DUAL-AC5 0
-d 13070034 PCI-DAS-TC 0
-d 13070035 PCI-DAS64/M1/16 0
-d 13070036 PCI-DAS64/M2/16 0
-d 13070037 PCI-DAS64/M3/16 0
-d 1307004c PCI-DAS1000 0
-d 1307004d PCI-QUAD04 0
-d 13070052 PCI-DAS4020/12 0
-d 1307005e PCI-DAS6025 0
-v 1308 Jato Technologies Inc. 0
-d 13080001 NetCelerator Adapter 0
-s 1308000113080001 NetCelerator Adapter 0
-v 1309 AB Semiconductor Ltd 0
-v 130a Mitsubishi Electric Microcomputer 0
-v 130b Colorgraphic Communications Corp 0
-v 130c Ambex Technologies, Inc 0
-v 130d Accelerix Inc 0
-v 130e Yamatake-Honeywell Co. Ltd 0
-v 130f Advanet Inc 0
-v 1310 Gespac 0
-v 1311 Videoserver, Inc 0
-v 1312 Acuity Imaging, Inc 0
-v 1313 Yaskawa Electric Co. 0
-v 1316 Teradyne Inc 0
-v 1317 Linksys 0
-d 13170981 21x4x DEC-Tulip compatible 10/100 Ethernet 0
-d 13170985 NC100 Network Everywhere Fast Ethernet 10/100 0
-d 13171985 21x4x DEC-Tulip compatible 10/100 Ethernet 0
-d 13172850 HSP MicroModem 56 0
-d 13178201 ADMtek ADM8211 802.11b Wireless Interface 0
-s 1317820110b82635 SMC2635W 802.11b (11Mbps) wireless lan pcmcia (cardbus) card 0
-s 1317820113178201 SMC2635W 802.11b (11mbps) wireless lan pcmcia (cardbus) card 0
-d 13178211 ADMtek ADM8211 802.11b Wireless Interface 0
-d 13179511 21x4x DEC-Tulip compatible 10/100 Ethernet 0
-v 1318 Packet Engines Inc. 0
-d 13180911 GNIC-II PCI Gigabit Ethernet [Hamachi] 0
-v 1319 Fortemedia, Inc 0
-d 13190801 Xwave QS3000A [FM801] 0
-d 13190802 Xwave QS3000A [FM801 game port] 0
-d 13191000 FM801 PCI Audio 0
-d 13191001 FM801 PCI Joystick 0
-v 131a Finisar Corp. 0
-v 131c Nippon Electro-Sensory Devices Corp 0
-v 131d Sysmic, Inc. 0
-v 131e Xinex Networks Inc 0
-v 131f Siig Inc 0
-d 131f1000 CyberSerial (1-port) 16550 0
-d 131f1001 CyberSerial (1-port) 16650 0
-d 131f1002 CyberSerial (1-port) 16850 0
-d 131f1010 Duet 1S(16550)+1P 0
-d 131f1011 Duet 1S(16650)+1P 0
-d 131f1012 Duet 1S(16850)+1P 0
-d 131f1020 CyberParallel (1-port) 0
-d 131f1021 CyberParallel (2-port) 0
-d 131f1030 CyberSerial (2-port) 16550 0
-d 131f1031 CyberSerial (2-port) 16650 0
-d 131f1032 CyberSerial (2-port) 16850 0
-d 131f1034 Trio 2S(16550)+1P 0
-d 131f1035 Trio 2S(16650)+1P 0
-d 131f1036 Trio 2S(16850)+1P 0
-d 131f1050 CyberSerial (4-port) 16550 0
-d 131f1051 CyberSerial (4-port) 16650 0
-d 131f1052 CyberSerial (4-port) 16850 0
-d 131f2000 CyberSerial (1-port) 16550 0
-d 131f2001 CyberSerial (1-port) 16650 0
-d 131f2002 CyberSerial (1-port) 16850 0
-d 131f2010 Duet 1S(16550)+1P 0
-d 131f2011 Duet 1S(16650)+1P 0
-d 131f2012 Duet 1S(16850)+1P 0
-d 131f2020 CyberParallel (1-port) 0
-d 131f2021 CyberParallel (2-port) 0
-d 131f2030 CyberSerial (2-port) 16550 0
-s 131f2030131f2030 PCI Serial Card 0
-d 131f2031 CyberSerial (2-port) 16650 0
-d 131f2032 CyberSerial (2-port) 16850 0
-d 131f2040 Trio 1S(16550)+2P 0
-d 131f2041 Trio 1S(16650)+2P 0
-d 131f2042 Trio 1S(16850)+2P 0
-d 131f2050 CyberSerial (4-port) 16550 0
-d 131f2051 CyberSerial (4-port) 16650 0
-d 131f2052 CyberSerial (4-port) 16850 0
-d 131f2060 Trio 2S(16550)+1P 0
-d 131f2061 Trio 2S(16650)+1P 0
-d 131f2062 Trio 2S(16850)+1P 0
-d 131f2081 CyberSerial (8-port) ST16654 0
-v 1320 Crypto AG 0
-v 1321 Arcobel Graphics BV 0
-v 1322 MTT Co., Ltd 0
-v 1323 Dome Inc 0
-v 1324 Sphere Communications 0
-v 1325 Salix Technologies, Inc 0
-v 1326 Seachange international 0
-v 1327 Voss scientific 0
-v 1328 quadrant international 0
-v 1329 Productivity Enhancement 0
-v 132a Microcom Inc. 0
-v 132b Broadband Technologies 0
-v 132c Micrel Inc 0
-v 132d Integrated Silicon Solution, Inc. 0
-v 1330 MMC Networks 0
-v 1331 Radisys Corp. 0
-d 13310030 ENP-2611 0
-d 13318200 82600 Host Bridge 0
-d 13318201 82600 IDE 0
-d 13318202 82600 USB 0
-d 13318210 82600 PCI Bridge 0
-v 1332 Micro Memory 0
-d 13325415 MM-5415CN PCI Memory Module with Battery Backup 0
-d 13325425 MM-5425CN PCI 64/66 Memory Module with Battery Backup 0
-v 1334 Redcreek Communications, Inc 0
-v 1335 Videomail, Inc 0
-v 1337 Third Planet Publishing 0
-v 1338 BT Electronics 0
-v 133a Vtel Corp 0
-v 133b Softcom Microsystems 0
-v 133c Holontech Corp 0
-v 133d SS Technologies 0
-v 133e Virtual Computer Corp 0
-v 133f SCM Microsystems 0
-v 1340 Atalla Corp 0
-v 1341 Kyoto Microcomputer Co 0
-v 1342 Promax Systems Inc 0
-v 1343 Phylon Communications Inc 0
-v 1344 Crucial Technology 0
-v 1345 Arescom Inc 0
-v 1347 Odetics 0
-v 1349 Sumitomo Electric Industries, Ltd. 0
-v 134a DTC Technology Corp. 0
-d 134a0001 Domex 536 0
-d 134a0002 Domex DMX3194UP SCSI Adapter 0
-v 134b ARK Research Corp. 0
-v 134c Chori Joho System Co. Ltd 0
-v 134d PCTel Inc 0
-d 134d2189 HSP56 MicroModem 0
-d 134d2486 2304WT V.92 MDC Modem 0
-d 134d7890 HSP MicroModem 56 0
-s 134d7890134d0001 PCT789 adapter 0
-d 134d7891 HSP MicroModem 56 0
-s 134d7891134d0001 HSP MicroModem 56 0
-d 134d7892 HSP MicroModem 56 0
-d 134d7893 HSP MicroModem 56 0
-d 134d7894 HSP MicroModem 56 0
-d 134d7895 HSP MicroModem 56 0
-d 134d7896 HSP MicroModem 56 0
-d 134d7897 HSP MicroModem 56 0
-v 134e CSTI 0
-v 134f Algo System Co Ltd 0
-v 1350 Systec Co. Ltd 0
-v 1351 Sonix Inc 0
-v 1353 Thales Idatys 0
-d 13530002 Proserver 0
-d 13530003 PCI-FUT 0
-d 13530004 PCI-S0 0
-d 13530005 PCI-FUT-S0 0
-v 1354 Dwave System Inc 0
-v 1355 Kratos Analytical Ltd 0
-v 1356 The Logical Co 0
-v 1359 Prisa Networks 0
-v 135a Brain Boxes 0
-v 135b Giganet Inc 0
-v 135c Quatech Inc 0
-d 135c0010 QSC-100 0
-d 135c0020 DSC-100 0
-d 135c0030 DSC-200/300 0
-d 135c0040 QSC-200/300 0
-d 135c0050 ESC-100D 0
-d 135c0060 ESC-100M 0
-d 135c00f0 MPAC-100 Syncronous Serial Card (Zilog 85230) 0
-d 135c0170 QSCLP-100 0
-d 135c0180 DSCLP-100 0
-d 135c0190 SSCLP-100 0
-d 135c01a0 QSCLP-200/300 0
-d 135c01b0 DSCLP-200/300 0
-d 135c01c0 SSCLP-200/300 0
-v 135d ABB Network Partner AB 0
-v 135e Sealevel Systems Inc 0
-d 135e5101 Route 56.PCI - Multi-Protocol Serial Interface (Zilog Z16C32) 0
-d 135e7101 Single Port RS-232/422/485/530 0
-d 135e7201 Dual Port RS-232/422/485 Interface 0
-d 135e7202 Dual Port RS-232 Interface 0
-d 135e7401 Four Port RS-232 Interface 0
-d 135e7402 Four Port RS-422/485 Interface 0
-d 135e7801 Eight Port RS-232 Interface 0
-d 135e8001 8001 Digital I/O Adapter 0
-v 135f I-Data International A-S 0
-v 1360 Meinberg Funkuhren 0
-d 13600101 PCI32 DCF77 Radio Clock 0
-d 13600102 PCI509 DCF77 Radio Clock 0
-d 13600103 PCI510 DCF77 Radio Clock 0
-d 13600201 GPS167PCI GPS Receiver 0
-d 13600202 GPS168PCI GPS Receiver 0
-d 13600203 GPS169PCI GPS Receiver 0
-d 13600301 TCR510PCI IRIG Receiver 0
-v 1361 Soliton Systems K.K. 0
-v 1362 Fujifacom Corporation 0
-v 1363 Phoenix Technology Ltd 0
-v 1364 ATM Communications Inc 0
-v 1365 Hypercope GmbH 0
-v 1366 Teijin Seiki Co. Ltd 0
-v 1367 Hitachi Zosen Corporation 0
-v 1368 Skyware Corporation 0
-v 1369 Digigram 0
-v 136a High Soft Tech 0
-v 136b Kawasaki Steel Corporation 0
-d 136bff01 KL5A72002 Motion JPEG 0
-v 136c Adtek System Science Co Ltd 0
-v 136d Gigalabs Inc 0
-v 136f Applied Magic Inc 0
-v 1370 ATL Products 0
-v 1371 CNet Technology Inc 0
-d 1371434e GigaCard Network Adapter 0
-s 1371434e1371434e N-Way PCI-Bus Giga-Card 1000/100/10Mbps(L) 0
-v 1373 Silicon Vision Inc 0
-v 1374 Silicom Ltd 0
-v 1375 Argosystems Inc 0
-v 1376 LMC 0
-v 1377 Electronic Equipment Production & Distribution GmbH 0
-v 1378 Telemann Co. Ltd 0
-v 1379 Asahi Kasei Microsystems Co Ltd 0
-v 137a Mark of the Unicorn Inc 0
-d 137a0001 PCI-324 Audiowire Interface 0
-v 137b PPT Vision 0
-v 137c Iwatsu Electric Co Ltd 0
-v 137d Dynachip Corporation 0
-v 137e Patriot Scientific Corporation 0
-v 137f Japan Satellite Systems Inc 0
-v 1380 Sanritz Automation Co Ltd 0
-v 1381 Brains Co. Ltd 0
-v 1382 Marian - Electronic & Software 0
-d 13820001 ARC88 audio recording card 0
-d 13822088 Marc-8 MIDI 8 channel audio card 0
-v 1383 Controlnet Inc 0
-v 1384 Reality Simulation Systems Inc 0
-v 1385 Netgear 0
-d 13850013 WG311T 0 Note: This lists as Atheros Communications, Inc. AR5212 802.11abg NIC because of Madwifi
-d 13854100 802.11b Wireless Adapter (MA301) 0
-d 13854105 MA311 802.11b wireless adapter 0
-d 13854400 WAG511 802.11a/b/g Dual Band Wireless PC Card 0
-d 13854600 WAG511 802.11a/b/g Dual Band Wireless PC Card 0
-d 13854601 WAG511 802.11a/b/g Dual Band Wireless PC Card 0
-d 13854610 WAG511 802.11a/b/g Dual Band Wireless PC Card 0
-d 13854a00 WAG311 802.11a/g Wireless PCI Adapter 0
-d 13854c00 WG311v2 54 Mbps Wireless PCI Adapter 0
-d 1385620a GA620 Gigabit Ethernet 0
-d 1385622a GA622 0
-d 1385630a GA630 Gigabit Ethernet 0
-d 1385f004 FA310TX 0
-v 1386 Video Domain Technologies 0
-v 1387 Systran Corp 0
-v 1388 Hitachi Information Technology Co Ltd 0
-v 1389 Applicom International 0
-d 13890001 PCI1500PFB [Intelligent fieldbus adaptor] 0
-v 138a Fusion Micromedia Corp 0
-v 138b Tokimec Inc 0
-v 138c Silicon Reality 0
-v 138d Future Techno Designs pte Ltd 0
-v 138e Basler GmbH 0
-v 138f Patapsco Designs Inc 0
-v 1390 Concept Development Inc 0
-v 1391 Development Concepts Inc 0
-v 1392 Medialight Inc 0
-v 1393 Moxa Technologies Co Ltd 0
-d 13931040 Smartio C104H/PCI 0
-d 13931141 Industrio CP-114 0
-d 13931680 Smartio C168H/PCI 0
-d 13932040 Intellio CP-204J 0
-d 13932180 Intellio C218 Turbo PCI 0
-d 13933200 Intellio C320 Turbo PCI 0
-v 1394 Level One Communications 0
-d 13940001 LXT1001 Gigabit Ethernet 0
-s 1394000113940001 NetCelerator Adapter 0
-v 1395 Ambicom Inc 0
-v 1396 Cipher Systems Inc 0
-v 1397 Cologne Chip Designs GmbH 0
-d 13972bd0 ISDN network controller [HFC-PCI] 0
-s 13972bd013972bd0 ISDN Board 0
-s 13972bd0e4bf1000 CI1-1-Harp 0
-v 1398 Clarion co. Ltd 0
-v 1399 Rios systems Co Ltd 0
-v 139a Alacritech Inc 0
-d 139a0001 Quad Port 10/100 Server Accelerator 0
-d 139a0003 Single Port 10/100 Server Accelerator 0
-d 139a0005 Single Port Gigabit Server Accelerator 0
-v 139b Mediasonic Multimedia Systems Ltd 0
-v 139c Quantum 3d Inc 0
-v 139d EPL limited 0
-v 139e Media4 0
-v 139f Aethra s.r.l. 0
-v 13a0 Crystal Group Inc 0
-v 13a1 Kawasaki Heavy Industries Ltd 0
-v 13a2 Ositech Communications Inc 0
-v 13a3 Hifn Inc. 0
-d 13a30005 7751 Security Processor 0
-d 13a30006 6500 Public Key Processor 0
-d 13a30007 7811 Security Processor 0
-d 13a30012 7951 Security Processor 0
-d 13a30014 78XX Security Processor 0
-d 13a30016 8065 Security Processor 0
-d 13a30017 8165 Security Processor 0
-d 13a30018 8154 Security Processor 0
-v 13a4 Rascom Inc 0
-v 13a5 Audio Digital Imaging Inc 0
-v 13a6 Videonics Inc 0
-v 13a7 Teles AG 0
-v 13a8 Exar Corp. 0
-d 13a80154 XR17C154 Quad UART 0
-d 13a80158 XR17C158 Octal UART 0
-v 13a9 Siemens Medical Systems, Ultrasound Group 0
-v 13aa Broadband Networks Inc 0
-v 13ab Arcom Control Systems Ltd 0
-v 13ac Motion Media Technology Ltd 0
-v 13ad Nexus Inc 0
-v 13ae ALD Technology Ltd 0
-v 13af T.Sqware 0
-v 13b0 Maxspeed Corp 0
-v 13b1 Tamura corporation 0
-v 13b2 Techno Chips Co. Ltd 0
-v 13b3 Lanart Corporation 0
-v 13b4 Wellbean Co Inc 0
-v 13b5 ARM 0
-v 13b6 Dlog GmbH 0
-v 13b7 Logic Devices Inc 0
-v 13b8 Nokia Telecommunications oy 0
-v 13b9 Elecom Co Ltd 0
-v 13ba Oxford Instruments 0
-v 13bb Sanyo Technosound Co Ltd 0
-v 13bc Bitran Corporation 0
-v 13bd Sharp corporation 0
-v 13be Miroku Jyoho Service Co. Ltd 0
-v 13bf Sharewave Inc 0
-v 13c0 Microgate Corporation 0
-d 13c00010 SyncLink Adapter v1 0
-d 13c00020 SyncLink SCC Adapter 0
-d 13c00030 SyncLink Multiport Adapter 0
-d 13c00210 SyncLink Adapter v2 0
-v 13c1 3ware Inc 0
-d 13c11000 3ware Inc 3ware 5xxx/6xxx-series PATA-RAID 0
-d 13c11001 3ware Inc 3ware 7xxx/8xxx-series PATA/SATA-RAID 0
-s 13c1100113c11001 3ware Inc 3ware 7xxx/8xxx-series PATA/SATA-RAID 0
-d 13c11002 3ware Inc 3ware 9xxx-series SATA-RAID 0
-v 13c2 Technotrend Systemtechnik GmbH 0
-v 13c3 Janz Computer AG 0
-v 13c4 Phase Metrics 0
-v 13c5 Alphi Technology Corp 0
-v 13c6 Condor Engineering Inc 0
-d 13c60520 CEI-520 A429 Card 0
-d 13c60620 CEI-620 A429 Card 0
-d 13c60820 CEI-820 A429 Card 0
-v 13c7 Blue Chip Technology Ltd 0
-v 13c8 Apptech Inc 0
-v 13c9 Eaton Corporation 0
-v 13ca Iomega Corporation 0
-v 13cb Yano Electric Co Ltd 0
-v 13cc Metheus Corporation 0
-v 13cd Compatible Systems Corporation 0
-v 13ce Cocom A/S 0
-v 13cf Studio Audio & Video Ltd 0
-v 13d0 Techsan Electronics Co Ltd 0
-d 13d02103 B2C2 FlexCopII DVB chip / Technisat SkyStar2 DVB card 0
-d 13d02200 B2C2 FlexCopIII DVB chip / Technisat SkyStar2 DVB card 0
-v 13d1 Abocom Systems Inc 0
-d 13d1ab02 ADMtek Centaur-C rev 17 [D-Link DFE-680TX] CardBus Fast Ethernet Adapter 0
-d 13d1ab03 21x4x DEC-Tulip compatible 10/100 Ethernet 0
-d 13d1ab06 RTL8139 [FE2000VX] CardBus Fast Ethernet Attached Port Adapter 0
-d 13d1ab08 21x4x DEC-Tulip compatible 10/100 Ethernet 0
-v 13d2 Shark Multimedia Inc 0
-v 13d3 IMC Networks 0
-v 13d4 Graphics Microsystems Inc 0
-v 13d5 Media 100 Inc 0
-v 13d6 K.I. Technology Co Ltd 0
-v 13d7 Toshiba Engineering Corporation 0
-v 13d8 Phobos corporation 0
-v 13d9 Apex PC Solutions Inc 0
-v 13da Intresource Systems pte Ltd 0
-v 13db Janich & Klass Computertechnik GmbH 0
-v 13dc Netboost Corporation 0
-v 13dd Multimedia Bundle Inc 0
-v 13de ABB Robotics Products AB 0
-v 13df E-Tech Inc 0
-d 13df0001 PCI56RVP Modem 0
-s 13df000113df0001 PCI56RVP Modem 0
-v 13e0 GVC Corporation 0
-v 13e1 Silicom Multimedia Systems Inc 0
-v 13e2 Dynamics Research Corporation 0
-v 13e3 Nest Inc 0
-v 13e4 Calculex Inc 0
-v 13e5 Telesoft Design Ltd 0
-v 13e6 Argosy research Inc 0
-v 13e7 NAC Incorporated 0
-v 13e8 Chip Express Corporation 0
-v 13e9 Intraserver Technology Inc 0
-v 13ea Dallas Semiconductor 0
-v 13eb Hauppauge Computer Works Inc 0
-v 13ec Zydacron Inc 0
-v 13ed Raytheion E-Systems 0
-v 13ee Hayes Microcomputer Products Inc 0
-v 13ef Coppercom Inc 0
-v 13f0 Sundance Technology Inc 0
-d 13f00201 ST201 Sundance Ethernet 0
-v 13f1 Oce' - Technologies B.V. 0
-v 13f2 Ford Microelectronics Inc 0
-v 13f3 Mcdata Corporation 0
-v 13f4 Troika Networks, Inc. 0
-d 13f41401 Zentai Fibre Channel Adapter 0
-v 13f5 Kansai Electric Co. Ltd 0
-v 13f6 C-Media Electronics Inc 0
-d 13f60011 CMI8738 0
-d 13f60100 CM8338A 0
-s 13f6010013f6ffff CMI8338/C3DX PCI Audio Device 0
-d 13f60101 CM8338B 0
-s 13f6010113f60101 CMI8338-031 PCI Audio Device 0
-d 13f60111 CM8738 0
-s 13f6011110190970 P6STP-FL motherboard 0
-s 13f6011110438035 CUSI-FX motherboard 0
-s 13f6011110438077 CMI8738 6-channel audio controller 0
-s 13f60111104380e2 CMI8738 6ch-MX 0
-s 13f6011113f60111 CMI8738/C3DX PCI Audio Device 0
-s 13f601111681a000 Gamesurround MUSE XL 0
-d 13f60211 CM8738 0
-v 13f7 Wildfire Communications 0
-v 13f8 Ad Lib Multimedia Inc 0
-v 13f9 NTT Advanced Technology Corp. 0
-v 13fa Pentland Systems Ltd 0
-v 13fb Aydin Corp 0
-v 13fc Computer Peripherals International 0
-v 13fd Micro Science Inc 0
-v 13fe Advantech Co. Ltd 0
-d 13fe1240 PCI-1240 4-channel stepper motor controller card w. Nova Electronics MCX314 0
-d 13fe1600 PCI-1612 4-port RS-232/422/485 PCI Communication Card 0
-d 13fe1752 PCI-1752 0
-d 13fe1754 PCI-1754 0
-d 13fe1756 PCI-1756 0
-v 13ff Silicon Spice Inc 0
-v 1400 Artx Inc 0
-d 14001401 9432 TX 0
-v 1401 CR-Systems A/S 0
-v 1402 Meilhaus Electronic GmbH 0
-v 1403 Ascor Inc 0
-v 1404 Fundamental Software Inc 0
-v 1405 Excalibur Systems Inc 0
-v 1406 Oce' Printing Systems GmbH 0
-v 1407 Lava Computer mfg Inc 0
-d 14070100 Lava Dual Serial 0
-d 14070101 Lava Quatro A 0
-d 14070102 Lava Quatro B 0
-d 14070120 Quattro-PCI A 0
-d 14070121 Quattro-PCI B 0
-d 14070180 Lava Octo A 0
-d 14070181 Lava Octo B 0
-d 14070200 Lava Port Plus 0
-d 14070201 Lava Quad A 0
-d 14070202 Lava Quad B 0
-d 14070220 Lava Quattro PCI Ports A/B 0
-d 14070221 Lava Quattro PCI Ports C/D 0
-d 14070500 Lava Single Serial 0
-d 14070600 Lava Port 650 0
-d 14078000 Lava Parallel 0
-d 14078001 Dual parallel port controller A 0
-d 14078002 Lava Dual Parallel port A 0
-d 14078003 Lava Dual Parallel port B 0
-d 14078800 BOCA Research IOPPAR 0
-v 1408 Aloka Co. Ltd 0
-v 1409 Timedia Technology Co Ltd 0
-d 14097168 PCI2S550 (Dual 16550 UART) 0
-v 140a DSP Research Inc 0
-v 140b Ramix Inc 0
-v 140c Elmic Systems Inc 0
-v 140d Matsushita Electric Works Ltd 0
-v 140e Goepel Electronic GmbH 0
-v 140f Salient Systems Corp 0
-v 1410 Midas lab Inc 0
-v 1411 Ikos Systems Inc 0
-v 1412 VIA Technologies Inc. 0 formerly IC Ensemble Inc.
-d 14121712 ICE1712 [Envy24] PCI Multi-Channel I/O Controller 0
-s 141217121412d638 M-Audio Delta 410 0
-d 14121724 VT1720/24 [Envy24PT/HT] PCI Multi-Channel Audio Controller 0
-v 1413 Addonics 0
-v 1414 Microsoft Corporation 0
-v 1415 Oxford Semiconductor Ltd 0
-d 14158403 VScom 011H-EP1 1 port parallel adaptor 0
-d 14159501 OX16PCI954 (Quad 16950 UART) function 0 0
-s 14159501131f2050 CyberPro (4-port) 0
-s 1415950115ed2000 MCCR Serial p0-3 of 8 0
-s 1415950115ed2001 MCCR Serial p0-3 of 16 0
-d 1415950a EXSYS EX-41092 Dual 16950 Serial adapter 0
-d 1415950b OXCB950 Cardbus 16950 UART 0
-d 14159511 OX16PCI954 (Quad 16950 UART) function 1 0
-s 1415951115ed2000 MCCR Serial p4-7 of 8 0
-s 1415951115ed2001 MCCR Serial p4-15 of 16 0
-d 14159521 OX16PCI952 (Dual 16950 UART) 0
-v 1416 Multiwave Innovation pte Ltd 0
-v 1417 Convergenet Technologies Inc 0
-v 1418 Kyushu electronics systems Inc 0
-v 1419 Excel Switching Corp 0
-v 141a Apache Micro Peripherals Inc 0
-v 141b Zoom Telephonics Inc 0
-v 141d Digitan Systems Inc 0
-v 141e Fanuc Ltd 0
-v 141f Visiontech Ltd 0
-v 1420 Psion Dacom plc 0
-d 14208002 Gold Card NetGlobal 56k+10/100Mb CardBus (Ethernet part) 0
-d 14208003 Gold Card NetGlobal 56k+10/100Mb CardBus (Modem part) 0
-v 1421 Ads Technologies Inc 0
-v 1422 Ygrec Systems Co Ltd 0
-v 1423 Custom Technology Corp. 0
-v 1424 Videoserver Connections 0
-v 1425 Chelsio Communications Inc 0
-v 1426 Storage Technology Corp. 0
-v 1427 Better On-Line Solutions 0
-v 1428 Edec Co Ltd 0
-v 1429 Unex Technology Corp. 0
-v 142a Kingmax Technology Inc 0
-v 142b Radiolan 0
-v 142c Minton Optic Industry Co Ltd 0
-v 142d Pix stream Inc 0
-v 142e Vitec Multimedia 0
-d 142e4020 VM2-2 [Video Maker 2] MPEG1/2 Encoder 0
-v 142f Radicom Research Inc 0
-v 1430 ITT Aerospace/Communications Division 0
-v 1431 Gilat Satellite Networks 0
-v 1432 Edimax Computer Co. 0
-d 14329130 RTL81xx Fast Ethernet 0
-v 1433 Eltec Elektronik GmbH 0
-v 1435 Real Time Devices US Inc. 0
-v 1436 CIS Technology Inc 0
-v 1437 Nissin Inc Co 0
-v 1438 Atmel-dream 0
-v 1439 Outsource Engineering & Mfg. Inc 0
-v 143a Stargate Solutions Inc 0
-v 143b Canon Research Center, America 0
-v 143c Amlogic Inc 0
-v 143d Tamarack Microelectronics Inc 0
-v 143e Jones Futurex Inc 0
-v 143f Lightwell Co Ltd - Zax Division 0
-v 1440 ALGOL Corp. 0
-v 1441 AGIE Ltd 0
-v 1442 Phoenix Contact GmbH & Co. 0
-v 1443 Unibrain S.A. 0
-v 1444 TRW 0
-v 1445 Logical DO Ltd 0
-v 1446 Graphin Co Ltd 0
-v 1447 AIM GmBH 0
-v 1448 Alesis Studio Electronics 0
-v 1449 TUT Systems Inc 0
-v 144a Adlink Technology 0
-d 144a7296 PCI-7296 0
-d 144a7432 PCI-7432 0
-d 144a7433 PCI-7433 0
-d 144a7434 PCI-7434 0
-d 144a7841 PCI-7841 0
-d 144a8133 PCI-8133 0
-d 144a8164 PCI-8164 0
-d 144a8554 PCI-8554 0
-d 144a9111 PCI-9111 0
-d 144a9113 PCI-9113 0
-d 144a9114 PCI-9114 0
-v 144b Loronix Information Systems Inc 0
-v 144c Catalina Research Inc 0
-v 144d Samsung Electronics Co Ltd 0
-v 144e OLITEC 0
-v 144f Askey Computer Corp. 0
-v 1450 Octave Communications Ind. 0
-v 1451 SP3D Chip Design GmBH 0
-v 1453 MYCOM Inc 0
-v 1454 Altiga Networks 0
-v 1455 Logic Plus Plus Inc 0
-v 1456 Advanced Hardware Architectures 0
-v 1457 Nuera Communications Inc 0
-v 1458 Giga-byte Technology 0
-v 1459 DOOIN Electronics 0
-v 145a Escalate Networks Inc 0
-v 145b PRAIM SRL 0
-v 145c Cryptek 0
-v 145d Gallant Computer Inc 0
-v 145e Aashima Technology B.V. 0
-v 145f Baldor Electric Company 0
-d 145f0001 NextMove PCI 0
-v 1460 DYNARC INC 0
-v 1461 Avermedia Technologies Inc 0
-v 1462 Micro-Star International Co., Ltd. 0
-d 14626825 PCI Card wireless 11g [PC54G] 0
-d 14628725 NVIDIA NV25 [GeForce4 Ti 4600] VGA Adapter 0
-d 14629000 NVIDIA NV28 [GeForce4 Ti 4800] VGA Adapter 0 MSI G4Ti4800, 128MB DDR SDRAM, TV-Out, DVI-I
-d 14629119 NVIDIA NV31 [GeForce FX 5600XT] VGA Adapter 0
-v 1463 Fast Corporation 0
-v 1464 Interactive Circuits & Systems Ltd 0
-v 1465 GN NETTEST Telecom DIV. 0
-v 1466 Designpro Inc. 0
-v 1467 DIGICOM SPA 0
-v 1468 AMBIT Microsystem Corp. 0
-v 1469 Cleveland Motion Controls 0
-v 146a IFR 0
-v 146b Parascan Technologies Ltd 0
-v 146c Ruby Tech Corp. 0
-d 146c1430 FE-1430TX Fast Ethernet PCI Adapter 0
-v 146d Tachyon, INC. 0
-v 146e Williams Electronics Games, Inc. 0
-v 146f Multi Dimensional Consulting Inc 0
-v 1470 Bay Networks 0
-v 1471 Integrated Telecom Express Inc 0
-v 1472 DAIKIN Industries, Ltd 0
-v 1473 ZAPEX Technologies Inc 0
-v 1474 Doug Carson & Associates 0
-v 1475 PICAZO Communications 0
-v 1476 MORTARA Instrument Inc 0
-v 1477 Net Insight 0
-v 1478 DIATREND Corporation 0
-v 1479 TORAY Industries Inc 0
-v 147a FORMOSA Industrial Computing 0
-v 147b ABIT Computer Corp. 0
-v 147c AWARE, Inc. 0
-v 147d Interworks Computer Products 0
-v 147e Matsushita Graphic Communication Systems, Inc. 0
-v 147f NIHON UNISYS, Ltd. 0
-v 1480 SCII Telecom 0
-v 1481 BIOPAC Systems Inc 0
-v 1482 ISYTEC - Integrierte Systemtechnik GmBH 0
-v 1483 LABWAY Corporation 0
-v 1484 Logic Corporation 0
-v 1485 ERMA - Electronic GmBH 0
-v 1486 L3 Communications Telemetry & Instrumentation 0
-v 1487 MARQUETTE Medical Systems 0
-v 1488 KONTRON Electronik GmBH 0
-v 1489 KYE Systems Corporation 0
-v 148a OPTO 0
-v 148b INNOMEDIALOGIC Inc. 0
-v 148c C.P. Technology Co. Ltd 0
-v 148d DIGICOM Systems, Inc. 0
-d 148d1003 HCF 56k Data/Fax Modem 0
-v 148e OSI Plus Corporation 0
-v 148f Plant Equipment, Inc. 0
-v 1490 Stone Microsystems PTY Ltd. 0
-v 1491 ZEAL Corporation 0
-v 1492 Time Logic Corporation 0
-v 1493 MAKER Communications 0
-v 1494 WINTOP Technology, Inc. 0
-v 1495 TOKAI Communications Industry Co. Ltd 0
-v 1496 JOYTECH Computer Co., Ltd. 0
-v 1497 SMA Regelsysteme GmBH 0
-v 1498 TEWS Datentechnik GmBH 0
-d 149830c8 TPCI200 0
-v 1499 EMTEC CO., Ltd 0
-v 149a ANDOR Technology Ltd 0
-v 149b SEIKO Instruments Inc 0
-v 149c OVISLINK Corp. 0
-v 149d NEWTEK Inc 0
-d 149d0001 Video Toaster for PC 0
-v 149e Mapletree Networks Inc. 0
-v 149f LECTRON Co Ltd 0
-v 14a0 SOFTING GmBH 0
-v 14a1 Systembase Co Ltd 0
-v 14a2 Millennium Engineering Inc 0
-v 14a3 Maverick Networks 0
-v 14a4 GVC/BCM Advanced Research 0
-v 14a5 XIONICS Document Technologies Inc 0
-v 14a6 INOVA Computers GmBH & Co KG 0
-v 14a7 MYTHOS Systems Inc 0
-v 14a8 FEATRON Technologies Corporation 0
-v 14a9 HIVERTEC Inc 0
-v 14aa Advanced MOS Technology Inc 0
-v 14ab Mentor Graphics Corp. 0
-v 14ac Novaweb Technologies Inc 0
-v 14ad Time Space Radio AB 0
-v 14ae CTI, Inc 0
-v 14af Guillemot Corporation 0
-d 14af7102 3D Prophet II MX 0
-v 14b0 BST Communication Technology Ltd 0
-v 14b1 Nextcom K.K. 0
-v 14b2 ENNOVATE Networks Inc 0
-v 14b3 XPEED Inc 0
-d 14b30000 DSL NIC 0
-v 14b4 PHILIPS Business Electronics B.V. 0
-v 14b5 Creamware GmBH 0
-d 14b50200 Scope 0
-d 14b50300 Pulsar 0
-d 14b50400 PulsarSRB 0
-d 14b50600 Pulsar2 0
-d 14b50800 DSP-Board 0
-d 14b50900 DSP-Board 0
-d 14b50a00 DSP-Board 0
-d 14b50b00 DSP-Board 0
-v 14b6 Quantum Data Corp. 0
-v 14b7 PROXIM Inc 0
-d 14b70001 Symphony 4110 0
-v 14b8 Techsoft Technology Co Ltd 0
-v 14b9 AIRONET Wireless Communications 0
-d 14b90001 PC4800 0
-d 14b90340 PC4800 0
-d 14b90350 PC4800 0
-d 14b94500 PC4500 0
-d 14b94800 Cisco Aironet 340 802.11b Wireless LAN Adapter/Aironet PC4800 0
-d 14b9a504 Cisco Aironet Wireless 802.11b 0
-d 14b9a505 Cisco Aironet CB20a 802.11a Wireless LAN Adapter 0
-d 14b9a506 Cisco Aironet Mini PCI b/g 0
-v 14ba INTERNIX Inc. 0
-v 14bb SEMTECH Corporation 0
-v 14bc Globespan Semiconductor Inc. 0
-v 14bd CARDIO Control N.V. 0
-v 14be L3 Communications 0
-v 14bf SPIDER Communications Inc. 0
-v 14c0 COMPAL Electronics Inc 0
-v 14c1 MYRICOM Inc. 0
-d 14c18043 Myrinet 2000 Scalable Cluster Interconnect 0
-v 14c2 DTK Computer 0
-v 14c3 MEDIATEK Corp. 0
-v 14c4 IWASAKI Information Systems Co Ltd 0
-v 14c5 Automation Products AB 0
-v 14c6 Data Race Inc 0
-v 14c7 Modular Technology Holdings Ltd 0
-v 14c8 Turbocomm Tech. Inc. 0
-v 14c9 ODIN Telesystems Inc 0
-v 14ca PE Logic Corp. 0
-v 14cb Billionton Systems Inc 0
-v 14cc NAKAYO Telecommunications Inc 0
-v 14cd Universal Scientific Ind. 0
-v 14ce Whistle Communications 0
-v 14cf TEK Microsystems Inc. 0
-v 14d0 Ericsson Axe R & D 0
-v 14d1 Computer Hi-Tech Co Ltd 0
-v 14d2 Titan Electronics Inc 0
-d 14d28001 VScom 010L 1 port parallel adaptor 0
-d 14d28002 VScom 020L 2 port parallel adaptor 0
-d 14d28010 VScom 100L 1 port serial adaptor 0
-d 14d28011 VScom 110L 1 port serial and 1 port parallel adaptor 0
-d 14d28020 VScom 200L 1 port serial adaptor 0
-d 14d28021 VScom 210L 2 port serial and 1 port parallel adaptor 0
-d 14d28040 VScom 400L 4 port serial adaptor 0
-d 14d28080 VScom 800L 8 port serial adaptor 0
-d 14d2a000 VScom 010H 1 port parallel adaptor 0
-d 14d2a001 VScom 100H 1 port serial adaptor 0
-d 14d2a003 VScom 400H 4 port serial adaptor 0
-d 14d2a004 VScom 400HF1 4 port serial adaptor 0
-d 14d2a005 VScom 200H 2 port serial adaptor 0
-d 14d2e001 VScom 010HV2 1 port parallel adaptor 0
-d 14d2e010 VScom 100HV2 1 port serial adaptor 0
-d 14d2e020 VScom 200HV2 2 port serial adaptor 0
-v 14d3 CIRTECH (UK) Ltd 0
-v 14d4 Panacom Technology Corp 0
-v 14d5 Nitsuko Corporation 0
-v 14d6 Accusys Inc 0
-v 14d7 Hirakawa Hewtech Corp 0
-v 14d8 HOPF Elektronik GmBH 0
-v 14d9 Alliance Semiconductor Corporation 0 Formerly SiPackets, Inc., formerly API NetWorks, Inc., formerly Alpha Processor, Inc.
-d 14d90010 AP1011/SP1011 HyperTransport-PCI Bridge [Sturgeon] 0
-d 14d99000 AS90L10204/10208 HyperTransport to PCI-X Bridge 0
-v 14da National Aerospace Laboratories 0
-v 14db AFAVLAB Technology Inc 0
-d 14db2120 TK9902 0
-v 14dc Amplicon Liveline Ltd 0
-d 14dc0000 PCI230 0
-d 14dc0001 PCI242 0
-d 14dc0002 PCI244 0
-d 14dc0003 PCI247 0
-d 14dc0004 PCI248 0
-d 14dc0005 PCI249 0
-d 14dc0006 PCI260 0
-d 14dc0007 PCI224 0
-d 14dc0008 PCI234 0
-d 14dc0009 PCI236 0
-d 14dc000a PCI272 0
-d 14dc000b PCI215 0
-v 14dd Boulder Design Labs Inc 0
-v 14de Applied Integration Corporation 0
-v 14df ASIC Communications Corp 0
-v 14e1 INVERTEX 0
-v 14e2 INFOLIBRIA 0
-v 14e3 AMTELCO 0
-v 14e4 Broadcom Corporation 0
-d 14e40800 Sentry5 Chipcommon I/O Controller 0
-d 14e40804 Sentry5 PCI Bridge 0
-d 14e40805 Sentry5 MIPS32 CPU 0
-d 14e40806 Sentry5 Ethernet Controller 0
-d 14e4080b Sentry5 Crypto Accelerator 0
-d 14e4080f Sentry5 DDR/SDR RAM Controller 0
-d 14e40811 Sentry5 External Interface Core 0
-d 14e40816 BCM3302 Sentry5 MIPS32 CPU 0
-d 14e41644 NetXtreme BCM5700 Gigabit Ethernet 0
-s 14e4164410140277 Broadcom Vigil B5700 1000Base-T 0
-s 14e41644102800d1 Broadcom BCM5700 0
-s 14e4164410280106 Broadcom BCM5700 0
-s 14e4164410280109 Broadcom BCM5700 1000Base-T 0
-s 14e416441028010a Broadcom BCM5700 1000BaseTX 0
-s 14e4164410b71000 3C996-T 1000Base-T 0
-s 14e4164410b71001 3C996B-T 1000Base-T 0
-s 14e4164410b71002 3C996C-T 1000Base-T 0
-s 14e4164410b71003 3C997-T 1000Base-T Dual Port 0
-s 14e4164410b71004 3C996-SX 1000Base-SX 0
-s 14e4164410b71005 3C997-SX 1000Base-SX Dual Port 0
-s 14e4164410b71008 3C942 Gigabit LOM (31X31) 0
-s 14e4164414e40002 NetXtreme 1000Base-SX 0
-s 14e4164414e40003 NetXtreme 1000Base-SX 0
-s 14e4164414e40004 NetXtreme 1000Base-T 0
-s 14e4164414e41028 NetXtreme 1000BaseTX 0
-s 14e4164414e41644 BCM5700 1000Base-T 0
-d 14e41645 NetXtreme BCM5701 Gigabit Ethernet 0
-s 14e416450e11007c NC7770 Gigabit Server Adapter (PCI-X, 10/100/1000-T) 0
-s 14e416450e11007d NC6770 Gigabit Server Adapter (PCI-X, 1000-SX) 0
-s 14e416450e110085 NC7780 Gigabit Server Adapter (embedded, WOL) 0
-s 14e416450e110099 NC7780 Gigabit Server Adapter (embedded, WOL) 0
-s 14e416450e11009a NC7770 Gigabit Server Adapter (PCI-X, 10/100/1000-T) 0
-s 14e416450e1100c1 NC6770 Gigabit Server Adapter (PCI-X, 1000-SX) 0
-s 14e4164510280121 Broadcom BCM5701 1000Base-T 0
-s 14e41645103c128a HP 1000Base-T (PCI) [A7061A] 0
-s 14e41645103c128b HP 1000Base-SX (PCI) [A7073A] 0
-s 14e41645103c12a4 HP Core Lan 1000Base-T 0
-s 14e41645103c12c1 HP IOX Core Lan 1000Base-T [A7109AX] 0
-s 14e4164510a98010 SGI IO9 Gigabit Ethernet (Copper) 0
-s 14e4164510a98011 SGI Gigabit Ethernet (Copper) 0
-s 14e4164510a98012 SGI Gigabit Ethernet (Fiber) 0
-s 14e4164510b71004 3C996-SX 1000Base-SX 0
-s 14e4164510b71006 3C996B-T 1000Base-T 0
-s 14e4164510b71007 3C1000-T 1000Base-T 0
-s 14e4164510b71008 3C940-BR01 1000Base-T 0
-s 14e4164514e40001 BCM5701 1000Base-T 0
-s 14e4164514e40005 BCM5701 1000Base-T 0
-s 14e4164514e40006 BCM5701 1000Base-T 0
-s 14e4164514e40007 BCM5701 1000Base-SX 0
-s 14e4164514e40008 BCM5701 1000Base-T 0
-s 14e4164514e48008 BCM5701 1000Base-T 0
-d 14e41646 NetXtreme BCM5702 Gigabit Ethernet 0
-s 14e416460e1100bb NC7760 1000BaseTX 0
-s 14e4164610280126 Broadcom BCM5702 1000BaseTX 0
-s 14e4164614e48009 BCM5702 1000BaseTX 0
-d 14e41647 NetXtreme BCM5703 Gigabit Ethernet 0
-s 14e416470e110099 NC7780 1000BaseTX 0
-s 14e416470e11009a NC7770 1000BaseTX 0
-s 14e4164710a98010 SGI IO9 Gigabit Ethernet (Copper) 0
-s 14e4164714e40009 BCM5703 1000BaseTX 0
-s 14e4164714e4000a BCM5703 1000BaseSX 0
-s 14e4164714e4000b BCM5703 1000BaseTX 0
-s 14e4164714e48009 BCM5703 1000BaseTX 0
-s 14e4164714e4800a BCM5703 1000BaseTX 0
-d 14e41648 NetXtreme BCM5704 Gigabit Ethernet 0
-s 14e416480e1100cf NC7772 Gigabit Server Adapter (PCI-X, 10,100,1000-T) 0
-s 14e416480e1100d0 NC7782 Gigabit Server Adapter (PCI-X, 10,100,1000-T) 0
-s 14e416480e1100d1 NC7783 Gigabit Server Adapter (PCI-X, 10,100,1000-T) 0
-s 14e4164810b72000 3C998-T Dual Port 10/100/1000 PCI-X 0
-s 14e4164810b73000 3C999-T Quad Port 10/100/1000 PCI-X 0
-s 14e4164811661648 NetXtreme CIOB-E 1000Base-T 0
-d 14e4164a NetXtreme II BCM5706 Gigabit Ethernet 0
-d 14e4164d NetXtreme BCM5702FE Gigabit Ethernet 0
-d 14e41653 NetXtreme BCM5705 Gigabit Ethernet 0
-s 14e416530e1100e3 NC7761 Gigabit Server Adapter 0
-d 14e41654 NetXtreme BCM5705_2 Gigabit Ethernet 0
-s 14e416540e1100e3 NC7761 Gigabit Server Adapter 0
-s 14e41654103c3100 NC1020 HP ProLiant Gigabit Server Adapter 32 PCI 0
-d 14e41659 NetXtreme BCM5721 Gigabit Ethernet PCI Express 0
-d 14e4165d NetXtreme BCM5705M Gigabit Ethernet 0
-d 14e4165e NetXtreme BCM5705M_2 Gigabit Ethernet 0
-s 14e4165e103c0890 NC6000 laptop 0
-d 14e4166e 570x 10/100 Integrated Controller 0
-d 14e41677 NetXtreme BCM5751 Gigabit Ethernet PCI Express 0
-s 14e4167710280179 Optiplex GX280 0
-d 14e4167d NetXtreme BCM5751M Gigabit Ethernet PCI Express 0
-d 14e4167e NetXtreme BCM5751F Fast Ethernet PCI Express 0
-d 14e41696 NetXtreme BCM5782 Gigabit Ethernet 0
-s 14e41696103c12bc HP d530 CMT (DG746A) 0
-s 14e4169614e4000d NetXtreme BCM5782 1000Base-T 0
-d 14e4169c NetXtreme BCM5788 Gigabit Ethernet 0
-d 14e4169d NetLink BCM5789 Gigabit Ethernet PCI Express 0
-d 14e416a6 NetXtreme BCM5702X Gigabit Ethernet 0
-s 14e416a60e1100bb NC7760 Gigabit Server Adapter (PCI-X, 10/100/1000-T) 0
-s 14e416a610280126 BCM5702 1000Base-T 0
-s 14e416a614e4000c BCM5702 1000Base-T 0
-s 14e416a614e48009 BCM5702 1000Base-T 0
-d 14e416a7 NetXtreme BCM5703X Gigabit Ethernet 0
-s 14e416a70e1100ca NC7771 Gigabit Server Adapter (PCI-X, 10,100,1000-T) 0
-s 14e416a70e1100cb NC7781 Gigabit Server Adapter (PCI-X, 10,100,1000-T) 0
-s 14e416a714e40009 NetXtreme BCM5703 1000Base-T 0
-s 14e416a714e4000a NetXtreme BCM5703 1000Base-SX 0
-s 14e416a714e4000b NetXtreme BCM5703 1000Base-T 0
-s 14e416a714e4800a NetXtreme BCM5703 1000Base-T 0
-d 14e416a8 NetXtreme BCM5704S Gigabit Ethernet 0
-s 14e416a810b72001 3C998-SX Dual Port 1000-SX PCI-X 0
-d 14e416aa NetXtreme II BCM5706S Gigabit Ethernet 0
-d 14e416c6 NetXtreme BCM5702A3 Gigabit Ethernet 0
-s 14e416c610b71100 3C1000B-T 10/100/1000 PCI 0
-s 14e416c614e4000c BCM5702 1000Base-T 0
-s 14e416c614e48009 BCM5702 1000Base-T 0
-d 14e416c7 NetXtreme BCM5703 Gigabit Ethernet 0
-s 14e416c70e1100ca NC7771 Gigabit Server Adapter (PCI-X, 10,100,1000-T) 0
-s 14e416c70e1100cb NC7781 Gigabit Server Adapter (PCI-X, 10,100,1000-T) 0
-s 14e416c7103c12c3 HP Combo FC/GigE-SX [A9782A] 0
-s 14e416c7103c12ca HP Combo FC/GigE-T [A9784A] 0
-s 14e416c714e40009 NetXtreme BCM5703 1000Base-T 0
-s 14e416c714e4000a NetXtreme BCM5703 1000Base-SX 0
-d 14e416dd NetLink BCM5781 Gigabit Ethernet PCI Express 0
-d 14e416f7 NetXtreme BCM5753 Gigabit Ethernet PCI Express 0
-d 14e416fd NetXtreme BCM5753M Gigabit Ethernet PCI Express 0
-d 14e416fe NetXtreme BCM5753F Fast Ethernet PCI Express 0
-d 14e4170c BCM4401-B0 100Base-TX 0
-d 14e4170d NetXtreme BCM5901 100Base-TX 0
-s 14e4170d10140545 ThinkPad R40e (2684-HVG) builtin ethernet controller 0
-d 14e4170e NetXtreme BCM5901 100Base-TX 0
-d 14e43352 BCM3352 0
-d 14e43360 BCM3360 0
-d 14e44210 BCM4210 iLine10 HomePNA 2.0 0
-d 14e44211 BCM4211 iLine10 HomePNA 2.0 + V.90 56k modem 0
-d 14e44212 BCM4212 v.90 56k modem 0
-d 14e44301 BCM4303 802.11b Wireless LAN Controller 0
-s 14e4430110280407 TrueMobile 1180 Onboard WLAN 0
-s 14e4430110430120 WL-103b Wireless LAN PC Card 0
-d 14e44305 BCM4307 V.90 56k Modem 0
-d 14e44306 BCM4307 Ethernet Controller 0
-d 14e44307 BCM4307 802.11b Wireless LAN Controller 0
-d 14e44310 BCM4310 Chipcommon I/OController 0
-d 14e44312 BCM4310 UART 0
-d 14e44313 BCM4310 Ethernet Controller 0
-d 14e44315 BCM4310 USB Controller 0
-d 14e44320 BCM4306 802.11b/g Wireless LAN Controller 0
-s 14e4432010280001 TrueMobile 1300 WLAN Mini-PCI Card 0
-s 14e4432010280003 Wireless 1350 WLAN Mini-PCI Card 0
-s 14e443201043100f WL-100G 0
-s 14e4432014e44320 Linksys WMP54G PCI 0
-s 14e4432017374320 WPC54G 0
-s 14e4432017997010 Belkin F5D7010 54g Wireless Network card 0
-d 14e44321 BCM4306 802.11a Wireless LAN Controller 0
-d 14e44322 BCM4306 UART 0
-d 14e44324 BCM4309 802.11a/b/g 0
-s 14e4432410280001 Truemobile 1400 0
-s 14e4432410280003 Truemobile 1450 MiniPCI 0
-d 14e44325 BCM43xG 802.11b/g 0
-s 14e4432514140003 Wireless Notebook Adapter MN-720 0
-s 14e4432514140004 Wireless PCI Adapter MN-730 0
-d 14e44326 BCM4307 Chipcommon I/O Controller? 0 probably this is a correct ID...
-d 14e44401 BCM4401 100Base-T 0
-s 14e44401104380a8 A7V8X motherboard 0
-d 14e44402 BCM4402 Integrated 10/100BaseT 0
-d 14e44403 BCM4402 V.90 56k Modem 0
-d 14e44410 BCM4413 iLine32 HomePNA 2.0 0
-d 14e44411 BCM4413 V.90 56k modem 0
-d 14e44412 BCM4412 10/100BaseT 0
-d 14e44430 BCM44xx CardBus iLine32 HomePNA 2.0 0
-d 14e44432 BCM4432 CardBus 10/100BaseT 0
-d 14e44610 BCM4610 Sentry5 PCI to SB Bridge 0
-d 14e44611 BCM4610 Sentry5 iLine32 HomePNA 1.0 0
-d 14e44612 BCM4610 Sentry5 V.90 56k Modem 0
-d 14e44613 BCM4610 Sentry5 Ethernet Controller 0
-d 14e44614 BCM4610 Sentry5 External Interface 0
-d 14e44615 BCM4610 Sentry5 USB Controller 0
-d 14e44704 BCM4704 PCI to SB Bridge 0
-d 14e44705 BCM4704 Sentry5 802.11b Wireless LAN Controller 0
-d 14e44706 BCM4704 Sentry5 Ethernet Controller 0
-d 14e44707 BCM4704 Sentry5 USB Controller 0
-d 14e44708 BCM4704 Crypto Accelerator 0
-d 14e44710 BCM4710 Sentry5 PCI to SB Bridge 0
-d 14e44711 BCM47xx Sentry5 iLine32 HomePNA 2.0 0
-d 14e44712 BCM47xx V.92 56k modem 0
-d 14e44713 Sentry5 Ethernet Controller 0
-d 14e44714 BCM47xx Sentry5 External Interface 0
-d 14e44715 Sentry5 USB Controller 0
-d 14e44716 BCM47xx Sentry5 USB Host Controller 0
-d 14e44717 BCM47xx Sentry5 USB Device Controller 0
-d 14e44718 Sentry5 Crypto Accelerator 0
-d 14e44720 BCM4712 MIPS CPU 0
-d 14e45365 BCM5365P Sentry5 Host Bridge 0
-d 14e45600 BCM5600 StrataSwitch 24+2 Ethernet Switch Controller 0
-d 14e45605 BCM5605 StrataSwitch 24+2 Ethernet Switch Controller 0
-d 14e45615 BCM5615 StrataSwitch 24+2 Ethernet Switch Controller 0
-d 14e45625 BCM5625 StrataSwitch 24+2 Ethernet Switch Controller 0
-d 14e45645 BCM5645 StrataSwitch 24+2 Ethernet Switch Controller 0
-d 14e45670 BCM5670 8-Port 10GE Ethernet Switch Fabric 0
-d 14e45680 BCM5680 G-Switch 8 Port Gigabit Ethernet Switch Controller 0
-d 14e45690 BCM5690 12-port Multi-Layer Gigabit Ethernet Switch 0
-d 14e45691 BCM5691 GE/10GE 8+2 Gigabit Ethernet Switch Controller 0
-d 14e45820 BCM5820 Crypto Accelerator 0
-d 14e45821 BCM5821 Crypto Accelerator 0
-d 14e45822 BCM5822 Crypto Accelerator 0
-d 14e45823 BCM5823 Crypto Accelerator 0
-d 14e45824 BCM5824 Crypto Accelerator 0
-d 14e45840 BCM5840 Crypto Accelerator 0
-d 14e45841 BCM5841 Crypto Accelerator 0
-d 14e45850 BCM5850 Crypto Accelerator 0
-v 14e5 Pixelfusion Ltd 0
-v 14e6 SHINING Technology Inc 0
-v 14e7 3CX 0
-v 14e8 RAYCER Inc 0
-v 14e9 GARNETS System CO Ltd 0
-v 14ea Planex Communications, Inc 0
-d 14eaab06 FNW-3603-TX CardBus Fast Ethernet 0
-d 14eaab07 RTL81xx RealTek Ethernet 0
-v 14eb SEIKO EPSON Corp 0
-v 14ec ACQIRIS 0
-v 14ed DATAKINETICS Ltd 0
-v 14ee MASPRO KENKOH Corp 0
-v 14ef CARRY Computer ENG. CO Ltd 0
-v 14f0 CANON RESEACH CENTRE FRANCE 0
-v 14f1 Conexant 0
-d 14f11002 HCF 56k Modem 0
-d 14f11003 HCF 56k Modem 0
-d 14f11004 HCF 56k Modem 0
-d 14f11005 HCF 56k Modem 0
-d 14f11006 HCF 56k Modem 0
-d 14f11022 HCF 56k Modem 0
-d 14f11023 HCF 56k Modem 0
-d 14f11024 HCF 56k Modem 0
-d 14f11025 HCF 56k Modem 0
-d 14f11026 HCF 56k Modem 0
-d 14f11032 HCF 56k Modem 0
-d 14f11033 HCF 56k Data/Fax Modem 0
-s 14f1103310338077 NEC 0
-s 14f11033122d4027 Dell Zeus - MDP3880-W(B) Data Fax Modem 0
-s 14f11033122d4030 Dell Mercury - MDP3880-U(B) Data Fax Modem 0
-s 14f11033122d4034 Dell Thor - MDP3880-W(U) Data Fax Modem 0
-s 14f1103313e0020d Dell Copper 0
-s 14f1103313e0020e Dell Silver 0
-s 14f1103313e00261 IBM 0
-s 14f1103313e00290 Compaq Goldwing 0
-s 14f1103313e002a0 IBM 0
-s 14f1103313e002b0 IBM 0
-s 14f1103313e002c0 Compaq Scooter 0
-s 14f1103313e002d0 IBM 0
-s 14f11033144f1500 IBM P85-DF (1) 0
-s 14f11033144f1501 IBM P85-DF (2) 0
-s 14f11033144f150a IBM P85-DF (3) 0
-s 14f11033144f150b IBM P85-DF Low Profile (1) 0
-s 14f11033144f1510 IBM P85-DF Low Profile (2) 0
-d 14f11034 HCF 56k Data/Fax/Voice Modem 0
-d 14f11035 HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem 0
-s 14f1103510cf1098 Fujitsu P85-DFSV 0
-d 14f11036 HCF 56k Data/Fax/Voice/Spkp Modem 0
-s 14f11036104d8067 HCF 56k Modem 0
-s 14f11036122d4029 MDP3880SP-W 0
-s 14f11036122d4031 MDP3880SP-U 0
-s 14f1103613e00209 Dell Titanium 0
-s 14f1103613e0020a Dell Graphite 0
-s 14f1103613e00260 Gateway Red Owl 0
-s 14f1103613e00270 Gateway White Horse 0
-d 14f11052 HCF 56k Data/Fax Modem (Worldwide) 0
-d 14f11053 HCF 56k Data/Fax Modem (Worldwide) 0
-d 14f11054 HCF 56k Data/Fax/Voice Modem (Worldwide) 0
-d 14f11055 HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem (Worldwide) 0
-d 14f11056 HCF 56k Data/Fax/Voice/Spkp Modem (Worldwide) 0
-d 14f11057 HCF 56k Data/Fax/Voice/Spkp Modem (Worldwide) 0
-d 14f11059 HCF 56k Data/Fax/Voice Modem (Worldwide) 0
-d 14f11063 HCF 56k Data/Fax Modem 0
-d 14f11064 HCF 56k Data/Fax/Voice Modem 0
-d 14f11065 HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem 0
-d 14f11066 HCF 56k Data/Fax/Voice/Spkp Modem 0
-s 14f11066122d4033 Dell Athena - MDP3900V-U 0
-d 14f11433 HCF 56k Data/Fax Modem 0
-d 14f11434 HCF 56k Data/Fax/Voice Modem 0
-d 14f11435 HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem 0
-d 14f11436 HCF 56k Data/Fax Modem 0
-d 14f11453 HCF 56k Data/Fax Modem 0
-s 14f1145313e00240 IBM 0
-s 14f1145313e00250 IBM 0
-s 14f11453144f1502 IBM P95-DF (1) 0
-s 14f11453144f1503 IBM P95-DF (2) 0
-d 14f11454 HCF 56k Data/Fax/Voice Modem 0
-d 14f11455 HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem 0
-d 14f11456 HCF 56k Data/Fax/Voice/Spkp Modem 0
-s 14f11456122d4035 Dell Europa - MDP3900V-W 0
-s 14f11456122d4302 Dell MP3930V-W(C) MiniPCI 0
-d 14f11610 ADSL AccessRunner PCI Arbitration Device 0
-d 14f11611 AccessRunner PCI ADSL Interface Device 0
-d 14f11620 ADSL AccessRunner V2 PCI Arbitration Device 0
-d 14f11621 AccessRunner V2 PCI ADSL Interface Device 0
-d 14f11622 AccessRunner V2 PCI ADSL Yukon WAN Adapter 0
-d 14f11803 HCF 56k Modem 0
-s 14f118030e110023 623-LAN Grizzly 0
-s 14f118030e110043 623-LAN Yogi 0
-d 14f11815 HCF 56k Modem 0
-s 14f118150e110022 Grizzly 0
-s 14f118150e110042 Yogi 0
-d 14f12003 HSF 56k Data/Fax Modem 0
-d 14f12004 HSF 56k Data/Fax/Voice Modem 0
-d 14f12005 HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem 0
-d 14f12006 HSF 56k Data/Fax/Voice/Spkp Modem 0
-d 14f12013 HSF 56k Data/Fax Modem 0
-s 14f120130e11b195 Bear 0
-s 14f120130e11b196 Seminole 1 0
-s 14f120130e11b1be Seminole 2 0
-s 14f1201310258013 Acer 0
-s 14f120131033809d NEC 0
-s 14f12013103380bc NEC 0
-s 14f12013155d6793 HP 0
-s 14f12013155d8850 E Machines 0
-d 14f12014 HSF 56k Data/Fax/Voice Modem 0
-d 14f12015 HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem 0
-d 14f12016 HSF 56k Data/Fax/Voice/Spkp Modem 0
-d 14f12043 HSF 56k Data/Fax Modem (WorldW SmartDAA) 0
-d 14f12044 HSF 56k Data/Fax/Voice Modem (WorldW SmartDAA) 0
-d 14f12045 HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem (WorldW SmartDAA) 0
-d 14f12046 HSF 56k Data/Fax/Voice/Spkp Modem (WorldW SmartDAA) 0
-d 14f12063 HSF 56k Data/Fax Modem (SmartDAA) 0
-d 14f12064 HSF 56k Data/Fax/Voice Modem (SmartDAA) 0
-d 14f12065 HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem (SmartDAA) 0
-d 14f12066 HSF 56k Data/Fax/Voice/Spkp Modem (SmartDAA) 0
-d 14f12093 HSF 56k Modem 0
-s 14f12093155d2f07 Legend 0
-d 14f12143 HSF 56k Data/Fax/Cell Modem (Mob WorldW SmartDAA) 0
-d 14f12144 HSF 56k Data/Fax/Voice/Cell Modem (Mob WorldW SmartDAA) 0
-d 14f12145 HSF 56k Data/Fax/Voice/Spkp (w/HS)/Cell Modem (Mob WorldW SmartDAA) 0
-d 14f12146 HSF 56k Data/Fax/Voice/Spkp/Cell Modem (Mob WorldW SmartDAA) 0
-d 14f12163 HSF 56k Data/Fax/Cell Modem (Mob SmartDAA) 0
-d 14f12164 HSF 56k Data/Fax/Voice/Cell Modem (Mob SmartDAA) 0
-d 14f12165 HSF 56k Data/Fax/Voice/Spkp (w/HS)/Cell Modem (Mob SmartDAA) 0
-d 14f12166 HSF 56k Data/Fax/Voice/Spkp/Cell Modem (Mob SmartDAA) 0
-d 14f12343 HSF 56k Data/Fax CardBus Modem (Mob WorldW SmartDAA) 0
-d 14f12344 HSF 56k Data/Fax/Voice CardBus Modem (Mob WorldW SmartDAA) 0
-d 14f12345 HSF 56k Data/Fax/Voice/Spkp (w/HS) CardBus Modem (Mob WorldW SmartDAA) 0
-d 14f12346 HSF 56k Data/Fax/Voice/Spkp CardBus Modem (Mob WorldW SmartDAA) 0
-d 14f12363 HSF 56k Data/Fax CardBus Modem (Mob SmartDAA) 0
-d 14f12364 HSF 56k Data/Fax/Voice CardBus Modem (Mob SmartDAA) 0
-d 14f12365 HSF 56k Data/Fax/Voice/Spkp (w/HS) CardBus Modem (Mob SmartDAA) 0
-d 14f12366 HSF 56k Data/Fax/Voice/Spkp CardBus Modem (Mob SmartDAA) 0
-d 14f12443 HSF 56k Data/Fax Modem (Mob WorldW SmartDAA) 0
-s 14f12443104d8075 Modem 0
-s 14f12443104d8083 Modem 0
-s 14f12443104d8097 Modem 0
-d 14f12444 HSF 56k Data/Fax/Voice Modem (Mob WorldW SmartDAA) 0
-d 14f12445 HSF 56k Data/Fax/Voice/Spkp (w/HS) Modem (Mob WorldW SmartDAA) 0
-d 14f12446 HSF 56k Data/Fax/Voice/Spkp Modem (Mob WorldW SmartDAA) 0
-d 14f12463 HSF 56k Data/Fax Modem (Mob SmartDAA) 0
-d 14f12464 HSF 56k Data/Fax/Voice Modem (Mob SmartDAA) 0
-d 14f12465 HSF 56k Data/Fax/Voice/Spkp (w/HS) Modem (Mob SmartDAA) 0
-d 14f12466 HSF 56k Data/Fax/Voice/Spkp Modem (Mob SmartDAA) 0
-d 14f12f00 HSF 56k HSFi Modem 0
-s 14f12f0013e08d84 IBM HSFi V.90 0
-s 14f12f0013e08d85 Compaq Stinger 0
-s 14f12f0014f12004 Dynalink 56PMi 0
-d 14f12f02 HSF 56k HSFi Data/Fax 0
-d 14f12f11 HSF 56k HSFi Modem 0
-d 14f18234 RS8234 ATM SAR Controller [ServiceSAR Plus] 0
-d 14f18800 Winfast TV2000 XP 0
-v 14f2 MOBILITY Electronics 0
-d 14f20120 EV1000 bridge 0
-d 14f20121 EV1000 Parallel port 0
-d 14f20122 EV1000 Serial port 0
-d 14f20123 EV1000 Keyboard controller 0
-d 14f20124 EV1000 Mouse controller 0
-v 14f3 BroadLogic 0
-d 14f32030 2030 DVB-S Satellite Reciever 0
-d 14f32050 2050 DVB-T Terrestrial (Cable) Reciever 0
-d 14f32060 2060 ATSC Terrestrial (Cable) Reciever 0
-v 14f4 TOKYO Electronic Industry CO Ltd 0
-v 14f5 SOPAC Ltd 0
-v 14f6 COYOTE Technologies LLC 0
-v 14f7 WOLF Technology Inc 0
-v 14f8 AUDIOCODES Inc 0
-d 14f82077 TP-240 dual span E1 VoIP PCI card 0
-v 14f9 AG COMMUNICATIONS 0
-v 14fa WANDEL & GOCHERMANN 0
-v 14fb TRANSAS MARINE (UK) Ltd 0
-v 14fc Quadrics Ltd 0
-d 14fc0000 QsNet Elan3 Network Adapter 0
-d 14fc0001 QsNetII Elan4 Network Adapter 0
-v 14fd JAPAN Computer Industry Inc 0
-v 14fe ARCHTEK TELECOM Corp 0
-v 14ff TWINHEAD INTERNATIONAL Corp 0
-v 1500 DELTA Electronics, Inc 0
-d 15001360 RTL81xx RealTek Ethernet 0
-v 1501 BANKSOFT CANADA Ltd 0
-v 1502 MITSUBISHI ELECTRIC LOGISTICS SUPPORT Co Ltd 0
-v 1503 KAWASAKI LSI USA Inc 0
-v 1504 KAISER Electronics 0
-v 1505 ITA INGENIEURBURO FUR TESTAUFGABEN GmbH 0
-v 1506 CHAMELEON Systems Inc 0
-v 1507 Motorola ?? / HTEC 0 Should be HTEC Ltd, but there are no known HTEC chips and 1507 is already used by mistake by Motorola (see vendor ID 1057).
-d 15070001 MPC105 [Eagle] 0
-d 15070002 MPC106 [Grackle] 0
-d 15070003 MPC8240 [Kahlua] 0
-d 15070100 MC145575 [HFC-PCI] 0
-d 15070431 KTI829c 100VG 0
-d 15074801 Raven 0
-d 15074802 Falcon 0
-d 15074803 Hawk 0
-d 15074806 CPX8216 0
-v 1508 HONDA CONNECTORS/MHOTRONICS Inc 0
-v 1509 FIRST INTERNATIONAL Computer Inc 0
-v 150a FORVUS RESEARCH Inc 0
-v 150b YAMASHITA Systems Corp 0
-v 150c KYOPAL CO Ltd 0
-v 150d WARPSPPED Inc 0
-v 150e C-PORT Corp 0
-v 150f INTEC GmbH 0
-v 1510 BEHAVIOR TECH Computer Corp 0
-v 1511 CENTILLIUM Technology Corp 0
-v 1512 ROSUN Technologies Inc 0
-v 1513 Raychem 0
-v 1514 TFL LAN Inc 0
-v 1515 Advent design 0
-v 1516 MYSON Technology Inc 0
-d 15160800 MTD-8xx 100/10M Ethernet PCI Adapter 0
-d 15160803 SURECOM EP-320X-S 100/10M Ethernet PCI Adapter 0
-s 15160803132010bd SURECOM EP-320X-S 100/10M Ethernet PCI Adapter 0
-d 15160891 MTD-8xx 100/10M Ethernet PCI Adapter 0
-v 1517 ECHOTEK Corp 0
-v 1518 PEP MODULAR Computers GmbH 0
-v 1519 TELEFON AKTIEBOLAGET LM Ericsson 0
-v 151a Globetek 0
-d 151a1002 PCI-1002 0
-d 151a1004 PCI-1004 0
-d 151a1008 PCI-1008 0
-v 151b COMBOX Ltd 0
-v 151c DIGITAL AUDIO LABS Inc 0
-v 151d Fujitsu Computer Products Of America 0
-v 151e MATRIX Corp 0
-v 151f TOPIC SEMICONDUCTOR Corp 0
-d 151f0000 TP560 Data/Fax/Voice 56k modem 0
-v 1520 CHAPLET System Inc 0
-v 1521 BELL Corp 0
-v 1522 MainPine Ltd 0
-d 15220100 PCI <-> IOBus Bridge 0
-s 1522010015220200 RockForceDUO 2 Port V.92/V.44 Data/Fax/Voice Modem 0
-s 1522010015220300 RockForceQUATRO 4 Port V.92/V.44 Data/Fax/Voice Modem 0
-s 1522010015220400 RockForceDUO+ 2 Port V.92/V.44 Data/Fax/Voice Modem 0
-s 1522010015220500 RockForceQUATRO+ 4 Port V.92/V.44 Data/Fax/Voice Modem 0
-s 1522010015220600 RockForce+ 2 Port V.90 Data/Fax/Voice Modem 0
-s 1522010015220700 RockForce+ 4 Port V.90 Data/Fax/Voice Modem 0
-s 1522010015220800 RockForceOCTO+ 8 Port V.92/V.44 Data/Fax/Voice Modem 0
-s 1522010015220c00 RockForceDUO+ 2 Port V.92/V.44 Data, V.34 Super-G3 Fax, Voice Modem 0
-s 1522010015220d00 RockForceQUATRO+ 4 Port V.92/V.44 Data, V.34 Super-G3 Fax, Voice Modem 0
-s 1522010015221d00 RockForceOCTO+ 8 Port V.92/V.44 Data, V.34 Super-G3 Fax, Voice Modem 0 this is a correction to a recent entry. 1522:0E00 should be 1522:1D00
-v 1523 MUSIC Semiconductors 0
-v 1524 ENE Technology Inc 0
-d 15240510 CB710 Memory Card Reader Controller 0
-d 15240610 PCI Smart Card Reader Controller 0
-d 15241211 CB1211 Cardbus Controller 0
-d 15241225 CB1225 Cardbus Controller 0
-d 15241410 CB1410 Cardbus Controller 0
-s 152414101025005a TravelMate 290 0
-d 15241411 CB-710/2/4 Cardbus Controller 0
-d 15241412 CB-712/4 Cardbus Controller 0
-d 15241420 CB1420 Cardbus Controller 0
-d 15241421 CB-720/2/4 Cardbus Controller 0
-d 15241422 CB-722/4 Cardbus Controller 0
-v 1525 IMPACT Technologies 0
-v 1526 ISS, Inc 0
-v 1527 SOLECTRON 0
-v 1528 ACKSYS 0
-v 1529 AMERICAN MICROSystems Inc 0
-v 152a QUICKTURN DESIGN Systems 0
-v 152b FLYTECH Technology CO Ltd 0
-v 152c MACRAIGOR Systems LLC 0
-v 152d QUANTA Computer Inc 0
-v 152e MELEC Inc 0
-v 152f PHILIPS - CRYPTO 0
-v 1530 ACQIS Technology Inc 0
-v 1531 CHRYON Corp 0
-v 1532 ECHELON Corp 0
-v 1533 BALTIMORE 0
-v 1534 ROAD Corp 0
-v 1535 EVERGREEN Technologies Inc 0
-v 1537 DATALEX COMMUNCATIONS 0
-v 1538 ARALION Inc 0
-d 15380303 ARS106S Ultra ATA 133/100/66 Host Controller 0
-v 1539 ATELIER INFORMATIQUES et ELECTRONIQUE ETUDES S.A. 0
-v 153a ONO SOKKI 0
-v 153b TERRATEC Electronic GmbH 0
-d 153b1144 Aureon 5.1 0
-d 153b1147 Aureon 5.1 Sky 0 Terratec seems to use several IDs for the same card.
-d 153b1158 Philips Semiconductors SAA7134 (rev 01) [Terratec Cinergy 600 TV] 0
-v 153c ANTAL Electronic 0
-v 153d FILANET Corp 0
-v 153e TECHWELL Inc 0
-v 153f MIPS DENMARK 0
-v 1540 PROVIDEO MULTIMEDIA Co Ltd 0
-v 1541 MACHONE Communications 0
-v 1542 VIVID Technology Inc 0
-v 1543 SILICON Laboratories 0
-d 15433052 Intel 537 [Winmodem] 0
-d 15434c22 Si3036 MC'97 DAA 0
-v 1544 DCM DATA Systems 0
-v 1545 VISIONTEK 0
-v 1546 IOI Technology Corp 0
-v 1547 MITUTOYO Corp 0
-v 1548 JET PROPULSION Laboratory 0
-v 1549 INTERCONNECT Systems Solutions 0
-v 154a MAX Technologies Inc 0
-v 154b COMPUTEX Co Ltd 0
-v 154c VISUAL Technology Inc 0
-v 154d PAN INTERNATIONAL Industrial Corp 0
-v 154e SERVOTEST Ltd 0
-v 154f STRATABEAM Technology 0
-v 1550 OPEN NETWORK Co Ltd 0
-v 1551 SMART Electronic DEVELOPMENT GmBH 0
-v 1552 RACAL AIRTECH Ltd 0
-v 1553 CHICONY Electronics Co Ltd 0
-v 1554 PROLINK Microsystems Corp 0
-v 1555 GESYTEC GmBH 0
-v 1556 PLD APPLICATIONS 0
-v 1557 MEDIASTAR Co Ltd 0
-v 1558 CLEVO/KAPOK Computer 0
-v 1559 SI LOGIC Ltd 0
-v 155a INNOMEDIA Inc 0
-v 155b PROTAC INTERNATIONAL Corp 0
-v 155c Cemax-Icon Inc 0
-v 155d Mac System Co Ltd 0
-v 155e LP Elektronik GmbH 0
-v 155f Perle Systems Ltd 0
-v 1560 Terayon Communications Systems 0
-v 1561 Viewgraphics Inc 0
-v 1562 Symbol Technologies 0
-v 1563 A-Trend Technology Co Ltd 0
-v 1564 Yamakatsu Electronics Industry Co Ltd 0
-v 1565 Biostar Microtech Int'l Corp 0
-v 1566 Ardent Technologies Inc 0
-v 1567 Jungsoft 0
-v 1568 DDK Electronics Inc 0
-v 1569 Palit Microsystems Inc. 0
-v 156a Avtec Systems 0
-v 156b 2wire Inc 0
-v 156c Vidac Electronics GmbH 0
-v 156d Alpha-Top Corp 0
-v 156e Alfa Inc 0
-v 156f M-Systems Flash Disk Pioneers Ltd 0
-v 1570 Lecroy Corp 0
-v 1571 Contemporary Controls 0
-d 1571a001 CCSI PCI20-485 ARCnet 0
-d 1571a002 CCSI PCI20-485D ARCnet 0
-d 1571a003 CCSI PCI20-485X ARCnet 0
-d 1571a004 CCSI PCI20-CXB ARCnet 0
-d 1571a005 CCSI PCI20-CXS ARCnet 0
-d 1571a006 CCSI PCI20-FOG-SMA ARCnet 0
-d 1571a007 CCSI PCI20-FOG-ST ARCnet 0
-d 1571a008 CCSI PCI20-TB5 ARCnet 0
-d 1571a009 CCSI PCI20-5-485 5Mbit ARCnet 0
-d 1571a00a CCSI PCI20-5-485D 5Mbit ARCnet 0
-d 1571a00b CCSI PCI20-5-485X 5Mbit ARCnet 0
-d 1571a00c CCSI PCI20-5-FOG-ST 5Mbit ARCnet 0
-d 1571a00d CCSI PCI20-5-FOG-SMA 5Mbit ARCnet 0
-d 1571a201 CCSI PCI22-485 10Mbit ARCnet 0
-d 1571a202 CCSI PCI22-485D 10Mbit ARCnet 0
-d 1571a203 CCSI PCI22-485X 10Mbit ARCnet 0
-d 1571a204 CCSI PCI22-CHB 10Mbit ARCnet 0
-d 1571a205 CCSI PCI22-FOG_ST 10Mbit ARCnet 0
-d 1571a206 CCSI PCI22-THB 10Mbit ARCnet 0
-v 1572 Otis Elevator Company 0
-v 1573 Lattice - Vantis 0
-v 1574 Fairchild Semiconductor 0
-v 1575 Voltaire Advanced Data Security Ltd 0
-v 1576 Viewcast COM 0
-v 1578 HITT 0
-v 1579 Dual Technology Corp 0
-v 157a Japan Elecronics Ind Inc 0
-v 157b Star Multimedia Corp 0
-v 157c Eurosoft (UK) 0
-d 157c8001 Fix2000 PCI Y2K Compliance Card 0
-v 157d Gemflex Networks 0
-v 157e Transition Networks 0
-v 157f PX Instruments Technology Ltd 0
-v 1580 Primex Aerospace Co 0
-v 1581 SEH Computertechnik GmbH 0
-v 1582 Cytec Corp 0
-v 1583 Inet Technologies Inc 0
-v 1584 Uniwill Computer Corp 0
-v 1585 Logitron 0
-v 1586 Lancast Inc 0
-v 1587 Konica Corp 0
-v 1588 Solidum Systems Corp 0
-v 1589 Atlantek Microsystems Pty Ltd 0
-v 158a Digalog Systems Inc 0
-v 158b Allied Data Technologies 0
-v 158c Hitachi Semiconductor & Devices Sales Co Ltd 0
-v 158d Point Multimedia Systems 0
-v 158e Lara Technology Inc 0
-v 158f Ditect Coop 0
-v 1590 3pardata Inc 0
-v 1591 ARN 0
-v 1592 Syba Tech Ltd 0
-d 15920781 Multi-IO Card 0
-d 15920782 Parallel Port Card 2xEPP 0
-d 15920783 Multi-IO Card 0
-d 15920785 Multi-IO Card 0
-d 15920786 Multi-IO Card 0
-d 15920787 Multi-IO Card 0
-d 15920788 Multi-IO Card 0
-d 1592078a Multi-IO Card 0
-v 1593 Bops Inc 0
-v 1594 Netgame Ltd 0
-v 1595 Diva Systems Corp 0
-v 1596 Folsom Research Inc 0
-v 1597 Memec Design Services 0
-v 1598 Granite Microsystems 0
-v 1599 Delta Electronics Inc 0
-v 159a General Instrument 0
-v 159b Faraday Technology Corp 0
-v 159c Stratus Computer Systems 0
-v 159d Ningbo Harrison Electronics Co Ltd 0
-v 159e A-Max Technology Co Ltd 0
-v 159f Galea Network Security 0
-v 15a0 Compumaster SRL 0
-v 15a1 Geocast Network Systems 0
-v 15a2 Catalyst Enterprises Inc 0
-d 15a20001 TA700 PCI Bus Analyzer/Exerciser 0
-v 15a3 Italtel 0
-v 15a4 X-Net OY 0
-v 15a5 Toyota Macs Inc 0
-v 15a6 Sunlight Ultrasound Technologies Ltd 0
-v 15a7 SSE Telecom Inc 0
-v 15a8 Shanghai Communications Technologies Center 0
-v 15aa Moreton Bay 0
-v 15ab Bluesteel Networks Inc 0
-v 15ac North Atlantic Instruments 0
-v 15ad VMware Inc 0
-d 15ad0405 [VMware SVGA II] PCI Display Adapter 0
-d 15ad0710 Virtual SVGA 0
-d 15ad0720 VMware High-Speed Virtual NIC [vmxnet] 0
-v 15ae Amersham Pharmacia Biotech 0
-v 15b0 Zoltrix International Ltd 0
-v 15b1 Source Technology Inc 0
-v 15b2 Mosaid Technologies Inc 0
-v 15b3 Mellanox Technologies 0
-d 15b35274 MT21108 InfiniBridge 0
-d 15b35a44 MT23108 InfiniHost 0
-d 15b35a45 MT23108 [Infinihost HCA Flash Recovery] 0
-d 15b35a46 MT23108 PCI Bridge 0
-d 15b35e8c MT24204 [InfiniHost III Lx HCA] 0
-d 15b35e8d MT24204 [InfiniHost III Lx HCA Flash Recovery] 0
-d 15b36278 MT25208 InfiniHost III Ex (Tavor compatibility mode) 0
-d 15b36279 MT25208 [InfiniHost III Ex HCA Flash Recovery] 0
-d 15b36282 MT25208 InfiniHost III Ex 0
-v 15b4 CCI/TRIAD 0
-v 15b5 Cimetrics Inc 0
-v 15b6 Texas Memory Systems Inc 0
-v 15b7 Sandisk Corp 0
-v 15b8 ADDI-DATA GmbH 0
-v 15b9 Maestro Digital Communications 0
-v 15ba Impacct Technology Corp 0
-v 15bb Portwell Inc 0
-v 15bc Agilent Technologies 0
-d 15bc2922 64 Bit, 133MHz PCI-X Exerciser & Protocol Checker 0
-d 15bc2928 64 Bit, 66MHz PCI Exerciser & Analyzer 0
-d 15bc2929 64 Bit, 133MHz PCI-X Analyzer & Exerciser 0
-v 15bd DFI Inc 0
-v 15be Sola Electronics 0
-v 15bf High Tech Computer Corp (HTC) 0
-v 15c0 BVM Ltd 0
-v 15c1 Quantel 0
-v 15c2 Newer Technology Inc 0
-v 15c3 Taiwan Mycomp Co Ltd 0
-v 15c4 EVSX Inc 0
-v 15c5 Procomp Informatics Ltd 0
-d 15c58010 1394b - 1394 Firewire 3-Port Host Adapter Card 0
-v 15c6 Technical University of Budapest 0
-v 15c7 Tateyama System Laboratory Co Ltd 0
-d 15c70349 Tateyama C-PCI PLC/NC card Rev.01A 0
-v 15c8 Penta Media Co Ltd 0
-v 15c9 Serome Technology Inc 0
-v 15ca Bitboys OY 0
-v 15cb AG Electronics Ltd 0
-v 15cc Hotrail Inc 0
-v 15cd Dreamtech Co Ltd 0
-v 15ce Genrad Inc 0
-v 15cf Hilscher GmbH 0
-v 15d1 Infineon Technologies AG 0
-v 15d2 FIC (First International Computer Inc) 0
-v 15d3 NDS Technologies Israel Ltd 0
-v 15d4 Iwill Corp 0
-v 15d5 Tatung Co 0
-v 15d6 Entridia Corp 0
-v 15d7 Rockwell-Collins Inc 0
-v 15d8 Cybernetics Technology Co Ltd 0
-v 15d9 Super Micro Computer Inc 0
-v 15da Cyberfirm Inc 0
-v 15db Applied Computing Systems Inc 0
-v 15dc Litronic Inc 0
-d 15dc0001 Argus 300 PCI Cryptography Module 0
-v 15dd Sigmatel Inc 0
-v 15de Malleable Technologies Inc 0
-v 15df Infinilink Corp 0
-v 15e0 Cacheflow Inc 0
-v 15e1 Voice Technologies Group Inc 0
-v 15e2 Quicknet Technologies Inc 0
-v 15e3 Networth Technologies Inc 0
-v 15e4 VSN Systemen BV 0
-v 15e5 Valley technologies Inc 0
-v 15e6 Agere Inc 0
-v 15e7 Get Engineering Corp 0
-v 15e8 National Datacomm Corp 0
-d 15e80130 Wireless PCI Card 0
-v 15e9 Pacific Digital Corp 0
-d 15e91841 ADMA-100 DiscStaQ ATA Controller 0
-v 15ea Tokyo Denshi Sekei K.K. 0
-v 15eb Drsearch GmbH 0
-v 15ec Beckhoff GmbH 0
-d 15ec3101 FC3101 Profibus DP 1 Channel PCI 0
-d 15ec5102 FC5102 0
-v 15ed Macrolink Inc 0
-v 15ee In Win Development Inc 0
-v 15ef Intelligent Paradigm Inc 0
-v 15f0 B-Tree Systems Inc 0
-v 15f1 Times N Systems Inc 0
-v 15f2 Diagnostic Instruments Inc 0
-v 15f3 Digitmedia Corp 0
-v 15f4 Valuesoft 0
-v 15f5 Power Micro Research 0
-v 15f6 Extreme Packet Device Inc 0
-v 15f7 Banctec 0
-v 15f8 Koga Electronics Co 0
-v 15f9 Zenith Electronics Corp 0
-v 15fa J.P. Axzam Corp 0
-v 15fb Zilog Inc 0
-v 15fc Techsan Electronics Co Ltd 0
-v 15fd N-CUBED.NET 0
-v 15fe Kinpo Electronics Inc 0
-v 15ff Fastpoint Technologies Inc 0
-v 1600 Northrop Grumman - Canada Ltd 0
-v 1601 Tenta Technology 0
-v 1602 Prosys-tec Inc 0
-v 1603 Nokia Wireless Communications 0
-v 1604 Central System Research Co Ltd 0
-v 1605 Pairgain Technologies 0
-v 1606 Europop AG 0
-v 1607 Lava Semiconductor Manufacturing Inc 0
-v 1608 Automated Wagering International 0
-v 1609 Scimetric Instruments Inc 0
-v 1612 Telesynergy Research Inc. 0
-v 1619 FarSite Communications Ltd 0
-d 16190400 FarSync T2P (2 port X.21/V.35/V.24) 0
-d 16190440 FarSync T4P (4 port X.21/V.35/V.24) 0
-v 161f Rioworks 0 www.rioworks.com
-v 1626 TDK Semiconductor Corp. 0
-d 16268410 RTL81xx Fast Ethernet 0
-v 1629 Kongsberg Spacetec AS 0
-d 16291003 Format synchronizer v3.0 0
-d 16292002 Fast Universal Data Output 0
-v 1637 Linksys 0 This seems to occur on their 802.11b Wireless card WMP-11
-d 16373874 Linksys 802.11b WMP11 PCI Wireless card 0
-v 1638 Standard Microsystems Corp [SMC] 0
-d 16381100 SMC2602W EZConnect / Addtron AWA-100 / Eumitcom PCI WL11000 0
-v 163c Smart Link Ltd. 0
-d 163c3052 SmartLink SmartPCI562 56K Modem 0
-d 163c5449 SmartPCI561 Modem 0
-v 1657 Brocade Communications Systems, Inc. 0
-v 165a Epix Inc 0
-d 165ac100 PIXCI(R) CL1 Camera Link Video Capture Board [custom QL5232] 0
-d 165ad200 PIXCI(R) D2X Digital Video Capture Board [custom QL5232] 0
-d 165ad300 PIXCI(R) D3X Digital Video Capture Board [custom QL5232] 0
-v 165d Hsing Tech. Enterprise Co., Ltd. 0
-v 1661 Worldspace Corp. 0
-v 1668 Actiontec Electronics Inc 0
-d 16680100 Mini-PCI bridge 0
-v 166d Broadcom Corporation 0 Formerly SiByte, Inc.
-d 166d0001 SiByte BCM1125/1125H/1250 System-on-a-Chip PCI 0
-d 166d0002 SiByte BCM1125H/1250 System-on-a-Chip HyperTransport 0
-v 1677 Bernecker + Rainer 0
-d 1677104e 5LS172.6 B&R Dual CAN Interface Card 0
-d 167712d7 5LS172.61 B&R Dual CAN Interface Card 0
-v 1681 Hercules 0
-d 16810010 Hercules 3d Prophet II Ultra 64MB [ 350 MHz NV15BR core, 128-bit DDR @ 460 MHz, 1.5v AGP4x ] 0 More specs, more accurate desc.
-v 1688 CastleNet Technology Inc. 0
-d 16881170 WLAN 802.11b card 0
-v 168c Atheros Communications, Inc. 0
-d 168c0007 AR5000 802.11a Wireless Adapter 0
-d 168c0011 AR5210 802.11a NIC 0
-d 168c0012 AR5211 802.11ab NIC 0
-d 168c0013 AR5212 802.11abg NIC 0
-s 168c001311863202 D-link DWL-G650 B3 Wireless cardbus adapter 0
-s 168c001311863203 DWL-G520 Wireless PCI Adapter 0
-s 168c001311863a13 DWL-G520 Wireless PCI Adapter rev. B 0
-s 168c001311863a94 C54C Wireless 801.11g cardbus 0
-s 168c001313854d00 Netgear WG311T Wireless PCI Adapter 0
-s 168c001314b70a60 8482-WD ORiNOCO 11a/b/g Wireless PCI Adapter 0
-s 168c0013168c0013 WG511T Wireless CardBus Adapter 0
-s 168c0013168c1025 DWL-G650B2 Wireless CardBus Adapter 0
-s 168c0013168c2026 Netgate 5354MP ARIES a(108Mb turbo)/b/g MiniPCI Adapter 0
-d 168c1014 AR5212 802.11abg NIC 0
-v 16a5 Tekram Technology Co.,Ltd. 0
-v 16ab Global Sun Technology Inc 0
-d 16ab1100 GL24110P 0
-d 16ab1101 PLX9052 PCMCIA-to-PCI Wireless LAN 0
-d 16ab1102 PCMCIA-to-PCI Wireless Network Bridge 0
-v 16ae Safenet Inc 0
-d 16ae1141 SafeXcel-1141 0
-v 16b4 Aspex Semiconductor Ltd 0
-v 16be Creatix Polymedia GmbH 0
-v 16ca CENATEK Inc 0
-d 16ca0001 Rocket Drive DL 0
-v 16cd Densitron Technologies 0
-v 16df PIKA Technologies Inc. 0 www.pikatechnologies.com
-v 16e3 European Space Agency 0
-d 16e31e0f LEON2FT Processor 0
-v 16ec U.S. Robotics 0
-d 16ec00ff USR997900 10/100 Mbps PCI Network Card 0
-d 16ec3685 Wireless Access PCI Adapter Model 022415 0
-v 16ed Sycron N. V. 0
-d 16ed1001 UMIO communication card 0
-v 16f3 Jetway Information Co., Ltd. 0
-v 16f4 Vweb Corp 0
-d 16f48000 VW2010 0
-v 16f6 VideoTele.com, Inc. 0
-v 1702 Internet Machines Corporation (IMC) 0 www.internetmachines.com
-v 1705 Digital First, Inc. 0
-v 170b NetOctave 0
-d 170b0100 NSP2000-SSL crypto accelerator 0
-v 170c YottaYotta Inc. 0
-v 1725 Vitesse Semiconductor 0 Seems to be a 2nd ID for Vitesse Semiconductor
-d 17257174 VSC7174 PCI/PCI-X Serial ATA Host Bus Controller 0
-v 172a Accelerated Encryption 0
-v 1734 Fujitsu Siemens Computer GmbH 0
-v 1737 Linksys 0
-d 17370013 WMP54G Wireless Pci Card 0
-d 17370015 WMP54GS Wireless Pci Card 0
-d 17371032 Gigabit Network Adapter 0
-s 1737103217370015 EG1032 v2 Instant Gigabit Network Adapter 0
-d 17371064 Gigabit Network Adapter 0
-s 1737106417370016 EG1064 v2 Instant Gigabit Network Adapter 0
-d 1737ab08 21x4x DEC-Tulip compatible 10/100 Ethernet 0
-d 1737ab09 21x4x DEC-Tulip compatible 10/100 Ethernet 0
-v 173b Altima (nee Broadcom) 0
-d 173b03e8 AC1000 Gigabit Ethernet 0
-d 173b03e9 AC1001 Gigabit Ethernet 0
-d 173b03ea AC9100 Gigabit Ethernet 0
-s 173b03ea173b0001 AC1002 0
-d 173b03eb AC1003 Gigabit Ethernet 0
-v 1743 Peppercon AG 0
-d 17438139 ROL/F-100 Fast Ethernet Adapter with ROL 0
-v 1749 RLX Technologies 0
-v 174b PC Partner Limited 0
-v 174d WellX Telecom SA 0
-v 175c AudioScience Inc 0
-v 175e Sanera Systems, Inc. 0
-v 1787 Hightech Information System Ltd. 0
-v 1796 Research Centre Juelich 0 also used by Struck Innovative Systeme for joint developments
-d 17960001 SIS1100 [Gigabit link] 0
-d 17960002 HOTlink 0
-d 17960003 Counter Timer 0
-d 17960004 CAMAC Controller 0
-d 17960005 PROFIBUS 0
-d 17960006 AMCC HOTlink 0
-v 1797 JumpTec h, GMBH 0
-v 1799 Belkin 0
-d 17996001 Wireless PCI Card - F5D6001 0
-d 17996020 Wireless PCMCIA Card - F5D6020 0
-d 17996060 Wireless PDA Card - F5D6060 0
-d 17997000 Wireless PCI Card - F5D7000 0
-v 17a0 Genesys Logic, Inc 0
-d 17a08033 GL880S USB 1.1 controller 0
-d 17a08034 GL880S USB 2.0 controller 0
-v 17af Hightech Information System Ltd. 0
-v 17b3 Hawking Technologies 0
-d 17b3ab08 PN672TX 10/100 Ethernet 0
-v 17b4 Indra Networks, Inc. 0
-d 17b40011 WebEnhance 100 GZIP Compression Card 0
-v 17c0 Wistron Corp. 0
-v 17c2 Newisys, Inc. 0
-v 17cc NetChip Technology, Inc 0
-d 17cc2280 USB 2.0 0
-v 17d5 S2io Inc. 0 S2io ships 10Gb PCI-X Ethernet adapters www.s2io.com
-v 17ee Connect Components Ltd 0 http://www.connect3d.com
-v 17fe Linksys, A Division of Cisco Systems 0
-d 17fe2220 [AirConn] INPROCOMM IPN 2220 Wireless LAN Adapter (rev 01) 0
-v 1813 Ambient Technologies Inc 0
-d 18134000 HaM controllerless modem 0
-s 1813400016be0001 V9x HAM Data Fax Modem 0
-d 18134100 HaM plus Data Fax Modem 0
-s 1813410016be0002 V9x HAM 1394 0
-v 1814 RaLink 0
-d 18140101 Wireless PCI Adpator RT2400 / RT2460 0
-d 18140201 Ralink RT2500 802.11 Cardbus Reference Card 0
-s 181402011371001e CWC-854 Wireless-G CardBus Adapter 0
-s 181402011371001f CWM-854 Wireless-G Mini PCI Adapter 0
-s 1814020113710020 CWP-854 Wireless-G PCI Adapter 0
-v 1820 InfiniCon Systems Inc. 0
-v 1822 Twinhan Technology Co. Ltd 0
-v 182d SiteCom Europe BV 0
-d 182d3069 ISDN PCI DC-105V2 0 HFC-based ISDN card
-v 1830 Credence Systems Corporation 0
-v 183b MikroM GmbH 0
-d 183b08a7 MVC100 DVI 0
-d 183b08a8 MVC101 SDI 0
-d 183b08a9 MVC102 DVI+Audio 0
-v 1849 ASRock Incorporation 0
-v 1851 Microtune, Inc. 0
-v 1852 Anritsu Corp. 0
-v 1867 Topspin Communications 0
-d 18675a44 MT23108 PCI-X HCA 0
-d 18675a45 MT23108 PCI-X HCA flash recovery 0
-d 18675a46 MT23108 PCI-X HCA bridge 0
-d 18676278 MT25208 InfiniHost III Ex (Tavor compatibility mode) 0
-d 18676282 MT25208 InfiniHost III Ex 0
-v 1888 Varisys Ltd 0
-d 18880301 VMFX1 FPGA PMC module 0
-d 18880601 VSM2 dual PMC carrier 0
-d 18880710 VS14x series PowerPC PCI board 0
-d 18880720 VS24x series PowerPC PCI board 0
-v 1894 KNC One 0 found e.g. on KNC DVB-S card
-v 1896 B&B Electronics Manufacturing Company, Inc. 0
-v 18a1 Astute Networks Inc. 0
-v 18ac DViCO Corporation 0
-d 18acd810 FusionHDTV 3 Gold 0
-v 18bc Info-Tek Corp. 0
-v 18c8 Cray Inc 0 assigned to Octigabay System, which has been acquired by Cray
-v 18c9 ARVOO Engineering BV 0
-v 18ca XGI - Xabre Graphics Inc 0
-d 18ca0040 Volari V8 0
-v 18e6 MPL AG 0
-d 18e60001 OSCI [Octal Serial Communication Interface] 0
-v 18f7 Commtech, Inc. 0
-d 18f70001 Fastcom ESCC-PCI-335 0
-d 18f70002 Fastcom 422/4-PCI-335 0
-d 18f70004 Fastcom 422/2-PCI-335 0
-d 18f70005 Fastcom IGESCC-PCI-ISO/1 0
-d 18f7000a Fastcom 232/4-PCI-335 0
-v 18fb Resilience Corporation 0
-v 1a08 Sierra semiconductor 0
-d 1a080000 SC15064 0
-v 1b13 Jaton Corp 0
-v 1c1c Symphony 0
-d 1c1c0001 82C101 0
-v 1d44 DPT 0
-d 1d44a400 PM2x24/PM3224 0
-v 1de1 Tekram Technology Co.,Ltd. 0
-d 1de10391 TRM-S1040 0
-d 1de12020 DC-390 0
-d 1de1690c 690c 0
-d 1de1dc29 DC290 0
-v 1fc0 Tumsan Oy 0
-d 1fc00300 E2200 Dual E1/Rawpipe Card 0
-v 2000 Smart Link Ltd. 0
-v 2001 Temporal Research Ltd 0
-v 2003 Smart Link Ltd. 0
-v 2004 Smart Link Ltd. 0
-v 21c3 21st Century Computer Corp. 0
-v 2348 Racore 0
-d 23482010 8142 100VG/AnyLAN 0
-v 2646 Kingston Technologies 0
-v 270b Xantel Corporation 0
-v 270f Chaintech Computer Co. Ltd 0
-v 2711 AVID Technology Inc. 0
-v 2a15 3D Vision(?) 0
-v 3000 Hansol Electronics Inc. 0
-v 3142 Post Impression Systems. 0
-v 3388 Hint Corp 0
-d 33880013 HiNT HC4 PCI to ISDN bridge, Multimedia audio controller 0
-d 33880014 HiNT HC4 PCI to ISDN bridge, Network controller 0
-d 33880020 HB6 Universal PCI-PCI bridge (transparent mode) 0
-d 33880021 HB6 Universal PCI-PCI bridge (non-transparent mode) 0
-s 338800214c531050 CT7 mainboard 0
-s 338800214c531080 CT8 mainboard 0
-s 338800214c5310a0 CA3/CR3 mainboard 0
-s 338800214c533010 PPCI mezzanine (32-bit PMC) 0
-s 338800214c533011 PPCI mezzanine (64-bit PMC) 0
-d 33880022 HiNT HB4 PCI-PCI Bridge (PCI6150) 0
-d 33880026 HB2 PCI-PCI Bridge 0
-d 3388101a E.Band [AudioTrak Inca88] 0
-d 3388101b E.Band [AudioTrak Inca88] 0
-d 33888011 VXPro II Chipset 0
-s 3388801133888011 VXPro II Chipset CPU to PCI Bridge 0
-d 33888012 VXPro II Chipset 0
-s 3388801233888012 VXPro II Chipset PCI to ISA Bridge 0
-d 33888013 VXPro II IDE 0
-s 3388801333888013 VXPro II Chipset EIDE Controller 0
-v 3411 Quantum Designs (H.K.) Inc 0
-v 3513 ARCOM Control Systems Ltd 0
-v 3842 eVga.com. Corp. 0
-v 38ef 4Links 0
-v 3d3d 3DLabs 0
-d 3d3d0001 GLINT 300SX 0
-d 3d3d0002 GLINT 500TX 0
-d 3d3d0003 GLINT Delta 0
-d 3d3d0004 Permedia 0
-d 3d3d0005 Permedia 0
-d 3d3d0006 GLINT MX 0
-d 3d3d0007 3D Extreme 0
-d 3d3d0008 GLINT Gamma G1 0
-d 3d3d0009 Permedia II 2D+3D 0
-s 3d3d000910400011 AccelStar II 0
-s 3d3d000913e91000 6221L-4U 0
-s 3d3d00093d3d0100 AccelStar II 3D Accelerator 0
-s 3d3d00093d3d0111 Permedia 3:16 0
-s 3d3d00093d3d0114 Santa Ana 0
-s 3d3d00093d3d0116 Oxygen GVX1 0
-s 3d3d00093d3d0119 Scirocco 0
-s 3d3d00093d3d0120 Santa Ana PCL 0
-s 3d3d00093d3d0125 Oxygen VX1 0
-s 3d3d00093d3d0127 Permedia3 Create! 0
-d 3d3d000a GLINT R3 0
-s 3d3d000a3d3d0121 Oxygen VX1 0
-d 3d3d000c GLINT R3 [Oxygen VX1] 0
-s 3d3d000c3d3d0144 Oxygen VX1-4X AGP [Permedia 4] 0
-d 3d3d000d GLint R4 rev A 0
-d 3d3d0011 GLint R4 rev B 0
-d 3d3d0012 GLint R5 rev A 0
-d 3d3d0013 GLint R5 rev B 0
-d 3d3d0020 VP10 visual processor 0
-d 3d3d0022 VP10 visual processor 0 P10 generic II
-d 3d3d0024 VP9 visual processor 0
-d 3d3d0100 Permedia II 2D+3D 0
-d 3d3d07a1 Wildcat III 6210 0
-d 3d3d07a2 Sun XVR-500 Graphics Accelerator 0
-d 3d3d07a3 Wildcat IV 7210 0
-d 3d3d1004 Permedia 0
-d 3d3d3d04 Permedia 0
-d 3d3dffff Glint VGA 0
-v 4005 Avance Logic Inc. 0
-d 40050300 ALS300 PCI Audio Device 0
-d 40050308 ALS300+ PCI Audio Device 0
-d 40050309 PCI Input Controller 0
-d 40051064 ALG-2064 0
-d 40052064 ALG-2064i 0
-d 40052128 ALG-2364A GUI Accelerator 0
-d 40052301 ALG-2301 0
-d 40052302 ALG-2302 0
-d 40052303 AVG-2302 GUI Accelerator 0
-d 40052364 ALG-2364A 0
-d 40052464 ALG-2464 0
-d 40052501 ALG-2564A/25128A 0
-d 40054000 ALS4000 Audio Chipset 0
-s 4005400040054000 ALS4000 Audio Chipset 0
-d 40054710 ALC200/200P 0
-v 4033 Addtron Technology Co, Inc. 0
-d 40331360 RTL8139 Ethernet 0
-v 4143 Digital Equipment Corp 0
-v 4144 Alpha Data 0
-v 416c Aladdin Knowledge Systems 0
-d 416c0100 AladdinCARD 0
-d 416c0200 CPC 0
-v 4444 Internext Compression Inc 0
-d 44440016 iTVC16 (CX23416) MPEG-2 Encoder 0
-s 4444001600704009 WinTV PVR 250 0
-d 44440803 iTVC15 MPEG-2 Encoder 0
-s 4444080300704000 WinTV PVR-350 0
-s 4444080300704001 WinTV PVR-250 0
-v 4468 Bridgeport machines 0
-v 4594 Cogetec Informatique Inc 0
-v 45fb Baldor Electric Company 0
-v 4680 Umax Computer Corp 0
-v 4843 Hercules Computer Technology Inc 0
-v 4916 RedCreek Communications Inc 0
-d 49161960 RedCreek PCI adapter 0
-v 4943 Growth Networks 0
-v 494f ACCES I/O Products, Inc. 0
-d 494f10e8 LPCI-COM-8SM 0
-v 4978 Axil Computer Inc 0
-v 4a14 NetVin 0
-d 4a145000 NV5000SC 0
-s 4a1450004a145000 RT8029-Based Ethernet Adapter 0
-v 4b10 Buslogic Inc. 0
-v 4c48 LUNG HWA Electronics 0
-v 4c53 SBS Technologies 0
-d 4c530000 PLUSTEST device 0
-s 4c5300004c533000 PLUSTEST card (PC104+) 0
-s 4c5300004c533001 PLUSTEST card (PMC) 0
-d 4c530001 PLUSTEST-MM device 0
-s 4c5300014c533002 PLUSTEST-MM card (PMC) 0
-v 4ca1 Seanix Technology Inc 0
-v 4d51 MediaQ Inc. 0
-d 4d510200 MQ-200 0
-v 4d54 Microtechnica Co Ltd 0
-v 4ddc ILC Data Device Corp 0
-d 4ddc0100 DD-42924I5-300 (ARINC 429 Data Bus) 0
-d 4ddc0801 BU-65570I1 MIL-STD-1553 Test and Simulation 0
-d 4ddc0802 BU-65570I2 MIL-STD-1553 Test and Simulation 0
-d 4ddc0811 BU-65572I1 MIL-STD-1553 Test and Simulation 0
-d 4ddc0812 BU-65572I2 MIL-STD-1553 Test and Simulation 0
-d 4ddc0881 BU-65570T1 MIL-STD-1553 Test and Simulation 0
-d 4ddc0882 BU-65570T2 MIL-STD-1553 Test and Simulation 0
-d 4ddc0891 BU-65572T1 MIL-STD-1553 Test and Simulation 0
-d 4ddc0892 BU-65572T2 MIL-STD-1553 Test and Simulation 0
-d 4ddc0901 BU-65565C1 MIL-STD-1553 Data Bus 0
-d 4ddc0902 BU-65565C2 MIL-STD-1553 Data Bus 0
-d 4ddc0903 BU-65565C3 MIL-STD-1553 Data Bus 0
-d 4ddc0904 BU-65565C4 MIL-STD-1553 Data Bus 0
-d 4ddc0b01 BU-65569I1 MIL-STD-1553 Data Bus 0
-d 4ddc0b02 BU-65569I2 MIL-STD-1553 Data Bus 0
-d 4ddc0b03 BU-65569I3 MIL-STD-1553 Data Bus 0
-d 4ddc0b04 BU-65569I4 MIL-STD-1553 Data Bus 0
-v 5046 GemTek Technology Corporation 0
-d 50461001 PCI Radio 0
-v 5053 Voyetra Technologies 0
-d 50532010 Daytona Audio Adapter 0
-v 5136 S S Technologies 0
-v 5143 Qualcomm Inc 0
-v 5145 Ensoniq (Old) 0
-d 51453031 Concert AudioPCI 0
-v 5168 Animation Technologies Inc. 0
-v 5301 Alliance Semiconductor Corp. 0
-d 53010001 ProMotion aT3D 0
-v 5333 S3 Inc. 0
-d 53330551 Plato/PX (system) 0
-d 53335631 86c325 [ViRGE] 0
-d 53338800 86c866 [Vision 866] 0
-d 53338801 86c964 [Vision 964] 0
-d 53338810 86c764_0 [Trio 32 vers 0] 0
-d 53338811 86c764/765 [Trio32/64/64V+] 0
-d 53338812 86cM65 [Aurora64V+] 0
-d 53338813 86c764_3 [Trio 32/64 vers 3] 0
-d 53338814 86c767 [Trio 64UV+] 0
-d 53338815 86cM65 [Aurora 128] 0
-d 5333883d 86c988 [ViRGE/VX] 0
-d 53338870 FireGL 0
-d 53338880 86c868 [Vision 868 VRAM] vers 0 0
-d 53338881 86c868 [Vision 868 VRAM] vers 1 0
-d 53338882 86c868 [Vision 868 VRAM] vers 2 0
-d 53338883 86c868 [Vision 868 VRAM] vers 3 0
-d 533388b0 86c928 [Vision 928 VRAM] vers 0 0
-d 533388b1 86c928 [Vision 928 VRAM] vers 1 0
-d 533388b2 86c928 [Vision 928 VRAM] vers 2 0
-d 533388b3 86c928 [Vision 928 VRAM] vers 3 0
-d 533388c0 86c864 [Vision 864 DRAM] vers 0 0
-d 533388c1 86c864 [Vision 864 DRAM] vers 1 0
-d 533388c2 86c864 [Vision 864-P DRAM] vers 2 0
-d 533388c3 86c864 [Vision 864-P DRAM] vers 3 0
-d 533388d0 86c964 [Vision 964 VRAM] vers 0 0
-d 533388d1 86c964 [Vision 964 VRAM] vers 1 0
-d 533388d2 86c964 [Vision 964-P VRAM] vers 2 0
-d 533388d3 86c964 [Vision 964-P VRAM] vers 3 0
-d 533388f0 86c968 [Vision 968 VRAM] rev 0 0
-d 533388f1 86c968 [Vision 968 VRAM] rev 1 0
-d 533388f2 86c968 [Vision 968 VRAM] rev 2 0
-d 533388f3 86c968 [Vision 968 VRAM] rev 3 0
-d 53338900 86c755 [Trio 64V2/DX] 0
-s 5333890053338900 86C775 Trio64V2/DX 0
-d 53338901 86c775/86c785 [Trio 64V2/DX or /GX] 0
-s 5333890153338901 86C775 Trio64V2/DX, 86C785 Trio64V2/GX 0
-d 53338902 Plato/PX 0
-d 53338903 Trio 3D business multimedia 0
-d 53338904 Trio 64 3D 0
-s 53338904101400db Integrated Trio3D 0
-s 5333890453338904 86C365 Trio3D AGP 0
-d 53338905 Trio 64V+ family 0
-d 53338906 Trio 64V+ family 0
-d 53338907 Trio 64V+ family 0
-d 53338908 Trio 64V+ family 0
-d 53338909 Trio 64V+ family 0
-d 5333890a Trio 64V+ family 0
-d 5333890b Trio 64V+ family 0
-d 5333890c Trio 64V+ family 0
-d 5333890d Trio 64V+ family 0
-d 5333890e Trio 64V+ family 0
-d 5333890f Trio 64V+ family 0
-d 53338a01 ViRGE/DX or /GX 0
-s 53338a010e11b032 ViRGE/GX 0
-s 53338a0110b41617 Nitro 3D 0
-s 53338a0110b41717 Nitro 3D 0
-s 53338a0153338a01 ViRGE/DX 0
-d 53338a10 ViRGE/GX2 0
-s 53338a1010928a10 Stealth 3D 4000 0
-d 53338a13 86c368 [Trio 3D/2X] 0
-s 53338a1353338a13 Trio3D/2X 0
-d 53338a20 86c794 [Savage 3D] 0
-s 53338a2053338a20 86C391 Savage3D 0
-d 53338a21 86c390 [Savage 3D/MV] 0
-s 53338a2153338a21 86C390 Savage3D/MV 0
-d 53338a22 Savage 4 0
-s 53338a2210338068 Savage 4 0
-s 53338a2210338069 Savage 4 0
-s 53338a2210338110 Savage4 LT 0
-s 53338a22105d0018 SR9 8Mb SDRAM 0
-s 53338a22105d002a SR9 Pro 16Mb SDRAM 0
-s 53338a22105d003a SR9 Pro 32Mb SDRAM 0
-s 53338a22105d092f SR9 Pro+ 16Mb SGRAM 0
-s 53338a2210924207 Stealth III S540 0
-s 53338a2210924800 Stealth III S540 0
-s 53338a2210924807 SpeedStar A90 0
-s 53338a2210924808 Stealth III S540 0
-s 53338a2210924809 Stealth III S540 0
-s 53338a221092480e Stealth III S540 0
-s 53338a2210924904 Stealth III S520 0
-s 53338a2210924905 SpeedStar A200 0
-s 53338a2210924a09 Stealth III S540 0
-s 53338a2210924a0b Stealth III S540 Xtreme 0
-s 53338a2210924a0f Stealth III S540 0
-s 53338a2210924e01 Stealth III S540 0
-s 53338a221102101d 3d Blaster Savage 4 0
-s 53338a221102101e 3d Blaster Savage 4 0
-s 53338a2253338100 86C394-397 Savage4 SDRAM 100 0
-s 53338a2253338110 86C394-397 Savage4 SDRAM 110 0
-s 53338a2253338125 86C394-397 Savage4 SDRAM 125 0
-s 53338a2253338143 86C394-397 Savage4 SDRAM 143 0
-s 53338a2253338a22 86C394-397 Savage4 0
-s 53338a2253338a2e 86C394-397 Savage4 32bit 0
-s 53338a2253339125 86C394-397 Savage4 SGRAM 125 0
-s 53338a2253339143 86C394-397 Savage4 SGRAM 143 0
-d 53338a23 Savage 4 0
-d 53338a25 ProSavage PM133 0
-d 53338a26 ProSavage KM133 0
-d 53338c00 ViRGE/M3 0
-d 53338c01 ViRGE/MX 0
-s 53338c0111790001 ViRGE/MX 0
-d 53338c02 ViRGE/MX+ 0
-d 53338c03 ViRGE/MX+MV 0
-d 53338c10 86C270-294 Savage/MX-MV 0
-d 53338c11 82C270-294 Savage/MX 0
-d 53338c12 86C270-294 Savage/IX-MV 0
-s 53338c121014017f ThinkPad T20 0
-d 53338c13 86C270-294 Savage/IX 0
-s 53338c1311790001 Magnia Z310 0
-d 53338c22 SuperSavage MX/128 0
-d 53338c24 SuperSavage MX/64 0
-d 53338c26 SuperSavage MX/64C 0
-d 53338c2a SuperSavage IX/128 SDR 0
-d 53338c2b SuperSavage IX/128 DDR 0
-d 53338c2c SuperSavage IX/64 SDR 0
-d 53338c2d SuperSavage IX/64 DDR 0
-d 53338c2e SuperSavage IX/C SDR 0
-s 53338c2e101401fc ThinkPad T23 (2647-4MG) 0
-d 53338c2f SuperSavage IX/C DDR 0
-d 53338d01 86C380 [ProSavageDDR K4M266] 0
-d 53338d02 VT8636A [ProSavage KN133] AGP4X VGA Controller (TwisterK) 0
-d 53338d03 VT8751 [ProSavageDDR P4M266] 0
-d 53338d04 VT8375 [ProSavage8 KM266/KL266] 0
-d 53339102 86C410 Savage 2000 0
-s 5333910210925932 Viper II Z200 0
-s 5333910210925934 Viper II Z200 0
-s 5333910210925952 Viper II Z200 0
-s 5333910210925954 Viper II Z200 0
-s 5333910210925a35 Viper II Z200 0
-s 5333910210925a37 Viper II Z200 0
-s 5333910210925a55 Viper II Z200 0
-s 5333910210925a57 Viper II Z200 0
-d 5333ca00 SonicVibes 0
-v 544c Teralogic Inc 0
-d 544c0350 TL880-based HDTV/ATSC tuner 0
-v 5455 Technische University Berlin 0
-d 54554458 S5933 0
-v 5519 Cnet Technologies, Inc. 0
-v 5544 Dunord Technologies 0
-d 55440001 I-30xx Scanner Interface 0
-v 5555 Genroco, Inc 0
-d 55550003 TURBOstor HFP-832 [HiPPI NIC] 0
-v 5654 VoiceTronix Pty Ltd 0
-d 56543132 OpenSwitch12 0
-v 5700 Netpower 0
-v 5851 Exacq Technologies 0
-v 6356 UltraStor 0
-v 6374 c't Magazin für Computertechnik 0
-d 63746773 GPPCI 0
-v 6409 Logitec Corp. 0
-v 6666 Decision Computer International Co. 0
-d 66660001 PCCOM4 0
-d 66660002 PCCOM8 0
-v 7604 O.N. Electronic Co Ltd. 0
-v 7bde MIDAC Corporation 0
-v 7fed PowerTV 0
-v 8008 Quancom Electronic GmbH 0
-d 80080010 WDOG1 [PCI-Watchdog 1] 0
-d 80080011 PWDOG2 [PCI-Watchdog 2] 0
-v 807d Asustek Computer, Inc. 0 Wrong ID used in subsystem ID of AsusTek PCI-USB2 PCI card.
-v 8086 Intel Corp. 0
-d 80860007 82379AB 0
-d 80860008 Extended Express System Support Controller 0
-s 8086000800081000 WorldMark 4300 INCA ASIC 0
-d 80860039 21145 Fast Ethernet 0
-d 80860122 82437FX 0
-d 80860309 80303 I/O Processor PCI-to-PCI Bridge 0
-d 8086030d 80312 I/O Companion Chip PCI-to-PCI Bridge 0
-d 80860326 6700/6702PXH I/OxAPIC Interrupt Controller A 0
-d 80860327 6700PXH I/OxAPIC Interrupt Controller B 0
-d 80860329 6700PXH PCI Express-to-PCI Bridge A 0
-d 8086032a 6700PXH PCI Express-to-PCI Bridge B 0
-d 8086032c 6702PXH PCI Express-to-PCI Bridge A 0
-d 80860330 80332 [Dobson] I/O processor 0 A-segment bridge
-d 80860331 80332 [Dobson] I/O processor 0 A-segment IOAPIC
-d 80860332 80332 [Dobson] I/O processor 0 B-segment bridge
-d 80860333 80332 [Dobson] I/O processor 0 B-segment IOAPIC
-d 80860334 80332 [Dobson] I/O processor 0 Address Translation Unit (ATU)
-d 80860335 80331 [Lindsay] I/O processor 0 PCI-X bridge
-d 80860336 80331 [Lindsay] I/O processor 0 Address Translation Unit (ATU)
-d 80860340 41210 [Lanai] Serial to Parallel PCI Bridge 0 A-segment bridge
-d 80860341 41210 [Lanai] Serial to Parallel PCI Bridge 0 B-segment bridge
-d 80860482 82375EB/SB PCI to EISA Bridge 0
-d 80860483 82424TX/ZX [Saturn] CPU to PCI bridge 0
-d 80860484 82378ZB/IB, 82379AB (SIO, SIO.A) PCI to ISA Bridge 0
-d 80860486 82425EX/ZX [Aries] PCIset with ISA bridge 0
-d 808604a3 82434LX/NX [Mercury/Neptune] Processor to PCI bridge 0
-d 808604d0 82437FX [Triton FX] 0
-d 80860500 E8870 Processor bus control 0
-d 80860501 E8870 Memory controller 0
-d 80860502 E8870 Scalability Port 0 0 and registers common to both SPs
-d 80860503 E8870 Scalability Port 1 0 and global performance monitoring
-d 80860510 E8870IO Hub Interface Port 0 registers (8-bit compatibility port) 0
-d 80860511 E8870IO Hub Interface Port 1 registers 0
-d 80860512 E8870IO Hub Interface Port 2 registers 0
-d 80860513 E8870IO Hub Interface Port 3 registers 0
-d 80860514 E8870IO Hub Interface Port 4 registers 0
-d 80860515 E8870IO General SIOH registers 0
-d 80860516 E8870IO RAS registers 0
-d 80860530 E8870SP Scalability Port 0 registers 0
-d 80860531 E8870SP Scalability Port 1 registers 0
-d 80860532 E8870SP Scalability Port 2 registers 0
-d 80860533 E8870SP Scalability Port 3 registers 0
-d 80860534 E8870SP Scalability Port 4 registers 0
-d 80860535 E8870SP Scalability Port 5 registers 0
-d 80860536 E8870SP Interleave registers 0 and 1 0 (bi-interleave 0) and global registers that are neither per-port nor per-interleave
-d 80860537 E8870SP Interleave registers 2 and 3 0 (bi-interleave 1)
-d 80860600 RAID Controller 0
-s 80860600808601c1 ICP Vortex GDT8546RZ 0
-s 80860600808601f7 SCRU32 0
-d 8086061f 80303 I/O Processor 0 uninitialized SRCU32 RAID Controller
-d 80860960 80960RP [i960 RP Microprocessor/Bridge] 0
-d 80860962 80960RM [i960RM Bridge] 0
-d 80860964 80960RP [i960 RP Microprocessor/Bridge] 0
-d 80861000 82542 Gigabit Ethernet Controller 0
-s 808610000e11b0df NC1632 Gigabit Ethernet Adapter (1000-SX) 0
-s 808610000e11b0e0 NC1633 Gigabit Ethernet Adapter (1000-LX) 0
-s 808610000e11b123 NC1634 Gigabit Ethernet Adapter (1000-SX) 0
-s 8086100010140119 Netfinity Gigabit Ethernet SX Adapter 0
-s 8086100080861000 PRO/1000 Gigabit Server Adapter 0
-d 80861001 82543GC Gigabit Ethernet Controller (Fiber) 0
-s 808610010e11004a NC6136 Gigabit Server Adapter 0
-s 80861001101401ea Netfinity Gigabit Ethernet SX Adapter 0
-s 8086100180861002 PRO/1000 F Server Adapter 0
-s 8086100180861003 PRO/1000 F Server Adapter 0
-d 80861002 Pro 100 LAN+Modem 56 Cardbus II 0
-s 808610028086200e Pro 100 LAN+Modem 56 Cardbus II 0
-s 8086100280862013 Pro 100 SR Mobile Combo Adapter 0
-s 8086100280862017 Pro 100 S Combo Mobile Adapter 0
-d 80861004 82543GC Gigabit Ethernet Controller (Copper) 0
-s 808610040e110049 NC7132 Gigabit Upgrade Module 0
-s 808610040e11b1a4 NC7131 Gigabit Server Adapter 0
-s 80861004101410f2 Gigabit Ethernet Server Adapter 0
-s 8086100480861004 PRO/1000 T Server Adapter 0
-s 8086100480862004 PRO/1000 T Server Adapter 0
-d 80861008 82544EI Gigabit Ethernet Controller (Copper) 0
-s 8086100810140269 iSeries 1000/100/10 Ethernet Adapter 0
-s 808610081028011c PRO/1000 XT Network Connection 0
-s 8086100880861107 PRO/1000 XT Server Adapter 0
-s 8086100880862107 PRO/1000 XT Server Adapter 0
-s 8086100880862110 PRO/1000 XT Server Adapter 0
-s 8086100880863108 PRO/1000 XT Network Connection 0
-d 80861009 82544EI Gigabit Ethernet Controller (Fiber) 0
-s 8086100910140268 iSeries Gigabit Ethernet Adapter 0
-s 8086100980861109 PRO/1000 XF Server Adapter 0
-s 8086100980862109 PRO/1000 XF Server Adapter 0
-d 8086100c 82544GC Gigabit Ethernet Controller (Copper) 0
-s 8086100c80861112 PRO/1000 T Desktop Adapter 0
-s 8086100c80862112 PRO/1000 T Desktop Adapter 0
-d 8086100d 82544GC Gigabit Ethernet Controller (LOM) 0
-s 8086100d10280123 PRO/1000 XT Network Connection 0
-s 8086100d1079891f 82544GC Based Network Connection 0
-s 8086100d4c531080 CT8 mainboard 0
-s 8086100d8086110d 82544GC Based Network Connection 0
-d 8086100e 82540EM Gigabit Ethernet Controller 0
-s 8086100e10140265 PRO/1000 MT Network Connection 0
-s 8086100e10140267 PRO/1000 MT Network Connection 0
-s 8086100e1014026a PRO/1000 MT Network Connection 0
-s 8086100e1028002e Optiplex GX260 0
-s 8086100e10280151 PRO/1000 MT Network Connection 0
-s 8086100e107b8920 PRO/1000 MT Desktop Adapter 0
-s 8086100e8086001e PRO/1000 MT Desktop Adapter 0
-s 8086100e8086002e PRO/1000 MT Desktop Adapter 0
-d 8086100f 82545EM Gigabit Ethernet Controller (Copper) 0
-s 8086100f10140269 iSeries 1000/100/10 Ethernet Adapter 0
-s 8086100f1014028e PRO/1000 MT Network Connection 0
-s 8086100f80861000 PRO/1000 MT Network Connection 0
-s 8086100f80861001 PRO/1000 MT Server Adapter 0
-d 80861010 82546EB Gigabit Ethernet Controller (Copper) 0
-s 808610101014027c PRO/1000 MT Dual Port Network Adapter 0
-s 8086101018fb7872 RESlink-X 0
-s 808610104c531080 CT8 mainboard 0
-s 808610104c5310a0 CA3/CR3 mainboard 0
-s 8086101080861011 PRO/1000 MT Dual Port Server Adapter 0
-s 808610108086101a PRO/1000 MT Dual Port Network Adapter 0
-s 8086101080863424 SE7501HG2 Mainboard 0
-d 80861011 82545EM Gigabit Ethernet Controller (Fiber) 0
-s 8086101110140268 iSeries Gigabit Ethernet Adapter 0
-s 8086101180861002 PRO/1000 MF Server Adapter 0
-s 8086101180861003 PRO/1000 MF Server Adapter (LX) 0
-d 80861012 82546EB Gigabit Ethernet Controller (Fiber) 0
-s 8086101280861012 PRO/1000 MF Dual Port Server Adapter 0
-d 80861013 82541EI Gigabit Ethernet Controller (Copper) 0
-s 8086101380860013 PRO/1000 MT Network Connection 0
-s 8086101380861013 IBM ThinkCentre Network Card 0
-s 8086101380861113 PRO/1000 MT Desktop Adapter 0
-d 80861014 82541ER Gigabit Ethernet Controller 0
-d 80861015 82540EM Gigabit Ethernet Controller (LOM) 0
-d 80861016 82540EP Gigabit Ethernet Controller (LOM) 0
-s 808610161014052c PRO/1000 MT Mobile Connection 0
-s 8086101611790001 PRO/1000 MT Mobile Connection 0
-s 8086101680861016 PRO/1000 MT Mobile Connection 0
-d 80861017 82540EP Gigabit Ethernet Controller (LOM) 0
-s 8086101780861017 PR0/1000 MT Desktop Connection 0
-d 80861018 82541EI Gigabit Ethernet Controller 0 Update controller name from 82541EP to 82541EI
-s 8086101880861018 PRO/1000 MT Desktop Adapter 0
-d 80861019 82547EI Gigabit Ethernet Controller (LOM) 0
-s 8086101914581019 GA-8IPE1000 Pro2 motherboard (865PE) 0
-s 8086101980861019 PRO/1000 CT Desktop Connection 0
-s 808610198086301f D865PERL mainboard 0
-s 8086101980863427 S875WP1-E mainboard 0
-d 8086101d 82546EB Gigabit Ethernet Controller 0
-s 8086101d80861000 PRO/1000 MT Quad Port Server Adapter 0
-d 8086101e 82540EP Gigabit Ethernet Controller (Mobile) 0
-s 8086101e10140549 PRO/1000 MT Mobile Connection 0
-s 8086101e11790001 PRO/1000 MT Mobile Connection 0
-s 8086101e8086101e PRO/1000 MT Mobile Connection 0
-d 80861026 82545GM Gigabit Ethernet Controller 0
-s 8086102680861000 PRO/1000 MT Server Connection 0
-s 8086102680861001 PRO/1000 MT Server Adapter 0
-s 8086102680861002 PRO/1000 MT Server Adapter 0
-s 8086102680861026 PRO/1000 MT Server Connection 0
-d 80861027 82545GM Gigabit Ethernet Controller 0
-s 8086102780861001 PRO/1000 MF Server Adapter(LX) 0
-s 8086102780861002 PRO/1000 MF Server Adapter(LX) 0
-s 8086102780861003 PRO/1000 MF Server Adapter(LX) 0
-s 8086102780861027 PRO/1000 MF Server Adapter 0
-d 80861028 82545GM Gigabit Ethernet Controller 0
-s 8086102880861028 PRO/1000 MB Server Adapter 0
-d 80861029 82559 Ethernet Controller 0
-d 80861030 82559 InBusiness 10/100 0
-d 80861031 82801CAM (ICH3) PRO/100 VE (LOM) Ethernet Controller 0
-s 8086103110140209 ThinkPad A/T/X Series 0
-s 80861031104d80e7 Vaio PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP 0
-s 80861031107b5350 EtherExpress PRO/100 VE 0
-s 8086103111790001 EtherExpress PRO/100 VE 0
-s 80861031144dc000 EtherExpress PRO/100 VE 0
-s 80861031144dc001 EtherExpress PRO/100 VE 0
-s 80861031144dc003 EtherExpress PRO/100 VE 0
-s 80861031144dc006 vpr Matrix 170B4 0
-d 80861032 82801CAM (ICH3) PRO/100 VE Ethernet Controller 0
-d 80861033 82801CAM (ICH3) PRO/100 VM (LOM) Ethernet Controller 0
-d 80861034 82801CAM (ICH3) PRO/100 VM Ethernet Controller 0
-d 80861035 82801CAM (ICH3)/82562EH (LOM) Ethernet Controller 0
-d 80861036 82801CAM (ICH3) 82562EH Ethernet Controller 0
-d 80861037 82801CAM (ICH3) Chipset Ethernet Controller 0
-d 80861038 82801CAM (ICH3) PRO/100 VM (KM) Ethernet Controller 0
-d 80861039 82801DB PRO/100 VE (LOM) Ethernet Controller 0
-s 8086103910140267 NetVista A30p 0
-d 8086103a 82801DB PRO/100 VE (CNR) Ethernet Controller 0
-d 8086103b 82801DB PRO/100 VM (LOM) Ethernet Controller 0
-d 8086103c 82801DB PRO/100 VM (CNR) Ethernet Controller 0
-d 8086103d 82801DB PRO/100 VE (MOB) Ethernet Controller 0
-d 8086103e 82801DB PRO/100 VM (MOB) Ethernet Controller 0
-d 80861040 536EP Data Fax Modem 0
-s 8086104016be1040 V.9X DSP Data Fax Modem 0
-d 80861043 PRO/Wireless LAN 2100 3B Mini PCI Adapter 0
-s 8086104380862527 MIM2000/Centrino 0
-d 80861048 PRO/10GbE LR Server Adapter 0
-s 808610488086a01f PRO/10GbE LR Server Adapter 0
-s 808610488086a11f PRO/10GbE LR Server Adapter 0
-d 80861050 82562EZ 10/100 Ethernet Controller 0
-s 808610501462728c 865PE Neo2 (MS-6728) 0
-s 808610501462758c MS-6758 (875P Neo) 0
-s 8086105080863427 S875WP1-E mainboard 0
-d 80861051 82801EB/ER (ICH5/ICH5R) integrated LAN Controller 0
-d 80861059 82551QM Ethernet Controller 0
-d 80861064 82562ET/EZ/GT/GZ - PRO/100 VE (LOM) Ethernet Controller 0 ICH-6 Component
-d 80861065 82562ET/EZ/GT/GZ - PRO/100 VE Ethernet Controller 0 ICH-6 Component
-d 80861066 82562 EM/EX/GX - PRO/100 VM (LOM) Ethernet Controller 0 ICH-6 Component
-d 80861067 82562 EM/EX/GX - PRO/100 VM Ethernet Controller 0 ICH-6 Component
-d 80861068 82562ET/EZ/GT/GZ - PRO/100 VE (LOM) Ethernet Controller Mobile 0 ICH-6 Component
-d 80861069 82562 EM/EX/GX - PRO/100 VM (LOM) Ethernet Controller Mobile 0 ICH-6 Component
-d 8086106a 82562G \t- PRO/100 VE (LOM) Ethernet Controller 0 ICH-6 Component
-d 8086106b 82562G \t- PRO/100 VE Ethernet Controller Mobile 0 ICH-6 Component
-d 80861075 82547GI Gigabit Ethernet Controller 0
-s 8086107510280165 PowerEdge 750 0
-s 8086107580860075 PRO/1000 CT Network Connection 0
-s 8086107580861075 PRO/1000 CT Network Connection 0
-d 80861076 82541GI/PI Gigabit Ethernet Controller 0
-s 8086107610280165 PowerEdge 750 0
-s 8086107680860076 PRO/1000 MT Network Connection 0
-s 8086107680861076 PRO/1000 MT Network Connection 0
-s 8086107680861176 PRO/1000 MT Desktop Adapter 0
-s 8086107680861276 PRO/1000 MT Desktop Adapter 0
-d 80861077 82541GI Gigabit Ethernet Controller 0
-s 8086107711790001 PRO/1000 MT Mobile Connection 0
-s 8086107780860077 PRO/1000 MT Mobile Connection 0
-s 8086107780861077 PRO/1000 MT Mobile Connection 0
-d 80861078 82541EI Gigabit Ethernet Controller 0
-s 8086107880861078 PRO/1000 MT Network Connection 0
-d 80861079 82546GB Gigabit Ethernet Controller 0
-s 80861079103c12a6 HP Dual Port 1000Base-T [A9900A] 0
-s 80861079103c12cf HP Core Dual Port 1000Base-T [AB352A] 0
-s 808610794c531090 Cx9 / Vx9 mainboard 0
-s 808610794c5310b0 CL9 mainboard 0
-s 8086107980860079 PRO/1000 MT Dual Port Network Connection 0
-s 8086107980861079 PRO/1000 MT Dual Port Network Connection 0
-s 8086107980861179 PRO/1000 MT Dual Port Network Connection 0
-s 808610798086117a PRO/1000 MT Dual Port Server Adapter 0
-d 8086107a 82546GB Gigabit Ethernet Controller 0
-s 8086107a103c12a8 HP Dual Port 1000base-SX [A9899A] 0
-s 8086107a8086107a PRO/1000 MF Dual Port Server Adapter 0
-s 8086107a8086127a PRO/1000 MF Dual Port Server Adapter 0
-d 8086107b 82546GB Gigabit Ethernet Controller 0
-s 8086107b8086007b PRO/1000 MB Dual Port Server Connection 0
-s 8086107b8086107b PRO/1000 MB Dual Port Server Connection 0
-d 80861107 PRO/1000 MF Server Adapter (LX) 0
-d 80861130 82815 815 Chipset Host Bridge and Memory Controller Hub 0
-s 8086113010251016 Travelmate 612 TX 0
-s 8086113010438027 TUSL2-C Mainboard 0
-s 80861130104d80df Vaio PCG-FX403 0
-s 8086113080864532 D815EEA2 mainboard 0
-s 8086113080864557 D815EGEW Mainboard 0
-d 80861131 82815 815 Chipset AGP Bridge 0
-d 80861132 82815 CGC [Chipset Graphics Controller] 0
-s 8086113210251016 Travelmate 612 TX 0
-s 80861132104d80df Vaio PCG-FX403 0
-s 8086113280864532 D815EEA2 Mainboard 0
-s 8086113280864557 D815EGEW Mainboard 0
-d 80861161 82806AA PCI64 Hub Advanced Programmable Interrupt Controller 0
-s 8086116180861161 82806AA PCI64 Hub APIC 0
-d 80861162 Xscale 80200 Big Endian Companion Chip 0
-d 80861200 Intel IXP1200 Network Processor 0
-s 80861200172a0000 AEP SSL Accelerator 0
-d 80861209 8255xER/82551IT Fast Ethernet Controller 0
-s 808612094c531050 CT7 mainboard 0
-s 808612094c531051 CE7 mainboard 0
-s 808612094c531070 PC6 mainboard 0
-d 80861221 82092AA PCI to PCMCIA Bridge 0
-d 80861222 82092AA IDE Controller 0
-d 80861223 SAA7116 0
-d 80861225 82452KX/GX [Orion] 0
-d 80861226 82596 PRO/10 PCI 0
-d 80861227 82865 EtherExpress PRO/100A 0
-d 80861228 82556 EtherExpress PRO/100 Smart 0
-d 80861229 82557/8/9 [Ethernet Pro 100] 0 the revision field differentiates between them (1-3 is 82557, 4-5 is 82558, 6-8 is 82559, 9 is 82559ER)
-s 808612290e113001 82559 Fast Ethernet LOM with Alert on LAN* 0
-s 808612290e113002 82559 Fast Ethernet LOM with Alert on LAN* 0
-s 808612290e113003 82559 Fast Ethernet LOM with Alert on LAN* 0
-s 808612290e113004 82559 Fast Ethernet LOM with Alert on LAN* 0
-s 808612290e113005 82559 Fast Ethernet LOM with Alert on LAN* 0
-s 808612290e113006 82559 Fast Ethernet LOM with Alert on LAN* 0
-s 808612290e113007 82559 Fast Ethernet LOM with Alert on LAN* 0
-s 808612290e11b01e NC3120 Fast Ethernet NIC 0
-s 808612290e11b01f NC3122 Fast Ethernet NIC (dual port) 0
-s 808612290e11b02f NC1120 Ethernet NIC 0
-s 808612290e11b04a Netelligent 10/100TX NIC with Wake on LAN 0
-s 808612290e11b0c6 NC3161 Fast Ethernet NIC (embedded, WOL) 0
-s 808612290e11b0c7 NC3160 Fast Ethernet NIC (embedded) 0
-s 808612290e11b0d7 NC3121 Fast Ethernet NIC (WOL) 0
-s 808612290e11b0dd NC3131 Fast Ethernet NIC (dual port) 0
-s 808612290e11b0de NC3132 Fast Ethernet Module (dual port) 0
-s 808612290e11b0e1 NC3133 Fast Ethernet Module (100-FX) 0
-s 808612290e11b134 NC3163 Fast Ethernet NIC (embedded, WOL) 0
-s 808612290e11b13c NC3162 Fast Ethernet NIC (embedded) 0
-s 808612290e11b144 NC3123 Fast Ethernet NIC (WOL) 0
-s 808612290e11b163 NC3134 Fast Ethernet NIC (dual port) 0
-s 808612290e11b164 NC3135 Fast Ethernet Upgrade Module (dual port) 0
-s 808612290e11b1a4 NC7131 Gigabit Server Adapter 0
-s 808612291014005c 82558B Ethernet Pro 10/100 0
-s 80861229101401bc 82559 Fast Ethernet LAN On Motherboard 0
-s 80861229101401f1 10/100 Ethernet Server Adapter 0
-s 80861229101401f2 10/100 Ethernet Server Adapter 0
-s 8086122910140207 Ethernet Pro/100 S 0
-s 8086122910140232 10/100 Dual Port Server Adapter 0
-s 808612291014023a ThinkPad R30 0
-s 808612291014105c Netfinity 10/100 0
-s 8086122910142205 ThinkPad A22p 0
-s 808612291014305c 10/100 EtherJet Management Adapter 0
-s 808612291014405c 10/100 EtherJet Adapter with Alert on LAN 0
-s 808612291014505c 10/100 EtherJet Secure Management Adapter 0
-s 808612291014605c 10/100 EtherJet Secure Management Adapter 0
-s 808612291014705c 10/100 Netfinity 10/100 Ethernet Security Adapter 0
-s 808612291014805c 10/100 Netfinity 10/100 Ethernet Security Adapter 0
-s 808612291028009b PowerEdge 2500/2550 0
-s 80861229102800ce PowerEdge 1400 0
-s 8086122910338000 PC-9821X-B06 0
-s 8086122910338016 PK-UG-X006 0
-s 808612291033801f PK-UG-X006 0
-s 8086122910338026 PK-UG-X006 0
-s 8086122910338063 82559-based Fast Ethernet Adapter 0
-s 8086122910338064 82559-based Fast Ethernet Adapter 0
-s 80861229103c10c0 NetServer 10/100TX 0
-s 80861229103c10c3 NetServer 10/100TX 0
-s 80861229103c10ca NetServer 10/100TX 0
-s 80861229103c10cb NetServer 10/100TX 0
-s 80861229103c10e3 NetServer 10/100TX 0
-s 80861229103c10e4 NetServer 10/100TX 0
-s 80861229103c1200 NetServer 10/100TX 0
-s 8086122910c31100 SmartEther100 SC1100 0
-s 8086122910cf1115 8255x-based Ethernet Adapter (10/100) 0
-s 8086122910cf1143 8255x-based Ethernet Adapter (10/100) 0
-s 8086122911790001 8255x-based Ethernet Adapter (10/100) 0
-s 8086122911790002 PCI FastEther LAN on Docker 0
-s 8086122911790003 8255x-based Fast Ethernet 0
-s 8086122912592560 AT-2560 100 0
-s 8086122912592561 AT-2560 100 FX Ethernet Adapter 0
-s 8086122912660001 NE10/100 Adapter 0
-s 8086122913e91000 6221L-4U 0
-s 80861229144d2501 SEM-2000 MiniPCI LAN Adapter 0
-s 80861229144d2502 SEM-2100IL MiniPCI LAN Adapter 0
-s 8086122916681100 EtherExpress PRO/100B (TX) (MiniPCI Ethernet+Modem) 0
-s 808612294c531080 CT8 mainboard 0
-s 8086122980860001 EtherExpress PRO/100B (TX) 0
-s 8086122980860002 EtherExpress PRO/100B (T4) 0
-s 8086122980860003 EtherExpress PRO/10+ 0
-s 8086122980860004 EtherExpress PRO/100 WfM 0
-s 8086122980860005 82557 10/100 0
-s 8086122980860006 82557 10/100 with Wake on LAN 0
-s 8086122980860007 82558 10/100 Adapter 0
-s 8086122980860008 82558 10/100 with Wake on LAN 0
-s 8086122980860009 EtherExpress PRO/100+ 0
-s 808612298086000a EtherExpress PRO/100+ Management Adapter 0
-s 808612298086000b EtherExpress PRO/100+ 0
-s 808612298086000c EtherExpress PRO/100+ Management Adapter 0
-s 808612298086000d EtherExpress PRO/100+ Alert On LAN II* Adapter 0
-s 808612298086000e EtherExpress PRO/100+ Management Adapter with Alert On LAN* 0
-s 808612298086000f EtherExpress PRO/100 Desktop Adapter 0
-s 8086122980860010 EtherExpress PRO/100 S Management Adapter 0
-s 8086122980860011 EtherExpress PRO/100 S Management Adapter 0
-s 8086122980860012 EtherExpress PRO/100 S Advanced Management Adapter (D) 0
-s 8086122980860013 EtherExpress PRO/100 S Advanced Management Adapter (E) 0
-s 8086122980860030 EtherExpress PRO/100 Management Adapter with Alert On LAN* GC 0
-s 8086122980860031 EtherExpress PRO/100 Desktop Adapter 0
-s 8086122980860040 EtherExpress PRO/100 S Desktop Adapter 0
-s 8086122980860041 EtherExpress PRO/100 S Desktop Adapter 0
-s 8086122980860042 EtherExpress PRO/100 Desktop Adapter 0
-s 8086122980860050 EtherExpress PRO/100 S Desktop Adapter 0
-s 8086122980861009 EtherExpress PRO/100+ Server Adapter 0
-s 808612298086100c EtherExpress PRO/100+ Server Adapter (PILA8470B) 0
-s 8086122980861012 EtherExpress PRO/100 S Server Adapter (D) 0
-s 8086122980861013 EtherExpress PRO/100 S Server Adapter (E) 0
-s 8086122980861015 EtherExpress PRO/100 S Dual Port Server Adapter 0
-s 8086122980861017 EtherExpress PRO/100+ Dual Port Server Adapter 0
-s 8086122980861030 EtherExpress PRO/100+ Management Adapter with Alert On LAN* G Server 0
-s 8086122980861040 EtherExpress PRO/100 S Server Adapter 0
-s 8086122980861041 EtherExpress PRO/100 S Server Adapter 0
-s 8086122980861042 EtherExpress PRO/100 Server Adapter 0
-s 8086122980861050 EtherExpress PRO/100 S Server Adapter 0
-s 8086122980861051 EtherExpress PRO/100 Server Adapter 0
-s 8086122980861052 EtherExpress PRO/100 Server Adapter 0
-s 80861229808610f0 EtherExpress PRO/100+ Dual Port Adapter 0
-s 8086122980862009 EtherExpress PRO/100 S Mobile Adapter 0
-s 808612298086200d EtherExpress PRO/100 Cardbus 0
-s 808612298086200e EtherExpress PRO/100 LAN+V90 Cardbus Modem 0
-s 808612298086200f EtherExpress PRO/100 SR Mobile Adapter 0
-s 8086122980862010 EtherExpress PRO/100 S Mobile Combo Adapter 0
-s 8086122980862013 EtherExpress PRO/100 SR Mobile Combo Adapter 0
-s 8086122980862016 EtherExpress PRO/100 S Mobile Adapter 0
-s 8086122980862017 EtherExpress PRO/100 S Combo Mobile Adapter 0
-s 8086122980862018 EtherExpress PRO/100 SR Mobile Adapter 0
-s 8086122980862019 EtherExpress PRO/100 SR Combo Mobile Adapter 0
-s 8086122980862101 EtherExpress PRO/100 P Mobile Adapter 0
-s 8086122980862102 EtherExpress PRO/100 SP Mobile Adapter 0
-s 8086122980862103 EtherExpress PRO/100 SP Mobile Adapter 0
-s 8086122980862104 EtherExpress PRO/100 SP Mobile Adapter 0
-s 8086122980862105 EtherExpress PRO/100 SP Mobile Adapter 0
-s 8086122980862106 EtherExpress PRO/100 P Mobile Adapter 0
-s 8086122980862107 EtherExpress PRO/100 Network Connection 0
-s 8086122980862108 EtherExpress PRO/100 Network Connection 0
-s 8086122980862200 EtherExpress PRO/100 P Mobile Combo Adapter 0
-s 8086122980862201 EtherExpress PRO/100 P Mobile Combo Adapter 0
-s 8086122980862202 EtherExpress PRO/100 SP Mobile Combo Adapter 0
-s 8086122980862203 EtherExpress PRO/100+ MiniPCI 0
-s 8086122980862204 EtherExpress PRO/100+ MiniPCI 0
-s 8086122980862205 EtherExpress PRO/100 SP Mobile Combo Adapter 0
-s 8086122980862206 EtherExpress PRO/100 SP Mobile Combo Adapter 0
-s 8086122980862207 EtherExpress PRO/100 SP Mobile Combo Adapter 0
-s 8086122980862208 EtherExpress PRO/100 P Mobile Combo Adapter 0
-s 8086122980862402 EtherExpress PRO/100+ MiniPCI 0
-s 8086122980862407 EtherExpress PRO/100+ MiniPCI 0
-s 8086122980862408 EtherExpress PRO/100+ MiniPCI 0
-s 8086122980862409 EtherExpress PRO/100+ MiniPCI 0
-s 808612298086240f EtherExpress PRO/100+ MiniPCI 0
-s 8086122980862410 EtherExpress PRO/100+ MiniPCI 0
-s 8086122980862411 EtherExpress PRO/100+ MiniPCI 0
-s 8086122980862412 EtherExpress PRO/100+ MiniPCI 0
-s 8086122980862413 EtherExpress PRO/100+ MiniPCI 0
-s 8086122980863000 82559 Fast Ethernet LAN on Motherboard 0
-s 8086122980863001 82559 Fast Ethernet LOM with Basic Alert on LAN* 0
-s 8086122980863002 82559 Fast Ethernet LOM with Alert on LAN II* 0
-s 8086122980863006 EtherExpress PRO/100 S Network Connection 0
-s 8086122980863007 EtherExpress PRO/100 S Network Connection 0
-s 8086122980863008 EtherExpress PRO/100 Network Connection 0
-s 8086122980863010 EtherExpress PRO/100 S Network Connection 0
-s 8086122980863011 EtherExpress PRO/100 S Network Connection 0
-s 8086122980863012 EtherExpress PRO/100 Network Connection 0
-s 8086122980863411 SDS2 Mainboard 0
-d 8086122d 430FX - 82437FX TSC [Triton I] 0
-d 8086122e 82371FB PIIX ISA [Triton I] 0
-d 80861230 82371FB PIIX IDE [Triton I] 0
-d 80861231 DSVD Modem 0
-d 80861234 430MX - 82371MX Mobile PCI I/O IDE Xcelerator (MPIIX) 0
-d 80861235 430MX - 82437MX Mob. System Ctrlr (MTSC) & 82438MX Data Path (MTDP) 0
-d 80861237 440FX - 82441FX PMC [Natoma] 0
-d 80861239 82371FB PIIX IDE Interface 0
-d 8086123b 82380PB PCI to PCI Docking Bridge 0
-d 8086123c 82380AB (MISA) Mobile PCI-to-ISA Bridge 0
-d 8086123d 683053 Programmable Interrupt Device 0
-d 8086123e 82466GX (IHPC) Integrated Hot-Plug Controller 0 in" hidden" mode
-d 8086123f 82466GX Integrated Hot-Plug Controller (IHPC) 0
-d 80861240 82752 (752) AGP Graphics Accelerator 0
-d 8086124b 82380FB (MPCI2) Mobile Docking Controller 0
-d 80861250 430HX - 82439HX TXC [Triton II] 0
-d 80861360 82806AA PCI64 Hub PCI Bridge 0
-d 80861361 82806AA PCI64 Hub Controller (HRes) 0
-s 8086136180861361 82806AA PCI64 Hub Controller (HRes) 0
-s 8086136180868000 82806AA PCI64 Hub Controller (HRes) 0
-d 80861460 82870P2 P64H2 Hub PCI Bridge 0
-d 80861461 82870P2 P64H2 I/OxAPIC 0
-s 8086146115d93480 P4DP6 0
-s 808614614c531090 Cx9 / Vx9 mainboard 0
-d 80861462 82870P2 P64H2 Hot Plug Controller 0
-d 80861960 80960RP [i960RP Microprocessor] 0
-s 80861960101e0431 MegaRAID 431 RAID Controller 0
-s 80861960101e0438 MegaRAID 438 Ultra2 LVD RAID Controller 0
-s 80861960101e0466 MegaRAID 466 Express Plus RAID Controller 0
-s 80861960101e0467 MegaRAID 467 Enterprise 1500 RAID Controller 0
-s 80861960101e0490 MegaRAID 490 Express 300 RAID Controller 0
-s 80861960101e0762 MegaRAID 762 Express RAID Controller 0
-s 80861960101e09a0 PowerEdge Expandable RAID Controller 2/SC 0
-s 8086196010280467 PowerEdge Expandable RAID Controller 2/DC 0
-s 8086196010281111 PowerEdge Expandable RAID Controller 2/SC 0
-s 80861960103c03a2 MegaRAID 0
-s 80861960103c10c6 MegaRAID 438, HP NetRAID-3Si 0
-s 80861960103c10c7 MegaRAID T5, Integrated HP NetRAID 0
-s 80861960103c10cc MegaRAID, Integrated HP NetRAID 0
-s 80861960103c10cd HP NetRAID-1Si 0
-s 80861960105a0000 SuperTrak 0
-s 80861960105a2168 SuperTrak Pro 0
-s 80861960105a5168 SuperTrak66/100 0
-s 8086196011111111 MegaRAID 466, PowerEdge Expandable RAID Controller 2/SC 0
-s 8086196011111112 PowerEdge Expandable RAID Controller 2/SC 0
-s 80861960113c03a2 MegaRAID 0
-s 80861960e4bf1010 CG1-RADIO 0
-s 80861960e4bf1020 CU2-QUARTET 0
-s 80861960e4bf1040 CU1-CHORUS 0
-s 80861960e4bf3100 CX1-BAND 0
-d 80861962 80960RM [i960RM Microprocessor] 0
-s 80861962105a0000 SuperTrak SX6000 I2O CPU 0
-d 80861a21 82840 840 (Carmel) Chipset Host Bridge (Hub A) 0
-d 80861a23 82840 840 (Carmel) Chipset AGP Bridge 0
-d 80861a24 82840 840 (Carmel) Chipset PCI Bridge (Hub B) 0
-d 80861a30 82845 845 (Brookdale) Chipset Host Bridge 0
-s 80861a301028010e Optiplex GX240 0
-d 80861a31 82845 845 (Brookdale) Chipset AGP Bridge 0
-d 80862410 82801AA ISA Bridge (LPC) 0
-d 80862411 82801AA IDE 0
-d 80862412 82801AA USB 0
-d 80862413 82801AA SMBus 0
-d 80862415 82801AA AC'97 Audio 0
-s 8086241510280095 Precision Workstation 220 Integrated Digital Audio 0
-s 8086241511d40040 SoundMAX Integrated Digital Audio 0
-s 8086241511d40048 SoundMAX Integrated Digital Audio 0
-s 8086241511d45340 SoundMAX Integrated Digital Audio 0
-d 80862416 82801AA AC'97 Modem 0
-d 80862418 82801AA PCI Bridge 0
-d 80862420 82801AB ISA Bridge (LPC) 0
-d 80862421 82801AB IDE 0
-d 80862422 82801AB USB 0
-d 80862423 82801AB SMBus 0
-d 80862425 82801AB AC'97 Audio 0
-s 8086242511d40040 SoundMAX Integrated Digital Audio 0
-s 8086242511d40048 SoundMAX Integrated Digital Audio 0
-d 80862426 82801AB AC'97 Modem 0
-d 80862428 82801AB PCI Bridge 0
-d 80862440 82801BA ISA Bridge (LPC) 0
-d 80862442 82801BA/BAM USB (Hub #1) 0
-s 80862442101401c6 Netvista A40/A40p 0
-s 8086244210251016 Travelmate 612 TX 0
-s 808624421028010e Optiplex GX240 0
-s 8086244210438027 TUSL2-C Mainboard 0
-s 80862442104d80df Vaio PCG-FX403 0
-s 80862442147b0507 TH7II-RAID 0
-s 8086244280864532 D815EEA2 mainboard 0
-s 8086244280864557 D815EGEW Mainboard 0
-d 80862443 82801BA/BAM SMBus 0
-s 80862443101401c6 Netvista A40/A40p 0
-s 8086244310251016 Travelmate 612 TX 0
-s 808624431028010e Optiplex GX240 0
-s 8086244310438027 TUSL2-C Mainboard 0
-s 80862443104d80df Vaio PCG-FX403 0
-s 80862443147b0507 TH7II-RAID 0
-s 8086244380864532 D815EEA2 mainboard 0
-s 8086244380864557 D815EGEW Mainboard 0
-d 80862444 82801BA/BAM USB (Hub #2) 0
-s 8086244410251016 Travelmate 612 TX 0
-s 808624441028010e Optiplex GX240 0
-s 8086244410438027 TUSL2-C Mainboard 0
-s 80862444104d80df Vaio PCG-FX403 0
-s 80862444147b0507 TH7II-RAID 0
-s 8086244480864532 D815EEA2 mainboard 0
-d 80862445 82801BA/BAM AC'97 Audio 0
-s 80862445101401c6 Netvista A40/A40p 0
-s 8086244510251016 Travelmate 612 TX 0
-s 80862445104d80df Vaio PCG-FX403 0
-s 8086244514623370 STAC9721 AC 0
-s 80862445147b0507 TH7II-RAID 0
-s 8086244580864557 D815EGEW Mainboard 0
-d 80862446 82801BA/BAM AC'97 Modem 0
-s 8086244610251016 Travelmate 612 TX 0
-s 80862446104d80df Vaio PCG-FX403 0
-d 80862448 82801 Mobile PCI Bridge 0
-d 80862449 82801BA/BAM/CA/CAM Ethernet Controller 0
-s 808624490e110012 EtherExpress PRO/100 VM 0
-s 808624490e110091 EtherExpress PRO/100 VE 0
-s 80862449101401ce EtherExpress PRO/100 VE 0
-s 80862449101401dc EtherExpress PRO/100 VE 0
-s 80862449101401eb EtherExpress PRO/100 VE 0
-s 80862449101401ec EtherExpress PRO/100 VE 0
-s 8086244910140202 EtherExpress PRO/100 VE 0
-s 8086244910140205 EtherExpress PRO/100 VE 0
-s 8086244910140217 EtherExpress PRO/100 VE 0
-s 8086244910140234 EtherExpress PRO/100 VE 0
-s 808624491014023d EtherExpress PRO/100 VE 0
-s 8086244910140244 EtherExpress PRO/100 VE 0
-s 8086244910140245 EtherExpress PRO/100 VE 0
-s 8086244910140265 PRO/100 VE Desktop Connection 0
-s 8086244910140267 PRO/100 VE Desktop Connection 0
-s 808624491014026a PRO/100 VE Desktop Connection 0
-s 80862449109f315d EtherExpress PRO/100 VE 0
-s 80862449109f3181 EtherExpress PRO/100 VE 0
-s 808624491179ff01 PRO/100 VE Network Connection 0
-s 8086244911867801 EtherExpress PRO/100 VE 0
-s 80862449144d2602 HomePNA 1M CNR 0
-s 8086244980863010 EtherExpress PRO/100 VE 0
-s 8086244980863011 EtherExpress PRO/100 VM 0
-s 8086244980863012 82562EH based Phoneline 0
-s 8086244980863013 EtherExpress PRO/100 VE 0
-s 8086244980863014 EtherExpress PRO/100 VM 0
-s 8086244980863015 82562EH based Phoneline 0
-s 8086244980863016 EtherExpress PRO/100 P Mobile Combo 0
-s 8086244980863017 EtherExpress PRO/100 P Mobile 0
-s 8086244980863018 EtherExpress PRO/100 0
-d 8086244a 82801BAM IDE U100 0
-s 8086244a10251016 Travelmate 612TX 0
-s 8086244a104d80df Vaio PCG-FX403 0
-d 8086244b 82801BA IDE U100 0
-s 8086244b101401c6 Netvista A40/A40p 0
-s 8086244b1028010e Optiplex GX240 0
-s 8086244b10438027 TUSL2-C Mainboard 0
-s 8086244b147b0507 TH7II-RAID 0
-s 8086244b80864532 D815EEA2 mainboard 0
-s 8086244b80864557 D815EGEW Mainboard 0
-d 8086244c 82801BAM ISA Bridge (LPC) 0
-d 8086244e 82801 PCI Bridge 0
-s 8086244e10140267 NetVista A30p 0
-d 80862450 82801E ISA Bridge (LPC) 0
-d 80862452 82801E USB 0
-d 80862453 82801E SMBus 0
-d 80862459 82801E Ethernet Controller 0 0
-d 8086245b 82801E IDE U100 0
-d 8086245d 82801E Ethernet Controller 1 0
-d 8086245e 82801E PCI Bridge 0
-d 80862480 82801CA LPC Interface Controller 0
-d 80862482 82801CA/CAM USB (Hub #1) 0
-s 8086248210140220 ThinkPad A/T/X Series 0
-s 80862482104d80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP 0
-s 8086248215d93480 P4DP6 0
-s 8086248280861958 vpr Matrix 170B4 0
-s 8086248280863424 SE7501HG2 Mainboard 0
-s 8086248280864541 Latitude C640 0
-d 80862483 82801CA/CAM SMBus Controller 0
-s 8086248310140220 ThinkPad A/T/X Series 0
-s 80862483104d80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP 0
-s 8086248315d93480 P4DP6 0
-s 8086248380861958 vpr Matrix 170B4 0
-d 80862484 82801CA/CAM USB (Hub #2) 0
-s 8086248410140220 ThinkPad A/T/X Series 0
-s 80862484104d80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP 0
-s 8086248415d93480 P4DP6 0
-s 8086248480861958 vpr Matrix 170B4 0
-d 80862485 82801CA/CAM AC'97 Audio Controller 0
-s 8086248510135959 Crystal WMD Audio Codec 0
-s 8086248510140222 ThinkPad T23 (2647-4MG) or A30/A30p (2652/2653) 0
-s 8086248510140508 ThinkPad T30 0
-s 808624851014051c ThinkPad A/T/X Series 0
-s 80862485104d80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP 0
-s 80862485144dc006 vpr Matrix 170B4 0
-d 80862486 82801CA/CAM AC'97 Modem Controller 0
-s 8086248610140223 ThinkPad A/T/X Series 0
-s 8086248610140503 ThinkPad R31 2656BBG 0
-s 808624861014051a ThinkPad A/T/X Series 0
-s 80862486101f1025 Acer 620 Series 0
-s 80862486104d80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP 0
-s 8086248611790001 Toshiba Satellite 1110 Z15 internal Modem 0
-s 80862486134d4c21 Dell Inspiron 2100 internal modem 0
-s 80862486144d2115 vpr Matrix 170B4 internal modem 0
-s 8086248614f15421 MD56ORD V.92 MDC Modem 0
-d 80862487 82801CA/CAM USB (Hub #3) 0
-s 8086248710140220 ThinkPad A/T/X Series 0
-s 80862487104d80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP 0
-s 8086248715d93480 P4DP6 0
-s 8086248780861958 vpr Matrix 170B4 0
-d 8086248a 82801CAM IDE U100 0
-s 8086248a10140220 ThinkPad A/T/X Series 0
-s 8086248a104d80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP 0
-s 8086248a80861958 vpr Matrix 170B4 0
-s 8086248a80864541 Latitude C640 0
-d 8086248b 82801CA Ultra ATA Storage Controller 0
-s 8086248b15d93480 P4DP6 0
-d 8086248c 82801CAM ISA Bridge (LPC) 0
-d 808624c0 82801DB/DBL (ICH4/ICH4-L) LPC Interface Bridge 0
-s 808624c010140267 NetVista A30p 0
-s 808624c014625800 845PE Max (MS-6580) 0
-d 808624c1 82801DBL (ICH4-L) IDE Controller 0
-d 808624c2 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 0
-s 808624c210140267 NetVista A30p 0
-s 808624c21025005a TravelMate 290 0
-s 808624c210280126 Optiplex GX260 0
-s 808624c210280163 Latitude D505 0
-s 808624c2103c0890 NC6000 laptop 0
-s 808624c210718160 MIM2000 0
-s 808624c214625800 845PE Max (MS-6580) 0
-s 808624c215092990 Averatec 5110H laptop 0
-s 808624c24c531090 Cx9 / Vx9 mainboard 0
-d 808624c3 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) SMBus Controller 0
-s 808624c310140267 NetVista A30p 0
-s 808624c31025005a TravelMate 290 0
-s 808624c310280126 Optiplex GX260 0
-s 808624c3103c0890 NC6000 laptop 0
-s 808624c310718160 MIM2000 0
-s 808624c3145824c2 GA-8PE667 Ultra 0
-s 808624c314625800 845PE Max (MS-6580) 0
-s 808624c34c531090 Cx9 / Vx9 mainboard 0
-d 808624c4 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2 0
-s 808624c410140267 NetVista A30p 0
-s 808624c41025005a TravelMate 290 0
-s 808624c410280126 Optiplex GX260 0
-s 808624c410280163 Latitude D505 0
-s 808624c4103c0890 NC6000 laptop 0
-s 808624c410718160 MIM2000 0
-s 808624c414625800 845PE Max (MS-6580) 0
-s 808624c415092990 Averatec 5110H 0
-s 808624c44c531090 Cx9 / Vx9 mainboard 0
-d 808624c5 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller 0
-s 808624c50e1100b8 Analog Devices Inc. codec [SoundMAX] 0
-s 808624c510140267 NetVista A30p 0
-s 808624c51025005a TravelMate 290 0
-s 808624c510280163 Latitude D505 0
-s 808624c5103c0890 NC6000 laptop 0
-s 808624c510718160 MIM2000 0
-s 808624c51458a002 GA-8PE667 Ultra 0
-s 808624c514625800 845PE Max (MS-6580) 0
-d 808624c6 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Modem Controller 0
-s 808624c61025005a TravelMate 290 0
-s 808624c6103c0890 NC6000 laptop 0
-s 808624c610718160 MIM2000 0
-d 808624c7 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3 0
-s 808624c710140267 NetVista A30p 0
-s 808624c71025005a TravelMate 290 0
-s 808624c710280126 Optiplex GX260 0
-s 808624c710280163 Latitude D505 0
-s 808624c7103c0890 NC6000 laptop 0
-s 808624c710718160 MIM2000 0
-s 808624c714625800 845PE Max (MS-6580) 0
-s 808624c715092990 Averatec 5110H 0
-s 808624c74c531090 Cx9 / Vx9 mainboard 0
-d 808624ca 82801DBM (ICH4-M) IDE Controller 0
-s 808624ca1025005a TravelMate 290 0
-s 808624ca10280163 Latitude D505 0
-s 808624ca103c0890 NC6000 laptop 0
-s 808624ca10718160 MIM2000 0
-d 808624cb 82801DB (ICH4) IDE Controller 0
-s 808624cb10140267 NetVista A30p 0
-s 808624cb10280126 Optiplex GX260 0
-s 808624cb145824c2 GA-8PE667 Ultra 0
-s 808624cb14625800 845PE Max (MS-6580) 0
-s 808624cb4c531090 Cx9 / Vx9 mainboard 0
-d 808624cc 82801DBM (ICH4-M) LPC Interface Bridge 0
-d 808624cd 82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller 0
-s 808624cd10140267 NetVista A30p 0
-s 808624cd1025005a TravelMate 290 0
-s 808624cd10280126 Optiplex GX260 0
-s 808624cd10280163 Latitude D505 0
-s 808624cd103c0890 NC6000 laptop 0
-s 808624cd10718160 MIM2000 0
-s 808624cd14623981 845PE Max (MS-6580) 0
-s 808624cd15091968 Averatec 5110H 0
-s 808624cd4c531090 Cx9 / Vx9 mainboard 0
-d 808624d0 82801EB/ER (ICH5/ICH5R) LPC Interface Bridge 0
-d 808624d1 82801EB (ICH5) SATA Controller 0
-s 808624d1103c12bc d530 CMT (DG746A) 0
-s 808624d1145824d1 GA-8IPE1000 Pro2 motherboard (865PE) 0
-s 808624d114627280 865PE Neo2 (MS-6728) 0
-s 808624d180863427 S875WP1-E mainboard 0
-s 808624d18086524c D865PERL mainboard 0
-d 808624d2 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #1 0
-s 808624d2103c12bc d530 CMT (DG746A) 0
-s 808624d2104380a6 P4P800 Mainboard 0
-s 808624d2145824d2 GA-8KNXP motherboard (875P) 0
-s 808624d214627280 865PE Neo2 (MS-6728) 0
-s 808624d280863427 S875WP1-E mainboard 0
-s 808624d28086524c D865PERL mainboard 0
-d 808624d3 82801EB/ER (ICH5/ICH5R) SMBus Controller 0
-s 808624d3104380a6 P4P800 Mainboard 0
-s 808624d3145824d2 GA-8IPE1000 Pro2 motherboard (865PE) 0
-s 808624d314627280 865PE Neo2 (MS-6728) 0
-s 808624d380863427 S875WP1-E mainboard 0
-s 808624d38086524c D865PERL mainboard 0
-d 808624d4 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #2 0
-s 808624d4103c12bc d530 CMT (DG746A) 0
-s 808624d4104380a6 P4P800 Mainboard 0
-s 808624d4145824d2 GA-8IPE1000 Pro2 motherboard (865PE) 0
-s 808624d414627280 865PE Neo2 (MS-6728) 0
-s 808624d480863427 S875WP1-E mainboard 0
-s 808624d48086524c D865PERL mainboard 0
-d 808624d5 82801EB/ER (ICH5/ICH5R) AC'97 Audio Controller 0
-s 808624d5103c12bc Analog Devices codec [SoundMAX Integrated Digital Audio] 0
-s 808624d5104380f3 P4P800 Mainboard 0
-s 808624d51458a002 GA-8KNXP motherboard (875P) 0
-s 808624d514627280 865PE Neo2 (MS-6728) 0
-s 808624d58086a000 D865PERL mainboard 0
-d 808624d6 82801EB/ER (ICH5/ICH5R) AC'97 Modem Controller 0
-d 808624d7 82801EB/ER (ICH5/ICH5R) USB UHCI #3 0
-s 808624d7103c12bc d530 CMT (DG746A) 0
-s 808624d7104380a6 P4P800 Mainboard 0
-s 808624d7145824d2 GA-8IPE1000 Pro2 motherboard (865PE) 0
-s 808624d714627280 865PE Neo2 (MS-6728) 0
-s 808624d780863427 S875WP1-E mainboard 0
-s 808624d78086524c D865PERL mainboard 0
-d 808624db 82801EB/ER (ICH5/ICH5R) IDE Controller 0
-s 808624db103c12bc d530 CMT (DG746A) 0
-s 808624db104380a6 P4P800 Mainboard 0
-s 808624db145824d2 GA-8IPE1000 Pro2 motherboard (865PE) 0
-s 808624db14627280 865PE Neo2 (MS-6728) 0
-s 808624db14627580 MSI 875P 0
-s 808624db80863427 S875WP1-E mainboard 0
-s 808624db8086524c D865PERL mainboard 0
-d 808624dc 82801EB (ICH5) LPC Interface Bridge 0
-d 808624dd 82801EB/ER (ICH5/ICH5R) USB2 EHCI Controller 0
-s 808624dd103c12bc d530 CMT (DG746A) 0
-s 808624dd104380a6 P4P800 Mainboard 0
-s 808624dd14585006 GA-8IPE1000 Pro2 motherboard (865PE) 0
-s 808624dd14627280 865PE Neo2 (MS-6728) 0
-s 808624dd80863427 S875WP1-E mainboard 0
-s 808624dd8086524c D865PERL mainboard 0
-d 808624de 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #4 0
-s 808624de104380a6 P4P800 Mainboard 0
-s 808624de145824d2 GA-8IPE1000 Pro2 motherboard (865PE) 0
-s 808624de14627280 865PE Neo2 (MS-6728) 0
-s 808624de80863427 S875WP1-E mainboard 0
-s 808624de8086524c D865PERL mainboard 0
-d 808624df 82801ER (ICH5R) SATA Controller 0
-d 80862500 82820 820 (Camino) Chipset Host Bridge (MCH) 0
-s 8086250010280095 Precision Workstation 220 Chipset 0
-s 808625001043801c P3C-2000 system chipset 0
-d 80862501 82820 820 (Camino) Chipset Host Bridge (MCH) 0
-s 808625011043801c P3C-2000 system chipset 0
-d 8086250b 82820 820 (Camino) Chipset Host Bridge 0
-d 8086250f 82820 820 (Camino) Chipset AGP Bridge 0
-d 80862520 82805AA MTH Memory Translator Hub 0
-d 80862521 82804AA MRH-S Memory Repeater Hub for SDRAM 0
-d 80862530 82850 850 (Tehama) Chipset Host Bridge (MCH) 0
-s 80862530147b0507 TH7II-RAID 0
-d 80862531 82860 860 (Wombat) Chipset Host Bridge (MCH) 0
-d 80862532 82850 850 (Tehama) Chipset AGP Bridge 0
-d 80862533 82860 860 (Wombat) Chipset AGP Bridge 0
-d 80862534 82860 860 (Wombat) Chipset PCI Bridge 0
-d 80862540 E7500 Memory Controller Hub 0
-s 8086254015d93480 P4DP6 0
-d 80862541 E7500/E7501 Host RASUM Controller 0
-s 8086254115d93480 P4DP6 0
-s 808625414c531090 Cx9 / Vx9 mainboard 0
-s 8086254180863424 SE7501HG2 Mainboard 0
-d 80862543 E7500/E7501 Hub Interface B PCI-to-PCI Bridge 0
-d 80862544 E7500/E7501 Hub Interface B RASUM Controller 0
-s 808625444c531090 Cx9 / Vx9 mainboard 0
-d 80862545 E7500/E7501 Hub Interface C PCI-to-PCI Bridge 0
-d 80862546 E7500/E7501 Hub Interface C RASUM Controller 0
-d 80862547 E7500/E7501 Hub Interface D PCI-to-PCI Bridge 0
-d 80862548 E7500/E7501 Hub Interface D RASUM Controller 0
-d 8086254c E7501 Memory Controller Hub 0
-s 8086254c4c531090 Cx9 / Vx9 mainboard 0
-s 8086254c80863424 SE7501HG2 Mainboard 0
-d 80862550 E7505 Memory Controller Hub 0
-d 80862551 E7505/E7205 Series RAS Controller 0
-d 80862552 E7505/E7205 PCI-to-AGP Bridge 0
-d 80862553 E7505 Hub Interface B PCI-to-PCI Bridge 0
-d 80862554 E7505 Hub Interface B PCI-to-PCI Bridge RAS Controller 0
-d 8086255d E7205 Memory Controller Hub 0
-d 80862560 82845G/GL[Brookdale-G]/GE/PE DRAM Controller/Host-Hub Interface 0
-s 8086256010280126 Optiplex GX260 0
-s 8086256014582560 GA-8PE667 Ultra 0
-s 8086256014625800 845PE Max (MS-6580) 0
-d 80862561 82845G/GL[Brookdale-G]/GE/PE Host-to-AGP Bridge 0
-d 80862562 82845G/GL[Brookdale-G]/GE Chipset Integrated Graphics Device 0
-s 8086256210140267 NetVista A30p 0
-d 80862570 82865G/PE/P DRAM Controller/Host-Hub Interface 0
-s 80862570104380f2 P4P800 Mainboard 0
-s 8086257014582570 GA-8IPE1000 Pro2 motherboard (865PE) 0
-d 80862571 82865G/PE/P PCI to AGP Controller 0
-d 80862572 82865G Integrated Graphics Device 0
-d 80862573 82865G/PE/P PCI to CSA Bridge 0
-d 80862576 82865G/PE/P Processor to I/O Memory Interface 0
-d 80862578 82875P/E7210 Memory Controller Hub 0
-s 8086257814582578 GA-8KNXP motherboard (875P) 0
-s 8086257814627580 MS-6758 (875P Neo) 0
-s 8086257815d94580 Super Micro Computer Inc. P4SCE 0 Motherboard P4SCE
-d 80862579 82875P Processor to AGP Controller 0
-d 8086257b 82875P/E7210 Processor to PCI to CSA Bridge 0
-d 8086257e 82875P/E7210 Processor to I/O Memory Interface 0
-d 80862580 915G/P/GV Processor to I/O Controller 0
-d 80862581 915G/P/GV PCI Express Root Port 0
-d 80862582 82915G Express Chipset Family Graphics Controller 0
-s 8086258210281079 Optiplex GX280 0
-d 80862584 925X/XE Memory Controller Hub 0
-d 80862585 925X/XE PCI Express Root Port 0
-d 80862588 E7220/E7221 Memory Controller Hub 0
-d 80862589 E7220/E7221 PCI Express Root Port 0
-d 8086258a E7221 Integrated Graphics Controller 0
-d 80862590 Mobile Memory Controller Hub 0
-d 80862591 Mobile Memory Controller Hub PCI Express Port 0
-d 80862592 Mobile Graphics Controller 0
-d 808625a1 6300ESB LPC Interface Controller 0
-d 808625a2 6300ESB PATA Storage Controller 0
-s 808625a24c5310b0 CL9 mainboard 0
-d 808625a3 6300ESB SATA Storage Controller 0
-s 808625a34c5310b0 CL9 mainboard 0
-d 808625a4 6300ESB SMBus Controller 0
-s 808625a44c5310b0 CL9 mainboard 0
-d 808625a6 6300ESB AC'97 Audio Controller 0
-s 808625a64c5310b0 CL9 mainboard 0
-d 808625a7 6300ESB AC'97 Modem Controller 0
-d 808625a9 6300ESB USB Universal Host Controller 0
-s 808625a94c5310b0 CL9 mainboard 0
-d 808625aa 6300ESB USB Universal Host Controller 0
-s 808625aa4c5310b0 CL9 mainboard 0
-d 808625ab 6300ESB Watchdog Timer 0
-s 808625ab4c5310b0 CL9 mainboard 0
-d 808625ac 6300ESB I/O Advanced Programmable Interrupt Controller 0
-s 808625ac4c5310b0 CL9 mainboard 0
-d 808625ad 6300ESB USB2 Enhanced Host Controller 0
-d 808625ae 6300ESB 64-bit PCI-X Bridge 0
-d 808625b0 6300ESB SATA RAID Controller 0
-d 80862600 Server Hub Interface 0
-d 80862601 Server Hub PCI Express x4 Port D 0
-d 80862602 Server Hub PCI Express x4 Port C0 0
-d 80862603 Server Hub PCI Express x4 Port C1 0
-d 80862604 Server Hub PCI Express x4 Port B0 0
-d 80862605 Server Hub PCI Express x4 Port B1 0
-d 80862606 Server Hub PCI Express x4 Port A0 0
-d 80862607 Server Hub PCI Express x4 Port A1 0
-d 80862608 Server Hub PCI Express x8 Port C 0
-d 80862609 Server Hub PCI Express x8 Port B 0
-d 8086260a Server Hub PCI Express x8 Port A 0
-d 8086260c Server Hub IMI Registers 0
-d 80862610 Server Hub System Bus, Boot, and Interrupt Registers 0
-d 80862611 Server Hub Address Mapping Registers 0
-d 80862612 Server Hub RAS Registers 0
-d 80862613 Server Hub Reserved Registers 0
-d 80862614 Server Hub Reserved Registers 0
-d 80862615 Server Hub Miscellaneous Registers 0
-d 80862617 Server Hub Reserved Registers 0
-d 80862618 Server Hub Reserved Registers 0
-d 80862619 Server Hub Reserved Registers 0
-d 8086261a Server Hub Reserved Registers 0
-d 8086261b Server Hub Reserved Registers 0
-d 8086261c Server Hub Reserved Registers 0
-d 8086261d Server Hub Reserved Registers 0
-d 8086261e Server Hub Reserved Registers 0
-d 80862620 External Memory Bridge 0
-d 80862621 External Memory Bridge Control Registers 0
-d 80862622 External Memory Bridge Memory Interleaving Registers 0
-d 80862623 External Memory Bridge DDR Initialization and Calibration 0
-d 80862624 External Memory Bridge Reserved Registers 0
-d 80862625 External Memory Bridge Reserved Registers 0
-d 80862626 External Memory Bridge Reserved Registers 0
-d 80862627 External Memory Bridge Reserved Registers 0
-d 80862640 82801FB/FR (ICH6/ICH6R) LPC Interface Bridge 0
-d 80862641 82801FBM (ICH6M) LPC Interface Bridge 0
-d 80862642 82801FW/FRW (ICH6W/ICH6RW) LPC Interface Bridge 0
-d 80862651 82801FB/FW (ICH6/ICH6W) SATA Controller 0
-s 8086265110280179 Optiplex GX280 0
-d 80862652 82801FR/FRW (ICH6R/ICH6RW) SATA Controller 0
-d 80862653 82801FBM (ICH6M) SATA Controller 0
-d 80862658 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #1 0
-s 8086265810280179 Optiplex GX280 0
-d 80862659 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #2 0
-s 8086265910280179 Optiplex GX280 0
-d 8086265a 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #3 0
-s 8086265a10280179 Optiplex GX280 0
-d 8086265b 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #4 0
-s 8086265b10280179 Optiplex GX280 0
-d 8086265c 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB2 EHCI Controller 0
-s 8086265c10280179 Optiplex GX280 0
-d 80862660 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 1 0
-d 80862662 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 2 0
-d 80862664 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 3 0
-d 80862666 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 4 0
-d 80862668 82801FB/FBM/FR/FW/FRW (ICH6 Family) High Definition Audio Controller 0
-d 8086266a 82801FB/FBM/FR/FW/FRW (ICH6 Family) SMBus Controller 0
-s 8086266a10280179 Optiplex GX280 0
-d 8086266c 82801FB/FBM/FR/FW/FRW (ICH6 Family) LAN Controller 0
-d 8086266d 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Modem Controller 0
-d 8086266e 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller 0
-s 8086266e10280179 Optiplex GX280 0
-d 8086266f 82801FB/FBM/FR/FW/FRW (ICH6 Family) IDE Controller 0
-d 80862782 82915G Express Chipset Family Graphics Controller 0
-d 80862792 Mobile Graphics Controller 0
-d 80863092 Integrated RAID 0
-d 80863200 GD31244 PCI-X SATA HBA 0
-d 80863340 82855PM Processor to I/O Controller 0
-s 808633401025005a TravelMate 290 0
-s 80863340103c0890 NC6000 laptop 0
-d 80863341 82855PM Processor to AGP Controller 0
-d 80863575 82830 830 Chipset Host Bridge 0
-s 808635751014021d ThinkPad A/T/X Series 0
-s 80863575104d80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP 0
-d 80863576 82830 830 Chipset AGP Bridge 0
-d 80863577 82830 CGC [Chipset Graphics Controller] 0
-s 8086357710140513 ThinkPad A/T/X Series 0
-d 80863578 82830 830 Chipset Host Bridge 0
-d 80863580 82852/82855 GM/GME/PM/GMV Processor to I/O Controller 0
-s 8086358010280163 Latitude D505 0
-s 808635804c5310b0 CL9 mainboard 0
-d 80863581 82852/82855 GM/GME/PM/GMV Processor to AGP Controller 0
-d 80863582 82852/855GM Integrated Graphics Device 0
-s 8086358210280163 Latitude D505 0
-s 808635824c5310b0 CL9 mainboard 0
-d 80863584 82852/82855 GM/GME/PM/GMV Processor to I/O Controller 0
-s 8086358410280163 Latitude D505 0
-s 808635844c5310b0 CL9 mainboard 0
-d 80863585 82852/82855 GM/GME/PM/GMV Processor to I/O Controller 0
-s 8086358510280163 Latitude D505 0
-s 808635854c5310b0 CL9 mainboard 0
-d 80863590 E7520 Memory Controller Hub 0
-d 80863591 E7525/E7520 Error Reporting Registers 0
-d 80863592 E7320 Memory Controller Hub 0
-d 80863593 E7320 Error Reporting Registers 0
-d 80863594 E7520 DMA Controller 0
-d 80863595 E7525/E7520/E7320 PCI Express Port A 0
-d 80863596 E7525/E7520/E7320 PCI Express Port A1 0
-d 80863597 E7525/E7520 PCI Express Port B 0
-d 80863598 E7520 PCI Express Port B1 0
-d 80863599 E7520 PCI Express Port C 0
-d 8086359a E7520 PCI Express Port C1 0
-d 8086359b E7525/E7520/E7320 Extended Configuration Registers 0
-d 8086359e E7525 Memory Controller Hub 0
-d 80864220 PRO/Wireless 2200BG 0
-d 80864223 PRO/Wireless 2915ABG MiniPCI Adapter 0
-d 80865200 EtherExpress PRO/100 Intelligent Server 0
-d 80865201 EtherExpress PRO/100 Intelligent Server 0
-s 8086520180860001 EtherExpress PRO/100 Server Ethernet Adapter 0
-d 8086530d 80310 IOP [IO Processor] 0
-d 80867000 82371SB PIIX3 ISA [Natoma/Triton II] 0
-d 80867010 82371SB PIIX3 IDE [Natoma/Triton II] 0
-d 80867020 82371SB PIIX3 USB [Natoma/Triton II] 0
-d 80867030 430VX - 82437VX TVX [Triton VX] 0
-d 80867050 Intel Intercast Video Capture Card 0
-d 80867100 430TX - 82439TX MTXC 0
-d 80867110 82371AB/EB/MB PIIX4 ISA 0
-s 8086711015ad1976 virtualHW v3 0
-d 80867111 82371AB/EB/MB PIIX4 IDE 0
-s 8086711115ad1976 virtualHW v3 0
-d 80867112 82371AB/EB/MB PIIX4 USB 0
-s 8086711215ad1976 virtualHW v3 0
-d 80867113 82371AB/EB/MB PIIX4 ACPI 0
-s 8086711315ad1976 virtualHW v3 0
-d 80867120 82810 GMCH [Graphics Memory Controller Hub] 0
-s 808671204c531040 CL7 mainboard 0
-s 808671204c531060 PC7 mainboard 0
-d 80867121 82810 CGC [Chipset Graphics Controller] 0
-s 808671214c531040 CL7 mainboard 0
-s 808671214c531060 PC7 mainboard 0
-s 8086712180864341 Cayman (CA810) Mainboard 0
-d 80867122 82810 DC-100 GMCH [Graphics Memory Controller Hub] 0
-d 80867123 82810 DC-100 CGC [Chipset Graphics Controller] 0
-d 80867124 82810E DC-133 GMCH [Graphics Memory Controller Hub] 0
-d 80867125 82810E DC-133 CGC [Chipset Graphics Controller] 0
-d 80867126 82810 DC-133 System and Graphics Controller 0
-d 80867128 82810-M DC-100 System and Graphics Controller 0
-d 8086712a 82810-M DC-133 System and Graphics Controller 0
-d 80867180 440LX/EX - 82443LX/EX Host bridge 0
-d 80867181 440LX/EX - 82443LX/EX AGP bridge 0
-d 80867190 440BX/ZX/DX - 82443BX/ZX/DX Host bridge 0
-s 808671900e110500 Armada 1750 Laptop System Chipset 0
-s 808671900e11b110 Armada M700/E500 0
-s 8086719011790001 Toshiba Tecra 8100 Laptop System Chipset 0
-s 8086719015ad1976 virtualHW v3 0
-s 808671904c531050 CT7 mainboard 0
-s 808671904c531051 CE7 mainboard 0
-d 80867191 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge 0
-d 80867192 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (AGP disabled) 0
-s 808671920e110460 Armada 1700 Laptop System Chipset 0
-s 808671924c531000 CC7/CR7/CP7/VC7/VP7/VR7 mainboard 0
-d 80867194 82440MX Host Bridge 0
-s 8086719410330000 Versa Note Vxi 0
-s 808671944c5310a0 CA3/CR3 mainboard 0
-d 80867195 82440MX AC'97 Audio Controller 0
-s 80867195103380cc Versa Note VXi 0
-s 8086719510cf1099 QSound_SigmaTel Stac97 PCI Audio 0
-s 8086719511d40040 SoundMAX Integrated Digital Audio 0
-s 8086719511d40048 SoundMAX Integrated Digital Audio 0
-d 80867196 82440MX AC'97 Modem Controller 0
-d 80867198 82440MX ISA Bridge 0
-d 80867199 82440MX EIDE Controller 0
-d 8086719a 82440MX USB Universal Host Controller 0
-d 8086719b 82440MX Power Management Controller 0
-d 808671a0 440GX - 82443GX Host bridge 0
-s 808671a04c531050 CT7 mainboard 0
-s 808671a04c531051 CE7 mainboard 0
-d 808671a1 440GX - 82443GX AGP bridge 0
-d 808671a2 440GX - 82443GX Host bridge (AGP disabled) 0
-s 808671a24c531000 CC7/CR7/CP7/VC7/VP7/VR7 mainboard 0
-d 80867600 82372FB PIIX5 ISA 0
-d 80867601 82372FB PIIX5 IDE 0
-d 80867602 82372FB PIIX5 USB 0
-d 80867603 82372FB PIIX5 SMBus 0
-d 80867800 82740 (i740) AGP Graphics Accelerator 0
-s 80867800003d0008 Starfighter AGP 0
-s 80867800003d000b Starfighter AGP 0
-s 8086780010920100 Stealth II G460 0
-s 8086780010b4201a Lightspeed 740 0
-s 8086780010b4202f Lightspeed 740 0
-s 8086780080860000 Terminator 2x/i 0
-s 8086780080860100 Intel740 Graphics Accelerator 0
-d 808684c4 450KX/GX [Orion] - 82454KX/GX PCI bridge 0
-d 808684c5 450KX/GX [Orion] - 82453KX/GX Memory controller 0
-d 808684ca 450NX - 82451NX Memory & I/O Controller 0
-d 808684cb 450NX - 82454NX/84460GX PCI Expander Bridge 0
-d 808684e0 460GX - 84460GX System Address Controller (SAC) 0
-d 808684e1 460GX - 84460GX System Data Controller (SDC) 0
-d 808684e2 460GX - 84460GX AGP Bridge (GXB function 2) 0
-d 808684e3 460GX - 84460GX Memory Address Controller (MAC) 0
-d 808684e4 460GX - 84460GX Memory Data Controller (MDC) 0
-d 808684e6 460GX - 82466GX Wide and fast PCI eXpander Bridge (WXB) 0
-d 808684ea 460GX - 84460GX AGP Bridge (GXB function 1) 0
-d 80868500 IXP4XX - Intel Network Processor family. IXP420, IXP421, IXP422, IXP425 and IXC1100 0
-d 80869000 IXP2000 Family Network Processor 0
-d 80869001 IXP2400 Network Processor 0
-d 80869004 IXP2800 Network Processor 0
-d 80869621 Integrated RAID 0
-d 80869622 Integrated RAID 0
-d 80869641 Integrated RAID 0
-d 808696a1 Integrated RAID 0
-d 8086a01f PRO/10GbE LR Server Adapter 0 retail verson
-d 8086a11f PRO/10GbE LR Server Adapter 0 OEM version
-d 8086b152 21152 PCI-to-PCI Bridge 0
-d 8086b154 21154 PCI-to-PCI Bridge 0 observed, and documented in Intel revision note; new mask of 1011:0026
-d 8086b555 21555 Non transparent PCI-to-PCI Bridge 0
-s 8086b55512d9000a PCI VoIP Gateway 0
-s 8086b5554c531050 CT7 mainboard 0
-s 8086b5554c531051 CE7 mainboard 0
-s 8086b555e4bf1000 CC8-1-BLUES 0
-d 8086ffff 450NX/GX [Orion] - 82453KX/GX Memory controller [BUG] 0
-v 8401 TRENDware International Inc. 0
-v 8800 Trigem Computer Inc. 0
-d 88002008 Video assistent component 0
-v 8866 T-Square Design Inc. 0
-v 8888 Silicon Magic 0
-v 8c4a Winbond 0 8c4a is not Winbond but there is a board misprogrammed
-d 8c4a1980 W89C940 misprogrammed [ne2k] 0
-v 8e0e Computone Corporation 0
-v 8e2e KTI 0
-d 8e2e3000 ET32P2 0
-v 9004 Adaptec 0
-d 90040078 AHA-2940U_CN 0
-d 90041078 AIC-7810 0
-d 90041160 AIC-1160 [Family Fibre Channel Adapter] 0
-d 90042178 AIC-7821 0
-d 90043860 AHA-2930CU 0
-d 90043b78 AHA-4844W/4844UW 0
-d 90045075 AIC-755x 0
-d 90045078 AHA-7850 0
-s 9004507890047850 AHA-2904/Integrated AIC-7850 0
-d 90045175 AIC-755x 0
-d 90045178 AIC-7851 0
-d 90045275 AIC-755x 0
-d 90045278 AIC-7852 0
-d 90045375 AIC-755x 0
-d 90045378 AIC-7850 0
-d 90045475 AIC-755x 0
-d 90045478 AIC-7850 0
-d 90045575 AVA-2930 0
-d 90045578 AIC-7855 0
-d 90045647 ANA-7711 TCP Offload Engine 0
-s 9004564790047710 ANA-7711F TCP Offload Engine - Optical 0
-s 9004564790047711 ANA-7711LP TCP Offload Engine - Copper 0
-d 90045675 AIC-755x 0
-d 90045678 AIC-7856 0
-d 90045775 AIC-755x 0
-d 90045778 AIC-7850 0
-d 90045800 AIC-5800 0
-d 90045900 ANA-5910/5930/5940 ATM155 & 25 LAN Adapter 0
-d 90045905 ANA-5910A/5930A/5940A ATM Adapter 0
-d 90046038 AIC-3860 0
-d 90046075 AIC-1480 / APA-1480 0
-s 9004607590047560 AIC-1480 / APA-1480 Cardbus 0
-d 90046078 AIC-7860 0
-d 90046178 AIC-7861 0
-s 9004617890047861 AHA-2940AU Single 0
-d 90046278 AIC-7860 0
-d 90046378 AIC-7860 0
-d 90046478 AIC-786x 0
-d 90046578 AIC-786x 0
-d 90046678 AIC-786x 0
-d 90046778 AIC-786x 0
-d 90046915 ANA620xx/ANA69011A 0
-s 9004691590040008 ANA69011A/TX 10/100 0
-s 9004691590040009 ANA69011A/TX 10/100 0
-s 9004691590040010 ANA62022 2-port 10/100 0
-s 9004691590040018 ANA62044 4-port 10/100 0
-s 9004691590040019 ANA62044 4-port 10/100 0
-s 9004691590040020 ANA62022 2-port 10/100 0
-s 9004691590040028 ANA69011A/TX 10/100 0
-s 9004691590048008 ANA69011A/TX 64 bit 10/100 0
-s 9004691590048009 ANA69011A/TX 64 bit 10/100 0
-s 9004691590048010 ANA62022 2-port 64 bit 10/100 0
-s 9004691590048018 ANA62044 4-port 64 bit 10/100 0
-s 9004691590048019 ANA62044 4-port 64 bit 10/100 0
-s 9004691590048020 ANA62022 2-port 64 bit 10/100 0
-s 9004691590048028 ANA69011A/TX 64 bit 10/100 0
-d 90047078 AHA-294x / AIC-7870 0
-d 90047178 AHA-2940/2940W / AIC-7871 0
-d 90047278 AHA-3940/3940W / AIC-7872 0
-d 90047378 AHA-3985 / AIC-7873 0
-d 90047478 AHA-2944/2944W / AIC-7874 0
-d 90047578 AHA-3944/3944W / AIC-7875 0
-d 90047678 AHA-4944W/UW / AIC-7876 0
-d 90047710 ANA-7711F Network Accelerator Card (NAC) - Optical 0
-d 90047711 ANA-7711C Network Accelerator Card (NAC) - Copper 0
-d 90047778 AIC-787x 0
-d 90047810 AIC-7810 0
-d 90047815 AIC-7815 RAID+Memory Controller IC 0
-s 9004781590047815 ARO-1130U2 RAID Controller 0
-s 9004781590047840 AIC-7815 RAID+Memory Controller IC 0
-d 90047850 AIC-7850 0
-d 90047855 AHA-2930 0
-d 90047860 AIC-7860 0
-d 90047870 AIC-7870 0
-d 90047871 AHA-2940 0
-d 90047872 AHA-3940 0
-d 90047873 AHA-3980 0
-d 90047874 AHA-2944 0
-d 90047880 AIC-7880P 0
-d 90047890 AIC-7890 0
-d 90047891 AIC-789x 0
-d 90047892 AIC-789x 0
-d 90047893 AIC-789x 0
-d 90047894 AIC-789x 0
-d 90047895 AHA-2940U/UW / AHA-39xx / AIC-7895 0
-s 9004789590047890 AHA-2940U/2940UW Dual AHA-394xAU/AUW/AUWD AIC-7895B 0
-s 9004789590047891 AHA-2940U/2940UW Dual 0
-s 9004789590047892 AHA-3940AU/AUW/AUWD/UWD 0
-s 9004789590047894 AHA-3944AUWD 0
-s 9004789590047895 AHA-2940U/2940UW Dual AHA-394xAU/AUW/AUWD AIC-7895B 0
-s 9004789590047896 AHA-2940U/2940UW Dual AHA-394xAU/AUW/AUWD AIC-7895B 0
-s 9004789590047897 AHA-2940U/2940UW Dual AHA-394xAU/AUW/AUWD AIC-7895B 0
-d 90047896 AIC-789x 0
-d 90047897 AIC-789x 0
-d 90048078 AIC-7880U 0
-s 9004807890047880 AIC-7880P Ultra/Ultra Wide SCSI Chipset 0
-d 90048178 AHA-2940U/UW/D / AIC-7881U 0
-s 9004817890047881 AHA-2940UW SCSI Host Adapter 0
-d 90048278 AHA-3940U/UW/UWD / AIC-7882U 0
-d 90048378 AHA-3940U/UW / AIC-7883U 0
-d 90048478 AHA-2944UW / AIC-7884U 0
-d 90048578 AHA-3944U/UWD / AIC-7885 0
-d 90048678 AHA-4944UW / AIC-7886 0
-d 90048778 AHA-2940UW Pro / AIC-788x 0
-s 9004877890047887 2940UW Pro Ultra-Wide SCSI Controller 0
-d 90048878 AHA-2930UW / AIC-7888 0
-s 9004887890047888 AHA-2930UW SCSI Controller 0
-d 90048b78 ABA-1030 0
-d 9004ec78 AHA-4944W/UW 0
-v 9005 Adaptec 0
-d 90050010 AHA-2940U2/U2W 0
-s 9005001090052180 AHA-2940U2 SCSI Controller 0
-s 9005001090058100 AHA-2940U2B SCSI Controller 0
-s 900500109005a100 AHA-2940U2B SCSI Controller 0
-s 900500109005a180 AHA-2940U2W SCSI Controller 0
-s 900500109005e100 AHA-2950U2B SCSI Controller 0
-d 90050011 AHA-2930U2 0
-d 90050013 78902 0
-s 9005001390050003 AAA-131U2 Array1000 1 Channel RAID Controller 0
-s 900500139005000f AIC7890_ARO 0
-d 9005001f AHA-2940U2/U2W / 7890/7891 0
-s 9005001f9005000f 2940U2W SCSI Controller 0
-s 9005001f9005a180 2940U2W SCSI Controller 0
-d 90050020 AIC-7890 0
-d 9005002f AIC-7890 0
-d 90050030 AIC-7890 0
-d 9005003f AIC-7890 0
-d 90050050 AHA-3940U2x/395U2x 0
-s 900500509005f500 AHA-3950U2B 0
-s 900500509005ffff AHA-3950U2B 0
-d 90050051 AHA-3950U2D 0
-s 900500519005b500 AHA-3950U2D 0
-d 90050053 AIC-7896 SCSI Controller 0
-s 900500539005ffff AIC-7896 SCSI Controller mainboard implementation 0
-d 9005005f AIC-7896U2/7897U2 0
-d 90050080 AIC-7892A U160/m 0
-s 900500800e11e2a0 Compaq 64-Bit/66MHz Wide Ultra3 SCSI Adapter 0
-s 9005008090056220 AHA-29160C 0
-s 90050080900562a0 29160N Ultra160 SCSI Controller 0
-s 900500809005e220 29160LP Low Profile Ultra160 SCSI Controller 0
-s 900500809005e2a0 29160 Ultra160 SCSI Controller 0
-d 90050081 AIC-7892B U160/m 0
-s 90050081900562a1 19160 Ultra160 SCSI Controller 0
-d 90050083 AIC-7892D U160/m 0
-d 9005008f AIC-7892P U160/m 0
-s 9005008f11790001 Magnia Z310 0
-s 9005008f15d99005 Onboard SCSI Host Adapter 0
-d 900500c0 AHA-3960D / AIC-7899A U160/m 0
-s 900500c00e11f620 Compaq 64-Bit/66MHz Dual Channel Wide Ultra3 SCSI Adapter 0
-s 900500c09005f620 AHA-3960D U160/m 0
-d 900500c1 AIC-7899B U160/m 0
-d 900500c3 AIC-7899D U160/m 0
-d 900500c5 RAID subsystem HBA 0
-s 900500c5102800c5 PowerEdge 2400,2500,2550,4400 0
-d 900500cf AIC-7899P U160/m 0
-s 900500cf102800ce PowerEdge 1400 0
-s 900500cf102800d1 PowerEdge 2550 0
-s 900500cf102800d9 PowerEdge 2500 0
-s 900500cf10f12462 Thunder K7 S2462 0
-s 900500cf15d99005 Onboard SCSI Host Adapter 0
-s 900500cf80863411 SDS2 Mainboard 0
-d 90050250 ServeRAID Controller 0
-s 9005025010140279 ServeRAID-xx 0
-s 900502501014028c ServeRAID-xx 0
-d 90050279 ServeRAID 6M 0 from kernel sources
-d 90050283 AAC-RAID 0
-s 9005028390050283 Catapult 0
-d 90050284 AAC-RAID 0
-s 9005028490050284 Tomcat 0
-d 90050285 AAC-RAID 0
-s 900502850e110295 SATA 6Ch (Bearcat) 0
-s 9005028510280287 PowerEdge Expandable RAID Controller 320/DC 0
-s 9005028510280291 CERC SATA RAID 2 PCI SATA 6ch (DellCorsair) 0
-s 9005028517aa0286 Legend S220 (Legend Crusader) 0
-s 9005028517aa0287 Legend S230 (Legend Vulcan) 0
-s 9005028590050285 2200S (Vulcan) 0
-s 9005028590050286 2120S (Crusader) 0
-s 9005028590050287 2200S (Vulcan-2m) 0
-s 9005028590050288 3230S (Harrier) 0
-s 9005028590050289 3240S (Tornado) 0
-s 900502859005028a ASR-2020S PCI-X ZCR (Skyhawk) 0
-s 900502859005028b ASR-2020S SO-DIMM PCI-X ZCR (Terminator) 0
-s 9005028590050290 AAR-2410SA PCI SATA 4ch (Jaguar II) 0
-s 9005028590050292 AAR-2810SA PCI SATA 8ch (Corsair-8) 0
-s 9005028590050293 AAR-21610SA PCI SATA 16ch (Corsair-16) 0
-s 9005028590050294 ESD SO-DIMM PCI-X SATA ZCR (Prowler) 0
-d 90050286 AAC-RAID (Rocket) 0
-s 900502869005028c ASR-2230S + ASR-2230SLP PCI-X (Lancer) 0
-d 90058000 ASC-29320A U320 0
-d 9005800f AIC-7901 U320 0
-d 90058010 ASC-39320 U320 0
-d 90058011 ASC-32320D U320 0
-s 900580110e1100ac ASC-39320D U320 0
-s 9005801190050041 ASC-39320D U320 0
-d 90058012 ASC-29320 U320 0
-d 90058013 ASC-29320B U320 0
-d 90058014 ASC-29320LP U320 0
-d 90058015 ASC-39320B U320 0
-d 90058016 ASC-39320A U320 0
-d 90058017 ASC-29320ALP U320 0
-d 9005801c ASC-39320D U320 0
-d 9005801d AIC-7902B U320 0
-d 9005801e AIC-7901A U320 0
-d 9005801f AIC-7902 U320 0
-d 90058080 ASC-29320A U320 w/HostRAID 0
-d 9005808f AIC-7901 U320 w/HostRAID 0
-d 90058090 ASC-39320 U320 w/HostRAID 0
-d 90058091 ASC-39320D U320 w/HostRAID 0
-d 90058092 ASC-29320 U320 w/HostRAID 0
-d 90058093 ASC-29320B U320 w/HostRAID 0
-d 90058094 ASC-29320LP U320 w/HostRAID 0
-d 90058095 ASC-39320(B) U320 w/HostRAID 0
-d 90058096 ASC-39320A U320 w/HostRAID 0
-d 90058097 ASC-29320ALP U320 w/HostRAID 0
-d 9005809c ASC-39320D(B) U320 w/HostRAID 0
-d 9005809d AIC-7902(B) U320 w/HostRAID 0
-d 9005809e AIC-7901A U320 w/HostRAID 0
-d 9005809f AIC-7902 U320 w/HostRAID 0
-v 907f Atronics 0
-d 907f2015 IDE-2015PL 0
-v 919a Gigapixel Corp 0
-v 9412 Holtek 0
-d 94126565 6565 0
-v 9699 Omni Media Technology Inc 0
-d 96996565 6565 0
-v 9710 NetMos Technology 0
-d 97107780 USB IRDA-port 0
-d 97109815 PCI 9815 Multi-I/O Controller 0
-s 9710981510000020 2P0S (2 port parallel adaptor) 0
-d 97109835 PCI 9835 Multi-I/O Controller 0
-s 9710983510000002 2S (16C550 UART) 0
-s 9710983510000012 1P2S 0
-d 97109845 PCI 9845 Multi-I/O Controller 0
-s 9710984510000004 0P4S (4 port 16550A serial card) 0
-s 9710984510000006 0P6S (6 port 16550a serial card) 0
-d 97109855 PCI 9855 Multi-I/O Controller 0
-s 9710985510000014 1P4S 0
-v 9902 Stargen Inc. 0
-d 99020001 SG2010 PCI over Starfabric Bridge 0
-d 99020002 SG2010 PCI to Starfabric Gateway 0
-d 99020003 SG1010 Starfabric Switch and PCI Bridge 0
-v a0a0 AOPEN Inc. 0
-v a0f1 UNISYS Corporation 0
-v a200 NEC Corporation 0
-v a259 Hewlett Packard 0
-v a25b Hewlett Packard GmbH PL24-MKT 0
-v a304 Sony 0
-v a727 3Com Corporation 0
-d a7270013 3CRPAG175 Wireless PC Card 0
-v aa42 Scitex Digital Video 0
-v ac1e Digital Receiver Technology Inc 0
-v ac3d Actuality Systems 0
-v aecb Adrienne Electronics Corporation 0
-v b1b3 Shiva Europe Limited 0
-v bd11 Pinnacle Systems, Inc. (Wrong ID) 0 Pinnacle should be 11bd, but they got it wrong several times --mj
-v c001 TSI Telsys 0
-v c0a9 Micron/Crucial Technology 0
-v c0de Motorola 0
-v c0fe Motion Engineering, Inc. 0
-v ca50 Varian Australia Pty Ltd 0
-v cafe Chrysalis-ITS 0
-v cccc Catapult Communications 0
-v cddd Tyzx, Inc. 0
-d cddd0101 DeepSea 1 High Speed Stereo Vision Frame Grabber 0
-d cddd0200 DeepSea 2 High Speed Stereo Vision Frame Grabber 0
-v d4d4 Dy4 Systems Inc 0
-d d4d40601 PCI Mezzanine Card 0
-v d531 I+ME ACTIA GmbH 0
-v d84d Exsys 0
-v dead Indigita Corporation 0
-v e000 Winbond 0
-d e000e000 W89C940 0
-v e159 Tiger Jet Network Inc. 0 see also : http://www.schoenfeld.de/inside/Inside_CWMK3.txt maybe a misuse of TJN id or it use the TJN 3XX chip for other applic
-d e1590001 Tiger3XX Modem/ISDN interface 0
-s e159000100590001 128k ISDN-S/T Adapter 0
-s e159000100590003 128k ISDN-U Adapter 0
-d e1590002 Tiger100APC ISDN chipset 0
-v e4bf EKF Elektronik GmbH 0
-v e55e Essence Technology, Inc. 0 Innovative and scalable network IC vendor
-v ea01 Eagle Technology 0
-v ea60 RME 0 The main chip of all these devices is by Xilinx -> It could also be a Xilinx ID.
-d ea609896 Digi32 0
-d ea609897 Digi32 Pro 0
-d ea609898 Digi32/8 0
-v eabb Aashima Technology B.V. 0
-v eace Endace Measurement Systems, Ltd 0
-d eace3100 DAG 3.10 OC-3/OC-12 0
-d eace3200 DAG 3.2x OC-3/OC-12 0
-d eace320e DAG 3.2E Fast Ethernet 0
-d eace340e DAG 3.4E Fast Ethernet 0
-d eace341e DAG 3.41E Fast Ethernet 0
-d eace3500 DAG 3.5 OC-3/OC-12 0
-d eace351c DAG 3.5ECM Fast Ethernet 0
-d eace4100 DAG 4.10 OC-48 0
-d eace4110 DAG 4.11 OC-48 0
-d eace4220 DAG 4.2 OC-48 0
-d eace422e DAG 4.2E Dual Gigabit Ethernet 0
-v ec80 Belkin Corporation 0
-d ec80ec00 F5D6000 0
-v ecc0 Echo Digital Audio Corporation 0
-d ecc00050 Gina24_301 0
-d ecc00051 Gina24_361 0
-d ecc00060 Layla24 0
-d ecc00070 Mona_301_80 0
-d ecc00071 Mona_301_66 0
-d ecc00072 Mona_361 0
-d ecc00080 Mia 0
-v edd8 ARK Logic Inc 0
-d edd8a091 1000PV [Stingray] 0
-d edd8a099 2000PV [Stingray] 0
-d edd8a0a1 2000MT 0
-d edd8a0a9 2000MI 0
-v f1d0 AJA Video 0
-d f1d0cafe KONA SD SMPTE 259M I/O 0 All boards I have seen have this ID not efac, though all docs say efac...
-d f1d0efac KONA SD SMPTE 259M I/O 0
-d f1d0facd KONA HD SMPTE 292M I/O 0
-v fa57 Interagon AS 0
-d fa570001 PMC [Pattern Matching Chip] 0
-v febd Ultraview Corp. 0
-v feda Broadcom Inc (nee Epigram) 0
-d fedaa0fa BCM4210 iLine10 HomePNA 2.0 0
-d fedaa10e BCM4230 iLine10 HomePNA 2.0 0
-v fede Fedetec Inc. 0 IT & Telecom company, develops PCI Trunk cards <www.fedetec.es>
-d fede0003 TABIC PCI v3 0
-v fffe VMWare Inc 0
-d fffe0405 Virtual SVGA 4.0 0
-d fffe0710 Virtual SVGA 0
-v ffff Illegal Vendor ID 0
diff --git a/src/video_out/libdha/pci.c b/src/video_out/libdha/pci.c
deleted file mode 100644
index db8f4ddd5..000000000
--- a/src/video_out/libdha/pci.c
+++ /dev/null
@@ -1,834 +0,0 @@
-/*
- (C) 2002 - library implementation by Nick Kyrshev
- XFree86 3.3.3 scanpci.c, modified for GATOS/win/gfxdump by Øyvind Aabling.
- */
-/* $XConsortium: scanpci.c /main/25 1996/10/27 11:48:40 kaleb $ */
-/*
- * name: scanpci.c
- *
- * purpose: This program will scan for and print details of
- * devices on the PCI bus.
-
- * author: Robin Cutshaw (robin@xfree86.org)
- *
- * supported O/S's: SVR4, UnixWare, SCO, Solaris,
- * FreeBSD, NetBSD, 386BSD, BSDI BSD/386,
- * Linux, Mach/386, ISC
- * DOS (WATCOM 9.5 compiler)
- *
- * compiling: [g]cc scanpci.c -o scanpci
- * for SVR4 (not Solaris), UnixWare use:
- * [g]cc -DSVR4 scanpci.c -o scanpci
- * for DOS, watcom 9.5:
- * wcc386p -zq -omaxet -7 -4s -s -w3 -d2 name.c
- * and link with PharLap or other dos extender for exe
- *
- */
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.c,v 3.34.2.17 1998/11/10 11:55:40 dawes Exp $ */
-
-/*
- * Copyright 1995 by Robin Cutshaw <robin@XFree86.Org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of the above listed copyright holder(s)
- * not be used in advertising or publicity pertaining to distribution of
- * the software without specific, written prior permission. The above listed
- * copyright holder(s) make(s) no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM(S) ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
- * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-
-#include "libdha.h"
-#include <errno.h>
-#include <string.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/ioctl.h>
-#include "kernelhelper/dhahelper.h"
-
-#ifdef __unix__
-#include <unistd.h>
-#endif
-
-#if 0
-#if defined(__SUNPRO_C) || defined(sun) || defined(__sun)
-#include <sys/psw.h>
-#else
-#include <sys/seg.h>
-#endif
-#include <sys/v86.h>
-#endif
-
-#if defined(Lynx) && defined(__powerpc__)
-/* let's mimick the Linux Alpha stuff for LynxOS so we don't have
- * to change too much code
- */
-#include <smem.h>
-
-static unsigned char *pciConfBase;
-
-static __inline__ unsigned long
-static swapl(unsigned long val)
-{
- unsigned char *p = (unsigned char *)&val;
- return ((p[3] << 24) | (p[2] << 16) | (p[1] << 8) | (p[0] << 0));
-}
-
-
-#define BUS(tag) (((tag)>>16)&0xff)
-#define DFN(tag) (((tag)>>8)&0xff)
-
-#define PCIBIOS_DEVICE_NOT_FOUND 0x86
-#define PCIBIOS_SUCCESSFUL 0x00
-
-int pciconfig_read(
- unsigned char bus,
- unsigned char dev,
- unsigned char offset,
- int len, /* unused, alway 4 */
- unsigned long *val)
-{
- unsigned long _val;
- unsigned long *ptr;
-
- dev >>= 3;
- if (bus || dev >= 16) {
- *val = 0xFFFFFFFF;
- return PCIBIOS_DEVICE_NOT_FOUND;
- } else {
- ptr = (unsigned long *)(pciConfBase + ((1<<dev) | offset));
- _val = swapl(*ptr);
- }
- *val = _val;
- return PCIBIOS_SUCCESSFUL;
-}
-
-int pciconfig_write(
- unsigned char bus,
- unsigned char dev,
- unsigned char offset,
- int len, /* unused, alway 4 */
- unsigned long val)
-{
- unsigned long _val;
- unsigned long *ptr;
-
- dev >>= 3;
- _val = swapl(val);
- if (bus || dev >= 16) {
- return PCIBIOS_DEVICE_NOT_FOUND;
- } else {
- ptr = (unsigned long *)(pciConfBase + ((1<<dev) | offset));
- *ptr = _val;
- }
- return PCIBIOS_SUCCESSFUL;
-}
-#endif
-
-#if !defined(__powerpc__)
-struct pci_config_reg {
- /* start of official PCI config space header */
- union {
- unsigned long device_vendor;
- struct {
- unsigned short vendor;
- unsigned short device;
- } dv;
- } dv_id;
-#define _device_vendor dv_id.device_vendor
-#define _vendor dv_id.dv.vendor
-#define _device dv_id.dv.device
- union {
- unsigned long status_command;
- struct {
- unsigned short command;
- unsigned short status;
- } sc;
- } stat_cmd;
-#define _status_command stat_cmd.status_command
-#define _command stat_cmd.sc.command
-#define _status stat_cmd.sc.status
- union {
- unsigned long class_revision;
- struct {
- unsigned char rev_id;
- unsigned char prog_if;
- unsigned char sub_class;
- unsigned char base_class;
- } cr;
- } class_rev;
-#define _class_revision class_rev.class_revision
-#define _rev_id class_rev.cr.rev_id
-#define _prog_if class_rev.cr.prog_if
-#define _sub_class class_rev.cr.sub_class
-#define _base_class class_rev.cr.base_class
- union {
- unsigned long bist_header_latency_cache;
- struct {
- unsigned char cache_line_size;
- unsigned char latency_timer;
- unsigned char header_type;
- unsigned char bist;
- } bhlc;
- } bhlc;
-#define _bist_header_latency_cache bhlc.bist_header_latency_cache
-#define _cache_line_size bhlc.bhlc.cache_line_size
-#define _latency_timer bhlc.bhlc.latency_timer
-#define _header_type bhlc.bhlc.header_type
-#define _bist bhlc.bhlc.bist
- union {
- struct {
- unsigned long dv_base0;
- unsigned long dv_base1;
- unsigned long dv_base2;
- unsigned long dv_base3;
- unsigned long dv_base4;
- unsigned long dv_base5;
- } dv;
- struct {
- unsigned long bg_rsrvd[2];
- unsigned char primary_bus_number;
- unsigned char secondary_bus_number;
- unsigned char subordinate_bus_number;
- unsigned char secondary_latency_timer;
- unsigned char io_base;
- unsigned char io_limit;
- unsigned short secondary_status;
- unsigned short mem_base;
- unsigned short mem_limit;
- unsigned short prefetch_mem_base;
- unsigned short prefetch_mem_limit;
- } bg;
- } bc;
-#define _base0 bc.dv.dv_base0
-#define _base1 bc.dv.dv_base1
-#define _base2 bc.dv.dv_base2
-#define _base3 bc.dv.dv_base3
-#define _base4 bc.dv.dv_base4
-#define _base5 bc.dv.dv_base5
-#define _primary_bus_number bc.bg.primary_bus_number
-#define _secondary_bus_number bc.bg.secondary_bus_number
-#define _subordinate_bus_number bc.bg.subordinate_bus_number
-#define _secondary_latency_timer bc.bg.secondary_latency_timer
-#define _io_base bc.bg.io_base
-#define _io_limit bc.bg.io_limit
-#define _secondary_status bc.bg.secondary_status
-#define _mem_base bc.bg.mem_base
-#define _mem_limit bc.bg.mem_limit
-#define _prefetch_mem_base bc.bg.prefetch_mem_base
-#define _prefetch_mem_limit bc.bg.prefetch_mem_limit
- unsigned long rsvd1;
- unsigned long rsvd2;
- unsigned long _baserom;
- unsigned long rsvd3;
- unsigned long rsvd4;
- union {
- unsigned long max_min_ipin_iline;
- struct {
- unsigned char int_line;
- unsigned char int_pin;
- unsigned char min_gnt;
- unsigned char max_lat;
- } mmii;
- } mmii;
-#define _max_min_ipin_iline mmii.max_min_ipin_iline
-#define _int_line mmii.mmii.int_line
-#define _int_pin mmii.mmii.int_pin
-#define _min_gnt mmii.mmii.min_gnt
-#define _max_lat mmii.mmii.max_lat
- /* I don't know how accurate or standard this is (DHD) */
- union {
- unsigned long user_config;
- struct {
- unsigned char user_config_0;
- unsigned char user_config_1;
- unsigned char user_config_2;
- unsigned char user_config_3;
- } uc;
- } uc;
-#define _user_config uc.user_config
-#define _user_config_0 uc.uc.user_config_0
-#define _user_config_1 uc.uc.user_config_1
-#define _user_config_2 uc.uc.user_config_2
-#define _user_config_3 uc.uc.user_config_3
- /* end of official PCI config space header */
- unsigned long _pcibusidx;
- unsigned long _pcinumbus;
- unsigned long _pcibuses[16];
- unsigned short _configtype; /* config type found */
- unsigned short _ioaddr; /* config type 1 - private I/O addr */
- unsigned long _cardnum; /* config type 2 - private card number */
-};
-#else
-/* ppc is big endian, swapping bytes is not quite enough
- * to interpret the PCI config registers...
- */
-struct pci_config_reg {
- /* start of official PCI config space header */
- union {
- unsigned long device_vendor;
- struct {
- unsigned short device;
- unsigned short vendor;
- } dv;
- } dv_id;
-#define _device_vendor dv_id.device_vendor
-#define _vendor dv_id.dv.vendor
-#define _device dv_id.dv.device
- union {
- unsigned long status_command;
- struct {
- unsigned short status;
- unsigned short command;
- } sc;
- } stat_cmd;
-#define _status_command stat_cmd.status_command
-#define _command stat_cmd.sc.command
-#define _status stat_cmd.sc.status
- union {
- unsigned long class_revision;
- struct {
- unsigned char base_class;
- unsigned char sub_class;
- unsigned char prog_if;
- unsigned char rev_id;
- } cr;
- } class_rev;
-#define _class_revision class_rev.class_revision
-#define _rev_id class_rev.cr.rev_id
-#define _prog_if class_rev.cr.prog_if
-#define _sub_class class_rev.cr.sub_class
-#define _base_class class_rev.cr.base_class
- union {
- unsigned long bist_header_latency_cache;
- struct {
- unsigned char bist;
- unsigned char header_type;
- unsigned char latency_timer;
- unsigned char cache_line_size;
- } bhlc;
- } bhlc;
-#define _bist_header_latency_cache bhlc.bist_header_latency_cache
-#define _cache_line_size bhlc.bhlc.cache_line_size
-#define _latency_timer bhlc.bhlc.latency_timer
-#define _header_type bhlc.bhlc.header_type
-#define _bist bhlc.bhlc.bist
- union {
- struct {
- unsigned long dv_base0;
- unsigned long dv_base1;
- unsigned long dv_base2;
- unsigned long dv_base3;
- unsigned long dv_base4;
- unsigned long dv_base5;
- } dv;
-/* ?? */
- struct {
- unsigned long bg_rsrvd[2];
-
- unsigned char secondary_latency_timer;
- unsigned char subordinate_bus_number;
- unsigned char secondary_bus_number;
- unsigned char primary_bus_number;
-
- unsigned short secondary_status;
- unsigned char io_limit;
- unsigned char io_base;
-
- unsigned short mem_limit;
- unsigned short mem_base;
-
- unsigned short prefetch_mem_limit;
- unsigned short prefetch_mem_base;
- } bg;
- } bc;
-#define _base0 bc.dv.dv_base0
-#define _base1 bc.dv.dv_base1
-#define _base2 bc.dv.dv_base2
-#define _base3 bc.dv.dv_base3
-#define _base4 bc.dv.dv_base4
-#define _base5 bc.dv.dv_base5
-#define _primary_bus_number bc.bg.primary_bus_number
-#define _secondary_bus_number bc.bg.secondary_bus_number
-#define _subordinate_bus_number bc.bg.subordinate_bus_number
-#define _secondary_latency_timer bc.bg.secondary_latency_timer
-#define _io_base bc.bg.io_base
-#define _io_limit bc.bg.io_limit
-#define _secondary_status bc.bg.secondary_status
-#define _mem_base bc.bg.mem_base
-#define _mem_limit bc.bg.mem_limit
-#define _prefetch_mem_base bc.bg.prefetch_mem_base
-#define _prefetch_mem_limit bc.bg.prefetch_mem_limit
- unsigned long rsvd1;
- unsigned long rsvd2;
- unsigned long _baserom;
- unsigned long rsvd3;
- unsigned long rsvd4;
- union {
- unsigned long max_min_ipin_iline;
- struct {
- unsigned char max_lat;
- unsigned char min_gnt;
- unsigned char int_pin;
- unsigned char int_line;
- } mmii;
- } mmii;
-#define _max_min_ipin_iline mmii.max_min_ipin_iline
-#define _int_line mmii.mmii.int_line
-#define _int_pin mmii.mmii.int_pin
-#define _min_gnt mmii.mmii.min_gnt
-#define _max_lat mmii.mmii.max_lat
- /* I don't know how accurate or standard this is (DHD) */
- union {
- unsigned long user_config;
- struct {
- unsigned char user_config_3;
- unsigned char user_config_2;
- unsigned char user_config_1;
- unsigned char user_config_0;
- } uc;
- } uc;
-#define _user_config uc.user_config
-#define _user_config_0 uc.uc.user_config_0
-#define _user_config_1 uc.uc.user_config_1
-#define _user_config_2 uc.uc.user_config_2
-#define _user_config_3 uc.uc.user_config_3
- /* end of official PCI config space header */
- unsigned long _pcibusidx;
- unsigned long _pcinumbus;
- unsigned long _pcibuses[16];
- unsigned short _ioaddr; /* config type 1 - private I/O addr */
- unsigned short _configtype; /* config type found */
- unsigned long _cardnum; /* config type 2 - private card number */
-};
-#endif
-
-#define MAX_DEV_PER_VENDOR_CFG1 64
-#define MAX_PCI_DEVICES_PER_BUS 32
-#define MAX_PCI_DEVICES 64
-#define NF ((void (*)())NULL), { 0.0, 0, 0, NULL }
-#define PCI_MULTIFUNC_DEV 0x80
-#define PCI_ID_REG 0x00
-#define PCI_CMD_STAT_REG 0x04
-#define PCI_CLASS_REG 0x08
-#define PCI_HEADER_MISC 0x0C
-#define PCI_MAP_REG_START 0x10
-#define PCI_MAP_ROM_REG 0x30
-#define PCI_INTERRUPT_REG 0x3C
-#define PCI_INTERRUPT_PIN 0x3D /* 8 bits */
-#define PCI_MIN_GNT 0x3E /* 8 bits */
-#define PCI_MAX_LAT 0x3F /* 8 bits */
-#define PCI_REG_USERCONFIG 0x40
-
-static int pcibus=-1, pcicard=-1, pcifunc=-1 ;
-/*static struct pci_device *pcidev=NULL ;*/
-
-#if defined(__alpha__)
-#define PCI_EN 0x00000000
-#else
-#define PCI_EN 0x80000000
-#endif
-
-#define PCI_MODE1_ADDRESS_REG 0xCF8
-#define PCI_MODE1_DATA_REG 0xCFC
-
-#define PCI_MODE2_ENABLE_REG 0xCF8
-#ifdef PC98
-#define PCI_MODE2_FORWARD_REG 0xCF9
-#else
-#define PCI_MODE2_FORWARD_REG 0xCFA
-#endif
-
-/* cpu depended stuff */
-#if defined(__alpha__)
-#include "sysdep/pci_alpha.c"
-#elif defined(__ia64__)
-#include "sysdep/pci_ia64.c"
-#elif defined(__sparc__)
-#include "sysdep/pci_sparc.c"
-#elif defined( __arm32__ )
-#include "sysdep/pci_arm32.c"
-#elif defined(__powerpc__)
-#include "sysdep/pci_powerpc.c"
-#elif defined( __i386__ )
-#include "sysdep/pci_x86.c"
-#else
-#include "sysdep/pci_generic_cpu.c"
-#endif
-
-static int pcicards=0 ;
-static pciinfo_t *pci_lst;
-
-static void identify_card(struct pci_config_reg *pcr)
-{
-
- if (pcicards>=MAX_PCI_DEVICES) return ;
-
- pci_lst[pcicards].bus = pcibus ;
- pci_lst[pcicards].card = pcicard ;
- pci_lst[pcicards].func = pcifunc ;
- pci_lst[pcicards].vendor = pcr->_vendor ;
- pci_lst[pcicards].device = pcr->_device ;
- pci_lst[pcicards].base0 = 0xFFFFFFFF ;
- pci_lst[pcicards].base1 = 0xFFFFFFFF ;
- pci_lst[pcicards].base2 = 0xFFFFFFFF ;
- pci_lst[pcicards].base3 = 0xFFFFFFFF ;
- pci_lst[pcicards].base4 = 0xFFFFFFFF ;
- pci_lst[pcicards].base5 = 0xFFFFFFFF ;
- pci_lst[pcicards].baserom = 0x000C0000 ;
- if (pcr->_base0) pci_lst[pcicards].base0 = pcr->_base0 &
- ((pcr->_base0&0x1) ? 0xFFFFFFFC : 0xFFFFFFF0) ;
- if (pcr->_base1) pci_lst[pcicards].base1 = pcr->_base1 &
- ((pcr->_base1&0x1) ? 0xFFFFFFFC : 0xFFFFFFF0) ;
- if (pcr->_base2) pci_lst[pcicards].base2 = pcr->_base2 &
- ((pcr->_base2&0x1) ? 0xFFFFFFFC : 0xFFFFFFF0) ;
- if (pcr->_base3) pci_lst[pcicards].base3 = pcr->_base3 &
- ((pcr->_base0&0x1) ? 0xFFFFFFFC : 0xFFFFFFF0) ;
- if (pcr->_base4) pci_lst[pcicards].base4 = pcr->_base4 &
- ((pcr->_base1&0x1) ? 0xFFFFFFFC : 0xFFFFFFF0) ;
- if (pcr->_base5) pci_lst[pcicards].base5 = pcr->_base5 &
- ((pcr->_base2&0x1) ? 0xFFFFFFFC : 0xFFFFFFF0) ;
- if (pcr->_baserom) pci_lst[pcicards].baserom = pcr->_baserom ;
- pci_lst[pcicards].irq = pcr->_int_line;
- pci_lst[pcicards].ipin= pcr->_int_pin;
- pci_lst[pcicards].gnt = pcr->_min_gnt;
- pci_lst[pcicards].lat = pcr->_max_lat;
-
- pcicards++;
-}
-
-/*main(int argc, char *argv[])*/
-static int __pci_scan(pciinfo_t *pci_list,unsigned *num_pci)
-{
- unsigned int idx;
- struct pci_config_reg pcr;
- int do_mode1_scan = 0, do_mode2_scan = 0;
- int func, hostbridges=0;
- int ret = -1;
-
- pci_lst = pci_list;
- pcicards = 0;
-
- ret = enable_app_io();
- if (ret != 0)
- return(ret);
-
- if((pcr._configtype = pci_config_type()) == 0xFFFF) return ENODEV;
-
- /* Try pci config 1 probe first */
-
- if ((pcr._configtype == 1) || do_mode1_scan) {
- /*printf("\nPCI probing configuration type 1\n");*/
-
- pcr._ioaddr = 0xFFFF;
-
- pcr._pcibuses[0] = 0;
- pcr._pcinumbus = 1;
- pcr._pcibusidx = 0;
- idx = 0;
-
- do {
- /*printf("Probing for devices on PCI bus %d:\n\n", pcr._pcibusidx);*/
-
- for (pcr._cardnum = 0x0; pcr._cardnum < MAX_PCI_DEVICES_PER_BUS;
- pcr._cardnum += 0x1) {
- func = 0;
- do { /* loop over the different functions, if present */
- pcr._device_vendor = pci_get_vendor(pcr._pcibuses[pcr._pcibusidx], pcr._cardnum,
- func);
- if ((pcr._vendor == 0xFFFF) || (pcr._device == 0xFFFF))
- break; /* nothing there */
-
- /*printf("\npci bus 0x%x cardnum 0x%02x function 0x%04x: vendor 0x%04x device 0x%04x\n",
- pcr._pcibuses[pcr._pcibusidx], pcr._cardnum, func,
- pcr._vendor, pcr._device);*/
- pcibus = pcr._pcibuses[pcr._pcibusidx];
- pcicard = pcr._cardnum;
- pcifunc = func;
-
- pcr._status_command = pci_config_read_long(pcr._pcibuses[pcr._pcibusidx],
- pcr._cardnum,func,PCI_CMD_STAT_REG);
- pcr._class_revision = pci_config_read_long(pcr._pcibuses[pcr._pcibusidx],
- pcr._cardnum,func,PCI_CLASS_REG);
- pcr._bist_header_latency_cache = pci_config_read_long(pcr._pcibuses[pcr._pcibusidx],
- pcr._cardnum,func,PCI_HEADER_MISC);
- pcr._base0 = pci_config_read_long(pcr._pcibuses[pcr._pcibusidx],
- pcr._cardnum,func,PCI_MAP_REG_START);
- pcr._base1 = pci_config_read_long(pcr._pcibuses[pcr._pcibusidx],
- pcr._cardnum,func,PCI_MAP_REG_START+4);
- pcr._base2 = pci_config_read_long(pcr._pcibuses[pcr._pcibusidx],
- pcr._cardnum,func,PCI_MAP_REG_START+8);
- pcr._base3 = pci_config_read_long(pcr._pcibuses[pcr._pcibusidx],
- pcr._cardnum,func,PCI_MAP_REG_START+0x0C);
- pcr._base4 = pci_config_read_long(pcr._pcibuses[pcr._pcibusidx],
- pcr._cardnum,func,PCI_MAP_REG_START+0x10);
- pcr._base5 = pci_config_read_long(pcr._pcibuses[pcr._pcibusidx],
- pcr._cardnum,func,PCI_MAP_REG_START+0x14);
- pcr._baserom = pci_config_read_long(pcr._pcibuses[pcr._pcibusidx],
- pcr._cardnum,func,PCI_MAP_ROM_REG);
-#if 0
- pcr._int_pin = pci_config_read_byte(pcr._pcibuses[pcr._pcibusidx],
- pcr._cardnum,func,PCI_INTERRUPT_PIN);
- pcr._int_line = pci_config_read_byte(pcr._pcibuses[pcr._pcibusidx],
- pcr._cardnum,func,PCI_INTERRUPT_REG);
- pcr._min_gnt = pci_config_read_byte(pcr._pcibuses[pcr._pcibusidx],
- pcr._cardnum,func,PCI_MIN_GNT);
- pcr._max_lat = pci_config_read_byte(pcr._pcibuses[pcr._pcibusidx],
- pcr._cardnum,func,PCI_MAX_LAT);
-#else
- pcr._max_min_ipin_iline = pci_config_read_long(pcr._pcibuses[pcr._pcibusidx],
- pcr._cardnum,func,PCI_INTERRUPT_REG);
-#endif
- pcr._user_config = pci_config_read_long(pcr._pcibuses[pcr._pcibusidx],
- pcr._cardnum,func,PCI_REG_USERCONFIG);
- /* check for pci-pci bridges */
-#define PCI_CLASS_MASK 0xff000000
-#define PCI_SUBCLASS_MASK 0x00ff0000
-#define PCI_CLASS_BRIDGE 0x06000000
-#define PCI_SUBCLASS_BRIDGE_PCI 0x00040000
- switch(pcr._class_revision & (PCI_CLASS_MASK|PCI_SUBCLASS_MASK)) {
- case PCI_CLASS_BRIDGE|PCI_SUBCLASS_BRIDGE_PCI:
- if (pcr._secondary_bus_number > 0) {
- pcr._pcibuses[pcr._pcinumbus++] = pcr._secondary_bus_number;
- }
- break;
- case PCI_CLASS_BRIDGE:
- if ( ++hostbridges > 1) {
- pcr._pcibuses[pcr._pcinumbus] = pcr._pcinumbus;
- pcr._pcinumbus++;
- }
- break;
- default:
- break;
- }
- if((func==0) && ((pcr._header_type & PCI_MULTIFUNC_DEV) == 0)) {
- /* not a multi function device */
- func = 8;
- } else {
- func++;
- }
-
- if (idx++ >= MAX_PCI_DEVICES)
- continue;
-
- identify_card(&pcr);
- } while( func < 8 );
- }
- } while (++pcr._pcibusidx < pcr._pcinumbus);
- }
-
-#if !defined(__alpha__) && !defined(__powerpc__)
- /* Now try pci config 2 probe (deprecated) */
-
- if ((pcr._configtype == 2) || do_mode2_scan) {
- OUTPORT8(PCI_MODE2_ENABLE_REG, 0xF1);
- OUTPORT8(PCI_MODE2_FORWARD_REG, 0x00); /* bus 0 for now */
-
- /*printf("\nPCI probing configuration type 2\n");*/
-
- pcr._pcibuses[0] = 0;
- pcr._pcinumbus = 1;
- pcr._pcibusidx = 0;
- idx = 0;
-
- do {
- for (pcr._ioaddr = 0xC000; pcr._ioaddr < 0xD000; pcr._ioaddr += 0x0100){
- OUTPORT8(PCI_MODE2_FORWARD_REG, pcr._pcibuses[pcr._pcibusidx]); /* bus 0 for now */
- pcr._device_vendor = INPORT32(pcr._ioaddr);
- OUTPORT8(PCI_MODE2_FORWARD_REG, 0x00); /* bus 0 for now */
-
- if ((pcr._vendor == 0xFFFF) || (pcr._device == 0xFFFF))
- continue;
- if ((pcr._vendor == 0xF0F0) || (pcr._device == 0xF0F0))
- continue; /* catch ASUS P55TP4XE motherboards */
-
- /*printf("\npci bus 0x%x slot at 0x%04x, vendor 0x%04x device 0x%04x\n",
- pcr._pcibuses[pcr._pcibusidx], pcr._ioaddr, pcr._vendor,
- pcr._device);*/
- pcibus = pcr._pcibuses[pcr._pcibusidx] ;
- pcicard = pcr._ioaddr ; pcifunc = 0 ;
-
- OUTPORT8(PCI_MODE2_FORWARD_REG, pcr._pcibuses[pcr._pcibusidx]); /* bus 0 for now */
- pcr._status_command = INPORT32(pcr._ioaddr + 0x04);
- pcr._class_revision = INPORT32(pcr._ioaddr + 0x08);
- pcr._bist_header_latency_cache = INPORT32(pcr._ioaddr + 0x0C);
- pcr._base0 = INPORT32(pcr._ioaddr + 0x10);
- pcr._base1 = INPORT32(pcr._ioaddr + 0x14);
- pcr._base2 = INPORT32(pcr._ioaddr + 0x18);
- pcr._base3 = INPORT32(pcr._ioaddr + 0x1C);
- pcr._base4 = INPORT32(pcr._ioaddr + 0x20);
- pcr._base5 = INPORT32(pcr._ioaddr + 0x24);
- pcr._baserom = INPORT32(pcr._ioaddr + 0x30);
- pcr._max_min_ipin_iline = INPORT8(pcr._ioaddr + 0x3C);
- pcr._user_config = INPORT32(pcr._ioaddr + 0x40);
- OUTPORT8(PCI_MODE2_FORWARD_REG, 0x00); /* bus 0 for now */
-
- /* check for pci-pci bridges (currently we only know Digital) */
- if ((pcr._vendor == 0x1011) && (pcr._device == 0x0001))
- if (pcr._secondary_bus_number > 0)
- pcr._pcibuses[pcr._pcinumbus++] = pcr._secondary_bus_number;
-
- if (idx++ >= MAX_PCI_DEVICES)
- continue;
-
- identify_card(&pcr);
- }
- } while (++pcr._pcibusidx < pcr._pcinumbus);
-
- OUTPORT8(PCI_MODE2_ENABLE_REG, 0x00);
- }
-
-#endif /* __alpha__ */
-
- disable_app_io();
- *num_pci = pcicards;
-
- return 0 ;
-
-}
-
-#if !defined(ENOTSUP)
-#if defined(EOPNOTSUPP)
-#define ENOTSUP EOPNOTSUPP
-#else
-#warning "ENOTSUP nor EOPNOTSUPP defined!"
-#endif
-#endif
-
-int pci_scan(pciinfo_t *pci_list,unsigned *num_pci)
-{
- int libdha_fd;
- if ( (libdha_fd = open("/dev/dhahelper",O_RDWR)) < 0)
- {
- return __pci_scan(pci_list,num_pci);
- }
- else
- {
- dhahelper_pci_device_t pci_dev;
- unsigned idx;
- idx = 0;
- while(ioctl(libdha_fd, DHAHELPER_PCI_FIND, &pci_dev)==0)
- {
- pci_list[idx].bus = pci_dev.bus;
- pci_list[idx].card = pci_dev.card;
- pci_list[idx].func = pci_dev.func;
- pci_list[idx].vendor = pci_dev.vendor;
- pci_list[idx].device = pci_dev.device;
- pci_list[idx].base0 = pci_dev.base0?pci_dev.base0:0xFFFFFFFF;
- pci_list[idx].base1 = pci_dev.base1?pci_dev.base1:0xFFFFFFFF;
- pci_list[idx].base2 = pci_dev.base2?pci_dev.base2:0xFFFFFFFF;
- pci_list[idx].baserom = pci_dev.baserom?pci_dev.baserom:0x000C0000;
- pci_list[idx].base3 = pci_dev.base3?pci_dev.base3:0xFFFFFFFF;
- pci_list[idx].base4 = pci_dev.base4?pci_dev.base4:0xFFFFFFFF;
- pci_list[idx].base5 = pci_dev.base5?pci_dev.base5:0xFFFFFFFF;
- pci_list[idx].irq = pci_dev.irq;
- pci_list[idx].ipin = pci_dev.ipin;
- pci_list[idx].gnt = pci_dev.gnt;
- pci_list[idx].lat = pci_dev.lat;
- idx++;
- }
- *num_pci=idx;
- close(libdha_fd);
- }
- return 0;
-}
-
-int pci_config_read(unsigned char bus, unsigned char dev, unsigned char func,
- unsigned char cmd, int len, unsigned long *val)
-{
- int ret;
- int dhahelper_fd;
- if ( (dhahelper_fd = open("/dev/dhahelper",O_RDWR)) > 0)
- {
- int retval;
- dhahelper_pci_config_t pcic;
- pcic.operation = PCI_OP_READ;
- pcic.bus = bus;
- pcic.dev = dev;
- pcic.func = func;
- pcic.cmd = cmd;
- pcic.size = len;
- retval = ioctl(dhahelper_fd, DHAHELPER_PCI_CONFIG, &pcic);
- close(dhahelper_fd);
- *val = pcic.ret;
- return retval;
- }
- ret = enable_app_io();
- if (ret != 0)
- return(ret);
- switch(len)
- {
- case 4:
- ret = pci_config_read_long(bus, dev, func, cmd);
- break;
- case 2:
- ret = pci_config_read_word(bus, dev, func, cmd);
- break;
- case 1:
- ret = pci_config_read_byte(bus, dev, func, cmd);
- break;
- default:
- printf("libdha_pci: wrong length to read: %u\n",len);
- }
- disable_app_io();
-
- *val = ret;
- return(0);
-}
-
-int pci_config_write(unsigned char bus, unsigned char dev, unsigned char func,
- unsigned char cmd, int len, unsigned long val)
-{
- int ret;
-
- int dhahelper_fd;
- if ( (dhahelper_fd = open("/dev/dhahelper",O_RDWR)) > 0)
- {
- int retval;
- dhahelper_pci_config_t pcic;
- pcic.operation = PCI_OP_WRITE;
- pcic.bus = bus;
- pcic.dev = dev;
- pcic.func = func;
- pcic.cmd = cmd;
- pcic.size = len;
- pcic.ret = val;
- retval = ioctl(dhahelper_fd, DHAHELPER_PCI_CONFIG, &pcic);
- close(dhahelper_fd);
- return retval;
- }
- ret = enable_app_io();
- if (ret != 0)
- return ret;
- switch(len)
- {
- case 4:
- pci_config_write_long(bus, dev, func, cmd, val);
- break;
- case 2:
- pci_config_write_word(bus, dev, func, cmd, val);
- break;
- case 1:
- pci_config_write_byte(bus, dev, func, cmd, val);
- break;
- default:
- printf("libdha_pci: wrong length to read: %u\n",len);
- }
- disable_app_io();
-
- return 0;
-}
diff --git a/src/video_out/libdha/pci_db2c.awk b/src/video_out/libdha/pci_db2c.awk
deleted file mode 100644
index feaa1c7a1..000000000
--- a/src/video_out/libdha/pci_db2c.awk
+++ /dev/null
@@ -1,267 +0,0 @@
-# This file converts given pci.db to "C" source and header files
-# For latest version of pci ids see: http://pciids.sf.net
-# Copyright 2002 Nick Kurshev
-#
-# Usage: awk -f pci_db2c.awk pci.db
-#
-# Tested with Gawk v 3.0.x and Mawk 1.3.3
-# But it should work with standard Awk implementations (hopefully).
-# (Nobody tested it with Nawk, but it should work, too).
-#
-
-BEGIN {
-
- if(ARGC != 2) {
-# check for arguments:
- print "Usage awk -f pci_db2c.awk pci.db (and make sure pci.db file exists first)";
- exit(1);
- }
- in_file = ARGV[1];
- vendor_file = "pci_vendors.h";
- ids_file = "pci_ids.h"
- name_file = "pci_names.c"
- name_h_file = "pci_names.h"
- dev_ids_file = "pci_dev_ids.c"
- line=0;
-# print out head lines
- print_head(vendor_file);
- print_head(ids_file);
- print_head(name_file);
- print_head(name_h_file);
- print_head(dev_ids_file);
- print "#ifndef PCI_VENDORS_INCLUDED" >vendor_file
- print "#define PCI_VENDORS_INCLUDED 1">vendor_file
- print "" >vendor_file
- print "#ifndef PCI_IDS_INCLUDED" >ids_file
- print "#define PCI_IDS_INCLUDED 1">ids_file
- print "" >ids_file
- print "#include \"pci_vendors.h\"">ids_file
- print "" >ids_file
-
- print "#ifndef PCI_NAMES_INCLUDED" >name_h_file
- print "#define PCI_NAMES_INCLUDED 1">name_h_file
- print "" >name_h_file
- print_name_struct(name_h_file);
- print "#include <stddef.h>">name_file
- print "#include \"pci_names.h\"">name_file
- print "#include \"pci_dev_ids.c\"">name_file
- print "">name_file
- print "static struct vendor_id_s vendor_ids[] = {">name_file
- first_pass=1;
- init_name_db();
- while(getline <in_file)
- {
-# count up lines
- line++;
- n=split($0, field, "[\t]");
- name_field = kill_double_quoting(field[3])
- if(field[1] == "v" && length(field[3])>0 && field[4] == "0")
- {
- init_device_db()
- svend_name = get_short_vendor_name(field[3])
- printf("#define VENDOR_%s\t", svend_name) >vendor_file;
- if(length(svend_name) < 9) printf("\t") >vendor_file;
- printf("0x%s /*%s*/\n",field[2], name_field) >vendor_file;
- printf("{ 0x%s, \"%s\", dev_lst_%s },\n",field[2], name_field, field[2]) >name_file;
- printf("/* Vendor: %s: %s */\n", field[2], name_field) > ids_file
- if(first_pass == 1) { first_pass=0; }
- else { print "{ 0xFFFF, NULL }\n};" >dev_ids_file; }
- printf("static const struct device_id_s dev_lst_%s[]={\n", field[2])>dev_ids_file
- }
- if(field[1] == "d" && length(field[3])>0 && field[4] == "0")
- {
- sdev_name = get_short_device_name(field[3])
- full_name = sprintf("#define DEVICE_%s_%s", svend_name, sdev_name);
- printf("%s\t", full_name) >ids_file
- if(length(full_name) < 9) printf("\t") >ids_file;
- if(length(full_name) < 17) printf("\t") >ids_file;
- if(length(full_name) < 25) printf("\t") >ids_file;
- if(length(full_name) < 32) printf("\t") >ids_file;
- if(length(full_name) < 40) printf("\t") >ids_file;
- if(length(full_name) < 48) printf("\t") >ids_file;
- printf("0x%s /*%s*/\n", substr(field[2], 5), name_field) >ids_file
- printf("{ 0x%s, \"%s\" },\n", substr(field[2], 5), name_field) >dev_ids_file
- }
- if(field[1] == "s" && length(field[3])>0 && field[4] == "0")
- {
- subdev_name = get_short_subdevice_name(field[3])
- full_name = sprintf("#define SUBDEVICE_%s_%s", svend_name, subdev_name)
- printf("\t%s\t", full_name) >ids_file
- if(length(full_name) < 9) printf("\t") >ids_file;
- if(length(full_name) < 17) printf("\t") >ids_file;
- if(length(full_name) < 25) printf("\t") >ids_file;
- if(length(full_name) < 32) printf("\t") >ids_file;
- if(length(full_name) < 40) printf("\t") >ids_file;
- printf("0x%s /*%s*/\n", substr(field[2], 9), name_field) >ids_file
- }
- }
- print "Total lines parsed:", line;
- print "">vendor_file
- print "#endif/*PCI_VENDORS_INCLUDED*/">vendor_file
- print "">ids_file
- print "#endif/*PCI_IDS_INCLUDED*/">ids_file
- print "">name_h_file
- print "#endif/*PCI_NAMES_INCLUDED*/">name_h_file
- print "};">name_file
- print "{ 0xFFFF, NULL }" >dev_ids_file;
- print "};">dev_ids_file
- print_func_bodies(name_file);
-}
-
-function print_head( out_file)
-{
- print "/*" >out_file;
- printf(" * File: %s\n", out_file) >out_file;
- printf(" * This file was generated automatically. Don't modify it.\n") >out_file;
- print "*/" >out_file;
- return;
-}
-
-function print_name_struct(out_file)
-{
- print "#ifdef __cplusplus" >out_file
- print "extern \"C\" {" >out_file
- print "#endif" >out_file
- print "">out_file
- print "struct device_id_s" >out_file
- print "{" >out_file
- print "\tunsigned short\tid;" >out_file
- print "\tconst char *\tname;" >out_file
- print "};" >out_file
- print "">out_file
- print "struct vendor_id_s" >out_file
- print "{" >out_file
- print "\tunsigned short\tid;" >out_file
- print "\tconst char *\tname;" >out_file
- print "\tconst struct device_id_s *\tdev_list;" >out_file
- print "};" >out_file
- print "extern const char *pci_vendor_name(unsigned short id);">out_file
- print "extern const char *pci_device_name(unsigned short vendor_id, unsigned short device_id);">out_file
- print "">out_file
- print "#ifdef __cplusplus" >out_file
- print "}" >out_file
- print "#endif" >out_file
- return
-}
-
-function print_func_bodies(out_file)
-{
- print "">out_file
- print "const char *pci_vendor_name(unsigned short id)" >out_file
- print "{" >out_file
- print " unsigned i;" >out_file
- print " for(i=0;i<sizeof(vendor_ids)/sizeof(struct vendor_id_s);i++)">out_file
- print " {" >out_file
- print "\tif(vendor_ids[i].id == id) return vendor_ids[i].name;" >out_file
- print " }" >out_file
- print " return NULL;" >out_file
- print "}">out_file
- print "" >out_file
- print "const char *pci_device_name(unsigned short vendor_id, unsigned short device_id)" >out_file
- print "{" >out_file
- print " unsigned i, j;" >out_file
- print " for(i=0;i<sizeof(vendor_ids)/sizeof(struct vendor_id_s);i++)">out_file
- print " {" >out_file
- print "\tif(vendor_ids[i].id == vendor_id)" >out_file
- print "\t{" >out_file
- print "\t j=0;" >out_file
- print "\t while(vendor_ids[i].dev_list[j].id != 0xFFFF)" >out_file
- print "\t {">out_file
- print "\t\tif(vendor_ids[i].dev_list[j].id == device_id) return vendor_ids[i].dev_list[j].name;">out_file
- print "\t\tj++;">out_file
- print "\t };">out_file
- print "\t break;" >out_file
- print "\t}" >out_file
- print " }" >out_file
- print " return NULL;">out_file
- print "}">out_file
- return
-}
-
-function kill_double_quoting(fld)
-{
- n=split(fld,phrases, "[\"]");
- new_fld = phrases[1]
- for(i=2;i<=n;i++) new_fld = sprintf("%s\\\"%s", new_fld, phrases[i])
- return new_fld
-}
-
-function init_name_db()
-{
- vendor_names[1]=""
-}
-
-function init_device_db()
-{
-# delete device_names
- for( i in device_names ) delete device_names[i];
- device_names[1]=""
-# delete subdevice_names
- for( i in subdevice_names ) delete subdevice_names[i];
- subdevice_names[1] = ""
-}
-
-function get_short_vendor_name(from)
-{
- n=split(from, name, "[ ]");
- new_name = toupper(name[1]);
- if(length(new_name)<3) new_name = sprintf("%s_%s", new_name, toupper(name[2]));
- n=split(new_name, name, "[^0-9A-Za-z]");
- svendor = name[1];
- for(i=2;i<=n;i++) svendor=sprintf("%s%s%s", svendor, length(name[i])?"_":"", name[i]);
- new_name = svendor;
- vend_suffix = 2;
-# check for unique
- while(new_name in vendor_names)
- {
- new_name = sprintf("%s%u", svendor, vend_suffix)
- vend_suffix = vend_suffix + 1;
- }
-# Add new name in array of vendor's names
- vendor_names[new_name] = new_name
- return new_name;
-}
-
-function get_short_device_name(from_name)
-{
- n=split(from_name, name, "[ ]");
- new_name = toupper(name[1]);
- if(length(name[2])) new_name = sprintf("%s_%s", new_name, toupper(name[2]));
- if(length(name[3])) new_name = sprintf("%s_%s", new_name, toupper(name[3]));
- n=split(new_name, name, "[^0-9A-Za-z]");
- sdevice = name[1];
- for(i=2;i<=n;i++) sdevice=sprintf("%s%s%s", sdevice, length(name[i])?"_":"", name[i]);
- new_name = sdevice;
- dev_suffix = 2;
-# check for unique
- while(new_name in device_names)
- {
- new_name = sprintf("%s%u", sdevice, dev_suffix)
- dev_suffix = dev_suffix + 1;
- }
-# Add new name in array of device names
- device_names[new_name] = new_name
- return new_name;
-}
-
-function get_short_subdevice_name(from_name)
-{
- n=split(from_name, name, "[ ]");
- new_name = toupper(name[1]);
- if(length(name[2])) new_name = sprintf("%s_%s", new_name, toupper(name[2]));
- if(length(name[3])) new_name = sprintf("%s_%s", new_name, toupper(name[3]));
- n=split(new_name, name, "[^0-9A-Za-z]");
- ssdevice = name[1];
- for(i=2;i<=n;i++) ssdevice=sprintf("%s%s%s", ssdevice, length(name[i])?"_":"", name[i]);
- new_name = ssdevice;
- sdev_suffix = 2;
-# check for unique
- while(new_name in subdevice_names)
- {
- new_name = sprintf("%s%u", ssdevice, sdev_suffix)
- sdev_suffix = sdev_suffix + 1;
- }
-# Add new name in array of subdevice names
- subdevice_names[new_name] = new_name
- return new_name;
-}
diff --git a/src/video_out/libdha/ports.c b/src/video_out/libdha/ports.c
deleted file mode 100644
index b531082d3..000000000
--- a/src/video_out/libdha/ports.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- (C) 2002 - library implementation by Nick Kyrshev
- XFree86 3.3.3 scanpci.c, modified for GATOS/win/gfxdump by Øyvind Aabling.
- */
-/* $XConsortium: scanpci.c /main/25 1996/10/27 11:48:40 kaleb $ */
-/*
- * name: scanpci.c
- *
- * purpose: This program will scan for and print details of
- * devices on the PCI bus.
-
- * author: Robin Cutshaw (robin@xfree86.org)
- *
- * supported O/S's: SVR4, UnixWare, SCO, Solaris,
- * FreeBSD, NetBSD, 386BSD, BSDI BSD/386,
- * Linux, Mach/386, ISC
- * DOS (WATCOM 9.5 compiler)
- *
- * compiling: [g]cc scanpci.c -o scanpci
- * for SVR4 (not Solaris), UnixWare use:
- * [g]cc -DSVR4 scanpci.c -o scanpci
- * for DOS, watcom 9.5:
- * wcc386p -zq -omaxet -7 -4s -s -w3 -d2 name.c
- * and link with PharLap or other dos extender for exe
- *
- */
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.c,v 3.34.2.17 1998/11/10 11:55:40 dawes Exp $ */
-
-/*
- * Copyright 1995 by Robin Cutshaw <robin@XFree86.Org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of the above listed copyright holder(s)
- * not be used in advertising or publicity pertaining to distribution of
- * the software without specific, written prior permission. The above listed
- * copyright holder(s) make(s) no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM(S) ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
- * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-#include <sys/ioctl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#ifdef ARCH_ALPHA
-#include <sys/io.h>
-#endif
-#include <unistd.h>
-
-#include "libdha.h"
-#include "AsmMacros.h"
-#include "kernelhelper/dhahelper.h"
-
-/* OS depended stuff */
-#if defined (linux)
-#include "sysdep/pci_linux.c"
-#elif defined (__FreeBSD__)
-#include "sysdep/pci_freebsd.c"
-#elif defined (__386BSD__)
-#include "sysdep/pci_386bsd.c"
-#elif defined (__NetBSD__)
-#include "sysdep/pci_netbsd.c"
-#elif defined (__OpenBSD__)
-#include "sysdep/pci_openbsd.c"
-#elif defined (__bsdi__)
-#include "sysdep/pci_bsdi.c"
-#elif defined (Lynx)
-#include "sysdep/pci_lynx.c"
-#elif defined (MACH386)
-#include "sysdep/pci_mach386.c"
-#elif defined (__SVR4)
-#if !defined(SVR4)
-#define SVR4
-#endif
-#include "sysdep/pci_svr4.c"
-#elif defined (SCO)
-#include "sysdep/pci_sco.c"
-#elif defined (ISC)
-#include "sysdep/pci_isc.c"
-#elif defined (__EMX__)
-#include "sysdep/pci_os2.c"
-#elif defined (_WIN32) || defined(__CYGWIN__)
-#include "sysdep/pci_win32.c"
-#else
-#include "sysdep/pci_generic_os.c"
-#endif
-
-static int dhahelper_fd=-1;
-static unsigned dhahelper_counter=0;
-int enable_app_io( void )
-{
- if((dhahelper_fd=open("/dev/dhahelper",O_RDWR)) < 0) return enable_os_io();
- dhahelper_counter++;
- return 0;
-}
-
-int disable_app_io( void )
-{
- dhahelper_counter--;
- if(dhahelper_fd > 0)
- {
- if(!dhahelper_counter)
- {
- close(dhahelper_fd);
- dhahelper_fd = -1;
- }
- }
- else return disable_os_io();
- return 0;
-}
-
-unsigned char INPORT8(unsigned idx)
-{
- if (dhahelper_fd > 0)
- {
- dhahelper_port_t _port;
-
- _port.operation = PORT_OP_READ;
- _port.addr = idx;
- _port.size = 1;
- if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0)
- return _port.value;
- }
- return inb(idx);
-}
-
-unsigned short INPORT16(unsigned idx)
-{
- if (dhahelper_fd > 0)
- {
- dhahelper_port_t _port;
-
- _port.operation = PORT_OP_READ;
- _port.addr = idx;
- _port.size = 2;
- if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0)
- return _port.value;
- }
- return inw(idx);
-}
-
-unsigned INPORT32(unsigned idx)
-{
- if (dhahelper_fd > 0)
- {
- dhahelper_port_t _port;
-
- _port.operation = PORT_OP_READ;
- _port.addr = idx;
- _port.size = 4;
- if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0)
- return _port.value;
- }
- return inl(idx);
-}
-
-void OUTPORT8(unsigned idx,unsigned char val)
-{
- if (dhahelper_fd > 0)
- {
- dhahelper_port_t _port;
-
- _port.operation = PORT_OP_WRITE;
- _port.addr = idx;
- _port.size = 1;
- _port.value = val;
- if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0)
- return;
- }
- else outb(idx,val);
-}
-
-void OUTPORT16(unsigned idx,unsigned short val)
-{
- if (dhahelper_fd > 0)
- {
- dhahelper_port_t _port;
-
- _port.operation = PORT_OP_WRITE;
- _port.addr = idx;
- _port.size = 2;
- _port.value = val;
- if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0)
- return;
- }
- else outw(idx,val);
-}
-
-void OUTPORT32(unsigned idx,unsigned val)
-{
- if (dhahelper_fd > 0)
- {
- dhahelper_port_t _port;
-
- _port.operation = PORT_OP_WRITE;
- _port.addr = idx;
- _port.size = 4;
- _port.value = val;
- if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0)
- return;
- }
- else outl(idx,val);
-}
-
diff --git a/src/video_out/libdha/sysdep/AsmMacros_alpha.h b/src/video_out/libdha/sysdep/AsmMacros_alpha.h
deleted file mode 100644
index 59da53891..000000000
--- a/src/video_out/libdha/sysdep/AsmMacros_alpha.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- This file is based on:
- $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/util/AsmMacros.h,v 1.1 2001/11/16 21:13:34 tsi Exp $
- Modified for readability by Nick Kurshev
-*/
-
-#ifndef __ASM_MACROS_ALPHA_H
-#define __ASM_MACROS_ALPHA_H
-#if defined (linux)
-#include <sys/io.h>
-#elif defined (__FreeBSD__)
-#include <sys/types.h>
-extern void outb(u_int32_t port, u_int8_t val);
-extern void outw(u_int32_t port, u_int16_t val);
-extern void outl(u_int32_t port, u_int32_t val);
-extern u_int8_t inb(u_int32_t port);
-extern u_int16_t inw(u_int32_t port);
-extern u_int32_t inl(u_int32_t port);
-#else
-#include "sysdep/AsmMacros_generic.h"
-#endif
-
-#define intr_disable()
-#define intr_enable()
-
-#endif
diff --git a/src/video_out/libdha/sysdep/AsmMacros_arm32.h b/src/video_out/libdha/sysdep/AsmMacros_arm32.h
deleted file mode 100644
index e618d32ee..000000000
--- a/src/video_out/libdha/sysdep/AsmMacros_arm32.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- This file is based on:
- $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/util/AsmMacros.h,v 1.1 2001/11/16 21:13:34 tsi Exp $
- Modified for readability by Nick Kurshev
-*/
-
-#ifndef __ASM_MACROS_ARM32_H
-#define __ASM_MACROS_ARM32_H
-unsigned int IOPortBase; /* Memory mapped I/O port area */
-
-static __inline__ void outb(short port,char val)
-{
- if ((unsigned short)port >= 0x400) return;
- *(volatile unsigned char*)(((unsigned short)(port))+IOPortBase) = val;
-}
-
-static __inline__ void outw(short port,short val)
-{
- if ((unsigned short)port >= 0x400) return;
- *(volatile unsigned short*)(((unsigned short)(port))+IOPortBase) = val;
-}
-
-static __inline__ void outl(short port,int val)
-{
- if ((unsigned short)port >= 0x400) return;
- *(volatile unsigned long*)(((unsigned short)(port))+IOPortBase) = val;
-}
-
-static __inline__ unsigned int inb(short port)
-{
- if ((unsigned short)port >= 0x400) return((unsigned int)-1);
- return(*(volatile unsigned char*)(((unsigned short)(port))+IOPortBase));
-}
-
-static __inline__ unsigned int inw(short port)
-{
- if ((unsigned short)port >= 0x400) return((unsigned int)-1);
- return(*(volatile unsigned short*)(((unsigned short)(port))+IOPortBase));
-}
-
-static __inline__ unsigned int inl(short port)
-{
- if ((unsigned short)port >= 0x400) return((unsigned int)-1);
- return(*(volatile unsigned long*)(((unsigned short)(port))+IOPortBase));
-}
-
-#define intr_disable()
-#define intr_enable()
-
-#endif
diff --git a/src/video_out/libdha/sysdep/AsmMacros_generic.h b/src/video_out/libdha/sysdep/AsmMacros_generic.h
deleted file mode 100644
index 183f831e5..000000000
--- a/src/video_out/libdha/sysdep/AsmMacros_generic.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- Generic stuff to compile VIDIX only on any system (SCRATCH)
-*/
-
-#ifndef __ASM_MACROS_GENERIC_H
-#define __ASM_MACROS_GENERIC_H
-
-#warning This stuff is not ported on your system
-
-static __inline__ void outb(short port,char val)
-{
- printf("outb: generic function call\n");
- return;
-}
-
-static __inline__ void outw(short port,short val)
-{
- printf("outw: generic function call\n");
- return;
-}
-
-static __inline__ void outl(short port,unsigned int val)
-{
- printf("outl: generic function call\n");
- return;
-}
-
-static __inline__ unsigned int inb(short port)
-{
- printf("inb: generic function call\n");
- return 0;
-}
-
-static __inline__ unsigned int inw(short port)
-{
- printf("inw: generic function call\n");
- return 0;
-}
-
-static __inline__ unsigned int inl(short port)
-{
- printf("inl: generic function call\n");
- return 0;
-}
-
-static __inline__ void intr_disable()
-{
- printf("intr_disable: generic function call\n");
-}
-
-static __inline__ void intr_enable()
-{
- printf("intr_enable: generic function call\n");
-}
-
-#endif
diff --git a/src/video_out/libdha/sysdep/AsmMacros_ia64.h b/src/video_out/libdha/sysdep/AsmMacros_ia64.h
deleted file mode 100644
index 7d6123f33..000000000
--- a/src/video_out/libdha/sysdep/AsmMacros_ia64.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- This file is based on:
- $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/util/AsmMacros.h,v 1.1 2001/11/16 21:13:34 tsi Exp $
- Modified for readability by Nick Kurshev
-*/
-
-#ifndef __ASM_MACROS_IA64_H
-#define __ASM_MACROS_IA64_H
-
-#if defined(linux)
-#include <sys/io.h>
-#else
-#include "sysdep/AsmMacros_generic.h"
-#endif
-
-#endif
diff --git a/src/video_out/libdha/sysdep/AsmMacros_powerpc.h b/src/video_out/libdha/sysdep/AsmMacros_powerpc.h
deleted file mode 100644
index 2169c96b4..000000000
--- a/src/video_out/libdha/sysdep/AsmMacros_powerpc.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- This file is based on:
- $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/util/AsmMacros.h,v 1.1 2001/11/16 21:13:34 tsi Exp $
- Modified for readability by Nick Kurshev
-*/
-
-#ifndef __ASM_MACROS_POWERPC_H
-#define __ASM_MACROS_POWERPC_H
-
-#if defined(Lynx) || defined(__OpenBSD__)
-
-extern unsigned char *ioBase;
-
-static __inline__ volatile void eieio()
-{
- __asm__ __volatile__ ("eieio");
-}
-
-static __inline__ void outb(short port, unsigned char value)
-{
- *(unsigned char *)(ioBase + port) = value; eieio();
-}
-
-static __inline__ void outw(short port, unsigned short value)
-{
- *(unsigned short *)(ioBase + port) = value; eieio();
-}
-
-static __inline__ void outl(short port, unsigned short value)
-{
- *(unsigned long *)(ioBase + port) = value; eieio();
-}
-
-static __inline__ unsigned char inb(short port)
-{
- unsigned char val;
- val = *((unsigned char *)(ioBase + port)); eieio();
- return(val);
-}
-
-static __inline__ unsigned short inw(short port)
-{
- unsigned short val;
- val = *((unsigned short *)(ioBase + port)); eieio();
- return(val);
-}
-
-static __inline__ unsigned long inl(short port)
-{
- unsigned long val;
- val = *((unsigned long *)(ioBase + port)); eieio();
- return(val);
-}
-
-#define intr_disable()
-#define intr_enable()
-
-#else
- #ifdef linux
- /*nothing*/
- #else
- #include "sysdep/AsmMacros_generic.h"
- #endif
-#endif
-
-#endif
diff --git a/src/video_out/libdha/sysdep/AsmMacros_sparc.h b/src/video_out/libdha/sysdep/AsmMacros_sparc.h
deleted file mode 100644
index f6717b4bb..000000000
--- a/src/video_out/libdha/sysdep/AsmMacros_sparc.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- This file is based on:
- $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/util/AsmMacros.h,v 1.1 2001/11/16 21:13:34 tsi Exp $
- Modified for readability by Nick Kurshev
-*/
-
-#ifndef __ASM_MACROS_SPARC_H
-#define __ASM_MACROS_SPARC_H
-
-#ifndef ASI_PL
-#define ASI_PL 0x88
-#endif
-
-static __inline__ void outb(unsigned long port, char val)
-{
- __asm__ __volatile__("stba %0, [%1] %2" : : "r" (val), "r" (port), "i" (ASI_PL));
-}
-
-static __inline__ void outw(unsigned long port, char val)
-{
- __asm__ __volatile__("stha %0, [%1] %2" : : "r" (val), "r" (port), "i" (ASI_PL));
-}
-
-static __inline__ void outl(unsigned long port, char val)
-{
- __asm__ __volatile__("sta %0, [%1] %2" : : "r" (val), "r" (port), "i" (ASI_PL));
-}
-
-static __inline__ unsigned int inb(unsigned long port)
-{
- unsigned char ret;
- __asm__ __volatile__("lduba [%1] %2, %0" : "=r" (ret) : "r" (port), "i" (ASI_PL));
- return ret;
-}
-
-static __inline__ unsigned int inw(unsigned long port)
-{
- unsigned char ret;
- __asm__ __volatile__("lduha [%1] %2, %0" : "=r" (ret) : "r" (port), "i" (ASI_PL));
- return ret;
-}
-
-static __inline__ unsigned int inl(unsigned long port)
-{
- unsigned char ret;
- __asm__ __volatile__("lda [%1] %2, %0" : "=r" (ret) : "r" (port), "i" (ASI_PL));
- return ret;
-}
-
-#define intr_disable()
-#define intr_enable()
-
-#endif
diff --git a/src/video_out/libdha/sysdep/AsmMacros_x86.h b/src/video_out/libdha/sysdep/AsmMacros_x86.h
deleted file mode 100644
index 97dcaae16..000000000
--- a/src/video_out/libdha/sysdep/AsmMacros_x86.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- This file is based on:
- $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/util/AsmMacros.h,v 1.1 2001/11/16 21:13:34 tsi Exp $
- Modified for readability by Nick Kurshev
-*/
-
-#ifndef __ASM_MACROS_X86_H
-#define __ASM_MACROS_X86_H
-
-#if defined (WINNT)
-#include "sysdep/AsmMacros_generic.h"
-#else
-
-#include "config.h"
-
-static __inline__ void outb(short port,char val)
-{
- __asm__ __volatile__("outb %0,%1" : :"a" (val), "d" (port));
- return;
-}
-
-static __inline__ void outw(short port,short val)
-{
- __asm__ __volatile__("outw %0,%1" : :"a" (val), "d" (port));
- return;
-}
-
-static __inline__ void outl(short port,unsigned int val)
-{
- __asm__ __volatile__("outl %0,%1" : :"a" (val), "d" (port));
- return;
-}
-
-static __inline__ unsigned int inb(short port)
-{
- unsigned char ret;
- __asm__ __volatile__("inb %1,%0" :
- "=a" (ret) :
- "d" (port));
- return ret;
-}
-
-static __inline__ unsigned int inw(short port)
-{
- unsigned short ret;
- __asm__ __volatile__("inw %1,%0" :
- "=a" (ret) :
- "d" (port));
- return ret;
-}
-
-static __inline__ unsigned int inl(short port)
-{
- unsigned int ret;
- __asm__ __volatile__("inl %1,%0" :
- "=a" (ret) :
- "d" (port));
- return ret;
-}
-
-static __inline__ void intr_disable()
-{
- __asm__ __volatile__("cli");
-}
-
-static __inline__ void intr_enable()
-{
- __asm__ __volatile__("sti");
-}
-
-#endif
-#endif
diff --git a/src/video_out/libdha/sysdep/Makefile.am b/src/video_out/libdha/sysdep/Makefile.am
deleted file mode 100644
index 807572c39..000000000
--- a/src/video_out/libdha/sysdep/Makefile.am
+++ /dev/null
@@ -1,35 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-EXTRA_DIST = \
- libdha_os2.c \
- libdha_win32.c \
- pci_386bsd.c \
- pci_alpha.c \
- pci_arm32.c \
- pci_bsdi.c \
- pci_freebsd.c \
- pci_generic_cpu.c \
- pci_generic_os.c \
- pci_ia64.c \
- pci_isc.c \
- pci_linux.c \
- pci_lynx.c \
- pci_mach386.c \
- pci_netbsd.c \
- pci_openbsd.c \
- pci_os2.c \
- pci_powerpc.c \
- pci_sco.c \
- pci_sparc.c \
- pci_svr4.c \
- pci_win32.c \
- pci_x86.c
-
-noinst_HEADERS = \
- AsmMacros_alpha.h \
- AsmMacros_arm32.h \
- AsmMacros_generic.h \
- AsmMacros_ia64.h \
- AsmMacros_powerpc.h \
- AsmMacros_sparc.h \
- AsmMacros_x86.h
diff --git a/src/video_out/libdha/sysdep/libdha_os2.c b/src/video_out/libdha/sysdep/libdha_os2.c
deleted file mode 100644
index 041f6be71..000000000
--- a/src/video_out/libdha/sysdep/libdha_os2.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/os2/os2_video.c,v 3.14 2000/10/28 01:42:28 mvojkovi Exp $ */
-/* Modified for libdha by Nick Kurshev. */
-/*
- * (c) Copyright 1994,1999 by Holger Veit
- * <Holger.Veit@gmd.de>
- * Modified 1996 by Sebastien Marineau <marineau@genie.uottawa.ca>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * HOLGER VEIT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Holger Veit shall not be
- * used in advertising or otherwise to promote the sale, use or other dealings
- * in this Software without prior written authorization from Holger Veit.
- *
- */
-/* $XConsortium: os2_video.c /main/8 1996/10/27 11:49:02 kaleb $ */
-
-#define INCL_DOSFILEMGR
-#include "os2.h"
-
-/***************************************************************************/
-/* Video Memory Mapping helper functions */
-/***************************************************************************/
-
-/* This section uses the xf86sup.sys driver developed for xfree86.
- * The driver allows mapping of physical memory
- * You must install it with a line DEVICE=path\xf86sup.sys in config.sys.
- */
-
-static HFILE mapdev = -1;
-static ULONG stored_virt_addr;
-static char* mappath = "\\DEV\\PMAP$";
-static HFILE open_mmap()
-{
- APIRET rc;
- ULONG action;
-
- if (mapdev != -1)
- return mapdev;
-
- rc = DosOpen((PSZ)mappath, (PHFILE)&mapdev, (PULONG)&action,
- (ULONG)0, FILE_SYSTEM, FILE_OPEN,
- OPEN_SHARE_DENYNONE|OPEN_FLAGS_NOINHERIT|OPEN_ACCESS_READONLY,
- (ULONG)0);
- if (rc!=0)
- mapdev = -1;
- return mapdev;
-}
-
-static void close_mmap()
-{
- if (mapdev != -1)
- DosClose(mapdev);
- mapdev = -1;
-}
-
-/* this structure is used as a parameter packet for the direct access
- * ioctl of pmap$
- */
-
-/* Changed here for structure of driver PMAP$ */
-
-typedef struct{
- ULONG addr;
- ULONG size;
-} DIOParPkt;
-
-/* This is the data packet for the mapping function */
-
-typedef struct {
- ULONG addr;
- USHORT sel;
-} DIODtaPkt;
-
-/***************************************************************************/
-/* Video Memory Mapping section */
-/***************************************************************************/
-
-static long callcount = 0L;
-
-/* ARGSUSED */
-void * map_phys_mem(unsigned long base, unsigned long size)
-{
- DIOParPkt par;
- ULONG plen;
- DIODtaPkt dta;
- ULONG dlen;
- static BOOL ErrRedir = FALSE;
- APIRET rc;
-
- par.addr = (ULONG)base;
- par.size = (ULONG)size;
- plen = sizeof(par);
- dlen = sizeof(dta);
-
- open_mmap();
- if (mapdev == -1)
- {
- perror("libdha: device xf86sup.sys is not installed");
- exit(1);
- }
- if ((rc=DosDevIOCtl(mapdev, (ULONG)0x76, (ULONG)0x44,
- (PVOID)&par, (ULONG)plen, (PULONG)&plen,
- (PVOID)&dta, (ULONG)dlen, (PULONG)&dlen)) == 0) {
- if (dlen==sizeof(dta)) {
- callcount++;
- return (void *)dta.addr;
- }
- /*else fail*/
- }
- return (void *)-1;
-}
-
-/* ARGSUSED */
-void unmap_phys_mem(void * base, unsigned long size)
-{
- DIOParPkt par;
- ULONG plen,vmaddr;
-
-/* We need here the VIRTADDR for unmapping, not the physical address */
-/* This should be taken care of either here by keeping track of allocated */
-/* pointers, but this is also already done in the driver... Thus it would */
-/* be a waste to do this tracking twice. Can this be changed when the fn. */
-/* is called? This would require tracking this function in all servers, */
-/* and changing it appropriately to call this with the virtual adress */
-/* If the above mapping function is only called once, then we can store */
-/* the virtual adress and use it here.... */
-
- par.addr = (ULONG)base;
- par.size = 0xffffffff; /* This is the virtual address parameter. Set this to ignore */
- plen = sizeof(par);
-
- if (mapdev != -1)
- {
- DosDevIOCtl(mapdev, (ULONG)0x76, (ULONG)0x46,
- (PVOID)&par, (ULONG)plen, (PULONG)&plen,
- &vmaddr, sizeof(ULONG), &plen);
- callcount--;
- }
-/* Now if more than one region has been allocated and we close the driver,
- * the other pointers will immediately become invalid. We avoid closing
- * driver for now, but this should be fixed for server exit
- */
-
- if(!callcount) close_mmap();
-}
diff --git a/src/video_out/libdha/sysdep/libdha_win32.c b/src/video_out/libdha/sysdep/libdha_win32.c
deleted file mode 100644
index 75c5dfb94..000000000
--- a/src/video_out/libdha/sysdep/libdha_win32.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- MAPDEV.h - include file for VxD MAPDEV
- Copyright (c) 1996 Vireo Software, Inc.
- Modified for libdha by Nick Kurshev.
-*/
-
-#include <windows.h>
-
-/*
- This is the request structure that applications use
- to request services from the MAPDEV VxD.
-*/
-
-typedef struct _MapDevRequest
-{
- DWORD mdr_ServiceID; /* supplied by caller */
- LPVOID mdr_PhysicalAddress; /* supplied by caller */
- DWORD mdr_SizeInBytes; /* supplied by caller */
- LPVOID mdr_LinearAddress; /* returned by VxD */
- WORD mdr_Selector; /* returned if 16-bit caller */
- WORD mdr_Status; /* MDR_xxxx code below */
-} MAPDEVREQUEST, *PMAPDEVREQUEST;
-
-#define MDR_SERVICE_MAP CTL_CODE(FILE_DEVICE_UNKNOWN, 1, METHOD_NEITHER, FILE_ANY_ACCESS)
-#define MDR_SERVICE_UNMAP CTL_CODE(FILE_DEVICE_UNKNOWN, 2, METHOD_NEITHER, FILE_ANY_ACCESS)
-
-#define MDR_STATUS_SUCCESS 1
-#define MDR_STATUS_ERROR 0
-/*#include "winioctl.h"*/
-#define FILE_DEVICE_UNKNOWN 0x00000022
-#define METHOD_NEITHER 3
-#define FILE_ANY_ACCESS 0
-#define CTL_CODE( DeviceType, Function, Method, Access ) ( \
- ((DeviceType)<<16) | ((Access)<<14) | ((Function)<<2) | (Method) )
-
-/* Memory Map a piece of Real Memory */
-void *map_phys_mem(unsigned base, unsigned size) {
-
- HANDLE hDevice ;
- PVOID inBuf[1] ; /* buffer for struct pointer to VxD */
- DWORD RetInfo[2] ; /* buffer to receive data from VxD */
- DWORD cbBytesReturned ; /* count of bytes returned from VxD */
- MAPDEVREQUEST req ; /* map device request structure */
- DWORD *pNicstar, Status, Time ; int i ; char *endptr ;
- const PCHAR VxDName = "\\\\.\\MAPDEV.VXD" ;
- const PCHAR VxDNameAlreadyLoaded = "\\\\.\\MAPDEV" ;
-
- hDevice = CreateFile(VxDName, 0,0,0,
- CREATE_NEW, FILE_FLAG_DELETE_ON_CLOSE, 0) ;
- if (hDevice == INVALID_HANDLE_VALUE)
- hDevice = CreateFile(VxDNameAlreadyLoaded, 0,0,0,
- CREATE_NEW, FILE_FLAG_DELETE_ON_CLOSE, 0) ;
- if (hDevice == INVALID_HANDLE_VALUE) {
- fprintf(stderr, "Cannot open driver, error=%08lx\n", GetLastError()) ;
- exit(1) ; }
-
- req.mdr_ServiceID = MDR_SERVICE_MAP ;
- req.mdr_PhysicalAddress = (PVOID)base ;
- req.mdr_SizeInBytes = size ;
- inBuf[0] = &req ;
-
- if ( ! DeviceIoControl(hDevice, MDR_SERVICE_MAP, inBuf, sizeof(PVOID),
- NULL, 0, &cbBytesReturned, NULL) ) {
- fprintf(stderr, "Failed to map device\n") ; exit(1) ; }
-
- return (void*)req.mdr_LinearAddress ;
-}
-
-void unmap_phys_mem(void *ptr, unsigned size) { }
-
diff --git a/src/video_out/libdha/sysdep/pci_386bsd.c b/src/video_out/libdha/sysdep/pci_386bsd.c
deleted file mode 100644
index d00ecb078..000000000
--- a/src/video_out/libdha/sysdep/pci_386bsd.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- This file is based on:
- $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.c,v 3.34.2.17 1998/11/10 11:55:40 dawes Exp $
- Modified for readability by Nick Kurshev
-*/
-#include <errno.h>
-#include <sys/file.h>
-#include <machine/console.h>
-#ifndef GCCUSESGAS
-#define GCCUSESGAS
-#endif
-
-static int io_fd;
-
-static __inline__ int enable_os_io(void)
-{
- io_fd = -1 ;
- if ((io_fd = open("/dev/console", O_RDWR, 0)) < 0) {
- perror("/dev/console");
- return(errno);
- }
- if (ioctl(io_fd, KDENABIO, 0) < 0) {
- perror("ioctl(KDENABIO)");
- return(errno);
- }
- return(0);
-}
-
-static __inline__ int disable_os_io(void)
-{
- if (ioctl(io_fd, KDDISABIO, 0) < 0) {
- perror("ioctl(KDDISABIO)");
- close(io_fd);
- return(errno);
- }
- close(io_fd);
- return(0);
-}
diff --git a/src/video_out/libdha/sysdep/pci_alpha.c b/src/video_out/libdha/sysdep/pci_alpha.c
deleted file mode 100644
index 74c3eb687..000000000
--- a/src/video_out/libdha/sysdep/pci_alpha.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- This file is based on:
- $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.c,v 3.34.2.17 1998/11/10 11:55:40 dawes Exp $
- Modified for readability by Nick Kurshev
-*/
-
-static int pci_config_type( void ) { return 1; }
-
-static int pci_get_vendor(
- unsigned char bus,
- unsigned char dev,
- int func)
-{
- unsigned long retval;
- pciconfig_read(bus, dev<<3, PCI_ID_REG, 4, &retval);
- return retval;
-}
-
-static long pci_config_read_long(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd)
-{
- unsigned long retval;
- pciconfig_read(bus, dev<<3, cmd, 4, &retval);
- return retval;
-}
-
-static long pci_config_read_word(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd)
-{
- unsigned long retval;
- pciconfig_read(bus, dev<<3, cmd, 2, &retval);
- return retval;
-}
-
-static long pci_config_read_byte(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd)
-{
- unsigned long retval;
- pciconfig_read(bus, dev<<3, cmd, 1, &retval);
- return retval;
-}
-
-static void pci_config_write_long(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd,
- long val)
-{
- pciconfig_write(bus, dev<<3, cmd, 4, val);
-}
-
-static void pci_config_write_word(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd,
- long val)
-{
- pciconfig_write(bus, dev<<3, cmd, 2, val);
-}
-
-static void pci_config_write_byte(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd,
- long val)
-{
- pciconfig_write(bus, dev<<3, cmd, 1, val);
-}
diff --git a/src/video_out/libdha/sysdep/pci_arm32.c b/src/video_out/libdha/sysdep/pci_arm32.c
deleted file mode 100644
index 6920b615e..000000000
--- a/src/video_out/libdha/sysdep/pci_arm32.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- This file is based on:
- $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.c,v 3.34.2.17 1998/11/10 11:55:40 dawes Exp $
- Modified for readability by Nick Kurshev
-*/
-
-static int pci_config_type( void )
-{
- unsigned long tmplong1, tmplong2;
- unsigned char tmp1, tmp2;
- int retval;
- retval = 0;
-
- OUTPORT8(PCI_MODE2_ENABLE_REG, 0x00);
- OUTPORT8(PCI_MODE2_FORWARD_REG, 0x00);
- tmp1 = INPORT8(PCI_MODE2_ENABLE_REG);
- tmp2 = INPORT8(PCI_MODE2_FORWARD_REG);
- if ((tmp1 == 0x00) && (tmp2 == 0x00)) {
- retval = 2;
- /*printf("PCI says configuration type 2\n");*/
- } else {
- tmplong1 = INPORT32(PCI_MODE1_ADDRESS_REG);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, PCI_EN);
- tmplong2 = INPORT32(PCI_MODE1_ADDRESS_REG);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, tmplong1);
- if (tmplong2 == PCI_EN) {
- retval = 1;
- /*printf("PCI says configuration type 1\n");*/
- } else {
- /*printf("No PCI !\n");*/
- disable_app_io();
- /*exit(1);*/
- retval = 0xFFFF;
- }
- }
- return retval;
-}
-
-static int pci_get_vendor(
- unsigned char bus,
- unsigned char dev,
- int func)
-{
- unsigned long config_cmd;
- config_cmd = PCI_EN | (bus<<16) | (dev<<11) | (func<<8);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, config_cmd);
- return INPORT32(PCI_MODE1_DATA_REG);
-}
-
-static long pci_config_read_long(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd)
-{
- unsigned long config_cmd;
- config_cmd = PCI_EN | (bus<<16) | (dev<<11) | (func<<8);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, config_cmd | cmd);
- return INPORT32(PCI_MODE1_DATA_REG);
-}
-
-static long pci_config_read_word(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd)
-{
- unsigned long config_cmd;
- config_cmd = PCI_EN | (bus<<16) | (dev<<11) | (func<<8);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, config_cmd | cmd);
- return INPORT16(PCI_MODE1_DATA_REG);
-}
-
-static long pci_config_read_byte(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd)
-{
- unsigned long config_cmd;
- config_cmd = PCI_EN | (bus<<16) | (dev<<11) | (func<<8);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, config_cmd | cmd);
- return INPORT8(PCI_MODE1_DATA_REG);
-}
-
-static void pci_config_write_long(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd,
- long val)
-{
- unsigned long config_cmd;
- config_cmd = PCI_EN | (bus<<16) | (dev<<11) | (func<<8);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, config_cmd | cmd);
- OUTPORT32(PCI_MODE1_DATA_REG,val);
-}
-
-static void pci_config_write_word(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd,
- unsigned val)
-{
- unsigned long config_cmd;
- config_cmd = PCI_EN | (bus<<16) | (dev<<11) | (func<<8);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, config_cmd | cmd);
- OUTPORT16(PCI_MODE1_DATA_REG,val);
-}
-
-static void pci_config_write_byte(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd,
- long val)
-{
- unsigned long config_cmd;
- config_cmd = PCI_EN | (bus<<16) | (dev<<11) | (func<<8);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, config_cmd | cmd);
- OUTPORT8(PCI_MODE1_DATA_REG,val);
-}
diff --git a/src/video_out/libdha/sysdep/pci_bsdi.c b/src/video_out/libdha/sysdep/pci_bsdi.c
deleted file mode 100644
index b6b142054..000000000
--- a/src/video_out/libdha/sysdep/pci_bsdi.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- This file is based on:
- $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.c,v 3.34.2.17 1998/11/10 11:55:40 dawes Exp $
- Modified for readability by Nick Kurshev
-*/
-#include <errno.h>
-#include <sys/file.h>
-#include <sys/ioctl.h>
-#include <i386/isa/pcconsioctl.h>
-#ifndef GCCUSESGAS
-#define GCCUSESGAS
-#endif
-
-static int io_fd;
-
-static __inline__ int enable_os_io(void)
-{
- io_fd = -1 ;
- if ((io_fd = open("/dev/console", O_RDWR, 0)) < 0) {
- perror("/dev/console");
- return(errno);
- }
- if (ioctl(io_fd, PCCONENABIOPL, 0) < 0) {
- perror("ioctl(PCCONENABIOPL)");
- return(errno);
- }
- return(0);
-}
-
-static __inline__ int disable_os_io(void)
-{
- if (ioctl(io_fd, PCCONDISABIOPL, 0) < 0) {
- perror("ioctl(PCCONDISABIOPL)");
- close(io_fd);
- return(errno);
- }
- close(io_fd);
- return(0);
-}
diff --git a/src/video_out/libdha/sysdep/pci_freebsd.c b/src/video_out/libdha/sysdep/pci_freebsd.c
deleted file mode 100644
index 9ad4b15f2..000000000
--- a/src/video_out/libdha/sysdep/pci_freebsd.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- This file is based on:
- $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.c,v 3.34.2.17 1998/11/10 11:55:40 dawes Exp $
- Modified for readability by Nick Kurshev
-*/
-#include <errno.h>
-#include <sys/file.h>
-/* machine/console.h seems to be outdated by recent FreeBSD *
- * however pcvt_ioctl.h seems to exist for very long time */
-/* #include <machine/console.h>*/
-#include <machine/pcvt_ioctl.h>
-#ifndef GCCUSESGAS
-#define GCCUSESGAS
-#endif
-
-static int io_fd;
-
-static __inline__ int enable_os_io(void)
-{
- io_fd = -1 ;
- if ((io_fd = open("/dev/console", O_RDWR, 0)) < 0) {
- perror("/dev/console");
- return(errno);
- }
- if (ioctl(io_fd, KDENABIO, 0) < 0) {
- perror("ioctl(KDENABIO)");
- return(errno);
- }
- return(0);
-}
-
-static __inline__ int disable_os_io(void)
-{
- if (ioctl(io_fd, KDDISABIO, 0) < 0) {
- perror("ioctl(KDDISABIO)");
- close(io_fd);
- return(errno);
- }
- close(io_fd);
- return(0);
-}
diff --git a/src/video_out/libdha/sysdep/pci_generic_cpu.c b/src/video_out/libdha/sysdep/pci_generic_cpu.c
deleted file mode 100644
index 729d48b5a..000000000
--- a/src/video_out/libdha/sysdep/pci_generic_cpu.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- Generic stuff to compile VIDIX only on any system (SCRATCH)
-*/
-#warning This stuff is not ported on your system
-
-static int pci_config_type( void )
-{
- printf("pci_config_type: generic function call\n");
- return 0xFFFF;
-}
-
-static int pci_get_vendor(
- unsigned char bus,
- unsigned char dev,
- int func)
-{
- printf("pci_get_vendor: generic function call\n");
- return 0;
-}
-
-static long pci_config_read_long(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd)
-{
- printf("pci_config_read_long: generic function call\n");
- return 0;
-}
-
-static long pci_config_read_word(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd)
-{
- printf("pci_config_read_word: generic function call\n");
- return 0;
-}
-
-static long pci_config_read_byte(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd)
-{
- printf("pci_config_read_byte: generic function call\n");
- return 0;
-}
-
-static void pci_config_write_long(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd,
- long val)
-{
- printf("pci_config_write_long: generic function call\n");
-}
-
-static void pci_config_write_word(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd,
- long val)
-{
- printf("pci_config_write_word: generic function call\n");
-}
-
-static void pci_config_write_byte(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd,
- long val)
-{
- printf("pci_config_write_byte: generic function call\n");
-}
diff --git a/src/video_out/libdha/sysdep/pci_generic_os.c b/src/video_out/libdha/sysdep/pci_generic_os.c
deleted file mode 100644
index 8855bb4ba..000000000
--- a/src/video_out/libdha/sysdep/pci_generic_os.c
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- Generic stuff to compile VIDIX only on any system (SCRATCH)
-*/
-#warn This stuff is not ported on yur system
-static __inline__ int enable_os_io(void)
-{
- printf("enable_os_io: generic function call\n");
- return 0;
-}
-
-static __inline__ int disable_os_io(void)
-{
- printf("disable_os_io: generic function call\n");
- return 0;
-}
diff --git a/src/video_out/libdha/sysdep/pci_ia64.c b/src/video_out/libdha/sysdep/pci_ia64.c
deleted file mode 100644
index ef2074ab2..000000000
--- a/src/video_out/libdha/sysdep/pci_ia64.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- This file is based on:
- $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.c,v 3.34.2.17 1998/11/10 11:55:40 dawes Exp $
- Modified for readability by Nick Kurshev
-*/
-
-static int pci_config_type( void )
-{
- unsigned long tmplong1, tmplong2;
- unsigned char tmp1, tmp2;
- int retval;
- retval = 0;
-
- OUTPORT8(PCI_MODE2_ENABLE_REG, 0x00);
- OUTPORT8(PCI_MODE2_FORWARD_REG, 0x00);
- tmp1 = INPORT8(PCI_MODE2_ENABLE_REG);
- tmp2 = INPORT8(PCI_MODE2_FORWARD_REG);
- if ((tmp1 == 0x00) && (tmp2 == 0x00)) {
- retval = 2;
- /*printf("PCI says configuration type 2\n");*/
- } else {
- tmplong1 = INPORT32(PCI_MODE1_ADDRESS_REG);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, PCI_EN);
- tmplong2 = INPORT32(PCI_MODE1_ADDRESS_REG);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, tmplong1);
- if (tmplong2 == PCI_EN) {
- retval = 1;
- /*printf("PCI says configuration type 1\n");*/
- } else {
- /*printf("No PCI !\n");*/
- disable_app_io();
- /*exit(1);*/
- retval = 0xFFFF;
- }
- }
- return retval;
-}
-
-static int pci_get_vendor(
- unsigned char bus,
- unsigned char dev,
- int func)
-{
- unsigned long config_cmd;
- config_cmd = PCI_EN | (bus<<16) | (dev<<11) | (func<<8);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, config_cmd);
- return INPORT32(PCI_MODE1_DATA_REG);
-}
-
-static long pci_config_read_long(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd)
-{
- unsigned long config_cmd;
- config_cmd = PCI_EN | (bus<<16) | (dev<<11) | (func<<8);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, config_cmd | cmd);
- return INPORT32(PCI_MODE1_DATA_REG);
-}
-
-static long pci_config_read_word(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd)
-{
- unsigned long config_cmd;
- config_cmd = PCI_EN | (bus<<16) | (dev<<11) | (func<<8);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, config_cmd | cmd);
- return INPORT16(PCI_MODE1_DATA_REG);
-}
-
-static long pci_config_read_byte(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd)
-{
- unsigned long config_cmd;
- config_cmd = PCI_EN | (bus<<16) | (dev<<11) | (func<<8);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, config_cmd | cmd);
- return INPORT8(PCI_MODE1_DATA_REG);
-}
-
-static void pci_config_write_long(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd,
- long val)
-{
- unsigned long config_cmd;
- config_cmd = PCI_EN | (bus<<16) | (dev<<11) | (func<<8);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, config_cmd | cmd);
- OUTPORT32(PCI_MODE1_DATA_REG,val);
-}
-
-static void pci_config_write_word(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd,
- long val)
-{
- unsigned long config_cmd;
- config_cmd = PCI_EN | (bus<<16) | (dev<<11) | (func<<8);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, config_cmd | cmd);
- OUTPORT16(PCI_MODE1_DATA_REG,val);
-}
-
-static void pci_config_write_byte(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd,
- long val)
-{
- unsigned long config_cmd;
- config_cmd = PCI_EN | (bus<<16) | (dev<<11) | (func<<8);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, config_cmd | cmd);
- OUTPORT8(PCI_MODE1_DATA_REG,val);
-}
diff --git a/src/video_out/libdha/sysdep/pci_isc.c b/src/video_out/libdha/sysdep/pci_isc.c
deleted file mode 100644
index 5b5a59182..000000000
--- a/src/video_out/libdha/sysdep/pci_isc.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- This file is based on:
- $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.c,v 3.34.2.17 1998/11/10 11:55:40 dawes Exp $
- Modified for readability by Nick Kurshev
-*/
-#include <sys/param.h>
-#include <sys/immu.h>
-#include <sys/region.h>
-#include <sys/proc.h>
-#include <sys/tss.h>
-#include <sys/sysi86.h>
-#include <sys/v86.h>
-
-static __inline__ int enable_os_io(void)
-{
-#if defined(SI86IOPL)
- sysi86(SI86IOPL, 3);
-#else
- sysi86(SI86V86, V86SC_IOPL, PS_IOPL);
-#endif
- return(0);
-}
-
-static __inline__ int disable_os_io(void)
-{
-#if defined(SI86IOPL)
- sysi86(SI86IOPL, 0);
-#else
- sysi86(SI86V86, V86SC_IOPL, 0);
-#endif
- return(0);
-}
diff --git a/src/video_out/libdha/sysdep/pci_linux.c b/src/video_out/libdha/sysdep/pci_linux.c
deleted file mode 100644
index 1d2116da6..000000000
--- a/src/video_out/libdha/sysdep/pci_linux.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- This file is based on:
- $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.c,v 3.34.2.17 1998/11/10 11:55:40 dawes Exp $
- Modified for readability by Nick Kurshev
-*/
-#include <errno.h>
-#ifdef __i386__
-#include <sys/perm.h>
-#else
-#ifndef __sparc__
-#include <sys/io.h>
-#endif
-#endif
-
-#include "config.h"
-
-#ifdef CONFIG_DHAHELPER
-#include <fcntl.h>
-int dhahelper_initialized = 0;
-int dhahelper_fd = 0;
-#endif
-
-#if defined(__sparc__) || defined(__powerpc__)
-#define iopl(x) (0)
-#endif
-
-static __inline__ int enable_os_io(void)
-{
-#ifdef CONFIG_DHAHELPER
- dhahelper_fd = open("/dev/dhahelper", O_RDWR);
- if (dhahelper_fd > 0)
- {
- dhahelper_initialized = 1;
- return(0);
- }
- dhahelper_initialized = -1;
-#endif
-
- if (iopl(3) != 0)
- return(errno);
- return(0);
-}
-
-static __inline__ int disable_os_io(void)
-{
-#ifdef CONFIG_DHAHELPER
- if (dhahelper_initialized == 1)
- close(dhahelper_fd);
- else
-#endif
- if (iopl(0) != 0)
- return(errno);
- return(0);
-}
diff --git a/src/video_out/libdha/sysdep/pci_lynx.c b/src/video_out/libdha/sysdep/pci_lynx.c
deleted file mode 100644
index b698f6308..000000000
--- a/src/video_out/libdha/sysdep/pci_lynx.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- This file is based on:
- $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.c,v 3.34.2.17 1998/11/10 11:55:40 dawes Exp $
- Modified for readability by Nick Kurshev
-*/
-
-#if defined(Lynx_22)
-#ifndef GCCUSESGAS
-#define GCCUSESGAS
-#endif
-
-/* let's mimick the Linux Alpha stuff for LynxOS so we don't have
- * to change too much code
- */
-#include <smem.h>
-
-static unsigned char *pciConfBase;
-
-static __inline__ void enable_os_io(void)
-{
- pciConfBase = (unsigned char *) smem_create("PCI-CONF",
- (char *)0x80800000, 64*1024, SM_READ|SM_WRITE);
- if (pciConfBase == (void *) -1)
- exit(1);
-}
-
-static __inline__ void disable_os_io(void)
-{
- smem_create(NULL, (char *) pciConfBase, 0, SM_DETACH);
- smem_remove("PCI-CONF");
- pciConfBase = NULL;
-}
-
-#include <smem.h>
-
-static unsigned char *pciConfBase;
-
-static __inline__ unsigned long
-static swapl(unsigned long val)
-{
- unsigned char *p = (unsigned char *)&val;
- return ((p[3] << 24) | (p[2] << 16) | (p[1] << 8) | (p[0] << 0));
-}
-
-
-#define BUS(tag) (((tag)>>16)&0xff)
-#define DFN(tag) (((tag)>>8)&0xff)
-
-#define PCIBIOS_DEVICE_NOT_FOUND 0x86
-#define PCIBIOS_SUCCESSFUL 0x00
-
-static int pciconfig_read(
- unsigned char bus,
- unsigned char dev,
- unsigned char offset,
- int len, /* unused, alway 4 */
- unsigned long *val)
-{
- unsigned long _val;
- unsigned long *ptr;
-
- dev >>= 3;
- if (bus || dev >= 16) {
- *val = 0xFFFFFFFF;
- return PCIBIOS_DEVICE_NOT_FOUND;
- } else {
- ptr = (unsigned long *)(pciConfBase + ((1<<dev) | offset));
- _val = swapl(*ptr);
- }
- *val = _val;
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int pciconfig_write(
- unsigned char bus,
- unsigned char dev,
- unsigned char offset,
- int len, /* unused, alway 4 */
- unsigned long val)
-{
- unsigned long _val;
- unsigned long *ptr;
-
- dev >>= 3;
- _val = swapl(val);
- if (bus || dev >= 16) {
- return PCIBIOS_DEVICE_NOT_FOUND;
- } else {
- ptr = (unsigned long *)(pciConfBase + ((1<<dev) | offset));
- *ptr = _val;
- }
- return PCIBIOS_SUCCESSFUL;
-}
diff --git a/src/video_out/libdha/sysdep/pci_mach386.c b/src/video_out/libdha/sysdep/pci_mach386.c
deleted file mode 100644
index 31621862b..000000000
--- a/src/video_out/libdha/sysdep/pci_mach386.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- This file is based on:
- $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.c,v 3.34.2.17 1998/11/10 11:55:40 dawes Exp $
- Modified for readability by Nick Kurshev
-*/
-
-#include <errno.h>
-
-static int io_fd;
-
-static __inline__ int enable_os_io(void)
-{
- io_fd = -1 ;
- if ((io_fd = open("/dev/iopl", O_RDWR, 0)) < 0) {
- perror("/dev/iopl");
- return(errno);
- }
- return(0);
-}
-
-static __inline__ int disable_os_io(void)
-{
- close(io_fd);
- return(0);
-}
diff --git a/src/video_out/libdha/sysdep/pci_netbsd.c b/src/video_out/libdha/sysdep/pci_netbsd.c
deleted file mode 100644
index 793944beb..000000000
--- a/src/video_out/libdha/sysdep/pci_netbsd.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- This file is based on:
- $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.c,v 3.34.2.17 1998/11/10 11:55:40 dawes Exp $
- Modified for readability by Nick Kurshev
-*/
-#include <errno.h>
-#include <sys/param.h>
-#include <sys/file.h>
-#include <machine/sysarch.h>
-#ifndef GCCUSESGAS
-#define GCCUSESGAS
-#endif
-
-static int io_fd;
-
-static __inline__ int enable_os_io(void)
-{
- io_fd = -1 ;
-#if !defined(USE_I386_IOPL)
- if ((io_fd = open("/dev/io", O_RDWR, 0)) < 0) {
- perror("/dev/io");
- return(errno);
- }
-#else
- if (i386_iopl(1) < 0) {
- perror("i386_iopl");
- return(errno);
- }
-#endif /* USE_I386_IOPL */
- return(0);
-}
-
-static __inline__ int disable_os_io(void)
-{
-#if !defined(USE_I386_IOPL)
- close(io_fd);
-#else
- if (i386_iopl(0) < 0) {
- perror("i386_iopl");
- return(errno);
- }
-#endif /* NetBSD1_1 */
- return(0);
-}
diff --git a/src/video_out/libdha/sysdep/pci_openbsd.c b/src/video_out/libdha/sysdep/pci_openbsd.c
deleted file mode 100644
index 89c85eab6..000000000
--- a/src/video_out/libdha/sysdep/pci_openbsd.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- This file is based on:
- $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.c,v 3.34.2.17 1998/11/10 11:55:40 dawes Exp $
- Modified for readability by Nick Kurshev
-*/
-
-#ifdef __i386__
-
-#include <errno.h>
-#include <sys/types.h>
-#include <machine/sysarch.h>
-
-static __inline__ int enable_os_io(void)
-{
- if (i386_iopl(1) < 0) {
- perror("i386_iopl");
- return(errno);
- }
- return(0);
-}
-
-static __inline__ int disable_os_io(void)
-{
- /* Nothing to do */
- return(0);
-}
-#endif
diff --git a/src/video_out/libdha/sysdep/pci_os2.c b/src/video_out/libdha/sysdep/pci_os2.c
deleted file mode 100644
index ddfc0c0ea..000000000
--- a/src/video_out/libdha/sysdep/pci_os2.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- This file is based on:
- $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.c,v 3.34.2.17 1998/11/10 11:55:40 dawes Exp $
- Modified for readability by Nick Kurshev
-*/
-#define INCL_DOSFILEMGR
-#include <os2.h>
-
-static USHORT callgate[3] = {0,0,0};
-
-static __inline__ int enable_os_io(void)
-{
- HFILE hfd;
- ULONG dlen,action;
- APIRET rc;
- static char *ioDrvPath = "/dev/fastio$";
-
- if (DosOpen((PSZ)ioDrvPath, (PHFILE)&hfd, (PULONG)&action,
- (ULONG)0, FILE_SYSTEM, FILE_OPEN,
- OPEN_SHARE_DENYNONE|OPEN_FLAGS_NOINHERIT|OPEN_ACCESS_READONLY,
- (ULONG)0) != 0) {
- fprintf(stderr,"Error opening fastio$ driver...\n");
- fprintf(stderr,"Please install xf86sup.sys in config.sys!\n");
- return(42);
- }
- callgate[0] = callgate[1] = 0;
-
-/* Get callgate from driver for fast io to ports and other stuff */
-
- rc = DosDevIOCtl(hfd, (ULONG)0x76, (ULONG)0x64,
- NULL, 0, NULL,
- (ULONG*)&callgate[2], sizeof(USHORT), &dlen);
- if (rc) {
- fprintf(stderr,"xf86-OS/2: EnableIOPorts failed, rc=%d, dlen=%d; emergency exit\n",
- rc,dlen);
- DosClose(hfd);
- return(42);
- }
-
-/* Calling callgate with function 13 sets IOPL for the program */
-
- asm volatile ("movl $13,%%ebx;.byte 0xff,0x1d;.long _callgate"
- : /*no outputs */
- : /*no inputs */
- : "eax","ebx","ecx","edx","cc");
-
- DosClose(hfd);
- return(0);
-}
-
-static __inline__ int disable_os_io(void)
-{
-/* Nothing to do */
- return(0);
-}
diff --git a/src/video_out/libdha/sysdep/pci_powerpc.c b/src/video_out/libdha/sysdep/pci_powerpc.c
deleted file mode 100644
index 667b4db37..000000000
--- a/src/video_out/libdha/sysdep/pci_powerpc.c
+++ /dev/null
@@ -1,250 +0,0 @@
-/*
- This file is based on:
- $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.c,v 3.34.2.17 1998/11/10 11:55:40 dawes Exp $
- Modified for readability by Nick Kurshev
-*/
-
-static int pci_config_type( void ) { return 1; }
-#ifdef linux
-#include <fcntl.h>
-#include <sys/io.h>
-#include <linux/pci.h>
-#include "../../bswap.h"
-#endif
-
-#ifdef linux
-static int pci_get_vendor(
- unsigned char bus,
- unsigned char dev,
- int func)
-{
- int retval;
- char path[100];
- int fd;
- short vendor, device;
- sprintf(path,"/proc/bus/pci/%02d/%02x.0", bus, dev);
- fd = open(path,O_RDONLY|O_SYNC);
- if (fd == -1) {
- retval=0xFFFF;
- }
- else if (pread(fd, &vendor, 2, PCI_VENDOR_ID) == 2 &&
- pread(fd, &device, 2, PCI_DEVICE_ID) == 2) {
- vendor = bswap_16(vendor);
- device = bswap_16(device);
- retval = vendor + (device<<16); /*no worries about byte order,
- all ppc are bigendian*/
- } else {
- retval = 0xFFFF;
- }
- if (fd > 0) {
- close(fd);
- }
- return retval;
-}
-#else
-static int pci_get_vendor(
- unsigned char bus,
- unsigned char dev,
- int func)
-{
- int retval;
- pciconfig_read(bus, dev<<3, PCI_ID_REG, 4, &retval);
- return retval;
-}
-#endif
-#ifdef linux
-static long pci_config_read_long(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd)
-{
- long retval;
- char path[100];
- int fd;
- sprintf(path,"/proc/bus/pci/%02d/%02x.0", bus, dev);
- fd = open(path,O_RDONLY|O_SYNC);
- if (fd == -1) {
- retval=0;
- }
- else if (pread(fd, &retval, 4, cmd) == 4) {
- retval = bswap_32(retval);
- } else {
- retval = 0;
- }
- if (fd > 0) {
- close(fd);
- }
- return retval;
-}
-
-static long pci_config_read_word(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd)
-{
- long retval;
- char path[100];
- int fd;
- sprintf(path,"/proc/bus/pci/%02d/%02x.0", bus, dev);
- fd = open(path,O_RDONLY|O_SYNC);
- if (fd == -1) {
- retval=0;
- }
- else if (pread(fd, &retval, 2, cmd) == 2) {
- retval = bswap_16(retval);
- } else {
- retval = 0;
- }
- if (fd > 0) {
- close(fd);
- }
- return retval;
-}
-
-static long pci_config_read_byte(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd)
-{
- long retval;
- char path[100];
- int fd;
- sprintf(path,"/proc/bus/pci/%02d/%02x.0", bus, dev);
- fd = open(path,O_RDONLY|O_SYNC);
- if (fd == -1) {
- retval=0;
- }
- else if (pread(fd, &retval, 1, cmd) != 1) {
- retval = 0;
- }
- if (fd > 0) {
- close(fd);
- }
- return retval;
-}
-
-static void pci_config_write_long(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd,
- long val)
-{
- char path[100];
- int fd;
- val = bswap_32(val);
- sprintf(path,"/proc/bus/pci/%02d/%02x.0", bus, dev);
- fd = open(path,O_RDONLY|O_SYNC);
- if (fd > 0) {
- pwrite(fd, &val, 4, cmd);
- close(fd);
- }
-}
-
-static void pci_config_write_word(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd,
- long val)
-{
- char path[100];
- int fd;
- val = bswap_16(val);
- sprintf(path,"/proc/bus/pci/%02d/%02x.0", bus, dev);
- fd = open(path,O_RDONLY|O_SYNC);
- if (fd > 0) {
- pwrite(fd, &val, 2, cmd);
- close(fd);
- }
-}
-
-static void pci_config_write_byte(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd,
- long val)
-{
- char path[100];
- int fd;
- sprintf(path,"/proc/bus/pci/%02d/%02x.0", bus, dev);
- fd = open(path,O_RDONLY|O_SYNC);
- if (fd > 0) {
- pwrite(fd, &val, 1, cmd);
- close(fd);
- }
-}
-#else
-static long pci_config_read_long(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd)
-{
- long retval;
- pciconfig_read(bus, dev<<3, cmd, 4, &retval);
- return retval;
-}
-
-static long pci_config_read_word(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd)
-{
- long retval;
- pciconfig_read(bus, dev<<3, cmd, 2, &retval);
- return retval;
-}
-
-static long pci_config_read_byte(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd)
-{
- long retval;
- pciconfig_read(bus, dev<<3, cmd, 1, &retval);
- return retval;
-}
-
-static void pci_config_write_long(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd,
- long val)
-{
- long retval;
- pciconfig_write(bus, dev<<3, cmd, 4, val);
- return retval;
-}
-
-static void pci_config_write_word(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd,
- long val)
-{
- long retval;
- pciconfig_write(bus, dev<<3, cmd, 2, val);
- return retval;
-}
-
-static void pci_config_write_byte(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd,
- long val)
-{
- long retval;
- pciconfig_write(bus, dev<<3, cmd, 1, val);
- return retval;
-}
-#endif
diff --git a/src/video_out/libdha/sysdep/pci_sco.c b/src/video_out/libdha/sysdep/pci_sco.c
deleted file mode 100644
index 9cb2282ad..000000000
--- a/src/video_out/libdha/sysdep/pci_sco.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- This file is based on:
- $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.c,v 3.34.2.17 1998/11/10 11:55:40 dawes Exp $
- Modified for readability by Nick Kurshev
-*/
-#include <sys/console.h>
-#include <sys/param.h>
-#include <sys/immu.h>
-#include <sys/region.h>
-#include <sys/proc.h>
-#include <sys/tss.h>
-#include <sys/sysi86.h>
-#include <sys/v86.h>
-
-static __inline__ int enable_os_io(void)
-{
-#if defined(SI86IOPL)
- sysi86(SI86IOPL, 3);
-#else
- sysi86(SI86V86, V86SC_IOPL, PS_IOPL);
-#endif
- return(0);
-}
-
-static __inline__ int disable_os_io(void)
-{
-#if defined(SI86IOPL)
- sysi86(SI86IOPL, 0);
-#else
- sysi86(SI86V86, V86SC_IOPL, 0);
-#endif
- return(0);
-}
diff --git a/src/video_out/libdha/sysdep/pci_sparc.c b/src/video_out/libdha/sysdep/pci_sparc.c
deleted file mode 100644
index ef2074ab2..000000000
--- a/src/video_out/libdha/sysdep/pci_sparc.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- This file is based on:
- $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.c,v 3.34.2.17 1998/11/10 11:55:40 dawes Exp $
- Modified for readability by Nick Kurshev
-*/
-
-static int pci_config_type( void )
-{
- unsigned long tmplong1, tmplong2;
- unsigned char tmp1, tmp2;
- int retval;
- retval = 0;
-
- OUTPORT8(PCI_MODE2_ENABLE_REG, 0x00);
- OUTPORT8(PCI_MODE2_FORWARD_REG, 0x00);
- tmp1 = INPORT8(PCI_MODE2_ENABLE_REG);
- tmp2 = INPORT8(PCI_MODE2_FORWARD_REG);
- if ((tmp1 == 0x00) && (tmp2 == 0x00)) {
- retval = 2;
- /*printf("PCI says configuration type 2\n");*/
- } else {
- tmplong1 = INPORT32(PCI_MODE1_ADDRESS_REG);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, PCI_EN);
- tmplong2 = INPORT32(PCI_MODE1_ADDRESS_REG);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, tmplong1);
- if (tmplong2 == PCI_EN) {
- retval = 1;
- /*printf("PCI says configuration type 1\n");*/
- } else {
- /*printf("No PCI !\n");*/
- disable_app_io();
- /*exit(1);*/
- retval = 0xFFFF;
- }
- }
- return retval;
-}
-
-static int pci_get_vendor(
- unsigned char bus,
- unsigned char dev,
- int func)
-{
- unsigned long config_cmd;
- config_cmd = PCI_EN | (bus<<16) | (dev<<11) | (func<<8);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, config_cmd);
- return INPORT32(PCI_MODE1_DATA_REG);
-}
-
-static long pci_config_read_long(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd)
-{
- unsigned long config_cmd;
- config_cmd = PCI_EN | (bus<<16) | (dev<<11) | (func<<8);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, config_cmd | cmd);
- return INPORT32(PCI_MODE1_DATA_REG);
-}
-
-static long pci_config_read_word(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd)
-{
- unsigned long config_cmd;
- config_cmd = PCI_EN | (bus<<16) | (dev<<11) | (func<<8);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, config_cmd | cmd);
- return INPORT16(PCI_MODE1_DATA_REG);
-}
-
-static long pci_config_read_byte(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd)
-{
- unsigned long config_cmd;
- config_cmd = PCI_EN | (bus<<16) | (dev<<11) | (func<<8);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, config_cmd | cmd);
- return INPORT8(PCI_MODE1_DATA_REG);
-}
-
-static void pci_config_write_long(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd,
- long val)
-{
- unsigned long config_cmd;
- config_cmd = PCI_EN | (bus<<16) | (dev<<11) | (func<<8);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, config_cmd | cmd);
- OUTPORT32(PCI_MODE1_DATA_REG,val);
-}
-
-static void pci_config_write_word(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd,
- long val)
-{
- unsigned long config_cmd;
- config_cmd = PCI_EN | (bus<<16) | (dev<<11) | (func<<8);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, config_cmd | cmd);
- OUTPORT16(PCI_MODE1_DATA_REG,val);
-}
-
-static void pci_config_write_byte(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd,
- long val)
-{
- unsigned long config_cmd;
- config_cmd = PCI_EN | (bus<<16) | (dev<<11) | (func<<8);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, config_cmd | cmd);
- OUTPORT8(PCI_MODE1_DATA_REG,val);
-}
diff --git a/src/video_out/libdha/sysdep/pci_svr4.c b/src/video_out/libdha/sysdep/pci_svr4.c
deleted file mode 100644
index bcce5c901..000000000
--- a/src/video_out/libdha/sysdep/pci_svr4.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- This file is based on:
- $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.c,v 3.34.2.17 1998/11/10 11:55:40 dawes Exp $
- Modified for readability by Nick Kurshev
-*/
-#include <sys/types.h>
-#include <sys/proc.h>
-#include <sys/tss.h>
-#if defined(NCR)
-#define __STDC
-#include <sys/sysi86.h>
-#undef __STDC
-#else
-#include <sys/sysi86.h>
-#endif
-
-#if defined(sun)
-# ifndef __EXTENSIONS__
-# define __EXTENSIONS__
-# endif
-# include <sys/psw.h>
-#endif
-
-static __inline__ int enable_os_io(void)
-{
-#if defined(SI86IOPL)
- sysi86(SI86IOPL, 3);
-#else
- sysi86(SI86V86, V86SC_IOPL, PS_IOPL);
-#endif
- return(0);
-}
-
-static __inline__ int disable_os_io(void)
-{
-#if defined(SI86IOPL)
- sysi86(SI86IOPL, 0);
-#else
- sysi86(SI86V86, V86SC_IOPL, 0);
-#endif
- return(0);
-}
diff --git a/src/video_out/libdha/sysdep/pci_win32.c b/src/video_out/libdha/sysdep/pci_win32.c
deleted file mode 100644
index 1c88cb13e..000000000
--- a/src/video_out/libdha/sysdep/pci_win32.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- This file is based on:
- $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.c,v 3.34.2.17 1998/11/10 11:55:40 dawes Exp $
- Modified for readability by Nick Kurshev
-*/
-#include <windows.h>
-
-/* Nothing to do for Win9x. For WinNT I have no solution */
-
-static __inline__ int enable_os_io(void)
-{
- return(0);
-}
-
-static __inline__ int disable_os_io(void)
-{
- return(0);
-}
diff --git a/src/video_out/libdha/sysdep/pci_x86.c b/src/video_out/libdha/sysdep/pci_x86.c
deleted file mode 100644
index ef2074ab2..000000000
--- a/src/video_out/libdha/sysdep/pci_x86.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- This file is based on:
- $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.c,v 3.34.2.17 1998/11/10 11:55:40 dawes Exp $
- Modified for readability by Nick Kurshev
-*/
-
-static int pci_config_type( void )
-{
- unsigned long tmplong1, tmplong2;
- unsigned char tmp1, tmp2;
- int retval;
- retval = 0;
-
- OUTPORT8(PCI_MODE2_ENABLE_REG, 0x00);
- OUTPORT8(PCI_MODE2_FORWARD_REG, 0x00);
- tmp1 = INPORT8(PCI_MODE2_ENABLE_REG);
- tmp2 = INPORT8(PCI_MODE2_FORWARD_REG);
- if ((tmp1 == 0x00) && (tmp2 == 0x00)) {
- retval = 2;
- /*printf("PCI says configuration type 2\n");*/
- } else {
- tmplong1 = INPORT32(PCI_MODE1_ADDRESS_REG);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, PCI_EN);
- tmplong2 = INPORT32(PCI_MODE1_ADDRESS_REG);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, tmplong1);
- if (tmplong2 == PCI_EN) {
- retval = 1;
- /*printf("PCI says configuration type 1\n");*/
- } else {
- /*printf("No PCI !\n");*/
- disable_app_io();
- /*exit(1);*/
- retval = 0xFFFF;
- }
- }
- return retval;
-}
-
-static int pci_get_vendor(
- unsigned char bus,
- unsigned char dev,
- int func)
-{
- unsigned long config_cmd;
- config_cmd = PCI_EN | (bus<<16) | (dev<<11) | (func<<8);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, config_cmd);
- return INPORT32(PCI_MODE1_DATA_REG);
-}
-
-static long pci_config_read_long(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd)
-{
- unsigned long config_cmd;
- config_cmd = PCI_EN | (bus<<16) | (dev<<11) | (func<<8);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, config_cmd | cmd);
- return INPORT32(PCI_MODE1_DATA_REG);
-}
-
-static long pci_config_read_word(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd)
-{
- unsigned long config_cmd;
- config_cmd = PCI_EN | (bus<<16) | (dev<<11) | (func<<8);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, config_cmd | cmd);
- return INPORT16(PCI_MODE1_DATA_REG);
-}
-
-static long pci_config_read_byte(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd)
-{
- unsigned long config_cmd;
- config_cmd = PCI_EN | (bus<<16) | (dev<<11) | (func<<8);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, config_cmd | cmd);
- return INPORT8(PCI_MODE1_DATA_REG);
-}
-
-static void pci_config_write_long(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd,
- long val)
-{
- unsigned long config_cmd;
- config_cmd = PCI_EN | (bus<<16) | (dev<<11) | (func<<8);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, config_cmd | cmd);
- OUTPORT32(PCI_MODE1_DATA_REG,val);
-}
-
-static void pci_config_write_word(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd,
- long val)
-{
- unsigned long config_cmd;
- config_cmd = PCI_EN | (bus<<16) | (dev<<11) | (func<<8);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, config_cmd | cmd);
- OUTPORT16(PCI_MODE1_DATA_REG,val);
-}
-
-static void pci_config_write_byte(
- unsigned char bus,
- unsigned char dev,
- int func,
- unsigned cmd,
- long val)
-{
- unsigned long config_cmd;
- config_cmd = PCI_EN | (bus<<16) | (dev<<11) | (func<<8);
- OUTPORT32(PCI_MODE1_ADDRESS_REG, config_cmd | cmd);
- OUTPORT8(PCI_MODE1_DATA_REG,val);
-}
diff --git a/src/video_out/libdha/test.c b/src/video_out/libdha/test.c
deleted file mode 100644
index 857e739c6..000000000
--- a/src/video_out/libdha/test.c
+++ /dev/null
@@ -1,48 +0,0 @@
-#include "libdha.h"
-#include "pci_names.h"
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <inttypes.h> /* for __WORDSIZE */
-
-int main( void )
-{
- pciinfo_t lst[MAX_PCI_DEVICES];
- unsigned i,num_pci;
- int err;
- err = pci_scan(lst,&num_pci);
- if(err)
- {
- printf("Error occured during pci scan: %s\n",strerror(err));
- return EXIT_FAILURE;
- }
- else
- {
- printf(" Bus:card:func vend:dev base0 :base1 :base2 :baserom :irq:pin:gnt:lat\n");
- for(i=0;i<num_pci;i++)
-#if __WORDSIZE > 32
- printf("%04X:%04X:%04X %04X:%04X %16X:%16X:%16X:%16X:%02X :%02X :%02X :%02X\n"
-#else
- printf("%04X:%04X:%04X %04X:%04X %08X:%08X:%08X:%08X:%02X :%02X :%02X :%02X\n"
-#endif
- ,lst[i].bus,lst[i].card,lst[i].func
- ,lst[i].vendor,lst[i].device
- ,lst[i].base0,lst[i].base1,lst[i].base2,lst[i].baserom
- ,lst[i].irq,lst[i].ipin,lst[i].gnt,lst[i].lat);
- printf("Additional info:\n");
- printf("================\n");
- printf("base3 :base4 :base5 :name (vendor)\n");
- for(i=0;i<num_pci;i++)
- {
- const char *vname,*dname;
- dname = pci_device_name(lst[i].vendor,lst[i].device);
- dname = dname ? dname : "Unknown chip";
- vname = pci_vendor_name(lst[i].vendor);
- vname = vname ? vname : "Unknown chip";
- printf("%08X:%08X:%08X:%s (%s)\n"
- ,lst[i].base3,lst[i].base4,lst[i].base5
- ,dname,vname);
- }
- }
- return EXIT_SUCCESS;
-}
diff --git a/src/video_out/macosx/Makefile.am b/src/video_out/macosx/Makefile.am
index a69f30dc5..ae6a5acc8 100644
--- a/src/video_out/macosx/Makefile.am
+++ b/src/video_out/macosx/Makefile.am
@@ -1,27 +1,12 @@
include $(top_srcdir)/misc/Makefile.common
-AM_CPPFLAGS = -DXINE_COMPILE
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_OBJCFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
-EXTRA_DIST = \
- video_window.h \
- XineOpenGLView.m \
- XineOpenGLView.h \
- XineVideoWindow.m \
- XineVideoWindow.h
-
-if HAVE_MACOSX_VIDEO
+xineinclude_HEADERS = video_window.h XineOpenGLView.h XineVideoWindow.h
lib_LTLIBRARIES = libxineMacOSXVideo.la
libxineMacOSXVideo_la_SOURCES = XineOpenGLView.m XineVideoWindow.m
-# The "-Wl,-framework -Wl,..." is needed for libtool versions before
-# 1.5.x (1.257): the default version that ships with Mac OS X is 1.5 (1.1220)
-libxineMacOSXVideo_la_LDFLAGS = -version-info \
- $(XINE_LT_CURRENT):$(XINE_LT_REVISION):$(XINE_LT_AGE) \
- -Wl,-framework -Wl,Cocoa -framework Cocoa \
- -Wl,-framework -Wl,OpenGL -framework OpenGL
-
-xineinclude_HEADERS = video_window.h XineOpenGLView.h XineVideoWindow.h
-
-endif
-
+libxineMacOSXVideo_la_LDFLAGS = $(AM_LDFLAGS) -framework Cocoa -framework OpenGL \
+ -version-info $(XINE_LT_CURRENT):$(XINE_LT_REVISION):$(XINE_LT_AGE)
diff --git a/src/video_out/video_out_directfb.c b/src/video_out/video_out_directfb.c
index efbb30f2d..a374c56de 100644
--- a/src/video_out/video_out_directfb.c
+++ b/src/video_out/video_out_directfb.c
@@ -1333,8 +1333,8 @@ static void update_config_cb (void *data, xine_cfg_entry_t *entry) {
static void init_config (directfb_driver_t *this) {
config_values_t *config = this->xine->config;
- static const char *buffermode_enum[] = {"single", "double", "triple", 0};
- static const char *fieldparity_enum[] = {"none", "top", "bottom", 0};
+ static const char *const buffermode_enum[] = {"single", "double", "triple", 0};
+ static const char *const fieldparity_enum[] = {"none", "top", "bottom", 0};
this->buffermode = config->register_enum (config,
"video.device.directfb_buffermode", this->buffermode, (char**)buffermode_enum,
diff --git a/src/video_out/video_out_directx.c b/src/video_out/video_out_directx.c
index 7c3e5a78c..7c3e5a78c 100644..100755
--- a/src/video_out/video_out_directx.c
+++ b/src/video_out/video_out_directx.c
diff --git a/src/video_out/video_out_fb.c b/src/video_out/video_out_fb.c
index 3c53adf4d..3ca39b89d 100644
--- a/src/video_out/video_out_fb.c
+++ b/src/video_out/video_out_fb.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2000-2003 the xine project and Fredrik Noring
+ * Copyright (C) 2000-2007 the xine project and Fredrik Noring
*
* This file is part of xine, a free video player.
*
@@ -18,28 +18,28 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
* $Id: video_out_fb.c,v 1.49 2006/12/19 19:10:51 dsalt Exp $
- *
- * video_out_fb.c, frame buffer xine driver by Miguel Freitas
+ */
+
+/**
+ * @file
+ * @brief Frame buffer xine driver
*
- * Contributors:
+ * @author Miguel Freitas
*
- * Fredrik Noring <noring@nocrew.org>: Zero copy buffers and clean up.
+ * @author Fredrik Noring <noring@nocrew.org>:
+ * Zero copy buffers and clean up.
*
- * based on xine's video_out_xshm.c...
- * ...based on mpeg2dec code from
- * Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
+ * @author Aaron Holtzman <aholtzma@ess.engr.uvic.ca>:
+ * Based on xine's video_out_xshm.c, based on mpeg2dec code from
*
- * ideas from ppmtofb - Display P?M graphics on framebuffer devices
- * by Geert Uytterhoeven and Chris Lawrence
+ * @author Geert Uytterhoeven and Chris Lawrence:
+ * Ideas from ppmtofb - Display P?M graphics on framebuffer devices.
*
- * Note: Use this with fbxine. It may work with the regular xine too,
- * provided the visual type is changed (see below).
+ * @note Use this with fbxine.
*
- * TODO: VT switching (configurable)
+ * @todo VT Switching (configurable)
*/
-/* #define USE_X11_VISUAL */
-
#define RECOMMENDED_NUM_BUFFERS 5
#define MAXIMUM_NUM_BUFFERS 25
@@ -326,21 +326,10 @@ static void setup_colorspace_converter(fb_frame_t *frame, int flags)
static void frame_reallocate(fb_driver_t *this, fb_frame_t *frame,
uint32_t width, uint32_t height, int format)
{
- if(frame->chunk[0])
- {
- free(frame->chunk[0]);
- frame->chunk[0] = NULL;
- }
- if(frame->chunk[1])
- {
- free(frame->chunk[1]);
- frame->chunk[1] = NULL;
- }
- if(frame->chunk[2])
- {
- free(frame->chunk[2]);
- frame->chunk[2] = NULL;
- }
+ free(frame->chunk[0]);
+ free(frame->chunk[1]);
+ free(frame->chunk[2]);
+ memset(frame->chunk, 0, sizeof(frame->chunk[0])*3);
if(this->use_zero_copy)
{
@@ -350,10 +339,9 @@ static void frame_reallocate(fb_driver_t *this, fb_frame_t *frame,
}
else
{
- if(frame->data)
- free(frame->data);
- frame->data = xine_xmalloc(frame->sc.output_width *
- frame->sc.output_height *
+ free(frame->data);
+ frame->data = xine_xcalloc(frame->sc.output_width *
+ frame->sc.output_height,
this->bytes_per_pixel);
}
@@ -442,7 +430,7 @@ static void fb_update_frame_format(vo_driver_t *this_gen,
static void fb_overlay_clut_yuv2rgb(fb_driver_t *this,
vo_overlay_t *overlay, fb_frame_t *frame)
{
- int i;
+ size_t i;
clut_t* clut = (clut_t*)overlay->color;
if(!overlay->rgb_clut)
@@ -810,7 +798,7 @@ static void register_callbacks(fb_driver_t *this)
static int open_fb_device(config_values_t *config, xine_t *xine)
{
- static char devkey[] = "video.device.fb_device"; /* Why static? */
+ static const char devkey[] = "video.device.fb_device";
char *device_name;
int fd;
@@ -892,7 +880,7 @@ static int mode_visual(fb_driver_t *this, config_values_t *config,
}
}
- xprintf(this->xine, XINE_VERBOSITY_LOG, _("video_out_fb: Your video mode was not recognized, sorry.\n"));
+ xprintf(this->xine, XINE_VERBOSITY_LOG, _("%s: Your video mode was not recognized, sorry.\n"), LOG_MODULE);
return 0;
}
@@ -949,16 +937,16 @@ static void setup_buffers(fb_driver_t *this,
this->cur_frame = this->old_frame = 0;
xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_fb: %d video RAM buffers are available.\n"), this->total_num_native_buffers);
+ _("%s: %d video RAM buffers are available.\n"), LOG_MODULE, this->total_num_native_buffers);
if(this->total_num_native_buffers < RECOMMENDED_NUM_BUFFERS)
{
this->use_zero_copy = 0;
xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("WARNING: video_out_fb: Zero copy buffers are DISABLED because only %d buffers\n"
+ _("WARNING: %s: Zero copy buffers are DISABLED because only %d buffers\n"
" are available which is less than the recommended %d buffers. Lowering\n"
" the frame buffer resolution might help.\n"),
- this->total_num_native_buffers, RECOMMENDED_NUM_BUFFERS);
+ LOG_MODULE, this->total_num_native_buffers, RECOMMENDED_NUM_BUFFERS);
}
else
{
@@ -966,8 +954,8 @@ static void setup_buffers(fb_driver_t *this,
this->fb_var.yoffset = this->fb_var.yres;
if(ioctl(this->fd, FBIOPAN_DISPLAY, &this->fb_var) == -1) {
xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("WARNING: video_out_fb: Zero copy buffers are DISABLED because kernel driver\n"
- " do not support screen panning (used for frame flips).\n"));
+ _("WARNING: %s: Zero copy buffers are DISABLED because kernel driver\n"
+ " do not support screen panning (used for frame flips).\n"), LOG_MODULE);
} else {
this->fb_var.yoffset = 0;
ioctl(this->fd, FBIOPAN_DISPLAY, &this->fb_var);
@@ -1035,12 +1023,13 @@ static vo_driver_t *fb_open_plugin(video_driver_class_t *class_gen,
if(this->depth > 16)
xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("WARNING: video_out_fb: current display depth is %d. For better performance\n"
- " a depth of 16 bpp is recommended!\n\n"), this->depth);
+ _("WARNING: %s: current display depth is %d. For better performance\n"
+ " a depth of 16 bpp is recommended!\n\n"), LOG_MODULE, this->depth);
xprintf(class->xine, XINE_VERBOSITY_DEBUG,
- "video_out_fb: video mode depth is %d (%d bpp),\n"
+ "%s: video mode depth is %d (%d bpp),\n"
" red: %d/%d, green: %d/%d, blue: %d/%d\n",
+ LOG_MODULE,
this->depth, this->bpp,
this->fb_var.red.length, this->fb_var.red.offset,
this->fb_var.green.length, this->fb_var.green.offset,
@@ -1093,11 +1082,7 @@ static void *fb_init_class(xine_t *xine, void *visual_gen)
static const vo_info_t vo_info_fb =
{
1, /* priority */
-#ifdef USE_X11_VISUAL
- XINE_VISUAL_TYPE_X11 /* visual type */
-#else
XINE_VISUAL_TYPE_FB /* visual type */
-#endif
};
/* exported plugin catalog entry */
diff --git a/src/video_out/video_out_xcbshm.c b/src/video_out/video_out_xcbshm.c
index 5b4eb1fa3..bc31e153a 100644
--- a/src/video_out/video_out_xcbshm.c
+++ b/src/video_out/video_out_xcbshm.c
@@ -133,11 +133,6 @@ typedef struct {
*/
static void create_ximage(xshm_driver_t *this, xshm_frame_t *frame, int width, int height)
{
- if (width <= 0)
- width = 1;
- if (height <= 0)
- height = 1;
-
frame->bytes_per_line = ((this->bpp * width + this->scanline_pad - 1) &
(~(this->scanline_pad - 1))) >> 3;
@@ -154,8 +149,9 @@ static void create_ximage(xshm_driver_t *this, xshm_frame_t *frame, int width, i
if (shmid < 0) {
xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_xcbshm: %s: allocating image\n"
- "video_out_xcbshm: => not using MIT Shared Memory extension.\n"), strerror(errno));
+ _("%s: %s: allocating image\n"), LOG_MODULE, strerror(errno));
+ xprintf(this->xine, XINE_VERBOSITY_LOG,
+ _("%s: => not using MIT Shared Memory extension.\n"), LOG_MODULE);
goto shm_fail1;
}
@@ -163,8 +159,9 @@ static void create_ximage(xshm_driver_t *this, xshm_frame_t *frame, int width, i
if (frame->image == ((void *) -1)) {
xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_xcbshm: shared memory error (address error) when allocating image \n"
- "video_out_xcbshm: => not using MIT Shared Memory extension.\n"));
+ _("%s: shared memory error (address error) when allocating image \n"), LOG_MODULE);
+ xprintf(this->xine, XINE_VERBOSITY_LOG,
+ _("%s: => not using MIT Shared Memory extension.\n"), LOG_MODULE);
goto shm_fail2;
}
@@ -174,8 +171,9 @@ static void create_ximage(xshm_driver_t *this, xshm_frame_t *frame, int width, i
if (generic_error != NULL) {
xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_xcbshm: x11 error during shared memory XImage creation\n"
- "video_out_xcbshm: => not using MIT Shared Memory extension.\n"));
+ _("%s: x11 error during shared memory XImage creation\n"), LOG_MODULE);
+ xprintf(this->xine, XINE_VERBOSITY_LOG,
+ _("%s: => not using MIT Shared Memory extension.\n"), LOG_MODULE);
free(generic_error);
goto shm_fail3;
}
@@ -736,7 +734,7 @@ static int xshm_get_property (vo_driver_t *this_gen, int property) {
return this->sc.gui_height;
default:
xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xcbshm: tried to get unsupported property %d\n", property);
+ LOG_MODULE ": tried to get unsupported property %d\n", property);
}
return 0;
@@ -752,7 +750,7 @@ static int xshm_set_property (vo_driver_t *this_gen,
value = XINE_VO_ASPECT_AUTO;
this->sc.user_ratio = value;
xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xcbshm: aspect ratio changed to %s\n", _x_vo_scale_aspect_ratio_name(value));
+ LOG_MODULE ": aspect ratio changed to %s\n", _x_vo_scale_aspect_ratio_name(value));
} else if (property == VO_PROP_BRIGHTNESS) {
@@ -786,7 +784,7 @@ static int xshm_set_property (vo_driver_t *this_gen,
} else {
xprintf (this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xcbshm: tried to set unsupported property %d\n", property);
+ LOG_MODULE ": tried to set unsupported property %d\n", property);
}
return value;
@@ -962,7 +960,7 @@ static int ImlibPaletteLUTGet(xshm_driver_t *this) {
char *retval = xcb_get_property_value(prop_reply);
j = 1 + retval[0]*4;
- this->yuv2rgb_cmap = malloc(sizeof(uint8_t) * 32 * 32 * 32);
+ this->yuv2rgb_cmap = xine_xcalloc(sizeof(uint8_t), 32 * 32 * 32);
for (i = 0; i < 32 * 32 * 32 && j < num_ret; i++)
this->yuv2rgb_cmap[i] = retval[1+4*retval[j++]+3];
@@ -1110,7 +1108,7 @@ static vo_driver_t *xshm_open_plugin(video_driver_class_t *class_gen, const void
}
else {
xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_xcbshm: MIT shared memory extension not present on display.\n"));
+ _("%s: MIT shared memory extension not present on display.\n"), LOG_MODULE);
this->use_shm = 0;
}
@@ -1148,8 +1146,8 @@ static vo_driver_t *xshm_open_plugin(video_driver_class_t *class_gen, const void
swapped = cpu_byte_order != image_byte_order;
xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xcbshm: video mode depth is %d (%d bpp), %s, %sswapped,\n"
- "\tred: %08x, green: %08x, blue: %08x\n",
+ LOG_MODULE ": video mode depth is %d (%d bpp), %s, %sswapped,\n"
+ LOG_MODULE ": red: %08x, green: %08x, blue: %08x\n",
this->depth, this->bpp,
visual_class_name(visualtype),
swapped ? "" : "not ",
@@ -1209,7 +1207,7 @@ static vo_driver_t *xshm_open_plugin(video_driver_class_t *class_gen, const void
if (!mode) {
xprintf (this->xine, XINE_VERBOSITY_LOG,
- _("video_out_xcbshm: your video mode was not recognized, sorry :-(\n"));
+ _("%s: your video mode was not recognized, sorry :-(\n"), LOG_MODULE);
return NULL;
}
diff --git a/src/video_out/video_out_xcbxv.c b/src/video_out/video_out_xcbxv.c
index 81c78a71f..84185bb85 100644
--- a/src/video_out/video_out_xcbxv.c
+++ b/src/video_out/video_out_xcbxv.c
@@ -63,7 +63,6 @@
#include "video_out.h"
#include "xine_internal.h"
/* #include "overlay.h" */
-#include "deinterlace.h"
#include "xineutils.h"
#include "vo_scale.h"
#include "xcbosd.h"
@@ -132,10 +131,6 @@ struct xv_driver_s {
/* all scaling information goes here */
vo_scale_t sc;
- xv_frame_t deinterlace_frame;
- int deinterlace_method;
- int deinterlace_enabled;
-
int use_colorkey;
uint32_t colorkey;
@@ -213,11 +208,6 @@ static void create_ximage(xv_driver_t *this, xv_frame_t *frame, int width, int h
unsigned int length;
- if (width <= 0)
- width = 1;
- if (height <= 0)
- height = 1;
-
if (this->use_pitch_alignment) {
width = (width + 7) & ~0x7;
}
@@ -267,8 +257,9 @@ static void create_ximage(xv_driver_t *this, xv_frame_t *frame, int width, int h
if (frame->xv_data_size == 0) {
xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_xcbxv: XvShmCreateImage returned a zero size\n"
- "video_out_xcbxv: => not using MIT Shared Memory extension.\n"));
+ _("%s: XvShmCreateImage returned a zero size\n"), LOG_MODULE);
+ xprintf(this->xine, XINE_VERBOSITY_LOG,
+ _("%s: => not using MIT Shared Memory extension.\n"), LOG_MODULE);
goto shm_fail1;
}
@@ -276,8 +267,9 @@ static void create_ximage(xv_driver_t *this, xv_frame_t *frame, int width, int h
if (shmid < 0 ) {
xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_xcbxv: shared memory error in shmget: %s\n"
- "video_out_xcbxv: => not using MIT Shared Memory extension.\n"), strerror(errno));
+ _("%s: shared memory error in shmget: %s\n"), LOG_MODULE, strerror(errno));
+ xprintf(this->xine, XINE_VERBOSITY_LOG,
+ _("%s: => not using MIT Shared Memory extension.\n"), LOG_MODULE);
goto shm_fail1;
}
@@ -285,7 +277,9 @@ static void create_ximage(xv_driver_t *this, xv_frame_t *frame, int width, int h
if (frame->image == ((void *) -1)) {
xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xcbxv: shared memory error (address error)\n");
+ _("%s: shared memory error (address error)\n"), LOG_MODULE);
+ xprintf(this->xine, XINE_VERBOSITY_LOG,
+ _("%s: => not using MIT Shared Memory extension.\n"), LOG_MODULE);
goto shm_fail2;
}
@@ -295,8 +289,9 @@ static void create_ximage(xv_driver_t *this, xv_frame_t *frame, int width, int h
if (generic_error != NULL) {
xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_xcbxv: x11 error during shared memory XImage creation\n"
- "video_out_xcbxv: => not using MIT Shared Memory extension.\n"));
+ _("%s: x11 error during shared memory XImage creation\n"), LOG_MODULE);
+ xprintf(this->xine, XINE_VERBOSITY_LOG,
+ _("%s: => not using MIT Shared Memory extension.\n"), LOG_MODULE);
free(generic_error);
goto shm_fail3;
}
@@ -364,7 +359,7 @@ static void xv_update_frame_format (vo_driver_t *this_gen,
|| (frame->height != height)
|| (frame->format != format)) {
- /* printf ("video_out_xcbxv: updating frame to %d x %d (ratio=%d, format=%08x)\n",width,height,ratio_code,format); */
+ /* printf (LOG_MODULE ": updating frame to %d x %d (ratio=%d, format=%08x)\n",width,height,ratio_code,format); */
pthread_mutex_lock(&this->main_mutex);
@@ -400,117 +395,6 @@ static void xv_update_frame_format (vo_driver_t *this_gen,
frame->ratio = ratio;
}
-#define DEINTERLACE_CROMA
-static void xv_deinterlace_frame (xv_driver_t *this) {
- uint8_t *recent_bitmaps[VO_NUM_RECENT_FRAMES];
- xv_frame_t *frame = this->recent_frames[0];
- int i;
- int xvscaling;
-
- xvscaling = (this->deinterlace_method == DEINTERLACE_ONEFIELDXV) ? 2 : 1;
-
- if (!this->deinterlace_frame.image
- || (frame->width != this->deinterlace_frame.width)
- || (frame->height != this->deinterlace_frame.height )
- || (frame->format != this->deinterlace_frame.format)
- || (frame->ratio != this->deinterlace_frame.ratio)) {
- pthread_mutex_lock(&this->main_mutex);
-
- if(this->deinterlace_frame.image)
- dispose_ximage(this, &this->deinterlace_frame);
-
- create_ximage(this, &this->deinterlace_frame, frame->width, frame->height / xvscaling, frame->format);
- this->deinterlace_frame.width = frame->width;
- this->deinterlace_frame.height = frame->height;
- this->deinterlace_frame.format = frame->format;
- this->deinterlace_frame.ratio = frame->ratio;
-
- pthread_mutex_unlock(&this->main_mutex);
- }
-
-
- if ( this->deinterlace_method != DEINTERLACE_ONEFIELDXV ) {
-#ifdef DEINTERLACE_CROMA
-
- /* I don't think this is the right way to do it (deinterlacing croma by croma info).
- DScaler deinterlaces croma together with luma, but it's easier for them because
- they have that components 1:1 at the same table.
- */
- for( i = 0; i < VO_NUM_RECENT_FRAMES; i++ )
- if( this->recent_frames[i] && this->recent_frames[i]->width == frame->width &&
- this->recent_frames[i]->height == frame->height )
- recent_bitmaps[i] = this->recent_frames[i]->image + frame->width*frame->height;
- else
- recent_bitmaps[i] = NULL;
-
- deinterlace_yuv( this->deinterlace_frame.image + this->deinterlace_frame.xv_width * frame->height,
- recent_bitmaps, this->deinterlace_frame.xv_width/2, frame->height/2, this->deinterlace_method );
- for( i = 0; i < VO_NUM_RECENT_FRAMES; i++ )
- if( this->recent_frames[i] && this->recent_frames[i]->width == frame->width &&
- this->recent_frames[i]->height == frame->height )
- recent_bitmaps[i] = this->recent_frames[i]->image + this->deinterlace_frame.xv_width*frame->height*5/4;
- else
- recent_bitmaps[i] = NULL;
-
- deinterlace_yuv( this->deinterlace_frame.image + this->deinterlace_frame.xv_width*frame->height*5/4,
- recent_bitmaps, this->deinterlace_frame.xv_width/2, frame->height/2, this->deinterlace_method );
-
-#else
-
- /* know bug: we are not deinterlacing Cb and Cr */
- xine_fast_memcpy(this->deinterlace_frame.image + frame->width*frame->height,
- frame->image + frame->width*frame->height,
- frame->width*frame->height*1/2);
-
-#endif
-
- for( i = 0; i < VO_NUM_RECENT_FRAMES; i++ )
- if( this->recent_frames[i] && this->recent_frames[i]->width == frame->width &&
- this->recent_frames[i]->height == frame->height )
- recent_bitmaps[i] = this->recent_frames[i]->image;
- else
- recent_bitmaps[i] = NULL;
-
- deinterlace_yuv( this->deinterlace_frame.image, recent_bitmaps,
- this->deinterlace_frame.xv_width, frame->height, this->deinterlace_method );
- }
- else {
- /*
- dirty and cheap deinterlace method: we give half of the lines to xv
- driver and let it scale for us.
- note that memcpy's below don't seem to impact much on performance,
- specially when fast memcpys are available.
- */
- uint8_t *dst, *src;
-
- dst = this->deinterlace_frame.image;
- src = this->recent_frames[0]->image;
- for( i = 0; i < frame->height; i+=2 ) {
- xine_fast_memcpy(dst,src,frame->width);
- dst += frame->width;
- src += 2 * frame->width;
- }
-
- dst = this->deinterlace_frame.image + frame->width * frame->height / 2;
- src = this->recent_frames[0]->image + frame->width * frame->height;
- for( i = 0; i < frame->height; i+=4 ) {
- xine_fast_memcpy(dst,src,frame->width / 2);
- dst += frame->width / 2;
- src += frame->width;
- }
-
- dst = this->deinterlace_frame.image + frame->width * frame->height * 5 / 8;
- src = this->recent_frames[0]->image + frame->width * frame->height * 5 / 4;
- for( i = 0; i < frame->height; i+=4 ) {
- xine_fast_memcpy(dst,src,frame->width / 2);
- dst += frame->width / 2;
- src += frame->width;
- }
- }
-
- this->cur_frame = &this->deinterlace_frame;
-}
-
static void xv_clean_output_area (xv_driver_t *this) {
int i;
xcb_rectangle_t rects[4];
@@ -565,14 +449,6 @@ static void xv_compute_ideal_size (xv_driver_t *this) {
static void xv_compute_output_size (xv_driver_t *this) {
_x_vo_scale_compute_output_size( &this->sc );
-
- /* onefield_xv divide by 2 the number of lines */
- if (this->deinterlace_enabled
- && (this->deinterlace_method == DEINTERLACE_ONEFIELDXV)
- && this->cur_frame && (this->cur_frame->format == XINE_IMGFMT_YV12)) {
- this->sc.displayed_height = this->sc.displayed_height / 2 - 1;
- this->sc.displayed_yoffset = this->sc.displayed_yoffset / 2;
- }
}
static void xv_overlay_begin (vo_driver_t *this_gen,
@@ -692,7 +568,7 @@ static void xv_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) {
xv_driver_t *this = (xv_driver_t *) this_gen;
xv_frame_t *frame = (xv_frame_t *) frame_gen;
/*
- printf ("video_out_xcbxv: xv_display_frame...\n");
+ printf (LOG_MODULE ": xv_display_frame...\n");
*/
/*
@@ -716,17 +592,6 @@ static void xv_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) {
}
/*
- * deinterlace frame if necessary
- * (currently only working for YUV images)
- */
-
- if (this->deinterlace_enabled && this->deinterlace_method
- && frame->format == XINE_IMGFMT_YV12
- && (deinterlace_yuv_supported( this->deinterlace_method ) == 1
- || this->deinterlace_method == DEINTERLACE_ONEFIELDXV))
- xv_deinterlace_frame (this);
-
- /*
* tell gui that we are about to display a frame,
* ask for offset and output size
*/
@@ -759,7 +624,7 @@ static void xv_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) {
pthread_mutex_unlock(&this->main_mutex);
/*
- printf ("video_out_xcbxv: xv_display_frame... done\n");
+ printf (LOG_MODULE ": xv_display_frame... done\n");
*/
}
@@ -775,7 +640,7 @@ static int xv_get_property (vo_driver_t *this_gen, int property) {
break;
}
- lprintf("video_out_xcbxv: property #%d = %d\n", property, this->props[property].value);
+ lprintf(LOG_MODULE ": property #%d = %d\n", property, this->props[property].value);
return this->props[property].value;
}
@@ -820,25 +685,13 @@ static int xv_set_property (vo_driver_t *this_gen,
}
else {
switch (property) {
-
- case VO_PROP_INTERLACED:
- this->props[property].value = value;
- xprintf(this->xine, XINE_VERBOSITY_LOG,
- "video_out_xcbxv: VO_PROP_INTERLACED(%d)\n", this->props[property].value);
- this->deinterlace_enabled = value;
- if (this->deinterlace_method == DEINTERLACE_ONEFIELDXV) {
- xv_compute_ideal_size (this);
- xv_compute_output_size (this);
- }
- break;
-
case VO_PROP_ASPECT_RATIO:
if (value>=XINE_VO_ASPECT_NUM_RATIOS)
value = XINE_VO_ASPECT_AUTO;
this->props[property].value = value;
xprintf(this->xine, XINE_VERBOSITY_LOG,
- "video_out_xcbxv: VO_PROP_ASPECT_RATIO(%d)\n", this->props[property].value);
+ LOG_MODULE ": VO_PROP_ASPECT_RATIO(%d)\n", this->props[property].value);
this->sc.user_ratio = value;
xv_compute_ideal_size (this);
@@ -850,7 +703,7 @@ static int xv_set_property (vo_driver_t *this_gen,
if ((value >= XINE_VO_ZOOM_MIN) && (value <= XINE_VO_ZOOM_MAX)) {
this->props[property].value = value;
xprintf(this->xine, XINE_VERBOSITY_LOG,
- "video_out_xcbxv: VO_PROP_ZOOM_X = %d\n", this->props[property].value);
+ LOG_MODULE ": VO_PROP_ZOOM_X = %d\n", this->props[property].value);
this->sc.zoom_factor_x = (double)value / (double)XINE_VO_ZOOM_STEP;
@@ -864,7 +717,7 @@ static int xv_set_property (vo_driver_t *this_gen,
if ((value >= XINE_VO_ZOOM_MIN) && (value <= XINE_VO_ZOOM_MAX)) {
this->props[property].value = value;
xprintf(this->xine, XINE_VERBOSITY_LOG,
- "video_out_xcbxv: VO_PROP_ZOOM_Y = %d\n", this->props[property].value);
+ LOG_MODULE ": VO_PROP_ZOOM_Y = %d\n", this->props[property].value);
this->sc.zoom_factor_y = (double)value / (double)XINE_VO_ZOOM_STEP;
@@ -976,15 +829,6 @@ static int xv_gui_data_exchange (vo_driver_t *this_gen,
rect->y = y1;
rect->w = x2-x1;
rect->h = y2-y1;
-
- /* onefield_xv divide by 2 the number of lines */
- if (this->deinterlace_enabled
- && (this->deinterlace_method == DEINTERLACE_ONEFIELDXV)
- && (this->cur_frame->format == XINE_IMGFMT_YV12)) {
- rect->y = rect->y * 2;
- rect->h = rect->h * 2;
- }
-
}
break;
@@ -1056,12 +900,6 @@ static void xv_dispose (vo_driver_t *this_gen) {
/* restore port attributes to their initial values */
xv_restore_port_attributes(this);
-
- if (this->deinterlace_frame.image) {
- pthread_mutex_lock(&this->main_mutex);
- dispose_ximage(this, &this->deinterlace_frame);
- pthread_mutex_unlock(&this->main_mutex);
- }
pthread_mutex_lock(&this->main_mutex);
xcb_xv_ungrab_port(this->connection, this->xv_port, XCB_CURRENT_TIME);
@@ -1148,7 +986,7 @@ static void xv_check_capability (xv_driver_t *this,
free(get_attribute_reply);
xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xcbxv: port attribute %s (%d) value is %d\n", str_prop, property, int_default);
+ LOG_MODULE ": port attribute %s (%d) value is %d\n", str_prop, property, int_default);
/* disable autopaint colorkey by default */
/* might be overridden using config entry */
@@ -1193,13 +1031,6 @@ static void xv_check_capability (xv_driver_t *this,
}
} else
this->props[property].value = int_default;
-
-}
-
-static void xv_update_deinterlace(void *this_gen, xine_cfg_entry_t *entry) {
- xv_driver_t *this = (xv_driver_t *) this_gen;
-
- this->deinterlace_method = entry->num_value;
}
static void xv_update_XV_FILTER(void *this_gen, xine_cfg_entry_t *entry) {
@@ -1219,7 +1050,7 @@ static void xv_update_XV_FILTER(void *this_gen, xine_cfg_entry_t *entry) {
pthread_mutex_unlock(&this->main_mutex);
xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xcbxv: bilinear scaling mode (XV_FILTER) = %d\n",xv_filter);
+ LOG_MODULE ": bilinear scaling mode (XV_FILTER) = %d\n",xv_filter);
}
static void xv_update_XV_DOUBLE_BUFFER(void *this_gen, xine_cfg_entry_t *entry) {
@@ -1239,7 +1070,7 @@ static void xv_update_XV_DOUBLE_BUFFER(void *this_gen, xine_cfg_entry_t *entry)
pthread_mutex_unlock(&this->main_mutex);
xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xcbxv: double buffering mode = %d\n", xv_double_buffer);
+ LOG_MODULE ": double buffering mode = %d\n", xv_double_buffer);
}
static void xv_update_xv_pitch_alignment(void *this_gen, xine_cfg_entry_t *entry) {
@@ -1288,7 +1119,7 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis
query_extension_reply = xcb_get_extension_data(this->connection, &xcb_xv_id);
if (!query_extension_reply || !query_extension_reply->present) {
- xprintf (class->xine, XINE_VERBOSITY_LOG, _("video_out_xcbxv: Xv extension not present.\n"));
+ xprintf (class->xine, XINE_VERBOSITY_LOG, _("%s: Xv extension not present.\n"), LOG_MODULE);
return NULL;
}
@@ -1300,7 +1131,7 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis
query_adaptors_reply = xcb_xv_query_adaptors_reply(this->connection, query_adaptors_cookie, NULL);
if (!query_adaptors_reply) {
- xprintf(class->xine, XINE_VERBOSITY_DEBUG, "video_out_xcbxv: XvQueryAdaptors failed.\n");
+ xprintf(class->xine, XINE_VERBOSITY_DEBUG, LOG_MODULE ": XvQueryAdaptors failed.\n");
return NULL;
}
@@ -1330,16 +1161,17 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis
if (!xv_port) {
xprintf(class->xine, XINE_VERBOSITY_LOG,
- _("video_out_xcbxv: Xv extension is present but I couldn't find a usable yuv12 port.\n"
- " Looks like your graphics hardware driver doesn't support Xv?!\n"));
+ _("%s: Xv extension is present but I couldn't find a usable yuv12 port.\n"
+ "\tLooks like your graphics hardware driver doesn't support Xv?!\n"),
+ LOG_MODULE);
/* XvFreeAdaptorInfo (adaptor_info); this crashed on me (gb)*/
return NULL;
}
else
xprintf(class->xine, XINE_VERBOSITY_LOG,
- _("video_out_xcbxv: using Xv port %d from adaptor %s for hardware "
- "colorspace conversion and scaling.\n"), xv_port,
+ _("%s: using Xv port %d from adaptor %s for hardware "
+ "colorspace conversion and scaling.\n"), LOG_MODULE, xv_port,
xcb_xv_adaptor_info_name(adaptor_it.data));
this->xv_port = xv_port;
@@ -1352,8 +1184,6 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis
xcb_create_gc(this->connection, this->gc, this->window, 0, NULL);
this->capabilities = VO_CAP_CROP;
this->use_shm = 1;
- this->deinterlace_method = 0;
- this->deinterlace_frame.image = NULL;
this->use_colorkey = 0;
this->colorkey = 0;
this->xoverlay = NULL;
@@ -1387,7 +1217,6 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis
this->props[i].this = this;
}
- this->props[VO_PROP_INTERLACED].value = 0;
this->sc.user_ratio =
this->props[VO_PROP_ASPECT_RATIO].value = XINE_VO_ASPECT_AUTO;
this->props[VO_PROP_ZOOM_X].value = 100;
@@ -1411,7 +1240,7 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis
if(!strcmp(xcb_xv_attribute_info_name(attribute_it.data), "XV_HUE")) {
if (!strncmp(xcb_xv_adaptor_info_name(adaptor_it.data), "NV", 2)) {
- xprintf (this->xine, XINE_VERBOSITY_NONE, "video_out_xcbxv: ignoring broken XV_HUE settings on NVidia cards\n");
+ xprintf (this->xine, XINE_VERBOSITY_NONE, LOG_MODULE ": ignoring broken XV_HUE settings on NVidia cards\n");
} else {
xv_check_capability (this, VO_PROP_HUE, attribute_it.data,
adaptor_it.data->base_id,
@@ -1481,7 +1310,7 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis
free(query_attributes_reply);
}
else
- xprintf(this->xine, XINE_VERBOSITY_DEBUG, "video_out_xcbxv: no port attributes defined.\n");
+ xprintf(this->xine, XINE_VERBOSITY_DEBUG, LOG_MODULE ": no port attributes defined.\n");
free(query_adaptors_reply);
/*
@@ -1506,12 +1335,12 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis
this->xv_format_yv12 = format_it.data->id;
this->capabilities |= VO_CAP_YV12;
xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_xcbxv: this adaptor supports the yv12 format.\n"));
+ _("%s: this adaptor supports the yv12 format.\n"), LOG_MODULE);
} else if (format_it.data->id == XINE_IMGFMT_YUY2) {
this->xv_format_yuy2 = format_it.data->id;
this->capabilities |= VO_CAP_YUY2;
xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_xcbxv: this adaptor supports the yuy2 format.\n"));
+ _("%s: this adaptor supports the yuy2 format.\n"), LOG_MODULE);
}
}
@@ -1523,39 +1352,6 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis
_("Some buggy video drivers need a workaround to function properly."),
10, xv_update_xv_pitch_alignment, this);
- this->deinterlace_method =
- config->register_enum (config, "video.output.xv_deinterlace_method", 4,
- deinterlace_methods,
- _("deinterlace method (deprecated)"),
- _("This config setting is deprecated. You should use the new deinterlacing "
- "post processing settings instead.\n\n"
- "From the old days of analog television, where the even and odd numbered "
- "lines of a video frame would be displayed at different times comes the "
- "idea to increase motion smoothness by also recording the lines at "
- "different times. This is called \"interlacing\". But unfortunately, "
- "todays displays show the even and odd numbered lines as one complete frame "
- "all at the same time (called \"progressive display\"), which results in "
- "ugly frame errors known as comb artifacts. Software deinterlacing is an "
- "approach to reduce these artifacts. The individual values are:\n\n"
- "none\n"
- "Disables software deinterlacing.\n\n"
- "bob\n"
- "Interpolates between the lines for moving parts of the image.\n\n"
- "weave\n"
- "Similar to bob, but with a tendency to preserve the full resolution, "
- "better for high detail in low movement scenes.\n\n"
- "greedy\n"
- "Very good adaptive deinterlacer, but needs a lot of CPU power.\n\n"
- "onefield\n"
- "Always interpolates and reduces vertical resolution.\n\n"
- "onefieldxv\n"
- "Same as onefield, but does the interpolation in hardware.\n\n"
- "linearblend\n"
- "Applies a slight vertical blur to remove the comb artifacts. Good results "
- "with medium CPU usage."),
- 10, xv_update_deinterlace, this);
- this->deinterlace_enabled = 0;
-
if(this->use_colorkey==1) {
this->xoverlay = xcbosd_create(this->xine, this->connection, this->screen,
this->window, XCBOSD_COLORKEY);
diff --git a/src/video_out/video_out_xshm.c b/src/video_out/video_out_xshm.c
index 00d3bee1c..54747e1a9 100644
--- a/src/video_out/video_out_xshm.c
+++ b/src/video_out/video_out_xshm.c
@@ -148,7 +148,7 @@ static int HandleXError (Display *display, XErrorEvent *xevent) {
char str [1024];
XGetErrorText (display, xevent->error_code, str, 1024);
- printf ("video_out_xshm: received X error event: %s\n", str);
+ printf (LOG_MODULE ": received X error event: %s\n", str);
gX11Fail = 1;
return 0;
@@ -175,11 +175,6 @@ static XImage *create_ximage (xshm_driver_t *this, XShmSegmentInfo *shminfo,
int width, int height) {
XImage *myimage = NULL;
- if (width <= 0)
- width = 1;
- if (height <= 0)
- height = 1;
-
if (this->use_shm) {
/*
@@ -199,8 +194,9 @@ static XImage *create_ximage (xshm_driver_t *this, XShmSegmentInfo *shminfo,
if (myimage == NULL ) {
xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_xshm: shared memory error when allocating image\n"
- "video_out_xshm: => not using MIT Shared Memory extension.\n"));
+ _("%s: shared memory error when allocating image\n"), LOG_MODULE);
+ xprintf(this->xine, XINE_VERBOSITY_LOG,
+ _("%s: => not using MIT Shared Memory extension.\n"), LOG_MODULE);
this->use_shm = 0;
goto finishShmTesting;
}
@@ -215,8 +211,9 @@ static XImage *create_ximage (xshm_driver_t *this, XShmSegmentInfo *shminfo,
if (shminfo->shmid < 0 ) {
xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_xshm: %s: allocating image\n"
- "video_out_xshm: => not using MIT Shared Memory extension.\n"), strerror(errno));
+ _("%s: %s: allocating image\n"), LOG_MODULE, strerror(errno));
+ xprintf(this->xine, XINE_VERBOSITY_LOG,
+ _("%s: => not using MIT Shared Memory extension.\n"), LOG_MODULE);
this->use_shm = 0;
goto finishShmTesting;
}
@@ -225,8 +222,9 @@ static XImage *create_ximage (xshm_driver_t *this, XShmSegmentInfo *shminfo,
if (shminfo->shmaddr == ((char *) -1)) {
xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_xshm: shared memory error (address error) when allocating image \n"
- "video_out_xshm: => not using MIT Shared Memory extension.\n"));
+ _("%s: shared memory error (address error) when allocating image \n"), LOG_MODULE);
+ xprintf(this->xine, XINE_VERBOSITY_LOG,
+ _("%s: => not using MIT Shared Memory extension.\n"), LOG_MODULE);
shmctl (shminfo->shmid, IPC_RMID, 0);
shminfo->shmid = -1;
this->use_shm = 0;
@@ -241,10 +239,11 @@ static XImage *create_ximage (xshm_driver_t *this, XShmSegmentInfo *shminfo,
XSync(this->display, False);
if (gX11Fail) {
- xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_xshm: x11 error during shared memory XImage creation\n"
- "video_out_xshm: => not using MIT Shared Memory extension.\n"));
shmdt (shminfo->shmaddr);
+ xprintf(this->xine, XINE_VERBOSITY_LOG,
+ _("%s: x11 error during shared memory XImage creation\n"), LOG_MODULE);
+ xprintf(this->xine, XINE_VERBOSITY_LOG,
+ _("%s: => not using MIT Shared Memory extension.\n"), LOG_MODULE);
shmctl (shminfo->shmid, IPC_RMID, 0);
shminfo->shmid = -1;
this->use_shm = 0;
@@ -284,7 +283,7 @@ static XImage *create_ximage (xshm_driver_t *this, XShmSegmentInfo *shminfo,
this->bytes_per_pixel = this->bpp / 8;
this->image_byte_order = myimage->byte_order;
- myimage->data = xine_xmalloc (width * this->bytes_per_pixel * height);
+ myimage->data = xine_xcalloc (width * height, this->bytes_per_pixel);
}
return myimage;
@@ -825,7 +824,7 @@ static int xshm_get_property (vo_driver_t *this_gen, int property) {
return this->sc.gui_height;
default:
xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xshm: tried to get unsupported property %d\n", property);
+ LOG_MODULE ": tried to get unsupported property %d\n", property);
}
return 0;
@@ -841,7 +840,7 @@ static int xshm_set_property (vo_driver_t *this_gen,
value = XINE_VO_ASPECT_AUTO;
this->sc.user_ratio = value;
xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xshm: aspect ratio changed to %s\n", _x_vo_scale_aspect_ratio_name(value));
+ LOG_MODULE ": aspect ratio changed to %s\n", _x_vo_scale_aspect_ratio_name(value));
} else if (property == VO_PROP_BRIGHTNESS) {
@@ -875,7 +874,7 @@ static int xshm_set_property (vo_driver_t *this_gen,
} else {
xprintf (this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xshm: tried to set unsupported property %d\n", property);
+ LOG_MODULE ": tried to set unsupported property %d\n", property);
}
return value;
@@ -1167,7 +1166,7 @@ static vo_driver_t *xshm_open_plugin_2 (video_driver_class_t *class_gen, const v
}
else {
xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_xshm: MIT shared memory extension not present on display.\n"));
+ _("%s: MIT shared memory extension not present on display.\n"), LOG_MODULE);
this->use_shm = 0;
}
@@ -1188,8 +1187,8 @@ static vo_driver_t *xshm_open_plugin_2 (video_driver_class_t *class_gen, const v
swapped = cpu_byte_order != this->image_byte_order;
xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xshm: video mode depth is %d (%d bpp), %s, %sswapped,\n"
- "\tred: %08lx, green: %08lx, blue: %08lx\n",
+ LOG_MODULE ": video mode depth is %d (%d bpp), %s, %sswapped,\n"
+ LOG_MODULE ": red: %08lx, green: %08lx, blue: %08lx\n",
this->depth, this->bpp,
visual_class_name(this->visual),
swapped ? "" : "not ",
@@ -1251,7 +1250,7 @@ static vo_driver_t *xshm_open_plugin_2 (video_driver_class_t *class_gen, const v
if (!mode) {
xprintf (this->xine, XINE_VERBOSITY_LOG,
- _("video_out_xshm: your video mode was not recognized, sorry :-(\n"));
+ _("%s: your video mode was not recognized, sorry :-(\n"), LOG_MODULE);
return NULL;
}
diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c
index b20a28c84..100129fdb 100644
--- a/src/video_out/video_out_xv.c
+++ b/src/video_out/video_out_xv.c
@@ -68,7 +68,6 @@
#include "video_out.h"
#include "xine_internal.h"
/* #include "overlay.h" */
-#include "deinterlace.h"
#include "xineutils.h"
#include "vo_scale.h"
#include "x11osd.h"
@@ -137,10 +136,6 @@ struct xv_driver_s {
/* all scaling information goes here */
vo_scale_t sc;
- xv_frame_t deinterlace_frame;
- int deinterlace_method;
- int deinterlace_enabled;
-
int use_colorkey;
uint32_t colorkey;
@@ -290,8 +285,9 @@ static XvImage *create_ximage (xv_driver_t *this, XShmSegmentInfo *shminfo,
if (image == NULL ) {
xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_xv: XvShmCreateImage failed\n"
- "video_out_xv: => not using MIT Shared Memory extension.\n"));
+ _("%s: XvShmCreateImage failed\n"), LOG_MODULE);
+ xprintf(this->xine, XINE_VERBOSITY_LOG,
+ _("%s: => not using MIT Shared Memory extension.\n"), LOG_MODULE);
this->use_shm = 0;
goto finishShmTesting;
}
@@ -316,16 +312,18 @@ static XvImage *create_ximage (xv_driver_t *this, XShmSegmentInfo *shminfo,
if (image->data_size==0) {
xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_xv: XvShmCreateImage returned a zero size\n"
- "video_out_xv: => not using MIT Shared Memory extension.\n"));
+ _("%s: XvShmCreateImage returned a zero size\n"), LOG_MODULE);
+ xprintf(this->xine, XINE_VERBOSITY_LOG,
+ _("%s: => not using MIT Shared Memory extension.\n"), LOG_MODULE);
this->use_shm = 0;
goto finishShmTesting;
}
if (shminfo->shmid < 0 ) {
xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_xv: shared memory error in shmget: %s\n"
- "video_out_xv: => not using MIT Shared Memory extension.\n"), strerror(errno));
+ _("%s: shared memory error in shmget: %s\n"), LOG_MODULE, strerror(errno));
+ xprintf(this->xine, XINE_VERBOSITY_LOG,
+ _("%s: => not using MIT Shared Memory extension.\n"), LOG_MODULE);
this->use_shm = 0;
goto finishShmTesting;
}
@@ -334,14 +332,14 @@ static XvImage *create_ximage (xv_driver_t *this, XShmSegmentInfo *shminfo,
if (shminfo->shmaddr == NULL) {
xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xv: shared memory error (address error NULL)\n");
+ LOG_MODULE ": shared memory error (address error NULL)\n");
this->use_shm = 0;
goto finishShmTesting;
}
if (shminfo->shmaddr == ((char *) -1)) {
xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xv: shared memory error (address error)\n");
+ LOG_MODULE ": shared memory error (address error)\n");
this->use_shm = 0;
goto finishShmTesting;
}
@@ -355,12 +353,13 @@ static XvImage *create_ximage (xv_driver_t *this, XShmSegmentInfo *shminfo,
shmctl(shminfo->shmid, IPC_RMID, 0);
if (gX11Fail) {
- xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_xv: x11 error during shared memory XImage creation\n"
- "video_out_xv: => not using MIT Shared Memory extension.\n"));
shmdt (shminfo->shmaddr);
shmctl (shminfo->shmid, IPC_RMID, 0);
shminfo->shmid = -1;
+ xprintf(this->xine, XINE_VERBOSITY_LOG,
+ _("%s: x11 error during shared memory XImage creation\n"), LOG_MODULE);
+ xprintf(this->xine, XINE_VERBOSITY_LOG,
+ _("%s: => not using MIT Shared Memory extension.\n"), LOG_MODULE);
this->use_shm = 0;
goto finishShmTesting;
}
@@ -443,7 +442,7 @@ static void xv_update_frame_format (vo_driver_t *this_gen,
|| (frame->height != height)
|| (frame->format != format)) {
- /* printf ("video_out_xv: updating frame to %d x %d (ratio=%d, format=%08x)\n",width,height,ratio_code,format); */
+ /* printf (LOG_MODULE ": updating frame to %d x %d (ratio=%d, format=%08x)\n",width,height,ratio_code,format); */
LOCK_DISPLAY(this);
@@ -481,120 +480,6 @@ static void xv_update_frame_format (vo_driver_t *this_gen,
frame->ratio = ratio;
}
-#define DEINTERLACE_CROMA
-static void xv_deinterlace_frame (xv_driver_t *this) {
- uint8_t *recent_bitmaps[VO_NUM_RECENT_FRAMES];
- xv_frame_t *frame = this->recent_frames[0];
- int i;
- int xvscaling;
-
- xvscaling = (this->deinterlace_method == DEINTERLACE_ONEFIELDXV) ? 2 : 1;
-
- if (!this->deinterlace_frame.image
- || (frame->width != this->deinterlace_frame.width)
- || (frame->height != this->deinterlace_frame.height )
- || (frame->format != this->deinterlace_frame.format)
- || (frame->ratio != this->deinterlace_frame.ratio)) {
- LOCK_DISPLAY(this);
-
- if(this->deinterlace_frame.image)
- dispose_ximage (this, &this->deinterlace_frame.shminfo,
- this->deinterlace_frame.image);
-
- this->deinterlace_frame.image = create_ximage (this, &this->deinterlace_frame.shminfo,
- frame->width,frame->height / xvscaling,
- frame->format);
- this->deinterlace_frame.width = frame->width;
- this->deinterlace_frame.height = frame->height;
- this->deinterlace_frame.format = frame->format;
- this->deinterlace_frame.ratio = frame->ratio;
-
- UNLOCK_DISPLAY(this);
- }
-
-
- if ( this->deinterlace_method != DEINTERLACE_ONEFIELDXV ) {
-#ifdef DEINTERLACE_CROMA
-
- /* I don't think this is the right way to do it (deinterlacing croma by croma info).
- DScaler deinterlaces croma together with luma, but it's easier for them because
- they have that components 1:1 at the same table.
- */
- for( i = 0; i < VO_NUM_RECENT_FRAMES; i++ )
- if( this->recent_frames[i] && this->recent_frames[i]->width == frame->width &&
- this->recent_frames[i]->height == frame->height )
- recent_bitmaps[i] = this->recent_frames[i]->image->data + frame->width*frame->height;
- else
- recent_bitmaps[i] = NULL;
-
- deinterlace_yuv( this->deinterlace_frame.image->data+this->deinterlace_frame.image->width*frame->height,
- recent_bitmaps, this->deinterlace_frame.image->width/2, frame->height/2, this->deinterlace_method );
- for( i = 0; i < VO_NUM_RECENT_FRAMES; i++ )
- if( this->recent_frames[i] && this->recent_frames[i]->width == frame->width &&
- this->recent_frames[i]->height == frame->height )
- recent_bitmaps[i] = this->recent_frames[i]->image->data + this->deinterlace_frame.image->width*frame->height*5/4;
- else
- recent_bitmaps[i] = NULL;
-
- deinterlace_yuv( this->deinterlace_frame.image->data+this->deinterlace_frame.image->width*frame->height*5/4,
- recent_bitmaps, this->deinterlace_frame.image->width/2, frame->height/2, this->deinterlace_method );
-
-#else
-
- /* know bug: we are not deinterlacing Cb and Cr */
- xine_fast_memcpy(this->deinterlace_frame.image->data + frame->width*frame->height,
- frame->image->data + frame->width*frame->height,
- frame->width*frame->height*1/2);
-
-#endif
-
- for( i = 0; i < VO_NUM_RECENT_FRAMES; i++ )
- if( this->recent_frames[i] && this->recent_frames[i]->width == frame->width &&
- this->recent_frames[i]->height == frame->height )
- recent_bitmaps[i] = this->recent_frames[i]->image->data;
- else
- recent_bitmaps[i] = NULL;
-
- deinterlace_yuv( this->deinterlace_frame.image->data, recent_bitmaps,
- this->deinterlace_frame.image->width, frame->height, this->deinterlace_method );
- }
- else {
- /*
- dirty and cheap deinterlace method: we give half of the lines to xv
- driver and let it scale for us.
- note that memcpy's below don't seem to impact much on performance,
- specially when fast memcpys are available.
- */
- uint8_t *dst, *src;
-
- dst = this->deinterlace_frame.image->data;
- src = this->recent_frames[0]->image->data;
- for( i = 0; i < frame->height; i+=2 ) {
- xine_fast_memcpy(dst,src,frame->width);
- dst += frame->width;
- src += 2 * frame->width;
- }
-
- dst = this->deinterlace_frame.image->data + frame->width * frame->height / 2;
- src = this->recent_frames[0]->image->data + frame->width * frame->height;
- for( i = 0; i < frame->height; i+=4 ) {
- xine_fast_memcpy(dst,src,frame->width / 2);
- dst += frame->width / 2;
- src += frame->width;
- }
-
- dst = this->deinterlace_frame.image->data + frame->width * frame->height * 5 / 8;
- src = this->recent_frames[0]->image->data + frame->width * frame->height * 5 / 4;
- for( i = 0; i < frame->height; i+=4 ) {
- xine_fast_memcpy(dst,src,frame->width / 2);
- dst += frame->width / 2;
- src += frame->width;
- }
- }
-
- this->cur_frame = &this->deinterlace_frame;
-}
-
static void xv_clean_output_area (xv_driver_t *this) {
int i;
@@ -642,14 +527,6 @@ static void xv_compute_ideal_size (xv_driver_t *this) {
static void xv_compute_output_size (xv_driver_t *this) {
_x_vo_scale_compute_output_size( &this->sc );
-
- /* onefield_xv divide by 2 the number of lines */
- if (this->deinterlace_enabled
- && (this->deinterlace_method == DEINTERLACE_ONEFIELDXV)
- && this->cur_frame && (this->cur_frame->format == XINE_IMGFMT_YV12)) {
- this->sc.displayed_height = this->sc.displayed_height / 2 - 1;
- this->sc.displayed_yoffset = this->sc.displayed_yoffset / 2;
- }
}
static void xv_overlay_begin (vo_driver_t *this_gen,
@@ -779,7 +656,7 @@ static void xv_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) {
xv_driver_t *this = (xv_driver_t *) this_gen;
xv_frame_t *frame = (xv_frame_t *) frame_gen;
/*
- printf ("video_out_xv: xv_display_frame...\n");
+ printf (LOG_MODULE ": xv_display_frame...\n");
*/
/*
@@ -803,17 +680,6 @@ static void xv_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) {
}
/*
- * deinterlace frame if necessary
- * (currently only working for YUV images)
- */
-
- if (this->deinterlace_enabled && this->deinterlace_method
- && frame->format == XINE_IMGFMT_YV12
- && (deinterlace_yuv_supported( this->deinterlace_method ) == 1
- || this->deinterlace_method == DEINTERLACE_ONEFIELDXV))
- xv_deinterlace_frame (this);
-
- /*
* tell gui that we are about to display a frame,
* ask for offset and output size
*/
@@ -859,7 +725,7 @@ static void xv_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) {
}
/*
- printf ("video_out_xv: xv_display_frame... done\n");
+ printf (LOG_MODULE ": xv_display_frame... done\n");
*/
}
@@ -875,7 +741,7 @@ static int xv_get_property (vo_driver_t *this_gen, int property) {
break;
}
- lprintf("video_out_xv: property #%d = %d\n", property, this->props[property].value);
+ lprintf(LOG_MODULE ": property #%d = %d\n", property, this->props[property].value);
return this->props[property].value;
}
@@ -917,24 +783,13 @@ static int xv_set_property (vo_driver_t *this_gen,
else {
switch (property) {
- case VO_PROP_INTERLACED:
- this->props[property].value = value;
- xprintf(this->xine, XINE_VERBOSITY_LOG,
- "video_out_xv: VO_PROP_INTERLACED(%d)\n", this->props[property].value);
- this->deinterlace_enabled = value;
- if (this->deinterlace_method == DEINTERLACE_ONEFIELDXV) {
- xv_compute_ideal_size (this);
- xv_compute_output_size (this);
- }
- break;
-
case VO_PROP_ASPECT_RATIO:
if (value>=XINE_VO_ASPECT_NUM_RATIOS)
value = XINE_VO_ASPECT_AUTO;
this->props[property].value = value;
xprintf(this->xine, XINE_VERBOSITY_LOG,
- "video_out_xv: VO_PROP_ASPECT_RATIO(%d)\n", this->props[property].value);
+ LOG_MODULE ": VO_PROP_ASPECT_RATIO(%d)\n", this->props[property].value);
this->sc.user_ratio = value;
xv_compute_ideal_size (this);
@@ -946,7 +801,7 @@ static int xv_set_property (vo_driver_t *this_gen,
if ((value >= XINE_VO_ZOOM_MIN) && (value <= XINE_VO_ZOOM_MAX)) {
this->props[property].value = value;
xprintf(this->xine, XINE_VERBOSITY_LOG,
- "video_out_xv: VO_PROP_ZOOM_X = %d\n", this->props[property].value);
+ LOG_MODULE ": VO_PROP_ZOOM_X = %d\n", this->props[property].value);
this->sc.zoom_factor_x = (double)value / (double)XINE_VO_ZOOM_STEP;
@@ -960,7 +815,7 @@ static int xv_set_property (vo_driver_t *this_gen,
if ((value >= XINE_VO_ZOOM_MIN) && (value <= XINE_VO_ZOOM_MAX)) {
this->props[property].value = value;
xprintf(this->xine, XINE_VERBOSITY_LOG,
- "video_out_xv: VO_PROP_ZOOM_Y = %d\n", this->props[property].value);
+ LOG_MODULE ": VO_PROP_ZOOM_Y = %d\n", this->props[property].value);
this->sc.zoom_factor_y = (double)value / (double)XINE_VO_ZOOM_STEP;
@@ -1061,15 +916,6 @@ static int xv_gui_data_exchange (vo_driver_t *this_gen,
rect->y = y1;
rect->w = x2-x1;
rect->h = y2-y1;
-
- /* onefield_xv divide by 2 the number of lines */
- if (this->deinterlace_enabled
- && (this->deinterlace_method == DEINTERLACE_ONEFIELDXV)
- && (this->cur_frame->format == XINE_IMGFMT_YV12)) {
- rect->y = rect->y * 2;
- rect->h = rect->h * 2;
- }
-
}
break;
@@ -1125,18 +971,10 @@ static void xv_dispose (vo_driver_t *this_gen) {
/* restore port attributes to their initial values */
xv_restore_port_attributes(this);
-
- if (this->deinterlace_frame.image) {
- LOCK_DISPLAY(this);
- dispose_ximage (this, &this->deinterlace_frame.shminfo,
- this->deinterlace_frame.image);
- UNLOCK_DISPLAY(this);
- this->deinterlace_frame.image = NULL;
- }
LOCK_DISPLAY(this);
if(XvUngrabPort (this->display, this->xv_port, CurrentTime) != Success) {
- xprintf (this->xine, XINE_VERBOSITY_DEBUG, "video_out_xv: xv_exit: XvUngrabPort() failed.\n");
+ xprintf (this->xine, XINE_VERBOSITY_DEBUG, LOG_MODULE ": xv_exit: XvUngrabPort() failed.\n");
}
XFreeGC(this->display, this->gc);
UNLOCK_DISPLAY(this);
@@ -1203,7 +1041,7 @@ static void xv_check_capability (xv_driver_t *this,
this->props[property].atom, &int_default);
xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xv: port attribute %s (%d) value is %d\n", str_prop, property, int_default);
+ LOG_MODULE ": port attribute %s (%d) value is %d\n", str_prop, property, int_default);
/* disable autopaint colorkey by default */
/* might be overridden using config entry */
@@ -1248,13 +1086,6 @@ static void xv_check_capability (xv_driver_t *this,
}
} else
this->props[property].value = int_default;
-
-}
-
-static void xv_update_deinterlace(void *this_gen, xine_cfg_entry_t *entry) {
- xv_driver_t *this = (xv_driver_t *) this_gen;
-
- this->deinterlace_method = entry->num_value;
}
static void xv_update_XV_FILTER(void *this_gen, xine_cfg_entry_t *entry) {
@@ -1270,7 +1101,7 @@ static void xv_update_XV_FILTER(void *this_gen, xine_cfg_entry_t *entry) {
UNLOCK_DISPLAY(this);
xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xv: bilinear scaling mode (XV_FILTER) = %d\n",xv_filter);
+ LOG_MODULE ": bilinear scaling mode (XV_FILTER) = %d\n",xv_filter);
}
static void xv_update_XV_DOUBLE_BUFFER(void *this_gen, xine_cfg_entry_t *entry) {
@@ -1286,7 +1117,7 @@ static void xv_update_XV_DOUBLE_BUFFER(void *this_gen, xine_cfg_entry_t *entry)
UNLOCK_DISPLAY(this);
xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xv: double buffering mode = %d\n", xv_double_buffer);
+ LOG_MODULE ": double buffering mode = %d\n", xv_double_buffer);
}
static void xv_update_xv_pitch_alignment(void *this_gen, xine_cfg_entry_t *entry) {
@@ -1335,7 +1166,7 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void *
LOCK_DISPLAY(this);
if (Success != XvQueryExtension(this->display, &ver,&rel, &req, &ev,&err)) {
- xprintf (class->xine, XINE_VERBOSITY_LOG, _("video_out_xv: Xv extension not present.\n"));
+ xprintf (class->xine, XINE_VERBOSITY_LOG, _("%s: Xv extension not present.\n"), LOG_MODULE);
UNLOCK_DISPLAY(this);
return NULL;
}
@@ -1345,7 +1176,7 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void *
*/
if (Success != XvQueryAdaptors(this->display,DefaultRootWindow(this->display), &adaptors, &adaptor_info)) {
- xprintf(class->xine, XINE_VERBOSITY_DEBUG, "video_out_xv: XvQueryAdaptors failed.\n");
+ xprintf(class->xine, XINE_VERBOSITY_DEBUG, LOG_MODULE ": XvQueryAdaptors failed.\n");
UNLOCK_DISPLAY(this);
return NULL;
}
@@ -1372,8 +1203,9 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void *
if (!xv_port) {
xprintf(class->xine, XINE_VERBOSITY_LOG,
- _("video_out_xv: Xv extension is present but I couldn't find a usable yuv12 port.\n"
- " Looks like your graphics hardware driver doesn't support Xv?!\n"));
+ _("%s: Xv extension is present but I couldn't find a usable yuv12 port.\n"
+ "\tLooks like your graphics hardware driver doesn't support Xv?!\n"),
+ LOG_MODULE);
/* XvFreeAdaptorInfo (adaptor_info); this crashed on me (gb)*/
UNLOCK_DISPLAY(this);
@@ -1381,8 +1213,8 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void *
}
else
xprintf(class->xine, XINE_VERBOSITY_LOG,
- _("video_out_xv: using Xv port %ld from adaptor %s for hardware "
- "colorspace conversion and scaling.\n"), xv_port,
+ _("%s: using Xv port %ld from adaptor %s for hardware "
+ "colorspace conversion and scaling.\n"), LOG_MODULE, xv_port,
adaptor_info[adaptor_num].name);
UNLOCK_DISPLAY(this);
@@ -1399,8 +1231,6 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void *
UNLOCK_DISPLAY(this);
this->capabilities = VO_CAP_CROP;
this->use_shm = 1;
- this->deinterlace_method = 0;
- this->deinterlace_frame.image = NULL;
this->use_colorkey = 0;
this->colorkey = 0;
this->xoverlay = NULL;
@@ -1441,7 +1271,6 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void *
this->props[i].this = this;
}
- this->props[VO_PROP_INTERLACED].value = 0;
this->sc.user_ratio =
this->props[VO_PROP_ASPECT_RATIO].value = XINE_VO_ASPECT_AUTO;
this->props[VO_PROP_ZOOM_X].value = 100;
@@ -1464,7 +1293,7 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void *
if(!strcmp(attr[k].name, "XV_HUE")) {
if (!strncmp(adaptor_info[adaptor_num].name, "NV", 2)) {
- xprintf (this->xine, XINE_VERBOSITY_NONE, "video_out_xv: ignoring broken XV_HUE settings on NVidia cards\n");
+ xprintf (this->xine, XINE_VERBOSITY_NONE, LOG_MODULE ": ignoring broken XV_HUE settings on NVidia cards\n");
} else {
xv_check_capability (this, VO_PROP_HUE, attr[k],
adaptor_info[adaptor_num].base_id,
@@ -1534,7 +1363,7 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void *
XFree(attr);
}
else
- xprintf(this->xine, XINE_VERBOSITY_DEBUG, "video_out_xv: no port attributes defined.\n");
+ xprintf(this->xine, XINE_VERBOSITY_DEBUG, LOG_MODULE ": no port attributes defined.\n");
XvFreeAdaptorInfo(adaptor_info);
/*
@@ -1556,12 +1385,12 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void *
this->xv_format_yv12 = fo[i].id;
this->capabilities |= VO_CAP_YV12;
xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_xv: this adaptor supports the yv12 format.\n"));
+ _("%s: this adaptor supports the yv12 format.\n"), LOG_MODULE);
} else if (fo[i].id == XINE_IMGFMT_YUY2) {
this->xv_format_yuy2 = fo[i].id;
this->capabilities |= VO_CAP_YUY2;
xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_xv: this adaptor supports the yuy2 format.\n"));
+ _("%s: this adaptor supports the yuy2 format.\n"), LOG_MODULE);
}
}
@@ -1587,39 +1416,6 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void *
_("Some buggy video drivers need a workaround to function properly."),
10, xv_update_xv_pitch_alignment, this);
- this->deinterlace_method =
- config->register_enum (config, "video.output.xv_deinterlace_method", 4,
- deinterlace_methods,
- _("deinterlace method (deprecated)"),
- _("This config setting is deprecated. You should use the new deinterlacing "
- "post processing settings instead.\n\n"
- "From the old days of analog television, where the even and odd numbered "
- "lines of a video frame would be displayed at different times comes the "
- "idea to increase motion smoothness by also recording the lines at "
- "different times. This is called \"interlacing\". But unfortunately, "
- "todays displays show the even and odd numbered lines as one complete frame "
- "all at the same time (called \"progressive display\"), which results in "
- "ugly frame errors known as comb artifacts. Software deinterlacing is an "
- "approach to reduce these artifacts. The individual values are:\n\n"
- "none\n"
- "Disables software deinterlacing.\n\n"
- "bob\n"
- "Interpolates between the lines for moving parts of the image.\n\n"
- "weave\n"
- "Similar to bob, but with a tendency to preserve the full resolution, "
- "better for high detail in low movement scenes.\n\n"
- "greedy\n"
- "Very good adaptive deinterlacer, but needs a lot of CPU power.\n\n"
- "onefield\n"
- "Always interpolates and reduces vertical resolution.\n\n"
- "onefieldxv\n"
- "Same as onefield, but does the interpolation in hardware.\n\n"
- "linearblend\n"
- "Applies a slight vertical blur to remove the comb artifacts. Good results "
- "with medium CPU usage."),
- 10, xv_update_deinterlace, this);
- this->deinterlace_enabled = 0;
-
LOCK_DISPLAY(this);
if(this->use_colorkey==1) {
this->xoverlay = x11osd_create (this->xine, this->display, this->screen,
diff --git a/src/video_out/video_out_xvmc.c b/src/video_out/video_out_xvmc.c
index 53d09b7d5..77016dc81 100644
--- a/src/video_out/video_out_xvmc.c
+++ b/src/video_out/video_out_xvmc.c
@@ -72,9 +72,6 @@
#include "xine_internal.h"
#include "accel_xvmc.h"
-/* TODO - delete these? */
-#include "deinterlace.h"
-
#include "xineutils.h"
#include "vo_scale.h"
@@ -198,11 +195,6 @@ struct xvmc_driver_s {
double ratio_factor; /* output frame must fullfill:
height = width * ratio_factor */
-
- xvmc_frame_t deinterlace_frame;
- int deinterlace_method;
- int deinterlace_enabled;
-
/* gui callback */
void (*frame_output_cb) (void *user_data,
@@ -489,9 +481,9 @@ static void xvmc_render_macro_blocks(vo_frame_t *current_image,
int second_field,
xvmc_macroblocks_t *macroblocks) {
xvmc_driver_t *this = (xvmc_driver_t *) current_image->driver;
- xvmc_frame_t *current_frame = (xvmc_frame_t *) current_image;
- xvmc_frame_t *forward_frame = (xvmc_frame_t *) forward_ref_image;
- xvmc_frame_t *backward_frame = (xvmc_frame_t *) backward_ref_image;
+ xvmc_frame_t *current_frame = XVMC_FRAME(current_image);
+ xvmc_frame_t *forward_frame = XVMC_FRAME(forward_ref_image);
+ xvmc_frame_t *backward_frame = XVMC_FRAME(backward_ref_image);
int flags;
lprintf ("xvmc_render_macro_blocks\n");
@@ -564,6 +556,7 @@ static vo_frame_t *xvmc_alloc_frame (vo_driver_t *this_gen) {
return NULL;
frame->vo_frame.accel_data = &frame->xvmc_data;
+ frame->xvmc_data.vo_frame = &frame->vo_frame;
/* keep track of frames and how many frames alocated. */
this->frames[this->num_frame_buffers++] = frame;
@@ -766,6 +759,11 @@ static void xvmc_update_frame_format (vo_driver_t *this_gen,
xvmc_frame_t *frame = (xvmc_frame_t *) frame_gen;
xine_xvmc_t *xvmc = (xine_xvmc_t *) frame_gen->accel_data;
+ if (format != XINE_IMGFMT_XVMC) {
+ xprintf (this->xine, XINE_VERBOSITY_LOG, "xvmc_update_frame_format: frame format %08x not supported\n", format);
+ _x_abort();
+ }
+
lprintf ("xvmc_update_frame_format\n");
if ((frame->width != width)
@@ -853,6 +851,8 @@ static void xvmc_overlay_blend (vo_driver_t *this_gen,
_x_blend_yuy2(frame->vo_frame.base[0], overlay,
frame->width, frame->height, frame->vo_frame.pitches[0],
&this->alphablend_extra_data);
+ else
+ xprintf (this->xine, XINE_VERBOSITY_LOG, "xvmc_overlay_blend: overlay blending not supported for frame format %08x\n", frame->format);
}
}
@@ -966,24 +966,13 @@ static void xvmc_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) {
/* Make sure the surface has finished rendering before we display */
XvMCSyncSurface(this->display, &this->cur_frame->surface);
- if (this->deinterlace_enabled &&
- (this->deinterlace_method == DEINTERLACE_ONEFIELD)) {
- XvMCPutSurface(this->display, &this->cur_frame->surface,
- this->drawable,
- this->sc.displayed_xoffset, this->sc.displayed_yoffset,
- this->sc.displayed_width, this->sc.displayed_height,
- this->sc.output_xoffset, this->sc.output_yoffset,
- this->sc.output_width, this->sc.output_height,
- XVMC_TOP_FIELD);
- } else { /* WEAVE */
- XvMCPutSurface(this->display, &this->cur_frame->surface,
- this->drawable,
- this->sc.displayed_xoffset, this->sc.displayed_yoffset,
- this->sc.displayed_width, this->sc.displayed_height,
- this->sc.output_xoffset, this->sc.output_yoffset,
- this->sc.output_width, this->sc.output_height,
- XVMC_FRAME_PICTURE);
- }
+ XvMCPutSurface(this->display, &this->cur_frame->surface,
+ this->drawable,
+ this->sc.displayed_xoffset, this->sc.displayed_yoffset,
+ this->sc.displayed_width, this->sc.displayed_height,
+ this->sc.output_xoffset, this->sc.output_yoffset,
+ this->sc.output_width, this->sc.output_height,
+ XVMC_FRAME_PICTURE);
XUnlockDisplay (this->display);
@@ -1047,16 +1036,6 @@ static int xvmc_set_property (vo_driver_t *this_gen,
}
else {
switch (property) {
- case VO_PROP_INTERLACED:
- this->props[property].value = value;
- lprintf("VO_PROP_INTERLACED(%d)\n", this->props[property].value);
- this->deinterlace_enabled = value;
-
- if (this->deinterlace_method == DEINTERLACE_ONEFIELDXV) {
- xvmc_compute_ideal_size (this);
- }
- break;
-
case VO_PROP_ASPECT_RATIO:
if (value>=XINE_VO_ASPECT_NUM_RATIOS)
value = XINE_VO_ASPECT_AUTO;
@@ -1288,14 +1267,6 @@ static void xvmc_check_capability (xvmc_driver_t *this,
this->props[property].value = int_default;
}
-static void xvmc_update_deinterlace(void *this_gen, xine_cfg_entry_t *entry) {
- xvmc_driver_t *this = (xvmc_driver_t *) this_gen;
-
- lprintf ("xvmc_update_deinterlace method = %d\n",entry->num_value);
-
- this->deinterlace_method = entry->num_value;
-}
-
static void xvmc_update_XV_DOUBLE_BUFFER(void *this_gen, xine_cfg_entry_t *entry)
{
xvmc_driver_t *this = (xvmc_driver_t *) this_gen;
@@ -1366,7 +1337,6 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
/* TODO CLEAN UP THIS */
this->user_data = visual->user_data;
- this->deinterlace_method = 0;
this->use_colorkey = 0;
this->colorkey = 0;
@@ -1517,65 +1487,6 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
dispose_ximage (this, &myshminfo, myimage);
XUnLockDisplay(this->display);
*/
-
- this->deinterlace_method =
- config->register_enum (config, "video.output.xv_deinterlace_method", 4,
- deinterlace_methods,
- _("deinterlace method (deprecated)"),
- _("This config setting is deprecated. You should use the new deinterlacing "
- "post processing settings instead.\n\n"
- "From the old days of analog television, where the even and odd numbered "
- "lines of a video frame would be displayed at different times comes the "
- "idea to increase motion smoothness by also recording the lines at "
- "different times. This is called \"interlacing\". But unfortunately, "
- "todays displays show the even and odd numbered lines as one complete frame "
- "all at the same time (called \"progressive display\"), which results in "
- "ugly frame errors known as comb artifacts. Software deinterlacing is an "
- "approach to reduce these artifacts. The individual values are:\n\n"
- "none\n"
- "Disables software deinterlacing.\n\n"
- "bob\n"
- "Interpolates between the lines for moving parts of the image.\n\n"
- "weave\n"
- "Similar to bob, but with a tendency to preserve the full resolution, "
- "better for high detail in low movement scenes.\n\n"
- "greedy\n"
- "Very good adaptive deinterlacer, but needs a lot of CPU power.\n\n"
- "onefield\n"
- "Always interpolates and reduces vertical resolution.\n\n"
- "onefieldxv\n"
- "Same as onefield, but does the interpolation in hardware.\n\n"
- "linearblend\n"
- "Applies a slight vertical blur to remove the comb artifacts. Good results "
- "with medium CPU usage."),
- 10, xvmc_update_deinterlace, this);
-
- this->deinterlace_enabled = 1; /* default is enabled */
- lprintf("deinterlace_methods %d ",this->deinterlace_method);
-
- switch(this->deinterlace_method) {
- case DEINTERLACE_NONE:
- lprintf("NONE\n");
- break;
- case DEINTERLACE_BOB:
- lprintf("BOB\n");
- break;
- case DEINTERLACE_WEAVE:
- lprintf("WEAVE\n");
- break;
- case DEINTERLACE_GREEDY:
- lprintf("GREEDY\n");
- break;
- case DEINTERLACE_ONEFIELD:
- lprintf("ONEFIELD\n");
- break;
- case DEINTERLACE_ONEFIELDXV:
- lprintf("ONEFIELDXV\n");
- break;
- case DEINTERLACE_LINEARBLEND:
- lprintf("LINEARBLEND\n");
- break;
- }
lprintf("initialization of plugin successful\n");
return &this->vo_driver;
diff --git a/src/video_out/video_out_xxmc.c b/src/video_out/video_out_xxmc.c
index 5dd3cb118..0f1040685 100644
--- a/src/video_out/video_out_xxmc.c
+++ b/src/video_out/video_out_xxmc.c
@@ -165,14 +165,10 @@ static void xxmc_xvmc_surface_handler_construct(xxmc_driver_t *this)
xvmc_surface_handler_t *handler = &this->xvmc_surf_handler;
pthread_mutex_init(&handler->mutex,NULL);
- for (i=0; i<XVMC_MAX_SURFACES; ++i) {
- handler->surfInUse[i] = 0;
- handler->surfValid[i] = 0;
- }
- for (i=0; i<XVMC_MAX_SUBPICTURES; ++i) {
- handler->subInUse[i] = 0;
- handler->subValid[i] = 0;
- }
+ memset(handler->surfInUse, 0, sizeof(*handler->surfInUse)*XVMC_MAX_SURFACES);
+ memset(handler->surfValid, 0, sizeof(*handler->surfValid)*XVMC_MAX_SURFACES);
+ memset(handler->subInUse, 0, sizeof(*handler->subInUse)*XVMC_MAX_SUBPICTURES);
+ memset(handler->subValid, 0, sizeof(*handler->subValid)*XVMC_MAX_SUBPICTURES);
}
static void xxmc_xvmc_destroy_surfaces(xxmc_driver_t *this)
@@ -242,7 +238,7 @@ static XvMCSurface *xxmc_xvmc_alloc_surface(xxmc_driver_t *this,
}
XVMCUNLOCKDISPLAY( this->display );
xprintf (this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xxmc: Created surface %d\n",i);
+ LOG_MODULE ": Created surface %d\n",i);
handler->surfInUse[i] = 1;
handler->surfValid[i] = 1;
pthread_mutex_unlock(&handler->mutex);
@@ -262,7 +258,7 @@ static void xxmc_xvmc_free_surface(xxmc_driver_t *this, XvMCSurface *surf)
if (index >= XVMC_MAX_SURFACES) return;
pthread_mutex_lock(&handler->mutex);
xprintf (this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xxmc: Disposing of surface %d\n",index);
+ LOG_MODULE ": Disposing of surface %d\n",index);
handler->surfInUse[index]--;
xxmc_xvmc_dump_surfaces(this);
pthread_mutex_unlock(&handler->mutex);
@@ -322,7 +318,7 @@ static XvMCSubpicture *xxmc_xvmc_alloc_subpicture
}
XVMCUNLOCKDISPLAY( this->display );
xprintf (this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xxmc: Created subpicture %d\n",i);
+ LOG_MODULE ": Created subpicture %d\n",i);
handler->subInUse[i] = 1;
handler->subValid[i] = 1;
pthread_mutex_unlock(&handler->mutex);
@@ -343,7 +339,7 @@ static void xxmc_xvmc_free_subpicture(xxmc_driver_t *this, XvMCSubpicture *sub)
if (index >= XVMC_MAX_SUBPICTURES) return;
pthread_mutex_lock(&handler->mutex);
xprintf (this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xxmc: Disposing of subpicture %d\n",index);
+ LOG_MODULE ": Disposing of subpicture %d\n",index);
handler->subInUse[index] = 0;
xxmc_xvmc_dump_subpictures(this);
pthread_mutex_unlock(&handler->mutex);
@@ -371,15 +367,15 @@ static int xxmc_lock_and_validate_surfaces(vo_frame_t *cur_frame,
switch(pc_type) {
case XINE_PICT_B_TYPE:
- frame = (xxmc_frame_t *) bw_frame;
+ frame = XXMC_FRAME(bw_frame);
if (!xxmc_xvmc_surface_valid( driver, frame->xvmc_surf)) break;
/* fall through */
case XINE_PICT_P_TYPE:
- frame = (xxmc_frame_t *) fw_frame;
+ frame = XXMC_FRAME(fw_frame);
if (!xxmc_xvmc_surface_valid( driver, frame->xvmc_surf)) break;
/* fall through */
default:
- frame = (xxmc_frame_t *) cur_frame;
+ frame = XXMC_FRAME(cur_frame);
if (!xxmc_xvmc_surface_valid( driver, frame->xvmc_surf)) break;
return 0;
}
@@ -410,7 +406,7 @@ static void xvmc_flush(vo_frame_t *this_gen)
{
xxmc_frame_t
- *frame = (xxmc_frame_t *) this_gen;
+ *frame = XXMC_FRAME(this_gen);
xxmc_driver_t
*driver = (xxmc_driver_t *) this_gen->driver;
@@ -458,6 +454,7 @@ static void xxmc_duplicate_frame_data(vo_frame_t *this_gen,
return;
}
this->xxmc_data = *xxmc;
+ this->xxmc_data.xvmc.vo_frame = &this->vo_frame;
this->width = original->width;
this->height = original->height;
this->format = original->format;
@@ -572,6 +569,7 @@ static vo_frame_t *xxmc_alloc_frame (vo_driver_t *this_gen) {
frame->vo_frame.driver = this_gen;
frame->last_sw_format = 0;
frame->vo_frame.accel_data = &frame->xxmc_data;
+ frame->xxmc_data.xvmc.vo_frame = &frame->vo_frame;
frame->image = NULL;
xprintf (this->xine, XINE_VERBOSITY_DEBUG, "Allocating frame\n");
@@ -642,8 +640,9 @@ static XvImage *create_ximage (xxmc_driver_t *this, XShmSegmentInfo *shminfo,
if (image == NULL ) {
xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_xxmc: XvShmCreateImage failed\n"
- "video_out_xxmc: => not using MIT Shared Memory extension.\n"));
+ _("%s: XvShmCreateImage failed\n"), LOG_MODULE);
+ xprintf(this->xine, XINE_VERBOSITY_LOG,
+ _("%s: => not using MIT Shared Memory extension.\n"), LOG_MODULE);
this->use_shm = 0;
goto finishShmTesting;
}
@@ -652,16 +651,18 @@ static XvImage *create_ximage (xxmc_driver_t *this, XShmSegmentInfo *shminfo,
if (image->data_size==0) {
xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_xxmc: XvShmCreateImage returned a zero size\n"
- "video_out_xxmc: => not using MIT Shared Memory extension.\n"));
+ _("%s: XvShmCreateImage returned a zero size\n"), LOG_MODULE);
+ xprintf(this->xine, XINE_VERBOSITY_LOG,
+ _("%s: => not using MIT Shared Memory extension.\n"), LOG_MODULE);
this->use_shm = 0;
goto finishShmTesting;
}
if (shminfo->shmid < 0 ) {
xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_xxmc: shared memory error in shmget: %s\n"
- "video_out_xxmc: => not using MIT Shared Memory extension.\n"), strerror(errno));
+ _("%s: shared memory error in shmget: %s\n"), LOG_MODULE, strerror(errno));
+ xprintf(this->xine, XINE_VERBOSITY_LOG,
+ _("%s: => not using MIT Shared Memory extension.\n"), LOG_MODULE);
this->use_shm = 0;
goto finishShmTesting;
}
@@ -670,14 +671,14 @@ static XvImage *create_ximage (xxmc_driver_t *this, XShmSegmentInfo *shminfo,
if (shminfo->shmaddr == NULL) {
xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xxmc: shared memory error (address error NULL)\n");
+ LOG_MODULE ": shared memory error (address error NULL)\n");
this->use_shm = 0;
goto finishShmTesting;
}
if (shminfo->shmaddr == ((char *) -1)) {
xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xxmc: shared memory error (address error)\n");
+ LOG_MODULE ": shared memory error (address error)\n");
this->use_shm = 0;
goto finishShmTesting;
}
@@ -691,12 +692,13 @@ static XvImage *create_ximage (xxmc_driver_t *this, XShmSegmentInfo *shminfo,
shmctl(shminfo->shmid, IPC_RMID, 0);
if (gX11Fail) {
- xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_xxmc: x11 error during shared memory XImage creation\n"
- "video_out_xxmc: => not using MIT Shared Memory extension.\n"));
shmdt (shminfo->shmaddr);
shmctl (shminfo->shmid, IPC_RMID, 0);
shminfo->shmid = -1;
+ xprintf(this->xine, XINE_VERBOSITY_LOG,
+ _("%s: x11 error during shared memory XImage creation\n"), LOG_MODULE);
+ xprintf(this->xine, XINE_VERBOSITY_LOG,
+ _("%s: => not using MIT Shared Memory extension.\n"), LOG_MODULE);
this->use_shm = 0;
goto finishShmTesting;
}
@@ -761,13 +763,13 @@ static void xxmc_dispose_context(xxmc_driver_t *driver)
}
xprintf(driver->xine, XINE_VERBOSITY_LOG,
- "video_out_xxmc: Freeing up XvMC Surfaces and subpictures.\n");
+ LOG_MODULE ": Freeing up XvMC Surfaces and subpictures.\n");
if (driver->xvmc_palette) free(driver->xvmc_palette);
_x_dispose_xx44_palette( &driver->palette );
xxmc_xvmc_destroy_subpictures( driver );
xxmc_xvmc_destroy_surfaces( driver );
xprintf(driver->xine, XINE_VERBOSITY_LOG,
- "video_out_xxmc: Freeing up XvMC Context.\n");
+ LOG_MODULE ": Freeing up XvMC Context.\n");
XLockDisplay (driver->display);
if (driver->subImage)
dispose_ximage(driver, &driver->subShmInfo, driver->subImage);
@@ -807,10 +809,10 @@ static int xxmc_find_context(xxmc_driver_t *driver, xine_xxmc_t *xxmc,
curCap = driver->xvmc_cap;
for (i =0; i < driver->xvmc_num_cap; ++i) {
xprintf(driver->xine, XINE_VERBOSITY_LOG,
- "video_out_xxmc: Surface type %d. Capabilities 0x%8x 0x%8x\n",i,
+ LOG_MODULE ": Surface type %d. Capabilities 0x%8x 0x%8x\n",i,
curCap->mpeg_flags,curCap->accel_flags);
xprintf(driver->xine, XINE_VERBOSITY_LOG,
- "video_out_xxmc: Requests: 0x%8x 0x%8x\n",
+ LOG_MODULE ": Requests: 0x%8x 0x%8x\n",
request_mpeg_flags,request_accel_flags);
if (((curCap->mpeg_flags & request_mpeg_flags) == request_mpeg_flags) &&
((curCap->accel_flags & request_accel_flags)) &&
@@ -841,7 +843,7 @@ static int xxmc_create_context(xxmc_driver_t *driver, unsigned width, unsigned h
curCap = driver->xvmc_cap + driver->xvmc_cur_cap;
xprintf(driver->xine, XINE_VERBOSITY_LOG,
- "video_out_xxmc: Creating new XvMC Context %d\n",curCap->type_id);
+ LOG_MODULE ": Creating new XvMC Context %d\n",curCap->type_id);
XVMCLOCKDISPLAY( driver->display );
if (Success == XvMCCreateContext( driver->display, driver->xv_port,
curCap->type_id, width,
@@ -874,7 +876,7 @@ static void xxmc_setup_subpictures(xxmc_driver_t *driver, unsigned width, unsign
if ((driver->xvmc_backend_subpic = (curCap->flags & XVMC_BACKEND_SUBPICTURE)))
xprintf(driver->xine, XINE_VERBOSITY_LOG,
- "video_out_xxmc: Using Backend subpictures.\n");
+ LOG_MODULE ": Using Backend subpictures.\n");
if (!driver->subImage) {
/*
@@ -890,7 +892,7 @@ static void xxmc_setup_subpictures(xxmc_driver_t *driver, unsigned width, unsign
XUnlockDisplay (driver->display);
if (NULL == driver->subImage) {
xprintf(driver->xine, XINE_VERBOSITY_LOG,
- "video_out_xxmc: Failed allocating XvImage for supbictures.\n");
+ LOG_MODULE ": Failed allocating XvImage for supbictures.\n");
return;
}
}
@@ -985,8 +987,8 @@ static int xxmc_xvmc_update_context(xxmc_driver_t *driver, xxmc_frame_t *frame,
return 0;
xprintf(driver->xine, XINE_VERBOSITY_LOG,
- "video_out_xxmc: New format. Need to change XvMC Context.\n"
- "width: %d height: %d", width, height);
+ LOG_MODULE ": New format. Need to change XvMC Context.\n"
+ LOG_MODULE ": width: %d height: %d", width, height);
if (frame_format_xxmc) {
xprintf(driver->xine, XINE_VERBOSITY_LOG,
" mpeg: %d acceleration: %d", xxmc->mpeg, xxmc->acceleration);
@@ -1006,17 +1008,17 @@ static int xxmc_xvmc_update_context(xxmc_driver_t *driver, xxmc_frame_t *frame,
if ((driver->xvmc_accel &
(XINE_XVMC_ACCEL_MOCOMP | XINE_XVMC_ACCEL_IDCT))) {
if (!xxmc_mocomp_create_macroblocks(driver, frame, 1)) {
- lprintf("video_out_xxmc: ERROR: Macroblock allocation failed\n");
+ printf(LOG_MODULE ": ERROR: Macroblock allocation failed\n");
xxmc_dispose_context( driver );
}
}
}
if (!driver->contextActive) {
- printf("video_out_xxmc: Using software decoding for this stream.\n");
+ printf(LOG_MODULE ": Using software decoding for this stream.\n");
driver->xvmc_accel = 0;
} else {
- printf("video_out_xxmc: Using hardware decoding for this stream.\n");
+ printf(LOG_MODULE ": Using hardware decoding for this stream.\n");
}
driver->xvmc_mpeg = xxmc->mpeg;
@@ -1052,9 +1054,9 @@ static void xxmc_frame_updates(xxmc_driver_t *driver,
if (frame->xvmc_surf == NULL) {
if (NULL == (frame->xvmc_surf =
xxmc_xvmc_alloc_surface( driver, &driver->context))) {
- fprintf(stderr, "video_out_xxmc: ERROR: Accelerated surface allocation failed.\n"
- "video_out_xxmc: You are probably out of framebuffer memory.\n"
- "video_out_xxmc: Falling back to software decoding.\n");
+ fprintf(stderr, LOG_MODULE ": ERROR: Accelerated surface allocation failed.\n"
+ LOG_MODULE ": You are probably out of framebuffer memory.\n"
+ LOG_MODULE ": Falling back to software decoding.\n");
driver->xvmc_accel = 0;
xxmc_dispose_context( driver );
return;
@@ -1219,10 +1221,17 @@ static void xxmc_do_update_frame(vo_driver_t *this_gen,
double ratio, int format, int flags) {
xxmc_driver_t *this = (xxmc_driver_t *) this_gen;
- xxmc_frame_t *frame = (xxmc_frame_t *) frame_gen;
+ xxmc_frame_t *frame = XXMC_FRAME(frame_gen);
if ( XINE_IMGFMT_XXMC == format ) {
xine_xxmc_t *xxmc = &frame->xxmc_data;
+ vo_frame_t orig_frame_content;
+
+ if (frame_gen != &frame->vo_frame) {
+ /* this is an intercepted frame, so we need to detect and propagate any
+ * changes on the original vo_frame to all the intercepted frames */
+ xine_fast_memcpy(&orig_frame_content, &frame->vo_frame, sizeof (vo_frame_t));
+ }
xvmc_context_writer_lock( &this->xvmc_lock);
if (xxmc_accel_update(this, this->last_accel_request, xxmc->acceleration) ||
@@ -1238,7 +1247,7 @@ static void xxmc_do_update_frame(vo_driver_t *this_gen,
if (this->contextActive)
xxmc_frame_updates(this, frame, 1);
- xxmc_do_update_frame_xv(this_gen, frame_gen, width, height, ratio,
+ xxmc_do_update_frame_xv(this_gen, &frame->vo_frame, width, height, ratio,
xxmc->fallback_format, flags);
if (!this->contextActive) {
@@ -1252,6 +1261,33 @@ static void xxmc_do_update_frame(vo_driver_t *this_gen,
xvmc_context_writer_unlock( &this->xvmc_lock);
+ if (frame_gen != &frame->vo_frame) {
+ /* this is an intercepted frame, so we need to detect and propagate any
+ * changes on the original vo_frame to all the intercepted frames */
+ unsigned char *p0 = (unsigned char *)&orig_frame_content;
+ unsigned char *p1 = (unsigned char *)&frame->vo_frame;
+ int i;
+ for (i = 0; i < sizeof (vo_frame_t); i++) {
+ if (*p0 != *p1) {
+ /* propagate the change */
+ vo_frame_t *f = frame_gen;
+ while (f->next) {
+ /* serveral restrictions apply when intercepting XXMC frames. So let's check
+ * the intercepted frames before modifing them and fail otherwise. */
+ unsigned char *p = (unsigned char *)f + i;
+ if (*p != *p0) {
+ xprintf(this->xine, XINE_VERBOSITY_DEBUG, "xxmc_do_update_frame: a post plugin violates the restrictions on intercepting XXMC frames\n");
+ _x_abort();
+ }
+
+ *p = *p1;
+ f = f->next;
+ }
+ }
+ p0++;
+ p1++;
+ }
+ }
} else {
/* switch back to an unaccelerated context */
if (this->last_accel_request != 0xFFFFFFFF) {
@@ -1259,7 +1295,7 @@ static void xxmc_do_update_frame(vo_driver_t *this_gen,
xxmc_xvmc_update_context(this, frame, width, height, 0);
}
frame->vo_frame.proc_duplicate_frame_data = NULL;
- xxmc_do_update_frame_xv(this_gen, frame_gen, width, height, ratio,
+ xxmc_do_update_frame_xv(this_gen, &frame->vo_frame, width, height, ratio,
format, flags);
}
}
@@ -1765,7 +1801,7 @@ static int xxmc_get_property (vo_driver_t *this_gen, int property) {
break;
}
- lprintf("video_out_xxmc: property #%d = %d\n", property, this->props[property].value);
+ lprintf("%s: property #%d = %d\n", LOG_MODULE, property, this->props[property].value);
return this->props[property].value;
}
@@ -1828,7 +1864,7 @@ static int xxmc_set_property (vo_driver_t *this_gen,
case VO_PROP_INTERLACED:
this->props[property].value = value;
xprintf(this->xine, XINE_VERBOSITY_LOG,
- "video_out_xxmc: VO_PROP_INTERLACED(%d)\n", this->props[property].value);
+ LOG_MODULE ": VO_PROP_INTERLACED(%d)\n", this->props[property].value);
this->deinterlace_enabled = value;
break;
@@ -1838,7 +1874,7 @@ static int xxmc_set_property (vo_driver_t *this_gen,
this->props[property].value = value;
xprintf(this->xine, XINE_VERBOSITY_LOG,
- "video_out_xxmc: VO_PROP_ASPECT_RATIO(%d)\n", this->props[property].value);
+ LOG_MODULE ": VO_PROP_ASPECT_RATIO(%d)\n", this->props[property].value);
this->sc.user_ratio = value;
xxmc_compute_ideal_size (this);
@@ -1850,7 +1886,7 @@ static int xxmc_set_property (vo_driver_t *this_gen,
if ((value >= XINE_VO_ZOOM_MIN) && (value <= XINE_VO_ZOOM_MAX)) {
this->props[property].value = value;
xprintf(this->xine, XINE_VERBOSITY_LOG,
- "video_out_xxmc: VO_PROP_ZOOM_X = %d\n", this->props[property].value);
+ LOG_MODULE ": VO_PROP_ZOOM_X = %d\n", this->props[property].value);
this->sc.zoom_factor_x = (double)value / (double)XINE_VO_ZOOM_STEP;
@@ -1864,7 +1900,7 @@ static int xxmc_set_property (vo_driver_t *this_gen,
if ((value >= XINE_VO_ZOOM_MIN) && (value <= XINE_VO_ZOOM_MAX)) {
this->props[property].value = value;
xprintf(this->xine, XINE_VERBOSITY_LOG,
- "video_out_xxmc: VO_PROP_ZOOM_Y = %d\n", this->props[property].value);
+ LOG_MODULE ": VO_PROP_ZOOM_Y = %d\n", this->props[property].value);
this->sc.zoom_factor_y = (double)value / (double)XINE_VO_ZOOM_STEP;
@@ -2011,7 +2047,7 @@ static void xxmc_dispose (vo_driver_t *this_gen) {
XLockDisplay (this->display);
if(XvUngrabPort (this->display, this->xv_port, CurrentTime) != Success) {
- xprintf (this->xine, XINE_VERBOSITY_DEBUG, "video_out_xxmc: xxmc_exit: XvUngrabPort() failed.\n");
+ xprintf (this->xine, XINE_VERBOSITY_DEBUG, LOG_MODULE ": xxmc_exit: XvUngrabPort() failed.\n");
}
XFreeGC(this->display, this->gc);
XUnlockDisplay (this->display);
@@ -2075,7 +2111,7 @@ static void xxmc_check_capability (xxmc_driver_t *this,
this->props[property].atom, &int_default);
xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xxmc: port attribute %s (%d) value is %d\n", str_prop, property, int_default);
+ LOG_MODULE ": port attribute %s (%d) value is %d\n", str_prop, property, int_default);
/*
* We enable autopaint by default.
@@ -2137,7 +2173,7 @@ static void xxmc_update_XV_FILTER(void *this_gen, xine_cfg_entry_t *entry) {
XUnlockDisplay(this->display);
xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xxmc: bilinear scaling mode (XV_FILTER) = %d\n",xv_filter);
+ LOG_MODULE ": bilinear scaling mode (XV_FILTER) = %d\n",xv_filter);
}
static void xxmc_update_XV_DOUBLE_BUFFER(void *this_gen, xine_cfg_entry_t *entry) {
@@ -2153,7 +2189,7 @@ static void xxmc_update_XV_DOUBLE_BUFFER(void *this_gen, xine_cfg_entry_t *entry
XUnlockDisplay(this->display);
xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xxmc: double buffering mode = %d\n", xv_double_buffer);
+ LOG_MODULE ": double buffering mode = %d\n", xv_double_buffer);
}
static void xxmc_update_xv_pitch_alignment(void *this_gen, xine_cfg_entry_t *entry) {
@@ -2225,7 +2261,7 @@ static void checkXvMCCap( xxmc_driver_t *this, XvPortID xv_port)
return;
}
xprintf (this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xxmc: XvMC extension present.\n");
+ LOG_MODULE ": XvMC extension present.\n");
surfaceInfo = XvMCListSurfaceTypes(this->display, xv_port, &numSurf);
if (0 == surfaceInfo) {
@@ -2241,7 +2277,7 @@ static void checkXvMCCap( xxmc_driver_t *this, XvPortID xv_port)
curCap = this->xvmc_cap;
xprintf (this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xxmc: Found %d XvMC surface types\n",numSurf);
+ LOG_MODULE ": Found %d XvMC surface types\n", numSurf);
for (i=0; i< numSurf; ++i) {
curCap->mpeg_flags = 0;
@@ -2265,10 +2301,10 @@ static void checkXvMCCap( xxmc_driver_t *this, XvPortID xv_port)
curCap->sub_max_height = curInfo->subpicture_max_height;
curCap->flags = curInfo->flags;
xprintf (this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xxmc: Surface type %d: Max size: %d %d.\n",
+ LOG_MODULE ": Surface type %d: Max size: %d %d.\n",
i,curCap->max_width,curCap->max_height);
xprintf (this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xxmc: Surface type %d: Max subpic size: %d %d.\n",
+ LOG_MODULE ": Surface type %d: Max subpic size: %d %d.\n",
i,curCap->sub_max_width,curCap->sub_max_height);
curCap->type_id = curInfo->surface_type_id;
@@ -2277,21 +2313,18 @@ static void checkXvMCCap( xxmc_driver_t *this, XvPortID xv_port)
curCap->subPicType.id = 0;
if (formatValues) {
xprintf (this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xxmc: Surface type %d: Found %d XvMC subpicture "
- "types\n",i,numSub);
+ LOG_MODULE ": Surface type %d: Found %d XvMC subpicture types\n",i,numSub);
for (j = 0; j<numSub; ++j) {
if (formatValues[j].id == FOURCC_IA44) {
curCap->subPicType = formatValues[j];
xprintf (this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xxmc: Surface type %d: Detected and using "
- "IA44 subpicture type.\n",i);
+ LOG_MODULE ": Surface type %d: Detected and using IA44 subpicture type.\n",i);
/* Prefer IA44 */
break;
} else if (formatValues[j].id == FOURCC_AI44) {
curCap->subPicType = formatValues[j];
xprintf (this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xxmc: Surface type %d: Detected AI44 "
- "subpicture type.\n",i);
+ LOG_MODULE ": Surface type %d: Detected AI44 subpicture type.\n",i);
}
}
}
@@ -2322,9 +2355,8 @@ static void checkXvMCCap( xxmc_driver_t *this, XvPortID xv_port)
free(this->xvmc_cap);
this->xvmc_cap = 0;
xprintf (this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xxmc: Apparent attempt to use a direct XvMC "
- "context\nvideo_out_xxmc: on a remote display. "
- "Falling back to XV.\n");
+ LOG_MODULE ": Apparent attempt to use a direct XvMC context on a remote display.\n"
+ LOG_MODULE ": Falling back to Xv.\n");
XVMCUNLOCKDISPLAY( this->display );
xvmc_context_writer_unlock( &this->xvmc_lock );
return;
@@ -2380,7 +2412,7 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
XLockDisplay(this->display);
if (Success != XvQueryExtension(this->display, &ver,&rel, &req, &ev,&err)) {
- xprintf (class->xine, XINE_VERBOSITY_LOG, _("video_out_xxmc: Xv extension not present.\n"));
+ xprintf (class->xine, XINE_VERBOSITY_LOG, _("%s: Xv extension not present.\n"), LOG_MODULE);
XUnlockDisplay(this->display);
return NULL;
}
@@ -2390,7 +2422,7 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
*/
if (Success != XvQueryAdaptors(this->display,DefaultRootWindow(this->display), &adaptors, &adaptor_info)) {
- xprintf(class->xine, XINE_VERBOSITY_DEBUG, "video_out_xxmc: XvQueryAdaptors failed.\n");
+ xprintf(class->xine, XINE_VERBOSITY_DEBUG, LOG_MODULE ": XvQueryAdaptors failed.\n");
XUnlockDisplay(this->display);
return NULL;
}
@@ -2417,8 +2449,9 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
if (!xv_port) {
xprintf(class->xine, XINE_VERBOSITY_LOG,
- _("video_out_xxmc: Xv extension is present but I couldn't find a usable yuv12 port.\n"
- " Looks like your graphics hardware driver doesn't support Xv?!\n"));
+ _("%s: Xv extension is present but I couldn't find a usable yuv12 port.\n"
+ "\tLooks like your graphics hardware driver doesn't support Xv?!\n"),
+ LOG_MODULE);
/* XvFreeAdaptorInfo (adaptor_info); this crashed on me (gb)*/
XUnlockDisplay(this->display);
@@ -2426,8 +2459,8 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
}
else
xprintf(class->xine, XINE_VERBOSITY_LOG,
- _("video_out_xxmc: using Xv port %ld from adaptor %s for hardware "
- "colorspace conversion and scaling.\n"), xv_port,
+ _("%s: using Xv port %ld from adaptor %s for hardware "
+ "colorspace conversion and scaling.\n"), LOG_MODULE, xv_port,
adaptor_info[adaptor_num].name);
XUnlockDisplay(this->display);
@@ -2503,7 +2536,7 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
if((attr[k].flags & XvSettable) && (attr[k].flags & XvGettable)) {
if(!strcmp(attr[k].name, "XV_HUE")) {
if (!strncmp(adaptor_info[adaptor_num].name, "NV", 2)) {
- xprintf (this->xine, XINE_VERBOSITY_NONE, "video_out_xxmc: ignoring broken XV_HUE settings on NVidia cards\n");
+ xprintf (this->xine, XINE_VERBOSITY_NONE, LOG_MODULE ": ignoring broken XV_HUE settings on NVidia cards\n");
} else {
xxmc_check_capability (this, VO_PROP_HUE, attr[k],
adaptor_info[adaptor_num].base_id, "XV_HUE",
@@ -2573,7 +2606,7 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
XFree(attr);
}
else
- xprintf(this->xine, XINE_VERBOSITY_DEBUG, "video_out_xxmc: no port attributes defined.\n");
+ xprintf(this->xine, XINE_VERBOSITY_DEBUG, LOG_MODULE ": no port attributes defined.\n");
XvFreeAdaptorInfo(adaptor_info);
/*
@@ -2602,12 +2635,12 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
this->xv_format_yv12 = fo[i].id;
this->capabilities |= VO_CAP_YV12;
xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_xxmc: this adaptor supports the yv12 format.\n"));
+ _("%s: this adaptor supports the yv12 format.\n"), LOG_MODULE);
} else if (fo[i].id == XINE_IMGFMT_YUY2) {
this->xv_format_yuy2 = fo[i].id;
this->capabilities |= VO_CAP_YUY2;
xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_xxmc: this adaptor supports the yuy2 format.\n"));
+ _("%s: this adaptor supports the yuy2 format.\n"), LOG_MODULE);
}
}
@@ -2679,10 +2712,10 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
this->cur_field = XVMC_FRAME_PICTURE;
#ifdef HAVE_VLDXVMC
- printf("video_out_xxmc: Unichrome CPU saving is %s.\n",
+ printf("%s: Unichrome CPU saving is %s.\n", LOG_MODULE,
(this->cpu_save_enabled) ? "on":"off");
#else
- printf("video_out_xxmc: warning - compiled with no vld extensions.\n");
+ printf("%s: warning - compiled with no vld extensions.\n", LOG_MODULE);
#endif
this->props[VO_PROP_MAX_NUM_FRAMES].value = (use_more_frames) ? 15:8;
this->cpu_saver = 0.;
diff --git a/src/video_out/vidix/Makefile.am b/src/video_out/vidix/Makefile.am
deleted file mode 100644
index 2ca8f168a..000000000
--- a/src/video_out/vidix/Makefile.am
+++ /dev/null
@@ -1,21 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-EXTRA_DIST = README vidix.txt
-
-SUBDIRS = drivers
-
-AM_CFLAGS = @STATIC@
-
-if HAVE_VIDIX
-vidix_lib = libvidix.la
-endif
-
-noinst_LTLIBRARIES = $(vidix_lib)
-
-libvidix_la_SOURCES = vidixlib.c
-libvidix_la_LIBADD = $(DYNAMIC_LD_LIBS) $(top_builddir)/src/video_out/libdha/libdha.la
-
-noinst_HEADERS = fourcc.h vidix.h vidixlib.h
-
-AM_CPPFLAGS = -I$(top_srcdir)/src/video_out/vidix \
- -I$(top_builddir)/src/video_out/libdha
diff --git a/src/video_out/vidix/README b/src/video_out/vidix/README
deleted file mode 100644
index 23bcaca30..000000000
--- a/src/video_out/vidix/README
+++ /dev/null
@@ -1,7 +0,0 @@
-VIDIX - Video Interface for *niX.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-This library was designed and introduced as interface to userspace drivers
-to provide DGA everywhere where it's possible (unline X11).
-I hope that these drivers will be portable same as X11 (not only on *nix).
-
-For detail on how to develop new driver see vidix.txt
diff --git a/src/video_out/vidix/drivers/Makefile.am b/src/video_out/vidix/drivers/Makefile.am
deleted file mode 100644
index f438dde36..000000000
--- a/src/video_out/vidix/drivers/Makefile.am
+++ /dev/null
@@ -1,66 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-EXTRA_DIST = genfb_vid.c
-
-if HAVE_VIDIX
-vidix_drivers = \
- mach64_vid.la \
- mga_crtc2_vid.la \
- mga_vid.la \
- pm2_vid.la \
- pm3_vid.la \
- radeon_vid.la \
- rage128_vid.la \
- cyberblade_vid.la \
- unichrome_vid.la \
- nvidia_vid.la \
- sis_vid.la \
- savage_vid.la
-endif
-
-vidix_LTLIBRARIES = $(vidix_drivers)
-
-radeon_vid_la_SOURCES = radeon_vid.c
-radeon_vid_la_LDFLAGS = -avoid-version -module -lm
-
-rage128_vid_la_SOURCES = radeon_vid.c
-rage128_vid_la_LDFLAGS = -avoid-version -module -lm
-rage128_vid_la_CFLAGS = -DRAGE128 $(AM_CFLAGS)
-
-pm2_vid_la_SOURCES = pm2_vid.c
-pm2_vid_la_LDFLAGS = -avoid-version -module
-
-pm3_vid_la_SOURCES = pm3_vid.c
-pm3_vid_la_LDFLAGS = -avoid-version -module
-
-mach64_vid_la_SOURCES = mach64_vid.c
-mach64_vid_la_LDFLAGS = -avoid-version -module
-
-mga_vid_la_SOURCES = mga_vid.c
-mga_vid_la_LDFLAGS = -avoid-version -module -lm
-
-mga_crtc2_vid_la_SOURCES = mga_vid.c
-mga_crtc2_vid_la_LDFLAGS = -avoid-version -module -lm
-mga_crtc2_vid_la_CFLAGS = -DCRTC2 $(AM_CFLAGS)
-
-cyberblade_vid_la_SOURCES = cyberblade_vid.c
-cyberblade_vid_la_LDFLAGS = -avoid-version -module
-
-unichrome_vid_la_SOURCES = unichrome_vid.c
-unichrome_vid_la_LDFLAGS = -avoid-version -module
-
-nvidia_vid_la_SOURCES = nvidia_vid.c
-nvidia_vid_la_LDFLAGS = -avoid-version -module
-
-sis_vid_la_SOURCES = sis_vid.c sis_bridge.c
-sis_vid_la_LDFLAGS = -avoid-version -module
-
-savage_vid_la_SOURCES = savage_vid.c
-savage_vid_la_LDFLAGS = -avoid-version -module -lm
-
-noinst_HEADERS = mach64.h glint_regs.h pm3_regs.h radeon.h savage_regs.h \
- cyberblade_regs.h unichrome_regs.h sis_defs.h sis_regs.h
-
-AM_CPPFLAGS = -I$(top_srcdir)/src/video_out/vidix \
- -I$(top_srcdir)/src/video_out/libdha \
- -I$(top_builddir)/src/video_out/libdha
diff --git a/src/video_out/vidix/drivers/cyberblade_regs.h b/src/video_out/vidix/drivers/cyberblade_regs.h
deleted file mode 100644
index 1bae61d4a..000000000
--- a/src/video_out/vidix/drivers/cyberblade_regs.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright 1992-2000 by Alan Hourihane, Wigan, England.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Alan Hourihane not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Alan Hourihane makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Alan Hourihane, alanh@fairlite.demon.co.uk
- */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_regs.h,v 1.22 2002/01/11 13:06:30 alanh Exp $ */
-
-#define DEBUG 1
-
-#define NTSC 14.31818
-#define PAL 17.73448
-
-/* General Registers */
-#define SPR 0x1F /* Software Programming Register (videoram) */
-
-/* 3C4 */
-#define RevisionID 0x09
-#define ConfPort1 0x0C
-#define ConfPort2 0x0C
-#define NewMode2 0x0D
-#define OldMode2 0x00 /* Should be 0x0D - dealt with in trident_dac.c */
-#define OldMode1 0x0E
-#define NewMode1 0x0E
-#define Protection 0x11
-#define MCLKLow 0x16
-#define MCLKHigh 0x17
-#define ClockLow 0x18
-#define ClockHigh 0x19
-#define SSetup 0x20
-#define SKey 0x37
-#define SPKey 0x57
-
-/* 3x4 */
-#define Offset 0x13
-#define Underline 0x14
-#define CRTCMode 0x17
-#define CRTCModuleTest 0x1E
-#define FIFOControl 0x20
-#define LinearAddReg 0x21
-#define DRAMTiming 0x23
-#define New32 0x23
-#define RAMDACTiming 0x25
-#define CRTHiOrd 0x27
-#define AddColReg 0x29
-#define InterfaceSel 0x2A
-#define HorizOverflow 0x2B
-#define GETest 0x2D
-#define Performance 0x2F
-#define GraphEngReg 0x36
-#define I2C 0x37
-#define PixelBusReg 0x38
-#define PCIReg 0x39
-#define DRAMControl 0x3A
-#define MiscContReg 0x3C
-#define CursorXLow 0x40
-#define CursorXHigh 0x41
-#define CursorYLow 0x42
-#define CursorYHigh 0x43
-#define CursorLocLow 0x44
-#define CursorLocHigh 0x45
-#define CursorXOffset 0x46
-#define CursorYOffset 0x47
-#define CursorFG1 0x48
-#define CursorFG2 0x49
-#define CursorFG3 0x4A
-#define CursorFG4 0x4B
-#define CursorBG1 0x4C
-#define CursorBG2 0x4D
-#define CursorBG3 0x4E
-#define CursorBG4 0x4F
-#define CursorControl 0x50
-#define PCIRetry 0x55
-#define PreEndControl 0x56
-#define PreEndFetch 0x57
-#define PCIMaster 0x60
-#define Enhancement0 0x62
-#define NewEDO 0x64
-
-/* --- Additions by AMR for Vidix support --- */
-#define VideoWin1_HScale 0x80
-#define VideoWin1_VScale 0x82
-#define VideoWin1_Start 0x86
-#define VideoWin1_Stop 0x8a
-#define Video_Flags 0x8e
-#define VideoWin1_Y_BPR 0x90
-#define VideoWin1_Y_Offset 0x92
-#define Video_LineBufferThreshold 0x95
-#define Video_LineBufferLevel 0x96
-#define Video_Flags2 0x97
-/* --- */
-
-#define TVinterface 0xC0
-#define TVMode 0xC1
-#define ClockControl 0xCF
-
-
-/* 3CE */
-#define MiscExtFunc 0x0F
-#define MiscIntContReg 0x2F
-#define CyberControl 0x30
-#define CyberEnhance 0x31
-#define FPConfig 0x33
-#define VertStretch 0x52
-#define HorStretch 0x53
-#define BiosMode 0x5c
-#define BiosNewMode1 0x5a
-#define BiosNewMode2 0x5c
-#define BiosReg 0x5d
-
-/* --- IO Macros by AMR --- */
-
-#define CRINB(reg) (OUTPORT8(0x3d4,reg), INPORT8(0x3d5))
-#define SRINB(reg) (OUTPORT8(0x3c4,reg), INPORT8(0x3c5))
-#define CROUTB(reg,val) (OUTPORT8(0x3d4,reg), OUTPORT8(0x3d5,val))
-#define SROUTB(reg,val) (OUTPORT8(0x3c4,reg), OUTPORT8(0x3c5,val))
-
-/* --- */
-
-
diff --git a/src/video_out/vidix/drivers/cyberblade_vid.c b/src/video_out/vidix/drivers/cyberblade_vid.c
deleted file mode 100644
index 7a32ce7bd..000000000
--- a/src/video_out/vidix/drivers/cyberblade_vid.c
+++ /dev/null
@@ -1,649 +0,0 @@
-/*
- Driver for CyberBlade/i1 - Version 0.1.4
-
- Copyright (C) 2002 by Alastair M. Robinson.
- Official homepage: http://www.blackfiveservices.co.uk/EPIAVidix.shtml
-
- Based on Permedia 3 driver by Måns Rullgård
-
- Thanks to Gilles Frattini for bugfixes
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Changes:
- 18/01/03
- MMIO is no longer used, sidestepping cache issues on EPIA-800
- TV-Out modes are now better supported - this should be the end
- of the magenta stripes :)
- Brightness/Contrast controls disabled for the time being - they were
- seriously degrading picture quality, especially with TV-Out.
-
- To Do:
- Implement Hue/Saturation controls
- Support / Test multiple frames
- Test colour-key code more extensively
-*/
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <inttypes.h>
-#include <unistd.h>
-
-#include "vidix.h"
-#include "fourcc.h"
-#include "libdha.h"
-#include "pci_ids.h"
-#include "pci_names.h"
-
-
-#include "cyberblade_regs.h"
-
-pciinfo_t pci_info;
-
-char save_colourkey[6];
-char *cyberblade_mem;
-
-#ifdef DEBUG_LOGFILE
-FILE *logfile=0;
-#define LOGWRITE(x) {if(logfile) fprintf(logfile,x);}
-#else
-#define LOGWRITE(x)
-#endif
-
-/* Helper functions for reading registers. */
-
-#if 0 /* unused */
-static int CRINW(int reg)
-{
- int result;
- result=CRINB(reg);
- result|=CRINB(reg+1)<<8;
- return(result);
-}
-#endif
-
-static void CROUTW(int reg,int val)
-{
- CROUTB(reg,val&255);
- CROUTB(reg+1,(val>>8)&255);
-}
-
-#if 0 /* unused */
-static int SRINW(int reg)
-{
- int result;
- result=SRINB(reg);
- result|=SRINB(reg+1)<<8;
- return(result);
-}
-#endif
-
-static void SROUTW(int reg,int val)
-{
- SROUTB(reg,val&255);
- SROUTB(reg+1,(val>>8)&255);
-}
-
-#if 0 /* unused */
-static void DumpRegisters(void)
-{
-#ifdef DEBUG_LOGFILE
- int reg,val;
- if(logfile)
- {
- LOGWRITE("CRTC Register Dump:\n")
- for(reg=0;reg<256;++reg)
- {
- val=CRINB(reg);
- fprintf(logfile,"CR0x%2x: 0x%2x\n",reg,val);
- }
- LOGWRITE("SR Register Dump:\n")
- for(reg=0;reg<256;++reg)
- {
- val=SRINB(reg);
- fprintf(logfile,"SR0x%2x: 0x%2x\n",reg,val);
- }
- }
-#endif
-}
-#endif
-
-/* --- */
-
-static vidix_capability_t cyberblade_cap =
-{
- "Trident CyberBlade i1 driver",
- "Alastair M. Robinson <blackfive@fakenhamweb.co.uk>",
- TYPE_OUTPUT,
- { 0, 0, 0, 0 },
- 1024,
- 1024,
- 4,
- 4,
- -1,
- FLAG_UPSCALER|FLAG_DOWNSCALER,
- VENDOR_TRIDENT,
- -1,
- { 0, 0, 0, 0 }
-};
-
-
-unsigned int vixGetVersion(void)
-{
- return(VIDIX_VERSION);
-}
-
-
-static unsigned short cyberblade_card_ids[] =
-{
- DEVICE_TRIDENT_CYBERBLADE_I7,
- DEVICE_TRIDENT_CYBERBLADE_I7D,
- DEVICE_TRIDENT_CYBERBLADE_I1,
- DEVICE_TRIDENT_CYBERBLADE_I12,
- DEVICE_TRIDENT_CYBERBLADE_I13,
- DEVICE_TRIDENT_CYBERBLADE_XPAI1
-};
-
-
-static int find_chip(unsigned chip_id)
-{
- unsigned i;
- for(i = 0;i < sizeof(cyberblade_card_ids)/sizeof(unsigned short);i++)
- {
- if(chip_id == cyberblade_card_ids[i]) return i;
- }
- return -1;
-}
-
-int vixProbe(int verbose, int force)
-{
- pciinfo_t lst[MAX_PCI_DEVICES];
- unsigned i,num_pci;
- int err;
- err = pci_scan(lst,&num_pci);
- if(err)
- {
- printf("[cyberblade] Error occurred during pci scan: %s\n",strerror(err));
- return err;
- }
- else
- {
- err = ENXIO;
- for(i=0; i < num_pci; i++)
- {
- if(lst[i].vendor == VENDOR_TRIDENT)
- {
- int idx;
- const char *dname;
- idx = find_chip(lst[i].device);
- if(idx == -1)
- continue;
- dname = pci_device_name(VENDOR_TRIDENT, lst[i].device);
- dname = dname ? dname : "Unknown chip";
- printf("[cyberblade] Found chip: %s\n", dname);
- cyberblade_cap.device_id = lst[i].device;
- err = 0;
- memcpy(&pci_info, &lst[i], sizeof(pciinfo_t));
- break;
- }
- }
- }
-
- if(err && verbose) printf("[cyberblade] Can't find chip\n");
- return err;
-}
-
-
-int vixInit(const char *args)
-{
- cyberblade_mem = map_phys_mem(pci_info.base0, 0x800000);
- enable_app_io();
- save_colourkey[0]=SRINB(0x50);
- save_colourkey[1]=SRINB(0x51);
- save_colourkey[2]=SRINB(0x52);
- save_colourkey[3]=SRINB(0x54);
- save_colourkey[4]=SRINB(0x55);
- save_colourkey[5]=SRINB(0x56);
-#ifdef DEBUG_LOGFILE
- logfile=fopen("/tmp/cyberblade_vidix.log","w");
-#endif
- return 0;
-}
-
-void vixDestroy(void)
-{
- int protect;
-#ifdef DEBUG_LOGFILE
- if(logfile)
- fclose(logfile);
-#endif
- protect=SRINB(0x11);
- SROUTB(0x11, 0x92);
- CROUTB(0x8E, 0xc4); /* Disable overlay */
- SROUTB(0x50,save_colourkey[0]);
- SROUTB(0x51,save_colourkey[1]);
- SROUTB(0x52,save_colourkey[2]);
- SROUTB(0x54,save_colourkey[3]);
- SROUTB(0x55,save_colourkey[4]);
- SROUTB(0x56,save_colourkey[5]);
- SROUTB(0x11, protect);
- disable_app_io();
- unmap_phys_mem(cyberblade_mem, 0x800000);
-}
-
-
-int vixGetCapability(vidix_capability_t *to)
-{
- memcpy(to, &cyberblade_cap, sizeof(vidix_capability_t));
- return 0;
-}
-
-
-static int is_supported_fourcc(uint32_t fourcc)
-{
- switch(fourcc)
- {
- case IMGFMT_YUY2:
- case IMGFMT_YV12:
- case IMGFMT_I420:
- case IMGFMT_YVU9:
- case IMGFMT_BGR16:
- return 1;
- default:
- return 0;
- }
-}
-
-int vixQueryFourcc(vidix_fourcc_t *to)
-{
- if(is_supported_fourcc(to->fourcc))
- {
- to->depth = VID_DEPTH_1BPP | VID_DEPTH_2BPP |
- VID_DEPTH_4BPP | VID_DEPTH_8BPP |
- VID_DEPTH_12BPP| VID_DEPTH_15BPP|
- VID_DEPTH_16BPP| VID_DEPTH_24BPP|
- VID_DEPTH_32BPP;
- to->flags = VID_CAP_EXPAND | VID_CAP_SHRINK | VID_CAP_COLORKEY;
- return 0;
- }
- else
- to->depth = to->flags = 0;
- return ENOSYS;
-}
-
-
-static int frames[VID_PLAY_MAXFRAMES];
-
-static vidix_grkey_t cyberblade_grkey;
-
-int vixGetGrKeys(vidix_grkey_t *grkey)
-{
- memcpy(grkey, &cyberblade_grkey, sizeof(vidix_grkey_t));
- return(0);
-}
-
-int vixSetGrKeys(const vidix_grkey_t *grkey)
-{
- int pixfmt=CRINB(0x38);
- int protect;
- memcpy(&cyberblade_grkey, grkey, sizeof(vidix_grkey_t));
-
- protect=SRINB(0x11);
- SROUTB(0x11, 0x92);
-
- if(pixfmt&0x28) /* 32 or 24 bpp */
- {
- SROUTB(0x50, cyberblade_grkey.ckey.blue); /* Colour Key */
- SROUTB(0x51, cyberblade_grkey.ckey.green); /* Colour Key */
- SROUTB(0x52, cyberblade_grkey.ckey.red); /* Colour Key */
- SROUTB(0x54, 0xff); /* Colour Key Mask */
- SROUTB(0x55, 0xff); /* Colour Key Mask */
- SROUTB(0x56, 0xff); /* Colour Key Mask */
- }
- else
- {
- int tmp=((cyberblade_grkey.ckey.blue & 0xF8)>>3)
- | ((cyberblade_grkey.ckey.green & 0xfc)<<3)
- | ((cyberblade_grkey.ckey.red & 0xf8)<<8);
- SROUTB(0x50, tmp&0xff); /* Colour Key */
- SROUTB(0x51, (tmp>>8)&0xff); /* Colour Key */
- SROUTB(0x52, 0); /* Colour Key */
- SROUTB(0x54, 0xff); /* Colour Key Mask */
- SROUTB(0x55, 0xff); /* Colour Key Mask */
- SROUTB(0x56, 0x00); /* Colour Key Mask */
- }
- SROUTB(0x11,protect);
- return(0);
-}
-
-
-vidix_video_eq_t equal =
-{
- VEQ_CAP_BRIGHTNESS | VEQ_CAP_SATURATION | VEQ_CAP_HUE,
- 300, 100, 0, 0, 0, 0, 0, 0
-};
-
-int vixPlaybackGetEq( vidix_video_eq_t * eq)
-{
- memcpy(eq,&equal,sizeof(vidix_video_eq_t));
- return 0;
-}
-
-int vixPlaybackSetEq( const vidix_video_eq_t * eq)
-{
- int br,sat,cr,protect;
- if(eq->cap & VEQ_CAP_BRIGHTNESS) equal.brightness = eq->brightness;
- if(eq->cap & VEQ_CAP_CONTRAST) equal.contrast = eq->contrast;
- if(eq->cap & VEQ_CAP_SATURATION) equal.saturation = eq->saturation;
- if(eq->cap & VEQ_CAP_HUE) equal.hue = eq->hue;
- if(eq->cap & VEQ_CAP_RGB_INTENSITY)
- {
- equal.red_intensity = eq->red_intensity;
- equal.green_intensity = eq->green_intensity;
- equal.blue_intensity = eq->blue_intensity;
- }
- equal.flags = eq->flags;
-
- cr = (equal.contrast) * 31 / 2000; cr+=16;
- if (cr < 0) cr = 0; if(cr > 7) cr = 7;
- cr=cr<<4 | cr;
-
- br = (equal.brightness+1000) * 63 / 2000;
- if (br < 0) br = 0; if(br > 63) br = 63;
- if(br>32) br-=32; else br+=32;
-
- sat = (equal.saturation + 1000) * 16 / 2000;
- if (sat < 0) sat = 0; if(sat > 31) sat = 31;
-
- protect=SRINB(0x11);
- SROUTB(0x11, 0x92);
-
- SROUTB(0xBC,cr);
- SROUTW(0xB0,(br<<10)|4);
-
- SROUTB(0x11, protect);
-
- return 0;
-}
-
-
-static int YOffs,UOffs,VOffs;
-
-int vixConfigPlayback(vidix_playback_t *info)
-{
- int src_w, drw_w;
- int src_h, drw_h;
- int hscale,vscale;
- long base0;
- int y_pitch = 0, uv_pitch = 0;
- int protect=0;
- int layout=0;
- unsigned int i;
-
- if(!is_supported_fourcc(info->fourcc))
- return -1;
-
- src_w = info->src.w;
- src_h = info->src.h;
-
- drw_w = info->dest.w;
- drw_h = info->dest.h;
-
- switch(info->fourcc)
- {
- case IMGFMT_YUY2:
- case IMGFMT_BGR16:
- y_pitch = (src_w*2 + 15) & ~15;
- uv_pitch = 0;
- YOffs=VOffs=UOffs=info->offset.y = info->offset.v = info->offset.u = 0;
- info->frame_size = y_pitch*src_h;
- layout=0x0; /* packed */
- break;
- case IMGFMT_YV12:
- case IMGFMT_I420:
- y_pitch = (src_w+15) & ~15;
- uv_pitch = ((src_w/2)+7) & ~7;
- YOffs=info->offset.y = 0;
- VOffs=info->offset.v = y_pitch*src_h;
- UOffs=info->offset.u = info->offset.v+(uv_pitch)*(src_h/2);
- info->frame_size = y_pitch*src_h + 2*uv_pitch*(src_h/2);
- layout=0x1; /* planar, 4:1:1 */
- break;
- case IMGFMT_YVU9:
- y_pitch = (src_w+15) & ~15;
- uv_pitch = ((src_w/4)+3) & ~3;
- YOffs=info->offset.y = 0;
- VOffs=info->offset.v = y_pitch*src_h;
- UOffs=info->offset.u = info->offset.v+(uv_pitch)*(src_h/4);
- info->frame_size = y_pitch*src_h + 2*uv_pitch*(src_h/4);
- layout=0x51; /* planar, 16:1:1 */
- break;
- }
-
- /* Assume we have 2 MB to play with */
- info->num_frames = 0x200000 / info->frame_size;
- if(info->num_frames > VID_PLAY_MAXFRAMES)
- info->num_frames = VID_PLAY_MAXFRAMES;
-
- /* Start at 6 MB. Let's hope it's not in use. */
- base0 = 0x600000;
- info->dga_addr = cyberblade_mem + base0;
-
- info->dest.pitch.y = 16;
- info->dest.pitch.u = 16;
- info->dest.pitch.v = 16;
-
- for(i = 0; i < info->num_frames; i++)
- {
- info->offsets[i] = info->frame_size * i;
- frames[i] = base0+info->offsets[i];
- }
-
- OUTPORT8(0x3d4,0x39);
- OUTPORT8(0x3d5,INPORT(0x3d5)|1);
-
- SRINB(0x0b); /* Select new mode */
-
- /* Unprotect hardware registers... */
- protect=SRINB(0x11);
- SROUTB(0x11, 0x92);
-
- SROUTB(0x57, 0xc0); /* Playback key function */
- SROUTB(0x21, 0x34); /* Signature control */
- SROUTB(0x37, 0x30); /* Video key mode */
-
- vixSetGrKeys(&cyberblade_grkey);
-
- /* compute_scale_factor(&src_w, &drw_w, &shrink, &zoom); */
- {
- int HTotal,VTotal,HSync,VSync,Overflow,HDisp,VDisp;
- int HWinStart,VWinStart;
- int tx1,ty1,tx2,ty2;
-
- HTotal=CRINB(0x00);
- HSync=CRINB(0x04);
- VTotal=CRINB(0x06);
- VSync=CRINB(0x10);
- Overflow=CRINB(0x07);
- HTotal <<=3;
- HSync <<=3;
- VTotal |= (Overflow & 1) <<8;
- VTotal |= (Overflow & 0x20) <<4;
- VTotal +=4;
- VSync |= (Overflow & 4) <<6;
- VSync |= (Overflow & 0x80) <<2;
-
- if(CRINB(0xd1)&0x80)
- {
- int TVHTotal,TVVTotal,TVHSyncStart,TVVSyncStart,TVOverflow;
- LOGWRITE("[cyberblade] Using TV-CRTC\n");
-
- HDisp=(1+CRINB(0x01))*8;
- VDisp=1+CRINB(0x12);
- Overflow=CRINB(0x07);
- VDisp |= (Overflow & 2) <<7;
- VDisp |= (Overflow & 0x40) << 3;
-
- TVHTotal=CRINB(0xe0)*8;
- TVVTotal=CRINB(0xe6);
- TVOverflow=CRINB(0xe7);
- if(TVOverflow&0x20) TVVTotal|=512;
- if(TVOverflow&0x01) TVVTotal|=256;
- TVHTotal+=40; TVVTotal+=2;
-
- TVHSyncStart=CRINB(0xe4)*8;
- TVVSyncStart=CRINB(0xf0);
- if(TVOverflow&0x80) TVVSyncStart|=512;
- if(TVOverflow&0x04) TVVSyncStart|=256;
-
- HWinStart=(TVHTotal-HDisp)&15;
- HWinStart|=(HTotal-HDisp)&15;
- HWinStart+=(TVHTotal-TVHSyncStart)-49;
- }
- else
- {
- LOGWRITE("[cyberblade] Using Standard CRTC\n");
- HWinStart=(HTotal-HSync)+15;
- }
- VWinStart=(VTotal-VSync)-8;
-
- printf("[cyberblade] HTotal: 0x%x, HSStart: 0x%x\n",HTotal,HSync);
- printf(" VTotal: 0x%x, VStart: 0x%x\n",VTotal,VSync);
- tx1=HWinStart+info->dest.x;
- ty1=VWinStart+info->dest.y;
- tx2=tx1+info->dest.w;
- ty2=ty1+info->dest.h;
-
- CROUTW(0x86,tx1);
- CROUTW(0x88,ty1);
- CROUTW(0x8a,tx2);
- CROUTW(0x8c,ty2+3);
- }
-
- if(src_w==drw_w)
- hscale=0;
- else if(src_w<drw_w)
- {
- hscale=((src_w<<10)/(drw_w-2)) & 0x1fff;
- }
- else
- {
- hscale=0x8000 | ((((src_w/drw_w)-1)&7)<<10) | (((drw_w<<10)/src_w) & 0x3ff);
- }
-
- vscale=(src_h<<10)/(drw_h);
- if(drw_h<src_h)
- vscale=0x8000|((drw_h<<10)/(src_h));
-
- /* Write scale factors to hardware */
-
- CROUTW(0x80,hscale); /* Horizontal Scale */
- CROUTW(0x82,vscale); /* Vertical Scale */
-
- /* Now set the start address and data layout */
- {
- int lb = (y_pitch+2) >> 2;
- CROUTB(0x95, ((lb & 0x100)>>1) | 0x08 ); /* Linebuffer level bit 8 & threshold */
- CROUTB(0x96, (lb & 0xFF)); /* Linebuffer level */
-
- CROUTB(0x97, 0x00); /* VDE Flags */
- CROUTB(0xBA, 0x00); /* Chroma key */
- CROUTB(0xBB, 0x00); /* Chroma key */
- CROUTB(0xBC, 0xFF); /* Chroma key */
- CROUTB(0xBD, 0xFF); /* Chroma key */
- CROUTB(0xBE, 0x04); /* Capture control */
-
- if(src_w > 384)
- layout|=4; /* 2x line buffers */
- SROUTB(0x97, layout);
-
- CROUTW(0x90,y_pitch); /* Y Bytes per row */
- SROUTW(0x9A,uv_pitch); /* UV Bytes per row */
-
- switch(info->fourcc)
- {
- case IMGFMT_BGR16:
- CROUTB(0x8F, 0x24); /* VDE Flags - Edge Recovery & CSC Bypass */
- CROUTB(0xBF, 0x02); /* Video format - RGB16 */
- SROUTB(0xBE, 0x0); /* HSCB disabled */
- break;
- default:
- CROUTB(0x8F, 0x20); /* VDE Flags - Edge Recovery */
- CROUTB(0xBF, 0x00); /* Video format - YUV */
- SROUTB(0xBE, 0x00); /* HSCB disable - was 0x03*/
- break;
- }
-
- CROUTB(0x92, ((base0+info->offset.y) >> 3) &0xff); /* Lower 8 bits of start address */
- CROUTB(0x93, ((base0+info->offset.y) >> 11) &0xff); /* Mid 8 bits of start address */
- CROUTB(0x94, ((base0+info->offset.y) >> 19) &0xf); /* Upper 4 bits of start address */
- SROUTB(0x80, ((base0+info->offset.v) >> 3) &0xff); /* Lower 8 bits of start address */
- SROUTB(0x81, ((base0+info->offset.v) >> 11) &0xff); /* Mid 8 bits of start address */
- SROUTB(0x82, ((base0+info->offset.v) >> 19) &0xf); /* Upper 4 bits of start address */
- SROUTB(0x83, ((base0+info->offset.u) >> 3) &0xff); /* Lower 8 bits of start address */
- SROUTB(0x84, ((base0+info->offset.u) >> 11) &0xff); /* Mid 8 bits of start address */
- SROUTB(0x85, ((base0+info->offset.u) >> 19) &0xf); /* Upper 4 bits of start address */
- }
-
- vixPlaybackSetEq(&equal);
-
- /* Protect hardware registers again */
- SROUTB(0x11, protect);
- return 0;
-}
-
-
-int vixPlaybackOn(void)
-{
- LOGWRITE("Enable overlay\n");
- CROUTB(0x8E, 0xd4); /* VDE Flags*/
-
- return 0;
-}
-
-
-int vixPlaybackOff(void)
-{
- LOGWRITE("Disable overlay\n");
- CROUTB(0x8E, 0xc4); /* VDE Flags*/
-
- return 0;
-}
-
-
-int vixPlaybackFrameSelect(unsigned int frame)
-{
- int protect;
- LOGWRITE("Frame select\n");
- protect=SRINB(0x11);
- SROUTB(0x11, 0x92);
- /* Set overlay address to that of selected frame */
- CROUTB(0x92, ((frames[frame]+YOffs) >> 3) &0xff); /* Lower 8 bits of start address */
- CROUTB(0x93, ((frames[frame]+YOffs) >> 11) &0xff); /* Mid 8 bits of start address */
- CROUTB(0x94, ((frames[frame]+YOffs) >> 19) &0xf); /* Upper 4 bits of start address */
- SROUTB(0x80, ((frames[frame]+VOffs) >> 3) &0xff); /* Lower 8 bits of start address */
- SROUTB(0x81, ((frames[frame]+VOffs) >> 11) &0xff); /* Mid 8 bits of start address */
- SROUTB(0x82, ((frames[frame]+VOffs) >> 19) &0xf); /* Upper 4 bits of start address */
- SROUTB(0x83, ((frames[frame]+UOffs) >> 3) &0xff); /* Lower 8 bits of start address */
- SROUTB(0x84, ((frames[frame]+UOffs) >> 11) &0xff); /* Mid 8 bits of start address */
- SROUTB(0x85, ((frames[frame]+UOffs) >> 19) &0xf); /* Upper 4 bits of start address */
- SROUTB(0x11, protect);
- return 0;
-}
-
-
-
diff --git a/src/video_out/vidix/drivers/genfb_vid.c b/src/video_out/vidix/drivers/genfb_vid.c
deleted file mode 100644
index eaf548438..000000000
--- a/src/video_out/vidix/drivers/genfb_vid.c
+++ /dev/null
@@ -1,177 +0,0 @@
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include <inttypes.h>
-#include <fcntl.h>
-
-#include "../vidix.h"
-#include "../fourcc.h"
-#include "../../libdha/libdha.h"
-#include "../../libdha/pci_ids.h"
-#include "../../libdha/pci_names.h"
-
-#define DEMO_DRIVER 1
-#define VIDIX_STATIC genfb_
-
-#define GENFB_MSG "[genfb-demo-driver] "
-
-#if 0 /* these are unused. remove? */
-static int fd;
-
-static void *mmio_base = 0;
-static void *mem_base = 0;
-static int32_t overlay_offset = 0;
-static uint32_t ram_size = 0;
-#endif
-
-static int probed = 0;
-
-/* VIDIX exports */
-
-static vidix_capability_t genfb_cap =
-{
- "General Framebuffer",
- "alex",
- TYPE_OUTPUT,
- { 0, 0, 0, 0 },
- 2048,
- 2048,
- 4,
- 4,
- -1,
- FLAG_UPSCALER|FLAG_DOWNSCALER,
- -1,
- -1,
- { 0, 0, 0, 0 }
-};
-
-unsigned int VIDIX_NAME(vixGetVersion)(void)
-{
- return(VIDIX_VERSION);
-}
-
-int VIDIX_NAME(vixProbe)(int verbose,int force)
-{
-#if 0
- int err = 0;
-#ifdef DEMO_DRIVER
- err = ENOSYS;
-#endif
-
- printf(GENFB_MSG"probe\n");
-
- fd = open("/dev/fb0", O_RDWR);
- if (fd < 0)
- {
- printf(GENFB_MSG"Error occured durint open: %s\n", strerror(errno));
- err = errno;
- }
-
- probed = 1;
-
- return(err);
-#else
- pciinfo_t lst[MAX_PCI_DEVICES];
- unsigned i,num_pci;
- int err;
- err = pci_scan(lst,&num_pci);
- if(err)
- {
- printf(GENFB_MSG"Error occured during pci scan: %s\n",strerror(err));
- return err;
- }
- else
- {
- err = ENXIO;
- for(i=0;i<num_pci;i++)
- {
- if(verbose)
- printf(GENFB_MSG" Found chip [%04X:%04X] '%s' '%s'\n"
- ,lst[i].vendor
- ,lst[i].device
- ,pci_vendor_name(lst[i].vendor)
- ,pci_device_name(lst[i].vendor,lst[i].device));
- }
- }
- return ENOSYS;
-#endif
-}
-
-int VIDIX_NAME(vixInit)(const char *args)
-{
- printf(GENFB_MSG"init\n");
-
- if (!probed)
- {
- printf(GENFB_MSG"Driver was not probed but is being initialized\n");
- return(EINTR);
- }
-
- return(0);
-}
-
-void VIDIX_NAME(vixDestroy)(void)
-{
- printf(GENFB_MSG"destory\n");
- return;
-}
-
-int VIDIX_NAME(vixGetCapability)(vidix_capability_t *to)
-{
- memcpy(to, &genfb_cap, sizeof(vidix_capability_t));
- return(0);
-}
-
-int VIDIX_NAME(vixQueryFourcc)(vidix_fourcc_t *to)
-{
- printf(GENFB_MSG"query fourcc (%x)\n", to->fourcc);
-
- to->depth = VID_DEPTH_1BPP | VID_DEPTH_2BPP |
- VID_DEPTH_4BPP | VID_DEPTH_8BPP |
- VID_DEPTH_12BPP | VID_DEPTH_15BPP |
- VID_DEPTH_16BPP | VID_DEPTH_24BPP |
- VID_DEPTH_32BPP;
-
- to->flags = 0;
- return(0);
-}
-
-int VIDIX_NAME(vixConfigPlayback)(vidix_playback_t *info)
-{
- printf(GENFB_MSG"config playback\n");
-
- info->num_frames = 2;
- info->frame_size = info->src.w*info->src.h+(info->src.w*info->src.h)/2;
- info->dest.pitch.y = 32;
- info->dest.pitch.u = info->dest.pitch.v = 16;
- info->offsets[0] = 0;
- info->offsets[1] = info->frame_size;
- info->offset.y = 0;
- info->offset.v = ((info->src.w+31) & ~31) * info->src.h;
- info->offset.u = info->offset.v+((info->src.w+31) & ~31) * info->src.h/4;
- info->dga_addr = malloc(info->num_frames*info->frame_size);
- printf(GENFB_MSG"frame_size: %d, dga_addr: %p\n",
- info->frame_size, info->dga_addr);
-
- return(0);
-}
-
-int VIDIX_NAME(vixPlaybackOn)(void)
-{
- printf(GENFB_MSG"playback on\n");
- return(0);
-}
-
-int VIDIX_NAME(vixPlaybackOff)(void)
-{
- printf(GENFB_MSG"playback off\n");
- return(0);
-}
-
-int VIDIX_NAME(vixPlaybackFrameSelect)(unsigned int frame)
-{
- printf(GENFB_MSG"frameselect: %d\n", frame);
- return(0);
-}
diff --git a/src/video_out/vidix/drivers/glint_regs.h b/src/video_out/vidix/drivers/glint_regs.h
deleted file mode 100644
index f33accd3d..000000000
--- a/src/video_out/vidix/drivers/glint_regs.h
+++ /dev/null
@@ -1,1304 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint_regs.h,v 1.31 2001/12/08 16:01:52 alanh Exp $ */
-
-/*
- * glint register file
- *
- * Copyright by Stefan Dirsch, Dirk Hohndel, Alan Hourihane
- * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
- * Dirk Hohndel, <hohndel@suse.de>
- * Stefan Dirsch, <sndirsch@suse.de>
- * Simon P., <sim@suse.de>
- *
- * this work is sponsored by S.u.S.E. GmbH, Fuerth, Elsa GmbH, Aachen and
- * Siemens Nixdorf Informationssysteme
- *
- */
-
-#ifndef _GLINTREG_H_
-#define _GLINTREG_H_
-
-/**********************************************
-* GLINT 500TX Configuration Region Registers *
-***********************************************/
-
-/* Device Identification */
-#define CFGVendorId 0x0000
-#define PCI_VENDOR_3DLABS 0x3D3D
-#define PCI_VENDOR_TI 0x104C
-#define CFGDeviceId 0x0002
-
-#define CFGRevisionId 0x08
-#define CFGClassCode 0x09
-#define CFGHeaderType 0x0E
-
-/* Device Control/Status */
-#define CFGCommand 0x04
-#define CFGStatus 0x06
-
-/* Miscellaneous Functions */
-#define CFGBist 0x0f
-#define CFGLatTimer 0x0d
-#define CFGCacheLine 0x0c
-#define CFGMaxLat 0x3f
-#define CFGMinGrant 0x3e
-#define CFGIntPin 0x3d
-#define CFGIntLine 0x3c
-
-/* Base Adresses */
-#define CFGBaseAddr0 0x10
-#define CFGBaseAddr1 0x14
-#define CFGBaseAddr2 0x18
-#define CFGBaseAddr3 0x1C
-#define CFGBaseAddr4 0x20
-#define CFGRomAddr 0x30
-
-
-
-/**********************************
- * GLINT 500TX Region 0 Registers *
- **********************************/
-
-/* Control Status Registers */
-#define ResetStatus 0x0000
-#define IntEnable 0x0008
-#define IntFlags 0x0010
-#define InFIFOSpace 0x0018
-#define OutFIFOWords 0x0020
-#define DMAAddress 0x0028
-#define DMACount 0x0030
-#define ErrorFlags 0x0038
-#define VClkCtl 0x0040
-#define TestRegister 0x0048
-#define Aperture0 0x0050
-#define Aperture1 0x0058
-#define DMAControl 0x0060
-#define FIFODis 0x0068
-
-/* GLINT PerMedia Region 0 additional Registers */
-#define ChipConfig 0x0070
-#define SCLK_SEL_MASK (3 << 10)
-#define SCLK_SEL_MCLK_HALF (3 << 10)
-#define ByDMAControl 0x00D8
-
-/* GLINT 500TX LocalBuffer Registers */
-#define LBMemoryCtl 0x1000
-#define LBNumBanksMask 0x00000001
-#define LBNumBanks1 (0)
-#define LBNumBanks2 (1)
-#define LBPageSizeMask 0x00000006
-#define LBPageSize256 (0<<1)
-#define LBPageSize512 (1<<1)
-#define LBPageSize1024 (2<<1)
-#define LBPageSize2048 (3<<1)
-#define LBRASCASLowMask 0x00000018
-#define LBRASCASLow2 (0<<3)
-#define LBRASCASLow3 (1<<3)
-#define LBRASCASLow4 (2<<3)
-#define LBRASCASLow5 (3<<3)
-#define LBRASPrechargeMask 0x00000060
-#define LBRASPrecharge2 (0<<5)
-#define LBRASPrecharge3 (1<<5)
-#define LBRASPrecharge4 (2<<5)
-#define LBRASPrecharge5 (3<<5)
-#define LBCASLowMask 0x00000180
-#define LBCASLow1 (0<<7)
-#define LBCASLow2 (1<<7)
-#define LBCASLow3 (2<<7)
-#define LBCASLow4 (3<<7)
-#define LBPageModeMask 0x00000200
-#define LBPageModeEnabled (0<<9)
-#define LBPageModeDisabled (1<<9)
-#define LBRefreshCountMask 0x0003fc00
-#define LBRefreshCountShift 10
-
-#define LBMemoryEDO 0x1008
-#define LBEDOMask 0x00000001
-#define LBEDODisabled (0)
-#define LBEDOEnabled (1)
-#define LBEDOBankSizeMask 0x0000000e
-#define LBEDOBankSizeDiabled (0<<1)
-#define LBEDOBankSize256K (1<<1)
-#define LBEDOBankSize512K (2<<1)
-#define LBEDOBankSize1M (3<<1)
-#define LBEDOBankSize2M (4<<1)
-#define LBEDOBankSize4M (5<<1)
-#define LBEDOBankSize8M (6<<1)
-#define LBEDOBankSize16M (7<<1)
-#define LBTwoPageDetectorMask 0x00000010
-#define LBSinglePageDetector (0<<4)
-#define LBTwoPageDetector (1<<4)
-
-/* GLINT PerMedia Memory Control Registers */
-#define PMReboot 0x1000
-#define PMRomControl 0x1040
-#define PMBootAddress 0x1080
-#define PMMemConfig 0x10C0
- #define RowCharge8 1 << 10
- #define TimeRCD8 1 << 7
- #define TimeRC8 0x6 << 3
- #define TimeRP8 1
- #define CAS3Latency8 0 << 16
- #define BootAdress8 0x10
- #define NumberBanks8 0x3 << 29
- #define RefreshCount8 0x41 << 21
- #define TimeRASMin8 1 << 13
- #define DeadCycle8 1 << 17
- #define BankDelay8 0 << 18
- #define Burst1Cycle8 1 << 31
- #define SDRAM8 0 << 4
-
- #define RowCharge6 1 << 10
- #define TimeRCD6 1 << 7
- #define TimeRC6 0x6 << 3
- #define TimeRP6 0x2
- #define CAS3Latency6 1 << 16
- #define BootAdress6 0x60
- #define NumberBanks6 0x2 << 29
- #define RefreshCount6 0x41 << 21
- #define TimeRASMin6 1 << 13
- #define DeadCycle6 1 << 17
- #define BankDelay6 0 << 18
- #define Burst1Cycle6 1 << 31
- #define SDRAM6 0 << 4
-
- #define RowCharge4 0 << 10
- #define TimeRCD4 0 << 7
- #define TimeRC4 0x4 << 3
- #define TimeRP4 1
- #define CAS3Latency4 0 << 16
- #define BootAdress4 0x10
- #define NumberBanks4 1 << 29
- #define RefreshCount4 0x30 << 21
- #define TimeRASMin4 1 << 13
- #define DeadCycle4 0 << 17
- #define BankDelay4 0 << 18
- #define Burst1Cycle4 1 << 31
- #define SDRAM4 0 << 4
-
-/* Permedia 2 Control */
-#define MemControl 0x1040
-
-#define PMBypassWriteMask 0x1100
-#define PMFramebufferWriteMask 0x1140
-#define PMCount 0x1180
-
-/* Framebuffer Registers */
-#define FBMemoryCtl 0x1800
-#define FBModeSel 0x1808
-#define FBGCWrMask 0x1810
-#define FBGCColorLower 0x1818
-#define FBTXMemCtl 0x1820
-#define FBWrMaskk 0x1830
-#define FBGCColorUpper 0x1838
-
-/* Core FIFO */
-#define OutputFIFO 0x2000
-
-/* 500TX Internal Video Registers */
-#define VTGHLimit 0x3000
-#define VTGHSyncStart 0x3008
-#define VTGHSyncEnd 0x3010
-#define VTGHBlankEnd 0x3018
-#define VTGVLimit 0x3020
-#define VTGVSyncStart 0x3028
-#define VTGVSyncEnd 0x3030
-#define VTGVBlankEnd 0x3038
-#define VTGHGateStart 0x3040
-#define VTGHGateEnd 0x3048
-#define VTGVGateStart 0x3050
-#define VTGVGateEnd 0x3058
-#define VTGPolarity 0x3060
-#define VTGFrameRowAddr 0x3068
-#define VTGVLineNumber 0x3070
-#define VTGSerialClk 0x3078
-#define VTGModeCtl 0x3080
-
-/* Permedia Video Control Registers */
-#define PMScreenBase 0x3000
-#define PMScreenStride 0x3008
-#define PMHTotal 0x3010
-#define PMHgEnd 0x3018
-#define PMHbEnd 0x3020
-#define PMHsStart 0x3028
-#define PMHsEnd 0x3030
-#define PMVTotal 0x3038
-#define PMVbEnd 0x3040
-#define PMVsStart 0x3048
-#define PMVsEnd 0x3050
-#define PMVideoControl 0x3058
-#define PMInterruptLine 0x3060
-#define PMDDCData 0x3068
-#define DataIn (1<<0)
-#define ClkIn (1<<1)
-#define DataOut (1<<2)
-#define ClkOut (1<<3)
-#define PMLineCount 0x3070
-#define PMFifoControl 0x3078
-
-/* Permedia 2 RAMDAC Registers */
-#define PM2DACWriteAddress 0x4000
-#define PM2DACIndexReg 0x4000
-#define PM2DACData 0x4008
-#define PM2DACReadMask 0x4010
-#define PM2DACReadAddress 0x4018
-#define PM2DACCursorColorAddress 0x4020
-#define PM2DACCursorColorData 0x4028
-#define PM2DACIndexData 0x4050
-#define PM2DACCursorData 0x4058
-#define PM2DACCursorXLsb 0x4060
-#define PM2DACCursorXMsb 0x4068
-#define PM2DACCursorYLsb 0x4070
-#define PM2DACCursorYMsb 0x4078
-#define PM2DACCursorControl 0x06
-#define PM2DACIndexCMR 0x18
-#define PM2DAC_TRUECOLOR 0x80
-#define PM2DAC_RGB 0x20
-#define PM2DAC_GRAPHICS 0x10
-#define PM2DAC_PACKED 0x09
-#define PM2DAC_8888 0x08
-#define PM2DAC_565 0x06
-#define PM2DAC_4444 0x05
-#define PM2DAC_5551 0x04
-#define PM2DAC_2321 0x03
-#define PM2DAC_2320 0x02
-#define PM2DAC_332 0x01
-#define PM2DAC_CI8 0x00
-#define PM2DACIndexMDCR 0x19
-#define PM2DACIndexPalettePage 0x1c
-#define PM2DACIndexMCR 0x1e
-#define PM2DACIndexClockAM 0x20
-#define PM2DACIndexClockAN 0x21
-#define PM2DACIndexClockAP 0x22
-#define PM2DACIndexClockBM 0x23
-#define PM2DACIndexClockBN 0x24
-#define PM2DACIndexClockBP 0x25
-#define PM2DACIndexClockCM 0x26
-#define PM2DACIndexClockCN 0x27
-#define PM2DACIndexClockCP 0x28
-#define PM2DACIndexClockStatus 0x29
-#define PM2DACIndexMemClockM 0x30
-#define PM2DACIndexMemClockN 0x31
-#define PM2DACIndexMemClockP 0x32
-#define PM2DACIndexMemClockStatus 0x33
-#define PM2DACIndexColorKeyControl 0x40
-#define PM2DACIndexColorKeyOverlay 0x41
-#define PM2DACIndexColorKeyRed 0x42
-#define PM2DACIndexColorKeyGreen 0x43
-#define PM2DACIndexColorKeyBlue 0x44
-
-/* Permedia 2V extensions */
-#define PM2VDACRDMiscControl 0x000
-#define PM2VDACRDSyncControl 0x001
-#define PM2VDACRDDACControl 0x002
-#define PM2VDACRDPixelSize 0x003
-#define PM2VDACRDColorFormat 0x004
-#define PM2VDACRDCursorMode 0x005
-#define PM2VDACRDCursorXLow 0x007
-#define PM2VDACRDCursorXHigh 0x008
-#define PM2VDACRDCursorYLow 0x009
-#define PM2VDACRDCursorYHigh 0x00A
-#define PM2VDACRDCursorHotSpotX 0x00B
-#define PM2VDACRDCursorHotSpotY 0x00C
-#define PM2VDACRDOverlayKey 0x00D
-#define PM2VDACRDPan 0x00E
-#define PM2VDACRDSense 0x00F
-#define PM2VDACRDCheckControl 0x018
-#define PM2VDACIndexClockControl 0x200
-#define PM2VDACRDDClk0PreScale 0x201
-#define PM2VDACRDDClk0FeedbackScale 0x202
-#define PM2VDACRDDClk0PostScale 0x203
-#define PM2VDACRDDClk1PreScale 0x204
-#define PM2VDACRDDClk1FeedbackScale 0x205
-#define PM2VDACRDDClk1PostScale 0x206
-#define PM2VDACRDMClkControl 0x20D
-#define PM2VDACRDMClkPreScale 0x20E
-#define PM2VDACRDMClkFeedbackScale 0x20F
-#define PM2VDACRDMClkPostScale 0x210
-#define PM2VDACRDCursorPalette 0x303
-#define PM2VDACRDCursorPattern 0x400
-#define PM2VDACIndexRegLow 0x4020
-#define PM2VDACIndexRegHigh 0x4028
-#define PM2VDACIndexData 0x4030
-#define PM2VDACRDIndexControl 0x4038
-
-/* Permedia 2 Video Streams Unit Registers */
-#define VSBIntFlag (1<<8)
-#define VSAIntFlag (1<<9)
-
-#define VSConfiguration 0x5800
-#define VS_UnitMode_ROM 0
-#define VS_UnitMode_AB8 3
-#define VS_UnitMode_Mask 7
-#define VS_GPBusMode_A (1<<3)
-#define VS_HRefPolarityA (1<<9)
-#define VS_VRefPolarityA (1<<10)
-#define VS_VActivePolarityA (1<<11)
-#define VS_UseFieldA (1<<12)
-#define VS_FieldPolarityA (1<<13)
-#define VS_FieldEdgeA (1<<14)
-#define VS_VActiveVBIA (1<<15)
-#define VS_InterlaceA (1<<16)
-#define VS_ReverseDataA (1<<17)
-#define VS_HRefPolarityB (1<<18)
-#define VS_VRefPolarityB (1<<19)
-#define VS_VActivePolarityB (1<<20)
-#define VS_UseFieldB (1<<21)
-#define VS_FieldPolarityB (1<<22)
-#define VS_FieldEdgeB (1<<23)
-#define VS_VActiveVBIB (1<<24)
-#define VS_InterlaceB (1<<25)
-#define VS_ColorSpaceB_RGB (1<<26)
-#define VS_ReverseDataB (1<<27)
-#define VS_DoubleEdgeB (1<<28)
-
-#define VSStatus 0x5808
-#define VS_FieldOne0A (1<<9)
-#define VS_FieldOne1A (1<<10)
-#define VS_FieldOne2A (1<<11)
-#define VS_InvalidInterlaceA (1<<12)
-#define VS_FieldOne0B (1<<17)
-#define VS_FieldOne1B (1<<18)
-#define VS_FieldOne2B (1<<19)
-#define VS_InvalidInterlaceB (1<<20)
-
-#define VSSerialBusControl 0x5810
-
-#define VSABase 0x5900
-#define VSA_Video (1<<0)
-#define VSA_VBI (1<<1)
-#define VSA_BufferCtl (1<<2)
-#define VSA_MirrorX (1<<7)
-#define VSA_MirrorY (1<<8)
-#define VSA_Discard_None (0<<9)
-#define VSA_Discard_FieldOne (1<<9)
-#define VSA_Discard_FieldTwo (2<<9)
-#define VSA_CombineFields (1<<11)
-#define VSA_LockToStreamB (1<<12)
-#define VSBBase 0x5A00
-#define VSB_Video (1<<0)
-#define VSB_VBI (1<<1)
-#define VSB_BufferCtl (1<<2)
-#define VSB_CombineFields (1<<3)
-#define VSB_RGBOrder (1<<11)
-#define VSB_GammaCorrect (1<<12)
-#define VSB_LockToStreamA (1<<13)
-
-#define VSControl 0x0000
-#define VSInterrupt 0x0008
-#define VSCurrentLine 0x0010
-#define VSVideoAddressHost 0x0018
-#define VSVideoAddressIndex 0x0020
-#define VSVideoAddress0 0x0028
-#define VSVideoAddress1 0x0030
-#define VSVideoAddress2 0x0038
-#define VSVideoStride 0x0040
-#define VSVideoStartLine 0x0048
-#define VSVideoEndLine 0x0050
-#define VSVideoStartData 0x0058
-#define VSVideoEndData 0x0060
-#define VSVBIAddressHost 0x0068
-#define VSVBIAddressIndex 0x0070
-#define VSVBIAddress0 0x0078
-#define VSVBIAddress1 0x0080
-#define VSVBIAddress2 0x0088
-#define VSVBIStride 0x0090
-#define VSVBIStartLine 0x0098
-#define VSVBIEndLine 0x00A0
-#define VSVBIStartData 0x00A8
-#define VSVBIEndData 0x00B0
-#define VSFifoControl 0x00B8
-
-/**********************************
- * GLINT Delta Region 0 Registers *
- **********************************/
-
-/* Control Status Registers */
-#define DResetStatus 0x0800
-#define DIntEnable 0x0808
-#define DIntFlags 0x0810
-#define DErrorFlags 0x0838
-#define DTestRegister 0x0848
-#define DFIFODis 0x0868
-
-
-
-/**********************************
- * GLINT Gamma Region 0 Registers *
- **********************************/
-
-/* Control Status Registers */
-#define GInFIFOSpace 0x0018
-#define GDMAAddress 0x0028
-#define GDMACount 0x0030
-#define GDMAControl 0x0060
-#define GOutDMA 0x0080
-#define GOutDMACount 0x0088
-#define GResetStatus 0x0800
-#define GIntEnable 0x0808
-#define GIntFlags 0x0810
-#define GErrorFlags 0x0838
-#define GTestRegister 0x0848
-#define GFIFODis 0x0868
-
-#define GChipConfig 0x0870
-#define GChipAGPCapable 1 << 0
-#define GChipAGPSideband 1 << 1
-#define GChipMultiGLINTApMask 3 << 19
-#define GChipMultiGLINTAp_0M 0 << 19
-#define GChipMultiGLINTAp_16M 1 << 19
-#define GChipMultiGLINTAp_32M 2 << 19
-#define GChipMultiGLINTAp_64M 3 << 19
-
-#define GCSRAperture 0x0878
-#define GCSRSecondaryGLINTMapEn 1 << 0
-
-#define GPageTableAddr 0x0c00
-#define GPageTableLength 0x0c08
-#define GDelayTimer 0x0c38
-#define GCommandMode 0x0c40
-#define GCommandIntEnable 0x0c48
-#define GCommandIntFlags 0x0c50
-#define GCommandErrorFlags 0x0c58
-#define GCommandStatus 0x0c60
-#define GCommandFaultingAddr 0x0c68
-#define GVertexFaultingAddr 0x0c70
-#define GWriteFaultingAddr 0x0c88
-#define GFeedbackSelectCount 0x0c98
-#define GGammaProcessorMode 0x0cb8
-#define GVGAShadow 0x0d00
-#define GMultGLINTAperture 0x0d08
-#define GMultGLINT1 0x0d10
-#define GMultGLINT2 0x0d18
-
-/************************
- * GLINT Core Registers *
- ************************/
-
-#define GLINT_TAG(major,offset) (((major) << 7) | ((offset) << 3))
-#define GLINT_TAG_ADDR(major,offset) (0x8000 | GLINT_TAG((major),(offset)))
-
-#define UNIT_DISABLE 0
-#define UNIT_ENABLE 1
-
-#define StartXDom GLINT_TAG_ADDR(0x00,0x00)
-#define dXDom GLINT_TAG_ADDR(0x00,0x01)
-#define StartXSub GLINT_TAG_ADDR(0x00,0x02)
-#define dXSub GLINT_TAG_ADDR(0x00,0x03)
-#define StartY GLINT_TAG_ADDR(0x00,0x04)
-#define dY GLINT_TAG_ADDR(0x00,0x05)
-#define GLINTCount GLINT_TAG_ADDR(0x00,0x06)
-#define Render GLINT_TAG_ADDR(0x00,0x07)
- #define AreaStippleEnable 0x00001
- #define LineStippleEnable 0x00002
- #define ResetLineStipple 0x00004
- #define FastFillEnable 0x00008
- #define PrimitiveLine 0
- #define PrimitiveTrapezoid 0x00040
- #define PrimitivePoint 0x00080
- #define PrimitiveRectangle 0x000C0
- #define AntialiasEnable 0x00100
- #define AntialiasingQuality 0x00200
- #define UsePointTable 0x00400
- #define SyncOnBitMask 0x00800
- #define SyncOnHostData 0x01000
- #define TextureEnable 0x02000
- #define FogEnable 0x04000
- #define CoverageEnable 0x08000
- #define SubPixelCorrectionEnable 0x10000
- #define SpanOperation 0x40000
- #define XPositive 1<<21
- #define YPositive 1<<22
-
-
-#define ContinueNewLine GLINT_TAG_ADDR(0x00,0x08)
-#define ContinueNewDom GLINT_TAG_ADDR(0x00,0x09)
-#define ContinueNewSub GLINT_TAG_ADDR(0x00,0x0a)
-#define Continue GLINT_TAG_ADDR(0x00,0x0b)
-#define FlushSpan GLINT_TAG_ADDR(0x00,0x0c)
-#define BitMaskPattern GLINT_TAG_ADDR(0x00,0x0d)
-
-#define PointTable0 GLINT_TAG_ADDR(0x01,0x00)
-#define PointTable1 GLINT_TAG_ADDR(0x01,0x01)
-#define PointTable2 GLINT_TAG_ADDR(0x01,0x02)
-#define PointTable3 GLINT_TAG_ADDR(0x01,0x03)
-#define RasterizerMode GLINT_TAG_ADDR(0x01,0x04)
-#define RMMultiGLINT 1<<17
-#define BitMaskPackingEachScanline 1<<9
-#define ForceBackgroundColor 1<<6
-#define InvertBitMask 1<<1
-#define YLimits GLINT_TAG_ADDR(0x01,0x05)
-#define ScanLineOwnership GLINT_TAG_ADDR(0x01,0x06)
-#define WaitForCompletion GLINT_TAG_ADDR(0x01,0x07)
-#define PixelSize GLINT_TAG_ADDR(0x01,0x08)
-#define XLimits GLINT_TAG_ADDR(0x01,0x09) /* PM only */
-
-#define RectangleOrigin GLINT_TAG_ADDR(0x01,0x0A) /* PM2 only */
-#define RectangleSize GLINT_TAG_ADDR(0x01,0x0B) /* PM2 only */
-
-#define PackedDataLimits GLINT_TAG_ADDR(0x02,0x0a) /* PM only */
-
-#define ScissorMode GLINT_TAG_ADDR(0x03,0x00)
- #define SCI_USER 0x01
- #define SCI_SCREEN 0x02
- #define SCI_USERANDSCREEN 0x03
-
-#define ScissorMinXY GLINT_TAG_ADDR(0x03,0x01)
-#define ScissorMaxXY GLINT_TAG_ADDR(0x03,0x02)
-#define ScreenSize GLINT_TAG_ADDR(0x03,0x03)
-#define AreaStippleMode GLINT_TAG_ADDR(0x03,0x04)
- /* 0: */
- /* NoMirrorY */
- /* NoMirrorX */
- /* NoInvertPattern */
- /* YAddress_1bit */
- /* XAddress_1bit */
- /* UNIT_DISABLE */
-
- #define ASM_XAddress_2bit 1 << 1
- #define ASM_XAddress_3bit 2 << 1
- #define ASM_XAddress_4bit 3 << 1
- #define ASM_XAddress_5bit 4 << 1
- #define ASM_YAddress_2bit 1 << 4
- #define ASM_YAddress_3bit 2 << 4
- #define ASM_YAddress_4bit 3 << 4
- #define ASM_YAddress_5bit 4 << 4
- #define ASM_InvertPattern 1 << 17
- #define ASM_MirrorX 1 << 18
- #define ASM_MirrorY 1 << 19
-
-#define LineStippleMode GLINT_TAG_ADDR(0x03,0x05)
-#define LoadLineStippleCounters GLINT_TAG_ADDR(0x03,0x06)
-#define UpdateLineStippleCounters GLINT_TAG_ADDR(0x03,0x07)
-#define SaveLineStippleState GLINT_TAG_ADDR(0x03,0x08)
-#define WindowOrigin GLINT_TAG_ADDR(0x03,0x09)
-
-#define AreaStipplePattern0 GLINT_TAG_ADDR(0x04,0x00)
-#define AreaStipplePattern1 GLINT_TAG_ADDR(0x04,0x01)
-#define AreaStipplePattern2 GLINT_TAG_ADDR(0x04,0x02)
-#define AreaStipplePattern3 GLINT_TAG_ADDR(0x04,0x03)
-#define AreaStipplePattern4 GLINT_TAG_ADDR(0x04,0x04)
-#define AreaStipplePattern5 GLINT_TAG_ADDR(0x04,0x05)
-#define AreaStipplePattern6 GLINT_TAG_ADDR(0x04,0x06)
-#define AreaStipplePattern7 GLINT_TAG_ADDR(0x04,0x07)
-
-#define TextureAddressMode GLINT_TAG_ADDR(0x07,0x00)
-#define SStart GLINT_TAG_ADDR(0x07,0x01)
-#define dSdx GLINT_TAG_ADDR(0x07,0x02)
-#define dSdyDom GLINT_TAG_ADDR(0x07,0x03)
-#define TStart GLINT_TAG_ADDR(0x07,0x04)
-#define dTdx GLINT_TAG_ADDR(0x07,0x05)
-#define dTdyDom GLINT_TAG_ADDR(0x07,0x06)
-#define QStart GLINT_TAG_ADDR(0x07,0x07)
-#define dQdx GLINT_TAG_ADDR(0x07,0x08)
-#define dQdyDom GLINT_TAG_ADDR(0x07,0x09)
-#define LOD GLINT_TAG_ADDR(0x07,0x0A)
-#define dSdy GLINT_TAG_ADDR(0x07,0x0B)
-#define dTdy GLINT_TAG_ADDR(0x07,0x0C)
-#define dQdy GLINT_TAG_ADDR(0x07,0x0D)
-
-#define TextureReadMode GLINT_TAG_ADDR(0x09,0x00)
-#define TextureFormat GLINT_TAG_ADDR(0x09,0x01)
- #define Texture_4_Components 3 << 3
- #define Texture_Texel 0
-
-#define TextureCacheControl GLINT_TAG_ADDR(0x09,0x02)
- #define TextureCacheControlEnable 2
- #define TextureCacheControlInvalidate 1
-
-#define GLINTBorderColor GLINT_TAG_ADDR(0x09,0x05)
-
-#define TexelLUTIndex GLINT_TAG_ADDR(0x09,0x08)
-#define TexelLUTData GLINT_TAG_ADDR(0x09,0x09)
-#define TexelLUTAddress GLINT_TAG_ADDR(0x09,0x0A)
-#define TexelLUTTransfer GLINT_TAG_ADDR(0x09,0x0B)
-#define TextureFilterMode GLINT_TAG_ADDR(0x09,0x0C)
-#define TextureChromaUpper GLINT_TAG_ADDR(0x09,0x0D)
-#define TextureChromaLower GLINT_TAG_ADDR(0x09,0x0E)
-
-#define TxBaseAddr0 GLINT_TAG_ADDR(0x0A,0x00)
-#define TxBaseAddr1 GLINT_TAG_ADDR(0x0A,0x01)
-#define TxBaseAddr2 GLINT_TAG_ADDR(0x0A,0x02)
-#define TxBaseAddr3 GLINT_TAG_ADDR(0x0A,0x03)
-#define TxBaseAddr4 GLINT_TAG_ADDR(0x0A,0x04)
-#define TxBaseAddr5 GLINT_TAG_ADDR(0x0A,0x05)
-#define TxBaseAddr6 GLINT_TAG_ADDR(0x0A,0x06)
-#define TxBaseAddr7 GLINT_TAG_ADDR(0x0A,0x07)
-#define TxBaseAddr8 GLINT_TAG_ADDR(0x0A,0x08)
-#define TxBaseAddr9 GLINT_TAG_ADDR(0x0A,0x09)
-#define TxBaseAddr10 GLINT_TAG_ADDR(0x0A,0x0A)
-#define TxBaseAddr11 GLINT_TAG_ADDR(0x0A,0x0B)
-
-#define PMTextureBaseAddress GLINT_TAG_ADDR(0x0b,0x00)
-#define PMTextureMapFormat GLINT_TAG_ADDR(0x0b,0x01)
-#define PMTextureDataFormat GLINT_TAG_ADDR(0x0b,0x02)
-
-#define Texel0 GLINT_TAG_ADDR(0x0c,0x00)
-#define Texel1 GLINT_TAG_ADDR(0x0c,0x01)
-#define Texel2 GLINT_TAG_ADDR(0x0c,0x02)
-#define Texel3 GLINT_TAG_ADDR(0x0c,0x03)
-#define Texel4 GLINT_TAG_ADDR(0x0c,0x04)
-#define Texel5 GLINT_TAG_ADDR(0x0c,0x05)
-#define Texel6 GLINT_TAG_ADDR(0x0c,0x06)
-#define Texel7 GLINT_TAG_ADDR(0x0c,0x07)
-#define Interp0 GLINT_TAG_ADDR(0x0c,0x08)
-#define Interp1 GLINT_TAG_ADDR(0x0c,0x09)
-#define Interp2 GLINT_TAG_ADDR(0x0c,0x0a)
-#define Interp3 GLINT_TAG_ADDR(0x0c,0x0b)
-#define Interp4 GLINT_TAG_ADDR(0x0c,0x0c)
-#define TextureFilter GLINT_TAG_ADDR(0x0c,0x0d)
-#define PMTextureReadMode GLINT_TAG_ADDR(0x0c,0x0e)
-#define TexelLUTMode GLINT_TAG_ADDR(0x0c,0x0f)
-
-#define TextureColorMode GLINT_TAG_ADDR(0x0d,0x00)
- #define TextureTypeOpenGL 0
- #define TextureTypeApple 1 << 4
- #define TextureKsDDA 1 << 5 /* only Apple-Mode */
- #define TextureKdDDA 1 << 6 /* only Apple-Mode */
-
-#define TextureEnvColor GLINT_TAG_ADDR(0x0d,0x01)
-#define FogMode GLINT_TAG_ADDR(0x0d,0x02)
- /* 0: */
- /* FOG RGBA */
- /* UNIT_DISABLE */
-
- #define FOG_CI 0x0002
-
-#define FogColor GLINT_TAG_ADDR(0x0d,0x03)
-#define FStart GLINT_TAG_ADDR(0x0d,0x04)
-#define dFdx GLINT_TAG_ADDR(0x0d,0x05)
-#define dFdyDom GLINT_TAG_ADDR(0x0d,0x06)
-#define KsStart GLINT_TAG_ADDR(0x0d,0x09)
-#define dKsdx GLINT_TAG_ADDR(0x0d,0x0a)
-#define dKsdyDom GLINT_TAG_ADDR(0x0d,0x0b)
-#define KdStart GLINT_TAG_ADDR(0x0d,0x0c)
-#define dKdStart GLINT_TAG_ADDR(0x0d,0x0d)
-#define dKddyDom GLINT_TAG_ADDR(0x0d,0x0e)
-
-#define RStart GLINT_TAG_ADDR(0x0f,0x00)
-#define dRdx GLINT_TAG_ADDR(0x0f,0x01)
-#define dRdyDom GLINT_TAG_ADDR(0x0f,0x02)
-#define GStart GLINT_TAG_ADDR(0x0f,0x03)
-#define dGdx GLINT_TAG_ADDR(0x0f,0x04)
-#define dGdyDom GLINT_TAG_ADDR(0x0f,0x05)
-#define BStart GLINT_TAG_ADDR(0x0f,0x06)
-#define dBdx GLINT_TAG_ADDR(0x0f,0x07)
-#define dBdyDom GLINT_TAG_ADDR(0x0f,0x08)
-#define AStart GLINT_TAG_ADDR(0x0f,0x09)
-#define dAdx GLINT_TAG_ADDR(0x0f,0x0a)
-#define dAdyDom GLINT_TAG_ADDR(0x0f,0x0b)
-#define ColorDDAMode GLINT_TAG_ADDR(0x0f,0x0c)
- /* 0: */
- #define CDDA_FlatShading 0
- /* UNIT_DISABLE */
- #define CDDA_GouraudShading 0x0002
-
-
-#define ConstantColor GLINT_TAG_ADDR(0x0f,0x0d)
-#define GLINTColor GLINT_TAG_ADDR(0x0f,0x0e)
-#define AlphaTestMode GLINT_TAG_ADDR(0x10,0x00)
-#define AntialiasMode GLINT_TAG_ADDR(0x10,0x01)
-#define AlphaBlendMode GLINT_TAG_ADDR(0x10,0x02)
- /* 0: */
- /* SrcZERO */
- /* DstZERO */
- /* ColorFormat8888 */
- /* AlphaBuffer present */
- /* ColorOrderBGR */
- /* TypeOpenGL */
- /* DstFBData */
- /* UNIT_DISABLE */
-
- #define ABM_SrcONE 1 << 1
- #define ABM_SrcDST_COLOR 2 << 1
- #define ABM_SrcONE_MINUS_DST_COLOR 3 << 1
- #define ABM_SrcSRC_ALPHA 4 << 1
- #define ABM_SrcONE_MINUS_SRC_ALPHA 5 << 1
- #define ABM_SrcDST_ALPHA 6 << 1
- #define ABM_SrcONE_MINUS_DST_ALPHA 7 << 1
- #define ABM_SrcSRC_ALPHA_SATURATE 8 << 1
- #define ABM_DstONE 1 << 5
- #define ABM_DstSRC_COLOR 2 << 5
- #define ABM_DstONE_MINUS_SRC_COLOR 3 << 5
- #define ABM_DstSRC_ALPHA 4 << 5
- #define ABM_DstONE_MINUS_SRC_ALPHA 5 << 5
- #define ABM_DstDST_ALPHA 6 << 5
- #define ABM_DstONE_MINUS_DST_ALPHA 7 << 5
- #define ABM_ColorFormat5555 1 << 8
- #define ABM_ColorFormat4444 2 << 8
- #define ABM_ColorFormat4444_Front 3 << 8
- #define ABM_ColorFormat4444_Back 4 << 8
- #define ABM_ColorFormat332_Front 5 << 8
- #define ABM_ColorFormat332_Back 6 << 8
- #define ABM_ColorFormat121_Front 7 << 8
- #define ABM_ColorFormat121_Back 8 << 8
- #define ABM_ColorFormat555_Back 13 << 8
- #define ABM_ColorFormat_CI8 14 << 8
- #define ABM_ColorFormat_CI4 15 << 8
- #define ABM_NoAlphaBuffer 0x1000
- #define ABM_ColorOrderRGB 0x2000
- #define ABM_TypeQuickDraw3D 0x4000
- #define ABM_DstFBSourceData 0x8000
-
-#define DitherMode GLINT_TAG_ADDR(0x10,0x03)
- /* 0: */
- /* ColorOrder BGR */
- /* AlphaDitherDefault */
- /* ColorFormat8888 */
- /* TruncateMode */
- /* DitherDisable */
- /* UNIT_DISABLE */
-
- #define DTM_DitherEnable 1 << 1
- #define DTM_ColorFormat5555 1 << 2
- #define DTM_ColorFormat4444 2 << 2
- #define DTM_ColorFormat4444_Front 3 << 2
- #define DTM_ColorFormat4444_Back 4 << 2
- #define DTM_ColorFormat332_Front 5 << 2
- #define DTM_ColorFormat332_Back 6 << 2
- #define DTM_ColorFormat121_Front 7 << 2
- #define DTM_ColorFormat121_Back 8 << 2
- #define DTM_ColorFormat555_Back 13 << 2
- #define DTM_ColorFormat_CI8 14 << 2
- #define DTM_ColorFormat_CI4 15 << 2
- #define DTM_ColorOrderRGB 1 << 10
- #define DTM_NoAlphaDither 1 << 14
- #define DTM_RoundMode 1 << 15
-
-#define FBSoftwareWriteMask GLINT_TAG_ADDR(0x10,0x04)
-#define LogicalOpMode GLINT_TAG_ADDR(0x10,0x05)
- #define Use_ConstantFBWriteData 0x40
-
-
-#define FBWriteData GLINT_TAG_ADDR(0x10,0x06)
-#define RouterMode GLINT_TAG_ADDR(0x10,0x08)
- #define ROUTER_Depth_Texture 1
- #define ROUTER_Texture_Depth 0
-
-
-#define LBReadMode GLINT_TAG_ADDR(0x11,0x00)
- /* 0: */
- /* SrcNoRead */
- /* DstNoRead */
- /* DataLBDefault */
- /* WinTopLeft */
- /* NoPatch */
- /* ScanlineInterval1 */
-
- #define LBRM_SrcEnable 1 << 9
- #define LBRM_DstEnable 1 << 10
- #define LBRM_DataLBStencil 1 << 16
- #define LBRM_DataLBDepth 2 << 16
- #define LBRM_WinBottomLeft 1 << 18
- #define LBRM_DoPatch 1 << 19
-
- #define LBRM_ScanlineInt2 1 << 20
- #define LBRM_ScanlineInt4 2 << 20
- #define LBRM_ScanlineInt8 3 << 20
-
-
-#define LBReadFormat GLINT_TAG_ADDR(0x11,0x01)
- #define LBRF_DepthWidth15 0x03 /* only permedia */
- #define LBRF_DepthWidth16 0x00
- #define LBRF_DepthWidth24 0x01
- #define LBRF_DepthWidth32 0x02
-
- #define LBRF_StencilWidth0 (0 << 2)
- #define LBRF_StencilWidth4 (1 << 2)
- #define LBRF_StencilWidth8 (2 << 2)
-
- #define LBRF_StencilPos16 (0 << 4)
- #define LBRF_StencilPos20 (1 << 4)
- #define LBRF_StencilPos24 (2 << 4)
- #define LBRF_StencilPos28 (3 << 4)
- #define LBRF_StencilPos32 (4 << 4)
-
- #define LBRF_FrameCount0 (0 << 7)
- #define LBRF_FrameCount4 (1 << 7)
- #define LBRF_FrameCount8 (2 << 7)
-
- #define LBRF_FrameCountPos16 (0 << 9)
- #define LBRF_FrameCountPos20 (1 << 9)
- #define LBRF_FrameCountPos24 (2 << 9)
- #define LBRF_FrameCountPos28 (3 << 9)
- #define LBRF_FrameCountPos32 (4 << 9)
- #define LBRF_FrameCountPos36 (5 << 9)
- #define LBRF_FrameCountPos40 (6 << 9)
-
- #define LBRF_GIDWidth0 (0 << 12)
- #define LBRF_GIDWidth4 (1 << 12)
-
- #define LBRF_GIDPos16 (0 << 13)
- #define LBRF_GIDPos20 (1 << 13)
- #define LBRF_GIDPos24 (2 << 13)
- #define LBRF_GIDPos28 (3 << 13)
- #define LBRF_GIDPos32 (4 << 13)
- #define LBRF_GIDPos36 (5 << 13)
- #define LBRF_GIDPos40 (6 << 13)
- #define LBRF_GIDPos44 (7 << 13)
- #define LBRF_GIDPos48 (8 << 13)
-
- #define LBRF_Compact32 (1 << 17)
-
-
-
-#define LBSourceOffset GLINT_TAG_ADDR(0x11,0x02)
-#define LBStencil GLINT_TAG_ADDR(0x11,0x05)
-#define LBDepth GLINT_TAG_ADDR(0x11,0x06)
-#define LBWindowBase GLINT_TAG_ADDR(0x11,0x07)
-#define LBWriteMode GLINT_TAG_ADDR(0x11,0x08)
- #define LBWM_WriteEnable 0x1
- #define LBWM_UpLoad_LBDepth 0x2
- #define LBWM_UpLoad_LBStencil 0x4
-
-#define LBWriteFormat GLINT_TAG_ADDR(0x11,0x09)
-
-
-#define TextureData GLINT_TAG_ADDR(0x11,0x0d)
-#define TextureDownloadOffset GLINT_TAG_ADDR(0x11,0x0e)
-#define LBWindowOffset GLINT_TAG_ADDR(0x11,0x0f)
-
-#define GLINTWindow GLINT_TAG_ADDR(0x13,0x00)
- #define GWIN_UnitEnable (1 << 0)
- #define GWIN_ForceLBUpdate (1 << 3)
- #define GWIN_LBUpdateSourceREG (1 << 4)
- #define GWIN_LBUpdateSourceLB (0 << 4)
- #define GWIN_StencilFCP (1 << 17)
- #define GWIN_DepthFCP (1 << 18)
- #define GWIN_OverrideWriteFilter (1 << 19)
-
- /* ??? is this needed, set by permedia (2) modules */
- #define GWIN_DisableLBUpdate 0x40000
-
-#define StencilMode GLINT_TAG_ADDR(0x13,0x01)
-#define StencilData GLINT_TAG_ADDR(0x13,0x02)
-#define GLINTStencil GLINT_TAG_ADDR(0x13,0x03)
-#define DepthMode GLINT_TAG_ADDR(0x13,0x04)
- /* 0: */
- /* WriteDisable */
- /* SrcCompFragment */
- /* CompFuncNEVER */
- /* UNIT_DISABLE */
-
- #define DPM_WriteEnable 1 << 1
- #define DPM_SrcCompLBData 1 << 2
- #define DPM_SrcCompDregister 2 << 2
- #define DPM_SrcCompLBSourceData 3 << 2
- #define DPM_CompFuncLESS 1 << 4
- #define DPM_CompFuncEQUAL 2 << 4
- #define DPM_CompFuncLESS_OR_EQ 3 << 4
- #define DPM_CompFuncGREATER 4 << 4
- #define DPM_CompFuncNOT_EQ 5 << 4
- #define DPM_CompFuncGREATER_OR_EQ 6 << 4
- #define DPM_CompFuncALWAYS 7 << 4
-
-#define GLINTDepth GLINT_TAG_ADDR(0x13,0x05)
-#define ZStartU GLINT_TAG_ADDR(0x13,0x06)
-#define ZStartL GLINT_TAG_ADDR(0x13,0x07)
-#define dZdxU GLINT_TAG_ADDR(0x13,0x08)
-#define dZdxL GLINT_TAG_ADDR(0x13,0x09)
-#define dZdyDomU GLINT_TAG_ADDR(0x13,0x0a)
-#define dZdyDomL GLINT_TAG_ADDR(0x13,0x0b)
-#define FastClearDepth GLINT_TAG_ADDR(0x13,0x0c)
-
-#define FBReadMode GLINT_TAG_ADDR(0x15,0x00)
- /* 0: */
- /* SrcNoRead */
- /* DstNoRead */
- /* DataFBDefault */
- /* WinTopLeft */
- /* ScanlineInterval1 */
-
- #define FBRM_SrcEnable 1 << 9
- #define FBRM_DstEnable 1 << 10
- #define FBRM_DataFBColor 1 << 15
- #define FBRM_WinBottomLeft 1 << 16
- #define FBRM_Packed 1 << 19
- #define FBRM_ScanlineInt2 1 << 23
- #define FBRM_ScanlineInt4 2 << 23
- #define FBRM_ScanlineInt8 3 << 23
-
-
-#define FBSourceOffset GLINT_TAG_ADDR(0x15,0x01)
-#define FBPixelOffset GLINT_TAG_ADDR(0x15,0x02)
-#define FBColor GLINT_TAG_ADDR(0x15,0x03)
-#define FBData GLINT_TAG_ADDR(0x15,0x04)
-#define FBSourceData GLINT_TAG_ADDR(0x15,0x05)
-
-#define FBWindowBase GLINT_TAG_ADDR(0x15,0x06)
-#define FBWriteMode GLINT_TAG_ADDR(0x15,0x07)
- /* 0: */
- /* FBWM_NoColorUpload */
- /* FBWM_WriteDisable */
- #define FBWM_WriteEnable 1
- #define FBWM_UploadColor 1 << 3
-/* Permedia3 extensions */
- #define FBWM_Enable0 1 << 12
-
-#define FBHardwareWriteMask GLINT_TAG_ADDR(0x15,0x08)
-#define FBBlockColor GLINT_TAG_ADDR(0x15,0x09)
-#define FBReadPixel GLINT_TAG_ADDR(0x15,0x0a) /* PM */
-#define PatternRamMode GLINT_TAG_ADDR(0x15,0x0f)
-
-#define PatternRamData0 GLINT_TAG_ADDR(0x16,0x00)
-#define PatternRamData1 GLINT_TAG_ADDR(0x16,0x01)
-#define PatternRamData2 GLINT_TAG_ADDR(0x16,0x02)
-#define PatternRamData3 GLINT_TAG_ADDR(0x16,0x03)
-#define PatternRamData4 GLINT_TAG_ADDR(0x16,0x04)
-#define PatternRamData5 GLINT_TAG_ADDR(0x16,0x05)
-#define PatternRamData6 GLINT_TAG_ADDR(0x16,0x06)
-#define PatternRamData7 GLINT_TAG_ADDR(0x16,0x07)
-
-#define FilterMode GLINT_TAG_ADDR(0x18,0x00)
- /* 0: */
- /* CullDepthTags */
- /* CullDepthData */
- /* CullStencilTags */
- /* CullStencilData */
- /* CullColorTag */
- /* CullColorData */
- /* CullSyncTag */
- /* CullSyncData */
- /* CullStatisticTag */
- /* CullStatisticData */
-
- #define FM_PassDepthTags 0x0010
- #define FM_PassDepthData 0x0020
- #define FM_PassStencilTags 0x0040
- #define FM_PassStencilData 0x0080
- #define FM_PassColorTag 0x0100
- #define FM_PassColorData 0x0200
- #define FM_PassSyncTag 0x0400
- #define FM_PassSyncData 0x0800
- #define FM_PassStatisticTag 0x1000
- #define FM_PassStatisticData 0x2000
-
-#define Sync_tag 0x0188
-
-#define StatisticMode GLINT_TAG_ADDR(0x18,0x01)
-#define MinRegion GLINT_TAG_ADDR(0x18,0x02)
-#define MaxRegion GLINT_TAG_ADDR(0x18,0x03)
-#define ResetPickResult GLINT_TAG_ADDR(0x18,0x04)
-#define MitHitRegion GLINT_TAG_ADDR(0x18,0x05)
-#define MaxHitRegion GLINT_TAG_ADDR(0x18,0x06)
-#define PickResult GLINT_TAG_ADDR(0x18,0x07)
-#define GlintSync GLINT_TAG_ADDR(0x18,0x08)
-
-#define FBBlockColorU GLINT_TAG_ADDR(0x18,0x0d)
-#define FBBlockColorL GLINT_TAG_ADDR(0x18,0x0e)
-#define SuspendUntilFrameBlank GLINT_TAG_ADDR(0x18,0x0f)
-
-#define KsRStart GLINT_TAG_ADDR(0x19,0x00)
-#define dKsRdx GLINT_TAG_ADDR(0x19,0x01)
-#define dKsRdyDom GLINT_TAG_ADDR(0x19,0x02)
-#define KsGStart GLINT_TAG_ADDR(0x19,0x03)
-#define dKsGdx GLINT_TAG_ADDR(0x19,0x04)
-#define dKsGdyDom GLINT_TAG_ADDR(0x19,0x05)
-#define KsBStart GLINT_TAG_ADDR(0x19,0x06)
-#define dKsBdx GLINT_TAG_ADDR(0x19,0x07)
-#define dKsBdyDom GLINT_TAG_ADDR(0x19,0x08)
-
-#define KdRStart GLINT_TAG_ADDR(0x1A,0x00)
-#define dKdRdx GLINT_TAG_ADDR(0x1A,0x01)
-#define dKdRdyDom GLINT_TAG_ADDR(0x1A,0x02)
-#define KdGStart GLINT_TAG_ADDR(0x1A,0x03)
-#define dKdGdx GLINT_TAG_ADDR(0x1A,0x04)
-#define dKdGdyDom GLINT_TAG_ADDR(0x1A,0x05)
-#define KdBStart GLINT_TAG_ADDR(0x1A,0x06)
-#define dKdBdx GLINT_TAG_ADDR(0x1A,0x07)
-#define dKdBdyDom GLINT_TAG_ADDR(0x1A,0x08)
-
-#define FBSourceBase GLINT_TAG_ADDR(0x1B,0x00)
-#define FBSourceDelta GLINT_TAG_ADDR(0x1B,0x01)
-#define Config GLINT_TAG_ADDR(0x1B,0x02)
-#define CFBRM_SrcEnable 1<<0
-#define CFBRM_DstEnable 1<<1
-#define CFBRM_Packed 1<<2
-#define CWM_Enable 1<<3
-#define CCDDA_Enable 1<<4
-#define CLogOp_Enable 1<<5
-#define ContextDump GLINT_TAG_ADDR(0x1B,0x08)
-#define ContextRestore GLINT_TAG_ADDR(0x1B,0x09)
-#define ContextData GLINT_TAG_ADDR(0x1B,0x0a)
-
-#define TexelLUT0 GLINT_TAG_ADDR(0x1D,0x00)
-#define TexelLUT1 GLINT_TAG_ADDR(0x1D,0x01)
-#define TexelLUT2 GLINT_TAG_ADDR(0x1D,0x02)
-#define TexelLUT3 GLINT_TAG_ADDR(0x1D,0x03)
-#define TexelLUT4 GLINT_TAG_ADDR(0x1D,0x04)
-#define TexelLUT5 GLINT_TAG_ADDR(0x1D,0x05)
-#define TexelLUT6 GLINT_TAG_ADDR(0x1D,0x06)
-#define TexelLUT7 GLINT_TAG_ADDR(0x1D,0x07)
-#define TexelLUT8 GLINT_TAG_ADDR(0x1D,0x08)
-#define TexelLUT9 GLINT_TAG_ADDR(0x1D,0x09)
-#define TexelLUT10 GLINT_TAG_ADDR(0x1D,0x0A)
-#define TexelLUT11 GLINT_TAG_ADDR(0x1D,0x0B)
-#define TexelLUT12 GLINT_TAG_ADDR(0x1D,0x0C)
-#define TexelLUT13 GLINT_TAG_ADDR(0x1D,0x0D)
-#define TexelLUT14 GLINT_TAG_ADDR(0x1D,0x0E)
-#define TexelLUT15 GLINT_TAG_ADDR(0x1D,0x0F)
-
-#define YUVMode GLINT_TAG_ADDR(0x1E,0x00)
-#define ChromaUpper GLINT_TAG_ADDR(0x1E,0x01)
-#define ChromaLower GLINT_TAG_ADDR(0x1E,0x02)
-#define ChromaTestMode GLINT_TAG_ADDR(0x1E,0x03)
-#define AlphaMapUpperBound GLINT_TAG_ADDR(0x1E,0x03) /* PM2 */
-#define AlphaMapLowerBound GLINT_TAG_ADDR(0x1E,0x04) /* PM2 */
-
-
-/******************************
- * GLINT Delta Core Registers *
- ******************************/
-
-#define V0FixedTag GLINT_TAG_ADDR(0x20,0x00)
-#define V1FixedTag GLINT_TAG_ADDR(0x21,0x00)
-#define V2FixedTag GLINT_TAG_ADDR(0x22,0x00)
-#define V0FloatTag GLINT_TAG_ADDR(0x23,0x00)
-#define V1FloatTag GLINT_TAG_ADDR(0x24,0x00)
-#define V2FloatTag GLINT_TAG_ADDR(0x25,0x00)
-
-#define VPAR_s 0x00
-#define VPAR_t 0x08
-#define VPAR_q 0x10
-#define VPAR_Ks 0x18
-#define VPAR_Kd 0x20
-
-/* have changed colors in ramdac !
-#define VPAR_R 0x28
-#define VPAR_G 0x30
-#define VPAR_B 0x38
-#define VPAR_A 0x40
-*/
-#define VPAR_B 0x28
-#define VPAR_G 0x30
-#define VPAR_R 0x38
-#define VPAR_A 0x40
-
-#define VPAR_f 0x48
-
-#define VPAR_x 0x50
-#define VPAR_y 0x58
-#define VPAR_z 0x60
-
-#define DeltaModeTag GLINT_TAG_ADDR(0x26,0x00)
- /* 0: */
- /* GLINT_300SX */
-
- /* DeltaMode Register Bit Field Assignments */
- #define DM_GLINT_300SX 0x0000
- #define DM_GLINT_500TX 0x0001
- #define DM_PERMEDIA 0x0002
- #define DM_Depth_16BPP (1 << 2)
- #define DM_Depth_24BPP (2 << 2)
- #define DM_Depth_32BPP (3 << 2)
- #define DM_FogEnable 0x0010
- #define DM_TextureEnable 0x0020
- #define DM_SmoothShadingEnable 0x0040
- #define DM_DepthEnable 0x0080
- #define DM_SpecularTextureEnable 0x0100
- #define DM_DiffuseTextureEnable 0x0200
- #define DM_SubPixelCorrectionEnable 0x0400
- #define DM_DiamondExit 0x0800
- #define DM_NoDraw 0x1000
- #define DM_ClampEnable 0x2000
- #define DM_ClampedTexParMode 0x4000
- #define DM_NormalizedTexParMode 0xC000
-
-
- #define DDCMD_AreaStrippleEnable 0x0001
- #define DDCMD_LineStrippleEnable 0x0002
- #define DDCMD_ResetLineStripple 1 << 2
- #define DDCMD_FastFillEnable 1 << 3
- /* 2 Bits reserved */
- #define DDCMD_PrimitiveType_Point 2 << 6
- #define DDCMD_PrimitiveType_Line 0 << 6
- #define DDCMD_PrimitiveType_Trapezoid 1 << 6
- #define DDCMD_AntialiasEnable 1 << 8
- #define DDCMD_AntialiasingQuality 1 << 9
- #define DDCMD_UsePointTable 1 << 10
- #define DDCMD_SyncOnBitMask 1 << 11
- #define DDCMD_SyncOnHostDate 1 << 12
- #define DDCMD_TextureEnable 1 << 13
- #define DDCMD_FogEnable 1 << 14
- #define DDCMD_CoverageEnable 1 << 15
- #define DDCMD_SubPixelCorrectionEnable 1 << 16
-
-
-
-#define DrawTriangle GLINT_TAG_ADDR(0x26,0x01)
-#define RepeatTriangle GLINT_TAG_ADDR(0x26,0x02)
-#define DrawLine01 GLINT_TAG_ADDR(0x26,0x03)
-#define DrawLine10 GLINT_TAG_ADDR(0x26,0x04)
-#define RepeatLine GLINT_TAG_ADDR(0x26,0x05)
-#define BroadcastMask GLINT_TAG_ADDR(0x26,0x0F)
-
-/* Permedia 3 - Accelerator Extensions */
-#define FillRectanglePosition 0x8348
-#define FillRender2D 0x8350
-#define FBDstReadBufAddr0 0xAE80
-#define FBDstReadBufOffset0 0xAEA0
-#define FBDstReadBufWidth0 0xAEC0
-#define FBDstReadMode 0xAEE0
-#define FBDRM_Enable0 1<<8
-#define FBDRM_Blocking 1<<24
-#define FBDstReadEnables 0xAEE8
-#define FBSrcReadMode 0xAF00
-#define FBSRM_Blocking 1<<11
-#define FBSrcReadBufAddr 0xAF08
-#define FBSrcReadBufOffset0 0xAF10
-#define FBSrcReadBufWidth 0xAF18
-#define FBWriteBufAddr0 0xB000
-#define FBWriteBufOffset0 0xB020
-#define FBWriteBufWidth0 0xB040
-#define FBBlockColorBack 0xB0A0
-#define ForegroundColor 0xB0C0
-#define BackgroundColor 0xB0C8
-#define RectanglePosition 0xB600
-#define Render2D 0xB640
-
-/* Colorformats */
-#define BGR555 1
-#define BGR565 16
-#define CI8 14
-#define CI4 15
-
-#ifdef DEBUG
-#define GLINT_WRITE_REG(v,r) \
- GLINT_VERB_WRITE_REG(pGlint,v,r,__FILE__,__LINE__)
-#define GLINT_READ_REG(r) \
- GLINT_VERB_READ_REG(pGlint,r,__FILE__,__LINE__)
-#else
-
-#define GLINT_WRITE_REG(v,r) \
- MMIO_OUT32(pGlint->IOBase + pGlint->IOOffset,(unsigned long)(r), (v))
-#define GLINT_READ_REG(r) \
- MMIO_IN32(pGlint->IOBase + pGlint->IOOffset,(unsigned long)(r))
-
-#endif /* DEBUG */
-
-#define GLINT_WAIT(n) \
-do{ \
- if (pGlint->InFifoSpace>=(n)) \
- pGlint->InFifoSpace -= (n); \
- else { \
- int tmp; \
- while((tmp=GLINT_READ_REG(InFIFOSpace))<(n)); \
- /* Clamp value due to bugs in PM3 */ \
- if (tmp > pGlint->FIFOSize) \
- tmp = pGlint->FIFOSize; \
- pGlint->InFifoSpace = tmp - (n); \
- } \
-}while(0)
-
-#define GLINTDACDelay(x) do { \
- int delay = x; \
- unsigned char tmp; \
- while(delay--){tmp = GLINT_READ_REG(InFIFOSpace);}; \
- } while(0)
-
-#define GLINT_MASK_WRITE_REG(v,m,r) \
- GLINT_WRITE_REG((GLINT_READ_REG(r)&(m))|(v),r)
-
-#define GLINT_SLOW_WRITE_REG(v,r) \
-do{ \
- mem_barrier(); \
- GLINT_WAIT(pGlint->FIFOSize); \
- mem_barrier(); \
- GLINT_WRITE_REG(v,r); \
-}while(0)
-
-#define GLINT_SET_INDEX(index) \
-do{ \
- GLINT_SLOW_WRITE_REG(((index)>>8)&0xff,PM2VDACIndexRegHigh); \
- GLINT_SLOW_WRITE_REG((index)&0xff,PM2VDACIndexRegLow); \
-} while(0)
-
-#define REPLICATE(r) \
-{ \
- if (pScrn->bitsPerPixel == 16) { \
- r &= 0xFFFF; \
- r |= (r<<16); \
- } else \
- if (pScrn->bitsPerPixel == 8) { \
- r &= 0xFF; \
- r |= (r<<8); \
- r |= (r<<16); \
- } \
-}
-
-#ifndef XF86DRI
-#define LOADROP(rop) \
-{ \
- if (pGlint->ROP != rop) { \
- GLINT_WRITE_REG(rop<<1|UNIT_ENABLE, LogicalOpMode); \
- pGlint->ROP = rop; \
- } \
-}
-#else
-#define LOADROP(rop) \
- { \
- GLINT_WRITE_REG(rop<<1|UNIT_ENABLE, LogicalOpMode); \
- pGlint->ROP = rop; \
- }
-#endif
-
-#define CHECKCLIPPING \
-{ \
- if (pGlint->ClippingOn) { \
- pGlint->ClippingOn = FALSE; \
- GLINT_WAIT(1); \
- GLINT_WRITE_REG(0, ScissorMode); \
- } \
-}
-
-#ifndef XF86DRI
-#define DO_PLANEMASK(planemask) \
-{ \
- if (planemask != pGlint->planemask) { \
- pGlint->planemask = planemask; \
- REPLICATE(planemask); \
- GLINT_WRITE_REG(planemask, FBHardwareWriteMask);\
- } \
-}
-#else
-#define DO_PLANEMASK(planemask) \
- { \
- pGlint->planemask = planemask; \
- REPLICATE(planemask); \
- GLINT_WRITE_REG(planemask, FBHardwareWriteMask);\
- }
-#endif
-
-/* Permedia Save/Restore functions */
-
-#define STOREREG(address,value) \
- pReg->glintRegs[address >> 3] = value;
-
-#define SAVEREG(address) \
- pReg->glintRegs[address >> 3] = GLINT_READ_REG(address);
-
-#define RESTOREREG(address) \
- GLINT_SLOW_WRITE_REG(pReg->glintRegs[address >> 3], address);
-
-#define STOREDAC(address,value) \
- pReg->DacRegs[address] = value;
-
-#define P2VOUT(address) \
- Permedia2vOutIndReg(pScrn, address, 0x00, pReg->DacRegs[address]);
-
-#define P2VIN(address) \
- pReg->DacRegs[address] = Permedia2vInIndReg(pScrn, address);
-
-/* RamDac Save/Restore functions, used by external DAC's */
-
-#define STORERAMDAC(address,value) \
- ramdacReg->DacRegs[address] = value;
-
-/* Multi Chip access */
-
-#define ACCESSCHIP1() \
- pGlint->IOOffset = 0;
-
-#define ACCESSCHIP2() \
- pGlint->IOOffset = 0x10000;
-
-#endif
diff --git a/src/video_out/vidix/drivers/mach64.h b/src/video_out/vidix/drivers/mach64.h
deleted file mode 100644
index 807efdb8d..000000000
--- a/src/video_out/vidix/drivers/mach64.h
+++ /dev/null
@@ -1,2611 +0,0 @@
-/*
- * mach64.h
- * This software has been released under the terms of the GNU Public
- * license. See http://www.gnu.org/copyleft/gpl.html for details.
- *
- * It's based on radeonfb, X11, GATOS sources
-*/
-
-#ifndef __MACH64_INCLUDED
-#define __MACH64_INCLUDED 1
-
-/* Note: this model of accessing to IO space is based on MMIO technology.
-This means that this sources don't support ISA and VLB cards */
-#define BlockIOTag(val) (val)
-#define IOPortTag(sparce,val) (val)
-
-/* MDA/[M]CGA/EGA/VGA I/O ports */
-#define GENVS 0x0102u /* Write (and Read on uC only) */
-
-#define R_GENLPS 0x03b9u /* Read */
-
-#define GENHP 0x03bfu
-
-#define ATTRX 0x03c0u
-#define ATTRD 0x03c1u
-#define GENS0 0x03c2u /* Read */
-#define GENMO 0x03c2u /* Write */
-#define GENENB 0x03c3u /* Read */
-#define SEQX 0x03c4u
-#define SEQD 0x03c5u
-#define VGA_DAC_MASK 0x03c6u
-#define VGA_DAC_READ 0x03c7u
-#define VGA_DAC_WRITE 0x03c8u
-#define VGA_DAC_DATA 0x03c9u
-#define R_GENFC 0x03cau /* Read */
-/* ? 0x03cbu */
-#define R_GENMO 0x03ccu /* Read */
-/* ? 0x03cdu */
-#define GRAX 0x03ceu
-#define GRAD 0x03cfu
-
-#define GENB 0x03d9u
-
-#define GENLPS 0x03dcu /* Write */
-#define KCX 0x03ddu
-#define KCD 0x03deu
-
-#define GENENA 0x46e8u /* Write */
-
-/* I/O port base numbers */
-#define MonochromeIOBase 0x03b0u
-#define ColourIOBase 0x03d0u
-
-/* Other MDA/[M]CGA/EGA/VGA I/O ports */
-/* ?(_IOBase) ((_IOBase) + 0x00u) */ /* CRTX synonym */
-/* ?(_IOBase) ((_IOBase) + 0x01u) */ /* CRTD synonym */
-/* ?(_IOBase) ((_IOBase) + 0x02u) */ /* CRTX synonym */
-/* ?(_IOBase) ((_IOBase) + 0x03u) */ /* CRTD synonym */
-#define CRTX(_IOBase) ((_IOBase) + 0x04u)
-#define CRTD(_IOBase) ((_IOBase) + 0x05u)
-/* ?(_IOBase) ((_IOBase) + 0x06u) */
-/* ?(_IOBase) ((_IOBase) + 0x07u) */
-#define GENMC(_IOBase) ((_IOBase) + 0x08u)
-/* ?(_IOBase) ((_IOBase) + 0x09u) */ /* R_GENLPS/GENB */
-#define GENS1(_IOBase) ((_IOBase) + 0x0au) /* Read */
-#define GENFC(_IOBase) ((_IOBase) + 0x0au) /* Write */
-#define GENLPC(_IOBase) ((_IOBase) + 0x0bu)
-/* ?(_IOBase) ((_IOBase) + 0x0cu) */ /* /GENLPS */
-/* ?(_IOBase) ((_IOBase) + 0x0du) */ /* /KCX */
-/* ?(_IOBase) ((_IOBase) + 0x0eu) */ /* /KCD */
-/* ?(_IOBase) ((_IOBase) + 0x0fu) */ /* GENHP/ */
-
-/* 8514/A VESA approved register definitions */
-#define DISP_STAT 0x02e8u /* Read */
-#define SENSE 0x0001u /* Presumably belong here */
-#define VBLANK 0x0002u
-#define HORTOG 0x0004u
-#define H_TOTAL 0x02e8u /* Write */
-#define IBM_DAC_MASK 0x02eau
-#define IBM_DAC_READ 0x02ebu
-#define IBM_DAC_WRITE 0x02ecu
-#define IBM_DAC_DATA 0x02edu
-#define H_DISP 0x06e8u /* Write */
-#define H_SYNC_STRT 0x0ae8u /* Write */
-#define H_SYNC_WID 0x0ee8u /* Write */
-#define HSYNCPOL_POS 0x0000u
-#define HSYNCPOL_NEG 0x0020u
-#define H_POLARITY_POS HSYNCPOL_POS /* Sigh */
-#define H_POLARITY_NEG HSYNCPOL_NEG /* Sigh */
-#define V_TOTAL 0x12e8u /* Write */
-#define V_DISP 0x16e8u /* Write */
-#define V_SYNC_STRT 0x1ae8u /* Write */
-#define V_SYNC_WID 0x1ee8u /* Write */
-#define VSYNCPOL_POS 0x0000u
-#define VSYNCPOL_NEG 0x0020u
-#define V_POLARITY_POS VSYNCPOL_POS /* Sigh */
-#define V_POLARITY_NEG VSYNCPOL_NEG /* Sigh */
-#define DISP_CNTL 0x22e8u /* Write */
-#define ODDBNKENAB 0x0001u
-#define MEMCFG_2 0x0000u
-#define MEMCFG_4 0x0002u
-#define MEMCFG_6 0x0004u
-#define MEMCFG_8 0x0006u
-#define DBLSCAN 0x0008u
-#define INTERLACE 0x0010u
-#define DISPEN_NC 0x0000u
-#define DISPEN_ENAB 0x0020u
-#define DISPEN_DISAB 0x0040u
-#define R_H_TOTAL 0x26e8u /* Read */
-/* ? 0x2ae8u */
-/* ? 0x2ee8u */
-/* ? 0x32e8u */
-/* ? 0x36e8u */
-/* ? 0x3ae8u */
-/* ? 0x3ee8u */
-#define SUBSYS_STAT 0x42e8u /* Read */
-#define VBLNKFLG 0x0001u
-#define PICKFLAG 0x0002u
-#define INVALIDIO 0x0004u
-#define GPIDLE 0x0008u
-#define MONITORID_MASK 0x0070u
-/* MONITORID_? 0x0000u */
-#define MONITORID_8507 0x0010u
-#define MONITORID_8514 0x0020u
-/* MONITORID_? 0x0030u */
-/* MONITORID_? 0x0040u */
-#define MONITORID_8503 0x0050u
-#define MONITORID_8512 0x0060u
-#define MONITORID_8513 0x0060u
-#define MONITORID_NONE 0x0070u
-#define _8PLANE 0x0080u
-#define SUBSYS_CNTL 0x42e8u /* Write */
-#define RVBLNKFLG 0x0001u
-#define RPICKFLAG 0x0002u
-#define RINVALIDIO 0x0004u
-#define RGPIDLE 0x0008u
-#define IVBLNKFLG 0x0100u
-#define IPICKFLAG 0x0200u
-#define IINVALIDIO 0x0400u
-#define IGPIDLE 0x0800u
-#define CHPTEST_NC 0x0000u
-#define CHPTEST_NORMAL 0x1000u
-#define CHPTEST_ENAB 0x2000u
-#define GPCTRL_NC 0x0000u
-#define GPCTRL_ENAB 0x4000u
-#define GPCTRL_RESET 0x8000u
-#define ROM_PAGE_SEL 0x46e8u /* Write */
-#define ADVFUNC_CNTL 0x4ae8u /* Write */
-#define DISABPASSTHRU 0x0001u
-#define CLOKSEL 0x0004u
-/* ? 0x4ee8u */
-#define EXT_CONFIG_0 0x52e8u /* C & T 82C480 */
-#define EXT_CONFIG_1 0x56e8u /* C & T 82C480 */
-#define EXT_CONFIG_2 0x5ae8u /* C & T 82C480 */
-#define EXT_CONFIG_3 0x5ee8u /* C & T 82C480 */
-/* ? 0x62e8u */
-/* ? 0x66e8u */
-/* ? 0x6ae8u */
-/* ? 0x6ee8u */
-/* ? 0x72e8u */
-/* ? 0x76e8u */
-/* ? 0x7ae8u */
-/* ? 0x7ee8u */
-#define CUR_Y 0x82e8u
-#define CUR_X 0x86e8u
-#define DESTY_AXSTP 0x8ae8u /* Write */
-#define DESTX_DIASTP 0x8ee8u /* Write */
-#define ERR_TERM 0x92e8u
-#define MAJ_AXIS_PCNT 0x96e8u /* Write */
-#define GP_STAT 0x9ae8u /* Read */
-#define GE_STAT 0x9ae8u /* Alias */
-#define DATARDY 0x0100u
-#define DATA_READY DATARDY /* Alias */
-#define GPBUSY 0x0200u
-#define CMD 0x9ae8u /* Write */
-#define WRTDATA 0x0001u
-#define PLANAR 0x0002u
-#define LASTPIX 0x0004u
-#define LINETYPE 0x0008u
-#define DRAW 0x0010u
-#define INC_X 0x0020u
-#define YMAJAXIS 0x0040u
-#define INC_Y 0x0080u
-#define PCDATA 0x0100u
-#define _16BIT 0x0200u
-#define CMD_NOP 0x0000u
-#define CMD_OP_MSK 0xf000u
-#define BYTSEQ 0x1000u
-#define CMD_LINE 0x2000u
-#define CMD_RECT 0x4000u
-#define CMD_RECTV1 0x6000u
-#define CMD_RECTV2 0x8000u
-#define CMD_LINEAF 0xa000u
-#define CMD_BITBLT 0xc000u
-#define SHORT_STROKE 0x9ee8u /* Write */
-#define SSVDRAW 0x0010u
-#define VECDIR_000 0x0000u
-#define VECDIR_045 0x0020u
-#define VECDIR_090 0x0040u
-#define VECDIR_135 0x0060u
-#define VECDIR_180 0x0080u
-#define VECDIR_225 0x00a0u
-#define VECDIR_270 0x00c0u
-#define VECDIR_315 0x00e0u
-#define BKGD_COLOR 0xa2e8u /* Write */
-#define FRGD_COLOR 0xa6e8u /* Write */
-#define WRT_MASK 0xaae8u /* Write */
-#define RD_MASK 0xaee8u /* Write */
-#define COLOR_CMP 0xb2e8u /* Write */
-#define BKGD_MIX 0xb6e8u /* Write */
-/* 0x001fu See MIX_* definitions below */
-#define BSS_BKGDCOL 0x0000u
-#define BSS_FRGDCOL 0x0020u
-#define BSS_PCDATA 0x0040u
-#define BSS_BITBLT 0x0060u
-#define FRGD_MIX 0xbae8u /* Write */
-/* 0x001fu See MIX_* definitions below */
-#define FSS_BKGDCOL 0x0000u
-#define FSS_FRGDCOL 0x0020u
-#define FSS_PCDATA 0x0040u
-#define FSS_BITBLT 0x0060u
-#define MULTIFUNC_CNTL 0xbee8u /* Write */
-#define MIN_AXIS_PCNT 0x0000u
-#define SCISSORS_T 0x1000u
-#define SCISSORS_L 0x2000u
-#define SCISSORS_B 0x3000u
-#define SCISSORS_R 0x4000u
-#define M32_MEM_CNTL 0x5000u
-#define HORCFG_4 0x0000u
-#define HORCFG_5 0x0001u
-#define HORCFG_8 0x0002u
-#define HORCFG_10 0x0003u
-#define VRTCFG_2 0x0000u
-#define VRTCFG_4 0x0004u
-#define VRTCFG_6 0x0008u
-#define VRTCFG_8 0x000cu
-#define BUFSWP 0x0010u
-#define PATTERN_L 0x8000u
-#define PATTERN_H 0x9000u
-#define PIX_CNTL 0xa000u
-#define PLANEMODE 0x0004u
-#define COLCMPOP_F 0x0000u
-#define COLCMPOP_T 0x0008u
-#define COLCMPOP_GE 0x0010u
-#define COLCMPOP_LT 0x0018u
-#define COLCMPOP_NE 0x0020u
-#define COLCMPOP_EQ 0x0028u
-#define COLCMPOP_LE 0x0030u
-#define COLCMPOP_GT 0x0038u
-#define MIXSEL_FRGDMIX 0x0000u
-#define MIXSEL_PATT 0x0040u
-#define MIXSEL_EXPPC 0x0080u
-#define MIXSEL_EXPBLT 0x00c0u
-/* ? 0xc2e8u */
-/* ? 0xc6e8u */
-/* ? 0xcae8u */
-/* ? 0xcee8u */
-/* ? 0xd2e8u */
-/* ? 0xd6e8u */
-/* ? 0xdae8u */
-/* ? 0xdee8u */
-#define PIX_TRANS 0xe2e8u
-/* ? 0xe6e8u */
-/* ? 0xeae8u */
-/* ? 0xeee8u */
-/* ? 0xf2e8u */
-/* ? 0xf6e8u */
-/* ? 0xfae8u */
-/* ? 0xfee8u */
-
-/* ATI Mach8 & Mach32 register definitions */
-#define OVERSCAN_COLOR_8 0x02eeu /* Write */ /* Mach32 */
-#define OVERSCAN_BLUE_24 0x02efu /* Write */ /* Mach32 */
-#define OVERSCAN_GREEN_24 0x06eeu /* Write */ /* Mach32 */
-#define OVERSCAN_RED_24 0x06efu /* Write */ /* Mach32 */
-#define CURSOR_OFFSET_LO 0x0aeeu /* Write */ /* Mach32 */
-#define CURSOR_OFFSET_HI 0x0eeeu /* Write */ /* Mach32 */
-#define CONFIG_STATUS_1 0x12eeu /* Read */
-#define CLK_MODE 0x0001u /* Mach8 */
-#define BUS_16 0x0002u /* Mach8 */
-#define MC_BUS 0x0004u /* Mach8 */
-#define EEPROM_ENA 0x0008u /* Mach8 */
-#define DRAM_ENA 0x0010u /* Mach8 */
-#define MEM_INSTALLED 0x0060u /* Mach8 */
-#define ROM_ENA 0x0080u /* Mach8 */
-#define ROM_PAGE_ENA 0x0100u /* Mach8 */
-#define ROM_LOCATION 0xfe00u /* Mach8 */
-#define _8514_ONLY 0x0001u /* Mach32 */
-#define BUS_TYPE 0x000eu /* Mach32 */
-#define ISA_16_BIT 0x0000u /* Mach32 */
-#define EISA 0x0002u /* Mach32 */
-#define MICRO_C_16_BIT 0x0004u /* Mach32 */
-#define MICRO_C_8_BIT 0x0006u /* Mach32 */
-#define LOCAL_386SX 0x0008u /* Mach32 */
-#define LOCAL_386DX 0x000au /* Mach32 */
-#define LOCAL_486 0x000cu /* Mach32 */
-#define PCI 0x000eu /* Mach32 */
-#define MEM_TYPE 0x0070u /* Mach32 */
-#define CHIP_DIS 0x0080u /* Mach32 */
-#define TST_VCTR_ENA 0x0100u /* Mach32 */
-#define DACTYPE 0x0e00u /* Mach32 */
-#define MC_ADR_DECODE 0x1000u /* Mach32 */
-#define CARD_ID 0xe000u /* Mach32 */
-#define HORZ_CURSOR_POSN 0x12eeu /* Write */ /* Mach32 */
-#define CONFIG_STATUS_2 0x16eeu /* Read */
-#define SHARE_CLOCK 0x0001u /* Mach8 */
-#define HIRES_BOOT 0x0002u /* Mach8 */
-#define EPROM_16_ENA 0x0004u /* Mach8 */
-#define WRITE_PER_BIT 0x0008u /* Mach8 */
-#define FLASH_ENA 0x0010u /* Mach8 */
-#define SLOW_SEQ_EN 0x0001u /* Mach32 */
-#define MEM_ADDR_DIS 0x0002u /* Mach32 */
-#define ISA_16_ENA 0x0004u /* Mach32 */
-#define KOR_TXT_MODE_ENA 0x0008u /* Mach32 */
-#define LOCAL_BUS_SUPPORT 0x0030u /* Mach32 */
-#define LOCAL_BUS_CONFIG_2 0x0040u /* Mach32 */
-#define LOCAL_BUS_RD_DLY_ENA 0x0080u /* Mach32 */
-#define LOCAL_DAC_EN 0x0100u /* Mach32 */
-#define LOCAL_RDY_EN 0x0200u /* Mach32 */
-#define EEPROM_ADR_SEL 0x0400u /* Mach32 */
-#define GE_STRAP_SEL 0x0800u /* Mach32 */
-#define VESA_RDY 0x1000u /* Mach32 */
-#define Z4GB 0x2000u /* Mach32 */
-#define LOC2_MDRAM 0x4000u /* Mach32 */
-#define VERT_CURSOR_POSN 0x16eeu /* Write */ /* Mach32 */
-#define FIFO_TEST_DATA 0x1aeeu /* Read */ /* Mach32 */
-#define CURSOR_COLOR_0 0x1aeeu /* Write */ /* Mach32 */
-#define CURSOR_COLOR_1 0x1aefu /* Write */ /* Mach32 */
-#define HORZ_CURSOR_OFFSET 0x1eeeu /* Write */ /* Mach32 */
-#define VERT_CURSOR_OFFSET 0x1eefu /* Write */ /* Mach32 */
-#define PCI_CNTL 0x22eeu /* Mach32-PCI */
-#define CRT_PITCH 0x26eeu /* Write */
-#define CRT_OFFSET_LO 0x2aeeu /* Write */
-#define CRT_OFFSET_HI 0x2eeeu /* Write */
-#define LOCAL_CNTL 0x32eeu /* Mach32 */
-#define FIFO_OPT 0x36eeu /* Write */ /* Mach8 */
-#define MISC_OPTIONS 0x36eeu /* Mach32 */
-#define W_STATE_ENA 0x0000u /* Mach32 */
-#define HOST_8_ENA 0x0001u /* Mach32 */
-#define MEM_SIZE_ALIAS 0x000cu /* Mach32 */
-#define MEM_SIZE_512K 0x0000u /* Mach32 */
-#define MEM_SIZE_1M 0x0004u /* Mach32 */
-#define MEM_SIZE_2M 0x0008u /* Mach32 */
-#define MEM_SIZE_4M 0x000cu /* Mach32 */
-#define DISABLE_VGA 0x0010u /* Mach32 */
-#define _16_BIT_IO 0x0020u /* Mach32 */
-#define DISABLE_DAC 0x0040u /* Mach32 */
-#define DLY_LATCH_ENA 0x0080u /* Mach32 */
-#define TEST_MODE 0x0100u /* Mach32 */
-#define BLK_WR_ENA 0x0400u /* Mach32 */
-#define _64_DRAW_ENA 0x0800u /* Mach32 */
-#define FIFO_TEST_TAG 0x3aeeu /* Read */ /* Mach32 */
-#define EXT_CURSOR_COLOR_0 0x3aeeu /* Write */ /* Mach32 */
-#define EXT_CURSOR_COLOR_1 0x3eeeu /* Write */ /* Mach32 */
-#define MEM_BNDRY 0x42eeu /* Mach32 */
-#define MEM_PAGE_BNDRY 0x000fu /* Mach32 */
-#define MEM_BNDRY_ENA 0x0010u /* Mach32 */
-#define SHADOW_CTL 0x46eeu /* Write */
-#define CLOCK_SEL 0x4aeeu
-/* DISABPASSTHRU 0x0001u See ADVFUNC_CNTL */
-#define VFIFO_DEPTH_1 0x0100u /* Mach32 */
-#define VFIFO_DEPTH_2 0x0200u /* Mach32 */
-#define VFIFO_DEPTH_3 0x0300u /* Mach32 */
-#define VFIFO_DEPTH_4 0x0400u /* Mach32 */
-#define VFIFO_DEPTH_5 0x0500u /* Mach32 */
-#define VFIFO_DEPTH_6 0x0600u /* Mach32 */
-#define VFIFO_DEPTH_7 0x0700u /* Mach32 */
-#define VFIFO_DEPTH_8 0x0800u /* Mach32 */
-#define VFIFO_DEPTH_9 0x0900u /* Mach32 */
-#define VFIFO_DEPTH_A 0x0a00u /* Mach32 */
-#define VFIFO_DEPTH_B 0x0b00u /* Mach32 */
-#define VFIFO_DEPTH_C 0x0c00u /* Mach32 */
-#define VFIFO_DEPTH_D 0x0d00u /* Mach32 */
-#define VFIFO_DEPTH_E 0x0e00u /* Mach32 */
-#define VFIFO_DEPTH_F 0x0f00u /* Mach32 */
-#define COMPOSITE_SYNC 0x1000u
-/* ? 0x4eeeu */
-#define ROM_ADDR_1 0x52eeu
-#define BIOS_BASE_SEGMENT 0x007fu /* Mach32 */
-/* ? 0xff80u */ /* Mach32 */
-#define ROM_ADDR_2 0x56eeu /* Sick ... */
-#define SHADOW_SET 0x5aeeu /* Write */
-#define MEM_CFG 0x5eeeu /* Mach32 */
-#define MEM_APERT_SEL 0x0003u /* Mach32 */
-#define MEM_APERT_PAGE 0x000cu /* Mach32 */
-#define MEM_APERT_LOC 0xfff0u /* Mach32 */
-#define EXT_GE_STATUS 0x62eeu /* Read */ /* Mach32 */
-#define HORZ_OVERSCAN 0x62eeu /* Write */ /* Mach32 */
-#define VERT_OVERSCAN 0x66eeu /* Write */ /* Mach32 */
-#define MAX_WAITSTATES 0x6aeeu
-#define GE_OFFSET_LO 0x6eeeu /* Write */
-#define BOUNDS_LEFT 0x72eeu /* Read */
-#define GE_OFFSET_HI 0x72eeu /* Write */
-#define BOUNDS_TOP 0x76eeu /* Read */
-#define GE_PITCH 0x76eeu /* Write */
-#define BOUNDS_RIGHT 0x7aeeu /* Read */
-#define EXT_GE_CONFIG 0x7aeeu /* Write */ /* Mach32 */
-#define MONITOR_ALIAS 0x0007u /* Mach32 */
-/* MONITOR_? 0x0000u */ /* Mach32 */
-#define MONITOR_8507 0x0001u /* Mach32 */
-#define MONITOR_8514 0x0002u /* Mach32 */
-/* MONITOR_? 0x0003u */ /* Mach32 */
-/* MONITOR_? 0x0004u */ /* Mach32 */
-#define MONITOR_8503 0x0005u /* Mach32 */
-#define MONITOR_8512 0x0006u /* Mach32 */
-#define MONITOR_8513 0x0006u /* Mach32 */
-#define MONITOR_NONE 0x0007u /* Mach32 */
-#define ALIAS_ENA 0x0008u /* Mach32 */
-#define PIXEL_WIDTH_4 0x0000u /* Mach32 */
-#define PIXEL_WIDTH_8 0x0010u /* Mach32 */
-#define PIXEL_WIDTH_16 0x0020u /* Mach32 */
-#define PIXEL_WIDTH_24 0x0030u /* Mach32 */
-#define RGB16_555 0x0000u /* Mach32 */
-#define RGB16_565 0x0040u /* Mach32 */
-#define RGB16_655 0x0080u /* Mach32 */
-#define RGB16_664 0x00c0u /* Mach32 */
-#define MULTIPLEX_PIXELS 0x0100u /* Mach32 */
-#define RGB24 0x0000u /* Mach32 */
-#define RGBx24 0x0200u /* Mach32 */
-#define BGR24 0x0400u /* Mach32 */
-#define xBGR24 0x0600u /* Mach32 */
-#define DAC_8_BIT_EN 0x4000u /* Mach32 */
-#define ORDER_16BPP_565 RGB16_565 /* Mach32 */
-#define BOUNDS_BOTTOM 0x7eeeu /* Read */
-#define MISC_CNTL 0x7eeeu /* Write */ /* Mach32 */
-#define PATT_DATA_INDEX 0x82eeu
-/* ? 0x86eeu */
-/* ? 0x8aeeu */
-#define R_EXT_GE_CONFIG 0x8eeeu /* Read */ /* Mach32 */
-#define PATT_DATA 0x8eeeu /* Write */
-#define R_MISC_CNTL 0x92eeu /* Read */ /* Mach32 */
-#define BRES_COUNT 0x96eeu
-#define EXT_FIFO_STATUS 0x9aeeu /* Read */
-#define LINEDRAW_INDEX 0x9aeeu /* Write */
-/* ? 0x9eeeu */
-#define LINEDRAW_OPT 0xa2eeu
-#define BOUNDS_RESET 0x0100u
-#define CLIP_MODE_0 0x0000u /* Clip exception disabled */
-#define CLIP_MODE_1 0x0200u /* Line segments */
-#define CLIP_MODE_2 0x0400u /* Polygon boundary lines */
-#define CLIP_MODE_3 0x0600u /* Patterned lines */
-#define DEST_X_START 0xa6eeu /* Write */
-#define DEST_X_END 0xaaeeu /* Write */
-#define DEST_Y_END 0xaeeeu /* Write */
-#define R_H_TOTAL_DISP 0xb2eeu /* Read */ /* Mach32 */
-#define SRC_X_STRT 0xb2eeu /* Write */
-#define R_H_SYNC_STRT 0xb6eeu /* Read */ /* Mach32 */
-#define ALU_BG_FN 0xb6eeu /* Write */
-#define R_H_SYNC_WID 0xbaeeu /* Read */ /* Mach32 */
-#define ALU_FG_FN 0xbaeeu /* Write */
-#define SRC_X_END 0xbeeeu /* Write */
-#define R_V_TOTAL 0xc2eeu /* Read */
-#define SRC_Y_DIR 0xc2eeu /* Write */
-#define R_V_DISP 0xc6eeu /* Read */ /* Mach32 */
-#define EXT_SHORT_STROKE 0xc6eeu /* Write */
-#define R_V_SYNC_STRT 0xcaeeu /* Read */ /* Mach32 */
-#define SCAN_X 0xcaeeu /* Write */
-#define VERT_LINE_CNTR 0xceeeu /* Read */ /* Mach32 */
-#define DP_CONFIG 0xceeeu /* Write */
-#define READ_WRITE 0x0001u
-#define DATA_WIDTH 0x0200u
-#define DATA_ORDER 0x1000u
-#define FG_COLOR_SRC_FG 0x2000u
-#define FG_COLOR_SRC_BLIT 0x6000u
-#define R_V_SYNC_WID 0xd2eeu /* Read */
-#define PATT_LENGTH 0xd2eeu /* Write */
-#define PATT_INDEX 0xd6eeu /* Write */
-#define READ_SRC_X 0xdaeeu /* Read */ /* Mach32 */
-#define EXT_SCISSOR_L 0xdaeeu /* Write */
-#define READ_SRC_Y 0xdeeeu /* Read */ /* Mach32 */
-#define EXT_SCISSOR_T 0xdeeeu /* Write */
-#define EXT_SCISSOR_R 0xe2eeu /* Write */
-#define EXT_SCISSOR_B 0xe6eeu /* Write */
-/* ? 0xeaeeu */
-#define DEST_COMP_FN 0xeeeeu /* Write */
-#define DEST_COLOR_CMP_MASK 0xf2eeu /* Write */ /* Mach32 */
-/* ? 0xf6eeu */
-#define CHIP_ID 0xfaeeu /* Read */ /* Mach32 */
-#define CHIP_CODE_0 0x001fu /* Mach32 */
-#define CHIP_CODE_1 0x03e0u /* Mach32 */
-#define CHIP_CLASS 0x0c00u /* Mach32 */
-#define CHIP_REV 0xf000u /* Mach32 */
-#define LINEDRAW 0xfeeeu /* Write */
-
-/* ATI Mach64 register definitions */
-#define CRTC_H_TOTAL_DISP IOPortTag(0x00u, 0x00u)
-# define CRTC_H_TOTAL 0x000001fful
-/* ? 0x0000fe00ul */
-# define CRTC_H_DISP 0x01ff0000ul
-/* ? 0xfe000000ul */
-#define CRTC_H_SYNC_STRT_WID IOPortTag(0x01u, 0x01u)
-# define CRTC_H_SYNC_STRT 0x000000fful
-# define CRTC_H_SYNC_DLY 0x00000700ul
-/* ? 0x00000800ul */
-# define CRTC_H_SYNC_STRT_HI 0x00001000ul
-/* ? 0x0000e000ul */
-# define CRTC_H_SYNC_WID 0x001f0000ul
-# define CRTC_H_SYNC_POL 0x00200000ul
-/* ? 0xffc00000ul */
-#define CRTC_V_TOTAL_DISP IOPortTag(0x02u, 0x02u)
-# define CRTC_V_TOTAL 0x000007fful
-/* ? 0x0000f800ul */
-# define CRTC_V_DISP 0x07ff0000ul
-/* ? 0xf8000000ul */
-#define CRTC_V_SYNC_STRT_WID IOPortTag(0x03u, 0x03u)
-# define CRTC_V_SYNC_STRT 0x000007fful
-/* ? 0x0000f800ul */
-# define CRTC_V_SYNC_WID 0x001f0000ul
-# define CRTC_V_SYNC_POL 0x00200000ul
-/* ? 0xffc00000ul */
-#define CRTC_VLINE_CRNT_VLINE IOPortTag(0x04u, 0x04u)
-#define CRTC_VLINE 0x000007fful
-/* ? 0x0000f800ul */
-#define CRTC_CRNT_VLINE 0x07ff0000ul
-/* ? 0xf8000000ul */
-#define CRTC_OFF_PITCH IOPortTag(0x05u, 0x05u)
-# define CRTC_OFFSET 0x000ffffful
-# define CRTC_OFFSET_VGA 0x0003fffful
-# define CRTC_OFFSET_LOCK 0x00100000ul /* XC/XL */
-/* ? 0x00200000ul */
-# define CRTC_PITCH 0xffc00000ul
-#define CRTC_INT_CNTL IOPortTag(0x06u, 0x06u)
-# define CRTC_VBLANK 0x00000001ul
-# define CRTC_VBLANK_INT_EN 0x00000002ul
-# define CRTC_VBLANK_INT 0x00000004ul
-# define CRTC_VLINE_INT_EN 0x00000008ul
-# define CRTC_VLINE_INT 0x00000010ul
-# define CRTC_VLINE_SYNC 0x00000020ul
-# define CRTC_FRAME 0x00000040ul
-# define CRTC_SNAPSHOT_INT_EN 0x00000080ul /* GTPro */
-# define CRTC_SNAPSHOT_INT 0x00000100ul /* GTPro */
-# define CRTC_I2C_INT_EN 0x00000200ul /* GTPro */
-# define CRTC_I2C_INT 0x00000400ul /* GTPro */
-# define CRTC2_VBLANK 0x00000800ul /* LTPro */
-# define CRTC2_VBLANK_INT_EN 0x00001000ul /* LTPro */
-# define CRTC2_VBLANK_INT 0x00002000ul /* LTPro */
-# define CRTC2_VLINE_INT_EN 0x00004000ul /* LTPro */
-# define CRTC2_VLINE_INT 0x00008000ul /* LTPro */
-# define CRTC_CAPBUF0_INT_EN 0x00010000ul /* VT/GT */
-# define CRTC_CAPBUF0_INT 0x00020000ul /* VT/GT */
-# define CRTC_CAPBUF1_INT_EN 0x00040000ul /* VT/GT */
-# define CRTC_CAPBUF1_INT 0x00080000ul /* VT/GT */
-# define CRTC_OVERLAY_EOF_INT_EN 0x00100000ul /* VT/GT */
-# define CRTC_OVERLAY_EOF_INT 0x00200000ul /* VT/GT */
-# define CRTC_ONESHOT_CAP_INT_EN 0x00400000ul /* VT/GT */
-# define CRTC_ONESHOT_CAP_INT 0x00800000ul /* VT/GT */
-# define CRTC_BUSMASTER_EOL_INT_EN 0x01000000ul /* VTB/GTB/LT */
-# define CRTC_BUSMASTER_EOL_INT 0x02000000ul /* VTB/GTB/LT */
-# define CRTC_GP_INT_EN 0x04000000ul /* VTB/GTB/LT */
-# define CRTC_GP_INT 0x08000000ul /* VTB/GTB/LT */
-# define CRTC2_VLINE_SYNC 0x10000000ul /* LTPro */
-# define CRTC_SNAPSHOT2_INT_EN 0x20000000ul /* LTPro */
-# define CRTC_SNAPSHOT2_INT 0x40000000ul /* LTPro */
-# define CRTC_VBLANK_BIT2_INT 0x80000000ul /* GTPro */
-# define CRTC_INT_ENS /* *** UPDATE ME *** */ \
- ( \
- CRTC_VBLANK_INT_EN | \
- CRTC_VLINE_INT_EN | \
- CRTC_SNAPSHOT_INT_EN | \
- CRTC_I2C_INT_EN | \
- CRTC2_VBLANK_INT_EN | \
- CRTC2_VLINE_INT_EN | \
- CRTC_CAPBUF0_INT_EN | \
- CRTC_CAPBUF1_INT_EN | \
- CRTC_OVERLAY_EOF_INT_EN | \
- CRTC_ONESHOT_CAP_INT_EN | \
- CRTC_BUSMASTER_EOL_INT_EN | \
- CRTC_GP_INT_EN | \
- CRTC_SNAPSHOT2_INT_EN | \
- 0 \
- )
-# define CRTC_INT_ACKS /* *** UPDATE ME *** */ \
- ( \
- CRTC_VBLANK_INT | \
- CRTC_VLINE_INT | \
- CRTC_SNAPSHOT_INT | \
- CRTC_I2C_INT | \
- CRTC2_VBLANK_INT | \
- CRTC2_VLINE_INT | \
- CRTC_CAPBUF0_INT | \
- CRTC_CAPBUF1_INT | \
- CRTC_OVERLAY_EOF_INT | \
- CRTC_ONESHOT_CAP_INT | \
- CRTC_BUSMASTER_EOL_INT | \
- CRTC_GP_INT | \
- CRTC_SNAPSHOT2_INT | \
- CRTC_VBLANK_BIT2_INT | \
- 0 \
- )
-#define CRTC_GEN_CNTL IOPortTag(0x07u, 0x07u)
-# define CRTC_DBL_SCAN_EN 0x00000001ul
-# define CRTC_INTERLACE_EN 0x00000002ul
-# define CRTC_HSYNC_DIS 0x00000004ul
-# define CRTC_VSYNC_DIS 0x00000008ul
-# define CRTC_CSYNC_EN 0x00000010ul
-# define CRTC_PIX_BY_2_EN 0x00000020ul
-# define CRTC2_DBL_SCAN_EN 0x00000020ul /* LTPro */
-# define CRTC_DISPLAY_DIS 0x00000040ul
-# define CRTC_VGA_XOVERSCAN 0x00000080ul
-# define CRTC_PIX_WIDTH 0x00000700ul
-# define CRTC_BYTE_PIX_ORDER 0x00000800ul
-# define CRTC_VSYNC_INT_EN 0x00001000ul /* XC/XL */
-# define CRTC_VSYNC_INT 0x00002000ul /* XC/XL */
-# define CRTC_FIFO_OVERFILL 0x0000c000ul /* VT/GT */
-# define CRTC2_VSYNC_INT_EN 0x00004000ul /* XC/XL */
-# define CRTC2_VSYNC_INT 0x00008000ul /* XC/XL */
-# define CRTC_FIFO_LWM 0x000f0000ul
-# define CRTC_HVSYNC_IO_DRIVE 0x00010000ul /* XC/XL */
-# define CRTC2_PIX_WIDTH 0x000e0000ul /* LTPro */
-# define CRTC_VGA_128KAP_PAGING 0x00100000ul /* VT/GT */
-# define CRTC_DISPREQ_ONLY 0x00200000ul /* VT/GT */
-# define CRTC_VFC_SYNC_TRISTATE 0x00200000ul /* VTB/GTB/LT */
-# define CRTC2_EN 0x00200000ul /* LTPro */
-# define CRTC_LOCK_REGS 0x00400000ul /* VT/GT */
-# define CRTC_SYNC_TRISTATE 0x00800000ul /* VT/GT */
-# define CRTC_EXT_DISP_EN 0x01000000ul
-# define CRTC_EN 0x02000000ul
-# define CRTC_DISP_REQ_EN 0x04000000ul
-# define CRTC_VGA_LINEAR 0x08000000ul
-# define CRTC_VSYNC_FALL_EDGE 0x10000000ul
-# define CRTC_VGA_TEXT_132 0x20000000ul
-# define CRTC_CNT_EN 0x40000000ul
-# define CRTC_CUR_B_TEST 0x80000000ul
-# define CRTC_INT_ENS_X /* *** UPDATE ME *** */ \
- ( \
- CRTC_VSYNC_INT_EN | \
- CRTC2_VSYNC_INT_EN | \
- 0 \
- )
-# define CRTC_INT_ACKS_X /* *** UPDATE ME *** */ \
- ( \
- CRTC_VSYNC_INT | \
- CRTC2_VSYNC_INT | \
- 0 \
- )
-#define DSP_CONFIG BlockIOTag(0x08u) /* VTB/GTB/LT */
-# define DSP_XCLKS_PER_QW 0x00003ffful
-/* ? 0x00004000ul */
-# define DSP_FLUSH_WB 0x00008000ul
-# define DSP_LOOP_LATENCY 0x000f0000ul
-# define DSP_PRECISION 0x00700000ul
-/* ? 0xff800000ul */
-#define DSP_ON_OFF BlockIOTag(0x09u) /* VTB/GTB/LT */
-# define DSP_OFF 0x000007fful
-/* ? 0x0000f800ul */
-# define DSP_ON 0x07ff0000ul
-/* ? 0xf8000000ul */
-#define TIMER_CONFIG BlockIOTag(0x0au) /* VTB/GTB/LT */
-#define MEM_BUF_CNTL BlockIOTag(0x0bu) /* VTB/GTB/LT */
-#define SHARED_CNTL BlockIOTag(0x0cu) /* VTB/GTB/LT */
-#define SHARED_MEM_CONFIG BlockIOTag(0x0du) /* VTB/GTB/LT */
-#define MEM_ADDR_CONFIG BlockIOTag(0x0du) /* GTPro */
-#define SHARED_CNTL_CTD BlockIOTag(0x0eu) /* CTD */
-/* ? 0x00fffffful */
-#define CTD_FIFO5 0x01000000ul
-/* ? 0xfe000000ul */
-#define CRT_TRAP BlockIOTag(0x0eu) /* VTB/GTB/LT */
-#define DSTN_CONTROL BlockIOTag(0x0fu) /* LT */
-#define I2C_CNTL_0 BlockIOTag(0x0fu) /* GTPro */
-#define OVR_CLR IOPortTag(0x08u, 0x10u)
-# define OVR_CLR_8 0x000000fful
-# define OVR_CLR_B 0x0000ff00ul
-# define OVR_CLR_G 0x00ff0000ul
-# define OVR_CLR_R 0xff000000ul
-#define OVR_WID_LEFT_RIGHT IOPortTag(0x09u, 0x11u)
-# define OVR_WID_LEFT 0x0000003ful /* 0x0f on <LT */
-/* ? 0x0000ffc0ul */
-# define OVR_WID_RIGHT 0x003f0000ul /* 0x0f0000 on <LT */
-/* ? 0xffc00000ul */
-#define OVR_WID_TOP_BOTTOM IOPortTag(0x0au, 0x12u)
-# define OVR_WID_TOP 0x000001fful /* 0x00ff on <LT */
-/* ? 0x0000fe00ul */
-# define OVR_WID_BOTTOM 0x01ff0000ul /* 0x00ff0000 on <LT */
-/* ? 0xfe000000ul */
-#define VGA_DSP_CONFIG BlockIOTag(0x13u) /* VTB/GTB/LT */
-# define VGA_DSP_XCLKS_PER_QW DSP_XCLKS_PER_QW
-/* ? 0x000fc000ul */
-# define VGA_DSP_PREC_PCLKBY2 0x00700000ul
-/* ? 0x00800000ul */
-# define VGA_DSP_PREC_PCLK 0x07000000ul
-/* ? 0xf8000000ul */
-#define VGA_DSP_ON_OFF BlockIOTag(0x14u) /* VTB/GTB/LT */
-# define VGA_DSP_OFF DSP_OFF
-/* ? 0x0000f800ul */
-# define VGA_DSP_ON DSP_ON
-/* ? 0xf8000000ul */
-#define DSP2_CONFIG BlockIOTag(0x15u) /* LTPro */
-#define DSP2_ON_OFF BlockIOTag(0x16u) /* LTPro */
-#define EXT_CRTC_GEN_CNTL BlockIOTag(0x17u) /* VT-A4 (W) */
-#define CRTC2_OFF_PITCH BlockIOTag(0x17u) /* LTPro */
-#define CUR_CLR0 IOPortTag(0x0bu, 0x18u)
-#define CUR_CLR1 IOPortTag(0x0cu, 0x19u)
-/* These are for both CUR_CLR0 and CUR_CLR1 */
-# define CUR_CLR_I 0x000000fful
-# define CUR_CLR_B 0x0000ff00ul
-# define CUR_CLR_G 0x00ff0000ul
-# define CUR_CLR_R 0xff000000ul
-# define CUR_CLR (CUR_CLR_R | CUR_CLR_G | CUR_CLR_B)
-#define CUR_OFFSET IOPortTag(0x0du, 0x1au)
-#define CUR_HORZ_VERT_POSN IOPortTag(0x0eu, 0x1bu)
-# define CUR_HORZ_POSN 0x000007fful
-/* ? 0x0000f800ul */
-# define CUR_VERT_POSN 0x07ff0000ul
-/* ? 0xf8000000ul */
-#define CUR_HORZ_VERT_OFF IOPortTag(0x0fu, 0x1cu)
-# define CUR_HORZ_OFF 0x0000007ful
-/* ? 0x0000ff80ul */
-# define CUR_VERT_OFF 0x007f0000ul
-/* ? 0xff800000ul */
-#define CONFIG_PANEL BlockIOTag(0x1du) /* LT */
-# define PANEL_FORMAT 0x00000007ul
-/* ? 0x00000008ul */
-# define PANEL_TYPE 0x000000f0ul
-# define NO_OF_GREY 0x00000700ul
-# define MOD_GEN 0x00001800ul
-# define EXT_LVDS_CLK 0x00001800ul /* LTPro */
-# define BLINK_RATE 0x00006000ul
-# define BLINK_RATE_PRO 0x00002000ul /* LTPro */
-# define DONT_SHADOW_HEND 0x00004000ul /* LTPro */
-# define DONT_USE_F32KHZ 0x00008000ul
-# define LCD_IO_DRIVE 0x00008000ul /* XC/XL */
-# define FP_POL 0x00010000ul
-# define LP_POL 0x00020000ul
-# define DTMG_POL 0x00040000ul
-# define SCK_POL 0x00080000ul
-# define DITHER_SEL 0x00300000ul
-# define INVERSE_VIDEO_EN 0x00400000ul
-# define BL_CLK_SEL 0x01800000ul
-# define BL_LEVEL 0x0e000000ul
-# define BL_CLK_SEL_PRO 0x00800000ul /* LTPro */
-# define BL_LEVEL_PRO 0x03000000ul /* LTPro */
-# define BIAS_LEVEL_PRO 0x0c000000ul /* LTPro */
-# define HSYNC_DELAY 0xf0000000ul
-#define TV_OUT_INDEX BlockIOTag(0x1du) /* LTPro */
-# define TV_REG_INDEX 0x000000fful
-# define TV_ON 0x00000100ul
-/* ? 0xfffffe00ul */
-#define GP_IO IOPortTag(0x1eu, 0x1eu) /* VT/GT */
-#define GP_IO_CNTL BlockIOTag(0x1fu) /* VT/GT */
-#define HW_DEBUG BlockIOTag(0x1fu) /* VTB/GTB/LT */
-# define FAST_SRCCOPY_DIS 0x00000001ul
-# define BYPASS_SUBPIC_DBF 0x00000001ul /* XL/XC */
-# define SRC_AUTONA_FIX_DIS 0x00000002ul
-# define SYNC_PD_EN 0x00000002ul /* Mobility */
-# define DISP_QW_FIX_DIS 0x00000004ul
-# define GUIDST_WB_EXP_DIS 0x00000008ul
-# define CYC_ALL_FIX_DIS 0x00000008ul /* GTPro */
-# define AGPPLL_FIX_EN 0x00000008ul /* Mobility */
-# define SRC_AUTONA_ALWAYS_EN 0x00000010ul
-# define GUI_BEATS_HOST_P 0x00000010ul /* GTPro */
-# define DRV_CNTL_DQMB_WEB 0x00000020ul
-# define FAST_FILL_SCISSOR_DIS 0x00000020ul /* GT2c/VT4 */
-# define INTER_BLIT_FIX_DIS 0x00000020ul /* GTPro */
-# define DRV_CNTL_MA 0x00000040ul
-# define AUTO_BLKWRT_COLOR_DIS 0x00000040ul /* GT2c/VT4 */
-# define INTER_PRIM_DIS 0x00000040ul /* GTPro */
-# define DRV_CNTL_MD 0x00000080ul
-# define CHG_DEV_ID 0x00000100ul
-# define SRC_TRACK_DST_FIX_DIS 0x00000200ul
-# define HCLK_FB_SKEW 0x00000380ul /* GT2c/VT4 */
-# define SRC_TRACK_DST_FIX_DIS_P 0x00000080ul /* GTPro */
-# define AUTO_BLKWRT_COLOR_DIS_P 0x00000100ul /* GTPro */
-# define INTER_LINE_OVERLAP_DIS 0x00000200ul /* GTPro */
-# define MEM_OE_PULLBACK 0x00000400ul
-# define DBL_BUFFER_EN 0x00000400ul /* GTPro */
-# define MEM_WE_FIX_DIS 0x00000800ul
-# define MEM_OE_PULLBACK_B 0x00000800ul /* GT2c/VT4 */
-# define CMDFIFO_SIZE_DIS_P 0x00000800ul /* GTPro */
-# define RD_EN_FIX_DIS 0x00001000ul
-# define MEM_WE_FIX_DIS_B 0x00001000ul
-# define AUTO_FF_DIS 0x00001000ul /* GTPro */
-# define CMDFIFO_SIZE_DIS 0x00002000ul /* GT2c/VT4 */
-# define AUTO_BLKWRT_DIS 0x00002000ul /* GTPro */
-# define GUI_BEATS_HOST 0x00004000ul /* GT2c/VT4 */
-# define ORED_INVLD_RB_CACHE 0x00004000ul /* GTPro */
-# define BLOCK_DBL_BUF 0x00008000ul /* GTPro */
-# define R2W_TURNAROUND_DELAY 0x00020000ul /* GT2c/VT4 */
-# define ENA_32BIT_DATA_BUS 0x00040000ul /* GT2c/VT4 */
-# define HCLK_FB_SKEW_P 0x00070000ul /* GTPro */
-# define ENA_FLASH_ROM 0x00080000ul /* GT2c/VT4 */
-# define DISABLE_SWITCH_FIX 0x00080000ul /* GTPro */
-# define MCLK_START_EN 0x00080000ul /* LTPro */
-# define SEL_VBLANK_BDL_BUF 0x00100000ul /* GTPro */
-# define CMDFIFO_64EN 0x00200000ul /* GTPro must be set if IDCT_EN */
-# define BM_FIX_DIS 0x00400000ul /* GTPro */
-# define Z_SWITCH_EN 0x00800000ul /* LTPro */
-# define FLUSH_HOST_WB 0x01000000ul /* GTPro */
-# define HW_DEBUG_WRITE_MSK_FIX_DIS 0x02000000ul /* LTPro */
-# define Z_NO_WRITE_EN 0x04000000ul /* LTPro */
-# define DISABLE_PCLK_RESET_P 0x08000000ul /* LTPro */
-# define PM_D3_SUPPORT_ENABLE_P 0x10000000ul /* LTPro */
-# define STARTCYCLE_FIX_ENABLE 0x20000000ul /* LTPro */
-# define DONT_RST_CHAREN 0x20000000ul /* XL/XC */
-# define C3_FIX_ENABLE 0x40000000ul /* LTPro */
-# define BM_HOSTRA_EN 0x40000000ul /* XL/XC */
-# define PKGBGAb 0x80000000ul /* XL/XC */
-# define AUTOEXP_HORZ_FIX 0x80000000ul /* Mobility */
-#define SCRATCH_REG0 IOPortTag(0x10u, 0x20u)
-#define SCRATCH_REG1 IOPortTag(0x11u, 0x21u)
-/* BIOS_BASE_SEGMENT 0x0000007ful */ /* As above */
-/* ? 0x00000f80ul */
-#define BIOS_INIT_DAC_SUBTYPE 0x0000f000ul
-/* ? 0xffff0000ul */
-#define SCRATCH_REG2 BlockIOTag(0x22u) /* LT */
-#define SCRATCH_REG3 BlockIOTag(0x23u) /* GTPro */
-#define CLOCK_CNTL IOPortTag(0x12u, 0x24u)
-# define CLOCK_BIT 0x00000004ul /* For ICS2595 */
-# define CLOCK_PULSE 0x00000008ul /* For ICS2595 */
-# define CLOCK_SELECT 0x0000000ful
-# define CLOCK_DIVIDER 0x00000030ul
-# define CLOCK_STROBE 0x00000040ul
-# define CLOCK_DATA 0x00000080ul
-/* ? 0x00000100ul */
-# define PLL_WR_EN 0x00000200ul /* For internal PLL */
-# define PLL_ADDR 0x0000fc00ul /* For internal PLL */
-# define PLL_DATA 0x00ff0000ul /* For internal PLL */
-/* ? 0xff000000ul */
-#define CONFIG_STAT64_1 BlockIOTag(0x25u) /* GTPro */
-# define CFG_SUBSYS_DEV_ID 0x000000fful
-# define CFG_SUBSYS_VEN_ID 0x00ffff00ul
-/* ? 0x1f000000ul */
-# define CFG_DIMM_TYPE 0xe0000000ul
-# define CFG_PCI_SUBSYS_DEV_ID 0x0000fffful /* XC/XL */
-# define CFG_PCI_SUBSYS_VEN_ID 0xffff0000ul /* XC/XL */
-#define CONFIG_STAT64_2 BlockIOTag(0x26u) /* GTPro */
-# define CFG_DIMM_TYPE_3 0x00000001ul
-/* ? 0x0000001eul */
-# define CFG_ROMWRTEN 0x00000020ul
-# define CFG_AGPVCOGAIN 0x000000c0ul
-# define CFG_PCI_TYPE 0x00000100ul
-# define CFG_AGPSKEW 0x00000e00ul
-# define CFG_X1CLKSKEW 0x00007000ul
-# define CFG_PANEL_ID_P 0x000f8000ul /* LTPro */
-/* ? 0x00100000ul */
-# define CFG_PREFETCH_EN 0x00200000ul
-# define CFG_ID_DISABLE 0x00400000ul
-# define CFG_PRE_TESTEN 0x00800000ul
-/* ? 0x01000000ul */
-# define CFG_PCI5VEN 0x02000000ul /* LTPro */
-# define CFG_VGA_DISABLE 0x04000000ul
-# define CFG_ENINTB 0x08000000ul
-/* ? 0x10000000ul */
-# define CFG_ROM_REMAP_2 0x20000000ul
-# define CFG_IDSEL 0x40000000ul
-/* ? 0x80000000ul */
-#define TV_OUT_DATA BlockIOTag(0x27u) /* LTPro */
-#define BUS_CNTL IOPortTag(0x13u, 0x28u)
-# define BUS_WS 0x0000000ful
-# define BUS_DBL_RESYNC 0x00000001ul /* VTB/GTB/LT */
-# define BUS_MSTR_RESET 0x00000002ul /* VTB/GTB/LT */
-# define BUS_FLUSH_BUF 0x00000004ul /* VTB/GTB/LT */
-# define BUS_STOP_REQ_DIS 0x00000008ul /* VTB/GTB/LT */
-# define BUS_ROM_WS 0x000000f0ul
-# define BUS_APER_REG_DIS 0x00000010ul /* VTB/GTB/LT */
-# define BUS_EXTRA_PIPE_DIS 0x00000020ul /* VTB/GTB/LT */
-# define BUS_MASTER_DIS 0x00000040ul /* VTB/GTB/LT */
-# define BUS_ROM_WRT_EN 0x00000080ul /* GTPro */
-# define BUS_ROM_PAGE 0x00000f00ul
-# define BUS_MINOR_REV_ID 0x00000700ul /* LTPro */
-# define BUS_EXT_REG_EN 0x08000000ul
-/* First silicom - Prototype (A11) 0x00000000ul */
-/* Metal mask spin (A12 & A13) 0x00000100ul */
-/* All layer spin (A21) 0x00000200ul */
-/* Fast metal spin (A22) - Prod. 0x00000300ul */
-/* All layer spin (A31) 0x00000700ul */
-/* ? 0x00000800ul */ /* LTPro */
-# define BUS_CHIP_HIDDEN_REV 0x00000300ul /* XC/XL */
-/* ? 0x00001c00ul */ /* XC/XL */
-# define BUS_ROM_DIS 0x00001000ul
-# define BUS_IO_16_EN 0x00002000ul /* GX */
-# define BUS_PCI_READ_RETRY_EN 0x00002000ul /* VTB/GTB/LT */
-# define BUS_DAC_SNOOP_EN 0x00004000ul
-# define BUS_PCI_RETRY_EN 0x00008000ul /* VT/GT */
-# define BUS_PCI_WRT_RETRY_EN 0x00008000ul /* VTB/GTB/LT */
-# define BUS_FIFO_WS 0x000f0000ul
-# define BUS_RETRY_WS 0x000f0000ul /* VTB/GTB/LT */
-# define BUS_FIFO_ERR_INT_EN 0x00100000ul
-# define BUS_MSTR_RD_MULT 0x00100000ul /* VTB/GTB/LT */
-# define BUS_FIFO_ERR_INT 0x00200000ul
-# define BUS_MSTR_RD_LINE 0x00200000ul /* VTB/GTB/LT */
-# define BUS_HOST_ERR_INT_EN 0x00400000ul
-# define BUS_SUSPEND 0x00400000ul /* GTPro */
-# define BUS_HOST_ERR_INT 0x00800000ul
-# define BUS_LAT16X 0x00800000ul /* GTPro */
-# define BUS_PCI_DAC_WS 0x07000000ul
-# define BUS_RD_DISCARD_EN 0x01000000ul /* VTB/GTB/LT */
-# define BUS_RD_ABORT_EN 0x02000000ul /* VTB/GTB/LT */
-# define BUS_MSTR_WS 0x04000000ul /* VTB/GTB/LT */
-# define BUS_PCI_DAC_DLY 0x08000000ul
-# define BUS_EXT_REG_EN 0x08000000ul /* VT/GT */
-# define BUS_PCI_MEMW_WS 0x10000000ul
-# define BUS_MSTR_DISCONNECT_EN 0x10000000ul /* VTB/GTB/LT */
-# define BUS_PCI_BURST_DEC 0x20000000ul /* GX/CX */
-# define BUS_BURST 0x20000000ul /* 264xT */
-# define BUS_WRT_BURST 0x20000000ul /* VTB/GTB/LT */
-# define BUS_RDY_READ_DLY 0xc0000000ul
-# define BUS_READ_BURST 0x40000000ul /* VTB/GTB/LT */
-# define BUS_RDY_READ_DLY_B 0x80000000ul /* VTB/GTB/LT */
-#define LCD_INDEX BlockIOTag(0x29u) /* LTPro */
-# define LCD_REG_INDEX 0x0000003ful
-# define LCD_DISPLAY_DIS 0x00000100ul
-# define LCD_SRC_SEL 0x00000200ul
-# define LCD_SRC_SEL_CRTC1 0x00000000ul
-# define LCD_SRC_SEL_CRTC2 0x00000200ul
-# define LCD_CRTC2_DISPLAY_DIS 0x00000400ul
-# define LCD_GUI_ACTIVE 0x00000800ul /* XC/XL */
-# define LCD_MONDET_SENSE 0x01000000ul /* XC/XL */
-# define LCD_MONDET_INT_POL 0x02000000ul /* XC/XL */
-# define LCD_MONDET_INT_EN 0x04000000ul /* XC/XL */
-# define LCD_MONDET_INT 0x08000000ul /* XC/XL */
-# define LCD_MONDET_EN 0x10000000ul /* XC/XL */
-# define LCD_EN_PL 0x20000000ul /* XC/XL */
-#define HFB_PITCH_ADDR BlockIOTag(0x2au) /* LT */
-#define LCD_DATA BlockIOTag(0x2au) /* LTPro */
-#define EXT_MEM_CNTL BlockIOTag(0x2bu) /* VTB/GTB/LT */
-#define MEM_CNTL IOPortTag(0x14u, 0x2cu)
-# define CTL_MEM_SIZE 0x00000007ul
-/* ? 0x00000008ul */
-# define CTL_MEM_REFRESH 0x00000078ul /* VT/GT */
-# define CTL_MEM_SIZEB 0x0000000ful /* VTB/GTB/LT */
-# define CTL_MEM_RD_LATCH_EN 0x00000010ul
-# define CTL_MEM_RD_LATCH_DLY 0x00000020ul
-# define CTL_MEM_LATENCY 0x00000030ul /* VTB/GTB/LT */
-# define CTL_MEM_SD_LATCH_EN 0x00000040ul
-# define CTL_MEM_SD_LATCH_DLY 0x00000080ul
-# define CTL_MEM_LATCH 0x000000c0ul /* VTB/GTB/LT */
-# define CTL_MEM_WDOE_CNTL 0x000000c0ul /* XC/XL */
-# define CTL_MEM_FULL_PLS 0x00000100ul
-# define CTL_MEM_CYC_LNTH_AUX 0x00000180ul /* VT/GT */
-# define CTL_MEM_TRP 0x00000300ul /* VTB/GTB/LT */
-# define CTL_MEM_CYC_LNTH 0x00000600ul
-# define CTL_MEM_REFRESH_RATE 0x00001800ul /* 264xT */
-# define CTL_MEM_TRCD 0x00000c00ul /* VTB/GTB/LT */
-# define CTL_MEM_WR_RDY_SEL 0x00000800ul /* GX/CX */
-# define CTL_MEM_EXT_RMW_CYC_EN 0x00001000ul /* GX/CX */
-# define CTL_MEM_TCRD 0x00001000ul /* VTB/GTB/LT */
-# define CTL_MEM_DLL_RESET 0x00002000ul /* VT/GT */
-# define CTL_MEM_TR2W 0x00002000ul /* GTPro */
-# define CTL_MEM_ACTV_PRE 0x0000c000ul /* VT/GT */
-# define CTL_MEM_CAS_PHASE 0x00004000ul /* GTPro */
-# define CTL_MEM_OE_PULLBACK 0x00008000ul /* GTPro */
-# define CTL_MEM_TWR 0x0000c000ul /* XC/XL */
-# define CTL_MEM_BNDRY 0x00030000ul
-# define CTL_MEM_BNDRY_0K 0x00000000ul
-# define CTL_MEM_BNDRY_256K 0x00010000ul
-# define CTL_MEM_BNDRY_512K 0x00020000ul
-# define CTL_MEM_BNDRY_1024K 0x00030000ul
-# define CTL_MEM_DLL_GAIN_CNTL 0x00030000ul /* VT/GT */
-# define CTL_MEM_BNDRY_EN 0x00040000ul
-# define CTL_MEM_SDRAM_RESET 0x00040000ul /* VT/GT */
-# define CTL_MEM_TRAS 0x00070000ul /* VTB/GTB/LT */
-# define CTL_MEM_TILE_SELECT 0x00180000ul /* VT/GT */
-# define CTL_MEM_REFRESH_DIS 0x00080000ul /* VTB/GTB/LT */
-# define CTL_MEM_LOW_LATENCY_MODE 0x00200000ul /* VT/GT */
-# define CTL_MEM_CDE_PULLBACK 0x00400000ul /* VT/GT */
-# define CTL_MEM_REFRESH_RATE_B 0x00f00000ul /* VTB/GTB/LT */
-# define CTL_MEM_PIX_WIDTH 0x07000000ul
-# define CTL_MEM_LOWER_APER_ENDIAN 0x03000000ul /* VTB/GTB/LT */
-# define CTL_MEM_OE_SELECT 0x18000000ul /* VT/GT */
-# define CTL_MEM_UPPER_APER_ENDIAN 0x0c000000ul /* VTB/GTB/LT */
-/* ? 0xe0000000ul */
-# define CTL_MEM_PAGE_SIZE 0x30000000ul /* VTB/GTB/LT */
-#define MEM_VGA_WP_SEL IOPortTag(0x15u, 0x2du)
-# define MEM_VGA_WPS0 0x0000fffful
-# define MEM_VGA_WPS1 0xffff0000ul
-#define MEM_VGA_RP_SEL IOPortTag(0x16u, 0x2eu)
-# define MEM_VGA_RPS0 0x0000fffful
-# define MEM_VGA_RPS1 0xffff0000ul
-#define LT_GIO BlockIOTag(0x2fu) /* LT */
-#define I2C_CNTL_1 BlockIOTag(0x2fu) /* GTPro */
-#define DAC_REGS IOPortTag(0x17u, 0x30u) /* 4 separate bytes */
-# define M64_DAC_WRITE (DAC_REGS + 0)
-# define M64_DAC_DATA (DAC_REGS + 1)
-# define M64_DAC_MASK (DAC_REGS + 2)
-# define M64_DAC_READ (DAC_REGS + 3)
-#define DAC_CNTL IOPortTag(0x18u, 0x31u)
-# define DAC_EXT_SEL 0x00000003ul
-# define DAC_EXT_SEL_RS2 0x00000001ul
-# define DAC_EXT_SEL_RS3 0x00000002ul
-# define DAC_RANGE_CTL 0x00000003ul /* VTB/GTB/LT */
-# define DAC_BLANKING 0x00000004ul /* 264xT */
-# define DAC_CMP_DIS 0x00000008ul /* 264xT */
-# define DAC1_CLK_SEL 0x00000010ul /* LTPro */
-# define DAC_PALETTE_ACCESS_CNTL 0x00000020ul /* LTPro */
-# define DAC_PALETTE2_SNOOP_EN 0x00000040ul /* LTPro */
-# define DAC_CMP_OUTPUT 0x00000080ul /* 264xT */
-# define DAC_8BIT_EN 0x00000100ul
-# define DAC_PIX_DLY 0x00000600ul
-# define DAC_DIRECT 0x00000400ul /* VTB/GTB/LT */
-# define DAC_BLANK_ADJ 0x00001800ul
-# define DAC_PAL_CLK_SEL 0x00000800ul /* VTB/GTB/LT */
-# define DAC_CRT_SENSE 0x00000800ul /* XC/XL */
-# define DAC_CRT_DETECTION_ON 0x00001000ul /* XC/XL */
-# define DAC_VGA_ADR_EN 0x00002000ul
-# define DAC_FEA_CON_EN 0x00004000ul /* 264xT */
-# define DAC_PDMN 0x00008000ul /* 264xT */
-# define DAC_TYPE 0x00070000ul
-/* ? 0x00f80000ul */
-# define DAC_MON_ID_STATE0 0x01000000ul /* GX-E+/CX */
-# define DAC_GIO_STATE_1 0x01000000ul /* 264xT */
-# define DAC_MON_ID_STATE1 0x02000000ul /* GX-E+/CX */
-# define DAC_GIO_STATE_0 0x02000000ul /* 264xT */
-# define DAC_MON_ID_STATE2 0x04000000ul /* GX-E+/CX */
-# define DAC_GIO_STATE_4 0x04000000ul /* 264xT */
-# define DAC_MON_ID_DIR0 0x08000000ul /* GX-E+/CX */
-# define DAC_GIO_DIR_1 0x08000000ul /* 264xT */
-# define DAC_MON_ID_DIR1 0x10000000ul /* GX-E+/CX */
-# define DAC_GIO_DIR_0 0x10000000ul /* 264xT */
-# define DAC_MON_ID_DIR2 0x20000000ul /* GX-E+/CX */
-# define DAC_GIO_DIR_4 0x20000000ul /* 264xT */
-# define DAC_MAN_CMP_STATE 0x40000000ul /* GX-E+ */
-# define DAC_RW_WS 0x80000000ul /* VT/GT */
-#define HORZ_STRETCHING BlockIOTag(0x32u) /* LT */
-# define HORZ_STRETCH_BLEND 0x00000ffful
-# define HORZ_STRETCH_RATIO 0x0000fffful
-# define HORZ_STRETCH_LOOP 0x00070000ul
-# define HORZ_STRETCH_LOOP09 0x00000000ul
-# define HORZ_STRETCH_LOOP11 0x00010000ul
-# define HORZ_STRETCH_LOOP12 0x00020000ul
-# define HORZ_STRETCH_LOOP14 0x00030000ul
-# define HORZ_STRETCH_LOOP15 0x00040000ul
-/* ? 0x00050000ul */
-/* ? 0x00060000ul */
-/* ? 0x00070000ul */
-/* ? 0x00080000ul */
-# define HORZ_PANEL_SIZE 0x0ff00000ul /* XC/XL */
-/* ? 0x10000000ul */
-# define AUTO_HORZ_RATIO 0x20000000ul /* XC/XL */
-# define HORZ_STRETCH_MODE 0x40000000ul
-# define HORZ_STRETCH_EN 0x80000000ul
-#define EXT_DAC_REGS BlockIOTag(0x32u) /* GTPro */
-#define VERT_STRETCHING BlockIOTag(0x33u) /* LT */
-# define VERT_STRETCH_RATIO0 0x000003fful
-# define VERT_STRETCH_RATIO1 0x000ffc00ul
-# define VERT_STRETCH_RATIO2 0x3ff00000ul
-# define VERT_STRETCH_USE0 0x40000000ul
-# define VERT_STRETCH_EN 0x80000000ul
-#define GEN_TEST_CNTL IOPortTag(0x19u, 0x34u)
-# define GEN_EE_DATA_OUT 0x00000001ul /* GX/CX */
-# define GEN_GIO2_DATA_OUT 0x00000001ul /* 264xT */
-# define GEN_EE_CLOCK 0x00000002ul /* GX/CX */
-/* ? 0x00000002ul */ /* 264xT */
-# define GEN_EE_CHIP_SEL 0x00000004ul /* GX/CX */
-# define GEN_GIO3_DATA_OUT 0x00000004ul /* 264xT */
-# define GEN_EE_DATA_IN 0x00000008ul /* GX/CX */
-# define GEN_GIO2_DATA_IN 0x00000008ul /* 264xT */
-# define GEN_EE_EN 0x00000010ul /* GX/CX */
-# define GEN_GIO2_ENABLE 0x00000010ul /* 264xT */
-# define GEN_ICON2_ENABLE 0x00000010ul /* XC/XL */
-# define GEN_OVR_OUTPUT_EN 0x00000020ul /* GX/CX */
-# define GEN_GIO2_WRITE 0x00000020ul /* 264xT */
-# define GEN_CUR2_ENABLE 0x00000020ul /* XC/XL */
-# define GEN_OVR_POLARITY 0x00000040ul /* GX/CX */
-# define GEN_ICON_ENABLE 0x00000040ul /* XC/XL */
-# define GEN_CUR_EN 0x00000080ul
-# define GEN_GUI_EN 0x00000100ul /* GX/CX */
-# define GEN_GUI_RESETB 0x00000100ul /* 264xT */
-# define GEN_BLOCK_WR_EN 0x00000200ul /* GX */
-/* ? 0x00000200ul */ /* CX/264xT */
-# define GEN_SOFT_RESET 0x00000200ul /* VTB/GTB/LT */
-# define GEN_MEM_TRISTATE 0x00000400ul /* GTPro */
-/* ? 0x00000800ul */
-# define GEN_TEST_VECT_MODE 0x00003000ul /* VT/GT */
-/* ? 0x0000c000ul */
-# define GEN_TEST_FIFO_EN 0x00010000ul /* GX/CX */
-# define GEN_TEST_GUI_REGS_EN 0x00020000ul /* GX/CX */
-# define GEN_TEST_VECT_EN 0x00040000ul /* GX/CX */
-# define GEN_TEST_CRC_STR 0x00080000ul /* GX-C/-D */
-/* ? 0x00080000ul */ /* GX-E+/CX */
-# define GEN_TEST_MODE_T 0x000f0000ul /* 264xT */
-# define GEN_TEST_MODE 0x00700000ul /* GX/CX */
-# define GEN_TEST_CNT_EN 0x00100000ul /* 264xT */
-# define GEN_TEST_CRC_EN 0x00200000ul /* 264xT */
-/* ? 0x00400000ul */ /* 264xT */
-/* ? 0x00800000ul */
-# define GEN_TEST_MEM_WR 0x01000000ul /* GX-C/-D */
-# define GEN_TEST_MEM_STROBE 0x02000000ul /* GX-C/-D */
-# define GEN_TEST_DST_SS_EN 0x04000000ul /* GX/CX */
-# define GEN_TEST_DST_SS_STROBE 0x08000000ul /* GX/CX */
-# define GEN_TEST_SRC_SS_EN 0x10000000ul /* GX/CX */
-# define GEN_TEST_SRC_SS_STROBE 0x20000000ul /* GX/CX */
-# define GEN_TEST_CNT_VALUE 0x3f000000ul /* 264xT */
-# define GEN_TEST_CC_EN 0x40000000ul /* GX/CX */
-# define GEN_TEST_CC_STROBE 0x80000000ul /* GX/CX */
-/* ? 0xc0000000ul */ /* 264xT */
-# define GEN_DEBUG_MODE 0xff000000ul /* VTB/GTB/LT */
-# define GEN_DEBUG_MC_PARSER 0x2A000000ul /* Mobility pro */
-# define GEN_DEBUG_IDCT_PARSER 0x2B000000ul /* Mobility pro */
-# define GEN_DEBUG_MC_BUFFER 0x2C000000ul /* Mobility pro */
-# define GEN_DEBUG_IDCT_BUFFER 0x2E000000ul /* Mobility pro */
-# define GEN_DEBUG_IDCT1 0x90000000ul /* Mobility pro */
-# define GEN_DEBUG_IDCT2 0x91000000ul /* Mobility pro */
-# define GEN_DEBUG_IDCT3 0x92000000ul /* Mobility pro */
-#define LCD_GEN_CTRL BlockIOTag(0x35u) /* LT */
-# define CRT_ON 0x00000001ul
-# define LCD_ON 0x00000002ul
-# define HORZ_DIVBY2_EN 0x00000004ul
-# define DONT_DS_ICON 0x00000008ul
-# define LOCK_8DOT 0x00000010ul
-# define ICON_ENABLE 0x00000020ul
-# define DONT_SHADOW_VPAR 0x00000040ul
-# define V2CLK_PM_EN 0x00000080ul
-# define RST_FM 0x00000100ul
-# define DISABLE_PCLK_RESET 0x00000200ul /* XC/XL */
-# define DIS_HOR_CRT_DIVBY2 0x00000400ul
-# define SCLK_SEL 0x00000800ul
-# define SCLK_DELAY 0x0000f000ul
-# define TVCLK_PM_EN 0x00010000ul
-# define VCLK_DAC_PM_EN 0x00020000ul
-# define VCLK_LCD_OFF 0x00040000ul
-# define SELECT_WAIT_4MS 0x00080000ul
-# define XTALIN_PM_EN 0x00080000ul /* XC/XL */
-# define V2CLK_DAC_PM_EN 0x00100000ul
-# define LVDS_EN 0x00200000ul
-# define LVDS_PLL_EN 0x00400000ul
-# define LVDS_PLL_RESET 0x00800000ul
-# define LVDS_RESERVED_BITS 0x07000000ul
-# define CRTC_RW_SELECT 0x08000000ul /* LTPro */
-# define USE_SHADOWED_VEND 0x10000000ul
-# define USE_SHADOWED_ROWCUR 0x20000000ul
-# define SHADOW_EN 0x40000000ul
-# define SHADOW_RW_EN 0x80000000ul
-#define CUSTOM_MACRO_CNTL BlockIOTag(0x35u) /* GTPro */
-# define IDCT_FIFO_EXTENSE 0x00000001ul
-#define POWER_MANAGEMENT BlockIOTag(0x36u) /* LT */
-# define PWR_MGT_ON 0x00000001ul
-# define PWR_MGT_MODE 0x00000006ul
-# define AUTO_PWRUP_EN 0x00000008ul
-# define ACTIVITY_PIN_ON 0x00000010ul
-# define STANDBY_POL 0x00000020ul
-# define SUSPEND_POL 0x00000040ul
-# define SELF_REFRESH 0x00000080ul
-# define ACTIVITY_PIN_EN 0x00000100ul
-# define KEYBD_SNOOP 0x00000200ul
-# define USE_F32KHZ 0x00000400ul /* LTPro */
-# define DONT_USE_XTALIN 0x00000400ul /* XC/XL */
-# define TRISTATE_MEM_EN 0x00000800ul /* LTPro */
-# define LCDENG_TEST_MODE 0x0000f000ul
-# define STANDBY_COUNT 0x000f0000ul
-# define SUSPEND_COUNT 0x00f00000ul
-# define BAISON 0x01000000ul
-# define BLON 0x02000000ul
-# define DIGON 0x04000000ul
-# define PM_D3_SUPPORT_ENABLE 0x08000000ul /* XC/XL */
-# define STANDBY_NOW 0x10000000ul
-# define SUSPEND_NOW 0x20000000ul
-# define PWR_MGT_STATUS 0xc0000000ul
-#define CONFIG_CNTL IOPortTag(0x1au, 0x37u)
-# define CFG_MEM_AP_SIZE 0x00000003ul
-# define CFG_MEM_VGA_AP_EN 0x00000004ul
-/* ? 0x00000008ul */
-# define CFG_MEM_AP_LOC 0x00003ff0ul
-/* ? 0x0000c000ul */
-# define CFG_CARD_ID 0x00070000ul
-# define CFG_VGA_DIS 0x00080000ul
-/* ? 0x00f00000ul */
-# define CFG_CDE_WINDOW 0x3f000000ul /* VT/GT */
-/* ? 0xc0000000ul */
-#define CONFIG_CHIP_ID IOPortTag(0x1bu, 0x38u) /* Read */
-# define CFG_CHIP_TYPE0 0x000000fful
-# define CFG_CHIP_TYPE1 0x0000ff00ul
-# define CFG_CHIP_TYPE 0x0000fffful
-# define CFG_CHIP_CLASS 0x00ff0000ul
-# define CFG_CHIP_REV 0xff000000ul
-# define CFG_CHIP_VERSION 0x07000000ul /* 264xT */
-# define CFG_CHIP_FOUNDRY 0x38000000ul /* 264xT */
-# define CFG_CHIP_REVISION 0xc0000000ul /* 264xT */
-#define CONFIG_STATUS64_0 IOPortTag(0x1cu, 0x39u) /* Read (R/W (264xT)) */
-# define CFG_BUS_TYPE 0x00000007ul /* GX/CX */
-# define CFG_MEM_TYPE_T 0x00000007ul /* 264xT */
-# define CFG_MEM_TYPE 0x00000038ul /* GX/CX */
-# define CFG_DUAL_CAS_EN_T 0x00000008ul /* 264xT */
-# define CFG_ROM_128K_EN 0x00000008ul /* VTB/GTB/LT */
-# define CFG_ROM_REMAP 0x00000008ul /* GTPro */
-# define CFG_VGA_EN_T 0x00000010ul /* VT/GT */
-# define CFG_CLOCK_EN 0x00000020ul /* 264xT */
-# define CFG_DUAL_CAS_EN 0x00000040ul /* GX/CX */
-# define CFG_VMC_SENSE 0x00000040ul /* VT/GT */
-# define CFG_SHARED_MEM_EN 0x00000040ul /* VTB/GTB/LT */
-# define CFG_LOCAL_BUS_OPTION 0x00000180ul /* GX/CX */
-# define CFG_VFC_SENSE 0x00000080ul /* VT/GT */
-# define CFG_INIT_DAC_TYPE 0x00000e00ul /* GX/CX */
-# define CFG_INIT_CARD_ID 0x00007000ul /* GX-C/-D */
-# define CFG_BLK_WR_SIZE 0x00001000ul /* GX-E+ */
-# define CFG_INT_QSF_EN 0x00002000ul /* GX-E+ */
-/* ? 0x00004000ul */ /* GX-E+ */
-/* ? 0x00007000ul */ /* CX */
-# define CFG_TRI_BUF_DIS 0x00008000ul /* GX/CX */
-# define CFG_BOARD_ID 0x0000ff00ul /* VT/GT */
-# define CFG_EXT_RAM_ADDR 0x003f0000ul /* GX/CX */
-# define CFG_PANEL_ID 0x001f0000ul /* LT */
-# define CFG_MACROVISION_EN 0x00200000ul /* GTPro */
-# define CFG_ROM_DIS 0x00400000ul /* GX/CX */
-# define CFG_PCI33EN 0x00400000ul /* GTPro */
-# define CFG_VGA_EN 0x00800000ul /* GX/CX */
-# define CFG_FULLAGP 0x00800000ul /* GTPro */
-# define CFG_ARITHMOS_ENABLE 0x00800000ul /* XC/XL */
-# define CFG_LOCAL_BUS_CFG 0x01000000ul /* GX/CX */
-# define CFG_CHIP_EN 0x02000000ul /* GX/CX */
-# define CFG_LOCAL_READ_DLY_DIS 0x04000000ul /* GX/CX */
-# define CFG_ROM_OPTION 0x08000000ul /* GX/CX */
-# define CFG_BUS_OPTION 0x10000000ul /* GX/CX */
-# define CFG_LOCAL_DAC_WR_EN 0x20000000ul /* GX/CX */
-# define CFG_VLB_RDY_DIS 0x40000000ul /* GX/CX */
-# define CFG_AP_4GBYTE_DIS 0x80000000ul /* GX/CX */
-#define CONFIG_STATUS64_1 IOPortTag(0x1du, 0x3au) /* Read */
-# define CFG_PCI_DAC_CFG 0x00000001ul /* GX/CX */
-/* ? 0x0000001eul */ /* GX/CX */
-# define CFG_1C8_IO_SEL 0x00000020ul /* GX/CX */
-/* ? 0xffffffc0ul */ /* GX/CX */
-# define CRC_SIG 0xfffffffful /* 264xT */
-#define MPP_CONFIG BlockIOTag(0x3bu) /* VTB/GTB/LT */
-#define MPP_STROBE_CONFIG BlockIOTag(0x3cu) /* VTB/GTB/LT */
-#define MPP_ADDR BlockIOTag(0x3du) /* VTB/GTB/LT */
-#define MPP_DATA BlockIOTag(0x3eu) /* VTB/GTB/LT */
-#define TVO_CNTL BlockIOTag(0x3fu) /* VTB/GTB/LT */
-/* GP_IO IOPortTag(0x1eu, 0x1eu) */ /* See above */
-/* CRTC_H_TOTAL_DISP IOPortTag(0x1fu, 0x00u) */ /* Duplicate */
-#define DST_OFF_PITCH BlockIOTag(0x40u)
-# define DST_OFFSET 0x000ffffful
-/* ? 0x00300000ul */
-# define DST_PITCH 0xffc00000ul
-#define DST_X BlockIOTag(0x41u)
-#define DST_Y BlockIOTag(0x42u)
-#define DST_Y_X BlockIOTag(0x43u)
-#define DST_WIDTH BlockIOTag(0x44u)
-#define DST_HEIGHT BlockIOTag(0x45u)
-#define DST_HEIGHT_WIDTH BlockIOTag(0x46u)
-#define DST_X_WIDTH BlockIOTag(0x47u)
-#define DST_BRES_LNTH BlockIOTag(0x48u)
-#define DST_BRES_ERR BlockIOTag(0x49u)
-#define DST_BRES_INC BlockIOTag(0x4au)
-#define DST_BRES_DEC BlockIOTag(0x4bu)
-#define DST_CNTL BlockIOTag(0x4cu)
-# define DST_X_DIR 0x00000001ul
-# define DST_Y_DIR 0x00000002ul
-# define DST_Y_MAJOR 0x00000004ul
-# define DST_X_TILE 0x00000008ul
-# define DST_Y_TILE 0x00000010ul
-# define DST_LAST_PEL 0x00000020ul
-# define DST_POLYGON_EN 0x00000040ul
-# define DST_24_ROT_EN 0x00000080ul
-# define DST_24_ROT 0x00000700ul
-# define DST_BRES_SIGN 0x00000800ul /* GX/CX */
-# define DST_BRES_ZERO 0x00000800ul /* CT */
-# define DST_POLYGON_RTEDGE_DIS 0x00001000ul /* CT */
-# define TRAIL_X_DIR 0x00002000ul /* GT */
-# define TRAP_FILL_DIR 0x00004000ul /* GT */
-# define TRAIL_BRES_SIGN 0x00008000ul /* GT */
-/* ? 0x00010000ul */
-# define BRES_SIGN_AUTO 0x00020000ul /* GT */
-/* ? 0x00040000ul */
-# define ALPHA_OVERLAP_ENB 0x00080000ul /* GTPro */
-# define SUB_PIX_ON 0x00100000ul /* GTPro */
-/* ? 0xffe00000ul */
-/* DST_Y_X BlockIOTag(0x4du) */ /* Duplicate */
-#define TRAIL_BRES_ERR BlockIOTag(0x4eu) /* GT */
-#define TRAIL_BRES_INC BlockIOTag(0x4fu) /* GT */
-#define TRAIL_BRES_DEC BlockIOTag(0x50u) /* GT */
-#define LEAD_BRES_LNTH BlockIOTag(0x51u) /* GT */
-#define Z_OFF_PITCH BlockIOTag(0x52u) /* GT */
-#define Z_CNTL BlockIOTag(0x53u) /* GT */
-#define ALPHA_TST_CNTL BlockIOTag(0x54u) /* GTPro */
-# define IDCT_EN 0x00008000UL
-/* ? BlockIOTag(0x55u) */
-#define SECONDARY_STW_EXP BlockIOTag(0x56u) /* GTPro */
-#define SECONDARY_S_X_INC BlockIOTag(0x57u) /* GTPro */
-#define SECONDARY_S_Y_INC BlockIOTag(0x58u) /* GTPro */
-#define SECONDARY_S_START BlockIOTag(0x59u) /* GTPro */
-#define SECONDARY_W_X_INC BlockIOTag(0x5au) /* GTPro */
-#define SECONDARY_W_Y_INC BlockIOTag(0x5bu) /* GTPro */
-#define SECONDARY_W_START BlockIOTag(0x5cu) /* GTPro */
-#define SECONDARY_T_X_INC BlockIOTag(0x5du) /* GTPro */
-#define SECONDARY_T_Y_INC BlockIOTag(0x5eu) /* GTPro */
-#define SECONDARY_T_START BlockIOTag(0x5fu) /* GTPro */
-#define SRC_OFF_PITCH BlockIOTag(0x60u)
-# define SRC_OFFSET 0x000ffffful
-/* ? 0x00300000ul */
-# define SRC_PITCH 0xffc00000ul
-#define SRC_X BlockIOTag(0x61u)
-#define SRC_Y BlockIOTag(0x62u)
-#define SRC_Y_X BlockIOTag(0x63u)
-#define SRC_WIDTH1 BlockIOTag(0x64u)
-#define SRC_HEIGHT1 BlockIOTag(0x65u)
-#define SRC_HEIGHT1_WIDTH1 BlockIOTag(0x66u)
-#define SRC_X_START BlockIOTag(0x67u)
-#define SRC_Y_START BlockIOTag(0x68u)
-#define SRC_Y_X_START BlockIOTag(0x69u)
-#define SRC_WIDTH2 BlockIOTag(0x6au)
-#define SRC_HEIGHT2 BlockIOTag(0x6bu)
-#define SRC_HEIGHT2_WIDTH2 BlockIOTag(0x6cu)
-#define SRC_CNTL BlockIOTag(0x6du)
-# define SRC_PATT_EN 0x00000001ul
-# define SRC_PATT_ROT_EN 0x00000002ul
-# define SRC_LINEAR_EN 0x00000004ul
-# define SRC_BYTE_ALIGN 0x00000008ul
-# define SRC_LINE_X_DIR 0x00000010ul
-# define SRC_8X8X8_BRUSH 0x00000020ul /* VTB/GTB */
-# define FAST_FILL_EN 0x00000040ul /* VTB/GTB */
-# define SRC_TRACK_DST 0x00000080ul /* VTB/GTB */
-# define BUS_MASTER_EN 0x00000100ul /* VTB/GTB */
-# define BUS_MASTER_SYNC 0x00000200ul /* VTB/GTB */
-# define BUS_MASTER_OP 0x00000c00ul /* VTB/GTB */
-# define BM_OP_FRAME_TO_SYSTEM (0 << 10)
-# define BM_OP_SYSTEM_TO_FRAME (1 << 10)
-# define BM_OP_REG_TO_SYSTEM (2 << 10)
-# define BM_OP_SYSTEM_TO_REG (3 << 10)
-# define SRC_8X8X8_BRUSH_LOADED 0x00001000ul /* VTB/GTB */
-# define COLOR_REG_WRITE_EN 0x00002000ul /* VTB/GTB */
-# define BLOCK_WRITE_EN 0x00004000ul /* VTB/GTB */
-/* ? 0xffff8000ul */
-/* ? BlockIOTag(0x6eu) */
-/* ? BlockIOTag(0x6fu) */
-#define SCALE_Y_OFF BlockIOTag(0x70u) /* GT */
-#define SCALE_OFF BlockIOTag(0x70u) /* GTPro */
-#define SECONDARY_SCALE_OFF BlockIOTag(0x70u) /* GTPro */
-#define TEX_0_OFF BlockIOTag(0x70u) /* GT */
-#define TEX_1_OFF BlockIOTag(0x71u) /* GT */
-#define TEX_2_OFF BlockIOTag(0x72u) /* GT */
-#define TEX_3_OFF BlockIOTag(0x73u) /* GT */
-#define TEX_4_OFF BlockIOTag(0x74u) /* GT */
-#define TEX_5_OFF BlockIOTag(0x75u) /* GT */
-#define TEX_6_OFF BlockIOTag(0x76u) /* GT */
-#define SCALE_WIDTH BlockIOTag(0x77u) /* GT */
-#define TEX_7_OFF BlockIOTag(0x77u) /* GT */
-#define SCALE_HEIGHT BlockIOTag(0x78u) /* GT */
-#define TEX_8_OFF BlockIOTag(0x78u) /* GT */
-#define TEX_9_OFF BlockIOTag(0x79u) /* GT */
-#define TEX_10_OFF BlockIOTag(0x7au) /* GT */
-#define S_Y_INC BlockIOTag(0x7bu) /* GT */
-#define SCALE_Y_PITCH BlockIOTag(0x7bu) /* GT */
-#define SCALE_X_INC BlockIOTag(0x7cu) /* GT */
-#define RED_X_INC BlockIOTag(0x7cu) /* GT */
-#define GREEN_X_INC BlockIOTag(0x7du) /* GT */
-#define SCALE_Y_INC BlockIOTag(0x7du) /* GT */
-#define SCALE_VACC BlockIOTag(0x7eu) /* GT */
-#define SCALE_3D_CNTL BlockIOTag(0x7fu) /* GT */
-# define SIGNED_DST_CLAMP 0x00008000UL /* MPEG's MC */
-#define HOST_DATA_0 BlockIOTag(0x80u)
-#define HOST_DATA_1 BlockIOTag(0x81u)
-#define HOST_DATA_2 BlockIOTag(0x82u)
-#define HOST_DATA_3 BlockIOTag(0x83u)
-#define HOST_DATA_4 BlockIOTag(0x84u)
-#define HOST_DATA_5 BlockIOTag(0x85u)
-#define HOST_DATA_6 BlockIOTag(0x86u)
-#define HOST_DATA_7 BlockIOTag(0x87u)
-#define HOST_DATA_8 BlockIOTag(0x88u)
-#define HOST_DATA_9 BlockIOTag(0x89u)
-#define HOST_DATA_A BlockIOTag(0x8au)
-#define HOST_DATA_B BlockIOTag(0x8bu)
-#define HOST_DATA_C BlockIOTag(0x8cu)
-#define HOST_DATA_D BlockIOTag(0x8du)
-#define HOST_DATA_E BlockIOTag(0x8eu)
-#define HOST_DATA_F BlockIOTag(0x8fu)
-#define HOST_CNTL BlockIOTag(0x90u)
-#define HOST_BYTE_ALIGN 0x00000001ul
-#define HOST_BIG_ENDIAN_EN 0x00000002ul /* GX-E/CT */
-/* ? 0xfffffffcul */
-#define BM_HOSTDATA BlockIOTag(0x91u) /* VTB/GTB write-only */
-#define BM_ADDR BlockIOTag(0x92u) /* VTB/GTB */
-# define GUIREG_ADDR 0x000000FFUL
-# define GUIREG_COUNTER 0x003F0000UL
-# define IDCT_FLAGS 0x60000000UL
-# define IDCT_EOB 0x00000000UL
-# define IDCT_TRIPLETS 0x20000000UL /* run, level, level */
-# define IDCT_AUTOINC 0x40000000UL
-# define IDCT_STREAM 0x80000000UL
-#define BM_DATA BlockIOTag(0x92u) /* VTB/GTB write-only */
-#define BM_GUI_TABLE_CMD BlockIOTag(0x93u) /* GTPro */
-# define CIRCULAR_BUF_SIZE_16KB (0 << 0)
-# define CIRCULAR_BUF_SIZE_32KB (1 << 0)
-# define CIRCULAR_BUF_SIZE_64KB (2 << 0)
-# define CIRCULAR_BUF_SIZE_128KB (3 << 0)
-# define LAST_DESCRIPTOR (1 << 31)
-/* ? BlockIOTag(0x94u) */
-/* ? BlockIOTag(0x95u) */
-/* ? BlockIOTag(0x96u) */
-/* ? BlockIOTag(0x97u) */
-/* ? BlockIOTag(0x98u) */
-/* ? BlockIOTag(0x99u) */
-/* ? BlockIOTag(0x9au) */
-/* ? BlockIOTag(0x9bu) */
-/* ? BlockIOTag(0x9cu) */
-/* ? BlockIOTag(0x9du) */
-/* ? BlockIOTag(0x9eu) */
-/* ? BlockIOTag(0x9fu) */
-#define PAT_REG0 BlockIOTag(0xa0u)
-#define PAT_REG1 BlockIOTag(0xa1u)
-#define PAT_CNTL BlockIOTag(0xa2u)
-# define PAT_MONO_EN 0x00000001ul
-# define PAT_CLR_4x2_EN 0x00000002ul
-# define PAT_CLR_8x1_EN 0x00000004ul
-/* ? 0xfffffff8ul */
-/* ? BlockIOTag(0xa3u) */
-/* ? BlockIOTag(0xa4u) */
-/* ? BlockIOTag(0xa5u) */
-/* ? BlockIOTag(0xa6u) */
-/* ? BlockIOTag(0xa7u) */
-#define SC_LEFT BlockIOTag(0xa8u)
-#define SC_RIGHT BlockIOTag(0xa9u)
-#define SC_LEFT_RIGHT BlockIOTag(0xaau)
-#define SC_TOP BlockIOTag(0xabu)
-#define SC_BOTTOM BlockIOTag(0xacu)
-#define SC_TOP_BOTTOM BlockIOTag(0xadu)
-#define USR1_DST_OFF_PITCH BlockIOTag(0xaeu) /* LTPro */
-#define USR2_DST_OFF_PITCH BlockIOTag(0xafu) /* LTPro */
-#define DP_BKGD_CLR BlockIOTag(0xb0u)
-#define DP_FRGD_CLR BlockIOTag(0xb1u)
-#define DP_WRITE_MASK BlockIOTag(0xb2u)
-#define DP_CHAIN_MASK BlockIOTag(0xb3u)
-# define DP_CHAIN_1BPP 0x00000000ul /* Irrelevant */
-# define DP_CHAIN_4BPP 0x00008888ul
-# define DP_CHAIN_8BPP 0x00008080ul
-# define DP_CHAIN_8BPP_332 0x00009292ul
-# define DP_CHAIN_15BPP_1555 0x00004210ul
-# define DP_CHAIN_16BPP_565 0x00008410ul
-# define DP_CHAIN_24BPP_888 0x00008080ul
-# define DP_CHAIN_32BPP_8888 0x00008080ul
-/* ? 0xffff0000ul */
-#define DP_PIX_WIDTH BlockIOTag(0xb4u)
-# define DP_DST_PIX_WIDTH 0x0000000ful
-# define COMPOSITE_PIX_WIDTH 0x000000f0ul /* GTPro */
-# define DP_SRC_PIX_WIDTH 0x00000f00ul
-/* ? 0x00001000ul */
-# define DP_HOST_TRIPLE_EN 0x00002000ul /* GT2c/VT4 */
-# define DP_SRC_AUTONA_FIX_DIS 0x00004000ul /* GTB */
-# define DP_FAST_SRCCOPY_DIS 0x00008000ul /* GTB */
-# define DP_HOST_PIX_WIDTH 0x000f0000ul
-# define DP_CI4_RGB_INDEX 0x00f00000ul /* GTB */
-# define DP_BYTE_PIX_ORDER 0x01000000ul
-# define DP_CONVERSION_TEMP 0x02000000ul /* GTB */
-# define DP_CI4_RGB_LOW_NIBBLE 0x04000000ul /* GTB */
-# define DP_C14_RGB_HIGH_NIBBLE 0x08000000ul /* GTB */
-# define DP_SCALE_PIX_WIDTH 0xf0000000ul /* GTB */
-#define DP_MIX BlockIOTag(0xb5u)
-# define BKGD_MIX_NOT_D (0 << 0)
-# define BKGD_MIX_ZERO (1 << 0)
-# define BKGD_MIX_ONE (2 << 0)
-# define BKGD_MIX_D (3 << 0)
-# define BKGD_MIX_NOT_S (4 << 0)
-# define BKGD_MIX_D_XOR_S (5 << 0)
-# define BKGD_MIX_NOT_D_XOR_S (6 << 0)
-# define BKGD_MIX_S (7 << 0)
-# define BKGD_MIX_NOT_D_OR_NOT_S (8 << 0)
-# define BKGD_MIX_D_OR_NOT_S (9 << 0)
-# define BKGD_MIX_NOT_D_OR_S (10 << 0)
-# define BKGD_MIX_D_OR_S (11 << 0)
-# define BKGD_MIX_D_AND_S (12 << 0)
-# define BKGD_MIX_NOT_D_AND_S (13 << 0)
-# define BKGD_MIX_D_AND_NOT_S (14 << 0)
-# define BKGD_MIX_NOT_D_AND_NOT_S (15 << 0)
-# define BKGD_MIX_D_PLUS_S_DIV2 (23 << 0)
-# define FRGD_MIX_NOT_D (0 << 16)
-# define FRGD_MIX_ZERO (1 << 16)
-# define FRGD_MIX_ONE (2 << 16)
-# define FRGD_MIX_D (3 << 16)
-# define FRGD_MIX_NOT_S (4 << 16)
-# define FRGD_MIX_D_XOR_S (5 << 16)
-# define FRGD_MIX_NOT_D_XOR_S (6 << 16)
-# define FRGD_MIX_S (7 << 16)
-# define FRGD_MIX_NOT_D_OR_NOT_S (8 << 16)
-# define FRGD_MIX_D_OR_NOT_S (9 << 16)
-# define FRGD_MIX_NOT_D_OR_S (10 << 16)
-# define FRGD_MIX_D_OR_S (11 << 16)
-# define FRGD_MIX_D_AND_S (12 << 16)
-# define FRGD_MIX_NOT_D_AND_S (13 << 16)
-# define FRGD_MIX_D_AND_NOT_S (14 << 16)
-# define FRGD_MIX_NOT_D_AND_NOT_S (15 << 16)
-# define FRGD_MIX_D_PLUS_S_DIV2 (23 << 16)
-#define DP_SRC BlockIOTag(0xb6u)
-# define BKGD_SRC_BKGD_CLR (0 << 0)
-# define BKGD_SRC_FRGD_CLR (1 << 0)
-# define BKGD_SRC_HOST (2 << 0)
-# define BKGD_SRC_BLIT (3 << 0)
-# define BKGD_SRC_PATTERN (4 << 0)
-# define BKGD_SRC_3D (5 << 0)
-# define FRGD_SRC_BKGD_CLR (0 << 8)
-# define FRGD_SRC_FRGD_CLR (1 << 8)
-# define FRGD_SRC_HOST (2 << 8)
-# define FRGD_SRC_BLIT (3 << 8)
-# define FRGD_SRC_PATTERN (4 << 8)
-# define FRGD_SRC_3D (5 << 8)
-# define MONO_SRC_ONE (0 << 16)
-# define MONO_SRC_PATTERN (1 << 16)
-# define MONO_SRC_HOST (2 << 16)
-# define MONO_SRC_BLIT (3 << 16)
-#define DP_FRGD_CLR_MIX BlockIOTag(0xb7u) /* VTB/GTB */
-#define DP_FRGD_BKGD_CLR BlockIOTag(0xb8u) /* VTB/GTB */
-/* ? BlockIOTag(0xb9u) */
-#define DST_X_Y BlockIOTag(0xbau) /* VTB/GTB */
-#define DST_WIDTH_HEIGHT BlockIOTag(0xbbu) /* VTB/GTB */
-#define USR_DST_PITCH BlockIOTag(0xbcu) /* GTPro */
-/* ? BlockIOTag(0xbdu) */
-#define DP_SET_GUI_ENGINE2 BlockIOTag(0xbeu) /* GTPro */
-#define DP_SET_GUI_ENGINE BlockIOTag(0xbfu) /* VTB/GTB */
-#define CLR_CMP_CLR BlockIOTag(0xc0u)
-#define CLR_CMP_MSK BlockIOTag(0xc1u)
-#define CLR_CMP_CNTL BlockIOTag(0xc2u)
-# define CLR_CMP_FN 0x00000007ul
-# define CLR_CMP_FN_FALSE 0x00000000ul
-# define CLR_CMP_FN_TRUE 0x00000001ul
-/* ? 0x00000002ul */
-/* ? 0x00000003ul */
-# define CLR_CMP_FN_NOT_EQUAL 0x00000004ul
-# define CLR_CMP_FN_EQUAL 0x00000005ul
-/* ? 0x00000006ul */
-/* ? 0x00000007ul */
-/* ? 0x00fffff8ul */
-# define CLR_CMP_SRC 0x03000000ul
-# define CLR_CMP_SRC_DST 0x00000000ul
-# define CLR_CMP_SRC_2D 0x01000000ul
-# define CLR_CMP_SRC_TEXEL 0x02000000ul
-/* ? 0x03000000ul */
-/* ? 0xfc000000ul */
-/* ? BlockIOTag(0xc3u) */
-#define FIFO_STAT BlockIOTag(0xc4u)
-# define FIFO_STAT_BITS 0x0000fffful
-/* ? 0x7fff0000ul */
-# define FIFO_ERR 0x80000000ul
-/* ? BlockIOTag(0xc5u) */
-/* ? BlockIOTag(0xc6u) */
-/* ? BlockIOTag(0xc7u) */
-#define CONTEXT_MASK BlockIOTag(0xc8u)
-/* ? BlockIOTag(0xc9u) */
-/* ? BlockIOTag(0xcau) */
-#define CONTEXT_LOAD_CNTL BlockIOTag(0xcbu)
-# define CONTEXT_LOAD_PTR 0x00007ffful
-/* ? 0x00008000ul */
-# define CONTEXT_LOAD_CMD 0x00030000ul
-# define CONTEXT_LOAD_NONE 0x00000000ul
-# define CONTEXT_LOAD_ONLY 0x00010000ul
-# define CONTEXT_LOAD_FILL 0x00020000ul
-# define CONTEXT_LOAD_LINE 0x00030000ul
-/* ? 0x7ffc0000ul */
-#define CONTEXT_LOAD_DIS 0x80000000ul
-#define GUI_TRAJ_CNTL BlockIOTag(0xccu)
-/* ? BlockIOTag(0xcdu) */
-#define GUI_STAT BlockIOTag(0xceu)
-#define GUI_ACTIVE 0x00000001ul
-/* ? 0x000000feul */
-#define DSTX_LT_SCISSOR_LEFT 0x00000100ul
-#define DSTX_GT_SCISSOR_RIGHT 0x00000200ul
-#define DSTY_LT_SCISSOR_TOP 0x00000400ul
-#define DSTY_GT_SCISSOR_BOTTOM 0x00000800ul
-/* ? 0x0000f000ul */
-#define GUI_FIFO 0x03ff0000ul /* VTB/GTB */
-/* ? 0xfc000000ul */
-/* ? BlockIOTag(0xcfu) */
-#define S_X_INC2 BlockIOTag(0xd0u) /* GTB */
-#define TEX_PALETTE_INDEX BlockIOTag(0xd0u) /* GTPro */
-#define S_Y_INC2 BlockIOTag(0xd1u) /* GTB */
-#define STW_EXP BlockIOTag(0xd1u) /* GTPro */
-#define S_XY_INC2 BlockIOTag(0xd2u) /* GTB */
-#define LOG_MAX_INC BlockIOTag(0xd2u) /* GTPro */
-#define S_XINC_START BlockIOTag(0xd3u) /* GTB */
-/* S_Y_INC BlockIOTag(0xd4u) */ /* Duplicate */
-/* SCALE_Y_PITCH BlockIOTag(0xd4u) */ /* Duplicate */
-#define S_START BlockIOTag(0xd5u) /* GTB */
-#define T_X_INC2 BlockIOTag(0xd6u) /* GTB */
-#define W_X_INC BlockIOTag(0xd6u) /* GTPro */
-#define T_Y_INC2 BlockIOTag(0xd7u) /* GTB */
-#define W_Y_INC BlockIOTag(0xd7u) /* GTPro */
-#define T_XY_INC2 BlockIOTag(0xd8u) /* GTB */
-#define W_START BlockIOTag(0xd8u) /* GTPro */
-#define T_XINC_START BlockIOTag(0xd9u) /* GTB */
-#define T_Y_INC BlockIOTag(0xdau) /* GTB */
-#define SECONDARY_SCALE_PITCH BlockIOTag(0xdau) /* GTPro */
-#define T_START BlockIOTag(0xdbu) /* GTB */
-#define TEX_SIZE_PITCH BlockIOTag(0xdcu) /* GTB */
-#define TEX_CNTL BlockIOTag(0xddu) /* GTPro */
-#define SECONDARY_TEX_OFFSET BlockIOTag(0xdeu) /* GTPro */
-#define TEX_PAL_WR BlockIOTag(0xdfu) /* GTB */
-#define TEX_PALETTE BlockIOTag(0xdfu) /* GTPro */
-#define SCALE_PITCH_BOTH BlockIOTag(0xe0u) /* GTPro */
-#define SECONDARY_SCALE_OFF_ACC BlockIOTag(0xe1u) /* GTPro */
-#define SCALE_OFF_ACC BlockIOTag(0xe2u) /* GTPro */
-#define SCALE_DST_Y_X BlockIOTag(0xe3u) /* GTPro */
-/* ? BlockIOTag(0xe4u) */
-/* ? BlockIOTag(0xe5u) */
-#define COMPOSITE_SHADOW_ID BlockIOTag(0xe6u) /* GTPro */
-#define SECONDARY_SCALE_X_INC BlockIOTag(0xe7u) /* GTPro */
-#define SPECULAR_RED_X_INC BlockIOTag(0xe7u) /* GTPro */
-#define SPECULAR_RED_Y_INC BlockIOTag(0xe8u) /* GTPro */
-#define SPECULAR_RED_START BlockIOTag(0xe9u) /* GTPro */
-#define SECONDARY_SCALE_HACC BlockIOTag(0xe9u) /* GTPro */
-#define SPECULAR_GREEN_X_INC BlockIOTag(0xeau) /* GTPro */
-#define SPECULAR_GREEN_Y_INC BlockIOTag(0xebu) /* GTPro */
-#define SPECULAR_GREEN_START BlockIOTag(0xecu) /* GTPro */
-#define SPECULAR_BLUE_X_INC BlockIOTag(0xedu) /* GTPro */
-#define SPECULAR_BLUE_Y_INC BlockIOTag(0xeeu) /* GTPro */
-#define SPECULAR_BLUE_START BlockIOTag(0xefu) /* GTPro */
-/* SCALE_X_INC BlockIOTag(0xf0u) */ /* Duplicate */
-/* RED_X_INC BlockIOTag(0xf0u) */ /* Duplicate */
-#define RED_Y_INC BlockIOTag(0xf1u) /* GTB */
-#define SCALE_HACC BlockIOTag(0xf2u) /* GTB */
-#define RED_START BlockIOTag(0xf2u) /* GTB */
-/* GREEN_X_INC BlockIOTag(0xf3u) */ /* Duplicate */
-/* SCALE_Y_INC BlockIOTag(0xf3u) */ /* Duplicate */
-#define GREEN_Y_INC BlockIOTag(0xf4u) /* GTB */
-#define SECONDARY_SCALE_Y_INC BlockIOTag(0xf4u) /* GTPro */
-#define SECONDARY_SCALE_VACC BlockIOTag(0xf5u) /* GTPro */
-#define GREEN_START BlockIOTag(0xf5u) /* GTB */
-#define BLUE_X_INC BlockIOTag(0xf6u) /* GTB */
-#define SCALE_XUV_INC BlockIOTag(0xf6u) /* GTB */
-#define BLUE_Y_INC BlockIOTag(0xf7u) /* GTB */
-#define BLUE_START BlockIOTag(0xf8u) /* GTB */
-#define SCALE_UV_HACC BlockIOTag(0xf8u) /* GTB */
-#define Z_X_INC BlockIOTag(0xf9u) /* GTB */
-#define Z_Y_INC BlockIOTag(0xfau) /* GTB */
-#define Z_START BlockIOTag(0xfbu) /* GTB */
-#define ALPHA_FOG_X_INC BlockIOTag(0xfcu) /* GTB */
-#define ALPHA_FOG_Y_INC BlockIOTag(0xfdu) /* GTB */
-#define ALPHA_FOG_START BlockIOTag(0xfeu) /* GTB */
-/* ? BlockIOTag(0xffu) */
-#define OVERLAY_Y_X_START BlockIOTag(0x100u)
-# define OVERLAY_Y_START 0x000007FFUL
-# define OVERLAY_X_START 0x07FF0000UL
-# define OVERLAY_LOCK_START 0x80000000UL
-#define OVERLAY_Y_X_END BlockIOTag(0x101u)
-# define OVERLAY_Y_END 0x000007FFUL
-# define OVERLAY_X_END 0x07FF0000UL
-# define OVERLAY_LOCK_END 0x80000000UL
-#define OVERLAY_VIDEO_KEY_CLR BlockIOTag(0x102u)
-#define OVERLAY_VIDEO_KEY_MSK BlockIOTag(0x103u)
-#define OVERLAY_GRAPHICS_KEY_CLR BlockIOTag(0x104u)
-#define OVERLAY_GRAPHICS_KEY_MSK BlockIOTag(0x105u)
-#define OVERLAY_KEY_CNTL BlockIOTag(0x106u)
-# define VIDEO_KEY_FN_MASK 0x00000007L
-# define VIDEO_KEY_FN_FALSE 0x00000000L
-# define VIDEO_KEY_FN_TRUE 0x00000001L
-# define VIDEO_KEY_FN_NE 0x00000004L
-# define VIDEO_KEY_FN_EQ 0x00000005L // EQ and NE are exchanged relative to radeon
-# define GRAPHIC_KEY_FN_MASK 0x00000070L
-# define GRAPHIC_KEY_FN_FALSE 0x00000000L
-# define GRAPHIC_KEY_FN_TRUE 0x00000010L
-# define GRAPHIC_KEY_FN_NE 0x00000040L
-# define GRAPHIC_KEY_FN_EQ 0x00000050L // EQ and NE are exchanged relative to radeon
-# define CMP_MIX_MASK 0x00000100L
-# define CMP_MIX_OR 0x00000000L
-# define CMP_MIX_AND 0x00000100L
-/* ? BlockIOTag(0x107u) */
-#define OVERLAY_SCALE_INC BlockIOTag(0x108u)
-#define OVERLAY_SCALE_CNTL BlockIOTag(0x109u)
-# define SCALE_PIX_EXPAND 0x00000001UL
-# define SCALE_Y2R_TEMP 0x00000002UL
-# define SCALE_HORZ_MODE 0x00000004UL
-# define SCALE_VERT_MODE 0x00000008UL
-# define SCALE_SIGNED_UV 0x00000010UL
-# define SCALE_GAMMA_SEL_MSK 0x00000060UL
-# define SCALE_GAMMA_SEL_BRIGHT 0x00000000UL
-# define SCALE_GAMMA_SEL_G22 0x00000020UL
-# define SCALE_GAMMA_SEL_G18 0x00000040UL
-# define SCALE_GAMMA_SEL_G14 0x00000060UL
-# define SCALE_SEL_DISP2 0x00000080UL /* pro only */
-# define SCALE_BANDWIDTH 0x04000000UL
-# define SCALE_DIS_LIMIT 0x08000000UL
-# define SCALE_CLK_FORCE_ON 0x20000000UL
-# define OVERLAY_EN 0x40000000UL
-# define SCALE_EN 0x80000000UL
-#define SCALER_HEIGHT_WIDTH BlockIOTag(0x10au)
-#define OVERLAY_TEST BlockIOTag(0x10bu)
-# define SCALE_SUBPIC_ONLY 0x00000001UL
-# define SCALE_Y2R_DIS 0x00000002UL
-#define SCALER_THRESHOLD BlockIOTag(0x10cu)
-#define SCALER_BUF0_OFFSET BlockIOTag(0x10du) /* VTB/GTB */
-#define SCALER_BUF1_OFFSET BlockIOTag(0x10eu) /* VTB/GTB */
-#define SCALER_BUF_PITCH BlockIOTag(0x10fu) /* VTB/GTB */
-#define CAPTURE_Y_X BlockIOTag(0x110u)
-#define CAPTURE_START_END BlockIOTag(0x110u) /* VTB/GTB */
-#define CAPTURE_HEIGHT_WIDTH BlockIOTag(0x111u)
-#define CAPTURE_X_WIDTH BlockIOTag(0x111u) /* VTB/GTB */
-#define VIDEO_FORMAT BlockIOTag(0x112u)
-# define VIDEO_IN_MSK 0x0000000FUL
-# define VIDEO_IN_VYUY422 0x0000000BUL
-# define VIDEO_IN_YVYU422 0x0000000CUL
-# define VIDEO_SIGNED_UV 0x00000010UL
-# define SCALER_IN_MSK 0x000F0000UL
-# define SCALER_IN_RGB15 0x00030000UL
-# define SCALER_IN_RGB16 0x00040000UL
-# define SCALER_IN_RGB32 0x00060000UL
-# define SCALER_IN_YUV9 0x00090000UL
-# define SCALER_IN_YUV12 0x000A0000UL
-# define SCALER_IN_VYUY422 0x000B0000UL
-# define SCALER_IN_YVYU422 0x000C0000UL
-# define HOST_BYTE_SHIFT_EN 0x10000000UL
-# define HOST_YUV_APER 0x20000000UL
-# define HOST_MEM_MODE_MSK 0xC0000000UL
-# define HOST_MEM_MODE_NORMAL 0x00000000UL
-# define HOST_MEM_MODE_Y 0x40000000UL
-# define HOST_MEM_MODE_U 0x80000000UL
-# define HOST_MEM_MODE_V 0xC0000000UL
-#define VIDEO_CONFIG BlockIOTag(0x113u)
-#define VBI_START_END BlockIOTag(0x113u) /* VTB/GTB */
-#define CAPTURE_CONFIG BlockIOTag(0x114u)
-#define TRIG_CNTL BlockIOTag(0x115u)
-#define VIDEO_SYNC_TEST BlockIOTag(0x116u)
-#define OVERLAY_EXCLUSIVE_HORZ BlockIOTag(0x116u) /* VTB/GTB */
-# define EXCLUSIVE_HORZ_START 0x000000FFUL
-# define EXCLUSIVE_HORZ_END 0x0000FF00UL
-# define EXCLUSIVE_BACK_PORSH 0x00FF0000UL
-# define EXCLUSIVE_EN 0x80000000UL
-#define EXT_CRTC_GEN_CNTL_R BlockIOTag(0x117u) /* VT-A4 (R) */
-#define OVERLAY_EXCLUSIVE_VERT BlockIOTag(0x117u) /* VTB/GTB */
-# define EXCLUSIVE_VERT_START 0x000007FFUL
-# define EXCLUSIVE_VERT_END 0x07FF0000UL
-#define VMC_CONFIG BlockIOTag(0x118u)
-#define VBI_WIDTH BlockIOTag(0x118u) /* VTB/GTB */
-#define VMC_STATUS BlockIOTag(0x119u)
-#define CAPTURE_DEBUG BlockIOTag(0x119u) /* VTB/GTB */
-#define VMC_CMD BlockIOTag(0x11au)
-#define VIDEO_SYNC_TEST_B BlockIOTag(0x11au) /* VTB/GTB */
-# define TEST_CRTC_OVLSOF 0x00000001UL
-# define TEST_CRTC_VOVLEN 0x00000002UL
-# define TEST_VID_SOF 0x00000100UL
-# define TEST_VID_EOF 0x00000200UL
-# define TEST_VID_EOL 0x00000400UL
-# define TEST_VID_FIELD 0x00000800UL
-# define TEST_END_OF_VBI 0x00001000UL
-# define TEST_BUSMASTER_EOL 0x00002000UL
-# define TEST_SYNC_EN 0x80000000UL
-#define VMC_ARG0 BlockIOTag(0x11bu)
-#define VMC_ARG1 BlockIOTag(0x11cu)
-#define SNAPSHOT_VH_COUNTS BlockIOTag(0x11cu) /* GTPro */
-#define VMC_SNOOP_ARG0 BlockIOTag(0x11du)
-#define SNAPSHOT_F_COUNT BlockIOTag(0x11du) /* GTPro */
-#define VMC_SNOOP_ARG1 BlockIOTag(0x11eu)
-#define N_VIF_COUNT BlockIOTag(0x11eu) /* GTPro */
-#define SNAPSHOT_VIF_COUNT BlockIOTag(0x11fu) /* GTPro */
-#define BUF0_OFFSET BlockIOTag(0x120u)
-#define CAPTURE_BUF0_OFFSET BlockIOTag(0x120u) /* VTB/GTB */
-#define CAPTURE_BUF1_OFFSET BlockIOTag(0x121u) /* VTB/GTB */
-#define ONESHOT_BUF_OFFSET BlockIOTag(0x122u) /* VTB/GTB */
-#define BUF0_PITCH BlockIOTag(0x123u)
-/* ? BlockIOTag(0x124u) */
-/* ? BlockIOTag(0x125u) */
-#define BUF1_OFFSET BlockIOTag(0x126u)
-/* ? BlockIOTag(0x127u) */
-/* ? BlockIOTag(0x128u) */
-#define BUF1_PITCH BlockIOTag(0x129u)
-/* ? BlockIOTag(0x12au) */
-#define BUF0_CAP_ODD_OFFSET BlockIOTag(0x12bu)
-#define BUF1_CAP_ODD_OFFSET BlockIOTag(0x12cu)
-#define SNAPSHOT2_VH_COUNTS BlockIOTag(0x12cu) /* LTPro */
-#define SNAPSHOT2_F_COUNT BlockIOTag(0x12du) /* LTPro */
-#define N_VIF2_COUNT BlockIOTag(0x12eu) /* LTPro */
-#define SNAPSHOT2_VIF_COUNT BlockIOTag(0x12fu) /* LTPro */
-#define VMC_STRM_DATA_0 BlockIOTag(0x130u)
-/* MPP_CONFIG BlockIOTag(0x130u) */ /* See 0x3bu */
-#define VMC_STRM_DATA_1 BlockIOTag(0x131u)
-/* MPP_STROBE_SEQ BlockIOTag(0x131u) */ /* See 0x3cu */
-#define VMC_STRM_DATA_2 BlockIOTag(0x132u)
-/* MPP_ADDR BlockIOTag(0x132u) */ /* See 0x3du */
-#define VMC_STRM_DATA_3 BlockIOTag(0x133u)
-/* MPP_DATA BlockIOTag(0x133u) */ /* See 0x3eu */
-#define VMC_STRM_DATA_4 BlockIOTag(0x134u)
-#define VMC_STRM_DATA_5 BlockIOTag(0x135u)
-#define VMC_STRM_DATA_6 BlockIOTag(0x136u)
-#define VMC_STRM_DATA_7 BlockIOTag(0x137u)
-#define VMC_STRM_DATA_8 BlockIOTag(0x138u)
-#define VMC_STRM_DATA_9 BlockIOTag(0x139u)
-#define VMC_STRM_DATA_A BlockIOTag(0x13au)
-#define VMC_STRM_DATA_B BlockIOTag(0x13bu)
-#define VMC_STRM_DATA_C BlockIOTag(0x13cu)
-#define VMC_STRM_DATA_D BlockIOTag(0x13du)
-#define VMC_STRM_DATA_E BlockIOTag(0x13eu)
-#define VMC_STRM_DATA_F BlockIOTag(0x13fu)
-/* TVO_CNTL BlockIOTag(0x140u) */ /* See 0x3fu */
-/* ? BlockIOTag(0x141u) */
-/* ? BlockIOTag(0x142u) */
-/* ? BlockIOTag(0x143u) */
-/* ? BlockIOTag(0x144u) */
-/* ? BlockIOTag(0x145u) */
-/* ? BlockIOTag(0x146u) */
-/* ? BlockIOTag(0x147u) */
-/* ? BlockIOTag(0x148u) */
-/* ? BlockIOTag(0x149u) */
-/* ? BlockIOTag(0x14au) */
-/* ? BlockIOTag(0x14bu) */
-/* ? BlockIOTag(0x14cu) */
-/* ? BlockIOTag(0x14du) */
-/* ? BlockIOTag(0x14eu) */
-/* ? BlockIOTag(0x14fu) */
-/* ? BlockIOTag(0x150u) */
-#define CRT_HORZ_VERT_LOAD BlockIOTag(0x151u) /* VTB/GTB */
-#define AGP_BASE BlockIOTag(0x152u) /* GTPro */
-#define AGP_CNTL BlockIOTag(0x153u) /* GTPro */
-#define SCALER_COLOUR_CNTL BlockIOTag(0x154u) /* GTPro */
-# define COLOUR_BRIGHTNESS 0x0000007FUL
-# define COLOUR_SATURATION_U 0x00001F00UL
-# define COLOUR_SATURATION_V 0x001F0000UL
-# define SCALER_VERT_ADJ_UV 0x0FE00000UL
-/*# define SCALER_VERT_ADJ_UV 0x0F000000UL (need testing) */
-# define SCALER_HORZ_ADJ_UV 0xF0000000UL
-#define SCALER_H_COEFF0 BlockIOTag(0x155u) /* GTPro */
-#define SCALER_H_COEFF1 BlockIOTag(0x156u) /* GTPro */
-#define SCALER_H_COEFF2 BlockIOTag(0x157u) /* GTPro */
-#define SCALER_H_COEFF3 BlockIOTag(0x158u) /* GTPro */
-#define SCALER_H_COEFF4 BlockIOTag(0x159u) /* GTPro */
-/* ? BlockIOTag(0x15au) */
-/* ? BlockIOTag(0x15bu) */
-#define GUI_CMDFIFO_DEBUG BlockIOTag(0x15cu) /* GT2c/VT4 */
-#define GUI_CMDFIFO_DATA BlockIOTag(0x15du) /* GT2c/VT4 */
-#define GUI_CNTL BlockIOTag(0x15eu) /* GT2c/VT4 */
-# define CMDFIFO_SIZE_MASK 0x00000003ul
-# define CMDFIFO_SIZE_192 0x00000000ul
-# define CMDFIFO_SIZE_128 0x00000001ul
-# define CMDFIFO_SIZE_64 0x00000002ul
-/* ? 0x0000fffcul */
-# define IDCT_PRSR_MODE 0x00010000ul /* XL/XC */
-# define IDCT_BLOCK_GUI_INITIATOR 0x00020000ul /* XL/XC */
-/* ? 0xfffc0000ul */
-/* ? BlockIOTag(0x15fu) */
-/* BUS MASTERING */
-#define BM_FRAME_BUF_OFFSET BlockIOTag(0x160u) /* VTB/GTB read-only */
-#define BM_SYSTEM_MEM_ADDR BlockIOTag(0x161u) /* VTB/GTB read-only */
-#define BM_COMMAND BlockIOTag(0x162u) /* VTB/GTB read-only */
-# define BM_CMD_BYTE_COUNT 0x00001FFFUL
-# define BM_CMD_HOLD_OFFSET 0x40000000UL
-# define BM_CMD_EOL 0x80000000UL
-#define BM_STATUS BlockIOTag(0x163u) /* VTB/GTB read-only */
-/* ? BlockIOTag(0x164u) */
-/* ? BlockIOTag(0x165u) */
-/* ? BlockIOTag(0x166u) */
-/* ? BlockIOTag(0x167u) */
-/* ? BlockIOTag(0x168u) */
-/* ? BlockIOTag(0x169u) */
-/* ? BlockIOTag(0x16au) */
-/* ? BlockIOTag(0x16bu) */
-/* ? BlockIOTag(0x16cu) */
-/* ? BlockIOTag(0x16du) */
-#define BM_GUI_TABLE BlockIOTag(0x16eu) /* VTB/GTB */
-#define BM_SYSTEM_TABLE BlockIOTag(0x16fu) /* VTB/GTB */
-# define DMA_GUI_COMMAND__BYTE_COUNT_MASK 0x001ffff0
-# define DMA_GUI_COMMAND__HOLD_VIDEO_OFFSET 0x40000000
-# define DMA_GUI_COMMAND__EOL 0x80000000
-# define SYSTEM_TRIGGER_MASK 0x7
-# define SYSTEM_TRIGGER_SYSTEM_TO_VIDEO 0x0
-# define SYSTEM_TRIGGER_VIDEO_TO_SYSTEM 0x1
-# define SYSTEM_TRIGGER_VIDEO_TO_SYSTEM_AFTER_BUF0_READY 0x2
-# define SYSTEM_TRIGGER_VIDEO_TO_SYSTEM_AFTER_BUF1_READY 0x3
-# define SYSTEM_TRIGGER_VIDEO_TO_SYSTEM_AFTER_SNAPSHOT_READY 0x4
-# define SYSTEM_TRIGGER_SYSTEM_TO_MPP 0x5
-/* ? BlockIOTag(0x170u) */
-/* ? BlockIOTag(0x171u) */
-/* ? BlockIOTag(0x172u) */
-/* ? BlockIOTag(0x173u) */
-/* ? BlockIOTag(0x174u) */
-#define SCALER_BUF0_OFFSET_V BlockIOTag(0x175u) /* GTPro */
-#define SCALER_BUF0_OFFSET_U BlockIOTag(0x176u) /* GTPro */
-#define SCALER_BUF1_OFFSET_V BlockIOTag(0x177u) /* GTPro */
-#define SCALER_BUF1_OFFSET_U BlockIOTag(0x178u) /* GTPro */
-/* ? BlockIOTag(0x179u) */
-/* ? BlockIOTag(0x17au) */
-/* ? BlockIOTag(0x17bu) */
-/* ? BlockIOTag(0x17cu) */
-/* ? BlockIOTag(0x17du) */
-/* ? BlockIOTag(0x17eu) */
-/* ? BlockIOTag(0x17fu) */
-/* ? BlockIOTag(0x180u) */
-/* ? BlockIOTag(0x181u) */
-/* ? BlockIOTag(0x182u) */
-/* ? BlockIOTag(0x183u) */
-/* ? BlockIOTag(0x184u) */
-/* ? BlockIOTag(0x185u) */
-/* ? BlockIOTag(0x186u) */
-/* ? BlockIOTag(0x187u) */
-/* ? BlockIOTag(0x188u) */
-/* ? BlockIOTag(0x189u) */
-/* ? BlockIOTag(0x18au) */
-/* ? BlockIOTag(0x18bu) */
-/* ? BlockIOTag(0x18cu) */
-/* ? BlockIOTag(0x18du) */
-/* ? BlockIOTag(0x18eu) */
-/* ? BlockIOTag(0x18fu) */
-#define VERTEX_1_S BlockIOTag(0x190u) /* GTPro */
-#define VERTEX_1_T BlockIOTag(0x191u) /* GTPro */
-#define VERTEX_1_W BlockIOTag(0x192u) /* GTPro */
-#define VERTEX_1_SPEC_ARGB BlockIOTag(0x193u) /* GTPro */
-#define VERTEX_1_Z BlockIOTag(0x194u) /* GTPro */
-#define VERTEX_1_ARGB BlockIOTag(0x195u) /* GTPro */
-#define VERTEX_1_X_Y BlockIOTag(0x196u) /* GTPro */
-#define ONE_OVER_AREA BlockIOTag(0x197u) /* GTPro */
-#define VERTEX_2_S BlockIOTag(0x198u) /* GTPro */
-#define VERTEX_2_T BlockIOTag(0x199u) /* GTPro */
-#define VERTEX_2_W BlockIOTag(0x19au) /* GTPro */
-#define VERTEX_2_SPEC_ARGB BlockIOTag(0x19bu) /* GTPro */
-#define VERTEX_2_Z BlockIOTag(0x19cu) /* GTPro */
-#define VERTEX_2_ARGB BlockIOTag(0x19du) /* GTPro */
-#define VERTEX_2_X_Y BlockIOTag(0x19eu) /* GTPro */
-/* ONE_OVER_AREA BlockIOTag(0x19fu) */ /* Duplicate */
-#define VERTEX_3_S BlockIOTag(0x1a0u) /* GTPro */
-#define VERTEX_3_T BlockIOTag(0x1a1u) /* GTPro */
-#define VERTEX_3_W BlockIOTag(0x1a2u) /* GTPro */
-#define VERTEX_3_SPEC_ARGB BlockIOTag(0x1a3u) /* GTPro */
-#define VERTEX_3_Z BlockIOTag(0x1a4u) /* GTPro */
-#define VERTEX_3_ARGB BlockIOTag(0x1a5u) /* GTPro */
-#define VERTEX_3_X_Y BlockIOTag(0x1a6u) /* GTPro */
-/* ONE_OVER_AREA BlockIOTag(0x1a7u) */ /* Duplicate */
-#define VERTEX_3_SECONDARY_S BlockIOTag(0x1a8u) /* GTPro */
-#define VERTEX_3_SECONDARY_T BlockIOTag(0x1a9u) /* GTPro */
-#define VERTEX_3_SECONDARY_W BlockIOTag(0x1aau) /* GTPro */
-/* VERTEX_1_S BlockIOTag(0x1abu) */ /* Duplicate */
-/* VERTEX_1_T BlockIOTag(0x1acu) */ /* Duplicate */
-/* VERTEX_1_W BlockIOTag(0x1adu) */ /* Duplicate */
-/* VERTEX_2_S BlockIOTag(0x1aeu) */ /* Duplicate */
-/* VERTEX_2_T BlockIOTag(0x1afu) */ /* Duplicate */
-/* VERTEX_2_W BlockIOTag(0x1b0u) */ /* Duplicate */
-/* VERTEX_3_S BlockIOTag(0x1b1u) */ /* Duplicate */
-/* VERTEX_3_T BlockIOTag(0x1b2u) */ /* Duplicate */
-/* VERTEX_3_W BlockIOTag(0x1b3u) */ /* Duplicate */
-/* VERTEX_1_SPEC_ARGB BlockIOTag(0x1b4u) */ /* Duplicate */
-/* VERTEX_2_SPEC_ARGB BlockIOTag(0x1b5u) */ /* Duplicate */
-/* VERTEX_3_SPEC_ARGB BlockIOTag(0x1b6u) */ /* Duplicate */
-/* VERTEX_1_Z BlockIOTag(0x1b7u) */ /* Duplicate */
-/* VERTEX_2_Z BlockIOTag(0x1b8u) */ /* Duplicate */
-/* VERTEX_3_Z BlockIOTag(0x1b9u) */ /* Duplicate */
-/* VERTEX_1_ARGB BlockIOTag(0x1bau) */ /* Duplicate */
-/* VERTEX_2_ARGB BlockIOTag(0x1bbu) */ /* Duplicate */
-/* VERTEX_3_ARGB BlockIOTag(0x1bcu) */ /* Duplicate */
-/* VERTEX_1_X_Y BlockIOTag(0x1bdu) */ /* Duplicate */
-/* VERTEX_2_X_Y BlockIOTag(0x1beu) */ /* Duplicate */
-/* VERTEX_3_X_Y BlockIOTag(0x1bfu) */ /* Duplicate */
-#define ONE_OVER_AREA_UC BlockIOTag(0x1c0u) /* GTPro */
-#define SETUP_CNTL BlockIOTag(0x1c1u) /* GTPro */
-/* ? BlockIOTag(0x1c2u) */
-/* ? BlockIOTag(0x1c3u) */
-/* ? BlockIOTag(0x1c4u) */
-/* ? BlockIOTag(0x1c5u) */
-/* ? BlockIOTag(0x1c6u) */
-/* ? BlockIOTag(0x1c7u) */
-/* ? BlockIOTag(0x1c8u) */
-/* ? BlockIOTag(0x1c9u) */
-#define VERTEX_1_SECONDARY_S BlockIOTag(0x1cau) /* GTPro */
-#define VERTEX_1_SECONDARY_T BlockIOTag(0x1cbu) /* GTPro */
-#define VERTEX_1_SECONDARY_W BlockIOTag(0x1ccu) /* GTPro */
-#define VERTEX_2_SECONDARY_S BlockIOTag(0x1cdu) /* GTPro */
-#define VERTEX_2_SECONDARY_T BlockIOTag(0x1ceu) /* GTPro */
-#define VERTEX_2_SECONDARY_W BlockIOTag(0x1cfu) /* GTPro */
-/* IDCT and DVD's subpicture direct support (Rage Mobility only) */
-#define SUBPIC_CNTL BlockIOTag(0x1d0u)
-# define SUBPIC_ON 0x00000001UL
-# define BTN_HLI_ON 0x00000002UL
-# define SP_HORZ_MODE 0x00000010UL
-# define SP_VERT_MODE 0x00000020UL
-# define SP_ODD_FIELD 0x00000100UL
-# define SP_BUF_SELECT 0x00000200UL
-# define SP_NO_R_EDGE_BLEND 0x00000400UL
-#define SUBPIC_DEFCOLON BlockIOTag(0x1d1u)
-# define BKGD_PIX_CON 0x0000000FUL
-# define PATT_PIX_CON 0x000000F0UL
-# define EMPH_PIX1_CON 0x00000F00UL
-# define EMPH_PIX2_CON 0x0000F000UL
-# define BKGD_PIX_CLR 0x000F0000UL
-# define PATT_PIX_CLR 0x00F00000UL
-# define EMPH_PIX1_CLR 0x0F000000UL
-# define EMPH_PIX2_CLR 0xF0000000UL
-/* ? BlockIOTag(0x1d2u) */
-#define SUBPIC_Y_X_START BlockIOTag(0x1d3u)
-#define SUBPIC_Y_X_END BlockIOTag(0x1d4u)
-#define SUBPIC_V_INC BlockIOTag(0x1d5u)
-#define SUBPIC_H_INC BlockIOTag(0x1d6u)
-#define SUBPIC_BUF0_OFFSET BlockIOTag(0x1d7u)
-#define SUBPIC_BUF1_OFFSET BlockIOTag(0x1d8u)
-#define SUBPIC_LC0_OFFSET BlockIOTag(0x1d9u)
-#define SUBPIC_LC1_OFFSET BlockIOTag(0x1dau)
-#define SUBPIC_PITCH BlockIOTag(0x1dbu)
-# define SUBPIC_BUF_PITCH 0x00000FC0UL
-# define SUBPIC_LC_PITCH 0x0FC00000UL
-#define SUBPIC_BTN_HLI_COLCON BlockIOTag(0x1dcu)
-# define BTN_HLI_BKGD_PIX_CON 0x0000000FUL
-# define BTN_HLI_PATT_PIX_CON 0x000000F0UL
-# define BTN_HLI_EMPH_PIX1_CON 0x00000F00UL
-# define BTN_HLI_EMPH_PIX2_CON 0x0000F000UL
-# define BTN_HLI_BKGD_PIX_CLR 0x000F0000UL
-# define BTN_HLI_PATT_PIX_CLR 0x00F00000UL
-# define BTN_HLI_EMPH_PIX1_CLR 0x0F000000UL
-# define BTN_HLI_EMPH_PIX2_CLR 0xF0000000UL
-#define SUBPIC_BTN_Y_X_START BlockIOTag(0x1ddu)
-#define SUBPIC_BTN_Y_X_END BlockIOTag(0x1deu)
-#define SUBPIC_H_ACCUM_INIT BlockIOTag(0x1dfu)
-#define IDCT_RUNS BlockIOTag(0x1e0u)
-# define IDCT_RUNS_3 0x000000FFUL
-# define IDCT_RUNS_2 0x0000FF00UL
-# define IDCT_RUNS_1 0x00FF0000UL
-# define IDCT_RUNS_0 0xFF000000UL
-#define IDCT_LEVELS BlockIOTag(0x1e1u)
-# define IDCT_LEVELS_HI 0x0000FFFFUL
-# define IDCT_LEVELS_LO 0xFFFF0000UL
-#define IDCT_RESERVE_REGISTER1 BlockIOTag(0x1e2u)
-#define IDCT_RESERVE_REGISTER2 BlockIOTag(0x1e3u)
-/* ? BlockIOTag(0x1e4u) */
-/* ? BlockIOTag(0x1e5u) */
-#define SUBPIC_V_ACCUM_INIT BlockIOTag(0x1e6u)
-#define SUBPIC_PALETTE_INDEX BlockIOTag(0x1e7u)
-#define SUBPIC_PALETTE_DATA BlockIOTag(0x1e8u)
-/* ? BlockIOTag(0x1e9u) */
-/* ? BlockIOTag(0x1eau) */
-/* ? BlockIOTag(0x1ebu) */
-/* ? BlockIOTag(0x1ecu) */
-/* ? BlockIOTag(0x1edu) */
-/* ? BlockIOTag(0x1eeu) */
-#define IDCT_CONTROL BlockIOTag(0x1efu)
-# define IDCT_LUMA_RD_FORMAT_MSK 0x00000003UL
-# define IDCT_LUMA_RD_FORMAT_0123 0x00000000UL
-# define IDCT_LUMA_RD_FORMAT_0246 0x00000001UL
-# define IDCT_LUMA_RD_FORMAT_0819 0x00000002UL
-# define IDCT_CHROMA_RD_FMT_MSK 0x0000000CUL
-# define IDCT_CHROMA_RD_FMT_0123 0x00000000UL
-# define IDCT_CHROMA_RD_FMT_0246 0x00000004UL
-# define IDCT_CHROMA_RD_FMT_0819 0x00000008UL
-# define IDCT_CTL_SCAN_PATTERN 0x00000010UL
-# define IDCT_CTL_INTRA 0x00000020UL
-# define IDCT_CTL_FLUSH 0x00000040UL
-# define IDCT_CTL_PASSTHRU 0x00000080UL
-# define IDCT_CTL_SW_RESET 0x00000100UL
-# define IDCT_CONST_REQ 0x00000200UL
-# define IDCT_SCRAMBLE 0x00000400UL
-/* ? BlockIOTag(0x1f0u) */
-/* ? BlockIOTag(0x1f1u) */
-/* ? BlockIOTag(0x1f2u) */
-/* ? BlockIOTag(0x1f3u) */
-/* ? BlockIOTag(0x1f4u) */
-/* ? BlockIOTag(0x1f5u) */
-/* ? BlockIOTag(0x1f6u) */
-/* ? BlockIOTag(0x1f7u) */
-/* ? BlockIOTag(0x1f8u) */
-/* ? BlockIOTag(0x1f9u) */
-/* ? BlockIOTag(0x1fau) */
-/* ? BlockIOTag(0x1fbu) */
-/* ? BlockIOTag(0x1fcu) */
-/* ? BlockIOTag(0x1fdu) */
-/* ? BlockIOTag(0x1feu) */
-/* ? BlockIOTag(0x1ffu) */
-
-/* Definitions for MEM_CNTL's CTL_MEM_?????_APER_ENDIAN fields */
-#define CTL_MEM_APER_BYTE_ENDIAN 0x00u
-#define CTL_MEM_APER_WORD_ENDIAN 0x01u
-#define CTL_MEM_APER_LONG_ENDIAN 0x02u
-/* ? 0x03u */
-
-/* Definitions for an ICS2595's programme word */
-#define ICS2595_CLOCK 0x000001f0ul
-#define ICS2595_FB_DIV 0x0001fe00ul /* Feedback divider */
-#define ICS2595_POST_DIV 0x000c0000ul /* Post-divider */
-#define ICS2595_STOP 0x00300000ul /* Stop bits */
-#define ICS2595_TOGGLE (ICS2595_POST_DIV | ICS2595_STOP)
-
-/* Definitions for internal PLL registers on a 264xT */
-#define PLL_MPLL_CNTL 0x00u
-#define MPLL_PC_GAIN 0x07u
-#define MPLL_VC_GAIN 0x18u
-#define MPLL_D_CYC 0x60u
-#define MPLL_RANGE 0x80u
-#define VPLL_CNTL 0x01u
-#define VPLL_PC_GAIN 0x07u
-#define VPLL_VC_GAIN 0x18u
-#define VPLL_D_CYC 0x60u
-#define VPLL_RANGE 0x80u
-#define PLL_REF_DIV 0x02u
-#define PLL_GEN_CNTL 0x03u
-#define PLL_OVERRIDE 0x01u
-#define PLL_SLEEP 0x01u /* GTPro */
-#define PLL_MCLK_RESET 0x02u
-#define PLL_OSC_EN 0x04u
-#define PLL_EXT_CLK_EN 0x08u
-#define PLL_MCLK_SRC_SEL 0x70u
-#define PLL_EXT_CLK_CNTL 0x80u /* CT/ET */
-#define PLL_DLL_PWDN 0x80u /* VTB/GTB/LT */
-#define PLL_MCLK_FB_DIV 0x04u
-#define PLL_VCLK_CNTL 0x05u
-#define PLL_VCLK_SRC_SEL 0x03u
-#define PLL_VCLK_RESET 0x04u
-#define PLL_VCLK_INVERT 0x08u
-#define PLL_ECP_DIV 0x30u /* VT/GT */
-#define PLL_ERATE_GT_XRATE 0x40u /* VT/GT */
-#define PLL_SCALER_LOCK_EN 0x80u /* VT/GT */
-#define PLL_VCLK_POST_DIV 0x06u
-#define PLL_VCLK0_POST_DIV 0x03u
-#define PLL_VCLK1_POST_DIV 0x0cu
-#define PLL_VCLK2_POST_DIV 0x30u
-#define PLL_VCLK3_POST_DIV 0xc0u
-#define PLL_VCLK0_FB_DIV 0x07u
-#define PLL_VCLK1_FB_DIV 0x08u
-#define PLL_VCLK2_FB_DIV 0x09u
-#define PLL_VCLK3_FB_DIV 0x0au
-#define PLL_XCLK_CNTL 0x0bu /* VT/GT */
-#define PLL_XCLK_MCLK_RATIO 0x03u
-#define PLL_XCLK_SRC_SEL 0x07u /* VTB/GTB/LT */
-#define PLL_MFB_TIMES_4_2B 0x08u
-#define PLL_VCLK0_XDIV 0x10u
-#define PLL_VCLK1_XDIV 0x20u
-#define PLL_VCLK2_XDIV 0x40u
-#define PLL_VCLK3_XDIV 0x80u
-#define PLL_FCP_CNTL 0x0cu /* VT/GT */
-#define PLL_FCP_POST_DIV 0x0fu
-#define PLL_FCP_SRC_SEL 0x70u
-#define PLL_DCLK_BY2_EN 0x80u
-#define PLL_DLL_CNTL 0x0cu /* VTB/GTB/LT */
-#define PLL_DLL_REF_SRC 0x03u
-#define PLL_DLL_FB_SRC 0x0cu
-#define PLL_DLL_GAIN 0x30u
-#define PLL_DLL_RESET 0x40u
-#define PLL_DLL_HCLK_OUT_EN 0x80u
-#define PLL_VFC_CNTL 0x0du /* VT/GT */
-#define PLL_DCLK_INVB 0x01u
-#define PLL_DCLKBY2_EN 0x02u
-#define PLL_VFC_2PHASE 0x04u
-#define PLL_VFC_DELAY 0x18u
-#define PLL_VFC_DCLKBY2_SHIFT 0x20u
-/* ? 0x40u */
-#define PLL_TST_SRC_SEL_BIT5 0x80u /* VTB/GTB/LT */
-#define PLL_TEST_CNTL 0x0eu
-#define PLL_TST_SRC_SEL 0x1fu
-#define PLL_TST_DIVIDERS 0x20u
-#define PLL_TST_MASK_READ 0x40u
-#define PLL_TST_ANALOG_MON_EN 0x80u
-#define PLL_TEST_COUNT 0x0fu
-#define PLL_LVDSPLL_CNTL0 0x10u /* LT */
-#define PLL_FPDI_NS_TIMING 0x01u
-#define PLL_CURR_LEVEL 0x0eu
-#define PLL_LVDS_TEST_MODE 0xf0u
-#define PLL_LVDSPLL_CNTL1 0x11u /* LT */
-#define PLL_LPPL_RANGE 0x01u
-#define PLL_LPLL_DUTY 0x06u
-#define PLL_LPLL_VC_GAIN 0x18u
-#define PLL_LPLL_CP_GAIN 0xe0u
-#define PLL_AGP1_CNTL 0x12u /* GTPro */
-#define PLL_AGP2_CNTL 0x13u /* GTPro */
-#define PLL_DLL2_CNTL 0x14u /* GTPro */
-#define PLL_SCLK_FB_DIV 0x15u /* GTPro */
-#define PLL_SPLL_CNTL1 0x16u /* GTPro */
-#define PLL_SPLL_CNTL2 0x17u /* GTPro */
-#define PLL_APLL_STRAPS 0x18u /* GTPro */
-#define PLL_EXT_VPLL_CNTL 0x19u /* GTPro */
-#define PLL_EXT_VPLL_REF_SRC 0x03u
-#define PLL_EXT_VPLL_EN 0x04u
-#define PLL_EXT_VPLL_VGA_EN 0x08u
-#define PLL_EXT_VPLL_INSYNC 0x10u
-/* ? 0x60u */
-#define PLL_EXT_V2PLL_EN 0x80u
-#define PLL_EXT_VPLL_REF_DIV 0x1au /* GTPro */
-#define PLL_EXT_VPLL_FB_DIV 0x1bu /* GTPro */
-#define PLL_EXT_VPLL_MSB 0x1cu /* GTPro */
-#define PLL_HTOTAL_CNTL 0x1du /* GTPro */
-#define PLL_BYTE_CLK_CNTL 0x1eu /* GTPro */
-#define PLL_TV_REF_DIV 0x1fu /* LTPro */
-#define PLL_TV_FB_DIV 0x20u /* LTPro */
-#define PLL_TV_CNTL 0x21u /* LTPro */
-#define PLL_TV_GEN_CNTL 0x22u /* LTPro */
-#define PLL_V2_CNTL 0x23u /* LTPro */
-#define PLL_V2_GEN_CNTL 0x24u /* LTPro */
-#define PLL_V2_REF_DIV 0x25u /* LTPro */
-#define PLL_V2_FB_DIV 0x26u /* LTPro */
-#define PLL_V2_MSB 0x27u /* LTPro */
-#define PLL_HTOTAL2_CNTL 0x28u /* LTPro */
-#define PLL_YCLK_CNTL 0x29u /* XC/XL */
-#define PM_DYN_CLK_CNTL 0x2au /* XC/XL */
-/* ? 0x2bu */
-/* ? 0x2cu */
-/* ? 0x2du */
-/* ? 0x2eu */
-/* ? 0x2fu */
-/* ? 0x30u */
-/* ? 0x31u */
-/* ? 0x32u */
-/* ? 0x33u */
-/* ? 0x34u */
-/* ? 0x35u */
-/* ? 0x36u */
-/* ? 0x37u */
-/* ? 0x38u */
-/* ? 0x39u */
-/* ? 0x3au */
-/* ? 0x3bu */
-/* ? 0x3cu */
-/* ? 0x3du */
-/* ? 0x3eu */
-/* ? 0x3fu */
-
-/* Definitions for an LTPro's 32-bit LCD registers */
-#define LCD_CONFIG_PANEL 0x00u /* See LT's CONFIG_PANEL (0x1d) */
-#define LCD_GEN_CNTL 0x01u /* See LT's LCD_GEN_CTRL (0x35) */
-#define LCD_DSTN_CONTROL 0x02u /* See LT's DSTN_CONTROL (0x1f) */
-#define LCD_HFB_PITCH_ADDR 0x03u /* See LT's HFB_PITCH_ADDR (0x2a) */
-#define LCD_HORZ_STRETCHING 0x04u /* See LT's HORZ_STRETCHING (0x32) */
-#define LCD_VERT_STRETCHING 0x05u /* See LT's VERT_STRETCHING (0x33) */
-#define LCD_EXT_VERT_STRETCH 0x06u
-#define VERT_STRETCH_RATIO3 0x000003fful
-#define FORCE_DAC_DATA 0x000000fful
-#define FORCE_DAC_DATA_SEL 0x00000300ul
-#define VERT_STRETCH_MODE 0x00000400ul
-#define VERT_PANEL_SIZE 0x003ff800ul
-#define AUTO_VERT_RATIO 0x00400000ul
-#define USE_AUTO_FP_POS 0x00800000ul
-#define USE_AUTO_LCD_VSYNC 0x01000000ul
-/* ? 0xfe000000ul */
-#define LCD_LT_GIO 0x07u /* See LT's LT_GIO (0x2f) */
-#define LCD_POWER_MANAGEMENT 0x08u /* See LT's POWER_MANAGEMENT (0x36) */
-#define LCD_ZVGPIO 0x09u
-#define LCD_ICON_CLR0 0x0au /* XC/XL */
-#define LCD_ICON_CLR1 0x0bu /* XC/XL */
-#define LCD_ICON_OFFSET 0x0cu /* XC/XL */
-#define LCD_ICON_HORZ_VERT_POSN 0x0du /* XC/XL */
-#define LCD_ICON_HORZ_VERT_OFF 0x0eu /* XC/XL */
-#define LCD_ICON2_CLR0 0x0fu /* XC/XL */
-#define LCD_ICON2_CLR1 0x10u /* XC/XL */
-#define LCD_ICON2_OFFSET 0x11u /* XC/XL */
-#define LCD_ICON2_HORZ_VERT_POSN 0x12u /* XC/XL */
-#define LCD_ICON2_HORZ_VERT_OFF 0x13u /* XC/XL */
-#define LCD_MISC_CNTL 0x14u /* XC/XL */
-#define BL_MOD_LEVEL 0x000000fful
-#define BIAS_MOD_LEVEL 0x0000ff00ul
-#define BLMOD_EN 0x00010000ul
-#define BIASMOD_EN 0x00020000ul
-/* ? 0x00040000ul */
-#define PWRSEQ_MODE 0x00080000ul
-#define APC_EN 0x00100000ul
-#define MONITOR_DET_EN 0x00200000ul
-#define FORCE_DAC_DATA_SEL_X 0x00c00000ul
-#define FORCE_DAC_DATA_X 0xff000000ul
-#define LCD_TMDS_CNTL 0x15u /* XC/XL */
-#define LCD_TMDS_SYNC_CHAR_SETA 0x16u /* XC/XL */
-#define LCD_TMDS_SYNC_CHAR_SETB 0x17u /* XC/XL */
-#define LCD_TMDS_SRC 0x18u /* XC/XL */
-#define LCD_PLTSTBLK_CNTL 0x19u /* XC/XL */
-#define LCD_SYNC_GEN_CNTL 0x1au /* XC/XL */
-#define LCD_PATTERN_GEN_SEED 0x1bu /* XC/XL */
-#define LCD_APC_CNTL 0x1cu /* XC/XL */
-#define LCD_POWER_MANAGEMENT_2 0x1du /* XC/XL */
-#define LCD_XCLK_DISP_PM_EN 0x00000001ul
-#define LCD_XCLK_DISP2_PM_EN 0x00000002ul /* Mobility */
-#define LCD_XCLK_VID_PM_EN 0x00000004ul
-#define LCD_XCLK_SCL_PM_EN 0x00000008ul
-#define LCD_XCLK_GUI_PM_EN 0x00000010ul
-#define LCD_XCLK_SUB_PM_EN 0x00000020ul
-/* ? 0x000000c0ul */
-#define LCD_MCLK_PM_EN 0x00000100ul
-#define LCD_SS_EN 0x00000200ul
-#define LCD_BLON_DIGON_EN 0x00000400ul
-/* ? 0x00000800ul */
-#define LCD_PM_DYN_XCLK_SYNC 0x00003000ul
-#define LCD_SEL_W4MS 0x00004000ul
-/* ? 0x00008000ul */
-#define LCD_PM_DYN_XCLK_EN 0x00010000ul
-#define LCD_PM_XCLK_ALWAYS 0x00020000ul
-#define LCD_PM_DYN_XCLK_STATUS 0x00040000ul
-#define LCD_PCI_ACC_DIS 0x00080000ul
-#define LCD_PM_DYN_XCLK_DISP 0x00100000ul
-#define LCD_PM_DYN_XCLK_DISP2 0x00200000ul /* Mobility */
-#define LCD_PM_DYN_XCLK_VID 0x00400000ul
-#define LCD_PM_DYN_XCLK_HFB 0x00800000ul
-#define LCD_PM_DYN_XCLK_SCL 0x01000000ul
-#define LCD_PM_DYN_XCLK_SUB 0x02000000ul
-#define LCD_PM_DYN_XCLK_GUI 0x04000000ul
-#define LCD_PM_DYN_XCLK_HOST 0x08000000ul
-/* ? 0xf0000000ul */
-#define LCD_PRI_ERR_PATTERN 0x1eu /* XC/XL */
-#define LCD_CUR_ERR_PATTERN 0x1fu /* XC/XL */
-#define LCD_PLTSTBLK_RPT 0x20u /* XC/XL */
-#define LCD_SYNC_RPT 0x21u /* XC/XL */
-#define LCD_CRC_PATTERN_RPT 0x22u /* XC/XL */
-#define LCD_PL_TRANSMITTER_CNTL 0x23u /* XC/XL */
-#define LCD_PL_PLL_CNTL 0x24u /* XC/XL */
-#define LCD_ALPHA_BLENDING 0x25u /* XC/XL */
-#define LCD_PORTRAIT_GEN_CNTL 0x26u /* XC/XL */
-#define LCD_APC_CTRL_IO 0x27u /* XC/XL */
-#define LCD_TEST_IO 0x28u /* XC/XL */
-/* ? 0x29u */
-#define LCD_DP1_MEM_ACCESS 0x2au /* XC/XL */
-#define LCD_DP0_MEM_ACCESS 0x2bu /* XC/XL */
-#define LCD_DP0_DEBUG_A 0x2cu /* XC/XL */
-#define LCD_DP0_DEBUG_B 0x2du /* XC/XL */
-#define LCD_DP1_DEBUG_A 0x2eu /* XC/XL */
-#define LCD_DP1_DEBUG_B 0x2fu /* XC/XL */
-#define LCD_DPCTRL_DEBUG_A 0x30u /* XC/XL */
-#define LCD_DPCTRL_DEBUG_B 0x31u /* XC/XL */
-#define LCD_MEMBLK_DEBUG 0x32u /* XC/XL */
-#define LCD_APC_LUT_AB 0x33u /* XC/XL */
-#define LCD_APC_LUT_CD 0x34u /* XC/XL */
-#define LCD_APC_LUT_EF 0x35u /* XC/XL */
-#define LCD_APC_LUT_GH 0x36u /* XC/XL */
-#define LCD_APC_LUT_IJ 0x37u /* XC/XL */
-#define LCD_APC_LUT_KL 0x38u /* XC/XL */
-#define LCD_APC_LUT_MN 0x39u /* XC/XL */
-#define LCD_APC_LUT_OP 0x3au /* XC/XL */
-/* ? 0x3bu */
-/* ? 0x3cu */
-/* ? 0x3du */
-/* ? 0x3eu */
-/* ? 0x3fu */
-
-/* Definitions for an LTPro's TV registers */
-/* ? 0x00u */
-/* ? 0x01u */
-/* ? 0x02u */
-/* ? 0x03u */
-/* ? 0x04u */
-/* ? 0x05u */
-/* ? 0x06u */
-/* ? 0x07u */
-/* ? 0x08u */
-/* ? 0x09u */
-/* ? 0x0au */
-/* ? 0x0bu */
-/* ? 0x0cu */
-/* ? 0x0du */
-/* ? 0x0eu */
-/* ? 0x0fu */
-#define TV_MASTER_CNTL 0x10u
-/* ? 0x11u */
-#define TV_RGB_CNTL 0x12u
-/* ? 0x13u */
-#define TV_SYNC_CNTL 0x14u
-/* ? 0x15u */
-/* ? 0x16u */
-/* ? 0x17u */
-/* ? 0x18u */
-/* ? 0x19u */
-/* ? 0x1au */
-/* ? 0x1bu */
-/* ? 0x1cu */
-/* ? 0x1du */
-/* ? 0x1eu */
-/* ? 0x1fu */
-#define TV_HTOTAL 0x20u
-#define TV_HDISP 0x21u
-#define TV_HSIZE 0x22u
-#define TV_HSTART 0x23u
-#define TV_HCOUNT 0x24u
-#define TV_VTOTAL 0x25u
-#define TV_VDISP 0x26u
-#define TV_VCOUNT 0x27u
-#define TV_FTOTAL 0x28u
-#define TV_FCOUNT 0x29u
-#define TV_FRESTART 0x2au
-#define TV_HRESTART 0x2bu
-#define TV_VRESTART 0x2cu
-/* ? 0x2du */
-/* ? 0x2eu */
-/* ? 0x2fu */
-/* ? 0x30u */
-/* ? 0x31u */
-/* ? 0x32u */
-/* ? 0x33u */
-/* ? 0x34u */
-/* ? 0x35u */
-/* ? 0x36u */
-/* ? 0x37u */
-/* ? 0x38u */
-/* ? 0x39u */
-/* ? 0x3au */
-/* ? 0x3bu */
-/* ? 0x3cu */
-/* ? 0x3du */
-/* ? 0x3eu */
-/* ? 0x3fu */
-/* ? 0x40u */
-/* ? 0x41u */
-/* ? 0x42u */
-/* ? 0x43u */
-/* ? 0x44u */
-/* ? 0x45u */
-/* ? 0x46u */
-/* ? 0x47u */
-/* ? 0x48u */
-/* ? 0x49u */
-/* ? 0x4au */
-/* ? 0x4bu */
-/* ? 0x4cu */
-/* ? 0x4du */
-/* ? 0x4eu */
-/* ? 0x4fu */
-/* ? 0x50u */
-/* ? 0x51u */
-/* ? 0x52u */
-/* ? 0x53u */
-/* ? 0x54u */
-/* ? 0x55u */
-/* ? 0x56u */
-/* ? 0x57u */
-/* ? 0x58u */
-/* ? 0x59u */
-/* ? 0x5au */
-/* ? 0x5bu */
-/* ? 0x5cu */
-/* ? 0x5du */
-/* ? 0x5eu */
-/* ? 0x5fu */
-#define TV_HOST_READ_DATA 0x60u
-#define TV_HOST_WRITE_DATA 0x61u
-#define TV_HOST_RD_WT_CNTL 0x62u
-/* ? 0x63u */
-/* ? 0x64u */
-/* ? 0x65u */
-/* ? 0x66u */
-/* ? 0x67u */
-/* ? 0x68u */
-/* ? 0x69u */
-/* ? 0x6au */
-/* ? 0x6bu */
-/* ? 0x6cu */
-/* ? 0x6du */
-/* ? 0x6eu */
-/* ? 0x6fu */
-#define TV_VSCALER_CNTL 0x70u
-#define TV_TIMING_CNTL 0x71u
-#define TV_GAMMA_CNTL 0x72u
-#define TV_Y_FALL_CNTL 0x73u
-#define TV_Y_RISE_CNTL 0x74u
-#define TV_Y_SAW_TOOTH_CNTL 0x75u
-/* ? 0x76u */
-/* ? 0x77u */
-/* ? 0x78u */
-/* ? 0x79u */
-/* ? 0x7au */
-/* ? 0x7bu */
-/* ? 0x7cu */
-/* ? 0x7du */
-/* ? 0x7eu */
-/* ? 0x7fu */
-#define TV_MODULATOR_CNTL1 0x80u
-#define TV_MODULATOR_CNTL2 0x81u
-/* ? 0x82u */
-/* ? 0x83u */
-/* ? 0x84u */
-/* ? 0x85u */
-/* ? 0x86u */
-/* ? 0x87u */
-/* ? 0x88u */
-/* ? 0x89u */
-/* ? 0x8au */
-/* ? 0x8bu */
-/* ? 0x8cu */
-/* ? 0x8du */
-/* ? 0x8eu */
-/* ? 0x8fu */
-#define TV_PRE_DAC_MUX_CNTL 0x90u
-/* ? 0x91u */
-/* ? 0x92u */
-/* ? 0x93u */
-/* ? 0x94u */
-/* ? 0x95u */
-/* ? 0x96u */
-/* ? 0x97u */
-/* ? 0x98u */
-/* ? 0x99u */
-/* ? 0x9au */
-/* ? 0x9bu */
-/* ? 0x9cu */
-/* ? 0x9du */
-/* ? 0x9eu */
-/* ? 0x9fu */
-#define TV_DAC_CNTL 0xa0u
-/* ? 0xa1u */
-/* ? 0xa2u */
-/* ? 0xa3u */
-/* ? 0xa4u */
-/* ? 0xa5u */
-/* ? 0xa6u */
-/* ? 0xa7u */
-/* ? 0xa8u */
-/* ? 0xa9u */
-/* ? 0xaau */
-/* ? 0xabu */
-/* ? 0xacu */
-/* ? 0xadu */
-/* ? 0xaeu */
-/* ? 0xafu */
-#define TV_CRC_CNTL 0xb0u
-#define TV_VIDEO_PORT_SIG 0xb1u
-/* ? 0xb2u */
-/* ? 0xb3u */
-/* ? 0xb4u */
-/* ? 0xb5u */
-/* ? 0xb6u */
-/* ? 0xb7u */
-#define TV_VBI_CC_CNTL 0xb8u
-#define TV_VBI_EDS_CNTL 0xb9u
-#define TV_VBI_20BIT_CNTL 0xbau
-/* ? 0xbbu */
-/* ? 0xbcu */
-#define TV_VBI_DTO_CNTL 0xbdu
-#define TV_VBI_LEVEL_CNTL 0xbeu
-/* ? 0xbfu */
-#define TV_UV_ADR 0xc0u
-#define TV_FIFO_TEST_CNTL 0xc1u
-/* ? 0xc2u */
-/* ? 0xc3u */
-/* ? 0xc4u */
-/* ? 0xc5u */
-/* ? 0xc6u */
-/* ? 0xc7u */
-/* ? 0xc8u */
-/* ? 0xc9u */
-/* ? 0xcau */
-/* ? 0xcbu */
-/* ? 0xccu */
-/* ? 0xcdu */
-/* ? 0xceu */
-/* ? 0xcfu */
-/* ? 0xd0u */
-/* ? 0xd1u */
-/* ? 0xd2u */
-/* ? 0xd3u */
-/* ? 0xd4u */
-/* ? 0xd5u */
-/* ? 0xd6u */
-/* ? 0xd7u */
-/* ? 0xd8u */
-/* ? 0xd9u */
-/* ? 0xdau */
-/* ? 0xdbu */
-/* ? 0xdcu */
-/* ? 0xddu */
-/* ? 0xdeu */
-/* ? 0xdfu */
-/* ? 0xe0u */
-/* ? 0xe1u */
-/* ? 0xe2u */
-/* ? 0xe3u */
-/* ? 0xe4u */
-/* ? 0xe5u */
-/* ? 0xe6u */
-/* ? 0xe7u */
-/* ? 0xe8u */
-/* ? 0xe9u */
-/* ? 0xeau */
-/* ? 0xebu */
-/* ? 0xecu */
-/* ? 0xedu */
-/* ? 0xeeu */
-/* ? 0xefu */
-/* ? 0xf0u */
-/* ? 0xf1u */
-/* ? 0xf2u */
-/* ? 0xf3u */
-/* ? 0xf4u */
-/* ? 0xf5u */
-/* ? 0xf6u */
-/* ? 0xf7u */
-/* ? 0xf8u */
-/* ? 0xf9u */
-/* ? 0xfau */
-/* ? 0xfbu */
-/* ? 0xfcu */
-/* ? 0xfdu */
-/* ? 0xfeu */
-/* ? 0xffu */
-
-/* Miscellaneous */
-
-/* Current X, Y & Dest X, Y mask */
-#define COORD_MASK 0x07ffu
-
-/* Pixel widths */
-#define PIX_WIDTH_1BPP 0x00u
-#define PIX_WIDTH_4BPP 0x01u /* CRTC2: 8bpp */
-#define PIX_WIDTH_8BPP 0x02u /* CRTC2: Undefined */
-#define PIX_WIDTH_15BPP 0x03u
-#define PIX_WIDTH_16BPP 0x04u
-#define PIX_WIDTH_24BPP 0x05u
-#define PIX_WIDTH_32BPP 0x06u
-#define PIX_WIDTH_YUV422 0x07u /* CRTC2 only */
-
-/* Source definitions */
-#define SRC_BKGD 0x00u
-#define SRC_FRGD 0x01u
-#define SRC_HOST 0x02u
-#define SRC_BLIT 0x03u
-#define SRC_PATTERN 0x04u
-#define SRC_SCALER_3D 0x05u
-/* ? 0x06u */
-/* ? 0x07u */
-
-/* The Mixes */
-#define MIX_MASK 0x001fu
-
-#define MIX_NOT_DST 0x0000u
-#define MIX_0 0x0001u
-#define MIX_1 0x0002u
-#define MIX_DST 0x0003u
-#define MIX_NOT_SRC 0x0004u
-#define MIX_XOR 0x0005u
-#define MIX_XNOR 0x0006u
-#define MIX_SRC 0x0007u
-#define MIX_NAND 0x0008u
-#define MIX_NOT_SRC_OR_DST 0x0009u
-#define MIX_SRC_OR_NOT_DST 0x000au
-#define MIX_OR 0x000bu
-#define MIX_AND 0x000cu
-#define MIX_SRC_AND_NOT_DST 0x000du
-#define MIX_NOT_SRC_AND_DST 0x000eu
-#define MIX_NOR 0x000fu
-
-#define MIX_MIN 0x0010u
-#define MIX_DST_MINUS_SRC 0x0011u
-#define MIX_SRC_MINUS_DST 0x0012u
-#define MIX_PLUS 0x0013u
-#define MIX_MAX 0x0014u
-#define MIX_HALF__DST_MINUS_SRC 0x0015u
-#define MIX_HALF__SRC_MINUS_DST 0x0016u
-#define MIX_AVERAGE 0x0017u
-#define MIX_DST_MINUS_SRC_SAT 0x0018u
-#define MIX_SRC_MINUS_DST_SAT 0x001au
-#define MIX_HALF__DST_MINUS_SRC_SAT 0x001cu
-#define MIX_HALF__SRC_MINUS_DST_SAT 0x001eu
-#define MIX_AVERAGE_SAT 0x001fu
-#define MIX_FN_PAINT MIX_SRC
-
-
-#endif
diff --git a/src/video_out/vidix/drivers/mach64_vid.c b/src/video_out/vidix/drivers/mach64_vid.c
deleted file mode 100644
index 02447af19..000000000
--- a/src/video_out/vidix/drivers/mach64_vid.c
+++ /dev/null
@@ -1,1390 +0,0 @@
-/*
- mach64_vid - VIDIX based video driver for Mach64 and 3DRage chips
- Copyrights 2002 Nick Kurshev. This file is based on sources from
- GATOS (gatos.sf.net) and X11 (www.xfree86.org)
- Licence: GPL
- WARNING: THIS DRIVER IS IN BETTA STAGE
-*/
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include <inttypes.h>
-#include <fcntl.h>
-#include <limits.h>
-#include <sys/mman.h> /* for m(un)lock */
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#ifdef HAVE_MEMALIGN
-#define MACH64_ENABLE_BM 1
-#endif
-#endif
-
-#include "vidix.h"
-#include "fourcc.h"
-#include "libdha.h"
-#include "pci_ids.h"
-#include "pci_names.h"
-#include "bswap.h"
-
-#include "mach64.h"
-
-#define UNUSED(x) ((void)(x)) /**< Removes warning about unused arguments */
-
-#define VIDIX_STATIC mach64_
-
-#ifdef MACH64_ENABLE_BM
-
-#define cpu_to_le32(a) (a)
-#define VIRT_TO_CARD(a,b,c) bm_virt_to_bus(a,b,c)
-#pragma pack(1)
-typedef struct
-{
- uint32_t framebuf_offset;
- uint32_t sys_addr;
- uint32_t command;
- uint32_t reserved;
-} bm_list_descriptor;
-#pragma pack()
-static void *mach64_dma_desc_base[64];
-static unsigned long bus_addr_dma_desc = 0;
-static unsigned long *dma_phys_addrs;
-#endif
-
-static void *mach64_mmio_base = 0;
-static void *mach64_mem_base = 0;
-static int32_t mach64_overlay_offset = 0;
-static uint32_t mach64_ram_size = 0;
-static uint32_t mach64_buffer_base[64][3];
-static int num_mach64_buffers=-1;
-static int supports_planar=0;
-static int supports_colour_adj=0;
-static int supports_idct=0;
-static int supports_subpic=0;
-static int supports_lcd_v_stretch=0;
-
-pciinfo_t pci_info;
-static int probed = 0;
-static int __verbose = 0;
-
-#define VERBOSE_LEVEL 2
-
-typedef struct bes_registers_s
-{
- /* base address of yuv framebuffer */
- uint32_t yuv_base;
- uint32_t fourcc;
- /* YUV BES registers */
- uint32_t reg_load_cntl;
- uint32_t scale_inc;
- uint32_t y_x_start;
- uint32_t y_x_end;
- uint32_t vid_buf_pitch;
- uint32_t height_width;
-
- uint32_t scale_cntl;
- uint32_t exclusive_horz;
- uint32_t auto_flip_cntl;
- uint32_t filter_cntl;
- uint32_t key_cntl;
- uint32_t test;
- /* Configurable stuff */
-
- int brightness;
- int saturation;
-
- int ckey_on;
- uint32_t graphics_key_clr;
- uint32_t graphics_key_msk;
-
- int deinterlace_on;
- uint32_t deinterlace_pattern;
-
-} bes_registers_t;
-
-static bes_registers_t besr;
-
-typedef struct video_registers_s
-{
- const char * sname;
- uint32_t name;
- uint32_t value;
-}video_registers_t;
-
-static bes_registers_t besr;
-
-/* Graphic keys */
-static vidix_grkey_t mach64_grkey;
-
-#define DECLARE_VREG(name) { #name, name, 0 }
-static video_registers_t vregs[] =
-{
- DECLARE_VREG(OVERLAY_SCALE_INC),
- DECLARE_VREG(OVERLAY_Y_X_START),
- DECLARE_VREG(OVERLAY_Y_X_END),
- DECLARE_VREG(OVERLAY_SCALE_CNTL),
- DECLARE_VREG(OVERLAY_EXCLUSIVE_HORZ),
- DECLARE_VREG(OVERLAY_EXCLUSIVE_VERT),
- DECLARE_VREG(OVERLAY_TEST),
- DECLARE_VREG(SCALER_BUF_PITCH),
- DECLARE_VREG(SCALER_HEIGHT_WIDTH),
- DECLARE_VREG(SCALER_BUF0_OFFSET),
- DECLARE_VREG(SCALER_BUF0_OFFSET_U),
- DECLARE_VREG(SCALER_BUF0_OFFSET_V),
- DECLARE_VREG(SCALER_BUF1_OFFSET),
- DECLARE_VREG(SCALER_BUF1_OFFSET_U),
- DECLARE_VREG(SCALER_BUF1_OFFSET_V),
- DECLARE_VREG(SCALER_H_COEFF0),
- DECLARE_VREG(SCALER_H_COEFF1),
- DECLARE_VREG(SCALER_H_COEFF2),
- DECLARE_VREG(SCALER_H_COEFF3),
- DECLARE_VREG(SCALER_H_COEFF4),
- DECLARE_VREG(SCALER_COLOUR_CNTL),
- DECLARE_VREG(SCALER_THRESHOLD),
- DECLARE_VREG(VIDEO_FORMAT),
- DECLARE_VREG(VIDEO_CONFIG),
- DECLARE_VREG(VIDEO_SYNC_TEST),
- DECLARE_VREG(VIDEO_SYNC_TEST_B),
- DECLARE_VREG(BUS_CNTL),
- DECLARE_VREG(SRC_CNTL),
- DECLARE_VREG(GUI_STAT),
- DECLARE_VREG(BM_ADDR),
- DECLARE_VREG(BM_DATA),
- DECLARE_VREG(BM_HOSTDATA),
- DECLARE_VREG(BM_GUI_TABLE_CMD),
- DECLARE_VREG(BM_FRAME_BUF_OFFSET),
- DECLARE_VREG(BM_SYSTEM_MEM_ADDR),
- DECLARE_VREG(BM_COMMAND),
- DECLARE_VREG(BM_STATUS),
- DECLARE_VREG(BM_GUI_TABLE),
- DECLARE_VREG(BM_SYSTEM_TABLE),
- DECLARE_VREG(AGP_BASE),
- DECLARE_VREG(AGP_CNTL),
- DECLARE_VREG(CRTC_INT_CNTL)
-};
-
-/* VIDIX exports */
-
-/* MMIO space*/
-#define GETREG(TYPE,PTR,OFFZ) (*((volatile TYPE*)((PTR)+(OFFZ))))
-#define SETREG(TYPE,PTR,OFFZ,VAL) (*((volatile TYPE*)((PTR)+(OFFZ))))=VAL
-
-#define INREG8(addr) GETREG(uint8_t,(uint32_t)mach64_mmio_base,((addr)^0x100)<<2)
-#define OUTREG8(addr,val) SETREG(uint8_t,(uint32_t)mach64_mmio_base,((addr)^0x100)<<2,val)
-static inline uint32_t INREG (uint32_t addr) {
- uint32_t tmp = GETREG(uint32_t,(uint32_t)mach64_mmio_base,((addr)^0x100)<<2);
- return le2me_32(tmp);
-}
-#define OUTREG(addr,val) SETREG(uint32_t,(uint32_t)mach64_mmio_base,((addr)^0x100)<<2,le2me_32(val))
-
-#define OUTREGP(addr,val,mask) \
- do { \
- unsigned int _tmp = INREG(addr); \
- _tmp &= (mask); \
- _tmp |= (val); \
- OUTREG(addr, _tmp); \
- } while (0)
-
-static __inline__ int ATIGetMach64LCDReg(int _Index)
-{
- OUTREG8(LCD_INDEX, _Index);
- return INREG(LCD_DATA);
-}
-
-static __inline__ uint32_t INPLL(uint32_t addr)
-{
- uint32_t res;
- uint32_t in;
-
- in= INREG(CLOCK_CNTL);
- in &= ~((PLL_WR_EN | PLL_ADDR)); //clean some stuff
- OUTREG(CLOCK_CNTL, in | (addr<<10));
-
- /* read the register value */
- res = (INREG(CLOCK_CNTL)>>16)&0xFF;
- return res;
-}
-
-static __inline__ void OUTPLL(uint32_t addr,uint32_t val)
-{
-//FIXME buggy but its not used
- /* write addr byte */
- OUTREG8(CLOCK_CNTL + 1, (addr << 2) | PLL_WR_EN);
- /* write the register value */
- OUTREG(CLOCK_CNTL + 2, val);
- OUTREG8(CLOCK_CNTL + 1, (addr << 2) & ~PLL_WR_EN);
-}
-
-#define OUTPLLP(addr,val,mask) \
- do { \
- unsigned int _tmp = INPLL(addr); \
- _tmp &= (mask); \
- _tmp |= (val); \
- OUTPLL(addr, _tmp); \
- } while (0)
-
-static void mach64_engine_reset( void )
-{
- /* Kill off bus mastering with extreme predjudice... */
- OUTREG(BUS_CNTL, INREG(BUS_CNTL) | BUS_MASTER_DIS);
- OUTREG(CRTC_INT_CNTL,INREG(CRTC_INT_CNTL)&~(CRTC_BUSMASTER_EOL_INT|CRTC_BUSMASTER_EOL_INT_EN));
- /* Reset engine -- This is accomplished by setting bit 8 of the GEN_TEST_CNTL
- register high, then low (per the documentation, it's on high to low transition
- that the GUI engine gets reset...) */
- OUTREG( GEN_TEST_CNTL, INREG( GEN_TEST_CNTL ) | GEN_GUI_EN );
- OUTREG( GEN_TEST_CNTL, INREG( GEN_TEST_CNTL ) & ~GEN_GUI_EN );
-}
-
-static void mach64_fifo_wait(unsigned n)
-{
- while ((INREG(FIFO_STAT) & 0xffff) > ((uint32_t)(0x8000 >> n)));
-}
-
-static void mach64_wait_for_idle( void )
-{
- unsigned i;
- mach64_fifo_wait(16);
- for (i=0; i<2000000; i++) if((INREG(GUI_STAT) & GUI_ACTIVE) == 0) break;
- if((INREG(GUI_STAT) & 1) != 0) mach64_engine_reset(); /* due card lookup */
-}
-
-static void mach64_wait_vsync( void )
-{
- int i;
-
- for(i=0; i<2000000; i++)
- if( (INREG(CRTC_INT_CNTL)&CRTC_VBLANK)==0 ) break;
- for(i=0; i<2000000; i++)
- if( (INREG(CRTC_INT_CNTL)&CRTC_VBLANK) ) break;
-
-}
-
-static vidix_capability_t mach64_cap =
-{
- "BES driver for Mach64/3DRage cards",
- "Nick Kurshev and Michael Niedermayer",
- TYPE_OUTPUT,
- { 0, 0, 0, 0 },
- 2048,
- 2048,
- 4,
- 4,
- -1,
- FLAG_UPSCALER|FLAG_DOWNSCALER,
- VENDOR_ATI,
- -1,
- { 0, 0, 0, 0 }
-};
-
-static uint32_t mach64_vid_get_dbpp( void )
-{
- uint32_t dbpp,retval;
- dbpp = (INREG(CRTC_GEN_CNTL)>>8)& 0x7;
- switch(dbpp)
- {
- case 1: retval = 4; break;
- case 2: retval = 8; break;
- case 3: retval = 15; break;
- case 4: retval = 16; break;
- case 5: retval = 24; break;
- default: retval=32; break;
- }
- return retval;
-}
-
-static int mach64_is_dbl_scan( void )
-{
- return INREG(CRTC_GEN_CNTL) & CRTC_DBL_SCAN_EN;
-}
-
-static int mach64_is_interlace( void )
-{
- return INREG(CRTC_GEN_CNTL) & CRTC_INTERLACE_EN;
-}
-
-static uint32_t mach64_get_xres( void )
-{
- /* FIXME: currently we extract that from CRTC!!!*/
- uint32_t xres,h_total;
- h_total = INREG(CRTC_H_TOTAL_DISP);
- xres = (h_total >> 16) & 0xffff;
- return (xres + 1)*8;
-}
-
-static uint32_t mach64_get_yres( void )
-{
- /* FIXME: currently we extract that from CRTC!!!*/
- uint32_t yres,v_total;
- v_total = INREG(CRTC_V_TOTAL_DISP);
- yres = (v_total >> 16) & 0xffff;
- return yres + 1;
-}
-
-// returns the verical stretch factor in 16.16
-static int mach64_get_vert_stretch(void)
-{
- int lcd_index;
- int vert_stretching;
- int ext_vert_stretch;
- int ret;
- int yres= mach64_get_yres();
-
- if(!supports_lcd_v_stretch){
- if(__verbose>0) printf("[mach64] vertical stretching not supported\n");
- return 1<<16;
- }
-
- lcd_index= INREG(LCD_INDEX);
-
- vert_stretching= ATIGetMach64LCDReg(LCD_VERT_STRETCHING);
- if(!(vert_stretching&VERT_STRETCH_EN)) ret= 1<<16;
- else
- {
- int panel_size;
-
- ext_vert_stretch= ATIGetMach64LCDReg(LCD_EXT_VERT_STRETCH);
- panel_size= (ext_vert_stretch&VERT_PANEL_SIZE)>>11;
- panel_size++;
-
- ret= ((yres<<16) + (panel_size>>1))/panel_size;
- }
-
-// lcd_gen_ctrl = ATIGetMach64LCDReg(LCD_GEN_CNTL);
-
- OUTREG(LCD_INDEX, lcd_index);
-
- if(__verbose>0) printf("[mach64] vertical stretching factor= %d\n", ret);
-
- return ret;
-}
-
-static void mach64_vid_make_default()
-{
- mach64_fifo_wait(5);
- OUTREG(SCALER_COLOUR_CNTL,0x00101000);
-
- besr.ckey_on=0;
- besr.graphics_key_msk=0;
- besr.graphics_key_clr=0;
-
- OUTREG(OVERLAY_GRAPHICS_KEY_MSK, besr.graphics_key_msk);
- OUTREG(OVERLAY_GRAPHICS_KEY_CLR, besr.graphics_key_clr);
- OUTREG(OVERLAY_KEY_CNTL,VIDEO_KEY_FN_TRUE|GRAPHIC_KEY_FN_EQ|CMP_MIX_AND);
-
-}
-
-static void mach64_vid_dump_regs( void )
-{
- size_t i;
- printf("[mach64] *** Begin of DRIVER variables dump ***\n");
- printf("[mach64] mach64_mmio_base=%p\n",mach64_mmio_base);
- printf("[mach64] mach64_mem_base=%p\n",mach64_mem_base);
- printf("[mach64] mach64_overlay_off=%08X\n",mach64_overlay_offset);
- printf("[mach64] mach64_ram_size=%08X\n",mach64_ram_size);
- printf("[mach64] video mode: %ux%u@%u\n",mach64_get_xres(),mach64_get_yres(),mach64_vid_get_dbpp());
- printf("[mach64] *** Begin of OV0 registers dump ***\n");
- for(i=0;i<sizeof(vregs)/sizeof(video_registers_t);i++)
- {
- mach64_wait_for_idle();
- mach64_fifo_wait(2);
- printf("[mach64] %s = %08X\n",vregs[i].sname,INREG(vregs[i].name));
- }
- printf("[mach64] *** End of OV0 registers dump ***\n");
-}
-
-
-unsigned int VIDIX_NAME(vixGetVersion)(void)
-{
- return(VIDIX_VERSION);
-}
-
-typedef struct ati_chip_id_s
-{
- unsigned short id;
- unsigned short is_agp;
-}ati_chip_id_t;
-
-static ati_chip_id_t ati_card_ids[] =
-{
- { DEVICE_ATI_215CT_MACH64_CT, 0 },
- { DEVICE_ATI_210888CX_MACH64_CX, 0 },
- { DEVICE_ATI_210888ET_MACH64_ET, 0 },
- { DEVICE_ATI_MACH64_VT, 0 },
- { DEVICE_ATI_210888GX_MACH64_GX, 0 },
- { DEVICE_ATI_264LT_MACH64_LT, 0 },
- { DEVICE_ATI_264VT_MACH64_VT, 0 },
- { DEVICE_ATI_264VT3_MACH64_VT3, 0 },
- { DEVICE_ATI_264VT4_MACH64_VT4, 0 },
- /**/
- { DEVICE_ATI_3D_RAGE_PRO, 1 },
- { DEVICE_ATI_3D_RAGE_PRO2, 1 },
- { DEVICE_ATI_3D_RAGE_PRO3, 0 },
- { DEVICE_ATI_3D_RAGE_PRO4, 0 },
- { DEVICE_ATI_RAGE_XC, 0 },
- { DEVICE_ATI_RAGE_XL_AGP, 1 },
- { DEVICE_ATI_RAGE_XC_AGP, 1 },
- { DEVICE_ATI_RAGE_XL, 0 },
- { DEVICE_ATI_3D_RAGE_PRO5, 0 },
- { DEVICE_ATI_3D_RAGE_PRO6, 0 },
- { DEVICE_ATI_RAGE_XL2, 0 },
- { DEVICE_ATI_RAGE_XC2, 0 },
- { DEVICE_ATI_3D_RAGE_I_II, 0 },
- { DEVICE_ATI_3D_RAGE_II, 0 },
- { DEVICE_ATI_3D_RAGE_IIC, 1 },
- { DEVICE_ATI_3D_RAGE_IIC2, 0 },
- { DEVICE_ATI_3D_RAGE_IIC3, 0 },
- { DEVICE_ATI_3D_RAGE_IIC4, 1 },
- { DEVICE_ATI_3D_RAGE_LT, 1 },
- { DEVICE_ATI_3D_RAGE_LT2, 1 },
- { DEVICE_ATI_3D_RAGE_LT_G, 0 },
- { DEVICE_ATI_3D_RAGE_LT3, 0 },
- { DEVICE_ATI_RAGE_MOBILITY_P_M, 1 },
- { DEVICE_ATI_RAGE_MOBILITY_L, 1 },
- { DEVICE_ATI_3D_RAGE_LT4, 0 },
- { DEVICE_ATI_3D_RAGE_LT5, 0 },
- { DEVICE_ATI_RAGE_MOBILITY_P_M2, 0 },
- { DEVICE_ATI_RAGE_MOBILITY_L2, 0 }
-};
-
-static int is_agp;
-
-static int find_chip(unsigned chip_id)
-{
- unsigned i;
- for(i = 0;i < sizeof(ati_card_ids)/sizeof(ati_chip_id_t);i++)
- {
- if(chip_id == ati_card_ids[i].id) return i;
- }
- return -1;
-}
-
-int VIDIX_NAME(vixProbe)(int verbose,int force)
-{
- pciinfo_t lst[MAX_PCI_DEVICES];
- unsigned i,num_pci;
- int err;
- __verbose = verbose;
- err = pci_scan(lst,&num_pci);
- if(err)
- {
- printf("[mach64] Error occured during pci scan: %s\n",strerror(err));
- return err;
- }
- else
- {
- err = ENXIO;
- for(i=0;i<num_pci;i++)
- {
- if(lst[i].vendor == VENDOR_ATI)
- {
- int idx;
- const char *dname;
- idx = find_chip(lst[i].device);
- if(idx == -1 && force == PROBE_NORMAL) continue;
- dname = pci_device_name(VENDOR_ATI,lst[i].device);
- dname = dname ? dname : "Unknown chip";
- printf("[mach64] Found chip: %s\n",dname);
- if(force > PROBE_NORMAL)
- {
- printf("[mach64] Driver was forced. Was found %sknown chip\n",idx == -1 ? "un" : "");
- if(idx == -1)
- printf("[mach64] Assuming it as Mach64\n");
- }
- if(idx != -1) is_agp = ati_card_ids[idx].is_agp;
- mach64_cap.device_id = lst[i].device;
- err = 0;
- memcpy(&pci_info,&lst[i],sizeof(pciinfo_t));
- probed=1;
- break;
- }
- }
- }
- if(err && verbose) printf("[mach64] Can't find chip\n");
- return err;
-}
-
-static void reset_regs( void )
-{
- size_t i;
- for(i=0;i<sizeof(vregs)/sizeof(video_registers_t);i++)
- {
- mach64_fifo_wait(2);
- OUTREG(vregs[i].name,0);
- }
-}
-
-typedef struct saved_regs_s
-{
- uint32_t overlay_video_key_clr;
- uint32_t overlay_video_key_msk;
- uint32_t overlay_graphics_key_clr;
- uint32_t overlay_graphics_key_msk;
- uint32_t overlay_key_cntl;
- uint32_t bus_cntl;
-}saved_regs_t;
-static saved_regs_t savreg;
-
-static void save_regs( void )
-{
- mach64_fifo_wait(6);
- savreg.overlay_video_key_clr = INREG(OVERLAY_VIDEO_KEY_CLR);
- savreg.overlay_video_key_msk = INREG(OVERLAY_VIDEO_KEY_MSK);
- savreg.overlay_graphics_key_clr = INREG(OVERLAY_GRAPHICS_KEY_CLR);
- savreg.overlay_graphics_key_msk = INREG(OVERLAY_GRAPHICS_KEY_MSK);
- savreg.overlay_key_cntl = INREG(OVERLAY_KEY_CNTL);
- savreg.bus_cntl = INREG(BUS_CNTL);
-}
-
-static void restore_regs( void )
-{
- mach64_fifo_wait(6);
- OUTREG(OVERLAY_VIDEO_KEY_CLR,savreg.overlay_video_key_clr);
- OUTREG(OVERLAY_VIDEO_KEY_MSK,savreg.overlay_video_key_msk);
- OUTREG(OVERLAY_GRAPHICS_KEY_CLR,savreg.overlay_graphics_key_clr);
- OUTREG(OVERLAY_GRAPHICS_KEY_MSK,savreg.overlay_graphics_key_msk);
- OUTREG(OVERLAY_KEY_CNTL,savreg.overlay_key_cntl);
- OUTREG(BUS_CNTL,savreg.bus_cntl|BUS_MASTER_DIS);
-}
-
-static int forced_irq=INT_MAX;
-
-#ifdef MACH64_ENABLE_BM
-static int can_use_irq=0;
-static int irq_installed=0;
-
-static void init_irq(void)
-{
- irq_installed=1;
- if(forced_irq != INT_MAX) pci_info.irq=forced_irq;
- if(hwirq_install(pci_info.bus,pci_info.card,pci_info.func,
- 2,CRTC_INT_CNTL,CRTC_BUSMASTER_EOL_INT) == 0)
- {
- can_use_irq=1;
- if(__verbose) printf("[mach64] Will use %u irq line\n",pci_info.irq);
- }
- else
- if(__verbose) printf("[mach64] Can't initialize irq handling: %s\n"
- "[mach64]irq_param: line=%u pin=%u gnt=%u lat=%u\n"
- ,strerror(errno)
- ,pci_info.irq,pci_info.ipin,pci_info.gnt,pci_info.lat);
-}
-#endif
-
-int VIDIX_NAME(vixInit)(const char *args)
-{
- int err;
-#ifdef MACH64_ENABLE_BM
- unsigned i;
-#endif
- if(!probed)
- {
- printf("[mach64] Driver was not probed but is being initializing\n");
- return EINTR;
- }
- if(__verbose>0) printf("[mach64] version %d args='%s'\n", VIDIX_VERSION,args);
- if(args)
- if(strncmp(args,"irq=",4) == 0)
- {
- forced_irq=atoi(&args[4]);
- if(__verbose>0) printf("[mach64] forcing IRQ to %u\n",forced_irq);
- }
-
- if((mach64_mmio_base = map_phys_mem(pci_info.base2,0x4000))==(void *)-1) return ENOMEM;
- mach64_wait_for_idle();
- mach64_ram_size = INREG(MEM_CNTL) & CTL_MEM_SIZEB;
- if (mach64_ram_size < 8) mach64_ram_size = (mach64_ram_size + 1) * 512;
- else if (mach64_ram_size < 12) mach64_ram_size = (mach64_ram_size - 3) * 1024;
- else mach64_ram_size = (mach64_ram_size - 7) * 2048;
- mach64_ram_size *= 0x400; /* KB -> bytes */
- if((mach64_mem_base = map_phys_mem(pci_info.base0,mach64_ram_size))==(void *)-1) return ENOMEM;
- memset(&besr,0,sizeof(bes_registers_t));
- printf("[mach64] Video memory = %uMb\n",mach64_ram_size/0x100000);
- err = mtrr_set_type(pci_info.base0,mach64_ram_size,MTRR_TYPE_WRCOMB);
- if(!err) printf("[mach64] Set write-combining type of video memory\n");
-
- save_regs();
- /* check if planar formats are supported */
- supports_planar=0;
- mach64_wait_for_idle();
- mach64_fifo_wait(2);
- if(INREG(SCALER_BUF0_OFFSET_U)) supports_planar=1;
- else
- {
- OUTREG(SCALER_BUF0_OFFSET_U, -1);
-
- mach64_wait_vsync();
- mach64_wait_for_idle();
- mach64_fifo_wait(2);
-
- if(INREG(SCALER_BUF0_OFFSET_U)) supports_planar=1;
- }
- printf("[mach64] Planar YUV formats are %s supported\n",supports_planar?"":"not");
- supports_colour_adj=0;
- OUTREG(SCALER_COLOUR_CNTL,-1);
- if(INREG(SCALER_COLOUR_CNTL)) supports_colour_adj=1;
- supports_idct=0;
- OUTREG(IDCT_CONTROL,-1);
- if(INREG(IDCT_CONTROL)) supports_idct=1;
- OUTREG(IDCT_CONTROL,0);
- printf("[mach64] IDCT is %s supported\n",supports_idct?"":"not");
- supports_subpic=0;
- OUTREG(SUBPIC_CNTL,-1);
- if(INREG(SUBPIC_CNTL)) supports_subpic=1;
- OUTREG(SUBPIC_CNTL,0);
- printf("[mach64] subpictures are %s supported\n",supports_subpic?"":"not");
- if( mach64_cap.device_id==DEVICE_ATI_RAGE_MOBILITY_P_M
- || mach64_cap.device_id==DEVICE_ATI_RAGE_MOBILITY_P_M2
- || mach64_cap.device_id==DEVICE_ATI_RAGE_MOBILITY_L
- || mach64_cap.device_id==DEVICE_ATI_RAGE_MOBILITY_L2)
- supports_lcd_v_stretch=1;
- else
- supports_lcd_v_stretch=0;
-
- reset_regs();
- mach64_vid_make_default();
- if(__verbose > VERBOSE_LEVEL) mach64_vid_dump_regs();
-#ifdef MACH64_ENABLE_BM
- if(!(INREG(BUS_CNTL) & BUS_MASTER_DIS))
- OUTREG(BUS_CNTL,INREG(BUS_CNTL)|BUS_MSTR_RESET);
- if(bm_open() == 0)
- {
- mach64_cap.flags |= FLAG_DMA | FLAG_EQ_DMA;
- if((dma_phys_addrs = malloc(mach64_ram_size*sizeof(unsigned long)/4096)) == 0)
- {
- out_mem:
- printf("[mach64] Can't allocate temporary buffer for DMA\n");
- mach64_cap.flags &= ~FLAG_DMA & ~FLAG_EQ_DMA;
- return 0;
- }
- /*
- WARNING: We MUST have continigous descriptors!!!
- But: (720*720*2(YUV422)*16(sizeof(bm_descriptor)))/4096=4050
- Thus one 4K page is far enough to describe max movie size.
- */
- for(i=0;i<64;i++)
- if((mach64_dma_desc_base[i] = memalign(4096,mach64_ram_size*sizeof(bm_list_descriptor)/4096)) == 0)
- goto out_mem;
-#if 0
- if(!is_agp)
- {
- long tst;
- if(pci_config_read(pci_info.bus,pci_info.card,pci_info.func,4,4,&pci_command) == 0)
- pci_config_write(pci_info.bus,pci_info.card,pci_info.func,4,4,pci_command|0x14);
- pci_config_read(pci_info.bus,pci_info.card,pci_info.func,4,4,&tst);
- }
-#endif
- }
- else
- if(__verbose) printf("[mach64] Can't initialize busmastering: %s\n",strerror(errno));
-#endif
- return 0;
-}
-
-void VIDIX_NAME(vixDestroy)(void)
-{
-#ifdef MACH64_ENABLE_BM
- unsigned i;
-#endif
- restore_regs();
-#ifdef MACH64_ENABLE_BM
- mach64_engine_reset();
-#endif
- unmap_phys_mem(mach64_mem_base,mach64_ram_size);
- unmap_phys_mem(mach64_mmio_base,0x4000);
-#ifdef MACH64_ENABLE_BM
- bm_close();
- if(can_use_irq && irq_installed) hwirq_uninstall(pci_info.bus,pci_info.card,pci_info.func);
- if(dma_phys_addrs) free(dma_phys_addrs);
- for(i=0;i<64;i++)
- {
- if(mach64_dma_desc_base[i]) free(mach64_dma_desc_base[i]);
- }
-#endif
-}
-
-int VIDIX_NAME(vixGetCapability)(vidix_capability_t *to)
-{
- memcpy(to, &mach64_cap, sizeof(vidix_capability_t));
- return 0;
-}
-
-static unsigned mach64_query_pitch(unsigned fourcc,const vidix_yuv_t *spitch)
-{
- unsigned pitch,spy,spv,spu;
- spy = spv = spu = 0;
- switch(spitch->y)
- {
- case 16:
- case 32:
- case 64:
- case 128:
- case 256: spy = spitch->y; break;
- default: break;
- }
- switch(spitch->u)
- {
- case 16:
- case 32:
- case 64:
- case 128:
- case 256: spu = spitch->u; break;
- default: break;
- }
- switch(spitch->v)
- {
- case 16:
- case 32:
- case 64:
- case 128:
- case 256: spv = spitch->v; break;
- default: break;
- }
- switch(fourcc)
- {
- /* 4:2:0 */
- case IMGFMT_IYUV:
- case IMGFMT_YV12:
- case IMGFMT_I420:
- if(spy > 16 && spu == spy/2 && spv == spy/2) pitch = spy;
- else pitch = 32;
- break;
- case IMGFMT_YVU9:
- if(spy > 32 && spu == spy/4 && spv == spy/4) pitch = spy;
- else pitch = 64;
- break;
- default:
- if(spy >= 16) pitch = spy;
- else pitch = 16;
- break;
- }
- return pitch;
-}
-
-static void mach64_compute_framesize(vidix_playback_t *info)
-{
- unsigned pitch,awidth;
- pitch = mach64_query_pitch(info->fourcc,&info->src.pitch);
- switch(info->fourcc)
- {
- case IMGFMT_I420:
- case IMGFMT_YV12:
- case IMGFMT_IYUV:
- awidth = (info->src.w + (pitch-1)) & ~(pitch-1);
- info->frame_size = awidth*(info->src.h+info->src.h/2);
- break;
- case IMGFMT_YVU9:
- awidth = (info->src.w + (pitch-1)) & ~(pitch-1);
- info->frame_size = awidth*(info->src.h+info->src.h/8);
- break;
-// case IMGFMT_RGB32:
- case IMGFMT_BGR32:
- awidth = (info->src.w*4 + (pitch-1)) & ~(pitch-1);
- info->frame_size = (awidth*info->src.h);
- break;
- /* YUY2 YVYU, RGB15, RGB16 */
- default:
- awidth = (info->src.w*2 + (pitch-1)) & ~(pitch-1);
- info->frame_size = (awidth*info->src.h);
- break;
- }
- info->frame_size+=256; // so we have some space for alignment & such
- info->frame_size&=~16;
-}
-
-static void mach64_vid_stop_video( void )
-{
- mach64_fifo_wait(14);
- OUTREG(OVERLAY_SCALE_CNTL, 0x80000000);
- OUTREG(OVERLAY_EXCLUSIVE_HORZ, 0);
- OUTREG(OVERLAY_EXCLUSIVE_VERT, 0);
- OUTREG(SCALER_H_COEFF0, 0x00002000);
- OUTREG(SCALER_H_COEFF1, 0x0D06200D);
- OUTREG(SCALER_H_COEFF2, 0x0D0A1C0D);
- OUTREG(SCALER_H_COEFF3, 0x0C0E1A0C);
- OUTREG(SCALER_H_COEFF4, 0x0C14140C);
- OUTREG(VIDEO_FORMAT, 0xB000B);
- OUTREG(OVERLAY_TEST, 0x0);
-}
-
-static void mach64_vid_display_video( void )
-{
- uint32_t vf,sc,width;
- mach64_fifo_wait(14);
-
- OUTREG(OVERLAY_Y_X_START, besr.y_x_start);
- OUTREG(OVERLAY_Y_X_END, besr.y_x_end);
- OUTREG(OVERLAY_SCALE_INC, besr.scale_inc);
- OUTREG(SCALER_BUF_PITCH, besr.vid_buf_pitch);
- OUTREG(SCALER_HEIGHT_WIDTH, besr.height_width);
- OUTREG(SCALER_BUF0_OFFSET, mach64_buffer_base[0][0]);
- OUTREG(SCALER_BUF0_OFFSET_U, mach64_buffer_base[0][1]);
- OUTREG(SCALER_BUF0_OFFSET_V, mach64_buffer_base[0][2]);
- OUTREG(SCALER_BUF1_OFFSET, mach64_buffer_base[0][0]);
- OUTREG(SCALER_BUF1_OFFSET_U, mach64_buffer_base[0][1]);
- OUTREG(SCALER_BUF1_OFFSET_V, mach64_buffer_base[0][2]);
- mach64_wait_vsync();
- width = (besr.height_width >> 16 & 0x03FF);
- sc = SCALE_EN | OVERLAY_EN |
- SCALE_BANDWIDTH | /* reset bandwidth status */
- SCALE_PIX_EXPAND | /* dynamic range correct */
- SCALE_Y2R_TEMP; /* use the equal temparature for every component of RGB */
- /* Force clocks of scaler. */
- if(width > 360 && !supports_planar && !mach64_is_interlace())
- sc |= SCALE_CLK_FORCE_ON;
- /* Do we need that? And how we can improve the quality of 3dRageII scaler ?
- 3dRageII+ (non pro) is really crapped HW :(
- ^^^^^^^^^^^^^^^^^^^
- !!SCALER_WIDTH <= 360 provides full scaling functionality !!!!!!!!!!!!!
- !!360 < SCALER_WIDTH <= 720 provides scaling with vertical replication (crap)
- !!SCALER_WIDTH > 720 is illegal. (no comments)
-
- As for me - I would prefer to limit movie's width with 360 but it provides only
- half of picture but with perfect quality. (NK) */
- mach64_fifo_wait(10);
- OUTREG(OVERLAY_SCALE_CNTL, sc);
- mach64_wait_for_idle();
-
- switch(besr.fourcc)
- {
- /* BGR formats */
- case IMGFMT_BGR15: vf = SCALER_IN_RGB15; break;
- case IMGFMT_BGR16: vf = SCALER_IN_RGB16; break;
- case IMGFMT_BGR32: vf = SCALER_IN_RGB32; break;
- /* 4:2:0 */
- case IMGFMT_IYUV:
- case IMGFMT_I420:
- case IMGFMT_YV12: vf = SCALER_IN_YUV12; break;
- /* 4:1:0 */
- case IMGFMT_YVU9: vf = SCALER_IN_YUV9; break;
- /* 4:2:2 */
- case IMGFMT_YVYU:
- case IMGFMT_UYVY: vf = SCALER_IN_YVYU422; break;
- case IMGFMT_YUY2:
- default: vf = SCALER_IN_VYUY422; break;
- }
- OUTREG(VIDEO_FORMAT,vf);
- if(__verbose > VERBOSE_LEVEL) mach64_vid_dump_regs();
-}
-
-/* Goal of this function: hide RGB background and provide black screen around movie.
- Useful in '-vo fbdev:vidix -fs -zoom' mode.
- Reverse effect to colorkey */
-static void mach64_vid_exclusive( void )
-{
- unsigned screenw,screenh;
- screenw = mach64_get_xres();
- screenh = mach64_get_yres();
- OUTREG(OVERLAY_EXCLUSIVE_VERT,(((screenh-1)<<16)&EXCLUSIVE_VERT_END));
- OUTREG(OVERLAY_EXCLUSIVE_HORZ,(((screenw/8+1)<<8)&EXCLUSIVE_HORZ_END)|EXCLUSIVE_EN);
-}
-
-static void mach64_vid_non_exclusive( void )
-{
- OUTREG(OVERLAY_EXCLUSIVE_HORZ,0);
-}
-
-static int mach64_vid_init_video( vidix_playback_t *config )
-{
- uint32_t src_w,src_h,dest_w,dest_h,pitch,h_inc,v_inc,left,leftUV,top,ecp,y_pos;
- int is_420,best_pitch,mpitch;
- int src_offset_y, src_offset_u, src_offset_v;
- unsigned int i;
-
- mach64_vid_stop_video();
-/* warning, if left or top are != 0 this will fail, as the framesize is too small then */
- left = config->src.x;
- top = config->src.y;
- src_h = config->src.h;
- src_w = config->src.w;
- is_420 = 0;
- if(config->fourcc == IMGFMT_YV12 ||
- config->fourcc == IMGFMT_I420 ||
- config->fourcc == IMGFMT_IYUV) is_420 = 1;
- best_pitch = mach64_query_pitch(config->fourcc,&config->src.pitch);
- mpitch = best_pitch-1;
- switch(config->fourcc)
- {
- case IMGFMT_YVU9:
- /* 4:2:0 */
- case IMGFMT_IYUV:
- case IMGFMT_YV12:
- case IMGFMT_I420: pitch = (src_w + mpitch) & ~mpitch;
- config->dest.pitch.y =
- config->dest.pitch.u =
- config->dest.pitch.v = best_pitch;
- besr.vid_buf_pitch= pitch;
- break;
- /* RGB 4:4:4:4 */
- case IMGFMT_RGB32:
- case IMGFMT_BGR32: pitch = (src_w*4 + mpitch) & ~mpitch;
- config->dest.pitch.y =
- config->dest.pitch.u =
- config->dest.pitch.v = best_pitch;
- besr.vid_buf_pitch= pitch>>2;
- break;
- /* 4:2:2 */
- default: /* RGB15, RGB16, YVYU, UYVY, YUY2 */
- pitch = ((src_w*2) + mpitch) & ~mpitch;
- config->dest.pitch.y =
- config->dest.pitch.u =
- config->dest.pitch.v = best_pitch;
- besr.vid_buf_pitch= pitch>>1;
- break;
- }
- dest_w = config->dest.w;
- dest_h = config->dest.h;
- besr.fourcc = config->fourcc;
- ecp = (INPLL(PLL_VCLK_CNTL) & PLL_ECP_DIV) >> 4;
-#if 0
-{
-int i;
-for(i=0; i<32; i++){
- printf("%X ", INPLL(i));
-}
-}
-#endif
- if(__verbose>0) printf("[mach64] ecp: %d\n", ecp);
- v_inc = src_h * mach64_get_vert_stretch();
-
- if(mach64_is_interlace()) v_inc<<=1;
- if(mach64_is_dbl_scan() ) v_inc>>=1;
- v_inc/= dest_h;
- v_inc>>=4; // convert 16.16 -> 4.12
-
- h_inc = (src_w << (12+ecp)) / dest_w;
- /* keep everything in 4.12 */
- config->offsets[0] = 0;
- for(i=1; i<config->num_frames; i++)
- config->offsets[i] = config->offsets[i-1] + config->frame_size;
-
- /*FIXME the left / top stuff is broken (= zoom a src rectangle from a larger one)
- 1. the framesize isnt known as the outer src rectangle dimensions arent known
- 2. the mach64 needs aligned addresses so it cant work anyway
- -> so we could shift the outer buffer to compensate that but that would mean
- alignment problems for the code which writes into it
- */
-
- if(is_420)
- {
- config->offset.y= 0;
- config->offset.u= (pitch*src_h + 15)&~15;
- config->offset.v= (config->offset.u + (pitch*src_h>>2) + 15)&~15;
-
- src_offset_y= config->offset.y + top*pitch + left;
- src_offset_u= config->offset.u + (top*pitch>>2) + (left>>1);
- src_offset_v= config->offset.v + (top*pitch>>2) + (left>>1);
-
- if(besr.fourcc == IMGFMT_I420 || besr.fourcc == IMGFMT_IYUV)
- {
- uint32_t tmp;
- tmp = config->offset.u;
- config->offset.u = config->offset.v;
- config->offset.v = tmp;
- src_offset_u=config->offset.u;
- src_offset_v=config->offset.v;
- }
- }
- else if(besr.fourcc == IMGFMT_YVU9)
- {
- config->offset.y= 0;
- config->offset.u= (pitch*src_h + 15)&~15;
- config->offset.v= (config->offset.u + (pitch*src_h>>4) + 15)&~15;
-
- src_offset_y= config->offset.y + top*pitch + left;
- src_offset_u= config->offset.u + (top*pitch>>4) + (left>>1);
- src_offset_v= config->offset.v + (top*pitch>>4) + (left>>1);
- }
- else if(besr.fourcc == IMGFMT_BGR32)
- {
- config->offset.y = config->offset.u = config->offset.v = 0;
- src_offset_y= src_offset_u= src_offset_v= top*pitch + (left << 2);
- }
- else
- {
- config->offset.y = config->offset.u = config->offset.v = 0;
- src_offset_y= src_offset_u= src_offset_v= top*pitch + (left << 1);
- }
-
- num_mach64_buffers= config->num_frames;
- for(i=0; i<config->num_frames; i++)
- {
- mach64_buffer_base[i][0]= (mach64_overlay_offset + config->offsets[i] + src_offset_y)&~15;
- mach64_buffer_base[i][1]= (mach64_overlay_offset + config->offsets[i] + src_offset_u)&~15;
- mach64_buffer_base[i][2]= (mach64_overlay_offset + config->offsets[i] + src_offset_v)&~15;
- }
-
- leftUV = (left >> 17) & 15;
- left = (left >> 16) & 15;
- besr.scale_inc = ( h_inc << 16 ) | v_inc;
- y_pos = config->dest.y;
- if(mach64_is_dbl_scan()) y_pos*=2;
- else
- if(mach64_is_interlace()) y_pos/=2;
- besr.y_x_start = y_pos | (config->dest.x << 16);
- y_pos =config->dest.y + dest_h;
- if(mach64_is_dbl_scan()) y_pos*=2;
- else
- if(mach64_is_interlace()) y_pos/=2;
- besr.y_x_end = y_pos | ((config->dest.x + dest_w) << 16);
- besr.height_width = ((src_w - left)<<16) | (src_h - top);
- return 0;
-}
-
-static int is_supported_fourcc(uint32_t fourcc)
-{
- switch(fourcc)
- {
- case IMGFMT_YV12:
- case IMGFMT_I420:
- case IMGFMT_YVU9:
- case IMGFMT_IYUV:
- return supports_planar;
- case IMGFMT_YUY2:
- case IMGFMT_UYVY:
- case IMGFMT_BGR15:
- case IMGFMT_BGR16:
- case IMGFMT_BGR32:
- return 1;
- default:
- return 0;
- }
-}
-
-int VIDIX_NAME(vixQueryFourcc)(vidix_fourcc_t *to)
-{
- if(is_supported_fourcc(to->fourcc))
- {
- to->depth = VID_DEPTH_1BPP | VID_DEPTH_2BPP |
- VID_DEPTH_4BPP | VID_DEPTH_8BPP |
- VID_DEPTH_12BPP| VID_DEPTH_15BPP|
- VID_DEPTH_16BPP| VID_DEPTH_24BPP|
- VID_DEPTH_32BPP;
- to->flags = VID_CAP_EXPAND | VID_CAP_SHRINK | VID_CAP_COLORKEY;
- return 0;
- }
- else to->depth = to->flags = 0;
- return ENOSYS;
-}
-
-int VIDIX_NAME(vixConfigPlayback)(vidix_playback_t *info)
-{
- unsigned rgb_size,nfr;
- uint32_t mach64_video_size;
- if(!is_supported_fourcc(info->fourcc)) return ENOSYS;
- if(info->src.h > 720 || info->src.w > 720)
- {
- printf("[mach64] Can't apply width or height > 720\n");
- return EINVAL;
- }
- if(info->num_frames>VID_PLAY_MAXFRAMES) info->num_frames=VID_PLAY_MAXFRAMES;
-
- mach64_compute_framesize(info);
- rgb_size = mach64_get_xres()*mach64_get_yres()*((mach64_vid_get_dbpp()+7)/8);
- nfr = info->num_frames;
- mach64_video_size = mach64_ram_size;
- for(;nfr>0;nfr--)
- {
- mach64_overlay_offset = mach64_video_size - info->frame_size*nfr;
- mach64_overlay_offset &= 0xffff0000;
- if(mach64_overlay_offset >= (int)rgb_size ) break;
- }
- if(nfr <= 3)
- {
- nfr = info->num_frames;
- for(;nfr>0;nfr--)
- {
- mach64_overlay_offset = mach64_video_size - info->frame_size*nfr;
- mach64_overlay_offset &= 0xffff0000;
- if(mach64_overlay_offset>=0) break;
- }
- }
- if(nfr <= 0) return EINVAL;
- info->num_frames=nfr;
- num_mach64_buffers = info->num_frames;
- info->dga_addr = (char *)mach64_mem_base + mach64_overlay_offset;
- mach64_vid_init_video(info);
- return 0;
-}
-
-int VIDIX_NAME(vixPlaybackOn)(void)
-{
- int err;
- unsigned dw,dh;
- dw = (besr.y_x_end >> 16) - (besr.y_x_start >> 16);
- dh = (besr.y_x_end & 0xFFFF) - (besr.y_x_start & 0xFFFF);
- if(dw == mach64_get_xres() || dh == mach64_get_yres()) mach64_vid_exclusive();
- else mach64_vid_non_exclusive();
- mach64_vid_display_video();
- err = INREG(SCALER_BUF_PITCH) == besr.vid_buf_pitch ? 0 : EINTR;
- if(err)
- {
- printf("[mach64] *** Internal fatal error ***: Detected pitch corruption\n"
- "[mach64] Try decrease number of buffers\n");
- }
- return err;
-}
-
-int VIDIX_NAME(vixPlaybackOff)(void)
-{
- mach64_vid_stop_video();
- return 0;
-}
-
-int VIDIX_NAME(vixPlaybackFrameSelect)(unsigned int frame)
-{
- uint32_t off[6];
- int i;
- int last_frame= (frame-1+num_mach64_buffers) % num_mach64_buffers;
- /*
- buf3-5 always should point onto second buffer for better
- deinterlacing and TV-in
- */
- if(num_mach64_buffers==1) return 0;
- for(i=0; i<3; i++)
- {
- off[i] = mach64_buffer_base[frame][i];
- off[i+3]= mach64_buffer_base[last_frame][i];
- }
- if(__verbose > VERBOSE_LEVEL) printf("mach64_vid: flip_page = %u\n",frame);
-
-#if 0 // delay routine so the individual frames can be ssen better
-{
-volatile int i=0;
-for(i=0; i<10000000; i++);
-}
-#endif
-
- mach64_wait_for_idle();
- mach64_fifo_wait(7);
-
- OUTREG(SCALER_BUF0_OFFSET, off[0]);
- OUTREG(SCALER_BUF0_OFFSET_U, off[1]);
- OUTREG(SCALER_BUF0_OFFSET_V, off[2]);
- OUTREG(SCALER_BUF1_OFFSET, off[3]);
- OUTREG(SCALER_BUF1_OFFSET_U, off[4]);
- OUTREG(SCALER_BUF1_OFFSET_V, off[5]);
- if(num_mach64_buffers==2) mach64_wait_vsync(); //only wait for vsync if we do double buffering
-
- if(__verbose > VERBOSE_LEVEL) mach64_vid_dump_regs();
- return 0;
-}
-
-vidix_video_eq_t equal =
-{
- VEQ_CAP_BRIGHTNESS | VEQ_CAP_SATURATION
- ,
- 0, 0, 0, 0, 0, 0, 0, 0 };
-
-int VIDIX_NAME(vixPlaybackGetEq)( vidix_video_eq_t * eq)
-{
- memcpy(eq,&equal,sizeof(vidix_video_eq_t));
- if(!supports_colour_adj) eq->cap = VEQ_CAP_BRIGHTNESS;
- return 0;
-}
-
-int VIDIX_NAME(vixPlaybackSetEq)( const vidix_video_eq_t * eq)
-{
- int br,sat;
- if(eq->cap & VEQ_CAP_BRIGHTNESS) equal.brightness = eq->brightness;
- if(eq->cap & VEQ_CAP_CONTRAST) equal.contrast = eq->contrast;
- if(eq->cap & VEQ_CAP_SATURATION) equal.saturation = eq->saturation;
- if(eq->cap & VEQ_CAP_HUE) equal.hue = eq->hue;
- if(eq->cap & VEQ_CAP_RGB_INTENSITY)
- {
- equal.red_intensity = eq->red_intensity;
- equal.green_intensity = eq->green_intensity;
- equal.blue_intensity = eq->blue_intensity;
- }
- if(supports_colour_adj)
- {
- equal.flags = eq->flags;
- br = equal.brightness * 64 / 1000;
- if(br < -64) br = -64; if(br > 63) br = 63;
- sat = (equal.saturation + 1000) * 16 / 1000;
- if(sat < 0) sat = 0; if(sat > 31) sat = 31;
- OUTREG(SCALER_COLOUR_CNTL, (br & 0x7f) | (sat << 8) | (sat << 16));
- }
- else
- {
- unsigned gamma;
- br = equal.brightness * 3 / 1000;
- if(br < 0) br = 0;
- switch(br)
- {
- default:gamma = SCALE_GAMMA_SEL_BRIGHT; break;
- case 1: gamma = SCALE_GAMMA_SEL_G14; break;
- case 2: gamma = SCALE_GAMMA_SEL_G18; break;
- case 3: gamma = SCALE_GAMMA_SEL_G22; break;
- }
- OUTREG(OVERLAY_SCALE_CNTL,(INREG(OVERLAY_SCALE_CNTL) & ~SCALE_GAMMA_SEL_MSK) | gamma);
- }
- return 0;
-}
-
-int VIDIX_NAME(vixGetGrKeys)(vidix_grkey_t *grkey)
-{
- memcpy(grkey, &mach64_grkey, sizeof(vidix_grkey_t));
- return(0);
-}
-
-int VIDIX_NAME(vixSetGrKeys)(const vidix_grkey_t *grkey)
-{
- memcpy(&mach64_grkey, grkey, sizeof(vidix_grkey_t));
-
- if(mach64_grkey.ckey.op == CKEY_TRUE)
- {
- besr.ckey_on=1;
-
- switch(mach64_vid_get_dbpp())
- {
- case 15:
- besr.graphics_key_msk=0x7FFF;
- besr.graphics_key_clr=
- ((mach64_grkey.ckey.blue &0xF8)>>3)
- | ((mach64_grkey.ckey.green&0xF8)<<2)
- | ((mach64_grkey.ckey.red &0xF8)<<7);
- break;
- case 16:
- besr.graphics_key_msk=0xFFFF;
- besr.graphics_key_clr=
- ((mach64_grkey.ckey.blue &0xF8)>>3)
- | ((mach64_grkey.ckey.green&0xFC)<<3)
- | ((mach64_grkey.ckey.red &0xF8)<<8);
- break;
- case 24:
- besr.graphics_key_msk=0xFFFFFF;
- besr.graphics_key_clr=
- ((mach64_grkey.ckey.blue &0xFF))
- | ((mach64_grkey.ckey.green&0xFF)<<8)
- | ((mach64_grkey.ckey.red &0xFF)<<16);
- break;
- case 32:
- besr.graphics_key_msk=0xFFFFFF;
- besr.graphics_key_clr=
- ((mach64_grkey.ckey.blue &0xFF))
- | ((mach64_grkey.ckey.green&0xFF)<<8)
- | ((mach64_grkey.ckey.red &0xFF)<<16);
- break;
- default:
- besr.ckey_on=0;
- besr.graphics_key_msk=0;
- besr.graphics_key_clr=0;
- }
- }
- else
- {
- besr.ckey_on=0;
- besr.graphics_key_msk=0;
- besr.graphics_key_clr=0;
- }
-
- mach64_fifo_wait(4);
- OUTREG(OVERLAY_GRAPHICS_KEY_MSK, besr.graphics_key_msk);
- OUTREG(OVERLAY_GRAPHICS_KEY_CLR, besr.graphics_key_clr);
-// OUTREG(OVERLAY_VIDEO_KEY_MSK, 0);
-// OUTREG(OVERLAY_VIDEO_KEY_CLR, 0);
- if(besr.ckey_on)
- OUTREG(OVERLAY_KEY_CNTL,VIDEO_KEY_FN_TRUE|GRAPHIC_KEY_FN_EQ|CMP_MIX_AND);
- else
- OUTREG(OVERLAY_KEY_CNTL,VIDEO_KEY_FN_TRUE|GRAPHIC_KEY_FN_TRUE|CMP_MIX_AND);
-
- return(0);
-}
-
-#ifdef MACH64_ENABLE_BM
-static int mach64_setup_frame( vidix_dma_t * dmai )
-{
- if(mach64_overlay_offset + dmai->dest_offset + dmai->size > mach64_ram_size) return E2BIG;
- if(dmai->idx > VID_PLAY_MAXFRAMES-1) dmai->idx=0;
- if(!(dmai->internal[dmai->idx] && (dmai->flags & BM_DMA_FIXED_BUFFS)))
- {
- bm_list_descriptor * list = (bm_list_descriptor *)mach64_dma_desc_base[dmai->idx];
- unsigned long dest_ptr;
- unsigned i,n,count;
- int retval;
- n = dmai->size / 4096;
- if(dmai->size % 4096) n++;
- if((retval = VIRT_TO_CARD(dmai->src,dmai->size,dma_phys_addrs)) != 0) return retval;
- dmai->internal[dmai->idx] = mach64_dma_desc_base[dmai->idx];
- dest_ptr = dmai->dest_offset;
- count = dmai->size;
-#if 0
-printf("MACH64_DMA_REQUEST va=%X size=%X\n",dmai->src,dmai->size);
-#endif
- for(i=0;i<n;i++)
- {
- list[i].framebuf_offset = mach64_overlay_offset + dest_ptr; /* offset within of video memory */
- list[i].sys_addr = dma_phys_addrs[i];
- list[i].command = (count > 4096 ? 4096 : (count | DMA_GUI_COMMAND__EOL));
- list[i].reserved = 0;
-#if 0
-printf("MACH64_DMA_TABLE[%i] fboff=%X pa=%X cmd=%X rsrvd=%X\n",i,list[i].framebuf_offset,list[i].sys_addr,list[i].command,list[i].reserved);
-#endif
- dest_ptr += 4096;
- count -= 4096;
- }
- cpu_flush(list,4096);
- }
- return 0;
-}
-
-static int mach64_transfer_frame( unsigned long ba_dma_desc,int sync_mode )
-{
- uint32_t crtc_int;
- mach64_wait_for_idle();
- mach64_fifo_wait(4);
- OUTREG(BUS_CNTL,(INREG(BUS_CNTL)|BUS_EXT_REG_EN)&(~BUS_MASTER_DIS));
- crtc_int = INREG(CRTC_INT_CNTL);
- if(sync_mode && can_use_irq) OUTREG(CRTC_INT_CNTL,crtc_int|CRTC_BUSMASTER_EOL_INT|CRTC_BUSMASTER_EOL_INT_EN);
- else OUTREG(CRTC_INT_CNTL,crtc_int|CRTC_BUSMASTER_EOL_INT);
- OUTREG(BM_SYSTEM_TABLE,ba_dma_desc|SYSTEM_TRIGGER_SYSTEM_TO_VIDEO);
- if(__verbose > VERBOSE_LEVEL) mach64_vid_dump_regs();
-#if 0
- mach64_fifo_wait(4);
- mach64_fifo_wait(16);
- printf("MACH64_DMA_DBG: bm_fb_off=%08X bm_sysmem_addr=%08X bm_cmd=%08X bm_status=%08X bm_agp_base=%08X bm_agp_cntl=%08X\n",
- INREG(BM_FRAME_BUF_OFFSET),
- INREG(BM_SYSTEM_MEM_ADDR),
- INREG(BM_COMMAND),
- INREG(BM_STATUS),
- INREG(AGP_BASE),
- INREG(AGP_CNTL));
-#endif
- return 0;
-}
-
-int VIDIX_NAME(vixQueryDMAStatus)( void )
-{
- int bm_off;
- unsigned crtc_int_cntl;
- mach64_wait_for_idle();
- mach64_fifo_wait(2);
- crtc_int_cntl = INREG(CRTC_INT_CNTL);
- bm_off = crtc_int_cntl & CRTC_BUSMASTER_EOL_INT;
-// if(bm_off) OUTREG(CRTC_INT_CNTL,crtc_int_cntl | CRTC_BUSMASTER_EOL_INT);
- return bm_off?0:1;
-}
-
-int VIDIX_NAME(vixPlaybackCopyFrame)( vidix_dma_t * dmai )
-{
- int retval,sync_mode;
- if(!(dmai->flags & BM_DMA_FIXED_BUFFS)) if(bm_lock_mem(dmai->src,dmai->size) != 0) return errno;
- sync_mode = (dmai->flags & BM_DMA_SYNC) == BM_DMA_SYNC;
- if(sync_mode)
- {
- if(!irq_installed) init_irq();
- /* burn CPU instead of PCI bus here */
- while(vixQueryDMAStatus()!=0){
- if(can_use_irq) hwirq_wait(pci_info.irq);
- else usleep(0); /* ugly but may help */
- }
- }
- mach64_engine_reset();
- retval = mach64_setup_frame(dmai);
- VIRT_TO_CARD(mach64_dma_desc_base[dmai->idx],1,&bus_addr_dma_desc);
- if(retval == 0) retval = mach64_transfer_frame(bus_addr_dma_desc,sync_mode);
- if(!(dmai->flags & BM_DMA_FIXED_BUFFS)) bm_unlock_mem(dmai->src,dmai->size);
- return retval;
-}
-#endif
diff --git a/src/video_out/vidix/drivers/mga_vid.c b/src/video_out/vidix/drivers/mga_vid.c
deleted file mode 100644
index eed2b9e65..000000000
--- a/src/video_out/vidix/drivers/mga_vid.c
+++ /dev/null
@@ -1,1567 +0,0 @@
-/*
- * Matrox MGA driver
- *
- * ported to VIDIX by Alex Beregszaszi
- *
- * YUY2 support (see config.format) added by A'rpi/ESP-team
- * double buffering added by A'rpi/ESP-team
- *
- * Brightness/contrast support by Nick Kurshev/Dariush Pietrzak (eyck) and me
- *
- * Fixed Brightness/Contrast
- * Rewrite or read/write kabi@users.sf.net
- *
- * TODO:
- * * fix memory size detection (current reading pci userconfig isn't
- * working as requested - returns the max avail. ram on arch?)
- * * translate all non-english comments to english
- */
-
-/*
- * Original copyright:
- *
- * mga_vid.c
- *
- * Copyright (C) 1999 Aaron Holtzman
- *
- * Module skeleton based on gutted agpgart module by Jeff Hartmann
- * <slicer@ionet.net>
- *
- * Matrox MGA G200/G400 YUV Video Interface module Version 0.1.0
- *
- * BES == Back End Scaler
- *
- * This software has been released under the terms of the GNU Public
- * license. See http://www.gnu.org/copyleft/gpl.html for details.
- */
-
-//#define CRTC2
-
-// Set this value, if autodetection fails! (video ram size in megabytes)
-//#define MGA_MEMORY_SIZE 16
-
-/* No irq support in userspace implemented yet, do not enable this! */
-/* disable irq */
-#undef MGA_ALLOW_IRQ
-
-#define MGA_VSYNC_POS 2
-
-#undef MGA_PCICONFIG_MEMDETECT
-
-#define MGA_DEFAULT_FRAMES 64
-
-#define BES
-
-#ifdef MGA_TV
-#undef BES
-#define CRTC2
-#endif
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include <inttypes.h>
-
-#include "vidix.h"
-#include "fourcc.h"
-#include "libdha.h"
-#include "pci_ids.h"
-#include "pci_names.h"
-
-#if !defined(ENOTSUP) && defined(EOPNOTSUPP)
-#define ENOTSUP EOPNOTSUPP
-#endif
-
-#ifdef CRTC2
-#define VIDIX_STATIC mga_crtc2_
-#define MGA_MSG "[mga_crtc2]"
-#else
-#define VIDIX_STATIC mga_
-#define MGA_MSG "[mga]"
-#endif
-
-/* from radeon_vid */
-#define GETREG(TYPE,PTR,OFFZ) (*((volatile TYPE*)((PTR)+(OFFZ))))
-#define SETREG(TYPE,PTR,OFFZ,VAL) (*((volatile TYPE*)((PTR)+(OFFZ))))=VAL
-
-#define readb(addr) GETREG(uint8_t,(uint32_t)(mga_mmio_base + addr),0)
-#define writeb(addr, val) SETREG(uint8_t,(uint32_t)(mga_mmio_base + addr),0,val)
-#define readl(addr) GETREG(uint32_t,(uint32_t)(mga_mmio_base + addr),0)
-#define writel(addr, val) SETREG(uint32_t,(uint32_t)(mga_mmio_base + addr),0,val)
-
-static int mga_verbose = 0;
-
-/* for device detection */
-static int probed = 0;
-static pciinfo_t pci_info;
-
-/* internal booleans */
-static int mga_vid_in_use = 0;
-static int is_g400 = 0;
-static int vid_src_ready = 0;
-static int vid_overlay_on = 0;
-
-/* mapped physical addresses */
-static uint8_t *mga_mmio_base = 0;
-static uint8_t* mga_mem_base = 0;
-
-static int mga_src_base = 0; /* YUV buffer position in video memory */
-
-static uint32_t mga_ram_size = 0; /* how much megabytes videoram we have */
-
-/* Graphic keys */
-static vidix_grkey_t mga_grkey;
-
-static int colkey_saved = 0;
-static int colkey_on = 0;
-static unsigned char colkey_color[4];
-static unsigned char colkey_mask[4];
-
-/* for IRQ */
-static int mga_irq = -1;
-
-static int mga_next_frame = 0;
-
-static vidix_capability_t mga_cap =
-{
-#ifdef CRTC2
- "Matrox MGA G200/G4x0/G5x0 YUV Video - with second-head support",
-#else
- "Matrox MGA G200/G4x0/G5x0 YUV Video",
-#endif
- "Aaron Holtzman, Arpad Gereoffy, Alex Beregszaszi, Nick Kurshev",
- TYPE_OUTPUT,
- { 0, 0, 0, 0 },
- 2048,
- 2048,
- 4,
- 4,
- -1,
- FLAG_UPSCALER | FLAG_DOWNSCALER | FLAG_EQUALIZER,
- VENDOR_MATROX,
- -1, /* will be set in VIDIX_NAME(vixProbe) */
- { 0, 0, 0, 0}
-};
-
-/* MATROX BES registers */
-typedef struct bes_registers_s
-{
- //BES Control
- uint32_t besctl;
- //BES Global control
- uint32_t besglobctl;
- //Luma control (brightness and contrast)
- uint32_t beslumactl;
- //Line pitch
- uint32_t bespitch;
-
- //Buffer A-1 Chroma 3 plane org
- uint32_t besa1c3org;
- //Buffer A-1 Chroma org
- uint32_t besa1corg;
- //Buffer A-1 Luma org
- uint32_t besa1org;
-
- //Buffer A-2 Chroma 3 plane org
- uint32_t besa2c3org;
- //Buffer A-2 Chroma org
- uint32_t besa2corg;
- //Buffer A-2 Luma org
- uint32_t besa2org;
-
- //Buffer B-1 Chroma 3 plane org
- uint32_t besb1c3org;
- //Buffer B-1 Chroma org
- uint32_t besb1corg;
- //Buffer B-1 Luma org
- uint32_t besb1org;
-
- //Buffer B-2 Chroma 3 plane org
- uint32_t besb2c3org;
- //Buffer B-2 Chroma org
- uint32_t besb2corg;
- //Buffer B-2 Luma org
- uint32_t besb2org;
-
- //BES Horizontal coord
- uint32_t beshcoord;
- //BES Horizontal inverse scaling [5.14]
- uint32_t beshiscal;
- //BES Horizontal source start [10.14] (for scaling)
- uint32_t beshsrcst;
- //BES Horizontal source ending [10.14] (for scaling)
- uint32_t beshsrcend;
- //BES Horizontal source last
- uint32_t beshsrclst;
-
-
- //BES Vertical coord
- uint32_t besvcoord;
- //BES Vertical inverse scaling [5.14]
- uint32_t besviscal;
- //BES Field 1 vertical source last position
- uint32_t besv1srclst;
- //BES Field 1 weight start
- uint32_t besv1wght;
- //BES Field 2 vertical source last position
- uint32_t besv2srclst;
- //BES Field 2 weight start
- uint32_t besv2wght;
-
-} bes_registers_t;
-static bes_registers_t regs;
-
-#ifdef CRTC2
-typedef struct crtc2_registers_s
-{
- uint32_t c2ctl;
- uint32_t c2datactl;
- uint32_t c2misc;
- uint32_t c2hparam;
- uint32_t c2hsync;
- uint32_t c2offset;
- uint32_t c2pl2startadd0;
- uint32_t c2pl2startadd1;
- uint32_t c2pl3startadd0;
- uint32_t c2pl3startadd1;
- uint32_t c2preload;
- uint32_t c2spicstartadd0;
- uint32_t c2spicstartadd1;
- uint32_t c2startadd0;
- uint32_t c2startadd1;
- uint32_t c2subpiclut;
- uint32_t c2vcount;
- uint32_t c2vparam;
- uint32_t c2vsync;
-} crtc2_registers_t;
-static crtc2_registers_t cregs;
-static crtc2_registers_t cregs_save;
-#endif
-
-//All register offsets are converted to word aligned offsets (32 bit)
-//because we want all our register accesses to be 32 bits
-#define VCOUNT 0x1e20
-
-#define PALWTADD 0x3c00 // Index register for X_DATAREG port
-#define X_DATAREG 0x3c0a
-
-#define XMULCTRL 0x19
-#define BPP_8 0x00
-#define BPP_15 0x01
-#define BPP_16 0x02
-#define BPP_24 0x03
-#define BPP_32_DIR 0x04
-#define BPP_32_PAL 0x07
-
-#define XCOLMSK 0x40
-#define X_COLKEY 0x42
-#define XKEYOPMODE 0x51
-#define XCOLMSK0RED 0x52
-#define XCOLMSK0GREEN 0x53
-#define XCOLMSK0BLUE 0x54
-#define XCOLKEY0RED 0x55
-#define XCOLKEY0GREEN 0x56
-#define XCOLKEY0BLUE 0x57
-
-#ifdef CRTC2
-/*CRTC2 registers*/
-#define XMISCCTRL 0x1e
-#define C2CTL 0x3c10
-#define C2DATACTL 0x3c4c
-#define C2MISC 0x3c44
-#define C2HPARAM 0x3c14
-#define C2HSYNC 0x3c18
-#define C2OFFSET 0x3c40
-#define C2PL2STARTADD0 0x3c30 // like BESA1CORG
-#define C2PL2STARTADD1 0x3c34 // like BESA2CORG
-#define C2PL3STARTADD0 0x3c38 // like BESA1C3ORG
-#define C2PL3STARTADD1 0x3c3c // like BESA2C3ORG
-#define C2PRELOAD 0x3c24
-#define C2SPICSTARTADD0 0x3c54
-#define C2SPICSTARTADD1 0x3c58
-#define C2STARTADD0 0x3c28 // like BESA1ORG
-#define C2STARTADD1 0x3c2c // like BESA2ORG
-#define C2SUBPICLUT 0x3c50
-#define C2VCOUNT 0x3c48
-#define C2VPARAM 0x3c1c
-#define C2VSYNC 0x3c20
-#endif /* CRTC2 */
-
-// Backend Scaler registers
-#define BESCTL 0x3d20
-#define BESGLOBCTL 0x3dc0
-#define BESLUMACTL 0x3d40
-#define BESPITCH 0x3d24
-
-#define BESA1C3ORG 0x3d60
-#define BESA1CORG 0x3d10
-#define BESA1ORG 0x3d00
-
-#define BESA2C3ORG 0x3d64
-#define BESA2CORG 0x3d14
-#define BESA2ORG 0x3d04
-
-#define BESB1C3ORG 0x3d68
-#define BESB1CORG 0x3d18
-#define BESB1ORG 0x3d08
-
-#define BESB2C3ORG 0x3d6C
-#define BESB2CORG 0x3d1C
-#define BESB2ORG 0x3d0C
-
-#define BESHCOORD 0x3d28
-#define BESHISCAL 0x3d30
-#define BESHSRCEND 0x3d3C
-#define BESHSRCLST 0x3d50
-#define BESHSRCST 0x3d38
-#define BESV1WGHT 0x3d48
-#define BESV2WGHT 0x3d4c
-#define BESV1SRCLST 0x3d54
-#define BESV2SRCLST 0x3d58
-#define BESVISCAL 0x3d34
-#define BESVCOORD 0x3d2c
-#define BESSTATUS 0x3dc4
-
-#define CRTCX 0x1fd4
-#define CRTCD 0x1fd5
-#define IEN 0x1e1c
-#define ICLEAR 0x1e18
-#define STATUS 0x1e14
-#define CRTCEXTX 0x1fde
-#define CRTCEXTD 0x1fdf
-
-
-#ifdef CRTC2
-static void crtc2_frame_sel(int frame)
-{
- switch(frame) {
- case 0:
- cregs.c2pl2startadd0=regs.besa1corg;
- cregs.c2pl3startadd0=regs.besa1c3org;
- cregs.c2startadd0=regs.besa1org;
- break;
- case 1:
- cregs.c2pl2startadd0=regs.besa2corg;
- cregs.c2pl3startadd0=regs.besa2c3org;
- cregs.c2startadd0=regs.besa2org;
- break;
- case 2:
- cregs.c2pl2startadd0=regs.besb1corg;
- cregs.c2pl3startadd0=regs.besb1c3org;
- cregs.c2startadd0=regs.besb1org;
- break;
- case 3:
- cregs.c2pl2startadd0=regs.besb2corg;
- cregs.c2pl3startadd0=regs.besb2c3org;
- cregs.c2startadd0=regs.besb2org;
- break;
- }
- writel(C2STARTADD0, cregs.c2startadd0);
- writel(C2PL2STARTADD0, cregs.c2pl2startadd0);
- writel(C2PL3STARTADD0, cregs.c2pl3startadd0);
-}
-#endif
-
-int VIDIX_NAME(vixPlaybackFrameSelect)(unsigned int frame)
-{
- mga_next_frame = frame;
- if (mga_verbose>1) printf(MGA_MSG" frameselect: %d\n", mga_next_frame);
-#if MGA_ALLOW_IRQ
- if (mga_irq == -1)
-#endif
- {
-#ifdef BES
- //we don't need the vcount protection as we're only hitting
- //one register (and it doesn't seem to be double buffered)
- regs.besctl = (regs.besctl & ~0x07000000) + (mga_next_frame << 25);
- writel(BESCTL, regs.besctl);
-
- // writel( regs.besglobctl + ((readl(VCOUNT)+2)<<16),
- writel(BESGLOBCTL, regs.besglobctl + (MGA_VSYNC_POS<<16));
-#endif
-#ifdef CRTC2
- crtc2_frame_sel(mga_next_frame);
-#endif
- }
-
- return(0);
-}
-
-
-static void mga_vid_write_regs(int restore)
-{
-#ifdef BES
- //Make sure internal registers don't get updated until we're done
- writel(BESGLOBCTL, (readl(VCOUNT)-1)<<16);
-
- // color or coordinate keying
-
- if (restore && colkey_saved)
- {
- // restore it
- colkey_saved = 0;
-
- // Set color key registers:
- writeb(PALWTADD, XKEYOPMODE);
- writeb(X_DATAREG, colkey_on);
-
- writeb(PALWTADD, XCOLKEY0RED);
- writeb(X_DATAREG, colkey_color[0]);
- writeb(PALWTADD, XCOLKEY0GREEN);
- writeb(X_DATAREG, colkey_color[1]);
- writeb(PALWTADD, XCOLKEY0BLUE);
- writeb(X_DATAREG, colkey_color[2]);
- writeb(PALWTADD, X_COLKEY);
- writeb(X_DATAREG, colkey_color[3]);
-
- writeb(PALWTADD, XCOLMSK0RED);
- writeb(X_DATAREG, colkey_mask[0]);
- writeb(PALWTADD, XCOLMSK0GREEN);
- writeb(X_DATAREG, colkey_mask[1]);
- writeb(PALWTADD, XCOLMSK0BLUE);
- writeb(X_DATAREG, colkey_mask[2]);
- writeb(PALWTADD, XCOLMSK);
- writeb(X_DATAREG, colkey_mask[3]);
-
- printf(MGA_MSG" Restored colorkey (ON: %d %02X:%02X:%02X)\n",
- colkey_on,colkey_color[0],colkey_color[1],colkey_color[2]);
-
- } else if (!colkey_saved) {
- // save it
- colkey_saved=1;
- // Get color key registers:
- writeb(PALWTADD, XKEYOPMODE);
- colkey_on = readb(X_DATAREG) & 1;
-
- writeb(PALWTADD, XCOLKEY0RED);
- colkey_color[0]=(unsigned char)readb(X_DATAREG);
- writeb(PALWTADD, XCOLKEY0GREEN);
- colkey_color[1]=(unsigned char)readb(X_DATAREG);
- writeb(PALWTADD, XCOLKEY0BLUE);
- colkey_color[2]=(unsigned char)readb(X_DATAREG);
- writeb(PALWTADD, X_COLKEY);
- colkey_color[3]=(unsigned char)readb(X_DATAREG);
-
- writeb(PALWTADD, XCOLMSK0RED);
- colkey_mask[0]=(unsigned char)readb(X_DATAREG);
- writeb(PALWTADD, XCOLMSK0GREEN);
- colkey_mask[1]=(unsigned char)readb(X_DATAREG);
- writeb(PALWTADD, XCOLMSK0BLUE);
- colkey_mask[2]=(unsigned char)readb(X_DATAREG);
- writeb(PALWTADD, XCOLMSK);
- colkey_mask[3]=(unsigned char)readb(X_DATAREG);
-
- printf(MGA_MSG" Saved colorkey (ON: %d %02X:%02X:%02X)\n",
- colkey_on,colkey_color[0],colkey_color[1],colkey_color[2]);
- }
-
- if (!restore)
- {
- writeb(PALWTADD, XKEYOPMODE);
- writeb(X_DATAREG, (mga_grkey.ckey.op == CKEY_TRUE));
- if ( mga_grkey.ckey.op == CKEY_TRUE )
- {
- uint32_t r=0, g=0, b=0;
-
- writeb(PALWTADD, XMULCTRL);
- switch (readb(X_DATAREG))
- {
- case BPP_8:
- /* Need to look up the color index, just using
- color 0 for now. */
- break;
- case BPP_15:
- r = mga_grkey.ckey.red >> 3;
- g = mga_grkey.ckey.green >> 3;
- b = mga_grkey.ckey.blue >> 3;
- break;
- case BPP_16:
- r = mga_grkey.ckey.red >> 3;
- g = mga_grkey.ckey.green >> 2;
- b = mga_grkey.ckey.blue >> 3;
- break;
- case BPP_24:
- case BPP_32_DIR:
- case BPP_32_PAL:
- r = mga_grkey.ckey.red;
- g = mga_grkey.ckey.green;
- b = mga_grkey.ckey.blue;
- break;
- }
-
- // Disable color keying on alpha channel
- writeb(PALWTADD, XCOLMSK);
- writeb(X_DATAREG, 0x00);
- writeb(PALWTADD, X_COLKEY);
- writeb(X_DATAREG, 0x00);
-
-
- // Set up color key registers
- writeb(PALWTADD, XCOLKEY0RED);
- writeb(X_DATAREG, r);
- writeb(PALWTADD, XCOLKEY0GREEN);
- writeb(X_DATAREG, g);
- writeb(PALWTADD, XCOLKEY0BLUE);
- writeb(X_DATAREG, b);
-
- // Set up color key mask registers
- writeb(PALWTADD, XCOLMSK0RED);
- writeb(X_DATAREG, 0xff);
- writeb(PALWTADD, XCOLMSK0GREEN);
- writeb(X_DATAREG, 0xff);
- writeb(PALWTADD, XCOLMSK0BLUE);
- writeb(X_DATAREG, 0xff);
- }
- }
-
- // Backend Scaler
- writel(BESCTL, regs.besctl);
- if (is_g400)
- writel(BESLUMACTL, regs.beslumactl);
- writel(BESPITCH, regs.bespitch);
-
- writel(BESA1ORG, regs.besa1org);
- writel(BESA1CORG, regs.besa1corg);
- writel(BESA2ORG, regs.besa2org);
- writel(BESA2CORG, regs.besa2corg);
- writel(BESB1ORG, regs.besb1org);
- writel(BESB1CORG, regs.besb1corg);
- writel(BESB2ORG, regs.besb2org);
- writel(BESB2CORG, regs.besb2corg);
- if(is_g400)
- {
- writel(BESA1C3ORG, regs.besa1c3org);
- writel(BESA2C3ORG, regs.besa2c3org);
- writel(BESB1C3ORG, regs.besb1c3org);
- writel(BESB2C3ORG, regs.besb2c3org);
- }
-
- writel(BESHCOORD, regs.beshcoord);
- writel(BESHISCAL, regs.beshiscal);
- writel(BESHSRCST, regs.beshsrcst);
- writel(BESHSRCEND, regs.beshsrcend);
- writel(BESHSRCLST, regs.beshsrclst);
-
- writel(BESVCOORD, regs.besvcoord);
- writel(BESVISCAL, regs.besviscal);
-
- writel(BESV1SRCLST, regs.besv1srclst);
- writel(BESV1WGHT, regs.besv1wght);
- writel(BESV2SRCLST, regs.besv2srclst);
- writel(BESV2WGHT, regs.besv2wght);
-
- //update the registers somewhere between 1 and 2 frames from now.
- writel(BESGLOBCTL, regs.besglobctl + ((readl(VCOUNT)+2)<<16));
-
- if (mga_verbose > 1)
- {
- printf(MGA_MSG" wrote BES registers\n");
- printf(MGA_MSG" BESCTL = 0x%08x\n", readl(BESCTL));
- printf(MGA_MSG" BESGLOBCTL = 0x%08x\n", readl(BESGLOBCTL));
- printf(MGA_MSG" BESSTATUS= 0x%08x\n", readl(BESSTATUS));
- }
-#endif
-
-#ifdef CRTC2
-#if 0
- if (cregs_save.c2ctl == 0)
- {
- //int i;
- cregs_save.c2ctl = readl(C2CTL);
- cregs_save.c2datactl = readl(C2DATACTL);
- cregs_save.c2misc = readl(C2MISC);
-
- //for (i = 0; i <= 8; i++) { writeb(CRTCEXTX, i); printf("CRTCEXT%d %x\n", i, readb(CRTCEXTD)); }
- //printf("c2ctl:0x%08x c2datactl:0x%08x\n", cregs_save.c2ctl, cregs_save.c2datactl);
- //printf("c2misc:0x%08x\n", readl(C2MISC));
- //printf("c2ctl:0x%08x c2datactl:0x%08x\n", cregs.c2ctl, cregs.c2datactl);
- }
- if (restore)
- {
- writel(C2CTL, cregs_save.c2ctl);
- writel(C2DATACTL, cregs_save.c2datactl);
- writel(C2MISC, cregs_save.c2misc);
- return;
- }
-#endif
- // writel(C2CTL, cregs.c2ctl);
-
- writel(C2CTL, ((readl(C2CTL) & ~0x03e00000) + (cregs.c2ctl & 0x03e00000)));
- writel(C2DATACTL, ((readl(C2DATACTL) & ~0x000000ff) + (cregs.c2datactl & 0x000000ff)));
- // ctrc2
- // disable CRTC2 acording to specs
- // writel(C2CTL, cregs.c2ctl & 0xfffffff0);
- // je to treba ???
- // writeb(XMISCCTRL, (readb(XMISCCTRL) & 0x19) | 0xa2); // MAFC - mfcsel & vdoutsel
- // writeb(XMISCCTRL, (readb(XMISCCTRL) & 0x19) | 0x92);
- // writeb(XMISCCTRL, (readb(XMISCCTRL) & ~0xe9) + 0xa2);
- writel(C2DATACTL, cregs.c2datactl);
-// writel(C2HPARAM, cregs.c2hparam);
- writel(C2HSYNC, cregs.c2hsync);
-// writel(C2VPARAM, cregs.c2vparam);
- writel(C2VSYNC, cregs.c2vsync);
- //xx
- //writel(C2MISC, cregs.c2misc);
-
- if (mga_verbose > 1) printf(MGA_MSG" c2offset = %d\n", cregs.c2offset);
-
- writel(C2OFFSET, cregs.c2offset);
- writel(C2STARTADD0, cregs.c2startadd0);
- // writel(C2STARTADD1, cregs.c2startadd1);
- writel(C2PL2STARTADD0, cregs.c2pl2startadd0);
- // writel(C2PL2STARTADD1, cregs.c2pl2startadd1);
- writel(C2PL3STARTADD0, cregs.c2pl3startadd0);
- // writel(C2PL3STARTADD1, cregs.c2pl3startadd1);
- writel(C2SPICSTARTADD0, cregs.c2spicstartadd0);
-
- //xx
- //writel(C2SPICSTARTADD1, cregs.c2spicstartadd1);
-
- //set Color Lookup Table for Subpicture Layer
- {
- unsigned char r, g, b, y, cb, cr;
- int i;
- for (i = 0; i < 16; i++) {
-
- r = (i & 0x8) ? 0xff : 0x00;
- g = (i & 0x4) ? ((i & 0x2) ? 0xff : 0xaa) : ((i & 0x2) ? 0x55 : 0x00);
- b = (i & 0x1) ? 0xff : 0x00;
-
- y = ((r * 16829 + g * 33039 + b * 6416 + 0x8000) >> 16) + 16;
- cb = ((r * -9714 + g * -19071 + b * 28784 + 0x8000) >> 16) + 128;
- cr = ((r * 28784 + g * -24103 + b * -4681 + 0x8000) >> 16) + 128;
-
- cregs.c2subpiclut = (cr << 24) | (cb << 16) | (y << 8) | i;
- writel(C2SUBPICLUT, cregs.c2subpiclut);
- }
- }
-
- //writel(C2PRELOAD, cregs.c2preload);
-
- // finaly enable everything
-// writel(C2CTL, cregs.c2ctl);
- // printf("c2ctl:0x%08x c2datactl:0x%08x\n",readl(C2CTL), readl(C2DATACTL));
- // printf("c2misc:0x%08x\n", readl(C2MISC));
-#endif
-}
-
-#ifdef MGA_ALLOW_IRQ
-static void enable_irq()
-{
- long int cc;
-
- cc = readl(IEN);
- // printf("*** !!! IRQREG = %d\n", (int)(cc&0xff));
-
- writeb(CRTCX, 0x11);
-
- writeb(CRTCD, 0x20); /* clear 0, enable off */
- writeb(CRTCD, 0x00); /* enable on */
- writeb(CRTCD, 0x10); /* clear = 1 */
-
- writel(BESGLOBCTL, regs.besglobctl);
-
- return;
-}
-
-static void disable_irq()
-{
- writeb(CRTCX, 0x11);
- writeb(CRTCD, 0x20); /* clear 0, enable off */
-
- return;
-}
-
-void mga_handle_irq(int irq, void *dev_id/*, struct pt_regs *pregs*/) {
- // static int frame=0;
- // static int counter=0;
- long int cc;
- // if ( ! mga_enabled_flag ) return;
-
- // printf("vcount = %d\n",readl(VCOUNT));
-
- //printf("mga_interrupt #%d\n", irq);
-
- if ( irq != -1 ) {
-
- cc = readl(STATUS);
- if ( ! (cc & 0x10) ) return; /* vsyncpen */
- // debug_irqcnt++;
- }
-
- // if ( debug_irqignore ) {
- // debug_irqignore = 0;
-
- /*
- if ( mga_conf_deinterlace ) {
- if ( mga_first_field ) {
- // printf("mga_interrupt first field\n");
- if ( syncfb_interrupt() )
- mga_first_field = 0;
- } else {
- // printf("mga_interrupt second field\n");
- mga_select_buffer( mga_current_field | 2 );
- mga_first_field = 1;
- }
- } else {
- syncfb_interrupt();
- }
- */
-
- // frame=(frame+1)&1;
- regs.besctl = (regs.besctl & ~0x07000000) + (mga_next_frame << 25);
- writel(BESCTL, regs.besctl);
-
-#ifdef CRTC2
- crtc2_frame_sel(mga_next_frame);
-#endif
-
-#if 0
- ++counter;
- if(!(counter&63)){
- printf("mga irq counter = %d\n",counter);
- }
-#endif
-
- // } else {
- // debug_irqignore = 1;
- // }
-
- if ( irq != -1 ) {
- writeb(CRTCX, 0x11);
- writeb(CRTCD, 0);
- writeb(CRTCD, 0x10);
- }
-
- //writel(BESGLOBCTL, regs.besglobctl);
-
-}
-#endif /* MGA_ALLOW_IRQ */
-
-int VIDIX_NAME(vixConfigPlayback)(vidix_playback_t *config)
-{
- unsigned int i;
- int x, y, sw, sh, dw, dh;
- int besleft, bestop, ifactor, ofsleft, ofstop, baseadrofs, weight, weights;
-#ifdef CRTC2
-#define right_margin 0
-#define left_margin 18
-#define hsync_len 46
-#define lower_margin 10
-#define vsync_len 4
-#define upper_margin 39
-
- unsigned int hdispend = (config->src.w + 31) & ~31;
- unsigned int hsyncstart = hdispend + (right_margin & ~7);
- unsigned int hsyncend = hsyncstart + (hsync_len & ~7);
- unsigned int htotal = hsyncend + (left_margin & ~7);
- unsigned int vdispend = config->src.h;
- unsigned int vsyncstart = vdispend + lower_margin;
- unsigned int vsyncend = vsyncstart + vsync_len;
- unsigned int vtotal = vsyncend + upper_margin;
-#endif
-
- if ((config->num_frames < 1) || (config->num_frames > MGA_DEFAULT_FRAMES))
- {
- printf(MGA_MSG" illegal num_frames: %d, setting to %d\n",
- config->num_frames, MGA_DEFAULT_FRAMES);
- config->num_frames = MGA_DEFAULT_FRAMES;
- }
- for(;config->num_frames>0;config->num_frames--)
- {
- /*FIXME: this driver can use more frames but we need to apply
- some tricks to avoid RGB-memory hits*/
- mga_src_base = ((mga_ram_size/2)*0x100000-(config->num_frames+1)*config->frame_size);
- mga_src_base &= (~0xFFFF); /* 64k boundary */
- if(mga_src_base>=0) break;
- }
- if (mga_verbose > 1) printf(MGA_MSG" YUV buffer base: 0x%x\n", mga_src_base);
-
- config->dga_addr = mga_mem_base + mga_src_base;
-
- x = config->dest.x;
- y = config->dest.y;
- sw = config->src.w;
- sh = config->src.h;
- dw = config->dest.w;
- dh = config->dest.h;
-
- if (mga_verbose) printf(MGA_MSG" Setting up a %dx%d-%dx%d video window (src %dx%d) format %X\n",
- dw, dh, x, y, sw, sh, config->fourcc);
-
- if ((sw < 4) || (sh < 4) || (dw < 4) || (dh < 4))
- {
- printf(MGA_MSG" Invalid src/dest dimensions\n");
- return(EINVAL);
- }
-
- //FIXME check that window is valid and inside desktop
-
- // printf(MGA_MSG" vcount = %d\n", readl(VCOUNT));
-
- sw += sw & 1;
- switch(config->fourcc)
- {
- case IMGFMT_I420:
- case IMGFMT_IYUV:
- case IMGFMT_YV12:
- sh+=sh&1;
- config->dest.pitch.y=config->dest.pitch.u=config->dest.pitch.v=32;
- config->frame_size = ((sw + 31) & ~31) * sh + (((sw + 31) & ~31) * sh) / 2;
- break;
- case IMGFMT_YUY2:
- case IMGFMT_UYVY:
- config->dest.pitch.y=16;
- config->dest.pitch.u=config->dest.pitch.v=0;
- config->frame_size = ((sw + 8) & ~8) * sh * 2;
- break;
- default:
- printf(MGA_MSG" Unsupported pixel format: %x\n", config->fourcc);
- return(ENOTSUP);
- }
-
- config->offsets[0] = 0;
- // config->offsets[1] = config->frame_size;
- // config->offsets[2] = 2*config->frame_size;
- // config->offsets[3] = 3*config->frame_size;
- for (i = 1; i < config->num_frames+2; i++)
- config->offsets[i] = i*config->frame_size;
-
- config->offset.y=0;
- config->offset.v=((sw + 31) & ~31) * sh;
- config->offset.u=config->offset.v+((sw + 31) & ~31) * sh /4;
-
- //FIXME figure out a better way to allocate memory on card
- //allocate 2 megs
- //mga_src_base = mga_mem_base + (MGA_VIDMEM_SIZE-2) * 0x100000;
- //mga_src_base = (MGA_VIDMEM_SIZE-3) * 0x100000;
-
-
- /* for G200 set Interleaved UV planes */
- if (!is_g400)
- config->flags = VID_PLAY_INTERLEAVED_UV | INTERLEAVING_UV;
-
- //Setup the BES registers for a three plane 4:2:0 video source
-
- regs.besglobctl = 0;
-
- switch(config->fourcc)
- {
- case IMGFMT_YV12:
- case IMGFMT_I420:
- case IMGFMT_IYUV:
- regs.besctl = 1 // BES enabled
- + (0<<6) // even start polarity
- + (1<<10) // x filtering enabled
- + (1<<11) // y filtering enabled
- + (1<<16) // chroma upsampling
- + (1<<17) // 4:2:0 mode
- + (1<<18); // dither enabled
-#if 0
- if(is_g400)
- {
- //zoom disabled, zoom filter disabled, 420 3 plane format, proc amp
- //disabled, rgb mode disabled
- regs.besglobctl = (1<<5);
- }
- else
- {
- //zoom disabled, zoom filter disabled, Cb samples in 0246, Cr
- //in 1357, BES register update on besvcnt
- regs.besglobctl = 0;
- }
-#endif
- break;
-
- case IMGFMT_YUY2:
- regs.besctl = 1 // BES enabled
- + (0<<6) // even start polarity
- + (1<<10) // x filtering enabled
- + (1<<11) // y filtering enabled
- + (1<<16) // chroma upsampling
- + (0<<17) // 4:2:2 mode
- + (1<<18); // dither enabled
-
- regs.besglobctl = 0; // YUY2 format selected
- break;
-
- case IMGFMT_UYVY:
- regs.besctl = 1 // BES enabled
- + (0<<6) // even start polarity
- + (1<<10) // x filtering enabled
- + (1<<11) // y filtering enabled
- + (1<<16) // chroma upsampling
- + (0<<17) // 4:2:2 mode
- + (1<<18); // dither enabled
-
- regs.besglobctl = 1<<6; // UYVY format selected
- break;
-
- }
-
- //Disable contrast and brightness control
- regs.besglobctl |= (1<<5) + (1<<7);
- // we want to preserver these across restarts
- //regs.beslumactl = (0x0 << 16) + 0x80;
-
- //Setup destination window boundaries
- besleft = x > 0 ? x : 0;
- bestop = y > 0 ? y : 0;
- regs.beshcoord = (besleft<<16) + (x + dw-1);
- regs.besvcoord = (bestop<<16) + (y + dh-1);
-
- //Setup source dimensions
- regs.beshsrclst = (sw - 1) << 16;
- switch(config->fourcc)
- {
- case IMGFMT_YV12:
- case IMGFMT_I420:
- case IMGFMT_IYUV:
- regs.bespitch = (sw + 31) & ~31;
- break;
- case IMGFMT_YUY2:
- case IMGFMT_UYVY:
- regs.bespitch = (sw + 8) & ~8;
- break;
- }
-
- //Setup horizontal scaling
- ifactor = ((sw-1)<<14)/(dw-1);
- ofsleft = besleft - x;
-
- regs.beshiscal = ifactor<<2;
- regs.beshsrcst = (ofsleft*ifactor)<<2;
- regs.beshsrcend = regs.beshsrcst + (((dw - ofsleft - 1) * ifactor) << 2);
-
- //Setup vertical scaling
- ifactor = ((sh-1)<<14)/(dh-1);
- ofstop = bestop - y;
-
- regs.besviscal = ifactor<<2;
-
- baseadrofs = ((ofstop*regs.besviscal)>>16)*regs.bespitch;
- //frame_size = ((sw + 31) & ~31) * sh + (((sw + 31) & ~31) * sh) / 2;
- regs.besa1org = (uint32_t) mga_src_base + baseadrofs;
- regs.besa2org = (uint32_t) mga_src_base + baseadrofs + 1*config->frame_size;
- regs.besb1org = (uint32_t) mga_src_base + baseadrofs + 2*config->frame_size;
- regs.besb2org = (uint32_t) mga_src_base + baseadrofs + 3*config->frame_size;
-
- if (config->fourcc == IMGFMT_YV12
- || config->fourcc == IMGFMT_IYUV
- || config->fourcc == IMGFMT_I420)
- {
- // planar YUV frames:
- if (is_g400)
- baseadrofs = (((ofstop*regs.besviscal)/4)>>16)*regs.bespitch;
- else
- baseadrofs = (((ofstop*regs.besviscal)/2)>>16)*regs.bespitch;
-
- if (config->fourcc == IMGFMT_YV12){
- regs.besa1corg = (uint32_t) mga_src_base + baseadrofs + regs.bespitch * sh ;
- regs.besa2corg = (uint32_t) mga_src_base + baseadrofs + 1*config->frame_size + regs.bespitch * sh;
- regs.besb1corg = (uint32_t) mga_src_base + baseadrofs + 2*config->frame_size + regs.bespitch * sh;
- regs.besb2corg = (uint32_t) mga_src_base + baseadrofs + 3*config->frame_size + regs.bespitch * sh;
- regs.besa1c3org = regs.besa1corg + ((regs.bespitch * sh) / 4);
- regs.besa2c3org = regs.besa2corg + ((regs.bespitch * sh) / 4);
- regs.besb1c3org = regs.besb1corg + ((regs.bespitch * sh) / 4);
- regs.besb2c3org = regs.besb2corg + ((regs.bespitch * sh) / 4);
- } else {
- regs.besa1c3org = (uint32_t) mga_src_base + baseadrofs + regs.bespitch * sh ;
- regs.besa2c3org = (uint32_t) mga_src_base + baseadrofs + 1*config->frame_size + regs.bespitch * sh;
- regs.besb1c3org = (uint32_t) mga_src_base + baseadrofs + 2*config->frame_size + regs.bespitch * sh;
- regs.besb2c3org = (uint32_t) mga_src_base + baseadrofs + 3*config->frame_size + regs.bespitch * sh;
- regs.besa1corg = regs.besa1c3org + ((regs.bespitch * sh) / 4);
- regs.besa2corg = regs.besa2c3org + ((regs.bespitch * sh) / 4);
- regs.besb1corg = regs.besb1c3org + ((regs.bespitch * sh) / 4);
- regs.besb2corg = regs.besb2c3org + ((regs.bespitch * sh) / 4);
- }
- }
-
- weight = ofstop * (regs.besviscal >> 2);
- weights = weight < 0 ? 1 : 0;
- regs.besv2wght = regs.besv1wght = (weights << 16) + ((weight & 0x3FFF) << 2);
- regs.besv2srclst = regs.besv1srclst = sh - 1 - (((ofstop * regs.besviscal) >> 16) & 0x03FF);
-
-#ifdef CRTC2
- // pridat hlavni registry - tj. casovani ...
-
-
- switch(config->fourcc){
- case IMGFMT_YV12:
- case IMGFMT_I420:
- case IMGFMT_IYUV:
- cregs.c2ctl = 1 // CRTC2 enabled
- + (1<<1) // external clock
- + (0<<2) // external clock
- + (1<<3) // pixel clock enable - not needed ???
- + (0<<4) // high priority req
- + (1<<5) // high priority req
- + (0<<6) // high priority req
- + (1<<8) // high priority req max
- + (0<<9) // high priority req max
- + (0<<10) // high priority req max
- + (0<<20) // CRTC1 to DAC
- + (1<<21) // 420 mode
- + (1<<22) // 420 mode
- + (1<<23) // 420 mode
- + (0<<24) // single chroma line for 420 mode - need to be corrected
- + (0<<25) /*/ interlace mode - need to be corrected*/
- + (0<<26) // field legth polariry
- + (0<<27) // field identification polariry
- + (1<<28) // VIDRST detection mode
- + (0<<29) // VIDRST detection mode
- + (1<<30) // Horizontal counter preload
- + (1<<31) // Vertical counter preload
- ;
- cregs.c2datactl = 1 // disable dither - propably not needed, we are already in YUV mode
- + (1<<1) // Y filter enable
- + (1<<2) // CbCr filter enable
- + (1<<3) // subpicture enable (enabled)
- + (0<<4) // NTSC enable (disabled - PAL)
- + (0<<5) // C2 static subpicture enable (disabled)
- + (0<<6) // C2 subpicture offset division (disabled)
- + (0<<7) // 422 subformat selection !
- /* + (0<<8) // 15 bpp high alpha
- + (0<<9) // 15 bpp high alpha
- + (0<<10) // 15 bpp high alpha
- + (0<<11) // 15 bpp high alpha
- + (0<<12) // 15 bpp high alpha
- + (0<<13) // 15 bpp high alpha
- + (0<<14) // 15 bpp high alpha
- + (0<<15) // 15 bpp high alpha
- + (0<<16) // 15 bpp low alpha
- + (0<<17) // 15 bpp low alpha
- + (0<<18) // 15 bpp low alpha
- + (0<<19) // 15 bpp low alpha
- + (0<<20) // 15 bpp low alpha
- + (0<<21) // 15 bpp low alpha
- + (0<<22) // 15 bpp low alpha
- + (0<<23) // 15 bpp low alpha
- + (0<<24) // static subpicture key
- + (0<<25) // static subpicture key
- + (0<<26) // static subpicture key
- + (0<<27) // static subpicture key
- + (0<<28) // static subpicture key
- */ ;
- break;
-
- case IMGFMT_YUY2:
- cregs.c2ctl = 1 // CRTC2 enabled
- + (1<<1) // external clock
- + (0<<2) // external clock
- + (1<<3) // pixel clock enable - not needed ???
- + (0<<4) // high priority req - acc to spec
- + (1<<5) // high priority req
- + (0<<6) // high priority req
- // 7 reserved
- + (1<<8) // high priority req max
- + (0<<9) // high priority req max
- + (0<<10) // high priority req max
- // 11-19 reserved
- + (0<<20) // CRTC1 to DAC
- + (1<<21) // 422 mode
- + (0<<22) // 422 mode
- + (1<<23) // 422 mode
- + (0<<24) // single chroma line for 420 mode - need to be corrected
- + (0<<25) /*/ interlace mode - need to be corrected*/
- + (0<<26) // field legth polariry
- + (0<<27) // field identification polariry
- + (1<<28) // VIDRST detection mode
- + (0<<29) // VIDRST detection mode
- + (1<<30) // Horizontal counter preload
- + (1<<31) // Vertical counter preload
- ;
- cregs.c2datactl = 1 // disable dither - propably not needed, we are already in YUV mode
- + (1<<1) // Y filter enable
- + (1<<2) // CbCr filter enable
- + (1<<3) // subpicture enable (enabled)
- + (0<<4) // NTSC enable (disabled - PAL)
- + (0<<5) // C2 static subpicture enable (disabled)
- + (0<<6) // C2 subpicture offset division (disabled)
- + (0<<7) // 422 subformat selection !
- /* + (0<<8) // 15 bpp high alpha
- + (0<<9) // 15 bpp high alpha
- + (0<<10) // 15 bpp high alpha
- + (0<<11) // 15 bpp high alpha
- + (0<<12) // 15 bpp high alpha
- + (0<<13) // 15 bpp high alpha
- + (0<<14) // 15 bpp high alpha
- + (0<<15) // 15 bpp high alpha
- + (0<<16) // 15 bpp low alpha
- + (0<<17) // 15 bpp low alpha
- + (0<<18) // 15 bpp low alpha
- + (0<<19) // 15 bpp low alpha
- + (0<<20) // 15 bpp low alpha
- + (0<<21) // 15 bpp low alpha
- + (0<<22) // 15 bpp low alpha
- + (0<<23) // 15 bpp low alpha
- + (0<<24) // static subpicture key
- + (0<<25) // static subpicture key
- + (0<<26) // static subpicture key
- + (0<<27) // static subpicture key
- + (0<<28) // static subpicture key
- */ ;
- break;
-
- case IMGFMT_UYVY:
- cregs.c2ctl = 1 // CRTC2 enabled
- + (1<<1) // external clock
- + (0<<2) // external clock
- + (1<<3) // pixel clock enable - not needed ???
- + (0<<4) // high priority req
- + (1<<5) // high priority req
- + (0<<6) // high priority req
- + (1<<8) // high priority req max
- + (0<<9) // high priority req max
- + (0<<10) // high priority req max
- + (0<<20) // CRTC1 to DAC
- + (1<<21) // 422 mode
- + (0<<22) // 422 mode
- + (1<<23) // 422 mode
- + (1<<24) // single chroma line for 420 mode - need to be corrected
- + (1<<25) /*/ interlace mode - need to be corrected*/
- + (0<<26) // field legth polariry
- + (0<<27) // field identification polariry
- + (1<<28) // VIDRST detection mode
- + (0<<29) // VIDRST detection mode
- + (1<<30) // Horizontal counter preload
- + (1<<31) // Vertical counter preload
- ;
- cregs.c2datactl = 0 // enable dither - propably not needed, we are already in YUV mode
- + (1<<1) // Y filter enable
- + (1<<2) // CbCr filter enable
- + (1<<3) // subpicture enable (enabled)
- + (0<<4) // NTSC enable (disabled - PAL)
- + (0<<5) // C2 static subpicture enable (disabled)
- + (0<<6) // C2 subpicture offset division (disabled)
- + (1<<7) // 422 subformat selection !
- /* + (0<<8) // 15 bpp high alpha
- + (0<<9) // 15 bpp high alpha
- + (0<<10) // 15 bpp high alpha
- + (0<<11) // 15 bpp high alpha
- + (0<<12) // 15 bpp high alpha
- + (0<<13) // 15 bpp high alpha
- + (0<<14) // 15 bpp high alpha
- + (0<<15) // 15 bpp high alpha
- + (0<<16) // 15 bpp low alpha
- + (0<<17) // 15 bpp low alpha
- + (0<<18) // 15 bpp low alpha
- + (0<<19) // 15 bpp low alpha
- + (0<<20) // 15 bpp low alpha
- + (0<<21) // 15 bpp low alpha
- + (0<<22) // 15 bpp low alpha
- + (0<<23) // 15 bpp low alpha
- + (0<<24) // static subpicture key
- + (0<<25) // static subpicture key
- + (0<<26) // static subpicture key
- + (0<<27) // static subpicture key
- + (0<<28) // static subpicture key
- */ ;
- break;
- }
-
- cregs.c2hparam=((hdispend - 8) << 16) | (htotal - 8);
- cregs.c2hsync=((hsyncend - 8) << 16) | (hsyncstart - 8);
-
- cregs.c2misc=0 // CRTCV2 656 togg f0
- +(0<<1) // CRTCV2 656 togg f0
- +(0<<2) // CRTCV2 656 togg f0
- +(0<<4) // CRTCV2 656 togg f1
- +(0<<5) // CRTCV2 656 togg f1
- +(0<<6) // CRTCV2 656 togg f1
- +(0<<8) // Hsync active high
- +(0<<9) // Vsync active high
- // 16-27 c2vlinecomp - nevim co tam dat
- ;
- cregs.c2offset=(regs.bespitch << 1);
-
- cregs.c2pl2startadd0=regs.besa1corg;
- //cregs.c2pl2startadd1=regs.besa2corg;
- cregs.c2pl3startadd0=regs.besa1c3org;
- //cregs.c2pl3startadd1=regs.besa2c3org;
-
- cregs.c2preload=(vsyncstart << 16) | (hsyncstart); // from
-
- memset(config->dga_addr + config->offsets[config->num_frames], 0, config->frame_size); // clean spic area
- cregs.c2spicstartadd0=(uint32_t) mga_src_base + baseadrofs + config->num_frames*config->frame_size;
- //cregs.c2spicstartadd1=0; // not used
-
- cregs.c2startadd0=regs.besa1org;
- //cregs.c2startadd1=regs.besa2org;
-
- cregs.c2subpiclut=0; //not used
-
- cregs.c2vparam=((vdispend - 1) << 16) | (vtotal - 1);
- cregs.c2vsync=((vsyncend - 1) << 16) | (vsyncstart - 1);
-#endif /* CRTC2 */
-
- mga_vid_write_regs(0);
- return(0);
-}
-
-int VIDIX_NAME(vixPlaybackOn)(void)
-{
- if (mga_verbose) printf(MGA_MSG" playback on\n");
-
- vid_src_ready = 1;
- if(vid_overlay_on)
- {
- regs.besctl |= 1;
- mga_vid_write_regs(0);
- }
-#ifdef MGA_ALLOW_IRQ
- if (mga_irq != -1)
- enable_irq();
-#endif
- mga_next_frame=0;
-
- return(0);
-}
-
-int VIDIX_NAME(vixPlaybackOff)(void)
-{
- if (mga_verbose) printf(MGA_MSG" playback off\n");
-
- vid_src_ready = 0;
-#ifdef MGA_ALLOW_IRQ
- if (mga_irq != -1)
- disable_irq();
-#endif
- regs.besctl &= ~1;
- regs.besglobctl &= ~(1<<6); /* UYVY format selected */
- mga_vid_write_regs(0);
-
- return(0);
-}
-
-int VIDIX_NAME(vixProbe)(int verbose,int force)
-{
- pciinfo_t lst[MAX_PCI_DEVICES];
- unsigned int i, num_pci;
- int err;
-
- if (verbose) printf(MGA_MSG" probe\n");
-
- mga_verbose = verbose;
-
- is_g400 = -1;
-
- err = pci_scan(lst, &num_pci);
- if (err)
- {
- printf(MGA_MSG" Error occured during pci scan: %s\n", strerror(err));
- return(err);
- }
-
- if (mga_verbose)
- printf(MGA_MSG" found %d pci devices\n", num_pci);
-
- for (i = 0; i < num_pci; i++)
- {
- if (mga_verbose > 1)
- printf(MGA_MSG" pci[%d] vendor: %d device: %d\n",
- i, lst[i].vendor, lst[i].device);
- if (lst[i].vendor == VENDOR_MATROX)
- {
- switch(lst[i].device)
- {
- case DEVICE_MATROX_MGA_G550_AGP:
- printf(MGA_MSG" Found MGA G550\n");
- is_g400 = 1;
- goto card_found;
- case DEVICE_MATROX_MGA_G400_AGP:
- printf(MGA_MSG" Found MGA G400/G450\n");
- is_g400 = 1;
- goto card_found;
-#ifndef CRTC2
- case DEVICE_MATROX_MGA_G200_AGP:
- printf(MGA_MSG" Found MGA G200 AGP\n");
- is_g400 = 0;
- goto card_found;
- case DEVICE_MATROX_MGA_G200:
- printf(MGA_MSG" Found MGA G200 PCI\n");
- is_g400 = 0;
- goto card_found;
-#endif
- }
- }
- }
-
- if (is_g400 == -1)
- {
- if(verbose)
- printf(MGA_MSG" Can't find chip\n\n");
- return(ENXIO);
- }
-
-card_found:
- probed = 1;
- memcpy(&pci_info, &lst[i], sizeof(pciinfo_t));
-
- mga_cap.device_id = pci_info.device; /* set device id in capabilites */
-
- return(0);
-}
-
-int VIDIX_NAME(vixInit)(const char *args)
-{
- unsigned int card_option = 0;
- int err;
-
- /* reset Brightness & Constrast here */
- regs.beslumactl = (0x0 << 16) + 0x80;
-
- if (mga_verbose) printf(MGA_MSG" init\n");
-
- mga_vid_in_use = 0;
-
- if (!probed)
- {
- printf(MGA_MSG" driver was not probed but is being initializing\n");
- return(EINTR);
- }
-
-#ifdef MGA_PCICONFIG_MEMDETECT
- pci_config_read(pci_info.bus, pci_info.card, pci_info.func,
- 0x40, 4, &card_option);
- if (mga_verbose > 1) printf(MGA_MSG" OPTION word: 0x%08X mem: 0x%02X %s\n", card_option,
- (card_option>>10)&0x17, ((card_option>>14)&1)?"SGRAM":"SDRAM");
-#endif
-
- if (mga_ram_size)
- {
- printf(MGA_MSG" RAMSIZE forced to %d MB\n", mga_ram_size);
- }
- else
- {
-#ifdef MGA_MEMORY_SIZE
- mga_ram_size = MGA_MEMORY_SIZE;
- printf(MGA_MSG" hard-coded RAMSIZE is %d MB\n", (unsigned int) mga_ram_size);
-#else
- if (is_g400)
- {
- switch((card_option>>10)&0x17)
- {
- // SDRAM:
- case 0x00:
- case 0x04: mga_ram_size = 16; break;
- case 0x03: mga_ram_size = 32; break;
- // SGRAM:
- case 0x10:
- case 0x14: mga_ram_size = 32; break;
- case 0x11:
- case 0x12: mga_ram_size = 16; break;
- default:
- mga_ram_size = 16;
- printf(MGA_MSG" Couldn't detect RAMSIZE, assuming 16MB!\n");
- }
- }
- else
- {
- switch((card_option>>10)&0x17)
- {
- // case 0x10:
- // case 0x13: mga_ram_size = 8; break;
- default: mga_ram_size = 8;
- }
- }
-
-#if 0
- // printf("List resources -----------\n");
- for(temp=0;temp<DEVICE_COUNT_RESOURCE;temp++){
- struct resource *res=&pci_dev->resource[temp];
- if(res->flags){
- int size=(1+res->end-res->start)>>20;
- printf("res %d: start: 0x%X end: 0x%X (%d MB) flags=0x%X\n",temp,res->start,res->end,size,res->flags);
- if(res->flags&(IORESOURCE_MEM|IORESOURCE_PREFETCH)){
- if(size>mga_ram_size && size<=64) mga_ram_size=size;
- }
- }
- }
-#endif
-
- printf(MGA_MSG" detected RAMSIZE is %d MB\n", (unsigned int) mga_ram_size);
-#endif
- }
-
- if (mga_ram_size)
- {
- if ((mga_ram_size < 4) || (mga_ram_size > 64))
- {
- printf(MGA_MSG" invalid RAMSIZE: %d MB\n", mga_ram_size);
- return(EINVAL);
- }
- }
-
- if (mga_verbose > 1) printf(MGA_MSG" hardware addresses: mmio: 0x%lx, framebuffer: 0x%lx\n",
- pci_info.base1, pci_info.base0);
-
- mga_mmio_base = map_phys_mem(pci_info.base1,0x4000);
- mga_mem_base = map_phys_mem(pci_info.base0,mga_ram_size*1024*1024);
-
- if (mga_verbose > 1) printf(MGA_MSG" MMIO at %p, IRQ: %d, framebuffer: %p\n",
- mga_mmio_base, mga_irq, mga_mem_base);
- err = mtrr_set_type(pci_info.base0,mga_ram_size*1024*1024,MTRR_TYPE_WRCOMB);
- if(!err) printf(MGA_MSG" Set write-combining type of video memory\n");
-#ifdef MGA_ALLOW_IRQ
- if (mga_irq != -1)
- {
- int tmp = request_irq(mga_irq, mga_handle_irq, SA_INTERRUPT | SA_SHIRQ, "Syncfb Time Base", &mga_irq);
- if (tmp)
- {
- printf("syncfb (mga): cannot register irq %d (Err: %d)\n", mga_irq, tmp);
- mga_irq=-1;
- }
- else
- {
- printf("syncfb (mga): registered irq %d\n", mga_irq);
- }
- }
- else
- {
- printf("syncfb (mga): No valid irq was found\n");
- mga_irq=-1;
- }
-#else
- printf(MGA_MSG" IRQ support disabled\n");
- mga_irq=-1;
-#endif
-#ifdef CRTC2
- memset(&cregs_save, 0, sizeof(cregs_save));
-#endif
- return(0);
-}
-
-void VIDIX_NAME(vixDestroy)(void)
-{
- if (mga_verbose) printf(MGA_MSG" destroy\n");
-
- /* FIXME turn off BES */
- vid_src_ready = 0;
- regs.besctl &= ~1;
- regs.besglobctl &= ~(1<<6); // UYVY format selected
- // mga_config.colkey_on=0; //!!!
- mga_vid_write_regs(1);
- mga_vid_in_use = 0;
-
-#ifdef MGA_ALLOW_IRQ
- if (mga_irq != -1)
- free_irq(mga_irq, &mga_irq);
-#endif
-
- if (mga_mmio_base)
- unmap_phys_mem(mga_mmio_base, 0x4000);
- if (mga_mem_base)
- unmap_phys_mem(mga_mem_base, mga_ram_size);
- return;
-}
-
-int VIDIX_NAME(vixQueryFourcc)(vidix_fourcc_t *to)
-{
- int supports=0;
- if (mga_verbose) printf(MGA_MSG" query fourcc (%x)\n", to->fourcc);
-
- switch(to->fourcc)
- {
- case IMGFMT_YV12:
- case IMGFMT_IYUV:
- case IMGFMT_I420:
- supports = is_g400 ? 1 : 0;
- case IMGFMT_NV12:
- supports = is_g400 ? 0 : 1;
- case IMGFMT_YUY2:
- case IMGFMT_UYVY:
- supports = 1;
- break;
- default:
- supports = 0;
- }
-
- if(!supports)
- {
- to->depth = to->flags = 0;
- return(ENOTSUP);
- }
- to->depth = VID_DEPTH_12BPP |
- VID_DEPTH_15BPP | VID_DEPTH_16BPP |
- VID_DEPTH_24BPP | VID_DEPTH_32BPP;
- to->flags = VID_CAP_EXPAND | VID_CAP_SHRINK | VID_CAP_COLORKEY;
- return(0);
-}
-
-unsigned int VIDIX_NAME(vixGetVersion)(void)
-{
- return(VIDIX_VERSION);
-}
-
-int VIDIX_NAME(vixGetCapability)(vidix_capability_t *to)
-{
- memcpy(to, &mga_cap, sizeof(vidix_capability_t));
- return(0);
-}
-
-int VIDIX_NAME(vixGetGrKeys)(vidix_grkey_t *grkey)
-{
- memcpy(grkey, &mga_grkey, sizeof(vidix_grkey_t));
- return(0);
-}
-
-int VIDIX_NAME(vixSetGrKeys)(const vidix_grkey_t *grkey)
-{
- memcpy(&mga_grkey, grkey, sizeof(vidix_grkey_t));
- return(0);
-}
-
-int VIDIX_NAME(vixPlaybackSetEq)( const vidix_video_eq_t * eq)
-{
- uint32_t luma;
- float factor = 255.0 / 2000;
-
- /* contrast and brightness control isn't supported on G200 - alex */
- if (!is_g400)
- {
- if (mga_verbose) printf(MGA_MSG" equalizer isn't supported with G200\n");
- return(ENOTSUP);
- }
-
- luma = regs.beslumactl;
-
- if (eq->cap & VEQ_CAP_BRIGHTNESS)
- {
- luma &= 0xffff;
- luma |= (((int)(eq->brightness * factor) & 0xff) << 16);
- }
- if (eq->cap & VEQ_CAP_CONTRAST)
- {
- luma &= 0xffff << 16;
- luma |= ((int)((eq->contrast + 1000) * factor) & 0xff);
- }
-
- regs.beslumactl = luma;
-#ifdef BES
- writel(BESLUMACTL, regs.beslumactl);
-#endif
- return(0);
-}
-
-int VIDIX_NAME(vixPlaybackGetEq)( vidix_video_eq_t * eq)
-{
- float factor = 2000.0 / 255;
-
- /* contrast and brightness control isn't supported on G200 - alex */
- if (!is_g400)
- {
- if (mga_verbose) printf(MGA_MSG" equalizer isn't supported with G200\n");
- return(ENOTSUP);
- }
-
- // BESLUMACTL is WO only registr!
- // this will not work: regs.beslumactl = readl(BESLUMACTL);
- eq->brightness = ((signed char)((regs.beslumactl >> 16) & 0xff)) * factor;
- eq->contrast = (regs.beslumactl & 0xFF) * factor - 1000;
- eq->cap = VEQ_CAP_BRIGHTNESS | VEQ_CAP_CONTRAST;
-
- return(0);
-}
diff --git a/src/video_out/vidix/drivers/nvidia_vid.c b/src/video_out/vidix/drivers/nvidia_vid.c
deleted file mode 100644
index 34fa27cb7..000000000
--- a/src/video_out/vidix/drivers/nvidia_vid.c
+++ /dev/null
@@ -1,976 +0,0 @@
-/*
- nvidia_vid - VIDIX based video driver for NVIDIA chips
- Copyrights 2003 - 2004 Sascha Sommer. This file is based on sources from
- RIVATV (rivatv.sf.net)
- Licence: GPL
- WARNING: THIS DRIVER IS IN BETA STAGE
-
- multi buffer support and TNT2 fixes by Dmitry Baryshkov
-*/
-
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <inttypes.h>
-#include <unistd.h>
-
-
-#include "vidix.h"
-#include "fourcc.h"
-#include "libdha.h"
-#include "pci_ids.h"
-#include "pci_names.h"
-#include "bswap.h"
-
-
-pciinfo_t pci_info;
-
-
-#define MAX_FRAMES 3
-#define NV04_BES_SIZE 1024*2000*4
-
-
-static vidix_capability_t nvidia_cap = {
- "NVIDIA RIVA OVERLAY DRIVER",
- "Sascha Sommer <saschasommer@freenet.de>",
- TYPE_OUTPUT,
- { 0, 0, 0, 0 },
- 2046,
- 2046,
- 4,
- 4,
- -1,
- FLAG_UPSCALER|FLAG_DOWNSCALER,
- VENDOR_NVIDIA2,
- -1,
- { 0, 0, 0, 0 }
-};
-
-
-unsigned int vixGetVersion(void){
- return(VIDIX_VERSION);
-}
-
-
-#define NV_ARCH_03 0x03
-#define NV_ARCH_04 0x04
-#define NV_ARCH_10 0x10
-#define NV_ARCH_20 0x20
-#define NV_ARCH_30 0x30
-
-struct nvidia_cards {
- unsigned short chip_id;
- unsigned short arch;
-};
-
-static struct nvidia_cards nvidia_card_ids[] = {
- /*NV03*/
- {DEVICE_NVIDIA2_RIVA128, NV_ARCH_03},
- {DEVICE_NVIDIA2_RIVA128ZX,NV_ARCH_03},
- /*NV04*/
- {DEVICE_NVIDIA_NV4_RIVA_TNT,NV_ARCH_04},
- {DEVICE_NVIDIA_NV5_RIVA_TNT2,NV_ARCH_04},
- {DEVICE_NVIDIA_NV5_RIVA_TNT22,NV_ARCH_04},
- {DEVICE_NVIDIA_NV5_RIVA_TNT23,NV_ARCH_04},
- {DEVICE_NVIDIA_NV6_VANTA,NV_ARCH_04},
- {DEVICE_NVIDIA_NV6_VANTA2,NV_ARCH_04},
- {DEVICE_NVIDIA2_TNT,NV_ARCH_04},
- {DEVICE_NVIDIA2_TNT2,NV_ARCH_04},
- {DEVICE_NVIDIA2_VTNT2,NV_ARCH_04},
- {DEVICE_NVIDIA2_UTNT2 ,NV_ARCH_04},
- {DEVICE_NVIDIA2_ITNT2,NV_ARCH_04},
- {DEVICE_NVIDIA_NV5_ALADDIN_TNT2,NV_ARCH_30},
- /*NV10*/
- {DEVICE_NVIDIA_NV18_GEFORCE_PCX,NV_ARCH_10},
- {DEVICE_NVIDIA_NV10_GEFORCE_256,NV_ARCH_10},
- {DEVICE_NVIDIA_NV10DDR_GEFORCE_256,NV_ARCH_10},
- {DEVICE_NVIDIA_NV10GL_QUADRO,NV_ARCH_10},
- {DEVICE_NVIDIA_NV11_GEFORCE2_MX_MX,NV_ARCH_10},
- {DEVICE_NVIDIA_NV11DDR_GEFORCE2_MX,NV_ARCH_10},
- {DEVICE_NVIDIA_NV11_GEFORCE2_GO,NV_ARCH_10},
- {DEVICE_NVIDIA_NV11GL_QUADRO2_MXR_EX,NV_ARCH_10},
- {DEVICE_NVIDIA_NV15_GEFORCE2_GTS_PRO,NV_ARCH_10},
- {DEVICE_NVIDIA_NV15DDR_GEFORCE2_TI,NV_ARCH_10},
- {DEVICE_NVIDIA_NV15BR_GEFORCE2_ULTRA,NV_ARCH_10},
- {DEVICE_NVIDIA_NV15GL_QUADRO2_PRO,NV_ARCH_10},
- {DEVICE_NVIDIA_NV17_GEFORCE4_MX,NV_ARCH_10},
- {DEVICE_NVIDIA_NV17_GEFORCE4_MX2,NV_ARCH_10},
- {DEVICE_NVIDIA_NV17_GEFORCE4_MX3,NV_ARCH_10},
- {DEVICE_NVIDIA_NV17_GEFORCE4_MX4,NV_ARCH_10},
- {DEVICE_NVIDIA_NV17_GEFORCE4_440,NV_ARCH_10},
- {DEVICE_NVIDIA_NV17_GEFORCE4_420,NV_ARCH_10},
- {DEVICE_NVIDIA_NV17_GEFORCE4_4202,NV_ARCH_10},
- {DEVICE_NVIDIA_NV17GL_QUADRO4_550,NV_ARCH_10},
- {DEVICE_NVIDIA_NV17_GEFORCE4_4402,NV_ARCH_10},
- {DEVICE_NVIDIA_NV17GL_QUADRO4_200_400,NV_ARCH_10},
- {DEVICE_NVIDIA_NV17GL_QUADRO4_5502,NV_ARCH_10},
- {DEVICE_NVIDIA_NV17GL_QUADRO4_5503,NV_ARCH_10},
- {DEVICE_NVIDIA_NV17_GEFORCE4_410,NV_ARCH_10},
- {DEVICE_NVIDIA_NV18_GEFORCE4_MX,NV_ARCH_10},
- {DEVICE_NVIDIA_NV18_GEFORCE4_MX2,NV_ARCH_10},
- {DEVICE_NVIDIA_NV18_GEFORCE4_MX3,NV_ARCH_10},
- {DEVICE_NVIDIA_NV18_GEFORCE4_MX4,NV_ARCH_10},
- {DEVICE_NVIDIA_NV18M_GEFORCE4_448,NV_ARCH_10},
- {DEVICE_NVIDIA_NV18M_GEFORCE4_488,NV_ARCH_10},
- {DEVICE_NVIDIA_NV18GL_QUADRO4_580,NV_ARCH_10},
- {DEVICE_NVIDIA_NV18GL_QUADRO4_NVS,NV_ARCH_10},
- {DEVICE_NVIDIA_NV18GL_QUADRO4_380,NV_ARCH_10},
- {DEVICE_NVIDIA_NV18M_GEFORCE4_4482,NV_ARCH_10},
- {DEVICE_NVIDIA_NVCRUSH11_GEFORCE2_MX,NV_ARCH_10},
- {DEVICE_NVIDIA_NFORCE2_AGP_DIFFERENT,NV_ARCH_10},
- {DEVICE_NVIDIA_NFORCE2_AGP,NV_ARCH_10},
- {DEVICE_NVIDIA_NV18_GEFORCE4_MX5,NV_ARCH_10},
- /*NV20*/
- {DEVICE_NVIDIA_NV20_GEFORCE3,NV_ARCH_20},
- {DEVICE_NVIDIA_NV20_GEFORCE3_TI,NV_ARCH_20},
- {DEVICE_NVIDIA_NV20_GEFORCE3_TI2,NV_ARCH_20},
- {DEVICE_NVIDIA_NV20DCC_QUADRO_DCC,NV_ARCH_20},
- {DEVICE_NVIDIA_NV25_GEFORCE4_TI,NV_ARCH_20},
- {DEVICE_NVIDIA_NV25_GEFORCE4_TI2,NV_ARCH_20},
- {DEVICE_NVIDIA_NV25_GEFORCE4_TI3,NV_ARCH_20},
- {DEVICE_NVIDIA_NV25_GEFORCE4_TI4,NV_ARCH_20},
- {DEVICE_NVIDIA_NV25GL_QUADRO4_900,NV_ARCH_20},
- {DEVICE_NVIDIA_NV25GL_QUADRO4_750,NV_ARCH_20},
- {DEVICE_NVIDIA_NV25GL_QUADRO4_700,NV_ARCH_20},
- {DEVICE_NVIDIA_NV28_GEFORCE4_TI,NV_ARCH_20},
- {DEVICE_NVIDIA_NV28_GEFORCE4_TI2,NV_ARCH_20},
- {DEVICE_NVIDIA_NV28_GEFORCE4_TI3,NV_ARCH_20},
- {DEVICE_NVIDIA_NV28_GEFORCE4_TI4,NV_ARCH_20},
- {DEVICE_NVIDIA_NV28GL_QUADRO4_980,NV_ARCH_20},
- {DEVICE_NVIDIA_NV28GL_QUADRO4_780,NV_ARCH_20},
- {DEVICE_NVIDIA_NV28GLM_QUADRO4_700,NV_ARCH_20},
- /*NV30*/
- {DEVICE_NVIDIA_NV30_GEFORCE_FX,NV_ARCH_30},
- {DEVICE_NVIDIA_NV30_GEFORCE_FX2,NV_ARCH_30},
- {DEVICE_NVIDIA_NV30_GEFORCE_FX3,NV_ARCH_30},
- {DEVICE_NVIDIA_NV30GL_QUADRO_FX,NV_ARCH_30},
- {DEVICE_NVIDIA_NV30GL_QUADRO_FX2,NV_ARCH_30},
- {DEVICE_NVIDIA_NV31_GEFORCE_FX,NV_ARCH_30},
- {DEVICE_NVIDIA_NV31_GEFORCE_FX2,NV_ARCH_30},
- {DEVICE_NVIDIA_NV31,NV_ARCH_30},
- {DEVICE_NVIDIA_NV31_GEFORCE_FX3,NV_ARCH_30},
- {DEVICE_NVIDIA_NV312,NV_ARCH_30},
- {DEVICE_NVIDIA_NV313,NV_ARCH_30},
- {DEVICE_NVIDIA_NV31M_GEFORCE_FX,NV_ARCH_30},
- {DEVICE_NVIDIA_NV31M_GEFORCE_FX2,NV_ARCH_30},
- {DEVICE_NVIDIA_NVIDIA_QUADRO_FX,NV_ARCH_30},
- {DEVICE_NVIDIA_NV314,NV_ARCH_30},
- {DEVICE_NVIDIA_NV315,NV_ARCH_30},
- {DEVICE_NVIDIA_NV316,NV_ARCH_30},
- {DEVICE_NVIDIA_NV34_GEFORCE_FX,NV_ARCH_30},
- {DEVICE_NVIDIA_NV34_GEFORCE_FX2,NV_ARCH_30},
- {DEVICE_NVIDIA_NV34_GEFORCE_FX3,NV_ARCH_30},
- {DEVICE_NVIDIA_NV34_GEFORCE_FX4,NV_ARCH_30},
- {DEVICE_NVIDIA_NV34M_GEFORCE_FX,NV_ARCH_30},
- {DEVICE_NVIDIA_NV34M_GEFORCE_FX2,NV_ARCH_30},
- {DEVICE_NVIDIA_NV34_GEFORCE_FX5,NV_ARCH_30},
- {DEVICE_NVIDIA_NV34_GEFORCE_FX6,NV_ARCH_30},
- {DEVICE_NVIDIA_NV34M_GEFORCE_FX3,NV_ARCH_30},
- {DEVICE_NVIDIA_NV34M_GEFORCE_FX4,NV_ARCH_30},
- {DEVICE_NVIDIA_NV34GL_QUADRO_NVS,NV_ARCH_30},
- {DEVICE_NVIDIA_NV34GL_QUADRO_FX,NV_ARCH_30},
- {DEVICE_NVIDIA_NV34GLM_GEFORCE_FX,NV_ARCH_30},
- {DEVICE_NVIDIA_NV34_GEFORCE_FX7,NV_ARCH_30},
- {DEVICE_NVIDIA_NV34,NV_ARCH_30},
- {DEVICE_NVIDIA_NV35_GEFORCE_FX,NV_ARCH_30},
- {DEVICE_NVIDIA_NV35_GEFORCE_FX2,NV_ARCH_30},
- {DEVICE_NVIDIA_NV35_GEFORCE_FX3,NV_ARCH_30},
- {DEVICE_NVIDIA_NV38_GEFORCE_FX,NV_ARCH_30},
- {DEVICE_NVIDIA_NV35_GEFORCE_FX4,NV_ARCH_30},
- {DEVICE_NVIDIA_NV35GL_QUADRO_FX,NV_ARCH_30},
- {DEVICE_NVIDIA_NV35GL_QUADRO_FX2,NV_ARCH_30},
- {DEVICE_NVIDIA_NV36_1_GEFORCE_FX,NV_ARCH_30},
- {DEVICE_NVIDIA_NV36_2_GEFORCE_FX,NV_ARCH_30},
- {DEVICE_NVIDIA_NV36_GEFORCE_FX,NV_ARCH_30},
- {DEVICE_NVIDIA_NV36_4_GEFORCE_FX,NV_ARCH_30},
- {DEVICE_NVIDIA_NV36_5,NV_ARCH_30},
- {DEVICE_NVIDIA_NV36_GEFORCE_FX2,NV_ARCH_30},
- {DEVICE_NVIDIA_NV36_GEFORCE_FX3,NV_ARCH_30},
- {DEVICE_NVIDIA_NV36,NV_ARCH_30},
- {DEVICE_NVIDIA_NV362,NV_ARCH_30},
- {DEVICE_NVIDIA_NV36_QUADRO_FX,NV_ARCH_30},
- {DEVICE_NVIDIA_NV36GL_QUADRO_FX,NV_ARCH_30},
- {DEVICE_NVIDIA_NV36GL,NV_ARCH_30},
- {DEVICE_NVIDIA_NV36_GEFORCE_PCX,NV_ARCH_30},
- {DEVICE_NVIDIA_NV35_GEFORCE_PCX,NV_ARCH_30},
- {DEVICE_NVIDIA_NV37GL_QUADRO_FX,NV_ARCH_30},
- {DEVICE_NVIDIA_NV37GL_QUADRO_FX2,NV_ARCH_30},
- {DEVICE_NVIDIA_NV38GL_QUADRO_FX,NV_ARCH_30},
- /* FIXME are they different? */
- {DEVICE_NVIDIA_NV40_GEFORCE_6800,NV_ARCH_30},
- {DEVICE_NVIDIA_NV40_GEFORCE_68002,NV_ARCH_30},
- {DEVICE_NVIDIA_NV40_2,NV_ARCH_30},
- {DEVICE_NVIDIA_NV40_3,NV_ARCH_30},
- {DEVICE_NVIDIA_NV40_GEFORCE_68003,NV_ARCH_30},
- {DEVICE_NVIDIA_NV40GL,NV_ARCH_30},
- {DEVICE_NVIDIA_NV40GL_QUADRO_FX,NV_ARCH_30},
- {DEVICE_NVIDIA_NV41_0,NV_ARCH_30},
- {DEVICE_NVIDIA_NV41_1,NV_ARCH_30},
- {DEVICE_NVIDIA_NV41_2,NV_ARCH_30},
- {DEVICE_NVIDIA_NV41_8,NV_ARCH_30},
- {DEVICE_NVIDIA_NV41GL,NV_ARCH_30},
- {DEVICE_NVIDIA_NV40_GEFORCE_6800_GEFORCE,NV_ARCH_30},
- {DEVICE_NVIDIA_NV43_GEFORCE_6600_GEFORCE,NV_ARCH_30},
- {DEVICE_NVIDIA_NV43_GEFORCE_6600,NV_ARCH_30},
- {DEVICE_NVIDIA_NV45GL_QUADRO_FX,NV_ARCH_30},
- {DEVICE_NVIDIA_NV40_GEFORCE_68004,NV_ARCH_30}
-};
-
-
-static int find_chip(unsigned chip_id){
- unsigned i;
- for(i = 0;i < sizeof(nvidia_card_ids)/sizeof(struct nvidia_cards);i++)
- {
- if(chip_id == nvidia_card_ids[i].chip_id)return i;
- }
- return -1;
-}
-
-int vixProbe(int verbose, int force){
- pciinfo_t lst[MAX_PCI_DEVICES];
- unsigned i,num_pci;
- int err;
-
- if (force)
- printf("[nvidia_vid]: warning: forcing not supported yet!\n");
- err = pci_scan(lst,&num_pci);
- if(err){
- printf("[nvidia_vid] Error occurred during pci scan: %s\n",strerror(err));
- return err;
- }
- else {
- err = ENXIO;
- for(i=0; i < num_pci; i++){
- if(lst[i].vendor == VENDOR_NVIDIA2 || lst[i].vendor == VENDOR_NVIDIA){
- int idx;
- const char *dname;
- idx = find_chip(lst[i].device);
- if(idx == -1)
- continue;
- dname = pci_device_name(lst[i].vendor, lst[i].device);
- dname = dname ? dname : "Unknown chip";
- printf("[nvidia_vid] Found chip: %s\n", dname);
- nvidia_cap.device_id = lst[i].device;
- err = 0;
- memcpy(&pci_info, &lst[i], sizeof(pciinfo_t));
- break;
- }
- }
- }
- if(err && verbose) printf("[nvidia_vid] Can't find chip\n");
- return err;
-}
-
-
-
-
-/*
- * PCI-Memory IO access macros.
- */
-#define VID_WR08(p,i,val) (((uint8_t *)(p))[(i)]=(val))
-#define VID_RD08(p,i) (((uint8_t *)(p))[(i)])
-
-#define VID_WR32(p,i,val) (((uint32_t *)(p))[(i)/4]=(val))
-#define VID_RD32(p,i) (((uint32_t *)(p))[(i)/4])
-
-#ifndef USE_RMW_CYCLES
-/*
- * Can be used to inhibit READ-MODIFY-WRITE cycles. On by default.
- */
-
-#define MEM_BARRIER() __asm__ __volatile__ ("" : : : "memory")
-
-#undef VID_WR08
-#define VID_WR08(p,i,val) ({ MEM_BARRIER(); ((uint8_t *)(p))[(i)]=(val); })
-#undef VID_RD08
-#define VID_RD08(p,i) ({ MEM_BARRIER(); ((uint8_t *)(p))[(i)]; })
-
-#undef VID_WR32
-#define VID_WR32(p,i,val) ({ MEM_BARRIER(); ((uint32_t *)(p))[(i)/4]=(val); })
-#undef VID_RD32
-#define VID_RD32(p,i) ({ MEM_BARRIER(); ((uint32_t *)(p))[(i)/4]; })
-#endif /* USE_RMW_CYCLES */
-
-#define VID_AND32(p,i,val) VID_WR32(p,i,VID_RD32(p,i)&(val))
-#define VID_OR32(p,i,val) VID_WR32(p,i,VID_RD32(p,i)|(val))
-#define VID_XOR32(p,i,val) VID_WR32(p,i,VID_RD32(p,i)^(val))
-
-
-
-
-
-
-struct rivatv_chip {
- volatile uint32_t *PMC; /* general control */
- volatile uint32_t *PME; /* multimedia port */
- volatile uint32_t *PFB; /* framebuffer control */
- volatile uint32_t *PVIDEO; /* overlay control */
- volatile uint8_t *PCIO; /* SVGA (CRTC, ATTR) registers */
- volatile uint8_t *PVIO; /* SVGA (MISC, GRAPH, SEQ) registers */
- volatile uint32_t *PRAMIN; /* instance memory */
- volatile uint32_t *PRAMHT; /* hash table */
- volatile uint32_t *PRAMFC; /* fifo context table */
- volatile uint32_t *PRAMRO; /* fifo runout table */
- volatile uint32_t *PFIFO; /* fifo control region */
- volatile uint32_t *FIFO; /* fifo channels (USER) */
- volatile uint32_t *PGRAPH; /* graphics engine */
-
- unsigned long fbsize; /* framebuffer size */
- int arch; /* compatible NV_ARCH_XX define */
- int realarch; /* real architecture */
- void (* lock) (struct rivatv_chip *, int);
-};
-typedef struct rivatv_chip rivatv_chip;
-
-
-struct rivatv_info {
- unsigned int use_colorkey;
- unsigned int colorkey; /* saved xv colorkey*/
- unsigned int vidixcolorkey; /*currently used colorkey*/
- unsigned int depth;
- unsigned int format;
- unsigned int pitch;
- unsigned int width,height;
- unsigned int d_width,d_height; /*scaled width && height*/
- unsigned int wx,wy; /*window x && y*/
- unsigned int screen_x; /*screen width*/
- unsigned int screen_y; /*screen height*/
- unsigned long buffer_size; /* size of the image buffer */
- struct rivatv_chip chip; /* NV architecture structure */
- void* video_base; /* virtual address of control region */
- void* control_base; /* virtual address of fb region */
- unsigned long picture_base; /* direct pointer to video picture */
- unsigned long picture_offset; /* offset of video picture in frame buffer */
-// struct rivatv_dma dma; /* DMA structure */
- unsigned int cur_frame;
- unsigned int num_frames; /* number of buffers */
- int bps; /* bytes per line */
-};
-typedef struct rivatv_info rivatv_info;
-
-//framebuffer size funcs
-static unsigned long rivatv_fbsize_nv03 (struct rivatv_chip *chip){
- if (VID_RD32 (chip->PFB, 0) & 0x00000020) {
- if (((VID_RD32 (chip->PMC, 0) & 0xF0) == 0x20)
- && ((VID_RD32 (chip->PMC, 0) & 0x0F) >= 0x02)) {
- /* SDRAM 128 ZX. */
- return ((1 << (VID_RD32 (chip->PFB, 0) & 0x03)) * 1024 * 1024);
- }
- else {
- return 1024 * 1024 * 8;
- }
- }
- else {
- /* SGRAM 128. */
- switch (chip->PFB[0x00000000] & 0x00000003) {
- case 0:
- return 1024 * 1024 * 8;
- break;
- case 2:
- return 1024 * 1024 * 4;
- break;
- default:
- return 1024 * 1024 * 2;
- break;
- }
- }
-}
-static unsigned long rivatv_fbsize_nv04 (struct rivatv_chip *chip){
- if (VID_RD32 (chip->PFB, 0) & 0x00000100) {
- return ((VID_RD32 (chip->PFB, 0) >> 12) & 0x0F) * 1024 * 1024 * 2
- + 1024 * 1024 * 2;
- } else {
- switch (VID_RD32 (chip->PFB, 0) & 0x00000003) {
- case 0:
- return 1024 * 1024 * 32;
- break;
- case 1:
- return 1024 * 1024 * 4;
- break;
- case 2:
- return 1024 * 1024 * 8;
- break;
- case 3:
- default:
- return 1024 * 1024 * 16;
- break;
- }
- }
-}
-
-static unsigned long rivatv_fbsize_nv10 (struct rivatv_chip *chip){
- return ((VID_RD32 (chip->PFB, 0x20C) >> 20) & 0x000000FF) * 1024 * 1024;
-}
-
-//lock funcs
-static void rivatv_lock_nv03 (struct rivatv_chip *chip, int LockUnlock){
- VID_WR08 (chip->PVIO, 0x3C4, 0x06);
- VID_WR08 (chip->PVIO, 0x3C5, LockUnlock ? 0x99 : 0x57);
-}
-
-static void rivatv_lock_nv04 (struct rivatv_chip *chip, int LockUnlock){
- VID_WR08 (chip->PCIO, 0x3C4, 0x06);
- VID_WR08 (chip->PCIO, 0x3C5, LockUnlock ? 0x99 : 0x57);
- VID_WR08 (chip->PCIO, 0x3D4, 0x1F);
- VID_WR08 (chip->PCIO, 0x3D5, LockUnlock ? 0x99 : 0x57);
-}
-
-
-
-
-/* Enable PFB (Framebuffer), PVIDEO (Overlay unit) and PME (Mediaport) if neccessary. */
-static void rivatv_enable_PMEDIA (struct rivatv_info *info){
- uint32_t reg;
-
- /* switch off interrupts once for a while */
-// VID_WR32 (info->chip.PME, 0x200140, 0x00);
-// VID_WR32 (info->chip.PMC, 0x000140, 0x00);
-
- reg = VID_RD32 (info->chip.PMC, 0x000200);
-
- /* NV3 (0x10100010): NV03_PMC_ENABLE_PMEDIA, NV03_PMC_ENABLE_PFB, NV03_PMC_ENABLE_PVIDEO */
-
- if ((reg & 0x10100010) != 0x10100010) {
- printf("PVIDEO and PFB disabled, enabling...\n");
- VID_OR32 (info->chip.PMC, 0x000200, 0x10100010);
- }
-
- /* save the current colorkey */
- switch (info->chip.arch ) {
- case NV_ARCH_10:
- case NV_ARCH_20:
- case NV_ARCH_30:
- /* NV_PVIDEO_COLOR_KEY */
- info->colorkey = VID_RD32 (info->chip.PVIDEO, 0xB00);
- break;
- case NV_ARCH_03:
- case NV_ARCH_04:
- /* NV_PVIDEO_KEY */
- info->colorkey = VID_RD32 (info->chip.PVIDEO, 0x240);
- break;
- }
-
-
- /* re-enable interrupts again */
-// VID_WR32 (info->chip.PMC, 0x000140, 0x01);
-// VID_WR32 (info->chip.PME, 0x200140, 0x01);
-}
-
-/* Stop overlay video. */
-static void rivatv_overlay_stop (struct rivatv_info *info) {
- switch (info->chip.arch ) {
- case NV_ARCH_10:
- case NV_ARCH_20:
- case NV_ARCH_30:
- /* NV_PVIDEO_COLOR_KEY */
- /* Xv-Extension-Hack: Restore previously saved value. */
- VID_WR32 (info->chip.PVIDEO, 0xB00, info->colorkey);
- /* NV_PVIDEO_STOP */
- VID_OR32 (info->chip.PVIDEO, 0x704, 0x11);
- /* NV_PVIDEO_BUFFER */
- VID_AND32 (info->chip.PVIDEO, 0x700, ~0x11);
- /* NV_PVIDEO_INTR_EN_BUFFER */
-// VID_AND32 (info->chip.PVIDEO, 0x140, ~0x11);
- break;
- case NV_ARCH_03:
- case NV_ARCH_04:
- /* NV_PVIDEO_KEY */
- VID_WR32 (info->chip.PVIDEO, 0x240, info->colorkey);
- /* NV_PVIDEO_OVERLAY_VIDEO_OFF */
- VID_AND32 (info->chip.PVIDEO, 0x244, ~0x01);
- /* NV_PVIDEO_INTR_EN_0_NOTIFY */
-// VID_AND32 (info->chip.PVIDEO, 0x140, ~0x01);
- /* NV_PVIDEO_OE_STATE */
- VID_WR32 (info->chip.PVIDEO, 0x224, 0);
- /* NV_PVIDEO_SU_STATE */
- VID_WR32 (info->chip.PVIDEO, 0x228, 0);
- /* NV_PVIDEO_RM_STATE */
- VID_WR32 (info->chip.PVIDEO, 0x22C, 0);
- break;
- }
-}
-
-/* Get pan offset of the physical screen. */
-static uint32_t rivatv_overlay_pan (struct rivatv_info *info){
- uint32_t pan;
- info->chip.lock (&info->chip, 0);
- VID_WR08 (info->chip.PCIO, 0x3D4, 0x0D);
- pan = VID_RD08 (info->chip.PCIO, 0x3D5);
- VID_WR08 (info->chip.PCIO, 0x3D4, 0x0C);
- pan |= VID_RD08 (info->chip.PCIO, 0x3D5) << 8;
- VID_WR08 (info->chip.PCIO, 0x3D4, 0x19);
- pan |= (VID_RD08 (info->chip.PCIO, 0x3D5) & 0x1F) << 16;
- VID_WR08 (info->chip.PCIO, 0x3D4, 0x2D);
- pan |= (VID_RD08 (info->chip.PCIO, 0x3D5) & 0x60) << 16;
- return pan << 2;
-}
-
-/* Compute and set colorkey depending on the colour depth. */
-static void rivatv_overlay_colorkey (rivatv_info* info, unsigned int chromakey){
- uint32_t r, g, b, key = 0;
-
- r = (chromakey & 0x00FF0000) >> 16;
- g = (chromakey & 0x0000FF00) >> 8;
- b = chromakey & 0x000000FF;
- switch (info->depth) {
- case 15:
- key = ((r >> 3) << 10) | ((g >> 3) << 5) | ((b >> 3));
-#ifndef WIN32
- key = key | 0x00008000;
-#endif
- break;
- case 16: // XXX unchecked
- key = ((r >> 3) << 11) | ((g >> 2) << 5) | ((b >> 3));
-#ifndef WIN32
- key = key | 0x00008000;
-#endif
- break;
- case 24: // XXX unchecked, maybe swap order of masking - FIXME Can the card be in 24 bit mode anyway?
- key = (chromakey & 0x00FFFFFF) | 0x00800000;
- break;
- case 32:
- key = chromakey;
-#ifndef WIN32
- key = key | 0x80000000;
-#endif
- break;
- }
- //printf("[nvidia_vid] depth=%d %08X \n", info->depth, chromakey);
- switch (info->chip.arch) {
- case NV_ARCH_10:
- case NV_ARCH_20:
- case NV_ARCH_30:
- VID_WR32 (info->chip.PVIDEO, 0xB00, key);
- break;
- case NV_ARCH_03:
- case NV_ARCH_04:
- VID_WR32 (info->chip.PVIDEO, 0x240, key);
- break;
- }
-}
-
-static void nv_getscreenproperties(struct rivatv_info *info){
- uint32_t bpp=0;
- info->chip.lock(&info->chip, 0);
- /*get screen depth*/
- VID_WR08(info->chip.PCIO, 0x03D4,0x28);
- bpp = VID_RD08(info->chip.PCIO,0x03D5)&0x3;
- if(bpp==3)bpp=4;
- if((bpp == 2) && (info->chip.PVIDEO[0x00000600/4] & 0x00001000) == 0x0)info->depth=15;
- else info->depth = bpp*8;
- /*get screen width*/
- VID_WR08(info->chip.PCIO, 0x03D4, 0x1);
- info->screen_x = (1 + VID_RD08(info->chip.PCIO, 0x3D5)) * 8;
- /*get screen height*/
- /* get first 8 bits in VT_DISPLAY_END*/
- VID_WR08(info->chip.PCIO, 0x03D4, 0x12);
- info->screen_y = VID_RD08(info->chip.PCIO,0x03D5);
- VID_WR08(info->chip.PCIO,0x03D4,0x07);
- /* get 9th bit in CRTC_OVERFLOW*/
- info->screen_y |= (VID_RD08(info->chip.PCIO,0x03D5) &0x02)<<7;
- /* and the 10th in CRTC_OVERFLOW*/
- info->screen_y |=(VID_RD08(info->chip.PCIO,0x03D5) &0x40)<<3;
- ++info->screen_y;
-}
-
-
-
-
-/* Start overlay video. */
-static void rivatv_overlay_start (struct rivatv_info *info,int bufno){
- uint32_t base, size, offset, xscale, yscale, pan;
- uint32_t value;
- int x=info->wx?info->wx:8, y=info->wy?info->wy:8;
- int lwidth=info->d_width, lheight=info->d_height;
- int bps;
- int i;
-
- size = info->buffer_size;
- base = info->picture_offset;
- offset = bufno*size;
- /*update depth & dimensions here because it may change with vo vesa or vo fbdev*/
- nv_getscreenproperties(info);
-
- if(info->depth){
-// bps = info->screen_x * ((info->depth+1)/8);
- /* get pan offset of the physical screen */
- pan = rivatv_overlay_pan (info);
- /* adjust window position depending on the pan offset */
- bps = 0;
- info->chip.lock (&info->chip, 0);
- for (i = 0; (i < 1024) && (bps == 0); i++)
- {
- if (info->chip.arch != NV_ARCH_03)
- bps = info->chip.PGRAPH[0x00000670/4];
- else
- bps = info->chip.PGRAPH[0x00000650/4];
- }
- if (bps == 0)
- {
- fprintf(stderr, "[nvidia_vid] reading bps returned 0!!!\n");
- if (info->bps != 0)
- bps = info->bps;
- }
- else
- {
- info->bps = bps;
- }
-
- if (bps != 0)
- {
- x = info->wx - (pan % bps) * 8 / info->depth;
- y = info->wy - (pan / bps);
- }
- }
-
- /* adjust negative output window variables */
- if (x < 0) {
- lwidth = info->d_width + x;
- offset += (-x * info->width / info->d_width) << 1;
-// offset += (-window->x * port->vld_width / window->width) << 1;
- x = 0;
- }
- if (y < 0) {
- lheight = info->d_height + y;
- offset += (-y * info->height / info->d_height * info->width) << 1;
-// offset += (-window->y * port->vld_height / window->height * port->org_width) << 1;
- y = 0;
- }
-
- switch (info->chip.arch) {
- case NV_ARCH_10:
- case NV_ARCH_20:
- case NV_ARCH_30:
-
- /* NV_PVIDEO_BASE */
- VID_WR32 (info->chip.PVIDEO, 0x900 + 0, base + offset);
- //VID_WR32 (info->chip.PVIDEO, 0x900 + 4, base);
- /* NV_PVIDEO_LIMIT */
- VID_WR32 (info->chip.PVIDEO, 0x908 + 0, base + offset + size - 1);
- //VID_WR32 (info->chip.PVIDEO, 0x908 + 4, base + size - 1);
-
- /* extra code for NV20 && NV30 architectures */
- if (info->chip.arch == NV_ARCH_20 || info->chip.arch == NV_ARCH_30) {
- VID_WR32 (info->chip.PVIDEO, 0x800 + 0, base + offset);
- //VID_WR32 (info->chip.PVIDEO, 0x800 + 4, base);
- VID_WR32 (info->chip.PVIDEO, 0x808 + 0, base + offset + size - 1);
- //VID_WR32 (info->chip.PVIDEO, 0x808 + 4, base + size - 1);
- }
-
- /* NV_PVIDEO_LUMINANCE */
- VID_WR32 (info->chip.PVIDEO, 0x910 + 0, 0x00001000);
- //VID_WR32 (info->chip.PVIDEO, 0x910 + 4, 0x00001000);
- /* NV_PVIDEO_CHROMINANCE */
- VID_WR32 (info->chip.PVIDEO, 0x918 + 0, 0x00001000);
- //VID_WR32 (info->chip.PVIDEO, 0x918 + 4, 0x00001000);
-
- /* NV_PVIDEO_OFFSET */
- VID_WR32 (info->chip.PVIDEO, 0x920 + 0, 0x0);
- //VID_WR32 (info->chip.PVIDEO, 0x920 + 4, offset + pitch);
- /* NV_PVIDEO_SIZE_IN */
- VID_WR32 (info->chip.PVIDEO, 0x928 + 0, ((info->height) << 16) | info->width);
- //VID_WR32 (info->chip.PVIDEO, 0x928 + 4, ((port->org_height/2) << 16) | port->org_width);
- /* NV_PVIDEO_POINT_IN */
- VID_WR32 (info->chip.PVIDEO, 0x930 + 0, 0x00000000);
- //VID_WR32 (info->chip.PVIDEO, 0x930 + 4, 0x00000000);
- /* NV_PVIDEO_DS_DX_RATIO */
- VID_WR32 (info->chip.PVIDEO, 0x938 + 0, (info->width << 20) / info->d_width);
- //VID_WR32 (info->chip.PVIDEO, 0x938 + 4, (port->org_width << 20) / window->width);
- /* NV_PVIDEO_DT_DY_RATIO */
- VID_WR32 (info->chip.PVIDEO, 0x940 + 0, ((info->height) << 20) / info->d_height);
- //VID_WR32 (info->chip.PVIDEO, 0x940 + 4, ((port->org_height/2) << 20) / window->height);
-
- /* NV_PVIDEO_POINT_OUT */
- VID_WR32 (info->chip.PVIDEO, 0x948 + 0, ((y + 0) << 16) | x);
- //VID_WR32 (info->chip.PVIDEO, 0x948 + 4, ((y + 0) << 16) | x);
- /* NV_PVIDEO_SIZE_OUT */
- VID_WR32 (info->chip.PVIDEO, 0x950 + 0, (lheight << 16) | lwidth);
- //VID_WR32 (info->chip.PVIDEO, 0x950 + 4, (height << 16) | width);
-
- /* NV_PVIDEO_FORMAT */
- value = info->pitch;
- if(info->use_colorkey)value |= 1 << 20;
- if(info->format == IMGFMT_YUY2)value |= 1 << 16;
- VID_WR32 (info->chip.PVIDEO, 0x958 + 0, value);
- //VID_WR32 (info->chip.PVIDEO, 0x958 + 4, (pitch << 1) | 0x00100000);
-
- /* NV_PVIDEO_INTR_EN_BUFFER */
-// VID_OR32 (info->chip.PVIDEO, 0x140, 0x01/*0x11*/);
- /* NV_PVIDEO_STOP */
- VID_WR32 (info->chip.PVIDEO, 0x704,0x0);
- /* NV_PVIDEO_BUFFER */
- VID_WR32 (info->chip.PVIDEO, 0x700, 0x01/*0x11*/);
- break;
-
- case NV_ARCH_03:
- case NV_ARCH_04:
-
-
- /* NV_PVIDEO_OE_STATE */
- VID_WR32 (info->chip.PVIDEO, 0x224, 0);
- /* NV_PVIDEO_SU_STATE */
- VID_WR32 (info->chip.PVIDEO, 0x228, 0);
- /* NV_PVIDEO_RM_STATE */
- VID_WR32 (info->chip.PVIDEO, 0x22C, 0);
-
- /* NV_PVIDEO_BUFF0_START_ADDRESS */
- VID_WR32 (info->chip.PVIDEO, 0x20C + 0, base + offset + 0);
- VID_WR32 (info->chip.PVIDEO, 0x20C + 4, base + offset + 0);
- /* NV_PVIDEO_BUFF0_PITCH_LENGTH */
- VID_WR32 (info->chip.PVIDEO, 0x214 + 0, info->pitch);
- VID_WR32 (info->chip.PVIDEO, 0x214 + 4, info->pitch);
-
- /* NV_PVIDEO_WINDOW_START */
- VID_WR32 (info->chip.PVIDEO, 0x230, (y << 16) | x);
- /* NV_PVIDEO_WINDOW_SIZE */
- VID_WR32 (info->chip.PVIDEO, 0x234, (lheight << 16) | lwidth);
- /* NV_PVIDEO_STEP_SIZE */
- yscale = ((info->height - 1) << 11) / (info->d_height - 1);
- xscale = ((info->width - 1) << 11) / (info->d_width - 1);
- VID_WR32 (info->chip.PVIDEO, 0x200, (yscale << 16) | xscale);
-
- /* NV_PVIDEO_RED_CSC_OFFSET */
- VID_WR32 (info->chip.PVIDEO, 0x280, 0x69);
- /* NV_PVIDEO_GREEN_CSC_OFFSET */
- VID_WR32 (info->chip.PVIDEO, 0x284, 0x3e);
- /* NV_PVIDEO_BLUE_CSC_OFFSET */
- VID_WR32 (info->chip.PVIDEO, 0x288, 0x89);
- /* NV_PVIDEO_CSC_ADJUST */
- VID_WR32 (info->chip.PVIDEO, 0x28C, 0x00000); /* No colour correction! */
-
- /* NV_PVIDEO_CONTROL_Y (BLUR_ON, LINE_HALF) */
- VID_WR32 (info->chip.PVIDEO, 0x204, 0x001);
- /* NV_PVIDEO_CONTROL_X (WEIGHT_HEAVY, SHARPENING_ON, SMOOTHING_ON) */
- VID_WR32 (info->chip.PVIDEO, 0x208, 0x111); /*directx overlay 0x110 */
-
- /* NV_PVIDEO_FIFO_BURST_LENGTH */
- VID_WR32 (info->chip.PVIDEO, 0x23C, 0x03);
- /* NV_PVIDEO_FIFO_THRES_SIZE */
- VID_WR32 (info->chip.PVIDEO, 0x238, 0x38); /*windows uses 0x40*/
-
- /* NV_PVIDEO_BUFF0_OFFSET */
- VID_WR32 (info->chip.PVIDEO, 0x21C + 0, 0);
- VID_WR32 (info->chip.PVIDEO, 0x21C + 4, 0);
-
- /* NV_PVIDEO_INTR_EN_0_NOTIFY_ENABLED */
-// VID_OR32 (info->chip.PVIDEO, 0x140, 0x01);
-
- /* NV_PVIDEO_OVERLAY (KEY_ON, VIDEO_ON, FORMAT_CCIR) */
- value = 0x1; /*video on*/
- if(info->format==IMGFMT_YUY2)value |= 0x100;
- if(info->use_colorkey)value |=0x10;
- VID_WR32 (info->chip.PVIDEO, 0x244, value);
-
- /* NV_PVIDEO_SU_STATE */
- VID_XOR32 (info->chip.PVIDEO, 0x228, 1 << 16);
- break;
- }
- /*set colorkey*/
- rivatv_overlay_colorkey(info,info->vidixcolorkey);
-
-}
-
-
-
-
-
-
-
-static rivatv_info* info;
-
-
-
-
-int vixInit(const char *args){
- int mtrr;
- info = (rivatv_info*)calloc(1,sizeof(rivatv_info));
- info->control_base = map_phys_mem(pci_info.base0, 0x00C00000 + 0x00008000);
- info->chip.arch = nvidia_card_ids[find_chip(pci_info.device)].arch;
- printf("[nvidia_vid] arch %x register base %x\n",info->chip.arch,(unsigned int)info->control_base);
- info->chip.PFIFO = (uint32_t *) (info->control_base + 0x00002000);
- info->chip.FIFO = (uint32_t *) (info->control_base + 0x00800000);
- info->chip.PMC = (uint32_t *) (info->control_base + 0x00000000);
- info->chip.PFB = (uint32_t *) (info->control_base + 0x00100000);
- info->chip.PME = (uint32_t *) (info->control_base + 0x00000000);
- info->chip.PCIO = (uint8_t *) (info->control_base + 0x00601000);
- info->chip.PVIO = (uint8_t *) (info->control_base + 0x000C0000);
- info->chip.PGRAPH = (uint32_t *) (info->control_base + 0x00400000);
- /* setup chip specific functions */
- switch (info->chip.arch) {
- case NV_ARCH_03:
- info->chip.lock = rivatv_lock_nv03;
- info->chip.fbsize = rivatv_fbsize_nv03 (&info->chip);
- info->chip.PVIDEO = (uint32_t *) (info->control_base + 0x00680000);
- break;
- case NV_ARCH_04:
- info->chip.lock = rivatv_lock_nv04;
- info->chip.fbsize = rivatv_fbsize_nv04 (&info->chip);
- info->chip.PRAMIN = (uint32_t *) (info->control_base + 0x00700000);
- info->chip.PVIDEO = (uint32_t *) (info->control_base + 0x00680000);
- break;
- case NV_ARCH_10:
- case NV_ARCH_20:
- case NV_ARCH_30:
- info->chip.lock = rivatv_lock_nv04;
- info->chip.fbsize = rivatv_fbsize_nv10 (&info->chip);
- info->chip.PRAMIN = (uint32_t *) (info->control_base + 0x00700000);
- info->chip.PVIDEO = (uint32_t *) (info->control_base + 0x00008000);
- break;
- }
- switch (info->chip.arch) {
- case NV_ARCH_03:
- {
- /* This maps framebuffer @6MB, thus 2MB are left for video. */
- info->video_base = map_phys_mem(pci_info.base1, info->chip.fbsize);
- /* This may trash your screen for resolutions greater than 1024x768, sorry. */
- info->picture_offset = 1024*768* 4 * ((info->chip.fbsize > 4194304)?2:1);
- info->picture_base = (uint32_t) info->video_base + info->picture_offset;
- info->chip.PRAMIN = (uint32_t *) (info->video_base + 0x00C00000);
- break;
- }
- case NV_ARCH_04:
- case NV_ARCH_10:
- case NV_ARCH_20:
- case NV_ARCH_30:
- {
- info->video_base = map_phys_mem(pci_info.base1, info->chip.fbsize);
- info->picture_offset = info->chip.fbsize - NV04_BES_SIZE;
-// info->picture_base = (unsigned long)map_phys_mem(pci_info.base1+info->picture_offset,NV04_BES_SIZE);
- info->picture_base = (uint32_t) info->video_base + info->picture_offset;
- break;
- }
- }
-
- printf("[nvidia_vid] detected memory size %u MB\n",(uint32_t)(info->chip.fbsize /1024/1024));
-
- if ((mtrr = mtrr_set_type(pci_info.base1, info->chip.fbsize, MTRR_TYPE_WRCOMB))!= 0)
- printf("[nvidia_vid] unable to setup MTRR: %s\n", strerror(mtrr));
- else
- printf("[nvidia_vid] MTRR set up\n");
-
- nv_getscreenproperties(info);
- if(!info->depth)printf("[nvidia_vid] text mode: %ux%u\n",info->screen_x,info->screen_y);
- else printf("[nvidia_vid] video mode: %ux%u@%u\n",info->screen_x,info->screen_y, info->depth);
-
-
- rivatv_enable_PMEDIA(info);
- info->cur_frame = 0;
- info->use_colorkey = 0;
-
- return 0;
-}
-
-void vixDestroy(void){
- unmap_phys_mem(info->control_base ,0x00C00000 + 0x00008000);
- unmap_phys_mem(info->video_base, info->chip.fbsize);
- free(info);
-}
-
-int vixGetCapability(vidix_capability_t *to){
- memcpy(to, &nvidia_cap, sizeof(vidix_capability_t));
- return 0;
-}
-
-inline static int is_supported_fourcc(uint32_t fourcc)
-{
- if (fourcc == IMGFMT_UYVY || fourcc == IMGFMT_YUY2)
- return 1;
- else
- return 0;
-}
-
-int vixQueryFourcc(vidix_fourcc_t *to){
- if(is_supported_fourcc(to->fourcc)){
- to->depth = VID_DEPTH_1BPP | VID_DEPTH_2BPP |
- VID_DEPTH_4BPP | VID_DEPTH_8BPP |
- VID_DEPTH_12BPP| VID_DEPTH_15BPP|
- VID_DEPTH_16BPP| VID_DEPTH_24BPP|
- VID_DEPTH_32BPP;
- to->flags = VID_CAP_EXPAND | VID_CAP_SHRINK | VID_CAP_COLORKEY;
- return 0;
- }
- else to->depth = to->flags = 0;
- return ENOSYS;
-}
-
-int vixConfigPlayback(vidix_playback_t *vinfo){
- uint32_t i;
- printf("called %s\n", __FUNCTION__);
- if (! is_supported_fourcc(vinfo->fourcc))
- return ENOSYS;
-
- info->width = vinfo->src.w;
- info->height = vinfo->src.h;
-
- info->d_width = vinfo->dest.w;
- info->d_height = vinfo->dest.h;
- info->wx = vinfo->dest.x;
- info->wy = vinfo->dest.y;
- info->format = vinfo->fourcc;
-
- printf("[nvidia_vid] setting up a %dx%d-%dx%d video window (src %dx%d), format 0x%X\n",
- info->d_width, info->d_height, info->wx, info->wy, info->width, info->height, vinfo->fourcc);
-
-
- vinfo->dga_addr=(void*)(info->picture_base);
-
- switch (vinfo->fourcc)
- {
- case IMGFMT_YUY2:
- case IMGFMT_UYVY:
-
- vinfo->dest.pitch.y = 16;
- vinfo->dest.pitch.u = 0;
- vinfo->dest.pitch.v = 0;
-
- vinfo->offset.y = 0;
- vinfo->offset.v = 0;
- vinfo->offset.u = 0;
- info->pitch = ((info->width << 1) + (vinfo->dest.pitch.y-1)) & ~(vinfo->dest.pitch.y-1);
- vinfo->frame_size = info->pitch * info->height;
- break;
- }
- info->buffer_size = vinfo->frame_size;
- info->num_frames = vinfo->num_frames= (info->chip.fbsize - info->picture_offset)/vinfo->frame_size;
- if(vinfo->num_frames > MAX_FRAMES)vinfo->num_frames = MAX_FRAMES;
-// vinfo->num_frames = 1;
-// printf("[nvidia_vid] Number of frames %i\n",vinfo->num_frames);
- for(i=0;i <vinfo->num_frames;i++)vinfo->offsets[i] = vinfo->frame_size*i;
- return 0;
-}
-
-int vixPlaybackOn(void){
- rivatv_overlay_start(info,info->cur_frame);
- return 0;
-}
-
-int vixPlaybackOff(void){
- rivatv_overlay_stop(info);
- return 0;
-}
-
-int vixSetGrKeys( const vidix_grkey_t * grkey){
- if (grkey->ckey.op == CKEY_FALSE)
- {
- info->use_colorkey = 0;
- printf("[nvidia_vid] colorkeying disabled\n");
- }
- else {
- info->use_colorkey = 1;
- info->vidixcolorkey = ((grkey->ckey.red<<16)|(grkey->ckey.green<<8)|grkey->ckey.blue);
- printf("[nvidia_vid] set colorkey 0x%x\n",info->vidixcolorkey);
- }
- if(info->d_width && info->d_height)rivatv_overlay_start(info,0);
- return 0;
-}
-
-int vixPlaybackFrameSelect(unsigned int frame){
-// printf("selecting buffer %d\n", frame);
- rivatv_overlay_start(info, frame);
- if (info->num_frames >= 1)
- info->cur_frame = frame/*(frame+1)%info->num_frames*/;
- return 0;
-}
-
diff --git a/src/video_out/vidix/drivers/pm2_vid.c b/src/video_out/vidix/drivers/pm2_vid.c
deleted file mode 100644
index 075b178de..000000000
--- a/src/video_out/vidix/drivers/pm2_vid.c
+++ /dev/null
@@ -1,357 +0,0 @@
-/**
- Driver for 3DLabs Permedia 2.
-
- Copyright (C) 2002 Måns Rullgård
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-**/
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <inttypes.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include "vidix.h"
-#include "fourcc.h"
-#include "libdha.h"
-#include "pci_ids.h"
-#include "pci_names.h"
-
-#include "glint_regs.h"
-
-#define VIDIX_STATIC pm2_
-
-/* MBytes of video memory to use */
-#define PM2_VIDMEM 6
-
-#if 0
-#define TRACE_ENTER() fprintf(stderr, "%s: enter\n", __FUNCTION__)
-#define TRACE_EXIT() fprintf(stderr, "%s: exit\n", __FUNCTION__)
-#else
-#define TRACE_ENTER()
-#define TRACE_EXIT()
-#endif
-
-#define WRITE_REG(offset,val) \
- *(volatile u_long *)(((u_char *)(pm2_reg_base)) + offset) = (val)
-#define READ_REG(offset) \
- *(volatile unsigned long *)(((unsigned char *)(pm2_reg_base)) + offset)
-
-pciinfo_t pci_info;
-
-void *pm2_reg_base;
-void *pm2_mem;
-
-int pm2_vidmem = PM2_VIDMEM;
-
-static vidix_capability_t pm2_cap =
-{
- "3DLabs Permedia2 driver",
- "Måns Rullgård <mru@users.sf.net>",
- TYPE_OUTPUT,
- { 0, 0, 0, 0 },
- 2048,
- 2048,
- 4,
- 4,
- -1,
- FLAG_UPSCALER|FLAG_DOWNSCALER,
- VENDOR_3DLABS,
- -1,
- { 0, 0, 0, 0 }
-};
-
-
-unsigned int VIDIX_NAME(vixGetVersion)(void)
-{
- return(VIDIX_VERSION);
-}
-
-static u_int pm2_card_ids[] =
-{
- (VENDOR_3DLABS << 16) | DEVICE_3DLABS_PERMEDIA2,
- (VENDOR_TEXAS << 16) | DEVICE_TEXAS_TVP4020_PERMEDIA_2
-};
-
-static int find_chip(u_int vendor, u_int chip_id)
-{
- u_int vci = (vendor << 16) | chip_id;
- unsigned i;
- for(i = 0; i < sizeof(pm2_card_ids)/sizeof(u_int); i++){
- if(vci == pm2_card_ids[i]) return i;
- }
- return -1;
-}
-
-int VIDIX_NAME(vixProbe)(int verbose, int force)
-{
- pciinfo_t lst[MAX_PCI_DEVICES];
- unsigned i,num_pci;
- int err;
-
- err = pci_scan(lst,&num_pci);
- if(err)
- {
- printf("[pm2] Error occured during pci scan: %s\n",strerror(err));
- return err;
- }
- else
- {
- err = ENXIO;
- for(i=0; i < num_pci; i++)
- {
- int idx;
- const char *dname;
- idx = find_chip(lst[i].vendor, lst[i].device);
- if(idx == -1)
- continue;
- dname = pci_device_name(lst[i].vendor, lst[i].device);
- dname = dname ? dname : "Unknown chip";
- printf("[pm2] Found chip: %s\n", dname);
- pm2_cap.device_id = lst[i].device;
- err = 0;
- memcpy(&pci_info, &lst[i], sizeof(pciinfo_t));
- break;
- }
- }
- if(err && verbose) printf("[pm2] Can't find chip.\n");
- return err;
-}
-
-#define PRINT_REG(reg) \
-{ \
- long _foo = READ_REG(reg); \
- printf("[pm2] " #reg " (%x) = %#lx (%li)\n", reg, _foo, _foo); \
-}
-
-int VIDIX_NAME(vixInit)(const char *args)
-{
- char *vm;
- pm2_reg_base = map_phys_mem(pci_info.base0, 0x10000);
- pm2_mem = map_phys_mem(pci_info.base1, 1 << 23);
- if((vm = getenv("PM2_VIDMEM"))){
- pm2_vidmem = strtol(vm, NULL, 0);
- }
- return 0;
-}
-
-void VIDIX_NAME(vixDestroy)(void)
-{
- unmap_phys_mem(pm2_reg_base, 0x10000);
- unmap_phys_mem(pm2_mem, 1 << 23);
-}
-
-int VIDIX_NAME(vixGetCapability)(vidix_capability_t *to)
-{
- memcpy(to, &pm2_cap, sizeof(vidix_capability_t));
- return 0;
-}
-
-static int is_supported_fourcc(uint32_t fourcc)
-{
- switch(fourcc){
- case IMGFMT_YUY2:
- return 1;
- default:
- return 0;
- }
-}
-
-int VIDIX_NAME(vixQueryFourcc)(vidix_fourcc_t *to)
-{
- if(is_supported_fourcc(to->fourcc))
- {
- to->depth = VID_DEPTH_1BPP | VID_DEPTH_2BPP |
- VID_DEPTH_4BPP | VID_DEPTH_8BPP |
- VID_DEPTH_12BPP| VID_DEPTH_15BPP|
- VID_DEPTH_16BPP| VID_DEPTH_24BPP|
- VID_DEPTH_32BPP;
- to->flags = VID_CAP_EXPAND | VID_CAP_SHRINK | VID_CAP_COLORKEY;
- return 0;
- }
- else to->depth = to->flags = 0;
- return ENOSYS;
-}
-
-#define FORMAT_YUV422 ((1 << 6) | 3 | (1 << 4))
-
-#define PPROD(a,b,c) (a | (b << 3) | (c << 6))
-
-static u_int ppcodes[][2] = {
- {0, 0},
- {32, PPROD(1, 0, 0)},
- {64, PPROD(1, 1, 0)},
- {96, PPROD(1, 1, 1)},
- {128, PPROD(2, 1, 1)},
- {160, PPROD(2, 2, 1)},
- {192, PPROD(2, 2, 2)},
- {224, PPROD(3, 2, 1)},
- {256, PPROD(3, 2, 2)},
- {288, PPROD(3, 3, 1)},
- {320, PPROD(3, 3, 2)},
- {384, PPROD(3, 3, 3)},
- {416, PPROD(4, 3, 1)},
- {448, PPROD(4, 3, 2)},
- {512, PPROD(4, 3, 3)},
- {544, PPROD(4, 4, 1)},
- {576, PPROD(4, 4, 2)},
- {640, PPROD(4, 4, 3)},
- {768, PPROD(4, 4, 4)},
- {800, PPROD(5, 4, 1)},
- {832, PPROD(5, 4, 2)},
- {896, PPROD(5, 4, 3)},
- {1024, PPROD(5, 4, 4)},
- {1056, PPROD(5, 5, 1)},
- {1088, PPROD(5, 5, 2)},
- {1152, PPROD(5, 5, 3)},
- {1280, PPROD(5, 5, 4)},
- {1536, PPROD(5, 5, 5)},
- {1568, PPROD(6, 5, 1)},
- {1600, PPROD(6, 5, 2)},
- {1664, PPROD(6, 5, 3)},
- {1792, PPROD(6, 5, 4)},
- {2048, PPROD(6, 5, 5)}
-};
-
-static int frames[VID_PLAY_MAXFRAMES];
-
-int VIDIX_NAME(vixConfigPlayback)(vidix_playback_t *info)
-{
- u_int src_w, drw_w;
- u_int src_h, drw_h;
- long base0;
- u_int stride, sstr;
- u_int format;
- unsigned int i;
- u_int ppcode = 0, sppc = 0;
- u_int pitch = 0;
-
- TRACE_ENTER();
-
- switch(info->fourcc){
- case IMGFMT_YUY2:
- format = FORMAT_YUV422;
- break;
- default:
- return -1;
- }
-
- src_w = info->src.w;
- src_h = info->src.h;
-
- drw_w = info->dest.w;
- drw_h = info->dest.h;
-
- sstr = READ_REG(PMScreenStride) * 2;
-
- stride = 0;
- for(i = 1; i < sizeof(ppcodes) / sizeof(ppcodes[0]); i++){
- if((!stride) && (ppcodes[i][0] >= src_w)){
- stride = ppcodes[i][0];
- ppcode = ppcodes[i][1];
- pitch = ppcodes[i][0] - ppcodes[i-1][0];
- }
- if(ppcodes[i][0] == sstr)
- sppc = ppcodes[i][1];
- }
-
- if(!stride)
- return -1;
-
- info->num_frames = pm2_vidmem*1024*1024 / (stride * src_h * 2);
- if(info->num_frames > VID_PLAY_MAXFRAMES)
- info->num_frames = VID_PLAY_MAXFRAMES;
-
- /* Use end of video memory. Assume the card has 8 MB */
- base0 = (8 - pm2_vidmem)*1024*1024;
- info->dga_addr = pm2_mem + base0;
-
- info->dest.pitch.y = pitch*2;
- info->dest.pitch.u = 0;
- info->dest.pitch.v = 0;
- info->offset.y = 0;
- info->offset.v = 0;
- info->offset.u = 0;
- info->frame_size = stride * src_h * 2;
-
- for(i = 0; i < info->num_frames; i++){
- info->offsets[i] = info->frame_size * i;
- frames[i] = (base0 + info->offsets[i]) >> 1;
- }
-
- WRITE_REG(WindowOrigin, 0);
- WRITE_REG(dY, 1 << 16);
- WRITE_REG(RasterizerMode, 0);
- WRITE_REG(ScissorMode, 0);
- WRITE_REG(AreaStippleMode, 0);
- WRITE_REG(StencilMode, 0);
- WRITE_REG(TextureAddressMode, 1);
-
- WRITE_REG(dSdyDom, 0);
- WRITE_REG(dTdx, 0);
-
- WRITE_REG(PMTextureMapFormat, (1 << 19) | ppcode);
- WRITE_REG(PMTextureDataFormat, format);
- WRITE_REG(PMTextureReadMode, (1 << 17) | /* FilterMode */
- (11 << 13) | (11 << 9) /* TextureSize log2 */ | 1);
- WRITE_REG(ColorDDAMode, 0);
- WRITE_REG(TextureColorMode, (0 << 4) /* RGB */ | (3 << 1) /* Copy */ | 1);
- WRITE_REG(AlphaBlendMode, 0);
- WRITE_REG(DitherMode, (1 << 10) | 1);
- WRITE_REG(LogicalOpMode, 0);
- WRITE_REG(FBReadMode, sppc);
- WRITE_REG(FBHardwareWriteMask, 0xFFFFFFFF);
- WRITE_REG(FBWriteMode, 1);
- WRITE_REG(YUVMode, 1);
-
- WRITE_REG(SStart, 0);
- WRITE_REG(TStart, 0);
-
- WRITE_REG(dSdx, (src_w << 20) / drw_w);
- WRITE_REG(dTdyDom, (src_h << 20) / drw_h);
- WRITE_REG(RectangleOrigin, info->dest.x | (info->dest.y << 16));
- WRITE_REG(RectangleSize, (drw_h << 16) | drw_w);
-
- TRACE_EXIT();
- return 0;
-}
-
-int VIDIX_NAME(vixPlaybackOn)(void)
-{
- TRACE_ENTER();
-
- TRACE_EXIT();
- return 0;
-}
-
-int VIDIX_NAME(vixPlaybackOff)(void)
-{
- WRITE_REG(YUVMode, 0);
- WRITE_REG(TextureColorMode, 0);
- WRITE_REG(TextureAddressMode, 0);
- WRITE_REG(TextureReadMode, 0);
- return 0;
-}
-
-int VIDIX_NAME(vixPlaybackFrameSelect)(unsigned int frame)
-{
- WRITE_REG(PMTextureBaseAddress, frames[frame]);
- WRITE_REG(Render, PrimitiveRectangle | XPositive | YPositive |
- TextureEnable);
- return 0;
-}
diff --git a/src/video_out/vidix/drivers/pm3_regs.h b/src/video_out/vidix/drivers/pm3_regs.h
deleted file mode 100644
index 44cc92dca..000000000
--- a/src/video_out/vidix/drivers/pm3_regs.h
+++ /dev/null
@@ -1,1253 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_regs.h,v 1.9 2001/11/20 00:09:15 alanh Exp $ */
-
-/*
- * glint register file
- *
- * Copyright by Sven Luther
- * Authors: Sven Luther, <luther@dpt-info.u-strasbg.fr>
- * Thomas Witzel, <twitzel@nmr.mgh.harvard.edu>
- *
- * this work is sponsored by Appian Graphics.
- *
- */
-
-#ifndef _PM3_REG_H_
-#define _PM3_REG_H_
-
-#define PM3FIFOSize 120
-
-#define PM3Tag(r) ((r>>3)&0x7ff)
-
-#define PM3OutputFIFO 0x2000
-
-/**********************************************
-* GLINT Permedia3 Control Status registers *
-***********************************************/
-/* Control Status Registers */
-#define PM3ResetStatus 0x0000
-#define PM3IntEnable 0x0008
-#define PM3IntFlags 0x0010
-#define PM3InFIFOSpace 0x0018
-#define PM3OutFIFOWords 0x0020
-#define PM3DMAAddress 0x0028
-#define PM3DMACount 0x0030
-#define PM3ErrorFlags 0x0038
-#define PM3VClkCtl 0x0040
-#define PM3TestRegister 0x0048
-#define PM3Aperture0 0x0050
-#define PM3Aperture1 0x0058
-#define PM3DMAControl 0x0060
-#define PM3FIFODis 0x0068
-#define PM3ChipConfig 0x0070
-#define PM3AGPControl 0x0078
-
-#define PM3GPOutDMAAddress 0x0080
-#define PM3PCIFeedbackCount 0x0088
-#define PM3PCIAbortStatus 0x0090
-#define PM3PCIAbortAddress 0x0098
-
-#define PM3PCIPLLStatus 0x00f0
-
-#define PM3HostTextureAddress 0x0100
-#define PM3TextureDownloadControl 0x0108
-#define PM3TextureOperation 0x0110
-#define PM3LogicalTexturePage 0x0118
-#define PM3TexDMAAddress 0x0120
-#define PM3TexFIFOSpace 0x0128
-
-/**********************************************
-* GLINT Permedia3 Region 0 Bypass Controls *
-***********************************************/
-#define PM3ByAperture1Mode 0x0300
- #define PM3ByApertureMode_BYTESWAP_ABCD (0<<0)
- #define PM3ByApertureMode_BYTESWAP_BADC (1<<0)
- #define PM3ByApertureMode_BYTESWAP_CDAB (2<<0)
- #define PM3ByApertureMode_BYTESWAP_DCBA (3<<0)
- #define PM3ByApertureMode_PATCH_DISABLE (0<<2)
- #define PM3ByApertureMode_PATCH_ENABLE (1<<2)
- #define PM3ByApertureMode_FORMAT_RAW (0<<3)
- #define PM3ByApertureMode_FORMAT_YUYV (1<<3)
- #define PM3ByApertureMode_FORMAT_UYVY (2<<3)
- #define PM3ByApertureMode_PIXELSIZE_8BIT (0<<5)
- #define PM3ByApertureMode_PIXELSIZE_16BIT (1<<5)
- #define PM3ByApertureMode_PIXELSIZE_32BIT (2<<5)
- #define PM3ByApertureMode_EFFECTIVE_STRIDE_1024 (0<<7)
- #define PM3ByApertureMode_EFFECTIVE_STRIDE_2048 (1<<7)
- #define PM3ByApertureMode_EFFECTIVE_STRIDE_4096 (2<<7)
- #define PM3ByApertureMode_EFFECTIVE_STRIDE_8192 (3<<7)
- #define PM3ByApertureMode_PATCH_OFFSET_X(off) (((off)&7f)<<9)
- #define PM3ByApertureMode_PATCH_OFFSET_Y(off) (((off)&7f)<<16)
- #define PM3ByApertureMode_FRAMEBUFFER (0<<21)
- #define PM3ByApertureMode_LOCALBUFFER (1<<21)
- #define PM3ByApertureMode_DOUBLE_WRITE_OFF (0<<22)
- #define PM3ByApertureMode_DOUBLE_WRITE_1MB (1<<22)
- #define PM3ByApertureMode_DOUBLE_WRITE_2MB (2<<22)
- #define PM3ByApertureMode_DOUBLE_WRITE_4MB (3<<22)
- #define PM3ByApertureMode_DOUBLE_WRITE_8MB (4<<22)
- #define PM3ByApertureMode_DOUBLE_WRITE_16MB (5<<22)
- #define PM3ByApertureMode_DOUBLE_WRITE_32MB (6<<22)
-#define PM3Aperture1Stride 0x0308
-#define PM3Aperture1YStart 0x0310
-#define PM3Aperture1UStart 0x0318
-#define PM3Aperture1VStart 0x0320
-
-#define PM3ByAperture2Mode 0x0328
-#define PM3Aperture2Stride 0x0330
-#define PM3Aperture2YStart 0x0338
-#define PM3Aperture2UStart 0x0340
-#define PM3Aperture2VStart 0x0348
-
-#define PM3ByDMAReadCommandBase 0x0378
-#define PM3ByDMAReadCommandCount 0x0380
-#define PM3ByDMAReadMode 0x0350
- #define PM3ByDMAReadMode_ByteSwap_NONE (0<<0)
- #define PM3ByDMAReadMode_ByteSwap_BYTE (1<<0)
- #define PM3ByDMAReadMode_ByteSwap_HWORD (2<<0)
- #define PM3ByDMAReadMode_ByteSwap_FULL (3<<0)
- #define PM3ByDMAReadMode_PatchEnable (1<<2)
- #define PM3ByDMAReadMode_Format_RAW (0<<3)
- #define PM3ByDMAReadMode_Format_YUYV (1<<3)
- #define PM3ByDMAReadMode_Format_UYVY (2<<3)
- #define PM3ByDMAReadMode_PixelSize(s) (((s>>4)&3)<<5)
- #define PM3ByDMAReadMode_EffectiveStride(s) ((s&3)<<7)
- #define PM3ByDMAReadMode_PatchOffsetX(x) ((x&0x3f)<<9)
- #define PM3ByDMAReadMode_PatchOffsetY(y) ((y&0x3f)<<16)
- #define PM3ByDMAReadMode_Buffer_FB (0<<21)
- #define PM3ByDMAReadMode_Buffer_LB (1<<21)
- #define PM3ByDMAReadMode_Active (1<<22)
- #define PM3ByDMAReadMode_MemType_PCI (0<<23)
- #define PM3ByDMAReadMode_MemType_AGP (1<<23)
- #define PM3ByDMAReadMode_Burst(b) ((b&7)<<24)
- #define PM3ByDMAReadMode_Align (1<<27)
-#define PM3ByDMAReadStride 0x0358
-#define PM3ByDMAReadUStart 0x0368
-#define PM3ByDMAReadVStart 0x0370
-#define PM3ByDMAReadYStart 0x0360
-
-
-/**********************************************
-* GLINT Permedia3 Memory Control (0x1000) *
-***********************************************/
-#define PM3MemCounter 0x1000
-#define PM3MemBypassWriteMask 0x1008
-#define PM3MemScratch 0x1010
-#define PM3LocalMemCaps 0x1018
- #define PM3LocalMemCaps_NoWriteMask (1<<28)
-#define PM3LocalMemTimings 0x1020
-#define PM3LocalMemControl 0x1028
-#define PM3LocalMemRefresh 0x1030
-#define PM3LocalMemPowerDown 0x1038
-#define PM3RemoteMemControl 0x1100
-
-/**********************************************
-* GLINT Permedia3 Video Control (0x3000) *
-***********************************************/
-
-#define PM3ScreenBase 0x3000
-#define PM3ScreenStride 0x3008
-#define PM3HTotal 0x3010
-#define PM3HgEnd 0x3018
-#define PM3HbEnd 0x3020
-#define PM3HsStart 0x3028
-#define PM3HsEnd 0x3030
-#define PM3VTotal 0x3038
-#define PM3VbEnd 0x3040
-#define PM3VsStart 0x3048
-#define PM3VsEnd 0x3050
-#define PM3VideoControl 0x3058
- #define PM3VideoControl_DISABLE (0<<0)
- #define PM3VideoControl_ENABLE (1<<0)
- #define PM3VideoControl_BLANK_ACTIVE_HIGH (0<<1)
- #define PM3VideoControl_BLANK_ACTIVE_LOW (1<<1)
- #define PM3VideoControl_LINE_DOUBLE_OFF (0<<2)
- #define PM3VideoControl_LINE_DOUBLE_ON (1<<2)
- #define PM3VideoControl_HSYNC_FORCE_HIGH (0<<3)
- #define PM3VideoControl_HSYNC_ACTIVE_HIGH (1<<3)
- #define PM3VideoControl_HSYNC_FORCE_LOW (2<<3)
- #define PM3VideoControl_HSYNC_ACTIVE_LOW (3<<3)
- #define PM3VideoControl_VSYNC_FORCE_HIGH (0<<5)
- #define PM3VideoControl_VSYNC_ACTIVE_HIGH (1<<5)
- #define PM3VideoControl_VSYNC_FORCE_LOW (2<<5)
- #define PM3VideoControl_VSYNC_ACTIVE_LOW (3<<5)
- #define PM3VideoControl_BYTE_DOUBLE_OFF (0<<7)
- #define PM3VideoControl_BYTE_DOUBLE_ON (1<<7)
- #define PM3VideoControl_BUFFER_SWAP_SYNCON_FRAMEBLANK (0<<9)
- #define PM3VideoControl_BUFFER_SWAP_FREE_RUNNING (1<<9)
- #define PM3VideoControl_BUFFER_SWAP_LIMITETO_FRAMERATE (2<<9)
- #define PM3VideoControl_STEREO_DISABLE (0<<11)
- #define PM3VideoControl_STEREO_ENABLE (1<<11)
- #define PM3VideoControl_RIGHT_EYE_ACTIVE_HIGH (0<<12)
- #define PM3VideoControl_RIGHT_EYE_ACTIVE_LOW (1<<12)
- #define PM3VideoControl_VIDEO_EXT_LOW (0<<14)
- #define PM3VideoControl_VIDEO_EXT_HIGH (1<<14)
- #define PM3VideoControl_SYNC_MODE_INDEPENDENT (0<<16)
- #define PM3VideoControl_SYNC_MODE_SYNCTO_VSA (1<<16)
- #define PM3VideoControl_SYNC_MODE_SYNCTO_VSB (2<<16)
- #define PM3VideoControl_PATCH_DISABLE (0<<18)
- #define PM3VideoControl_PATCH_ENABLE (1<<18)
- #define PM3VideoControl_PIXELSIZE_8BIT (0<<19)
- #define PM3VideoControl_PIXELSIZE_16BIT (1<<19)
- #define PM3VideoControl_PIXELSIZE_32BIT (2<<19)
- #define PM3VideoControl_DISPLAY_DISABLE (0<<21)
- #define PM3VideoControl_DISPLAY_ENABLE (1<<21)
- #define PM3VideoControl_PATCH_OFFSET_X(off) (((off)&0x3f)<<22)
- #define PM3VideoControl_PATCH_OFFSET_Y(off) (((off)&0x3f)<<28)
-#define PM3InterruptLine 0x3060
-#define PM3DisplayData 0x3068
-#define PM3VerticalLineCount 0x3070
-#define PM3FifoControl 0x3078
-#define PM3ScreenBaseRight 0x3080
-#define PM3MiscControl 0x3088
-
-#define PM3VideoOverlayUpdate 0x3100
- #define PM3VideoOverlayUpdate_DISABLE (0<<0)
- #define PM3VideoOverlayUpdate_ENABLE (1<<0)
-#define PM3VideoOverlayMode 0x3108
- #define PM3VideoOverlayMode_DISABLE (0<<0)
- #define PM3VideoOverlayMode_ENABLE (1<<0)
- #define PM3VideoOverlayMode_BUFFERSYNC_MANUAL (0<<1)
- #define PM3VideoOverlayMode_BUFFERSYNC_VIDEOSTREAMA (1<<1)
- #define PM3VideoOverlayMode_BUFFERSYNC_VIDEOSTREAMB (2<<1)
- #define PM3VideoOverlayMode_FIELDPOLARITY_NORMAL (0<<4)
- #define PM3VideoOverlayMode_FIELDPOLARITY_INVERT (1<<4)
- #define PM3VideoOverlayMode_PIXELSIZE_8BIT (0<<5)
- #define PM3VideoOverlayMode_PIXELSIZE_16BIT (1<<5)
- #define PM3VideoOverlayMode_PIXELSIZE_32BIT (2<<5)
- #define PM3VideoOverlayMode_COLORFORMAT_RGB8888 ((0<<7)|(1<<12)|(2<<5))
- #define PM3VideoOverlayMode_COLORFORMAT_RGB4444 ((1<<7)|(1<<12)|(1<<5))
- #define PM3VideoOverlayMode_COLORFORMAT_RGB5551 ((2<<7)|(1<<12)|(1<<5))
- #define PM3VideoOverlayMode_COLORFORMAT_RGB565 ((3<<7)|(1<<12)|(1<<5))
- #define PM3VideoOverlayMode_COLORFORMAT_RGB332 ((4<<7)|(1<<12)|(0<<5))
- #define PM3VideoOverlayMode_COLORFORMAT_BGR8888 ((0<<7)|(2<<5))
- #define PM3VideoOverlayMode_COLORFORMAT_BGR4444 ((1<<7)|(1<<5))
- #define PM3VideoOverlayMode_COLORFORMAT_BGR5551 ((2<<7)|(1<<5))
- #define PM3VideoOverlayMode_COLORFORMAT_BGR565 ((3<<7)|(1<<5))
- #define PM3VideoOverlayMode_COLORFORMAT_BGR332 ((4<<7)|(0<<5))
- #define PM3VideoOverlayMode_COLORFORMAT_CI8 ((5<<7)|(1<<12)|(0<<5))
- #define PM3VideoOverlayMode_COLORFORMAT_VUY444 ((2<<10)|(1<<12)|(2<<5))
- #define PM3VideoOverlayMode_COLORFORMAT_YUV444 ((2<<10)|(2<<5))
- #define PM3VideoOverlayMode_COLORFORMAT_VUY422 ((1<<10)|(1<<12)|(1<<5))
- #define PM3VideoOverlayMode_COLORFORMAT_YUV422 ((1<<10)|(1<<5))
- #define PM3VideoOverlayMode_COLORORDER_BGR (0<<12)
- #define PM3VideoOverlayMode_COLORORDER_RGB (1<<12)
- #define PM3VideoOverlayMode_LINEARCOLOREXT_OFF (0<<13)
- #define PM3VideoOverlayMode_LINEARCOLOREXT_ON (1<<13)
- #define PM3VideoOverlayMode_FILTER_MASK (3<<14)
- #define PM3VideoOverlayMode_FILTER_OFF (0<<14)
- #define PM3VideoOverlayMode_FILTER_FULL (1<<14)
- #define PM3VideoOverlayMode_FILTER_PARTIAL (2<<14)
- #define PM3VideoOverlayMode_DEINTERLACE_OFF (0<<16)
- #define PM3VideoOverlayMode_DEINTERLACE_BOB (1<<16)
- #define PM3VideoOverlayMode_PATCHMODE_OFF (0<<18)
- #define PM3VideoOverlayMode_PATCHMODE_ON (1<<18)
- #define PM3VideoOverlayMode_FLIP_VIDEO (0<<20)
- #define PM3VideoOverlayMode_FLIP_VIDEOSTREAMA (1<<20)
- #define PM3VideoOverlayMode_FLIP_VIDEOSTREAMB (2<<20)
- #define PM3VideoOverlayMode_MIRROR_MASK (3<<23)
- #define PM3VideoOverlayMode_MIRRORX_OFF (0<<23)
- #define PM3VideoOverlayMode_MIRRORX_ON (1<<23)
- #define PM3VideoOverlayMode_MIRRORY_OFF (0<<24)
- #define PM3VideoOverlayMode_MIRRORY_ON (1<<24)
-#define PM3VideoOverlayFifoControl 0x3110
-#define PM3VideoOverlayIndex 0x3118
-#define PM3VideoOverlayBase 0x3120
-#define PM3VideoOverlayBase0 0x3120
-#define PM3VideoOverlayBase1 0x3128
-#define PM3VideoOverlayBase2 0x3130
-#define PM3VideoOverlayStride 0x3138
- #define PM3VideoOverlayStride_STRIDE(s) (((s)&0xfff)<<0)
-#define PM3VideoOverlayWidth 0x3140
- #define PM3VideoOverlayWidth_WIDTH(w) (((w)&0xfff)<<0)
-#define PM3VideoOverlayHeight 0x3148
- #define PM3VideoOverlayHeight_HEIGHT(h) (((h)&0xfff)<<0)
-#define PM3VideoOverlayOrigin 0x3150
- #define PM3VideoOverlayOrigin_XORIGIN(x) (((x)&0xfff)<<0)
- #define PM3VideoOverlayOrigin_YORIGIN(y) (((y)&0xfff)<<16)
-#define PM3VideoOverlayShrinkXDelta 0x3158
- #define PM3VideoOverlayShrinkXDelta_NONE (1<<16)
- #define PM3VideoOverlayShrinkXDelta_DELTA(s,d) \
- ((((s)<<16)/(d))&0x0ffffff0)
-#define PM3VideoOverlayZoomXDelta 0x3160
- #define PM3VideoOverlayZoomXDelta_NONE (1<<16)
- #define PM3VideoOverlayZoomXDelta_DELTA(s,d) \
- ((((s)<<16)/(d))&0x0001fff0)
-#define PM3VideoOverlayYDelta 0x3168
- #define PM3VideoOverlayYDelta_NONE (1<<16)
- #define PM3VideoOverlayYDelta_DELTA(s,d) \
- ((((s)<<16)/(d))&0x0ffffff0)
-#define PM3VideoOverlayFieldOffset 0x3170
-#define PM3VideoOverlayStatus 0x3178
-
-/**********************************************
-* GLINT Permedia3 RAMDAC Registers (0x4000) *
-***********************************************/
-/* Direct Registers */
-#define PM3RD_PaletteWriteAddress 0x4000
-#define PM3RD_PaletteData 0x4008
-#define PM3RD_PixelMask 0x4010
-#define PM3RD_PaletteReadAddress 0x4018
-
-#define PM3RD_IndexLow 0x4020
-#define PM3RD_IndexHigh 0x4028
-#define PM3RD_IndexedData 0x4030
-#define PM3RD_IndexControl 0x4038
- #define PM3RD_IndexControl_AUTOINCREMENT_ENABLE (1<<0)
- #define PM3RD_IndexControl_AUTOINCREMENT_DISABLE (0<<0)
-
-/* Indirect Registers */
-#define PM3RD_MiscControl 0x000
- #define PM3RD_MiscControl_HIGHCOLOR_RES_DISABLE (0<<0)
- #define PM3RD_MiscControl_HIGHCOLOR_RES_ENABLE (1<<0)
- #define PM3RD_MiscControl_PIXELDOUBLE_DISABLE (0<<1)
- #define PM3RD_MiscControl_PIXELDOUBLE_ENABLE (1<<1)
- #define PM3RD_MiscControl_LASTREAD_ADDR_DISABLE (0<<2)
- #define PM3RD_MiscControl_LASTREAD_ADDR_ENABLE (1<<2)
- #define PM3RD_MiscControl_DIRECTCOLOR_DISABLE (0<<3)
- #define PM3RD_MiscControl_DIRECTCOLOR_ENABLE (1<<3)
- #define PM3RD_MiscControl_OVERLAY_DISABLE (0<<4)
- #define PM3RD_MiscControl_OVERLAY_ENABLE (1<<4)
- #define PM3RD_MiscControl_PIXELDOUBLE_BUFFER_DISABLE (0<<5)
- #define PM3RD_MiscControl_PIXELDOUBLE_BUFFER_ENABLE (1<<5)
- #define PM3RD_MiscControl_VSB_OUTPUT_DISABLE (0<<6)
- #define PM3RD_MiscControl_VSB_OUTPUT_ENABLE (1<<6)
- #define PM3RD_MiscControl_STEREODOUBLE_BUFFER_DISABLE (0<<7)
- #define PM3RD_MiscControl_STEREODOUBLE_BUFFER_ENABLE (1<<7)
-#define PM3RD_SyncControl 0x001
- #define PM3RD_SyncControl_HSYNC_ACTIVE_LOW (0<<0)
- #define PM3RD_SyncControl_HSYNC_ACTIVE_HIGH (1<<0)
- #define PM3RD_SyncControl_HSYNC_FORCE_ACTIVE (3<<0)
- #define PM3RD_SyncControl_HSYNC_FORCE_INACTIVE (4<<0)
- #define PM3RD_SyncControl_HSYNC_TRI_STATE (2<<0)
- #define PM3RD_SyncControl_VSYNC_ACTIVE_LOW (0<<3)
- #define PM3RD_SyncControl_VSYNC_ACTIVE_HIGH (1<<3)
- #define PM3RD_SyncControl_VSYNC_TRI_STATE (2<<3)
- #define PM3RD_SyncControl_VSYNC_FORCE_ACTIVE (3<<3)
- #define PM3RD_SyncControl_VSYNC_FORCE_INACTIVE (4<<3)
- #define PM3RD_SyncControl_HSYNC_OVERRIDE_SETBY_HSYNC (0<<6)
- #define PM3RD_SyncControl_HSYNC_OVERRIDE_FORCE_HIGH (1<<6)
- #define PM3RD_SyncControl_VSYNC_OVERRIDE_SETBY_VSYNC (0<<7)
- #define PM3RD_SyncControl_VSYNC_OVERRIDE_FORCE_HIGH (1<<7)
-#define PM3RD_DACControl 0x002
- #define PM3RD_DACControl_DAC_POWER_ON (0<<0)
- #define PM3RD_DACControl_DAC_POWER_OFF (1<<0)
- #define PM3RD_DACControl_SYNC_ON_GREEN_DISABLE (0<<3)
- #define PM3RD_DACControl_SYNC_ON_GREEN_ENABLE (1<<3)
- #define PM3RD_DACControl_BLANK_RED_DAC_DISABLE (0<<4)
- #define PM3RD_DACControl_BLANK_RED_DAC_ENABLE (1<<4)
- #define PM3RD_DACControl_BLANK_GREEN_DAC_DISABLE (0<<5)
- #define PM3RD_DACControl_BLANK_GREEN_DAC_ENABLE (1<<5)
- #define PM3RD_DACControl_BLANK_BLUE_DAC_DISABLE (0<<6)
- #define PM3RD_DACControl_BLANK_BLUE_DAC_ENABLE (1<<6)
- #define PM3RD_DACControl_BLANK_PEDESTAL_DISABLE (0<<7)
- #define PM3RD_DACControl_BLANK_PEDESTAL_ENABLE (1<<7)
-#define PM3RD_PixelSize 0x003
- #define PM3RD_PixelSize_24_BIT_PIXELS (4<<0)
- #define PM3RD_PixelSize_32_BIT_PIXELS (2<<0)
- #define PM3RD_PixelSize_16_BIT_PIXELS (1<<0)
- #define PM3RD_PixelSize_8_BIT_PIXELS (0<<0)
-#define PM3RD_ColorFormat 0x004
- #define PM3RD_ColorFormat_LINEAR_COLOR_EXT_ENABLE (1<<6)
- #define PM3RD_ColorFormat_LINEAR_COLOR_EXT_DISABLE (0<<6)
- #define PM3RD_ColorFormat_COLOR_ORDER_BLUE_LOW (1<<5)
- #define PM3RD_ColorFormat_COLOR_ORDER_RED_LOW (0<<5)
- #define PM3RD_ColorFormat_COLOR_FORMAT_MASK (0x1f<<0)
- #define PM3RD_ColorFormat_8888_COLOR (0<<0)
- #define PM3RD_ColorFormat_5551_FRONT_COLOR (1<<0)
- #define PM3RD_ColorFormat_4444_COLOR (2<<0)
- #define PM3RD_ColorFormat_332_FRONT_COLOR (5<<0)
- #define PM3RD_ColorFormat_332_BACK_COLOR (6<<0)
- #define PM3RD_ColorFormat_2321_FRONT_COLOR (9<<0)
- #define PM3RD_ColorFormat_2321_BACK_COLOR (10<<0)
- #define PM3RD_ColorFormat_232_FRONTOFF_COLOR (11<<0)
- #define PM3RD_ColorFormat_232_BACKOFF_COLOR (12<<0)
- #define PM3RD_ColorFormat_5551_BACK_COLOR (13<<0)
- #define PM3RD_ColorFormat_CI8_COLOR (14<<0)
- #define PM3RD_ColorFormat_565_FRONT_COLOR (16<<0)
- #define PM3RD_ColorFormat_565_BACK_COLOR (17<<0)
-#define PM3RD_CursorMode 0x005
- #define PM3RD_CursorMode_CURSOR_DISABLE (0<<0)
- #define PM3RD_CursorMode_CURSOR_ENABLE (1<<0)
- #define PM3RD_CursorMode_FORMAT_64x64_2BPE_P0123 (0<<2)
- #define PM3RD_CursorMode_FORMAT_32x32_2BPE_P0 (1<<2)
- #define PM3RD_CursorMode_FORMAT_32x32_2BPE_P1 (2<<2)
- #define PM3RD_CursorMode_FORMAT_32x32_2BPE_P2 (3<<2)
- #define PM3RD_CursorMode_FORMAT_32x32_2BPE_P3 (4<<2)
- #define PM3RD_CursorMode_FORMAT_32x32_4BPE_P01 (5<<2)
- #define PM3RD_CursorMode_FORMAT_32x32_4BPE_P23 (6<<2)
- #define PM3RD_CursorMode_TYPE_MS (0<<4)
- #define PM3RD_CursorMode_TYPE_X (1<<4)
- #define PM3RD_CursorMode_REVERSE_PIXEL_ORDER_DISABLE (0<<6)
- #define PM3RD_CursorMode_REVERSE_PIXEL_ORDER_ENABLE (1<<6)
- #define PM3RD_CursorMode_REVERSE_PIXEL_ORDER_3_COLOR (2<<6)
- #define PM3RD_CursorMode_REVERSE_PIXEL_ORDER_15_COLOR (3<<6)
-#define PM3RD_CursorControl 0x006
- #define PM3RD_CursorControl_DOUBLE_X_DISABLED (0<<0)
- #define PM3RD_CursorControl_DOUBLE_X_ENABLED (1<<0)
- #define PM3RD_CursorControl_DOUBLE_Y_DISABLED (0<<1)
- #define PM3RD_CursorControl_DOUBLE_Y_ENABLED (1<<1)
- #define PM3RD_CursorControl_READBACK_POS_DISABLED (0<<2)
- #define PM3RD_CursorControl_READBACK_POS_ENABLED (1<<2)
-
-#define PM3RD_CursorXLow 0x007
-#define PM3RD_CursorXHigh 0x008
-#define PM3RD_CursorYLow 0x009
-#define PM3RD_CursorYHigh 0x00a
-#define PM3RD_CursorHotSpotX 0x00b
-#define PM3RD_CursorHotSpotY 0x00c
-#define PM3RD_OverlayKey 0x00d
-#define PM3RD_Pan 0x00e
- #define PM3RD_Pan_DISABLE (0<<0)
- #define PM3RD_Pan_ENABLE (1<<0)
- #define PM3RD_Pan_GATE_DISABLE (0<<1)
- #define PM3RD_Pan_GATE_ENABLE (1<<1)
-#define PM3RD_Sense 0x00f
-
-#define PM3RD_CheckControl 0x018
- #define PM3RD_CheckControl_PIXEL_DISABLED (0<<0)
- #define PM3RD_CheckControl_PIXEL_ENABLED (1<<0)
- #define PM3RD_CheckControl_LUT_DISABLED (0<<1)
- #define PM3RD_CheckControl_LUT_ENABLED (1<<1)
-#define PM3RD_CheckPixelRed 0x019
-#define PM3RD_CheckPixelGreen 0x01a
-#define PM3RD_CheckPixelBlue 0x01b
-#define PM3RD_CheckLUTRed 0x01c
-#define PM3RD_CheckLUTGreen 0x01d
-#define PM3RD_CheckLUTBlue 0x01e
-#define PM3RD_Scratch 0x01f
-
-#define PM3RD_VideoOverlayControl 0x020
- #define PM3RD_VideoOverlayControl_DISABLE (0<<0)
- #define PM3RD_VideoOverlayControl_ENABLE (1<<0)
- #define PM3RD_VideoOverlayControl_MODE_MASK (3<<1)
- #define PM3RD_VideoOverlayControl_MODE_MAINKEY (0<<1)
- #define PM3RD_VideoOverlayControl_MODE_OVERLAYKEY (1<<1)
- #define PM3RD_VideoOverlayControl_MODE_ALWAYS (2<<1)
- #define PM3RD_VideoOverlayControl_MODE_BLEND (3<<1)
- #define PM3RD_VideoOverlayControl_DIRECTCOLOR_DISABLED (0<<3)
- #define PM3RD_VideoOverlayControl_DIRECTCOLOR_ENABLED (1<<3)
- #define PM3RD_VideoOverlayControl_BLENDSRC_MAIN (0<<4)
- #define PM3RD_VideoOverlayControl_BLENDSRC_REGISTER (1<<4)
- #define PM3RD_VideoOverlayControl_KEY_COLOR (0<<5)
- #define PM3RD_VideoOverlayControl_KEY_ALPHA (1<<5)
-#define PM3RD_VideoOverlayXStartLow 0x021
-#define PM3RD_VideoOverlayXStartHigh 0x022
-#define PM3RD_VideoOverlayYStartLow 0x023
-#define PM3RD_VideoOverlayYStartHigh 0x024
-#define PM3RD_VideoOverlayXEndLow 0x025
-#define PM3RD_VideoOverlayXEndHigh 0x026
-#define PM3RD_VideoOverlayYEndLow 0x027
-#define PM3RD_VideoOverlayYEndHigh 0x028
-#define PM3RD_VideoOverlayKeyR 0x029
-#define PM3RD_VideoOverlayKeyG 0x02a
-#define PM3RD_VideoOverlayKeyB 0x02b
-#define PM3RD_VideoOverlayBlend 0x02c
- #define PM3RD_VideoOverlayBlend_FACTOR_0_PERCENT (0<<6)
- #define PM3RD_VideoOverlayBlend_FACTOR_25_PERCENT (1<<6)
- #define PM3RD_VideoOverlayBlend_FACTOR_75_PERCENT (2<<6)
- #define PM3RD_VideoOverlayBlend_FACTOR_100_PERCENT (3<<6)
-
-#define PM3RD_DClkSetup1 0x1f0
-#define PM3RD_DClkSetup2 0x1f1
-#define PM3RD_KClkSetup1 0x1f2
-#define PM3RD_KClkSetup2 0x1f3
-
-#define PM3RD_DClkControl 0x200
- #define PM3RD_DClkControl_SOURCE_PLL (0<<4)
- #define PM3RD_DClkControl_SOURCE_VSA (1<<4)
- #define PM3RD_DClkControl_SOURCE_VSB (2<<4)
- #define PM3RD_DClkControl_SOURCE_EXT (3<<4)
- #define PM3RD_DClkControl_STATE_RUN (2<<2)
- #define PM3RD_DClkControl_STATE_HIGH (1<<2)
- #define PM3RD_DClkControl_STATE_LOW (0<<2)
- #define PM3RD_DClkControl_LOCKED (1<<1)
- #define PM3RD_DClkControl_NOT_LOCKED (0<<1)
- #define PM3RD_DClkControl_ENABLE (1<<0)
- #define PM3RD_DClkControl_DISABLE (0<<0)
-#define PM3RD_DClk0PreScale 0x201
-#define PM3RD_DClk0FeedbackScale 0x202
-#define PM3RD_DClk0PostScale 0x203
-#define PM3RD_DClk1PreScale 0x204
-#define PM3RD_DClk1FeedbackScale 0x205
-#define PM3RD_DClk1PostScale 0x206
-#define PM3RD_DClk2PreScale 0x207
-#define PM3RD_DClk2FeedbackScale 0x208
-#define PM3RD_DClk2PostScale 0x209
-#define PM3RD_DClk3PreScale 0x20a
-#define PM3RD_DClk3FeedbackScale 0x20b
-#define PM3RD_DClk3PostScale 0x20c
-#define PM3RD_KClkControl 0x20d
- #define PM3RD_KClkControl_DISABLE (0<<0)
- #define PM3RD_KClkControl_ENABLE (1<<0)
- #define PM3RD_KClkControl_NOT_LOCKED (0<<1)
- #define PM3RD_KClkControl_LOCKED (1<<1)
- #define PM3RD_KClkControl_STATE_LOW (0<<2)
- #define PM3RD_KClkControl_STATE_HIGH (1<<2)
- #define PM3RD_KClkControl_STATE_RUN (2<<2)
- #define PM3RD_KClkControl_STATE_LOW_POWER (3<<2)
- #define PM3RD_KClkControl_SOURCE_PCLK (0<<4)
- #define PM3RD_KClkControl_SOURCE_HALF_PCLK (1<<4)
- #define PM3RD_KClkControl_SOURCE_PLL (2<<4)
-#define PM3RD_KClkPreScale 0x20e
-#define PM3RD_KClkFeedbackScale 0x20f
-#define PM3RD_KClkPostScale 0x210
-#define PM3RD_MClkControl 0x211
- #define PM3RD_MClkControl_DISABLE (0<<0)
- #define PM3RD_MClkControl_ENABLE (1<<0)
- #define PM3RD_MClkControl_NOT_LOCKED (0<<1)
- #define PM3RD_MClkControl_LOCKED (1<<1)
- #define PM3RD_MClkControl_STATE_LOW (0<<2)
- #define PM3RD_MClkControl_STATE_HIGH (1<<2)
- #define PM3RD_MClkControl_STATE_RUN (2<<2)
- #define PM3RD_MClkControl_STATE_LOW_POWER (3<<2)
- #define PM3RD_MClkControl_SOURCE_PCLK (0<<4)
- #define PM3RD_MClkControl_SOURCE_HALF_PCLK (1<<4)
- #define PM3RD_MClkControl_SOURCE_HALF_EXT (3<<4)
- #define PM3RD_MClkControl_SOURCE_EXT (4<<4)
- #define PM3RD_MClkControl_SOURCE_HALF_KCLK (5<<4)
- #define PM3RD_MClkControl_SOURCE_KCLK (6<<4)
-#define PM3RD_MClkPreScale 0x212
-#define PM3RD_MClkFeedbackScale 0x213
-#define PM3RD_MClkPostScale 0x214
-#define PM3RD_SClkControl 0x215
- #define PM3RD_SClkControl_DISABLE (0<<0)
- #define PM3RD_SClkControl_ENABLE (1<<0)
- #define PM3RD_SClkControl_NOT_LOCKED (0<<1)
- #define PM3RD_SClkControl_LOCKED (1<<1)
- #define PM3RD_SClkControl_STATE_LOW (0<<2)
- #define PM3RD_SClkControl_STATE_HIGH (1<<2)
- #define PM3RD_SClkControl_STATE_RUN (2<<2)
- #define PM3RD_SClkControl_STATE_LOW_POWER (3<<2)
- #define PM3RD_SClkControl_SOURCE_PCLK (0<<4)
- #define PM3RD_SClkControl_SOURCE_HALF_PCLK (1<<4)
- #define PM3RD_SClkControl_SOURCE_HALF_EXT (3<<4)
- #define PM3RD_SClkControl_SOURCE_EXT (4<<4)
- #define PM3RD_SClkControl_SOURCE_HALF_KCLK (5<<4)
- #define PM3RD_SClkControl_SOURCE_KCLK (6<<4)
-#define PM3RD_SClkPreScale 0x216
-#define PM3RD_SClkFeedbackScale 0x217
-#define PM3RD_SClkPostScale 0x218
-
-#define PM3RD_CursorPalette(p) (0x303+(p))
-#define PM3RD_CursorPattern(p) (0x400+(p))
-/******************************************************
-* GLINT Permedia3 Video Streaming Registers (0x5000) *
-*******************************************************/
-
-#define PM3VSConfiguration 0x5800
-
-/**********************************************
-* GLINT Permedia3 Core Registers (0x8000+) *
-***********************************************/
-#define PM3AALineWidth 0x94c0
-#define PM3AAPointsize 0x94a0
-#define PM3AlphaBlendAlphaMode 0xafa8
-#define PM3AlphaBlendAlphaModeAnd 0xad30
-#define PM3AlphaBlendAlphaModeOr 0xad38
-#define PM3AlphaBlendColorMode 0xafa0
-#define PM3AlphaBlendColorModeAnd 0xacb0
-#define PM3AlphaBlendColorModeOr 0xacb8
-#define PM3AlphaDestColor 0xaf88
-#define PM3AlphaSourceColor 0xaf80
-#define PM3AlphaTestMode 0x8800
-#define PM3AlphaTestModeAnd 0xabf0
-#define PM3AlphaTestModeOr 0xabf8
-#define PM3AntialiasMode 0x8808
-#define PM3AntialiasModeAnd 0xac00
-#define PM3AntialiasModeOr 0xac08
-#define PM3AreaStippleMode 0x81a0
-/* ... */
-#define PM3BackgroundColor 0xb0c8
-#define PM3BasePageOfWorkingSet 0xb4c8
-/* ... */
-#define PM3ChromaTestMode 0x8f18
-/* ... */
-#define PM3ColorDDAMode 0x87e0
-#define PM3ColorDDAModeAnd 0xabe0
-#define PM3ColorDDAModeOr 0xabe8
-#define PM3CommandInterrupt 0xa990
-#define PM3ConstantColorDDA 0xafb0
- #define PM3ConstantColorDDA_R(r) ((r)&0xff)
- #define PM3ConstantColorDDA_G(g) (((g)&0xff)<<8)
- #define PM3ConstantColorDDA_B(b) (((b)&0xff)<<16)
- #define PM3ConstantColorDDA_A(a) (((a)&0xff)<<24)
-#define PM3ContextData 0x8dd0
-#define PM3ContextDump 0x8dc0
-#define PM3ContextRestore 0x8dc8
-#define PM3Continue 0x8058
-#define PM3ContinueNewDom 0x8048
-#define PM3ContinueNewLine 0x8040
-#define PM3ContinueNewSub 0x8050
-#define PM3Count 0x8030
-/* ... */
-#define PM3DeltaControl 0x9350
-#define PM3DeltaControlAnd 0xab20
-#define PM3DeltaControlOr 0xab28
-#define PM3DeltaMode 0x9300
-#define PM3DeltaModeAnd 0xaad0
-#define PM3DeltaModeOr 0xaad8
-
-#define PM3DepthMode 0x89a0
-/* ... */
-#define PM3DitherMode 0x8818
-#define PM3DitherModeAnd 0xacd0
-#define PM3DitherModeOr 0xacd8
-/* ... */
-#define PM3DMARectangleRead 0xa9a8
- #define PM3DMARectangleRead_Width(w) (w&0xfff)
- #define PM3DMARectangleRead_Height(h) ((h&0xfff)<<12)
- #define PM3DMARectangleRead_PixelSize(s) ((s&0x3)<<24)
- #define PM3DMARectangleRead_Pack (1<<26)
- #define PM3DMARectangleRead_ByteSwap(b) ((b&0x3)<<27)
- #define PM3DMARectangleRead_Alignment (1<<30)
-#define PM3DMARectangleReadAddress 0xa9b0
-#define PM3DMARectangleReadLinePitch 0xa9b8
-#define PM3DMARectangleReadTarget 0xa9c0
-/* ... */
-#define PM3DownloadAddress 0xb0d0
-#define PM3DownloadData 0xb0d8
-/* ... */
-#define PM3dBdx 0x87b8
-#define PM3dBdyDom 0x87c0
-#define PM3dGdx 0x87a0
-#define PM3dGdyDom 0x87a8
-#define PM3dQdx 0x83c0
-#define PM3dQdyDom 0x83c8
-#define PM3dRdx 0x8788
-#define PM3dRdyDom 0x8790
-#define PM3dSdx 0x8390
-#define PM3dSdy 0x83d8
-#define PM3dSdyDom 0x8398
-#define PM3dTdx 0x83a8
-#define PM3dTdy 0x83e0
-#define PM3dTdyDom 0x83b0
-#define PM3dXDom 0x8008
-#define PM3dXSub 0x8018
-#define PM3dY 0x8028
-/* ... */
-#define PM3FBBlockColor 0x8ac8
-#define PM3FBBlockColor0 0xb060
-#define PM3FBBlockColor1 0xb068
-#define PM3FBBlockColor2 0xb070
-#define PM3FBBlockColor3 0xb078
-#define PM3FBBlockColorBack 0xb0a0
-#define PM3FBBlockColorBack0 0xb080
-#define PM3FBBlockColorBack1 0xb088
-#define PM3FBBlockColorBack2 0xb090
-#define PM3FBBlockColorBack3 0xb098
-#define PM3FBColor 0x8a98
-#define PM3FBDestReadBufferAddr0 0xae80
-#define PM3FBDestReadBufferAddr1 0xae88
-#define PM3FBDestReadBufferAddr2 0xae90
-#define PM3FBDestReadBufferAddr3 0xae98
-#define PM3FBDestReadBufferOffset0 0xaea0
-#define PM3FBDestReadBufferOffset1 0xaea8
-#define PM3FBDestReadBufferOffset2 0xaeb0
-#define PM3FBDestReadBufferOffset3 0xaeb8
- #define PM3FBDestReadBufferOffset_XOffset(x) ((x)&0xffff)
- #define PM3FBDestReadBufferOffset_YOffset(y) (((y)&0xffff)<<16)
-#define PM3FBDestReadBufferWidth0 0xaec0
-#define PM3FBDestReadBufferWidth1 0xaec8
-#define PM3FBDestReadBufferWidth2 0xaed0
-#define PM3FBDestReadBufferWidth3 0xaed8
- #define PM3FBDestReadBufferWidth_Width(w) ((w)&0x0fff)
-
-#define PM3FBDestReadEnables 0xaee8
-#define PM3FBDestReadEnablesAnd 0xad20
-#define PM3FBDestReadEnablesOr 0xad28
- #define PM3FBDestReadEnables_E(e) ((e)&0xff)
- #define PM3FBDestReadEnables_E0 (1<<0)
- #define PM3FBDestReadEnables_E1 (1<<1)
- #define PM3FBDestReadEnables_E2 (1<<2)
- #define PM3FBDestReadEnables_E3 (1<<3)
- #define PM3FBDestReadEnables_E4 (1<<4)
- #define PM3FBDestReadEnables_E5 (1<<5)
- #define PM3FBDestReadEnables_E6 (1<<6)
- #define PM3FBDestReadEnables_E7 (1<<7)
- #define PM3FBDestReadEnables_R(r) (((r)&0xff)<<8)
- #define PM3FBDestReadEnables_R0 (1<<8)
- #define PM3FBDestReadEnables_R1 (1<<9)
- #define PM3FBDestReadEnables_R2 (1<<10)
- #define PM3FBDestReadEnables_R3 (1<<11)
- #define PM3FBDestReadEnables_R4 (1<<12)
- #define PM3FBDestReadEnables_R5 (1<<13)
- #define PM3FBDestReadEnables_R6 (1<<14)
- #define PM3FBDestReadEnables_R7 (1<<15)
- #define PM3FBDestReadEnables_ReferenceAlpha(a) (((a)&0xff)<<24)
-
-#define PM3FBDestReadMode 0xaee0
-#define PM3FBDestReadModeAnd 0xac90
-#define PM3FBDestReadModeOr 0xac98
- #define PM3FBDestReadMode_ReadDisable (0<<0)
- #define PM3FBDestReadMode_ReadEnable (1<<0)
- #define PM3FBDestReadMode_StripePitch(sp) (((sp)&0x7)<<2)
- #define PM3FBDestReadMode_StripeHeight(sh) (((sh)&0x7)<<7)
- #define PM3FBDestReadMode_Enable0 (1<<8)
- #define PM3FBDestReadMode_Enable1 (1<<9)
- #define PM3FBDestReadMode_Enable2 (1<<10)
- #define PM3FBDestReadMode_Enable3 (1<<11)
- #define PM3FBDestReadMode_Layout0(l) (((l)&0x3)<<12)
- #define PM3FBDestReadMode_Layout1(l) (((l)&0x3)<<14)
- #define PM3FBDestReadMode_Layout2(l) (((l)&0x3)<<16)
- #define PM3FBDestReadMode_Layout3(l) (((l)&0x3)<<18)
- #define PM3FBDestReadMode_Origin0 (1<<20)
- #define PM3FBDestReadMode_Origin1 (1<<21)
- #define PM3FBDestReadMode_Origin2 (1<<22)
- #define PM3FBDestReadMode_Origin3 (1<<23)
- #define PM3FBDestReadMode_Blocking (1<<24)
- #define PM3FBDestReadMode_UseReadEnabled (1<<26)
- #define PM3FBDestReadMode_AlphaFiltering (1<<27)
-
-#define PM3FBHardwareWriteMask 0x8ac0
-#define PM3FBSoftwareWriteMask 0x8820
-#define PM3FBData 0x8aa0
-#define PM3FBSourceData 0x8aa8
-#define PM3FBSourceReadBufferAddr 0xaf08
-#define PM3FBSourceReadBufferOffset 0xaf10
- #define PM3FBSourceReadBufferOffset_XOffset(x) ((x)&0xffff)
- #define PM3FBSourceReadBufferOffset_YOffset(y) (((y)&0xffff)<<16)
-#define PM3FBSourceReadBufferWidth 0xaf18
- #define PM3FBSourceReadBufferWidth_Width(w) ((w)&0x0fff)
-#define PM3FBSourceReadMode 0xaf00
-#define PM3FBSourceReadModeAnd 0xaca0
-#define PM3FBSourceReadModeOr 0xaca8
- #define PM3FBSourceReadMode_ReadDisable (0<<0)
- #define PM3FBSourceReadMode_ReadEnable (1<<0)
- #define PM3FBSourceReadMode_StripePitch(sp) (((sp)&0x7)<<2)
- #define PM3FBSourceReadMode_StripeHeight(sh) (((sh)&0x7)<<7)
- #define PM3FBSourceReadMode_Layout(l) (((l)&0x3)<<8)
- #define PM3FBSourceReadMode_Origin (1<<10)
- #define PM3FBSourceReadMode_Blocking (1<<11)
- #define PM3FBSourceReadMode_UseTexelCoord (1<<13)
- #define PM3FBSourceReadMode_WrapXEnable (1<<14)
- #define PM3FBSourceReadMode_WrapYEnable (1<<15)
- #define PM3FBSourceReadMode_WrapX(w) (((w)&0xf)<<16)
- #define PM3FBSourceReadMode_WrapY(w) (((w)&0xf)<<20)
- #define PM3FBSourceReadMode_ExternalSourceData (1<<24)
-#define PM3FBWriteBufferAddr0 0xb000
-#define PM3FBWriteBufferAddr1 0xb008
-#define PM3FBWriteBufferAddr2 0xb010
-#define PM3FBWriteBufferAddr3 0xb018
-
-#define PM3FBWriteBufferOffset0 0xb020
-#define PM3FBWriteBufferOffset1 0xb028
-#define PM3FBWriteBufferOffset2 0xb030
-#define PM3FBWriteBufferOffset3 0xb038
- #define PM3FBWriteBufferOffset_XOffset(x) ((x)&0xffff)
- #define PM3FBWriteBufferOffset_YOffset(y) (((y)&0xffff)<<16)
-
-#define PM3FBWriteBufferWidth0 0xb040
-#define PM3FBWriteBufferWidth1 0xb048
-#define PM3FBWriteBufferWidth2 0xb050
-#define PM3FBWriteBufferWidth3 0xb058
- #define PM3FBWriteBufferWidth_Width(w) ((w)&0x0fff)
-
-#define PM3FBWriteMode 0x8ab8
-#define PM3FBWriteModeAnd 0xacf0
-#define PM3FBWriteModeOr 0xacf8
- #define PM3FBWriteMode_WriteDisable 0<<0
- #define PM3FBWriteMode_WriteEnable 1<<0
- #define PM3FBWriteMode_Replicate 1<<4
- #define PM3FBWriteMode_OpaqueSpan 1<<5
- #define PM3FBWriteMode_StripePitch(p) (((p)&0x7)<<6)
- #define PM3FBWriteMode_StripeHeight(h) (((h)&0x7)<<9)
- #define PM3FBWriteMode_Enable0 1<<12
- #define PM3FBWriteMode_Enable1 1<<13
- #define PM3FBWriteMode_Enable2 1<<14
- #define PM3FBWriteMode_Enable3 1<<15
- #define PM3FBWriteMode_Layout0(l) (((l)&0x3)<<16)
- #define PM3FBWriteMode_Layout1(l) (((l)&0x3)<<18)
- #define PM3FBWriteMode_Layout2(l) (((l)&0x3)<<20)
- #define PM3FBWriteMode_Layout3(l) (((l)&0x3)<<22)
- #define PM3FBWriteMode_Origin0 1<<24
- #define PM3FBWriteMode_Origin1 1<<25
- #define PM3FBWriteMode_Origin2 1<<26
- #define PM3FBWriteMode_Origin3 1<<27
-
-#define PM3FogMode 0x8690
-#define PM3ForegroundColor 0xb0c0
-/* ... */
-#define PM3GIDMode 0xb538
-#define PM3GIDModeAnd 0xb5b0
-#define PM3GIDModeOr 0xb5b8
-/* ... */
-#define PM3HeadPhysicalPageAllocation0 0xb480
-#define PM3HeadPhysicalPageAllocation1 0xb488
-#define PM3HeadPhysicalPageAllocation2 0xb490
-#define PM3HeadPhysicalPageAllocation3 0xb498
-/* ... */
-#define PM3LBDestReadBufferAddr 0xb510
-#define PM3LBDestReadBufferOffset 0xb518
-#define PM3LBDestReadEnables 0xb508
-#define PM3LBDestReadEnablesAnd 0xb590
-#define PM3LBDestReadEnablesOr 0xb598
-#define PM3LBDestReadMode 0xb500
-#define PM3LBDestReadModeAnd 0xb580
-#define PM3LBDestReadModeOr 0xb588
- #define PM3LBDestReadMode_Disable (0<<0)
- #define PM3LBDestReadMode_Enable (1<<0)
- #define PM3LBDestReadMode_StripePitch(p) (((p)&0x7)<<2)
- #define PM3LBDestReadMode_StripeHeight(h) (((h)&0x7)<<5)
- #define PM3LBDestReadMode_Layout (1<<8)
- #define PM3LBDestReadMode_Origin (1<<9)
- #define PM3LBDestReadMode_UserReadEnables (1<<10)
- #define PM3LBDestReadMode_Packed16 (1<<11)
- #define PM3LBDestReadMode_Width(w) (((w)&0xfff)<<12)
-#define PM3LBReadFormat 0x8888
- #define PM3LBReadFormat_DepthWidth(w) (((w)&0x3)<<0)
- #define PM3LBReadFormat_StencilWidth(w) (((w)&0xf)<<2)
- #define PM3LBReadFormat_StencilPosition(p) (((p)&0x1f)<<6)
- #define PM3LBReadFormat_FCPWidth(w) (((w)&0xf)<<11)
- #define PM3LBReadFormat_FCPPosition(p) (((p)&0x1f)<<15)
- #define PM3LBReadFormat_GIDWidth(w) (((w)&0x7)<<20)
- #define PM3LBReadFormat_GIDPosition(p) (((p)&0x1f)<<23)
-#define PM3LBSourceReadBufferAddr 0xb528
-#define PM3LBSourceReadBufferOffset 0xb530
-#define PM3LBSourceReadMode 0xb520
-#define PM3LBSourceReadModeAnd 0xb5a0
-#define PM3LBSourceReadModeOr 0xb5a8
- #define PM3LBSourceReadMode_Enable (1<<0)
- #define PM3LBSourceReadMode_StripePitch(p) (((p)&0x7)<<2)
- #define PM3LBSourceReadMode_StripeHeight(h) (((h)&0x7)<<5)
- #define PM3LBSourceReadMode_Layout (1<<8)
- #define PM3LBSourceReadMode_Origin (1<<9)
- #define PM3LBSourceReadMode_Packed16 (1<<10)
- #define PM3LBSourceReadMode_Width(w) (((w)&0xfff)<<11)
-#define PM3LBStencil 0x88a8
-#define PM3LBWriteBufferAddr 0xb540
-#define PM3LBWriteBufferOffset 0xb548
-#define PM3LBWriteFormat 0x88c8
- #define PM3LBWriteFormat_DepthWidth(w) (((w)&0x3)<<0)
- #define PM3LBWriteFormat_StencilWidth(w) (((w)&0xf)<<2)
- #define PM3LBWriteFormat_StencilPosition(p) (((p)&0x1f)<<6)
- #define PM3LBWriteFormat_GIDWidth(w) (((w)&0x7)<<20)
- #define PM3LBWriteFormat_GIDPosition(p) (((p)&0x1f)<<23)
-#define PM3LBWriteMode 0x88c0
-#define PM3LBWriteModeAnd 0xac80
-#define PM3LBWriteModeOr 0xac88
- #define PM3LBWriteMode_WriteDisable (0<<0)
- #define PM3LBWriteMode_WriteEnable (1<<0)
- #define PM3LBWriteMode_StripePitch(p) (((p)&0x7)<<3)
- #define PM3LBWriteMode_StripeHeight(h) (((h)&0x7)<<6)
- #define PM3LBWriteMode_Layout (1<<9)
- #define PM3LBWriteMode_Origin (1<<10)
- #define PM3LBWriteMode_Packed16 (1<<11)
- #define PM3LBWriteMode_Width(w) (((w)&0xfff)<<12)
-/* ... */
-#define PM3LineStippleMode 0x81a8
-#define PM3LineStippleModeAnd 0xabc0
-#define PM3LineStippleModeOr 0xabc8
-#define PM3LoadLineStippleCounters 0x81b0
-/* ... */
-#define PM3LogicalOpMode 0x8828
-#define PM3LogicalOpModeAnd 0xace0
-#define PM3LogicalOpModeOr 0xace8
- #define PM3LogicalOpMode_Disable (0<<0)
- #define PM3LogicalOpMode_Enable (1<<0)
- #define PM3LogicalOpMode_LogicOp(op) (((op)&0xf)<<1)
- #define PM3LogicalOpMode_UseConstantWriteData_Disable (0<<5)
- #define PM3LogicalOpMode_UseConstantWriteData_Enable (1<<5)
- #define PM3LogicalOpMode_Background_Disable (0<<6)
- #define PM3LogicalOpMode_Background_Enable (1<<6)
- #define PM3LogicalOpMode_Background_LogicOp(op) (((op)&0xf)<<7)
- #define PM3LogicalOpMode_UseConstantSource_Disable (0<<11)
- #define PM3LogicalOpMode_UseConstantSource_Enable (1<<11)
-
-#define PM3LogicalTexturePageAddr 0xb4d0
-#define PM3LogicalTexturePageTableLength 0xb4d8
-/* ... */
-#define PM3LUT 0x8e80
-/* ... */
-#define PM3LUT 0x8e80
-#define PM3LUTAddress 0x84d0
-#define PM3LUTData 0x84c8
-#define PM3LUTIndex 0x84c0
-#define PM3LUTMode 0xb378
-#define PM3LUTModeAnd 0xad70
-#define PM3LUTModeOr 0xad78
-#define PM3LUTTransfer 0x84d8
-/* ... */
-#define PM3PhysicalPageAllocationTableAddr 0xb4c0
-/* ... */
-#define PM3PixelSize 0x80c0
- #define PM3PixelSize_GLOBAL_32BIT (0<<0)
- #define PM3PixelSize_GLOBAL_16BIT (1<<0)
- #define PM3PixelSize_GLOBAL_8BIT (2<<0)
- #define PM3PixelSize_RASTERIZER_32BIT (0<<2)
- #define PM3PixelSize_RASTERIZER_16BIT (1<<2)
- #define PM3PixelSize_RASTERIZER_8BIT (2<<2)
- #define PM3PixelSize_SCISSOR_AND_STIPPLE_32BIT (0<<4)
- #define PM3PixelSize_SCISSOR_AND_STIPPLE_16BIT (1<<4)
- #define PM3PixelSize_SCISSOR_AND_STIPPLE_8BIT (2<<4)
- #define PM3PixelSize_TEXTURE_32BIT (0<<6)
- #define PM3PixelSize_TEXTURE_16BIT (1<<6)
- #define PM3PixelSize_TEXTURE_8BIT (2<<6)
- #define PM3PixelSize_LUT_32BIT (0<<8)
- #define PM3PixelSize_LUT_16BIT (1<<8)
- #define PM3PixelSize_LUT_8BIT (2<<8)
- #define PM3PixelSize_FRAMEBUFFER_32BIT (0<<10)
- #define PM3PixelSize_FRAMEBUFFER_16BIT (1<<10)
- #define PM3PixelSize_FRAMEBUFFER_8BIT (2<<10)
- #define PM3PixelSize_LOGICAL_OP_32BIT (0<<12)
- #define PM3PixelSize_LOGICAL_OP_16BIT (1<<12)
- #define PM3PixelSize_LOGICAL_OP_8BIT (2<<12)
- #define PM3PixelSize_LOCALBUFFER_32BIT (0<<14)
- #define PM3PixelSize_LOCALBUFFER_16BIT (1<<14)
- #define PM3PixelSize_LOCALBUFFER_8BIT (2<<14)
- #define PM3PixelSize_SETUP_32BIT (0<<16)
- #define PM3PixelSize_SETUP_16BIT (1<<16)
- #define PM3PixelSize_SETUP_8BIT (2<<16)
- #define PM3PixelSize_GLOBAL (0<<31)
- #define PM3PixelSize_INDIVIDUAL (1<<31)
-/* ... */
-#define PM3QStart 0x83b8
-
-#define PM3Render 0x8038
- #define PM3Render_AreaStipple_Disable (0<<0)
- #define PM3Render_AreaStipple_Enable (1<<0)
- #define PM3Render_LineStipple_Disable (0<<1)
- #define PM3Render_LineStipple_Enable (1<<1)
- #define PM3Render_ResetLine_Disable (0<<2)
- #define PM3Render_ResetLine_Enable (1<<2)
- #define PM3Render_FastFill_Disable (0<<3)
- #define PM3Render_FastFill_Enable (1<<3)
- #define PM3Render_Primitive_Line (0<<6)
- #define PM3Render_Primitive_Trapezoid (1<<6)
- #define PM3Render_Primitive_Point (2<<6)
- #define PM3Render_Antialias_Disable (0<<8)
- #define PM3Render_Antialias_Enable (1<<8)
- #define PM3Render_Antialias_SubPixelRes_4x4 (0<<9)
- #define PM3Render_Antialias_SubPixelRes_8x8 (1<<9)
- #define PM3Render_UsePointTable_Disable (0<<10)
- #define PM3Render_UsePointTable_Enable (1<<10)
- #define PM3Render_SyncOnbitMask_Disable (0<<11)
- #define PM3Render_SyncOnBitMask_Enable (1<<11)
- #define PM3Render_SyncOnHostData_Disable (0<<12)
- #define PM3Render_SyncOnHostData_Enable (1<<12)
- #define PM3Render_Texture_Disable (0<<13)
- #define PM3Render_Texture_Enable (1<<13)
- #define PM3Render_Fog_Disable (0<<14)
- #define PM3Render_Fog_Enable (1<<14)
- #define PM3Render_Coverage_Disable (0<<15)
- #define PM3Render_Coverage_Enable (1<<15)
- #define PM3Render_SubPixelCorrection_Disable (0<<16)
- #define PM3Render_SubPixelCorrection_Enable (1<<16)
- #define PM3Render_SpanOperation_Disable (0<<18)
- #define PM3Render_SpanOperation_Enable (1<<18)
- #define PM3Render_FBSourceRead_Disable (0<<27)
- #define PM3Render_FBSourceRead_Enable (1<<27)
-#define PM3RasterizerMode 0x80a0
-#define PM3RasterizerModeAnd 0xaba0
-#define PM3RasterizerModeOr 0xabb8
-#define PM3RectangleHeight 0x94e0
-#define PM3RepeatLine 0x9328
-#define PM3ResetPickResult 0x8c20
-#define PM3RLEMask 0x8c48
-#define PM3RouterMode 0x8840
-#define PM3RStart 0x8780
-#define PM3S1Start 0x8400
-#define PM3aveLineStippleCounters 0x81c0
-#define PM3ScissorMaxXY 0x8190
-#define PM3ScissorMinXY 0x8188
-#define PM3ScissorMode 0x8180
-#define PM3ScissorModeAnd 0xabb0
-#define PM3ScissorModeOr 0xabb8
-#define PM3ScreenSize 0x8198
-#define PM3Security 0x8908
-#define PM3SetLogicalTexturePage 0xb360
-#define PM3SizeOfFramebuffer 0xb0a8
-#define PM3SStart 0x8388
-#define PM3StartXDom 0x8000
-#define PM3StartXSub 0x8010
-#define PM3StartY 0x8020
-/* ... */
-#define PM3SpanColorMask 0x8168
-
-#define PM3StencilMode 0x8988
-/* ... */
-#define PM3TailPhysicalPageAllocation0 0xb4a0
-#define PM3TailPhysicalPageAllocation1 0xb4a8
-#define PM3TailPhysicalPageAllocation2 0xb4b0
-#define PM3TailPhysicalPageAllocation3 0xb4b8
-/* ... */
-#define PM3TextureApplicationMode 0x8680
-#define PM3TextureApplicationModeAnd 0xac50
-#define PM3TextureApplicationModeOr 0xac58
-#define PM3TextureBaseAddr0 0x8500
-#define PM3TextureBaseAddr1 0x8508
-#define PM3TextureBaseAddr2 0x8510
-#define PM3TextureBaseAddr3 0x8518
-#define PM3TextureBaseAddr4 0x8520
-#define PM3TextureBaseAddr5 0x8528
-#define PM3TextureBaseAddr6 0x8530
-#define PM3TextureBaseAddr7 0x8538
-#define PM3TextureBaseAddr8 0x8540
-#define PM3TextureBaseAddr9 0x8548
-#define PM3TextureBaseAddr10 0x8550
-#define PM3TextureBaseAddr11 0x8558
-#define PM3TextureBaseAddr12 0x8560
-#define PM3TextureBaseAddr13 0x8568
-#define PM3TextureBaseAddr14 0x8570
-#define PM3TextureBaseAddr15 0x8578
-#define PM3TextureCacheControl 0x8490
-#define PM3TextureChromaLower0 0x84f0
-#define PM3TextureChromaLower1 0x8608
-#define PM3TextureChromaUpper0 0x84e8
-#define PM3TextureChromaUpper1 0x8600
-#define PM3TextureCompositeAlphaMode0 0xb310
-#define PM3TextureCompositeAlphaMode0And 0xb390
-#define PM3TextureCompositeAlphaMode0Or 0xb398
-#define PM3TextureCompositeAlphaMode1 0xb320
-#define PM3TextureCompositeAlphaMode1And 0xb3b0
-#define PM3TextureCompositeAlphaMode1Or 0xb3b8
-#define PM3TextureCompositeColorMode0 0xb308
-#define PM3TextureCompositeColorMode0And 0xb380
-#define PM3TextureCompositeColorMode0Or 0xb388
-#define PM3TextureCompositeColorMode1 0xb318
-#define PM3TextureCompositeColorMode1And 0xb3a0
-#define PM3TextureCompositeColorMode1Or 0xb3a8
-#define PM3TextureCompositeFactor0 0xb328
-#define PM3TextureCompositeFactor1 0xb330
-#define PM3TextureCompositeMode 0xb300
-#define PM3TextureCoordMode 0x8380
-#define PM3TextureCoordModeAnd 0xac20
-#define PM3TextureCoordModeOr 0xac28
-#define PM3TextureData 0x88e8
-/*
-#define PM3TextureDownloadControl 0x0108
-*/
-#define PM3TextureDownloadOffset 0x88f0
-#define PM3TextureEnvColor 0x8688
-#define PM3TextureFilterMode 0x84e0
-#define PM3TextureFilterModeAnd 0xad50
-#define PM3TextureFilterModeOr 0xad58
-#define PM3TextureIndexMode0 0xb338
-#define PM3TextureIndexMode0And 0xb3c0
-#define PM3TextureIndexMode0Or 0xb3c8
-#define PM3TextureIndexMode1 0xb340
-#define PM3TextureIndexMode1And 0xb3d0
-#define PM3TextureIndexMode1Or 0xb3d8
-#define PM3TextureLODBiasS 0x8450
-#define PM3TextureLODBiasT 0x8458
-/* ... */
-#define PM3TextureMapSize 0xb428
-#define PM3TextureMapWidth0 0x8580
-#define PM3TextureMapWidth1 0x8588
- #define PM3TextureMapWidth_Width(w) ((w&0xfff)<<0)
- #define PM3TextureMapWidth_BorderLayout (1<<12)
- #define PM3TextureMapWidth_Layout_Linear (0<<13)
- #define PM3TextureMapWidth_Layout_Patch64 (1<<13)
- #define PM3TextureMapWidth_Layout_Patch32_2 (2<<13)
- #define PM3TextureMapWidth_Layout_Patch2 (3<<13)
- #define PM3TextureMapWidth_HostTexture (1<<15)
-#define PM3TextureReadMode0 0xb400
-#define PM3TextureReadMode0And 0xac30
-#define PM3TextureReadMode0Or 0xac38
-#define PM3TextureReadMode1 0xb408
-#define PM3TextureReadMode1And 0xad40
-#define PM3TextureReadMode1Or 0xad48
-
-#define PM3TouchLogicalPage 0xb370
- #define PM3TouchLogicalPage_Page(p) (p&0xffff)
- #define PM3TouchLogicalPage_Count(c) ((c&0x3fff)<<16)
- #define PM3TouchLogicalPage_Mode(m) ((m&0x3)<<30)
-
-#define PM3TStart 0x83a0
-
-#define PM3UpdateLogicalTextureInfo 0xb368
- #define PM3UpdateLogicalTextureInfo_Length(l) ((l)&0x1ff)
- #define PM3UpdateLogicalTextureInfo_MemoryPool(m) (((m)&0x3)<<9)
- #define PM3UpdateLogicalTextureInfo_VirtualHostPage (1<<11)
- #define PM3UpdateLogicalTextureInfo_HostPage(p) (((p)&0xfffff)<<12)
-
-/* ... */
-#define PM3WaitForCompletion 0x80b8
-#define PM3Window 0x8980
- #define PM3Window_ForceLBUpdate (1<<3)
- #define PM3Window_LBUpdateSource (1<<4)
- #define PM3Window_FrameCount(c) (((c)&0xff)<<9)
- #define PM3Window_StencilFCP (1<<17)
- #define PM3Window_DepthFCP (1<<18)
- #define PM3Window_OverrideWriteFiltering (1<<19)
-#define PM3WindowAnd 0xab80
-#define PM3WindowOr 0xab88
-#define PM3WindowOrigin 0x81c8
-#define PM3XBias 0x9480
-#define PM3YBias 0x9488
-#define PM3YLimits 0x80a8
-#define PM3YUVMode 0x8f00
-#define PM3ZFogBias 0x86b8
-#define PM3ZStart 0xadd8
-#define PM3ZStartL 0x89b8
-#define PM3ZStartU 0x89b0
-
-
-/**********************************************
-* GLINT Permedia3 2D setup Unit *
-***********************************************/
-#define PM3Config2D 0xb618
- #define PM3Config2D_OpaqueSpan (1<<0)
- #define PM3Config2D_MultiRXBlit (1<<1)
- #define PM3Config2D_UserScissorEnable (1<<2)
- #define PM3Config2D_FBDestReadEnable (1<<3)
- #define PM3Config2D_AlphaBlendEnable (1<<4)
- #define PM3Config2D_DitherEnable (1<<5)
- #define PM3Config2D_ForegroundROPEnable (1<<6)
- #define PM3Config2D_ForegroundROP(rop) (((rop)&0xf)<<7)
- #define PM3Config2D_BackgroundROPEnable (1<<11)
- #define PM3Config2D_BackgroundROP(rop) (((rop)&0xf)<<12)
- #define PM3Config2D_UseConstantSource (1<<16)
- #define PM3Config2D_FBWriteEnable (1<<17)
- #define PM3Config2D_Blocking (1<<18)
- #define PM3Config2D_ExternalSourceData (1<<19)
- #define PM3Config2D_LUTModeEnable (1<<20)
-#define PM3DownloadGlyphwidth 0xb658
- #define PM3DownloadGlyphwidth_GlyphWidth(gw) ((gw)&0xffff)
-#define PM3DownloadTarget 0xb650
- #define PM3DownloadTarget_TagName(tag) ((tag)&0x1fff)
-#define PM3GlyphData 0xb660
-#define PM3GlyphPosition 0xb608
- #define PM3GlyphPosition_XOffset(x) ((x)&0xffff)
- #define PM3GlyphPosition_YOffset(y) (((y)&0xffff)<<16)
-#define PM3Packed4Pixels 0xb668
-#define PM3Packed8Pixels 0xb630
-#define PM3Packed16Pixels 0xb638
-#define PM3RectanglePosition 0xb600
- #define PM3RectanglePosition_XOffset(x) ((x)&0xffff)
- #define PM3RectanglePosition_YOffset(y) (((y)&0xffff)<<16)
-#define PM3Render2D 0xb640
- #define PM3Render2D_Width(w) ((w)&0x0fff)
- #define PM3Render2D_Operation_Normal (0<<12)
- #define PM3Render2D_Operation_SyncOnHostData (1<<12)
- #define PM3Render2D_Operation_SyncOnBitMask (2<<12)
- #define PM3Render2D_Operation_PatchOrderRendering (3<<12)
- #define PM3Render2D_FBSourceReadEnable (1<<14)
- #define PM3Render2D_SpanOperation (1<<15)
- #define PM3Render2D_Height(h) (((h)&0x0fff)<<16)
- #define PM3Render2D_XPositive (1<<28)
- #define PM3Render2D_YPositive (1<<29)
- #define PM3Render2D_AreaStippleEnable (1<<30)
- #define PM3Render2D_TextureEnable (1<<31)
-#define PM3Render2DGlyph 0xb648
- #define PM3Render2DGlyph_Width(w) ((w)&0x7f)
- #define PM3Render2DGlyph_Height(h) (((h)&0x7f)<<7)
- #define PM3Render2DGlyph_XOffset(x) (((x)&0x1ff)<<14)
- #define PM3Render2DGlyph_YOffset(y) (((y)&0x1ff)<<23)
-#define PM3RenderPatchOffset 0xb610
- #define PM3RenderPatchOffset_XOffset(x) ((x)&0xffff)
- #define PM3RenderPatchOffset_YOffset(y) (((y)&0xffff)<<16)
-#define PM3RLCount 0xb678
- #define PM3RLCount_Count(c) ((c)&0x0fff)
-#define PM3RLData 0xb670
-
-/**********************************************
-* GLINT Permedia3 Alias Register *
-***********************************************/
-#define PM3FillBackgroundColor 0x8330
-#define PM3FillConfig2D0 0x8338
-#define PM3FillConfig2D1 0x8360
- #define PM3FillConfig2D_OpaqueSpan 1<<0
- #define PM3FillConfig2D_MultiRXBlit 1<<1
- #define PM3FillConfig2D_UserScissorEnable 1<<2
- #define PM3FillConfig2D_FBDestReadEnable 1<<3
- #define PM3FillConfig2D_AlphaBlendEnable 1<<4
- #define PM3FillConfig2D_DitherEnable 1<<5
- #define PM3FillConfig2D_ForegroundROPEnable 1<<6
- #define PM3FillConfig2D_ForegroundROP(rop) (((rop)&0xf)<<7)
- #define PM3FillConfig2D_BackgroundROPEnable 1<<11
- #define PM3FillConfig2D_BackgroundROP(rop) (((rop)&0xf)<<12)
- #define PM3FillConfig2D_UseConstantSource 1<<16
- #define PM3FillConfig2D_FBWriteEnable 1<<17
- #define PM3FillConfig2D_Blocking 1<<18
- #define PM3FillConfig2D_ExternalSourceData 1<<19
- #define PM3FillConfig2D_LUTModeEnable 1<<20
-#define PM3FillFBDestReadBufferAddr 0x8310
-#define PM3FillFBSourceReadBufferAddr 0x8308
-#define PM3FillFBSourceReadBufferOffset 0x8340
- #define PM3FillFBSourceReadBufferOffset_XOffset(x) ((x)&0xffff)
- #define PM3FillFBSourceReadBufferOffset_YOffset(y) (((y)&0xffff)<<16)
-#define PM3FillFBWriteBufferAddr 0x8300
-#define PM3FillForegroundColor0 0x8328
-#define PM3FillForegroundColor1 0x8358
-#define PM3FillGlyphPosition 0x8368
- #define PM3FillGlyphPosition_XOffset(x) ((x)&0xffff)
- #define PM3FillGlyphPosition_YOffset(y) (((y)&0xffff)<<16)
-#define PM3FillRectanglePosition 0x8348
- #define PM3FillRectanglePosition_XOffset(x) ((x)&0xffff)
- #define PM3FillRectanglePosition_YOffset(y) (((y)&0xffff)<<16)
-
-/**********************************************
-* GLINT Permedia3 Macros *
-***********************************************/
-
-#ifdef __alpha__
-#define mem_barrier() asm volatile ("mb" : : : "memory")
-#define write_mem_barrier() asm volatile ("wmb" : : : "memory")
-#else
-#define mem_barrier()
-#define write_mem_barrier()
-#endif
-
-extern void *pm3_reg_base;
-
-#define WRITE_REG(offset,val) \
- do { \
- write_mem_barrier(); \
- *(volatile uint32_t *) \
- (((unsigned char *)(pm3_reg_base)) + offset) = (val); \
- } while(0)
-
-static inline uint32_t
-READ_REG(uint32_t offset)
-{
- mem_barrier();
- return *(volatile uint32_t *)(((unsigned char *)(pm3_reg_base)) + offset);
-}
-
-#define UPDATE_SET_REG(offset,val) \
- { \
- unsigned long temp; \
- temp = READ_REG(offset); \
- WRITE_REG(offset,temp|(val)); \
- }
-
-#define UPDATE_CLEAR_REG(offset,val) \
- { \
- unsigned long temp; \
- temp = READ_REG(offset); \
- WRITE_REG(offset,temp&(~(val))); \
- }
-
-#define WAIT_FIFO(n) while(READ_REG(PM3InFIFOSpace) < (n))
-
-#define RAMDAC_DELAY(x) do { \
- int delay = x; \
- unsigned char tmp; \
- while(delay--){tmp = READ_REG(PM3InFIFOSpace);}; \
-} while(0)
-
-#define SLOW_WRITE_REG(v,r) \
-do{ \
- RAMDAC_DELAY(5); \
- WRITE_REG(v,r); \
- RAMDAC_DELAY(5); \
-}while(0)
-
-#define RAMDAC_SET_INDEX(index) \
-{ \
- SLOW_WRITE_REG (PM3RD_IndexHigh,(index>>8)&0xff); \
- SLOW_WRITE_REG (PM3RD_IndexLow,index&0xff); \
-}
-
-#define RAMDAC_SET_REG(index, data) \
-{ \
- RAMDAC_SET_INDEX(index); \
- SLOW_WRITE_REG(PM3RD_IndexedData, data); \
-}
-
-#define RAMDAC_GET_REG(index, temp) \
-{ \
- RAMDAC_SET_INDEX(index); \
- temp = READ_REG(PM3RD_IndexedData); \
-}
-
-#endif /* _PM3_REG_H_ */
diff --git a/src/video_out/vidix/drivers/pm3_vid.c b/src/video_out/vidix/drivers/pm3_vid.c
deleted file mode 100644
index 72a6523b3..000000000
--- a/src/video_out/vidix/drivers/pm3_vid.c
+++ /dev/null
@@ -1,573 +0,0 @@
-/**
- Driver for 3DLabs GLINT R3 and Permedia3 chips.
-
- Copyright (C) 2002, 2003 Måns Rullgård
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-**/
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <inttypes.h>
-#include <unistd.h>
-#include <sys/mman.h>
-
-#include "vidix.h"
-#include "fourcc.h"
-#include "libdha.h"
-#include "pci_ids.h"
-#include "pci_names.h"
-
-#include "pm3_regs.h"
-
-#define VIDIX_STATIC pm3_
-
-/* MBytes of video memory to use */
-#define PM3_VIDMEM 24
-
-#if 0
-#define TRACE_ENTER() fprintf(stderr, "%s: enter\n", __FUNCTION__)
-#define TRACE_EXIT() fprintf(stderr, "%s: exit\n", __FUNCTION__)
-#else
-#define TRACE_ENTER()
-#define TRACE_EXIT()
-#endif
-
-static pciinfo_t pci_info;
-
-void *pm3_reg_base;
-static void *pm3_mem;
-
-static int pm3_vidmem = PM3_VIDMEM;
-static int pm3_blank = 0;
-static int pm3_dma = 0;
-
-static int pm3_ckey_red, pm3_ckey_green, pm3_ckey_blue;
-
-static u_int page_size;
-
-static vidix_capability_t pm3_cap =
-{
- "3DLabs GLINT R3/Permedia3 driver",
- "Måns Rullgård <mru@users.sf.net>",
- TYPE_OUTPUT,
- { 0, 0, 0, 0 },
- 2048,
- 2048,
- 4,
- 4,
- -1,
- FLAG_UPSCALER | FLAG_DOWNSCALER,
- VENDOR_3DLABS,
- -1,
- { 0, 0, 0, 0 }
-};
-
-
-unsigned int VIDIX_NAME(vixGetVersion)(void)
-{
- return(VIDIX_VERSION);
-}
-
-static unsigned short pm3_card_ids[] =
-{
- DEVICE_3DLABS_GLINT_R3
-};
-
-static int find_chip(unsigned chip_id)
-{
- unsigned i;
- for(i = 0;i < sizeof(pm3_card_ids)/sizeof(unsigned short);i++)
- {
- if(chip_id == pm3_card_ids[i]) return i;
- }
- return -1;
-}
-
-int VIDIX_NAME(vixProbe)(int verbose, int force)
-{
- pciinfo_t lst[MAX_PCI_DEVICES];
- unsigned i,num_pci;
- int err;
-
- err = pci_scan(lst,&num_pci);
- if(err)
- {
- printf("[pm3] Error occured during pci scan: %s\n",strerror(err));
- return err;
- }
- else
- {
- err = ENXIO;
- for(i=0; i < num_pci; i++)
- {
- if(lst[i].vendor == VENDOR_3DLABS)
- {
- int idx;
- const char *dname;
- idx = find_chip(lst[i].device);
- if(idx == -1)
- continue;
- dname = pci_device_name(VENDOR_3DLABS, lst[i].device);
- dname = dname ? dname : "Unknown chip";
- printf("[pm3] Found chip: %s with IRQ %i\n",
- dname, lst[i].irq);
- pm3_cap.device_id = lst[i].device;
- err = 0;
- memcpy(&pci_info, &lst[i], sizeof(pciinfo_t));
- break;
- }
- }
- }
- if(err && verbose) printf("[pm3] Can't find chip\n");
- return err;
-}
-
-#define PRINT_REG(reg) \
-{ \
- long _foo = READ_REG(reg); \
- printf("[pm3] " #reg " (%x) = %#lx (%li)\n", reg, _foo, _foo); \
-}
-
-int VIDIX_NAME(vixInit)(const char *args)
-{
- if(args != NULL){
- char *ac = strdup(args), *s, *opt;
-
- opt = strtok_r(ac, ",", &s);
- while(opt){
- char *a = strchr(opt, '=');
-
- if(a)
- *a++ = 0;
- if(!strcmp(opt, "mem")){
- if(a)
- pm3_vidmem = strtol(a, NULL, 0);
- } else if(!strcmp(opt, "blank")){
- pm3_blank = a? strtol(a, NULL, 0): 1;
- }
-
- opt = strtok_r(NULL, ",", &s);
- }
-
- free(ac);
- }
-
- pm3_reg_base = map_phys_mem(pci_info.base0, 0x20000);
- pm3_mem = map_phys_mem(pci_info.base1, 0x2000000);
-
- if(bm_open() == 0){
- fprintf(stderr, "[pm3] DMA available.\n");
- pm3_cap.flags |= FLAG_DMA | FLAG_SYNC_DMA;
- page_size = sysconf(_SC_PAGESIZE);
- hwirq_install(pci_info.bus, pci_info.card, pci_info.func,
- 0, PM3IntFlags, -1);
- WRITE_REG(PM3IntEnable, (1 << 7));
- pm3_dma = 1;
- }
-
- RAMDAC_GET_REG(PM3RD_VideoOverlayKeyR, pm3_ckey_red);
- RAMDAC_GET_REG(PM3RD_VideoOverlayKeyG, pm3_ckey_green);
- RAMDAC_GET_REG(PM3RD_VideoOverlayKeyB, pm3_ckey_blue);
-
- return 0;
-}
-
-void VIDIX_NAME(vixDestroy)(void)
-{
- if(pm3_dma)
- WRITE_REG(PM3IntEnable, 0);
-
- RAMDAC_SET_REG(PM3RD_VideoOverlayKeyR, pm3_ckey_red);
- RAMDAC_SET_REG(PM3RD_VideoOverlayKeyG, pm3_ckey_green);
- RAMDAC_SET_REG(PM3RD_VideoOverlayKeyB, pm3_ckey_blue);
-
- unmap_phys_mem(pm3_reg_base, 0x20000);
- unmap_phys_mem(pm3_mem, 0x2000000);
- hwirq_uninstall(pci_info.bus, pci_info.card, pci_info.func);
- bm_close();
-}
-
-int VIDIX_NAME(vixGetCapability)(vidix_capability_t *to)
-{
- memcpy(to, &pm3_cap, sizeof(vidix_capability_t));
- return 0;
-}
-
-static int is_supported_fourcc(uint32_t fourcc)
-{
- switch(fourcc){
- case IMGFMT_YUY2:
- case IMGFMT_UYVY:
- return 1;
- default:
- return 0;
- }
-}
-
-int VIDIX_NAME(vixQueryFourcc)(vidix_fourcc_t *to)
-{
- if(is_supported_fourcc(to->fourcc))
- {
- to->depth = VID_DEPTH_1BPP | VID_DEPTH_2BPP |
- VID_DEPTH_4BPP | VID_DEPTH_8BPP |
- VID_DEPTH_12BPP| VID_DEPTH_15BPP|
- VID_DEPTH_16BPP| VID_DEPTH_24BPP|
- VID_DEPTH_32BPP;
- to->flags = VID_CAP_EXPAND | VID_CAP_SHRINK | VID_CAP_COLORKEY;
- return 0;
- }
- else to->depth = to->flags = 0;
- return ENOSYS;
-}
-
-static int frames[VID_PLAY_MAXFRAMES], vid_base;
-static int overlay_mode, overlay_control, video_control, int_enable;
-static int rdoverlay_mode;
-static int src_w, drw_w;
-static int src_h, drw_h;
-static int drw_x, drw_y;
-
-#define FORMAT_RGB8888 PM3VideoOverlayMode_COLORFORMAT_RGB8888
-#define FORMAT_RGB4444 PM3VideoOverlayMode_COLORFORMAT_RGB4444
-#define FORMAT_RGB5551 PM3VideoOverlayMode_COLORFORMAT_RGB5551
-#define FORMAT_RGB565 PM3VideoOverlayMode_COLORFORMAT_RGB565
-#define FORMAT_RGB332 PM3VideoOverlayMode_COLORFORMAT_RGB332
-#define FORMAT_BGR8888 PM3VideoOverlayMode_COLORFORMAT_BGR8888
-#define FORMAT_BGR4444 PM3VideoOverlayMode_COLORFORMAT_BGR4444
-#define FORMAT_BGR5551 PM3VideoOverlayMode_COLORFORMAT_BGR5551
-#define FORMAT_BGR565 PM3VideoOverlayMode_COLORFORMAT_BGR565
-#define FORMAT_BGR332 PM3VideoOverlayMode_COLORFORMAT_BGR332
-#define FORMAT_CI8 PM3VideoOverlayMode_COLORFORMAT_CI8
-#define FORMAT_VUY444 PM3VideoOverlayMode_COLORFORMAT_VUY444
-#define FORMAT_YUV444 PM3VideoOverlayMode_COLORFORMAT_YUV444
-#define FORMAT_VUY422 PM3VideoOverlayMode_COLORFORMAT_VUY422
-#define FORMAT_YUV422 PM3VideoOverlayMode_COLORFORMAT_YUV422
-
-/* Notice, have to check that we dont overflow the deltas here ... */
-static void
-compute_scale_factor(int* src_w, int* dst_w,
- u_int* shrink_delta, u_int* zoom_delta)
-{
- /* NOTE: If we don't return reasonable values here then the video
- * unit can potential shut off and won't display an image until re-enabled.
- * Seems as though the zoom_delta is o.k, and I've not had the problem.
- * The 'shrink_delta' is prone to this the most - FIXME ! */
-
- if (*src_w >= *dst_w) {
- *src_w &= ~0x3;
- *dst_w &= ~0x3;
- *shrink_delta = (((*src_w << 16) / *dst_w) + 0x0f) & 0x0ffffff0;
- *zoom_delta = 1<<16;
- if ( ((*shrink_delta * *dst_w) >> 16) & 0x03 )
- *shrink_delta += 0x10;
- } else {
- *src_w &= ~0x3;
- *dst_w &= ~0x3;
- *zoom_delta = (((*src_w << 16) / *dst_w) + 0x0f) & 0x0001fff0;
- *shrink_delta = 1<<16;
- if ( ((*zoom_delta * *dst_w) >> 16) & 0x03 )
- *zoom_delta += 0x10;
- }
-}
-
-static void
-pm3_setup_overlay(vidix_playback_t *info)
-{
- u_int shrink, zoom;
- int format = 0;
- int filter = 0;
- int sw = src_w;
-
- switch(info->fourcc){
- case IMGFMT_YUY2:
- format = FORMAT_YUV422;
- break;
- case IMGFMT_UYVY:
- format = FORMAT_VUY422;
- break;
- }
-
- compute_scale_factor(&sw, &drw_w, &shrink, &zoom);
-
- WAIT_FIFO(9);
- WRITE_REG(PM3VideoOverlayBase0, vid_base >> 1);
- WRITE_REG(PM3VideoOverlayStride, PM3VideoOverlayStride_STRIDE(src_w));
- WRITE_REG(PM3VideoOverlayWidth, PM3VideoOverlayWidth_WIDTH(sw));
- WRITE_REG(PM3VideoOverlayHeight, PM3VideoOverlayHeight_HEIGHT(src_h));
- WRITE_REG(PM3VideoOverlayOrigin, 0);
-
- /* Scale the source to the destinationsize */
- if (src_w == drw_w) {
- WRITE_REG(PM3VideoOverlayShrinkXDelta, 1<<16);
- WRITE_REG(PM3VideoOverlayZoomXDelta, 1<<16);
- } else {
- WRITE_REG(PM3VideoOverlayShrinkXDelta, shrink);
- WRITE_REG(PM3VideoOverlayZoomXDelta, zoom);
- filter = PM3VideoOverlayMode_FILTER_PARTIAL;
- }
- if (src_h == drw_h) {
- WRITE_REG(PM3VideoOverlayYDelta, PM3VideoOverlayYDelta_NONE);
- } else {
- WRITE_REG(PM3VideoOverlayYDelta,
- PM3VideoOverlayYDelta_DELTA(src_h, drw_h));
- filter = PM3VideoOverlayMode_FILTER_FULL;
- }
-
- WRITE_REG(PM3VideoOverlayIndex, 0);
-
- /* Now set the ramdac video overlay region and mode */
- RAMDAC_SET_REG(PM3RD_VideoOverlayXStartLow, (drw_x & 0xff));
- RAMDAC_SET_REG(PM3RD_VideoOverlayXStartHigh, (drw_x & 0xf00)>>8);
- RAMDAC_SET_REG(PM3RD_VideoOverlayXEndLow, (drw_x+drw_w) & 0xff);
- RAMDAC_SET_REG(PM3RD_VideoOverlayXEndHigh,
- ((drw_x+drw_w) & 0xf00)>>8);
- RAMDAC_SET_REG(PM3RD_VideoOverlayYStartLow, (drw_y & 0xff));
- RAMDAC_SET_REG(PM3RD_VideoOverlayYStartHigh, (drw_y & 0xf00)>>8);
- RAMDAC_SET_REG(PM3RD_VideoOverlayYEndLow, (drw_y+drw_h) & 0xff);
- RAMDAC_SET_REG(PM3RD_VideoOverlayYEndHigh,
- ((drw_y+drw_h) & 0xf00)>>8);
-
- overlay_mode =
- 1 << 5 |
- format |
- filter |
- PM3VideoOverlayMode_BUFFERSYNC_MANUAL |
- PM3VideoOverlayMode_FLIP_VIDEO;
-
- overlay_control =
- PM3RD_VideoOverlayControl_KEY_COLOR |
- PM3RD_VideoOverlayControl_DIRECTCOLOR_ENABLED;
-}
-
-extern int
-VIDIX_NAME(vixSetGrKeys)(const vidix_grkey_t *key)
-{
- if(key->ckey.op == CKEY_TRUE){
- RAMDAC_SET_REG(PM3RD_VideoOverlayKeyR, key->ckey.red);
- RAMDAC_SET_REG(PM3RD_VideoOverlayKeyG, key->ckey.green);
- RAMDAC_SET_REG(PM3RD_VideoOverlayKeyB, key->ckey.blue);
- rdoverlay_mode = PM3RD_VideoOverlayControl_MODE_MAINKEY;
- } else {
- rdoverlay_mode = PM3RD_VideoOverlayControl_MODE_ALWAYS;
- }
- RAMDAC_SET_REG(PM3RD_VideoOverlayControl,
- overlay_control | rdoverlay_mode);
-
- return 0;
-}
-
-extern int
-VIDIX_NAME(vixGetGrKeys)(vidix_grkey_t *key)
-{
- RAMDAC_GET_REG(PM3RD_VideoOverlayKeyR, key->ckey.red);
- RAMDAC_GET_REG(PM3RD_VideoOverlayKeyG, key->ckey.green);
- RAMDAC_GET_REG(PM3RD_VideoOverlayKeyB, key->ckey.blue);
- return 0;
-}
-
-extern int
-VIDIX_NAME(vixConfigPlayback)(vidix_playback_t *info)
-{
- unsigned int i;
- u_int frame_size;
- u_int vidmem_size;
- u_int max_frames;
-
- TRACE_ENTER();
-
- src_w = info->src.w;
- src_h = info->src.h;
- drw_w = info->dest.w;
- drw_h = info->dest.h;
- drw_x = info->dest.x;
- drw_y = info->dest.y;
-
- frame_size = src_w * src_h * 2;
- vidmem_size = pm3_vidmem*1024*1024;
- max_frames = vidmem_size / frame_size;
- if(max_frames > VID_PLAY_MAXFRAMES)
- max_frames = VID_PLAY_MAXFRAMES;
-
- src_h--; /* ugh */
-
- if(info->num_frames > max_frames)
- info->num_frames = max_frames;
- vidmem_size = info->num_frames * frame_size;
-
- /* Use end of video memory. Assume the card has 32 MB */
- vid_base = 32*1024*1024 - vidmem_size;
- info->dga_addr = pm3_mem + vid_base;
-
- info->dest.pitch.y = 2;
- info->dest.pitch.u = 0;
- info->dest.pitch.v = 0;
- info->offset.y = 0;
- info->offset.v = 0;
- info->offset.u = 0;
- info->frame_size = frame_size;
-
- for(i = 0; i < info->num_frames; i++){
- info->offsets[i] = frame_size * i;
- frames[i] = (vid_base + info->offsets[i]) >> 1;
- }
-
- pm3_setup_overlay(info);
-
- video_control = READ_REG(PM3VideoControl);
- int_enable = READ_REG(PM3IntEnable);
-
- TRACE_EXIT();
- return 0;
-}
-
-int VIDIX_NAME(vixPlaybackOn)(void)
-{
- TRACE_ENTER();
-
- WRITE_REG(PM3VideoOverlayMode,
- overlay_mode | PM3VideoOverlayMode_ENABLE);
- overlay_control |= PM3RD_VideoOverlayControl_ENABLE;
- RAMDAC_SET_REG(PM3RD_VideoOverlayControl,
- overlay_control | rdoverlay_mode);
- WRITE_REG(PM3VideoOverlayUpdate, PM3VideoOverlayUpdate_ENABLE);
-
- if(pm3_blank)
- WRITE_REG(PM3VideoControl,
- video_control | PM3VideoControl_DISPLAY_ENABLE);
-
- TRACE_EXIT();
- return 0;
-}
-
-int VIDIX_NAME(vixPlaybackOff)(void)
-{
- overlay_control &= ~PM3RD_VideoOverlayControl_ENABLE;
- RAMDAC_SET_REG(PM3RD_VideoOverlayControl,
- PM3RD_VideoOverlayControl_DISABLE);
- WRITE_REG(PM3VideoOverlayMode,
- PM3VideoOverlayMode_DISABLE);
-
- if(video_control)
- WRITE_REG(PM3VideoControl,
- video_control & ~PM3VideoControl_DISPLAY_ENABLE);
-
- return 0;
-}
-
-int VIDIX_NAME(vixPlaybackFrameSelect)(unsigned int frame)
-{
- WRITE_REG(PM3VideoOverlayBase0, frames[frame]);
-
- return 0;
-}
-
-struct pm3_bydma_cmd {
- uint32_t bus_addr;
- uint32_t fb_addr;
- uint32_t mask;
- uint32_t count;
-};
-
-struct pm3_bydma_frame {
- struct pm3_bydma_cmd *cmds;
- u_long bus_addr;
- uint32_t count;
-};
-
-static struct pm3_bydma_frame *
-pm3_setup_bydma(vidix_dma_t *dma, struct pm3_bydma_frame *bdf)
-{
- u_int size = dma->size;
- u_int pages = (size + page_size-1) / page_size;
- unsigned long baddr[pages];
- u_int i;
- uint32_t dest;
-
- if(bm_virt_to_bus(dma->src, dma->size, baddr))
- return NULL;
-
- if(!bdf){
- bdf = malloc(sizeof(*bdf));
- bdf->cmds = valloc(pages * sizeof(struct pm3_bydma_cmd));
- if(dma->flags & BM_DMA_FIXED_BUFFS){
- mlock(bdf->cmds, page_size);
- }
- }
-
- dest = vid_base + dma->dest_offset;
- for(i = 0; i < pages; i++, dest += page_size, size -= page_size){
- bdf->cmds[i].bus_addr = baddr[i];
- bdf->cmds[i].fb_addr = dest;
- bdf->cmds[i].mask = ~0;
- bdf->cmds[i].count = ((size > page_size)? page_size: size) / 16;
- }
-
- bdf->count = pages;
-
- if(bm_virt_to_bus(bdf->cmds, page_size, &bdf->bus_addr) != 0){
- free(bdf->cmds);
- free(bdf);
- return NULL;
- }
-
- return bdf;
-}
-
-extern int
-VIDIX_NAME(vixPlaybackCopyFrame)(vidix_dma_t *dma)
-{
- u_int frame = dma->idx;
- struct pm3_bydma_frame *bdf;
-
- bdf = dma->internal[frame];
- if(!bdf || !(dma->flags & BM_DMA_FIXED_BUFFS))
- bdf = pm3_setup_bydma(dma, bdf);
- if(!bdf)
- return -1;
-
- if(!dma->internal[frame])
- dma->internal[frame] = bdf;
-
- if(dma->flags & BM_DMA_SYNC){
- hwirq_wait(pci_info.irq);
- }
-
- WAIT_FIFO(3);
- WRITE_REG(PM3ByDMAReadCommandBase, bdf->bus_addr);
- WRITE_REG(PM3ByDMAReadCommandCount, bdf->count);
- WRITE_REG(PM3ByDMAReadMode,
- PM3ByDMAReadMode_ByteSwap_NONE |
- PM3ByDMAReadMode_Format_RAW |
- PM3ByDMAReadMode_PixelSize(16) |
- PM3ByDMAReadMode_Active |
- PM3ByDMAReadMode_Burst(7) |
- PM3ByDMAReadMode_Align);
-
- if(dma->flags & BM_DMA_BLOCK){
- hwirq_wait(pci_info.irq);
- }
-
- return 0;
-}
-
-extern int
-VIDIX_NAME(vixQueryDMAStatus)(void)
-{
- uint32_t bdm = READ_REG(PM3ByDMAReadMode);
- return (bdm & PM3ByDMAReadMode_Active)? 1: 0;
-}
diff --git a/src/video_out/vidix/drivers/radeon.h b/src/video_out/vidix/drivers/radeon.h
deleted file mode 100644
index 090fbf8df..000000000
--- a/src/video_out/vidix/drivers/radeon.h
+++ /dev/null
@@ -1,2221 +0,0 @@
-/*
- * radeon.h
- * This software has been released under the terms of the GNU Public
- * license. See http://www.gnu.org/copyleft/gpl.html for details.
- *
- * This collection of definition was written by Nick Kurshev
- * It's based on radeonfb, X11, GATOS sources
- * and partly compatible with Rage128 set (in OV0, CAP0, CAP1 parts)
-*/
-
-#ifndef _RADEON_H
-#define _RADEON_H
-
-#define RADEON_REGSIZE 0x4000
-#define MM_INDEX 0x0000
-/* MM_INDEX bit constants */
-# define MM_APER 0x80000000
-#define MM_DATA 0x0004
-#define BUS_CNTL 0x0030
-/* BUS_CNTL bit constants */
-# define BUS_DBL_RESYNC 0x00000001
-# define BUS_MSTR_RESET 0x00000002
-# define BUS_FLUSH_BUF 0x00000004
-# define BUS_STOP_REQ_DIS 0x00000008
-# define BUS_ROTATION_DIS 0x00000010
-# define BUS_MASTER_DIS 0x00000040
-# define BUS_ROM_WRT_EN 0x00000080
-# define BUS_DIS_ROM 0x00001000
-# define BUS_PCI_READ_RETRY_EN 0x00002000
-# define BUS_AGP_AD_STEPPING_EN 0x00004000
-# define BUS_PCI_WRT_RETRY_EN 0x00008000
-# define BUS_MSTR_RD_MULT 0x00100000
-# define BUS_MSTR_RD_LINE 0x00200000
-# define BUS_SUSPEND 0x00400000
-# define LAT_16X 0x00800000
-# define BUS_RD_DISCARD_EN 0x01000000
-# define BUS_RD_ABORT_EN 0x02000000
-# define BUS_MSTR_WS 0x04000000
-# define BUS_PARKING_DIS 0x08000000
-# define BUS_MSTR_DISCONNECT_EN 0x10000000
-# define BUS_WRT_BURST 0x20000000
-# define BUS_READ_BURST 0x40000000
-# define BUS_RDY_READ_DLY 0x80000000
-#define HI_STAT 0x004C
-#define BUS_CNTL1 0x0034
-# define BUS_WAIT_ON_LOCK_EN (1 << 4)
-#define I2C_CNTL_0 0x0090
-# define I2C_DONE (1<<0)
-# define I2C_NACK (1<<1)
-# define I2C_HALT (1<<2)
-# define I2C_SOFT_RST (1<<5)
-# define I2C_DRIVE_EN (1<<6)
-# define I2C_DRIVE_SEL (1<<7)
-# define I2C_START (1<<8)
-# define I2C_STOP (1<<9)
-# define I2C_RECEIVE (1<<10)
-# define I2C_ABORT (1<<11)
-# define I2C_GO (1<<12)
-# define I2C_SEL (1<<16)
-# define I2C_EN (1<<17)
-#define I2C_CNTL_1 0x0094
-#define I2C_DATA 0x0098
-#define CONFIG_CNTL 0x00E0
-/* CONFIG_CNTL bit constants */
-# define CFG_VGA_RAM_EN 0x00000100
-#ifdef RAGE128
-#define GEN_RESET_CNTL 0x00f0
-# define SOFT_RESET_GUI 0x00000001
-# define SOFT_RESET_VCLK 0x00000100
-# define SOFT_RESET_PCLK 0x00000200
-# define SOFT_RESET_ECP 0x00000400
-# define SOFT_RESET_DISPENG_XCLK 0x00000800
-# define SOFT_RESET_MEMCTLR_XCLK 0x00001000
-#endif
-#define CONFIG_MEMSIZE 0x00F8
-#define CONFIG_APER_0_BASE 0x0100
-#define CONFIG_APER_1_BASE 0x0104
-#define CONFIG_APER_SIZE 0x0108
-#define CONFIG_REG_1_BASE 0x010C
-#define CONFIG_REG_APER_SIZE 0x0110
-#define PAD_AGPINPUT_DELAY 0x0164
-#define PAD_CTLR_STRENGTH 0x0168
-#define PAD_CTLR_UPDATE 0x016C
-#define AGP_CNTL 0x0174
-# define AGP_APER_SIZE_256MB (0x00 << 0)
-# define AGP_APER_SIZE_128MB (0x20 << 0)
-# define AGP_APER_SIZE_64MB (0x30 << 0)
-# define AGP_APER_SIZE_32MB (0x38 << 0)
-# define AGP_APER_SIZE_16MB (0x3c << 0)
-# define AGP_APER_SIZE_8MB (0x3e << 0)
-# define AGP_APER_SIZE_4MB (0x3f << 0)
-# define AGP_APER_SIZE_MASK (0x3f << 0)
-#define AMCGPIO_A_REG 0x01a0
-#define AMCGPIO_EN_REG 0x01a8
-#define AMCGPIO_MASK 0x0194
-#define AMCGPIO_Y_REG 0x01a4
-/*#define BM_STATUS 0x0160*/
-#define MPP_TB_CONFIG 0x01c0 /* ? */
-#define MPP_GP_CONFIG 0x01c8 /* ? */
-#define VENDOR_ID 0x0F00
-#define DEVICE_ID 0x0F02
-#define COMMAND 0x0F04
-#define STATUS 0x0F06
-#define REVISION_ID 0x0F08
-#define REGPROG_INF 0x0F09
-#define SUB_CLASS 0x0F0A
-#define CACHE_LINE 0x0F0C
-#define LATENCY 0x0F0D
-#define HEADER 0x0F0E
-#define BIST 0x0F0F
-#define REG_MEM_BASE 0x0F10
-#define REG_IO_BASE 0x0F14
-#define REG_REG_BASE 0x0F18
-#define ADAPTER_ID 0x0F2C
-#define BIOS_ROM 0x0F30
-#define CAPABILITIES_PTR 0x0F34
-#define INTERRUPT_LINE 0x0F3C
-#define INTERRUPT_PIN 0x0F3D
-#define MIN_GRANT 0x0F3E
-#define MAX_LATENCY 0x0F3F
-#define ADAPTER_ID_W 0x0F4C
-#define PMI_CAP_ID 0x0F50
-#define PMI_NXT_CAP_PTR 0x0F51
-#define PMI_PMC_REG 0x0F52
-#define PM_STATUS 0x0F54
-#define PMI_DATA 0x0F57
-#define AGP_CAP_ID 0x0F58
-#define AGP_STATUS 0x0F5C
-# define AGP_1X_MODE 0x01
-# define AGP_2X_MODE 0x02
-# define AGP_4X_MODE 0x04
-# define AGP_MODE_MASK 0x07
-#define AGP_COMMAND 0x0F60
-
-/* Video muxer unit */
-#define VIDEOMUX_CNTL 0x0190
-#define VIPPAD_MASK 0x0198
-#define VIPPAD1_A 0x01AC
-#define VIPPAD1_EN 0x01B0
-#define VIPPAD1_Y 0x01B4
-
-#define AIC_CTRL 0x01D0
-#define AIC_STAT 0x01D4
-#define AIC_PT_BASE 0x01D8
-#define AIC_LO_ADDR 0x01DC
-#define AIC_HI_ADDR 0x01E0
-#define AIC_TLB_ADDR 0x01E4
-#define AIC_TLB_DATA 0x01E8
-#define DAC_CNTL 0x0058
-/* DAC_CNTL bit constants */
-# define DAC_RANGE_CNTL_MSK 0x00000003
-# define DAC_RANGE_PAL 0x00000000
-# define DAC_RANGE_NTSC 0x00000001
-# define DAC_RANGE_PS2 0x00000002
-# define DAC_BLANKING 0x00000004
-# define DAC_CMP_EN 0x00000008
-# define DAC_CMP_OUTPUT 0x00000080
-# define DAC_8BIT_EN 0x00000100
-# define DAC_4BPP_PIX_ORDER 0x00000200
-# define DAC_TVO_EN 0x00000400
-# define DAC_TVO_OVR_EXCL 0x00000800
-# define DAC_TVO_16BPP_DITH_EN 0x00001000
-# define DAC_VGA_ADR_EN (1 << 13)
-# define DAC_PWDN (1 << 15)
-# define DAC_CRC_EN 0x00080000
-# define DAC_MASK_ALL (0xff << 24)
-# define DAC_RANGE_CNTL (3 << 0)
-#define DAC_CNTL2 0x007c
-/* DAC_CNTL2 bit constants */
-# define DAC2_DAC_CLK_SEL (1 << 0)
-# define DAC2_DAC2_CLK_SEL (1 << 1)
-# define DAC2_PALETTE_ACC_CTL (1 << 5)
-#define TV_DAC_CNTL 0x088c
-/* TV_DAC_CNTL bit constants */
-# define TV_DAC_STD_MASK 0x0300
-# define TV_DAC_RDACPD (1 << 24)
-# define TV_DAC_GDACPD (1 << 25)
-# define TV_DAC_BDACPD (1 << 26)
-#define CRTC_GEN_CNTL 0x0050
-/* CRTC_GEN_CNTL bit constants */
-# define CRTC_DBL_SCAN_EN 0x00000001
-# define CRTC_INTERLACE_EN (1 << 1)
-# define CRTC_CSYNC_EN (1 << 4)
-# define CRTC_CUR_EN 0x00010000
-# define CRTC_CUR_MODE_MASK (7 << 17)
-# define CRTC_ICON_EN (1 << 20)
-# define CRTC_EXT_DISP_EN (1 << 24)
-# define CRTC_EN (1 << 25)
-# define CRTC_DISP_REQ_EN_B (1 << 26)
-#define CRTC2_GEN_CNTL 0x03f8
-/* CRTC2_GEN_CNTL bit constants */
-# define CRTC2_DBL_SCAN_EN (1 << 0)
-# define CRTC2_INTERLACE_EN (1 << 1)
-# define CRTC2_SYNC_TRISTAT (1 << 4)
-# define CRTC2_HSYNC_TRISTAT (1 << 5)
-# define CRTC2_VSYNC_TRISTAT (1 << 6)
-# define CRTC2_CRT2_ON (1 << 7)
-# define CRTC2_ICON_EN (1 << 15)
-# define CRTC2_CUR_EN (1 << 16)
-# define CRTC2_CUR_MODE_MASK (7 << 20)
-# define CRTC2_DISP_DIS (1 << 23)
-# define CRTC2_EN (1 << 25)
-# define CRTC2_DISP_REQ_EN_B (1 << 26)
-# define CRTC2_HSYNC_DIS (1 << 28)
-# define CRTC2_VSYNC_DIS (1 << 29)
-#define MEM_CNTL 0x0140
-/* MEM_CNTL bit constants */
-# define MEM_CTLR_STATUS_IDLE 0x00000000
-# define MEM_CTLR_STATUS_BUSY 0x00100000
-# define MEM_SEQNCR_STATUS_IDLE 0x00000000
-# define MEM_SEQNCR_STATUS_BUSY 0x00200000
-# define MEM_ARBITER_STATUS_IDLE 0x00000000
-# define MEM_ARBITER_STATUS_BUSY 0x00400000
-# define MEM_REQ_UNLOCK 0x00000000
-# define MEM_REQ_LOCK 0x00800000
-#define EXT_MEM_CNTL 0x0144
-#define MC_AGP_LOCATION 0x014C
-#define MEM_IO_CNTL_A0 0x0178
-#define MEM_INIT_LATENCY_TIMER 0x0154
-#define MEM_SDRAM_MODE_REG 0x0158
-#define AGP_BASE 0x0170
-#ifdef RAGE128
-#define PCI_GART_PAGE 0x017c
-#define PC_NGUI_MODE 0x0180
-#define PC_NGUI_CTLSTAT 0x0184
-# define PC_FLUSH_GUI (3 << 0)
-# define PC_RI_GUI (1 << 2)
-# define PC_FLUSH_ALL 0x00ff
-# define PC_BUSY (1 << 31)
-#define PC_MISC_CNTL 0x0188
-#else
-#define MEM_IO_CNTL_A1 0x017C
-#define MEM_IO_CNTL_B0 0x0180
-#define MEM_IO_CNTL_B1 0x0184
-#define MC_DEBUG 0x0188
-#endif
-#define MC_STATUS 0x0150
-#define MEM_IO_OE_CNTL 0x018C
-#define MC_FB_LOCATION 0x0148
-#define HOST_PATH_CNTL 0x0130
-#define MEM_VGA_WP_SEL 0x0038
-#define MEM_VGA_RP_SEL 0x003C
-#define HDP_DEBUG 0x0138
-#define SW_SEMAPHORE 0x013C
-#define SURFACE_CNTL 0x0B00
-/* SURFACE_CNTL bit constants */
-# define SURF_TRANSLATION_DIS (1 << 8)
-# define NONSURF_AP0_SWP_16BPP (1 << 20)
-# define NONSURF_AP0_SWP_32BPP (2 << 20)
-#define SURFACE0_LOWER_BOUND 0x0B04
-#define SURFACE1_LOWER_BOUND 0x0B14
-#define SURFACE2_LOWER_BOUND 0x0B24
-#define SURFACE3_LOWER_BOUND 0x0B34
-#define SURFACE4_LOWER_BOUND 0x0B44
-#define SURFACE5_LOWER_BOUND 0x0B54
-#define SURFACE6_LOWER_BOUND 0x0B64
-#define SURFACE7_LOWER_BOUND 0x0B74
-#define SURFACE0_UPPER_BOUND 0x0B08
-#define SURFACE1_UPPER_BOUND 0x0B18
-#define SURFACE2_UPPER_BOUND 0x0B28
-#define SURFACE3_UPPER_BOUND 0x0B38
-#define SURFACE4_UPPER_BOUND 0x0B48
-#define SURFACE5_UPPER_BOUND 0x0B58
-#define SURFACE6_UPPER_BOUND 0x0B68
-#define SURFACE7_UPPER_BOUND 0x0B78
-#define SURFACE0_INFO 0x0B0C
-#define SURFACE1_INFO 0x0B1C
-#define SURFACE2_INFO 0x0B2C
-#define SURFACE3_INFO 0x0B3C
-#define SURFACE4_INFO 0x0B4C
-#define SURFACE5_INFO 0x0B5C
-#define SURFACE6_INFO 0x0B6C
-#define SURFACE7_INFO 0x0B7C
-#define SURFACE_ACCESS_FLAGS 0x0BF8
-#define SURFACE_ACCESS_CLR 0x0BFC
-#define GEN_INT_CNTL 0x0040
-#define GEN_INT_STATUS 0x0044
-# define VSYNC_INT_AK (1 << 2)
-# define VSYNC_INT (1 << 2)
-#define CRTC_EXT_CNTL 0x0054
-/* CRTC_EXT_CNTL bit constants */
-# define CRTC_VGA_XOVERSCAN (1 << 0)
-# define VGA_ATI_LINEAR 0x00000008
-# define VGA_128KAP_PAGING 0x00000010
-# define XCRT_CNT_EN (1 << 6)
-# define CRTC_HSYNC_DIS (1 << 8)
-# define CRTC_VSYNC_DIS (1 << 9)
-# define CRTC_DISPLAY_DIS (1 << 10)
-# define CRTC_SYNC_TRISTAT (1 << 11)
-# define CRTC_CRT_ON (1 << 15)
-#define CRTC_EXT_CNTL_DPMS_BYTE 0x0055
-# define CRTC_HSYNC_DIS_BYTE (1 << 0)
-# define CRTC_VSYNC_DIS_BYTE (1 << 1)
-# define CRTC_DISPLAY_DIS_BYTE (1 << 2)
-#define RB3D_CNTL 0x1C3C
-#define WAIT_UNTIL 0x1720
-# define EVENT_CRTC_OFFSET 0x00000001
-# define EVENT_RE_CRTC_VLINE 0x00000002
-# define EVENT_FE_CRTC_VLINE 0x00000004
-# define EVENT_CRTC_VLINE 0x00000008
-# define EVENT_BM_VIP0_IDLE 0x00000010
-# define EVENT_BM_VIP1_IDLE 0x00000020
-# define EVENT_BM_VIP2_IDLE 0x00000040
-# define EVENT_BM_VIP3_IDLE 0x00000080
-# define EVENT_BM_VIDCAP_IDLE 0x00000100
-# define EVENT_BM_GUI_IDLE 0x00000200
-# define EVENT_CMDFIFO 0x00000400
-# define EVENT_OV0_FLIP 0x00000800
-# define EVENT_CMDFIFO_ENTRIES 0x07F00000
-#define ISYNC_CNTL 0x1724
-#define RBBM_GUICNTL 0x172C
-#define RBBM_STATUS 0x0E40
-# define RBBM_FIFOCNT_MASK 0x007f
-# define RBBM_ACTIVE (1 << 31)
-#define RBBM_STATUS_alt_1 0x1740
-#define RBBM_CNTL 0x00EC
-#define RBBM_CNTL_alt_1 0x0E44
-#define RBBM_SOFT_RESET 0x00F0
-/* RBBM_SOFT_RESET bit constants */
-# define SOFT_RESET_CP (1 << 0)
-# define SOFT_RESET_HI (1 << 1)
-# define SOFT_RESET_SE (1 << 2)
-# define SOFT_RESET_RE (1 << 3)
-# define SOFT_RESET_PP (1 << 4)
-# define SOFT_RESET_E2 (1 << 5)
-# define SOFT_RESET_RB (1 << 6)
-# define SOFT_RESET_HDP (1 << 7)
-#define RBBM_SOFT_RESET_alt_1 0x0E48
-#define NQWAIT_UNTIL 0x0E50
-#define RBBM_DEBUG 0x0E6C
-#define RBBM_CMDFIFO_ADDR 0x0E70
-#define RBBM_CMDFIFO_DATAL 0x0E74
-#define RBBM_CMDFIFO_DATAH 0x0E78
-#define RBBM_CMDFIFO_STAT 0x0E7C
-#define CRTC_STATUS 0x005C
-/* CRTC_STATUS bit constants */
-# define CRTC_VBLANK 0x00000001
-# define CRTC_VBLANK_SAVE ( 1 << 1)
-#define GPIO_VGA_DDC 0x0060
-#define GPIO_DVI_DDC 0x0064
-#define GPIO_MONID 0x0068
-#define PALETTE_INDEX 0x00B0
-#define PALETTE_DATA 0x00B4
-#define PALETTE_30_DATA 0x00B8
-#define CRTC_H_TOTAL_DISP 0x0200
-# define CRTC_H_TOTAL (0x03ff << 0)
-# define CRTC_H_TOTAL_SHIFT 0
-# define CRTC_H_DISP (0x01ff << 16)
-# define CRTC_H_DISP_SHIFT 16
-#define CRTC2_H_TOTAL_DISP 0x0300
-# define CRTC2_H_TOTAL (0x03ff << 0)
-# define CRTC2_H_TOTAL_SHIFT 0
-# define CRTC2_H_DISP (0x01ff << 16)
-# define CRTC2_H_DISP_SHIFT 16
-#define CRTC_H_SYNC_STRT_WID 0x0204
-# define CRTC_H_SYNC_STRT_PIX (0x07 << 0)
-# define CRTC_H_SYNC_STRT_CHAR (0x3ff << 3)
-# define CRTC_H_SYNC_STRT_CHAR_SHIFT 3
-# define CRTC_H_SYNC_WID (0x3f << 16)
-# define CRTC_H_SYNC_WID_SHIFT 16
-# define CRTC_H_SYNC_POL (1 << 23)
-#define CRTC2_H_SYNC_STRT_WID 0x0304
-# define CRTC2_H_SYNC_STRT_PIX (0x07 << 0)
-# define CRTC2_H_SYNC_STRT_CHAR (0x3ff << 3)
-# define CRTC2_H_SYNC_STRT_CHAR_SHIFT 3
-# define CRTC2_H_SYNC_WID (0x3f << 16)
-# define CRTC2_H_SYNC_WID_SHIFT 16
-# define CRTC2_H_SYNC_POL (1 << 23)
-#define CRTC_V_TOTAL_DISP 0x0208
-# define CRTC_V_TOTAL (0x07ff << 0)
-# define CRTC_V_TOTAL_SHIFT 0
-# define CRTC_V_DISP (0x07ff << 16)
-# define CRTC_V_DISP_SHIFT 16
-#define CRTC2_V_TOTAL_DISP 0x0308
-# define CRTC2_V_TOTAL (0x07ff << 0)
-# define CRTC2_V_TOTAL_SHIFT 0
-# define CRTC2_V_DISP (0x07ff << 16)
-# define CRTC2_V_DISP_SHIFT 16
-#define CRTC_V_SYNC_STRT_WID 0x020C
-# define CRTC_V_SYNC_STRT (0x7ff << 0)
-# define CRTC_V_SYNC_STRT_SHIFT 0
-# define CRTC_V_SYNC_WID (0x1f << 16)
-# define CRTC_V_SYNC_WID_SHIFT 16
-# define CRTC_V_SYNC_POL (1 << 23)
-#define CRTC2_V_SYNC_STRT_WID 0x030C
-# define CRTC2_V_SYNC_STRT (0x7ff << 0)
-# define CRTC2_V_SYNC_STRT_SHIFT 0
-# define CRTC2_V_SYNC_WID (0x1f << 16)
-# define CRTC2_V_SYNC_WID_SHIFT 16
-# define CRTC2_V_SYNC_POL (1 << 23)
-#define CRTC_VLINE_CRNT_VLINE 0x0210
-# define CRTC_CRNT_VLINE_MASK (0x7ff << 16)
-#define CRTC2_VLINE_CRNT_VLINE 0x0310
-#define CRTC_CRNT_FRAME 0x0214
-#define CRTC2_CRNT_FRAME 0x0314
-#define CRTC_GUI_TRIG_VLINE 0x0218
-#define CRTC2_GUI_TRIG_VLINE 0x0318
-#define CRTC_DEBUG 0x021C
-#define CRTC2_DEBUG 0x031C
-#define CRTC_OFFSET_RIGHT 0x0220
-#define CRTC_OFFSET 0x0224
-#define CRTC2_OFFSET 0x0324
-#define CRTC_OFFSET_CNTL 0x0228
-# define CRTC_TILE_EN (1 << 15)
-#define CRTC2_OFFSET_CNTL 0x0328
-# define CRTC2_TILE_EN (1 << 15)
-#define CRTC_PITCH 0x022C
-#define CRTC2_PITCH 0x032C
-#define TMDS_CRC 0x02a0
-#define OVR_CLR 0x0230
-#define OVR_WID_LEFT_RIGHT 0x0234
-#define OVR_WID_TOP_BOTTOM 0x0238
-#define DISPLAY_BASE_ADDR 0x023C
-#define SNAPSHOT_VH_COUNTS 0x0240
-#define SNAPSHOT_F_COUNT 0x0244
-#define N_VIF_COUNT 0x0248
-#define SNAPSHOT_VIF_COUNT 0x024C
-#define FP_CRTC_H_TOTAL_DISP 0x0250
-#define FP_CRTC2_H_TOTAL_DISP 0x0350
-#define FP_CRTC_V_TOTAL_DISP 0x0254
-#define FP_CRTC2_V_TOTAL_DISP 0x0354
-# define FP_CRTC_H_TOTAL_MASK 0x000003ff
-# define FP_CRTC_H_DISP_MASK 0x01ff0000
-# define FP_CRTC_V_TOTAL_MASK 0x00000fff
-# define FP_CRTC_V_DISP_MASK 0x0fff0000
-# define FP_H_SYNC_STRT_CHAR_MASK 0x00001ff8
-# define FP_H_SYNC_WID_MASK 0x003f0000
-# define FP_V_SYNC_STRT_MASK 0x00000fff
-# define FP_V_SYNC_WID_MASK 0x001f0000
-# define FP_CRTC_H_TOTAL_SHIFT 0x00000000
-# define FP_CRTC_H_DISP_SHIFT 0x00000010
-# define FP_CRTC_V_TOTAL_SHIFT 0x00000000
-# define FP_CRTC_V_DISP_SHIFT 0x00000010
-# define FP_H_SYNC_STRT_CHAR_SHIFT 0x00000003
-# define FP_H_SYNC_WID_SHIFT 0x00000010
-# define FP_V_SYNC_STRT_SHIFT 0x00000000
-# define FP_V_SYNC_WID_SHIFT 0x00000010
-#define CRT_CRTC_H_SYNC_STRT_WID 0x0258
-#define CRT_CRTC_V_SYNC_STRT_WID 0x025C
-#define CUR_OFFSET 0x0260
-#define CUR_HORZ_VERT_POSN 0x0264
-#define CUR_HORZ_VERT_OFF 0x0268
-/* CUR_OFFSET, CUR_HORZ_VERT_POSN, CUR_HORZ_VERT_OFF bit constants */
-# define CUR_LOCK 0x80000000
-#define CUR_CLR0 0x026C
-#define CUR_CLR1 0x0270
-#define CUR2_OFFSET 0x0360
-#define CUR2_HORZ_VERT_POSN 0x0364
-#define CUR2_HORZ_VERT_OFF 0x0368
-# define CUR2_LOCK (1 << 31)
-#define CUR2_CLR0 0x036c
-#define CUR2_CLR1 0x0370
-#define FP_HORZ_VERT_ACTIVE 0x0278
-#define CRTC_MORE_CNTL 0x027C
-#define DAC_EXT_CNTL 0x0280
-#define FP_GEN_CNTL 0x0284
-/* FP_GEN_CNTL bit constants */
-# define FP_FPON (1 << 0)
-# define FP_TMDS_EN (1 << 2)
-# define FP_EN_TMDS (1 << 7)
-# define FP_DETECT_SENSE (1 << 8)
-# define FP_SEL_CRTC2 (1 << 13)
-# define FP_CRTC_DONT_SHADOW_HPAR (1 << 15)
-# define FP_CRTC_DONT_SHADOW_VPAR (1 << 16)
-# define FP_CRTC_DONT_SHADOW_HEND (1 << 17)
-# define FP_CRTC_USE_SHADOW_VEND (1 << 18)
-# define FP_RMX_HVSYNC_CONTROL_EN (1 << 20)
-# define FP_DFP_SYNC_SEL (1 << 21)
-# define FP_CRTC_LOCK_8DOT (1 << 22)
-# define FP_CRT_SYNC_SEL (1 << 23)
-# define FP_USE_SHADOW_EN (1 << 24)
-# define FP_CRT_SYNC_ALT (1 << 26)
-#define FP2_GEN_CNTL 0x0288
-/* FP2_GEN_CNTL bit constants */
-# define FP2_FPON (1 << 0)
-# define FP2_TMDS_EN (1 << 2)
-# define FP2_EN_TMDS (1 << 7)
-# define FP2_DETECT_SENSE (1 << 8)
-# define FP2_SEL_CRTC2 (1 << 13)
-# define FP2_FP_POL (1 << 16)
-# define FP2_LP_POL (1 << 17)
-# define FP2_SCK_POL (1 << 18)
-# define FP2_LCD_CNTL_MASK (7 << 19)
-# define FP2_PAD_FLOP_EN (1 << 22)
-# define FP2_CRC_EN (1 << 23)
-# define FP2_CRC_READ_EN (1 << 24)
-#define FP_HORZ_STRETCH 0x028C
-#define FP_HORZ2_STRETCH 0x038C
-# define HORZ_STRETCH_RATIO_MASK 0xffff
-# define HORZ_STRETCH_RATIO_MAX 4096
-# define HORZ_PANEL_SIZE (0x1ff << 16)
-# define HORZ_PANEL_SHIFT 16
-# define HORZ_STRETCH_PIXREP (0 << 25)
-# define HORZ_STRETCH_BLEND (1 << 26)
-# define HORZ_STRETCH_ENABLE (1 << 25)
-# define HORZ_AUTO_RATIO (1 << 27)
-# define HORZ_FP_LOOP_STRETCH (0x7 << 28)
-# define HORZ_AUTO_RATIO_INC (1 << 31)
-#define FP_VERT_STRETCH 0x0290
-#define FP_VERT2_STRETCH 0x0390
-# define VERT_PANEL_SIZE (0xfff << 12)
-# define VERT_PANEL_SHIFT 12
-# define VERT_STRETCH_RATIO_MASK 0xfff
-# define VERT_STRETCH_RATIO_SHIFT 0
-# define VERT_STRETCH_RATIO_MAX 4096
-# define VERT_STRETCH_ENABLE (1 << 25)
-# define VERT_STRETCH_LINEREP (0 << 26)
-# define VERT_STRETCH_BLEND (1 << 26)
-# define VERT_AUTO_RATIO_EN (1 << 27)
-# define VERT_STRETCH_RESERVED 0xf1000000
-#define FP_H_SYNC_STRT_WID 0x02C4
-#define FP_H2_SYNC_STRT_WID 0x03C4
-#define FP_V_SYNC_STRT_WID 0x02C8
-#define FP_V2_SYNC_STRT_WID 0x03C8
-#define LVDS_GEN_CNTL 0x02d0
-# define LVDS_ON (1 << 0)
-# define LVDS_DISPLAY_DIS (1 << 1)
-# define LVDS_PANEL_TYPE (1 << 2)
-# define LVDS_PANEL_FORMAT (1 << 3)
-# define LVDS_EN (1 << 7)
-# define LVDS_DIGON (1 << 18)
-# define LVDS_BLON (1 << 19)
-# define LVDS_SEL_CRTC2 (1 << 23)
-#define LVDS_PLL_CNTL 0x02d4
-# define HSYNC_DELAY_SHIFT 28
-# define HSYNC_DELAY_MASK (0xf << 28)
-#define AUX_WINDOW_HORZ_CNTL 0x02D8
-#define AUX_WINDOW_VERT_CNTL 0x02DC
-#define DDA_CONFIG 0x02e0
-#define DDA_ON_OFF 0x02e4
-
-#define GRPH_BUFFER_CNTL 0x02F0
-#define VGA_BUFFER_CNTL 0x02F4
-
-/* first overlay unit (there is only one) */
-
-#define OV0_Y_X_START 0x0400
-#define OV0_Y_X_END 0x0404
-#define OV0_PIPELINE_CNTL 0x0408
-#define OV0_EXCLUSIVE_HORZ 0x0408
-# define EXCL_HORZ_START_MASK 0x000000ff
-# define EXCL_HORZ_END_MASK 0x0000ff00
-# define EXCL_HORZ_BACK_PORCH_MASK 0x00ff0000
-# define EXCL_HORZ_EXCLUSIVE_EN 0x80000000
-#define OV0_EXCLUSIVE_VERT 0x040C
-# define EXCL_VERT_START_MASK 0x000003ff
-# define EXCL_VERT_END_MASK 0x03ff0000
-#define OV0_REG_LOAD_CNTL 0x0410
-# define REG_LD_CTL_LOCK 0x00000001L
-# define REG_LD_CTL_VBLANK_DURING_LOCK 0x00000002L
-# define REG_LD_CTL_STALL_GUI_UNTIL_FLIP 0x00000004L
-# define REG_LD_CTL_LOCK_READBACK 0x00000008L
-#define OV0_SCALE_CNTL 0x0420
-# define SCALER_PIX_EXPAND 0x00000001L
-# define SCALER_Y2R_TEMP 0x00000002L
-#ifdef RAGE128
-# define SCALER_HORZ_PICK_NEAREST 0x00000003L
-# define SCALER_VERT_PICK_NEAREST 0x00000004L
-#else
-# define SCALER_HORZ_PICK_NEAREST 0x00000004L
-# define SCALER_VERT_PICK_NEAREST 0x00000008L
-#endif
-# define SCALER_SIGNED_UV 0x00000010L
-# define SCALER_GAMMA_SEL_MASK 0x00000060L
-# define SCALER_GAMMA_SEL_BRIGHT 0x00000000L
-# define SCALER_GAMMA_SEL_G22 0x00000020L
-# define SCALER_GAMMA_SEL_G18 0x00000040L
-# define SCALER_GAMMA_SEL_G14 0x00000060L
-# define SCALER_COMCORE_SHIFT_UP_ONE 0x00000080L
-# define SCALER_SURFAC_FORMAT 0x00000f00L
-# define SCALER_SOURCE_UNK0 0x00000000L /* 2 bpp ??? */
-# define SCALER_SOURCE_UNK1 0x00000100L /* 4 bpp ??? */
-# define SCALER_SOURCE_UNK2 0x00000200L /* 8 bpp ??? */
-# define SCALER_SOURCE_15BPP 0x00000300L
-# define SCALER_SOURCE_16BPP 0x00000400L
-/*# define SCALER_SOURCE_24BPP 0x00000500L*/
-# define SCALER_SOURCE_32BPP 0x00000600L
-# define SCALER_SOURCE_UNK3 0x00000700L /* 8BPP_RGB332 ??? */
-# define SCALER_SOURCE_UNK4 0x00000800L /* 8BPP_Y8 ??? */
-# define SCALER_SOURCE_YUV9 0x00000900L /* 8BPP_RGB8 */
-# define SCALER_SOURCE_YUV12 0x00000A00L
-# define SCALER_SOURCE_VYUY422 0x00000B00L
-# define SCALER_SOURCE_YVYU422 0x00000C00L
-# define SCALER_SOURCE_UNK5 0x00000D00L /* ??? */
-# define SCALER_SOURCE_UNK6 0x00000E00L /* 32BPP_AYUV444 */
-# define SCALER_SOURCE_UNK7 0x00000F00L /* 16BPP_ARGB4444 */
-# define SCALER_ADAPTIVE_DEINT 0x00001000L
-# define R200_SCALER_TEMPORAL_DEINT 0x00002000L
-# define SCALER_UNKNOWN_FLAG1 0x00004000L /* ??? */
-# define SCALER_SMART_SWITCH 0x00008000L
-#ifdef RAGE128
-# define SCALER_BURST_PER_PLANE 0x00ff0000L
-#else
-# define SCALER_BURST_PER_PLANE 0x007f0000L
-#endif
-# define SCALER_DOUBLE_BUFFER 0x01000000L
-# define SCALER_UNKNOWN_FLAG3 0x02000000L /* ??? */
-# define SCALER_UNKNOWN_FLAG4 0x04000000L /* ??? */
-# define SCALER_DIS_LIMIT 0x08000000L
-# define SCALER_PRG_LOAD_START 0x10000000L
-# define SCALER_INT_EMU 0x20000000L
-# define SCALER_ENABLE 0x40000000L
-# define SCALER_SOFT_RESET 0x80000000L
-#define OV0_V_INC 0x0424
-#define OV0_P1_V_ACCUM_INIT 0x0428
-# define OV0_P1_MAX_LN_IN_PER_LN_OUT 0x00000003L
-# define OV0_P1_V_ACCUM_INIT_MASK 0x01ff8000L
-#define OV0_P23_V_ACCUM_INIT 0x042C
-# define OV0_P23_MAX_LN_IN_PER_LN_OUT 0x00000003L
-# define OV0_P23_V_ACCUM_INIT_MASK 0x01ff8000L
-#define OV0_P1_BLANK_LINES_AT_TOP 0x0430
-# define P1_BLNK_LN_AT_TOP_M1_MASK 0x00000fffL
-# define P1_ACTIVE_LINES_M1 0x0fff0000L
-#define OV0_P23_BLANK_LINES_AT_TOP 0x0434
-# define P23_BLNK_LN_AT_TOP_M1_MASK 0x000007ffL
-# define P23_ACTIVE_LINES_M1 0x07ff0000L
-#ifndef RAGE128
-#define OV0_BASE_ADDR 0x043C
-#endif
-#define OV0_VID_BUF0_BASE_ADRS 0x0440
-# define VIF_BUF0_PITCH_SEL 0x00000001L
-# define VIF_BUF0_TILE_ADRS 0x00000002L
-# define VIF_BUF0_BASE_ADRS_MASK 0x03fffff0L
-# define VIF_BUF0_1ST_LINE_LSBS_MASK 0x48000000L
-#define OV0_VID_BUF1_BASE_ADRS 0x0444
-# define VIF_BUF1_PITCH_SEL 0x00000001L
-# define VIF_BUF1_TILE_ADRS 0x00000002L
-# define VIF_BUF1_BASE_ADRS_MASK 0x03fffff0L
-# define VIF_BUF1_1ST_LINE_LSBS_MASK 0x48000000L
-#define OV0_VID_BUF2_BASE_ADRS 0x0448
-# define VIF_BUF2_PITCH_SEL 0x00000001L
-# define VIF_BUF2_TILE_ADRS 0x00000002L
-# define VIF_BUF2_BASE_ADRS_MASK 0x03fffff0L
-# define VIF_BUF2_1ST_LINE_LSBS_MASK 0x48000000L
-#define OV0_VID_BUF3_BASE_ADRS 0x044C
-# define VIF_BUF3_PITCH_SEL 0x00000001L
-# define VIF_BUF3_TILE_ADRS 0x00000002L
-# define VIF_BUF3_BASE_ADRS_MASK 0x03fffff0L
-# define VIF_BUF3_1ST_LINE_LSBS_MASK 0x48000000L
-#define OV0_VID_BUF4_BASE_ADRS 0x0450
-# define VIF_BUF4_PITCH_SEL 0x00000001L
-# define VIF_BUF4_TILE_ADRS 0x00000002L
-# define VIF_BUF4_BASE_ADRS_MASK 0x03fffff0L
-# define VIF_BUF4_1ST_LINE_LSBS_MASK 0x48000000L
-#define OV0_VID_BUF5_BASE_ADRS 0x0454
-# define VIF_BUF5_PITCH_SEL 0x00000001L
-# define VIF_BUF5_TILE_ADRS 0x00000002L
-# define VIF_BUF5_BASE_ADRS_MASK 0x03fffff0L
-# define VIF_BUF5_1ST_LINE_LSBS_MASK 0x48000000L
-#define OV0_VID_BUF_PITCH0_VALUE 0x0460
-#define OV0_VID_BUF_PITCH1_VALUE 0x0464
-#define OV0_AUTO_FLIP_CNTL 0x0470
-# define OV0_AUTO_FLIP_CNTL_SOFT_BUF_NUM 0x00000007
-# define OV0_AUTO_FLIP_CNTL_SOFT_REPEAT_FIELD 0x00000008
-# define OV0_AUTO_FLIP_CNTL_SOFT_BUF_ODD 0x00000010
-# define OV0_AUTO_FLIP_CNTL_IGNORE_REPEAT_FIELD 0x00000020
-# define OV0_AUTO_FLIP_CNTL_SOFT_EOF_TOGGLE 0x00000040
-# define OV0_AUTO_FLIP_CNTL_VID_PORT_SELECT 0x00000300
-# define OV0_AUTO_FLIP_CNTL_P1_FIRST_LINE_EVEN 0x00010000
-# define OV0_AUTO_FLIP_CNTL_SHIFT_EVEN_DOWN 0x00040000
-# define OV0_AUTO_FLIP_CNTL_SHIFT_ODD_DOWN 0x00080000
-# define OV0_AUTO_FLIP_CNTL_FIELD_POL_SOURCE 0x00800000
-#define OV0_DEINTERLACE_PATTERN 0x0474
-#define OV0_SUBMIT_HISTORY 0x0478
-#define OV0_H_INC 0x0480
-#define OV0_STEP_BY 0x0484
-#define OV0_P1_H_ACCUM_INIT 0x0488
-#define OV0_P23_H_ACCUM_INIT 0x048C
-#define OV0_P1_X_START_END 0x0494
-#define OV0_P2_X_START_END 0x0498
-#define OV0_P3_X_START_END 0x049C
-#define OV0_FILTER_CNTL 0x04A0
-# define FILTER_PROGRAMMABLE_COEF 0x00000000
-# define FILTER_HARD_SCALE_HORZ_Y 0x00000001
-# define FILTER_HARD_SCALE_HORZ_UV 0x00000002
-# define FILTER_HARD_SCALE_VERT_Y 0x00000004
-# define FILTER_HARD_SCALE_VERT_UV 0x00000008
-# define FILTER_HARDCODED_COEF 0x0000000F
-# define FILTER_COEF_MASK 0x0000000F
-/* When bit is set hard coded coefficients are used. */
-
-/*
- Top quality 4x4-tap filtered vertical and horizontal scaler.
- It allows up to 64:1 upscaling and downscaling without
- performance or quality degradation.
-*/
-#define OV0_FOUR_TAP_COEF_0 0x04B0
-# define OV0_FOUR_TAP_PHASE_0_TAP_0 0x0000000F
-# define OV0_FOUR_TAP_PHASE_0_TAP_1 0x00007F00
-# define OV0_FOUR_TAP_PHASE_0_TAP_2 0x007F0000
-# define OV0_FOUR_TAP_PHASE_0_TAP_3 0x0F000000
-#define OV0_FOUR_TAP_COEF_1 0x04B4
-# define OV0_FOUR_TAP_PHASE_1_5_TAP_0 0x0000000F
-# define OV0_FOUR_TAP_PHASE_1_5_TAP_1 0x00007F00
-# define OV0_FOUR_TAP_PHASE_1_5_TAP_2 0x007F0000
-# define OV0_FOUR_TAP_PHASE_1_5_TAP_3 0x0F000000
-#define OV0_FOUR_TAP_COEF_2 0x04B8
-# define OV0_FOUR_TAP_PHASE_2_6_TAP_0 0x0000000F
-# define OV0_FOUR_TAP_PHASE_2_6_TAP_1 0x00007F00
-# define OV0_FOUR_TAP_PHASE_2_6_TAP_2 0x007F0000
-# define OV0_FOUR_TAP_PHASE_2_6_TAP_3 0x0F000000
-#define OV0_FOUR_TAP_COEF_3 0x04BC
-# define OV0_FOUR_TAP_PHASE_3_7_TAP_0 0x0000000F
-# define OV0_FOUR_TAP_PHASE_3_7_TAP_1 0x00007F00
-# define OV0_FOUR_TAP_PHASE_3_7_TAP_2 0x007F0000
-# define OV0_FOUR_TAP_PHASE_3_7_TAP_3 0x0F000000
-#define OV0_FOUR_TAP_COEF_4 0x04C0
-# define OV0_FOUR_TAP_PHASE_4_TAP_0 0x0000000F
-# define OV0_FOUR_TAP_PHASE_4_TAP_1 0x00007F00
-# define OV0_FOUR_TAP_PHASE_4_TAP_2 0x007F0000
-# define OV0_FOUR_TAP_PHASE_4_TAP_3 0x0F000000
-/* 0th_tap means that the left most of top most pixel in a set of four will
- be multiplied by this coefficient. */
-
-#define OV0_FLAG_CNTL 0x04DC
-#ifdef RAGE128
-#define OV0_COLOUR_CNTL 0x04E0
-# define COLOUR_CNTL_BRIGHTNESS 0x0000007F
-# define COLOUR_CNTL_SATURATION 0x001F1F00
-#else
-/* NB: radeons have no COLOUR_CNTL register */
-#define OV0_SLICE_CNTL 0x04E0
-# define SLICE_CNTL_DISABLE 0x40000000
-#endif
-/* Video and graphics keys allow alpha blending, color correction
- and many other video effects */
-#define OV0_VID_KEY_CLR 0x04E4
-#define OV0_VID_KEY_MSK 0x04E8
-#define OV0_GRAPHICS_KEY_CLR 0x04EC
-#define OV0_GRAPHICS_KEY_MSK 0x04F0
-#define OV0_KEY_CNTL 0x04F4
-#ifdef RAGE128
-# define VIDEO_KEY_FN_MASK 0x00000007L
-# define VIDEO_KEY_FN_FALSE 0x00000000L
-# define VIDEO_KEY_FN_TRUE 0x00000001L
-# define VIDEO_KEY_FN_EQ 0x00000004L
-# define VIDEO_KEY_FN_NE 0x00000005L
-# define GRAPHIC_KEY_FN_MASK 0x00000070L
-# define GRAPHIC_KEY_FN_FALSE 0x00000000L
-# define GRAPHIC_KEY_FN_TRUE 0x00000010L
-# define GRAPHIC_KEY_FN_EQ 0x00000040L
-# define GRAPHIC_KEY_FN_NE 0x00000050L
-#else
-# define VIDEO_KEY_FN_MASK 0x00000003L
-# define VIDEO_KEY_FN_FALSE 0x00000000L
-# define VIDEO_KEY_FN_TRUE 0x00000001L
-# define VIDEO_KEY_FN_EQ 0x00000002L
-# define VIDEO_KEY_FN_NE 0x00000003L
-# define GRAPHIC_KEY_FN_MASK 0x00000030L
-# define GRAPHIC_KEY_FN_FALSE 0x00000000L
-# define GRAPHIC_KEY_FN_TRUE 0x00000010L
-# define GRAPHIC_KEY_FN_EQ 0x00000020L
-# define GRAPHIC_KEY_FN_NE 0x00000030L
-#endif
-# define CMP_MIX_MASK 0x00000100L
-# define CMP_MIX_OR 0x00000000L
-# define CMP_MIX_AND 0x00000100L
-#define OV0_TEST 0x04F8
-# define OV0_SCALER_Y2R_DISABLE 0x00000001L
-# define OV0_SUBPIC_ONLY 0x00000008L
-# define OV0_EXTENSE 0x00000010L
-# define OV0_SWAP_UV 0x00000020L
-#define OV0_COL_CONV 0x04FC
-# define OV0_CB_TO_B 0x0000007FL
-# define OV0_CB_TO_G 0x0000FF00L
-# define OV0_CR_TO_G 0x00FF0000L
-# define OV0_CR_TO_R 0x7F000000L
-# define OV0_NEW_COL_CONV 0x80000000L
-#define OV0_LIN_TRANS_A 0x0D20
-#define OV0_LIN_TRANS_B 0x0D24
-#define OV0_LIN_TRANS_C 0x0D28
-#define OV0_LIN_TRANS_D 0x0D2C
-#define OV0_LIN_TRANS_E 0x0D30
-#define OV0_LIN_TRANS_F 0x0D34
-#define OV0_GAMMA_0_F 0x0D40
-#define OV0_GAMMA_10_1F 0x0D44
-#define OV0_GAMMA_20_3F 0x0D48
-#define OV0_GAMMA_40_7F 0x0D4C
-/* These registers exist on R200 only */
-#define OV0_GAMMA_80_BF 0x0E00
-#define OV0_GAMMA_C0_FF 0x0E04
-#define OV0_GAMMA_100_13F 0x0E08
-#define OV0_GAMMA_140_17F 0x0E0C
-#define OV0_GAMMA_180_1BF 0x0E10
-#define OV0_GAMMA_1C0_1FF 0x0E14
-#define OV0_GAMMA_200_23F 0x0E18
-#define OV0_GAMMA_240_27F 0x0E1C
-#define OV0_GAMMA_280_2BF 0x0E20
-#define OV0_GAMMA_2C0_2FF 0x0E24
-#define OV0_GAMMA_300_33F 0x0E28
-#define OV0_GAMMA_340_37F 0x0E2C
-/* End of R200 specific definitions */
-#define OV0_GAMMA_380_3BF 0x0D50
-#define OV0_GAMMA_3C0_3FF 0x0D54
-
-/*
- IDCT ENGINE:
- It's MPEG-2 hardware decoder which incorporates run-level decode, de-zigzag
- and IDCT into an IDCT engine to complement the motion compensation engine.
-*/
-#define IDCT_RUNS 0x1F80
-#define IDCT_LEVELS 0x1F84
-#define IDCT_AUTH_CONTROL 0x1F88
-#define IDCT_AUTH 0x1F8C
-#define IDCT_CONTROL 0x1FBC
-
-#define SE_MC_SRC2_CNTL 0x19D4
-# define SECONDARY_SCALE_HACC 0x00001FFFL
-# define SECONDARY_SCALE_VACC 0x0FFF0000L
-# define SECONDARY_SCALE_PICTH_ADJ 0xC0000000L
-#define SE_MC_SRC1_CNTL 0x19D8
-# define SCALE_HACC 0x00001FFFL
-# define SCALE_VACC 0x0FFF0000L
-# define IDCT_EN 0x10000000L
-# define SECONDARY_TEX_EN 0x20000000L
-# define SCALE_PICTH_ADJ 0xC0000000L
-#define SE_MC_DST_CNTL 0x19DC
-# define DST_Y 0x00003FFFL
-# define DST_X 0x3FFF0000L
-# define DST_PITCH_ADJ 0xC0000000L
-#define SE_MC_CNTL_START 0x19E0
-# define SCALE_OFFSET_PTR 0x0000000FL
-# define DST_OFFSET 0x00FFFFF0L
-# define ALPHA_EN 0x01000000L
-# define SECONDARY_OFFSET_PTR 0x1E000000L
-# define MC_DST_HEIGHT_WIDTH 0xE0000000L
-#ifndef RAGE128
-#define SE_MC_BUF_BASE 0x19E4
-#define PP_MC_CONTEXT 0x19E8
-#define PP_MISC 0x1C14
-#endif
-/*
- SUBPICTURE UNIT:
- Decompressing, scaling and alpha blending the compressed bitmap on the fly.
- Provide optimal DVD subpicture qualtity.
-*/
-#define SUBPIC_CNTL 0x0540
-#define SUBPIC_DEFCOLCON 0x0544
-#define SUBPIC_Y_X_START 0x054C
-#define SUBPIC_Y_X_END 0x0550
-#define SUBPIC_V_INC 0x0554
-#define SUBPIC_H_INC 0x0558
-#define SUBPIC_BUF0_OFFSET 0x055C
-#define SUBPIC_BUF1_OFFSET 0x0560
-#define SUBPIC_LC0_OFFSET 0x0564
-#define SUBPIC_LC1_OFFSET 0x0568
-#define SUBPIC_PITCH 0x056C
-#define SUBPIC_BTN_HLI_COLCON 0x0570
-#define SUBPIC_BTN_HLI_Y_X_START 0x0574
-#define SUBPIC_BTN_HLI_Y_X_END 0x0578
-#define SUBPIC_PALETTE_INDEX 0x057C
-#define SUBPIC_PALETTE_DATA 0x0580
-#define SUBPIC_H_ACCUM_INIT 0x0584
-#define SUBPIC_V_ACCUM_INIT 0x0588
-
-#define CP_RB_BASE 0x0700
-#define CP_RB_CNTL 0x0704
-#define CP_RB_RPTR_ADDR 0x070C
-#define CP_RB_RPTR 0x0710
-#define CP_RB_WPTR 0x0714
-#define CP_RB_WPTR_DELAY 0x0718
-#define CP_IB_BASE 0x0738
-#define CP_IB_BUFSZ 0x073C
-#define CP_CSQ_CNTL 0x0740
-#define SCRATCH_UMSK 0x0770
-#define SCRATCH_ADDR 0x0774
-#ifndef RAGE128
-#define DMA_GUI_TABLE_ADDR 0x0780
-# define DMA_GUI_COMMAND__BYTE_COUNT_MASK 0x001fffff
-# define DMA_GUI_COMMAND__INTDIS 0x40000000
-# define DMA_GUI_COMMAND__EOL 0x80000000
-#define DMA_GUI_SRC_ADDR 0x0784
-#define DMA_GUI_DST_ADDR 0x0788
-#define DMA_GUI_COMMAND 0x078C
-#define DMA_GUI_STATUS 0x0790
-#define DMA_GUI_ACT_DSCRPTR 0x0794
-#define DMA_VID_TABLE_ADDR 0x07A0
-#define DMA_VID_SRC_ADDR 0x07A4
-#define DMA_VID_DST_ADDR 0x07A8
-#define DMA_VID_COMMAND 0x07AC
-#define DMA_VID_STATUS 0x07B0
-#define DMA_VID_ACT_DSCRPTR 0x07B4
-#endif
-#define CP_ME_CNTL 0x07D0
-#define CP_ME_RAM_ADDR 0x07D4
-#define CP_ME_RAM_RADDR 0x07D8
-#define CP_ME_RAM_DATAH 0x07DC
-#define CP_ME_RAM_DATAL 0x07E0
-#define CP_CSQ_ADDR 0x07F0
-#define CP_CSQ_DATA 0x07F4
-#define CP_CSQ_STAT 0x07F8
-
-#define DISP_MISC_CNTL 0x0D00
-# define SOFT_RESET_GRPH_PP (1 << 0)
-#define DAC_MACRO_CNTL 0x0D04
-#define DISP_PWR_MAN 0x0D08
-#define DISP_TEST_DEBUG_CNTL 0x0D10
-#define DISP_HW_DEBUG 0x0D14
-#define DAC_CRC_SIG1 0x0D18
-#define DAC_CRC_SIG2 0x0D1C
-
-/* first capture unit */
-
-#define VID_BUFFER_CONTROL 0x0900
-#define CAP_INT_CNTL 0x0908
-#define CAP_INT_STATUS 0x090C
-#define FCP_CNTL 0x0910
-# define FCP_CNTL__PCICLK 0
-# define FCP_CNTL__PCLK 1
-# define FCP_CNTL__PCLKb 2
-# define FCP_CNTL__HREF 3
-# define FCP_CNTL__GND 4
-# define FCP_CNTL__HREFb 5
-
-#define CAP0_BUF0_OFFSET 0x0920
-#define CAP0_BUF1_OFFSET 0x0924
-#define CAP0_BUF0_EVEN_OFFSET 0x0928
-#define CAP0_BUF1_EVEN_OFFSET 0x092C
-#define CAP0_BUF_PITCH 0x0930
-#define CAP0_V_WINDOW 0x0934
-#define CAP0_H_WINDOW 0x0938
-#define CAP0_VBI0_OFFSET 0x093C
-#define CAP0_VBI1_OFFSET 0x0940
-#define CAP0_VBI_V_WINDOW 0x0944
-#define CAP0_VBI_H_WINDOW 0x0948
-#define CAP0_PORT_MODE_CNTL 0x094C
-#define CAP0_TRIG_CNTL 0x0950
-#define CAP0_DEBUG 0x0954
-#define CAP0_CONFIG 0x0958
-# define CAP0_CONFIG_CONTINUOS 0x00000001
-# define CAP0_CONFIG_START_FIELD_EVEN 0x00000002
-# define CAP0_CONFIG_START_BUF_GET 0x00000004
-# define CAP0_CONFIG_START_BUF_SET 0x00000008
-# define CAP0_CONFIG_BUF_TYPE_ALT 0x00000010
-# define CAP0_CONFIG_BUF_TYPE_FRAME 0x00000020
-# define CAP0_CONFIG_ONESHOT_MODE_FRAME 0x00000040
-# define CAP0_CONFIG_BUF_MODE_DOUBLE 0x00000080
-# define CAP0_CONFIG_BUF_MODE_TRIPLE 0x00000100
-# define CAP0_CONFIG_MIRROR_EN 0x00000200
-# define CAP0_CONFIG_ONESHOT_MIRROR_EN 0x00000400
-# define CAP0_CONFIG_VIDEO_SIGNED_UV 0x00000800
-# define CAP0_CONFIG_ANC_DECODE_EN 0x00001000
-# define CAP0_CONFIG_VBI_EN 0x00002000
-# define CAP0_CONFIG_SOFT_PULL_DOWN_EN 0x00004000
-# define CAP0_CONFIG_VIP_EXTEND_FLAG_EN 0x00008000
-# define CAP0_CONFIG_FAKE_FIELD_EN 0x00010000
-# define CAP0_CONFIG_ODD_ONE_MORE_LINE 0x00020000
-# define CAP0_CONFIG_EVEN_ONE_MORE_LINE 0x00040000
-# define CAP0_CONFIG_HORZ_DIVIDE_2 0x00080000
-# define CAP0_CONFIG_HORZ_DIVIDE_4 0x00100000
-# define CAP0_CONFIG_VERT_DIVIDE_2 0x00200000
-# define CAP0_CONFIG_VERT_DIVIDE_4 0x00400000
-# define CAP0_CONFIG_FORMAT_BROOKTREE 0x00000000
-# define CAP0_CONFIG_FORMAT_CCIR656 0x00800000
-# define CAP0_CONFIG_FORMAT_ZV 0x01000000
-# define CAP0_CONFIG_FORMAT_VIP 0x01800000
-# define CAP0_CONFIG_FORMAT_TRANSPORT 0x02000000
-# define CAP0_CONFIG_HORZ_DECIMATOR 0x04000000
-# define CAP0_CONFIG_VIDEO_IN_YVYU422 0x00000000
-# define CAP0_CONFIG_VIDEO_IN_VYUY422 0x20000000
-# define CAP0_CONFIG_VBI_DIVIDE_2 0x40000000
-# define CAP0_CONFIG_VBI_DIVIDE_4 0x80000000
-#define CAP0_ANC_ODD_OFFSET 0x095C
-#define CAP0_ANC_EVEN_OFFSET 0x0960
-#define CAP0_ANC_H_WINDOW 0x0964
-#define CAP0_VIDEO_SYNC_TEST 0x0968
-#define CAP0_ONESHOT_BUF_OFFSET 0x096C
-#define CAP0_BUF_STATUS 0x0970
-#ifdef RAGE128
-#define CAP0_DWNSC_XRATIO 0x0978
-#define CAP0_XSHARPNESS 0x097C
-#else
-/* #define CAP0_DWNSC_XRATIO 0x0978 */
-/* #define CAP0_XSHARPNESS 0x097C */
-#endif
-#define CAP0_VBI2_OFFSET 0x0980
-#define CAP0_VBI3_OFFSET 0x0984
-#define CAP0_ANC2_OFFSET 0x0988
-#define CAP0_ANC3_OFFSET 0x098C
-
-/* second capture unit */
-
-#define CAP1_BUF0_OFFSET 0x0990
-#define CAP1_BUF1_OFFSET 0x0994
-#define CAP1_BUF0_EVEN_OFFSET 0x0998
-#define CAP1_BUF1_EVEN_OFFSET 0x099C
-
-#define CAP1_BUF_PITCH 0x09A0
-#define CAP1_V_WINDOW 0x09A4
-#define CAP1_H_WINDOW 0x09A8
-#define CAP1_VBI_ODD_OFFSET 0x09AC
-#define CAP1_VBI_EVEN_OFFSET 0x09B0
-#define CAP1_VBI_V_WINDOW 0x09B4
-#define CAP1_VBI_H_WINDOW 0x09B8
-#define CAP1_PORT_MODE_CNTL 0x09BC
-#define CAP1_TRIG_CNTL 0x09C0
-#define CAP1_DEBUG 0x09C4
-#define CAP1_CONFIG 0x09C8
-#define CAP1_ANC_ODD_OFFSET 0x09CC
-#define CAP1_ANC_EVEN_OFFSET 0x09D0
-#define CAP1_ANC_H_WINDOW 0x09D4
-#define CAP1_VIDEO_SYNC_TEST 0x09D8
-#define CAP1_ONESHOT_BUF_OFFSET 0x09DC
-#define CAP1_BUF_STATUS 0x09E0
-#define CAP1_DWNSC_XRATIO 0x09E8
-#define CAP1_XSHARPNESS 0x09EC
-
-#define DISP_MERGE_CNTL 0x0D60
-#define DISP_OUTPUT_CNTL 0x0D64
-# define DISP_DAC_SOURCE_MASK 0x03
-# define DISP_DAC_SOURCE_CRTC2 0x01
-#define DISP_LIN_TRANS_GRPH_A 0x0D80
-#define DISP_LIN_TRANS_GRPH_B 0x0D84
-#define DISP_LIN_TRANS_GRPH_C 0x0D88
-#define DISP_LIN_TRANS_GRPH_D 0x0D8C
-#define DISP_LIN_TRANS_GRPH_E 0x0D90
-#define DISP_LIN_TRANS_GRPH_F 0x0D94
-#define DISP_LIN_TRANS_VID_A 0x0D98
-#define DISP_LIN_TRANS_VID_B 0x0D9C
-#define DISP_LIN_TRANS_VID_C 0x0DA0
-#define DISP_LIN_TRANS_VID_D 0x0DA4
-#define DISP_LIN_TRANS_VID_E 0x0DA8
-#define DISP_LIN_TRANS_VID_F 0x0DAC
-#define RMX_HORZ_FILTER_0TAP_COEF 0x0DB0
-#define RMX_HORZ_FILTER_1TAP_COEF 0x0DB4
-#define RMX_HORZ_FILTER_2TAP_COEF 0x0DB8
-#define RMX_HORZ_PHASE 0x0DBC
-#define DAC_EMBEDDED_SYNC_CNTL 0x0DC0
-#define DAC_BROAD_PULSE 0x0DC4
-#define DAC_SKEW_CLKS 0x0DC8
-#define DAC_INCR 0x0DCC
-#define DAC_NEG_SYNC_LEVEL 0x0DD0
-#define DAC_POS_SYNC_LEVEL 0x0DD4
-#define DAC_BLANK_LEVEL 0x0DD8
-#define CLOCK_CNTL_INDEX 0x0008
-/* CLOCK_CNTL_INDEX bit constants */
-# define PLL_WR_EN 0x00000080
-# define PLL_DIV_SEL (3 << 8)
-# define PLL2_DIV_SEL_MASK ~(3 << 8)
-#define CLOCK_CNTL_DATA 0x000C
-#define CP_RB_CNTL 0x0704
-#define CP_RB_BASE 0x0700
-#define CP_RB_RPTR_ADDR 0x070C
-#define CP_RB_RPTR 0x0710
-#define CP_RB_WPTR 0x0714
-#define CP_RB_WPTR_DELAY 0x0718
-#define CP_IB_BASE 0x0738
-#define CP_IB_BUFSZ 0x073C
-#define SCRATCH_REG0 0x15E0
-#define GUI_SCRATCH_REG0 0x15E0
-#define SCRATCH_REG1 0x15E4
-#define GUI_SCRATCH_REG1 0x15E4
-#define SCRATCH_REG2 0x15E8
-#define GUI_SCRATCH_REG2 0x15E8
-#define SCRATCH_REG3 0x15EC
-#define GUI_SCRATCH_REG3 0x15EC
-#define SCRATCH_REG4 0x15F0
-#define GUI_SCRATCH_REG4 0x15F0
-#define SCRATCH_REG5 0x15F4
-#define GUI_SCRATCH_REG5 0x15F4
-#define SCRATCH_UMSK 0x0770
-#define SCRATCH_ADDR 0x0774
-#define DP_BRUSH_FRGD_CLR 0x147C
-#define DP_BRUSH_BKGD_CLR 0x1478
-#define DST_LINE_START 0x1600
-#define DST_LINE_END 0x1604
-#define SRC_OFFSET 0x15AC
-#define SRC_PITCH 0x15B0
-#define SRC_TILE 0x1704
-#define SRC_PITCH_OFFSET 0x1428
-#define SRC_X 0x1414
-#define SRC_Y 0x1418
-#define DST_WIDTH_X 0x1588
-#define DST_HEIGHT_WIDTH_8 0x158C
-#define SRC_X_Y 0x1590
-#define SRC_Y_X 0x1434
-#define DST_Y_X 0x1438
-#define DST_WIDTH_HEIGHT 0x1598
-#define DST_HEIGHT_WIDTH 0x143c
-#ifdef RAGE128
-#define GUI_STAT 0x1740
-# define GUI_FIFOCNT_MASK 0x0fff
-# define PM4_BUSY (1 << 16)
-# define MICRO_BUSY (1 << 17)
-# define FPU_BUSY (1 << 18)
-# define VC_BUSY (1 << 19)
-# define IDCT_BUSY (1 << 20)
-# define ENG_EV_BUSY (1 << 21)
-# define SETUP_BUSY (1 << 22)
-# define EDGE_WALK_BUSY (1 << 23)
-# define ADDRESSING_BUSY (1 << 24)
-# define ENG_3D_BUSY (1 << 25)
-# define ENG_2D_SM_BUSY (1 << 26)
-# define ENG_2D_BUSY (1 << 27)
-# define GUI_WB_BUSY (1 << 28)
-# define CACHE_BUSY (1 << 29)
-# define GUI_ACTIVE (1 << 31)
-#endif
-#define SRC_CLUT_ADDRESS 0x1780
-#define SRC_CLUT_DATA 0x1784
-#define SRC_CLUT_DATA_RD 0x1788
-#define HOST_DATA0 0x17C0
-#define HOST_DATA1 0x17C4
-#define HOST_DATA2 0x17C8
-#define HOST_DATA3 0x17CC
-#define HOST_DATA4 0x17D0
-#define HOST_DATA5 0x17D4
-#define HOST_DATA6 0x17D8
-#define HOST_DATA7 0x17DC
-#define HOST_DATA_LAST 0x17E0
-#define DP_SRC_ENDIAN 0x15D4
-#define DP_SRC_FRGD_CLR 0x15D8
-#define DP_SRC_BKGD_CLR 0x15DC
-#define DP_WRITE_MASK 0x16cc
-#define SC_LEFT 0x1640
-#define SC_RIGHT 0x1644
-#define SC_TOP 0x1648
-#define SC_BOTTOM 0x164C
-#define SRC_SC_RIGHT 0x1654
-#define SRC_SC_BOTTOM 0x165C
-#define DP_CNTL 0x16C0
-/* DP_CNTL bit constants */
-# define DST_X_RIGHT_TO_LEFT 0x00000000
-# define DST_X_LEFT_TO_RIGHT 0x00000001
-# define DST_Y_BOTTOM_TO_TOP 0x00000000
-# define DST_Y_TOP_TO_BOTTOM 0x00000002
-# define DST_X_MAJOR 0x00000000
-# define DST_Y_MAJOR 0x00000004
-# define DST_X_TILE 0x00000008
-# define DST_Y_TILE 0x00000010
-# define DST_LAST_PEL 0x00000020
-# define DST_TRAIL_X_RIGHT_TO_LEFT 0x00000000
-# define DST_TRAIL_X_LEFT_TO_RIGHT 0x00000040
-# define DST_TRAP_FILL_RIGHT_TO_LEFT 0x00000000
-# define DST_TRAP_FILL_LEFT_TO_RIGHT 0x00000080
-# define DST_BRES_SIGN 0x00000100
-# define DST_HOST_BIG_ENDIAN_EN 0x00000200
-# define DST_POLYLINE_NONLAST 0x00008000
-# define DST_RASTER_STALL 0x00010000
-# define DST_POLY_EDGE 0x00040000
-#define DP_CNTL_XDIR_YDIR_YMAJOR 0x16D0
-/* DP_CNTL_XDIR_YDIR_YMAJOR bit constants (short version of DP_CNTL) */
-# define DST_X_MAJOR_S 0x00000000
-# define DST_Y_MAJOR_S 0x00000001
-# define DST_Y_BOTTOM_TO_TOP_S 0x00000000
-# define DST_Y_TOP_TO_BOTTOM_S 0x00008000
-# define DST_X_RIGHT_TO_LEFT_S 0x00000000
-# define DST_X_LEFT_TO_RIGHT_S 0x80000000
-#define DP_DATATYPE 0x16C4
-/* DP_DATATYPE bit constants */
-# define DST_8BPP 0x00000002
-# define DST_15BPP 0x00000003
-# define DST_16BPP 0x00000004
-# define DST_24BPP 0x00000005
-# define DST_32BPP 0x00000006
-# define DST_8BPP_RGB332 0x00000007
-# define DST_8BPP_Y8 0x00000008
-# define DST_8BPP_RGB8 0x00000009
-# define DST_16BPP_VYUY422 0x0000000b
-# define DST_16BPP_YVYU422 0x0000000c
-# define DST_32BPP_AYUV444 0x0000000e
-# define DST_16BPP_ARGB4444 0x0000000f
-# define BRUSH_SOLIDCOLOR 0x00000d00
-# define SRC_MONO 0x00000000
-# define SRC_MONO_LBKGD 0x00010000
-# define SRC_DSTCOLOR 0x00030000
-# define BYTE_ORDER_MSB_TO_LSB 0x00000000
-# define BYTE_ORDER_LSB_TO_MSB 0x40000000
-# define DP_CONVERSION_TEMP 0x80000000
-# define HOST_BIG_ENDIAN_EN (1 << 29)
-#define DP_MIX 0x16C8
-/* DP_MIX bit constants */
-# define DP_SRC_RECT 0x00000200
-# define DP_SRC_HOST 0x00000300
-# define DP_SRC_HOST_BYTEALIGN 0x00000400
-#define DP_WRITE_MSK 0x16CC
-#define DP_XOP 0x17F8
-#define CLR_CMP_CLR_SRC 0x15C4
-#define CLR_CMP_CLR_DST 0x15C8
-#define CLR_CMP_CNTL 0x15C0
-/* CLR_CMP_CNTL bit constants */
-# define COMPARE_SRC_FALSE 0x00000000
-# define COMPARE_SRC_TRUE 0x00000001
-# define COMPARE_SRC_NOT_EQUAL 0x00000004
-# define COMPARE_SRC_EQUAL 0x00000005
-# define COMPARE_SRC_EQUAL_FLIP 0x00000007
-# define COMPARE_DST_FALSE 0x00000000
-# define COMPARE_DST_TRUE 0x00000100
-# define COMPARE_DST_NOT_EQUAL 0x00000400
-# define COMPARE_DST_EQUAL 0x00000500
-# define COMPARE_DESTINATION 0x00000000
-# define COMPARE_SOURCE 0x01000000
-# define COMPARE_SRC_AND_DST 0x02000000
-#define CLR_CMP_MSK 0x15CC
-#define DSTCACHE_MODE 0x1710
-#define DSTCACHE_CTLSTAT 0x1714
-/* DSTCACHE_CTLSTAT bit constants */
-# define RB2D_DC_FLUSH (3 << 0)
-# define RB2D_DC_FLUSH_ALL 0xf
-# define RB2D_DC_BUSY (1 << 31)
-#define DEFAULT_OFFSET 0x16e0
-#define DEFAULT_PITCH_OFFSET 0x16E0
-#define DEFAULT_SC_BOTTOM_RIGHT 0x16E8
-/* DEFAULT_SC_BOTTOM_RIGHT bit constants */
-# define DEFAULT_SC_RIGHT_MAX (0x1fff << 0)
-# define DEFAULT_SC_BOTTOM_MAX (0x1fff << 16)
-#define DP_GUI_MASTER_CNTL 0x146C
-/* DP_GUI_MASTER_CNTL bit constants */
-# define GMC_SRC_PITCH_OFFSET_DEFAULT 0x00000000
-# define GMC_SRC_PITCH_OFFSET_LEAVE 0x00000001
-# define GMC_DST_PITCH_OFFSET_DEFAULT 0x00000000
-# define GMC_DST_PITCH_OFFSET_LEAVE 0x00000002
-# define GMC_SRC_CLIP_DEFAULT 0x00000000
-# define GMC_SRC_CLIP_LEAVE 0x00000004
-# define GMC_DST_CLIP_DEFAULT 0x00000000
-# define GMC_DST_CLIP_LEAVE 0x00000008
-# define GMC_BRUSH_8x8MONO 0x00000000
-# define GMC_BRUSH_8x8MONO_LBKGD 0x00000010
-# define GMC_BRUSH_8x1MONO 0x00000020
-# define GMC_BRUSH_8x1MONO_LBKGD 0x00000030
-# define GMC_BRUSH_1x8MONO 0x00000040
-# define GMC_BRUSH_1x8MONO_LBKGD 0x00000050
-# define GMC_BRUSH_32x1MONO 0x00000060
-# define GMC_BRUSH_32x1MONO_LBKGD 0x00000070
-# define GMC_BRUSH_32x32MONO 0x00000080
-# define GMC_BRUSH_32x32MONO_LBKGD 0x00000090
-# define GMC_BRUSH_8x8COLOR 0x000000a0
-# define GMC_BRUSH_8x1COLOR 0x000000b0
-# define GMC_BRUSH_1x8COLOR 0x000000c0
-# define GMC_BRUSH_SOLID_COLOR 0x000000d0
-# define GMC_DST_8BPP 0x00000200
-# define GMC_DST_15BPP 0x00000300
-# define GMC_DST_16BPP 0x00000400
-# define GMC_DST_24BPP 0x00000500
-# define GMC_DST_32BPP 0x00000600
-# define GMC_DST_8BPP_RGB332 0x00000700
-# define GMC_DST_8BPP_Y8 0x00000800
-# define GMC_DST_8BPP_RGB8 0x00000900
-# define GMC_DST_16BPP_VYUY422 0x00000b00
-# define GMC_DST_16BPP_YVYU422 0x00000c00
-# define GMC_DST_32BPP_AYUV444 0x00000e00
-# define GMC_DST_16BPP_ARGB4444 0x00000f00
-# define GMC_SRC_MONO 0x00000000
-# define GMC_SRC_MONO_LBKGD 0x00001000
-# define GMC_SRC_DSTCOLOR 0x00003000
-# define GMC_BYTE_ORDER_MSB_TO_LSB 0x00000000
-# define GMC_BYTE_ORDER_LSB_TO_MSB 0x00004000
-# define GMC_DP_CONVERSION_TEMP_9300 0x00008000
-# define GMC_DP_CONVERSION_TEMP_6500 0x00000000
-# define GMC_DP_SRC_RECT 0x02000000
-# define GMC_DP_SRC_HOST 0x03000000
-# define GMC_DP_SRC_HOST_BYTEALIGN 0x04000000
-# define GMC_3D_FCN_EN_CLR 0x00000000
-# define GMC_3D_FCN_EN_SET 0x08000000
-# define GMC_DST_CLR_CMP_FCN_LEAVE 0x00000000
-# define GMC_DST_CLR_CMP_FCN_CLEAR 0x10000000
-# define GMC_AUX_CLIP_LEAVE 0x00000000
-# define GMC_AUX_CLIP_CLEAR 0x20000000
-# define GMC_WRITE_MASK_LEAVE 0x00000000
-# define GMC_WRITE_MASK_SET 0x40000000
-# define GMC_CLR_CMP_CNTL_DIS (1 << 28)
-# define GMC_SRC_DATATYPE_COLOR (3 << 12)
-# define ROP3_S 0x00cc0000
-# define ROP3_SRCCOPY 0x00cc0000
-# define ROP3_P 0x00f00000
-# define ROP3_PATCOPY 0x00f00000
-# define DP_SRC_SOURCE_MASK (7 << 24)
-# define GMC_BRUSH_NONE (15 << 4)
-# define DP_SRC_SOURCE_MEMORY (2 << 24)
-# define GMC_BRUSH_SOLIDCOLOR 0x000000d0
-#define SC_TOP_LEFT 0x16EC
-#define SC_BOTTOM_RIGHT 0x16F0
-#define SRC_SC_BOTTOM_RIGHT 0x16F4
-#define RB2D_DSTCACHE_CTLSTAT 0x342C
-#define RB2D_DSTCACHE_MODE 0x3428
-
-#define BASE_CODE 0x0f0b/*0x0f08*/
-#define RADEON_BIOS_0_SCRATCH 0x0010
-#define RADEON_BIOS_1_SCRATCH 0x0014
-#define RADEON_BIOS_2_SCRATCH 0x0018
-#define RADEON_BIOS_3_SCRATCH 0x001c
-#define RADEON_BIOS_4_SCRATCH 0x0020
-#define RADEON_BIOS_5_SCRATCH 0x0024
-#define RADEON_BIOS_6_SCRATCH 0x0028
-#define RADEON_BIOS_7_SCRATCH 0x002c
-
-
-#define CLK_PIN_CNTL 0x0001
-#define PPLL_CNTL 0x0002
-# define PPLL_RESET (1 << 0)
-# define PPLL_SLEEP (1 << 1)
-# define PPLL_ATOMIC_UPDATE_EN (1 << 16)
-# define PPLL_VGA_ATOMIC_UPDATE_EN (1 << 17)
-# define PPLL_ATOMIC_UPDATE_VSYNC (1 << 18)
-#define PPLL_REF_DIV 0x0003
-# define PPLL_REF_DIV_MASK 0x03ff
-# define PPLL_ATOMIC_UPDATE_R (1 << 15) /* same as _W */
-# define PPLL_ATOMIC_UPDATE_W (1 << 15) /* same as _R */
-#define PPLL_DIV_0 0x0004
-#define PPLL_DIV_1 0x0005
-#define PPLL_DIV_2 0x0006
-#define PPLL_DIV_3 0x0007
-#define VCLK_ECP_CNTL 0x0008
-# define VCLK_SRC_SEL_MASK 0x03
-# define VCLK_SRC_SEL_CPUCLK 0x00
-# define VCLK_SRC_SEL_PSCANCLK 0x01
-# define VCLK_SRC_SEL_BYTECLK 0x02
-# define VCLK_SRC_SEL_PPLLCLK 0x03
-#define HTOTAL_CNTL 0x0009
-#define HTOTAL2_CNTL 0x002e /* PLL */
-#define M_SPLL_REF_FB_DIV 0x000a
-#define AGP_PLL_CNTL 0x000b
-#define SPLL_CNTL 0x000c
-#define SCLK_CNTL 0x000d
-# define DYN_STOP_LAT_MASK 0x00007ff8
-# define CP_MAX_DYN_STOP_LAT 0x0008
-# define SCLK_FORCEON_MASK 0xffff8000
-#define SCLK_MORE_CNTL 0x0035 /* PLL */
-# define SCLK_MORE_FORCEON 0x0700
-#define MPLL_CNTL 0x000e
-#ifdef RAGE128
-#define MCLK_CNTL 0x000f /* PLL */
-# define FORCE_GCP (1 << 16)
-# define FORCE_PIPE3D_CP (1 << 17)
-# define FORCE_RCP (1 << 18)
-#else
-#define MCLK_CNTL 0x0012
-/* MCLK_CNTL bit constants */
-# define FORCEON_MCLKA (1 << 16)
-# define FORCEON_MCLKB (1 << 17)
-# define FORCEON_YCLKA (1 << 18)
-# define FORCEON_YCLKB (1 << 19)
-# define FORCEON_MC (1 << 20)
-# define FORCEON_AIC (1 << 21)
-#endif
-#define PLL_TEST_CNTL 0x0013
-#define P2PLL_CNTL 0x002a /* P2PLL */
-# define P2PLL_RESET (1 << 0)
-# define P2PLL_SLEEP (1 << 1)
-# define P2PLL_ATOMIC_UPDATE_EN (1 << 16)
-# define P2PLL_VGA_ATOMIC_UPDATE_EN (1 << 17)
-# define P2PLL_ATOMIC_UPDATE_VSYNC (1 << 18)
-#define P2PLL_DIV_0 0x002c
-# define P2PLL_FB0_DIV_MASK 0x07ff
-# define P2PLL_POST0_DIV_MASK 0x00070000
-#define P2PLL_REF_DIV 0x002B /* PLL */
-# define P2PLL_REF_DIV_MASK 0x03ff
-# define P2PLL_ATOMIC_UPDATE_R (1 << 15) /* same as _W */
-# define P2PLL_ATOMIC_UPDATE_W (1 << 15) /* same as _R */
-#define PIXCLKS_CNTL 0x002d
-# define PIX2CLK_SRC_SEL_MASK 0x03
-# define PIX2CLK_SRC_SEL_CPUCLK 0x00
-# define PIX2CLK_SRC_SEL_PSCANCLK 0x01
-# define PIX2CLK_SRC_SEL_BYTECLK 0x02
-# define PIX2CLK_SRC_SEL_P2PLLCLK 0x03
-
-/* masks */
-
-#define CONFIG_MEMSIZE_MASK 0x1f000000
-#define MEM_CFG_TYPE 0x40000000
-#define DST_OFFSET_MASK 0x003fffff
-#define DST_PITCH_MASK 0x3fc00000
-#define DEFAULT_TILE_MASK 0xc0000000
-#define PPLL_DIV_SEL_MASK 0x00000300
-#define PPLL_FB3_DIV_MASK 0x000007ff
-#define PPLL_POST3_DIV_MASK 0x00070000
-
-/* BUS MASTERING */
-#ifdef RAGE128
-#define BM_FRAME_BUF_OFFSET 0xA00
-#define BM_SYSTEM_MEM_ADDR 0xA04
-#define BM_COMMAND 0xA08
-# define BM_INTERRUPT_DIS 0x08000000
-# define BM_TRANSFER_DEST_REG 0x10000000
-# define BM_FORCE_TO_PCI 0x20000000
-# define BM_FRAME_OFFSET_HOLD 0x40000000
-# define BM_END_OF_LIST 0x80000000
-#define BM_STATUS 0xA0c
-#define BM_QUEUE_STATUS 0xA10
-#define BM_QUEUE_FREE_STATUS 0xA14
-#define BM_CHUNK_0_VAL 0xA18
-# define BM_PTR_FORCE_TO_PCI 0x00200000
-# define BM_PM4_RD_FORCE_TO_PCI 0x00400000
-# define BM_GLOBAL_FORCE_TO_PCI 0x00800000
-# define BM_VIP3_NOCHUNK 0x10000000
-# define BM_VIP2_NOCHUNK 0x20000000
-# define BM_VIP1_NOCHUNK 0x40000000
-# define BM_VIP0_NOCHUNK 0x80000000
-#define BM_CHUNK_1_VAL 0xA1C
-#define BM_VIP0_BUF 0xA20
-# define SYSTEM_TRIGGER_SYSTEM_TO_VIDEO 0x0
-# define SYSTEM_TRIGGER_VIDEO_TO_SYSTEM 0x1
-#define BM_VIP0_ACTIVE 0xA24
-#define BM_VIP1_BUF 0xA30
-#define BM_VIP1_ACTIVE 0xA34
-#define BM_VIP2_BUF 0xA40
-#define BM_VIP2_ACTIVE 0xA44
-#define BM_VIP3_BUF 0xA50
-#define BM_VIP3_ACTIVE 0xA54
-#define BM_VIDCAP_BUF0 0xA60
-#define BM_VIDCAP_BUF1 0xA64
-#define BM_VIDCAP_BUF2 0xA68
-#define BM_VIDCAP_ACTIVE 0xA6c
-#define BM_GUI 0xA80
-#define BM_ABORT 0xA88
-#endif
-/* RAGE THEATER REGISTERS */
-
-#define DMA_VIPH0_COMMAND 0x0A00
-#define DMA_VIPH1_COMMAND 0x0A04
-#define DMA_VIPH2_COMMAND 0x0A08
-#define DMA_VIPH3_COMMAND 0x0A0C
-#define DMA_VIPH_STATUS 0x0A10
-#define DMA_VIPH_CHUNK_0 0x0A18
-#define DMA_VIPH_CHUNK_1_VAL 0x0A1C
-#define DMA_VIP0_TABLE_ADDR 0x0A20
-#define DMA_VIPH0_ACTIVE 0x0A24
-#define DMA_VIP1_TABLE_ADDR 0x0A30
-#define DMA_VIPH1_ACTIVE 0x0A34
-#define DMA_VIP2_TABLE_ADDR 0x0A40
-#define DMA_VIPH2_ACTIVE 0x0A44
-#define DMA_VIP3_TABLE_ADDR 0x0A50
-#define DMA_VIPH3_ACTIVE 0x0A54
-#define DMA_VIPH_ABORT 0x0A88
-
-#define VIPH_CH0_DATA 0x0c00
-#define VIPH_CH1_DATA 0x0c04
-#define VIPH_CH2_DATA 0x0c08
-#define VIPH_CH3_DATA 0x0c0c
-#define VIPH_CH0_ADDR 0x0c10
-#define VIPH_CH1_ADDR 0x0c14
-#define VIPH_CH2_ADDR 0x0c18
-#define VIPH_CH3_ADDR 0x0c1c
-#define VIPH_CH0_SBCNT 0x0c20
-#define VIPH_CH1_SBCNT 0x0c24
-#define VIPH_CH2_SBCNT 0x0c28
-#define VIPH_CH3_SBCNT 0x0c2c
-#define VIPH_CH0_ABCNT 0x0c30
-#define VIPH_CH1_ABCNT 0x0c34
-#define VIPH_CH2_ABCNT 0x0c38
-#define VIPH_CH3_ABCNT 0x0c3c
-#define VIPH_CONTROL 0x0c40
-#define VIPH_DV_LAT 0x0c44
-#define VIPH_BM_CHUNK 0x0c48
-#define VIPH_DV_INT 0x0c4c
-#define VIPH_TIMEOUT_STAT 0x0c50
-
-#define VIPH_REG_DATA 0x0084
-#define VIPH_REG_ADDR 0x0080
-
-/* Address Space Rage Theatre Registers (VIP Access) */
-#define VIP_VIP_VENDOR_DEVICE_ID 0x0000
-#define VIP_VIP_SUB_VENDOR_DEVICE_ID 0x0004
-#define VIP_VIP_COMMAND_STATUS 0x0008
-#define VIP_VIP_REVISION_ID 0x000c
-#define VIP_HW_DEBUG 0x0010
-#define VIP_SW_SCRATCH 0x0014
-#define VIP_I2C_CNTL_0 0x0020
-#define VIP_I2C_CNTL_1 0x0024
-#define VIP_I2C_DATA 0x0028
-#define VIP_INT_CNTL 0x002c
-#define VIP_GPIO_INOUT 0x0030
-#define VIP_GPIO_CNTL 0x0034
-#define VIP_CLKOUT_GPIO_CNTL 0x0038
-#define VIP_RIPINTF_PORT_CNTL 0x003c
-#define VIP_ADC_CNTL 0x0400
-#define VIP_ADC_DEBUG 0x0404
-#define VIP_STANDARD_SELECT 0x0408
-#define VIP_THERMO2BIN_STATUS 0x040c
-#define VIP_COMB_CNTL0 0x0440
-#define VIP_COMB_CNTL1 0x0444
-#define VIP_COMB_CNTL2 0x0448
-#define VIP_COMB_LINE_LENGTH 0x044c
-#define VIP_NOISE_CNTL0 0x0450
-#define VIP_HS_PLINE 0x0480
-#define VIP_HS_DTOINC 0x0484
-#define VIP_HS_PLLGAIN 0x0488
-#define VIP_HS_MINMAXWIDTH 0x048c
-#define VIP_HS_GENLOCKDELAY 0x0490
-#define VIP_HS_WINDOW_LIMIT 0x0494
-#define VIP_HS_WINDOW_OC_SPEED 0x0498
-#define VIP_HS_PULSE_WIDTH 0x049c
-#define VIP_HS_PLL_ERROR 0x04a0
-#define VIP_HS_PLL_FS_PATH 0x04a4
-#define VIP_SG_BLACK_GATE 0x04c0
-#define VIP_SG_SYNCTIP_GATE 0x04c4
-#define VIP_SG_UVGATE_GATE 0x04c8
-#define VIP_LP_AGC_CLAMP_CNTL0 0x0500
-#define VIP_LP_AGC_CLAMP_CNTL1 0x0504
-#define VIP_LP_BRIGHTNESS 0x0508
-#define VIP_LP_CONTRAST 0x050c
-#define VIP_LP_SLICE_LIMIT 0x0510
-#define VIP_LP_WPA_CNTL0 0x0514
-#define VIP_LP_WPA_CNTL1 0x0518
-#define VIP_LP_BLACK_LEVEL 0x051c
-#define VIP_LP_SLICE_LEVEL 0x0520
-#define VIP_LP_SYNCTIP_LEVEL 0x0524
-#define VIP_LP_VERT_LOCKOUT 0x0528
-#define VIP_VS_DETECTOR_CNTL 0x0540
-#define VIP_VS_BLANKING_CNTL 0x0544
-#define VIP_VS_FIELD_ID_CNTL 0x0548
-#define VIP_VS_COUNTER_CNTL 0x054c
-#define VIP_VS_FRAME_TOTAL 0x0550
-#define VIP_VS_LINE_COUNT 0x0554
-#define VIP_CP_PLL_CNTL0 0x0580
-#define VIP_CP_PLL_CNTL1 0x0584
-#define VIP_CP_HUE_CNTL 0x0588
-#define VIP_CP_BURST_GAIN 0x058c
-#define VIP_CP_AGC_CNTL 0x0590
-#define VIP_CP_ACTIVE_GAIN 0x0594
-#define VIP_CP_PLL_STATUS0 0x0598
-#define VIP_CP_PLL_STATUS1 0x059c
-#define VIP_CP_PLL_STATUS2 0x05a0
-#define VIP_CP_PLL_STATUS3 0x05a4
-#define VIP_CP_PLL_STATUS4 0x05a8
-#define VIP_CP_PLL_STATUS5 0x05ac
-#define VIP_CP_PLL_STATUS6 0x05b0
-#define VIP_CP_PLL_STATUS7 0x05b4
-#define VIP_CP_DEBUG_FORCE 0x05b8
-#define VIP_CP_VERT_LOCKOUT 0x05bc
-#define VIP_H_ACTIVE_WINDOW 0x05c0
-#define VIP_V_ACTIVE_WINDOW 0x05c4
-#define VIP_H_VBI_WINDOW 0x05c8
-#define VIP_V_VBI_WINDOW 0x05cc
-#define VIP_VBI_CONTROL 0x05d0
-#define VIP_DECODER_DEBUG_CNTL 0x05d4
-#define VIP_SINGLE_STEP_DATA 0x05d8
-#define VIP_MASTER_CNTL 0x0040
-#define VIP_RGB_CNTL 0x0048
-#define VIP_CLKOUT_CNTL 0x004c
-#define VIP_SYNC_CNTL 0x0050
-#define VIP_I2C_CNTL 0x0054
-#define VIP_HTOTAL 0x0080
-#define VIP_HDISP 0x0084
-#define VIP_HSIZE 0x0088
-#define VIP_HSTART 0x008c
-#define VIP_HCOUNT 0x0090
-#define VIP_VTOTAL 0x0094
-#define VIP_VDISP 0x0098
-#define VIP_VCOUNT 0x009c
-#define VIP_VFTOTAL 0x00a0
-#define VIP_DFCOUNT 0x00a4
-#define VIP_DFRESTART 0x00a8
-#define VIP_DHRESTART 0x00ac
-#define VIP_DVRESTART 0x00b0
-#define VIP_SYNC_SIZE 0x00b4
-#define VIP_TV_PLL_FINE_CNTL 0x00b8
-#define VIP_CRT_PLL_FINE_CNTL 0x00bc
-#define VIP_TV_PLL_CNTL 0x00c0
-#define VIP_CRT_PLL_CNTL 0x00c4
-#define VIP_PLL_CNTL0 0x00c8
-#define VIP_PLL_TEST_CNTL 0x00cc
-#define VIP_CLOCK_SEL_CNTL 0x00d0
-#define VIP_VIN_PLL_CNTL 0x00d4
-#define VIP_VIN_PLL_FINE_CNTL 0x00d8
-#define VIP_AUD_PLL_CNTL 0x00e0
-#define VIP_AUD_PLL_FINE_CNTL 0x00e4
-#define VIP_AUD_CLK_DIVIDERS 0x00e8
-#define VIP_AUD_DTO_INCREMENTS 0x00ec
-#define VIP_L54_PLL_CNTL 0x00f0
-#define VIP_L54_PLL_FINE_CNTL 0x00f4
-#define VIP_L54_DTO_INCREMENTS 0x00f8
-#define VIP_PLL_CNTL1 0x00fc
-#define VIP_FRAME_LOCK_CNTL 0x0100
-#define VIP_SYNC_LOCK_CNTL 0x0104
-#define VIP_TVO_SYNC_PAT_ACCUM 0x0108
-#define VIP_TVO_SYNC_THRESHOLD 0x010c
-#define VIP_TVO_SYNC_PAT_EXPECT 0x0110
-#define VIP_DELAY_ONE_MAP_A 0x0114
-#define VIP_DELAY_ONE_MAP_B 0x0118
-#define VIP_DELAY_ZERO_MAP_A 0x011c
-#define VIP_DELAY_ZERO_MAP_B 0x0120
-#define VIP_TVO_DATA_DELAY_A 0x0140
-#define VIP_TVO_DATA_DELAY_B 0x0144
-#define VIP_HOST_READ_DATA 0x0180
-#define VIP_HOST_WRITE_DATA 0x0184
-#define VIP_HOST_RD_WT_CNTL 0x0188
-#define VIP_VSCALER_CNTL1 0x01c0
-#define VIP_TIMING_CNTL 0x01c4
-#define VIP_VSCALER_CNTL2 0x01c8
-#define VIP_Y_FALL_CNTL 0x01cc
-#define VIP_Y_RISE_CNTL 0x01d0
-#define VIP_Y_SAW_TOOTH_CNTL 0x01d4
-#define VIP_UPSAMP_AND_GAIN_CNTL 0x01e0
-#define VIP_GAIN_LIMIT_SETTINGS 0x01e4
-#define VIP_LINEAR_GAIN_SETTINGS 0x01e8
-#define VIP_MODULATOR_CNTL1 0x0200
-#define VIP_MODULATOR_CNTL2 0x0204
-#define VIP_MV_MODE_CNTL 0x0208
-#define VIP_MV_STRIPE_CNTL 0x020c
-#define VIP_MV_LEVEL_CNTL1 0x0210
-#define VIP_MV_LEVEL_CNTL2 0x0214
-#define VIP_PRE_DAC_MUX_CNTL 0x0240
-#define VIP_TV_DAC_CNTL 0x0280
-#define VIP_CRC_CNTL 0x02c0
-#define VIP_VIDEO_PORT_SIG 0x02c4
-#define VIP_VBI_CC_CNTL 0x02c8
-#define VIP_VBI_EDS_CNTL 0x02cc
-#define VIP_VBI_20BIT_CNTL 0x02d0
-#define VIP_VBI_DTO_CNTL 0x02d4
-#define VIP_VBI_LEVEL_CNTL 0x02d8
-#define VIP_UV_ADR 0x0300
-#define VIP_MV_STATUS 0x0330
-#define VIP_UPSAMP_COEFF0_0 0x0340
-#define VIP_UPSAMP_COEFF0_1 0x0344
-#define VIP_UPSAMP_COEFF0_2 0x0348
-#define VIP_UPSAMP_COEFF1_0 0x034c
-#define VIP_UPSAMP_COEFF1_1 0x0350
-#define VIP_UPSAMP_COEFF1_2 0x0354
-#define VIP_UPSAMP_COEFF2_0 0x0358
-#define VIP_UPSAMP_COEFF2_1 0x035c
-#define VIP_UPSAMP_COEFF2_2 0x0360
-#define VIP_UPSAMP_COEFF3_0 0x0364
-#define VIP_UPSAMP_COEFF3_1 0x0368
-#define VIP_UPSAMP_COEFF3_2 0x036c
-#define VIP_UPSAMP_COEFF4_0 0x0370
-#define VIP_UPSAMP_COEFF4_1 0x0374
-#define VIP_UPSAMP_COEFF4_2 0x0378
-#define VIP_TV_DTO_INCREMENTS 0x0390
-#define VIP_CRT_DTO_INCREMENTS 0x0394
-#define VIP_VSYNC_DIFF_CNTL 0x03a0
-#define VIP_VSYNC_DIFF_LIMITS 0x03a4
-#define VIP_VSYNC_DIFF_RD_DATA 0x03a8
-#define VIP_SCALER_IN_WINDOW 0x0618
-#define VIP_SCALER_OUT_WINDOW 0x061c
-#define VIP_H_SCALER_CONTROL 0x0600
-#define VIP_V_SCALER_CONTROL 0x0604
-#define VIP_V_DEINTERLACE_CONTROL 0x0608
-#define VIP_VBI_SCALER_CONTROL 0x060c
-#define VIP_DVS_PORT_CTRL 0x0610
-#define VIP_DVS_PORT_READBACK 0x0614
-#define VIP_FIFOA_CONFIG 0x0800
-#define VIP_FIFOB_CONFIG 0x0804
-#define VIP_FIFOC_CONFIG 0x0808
-#define VIP_SPDIF_PORT_CNTL 0x080c
-#define VIP_SPDIF_CHANNEL_STAT 0x0810
-#define VIP_SPDIF_AC3_PREAMBLE 0x0814
-#define VIP_I2S_TRANSMIT_CNTL 0x0818
-#define VIP_I2S_RECEIVE_CNTL 0x081c
-#define VIP_SPDIF_TX_CNT_REG 0x0820
-#define VIP_IIS_TX_CNT_REG 0x0824
-
-/* Status defines */
-#define VIP_BUSY 0
-#define VIP_IDLE 1
-#define VIP_RESET 2
-
-#define VIPH_TIMEOUT_STAT__VIPH_REG_STAT 0x00000010
-#define VIPH_TIMEOUT_STAT__VIPH_REG_AK 0x00000010
-#define VIPH_TIMEOUT_STAT__VIPH_REGR_DIS 0x01000000
-#define TEST_DEBUG_CNTL__TEST_DEBUG_OUT_EN 0x00000001
-
-#define RT_ATI_ID 0x4D541002
-
-/* Register/Field values: */
-#define RT_COMP0 0x0
-#define RT_COMP1 0x1
-#define RT_COMP2 0x2
-#define RT_YF_COMP3 0x3
-#define RT_YR_COMP3 0x4
-#define RT_YCF_COMP4 0x5
-#define RT_YCR_COMP4 0x6
-
-/* Video standard defines */
-#define RT_NTSC 0x0
-#define RT_PAL 0x1
-#define RT_SECAM 0x2
-#define extNONE 0x0000
-#define extNTSC 0x0100
-#define extRsvd 0x0200
-#define extPAL 0x0300
-#define extPAL_M 0x0400
-#define extPAL_N 0x0500
-#define extSECAM 0x0600
-#define extPAL_NCOMB 0x0700
-#define extNTSC_J 0x0800
-#define extNTSC_443 0x0900
-#define extPAL_BGHI 0x0A00
-#define extPAL_60 0x0B00
- /* these are used in MSP3430 */
-#define extPAL_DK1 0x0C00
-#define extPAL_AUTO 0x0D00
-
-#define RT_FREF_2700 6
-#define RT_FREF_2950 5
-
-#define RT_COMPOSITE 0x0
-#define RT_SVIDEO 0x1
-
-#define RT_NORM_SHARPNESS 0x03
-#define RT_HIGH_SHARPNESS 0x0F
-
-#define RT_HUE_PAL_DEF 0x00
-
-#define RT_DECINTERLACED 0x1
-#define RT_DECNONINTERLACED 0x0
-
-#define NTSC_LINES 525
-#define PAL_SECAM_LINES 625
-
-#define RT_ASYNC_ENABLE 0x0
-#define RT_ASYNC_DISABLE 0x1
-#define RT_ASYNC_RESET 0x1
-
-#define RT_VINRST_ACTIVE 0x0
-#define RT_VINRST_RESET 0x1
-#define RT_L54RST_RESET 0x1
-
-#define RT_REF_CLK 0x0
-#define RT_PLL_VIN_CLK 0x1
-
-#define RT_VIN_ASYNC_RST 0x20
-#define RT_DVS_ASYNC_RST 0x80
-
-#define RT_ADC_ENABLE 0x0
-#define RT_ADC_DISABLE 0x1
-
-#define RT_DVSDIR_IN 0x0
-#define RT_DVSDIR_OUT 0x1
-
-#define RT_DVSCLK_HIGH 0x0
-#define RT_DVSCLK_LOW 0x1
-
-#define RT_DVSCLK_SEL_8FS 0x0
-#define RT_DVSCLK_SEL_27MHZ 0x1
-
-#define RT_DVS_CONTSTREAM 0x1
-#define RT_DVS_NONCONTSTREAM 0x0
-
-#define RT_DVSDAT_HIGH 0x0
-#define RT_DVSDAT_LOW 0x1
-
-#define RT_ADC_CNTL_DEFAULT 0x03252338
-
-/* COMB_CNTL0 FILTER SETTINGS FOR DIFFERENT STANDARDS: */
-#define RT_NTSCM_COMB_CNTL0_COMPOSITE 0x09438090
-#define RT_NTSCM_COMB_CNTL0_SVIDEO 0x48540000
-
-#define RT_PAL_COMB_CNTL0_COMPOSITE 0x09438090
-#define RT_PAL_COMB_CNTL0_SVIDEO 0x40348090
-
-#define RT_SECAM_COMB_CNTL0_COMPOSITE 0xD0108090 /* instead of orig 0xD0088090 - eric*/
-#define RT_SECAM_COMB_CNTL0_SVIDEO 0x50148090
-
-#define RT_PALN_COMB_CNTL0_COMPOSITE 0x09438090
-#define RT_PALN_COMB_CNTL0_SVIDEO 0x40348090
-
-#define RT_PALM_COMB_CNTL0_COMPOSITE 0x09438090
-#define RT_PALM_COMB_CNTL0_SVIDEO 0x40348090
-/* End of filter settings. */
-
-/* COMB_CNTL1 FILTER SETTINGS FOR DIFFERENT STANDARDS: */
-#define RT_NTSCM_COMB_CNTL1_COMPOSITE 0x00000010
-#define RT_NTSCM_COMB_CNTL1_SVIDEO 0x00000081
-
-#define RT_PAL_COMB_CNTL1_COMPOSITE 0x00000010
-#define RT_PAL_COMB_CNTL1_SVIDEO 0x000000A1
-
-#define RT_SECAM_COMB_CNTL1_COMPOSITE 0x00000091
-#define RT_SECAM_COMB_CNTL1_SVIDEO 0x00000081
-
-#define RT_PALN_COMB_CNTL1_COMPOSITE 0x00000010
-#define RT_PALN_COMB_CNTL1_SVIDEO 0x000000A1
-
-#define RT_PALM_COMB_CNTL1_COMPOSITE 0x00000010
-#define RT_PALM_COMB_CNTL1_SVIDEO 0x000000A1
-/* End of filter settings. */
-
-/* COMB_CNTL2 FILTER SETTINGS FOR DIFFERENT STANDARDS: */
-#define RT_NTSCM_COMB_CNTL2_COMPOSITE 0x16161010
-#define RT_NTSCM_COMB_CNTL2_SVIDEO 0xFFFFFFFF
-
-#define RT_PAL_COMB_CNTL2_COMPOSITE 0x06080102 /* instead of 0x16161010 - Ivo */
-#define RT_PAL_COMB_CNTL2_SVIDEO 0x06080102
-
-#define RT_SECAM_COMB_CNTL2_COMPOSITE 0xffffffff /* instead of 0x06080102 - eric */
-#define RT_SECAM_COMB_CNTL2_SVIDEO 0x06080102
-
-#define RT_PALN_COMB_CNTL2_COMPOSITE 0x06080102
-#define RT_PALN_COMB_CNTL2_SVIDEO 0x06080102
-
-#define RT_PALM_COMB_CNTL2_COMPOSITE 0x06080102
-#define RT_PALM_COMB_CNTL2_SVIDEO 0x06080102
-/* End of filter settings. */
-
-/* COMB_LINE_LENGTH FILTER SETTINGS FOR DIFFERENT STANDARDS: */
-#define RT_NTSCM_COMB_LENGTH_COMPOSITE 0x0718038A
-#define RT_NTSCM_COMB_LENGTH_SVIDEO 0x0718038A
-
-#define RT_PAL_COMB_LENGTH_COMPOSITE 0x08DA046B
-#define RT_PAL_COMB_LENGTH_SVIDEO 0x08DA046B
-
-#define RT_SECAM_COMB_LENGTH_COMPOSITE 0x08DA046A
-#define RT_SECAM_COMB_LENGTH_SVIDEO 0x08DA046A
-
-#define RT_PALN_COMB_LENGTH_COMPOSITE 0x07260391
-#define RT_PALN_COMB_LENGTH_SVIDEO 0x07260391
-
-#define RT_PALM_COMB_LENGTH_COMPOSITE 0x07160389
-#define RT_PALM_COMB_LENGTH_SVIDEO 0x07160389
-/* End of filter settings. */
-
-/* LP_AGC_CLAMP_CNTL0 */
-#define RT_NTSCM_SYNCTIP_REF0 0x00000037
-#define RT_NTSCM_SYNCTIP_REF1 0x00000029
-#define RT_NTSCM_CLAMP_REF 0x0000003B
-#define RT_NTSCM_PEAKWHITE 0x000000FF
-#define RT_NTSCM_VBI_PEAKWHITE 0x000000C2
-
-#define RT_NTSCM_WPA_THRESHOLD 0x00000406
-#define RT_NTSCM_WPA_TRIGGER_LO 0x000000B3
-
-#define RT_NTSCM_WPA_TRIGGER_HIGH 0x0000021B
-
-#define RT_NTSCM_LP_LOCKOUT_START 0x00000206
-#define RT_NTSCM_LP_LOCKOUT_END 0x00000021
-#define RT_NTSCM_CH_DTO_INC 0x00400000
-#define RT_NTSCM_CH_PLL_SGAIN 0x00000001
-#define RT_NTSCM_CH_PLL_FGAIN 0x00000002
-
-#define RT_NTSCM_CR_BURST_GAIN 0x0000007A
-#define RT_NTSCM_CB_BURST_GAIN 0x000000AC
-
-#define RT_NTSCM_CH_HEIGHT 0x000000CD
-#define RT_NTSCM_CH_KILL_LEVEL 0x000000C0
-#define RT_NTSCM_CH_AGC_ERROR_LIM 0x00000002
-#define RT_NTSCM_CH_AGC_FILTER_EN 0x00000000
-#define RT_NTSCM_CH_AGC_LOOP_SPEED 0x00000000
-
-#define RT_NTSCM_CRDR_ACTIVE_GAIN 0x0000007A
-#define RT_NTSCM_CBDB_ACTIVE_GAIN 0x000000AC
-
-#define RT_NTSCM_VERT_LOCKOUT_START 0x00000207
-#define RT_NTSCM_VERT_LOCKOUT_END 0x0000000E
-
-#define RT_NTSCJ_SYNCTIP_REF0 0x00000004
-#define RT_NTSCJ_SYNCTIP_REF1 0x00000012
-#define RT_NTSCJ_CLAMP_REF 0x0000003B
-#define RT_NTSCJ_PEAKWHITE 0x000000CB
-#define RT_NTSCJ_VBI_PEAKWHITE 0x000000C2
-#define RT_NTSCJ_WPA_THRESHOLD 0x000004B0
-#define RT_NTSCJ_WPA_TRIGGER_LO 0x000000B4
-#define RT_NTSCJ_WPA_TRIGGER_HIGH 0x0000021C
-#define RT_NTSCJ_LP_LOCKOUT_START 0x00000206
-#define RT_NTSCJ_LP_LOCKOUT_END 0x00000021
-
-#define RT_NTSCJ_CR_BURST_GAIN 0x00000071
-#define RT_NTSCJ_CB_BURST_GAIN 0x0000009F
-#define RT_NTSCJ_CH_HEIGHT 0x000000CD
-#define RT_NTSCJ_CH_KILL_LEVEL 0x000000C0
-#define RT_NTSCJ_CH_AGC_ERROR_LIM 0x00000002
-#define RT_NTSCJ_CH_AGC_FILTER_EN 0x00000000
-#define RT_NTSCJ_CH_AGC_LOOP_SPEED 0x00000000
-
-#define RT_NTSCJ_CRDR_ACTIVE_GAIN 0x00000071
-#define RT_NTSCJ_CBDB_ACTIVE_GAIN 0x0000009F
-#define RT_NTSCJ_VERT_LOCKOUT_START 0x00000207
-#define RT_NTSCJ_VERT_LOCKOUT_END 0x0000000E
-
-#define RT_PAL_SYNCTIP_REF0 0x37 /* instead of 0x00000004 - Ivo */
-#define RT_PAL_SYNCTIP_REF1 0x26 /* instead of 0x0000000F - Ivo */
-#define RT_PAL_CLAMP_REF 0x0000003B
-#define RT_PAL_PEAKWHITE 0xFF /* instead of 0x000000C1 - Ivo */
-#define RT_PAL_VBI_PEAKWHITE 0xC6 /* instead of 0x000000C7 - Ivo */
-#define RT_PAL_WPA_THRESHOLD 0x59C /* instead of 0x000006A4 - Ivo */
-
-#define RT_PAL_WPA_TRIGGER_LO 0x00000096
-#define RT_PAL_WPA_TRIGGER_HIGH 0x000001C2
-#define RT_PAL_LP_LOCKOUT_START 0x00000263
-#define RT_PAL_LP_LOCKOUT_END 0x0000002C
-
-#define RT_PAL_CH_DTO_INC 0x00400000
-#define RT_PAL_CH_PLL_SGAIN 1 /* instead of 0x00000002 - Ivo */
-#define RT_PAL_CH_PLL_FGAIN 2 /* instead of 0x00000001 - Ivo */
-#define RT_PAL_CR_BURST_GAIN 0x0000007A
-#define RT_PAL_CB_BURST_GAIN 0x000000AB
-#define RT_PAL_CH_HEIGHT 0x0000009C
-#define RT_PAL_CH_KILL_LEVEL 4 /* instead of 0x00000090 - Ivo */
-#define RT_PAL_CH_AGC_ERROR_LIM 1 /* instead of 0x00000002 - Ivo */
-#define RT_PAL_CH_AGC_FILTER_EN 1 /* instead of 0x00000000 - Ivo */
-#define RT_PAL_CH_AGC_LOOP_SPEED 0x00000000
-
-#define RT_PAL_CRDR_ACTIVE_GAIN 0x9E /* instead of 0x0000007A - Ivo */
-#define RT_PAL_CBDB_ACTIVE_GAIN 0xDF /* instead of 0x000000AB - Ivo */
-#define RT_PAL_VERT_LOCKOUT_START 0x00000269
-#define RT_PAL_VERT_LOCKOUT_END 0x00000012
-
-#define RT_SECAM_SYNCTIP_REF0 0x37 /* instead of 0x00000004 - Ivo */
-#define RT_SECAM_SYNCTIP_REF1 0x26 /* instead of 0x0000000F - Ivo */
-#define RT_SECAM_CLAMP_REF 0x0000003B
-#define RT_SECAM_PEAKWHITE 0xFF /* instead of 0x000000C1 - Ivo */
-#define RT_SECAM_VBI_PEAKWHITE 0xC6 /* instead of 0x000000C7 - Ivo */
-#define RT_SECAM_WPA_THRESHOLD 0x57A /* instead of 0x6A4, instead of 0x0000059C is Ivo's value , -eric*/
-
-#define RT_SECAM_WPA_TRIGGER_LO 0x96 /* instead of 0x0000026B - eric */
-#define RT_SECAM_WPA_TRIGGER_HIGH 0x000001C2
-#define RT_SECAM_LP_LOCKOUT_START 0x263 /* instead of 0x0000026B - eric */
-#define RT_SECAM_LP_LOCKOUT_END 0x2b /* instead of 0x0000002C -eric */
-
-#define RT_SECAM_CH_DTO_INC 0x003E7A28
-#define RT_SECAM_CH_PLL_SGAIN 0x4 /* instead of 0x00000006 -Volodya */
-#define RT_SECAM_CH_PLL_FGAIN 0x7 /* instead of 0x00000006 -Volodya */
-
-#define RT_SECAM_CR_BURST_GAIN 0x1FF /* instead of 0x00000200 -Volodya */
-#define RT_SECAM_CB_BURST_GAIN 0x1FF /* instead of 0x00000200 -Volodya */
-#define RT_SECAM_CH_HEIGHT 0x00000066
-#define RT_SECAM_CH_KILL_LEVEL 0x00000060
-#define RT_SECAM_CH_AGC_ERROR_LIM 0x00000003
-#define RT_SECAM_CH_AGC_FILTER_EN 0x00000000
-#define RT_SECAM_CH_AGC_LOOP_SPEED 0x00000000
-
-#define RT_SECAM_CRDR_ACTIVE_GAIN 0x11B /* instead of 0x00000200 - eric */
-#define RT_SECAM_CBDB_ACTIVE_GAIN 0x15A /* instead of 0x00000200 - eric */
-#define RT_SECAM_VERT_LOCKOUT_START 0x00000269
-#define RT_SECAM_VERT_LOCKOUT_END 0x00000012
-
-#define RT_PAL_VS_FIELD_BLANK_END 0x2A /* instead of 0x0000002C - Ivo*/
-#define RT_NTSCM_VS_FIELD_BLANK_END 0x0000000A
-
-#define RT_NTSCM_FIELD_IDLOCATION 0x00000105
-#define RT_PAL_FIELD_IDLOCATION 0x00000137
-
-#define RT_NTSCM_H_ACTIVE_START 0x00000070
-#define RT_NTSCM_H_ACTIVE_END 0x00000363
-
-#define RT_PAL_H_ACTIVE_START 0x0000009A
-#define RT_PAL_H_ACTIVE_END 0x00000439
-
-#define RT_NTSCM_V_ACTIVE_START ((22-4)*2+1)
-#define RT_NTSCM_V_ACTIVE_END ((22+240-4)*2+1)
-
-#define RT_PAL_V_ACTIVE_START 0x2E /* instead of 0x00000023 (Same as SECAM) - Ivo */
-#define RT_PAL_V_ACTIVE_END 0x269 /* instead of 0x00000262 - Ivo */
-
-/* VBI */
-#define RT_NTSCM_H_VBI_WIND_START 0x00000049
-#define RT_NTSCM_H_VBI_WIND_END 0x00000366
-
-#define RT_PAL_H_VBI_WIND_START 0x00000084
-#define RT_PAL_H_VBI_WIND_END 0x0000041F
-
-#define RT_NTSCM_V_VBI_WIND_START fld_V_VBI_WIND_START_def
-#define RT_NTSCM_V_VBI_WIND_END fld_V_VBI_WIND_END_def
-
-#define RT_PAL_V_VBI_WIND_START 0x8 /* instead of 0x0000000B - Ivo */
-#define RT_PAL_V_VBI_WIND_END 0x2D /* instead of 0x00000022 - Ivo */
-
-#define RT_VBI_CAPTURE_EN 0x00000001 /* Enable */
-#define RT_VBI_CAPTURE_DIS 0x00000000 /* Disable */
-#define RT_RAW_CAPTURE 0x00000002 /* Use raw Video Capture. */
-
-#define RT_NTSCM_VSYNC_INT_TRIGGER 0x2AA
-#define RT_PALSEM_VSYNC_INT_TRIGGER 0x353
-
-#define RT_NTSCM_VSYNC_INT_HOLD 0x17
-#define RT_PALSEM_VSYNC_INT_HOLD 0x1C
-
-#define RT_NTSCM_VS_FIELD_BLANK_START 0x206
-#define RT_PALSEM_VS_FIELD_BLANK_START 0x26D /* instead of 0x26C - Ivo */
-
-#define RT_FIELD_FLIP_EN 0x4
-#define RT_V_FIELD_FLIP_INVERTED 0x2000
-
-#define RT_NTSCM_H_IN_START 0x70
-#define RT_PAL_H_IN_START 154 /* instead of 144 - Ivo */
-#define RT_SECAM_H_IN_START 0x91 /* instead of 0x9A, Ivo value is 154, instead of 144 - Volodya, - eric */
-#define RT_NTSC_H_ACTIVE_SIZE 744
-#define RT_PAL_H_ACTIVE_SIZE 928 /* instead of 927 - Ivo */
-#define RT_SECAM_H_ACTIVE_SIZE 932 /* instead of 928, instead of 927 - Ivo, - eric */
-#define RT_NTSCM_V_IN_START (0x23)
-#define RT_PAL_V_IN_START 44 /* instead of (45-6) - Ivo */
-#define RT_SECAM_V_IN_START 0x2C /* instead of (45-6) - Volodya */
-#define RT_NTSCM_V_ACTIVE_SIZE 480
-#define RT_PAL_V_ACTIVE_SIZE 572 /* instead of 575 - Ivo */
-#define RT_SECAM_V_ACTIVE_SIZE 570 /* instead of 572, instead of 575 - Ivo, - eric */
-
-#define RT_NTSCM_WIN_CLOSE_LIMIT 0x4D
-#define RT_NTSCJ_WIN_CLOSE_LIMIT 0x4D
-#define RT_NTSC443_WIN_CLOSE_LIMIT 0x5F
-#define RT_PALM_WIN_CLOSE_LIMIT 0x4D
-#define RT_PALN_WIN_CLOSE_LIMIT 0x5F
-#define RT_SECAM_WIN_CLOSE_LIMIT 0xC7 /* instead of 0x5F - eric */
-
-#define RT_NTSCM_VS_FIELD_BLANK_START 0x206
-
-#define RT_NTSCM_HS_PLL_SGAIN 0x5
-#define RT_NTSCM_HS_PLL_FGAIN 0x7
-
-#define RT_NTSCM_H_OUT_WIND_WIDTH 0x2F4
-#define RT_NTSCM_V_OUT_WIND_HEIGHT 0xF0
-
-#define TV 0x1
-#define LINEIN 0x2
-#define MUTE 0x3
-
-#define DEC_COMPOSITE 0
-#define DEC_SVIDEO 1
-#define DEC_TUNER 2
-
-#define DEC_NTSC 0
-#define DEC_PAL 1
-#define DEC_SECAM 2
-#define DEC_NTSC_J 8
-
-#define DEC_SMOOTH 0
-#define DEC_SHARP 1
-
-/* RT Register Field Defaults: */
-#define fld_tmpReg1_def 0x00000000
-#define fld_tmpReg2_def 0x00000001
-#define fld_tmpReg3_def 0x00000002
-
-#define fld_LP_CONTRAST_def 0x0000006e
-#define fld_LP_BRIGHTNESS_def 0x00003ff0
-#define fld_CP_HUE_CNTL_def 0x00000000
-#define fld_LUMA_FILTER_def 0x00000001
-#define fld_H_SCALE_RATIO_def 0x00010000
-#define fld_H_SHARPNESS_def 0x00000000
-
-#define fld_V_SCALE_RATIO_def 0x00000800
-#define fld_V_DEINTERLACE_ON_def 0x00000001
-#define fld_V_BYPSS_def 0x00000000
-#define fld_V_DITHER_ON_def 0x00000001
-#define fld_EVENF_OFFSET_def 0x00000000
-#define fld_ODDF_OFFSET_def 0x00000000
-
-#define fld_INTERLACE_DETECTED_def 0x00000000
-
-#define fld_VS_LINE_COUNT_def 0x00000000
-#define fld_VS_DETECTED_LINES_def 0x00000000
-#define fld_VS_ITU656_VB_def 0x00000000
-
-#define fld_VBI_CC_DATA_def 0x00000000
-#define fld_VBI_CC_WT_def 0x00000000
-#define fld_VBI_CC_WT_ACK_def 0x00000000
-#define fld_VBI_CC_HOLD_def 0x00000000
-#define fld_VBI_DECODE_EN_def 0x00000000
-
-#define fld_VBI_CC_DTO_P_def 0x00001802
-#define fld_VBI_20BIT_DTO_P_def 0x0000155c
-
-#define fld_VBI_CC_LEVEL_def 0x0000003f
-#define fld_VBI_20BIT_LEVEL_def 0x00000059
-#define fld_VBI_CLK_RUNIN_GAIN_def 0x0000010f
-
-#define fld_H_VBI_WIND_START_def 0x00000041
-#define fld_H_VBI_WIND_END_def 0x00000366
-
-#define fld_V_VBI_WIND_START_def 0x0D
-#define fld_V_VBI_WIND_END_def 0x24
-
-#define fld_VBI_20BIT_DATA0_def 0x00000000
-#define fld_VBI_20BIT_DATA1_def 0x00000000
-#define fld_VBI_20BIT_WT_def 0x00000000
-#define fld_VBI_20BIT_WT_ACK_def 0x00000000
-#define fld_VBI_20BIT_HOLD_def 0x00000000
-
-#define fld_VBI_CAPTURE_ENABLE_def 0x00000000
-
-#define fld_VBI_EDS_DATA_def 0x00000000
-#define fld_VBI_EDS_WT_def 0x00000000
-#define fld_VBI_EDS_WT_ACK_def 0x00000000
-#define fld_VBI_EDS_HOLD_def 0x00000000
-
-#define fld_VBI_SCALING_RATIO_def 0x00010000
-#define fld_VBI_ALIGNER_ENABLE_def 0x00000000
-
-#define fld_H_ACTIVE_START_def 0x00000070
-#define fld_H_ACTIVE_END_def 0x000002f0
-
-#define fld_V_ACTIVE_START_def ((22-4)*2+1)
-#define fld_V_ACTIVE_END_def ((22+240-4)*2+2)
-
-#define fld_CH_HEIGHT_def 0x000000CD
-#define fld_CH_KILL_LEVEL_def 0x000000C0
-#define fld_CH_AGC_ERROR_LIM_def 0x00000002
-#define fld_CH_AGC_FILTER_EN_def 0x00000000
-#define fld_CH_AGC_LOOP_SPEED_def 0x00000000
-
-#define fld_HUE_ADJ_def 0x00000000
-
-#define fld_STANDARD_SEL_def 0x00000000
-#define fld_STANDARD_YC_def 0x00000000
-
-#define fld_ADC_PDWN_def 0x00000001
-#define fld_INPUT_SELECT_def 0x00000000
-
-#define fld_ADC_PREFLO_def 0x00000003
-#define fld_H_SYNC_PULSE_WIDTH_def 0x00000000
-#define fld_HS_GENLOCKED_def 0x00000000
-#define fld_HS_SYNC_IN_WIN_def 0x00000000
-
-#define fld_VIN_ASYNC_RST_def 0x00000001
-#define fld_DVS_ASYNC_RST_def 0x00000001
-
-/* Vendor IDs: */
-#define fld_VIP_VENDOR_ID_def 0x00001002
-#define fld_VIP_DEVICE_ID_def 0x00004d54
-#define fld_VIP_REVISION_ID_def 0x00000001
-
-/* AGC Delay Register */
-#define fld_BLACK_INT_START_def 0x00000031
-#define fld_BLACK_INT_LENGTH_def 0x0000000f
-
-#define fld_UV_INT_START_def 0x0000003b
-#define fld_U_INT_LENGTH_def 0x0000000f
-#define fld_V_INT_LENGTH_def 0x0000000f
-#define fld_CRDR_ACTIVE_GAIN_def 0x0000007a
-#define fld_CBDB_ACTIVE_GAIN_def 0x000000ac
-
-#define fld_DVS_DIRECTION_def 0x00000000
-#define fld_DVS_VBI_CARD8_SWAP_def 0x00000000
-#define fld_DVS_CLK_SELECT_def 0x00000000
-#define fld_CONTINUOUS_STREAM_def 0x00000000
-#define fld_DVSOUT_CLK_DRV_def 0x00000001
-#define fld_DVSOUT_DATA_DRV_def 0x00000001
-
-#define fld_COMB_CNTL0_def 0x09438090
-#define fld_COMB_CNTL1_def 0x00000010
-
-#define fld_COMB_CNTL2_def 0x16161010
-#define fld_COMB_LENGTH_def 0x0718038A
-
-#define fld_SYNCTIP_REF0_def 0x00000037
-#define fld_SYNCTIP_REF1_def 0x00000029
-#define fld_CLAMP_REF_def 0x0000003B
-#define fld_AGC_PEAKWHITE_def 0x000000FF
-#define fld_VBI_PEAKWHITE_def 0x000000D2
-
-#define fld_WPA_THRESHOLD_def 0x000003B0
-
-#define fld_WPA_TRIGGER_LO_def 0x000000B4
-#define fld_WPA_TRIGGER_HIGH_def 0x0000021C
-
-#define fld_LOCKOUT_START_def 0x00000206
-#define fld_LOCKOUT_END_def 0x00000021
-
-#define fld_CH_DTO_INC_def 0x00400000
-#define fld_PLL_SGAIN_def 0x00000001
-#define fld_PLL_FGAIN_def 0x00000002
-
-#define fld_CR_BURST_GAIN_def 0x0000007a
-#define fld_CB_BURST_GAIN_def 0x000000ac
-
-#define fld_VERT_LOCKOUT_START_def 0x00000207
-#define fld_VERT_LOCKOUT_END_def 0x0000000E
-
-#define fld_H_IN_WIND_START_def 0x00000070
-#define fld_V_IN_WIND_START_def 0x00000027
-
-#define fld_H_OUT_WIND_WIDTH_def 0x000002f4
-
-#define fld_V_OUT_WIND_WIDTH_def 0x000000f0
-
-#define fld_HS_LINE_TOTAL_def 0x0000038E
-
-#define fld_MIN_PULSE_WIDTH_def 0x0000002F
-#define fld_MAX_PULSE_WIDTH_def 0x00000046
-
-#define fld_WIN_CLOSE_LIMIT_def 0x0000004D
-#define fld_WIN_OPEN_LIMIT_def 0x000001B7
-
-#define fld_VSYNC_INT_TRIGGER_def 0x000002AA
-
-#define fld_VSYNC_INT_HOLD_def 0x0000001D
-
-#define fld_VIN_M0_def 0x00000039
-#define fld_VIN_N0_def 0x0000014c
-#define fld_MNFLIP_EN_def 0x00000000
-#define fld_VIN_P_def 0x00000006
-#define fld_REG_CLK_SEL_def 0x00000000
-
-#define fld_VIN_M1_def 0x00000000
-#define fld_VIN_N1_def 0x00000000
-#define fld_VIN_DRIVER_SEL_def 0x00000000
-#define fld_VIN_MNFLIP_REQ_def 0x00000000
-#define fld_VIN_MNFLIP_DONE_def 0x00000000
-#define fld_TV_LOCK_TO_VIN_def 0x00000000
-#define fld_TV_P_FOR_WINCLK_def 0x00000004
-
-#define fld_VINRST_def 0x00000001
-#define fld_VIN_CLK_SEL_def 0x00000000
-
-#define fld_VS_FIELD_BLANK_START_def 0x00000206
-
-#define fld_VS_FIELD_BLANK_END_def 0x0000000A
-
-/*#define fld_VS_FIELD_IDLOCATION_def 0x00000105 */
-#define fld_VS_FIELD_IDLOCATION_def 0x00000001
-#define fld_VS_FRAME_TOTAL_def 0x00000217
-
-#define fld_SYNC_TIP_START_def 0x00000372
-#define fld_SYNC_TIP_LENGTH_def 0x0000000F
-
-#define fld_GAIN_FORCE_DATA_def 0x00000000
-#define fld_GAIN_FORCE_EN_def 0x00000000
-#define fld_I_CLAMP_SEL_def 0x00000003
-#define fld_I_AGC_SEL_def 0x00000001
-#define fld_EXT_CLAMP_CAP_def 0x00000001
-#define fld_EXT_AGC_CAP_def 0x00000001
-#define fld_DECI_DITHER_EN_def 0x00000001
-#define fld_ADC_PREFHI_def 0x00000000
-#define fld_ADC_CH_GAIN_SEL_def 0x00000001
-
-#define fld_HS_PLL_SGAIN_def 0x00000003
-
-#define fld_NREn_def 0x00000000
-#define fld_NRGainCntl_def 0x00000000
-#define fld_NRBWTresh_def 0x00000000
-#define fld_NRGCTresh_def 0x00000000
-#define fld_NRCoefDespeclMode_def 0x00000000
-
-#define fld_GPIO_5_OE_def 0x00000000
-#define fld_GPIO_6_OE_def 0x00000000
-
-#define fld_GPIO_5_OUT_def 0x00000000
-#define fld_GPIO_6_OUT_def 0x00000000
-
-/* End of field default values. */
-
-#endif /* RADEON_H */
diff --git a/src/video_out/vidix/drivers/radeon_vid.c b/src/video_out/vidix/drivers/radeon_vid.c
deleted file mode 100644
index de4e66194..000000000
--- a/src/video_out/vidix/drivers/radeon_vid.c
+++ /dev/null
@@ -1,3366 +0,0 @@
-/*
- radeon_vid - VIDIX based video driver for Radeon and Rage128 chips
- Copyrights 2002 Nick Kurshev. This file is based on sources from
- GATOS (gatos.sf.net) and X11 (www.xfree86.org)
- Licence: GPL
-*/
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include <inttypes.h>
-#include <sys/types.h>
-#include <sys/mman.h>
-#include "bswap.h"
-#include "pci_ids.h"
-#include "pci_names.h"
-#include "vidix.h"
-#include "fourcc.h"
-#include "libdha.h"
-#include "radeon.h"
-
-#ifdef RAGE128
-#define RADEON_MSG "[rage128]"
-#define X_ADJUST 0
-#else
-#define RADEON_MSG "[radeon]"
-#define X_ADJUST (((besr.chip_flags&R_OVL_SHIFT)==R_OVL_SHIFT)?8:0)
-#ifndef RADEON
-#define RADEON
-#endif
-#endif
-
-#define RADEON_ASSERT(msg) printf(RADEON_MSG"################# FATAL:"msg);
-
-#ifdef RAGE128
-#define VIDIX_STATIC rage128_
-#else
-#define VIDIX_STATIC radeo_
-#endif
-
-//#undef RADEON_ENABLE_BM /* unfinished stuff. May corrupt your filesystem ever */
-#define RADEON_ENABLE_BM 1
-
-#ifdef RADEON_ENABLE_BM
-static void * radeon_dma_desc_base = 0;
-static unsigned long bus_addr_dma_desc = 0;
-static unsigned long *dma_phys_addrs = 0;
-#pragma pack(1)
-typedef struct
-{
- uint32_t framebuf_offset;
- uint32_t sys_addr;
- uint32_t command;
- uint32_t reserved;
-} bm_list_descriptor;
-#pragma pack()
-#endif
-
-#define VERBOSE_LEVEL 0
-static int __verbose = 0;
-typedef struct bes_registers_s
-{
- /* base address of yuv framebuffer */
- uint32_t yuv_base;
- uint32_t fourcc;
- uint32_t surf_id;
- int load_prg_start;
- int horz_pick_nearest;
- int vert_pick_nearest;
- int swap_uv; /* for direct support of bgr fourccs */
- uint32_t dest_bpp;
- /* YUV BES registers */
- uint32_t reg_load_cntl;
- uint32_t h_inc;
- uint32_t step_by;
- uint32_t y_x_start;
- uint32_t y_x_end;
- uint32_t v_inc;
- uint32_t p1_blank_lines_at_top;
- uint32_t p23_blank_lines_at_top;
- uint32_t vid_buf_pitch0_value;
- uint32_t vid_buf_pitch1_value;
- uint32_t p1_x_start_end;
- uint32_t p2_x_start_end;
- uint32_t p3_x_start_end;
- uint32_t base_addr;
- uint32_t vid_buf_base_adrs_y[VID_PLAY_MAXFRAMES];
- uint32_t vid_buf_base_adrs_u[VID_PLAY_MAXFRAMES];
- uint32_t vid_buf_base_adrs_v[VID_PLAY_MAXFRAMES];
- uint32_t vid_nbufs;
-
- uint32_t p1_v_accum_init;
- uint32_t p1_h_accum_init;
- uint32_t p23_v_accum_init;
- uint32_t p23_h_accum_init;
- uint32_t scale_cntl;
- uint32_t exclusive_horz;
- uint32_t auto_flip_cntl;
- uint32_t filter_cntl;
- uint32_t four_tap_coeff[5];
- uint32_t key_cntl;
- uint32_t test;
- /* Configurable stuff */
- int double_buff;
-
- int brightness;
- int saturation;
-
- uint32_t graphics_key_clr;
- uint32_t graphics_key_msk;
- uint32_t ckey_cntl;
-
- int deinterlace_on;
- uint32_t deinterlace_pattern;
- unsigned chip_flags;
-} bes_registers_t;
-
-typedef struct video_registers_s
-{
- const char * sname;
- uint32_t name;
- uint32_t value;
-}video_registers_t;
-
-static bes_registers_t besr;
-#define DECLARE_VREG(name) { #name, name, 0 }
-static video_registers_t vregs[] =
-{
- DECLARE_VREG(VIDEOMUX_CNTL),
- DECLARE_VREG(VIPPAD_MASK),
- DECLARE_VREG(VIPPAD1_A),
- DECLARE_VREG(VIPPAD1_EN),
- DECLARE_VREG(VIPPAD1_Y),
- DECLARE_VREG(OV0_Y_X_START),
- DECLARE_VREG(OV0_Y_X_END),
- DECLARE_VREG(OV0_PIPELINE_CNTL),
- DECLARE_VREG(OV0_EXCLUSIVE_HORZ),
- DECLARE_VREG(OV0_EXCLUSIVE_VERT),
- DECLARE_VREG(OV0_REG_LOAD_CNTL),
- DECLARE_VREG(OV0_SCALE_CNTL),
- DECLARE_VREG(OV0_V_INC),
- DECLARE_VREG(OV0_P1_V_ACCUM_INIT),
- DECLARE_VREG(OV0_P23_V_ACCUM_INIT),
- DECLARE_VREG(OV0_P1_BLANK_LINES_AT_TOP),
- DECLARE_VREG(OV0_P23_BLANK_LINES_AT_TOP),
-#ifdef RADEON
- DECLARE_VREG(OV0_BASE_ADDR),
-#endif
- DECLARE_VREG(OV0_VID_BUF0_BASE_ADRS),
- DECLARE_VREG(OV0_VID_BUF1_BASE_ADRS),
- DECLARE_VREG(OV0_VID_BUF2_BASE_ADRS),
- DECLARE_VREG(OV0_VID_BUF3_BASE_ADRS),
- DECLARE_VREG(OV0_VID_BUF4_BASE_ADRS),
- DECLARE_VREG(OV0_VID_BUF5_BASE_ADRS),
- DECLARE_VREG(OV0_VID_BUF_PITCH0_VALUE),
- DECLARE_VREG(OV0_VID_BUF_PITCH1_VALUE),
- DECLARE_VREG(OV0_AUTO_FLIP_CNTL),
- DECLARE_VREG(OV0_DEINTERLACE_PATTERN),
- DECLARE_VREG(OV0_SUBMIT_HISTORY),
- DECLARE_VREG(OV0_H_INC),
- DECLARE_VREG(OV0_STEP_BY),
- DECLARE_VREG(OV0_P1_H_ACCUM_INIT),
- DECLARE_VREG(OV0_P23_H_ACCUM_INIT),
- DECLARE_VREG(OV0_P1_X_START_END),
- DECLARE_VREG(OV0_P2_X_START_END),
- DECLARE_VREG(OV0_P3_X_START_END),
- DECLARE_VREG(OV0_FILTER_CNTL),
- DECLARE_VREG(OV0_FOUR_TAP_COEF_0),
- DECLARE_VREG(OV0_FOUR_TAP_COEF_1),
- DECLARE_VREG(OV0_FOUR_TAP_COEF_2),
- DECLARE_VREG(OV0_FOUR_TAP_COEF_3),
- DECLARE_VREG(OV0_FOUR_TAP_COEF_4),
- DECLARE_VREG(OV0_FLAG_CNTL),
-#ifdef RAGE128
- DECLARE_VREG(OV0_COLOUR_CNTL),
-#else
- DECLARE_VREG(OV0_SLICE_CNTL),
-#endif
- DECLARE_VREG(OV0_VID_KEY_CLR),
- DECLARE_VREG(OV0_VID_KEY_MSK),
- DECLARE_VREG(OV0_GRAPHICS_KEY_CLR),
- DECLARE_VREG(OV0_GRAPHICS_KEY_MSK),
- DECLARE_VREG(OV0_KEY_CNTL),
- DECLARE_VREG(OV0_TEST),
- DECLARE_VREG(OV0_LIN_TRANS_A),
- DECLARE_VREG(OV0_LIN_TRANS_B),
- DECLARE_VREG(OV0_LIN_TRANS_C),
- DECLARE_VREG(OV0_LIN_TRANS_D),
- DECLARE_VREG(OV0_LIN_TRANS_E),
- DECLARE_VREG(OV0_LIN_TRANS_F),
- DECLARE_VREG(OV0_GAMMA_0_F),
- DECLARE_VREG(OV0_GAMMA_10_1F),
- DECLARE_VREG(OV0_GAMMA_20_3F),
- DECLARE_VREG(OV0_GAMMA_40_7F),
- DECLARE_VREG(OV0_GAMMA_380_3BF),
- DECLARE_VREG(OV0_GAMMA_3C0_3FF),
- DECLARE_VREG(SUBPIC_CNTL),
- DECLARE_VREG(SUBPIC_DEFCOLCON),
- DECLARE_VREG(SUBPIC_Y_X_START),
- DECLARE_VREG(SUBPIC_Y_X_END),
- DECLARE_VREG(SUBPIC_V_INC),
- DECLARE_VREG(SUBPIC_H_INC),
- DECLARE_VREG(SUBPIC_BUF0_OFFSET),
- DECLARE_VREG(SUBPIC_BUF1_OFFSET),
- DECLARE_VREG(SUBPIC_LC0_OFFSET),
- DECLARE_VREG(SUBPIC_LC1_OFFSET),
- DECLARE_VREG(SUBPIC_PITCH),
- DECLARE_VREG(SUBPIC_BTN_HLI_COLCON),
- DECLARE_VREG(SUBPIC_BTN_HLI_Y_X_START),
- DECLARE_VREG(SUBPIC_BTN_HLI_Y_X_END),
- DECLARE_VREG(SUBPIC_PALETTE_INDEX),
- DECLARE_VREG(SUBPIC_PALETTE_DATA),
- DECLARE_VREG(SUBPIC_H_ACCUM_INIT),
- DECLARE_VREG(SUBPIC_V_ACCUM_INIT),
- DECLARE_VREG(IDCT_RUNS),
- DECLARE_VREG(IDCT_LEVELS),
- DECLARE_VREG(IDCT_AUTH_CONTROL),
- DECLARE_VREG(IDCT_AUTH),
- DECLARE_VREG(IDCT_CONTROL),
-#ifdef RAGE128
- DECLARE_VREG(BM_FRAME_BUF_OFFSET),
- DECLARE_VREG(BM_SYSTEM_MEM_ADDR),
- DECLARE_VREG(BM_COMMAND),
- DECLARE_VREG(BM_STATUS),
- DECLARE_VREG(BM_QUEUE_STATUS),
- DECLARE_VREG(BM_QUEUE_FREE_STATUS),
- DECLARE_VREG(BM_CHUNK_0_VAL),
- DECLARE_VREG(BM_CHUNK_1_VAL),
- DECLARE_VREG(BM_VIP0_BUF),
- DECLARE_VREG(BM_VIP0_ACTIVE),
- DECLARE_VREG(BM_VIP1_BUF),
- DECLARE_VREG(BM_VIP1_ACTIVE),
- DECLARE_VREG(BM_VIP2_BUF),
- DECLARE_VREG(BM_VIP2_ACTIVE),
- DECLARE_VREG(BM_VIP3_BUF),
- DECLARE_VREG(BM_VIP3_ACTIVE),
- DECLARE_VREG(BM_VIDCAP_BUF0),
- DECLARE_VREG(BM_VIDCAP_BUF1),
- DECLARE_VREG(BM_VIDCAP_BUF2),
- DECLARE_VREG(BM_VIDCAP_ACTIVE),
- DECLARE_VREG(BM_GUI),
- DECLARE_VREG(BM_ABORT)
-#else
- DECLARE_VREG(DMA_GUI_TABLE_ADDR),
- DECLARE_VREG(DMA_GUI_SRC_ADDR),
- DECLARE_VREG(DMA_GUI_DST_ADDR),
- DECLARE_VREG(DMA_GUI_COMMAND),
- DECLARE_VREG(DMA_GUI_STATUS),
- DECLARE_VREG(DMA_GUI_ACT_DSCRPTR),
- DECLARE_VREG(DMA_VID_SRC_ADDR),
- DECLARE_VREG(DMA_VID_DST_ADDR),
- DECLARE_VREG(DMA_VID_COMMAND),
- DECLARE_VREG(DMA_VID_STATUS),
- DECLARE_VREG(DMA_VID_ACT_DSCRPTR),
-#endif
-};
-
-#define R_FAMILY 0x000000FF
-#define R_100 0x00000001
-#define R_120 0x00000002
-#define R_150 0x00000003
-#define R_200 0x00000004
-#define R_250 0x00000005
-#define R_280 0x00000006
-#define R_300 0x00000007
-#define R_350 0x00000008
-#define R_370 0x00000010
-#define R_380 0x00000020
-#define R_420 0x00000040
-#define R_OVL_SHIFT 0x00000100
-#define R_INTEGRATED 0x00000200
-#define R_PCIE 0x00000400
-
-typedef struct ati_card_ids_s
-{
- unsigned short id;
- unsigned flags;
-}ati_card_ids_t;
-
-static const ati_card_ids_t ati_card_ids[] =
-{
-#ifdef RAGE128
- /*
- This driver should be compatible with Rage128 (pro) chips.
- (include adaptive deinterlacing!!!).
- Moreover: the same logic can be used with Mach64 chips.
- (I mean: mach64xx, 3d rage, 3d rage IIc, 3D rage pro, 3d rage mobility).
- but they are incompatible by i/o ports. So if enthusiasts will want
- then they can redefine OUTREG and INREG macros and redefine OV0_*
- constants. Also it seems that mach64 chips supports only: YUY2, YV12, UYVY
- fourccs (422 and 420 formats only).
- */
-/* Rage128 Pro GL */
- { DEVICE_ATI_RAGE_128_PA_PRO, 0 },
- { DEVICE_ATI_RAGE_128_PB_PRO, 0 },
- { DEVICE_ATI_RAGE_128_PC_PRO, 0 },
- { DEVICE_ATI_RAGE_128_PD_PRO, 0 },
- { DEVICE_ATI_RAGE_128_PE_PRO, 0 },
- { DEVICE_ATI_RAGE_128_PF_PRO, 0 },
-/* Rage128 Pro VR */
- { DEVICE_ATI_RAGE_128_PG_PRO, 0 },
- { DEVICE_ATI_RAGE_128_PH_PRO, 0 },
- { DEVICE_ATI_RAGE_128_PI_PRO, 0 },
- { DEVICE_ATI_RAGE_128_PJ_PRO, 0 },
- { DEVICE_ATI_RAGE_128_PK_PRO, 0 },
- { DEVICE_ATI_RAGE_128_PL_PRO, 0 },
- { DEVICE_ATI_RAGE_128_PM_PRO, 0 },
- { DEVICE_ATI_RAGE_128_PN_PRO, 0 },
- { DEVICE_ATI_RAGE_128_PO_PRO, 0 },
- { DEVICE_ATI_RAGE_128_PP_PRO, 0 },
- { DEVICE_ATI_RAGE_128_PQ_PRO, 0 },
- { DEVICE_ATI_RAGE_128_PR_PRO, 0 },
- { DEVICE_ATI_RAGE_128_PS_PRO, 0 },
- { DEVICE_ATI_RAGE_128_PT_PRO, 0 },
- { DEVICE_ATI_RAGE_128_PU_PRO, 0 },
- { DEVICE_ATI_RAGE_128_PV_PRO, 0 },
- { DEVICE_ATI_RAGE_128_PW_PRO, 0 },
- { DEVICE_ATI_RAGE_128_PX_PRO, 0 },
-/* Rage128 GL */
- { DEVICE_ATI_RAGE_128_RE_SG, 0 },
- { DEVICE_ATI_RAGE_128_RF_SG, 0 },
- { DEVICE_ATI_RAGE_128_RG, 0 },
- { DEVICE_ATI_RAGE_128_RK_VR, 0 },
- { DEVICE_ATI_RAGE_128_RL_VR, 0 },
- { DEVICE_ATI_RAGE_128_SE_4X, 0 },
- { DEVICE_ATI_RAGE_128_SF_4X, 0 },
- { DEVICE_ATI_RAGE_128_SG_4X, 0 },
- { DEVICE_ATI_RAGE_128_SH, 0 },
- { DEVICE_ATI_RAGE_128_SK_4X, 0 },
- { DEVICE_ATI_RAGE_128_SL_4X, 0 },
- { DEVICE_ATI_RAGE_128_SM_4X, 0 },
- { DEVICE_ATI_RAGE_128_4X, 0 },
- { DEVICE_ATI_RAGE_128_PRO, 0 },
- { DEVICE_ATI_RAGE_128_PRO2, 0 },
- { DEVICE_ATI_RAGE_128_PRO3, 0 },
-/* these seem to be based on rage 128 instead of mach64 */
- { DEVICE_ATI_RAGE_MOBILITY_M3, 0 },
- { DEVICE_ATI_RAGE_MOBILITY_M32, 0 },
-#else
-/* Radeon1 (indeed: Rage 256 Pro ;) */
- { DEVICE_ATI_RADEON_R100_QD, R_100|R_OVL_SHIFT },
- { DEVICE_ATI_RADEON_R100_QE, R_100|R_OVL_SHIFT },
- { DEVICE_ATI_RADEON_R100_QF, R_100|R_OVL_SHIFT },
- { DEVICE_ATI_RADEON_R100_QG, R_100|R_OVL_SHIFT },
- { DEVICE_ATI_RADEON_IGP_320, R_150|R_OVL_SHIFT|R_INTEGRATED },
- { DEVICE_ATI_RADEON_MOBILITY_U1, R_150|R_OVL_SHIFT|R_INTEGRATED },
- { DEVICE_ATI_RADEON_RV100_QY, R_120|R_OVL_SHIFT },
- { DEVICE_ATI_RADEON_RV100_QZ, R_120|R_OVL_SHIFT },
- { DEVICE_ATI_RADEON_MOBILITY_M7, R_150|R_OVL_SHIFT },
- { DEVICE_ATI_RADEON_RV200_LX, R_150|R_OVL_SHIFT },
- { DEVICE_ATI_RADEON_MOBILITY_M6, R_120|R_OVL_SHIFT },
- { DEVICE_ATI_RADEON_MOBILITY_M62, R_120|R_OVL_SHIFT },
-/* Radeon2 (indeed: Rage 512 Pro ;) */
- { DEVICE_ATI_R200_BB_RADEON, R_200 },
- { DEVICE_ATI_R200_BC_RADEON, R_200 },
- { DEVICE_ATI_RADEON_R200_QH, R_200 },
- { DEVICE_ATI_RADEON_R200_QI, R_200 },
- { DEVICE_ATI_RADEON_R200_QJ, R_200 },
- { DEVICE_ATI_RADEON_R200_QK, R_200 },
- { DEVICE_ATI_RADEON_R200_QL, R_200 },
- { DEVICE_ATI_RADEON_R200_QM, R_200 },
- { DEVICE_ATI_RADEON_R200_QN, R_200 },
- { DEVICE_ATI_RADEON_R200_QO, R_200 },
- { DEVICE_ATI_RADEON_R200_QH2, R_200 },
- { DEVICE_ATI_RADEON_R200_QI2, R_200 },
- { DEVICE_ATI_RADEON_R200_QJ2, R_200 },
- { DEVICE_ATI_RADEON_R200_QK2, R_200 },
- { DEVICE_ATI_RADEON_R200_QL2, R_200 },
- { DEVICE_ATI_RADEON_RV200_QW, R_150|R_OVL_SHIFT },
- { DEVICE_ATI_RADEON_RV200_QX, R_150|R_OVL_SHIFT },
- { DEVICE_ATI_RADEON_IGP330_340_350,R_200|R_INTEGRATED },
- { DEVICE_ATI_RADEON_IGP_330M_340M_350M,R_200|R_INTEGRATED },
- { DEVICE_ATI_RADEON_RV250_IG, R_250|R_OVL_SHIFT },
- { DEVICE_ATI_RADEON_7000_IGP, R_250|R_OVL_SHIFT|R_INTEGRATED },
- { DEVICE_ATI_RADEON_MOBILITY_7000, R_250|R_OVL_SHIFT|R_INTEGRATED },
- { DEVICE_ATI_RADEON_RV250_ID, R_250|R_OVL_SHIFT },
- { DEVICE_ATI_RADEON_RV250_IE, R_250|R_OVL_SHIFT },
- { DEVICE_ATI_RADEON_RV250_IF, R_250|R_OVL_SHIFT },
- { DEVICE_ATI_RADEON_RV250_IG, R_250|R_OVL_SHIFT },
- { DEVICE_ATI_RADEON_R250_LD, R_250|R_OVL_SHIFT },
- { DEVICE_ATI_RADEON_R250_LE, R_250|R_OVL_SHIFT },
- { DEVICE_ATI_RADEON_R250_LF, R_250|R_OVL_SHIFT },
- { DEVICE_ATI_RADEON_R250_LG, R_250|R_OVL_SHIFT },
- { DEVICE_ATI_RV280_RADEON_92003, R_280 },
- { DEVICE_ATI_RV280_RADEON_92004, R_280 },
- { DEVICE_ATI_RV280_RADEON_92005, R_280 },
-/* Radeon3 (indeed: Rage 1024 Pro ;) */
- { DEVICE_ATI_R300_AG_FIREGL, R_300 },
- { DEVICE_ATI_RADEON_R300_ND, R_300 },
- { DEVICE_ATI_RADEON_R300_NE, R_300 },
- { DEVICE_ATI_RADEON_R300_NG, R_300 },
- { DEVICE_ATI_R300_AD_RADEON, R_300 },
- { DEVICE_ATI_R300_AE_RADEON, R_300 },
- { DEVICE_ATI_R300_AF_RADEON, R_300 },
- { DEVICE_ATI_RADEON_9100_IGP2, R_300|R_OVL_SHIFT|R_INTEGRATED },
- { DEVICE_ATI_RS300M_AGP_RADEON, R_300|R_INTEGRATED },
- { DEVICE_ATI_R350_AH_RADEON, R_350 },
- { DEVICE_ATI_R350_AI_RADEON, R_350 },
- { DEVICE_ATI_R350_AJ_RADEON, R_350 },
- { DEVICE_ATI_R350_AK_FIRE, R_350 },
- { DEVICE_ATI_RADEON_R350_RADEON2, R_350 },
- { DEVICE_ATI_RADEON_R350_RADEON3, R_350 },
- { DEVICE_ATI_RV350_NJ_RADEON, R_350 },
- { DEVICE_ATI_R350_NK_FIRE, R_350 },
- { DEVICE_ATI_RV350_AP_RADEON, R_350 },
- { DEVICE_ATI_RV350_AQ_RADEON, R_350 },
- { DEVICE_ATI_RV350_AR_RADEON, R_350 },
- { DEVICE_ATI_RV350_AS_RADEON, R_350 },
- { DEVICE_ATI_RV350_AT_FIRE, R_350 },
- { DEVICE_ATI_RV350_AU_FIRE, R_350 },
- { DEVICE_ATI_RV350_AV_FIRE, R_350 },
- { DEVICE_ATI_RV350_AW_FIRE, R_350 },
- { DEVICE_ATI_RV350_MOBILITY_RADEON, R_350 },
- { DEVICE_ATI_RV350_NF_RADEON, R_300 },
- { DEVICE_ATI_RV350_NJ_RADEON, R_300 },
- { DEVICE_ATI_M10_NQ_RADEON, R_350 },
- { DEVICE_ATI_RV350_MOBILITY_RADEON2, R_350 },
- { DEVICE_ATI_M10_NS_RADEON, R_350 },
- { DEVICE_ATI_M10_NT_FIREGL, R_350 },
- { DEVICE_ATI_M11_NV_FIREGL, R_350 },
- { DEVICE_ATI_RV370_5B60_RADEON, R_370|R_PCIE },
- { DEVICE_ATI_RV370_5B62_RADEON, R_370|R_PCIE },
- { DEVICE_ATI_RV370_5B64_FIREGL, R_370|R_PCIE },
- { DEVICE_ATI_RV370_5B65_FIREGL, R_370|R_PCIE },
- { DEVICE_ATI_RV380_0X3E50_RADEON, R_380|R_PCIE },
- { DEVICE_ATI_RV380_0X3E54_FIREGL, R_380|R_PCIE },
- { DEVICE_ATI_RV380_RADEON_X600, R_380|R_PCIE },
- { DEVICE_ATI_R420_JH_RADEON, R_420|R_PCIE },
- { DEVICE_ATI_R420_JI_RADEON, R_420|R_PCIE },
- { DEVICE_ATI_R420_JJ_RADEON, R_420|R_PCIE },
- { DEVICE_ATI_R420_JK_RADEON, R_420|R_PCIE },
- { DEVICE_ATI_R420_JL_RADEON, R_420|R_PCIE },
- { DEVICE_ATI_R420_JM_FIREGL, R_420|R_PCIE },
- { DEVICE_ATI_M18_JN_RADEON, R_420|R_PCIE },
- { DEVICE_ATI_R420_JP_RADEON, R_420|R_PCIE },
- { DEVICE_ATI_R420_JM_FIREGL, R_420|R_PCIE },
- { DEVICE_ATI_R423_5F57_RADEON, R_420|R_PCIE }
-#endif
-};
-
-
-static void * radeon_mmio_base = 0;
-static void * radeon_mem_base = 0;
-static int32_t radeon_overlay_off = 0;
-static uint32_t radeon_ram_size = 0;
-
-#define GETREG(TYPE,PTR,OFFZ) (*((volatile TYPE*)((PTR)+(OFFZ))))
-#define SETREG(TYPE,PTR,OFFZ,VAL) (*((volatile TYPE*)((PTR)+(OFFZ))))=VAL
-
-#define INREG8(addr) GETREG(uint8_t,(uint32_t)(radeon_mmio_base),addr)
-#define OUTREG8(addr,val) SETREG(uint8_t,(uint32_t)(radeon_mmio_base),addr,val)
-static inline uint32_t INREG (uint32_t addr) {
- uint32_t tmp = GETREG(uint32_t,(uint32_t)(radeon_mmio_base),addr);
- return le2me_32(tmp);
-}
-#define OUTREG(addr,val) SETREG(uint32_t,(uint32_t)(radeon_mmio_base),addr,le2me_32(val))
-#define OUTREGP(addr,val,mask) \
- do { \
- unsigned int _tmp = INREG(addr); \
- _tmp &= (mask); \
- _tmp |= (val); \
- OUTREG(addr, _tmp); \
- } while (0)
-
-
-static __inline__ uint32_t INPLL(uint32_t addr)
-{
- OUTREG8(CLOCK_CNTL_INDEX, addr & 0x0000001f);
- return (INREG(CLOCK_CNTL_DATA));
-}
-
-#define OUTPLL(addr,val) OUTREG8(CLOCK_CNTL_INDEX, (addr & 0x0000001f) | 0x00000080); \
- OUTREG(CLOCK_CNTL_DATA, val)
-#define OUTPLLP(addr,val,mask) \
- do { \
- unsigned int _tmp = INPLL(addr); \
- _tmp &= (mask); \
- _tmp |= (val); \
- OUTPLL(addr, _tmp); \
- } while (0)
-
-static uint32_t radeon_vid_get_dbpp( void )
-{
- uint32_t dbpp,retval;
- dbpp = (INREG(CRTC_GEN_CNTL)>>8)& 0xF;
- switch(dbpp)
- {
- case DST_8BPP: retval = 8; break;
- case DST_15BPP: retval = 15; break;
- case DST_16BPP: retval = 16; break;
- case DST_24BPP: retval = 24; break;
- default: retval=32; break;
- }
- return retval;
-}
-
-static int radeon_is_dbl_scan( void )
-{
- return (INREG(CRTC_GEN_CNTL))&CRTC_DBL_SCAN_EN;
-}
-
-static int radeon_is_interlace( void )
-{
- return (INREG(CRTC_GEN_CNTL))&CRTC_INTERLACE_EN;
-}
-
-static uint32_t radeon_get_xres( void )
-{
- /* FIXME: currently we extract that from CRTC!!!*/
- uint32_t xres,h_total;
- h_total = INREG(CRTC_H_TOTAL_DISP);
- xres = (h_total >> 16) & 0xffff;
- return (xres + 1)*8;
-}
-
-static uint32_t radeon_get_yres( void )
-{
- /* FIXME: currently we extract that from CRTC!!!*/
- uint32_t yres,v_total;
- v_total = INREG(CRTC_V_TOTAL_DISP);
- yres = (v_total >> 16) & 0xffff;
- return yres + 1;
-}
-
-static void radeon_wait_vsync(void)
-{
- int i;
-
- OUTREG(GEN_INT_STATUS, VSYNC_INT_AK);
- for (i = 0; i < 2000000; i++)
- {
- if (INREG(GEN_INT_STATUS) & VSYNC_INT) break;
- }
-}
-
-#ifdef RAGE128
-static void _radeon_engine_idle(void);
-static void _radeon_fifo_wait(unsigned);
-#define radeon_engine_idle() _radeon_engine_idle()
-#define radeon_fifo_wait(entries) _radeon_fifo_wait(entries)
-/* Flush all dirty data in the Pixel Cache to memory. */
-static __inline__ void radeon_engine_flush ( void )
-{
- unsigned i;
-
- OUTREGP(PC_NGUI_CTLSTAT, PC_FLUSH_ALL, ~PC_FLUSH_ALL);
- for (i = 0; i < 2000000; i++) {
- if (!(INREG(PC_NGUI_CTLSTAT) & PC_BUSY)) break;
- }
-}
-
-/* Reset graphics card to known state. */
-static void radeon_engine_reset( void )
-{
- uint32_t clock_cntl_index;
- uint32_t mclk_cntl;
- uint32_t gen_reset_cntl;
-
- radeon_engine_flush();
-
- clock_cntl_index = INREG(CLOCK_CNTL_INDEX);
- mclk_cntl = INPLL(MCLK_CNTL);
-
- OUTPLL(MCLK_CNTL, mclk_cntl | FORCE_GCP | FORCE_PIPE3D_CP);
-
- gen_reset_cntl = INREG(GEN_RESET_CNTL);
-
- OUTREG(GEN_RESET_CNTL, gen_reset_cntl | SOFT_RESET_GUI);
- INREG(GEN_RESET_CNTL);
- OUTREG(GEN_RESET_CNTL,
- gen_reset_cntl & (uint32_t)(~SOFT_RESET_GUI));
- INREG(GEN_RESET_CNTL);
-
- OUTPLL(MCLK_CNTL, mclk_cntl);
- OUTREG(CLOCK_CNTL_INDEX, clock_cntl_index);
- OUTREG(GEN_RESET_CNTL, gen_reset_cntl);
-}
-#else
-
-static __inline__ void radeon_engine_flush ( void )
-{
- int i;
-
- /* initiate flush */
- OUTREGP(RB2D_DSTCACHE_CTLSTAT, RB2D_DC_FLUSH_ALL,
- ~RB2D_DC_FLUSH_ALL);
-
- for (i=0; i < 2000000; i++) {
- if (!(INREG(RB2D_DSTCACHE_CTLSTAT) & RB2D_DC_BUSY))
- break;
- }
-}
-
-static void _radeon_engine_idle(void);
-static void _radeon_fifo_wait(unsigned);
-#define radeon_engine_idle() _radeon_engine_idle()
-#define radeon_fifo_wait(entries) _radeon_fifo_wait(entries)
-
-static void radeon_engine_reset( void )
-{
- uint32_t clock_cntl_index, mclk_cntl, rbbm_soft_reset;
-
- radeon_engine_flush ();
-
- clock_cntl_index = INREG(CLOCK_CNTL_INDEX);
- mclk_cntl = INPLL(MCLK_CNTL);
-
- OUTPLL(MCLK_CNTL, (mclk_cntl |
- FORCEON_MCLKA |
- FORCEON_MCLKB |
- FORCEON_YCLKA |
- FORCEON_YCLKB |
- FORCEON_MC |
- FORCEON_AIC));
- rbbm_soft_reset = INREG(RBBM_SOFT_RESET);
-
- OUTREG(RBBM_SOFT_RESET, rbbm_soft_reset |
- SOFT_RESET_CP |
- SOFT_RESET_HI |
- SOFT_RESET_SE |
- SOFT_RESET_RE |
- SOFT_RESET_PP |
- SOFT_RESET_E2 |
- SOFT_RESET_RB |
- SOFT_RESET_HDP);
- INREG(RBBM_SOFT_RESET);
- OUTREG(RBBM_SOFT_RESET, rbbm_soft_reset & (uint32_t)
- ~(SOFT_RESET_CP |
- SOFT_RESET_HI |
- SOFT_RESET_SE |
- SOFT_RESET_RE |
- SOFT_RESET_PP |
- SOFT_RESET_E2 |
- SOFT_RESET_RB |
- SOFT_RESET_HDP));
- INREG(RBBM_SOFT_RESET);
-
- OUTPLL(MCLK_CNTL, mclk_cntl);
- OUTREG(CLOCK_CNTL_INDEX, clock_cntl_index);
- OUTREG(RBBM_SOFT_RESET, rbbm_soft_reset);
-
- return;
-}
-#endif
-static void radeon_engine_restore( void )
-{
-#ifndef RAGE128
- int pitch64;
- uint32_t xres,yres,bpp;
- radeon_fifo_wait(1);
- xres = radeon_get_xres();
- yres = radeon_get_yres();
- bpp = radeon_vid_get_dbpp();
- /* turn of all automatic flushing - we'll do it all */
- OUTREG(RB2D_DSTCACHE_MODE, 0);
-
- pitch64 = ((xres * (bpp / 8) + 0x3f)) >> 6;
-
- radeon_fifo_wait(1);
- OUTREG(DEFAULT_OFFSET, (INREG(DEFAULT_OFFSET) & 0xC0000000) |
- (pitch64 << 22));
-
- radeon_fifo_wait(1);
-#if defined(WORDS_BIGENDIAN)
- OUTREGP(DP_DATATYPE,
- HOST_BIG_ENDIAN_EN, ~HOST_BIG_ENDIAN_EN);
-#else
- OUTREGP(DP_DATATYPE, 0, ~HOST_BIG_ENDIAN_EN);
-#endif
-
- radeon_fifo_wait(1);
- OUTREG(DEFAULT_SC_BOTTOM_RIGHT, (DEFAULT_SC_RIGHT_MAX
- | DEFAULT_SC_BOTTOM_MAX));
- radeon_fifo_wait(1);
- OUTREG(DP_GUI_MASTER_CNTL, (INREG(DP_GUI_MASTER_CNTL)
- | GMC_BRUSH_SOLID_COLOR
- | GMC_SRC_DATATYPE_COLOR));
-
- radeon_fifo_wait(7);
- OUTREG(DST_LINE_START, 0);
- OUTREG(DST_LINE_END, 0);
- OUTREG(DP_BRUSH_FRGD_CLR, 0xffffffff);
- OUTREG(DP_BRUSH_BKGD_CLR, 0x00000000);
- OUTREG(DP_SRC_FRGD_CLR, 0xffffffff);
- OUTREG(DP_SRC_BKGD_CLR, 0x00000000);
- OUTREG(DP_WRITE_MASK, 0xffffffff);
-
- radeon_engine_idle();
-#endif
-}
-#ifdef RAGE128
-static void _radeon_fifo_wait (unsigned entries)
-{
- unsigned i;
-
- for(;;)
- {
- for (i=0; i<2000000; i++)
- if ((INREG(GUI_STAT) & GUI_FIFOCNT_MASK) >= entries)
- return;
- radeon_engine_reset();
- radeon_engine_restore();
- }
-}
-
-static void _radeon_engine_idle ( void )
-{
- unsigned i;
-
- /* ensure FIFO is empty before waiting for idle */
- radeon_fifo_wait (64);
- for(;;)
- {
- for (i=0; i<2000000; i++) {
- if ((INREG(GUI_STAT) & GUI_ACTIVE) == 0) {
- radeon_engine_flush ();
- return;
- }
- }
- radeon_engine_reset();
- radeon_engine_restore();
- }
-}
-#else
-static void _radeon_fifo_wait (unsigned entries)
-{
- unsigned i;
-
- for(;;)
- {
- for (i=0; i<2000000; i++)
- if ((INREG(RBBM_STATUS) & RBBM_FIFOCNT_MASK) >= entries)
- return;
- radeon_engine_reset();
- radeon_engine_restore();
- }
-}
-static void _radeon_engine_idle ( void )
-{
- int i;
-
- /* ensure FIFO is empty before waiting for idle */
- radeon_fifo_wait (64);
- for(;;)
- {
- for (i=0; i<2000000; i++) {
- if (((INREG(RBBM_STATUS) & RBBM_ACTIVE)) == 0) {
- radeon_engine_flush ();
- return;
- }
- }
- radeon_engine_reset();
- radeon_engine_restore();
- }
-}
-#endif
-
-#ifndef RAGE128
-/* Reference color space transform data */
-typedef struct tagREF_TRANSFORM
-{
- float RefLuma;
- float RefRCb;
- float RefRCr;
- float RefGCb;
- float RefGCr;
- float RefBCb;
- float RefBCr;
-} REF_TRANSFORM;
-
-/* Parameters for ITU-R BT.601 and ITU-R BT.709 colour spaces */
-REF_TRANSFORM trans[2] =
-{
- {1.1678, 0.0, 1.6007, -0.3929, -0.8154, 2.0232, 0.0}, /* BT.601 */
- {1.1678, 0.0, 1.7980, -0.2139, -0.5345, 2.1186, 0.0} /* BT.709 */
-};
-/****************************************************************************
- * SetTransform *
- * Function: Calculates and sets color space transform from supplied *
- * reference transform, gamma, brightness, contrast, hue and *
- * saturation. *
- * Inputs: bright - brightness *
- * cont - contrast *
- * sat - saturation *
- * hue - hue *
- * red_intensity - intense of red component *
- * green_intensity - intense of green component *
- * blue_intensity - intense of blue component *
- * ref - index to the table of refernce transforms *
- * Outputs: NONE *
- ****************************************************************************/
-
-static void radeon_set_transform(float bright, float cont, float sat,
- float hue, float red_intensity,
- float green_intensity,float blue_intensity,
- unsigned ref)
-{
- float OvHueSin, OvHueCos;
- float CAdjLuma, CAdjOff;
- float RedAdj,GreenAdj,BlueAdj;
- float CAdjRCb, CAdjRCr;
- float CAdjGCb, CAdjGCr;
- float CAdjBCb, CAdjBCr;
- float OvLuma, OvROff, OvGOff, OvBOff;
- float OvRCb, OvRCr;
- float OvGCb, OvGCr;
- float OvBCb, OvBCr;
- float Loff = 64.0;
- float Coff = 512.0f;
-
- uint32_t dwOvLuma, dwOvROff, dwOvGOff, dwOvBOff;
- uint32_t dwOvRCb, dwOvRCr;
- uint32_t dwOvGCb, dwOvGCr;
- uint32_t dwOvBCb, dwOvBCr;
-
- if (ref >= 2) return;
-
- OvHueSin = sin((double)hue);
- OvHueCos = cos((double)hue);
-
- CAdjLuma = cont * trans[ref].RefLuma;
- CAdjOff = cont * trans[ref].RefLuma * bright * 1023.0;
- RedAdj = cont * trans[ref].RefLuma * red_intensity * 1023.0;
- GreenAdj = cont * trans[ref].RefLuma * green_intensity * 1023.0;
- BlueAdj = cont * trans[ref].RefLuma * blue_intensity * 1023.0;
-
- CAdjRCb = sat * -OvHueSin * trans[ref].RefRCr;
- CAdjRCr = sat * OvHueCos * trans[ref].RefRCr;
- CAdjGCb = sat * (OvHueCos * trans[ref].RefGCb - OvHueSin * trans[ref].RefGCr);
- CAdjGCr = sat * (OvHueSin * trans[ref].RefGCb + OvHueCos * trans[ref].RefGCr);
- CAdjBCb = sat * OvHueCos * trans[ref].RefBCb;
- CAdjBCr = sat * OvHueSin * trans[ref].RefBCb;
-
-#if 0 /* default constants */
- CAdjLuma = 1.16455078125;
-
- CAdjRCb = 0.0;
- CAdjRCr = 1.59619140625;
- CAdjGCb = -0.39111328125;
- CAdjGCr = -0.8125;
- CAdjBCb = 2.01708984375;
- CAdjBCr = 0;
-#endif
- OvLuma = CAdjLuma;
- OvRCb = CAdjRCb;
- OvRCr = CAdjRCr;
- OvGCb = CAdjGCb;
- OvGCr = CAdjGCr;
- OvBCb = CAdjBCb;
- OvBCr = CAdjBCr;
- OvROff = RedAdj + CAdjOff -
- OvLuma * Loff - (OvRCb + OvRCr) * Coff;
- OvGOff = GreenAdj + CAdjOff -
- OvLuma * Loff - (OvGCb + OvGCr) * Coff;
- OvBOff = BlueAdj + CAdjOff -
- OvLuma * Loff - (OvBCb + OvBCr) * Coff;
-#if 0 /* default constants */
- OvROff = -888.5;
- OvGOff = 545;
- OvBOff = -1104;
-#endif
-
- dwOvROff = ((int)(OvROff * 2.0)) & 0x1fff;
- dwOvGOff = (int)(OvGOff * 2.0) & 0x1fff;
- dwOvBOff = (int)(OvBOff * 2.0) & 0x1fff;
- /* Whatever docs say about R200 having 3.8 format instead of 3.11
- as in Radeon is a lie */
-#if 0
- if(!IsR200)
- {
-#endif
- dwOvLuma =(((int)(OvLuma * 2048.0))&0x7fff)<<17;
- dwOvRCb = (((int)(OvRCb * 2048.0))&0x7fff)<<1;
- dwOvRCr = (((int)(OvRCr * 2048.0))&0x7fff)<<17;
- dwOvGCb = (((int)(OvGCb * 2048.0))&0x7fff)<<1;
- dwOvGCr = (((int)(OvGCr * 2048.0))&0x7fff)<<17;
- dwOvBCb = (((int)(OvBCb * 2048.0))&0x7fff)<<1;
- dwOvBCr = (((int)(OvBCr * 2048.0))&0x7fff)<<17;
-#if 0
- }
- else
- {
- dwOvLuma = (((int)(OvLuma * 256.0))&0x7ff)<<20;
- dwOvRCb = (((int)(OvRCb * 256.0))&0x7ff)<<4;
- dwOvRCr = (((int)(OvRCr * 256.0))&0x7ff)<<20;
- dwOvGCb = (((int)(OvGCb * 256.0))&0x7ff)<<4;
- dwOvGCr = (((int)(OvGCr * 256.0))&0x7ff)<<20;
- dwOvBCb = (((int)(OvBCb * 256.0))&0x7ff)<<4;
- dwOvBCr = (((int)(OvBCr * 256.0))&0x7ff)<<20;
- }
-#endif
- OUTREG(OV0_LIN_TRANS_A, dwOvRCb | dwOvLuma);
- OUTREG(OV0_LIN_TRANS_B, dwOvROff | dwOvRCr);
- OUTREG(OV0_LIN_TRANS_C, dwOvGCb | dwOvLuma);
- OUTREG(OV0_LIN_TRANS_D, dwOvGOff | dwOvGCr);
- OUTREG(OV0_LIN_TRANS_E, dwOvBCb | dwOvLuma);
- OUTREG(OV0_LIN_TRANS_F, dwOvBOff | dwOvBCr);
-}
-
-/* Gamma curve definition */
-typedef struct
-{
- unsigned int gammaReg;
- unsigned int gammaSlope;
- unsigned int gammaOffset;
-}GAMMA_SETTINGS;
-
-/* Recommended gamma curve parameters */
-GAMMA_SETTINGS r200_def_gamma[18] =
-{
- {OV0_GAMMA_0_F, 0x100, 0x0000},
- {OV0_GAMMA_10_1F, 0x100, 0x0020},
- {OV0_GAMMA_20_3F, 0x100, 0x0040},
- {OV0_GAMMA_40_7F, 0x100, 0x0080},
- {OV0_GAMMA_80_BF, 0x100, 0x0100},
- {OV0_GAMMA_C0_FF, 0x100, 0x0100},
- {OV0_GAMMA_100_13F, 0x100, 0x0200},
- {OV0_GAMMA_140_17F, 0x100, 0x0200},
- {OV0_GAMMA_180_1BF, 0x100, 0x0300},
- {OV0_GAMMA_1C0_1FF, 0x100, 0x0300},
- {OV0_GAMMA_200_23F, 0x100, 0x0400},
- {OV0_GAMMA_240_27F, 0x100, 0x0400},
- {OV0_GAMMA_280_2BF, 0x100, 0x0500},
- {OV0_GAMMA_2C0_2FF, 0x100, 0x0500},
- {OV0_GAMMA_300_33F, 0x100, 0x0600},
- {OV0_GAMMA_340_37F, 0x100, 0x0600},
- {OV0_GAMMA_380_3BF, 0x100, 0x0700},
- {OV0_GAMMA_3C0_3FF, 0x100, 0x0700}
-};
-
-GAMMA_SETTINGS r100_def_gamma[6] =
-{
- {OV0_GAMMA_0_F, 0x100, 0x0000},
- {OV0_GAMMA_10_1F, 0x100, 0x0020},
- {OV0_GAMMA_20_3F, 0x100, 0x0040},
- {OV0_GAMMA_40_7F, 0x100, 0x0080},
- {OV0_GAMMA_380_3BF, 0x100, 0x0100},
- {OV0_GAMMA_3C0_3FF, 0x100, 0x0100}
-};
-
-static void make_default_gamma_correction( void )
-{
- size_t i;
- if((besr.chip_flags & R_100)==R_100||
- (besr.chip_flags & R_120)==R_120||
- (besr.chip_flags & R_150)==R_150){
- OUTREG(OV0_LIN_TRANS_A, 0x12A00000);
- OUTREG(OV0_LIN_TRANS_B, 0x199018FE);
- OUTREG(OV0_LIN_TRANS_C, 0x12A0F9B0);
- OUTREG(OV0_LIN_TRANS_D, 0xF2F0043B);
- OUTREG(OV0_LIN_TRANS_E, 0x12A02050);
- OUTREG(OV0_LIN_TRANS_F, 0x0000174E);
- for(i=0; i<6; i++){
- OUTREG(r100_def_gamma[i].gammaReg,
- (r100_def_gamma[i].gammaSlope<<16) |
- r100_def_gamma[i].gammaOffset);
- }
- }
- else{
- OUTREG(OV0_LIN_TRANS_A, 0x12a20000);
- OUTREG(OV0_LIN_TRANS_B, 0x198a190e);
- OUTREG(OV0_LIN_TRANS_C, 0x12a2f9da);
- OUTREG(OV0_LIN_TRANS_D, 0xf2fe0442);
- OUTREG(OV0_LIN_TRANS_E, 0x12a22046);
- OUTREG(OV0_LIN_TRANS_F, 0x175f);
- /* Default Gamma,
- Of 18 segments for gamma cure, all segments in R200 are programmable,
- while only lower 4 and upper 2 segments are programmable in Radeon*/
- for(i=0; i<18; i++){
- OUTREG(r200_def_gamma[i].gammaReg,
- (r200_def_gamma[i].gammaSlope<<16) |
- r200_def_gamma[i].gammaOffset);
- }
- }
-}
-#endif
-
-static void radeon_vid_make_default(void)
-{
-#ifdef RAGE128
- besr.saturation = 0x0F;
- besr.brightness = 0;
- OUTREG(OV0_COLOUR_CNTL,0x000F0F00UL); /* Default brihgtness and saturation for Rage128 */
-#else
- make_default_gamma_correction();
-#endif
- besr.deinterlace_pattern = 0x900AAAAA;
- OUTREG(OV0_DEINTERLACE_PATTERN,besr.deinterlace_pattern);
- besr.deinterlace_on=1;
- besr.double_buff=1;
- besr.graphics_key_msk=0;
- besr.graphics_key_clr=0;
- besr.ckey_cntl = VIDEO_KEY_FN_TRUE|GRAPHIC_KEY_FN_TRUE|CMP_MIX_AND;
-}
-
-
-unsigned VIDIX_NAME(vixGetVersion)( void ) { return VIDIX_VERSION; }
-
-
-static int find_chip(unsigned chip_id)
-{
- unsigned i;
- for(i = 0;i < sizeof(ati_card_ids)/sizeof(ati_card_ids_t);i++)
- {
- if(chip_id == ati_card_ids[i].id) return i;
- }
- return -1;
-}
-
-static pciinfo_t pci_info;
-static int probed=0;
-
-vidix_capability_t def_cap =
-{
-#ifdef RAGE128
- "BES driver for rage128 cards",
-#else
- "BES driver for radeon cards",
-#endif
- "Nick Kurshev",
- TYPE_OUTPUT | TYPE_FX,
- { 0, 0, 0, 0 },
- 2048,
- 2048,
- 4,
- 4,
- -1,
- FLAG_UPSCALER | FLAG_DOWNSCALER | FLAG_EQUALIZER,
- VENDOR_ATI,
- 0,
- { 0, 0, 0, 0}
-};
-
-
-int VIDIX_NAME(vixProbe)( int verbose,int force )
-{
- pciinfo_t lst[MAX_PCI_DEVICES];
- unsigned i,num_pci;
- int err;
- __verbose = verbose;
- err = pci_scan(lst,&num_pci);
- if(err)
- {
- printf(RADEON_MSG" Error occured during pci scan: %s\n",strerror(err));
- return err;
- }
- else
- {
- err = ENXIO;
- for(i=0;i<num_pci;i++)
- {
- if(lst[i].vendor == VENDOR_ATI)
- {
- int idx;
- const char *dname;
- idx = find_chip(lst[i].device);
- if(idx == -1 && force == PROBE_NORMAL) continue;
- dname = pci_device_name(VENDOR_ATI,lst[i].device);
- dname = dname ? dname : "Unknown chip";
- printf(RADEON_MSG" Found chip: %s\n",dname);
- memset(&besr,0,sizeof(bes_registers_t));
- if(force > PROBE_NORMAL)
- {
- printf(RADEON_MSG" Driver was forced. Was found %sknown chip\n",idx == -1 ? "un" : "");
- if(idx == -1)
-#ifdef RAGE128
- printf(RADEON_MSG" Assuming it as Rage128\n");
-#else
- printf(RADEON_MSG" Assuming it as Radeon1\n");
-#endif
- besr.chip_flags=R_100|R_OVL_SHIFT;
- }
- if(idx != -1) besr.chip_flags=ati_card_ids[idx].flags;
- def_cap.device_id = lst[i].device;
- err = 0;
- memcpy(&pci_info,&lst[i],sizeof(pciinfo_t));
- probed=1;
- break;
- }
- }
- }
- if(err && verbose) printf(RADEON_MSG" Can't find chip\n");
- return err;
-}
-
-#ifndef RAGE128
-enum radeon_montype
-{
- MT_NONE,
- MT_CRT, /* CRT-(cathode ray tube) analog monitor. (15-pin VGA connector) */
- MT_LCD, /* Liquid Crystal Display */
- MT_DFP, /* DFP-digital flat panel monitor. (24-pin DVI-I connector) */
- MT_CTV, /* Composite TV out (not in VE) */
- MT_STV /* S-Video TV out (probably in VE only) */
-};
-
-typedef struct radeon_info_s
-{
- int hasCRTC2;
- int crtDispType;
- int dviDispType;
-}rinfo_t;
-
-static rinfo_t rinfo;
-
-static char * GET_MON_NAME(int type)
-{
- char *pret;
- switch(type)
- {
- case MT_NONE: pret = "no"; break;
- case MT_CRT: pret = "CRT"; break;
- case MT_DFP: pret = "DFP"; break;
- case MT_LCD: pret = "LCD"; break;
- case MT_CTV: pret = "CTV"; break;
- case MT_STV: pret = "STV"; break;
- default: pret = "Unknown";
- }
- return pret;
-}
-
-static void radeon_get_moninfo (rinfo_t *rinfo)
-{
- unsigned int tmp;
-
- tmp = INREG(RADEON_BIOS_4_SCRATCH);
-
- if (rinfo->hasCRTC2) {
- /* primary DVI port */
- if (tmp & 0x08)
- rinfo->dviDispType = MT_DFP;
- else if (tmp & 0x4)
- rinfo->dviDispType = MT_LCD;
- else if (tmp & 0x200)
- rinfo->dviDispType = MT_CRT;
- else if (tmp & 0x10)
- rinfo->dviDispType = MT_CTV;
- else if (tmp & 0x20)
- rinfo->dviDispType = MT_STV;
-
- /* secondary CRT port */
- if (tmp & 0x2)
- rinfo->crtDispType = MT_CRT;
- else if (tmp & 0x800)
- rinfo->crtDispType = MT_DFP;
- else if (tmp & 0x400)
- rinfo->crtDispType = MT_LCD;
- else if (tmp & 0x1000)
- rinfo->crtDispType = MT_CTV;
- else if (tmp & 0x2000)
- rinfo->crtDispType = MT_STV;
- } else {
- rinfo->dviDispType = MT_NONE;
-
- tmp = INREG(FP_GEN_CNTL);
-
- if (tmp & FP_EN_TMDS)
- rinfo->crtDispType = MT_DFP;
- else
- rinfo->crtDispType = MT_CRT;
- }
-}
-#endif
-
-typedef struct saved_regs_s
-{
- uint32_t ov0_vid_key_clr;
- uint32_t ov0_vid_key_msk;
- uint32_t ov0_graphics_key_clr;
- uint32_t ov0_graphics_key_msk;
- uint32_t ov0_key_cntl;
-}saved_regs_t;
-static saved_regs_t savreg;
-
-static void save_regs( void )
-{
- radeon_fifo_wait(6);
- savreg.ov0_vid_key_clr = INREG(OV0_VID_KEY_CLR);
- savreg.ov0_vid_key_msk = INREG(OV0_VID_KEY_MSK);
- savreg.ov0_graphics_key_clr = INREG(OV0_GRAPHICS_KEY_CLR);
- savreg.ov0_graphics_key_msk = INREG(OV0_GRAPHICS_KEY_MSK);
- savreg.ov0_key_cntl = INREG(OV0_KEY_CNTL);
-}
-
-static void restore_regs( void )
-{
- radeon_fifo_wait(6);
- OUTREG(OV0_VID_KEY_CLR,savreg.ov0_vid_key_clr);
- OUTREG(OV0_VID_KEY_MSK,savreg.ov0_vid_key_msk);
- OUTREG(OV0_GRAPHICS_KEY_CLR,savreg.ov0_graphics_key_clr);
- OUTREG(OV0_GRAPHICS_KEY_MSK,savreg.ov0_graphics_key_msk);
- OUTREG(OV0_KEY_CNTL,savreg.ov0_key_cntl);
-}
-
-int VIDIX_NAME(vixInit)( const char *args )
-{
- int err;
- if(!probed)
- {
- printf(RADEON_MSG" Driver was not probed but is being initializing\n");
- return EINTR;
- }
- if((radeon_mmio_base = map_phys_mem(pci_info.base2,0xFFFF))==(void *)-1) return ENOMEM;
- radeon_ram_size = INREG(CONFIG_MEMSIZE);
- /* mem size is bits [28:0], mask off the rest. Range: from 1Mb up to 512 Mb */
- radeon_ram_size &= CONFIG_MEMSIZE_MASK;
-#ifdef RADEON
- /* according to XFree86 4.2.0, some production M6's return 0 for 8MB */
- if (radeon_ram_size == 0 &&
- (def_cap.device_id == DEVICE_ATI_RADEON_MOBILITY_M6 ||
- def_cap.device_id == DEVICE_ATI_RADEON_MOBILITY_M62))
- {
- printf(RADEON_MSG" Workarounding buggy Radeon Mobility M6 (0 vs. 8MB ram)\n");
- radeon_ram_size = 8192*1024;
- }
-#else
- /* Rage Mobility (rage128) also has memsize bug */
- if (radeon_ram_size == 0 &&
- (def_cap.device_id == DEVICE_ATI_RAGE_MOBILITY_M3 ||
- def_cap.device_id == DEVICE_ATI_RAGE_MOBILITY_M32))
- {
- printf(RADEON_MSG" Workarounding buggy Rage Mobility M3 (0 vs. 8MB ram)\n");
- radeon_ram_size = 8192*1024;
- }
-#endif
- if((radeon_mem_base = map_phys_mem(pci_info.base0,radeon_ram_size))==(void *)-1) return ENOMEM;
- radeon_vid_make_default();
- printf(RADEON_MSG" Video memory = %uMb\n",radeon_ram_size/0x100000);
- err = mtrr_set_type(pci_info.base0,radeon_ram_size,MTRR_TYPE_WRCOMB);
- if(!err) printf(RADEON_MSG" Set write-combining type of video memory\n");
-#ifndef RAGE128
- {
- memset(&rinfo,0,sizeof(rinfo_t));
- if((besr.chip_flags&R_100) != R_100) rinfo.hasCRTC2 = 1;
-
- radeon_get_moninfo(&rinfo);
- if(rinfo.hasCRTC2) {
- printf(RADEON_MSG" DVI port has %s monitor connected\n",GET_MON_NAME(rinfo.dviDispType));
- printf(RADEON_MSG" CRT port has %s monitor connected\n",GET_MON_NAME(rinfo.crtDispType));
- }
- else
- printf(RADEON_MSG" CRT port has %s monitor connected\n",GET_MON_NAME(rinfo.crtDispType));
- }
-#endif
-#ifdef RADEON_ENABLE_BM
- if(bm_open() == 0)
- {
- if((dma_phys_addrs = malloc(radeon_ram_size*sizeof(unsigned long)/4096)) != 0)
- def_cap.flags |= FLAG_DMA | FLAG_EQ_DMA;
- else
- printf(RADEON_MSG" Can't allocate temopary buffer for DMA\n");
- }
- else
- if(__verbose) printf(RADEON_MSG" Can't initialize busmastering: %s\n",strerror(errno));
-#endif
- save_regs();
- return 0;
-}
-
-void VIDIX_NAME(vixDestroy)( void )
-{
- restore_regs();
- unmap_phys_mem(radeon_mem_base,radeon_ram_size);
- unmap_phys_mem(radeon_mmio_base,0xFFFF);
- bm_close();
-}
-
-int VIDIX_NAME(vixGetCapability)(vidix_capability_t *to)
-{
- memcpy(to,&def_cap,sizeof(vidix_capability_t));
- return 0;
-}
-
-/*
- Full list of fourcc which are supported by Win2K radeon driver:
- YUY2, UYVY, DDES, OGLT, OGL2, OGLS, OGLB, OGNT, OGNZ, OGNS,
- IF09, YVU9, IMC4, M2IA, IYUV, VBID, DXT1, DXT2, DXT3, DXT4, DXT5
-*/
-typedef struct fourcc_desc_s
-{
- uint32_t fourcc;
- unsigned max_srcw;
-}fourcc_desc_t;
-
-fourcc_desc_t supported_fourcc[] =
-{
- { IMGFMT_Y800, 1567 },
- { IMGFMT_YVU9, 1567 },
- { IMGFMT_IF09, 1567 },
- { IMGFMT_YV12, 1567 },
- { IMGFMT_I420, 1567 },
- { IMGFMT_IYUV, 1567 },
- { IMGFMT_UYVY, 1551 },
- { IMGFMT_YUY2, 1551 },
- { IMGFMT_YVYU, 1551 },
- { IMGFMT_RGB15, 1551 },
- { IMGFMT_BGR15, 1551 },
- { IMGFMT_RGB16, 1551 },
- { IMGFMT_BGR16, 1551 },
- { IMGFMT_RGB32, 775 },
- { IMGFMT_BGR32, 775 }
-};
-
-__inline__ static int is_supported_fourcc(uint32_t fourcc,unsigned srcw)
-{
- unsigned i;
- for(i=0;i<sizeof(supported_fourcc)/sizeof(fourcc_desc_t);i++)
- {
- if(fourcc==supported_fourcc[i].fourcc &&
- srcw <=supported_fourcc[i].max_srcw) return 1;
- }
- return 0;
-}
-
-int VIDIX_NAME(vixQueryFourcc)(vidix_fourcc_t *to)
-{
- if(is_supported_fourcc(to->fourcc,to->srcw))
- {
- to->depth = VID_DEPTH_1BPP | VID_DEPTH_2BPP |
- VID_DEPTH_4BPP | VID_DEPTH_8BPP |
- VID_DEPTH_12BPP| VID_DEPTH_15BPP|
- VID_DEPTH_16BPP| VID_DEPTH_24BPP|
- VID_DEPTH_32BPP;
- to->flags = VID_CAP_EXPAND | VID_CAP_SHRINK | VID_CAP_COLORKEY;
- return 0;
- }
- else to->depth = to->flags = 0;
- return ENOSYS;
-}
-
-static double H_scale_ratio;
-static void radeon_vid_dump_regs( void )
-{
- size_t i;
- printf(RADEON_MSG"*** Begin of DRIVER variables dump ***\n");
- printf(RADEON_MSG"radeon_mmio_base=%p\n",radeon_mmio_base);
- printf(RADEON_MSG"radeon_mem_base=%p\n",radeon_mem_base);
- printf(RADEON_MSG"radeon_overlay_off=%08X\n",radeon_overlay_off);
- printf(RADEON_MSG"radeon_ram_size=%08X\n",radeon_ram_size);
- printf(RADEON_MSG"video mode: %ux%u@%u\n",radeon_get_xres(),radeon_get_yres(),radeon_vid_get_dbpp());
- printf(RADEON_MSG"H_scale_ratio=%8.2f\n",H_scale_ratio);
- printf(RADEON_MSG"*** Begin of OV0 registers dump ***\n");
- for(i=0;i<sizeof(vregs)/sizeof(video_registers_t);i++)
- printf(RADEON_MSG"%s = %08X\n",vregs[i].sname,INREG(vregs[i].name));
- printf(RADEON_MSG"*** End of OV0 registers dump ***\n");
-}
-
-static void radeon_vid_stop_video( void )
-{
- radeon_engine_idle();
- OUTREG(OV0_SCALE_CNTL, SCALER_SOFT_RESET);
- OUTREG(OV0_EXCLUSIVE_HORZ, 0);
- OUTREG(OV0_AUTO_FLIP_CNTL, 0); /* maybe */
- OUTREG(OV0_FILTER_CNTL, FILTER_HARDCODED_COEF);
-#ifdef RAGE128
- OUTREG(OV0_KEY_CNTL, GRAPHIC_KEY_FN_NE);
-#else
- OUTREG(OV0_KEY_CNTL, GRAPHIC_KEY_FN_EQ);
-#endif
- OUTREG(OV0_TEST, 0);
-}
-
-static void radeon_vid_display_video( void )
-{
- int bes_flags;
- radeon_fifo_wait(2);
- OUTREG(OV0_REG_LOAD_CNTL, REG_LD_CTL_LOCK);
- radeon_engine_idle();
- while(!(INREG(OV0_REG_LOAD_CNTL)&REG_LD_CTL_LOCK_READBACK));
- radeon_fifo_wait(15);
-
- /* Shutdown capturing */
- OUTREG(FCP_CNTL, FCP_CNTL__GND);
- OUTREG(CAP0_TRIG_CNTL, 0);
-
- OUTREG(VID_BUFFER_CONTROL, (1<<16) | 0x01);
- OUTREG(DISP_TEST_DEBUG_CNTL, 0);
-
- OUTREG(OV0_AUTO_FLIP_CNTL,OV0_AUTO_FLIP_CNTL_SOFT_BUF_ODD);
-
- if(besr.deinterlace_on) OUTREG(OV0_DEINTERLACE_PATTERN,besr.deinterlace_pattern);
-#ifdef RAGE128
- OUTREG(OV0_COLOUR_CNTL, (besr.brightness & 0x7f) |
- (besr.saturation << 8) |
- (besr.saturation << 16));
-#endif
- radeon_fifo_wait(2);
- OUTREG(OV0_GRAPHICS_KEY_MSK, besr.graphics_key_msk);
- OUTREG(OV0_GRAPHICS_KEY_CLR, besr.graphics_key_clr);
- OUTREG(OV0_KEY_CNTL,besr.ckey_cntl);
-
- OUTREG(OV0_H_INC, besr.h_inc);
- OUTREG(OV0_STEP_BY, besr.step_by);
- OUTREG(OV0_Y_X_START, besr.y_x_start);
- OUTREG(OV0_Y_X_END, besr.y_x_end);
- OUTREG(OV0_V_INC, besr.v_inc);
- OUTREG(OV0_P1_BLANK_LINES_AT_TOP, besr.p1_blank_lines_at_top);
- OUTREG(OV0_P23_BLANK_LINES_AT_TOP, besr.p23_blank_lines_at_top);
- OUTREG(OV0_VID_BUF_PITCH0_VALUE, besr.vid_buf_pitch0_value);
- OUTREG(OV0_VID_BUF_PITCH1_VALUE, besr.vid_buf_pitch1_value);
- OUTREG(OV0_P1_X_START_END, besr.p1_x_start_end);
- OUTREG(OV0_P2_X_START_END, besr.p2_x_start_end);
- OUTREG(OV0_P3_X_START_END, besr.p3_x_start_end);
-#ifdef RADEON
- OUTREG(OV0_BASE_ADDR, besr.base_addr);
-#endif
- OUTREG(OV0_VID_BUF0_BASE_ADRS, besr.vid_buf_base_adrs_y[0]);
- OUTREG(OV0_VID_BUF1_BASE_ADRS, besr.vid_buf_base_adrs_v[0]);
- OUTREG(OV0_VID_BUF2_BASE_ADRS, besr.vid_buf_base_adrs_u[0]);
- radeon_fifo_wait(9);
- OUTREG(OV0_VID_BUF3_BASE_ADRS, besr.vid_buf_base_adrs_y[0]);
- OUTREG(OV0_VID_BUF4_BASE_ADRS, besr.vid_buf_base_adrs_v[0]);
- OUTREG(OV0_VID_BUF5_BASE_ADRS, besr.vid_buf_base_adrs_u[0]);
- OUTREG(OV0_P1_V_ACCUM_INIT, besr.p1_v_accum_init);
- OUTREG(OV0_P1_H_ACCUM_INIT, besr.p1_h_accum_init);
- OUTREG(OV0_P23_H_ACCUM_INIT, besr.p23_h_accum_init);
- OUTREG(OV0_P23_V_ACCUM_INIT, besr.p23_v_accum_init);
-
- bes_flags = SCALER_ENABLE |
- SCALER_SMART_SWITCH |
- SCALER_Y2R_TEMP |
- SCALER_PIX_EXPAND;
- if(besr.double_buff) bes_flags |= SCALER_DOUBLE_BUFFER;
- if(besr.deinterlace_on) bes_flags |= SCALER_ADAPTIVE_DEINT;
- if(besr.horz_pick_nearest) bes_flags |= SCALER_HORZ_PICK_NEAREST;
- if(besr.vert_pick_nearest) bes_flags |= SCALER_VERT_PICK_NEAREST;
-#ifdef RAGE128
- bes_flags |= SCALER_BURST_PER_PLANE;
-#endif
- bes_flags |= (besr.surf_id << 8) & SCALER_SURFAC_FORMAT;
- if(besr.load_prg_start) bes_flags |= SCALER_PRG_LOAD_START;
- OUTREG(OV0_SCALE_CNTL, bes_flags);
-#ifndef RAGE128
- if(rinfo.hasCRTC2 &&
- (rinfo.dviDispType == MT_CTV || rinfo.dviDispType == MT_STV))
- {
- /* TODO: suppress scaler output to CRTC here and enable TVO only */
- }
-#endif
- radeon_fifo_wait(6);
- OUTREG(OV0_FILTER_CNTL,besr.filter_cntl);
- OUTREG(OV0_FOUR_TAP_COEF_0,besr.four_tap_coeff[0]);
- OUTREG(OV0_FOUR_TAP_COEF_1,besr.four_tap_coeff[1]);
- OUTREG(OV0_FOUR_TAP_COEF_2,besr.four_tap_coeff[2]);
- OUTREG(OV0_FOUR_TAP_COEF_3,besr.four_tap_coeff[3]);
- OUTREG(OV0_FOUR_TAP_COEF_4,besr.four_tap_coeff[4]);
- if(besr.swap_uv) OUTREG(OV0_TEST,INREG(OV0_TEST)|OV0_SWAP_UV);
- OUTREG(OV0_REG_LOAD_CNTL, 0);
- if(__verbose > VERBOSE_LEVEL) printf(RADEON_MSG"we wanted: scaler=%08X\n",bes_flags);
- if(__verbose > VERBOSE_LEVEL) radeon_vid_dump_regs();
-}
-
-/* Goal of this function: hide RGB background and provide black screen around movie.
- Useful in '-vo fbdev:vidix -fs -zoom' mode.
- Reverse effect to colorkey */
-#ifdef RAGE128
-static void radeon_vid_exclusive( void )
-{
-/* this function works only with Rage128.
- Radeon should has something the same */
- unsigned screenw,screenh;
- screenw = radeon_get_xres();
- screenh = radeon_get_yres();
- radeon_fifo_wait(2);
- OUTREG(OV0_EXCLUSIVE_VERT,(((screenh-1)<<16)&EXCL_VERT_END_MASK));
- OUTREG(OV0_EXCLUSIVE_HORZ,(((screenw/8+1)<<8)&EXCL_HORZ_END_MASK)|EXCL_HORZ_EXCLUSIVE_EN);
-}
-
-static void radeon_vid_non_exclusive( void )
-{
- OUTREG(OV0_EXCLUSIVE_HORZ,0);
-}
-#endif
-
-static unsigned radeon_query_pitch(unsigned fourcc,const vidix_yuv_t *spitch)
-{
- unsigned pitch,spy,spv,spu;
- spy = spv = spu = 0;
- switch(spitch->y)
- {
- case 16:
- case 32:
- case 64:
- case 128:
- case 256: spy = spitch->y; break;
- default: break;
- }
- switch(spitch->u)
- {
- case 16:
- case 32:
- case 64:
- case 128:
- case 256: spu = spitch->u; break;
- default: break;
- }
- switch(spitch->v)
- {
- case 16:
- case 32:
- case 64:
- case 128:
- case 256: spv = spitch->v; break;
- default: break;
- }
- switch(fourcc)
- {
- /* 4:2:0 */
- case IMGFMT_IYUV:
- case IMGFMT_YV12:
- case IMGFMT_I420:
- if(spy > 16 && spu == spy/2 && spv == spy/2) pitch = spy;
- else pitch = 32;
- break;
- case IMGFMT_IF09:
- case IMGFMT_YVU9:
- if(spy >= 64 && spu == spy/4 && spv == spy/4) pitch = spy;
- else pitch = 64;
- break;
- default:
- if(spy >= 16) pitch = spy;
- else pitch = 16;
- break;
- }
- return pitch;
-}
-
-static void Calc_H_INC_STEP_BY (
- int fieldvalue_OV0_SURFACE_FORMAT,
- double H_scale_ratio,
- int DisallowFourTapVertFiltering,
- int DisallowFourTapUVVertFiltering,
- uint32_t *val_OV0_P1_H_INC,
- uint32_t *val_OV0_P1_H_STEP_BY,
- uint32_t *val_OV0_P23_H_INC,
- uint32_t *val_OV0_P23_H_STEP_BY,
- int *P1GroupSize,
- int *P1StepSize,
- int *P23StepSize )
-{
-
- double ClocksNeededFor16Pixels;
-
- switch (fieldvalue_OV0_SURFACE_FORMAT)
- {
- case 3:
- case 4: /*16BPP (ARGB1555 and RGB565) */
- /* All colour components are fetched in pairs */
- *P1GroupSize = 2;
- /* We don't support four tap in this mode because G's are split between two bytes. In theory we could support it if */
- /* we saved part of the G when fetching the R, and then filter the G, followed by the B in the following cycles. */
- if (H_scale_ratio>=.5)
- {
- /* We are actually generating two pixels (but 3 colour components) per tick. Thus we don't have to skip */
- /* until we reach .5. P1 and P23 are the same. */
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 1;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 1;
- *P1StepSize = 1;
- *P23StepSize = 1;
- }
- else if (H_scale_ratio>=.25)
- {
- /* Step by two */
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio*2)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 2;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*2)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 2;
- *P1StepSize = 2;
- *P23StepSize = 2;
- }
- else if (H_scale_ratio>=.125)
- {
- /* Step by four */
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio*4)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 3;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*4)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 3;
- *P1StepSize = 4;
- *P23StepSize = 4;
- }
- else if (H_scale_ratio>=.0625)
- {
- /* Step by eight */
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio*8)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 4;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*8)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 4;
- *P1StepSize = 8;
- *P23StepSize = 8;
- }
- else if (H_scale_ratio>=0.03125)
- {
- /* Step by sixteen */
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio*16)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 5;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*16)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 5;
- *P1StepSize = 16;
- *P23StepSize = 16;
- }
- else
- {
- H_scale_ratio=0.03125;
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio*16)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 5;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*16)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 5;
- *P1StepSize = 16;
- *P23StepSize = 16;
- }
- break;
- case 6: /*32BPP RGB */
- if (H_scale_ratio>=1.5 && !DisallowFourTapVertFiltering)
- {
- /* All colour components are fetched in pairs */
- *P1GroupSize = 2;
- /* With four tap filtering, we can generate two colour components every clock, or two pixels every three */
- /* clocks. This means that we will have four tap filtering when scaling 1.5 or more. */
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 0;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 0;
- *P1StepSize = 1;
- *P23StepSize = 1;
- }
- else if (H_scale_ratio>=0.75)
- {
- /* Four G colour components are fetched at once */
- *P1GroupSize = 4;
- /* R and B colour components are fetched in pairs */
- /* With two tap filtering, we can generate four colour components every clock. */
- /* This means that we will have two tap filtering when scaling 1.0 or more. */
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 1;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 1;
- *P1StepSize = 1;
- *P23StepSize = 1;
- }
- else if (H_scale_ratio>=0.375)
- {
- /* Step by two. */
- /* Four G colour components are fetched at once */
- *P1GroupSize = 4;
- /* R and B colour components are fetched in pairs */
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio*2)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 2;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*2)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 2;
- *P1StepSize = 2;
- *P23StepSize = 2;
- }
- else if (H_scale_ratio>=0.25)
- {
- /* Step by two. */
- /* Four G colour components are fetched at once */
- *P1GroupSize = 4;
- /* R and B colour components are fetched in pairs */
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio*2)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 2;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*4)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 3;
- *P1StepSize = 2;
- *P23StepSize = 4;
- }
- else if (H_scale_ratio>=0.1875)
- {
- /* Step by four */
- /* Four G colour components are fetched at once */
- *P1GroupSize = 4;
- /* R and B colour components are fetched in pairs */
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio*4)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 3;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*4)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 3;
- *P1StepSize = 4;
- *P23StepSize = 4;
- }
- else if (H_scale_ratio>=0.125)
- {
- /* Step by four */
- /* Four G colour components are fetched at once */
- *P1GroupSize = 4;
- /* R and B colour components are fetched in pairs */
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio*4)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 3;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*8)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 4;
- *P1StepSize = 4;
- *P23StepSize = 8;
- }
- else if (H_scale_ratio>=0.09375)
- {
- /* Step by eight */
- /* Four G colour components are fetched at once */
- *P1GroupSize = 4;
- /* R and B colour components are fetched in pairs */
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio*8)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 4;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*8)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 4;
- *P1StepSize = 8;
- *P23StepSize = 8;
- }
- else if (H_scale_ratio>=0.0625)
- {
- /* Step by eight */
- /* Four G colour components are fetched at once */
- *P1GroupSize = 4;
- /* R and B colour components are fetched in pairs */
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio*16)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 5;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*16)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 5;
- *P1StepSize = 16;
- *P23StepSize = 16;
- }
- else
- {
- H_scale_ratio=0.0625;
- *P1GroupSize = 4;
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio*16)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 5;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*16)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 5;
- *P1StepSize = 16;
- *P23StepSize = 16;
- }
- break;
- case 9:
- /*ToDo_Active: In mode 9 there is a possibility that HScale ratio may be set to an illegal value, so we have extra conditions in the if statement. For consistancy, these conditions be added to the other modes as well. */
- /* four tap on both (unless Y is too wide) */
- if ((H_scale_ratio>=(ClocksNeededFor16Pixels=8+2+2) / 16.0) &&
- ((uint16_t)((1/(H_scale_ratio)) * (1<<0xc) + 0.5)<=0x3000) &&
- ((uint16_t)((1/(H_scale_ratio*4)) * (1<<0xc) + 0.5)<=0x2000) &&
- !DisallowFourTapVertFiltering && !DisallowFourTapUVVertFiltering)
- { /*0.75 */
- /* Colour components are fetched in pairs */
- *P1GroupSize = 2;
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 0;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*4)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 0;
- *P1StepSize = 1;
- *P23StepSize = 1;
- }
- /* two tap on Y (because it is too big for four tap), four tap on UV */
- else if ((H_scale_ratio>=(ClocksNeededFor16Pixels=4+2+2) / 16.0) &&
- ((uint16_t)((1/(H_scale_ratio)) * (1<<0xc) + 0.5)<=0x3000) &&
- ((uint16_t)((1/(H_scale_ratio*4)) * (1<<0xc) + 0.5)<=0x2000) &&
- DisallowFourTapVertFiltering && !DisallowFourTapUVVertFiltering)
- { /*0.75 */
- *P1GroupSize = 4;
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 1;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*4)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 0;
- *P1StepSize = 1;
- *P23StepSize = 1;
- }
- /* We scale the Y with the four tap filters, but UV's are generated
- with dual two tap configuration. */
- else if ((H_scale_ratio>=(ClocksNeededFor16Pixels=8+1+1) / 16.0) &&
- ((uint16_t)((1/(H_scale_ratio)) * (1<<0xc) + 0.5)<=0x3000) &&
- ((uint16_t)((1/(H_scale_ratio*4)) * (1<<0xc) + 0.5)<=0x2000) &&
- !DisallowFourTapVertFiltering)
- { /*0.625 */
- *P1GroupSize = 2;
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 0;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*4)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 1;
- *P1StepSize = 1;
- *P23StepSize = 1;
- }
- /* We scale the Y, U, and V with the two tap filters */
- else if ((H_scale_ratio>=(ClocksNeededFor16Pixels=4+1+1) / 16.0) &&
- ((uint16_t)((1/(H_scale_ratio)) * (1<<0xc) + 0.5)<=0x3000) &&
- ((uint16_t)((1/(H_scale_ratio*4)) * (1<<0xc) + 0.5)<=0x2000))
- { /*0.375 */
- *P1GroupSize = 4;
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 1;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*4)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 1;
- *P1StepSize = 1;
- *P23StepSize = 1;
- }
- /* We scale step the U and V by two to allow more bandwidth for fetching Y's,
- thus we won't drop Y's yet. */
- else if ((H_scale_ratio>=(ClocksNeededFor16Pixels=4+.5+.5) / 16.0) &&
- ((uint16_t)((1/(H_scale_ratio)) * (1<<0xc) + 0.5)<=0x3000) &&
- ((uint16_t)((1/(H_scale_ratio*4*2)) * (1<<0xc) + 0.5)<=0x2000))
- { /*>=0.3125 and >.333333~ */
- *P1GroupSize = 4;
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 1;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*4*2)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 2;
- *P1StepSize = 1;
- *P23StepSize = 2;
- }
- /* We step the Y, U, and V by two. */
- else if ((H_scale_ratio>=(ClocksNeededFor16Pixels=2+.5+.5) / 16.0) &&
- ((uint16_t)((1/(H_scale_ratio*2)) * (1<<0xc) + 0.5)<=0x3000) &&
- ((uint16_t)((1/(H_scale_ratio*4*2)) * (1<<0xc) + 0.5)<=0x2000))
- {
- *P1GroupSize = 4;
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio*2)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 2;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*4*2)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 2;
- *P1StepSize = 2;
- *P23StepSize = 2;
- }
- /* We step the Y by two and the U and V by four. */
- else if ((H_scale_ratio>=(ClocksNeededFor16Pixels=2+.25+.25) / 16.0) &&
- ((uint16_t)((1/(H_scale_ratio)) * (1<<0xc) + 0.5)<=0x3000) &&
- ((uint16_t)((1/(H_scale_ratio*4*4)) * (1<<0xc) + 0.5)<=0x2000))
- {
- *P1GroupSize = 4;
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio*2)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 2;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*4*4)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 3;
- *P1StepSize = 2;
- *P23StepSize = 4;
- }
- /* We step the Y, U, and V by four. */
- else if ((H_scale_ratio>=(ClocksNeededFor16Pixels=1+.25+.25) / 16.0) &&
- ((uint16_t)((1/(H_scale_ratio*4)) * (1<<0xc) + 0.5)<=0x3000) &&
- ((uint16_t)((1/(H_scale_ratio*4*4)) * (1<<0xc) + 0.5)<=0x2000))
- {
- *P1GroupSize = 4;
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio*4)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 3;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*4*4)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 3;
- *P1StepSize = 4;
- *P23StepSize = 4;
- }
- /* We would like to step the Y by four and the U and V by eight, but we can't mix step by 3 and step by 4 for packed modes */
-
- /* We step the Y, U, and V by eight. */
- else if ((H_scale_ratio>=(ClocksNeededFor16Pixels=.5+.125+.125) / 16.0) &&
- ((uint16_t)((1/(H_scale_ratio*8)) * (1<<0xc) + 0.5)<=0x3000) &&
- ((uint16_t)((1/(H_scale_ratio*4*8)) * (1<<0xc) + 0.5)<=0x2000))
- {
- *P1GroupSize = 4;
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio*8)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 4;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*4*8)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 4;
- *P1StepSize = 8;
- *P23StepSize = 8;
- }
- /* We step the Y by eight and the U and V by sixteen. */
- else if ((H_scale_ratio>=(ClocksNeededFor16Pixels=.5+.0625+.0625) / 16.0) &&
- ((uint16_t)((1/(H_scale_ratio*8)) * (1<<0xc) + 0.5)<=0x3000) &&
- ((uint16_t)((1/(H_scale_ratio*4*16)) * (1<<0xc) + 0.5)<=0x2000))
- {
- *P1GroupSize = 4;
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio*8)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 4;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*4*16)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 5;
- *P1StepSize = 8;
- *P23StepSize = 16;
- }
- /* We step the Y, U, and V by sixteen. */
- else if ((H_scale_ratio>=(ClocksNeededFor16Pixels=.25+.0625+.0625) / 16.0) &&
- ((uint16_t)((1/(H_scale_ratio*16)) * (1<<0xc) + 0.5)<=0x3000) &&
- ((uint16_t)((1/(H_scale_ratio*4*16)) * (1<<0xc) + 0.5)<=0x2000))
- {
- *P1GroupSize = 4;
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio*16)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 5;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*4*16)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 5;
- *P1StepSize = 16;
- *P23StepSize = 16;
- }
- else
- {
- H_scale_ratio=(ClocksNeededFor16Pixels=.25+.0625+.0625) / 16;
- *P1GroupSize = 4;
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio*16)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 5;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*4*16)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 5;
- *P1StepSize = 16;
- *P23StepSize = 16;
- }
- break;
- case 10:
- case 11:
- case 12:
- case 13:
- case 14: /* YUV12, VYUY422, YUYV422, YOverPkCRCB12, YWovenWithPkCRCB12 */
- /* We scale the Y, U, and V with the four tap filters */
- /* four tap on both (unless Y is too wide) */
- if ((H_scale_ratio>=(ClocksNeededFor16Pixels=8+4+4) / 16.0) &&
- !DisallowFourTapVertFiltering && !DisallowFourTapUVVertFiltering)
- { /*0.75 */
- *P1GroupSize = 2;
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 0;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*2)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 0;
- *P1StepSize = 1;
- *P23StepSize = 1;
- }
- /* two tap on Y (because it is too big for four tap), four tap on UV */
- else if ((H_scale_ratio>=(ClocksNeededFor16Pixels=4+4+4) / 16.0) &&
- DisallowFourTapVertFiltering && !DisallowFourTapUVVertFiltering)
- { /*0.75 */
- *P1GroupSize = 4;
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 1;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*2)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 0;
- *P1StepSize = 1;
- *P23StepSize = 1;
- }
- /* We scale the Y with the four tap filters, but UV's are generated
- with dual two tap configuration. */
- else if ((H_scale_ratio>=(ClocksNeededFor16Pixels=8+2+2) / 16.0) &&
- !DisallowFourTapVertFiltering)
- { /*0.625 */
- *P1GroupSize = 2;
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 0;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*2)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 1;
- *P1StepSize = 1;
- *P23StepSize = 1;
- }
- /* We scale the Y, U, and V with the two tap filters */
- else if (H_scale_ratio>=(ClocksNeededFor16Pixels=4+2+2) / 16.0)
- { /*0.375 */
- *P1GroupSize = 4;
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 1;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*2)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 1;
- *P1StepSize = 1;
- *P23StepSize = 1;
- }
- /* We scale step the U and V by two to allow more bandwidth for
- fetching Y's, thus we won't drop Y's yet. */
- else if (H_scale_ratio>=(ClocksNeededFor16Pixels=4+1+1) / 16.0)
- { /*0.312 */
- *P1GroupSize = 4;
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 1;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*2*2)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 2;
- *P1StepSize = 1;
- *P23StepSize = 2;
- }
- /* We step the Y, U, and V by two. */
- else if (H_scale_ratio>=(ClocksNeededFor16Pixels=2+1+1) / 16.0)
- {
- *P1GroupSize = 4;
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio*2)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 2;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*2*2)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 2;
- *P1StepSize = 2;
- *P23StepSize = 2;
- }
- /* We step the Y by two and the U and V by four. */
- else if (H_scale_ratio>=(ClocksNeededFor16Pixels=2+.5+.5) / 16.0)
- {
- *P1GroupSize = 4;
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio*2)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 2;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*2*4)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 3;
- *P1StepSize = 2;
- *P23StepSize = 4;
- }
- /* We step the Y, U, and V by four. */
- else if (H_scale_ratio>=(ClocksNeededFor16Pixels=1+.5+.5) / 16.0)
- {
- *P1GroupSize = 4;
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio*4)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 3;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*2*4)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 3;
- *P1StepSize = 4;
- *P23StepSize = 4;
- }
- /* We step the Y by four and the U and V by eight. */
- else if ((H_scale_ratio>=(ClocksNeededFor16Pixels=1+.25+.25) / 16.0) &&
- (fieldvalue_OV0_SURFACE_FORMAT==10))
- {
- *P1GroupSize = 4;
- /* Can't mix step by 3 and step by 4 for packed modes */
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio*4)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 3;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*2*8)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 4;
- *P1StepSize = 4;
- *P23StepSize = 8;
- }
- /* We step the Y, U, and V by eight. */
- else if (H_scale_ratio>=(ClocksNeededFor16Pixels=.5+.25+.25) / 16.0)
- {
- *P1GroupSize = 4;
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio*8)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 4;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*2*8)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 4;
- *P1StepSize = 8;
- *P23StepSize = 8;
- }
- /* We step the Y by eight and the U and V by sixteen. */
- else if ((H_scale_ratio>=(ClocksNeededFor16Pixels=.5+.125+.125) / 16.0) && (fieldvalue_OV0_SURFACE_FORMAT==10))
- {
- *P1GroupSize = 4;
- /* Step by 5 not supported for packed modes */
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio*8)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 4;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*2*16)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 5;
- *P1StepSize = 8;
- *P23StepSize = 16;
- }
- /* We step the Y, U, and V by sixteen. */
- else if ((H_scale_ratio>=(ClocksNeededFor16Pixels=.25+.125+.125) / 16.0) &&
- (fieldvalue_OV0_SURFACE_FORMAT==10))
- {
- *P1GroupSize = 4;
- /* Step by 5 not supported for packed modes */
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio*16)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 5;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*2*16)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 5;
- *P1StepSize = 16;
- *P23StepSize = 16;
- }
- else
- {
- if (fieldvalue_OV0_SURFACE_FORMAT==10)
- {
- H_scale_ratio=(ClocksNeededFor16Pixels=.25+.125+.125) / 16;
- *P1GroupSize = 4;
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio*16)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 5;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*2*16)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 5;
- *P1StepSize = 16;
- *P23StepSize = 16;
- }
- else
- {
- H_scale_ratio=(ClocksNeededFor16Pixels=.5+.25+.25) / 16;
- *P1GroupSize = 4;
- *val_OV0_P1_H_INC = (uint16_t)((1/(H_scale_ratio*8)) * (1<<0xc) + 0.5);
- *val_OV0_P1_H_STEP_BY = 4;
- *val_OV0_P23_H_INC = (uint16_t)((1/(H_scale_ratio*2*8)) * (1<<0xc) + 0.5);
- *val_OV0_P23_H_STEP_BY = 4;
- *P1StepSize = 8;
- *P23StepSize = 8;
- }
- }
- break;
- default: break;
-
- }
- besr.h_inc = (*(val_OV0_P1_H_INC)&0x3fff) | ((*(val_OV0_P23_H_INC)&0x3fff)<<16);
- besr.step_by = (*(val_OV0_P1_H_STEP_BY)&0x7) | ((*(val_OV0_P23_H_STEP_BY)&0x7)<<8);
-}
-
-/* ********************************************************* */
-/* ** Setup Black Bordering */
-/* ********************************************************* */
-
-static void ComputeBorders( vidix_playback_t *config, int VertUVSubSample )
-{
- double tempBLANK_LINES_AT_TOP;
- unsigned TopLine,BottomLine,SourceLinesUsed,TopUVLine,BottomUVLine,SourceUVLinesUsed;
- uint32_t val_OV0_P1_ACTIVE_LINES_M1,val_OV0_P1_BLNK_LN_AT_TOP_M1;
- uint32_t val_OV0_P23_ACTIVE_LINES_M1,val_OV0_P23_BLNK_LN_AT_TOP_M1;
-
- if (floor(config->src.y)<0) {
- tempBLANK_LINES_AT_TOP = -floor(config->src.y);
- TopLine = 0;
- }
- else {
- tempBLANK_LINES_AT_TOP = 0;
- TopLine = (int)floor(config->src.y);
- }
- /* Round rSrcBottom up and subtract one */
- if (ceil(config->src.y+config->src.h) > config->src.h)
- {
- BottomLine = config->src.h - 1;
- }
- else
- {
- BottomLine = (int)ceil(config->src.y+config->src.h) - 1;
- }
-
- if (BottomLine >= TopLine)
- {
- SourceLinesUsed = BottomLine - TopLine + 1;
- }
- else
- {
- /*CYCACC_ASSERT(0, "SourceLinesUsed less than or equal to zero.") */
- SourceLinesUsed = 1;
- }
-
- {
- int SourceHeightInPixels;
- SourceHeightInPixels = BottomLine - TopLine + 1;
- }
-
- val_OV0_P1_ACTIVE_LINES_M1 = SourceLinesUsed - 1;
- val_OV0_P1_BLNK_LN_AT_TOP_M1 = ((int)tempBLANK_LINES_AT_TOP-1) & 0xfff;
-
- TopUVLine = ((int)(config->src.y/VertUVSubSample) < 0) ? 0: (int)(config->src.y/VertUVSubSample); /* Round rSrcTop down */
- BottomUVLine = (ceil(((config->src.y+config->src.h)/VertUVSubSample)) > (config->src.h/VertUVSubSample))
- ? (config->src.h/VertUVSubSample)-1 : (u_int)ceil(((config->src.y+config->src.h)/VertUVSubSample))-1;
-
- if (BottomUVLine >= TopUVLine)
- {
- SourceUVLinesUsed = BottomUVLine - TopUVLine + 1;
- }
- else
- {
- /*CYCACC_ASSERT(0, "SourceUVLinesUsed less than or equal to zero.") */
- SourceUVLinesUsed = 1;
- }
- val_OV0_P23_ACTIVE_LINES_M1 = SourceUVLinesUsed - 1;
- val_OV0_P23_BLNK_LN_AT_TOP_M1 = ((int)(tempBLANK_LINES_AT_TOP/VertUVSubSample)-1) & 0x7ff;
- besr.p1_blank_lines_at_top = (val_OV0_P1_BLNK_LN_AT_TOP_M1 & 0xfff) |
- ((val_OV0_P1_ACTIVE_LINES_M1 & 0xfff) << 16);
- besr.p23_blank_lines_at_top = (val_OV0_P23_BLNK_LN_AT_TOP_M1 & 0x7ff) |
- ((val_OV0_P23_ACTIVE_LINES_M1 & 0x7ff) << 16);
-}
-
-
-static void ComputeXStartEnd(
- int is_400,
- uint32_t LeftPixel,uint32_t LeftUVPixel,
- uint32_t MemWordsInBytes,uint32_t BytesPerPixel,
- uint32_t SourceWidthInPixels, uint32_t P1StepSize,
- uint32_t BytesPerUVPixel,uint32_t SourceUVWidthInPixels,
- uint32_t P23StepSize, uint32_t *p1_x_start, uint32_t *p2_x_start )
-{
- uint32_t val_OV0_P1_X_START,val_OV0_P2_X_START,val_OV0_P3_X_START;
- uint32_t val_OV0_P1_X_END,val_OV0_P2_X_END,val_OV0_P3_X_END;
- /* ToDo_Active: At the moment we are not using iOV0_VID_BUF?_START_PIX, but instead // are using iOV0_P?_X_START and iOV0_P?_X_END. We should use "start pix" and // "width" to derive the start and end. */
-
- val_OV0_P1_X_START = (int)LeftPixel % (MemWordsInBytes/BytesPerPixel);
- val_OV0_P1_X_END = (int)((val_OV0_P1_X_START + SourceWidthInPixels - 1) / P1StepSize) * P1StepSize;
-
- val_OV0_P2_X_START = val_OV0_P2_X_END = 0;
- switch (besr.surf_id)
- {
- case 9:
- case 10:
- case 13:
- case 14: /* ToDo_Active: The driver must insure that the initial value is */
- /* a multiple of a power of two when decimating */
- val_OV0_P2_X_START = (int)LeftUVPixel %
- (MemWordsInBytes/BytesPerUVPixel);
- val_OV0_P2_X_END = (int)((val_OV0_P2_X_START +
- SourceUVWidthInPixels - 1) / P23StepSize) * P23StepSize;
- break;
- case 11:
- case 12: val_OV0_P2_X_START = (int)LeftUVPixel % (MemWordsInBytes/(BytesPerPixel*2));
- val_OV0_P2_X_END = (int)((val_OV0_P2_X_START + SourceUVWidthInPixels - 1) / P23StepSize) * P23StepSize;
- break;
- case 3:
- case 4: val_OV0_P2_X_START = val_OV0_P1_X_START;
- /* This value is needed only to allow proper setting of */
- /* val_OV0_PRESHIFT_P23_TO */
- /* val_OV0_P2_X_END = 0; */
- break;
- case 6: val_OV0_P2_X_START = (int)LeftPixel % (MemWordsInBytes/BytesPerPixel);
- val_OV0_P2_X_END = (int)((val_OV0_P1_X_START + SourceWidthInPixels - 1) / P23StepSize) * P23StepSize;
- break;
- default: /* insert debug statement here. */
- RADEON_ASSERT("unknown fourcc\n");
- break;
- }
- val_OV0_P3_X_START = val_OV0_P2_X_START;
- val_OV0_P3_X_END = val_OV0_P2_X_END;
-
- besr.p1_x_start_end = (val_OV0_P1_X_END&0x7ff) | ((val_OV0_P1_X_START&0x7ff)<<16);
- besr.p2_x_start_end = (val_OV0_P2_X_END&0x7ff) | ((val_OV0_P2_X_START&0x7ff)<<16);
- besr.p3_x_start_end = (val_OV0_P3_X_END&0x7ff) | ((val_OV0_P3_X_START&0x7ff)<<16);
- if(is_400)
- {
- besr.p2_x_start_end = 0;
- besr.p3_x_start_end = 0;
- }
- *p1_x_start = val_OV0_P1_X_START;
- *p2_x_start = val_OV0_P2_X_START;
-}
-
-static void ComputeAccumInit(
- uint32_t val_OV0_P1_X_START,uint32_t val_OV0_P2_X_START,
- uint32_t val_OV0_P1_H_INC,uint32_t val_OV0_P23_H_INC,
- uint32_t val_OV0_P1_H_STEP_BY,uint32_t val_OV0_P23_H_STEP_BY,
- uint32_t CRT_V_INC,
- uint32_t P1GroupSize, uint32_t P23GroupSize,
- uint32_t val_OV0_P1_MAX_LN_IN_PER_LN_OUT,
- uint32_t val_OV0_P23_MAX_LN_IN_PER_LN_OUT)
-{
- uint32_t val_OV0_P1_H_ACCUM_INIT,val_OV0_PRESHIFT_P1_TO;
- uint32_t val_OV0_P23_H_ACCUM_INIT,val_OV0_PRESHIFT_P23_TO;
- uint32_t val_OV0_P1_V_ACCUM_INIT,val_OV0_P23_V_ACCUM_INIT;
- /* 2.5 puts the kernal 50% of the way between the source pixel that is off screen */
- /* and the first on-screen source pixel. "(float)valOV0_P?_H_INC / (1<<0xc)" is */
- /* the distance (in source pixel coordinates) to the center of the first */
- /* destination pixel. Need to add additional pixels depending on how many pixels */
- /* are fetched at a time and how many pixels in a set are masked. */
- /* P23 values are always fetched in groups of two or four. If the start */
- /* pixel does not fall on the boundary, then we need to shift preshift for */
- /* some additional pixels */
-
- {
- double ExtraHalfPixel;
- double tempAdditionalShift;
- double tempP1HStartPoint;
- double tempP23HStartPoint;
- double tempP1Init;
- double tempP23Init;
-
- if (besr.horz_pick_nearest) ExtraHalfPixel = 0.5;
- else ExtraHalfPixel = 0.0;
- tempAdditionalShift = val_OV0_P1_X_START % P1GroupSize + ExtraHalfPixel;
- tempP1HStartPoint = tempAdditionalShift + 2.5 + ((float)val_OV0_P1_H_INC / (1<<0xd));
- tempP1Init = (double)((int)(tempP1HStartPoint * (1<<0x5) + 0.5)) / (1<<0x5);
-
- /* P23 values are always fetched in pairs. If the start pixel is odd, then we */
- /* need to shift an additional pixel */
- /* Note that if the pitch is a multiple of two, and if we store fields using */
- /* the traditional planer format where the V plane and the U plane share the */
- /* same pitch, then OverlayRegFields->val_OV0_P2_X_START % P23Group */
- /* OverlayRegFields->val_OV0_P3_X_START % P23GroupSize. Either way */
- /* it is a requirement that the U and V start on the same polarity byte */
- /* (even or odd). */
- tempAdditionalShift = val_OV0_P2_X_START % P23GroupSize + ExtraHalfPixel;
- tempP23HStartPoint = tempAdditionalShift + 2.5 + ((float)val_OV0_P23_H_INC / (1<<0xd));
- tempP23Init = (double)((int)(tempP23HStartPoint * (1<<0x5) + 0.5)) / (1 << 0x5);
- val_OV0_P1_H_ACCUM_INIT = (int)((tempP1Init - (int)tempP1Init) * (1<<0x5));
- val_OV0_PRESHIFT_P1_TO = (int)tempP1Init;
- val_OV0_P23_H_ACCUM_INIT = (int)((tempP23Init - (int)tempP23Init) * (1<<0x5));
- val_OV0_PRESHIFT_P23_TO = (int)tempP23Init;
- }
-
- /* ************************************************************** */
- /* ** Calculate values for initializing the vertical accumulators */
- /* ************************************************************** */
-
- {
- double ExtraHalfLine;
- double ExtraFullLine;
- double tempP1VStartPoint;
- double tempP23VStartPoint;
-
- if (besr.vert_pick_nearest) ExtraHalfLine = 0.5;
- else ExtraHalfLine = 0.0;
-
- if (val_OV0_P1_H_STEP_BY==0)ExtraFullLine = 1.0;
- else ExtraFullLine = 0.0;
-
- tempP1VStartPoint = 1.5 + ExtraFullLine + ExtraHalfLine + ((float)CRT_V_INC / (1<<0xd));
- if (tempP1VStartPoint>2.5 + 2*ExtraFullLine)
- {
- tempP1VStartPoint = 2.5 + 2*ExtraFullLine;
- }
- val_OV0_P1_V_ACCUM_INIT = (int)(tempP1VStartPoint * (1<<0x5) + 0.5);
-
- if (val_OV0_P23_H_STEP_BY==0)ExtraFullLine = 1.0;
- else ExtraFullLine = 0.0;
-
- switch (besr.surf_id)
- {
- case 10:
- case 13:
- case 14: tempP23VStartPoint = 1.5 + ExtraFullLine + ExtraHalfLine +
- ((float)CRT_V_INC / (1<<0xe));
- break;
- case 9: tempP23VStartPoint = 1.5 + ExtraFullLine + ExtraHalfLine +
- ((float)CRT_V_INC / (1<<0xf));
- break;
- case 3:
- case 4:
- case 6:
- case 11:
- case 12: tempP23VStartPoint = 0;
- break;
- default: tempP23VStartPoint = 0xFFFF;/* insert debug statement here */
- break;
- }
-
- if (tempP23VStartPoint>2.5 + 2*ExtraFullLine)
- {
- tempP23VStartPoint = 2.5 + 2*ExtraFullLine;
- }
-
- val_OV0_P23_V_ACCUM_INIT = (int)(tempP23VStartPoint * (1<<0x5) + 0.5);
- }
- besr.p1_h_accum_init = ((val_OV0_P1_H_ACCUM_INIT&0x1f)<<15) |((val_OV0_PRESHIFT_P1_TO&0xf)<<28);
- besr.p1_v_accum_init = (val_OV0_P1_MAX_LN_IN_PER_LN_OUT&0x3) |((val_OV0_P1_V_ACCUM_INIT&0x7ff)<<15);
- besr.p23_h_accum_init= ((val_OV0_P23_H_ACCUM_INIT&0x1f)<<15) |((val_OV0_PRESHIFT_P23_TO&0xf)<<28);
- besr.p23_v_accum_init= (val_OV0_P23_MAX_LN_IN_PER_LN_OUT&0x3)|((val_OV0_P23_V_ACCUM_INIT&0x3ff)<<15);
-}
-
-typedef struct RangeAndCoefSet {
- double Range;
- signed char CoefSet[5][4];
-} RANGEANDCOEFSET;
-
-/* Filter Setup Routine */
-static void FilterSetup ( uint32_t val_OV0_P1_H_INC )
-{
- static RANGEANDCOEFSET ArrayOfSets[] = {
- {0.25, {{ 7, 16, 9, 0}, { 7, 16, 9, 0}, { 5, 15, 11, 1}, { 4, 15, 12, 1}, { 3, 13, 13, 3}, }},
- {0.26, {{ 7, 16, 9, 0}, { 7, 16, 9, 0}, { 5, 15, 11, 1}, { 4, 15, 12, 1}, { 3, 13, 13, 3}, }},
- {0.27, {{ 7, 16, 9, 0}, { 7, 16, 9, 0}, { 5, 15, 11, 1}, { 4, 15, 12, 1}, { 3, 13, 13, 3}, }},
- {0.28, {{ 7, 16, 9, 0}, { 7, 16, 9, 0}, { 5, 15, 11, 1}, { 4, 15, 12, 1}, { 3, 13, 13, 3}, }},
- {0.29, {{ 7, 16, 9, 0}, { 7, 16, 9, 0}, { 5, 15, 11, 1}, { 4, 15, 12, 1}, { 3, 13, 13, 3}, }},
- {0.30, {{ 7, 16, 9, 0}, { 7, 16, 9, 0}, { 5, 15, 11, 1}, { 4, 15, 12, 1}, { 3, 13, 13, 3}, }},
- {0.31, {{ 7, 16, 9, 0}, { 7, 16, 9, 0}, { 5, 15, 11, 1}, { 4, 15, 12, 1}, { 3, 13, 13, 3}, }},
- {0.32, {{ 7, 16, 9, 0}, { 7, 16, 9, 0}, { 5, 15, 11, 1}, { 4, 15, 12, 1}, { 3, 13, 13, 3}, }},
- {0.33, {{ 7, 16, 9, 0}, { 7, 16, 9, 0}, { 5, 15, 11, 1}, { 4, 15, 12, 1}, { 3, 13, 13, 3}, }},
- {0.34, {{ 7, 16, 9, 0}, { 7, 16, 9, 0}, { 5, 15, 11, 1}, { 4, 15, 12, 1}, { 3, 13, 13, 3}, }},
- {0.35, {{ 7, 16, 9, 0}, { 7, 16, 9, 0}, { 5, 15, 11, 1}, { 4, 15, 12, 1}, { 3, 13, 13, 3}, }},
- {0.36, {{ 7, 16, 9, 0}, { 7, 16, 9, 0}, { 5, 15, 11, 1}, { 4, 15, 12, 1}, { 3, 13, 13, 3}, }},
- {0.37, {{ 7, 16, 9, 0}, { 7, 16, 9, 0}, { 5, 15, 11, 1}, { 4, 15, 12, 1}, { 3, 13, 13, 3}, }},
- {0.38, {{ 7, 16, 9, 0}, { 7, 16, 9, 0}, { 5, 15, 11, 1}, { 4, 15, 12, 1}, { 3, 13, 13, 3}, }},
- {0.39, {{ 7, 16, 9, 0}, { 7, 16, 9, 0}, { 5, 15, 11, 1}, { 4, 15, 12, 1}, { 3, 13, 13, 3}, }},
- {0.40, {{ 7, 16, 9, 0}, { 7, 16, 9, 0}, { 5, 15, 11, 1}, { 4, 15, 12, 1}, { 3, 13, 13, 3}, }},
- {0.41, {{ 7, 16, 9, 0}, { 7, 16, 9, 0}, { 5, 15, 11, 1}, { 4, 15, 12, 1}, { 3, 13, 13, 3}, }},
- {0.42, {{ 7, 16, 9, 0}, { 7, 16, 9, 0}, { 5, 15, 11, 1}, { 4, 15, 12, 1}, { 3, 13, 13, 3}, }},
- {0.43, {{ 7, 16, 9, 0}, { 7, 16, 9, 0}, { 5, 15, 11, 1}, { 4, 15, 12, 1}, { 3, 13, 13, 3}, }},
- {0.44, {{ 7, 16, 9, 0}, { 7, 16, 9, 0}, { 5, 15, 11, 1}, { 4, 15, 12, 1}, { 3, 13, 13, 3}, }},
- {0.45, {{ 7, 16, 9, 0}, { 7, 16, 9, 0}, { 5, 15, 11, 1}, { 4, 15, 12, 1}, { 3, 13, 13, 3}, }},
- {0.46, {{ 7, 16, 9, 0}, { 7, 16, 9, 0}, { 5, 15, 11, 1}, { 4, 15, 12, 1}, { 3, 13, 13, 3}, }},
- {0.47, {{ 7, 16, 9, 0}, { 7, 16, 9, 0}, { 5, 15, 11, 1}, { 4, 15, 12, 1}, { 3, 13, 13, 3}, }},
- {0.48, {{ 7, 16, 9, 0}, { 7, 16, 9, 0}, { 5, 15, 11, 1}, { 4, 15, 12, 1}, { 3, 13, 13, 3}, }},
- {0.49, {{ 7, 16, 9, 0}, { 7, 16, 9, 0}, { 5, 15, 11, 1}, { 4, 15, 12, 1}, { 3, 13, 13, 3}, }},
- {0.50, {{ 7, 16, 9, 0}, { 7, 16, 9, 0}, { 5, 15, 11, 1}, { 4, 15, 12, 1}, { 3, 13, 13, 3}, }},
- {0.51, {{ 7, 17, 8, 0}, { 6, 17, 9, 0}, { 5, 15, 11, 1}, { 4, 15, 12, 1}, { 2, 14, 14, 2}, }},
- {0.52, {{ 7, 17, 8, 0}, { 6, 17, 9, 0}, { 5, 16, 11, 0}, { 3, 15, 13, 1}, { 2, 14, 14, 2}, }},
- {0.53, {{ 7, 17, 8, 0}, { 6, 17, 9, 0}, { 5, 16, 11, 0}, { 3, 15, 13, 1}, { 2, 14, 14, 2}, }},
- {0.54, {{ 7, 17, 8, 0}, { 6, 17, 9, 0}, { 4, 17, 11, 0}, { 3, 15, 13, 1}, { 2, 14, 14, 2}, }},
- {0.55, {{ 7, 18, 7, 0}, { 6, 17, 9, 0}, { 4, 17, 11, 0}, { 3, 15, 13, 1}, { 1, 15, 15, 1}, }},
- {0.56, {{ 7, 18, 7, 0}, { 5, 18, 9, 0}, { 4, 17, 11, 0}, { 2, 17, 13, 0}, { 1, 15, 15, 1}, }},
- {0.57, {{ 7, 18, 7, 0}, { 5, 18, 9, 0}, { 4, 17, 11, 0}, { 2, 17, 13, 0}, { 1, 15, 15, 1}, }},
- {0.58, {{ 7, 18, 7, 0}, { 5, 18, 9, 0}, { 4, 17, 11, 0}, { 2, 17, 13, 0}, { 1, 15, 15, 1}, }},
- {0.59, {{ 7, 18, 7, 0}, { 5, 18, 9, 0}, { 4, 17, 11, 0}, { 2, 17, 13, 0}, { 1, 15, 15, 1}, }},
- {0.60, {{ 7, 18, 8, -1}, { 6, 17, 10, -1}, { 4, 17, 11, 0}, { 2, 17, 13, 0}, { 1, 15, 15, 1}, }},
- {0.61, {{ 7, 18, 8, -1}, { 6, 17, 10, -1}, { 4, 17, 11, 0}, { 2, 17, 13, 0}, { 1, 15, 15, 1}, }},
- {0.62, {{ 7, 18, 8, -1}, { 6, 17, 10, -1}, { 4, 17, 11, 0}, { 2, 17, 13, 0}, { 1, 15, 15, 1}, }},
- {0.63, {{ 7, 18, 8, -1}, { 6, 17, 10, -1}, { 4, 17, 11, 0}, { 2, 17, 13, 0}, { 1, 15, 15, 1}, }},
- {0.64, {{ 7, 18, 8, -1}, { 6, 17, 10, -1}, { 4, 17, 12, -1}, { 2, 17, 13, 0}, { 1, 15, 15, 1}, }},
- {0.65, {{ 7, 18, 8, -1}, { 6, 17, 10, -1}, { 4, 17, 12, -1}, { 2, 17, 13, 0}, { 0, 16, 16, 0}, }},
- {0.66, {{ 7, 18, 8, -1}, { 6, 18, 10, -2}, { 4, 17, 12, -1}, { 2, 17, 13, 0}, { 0, 16, 16, 0}, }},
- {0.67, {{ 7, 20, 7, -2}, { 5, 19, 10, -2}, { 3, 18, 12, -1}, { 2, 17, 13, 0}, { 0, 16, 16, 0}, }},
- {0.68, {{ 7, 20, 7, -2}, { 5, 19, 10, -2}, { 3, 19, 12, -2}, { 1, 18, 14, -1}, { 0, 16, 16, 0}, }},
- {0.69, {{ 7, 20, 7, -2}, { 5, 19, 10, -2}, { 3, 19, 12, -2}, { 1, 18, 14, -1}, { 0, 16, 16, 0}, }},
- {0.70, {{ 7, 20, 7, -2}, { 5, 20, 9, -2}, { 3, 19, 12, -2}, { 1, 18, 14, -1}, { 0, 16, 16, 0}, }},
- {0.71, {{ 7, 20, 7, -2}, { 5, 20, 9, -2}, { 3, 19, 12, -2}, { 1, 18, 14, -1}, { 0, 16, 16, 0}, }},
- {0.72, {{ 7, 20, 7, -2}, { 5, 20, 9, -2}, { 2, 20, 12, -2}, { 0, 19, 15, -2}, {-1, 17, 17, -1}, }},
- {0.73, {{ 7, 20, 7, -2}, { 4, 21, 9, -2}, { 2, 20, 12, -2}, { 0, 19, 15, -2}, {-1, 17, 17, -1}, }},
- {0.74, {{ 6, 22, 6, -2}, { 4, 21, 9, -2}, { 2, 20, 12, -2}, { 0, 19, 15, -2}, {-1, 17, 17, -1}, }},
- {0.75, {{ 6, 22, 6, -2}, { 4, 21, 9, -2}, { 1, 21, 12, -2}, { 0, 19, 15, -2}, {-1, 17, 17, -1}, }},
- {0.76, {{ 6, 22, 6, -2}, { 4, 21, 9, -2}, { 1, 21, 12, -2}, { 0, 19, 15, -2}, {-1, 17, 17, -1}, }},
- {0.77, {{ 6, 22, 6, -2}, { 3, 22, 9, -2}, { 1, 22, 12, -3}, { 0, 19, 15, -2}, {-2, 18, 18, -2}, }},
- {0.78, {{ 6, 21, 6, -1}, { 3, 22, 9, -2}, { 1, 22, 12, -3}, { 0, 19, 15, -2}, {-2, 18, 18, -2}, }},
- {0.79, {{ 5, 23, 5, -1}, { 3, 22, 9, -2}, { 0, 23, 12, -3}, {-1, 21, 15, -3}, {-2, 18, 18, -2}, }},
- {0.80, {{ 5, 23, 5, -1}, { 3, 23, 8, -2}, { 0, 23, 12, -3}, {-1, 21, 15, -3}, {-2, 18, 18, -2}, }},
- {0.81, {{ 5, 23, 5, -1}, { 2, 24, 8, -2}, { 0, 23, 12, -3}, {-1, 21, 15, -3}, {-2, 18, 18, -2}, }},
- {0.82, {{ 5, 23, 5, -1}, { 2, 24, 8, -2}, { 0, 23, 12, -3}, {-1, 21, 15, -3}, {-3, 19, 19, -3}, }},
- {0.83, {{ 5, 23, 5, -1}, { 2, 24, 8, -2}, { 0, 23, 11, -2}, {-2, 22, 15, -3}, {-3, 19, 19, -3}, }},
- {0.84, {{ 4, 25, 4, -1}, { 1, 25, 8, -2}, { 0, 23, 11, -2}, {-2, 22, 15, -3}, {-3, 19, 19, -3}, }},
- {0.85, {{ 4, 25, 4, -1}, { 1, 25, 8, -2}, { 0, 23, 11, -2}, {-2, 22, 15, -3}, {-3, 19, 19, -3}, }},
- {0.86, {{ 4, 24, 4, 0}, { 1, 25, 7, -1}, {-1, 24, 11, -2}, {-2, 22, 15, -3}, {-3, 19, 19, -3}, }},
- {0.87, {{ 4, 24, 4, 0}, { 1, 25, 7, -1}, {-1, 24, 11, -2}, {-2, 22, 15, -3}, {-3, 19, 19, -3}, }},
- {0.88, {{ 3, 26, 3, 0}, { 0, 26, 7, -1}, {-1, 24, 11, -2}, {-3, 23, 15, -3}, {-3, 19, 19, -3}, }},
- {0.89, {{ 3, 26, 3, 0}, { 0, 26, 7, -1}, {-1, 24, 11, -2}, {-3, 23, 15, -3}, {-3, 19, 19, -3}, }},
- {0.90, {{ 3, 26, 3, 0}, { 0, 26, 7, -1}, {-2, 25, 11, -2}, {-3, 23, 15, -3}, {-3, 19, 19, -3}, }},
- {0.91, {{ 3, 26, 3, 0}, { 0, 27, 6, -1}, {-2, 25, 11, -2}, {-3, 23, 15, -3}, {-3, 19, 19, -3}, }},
- {0.92, {{ 2, 28, 2, 0}, { 0, 27, 6, -1}, {-2, 25, 11, -2}, {-3, 23, 15, -3}, {-3, 19, 19, -3}, }},
- {0.93, {{ 2, 28, 2, 0}, { 0, 26, 6, 0}, {-2, 25, 10, -1}, {-3, 23, 15, -3}, {-3, 19, 19, -3}, }},
- {0.94, {{ 2, 28, 2, 0}, { 0, 26, 6, 0}, {-2, 25, 10, -1}, {-3, 23, 15, -3}, {-3, 19, 19, -3}, }},
- {0.95, {{ 1, 30, 1, 0}, {-1, 28, 5, 0}, {-3, 26, 10, -1}, {-3, 23, 14, -2}, {-3, 19, 19, -3}, }},
- {0.96, {{ 1, 30, 1, 0}, {-1, 28, 5, 0}, {-3, 26, 10, -1}, {-3, 23, 14, -2}, {-3, 19, 19, -3}, }},
- {0.97, {{ 1, 30, 1, 0}, {-1, 28, 5, 0}, {-3, 26, 10, -1}, {-3, 23, 14, -2}, {-3, 19, 19, -3}, }},
- {0.98, {{ 1, 30, 1, 0}, {-2, 29, 5, 0}, {-3, 27, 9, -1}, {-3, 23, 14, -2}, {-3, 19, 19, -3}, }},
- {0.99, {{ 0, 32, 0, 0}, {-2, 29, 5, 0}, {-3, 27, 9, -1}, {-4, 24, 14, -2}, {-3, 19, 19, -3}, }},
- {1.00, {{ 0, 32, 0, 0}, {-2, 29, 5, 0}, {-3, 27, 9, -1}, {-4, 24, 14, -2}, {-3, 19, 19, -3}, }}
- };
-
- double DSR;
-
- unsigned ArrayElement;
-
- DSR = (double)(1<<0xc)/val_OV0_P1_H_INC;
- if (DSR<.25) DSR=.25;
- if (DSR>1) DSR=1;
-
- ArrayElement = (int)((DSR-0.25) * 100);
- besr.four_tap_coeff[0] = (ArrayOfSets[ArrayElement].CoefSet[0][0] & 0xf) |
- ((ArrayOfSets[ArrayElement].CoefSet[0][1] & 0x7f)<<8) |
- ((ArrayOfSets[ArrayElement].CoefSet[0][2] & 0x7f)<<16) |
- ((ArrayOfSets[ArrayElement].CoefSet[0][3] & 0xf)<<24);
- besr.four_tap_coeff[1] = (ArrayOfSets[ArrayElement].CoefSet[1][0] & 0xf) |
- ((ArrayOfSets[ArrayElement].CoefSet[1][1] & 0x7f)<<8) |
- ((ArrayOfSets[ArrayElement].CoefSet[1][2] & 0x7f)<<16) |
- ((ArrayOfSets[ArrayElement].CoefSet[1][3] & 0xf)<<24);
- besr.four_tap_coeff[2] = (ArrayOfSets[ArrayElement].CoefSet[2][0] & 0xf) |
- ((ArrayOfSets[ArrayElement].CoefSet[2][1] & 0x7f)<<8) |
- ((ArrayOfSets[ArrayElement].CoefSet[2][2] & 0x7f)<<16) |
- ((ArrayOfSets[ArrayElement].CoefSet[2][3] & 0xf)<<24);
- besr.four_tap_coeff[3] = (ArrayOfSets[ArrayElement].CoefSet[3][0] & 0xf) |
- ((ArrayOfSets[ArrayElement].CoefSet[3][1] & 0x7f)<<8) |
- ((ArrayOfSets[ArrayElement].CoefSet[3][2] & 0x7f)<<16) |
- ((ArrayOfSets[ArrayElement].CoefSet[3][3] & 0xf)<<24);
- besr.four_tap_coeff[4] = (ArrayOfSets[ArrayElement].CoefSet[4][0] & 0xf) |
- ((ArrayOfSets[ArrayElement].CoefSet[4][1] & 0x7f)<<8) |
- ((ArrayOfSets[ArrayElement].CoefSet[4][2] & 0x7f)<<16) |
- ((ArrayOfSets[ArrayElement].CoefSet[4][3] & 0xf)<<24);
-/*
- For more details, refer to Microsoft's draft of PC99.
-*/
-}
-
-/* The minimal value of horizontal scale ratio when hard coded coefficients
- are suitable for the best quality. */
-/* FIXME: Should it be 0.9 for Rage128 ??? */
-const double MinHScaleHard=0.75;
-
-static int radeon_vid_init_video( vidix_playback_t *config )
-{
- double V_scale_ratio;
- uint32_t i,src_w,src_h,dest_w,dest_h,pitch,left,leftUV,top,h_inc;
- uint32_t val_OV0_P1_H_INC,val_OV0_P1_H_STEP_BY,val_OV0_P23_H_INC,val_OV0_P23_H_STEP_BY;
- uint32_t val_OV0_P1_X_START,val_OV0_P2_X_START;
- uint32_t val_OV0_P1_MAX_LN_IN_PER_LN_OUT,val_OV0_P23_MAX_LN_IN_PER_LN_OUT;
- uint32_t CRT_V_INC;
- uint32_t BytesPerOctWord,LogMemWordsInBytes,MemWordsInBytes,LogTileWidthInMemWords;
- uint32_t TileWidthInMemWords,TileWidthInBytes,LogTileHeight,TileHeight;
- uint32_t PageSizeInBytes,OV0LB_Rows;
- uint32_t SourceWidthInMemWords,SourceUVWidthInMemWords;
- uint32_t SourceWidthInPixels,SourceUVWidthInPixels;
- uint32_t RightPixel,RightUVPixel,LeftPixel,LeftUVPixel;
- int is_400,is_410,is_420,best_pitch,mpitch;
- int horz_repl_factor,interlace_factor;
- int BytesPerPixel,BytesPerUVPixel,HorzUVSubSample,VertUVSubSample;
- int DisallowFourTapVertFiltering,DisallowFourTapUVVertFiltering;
-
- radeon_vid_stop_video();
- left = config->src.x << 16;
- top = config->src.y << 16;
- src_h = config->src.h;
- src_w = config->src.w;
- is_400 = is_410 = is_420 = 0;
- if(config->fourcc == IMGFMT_YV12 ||
- config->fourcc == IMGFMT_I420 ||
- config->fourcc == IMGFMT_IYUV) is_420 = 1;
- if(config->fourcc == IMGFMT_YVU9 ||
- config->fourcc == IMGFMT_IF09) is_410 = 1;
- if(config->fourcc == IMGFMT_Y800) is_400 = 1;
- best_pitch = radeon_query_pitch(config->fourcc,&config->src.pitch);
- mpitch = best_pitch-1;
- BytesPerOctWord = 16;
- LogMemWordsInBytes = 4;
- MemWordsInBytes = 1<<LogMemWordsInBytes;
- LogTileWidthInMemWords = 2;
- TileWidthInMemWords = 1<<LogTileWidthInMemWords;
- TileWidthInBytes = 1<<(LogTileWidthInMemWords+LogMemWordsInBytes);
- LogTileHeight = 4;
- TileHeight = 1<<LogTileHeight;
- PageSizeInBytes = 64*MemWordsInBytes;
- OV0LB_Rows = 96;
- h_inc = 1;
- switch(config->fourcc)
- {
- /* 4:0:0*/
- case IMGFMT_Y800:
- /* 4:1:0*/
- case IMGFMT_YVU9:
- case IMGFMT_IF09:
- /* 4:2:0 */
- case IMGFMT_IYUV:
- case IMGFMT_YV12:
- case IMGFMT_I420: pitch = (src_w + mpitch) & ~mpitch;
- config->dest.pitch.y =
- config->dest.pitch.u =
- config->dest.pitch.v = best_pitch;
- break;
- /* RGB 4:4:4:4 */
- case IMGFMT_RGB32:
- case IMGFMT_BGR32: pitch = (src_w*4 + mpitch) & ~mpitch;
- config->dest.pitch.y =
- config->dest.pitch.u =
- config->dest.pitch.v = best_pitch;
- break;
- /* 4:2:2 */
-
- default: /* RGB15, RGB16, YVYU, UYVY, YUY2 */
- pitch = ((src_w*2) + mpitch) & ~mpitch;
- config->dest.pitch.y =
- config->dest.pitch.u =
- config->dest.pitch.v = best_pitch;
- break;
- }
- besr.load_prg_start=0;
- besr.swap_uv=0;
- switch(config->fourcc)
- {
- case IMGFMT_RGB15:
- besr.swap_uv=1;
- case IMGFMT_BGR15: besr.surf_id = SCALER_SOURCE_15BPP>>8;
- besr.load_prg_start = 1;
- break;
- case IMGFMT_RGB16:
- besr.swap_uv=1;
- case IMGFMT_BGR16: besr.surf_id = SCALER_SOURCE_16BPP>>8;
- besr.load_prg_start = 1;
- break;
- case IMGFMT_RGB32:
- besr.swap_uv=1;
- case IMGFMT_BGR32: besr.surf_id = SCALER_SOURCE_32BPP>>8;
- besr.load_prg_start = 1;
- break;
- /* 4:1:0*/
- case IMGFMT_IF09:
- case IMGFMT_YVU9: besr.surf_id = SCALER_SOURCE_YUV9>>8;
- break;
- /* 4:0:0*/
- case IMGFMT_Y800:
- /* 4:2:0 */
- case IMGFMT_IYUV:
- case IMGFMT_I420:
- case IMGFMT_YV12: besr.surf_id = SCALER_SOURCE_YUV12>>8;
- break;
- /* 4:2:2 */
- case IMGFMT_YVYU:
- case IMGFMT_UYVY: besr.surf_id = SCALER_SOURCE_YVYU422>>8;
- break;
- case IMGFMT_YUY2:
- default: besr.surf_id = SCALER_SOURCE_VYUY422>>8;
- break;
- }
- switch (besr.surf_id)
- {
- case 3:
- case 4:
- case 11:
- case 12: BytesPerPixel = 2;
- break;
- case 6: BytesPerPixel = 4;
- break;
- case 9:
- case 10:
- case 13:
- case 14: BytesPerPixel = 1;
- break;
- default: BytesPerPixel = 0;/*insert a debug statement here. */
- break;
- }
- switch (besr.surf_id)
- {
- case 3:
- case 4: BytesPerUVPixel = 0;
- break;/* In RGB modes, the BytesPerUVPixel is don't care */
- case 11:
- case 12: BytesPerUVPixel = 2;
- break;
- case 6: BytesPerUVPixel = 0;
- break; /* In RGB modes, the BytesPerUVPixel is don't care */
- case 9:
- case 10: BytesPerUVPixel = 1;
- break;
- case 13:
- case 14: BytesPerUVPixel = 2;
- break;
- default: BytesPerUVPixel = 0;/* insert a debug statement here. */
- break;
-
- }
- switch (besr.surf_id)
- {
- case 3:
- case 4:
- case 6: HorzUVSubSample = 1;
- break;
- case 9: HorzUVSubSample = 4;
- break;
- case 10:
- case 11:
- case 12:
- case 13:
- case 14: HorzUVSubSample = 2;
- break;
- default: HorzUVSubSample = 0;/* insert debug statement here. */
- break;
- }
- switch (besr.surf_id)
- {
- case 3:
- case 4:
- case 6:
- case 11:
- case 12: VertUVSubSample = 1;
- break;
- case 9: VertUVSubSample = 4;
- break;
- case 10:
- case 13:
- case 14: VertUVSubSample = 2;
- break;
- default: VertUVSubSample = 0;/* insert debug statment here. */
- break;
- }
- DisallowFourTapVertFiltering = 0; /* Allow it by default */
- DisallowFourTapUVVertFiltering = 0; /* Allow it by default */
- LeftPixel = config->src.x;
- RightPixel = config->src.w-1;
- if(floor(config->src.x/HorzUVSubSample)<0) LeftUVPixel = 0;
- else LeftUVPixel = (int)floor(config->src.x/HorzUVSubSample);
- if(ceil((config->src.x+config->src.w)/HorzUVSubSample) > config->src.w/HorzUVSubSample)
- RightUVPixel = config->src.w/HorzUVSubSample - 1;
- else RightUVPixel = (int)ceil((config->src.x+config->src.w)/HorzUVSubSample) - 1;
- /* Top, Bottom and Right Crops can be out of range. The driver will program the hardware
- // to create a black border at the top and bottom. This is useful for DVD letterboxing. */
- SourceWidthInPixels = (int)(config->src.w + 1);
- SourceUVWidthInPixels = (int)(RightUVPixel - LeftUVPixel + 1);
-
- SourceWidthInMemWords = (int)(ceil(RightPixel*BytesPerPixel / MemWordsInBytes) -
- floor(LeftPixel*BytesPerPixel / MemWordsInBytes) + 1);
- /* SourceUVWidthInMemWords means Source_U_or_V_or_UV_WidthInMemWords depending on whether the UV is packed together of not. */
- SourceUVWidthInMemWords = (int)(ceil(RightUVPixel*BytesPerUVPixel /
- MemWordsInBytes) - floor(LeftUVPixel*BytesPerUVPixel /
- MemWordsInBytes) + 1);
-
- switch (besr.surf_id)
- {
- case 9:
- case 10: if ((ceil(SourceWidthInMemWords/2)-1) * 2 > OV0LB_Rows-1)
- {
- RADEON_ASSERT("ceil(SourceWidthInMemWords/2)-1) * 2 > OV0LB_Rows-1\n");
- }
- else if ((SourceWidthInMemWords-1) * 2 > OV0LB_Rows-1)
- {
- DisallowFourTapVertFiltering = 1;
- }
-
- if ((ceil(SourceUVWidthInMemWords/2)-1) * 4 + 1 > OV0LB_Rows-1)
- {
- /*CYCACC_ASSERT(0, "Image U plane width spans more octwords than supported by hardware.") */
- }
- else if ((SourceUVWidthInMemWords-1) * 4 + 1 > OV0LB_Rows-1)
- {
- DisallowFourTapUVVertFiltering = 1;
- }
-
- if ((ceil(SourceUVWidthInMemWords/2)-1) * 4 + 3 > OV0LB_Rows-1)
- {
- /*CYCACC_ASSERT(0, "Image V plane width spans more octwords than supported by hardware.") */
- }
- else if ((SourceUVWidthInMemWords-1) * 4 + 3 > OV0LB_Rows-1)
- {
- DisallowFourTapUVVertFiltering = 1;
- }
- break;
- case 13:
- case 14: if ((ceil(SourceWidthInMemWords/2)-1) * 2 > OV0LB_Rows-1)
- {
- RADEON_ASSERT("ceil(SourceWidthInMemWords/2)-1) * 2 > OV0LB_Rows-1\n");
- }
- else if ((SourceWidthInMemWords-1) * 2 > OV0LB_Rows-1)
- {
- DisallowFourTapVertFiltering = 1;
- }
-
- if ((ceil(SourceUVWidthInMemWords/2)-1) * 2 + 1 > OV0LB_Rows-1)
- {
- /*CYCACC_ASSERT(0, "Image UV plane width spans more octwords than supported by hardware.") */
- }
- else if ((SourceUVWidthInMemWords-1) * 2 + 1 > OV0LB_Rows-1)
- {
- DisallowFourTapUVVertFiltering = 1;
- }
- break;
- case 3:
- case 4:
- case 6:
- case 11:
- case 12: if ((ceil(SourceWidthInMemWords/2)-1) > OV0LB_Rows-1)
- {
- RADEON_ASSERT("(ceil(SourceWidthInMemWords/2)-1) > OV0LB_Rows-1\n")
- }
- else if ((SourceWidthInMemWords-1) > OV0LB_Rows-1)
- {
- DisallowFourTapVertFiltering = 1;
- }
- break;
- default: /* insert debug statement here. */
- break;
- }
- dest_w = config->dest.w;
- dest_h = config->dest.h;
- if(radeon_is_dbl_scan()) dest_h *= 2;
- besr.dest_bpp = radeon_vid_get_dbpp();
- besr.fourcc = config->fourcc;
- if(radeon_is_interlace()) interlace_factor = 2;
- else interlace_factor = 1;
- /* TODO: must be checked in doublescan mode!!! */
- if((besr.chip_flags&R_INTEGRATED)==R_INTEGRATED)
- {
- /* Force the overlay clock on for integrated chips */
- OUTPLL(VCLK_ECP_CNTL, (INPLL(VCLK_ECP_CNTL) | (1<<18)));
- }
- horz_repl_factor = 1 << (uint32_t)((INPLL(VCLK_ECP_CNTL) & 0x300) >> 8);
- H_scale_ratio = (double)ceil(((double)dest_w+1)/horz_repl_factor)/src_w;
- V_scale_ratio = (double)(dest_h+1)/src_h;
- if(H_scale_ratio < 0.5 && V_scale_ratio < 0.5)
- {
- val_OV0_P1_MAX_LN_IN_PER_LN_OUT = 3;
- val_OV0_P23_MAX_LN_IN_PER_LN_OUT = 2;
- }
- else
- if(H_scale_ratio < 1 && V_scale_ratio < 1)
- {
- val_OV0_P1_MAX_LN_IN_PER_LN_OUT = 2;
- val_OV0_P23_MAX_LN_IN_PER_LN_OUT = 1;
- }
- else
- {
- val_OV0_P1_MAX_LN_IN_PER_LN_OUT = 1;
- val_OV0_P23_MAX_LN_IN_PER_LN_OUT = 1;
- }
- /* N.B.: Indeed it has 6.12 format but shifted on 8 to the left!!! */
- besr.v_inc = (uint16_t)((1./V_scale_ratio)*(1<<12)*interlace_factor+0.5);
- CRT_V_INC = besr.v_inc/interlace_factor;
- besr.v_inc <<= 8;
- {
- int ThereIsTwoTapVerticalFiltering,DoNotUseMostRecentlyFetchedLine;
- int P1GroupSize;
- int P23GroupSize;
- int P1StepSize;
- int P23StepSize;
-
- Calc_H_INC_STEP_BY(
- besr.surf_id,
- H_scale_ratio,
- DisallowFourTapVertFiltering,
- DisallowFourTapUVVertFiltering,
- &val_OV0_P1_H_INC,
- &val_OV0_P1_H_STEP_BY,
- &val_OV0_P23_H_INC,
- &val_OV0_P23_H_STEP_BY,
- &P1GroupSize,
- &P1StepSize,
- &P23StepSize);
-
- if(H_scale_ratio > MinHScaleHard)
- {
- h_inc = (src_w << 12) / dest_w;
- besr.step_by = 0x0101;
- switch (besr.surf_id)
- {
- case 3:
- case 4:
- case 6:
- besr.h_inc = (h_inc)|(h_inc<<16);
- break;
- case 9:
- besr.h_inc = h_inc | ((h_inc >> 2) << 16);
- break;
- default:
- besr.h_inc = h_inc | ((h_inc >> 1) << 16);
- break;
- }
- }
-
- P23GroupSize = 2; /* Current vaue for all modes */
-
- besr.horz_pick_nearest=0;
- DoNotUseMostRecentlyFetchedLine=0;
- ThereIsTwoTapVerticalFiltering = (val_OV0_P1_H_STEP_BY!=0) || (val_OV0_P23_H_STEP_BY!=0);
- if (ThereIsTwoTapVerticalFiltering && DoNotUseMostRecentlyFetchedLine)
- besr.vert_pick_nearest = 1;
- else
- besr.vert_pick_nearest = 0;
-
- ComputeXStartEnd(is_400,LeftPixel,LeftUVPixel,MemWordsInBytes,BytesPerPixel,
- SourceWidthInPixels,P1StepSize,BytesPerUVPixel,
- SourceUVWidthInPixels,P23StepSize,&val_OV0_P1_X_START,&val_OV0_P2_X_START);
-
- if(H_scale_ratio > MinHScaleHard)
- {
- unsigned tmp;
- tmp = (left & 0x0003ffff) + 0x00028000 + (h_inc << 3);
- besr.p1_h_accum_init = ((tmp << 4) & 0x000f8000) |
- ((tmp << 12) & 0xf0000000);
-
- tmp = (top & 0x0000ffff) + 0x00018000;
- besr.p1_v_accum_init = ((tmp << 4) & OV0_P1_V_ACCUM_INIT_MASK)
- |(OV0_P1_MAX_LN_IN_PER_LN_OUT & 1);
- tmp = ((left >> 1) & 0x0001ffff) + 0x00028000 + (h_inc << 2);
- besr.p23_h_accum_init = ((tmp << 4) & 0x000f8000) |
- ((tmp << 12) & 0x70000000);
-
- tmp = ((top >> 1) & 0x0000ffff) + 0x00018000;
- besr.p23_v_accum_init = (is_420||is_410) ?
- ((tmp << 4) & OV0_P23_V_ACCUM_INIT_MASK)
- |(OV0_P23_MAX_LN_IN_PER_LN_OUT & 1) : 0;
- }
- else
- ComputeAccumInit( val_OV0_P1_X_START,val_OV0_P2_X_START,
- val_OV0_P1_H_INC,val_OV0_P23_H_INC,
- val_OV0_P1_H_STEP_BY,val_OV0_P23_H_STEP_BY,
- CRT_V_INC,P1GroupSize,P23GroupSize,
- val_OV0_P1_MAX_LN_IN_PER_LN_OUT,
- val_OV0_P23_MAX_LN_IN_PER_LN_OUT);
- }
-
- /* keep everything in 16.16 */
- besr.base_addr = INREG(DISPLAY_BASE_ADDR);
- config->offsets[0] = 0;
- for(i=1;i<besr.vid_nbufs;i++)
- config->offsets[i] = config->offsets[i-1]+config->frame_size;
- if(is_420 || is_410 || is_400)
- {
- uint32_t d1line,d2line,d3line;
- d1line = top*pitch;
- if(is_420)
- {
- d2line = src_h*pitch+(d1line>>2);
- d3line = d2line+((src_h*pitch)>>2);
- }
- else
- if(is_410)
- {
- d2line = src_h*pitch+(d1line>>4);
- d3line = d2line+((src_h*pitch)>>4);
- }
- else
- {
- d2line = 0;
- d3line = 0;
- }
- d1line += (left >> 16) & ~15;
- if(is_420)
- {
- d2line += (left >> 17) & ~15;
- d3line += (left >> 17) & ~15;
- }
- else /* is_410 */
- {
- d2line += (left >> 18) & ~15;
- d3line += (left >> 18) & ~15;
- }
- config->offset.y = d1line & VIF_BUF0_BASE_ADRS_MASK;
- if(is_400)
- {
- config->offset.v = 0;
- config->offset.u = 0;
- }
- else
- {
- config->offset.v = d2line & VIF_BUF1_BASE_ADRS_MASK;
- config->offset.u = d3line & VIF_BUF2_BASE_ADRS_MASK;
- }
- for(i=0;i<besr.vid_nbufs;i++)
- {
- besr.vid_buf_base_adrs_y[i]=((radeon_overlay_off+config->offsets[i]+config->offset.y)&VIF_BUF0_BASE_ADRS_MASK);
- if(is_400)
- {
- besr.vid_buf_base_adrs_v[i]=0;
- besr.vid_buf_base_adrs_u[i]=0;
- }
- else
- {
- besr.vid_buf_base_adrs_v[i]=((radeon_overlay_off+config->offsets[i]+config->offset.v)&VIF_BUF1_BASE_ADRS_MASK)|VIF_BUF1_PITCH_SEL;
- besr.vid_buf_base_adrs_u[i]=((radeon_overlay_off+config->offsets[i]+config->offset.u)&VIF_BUF2_BASE_ADRS_MASK)|VIF_BUF2_PITCH_SEL;
- }
- }
- config->offset.y = ((besr.vid_buf_base_adrs_y[0])&VIF_BUF0_BASE_ADRS_MASK) - radeon_overlay_off;
- if(is_400)
- {
- config->offset.v = 0;
- config->offset.u = 0;
- }
- else
- {
- config->offset.v = ((besr.vid_buf_base_adrs_v[0])&VIF_BUF1_BASE_ADRS_MASK) - radeon_overlay_off;
- config->offset.u = ((besr.vid_buf_base_adrs_u[0])&VIF_BUF2_BASE_ADRS_MASK) - radeon_overlay_off;
- }
- if(besr.fourcc == IMGFMT_I420 || besr.fourcc == IMGFMT_IYUV)
- {
- uint32_t tmp;
- tmp = config->offset.u;
- config->offset.u = config->offset.v;
- config->offset.v = tmp;
- }
- }
- else
- {
- config->offset.y = config->offset.u = config->offset.v = ((left & ~7) << 1)&VIF_BUF0_BASE_ADRS_MASK;
- for(i=0;i<besr.vid_nbufs;i++)
- {
- besr.vid_buf_base_adrs_y[i] =
- besr.vid_buf_base_adrs_u[i] =
- besr.vid_buf_base_adrs_v[i] = radeon_overlay_off + config->offsets[i] + config->offset.y;
- }
- }
- leftUV = (left >> (is_410?18:17)) & 15;
- left = (left >> 16) & 15;
- besr.y_x_start = (config->dest.x+X_ADJUST) | (config->dest.y << 16);
- besr.y_x_end = (config->dest.x + dest_w+X_ADJUST) | ((config->dest.y + dest_h) << 16);
- ComputeBorders(config,VertUVSubSample);
- besr.vid_buf_pitch0_value = pitch;
- besr.vid_buf_pitch1_value = is_410 ? pitch>>2 : is_420 ? pitch>>1 : pitch;
- /* ********************************************************* */
- /* ** Calculate programmable coefficients as needed */
- /* ********************************************************* */
-
- /* ToDo_Active: When in pick nearest mode, we need to program the filter tap zero */
- /* coefficients to 0, 32, 0, 0. Or use hard coded coefficients. */
- if(H_scale_ratio > MinHScaleHard) besr.filter_cntl |= FILTER_HARDCODED_COEF;
- else
- {
- FilterSetup (val_OV0_P1_H_INC);
- /* ToDo_Active: Must add the smarts into the driver to decide what type of filtering it */
- /* would like to do. For now, we let the test application decide. */
- besr.filter_cntl = FILTER_PROGRAMMABLE_COEF;
- if(DisallowFourTapVertFiltering)
- besr.filter_cntl |= FILTER_HARD_SCALE_VERT_Y;
- if(DisallowFourTapUVVertFiltering)
- besr.filter_cntl |= FILTER_HARD_SCALE_VERT_UV;
- }
- return 0;
-}
-
-static void radeon_compute_framesize(vidix_playback_t *info)
-{
- unsigned pitch,awidth,dbpp;
- pitch = radeon_query_pitch(info->fourcc,&info->src.pitch);
- dbpp = radeon_vid_get_dbpp();
- switch(info->fourcc)
- {
- case IMGFMT_Y800:
- awidth = (info->src.w + (pitch-1)) & ~(pitch-1);
- info->frame_size = awidth*info->src.h;
- break;
- case IMGFMT_YVU9:
- case IMGFMT_IF09:
- awidth = (info->src.w + (pitch-1)) & ~(pitch-1);
- info->frame_size = awidth*(info->src.h+info->src.h/8);
- break;
- case IMGFMT_I420:
- case IMGFMT_YV12:
- case IMGFMT_IYUV:
- awidth = (info->src.w + (pitch-1)) & ~(pitch-1);
- info->frame_size = awidth*(info->src.h+info->src.h/2);
- break;
- case IMGFMT_RGB32:
- case IMGFMT_BGR32:
- awidth = (info->src.w*4 + (pitch-1)) & ~(pitch-1);
- info->frame_size = awidth*info->src.h;
- break;
- /* YUY2 YVYU, RGB15, RGB16 */
- default:
- awidth = (info->src.w*2 + (pitch-1)) & ~(pitch-1);
- info->frame_size = awidth*info->src.h;
- break;
- }
- info->frame_size = (info->frame_size+4095)&~4095;
-}
-
-int VIDIX_NAME(vixConfigPlayback)(vidix_playback_t *info)
-{
- unsigned rgb_size,nfr;
- uint32_t radeon_video_size;
- if(!is_supported_fourcc(info->fourcc,info->src.w)) return ENOSYS;
- if(info->num_frames>VID_PLAY_MAXFRAMES) info->num_frames=VID_PLAY_MAXFRAMES;
- if(info->num_frames==1) besr.double_buff=0;
- else besr.double_buff=1;
- radeon_compute_framesize(info);
-
- rgb_size = radeon_get_xres()*radeon_get_yres()*((radeon_vid_get_dbpp()+7)/8);
- nfr = info->num_frames;
- radeon_video_size = radeon_ram_size;
-#ifdef RADEON_ENABLE_BM
- if(def_cap.flags & FLAG_DMA)
- {
- /* every descriptor describes one 4K page and takes 16 bytes in memory
- Note: probably it's ont good idea to locate them in video memory
- but as initial release it's OK */
- radeon_video_size -= radeon_ram_size * sizeof(bm_list_descriptor) / 4096;
- radeon_dma_desc_base = (void *) pci_info.base0 + radeon_video_size;
- }
-#endif
- for(;nfr>0; nfr--)
- {
- radeon_overlay_off = radeon_video_size - info->frame_size*nfr;
- radeon_overlay_off &= 0xffff0000;
- if(radeon_overlay_off >= (int)rgb_size ) break;
- }
- if(nfr <= 3)
- {
- nfr = info->num_frames;
- for(;nfr>0; nfr--)
- {
- radeon_overlay_off = radeon_video_size - info->frame_size*nfr;
- radeon_overlay_off &= 0xffff0000;
- if(radeon_overlay_off > 0) break;
- }
- }
- if(nfr <= 0) return EINVAL;
- info->num_frames = nfr;
- besr.vid_nbufs = info->num_frames;
- info->dga_addr = (char *)radeon_mem_base + radeon_overlay_off;
- radeon_vid_init_video(info);
- return 0;
-}
-
-int VIDIX_NAME(vixPlaybackOn)( void )
-{
-#ifdef RAGE128
- unsigned dw,dh;
-#endif
- radeon_vid_display_video();
-#ifdef RAGE128
- dh = (besr.y_x_end >> 16) - (besr.y_x_start >> 16);
- dw = (besr.y_x_end & 0xFFFF) - (besr.y_x_start & 0xFFFF);
- if(dw == radeon_get_xres() || dh == radeon_get_yres()) radeon_vid_exclusive();
- else radeon_vid_non_exclusive();
-#endif
- return 0;
-}
-
-int VIDIX_NAME(vixPlaybackOff)( void )
-{
- radeon_vid_stop_video();
- return 0;
-}
-
-int VIDIX_NAME(vixPlaybackFrameSelect)(unsigned frame)
-{
- uint32_t off[6];
- int prev_frame= (frame-1+besr.vid_nbufs) % besr.vid_nbufs;
- /*
- buf3-5 always should point onto second buffer for better
- deinterlacing and TV-in
- */
- if(!besr.double_buff) return 0;
- if(frame > besr.vid_nbufs) frame = besr.vid_nbufs-1;
- if(prev_frame > (int)besr.vid_nbufs) prev_frame = besr.vid_nbufs-1;
- off[0] = besr.vid_buf_base_adrs_y[frame];
- off[1] = besr.vid_buf_base_adrs_v[frame];
- off[2] = besr.vid_buf_base_adrs_u[frame];
- off[3] = besr.vid_buf_base_adrs_y[prev_frame];
- off[4] = besr.vid_buf_base_adrs_v[prev_frame];
- off[5] = besr.vid_buf_base_adrs_u[prev_frame];
- radeon_fifo_wait(8);
- OUTREG(OV0_REG_LOAD_CNTL, REG_LD_CTL_LOCK);
- radeon_engine_idle();
- while(!(INREG(OV0_REG_LOAD_CNTL)&REG_LD_CTL_LOCK_READBACK));
- OUTREG(OV0_VID_BUF0_BASE_ADRS, off[0]);
- OUTREG(OV0_VID_BUF1_BASE_ADRS, off[1]);
- OUTREG(OV0_VID_BUF2_BASE_ADRS, off[2]);
- OUTREG(OV0_VID_BUF3_BASE_ADRS, off[3]);
- OUTREG(OV0_VID_BUF4_BASE_ADRS, off[4]);
- OUTREG(OV0_VID_BUF5_BASE_ADRS, off[5]);
- OUTREG(OV0_REG_LOAD_CNTL, 0);
- if(besr.vid_nbufs == 2) radeon_wait_vsync();
- if(__verbose > VERBOSE_LEVEL) radeon_vid_dump_regs();
- return 0;
-}
-
-vidix_video_eq_t equal =
-{
- VEQ_CAP_BRIGHTNESS | VEQ_CAP_SATURATION
-#ifndef RAGE128
- | VEQ_CAP_CONTRAST | VEQ_CAP_HUE | VEQ_CAP_RGB_INTENSITY
-#endif
- ,
- 0, 0, 0, 0, 0, 0, 0, 0 };
-
-int VIDIX_NAME(vixPlaybackGetEq)( vidix_video_eq_t * eq)
-{
- memcpy(eq,&equal,sizeof(vidix_video_eq_t));
- return 0;
-}
-
-#ifndef RAGE128
-#define RTFSaturation(a) (1.0 + ((a)*1.0)/1000.0)
-#define RTFBrightness(a) (((a)*1.0)/2000.0)
-#define RTFIntensity(a) (((a)*1.0)/2000.0)
-#define RTFContrast(a) (1.0 + ((a)*1.0)/1000.0)
-#define RTFHue(a) (((a)*3.1416)/1000.0)
-#define RTFCheckParam(a) {if((a)<-1000) (a)=-1000; if((a)>1000) (a)=1000;}
-#endif
-
-int VIDIX_NAME(vixPlaybackSetEq)( const vidix_video_eq_t * eq)
-{
-#ifdef RAGE128
- int br,sat;
-#else
- int itu_space;
-#endif
- if(eq->cap & VEQ_CAP_BRIGHTNESS) equal.brightness = eq->brightness;
- if(eq->cap & VEQ_CAP_CONTRAST) equal.contrast = eq->contrast;
- if(eq->cap & VEQ_CAP_SATURATION) equal.saturation = eq->saturation;
- if(eq->cap & VEQ_CAP_HUE) equal.hue = eq->hue;
- if(eq->cap & VEQ_CAP_RGB_INTENSITY)
- {
- equal.red_intensity = eq->red_intensity;
- equal.green_intensity = eq->green_intensity;
- equal.blue_intensity = eq->blue_intensity;
- }
- equal.flags = eq->flags;
-#ifdef RAGE128
- br = equal.brightness * 64 / 1000;
- if(br < -64) br = -64; if(br > 63) br = 63;
- sat = (equal.saturation*31 + 31000) / 2000;
- if(sat < 0) sat = 0; if(sat > 31) sat = 31;
- OUTREG(OV0_COLOUR_CNTL, (br & 0x7f) | (sat << 8) | (sat << 16));
-#else
- itu_space = equal.flags == VEQ_FLG_ITU_R_BT_709 ? 1 : 0;
- RTFCheckParam(equal.brightness);
- RTFCheckParam(equal.saturation);
- RTFCheckParam(equal.contrast);
- RTFCheckParam(equal.hue);
- RTFCheckParam(equal.red_intensity);
- RTFCheckParam(equal.green_intensity);
- RTFCheckParam(equal.blue_intensity);
- radeon_set_transform(RTFBrightness(equal.brightness),
- RTFContrast(equal.contrast),
- RTFSaturation(equal.saturation),
- RTFHue(equal.hue),
- RTFIntensity(equal.red_intensity),
- RTFIntensity(equal.green_intensity),
- RTFIntensity(equal.blue_intensity),
- itu_space);
-#endif
- return 0;
-}
-
-int VIDIX_NAME(vixPlaybackSetDeint)( const vidix_deinterlace_t * info)
-{
- unsigned sflg;
- switch(info->flags)
- {
- default:
- case CFG_NON_INTERLACED:
- besr.deinterlace_on = 0;
- break;
- case CFG_EVEN_ODD_INTERLACING:
- case CFG_INTERLACED:
- besr.deinterlace_on = 1;
- besr.deinterlace_pattern = 0x900AAAAA;
- break;
- case CFG_ODD_EVEN_INTERLACING:
- besr.deinterlace_on = 1;
- besr.deinterlace_pattern = 0x00055555;
- break;
- case CFG_UNIQUE_INTERLACING:
- besr.deinterlace_on = 1;
- besr.deinterlace_pattern = info->deinterlace_pattern;
- break;
- }
- OUTREG(OV0_REG_LOAD_CNTL, REG_LD_CTL_LOCK);
- radeon_engine_idle();
- while(!(INREG(OV0_REG_LOAD_CNTL)&REG_LD_CTL_LOCK_READBACK));
- radeon_fifo_wait(15);
- sflg = INREG(OV0_SCALE_CNTL);
- if(besr.deinterlace_on)
- {
- OUTREG(OV0_SCALE_CNTL,sflg | SCALER_ADAPTIVE_DEINT);
- OUTREG(OV0_DEINTERLACE_PATTERN,besr.deinterlace_pattern);
- }
- else OUTREG(OV0_SCALE_CNTL,sflg & (~SCALER_ADAPTIVE_DEINT));
- OUTREG(OV0_REG_LOAD_CNTL, 0);
- return 0;
-}
-
-int VIDIX_NAME(vixPlaybackGetDeint)( vidix_deinterlace_t * info)
-{
- if(!besr.deinterlace_on) info->flags = CFG_NON_INTERLACED;
- else
- {
- info->flags = CFG_UNIQUE_INTERLACING;
- info->deinterlace_pattern = besr.deinterlace_pattern;
- }
- return 0;
-}
-
-
-/* Graphic keys */
-static vidix_grkey_t radeon_grkey;
-
-static void set_gr_key( void )
-{
- if(radeon_grkey.ckey.op == CKEY_TRUE)
- {
- int dbpp=radeon_vid_get_dbpp();
-
- switch(dbpp)
- {
- case 15:
-#ifndef RAGE128
- besr.graphics_key_clr=
- ((radeon_grkey.ckey.blue &0xF8))
- | ((radeon_grkey.ckey.green&0xF8)<<8)
- | ((radeon_grkey.ckey.red &0xF8)<<16);
-#else
- besr.graphics_key_clr=
- ((radeon_grkey.ckey.blue &0xF8)>>3)
- | ((radeon_grkey.ckey.green&0xF8)<<2)
- | ((radeon_grkey.ckey.red &0xF8)<<7);
-#endif
- break;
- case 16:
-#ifndef RAGE128
- besr.graphics_key_clr=
- ((radeon_grkey.ckey.blue &0xF8))
- | ((radeon_grkey.ckey.green&0xFC)<<8)
- | ((radeon_grkey.ckey.red &0xF8)<<16);
-#else
- besr.graphics_key_clr=
- ((radeon_grkey.ckey.blue &0xF8)>>3)
- | ((radeon_grkey.ckey.green&0xFC)<<3)
- | ((radeon_grkey.ckey.red &0xF8)<<8);
-#endif
- break;
- case 24:
- case 32:
- besr.graphics_key_clr=
- ((radeon_grkey.ckey.blue &0xFF))
- | ((radeon_grkey.ckey.green&0xFF)<<8)
- | ((radeon_grkey.ckey.red &0xFF)<<16);
- break;
- default:
- besr.graphics_key_msk=0;
- besr.graphics_key_clr=0;
- }
-#ifdef RAGE128
- besr.graphics_key_msk=(1<<dbpp)-1;
- besr.ckey_cntl = VIDEO_KEY_FN_TRUE|GRAPHIC_KEY_FN_NE|CMP_MIX_AND;
-#else
- besr.graphics_key_msk=besr.graphics_key_clr;
- besr.ckey_cntl = VIDEO_KEY_FN_TRUE|CMP_MIX_AND|GRAPHIC_KEY_FN_EQ;
-#endif
- }
- else
- {
- besr.graphics_key_msk=0;
- besr.graphics_key_clr=0;
- besr.ckey_cntl = VIDEO_KEY_FN_TRUE|GRAPHIC_KEY_FN_TRUE|CMP_MIX_AND;
- }
- radeon_fifo_wait(3);
- OUTREG(OV0_GRAPHICS_KEY_MSK, besr.graphics_key_msk);
- OUTREG(OV0_GRAPHICS_KEY_CLR, besr.graphics_key_clr);
- OUTREG(OV0_KEY_CNTL,besr.ckey_cntl);
-}
-
-int VIDIX_NAME(vixGetGrKeys)(vidix_grkey_t *grkey)
-{
- memcpy(grkey, &radeon_grkey, sizeof(vidix_grkey_t));
- return(0);
-}
-
-int VIDIX_NAME(vixSetGrKeys)(const vidix_grkey_t *grkey)
-{
- memcpy(&radeon_grkey, grkey, sizeof(vidix_grkey_t));
- set_gr_key();
- return(0);
-}
-
-#ifdef RADEON_ENABLE_BM
-static int radeon_setup_frame( vidix_dma_t * dmai )
-{
- bm_list_descriptor * list = (bm_list_descriptor *)radeon_dma_desc_base;
- unsigned long dest_ptr;
- unsigned i,n,count;
- int retval;
- if(dmai->dest_offset + dmai->size > radeon_ram_size) return E2BIG;
- n = dmai->size / 4096;
- if(dmai->size % 4096) n++;
- if((retval = bm_virt_to_bus(dmai->src,dmai->size,dma_phys_addrs)) != 0) return retval;
- dest_ptr = dmai->dest_offset;
- count = dmai->size;
- for(i=0;i<n;i++)
- {
- list[i].framebuf_offset = radeon_overlay_off + dest_ptr;
- list[i].sys_addr = dma_phys_addrs[i];
-#ifdef RAGE128
- list[i].command = (count > 4096 ? 4096 : count | BM_END_OF_LIST)|BM_FORCE_TO_PCI;
-#else
- list[i].command = (count > 4096 ? 4096 : count | DMA_GUI_COMMAND__EOL);
-#endif
- list[i].reserved = 0;
-printf("RADEON_DMA_TABLE[%i] %X %X %X %X\n",i,list[i].framebuf_offset,list[i].sys_addr,list[i].command,list[i].reserved);
- dest_ptr += 4096;
- count -= 4096;
- }
- return 0;
-}
-
-static int radeon_transfer_frame( void )
-{
- unsigned i;
- radeon_engine_idle();
- for(i=0;i<1000;i++) INREG(BUS_CNTL); /* FlushWriteCombining */
- OUTREG(BUS_CNTL,(INREG(BUS_CNTL) | BUS_STOP_REQ_DIS)&(~BUS_MASTER_DIS));
-#ifdef RAGE128
- OUTREG(BM_CHUNK_0_VAL,0x000000FF | BM_GLOBAL_FORCE_TO_PCI);
- OUTREG(BM_CHUNK_1_VAL,0x0F0F0F0F);
- OUTREG(BM_VIP0_BUF,bus_addr_dma_desc|SYSTEM_TRIGGER_SYSTEM_TO_VIDEO);
-// OUTREG(GEN_INT_STATUS,INREG(GEN_INT_STATUS)|0x00010000);
-#else
- OUTREG(MC_FB_LOCATION,
- ((pci_info.base0>>16)&0xffff)|
- ((pci_info.base0+INREG(CONFIG_APER_SIZE)-1)&0xffff0000));
- if((INREG(MC_AGP_LOCATION)&0xffff)!=
- (((pci_info.base0+INREG(CONFIG_APER_SIZE))>>16)&0xffff))
- /*Radeon memory controller is misconfigured*/
- return EINVAL;
- OUTREG(DMA_VID_ACT_DSCRPTR,bus_addr_dma_desc);
-// OUTREG(GEN_INT_STATUS,INREG(GEN_INT_STATUS)|(1<<30));
-#endif
- OUTREG(GEN_INT_STATUS,INREG(GEN_INT_STATUS)|0x00010000);
- return 0;
-}
-
-
-int VIDIX_NAME(vixPlaybackCopyFrame)( vidix_dma_t * dmai )
-{
- int retval;
- if(mlock(dmai->src,dmai->size) != 0) return errno;
- retval = radeon_setup_frame(dmai);
- if(retval == 0) retval = radeon_transfer_frame();
- munlock(dmai->src,dmai->size);
- return retval;
-}
-
-int VIDIX_NAME(vixQueryDMAStatus)( void )
-{
- int bm_active;
-#if 1 //def RAGE128
- bm_active=(INREG(GEN_INT_STATUS)&0x00010000)==0?1:0;
-#else
- bm_active=(INREG(GEN_INT_STATUS)&(1<<30))==0?1:0;
-#endif
- return bm_active?1:0;
-}
-#endif
diff --git a/src/video_out/vidix/drivers/savage_regs.h b/src/video_out/vidix/drivers/savage_regs.h
deleted file mode 100644
index a8a44c7c3..000000000
--- a/src/video_out/vidix/drivers/savage_regs.h
+++ /dev/null
@@ -1,304 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_regs.h,v 1.10 2001/11/04 22:17:48 alanh Exp $ */
-
-#ifndef _SAVAGE_REGS_H
-#define _SAVAGE_REGS_H
-
-/* These are here until xf86PciInfo.h is updated. */
-
-#ifndef PCI_CHIP_S3TWISTER_P
-#define PCI_CHIP_S3TWISTER_P 0x8d01
-#endif
-#ifndef PCI_CHIP_S3TWISTER_K
-#define PCI_CHIP_S3TWISTER_K 0x8d02
-#endif
-#ifndef PCI_CHIP_SUPSAV_MX128
-#define PCI_CHIP_SUPSAV_MX128 0x8c22
-#define PCI_CHIP_SUPSAV_MX64 0x8c24
-#define PCI_CHIP_SUPSAV_MX64C 0x8c26
-#define PCI_CHIP_SUPSAV_IX128SDR 0x8c2a
-#define PCI_CHIP_SUPSAV_IX128DDR 0x8c2b
-#define PCI_CHIP_SUPSAV_IX64SDR 0x8c2c
-#define PCI_CHIP_SUPSAV_IX64DDR 0x8c2d
-#define PCI_CHIP_SUPSAV_IXCSDR 0x8c2e
-#define PCI_CHIP_SUPSAV_IXCDDR 0x8c2f
-#endif
-#ifndef PCI_CHIP_PROSAVAGE_DDR
-#define PCI_CHIP_PROSAVAGE_DDR 0x8d03
-#define PCI_CHIP_PROSAVAGE_DDRK 0x8d04
-#endif
-
-#define S3_SAVAGE3D_SERIES(chip) ((chip>=S3_SAVAGE3D) && (chip<=S3_SAVAGE_MX))
-
-#define S3_SAVAGE4_SERIES(chip) ((chip==S3_SAVAGE4) || (chip==S3_PROSAVAGE))
-
-#define S3_SAVAGE_MOBILE_SERIES(chip) ((chip==S3_SAVAGE_MX) || (chip==S3_SUPERSAVAGE))
-
-#define S3_SAVAGE_SERIES(chip) ((chip>=S3_SAVAGE3D) && (chip<=S3_SAVAGE2000))
-
-
-/* Chip tags. These are used to group the adapters into
- * related families.
- */
-
-
-enum S3CHIPTAGS {
- S3_UNKNOWN = 0,
- S3_SAVAGE3D,
- S3_SAVAGE_MX,
- S3_SAVAGE4,
- S3_PROSAVAGE,
- S3_SUPERSAVAGE,
- S3_SAVAGE2000,
- S3_LAST
-};
-
-typedef struct {
- unsigned int mode, refresh;
- unsigned char SR08, SR0E, SR0F;
- unsigned char SR10, SR11, SR12, SR13, SR15, SR18, SR1B, SR29, SR30;
- unsigned char SR54[8];
- unsigned char Clock;
- unsigned char CR31, CR32, CR33, CR34, CR36, CR3A, CR3B, CR3C;
- unsigned char CR40, CR41, CR42, CR43, CR45;
- unsigned char CR50, CR51, CR53, CR55, CR58, CR5B, CR5D, CR5E;
- unsigned char CR60, CR63, CR65, CR66, CR67, CR68, CR69, CR6D, CR6F;
- unsigned char CR86, CR88;
- unsigned char CR90, CR91, CRB0;
- unsigned int STREAMS[22]; /* yuck, streams regs */
- unsigned int MMPR0, MMPR1, MMPR2, MMPR3;
-} SavageRegRec, *SavageRegPtr;
-
-
-
-#define BIOS_BSIZE 1024
-#define BIOS_BASE 0xc0000
-
-#define SAVAGE_NEWMMIO_REGBASE_S3 0x1000000 /* 16MB */
-#define SAVAGE_NEWMMIO_REGBASE_S4 0x0000000
-#define SAVAGE_NEWMMIO_REGSIZE 0x0080000 /* 512kb */
-#define SAVAGE_NEWMMIO_VGABASE 0x8000
-
-#define BASE_FREQ 14.31818
-
-#define FIFO_CONTROL_REG 0x8200
-#define MIU_CONTROL_REG 0x8204
-#define STREAMS_TIMEOUT_REG 0x8208
-#define MISC_TIMEOUT_REG 0x820c
-
-/* Stream Processor 1 */
-
-/* Primary Stream 1 Frame Buffer Address 0 */
-#define PRI_STREAM_FBUF_ADDR0 0x81c0
-/* Primary Stream 1 Frame Buffer Address 0 */
-#define PRI_STREAM_FBUF_ADDR1 0x81c4
-/* Primary Stream 1 Stride */
-#define PRI_STREAM_STRIDE 0x81c8
-/* Primary Stream 1 Frame Buffer Size */
-#define PRI_STREAM_BUFFERSIZE 0x8214
-
-/* Secondary stream 1 Color/Chroma Key Control */
-#define SEC_STREAM_CKEY_LOW 0x8184
-/* Secondary stream 1 Chroma Key Upper Bound */
-#define SEC_STREAM_CKEY_UPPER 0x8194
-/* Blend Control of Secondary Stream 1 & 2 */
-#define BLEND_CONTROL 0x8190
-/* Secondary Stream 1 Color conversion/Adjustment 1 */
-#define SEC_STREAM_COLOR_CONVERT1 0x8198
-/* Secondary Stream 1 Color conversion/Adjustment 2 */
-#define SEC_STREAM_COLOR_CONVERT2 0x819c
-/* Secondary Stream 1 Color conversion/Adjustment 3 */
-#define SEC_STREAM_COLOR_CONVERT3 0x81e4
-/* Secondary Stream 1 Horizontal Scaling */
-#define SEC_STREAM_HSCALING 0x81a0
-/* Secondary Stream 1 Frame Buffer Size */
-#define SEC_STREAM_BUFFERSIZE 0x81a8
-/* Secondary Stream 1 Horizontal Scaling Normalization (2K only) */
-#define SEC_STREAM_HSCALE_NORMALIZE 0x81ac
-/* Secondary Stream 1 Horizontal Scaling */
-#define SEC_STREAM_VSCALING 0x81e8
-/* Secondary Stream 1 Frame Buffer Address 0 */
-#define SEC_STREAM_FBUF_ADDR0 0x81d0
-/* Secondary Stream 1 Frame Buffer Address 1 */
-#define SEC_STREAM_FBUF_ADDR1 0x81d4
-/* Secondary Stream 1 Frame Buffer Address 2 */
-#define SEC_STREAM_FBUF_ADDR2 0x81ec
-/* Secondary Stream 1 Stride */
-#define SEC_STREAM_STRIDE 0x81d8
-/* Secondary Stream 1 Window Start Coordinates */
-#define SEC_STREAM_WINDOW_START 0x81f8
-/* Secondary Stream 1 Window Size */
-#define SEC_STREAM_WINDOW_SZ 0x81fc
-/* Secondary Streams Tile Offset */
-#define SEC_STREAM_TILE_OFF 0x821c
-/* Secondary Stream 1 Opaque Overlay Control */
-#define SEC_STREAM_OPAQUE_OVERLAY 0x81dc
-
-
-/* Stream Processor 2 */
-
-/* Primary Stream 2 Frame Buffer Address 0 */
-#define PRI_STREAM2_FBUF_ADDR0 0x81b0
-/* Primary Stream 2 Frame Buffer Address 1 */
-#define PRI_STREAM2_FBUF_ADDR1 0x81b4
-/* Primary Stream 2 Stride */
-#define PRI_STREAM2_STRIDE 0x81b8
-/* Primary Stream 2 Frame Buffer Size */
-#define PRI_STREAM2_BUFFERSIZE 0x8218
-
-/* Secondary Stream 2 Color/Chroma Key Control */
-#define SEC_STREAM2_CKEY_LOW 0x8188
-/* Secondary Stream 2 Chroma Key Upper Bound */
-#define SEC_STREAM2_CKEY_UPPER 0x818c
-/* Secondary Stream 2 Horizontal Scaling */
-#define SEC_STREAM2_HSCALING 0x81a4
-/* Secondary Stream 2 Horizontal Scaling */
-#define SEC_STREAM2_VSCALING 0x8204
-/* Secondary Stream 2 Frame Buffer Size */
-#define SEC_STREAM2_BUFFERSIZE 0x81ac
-/* Secondary Stream 2 Frame Buffer Address 0 */
-#define SEC_STREAM2_FBUF_ADDR0 0x81bc
-/* Secondary Stream 2 Frame Buffer Address 1 */
-#define SEC_STREAM2_FBUF_ADDR1 0x81e0
-/* Secondary Stream 2 Frame Buffer Address 2 */
-#define SEC_STREAM2_FBUF_ADDR2 0x8208
-/* Multiple Buffer/LPB and Secondary Stream 2 Stride */
-#define SEC_STREAM2_STRIDE_LPB 0x81cc
-/* Secondary Stream 2 Color conversion/Adjustment 1 */
-#define SEC_STREAM2_COLOR_CONVERT1 0x81f0
-/* Secondary Stream 2 Color conversion/Adjustment 2 */
-#define SEC_STREAM2_COLOR_CONVERT2 0x81f4
-/* Secondary Stream 2 Color conversion/Adjustment 3 */
-#define SEC_STREAM2_COLOR_CONVERT3 0x8200
-/* Secondary Stream 2 Window Start Coordinates */
-#define SEC_STREAM2_WINDOW_START 0x820c
-/* Secondary Stream 2 Window Size */
-#define SEC_STREAM2_WINDOW_SZ 0x8210
-/* Secondary Stream 2 Opaque Overlay Control */
-#define SEC_STREAM2_OPAQUE_OVERLAY 0x8180
-
-
-/* savage 2000 */
-#define SEC_STREAM_COLOR_CONVERT0_2000 0x8198
-#define SEC_STREAM_COLOR_CONVERT1_2000 0x819c
-#define SEC_STREAM_COLOR_CONVERT2_2000 0x81e0
-#define SEC_STREAM_COLOR_CONVERT3_2000 0x81e4
-
-#define SUBSYS_STAT_REG 0x8504
-
-#define SRC_BASE 0xa4d4
-#define DEST_BASE 0xa4d8
-#define CLIP_L_R 0xa4dc
-#define CLIP_T_B 0xa4e0
-#define DEST_SRC_STR 0xa4e4
-#define MONO_PAT_0 0xa4e8
-#define MONO_PAT_1 0xa4ec
-
-/* Constants for CR69. */
-
-#define CRT_ACTIVE 0x01
-#define LCD_ACTIVE 0x02
-#define TV_ACTIVE 0x04
-#define CRT_ATTACHED 0x10
-#define LCD_ATTACHED 0x20
-#define TV_ATTACHED 0x40
-
-
-/*
- * reads from SUBSYS_STAT
- */
-#define STATUS_WORD0 (INREG(0x48C00))
-#define ALT_STATUS_WORD0 (INREG(0x48C60))
-#define MAXLOOP 0xffffff
-#define IN_SUBSYS_STAT() (INREG(SUBSYS_STAT_REG))
-
-#define MAXFIFO 0x7f00
-
-/*
- * NOTE: don't remove 'VGAIN8(vgaCRIndex);'.
- * If not present it will cause lockups on Savage4.
- * Ask S3, why.
- */
-/*#define VerticalRetraceWait() \
-{ \
- VGAIN8(0x3d0+4); \
- VGAOUT8(0x3d0+4, 0x17); \
- if (VGAIN8(0x3d0+5) & 0x80) { \
- while ((VGAIN8(0x3d0 + 0x0a) & 0x08) == 0x08) ; \
- while ((VGAIN8(0x3d0 + 0x0a) & 0x08) == 0x00) ; \
- } \
-}
-*/
-
-#define VerticalRetraceWait() \
-do { \
- VGAIN8(0x3d4); \
- VGAOUT8(0x3d4, 0x17); \
- if (VGAIN8(0x3d5) & 0x80) { \
- int i = 0x10000; \
- while ((VGAIN8(0x3da) & 0x08) == 0x08 && i--) ; \
- i = 0x10000; \
- while ((VGAIN8(0x3da) & 0x08) == 0x00 && i--) ; \
- } \
-} while (0)
-
-
-#define I2C_REG 0xa0
-#define InI2CREG(a) \
-{ \
- VGAOUT8(0x3d0 + 4, I2C_REG); \
- a = VGAIN8(0x3d0 + 5); \
-}
-
-#define OutI2CREG(a) \
-{ \
- VGAOUT8(0x3d0 + 4, I2C_REG); \
- VGAOUT8(0x3d0 + 5, a); \
-}
-
-#define HZEXP_COMP_1 0x54
-#define HZEXP_BORDER 0x58
-#define HZEXP_FACTOR_IGA1 0x59
-
-#define VTEXP_COMP_1 0x56
-#define VTEXP_BORDER 0x5a
-#define VTEXP_FACTOR_IGA1 0x5b
-
-#define EC1_CENTER_ON 0x10
-#define EC1_EXPAND_ON 0x0c
-
-#define MODE_24 24
-
-#if (MODE_24 == 32)
-# define BYTES_PP24 4
-#else
-# define BYTES_PP24 3
-#endif
-
-#define OVERLAY_DEPTH 16
-
-#define STREAMS_MODE32 0x7
-#define STREAMS_MODE24 0x6
-#define STREAMS_MODE16 0x5 /* @@@ */
-
-
-#define DEPTH_BPP(depth) (depth == 24 ? (BYTES_PP24 << 3) : (depth + 7) & ~0x7)
-#define DEPTH_2ND(depth) (depth > 8 ? depth\
- : OVERLAY_DEPTH)
-#define SSTREAMS_MODE(bpp) (bpp > 16 ? (bpp > 24 ? STREAMS_MODE32 :\
- STREAMS_MODE24) : STREAMS_MODE16)
-
-#define HSCALING_Shift 0
-#define HSCALING_Mask (((1L << 16)-1) << HSCALING_Shift)
-#define HSCALING(w0,w1) ((((unsigned int)(((double)w0/(double)w1) * (1 << 15))) \
- << HSCALING_Shift) \
- & HSCALING_Mask)
-
-#define VSCALING_Shift 0
-#define VSCALING_Mask (((1L << 20)-1) << VSCALING_Shift)
-#define VSCALING(h0,h1) ((((unsigned int) (((double)h0/(double)h1) * (1 << 15))) \
- << VSCALING_Shift) \
- & VSCALING_Mask)
-
-
-#endif /* _SAVAGE_REGS_H */
-
diff --git a/src/video_out/vidix/drivers/savage_vid.c b/src/video_out/vidix/drivers/savage_vid.c
deleted file mode 100644
index 2ac76198d..000000000
--- a/src/video_out/vidix/drivers/savage_vid.c
+++ /dev/null
@@ -1,1472 +0,0 @@
-/*
- Driver for S3 Savage Series
-
- Copyright (C) 2004 by Reza Jelveh
-
- Based on the X11 driver and nvidia vid
-
- Thanks to Alex Deucher for Support
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Changes:
- 2004-11-09
- Initial version
-
- To Do:
-
-*/
-
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <inttypes.h>
-#include <unistd.h>
-#include <math.h>
-
-#include "vidix.h"
-#include "fourcc.h"
-#include "libdha.h"
-#include "pci_ids.h"
-#include "pci_names.h"
-
-#include "savage_regs.h"
-
-
-#define VF_STREAMS_ON 0x0001
-#define BASE_PAD 0xf
-#define FRAMEBUFFER_SIZE 1024*2000*4
-/**************************************
- S3 streams processor
-**************************************/
-
-#define EXT_MISC_CTRL2 0x67
-
-/* New streams */
-
-/* CR67[2] = 1 : enable stream 1 */
-#define ENABLE_STREAM1 0x04
-/* CR67[1] = 1 : enable stream 2 */
-#define ENABLE_STREAM2 0x02
-/* mask to clear CR67[2,1] */
-#define NO_STREAMS 0xF9
-/* CR67[3] = 1 : Mem-mapped regs */
-#define USE_MM_FOR_PRI_STREAM 0x08
-
-#define HDM_SHIFT 16
-#define HDSCALE_4 (2 << HDM_SHIFT)
-#define HDSCALE_8 (3 << HDM_SHIFT)
-#define HDSCALE_16 (4 << HDM_SHIFT)
-#define HDSCALE_32 (5 << HDM_SHIFT)
-#define HDSCALE_64 (6 << HDM_SHIFT)
-
-/* Old Streams */
-
-#define ENABLE_STREAMS_OLD 0x0c
-#define NO_STREAMS_OLD 0xf3
-/* CR69[0] = 1 : Mem-mapped regs */
-#define USE_MM_FOR_PRI_STREAM_OLD 0x01
-
-static void SavageStreamsOn(void);
-
-/*
- * There are two different streams engines used in the Savage line.
- * The old engine is in the 3D, 4, Pro, and Twister.
- * The new engine is in the 2000, MX, IX, and Super.
- */
-
-
-/* streams registers for old engine */
-#define PSTREAM_CONTROL_REG 0x8180
-#define COL_CHROMA_KEY_CONTROL_REG 0x8184
-#define SSTREAM_CONTROL_REG 0x8190
-#define CHROMA_KEY_UPPER_BOUND_REG 0x8194
-#define SSTREAM_STRETCH_REG 0x8198
-#define COLOR_ADJUSTMENT_REG 0x819C
-#define BLEND_CONTROL_REG 0x81A0
-#define PSTREAM_FBADDR0_REG 0x81C0
-#define PSTREAM_FBADDR1_REG 0x81C4
-#define PSTREAM_STRIDE_REG 0x81C8
-#define DOUBLE_BUFFER_REG 0x81CC
-#define SSTREAM_FBADDR0_REG 0x81D0
-#define SSTREAM_FBADDR1_REG 0x81D4
-#define SSTREAM_STRIDE_REG 0x81D8
-#define SSTREAM_VSCALE_REG 0x81E0
-#define SSTREAM_VINITIAL_REG 0x81E4
-#define SSTREAM_LINES_REG 0x81E8
-#define STREAMS_FIFO_REG 0x81EC
-#define PSTREAM_WINDOW_START_REG 0x81F0
-#define PSTREAM_WINDOW_SIZE_REG 0x81F4
-#define SSTREAM_WINDOW_START_REG 0x81F8
-#define SSTREAM_WINDOW_SIZE_REG 0x81FC
-#define FIFO_CONTROL 0x8200
-#define PSTREAM_FBSIZE_REG 0x8300
-#define SSTREAM_FBSIZE_REG 0x8304
-#define SSTREAM_FBADDR2_REG 0x8308
-
-#define OS_XY(x,y) (((x+1)<<16)|(y+1))
-#define OS_WH(x,y) (((x-1)<<16)|(y))
-
-#define PCI_COMMAND_MEM 0x2
-#define MAX_FRAMES 3
-/**
- * @brief Information on PCI device.
- */
-pciinfo_t pci_info;
-
-/**
- * @brief Unichrome driver colorkey settings.
- */
-/* static vidix_grkey_t savage_grkey; */
-
-/* static int frames[VID_PLAY_MAXFRAMES]; */
-uint8_t *vio;
-uint8_t mclk_save[3];
-
-#define outb(reg,val) OUTPORT8(reg,val)
-#define inb(reg) INPORT8(reg)
-#define outw(reg,val) OUTPORT16(reg,val)
-#define inw(reg) INPORT16(reg)
-#define outl(reg,val) OUTPORT32(reg,val)
-#define inl(reg) INPORT32(reg)
-
-
-/*
- * PCI-Memory IO access macros.
- */
-#define VID_WR08(p,i,val) (((uint8_t *)(p))[(i)]=(val))
-#define VID_RD08(p,i) (((uint8_t *)(p))[(i)])
-
-#define VID_WR32(p,i,val) (((uint32_t *)(p))[(i)/4]=(val))
-#define VID_RD32(p,i) (((uint32_t *)(p))[(i)/4])
-
-#ifndef USE_RMW_CYCLES
-/*
- * Can be used to inhibit READ-MODIFY-WRITE cycles. On by default.
- */
-
-#define MEM_BARRIER() __asm__ __volatile__ ("" : : : "memory")
-
-#undef VID_WR08
-#define VID_WR08(p,i,val) ({ MEM_BARRIER(); ((uint8_t *)(p))[(i)]=(val); })
-#undef VID_RD08
-#define VID_RD08(p,i) ({ MEM_BARRIER(); ((uint8_t *)(p))[(i)]; })
-
-#undef VID_WR16
-#define VID_WR16(p,i,val) ({ MEM_BARRIER(); ((uint16_t *)(p))[(i)/2]=(val); })
-#undef VID_RD16
-#define VID_RD16(p,i) ({ MEM_BARRIER(); ((uint16_t *)(p))[(i)/2]; })
-
-#undef VID_WR32
-#define VID_WR32(p,i,val) ({ MEM_BARRIER(); ((uint32_t *)(p))[(i)/4]=(val); })
-#undef VID_RD32
-#define VID_RD32(p,i) ({ MEM_BARRIER(); ((uint32_t *)(p))[(i)/4]; })
-#endif /* USE_RMW_CYCLES */
-
-#define VID_AND32(p,i,val) VID_WR32(p,i,VID_RD32(p,i)&(val))
-#define VID_OR32(p,i,val) VID_WR32(p,i,VID_RD32(p,i)|(val))
-#define VID_XOR32(p,i,val) VID_WR32(p,i,VID_RD32(p,i)^(val))
-
-
-/* from x driver */
-
-#define VGAIN8(addr) VID_RD08(info->control_base+0x8000, addr)
-#define VGAIN16(addr) VID_RD16(info->control_base+0x8000, addr)
-#define VGAIN(addr) VID_RD32(info->control_base+0x8000, addr)
-
-#define VGAOUT8(addr,val) VID_WR08(info->control_base+0x8000, addr, val)
-#define VGAOUT16(addr,val) VID_WR16(info->control_base+0x8000, addr, val)
-#define VGAOUT(addr,val) VID_WR32(info->control_base+0x8000, addr, val)
-
-#define INREG(addr) VID_RD32(info->control_base, addr)
-#define OUTREG(addr,val) VID_WR32(info->control_base, addr, val)
-#define INREG8(addr) VID_RD08(info->control_base, addr)
-#define OUTREG8(addr,val) VID_WR08(info->control_base, addr, val)
-#define INREG16(addr) VID_RD16(info->control_base, addr)
-#define OUTREG16(addr,val) VID_WR16(info->control_base, addr, val)
-
-#define ALIGN_TO(v, n) (((v) + (n-1)) & ~(n-1))
-
-
-void debugout(unsigned int addr, unsigned int val);
-
-
-struct savage_chip {
- volatile uint32_t *PMC; /* general control */
- volatile uint32_t *PME; /* multimedia port */
- volatile uint32_t *PFB; /* framebuffer control */
- volatile uint32_t *PVIDEO; /* overlay control */
- volatile uint8_t *PCIO; /* SVGA (CRTC, ATTR) registers */
- volatile uint8_t *PVIO; /* SVGA (MISC, GRAPH, SEQ) registers */
- volatile uint32_t *PRAMIN; /* instance memory */
- volatile uint32_t *PRAMHT; /* hash table */
- volatile uint32_t *PRAMFC; /* fifo context table */
- volatile uint32_t *PRAMRO; /* fifo runout table */
- volatile uint32_t *PFIFO; /* fifo control region */
- volatile uint32_t *FIFO; /* fifo channels (USER) */
- volatile uint32_t *PGRAPH; /* graphics engine */
-
- int arch; /* compatible NV_ARCH_XX define */
- unsigned long fbsize; /* framebuffer size */
- void (* lock) (struct savage_chip *, int);
-};
-typedef struct savage_chip savage_chip;
-
-
-struct savage_info {
- unsigned int use_colorkey;
- unsigned int colorkey; /* saved xv colorkey*/
- unsigned int vidixcolorkey; /*currently used colorkey*/
- unsigned int depth;
- unsigned int bpp;
- unsigned int videoFlags;
- unsigned int format;
- unsigned int pitch;
- unsigned int blendBase;
- unsigned int lastKnownPitch;
- unsigned int displayWidth, displayHeight;
- unsigned int brightness,hue,saturation,contrast;
- unsigned int src_w,src_h;
- unsigned int drw_w,drw_h; /*scaled width && height*/
- unsigned int wx,wy; /*window x && y*/
- unsigned int screen_x; /*screen width*/
- unsigned int screen_y; /*screen height*/
- unsigned long buffer_size; /* size of the image buffer */
- struct savage_chip chip; /* NV architecture structure */
- void* video_base; /* virtual address of control region */
- void* control_base; /* virtual address of fb region */
- unsigned long picture_base; /* direct pointer to video picture */
- unsigned long picture_offset; /* offset of video picture in frame buffer */
-// struct savage_dma dma; /* DMA structure */
- unsigned int cur_frame;
- unsigned int num_frames; /* number of buffers */
- int bps; /* bytes per line */
- void (*SavageWaitIdle) ();
- void (*SavageWaitFifo) (int space);
-};
-typedef struct savage_info savage_info;
-
-
-static savage_info* info;
-
-
-/**
- * @brief Unichrome driver vidix capabilities.
- */
-static vidix_capability_t savage_cap = {
- "Savage/ProSavage/Twister vidix",
- "Reza Jelveh <reza.jelveh@tuhh.de>",
- TYPE_OUTPUT,
- {0, 0, 0, 0},
- 4096,
- 4096,
- 4,
- 4,
- -1,
- FLAG_UPSCALER | FLAG_DOWNSCALER,
- VENDOR_S3_INC,
- -1,
- {0, 0, 0, 0}
-};
-
-struct savage_cards {
- unsigned short chip_id;
- unsigned short arch;
-};
-
-
-static
-unsigned int GetBlendForFourCC( int id )
-{
- switch( id ) {
- case IMGFMT_YUY2:
- case IMGFMT_YV12:
- case IMGFMT_I420:
- return 1;
- case IMGFMT_Y211:
- return 4;
- case IMGFMT_RGB15:
- return 3;
- case IMGFMT_RGB16:
- return 5;
- default:
- return 0;
- }
-}
-
-/**
- * @brief list of card IDs compliant with the Unichrome driver .
- */
-static struct savage_cards savage_card_ids[] = {
- /*[ProSavage PN133] AGP4X VGA Controller (Twister)*/
- { PCI_CHIP_S3TWISTER_P, S3_PROSAVAGE },
- /*[ProSavage KN133] AGP4X VGA Controller (TwisterK)*/
- { PCI_CHIP_S3TWISTER_K, S3_PROSAVAGE },
- /*ProSavage DDR*/
- { PCI_CHIP_PROSAVAGE_DDR , S3_PROSAVAGE },
- /*[ProSavageDDR P4M266 K] */
- { PCI_CHIP_PROSAVAGE_DDRK , S3_PROSAVAGE },
-};
-
-static void SavageSetColorOld(void)
-{
-
-
- if(
- (info->format == IMGFMT_RGB15) ||
- (info->format == IMGFMT_RGB16)
- )
- {
- OUTREG( COLOR_ADJUSTMENT_REG, 0 );
- }
- else
- {
- /* Change 0..255 into 0..15 */
- long sat = info->saturation * 16 / 256;
- double hue = info->hue * 0.017453292;
- unsigned long hs1 = ((long)(sat * cos(hue))) & 0x1f;
- unsigned long hs2 = ((long)(sat * sin(hue))) & 0x1f;
-
- OUTREG( COLOR_ADJUSTMENT_REG,
- 0x80008000 |
- (info->brightness + 128) |
- ((info->contrast & 0xf8) << (12-7)) |
- (hs1 << 16) |
- (hs2 << 24)
- );
- debugout( COLOR_ADJUSTMENT_REG,
- 0x80008000 |
- (info->brightness + 128) |
- ((info->contrast & 0xf8) << (12-7)) |
- (hs1 << 16) |
- (hs2 << 24)
- );
-
- }
-}
-
-static void SavageSetColorKeyOld(void)
-{
- int red, green, blue;
-
- /* Here, we reset the colorkey and all the controls. */
-
- red = (info->vidixcolorkey & 0x00FF0000) >> 16;
- green = (info->vidixcolorkey & 0x0000FF00) >> 8;
- blue = info->vidixcolorkey & 0x000000FF;
-
- if( !info->vidixcolorkey ) {
- printf("SavageSetColorKey disabling colorkey\n");
- OUTREG( COL_CHROMA_KEY_CONTROL_REG, 0 );
- OUTREG( CHROMA_KEY_UPPER_BOUND_REG, 0 );
- OUTREG( BLEND_CONTROL_REG, 0 );
- }
- else {
- switch (info->depth) {
- // FIXME: isnt fixed yet
- case 8:
- OUTREG( COL_CHROMA_KEY_CONTROL_REG,
- 0x37000000 | (info->vidixcolorkey & 0xFF) );
- OUTREG( CHROMA_KEY_UPPER_BOUND_REG,
- 0x00000000 | (info->vidixcolorkey & 0xFF) );
- break;
- case 15:
- /* 15 bpp 555 */
- red&=0x1f;
- green&=0x1f;
- blue&=0x1f;
- OUTREG( COL_CHROMA_KEY_CONTROL_REG,
- 0x05000000 | (red<<19) | (green<<11) | (blue<<3) );
- OUTREG( CHROMA_KEY_UPPER_BOUND_REG,
- 0x00000000 | (red<<19) | (green<<11) | (blue<<3) );
- break;
- case 16:
- /* 16 bpp 565 */
- red&=0x1f;
- green&=0x3f;
- blue&=0x1f;
- OUTREG( COL_CHROMA_KEY_CONTROL_REG,
- 0x16000000 | (red<<19) | (green<<10) | (blue<<3) );
- OUTREG( CHROMA_KEY_UPPER_BOUND_REG,
- 0x00020002 | (red<<19) | (green<<10) | (blue<<3) );
- break;
- case 24:
- /* 24 bpp 888 */
- OUTREG( COL_CHROMA_KEY_CONTROL_REG,
- 0x17000000 | (red<<16) | (green<<8) | (blue) );
- OUTREG( CHROMA_KEY_UPPER_BOUND_REG,
- 0x00000000 | (red<<16) | (green<<8) | (blue) );
- break;
- }
-
- /* We use destination colorkey */
- OUTREG( BLEND_CONTROL_REG, 0x05000000 );
- }
-}
-
-
-static void SavageDisplayVideoOld(void)
-{
- int vgaCRIndex, vgaCRReg, vgaIOBase;
- unsigned int ssControl;
- int cr92;
-
-
- vgaIOBase = 0x3d0;
- vgaCRIndex = vgaIOBase + 4;
- vgaCRReg = vgaIOBase + 5;
-
-// if( psav->videoFourCC != id )
-// SavageStreamsOff(pScrn);
-
- if( !info->videoFlags & VF_STREAMS_ON )
- {
- SavageStreamsOn();
- // SavageResetVideo();
- SavageSetColorOld();
- SavageSetColorKeyOld();
- }
-
-
-
-
- /* Set surface format. */
-
- OUTREG(SSTREAM_CONTROL_REG,GetBlendForFourCC(info->format) << 24 | info->src_w);
-
- debugout(SSTREAM_CONTROL_REG,GetBlendForFourCC(info->format) << 24 | info->src_w);
-
- /* Calculate horizontal scale factor. */
-
- //FIXME: enable scaling
- OUTREG(SSTREAM_STRETCH_REG, (info->src_w << 15) / info->drw_w );
-// debugout(SSTREAM_STRETCH_REG, 1 << 15);
-
- OUTREG(SSTREAM_LINES_REG, info->src_h );
- debugout(SSTREAM_LINES_REG, info->src_h );
-
-
- OUTREG(SSTREAM_VINITIAL_REG, 0 );
- debugout(SSTREAM_VINITIAL_REG, 0 );
- /* Calculate vertical scale factor. */
-
-// OUTREG(SSTREAM_VSCALE_REG, 1 << 15);
- OUTREG(SSTREAM_VSCALE_REG, VSCALING(info->src_h,info->drw_h) );
- debugout(SSTREAM_VSCALE_REG, VSCALING(info->src_h,info->drw_h) );
-// OUTREG(SSTREAM_VSCALE_REG, (info->src_h << 15) / info->drw_h );
-
- /* Set surface location and stride. */
-
- OUTREG(SSTREAM_FBADDR0_REG, info->picture_offset );
- debugout(SSTREAM_FBADDR0_REG, info->picture_offset );
-
- OUTREG(SSTREAM_FBADDR1_REG, 0 );
- debugout(SSTREAM_FBADDR1_REG, 0 );
-
- OUTREG(SSTREAM_STRIDE_REG, info->pitch );
- debugout(SSTREAM_STRIDE_REG, info->pitch );
-
- OUTREG(SSTREAM_WINDOW_START_REG, OS_XY(info->wx, info->wy) );
- debugout(SSTREAM_WINDOW_START_REG, OS_XY(info->wx, info->wy) );
- OUTREG(SSTREAM_WINDOW_SIZE_REG, OS_WH(info->drw_w, info->drw_h) );
- debugout(SSTREAM_WINDOW_SIZE_REG, OS_WH(info->drw_w, info->drw_h) );
-
-
-
- ssControl = 0;
-
- if( info->src_w > (info->drw_w << 1) )
- {
- /* BUGBUG shouldn't this be >=? */
- if( info->src_w <= (info->drw_w << 2) )
- ssControl |= HDSCALE_4;
- else if( info->src_w > (info->drw_w << 3) )
- ssControl |= HDSCALE_8;
- else if( info->src_w > (info->drw_w << 4) )
- ssControl |= HDSCALE_16;
- else if( info->src_w > (info->drw_w << 5) )
- ssControl |= HDSCALE_32;
- else if( info->src_w > (info->drw_w << 6) )
- ssControl |= HDSCALE_64;
- }
-
- ssControl |= info->src_w;
- ssControl |= (1 << 24);
-
- //FIXME: enable scaling
- OUTREG(SSTREAM_CONTROL_REG, ssControl);
- debugout(SSTREAM_CONTROL_REG, ssControl);
-
- // FIXME: this should actually be enabled
-
- info->pitch = (info->pitch + 7) / 8;
- VGAOUT8(vgaCRIndex, 0x92);
- cr92 = VGAIN8(vgaCRReg);
- VGAOUT8(vgaCRReg, (cr92 & 0x40) | (info->pitch >> 8) | 0x80);
- VGAOUT8(vgaCRIndex, 0x93);
- VGAOUT8(vgaCRReg, info->pitch);
- OUTREG(STREAMS_FIFO_REG, 2 | 25 << 5 | 32 << 11);
-
-
-
-
-}
-
-static void SavageInitStreamsOld()
-{
- /*unsigned long jDelta;*/
- unsigned long format = 0;
-
- /*
- * For the OLD streams engine, several of these registers
- * cannot be touched unless streams are on. Seems backwards to me;
- * I'd want to set 'em up, then cut 'em loose.
- */
-
-
- /*jDelta = pScrn->displayWidth * (pScrn->bitsPerPixel + 7) / 8;*/
- switch( info->depth ) {
- case 8: format = 0 << 24; break;
- case 15: format = 3 << 24; break;
- case 16: format = 5 << 24; break;
- case 24: format = 7 << 24; break;
- }
-#warning enable this again
- OUTREG(PSTREAM_FBSIZE_REG,
- info->screen_y * info->screen_x * (info->bpp >> 3));
-
- OUTREG( PSTREAM_WINDOW_START_REG, OS_XY(0,0) );
- OUTREG( PSTREAM_WINDOW_SIZE_REG, OS_WH(info->screen_x, info->screen_y) );
- OUTREG( PSTREAM_FBADDR1_REG, 0 );
- /*OUTREG( PSTREAM_STRIDE_REG, jDelta );*/
- OUTREG( PSTREAM_CONTROL_REG, format );
- OUTREG( PSTREAM_FBADDR0_REG, 0 );
-
- /*OUTREG( PSTREAM_FBSIZE_REG, jDelta * pScrn->virtualY >> 3 );*/
-
- OUTREG( COL_CHROMA_KEY_CONTROL_REG, 0 );
- OUTREG( SSTREAM_CONTROL_REG, 0 );
- OUTREG( CHROMA_KEY_UPPER_BOUND_REG, 0 );
- OUTREG( SSTREAM_STRETCH_REG, 0 );
- OUTREG( COLOR_ADJUSTMENT_REG, 0 );
- OUTREG( BLEND_CONTROL_REG, 1 << 24 );
- OUTREG( DOUBLE_BUFFER_REG, 0 );
- OUTREG( SSTREAM_FBADDR0_REG, 0 );
- OUTREG( SSTREAM_FBADDR1_REG, 0 );
- OUTREG( SSTREAM_FBADDR2_REG, 0 );
- OUTREG( SSTREAM_FBSIZE_REG, 0 );
- OUTREG( SSTREAM_STRIDE_REG, 0 );
- OUTREG( SSTREAM_VSCALE_REG, 0 );
- OUTREG( SSTREAM_LINES_REG, 0 );
- OUTREG( SSTREAM_VINITIAL_REG, 0 );
-#warning is this needed?
- OUTREG( SSTREAM_WINDOW_START_REG, OS_XY(0xfffe, 0xfffe) );
- OUTREG( SSTREAM_WINDOW_SIZE_REG, OS_WH(10,2) );
-
-}
-
-static void SavageStreamsOn()
-{
- unsigned char jStreamsControl;
- unsigned short vgaCRIndex = 0x3d0 + 4;
- unsigned short vgaCRReg = 0x3d0 + 5;
-
-// xf86ErrorFVerb(STREAMS_TRACE, "SavageStreamsOn\n" );
-
- /* Sequence stolen from streams.c in M7 NT driver */
-
-
- enable_app_io ();
-
- /* Unlock extended registers. */
-
- /* FIXME: it looks like mmaped io is broken with vgaout16 */
- VGAOUT16(vgaCRIndex, 0x4838 );
- VGAOUT16(vgaCRIndex, 0xa039);
- VGAOUT16(0x3c4, 0x0608);
-
-
-
- VGAOUT8( vgaCRIndex, EXT_MISC_CTRL2 );
-
- if( S3_SAVAGE_MOBILE_SERIES(info->chip.arch) )
- {
-// SavageInitStreamsNew( pScrn );
-
- jStreamsControl = VGAIN8( vgaCRReg ) | ENABLE_STREAM1;
-
- /* Wait for VBLANK. */
- VerticalRetraceWait();
- /* Fire up streams! */
- VGAOUT16( vgaCRIndex, (jStreamsControl << 8) | EXT_MISC_CTRL2 );
- /* These values specify brightness, contrast, saturation and hue. */
- OUTREG( SEC_STREAM_COLOR_CONVERT1, 0x0000C892 );
- OUTREG( SEC_STREAM_COLOR_CONVERT2, 0x00039F9A );
- OUTREG( SEC_STREAM_COLOR_CONVERT3, 0x01F1547E );
- }
- else if (info->chip.arch == S3_SAVAGE2000)
- {
-// SavageInitStreams2000( pScrn );
-
- jStreamsControl = VGAIN8( vgaCRReg ) | ENABLE_STREAM1;
-
- /* Wait for VBLANK. */
- VerticalRetraceWait();
- /* Fire up streams! */
- VGAOUT16( vgaCRIndex, (jStreamsControl << 8) | EXT_MISC_CTRL2 );
- /* These values specify brightness, contrast, saturation and hue. */
- OUTREG( SEC_STREAM_COLOR_CONVERT0_2000, 0x0000C892 );
- OUTREG( SEC_STREAM_COLOR_CONVERT1_2000, 0x00033400 );
- OUTREG( SEC_STREAM_COLOR_CONVERT2_2000, 0x000001CF );
- OUTREG( SEC_STREAM_COLOR_CONVERT3_2000, 0x01F1547E );
- }
- else
- {
- jStreamsControl = VGAIN8( vgaCRReg ) | ENABLE_STREAMS_OLD;
-
- /* Wait for VBLANK. */
-
- VerticalRetraceWait();
-
- /* Fire up streams! */
-
- VGAOUT16( vgaCRIndex, (jStreamsControl << 8) | EXT_MISC_CTRL2 );
-
- SavageInitStreamsOld( );
- }
-
- /* Wait for VBLANK. */
-
- VerticalRetraceWait();
-
- /* Turn on secondary stream TV flicker filter, once we support TV. */
-
- /* SR70 |= 0x10 */
-
- info->videoFlags |= VF_STREAMS_ON;
-
-}
-
-
-
-
-static void savage_getscreenproperties(struct savage_info *info){
- unsigned char bpp=0;
- /* uint32_t width=0; unused */
-
- uint32_t vgaIOBase, vgaCRIndex, vgaCRReg;
-
- vgaIOBase = 0x3d0;
- vgaCRIndex = vgaIOBase + 4;
- vgaCRReg = vgaIOBase + 5;
-
-
- /* a little reversed from x driver source code */
- VGAOUT8(vgaCRIndex, 0x67);
- bpp = VGAIN8(vgaCRReg);
-
-
- switch (bpp&0xf0) {
- case 0x00:
- case 0x10:
- info->depth=8;
- info->bpp=8;
- break;
- case 0x20:
- case 0x30:
- info->depth=15;
- info->bpp=16;
- break;
- case 0x40:
- case 0x50:
- info->depth=16;
- info->bpp=16;
- break;
- case 0x70:
- case 0xd0:
- info->depth=24;
- info->bpp=32;
- break;
-
-
- }
-
-
- VGAOUT8(vgaCRIndex, 0x1);
- info->screen_x = (1 + VGAIN8(vgaCRReg)) <<3;
- /*get screen height*/
- /* get first 8 bits in VT_DISPLAY_END*/
- VGAOUT8(0x03D4, 0x12);
- info->screen_y = VGAIN8(0x03D5);
- VGAOUT8(0x03D4,0x07);
- /* get 9th bit in CRTC_OVERFLOW*/
- info->screen_y |= (VGAIN8(0x03D5) &0x02)<<7;
- /* and the 10th in CRTC_OVERFLOW*/
- info->screen_y |=(VGAIN8(0x03D5) &0x40)<<3;
- ++info->screen_y;
-
- printf("screen_x = %d, screen_y = %d, bpp = %d\n",info->screen_x,info->screen_y,info->bpp);
-}
-
-
-static void SavageStreamsOff()
-{
- unsigned char jStreamsControl;
- unsigned short vgaCRIndex = 0x3d0 + 4;
- unsigned short vgaCRReg = 0x3d0 + 5;
-
-
- /* Unlock extended registers. */
-
- VGAOUT16(vgaCRIndex, 0x4838);
- VGAOUT16(vgaCRIndex, 0xa039);
- VGAOUT16(0x3c4, 0x0608);
-
- VGAOUT8( vgaCRIndex, EXT_MISC_CTRL2 );
- if( S3_SAVAGE_MOBILE_SERIES(info->chip.arch) ||
- (info->chip.arch == S3_SUPERSAVAGE) ||
- (info->chip.arch == S3_SAVAGE2000) )
- jStreamsControl = VGAIN8( vgaCRReg ) & NO_STREAMS;
- else
- jStreamsControl = VGAIN8( vgaCRReg ) & NO_STREAMS_OLD;
-
- /* Wait for VBLANK. */
-
- VerticalRetraceWait();
-
- /* Kill streams. */
-
- VGAOUT16(vgaCRIndex, (jStreamsControl << 8) | EXT_MISC_CTRL2 );
-
- VGAOUT16(vgaCRIndex, 0x0093 );
- VGAOUT8( vgaCRIndex, 0x92 );
- VGAOUT8( vgaCRReg, VGAIN8(vgaCRReg) & 0x40 );
-
- info->videoFlags &= ~VF_STREAMS_ON;
-}
-
-
-/**
- * @brief Check age of driver.
- *
- * @return vidix version number.
- */
-unsigned int
-vixGetVersion (void)
-{
- return (VIDIX_VERSION);
-}
-
-/**
- * @brief Find chip index in Unichrome compliant devices list.
- *
- * @param chip_id PCI device ID.
- *
- * @returns index position in savage_card_ids if successful.
- * -1 if chip_id is not a compliant chipset ID.
- */
-
-static int find_chip(unsigned chip_id){
- unsigned i;
- for(i = 0;i < sizeof(savage_card_ids)/sizeof(struct savage_cards);i++)
- {
- if(chip_id == savage_card_ids[i].chip_id)return i;
- }
- return -1;
-}
-
-/**
- * @brief Probe hardware to find some useable chipset.
- *
- * @param verbose specifies verbose level.
- * @param force specifies force mode : driver should ignore
- * device_id (danger but useful for new devices)
- *
- * @returns 0 if it can handle something in PC.
- * a negative error code otherwise.
- */
-
-int vixProbe(int verbose, int force){
- pciinfo_t lst[MAX_PCI_DEVICES];
- unsigned i,num_pci;
- int err;
-
- if (force)
- printf("[savage_vid]: warning: forcing not supported yet!\n");
- err = pci_scan(lst,&num_pci);
- if(err){
- printf("[savage_vid] Error occurred during pci scan: %s\n",strerror(err));
- return err;
- }
- else {
- err = ENXIO;
- for(i=0; i < num_pci; i++){
- if(lst[i].vendor == VENDOR_S3_INC) {
- int idx;
- const char *dname;
- idx = find_chip(lst[i].device);
- if(idx == -1)
- continue;
- dname = pci_device_name(lst[i].vendor, lst[i].device);
- dname = dname ? dname : "Unknown chip";
- printf("[savage_vid] Found chip: %s\n", dname);
- savage_cap.device_id = lst[i].device;
- err = 0;
- memcpy(&pci_info, &lst[i], sizeof(pciinfo_t));
- break;
- }
- }
- }
- if(err && verbose) printf("[savage_vid] Can't find chip\n");
- return err;
-}
-
-/**
- * @brief Initializes driver.
- *
- * @returns 0 if ok.
- * a negative error code otherwise.
- */
-int
-vixInit (const char *args)
-{
- int mtrr;
- unsigned char config1, /* m, n, n1, n2, sr8, cr3f, cr66 = 0, */ tmp;
-
- static unsigned char RamSavage3D[] = { 8, 4, 4, 2 };
- static unsigned char RamSavage4[] = { 2, 4, 8, 12, 16, 32, 64, 32 };
- static unsigned char RamSavageMX[] = { 2, 8, 4, 16, 8, 16, 4, 16 };
- static unsigned char RamSavageNB[] = { 0, 2, 4, 8, 16, 32, 16, 2 };
-
- int videoRam /*, videoRambytes */;
-
- uint32_t vgaIOBase, vgaCRIndex, vgaCRReg ;
-
- unsigned char val;
-
- vgaIOBase = 0x3d0;
- vgaCRIndex = vgaIOBase + 4;
- vgaCRReg = vgaIOBase + 5;
-
- fprintf(stderr, "vixInit enter \n");
-// //getc(stdin);
-
- info = (savage_info*)calloc(1,sizeof(savage_info));
-
-
- /* need this if we want direct outb and inb access? */
- enable_app_io ();
-
- /* 12mb + 32kb ? */
- /* allocate some space for control registers */
- info->chip.arch = savage_card_ids[find_chip(pci_info.device)].arch;
-
- if (info->chip.arch == S3_SAVAGE3D) {
- info->control_base = map_phys_mem(pci_info.base0+SAVAGE_NEWMMIO_REGBASE_S3, SAVAGE_NEWMMIO_REGSIZE);
- }
- else {
- info->control_base = map_phys_mem(pci_info.base0+SAVAGE_NEWMMIO_REGBASE_S4, SAVAGE_NEWMMIO_REGSIZE);
- }
-
-// info->chip.PCIO = (uint8_t *) (info->control_base + SAVAGE_NEWMMIO_VGABASE);
-
- // FIXME: enable mmio?
- val = VGAIN8 (0x3c3);
- VGAOUT8 (0x3c3, val | 0x01);
- val = VGAIN8 (0x3cc);
- VGAOUT8 (0x3c2, val | 0x01);
-
- if (info->chip.arch >= S3_SAVAGE4)
- {
- VGAOUT8 (0x3d4, 0x40);
- val = VGAIN8 (0x3d5);
- VGAOUT8 (0x3d5, val | 1);
- }
-
-
-
- /* unprotect CRTC[0-7] */
- VGAOUT8(vgaCRIndex, 0x11);
- tmp = VGAIN8(vgaCRReg);
-// printf("$########## tmp = %d\n",tmp);
- VGAOUT8(vgaCRReg, tmp & 0x7f);
-
-
- /* unlock extended regs */
- VGAOUT16(vgaCRIndex, 0x4838);
- VGAOUT16(vgaCRIndex, 0xa039);
- VGAOUT16(0x3c4, 0x0608);
-
- VGAOUT8(vgaCRIndex, 0x40);
- tmp = VGAIN8(vgaCRReg);
- VGAOUT8(vgaCRReg, tmp & ~0x01);
-
- /* unlock sys regs */
- VGAOUT8(vgaCRIndex, 0x38);
- VGAOUT8(vgaCRReg, 0x48);
-
- /* Unlock system registers. */
- VGAOUT16(vgaCRIndex, 0x4838);
-
- /* Next go on to detect amount of installed ram */
-
- VGAOUT8(vgaCRIndex, 0x36); /* for register CR36 (CONFG_REG1), */
- config1 = VGAIN8(vgaCRReg); /* get amount of vram installed */
-
-
- switch( info->chip.arch ) {
- case S3_SAVAGE3D:
- videoRam = RamSavage3D[ (config1 & 0xC0) >> 6 ] * 1024;
- break;
-
- case S3_SAVAGE4:
- /*
- * The Savage4 has one ugly special case to consider. On
- * systems with 4 banks of 2Mx32 SDRAM, the BIOS says 4MB
- * when it really means 8MB. Why do it the same when you
- * can do it different...
- */
- VGAOUT8(0x3d4, 0x68); /* memory control 1 */
- if( (VGAIN8(0x3d5) & 0xC0) == (0x01 << 6) )
- RamSavage4[1] = 8;
-
- /*FALLTHROUGH*/
-
- case S3_SAVAGE2000:
- videoRam = RamSavage4[ (config1 & 0xE0) >> 5 ] * 1024;
- break;
-
- case S3_SAVAGE_MX:
- videoRam = RamSavageMX[ (config1 & 0x0E) >> 1 ] * 1024;
- break;
-
- case S3_PROSAVAGE:
- videoRam = RamSavageNB[ (config1 & 0xE0) >> 5 ] * 1024;
- break;
-
- default:
- /* How did we get here? */
- videoRam = 0;
- break;
- }
-
-
- printf("###### videoRam = %d\n",videoRam);
- info->chip.fbsize = videoRam * 1024;
-
-
- /* reset graphics engine to avoid memory corruption */
-#if 0
- VGAOUT8 (0x3d4, 0x66);
- cr66 = VGAIN8 (0x3d5);
- VGAOUT8 (0x3d5, cr66 | 0x02);
- udelay (10000);
-
- VGAOUT8 (0x3d4, 0x66);
- VGAOUT8 (0x3d5, cr66 & ~0x02); /* clear reset flag */
-#endif
- /* udelay (10000); */
-
- /* This maps framebuffer @6MB, thus 2MB are left for video. */
- if (info->chip.arch == S3_SAVAGE3D) {
- info->video_base = map_phys_mem(pci_info.base0, info->chip.fbsize);
- info->picture_offset = 1024*768* 4 * ((info->chip.fbsize > 4194304)?2:1);
- }
- else {
- info->video_base = map_phys_mem(pci_info.base1, info->chip.fbsize);
- info->picture_offset = info->chip.fbsize - FRAMEBUFFER_SIZE;
-// info->picture_offset = 1024*1024* 4 * 2;
- }
- if ( info->video_base < 0 ){
- printf("errno = %s\n", strerror(errno));
- return -1;
- }
-
-
- info->picture_base = (uint32_t) info->video_base + info->picture_offset;
-
- if ( info->chip.arch == S3_SAVAGE3D ){
- mtrr = mtrr_set_type(pci_info.base0, info->chip.fbsize, MTRR_TYPE_WRCOMB);
- }
- else{
- mtrr = mtrr_set_type(pci_info.base1, info->chip.fbsize, MTRR_TYPE_WRCOMB);
- }
-
- if (mtrr!= 0)
- printf("[savage_vid] unable to setup MTRR: %s\n", strerror(mtrr));
- else
- printf("[savage_vid] MTRR set up\n");
-
- /* This may trash your screen for resolutions greater than 1024x768, sorry. */
-
-
- savage_getscreenproperties(info);
-// return -1;
- info->videoFlags = 0;
-
- SavageStreamsOn();
- //getc(stdin);
- //FIXME ADD
- return 0;
-}
-
-/**
- * @brief Destroys driver.
- */
-void
-vixDestroy (void)
-{
- unmap_phys_mem(info->video_base, info->chip.fbsize);
- unmap_phys_mem(info->control_base, SAVAGE_NEWMMIO_REGSIZE);
- //FIXME ADD
-}
-
-/**
- * @brief Get chipset's hardware capabilities.
- *
- * @param to Pointer to the vidix_capability_t structure to be filled.
- *
- * @returns 0.
- */
-int
-vixGetCapability (vidix_capability_t * to)
-{
- memcpy (to, &savage_cap, sizeof (vidix_capability_t));
- return 0;
-}
-
-/**
- * @brief Report if the video FourCC is supported by hardware.
- *
- * @param fourcc input image format.
- *
- * @returns 1 if the fourcc is supported.
- * 0 otherwise.
- */
-static int
-is_supported_fourcc (uint32_t fourcc)
-{
- switch (fourcc)
- {
-//FIXME: YV12 isnt working properly yet
-// case IMGFMT_YV12:
-// case IMGFMT_I420:
- case IMGFMT_UYVY:
- case IMGFMT_YVYU:
- case IMGFMT_YUY2:
- case IMGFMT_RGB15:
- case IMGFMT_RGB16:
-// case IMGFMT_BGR32:
- return 1;
- default:
- return 0;
- }
-}
-
-/**
- * @brief Try to configure video memory for given fourcc.
- *
- * @param to Pointer to the vidix_fourcc_t structure to be filled.
- *
- * @returns 0 if ok.
- * errno otherwise.
- */
-int
-vixQueryFourcc (vidix_fourcc_t * to)
-{
- if (is_supported_fourcc (to->fourcc))
- {
- to->depth = VID_DEPTH_1BPP | VID_DEPTH_2BPP |
- VID_DEPTH_4BPP | VID_DEPTH_8BPP |
- VID_DEPTH_12BPP | VID_DEPTH_15BPP |
- VID_DEPTH_16BPP | VID_DEPTH_24BPP | VID_DEPTH_32BPP;
- to->flags = VID_CAP_EXPAND | VID_CAP_SHRINK | VID_CAP_COLORKEY;
- return 0;
- }
- else
- to->depth = to->flags = 0;
-
- return ENOSYS;
-}
-
-/**
- * @brief Get the GrKeys
- *
- * @param grkey Pointer to the vidix_grkey_t structure to be filled by driver.
- *
- * @return 0.
- */
-/*int
-vixGetGrKeys (vidix_grkey_t * grkey)
-{
-
-// if(info->d_width && info->d_height)savage_overlay_start(info,0);
-
- return (0);
-}
- * */
-
-/**
- * @brief Set the GrKeys
- *
- * @param grkey Colorkey to be set.
- *
- * @return 0.
- */
-int
-vixSetGrKeys (const vidix_grkey_t * grkey)
-{
- if (grkey->ckey.op == CKEY_FALSE)
- {
- info->use_colorkey = 0;
- info->vidixcolorkey=0;
- printf("[savage_vid] colorkeying disabled\n");
- }
- else {
- info->use_colorkey = 1;
- info->vidixcolorkey = ((grkey->ckey.red<<16)|(grkey->ckey.green<<8)|grkey->ckey.blue);
-
- printf("[savage_vid] set colorkey 0x%x\n",info->vidixcolorkey);
- }
- //FIXME: freezes if streams arent enabled
- SavageSetColorKeyOld();
- return (0);
-}
-
-/**
- * @brief Unichrome driver equalizer capabilities.
- */
-vidix_video_eq_t equal = {
- VEQ_CAP_BRIGHTNESS | VEQ_CAP_SATURATION | VEQ_CAP_HUE,
- 300, 100, 0, 0, 0, 0, 0, 0
-};
-
-
-/**
- * @brief Get the equalizer capabilities.
- *
- * @param eq Pointer to the vidix_video_eq_t structure to be filled by driver.
- *
- * @return 0.
- */
-int
-vixPlaybackGetEq (vidix_video_eq_t * eq)
-{
- memcpy (eq, &equal, sizeof (vidix_video_eq_t));
- return 0;
-}
-
-/**
- * @brief Set the equalizer capabilities for color correction
- *
- * @param eq equalizer capabilities to be set.
- *
- * @return 0.
- */
-int
-vixPlaybackSetEq (const vidix_video_eq_t * eq)
-{
- return 0;
-}
-
-/**
- * @brief Y, U, V offsets.
- */
-/* static int YOffs, UOffs, VOffs; */
-
-/**
- * @brief Configure driver for playback. Driver should prepare BES.
- *
- * @param info configuration description for playback.
- *
- * @returns 0 in case of success.
- * -1 otherwise.
- */
-int
-vixConfigPlayback (vidix_playback_t * vinfo)
-{
- int uv_size, swap_uv;
- unsigned int i;
-#if 0
- int extfifo_on;
- int srcPitch,srcPitch2;
-
- /* Overlay register settings */
- uint32_t win_start, win_end;
- uint32_t zoom, mini;
- uint32_t dcount, falign, qwfetch;
- uint32_t y_start, u_start, v_start;
- uint32_t v_ctrl, fifo_ctrl;
-#endif
-
- if (!is_supported_fourcc (vinfo->fourcc))
- return -1;
-
-
-
- info->src_w = vinfo->src.w;
- info->src_h = vinfo->src.h;
-
- info->drw_w = vinfo->dest.w;
- info->drw_h = vinfo->dest.h;
-
- info->wx = vinfo->dest.x;
- info->wy = vinfo->dest.y;
- info->format = vinfo->fourcc;
-
- info->lastKnownPitch = 0;
- info->brightness = 0;
- info->contrast = 128;
- info->saturation = 128;
- info->hue = 0;
-
-
- vinfo->dga_addr=(void*)(info->picture_base);
-
-
- vinfo->offset.y = 0;
- vinfo->offset.v = 0;
- vinfo->offset.u = 0;
-
- vinfo->dest.pitch.y = 32;
- vinfo->dest.pitch.u = 32;
- vinfo->dest.pitch.v = 32;
- // vinfo->dest.pitch.u = 0;
- // vinfo->dest.pitch.v = 0;
-
-
- info->pitch = ((info->src_w << 1) + 15) & ~15;
-
- swap_uv = 0;
- switch (vinfo->fourcc)
- {
- case IMGFMT_YUY2:
- case IMGFMT_UYVY:
-
- info->pitch = ((info->src_w << 1) + (vinfo->dest.pitch.y-1)) & ~(vinfo->dest.pitch.y-1);
-
- info->pitch = info->src_w << 1;
- info->pitch = ALIGN_TO (info->src_w << 1, 32);
- uv_size = 0;
- break;
- case IMGFMT_YV12:
- swap_uv = 1;
-
-
-
- /*
- srcPitch = (info->src_w + 3) & ~3;
- vinfo->offset.u = srcPitch * info->src_h;
- srcPitch2 = ((info->src_w >> 1) + 3) & ~3;
- vinfo->offset.v = (srcPitch2 * (info->src_h >> 1)) + vinfo->offset.v;
-
- vinfo->dest.pitch.y=srcPitch ;
- vinfo->dest.pitch.v=srcPitch2 ;
- vinfo->dest.pitch.u=srcPitch2 ;
- */
-
-
- info->pitch = ALIGN_TO (info->src_w, 32);
- uv_size = (info->pitch >> 1) * (info->src_h >> 1);
-
- vinfo->offset.y = 0;
- vinfo->offset.v = vinfo->offset.y + info->pitch * info->src_h;
- vinfo->offset.u = vinfo->offset.v + uv_size;
- vinfo->frame_size = vinfo->offset.u + uv_size;
-/* YOffs = info->offset.y;
- UOffs = (swap_uv ? vinfo->offset.v : vinfo->offset.u);
- VOffs = (swap_uv ? vinfo->offset.u : vinfo->offset.v);
- */
-// vinfo->offset.y = info->src_w;
-// vinfo->offset.v = vinfo->offset.y + info->src_w /2 * info->src_h;
-// vinfo->offset.u = vinfo->offset.v + (info->src_w >> 1) * (info->src_h >> 1) ;
-
- break;
- }
- info->pitch |= ((info->pitch >> 1) << 16);
-
- vinfo->frame_size = info->pitch * info->src_h;
-
- printf("$#### destination pitch = %u\n", info->pitch&0xffff);
-
-
-
-
- info->buffer_size = vinfo->frame_size;
- info->num_frames = vinfo->num_frames= (info->chip.fbsize - info->picture_offset)/vinfo->frame_size;
- if(vinfo->num_frames > MAX_FRAMES)vinfo->num_frames = MAX_FRAMES;
-// vinfo->num_frames = 1;
-// printf("[nvidia_vid] Number of frames %i\n",vinfo->num_frames);
- for(i=0;i <vinfo->num_frames;i++)vinfo->offsets[i] = vinfo->frame_size*i;
-
- return 0;
-}
-
-/**
- * @brief Set playback on : driver should activate BES on this call.
- *
- * @return 0.
- */
-int
-vixPlaybackOn (void)
-{
- // FIXME: enable
- SavageDisplayVideoOld();
-//FIXME ADD
- return 0;
-}
-
-/**
- * @brief Set playback off : driver should deactivate BES on this call.
- *
- * @return 0.
- */
-int
-vixPlaybackOff (void)
-{
- // otherwise we wont disable streams properly in new xorg
- // FIXME: shouldnt this be enabled?
-// SavageStreamsOn();
- SavageStreamsOff();
-// info->vidixcolorkey=0x0;
-
-// OUTREG( SSTREAM_WINDOW_START_REG, OS_XY(0xfffe, 0xfffe) );
-// SavageSetColorKeyOld();
-//FIXME ADD
- return 0;
-}
-
-/**
- * @brief Driver should prepare and activate corresponded frame.
- *
- * @param frame the frame index.
- *
- * @return 0.
- *
- * @note This function is used only for double and triple buffering
- * and never used for single buffering playback.
- */
-#if 0
-int
-vixPlaybackFrameSelect (unsigned int frame)
-{
-////FIXME ADD
-// savage_overlay_start(info, frame);
- //if (info->num_frames >= 1)
-// info->cur_frame = frame//(frame+1)%info->num_frames;
-//
-// savage4_waitidle(info);
-
- printf("vixPlaybackFrameSelect Leave\n" );
- // FIXME: does this work to avoid tearing?
-// VerticalRetraceWait();
-
- return 0;
-}
-
-#endif
-
-
-
-void debugout(unsigned int addr, unsigned int val){
- return ;
- switch ( addr ){
- case PSTREAM_CONTROL_REG:
- fprintf(stderr,"PSTREAM_CONTROL_REG");
- break;
- case COL_CHROMA_KEY_CONTROL_REG:
- fprintf(stderr,"COL_CHROMA_KEY_CONTROL_REG");
- break;
- case SSTREAM_CONTROL_REG:
- fprintf(stderr,"SSTREAM_CONTROL_REG");
- break;
- case CHROMA_KEY_UPPER_BOUND_REG:
- fprintf(stderr,"CHROMA_KEY_UPPER_BOUND_REG");
- break;
- case SSTREAM_STRETCH_REG:
- fprintf(stderr,"SSTREAM_STRETCH_REG");
- break;
- case COLOR_ADJUSTMENT_REG:
- fprintf(stderr,"COLOR_ADJUSTMENT_REG");
- break;
- case BLEND_CONTROL_REG:
- fprintf(stderr,"BLEND_CONTROL_REG");
- break;
- case PSTREAM_FBADDR0_REG:
- fprintf(stderr,"PSTREAM_FBADDR0_REG");
- break;
- case PSTREAM_FBADDR1_REG:
- fprintf(stderr,"PSTREAM_FBADDR1_REG");
- break;
- case PSTREAM_STRIDE_REG:
- fprintf(stderr,"PSTREAM_STRIDE_REG");
- break;
- case DOUBLE_BUFFER_REG:
- fprintf(stderr,"DOUBLE_BUFFER_REG");
- break;
- case SSTREAM_FBADDR0_REG:
- fprintf(stderr,"SSTREAM_FBADDR0_REG");
- break;
- case SSTREAM_FBADDR1_REG:
- fprintf(stderr,"SSTREAM_FBADDR1_REG");
- break;
- case SSTREAM_STRIDE_REG:
- fprintf(stderr,"SSTREAM_STRIDE_REG");
- break;
- case SSTREAM_VSCALE_REG:
- fprintf(stderr,"SSTREAM_VSCALE_REG");
- break;
- case SSTREAM_VINITIAL_REG:
- fprintf(stderr,"SSTREAM_VINITIAL_REG");
- break;
- case SSTREAM_LINES_REG:
- fprintf(stderr,"SSTREAM_LINES_REG");
- break;
- case STREAMS_FIFO_REG:
- fprintf(stderr,"STREAMS_FIFO_REG");
- break;
- case PSTREAM_WINDOW_START_REG:
- fprintf(stderr,"PSTREAM_WINDOW_START_REG");
- break;
- case PSTREAM_WINDOW_SIZE_REG:
- fprintf(stderr,"PSTREAM_WINDOW_SIZE_REG");
- break;
- case SSTREAM_WINDOW_START_REG:
- fprintf(stderr,"SSTREAM_WINDOW_START_REG");
- break;
- case SSTREAM_WINDOW_SIZE_REG:
- fprintf(stderr,"SSTREAM_WINDOW_SIZE_REG");
- break;
- case FIFO_CONTROL:
- fprintf(stderr,"FIFO_CONTROL");
- break;
- case PSTREAM_FBSIZE_REG:
- fprintf(stderr,"PSTREAM_FBSIZE_REG");
- break;
- case SSTREAM_FBSIZE_REG:
- fprintf(stderr,"SSTREAM_FBSIZE_REG");
- break;
- case SSTREAM_FBADDR2_REG:
- fprintf(stderr,"SSTREAM_FBADDR2_REG");
- break;
-
- }
- fprintf(stderr,":\t\t 0x%08X = %u\n",val,val);
-}
-
-
-
diff --git a/src/video_out/vidix/drivers/sis_bridge.c b/src/video_out/vidix/drivers/sis_bridge.c
deleted file mode 100644
index f6916ae87..000000000
--- a/src/video_out/vidix/drivers/sis_bridge.c
+++ /dev/null
@@ -1,835 +0,0 @@
-/**
- Video bridge detection for SiS 300 and 310/325 series chips.
-
- Copyright 2003 Jake Page, Sugar Media.
-
- Based on SiS Xv driver:
- Copyright 2002-2003 by Thomas Winischhofer, Vienna, Austria.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-**/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include "libdha.h"
-
-#include "sis_regs.h"
-#include "sis_defs.h"
-
-void sis_init_video_bridge(void);
-
-static void sis_ddc2_delay(unsigned short delaytime)
-{
- unsigned short i;
- int temp;
-
- for (i = 0; i < delaytime; i++) {
- inSISIDXREG(SISSR, 0x05, temp);
- }
-}
-
-
-static int sis_do_sense(int tempbl, int tempbh, int tempcl, int tempch)
-{
- int temp;
-
- outSISIDXREG(SISPART4, 0x11, tempbl);
- temp = tempbh | tempcl;
- setSISIDXREG(SISPART4, 0x10, 0xe0, temp);
- //usleep(200000);
- sis_ddc2_delay(0x1000);
- tempch &= 0x7f;
- inSISIDXREG(SISPART4, 0x03, temp);
- temp ^= 0x0e;
- temp &= tempch;
- return (temp == tempch);
-}
-
-
-/* sense connected devices on 30x bridge */
-static void sis_sense_30x()
-{
- unsigned char backupP4_0d, backupP2_00, biosflag;
- unsigned char testsvhs_tempbl, testsvhs_tempbh;
- unsigned char testsvhs_tempcl, testsvhs_tempch;
- unsigned char testcvbs_tempbl, testcvbs_tempbh;
- unsigned char testcvbs_tempcl, testcvbs_tempch;
- unsigned char testvga2_tempbl, testvga2_tempbh;
- unsigned char testvga2_tempcl, testvga2_tempch;
- int myflag, result = 0, i, j, haveresult;
-#if 0
- unsigned short temp;
-#endif
-
- inSISIDXREG(SISPART4, 0x0d, backupP4_0d);
- outSISIDXREG(SISPART4, 0x0d, (backupP4_0d | 0x04));
-
- inSISIDXREG(SISPART2, 0x00, backupP2_00);
- outSISIDXREG(SISPART2, 0x00, (backupP2_00 | 0x1c));
-
- sis_do_sense(0, 0, 0, 0);
-
- if ((sis_vga_engine == SIS_315_VGA) ||
- (sis_device_id == DEVICE_SIS_300)) {
-#if 0
- if (0 /*pSiS->sishw_ext.UseROM */ ) {
- if (sis_vga_engine == SIS_300_VGA)
- temp = 0xfe;
- else {
- temp = 0xf3;
- if (sis_device_id == DEVICE_SIS_330)
- temp = 0x11b;
- }
- if (pSiS->BIOS[temp] & 0x08) {
- if (sis_verbose > 1) {
- printf
- ("[SiS] SiS30x: Video bridge has DVI-I TMDS/VGA combo connector\n");
- }
- orSISIDXREG(SISCR, 0x32, 0x80);
- } else {
- andSISIDXREG(SISCR, 0x32, 0x7f);
- }
- }
-#endif
- }
-
- if (sis_vga_engine == SIS_300_VGA) {
- if (0 /*pSiS->sishw_ext.UseROM */ ) {
-#if 0
- testvga2_tempbh = pSiS->BIOS[0xf9];
- testvga2_tempbl = pSiS->BIOS[0xf8];
- testsvhs_tempbh = pSiS->BIOS[0xfb];
- testsvhs_tempbl = pSiS->BIOS[0xfa];
- testcvbs_tempbh = pSiS->BIOS[0xfd];
- testcvbs_tempbl = pSiS->BIOS[0xfc];
- biosflag = pSiS->BIOS[0xfe];
-#endif
- } else {
- testvga2_tempbh = 0x00;
- testvga2_tempbl = 0xd1;
- testsvhs_tempbh = 0x00;
- testsvhs_tempbl = 0xb9;
- testcvbs_tempbh = 0x00;
- testcvbs_tempbl = 0xb3;
- biosflag = 0;
- }
- if (sis_vbflags & (VB_301B | VB_302B | VB_301LV | VB_302LV)) {
- testvga2_tempbh = 0x01;
- testvga2_tempbl = 0x90;
- testsvhs_tempbh = 0x01;
- testsvhs_tempbl = 0x6b;
- testcvbs_tempbh = 0x01;
- testcvbs_tempbl = 0x74;
- }
- inSISIDXREG(SISPART4, 0x01, myflag);
- if (myflag & 0x04) {
- testvga2_tempbh = 0x00;
- testvga2_tempbl = 0xfd;
- testsvhs_tempbh = 0x00;
- testsvhs_tempbl = 0xdd;
- testcvbs_tempbh = 0x00;
- testcvbs_tempbl = 0xee;
- }
- testvga2_tempch = 0x0e;
- testvga2_tempcl = 0x08;
- testsvhs_tempch = 0x06;
- testsvhs_tempcl = 0x04;
- testcvbs_tempch = 0x08;
- testcvbs_tempcl = 0x04;
-
- if (sis_device_id == DEVICE_SIS_300) {
- inSISIDXREG(SISSR, 0x3b, myflag);
- if (!(myflag & 0x01)) {
- testvga2_tempbh = 0x00;
- testvga2_tempbl = 0x00;
- testvga2_tempch = 0x00;
- testvga2_tempcl = 0x00;
- }
- }
- } else {
- if (0 /*pSiS->sishw_ext.UseROM */ ) {
-#if 0
- if (sis_device_id == DEVICE_SIS_330) {
- testvga2_tempbh = pSiS->BIOS[0xe6];
- testvga2_tempbl = pSiS->BIOS[0xe5];
- testsvhs_tempbh = pSiS->BIOS[0xe8];
- testsvhs_tempbl = pSiS->BIOS[0xe7];
- testcvbs_tempbh = pSiS->BIOS[0xea];
- testcvbs_tempbl = pSiS->BIOS[0xe9];
- biosflag = pSiS->BIOS[0x11b];
- } else {
- testvga2_tempbh = pSiS->BIOS[0xbe];
- testvga2_tempbl = pSiS->BIOS[0xbd];
- testsvhs_tempbh = pSiS->BIOS[0xc0];
- testsvhs_tempbl = pSiS->BIOS[0xbf];
- testcvbs_tempbh = pSiS->BIOS[0xc2];
- testcvbs_tempbl = pSiS->BIOS[0xc1];
- biosflag = pSiS->BIOS[0xf3];
- }
-#endif
- } else {
- testvga2_tempbh = 0x00;
- testvga2_tempbl = 0xd1;
- testsvhs_tempbh = 0x00;
- testsvhs_tempbl = 0xb9;
- testcvbs_tempbh = 0x00;
- testcvbs_tempbl = 0xb3;
- biosflag = 0;
- }
-
- if (sis_vbflags & (VB_301B | VB_302B | VB_301LV | VB_302LV)) {
- if (0 /*pSiS->sishw_ext.UseROM */ ) {
-#if 0
- if (sis_device_id == DEVICE_SIS_330) {
- testvga2_tempbh = pSiS->BIOS[0xec];
- testvga2_tempbl = pSiS->BIOS[0xeb];
- testsvhs_tempbh = pSiS->BIOS[0xee];
- testsvhs_tempbl = pSiS->BIOS[0xed];
- testcvbs_tempbh = pSiS->BIOS[0xf0];
- testcvbs_tempbl = pSiS->BIOS[0xef];
- } else {
- testvga2_tempbh = pSiS->BIOS[0xc4];
- testvga2_tempbl = pSiS->BIOS[0xc3];
- testsvhs_tempbh = pSiS->BIOS[0xc6];
- testsvhs_tempbl = pSiS->BIOS[0xc5];
- testcvbs_tempbh = pSiS->BIOS[0xc8];
- testcvbs_tempbl = pSiS->BIOS[0xc7];
- }
-#endif
- } else {
- if (sis_vbflags & (VB_301B | VB_302B)) {
- testvga2_tempbh = 0x01;
- testvga2_tempbl = 0x90;
- testsvhs_tempbh = 0x01;
- testsvhs_tempbl = 0x6b;
- testcvbs_tempbh = 0x01;
- testcvbs_tempbl = 0x74;
- } else {
- testvga2_tempbh = 0x00;
- testvga2_tempbl = 0x00;
- testsvhs_tempbh = 0x02;
- testsvhs_tempbl = 0x00;
- testcvbs_tempbh = 0x01;
- testcvbs_tempbl = 0x00;
- }
- }
- }
- if (sis_vbflags & (VB_301 | VB_301B | VB_302B)) {
- inSISIDXREG(SISPART4, 0x01, myflag);
- if (myflag & 0x04) {
- testvga2_tempbh = 0x00;
- testvga2_tempbl = 0xfd;
- testsvhs_tempbh = 0x00;
- testsvhs_tempbl = 0xdd;
- testcvbs_tempbh = 0x00;
- testcvbs_tempbl = 0xee;
- }
- }
- if (sis_vbflags & (VB_301LV | VB_302LV)) {
- /* TW: No VGA2 or SCART on LV bridges */
- testvga2_tempbh = 0x00;
- testvga2_tempbl = 0x00;
- testvga2_tempch = 0x00;
- testvga2_tempcl = 0x00;
- testsvhs_tempch = 0x04;
- testsvhs_tempcl = 0x08;
- testcvbs_tempch = 0x08;
- testcvbs_tempcl = 0x08;
- } else {
- testvga2_tempch = 0x0e;
- testvga2_tempcl = 0x08;
- testsvhs_tempch = 0x06;
- testsvhs_tempcl = 0x04;
- testcvbs_tempch = 0x08;
- testcvbs_tempcl = 0x04;
- }
- }
-
- /* XXX: ?? andSISIDXREG(SISCR, 0x32, ~0x14); */
- /* pSiS->postVBCR32 &= ~0x14; */
-
- /* scan for VGA2/SCART */
- if (testvga2_tempch || testvga2_tempcl ||
- testvga2_tempbh || testvga2_tempbl) {
-
- haveresult = 0;
- for (j = 0; j < 10; j++) {
- result = 0;
- for (i = 0; i < 3; i++) {
- if (sis_do_sense(testvga2_tempbl, testvga2_tempbh,
- testvga2_tempcl, testvga2_tempch))
- result++;
- }
- if ((result == 0) || (result >= 2))
- break;
- }
- if (result) {
- if (biosflag & 0x01) {
- if (sis_verbose > 1) {
- printf
- ("[SiS] SiS30x: Detected TV connected to SCART output\n");
- }
- sis_vbflags |= TV_SCART;
- orSISIDXREG(SISCR, 0x32, 0x04);
- /*pSiS->postVBCR32 |= 0x04; */
- } else {
- if (sis_verbose > 1) {
- printf
- ("[SiS] SiS30x: Detected secondary VGA connection\n");
- }
- sis_vbflags |= VGA2_CONNECTED;
- orSISIDXREG(SISCR, 0x32, 0x10);
- /*pSiS->postVBCR32 |= 0x10; */
- }
- }
- }
-
- /* scanning for TV */
-
- /* XXX: ?? andSISIDXREG(SISCR, 0x32, ~0x03); */
- /* pSiS->postVBCR32 &= ~0x03; */
-
- result = sis_do_sense(testsvhs_tempbl, testsvhs_tempbh,
- testsvhs_tempcl, testsvhs_tempch);
-
-
- haveresult = 0;
- for (j = 0; j < 10; j++) {
- result = 0;
- for (i = 0; i < 3; i++) {
- if (sis_do_sense(testsvhs_tempbl, testsvhs_tempbh,
- testsvhs_tempcl, testsvhs_tempch))
- result++;
- }
- if ((result == 0) || (result >= 2))
- break;
- }
- if (result) {
- if (sis_verbose > 1) {
- printf
- ("[SiS] SiS30x: Detected TV connected to SVIDEO output\n");
- }
- /* TW: So we can be sure that there IS a SVIDEO output */
- sis_vbflags |= TV_SVIDEO;
- orSISIDXREG(SISCR, 0x32, 0x02);
- //pSiS->postVBCR32 |= 0x02;
- }
-
- if ((biosflag & 0x02) || (!(result))) {
- haveresult = 0;
- for (j = 0; j < 10; j++) {
- result = 0;
- for (i = 0; i < 3; i++) {
- if (sis_do_sense(testcvbs_tempbl, testcvbs_tempbh,
- testcvbs_tempcl, testcvbs_tempch))
- result++;
- }
- if ((result == 0) || (result >= 2))
- break;
- }
- if (result) {
- if (sis_verbose > 1) {
- printf
- ("[SiS] SiS30x: Detected TV connected to COMPOSITE output\n");
- }
- sis_vbflags |= TV_AVIDEO;
- orSISIDXREG(SISCR, 0x32, 0x01);
- //pSiS->postVBCR32 |= 0x01;
- }
- }
-
- sis_do_sense(0, 0, 0, 0);
-
- outSISIDXREG(SISPART2, 0x00, backupP2_00);
- outSISIDXREG(SISPART4, 0x0d, backupP4_0d);
-}
-
-
-static void sis_detect_crt1()
-{
- unsigned char CR32;
- unsigned char CRT1Detected = 0;
- unsigned char OtherDevices = 0;
-
- if (!(sis_vbflags & VB_VIDEOBRIDGE)) {
- sis_crt1_off = 0;
- return;
- }
-
- inSISIDXREG(SISCR, 0x32, CR32);
-
- if (CR32 & 0x20)
- CRT1Detected = 1;
- if (CR32 & 0x5F)
- OtherDevices = 1;
-
- if (sis_crt1_off == -1) {
- if (!CRT1Detected) {
- /* BIOS detected no CRT1. */
- /* If other devices exist, switch it off */
- if (OtherDevices)
- sis_crt1_off = 1;
- else
- sis_crt1_off = 0;
- } else {
- /* BIOS detected CRT1, leave/switch it on */
- sis_crt1_off = 0;
- }
- }
- if (sis_verbose > 0) {
- printf("[SiS] %sCRT1 connection detected\n",
- sis_crt1_off ? "No " : "");
- }
-}
-
-#if 0 /* not used yet */
-static void sis_detect_lcd()
-{
- unsigned char CR32;
-#if 0
- /* not supported yet? */
- unsigned char CR36, CR37;
-#endif
-
- if (!(sis_vbflags & VB_VIDEOBRIDGE)) {
- return;
- }
-
- inSISIDXREG(SISCR, 0x32, CR32);
-
- if (CR32 & 0x08)
- sis_vbflags |= CRT2_LCD;
-
- /* DDC detection of LCD - not supported yet */
-
- /* Get other misc info about LCD - not supported */
-}
-#endif
-
-static void sis_detect_tv()
-{
- unsigned char SR16, SR38, CR32, CR38 = 0, CR79;
- int temp = 0;
-
- if (!(sis_vbflags & VB_VIDEOBRIDGE))
- return;
-
- inSISIDXREG(SISCR, 0x32, CR32);
- inSISIDXREG(SISSR, 0x16, SR16);
- inSISIDXREG(SISSR, 0x38, SR38);
- switch (sis_vga_engine) {
- case SIS_300_VGA:
- if (sis_device_id == DEVICE_SIS_630_VGA)
- temp = 0x35;
- break;
- case SIS_315_VGA:
- temp = 0x38;
- break;
- }
- if (temp) {
- inSISIDXREG(SISCR, temp, CR38);
- }
-
- if (CR32 & 0x47)
- sis_vbflags |= CRT2_TV;
-
- if (CR32 & 0x04)
- sis_vbflags |= TV_SCART;
- else if (CR32 & 0x02)
- sis_vbflags |= TV_SVIDEO;
- else if (CR32 & 0x01)
- sis_vbflags |= TV_AVIDEO;
- else if (CR32 & 0x40)
- sis_vbflags |= (TV_SVIDEO | TV_HIVISION);
- else if ((CR38 & 0x04) && (sis_vbflags & (VB_301LV | VB_302LV)))
- sis_vbflags |= TV_HIVISION_LV;
- else if ((CR38 & 0x04) && (sis_vbflags & VB_CHRONTEL))
- sis_vbflags |= (TV_CHSCART | TV_PAL);
- else if ((CR38 & 0x08) && (sis_vbflags & VB_CHRONTEL))
- sis_vbflags |= (TV_CHHDTV | TV_NTSC);
-
- if (sis_vbflags & (TV_SCART | TV_SVIDEO | TV_AVIDEO | TV_HIVISION)) {
- if (sis_vga_engine == SIS_300_VGA) {
- /* TW: Should be SR38 here as well, but this
- * does not work. Looks like a BIOS bug (2.04.5c).
- */
- if (SR16 & 0x20)
- sis_vbflags |= TV_PAL;
- else
- sis_vbflags |= TV_NTSC;
- } else if ((sis_device_id == DEVICE_SIS_550_VGA)) {
- inSISIDXREG(SISCR, 0x79, CR79);
- if (CR79 & 0x08) {
- inSISIDXREG(SISCR, 0x79, CR79);
- CR79 >>= 5;
- }
- if (CR79 & 0x01) {
- sis_vbflags |= TV_PAL;
- if (CR38 & 0x40)
- sis_vbflags |= TV_PALM;
- else if (CR38 & 0x80)
- sis_vbflags |= TV_PALN;
- } else
- sis_vbflags |= TV_NTSC;
- } else if ((sis_device_id == DEVICE_SIS_650_VGA)) {
- inSISIDXREG(SISCR, 0x79, CR79);
- if (CR79 & 0x20) {
- sis_vbflags |= TV_PAL;
- if (CR38 & 0x40)
- sis_vbflags |= TV_PALM;
- else if (CR38 & 0x80)
- sis_vbflags |= TV_PALN;
- } else
- sis_vbflags |= TV_NTSC;
- } else { /* 315, 330 */
- if (SR38 & 0x01) {
- sis_vbflags |= TV_PAL;
- if (CR38 & 0x40)
- sis_vbflags |= TV_PALM;
- else if (CR38 & 0x80)
- sis_vbflags |= TV_PALN;
- } else
- sis_vbflags |= TV_NTSC;
- }
- }
-
- if (sis_vbflags &
- (TV_SCART | TV_SVIDEO | TV_AVIDEO | TV_HIVISION | TV_CHSCART |
- TV_CHHDTV)) {
- if (sis_verbose > 0) {
- printf("[SiS] %sTV standard %s\n",
- (sis_vbflags & (TV_CHSCART | TV_CHHDTV)) ? "Using " :
- "Detected default ",
- (sis_vbflags & TV_NTSC) ? ((sis_vbflags & TV_CHHDTV) ?
- "480i HDTV" : "NTSC")
- : ((sis_vbflags & TV_PALM) ? "PALM"
- : ((sis_vbflags & TV_PALN) ? "PALN" : "PAL")));
- }
- }
-
-}
-
-
-static void sis_detect_crt2()
-{
- unsigned char CR32;
-
- if (!(sis_vbflags & VB_VIDEOBRIDGE))
- return;
-
- /* CRT2-VGA not supported on LVDS and 30xLV */
- if (sis_vbflags & (VB_LVDS | VB_301LV | VB_302LV))
- return;
-
- inSISIDXREG(SISCR, 0x32, CR32);
-
- if (CR32 & 0x10)
- sis_vbflags |= CRT2_VGA;
-
-#if 0
- if (!(pSiS->nocrt2ddcdetection)) {
- if (sis_vbflags & (VB_301B | VB_302B)) {
- if (!(sis_vbflags & (CRT2_VGA | CRT2_LCD))) {
- printf
- ("[SiS] BIOS detected no secondary VGA, sensing via DDC\n");
- if (SiS_SenseVGA2DDC(pSiS->SiS_Pr, pSiS)) {
- printf
- ("[SiS] DDC error during secondary VGA detection\n");
- } else {
- inSISIDXREG(SISCR, 0x32, CR32);
- if (CR32 & 0x10) {
- sis_vbflags |= CRT2_VGA;
- /*pSiS->postVBCR32 |= 0x10; */
- printf
- ("[SiS] Detected secondary VGA connection\n");
- } else {
- printf
- ("[SiS] No secondary VGA connection detected\n");
- }
- }
- }
- }
- }
-#endif
-
-}
-
-
-/* Preinit: detect video bridge and sense connected devs */
-static void sis_detect_video_bridge()
-{
- int temp, temp1, temp2;
-
-
- sis_vbflags = 0;
-
- if (sis_vga_engine != SIS_300_VGA && sis_vga_engine != SIS_315_VGA)
- return;
-
- inSISIDXREG(SISPART4, 0x00, temp);
- temp &= 0x0F;
- if (temp == 1) {
- inSISIDXREG(SISPART4, 0x01, temp1);
- temp1 &= 0xff;
- if (temp1 >= 0xE0) {
- sis_vbflags |= VB_302LV;
- //pSiS->sishw_ext.ujVBChipID = VB_CHIP_302LV;
- if (sis_verbose > 1) {
- printf
- ("[SiS] Detected SiS302LV video bridge (ID 1; Revision 0x%x)\n",
- temp1);
- }
-
- } else if (temp1 >= 0xD0) {
- sis_vbflags |= VB_301LV;
- //pSiS->sishw_ext.ujVBChipID = VB_CHIP_301LV;
- if (sis_verbose > 1) {
- printf
- ("[SiS] Detected SiS301LV video bridge (ID 1; Revision 0x%x)\n",
- temp1);
- }
- } else if (temp1 >= 0xB0) {
- sis_vbflags |= VB_301B;
- //pSiS->sishw_ext.ujVBChipID = VB_CHIP_301B;
- inSISIDXREG(SISPART4, 0x23, temp2);
- if (!(temp2 & 0x02))
- sis_vbflags |= VB_30xBDH;
- if (sis_verbose > 1) {
- printf
- ("[SiS] Detected SiS301B%s video bridge (Revision 0x%x)\n",
- (temp2 & 0x02) ? "" : " (DH)", temp1);
- }
- } else {
- sis_vbflags |= VB_301;
- //pSiS->sishw_ext.ujVBChipID = VB_CHIP_301;
- if (sis_verbose > 1) {
- printf
- ("[SiS] Detected SiS301 video bridge (Revision 0x%x)\n",
- temp1);
- }
- }
-
- sis_sense_30x();
-
- } else if (temp == 2) {
-
- inSISIDXREG(SISPART4, 0x01, temp1);
- temp1 &= 0xff;
- if (temp1 >= 0xE0) {
- sis_vbflags |= VB_302LV;
- //pSiS->sishw_ext.ujVBChipID = VB_CHIP_302LV;
- if (sis_verbose > 1) {
- printf
- ("[SiS] Detected SiS302LV video bridge (ID 2; Revision 0x%x)\n",
- temp1);
- }
- } else if (temp1 >= 0xD0) {
- sis_vbflags |= VB_301LV;
- //pSiS->sishw_ext.ujVBChipID = VB_CHIP_301LV;
- if (sis_verbose > 1) {
- printf
- ("[SiS] Detected SiS301LV video bridge (ID 2; Revision 0x%x)\n",
- temp1);
- }
- } else {
- sis_vbflags |= VB_302B;
- //pSiS->sishw_ext.ujVBChipID = VB_CHIP_302B;
- inSISIDXREG(SISPART4, 0x23, temp2);
- if (!(temp & 0x02))
- sis_vbflags |= VB_30xBDH;
- if (sis_verbose > 1) {
- printf
- ("[SiS] Detected SiS302B%s video bridge (Revision 0x%x)\n",
- (temp2 & 0x02) ? "" : " (DH)", temp1);
- }
- }
-
- sis_sense_30x();
-
- } else if (temp == 3) {
- if (sis_verbose > 1) {
- printf("[SiS] Detected SiS303 video bridge - not supported\n");
- }
- } else {
- /* big scary mess of code to handle unknown or Chrontel LVDS */
- /* skipping it for now */
- if (sis_verbose > 1) {
- printf
- ("[SiS] Detected Chrontel video bridge - not supported\n");
- }
- }
-
- /* this is probably not relevant to video overlay driver... */
- /* detects if brdige uses LCDA for low res text modes */
- if (sis_vga_engine == SIS_315_VGA) {
- if (sis_vbflags & (VB_302B | VB_301LV | VB_302LV)) {
-#if 0
- if (pSiS->sisfblcda != 0xff) {
- if ((pSiS->sisfblcda & 0x03) == 0x03) {
- //pSiS->SiS_Pr->SiS_UseLCDA = TRUE;
- sis_vbflags |= VB_USELCDA;
- }
- } else
-#endif
- {
- inSISIDXREG(SISCR, 0x34, temp);
- if (temp <= 0x13) {
- inSISIDXREG(SISCR, 0x38, temp);
- if ((temp & 0x03) == 0x03) {
- //pSiS->SiS_Pr->SiS_UseLCDA = TRUE;
- sis_vbflags |= VB_USELCDA;
- } else {
- inSISIDXREG(SISCR, 0x30, temp);
- if (temp & 0x20) {
- inSISIDXREG(SISPART1, 0x13, temp);
- if (temp & 0x40) {
- //pSiS->SiS_Pr->SiS_UseLCDA = TRUE;
- sis_vbflags |= VB_USELCDA;
- }
- }
- }
- }
- }
- if (sis_vbflags & VB_USELCDA) {
- /* printf("Bridge uses LCDA for low resolution and text modes\n"); */
- }
- }
- }
-
-
-}
-
-
-/* detect video bridge type and sense connected devices */
-void sis_init_video_bridge()
-{
-
- sis_detect_video_bridge();
-
- sis_detect_crt1();
- //sis_detect_lcd(); /* not fully ready probably */
- sis_detect_tv();
- sis_detect_crt2();
-
- sis_detected_crt2_devices =
- sis_vbflags & (CRT2_LCD | CRT2_TV | CRT2_VGA);
-
- // force crt2 type
- if (sis_force_crt2_type == CRT2_DEFAULT) {
- if (sis_vbflags & CRT2_VGA)
- sis_force_crt2_type = CRT2_VGA;
- else if (sis_vbflags & CRT2_LCD)
- sis_force_crt2_type = CRT2_LCD;
- else if (sis_vbflags & CRT2_TV)
- sis_force_crt2_type = CRT2_TV;
- }
-
- switch (sis_force_crt2_type) {
- case CRT2_TV:
- sis_vbflags = sis_vbflags & ~(CRT2_LCD | CRT2_VGA);
- if (sis_vbflags & VB_VIDEOBRIDGE)
- sis_vbflags = sis_vbflags | CRT2_TV;
- else
- sis_vbflags = sis_vbflags & ~(CRT2_TV);
- break;
- case CRT2_LCD:
- sis_vbflags = sis_vbflags & ~(CRT2_TV | CRT2_VGA);
- if ((sis_vbflags & VB_VIDEOBRIDGE) /* XXX: && (pSiS->VBLCDFlags) */
- )
- sis_vbflags = sis_vbflags | CRT2_LCD;
- else {
- sis_vbflags = sis_vbflags & ~(CRT2_LCD);
- if (sis_verbose > 0) {
- printf
- ("[SiS] Can't force CRT2 to LCD, no panel detected\n");
- }
- }
- break;
- case CRT2_VGA:
- if (sis_vbflags & VB_LVDS) {
- if (sis_verbose > 0) {
- printf("[SiS] LVDS does not support secondary VGA\n");
- }
- break;
- }
- if (sis_vbflags & (VB_301LV | VB_302LV)) {
- if (sis_verbose > 0) {
- printf
- ("[SiS] SiS30xLV bridge does not support secondary VGA\n");
- }
- break;
- }
- sis_vbflags = sis_vbflags & ~(CRT2_TV | CRT2_LCD);
- if (sis_vbflags & VB_VIDEOBRIDGE)
- sis_vbflags = sis_vbflags | CRT2_VGA;
- else
- sis_vbflags = sis_vbflags & ~(CRT2_VGA);
- break;
- default:
- sis_vbflags &= ~(CRT2_TV | CRT2_LCD | CRT2_VGA);
- }
-
- /* CRT2 gamma correction?? */
-
- /* other force modes: */
- /* have a 'force tv type' (svideo, composite, scart) option? */
- /* have a 'force crt1 type' (to turn it off, etc??) */
-
- /* TW: Check if CRT1 used (or needed; this eg. if no CRT2 detected) */
- if (sis_vbflags & VB_VIDEOBRIDGE) {
-
- /* TW: No CRT2 output? Then we NEED CRT1!
- * We also need CRT1 if depth = 8 and bridge=LVDS|630+301B
- */
- if ((!(sis_vbflags & (CRT2_VGA | CRT2_LCD | CRT2_TV))) || ( /*(pScrn->bitsPerPixel == 8) && */
- ((sis_vbflags & (VB_LVDS | VB_CHRONTEL)) || ((sis_vga_engine == SIS_300_VGA) && (sis_vbflags & VB_301B))))) {
- sis_crt1_off = 0;
- }
- /* TW: No CRT2 output? Then we can't use hw overlay on CRT2 */
- if (!(sis_vbflags & (CRT2_VGA | CRT2_LCD | CRT2_TV)))
- sis_overlay_on_crt1 = 1;
-
- } else { /* TW: no video bridge? */
-
- /* Then we NEED CRT1... */
- sis_crt1_off = 0;
- /* ... and can't use CRT2 for overlay output */
- sis_overlay_on_crt1 = 1;
- }
-
- /* tvstandard options ? */
-
- // determine using CRT1 or CRT2?
- /* -> NO dualhead right now... */
- if (sis_vbflags & DISPTYPE_DISP2) {
- if (sis_crt1_off) {
- sis_vbflags |= VB_DISPMODE_SINGLE;
- /* TW: No CRT1? Then we use the video overlay on CRT2 */
- sis_overlay_on_crt1 = 0;
- } else /* TW: CRT1 and CRT2 - mirror or dual head ----- */
- sis_vbflags |= (VB_DISPMODE_MIRROR | DISPTYPE_CRT1);
- } else { /* TW: CRT1 only ------------------------------- */
- sis_vbflags |= (VB_DISPMODE_SINGLE | DISPTYPE_CRT1);
- }
-
- if (sis_verbose > 0) {
- printf("[SiS] Using hardware overlay on CRT%d\n",
- sis_overlay_on_crt1 ? 1 : 2);
- }
-
-}
diff --git a/src/video_out/vidix/drivers/sis_defs.h b/src/video_out/vidix/drivers/sis_defs.h
deleted file mode 100644
index 79a61a19b..000000000
--- a/src/video_out/vidix/drivers/sis_defs.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/**
- SiS graphics misc definitions.
-
- Taken from SiS Xv driver:
- Copyright 2002-2003 by Thomas Winischhofer, Vienna, Austria.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-**/
-
-#ifndef VIDIX_SIS_DEFS_H
-#define VIDIX_SIS_DEFS_H
-
-/** PCI IDs **/
-#define VENDOR_SIS 0x1039
-
-#define DEVICE_SIS_300 0x0300
-#define DEVICE_SIS_315H 0x0310
-#define DEVICE_SIS_315 0x0315
-#define DEVICE_SIS_315PRO 0x0325
-#define DEVICE_SIS_330 0x0330
-#define DEVICE_SIS_540 0x0540
-#define DEVICE_SIS_540_VGA 0x5300
-#define DEVICE_SIS_550 0x0550
-#define DEVICE_SIS_550_VGA 0x5315
-#define DEVICE_SIS_630 0x0630
-#define DEVICE_SIS_630_VGA 0x6300
-#define DEVICE_SIS_650 0x0650
-#define DEVICE_SIS_650_VGA 0x6325
-#define DEVICE_SIS_730 0x0730
-
-
-/* TW: VBFlags */
-#define CRT2_DEFAULT 0x00000001
-#define CRT2_LCD 0x00000002 /* TW: Never change the order of the CRT2_XXX entries */
-#define CRT2_TV 0x00000004 /* (see SISCycleCRT2Type()) */
-#define CRT2_VGA 0x00000008
-#define CRT2_ENABLE (CRT2_LCD | CRT2_TV | CRT2_VGA)
-#define DISPTYPE_DISP2 CRT2_ENABLE
-#define TV_NTSC 0x00000010
-#define TV_PAL 0x00000020
-#define TV_HIVISION 0x00000040
-#define TV_HIVISION_LV 0x00000080
-#define TV_TYPE (TV_NTSC | TV_PAL | TV_HIVISION | TV_HIVISION_LV)
-#define TV_AVIDEO 0x00000100
-#define TV_SVIDEO 0x00000200
-#define TV_SCART 0x00000400
-#define TV_INTERFACE (TV_AVIDEO | TV_SVIDEO | TV_SCART | TV_CHSCART | TV_CHHDTV)
-#define VB_USELCDA 0x00000800
-#define TV_PALM 0x00001000
-#define TV_PALN 0x00002000
-#define TV_CHSCART 0x00008000
-#define TV_CHHDTV 0x00010000
-#define VGA2_CONNECTED 0x00040000
-#define DISPTYPE_CRT1 0x00080000 /* TW: CRT1 connected and used */
-#define DISPTYPE_DISP1 DISPTYPE_CRT1
-#define VB_301 0x00100000 /* Video bridge type */
-#define VB_301B 0x00200000
-#define VB_302B 0x00400000
-#define VB_30xBDH 0x00800000 /* 30xB DH version (w/o LCD support) */
-#define VB_LVDS 0x01000000
-#define VB_CHRONTEL 0x02000000
-#define VB_301LV 0x04000000
-#define VB_302LV 0x08000000
-#define VB_30xLV VB_301LV
-#define VB_30xLVX VB_302LV
-#define VB_TRUMPION 0x10000000
-#define VB_VIDEOBRIDGE (VB_301|VB_301B|VB_302B|VB_301LV|VB_302LV| \
- VB_LVDS|VB_CHRONTEL|VB_TRUMPION) /* TW */
-#define VB_SISBRIDGE (VB_301|VB_301B|VB_302B|VB_301LV|VB_302LV)
-#define SINGLE_MODE 0x20000000 /* TW: CRT1 or CRT2; determined by DISPTYPE_CRTx */
-#define VB_DISPMODE_SINGLE SINGLE_MODE /* TW: alias */
-#define MIRROR_MODE 0x40000000 /* TW: CRT1 + CRT2 identical (mirror mode) */
-#define VB_DISPMODE_MIRROR MIRROR_MODE /* TW: alias */
-#define DUALVIEW_MODE 0x80000000 /* TW: CRT1 + CRT2 independent (dual head mode) */
-#define VB_DISPMODE_DUAL DUALVIEW_MODE /* TW: alias */
-#define DISPLAY_MODE (SINGLE_MODE | MIRROR_MODE | DUALVIEW_MODE) /* TW */
-
-/* SiS vga engine type */
-#define UNKNOWN_VGA 0
-#define SIS_300_VGA 1
-#define SIS_315_VGA 2
-
-extern unsigned int sis_verbose;
-extern unsigned short sis_iobase;
-extern unsigned int sis_vga_engine;
-extern unsigned int sis_vbflags;
-extern unsigned int sis_overlay_on_crt1;
-extern unsigned int sis_crt1_off;
-extern unsigned int sis_detected_crt2_devices;
-extern unsigned int sis_force_crt2_type;
-extern unsigned int sis_device_id;
-
-#endif /* VIDIX_SIS_DEFS_H */
diff --git a/src/video_out/vidix/drivers/sis_regs.h b/src/video_out/vidix/drivers/sis_regs.h
deleted file mode 100644
index 0157e049a..000000000
--- a/src/video_out/vidix/drivers/sis_regs.h
+++ /dev/null
@@ -1,412 +0,0 @@
-/**
- SiS register definitions and access macros.
- From SiS X11 driver.
-
- Copyright 2001-2003 by Thomas Winischhofer, Vienna, Austria.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-**/
-
-#ifndef VIDIX_SIS_REGS_H
-#define VIDIX_SIS_REGS_H
-
-#define inSISREG(base) INPORT8(base)
-#define outSISREG(base,val) OUTPORT8(base, val)
-#define orSISREG(base,val) do { \
- unsigned char __Temp = INPORT8(base); \
- outSISREG(base, __Temp | (val)); \
- } while (0)
-#define andSISREG(base,val) do { \
- unsigned char __Temp = INPORT8(base); \
- outSISREG(base, __Temp & (val)); \
- } while (0)
-
-#define inSISIDXREG(base,idx,var) do { \
- OUTPORT8(base, idx); var=INPORT8((base)+1); \
- } while (0)
-#define outSISIDXREG(base,idx,val) do { \
- OUTPORT8(base, idx); OUTPORT8((base)+1, val); \
- } while (0)
-#define orSISIDXREG(base,idx,val) do { \
- unsigned char __Temp; \
- OUTPORT8(base, idx); \
- __Temp = INPORT8((base)+1)|(val); \
- outSISIDXREG(base,idx,__Temp); \
- } while (0)
-#define andSISIDXREG(base,idx,and) do { \
- unsigned char __Temp; \
- OUTPORT8(base, idx); \
- __Temp = INPORT8((base)+1)&(and); \
- outSISIDXREG(base,idx,__Temp); \
- } while (0)
-#define setSISIDXREG(base,idx,and,or) do { \
- unsigned char __Temp; \
- OUTPORT8(base, idx); \
- __Temp = (INPORT8((base)+1)&(and))|(or); \
- outSISIDXREG(base,idx,__Temp); \
- } while (0)
-
-#define BITMASK(h,l) (((unsigned)(1U << ((h)-(l)+1))-1)<<(l))
-#define GENMASK(mask) BITMASK(1?mask,0?mask)
-
-#define GETBITS(var,mask) (((var) & GENMASK(mask)) >> (0?mask))
-#define SETBITS(val,mask) ((val) << (0?mask))
-#define SETBIT(n) (1<<(n))
-
-#define GETBITSTR(val,from,to) ((GETBITS(val,from)) << (0?to))
-#define SETVARBITS(var,val,from,to) (((var)&(~(GENMASK(to)))) | \
- GETBITSTR(val,from,to))
-#define GETVAR8(var) ((var)&0xFF)
-#define SETVAR8(var,val) (var) = GETVAR8(val)
-
-/* #define VGA_RELIO_BASE 0x380 */
-
-#define AROFFSET 0x40 /* VGA_ATTR_INDEX - VGA_RELIO_BASE */
-#define ARROFFSET 0x41 /* VGA_ATTR_DATA_R - VGA_RELIO_BASE */
-#define GROFFSET 0x4e /* VGA_GRAPH_INDEX - VGA_RELIO_BASE */
-#define SROFFSET 0x44 /* VGA_SEQ_INDEX - VGA_RELIO_BASE */
-#define CROFFSET 0x54 /* VGA_CRTC_INDEX_OFFSET + VGA_IOBASE_COLOR - VGA_RELIO_BASE */
-#define MISCROFFSET 0x4c /* VGA_MISC_OUT_R - VGA_RELIO_BASE */
-#define MISCWOFFSET 0x42 /* VGA_MISC_OUT_W - VGA_RELIO_BASE */
-#define INPUTSTATOFFSET 0x5A
-#define PART1OFFSET 0x04
-#define PART2OFFSET 0x10
-#define PART3OFFSET 0x12
-#define PART4OFFSET 0x14
-#define PART5OFFSET 0x16
-#define VIDEOOFFSET 0x02
-#define COLREGOFFSET 0x48
-
-#define SIS_IOBASE sis_iobase /* var defined in sis_vid.c */
-#define SISAR SIS_IOBASE + AROFFSET
-#define SISARR SIS_IOBASE + ARROFFSET
-#define SISGR SIS_IOBASE + GROFFSET
-#define SISSR SIS_IOBASE + SROFFSET
-#define SISCR SIS_IOBASE + CROFFSET
-#define SISMISCR SIS_IOBASE + MISCROFFSET
-#define SISMISCW SIS_IOBASE + MISCWOFFSET
-#define SISINPSTAT SIS_IOBASE + INPUTSTATOFFSET
-#define SISPART1 SIS_IOBASE + PART1OFFSET
-#define SISPART2 SIS_IOBASE + PART2OFFSET
-#define SISPART3 SIS_IOBASE + PART3OFFSET
-#define SISPART4 SIS_IOBASE + PART4OFFSET
-#define SISPART5 SIS_IOBASE + PART5OFFSET
-#define SISVID SIS_IOBASE + VIDEOOFFSET
-#define SISCOLIDX SIS_IOBASE + COLREGOFFSET
-#define SISCOLDATA SIS_IOBASE + COLREGOFFSET + 1
-#define SISCOL2IDX SISPART5
-#define SISCOL2DATA SISPART5 + 1
-
-
-#define vc_index_offset 0x00 /* Video capture - unused */
-#define vc_data_offset 0x01
-#define vi_index_offset VIDEOOFFSET
-#define vi_data_offset (VIDEOOFFSET + 1)
-#define crt2_index_offset PART1OFFSET
-#define crt2_port_offset (PART1OFFSET + 1)
-#define sr_index_offset SROFFSET
-#define sr_data_offset (SROFFSET + 1)
-#define cr_index_offset CROFFSET
-#define cr_data_offset (CROFFSET + 1)
-#define input_stat INPUTSTATOFFSET
-
-/* For old chipsets (5597/5598, 6326, 530/620) ------------ */
-/* SR (3C4) */
-#define BankReg 0x06
-#define ClockReg 0x07
-#define CPUThreshold 0x08
-#define CRTThreshold 0x09
-#define CRTCOff 0x0A
-#define DualBanks 0x0B
-#define MMIOEnable 0x0B
-#define RAMSize 0x0C
-#define Mode64 0x0C
-#define ExtConfStatus1 0x0E
-#define ClockBase 0x13
-#define LinearAdd0 0x20
-#define LinearAdd1 0x21
-#define GraphEng 0x27
-#define MemClock0 0x28
-#define MemClock1 0x29
-#define XR2A 0x2A
-#define XR2B 0x2B
-#define TurboQueueBase 0x2C
-#define FBSize 0x2F
-#define ExtMiscCont5 0x34
-#define ExtMiscCont9 0x3C
-
-/* 3x4 */
-#define Offset 0x13
-
-/* SiS Registers for 300, 540, 630, 730, 315, 550, 650, 740 */
-
-/* VGA standard register */
-#define Index_SR_Graphic_Mode 0x06
-#define Index_SR_RAMDAC_Ctrl 0x07
-#define Index_SR_Threshold_Ctrl1 0x08
-#define Index_SR_Threshold_Ctrl2 0x09
-#define Index_SR_Misc_Ctrl 0x0F
-#define Index_SR_DDC 0x11
-#define Index_SR_Feature_Connector_Ctrl 0x12
-#define Index_SR_DRAM_Sizing 0x14
-#define Index_SR_DRAM_State_Machine_Ctrl 0x15
-#define Index_SR_AGP_PCI_State_Machine 0x21
-#define Index_SR_Internal_MCLK0 0x28
-#define Index_SR_Internal_MCLK1 0x29
-#define Index_SR_Internal_DCLK1 0x2B
-#define Index_SR_Internal_DCLK2 0x2C
-#define Index_SR_Internal_DCLK3 0x2D
-#define Index_SR_Ext_Clock_Sel 0x32
-#define Index_SR_Int_Status 0x34
-#define Index_SR_Int_Enable 0x35
-#define Index_SR_Int_Reset 0x36
-#define Index_SR_Power_On_Trap 0x38
-#define Index_SR_Power_On_Trap2 0x39
-#define Index_SR_Power_On_Trap3 0x3A
-
-/* video registers (300/630/730/315/550/650/740 only) */
-#define Index_VI_Passwd 0x00
-
-/* Video overlay horizontal start/end, unit=screen pixels */
-#define Index_VI_Win_Hor_Disp_Start_Low 0x01
-#define Index_VI_Win_Hor_Disp_End_Low 0x02
-#define Index_VI_Win_Hor_Over 0x03 /* Overflow */
-
-/* Video overlay vertical start/end, unit=screen pixels */
-#define Index_VI_Win_Ver_Disp_Start_Low 0x04
-#define Index_VI_Win_Ver_Disp_End_Low 0x05
-#define Index_VI_Win_Ver_Over 0x06 /* Overflow */
-
-/* Y Plane (4:2:0) or YUV (4:2:2) buffer start address, unit=word */
-#define Index_VI_Disp_Y_Buf_Start_Low 0x07
-#define Index_VI_Disp_Y_Buf_Start_Middle 0x08
-#define Index_VI_Disp_Y_Buf_Start_High 0x09
-
-/* U Plane (4:2:0) buffer start address, unit=word */
-#define Index_VI_U_Buf_Start_Low 0x0A
-#define Index_VI_U_Buf_Start_Middle 0x0B
-#define Index_VI_U_Buf_Start_High 0x0C
-
-/* V Plane (4:2:0) buffer start address, unit=word */
-#define Index_VI_V_Buf_Start_Low 0x0D
-#define Index_VI_V_Buf_Start_Middle 0x0E
-#define Index_VI_V_Buf_Start_High 0x0F
-
-/* Pitch for Y, UV Planes, unit=word */
-#define Index_VI_Disp_Y_Buf_Pitch_Low 0x10
-#define Index_VI_Disp_UV_Buf_Pitch_Low 0x11
-#define Index_VI_Disp_Y_UV_Buf_Pitch_Middle 0x12
-
-/* What is this ? */
-#define Index_VI_Disp_Y_Buf_Preset_Low 0x13
-#define Index_VI_Disp_Y_Buf_Preset_Middle 0x14
-
-#define Index_VI_UV_Buf_Preset_Low 0x15
-#define Index_VI_UV_Buf_Preset_Middle 0x16
-#define Index_VI_Disp_Y_UV_Buf_Preset_High 0x17
-
-/* Scaling control registers */
-#define Index_VI_Hor_Post_Up_Scale_Low 0x18
-#define Index_VI_Hor_Post_Up_Scale_High 0x19
-#define Index_VI_Ver_Up_Scale_Low 0x1A
-#define Index_VI_Ver_Up_Scale_High 0x1B
-#define Index_VI_Scale_Control 0x1C
-
-/* Playback line buffer control */
-#define Index_VI_Play_Threshold_Low 0x1D
-#define Index_VI_Play_Threshold_High 0x1E
-#define Index_VI_Line_Buffer_Size 0x1F
-
-/* Destination color key */
-#define Index_VI_Overlay_ColorKey_Red_Min 0x20
-#define Index_VI_Overlay_ColorKey_Green_Min 0x21
-#define Index_VI_Overlay_ColorKey_Blue_Min 0x22
-#define Index_VI_Overlay_ColorKey_Red_Max 0x23
-#define Index_VI_Overlay_ColorKey_Green_Max 0x24
-#define Index_VI_Overlay_ColorKey_Blue_Max 0x25
-
-/* Source color key, YUV color space */
-#define Index_VI_Overlay_ChromaKey_Red_Y_Min 0x26
-#define Index_VI_Overlay_ChromaKey_Green_U_Min 0x27
-#define Index_VI_Overlay_ChromaKey_Blue_V_Min 0x28
-#define Index_VI_Overlay_ChromaKey_Red_Y_Max 0x29
-#define Index_VI_Overlay_ChromaKey_Green_U_Max 0x2A
-#define Index_VI_Overlay_ChromaKey_Blue_V_Max 0x2B
-
-/* Contrast enhancement and brightness control */
-#define Index_VI_Contrast_Factor 0x2C /* obviously unused/undefined */
-#define Index_VI_Brightness 0x2D
-#define Index_VI_Contrast_Enh_Ctrl 0x2E
-
-#define Index_VI_Key_Overlay_OP 0x2F
-
-#define Index_VI_Control_Misc0 0x30
-#define Index_VI_Control_Misc1 0x31
-#define Index_VI_Control_Misc2 0x32
-
-/* TW: Subpicture registers */
-#define Index_VI_SubPict_Buf_Start_Low 0x33
-#define Index_VI_SubPict_Buf_Start_Middle 0x34
-#define Index_VI_SubPict_Buf_Start_High 0x35
-
-/* TW: What is this ? */
-#define Index_VI_SubPict_Buf_Preset_Low 0x36
-#define Index_VI_SubPict_Buf_Preset_Middle 0x37
-
-/* TW: Subpicture pitch, unit=16 bytes */
-#define Index_VI_SubPict_Buf_Pitch 0x38
-
-/* TW: Subpicture scaling control */
-#define Index_VI_SubPict_Hor_Scale_Low 0x39
-#define Index_VI_SubPict_Hor_Scale_High 0x3A
-#define Index_VI_SubPict_Vert_Scale_Low 0x3B
-#define Index_VI_SubPict_Vert_Scale_High 0x3C
-
-#define Index_VI_SubPict_Scale_Control 0x3D
-/* (0x40 = enable/disable subpicture) */
-
-/* TW: Subpicture line buffer control */
-#define Index_VI_SubPict_Threshold 0x3E
-
-/* TW: What is this? */
-#define Index_VI_FIFO_Max 0x3F
-
-/* TW: Subpicture palette; 16 colors, total 32 bytes address space */
-#define Index_VI_SubPict_Pal_Base_Low 0x40
-#define Index_VI_SubPict_Pal_Base_High 0x41
-
-/* I wish I knew how to use these ... */
-#define Index_MPEG_Read_Ctrl0 0x60 /* MPEG auto flip */
-#define Index_MPEG_Read_Ctrl1 0x61 /* MPEG auto flip */
-#define Index_MPEG_Read_Ctrl2 0x62 /* MPEG auto flip */
-#define Index_MPEG_Read_Ctrl3 0x63 /* MPEG auto flip */
-
-/* TW: MPEG AutoFlip scale */
-#define Index_MPEG_Ver_Up_Scale_Low 0x64
-#define Index_MPEG_Ver_Up_Scale_High 0x65
-
-#define Index_MPEG_Y_Buf_Preset_Low 0x66
-#define Index_MPEG_Y_Buf_Preset_Middle 0x67
-#define Index_MPEG_UV_Buf_Preset_Low 0x68
-#define Index_MPEG_UV_Buf_Preset_Middle 0x69
-#define Index_MPEG_Y_UV_Buf_Preset_High 0x6A
-
-/* TW: The following registers only exist on the 310/325 series */
-
-/* TW: Bit 16:24 of Y_U_V buf start address (?) */
-#define Index_VI_Y_Buf_Start_Over 0x6B
-#define Index_VI_U_Buf_Start_Over 0x6C
-#define Index_VI_V_Buf_Start_Over 0x6D
-
-#define Index_VI_Disp_Y_Buf_Pitch_High 0x6E
-#define Index_VI_Disp_UV_Buf_Pitch_High 0x6F
-
-/* Hue and saturation */
-#define Index_VI_Hue 0x70
-#define Index_VI_Saturation 0x71
-
-#define Index_VI_SubPict_Start_Over 0x72
-#define Index_VI_SubPict_Buf_Pitch_High 0x73
-
-#define Index_VI_Control_Misc3 0x74
-
-
-/* TW: Bits (and helpers) for Index_VI_Control_Misc0 */
-#define VI_Misc0_Enable_Overlay 0x02
-#define VI_Misc0_420_Plane_Enable 0x04 /* Select Plane or Packed mode */
-#define VI_Misc0_422_Enable 0x20 /* Select 422 or 411 mode */
-#define VI_Misc0_Fmt_YVU420P 0x0C /* YUV420 Planar (I420, YV12) */
-#define VI_Misc0_Fmt_YUYV 0x28 /* YUYV Packed (YUY2) */
-#define VI_Misc0_Fmt_UYVY 0x08 /* (UYVY) */
-
-/* TW: Bits for Index_VI_Control_Misc1 */
-/* #define VI_Misc1_? 0x01 */
-#define VI_Misc1_BOB_Enable 0x02
-#define VI_Misc1_Line_Merge 0x04
-#define VI_Misc1_Field_Mode 0x08
-/* #define VI_Misc1_? 0x10 */
-#define VI_Misc1_Non_Interleave 0x20 /* 300 series only? */
-#define VI_Misc1_Buf_Addr_Lock 0x20 /* 310 series only? */
-/* #define VI_Misc1_? 0x40 */
-/* #define VI_Misc1_? 0x80 */
-
-/* TW: Bits for Index_VI_Control_Misc2 */
-#define VI_Misc2_Select_Video2 0x01
-#define VI_Misc2_Video2_On_Top 0x02
-/* #define VI_Misc2_? 0x04 */
-#define VI_Misc2_Vertical_Interpol 0x08
-#define VI_Misc2_Dual_Line_Merge 0x10
-#define VI_Misc2_All_Line_Merge 0x20 /* 310 series only? */
-#define VI_Misc2_Auto_Flip_Enable 0x40 /* 300 series only? */
-#define VI_Misc2_Video_Reg_Write_Enable 0x80 /* 310 series only? */
-
-/* TW: Bits for Index_VI_Control_Misc3 */
-#define VI_Misc3_Submit_Video_1 0x01 /* AKA "address ready" */
-#define VI_Misc3_Submit_Video_2 0x02 /* AKA "address ready" */
-#define VI_Misc3_Submit_SubPict 0x04 /* AKA "address ready" */
-
-/* TW: Values for Index_VI_Key_Overlay_OP (0x2F) */
-#define VI_ROP_Never 0x00
-#define VI_ROP_DestKey 0x03
-#define VI_ROP_Always 0x0F
-
-/*
- * CRT_2 function control register ---------------------------------
- */
-#define Index_CRT2_FC_CONTROL 0x00
-#define Index_CRT2_FC_SCREEN_HIGH 0x04
-#define Index_CRT2_FC_SCREEN_MID 0x05
-#define Index_CRT2_FC_SCREEN_LOW 0x06
-#define Index_CRT2_FC_ENABLE_WRITE 0x24
-#define Index_CRT2_FC_VR 0x25
-#define Index_CRT2_FC_VCount 0x27
-#define Index_CRT2_FC_VCount1 0x28
-
-#define Index_310_CRT2_FC_VR 0x30 /* d[1] = vertical retrace */
-#define Index_310_CRT2_FC_RT 0x33 /* d[7] = retrace in progress */
-
-/* video attributes - these should probably be configurable on the fly
- * so users with different desktop sizes can keep
- * captured data off the desktop
- */
-#define _VINWID 704
-#define _VINHGT _VINHGT_NTSC
-#define _VINHGT_NTSC 240
-#define _VINHGT_PAL 290
-#define _VIN_WINDOW (704 * 291 * 2)
-#define _VBI_WINDOW (704 * 64 * 2)
-
-#define _VIN_FIELD_EVEN 1
-#define _VIN_FIELD_ODD 2
-#define _VIN_FIELD_BOTH 4
-
-
-/* i2c registers (TW; not on 300/310/325 series) */
-#define X_INDEXREG 0x14
-#define X_PORTREG 0x15
-#define X_DATA 0x0f
-#define I2C_SCL 0x00
-#define I2C_SDA 0x01
-#define I2C_DELAY 10
-
-/* mmio registers for video */
-#define REG_PRIM_CRT_COUNTER 0x8514
-
-/* TW: MPEG MMIO registers (630 and later) ----------------------------*/
-
-/* Not public (yet?) */
-
-#endif /* VIDIX_SIS_REGS_H */
diff --git a/src/video_out/vidix/drivers/sis_vid.c b/src/video_out/vidix/drivers/sis_vid.c
deleted file mode 100644
index c3ef2bdcf..000000000
--- a/src/video_out/vidix/drivers/sis_vid.c
+++ /dev/null
@@ -1,1562 +0,0 @@
-/**
- VIDIX driver for SiS 300 and 310/325 series chips.
-
- Copyright 2003 Jake Page, Sugar Media.
-
- Based on SiS Xv driver:
- Copyright 2002-2003 by Thomas Winischhofer, Vienna, Austria.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- 2003/10/08 integrated into mplayer/vidix architecture -- Alex Beregszaszi
-**/
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <inttypes.h>
-#include <unistd.h>
-
-#include "vidix.h"
-#include "fourcc.h"
-#include "libdha.h"
-#include "pci_ids.h"
-#include "pci_names.h"
-
-#include "sis_regs.h"
-#include "sis_defs.h"
-
-
-/** Random defines **/
-
-#define WATCHDOG_DELAY 500000 /* Watchdog counter for retrace waiting */
-#define IMAGE_MIN_WIDTH 32 /* Min and max source image sizes */
-#define IMAGE_MIN_HEIGHT 24
-#define IMAGE_MAX_WIDTH 720
-#define IMAGE_MAX_HEIGHT 576
-#define IMAGE_MAX_WIDTH_M650 1920
-#define IMAGE_MAX_HEIGHT_M650 1080
-
-#define OVERLAY_MIN_WIDTH 32 /* Minimum overlay sizes */
-#define OVERLAY_MIN_HEIGHT 24
-
-#define DISPMODE_SINGLE1 0x1 /* TW: CRT1 only */
-#define DISPMODE_SINGLE2 0x2 /* TW: CRT2 only */
-#define DISPMODE_MIRROR 0x4 /* TW: CRT1 + CRT2 MIRROR */
-
-#define VMODE_INTERLACED 0x1
-#define VMODE_DOUBLESCAN 0x2
-
-typedef struct {
- short x1, y1, x2, y2;
-} BoxRec;
-
-typedef struct {
- int pixelFormat;
-
- uint16_t pitch;
- uint16_t origPitch;
-
- uint8_t keyOP;
- uint16_t HUSF;
- uint16_t VUSF;
- uint8_t IntBit;
- uint8_t wHPre;
-
- uint16_t srcW;
- uint16_t srcH;
-
- BoxRec dstBox;
-
- uint32_t PSY;
- uint32_t PSV;
- uint32_t PSU;
- uint8_t bobEnable;
-
- uint8_t contrastCtrl;
- uint8_t contrastFactor;
-
- uint8_t lineBufSize;
-
- uint8_t(*VBlankActiveFunc) ();
-
- uint16_t SCREENheight;
-
-} SISOverlayRec, *SISOverlayPtr;
-
-
-/** static variable definitions **/
-static int sis_probed = 0;
-static pciinfo_t pci_info;
-unsigned int sis_verbose = 0;
-
-static void *sis_mem_base;
-/* static void *sis_reg_base; */
-unsigned short sis_iobase;
-
-unsigned int sis_vga_engine = UNKNOWN_VGA;
-static unsigned int sis_displaymode = DISPMODE_SINGLE1;
-static unsigned int sis_has_two_overlays = 0;
-static unsigned int sis_bridge_is_slave = 0;
-static unsigned int sis_shift_value = 1;
-static unsigned int sis_vmode = 0;
-unsigned int sis_vbflags = DISPTYPE_DISP1;
-unsigned int sis_overlay_on_crt1 = 1;
-unsigned int sis_crt1_off = -1;
-unsigned int sis_detected_crt2_devices;
-unsigned int sis_force_crt2_type = CRT2_DEFAULT;
-unsigned int sis_device_id = -1;
-
-static int sis_format;
-static int sis_Yoff = 0;
-static int sis_Voff = 0;
-static int sis_Uoff = 0;
-static int sis_screen_width = 640;
-static int sis_screen_height = 480;
-
-static int sis_frames[VID_PLAY_MAXFRAMES];
-
-static vidix_grkey_t sis_grkey;
-
-static vidix_capability_t sis_cap = {
- "SiS 300/310/325 Video Driver",
- "Jake Page",
- TYPE_OUTPUT,
- {0, 0, 0, 0},
- 2048,
- 2048,
- 4,
- 4,
- -1,
- FLAG_UPSCALER | FLAG_DOWNSCALER | FLAG_EQUALIZER,
- VENDOR_SIS,
- -1,
- {0, 0, 0, 0}
-};
-
-vidix_video_eq_t sis_equal = {
- VEQ_CAP_BRIGHTNESS | VEQ_CAP_CONTRAST,
- 200, 0, 0, 0, 0, 0, 0, 0
-};
-
-static unsigned short sis_card_ids[] = {
- DEVICE_SIS_300,
- DEVICE_SIS_315H,
- DEVICE_SIS_315,
- DEVICE_SIS_315PRO,
- DEVICE_SIS_330,
- DEVICE_SIS_540_VGA,
- DEVICE_SIS_550_VGA,
- DEVICE_SIS_630_VGA,
- DEVICE_SIS_650_VGA
-};
-
-/** function declarations **/
-
-extern void sis_init_video_bridge();
-
-
-static void set_overlay(SISOverlayPtr pOverlay, int index);
-static void close_overlay(void);
-static void calc_scale_factor(SISOverlayPtr pOverlay,
- int index, int iscrt2);
-static void set_line_buf_size(SISOverlayPtr pOverlay);
-static void merge_line_buf(int enable);
-static void set_format(SISOverlayPtr pOverlay);
-static void set_colorkey(void);
-
-static void set_brightness(uint8_t brightness);
-static void set_contrast(uint8_t contrast);
-static void set_saturation(char saturation);
-static void set_hue(uint8_t hue);
-#if 0
-static void set_alpha(uint8_t alpha);
-#endif
-
-/* IO Port access functions */
-static uint8_t getvideoreg(uint8_t reg)
-{
- uint8_t ret;
- inSISIDXREG(SISVID, reg, ret);
- return (ret);
-}
-
-static void setvideoreg(uint8_t reg, uint8_t data)
-{
- outSISIDXREG(SISVID, reg, data);
-}
-
-static void setvideoregmask(uint8_t reg, uint8_t data, uint8_t mask)
-{
- uint8_t old;
-
- inSISIDXREG(SISVID, reg, old);
- data = (data & mask) | (old & (~mask));
- outSISIDXREG(SISVID, reg, data);
-}
-
-static void setsrregmask(uint8_t reg, uint8_t data, uint8_t mask)
-{
- uint8_t old;
-
- inSISIDXREG(SISSR, reg, old);
- data = (data & mask) | (old & (~mask));
- outSISIDXREG(SISSR, reg, data);
-}
-
-/* vblank checking*/
-static uint8_t vblank_active_CRT1()
-{
- /* this may be too simplistic? */
- return (inSISREG(SISINPSTAT) & 0x08);
-}
-
-static uint8_t vblank_active_CRT2()
-{
- uint8_t ret;
- if (sis_vga_engine == SIS_315_VGA) {
- inSISIDXREG(SISPART1, Index_310_CRT2_FC_VR, ret);
- } else {
- inSISIDXREG(SISPART1, Index_CRT2_FC_VR, ret);
- }
- return ((ret & 0x02) ^ 0x02);
-}
-
-
-unsigned int vixGetVersion(void)
-{
- return (VIDIX_VERSION);
-}
-
-static int find_chip(unsigned chip_id)
-{
- unsigned i;
- for (i = 0; i < sizeof(sis_card_ids) / sizeof(unsigned short); i++) {
- if (chip_id == sis_card_ids[i])
- return i;
- }
- return -1;
-}
-
-int vixProbe(int verbose, int force)
-{
- pciinfo_t lst[MAX_PCI_DEVICES];
- unsigned i, num_pci;
- int err;
-
- sis_verbose = verbose;
- force = force;
- err = pci_scan(lst, &num_pci);
- if (err) {
- printf("[SiS] Error occurred during pci scan: %s\n", strerror(err));
- return err;
- } else if(!enable_app_io()){
- err = ENXIO;
- for (i = 0; i < num_pci; i++) {
- if (lst[i].vendor == VENDOR_SIS) {
- int idx;
- const char *dname;
- idx = find_chip(lst[i].device);
- if (idx == -1)
- continue;
- dname = pci_device_name(VENDOR_SIS, lst[i].device);
- dname = dname ? dname : "Unknown chip";
- if (sis_verbose > 0)
- printf("[SiS] Found chip: %s (0x%X)\n",
- dname, lst[i].device);
- sis_device_id = sis_cap.device_id = lst[i].device;
- err = 0;
- memcpy(&pci_info, &lst[i], sizeof(pciinfo_t));
-
- sis_has_two_overlays = 0;
- switch (sis_cap.device_id) {
- case DEVICE_SIS_300:
- case DEVICE_SIS_630_VGA:
- sis_has_two_overlays = 1;
- case DEVICE_SIS_540_VGA:
- sis_vga_engine = SIS_300_VGA;
- break;
- case DEVICE_SIS_330:
- case DEVICE_SIS_550_VGA:
- sis_has_two_overlays = 1;
- case DEVICE_SIS_315H:
- case DEVICE_SIS_315:
- case DEVICE_SIS_315PRO:
- case DEVICE_SIS_650_VGA:
- /* M650 & 651 have 2 overlays */
- /* JCP: I think this works, but not really tested yet */
- {
- unsigned char CR5F;
- unsigned char tempreg1, tempreg2;
-
- inSISIDXREG(SISCR, 0x5F, CR5F);
- CR5F &= 0xf0;
- andSISIDXREG(SISCR, 0x5c, 0x07);
- inSISIDXREG(SISCR, 0x5c, tempreg1);
- tempreg1 &= 0xf8;
- setSISIDXREG(SISCR, 0x5c, 0x07, 0xf8);
- inSISIDXREG(SISCR, 0x5c, tempreg2);
- tempreg2 &= 0xf8;
- if ((!tempreg1) || (tempreg2)) {
- if (CR5F & 0x80) {
- sis_has_two_overlays = 1;
- }
- } else {
- sis_has_two_overlays = 1; /* ? */
- }
- if (sis_has_two_overlays) {
- if (sis_verbose > 0)
- printf
- ("[SiS] detected M650/651 with 2 overlays\n");
- }
- }
- sis_vga_engine = SIS_315_VGA;
- break;
- default:
- /* should never get here */
- sis_vga_engine = UNKNOWN_VGA;
- break;
- }
- }
- }
- } else {
- err = EPERM;
- }
-
- if (err && sis_verbose) {
- printf("[SiS] Can't find chip\n");
- } else {
- sis_probed = 1;
- }
-
- return err;
-}
-
-int vixInit(const char *args)
-{
- uint8_t sr_data, cr_data, cr_data2;
- char *env_overlay_crt;
-
- if (!sis_probed) {
- printf("[SiS] driver was not probed but is being initialized\n");
- return (EINTR);
- }
-
- /* JCP: this is WRONG. Need to coordinate w/ sisfb to use correct mem */
- /* map 16MB scary hack for now. */
- sis_mem_base = map_phys_mem(pci_info.base0, 0x1000000);
- /* sis_reg_base = map_phys_mem(pci_info.base1, 0x20000); */
- sis_iobase = pci_info.base2 & 0xFFFC;
-
- /* would like to use fb ioctl - or some other method - here to get
- current resolution. */
- inSISIDXREG(SISCR, 0x12, cr_data);
- inSISIDXREG(SISCR, 0x07, cr_data2);
- sis_screen_height =
- ((cr_data & 0xff) | ((uint16_t) (cr_data2 & 0x02) << 7) |
- ((uint16_t) (cr_data2 & 0x40) << 3) | ((uint16_t) (cr_data & 0x02)
- << 9)) + 1;
-
- inSISIDXREG(SISSR, 0x0b, sr_data);
- inSISIDXREG(SISCR, 0x01, cr_data);
- sis_screen_width = (((cr_data & 0xff) |
- ((uint16_t) (sr_data & 0x0C) << 6)) + 1) * 8;
-
- inSISIDXREG(SISSR, Index_SR_Graphic_Mode, sr_data);
- if (sr_data & 0x20) /* interlaced mode */
- sis_vmode |= VMODE_INTERLACED;
-
-#if 0 /* getting back false data here... */
- /* CR9 bit 7 set = double scan active */
- inSISIDXREG(SISCR, 0x09, cr_data);
- if (cr_data & 0x40) {
- sis_vmode |= VMODE_DOUBLESCAN;
- }
-#endif
-
- /* JCP: eventually I'd like to replace this with a call to sisfb
- SISFB_GET_INFO ioctl to get video bridge info. Not for now,
- since it requires a very new and not widely distributed version. */
- sis_init_video_bridge();
-
- env_overlay_crt = getenv("VIDIX_CRT");
- if (env_overlay_crt) {
- int crt = atoi(env_overlay_crt);
- if (crt == 1 || crt == 2) {
- sis_overlay_on_crt1 = (crt == 1);
- if (sis_verbose > 0) {
- printf
- ("[SiS] override: using overlay on CRT%d from VIDIX_CRT\n",
- crt);
- }
- }
- }
-
- return 0;
-}
-
-void vixDestroy(void)
-{
- /* unmap_phys_mem(sis_reg_base, 0x20000); */
- /* JCP: see above, hence also a hack. */
- unmap_phys_mem(sis_mem_base, 0x1000000);
-}
-
-int vixGetCapability(vidix_capability_t * to)
-{
- memcpy(to, &sis_cap, sizeof(vidix_capability_t));
- return 0;
-}
-
-static int is_supported_fourcc(uint32_t fourcc)
-{
- switch (fourcc) {
- case IMGFMT_YV12:
- case IMGFMT_I420:
- case IMGFMT_UYVY:
- case IMGFMT_YUY2:
- case IMGFMT_RGB15:
- case IMGFMT_RGB16:
- return 1;
- default:
- return 0;
- }
-}
-
-int vixQueryFourcc(vidix_fourcc_t * to)
-{
- if (is_supported_fourcc(to->fourcc)) {
- to->depth = VID_DEPTH_8BPP | VID_DEPTH_16BPP | VID_DEPTH_32BPP;
- to->flags = VID_CAP_EXPAND | VID_CAP_SHRINK | VID_CAP_COLORKEY;
- return 0;
- } else
- to->depth = to->flags = 0;
- return ENOSYS;
-}
-
-static int bridge_in_slave_mode()
-{
- unsigned char usScratchP1_00;
-
- if (!(sis_vbflags & VB_VIDEOBRIDGE))
- return 0;
-
- inSISIDXREG(SISPART1, 0x00, usScratchP1_00);
- if (((sis_vga_engine == SIS_300_VGA)
- && (usScratchP1_00 & 0xa0) == 0x20)
- || ((sis_vga_engine == SIS_315_VGA)
- && (usScratchP1_00 & 0x50) == 0x10)) {
- return 1;
- } else {
- return 0;
- }
-}
-
-/* This does not handle X dual head mode, since 1) vidix doesn't support it
- and 2) it doesn't make sense for other gfx drivers */
-static void set_dispmode()
-{
- sis_bridge_is_slave = 0;
-
- if (bridge_in_slave_mode())
- sis_bridge_is_slave = 1;
-
- if ((sis_vbflags & VB_DISPMODE_MIRROR) ||
- (sis_bridge_is_slave && (sis_vbflags & DISPTYPE_DISP2))) {
- if (sis_has_two_overlays)
- sis_displaymode = DISPMODE_MIRROR; /* TW: CRT1+CRT2 (2 overlays) */
- else if (!sis_overlay_on_crt1)
- sis_displaymode = DISPMODE_SINGLE2;
- else
- sis_displaymode = DISPMODE_SINGLE1;
- } else {
- if (sis_vbflags & DISPTYPE_DISP1) {
- sis_displaymode = DISPMODE_SINGLE1; /* TW: CRT1 only */
- } else {
- sis_displaymode = DISPMODE_SINGLE2; /* TW: CRT2 only */
- }
- }
-}
-
-static void set_disptype_regs()
-{
- switch (sis_displaymode) {
- case DISPMODE_SINGLE1: /* TW: CRT1 only */
- if (sis_verbose > 2) {
- printf("[SiS] Setting up overlay on CRT1\n");
- }
- if (sis_has_two_overlays) {
- setsrregmask(0x06, 0x00, 0xc0);
- setsrregmask(0x32, 0x00, 0xc0);
- } else {
- setsrregmask(0x06, 0x00, 0xc0);
- setsrregmask(0x32, 0x00, 0xc0);
- }
- break;
- case DISPMODE_SINGLE2: /* TW: CRT2 only */
- if (sis_verbose > 2) {
- printf("[SiS] Setting up overlay on CRT2\n");
- }
- if (sis_has_two_overlays) {
- setsrregmask(0x06, 0x80, 0xc0);
- setsrregmask(0x32, 0x80, 0xc0);
- } else {
- setsrregmask(0x06, 0x40, 0xc0);
- setsrregmask(0x32, 0x40, 0xc0);
- }
- break;
- case DISPMODE_MIRROR: /* TW: CRT1 + CRT2 */
- default:
- if (sis_verbose > 2) {
- printf("[SiS] Setting up overlay on CRT1 AND CRT2!\n");
- }
- setsrregmask(0x06, 0x80, 0xc0);
- setsrregmask(0x32, 0x80, 0xc0);
- break;
- }
-}
-
-static void init_overlay()
-{
- /* Initialize first overlay (CRT1) */
-
- /* Write-enable video registers */
- setvideoregmask(Index_VI_Control_Misc2, 0x80, 0x81);
-
- /* Disable overlay */
- setvideoregmask(Index_VI_Control_Misc0, 0x00, 0x02);
-
- /* Disable bobEnable */
- setvideoregmask(Index_VI_Control_Misc1, 0x02, 0x02);
-
- /* Reset scale control and contrast */
- setvideoregmask(Index_VI_Scale_Control, 0x60, 0x60);
- setvideoregmask(Index_VI_Contrast_Enh_Ctrl, 0x04, 0x1F);
-
- setvideoreg(Index_VI_Disp_Y_Buf_Preset_Low, 0x00);
- setvideoreg(Index_VI_Disp_Y_Buf_Preset_Middle, 0x00);
- setvideoreg(Index_VI_UV_Buf_Preset_Low, 0x00);
- setvideoreg(Index_VI_UV_Buf_Preset_Middle, 0x00);
- setvideoreg(Index_VI_Disp_Y_UV_Buf_Preset_High, 0x00);
- setvideoreg(Index_VI_Play_Threshold_Low, 0x00);
- setvideoreg(Index_VI_Play_Threshold_High, 0x00);
-
- /* may not want to init these here, could already be set to other
- values by app? */
- setvideoregmask(Index_VI_Control_Misc2, 0x00, 0x01);
- setvideoregmask(Index_VI_Contrast_Enh_Ctrl, 0x04, 0x07);
- setvideoreg(Index_VI_Brightness, 0x20);
- if (sis_vga_engine == SIS_315_VGA) {
- setvideoreg(Index_VI_Hue, 0x00);
- setvideoreg(Index_VI_Saturation, 0x00);
- }
-
- /* Initialize second overlay (CRT2) */
- if (sis_has_two_overlays) {
- /* Write-enable video registers */
- setvideoregmask(Index_VI_Control_Misc2, 0x81, 0x81);
-
- /* Disable overlay */
- setvideoregmask(Index_VI_Control_Misc0, 0x00, 0x02);
-
- /* Disable bobEnable */
- setvideoregmask(Index_VI_Control_Misc1, 0x02, 0x02);
-
- /* Reset scale control and contrast */
- setvideoregmask(Index_VI_Scale_Control, 0x60, 0x60);
- setvideoregmask(Index_VI_Contrast_Enh_Ctrl, 0x04, 0x1F);
-
- setvideoreg(Index_VI_Disp_Y_Buf_Preset_Low, 0x00);
- setvideoreg(Index_VI_Disp_Y_Buf_Preset_Middle, 0x00);
- setvideoreg(Index_VI_UV_Buf_Preset_Low, 0x00);
- setvideoreg(Index_VI_UV_Buf_Preset_Middle, 0x00);
- setvideoreg(Index_VI_Disp_Y_UV_Buf_Preset_High, 0x00);
- setvideoreg(Index_VI_Play_Threshold_Low, 0x00);
- setvideoreg(Index_VI_Play_Threshold_High, 0x00);
-
- setvideoregmask(Index_VI_Control_Misc2, 0x01, 0x01);
- setvideoregmask(Index_VI_Contrast_Enh_Ctrl, 0x04, 0x07);
- setvideoreg(Index_VI_Brightness, 0x20);
- if (sis_vga_engine == SIS_315_VGA) {
- setvideoreg(Index_VI_Hue, 0x00);
- setvideoreg(Index_VI_Saturation, 0x00);
- }
- }
-}
-
-int vixConfigPlayback(vidix_playback_t * info)
-{
- SISOverlayRec overlay;
- int srcOffsetX = 0, srcOffsetY = 0;
- int sx, sy;
- int index = 0, iscrt2 = 0;
- int total_size;
-
- short src_w, drw_w;
- short src_h, drw_h;
- short src_x, drw_x;
- short src_y, drw_y;
- long dga_offset;
- int pitch;
- unsigned int i;
-
- if (!is_supported_fourcc(info->fourcc))
- return -1;
-
- /* set chipset/engine.dependent config info */
- /* which CRT to use, etc.? */
- switch (sis_vga_engine) {
- case SIS_315_VGA:
- sis_shift_value = 1;
- sis_equal.cap |= VEQ_CAP_SATURATION | VEQ_CAP_HUE;
- break;
- case SIS_300_VGA:
- default:
- sis_shift_value = 2;
- break;
- }
-
- sis_displaymode = DISPMODE_SINGLE1; /* xV driver code in set_dispmode() */
- set_dispmode();
-
- set_disptype_regs();
-
- init_overlay();
-
- /* get basic dimension info */
- src_x = info->src.x;
- src_y = info->src.y;
- src_w = info->src.w;
- src_h = info->src.h;
-
- drw_x = info->dest.x;
- drw_y = info->dest.y;
- drw_w = info->dest.w;
- drw_h = info->dest.h;
-
- switch (info->fourcc) {
- case IMGFMT_YV12:
- case IMGFMT_I420:
- pitch = (src_w + 7) & ~7;
- total_size = (pitch * src_h * 3) >> 1;
- break;
- case IMGFMT_YUY2:
- case IMGFMT_UYVY:
- case IMGFMT_RGB15:
- case IMGFMT_RGB16:
- pitch = ((src_w << 1) + 3) & ~3;
- total_size = pitch * src_h;
- break;
- default:
- return -1;
- }
-
- /* "allocate" memory for overlay! */
- /* start at 8MB = sisfb's "dri reserved space" -
- really shouldn't hardcode though */
- /* XXX: JCP - this can use the sisfb FBIO_ALLOC ioctl to safely
- allocate "video heap" memory... */
- dga_offset = 0x800000;
-
- /* use 7MB for now. need to calc/get real info from sisfb? */
- /* this can result in a LOT of frames - probably not necessary */
- info->num_frames = 0x700000 / (total_size * 2);
- if (info->num_frames > VID_PLAY_MAXFRAMES)
- info->num_frames = VID_PLAY_MAXFRAMES;
-
- info->dga_addr = sis_mem_base + dga_offset;
- info->dest.pitch.y = 16;
- info->dest.pitch.u = 16;
- info->dest.pitch.v = 16;
- info->offset.y = 0;
- info->offset.u = 0;
- info->offset.v = 0;
- info->frame_size = (total_size * 2); /* why times 2 ? */
- for (i = 0; i < info->num_frames; i++) {
- info->offsets[i] = info->frame_size * i;
- /* save ptrs to mem buffers */
- sis_frames[i] = (dga_offset + info->offsets[i]);
- }
-
- memset(&overlay, 0, sizeof(overlay));
- overlay.pixelFormat = sis_format = info->fourcc;
- overlay.pitch = overlay.origPitch = pitch;
-
-
- overlay.keyOP = (sis_grkey.ckey.op == CKEY_TRUE ?
- VI_ROP_DestKey : VI_ROP_Always);
-
- overlay.bobEnable = 0x00;
-
- overlay.SCREENheight = sis_screen_height;
-
- /* probably will not support X virtual screen > phys very well? */
- overlay.dstBox.x1 = drw_x; /* - pScrn->frameX0; */
- overlay.dstBox.x2 = drw_x + drw_w; /* - pScrn->frameX0; ??? */
- overlay.dstBox.y1 = drw_y; /* - pScrn->frameY0; */
- overlay.dstBox.y2 = drw_y + drw_h; /* - pScrn->frameY0; ??? */
-
- if ((overlay.dstBox.x1 > overlay.dstBox.x2) ||
- (overlay.dstBox.y1 > overlay.dstBox.y2))
- return -1;
-
- if ((overlay.dstBox.x2 < 0) || (overlay.dstBox.y2 < 0))
- return -1;
-
- if (overlay.dstBox.x1 < 0) {
- srcOffsetX = src_w * (-overlay.dstBox.x1) / drw_w;
- overlay.dstBox.x1 = 0;
- }
- if (overlay.dstBox.y1 < 0) {
- srcOffsetY = src_h * (-overlay.dstBox.y1) / drw_h;
- overlay.dstBox.y1 = 0;
- }
-
- switch (info->fourcc) {
- case IMGFMT_YV12:
- info->dest.pitch.y = 16;
- sx = (src_x + srcOffsetX) & ~7;
- sy = (src_y + srcOffsetY) & ~1;
- info->offset.y = sis_Yoff = sx + sy * pitch;
- /* JCP: NOTE reversed u & v here! Not sure why this is needed.
- maybe mplayer & sis define U & V differently?? */
- info->offset.u = sis_Voff =
- src_h * pitch + ((sx + sy * pitch / 2) >> 1);
- info->offset.v = sis_Uoff =
- src_h * pitch * 5 / 4 + ((sx + sy * pitch / 2) >> 1);
-
- overlay.PSY = (sis_frames[0] + sis_Yoff) >> sis_shift_value;
- overlay.PSV = (sis_frames[0] + sis_Voff) >> sis_shift_value;
- overlay.PSU = (sis_frames[0] + sis_Uoff) >> sis_shift_value;
- break;
- case IMGFMT_I420:
- sx = (src_x + srcOffsetX) & ~7;
- sy = (src_y + srcOffsetY) & ~1;
- info->offset.y = sis_Yoff = sx + sy * pitch;
- /* JCP: see above... */
- info->offset.u = sis_Voff =
- src_h * pitch * 5 / 4 + ((sx + sy * pitch / 2) >> 1);
- info->offset.v = sis_Uoff =
- src_h * pitch + ((sx + sy * pitch / 2) >> 1);
-
- overlay.PSY = (sis_frames[0] + sis_Yoff) >> sis_shift_value;
- overlay.PSV = (sis_frames[0] + sis_Voff) >> sis_shift_value;
- overlay.PSU = (sis_frames[0] + sis_Uoff) >> sis_shift_value;
- break;
- case IMGFMT_YUY2:
- case IMGFMT_UYVY:
- case IMGFMT_RGB16:
- case IMGFMT_RGB15:
- default:
- sx = (src_x + srcOffsetX) & ~1;
- sy = (src_y + srcOffsetY);
- info->offset.y = sis_Yoff = sx * 2 + sy * pitch;
-
- overlay.PSY = (sis_frames[0] + sis_Yoff) >> sis_shift_value;
- break;
- }
-
- /* FIXME: is it possible that srcW < 0? */
- overlay.srcW = src_w - (sx - src_x);
- overlay.srcH = src_h - (sy - src_y);
-
- /* JCP: what to do about this? */
-#if 0
- if ((pPriv->oldx1 != overlay.dstBox.x1) ||
- (pPriv->oldx2 != overlay.dstBox.x2) ||
- (pPriv->oldy1 != overlay.dstBox.y1) ||
- (pPriv->oldy2 != overlay.dstBox.y2)) {
- pPriv->mustwait = 1;
- pPriv->oldx1 = overlay.dstBox.x1;
- pPriv->oldx2 = overlay.dstBox.x2;
- pPriv->oldy1 = overlay.dstBox.y1;
- pPriv->oldy2 = overlay.dstBox.y2;
- }
-#endif
-
- /* set merge line buffer */
- merge_line_buf(overlay.srcW > 384);
-
- /* calculate line buffer length */
- set_line_buf_size(&overlay);
-
- if (sis_displaymode == DISPMODE_SINGLE2) {
- if (sis_has_two_overlays) {
- /* TW: On chips with two overlays we use
- * overlay 2 for CRT2 */
- index = 1;
- iscrt2 = 1;
- } else {
- /* TW: On chips with only one overlay we
- * use that only overlay for CRT2 */
- index = 0;
- iscrt2 = 1;
- }
- overlay.VBlankActiveFunc = vblank_active_CRT2;
- /* overlay.GetScanLineFunc = get_scanline_CRT2; */
- } else {
- index = 0;
- iscrt2 = 0;
- overlay.VBlankActiveFunc = vblank_active_CRT1;
- /* overlay.GetScanLineFunc = get_scanline_CRT1; */
- }
-
- /* calc scale factor (to use below) */
- calc_scale_factor(&overlay, index, iscrt2);
-
- /* Select video1 (used for CRT1) or video2 (used for CRT2) */
- setvideoregmask(Index_VI_Control_Misc2, index, 0x01);
-
- set_format(&overlay);
-
- set_colorkey();
-
- vixPlaybackSetEq(&sis_equal);
-
- /* set up video overlay registers */
- set_overlay(&overlay, index);
-
- /* prevent badness if bits are not at default setting */
- setvideoregmask(Index_VI_Control_Misc1, 0x00, 0x01);
- setvideoregmask(Index_VI_Control_Misc2, 0x00, 0x04);
-
- /* JCP: Xv driver implementation loops back over above code to
- setup mirror CRT2 */
-
- return 0;
-}
-
-int vixPlaybackOn(void)
-{
- setvideoregmask(Index_VI_Control_Misc0, 0x02, 0x02);
- return 0;
-}
-
-int vixPlaybackOff(void)
-{
- unsigned char sridx, cridx;
- sridx = inSISREG(SISSR);
- cridx = inSISREG(SISCR);
- close_overlay();
- outSISREG(SISSR, sridx);
- outSISREG(SISCR, cridx);
-
- return 0;
-}
-
-int vixPlaybackFrameSelect(unsigned int frame)
-{
- uint8_t data;
- int index = 0;
- uint32_t PSY;
-
- if (sis_displaymode == DISPMODE_SINGLE2 && sis_has_two_overlays) {
- index = 1;
- }
-
- PSY = (sis_frames[frame] + sis_Yoff) >> sis_shift_value;
-
- /* Unlock address registers */
- data = getvideoreg(Index_VI_Control_Misc1);
- setvideoreg(Index_VI_Control_Misc1, data | 0x20);
- /* TEST: Is this required? */
- setvideoreg(Index_VI_Control_Misc1, data | 0x20);
- /* TEST end */
- /* TEST: Is this required? */
- if (sis_vga_engine == SIS_315_VGA)
- setvideoreg(Index_VI_Control_Misc3, 0x00);
- /* TEST end */
-
- /* set Y start address */
- setvideoreg(Index_VI_Disp_Y_Buf_Start_Low, (uint8_t) (PSY));
- setvideoreg(Index_VI_Disp_Y_Buf_Start_Middle, (uint8_t) ((PSY) >> 8));
- setvideoreg(Index_VI_Disp_Y_Buf_Start_High, (uint8_t) ((PSY) >> 16));
- /* set 310/325 series overflow bits for Y plane */
- if (sis_vga_engine == SIS_315_VGA) {
- setvideoreg(Index_VI_Y_Buf_Start_Over,
- ((uint8_t) ((PSY) >> 24) & 0x01));
- }
-
- /* Set U/V data if using plane formats */
- if ((sis_format == IMGFMT_YV12) || (sis_format == IMGFMT_I420)) {
-
- uint32_t PSU, PSV;
-
- PSU = (sis_frames[frame] + sis_Uoff) >> sis_shift_value;
- PSV = (sis_frames[frame] + sis_Voff) >> sis_shift_value;
-
- /* set U/V start address */
- setvideoreg(Index_VI_U_Buf_Start_Low, (uint8_t) PSU);
- setvideoreg(Index_VI_U_Buf_Start_Middle, (uint8_t) (PSU >> 8));
- setvideoreg(Index_VI_U_Buf_Start_High, (uint8_t) (PSU >> 16));
-
- setvideoreg(Index_VI_V_Buf_Start_Low, (uint8_t) PSV);
- setvideoreg(Index_VI_V_Buf_Start_Middle, (uint8_t) (PSV >> 8));
- setvideoreg(Index_VI_V_Buf_Start_High, (uint8_t) (PSV >> 16));
-
- /* 310/325 series overflow bits */
- if (sis_vga_engine == SIS_315_VGA) {
- setvideoreg(Index_VI_U_Buf_Start_Over,
- ((uint8_t) (PSU >> 24) & 0x01));
- setvideoreg(Index_VI_V_Buf_Start_Over,
- ((uint8_t) (PSV >> 24) & 0x01));
- }
- }
-
- if (sis_vga_engine == SIS_315_VGA) {
- /* Trigger register copy for 310 series */
- setvideoreg(Index_VI_Control_Misc3, 1 << index);
- }
-
- /* Lock the address registers */
- setvideoregmask(Index_VI_Control_Misc1, 0x00, 0x20);
-
- return 0;
-}
-
-int vixGetGrKeys(vidix_grkey_t * grkey)
-{
- memcpy(grkey, &sis_grkey, sizeof(vidix_grkey_t));
- return 0;
-}
-
-int vixSetGrKeys(const vidix_grkey_t * grkey)
-{
- memcpy(&sis_grkey, grkey, sizeof(vidix_grkey_t));
- set_colorkey();
- return 0;
-}
-
-int vixPlaybackGetEq(vidix_video_eq_t * eq)
-{
- memcpy(eq, &sis_equal, sizeof(vidix_video_eq_t));
- return 0;
-}
-
-int vixPlaybackSetEq(const vidix_video_eq_t * eq)
-{
- int br, sat, cr, hue;
- if (eq->cap & VEQ_CAP_BRIGHTNESS)
- sis_equal.brightness = eq->brightness;
- if (eq->cap & VEQ_CAP_CONTRAST)
- sis_equal.contrast = eq->contrast;
- if (eq->cap & VEQ_CAP_SATURATION)
- sis_equal.saturation = eq->saturation;
- if (eq->cap & VEQ_CAP_HUE)
- sis_equal.hue = eq->hue;
- if (eq->cap & VEQ_CAP_RGB_INTENSITY) {
- sis_equal.red_intensity = eq->red_intensity;
- sis_equal.green_intensity = eq->green_intensity;
- sis_equal.blue_intensity = eq->blue_intensity;
- }
- sis_equal.flags = eq->flags;
-
- cr = (sis_equal.contrast + 1000) * 7 / 2000;
- if (cr < 0)
- cr = 0;
- if (cr > 7)
- cr = 7;
-
- br = sis_equal.brightness * 127 / 1000;
- if (br < -128)
- br = -128;
- if (br > 127)
- br = 127;
-
- sat = (sis_equal.saturation * 7) / 1000;
- if (sat < -7)
- sat = -7;
- if (sat > 7)
- sat = 7;
-
- hue = sis_equal.hue * 7 / 1000;
- if (hue < -8)
- hue = -8;
- if (hue > 7)
- hue = 7;
-
- set_brightness(br);
- set_contrast(cr);
- if (sis_vga_engine == SIS_315_VGA) {
- set_saturation(sat);
- set_hue(hue);
- }
-
- return 0;
-}
-
-static void set_overlay(SISOverlayPtr pOverlay, int index)
-{
- uint16_t pitch = 0;
- uint8_t h_over = 0, v_over = 0;
- uint16_t top, bottom, left, right;
- uint16_t screenX = sis_screen_width;
- uint16_t screenY = sis_screen_height;
- uint8_t data;
- uint32_t watchdog;
-
- top = pOverlay->dstBox.y1;
- bottom = pOverlay->dstBox.y2;
- if (bottom > screenY) {
- bottom = screenY;
- }
-
- left = pOverlay->dstBox.x1;
- right = pOverlay->dstBox.x2;
- if (right > screenX) {
- right = screenX;
- }
-
- /* JCP: these aren't really tested... */
- /* TW: DoubleScan modes require Y coordinates * 2 */
- if (sis_vmode & VMODE_DOUBLESCAN) {
- top <<= 1;
- bottom <<= 1;
- }
- /* TW: Interlace modes require Y coordinates / 2 */
- if (sis_vmode & VMODE_INTERLACED) {
- top >>= 1;
- bottom >>= 1;
- }
-
- h_over = (((left >> 8) & 0x0f) | ((right >> 4) & 0xf0));
- v_over = (((top >> 8) & 0x0f) | ((bottom >> 4) & 0xf0));
-
- pitch = pOverlay->pitch >> sis_shift_value;
-
- /* set line buffer size */
- setvideoreg(Index_VI_Line_Buffer_Size, pOverlay->lineBufSize);
-
- /* set color key mode */
- setvideoregmask(Index_VI_Key_Overlay_OP, pOverlay->keyOP, 0x0F);
-
- /* TW: We don't have to wait for vertical retrace in all cases */
- /* JCP: be safe for now. */
- if (1 /*pPriv->mustwait */ ) {
- watchdog = WATCHDOG_DELAY;
- while (pOverlay->VBlankActiveFunc() && --watchdog);
- watchdog = WATCHDOG_DELAY;
- while ((!pOverlay->VBlankActiveFunc()) && --watchdog);
- if (!watchdog && sis_verbose > 0) {
- printf("[SiS]: timed out waiting for vertical retrace\n");
- }
- }
-
- /* Unlock address registers */
- data = getvideoreg(Index_VI_Control_Misc1);
- setvideoreg(Index_VI_Control_Misc1, data | 0x20);
- /* TEST: Is this required? */
- setvideoreg(Index_VI_Control_Misc1, data | 0x20);
- /* TEST end */
-
- /* TEST: Is this required? */
- if (sis_vga_engine == SIS_315_VGA)
- setvideoreg(Index_VI_Control_Misc3, 0x00);
- /* TEST end */
-
- /* Set Y buf pitch */
- setvideoreg(Index_VI_Disp_Y_Buf_Pitch_Low, (uint8_t) (pitch));
- setvideoregmask(Index_VI_Disp_Y_UV_Buf_Pitch_Middle,
- (uint8_t) (pitch >> 8), 0x0f);
-
- /* Set Y start address */
- setvideoreg(Index_VI_Disp_Y_Buf_Start_Low, (uint8_t) (pOverlay->PSY));
- setvideoreg(Index_VI_Disp_Y_Buf_Start_Middle,
- (uint8_t) ((pOverlay->PSY) >> 8));
- setvideoreg(Index_VI_Disp_Y_Buf_Start_High,
- (uint8_t) ((pOverlay->PSY) >> 16));
-
- /* set 310/325 series overflow bits for Y plane */
- if (sis_vga_engine == SIS_315_VGA) {
- setvideoreg(Index_VI_Disp_Y_Buf_Pitch_High,
- (uint8_t) (pitch >> 12));
- setvideoreg(Index_VI_Y_Buf_Start_Over,
- ((uint8_t) ((pOverlay->PSY) >> 24) & 0x01));
- }
-
- /* Set U/V data if using plane formats */
- if ((pOverlay->pixelFormat == IMGFMT_YV12) ||
- (pOverlay->pixelFormat == IMGFMT_I420)) {
-
- uint32_t PSU, PSV;
-
- PSU = pOverlay->PSU;
- PSV = pOverlay->PSV;
-
- /* Set U/V pitch */
- setvideoreg(Index_VI_Disp_UV_Buf_Pitch_Low,
- (uint8_t) (pitch >> 1));
- setvideoregmask(Index_VI_Disp_Y_UV_Buf_Pitch_Middle,
- (uint8_t) (pitch >> 5), 0xf0);
-
- /* set U/V start address */
- setvideoreg(Index_VI_U_Buf_Start_Low, (uint8_t) PSU);
- setvideoreg(Index_VI_U_Buf_Start_Middle, (uint8_t) (PSU >> 8));
- setvideoreg(Index_VI_U_Buf_Start_High, (uint8_t) (PSU >> 16));
-
- setvideoreg(Index_VI_V_Buf_Start_Low, (uint8_t) PSV);
- setvideoreg(Index_VI_V_Buf_Start_Middle, (uint8_t) (PSV >> 8));
- setvideoreg(Index_VI_V_Buf_Start_High, (uint8_t) (PSV >> 16));
-
- /* 310/325 series overflow bits */
- if (sis_vga_engine == SIS_315_VGA) {
- setvideoreg(Index_VI_Disp_UV_Buf_Pitch_High,
- (uint8_t) (pitch >> 13));
- setvideoreg(Index_VI_U_Buf_Start_Over,
- ((uint8_t) (PSU >> 24) & 0x01));
- setvideoreg(Index_VI_V_Buf_Start_Over,
- ((uint8_t) (PSV >> 24) & 0x01));
- }
- }
-
- if (sis_vga_engine == SIS_315_VGA) {
- /* Trigger register copy for 310 series */
- setvideoreg(Index_VI_Control_Misc3, 1 << index);
- }
-
- /* set scale factor */
- setvideoreg(Index_VI_Hor_Post_Up_Scale_Low,
- (uint8_t) (pOverlay->HUSF));
- setvideoreg(Index_VI_Hor_Post_Up_Scale_High,
- (uint8_t) ((pOverlay->HUSF) >> 8));
- setvideoreg(Index_VI_Ver_Up_Scale_Low, (uint8_t) (pOverlay->VUSF));
- setvideoreg(Index_VI_Ver_Up_Scale_High,
- (uint8_t) ((pOverlay->VUSF) >> 8));
-
- setvideoregmask(Index_VI_Scale_Control, (pOverlay->IntBit << 3)
- | (pOverlay->wHPre), 0x7f);
-
- /* set destination window position */
- setvideoreg(Index_VI_Win_Hor_Disp_Start_Low, (uint8_t) left);
- setvideoreg(Index_VI_Win_Hor_Disp_End_Low, (uint8_t) right);
- setvideoreg(Index_VI_Win_Hor_Over, (uint8_t) h_over);
-
- setvideoreg(Index_VI_Win_Ver_Disp_Start_Low, (uint8_t) top);
- setvideoreg(Index_VI_Win_Ver_Disp_End_Low, (uint8_t) bottom);
- setvideoreg(Index_VI_Win_Ver_Over, (uint8_t) v_over);
-
- setvideoregmask(Index_VI_Control_Misc1, pOverlay->bobEnable, 0x1a);
-
- /* Lock the address registers */
- setvideoregmask(Index_VI_Control_Misc1, 0x00, 0x20);
-}
-
-
-/* TW: Overlay MUST NOT be switched off while beam is over it */
-static void close_overlay()
-{
- uint32_t watchdog;
-
- if ((sis_displaymode == DISPMODE_SINGLE2) ||
- (sis_displaymode == DISPMODE_MIRROR)) {
- if (sis_has_two_overlays) {
- setvideoregmask(Index_VI_Control_Misc2, 0x01, 0x01);
- watchdog = WATCHDOG_DELAY;
- while (vblank_active_CRT2() && --watchdog);
- watchdog = WATCHDOG_DELAY;
- while ((!vblank_active_CRT2()) && --watchdog);
- setvideoregmask(Index_VI_Control_Misc0, 0x00, 0x02);
- watchdog = WATCHDOG_DELAY;
- while (vblank_active_CRT2() && --watchdog);
- watchdog = WATCHDOG_DELAY;
- while ((!vblank_active_CRT2()) && --watchdog);
- } else if (sis_displaymode == DISPMODE_SINGLE2) {
- setvideoregmask(Index_VI_Control_Misc2, 0x00, 0x01);
- watchdog = WATCHDOG_DELAY;
- while (vblank_active_CRT1() && --watchdog);
- watchdog = WATCHDOG_DELAY;
- while ((!vblank_active_CRT1()) && --watchdog);
- setvideoregmask(Index_VI_Control_Misc0, 0x00, 0x02);
- watchdog = WATCHDOG_DELAY;
- while (vblank_active_CRT1() && --watchdog);
- watchdog = WATCHDOG_DELAY;
- while ((!vblank_active_CRT1()) && --watchdog);
- }
- }
- if ((sis_displaymode == DISPMODE_SINGLE1) ||
- (sis_displaymode == DISPMODE_MIRROR)) {
- setvideoregmask(Index_VI_Control_Misc2, 0x00, 0x01);
- watchdog = WATCHDOG_DELAY;
- while (vblank_active_CRT1() && --watchdog);
- watchdog = WATCHDOG_DELAY;
- while ((!vblank_active_CRT1()) && --watchdog);
- setvideoregmask(Index_VI_Control_Misc0, 0x00, 0x02);
- watchdog = WATCHDOG_DELAY;
- while (vblank_active_CRT1() && --watchdog);
- watchdog = WATCHDOG_DELAY;
- while ((!vblank_active_CRT1()) && --watchdog);
- }
-}
-
-
-static void
-calc_scale_factor(SISOverlayPtr pOverlay, int index, int iscrt2)
-{
- uint32_t i = 0, mult = 0;
- int flag = 0;
-
- int dstW = pOverlay->dstBox.x2 - pOverlay->dstBox.x1;
- int dstH = pOverlay->dstBox.y2 - pOverlay->dstBox.y1;
- int srcW = pOverlay->srcW;
- int srcH = pOverlay->srcH;
- /* uint16_t LCDheight = pSiS->LCDheight; */
- int srcPitch = pOverlay->origPitch;
- int origdstH = dstH;
-
- /* get rid of warnings for now */
- index = index;
- iscrt2 = iscrt2;
-
-#if 0 /* JCP: don't bother with this for now. */
- /* TW: Stretch image due to idiotic LCD "auto"-scaling on LVDS (and 630+301B) */
- if (pSiS->VBFlags & CRT2_LCD) {
- if (sis_bridge_is_slave) {
- if (pSiS->VBFlags & VB_LVDS) {
- dstH = (dstH * LCDheight) / pOverlay->SCREENheight;
- } else if ((sis_vga_engine == SIS_300_VGA) &&
- (pSiS->
- VBFlags & (VB_301B | VB_302B | VB_301LV |
- VB_302LV))) {
- dstH = (dstH * LCDheight) / pOverlay->SCREENheight;
- }
- } else if (iscrt2) {
- if (pSiS->VBFlags & VB_LVDS) {
- dstH = (dstH * LCDheight) / pOverlay->SCREENheight;
- if (sis_displaymode == DISPMODE_MIRROR)
- flag = 1;
- } else if ((sis_vga_engine == SIS_300_VGA) &&
- (pSiS->
- VBFlags & (VB_301B | VB_302B | VB_301LV |
- VB_302LV))) {
- dstH = (dstH * LCDheight) / pOverlay->SCREENheight;
- if (sis_displaymode == DISPMODE_MIRROR)
- flag = 1;
- }
- }
- }
-#endif
-
- /* TW: For double scan modes, we need to double the height
- * (Perhaps we also need to scale LVDS, but I'm not sure.)
- * On 310/325 series, we need to double the width as well.
- * Interlace mode vice versa.
- */
- if (sis_vmode & VMODE_DOUBLESCAN) {
- dstH = origdstH << 1;
- flag = 0;
- if (sis_vga_engine == SIS_315_VGA) {
- dstW <<= 1;
- }
- }
- if (sis_vmode & VMODE_INTERLACED) {
- dstH = origdstH >> 1;
- flag = 0;
- }
-
- if (dstW < OVERLAY_MIN_WIDTH)
- dstW = OVERLAY_MIN_WIDTH;
- if (dstW == srcW) {
- pOverlay->HUSF = 0x00;
- pOverlay->IntBit = 0x05;
- pOverlay->wHPre = 0;
- } else if (dstW > srcW) {
- dstW += 2;
- pOverlay->HUSF = (srcW << 16) / dstW;
- pOverlay->IntBit = 0x04;
- pOverlay->wHPre = 0;
- } else {
- int tmpW = dstW;
-
- /* TW: It seems, the hardware can't scale below factor .125 (=1/8) if the
- pitch isn't a multiple of 256.
- TODO: Test this on the 310/325 series!
- */
- if ((srcPitch % 256) || (srcPitch < 256)) {
- if (((dstW * 1000) / srcW) < 125)
- dstW = tmpW = ((srcW * 125) / 1000) + 1;
- }
-
- i = 0;
- pOverlay->IntBit = 0x01;
- while (srcW >= tmpW) {
- tmpW <<= 1;
- i++;
- }
- pOverlay->wHPre = (uint8_t) (i - 1);
- dstW <<= (i - 1);
- if ((srcW % dstW))
- pOverlay->HUSF = ((srcW - dstW) << 16) / dstW;
- else
- pOverlay->HUSF = 0x00;
- }
-
- if (dstH < OVERLAY_MIN_HEIGHT)
- dstH = OVERLAY_MIN_HEIGHT;
- if (dstH == srcH) {
- pOverlay->VUSF = 0x00;
- pOverlay->IntBit |= 0x0A;
- } else if (dstH > srcH) {
- dstH += 0x02;
- pOverlay->VUSF = (srcH << 16) / dstH;
- pOverlay->IntBit |= 0x08;
- } else {
- uint32_t realI;
-
- i = realI = srcH / dstH;
- pOverlay->IntBit |= 0x02;
-
- if (i < 2) {
- pOverlay->VUSF = ((srcH - dstH) << 16) / dstH;
- /* TW: Needed for LCD-scaling modes */
- if ((flag) && (mult = (srcH / origdstH)) >= 2)
- pOverlay->pitch /= mult;
- } else {
-#if 0
- if (((pOverlay->bobEnable & 0x08) == 0x00) &&
- (((srcPitch * i) >> 2) > 0xFFF)) {
- pOverlay->bobEnable |= 0x08;
- srcPitch >>= 1;
- }
-#endif
- if (((srcPitch * i) >> 2) > 0xFFF) {
- i = (0xFFF * 2 / srcPitch);
- pOverlay->VUSF = 0xFFFF;
- } else {
- dstH = i * dstH;
- if (srcH % dstH)
- pOverlay->VUSF = ((srcH - dstH) << 16) / dstH;
- else
- pOverlay->VUSF = 0x00;
- }
- /* set video frame buffer offset */
- pOverlay->pitch = (uint16_t) (srcPitch * i);
- }
- }
-}
-
-static void set_line_buf_size(SISOverlayPtr pOverlay)
-{
- uint8_t preHIDF;
- uint32_t i;
- uint32_t line = pOverlay->srcW;
-
- if ((pOverlay->pixelFormat == IMGFMT_YV12) ||
- (pOverlay->pixelFormat == IMGFMT_I420)) {
- preHIDF = pOverlay->wHPre & 0x07;
- switch (preHIDF) {
- case 3:
- if ((line & 0xffffff00) == line)
- i = (line >> 8);
- else
- i = (line >> 8) + 1;
- pOverlay->lineBufSize = (uint8_t) (i * 32 - 1);
- break;
- case 4:
- if ((line & 0xfffffe00) == line)
- i = (line >> 9);
- else
- i = (line >> 9) + 1;
- pOverlay->lineBufSize = (uint8_t) (i * 64 - 1);
- break;
- case 5:
- if ((line & 0xfffffc00) == line)
- i = (line >> 10);
- else
- i = (line >> 10) + 1;
- pOverlay->lineBufSize = (uint8_t) (i * 128 - 1);
- break;
- case 6:
- if ((line & 0xfffff800) == line)
- i = (line >> 11);
- else
- i = (line >> 11) + 1;
- pOverlay->lineBufSize = (uint8_t) (i * 256 - 1);
- break;
- default:
- if ((line & 0xffffff80) == line)
- i = (line >> 7);
- else
- i = (line >> 7) + 1;
- pOverlay->lineBufSize = (uint8_t) (i * 16 - 1);
- break;
- }
- } else { /* YUV2, UYVY */
- if ((line & 0xffffff8) == line)
- i = (line >> 3);
- else
- i = (line >> 3) + 1;
- pOverlay->lineBufSize = (uint8_t) (i - 1);
- }
-}
-
-static void merge_line_buf(int enable)
-{
- if (enable) {
- switch (sis_displaymode) {
- case DISPMODE_SINGLE1:
- if (sis_has_two_overlays) {
- /* dual line merge */
- setvideoregmask(Index_VI_Control_Misc2, 0x10, 0x11);
- setvideoregmask(Index_VI_Control_Misc1, 0x00, 0x04);
- } else {
- setvideoregmask(Index_VI_Control_Misc2, 0x10, 0x11);
- setvideoregmask(Index_VI_Control_Misc1, 0x00, 0x04);
- }
- break;
- case DISPMODE_SINGLE2:
- if (sis_has_two_overlays) {
- /* line merge */
- setvideoregmask(Index_VI_Control_Misc2, 0x01, 0x11);
- setvideoregmask(Index_VI_Control_Misc1, 0x04, 0x04);
- } else {
- setvideoregmask(Index_VI_Control_Misc2, 0x10, 0x11);
- setvideoregmask(Index_VI_Control_Misc1, 0x00, 0x04);
- }
- break;
- case DISPMODE_MIRROR:
- default:
- /* line merge */
- setvideoregmask(Index_VI_Control_Misc2, 0x00, 0x11);
- setvideoregmask(Index_VI_Control_Misc1, 0x04, 0x04);
- if (sis_has_two_overlays) {
- /* line merge */
- setvideoregmask(Index_VI_Control_Misc2, 0x01, 0x11);
- setvideoregmask(Index_VI_Control_Misc1, 0x04, 0x04);
- }
- break;
- }
- } else {
- switch (sis_displaymode) {
- case DISPMODE_SINGLE1:
- setvideoregmask(Index_VI_Control_Misc2, 0x00, 0x11);
- setvideoregmask(Index_VI_Control_Misc1, 0x00, 0x04);
- break;
- case DISPMODE_SINGLE2:
- if (sis_has_two_overlays) {
- setvideoregmask(Index_VI_Control_Misc2, 0x01, 0x11);
- setvideoregmask(Index_VI_Control_Misc1, 0x00, 0x04);
- } else {
- setvideoregmask(Index_VI_Control_Misc2, 0x00, 0x11);
- setvideoregmask(Index_VI_Control_Misc1, 0x00, 0x04);
- }
- break;
- case DISPMODE_MIRROR:
- default:
- setvideoregmask(Index_VI_Control_Misc2, 0x00, 0x11);
- setvideoregmask(Index_VI_Control_Misc1, 0x00, 0x04);
- if (sis_has_two_overlays) {
- setvideoregmask(Index_VI_Control_Misc2, 0x01, 0x11);
- setvideoregmask(Index_VI_Control_Misc1, 0x00, 0x04);
- }
- break;
- }
- }
-}
-
-
-static void set_format(SISOverlayPtr pOverlay)
-{
- uint8_t fmt;
-
- switch (pOverlay->pixelFormat) {
- case IMGFMT_YV12:
- case IMGFMT_I420:
- fmt = 0x0c;
- break;
- case IMGFMT_YUY2:
- fmt = 0x28;
- break;
- case IMGFMT_UYVY:
- fmt = 0x08;
- break;
- case IMGFMT_RGB15: /* D[5:4] : 00 RGB555, 01 RGB 565 */
- fmt = 0x00;
- break;
- case IMGFMT_RGB16:
- fmt = 0x10;
- break;
- default:
- fmt = 0x00;
- break;
- }
- setvideoregmask(Index_VI_Control_Misc0, fmt, 0x7c);
-}
-
-static void set_colorkey()
-{
- uint8_t r, g, b;
-
- b = (uint8_t) sis_grkey.ckey.blue;
- g = (uint8_t) sis_grkey.ckey.green;
- r = (uint8_t) sis_grkey.ckey.red;
-
- /* set color key mode */
- setvideoregmask(Index_VI_Key_Overlay_OP,
- sis_grkey.ckey.op == CKEY_TRUE ?
- VI_ROP_DestKey : VI_ROP_Always, 0x0F);
-
- /* set colorkey values */
- setvideoreg(Index_VI_Overlay_ColorKey_Blue_Min, (uint8_t) b);
- setvideoreg(Index_VI_Overlay_ColorKey_Green_Min, (uint8_t) g);
- setvideoreg(Index_VI_Overlay_ColorKey_Red_Min, (uint8_t) r);
-
- setvideoreg(Index_VI_Overlay_ColorKey_Blue_Max, (uint8_t) b);
- setvideoreg(Index_VI_Overlay_ColorKey_Green_Max, (uint8_t) g);
- setvideoreg(Index_VI_Overlay_ColorKey_Red_Max, (uint8_t) r);
-}
-
-static void set_brightness(uint8_t brightness)
-{
- setvideoreg(Index_VI_Brightness, brightness);
-}
-
-static void set_contrast(uint8_t contrast)
-{
- setvideoregmask(Index_VI_Contrast_Enh_Ctrl, contrast, 0x07);
-}
-
-/* Next 3 functions are 310/325 series only */
-
-static void set_saturation(char saturation)
-{
- uint8_t temp = 0;
-
- if (saturation < 0) {
- temp |= 0x88;
- saturation = -saturation;
- }
- temp |= (saturation & 0x07);
- temp |= ((saturation & 0x07) << 4);
-
- setvideoreg(Index_VI_Saturation, temp);
-}
-
-static void set_hue(uint8_t hue)
-{
- setvideoreg(Index_VI_Hue, (hue & 0x08) ? (hue ^ 0x07) : hue);
-}
-
-#if 0
-/* JCP: not used (I don't think it's correct anyway) */
-static void set_alpha(uint8_t alpha)
-{
- uint8_t data;
-
- data = getvideoreg(Index_VI_Key_Overlay_OP);
- data &= 0x0F;
- setvideoreg(Index_VI_Key_Overlay_OP, data | (alpha << 4));
-}
-#endif
diff --git a/src/video_out/vidix/drivers/unichrome_regs.h b/src/video_out/vidix/drivers/unichrome_regs.h
deleted file mode 100644
index 15795f126..000000000
--- a/src/video_out/vidix/drivers/unichrome_regs.h
+++ /dev/null
@@ -1,635 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via.h,v 1.5 2004/01/05 00:34:17 dawes Exp $ */
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sub license,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _VIA_H_
-#define _VIA_H_ 1
-
-/* Video status flag */
-
-#define VIDEO_SHOW 0x80000000 /*Video on*/
-#define VIDEO_HIDE 0x00000000 /*Video off*/
-#define VIDEO_MPEG_INUSE 0x08000000 /*Video is used with MPEG */
-#define VIDEO_HQV_INUSE 0x04000000 /*Video is used with HQV*/
-#define VIDEO_CAPTURE0_INUSE 0x02000000 /*Video is used with CAPTURE 0*/
-#define VIDEO_CAPTURE1_INUSE 0x00000000 /*Video is used with CAPTURE 1*/
-#define VIDEO_1_INUSE 0x01000000 /*Video 1 is used with software flip*/
-#define VIDEO_3_INUSE 0x00000000 /*Video 3 is used with software flip*/
-#define MPEG_USE_V1 0x00010000 /*[16] : 1:MPEG use V1, 0:MPEG use V3*/
-#define MPEG_USE_V3 0x00000000 /*[16] : 1:MPEG use V1, 0:MPEG use V3*/
-#define MPEG_USE_HQV 0x00020000 /*[17] : 1:MPEG use HQV,0:MPEG not use HQV*/
-#define MPEG_USE_HW_FLIP 0x00040000 /*[18] : 1:MPEG use H/W flip,0:MPEG use S/W flip*/
-#define MPEG_USE_SW_FLIP 0x00000000 /*[18] : 1:MPEG use H/W flip,0:MPEG use S/W flip*/
-#define CAP0_USE_V1 0x00001000 /*[12] : 1:Capture 0 use V1, 0:Capture 0 use V3*/
-#define CAP0_USE_V3 0x00000000 /*[12] : 1:Capture 0 use V1, 0:Capture 0 use V3*/
-#define CAP0_USE_HQV 0x00002000 /*[13] : 1:Capture 0 use HQV,0:Capture 0 not use HQV*/
-#define CAP0_USE_HW_FLIP 0x00004000 /*[14] : 1:Capture 0 use H/W flip,0:Capture 0 use S/W flip*/
-#define CAP0_USE_CCIR656 0x00008000 /*[15] : 1:Capture 0 use CCIR656,0:Capture 0 CCIR601*/
-#define CAP1_USE_V1 0x00000100 /*[ 8] : 1:Capture 1 use V1, 0:Capture 1 use V3*/
-#define CAP1_USE_V3 0x00000000 /*[ 8] : 1:Capture 1 use V1, 0:Capture 1 use V3*/
-#define CAP1_USE_HQV 0x00000200 /*[ 9] : 1:Capture 1 use HQV,0:Capture 1 not use HQV*/
-#define CAP1_USE_HW_FLIP 0x00000400 /*[10] : 1:Capture 1 use H/W flip,0:Capture 1 use S/W flip */
-#define SW_USE_V1 0x00000010 /*[ 4] : 1:Capture 1 use V1, 0:Capture 1 use V3 */
-#define SW_USE_V3 0x00000000 /*[ 4] : 1:Capture 1 use V1, 0:Capture 1 use V3 */
-#define SW_USE_HQV 0x00000020 /*[ 5] : 1:Capture 1 use HQV,0:Capture 1 not use HQV */
-
-/*
-#define VIDEO1_INUSE 0x00000010 //[ 4] : 1:Video 1 is used with S/W flip
-#define VIDEO1_USE_HQV 0x00000020 //[ 5] : 1:Video 1 use HQV with S/W flip
-#define VIDEO3_INUSE 0x00000001 //[ 0] : 1:Video 3 is used with S/W flip
-#define VIDEO3_USE_HQV 0x00000002 //[ 1] : 1:Video 3 use HQV with S/W flip
-*/
-
-/* H/W registers for Video Engine */
-
-/*
- * bus master
- */
-#define PCI_MASTER_ENABLE 0x01
-#define PCI_MASTER_SCATTER 0x00
-#define PCI_MASTER_SINGLE 0x02
-#define PCI_MASTER_GUI 0x00
-#define PCI_MASTER_VIDEO 0x04
-#define PCI_MASTER_INPUT 0x00
-#define PCI_MASTER_OUTPUT 0x08
-
-/*
- * video registers
- */
-#define V_FLAGS 0x00
-#define V_CAP_STATUS 0x04
-#define V_FLIP_STATUS 0x04
-#define V_ALPHA_WIN_START 0x08
-#define V_ALPHA_WIN_END 0x0C
-#define V_ALPHA_CONTROL 0x10
-#define V_CRT_STARTADDR 0x14
-#define V_CRT_STARTADDR_2 0x18
-#define V_ALPHA_STRIDE 0x1C
-#define V_COLOR_KEY 0x20
-#define V_ALPHA_STARTADDR 0x24
-#define V_CHROMAKEY_LOW 0x28
-#define V_CHROMAKEY_HIGH 0x2C
-#define V1_CONTROL 0x30
-#define V12_QWORD_PER_LINE 0x34
-#define V1_STARTADDR_1 0x38
-#define V1_STARTADDR_Y1 V1_STARTADDR_1
-#define V1_STRIDE 0x3C
-#define V1_WIN_START_Y 0x40
-#define V1_WIN_START_X 0x42
-#define V1_WIN_END_Y 0x44
-#define V1_WIN_END_X 0x46
-#define V1_STARTADDR_2 0x48
-#define V1_STARTADDR_Y2 V1_STARTADDR_2
-#define V1_ZOOM_CONTROL 0x4C
-#define V1_MINI_CONTROL 0x50
-#define V1_STARTADDR_0 0x54
-#define V1_STARTADDR_Y0 V1_STARTADDR_0
-#define V_FIFO_CONTROL 0x58
-#define V1_STARTADDR_3 0x5C
-#define V1_STARTADDR_Y3 V1_STARTADDR_3
-#define HI_CONTROL 0x60
-#define SND_COLOR_KEY 0x64
-#define ALPHA_V3_PREFIFO_CONTROL 0x68
-#define V1_SOURCE_HEIGHT 0x6C
-#define HI_TRANSPARENT_COLOR 0x70
-#define V_DISPLAY_TEMP 0x74 /* No use */
-#define ALPHA_V3_FIFO_CONTROL 0x78
-#define V3_SOURCE_WIDTH 0x7C
-#define V3_COLOR_KEY 0x80
-#define V1_ColorSpaceReg_1 0x84
-#define V1_ColorSpaceReg_2 0x88
-#define V1_STARTADDR_CB0 0x8C
-#define V1_OPAQUE_CONTROL 0x90 /* To be deleted */
-#define V3_OPAQUE_CONTROL 0x94 /* To be deleted */
-#define V_COMPOSE_MODE 0x98
-#define V3_STARTADDR_2 0x9C
-#define V3_CONTROL 0xA0
-#define V3_STARTADDR_0 0xA4
-#define V3_STARTADDR_1 0xA8
-#define V3_STRIDE 0xAC
-#define V3_WIN_START_Y 0xB0
-#define V3_WIN_START_X 0xB2
-#define V3_WIN_END_Y 0xB4
-#define V3_WIN_END_X 0xB6
-#define V3_ALPHA_QWORD_PER_LINE 0xB8
-#define V3_ZOOM_CONTROL 0xBC
-#define V3_MINI_CONTROL 0xC0
-#define V3_ColorSpaceReg_1 0xC4
-#define V3_ColorSpaceReg_2 0xC8
-#define V3_DISPLAY_TEMP 0xCC /* No use */
-#define V1_STARTADDR_CB1 0xE4
-#define V1_STARTADDR_CB2 0xE8
-#define V1_STARTADDR_CB3 0xEC
-#define V1_STARTADDR_CR0 0xF0
-#define V1_STARTADDR_CR1 0xF4
-#define V1_STARTADDR_CR2 0xF8
-#define V1_STARTADDR_CR3 0xFC
-
-/* Video Capture Engine Registers
- * Capture Port 1
- */
-#define CAP0_MASKS 0x100
-#define CAP1_MASKS 0x104
-#define CAP0_CONTROL 0x110
-#define CAP0_H_RANGE 0x114
-#define CAP0_V_RANGE 0x118
-#define CAP0_SCAL_CONTROL 0x11C
-#define CAP0_VBI_H_RANGE 0x120
-#define CAP0_VBI_V_RANGE 0x124
-#define CAP0_VBI_STARTADDR 0x128
-#define CAP0_VBI_STRIDE 0x12C
-#define CAP0_ANCIL_COUNT 0x130
-#define CAP0_MAXCOUNT 0x134
-#define CAP0_VBIMAX_COUNT 0x138
-#define CAP0_DATA_COUNT 0x13C
-#define CAP0_FB_STARTADDR0 0x140
-#define CAP0_FB_STARTADDR1 0x144
-#define CAP0_FB_STARTADDR2 0x148
-#define CAP0_STRIDE 0x150
-/* Capture Port 2 */
-#define CAP1_CONTROL 0x154
-#define CAP1_SCAL_CONTROL 0x160
-#define CAP1_VBI_H_RANGE 0x164 /*To be deleted*/
-#define CAP1_VBI_V_RANGE 0x168 /*To be deleted*/
-#define CAP1_VBI_STARTADDR 0x16C /*To be deleted*/
-#define CAP1_VBI_STRIDE 0x170 /*To be deleted*/
-#define CAP1_ANCIL_COUNT 0x174 /*To be deleted*/
-#define CAP1_MAXCOUNT 0x178
-#define CAP1_VBIMAX_COUNT 0x17C /*To be deleted*/
-#define CAP1_DATA_COUNT 0x180
-#define CAP1_FB_STARTADDR0 0x184
-#define CAP1_FB_STARTADDR1 0x188
-#define CAP1_STRIDE 0x18C
-
-/* SUBPICTURE Registers */
-#define SUBP_CONTROL_STRIDE 0x1C0
-#define SUBP_STARTADDR 0x1C4
-#define RAM_TABLE_CONTROL 0x1C8
-#define RAM_TABLE_READ 0x1CC
-
-/* HQV Registers */
-#define HQV_CONTROL 0x1D0
-#define HQV_SRC_STARTADDR_Y 0x1D4
-#define HQV_SRC_STARTADDR_U 0x1D8
-#define HQV_SRC_STARTADDR_V 0x1DC
-#define HQV_SRC_FETCH_LINE 0x1E0
-#define HQV_FILTER_CONTROL 0x1E4
-#define HQV_MINIFY_CONTROL 0x1E8
-#define HQV_DST_STARTADDR0 0x1EC
-#define HQV_DST_STARTADDR1 0x1F0
-#define HQV_DST_STARTADDR2 0x1FC
-#define HQV_DST_STRIDE 0x1F4
-#define HQV_SRC_STRIDE 0x1F8
-
-
-/*
- * Video command definition
- */
-/* #define V_ALPHA_CONTROL 0x210 */
-#define ALPHA_WIN_EXPIRENUMBER_4 0x00040000
-#define ALPHA_WIN_CONSTANT_FACTOR_4 0x00004000
-#define ALPHA_WIN_CONSTANT_FACTOR_12 0x0000c000
-#define ALPHA_WIN_BLENDING_CONSTANT 0x00000000
-#define ALPHA_WIN_BLENDING_ALPHA 0x00000001
-#define ALPHA_WIN_BLENDING_GRAPHIC 0x00000002
-#define ALPHA_WIN_PREFIFO_THRESHOLD_12 0x000c0000
-#define ALPHA_WIN_FIFO_THRESHOLD_8 0x000c0000
-#define ALPHA_WIN_FIFO_DEPTH_16 0x00100000
-
-/* V_CHROMAKEY_LOW 0x228 */
-#define V_CHROMAKEY_V3 0x80000000
-
-/* V1_CONTROL 0x230 */
-#define V1_ENABLE 0x00000001
-#define V1_FULL_SCREEN 0x00000002
-#define V1_YUV422 0x00000000
-#define V1_RGB32 0x00000004
-#define V1_RGB15 0x00000008
-#define V1_RGB16 0x0000000C
-#define V1_YCbCr420 0x00000010
-#define V1_COLORSPACE_SIGN 0x00000080
-#define V1_SRC_IS_FIELD_PIC 0x00000200
-#define V1_SRC_IS_FRAME_PIC 0x00000000
-#define V1_BOB_ENABLE 0x00400000
-#define V1_FIELD_BASE 0x00000000
-#define V1_FRAME_BASE 0x01000000
-#define V1_SWAP_SW 0x00000000
-#define V1_SWAP_HW_HQV 0x02000000
-#define V1_SWAP_HW_CAPTURE 0x04000000
-#define V1_SWAP_HW_MC 0x06000000
-/* #define V1_DOUBLE_BUFFERS 0x00000000 */
-/* #define V1_QUADRUPLE_BUFFERS 0x18000000 */
-#define V1_EXPIRE_NUM 0x00050000
-#define V1_EXPIRE_NUM_A 0x000a0000
-#define V1_EXPIRE_NUM_F 0x000f0000 /* jason */
-#define V1_FIFO_EXTENDED 0x00200000
-#define V1_ON_CRT 0x00000000
-#define V1_ON_SND_DISPLAY 0x80000000
-#define V1_FIFO_32V1_32V2 0x00000000
-#define V1_FIFO_48V1_32V2 0x00200000
-
-/* V12_QWORD_PER_LINE 0x234 */
-#define V1_FETCH_COUNT 0x3ff00000
-#define V1_FETCHCOUNT_ALIGNMENT 0x0000000f
-#define V1_FETCHCOUNT_UNIT 0x00000004 /* Doubld QWORD */
-
-/* V1_STRIDE */
-#define V1_STRIDE_YMASK 0x00001fff
-#define V1_STRIDE_UVMASK 0x1ff00000
-
-/* V1_ZOOM_CONTROL 0x24C */
-#define V1_X_ZOOM_ENABLE 0x80000000
-#define V1_Y_ZOOM_ENABLE 0x00008000
-
-/* V1_MINI_CONTROL 0x250 */
-#define V1_X_INTERPOLY 0x00000002 /* X interpolation */
-#define V1_Y_INTERPOLY 0x00000001 /* Y interpolation */
-#define V1_YCBCR_INTERPOLY 0x00000004 /* Y, Cb, Cr all interpolation */
-#define V1_X_DIV_2 0x01000000
-#define V1_X_DIV_4 0x03000000
-#define V1_X_DIV_8 0x05000000
-#define V1_X_DIV_16 0x07000000
-#define V1_Y_DIV_2 0x00010000
-#define V1_Y_DIV_4 0x00030000
-#define V1_Y_DIV_8 0x00050000
-#define V1_Y_DIV_16 0x00070000
-
-/* V1_STARTADDR0 0x254 */
-#define SW_FLIP_ODD 0x08000000
-
-/* V_FIFO_CONTROL 0x258
- * IA2 has 32 level FIFO for packet mode video format
- * 32 level FIFO for planar mode video YV12. with extension reg 230 bit 21 enable
- * 16 level FIFO for planar mode video YV12. with extension reg 230 bit 21 disable
- * BCos of 128 bits. 1 level in IA2 = 2 level in VT3122
- */
-#define V1_FIFO_DEPTH12 0x0000000B
-#define V1_FIFO_DEPTH16 0x0000000F
-#define V1_FIFO_DEPTH32 0x0000001F
-#define V1_FIFO_DEPTH48 0x0000002F
-#define V1_FIFO_DEPTH64 0x0000003F
-#define V1_FIFO_THRESHOLD6 0x00000600
-#define V1_FIFO_THRESHOLD8 0x00000800
-#define V1_FIFO_THRESHOLD12 0x00000C00
-#define V1_FIFO_THRESHOLD16 0x00001000
-#define V1_FIFO_THRESHOLD24 0x00001800
-#define V1_FIFO_THRESHOLD32 0x00002000
-#define V1_FIFO_THRESHOLD40 0x00002800
-#define V1_FIFO_THRESHOLD48 0x00003000
-#define V1_FIFO_THRESHOLD56 0x00003800
-#define V1_FIFO_THRESHOLD61 0x00003D00
-#define V1_FIFO_PRETHRESHOLD10 0x0A000000
-#define V1_FIFO_PRETHRESHOLD12 0x0C000000
-#define V1_FIFO_PRETHRESHOLD29 0x1d000000
-#define V1_FIFO_PRETHRESHOLD40 0x28000000
-#define V1_FIFO_PRETHRESHOLD44 0x2c000000
-#define V1_FIFO_PRETHRESHOLD56 0x38000000
-#define V1_FIFO_PRETHRESHOLD61 0x3D000000
-
-/* ALPHA_V3_FIFO_CONTROL 0x278
- * IA2 has 32 level FIFO for packet mode video format
- * 32 level FIFO for planar mode video YV12. with extension reg 230 bit 21 enable
- * 16 level FIFO for planar mode video YV12. with extension reg 230 bit 21 disable
- * 8 level FIFO for ALPHA
- * BCos of 128 bits. 1 level in IA2 = 2 level in VT3122
- */
-#define V3_FIFO_DEPTH16 0x0000000F
-#define V3_FIFO_DEPTH24 0x00000017
-#define V3_FIFO_DEPTH32 0x0000001F
-#define V3_FIFO_DEPTH48 0x0000002F
-#define V3_FIFO_DEPTH64 0x0000003F
-#define V3_FIFO_THRESHOLD8 0x00000800
-#define V3_FIFO_THRESHOLD12 0x00000C00
-#define V3_FIFO_THRESHOLD16 0x00001000
-#define V3_FIFO_THRESHOLD24 0x00001800
-#define V3_FIFO_THRESHOLD32 0x00002000
-#define V3_FIFO_THRESHOLD40 0x00002800
-#define V3_FIFO_THRESHOLD48 0x00003000
-#define V3_FIFO_THRESHOLD56 0x00003800
-#define V3_FIFO_THRESHOLD61 0x00003D00
-#define V3_FIFO_PRETHRESHOLD10 0x0000000A
-#define V3_FIFO_PRETHRESHOLD12 0x0000000C
-#define V3_FIFO_PRETHRESHOLD29 0x0000001d
-#define V3_FIFO_PRETHRESHOLD40 0x00000028
-#define V3_FIFO_PRETHRESHOLD44 0x0000002c
-#define V3_FIFO_PRETHRESHOLD56 0x00000038
-#define V3_FIFO_PRETHRESHOLD61 0x0000003D
-#define V3_FIFO_MASK 0x0000007F
-#define ALPHA_FIFO_DEPTH8 0x00070000
-#define ALPHA_FIFO_THRESHOLD4 0x04000000
-#define ALPHA_FIFO_MASK 0xffff0000
-#define ALPHA_FIFO_PRETHRESHOLD4 0x00040000
-
-/* IA2 */
-#define ColorSpaceValue_1 0x140020f2
-#define ColorSpaceValue_2 0x0a0a2c00
-
-#define ColorSpaceValue_1_3123C0 0x13000DED
-#define ColorSpaceValue_2_3123C0 0x13171000
-
-/* For TV setting */
-#define ColorSpaceValue_1TV 0x140020f2
-#define ColorSpaceValue_2TV 0x0a0a2c00
-
-/* V_COMPOSE_MODE 0x298 */
-#define SELECT_VIDEO_IF_COLOR_KEY 0x00000001 /* select video if (color key),otherwise select graphics */
-#define SELECT_VIDEO3_IF_COLOR_KEY 0x00000020 /* For 3123C0, select video3 if (color key),otherwise select graphics */
-#define SELECT_VIDEO_IF_CHROMA_KEY 0x00000002 /* 0x0000000a //select video if (chroma key ),otherwise select graphics */
-#define ALWAYS_SELECT_VIDEO 0x00000000 /* always select video,Chroma key and Color key disable */
-#define COMPOSE_V1_V3 0x00000000 /* V1 on top of V3 */
-#define COMPOSE_V3_V1 0x00100000 /* V3 on top of V1 */
-#define COMPOSE_V1_TOP 0x00000000
-#define COMPOSE_V3_TOP 0x00100000
-#define V1_COMMAND_FIRE 0x80000000 /* V1 commands fire */
-#define V3_COMMAND_FIRE 0x40000000 /* V3 commands fire */
-#define V_COMMAND_LOAD 0x20000000 /* Video register always loaded */
-#define V_COMMAND_LOAD_VBI 0x10000000 /* Video register always loaded at vbi without waiting source flip */
-#define V3_COMMAND_LOAD 0x08000000 /* CLE_C0 Video3 register always loaded */
-#define V3_COMMAND_LOAD_VBI 0x00000100 /* CLE_C0 Video3 register always loaded at vbi without waiting source flip */
-#define SECOND_DISPLAY_COLOR_KEY_ENABLE 0x00010000
-
-/* V3_ZOOM_CONTROL 0x2bc */
-#define V3_X_ZOOM_ENABLE 0x80000000
-#define V3_Y_ZOOM_ENABLE 0x00008000
-
-/* V3_MINI_CONTROL 0x2c0 */
-#define V3_X_INTERPOLY 0x00000002 /* X interpolation */
-#define V3_Y_INTERPOLY 0x00000001 /* Y interpolation */
-#define V3_YCBCR_INTERPOLY 0x00000004 /* Y, Cb, Cr all interpolation */
-#define V3_X_DIV_2 0x01000000
-#define V3_X_DIV_4 0x03000000
-#define V3_X_DIV_8 0x05000000
-#define V3_X_DIV_16 0x07000000
-#define V3_Y_DIV_2 0x00010000
-#define V3_Y_DIV_4 0x00030000
-#define V3_Y_DIV_8 0x00050000
-#define V3_Y_DIV_16 0x00070000
-
-/* SUBP_CONTROL_STRIDE 0x3c0 */
-#define SUBP_HQV_ENABLE 0x00010000
-#define SUBP_IA44 0x00020000
-#define SUBP_AI44 0x00000000
-#define SUBP_STRIDE_MASK 0x00001fff
-#define SUBP_CONTROL_MASK 0x00070000
-
-/* RAM_TABLE_CONTROL 0x3c8 */
-#define RAM_TABLE_RGB_ENABLE 0x00000007
-
-/* CAPTURE0_CONTROL 0x310 */
-#define C0_ENABLE 0x00000001
-#define BUFFER_2_MODE 0x00000000
-#define BUFFER_3_MODE 0x00000004
-#define BUFFER_4_MODE 0x00000006
-#define SWAP_YUYV 0x00000000
-#define SWAP_UYVY 0x00000100
-#define SWAP_YVYU 0x00000200
-#define SWAP_VYUY 0x00000300
-#define IN_601_8 0x00000000
-#define IN_656_8 0x00000010
-#define IN_601_16 0x00000020
-#define IN_656_16 0x00000030
-#define DEINTER_ODD 0x00000000
-#define DEINTER_EVEN 0x00001000
-#define DEINTER_ODD_EVEN 0x00002000
-#define DEINTER_FRAME 0x00003000
-#define VIP_1 0x00000000
-#define VIP_2 0x00000400
-#define H_FILTER_2 0x00010000
-#define H_FILTER_4 0x00020000
-#define H_FILTER_8_1331 0x00030000
-#define H_FILTER_8_12221 0x00040000
-#define VIP_ENABLE 0x00000008
-#define EN_FIELD_SIG 0x00000800
-#define VREF_INVERT 0x00100000
-#define FIELD_INPUT_INVERSE 0x00400000
-#define FIELD_INVERSE 0x40000000
-
-#define C1_H_MINI_EN 0x00000800
-#define C0_H_MINI_EN 0x00000800
-#define C1_V_MINI_EN 0x04000000
-#define C0_V_MINI_EN 0x04000000
-#define C1_H_MINI_2 0x00000400
-
-/* CAPTURE1_CONTROL 0x354 */
-#define C1_ENABLE 0x00000001
-
-/* V3_CONTROL 0x2A0 */
-#define V3_ENABLE 0x00000001
-#define V3_FULL_SCREEN 0x00000002
-#define V3_YUV422 0x00000000
-#define V3_RGB32 0x00000004
-#define V3_RGB15 0x00000008
-#define V3_RGB16 0x0000000C
-#define V3_COLORSPACE_SIGN 0x00000080
-#define V3_EXPIRE_NUM 0x00040000
-#define V3_EXPIRE_NUM_F 0x000f0000
-#define V3_BOB_ENABLE 0x00400000
-#define V3_FIELD_BASE 0x00000000
-#define V3_FRAME_BASE 0x01000000
-#define V3_SWAP_SW 0x00000000
-#define V3_SWAP_HW_HQV 0x02000000
-#define V3_FLIP_HW_CAPTURE0 0x04000000
-#define V3_FLIP_HW_CAPTURE1 0x06000000
-
-/* V3_ALPHA_FETCH_COUNT 0x2B8 */
-#define V3_FETCH_COUNT 0x3ff00000
-#define ALPHA_FETCH_COUNT 0x000003ff
-
-/* HQV_CONTROL 0x3D0 */
-#define HQV_RGB32 0x00000000
-#define HQV_RGB16 0x20000000
-#define HQV_RGB15 0x30000000
-#define HQV_YUV422 0x80000000
-#define HQV_YUV420 0xC0000000
-#define HQV_ENABLE 0x08000000
-#define HQV_SRC_SW 0x00000000
-#define HQV_SRC_MC 0x01000000
-#define HQV_SRC_CAPTURE0 0x02000000
-#define HQV_SRC_CAPTURE1 0x03000000
-#define HQV_FLIP_EVEN 0x00000000
-#define HQV_FLIP_ODD 0x00000020
-#define HQV_SW_FLIP 0x00000010 /* Write 1 to flip HQV buffer */
-#define HQV_DEINTERLACE 0x00010000 /* First line of odd field will be repeated 3 times */
-#define HQV_FIELD_2_FRAME 0x00020000 /* Src is field. Display each line 2 times */
-#define HQV_FRAME_2_FIELD 0x00040000 /* Src is field. Display field */
-#define HQV_FRAME_UV 0x00000000 /* Src is Non-interleaved */
-#define HQV_FIELD_UV 0x00100000 /* Src is interleaved */
-#define HQV_IDLE 0x00000008
-#define HQV_FLIP_STATUS 0x00000001
-#define HQV_DOUBLE_BUFF 0x00000000
-#define HQV_TRIPLE_BUFF 0x04000000
-#define HQV_SUBPIC_FLIP 0x00008000
-#define HQV_FIFO_STATUS 0x00001000
-
-/* HQV_FILTER_CONTROL 0x3E4 */
-#define HQV_H_LOWPASS_2TAP 0x00000001
-#define HQV_H_LOWPASS_4TAP 0x00000002
-#define HQV_H_LOWPASS_8TAP1 0x00000003 /* To be deleted */
-#define HQV_H_LOWPASS_8TAP2 0x00000004 /* To be deleted */
-#define HQV_H_HIGH_PASS 0x00000008
-#define HQV_H_LOW_PASS 0x00000000
-#define HQV_V_LOWPASS_2TAP 0x00010000
-#define HQV_V_LOWPASS_4TAP 0x00020000
-#define HQV_V_LOWPASS_8TAP1 0x00030000
-#define HQV_V_LOWPASS_8TAP2 0x00040000
-#define HQV_V_HIGH_PASS 0x00080000
-#define HQV_V_LOW_PASS 0x00000000
-#define HQV_H_HIPASS_F1_DEFAULT 0x00000040
-#define HQV_H_HIPASS_F2_DEFAULT 0x00000000
-#define HQV_V_HIPASS_F1_DEFAULT 0x00400000
-#define HQV_V_HIPASS_F2_DEFAULT 0x00000000
-#define HQV_H_HIPASS_F1_2TAP 0x00000050
-#define HQV_H_HIPASS_F2_2TAP 0x00000100
-#define HQV_V_HIPASS_F1_2TAP 0x00500000
-#define HQV_V_HIPASS_F2_2TAP 0x01000000
-#define HQV_H_HIPASS_F1_4TAP 0x00000060
-#define HQV_H_HIPASS_F2_4TAP 0x00000200
-#define HQV_V_HIPASS_F1_4TAP 0x00600000
-#define HQV_V_HIPASS_F2_4TAP 0x02000000
-#define HQV_H_HIPASS_F1_8TAP 0x00000080
-#define HQV_H_HIPASS_F2_8TAP 0x00000400
-#define HQV_V_HIPASS_F1_8TAP 0x00800000
-#define HQV_V_HIPASS_F2_8TAP 0x04000000
-/* IA2 NEW */
-#define HQV_V_FILTER2 0x00080000
-#define HQV_H_FILTER2 0x00000008
-#define HQV_H_TAP2_11 0x00000041
-#define HQV_H_TAP4_121 0x00000042
-#define HQV_H_TAP4_1111 0x00000401
-#define HQV_H_TAP8_1331 0x00000221
-#define HQV_H_TAP8_12221 0x00000402
-#define HQV_H_TAP16_1991 0x00000159
-#define HQV_H_TAP16_141041 0x0000026A
-#define HQV_H_TAP32 0x0000015A
-#define HQV_V_TAP2_11 0x00410000
-#define HQV_V_TAP4_121 0x00420000
-#define HQV_V_TAP4_1111 0x04010000
-#define HQV_V_TAP8_1331 0x02210000
-#define HQV_V_TAP8_12221 0x04020000
-#define HQV_V_TAP16_1991 0x01590000
-#define HQV_V_TAP16_141041 0x026A0000
-#define HQV_V_TAP32 0x015A0000
-#define HQV_V_FILTER_DEFAULT 0x00420000
-#define HQV_H_FILTER_DEFAULT 0x00000040
-
-
-
-
-/* HQV_MINI_CONTROL 0x3E8 */
-#define HQV_H_MINIFY_ENABLE 0x00000800
-#define HQV_V_MINIFY_ENABLE 0x08000000
-#define HQV_VDEBLOCK_FILTER 0x80000000
-#define HQV_HDEBLOCK_FILTER 0x00008000
-
-
-#define CHROMA_KEY_LOW 0x00FFFFFF
-#define CHROMA_KEY_HIGH 0x00FFFFFF
-
-/* V_CAP_STATUS */
-#define V_ST_UPDATE_NOT_YET 0x00000003
-#define V1_ST_UPDATE_NOT_YET 0x00000001
-#define V3_ST_UPDATE_NOT_YET 0x00000008
-
-#define VBI_STATUS 0x00000002
-
-/*
- * Macros for Video MMIO
- */
-#ifndef V4L2
-#define VIDInB(port) *((volatile CARD8 *)(pVia->VidMapBase + (port)))
-#define VIDInW(port) *((volatile CARD16 *)(pVia->VidMapBase + (port)))
-#define VIDInD(port) *((volatile CARD32 *)(pVia->VidMapBase + (port)))
-#define VIDOutB(port, data) *((volatile CARD8 *)(pVia->VidMapBase + (port))) = (data)
-#define VIDOutW(port, data) *((volatile CARD16 *)(pVia->VidMapBase + (port))) = (data)
-#define VIDOutD(port, data) *((volatile CARD32 *)(pVia->VidMapBase + (port))) = (data)
-#define MPGOutD(port, data) *((volatile CARD32 *)(lpMPEGMMIO +(port))) = (data)
-#define MPGInD(port) *((volatile CARD32 *)(lpMPEGMMIO +(port)))
-#endif
-
-/*
- * Macros for GE MMIO
- */
-#define GEInW(port) *((volatile CARD16 *)(lpGEMMIO + (port)))
-#define GEInD(port) *((volatile CARD32 *)(lpGEMMIO + (port)))
-#define GEOutW(port, data) *((volatile CARD16 *)(lpGEMMIO + (port))) = (data)
-#define GEOutD(port, data) *((volatile CARD32 *)(lpGEMMIO + (port))) = (data)
-
-/*
- * MPEG 1/2 Slice Engine (at 0xC00 relative to base)
- */
-
-#define MPG_CONTROL 0x00
-#define MPG_CONTROL_STRUCT 0x03
-#define MPG_CONTROL_STRUCT_TOP 0x01
-#define MPG_CONTROL_STRUCT_BOTTOM 0x02
-#define MPG_CONTROL_STRUCT_FRAME 0x03
- /* Use TOP if interlaced */
-#define MPG_CONTROL_TYPE 0x3C
-#define MPG_CONTROL_TYPE_I (0x01 << 2)
-#define MPG_CONTROL_TYPE_B (0x02 << 2)
-#define MPG_CONTROL_TYPE_P (0x03 << 3)
-#define MPG_CONTROL_ALTSCAN 0x40
-#define MPG_BLOCK 0x08 /* Unsure */
-#define MPG_COMMAND 0x0C
-#define MPG_DATA1 0x10
-#define MPG_DATA2 0x14
-#define MPG_DATA3 0x18
-#define MPG_DATA4 0x1C
-
-#define MPG_YPHYSICAL(x) (0x20 + 12*(x))
-#define MPG_CbPHYSICAL(x) (0x24 + 12*(x))
-#define MPG_CrPHYSICAL(x) (0x28 + 12*(x))
-
-#define MPG_PITCH 0x50
-#define MPG_STATUS 0x54
-
-#define MPG_MATRIX_IDX 0x5C
-#define MPG_MATRIX_IDX_INTRA 0x00
-#define MPG_MATRIX_IDX_NON 0x01
-#define MPG_MATRIX_DATA 0x60
-
-#define MPG_SLICE_CTRL_1 0x90
-#define MPG_SLICE_MBAMAX 0x2FFF
-#define MPG_SLICE_PREDICTIVE_DCT 0x4000
-#define MPG_SLICE_TOP_FIRST 0x8000
-#define MPG_SLICE_MACROBLOCK_WIDTH(x) ((x)<<18) /* in 64's */
-#define MPG_SLICE_CTRL_2 0x94
-#define MPG_SLICE_CONCEAL_MVEC 0x0000001
-#define MPG_SLICE_QSCALE_TYPE 0x0000002
-#define MPG_SLICE_DCPRECISION 0x000000C
-#define MPG_SLICE_MACROBQUOT 0x0FFFFF0
-#define MPG_SLICE_INTRAVLC 0x1000000
-#define MPG_SLICE_CTRL_3 0x98
-#define MPG_SLICE_FHMVR 0x0000003
-#define MPG_SLICE_FVMVR 0x000000C
-#define MPG_SLICE_BHMVR 0x0000030
-#define MPG_SLICE_BVMVR 0x00000C0
-#define MPG_SLICE_SECOND_FIELD 0x0100000
-#define MPG_SLICE_RESET 0x0400000
-#define MPG_SLICE_LENGTH 0x9C
-#define MPG_SLICE_DATA 0xA0
-
-
-
-#endif /* _VIA_H_ */
diff --git a/src/video_out/vidix/drivers/unichrome_vid.c b/src/video_out/vidix/drivers/unichrome_vid.c
deleted file mode 100644
index b5ff314e6..000000000
--- a/src/video_out/vidix/drivers/unichrome_vid.c
+++ /dev/null
@@ -1,772 +0,0 @@
-/*
- Driver for VIA CLE266 Unichrome - Version 0.1.0
-
- Copyright (C) 2004 by Timothy Lee
-
- Based on Cyberblade/i driver by Alastair M. Robison.
-
- Thanks to Gilles Frattini for bugfixes
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Changes:
- 2004-03-10
- Initial version
-
- To Do:
-*/
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <inttypes.h>
-#include <unistd.h>
-
-#include "vidix.h"
-#include "fourcc.h"
-#include "libdha.h"
-#include "pci_ids.h"
-#include "pci_names.h"
-
-#include "unichrome_regs.h"
-
-pciinfo_t pci_info;
-
-uint8_t *uc_mem;
-static vidix_grkey_t uc_grkey;
-static int frames[VID_PLAY_MAXFRAMES];
-uint8_t *vio;
-uint8_t mclk_save[3];
-
-#define VIA_OUT(hwregs, reg, val) *(volatile uint32_t *)((hwregs) + (reg)) = (val)
-#define VIA_IN(hwregs, reg) *(volatile uint32_t *)((hwregs) + (reg))
-#define VGA_OUT8(hwregs, reg, val) *(volatile uint8_t *)((hwregs) + (reg) + 0x8000) = (val)
-#define VGA_IN8(hwregs, reg) *(volatile uint8_t *)((hwregs) + (reg) + 0x8000)
-#define VIDEO_OUT(hwregs, reg, val) VIA_OUT((hwregs)+0x200, reg, val)
-#define VIDEO_IN(hwregs, reg) VIA_IN((hwregs)+0x200, reg)
-
-#define outb(val,reg) OUTPORT8(reg,val)
-#define inb(reg) INPORT8(reg)
-
-#define ALIGN_TO(v, n) (((v) + (n-1)) & ~(n-1))
-#define UC_MAP_V1_FIFO_CONTROL(depth, pre_thr, thr) \
- (((depth)-1) | ((thr) << 8) | ((pre_thr) << 24))
-
-#define FRAMEBUFFER_START 0x600000
-#define FRAMEBUFFER_SIZE 0x200000
-
-#ifdef DEBUG_LOGFILE
-FILE *logfile=0;
-#define LOGWRITE(x) {if(logfile) fprintf(logfile,x);}
-#else
-#define LOGWRITE(x)
-#endif
-
-
-static vidix_capability_t uc_cap =
-{
- "VIA CLE266 Unichrome driver",
- "Timothy Lee <timothy@siriushk.com>",
- TYPE_OUTPUT,
- { 0, 0, 0, 0 },
- 4096,
- 4096,
- 4,
- 4,
- -1,
- FLAG_UPSCALER|FLAG_DOWNSCALER,
- VENDOR_VIA2,
- -1,
- { 0, 0, 0, 0 }
-};
-
-
-unsigned int vixGetVersion(void)
-{
- return(VIDIX_VERSION);
-}
-
-
-static unsigned short uc_card_ids[] =
-{
- DEVICE_VIA2_VT8623_APOLLO_CLE266
-};
-
-
-static int find_chip(unsigned chip_id)
-{
- unsigned i;
- for(i = 0;i < sizeof(uc_card_ids)/sizeof(unsigned short);i++)
- {
- if(chip_id == uc_card_ids[i]) return i;
- }
- return -1;
-}
-
-
-/**
- * Map hw settings for vertical scaling.
- *
- * @param sh source height
- * @param dh destination height
- * @param zoom will hold vertical setting of zoom register.
- * @param mini will hold vertical setting of mini register.
- *
- * @returns 1 if successful.
- * 0 if the zooming factor is too large or small.
- *
- * @note Derived from VIA's V4L driver.
- * See ddover.c, DDOVER_HQVCalcZoomHeight()
- */
-
-static int uc_ovl_map_vzoom(int sh, int dh, uint32_t* zoom, uint32_t* mini)
-{
- uint32_t sh1, tmp, d;
- int zoom_ok = 1;
-
- if (sh == dh) { // No zoom
- // Do nothing
- }
- else if (sh < dh) { // Zoom in
-
- tmp = (sh * 0x0400) / dh;
- zoom_ok = !(tmp > 0x3ff);
-
- *zoom |= (tmp & 0x3ff) | V1_Y_ZOOM_ENABLE;
- *mini |= V1_Y_INTERPOLY | V1_YCBCR_INTERPOLY;
- }
- else { // sw > dh - Zoom out
-
- // Find a suitable divider (1 << d) = {2, 4, 8 or 16}
-
- sh1 = sh;
- for (d = 1; d < 5; d++) {
- sh1 >>= 1;
- if (sh1 <= dh) break;
- }
- if (d == 5) { // Too small.
- d = 4;
- zoom_ok = 0;
- }
-
- *mini |= ((d<<1)-1) << 16; // <= {1,3,5,7} << 16
-
- // Add scaling
-
- if (sh1 < dh) {
- tmp = (sh1 * 0x400) / dh;
- *zoom |= ((tmp & 0x3ff) | V1_Y_ZOOM_ENABLE);
- *mini |= V1_Y_INTERPOLY | V1_YCBCR_INTERPOLY;
- }
- }
-
- return zoom_ok;
-}
-
-
-/**
- * Map hw settings for horizontal scaling.
- *
- * @param sw source width
- * @param dw destination width
- *
- * @param zoom will hold horizontal setting of zoom register.
- * @param mini will hold horizontal setting of mini register.
- * @param falign will hold fetch aligment
- * @param dcount will hold display count
- *
- * @returns 1 if successful.
- * 0 if the zooming factor is too large or small.
- *
- * @note Derived from VIA's V4L driver.
- * See ddover.c, DDOVER_HQVCalcZoomWidth() and DDOver_GetDisplayCount()
- */
-static int uc_ovl_map_hzoom(int sw, int dw, uint32_t* zoom, uint32_t* mini,
- int* falign, int* dcount)
-{
- uint32_t tmp, sw1, d;
- int md; // Minify-divider
- int zoom_ok = 1;
-
- md = 1;
- *falign = 0;
-
- if (sw == dw) { // No zoom
- // Do nothing
- }
- else if (sw < dw) { // Zoom in
-
- tmp = (sw * 0x0800) / dw;
- zoom_ok = !(tmp > 0x7ff);
-
- *zoom |= ((tmp & 0x7ff) << 16) | V1_X_ZOOM_ENABLE;
- *mini |= V1_X_INTERPOLY;
- }
- else { // sw > dw - Zoom out
-
- // Find a suitable divider (1 << d) = {2, 4, 8 or 16}
-
- sw1 = sw;
- for (d = 1; d < 5; d++) {
- sw1 >>= 1;
- if (sw1 <= dw) break;
- }
- if (d == 5) { // Too small.
- d = 4;
- zoom_ok = 0;
- }
-
- md = 1 << d; // <= {2,4,8,16}
- *falign = ((md<<1)-1) & 0xf; // <= {3,7,15,15}
- *mini |= V1_X_INTERPOLY;
- *mini |= ((d<<1)-1) << 24; // <= {1,3,5,7} << 24
-
- // Add scaling
-
- if (sw1 < dw) {
- //CLE bug
- //tmp = sw1*0x0800 / dw;
- tmp = (sw1 - 2) * 0x0800 / dw;
- *zoom |= ((tmp & 0x7ff) << 16) | V1_X_ZOOM_ENABLE;
- }
- }
-
- *dcount = sw - md;
-
- return zoom_ok;
-}
-
-
-/**
- * @param format overlay pixel format
- * @param sw source width
- *
- * @returns qword fetch register setting
- *
- * @note Derived from VIA's V4L driver. See ddover.c, DDOver_GetFetch()
- * @note Only call after uc_ovl_map_hzoom()
- */
-static uint32_t uc_ovl_map_qwfetch(uint32_t format, int sw)
-{
- uint32_t fetch = 0;
-
- switch (format) {
- case IMGFMT_YV12:
- case IMGFMT_I420:
- fetch = ALIGN_TO(sw, 32) >> 4;
- break;
- case IMGFMT_UYVY:
- case IMGFMT_YVYU:
- case IMGFMT_YUY2:
- fetch = (ALIGN_TO(sw << 1, 16) >> 4) + 1;
- break;
- case IMGFMT_BGR15:
- case IMGFMT_BGR16:
- fetch = (ALIGN_TO(sw << 1, 16) >> 4) + 1;
- break;
- case IMGFMT_BGR32:
- fetch = (ALIGN_TO(sw << 2, 16) >> 4) + 1;
- break;
- default:
- printf("[unichrome] Unexpected pixelformat!");
- break;
- }
-
- if (fetch < 4)
- fetch = 4;
-
- return fetch;
-}
-
-
-/**
- * Map pixel format.
- *
- * @note Derived from VIA's V4L driver. See ddover.c, DDOver_GetV1Format()
- */
-static uint32_t uc_ovl_map_format(uint32_t format)
-{
- switch (format) {
- case IMGFMT_UYVY:
- case IMGFMT_YVYU:
- case IMGFMT_YUY2:
- return V1_COLORSPACE_SIGN | V1_YUV422;
- case IMGFMT_IYUV:
- return V1_COLORSPACE_SIGN | V1_YCbCr420 | V1_SWAP_SW;
- case IMGFMT_YV12:
- case IMGFMT_I420:
- return V1_COLORSPACE_SIGN | V1_YCbCr420;
- case IMGFMT_BGR15:
- return V1_RGB15;
- case IMGFMT_BGR16:
- return V1_RGB16;
- case IMGFMT_BGR32:
- return V1_RGB32;
- default :
- printf("[unichrome] Unexpected pixelformat!");
- return V1_YUV422;
- }
-}
-
-
-/**
- * Calculate V1 control and fifo-control register values
- * @param format pixel format
- * @param sw source width
- * @param hwrev CLE266 hardware revision
- * @param extfifo_on set this 1 if the extended FIFO is enabled
- * @param control will hold value for V1_CONTROL
- * @param fifo will hold value for V1_FIFO_CONTROL
- */
-static void uc_ovl_map_v1_control(uint32_t format, int sw,
- int hwrev, int extfifo_on,
- uint32_t* control, uint32_t* fifo)
-{
- *control = V1_BOB_ENABLE | uc_ovl_map_format(format);
-
- if (hwrev == 0x10) {
- *control |= V1_EXPIRE_NUM_F;
- }
- else {
- if (extfifo_on) {
- *control |= V1_EXPIRE_NUM_A | V1_FIFO_EXTENDED;
- }
- else {
- *control |= V1_EXPIRE_NUM;
- }
- }
-
- if ((format == IMGFMT_YV12) || (format == IMGFMT_I420)) {
- //Minified video will be skewed without this workaround.
- if (sw <= 80) { //Fetch count <= 5
- *fifo = UC_MAP_V1_FIFO_CONTROL(16,0,0);
- }
- else {
- if (hwrev == 0x10)
- *fifo = UC_MAP_V1_FIFO_CONTROL(64,56,56);
- else
- *fifo = UC_MAP_V1_FIFO_CONTROL(16,12,8);
- }
- }
- else {
- if (hwrev == 0x10) {
- *fifo = UC_MAP_V1_FIFO_CONTROL(64,56,56); // Default rev 0x10
- }
- else {
- if (extfifo_on)
- *fifo = UC_MAP_V1_FIFO_CONTROL(48,40,40);
- else
- *fifo = UC_MAP_V1_FIFO_CONTROL(32,29,16); // Default
- }
- }
-}
-
-
-static void uc_ovl_setup_fifo(int *extfifo_on, int dst_w)
-{
- if (dst_w <= 1024)
- {
- // Disable extended FIFO
- outb(0x16, 0x3c4); outb(mclk_save[0], 0x3c5);
- outb(0x17, 0x3c4); outb(mclk_save[1], 0x3c5);
- outb(0x18, 0x3c4); outb(mclk_save[2], 0x3c5);
- *extfifo_on = 0;
- }
- else
- {
- // Enable extended FIFO
- outb(0x17, 0x3c4); outb(0x2f, 0x3c5);
- outb(0x16, 0x3c4); outb((mclk_save[0] & 0xf0) | 0x14, 0x3c5);
- outb(0x18, 0x3c4); outb(0x56, 0x3c5);
- *extfifo_on = 1;
- }
-}
-
-
-static void uc_ovl_vcmd_wait(volatile uint8_t* vio)
-{
- while ((VIDEO_IN(vio, V_COMPOSE_MODE)
- & (V1_COMMAND_FIRE | V3_COMMAND_FIRE)));
-}
-
-
-int vixProbe(int verbose, int force)
-{
- pciinfo_t lst[MAX_PCI_DEVICES];
- unsigned i,num_pci;
- int err;
- err = pci_scan(lst,&num_pci);
- if(err)
- {
- printf("[unichrome] Error occurred during pci scan: %s\n",strerror(err));
- return err;
- }
- else
- {
- err = ENXIO;
- for(i=0; i < num_pci; i++)
- {
- if(lst[i].vendor == VENDOR_VIA2)
- {
- int idx;
- const char *dname;
- idx = find_chip(lst[i].device);
- if(idx == -1)
- continue;
- dname = pci_device_name(VENDOR_VIA2, lst[i].device);
- dname = dname ? dname : "Unknown chip";
- printf("[unichrome] Found chip: %s\n", dname);
- uc_cap.device_id = lst[i].device;
- err = 0;
- memcpy(&pci_info, &lst[i], sizeof(pciinfo_t));
- break;
- }
- }
- }
-
- if(err && verbose) printf("[unichrome] Can't find chip\n");
- return err;
-}
-
-
-int vixInit(const char *args)
-{
- long tmp;
- uc_mem = map_phys_mem(pci_info.base0, 0x800000);
- enable_app_io();
-
- outb(0x2f, 0x3c4);
- tmp = inb(0x3c5) << 0x18;
- vio = map_phys_mem(tmp,0x1000);
-
- outb(0x16, 0x3c4); mclk_save[0] = inb(0x3c5);
- outb(0x17, 0x3c4); mclk_save[1] = inb(0x3c5);
- outb(0x18, 0x3c4); mclk_save[2] = inb(0x3c5);
-
- uc_grkey.ckey.blue = 0x00;
- uc_grkey.ckey.green = 0x00;
- uc_grkey.ckey.red = 0x00;
-
-#ifdef DEBUG_LOGFILE
- logfile=fopen("/tmp/uc_vidix.log","w");
-#endif
- return 0;
-}
-
-void vixDestroy(void)
-{
-#ifdef DEBUG_LOGFILE
- if(logfile)
- fclose(logfile);
-#endif
- outb(0x16, 0x3c4); outb(mclk_save[0], 0x3c5);
- outb(0x17, 0x3c4); outb(mclk_save[1], 0x3c5);
- outb(0x18, 0x3c4); outb(mclk_save[2], 0x3c5);
-
- disable_app_io();
- unmap_phys_mem(uc_mem, 0x800000);
- unmap_phys_mem(vio, 0x1000);
-}
-
-
-int vixGetCapability(vidix_capability_t *to)
-{
- memcpy(to, &uc_cap, sizeof(vidix_capability_t));
- return 0;
-}
-
-
-static int is_supported_fourcc(uint32_t fourcc)
-{
- switch(fourcc)
- {
- case IMGFMT_YV12:
- case IMGFMT_I420:
- case IMGFMT_UYVY:
- case IMGFMT_YVYU:
- case IMGFMT_YUY2:
- case IMGFMT_BGR15:
- case IMGFMT_BGR16:
- case IMGFMT_BGR32:
- return 1;
- default:
- return 0;
- }
-}
-
-int vixQueryFourcc(vidix_fourcc_t *to)
-{
- if(is_supported_fourcc(to->fourcc))
- {
- to->depth = VID_DEPTH_1BPP | VID_DEPTH_2BPP |
- VID_DEPTH_4BPP | VID_DEPTH_8BPP |
- VID_DEPTH_12BPP| VID_DEPTH_15BPP|
- VID_DEPTH_16BPP| VID_DEPTH_24BPP|
- VID_DEPTH_32BPP;
- to->flags = VID_CAP_EXPAND | VID_CAP_SHRINK | VID_CAP_COLORKEY;
- return 0;
- }
- else
- to->depth = to->flags = 0;
- return ENOSYS;
-}
-
-
-int vixGetGrKeys(vidix_grkey_t *grkey)
-{
- memcpy(grkey, &uc_grkey, sizeof(vidix_grkey_t));
- return(0);
-}
-
-
-int vixSetGrKeys(const vidix_grkey_t *grkey)
-{
- unsigned long dwCompose = VIDEO_IN(vio, V_COMPOSE_MODE) & ~0x0f;
- memcpy(&uc_grkey, grkey, sizeof(vidix_grkey_t));
- if (uc_grkey.ckey.op != CKEY_FALSE)
- {
- // Set colorkey
- // (how do I detect BPP in hardware??)
- unsigned long ckey;
- if (1) // Assume 16-bit graphics
- {
- ckey = (grkey->ckey.blue & 0x1f)
- | ((grkey->ckey.green & 0x3f) << 5)
- | ((grkey->ckey.red & 0x1f) << 11);
- }
- else
- {
- ckey = (grkey->ckey.blue)
- | (grkey->ckey.green << 8)
- | (grkey->ckey.red << 16);
- }
- VIDEO_OUT(vio, V_COLOR_KEY, ckey);
- dwCompose |= SELECT_VIDEO_IF_COLOR_KEY;
- }
-
- // Execute the changes
- VIDEO_OUT(vio, V_COMPOSE_MODE, dwCompose | V1_COMMAND_FIRE);
- return(0);
-}
-
-
-vidix_video_eq_t equal =
-{
- VEQ_CAP_BRIGHTNESS | VEQ_CAP_SATURATION | VEQ_CAP_HUE,
- 300, 100, 0, 0, 0, 0, 0, 0
-};
-
-int vixPlaybackGetEq( vidix_video_eq_t * eq)
-{
- memcpy(eq,&equal,sizeof(vidix_video_eq_t));
- return 0;
-}
-
-int vixPlaybackSetEq( const vidix_video_eq_t * eq)
-{
- return 0;
-}
-
-
-static int YOffs,UOffs,VOffs;
-
-int vixConfigPlayback(vidix_playback_t *info)
-{
- int src_w, drw_w;
- int src_h, drw_h;
- long base0, pitch;
- int uv_size, swap_uv;
- unsigned int i;
- int extfifo_on;
-
- // Overlay register settings
- uint32_t win_start, win_end;
- uint32_t zoom, mini;
- uint32_t dcount, falign, qwfetch;
- uint32_t v_ctrl, fifo_ctrl;
-
- if(!is_supported_fourcc(info->fourcc))
- return -1;
-
- src_w = info->src.w;
- src_h = info->src.h;
-
- drw_w = info->dest.w;
- drw_h = info->dest.h;
-
- // Setup FIFO
- uc_ovl_setup_fifo(&extfifo_on, src_w);
-
- // Get image format, FIFO size, etc.
- uc_ovl_map_v1_control(info->fourcc, src_w, 3, extfifo_on,
- &v_ctrl, &fifo_ctrl);
-
- // Setup layer window
- win_start = (info->dest.x << 16) | info->dest.y;
- win_end = ((info->dest.x + drw_w - 1) << 16) |
- (info->dest.y + drw_h - 1);
-
- // Get scaling and data-fetch parameters
- zoom = 0;
- mini = 0;
- uc_ovl_map_vzoom(src_h, drw_h, &zoom, &mini);
- uc_ovl_map_hzoom(src_w, drw_w, &zoom, &mini, &falign, &dcount);
- qwfetch = uc_ovl_map_qwfetch(info->fourcc, src_w);
-
- // Calculate buffer sizes
- swap_uv = 0;
- switch(info->fourcc)
- {
- default:
- case IMGFMT_YV12:
- swap_uv = 1;
- case IMGFMT_I420:
- case IMGFMT_UYVY:
- case IMGFMT_YVYU:
- pitch = ALIGN_TO (src_w, 32);
- uv_size = (pitch >> 1) * (src_h >> 1);
- break;
-
- case IMGFMT_YUY2:
- case IMGFMT_BGR15:
- case IMGFMT_BGR16:
- pitch = ALIGN_TO (src_w << 1, 32);
- uv_size = 0;
- break;
-
- case IMGFMT_BGR32:
- pitch = ALIGN_TO (src_w << 2, 32);
- uv_size = 0;
- break;
- }
- if ((src_w > 4096) || (src_h > 4096) ||
- (src_w < 32) || (src_h < 1) || (pitch > 0x1fff))
- {
- printf("[unichrome] Layer size out of bounds\n");
- }
-
- // Calculate offsets
- info->offset.y = 0;
- info->offset.v = info->offset.y + pitch * src_h;
- info->offset.u = info->offset.v + uv_size;
- info->frame_size = info->offset.u + uv_size;
- YOffs = info->offset.y;
- UOffs = (swap_uv ? info->offset.v : info->offset.u);
- VOffs = (swap_uv ? info->offset.u : info->offset.v);
-
- /* Assume we have 2 MB to play with */
- info->num_frames = FRAMEBUFFER_SIZE / info->frame_size;
- if(info->num_frames > VID_PLAY_MAXFRAMES)
- info->num_frames = VID_PLAY_MAXFRAMES;
-
- /* Start at 6 MB. Let's hope it's not in use. */
- base0 = FRAMEBUFFER_START;
- info->dga_addr = uc_mem + base0;
-
- info->dest.pitch.y = 32;
- info->dest.pitch.u = 32;
- info->dest.pitch.v = 32;
-
- for(i = 0; i < info->num_frames; i++)
- {
- info->offsets[i] = info->frame_size * i;
- frames[i] = base0+info->offsets[i];
- }
-
- // Write to the hardware
- uc_ovl_vcmd_wait(vio);
-
- // Configure diy_pitchlay parameters now
- if (v_ctrl & V1_COLORSPACE_SIGN)
- {
- VIDEO_OUT (vio, V1_ColorSpaceReg_2, ColorSpaceValue_2);
- VIDEO_OUT (vio, V1_ColorSpaceReg_1, ColorSpaceValue_1);
- }
-
- VIDEO_OUT(vio, V1_CONTROL, v_ctrl);
- VIDEO_OUT(vio, V_FIFO_CONTROL, fifo_ctrl);
-
- VIDEO_OUT(vio, V1_WIN_START_Y, win_start);
- VIDEO_OUT(vio, V1_WIN_END_Y, win_end);
-
- VIDEO_OUT(vio, V1_SOURCE_HEIGHT, (src_h << 16) | dcount);
-
- VIDEO_OUT(vio, V12_QWORD_PER_LINE, qwfetch << 20);
- VIDEO_OUT(vio, V1_STRIDE, pitch | ((pitch >> 1) << 16));
-
- VIDEO_OUT(vio, V1_MINI_CONTROL, mini);
- VIDEO_OUT(vio, V1_ZOOM_CONTROL, zoom);
-
- // Configure buffer address and execute the changes now!
- vixPlaybackFrameSelect(0);
-
- return 0;
-}
-
-
-int vixPlaybackOn(void)
-{
- LOGWRITE("Enable overlay\n");
-
- // Turn on overlay
- VIDEO_OUT(vio, V1_CONTROL, VIDEO_IN(vio, V1_CONTROL) | V1_ENABLE);
-
- // Execute the changes
- VIDEO_OUT(vio, V_COMPOSE_MODE,
- VIDEO_IN(vio, V_COMPOSE_MODE) | V1_COMMAND_FIRE);
-
- return 0;
-}
-
-
-int vixPlaybackOff(void)
-{
- LOGWRITE("Disable overlay\n");
-
- uc_ovl_vcmd_wait(vio);
-
- // Restore FIFO
- VIDEO_OUT(vio, V_FIFO_CONTROL, UC_MAP_V1_FIFO_CONTROL(16,12,8));
-
- // Turn off overlay
- VIDEO_OUT(vio, V1_CONTROL, VIDEO_IN(vio, V1_CONTROL) & ~V1_ENABLE);
-
- // Execute the changes
- VIDEO_OUT(vio, V_COMPOSE_MODE,
- VIDEO_IN(vio, V_COMPOSE_MODE) | V1_COMMAND_FIRE);
-
- return 0;
-}
-
-
-int vixPlaybackFrameSelect(unsigned int frame)
-{
- LOGWRITE("Frame select\n");
-
- uc_ovl_vcmd_wait(vio);
-
- // Configure buffer address
- VIDEO_OUT(vio, V1_STARTADDR_Y0, frames[frame]+YOffs);
- VIDEO_OUT(vio, V1_STARTADDR_CB0, frames[frame]+UOffs);
- VIDEO_OUT(vio, V1_STARTADDR_CR0, frames[frame]+VOffs);
-
- // Execute the changes
- VIDEO_OUT(vio, V_COMPOSE_MODE,
- VIDEO_IN(vio, V_COMPOSE_MODE) | V1_COMMAND_FIRE);
-
- return 0;
-}
-
diff --git a/src/video_out/vidix/fourcc.h b/src/video_out/vidix/fourcc.h
deleted file mode 100644
index 891f0b6ff..000000000
--- a/src/video_out/vidix/fourcc.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * fourcc.h
- * This file is part of VIDIX
- * Copyright 2002 Nick Kurshev
- * Licence: GPL
- * This interface is based on v4l2, fbvid.h, mga_vid.h projects
- * and personally my ideas.
-*/
-#ifndef FOURCC_H
-#define FOURCC_H
-
-/* Four-character-code (FOURCC) */
-#define vid_fourcc(a,b,c,d)\
- (((unsigned)(a)<<0)|((unsigned)(b)<<8)|((unsigned)(c)<<16)|((unsigned)(d)<<24))
-
-/* RGB fourcc */
-#define IMGFMT_RGB332 vid_fourcc('R','G','B','1') /* 8 RGB-3-3-2 */
-#define IMGFMT_RGB555 vid_fourcc('R','G','B','O') /* 16 RGB-5-5-5 */
-#define IMGFMT_RGB565 vid_fourcc('R','G','B','P') /* 16 RGB-5-6-5 */
-#define IMGFMT_RGB555X vid_fourcc('R','G','B','Q') /* 16 RGB-5-5-5 BE */
-#define IMGFMT_RGB565X vid_fourcc('R','G','B','R') /* 16 RGB-5-6-5 BE */
-#define IMGFMT_BGR15 vid_fourcc('B','G','R',15) /* 15 BGR-5-5-5 */
-#define IMGFMT_RGB15 vid_fourcc('R','G','B',15) /* 15 RGB-5-5-5 */
-#define IMGFMT_BGR16 vid_fourcc('B','G','R',16) /* 32 BGR-5-6-5 */
-#define IMGFMT_RGB16 vid_fourcc('R','G','B',16) /* 32 RGB-5-6-5 */
-#define IMGFMT_BGR24 vid_fourcc('B','G','R',24) /* 24 BGR-8-8-8 */
-#define IMGFMT_RGB24 vid_fourcc('R','G','B',24) /* 24 RGB-8-8-8 */
-#define IMGFMT_BGR32 vid_fourcc('B','G','R',32) /* 32 BGR-8-8-8-8 */
-#define IMGFMT_RGB32 vid_fourcc('R','G','B',32) /* 32 RGB-8-8-8-8 */
-
-/* Planar YUV Formats */
-#define IMGFMT_YVU9 vid_fourcc('Y','V','U','9') /* 9 YVU 4:1:0 */
-#define IMGFMT_IF09 vid_fourcc('I','F','0','9') /* 9.5 YUV 4:1:0 */
-#define IMGFMT_YV12 vid_fourcc('Y','V','1','2') /* 12 YVU 4:2:0 */
-#define IMGFMT_I420 vid_fourcc('I','4','2','0') /* 12 YUV 4:2:0 */
-#define IMGFMT_IYUV vid_fourcc('I','Y','U','V') /* 12 YUV 4:2:0 */
-#define IMGFMT_CLPL vid_fourcc('C','L','P','L') /* 12 */
-#define IMGFMT_Y800 vid_fourcc('Y','8','0','0') /* 8 Y Grayscale */
-#define IMGFMT_NV12 vid_fourcc('N','V','1','2') /* 8 Y Grayscale */
-#define IMGFMT_Y8 vid_fourcc('Y','8',' ',' ') /* 8 Y Grayscale */
-
-/* Packed YUV Formats */
-#define IMGFMT_IUYV vid_fourcc('I','U','Y','V') /* 16 line order {0,2,4,...1,3,5} */
-#define IMGFMT_IY41 vid_fourcc('I','Y','4','1') /* 12 line order {0,2,4,...1,3,5} */
-#define IMGFMT_IYU1 vid_fourcc('I','Y','U','1') /* 12 IEEE 1394 Digital Camera */
-#define IMGFMT_IYU2 vid_fourcc('I','Y','U','2') /* 24 IEEE 1394 Digital Camera */
-#define IMGFMT_UYVY vid_fourcc('U','Y','V','Y') /* 16 UYVY 4:2:2 */
-#define IMGFMT_UYNV vid_fourcc('U','Y','N','V') /* 16 UYVY 4:2:2 */
-#define IMGFMT_cyuv vid_fourcc('c','y','u','v') /* 16 */
-#define IMGFMT_Y422 vid_fourcc('Y','4','2','2') /* 16 UYVY 4:2:2 */
-#define IMGFMT_YUY2 vid_fourcc('Y','U','Y','2') /* 16 YUYV 4:2:2 */
-#define IMGFMT_YUNV vid_fourcc('Y','U','N','V') /* 16 YUYV 4:2:2 */
-#define IMGFMT_YVYU vid_fourcc('Y','V','Y','U') /* 16 YVYU 4:2:2 */
-#define IMGFMT_Y41P vid_fourcc('Y','4','1','P') /* 12 YUV 4:1:1 */
-#define IMGFMT_Y211 vid_fourcc('Y','2','1','1') /* 8.5 YUV 2:1:1 */
-#define IMGFMT_Y41T vid_fourcc('Y','4','1','T') /* 12 YUV 4:1:1 */
-#define IMGFMT_Y42T vid_fourcc('Y','4','2','T') /* 16 UYVU 4:2:2 */
-#define IMGFMT_V422 vid_fourcc('V','4','2','2') /* 16 YUY2 4:2:2 */
-#define IMGFMT_V655 vid_fourcc('V','6','5','5') /* 16 YUV 4:2:2 */
-#define IMGFMT_CLJR vid_fourcc('C','L','J','R') /* 7.9 YUV 4:1:1 */
-#define IMGFMT_YUVP vid_fourcc('Y','U','V','P') /* 24 Y0U0Y1V0 */
-#define IMGFMT_UYVP vid_fourcc('U','Y','V','P') /* 24 U0Y0V0Y1 */
-#define IMGFMT_411P vid_fourcc('4','1','1','P') /* 12 alias of Y41B */
-#define IMGFMT_422P vid_fourcc('4','2','2','P') /* 16 alias of Y42B */
-#define IMGFMT_444P vid_fourcc('4','4','4','P') /* 24 alias of Y44B */
-
-/* Vendor-specific formats */
-#define IMGFMT_WNVA vid_fourcc('W','N','V','A') /* Winnov hw compress */
-
-#endif
diff --git a/src/video_out/vidix/vidix.h b/src/video_out/vidix/vidix.h
deleted file mode 100644
index bcf6b4ae0..000000000
--- a/src/video_out/vidix/vidix.h
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
- * vidix.h
- * VIDIX - VIDeo Interface for *niX
- * This interface is introduced as universal one to MPEG decoder,
- * BES == Back End Scaler and YUV2RGB hw accelerators.
- * In the future it may be expanded up to capturing and audio things.
- * Main goal of this this interface imlpementation is providing DGA
- * everywhere where it's possible (unlike X11 and other).
- * Copyright 2002 Nick Kurshev
- * Licence: GPL
- * This interface is based on v4l2, fbvid.h, mga_vid.h projects
- * and personally my ideas.
- * NOTE: This interface is introduces as driver interface.
- * Don't use it for APP.
-*/
-#ifndef VIDIX_H
-#define VIDIX_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define VIDIX_VERSION 100
-
- /* returns driver version */
-extern unsigned vixGetVersion( void );
-
-#define PROBE_NORMAL 0 /* normal probing */
-#define PROBE_FORCE 1 /* ignore device_id but recognize device if it's known */
- /* Probes video hw.
- verbose - specifies verbose level.
- force - specifies force mode - driver should ignore
- device_id (danger but useful for new devices)
- Returns 0 if ok else errno */
-extern int vixProbe( int verbose, int force );
- /* Initializes driver.
- args - specifies driver specific parameters
- Returns 0 if ok else errno */
-extern int vixInit( const char *args );
- /* Destroys driver */
-extern void vixDestroy( void );
-
-typedef struct vidix_capability_s
-{
- char name[64]; /* Driver name */
- char author[64]; /* Author name */
-#define TYPE_OUTPUT 0x00000000 /* Is a video playback device */
-#define TYPE_CAPTURE 0x00000001 /* Is a capture device */
-#define TYPE_CODEC 0x00000002 /* Device supports hw (de)coding */
-#define TYPE_FX 0x00000004 /* Is a video effects device */
- int type; /* Device type, see below */
- unsigned reserved0[4];
- int maxwidth;
- int maxheight;
- int minwidth;
- int minheight;
- int maxframerate; /* -1 if unlimited */
-#define FLAG_NONE 0x00000000 /* No flags defined */
-#define FLAG_DMA 0x00000001 /* Card can use DMA */
-#define FLAG_EQ_DMA 0x00000002 /* Card can use DMA only if src pitch == dest pitch */
-#define FLAG_SYNC_DMA 0x00000004 /* Possible to wait for DMA
- * to finish. See
- * BM_DMA_SYNC and
- * BM_DMA_BLOCK below */
-#define FLAG_UPSCALER 0x00000010 /* Card supports hw upscaling */
-#define FLAG_DOWNSCALER 0x00000020 /* Card supports hw downscaling */
-#define FLAG_SUBPIC 0x00001000 /* Card supports DVD subpictures */
-#define FLAG_EQUALIZER 0x00002000 /* Card supports equalizer */
- unsigned flags; /* Feature flags, see above */
- unsigned short vendor_id;
- unsigned short device_id;
- unsigned reserved1[4];
-}vidix_capability_t;
-
- /* Should fill at least type before init.
- Returns 0 if ok else errno */
-extern int vixGetCapability(vidix_capability_t *);
-
-typedef struct vidix_fourcc_s
-{
- unsigned fourcc; /* input: requested fourcc */
- unsigned srcw; /* input: hint: width of source */
- unsigned srch; /* input: hint: height of source */
-#define VID_DEPTH_NONE 0x0000
-#define VID_DEPTH_1BPP 0x0001
-#define VID_DEPTH_2BPP 0x0002
-#define VID_DEPTH_4BPP 0x0004
-#define VID_DEPTH_8BPP 0x0008
-#define VID_DEPTH_12BPP 0x0010
-#define VID_DEPTH_15BPP 0x0020
-#define VID_DEPTH_16BPP 0x0040
-#define VID_DEPTH_24BPP 0x0080
-#define VID_DEPTH_32BPP 0x0100
- unsigned depth; /* output: screen depth for given fourcc */
-#define VID_CAP_NONE 0x0000
-#define VID_CAP_EXPAND 0x0001 /* if overlay can be bigger than source */
-#define VID_CAP_SHRINK 0x0002 /* if overlay can be smaller than source */
-#define VID_CAP_BLEND 0x0004 /* if overlay can be blended with framebuffer */
-#define VID_CAP_COLORKEY 0x0008 /* if overlay can be restricted to a colorkey */
-#define VID_CAP_ALPHAKEY 0x0010 /* if overlay can be restricted to an alpha channel */
-#define VID_CAP_COLORKEY_ISRANGE 0x0020 /* if the colorkey can be a range */
-#define VID_CAP_ALPHAKEY_ISRANGE 0x0040 /* if the alphakey can be a range */
-#define VID_CAP_COLORKEY_ISMAIN 0x0080 /* colorkey is checked against framebuffer */
-#define VID_CAP_COLORKEY_ISOVERLAY 0x0100 /* colorkey is checked against overlay */
-#define VID_CAP_ALPHAKEY_ISMAIN 0x0200 /* alphakey is checked against framebuffer */
-#define VID_CAP_ALPHAKEY_ISOVERLAY 0x0400 /* alphakey is checked against overlay */
- unsigned flags; /* output: capability */
-}vidix_fourcc_t;
-
- /* Returns 0 if ok else errno */
-extern int vixQueryFourcc(vidix_fourcc_t *);
-
-typedef struct vidix_yuv_s
-{
- unsigned y,u,v,a;
-}vidix_yuv_t;
-
-typedef struct vidix_rect_s
-{
- unsigned x,y,w,h; /* in pixels */
- vidix_yuv_t pitch; /* line-align in bytes */
-}vidix_rect_t;
-
-typedef struct vidix_color_key_s
-{
-#define CKEY_FALSE 0
-#define CKEY_TRUE 1
-#define CKEY_EQ 2
-#define CKEY_NEQ 3
- unsigned op; /* defines logical operation */
- unsigned char red;
- unsigned char green;
- unsigned char blue;
- unsigned char reserved;
-}vidix_ckey_t;
-
-typedef struct vidix_video_key_s
-{
-#define VKEY_FALSE 0
-#define VKEY_TRUE 1
-#define VKEY_EQ 2
-#define VKEY_NEQ 3
- unsigned op; /* defines logical operation */
- unsigned char key[8];
-}vidix_vkey_t;
-
-typedef struct vidix_playback_s
-{
- unsigned fourcc; /* app -> driver: movies's fourcc */
- unsigned capability; /* app -> driver: what capability to use */
- unsigned blend_factor; /* app -> driver: blending factor */
- vidix_rect_t src; /* app -> driver: original movie size */
- vidix_rect_t dest; /* app -> driver: destinition movie size. driver->app dest_pitch */
-#define VID_PLAY_INTERLEAVED_UV 0x00000001 /* driver -> app: interleaved UV planes */
-#define INTERLEAVING_UV 0x00001000 /* UVUVUVUVUV used by Matrox G200 */
-#define INTERLEAVING_VU 0x00001001 /* VUVUVUVUVU */
- int flags;
- /* memory model */
- unsigned frame_size; /* driver -> app: destinition frame size */
- unsigned num_frames; /* app -> driver: after call: driver -> app */
-#define VID_PLAY_MAXFRAMES 1024 /* unreal limitation */
- unsigned offsets[VID_PLAY_MAXFRAMES]; /* driver -> app */
- vidix_yuv_t offset; /* driver -> app: relative offsets within frame for yuv planes */
- void* dga_addr; /* driver -> app: linear address */
-}vidix_playback_t;
-
- /* Returns 0 if ok else errno */
-extern int vixConfigPlayback(vidix_playback_t *);
-
- /* Returns 0 if ok else errno */
-extern int vixPlaybackOn( void );
-
- /* Returns 0 if ok else errno */
-extern int vixPlaybackOff( void );
-
- /* Returns 0 if ok else errno */
-extern int vixPlaybackFrameSelect( unsigned frame_idx );
-
-typedef struct vidix_grkey_s
-{
- vidix_ckey_t ckey; /* app -> driver: color key */
- vidix_vkey_t vkey; /* app -> driver: video key */
-#define KEYS_PUT 0
-#define KEYS_AND 1
-#define KEYS_OR 2
-#define KEYS_XOR 3
- unsigned key_op; /* app -> driver: keys operations */
-}vidix_grkey_t;
-
- /* Returns 0 if ok else errno */
-extern int vixGetGrKeys( vidix_grkey_t * );
-
- /* Returns 0 if ok else errno */
-extern int vixSetGrKeys( const vidix_grkey_t * );
-
-
-typedef struct vidix_video_eq_s
-{
-#define VEQ_CAP_NONE 0x00000000UL
-#define VEQ_CAP_BRIGHTNESS 0x00000001UL
-#define VEQ_CAP_CONTRAST 0x00000002UL
-#define VEQ_CAP_SATURATION 0x00000004UL
-#define VEQ_CAP_HUE 0x00000008UL
-#define VEQ_CAP_RGB_INTENSITY 0x00000010UL
- int cap; /* on get_eq should contain capability of equalizer
- on set_eq should contain using fields */
-/* end-user app can have presets like: cold-normal-hot picture and so on */
- int brightness; /* -1000 : +1000 */
- int contrast; /* -1000 : +1000 */
- int saturation; /* -1000 : +1000 */
- int hue; /* -1000 : +1000 */
- int red_intensity; /* -1000 : +1000 */
- int green_intensity;/* -1000 : +1000 */
- int blue_intensity; /* -1000 : +1000 */
-#define VEQ_FLG_ITU_R_BT_601 0x00000000 /* ITU-R BT.601 colour space (default) */
-#define VEQ_FLG_ITU_R_BT_709 0x00000001 /* ITU-R BT.709 colour space */
-#define VEQ_FLG_ITU_MASK 0x0000000f
- int flags; /* currently specifies ITU YCrCb color space to use */
-}vidix_video_eq_t;
-
- /* Returns 0 if ok else errno */
-extern int vixPlaybackGetEq( vidix_video_eq_t * );
-
- /* Returns 0 if ok else errno */
-extern int vixPlaybackSetEq( const vidix_video_eq_t * );
-
-typedef struct vidix_deinterlace_s
-{
-#define CFG_NON_INTERLACED 0x00000000 /* stream is not interlaced */
-#define CFG_INTERLACED 0x00000001 /* stream is interlaced */
-#define CFG_EVEN_ODD_INTERLACING 0x00000002 /* first frame contains even fields but second - odd */
-#define CFG_ODD_EVEN_INTERLACING 0x00000004 /* first frame contains odd fields but second - even */
-#define CFG_UNIQUE_INTERLACING 0x00000008 /* field deinterlace_pattern is valid */
-#define CFG_UNKNOWN_INTERLACING 0x0000000f /* unknown deinterlacing - use adaptive if it's possible */
- unsigned flags;
- unsigned deinterlace_pattern; /* app -> driver: deinterlace pattern if flag CFG_UNIQUE_INTERLACING is set */
-}vidix_deinterlace_t;
-
- /* Returns 0 if ok else errno */
-extern int vixPlaybackGetDeint( vidix_deinterlace_t * );
-
- /* Returns 0 if ok else errno */
-extern int vixPlaybackSetDeint( const vidix_deinterlace_t * );
-
-typedef struct vidix_slice_s
-{
- void* address; /* app -> driver */
- unsigned size; /* app -> driver */
- vidix_rect_t slice; /* app -> driver */
-}vidix_slice_t;
-
-typedef struct vidix_dma_s
-{
- void * src; /* app -> driver. Virtual address of source */
- unsigned dest_offset; /* app -> driver. Destinition offset within of video memory */
- unsigned size; /* app -> driver. Size of transaction */
-#define BM_DMA_ASYNC 0
-#define BM_DMA_SYNC 1 /* await previous dma transfer completion */
-#define BM_DMA_FIXED_BUFFS 2 /* app -> driver: app uses buffers which are fixed in memory */
-#define BM_DMA_BLOCK 4 /* block until the transfer is complete */
- unsigned flags; /* app -> driver */
- unsigned idx; /* app -> driver: idx of src buffer */
- void * internal[VID_PLAY_MAXFRAMES]; /* for internal use by driver */
-}vidix_dma_t;
-
- /* Returns 0 if ok else errno */
-extern int vixPlaybackCopyFrame( vidix_dma_t * );
-
- /* Returns 0 if DMA is available else errno (EBUSY) */
-extern int vixQueryDMAStatus( void );
-/*
- This structure is introdused to support OEM effects like:
- - sharpness
- - exposure
- - (auto)gain
- - H(V)flip
- - black level
- - white balance
- and many other
-*/
-typedef struct vidix_oem_fx_s
-{
-#define FX_TYPE_BOOLEAN 0x00000000
-#define FX_TYPE_INTEGER 0x00000001
- int type; /* type of effects */
- int num; /* app -> driver: effect number. From 0 to max number of effects */
- int minvalue; /* min value of effect. 0 - for boolean */
- int maxvalue; /* max value of effect. 1 - for boolean */
- int value; /* current value of effect on 'get'; required on set */
- char * name[80]; /* effect name to display */
-}vidix_oem_fx_t;
-
- /* Returns 0 if ok else errno */
-extern int vixQueryNumOemEffects( unsigned * number );
-
- /* Returns 0 if ok else errno */
-extern int vixGetOemEffect( vidix_oem_fx_t * );
-
- /* Returns 0 if ok else errno */
-extern int vixSetOemEffect( const vidix_oem_fx_t * );
-
-#ifdef VIDIX_BUILD_STATIC
-#define VIDIX_NAME(name) VIDIX_STATIC##name
-#else
-#define VIDIX_NAME(name) name
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/src/video_out/vidix/vidix.txt b/src/video_out/vidix/vidix.txt
deleted file mode 100644
index e642147b4..000000000
--- a/src/video_out/vidix/vidix.txt
+++ /dev/null
@@ -1,247 +0,0 @@
- VIDIX - VIDeo Interface for *niX
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-This interface was designed and introduced as interface to userspace drivers
-to provide DGA everywhere where it's possible (unline X11).
-I hope that these drivers will be portable same as X11 (not only on *nix).
-
-What is it:
-- It's portable successor of mga_vid technology which is located in user-space.
-- Unlikely X11 it's provides DGA everywhere where it's possible.
-- Unlikely v4l it provides interface for video playback
-- Unlikely linux's drivers it uses mathematics library.
-
-Why it was developed:
-As said Vladimir Dergachev
-(http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/gatos/km/km.rfc.txt):
-"0) Motivation
- v4l, v4l2 and Xv are all suffering from the same problem: attempt to fit
- existing multimedia devices into a fixed scheme."
-Well - I tried to implement something similar by motivation.
-
-How it works:
-~~~~~~~~~~~~~
-
-This interface is almost finished. But I guess it can be expanded by developer's
-requests.
-So any suggestions, reports, criticism are gladly accepted.
-
-1) APP calls vixGetVersion to check age of driver ;)
-2) APP calls vixProbe. Driver should return 0 if it can handle something in PC.
-3) APP calls vixGetCapability. Driver should return filled
- vidix_capability_t.type field at least.
-4) If above calls were succesful then APP calls vixInit function
- (Driver can have not exported this function in this case call will be
- skiped).
-5) After initializing of driver APP calls vixGetCapability again
- (In this case driver must fill every field of struct)
-6) APP calls vixQueryFourcc. Driver should answer - can it configure
- video memory for given fourcc or not.
-7) APP calls vixConfigPlayback. Driver should prepare BES on this call.
- APP pass to driver following info:
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- vidix_playback_t.fourcc - contains fourcc of movie
- vidix_playback_t.capability - currently contsinas copy of vidix_capability_t.flags
- vidix_playback_t.blend_factor- currently unused
- vidix_playback_t.src - x,y,w,h fields contain original movie size
- (in pixels) x and y often are nulls.
- vidix_playback_t.src.pitch.y These fields contain source pitches
- vidix_playback_t.src.pitch.u - for each Y,U,V plane in bytes.
- vidix_playback_t.src.pitch.v (For packed fourcc only Y value is used)
- They are hints for driver to use same destinition
- pitches as in source memory (to speed up
- memcpy process).
- Note: when source pitches are unknown or
- variable these field will be filled into 0.
- vidix_playback_t.dest - x,y,w,h fields contains destinition rectange
- on the screen in pixels.
- vidix_playback_t.num_frames - maximal # of frames which can be used by APP.
- (Currently 10).
- Driver should fill following fields:
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- vidix_playback_t.num_frames - real # of frames which will be used by driver.
- (Should be less or equal to app's num_frames).
-
- vidix_playback_t.dest.pitch.y These fields should contain alignment
- vidix_playback_t.dest.pitch.u - for each Y,U,V plane in bytes.
- vidix_playback_t.dest.pitch.v (For packed fourcc only Y value is used)
-
- vidix_playback_t.frame_size - Driver should tell to app which size of
- source frame (src.w and src.h) should
- use APP (according to pitches and offsets)
-
- vidix_playback_t.offsets - offsets from begin of BES memory for each frame
-
- vidix_playback_t.offset.y These field should contain offset
- vidix_playback_t.offset.u - for each Y,U,V plane within frame.
- vidix_playback_t.offset.v (For packed fourcc only Y value is used)
-
- vidix_playback_t.dga_addr - Address of BES memory.
-
-Also see this picture:
-
-VIDEO MEMORY layout:
- +----------- It's begin of video memory End of video memory--------------+
- | |
- v v
- [ RGB memory | YUV memory | UNDEF ]
- ^
- |
- +---- begin of BES memory
-
-BES MEMORY layout:
- +-------- begin of BES memory
- |
- v
- [ | | | | |
- ^ ^ ^ ^ ^
- | | | | + BEGIN of second frame
- | | | + BEGIN of V plane
- | | + BEGIN of U plane
- | +------- BEGIN of Y plane
- |
- +--------- BEGIN of first frame
-
-This means that in general case:
-offset of frame != offset of BES
-offset of Y plane != offset of first frame
-
-But often: vidix_playback_t.offsets[0] = vidix_playback_t.offset.y = 0;
-
-Formula: (For Y plane) copy source to:
- vidix_playback_t.dga_addr +
- vidix_playback_t.offsets[i] +
- vidix_playback_t.offset.y
-
-8) APP calls vixPlaybackOn. Driver should activate BES on this call.
-9) PLAYBACK. Driver should sleep here ;)
- But during playback can be called:
- vixFrameSelect (if this function is exported)
- Driver should prepare and activate corresponded frame.
- This function is used only for double and trilpe buffering and
- never used for single buffering playback.
- vixGet(Set)GrKeys (if this function is exported)
- This interface should be tuned but intriduced for overlapped playback
- and video effects (TYPE_FX)
- vixPlaybackGet(Set)Eq (if this function is exported)
- For color correction.
-10) APP calls vixPlaybackOff. Driver should deactivate BES on this call.
-11) If vixDestroy is defined APP calls this function before unloading driver
- from memory.
-
-
-What functions are mandatory:
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-vixGetVersion
-vixProbe
-vixGetCapability
-vixQueryFourcc
-vixConfigPlayback
-vixPlaybackOn
-vixPlaybackOff
-
-All other functions are optionaly.
-
-BUSMASTERING
-************
-
-Busmastering is technique to implement data transfer through DMA.
-This technique is intended to free CPU for other useful work to
-speedup movie playback. The speedup will be different on different
-CPUs OSes and videocards. Only thing which SHOULD be implemented
-it's the fact that frame should be transfered faster than 1/fps.
-(I.e. faster than 33ms for 30 fps or faster than 40ms for 25 fps)
-VIDIX implementation of BM (busmastering) is slightly specific.
-During driver development you should keep in mind the next rules:
-1. BM is implemented as parallel process which should work
- simultaneously with frame decoding.
-2. To have possibility to use busmastering by non-ROOT users
- driver should rather call functions from libdha than from libc.
- (Example: driver should call bm_lock_mem instead of mlock)
-3. To speedup data transfer player will pass pointer to the DMA buffer
- which will have the same structure (planes and strides) as video memory
- (In this connexion driver should allocate frames in video memory
- same as if BM would not be implemented).
-
-Interface:
-~~~~~~~~~~
-
-The interface of BM is implemented through 2 functions:
- vixPlaybackCopyFrame
- vixQueryDMAStatus
-
-
-vixPlaybackCopyFrame
-
-should prepare engine to copy frame from
-system memory into video framebuffer. After that driver should
-send command into engine to start data transfer and return
-control immediatedly.
-
-The structure vidix_dma_s in details:
-
-typedef struct vidix_dma_s
-{
- /*
- app -> driver.
- Virtual address of source.
- Note: source buffer is allocated by using malloc
- or memalign();
- */
- void * src;
- /*
- app -> driver.
- Destinition offset within of video memory.
- It will point offset within of YUV memory where
- destinition data should be stored.
- */
- unsigned dest_offset;
- /* app -> driver. Size of data to be transfered in bytes. */
- unsigned size;
- /*
- can accept ORed values of BM_DMA* definitions
- BM_DMA_ASYNC - default value which indicates that transactiion
- should work asynchronously.
- BM_DMA_SYNC - may be ignored due speedup reasons
- BM_DMA_FIXED_BUFFS - indicates that player was started by ROOT
- and source DMA buffers were already locked in memory
- through mlock().
- /* app -> driver: idx of src buffer.
- if BM_DMA_FIXED_BUFFS flags is set then this field
- indicates which from buffers currently is passed
- into driver. This field maybe ignored by driver but
- it would be better to use that for minor speedup
- of engine preparing. */
- unsigned idx;
- /* for internal use by driver.
- Driver may use them on its opinion */
- void * internal[VID_PLAY_MAXFRAMES];
-}vidix_dma_t;
-
-
-vixQueryDMAStatus
-
-should check out DMA status and return 1 if BM is busy
-and 0 otherwise. Note: this function shouldn't wait any
-changes in DMA state.
-
-A few words about of non-linux systems
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Well, there is only one problem which stops us to use BM on
-nono-linux systems: it's lacking of possibility to perform
-convertion from virtual to physical address in user-space.
-This problem is sloved by so-called dhahelper driver for
-linux. What about of other OSes then this driver requires
-to be ported first. (Of course, except of DOS and DOS32
-where these convertions are unnecessary).
-
-Useful links:
-~~~~~~~~~~~~~
-Guide to DTV http://www.digitaltelevision.com/dtvbook/toc.shtml
-Fourcc http://www.webartz.com/fourcc/
-MPEG http://www.mpeg.org/MPEG/index.html
-Analog colors http://www.miranda.com/en/app_notes/TN/TN-05/TN-05.htm
-
-Please send your suggestions, reports, feedback to mplayerxp-general@lists.sourceforge.net
-
-Best regards! Nick Kurshev.
diff --git a/src/video_out/vidix/vidixlib.c b/src/video_out/vidix/vidixlib.c
deleted file mode 100644
index 37af2035b..000000000
--- a/src/video_out/vidix/vidixlib.c
+++ /dev/null
@@ -1,482 +0,0 @@
-/*
- * vidixlib.c
- * VIDIXLib - Library for VIDeo Interface for *niX
- * This interface is introduced as universal one to MPEG decoder,
- * BES == Back End Scaler and YUV2RGB hw accelerators.
- * In the future it may be expanded up to capturing and audio things.
- * Main goal of this this interface imlpementation is providing DGA
- * everywhere where it's possible (unlike X11 and other).
- * Copyright 2002 Nick Kurshev
- * Licence: GPL
- * This interface is based on v4l2, fbvid.h, mga_vid.h projects
- * and personally my ideas.
- * NOTE: This interface is introduces as APP interface.
- * Don't use it for driver.
- * It provides multistreaming. This mean that APP can handle
- * several streams simultaneously. (Example: Video capturing and video
- * playback or capturing, video playback, audio encoding and so on).
-*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
-#include <inttypes.h>
-
-#include <dlfcn.h> /* GLIBC specific. Exists under cygwin too! */
-#include <dirent.h>
-
-#include "vidixlib.h"
-#include "bswap.h"
-
-#define t_vdl(p) (((vdl_stream_t *)p))
-
-typedef struct vdl_stream_s
-{
- void * handle;
- int (*get_caps)(vidix_capability_t *);
- int (*query_fourcc)(vidix_fourcc_t *);
- int (*config_playback)(vidix_playback_t *);
- int (*playback_on)( void );
- int (*playback_off)( void );
- /* Functions below can be missed in driver ;) */
- int (*init)(const char *);
- void (*destroy)(void);
- int (*frame_sel)( unsigned frame_idx );
- int (*get_eq)( vidix_video_eq_t * );
- int (*set_eq)( const vidix_video_eq_t * );
- int (*get_deint)( vidix_deinterlace_t * );
- int (*set_deint)( const vidix_deinterlace_t * );
- int (*copy_frame)( const vidix_dma_t * );
- int (*query_dma)( void );
- int (*get_gkey)( vidix_grkey_t * );
- int (*set_gkey)( const vidix_grkey_t * );
- int (*get_num_fx)( unsigned * );
- int (*get_fx)( vidix_oem_fx_t * );
- int (*set_fx)( const vidix_oem_fx_t * );
-}vdl_stream_t;
-
-static char drv_name[FILENAME_MAX];
-static int dl_idx = -1;
-/* currently available driver for static linking */
-static const char* const drv_snames[] = {
-#ifdef VIDIX_BUILD_STATIC
- "genfb_",
- "mach64_",
- "mga_crtc2_",
- "mga_",
- "nvidia_",
- "pm2_",
- "pm3_",
- "radeo_",
- "rage128_",
-#endif
- NULL
-};
-
-extern unsigned vdlGetVersion( void )
-{
- return VIDIX_VERSION;
-}
-
-static void* dlsymm(void* handle, const char* fce)
-{
- char b[100];
-#if defined(__OpenBSD__) && !defined(__ELF__)
- b[0] = '_';
- b[1] = 0;
-#else
- b[0] = 0;
-#endif
- if (dl_idx >= 0) strcat(b, drv_snames[dl_idx]);
- strcat(b, fce);
- //printf("Handle %p %s\n", handle, b);
- return dlsym(handle, b);
-}
-
-static int vdl_fill_driver(VDL_HANDLE stream)
-{
- t_vdl(stream)->init = dlsymm(t_vdl(stream)->handle,"vixInit");
- t_vdl(stream)->destroy = dlsymm(t_vdl(stream)->handle,"vixDestroy");
- t_vdl(stream)->get_caps = dlsymm(t_vdl(stream)->handle,"vixGetCapability");
- t_vdl(stream)->query_fourcc = dlsymm(t_vdl(stream)->handle,"vixQueryFourcc");
- t_vdl(stream)->config_playback= dlsymm(t_vdl(stream)->handle,"vixConfigPlayback");
- t_vdl(stream)->playback_on = dlsymm(t_vdl(stream)->handle,"vixPlaybackOn");
- t_vdl(stream)->playback_off = dlsymm(t_vdl(stream)->handle,"vixPlaybackOff");
- t_vdl(stream)->frame_sel = dlsymm(t_vdl(stream)->handle,"vixPlaybackFrameSelect");
- t_vdl(stream)->get_eq = dlsymm(t_vdl(stream)->handle,"vixPlaybackGetEq");
- t_vdl(stream)->set_eq = dlsymm(t_vdl(stream)->handle,"vixPlaybackSetEq");
- t_vdl(stream)->get_gkey = dlsymm(t_vdl(stream)->handle,"vixGetGrKeys");
- t_vdl(stream)->set_gkey = dlsymm(t_vdl(stream)->handle,"vixSetGrKeys");
- t_vdl(stream)->get_deint = dlsymm(t_vdl(stream)->handle,"vixPlaybackGetDeint");
- t_vdl(stream)->set_deint = dlsymm(t_vdl(stream)->handle,"vixPlaybackSetDeint");
- t_vdl(stream)->copy_frame = dlsymm(t_vdl(stream)->handle,"vixPlaybackCopyFrame");
- t_vdl(stream)->query_dma = dlsymm(t_vdl(stream)->handle,"vixQueryDMAStatus");
- t_vdl(stream)->get_num_fx = dlsymm(t_vdl(stream)->handle,"vixQueryNumOemEffects");
- t_vdl(stream)->get_fx = dlsymm(t_vdl(stream)->handle,"vixGetOemEffect");
- t_vdl(stream)->set_fx = dlsymm(t_vdl(stream)->handle,"vixSetOemEffect");
- /* check driver viability */
- if(!( t_vdl(stream)->get_caps && t_vdl(stream)->query_fourcc &&
- t_vdl(stream)->config_playback && t_vdl(stream)->playback_on &&
- t_vdl(stream)->playback_off))
- {
- printf("vidixlib: Incomplete driver: some of essential features are missed in it.\n");
- return 0;
- }
- return 1;
-}
-
-#ifndef RTLD_GLOBAL
-#define RTLD_GLOBAL RTLD_LAZY
-#endif
-#ifndef RTLD_NOW
-#define RTLD_NOW RTLD_LAZY
-#endif
-
-static int vdl_probe_driver(VDL_HANDLE stream,const char *path,const char *name,unsigned cap,int verbose)
-{
- vidix_capability_t vid_cap;
- unsigned (*_ver)(void);
- int (*_probe)(int,int);
- int (*_cap)(vidix_capability_t*);
- strncpy(drv_name,path,sizeof(drv_name));
- drv_name[sizeof(drv_name) - 1] = '\0';
- strncat(drv_name,name,sizeof(drv_name) - strlen(drv_name) - 1);
- if(verbose) printf("vidixlib: PROBING: %s\n",drv_name);
-
- {
- const char* slash = strrchr(drv_name, '/');
- if (slash) {
- for (dl_idx = 0; drv_snames[dl_idx]; dl_idx++) {
- if (!strncmp(slash + 1, drv_snames[dl_idx], strlen(drv_snames[dl_idx])))
- break; // locate the name
- }
- if (!drv_snames[dl_idx]) dl_idx = -1;
- }
- }
- if (dl_idx < 0)
- if(!(t_vdl(stream)->handle = dlopen(drv_name,RTLD_LAZY|RTLD_GLOBAL))) {
- if(verbose) printf("vidixlib: %s not driver: %s\n",drv_name,dlerror());
- return 0;
- }
- _ver = dlsymm(t_vdl(stream)->handle,"vixGetVersion");
- _probe = dlsymm(t_vdl(stream)->handle,"vixProbe");
- _cap = dlsymm(t_vdl(stream)->handle,"vixGetCapability");
- if(_ver)
- {
- if((*_ver)() != VIDIX_VERSION)
- {
- if(verbose) printf("vidixlib: %s has wrong version\n",drv_name);
- err:
- dlclose(t_vdl(stream)->handle);
- t_vdl(stream)->handle = 0;
- dl_idx = -1;
- return 0;
- }
- }
- else
- {
- fatal_err:
- if(verbose) printf("vidixlib: %s has no function definition\n",drv_name);
- goto err;
- }
- if(_probe) { if((*_probe)(verbose,PROBE_NORMAL) != 0) goto err; }
- else goto fatal_err;
- if(_cap) { if((*_cap)(&vid_cap) != 0) goto err; }
- else goto fatal_err;
- if((vid_cap.type & cap) != cap)
- {
- if(verbose) printf("vidixlib: Found %s but has no required capability\n",drv_name);
- goto err;
- }
- if(verbose) printf("vidixlib: %s probed o'k\n",drv_name);
- return 1;
-}
-
-static int vdl_find_driver(VDL_HANDLE stream,const char *path,unsigned cap,int verbose)
-{
- DIR *dstream;
- struct dirent *name;
- int done = 0;
- if(!(dstream = opendir(path))) return 0;
- while(!done)
- {
- name = readdir(dstream);
- if(name)
- {
- if(name->d_name[0] != '.' && strstr(name->d_name, ".so"))
- if(vdl_probe_driver(stream,path,name->d_name,cap,verbose)) break;
- }
- else done = 1;
- }
- closedir(dstream);
- return done?0:1;
-}
-
-VDL_HANDLE vdlOpen(const char *path,const char *name,unsigned cap,int verbose)
-{
- vdl_stream_t *stream;
- const char *drv_args=NULL;
- int errcode;
- if(!(stream = malloc(sizeof(vdl_stream_t)))) return NULL;
- memset(stream,0,sizeof(vdl_stream_t));
- if(name)
- {
- unsigned (*ver)(void);
- int (*probe)(int,int);
- unsigned version = 0;
- unsigned char *arg_sep;
- arg_sep = strchr(name,':');
- if(arg_sep) { *arg_sep='\0'; drv_args = &arg_sep[1]; }
- strncpy(drv_name,path,sizeof(drv_name));
- drv_name[sizeof(drv_name) - 1] = '\0';
- strncat(drv_name,name,sizeof(drv_name) - strlen(drv_name) - 1);
- {
- const char* slash = strrchr(drv_name, '/');
- if (slash) {
- for (dl_idx = 0; drv_snames[dl_idx]; dl_idx++) {
- if (!strncmp(slash + 1, drv_snames[dl_idx], strlen(drv_snames[dl_idx])))
- break; // locate the name
- }
- if (!drv_snames[dl_idx]) dl_idx = -1;
- }
- }
- if (dl_idx < 0)
- if(!(t_vdl(stream)->handle = dlopen(drv_name,RTLD_NOW|RTLD_GLOBAL)))
- {
- if (verbose)
- printf("vidixlib: dlopen error: %s\n", dlerror());
- err:
- vdlClose(stream);
- return NULL;
- }
- ver = dlsymm(t_vdl(stream)->handle,"vixGetVersion");
- if(ver) version = (*ver)();
- if(version != VIDIX_VERSION)
- goto err;
- probe = dlsymm(t_vdl(stream)->handle,"vixProbe");
- if(probe) { if((*probe)(verbose,PROBE_FORCE)!=0) goto err; }
- else goto err;
- fill:
- if(!vdl_fill_driver(stream)) goto err;
- goto ok;
- }
- else
- if(vdl_find_driver(stream,path,cap,verbose))
- {
- if(verbose) printf("vidixlib: will use %s driver\n",drv_name);
- goto fill;
- }
- else goto err;
- ok:
- if(t_vdl(stream)->init)
- {
- if(verbose) printf("vidixlib: Attempt to initialize driver at: %p\n",t_vdl(stream)->init);
- if((errcode=t_vdl(stream)->init(drv_args))!=0)
- {
- if(verbose) printf("vidixlib: Can't init driver: %s\n",strerror(errcode));
- goto err;
- }
- }
- if(verbose) printf("vidixlib: '%s'successfully loaded\n",drv_name);
- return stream;
-}
-
-void vdlClose(VDL_HANDLE stream)
-{
- if(t_vdl(stream)->destroy) t_vdl(stream)->destroy();
- if(t_vdl(stream)->handle) dlclose(t_vdl(stream)->handle);
- memset(stream,0,sizeof(vdl_stream_t)); /* <- it's not stupid */
- free(stream);
- dl_idx = -1;
-}
-
-int vdlGetCapability(VDL_HANDLE handle, vidix_capability_t *cap)
-{
- return t_vdl(handle)->get_caps(cap);
-}
-
-#define MPLAYER_IMGFMT_RGB (('R'<<24)|('G'<<16)|('B'<<8))
-#define MPLAYER_IMGFMT_BGR (('B'<<24)|('G'<<16)|('R'<<8))
-#define MPLAYER_IMGFMT_RGB_MASK 0xFFFFFF00
-
-static uint32_t normalize_fourcc(uint32_t fourcc)
-{
- if((fourcc & MPLAYER_IMGFMT_RGB_MASK) == (MPLAYER_IMGFMT_RGB|0) ||
- (fourcc & MPLAYER_IMGFMT_RGB_MASK) == (MPLAYER_IMGFMT_BGR|0))
- return bswap_32(fourcc);
- else return fourcc;
-}
-
-int vdlQueryFourcc(VDL_HANDLE handle,vidix_fourcc_t *f)
-{
- f->fourcc = normalize_fourcc(f->fourcc);
- return t_vdl(handle)->query_fourcc(f);
-}
-
-int vdlConfigPlayback(VDL_HANDLE handle,vidix_playback_t *p)
-{
- p->fourcc = normalize_fourcc(p->fourcc);
- return t_vdl(handle)->config_playback(p);
-}
-
-int vdlPlaybackOn(VDL_HANDLE handle)
-{
- return t_vdl(handle)->playback_on();
-}
-
-int vdlPlaybackOff(VDL_HANDLE handle)
-{
- return t_vdl(handle)->playback_off();
-}
-
-int vdlPlaybackFrameSelect(VDL_HANDLE handle, unsigned frame_idx )
-{
- return t_vdl(handle)->frame_sel ? t_vdl(handle)->frame_sel(frame_idx) : ENOSYS;
-}
-
-int vdlPlaybackGetEq(VDL_HANDLE handle, vidix_video_eq_t * e)
-{
- return t_vdl(handle)->get_eq ? t_vdl(handle)->get_eq(e) : ENOSYS;
-}
-
-int vdlPlaybackSetEq(VDL_HANDLE handle, const vidix_video_eq_t * e)
-{
- return t_vdl(handle)->set_eq ? t_vdl(handle)->set_eq(e) : ENOSYS;
-}
-
-int vdlPlaybackCopyFrame(VDL_HANDLE handle, vidix_dma_t * f)
-{
- return t_vdl(handle)->copy_frame ? t_vdl(handle)->copy_frame(f) : ENOSYS;
-}
-
-int vdlQueryDMAStatus(VDL_HANDLE handle )
-{
- return t_vdl(handle)->query_dma ? t_vdl(handle)->query_dma() : ENOSYS;
-}
-
-int vdlGetGrKeys(VDL_HANDLE handle, vidix_grkey_t * k)
-{
- return t_vdl(handle)->get_gkey ? t_vdl(handle)->get_gkey(k) : ENOSYS;
-}
-
-int vdlSetGrKeys(VDL_HANDLE handle, const vidix_grkey_t * k)
-{
- return t_vdl(handle)->set_gkey ? t_vdl(handle)->set_gkey(k) : ENOSYS;
-}
-
-int vdlPlaybackGetDeint(VDL_HANDLE handle, vidix_deinterlace_t * d)
-{
- return t_vdl(handle)->get_deint ? t_vdl(handle)->get_deint(d) : ENOSYS;
-}
-
-int vdlPlaybackSetDeint(VDL_HANDLE handle, const vidix_deinterlace_t * d)
-{
- return t_vdl(handle)->set_deint ? t_vdl(handle)->set_deint(d) : ENOSYS;
-}
-
-int vdlQueryNumOemEffects(VDL_HANDLE handle, unsigned * number )
-{
- return t_vdl(handle)->get_num_fx ? t_vdl(handle)->get_num_fx(number) : ENOSYS;
-}
-
-int vdlGetOemEffect(VDL_HANDLE handle, vidix_oem_fx_t * f)
-{
- return t_vdl(handle)->get_fx ? t_vdl(handle)->get_fx(f) : ENOSYS;
-}
-
-int vdlSetOemEffect(VDL_HANDLE handle, const vidix_oem_fx_t * f)
-{
- return t_vdl(handle)->set_fx ? t_vdl(handle)->set_fx(f) : ENOSYS;
-}
-
-/* ABI related extensions */
-vidix_capability_t * vdlAllocCapabilityS( void )
-{
- vidix_capability_t *retval;
- retval=malloc(sizeof(vidix_capability_t));
- if(retval) memset(retval,0,sizeof(vidix_capability_t));
- return retval;
-}
-
-vidix_fourcc_t * vdlAllocFourccS( void )
-{
- vidix_fourcc_t *retval;
- retval=malloc(sizeof(vidix_fourcc_t));
- if(retval) memset(retval,0,sizeof(vidix_fourcc_t));
- return retval;
-}
-
-vidix_yuv_t * vdlAllocYUVS( void )
-{
- vidix_yuv_t *retval;
- retval=malloc(sizeof(vidix_yuv_t));
- if(retval) memset(retval,0,sizeof(vidix_yuv_t));
- return retval;
-}
-
-vidix_rect_t * vdlAllocRectS( void )
-{
- vidix_rect_t *retval;
- retval=malloc(sizeof(vidix_rect_t));
- if(retval) memset(retval,0,sizeof(vidix_rect_t));
- return retval;
-}
-
-vidix_playback_t * vdlAllocPlaybackS( void )
-{
- vidix_playback_t *retval;
- retval=malloc(sizeof(vidix_playback_t));
- if(retval) memset(retval,0,sizeof(vidix_playback_t));
- return retval;
-}
-
-vidix_grkey_t * vdlAllocGrKeyS( void )
-{
- vidix_grkey_t *retval;
- retval=malloc(sizeof(vidix_grkey_t));
- if(retval) memset(retval,0,sizeof(vidix_grkey_t));
- return retval;
-}
-
-vidix_video_eq_t * vdlAllocVideoEqS( void )
-{
- vidix_video_eq_t *retval;
- retval=malloc(sizeof(vidix_video_eq_t));
- if(retval) memset(retval,0,sizeof(vidix_video_eq_t));
- return retval;
-}
-
-vidix_deinterlace_t * vdlAllocDeinterlaceS( void )
-{
- vidix_deinterlace_t *retval;
- retval=malloc(sizeof(vidix_deinterlace_t));
- if(retval) memset(retval,0,sizeof(vidix_deinterlace_t));
- return retval;
-}
-
-vidix_dma_t * vdlAllocDmaS( void )
-{
- vidix_dma_t *retval;
- retval=malloc(sizeof(vidix_dma_t));
- if(retval) memset(retval,0,sizeof(vidix_dma_t));
- return retval;
-}
-
-vidix_oem_fx_t * vdlAllocOemFxS( void )
-{
- vidix_oem_fx_t *retval;
- retval=malloc(sizeof(vidix_oem_fx_t));
- if(retval) memset(retval,0,sizeof(vidix_oem_fx_t));
- return retval;
-}
-
-void vdlFreeCapabilityS(vidix_capability_t * _this) { free(_this); }
-void vdlFreeFourccS( vidix_fourcc_t * _this ) { free(_this); }
-void vdlFreePlaybackS( vidix_playback_t * _this ) { free(_this); }
-void vdlFreeYUVS( vidix_yuv_t * _this) { free(_this); }
-void vdlFreeRectS( vidix_rect_t * _this) { free(_this); }
-void vdlFreeGrKeyS( vidix_grkey_t * _this) { free(_this); }
-void vdlFreeVideoEqS( vidix_video_eq_t * _this) { free(_this); }
-void vdlFreeDeinterlaceS( vidix_deinterlace_t * _this) { free(_this); }
-void vdlFreeDmaS( vidix_dma_t * _this) { free(_this); }
-void vdlFreeOemFxS( vidix_oem_fx_t * _this) { free(_this); }
diff --git a/src/video_out/vidix/vidixlib.h b/src/video_out/vidix/vidixlib.h
deleted file mode 100644
index ebc3dd309..000000000
--- a/src/video_out/vidix/vidixlib.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * vidixlib.h
- * VIDIXLib - Library for VIDeo Interface for *niX
- * This interface is introduced as universal one to MPEG decoder,
- * BES == Back End Scaler and YUV2RGB hw accelerators.
- * In the future it may be expanded up to capturing and audio things.
- * Main goal of this this interface imlpementation is providing DGA
- * everywhere where it's possible (unlike X11 and other).
- * Copyright 2002 Nick Kurshev
- * Licence: GPL
- * This interface is based on v4l2, fbvid.h, mga_vid.h projects
- * and personally my ideas.
- * NOTE: This interface is introduces as APP interface.
- * Don't use it for driver.
- * It provides multistreaming. This mean that APP can handle
- * several streams simultaneously. (Example: Video capturing and video
- * playback or capturing, video playback, audio encoding and so on).
-*/
-#ifndef VIDIXLIB_H
-#define VIDIXLIB_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "vidix.h"
-
-typedef void * VDL_HANDLE;
-
- /* returns library version */
-extern unsigned vdlGetVersion( void );
-
- /* Opens corresponded video driver and returns handle
- of associated stream.
- path - specifies path where drivers are located.
- name - specifies prefered driver name (can be NULL).
- cap - specifies driver capability (TYPE_* constants).
- verbose - specifies verbose level
- returns !0 if ok else NULL.
- */
-extern VDL_HANDLE vdlOpen(const char *path,const char *name,unsigned cap,int verbose);
- /* Closes stream and corresponded driver. */
-extern void vdlClose(VDL_HANDLE stream);
-
- /* Queries driver capabilities. Return 0 if ok else errno */
-extern int vdlGetCapability(VDL_HANDLE, vidix_capability_t *);
-
- /* Queries support for given fourcc. Returns 0 if ok else errno */
-extern int vdlQueryFourcc(VDL_HANDLE,vidix_fourcc_t *);
-
- /* Returns 0 if ok else errno */
-extern int vdlConfigPlayback(VDL_HANDLE, vidix_playback_t *);
-
- /* Returns 0 if ok else errno */
-extern int vdlPlaybackOn(VDL_HANDLE);
-
- /* Returns 0 if ok else errno */
-extern int vdlPlaybackOff(VDL_HANDLE);
-
- /* Returns 0 if ok else errno */
-extern int vdlPlaybackFrameSelect(VDL_HANDLE, unsigned frame_idx );
-
- /* Returns 0 if ok else errno */
-extern int vdlGetGrKeys(VDL_HANDLE, vidix_grkey_t * );
-
- /* Returns 0 if ok else errno */
-extern int vdlSetGrKeys(VDL_HANDLE, const vidix_grkey_t * );
-
- /* Returns 0 if ok else errno */
-extern int vdlPlaybackGetEq(VDL_HANDLE, vidix_video_eq_t * );
-
- /* Returns 0 if ok else errno */
-extern int vdlPlaybackSetEq(VDL_HANDLE, const vidix_video_eq_t * );
-
- /* Returns 0 if ok else errno */
-extern int vdlPlaybackGetDeint(VDL_HANDLE, vidix_deinterlace_t * );
-
- /* Returns 0 if ok else errno */
-extern int vdlPlaybackSetDeint(VDL_HANDLE, const vidix_deinterlace_t * );
-
- /* Returns 0 if ok else errno */
-extern int vdlQueryNumOemEffects(VDL_HANDLE, unsigned * number );
-
- /* Returns 0 if ok else errno */
-extern int vdlGetOemEffect(VDL_HANDLE, vidix_oem_fx_t * );
-
- /* Returns 0 if ok else errno */
-extern int vdlSetOemEffect(VDL_HANDLE, const vidix_oem_fx_t * );
-
-
- /* Returns 0 if ok else errno */
-extern int vdlPlaybackCopyFrame(VDL_HANDLE, vidix_dma_t * );
-
- /* Returns 0 if DMA is available else errno (EBUSY) */
-extern int vdlQueryDMAStatus( VDL_HANDLE );
-
-/*
- ABI related extensions.
- Note: you should use this functions if you are using shared version
- of vidix.
-*/
-extern vidix_capability_t * vdlAllocCapabilityS( void );
-extern vidix_fourcc_t * vdlAllocFourccS( void );
-extern vidix_playback_t * vdlAllocPlaybackS( void );
-extern vidix_yuv_t * vdlAllocYUVS( void );
-extern vidix_rect_t * vdlAllocRectS( void );
-extern vidix_grkey_t * vdlAllocGrKeyS( void );
-extern vidix_video_eq_t * vdlAllocVideoEqS( void );
-extern vidix_deinterlace_t * vdlAllocDeinterlaceS( void );
-extern vidix_dma_t * vdlAllocDmaS( void );
-extern vidix_oem_fx_t * vdlAllocOemFxS( void );
-
-extern void vdlFreeCapabilityS(vidix_capability_t * );
-extern void vdlFreeFourccS( vidix_fourcc_t * );
-extern void vdlFreePlaybackS( vidix_playback_t * );
-extern void vdlFreeYUVS( vidix_yuv_t * );
-extern void vdlFreeRectS( vidix_rect_t * );
-extern void vdlFreeGrKeyS( vidix_grkey_t * );
-extern void vdlFreeVideoEqS( vidix_video_eq_t * );
-extern void vdlFreeDeinterlaceS( vidix_deinterlace_t * );
-extern void vdlFreeDmaS( vidix_dma_t * );
-extern void vdlFreeOemFxS( vidix_oem_fx_t * );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/src/video_out/xvmc_mocomp.c b/src/video_out/xvmc_mocomp.c
index 970c243dd..bf05a79d3 100644
--- a/src/video_out/xvmc_mocomp.c
+++ b/src/video_out/xvmc_mocomp.c
@@ -72,9 +72,9 @@ static void xvmc_render_macro_blocks(vo_frame_t *current_image,
int second_field,
xvmc_macroblocks_t *macroblocks) {
xxmc_driver_t *this = (xxmc_driver_t *) current_image->driver;
- xxmc_frame_t *current_frame = (xxmc_frame_t *) current_image;
- xxmc_frame_t *forward_frame = (xxmc_frame_t *) forward_ref_image;
- xxmc_frame_t *backward_frame = (xxmc_frame_t *) backward_ref_image;
+ xxmc_frame_t *current_frame = XXMC_FRAME(current_image);
+ xxmc_frame_t *forward_frame = XXMC_FRAME(forward_ref_image);
+ xxmc_frame_t *backward_frame = XXMC_FRAME(backward_ref_image);
int flags;
lprintf ("xvmc_render_macro_blocks\n");
diff --git a/src/video_out/xvmc_vld.c b/src/video_out/xvmc_vld.c
index 953b65563..ce1c82742 100644
--- a/src/video_out/xvmc_vld.c
+++ b/src/video_out/xvmc_vld.c
@@ -34,12 +34,12 @@ void xvmc_vld_frame(struct vo_frame_s *this_gen)
{
vo_frame_t *this = (vo_frame_t *) this_gen;
xxmc_frame_t
- *cf = (xxmc_frame_t *) this;
+ *cf = XXMC_FRAME(this);
xine_vld_frame_t
*vft = &(cf->xxmc_data.vld_frame);
xxmc_frame_t
- *ff = (xxmc_frame_t *) vft->forward_reference_frame,
- *bf = (xxmc_frame_t *) vft->backward_reference_frame;
+ *ff = XXMC_FRAME(vft->forward_reference_frame),
+ *bf = XXMC_FRAME(vft->backward_reference_frame);
XvMCMpegControl ctl;
xxmc_driver_t
*driver = (xxmc_driver_t *) cf->vo_frame.driver;
@@ -106,7 +106,7 @@ void xvmc_vld_frame(struct vo_frame_s *this_gen)
void xvmc_vld_slice(vo_frame_t *this_gen)
{
xxmc_frame_t
- *cf = (xxmc_frame_t *) this_gen;
+ *cf = XXMC_FRAME(this_gen);
xxmc_driver_t
*driver = (xxmc_driver_t *) cf->vo_frame.driver;
diff --git a/src/video_out/xxmc.h b/src/video_out/xxmc.h
index a25e651e4..bb6ace157 100644
--- a/src/video_out/xxmc.h
+++ b/src/video_out/xxmc.h
@@ -87,7 +87,6 @@
#include "xine.h"
#include "video_out.h"
#include "xine_internal.h"
-#include "deinterlace.h"
#include "xineutils.h"
#include "vo_scale.h"
#include "x11osd.h"
diff --git a/src/xine-engine/Makefile.am b/src/xine-engine/Makefile.am
index 17dd96b10..36c48a3c9 100644
--- a/src/xine-engine/Makefile.am
+++ b/src/xine-engine/Makefile.am
@@ -1,47 +1,48 @@
include $(top_srcdir)/misc/Makefile.common
include $(top_srcdir)/lib/Makefile.common
-AM_CFLAGS = $(X_CFLAGS) $(FT2_CFLAGS) $(FONTCONFIG_CFLAGS) $(VISIBILITY_FLAG)
-AM_CPPFLAGS = $(ZLIB_CPPFLAGS) -DXINE_LIBRARY_COMPILE
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(X_CFLAGS) $(FT2_CFLAGS) $(FONTCONFIG_CFLAGS) $(VISIBILITY_FLAG)
+AM_CPPFLAGS = $(XDG_BASEDIR_CPPFLAGS) $(ZLIB_CPPFLAGS) -DXINE_LIBRARY_COMPILE
-LIBTOOL = $(SHELL) $(top_builddir)/libtool
-lib_LTLIBRARIES = libxine.la
+XINEUTILS_LIB = $(top_builddir)/src/xine-utils/libxineutils.la
+
+# FIXME: these are currently unused:
+EXTRA_DIST = lrb.c lrb.h accel_xvmc.h
-XINEUTILS_LIB = $(top_builddir)/src/xine-utils/libxineutils.la
-DEF_FILE = libxine-$(XINE_MAJOR).def
if WIN32
+DEF_FILE = libxine-$(XINE_MAJOR).def
def_ldflags="-Wl,--output-def,$(DEF_FILE)"
endif
+noinst_HEADERS = bswap.h ffmpeg_bswap.h
+
+xineinclude_HEADERS = buffer.h metronom.h configfile.h vo_scale.h \
+ audio_out.h resample.h video_out.h xine_internal.h spu_decoder.h \
+ video_overlay.h osd.h spu.h scratch.h xine_plugin.h xineintl.h \
+ plugin_catalog.h audio_decoder.h video_decoder.h post.h \
+ io_helper.h broadcaster.h info_helper.h refcounter.h alphablend.h
+
+lib_LTLIBRARIES = libxine.la
+
libxine_la_SOURCES = xine.c metronom.c configfile.c buffer.c \
load_plugins.c video_decoder.c buffer_types.c \
audio_decoder.c video_out.c audio_out.c resample.c events.c \
- video_overlay.c osd.c scratch.c demux.c vo_scale.c \
+ video_overlay.c osd.c spu.c scratch.c demux.c vo_scale.c \
xine_interface.c post.c tvmode.c broadcaster.c io_helper.c \
input_rip.c input_cache.c info_helper.c refcounter.c \
alphablend.c
-# FIXME: these are currently unused:
-EXTRA_DIST = lrb.c lrb.h accel_xvmc.h
-
-libxine_la_DEPENDENCIES = $(XINEUTILS_LIB) \
+libxine_la_DEPENDENCIES = $(XINEUTILS_LIB) $(XDG_BASEDIR_DEPS) \
$(pthread_dep) $(LIBXINEPOSIX)
libxine_la_LIBADD = $(PTHREAD_LIBS) $(DYNAMIC_LD_LIBS) $(LTLIBINTL) $(ZLIB_LIBS) \
-lm $(XINEUTILS_LIB) $(LTLIBICONV) $(FT2_LIBS) $(FONTCONFIG_LIBS) \
- $(LIBXINEPOSIX) $(RT_LIBS) $(NET_LIBS)
-
-libxine_la_LDFLAGS = \
- -version-info $(XINE_LT_CURRENT):$(XINE_LT_REVISION):$(XINE_LT_AGE) \
- $(def_ldflags)
+ $(LIBXINEPOSIX) $(RT_LIBS) $(NET_LIBS) $(XDG_BASEDIR_LIBS)
+libxine_la_LDFLAGS = $(AM_LDFLAGS) $(def_ldflags) \
+ -version-info $(XINE_LT_CURRENT):$(XINE_LT_REVISION):$(XINE_LT_AGE)
-xineinclude_HEADERS = buffer.h metronom.h configfile.h vo_scale.h \
- audio_out.h resample.h video_out.h xine_internal.h spu_decoder.h \
- video_overlay.h osd.h scratch.h xine_plugin.h xineintl.h \
- plugin_catalog.h audio_decoder.h video_decoder.h post.h \
- io_helper.h broadcaster.h info_helper.h refcounter.h alphablend.h
-
-noinst_HEADERS = bswap.h ffmpeg_bswap.h
+$(XINEUTILS_LIB):
+ $(MAKE) -C $(top_builddir)/src/xine-utils libxineutils.la
if WIN32
install-exec-local:
@@ -50,6 +51,3 @@ install-exec-local:
uninstall-local:
rm -f $(DEF_FILE)
endif
-
-$(XINEUTILS_LIB):
- $(MAKE) -C $(top_builddir)/src/xine-utils libxineutils.la
diff --git a/src/xine-engine/accel_xvmc.h b/src/xine-engine/accel_xvmc.h
index 46cbfba22..d60246c3e 100644
--- a/src/xine-engine/accel_xvmc.h
+++ b/src/xine-engine/accel_xvmc.h
@@ -67,6 +67,7 @@ typedef struct xine_vld_frame_s {
typedef struct xine_xvmc_s {
+ vo_frame_t *vo_frame;
xine_macroblocks_t *macroblocks;
void (*proc_macro_block)(int x,int y,int mb_type,
int motion_type,int (*mv_field_sel)[2],
@@ -76,6 +77,9 @@ typedef struct xine_xvmc_s {
int second_field,int (*f_mot_pmv)[2],int (*b_mot_pmv)[2]);
} xine_xvmc_t ;
+#define XVMC_DATA(frame_gen) ((frame_gen) ? (xine_xvmc_t *)(frame_gen)->accel_data : (xine_xvmc_t *)0)
+#define XVMC_FRAME(frame_gen) ((frame_gen) ? (xvmc_frame_t *)XVMC_DATA(frame_gen)->vo_frame : (xvmc_frame_t *)0)
+
typedef struct xine_xxmc_s {
/*
@@ -110,6 +114,9 @@ typedef struct xine_xxmc_s {
void (*proc_xxmc_unlock) (vo_driver_t *this_gen);
} xine_xxmc_t;
+#define XXMC_DATA(frame_gen) ((frame_gen) ? (xine_xxmc_t *)(frame_gen)->accel_data : (xine_xxmc_t *)0)
+#define XXMC_FRAME(frame_gen) ((frame_gen) ? (xxmc_frame_t *)XXMC_DATA(frame_gen)->xvmc.vo_frame : (xxmc_frame_t *)0)
+
/*
* Register XvMC stream types here.
*/
diff --git a/src/xine-engine/alphablend.c b/src/xine-engine/alphablend.c
index 25c223272..57f8213cb 100644
--- a/src/xine-engine/alphablend.c
+++ b/src/xine-engine/alphablend.c
@@ -1104,7 +1104,7 @@ static void blend_yuv_exact(uint8_t *dst_cr, uint8_t *dst_cb, int src_width,
static uint8_t *(*blend_yuv_grow_extra_data(alphablend_t *extra_data, int osd_width))[ 3 ][ 2 ]
{
- struct __attribute__((packed)) header_s {
+ struct XINE_PACKED header_s {
int id;
int max_width;
uint8_t *data[ 3 ][ 2 ];
@@ -1546,7 +1546,7 @@ static void blend_yuy2_exact(uint8_t *dst_cr, uint8_t *dst_cb, int src_width,
static uint8_t *(*blend_yuy2_grow_extra_data(alphablend_t *extra_data, int osd_width))[ 3 ]
{
- struct __attribute__((packed)) header_s {
+ struct XINE_PACKED header_s {
int id;
int max_width;
uint8_t *data[ 3 ];
diff --git a/src/xine-engine/alphablend.h b/src/xine-engine/alphablend.h
index 513ac116f..4fc879b2c 100644
--- a/src/xine-engine/alphablend.h
+++ b/src/xine-engine/alphablend.h
@@ -39,37 +39,14 @@ typedef struct {
void _x_alphablend_init(alphablend_t *extra_data, xine_t *xine) XINE_PROTECTED;
void _x_alphablend_free(alphablend_t *extra_data) XINE_PROTECTED;
-/* _MSC_VER port changes */
-#undef ATTRIBUTE_PACKED
-#undef PRAGMA_PACK_BEGIN
-#undef PRAGMA_PACK_END
-
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) || defined(__ICC)
-#define ATTRIBUTE_PACKED __attribute__ ((packed))
-#define PRAGMA_PACK 0
-#endif
-
-#if !defined(ATTRIBUTE_PACKED)
-#define ATTRIBUTE_PACKED
-#define PRAGMA_PACK 1
-#endif
-
-#if PRAGMA_PACK
-#pragma pack(8)
-#endif
-
typedef struct { /* CLUT == Color LookUp Table */
uint8_t cb;
uint8_t cr;
uint8_t y;
uint8_t foo;
-} ATTRIBUTE_PACKED clut_t;
+} XINE_PACKED clut_t;
-#if PRAGMA_PACK
-#pragma pack()
-#endif
-
#define XX44_PALETTE_SIZE 32
typedef struct {
diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c
index fb2f495d5..3c7533138 100644
--- a/src/xine-engine/audio_out.c
+++ b/src/xine-engine/audio_out.c
@@ -16,16 +16,18 @@
* You should have received a copy of the GNU General Public License
* along with self program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+/**
+ * @file
+ * @brief xine-lib audio output implementation
+ *
+ * @date 2001-08-20 First implementation of Audio sync and Audio driver separation.
+ * (c) 2001 James Courtier-Dutton <james@superbug.demon.co.uk>
+ * @date 2001-08-22 James imported some useful AC3 sections from the previous
+ * ALSA driver. (c) 2001 Andy Lo A Foe <andy@alsaplayer.org>
*
- * $Id: audio_out.c,v 1.210 2007/04/01 00:52:36 dgp85 Exp $
*
- * 22-8-2001 James imported some useful AC3 sections from the previous alsa driver.
- * (c) 2001 Andy Lo A Foe <andy@alsaplayer.org>
- * 20-8-2001 First implementation of Audio sync and Audio driver separation.
- * (c) 2001 James Courtier-Dutton James@superbug.demon.co.uk
- */
-
-/*
* General Programming Guidelines: -
* New concept of an "audio_frame".
* An audio_frame consists of all the samples required to fill every
@@ -577,18 +579,16 @@ static void audio_filter_compress (aos_t *this, int16_t *mem, int num_frames) {
}
static void audio_filter_amp (aos_t *this, void *buf, int num_frames) {
-
- int i;
- int num_channels;
double amp_factor;
-
- num_channels = _x_ao_mode2channels (this->input.mode);
- if (!num_channels)
+ int i;
+ const int total_frames = num_frames * _x_ao_mode2channels (this->input.mode);
+
+ if (!total_frames)
return;
amp_factor=this->amp_factor;
if (this->amp_mute || amp_factor == 0) {
- memset (buf, 0, num_frames * num_channels * (this->input.bits / 8));
+ memset (buf, 0, total_frames * (this->input.bits / 8));
return;
}
@@ -596,7 +596,7 @@ static void audio_filter_amp (aos_t *this, void *buf, int num_frames) {
int16_t test;
int8_t *mem = (int8_t *) buf;
- for (i=0; i<num_frames*num_channels; i++) {
+ for (i=0; i<total_frames; i++) {
test = mem[i] * amp_factor;
/* Force limit on amp_factor to prevent clipping */
if (test < INT8_MIN) {
@@ -613,7 +613,7 @@ static void audio_filter_amp (aos_t *this, void *buf, int num_frames) {
int32_t test;
int16_t *mem = (int16_t *) buf;
- for (i=0; i<num_frames*num_channels; i++) {
+ for (i=0; i<total_frames; i++) {
test = mem[i] * amp_factor;
/* Force limit on amp_factor to prevent clipping */
if (test < INT16_MIN) {
diff --git a/src/xine-engine/audio_out.h b/src/xine-engine/audio_out.h
index c5f335dbb..f4e01ad25 100644
--- a/src/xine-engine/audio_out.h
+++ b/src/xine-engine/audio_out.h
@@ -257,11 +257,12 @@ struct audio_driver_class_s {
void (*dispose) (audio_driver_class_t *);
};
-/*
- * this initiates the audio_out sync routines
- * found in ./src/xine-engine/audio_out.c
+/**
+ * @brief Initialise the audio_out sync routines
+ *
+ * @internal
*/
-xine_audio_port_t *_x_ao_new_port (xine_t *xine, ao_driver_t *driver, int grab_only) XINE_PROTECTED;
+xine_audio_port_t *_x_ao_new_port (xine_t *xine, ao_driver_t *driver, int grab_only);
/*
* audio output modes + capabilities
diff --git a/src/xine-engine/buffer.h b/src/xine-engine/buffer.h
index 706a1765e..9c5dbb2a5 100644
--- a/src/xine-engine/buffer.h
+++ b/src/xine-engine/buffer.h
@@ -56,8 +56,8 @@ extern "C" {
#define BUF_MAX_CALLBACKS 5
-/*
- * buffer types
+/**
+ * @defgroup buffer_types Buffer Types
*
* a buffer type ID describes the contents of a buffer
* it consists of three fields:
@@ -68,17 +68,20 @@ extern "C" {
* DD : decoder selection (e.g. MPEG, OPENDIVX ... for VIDEO)
* CCCC : channel number or other subtype information for the decoder
*/
+/*@{*/
#define BUF_MAJOR_MASK 0xFF000000
#define BUF_DECODER_MASK 0x00FF0000
-/* control buffer types */
-
+/**
+ * @defgroup buffer_ctrl Control buffer types
+ */
+/*@{*/
#define BUF_CONTROL_BASE 0x01000000
#define BUF_CONTROL_START 0x01000000
#define BUF_CONTROL_END 0x01010000
#define BUF_CONTROL_QUIT 0x01020000
-#define BUF_CONTROL_DISCONTINUITY 0x01030000 /* former AVSYNC_RESET */
+#define BUF_CONTROL_DISCONTINUITY 0x01030000 /**< former AVSYNC_RESET */
#define BUF_CONTROL_NOP 0x01040000
#define BUF_CONTROL_AUDIO_CHANNEL 0x01050000
#define BUF_CONTROL_SPU_CHANNEL 0x01060000
@@ -87,11 +90,15 @@ extern "C" {
#define BUF_CONTROL_HEADERS_DONE 0x01090000
#define BUF_CONTROL_FLUSH_DECODER 0x010a0000
#define BUF_CONTROL_RESET_TRACK_MAP 0x010b0000
+/*@}*/
-/* video buffer types: (please keep in sync with buffer_types.c) */
-
+/**
+ * @defgroup buffer_video Video buffer types
+ * @note (please keep in sync with buffer_types.c)
+ */
+/*@{*/
#define BUF_VIDEO_BASE 0x02000000
-#define BUF_VIDEO_UNKNOWN 0x02ff0000 /* no decoder should handle this one */
+#define BUF_VIDEO_UNKNOWN 0x02ff0000 /**< no decoder should handle this one */
#define BUF_VIDEO_MPEG 0x02000000
#define BUF_VIDEO_MPEG4 0x02010000
#define BUF_VIDEO_CINEPAK 0x02020000
@@ -150,7 +157,7 @@ extern "C" {
#define BUF_VIDEO_INTERPLAY 0x02380000
#define BUF_VIDEO_RV40 0x02390000
#define BUF_VIDEO_PSX_MDEC 0x023A0000
-#define BUF_VIDEO_YUV_FRAMES 0x023B0000 /* uncompressed YUV, delivered by v4l input plugin */
+#define BUF_VIDEO_YUV_FRAMES 0x023B0000 /**< uncompressed YUV, delivered by v4l input plugin */
#define BUF_VIDEO_HUFFYUV 0x023C0000
#define BUF_VIDEO_IMAGE 0x023D0000
#define BUF_VIDEO_THEORA 0x023E0000
@@ -165,8 +172,8 @@ extern "C" {
#define BUF_VIDEO_8BPS 0x02470000
#define BUF_VIDEO_ASV1 0x02480000
#define BUF_VIDEO_ASV2 0x02490000
-#define BUF_VIDEO_BITPLANE 0x024A0000 /* Amiga typical picture and animation format */
-#define BUF_VIDEO_BITPLANE_BR1 0x024B0000 /* the same with Bytrun compression 1 */
+#define BUF_VIDEO_BITPLANE 0x024A0000 /**< Amiga typical picture and animation format */
+#define BUF_VIDEO_BITPLANE_BR1 0x024B0000 /**< the same with Bytrun compression 1 */
#define BUF_VIDEO_FLV1 0x024C0000
#define BUF_VIDEO_H264 0x024D0000
#define BUF_VIDEO_MJPEG_B 0x024E0000
@@ -192,11 +199,15 @@ extern "C" {
#define BUF_VIDEO_CAVS 0x02620000
#define BUF_VIDEO_VP6F 0x02630000
#define BUF_VIDEO_THEORA_RAW 0x02640000
+/*@}*/
-/* audio buffer types: (please keep in sync with buffer_types.c) */
-
+/**
+ * @defgroup buffer_audio Audio buffer types
+ * @note (please keep in sync with buffer_types.c)
+ */
+/*@{*/
#define BUF_AUDIO_BASE 0x03000000
-#define BUF_AUDIO_UNKNOWN 0x03ff0000 /* no decoder should handle this one */
+#define BUF_AUDIO_UNKNOWN 0x03ff0000 /**< no decoder should handle this one */
#define BUF_AUDIO_A52 0x03000000
#define BUF_AUDIO_MPEG 0x03010000
#define BUF_AUDIO_LPCM_BE 0x03020000
@@ -259,9 +270,12 @@ extern "C" {
#define BUF_AUDIO_SMACKER 0x033B0000
#define BUF_AUDIO_FLVADPCM 0x033C0000
#define BUF_AUDIO_WAVPACK 0x033D0000
+/*@}*/
-/* spu buffer types: */
-
+/**
+ * @defgroup buffer_spu SPU buffer types
+ */
+/*@{*/
#define BUF_SPU_BASE 0x04000000
#define BUF_SPU_DVD 0x04000000
#define BUF_SPU_TEXT 0x04010000
@@ -271,33 +285,41 @@ extern "C" {
#define BUF_SPU_CVD 0x04050000
#define BUF_SPU_OGM 0x04060000
#define BUF_SPU_CMML 0x04070000
+/*@}*/
-/* demuxer block types: */
-
+/**
+ * @defgroup buffer_demux Demuxer block types
+ */
+/*@{*/
#define BUF_DEMUX_BLOCK 0x05000000
+/*@}*/
+
+/*@}*/
typedef struct extra_info_s extra_info_t;
-/*
- * extra_info_t is used to pass information from input or demuxer plugins
- * to output frames (past decoder). new data must be added after the existing
- * fields for backward compatibility.
+/**
+ * @brief Structure to pass information from input or demuxer plugins
+ * to output frames (past decoder).
+ *
+ * New data must be added after the existing fields to not break ABI
+ * (backward compatibility).
*/
struct extra_info_s {
- int input_normpos; /* remember where this buf came from in
- * the input source (0..65535). can be
- * either time or offset based. */
- int input_time; /* time offset in miliseconds from
- * beginning of stream */
- uint32_t frame_number; /* number of current frame if known */
+ int input_normpos; /**< remember where this buf came from in
+ * the input source (0..65535). can be
+ * either time or offset based. */
+ int input_time; /**< time offset in miliseconds from
+ * beginning of stream */
+ uint32_t frame_number; /**< number of current frame if known */
- int seek_count; /* internal engine use */
- int64_t vpts; /* set on output layers only */
+ int seek_count; /**< internal engine use */
+ int64_t vpts; /**< set on output layers only */
- int invalid; /* do not use this extra info to update anything */
- int total_time; /* duration in miliseconds of the stream */
+ int invalid; /**< do not use this extra info to update anything */
+ int total_time; /**< duration in miliseconds of the stream */
};
@@ -308,74 +330,75 @@ struct buf_element_s {
buf_element_t *next;
unsigned char *mem;
- unsigned char *content; /* start of raw content in mem (without header etc) */
+ unsigned char *content; /**< start of raw content in mem (without header etc) */
- int32_t size ; /* size of _content_ */
- int32_t max_size; /* size of pre-allocated memory pointed to by "mem" */
- uint32_t type;
- int64_t pts; /* presentation time stamp, used for a/v sync */
- int64_t disc_off; /* discontinuity offset */
+ int32_t size ; /**< size of _content_ */
+ int32_t max_size; /**< size of pre-allocated memory pointed to by "mem" */
+ int64_t pts; /**< presentation time stamp, used for a/v sync */
+ int64_t disc_off; /**< discontinuity offset */
- extra_info_t *extra_info; /* extra info will be passed to frames */
+ extra_info_t *extra_info; /**< extra info will be passed to frames */
- uint32_t decoder_flags; /* stuff like keyframe, is_header ... see below */
+ uint32_t decoder_flags; /**< stuff like keyframe, is_header ... see below */
- /* additional decoder flags and other dec-spec. stuff */
+ /** additional decoder flags and other dec-spec. stuff */
uint32_t decoder_info[BUF_NUM_DEC_INFO];
- /* pointers to dec-spec. stuff */
+ /** pointers to dec-spec. stuff */
void *decoder_info_ptr[BUF_NUM_DEC_INFO];
void (*free_buffer) (buf_element_t *buf);
- void *source; /* pointer to source of this buffer for */
- /* free_buffer */
+ void *source; /**< pointer to source of this buffer for
+ * free_buffer */
+ uint32_t type;
} ;
-/* keyframe should be set whenever possible (that is, when demuxer
+/** keyframe should be set whenever possible (that is, when demuxer
* knows about frames and keyframes). */
#define BUF_FLAG_KEYFRAME 0x0001
-/* frame start/end. BUF_FLAG_FRAME_END is sent on last buf of a frame */
+/** frame start/end. BUF_FLAG_FRAME_END is sent on last buf of a frame */
#define BUF_FLAG_FRAME_START 0x0002
#define BUF_FLAG_FRAME_END 0x0004
-/* any out-of-band data needed to initialize decoder must have
+/** any out-of-band data needed to initialize decoder must have
* this flag set. */
#define BUF_FLAG_HEADER 0x0008
-/* preview buffers are normal data buffers that must not produce any
+/** preview buffers are normal data buffers that must not produce any
* output in decoders (may be used to sneak details about the stream
* to come). */
#define BUF_FLAG_PREVIEW 0x0010
-/* set when user stop the playback */
+/** set when user stop the playback */
#define BUF_FLAG_END_USER 0x0020
-/* set when stream finished naturaly */
+/** set when stream finished naturaly */
#define BUF_FLAG_END_STREAM 0x0040
-/* decoder_info[0] carries the frame step (1/90000). */
+/** decoder_info[0] carries the frame step (1/90000). */
#define BUF_FLAG_FRAMERATE 0x0080
-/* hint to metronom that seeking has occurred */
+/** hint to metronom that seeking has occurred */
#define BUF_FLAG_SEEK 0x0100
-/* special information inside, see below. */
+/** special information inside, see below. */
#define BUF_FLAG_SPECIAL 0x0200
-/* header use standard xine_bmiheader or xine_waveformatex structs.
+/** header use standard xine_bmiheader or xine_waveformatex structs.
* xine_waveformatex is actually optional since the most important
* information for audio init is available from decoder_info[].
* note: BUF_FLAG_HEADER must also be set. */
#define BUF_FLAG_STDHEADER 0x0400
-/* decoder_info[1] carries numerator for display aspect ratio
+/** decoder_info[1] carries numerator for display aspect ratio
* decoder_info[2] carries denominator for display aspect ratio */
#define BUF_FLAG_ASPECT 0x0800
-/* Special buffer types:
+/**
+ * \defgroup buffer_special Special buffer types:
* Sometimes there is a need to relay special information from a demuxer
* to a video decoder. For example, some file types store palette data in
* the file header independant of the video data. The special buffer type
@@ -394,10 +417,9 @@ struct buf_element_s {
* buffer will fall through to the case where the buffer's data content
* is accumulated and no harm will be done.
*/
+/*@{*/
-/* these are the types of special buffers */
-
-/*
+/**
* In a BUF_SPECIAL_PALETTE buffer:
* decoder_info[1] = BUF_SPECIAL_PALETTE
* decoder_info[2] = number of entries in palette table
@@ -415,7 +437,7 @@ struct buf_element_s {
/* special buffer type 2 used to be defined but is now available for use */
-/*
+/**
* In a BUF_SPECIAL_ASPECT buffer:
* decoder_info[1] = BUF_SPECIAL_ASPECT
* decoder_info[2] = MPEG2 aspect ratio code
@@ -428,7 +450,7 @@ struct buf_element_s {
*/
#define BUF_SPECIAL_ASPECT 3
-/*
+/**
* In a BUF_SPECIAL_DECODER_CONFIG buffer:
* decoder_info[1] = BUF_SPECIAL_DECODER_CONFIG
* decoder_info[2] = data size
@@ -438,7 +460,7 @@ struct buf_element_s {
*/
#define BUF_SPECIAL_DECODER_CONFIG 4
-/*
+/**
* In a BUF_SPECIAL_STSD_ATOM buffer:
* decoder_info[1] = BUF_SPECIAL_STSD_ATOM
* decoder_info[2] = size of the ImageDescription atom, minus the
@@ -452,7 +474,7 @@ struct buf_element_s {
*/
#define BUF_SPECIAL_STSD_ATOM 5
-/*
+/**
* In a BUF_SPECIAL_LPCM_CONFIG buffer:
* decoder_info[1] = BUF_SPECIAL_LPCM_CONFIG
* decoder_info[2] = config data
@@ -462,7 +484,7 @@ struct buf_element_s {
*/
#define BUF_SPECIAL_LPCM_CONFIG 6
-/*
+/**
* In a BUF_SPECIAL_CHARSET_ENCODING buffer:
* decoder_info[1] = BUF_SPECIAL_CHARSET_ENCODING
* decoder_info[2] = size of charset encoding string
@@ -474,7 +496,7 @@ struct buf_element_s {
#define BUF_SPECIAL_CHARSET_ENCODING 7
-/*
+/**
* In a BUF_SPECIAL_SPU_DVD_SUBTYPE:
* decoder_info[1] = BUF_SPECIAL_SPU_DVD_SUBTYPE
* decoder_info[2] = subtype
@@ -489,7 +511,8 @@ struct buf_element_s {
#define SPU_DVD_SUBTYPE_VOBSUB_PACKAGE 3
#define SPU_DVD_SUBTYPE_NAV 4
-/* In a BUF_SPECIAL_SPU_DVB_DESCRIPTOR
+/**
+ * In a BUF_SPECIAL_SPU_DVB_DESCRIPTOR
* decoder_info[1] = BUF_SPECIAL_SPU_DVB_DESCRIPTOR
* decoder_info[2] = size of spu_dvb_descriptor_t
* decoder_info_ptr[2] = pointer to spu_dvb_descriptor_t, or NULL
@@ -501,7 +524,7 @@ struct buf_element_s {
**/
#define BUF_SPECIAL_SPU_DVB_DESCRIPTOR 9
-/*
+/**
* In a BUF_SPECIAL_RV_CHUNK_TABLE:
* decoder_info[1] = BUF_SPECIAL_RV_CHUNK_TABLE
* decoder_info[2] = number of entries in chunk table
@@ -510,6 +533,7 @@ struct buf_element_s {
* This buffer transports the chunk table associated to each RealVideo frame.
*/
#define BUF_SPECIAL_RV_CHUNK_TABLE 10
+/*@}*/
typedef struct spu_dvb_descriptor_s spu_dvb_descriptor_t;
struct spu_dvb_descriptor_s
@@ -601,42 +625,61 @@ struct fifo_buffer_s
void *get_cb_data[BUF_MAX_CALLBACKS];
} ;
-/*
- * allocate and initialize new (empty) fifo buffer,
- * init buffer pool for it:
- * allocate num_buffers of buf_size bytes each
+/**
+ * @brief Allocate and initialise new (empty) FIFO buffers.
+ * @param num_buffer Number of buffers to allocate.
+ * @param buf_size Size of each buffer.
+ * @internal Only used by video and audio decoder loops.
*/
+fifo_buffer_t *_x_fifo_buffer_new (int num_buffers, uint32_t buf_size);
-fifo_buffer_t *_x_fifo_buffer_new (int num_buffers, uint32_t buf_size) XINE_PROTECTED;
-fifo_buffer_t *_x_dummy_fifo_buffer_new (int num_buffers, uint32_t buf_size) XINE_PROTECTED;
+/**
+ * @brief Allocate and initialise new dummy FIFO buffers.
+ * @param num_buffer Number of dummy buffers to allocate.
+ * @param buf_size Size of each buffer.
+ * @internal Only used by video and audio decoder loops.
+ */
+fifo_buffer_t *_x_dummy_fifo_buffer_new (int num_buffers, uint32_t buf_size);
-/* return BUF_VIDEO_xxx given the fourcc
- * fourcc_int must be read in machine endianness
+/**
+ * @brief Returns the \ref buffer_video "BUF_VIDEO_xxx" for the given fourcc.
+ * @param fourcc_int 32-bit FOURCC value in machine endianness
+ * @sa _x_formattag_to_buf_audio
+ *
* example: fourcc_int = *(uint32_t *)fourcc_char;
*/
uint32_t _x_fourcc_to_buf_video( uint32_t fourcc_int ) XINE_PROTECTED;
-/* return codec name given BUF_VIDEO_xxx */
-char * _x_buf_video_name( uint32_t buf_type ) XINE_PROTECTED;
+/**
+ * @brief Returns video codec name given the buffer type.
+ * @param buf_type One of the \ref buffer_video "BUF_VIDEO_xxx" values.
+ * @sa _x_buf_audio_name
+ */
+const char *_x_buf_video_name( uint32_t buf_type ) XINE_PROTECTED;
-/* return BUF_AUDIO_xxx given the formattag */
+/**
+ * @brief Returns the \ref buffer_audio "BUF_AUDIO_xxx" for the given formattag.
+ * @param formattagg 32-bit format tag value in machine endianness
+ * @sa _x_fourcc_to_buf_video
+ */
uint32_t _x_formattag_to_buf_audio( uint32_t formattag ) XINE_PROTECTED;
-/* return codec name given BUF_AUDIO_xxx */
-char * _x_buf_audio_name( uint32_t buf_type ) XINE_PROTECTED;
+/**
+ * @brief Returns audio codec name given the buffer type.
+ * @param buf_type One of the \ref buffer_audio "BUF_AUDIO_xxx" values.
+ * @sa _x_buf_video_name
+ */
+const char *_x_buf_audio_name( uint32_t buf_type ) XINE_PROTECTED;
-#ifndef ATTRIBUTE_PACKED
-/* no attribute packed? let's try with pragma pack as a last resort */
-#pragma pack(2)
-#endif
-/* this is xine version of BITMAPINFOHEADER
- * - should be safe to compile on 64bits machines
- * - will always use machine endian format, so demuxers reading
- * stuff from win32 formats must use the function below.
+/**
+ * @brief xine version of BITMAPINFOHEADER.
+ * @note Should be safe to compile on 64bits machines.
+ * @note Will always use machine endian format, so demuxers reading
+ * stuff from win32 formats must use the function below.
*/
-typedef struct __attribute__((__packed__)) {
+typedef struct XINE_PACKED {
int32_t biSize;
int32_t biWidth;
int32_t biHeight;
@@ -650,10 +693,11 @@ typedef struct __attribute__((__packed__)) {
int32_t biClrImportant;
} xine_bmiheader;
-/* this is xine version of WAVEFORMATEX
- * (the same comments from xine_bmiheader)
+/**
+ * @brief xine version of WAVEFORMATEX.
+ * @note The same comments from xine_bmiheader applies.
*/
-typedef struct __attribute__((__packed__)) {
+typedef struct XINE_PACKED {
int16_t wFormatTag;
int16_t nChannels;
int32_t nSamplesPerSec;
@@ -662,14 +706,11 @@ typedef struct __attribute__((__packed__)) {
int16_t wBitsPerSample;
int16_t cbSize;
} xine_waveformatex;
-#ifndef ATTRIBUTE_PACKED
-#pragma pack()
-#endif
-/* convert xine_bmiheader struct from little endian */
+/** Convert xine_bmiheader struct from little endian */
void _x_bmiheader_le2me( xine_bmiheader *bih ) XINE_PROTECTED;
-/* convert xine_waveformatex struct from little endian */
+/** Convert xine_waveformatex struct from little endian */
void _x_waveformatex_le2me( xine_waveformatex *wavex ) XINE_PROTECTED;
#ifdef __cplusplus
diff --git a/src/xine-engine/buffer_types.c b/src/xine-engine/buffer_types.c
index a15cb69d8..0421fecc8 100644
--- a/src/xine-engine/buffer_types.c
+++ b/src/xine-engine/buffer_types.c
@@ -38,14 +38,6 @@
#include "buffer.h"
#include "bswap.h"
-/* FOURCC will be manipulated using machine endian */
-#ifdef WORDS_BIGENDIAN
-#define meFOURCC BE_FOURCC
-#else
-#define meFOURCC LE_FOURCC
-#endif
-
-
typedef struct video_db_s {
uint32_t fourcc[20];
uint32_t buf_type;
@@ -62,12 +54,12 @@ typedef struct audio_db_s {
static const video_db_t video_db[] = {
{
{
- meFOURCC('m', 'p', 'e', 'g'),
- meFOURCC('M', 'P', 'E', 'G'),
- meFOURCC('P', 'I', 'M', '1'),
- meFOURCC('m', 'p', 'g', '2'),
- meFOURCC('m', 'p', 'g', '1'),
- meFOURCC(0x02, 0, 0, 0x10),
+ ME_FOURCC('m', 'p', 'e', 'g'),
+ ME_FOURCC('M', 'P', 'E', 'G'),
+ ME_FOURCC('P', 'I', 'M', '1'),
+ ME_FOURCC('m', 'p', 'g', '2'),
+ ME_FOURCC('m', 'p', 'g', '1'),
+ ME_FOURCC(0x02, 0, 0, 0x10),
0
},
BUF_VIDEO_MPEG,
@@ -75,15 +67,15 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('D', 'I', 'V', 'X'),
- meFOURCC('d', 'i', 'v', 'x'),
- meFOURCC('D', 'i', 'v', 'x'),
- meFOURCC('D', 'i', 'v', 'X'),
- meFOURCC('M', 'P', '4', 'S'),
- meFOURCC('m', 'p', '4', 'v'),
- meFOURCC('M', '4', 'S', '2'),
- meFOURCC('m', '4', 's', '2'),
- meFOURCC('F', 'M', 'P', '4'),
+ ME_FOURCC('D', 'I', 'V', 'X'),
+ ME_FOURCC('d', 'i', 'v', 'x'),
+ ME_FOURCC('D', 'i', 'v', 'x'),
+ ME_FOURCC('D', 'i', 'v', 'X'),
+ ME_FOURCC('M', 'P', '4', 'S'),
+ ME_FOURCC('m', 'p', '4', 'v'),
+ ME_FOURCC('M', '4', 'S', '2'),
+ ME_FOURCC('m', '4', 's', '2'),
+ ME_FOURCC('F', 'M', 'P', '4'),
0
},
BUF_VIDEO_MPEG4,
@@ -91,8 +83,8 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('X', 'V', 'I', 'D'),
- meFOURCC('x', 'v', 'i', 'd'),
+ ME_FOURCC('X', 'V', 'I', 'D'),
+ ME_FOURCC('x', 'v', 'i', 'd'),
0
},
BUF_VIDEO_XVID,
@@ -100,7 +92,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('D', 'X', '5', '0'),
+ ME_FOURCC('D', 'X', '5', '0'),
0
},
BUF_VIDEO_DIVX5,
@@ -108,7 +100,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('c', 'v', 'i', 'd'),
+ ME_FOURCC('c', 'v', 'i', 'd'),
0
},
BUF_VIDEO_CINEPAK,
@@ -116,9 +108,9 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('S', 'V', 'Q', '1'),
- meFOURCC('s', 'v', 'q', '1'),
- meFOURCC('s', 'v', 'q', 'i'),
+ ME_FOURCC('S', 'V', 'Q', '1'),
+ ME_FOURCC('s', 'v', 'q', '1'),
+ ME_FOURCC('s', 'v', 'q', 'i'),
0
},
BUF_VIDEO_SORENSON_V1,
@@ -126,8 +118,8 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('S', 'V', 'Q', '3'),
- meFOURCC('s', 'v', 'q', '3'),
+ ME_FOURCC('S', 'V', 'Q', '3'),
+ ME_FOURCC('s', 'v', 'q', '3'),
0
},
BUF_VIDEO_SORENSON_V3,
@@ -135,10 +127,10 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('M', 'P', '4', '1'),
- meFOURCC('m', 'p', '4', '1'),
- meFOURCC('M', 'P', 'G', '4'),
- meFOURCC('m', 'p', 'g', '4'),
+ ME_FOURCC('M', 'P', '4', '1'),
+ ME_FOURCC('m', 'p', '4', '1'),
+ ME_FOURCC('M', 'P', 'G', '4'),
+ ME_FOURCC('m', 'p', 'g', '4'),
0
},
BUF_VIDEO_MSMPEG4_V1,
@@ -146,12 +138,12 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('M', 'P', '4', '1'),
- meFOURCC('m', 'p', '4', '1'),
- meFOURCC('M', 'P', '4', '2'),
- meFOURCC('m', 'p', '4', '2'),
- meFOURCC('D', 'I', 'V', '2'),
- meFOURCC('d', 'i', 'v', '2'),
+ ME_FOURCC('M', 'P', '4', '1'),
+ ME_FOURCC('m', 'p', '4', '1'),
+ ME_FOURCC('M', 'P', '4', '2'),
+ ME_FOURCC('m', 'p', '4', '2'),
+ ME_FOURCC('D', 'I', 'V', '2'),
+ ME_FOURCC('d', 'i', 'v', '2'),
0
},
BUF_VIDEO_MSMPEG4_V2,
@@ -159,20 +151,20 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('M', 'P', '4', '3'),
- meFOURCC('m', 'p', '4', '3'),
- meFOURCC('D', 'I', 'V', '3'),
- meFOURCC('d', 'i', 'v', '3'),
- meFOURCC('D', 'I', 'V', '4'),
- meFOURCC('d', 'i', 'v', '4'),
- meFOURCC('D', 'I', 'V', '5'),
- meFOURCC('d', 'i', 'v', '5'),
- meFOURCC('D', 'I', 'V', '6'),
- meFOURCC('d', 'i', 'v', '6'),
- meFOURCC('A', 'P', '4', '1'),
- meFOURCC('M', 'P', 'G', '3'),
- meFOURCC('C', 'O', 'L', '1'),
- meFOURCC('3', 'I', 'V', 'D'),
+ ME_FOURCC('M', 'P', '4', '3'),
+ ME_FOURCC('m', 'p', '4', '3'),
+ ME_FOURCC('D', 'I', 'V', '3'),
+ ME_FOURCC('d', 'i', 'v', '3'),
+ ME_FOURCC('D', 'I', 'V', '4'),
+ ME_FOURCC('d', 'i', 'v', '4'),
+ ME_FOURCC('D', 'I', 'V', '5'),
+ ME_FOURCC('d', 'i', 'v', '5'),
+ ME_FOURCC('D', 'I', 'V', '6'),
+ ME_FOURCC('d', 'i', 'v', '6'),
+ ME_FOURCC('A', 'P', '4', '1'),
+ ME_FOURCC('M', 'P', 'G', '3'),
+ ME_FOURCC('C', 'O', 'L', '1'),
+ ME_FOURCC('3', 'I', 'V', 'D'),
0
},
BUF_VIDEO_MSMPEG4_V3,
@@ -180,8 +172,8 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('3', 'I', 'V', '1'),
- meFOURCC('3', 'I', 'V', '2'),
+ ME_FOURCC('3', 'I', 'V', '1'),
+ ME_FOURCC('3', 'I', 'V', '2'),
0
},
BUF_VIDEO_3IVX,
@@ -189,11 +181,11 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('d', 'm', 'b', '1'),
- meFOURCC('M', 'J', 'P', 'G'),
- meFOURCC('m', 'j', 'p', 'a'),
- meFOURCC('A', 'V', 'R', 'n'),
- meFOURCC('A', 'V', 'D', 'J'),
+ ME_FOURCC('d', 'm', 'b', '1'),
+ ME_FOURCC('M', 'J', 'P', 'G'),
+ ME_FOURCC('m', 'j', 'p', 'a'),
+ ME_FOURCC('A', 'V', 'R', 'n'),
+ ME_FOURCC('A', 'V', 'D', 'J'),
0
},
BUF_VIDEO_MJPEG,
@@ -201,7 +193,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('m', 'j', 'p', 'b'),
+ ME_FOURCC('m', 'j', 'p', 'b'),
0
},
BUF_VIDEO_MJPEG_B,
@@ -209,8 +201,8 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('I', 'V', '5', '0'),
- meFOURCC('i', 'v', '5', '0'),
+ ME_FOURCC('I', 'V', '5', '0'),
+ ME_FOURCC('i', 'v', '5', '0'),
0
},
BUF_VIDEO_IV50,
@@ -218,8 +210,8 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('I', 'V', '4', '1'),
- meFOURCC('i', 'v', '4', '1'),
+ ME_FOURCC('I', 'V', '4', '1'),
+ ME_FOURCC('i', 'v', '4', '1'),
0
},
BUF_VIDEO_IV41,
@@ -227,8 +219,8 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('I', 'V', '3', '2'),
- meFOURCC('i', 'v', '3', '2'),
+ ME_FOURCC('I', 'V', '3', '2'),
+ ME_FOURCC('i', 'v', '3', '2'),
0
},
BUF_VIDEO_IV32,
@@ -236,8 +228,8 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('I', 'V', '3', '1'),
- meFOURCC('i', 'v', '3', '1'),
+ ME_FOURCC('I', 'V', '3', '1'),
+ ME_FOURCC('i', 'v', '3', '1'),
0
},
BUF_VIDEO_IV31,
@@ -245,7 +237,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('V', 'C', 'R', '1'),
+ ME_FOURCC('V', 'C', 'R', '1'),
0
},
BUF_VIDEO_ATIVCR1,
@@ -253,7 +245,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('V', 'C', 'R', '2'),
+ ME_FOURCC('V', 'C', 'R', '2'),
0
},
BUF_VIDEO_ATIVCR2,
@@ -261,11 +253,11 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('I', '2', '6', '3'),
- meFOURCC('i', '2', '6', '3'),
- meFOURCC('V', 'I', 'V', 'O'),
- meFOURCC('v', 'i', 'v', 'o'),
- meFOURCC('v', 'i', 'v', '1'),
+ ME_FOURCC('I', '2', '6', '3'),
+ ME_FOURCC('i', '2', '6', '3'),
+ ME_FOURCC('V', 'I', 'V', 'O'),
+ ME_FOURCC('v', 'i', 'v', 'o'),
+ ME_FOURCC('v', 'i', 'v', '1'),
0
},
BUF_VIDEO_I263,
@@ -273,8 +265,8 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('D','I','B',' '), /* device-independent bitmap */
- meFOURCC('r','a','w',' '),
+ ME_FOURCC('D','I','B',' '), /* device-independent bitmap */
+ ME_FOURCC('r','a','w',' '),
0
},
BUF_VIDEO_RGB,
@@ -286,8 +278,8 @@ static const video_db_t video_db[] = {
else if (!strncasecmp (video, "yuv2", 4))
this->video_type = BUF_VIDEO_YUY2;
*/
- meFOURCC('y', 'u', 'v', '2'),
- meFOURCC('Y', 'U', 'Y', '2'),
+ ME_FOURCC('y', 'u', 'v', '2'),
+ ME_FOURCC('Y', 'U', 'Y', '2'),
0
},
BUF_VIDEO_YUY2,
@@ -295,8 +287,8 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('j','p','e','g'),
- meFOURCC('J','F','I','F'),
+ ME_FOURCC('j','p','e','g'),
+ ME_FOURCC('J','F','I','F'),
0
},
BUF_VIDEO_JPEG,
@@ -304,7 +296,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('W','M','V','1'),
+ ME_FOURCC('W','M','V','1'),
0
},
BUF_VIDEO_WMV7,
@@ -312,7 +304,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('W','M','V','2'),
+ ME_FOURCC('W','M','V','2'),
0
},
BUF_VIDEO_WMV8,
@@ -320,8 +312,8 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('W','M','V','3'),
- meFOURCC('W','M','V','P'),
+ ME_FOURCC('W','M','V','3'),
+ ME_FOURCC('W','M','V','P'),
0
},
BUF_VIDEO_WMV9,
@@ -329,12 +321,12 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('c','r','a','m'),
- meFOURCC('C','R','A','M'),
- meFOURCC('M','S','V','C'),
- meFOURCC('m','s','v','c'),
- meFOURCC('W','H','A','M'),
- meFOURCC('w','h','a','m'),
+ ME_FOURCC('c','r','a','m'),
+ ME_FOURCC('C','R','A','M'),
+ ME_FOURCC('M','S','V','C'),
+ ME_FOURCC('m','s','v','c'),
+ ME_FOURCC('W','H','A','M'),
+ ME_FOURCC('w','h','a','m'),
0
},
BUF_VIDEO_MSVC,
@@ -342,9 +334,9 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('D','V','S','D'),
- meFOURCC('d','v','s','d'),
- meFOURCC('d','v','c','p'),
+ ME_FOURCC('D','V','S','D'),
+ ME_FOURCC('d','v','s','d'),
+ ME_FOURCC('d','v','c','p'),
0
},
BUF_VIDEO_DV,
@@ -352,11 +344,11 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('V','P','3',' '),
- meFOURCC('V','P','3','0'),
- meFOURCC('v','p','3','0'),
- meFOURCC('V','P','3','1'),
- meFOURCC('v','p','3','1'),
+ ME_FOURCC('V','P','3',' '),
+ ME_FOURCC('V','P','3','0'),
+ ME_FOURCC('v','p','3','0'),
+ ME_FOURCC('V','P','3','1'),
+ ME_FOURCC('v','p','3','1'),
0
},
BUF_VIDEO_VP31,
@@ -364,7 +356,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('V','P','4','0'),
+ ME_FOURCC('V','P','4','0'),
0,
},
BUF_VIDEO_VP4,
@@ -372,10 +364,10 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('H', '2', '6', '3'),
- meFOURCC('h', '2', '6', '3'),
- meFOURCC('U', '2', '6', '3'),
- meFOURCC('s', '2', '6', '3'),
+ ME_FOURCC('H', '2', '6', '3'),
+ ME_FOURCC('h', '2', '6', '3'),
+ ME_FOURCC('U', '2', '6', '3'),
+ ME_FOURCC('s', '2', '6', '3'),
0
},
BUF_VIDEO_H263,
@@ -383,8 +375,8 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('c', 'y', 'u', 'v'),
- meFOURCC('C', 'Y', 'U', 'V'),
+ ME_FOURCC('c', 'y', 'u', 'v'),
+ ME_FOURCC('C', 'Y', 'U', 'V'),
0
},
BUF_VIDEO_CYUV,
@@ -392,7 +384,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('s', 'm', 'c', ' '),
+ ME_FOURCC('s', 'm', 'c', ' '),
0
},
BUF_VIDEO_SMC,
@@ -400,8 +392,8 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('r', 'p', 'z', 'a'),
- meFOURCC('a', 'z', 'p', 'r'),
+ ME_FOURCC('r', 'p', 'z', 'a'),
+ ME_FOURCC('a', 'z', 'p', 'r'),
0
},
BUF_VIDEO_RPZA,
@@ -409,7 +401,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('r', 'l', 'e', ' '),
+ ME_FOURCC('r', 'l', 'e', ' '),
0
},
BUF_VIDEO_QTRLE,
@@ -424,7 +416,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('D', 'U', 'C', 'K'),
+ ME_FOURCC('D', 'U', 'C', 'K'),
0
},
BUF_VIDEO_DUCKTM1,
@@ -432,7 +424,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('M', 'S', 'S', '1'),
+ ME_FOURCC('M', 'S', 'S', '1'),
0
},
BUF_VIDEO_MSS1,
@@ -440,7 +432,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('P', 'G', 'V', 'V'),
+ ME_FOURCC('P', 'G', 'V', 'V'),
0
},
BUF_VIDEO_PGVV,
@@ -448,7 +440,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('Z', 'y', 'G', 'o'),
+ ME_FOURCC('Z', 'y', 'G', 'o'),
0
},
BUF_VIDEO_ZYGO,
@@ -456,7 +448,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('t', 's', 'c', 'c'),
+ ME_FOURCC('t', 's', 'c', 'c'),
0
},
BUF_VIDEO_TSCC,
@@ -464,7 +456,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('Y', 'V', 'U', '9'),
+ ME_FOURCC('Y', 'V', 'U', '9'),
0
},
BUF_VIDEO_YVU9,
@@ -472,7 +464,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('G', 'R', 'E', 'Y'),
+ ME_FOURCC('G', 'R', 'E', 'Y'),
0
},
BUF_VIDEO_GREY,
@@ -480,9 +472,9 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('X', 'x', 'a', 'n'),
- meFOURCC('X', 'X', 'A', 'N'),
- meFOURCC('x', 'x', 'a', 'n'),
+ ME_FOURCC('X', 'x', 'a', 'n'),
+ ME_FOURCC('X', 'X', 'A', 'N'),
+ ME_FOURCC('x', 'x', 'a', 'n'),
0
},
BUF_VIDEO_XXAN,
@@ -490,8 +482,8 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('Y', 'V', '1', '2'),
- meFOURCC('y', 'v', '1', '2'),
+ ME_FOURCC('Y', 'V', '1', '2'),
+ ME_FOURCC('y', 'v', '1', '2'),
0
},
BUF_VIDEO_YV12,
@@ -499,8 +491,8 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('I', '4', '2', '0'),
- meFOURCC('I', 'Y', 'U', 'V'),
+ ME_FOURCC('I', '4', '2', '0'),
+ ME_FOURCC('I', 'Y', 'U', 'V'),
0
},
BUF_VIDEO_I420,
@@ -508,8 +500,8 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('S', 'E', 'G', 'A'),
- meFOURCC('s', 'e', 'g', 'a'),
+ ME_FOURCC('S', 'E', 'G', 'A'),
+ ME_FOURCC('s', 'e', 'g', 'a'),
0
},
BUF_VIDEO_SEGA,
@@ -517,8 +509,8 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('m', 'v', 'i', '2'),
- meFOURCC('M', 'V', 'I', '2'),
+ ME_FOURCC('m', 'v', 'i', '2'),
+ ME_FOURCC('M', 'V', 'I', '2'),
0
},
BUF_VIDEO_MVI2,
@@ -526,8 +518,8 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('u', 'c', 'o', 'd'),
- meFOURCC('U', 'C', 'O', 'D'),
+ ME_FOURCC('u', 'c', 'o', 'd'),
+ ME_FOURCC('U', 'C', 'O', 'D'),
0
},
BUF_VIDEO_UCOD,
@@ -535,7 +527,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('R', 'V', '1', '0'),
+ ME_FOURCC('R', 'V', '1', '0'),
0
},
BUF_VIDEO_RV10,
@@ -543,7 +535,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('R', 'V', '2', '0'),
+ ME_FOURCC('R', 'V', '2', '0'),
0
},
BUF_VIDEO_RV20,
@@ -551,7 +543,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('R', 'V', '3', '0'),
+ ME_FOURCC('R', 'V', '3', '0'),
0
},
BUF_VIDEO_RV30,
@@ -559,7 +551,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('R', 'V', '4', '0'),
+ ME_FOURCC('R', 'V', '4', '0'),
0
},
BUF_VIDEO_RV40,
@@ -567,7 +559,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('H', 'F', 'Y', 'U'),
+ ME_FOURCC('H', 'F', 'Y', 'U'),
0,
},
BUF_VIDEO_HUFFYUV,
@@ -575,8 +567,8 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('I', 'M', 'G', ' '),
- meFOURCC('g', 'i', 'f', ' '),
+ ME_FOURCC('I', 'M', 'G', ' '),
+ ME_FOURCC('g', 'i', 'f', ' '),
0,
},
BUF_VIDEO_IMAGE,
@@ -591,7 +583,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('V','P','5','0'),
+ ME_FOURCC('V','P','5','0'),
0
},
BUF_VIDEO_VP5,
@@ -599,9 +591,9 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('V','P','6','0'),
- meFOURCC('V','P','6','1'),
- meFOURCC('V','P','6','2'),
+ ME_FOURCC('V','P','6','0'),
+ ME_FOURCC('V','P','6','1'),
+ ME_FOURCC('V','P','6','2'),
0
},
BUF_VIDEO_VP6,
@@ -609,7 +601,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('8','B', 'P','S'),
+ ME_FOURCC('8','B', 'P','S'),
0
},
BUF_VIDEO_8BPS,
@@ -617,7 +609,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('Z','L','I','B'),
+ ME_FOURCC('Z','L','I','B'),
0
},
BUF_VIDEO_ZLIB,
@@ -625,7 +617,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('M','S','Z','H'),
+ ME_FOURCC('M','S','Z','H'),
0
},
BUF_VIDEO_MSZH,
@@ -633,7 +625,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('A','S','V','1'),
+ ME_FOURCC('A','S','V','1'),
0
},
BUF_VIDEO_ASV1,
@@ -641,7 +633,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('A','S','V','2'),
+ ME_FOURCC('A','S','V','2'),
0
},
BUF_VIDEO_ASV2,
@@ -649,9 +641,9 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('a','v','c','1'),
- meFOURCC('h','2','6','4'),
- meFOURCC('H','2','6','4'),
+ ME_FOURCC('a','v','c','1'),
+ ME_FOURCC('h','2','6','4'),
+ ME_FOURCC('H','2','6','4'),
0
},
BUF_VIDEO_H264,
@@ -659,7 +651,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('A','A','S','C'),
+ ME_FOURCC('A','A','S','C'),
0
},
BUF_VIDEO_AASC,
@@ -667,7 +659,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('q','d','r','w'),
+ ME_FOURCC('q','d','r','w'),
0
},
BUF_VIDEO_QDRW,
@@ -675,7 +667,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('L','O','C','O'),
+ ME_FOURCC('L','O','C','O'),
0
},
BUF_VIDEO_LOCO,
@@ -683,7 +675,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('U','L','T','I'),
+ ME_FOURCC('U','L','T','I'),
0
},
BUF_VIDEO_ULTI,
@@ -691,7 +683,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('W','N','V','1'),
+ ME_FOURCC('W','N','V','1'),
0
},
BUF_VIDEO_WNV1,
@@ -699,8 +691,8 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('P','I','X','L'),
- meFOURCC('X','I','X','L'),
+ ME_FOURCC('P','I','X','L'),
+ ME_FOURCC('X','I','X','L'),
0
},
BUF_VIDEO_XL,
@@ -708,9 +700,9 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('Q','P','E','G'),
- meFOURCC('Q','1','.','0'),
- meFOURCC('Q','1','.','1'),
+ ME_FOURCC('Q','P','E','G'),
+ ME_FOURCC('Q','1','.','0'),
+ ME_FOURCC('Q','1','.','1'),
0
},
BUF_VIDEO_QPEG,
@@ -718,7 +710,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('R','T','2','1'),
+ ME_FOURCC('R','T','2','1'),
0
},
BUF_VIDEO_RT21,
@@ -726,7 +718,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('F','P','S','1'),
+ ME_FOURCC('F','P','S','1'),
0
},
BUF_VIDEO_FPS1,
@@ -734,7 +726,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('T','M','2','0'),
+ ME_FOURCC('T','M','2','0'),
0
},
BUF_VIDEO_DUCKTM2,
@@ -742,7 +734,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('C','S','C','D'),
+ ME_FOURCC('C','S','C','D'),
0
},
BUF_VIDEO_CSCD,
@@ -750,7 +742,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('Z','M','B','V'),
+ ME_FOURCC('Z','M','B','V'),
0
},
BUF_VIDEO_ZMBV,
@@ -758,7 +750,7 @@ static const video_db_t video_db[] = {
},
{
{
- meFOURCC('K','M','V','C'),
+ ME_FOURCC('K','M','V','C'),
0
},
BUF_VIDEO_KMVC,
@@ -772,7 +764,7 @@ static const audio_db_t audio_db[] = {
{
{
0x2000,
- meFOURCC('m', 's', 0x20, 0x00),
+ ME_FOURCC('m', 's', 0x20, 0x00),
0
},
BUF_AUDIO_A52,
@@ -781,9 +773,9 @@ static const audio_db_t audio_db[] = {
{
{
0x50, 0x55,
- meFOURCC('.','m','p','3'),
- meFOURCC('m', 's', 0, 0x55),
- meFOURCC('M','P','3',' '),
+ ME_FOURCC('.','m','p','3'),
+ ME_FOURCC('m', 's', 0, 0x55),
+ ME_FOURCC('M','P','3',' '),
0
},
BUF_AUDIO_MPEG,
@@ -791,8 +783,8 @@ static const audio_db_t audio_db[] = {
},
{
{
- meFOURCC('t','w','o','s'),
- meFOURCC('i','n','2','4'),
+ ME_FOURCC('t','w','o','s'),
+ ME_FOURCC('i','n','2','4'),
0
},
BUF_AUDIO_LPCM_BE,
@@ -801,8 +793,8 @@ static const audio_db_t audio_db[] = {
{
{
0x01,
- meFOURCC('r','a','w',' '),
- meFOURCC('s','o','w','t'),
+ ME_FOURCC('r','a','w',' '),
+ ME_FOURCC('s','o','w','t'),
0
},
BUF_AUDIO_LPCM_LE,
@@ -853,7 +845,7 @@ static const audio_db_t audio_db[] = {
{
{
0x02,
- meFOURCC('m', 's', 0, 0x02),
+ ME_FOURCC('m', 's', 0, 0x02),
0
},
BUF_AUDIO_MSADPCM,
@@ -862,7 +854,7 @@ static const audio_db_t audio_db[] = {
{
{
0x11,
- meFOURCC('m', 's', 0, 0x11),
+ ME_FOURCC('m', 's', 0, 0x11),
0
},
BUF_AUDIO_MSIMAADPCM,
@@ -880,8 +872,8 @@ static const audio_db_t audio_db[] = {
/* these formattags are used by Vorbis ACM encoder and
supported by NanDub, a variant of VirtualDub. */
0x674f, 0x676f, 0x6750, 0x6770, 0x6751, 0x6771,
- meFOURCC('O','g','g','S'),
- meFOURCC('O','g','g','V'),
+ ME_FOURCC('O','g','g','S'),
+ ME_FOURCC('O','g','g','V'),
0
},
BUF_AUDIO_VORBIS,
@@ -938,7 +930,7 @@ static const audio_db_t audio_db[] = {
},
{
{
- meFOURCC('i', 'm', 'a', '4'),
+ ME_FOURCC('i', 'm', 'a', '4'),
0
},
BUF_AUDIO_QTIMAADPCM,
@@ -946,8 +938,8 @@ static const audio_db_t audio_db[] = {
},
{
{
- meFOURCC('m', 'a', 'c', '3'),
- meFOURCC('M', 'A', 'C', '3'),
+ ME_FOURCC('m', 'a', 'c', '3'),
+ ME_FOURCC('M', 'A', 'C', '3'),
0
},
BUF_AUDIO_MAC3,
@@ -955,8 +947,8 @@ static const audio_db_t audio_db[] = {
},
{
{
- meFOURCC('m', 'a', 'c', '6'),
- meFOURCC('M', 'A', 'C', '6'),
+ ME_FOURCC('m', 'a', 'c', '6'),
+ ME_FOURCC('M', 'A', 'C', '6'),
0
},
BUF_AUDIO_MAC6,
@@ -964,7 +956,7 @@ static const audio_db_t audio_db[] = {
},
{
{
- meFOURCC('Q', 'D', 'M', 'C'),
+ ME_FOURCC('Q', 'D', 'M', 'C'),
0
},
BUF_AUDIO_QDESIGN1,
@@ -972,7 +964,7 @@ static const audio_db_t audio_db[] = {
},
{
{
- meFOURCC('Q', 'D', 'M', '2'),
+ ME_FOURCC('Q', 'D', 'M', '2'),
0
},
BUF_AUDIO_QDESIGN2,
@@ -981,11 +973,11 @@ static const audio_db_t audio_db[] = {
{
{
0xFF,
- meFOURCC('m', 'p', '4', 'a'),
- meFOURCC('M', 'P', '4', 'A'),
- meFOURCC('r', 'a', 'a', 'c'),
- meFOURCC('r', 'a', 'c', 'p'),
- meFOURCC('A', 'A', 'C', ' '),
+ ME_FOURCC('m', 'p', '4', 'a'),
+ ME_FOURCC('M', 'P', '4', 'A'),
+ ME_FOURCC('r', 'a', 'a', 'c'),
+ ME_FOURCC('r', 'a', 'c', 'p'),
+ ME_FOURCC('A', 'A', 'C', ' '),
0
},
BUF_AUDIO_AAC,
@@ -993,7 +985,7 @@ static const audio_db_t audio_db[] = {
},
{
{
- meFOURCC('d', 'n', 'e', 't'),
+ ME_FOURCC('d', 'n', 'e', 't'),
0
},
BUF_AUDIO_DNET,
@@ -1001,7 +993,7 @@ static const audio_db_t audio_db[] = {
},
{
{
- meFOURCC('s', 'i', 'p', 'r'),
+ ME_FOURCC('s', 'i', 'p', 'r'),
0
},
BUF_AUDIO_SIPRO,
@@ -1009,7 +1001,7 @@ static const audio_db_t audio_db[] = {
},
{
{
- meFOURCC('c', 'o', 'o', 'k'),
+ ME_FOURCC('c', 'o', 'o', 'k'),
0
},
BUF_AUDIO_COOK,
@@ -1017,7 +1009,7 @@ static const audio_db_t audio_db[] = {
},
{
{
- meFOURCC('a', 't', 'r', 'c'),
+ ME_FOURCC('a', 't', 'r', 'c'),
0
},
BUF_AUDIO_ATRK,
@@ -1025,7 +1017,7 @@ static const audio_db_t audio_db[] = {
},
{
{
- meFOURCC('Q', 'c', 'l', 'p'),
+ ME_FOURCC('Q', 'c', 'l', 'p'),
0
},
BUF_AUDIO_QCLP,
@@ -1034,7 +1026,7 @@ static const audio_db_t audio_db[] = {
{
{
0x7,
- meFOURCC('u', 'l', 'a', 'w'),
+ ME_FOURCC('u', 'l', 'a', 'w'),
0
},
BUF_AUDIO_MULAW,
@@ -1043,7 +1035,7 @@ static const audio_db_t audio_db[] = {
{
{
0x6,
- meFOURCC('a', 'l', 'a', 'w'),
+ ME_FOURCC('a', 'l', 'a', 'w'),
0
},
BUF_AUDIO_ALAW,
@@ -1051,7 +1043,7 @@ static const audio_db_t audio_db[] = {
},
{
{
- meFOURCC('a', 'g', 's', 'm'),
+ ME_FOURCC('a', 'g', 's', 'm'),
0
},
BUF_AUDIO_GSM610,
@@ -1073,7 +1065,7 @@ static const audio_db_t audio_db[] = {
},
{
{
- meFOURCC('l', 'p', 'c', 'J'),
+ ME_FOURCC('l', 'p', 'c', 'J'),
0
},
BUF_AUDIO_14_4,
@@ -1081,7 +1073,7 @@ static const audio_db_t audio_db[] = {
},
{
{
- meFOURCC('2', '8', '_', '8'),
+ ME_FOURCC('2', '8', '_', '8'),
0
},
BUF_AUDIO_28_8,
@@ -1096,7 +1088,7 @@ static const audio_db_t audio_db[] = {
},
{
{
- meFOURCC('a', 'l', 'a', 'c'),
+ ME_FOURCC('a', 'l', 'a', 'c'),
},
BUF_AUDIO_ALAC,
"Apple Lossless Audio Codec"
@@ -1146,7 +1138,7 @@ static uint32_t cached_buf_type=0;
return 0;
}
-char * _x_buf_video_name( uint32_t buf_type ) {
+const char *_x_buf_video_name( uint32_t buf_type ) {
int i;
buf_type &= 0xffff0000;
@@ -1180,7 +1172,7 @@ static uint32_t cached_buf_type=0;
return 0;
}
-char * _x_buf_audio_name( uint32_t buf_type ) {
+const char *_x_buf_audio_name( uint32_t buf_type ) {
int i;
buf_type &= 0xffff0000;
@@ -1221,3 +1213,4 @@ void _x_waveformatex_le2me( xine_waveformatex *wavex ) {
wavex->wBitsPerSample = le2me_16(wavex->wBitsPerSample);
wavex->cbSize = le2me_16(wavex->cbSize);
}
+
diff --git a/src/xine-engine/configfile.h b/src/xine-engine/configfile.h
index 859214d1c..cf4a9703f 100644
--- a/src/xine-engine/configfile.h
+++ b/src/xine-engine/configfile.h
@@ -40,7 +40,7 @@ extern "C" {
#define CONFIG_FILE_VERSION 2
-/*
+/**
* config entries above this experience
* level must never be changed from MRL
*/
@@ -57,33 +57,32 @@ struct cfg_entry_s {
char *key;
int type;
- /* type unknown */
+ /** user experience level */
+ int exp_level;
+
+ /** type unknown */
char *unknown_value;
- /* type string */
+ /** type string */
char *str_value;
char *str_default;
- /* common to range, enum, num, bool: */
-
+ /** common to range, enum, num, bool: */
int num_value;
int num_default;
- /* type range specific: */
+ /** type range specific: */
int range_min;
int range_max;
- /* type enum specific: */
+ /** type enum specific: */
char **enum_values;
- /* help info for the user */
+ /** help info for the user */
char *description;
char *help;
- /* user experience level */
- int exp_level;
-
- /* callback function and data for live changeable values */
+ /** callback function and data for live changeable values */
xine_config_cb_t callback;
void *callback_data;
};
@@ -156,17 +155,17 @@ struct config_values_s {
xine_config_cb_t changed_cb,
void *cb_data);
- /* convenience function to update range, enum, num and bool values */
+ /** convenience function to update range, enum, num and bool values */
void (*update_num) (config_values_t *self, const char *key, int value);
- /* convenience function to update string values */
+ /** convenience function to update string values */
void (*update_string) (config_values_t *self, const char *key, const char *value);
- /* small utility function for enum handling */
+ /** small utility function for enum handling */
int (*parse_enum) (const char *str, const char **values);
- /*
- * lookup config entries
+ /**
+ * @brief lookup config entries
*
* remember to call the changed_cb if it exists
* and you changed the value of this item
@@ -174,12 +173,12 @@ struct config_values_s {
cfg_entry_t* (*lookup_entry) (config_values_t *self, const char *key);
- /*
+ /**
* unregister callback function
*/
void (*unregister_callback) (config_values_t *self, const char *key);
- /*
+ /**
* dispose of all config entries in memory
*/
void (*dispose) (config_values_t *self);
@@ -189,27 +188,29 @@ struct config_values_s {
*/
cfg_entry_t *first, *last, *cur;
- /*
+ /**
* mutex for modification to the config
*/
pthread_mutex_t config_lock;
- /*
+ /**
* current config file's version number
*/
int current_version;
};
-/*
- * allocate and init a new xine config object
+/**
+ * @brief allocate and init a new xine config object
+ * @internal
*/
-config_values_t *_x_config_init (void) XINE_PROTECTED;
+config_values_t *_x_config_init (void);
-/*
- * interpret stream_setup part of mrls for config value changes
+/**
+ * @brief interpret stream_setup part of mrls for config value changes
+ * @internal
*/
-int _x_config_change_opt(config_values_t *config, const char *opt) XINE_PROTECTED;
+int _x_config_change_opt(config_values_t *config, const char *opt);
#ifdef __cplusplus
diff --git a/src/xine-engine/input_cache.c b/src/xine-engine/input_cache.c
index 75c4beb43..7537c4d16 100644
--- a/src/xine-engine/input_cache.c
+++ b/src/xine-engine/input_cache.c
@@ -62,8 +62,9 @@ typedef struct {
/*
* read data from input plugin and write it into file
*/
-static off_t cache_plugin_read(input_plugin_t *this_gen, char *buf, off_t len) {
+static off_t cache_plugin_read(input_plugin_t *this_gen, void *buf_gen, off_t len) {
cache_input_plugin_t *this = (cache_input_plugin_t *)this_gen;
+ char *buf = (char *)buf_gen;
off_t read_len = 0;
off_t main_read;
diff --git a/src/xine-engine/input_rip.c b/src/xine-engine/input_rip.c
index 56850ba2d..774ef82c5 100644
--- a/src/xine-engine/input_rip.c
+++ b/src/xine-engine/input_rip.c
@@ -100,8 +100,9 @@ static off_t min_off(off_t a, off_t b) {
/*
* read data from input plugin and write it into file
*/
-static off_t rip_plugin_read(input_plugin_t *this_gen, char *buf, off_t len) {
+static off_t rip_plugin_read(input_plugin_t *this_gen, void *buf_gen, off_t len) {
rip_input_plugin_t *this = (rip_input_plugin_t *)this_gen;
+ char *buf = (char *)buf_gen;
off_t retlen, npreview, nread, nwrite, nread_orig, nread_file;
lprintf("reading %"PRId64" bytes (curpos = %"PRId64", savepos = %"PRId64")\n", len, this->curpos, this->savepos);
diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c
index 912455b18..e7ced7a5e 100644
--- a/src/xine-engine/load_plugins.c
+++ b/src/xine-engine/load_plugins.c
@@ -43,6 +43,8 @@
#include <ctype.h>
#include <signal.h>
+#include <basedir.h>
+
#define LOG_MODULE "load_plugins"
#define LOG_VERBOSE
@@ -95,6 +97,7 @@ static void remove_segv_handler(void){
#endif
#endif /* 0 */
+#define CACHE_CATALOG_VERSION 2
static const int plugin_iface_versions[] = {
INPUT_PLUGIN_IFACE_VERSION,
@@ -317,7 +320,6 @@ static void _insert_node (xine_t *this,
const input_info_t *input_old;
uint32_t *types;
char key[80];
- char desc[100];
int i;
_x_assert(list);
@@ -381,13 +383,8 @@ static void _insert_node (xine_t *this,
entry->priority = decoder_new->priority = decoder_old->priority;
snprintf(key, sizeof(key), "engine.decoder_priorities.%s", info->id);
- snprintf(desc, sizeof(desc), _("priority for %s decoder"), info->id);
- /* write the description on the heap because the config system
- * does not strdup() it, so we have to provide a different pointer
- * for each decoder */
for (i = 0; catalog->prio_desc[i]; i++);
- catalog->prio_desc[i] = malloc(strlen(desc) + 1);
- strcpy(catalog->prio_desc[i], desc);
+ asprintf(&catalog->prio_desc[i], _("priority for %s decoder"), info->id);
this->config->register_num (this->config,
key,
0,
@@ -949,7 +946,7 @@ static void load_plugin_list(FILE *fp, xine_sarray_t *plugins) {
file = xine_xmalloc(sizeof(plugin_file_t));
node->file = file;
file->filename = strdup(line+1);
- node->info = xine_xmalloc(2*sizeof(plugin_info_t));
+ node->info = xine_xcalloc(2, sizeof(plugin_info_t));
node->info[1].type = PLUGIN_NONE;
decoder_info = NULL;
vo_info = NULL;
@@ -1033,7 +1030,7 @@ static void load_plugin_list(FILE *fp, xine_sarray_t *plugins) {
for( s = value, i = 0; s && sscanf(s," %lu",&lu) > 0; i++ ) {
s = strchr(s+1, ' ');
}
- decoder_info->supported_types = xine_xmalloc((i+1)*sizeof(uint32_t));
+ decoder_info->supported_types = xine_xcalloc((i+1), sizeof(uint32_t));
for( s = value, i = 0; s && sscanf(s," %lu",&lu) > 0; i++ ) {
decoder_info->supported_types[i] = lu;
s = strchr(s+1, ' ');
@@ -1066,27 +1063,68 @@ static void load_plugin_list(FILE *fp, xine_sarray_t *plugins) {
}
}
+/**
+ * @brief Returns the complete filename for the plugins' cache file
+ * @param this Instance pointer, used for logging and libxdg-basedir.
+ * @param createdir If not zero, create the directory structure in which
+ * the file has to reside.
+ * @return If createdir was not zero, returns NULL if the directory hasn't
+ * been created; otherwise always returns a new string with the
+ * name of the cachefile.
+ * @internal
+ *
+ * @see XDG Base Directory specification:
+ * http://standards.freedesktop.org/basedir-spec/latest/index.html
+ */
+static char *catalog_filename(xine_t *this, int createdir) {
+ const char *const xdg_cache_home = xdgCacheHome(this->basedir_handle);
+ char *cachefile = NULL;
+
+ cachefile = xine_xmalloc( strlen(xdg_cache_home) + sizeof("/"PACKAGE"/plugins.cache") );
+ strcpy(cachefile, xdg_cache_home);
+
+ /* If we're going to create the directory structure, we concatenate
+ * piece by piece the path, so that we can try to create all the
+ * directories.
+ * If we don't need to create anything, we just concatenate the
+ * whole path at once.
+ */
+ if ( createdir ) {
+ int result = 0;
+
+ result = mkdir( cachefile, 0700 );
+ if ( result != 0 && errno != EEXIST ) {
+ /** @todo Convert this to use xine's log facility */
+ fprintf(stderr, _("Unable to create %s directory: %s\n"), cachefile, strerror(errno));
+ free(cachefile);
+ return NULL;
+ }
+
+ strcat(cachefile, "/"PACKAGE);
+ result = mkdir( cachefile, 0700 );
+ if ( result != 0 && errno != EEXIST ) {
+ /** @todo Convert this to use xine's log facility */
+ fprintf(stderr, _("Unable to create %s directory: %s\n"), cachefile, strerror(errno));
+ free(cachefile);
+ return NULL;
+ }
+
+ strcat(cachefile, "/plugins.cache");
+
+ } else
+ strcat(cachefile, "/"PACKAGE"/plugins.cache");
+
+ return cachefile;
+}
/*
* save catalog to cache file
*/
static void save_catalog (xine_t *this) {
-
FILE *fp;
- char *cachefile, *dirfile;
- const char *relname = CACHE_CATALOG_FILE;
- const char *dirname = CACHE_CATALOG_DIR;
-
- cachefile = (char *) xine_xmalloc(strlen(xine_get_homedir()) +
- strlen(relname) + 2);
- sprintf(cachefile, "%s/%s", xine_get_homedir(), relname);
-
- /* make sure homedir (~/.xine) exists */
- dirfile = (char *) xine_xmalloc(strlen(xine_get_homedir()) +
- strlen(dirname) + 2);
- sprintf(dirfile, "%s/%s", xine_get_homedir(), dirname);
- mkdir (dirfile, 0755);
- free (dirfile);
+ char *const cachefile = catalog_filename(this, 1);
+
+ if ( ! cachefile ) return;
if( (fp = fopen(cachefile,"w")) != NULL ) {
int i;
@@ -1108,13 +1146,9 @@ static void save_catalog (xine_t *this) {
static void load_cached_catalog (xine_t *this) {
FILE *fp;
- char *cachefile;
- const char *relname = CACHE_CATALOG_FILE;
-
- cachefile = (char *) xine_xmalloc(strlen(xine_get_homedir()) +
- strlen(relname) + 2);
- sprintf(cachefile, "%s/%s", xine_get_homedir(), relname);
-
+ char *const cachefile = catalog_filename(this, 0);
+ /* It can't return NULL without creating directories */
+
if( (fp = fopen(cachefile,"r")) != NULL ) {
load_plugin_list (fp, this->plugin_catalog->cache_list);
fclose(fp);
@@ -2231,7 +2265,7 @@ const char *const *xine_list_post_plugins(xine_t *xine) {
return catalog->ids;
}
-const char *const *xine_list_post_plugins_typed(xine_t *xine, int type) {
+const char *const *xine_list_post_plugins_typed(xine_t *xine, uint32_t type) {
plugin_catalog_t *catalog = xine->plugin_catalog;
plugin_node_t *node;
int i;
diff --git a/src/xine-engine/metronom.c b/src/xine-engine/metronom.c
index fa33da9e1..50720e157 100644
--- a/src/xine-engine/metronom.c
+++ b/src/xine-engine/metronom.c
@@ -851,7 +851,8 @@ static void metronom_unregister_scr (metronom_clock_t *this, scr_plugin_t *scr)
this->scr_master = get_master_scr(this);
}
-static int metronom_sync_loop (metronom_clock_t *this) {
+static void *metronom_sync_loop (void *const this_gen) {
+ metronom_clock_t *const this = (metronom_clock_t *const)this_gen;
struct timeval tv;
struct timespec ts;
@@ -874,7 +875,7 @@ static int metronom_sync_loop (metronom_clock_t *this) {
pthread_mutex_unlock (&this->lock);
}
- return 0;
+ return NULL;
}
static void metronom_exit (metronom_t *this) {
@@ -990,7 +991,7 @@ metronom_clock_t *_x_metronom_clock_init(xine_t *xine)
this->thread_running = 1;
if ((err = pthread_create(&this->sync_thread, NULL,
- (void*(*)(void*)) metronom_sync_loop, this)) != 0)
+ metronom_sync_loop, this)) != 0)
xprintf(this->xine, XINE_VERBOSITY_NONE, "cannot create sync thread (%s)\n",
strerror(err));
diff --git a/src/xine-engine/metronom.h b/src/xine-engine/metronom.h
index 1628ba9fd..e4115b6ad 100644
--- a/src/xine-engine/metronom.h
+++ b/src/xine-engine/metronom.h
@@ -336,8 +336,6 @@ metronom_clock_t *_x_metronom_clock_init(xine_t *xine) XINE_PROTECTED;
struct scr_plugin_s
{
- int interface_version;
-
int (*get_priority) (scr_plugin_t *self);
/*
@@ -358,6 +356,8 @@ struct scr_plugin_s
void (*exit) (scr_plugin_t *self);
metronom_clock_t *clock;
+
+ int interface_version;
};
#ifdef __cplusplus
diff --git a/src/xine-engine/osd.c b/src/xine-engine/osd.c
index ebc12300b..ff9cc2176 100644
--- a/src/xine-engine/osd.c
+++ b/src/xine-engine/osd.c
@@ -40,6 +40,8 @@
# include <iconv.h>
#endif
+#include <basedir.h>
+
#define LOG_MODULE "osd"
#define LOG_VERBOSE
/*
@@ -816,6 +818,93 @@ static int osd_renderer_unload_font(osd_renderer_t *this, char *fontname ) {
}
#ifdef HAVE_FT2
+
+# ifdef HAVE_FONTCONFIG
+/**
+ * @brief Look up a font name using FontConfig library
+ * @param osd The OSD object to load the font for.
+ * @param fontname Name of the font to look up.
+ * @param size Size of the font to look for.
+ *
+ * @return If the lookup was done correctly, a non-zero value is returned.
+ */
+static int osd_lookup_fontconfig( osd_object_t *osd, const char *const fontname, const int size ) {
+ FcPattern *pat = NULL, *match = NULL;
+ FcFontSet *fs = FcFontSetCreate();
+ FcResult result;
+
+ pat = FcPatternBuild(NULL, FC_FAMILY, FcTypeString, fontname, FC_SIZE, FcTypeDouble, (double)size, NULL);
+ FcConfigSubstitute(NULL, pat, FcMatchPattern);
+ FcDefaultSubstitute(pat);
+
+ match = FcFontMatch(NULL, pat, &result);
+ FcPatternDestroy(pat);
+
+ if ( ! match ) {
+ FcFontSetDestroy(fs);
+ xprintf(osd->renderer->stream->xine, XINE_VERBOSITY_LOG,
+ _("osd: error matching font %s with FontConfig"), fontname);
+ return 0;
+ }
+ FcFontSetAdd(fs, match);
+
+ if ( fs->nfont != 0 ) {
+ FcChar8 *filename = NULL;
+ FcPatternGetString(fs->fonts[0], FC_FILE, 0, &filename);
+ if ( ! FT_New_Face(osd->ft2->library, (const char*)filename, 0, &osd->ft2->face) ) {
+ FcFontSetDestroy(fs);
+ return 1;
+ }
+
+ xprintf(osd->renderer->stream->xine, XINE_VERBOSITY_LOG,
+ _("osd: error loading font %s with FontConfig"), fontname);
+ return 0;
+ } else {
+ xprintf(osd->renderer->stream->xine, XINE_VERBOSITY_LOG,
+ _("osd: error looking up font %s with FontConfig"), fontname);
+ return 0;
+ }
+}
+# endif /* HAVE_FONTCONFIG */
+
+/**
+ * @brief Look up a font file using XDG data directories.
+ * @param osd The OSD object to load the font for.
+ * @param fontname Name (absolute or relative) of the font to look up.
+ *
+ * @return If the lookup was done correctly, a non-zero value is returned.
+ *
+ * @see XDG Base Directory specification:
+ * http://standards.freedesktop.org/basedir-spec/latest/index.html
+ */
+static int osd_lookup_xdg( osd_object_t *osd, const char *const fontname ) {
+ const char *const *data_dirs = xdgSearchableDataDirectories(osd->renderer->stream->xine->basedir_handle);
+
+ /* try load font from current directory or from an absolute path */
+ if ( FT_New_Face(osd->ft2->library, fontname, 0, &osd->ft2->face) == FT_Err_Ok )
+ return 1;
+
+ if ( data_dirs )
+ while( (*data_dirs) && *(*data_dirs) ) {
+ FT_Error fte = FT_Err_Ok;
+ char *fontpath = NULL;
+ asprintf(&fontpath, "%s/"PACKAGE"/fonts/%s", *data_dirs, fontname);
+
+ fte = FT_New_Face(osd->ft2->library, fontpath, 0, &osd->ft2->face);
+
+ free(fontpath);
+
+ if ( fte == FT_Err_Ok )
+ return 1;
+
+ data_dirs++;
+ }
+
+ xprintf(osd->renderer->stream->xine, XINE_VERBOSITY_LOG,
+ _("osd: error loading font %s with in XDG data directories.\n"), fontname);
+ return 0;
+}
+
static int osd_set_font_freetype2( osd_object_t *osd, const char *fontname, int size ) {
if (!osd->ft2) {
osd->ft2 = xine_xmalloc(sizeof(osd_ft2context_t));
@@ -828,68 +917,19 @@ static int osd_set_font_freetype2( osd_object_t *osd, const char *fontname, int
}
}
+ do { /* while 0 */
#ifdef HAVE_FONTCONFIG
- do {
- FcPattern *pat = NULL, *match = NULL;
- FcFontSet *fs = FcFontSetCreate();
- FcResult result;
-
- pat = FcPatternBuild(NULL, FC_FAMILY, FcTypeString, fontname, FC_SIZE, FcTypeDouble, (double)size, NULL);
- FcConfigSubstitute(NULL, pat, FcMatchPattern);
- FcDefaultSubstitute(pat);
-
- match = FcFontMatch(NULL, pat, &result);
- FcPatternDestroy(pat);
-
- if ( ! match ) {
- FcFontSetDestroy(fs);
- xprintf(osd->renderer->stream->xine, XINE_VERBOSITY_LOG,
- _("osd: error matching font %s with FontConfig"), fontname);
+ if ( osd_lookup_fontconfig(osd, fontname, size) )
break;
- }
- FcFontSetAdd(fs, match);
-
- if ( fs->nfont != 0 ) {
- FcChar8 *filename = NULL;
- FcPatternGetString(fs->fonts[0], FC_FILE, 0, &filename);
- if ( ! FT_New_Face(osd->ft2->library, (const char*)filename, 0, &osd->ft2->face) ) {
- FcFontSetDestroy(fs);
- goto end;
- }
-
- xprintf(osd->renderer->stream->xine, XINE_VERBOSITY_LOG,
- _("osd: error loading font %s with FontConfig"), fontname);
- } else {
- xprintf(osd->renderer->stream->xine, XINE_VERBOSITY_LOG,
- _("osd: error looking up font %s with FontConfig"), fontname);
- }
- } while(0);
#endif
- {
- char pathname[1024];
- /* try load font from current directory */
- if ( !FT_New_Face(osd->ft2->library, fontname, 0, &osd->ft2->face) )
- goto end;
-
- /* try load font from home directory */
- snprintf(pathname, 1024, "%s/.xine/fonts/%s", xine_get_homedir(), fontname);
- if ( !FT_New_Face(osd->ft2->library, pathname, 0, &osd->ft2->face) )
- goto end;
-
- /* try load font from xine font directory */
- snprintf(pathname, 1024, "%s/%s", XINE_FONTDIR, fontname);
- if ( !FT_New_Face(osd->ft2->library, pathname, 0, &osd->ft2->face) )
- goto end;
-
- xprintf(osd->renderer->stream->xine, XINE_VERBOSITY_LOG,
- _("osd: error loading font %s with ft2\n"), fontname);
- }
+ if ( osd_lookup_xdg(osd, fontname) )
+ break;
- free(osd->ft2);
- osd->ft2 = NULL;
- return 0;
+ free(osd->ft2);
+ osd->ft2 = NULL;
+ return 0;
+ } while(0);
- end:
if (FT_Set_Pixel_Sizes(osd->ft2->face, 0, size)) {
xprintf(osd->renderer->stream->xine, XINE_VERBOSITY_LOG,
_("osd: error setting font size (no scalable font?)\n"));
@@ -1577,7 +1617,6 @@ static uint32_t osd_get_capabilities (osd_object_t *osd) {
osd_renderer_t *_x_osd_renderer_init( xine_stream_t *stream ) {
osd_renderer_t *this;
- char str[1024];
this = xine_xmalloc(sizeof(osd_renderer_t));
this->stream = stream;
@@ -1588,12 +1627,22 @@ osd_renderer_t *_x_osd_renderer_init( xine_stream_t *stream ) {
/*
* load available fonts
*/
+ {
+ const char *const *data_dirs = xdgSearchableDataDirectories(stream->xine->basedir_handle);
+ if ( data_dirs )
+ while( (*data_dirs) && *(*data_dirs) ) {
+ /* sizeof("") takes care of the final NUL byte */
+ char *fontpath = xine_xmalloc( strlen(*data_dirs) + sizeof("/"PACKAGE"/fonts/") );
+ strcpy(fontpath, *data_dirs);
+ strcat(fontpath, "/"PACKAGE"/fonts/");
- osd_preload_fonts (this, XINE_FONTDIR);
-
- snprintf (str, 1024, "%s/.xine/fonts", xine_get_homedir ());
+ osd_preload_fonts(this, fontpath);
- osd_preload_fonts (this, str);
+ free(fontpath);
+
+ data_dirs++;
+ }
+ }
this->textpalette = this->stream->xine->config->register_enum (this->stream->xine->config,
"ui.osd.text_palette", 0,
diff --git a/src/xine-engine/osd.h b/src/xine-engine/osd.h
index 6c7be8f0b..e8212acff 100644
--- a/src/xine-engine/osd.h
+++ b/src/xine-engine/osd.h
@@ -57,8 +57,6 @@ struct osd_object_s {
uint32_t color[OVL_PALETTE_SIZE]; /* color lookup table */
uint8_t trans[OVL_PALETTE_SIZE]; /* mixer key table */
- int32_t handle;
-
#ifdef HAVE_ICONV
iconv_t cd; /* iconv handle of encoding */
char *encoding; /* name of encoding */
@@ -66,6 +64,8 @@ struct osd_object_s {
osd_font_t *font;
osd_ft2context_t *ft2;
+
+ int32_t handle;
};
/* this one is public */
@@ -74,6 +74,8 @@ struct xine_osd_s {
};
struct osd_renderer_s {
+
+ xine_stream_t *stream;
/*
* open a new osd object. this will allocated an empty (all zero) drawing
@@ -219,8 +221,6 @@ struct osd_renderer_s {
osd_object_t *osds; /* instances of osd */
osd_font_t *fonts; /* loaded fonts */
int textpalette; /* default textpalette */
-
- xine_stream_t *stream;
};
diff --git a/src/xine-engine/plugin_catalog.h b/src/xine-engine/plugin_catalog.h
index 5bd1c4701..5533ab374 100644
--- a/src/xine-engine/plugin_catalog.h
+++ b/src/xine-engine/plugin_catalog.h
@@ -40,16 +40,12 @@
/* the engine takes this many plugins for one stream type */
#define PLUGINS_PER_TYPE 10
-#define CACHE_CATALOG_VERSION 2
-#define CACHE_CATALOG_FILE ".xine/catalog.cache"
-#define CACHE_CATALOG_DIR ".xine"
-
typedef struct {
char *filename;
off_t filesize;
time_t filemtime;
- int ref; /* count number of classes */
void *lib_handle;
+ int ref; /* count number of classes */
int no_unload; /* set if the file can't be unloaded */
} plugin_file_t ;
diff --git a/src/xine-engine/post.c b/src/xine-engine/post.c
index 32c8f9453..d153cada9 100644
--- a/src/xine-engine/post.c
+++ b/src/xine-engine/post.c
@@ -149,6 +149,14 @@ static void post_video_flush(xine_video_port_t *port_gen) {
if (port->port_lock) pthread_mutex_unlock(port->port_lock);
}
+static void post_video_trigger_drawing(xine_video_port_t *port_gen) {
+ post_video_port_t *port = (post_video_port_t *)port_gen;
+
+ if (port->port_lock) pthread_mutex_lock(port->port_lock);
+ port->original_port->trigger_drawing(port->original_port);
+ if (port->port_lock) pthread_mutex_unlock(port->port_lock);
+}
+
static int post_video_status(xine_video_port_t *port_gen, xine_stream_t *stream,
int *width, int *height, int64_t *img_duration) {
post_video_port_t *port = (post_video_port_t *)port_gen;
@@ -192,6 +200,7 @@ static int post_video_rewire(xine_post_out_t *output_gen, void *data) {
if (!new_port)
return 0;
+ this->running_ticket->lock_port_rewiring(this->running_ticket, -1);
this->running_ticket->revoke(this->running_ticket, 1);
if (input_port->original_port->status(input_port->original_port, input_port->stream,
@@ -202,6 +211,7 @@ static int post_video_rewire(xine_post_out_t *output_gen, void *data) {
input_port->original_port = new_port;
this->running_ticket->issue(this->running_ticket, 1);
+ this->running_ticket->unlock_port_rewiring(this->running_ticket);
return 1;
}
@@ -223,6 +233,7 @@ post_video_port_t *_x_post_intercept_video_port(post_plugin_t *post, xine_video_
port->new_port.exit = post_video_exit;
port->new_port.get_overlay_manager = post_video_get_overlay_manager;
port->new_port.flush = post_video_flush;
+ port->new_port.trigger_drawing = post_video_trigger_drawing;
port->new_port.status = post_video_status;
port->new_port.get_property = post_video_get_property;
port->new_port.set_property = post_video_set_property;
@@ -382,10 +393,11 @@ vo_frame_t *_x_post_intercept_video_frame(vo_frame_t *frame, post_video_port_t *
port->new_frame->free ? port->new_frame->free : post_frame_free;
new_frame->dispose =
port->new_frame->dispose ? port->new_frame->dispose : post_frame_dispose;
-
- if (!port->new_frame->draw) {
+
+ if (!port->new_frame->draw || (port->route_preprocessing_procs && port->route_preprocessing_procs(port, frame))) {
/* draw will most likely modify the frame, so the decoder
- * should only request preprocessing when there is no new draw */
+ * should only request preprocessing when there is no new draw
+ * but route_preprocessing_procs() can override this decision */
if (frame->proc_frame && !new_frame->proc_frame)
new_frame->proc_frame = post_frame_proc_frame;
if (frame->proc_slice && !new_frame->proc_slice)
@@ -702,6 +714,7 @@ static int post_audio_rewire(xine_post_out_t *output_gen, void *data) {
if (!new_port)
return 0;
+ this->running_ticket->lock_port_rewiring(this->running_ticket, -1);
this->running_ticket->revoke(this->running_ticket, 1);
if (input_port->original_port->status(input_port->original_port, input_port->stream,
@@ -712,6 +725,7 @@ static int post_audio_rewire(xine_post_out_t *output_gen, void *data) {
input_port->original_port = new_port;
this->running_ticket->issue(this->running_ticket, 1);
+ this->running_ticket->unlock_port_rewiring(this->running_ticket);
return 1;
}
diff --git a/src/xine-engine/post.h b/src/xine-engine/post.h
index bcdc3c54b..9f82ffaa1 100644
--- a/src/xine-engine/post.h
+++ b/src/xine-engine/post.h
@@ -92,9 +92,6 @@ struct post_plugin_s {
*/
void (*dispose) (post_plugin_t *this);
- /* has dispose been called */
- int dispose_pending;
-
/* plugins don't have to init the stuff below */
/*
@@ -119,6 +116,9 @@ struct post_plugin_s {
/* used by plugin loader */
void *node;
+
+ /* has dispose been called */
+ int dispose_pending;
};
/* helper function to initialize a post_plugin_t */
@@ -180,6 +180,13 @@ struct post_video_port_s {
/* the new frame function pointers */
vo_frame_t *new_frame;
+ /* if you want to decide yourself, whether the preprocessing functions
+ * should still be routed when draw is intercepted, fill in this
+ * function; _x_post_intercept_video_frame() acts as a template method
+ * and asks your function; return a boolean; the default is _not_ to
+ * route preprocessing functions when draw is intercepted */
+ int (*route_preprocessing_procs)(post_video_port_t *self, vo_frame_t *frame);
+
/* if you want to decide yourself, whether the overlay manager should
* be intercepted, fill in this function; get_overlay_manager() acts as
* a template method and asks your function; return a boolean;
@@ -290,16 +297,16 @@ struct post_audio_port_s {
/* the original port to call its functions from inside yours */
xine_audio_port_t *original_port;
- /* usage counter: how many objects are floating around that need
- * these pointers to exist */
- int usage_count;
- pthread_mutex_t usage_lock;
-
/* the stream we are being fed by; NULL means no stream is connected;
* this may be an anonymous stream */
xine_stream_t *stream;
- /* some values remembered by port->open() */
+ pthread_mutex_t usage_lock;
+ /* usage counter: how many objects are floating around that need
+ * these pointers to exist */
+ int usage_count;
+
+ /* some values remembered by (port->open) () */
uint32_t bits;
uint32_t rate;
uint32_t mode;
diff --git a/src/xine-engine/refcounter.h b/src/xine-engine/refcounter.h
index 640366b1f..739a6ad62 100644
--- a/src/xine-engine/refcounter.h
+++ b/src/xine-engine/refcounter.h
@@ -31,9 +31,9 @@
typedef struct {
pthread_mutex_t lock;
- int count;
void* object; /* referenced object */
void (*destructor)(void *); /* object destructor */
+ int count;
} refcounter_t;
typedef void (*refcounter_destructor)(void*);
diff --git a/src/xine-engine/scratch.c b/src/xine-engine/scratch.c
index 67281b041..ddca0cfaf 100644
--- a/src/xine-engine/scratch.c
+++ b/src/xine-engine/scratch.c
@@ -108,15 +108,11 @@ static void scratch_dispose (scratch_buffer_t *this) {
scratch_buffer_t *_x_new_scratch_buffer (int num_lines) {
scratch_buffer_t *this;
- int i;
this = xine_xmalloc (sizeof (scratch_buffer_t));
- this->lines = xine_xmalloc (sizeof (char *) * (num_lines + 1));
- this->ordered = xine_xmalloc (sizeof (char *) * (num_lines + 1));
-
- for (i = 0; i <= num_lines; i++)
- this->lines[i] = this->ordered[i] = NULL;
+ this->lines = xine_xcalloc ((num_lines + 1), sizeof(char*));
+ this->ordered = xine_xcalloc ((num_lines + 1), sizeof(char*));
this->scratch_printf = scratch_printf;
this->get_content = scratch_get_content;
diff --git a/src/xine-engine/spu.c b/src/xine-engine/spu.c
new file mode 100644
index 000000000..813300fb0
--- /dev/null
+++ b/src/xine-engine/spu.c
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2007 the xine project
+ *
+ * This file is part of xine, a free video player.
+ *
+ * xine is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * xine is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
+
+#include "xine_internal.h"
+#include "spu.h"
+
+#define BLACK_OPACITY 67
+#define COLOUR_OPACITY 100
+
+static void no_op (void *user_data, xine_cfg_entry_t *entry)
+{
+}
+
+void _x_spu_misc_init (xine_t *this)
+{
+ this->config->register_range (this->config, "subtitles.bitmap.black_opacity",
+ BLACK_OPACITY, 0, 100,
+ _("opacity for the black parts of bitmapped subtitles"),
+ NULL,
+ 10, no_op, NULL);
+ this->config->register_range (this->config, "subtitles.bitmap.colour_opacity",
+ COLOUR_OPACITY, 0, 100,
+ _("opacity for the colour parts of bitmapped subtitles"),
+ NULL,
+ 10, no_op, NULL);
+}
+
+void _x_spu_get_opacity (xine_t *this, xine_spu_opacity_t *opacity)
+{
+ cfg_entry_t *entry;
+
+ entry = this->config->lookup_entry (this->config, "subtitles.bitmap.black_opacity");
+ opacity->black = entry ? entry->num_value : BLACK_OPACITY;
+ entry = this->config->lookup_entry (this->config, "subtitles.bitmap.colour_opacity");
+ opacity->colour = entry ? entry->num_value : COLOUR_OPACITY;
+}
+
+int _x_spu_calculate_opacity (const clut_t *clut, uint8_t trans, const xine_spu_opacity_t *opacity)
+{
+ int value = (clut->y == 0 || (clut->y == 16 && clut->cb == 128 && clut->cr == 128))
+ ? opacity->black
+ : opacity->colour;
+ return value * (255 - trans) / 100;
+}
diff --git a/src/xine-engine/spu.h b/src/xine-engine/spu.h
new file mode 100644
index 000000000..daba7866b
--- /dev/null
+++ b/src/xine-engine/spu.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2007 the xine project
+ *
+ * This file is part of xine, a free video player.
+ *
+ * xine is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * xine is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
+
+#ifndef XINE_UTILS_SPU_H
+#define XINE_UTILS_SPU_H
+
+#ifndef XINE_PROTECTED
+#define XINE_PROTECTED
+#endif
+
+typedef struct xine_spu_opacity_s xine_spu_opacity_t;
+
+struct xine_spu_opacity_s {
+ uint8_t black, colour;
+};
+
+void _x_spu_misc_init (xine_t *);
+
+void _x_spu_get_opacity (xine_t *, xine_spu_opacity_t *) XINE_PROTECTED;
+
+/* in: trans = 0..255, 0=opaque
+ * out: 0..255, 0=transparent
+ */
+int _x_spu_calculate_opacity (const clut_t *, uint8_t trans, const xine_spu_opacity_t *) XINE_PROTECTED;
+
+#endif
diff --git a/src/xine-engine/video_decoder.c b/src/xine-engine/video_decoder.c
index fee75ec76..3d39b4550 100644
--- a/src/xine-engine/video_decoder.c
+++ b/src/xine-engine/video_decoder.c
@@ -28,6 +28,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#define XINE_ENGINE_INTERNAL
@@ -110,6 +111,15 @@ static void *video_decoder_loop (void *stream_gen) {
int prof_video_decode = -1;
int prof_spu_decode = -1;
uint32_t buftype_unknown = 0;
+
+#ifndef WIN32
+ /* nice(-value) will fail silently for normal users.
+ * however when running as root this may provide smoother
+ * playback. follow the link for more information:
+ * http://cambuca.ldhs.cetuc.puc-rio.br/~miguel/multimedia_sim/
+ */
+ nice(-1);
+#endif /* WIN32 */
if (prof_video_decode == -1)
prof_video_decode = xine_profiler_allocate_slot ("video decoder");
diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c
index 2a3ee1980..eeade3f48 100644
--- a/src/xine-engine/video_out.c
+++ b/src/xine-engine/video_out.c
@@ -71,6 +71,7 @@ typedef struct {
vo_frame_t *first;
vo_frame_t *last;
int num_buffers;
+ int num_buffers_max;
int locked_for_read;
pthread_mutex_t mutex;
@@ -128,9 +129,14 @@ typedef struct {
int current_width, current_height;
int64_t current_duration;
+ int frame_drop_limit_max;
int frame_drop_limit;
int frame_drop_cpt;
+ int frame_drop_suggested;
int crop_left, crop_right, crop_top, crop_bottom;
+ pthread_mutex_t trigger_drawing_mutex;
+ pthread_cond_t trigger_drawing_cond;
+ int trigger_drawing;
} vos_t;
@@ -144,9 +150,11 @@ static img_buf_fifo_t *vo_new_img_buf_queue () {
queue = (img_buf_fifo_t *) xine_xmalloc (sizeof (img_buf_fifo_t));
if( queue ) {
- queue->first = NULL;
- queue->last = NULL;
- queue->num_buffers = 0;
+ queue->first = NULL;
+ queue->last = NULL;
+ queue->num_buffers = 0;
+ queue->num_buffers_max = 0;
+
queue->locked_for_read = 0;
pthread_mutex_init (&queue->mutex, NULL);
pthread_cond_init (&queue->not_empty, NULL);
@@ -173,6 +181,8 @@ static void vo_append_to_img_buf_queue_int (img_buf_fifo_t *queue,
}
queue->num_buffers++;
+ if (queue->num_buffers_max < queue->num_buffers)
+ queue->num_buffers_max = queue->num_buffers;
pthread_cond_signal (&queue->not_empty);
}
@@ -213,14 +223,15 @@ static vo_frame_t *vo_remove_from_img_buf_queue_int (img_buf_fifo_t *queue, int
if( width && height ) {
if( !img ) {
- if( queue->num_buffers == 1 && !blocking) {
+ if( queue->num_buffers == 1 && !blocking && queue->num_buffers_max > 8) {
/* non-blocking and only a single frame on fifo with different
* format -> ignore it (give another chance of a frame format hit)
+ * only if we have a lot of buffers at all.
*/
lprintf("frame format mismatch - will wait another frame\n");
} else {
- /* we have at least 2 frames on fifo but they don't match ->
- * give up. return whatever we got.
+ /* we have just a limited number of buffers or at least 2 frames
+ * on fifo but they don't match -> give up. return whatever we got.
*/
img = queue->first;
lprintf("frame format miss (%d/%d)\n", i, queue->num_buffers);
@@ -467,28 +478,46 @@ static int vo_frame_draw (vo_frame_t *img, xine_stream_t *stream) {
duration = img->duration;
/* Frame dropping slow start:
- * The engine starts to drop frames if there is less than frame_drop_limit
+ * The engine starts to drop frames if there are less than frame_drop_limit
* frames in advance. There might be a problem just after a seek because
* there is no frame in advance yet.
* The following code increases progressively the frame_drop_limit (-2 -> 3)
* after a seek to give a chance to the engine to display the first frames
- * smootly before starting to drop frames if the decoder is really too
+ * smoothly before starting to drop frames if the decoder is really too
* slow.
+ * The above numbers are the result of frame_drop_limit_max beeing 3. They
+ * will be (-4 -> 1) when frame_drop_limit_max is only 1. This maximum value
+ * depends on the number of video buffers which the output device provides.
*/
if (stream && stream->first_frame_flag == 2)
this->frame_drop_cpt = 10;
if (this->frame_drop_cpt) {
- this->frame_drop_limit = 3 - (this->frame_drop_cpt / 2);
+ this->frame_drop_limit = this->frame_drop_limit_max - (this->frame_drop_cpt / 2);
this->frame_drop_cpt--;
}
frames_to_skip = ((-1 * diff) / duration + this->frame_drop_limit) * 2;
/* do not skip decoding until output fifo frames are consumed */
- if (this->display_img_buf_queue->num_buffers > this->frame_drop_limit ||
+ if (this->display_img_buf_queue->num_buffers >= this->frame_drop_limit ||
frames_to_skip < 0)
frames_to_skip = 0;
+ /* Do not drop frames immediately, but remember this as suggestion and give
+ * decoder a further chance to supply frames.
+ * This avoids unnecessary frame drops in situations where there is only
+ * a very little number of image buffers, e. g. when using xxmc.
+ */
+ if (this->frame_drop_suggested && frames_to_skip == 0)
+ this->frame_drop_suggested = 0;
+
+ if (frames_to_skip > 0) {
+ if (!this->frame_drop_suggested) {
+ this->frame_drop_suggested = 1;
+ frames_to_skip = 0;
+ }
+ }
+
lprintf ("delivery diff : %" PRId64 ", current vpts is %" PRId64 ", %d frames to skip\n",
diff, cur_vpts, frames_to_skip);
@@ -1043,6 +1072,32 @@ static void check_redraw_needed (vos_t *this, int64_t vpts) {
this->redraw_needed = 1;
}
+static int interruptable_sleep(vos_t *this, int usec_to_sleep)
+{
+ int timedout = 0;
+
+ struct timeval now;
+ gettimeofday(&now, 0);
+
+ pthread_mutex_lock (&this->trigger_drawing_mutex);
+ if (!this->trigger_drawing) {
+ struct timespec abstime;
+ abstime.tv_sec = now.tv_sec + usec_to_sleep / 1000000;
+ abstime.tv_nsec = now.tv_usec * 1000 + (usec_to_sleep % 1000000) * 1000;
+
+ if (abstime.tv_nsec > 1000000000) {
+ abstime.tv_nsec -= 1000000000;
+ abstime.tv_sec++;
+ }
+
+ timedout = pthread_cond_timedwait(&this->trigger_drawing_cond, &this->trigger_drawing_mutex, &abstime);
+ }
+ this->trigger_drawing = 0;
+ pthread_mutex_unlock (&this->trigger_drawing_mutex);
+
+ return timedout;
+}
+
/* special loop for paused mode
* needed to update screen due overlay changes, resize, window
* movement, brightness adjusting etc.
@@ -1088,7 +1143,7 @@ static void paused_loop( vos_t *this, int64_t vpts )
}
pthread_mutex_unlock( &this->free_img_buf_queue->mutex );
- xine_usec_sleep (20000);
+ interruptable_sleep(this, 20000);
pthread_mutex_lock( &this->free_img_buf_queue->mutex );
}
@@ -1218,7 +1273,10 @@ static void *video_out_loop (void *this_gen) {
"video_out: vpts/clock error, next_vpts=%" PRId64 " cur_vpts=%" PRId64 "\n", next_frame_vpts,vpts);
if (usec_to_sleep > 0)
- xine_usec_sleep (usec_to_sleep);
+ {
+ if (0 == interruptable_sleep(this, usec_to_sleep))
+ break;
+ }
if (this->discard_frames)
break;
@@ -1601,6 +1659,9 @@ static void vo_exit (xine_video_port_t *this_gen) {
free (this->free_img_buf_queue);
free (this->display_img_buf_queue);
+ pthread_cond_destroy(&this->trigger_drawing_cond);
+ pthread_mutex_destroy(&this->trigger_drawing_mutex);
+
free (this);
}
@@ -1670,6 +1731,15 @@ static void vo_flush (xine_video_port_t *this_gen) {
}
}
+static void vo_trigger_drawing (xine_video_port_t *this_gen) {
+ vos_t *this = (vos_t *) this_gen;
+
+ pthread_mutex_lock (&this->trigger_drawing_mutex);
+ this->trigger_drawing = 1;
+ pthread_cond_signal (&this->trigger_drawing_cond);
+ pthread_mutex_unlock (&this->trigger_drawing_mutex);
+}
+
/* crop_frame() will allocate a new frame to copy in the given image
* while cropping. maybe someday this will be an automatic post plugin.
*/
@@ -1765,6 +1835,7 @@ xine_video_port_t *_x_vo_new_port (xine_t *xine, vo_driver_t *driver, int grabon
this->vo.enable_ovl = vo_enable_overlay;
this->vo.get_overlay_manager = vo_get_overlay_manager;
this->vo.flush = vo_flush;
+ this->vo.trigger_drawing = vo_trigger_drawing;
this->vo.get_property = vo_get_property;
this->vo.set_property = vo_set_property;
this->vo.status = vo_status;
@@ -1784,8 +1855,6 @@ xine_video_port_t *_x_vo_new_port (xine_t *xine, vo_driver_t *driver, int grabon
this->overlay_source->init (this->overlay_source);
this->overlay_enabled = 1;
- this->frame_drop_limit = 3;
- this->frame_drop_cpt = 0;
/* default number of video frames from config */
num_frame_buffers = xine->config->register_num (xine->config,
@@ -1806,6 +1875,24 @@ xine_video_port_t *_x_vo_new_port (xine_t *xine, vo_driver_t *driver, int grabon
if (num_frame_buffers<5)
num_frame_buffers = 5;
+ /* Choose a frame_drop_limit which matches num_frame_buffers.
+ * xxmc for example supplies only 8 buffers. 2 are occupied by
+ * MPEG2 decoding, further 2 for displaying and the remaining 4 can
+ * hardly be filled all the time.
+ * The below constants reserve buffers for decoding, displaying and
+ * buffer fluctuation.
+ * A frame_drop_limit_max below 1 will disable frame drops at all.
+ */
+ this->frame_drop_limit_max = num_frame_buffers - 2 - 2 - 1;
+ if (this->frame_drop_limit_max < 1)
+ this->frame_drop_limit_max = 1;
+ else if (this->frame_drop_limit_max > 3)
+ this->frame_drop_limit_max = 3;
+
+ this->frame_drop_limit = this->frame_drop_limit_max;
+ this->frame_drop_cpt = 0;
+ this->frame_drop_suggested = 0;
+
this->extra_info_base = calloc (num_frame_buffers,
sizeof(extra_info_t));
@@ -1842,6 +1929,9 @@ xine_video_port_t *_x_vo_new_port (xine_t *xine, vo_driver_t *driver, int grabon
"were not scheduled for display in time, xine sends a notification."),
20, NULL, NULL);
+ pthread_mutex_init(&this->trigger_drawing_mutex, NULL);
+ pthread_cond_init(&this->trigger_drawing_cond, NULL);
+ this->trigger_drawing = 0;
if (grabonly) {
diff --git a/src/xine-engine/video_out.h b/src/xine-engine/video_out.h
index 085752dd8..bd169acfe 100644
--- a/src/xine-engine/video_out.h
+++ b/src/xine-engine/video_out.h
@@ -130,6 +130,9 @@ struct vo_frame_s {
/* cropping to be done */
int crop_left, crop_right, crop_top, crop_bottom;
+ int lock_counter;
+ pthread_mutex_t mutex; /* protect access to lock_count */
+
/* extra info coming from input or demuxers */
extra_info_t *extra_info;
@@ -158,8 +161,6 @@ struct vo_frame_s {
* obs: changing anything here will require recompiling vo drivers
*/
struct vo_frame_s *next;
- int lock_counter;
- pthread_mutex_t mutex; /* protect access to lock_count */
int id; /* debugging - track this frame */
int is_first;
@@ -205,6 +206,9 @@ struct xine_video_port_s {
/* flush video_out fifo */
void (*flush) (xine_video_port_t *self);
+ /* trigger immediate drawing */
+ void (*trigger_drawing) (xine_video_port_t *self);
+
/* Get/Set video property
*
* See VO_PROP_* bellow
@@ -443,11 +447,12 @@ struct video_overlay_manager_s {
vo_driver_t *output, vo_frame_t *vo_img, int enabled);
};
-/*
- * build a video_out_port from
- * a given video driver
+/**
+ * @brief Build a video output port from a given video driver.
+ *
+ * @internal
*/
-xine_video_port_t *_x_vo_new_port (xine_t *xine, vo_driver_t *driver, int grabonly) XINE_PROTECTED;
+xine_video_port_t *_x_vo_new_port (xine_t *xine, vo_driver_t *driver, int grabonly);
#ifdef __cplusplus
}
diff --git a/src/xine-engine/video_overlay.h b/src/xine-engine/video_overlay.h
index 1e7a2bcca..5e3455461 100644
--- a/src/xine-engine/video_overlay.h
+++ b/src/xine-engine/video_overlay.h
@@ -38,7 +38,7 @@
#define MAX_OBJECTS 50
#define MAX_EVENTS 50
-#define MAX_SHOWING 16
+#define MAX_SHOWING (5 + 16)
#define OVERLAY_EVENT_NULL 0
#define OVERLAY_EVENT_SHOW 1
@@ -46,58 +46,23 @@
#define OVERLAY_EVENT_MENU_BUTTON 3
#define OVERLAY_EVENT_FREE_HANDLE 8 /* Frees a handle, previous allocated via get_handle */
-/* number of colors in the overlay palette. Currently limited to 256
- at most, because some alphablend functions use an 8-bit index into
- the palette. This should probably be classified as a bug. */
-/* FIXME: Also defines in video_out.h */
-#define OVL_PALETTE_SIZE 256
-
-typedef struct vo_buttons_s {
- int32_t type; /* 0:Button not valid,
- 1:Button Valid, no auto_action,
- 2:Button Valid, auto_action.
- */
-
- /* The following clipping coordinates are relative to the left upper corner
- * of the OVERLAY, not of the target FRAME. Please do not mix them up! */
- int32_t hili_top;
- int32_t hili_bottom;
- int32_t hili_left;
- int32_t hili_right;
- int32_t up;
- int32_t down;
- int32_t left;
- int32_t right;
- uint32_t select_color[OVL_PALETTE_SIZE];
- uint8_t select_trans[OVL_PALETTE_SIZE];
- xine_event_t select_event;
- uint32_t active_color[OVL_PALETTE_SIZE];
- uint8_t active_trans[OVL_PALETTE_SIZE];
- xine_event_t active_event;
- int32_t hili_rgb_clut; /* true if clut was converted to rgb*/
- /* FIXME: Probably not needed ^^^ */
-} vo_buttons_t;
-
typedef struct video_overlay_object_s {
int32_t handle; /* Used to match Show and Hide events. */
uint32_t object_type; /* 0=Subtitle, 1=Menu */
int64_t pts; /* Needed for Menu button compares */
vo_overlay_t *overlay; /* The image data. */
- uint32_t palette_type; /* 1 Y'CrCB, 2 R'G'B' */
uint32_t *palette; /* If NULL, no palette contained in this event. */
- int32_t buttonN; /* Current highlighed button. 0 means no info on which button to higlight */
- /* -1 means don't use this button info. */
- vo_buttons_t button[32]; /* Info regarding each button on the overlay */
+ uint32_t palette_type; /* 1 Y'CrCB, 2 R'G'B' */
} video_overlay_object_t;
/* This will hold all details of an event item, needed for event queue to function */
typedef struct video_overlay_event_s {
- uint32_t event_type; /* Show SPU, Show OSD, Hide etc. */
int64_t vpts; /* Time when event will action. 0 means action now */
/* Once video_out blend_yuv etc. can take rle_elem_t with Colour, blend and length information.
* we can remove clut and blend from this structure.
* This will allow for many more colours for OSD.
*/
+ uint32_t event_type; /* Show SPU, Show OSD, Hide etc. */
video_overlay_object_t object; /* The image data. */
} video_overlay_event_t;
diff --git a/src/xine-engine/vo_scale.h b/src/xine-engine/vo_scale.h
index 917b6c99e..793ab1eb7 100644
--- a/src/xine-engine/vo_scale.h
+++ b/src/xine-engine/vo_scale.h
@@ -100,6 +100,9 @@ struct vo_scale_s {
int gui_width, gui_height;
int gui_win_x, gui_win_y;
+ /* */
+ int force_redraw;
+
/*
* video + display pixel aspect
* One pixel of height 1 has this width
@@ -121,10 +124,6 @@ struct vo_scale_s {
int output_yoffset;
- /* */
- int force_redraw;
-
-
/* gui callbacks */
void *user_data;
diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c
index 01ca48aa2..2d3b32176 100644
--- a/src/xine-engine/xine.c
+++ b/src/xine-engine/xine.c
@@ -47,6 +47,8 @@
#include <locale.h>
#endif
+#include <basedir.h>
+
#define LOG_MODULE "xine"
#define LOG_VERBOSE
/*
@@ -68,6 +70,7 @@
#include "metronom.h"
#include "configfile.h"
#include "osd.h"
+#include "spu.h"
#include "xineutils.h"
#include "compat.h"
@@ -294,8 +297,37 @@ static void ticket_revoke(xine_ticket_t *this, int atomic) {
pthread_mutex_unlock(&this->revoke_lock);
}
+static int ticket_lock_port_rewiring(xine_ticket_t *this, int ms_timeout) {
+
+ if (ms_timeout >= 0) {
+ struct timespec abstime;
+
+ struct timeval now;
+ gettimeofday(&now, 0);
+
+ abstime.tv_sec = now.tv_sec + ms_timeout / 1000;
+ abstime.tv_nsec = now.tv_usec * 1000 + (ms_timeout % 1000) * 1e6;
+
+ if (abstime.tv_nsec > 1e9) {
+ abstime.tv_nsec -= 1e9;
+ abstime.tv_sec++;
+ }
+
+ return (0 == pthread_mutex_timedlock(&this->port_rewiring_lock, &abstime));
+ }
+
+ pthread_mutex_lock(&this->port_rewiring_lock);
+ return 1;
+}
+
+static void ticket_unlock_port_rewiring(xine_ticket_t *this) {
+
+ pthread_mutex_unlock(&this->port_rewiring_lock);
+}
+
static void ticket_dispose(xine_ticket_t *this) {
+ pthread_mutex_destroy(&this->port_rewiring_lock);
pthread_mutex_destroy(&this->lock);
pthread_mutex_destroy(&this->revoke_lock);
pthread_cond_destroy(&this->issued);
@@ -316,12 +348,15 @@ static xine_ticket_t *ticket_init(void) {
port_ticket->renew = ticket_renew;
port_ticket->issue = ticket_issue;
port_ticket->revoke = ticket_revoke;
+ port_ticket->lock_port_rewiring = ticket_lock_port_rewiring;
+ port_ticket->unlock_port_rewiring = ticket_unlock_port_rewiring;
port_ticket->dispose = ticket_dispose;
port_ticket->holder_thread_count = XINE_MAX_TICKET_HOLDER_THREADS;
port_ticket->holder_threads = calloc(XINE_MAX_TICKET_HOLDER_THREADS,sizeof(*port_ticket->holder_threads));
pthread_mutex_init(&port_ticket->lock, NULL);
pthread_mutex_init(&port_ticket->revoke_lock, NULL);
+ pthread_mutex_init(&port_ticket->port_rewiring_lock, NULL);
pthread_cond_init(&port_ticket->issued, NULL);
pthread_cond_init(&port_ticket->revoked, NULL);
@@ -515,6 +550,7 @@ static int stream_rewire_audio(xine_post_out_t *output, void *data)
if (!data)
return 0;
+ stream->xine->port_ticket->lock_port_rewiring(stream->xine->port_ticket, -1);
stream->xine->port_ticket->revoke(stream->xine->port_ticket, 1);
if (stream->audio_out->status(stream->audio_out, stream, &bits, &rate, &mode)) {
@@ -525,6 +561,7 @@ static int stream_rewire_audio(xine_post_out_t *output, void *data)
stream->audio_out = new_port;
stream->xine->port_ticket->issue(stream->xine->port_ticket, 1);
+ stream->xine->port_ticket->unlock_port_rewiring(stream->xine->port_ticket);
return 1;
}
@@ -539,6 +576,7 @@ static int stream_rewire_video(xine_post_out_t *output, void *data)
if (!data)
return 0;
+ stream->xine->port_ticket->lock_port_rewiring(stream->xine->port_ticket, -1);
stream->xine->port_ticket->revoke(stream->xine->port_ticket, 1);
if (stream->video_out->status(stream->video_out, stream, &width, &height, &img_duration)) {
@@ -549,6 +587,7 @@ static int stream_rewire_video(xine_post_out_t *output, void *data)
stream->video_out = new_port;
stream->xine->port_ticket->issue(stream->xine->port_ticket, 1);
+ stream->xine->port_ticket->unlock_port_rewiring(stream->xine->port_ticket);
return 1;
}
@@ -692,9 +731,10 @@ xine_stream_t *xine_stream_new (xine_t *this,
/*
* osd
*/
- if (vo)
+ if (vo) {
+ _x_spu_misc_init (this);
stream->osd_renderer = _x_osd_renderer_init(stream);
- else
+ } else
stream->osd_renderer = NULL;
/*
@@ -1496,6 +1536,8 @@ void xine_exit (xine_t *this) {
WSACleanup();
#endif
+ xdgFreeHandle(this->basedir_handle);
+
free (this);
}
@@ -1621,8 +1663,11 @@ static void config_save_cb (void *this_gen, xine_cfg_entry_t *entry) {
}
void xine_init (xine_t *this) {
- static const char *demux_strategies[] = {"default", "reverse", "content",
- "extension", NULL};
+ static const char *const demux_strategies[] = {"default", "reverse", "content",
+ "extension", NULL};
+
+ /* First of all, initialise libxdg-basedir as it's used by plugins. */
+ this->basedir_handle = xdgAllocHandle();
/* initialize color conversion tables and functions */
init_yuv_conversion();
@@ -2055,6 +2100,9 @@ const char *const *xine_get_log_names (xine_t *this) {
static inline void check_log_alloc (xine_t *this, int buf)
{
+ if ( this->log_buffers[buf] )
+ return;
+
pthread_mutex_lock (&this->log_lock);
if ( ! this->log_buffers[buf] )
@@ -2154,3 +2202,83 @@ int _x_query_buffer_usage(xine_stream_t *stream, int *num_video_buffers, int *nu
return ticket_acquired != 0;
}
+
+int _x_lock_port_rewiring(xine_t *xine, int ms_timeout)
+{
+ return xine->port_ticket->lock_port_rewiring(xine->port_ticket, ms_timeout);
+}
+
+void _x_unlock_port_rewiring(xine_t *xine)
+{
+ xine->port_ticket->unlock_port_rewiring(xine->port_ticket);
+}
+
+int _x_lock_frontend(xine_stream_t *stream, int ms_to_time_out)
+{
+ if (ms_to_time_out >= 0) {
+ struct timespec abstime;
+
+ struct timeval now;
+ gettimeofday(&now, 0);
+
+ abstime.tv_sec = now.tv_sec + ms_to_time_out / 1000;
+ abstime.tv_nsec = now.tv_usec * 1000 + (ms_to_time_out % 1000) * 1e6;
+
+ if (abstime.tv_nsec > 1e9) {
+ abstime.tv_nsec -= 1e9;
+ abstime.tv_sec++;
+ }
+
+ return (0 == pthread_mutex_timedlock(&stream->frontend_lock, &abstime));
+ }
+
+ pthread_mutex_lock(&stream->frontend_lock);
+ return 1;
+}
+
+void _x_unlock_frontend(xine_stream_t *stream)
+{
+ pthread_mutex_unlock(&stream->frontend_lock);
+}
+
+int _x_query_unprocessed_osd_events(xine_stream_t *stream)
+{
+ video_overlay_manager_t *ovl;
+ int redraw_needed;
+
+ if (!stream->xine->port_ticket->acquire_nonblocking(stream->xine->port_ticket, 1))
+ return -1;
+
+ ovl = stream->video_out->get_overlay_manager(stream->video_out);
+ redraw_needed = ovl->redraw_needed(ovl, 0);
+
+ if (redraw_needed)
+ stream->video_out->trigger_drawing(stream->video_out);
+
+ stream->xine->port_ticket->release_nonblocking(stream->xine->port_ticket, 1);
+
+ return redraw_needed;
+}
+
+int _x_demux_seek(xine_stream_t *stream, off_t start_pos, int start_time, int playing)
+{
+ if (!stream->demux_plugin)
+ return -1;
+ return stream->demux_plugin->seek(stream->demux_plugin, start_pos, start_time, playing);
+}
+
+int _x_continue_stream_processing(xine_stream_t *stream)
+{
+ return stream->status != XINE_STATUS_STOP
+ && stream->status != XINE_STATUS_QUIT;
+}
+
+void _x_trigger_relaxed_frame_drop_mode(xine_stream_t *stream)
+{
+ stream->first_frame_flag = 2;
+}
+
+void _x_reset_relaxed_frame_drop_mode(xine_stream_t *stream)
+{
+ stream->first_frame_flag = 1;
+}
diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h
index 5523001ca..e4af27b92 100644
--- a/src/xine-engine/xine_internal.h
+++ b/src/xine-engine/xine_internal.h
@@ -72,7 +72,6 @@ extern "C" {
# include <xine/alphablend.h>
#endif
-
#define XINE_MAX_EVENT_LISTENERS 50
#define XINE_MAX_EVENT_TYPES 100
#define XINE_MAX_TICKET_HOLDER_THREADS 64
@@ -104,19 +103,22 @@ struct xine_s {
plugin_catalog_t *plugin_catalog;
+ int verbosity;
+
int demux_strategy;
char *save_path;
/* log output that may be presented to the user */
scratch_buffer_t *log_buffers[XINE_LOG_NUM];
- int verbosity;
-
xine_list_t *streams;
pthread_mutex_t streams_lock;
metronom_clock_t *clock;
+ /** Handle for libxdg-basedir functions. It's actually an xdgHandle. */
+ void * basedir_handle;
+
#ifdef XINE_ENGINE_INTERNAL
xine_ticket_t *port_ticket;
pthread_mutex_t log_lock;
@@ -169,6 +171,9 @@ struct xine_ticket_s {
* be used in combination with acquire_nonblocking() */
void (*release_nonblocking)(xine_ticket_t *self, int irrevocable);
+ int (*lock_port_rewiring)(xine_ticket_t *self, int ms_timeout);
+ void (*unlock_port_rewiring)(xine_ticket_t *self);
+
void (*dispose)(xine_ticket_t *self);
pthread_mutex_t lock;
@@ -180,6 +185,7 @@ struct xine_ticket_s {
int pending_revocations;
int atomic_revoke;
pthread_t atomic_revoker_thread;
+ pthread_mutex_t port_rewiring_lock;
struct {
int count;
pthread_t holder;
@@ -199,9 +205,9 @@ struct xine_event_queue_s {
pthread_cond_t events_processed;
xine_stream_t *stream;
pthread_t *listener_thread;
+ void *user_data;
xine_event_listener_cb_t callback;
int callback_running;
- void *user_data;
};
/*
@@ -219,9 +225,6 @@ struct xine_stream_s {
/* demuxers use input_plugin to read data */
input_plugin_t *input_plugin;
- /* current content detection method, see METHOD_BY_xxx */
- int content_detection_method;
-
/* used by video decoders */
xine_video_port_t *video_out;
@@ -255,6 +258,9 @@ struct xine_stream_s {
int spu_channel_letterbox;
int spu_channel;
+ /* current content detection method, see METHOD_BY_xxx */
+ int content_detection_method;
+
#ifdef XINE_ENGINE_INTERNAL
/* these are private variables, plugins must not access them */
@@ -262,27 +268,38 @@ struct xine_stream_s {
/* lock controlling speed change access */
pthread_mutex_t speed_change_lock;
- int ignore_speed_change; /* speed changes during stop can be disastrous */
+ uint32_t ignore_speed_change:1; /*< speed changes during stop can be disastrous */
+ uint32_t video_thread_created:1;
+ uint32_t audio_thread_created:1;
+ uint32_t first_frame_flag:2;
+ uint32_t demux_action_pending:1;
+ uint32_t demux_thread_created:1;
+ uint32_t demux_thread_running:1;
+ uint32_t slave_is_subtitle:1; /*< ... and will be automaticaly disposed */
+ uint32_t emergency_brake:1; /*< something went really wrong and this stream must be
+ * stopped. usually due some fatal error on output
+ * layers as they cannot call xine_stop. */
+ uint32_t early_finish_event:1; /*< do not wait fifos get empty before sending event */
+ uint32_t gapless_switch:1; /*< next stream switch will be gapless */
input_class_t *eject_class;
demux_plugin_t *demux_plugin;
/* vo_driver_t *video_driver;*/
pthread_t video_thread;
- int video_thread_created;
video_decoder_t *video_decoder_plugin;
- int video_decoder_streamtype;
extra_info_t *video_decoder_extra_info;
+ int video_decoder_streamtype;
int video_channel;
+ uint32_t audio_track_map[50];
+ int audio_track_map_entries;
+
+ int audio_decoder_streamtype;
pthread_t audio_thread;
- int audio_thread_created;
audio_decoder_t *audio_decoder_plugin;
- int audio_decoder_streamtype;
extra_info_t *audio_decoder_extra_info;
- uint32_t audio_track_map[50];
- int audio_track_map_entries;
uint32_t audio_type;
/* *_user: -2 => off
-1 => auto (use *_auto value)
@@ -314,7 +331,6 @@ struct xine_stream_s {
char *meta_info[XINE_STREAM_INFO_MAX];
/* seeking slowdown */
- int first_frame_flag;
pthread_mutex_t first_frame_lock;
pthread_cond_t first_frame_reached;
@@ -332,34 +348,25 @@ struct xine_stream_s {
/* demux thread stuff */
pthread_t demux_thread;
- int demux_thread_created;
- int demux_thread_running;
pthread_mutex_t demux_lock;
- int demux_action_pending;
pthread_mutex_t demux_mutex; /* used in _x_demux_... functions to synchronize order of pairwise A/V buffer operations */
extra_info_t *current_extra_info;
pthread_mutex_t current_extra_info_lock;
int video_seek_count;
- xine_post_out_t video_source;
- xine_post_out_t audio_source;
-
- int slave_is_subtitle; /* ... and will be automaticaly disposed */
+ int delay_finish_event; /* delay event in 1/10 sec units. 0=>no delay, -1=>forever */
+
int slave_affection; /* what operations need to be propagated down to the slave? */
int err;
+ xine_post_out_t video_source;
+ xine_post_out_t audio_source;
+
broadcaster_t *broadcaster;
refcounter_t *refcounter;
-
- int emergency_brake; /* something went really wrong and this stream must be
- * stopped. usually due some fatal error on output
- * layers as they cannot call xine_stop. */
- int early_finish_event; /* do not wait fifos get empty before sending event */
- int gapless_switch; /* next stream switch will be gapless */
- int delay_finish_event; /* delay event in 1/10 sec units. 0=>no delay, -1=>forever */
#endif
};
@@ -373,6 +380,15 @@ struct xine_stream_s {
*/
int _x_query_buffer_usage(xine_stream_t *stream, int *num_video_buffers, int *num_audio_buffers, int *num_video_frames, int *num_audio_frames) XINE_PROTECTED;
+int _x_lock_port_rewiring(xine_t *xine, int ms_to_time_out) XINE_PROTECTED;
+void _x_unlock_port_rewiring(xine_t *xine) XINE_PROTECTED;
+int _x_lock_frontend(xine_stream_t *stream, int ms_to_time_out) XINE_PROTECTED;
+void _x_unlock_frontend(xine_stream_t *stream) XINE_PROTECTED;
+int _x_query_unprocessed_osd_events(xine_stream_t *stream) XINE_PROTECTED;
+int _x_demux_seek(xine_stream_t *stream, off_t start_pos, int start_time, int playing) XINE_PROTECTED;
+int _x_continue_stream_processing(xine_stream_t *stream) XINE_PROTECTED;
+void _x_trigger_relaxed_frame_drop_mode(xine_stream_t *stream) XINE_PROTECTED;
+void _x_reset_relaxed_frame_drop_mode(xine_stream_t *stream) XINE_PROTECTED;
void _x_handle_stream_end (xine_stream_t *stream, int non_user) XINE_PROTECTED;
diff --git a/src/xine-utils/Makefile.am b/src/xine-utils/Makefile.am
index 95de06b9e..10f1714f9 100644
--- a/src/xine-utils/Makefile.am
+++ b/src/xine-utils/Makefile.am
@@ -1,19 +1,33 @@
include $(top_srcdir)/misc/Makefile.common
-LIBTOOL = $(SHELL) $(top_builddir)/libtool
-noinst_LTLIBRARIES = libxineutils.la
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(X_CFLAGS) $(VISIBILITY_FLAG)
+AM_CPPFLAGS = -DXINE_LIBRARY_COMPILE
EXTRA_DIST = ppcasm_string.S ppc_asm.tmpl
-if PPC_ARCH
+noinst_HEADERS = ppcasm_string.h xine_check.h
+
+xineinclude_HEADERS = \
+ attributes.h \
+ compat.h \
+ xine_buffer.h \
+ xineutils.h \
+ xmllexer.h \
+ xmlparser.h \
+ list.h \
+ array.h \
+ sorted_array.h \
+ pool.h \
+ ring_buffer.h
+
+noinst_LTLIBRARIES = libxineutils.la
+
+if ARCH_PPC
if !HOST_OS_DARWIN
pppc_files = ppcasm_string.S
endif
endif
-AM_CFLAGS = $(X_CFLAGS) $(VISIBILITY_FLAG)
-AM_CPPFLAGS=-DXINE_LIBRARY_COMPILE
-
libxineutils_la_SOURCES = $(pppc_files) \
cpu_accel.c \
color.c \
@@ -31,20 +45,3 @@ libxineutils_la_SOURCES = $(pppc_files) \
sorted_array.c \
pool.c \
ring_buffer.c
-
-xineinclude_HEADERS = \
- attributes.h \
- compat.h \
- xine_buffer.h \
- xineutils.h \
- xmllexer.h \
- xmlparser.h \
- list.h \
- array.h \
- sorted_array.h \
- pool.h \
- ring_buffer.h
-
-
-noinst_HEADERS = ppcasm_string.h xine_check.h
-
diff --git a/src/xine-utils/attributes.h b/src/xine-utils/attributes.h
index f7f5a111c..a9be4792f 100644
--- a/src/xine-utils/attributes.h
+++ b/src/xine-utils/attributes.h
@@ -32,18 +32,6 @@
#define ATTR_ALIGN(align)
#endif
-/* disable GNU __attribute__ extension, when not compiling with GNU C */
-#if defined(__GNUC__) || defined (__ICC)
-#ifndef ATTRIBUTE_PACKED
-#define ATTRIBUTE_PACKED 1
-#endif
-#else
-#undef ATTRIBUTE_PACKED
-#ifndef __attribute__
-#define __attribute__(x) /**/
-#endif /* __attribute __*/
-#endif
-
#ifdef XINE_COMPILE
# include "configure.h"
#endif
@@ -83,4 +71,16 @@
# define XINE_FORMAT_PRINTF_ARG(fmt)
#endif
+#ifdef SUPPORT_ATTRIBUTE_PACKED
+# define XINE_PACKED __attribute__((packed))
+#else
+# define XINE_PACKED
+#endif
+
+#ifdef SUPPORT_ATTRIBUTE_MALLOC
+# define XINE_MALLOC __attribute__((__malloc__))
+#else
+# define XINE_MALLOC
+#endif
+
#endif /* ATTRIBUTE_H_ */
diff --git a/src/xine-utils/cpu_accel.c b/src/xine-utils/cpu_accel.c
index b32733fba..06ee90cd3 100644
--- a/src/xine-utils/cpu_accel.c
+++ b/src/xine-utils/cpu_accel.c
@@ -24,9 +24,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
-#include <signal.h>
-#include <setjmp.h>
+
+#if defined(HAVE_MLIB) && defined(MLIB_LAZYLOAD)
#include <dlfcn.h>
+#endif
#if defined (__SVR4) && defined (__sun)
#include <sys/systeminfo.h>
@@ -40,22 +41,32 @@
#include "xineutils.h"
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if defined(__i386__) || defined(__x86_64__)
+
+#ifndef __x86_64__
+#include <signal.h>
+#include <setjmp.h>
static jmp_buf sigill_return;
static void sigill_handler (int n) {
longjmp(sigill_return, 1);
}
+#endif
static uint32_t arch_accel (void)
{
uint32_t caps;
-#ifdef __x86_64__
+#if defined(__x86_64__) || \
+ ( defined(__SSE__) && defined(__SSE2__) && defined(__MMX__) )
/* No need to test for this on AMD64, we know what the
platform has. */
- caps = MM_ACCEL_X86_MMX | MM_ACCEL_X86_SSE | MM_ACCEL_X86_MMXEXT | MM_ACCEL_X86_SSE2;
+ caps = MM_ACCEL_X86_MMX | MM_ACCEL_X86_SSE | MM_ACCEL_X86_MMXEXT | MM_ACCEL_X86_SSE2
+# if defined(__3dNOW__)
+ | MM_ACCEL_X86_3DNOW
+# endif
+ ;
#else
#ifndef _MSC_VER
@@ -148,6 +159,9 @@ static uint32_t arch_accel (void)
caps = 0;
#endif /* _MSC_VER */
+#endif /* x86_64 or built-in options */
+
+#ifndef __x86_64__
/* test OS support for SSE */
if (caps & MM_ACCEL_X86_SSE) {
void (*old_sigill_handler)(int);
@@ -169,9 +183,12 @@ static uint32_t arch_accel (void)
return caps;
}
-#endif /* ARCH_X86 */
+#endif /* i386 or x86_64 */
#if defined(ARCH_PPC) && defined(ENABLE_ALTIVEC)
+#include <signal.h>
+#include <setjmp.h>
+
static sigjmp_buf jmpbuf;
static volatile sig_atomic_t canjump = 0;
@@ -256,6 +273,9 @@ static uint32_t arch_accel (void)
return flags;
}
#else
+#include <signal.h>
+#include <setjmp.h>
+
static sigjmp_buf jmpbuf;
static volatile sig_atomic_t canjump = 0;
@@ -326,7 +346,7 @@ uint32_t xine_mm_accel (void)
#endif
#endif
-#if defined(ARCH_X86) || defined(ARCH_X86_64) || (defined(ARCH_PPC) && defined(ENABLE_ALTIVEC)) || (defined(ARCH_SPARC) && defined(ENABLE_VIS))
+#if defined(__i386__) || defined(__x86_64__) || (defined(ARCH_PPC) && defined(ENABLE_ALTIVEC)) || (defined(ARCH_SPARC) && defined(ENABLE_VIS))
accel |= arch_accel();
#endif
diff --git a/src/xine-utils/memcpy.c b/src/xine-utils/memcpy.c
index 539f4c8dd..67645081e 100644
--- a/src/xine-utils/memcpy.c
+++ b/src/xine-utils/memcpy.c
@@ -383,8 +383,8 @@ static void *linux_kernel_memcpy(void *to, const void *from, size_t len) {
#endif /* ARCH_X86 */
static struct {
- char *name;
- void *(* function)(void *to, const void *from, size_t len);
+ char *const name;
+ void *(*const function)(void *to, const void *from, size_t len);
uint64_t time; /* This type could be used for non-MSC build too! */
@@ -461,7 +461,7 @@ void xine_probe_fast_memcpy(xine_t *xine)
char *buf1, *buf2;
int i, j, best;
int config_flags = -1;
- static const char *memcpy_methods[] = {
+ static const char *const memcpy_methods[] = {
"probe", "libc",
#if (defined(ARCH_X86) || defined(ARCH_X86_64)) && !defined(_MSC_VER)
"kernel", "mmx", "mmxext", "sse",
diff --git a/src/xine-utils/monitor.c b/src/xine-utils/monitor.c
index c0cfd6179..b19195065 100644
--- a/src/xine-utils/monitor.c
+++ b/src/xine-utils/monitor.c
@@ -41,13 +41,10 @@ static long profiler_calls[MAX_ID] ;
static const char *profiler_label[MAX_ID] ;
void xine_profiler_init () {
- int i;
- for (i=0; i<MAX_ID; i++) {
- profiler_times[i] = 0;
- profiler_start[i] = 0;
- profiler_calls[i] = 0;
- profiler_label[i] = NULL;
- }
+ memset(profiler_times, 0, sizeof(profiler_times));
+ memset(profiler_start, 0, sizeof(profiler_start));
+ memset(profiler_calls, 0, sizeof(profiler_calls));
+ memset(profiler_label, 0, sizeof(profiler_label));
}
int xine_profiler_allocate_slot (const char *label) {
diff --git a/src/xine-utils/utils.c b/src/xine-utils/utils.c
index fa0c11dbe..f79d2ebce 100644
--- a/src/xine-utils/utils.c
+++ b/src/xine-utils/utils.c
@@ -256,6 +256,27 @@ void *xine_xmalloc(size_t size) {
return ptr;
}
+/**
+ * @brief Wrapper around calloc() function.
+ * @param nmemb Number of elements to allocate
+ * @param size Size of each element to allocate
+ *
+ * This is a simple wrapper around calloc(), the only thing
+ * it does more than calloc() is outputting an error if
+ * the calloc fails (returning NULL).
+ */
+void *xine_xcalloc(size_t nmemb, size_t size) {
+ void *ptr;
+
+ if((ptr = calloc(nmemb, size)) == NULL) {
+ fprintf(stderr, "%s: calloc() failed: %s.\n",
+ __XINE_FUNCTION__, strerror(errno));
+ return NULL;
+ }
+
+ return ptr;
+}
+
void *xine_xmalloc_aligned(size_t alignment, size_t size, void **base) {
char *ptr;
@@ -453,38 +474,40 @@ void xine_usec_sleep(unsigned usec) {
/* print a hexdump of length bytes from the data given in buf */
-void xine_hexdump (const char *buf, int length) {
- int i,j;
- unsigned char c;
+void xine_hexdump (const void *buf_gen, int length) {
+ static const char separator[70] = "---------------------------------------------------------------------";
+
+ const uint8_t *const buf = (const uint8_t*)buf;
+ int j = 0;
/* printf ("Hexdump: %i Bytes\n", length);*/
- for(j=0; j<69; j++)
- printf ("-");
- printf ("\n");
+ puts(separator);
- j=0;
while(j<length) {
+ int i;
+ const int imax = (j+16 < length) ? (j+16) : length;
+
printf ("%04X ",j);
for (i=j; i<j+16; i++) {
if( i<length )
- printf ("%02X ", (unsigned char) buf[i]);
+ printf ("%02X ", buf[i]);
else
printf(" ");
}
- for (i=j;i<(j+16<length?j+16:length);i++) {
- c=buf[i];
+
+ for (i=j; i < imax; i++) {
+ uint8_t c = buf[i];
if ((c>=32) && (c<127))
- printf ("%c", c);
- else
- printf (".");
+ c = '.';
+
+ fputc(c, stdout);
}
j=i;
- printf("\n");
+
+ fputc('\n', stdout);
}
- for(j=0; j<69; j++)
- printf("-");
- printf("\n");
+ puts(separator);
}
diff --git a/src/xine-utils/xineutils.h b/src/xine-utils/xineutils.h
index 03c5f689a..980586b7d 100644
--- a/src/xine-utils/xineutils.h
+++ b/src/xine-utils/xineutils.h
@@ -624,11 +624,9 @@ void xine_profiler_print_results (void) XINE_PROTECTED;
* Allocate and clean memory size_t 'size', then return the pointer
* to the allocated memory.
*/
-#if !defined(__GNUC__) || __GNUC__ < 3
-void *xine_xmalloc(size_t size) XINE_PROTECTED;
-#else
-void *xine_xmalloc(size_t size) __attribute__ ((__malloc__)) XINE_PROTECTED;
-#endif
+void *xine_xmalloc(size_t size) XINE_MALLOC XINE_PROTECTED;
+
+void *xine_xcalloc(size_t nmemb, size_t size) XINE_MALLOC XINE_PROTECTED;
/*
* Same as above, but memory is aligned to 'alignement'.
@@ -786,7 +784,7 @@ extern void yuy2_to_yuy2
int width, int height) XINE_PROTECTED;
/* print a hexdump of the given data */
-void xine_hexdump (const char *buf, int length) XINE_PROTECTED;
+void xine_hexdump (const void *buf, int length) XINE_PROTECTED;
/*
* Optimization macros for conditions
diff --git a/src/xine-utils/xmllexer.c b/src/xine-utils/xmllexer.c
index 754a006f9..c0f314699 100644
--- a/src/xine-utils/xmllexer.c
+++ b/src/xine-utils/xmllexer.c
@@ -41,16 +41,19 @@
#include <stdlib.h>
/* private constants*/
-#define NORMAL 0 /* normal lex mode */
-#define DATA 1 /* data lex mode */
/* private global variables */
static const char * lexbuf;
static int lexbuf_size = 0;
static int lexbuf_pos = 0;
-static int lex_mode = NORMAL;
static int in_comment = 0;
+static enum {
+ NORMAL,
+ DATA,
+ CDATA,
+} lex_mode = NORMAL;
+
void lexer_init(const char * buf, int size) {
lexbuf = buf;
lexbuf_size = size;
@@ -61,83 +64,102 @@ void lexer_init(const char * buf, int size) {
lprintf("buffer length %d\n", size);
}
+typedef enum {
+ STATE_UNKNOWN = -1,
+ STATE_IDLE,
+ STATE_EOL,
+ STATE_SEPAR,
+ STATE_T_M_START,
+ STATE_T_M_STOP_1,
+ STATE_T_M_STOP_2,
+ STATE_T_EQUAL,
+ STATE_T_STRING_SINGLE,
+ STATE_T_STRING_DOUBLE,
+ STATE_T_COMMENT,
+ STATE_T_TI_STOP,
+ STATE_T_DASHDASH,
+ STATE_T_C_STOP,
+ STATE_IDENT /* must be last */
+} lexer_state_t;
+
int lexer_get_token(char * tok, int tok_size) {
int tok_pos = 0;
- int state = 0;
+ lexer_state_t state = STATE_IDLE;
char c;
if (tok) {
while ((tok_pos < tok_size) && (lexbuf_pos < lexbuf_size)) {
c = lexbuf[lexbuf_pos];
- lprintf("c=%c, state=%d, in_comment=%d\n", c, state, in_comment);
+ lprintf("c=%c, state=%d, lex_mode=%d, in_comment=%d\n", c, state, lex_mode, in_comment);
- if (lex_mode == NORMAL) {
- /* normal mode */
+ switch (lex_mode) {
+ case NORMAL:
switch (state) {
/* init state */
- case 0:
+ case STATE_IDLE:
switch (c) {
case '\n':
case '\r':
- state = 1;
+ state = STATE_EOL;
tok[tok_pos] = c;
tok_pos++;
break;
case ' ':
case '\t':
- state = 2;
+ state = STATE_SEPAR;
tok[tok_pos] = c;
tok_pos++;
break;
case '<':
- state = 3;
+ state = STATE_T_M_START;
tok[tok_pos] = c;
tok_pos++;
break;
case '>':
- state = 4;
+ state = STATE_T_M_STOP_1;
tok[tok_pos] = c;
tok_pos++;
break;
case '/':
if (!in_comment)
- state = 5;
+ state = STATE_T_M_STOP_2;
tok[tok_pos] = c;
tok_pos++;
break;
case '=':
- state = 6;
+ state = STATE_T_EQUAL;
tok[tok_pos] = c;
tok_pos++;
break;
case '\"': /* " */
- state = 7;
+ state = STATE_T_STRING_DOUBLE;
break;
case '\'': /* " */
- state = 12;
+ state = STATE_T_STRING_SINGLE;
break;
case '-':
- state = 10;
+ state = STATE_T_DASHDASH;
tok[tok_pos] = c;
tok_pos++;
break;
case '?':
- state = 9;
+ if (!in_comment)
+ state = STATE_T_TI_STOP;
tok[tok_pos] = c;
tok_pos++;
break;
default:
- state = 100;
+ state = STATE_IDENT;
tok[tok_pos] = c;
tok_pos++;
break;
@@ -146,7 +168,7 @@ int lexer_get_token(char * tok, int tok_size) {
break;
/* end of line */
- case 1:
+ case STATE_EOL:
if (c == '\n' || (c == '\r')) {
tok[tok_pos] = c;
lexbuf_pos++;
@@ -158,7 +180,7 @@ int lexer_get_token(char * tok, int tok_size) {
break;
/* T_SEPAR */
- case 2:
+ case STATE_SEPAR:
if (c == ' ' || (c == '\t')) {
tok[tok_pos] = c;
lexbuf_pos++;
@@ -170,7 +192,7 @@ int lexer_get_token(char * tok, int tok_size) {
break;
/* T_M_START < or </ or <! or <? */
- case 3:
+ case STATE_T_M_START:
switch (c) {
case '/':
tok[tok_pos] = c;
@@ -183,7 +205,7 @@ int lexer_get_token(char * tok, int tok_size) {
tok[tok_pos] = c;
lexbuf_pos++;
tok_pos++;
- state = 8;
+ state = STATE_T_COMMENT;
break;
case '?':
tok[tok_pos] = c;
@@ -199,7 +221,7 @@ int lexer_get_token(char * tok, int tok_size) {
break;
/* T_M_STOP_1 */
- case 4:
+ case STATE_T_M_STOP_1:
tok[tok_pos] = '\0';
if (!in_comment)
lex_mode = DATA;
@@ -207,7 +229,7 @@ int lexer_get_token(char * tok, int tok_size) {
break;
/* T_M_STOP_2 */
- case 5:
+ case STATE_T_M_STOP_2:
if (c == '>') {
tok[tok_pos] = c;
lexbuf_pos++;
@@ -223,13 +245,13 @@ int lexer_get_token(char * tok, int tok_size) {
break;
/* T_EQUAL */
- case 6:
+ case STATE_T_EQUAL:
tok[tok_pos] = '\0';
return T_EQUAL;
break;
/* T_STRING */
- case 7:
+ case STATE_T_STRING_DOUBLE:
tok[tok_pos] = c;
lexbuf_pos++;
if (c == '\"') { /* " */
@@ -239,8 +261,8 @@ int lexer_get_token(char * tok, int tok_size) {
tok_pos++;
break;
- /* T_C_START or T_DOCTYPE_START */
- case 8:
+ /* T_C_START or T_DOCTYPE_START or T_CDATA_START */
+ case STATE_T_COMMENT:
switch (c) {
case '-':
lexbuf_pos++;
@@ -264,6 +286,17 @@ int lexer_get_token(char * tok, int tok_size) {
return T_ERROR;
}
break;
+ case '[':
+ lexbuf_pos++;
+ if (strncmp(lexbuf + lexbuf_pos, "CDATA[", 6) == 0) {
+ strncpy (tok + tok_pos, "[CDATA[", 7); /* FIXME */
+ lexbuf_pos += 6;
+ lex_mode = CDATA;
+ return T_CDATA_START;
+ } else{
+ return T_ERROR;
+ }
+ break;
default:
/* error */
return T_ERROR;
@@ -271,12 +304,14 @@ int lexer_get_token(char * tok, int tok_size) {
break;
/* T_TI_STOP */
- case 9:
+ case STATE_T_TI_STOP:
if (c == '>') {
tok[tok_pos] = c;
lexbuf_pos++;
tok_pos++; /* FIXME */
tok[tok_pos] = '\0';
+ if (!in_comment)
+ lex_mode = DATA;
return T_TI_STOP;
} else {
tok[tok_pos] = '\0';
@@ -285,24 +320,24 @@ int lexer_get_token(char * tok, int tok_size) {
break;
/* -- */
- case 10:
+ case STATE_T_DASHDASH:
switch (c) {
case '-':
tok[tok_pos] = c;
tok_pos++;
lexbuf_pos++;
- state = 11;
+ state = STATE_T_C_STOP;
break;
default:
tok[tok_pos] = c;
tok_pos++;
lexbuf_pos++;
- state = 100;
+ state = STATE_IDENT;
}
break;
/* --> */
- case 11:
+ case STATE_T_C_STOP:
switch (c) {
case '>':
tok[tok_pos] = c;
@@ -322,12 +357,12 @@ int lexer_get_token(char * tok, int tok_size) {
tok[tok_pos] = c;
tok_pos++;
lexbuf_pos++;
- state = 100;
+ state = STATE_IDENT;
}
break;
/* T_STRING (single quotes) */
- case 12:
+ case STATE_T_STRING_SINGLE:
tok[tok_pos] = c;
lexbuf_pos++;
if (c == '\'') { /* " */
@@ -338,7 +373,7 @@ int lexer_get_token(char * tok, int tok_size) {
break;
/* IDENT */
- case 100:
+ case STATE_IDENT:
switch (c) {
case '<':
case '>':
@@ -355,13 +390,13 @@ int lexer_get_token(char * tok, int tok_size) {
tok[tok_pos] = c;
tok_pos++;
lexbuf_pos++;
- state = 9;
+ state = STATE_T_TI_STOP;
break;
case '-':
tok[tok_pos] = c;
tok_pos++;
lexbuf_pos++;
- state = 10;
+ state = STATE_T_DASHDASH;
break;
default:
tok[tok_pos] = c;
@@ -373,8 +408,9 @@ int lexer_get_token(char * tok, int tok_size) {
lprintf("expected char \'%c\'\n", tok[tok_pos - 1]); /* FIX ME */
return T_ERROR;
}
- } else {
- /* data mode, stop if char equal '<' */
+ break;
+
+ case DATA: /* data mode, stop if char equal '<' */
switch (c)
{
case '<':
@@ -386,6 +422,28 @@ int lexer_get_token(char * tok, int tok_size) {
tok_pos++;
lexbuf_pos++;
}
+ break;
+
+ case CDATA: /* cdata mode, stop if next token is "]]>" */
+ switch (c)
+ {
+ case ']':
+ if (strncmp(lexbuf + lexbuf_pos, "]]>", 3) == 0) {
+ lexbuf_pos += 3;
+ lex_mode = DATA;
+ return T_CDATA_STOP;
+ } else {
+ tok[tok_pos] = c;
+ tok_pos++;
+ lexbuf_pos++;
+ }
+ break;
+ default:
+ tok[tok_pos] = c;
+ tok_pos++;
+ lexbuf_pos++;
+ }
+ break;
}
}
lprintf ("loop done tok_pos = %d, tok_size=%d, lexbuf_pos=%d, lexbuf_size=%d\n",
diff --git a/src/xine-utils/xmllexer.h b/src/xine-utils/xmllexer.h
index 5a217fcd8..524049a44 100644
--- a/src/xine-utils/xmllexer.h
+++ b/src/xine-utils/xmllexer.h
@@ -50,6 +50,8 @@
#define T_TI_STOP 15 /* ?> */
#define T_DOCTYPE_START 16 /* <!DOCTYPE */
#define T_DOCTYPE_STOP 17 /* > */
+#define T_CDATA_START 18 /* <![CDATA[ */
+#define T_CDATA_STOP 19 /* ]]> */
/* public functions */
diff --git a/src/xine-utils/xmlparser.c b/src/xine-utils/xmlparser.c
index 2ace4aba1..66ab28ce4 100644
--- a/src/xine-utils/xmlparser.c
+++ b/src/xine-utils/xmlparser.c
@@ -22,6 +22,10 @@
*
*/
+#ifdef XINE_COMPILE
+# include "config.h"
+#endif
+
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
@@ -76,8 +80,11 @@ static xml_node_t * new_xml_node(void) {
return new_node;
}
+static const char cdata[] = CDATA_MARKER;
+
static void free_xml_node(xml_node_t * node) {
- free (node->name);
+ if (node->name != cdata)
+ free (node->name);
free (node->data);
free(node);
}
@@ -152,18 +159,79 @@ void xml_parser_free_tree(xml_node_t *current_node) {
xml_parser_free_tree_rec(current_node, 1);
}
-#define STATE_IDLE 0
-#define STATE_NODE 1
-#define STATE_COMMENT 7
+typedef enum {
+ /*0*/
+ STATE_IDLE,
+ /* <foo ...> */
+ STATE_NODE,
+ STATE_ATTRIBUTE,
+ STATE_NODE_CLOSE,
+ STATE_TAG_TERM,
+ STATE_ATTRIBUTE_EQUALS,
+ STATE_STRING,
+ STATE_TAG_TERM_IGNORE,
+ /* <?foo ...?> */
+ STATE_Q_NODE,
+ STATE_Q_ATTRIBUTE,
+ STATE_Q_NODE_CLOSE,
+ STATE_Q_TAG_TERM,
+ STATE_Q_ATTRIBUTE_EQUALS,
+ STATE_Q_STRING,
+ /* Others */
+ STATE_COMMENT,
+ STATE_DOCTYPE,
+ STATE_CDATA,
+} parser_state_t;
+
+static xml_node_t *xml_parser_append_text (xml_node_t *node, xml_node_t *subnode, const char *text, int flags)
+{
+ if (!text || !*text)
+ return subnode; /* empty string -> nothing to do */
+
+ if ((flags & XML_PARSER_MULTI_TEXT) && subnode) {
+ /* we have a subtree, so we can't use node->data */
+ if (subnode->name == cdata) {
+ /* most recent node is CDATA - append to it */
+ char *newtext;
+ asprintf (&newtext, "%s%s", subnode->data, text);
+ free (subnode->data);
+ subnode->data = newtext;
+ } else {
+ /* most recent node is not CDATA - add a sibling */
+ subnode->next = new_xml_node ();
+ subnode->next->name = cdata;
+ subnode->next->data = strdup (text);
+ subnode = subnode->next;
+ }
+ } else if (node->data) {
+ /* "no" subtree, but we have existing text - append to it */
+ char *newtext;
+ asprintf (&newtext, "%s%s", node->data, text);
+ free (node->data);
+ node->data = newtext;
+ } else {
+ /* no text, "no" subtree - duplicate & assign */
+ while (isspace (*text))
+ ++text;
+ if (*text)
+ node->data = strdup (text);
+ }
+
+ return subnode;
+}
+
+#define Q_STATE(CURRENT,NEW) (STATE_##NEW + state - STATE_##CURRENT)
-static int xml_parser_get_node (xml_node_t *current_node, char *root_name, int rec) {
+static int xml_parser_get_node_internal (xml_node_t *current_node, char *root_names[], int rec, int flags)
+{
char tok[TOKEN_SIZE];
char property_name[TOKEN_SIZE];
char node_name[TOKEN_SIZE];
- int state = STATE_IDLE;
+ parser_state_t state = STATE_IDLE;
int res = 0;
int parse_res;
int bypass_get_token = 0;
+ int retval = 0; /* used when state==4; non-0 if there are missing </...> */
xml_node_t *subtree = NULL;
xml_node_t *current_subtree = NULL;
xml_property_t *current_property = NULL;
@@ -185,30 +253,33 @@ static int xml_parser_get_node (xml_node_t *current_node, char *root_name, int r
/* do nothing */
break;
case (T_EOF):
- return 0; /* normal end */
+ return retval; /* normal end */
break;
case (T_M_START_1):
state = STATE_NODE;
break;
case (T_M_START_2):
- state = 3;
+ state = STATE_NODE_CLOSE;
break;
case (T_C_START):
state = STATE_COMMENT;
break;
case (T_TI_START):
- state = 8;
+ state = STATE_Q_NODE;
break;
case (T_DOCTYPE_START):
- state = 9;
+ state = STATE_DOCTYPE;
+ break;
+ case (T_CDATA_START):
+ state = STATE_CDATA;
break;
case (T_DATA):
/* current data */
- if (current_node->data) {
- /* avoid a memory leak */
- free(current_node->data);
+ {
+ char *decoded = lexer_decode_entities (tok);
+ current_subtree = xml_parser_append_text (current_node, current_subtree, decoded, flags);
+ free (decoded);
}
- current_node->data = lexer_decode_entities(tok);
lprintf("info: node data : %s\n", current_node->data);
break;
default:
@@ -219,6 +290,7 @@ static int xml_parser_get_node (xml_node_t *current_node, char *root_name, int r
break;
case STATE_NODE:
+ case STATE_Q_NODE:
switch (res) {
case (T_IDENT):
properties = NULL;
@@ -228,8 +300,13 @@ static int xml_parser_get_node (xml_node_t *current_node, char *root_name, int r
if (xml_parser_mode == XML_PARSER_CASE_INSENSITIVE) {
strtoupper(tok);
}
- strcpy(node_name, tok);
- state = 2;
+ if (state == STATE_Q_NODE) {
+ snprintf (node_name, TOKEN_SIZE, "?%s", tok);
+ state = STATE_Q_ATTRIBUTE;
+ } else {
+ strcpy(node_name, tok);
+ state = STATE_ATTRIBUTE;
+ }
lprintf("info: current node name \"%s\"\n", node_name);
break;
default:
@@ -238,7 +315,8 @@ static int xml_parser_get_node (xml_node_t *current_node, char *root_name, int r
break;
}
break;
- case 2:
+
+ case STATE_ATTRIBUTE:
switch (res) {
case (T_EOL):
case (T_SEPAR):
@@ -254,8 +332,9 @@ static int xml_parser_get_node (xml_node_t *current_node, char *root_name, int r
/* set node propertys */
subtree->props = properties;
lprintf("info: rec %d new subtree %s\n", rec, node_name);
- parse_res = xml_parser_get_node(subtree, node_name, rec + 1);
- if (parse_res != 0) {
+ root_names[rec + 1] = node_name;
+ parse_res = xml_parser_get_node_internal(subtree, root_names, rec + 1, flags);
+ if (parse_res == -1 || parse_res > 0) {
return parse_res;
}
if (current_subtree == NULL) {
@@ -265,11 +344,16 @@ static int xml_parser_get_node (xml_node_t *current_node, char *root_name, int r
current_subtree->next = subtree;
current_subtree = subtree;
}
+ if (parse_res < -1) {
+ /* badly-formed XML (missing close tag) */
+ return parse_res + 1 + (parse_res == -2);
+ }
state = STATE_IDLE;
break;
case (T_M_STOP_2):
/* new leaf */
/* new subtree */
+ new_leaf:
subtree = new_xml_node();
/* set node name */
@@ -291,11 +375,12 @@ static int xml_parser_get_node (xml_node_t *current_node, char *root_name, int r
break;
case (T_IDENT):
/* save property name */
+ new_prop:
if (xml_parser_mode == XML_PARSER_CASE_INSENSITIVE) {
strtoupper(tok);
}
strcpy(property_name, tok);
- state = 5;
+ state = Q_STATE(ATTRIBUTE, ATTRIBUTE_EQUALS);
lprintf("info: current property name \"%s\"\n", property_name);
break;
default:
@@ -305,17 +390,50 @@ static int xml_parser_get_node (xml_node_t *current_node, char *root_name, int r
}
break;
- case 3:
+ case STATE_Q_ATTRIBUTE:
+ switch (res) {
+ case (T_EOL):
+ case (T_SEPAR):
+ /* nothing */
+ break;
+ case (T_TI_STOP):
+ goto new_leaf;
+ case (T_IDENT):
+ goto new_prop;
+ default:
+ lprintf("error: unexpected token \"%s\", state %d\n", tok, state);
+ return -1;
+ break;
+ }
+ break;
+
+ case STATE_NODE_CLOSE:
switch (res) {
case (T_IDENT):
/* must be equal to root_name */
if (xml_parser_mode == XML_PARSER_CASE_INSENSITIVE) {
strtoupper(tok);
}
- if (strcmp(tok, root_name) == 0) {
- state = 4;
- } else {
- lprintf("error: xml struct, tok=%s, waited_tok=%s\n", tok, root_name);
+ if (strcmp(tok, root_names[rec]) == 0) {
+ state = STATE_TAG_TERM;
+ } else if (flags & XML_PARSER_RELAXED) {
+ int r = rec;
+ while (--r >= 0)
+ if (strcmp(tok, root_names[r]) == 0) {
+ lprintf("warning: wanted %s, got %s - assuming missing close tags\n", root_names[rec], tok);
+ retval = r - rec - 1; /* -1 - (no. of implied close tags) */
+ state = STATE_TAG_TERM;
+ break;
+ }
+ /* relaxed parsing, ignoring extra close tag (but we don't handle out-of-order) */
+ if (r < 0) {
+ lprintf("warning: extra close tag %s - ignoring\n", tok);
+ state = STATE_TAG_TERM_IGNORE;
+ }
+ }
+ else
+ {
+ lprintf("error: xml struct, tok=%s, waited_tok=%s\n", tok, root_names[rec]);
return -1;
}
break;
@@ -327,10 +445,10 @@ static int xml_parser_get_node (xml_node_t *current_node, char *root_name, int r
break;
/* > expected */
- case 4:
+ case STATE_TAG_TERM:
switch (res) {
case (T_M_STOP_1):
- return 0;
+ return retval;
break;
default:
lprintf("error: unexpected token \"%s\", state %d\n", tok, state);
@@ -340,18 +458,18 @@ static int xml_parser_get_node (xml_node_t *current_node, char *root_name, int r
break;
/* = or > or ident or separator expected */
- case 5:
+ case STATE_ATTRIBUTE_EQUALS:
switch (res) {
case (T_EOL):
case (T_SEPAR):
/* do nothing */
break;
case (T_EQUAL):
- state = 6;
+ state = STATE_STRING;
break;
case (T_IDENT):
bypass_get_token = 1; /* jump to state 2 without get a new token */
- state = 2;
+ state = STATE_ATTRIBUTE;
break;
case (T_M_STOP_1):
/* add a new property without value */
@@ -365,7 +483,42 @@ static int xml_parser_get_node (xml_node_t *current_node, char *root_name, int r
current_property->name = strdup (property_name);
lprintf("info: new property %s\n", current_property->name);
bypass_get_token = 1; /* jump to state 2 without get a new token */
- state = 2;
+ state = STATE_ATTRIBUTE;
+ break;
+ default:
+ lprintf("error: unexpected token \"%s\", state %d\n", tok, state);
+ return -1;
+ break;
+ }
+ break;
+
+ /* = or ?> or ident or separator expected */
+ case STATE_Q_ATTRIBUTE_EQUALS:
+ switch (res) {
+ case (T_EOL):
+ case (T_SEPAR):
+ /* do nothing */
+ break;
+ case (T_EQUAL):
+ state = STATE_Q_STRING;
+ break;
+ case (T_IDENT):
+ bypass_get_token = 1; /* jump to state 2 without get a new token */
+ state = STATE_Q_ATTRIBUTE;
+ break;
+ case (T_TI_STOP):
+ /* add a new property without value */
+ if (current_property == NULL) {
+ properties = new_xml_property();
+ current_property = properties;
+ } else {
+ current_property->next = new_xml_property();
+ current_property = current_property->next;
+ }
+ current_property->name = strdup (property_name);
+ lprintf("info: new property %s\n", current_property->name);
+ bypass_get_token = 1; /* jump to state 2 without get a new token */
+ state = STATE_Q_ATTRIBUTE;
break;
default:
lprintf("error: unexpected token \"%s\", state %d\n", tok, state);
@@ -375,7 +528,8 @@ static int xml_parser_get_node (xml_node_t *current_node, char *root_name, int r
break;
/* string or ident or separator expected */
- case 6:
+ case STATE_STRING:
+ case STATE_Q_STRING:
switch (res) {
case (T_EOL):
case (T_SEPAR):
@@ -394,7 +548,7 @@ static int xml_parser_get_node (xml_node_t *current_node, char *root_name, int r
current_property->name = strdup(property_name);
current_property->value = lexer_decode_entities(tok);
lprintf("info: new property %s=%s\n", current_property->name, current_property->value);
- state = 2;
+ state = Q_STATE(STRING, ATTRIBUTE);
break;
default:
lprintf("error: unexpected token \"%s\", state %d\n", tok, state);
@@ -410,31 +564,45 @@ static int xml_parser_get_node (xml_node_t *current_node, char *root_name, int r
state = STATE_IDLE;
break;
default:
- state = STATE_COMMENT;
break;
}
break;
- /* ?> expected */
- case 8:
+ /* > expected */
+ case STATE_DOCTYPE:
switch (res) {
- case (T_TI_STOP):
+ case (T_M_STOP_1):
state = 0;
break;
default:
- state = 8;
break;
}
break;
- /* > expected */
- case 9:
+ /* ]]> expected */
+ case STATE_CDATA:
+ switch (res) {
+ case (T_CDATA_STOP):
+ current_subtree = xml_parser_append_text (current_node, current_subtree, tok, flags);
+ lprintf("info: node cdata : %s\n", tok);
+ state = STATE_IDLE;
+ break;
+ default:
+ lprintf("error: unexpected token \"%s\", state %d\n", tok, state);
+ return -1;
+ break;
+ }
+ break;
+
+ /* > expected (following unmatched "</...") */
+ case STATE_TAG_TERM_IGNORE:
switch (res) {
case (T_M_STOP_1):
- state = 0;
+ state = STATE_IDLE;
break;
default:
- state = 9;
+ lprintf("error: unexpected token \"%s\", state %d\n", tok, state);
+ return -1;
break;
}
break;
@@ -455,14 +623,51 @@ static int xml_parser_get_node (xml_node_t *current_node, char *root_name, int r
}
}
-int xml_parser_build_tree(xml_node_t **root_node) {
- xml_node_t *tmp_node;
+static int xml_parser_get_node (xml_node_t *current_node, int flags)
+{
+ char *root_names[MAX_RECURSION + 1];
+ root_names[0] = "";
+ return xml_parser_get_node_internal (current_node, root_names, 0, flags);
+}
+
+int xml_parser_build_tree_with_options(xml_node_t **root_node, int flags) {
+ xml_node_t *tmp_node, *pri_node, *q_node;
int res;
tmp_node = new_xml_node();
- res = xml_parser_get_node(tmp_node, "", 0);
- if ((tmp_node->child) && (!tmp_node->child->next)) {
- *root_node = tmp_node->child;
+ res = xml_parser_get_node(tmp_node, flags);
+
+ /* delete any top-level [CDATA] nodes */;
+ pri_node = tmp_node->child;
+ q_node = NULL;
+ while (pri_node) {
+ if (pri_node->name == cdata) {
+ xml_node_t *old = pri_node;
+ if (q_node)
+ q_node->next = pri_node->next;
+ else
+ q_node = pri_node;
+ pri_node = pri_node->next;
+ free_xml_node (old);
+ } else {
+ q_node = pri_node;
+ pri_node = pri_node->next;
+ }
+ }
+
+ /* find first non-<?...?> node */;
+ for (pri_node = tmp_node->child, q_node = NULL;
+ pri_node && pri_node->name[0] == '?';
+ pri_node = pri_node->next)
+ q_node = pri_node; /* last <?...?> node (eventually), or NULL */
+
+ if (pri_node && !pri_node->next) {
+ /* move the tail to the head (for compatibility reasons) */
+ if (q_node) {
+ pri_node->next = tmp_node->child;
+ q_node->next = NULL;
+ }
+ *root_node = pri_node;
free_xml_node(tmp_node);
res = 0;
} else {
@@ -473,6 +678,10 @@ int xml_parser_build_tree(xml_node_t **root_node) {
return res;
}
+int xml_parser_build_tree(xml_node_t **root_node) {
+ return xml_parser_build_tree_with_options (root_node, 0);
+}
+
const char *xml_parser_get_property (const xml_node_t *node, const char *name) {
xml_property_t *prop;
@@ -591,5 +800,8 @@ static void xml_parser_dump_node (const xml_node_t *node, int indent) {
}
void xml_parser_dump_tree (const xml_node_t *node) {
- xml_parser_dump_node (node, 0);
+ do {
+ xml_parser_dump_node (node, 0);
+ node = node->next;
+ } while (node);
}
diff --git a/src/xine-utils/xmlparser.h b/src/xine-utils/xmlparser.h
index f202ca28d..420f2c36c 100644
--- a/src/xine-utils/xmlparser.h
+++ b/src/xine-utils/xmlparser.h
@@ -37,6 +37,12 @@
#define XML_PARSER_OK 0
#define XML_PARSER_ERROR 1
+/* xml_parser_build_tree_with_options flag bits */
+#define XML_PARSER_RELAXED 1
+#define XML_PARSER_MULTI_TEXT 2
+
+/* node name for extra text chunks */
+#define CDATA_MARKER "[CDATA]"
/* xml property */
typedef struct xml_property_s {
@@ -46,6 +52,14 @@ typedef struct xml_property_s {
} xml_property_t;
/* xml node */
+/* .data contains any text which precedes any subtree elements;
+ * subtree elements may also contain only text; if so, name is "[CDATA]".
+ * e.g. <a>b<c />d</a>
+ * node1: .name="a" .data="b" .child=node2 .next=NULL
+ * node2: .name="c" .data=NULL .child=NULL .next=node3
+ * node3: .name="[CDATA]" .data="d" .child=NULL .next=NULL
+ * Adjacent text items are merged.
+ */
typedef struct xml_node_s {
char *name;
char *data;
@@ -57,6 +71,7 @@ typedef struct xml_node_s {
void xml_parser_init(const char * buf, int size, int mode) XINE_PROTECTED;
int xml_parser_build_tree(xml_node_t **root_node) XINE_PROTECTED;
+int xml_parser_build_tree_with_options(xml_node_t **root_node, int flags) XINE_PROTECTED;
void xml_parser_free_tree(xml_node_t *root_node) XINE_PROTECTED;